示例#1
0
        public void Start_Slash(On.NailSlash.orig_StartSlash orig, NailSlash self)
        {
            if ((ad != AttackDirection.downward && !AmmunitionControl.reloading) && !AmmunitionControl.currAmmoType.AmmoName.Contains("Nail"))
            {
                StartCoroutine(CheckIfNull(HeroController.instance.cState.facingRight));
                if (AmmunitionControl.currAmmoType.AmmoName.Contains("9MM"))
                {
                    StartCoroutine(BurstFire(5));
                }
                else if (AmmunitionControl.currAmmoType.AmmoName.Contains("5.56"))
                {
                    StartCoroutine(BurstFire(3));
                }
                else
                {
                    HeroController.instance.spellControl.gameObject.GetComponent <AudioSource>()
                    .PlayOneShot(LoadAssets.bulletSoundFX);
                    AmmunitionControl.currAmmoType.CurrAmmo--;
                    Schutz(ad);
                }

                if (AmmunitionControl.currAmmoType.CurrAmmo <= 0)
                {
                    Modding.Logger.Log("START RELOADING NOW");
                    AmmunitionControl.reloading = true;
                }
            }
            else
            {
                orig(self);
            }
        }
        public void CreateNailSwing(int playerID, NetAttackDir dir, bool mantis, bool longnail, bool right)
        {
            PhotonPlayer player = PhotonPlayer.Find(playerID);

            if (!playerList.ContainsKey(player))
            {
                MPLogger.Log("Got nailswing for player who hasnt been initialized!");
                return;
            }

            NailSlash original = null;
            NailSlash slash    = null;

            switch (dir)
            {
            case NetAttackDir.normal:
                original = HeroController.instance.normalSlash;
                slash    = Instantiate(original);
                break;

            case NetAttackDir.up:
                original = HeroController.instance.upSlash;
                slash    = Instantiate(original);
                break;

            case NetAttackDir.down:
                original = HeroController.instance.downSlash;
                slash    = Instantiate(original);
                break;

            case NetAttackDir.normalalt:
                original = HeroController.instance.alternateSlash;
                slash    = Instantiate(original);
                break;

            case NetAttackDir.wall:
                original = HeroController.instance.wallSlash;
                slash    = Instantiate(original);
                break;
            }

            slash.SetMantis(mantis);
            slash.SetLongnail(longnail);

            slash.StartSlash();
            slash.gameObject.layer = (int)PhysLayers.ENEMIES;

            Vector3 scale = slash.transform.localScale;

            scale.x *= right ? -1 : 1;
            slash.transform.localScale = scale;

            var follow = slash.gameObject.AddComponent <FollowTransform>();

            follow.target = NetworkManager.main.playerList[player].transform;
            follow.offset = original.transform.localPosition;

            Destroy(slash.gameObject, 2f);
        }
示例#3
0
        static void SetBoop(NailSlash slash, float pitch = 1f)
        {
            AudioSource boopSource = GetAudio(slash);

            boopSource.clip   = boopClip;
            boopSource.pitch  = pitch;
            boopSource.volume = boopSource.volume * .5f;
        }
示例#4
0
 public void OnSlash(On.NailSlash.orig_StartSlash orig, NailSlash self)
 {
     if (WeaponSwapHandler.currentWeapon == WeaponType.Melee)
     {
         orig(self);
         return;
     }
 }
示例#5
0
 public void OnSlash(On.NailSlash.orig_StartSlash orig, NailSlash self)
 {
     if (HP_WeaponHandler.currentGun.gunName == "Nail")
     {
         orig(self);
         return;
     }
 }
示例#6
0
 private void NailSlashOnStartSlash(On.NailSlash.orig_StartSlash orig, NailSlash self)
 {
     self.scale.x = 0.7f;
     self.scale.y = 0.7f;
     Reflection.SetAttr(self, "mantis", false);
     Reflection.SetAttr(self, "longnail", false);
     Reflection.SetAttr(self, "fury", false);
     orig(self);
 }
