Exemple #1
0
 public void StopCombatWith(Entity entity)
 {
     targets.Remove(entity);
     if (targets.Count == 0)
     {
         SendMessage("FinishCombat", entity);
     }
 }
Exemple #2
0
        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)
 {
 }
Exemple #9
0
 void Awake()
 {
     me = GetComponent<Entity>();
 }
Exemple #10
0
        void FinishCombat(Entity enemy)
        {
            movement.CancelMovement();

            events.CancelEvent((int)Events.BASIC_ATTACK);
        }
Exemple #11
0
        void EnterCombat(Entity enemy)
        {
            movement.AIMove(enemy.transform);

            events.RegistryEvent((int)Events.BASIC_ATTACK, Random.Range(3000, 6000));
        }
Exemple #12
0
 void EnemyLost(Entity enemy)
 {
     movement.AIMove(enemy.transform.position);
 }
Exemple #13
0
 protected override void AnyDamage(int damage, Entity damageCauser, DamageType damageType)
 {
 }
Exemple #14
0
 void PickUp(Entity entity)
 {
     UnityEngine.Debug.Log("Picked Up an Item!");
 }
Exemple #15
0
 void Start()
 {
     me = GetComponentInParent<Entity>();
     movement = me.Movement;
 }
Exemple #16
0
        void Awake()
        {
            me = GetComponent<Entity>();

            combat = CombatState.Idle;
        }
Exemple #17
0
 public bool IsInCombatWith(Entity entity)
 {
     return targets.Contains(entity);
 }