| 
 
| 赞 | 0 |  
| VIP | 1 |  
| 好人卡 | 11 |  
| 积分 | 1 |  
| 经验 | 4602 |  
| 最后登录 | 2012-11-20 |  
| 在线时间 | 28 小时 |  
 Lv1.梦旅人 
	梦石0 星屑50 在线时间28 小时注册时间2011-1-14帖子262 | 
| 本帖最后由 赤夜玄魔 于 2012-1-7 01:20 编辑 
 tosaka 发表于 2012-1-5 14:25 ![]() [@]赤夜玄魔[/@]
 这个修改后的脚本命中还是要么都中,要么都miss。。
 不应该啊,估计是调用RM默认的命中判定的问题吧,按理说随机数100,应该是可以的,主要看你能不能把握中间值吧,过多就都打不中,过少就打中,中间值应该会奏效吧。你得掌握命中判定,才能有MISS和有伤害,实在是不行,我抽空写一下吧。
 其实这个脚本还算好理解的,可以自己试试改下命中计算方式。
收回以上的话……
 改好了……结果是我弄错了……真是不好意思……
 如果再出错的话,再PM我吧,理解这个脚本的伤害计算方式,把我给弄晕了,由于我的脚本是从柳大的游戏中提取后更改,并非原来的彩虹脚本,你修改时可能会有出错的现象,如果有错的话,你就发工程给我吧。
 找到复制代码  
首先在class Game_Temp
中的
def initialize
下面添加:
$ynmiss = 0
$missbug = {}
然后,把彩虹脚本中的这一块
def update_animation
整块改成: def update_animation
     if @_animation_duration > 0
       frame_index = @_animation.frame_max - @_animation_duration
       cell_data = @_animation.frames[frame_index].cell_data
       position = @_animation.position
       animation_set_sprites(@_animation_sprites, cell_data, position)
       #=======================================
       # 修改:弹出伤害,权重计算
      #=======================================
       for timing in @_animation.timings
         if timing.frame == frame_index
           t = 1.0 * animation_process_timing(timing, @_animation_hit)          #p t,"当前权重", @all_quanzhong,"总权重"
           if @battler_damage.is_a?(Numeric) and t != 0
             t *= @battler_damage
             t /= @all_quanzhong
             #p t,"当前伤害",@battler_damage,"总伤害"
             t = t.to_i
             #p t,@battler_damage,@all_quanzhong
             lsb = $missbug
              if frame_index == @_last_frame and lsb.hp> 0# 最后一次闪光的话,伤害修正
                lsb.hp += @damagemissbug - @_total_damage - t
                #★这里得说一下,RMXP原始的伤害经过这个脚本的计算后,会因为闪光的次数减少,每一次减少1点伤害。
                #★这里只是为了显示的伤害和实际的伤害一致而设定的。
                #p "最后闪光",lsb.hp
                #lsc = @_total_damage+t;p "闪避后的原始伤害",@damagemissbug,"实际上伤害",lsc
              end
             lsa = (rand(100) > $ynmiss)
              if lsa == true and lsb.hp> 0
                #if @battler.is_a?(Game_Actor)
                #lsb = $missbug
                #else
                #lsb = $missbug
                #end
                lsb.hp += t
                @damagemissbug -= t #★减去闪避掉的伤害
                #p "我闪开了",lsb.hp
                damage("Miss",false)
              else
                damage(t,@battler_critical)
              end
           # 防止重复播放miss
           elsif !@battler_damage.is_a?(Numeric) and timing.flash_scope != 0
             damage(@battler_damage,@battler_critical)
           end
         end
         lsa = false
       end
     else
       dispose_animation
     end
   end
复制代码def animation(animation, hit, battler_damage="", battler_critical=false)
在@battler_damage = battler_damage下面添加:
@damagemissbug = battler_damage
全局搜索
animation(animation, @battler.animation_hit,@battler.damage, @battler.critical)
前面添加
$missbug = @battler
复制代码
全局搜索:
if hit_result == true
在所有这个前面添加:
hit_result = true
效果图复制代码
搜索hit_result = (rand(100) < attacker.hit)
改成$ynmiss = attacker.hit
搜索if skill.atk_f > 0
将离这个最近的这一句
hit_result = (rand(100) < hit)
改成:
$ynmiss = hit
找到
hit_result = (rand(100) < item.hit)
也改成
$ynmiss = hit
   | 
 评分
查看全部评分
 |