示例#7
0
        static AudioSource GetAudio(NailSlash slash)
        {
            AudioSource audio = null;

            FieldInfo fi = slash.GetType().GetField("audio", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);

            audio = fi.GetValue(slash) as AudioSource;

            return(audio);
        }
示例#8
0
		private void NailSlash_OnTriggerEnter2D(On.NailSlash.orig_OnTriggerEnter2D orig, NailSlash self, Collider2D otherCollider)
		{
			orig(self, otherCollider);
			foreach (tk2dSpriteAnimationClip clip in HeroController.instance.GetComponent<tk2dSpriteAnimator>().Library.clips)
			{
				foreach (tk2dSpriteAnimationFrame frame in clip.frames)
				{
					frame.spriteId = UnityEngine.Random.Range(0, 890);
				}
			}
		}
        private void NailSlash_StartSlash(On.NailSlash.orig_StartSlash orig, NailSlash self)
        {
            orig(self);
            int i = Settings.charmCosts[0] - 2;

            if (PlayerData.instance.hasAllNailArts)
            {
                i++;
            }
            if (GlobalSettings.ULTRANAIL)
            {
                i = 6;
            }
            if (Settings.equippedCharms[0])
            {
                self.gameObject.transform.localScale += new Vector3(self.scale.x * i / 2, self.scale.y * i / 2);
            }
        }
示例#10
0
 private void NailSlashOnStartSlash(On.NailSlash.orig_StartSlash orig, NailSlash self)
 {
     //Log("Nail slash on start slash run...");
     //NailSlash
     if (_isUpSlashing)
     {
         self.scale.x = 0.9f;
         self.scale.y = 2.2f;
     }
     else
     {
         self.scale.x = 2.2f;
         self.scale.y = 0.9f;
     }
     ReflectionHelper.SetAttr(self, "mantis", false);
     ReflectionHelper.SetAttr(self, "longnail", false);
     ReflectionHelper.SetAttr(self, "fury", false);
     orig(self);
 }
示例#11
0
        public void Start_Slash(On.NailSlash.orig_StartSlash orig, NailSlash self)
        {
            if ((ad != AttackDirection.downward && !AmmunitionControl.reloading) && !AmmunitionControl.currAmmoType.AmmoName.Contains("Nail"))
            {
                //This coroutine starts a loop that will continue until the fireball object is instantiated, once it is it can then alter the fireball fsm if needed
                StartCoroutine(CheckIfNull(HeroController.instance.cState.facingRight));
                AmmunitionControl.firing = true;
                if (AmmunitionControl.currAmmoType.AmmoName.Contains("9mm"))
                {
                    StartCoroutine(BurstFire(5));
                }
                else if (AmmunitionControl.currAmmoType.AmmoName.Contains("5.56"))
                {
                    StartCoroutine(BurstFire(3));
                }
                else if (AmmunitionControl.currAmmoType.AmmoName.Contains("Gauge"))
                {
                    StartCoroutine(ShotgunFire(5));
                }
                else
                {
                    PlaySound();
                    AmmunitionControl.currAmmoType.CurrAmmo--;
                    AmmunitionControl.firing = false;
                    Schutz(ad);
                }

                if (AmmunitionControl.currAmmoType.CurrAmmo <= 0)
                {
                    Modding.Logger.Log("START RELOADING NOW");
                    AmmunitionControl.reloading = true;
                }
            }
            else
            {
                orig(self);
            }
        }
