Ejemplo n.º 1
0
        public void HealthHaver_ApplyDamageHook(
            HealthHaver self, float damage, Vector2 direction, string sourceName, CoreDamageTypes damageTypes = CoreDamageTypes.None, DamageCategory damageCategory = DamageCategory.Normal,
            bool ignoreInvulnerabilityFrames = false, PixelCollider hitPixelCollider = null, bool ignoreDamageCaps = false)
        {//Killithid's ghosts spawn without correct hitboxes and crash game on hit, this method is a bandaid for that. Kills all enemies and projectiles in room
            try
            {
                self.orig_ApplyDamage(damage, direction, sourceName, damageTypes, damageCategory, ignoreInvulnerabilityFrames, hitPixelCollider, ignoreDamageCaps);
                if (0f < self.GetCurrentHealth() && 0f < damage && ETGModGUI.UseDamageIndicators)
                {
                    ETGDamageIndicatorGUI.HealthHaverTookDamage(self, damage);
                }
            }

            catch (Exception e)
            {
                Debug.Log("[Randomizer] HealthHaverHook Error" + e);
                RandomHandleEnemyInfo.DestroyEverything();
                throw;
            }
        }