Beispiel #1
0
 public override void Run(Combat.Character character)
 {
     Combat.Helper helper = character as Combat.Helper;
     if (helper != null)
     {
         helper.Remove();
     }
 }
Beispiel #2
0
        public override void Run(Combat.Character character)
        {
            var helperName        = Name ?? character.BasePlayer.Profile.DisplayName + "'s Helper";
            var helperId          = EvaluationHelper.AsInt32(character, Id, 0);
            var positionOffset    = (Vector2)EvaluationHelper.AsPoint(character, Position, new Point(0, 0));
            var facingflag        = EvaluationHelper.AsInt32(character, Facing, 1);
            var statenumber       = EvaluationHelper.AsInt32(character, StateNumber, 0);
            var keycontrol        = EvaluationHelper.AsBoolean(character, KeyControl, false);
            var ownpalette        = EvaluationHelper.AsBoolean(character, OwnPalette, false);
            var supermovetime     = EvaluationHelper.AsInt32(character, SuperMoveTime, 0);
            var pausemovetime     = EvaluationHelper.AsInt32(character, PauseMoveTime, 0);
            var scalex            = EvaluationHelper.AsSingle(character, XScale, character.BasePlayer.Constants.Scale.X);
            var scaley            = EvaluationHelper.AsSingle(character, YScale, character.BasePlayer.Constants.Scale.Y);
            var groundfront       = EvaluationHelper.AsInt32(character, GroundFrontSize, character.BasePlayer.Constants.GroundFront);
            var groundback        = EvaluationHelper.AsInt32(character, GroundBackSize, character.BasePlayer.Constants.GroundBack);
            var airfront          = EvaluationHelper.AsInt32(character, AirFrontSize, character.BasePlayer.Constants.Airfront);
            var airback           = EvaluationHelper.AsInt32(character, AirBackSize, character.BasePlayer.Constants.Airback);
            var height            = EvaluationHelper.AsInt32(character, Height, character.BasePlayer.Constants.Height);
            var projectilescaling = EvaluationHelper.AsBoolean(character, ProjectileScaling, character.BasePlayer.Constants.ProjectileScaling);
            var headposition      = (Vector2)EvaluationHelper.AsPoint(character, HeadPosition, (Point)character.BasePlayer.Constants.Headposition);
            var midposition       = (Vector2)EvaluationHelper.AsPoint(character, MiddlePosition, (Point)character.BasePlayer.Constants.Midposition);
            var shadowoffset      = EvaluationHelper.AsInt32(character, ShadowOffset, character.BasePlayer.Constants.Shadowoffset);

            var data = new Combat.HelperData();

            data.Name               = helperName;
            data.HelperId           = helperId;
            data.Type               = HelperType;
            data.FacingFlag         = facingflag;
            data.PositionType       = PositionType;
            data.CreationOffset     = positionOffset;
            data.KeyControl         = keycontrol;
            data.OwnPaletteFx       = ownpalette;
            data.InitialStateNumber = statenumber;
            data.Scale              = new Vector2(scalex, scaley);
            data.GroundFront        = groundfront;
            data.GroundBack         = groundback;
            data.AirFront           = airfront;
            data.AirBack            = airback;
            data.Height             = height;
            data.SuperPauseTime     = supermovetime;
            data.PauseTime          = pausemovetime;
            data.ProjectileScaling  = projectilescaling;
            data.HeadPosition       = headposition;
            data.MidPosition        = midposition;
            data.ShadowOffset       = shadowoffset;

            var helper = new Combat.Helper(character.Engine, character, data);

            helper.Engine.Entities.Add(helper);
        }
Beispiel #3
0
        public override void Run(Combat.Character character)
        {
            Combat.Helper helper = character as Combat.Helper;
            if (helper == null)
            {
                return;
            }

            Int32   time   = EvaluationHelper.AsInt32(character, Time, 1);
            Int32   facing = EvaluationHelper.AsInt32(character, Facing, 0);
            Vector2 offset = EvaluationHelper.AsVector2(character, Position, new Vector2(0, 0));

            helper.Bind.Set(helper.BasePlayer, offset, time, facing, false);
        }
Beispiel #4
0
        public override void Run(Combat.Character character)
        {
            Combat.Helper helper = character as Combat.Helper;
            if (helper == null)
            {
                return;
            }

            if (IntNumber != null)
            {
                Int32?index = EvaluationHelper.AsInt32(character, IntNumber, null);
                Int32?value = EvaluationHelper.AsInt32(character, Value, null);

                if (index != null && value != null && helper.Parent.Variables.AddInteger(index.Value, false, value.Value) == false)
                {
                }
            }

            if (FloatNumber != null)
            {
                Int32? index = EvaluationHelper.AsInt32(character, FloatNumber, null);
                Single?value = EvaluationHelper.AsSingle(character, Value, null);

                if (index != null && value != null && helper.Parent.Variables.AddFloat(index.Value, false, value.Value) == false)
                {
                }
            }

            if (SystemIntNumber != null)
            {
                Int32?index = EvaluationHelper.AsInt32(character, SystemIntNumber, null);
                Int32?value = EvaluationHelper.AsInt32(character, Value, null);

                if (index != null && value != null && helper.Parent.Variables.AddInteger(index.Value, true, value.Value) == false)
                {
                }
            }

            if (SystemFloatNumber != null)
            {
                Int32? index = EvaluationHelper.AsInt32(character, SystemFloatNumber, null);
                Single?value = EvaluationHelper.AsSingle(character, Value, null);

                if (index != null && value != null && helper.Parent.Variables.AddFloat(index.Value, true, value.Value) == false)
                {
                }
            }
        }
Beispiel #5
0
        public static Int32 Size_Shadowoffset(Object state, ref Boolean error)
        {
            Combat.Player player = state as Combat.Player;
            if (player != null)
            {
                return(player.Constants.Shadowoffset);
            }

            Combat.Helper helper = state as Combat.Helper;
            if (helper != null)
            {
                return(helper.Data.ShadowOffset);
            }

            error = true;
            return(0);
        }
Beispiel #6
0
        public static Single Size_Mid_Pos_Y(Object state, ref Boolean error)
        {
            Combat.Player player = state as Combat.Player;
            if (player != null)
            {
                return(player.Constants.Midposition.Y);
            }

            Combat.Helper helper = state as Combat.Helper;
            if (helper != null)
            {
                return(helper.Data.MidPosition.Y);
            }

            error = true;
            return(0);
        }
Beispiel #7
0
        public static Boolean Size_Proj_Doscale(Object state, ref Boolean error)
        {
            Combat.Player player = state as Combat.Player;
            if (player != null)
            {
                return(player.Constants.ProjectileScaling);
            }

            Combat.Helper helper = state as Combat.Helper;
            if (helper != null)
            {
                return(helper.Data.ProjectileScaling);
            }

            error = true;
            return(false);
        }
Beispiel #8
0
        public static Single Size_Yscale(Object state, ref Boolean error)
        {
            Combat.Player player = state as Combat.Player;
            if (player != null)
            {
                return(player.Constants.Scale.Y);
            }

            Combat.Helper helper = state as Combat.Helper;
            if (helper != null)
            {
                return(helper.Data.Scale.Y);
            }

            error = true;
            return(0);
        }
Beispiel #9
0
        public static Boolean Evaluate(Object state, ref Boolean error, Int32 helperid)
        {
            Combat.Character character = state as Combat.Character;
            if (character == null)
            {
                error = true;
                return(false);
            }

            Combat.Helper helper = character as Combat.Helper;
            if (helper == null)
            {
                return(false);
            }

            return((helperid >= 0) ? helper.Data.HelperId == helperid : true);
        }
Beispiel #10
0
        public static Object RedirectState(Object state, ref Boolean error)
        {
            Combat.Character character = state as Combat.Character;
            if (character == null)
            {
                error = true;
                return(null);
            }

            Combat.Helper helper = character as Combat.Helper;
            if (helper == null)
            {
                error = true;
                return(null);
            }

            return(helper.Parent);
        }
