Exemple #1
0
 /*
  * Pay tax when player chip is on anemy field
  */
 public void PayTax(PlayerModel pmodel, PlayerModel smodel, InfoPanel panel)
 {
     pmodel.AddMoney(-model.tax);
     smodel.AddMoney(model.tax);
     panel.SetPlayerInfo(pmodel);
     panel.SetPlayerInfo(smodel);
 }
Exemple #2
0
    /*
     * Buy Any Free GameField by Player
     * player model = the model with data obut player
     * info panel? for renw informatiom
     * */
    public void Buy(PlayerModel pmodel)
    {
        int fone = pmodel.GetPlayerType == PlayerType.AI ? 14 : 15;

        fieldtype = pmodel.GetPlayerType == PlayerType.AI ? FieldType.Player1 : FieldType.Player2;
        pmodel.AddMoney(-model.cost);
        obj.setImage(obj.GetGameObject().transform.parent.GetComponent <FieldBuilder>().GetSprite(fone));
    }
Exemple #3
0
    //根据玩家胜利与否处理结果
    void LevelEnd(bool isSuccess)
    {
        PlayerModel playerModel = ModelManager.Get("PlayerModel") as PlayerModel;

        if (isSuccess)
        {
            EventManager.ExecuteEvent(EventType.FightVectory);
        }
        else
        {
            int value = GetFailHurt();

            ViewManager.Get <WndFightOver>("WndFightOver").SetReduceHp(value);

            EventManager.ExecuteEvent(EventType.FightFail);

            playerModel.AddMoney(8);

            playerModel.SetHp(-value);
        }
    }