Example #1
0
 private void OnEntityDeath(EntityDeath data)
 {
     if (data.deadEntity.entityType != EntityType.Unit)
     {
         // do Items die?
         return;
     }
     if (data.deadEntity.isPlayer)
     {
         // Player dead! Time to roll up a new character
         Global.PlayerDeath playerDeath = new PlayerDeath();
         playerDeath.playerName   = data.deadEntity.Name;
         playerDeath.points       = 100; // TODO get this from total artifacts collected
         playerDeath.playerEntity = data.deadEntity;
         playerDeath.FireEvent();
         Player.ChangeActiveStatus(false);
         PoolEntity(data.deadEntity);
         return;
     }
     if (data.deadEntity.CanEndTurnCB != null)
     {
         if (data.deadEntity.CanEndTurnCB() == true)
         {
             TurnManager.instance.FinishTurn();
         }
     }
     DeactivateEnemy(data.deadEntity);
 }