Beispiel #11
0
        static String GetName(Combat.Character character)
        {
            if (character == null)
            {
                throw new ArgumentNullException("character");
            }

            if (character is Combat.Player)
            {
                Combat.Player player = (Combat.Player)character;
                return(player.Profile.PlayerName);
            }

            if (character is Combat.Helper)
            {
                Combat.Helper helper = (Combat.Helper)character;
                return(helper.Data.Name);
            }

            return(null);
        }
Beispiel #12
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.Helper helper = character as Combat.Helper;
            if (helper == null)
            {
                error = true;
                return(0);
            }

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

            case Axis.Y:
                return(helper.Parent.CurrentLocation.Y - helper.CurrentLocation.Y);

            default:
                error = true;
                return(0);
            }
        }
Beispiel #13
0
        public override void Run(Combat.Character character)
        {
            String helper_name = Name ?? character.BasePlayer.Profile.DisplayName + "'s Helper";
            Int32 helper_id = EvaluationHelper.AsInt32(character, Id, 0);
            Vector2 position_offset = (Vector2)EvaluationHelper.AsPoint(character, Position, new Point(0, 0));
            Int32 facingflag = EvaluationHelper.AsInt32(character, Facing, 1);
            Int32 statenumber = EvaluationHelper.AsInt32(character, StateNumber, 0);
            Boolean keycontrol = EvaluationHelper.AsBoolean(character, KeyControl, false);
            Boolean ownpalette = EvaluationHelper.AsBoolean(character, OwnPalette, false);
            Int32 supermovetime = EvaluationHelper.AsInt32(character, SuperMoveTime, 0);
            Int32 pausemovetime = EvaluationHelper.AsInt32(character, PauseMoveTime, 0);
            Single scalex = EvaluationHelper.AsSingle(character, XScale, character.BasePlayer.Constants.Scale.X);
            Single scaley = EvaluationHelper.AsSingle(character, YScale, character.BasePlayer.Constants.Scale.Y);
            Int32 groundfront = EvaluationHelper.AsInt32(character, GroundFrontSize, character.BasePlayer.Constants.GroundFront);
            Int32 groundback = EvaluationHelper.AsInt32(character, GroundBackSize, character.BasePlayer.Constants.GroundBack);
            Int32 airfront = EvaluationHelper.AsInt32(character, AirFrontSize, character.BasePlayer.Constants.Airfront);
            Int32 airback = EvaluationHelper.AsInt32(character, AirBackSize, character.BasePlayer.Constants.Airback);
            Int32 height = EvaluationHelper.AsInt32(character, Height, character.BasePlayer.Constants.Height);
            Boolean projectilescaling = EvaluationHelper.AsBoolean(character, ProjectileScaling, character.BasePlayer.Constants.ProjectileScaling);
            Vector2 headposition = (Vector2)EvaluationHelper.AsPoint(character, HeadPosition, (Point)character.BasePlayer.Constants.Headposition);
            Vector2 midposition = (Vector2)EvaluationHelper.AsPoint(character, MiddlePosition, (Point)character.BasePlayer.Constants.Midposition);
            Int32 shadowoffset = EvaluationHelper.AsInt32(character, ShadowOffset, character.BasePlayer.Constants.Shadowoffset);

            Combat.HelperData data = new Combat.HelperData();
            data.Name = helper_name;
            data.HelperId = helper_id;
            data.Type = HelperType;
            data.FacingFlag = facingflag;
            data.PositionType = PositionType;
            data.CreationOffset = position_offset;
            data.KeyControl = keycontrol;
            data.OwnPaletteFx = ownpalette;
            data.InitialStateNumber = statenumber;
            data.Scale = new Vector2(scalex, scaley);
            data.GroundFront = groundfront;
            data.GroundBack = groundback;
            data.AirFront = airfront;
            data.AirBack = airback;
            data.Height = height;
            data.SuperPauseTime = supermovetime;
            data.PauseTime = pausemovetime;
            data.ProjectileScaling = projectilescaling;
            data.HeadPosition = headposition;
            data.MidPosition = midposition;
            data.ShadowOffset = shadowoffset;

            Combat.Helper helper = new Combat.Helper(character.Engine, character, data);
            helper.Engine.Entities.Add(helper);
        }