|
更明顯的顔色
// 作者:<TW>希多
// 日期:108.09.10
// 說明:顯示蟲洞效果的圈圈。(含聲音提示)
// 參考檔案:
// 參考路徑:
// 版本:
using System.Linq;
using Turbo.Plugins.Default;
namespace Turbo.Plugins.User
{
public class WormHolePlugin : BasePlugin, IInGameWorldPainter
{
public WorldDecoratorCollection WormHoleDecorator { get; set; }
public WormHolePlugin()
{
Enabled = true;
}
public override void Load(IController hud)
{
base.Load(hud);
WormHoleDecorator = new WorldDecoratorCollection(
new MapShapeDecorator(Hud)
{
Brush = Hud.Render.CreateBrush(220, 255, 0, 255, 1),
Radius = 8.0f,
ShapePainter = new CircleShapePainter(Hud),
},
new GroundCircleDecorator(Hud)
{
Brush = Hud.Render.CreateBrush(255, 255, 0, 255, 3),
Radius = -1,
},
new GroundShapeDecorator(Hud)
{
Brush = Hud.Render.CreateBrush(255, 255, 0, 0, 3f),
ShapePainter = WorldStarShapePainter.NewTripleTriangle(Hud),
RotationTransformator = new CircularRotationTransformator(Hud, 30),
Radius = 5f
},
new GroundLabelDecorator(Hud)
{
CountDownFrom = 2,
TextFont = Hud.Render.CreateFont("tahoma", 14, 255, 255, 250, 250, false, false, 128, 0, 0, 0, true),
}
);
}
public void PaintWorld(WorldLayer layer)
{
if (Hud.Game.IsInTown) return;
var actors = Hud.Game.Actors.Where(a => a.SnoActor.Sno == ActorSnoEnum._x1_monsteraffix_teleportmines);
foreach (var actor in actors)
{
if (actor.LastSpeak == null && Hud.Sound.LastSpeak.TimerTest(2000))
{
Hud.Sound.Speak("小心蟲洞!");
actor.LastSpeak = Hud.Time.CreateAndStartWatch();
}
WormHoleDecorator.Paint(layer, actor, actor.FloorCoordinate, string.Empty);
}
}
// Func End
}
}
|
|