private void Start()
        {
            if (chanceToApply >= UnityEngine.Random.value)
            {
                WeakenedDebuff = new AIActorDebuffEffect
                {
                    HealthMultiplier     = EnemyHealthModifier,
                    CooldownMultiplier   = EnemyCooldownModifier,
                    SpeedMultiplier      = EnemySpeedMultiplier,
                    KeepHealthPercentage = EnemyKeepHealthPercentage,
                    OverheadVFX          = MagickeCauldron.overheadder,
                    duration             = EnemyDuration
                };
                BossWeakenedDebuff = new AIActorDebuffEffect
                {
                    HealthMultiplier     = BossHealthModifier,
                    CooldownMultiplier   = BossCooldownModifier,
                    SpeedMultiplier      = BossSpeedMultiplier,
                    KeepHealthPercentage = BossKeepHealthPercentage,
                    OverheadVFX          = MagickeCauldron.overheadder,
                    duration             = BossDuration
                };

                base.GetComponent <Projectile>().OnHitEnemy += this.OnHitenemy;
            }
        }
Beispiel #2
0
        protected override void OnBlank(Vector2 centerPoint, PlayerController user)
        {
            List <AIActor> activeEnemies = GameManager.Instance.Dungeon.data.GetAbsoluteRoomFromPosition(centerPoint.ToIntVector2(VectorConversions.Round)).GetActiveEnemies(RoomHandler.ActiveEnemyType.All);

            if (activeEnemies != null)
            {
                for (int j = 0; j < activeEnemies.Count; j++)
                {
                    AIActor             aiactor      = activeEnemies[j];
                    AIActorDebuffEffect debuffEffect = null;
                    foreach (AttackBehaviorBase attackBehaviour in EnemyDatabase.GetOrLoadByGuid((PickupObjectDatabase.GetById(492) as CompanionItem).CompanionGuid).behaviorSpeculator.AttackBehaviors)
                    {
                        if (attackBehaviour is WolfCompanionAttackBehavior)
                        {
                            debuffEffect = (attackBehaviour as WolfCompanionAttackBehavior).EnemyDebuff;
                        }
                    }
                    if (debuffEffect != null && !aiactor.IsBlackPhantom)
                    {
                        aiactor.ApplyEffect(debuffEffect, 1, null);
                    }
                    if (user != null && user.PlayerHasActiveSynergy("#FORBIDDEN_AMMOLET_OF_CONFUSION"))
                    {
                        if (aiactor.behaviorSpeculator != null)
                        {
                            aiactor.behaviorSpeculator.Stun(3, true);
                        }
                    }
                }
            }
        }
