Example #1
0
        public override void Run(Combat.Character character)
        {
            Combat.ModifyExplodData data = CreateModifyExplodData(character);
            if (data == null)
            {
                return;
            }

            foreach (Combat.Explod explod in character.GetExplods(data.Id))
            {
                explod.Modify(data);
            }
        }
Example #2
0
        public static Boolean GetIsBound(Object state, ref Boolean error)
        {
            Combat.Character character = state as Combat.Character;
            if (character == null)
            {
                error = true;
                return(false);
            }

            Combat.CharacterBind bind = character.Bind;

            return(bind.IsActive == true && bind.IsTargetBind == true);
        }
Example #3
0
 public override void Run(Combat.Character character)
 {
     if (Parameters != null)
     {
         character.Clipboard.Length = 0;
         character.Clipboard.Append(BuildString(Parameters.Evaluate(character)));
     }
     else
     {
         character.Clipboard.Length = 0;
         character.Clipboard.Append(FormatString);
     }
 }
Example #4
0
        public override void Run(Combat.Character character)
        {
            var time = EvaluationHelper.AsInt32(character, DisplayTime, null);

            if (time != null)
            {
                character.AfterImages.ModifyDisplayTime(time.Value);
            }
            else
            {
                character.AfterImages.IsActive = false;
            }
        }
Example #5
0
        public override void Run(Combat.Character character)
        {
            int?time       = EvaluationHelper.AsInt32(character, Time, 30);
            var buffertime = EvaluationHelper.AsInt32(character, EndCommandBufferTime, 0);
            var movetime   = EvaluationHelper.AsInt32(character, MoveTime, 0);
            var pausebg    = EvaluationHelper.AsBoolean(character, PauseBackgrounds, true);
            var power      = EvaluationHelper.AsInt32(character, PowerAdd, 0);

#warning Documentation states that default should be 30. Testing looks to be 100.
            var animationnumber = EvaluationHelper.AsInt32(character, AnimationNumber, 100);

            var soundid           = EvaluationHelper.AsSoundId(character, SoundId, null);
            var animationposition = EvaluationHelper.AsPoint(character, AnimationPosition, new Point(0, 0));
            var darkenscreen      = EvaluationHelper.AsBoolean(character, DarkenScreen, true);
            var p2defmul          = EvaluationHelper.AsSingle(character, P2DefenseMultiplier, null);
            var unhittable        = EvaluationHelper.AsBoolean(character, Unhittable, true);

            if (time == null)
            {
                return;
            }

            var pause = character.Engine.SuperPause;
            pause.Set(character, time.Value, buffertime, movetime, false, pausebg);

            character.BasePlayer.Power += power;

            var data = new Combat.ExplodData();
            data.PositionType    = PositionType.P1;
            data.Location        = (Vector2)animationposition;
            data.RemoveTime      = -2;
            data.CommonAnimation = EvaluationHelper.IsCommon(AnimationNumber, true);
            data.AnimationNumber = animationnumber;
            data.Scale           = Vector2.One;
            data.SuperMove       = true;
            data.Creator         = character;
            data.Offseter        = character;
            data.DrawOnTop       = true;

            var explod = new Combat.Explod(character.Engine, data);
            if (explod.IsValid)
            {
                explod.Engine.Entities.Add(explod);
            }

            if (soundid != null)
            {
                Audio.SoundManager soundmanager = SoundId.IsCommon(true) ? character.Engine.CommonSounds : character.SoundManager;
                soundmanager.Play(soundid.Value);
            }
        }
Example #6
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);
        }
Example #7
0
        public override void Run(Combat.Character character)
        {
            var angle = EvaluationHelper.AsSingle(character, Angle, character.DrawingAngle);

            character.DrawingAngle = angle;
            character.AngleDraw    = true;

            var scale = EvaluationHelper.AsVector2(character, Scale, null);

            if (scale != null)
            {
                character.DrawScale = scale.Value;
            }
        }
