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

            Combat.Player opponent = character.GetOpponent();
            if (opponent == null)
            {
                error = true;
                return(false);
            }

            if (movetype == xnaMugen.MoveType.Unchanged || movetype == xnaMugen.MoveType.None)
            {
                error = true;
                return(false);
            }

            switch (@operator)
            {
            case Operator.Equals:
                return(movetype == opponent.MoveType);

            case Operator.NotEquals:
                return(movetype != opponent.MoveType);

            default:
                error = true;
                return(false);
            }
        }
Esempio n. 2
0
        public override void Run(Combat.Character character)
        {
            Combat.ExplodData data = CreateExplodData(character);
            if (data == null)
            {
                return;
            }

            data.Creator  = character;
            data.Offseter = (data.PositionType == PositionType.P2) ? character.GetOpponent() : character;

            Combat.Explod explod = new Combat.Explod(character.Engine, data);
            if (explod.IsValid == true)
            {
                explod.Engine.Entities.Add(explod);
            }
        }
Esempio n. 3
0
        public static Int32 Evaluate(Object state, ref Boolean error)
        {
            Combat.Character character = state as Combat.Character;
            if (character == null)
            {
                error = true;
                return(0);
            }

            Combat.Player opponent = character.GetOpponent();
            if (opponent == null)
            {
                error = true;
                return(0);
            }

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

            Combat.Player opponent = character.GetOpponent();
            if (opponent == null)
            {
                error = true;
                return(0);
            }

            StateMachine.State currentstate = opponent.StateManager.CurrentState;
            return((currentstate != null) ? currentstate.Number : 0);
        }
Esempio n. 5
0
        public static Single Evaluate(Object state, ref Boolean error, Axis axis)
        {
            Combat.Character character = state as Combat.Character;
            if (character == null)
            {
                error = true;
                return(0);
            }

            Combat.Player opponent = character.GetOpponent();
            if (opponent == null)
            {
                error = true;
                return(0);
            }

            switch (axis)
            {
            case Axis.X:
                Single mylocation  = character.GetFrontLocation();
                Single opplocation = opponent.GetFrontLocation();
                Single distance    = Math.Abs(mylocation - opplocation);
                if (character.CurrentFacing == xnaMugen.Facing.Right)
                {
                    return((opponent.CurrentLocation.X >= character.CurrentLocation.X) ? distance : -distance);
                }
                else
                {
                    return((opponent.CurrentLocation.X >= character.CurrentLocation.X) ? -distance : distance);
                }

            case Axis.Y:
                return(opponent.CurrentLocation.Y - character.CurrentLocation.Y);

            default:
                error = true;
                return(0);
            }
        }