private IEnumerator DoSlash(float angle, float delay)
        {
            yield return(new WaitForSeconds(delay));

            if (slashParameters == null)
            {
                slashParameters = new SlashData(); ETGModConsole.Log("Made a new slashparam");
            }


            Projectile             proj    = this.m_projectile;
            List <GameActorEffect> effects = new List <GameActorEffect>();

            effects.AddRange(proj.GetFullListOfStatusEffects(true));

            SlashData instSlash = SlashData.CloneSlashData(slashParameters);

            if (SlashDamageUsesBaseProjectileDamage)
            {
                instSlash.damage              = this.m_projectile.baseData.damage;
                instSlash.bossDamageMult      = this.m_projectile.BossDamageMultiplier;
                instSlash.jammedDamageMult    = this.m_projectile.BlackPhantomDamageMultiplier;
                instSlash.enemyKnockbackForce = this.m_projectile.baseData.force;
            }
            instSlash.OnHitTarget += SlashHitTarget;

            SlashDoer.DoSwordSlash(this.m_projectile.specRigidbody.UnitCenter, (this.m_projectile.Direction.ToAngle() + angle), owner, instSlash);

            if (DestroyBaseAfterFirstSlash)
            {
                StartCoroutine(Suicide());
            }
            yield break;
        }
Example #2
0
        private void Slash(PlayerController player)
        {
            Vector2 vector     = player.CenterPosition;
            Vector2 normalized = (player.unadjustedAimPoint.XY() - vector).normalized;

            Vector2 dir        = (player.CenterPosition + normalized);
            float   angleToUse = player.CurrentGun.CurrentAngle;

            SlashData slashParams = new SlashData();

            slashParams.damage = 20f * player.stats.GetStatValue(PlayerStats.StatType.Damage);
            slashParams.enemyKnockbackForce = 10f * player.stats.GetStatValue(PlayerStats.StatType.KnockbackMultiplier);

            SlashDoer.DoSwordSlash(dir, angleToUse, player, slashParams, null);
        }
        private IEnumerator DoSlash(PlayerController user, float angle, float delay, SlashData slashParameters)
        {
            yield return(new WaitForSeconds(delay));

            AkSoundEngine.PostEvent("Play_WPN_blasphemy_shot_01", user.gameObject);
            Vector2 vector     = user.CenterPosition;
            Vector2 normalized = (user.unadjustedAimPoint.XY() - vector).normalized;

            normalized = normalized.Rotate(angle);
            Vector2 dir        = (user.CenterPosition + normalized * 0.75f);
            float   angleToUse = user.CurrentGun.CurrentAngle + angle;

            SlashDoer.DoSwordSlash(dir, angleToUse, user, slashParameters, user.transform);
            if (user.PlayerHasActiveSynergy("Tri-Tip Dagger"))
            {
                Vector2 normalized2 = normalized.Rotate(45);
                Vector2 dir2        = (user.CenterPosition + normalized2 * 0.75f);
                SlashDoer.DoSwordSlash(dir2, angleToUse + 45, user, slashParameters, user.transform);
                Vector2 normalized3 = normalized.Rotate(-45);
                Vector2 dir3        = (user.CenterPosition + normalized3 * 0.75f);
                SlashDoer.DoSwordSlash(dir3, angleToUse + -45, user, slashParameters, user.transform);
            }
            yield break;
        }