Example #8
0
        public override void Run(Combat.Character character)
        {
            var slotnumber  = EvaluationHelper.AsInt32(character, SlotNumber, 0);
            var statenumber = EvaluationHelper.AsInt32(character, StateNumber, int.MinValue);
            var time        = EvaluationHelper.AsInt32(character, Time, 1);
            var forceair    = EvaluationHelper.AsBoolean(character, ForceAir, false);

            if (slotnumber < 0 || slotnumber > 7)
            {
                return;
            }

            character.DefensiveInfo.HitOverrides[slotnumber].Set(Override, statenumber, time, forceair);
        }
Example #9
0
        public override void Run(Combat.Character character)
        {
            var time       = EvaluationHelper.AsInt32(character, Time, null);
            var buffertime = EvaluationHelper.AsInt32(character, EndCommandBufferTime, 0);
            var movetime   = EvaluationHelper.AsInt32(character, MoveTime, 0);
            var pausebg    = EvaluationHelper.AsBoolean(character, PauseBackgrounds, true);

            if (time == null)
            {
                return;
            }

            character.Engine.Pause.Set(character, time.Value, buffertime, movetime, false, pausebg);
        }
Example #10
0
        public override void Run(Combat.Character character)
        {
            var time = EvaluationHelper.AsInt32(character, Time, 1);

            if (HitAttribute1 != null)
            {
                character.DefensiveInfo.HitBy1.Set(HitAttribute1, time, true);
            }

            if (HitAttribute2 != null)
            {
                character.DefensiveInfo.HitBy2.Set(HitAttribute2, time, true);
            }
        }
Example #11
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);
        }
Example #12
0
        public override void Run(Combat.Character character)
        {
            Combat.HitDefinition hitdef = character.DefensiveInfo.HitDef;

            if (hitdef.EnvShakeFallTime == 0)
            {
                return;
            }

            Combat.EnvironmentShake envshake = character.Engine.EnvironmentShake;
            envshake.Set(hitdef.EnvShakeFallTime, hitdef.EnvShakeFallFrequency, hitdef.EnvShakeAmplitude, hitdef.EnvShakeFallPhase);

            hitdef.EnvShakeFallTime = 0;
        }
Example #13
0
        public override void Run(Combat.Character character)
        {
            var helper = character as Combat.Helper;

            if (helper == null)
            {
                return;
            }

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

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

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

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

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

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

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

                if (index != null && value != null && helper.Parent.Variables.AddFloat(index.Value, true, value.Value) == false)
                {
                }
            }
        }
Example #14
0
        public static Int32 GetAnimType(Object state, ref Boolean error)
        {
            Combat.Character character = state as Combat.Character;
            if (character == null)
            {
                error = true;
                return(0);
            }

            HitAnimationType hat = HitAnimationType.Light;

            if (character.DefensiveInfo.IsFalling == true)
            {
                hat = character.DefensiveInfo.HitDef.FallAnimationType;
            }
            else if (character.DefensiveInfo.HitStateType == xnaMugen.StateType.Airborne)
            {
                hat = character.DefensiveInfo.HitDef.AirAnimationType;
            }
            else
            {
                hat = character.DefensiveInfo.HitDef.GroundAnimationType;
            }

            switch (hat)
            {
            case HitAnimationType.Light:
                return(0);

            case HitAnimationType.Medium:
                return(1);

            case HitAnimationType.Hard:
                return(2);

            case HitAnimationType.Back:
                return(3);

            case HitAnimationType.Up:
                return(4);

            case HitAnimationType.DiagUp:
                return(5);

            default:
                error = true;
                return(0);
            }
        }
Example #15
0
        public override void Run(Combat.Character character)
        {
            var helper = character as Combat.Helper;

            if (helper == null)
            {
                return;
            }

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

            helper.Bind.Set(helper.Parent, offset, time, facing, false);
        }
Example #16
0
        public static Single Assignment_SysFVar(Object state, Int32 index, Single value)
        {
            Combat.Character character = state as Combat.Character;
            if (character == null)
            {
                throw new EvaluationException();
            }

            if (character.Variables.SetFloat(index, true, value) == true)
            {
                return(value);
            }

            throw new EvaluationException();
        }
