[Thảo Luận] Thảo luận về bộ card battle

2»

Comments

  • Mộc ChâuMộc Châu Posts: 344Registered
    thử thay số 20 thành các số khác xem, tầm 70 80 xem nó có thay đổi không
  • slucis7593slucis7593 Posts: 544Registered
    luonyeu357 wrote:
    Untitled6dfea.png


    scrip bảng tên người chơi và đối thủ cần loại bỏ






    Window_CardBattleStatus
     //

     function Window_CardBattleStatus() {
       this.initialize.apply(this, arguments);
     }

     Window_CardBattleStatus.prototype = Object.create(Window_Base.prototype);
     Window_CardBattleStatus.prototype.constructor = Window_CardBattleStatus;

     Window_CardBattleStatus.prototype.initialize = function(x, y) {
       var width = this.windowWidth();
       var height = this.lineHeight() + 20 + this.standardPadding() * 2;
       Window_Base.prototype.initialize.call(this, x, y, width, height);
       this.refresh();
     };

     Window_CardBattleStatus.prototype.windowWidth = function() {
       return Graphics.boxWidth;
     };

     Window_CardBattleStatus.prototype.refresh = function() {
       this.contents.clear();
       var x = this.textPadding();
       var width = this.contents.width - x * 2;
       var lineHeight = this.lineHeight();
       this.contents.fontSize = 28;
       this.drawText($gameCardBattle.playerDeck().userName(), x, 0, width, 'left');
       this.drawText($gameCardBattle.enemyDeck().userName(), x, 0, width, 'right');
       this.contents.fontSize = 16;
       this.contents.drawText('Tổng ' + TMPlugin.Card.ParamNames[2] + ': ' +
                              $gameCardBattle.playerDeck().cost(), x, lineHeight,
                              width, 20, 'left');
       this.contents.drawText('Tổng ' + TMPlugin.Card.ParamNames[2] + ': ' +
                              $gameCardBattle.enemyDeck().cost(), x, lineHeight,
                              width, 20, 'right');
     };








    kết quả edit mình muốn là như này (chỉ là ghép thôi )
    2267bb.png

    Chú thêm this.hide(); vào cuối hàm initialize.
    Window_CardBattleStatus.prototype.initialize = function(x, y) {
      var width = this.windowWidth();
      var height = this.lineHeight() + 20 + this.standardPadding() * 2;
      Window_Base.prototype.initialize.call(this, x, y, width, height);
      this.refresh();
      this.hide();
    };
    
  • luonyeu357luonyeu357 Posts: 84Registered
    Chú thêm this.hide(); vào cuối hàm initialize.
    Window_CardBattleStatus.prototype.initialize = function(x, y) {
      var width = this.windowWidth();
      var height = this.lineHeight() + 20 + this.standardPadding() * 2;
      Window_Base.prototype.initialize.call(this, x, y, width, height);
      this.refresh();
      this.hide();
    };
    


    :heart: :heart: :heart:
  • luonyeu357luonyeu357 Posts: 84Registered
    khâm phục bác sát đất luôn ^^
    e thấy bác edit bộ này cho đẹp rồi share cho ae cùng dùng
    bộ plugin này chó phép cá nhân hóa tự do đấy
    có khi từ bản này mà ae có thể vẽ ra bộ card battle đẹp mắt hơn
  • luonyeu357luonyeu357 Posts: 84Registered
    mà bác có face hay gì đó không để em tiện thảo luận với ạ bộ script này em cần học hỏi nhiều nữa
  • slucis7593slucis7593 Posts: 544Registered
    luonyeu357 wrote:
    mà bác có face hay gì đó không để em tiện thảo luận với ạ bộ script  này em cần học hỏi nhiều nữa

    Ok, fb mình đây: https://www.facebook.com/SLGame
  • luonyeu357luonyeu357 Posts: 84Registered
    thank bác slucis nhiều ạ
  • bazokabazoka Posts: 3Registered
    thế size mấy cái card đấy chỉnh sao??? nhìn nhỏ quá
  • luonyeu357luonyeu357 Posts: 84Registered
    mấy cái dòng
    this.addMessage(0, 'trong trận này');
    this.addMessage(0, 'Một trận hòa');
    this.addMessage(0, 'Tôi đã thua ...');
    this.addMessage(0, this._playerDeck.userName() + ' Thắng');
    mình muốn thay bằng hình ảnh thì nên sửa script này như thế nào

    Game_CardBattle.prototype.judgeWinLoss = function() {
    if (this.isGameover()) {
    this.addMessage(0, 'trong trận này');
    this.addMessage(4, 120);
    if (this._playerDeck.lose === this._playerDeck.size() &&
    this._enemyDeck.lose === this._enemyDeck.size()) {
    this.addMessage(3, 1);
    this.addMessage(0, 'Một trận hòa');
    $gameVariables.setValue(TMPlugin.Card.VNResult, 0);
    } else if (this._playerDeck.lose === this._playerDeck.size()) {
    this.addMessage(3, 1);
    this.addMessage(0, 'Tôi đã thua ...');
    $gameVariables.setValue(TMPlugin.Card.VNResult, 1);
    } else {
    this.addMessage(3, 2);
    this.addMessage(0, this._playerDeck.userName() + ' Thắng');
    $gameVariables.setValue(TMPlugin.Card.VNResult, 2);
    }
    this.addMessage(0, '');
    return true;
    }
    return false;
    };
  • lysuamuahelysuamuahe Posts: 75Registered
    luonyeu357 wrote:
    mấy cái dòng
    this.addMessage(0, 'trong trận này');
    this.addMessage(0, 'Một trận hòa');
    this.addMessage(0, 'Tôi đã thua ...');
    this.addMessage(0, this._playerDeck.userName() + ' Thắng');
    mình muốn thay bằng hình ảnh thì nên sửa script này như thế nào


    Game_CardBattle.prototype.judgeWinLoss = function() {
       if (this.isGameover()) {
         this.addMessage(0, 'trong trận này');
         this.addMessage(4, 120);
         if (this._playerDeck.lose === this._playerDeck.size() &&
             this._enemyDeck.lose === this._enemyDeck.size()) {
           this.addMessage(3, 1);
           this.addMessage(0, 'Một trận hòa');
           $gameVariables.setValue(TMPlugin.Card.VNResult, 0);
         } else if (this._playerDeck.lose === this._playerDeck.size()) {
           this.addMessage(3, 1);
           this.addMessage(0, 'Tôi đã thua ...');
           $gameVariables.setValue(TMPlugin.Card.VNResult, 1);
         } else {
           this.addMessage(3, 2);
           this.addMessage(0, this._playerDeck.userName() + ' Thắng');
           $gameVariables.setValue(TMPlugin.Card.VNResult, 2);
         }
         this.addMessage(0, '');
         return true;
       }
       return false;
     };

    ta nghĩ ngươi nên xóa mấy dòng Message đấy đi rồi thay thế = biến mặc định thắng thua "biến 1" ấy,
    カードゲーム後の処理
     ・勝敗判定
        プラグインパラメータ vnResult に設定した番号のゲーム変数に
        カードゲームの結果が代入されます。
        この値を使ってイベント内容を分岐させてください。
        -1 … デッキ選択の段階でキャンセルした
         0 … 引き分け (同時に最後のカードのHPが 0 になった)
         1 … プレイヤーの負け
         2 … プレイヤーの勝ち
         3 … 時間切れ (プラグインパラメータ maxTurn の値を超過)
Sign In or Register to comment.