public void RunScripts() { if (Script.Length > 0) { TriggerHandler.HandleTriggers(Script); } }
public void Move() { if (IsCasting || GamePlay.Collided(this, Speed, MoveDir)) { return; } if (MoveDir == Dir.Up) { OffSet.Y -= Speed; if (OffSet.Y <= -Globals.TileSize) { CurPos.Y -= 1; OffSet.Y = 0; if (this == Game.Player && Game.World.TileList[CurPos.X, CurPos.Y].StepTrigger) { TriggerHandler.HandleTriggers(Game.World.TileList[CurPos.X, CurPos.Y].Script); } } } else if (MoveDir == Dir.Down) { OffSet.Y += Speed; if (OffSet.Y >= Globals.TileSize) { CurPos.Y += 1; OffSet.Y = 0; if (this == Game.Player && Game.World.TileList[CurPos.X, CurPos.Y].StepTrigger) { TriggerHandler.HandleTriggers(Game.World.TileList[CurPos.X, CurPos.Y].Script); } } } else if (MoveDir == Dir.Left) { OffSet.X -= Speed; if (OffSet.X <= -Globals.TileSize) { CurPos.X -= 1; OffSet.X = 0; if (this == Game.Player && Game.World.TileList[CurPos.X, CurPos.Y].StepTrigger) { TriggerHandler.HandleTriggers(Game.World.TileList[CurPos.X, CurPos.Y].Script); } } } else if (MoveDir == Dir.Right) { OffSet.X += Speed; if (OffSet.X >= Globals.TileSize) { CurPos.X += 1; OffSet.X = 0; if (this == Game.Player && Game.World.TileList[CurPos.X, CurPos.Y].StepTrigger) { TriggerHandler.HandleTriggers(Game.World.TileList[CurPos.X, CurPos.Y].Script); } } } }