/// <summary> /// /// </summary> /// <returns></returns> public override bool OnTeamEnter() { if (!AffectTeam) { return(false); } Team team = GameScreen.Team; switch (Type) { case ForceFieldType.Spin: { team.Location.Direction = Compass.Rotate(team.Location.Direction, Spin); } break; case ForceFieldType.Move: { team.Offset(Direction, 1); } break; case ForceFieldType.FaceTo: { team.Location.Direction = Direction; } break; } return(true); }
/// <summary> /// /// </summary> /// <param name="monster"></param> /// <returns></returns> public override bool OnMonsterEnter(Monster monster) { if (!AffectMonsters || monster == null) { return(false); } switch (Type) { case ForceFieldType.Spin: { monster.Location.Direction = Compass.Rotate(monster.Location.Direction, Spin); } break; case ForceFieldType.Move: { switch (Direction) { case CardinalPoint.North: monster.Location.Coordinate.Offset(0, -1); break; case CardinalPoint.South: monster.Location.Coordinate.Offset(0, 1); break; case CardinalPoint.West: monster.Location.Coordinate.Offset(-1, 0); break; case CardinalPoint.East: monster.Location.Coordinate.Offset(1, 0); break; } } break; case ForceFieldType.FaceTo: { monster.Location.Direction = Direction; } break; } return(true); }