using System.Collections; using System.Collections.Generic; using UnityEngine; using RPGCreationKit; namespace RPGCreationKit { /// /// Contains information about the damage received/gaved /// public class DamageContext { public float amount; public Entity sender; public bool wasBlocked; public WeaponItem weaponItem; public AmmoItem ammoItem; public Spell spell; public DamageContext(float _amount, Entity _sender, WeaponItem _weaponItem, AmmoItem _ammoItem, bool _wasBlocked, Spell _spell = null) { amount = _amount; sender = _sender; weaponItem = _weaponItem; ammoItem = _ammoItem; wasBlocked = _wasBlocked; spell = _spell; } } /// /// Used on objects that has EntityAttributes on them an therefore can be damaged. /// public interface IDamageable { /// /// Damages the Entity if a DamageContext is provided. /// /// void Damage(DamageContext damageContext); void DamageBlocked(DamageContext damageContext); /// /// Generates particle for the damaged object /// void GenerateBlood(); /// /// Makes the Entity die. /// void Die(); /// /// Returns true if the Entity is hostile. /// /// bool IsHostile(); /// /// Returns true if the Entity is hostile against the Player Character. /// /// bool IsHostileAgainstPC(); /// /// Returns true if the the Healthbar on the PlayerUI should be used when this entity is hostile. /// /// bool ShouldDisplayHealthIfHostile(); /// /// Returns true if the target is alive. /// bool IsAlive(); /// /// Returns true if the target is unconscious. /// /// bool IsUnconscious(); /// /// Gets the max HP value of the Entity /// /// float GetMaxHP(); /// /// Gets the current HP value of the Entity /// /// float GetCurrentHP(); /// /// Gets the name of the Entity /// /// string GetEntityName(); /// /// Gets the name of the Entity /// /// string GetEntityID(); Entity GetEntity(); bool Bleeds(); void InstantiateBlood(Vector3 pos); } }