Exemple #1
0
    public override void HarvestHere(MonsterInteraction m)
    {
        Debug.Log("Harvest at Work tile");

        HarvestCrop();
        UpdateStatus(actionIndex, m);
    }
Exemple #2
0
    public override void ActionResult(int index, MonsterInteraction m)
    {
        switch (index)
        {
        case (0):
            Debug.Log("Idle");
            break;

        case (1):
            HarvestHere(m);
            break;

        case (2):
            WaterHere(m);
            break;

        case (3):
            EatHere(m);
            break;

        case (4):
            SleepHere(m);
            break;

        default:
            Debug.Log("Index ERROR");
            break;
        }

        float hungerAmount   = behaviorBook.behaviorDictionary[index].hungerAmount;
        float tirenessAmount = behaviorBook.behaviorDictionary[index].tirenessAmount;
        float emotionAmount  = behaviorBook.behaviorDictionary[index].emotionAmount;

        m.SetStatus(hungerAmount, tirenessAmount, emotionAmount);
    }
    public void CallTrainningPopup()
    {
        if (monster == null)
        {
            monster = FindObjectOfType <MonsterInteraction>();
        }

        if (monster.canTrain)
        {
            if (actionIndex == 0 && monster.canTrain)
            {
                // status
                trainingPopup.GetComponent <TrainningPopup>().ActivatePopup(actionIndex, states, GetQS());
                isTrainable = true;
            }
            else if (actionIndex == 1 && TileManager.Instance.tileTarget.typeTile == TypeTile.WorkTile && monster.canTrain)
            {
                Debug.Log("Action index: " + ", type tile: " + TypeTile.WorkTile);

                // crop info
                trainingPopup.GetComponent <TrainningPopup>().ActivatePopup(actionIndex, states, GetQS());
                isTrainable = true;
            }
        }
        else
        {
            isWaitReward = true;
            trainingPopup.GetComponent <TrainningPopup>().UpdatePopup(TileManager.Instance.tileTarget.typeTile);
            //trainingPopup.GetComponent<TrainningPopup>().ActivateNoTrainPopup();
            isTrainable = false;
        }

        SetTrainingPopup(true);
    }
Exemple #4
0
    public override void ActionResult(int index, MonsterInteraction m)
    {
        actionIndex = index;

        switch (index)
        {
        case (0):
            Debug.Log("Idle");
            break;

        case (1):
            HarvestHere(m);
            break;

        case (2):
            WaterHere(m);
            break;

        case (3):
            EatHere(m);
            break;

        case (4):
            SleepHere(m);
            break;

        default:
            Debug.Log("Index ERROR");
            break;
        }
    }
Exemple #5
0
    private void UpdateStatus(int index, MonsterInteraction m)
    {
        float hungerAmount   = behaviorBook.behaviorDictionary[index].hungerAmount;
        float tirenessAmount = behaviorBook.behaviorDictionary[index].tirenessAmount;
        float emotionAmount  = behaviorBook.behaviorDictionary[index].emotionAmount;

        m.SetStatus(hungerAmount, tirenessAmount, emotionAmount);
    }
Exemple #6
0
 public override void EatHere(MonsterInteraction m)
 {
     Debug.Log("Eat at Work tile");
     if (EatCrop())
     {
         UpdateStatus(actionIndex, m);
     }
 }
Exemple #7
0
    public override void WaterHere(MonsterInteraction m)
    {
        Debug.Log("Water at Work tile");

        waterAmount += m.waterAmount;
        if (crop != null)
        {
            crop.WaterCrop(waterAmount);
        }
        SoundManager.Instance.sfxManager.PlayFromSFXObjectLibrary("Water");
        UpdateStatus(actionIndex, m);
    }
Exemple #8
0
 public override void SleepHere(MonsterInteraction m)
 {
     Debug.Log("Sleep at Work tile");
     UpdateStatus(actionIndex, m);
 }
Exemple #9
0
 public override void WaterHere(MonsterInteraction m)
 {
     Debug.Log("Water at Rest tile");
 }
Exemple #10
0
 public override void SleepHere(MonsterInteraction m)
 {
     Debug.Log("Sleep at Rest tile");
 }
Exemple #11
0
 public abstract void SleepHere(MonsterInteraction m);
Exemple #12
0
 public override void HarvestHere(MonsterInteraction m)
 {
     Debug.Log("Harvest at Rest tile");
 }
Exemple #13
0
 public abstract void ActionResult(int index, MonsterInteraction m);
Exemple #14
0
 public abstract void PlantHere(MonsterInteraction m);
Exemple #15
0
 public abstract void HarvestHere(MonsterInteraction m);
Exemple #16
0
 public abstract void WaterHere(MonsterInteraction m);
Exemple #17
0
 public abstract void EatHere(MonsterInteraction m);
Exemple #18
0
 public override void PlantHere(MonsterInteraction m)
 {
     Debug.Log("Plant at Rest tile");
 }
Exemple #19
0
 public override void EatHere(MonsterInteraction m)
 {
     Debug.Log("Eat at Food tile");
     SoundManager.Instance.sfxManager.PlayFromSFXObjectLibrary("Eat");
 }