public void StopCombatWith(Entity entity) { targets.Remove(entity); if (targets.Count == 0) { SendMessage("FinishCombat", entity); } }
public void StartCombatWith(Entity entity) { if (!me.IsEnemyOf(entity) || IsInCombat()) return; targets.Add(entity); SendMessage("EnterCombat", entity); }
void Start() { me = GetComponent<Entity>(); events = new EventsMap<int>(this); SendMessage("JustSpawned"); }
void JustKilled(Entity victim) { }
void JustDead(Entity killer) { }
void FinishCombat(Entity enemy) { }
void EnterCombat(Entity target) { }
protected virtual void AnyDamage(int damage, Entity damageCauser, DamageType damageType) { }
void Awake() { me = GetComponent<Entity>(); }
void FinishCombat(Entity enemy) { movement.CancelMovement(); events.CancelEvent((int)Events.BASIC_ATTACK); }
void EnterCombat(Entity enemy) { movement.AIMove(enemy.transform); events.RegistryEvent((int)Events.BASIC_ATTACK, Random.Range(3000, 6000)); }
void EnemyLost(Entity enemy) { movement.AIMove(enemy.transform.position); }
protected override void AnyDamage(int damage, Entity damageCauser, DamageType damageType) { }
void PickUp(Entity entity) { UnityEngine.Debug.Log("Picked Up an Item!"); }
void Start() { me = GetComponentInParent<Entity>(); movement = me.Movement; }
void Awake() { me = GetComponent<Entity>(); combat = CombatState.Idle; }
public bool IsInCombatWith(Entity entity) { return targets.Contains(entity); }