Esempio n. 1
0
    //空き地に止まった
    public void stopFreeLand(PlayerStatus aTurnPlayer, Action aCallback)
    {
        LandMass tLand = (LandMass)mMaster.mFeild.mMassList[aTurnPlayer.mCurrentMassNumber];

        //購入できない
        if (aTurnPlayer.mMoney < tLand.mPurchaseCost)
        {
            aCallback();
            return;
        }
        //購入できる
        aTurnPlayer.mAi.purchaseLand(aTurnPlayer, tLand, mMaster, (aAns) => {
            if (!aAns)
            {
                aCallback();
                return;
            }
            //購入する
            GameEffector.lostCoin(aTurnPlayer.mComa.position, (-tLand.mPurchaseCost).ToString(), () => {
                aTurnPlayer.mMoney -= tLand.mPurchaseCost;
                tLand.changeOrner(aTurnPlayer, () => {
                    tLand.changeIncreaseLevel(tLand.mIncreaseLevel, () => {
                        mMaster.updateStatus();
                        aCallback();
                        return;
                    });
                });
            });
        });
    }
Esempio n. 2
0
    //自分の土地に止まった
    public void stopMyLand(PlayerStatus aTurnPlayer, Action aCallback)
    {
        LandMass tLand = (LandMass)mMaster.mFeild.mMassList[aTurnPlayer.mCurrentMassNumber];

        //最大まで増資済み
        if (tLand.mIncreaseLevel >= LandMass.mMaxIncreaseLevel)
        {
            aCallback();
            return;
        }
        //増資できない
        if (aTurnPlayer.mMoney < tLand.mIncreaseCost)
        {
            aCallback();
            return;
        }
        //増資できる
        aTurnPlayer.mAi.increaseLand(aTurnPlayer, tLand, mMaster, (aAns) => {
            if (!aAns)
            {
                aCallback();
                return;
            }
            //増資する
            GameEffector.lostCoin(aTurnPlayer.mComa.position, (-tLand.mIncreaseCost).ToString(), () => {
                aTurnPlayer.mMoney -= tLand.mIncreaseCost;
                tLand.changeIncreaseLevel(tLand.mIncreaseLevel + 1, () => {
                    mMaster.updateStatus();
                    aCallback();
                    return;
                });
            });
        });
    }
 //金損失
 public void lostCoin(PlayerStatus aPlayer, int aMoney, Action aCallback)
 {
     mMaster.mCamera.mTarget = aPlayer.mComa;
     GameEffector.lostCoin(aPlayer.mComa.worldPosition, (-aMoney).ToString(), () => {
         aPlayer.mMoney -= aMoney;
         aCallback();
     });
 }
Esempio n. 4
0
    //自分以外の土地に止まった
    public void stopOtherLand(PlayerStatus aTurnPlayer, Action aCallback)
    {
        LandMass tLand = (LandMass)mMaster.mFeild.mMassList[aTurnPlayer.mCurrentMassNumber];

        GameEffector.lostCoin(aTurnPlayer.mComa.position, (-tLand.mFeeCost).ToString(), () => {
            aTurnPlayer.mMoney  -= tLand.mFeeCost;
            PlayerStatus tStatus = mMaster.mPlayerStatus[tLand.mOwner - 1];
            GameEffector.getCoin(tStatus.mComa.position, tLand.mFeeCost.ToString(), () => {
                tStatus.mMoney += tLand.mFeeCost;
                mMaster.updateStatus();
                aCallback();
                return;
            });
        });
    }
    static public void soldLand(LandMass aLand, GameMaster aMaster, Action aCallback)
    {
        PlayerStatus tOwner = aMaster.mPlayerStatus[aLand.mOwner - 1];

        aLand.changeOrner(null, () => {});
        aMaster.mCamera.mTarget = aLand;
        GameEffector.lostCoin(aLand.worldPosition, "", () => {
            aMaster.mCamera.mTarget = tOwner.mComa;
            GameEffector.getCoin(tOwner.mComa.worldPosition, "+" + aLand.mSellCost.ToString(), () => {
                tOwner.mMoney += aLand.mSellCost;
                aMaster.updateStatus();
                aCallback();
            });
        });
    }