73e39b0b1011d3c6a79ded323ac31d8e.jpg (1.83 MB, 下载次数: 11)
这是效果,层数代表等级,0/10是当前经验/升级需要的经验
3.59 KB, 下载次数: 17
售价: 1 星屑 [记录]
古树旋律 发表于 2025-6-30 07:25
这段代码写得太妙了。我一开始的思路是拷贝dataskill,然后导致data数据越来越庞大。
这个JS新建了一个精简 ...
// 修改伤害应用部分 Yours.skillUpgrade.alias.Game_Action_apply = Game_Action.prototype.apply; Game_Action.prototype.apply = function(target) { if (this.subject() instanceof Game_Actor && this.isSkill()) { const skillId = this.item().id; if (this.subject().getSkillConfig(skillId)) { // 先获取伤害系数 const damageCoefficient = this.subject().getSkillDamageCoefficient(skillId); // 检查是否为伤害性技能 if (this.item().damage.type > 0) { // 临时修改技能的基础伤害公式,加入伤害系数 const originalFormula = this.item().damage.formula; if (damageCoefficient !== 1) { // 在公式中乘以系数 this.item().damage.formula = `(${originalFormula}) * ${damageCoefficient}`; } // 应用伤害 Yours.skillUpgrade.alias.Game_Action_apply.call(this, target); // 恢复原始公式 this.item().damage.formula = originalFormula; // 增加经验 this.subject().gainSkillExp(skillId); return; } } } // 非技能或不需要修改的情况 Yours.skillUpgrade.alias.Game_Action_apply.call(this, target); }; // 移除之前在apply中修改伤害结果的代码,因为现在已经在公式中处理了
古树旋律 发表于 2025-6-30 20:53
又发现了BUG,Window_SkillList.prototype.drawItemName = function(skill, x, y, width) 部分只绘制了文字 ...
涂九安 发表于 2025-7-2 16:45
这个怎么跟我写的有点像?我3月份就写好了!我的是根据仙剑奇侠传三的仙术写的,就是使用次数+技能等级!如 ...
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |