Ejemplo n.º 1
0
    void GetHurt(OtherPlayer otherPlayer)
    {
        if (borrowMoney > 0)
        {
            return;
        }
        hurtingPlayer = otherPlayer;

        //自身减少部分
        hurtMoney    = natureMoney;
        natureMoney -= hurtMoney;
        borrowMoney += hurtMoney;
        if (natureMoney < 0)
        {
            borrowMoney += natureMoney;
            natureMoney  = 0;
        }

        //对方借出部分
        float getMoney     = borrowMoney * 1f;
        float realGetMoney = hurtingPlayer.ReduceMoney(getMoney);

        borrowMoney += realGetMoney;
    }