Example #17
0
        public static Int32 Assignment_Var(Object state, Int32 index, Int32 value)
        {
            Combat.Character character = state as Combat.Character;
            if (character == null)
            {
                throw new EvaluationException();
            }

            if (character.Variables.SetInteger(index, false, value) == true)
            {
                return(value);
            }

            throw new EvaluationException();
        }
Example #18
0
        public override void Run(Combat.Character character)
        {
            var amount   = EvaluationHelper.AsInt32(character, Amount, null);
            var targetId = EvaluationHelper.AsInt32(character, TargetId, int.MinValue);

            if (amount == null)
            {
                return;
            }

            foreach (var target in character.GetTargets(targetId))
            {
                target.BasePlayer.Power += amount.Value;
            }
        }
Example #19
0
 public override void Run(Combat.Character character)
 {
     if (StateType != StateType.Unchanged && StateType != StateType.None)
     {
         character.StateType = StateType;
     }
     if (MoveType != MoveType.Unchanged && MoveType != MoveType.None)
     {
         character.MoveType = MoveType;
     }
     if (Physics != Physics.Unchanged)
     {
         character.Physics = Physics;
     }
 }
Example #20
0
        public override void Run(Combat.Character character)
        {
            Int32? time      = EvaluationHelper.AsInt32(character, Time, null);
            Single frequency = Misc.Clamp(EvaluationHelper.AsSingle(character, Frequency, 60), 0, 180);
            Int32  amplitude = EvaluationHelper.AsInt32(character, Amplitude, -4);
            Single phase     = EvaluationHelper.AsSingle(character, PhaseOffset, frequency >= 90 ? 0 : 90);

            if (time == null)
            {
                return;
            }

            Combat.EnvironmentShake envshake = character.Engine.EnvironmentShake;
            envshake.Set(time.Value, frequency, amplitude, phase);
        }
Example #21
0
        public override void Run(Combat.Character character)
        {
            Int32   time      = EvaluationHelper.AsInt32(character, Time, -2);
            Vector3 paladd    = EvaluationHelper.AsVector3(character, PaletteColorAdd, new Vector3(0, 0, 0));
            Vector3 palmul    = EvaluationHelper.AsVector3(character, PaletteColorMultiply, new Vector3(255, 255, 255));
            Vector4 sinadd    = EvaluationHelper.AsVector4(character, PaletteColorSineAdd, new Vector4(0, 0, 0, 1));
            Boolean invert    = EvaluationHelper.AsBoolean(character, PaletteColorInversion, false);
            Int32   basecolor = EvaluationHelper.AsInt32(character, PaletteColor, 255);

            foreach (Combat.Entity entity in character.Engine.Entities)
            {
                entity.PaletteFx.Set(time, paladd, palmul, sinadd, invert, basecolor);
            }

            character.Engine.Stage.PaletteFx.Set(time, paladd, palmul, sinadd, invert, basecolor);
        }
Example #22
0
        public override void Run(Combat.Character character)
        {
            var playerwidth = EvaluationHelper.AsPoint(character, PlayerWidth, null);

            if (playerwidth != null)
            {
                character.Dimensions.SetOverride(playerwidth.Value.X, playerwidth.Value.Y);
            }

            var edgewidth = EvaluationHelper.AsPoint(character, EdgeWidth, null);

            if (edgewidth != null)
            {
                character.Dimensions.SetEdgeOverride(edgewidth.Value.X, edgewidth.Value.Y);
            }
        }
Example #23
0
        static Combat.Player GetTeamMate(Combat.Character character)
        {
            if (character == null)
            {
                throw new ArgumentNullException("character");
            }

            if (character.BasePlayer == character.Team.MainPlayer)
            {
                return(character.Team.TeamMate);
            }
            else
            {
                return(character.Team.MainPlayer);
            }
        }
Example #24
0
        public override void Run(Combat.Character character)
        {
            Int32?statenumber = EvaluationHelper.AsInt32(character, StateNumber, null);
            Int32 target_id   = EvaluationHelper.AsInt32(character, TargetId, Int32.MinValue);

            if (statenumber == null)
            {
                return;
            }

            foreach (Combat.Character target in character.GetTargets(target_id))
            {
                target.StateManager.ForeignManager = character.StateManager;
                target.StateManager.ChangeState(statenumber.Value);
            }
        }
Example #25
0
        public static Int32 GetHitType(Object state, ref Boolean error)
        {
            Combat.Character character = state as Combat.Character;
            if (character == null)
            {
                error = true;
                return(0);
            }

            if (character.Life == 0)
            {
                return(3);
            }

            return((character.DefensiveInfo.HitStateType == xnaMugen.StateType.Airborne) ? GetAirHitType(state, ref error) : GetGroundHitType(state, ref error));
        }
Example #26
0
        public override void Run(Combat.Character character)
        {
            var control = EvaluationHelper.AsBoolean(character, Control, null);

            if (control != null)
            {
                if (control == true)
                {
                    character.PlayerControl = PlayerControl.InControl;
                }
                if (control == false)
                {
                    character.PlayerControl = PlayerControl.NoControl;
                }
            }
        }
Example #27
0
        public override void Run(Combat.Character character)
        {
            Int32   exclude_id = EvaluationHelper.AsInt32(character, Id, -1);
            Boolean keepone    = EvaluationHelper.AsBoolean(character, KeepOne, true);


            List <Combat.Character> removelist = new List <Combat.Character>();

            foreach (Combat.Character target in character.GetTargets(Int32.MinValue))
            {
                if (exclude_id != -1 && target.DefensiveInfo.HitDef.TargetId == exclude_id)
                {
                    continue;
                }

                removelist.Add(target);
            }

            if (removelist.Count > 0 && keepone == true)
            {
                removelist.RemoveAt(0);
            }

            foreach (Combat.Character target in removelist)
            {
                character.OffensiveInfo.TargetList.Remove(target);
            }

            /*
             * Boolean keptone = false;
             * foreach (Combat.Entity entity in character.Engine.Entities)
             * {
             *      Combat.Character target = character.FilterEntityAsTarget(entity, Int32.MinValue);
             *      if (target == null) continue;
             *
             *      if (exclude_id != -1 && target.DefensiveInfo.HitDef.TargetId == exclude_id) continue;
             *
             *      if (keptone == false)
             *      {
             *              keptone = true;
             *              continue;
             *      }
             *
             *      character.OffensiveInfo.TargetList.Remove(target);
             * }
             */
        }
Example #28
0
        public override void Run(Combat.Character character)
        {
            Int32 facing    = EvaluationHelper.AsInt32(character, Facing, 0);
            Int32 target_id = EvaluationHelper.AsInt32(character, TargetId, Int32.MinValue);

            foreach (Combat.Character target in character.GetTargets(target_id))
            {
                if (facing > 0)
                {
                    target.CurrentFacing = character.CurrentFacing;
                }
                else if (facing < 0)
                {
                    target.CurrentFacing = Misc.FlipFacing(character.CurrentFacing);
                }
            }
        }
Example #29
0
        public static Object RedirectState(Object state, ref Boolean error, Int32 target_id)
        {
            Combat.Character character = state as Combat.Character;
            if (character == null)
            {
                error = true;
                return(null);
            }

            foreach (Combat.Character target in character.GetTargets(target_id))
            {
                return(target);
            }

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

            if (character.AnimationManager.IsForeignAnimation == true)
            {
                error = true;
                return(false);
            }

            return(character.AnimationManager.HasAnimation(value));
        }
Example #31
0
        public StateManager(StateSystem statesystem, Combat.Character character, ReadOnlyKeyedCollection<Int32, State> states)
        {
            if (statesystem == null) throw new ArgumentNullException("statesystem");
            if (character == null) throw new ArgumentNullException("character");
            if (states == null) throw new ArgumentNullException("states");

            m_statesystem = statesystem;
            m_character = character;
            m_states = states;
            m_persistencemap = new Dictionary<StateController, Int32>();
            m_foreignmanager = null;
            m_statetime = 0;

            #if DEBUG
            m_stateorder = new CircularBuffer<State>(10);
            #else
            m_currentstate = null;
            m_previousstate = null;
            #endif
        }