Esempio n. 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);
 }
Esempio n. 2
0
    public void OnEntityDeathEvent(EntityDeath ede)
    {
        Debug.Log("death");
        List <Quest> taskComplete = new List <Quest>();

        foreach (Quest q in InProgress)
        {
            if (q.CurrentTask().TaskType == QuestTask.QuestTaskType.KILL_ENTITY)
            {
                Debug.Log(ede.Entity + "_" + q.CurrentTask().GetEntity());
            }
            if (q.CurrentTask().TaskType == QuestTask.QuestTaskType.KILL_ENTITY && ede.Entity.Equals(q.CurrentTask().GetEntity()))
            {
                taskComplete.Add(q);
            }
        }

        foreach (Quest q in taskComplete)
        {
            QuestCurrentTaskComplete(q);
        }
    }
Esempio n. 3
0
        private bool API_SendEntityDeath(Plugin owner, string name, string gridPos, string[] owners, Func <int, string, bool> callback)
        {
            EntityDeath di = new EntityDeath(name, gridPos, owners);

            return(Request(new ApiRequest(RequestMethod.PUT, EntityDeathURI, JsonConvert.SerializeObject(di), owner), callback));
        }