var _Game_Action_executeDamage = Game_Action.prototype.executeDamage; Game_Action.prototype.executeDamage = function (target, value) { if(value>0)/*大于0时为伤害量,小于0时为治疗量*/{ if(this.subject().isActor() && this.subject().actorId() == 1/*A的Id*/ && this.subject()._classId == 1/*职业Id*/){ this.subject().equips().forEach(function (equip){ if (equip != null && equip.wtypeId != undefined && equip.wtypeId == 5/*假设镰刀的类型为5*/) value *= 1.2;/*伤害倍率*/ }); }} _Game_Action_executeDamage.call(this, target, value); }
多卡多卡 发表于 2019-7-30 22:37
var _Game_Action_executeDamage = Game_Action.prototype.executeDamage;
Game_Action.prototype.execute ...
var _Game_Action_executeDamage = Game_Action.prototype.executeDamage; Game_Action.prototype.executeDamage = function (target, value) { if(value>0)/*大于0时为伤害量,小于0时为治疗量*/{ if(this.subject().isActor() && this.subject().actorId() == 1/*A的Id*/ && this.subject()._classId == 30/*职业Id*/){ this.subject().equips().forEach(function (equip){ if (equip != null && equip.wtypeId != undefined && equip.wtypeId == 2 /*假设镰刀的类型为5*/) value *= 2.5;/*伤害倍率*/ }); }} _Game_Action_executeDamage.call(this, target, value); }
j296196585 发表于 2019-7-31 00:41
== 1/*A的Id*/这是什么意思 、
[classId == 20, 21/*职业Id*/ 如何添加多个职业 多卡大兄弟/ size]
多卡多卡 发表于 2019-7-31 07:35
第一个是角色的Id
如果要添加多个职业,可以这样:
]OZZ$RJY4R0U]ONQF9X65}Y.png (126.88 KB, 下载次数: 1)
j296196585 发表于 2019-7-31 16:03
多卡大兄弟 你看是这样吗
怎样添加 角色 我自己鼓捣半天好像没效果 ...
3T_Q(OOY%P(0[{9)@}](8~8.png (144.13 KB, 下载次数: 2)
j296196585 发表于 2019-7-31 18:00
放在第一个if的里面就行了 【我是猪 】看不明白
如果不同的人职业不同,就多定义几个list取不同 ...
多卡多卡 发表于 2019-7-31 18:18
这个应该够详细了,自己对着看吧
对于一个角色能够使用哪些武器,这个不需要插件,直接角色那里 ...
3R9XN{~U15YW}B7M$1(DG]X.png (914.32 KB, 下载次数: 4)
多卡多卡 发表于 2019-7-30 22:37
var _Game_Action_executeDamage = Game_Action.prototype.executeDamage;
Game_Action.prototype.execute ...
// Author:Doka // Modified by cc Artermices // 如果要实现多个加成效果,就把第二个if里的复制一下改下参数就行了 var _Game_Action_executeDamage = Game_Action.prototype.executeDamage; Game_Action.prototype.executeDamage = function (target, value) { if(value>0)/*大于0时为伤害量,小于0时为治疗量*/{ if(this.subject().isActor() && this.subject().actorId() > 0 ){ if(this.subject()._classId == 16/*枪手*/){ this.subject().equips().forEach(function (equip){ if (equip != null && equip.wtypeId != undefined){ switch(equip.wtypeId){ case 9 /*轻枪*/: value *= 1.2;/*伤害倍率*/ break; case 20 /*重枪*/ value *= 1.1; break; default: } } }); }else if(this.subject()._classId == 17/*潜行者*/){ this.subject().equips().forEach(function (equip){ if (equip != null && equip.wtypeId != undefined){ switch(equip.wtypeId){ case 1 /*匕首*/: value *= 1.2; break; case 17 /*忍刀*/ value *= 1.1; break; default: } } }); } } } _Game_Action_executeDamage.call(this, target, value); }
ccArtermices 发表于 2019-7-31 19:44
多卡大神,我用了你的脚本,发现只要我一装备武器就报错:cannot read property 'params' of null
为此我 ...
多卡多卡 发表于 2019-7-31 18:18
这个应该够详细了,自己对着看吧
对于一个角色能够使用哪些武器,这个不需要插件,直接角色那里 ...
//================================================================================================================== /*: * @plugindesc 不同职业对不同武器的熟练度 。 * * @author 多卡多卡 * * @help * ◆ 不同职业对不同武器的熟练度 * *如果要实现多个加成效果,就把第二个if里的复制一下改下参数就行了。 */ //================================================================================================================== var _Game_Action_executeDamage = Game_Action.prototype.executeDamage; Game_Action.prototype.executeDamage = function (target, value) { var list1 = [21,22];//职业Id var list2 = [1,2]; if(value > 0) { if(this.subject().isActor() && this.subject().actorId() == 1 && list1.contains(this.subject()._classId)){//角色的Id this.subject().equips().forEach(function (equip){ if (equip != null && equip.wtypeId != undefined && equip.wtypeId == 2/*假设镰刀的类型为5*/) value *= 2.2;/*伤害倍率*/ }); } if(this.subject().isActor() && this.subject().actorId() == 2 && list2.contains(this.subject()._classId)){//角色的Id this.subject().equips().forEach(function (equip){ if (equip != null && equip.wtypeId != undefined && equip.wtypeId == 3/*假设镰刀的类型为5*/) value *= 2.2;/*伤害倍率*/ { switch (equip.wtypeld){ case 2: value =Math.ceil(value * 1.2 ); break; case 3: value =Math.ceil(value * 2 ); break; } } }); } } _Game_Action_executeDamage.call(this, target, value); }
多卡多卡 发表于 2019-7-31 19:55
16行和30行case的数字后面没有加冒号
defult的冒号后面也要加上分号代表空语句 ...
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |