/
LowHealthmonstersCircleplugin.cs
47 lines (36 loc) · 1.19 KB
/
LowHealthmonstersCircleplugin.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using Turbo.Plugins.Default;
namespace Turbo.Plugins.Stone
{
public class LowHealthmonstersCircleplugin : BasePlugin, IInGameWorldPainter
{
public WorldDecoratorCollection LowHealthDecorator { get; set; }
public int LowHealthLimit { get; set; }
public LowHealthmonstersCircleplugin()
{
Enabled = true;
}
public override void Load(IController hud)
{
base.Load(hud);
LowHealthLimit = 15;
LowHealthDecorator = new WorldDecoratorCollection(
new GroundCircleDecorator(Hud)
{
Brush = Hud.Render.CreateBrush(255, 255, 0, 0, 10f),
Radius = 0.5f,
}
);
}
public void PaintWorld(WorldLayer layer)
{
var monsters = Hud.Game.AliveMonsters;
foreach (var monster in monsters)
{
if (monster.CurHealth / monster.MaxHealth * 100 <= LowHealthLimit)
{
LowHealthDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
}
}
}
}
}