public static Object RedirectState(Object state, ref Boolean error, Int32 nth) { Combat.Character character = state as Combat.Character; if (character == null) { error = true; return(null); } Int32 count = 0; foreach (Combat.Entity entity in character.Engine.Entities) { Combat.Character enemy = character.FilterEntityAsCharacter(entity, AffectTeam.Enemy); if (enemy == null) { continue; } Combat.Player enemyplayer = enemy as Combat.Player; if (enemyplayer == null) { continue; } if (count != nth) { ++count; continue; } return(enemy); } error = true; return(null); }
public static Boolean Evaluate(Object state, ref Boolean error, Operator @operator, String text) { Combat.Character character = state as Combat.Character; if (character == null) { error = true; return(false); } Combat.Player p3 = character.Team.TeamMate; switch (@operator) { case Operator.Equals: return((p3 != null) ? String.Equals(p3.Profile.PlayerName, text, StringComparison.OrdinalIgnoreCase) : false); case Operator.NotEquals: return((p3 != null) ? !String.Equals(p3.Profile.PlayerName, text, StringComparison.OrdinalIgnoreCase) : true); default: error = true; return(false); } }