赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 3 |
经验 | 2829 |
最后登录 | 2018-9-5 |
在线时间 | 53 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 277
- 在线时间
- 53 小时
- 注册时间
- 2014-1-24
- 帖子
- 18
|
本帖最后由 qq420134293 于 2016-6-3 12:54 编辑
Game_Actor.prototype.paramBase = function (paramId) { //取消职业属性,获取Actors.json里属性
var thisparam = this.getParams(paramId);
if (thisparam == 0) {
thisparam = this.currentClass().params[paramId][this._level];
}
return Math.ceil(thisparam);
};
//获取属性方法
Game_Actor.prototype.getParams = function (paramsID) {
return this._paramsAll[paramsID];
};
Game_Actor.prototype.setup = function (actorId) {
var actor = $dataActors[actorId];
this._paramsAll = actor.params;//Actors.json里的角色属性
this._actorId = actorId;
this._candie = actor.die == 0 ? true : false;
this._deter = Math.ceil(actor.Deterrence); //威慑
this._resis = Math.ceil(actor.Resistance); //抵抗
this._name = actor.name;
this._nickname = actor.nickname;
this._profile = actor.profile;
this._classId = actor.classId;
this._level = actor.initialLevel;
this.initImages();
this.initExp();
this.initSkills();
this.initEquips(actor.equips);
this.clearParamPlus();
this.recoverAll();
};
Game_Action.prototype.executeDamage = function (target, value) {
var result = target.result();
if (value === 0) { result.critical = false; }
var plusvalue = this.DeterResis(0, 0) - target.DeterResis(1, 0); //获取威慑抵抗差值,正直,翻plusvalue倍,负值伤害减倍
while (plusvalue <= -50) { value /= 2; plusvalue + 50; }
if (plusvalue > -50) value *= (plusvalue / 100 + 1)
if (this.isHpEffect()) {
this.executeHpDamage(target, value);
}
if (this.isMpEffect()) {
this.executeMpDamage(target, value);
}
};
角色数据里Actors.json里添加params数组,就是角色的属性了。比如下面个角色,血9900,魔9999,攻击999,升级不加属性。
{"id":1,"params":[9900,9999,999,30,30,30,30,30],"battlerName":"Actor1_1","characterIndex":0,"characterName":"Actor1","classId":1,"equips":[1,1,2,3,0],"faceIndex":0,"faceName":"Actor1","traits":[{"code":11,"dataId":1,"value":1}],"initialLevel":1,"maxLevel":99,"name":"哈罗尔德","nickname":"昵称","note":"注释","profile":"简介","Deterrence":99,"Resistance":99},
|
|