コード例 #1
0
ファイル: VarSet.cs プロジェクト: terrynoya/xnamugen-1
        public override void Run(Combat.Character character)
        {
            if (IntNumber != null)
            {
                var index = EvaluationHelper.AsInt32(character, IntNumber, null);
                var value = EvaluationHelper.AsInt32(character, Value, null);

                if (index != null && value != null && character.Variables.SetInteger(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 && character.Variables.SetFloat(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 && character.Variables.SetInteger(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 && character.Variables.SetFloat(index.Value, true, value.Value) == false)
                {
                }
            }
        }
コード例 #2
0
        public override void Run(Combat.Character character)
        {
            Single?x = EvaluationHelper.AsSingle(character, X, null);
            Single?y = EvaluationHelper.AsSingle(character, Y, null);

            Vector2 cameralocation = (Vector2)character.Engine.Camera.Location;

            Vector2 location = character.CurrentLocation;

            if (x != null)
            {
                location.X = cameralocation.X + x.Value;
            }
            if (y != null)
            {
                location.Y = y.Value;
            }

            character.CurrentLocation = location;
        }
コード例 #3
0
ファイル: TargetVelAdd.cs プロジェクト: xubingyue/xnamugen
        public override void Run(Combat.Character character)
        {
            Single?x         = EvaluationHelper.AsSingle(character, X, null);
            Single?y         = EvaluationHelper.AsSingle(character, Y, null);
            Int32  target_id = EvaluationHelper.AsInt32(character, TargetId, Int32.MinValue);

            foreach (Combat.Character target in character.GetTargets(target_id))
            {
                Vector2 velocity = new Vector2(0, 0);

                if (x != null)
                {
                    velocity.X = x.Value;
                }
                if (y != null)
                {
                    velocity.Y = y.Value;
                }

                target.CurrentVelocity += velocity;
            }
        }
コード例 #4
0
ファイル: TargetVelSet.cs プロジェクト: terrynoya/xnamugen-1
        public override void Run(Combat.Character character)
        {
            var x        = EvaluationHelper.AsSingle(character, X, null);
            var y        = EvaluationHelper.AsSingle(character, Y, null);
            var targetId = EvaluationHelper.AsInt32(character, TargetId, int.MinValue);

            foreach (var target in character.GetTargets(targetId))
            {
                var velocity = target.CurrentVelocity;

                if (x != null)
                {
                    velocity.X = x.Value;
                }
                if (y != null)
                {
                    velocity.Y = y.Value;
                }

                target.CurrentVelocity = velocity;
            }
        }
コード例 #5
0
        public override void Run(Combat.Character character)
        {
            Int32?start = EvaluationHelper.AsInt32(character, StartRange, null);
            Int32?end   = EvaluationHelper.AsInt32(character, EndRange, null);

            if (IntNumber != null)
            {
                Int32?value = EvaluationHelper.AsInt32(character, IntNumber, null);
                if (value != null)
                {
                    for (Int32 i = 0; i != character.Variables.IntegerVariables.Count; ++i)
                    {
                        if (i < start || i > end)
                        {
                            continue;
                        }
                        character.Variables.SetInteger(i, false, value.Value);
                    }
                }
            }

            if (FloatNumber != null)
            {
                Single?value = EvaluationHelper.AsSingle(character, FloatNumber, null);
                if (value != null)
                {
                    for (Int32 i = 0; i != character.Variables.FloatVariables.Count; ++i)
                    {
                        if (i < start || i > end)
                        {
                            continue;
                        }
                        character.Variables.SetFloat(i, false, value.Value);
                    }
                }
            }
        }
コード例 #6
0
        public override void Run(Combat.Character character)
        {
            var fallset = EvaluationHelper.AsInt32(character, FallSet, -1);
            var velx    = EvaluationHelper.AsSingle(character, XVelocity, null);
            var vely    = EvaluationHelper.AsSingle(character, YVelocity, null);

            if (fallset == 0)
            {
                character.DefensiveInfo.HitDef.Fall = false;
            }
            else if (fallset == 1)
            {
                character.DefensiveInfo.HitDef.Fall = true;
            }

            if (velx != null)
            {
                character.DefensiveInfo.HitDef.FallVelocityX = velx.Value;
            }
            if (vely != null)
            {
                character.DefensiveInfo.HitDef.FallVelocityY = vely.Value;
            }
        }
コード例 #7
0
        public override void Run(Combat.Character character)
        {
            var angle = EvaluationHelper.AsSingle(character, NewAngleValue, character.DrawingAngle);

            character.DrawingAngle = angle;
        }
コード例 #8
0
        public override void Run(Combat.Character character)
        {
            var angle = EvaluationHelper.AsSingle(character, AngleAddition, 0);

            character.DrawingAngle += angle;
        }
コード例 #9
0
ファイル: AngleMul.cs プロジェクト: terrynoya/xnamugen-1
        public override void Run(Combat.Character character)
        {
            var angle = EvaluationHelper.AsSingle(character, AngleMultiplier, 1);

            character.DrawingAngle *= angle;
        }
コード例 #10
0
ファイル: HitDef.cs プロジェクト: terrynoya/xnamugen-1
        protected void SetHitDefinition(Combat.Character character, Combat.HitDefinition hitdef)
        {
            if (character == null)
            {
                throw new ArgumentNullException(nameof(character));
            }
            if (hitdef == null)
            {
                throw new ArgumentNullException(nameof(hitdef));
            }

            var defaulthitspark       = EvaluationHelper.AsInt32(character, character.BasePlayer.Constants.DefaultSparkNumber, -1);
            var defaultplayerhitspark = !EvaluationHelper.IsCommon(character.BasePlayer.Constants.DefaultSparkNumber, true);

            var defaultguardspark       = EvaluationHelper.AsInt32(character, character.BasePlayer.Constants.DefaultGuardSparkNumber, -1);
            var defaultplayerguardspark = !EvaluationHelper.IsCommon(character.BasePlayer.Constants.DefaultGuardSparkNumber, true);

            hitdef.HitAttribute        = HitAttribute;
            hitdef.HitFlag             = HitFlag;
            hitdef.GuardFlag           = GuardFlag;
            hitdef.Targeting           = Targetting;
            hitdef.GroundAnimationType = HitAnimationType;
            hitdef.AirAnimationType    = AirHitAnimationType;
            hitdef.FallAnimationType   = FallHitAnimationType;
            hitdef.HitPriority         = Priority;

            var damage = EvaluationHelper.AsPoint(character, Damage, new Point(0, 0));

            hitdef.HitDamage   = damage.X;
            hitdef.GuardDamage = damage.Y;

            var pauseshaketime = EvaluationHelper.AsPoint(character, PauseTime, new Point(0, 0));

            hitdef.PauseTime = pauseshaketime.X;
            hitdef.ShakeTime = pauseshaketime.Y;

            var guardpauseshaketime = EvaluationHelper.AsPoint(character, GuardPauseTime, pauseshaketime);

            hitdef.GuardPauseTime = guardpauseshaketime.X;
            hitdef.GuardShakeTime = guardpauseshaketime.Y;

            hitdef.PlayerSpark    = !EvaluationHelper.IsCommon(SparkNumber, !defaultplayerhitspark);
            hitdef.SparkAnimation = EvaluationHelper.AsInt32(character, SparkNumber, defaulthitspark);

            hitdef.GuardPlayerSpark    = !EvaluationHelper.IsCommon(GuardSparkNumber, !defaultplayerguardspark);
            hitdef.GuardSparkAnimation = EvaluationHelper.AsInt32(character, GuardSparkNumber, defaultguardspark);

            hitdef.SparkStartPosition = (Vector2)EvaluationHelper.AsPoint(character, SparkPosition, new Point(0, 0));

            hitdef.PlayerSound = !EvaluationHelper.IsCommon(HitSound, true);
            hitdef.HitSoundId  = EvaluationHelper.AsSoundId(character, HitSound, SoundId.Invalid);

            hitdef.GuardPlayerSound = !EvaluationHelper.IsCommon(GuardHitSound, true);
            hitdef.GuardSoundId     = EvaluationHelper.AsSoundId(character, GuardHitSound, SoundId.Invalid);

            hitdef.GroundAttackEffect = GroundAttackEffect;
            hitdef.AirAttackEffect    = AirAttackEffect;

            hitdef.GroundHitTime       = EvaluationHelper.AsInt32(character, GroundHitTime, 0);
            hitdef.DownHitTime         = EvaluationHelper.AsInt32(character, DownHitTime, 0);
            hitdef.GuardHitTime        = EvaluationHelper.AsInt32(character, GuardHitTime, hitdef.GroundHitTime);
            hitdef.AirHitTime          = EvaluationHelper.AsInt32(character, AirHitTime, 20);
            hitdef.GroundSlideTime     = EvaluationHelper.AsInt32(character, GroundSlideTime, 0);
            hitdef.GuardSlideTime      = EvaluationHelper.AsInt32(character, GroundSlideTime, hitdef.GuardHitTime);
            hitdef.GuardControlTime    = EvaluationHelper.AsInt32(character, GuardControlTime, hitdef.GuardSlideTime);
            hitdef.AirGuardControlTime = EvaluationHelper.AsInt32(character, AirGuardControlTime, hitdef.GuardControlTime);

            hitdef.GuardDistance       = EvaluationHelper.AsInt32(character, GuardDistance, character.BasePlayer.Constants.Attackdistance);
            hitdef.YAcceleration       = EvaluationHelper.AsSingle(character, VerticalAcceleration, 0.35f);
            hitdef.GroundVelocity      = EvaluationHelper.AsVector2(character, GroundVelocity, Vector2.Zero);
            hitdef.GroundGuardVelocity = new Vector2(EvaluationHelper.AsSingle(character, GuardVelocity, hitdef.GroundVelocity.X), 0);
            hitdef.AirVelocity         = EvaluationHelper.AsVector2(character, AirVelocity, Vector2.Zero);
            hitdef.DownVelocity        = EvaluationHelper.AsVector2(character, DownVelocity, hitdef.AirVelocity);
            hitdef.AirGuardVelocity    = EvaluationHelper.AsVector2(character, AirGuardVelocity, hitdef.AirVelocity * new Vector2(1.5f, 0.5f));
            hitdef.GroundCornerPush    = EvaluationHelper.AsSingle(character, GroundCornerPushOff, hitdef.HitAttribute.HasHeight(AttackStateType.Air) ? 0.0f : hitdef.GroundGuardVelocity.X * 1.3f);
            hitdef.AirCornerPush       = EvaluationHelper.AsSingle(character, AirCornerPushOff, hitdef.GroundCornerPush);
            hitdef.DownCornerPush      = EvaluationHelper.AsSingle(character, DownCornerPushOff, hitdef.GroundCornerPush);
            hitdef.GuardCornerPush     = EvaluationHelper.AsSingle(character, GuardCornerPushOff, hitdef.GroundCornerPush);
            hitdef.AirGuardCornerPush  = EvaluationHelper.AsSingle(character, AirGuardCornerPushOff, hitdef.GroundCornerPush);
            hitdef.JugglePointsNeeded  = EvaluationHelper.AsInt32(character, JugglePointsNeeded, 0);
            hitdef.MininumDistance     = EvaluationHelper.AsPoint(character, MinimumDistance, null);
            hitdef.MaximumDistance     = EvaluationHelper.AsPoint(character, MaximumDistance, null);
            hitdef.SnapLocation        = EvaluationHelper.AsPoint(character, Snap, null);
            hitdef.P1SpritePriority    = EvaluationHelper.AsInt32(character, P1SpritePriority, 1);
            hitdef.P2SpritePriority    = EvaluationHelper.AsInt32(character, P2SpritePriority, 0);
            hitdef.P1Facing            = EvaluationHelper.AsInt32(character, P1Facing, 0);
            hitdef.P1GetP2Facing       = EvaluationHelper.AsInt32(character, P1GetP2Facing, 0);
            hitdef.P2Facing            = EvaluationHelper.AsInt32(character, P2Facing, 0);
            hitdef.P1NewState          = EvaluationHelper.AsInt32(character, P1StateNumber, null);
            hitdef.P2NewState          = EvaluationHelper.AsInt32(character, P2StateNumber, null);
            hitdef.P2UseP1State        = EvaluationHelper.AsBoolean(character, P2GetP1StateNumber, true);
            hitdef.ForceStand          = EvaluationHelper.AsBoolean(character, ForceStand, hitdef.GroundVelocity.Y != 0 ? true : false);
            hitdef.Fall    = EvaluationHelper.AsBoolean(character, Fall, false);
            hitdef.AirFall = EvaluationHelper.AsBoolean(character, AirFall, hitdef.Fall);

            hitdef.FallVelocityX = EvaluationHelper.AsSingle(character, FallXVelocity, null);
            hitdef.FallVelocityY = EvaluationHelper.AsSingle(character, FallYVelocity, -4.5f);

            hitdef.FallCanRecover  = EvaluationHelper.AsBoolean(character, FallCanRecover, true);
            hitdef.FallRecoverTime = EvaluationHelper.AsInt32(character, FallRecoverTime, 4);
            hitdef.FallDamage      = EvaluationHelper.AsInt32(character, FallDamage, 0);
            hitdef.DownBounce      = EvaluationHelper.AsBoolean(character, DownBounce, false);
            hitdef.TargetId        = EvaluationHelper.AsInt32(character, TargetId, 0);
            hitdef.ChainId         = EvaluationHelper.AsInt32(character, ChainId, -1);

            var nochainid = EvaluationHelper.AsPoint(character, NoChainId, new Point(-1, -1));

            hitdef.NoChainId1 = nochainid.X;
            hitdef.NoChainId2 = nochainid.Y;

            hitdef.HitOnce      = EvaluationHelper.AsBoolean(character, HitOnce, hitdef.HitAttribute.HasData(new Combat.HitType(AttackClass.Throw, AttackPower.All)) ? true : false);
            hitdef.CanKill      = EvaluationHelper.AsBoolean(character, CanKill, true);
            hitdef.CanGuardKill = EvaluationHelper.AsBoolean(character, CanGuardKill, true);
            hitdef.CanFallKill  = EvaluationHelper.AsBoolean(character, CanFallKill, true);
            hitdef.NumberOfHits = EvaluationHelper.AsInt32(character, NumberOfHits, 1);

            if (P1PowerIncrease != null)
            {
                var statepower = P1PowerIncrease.Evaluate(character);

                if (statepower.Length > 0 && statepower[0].NumberType != NumberType.None)
                {
                    hitdef.P1HitPowerAdjustment = statepower[0].IntValue;
                }
                else
                {
                    hitdef.P1HitPowerAdjustment = (int)(hitdef.HitDamage * 0.7f);
                }

                if (statepower.Length > 1 && statepower[1].NumberType != NumberType.None)
                {
                    hitdef.P1GuardPowerAdjustment = statepower[1].IntValue;
                }
                else
                {
                    hitdef.P1GuardPowerAdjustment = (int)(hitdef.P1HitPowerAdjustment * 0.5f);
                }
            }

            if (P2PowerIncrease != null)
            {
                var p2power = P2PowerIncrease.Evaluate(character);

                if (p2power.Length > 0 && p2power[0].NumberType != NumberType.None)
                {
                    hitdef.P2HitPowerAdjustment = p2power[0].IntValue;
                }
                else
                {
                    hitdef.P2HitPowerAdjustment = (int)(hitdef.HitDamage * 0.6f);
                }

                if (p2power.Length > 1 && p2power[1].NumberType != NumberType.None)
                {
                    hitdef.P2GuardPowerAdjustment = p2power[1].IntValue;
                }
                else
                {
                    hitdef.P2GuardPowerAdjustment = (int)(hitdef.P2HitPowerAdjustment * 0.5f);
                }
            }

            hitdef.PalFxTime      = EvaluationHelper.AsInt32(character, PaletteColorTime, 0);
            hitdef.PalFxAdd       = EvaluationHelper.AsVector3(character, PaletteColorAdd, new Vector3(0, 0, 0));
            hitdef.PalFxMul       = EvaluationHelper.AsVector3(character, PaletteColorMultiply, new Vector3(255, 255, 255));
            hitdef.PalFxBaseColor = EvaluationHelper.AsInt32(character, PaletteColor, 255) / 255.0f;
            hitdef.PalFxInvert    = EvaluationHelper.AsBoolean(character, PaletteColorInversion, false);
            hitdef.PalFxSinAdd    = EvaluationHelper.AsVector4(character, PaletteColorSineAdd, new Vector4(0, 0, 0, 1));

            hitdef.EnvShakeTime      = EvaluationHelper.AsInt32(character, ShakeTime, 0);
            hitdef.EnvShakeFrequency = Misc.Clamp(EvaluationHelper.AsSingle(character, ShakeFrequency, 60), 0, 180);
            hitdef.EnvShakeAmplitude = EvaluationHelper.AsInt32(character, ShakeAmplitude, -4);
            hitdef.EnvShakePhase     = EvaluationHelper.AsSingle(character, ShakePhaseOffset, hitdef.EnvShakeFrequency >= 90 ? 0 : 90);

            hitdef.EnvShakeFallTime      = EvaluationHelper.AsInt32(character, FallShakeTime, 0);
            hitdef.EnvShakeFallFrequency = Misc.Clamp(EvaluationHelper.AsSingle(character, FallShakeFrequency, 60), 0, 180);
            hitdef.EnvShakeFallAmplitude = EvaluationHelper.AsInt32(character, FallShakeAmplitude, -4);
            hitdef.EnvShakeFallPhase     = EvaluationHelper.AsSingle(character, FallShakePhaseOffset, hitdef.EnvShakeFallFrequency >= 90 ? 0 : 90);
        }