Beispiel #3
0
 private void OnPostProcessProjectile(Projectile proj, float f)
 {
     if (this.m_owner.HasPickupID(351))
     {
         ExplosiveModifier mod = proj.gameObject.AddComponent <ExplosiveModifier>();
         mod.explosionData = GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultExplosionData;
     }
     if (this.m_owner.HasPickupID(348))
     {
         proj.baseData.speed  *= 2f;
         proj.baseData.damage *= 1.5f;
     }
     if (this.m_owner.HasPickupID(349))
     {
         proj.baseData.speed  /= 2f;
         proj.baseData.damage *= 2f;
         proj.baseData.force  *= 1.5f;
     }
     if (this.m_owner.HasPickupID(350))
     {
         PierceProjModifier pierceMod = proj.gameObject.GetOrAddComponent <PierceProjModifier>();
         pierceMod.penetratesBreakables       = true;
         pierceMod.preventPenetrationOfActors = false;
         pierceMod.penetration = 999;
     }
     if (this.m_owner.HasPickupID(303))
     {
         proj.BossDamageMultiplier *= 2f;
         proj.ignoreDamageCaps      = true;
     }
     if (this.m_owner.HasPickupID(491) || this.m_owner.PlayerHasCompletionGun())
     {
         if (UnityEngine.Random.value <= 0.05f)
         {
             Projectile proj2             = ((Gun)PickupObjectDatabase.GetById(16)).DefaultModule.projectiles[UnityEngine.Random.Range(0, ((Gun)PickupObjectDatabase.GetById(476)).DefaultModule.projectiles.Count)];
             BraveInput instanceForPlayer = BraveInput.GetInstanceForPlayer(this.m_owner.PlayerIDX);
             bool       flag2             = instanceForPlayer == null;
             float      z     = 0;
             bool       notDo = false;
             if (!flag2)
             {
                 bool    flag3 = instanceForPlayer.IsKeyboardAndMouse(false);
                 Vector2 a     = Vector2.zero;
                 if (flag3)
                 {
                     a = this.m_owner.unadjustedAimPoint.XY() - base.sprite.WorldCenter;
                 }
                 else
                 {
                     bool flag4 = instanceForPlayer.ActiveActions == null;
                     if (flag4)
                     {
                         notDo = true;
                     }
                     else
                     {
                         a = instanceForPlayer.ActiveActions.Aim.Vector;
                     }
                 }
                 if (!notDo)
                 {
                     a.Normalize();
                     z = BraveMathCollege.Atan2Degrees(a);
                 }
             }
             if (!notDo)
             {
                 GameObject obj       = SpawnManager.SpawnProjectile(proj2.gameObject, this.m_owner.sprite.WorldCenter, Quaternion.Euler(0, 0, z));
                 Projectile component = obj.GetComponent <Projectile>();
                 if (component != null)
                 {
                     component.Owner   = this.m_owner;
                     component.Shooter = this.m_owner.specRigidbody;
                 }
             }
         }
     }
     if (this.m_owner.HasPickupID(492) || this.m_owner.PlayerHasCompletionGun())
     {
         if (UnityEngine.Random.value <= 0.1f)
         {
             proj.AdjustPlayerProjectileTint(Color.red, 0);
             proj.OnHitEnemy += delegate(Projectile proj3, SpeculativeRigidbody enemyRigidbody, bool fatal)
             {
                 if (enemyRigidbody.aiActor != null)
                 {
                     AIActor             aiactor      = enemyRigidbody.aiActor;
                     AIActorDebuffEffect debuffEffect = null;
                     foreach (AttackBehaviorBase attackBehaviour in EnemyDatabase.GetOrLoadByGuid((PickupObjectDatabase.GetById(492) as CompanionItem).CompanionGuid).behaviorSpeculator.AttackBehaviors)
                     {
                         if (attackBehaviour is WolfCompanionAttackBehavior)
                         {
                             debuffEffect = (attackBehaviour as WolfCompanionAttackBehavior).EnemyDebuff;
                         }
                     }
                     if (debuffEffect != null)
                     {
                         aiactor.ApplyEffect(debuffEffect, 1, null);
                     }
                 }
             };
         }
     }
     if (this.m_owner.HasPickupID(493) || this.m_owner.PlayerHasCompletionGun())
     {
         if (UnityEngine.Random.value <= 0.1f)
         {
             Projectile proj2             = ((Gun)PickupObjectDatabase.GetById(476)).DefaultModule.projectiles[UnityEngine.Random.Range(0, ((Gun)PickupObjectDatabase.GetById(476)).DefaultModule.projectiles.Count)];
             BraveInput instanceForPlayer = BraveInput.GetInstanceForPlayer(this.m_owner.PlayerIDX);
             bool       flag2             = instanceForPlayer == null;
             float      z     = 0;
             bool       notDo = false;
             if (!flag2)
             {
                 bool    flag3 = instanceForPlayer.IsKeyboardAndMouse(false);
                 Vector2 a     = Vector2.zero;
                 if (flag3)
                 {
                     a = this.m_owner.unadjustedAimPoint.XY() - base.sprite.WorldCenter;
                 }
                 else
                 {
                     bool flag4 = instanceForPlayer.ActiveActions == null;
                     if (flag4)
                     {
                         notDo = true;
                     }
                     else
                     {
                         a = instanceForPlayer.ActiveActions.Aim.Vector;
                     }
                 }
                 if (!notDo)
                 {
                     a.Normalize();
                     z = BraveMathCollege.Atan2Degrees(a);
                 }
             }
             if (!notDo)
             {
                 GameObject obj       = SpawnManager.SpawnProjectile(proj2.gameObject, this.m_owner.sprite.WorldCenter, Quaternion.Euler(0, 0, z));
                 Projectile component = obj.GetComponent <Projectile>();
                 if (component != null)
                 {
                     component.Owner   = this.m_owner;
                     component.Shooter = this.m_owner.specRigidbody;
                 }
             }
         }
     }
     if (this.m_owner.HasPickupID(494) || this.m_owner.PlayerHasCompletionGun())
     {
         if (UnityEngine.Random.value <= 0.05f)
         {
             proj.AdjustPlayerProjectileTint(Color.cyan, 0, 0);
             proj.BossDamageMultiplier *= 2;
             proj.ignoreDamageCaps      = true;
         }
     }
     if (this.m_owner.HasPickupID(573) || this.m_owner.PlayerHasCompletionGun())
     {
         if (UnityEngine.Random.value <= 0.25f)
         {
             proj.AdjustPlayerProjectileTint(Color.white, 0, 0);
             proj.OnHitEnemy += delegate(Projectile proj2, SpeculativeRigidbody enemyRigidbody, bool fatal)
             {
                 if (enemyRigidbody.aiActor != null && enemyRigidbody.aiActor.behaviorSpeculator != null)
                 {
                     enemyRigidbody.aiActor.behaviorSpeculator.Stun(2f, true);
                 }
             };
         }
     }
     if (this.m_owner.HasPickupID(572) || this.m_owner.PlayerHasCompletionGun())
     {
         if (this.m_owner.healthHaver != null && this.m_owner.healthHaver.GetCurrentHealthPercentage() >= 1f)
         {
             proj.baseData.damage *= 1.5f;
             proj.AdjustPlayerProjectileTint(Color.magenta, 0, 0);
         }
     }
 }