public void Awake() { LoggerMenu = new ETGModDebugLogMenu(); LoaderMenu = new ETGModLoaderMenu(); ConsoleMenu = new ETGModConsole(); InspectorMenu = new ETGModInspector(); ETGDamageIndicatorGUI.Create(); }
protected void ApplyDamage(float damage, Vector2 direction, string sourceName, CoreDamageTypes damageTypes = CoreDamageTypes.None, DamageCategory damageCategory = DamageCategory.Normal, bool ignoreInvulnerabilityFrames = false, PixelCollider hitPixelCollider = null, bool ignoreDamageCaps = false) { orig_ApplyDamage(damage, direction, sourceName, damageTypes, damageCategory, ignoreInvulnerabilityFrames, hitPixelCollider, ignoreDamageCaps); if (0f < currentHealth && 0f < damage && ETGModGUI.UseDamageIndicators) { ETGDamageIndicatorGUI.HealthHaverTookDamage(this, damage); } }
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; } }
public void Awake() { BoxTexture = new Texture2D(1, 1); BoxTexture.SetPixel(0, 0, Color.white); BoxTexture.Apply(); loggerMenu = new ETGModDebugLogMenu(); loggerMenu.Start(); loaderMenu = new ETGModLoaderMenu(); loaderMenu.Start(); consoleMenu = new ETGModConsole(); consoleMenu.Start(); inspectorMenu = new ETGModInspector(); inspectorMenu.Start(); ETGDamageIndicatorGUI.Create(); StartCoroutine(ListAllItemsAndGuns()); }
protected void method_16(float float_14, Vector2 vector2_1, string string_6, GEnum1 genum1_0, GEnum165 genum165_0 = GEnum165.const_0, bool bool_18 = false, PixelCollider pixelCollider_0 = null, bool bool_19 = false) { if (currentHealth == 0) { orig_method_16(float_14, vector2_1, string_6, genum1_0, genum165_0, bool_18, pixelCollider_0, bool_19); return; } float currHP = this.currentHealth; orig_method_16(float_14, vector2_1, string_6, genum1_0, genum165_0, bool_18, pixelCollider_0, bool_19); float newHP = this.currentHealth; float deltaHP = currHP - newHP; Vector3 centerPos = this.SpeculativeRigidbody_0.Vector2_4; centerPos += this.transform.up; if (ETGModGUI.UseDamageIndicators) { ETGDamageIndicatorGUI.CreateIndicator(centerPos, deltaHP); ETGDamageIndicatorGUI.CreateBar(this); } ETGDamageIndicatorGUI.maxHP[this] = maximumHealth; ETGDamageIndicatorGUI.currentHP[this] = currentHealth; ETGDamageIndicatorGUI.UpdateHealthBar(this, deltaHP); if (currentHealth == 0) { ETGDamageIndicatorGUI.toRemoveBars.Add(this); ETGDamageIndicatorGUI.maxHP.Remove(this); ETGDamageIndicatorGUI.currentHP.Remove(this); } }