private void addNapalm(On.HealthManager.orig_TakeDamage orig, HealthManager self, HitInstance hitinstance) { if ((hitinstance.DamageDealt * hitinstance.Multiplier) >= (self.hp)) { orig(self, hitinstance); return; } if (hitinstance.Source.name.Contains("Fireball2")) { redwing_game_objects.addNapalm(self.gameObject, PlayerData.instance.GetBool("equippedCharm_19") ? 30.0 : 24.0, Color.red); } else if (hitinstance.Source.name.Contains("Fireball")) { redwing_game_objects.addNapalm(self.gameObject, PlayerData.instance.GetBool("equippedCharm_19") ? 20.0 : 15.0, Color.white); } else if (hitinstance.Source.name.Contains("Q Fall Damage")) { redwing_game_objects.addNapalm(self.gameObject, PlayerData.instance.GetBool("equippedCharm_19") ? 20.0 : 15.0, Color.white); } orig(self, hitinstance); }
private void addNapalm(On.HealthManager.orig_TakeDamage orig, HealthManager self, HitInstance hitinstance) { if (hitinstance.DamageDealt * hitinstance.Multiplier >= self.hp) { orig(self, hitinstance); return; } if (hitinstance.Source.name.Contains("Slash") && (hitinstance.Source.name.Contains("Dash") || hitinstance.Source.name.Contains("Great"))) { if (PlayerData.instance.GetBool("equippedCharm_6") && PlayerData.instance.GetInt("health") == 1) { redwing_game_objects.addNapalm(self.gameObject, 6.0 * (PlayerData.instance.nailSmithUpgrades + 1.0), Color.green); } else { redwing_game_objects.addNapalm(self.gameObject, 3.0 * (PlayerData.instance.nailSmithUpgrades + 1.0), Color.green); } } else if (hitinstance.Source.name.Contains("Slash")) { if (PlayerData.instance.GetBool("equippedCharm_6") && PlayerData.instance.GetInt("health") == 1) { redwing_game_objects.addNapalm(self.gameObject, 2.0 * (PlayerData.instance.nailSmithUpgrades + 1.0), Color.red); } else { redwing_game_objects.addNapalm(self.gameObject, PlayerData.instance.nailSmithUpgrades + 1.0, Color.white); } } else if (hitinstance.Source.name.Contains("Fireball2")) { redwing_game_objects.addNapalm(self.gameObject, PlayerData.instance.GetBool("equippedCharm_19") ? 30.0 : 24.0, Color.black); } else if (hitinstance.Source.name.Contains("Fireball")) { redwing_game_objects.addNapalm(self.gameObject, PlayerData.instance.GetBool("equippedCharm_19") ? 20.0 : 15.0, Color.white); } else if (hitinstance.Source.name.Contains("Q Fall Damage")) { redwing_game_objects.addNapalm(self.gameObject, PlayerData.instance.GetBool("equippedCharm_19") ? 20.0 : 15.0, Color.white); } else if (hitinstance.Source.name.Contains("Hit")) { redwing_game_objects.addNapalm(self.gameObject, hitinstance.DamageDealt * 0.15, Color.yellow); } orig(self, hitinstance); }
private void OnTakeDamage(On.HealthManager.orig_TakeDamage orig, HealthManager self, HitInstance hitInstance) { if (self.gameObject.name == "Doppelgänger Grimmchild") { Owner.GetComponent <HealthManager>().Hit(hitInstance); } orig(self, hitInstance); }
private void OnTakeDamage(On.HealthManager.orig_TakeDamage orig, HealthManager self, HitInstance hitInstance) { if (self.gameObject.name.Contains("Cagney Carnation")) { _he.RecieveHitEffect(hitInstance.Direction); _sf.flashFocusHeal(); } orig(self, hitInstance); }
private void OnTakeDamage(On.HealthManager.orig_TakeDamage orig, HealthManager self, HitInstance hitInstance) { if (self.gameObject.GetInstanceID() == gameObject.GetInstanceID()) { _he.RecieveHitEffect(hitInstance.Direction); _sf.flashFocusHeal(); } orig(self, hitInstance); }
public void RemoveCycloneKnockback(On.HealthManager.orig_TakeDamage orig, HealthManager self, HitInstance instance) { if (instance.Source.transform.parent.parent.gameObject.name == "Cyclone Slash") { var recoil = self.GetAttr <Recoil>("recoil"); self.SetAttr <Recoil>("recoil", null); orig(self, instance); self.SetAttr("recoil", recoil); return; } orig(self, instance); }
private void OnTakeDamage(On.HealthManager.orig_TakeDamage orig, HealthManager self, HitInstance hitInstance) { if (self.gameObject.name == "Doppelgänger") { GetComponent <EnemyHitEffectsUninfected>().RecieveHitEffect(hitInstance.Direction); GetComponent <SpriteFlash>().flashFocusHeal(); } orig(self, hitInstance); _furyActivated = _pd.equippedCharm_6 && _hm.hp < _furyThreshold; }
private void HealthManager_TakeDamage(On.HealthManager.orig_TakeDamage orig, HealthManager self, HitInstance hitInstance) { if (self.name.Contains("prop")) { propDmg = true; if (!flashing) { flashing = true; StartCoroutine(FlashWhite()); } } orig(self, hitInstance); }
private void HealthManager_TakeDamage(On.HealthManager.orig_TakeDamage orig, HealthManager self, HitInstance hitInstance) { if (self.name.Contains("fennel")) { if (_hm.hp >= HP_PHASE2) { _hitEffects.RecieveHitEffect(hitInstance.Direction); } if (!flashing) { flashing = true; StartCoroutine(FlashWhite()); } } orig(self, hitInstance); }
private void SetDamages(On.HealthManager.orig_TakeDamage orig, HealthManager owner, HitInstance hit) { Log($@"Creating HitInstance {hit.AttackType}, {hit.Source}, {hit.DamageDealt}, {hit.Multiplier} for {owner.name}"); _dashDamage = 5 + PlayerData.instance.GetInt("nailSmithUpgrades") * 4; float multiplier = 1; if (PlayerData.instance.GetBool("hasShadowDash")) { multiplier *= 2; } if (PlayerData.instance.GetBool("equippedCharm_25")) { multiplier *= 1.5f; } if (PlayerData.instance.GetBool("equippedCharm_6") && PlayerData.instance.GetInt("health") == 1) { multiplier *= 1.75f; } if (_oldDashDamage != _dashDamage) { LogDebug($@"[Blackmoth] Sharp Shadow Damage set to {_dashDamage}"); _oldDashDamage = _dashDamage; } if (hit.AttackType == AttackTypes.SharpShadow || hit.Source.name == "SuperDash Damage" && PlayerData.instance.GetBool("defeatedNightmareGrimm")) { LogDebug($@"Setting damage for {owner.name}"); hit.DamageDealt = _dashDamage; hit.AttackType = 0; hit.Multiplier = multiplier; hit.Direction = HeroController.instance.cState.facingRight ? 0 : 180; hit.MagnitudeMultiplier = PlayerData.instance.GetBool("equippedCharm_15") ? 2f : 0f; } else if (hit.AttackType == AttackTypes.Nail) { LogDebug($@"Setting damage for {owner.name}"); hit.DamageDealt = 1; } LogDebug($@"Creating HitInstance {hit.AttackType}, {hit.Source}, {hit.DamageDealt}, {hit.Multiplier} for {owner.name}"); orig(owner, hit); }
public void EnemyTookDamage(On.HealthManager.orig_TakeDamage orig, global::HealthManager self, global::HitInstance hit) { if (hit.AttackType == AttackTypes.SharpShadow && global::PlayerData.instance.equippedCharm_16 && global::PlayerData.instance.gotShadeCharm) { this.hitCount++; //Counter for healing //Only heal with sharp shadow while at full MP if (atMaxMP()) { HeroController.instance.AddHealth(this.hitCount >= 2 ? 1 : 0); //Heal every 2 hits with sharp shadow. this.hitCount = 0; } else { HeroController.instance.AddMPCharge(16); //Affected by soul catcher? } HeroController.instance.ResetAirMoves(); //Reset air dash when hitting enemy with sharp shadow. //TODO make sharp shadow cost more? } orig(self, hit); }
private void hitEnemy(On.HealthManager.orig_TakeDamage orig, HealthManager self, HitInstance hitinstance) { if (globals.fileSettings.onlyEnableInGodmaster && !inGodmasterBattle) { orig(self, hitinstance); return; } barActive = true; if (globals.fileSettings.comboAffectsPlayerDamage) { hitinstance.DamageDealt = (int)Math.Round((hitinstance.DamageDealt * globals.fileSettings.damageModifier * currentLevel)); if (hitinstance.DamageDealt < 1) { hitinstance.DamageDealt = 1; } } orig(self, hitinstance); if (autoPauseModule.godmasterTrackedHms.Contains(self) && (self.isDead || self.hp <= 0)) { autoPauseModule.godmasterTrackedHms.Remove(self); if (autoPauseModule.godmasterTrackedHms.Count == 0) { barActive = false; } } bool hasObject = sceneEnemies.Contains(self.gameObject); if ((self.isDead || self.hp <= 0) && hasObject) { sceneEnemies.Remove(self.gameObject); } else if (!hasObject && (!self.isDead && self.hp > 0)) { sceneEnemies.Add(self.gameObject); } if (comboBarPicture != null) { comboMeter = 1.0; comboBarPicture.fillAmount = (float)comboMeter; numHits++; if (inGodmasterBattle) { godmasterTotalHits++; if (godmasterBestCombo < numHits) { godmasterBestCombo = numHits; } } updateComboBars(); } }