Ejemplo n.º 1
0
    //every buddy by default know how to eat at low efficiency but if they are taught that action again
    //they will overwrite their default action with what they were taught (its how they can improve with better teaching)
    void ImproveCoreHarvestSkill(GOAPAct newActions)
    {
        MeleeAttack hitBush = new MeleeAttack(6, 1);

        if (newActions.GetType() == hitBush.GetType())
        {
            if (newActions.ActionLayer == hitBush.ActionLayer && newActions.ActionLayer2 == hitBush.ActionLayer2)
            {
                availableActions[2] = newActions;
            }
        }
    }
Ejemplo n.º 2
0
 bool IsDupeAction(GOAPAct newAction) //checks if I know this already
 {
     foreach (var act in availableActions)
     {
         if (newAction.GetType() == act.GetType())
         {
             if (act.ActionLayer == newAction.ActionLayer && act.ActionLayer2 == newAction.ActionLayer2)
             {
                 learningActions--;//buddy was taught a dupe, expending a learning opportunity
                 if (manager.PlayerAlive)
                 {
                     ImproveCoreHarvestSkill(newAction);
                     manager.ui.DisplayAction(transform.position, newAction, Color.white,
                                              "<br><size=6>(" + (learningActions - availableActions.Count).ToString() + " left)");
                 }
                 return(true);
             }
         }
     }
     return(false);
 }