Esempio n. 1
0
 private void OnHitEnemy(Projectile arg1, SpeculativeRigidbody arg2, bool arg3)
 {
     if (bighead2 == 6)
     {
         base.StartCoroutine(this.HandleFear(gun.CurrentOwner as PlayerController, arg2));
     }
     if (bighead2 == 5)
     {
         GameActorHealthEffect irradiatedLeadEffect = PickupObjectDatabase.GetById(204).GetComponent <BulletStatusEffectItem>().HealthModifierEffect;
         arg2.aiActor.ApplyEffect(irradiatedLeadEffect, 2f, arg1);
     }
     if (bighead2 == 2)
     {
         GameActorFireEffect hotLeadEffect = PickupObjectDatabase.GetById(295).GetComponent <BulletStatusEffectItem>().FireModifierEffect;
         arg2.aiActor.ApplyEffect(hotLeadEffect, 2f, arg1);
     }
     if (bighead2 == 1)
     {
         arg2.aiActor.healthHaver.ApplyDamage(1f * (gun.CurrentOwner as PlayerController).stats.GetStatValue(PlayerStats.StatType.Damage), Vector2.zero, "Erasure", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
         GlobalSparksDoer.DoRadialParticleBurst(50, arg2.specRigidbody.HitboxPixelCollider.UnitCenter, arg2.specRigidbody.HitboxPixelCollider.UnitCenter, 90f, 2f, 0f, null, null, Color.red, GlobalSparksDoer.SparksType.BLOODY_BLOOD);
     }
     if (bighead2 == 3)
     {
         arg2.aiActor.ApplyEffect(this.cheeseEffect, 3f, null);
     }
     if (bighead2 == 7)
     {
         GameActorCharmEffect charmingRoundsEffect = PickupObjectDatabase.GetById(527).GetComponent <BulletStatusEffectItem>().CharmModifierEffect;
         arg2.aiActor.ApplyEffect(charmingRoundsEffect, 3f, null);
     }
     if (bighead2 == 4)
     {
         GameActorFreezeEffect frostBulletsEffect = PickupObjectDatabase.GetById(278).GetComponent <BulletStatusEffectItem>().FreezeModifierEffect;
         arg2.aiActor.ApplyEffect(frostBulletsEffect, 3f, null);
     }
     if (bighead2 == 8)
     {
         GameActorSpeedEffect tripleCrossbowSlowEffect = (PickupObjectDatabase.GetById(381) as Gun).DefaultModule.projectiles[0].speedEffect;
         arg2.aiActor.ApplyEffect(tripleCrossbowSlowEffect, 3f, null);
     }
 }
        private void HandlePostRigidbodyMovement(SpeculativeRigidbody inSrb, Vector2 inVec2, IntVector2 inPixels)
        {
            if (!this.m_player || this.m_player.IsGhost || this.m_player.IsStealthed || Dungeon.IsGenerating || BraveTime.DeltaTime == 0f)
            {
                return;
            }

            if (this.m_player.HasPickupID(Vampirecloak.VampirecloakPickupID))
            {
                RedMatterParticleController redMatterController = GlobalSparksDoer.GetRedMatterController();
                BloodthirstSettings         bloodthirstOptions  = GameManager.Instance.BloodthirstOptions;
                float radius                 = 5f;
                float damagePerSecond        = 10f;
                float SynergydamagePerSecond = 20f;
                float percentAffected        = 1f;
                int   gainPerHeal            = 5;
                int   maxRequired            = 50;
                if (this.AuraAction == null)
                {
                    this.AuraAction = delegate(AIActor actor, float dist)
                    {
                        if (!actor || !actor.healthHaver)
                        {
                            return;
                        }
                        actor.HasBeenBloodthirstProcessed = true;
                        actor.CanBeBloodthirsted          = (UnityEngine.Random.value < percentAffected);
                        if (actor.CanBeBloodthirsted && actor.sprite)
                        {
                            Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(actor.sprite);
                            if (outlineMaterial != null)
                            {
                                outlineMaterial.SetColor("_OverrideColor", new Color(1f, 0f, 0f));
                            }
                        }

                        if (dist < radius && actor.CanBeBloodthirsted && !actor.IsGone)
                        {
                            float Synergydamage = SynergydamagePerSecond * BraveTime.DeltaTime;
                            float damage        = damagePerSecond * BraveTime.DeltaTime;
                            bool  isDead        = actor.healthHaver.IsDead;
                            if (m_player.HasPickupID(285))
                            {
                                actor.healthHaver.ApplyDamage(Synergydamage, Vector2.zero, "Bloodthirst", CoreDamageTypes.None, DamageCategory.Normal, false, null, false);
                            }
                            if (!m_player.HasPickupID(285))
                            {
                                actor.healthHaver.ApplyDamage(damage, Vector2.zero, "Bloodthirst", CoreDamageTypes.None, DamageCategory.Normal, false, null, false);
                            }
                            if (!isDead && actor.healthHaver.IsDead)
                            {
                                this.m_currentNumKills++;
                                if (this.m_currentNumKills >= this.m_currentNumKillsRequired)
                                {
                                    this.m_currentNumKills = 0;
                                    if (this.m_player.healthHaver.GetCurrentHealthPercentage() < 1f)
                                    {
                                        this.m_player.healthHaver.ApplyHealing(0.5f);
                                        this.m_currentNumKillsRequired = Mathf.Min(maxRequired, this.m_currentNumKillsRequired + gainPerHeal);
                                        GameObject gameObject = BraveResources.Load <GameObject>("Global VFX/VFX_Healing_Sparkles_001", ".prefab");
                                        if (gameObject != null)
                                        {
                                            this.m_player.PlayEffectOnActor(gameObject, Vector3.zero, true, false, false);
                                        }
                                        AkSoundEngine.PostEvent("Play_OBJ_med_kit_01", this.gameObject);
                                    }
                                }
                            }
                            GlobalSparksDoer.DoRadialParticleBurst(3, actor.specRigidbody.HitboxPixelCollider.UnitBottomLeft, actor.specRigidbody.HitboxPixelCollider.UnitTopRight, 90f, 4f, 0f, null, null, null, GlobalSparksDoer.SparksType.RED_MATTER);
                        }
                    };
                }
                if (this.m_player != null && this.m_player.CurrentRoom != null)
                {
                    this.m_player.CurrentRoom.ApplyActionToNearbyEnemies(this.m_player.CenterPosition, 100f, this.AuraAction);
                }
                if (redMatterController)
                {
                    redMatterController.target.position = this.m_player.CenterPosition;
                    redMatterController.ProcessParticles();
                }
            }
        }