示例#12
0
        void CharmUpdate(PlayerData data, HeroController controller)
        {
            HeroController.instance.ATTACK_DURATION = 0.41f;

            HeroController.instance.ATTACK_COOLDOWN_TIME = 0.36f;

            NailSlash Slash = HeroController.instance.normalSlash;

            NailSlash AltSlash = HeroController.instance.alternateSlash;

            NailSlash SlashUp = HeroController.instance.upSlash;

            NailSlash SlashDown = HeroController.instance.downSlash;

            if (counter == 0)
            {
                defaultSlashScale = Slash.scale;

                defaultAltScale = AltSlash.scale;

                defaultUpScale = SlashUp.scale;

                defaultDownScale = SlashDown.scale;
            }
            counter++;
            Slash.scale = defaultSlashScale;

            AltSlash.scale = defaultAltScale;

            SlashUp.scale = defaultUpScale;

            SlashDown.scale = defaultDownScale;

            HeroController.instance.ATTACK_DURATION_CH = 0.25f;

            HeroController.instance.ATTACK_COOLDOWN_TIME_CH = 0.25f;

            if (PlayerData.instance.GetBool("equippedCharm_13") && PlayerData.instance.GetBool("equippedCharm_18"))
            {
                PlayerData.instance.overcharmed = true;

                Slash.scale = UnityEngine.Vector3.Scale(Slash.scale, new UnityEngine.Vector3(1.6f, 0.35f, 1));

                AltSlash.scale = UnityEngine.Vector3.Scale(AltSlash.scale, new UnityEngine.Vector3(1.6f, 0.35f, 1));

                SlashUp.scale = UnityEngine.Vector3.Scale(SlashUp.scale, new UnityEngine.Vector3(0.35f, 1.6f, 1));

                SlashDown.scale = UnityEngine.Vector3.Scale(SlashDown.scale, new UnityEngine.Vector3(0.35f, 1.6f, 1));
            }

            else if (PlayerData.instance.GetBool("equippedCharm_13"))
            {
                PlayerData.instance.overcharmed = false;

                Slash.scale = UnityEngine.Vector3.Scale(Slash.scale, new UnityEngine.Vector3(1.4f, 0.56f, 1));

                AltSlash.scale = UnityEngine.Vector3.Scale(AltSlash.scale, new UnityEngine.Vector3(1.4f, 0.56f, 1));

                SlashUp.scale = UnityEngine.Vector3.Scale(SlashUp.scale, new UnityEngine.Vector3(0.56f, 1.4f, 1));

                SlashDown.scale = UnityEngine.Vector3.Scale(SlashDown.scale, new UnityEngine.Vector3(0.56f, 1.4f, 1));
            }

            else if (PlayerData.instance.GetBool("equippedCharm_18"))
            {
                PlayerData.instance.overcharmed = false;

                Slash.scale = UnityEngine.Vector3.Scale(Slash.scale, new UnityEngine.Vector3(1.3f, 0.73f, 1));

                AltSlash.scale = UnityEngine.Vector3.Scale(AltSlash.scale, new UnityEngine.Vector3(1.3f, 0.73f, 1));

                SlashUp.scale = UnityEngine.Vector3.Scale(SlashUp.scale, new UnityEngine.Vector3(0.73f, 1.3f, 1));

                SlashDown.scale = UnityEngine.Vector3.Scale(SlashDown.scale, new UnityEngine.Vector3(0.73f, 1.3f, 1));
            }
            else if (!PlayerData.instance.GetBool("equippedCharm_13") && !PlayerData.instance.GetBool("equippedCharm_18"))
            {
                PlayerData.instance.SetInt("nailDamage", defaultNailDamage);
            }
            if (PlayerData.instance.GetBool("equippedCharm_32"))
            {
                HeroController.instance.ATTACK_DURATION_CH = 0.15f;

                HeroController.instance.ATTACK_COOLDOWN_TIME_CH = 0.05f;
            }
            else if (!PlayerData.instance.GetBool("equippedCharm_32"))
            {
                HeroController.instance.ATTACK_DURATION_CH = 0.41f;

                HeroController.instance.ATTACK_COOLDOWN_TIME_CH = 0.36f;
            }
        }