Ejemplo n.º 1
0
 public override void Execute(Miner miner)
 {
     miner.AddToWealth(miner.GoldCarried());
     miner.SetGoldCarried(0);
     Debug.Log("矿工:存金块,银行内现在共有 " + miner.Wealth() + " 个金块");
     if (miner.Wealth() >= miner.ComfortLevel)
     {
         Debug.Log("矿工:WooHoo!存够钱啦,现在回家泡妹啦!");
         miner.ChangeState(GoHomeAndSleepTilRested.Instance);
     }
     else
     {
         Debug.Log("矿工:没存够钱,继续挖矿吧~");
         miner.ChangeState(EnterMineAndDigForNugget.Instance);
     }
 }
Ejemplo n.º 2
0
    public override void Execute(Miner miner)
    {
        miner.AddToGoldCarried(1);
        miner.IncreaseFatigue();
        Debug.Log("矿工:采到一个金块 | 身上有 " + miner.GoldCarried() + " 个金块");
        // 口袋里金块满了就去银行存
        if (miner.PocketsFull())
        {
            miner.ChangeState(VisitBankAndDepositGold.Instance);
        }

        // 口渴了就去酒吧喝威士忌
        if (miner.Thirsty())
        {
            miner.ChangeState(QuenchThirst.Instance);
        }
    }
Ejemplo n.º 3
0
        public void Execute(Miner miner)
        {
            miner.AddToGoldCarried(1);
            miner.IncreaseFatigue();

            miner.Speak("Pickin' up a nugget");

            if (miner.PocketsFull())
            {
                miner.ChangeState(VisitBankAndDepositGold.Instance);
            }

            if (miner.Thirsty())
            {
                miner.ChangeState(QuenchThirst.Instance);
            }
        }
        public void Execute(Miner miner)
        {
            miner.AddToWealth(miner.GoldCarried);
            miner.GoldCarried = 0;

            miner.Speak($"Depositing gold. Total savings now: {miner.MoneyInBank}");

            if (miner.MoneyInBank >= Miner.ComfortLevel)
            {
                miner.Speak("WooHoo! Rich enough for now. Back home to mah li'lle lady");
                miner.ChangeState(GoHomeAndSleepTilRested.Instance);
            }
            else
            {
                miner.ChangeState(EnterMineAndDigForNugget.Instance);
            }
        }
Ejemplo n.º 5
0
    public override void Execute(Miner miner)
    {
        //Deposit the gold
        miner.AddToWealth(miner.goldCarried);
        miner.goldCarried = 0;
        Debug.Log(miner.ID + " Depositing gold. Total savings now: " + miner.moneyInBank);

        //Wealthy enough to have a well earned rest?
        if (miner.moneyInBank >= miner.GetComfortLevel())
        {
            Debug.Log(miner.ID + " WooHoo! Rich enough for now. Back home to mah li'lle lady");
            miner.ChangeState(GoHomeAndSleepTilRested.Instance);
        }
        //Otherwise get more gold
        else
        {
            miner.ChangeState(EnterMineAndDigForNugget.Instance);
        }
    }
Ejemplo n.º 6
0
    public override void Execute(Miner miner)
    {
        //The miner digs for gold until he's carrying in excess of MaxNuggets.
        //If he gets thirsty during his digging he stops work and changes state to go to the saloon for a whiskey.
        miner.AddToGoldCarrier(1);

        //Diggin' is hard work
        miner.IncreaseFatigue();
        Debug.Log(miner.ID + " Pickin' up a nugget");

        //If enough gold mined, go and put it in the bank
        if (miner.IsPocketFull())
        {
            miner.ChangeState(VisitBankAndDepositGold.Instance);
        }

        //If thirsty go and get a whiskey
        if (miner.IsThirsty())
        {
            miner.ChangeState(QuenchThirst.Instance);
        }
    }
Ejemplo n.º 7
0
 public void Execute(Miner miner)
 {
     if (!miner.Fatigued())
     {
         miner.Speak("What a God darn fantastic nap! Time to find more gold");
         miner.ChangeState(EnterMineAndDigForNugget.Instance);
     }
     else
     {
         miner.DecreaseFatigue();
         miner.Speak("ZZZZ... ");
     }
 }
Ejemplo n.º 8
0
 public override void Execute(Miner miner)
 {
     if (!miner.Fatigued())
     {
         Debug.Log("矿工:睡得真好!是时候挖矿了!");
         miner.ChangeState(EnterMineAndDigForNugget.Instance);
     }
     else
     {
         miner.DecreaseFatigue();
         Debug.Log("矿工:ZZZZ...");
     }
 }
Ejemplo n.º 9
0
 public override void Execute(Miner miner)
 {
     if (miner.Thirsty())
     {
         miner.BuyAndDrinkAWhiskey();
         Debug.Log("矿工:好酒好酒!!!");
         miner.ChangeState(EnterMineAndDigForNugget.Instance);
     }
     else
     {
         Debug.LogError("出错啦");
     }
 }
Ejemplo n.º 10
0
 public void Execute(Miner miner)
 {
     if (miner.Thirsty())
     {
         miner.BuyAndDrinkAWhiskey();
         miner.Speak("That's mighty fine sippin liquer");
         miner.ChangeState(EnterMineAndDigForNugget.Instance);
     }
     else
     {
         System.Console.ForegroundColor = System.ConsoleColor.Red;
         System.Console.WriteLine("\nERROR!\nERROR!\nERROR!");
     }
 }
 public override void Execute(Miner miner)
 {
     //If miner is not fatigued, start to dig for nuggets again
     if (!miner.IsFatigued())
     {
         Debug.Log(miner.ID + " What a God darn fantastic nap! Time to find more gold");
         miner.ChangeState(EnterMineAndDigForNugget.Instance);
     }
     //Else sleep
     else
     {
         miner.DecreaseFatigue();
         Debug.Log(miner.ID + " ZZZZZ...");
     }
 }
Ejemplo n.º 12
0
    public override void Execute(Miner miner)
    {
        //If miner is thirsty, buy a whiskey and drink it
        if (miner.IsThirsty())
        {
            miner.BuyAndDrinkWhisky();
            Debug.Log(miner.ID + " That's mighty fine sippin liquer");

            //And then go back to dig mine
            miner.ChangeState(EnterMineAndDigForNugget.Instance);
        }
        //Else WE HAVE A LOGICAL ERROR HERE!
        else
        {
            Debug.Log("ERROR ERROR ERROR");
        }
    }