public virtual void TakeDamage(float damage, DamageType type = DamageType.Physics, StageObject shooter = null) { // Check if ((shooter && shooter.Info.Team == Info.Team) || !IsAlive) { return; } // Logic if (!TheHealth.Invincible) { HP -= damage * TheHealth.GetFixedProtect(type); if (!IsAlive) { // Msg OnDied(); } } }
public virtual void TakeDamage(float damage, DamageType type = DamageType.Physics, StageObject shooter = null) { // Check if ((shooter && shooter.Info.Team == Info.Team) || !IsAlive) { return; } // Logic if (!TheHealth.Invincible) { HP -= damage * TheHealth.GetFixedProtect(type); if (BattleLog) { BattleLog.sizeDelta = new Vector2(0, BattleLog.rect.height + 11); BattleLog.GetComponent <Text>().text = BattleLog.GetComponent <Text>().text + " " + shooter.Info.Name + " dealt " + (damage * TheHealth.GetFixedProtect(type)) + " " + type + " damage to " + this.name + "\n"; } if (!IsAlive) { // Msg OnDied(); } } }