public static void addNapalm(GameObject target, double fireToAdd, Color fireColor) { HealthManager hm = getHealthManagerRecursive(target); napalm n = hm.gameObject.GetOrAddComponent <napalm>(); n.addNapalm(fireToAdd, fireColor); }
public static void applyHitInstance(GameObject target, int expectedDamage, GameObject source, float flameGain) { int realDamage = expectedDamage; double multiplier = 1; if (PlayerData.instance.GetBool("equippedCharm_25")) { multiplier *= 1.5; } if (PlayerData.instance.GetBool("equippedCharm_6") && PlayerData.instance.GetInt("health") == 1) { multiplier *= 1.75f; } if (gng_bindings.hasNailBinding()) { multiplier *= 0.3; } realDamage = (int)Math.Round(realDamage * multiplier); if (realDamage <= 0) { return; } HealthManager targetHP = getHealthManagerRecursive(target); if (targetHP == null) { return; } if (GameManager.instance.GetComponent <rebalanced_hooks>() != null) { GameManager.instance.GetComponent <rebalanced_hooks>().flamePower += flameGain; } //Modding.Logger.Log("[Redwing] Doing " + realDamage + " damage with attack name " + source.name); targetHP.hp -= realDamage; if (targetHP.hp <= 0f) { targetHP.Die(0f, AttackTypes.Nail, true); return; } FSMUtility.SendEventToGameObject(targetHP.gameObject, "BLOCKED HIT", false); FSMUtility.SendEventToGameObject(source, "HIT LANDED", false); if ((Object)targetHP.gameObject.GetComponent <DontClinkGates>() != (Object)null) { return; } FSMUtility.SendEventToGameObject(targetHP.gameObject, "HIT", false); GameManager.instance.FreezeMoment(1); GameCameras.instance.cameraShakeFSM.SendEvent("EnemyKillShake"); napalm memes = targetHP.gameObject.GetOrAddComponent <napalm>(); memes.addNapalm(realDamage * (0.10), Color.green); /* * targetHP.Hit(new HitInstance * { * Source = source, * AttackType = damageType, * CircleDirection = false, * DamageDealt = realDamage, * Direction = 0f, * IgnoreInvulnerable = true, * MagnitudeMultiplier = 1f, * MoveAngle = 0f, * MoveDirection = false, * Multiplier = 1f, * SpecialType = SpecialTypes.None, * IsExtraDamage = false * });*/ }