示例#1
0
        // Taken and modified from https://github.com/5FiftySix6/HollowKnight.Lost-Lord/blob/master/LostLord/Kin.cs
        private void ReceiveHit(On.InfectedEnemyEffects.orig_RecieveHitEffect orig, InfectedEnemyEffects self, float attack_direction)
        {
            if (self.GetAttr <bool>("didFireThisFrame"))
            {
                return;
            }

            if (self.GetAttr <SpriteFlash>("spriteFlash") != null)
            {
                self.GetAttr <SpriteFlash>("spriteFlash").flashFocusHeal();
            }

            FSMUtility.SendEventToGameObject(gameObject, "DAMAGE FLASH", true);
            self.GetAttr <AudioEvent>("impactAudio").SpawnAndPlayOneShot(self.GetAttr <AudioSource>("audioSourcePrefab"), self.transform.position);
            self.SetAttr("didFireThisFrame", true);
        }
示例#2
0
        private void Start()
        {
            if (!PlayerData.instance.infectedKnightDreamDefeated)
            {
                return;
            }
            if (!LostLord.Instance.IsInHall)
            {
                return;
            }

            Log(_changedKin);

            if (!_changedKin)
            {
                tk2dSpriteDefinition def = gameObject.GetComponent <tk2dSprite>().GetCurrentSpriteDef();

                _oldTex = def.material.mainTexture;

                def.material.mainTexture = LostLord.SPRITES[0].texture;

                _changedKin = true;
            }

            _origFps = _origFps ?? _anim.Library.clips.Select(x => x.fps).ToArray();

            PlayMakerFSM corpse = gameObject.FindGameObjectInChildren("Corpse Infected Knight Dream(Clone)").LocateMyFSM("corpse");

            corpse.RemoveAction("Init", 9);
            corpse.RemoveAction("Init", 1);
            corpse.ChangeTransition("Pause", "FINISHED", "BG Open");

            corpse.AddAction("Pause", corpse.GetAction <Tk2dPlayAnimation>("Blow", 9));

            // Refill MP
            HeroController.instance.AddMPChargeSpa(999);

            // No stunning
            Destroy(_stunControl);

            // 🅱lood
            _enemyEffects.SetAttr("noBlood", true);

            // No balloons
            _balloons.ChangeTransition("Spawn Pause", "SPAWN", "Stop");


            // 1500hp
            _hm.hp = 1500;

            // Disable Knockback
            _recoil.enabled = false;

            // 2x Damage on All Components
            foreach (DamageHero i in gameObject.GetComponentsInChildren <DamageHero>(true))
            {
                Log(i.name);
                i.damageDealt *= 2;
            }

            // Speed up some attacks.
            foreach (KeyValuePair <string, float> i in _fpsDict)
            {
                _anim.GetClipByName(i.Key).fps = i.Value;
            }

            // Decrease idles
            _control.GetAction <WaitRandom>("Idle", 5).timeMax = 0.01f;
            _control.GetAction <WaitRandom>("Idle", 5).timeMin = 0.001f;

            // 2x Damage
            _control.GetAction <SetDamageHeroAmount>("Roar End", 3).damageDealt.Value = 2;

            // Increase Jump X
            _control.GetAction <FloatMultiply>("Aim Dstab", 3).multiplyBy = 5;
            _control.GetAction <FloatMultiply>("Aim Jump", 3).multiplyBy  = 2.2f;

            // Decrease walk idles.
            var walk = _control.GetAction <RandomFloat>("Idle", 3);

            walk.min = 0.001f;
            walk.max = 0.01f;

            // Speed up
            _control.GetAction <Wait>("Jump", 5).time         = 0.01f;
            _control.GetAction <Wait>("Dash Antic 2", 2).time = 0.27f;

            // Fall faster.
            _control.GetAction <SetVelocity2d>("Dstab Fall", 4).y          = -200; // -130; // -90
            _control.GetAction <SetVelocity2d>("Dstab Fall", 4).everyFrame = true;

            _control.GetAction <ActivateGameObject>("Dstab Land", 2).activate = false;
            _control.GetAction <ActivateGameObject>("Dstab Fall", 6).activate = false;

            // Combo Dash into Upslash followed by Dstab's Projectiles.
            _control.CopyState("Dstab Land", "Spawners");
            _control.CopyState("Ohead Slashing", "Ohead Combo");
            _control.CopyState("Dstab Recover", "Dstab Recover 2");

            _control.ChangeTransition("Dash Recover", "FINISHED", "Ohead Combo");

            _control.RemoveAnim("Dash Recover", 3);
            _control.RemoveAnim("Spawners", 3);

            _control.ChangeTransition("Ohead Combo", "FINISHED", "Spawners");
            _control.ChangeTransition("Spawners", "FINISHED", "Dstab Recover 2");
            _control.GetAction <Wait>("Dstab Recover 2", 0).time = 0f;

            List <FsmStateAction> a = _control.GetState("Dstab Fall").Actions.ToList();

            a.AddRange(_control.GetState("Spawners").Actions);

            _control.GetState("Dstab Fall").Actions = a.ToArray();

            // Spawners before Overhead Slashing.
            _control.CopyState("Spawners", "Spawn Ohead");
            _control.ChangeTransition("Ohead Antic", "FINISHED", "Spawn Ohead");
            _control.ChangeTransition("Spawn Ohead", "FINISHED", "Ohead Slashing");
            _control.FsmVariables.GetFsmFloat("Evade Range").Value *= 2;

            // Dstab => Upslash
            _control.CopyState("Ohead Slashing", "Ohead Combo 2");
            _control.ChangeTransition("Dstab Land", "FINISHED", "Ohead Combo 2");
            _control.ChangeTransition("Ohead Combo 2", "FINISHED", "Dstab Recover");

            // Aerial Dash => Dstab
            _control.ChangeTransition("Dash Recover", "FALL", "Dstab Antic");

            // bingo bongo ur dash is now lightspeed
            _control.FsmVariables.GetFsmFloat("Dash Speed").Value   *= 2;
            _control.FsmVariables.GetFsmFloat("Dash Reverse").Value *= 2;

            // Fixes the cheese where you can sit on the wall
            // right above where he can jump and then just spam ddark
            _control.CopyState("Jump", "Cheese Jump");
            _control.GetAction <Wait>("Cheese Jump", 5).time.Value *= 5;
            _control.RemoveAction("Cheese Jump", 4);
            _control.InsertAction("Cheese Jump", new FireAtTarget
            {
                gameObject = new FsmOwnerDefault {
                    GameObject = gameObject
                },
                target     = HeroController.instance.gameObject,
                speed      = 100f,
                everyFrame = false,
                spread     = 0f,
                position   = new Vector3(0, 0)
            }, 4);

            foreach (string i in new[] { "Damage Response", "Attack Choice" })
            {
                _control.InsertMethod(i, 0, StopCheese);
            }

            Log("fin.");
        }