Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections.Generic;
- using Turbo.Plugins.Default;
- using System.Linq;
- using System;
- namespace Turbo.Plugins.DavMonster
- {
- public class DAV_SpecMonsterPlugin : BasePlugin, IInGameWorldPainter {
- public float xPos { get; set; }
- public float yPos { get; set; }
- public List<DAV_SpecMon> SpMonsterList { get; set; } = new List<DAV_SpecMon>();
- public DAV_SpecMonsterPlugin() {
- Enabled = true;
- Order = 2005;
- }
- public override void Load(IController hud) {
- base.Load(hud);
- xPos = Hud.Window.Size.Width * 0.7f;
- yPos = Hud.Window.Size.Height * 0.4f;
- var tmpFont = Hud.Render.CreateFont("arial", 8, 255, 0, 255, 0, true, false, true);
- SpMonsterList.Add(new DAV_SpecMon("召喚師") { // Summoner
- showCustName = true, // customized name on decorator (if apply), show full localized name if false
- showCount = true,
- offsetZ = 3f, // greater than 0 if GroundLabelDecorator exist
- textFont = tmpFont,
- Members = new List<ActorSnoEnum> {
- ActorSnoEnum._skeletonsummoner_a, ActorSnoEnum._skeletonsummoner_b, ActorSnoEnum._skeletonsummoner_c,
- ActorSnoEnum._skeletonsummoner_d, ActorSnoEnum._skeletonsummoner_e
- },
- Decorator = new WorldDecoratorCollection(
- new GroundLabelDecorator(Hud) {
- BackgroundBrush = Hud.Render.CreateBrush(200, 178, 255, 102, 0),
- TextFont = Hud.Render.CreateFont("tahoma", 6.5f, 255, 255, 255, 255, false, false, false),
- },
- new MapShapeDecorator(Hud) {
- Brush = Hud.Render.CreateBrush(220, 255, 255, 0, 3f),
- ShapePainter = new RectangleShapePainter(Hud),
- Radius = 8
- }
- )
- });
- SpMonsterList.Add(new DAV_SpecMon("嘔吐女屍") { // Retching Cadaver
- showCustName = true,
- showCount = true,
- offsetZ = 3f,
- textFont = tmpFont,
- Members = new List<ActorSnoEnum> {
- ActorSnoEnum._zombiefemale_a, ActorSnoEnum._zombiefemale_b, ActorSnoEnum._zombiefemale_c,
- ActorSnoEnum._zombiefemale_d, ActorSnoEnum._zombiefemale_spitter_a,
- },
- Decorator = new WorldDecoratorCollection(
- new GroundLabelDecorator(Hud) {
- BackgroundBrush = Hud.Render.CreateBrush(200, 178, 255, 102, 0),
- TextFont = Hud.Render.CreateFont("tahoma", 6.5f, 255, 255, 255, 255, false, false, false),
- },
- new MapShapeDecorator(Hud) {
- Brush = Hud.Render.CreateBrush(220, 255, 51, 153, 3f),
- ShapePainter = new TriangleShapePainter(Hud),
- Radius = 8
- }
- )
- });
- SpMonsterList.Add(new DAV_SpecMon("召喚師") { // Triune Summoner
- showCustName = true,
- showCount = true,
- offsetZ = 3f,
- textFont = tmpFont,
- Members = new List<ActorSnoEnum> {
- ActorSnoEnum._triunesummoner_a, ActorSnoEnum._triunesummoner_b, ActorSnoEnum._triunesummoner_c, ActorSnoEnum._triunesummoner_d
- },
- Decorator = new WorldDecoratorCollection(
- new GroundLabelDecorator(Hud) {
- BackgroundBrush = Hud.Render.CreateBrush(200, 178, 255, 102, 0),
- TextFont = Hud.Render.CreateFont("tahoma", 6.5f, 255, 255, 255, 255, false, false, false),
- },
- new MapShapeDecorator(Hud) {
- Brush = Hud.Render.CreateBrush(220, 51, 153, 255, 3f),
- ShapePainter = new TriangleShapePainter(Hud),
- Radius = 8
- }
- )
- });
- SpMonsterList.Add(new DAV_SpecMon("變身哥") { // Dark Vessel
- showCustName = true,
- showCount = true,
- offsetZ = 3f,
- textFont = tmpFont,
- Members = new List<ActorSnoEnum> {
- ActorSnoEnum._triunevessel_a,
- },
- Decorator = new WorldDecoratorCollection(
- new GroundCircleDecorator(Hud) {
- Brush = Hud.Render.CreateBrush(255, 255, 255, 0, 2, SharpDX.Direct2D1.DashStyle.Dash),
- Radius = 2,
- },
- new MapShapeDecorator(Hud) {
- Brush = Hud.Render.CreateBrush(255, 255, 255, 0, 3f),
- ShapePainter = new CircleShapePainter(Hud),
- Radius = 8,
- }
- )
- });
- SpMonsterList.Add(new DAV_SpecMon("蛆蟲巢獸") { // Maggot Brood
- showCustName = true,
- showCount = true,
- offsetZ = 3f,
- textFont = tmpFont,
- Members = new List<ActorSnoEnum> {
- ActorSnoEnum._p1_lr_bogblight_a,
- },
- Decorator = new WorldDecoratorCollection(
- new GroundLabelDecorator(Hud) {
- BackgroundBrush = Hud.Render.CreateBrush(200, 178, 255, 102, 0),
- TextFont = Hud.Render.CreateFont("tahoma", 6.5f, 255, 255, 255, 255, false, false, false),
- },
- new MapShapeDecorator(Hud) {
- Brush = Hud.Render.CreateBrush(220, 255, 51, 153, 3f),
- ShapePainter = new PlusShapePainter(Hud),
- Radius = 8
- }
- )
- });
- // ActorSnoEnum._x1_plagued_lacunimale_a // Rat Caller
- SpMonsterList.Add(new DAV_SpecMon("蠻牛獸") { // Beast
- showCustName = true,
- showCount = false,
- offsetZ = 3f,
- textFont = tmpFont,
- Members = new List<ActorSnoEnum> {
- ActorSnoEnum._beast_a, ActorSnoEnum._beast_b, ActorSnoEnum._beast_c, ActorSnoEnum._beast_d,
- ActorSnoEnum._x1_beast_skeleton_a
- },
- Decorator = new WorldDecoratorCollection(
- new GroundLabelDecorator(Hud) {
- BackgroundBrush = Hud.Render.CreateBrush(200, 255, 178, 102, 0),
- TextFont = Hud.Render.CreateFont("tahoma", 6.5f, 255, 255, 255, 255, false, false, false),
- },
- new MapShapeDecorator(Hud) {
- Brush = Hud.Render.CreateBrush(220, 255, 125, 0, 3f),
- ShapePainter = new CrossShapePainter(Hud),
- Radius = 8
- }
- )
- });
- SpMonsterList.Add(new DAV_SpecMon("Other Bad Monster") {
- showCustName = false,
- showCount = false,
- offsetZ = 3f,
- textFont = tmpFont,
- Members = new List<ActorSnoEnum> {
- ActorSnoEnum._x1_bogfamily_brute_a, // Tusked Bogan
- ActorSnoEnum._p1_lr_sandmonster_a, ActorSnoEnum._sandmonster_b, ActorSnoEnum._sandmonster_a_gauntlet, ActorSnoEnum._p1_lr_sandmonster_a, // Sand Dweller
- ActorSnoEnum._dunedervish_b, ActorSnoEnum._dunedervish_c, // Dune Dervish
- ActorSnoEnum._malletdemon_a // Mallet Lord
- },
- Decorator = new WorldDecoratorCollection(
- new GroundLabelDecorator(Hud) {
- BackgroundBrush = Hud.Render.CreateBrush(200, 255, 178, 102, 0),
- TextFont = Hud.Render.CreateFont("tahoma", 6.5f, 255, 255, 255, 255, false, false, false),
- },
- new MapLabelDecorator(Hud) {
- LabelFont = Hud.Render.CreateFont("tahoma", 6f, 200, 255, 178, 102, false, false, 128, 0, 0, 0, true),
- Up = true,
- }
- )
- });
- }
- public void PaintWorld(WorldLayer layer) {
- var uiMinimapRect = Hud.Render.MinimapUiElement.Rectangle;
- var xref = uiMinimapRect.Left;
- var yref = uiMinimapRect.Bottom;
- foreach (var spMon in SpMonsterList) {
- var monsters = Hud.Game.AliveMonsters.Where(x => spMon.Members.Contains(x.SnoActor.Sno));
- var spCount = monsters.Count();
- if (spCount == 0) continue;
- spMon.PaintCount(spCount, xref, ref yref);
- foreach (var monster in monsters)
- spMon.Paint(layer, monster);
- }
- }
- }
- public class DAV_SpecMon {
- public bool showCustName { get; set; }
- public string NameCustomized { get; set; }
- public List<ActorSnoEnum> Members { get; set; }
- public float offsetZ { get; set; }
- public bool showCount { get; set; }
- public IFont textFont { get; set; }
- public WorldDecoratorCollection Decorator { get; set; }
- public DAV_SpecMon(string cust) {
- NameCustomized = cust;
- }
- public void AddMember(params ActorSnoEnum[] members) {
- foreach (var member in members)
- Members.Add(member);
- }
- public void PaintCount(int count, float x, ref float y) {
- if (!showCount) return;
- var message = NameCustomized + " : " + count;
- var layout = textFont.GetTextLayout(message);
- y -= layout.Metrics.Height;
- textFont.DrawText(layout, x, y);
- }
- public void Paint(WorldLayer layer, IMonster monster) {
- if (Decorator == null) return;
- Decorator.Paint(layer, monster, monster.FloorCoordinate.Offset(0, 0, offsetZ), (showCustName ? NameCustomized : monster.SnoMonster.NameLocalized));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement