Ejemplo n.º 1
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);

            character.PaletteFx.Set(time, paladd, palmul, sinadd, invert, basecolor / 255.0f);
        }
Ejemplo n.º 2
0
        public override void Run(Combat.Character character)
        {
            var time      = EvaluationHelper.AsInt32(character, Time, -2);
            var paladd    = EvaluationHelper.AsVector3(character, PaletteColorAdd, new Vector3(0, 0, 0));
            var palmul    = EvaluationHelper.AsVector3(character, PaletteColorMultiply, new Vector3(255, 255, 255));
            var sinadd    = EvaluationHelper.AsVector4(character, PaletteColorSineAdd, new Vector4(0, 0, 0, 1));
            var invert    = EvaluationHelper.AsBoolean(character, PaletteColorInversion, false);
            var basecolor = EvaluationHelper.AsInt32(character, PaletteColor, 255);

            foreach (var 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);
        }
Ejemplo n.º 3
0
        public override void Run(Combat.Character character)
        {
            var time      = EvaluationHelper.AsInt32(character, Time, -2);
            var paladd    = EvaluationHelper.AsVector3(character, PaletteColorAdd, new Vector3(0, 0, 0));
            var palmul    = EvaluationHelper.AsVector3(character, PaletteColorMultiply, new Vector3(255, 255, 255));
            var sinadd    = EvaluationHelper.AsVector4(character, PaletteColorSineAdd, new Vector4(0, 0, 0, 1));
            var invert    = EvaluationHelper.AsBoolean(character, PaletteColorInversion, false);
            var basecolor = EvaluationHelper.AsInt32(character, PaletteColor, 255);

            if (time < -1)
            {
                return;
            }

            var palfx = character.Engine.Stage.PaletteFx;

            palfx.Set(time, paladd, palmul, sinadd, invert, basecolor / 255.0f);
        }
Ejemplo n.º 4
0
        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);
        }