Esempio n. 1
0
        public static Boolean Evaluate(Object state, ref Boolean error)
        {
            Combat.Character character = state as Combat.Character;
            if (character == null)
            {
                error = true;
                return(false);
            }

            foreach (Combat.Entity entity in character.Engine.Entities)
            {
                Combat.Character opp = character.FilterEntityAsCharacter(entity, AffectTeam.Enemy);
                if (opp != null && opp.OffensiveInfo.ActiveHitDef == true && InGuardDistance(opp.OffensiveInfo.HitDef, opp, character) == true)
                {
                    return(true);
                }

                Combat.Projectile projectile = entity as Combat.Projectile;
                if (projectile != null && projectile.Team != character.Team && InGuardDistance(projectile.Data.HitDef, projectile, character) == true)
                {
                    return(true);
                }
            }

            return(false);
        }
Esempio n. 2
0
        public static Int32 Evaluate(Object state, ref Boolean error)
        {
            Combat.Character character = state as Combat.Character;
            if (character == null)
            {
                error = true;
                return(0);
            }

            Int32 count = 0;
            Action <Combat.Player> func = player =>
            {
                if (player != null && character.FilterEntityAsCharacter(player, AffectTeam.Enemy) != null)
                {
                    ++count;
                }
            };

            func(character.Engine.Team1.MainPlayer);
            func(character.Engine.Team2.MainPlayer);
            func(character.Engine.Team1.TeamMate);
            func(character.Engine.Team2.TeamMate);

            return(count);
        }
Esempio n. 3
0
        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);
        }