Project1

标题: 从坟堆里爬出来请教个关于XP齐时战斗的问题…… [打印本页]

作者: saterick    时间: 2008-12-31 06:23
标题: 从坟堆里爬出来请教个关于XP齐时战斗的问题……
原脚本是柳柳君的这帖,http://rpg.blue/web/htm/news63.htm

在使用时有个问题,假定一个增益技能对自己释放的话,这个脚本只会播放对象方动画,使用方动画会被略过。之前美兽殿曾经指点过,把脚本改成这样:

  1. #--------------------------------------------------------------------------
  2. # ● 刷新画面 (主回合步骤 3 : 行动方动画)
  3. #--------------------------------------------------------------------------
  4. def update_phase4_step3
  5.    # 行动方动画 (ID 为 0 的情况下是白色闪烁)
  6.    if @animation1_id == 0
  7.      @active_battler.white_flash = true
  8.    else
  9.      @active_battler.animation_id = @animation1_id
  10.      @active_battler.animation_hit = true
  11.    end   
  12.    # 对像方动画
  13.    for target in @target_battlers
  14.      if @active_battler.is_a?(Game_Actor) and target.is_a?(Game_Actor) and
  15.         @active_battler.id == target.id
  16.         target.animation_id = @animation1_id           
  17.      else  
  18.         target.animation_id = @animation2_id
  19.         target.animation_hit = (target.damage != "Miss")         
  20.      end      
  21.    end
  22.    # 移至步骤 4
  23.    @phase4_step = 4
  24. end
  25. #--------------------------------------------------------------------------
  26. # ● 刷新画面 (主回合步骤 4 : 对像方动画)
  27. #--------------------------------------------------------------------------
  28. def update_phase4_step4
  29.    # 对像方动画
  30.    for target in @target_battlers
  31.      if @active_battler.is_a?(Game_Actor) and target.is_a?(Game_Actor) and
  32.         @active_battler.id == target.id
  33.         target.animation_id = @animation2_id  
  34.         target.animation_hit = (target.damage != "Miss")        
  35.      end  
  36.    end   
  37.    # 限制动画长度、最低 8 帧
  38.    @wait_count = 8
  39.    # 移至步骤 5
  40.    @phase4_step = 5
  41. end
复制代码


但这个样子也有个缺点——敌人在对自己使用增益魔法的时候还是不会显示使用方动画。而且这个解决方法也并不是很完美,动画一会儿是同步显示一会儿又不是,流畅感大打折扣。望高手帮忙看看是否有更好的方法。感谢。

已有战斗脚本:CTB横版战斗系统,彩虹神剑,战斗特效(脚本版),敌残余战力表示,战斗终了时能力成长,战后回复。(未发现冲突) [LINE]1,#dddddd[/LINE]版务信息:本贴由楼主自主结贴~
作者: 天圣的马甲    时间: 2008-12-31 10:09
S大~!{/se}你的维纳利斯传说是俺的偶像啊~!{/hx}来到6R第二个游戏玩的就是那个,非常佩服那时候就能写出那么好剧本的您XDDD

咳咳……跑题了……
其实换成敌人的话似乎也差不多,同样的if语句复制粘贴一份出来改成Enemy看看?主要就是一个判断的部分:

#--------------------------------------------------------------------------
# ● 刷新画面 (主回合步骤 3 : 行动方动画)
#--------------------------------------------------------------------------
def update_phase4_step3
   # 行动方动画 (ID 为 0 的情况下是白色闪烁)
   if @animation1_id == 0
     @active_battler.white_flash = true
   else
     @active_battler.animation_id = @animation1_id
     @active_battler.animation_hit = true
   end   
   # 对像方动画
   for target in @target_battlers
     if @active_battler.is_a?(Game_Actor) and target.is_a?(Game_Actor) and
        @active_battler.id == target.id
        target.animation_id = @animation1_id           
     elsif
       @active_battler.is_a?(Game_Enemy) and target.is_a?(Game_Enemy) and @active_battler.id == target.id
        target.animation_id = @animation1_id
      else  
        target.animation_id = @animation2_id
        target.animation_hit = (target.damage != "Miss")         
     end      
   end
   # 移至步骤 4
   @phase4_step = 4
end
#--------------------------------------------------------------------------
# ● 刷新画面 (主回合步骤 4 : 对像方动画)
#--------------------------------------------------------------------------
def update_phase4_step4
   # 对像方动画
   for target in @target_battlers
     if @active_battler.is_a?(Game_Actor) and target.is_a?(Game_Actor) and
        @active_battler.id == target.id
        target.animation_id = @animation2_id  
        target.animation_hit = (target.damage != "Miss")
     elsif
        @active_battler.is_a?(Game_Enemy) and target.is_a?(Game_Enemy) and
        @active_battler.id == target.id
        target.animation_id = @animation2_id  
        target.animation_hit = (target.damage != "Miss")
     end  
   end   
   # 限制动画长度、最低 8 帧
   @wait_count = 8
   # 移至步骤 5
   @phase4_step = 5
end


目前暂时没时间测试效果做工程……orz如果出Syntax错误请加End|||| [LINE]1,#dddddd[/LINE]系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
作者: 3nξhα0_lim    时间: 2008-12-31 17:25
提示: 作者被禁止或删除 内容自动屏蔽
作者: saterick    时间: 2008-12-31 20:28
感谢,已经解决。{/ka}




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1