设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2558|回复: 8
打印 上一主题 下一主题

[已经过期] 请问如何设置一个状态或开关,让技能成功率倍增

[复制链接]

Lv2.观梦者

梦石
0
星屑
342
在线时间
377 小时
注册时间
2013-1-30
帖子
219
跳转到指定楼层
1
发表于 2017-5-13 16:07:47 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
在下在试着做一个海战场景,所有船只的攻击都是用技能来实现的。其中,火炮技能的成功率本身只有18%,但在下想设置两种场景,比如抵近射击时,让成功率放大5倍变成90%,远程乱轰时,让成功率降低数倍变成4%,求教有没有临时增加减少技能成功率的方法。

Lv1.梦旅人

梦石
0
星屑
50
在线时间
95 小时
注册时间
2017-4-26
帖子
45
2
发表于 2017-5-13 18:32:40 | 只看该作者
你会写插件就不难实现,核心代码在这里:
  1. Game_Action.prototype.apply = function(target) {
  2.     var result = target.result();
  3.     this.subject().clearResult();
  4.     result.clear();
  5.     result.used = this.testApply(target);
  6.     result.missed = (result.used && Math.random() >= this.itemHit(target));  //这句是判定是否miss
  7.     result.evaded = (!result.missed && Math.random() < this.itemEva(target)); // 这句是判定是否闪避
  8.     result.physical = this.isPhysical();
  9.     result.drain = this.isDrain();
  10.     if (result.idear()) {
  11.         if (this.item().damage.type > 0) {
  12.             result.critical = (Math.random() < this.itemCri(target));
  13.             var value = this.makeDamageValue(target, result.critical);
  14.             this.executeDamage(target, value);
  15.         }
  16.         this.item().effects.forEach(function(effect) {
  17.             this.applyItemEffect(target, effect);
  18.         }, this);
  19.         this.applyItemUserEffect(target);
  20.     }
  21. };
复制代码

点评

result.critical = (Math.random() < this.itemCri(target)); var value = this.makeDamageValue(target, result.critical); 重点这两句  发表于 2017-5-13 18:36
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
342
在线时间
377 小时
注册时间
2013-1-30
帖子
219
3
 楼主| 发表于 2017-5-13 19:11:04 | 只看该作者
linphy 发表于 2017-5-13 18:32
你会写插件就不难实现,核心代码在这里:

改成这样?
  1. result.critical = (Math.random() < this.itemCri(target));
  2. if ($gameVariables.value(1) === 0) {
  3.         var value = this.makeDamageValue(target, result.critical);;
  4.     } else if ($gameVariables.value(1) === 1) {
  5.         var value = this.makeDamageValue(target, result.critical)*5;
  6.     }
  7.             
复制代码

好吧,在下虽然知道要怎么分歧设定,但实在是不会写脚本,求修改
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
95 小时
注册时间
2017-4-26
帖子
45
4
发表于 2017-5-13 19:30:21 | 只看该作者
qknight 发表于 2017-5-13 19:11
改成这样?

好吧,在下虽然知道要怎么分歧设定,但实在是不会写脚本,求修改 ...

你是要提高命中还是提高伤害啊
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
342
在线时间
377 小时
注册时间
2013-1-30
帖子
219
5
 楼主| 发表于 2017-5-13 19:41:06 | 只看该作者
linphy 发表于 2017-5-13 19:30
你是要提高命中还是提高伤害啊

只提高命中率,不提高伤害
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
95 小时
注册时间
2017-4-26
帖子
45
6
发表于 2017-5-14 10:01:22 | 只看该作者
qknight 发表于 2017-5-13 19:41
只提高命中率,不提高伤害

改我给你注释的那两行
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
676
在线时间
224 小时
注册时间
2006-12-7
帖子
839
7
发表于 2017-5-14 11:25:25 | 只看该作者
要是用YEP的话 用buff state core和auto passive state应该能做
用开关控制passive state是否开启
state里面设置属性变更数值
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
342
在线时间
377 小时
注册时间
2013-1-30
帖子
219
8
 楼主| 发表于 2017-5-14 19:39:31 | 只看该作者
doranikofu 发表于 2017-5-14 11:25
要是用YEP的话 用buff state core和auto passive state应该能做
用开关控制passive state是否开启
state里 ...

在下要变更的不是人物属性,而是技能的成功率……
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-5 06:56

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表