private void OnEntityTakeDamage(EntityFightable entity, DamageSource dmgSource) { HookCalled("OnEntityHurt"); var source = (EntityFightable)GameManager.Instance.World.GetEntity(dmgSource.mdv0007()); var dmgtype = dmgSource.GetName(); PrintWarning($"{entity.EntityName} took {dmgtype} damage from {source.EntityName}"); }
public virtual void OnAttacked(DamageSource _damagesource, float _timer = 0.5f) { if (!B_isHit && !B_isDodging) { S_last_hit = _damagesource.GetName(); F_HP -= (_damagesource.GetDamage() * ((100 - F_defence) / 100)) * ((GetResistanceType() == _damagesource.GetAttackType()) ? 0.9f : 1); ResetOnHit(_timer); // Debug.Log("Attacked by: " + S_last_hit); } }
public void Damage(string damagerTeam, DamageSource source, int amount) { if (IsOnTeam(damagerTeam) || damagesThisFrame.Contains(source)) { return; } Debug.Log("Damaged " + amount + " by " + source.GetName() + " on team " + damagerTeam); OnDamage(source, amount); health -= amount; if (!IsAlive()) { OnDie(); } }
public AilmentDamageSpecification(DamageSource damageSource, Ailment ailment) : base(damageSource.GetName() + "." + ailment.GetName(), damageSource, ailment) { }
public SkillDamageSpecification(DamageSource damageSource) : base(damageSource.GetName() + ".Skill", damageSource, null) { }