切換
舊版
前往
大廳
主題

RM MV學習筆記(33) 角色公式

路漫行 | 2018-05-14 09:35:23 | 巴幣 0 | 人氣 506

(一)經驗值

    var basis = c.expParams[0];  //基本值,最小30
    var extra = c.expParams[1];  //額外值,最小0
    var acc_a = c.expParams[2]; //加速A,最小10
    var acc_b = c.expParams[3]; //加速B,最小10


經驗值計算:

Math.round(basis*(Math.pow(level-1, 0.9+acc_a/250))*level*
            (level+1)/(6+Math.pow(level,2)/50/acc_b)+(level-1)*extra);


注解:

Math.pow( a , b) = a的b次方

基本值 * (等級-1) ^ (0.9+加速A/255)  * 等級 * (等級+1)/  ( 6+ 等級^2 / 50 / 加速B ) + ( LV -1 ) *額外值

最後取整數...你TMD的一定要弄這麼複雜嗎!?



公式修改位置:
Game_Actor.prototype.expForLevel

升級需求exp:
Game_Actor.prototype.nextRequiredExp = function() {
return this.nextLevelExp() - this.currentExp();
};



(二)八大屬性

這個更厲害了,沒有公式= =
在Class.json裡面,直接把1~99級的屬性列出來


第一個屬性 1級時候是691,等同陣列裡面的元素1位置。


全部都是定值,所以內建果然沒有增加最大屬性這種東西...但我怎麼記得以前有?

//逃走率:
BattleManager.makeEscapeRatio = function() {
    this._escapeRatio = 0.5 * $gameParty.agility() / $gameTroop.agility();
};


//每次Buff增加的能力
Game_BattlerBase.prototype.paramBuffRate = function(paramId) {
    return this._buffs[paramId] * 0.25 + 1.0;
};
//增加25% 最多疊兩次

送禮物贊助創作者 !
0
留言

創作回應

更多創作