查看: 4203|回复: 81

[已经解决] 最后一击者播放胜利动画脚本,如果敌人最后一人逃跑则.....

[复制链接]
梦石
0
星屑
35248
在线时间
4171 小时
注册时间
2007-12-15
回帖
9489
发表于 2017-8-12 19:02:23 | 显示全部楼层 |阅读模式

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

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

×
当敌人逃跑时候游戏跳出,因为我没设置会逃跑的速度型敌人,这个bug一直没测试出来。

328 行是   @actor_sprites.find{|ac| ac.battler==winner}.win
全部脚本如下,
请帮忙修正 谢谢

[pre lang="ruby"]#脚本作者 66RPG ID fux2 ,QQ 缄口不言 在下表示非常感谢。
#脚本由66RPG ID 89444640 提出并与大家分享~
#胜利动画增加随机播放 在胜利动画文件名下加新的编号 第6第7个星星处
#!为叹号 中文全角
#例 角色名★9★10★11★12★13★123!124!125★621!622!623★最后一个星可以不加
class Game_Battler

  def setup_battler_ani(battler_ani, once = 0,exflag = 0)
    case exflag
    when 1
      arr = battler_ani.split(/!/)
      if arr.size > 1
        @win_rnd_flag = rand(arr.size)
        battler_ani = arr[@win_rnd_flag]
      end
    when 2
      arr = battler_ani.split(/!/)
      if arr.size > 1
        @win_rnd_flag ||= 0
        battler_ani = arr[@win_rnd_flag]
      end
    end
    @battler_ani = battler_ani
    @oNCE = once
  end
  
  alias _ini_fux initialize unless $@
  def initialize
    @states_source = {}
    _ini_fux
  end
  
  alias _ad_state_fux add_state unless $@
  def add_state(state_id, force = false)
    _ad_state_fux(state_id, force)
    if $game_temp.in_battle && $scene.active_battler
      user = $scene.active_battler
      if self.is_a?(Game_Enemy) && user.is_a?(Game_Actor)
        @states_source[state_id] = user if user
      end
    end
  end

  alias _rm_state_fux remove_state unless $@
  def remove_state(state_id, force = false)
    _rm_state_fux(state_id, force)
    if state?(state_id) == false
      @states_source.delete(state_id)
    end
  end
  
  alias _sde_fux slip_damage_effect unless $@
  def slip_damage_effect
    spk = nil
    if @states_source.size > 0
      spk = @states_source.values[0]
    end
    ret = _sde_fux
    if self.dead?
      if $game_temp.in_battle
        $scene.spec_killer = spk
      end
    end
    return ret
  end
  
  alias _hpp_fux hp= unless $@
  def hp=(hp)
    _hpp_fux(hp)
    if self.dead?
      if $game_temp.in_battle
        $scene.spec_killer = nil
      end
    end
    self.hp
  end
end

class Sprite_Battler < RPG::Sprite
  
  def update
    super
    if @battler == nil
      self.bitmap = nil
      loop_animation(nil)
      loop_animation1(nil)
      return
    end
    if @battler.battler_name != @battler_name or
      @battler.battler_hue != @battler_hue
      @battler_name = @battler.battler_name
      @battler_hue = @battler.battler_hue
      self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
      if not @battler.hidden and not @battler.dead?
        @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
      end
      @width = bitmap.width
      @height = bitmap.height
      self.ox = @width / 2
      self.oy = @height
    end
    update_actor_animation
    update_enemy_animation
    if @battler.is_a?(Game_Enemy)
      if @once == 1 and @loop_animation_once == 1 and
        @battler.battler_dead_ani == 1
        @battler.setup_battler_ani(@battler.battler_name.split(/★/)[5])
      elsif @once == 1 and @loop_animation_once == 1 and $scene.phase != 5
        @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
      end
    end
    if @battler.is_a?(Game_Actor)
      if @once == 1 and @loop_animation_once == 1 and $scene.phase != 5 and
        @battler.battler_dead_ani == 1 and @battler.dead?
        @battler.setup_battler_ani(@battler.battler_name.split(/★/)[5])
      elsif @once == 1 and @loop_animation_once == 1 and $scene.phase != 5
        @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
        $fangyu = 0
        @battler.setup_battler_dead_ani(0)
      elsif @once == 1 and @loop_animation_once == 1 and $scene.phase == 5 and
        not @battler.dead?
        @battler.setup_battler_ani(@battler.battler_name.split(/★/)[7],0,2)
        $fangyu = 0
        @battler.setup_battler_dead_ani(0)
      end
    end
    if @battler.damage == nil and
      @battler.state_animation_id != @state_animation_id
      @state_animation_id = @battler.state_animation_id
      loop_animation1($data_animations[@state_animation_id])
    end
    if @battler.battler_ani != @battler_ani
      @battler_ani = @battler.battler_ani
      @once = @battler.battler_ani_once
      loop_animation($data_animations[@battler_ani.to_i])
    end
    if @battler.blink
      blink_on
    else
      blink_off
    end
    unless @battler_visible
      if not @battler.hidden and not @battler.dead? and
        (@battler.damage == nil or @battler.damage_pop)
        if @battler.is_a?(Game_Enemy)
          @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
        else
          @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
        end
        @battler_visible = true
      end
    end
    if @battler_visible
      if @battler.hidden
        $game_system.se_play($data_system.escape_se)
        escape
        @battler_visible = false
      end
      if @battler.white_flash
        whiten
        @battler.white_flash = false
      end
      if @battler.animation_id != 0
        animation = $data_animations[@battler.animation_id]
        animation(animation, @battler.animation_hit,@battler.damage, @battler.critical)
        @battler.animation_id = 0
      end
      if @battler.damage_pop
        @battler.damage = nil
        @battler.critical = false
        @battler.damage_pop = false
      end
      if @battler.damage == nil and @battler.dead?
        if @battler.is_a?(Game_Enemy)
          if @battler.battler_dead_ani != 1
            $game_system.se_play($data_system.enemy_collapse_se)
            @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
            @battler.setup_battler_dead_ani(1)
          end
          collapse
        else
          if @battler.battler_dead_ani != 1
            $game_system.se_play($data_system.enemy_collapse_se)
            @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
            @battler.setup_battler_dead_ani(1)
          end
        end
        @battler_visible = false
      end
    end
    if @flash_shake_switch == true
      self.x = @battler.screen_x
      self.y = @battler.screen_y
      self.z = @battler.screen_z
      @flash_shake_switch = false
    end
    if @flash_shake != 0 and @battler.damage != nil and RPG::BATTLER_JUMP
      if @battler.is_a?(Game_Enemy)
        case @flash_shake
        when 9..10
          self.x -=4
          self.y -=4
          self.z = @battler.screen_z
        when 6..8
          self.x -=2
          self.y -=2
          self.z = @battler.screen_z
        when 3..5
          self.x +=2
          self.y +=2
          self.z = @battler.screen_z
        when 1..2
          self.x +=4
          self.y +=4
          self.z = @battler.screen_z
        end
      end
      if @battler.is_a?(Game_Actor)
        case @flash_shake
        when 9..10
          self.x +=4
          self.y +=4
          self.z = @battler.screen_z
        when 6..8
          self.x +=2
          self.y +=2
          self.z = @battler.screen_z
        when 3..5
          self.x -=2
          self.y -=2
          self.z = @battler.screen_z
        when 1..2
          self.x -=4
          self.y -=4
          self.z = @battler.screen_z
        end
      end
      @flash_shake -= 1
    end
  end
  
  def win
    if @battler_name != nil and not @battler.hidden and not @battler.dead?
      @battler.setup_battler_ani(@battler_name.split(/★/)[6], 1, 1)
    end
  end
  
  def update_actor_animation
    if @battler.is_a?(Game_Actor)
      if @battler.show_damage_value != nil
        self.damage(@battler.show_damage_value, false)
        @battler.show_damage(nil)
        @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
        @battler.setup_battler_hurt_ani(1)
      end
      if @battler.current_action.kind == 0 and @battler.current_action.basic == 1 and @battler.show_damage_value != nil
        if @hits > @temp_hits and not @battler.dead?
          @temp_hits+=1
          @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
          @battler.setup_battler_hurt_ani(1)
        elsif @last_hits == 1 and not @battler.dead?
          @last_hits = 0
          @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
          @battler.setup_battler_hurt_ani(1)
        elsif @frame_index != -1 and @frame_index != @last_frame and not @battler.dead? and !@battler.damage.is_a?(Numeric)
          @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
          @battler.setup_battler_hurt_ani(1)
        elsif @last_hits == 1 and not @battler.dead? and !@battler.damage.is_a?(Numeric)
          @last_hits = 0
          @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
          @battler.setup_battler_hurt_ani(1)
        end
      else
        if @last_hits == 1 and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and $fangyu != 1
          @last_hits = 0
          @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
          @battler.setup_battler_hurt_ani(1)
        elsif @hits > @temp_hits and @frame_index != @last_frame and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and  
          $fangyu != 1
          @temp_hits+=1
          @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
          @battler.setup_battler_hurt_ani(1)
        elsif @hits > @temp_hits and @frame_index != @last_frame and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and $fangyu != 1 and  
          @battler.dead? and @battler.battler_dead_ani != 1
          @temp_hits+=1
          @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
          @battler.setup_battler_hurt_ani(1)
        elsif !@battler_damage.is_a?(Numeric) and @last_hits == 1 and @frame_index == @last_frame
          @last_hits = 0
        elsif @battler_damage.is_a?(Numeric) and @battler.damage == 0 and @last_hits == 1 and @frame_index == @last_frame
          @last_hits = 0
        elsif @last_hits == 1 and @frame_index == @last_frame and @battler.dead? and @battler.battler_dead_ani != 1
          @last_hits = 0
          @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
          @battler.setup_battler_dead_ani(1)
        elsif $scene.phase == 5 and @once == 0 and @battler_name != nil and not @battler.hidden and not @battler.dead? and $game_temp.battle_proc == nil
          @once = 1
          @battler.setup_battler_ani(@battler_name.split(/★/)[6], 1,1)
        end
      end
    end
  end
end

class Scene_Battle
  attr_reader   :active_battler
  attr_accessor :spec_killer
  def initialize
    @spec_killer = nil
  end
  
  def get_real_killer
    if @spec_killer
      return @spec_killer
    end
    return @active_battler
  end
  
  def start_phase5
    @spriteset.win(get_real_killer)
    start_phase5101
  end
end

class Spriteset_Battle
  def win(winner)
    if winner
      @actor_sprites.find{|ac| ac.battler==winner}.win
    else
      for sprite in @actor_sprites
        sprite.win
      end
    end
  end
end

class Game_Actor < Game_Battler
  def screen_z
    case self.index
    when 0
      return 70
    when 1
      return 90
    when 2
      return 80
    when 3
      return 100
    else
      return 0
    end
  end
end

module RPG
  class Sprite < ::Sprite
    def animation_set_sprites(sprites, cell_data, position)
      for i in 0..15
        sprite = sprites
        pattern = cell_data[i, 0]
        if sprite == nil or pattern == nil or pattern == -1
          sprite.visible = false if sprite != nil
          next
        end
        sprite.visible = true
        sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
        if position == 3
          if self.viewport != nil
            sprite.x = self.viewport.rect.width / 2
            sprite.y = self.viewport.rect.height - 160
          else
            sprite.x = 320
            sprite.y = 240
          end
        else
          sprite.x = self.x - self.ox + self.src_rect.width / 2
          sprite.y = self.y - self.oy + self.src_rect.height / 2
          sprite.y -= self.src_rect.height / 4 if position == 0
          sprite.y += self.src_rect.height / 4 if position == 2
        end
        sprite.x += cell_data[i, 1]
        sprite.y += cell_data[i, 2]
        sprite.z = 2000+self.z
        sprite.ox = 96
        sprite.oy = 96
        sprite.zoom_x = cell_data[i, 3] / 100.0
        sprite.zoom_y = cell_data[i, 3] / 100.0
        sprite.angle = cell_data[i, 4]
        sprite.mirror = (cell_data[i, 5] == 1)
        sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
        sprite.blend_type = cell_data[i, 7]
      end
    end
  end
end[/pre]
梦石
0
星屑
39236
在线时间
11155 小时
注册时间
2009-3-15
回帖
4768
发表于 2017-8-14 12:09:40 | 显示全部楼层
本帖最后由 soulsaga 于 2017-8-14 14:23 编辑

有问题的话还原脚本..

[pre lang="ruby"]def get_real_killer
    if @spec_killer
      return @spec_killer
    end
    return $activebattler
  end[/pre]
反击死的问题可能要改成这样..
然后MAIN上面插入以下脚本
[pre lang="ruby"]class Game_Battler
    #--------------------------------------------------------------------------
  # ● 应用通常攻击效果
  #     attacker : 攻击者 (battler)
  #--------------------------------------------------------------------------

alias attack_effect20170814 attack_effect
  def attack_effect(attacker)
    $activebattler = attacker if attacker.is_a?(Game_Actor)#如果攻击者是角色就代入到变量里
   
    return attack_effect20170814(attacker)
  end
    #--------------------------------------------------------------------------
  # ● 应用特技效果
  #     user  : 特技的使用者 (battler)
  #     skill : 特技
  #--------------------------------------------------------------------------
alias skill_effect20170814 skill_effect
  def skill_effect(user, skill)
    $activebattler = user if user.is_a?(Game_Actor)#如果攻击者是角色就代入到变量里
    return skill_effect20170814(user, skill)
  end
end[/pre]

就既可解決敌人逃走弹出问题..又能改成最后攻击的角色播放动画了..

点评

有return @spec_killer那些的话..反击死也可以正常了..  发表于 2017-8-14 15:01
上来跑倒是没事,反击还没测试到,上面那个我改的不一样,就加一句313 return $activebattler end没加目前正常  发表于 2017-8-14 14:34
再修正脚本..果然杀死敌人播放胜利动画要留下呢..  发表于 2017-8-14 14:24
话说反击死正常吗..  发表于 2017-8-14 14:16
我想应该没有问题.不过没有清空全局变量..所以这次胜利后下次战斗敌人一开始就逃走的话就应该会是播放和上一次战斗最后同一人胜利动画吧..  发表于 2017-8-14 14:13
回复

使用道具 举报

梦石
0
星屑
39236
在线时间
11155 小时
注册时间
2009-3-15
回帖
4768
发表于 2017-8-12 23:00:20 | 显示全部楼层
怎么不@版主过来?
回复

使用道具 举报

梦石
0
星屑
35248
在线时间
4171 小时
注册时间
2007-12-15
回帖
9489
 楼主| 发表于 2017-8-12 23:04:52 | 显示全部楼层
本帖最后由 89444640 于 2017-8-13 09:39 编辑

@fux2这样用?@fux2
没用过不清楚。
01.png

点评

水区那个接龙,别人设置了一个会逃跑的速度型敌人,每次最后一名敌人逃跑就跳出,我才发现这个bug  发表于 2017-8-14 08:43
没用你怎么测出BUG?  发表于 2017-8-14 08:38
现实的动画得用全动画脚本里面那个方法,星号后的数字什么的,敌人逃跑--b从来没用过不清楚  发表于 2017-8-14 08:14
可以教一下怎么显示胜利动画和设置敌人逃走吗?  发表于 2017-8-13 11:18
回复

使用道具 举报

梦石
0
星屑
35248
在线时间
4171 小时
注册时间
2007-12-15
回帖
9489
 楼主| 发表于 2017-8-14 09:05:54 | 显示全部楼层
本帖最后由 89444640 于 2017-8-15 14:38 编辑

这样吧,我清理出来一个测试工程过来容易修改。
敌人设置100%逃跑,都调好了,请测试。
回复

使用道具 举报

梦石
0
星屑
39236
在线时间
11155 小时
注册时间
2009-3-15
回帖
4768
发表于 2017-8-14 09:59:48 | 显示全部楼层
本帖最后由 soulsaga 于 2017-8-14 10:09 编辑
89444640 发表于 2017-8-14 09:05
这样吧,我清理出来一个测试工程过来容易修改。
敌人设置100%逃跑,都调好了,请测试。


[pre lang="ruby"]
    @spriteset.win(get_real_killer) if @battler.is_a?(Game_Actor)[/pre]

最后一击者播放胜利动画脚本改成这样就可以了..

点评

你给我的工程可以正常播放胜利动画啊..虽然有点怪..两个灵梦都一起播放..  发表于 2017-8-14 12:23
那啥 不行……两个工程这么改完都不播放胜利动画了。ORZ  发表于 2017-8-14 11:20
没事我再试试,毕竟主程序里面好多杂七杂八的,没准别的脚本也有修改,现在只要不跳出就好。  发表于 2017-8-14 11:10
你得找大神帮你再改改脚本了..现在这个只是杀死敌人的角色播放胜利动画..  发表于 2017-8-14 10:48
不对..再研究一下..杀死敌人就返回杀死的角色..否则就是当前行动者  发表于 2017-8-14 10:42

评分

参与人数 2星屑 +140 梦石 +2 收起 理由
RyanBern + 2 认可答案
89444640 + 140

查看全部评分

回复

使用道具 举报

梦石
0
星屑
35248
在线时间
4171 小时
注册时间
2007-12-15
回帖
9489
 楼主| 发表于 2017-8-14 16:43:56 | 显示全部楼层
本帖最后由 89444640 于 2017-8-14 16:46 编辑
soulsaga 发表于 2017-8-14 12:09
有问题的话还原脚本..

def get_real_killer


单人测试没问题了,特意去试了下两人的情况。
两人的情况第一名角色胜利动画依然随机播放,
第二人有三个随机胜利动作,但是每次该角色胜利必定只播放第一个,其他的都不播放,
试了十次都是播放第一个,不可能是我运气太差了。
不知道是这个脚本原先的问题我没试出来还是新出现的。
可能主角灭人的次数太多了,没注意到同伴有这个问题。
不知道第三人第四人是否也是如此。

点评

不过你给我的工程就已经是胜利全员都会播放胜利动画..为何?  发表于 2017-8-14 17:12
我测试没问题..4人都随机播放..不过似乎有时会几种胜利动作混合播放?  发表于 2017-8-14 17:11
回复

使用道具 举报

梦石
0
星屑
39236
在线时间
11155 小时
注册时间
2009-3-15
回帖
4768
发表于 2017-8-14 16:46:29 | 显示全部楼层
本帖最后由 soulsaga 于 2017-8-15 20:50 编辑


https://rpg.blue/forum.php?mod=v ... &extra=page%3D1
位移写好了..要配合上面地址的工具使用..
[pre lang="ruby"]#位移BY:SOULSAGA
#使用方法:打开RMXP备注编辑器RXDataEditor.exe
#在技能备注写
#X移动:+:位移植
#X移动:-:位移植
#向左移是+向右移是-敌人打我方则相反
#Y移动:+:位移植
#Y移动:-:位移植
#等待:帧数值   最大是动画总帧数+14 超过不会有效
#受伤动作:战斗图用星号隔开的编号..



class Game_Battler
  alias item_effectsoulsaga item_effect
  def item_effect(item)
    $skill_id = 1
    $skillmoveflag = "OFF"
    $wait_count = 0
    @wait_skill = false
    $i = 0
    $battler_damage = 3
    return item_effectsoulsaga(item)
  end
   
    #--------------------------------------------------------------------------
  # ● 应用通常攻击效果
  #     attacker : 攻击者 (battler)
  #--------------------------------------------------------------------------

  
alias attack_effect20170814 attack_effect
  def attack_effect(attacker)
    $activebattler = attacker if attacker.is_a?(Game_Actor)#如果攻击者是角色就代入到变量里
    $skill_id = 1
    $skillmoveflag = "OFF"
    $wait_count = 0
    @wait_skill = false
    $i = 0
    $battler_damage = 3
    return attack_effect20170814(attacker)
  end
    #--------------------------------------------------------------------------
  # ● 应用特技效果
  #     user  : 特技的使用者 (battler)
  #     skill : 特技
  #--------------------------------------------------------------------------
alias skill_effect20170814 skill_effect
  def skill_effect(user, skill)
    $skill_id = skill.id
    $skillmoveflag = "OFF"
    $wait_count = 0
    @wait_skill = false
    $i = 0
    $battler_damage = 3
    $activebattler = user if user.is_a?(Game_Actor)#如果攻击者是角色就代入到变量里
    return skill_effect20170814(user, skill)
  end
end
module RPG
class Sprite < ::Sprite
#位移BY:SOULSAGA
   #..........................................................................
   def update_animation
     if @_animation_duration > 0
       frame_index = @_animation.frame_max - @_animation_duration
       @frame_index = frame_index
       cell_data = @_animation.frames[frame_index].cell_data
       position = @_animation.position
       animation_set_sprites(@_animation_sprites, cell_data, position)
      
       $wait_count -= 1 if $wait_count >= 1
       if $skillmoveflag == "OFF"
       @skill_xmove = []
skill = $data_skills[$skill_id]
skill_xymove = skill.note.split(/\r\n/)
if $wait_count <= 0 and @battler.damage != "Miss" and @battler.damage != nil
      while $i < skill_xymove.length
        if $wait_count <= 0 and @battler.damage != "Miss" and @battler.damage != nil
        @skill_xmove = skill_xymove[$i].split(/:/)
      if skill_xymove[$i].include?("X移动")
       case @skill_xmove[1]
    when "+"
       self.ox += @skill_xmove[2].to_i if @battler.is_a?(Game_Enemy)
       self.ox -= @skill_xmove[2].to_i if @battler.is_a?(Game_Actor)
       when "-"
       self.ox -= @skill_xmove[2].to_i if @battler.is_a?(Game_Enemy)
       self.ox += @skill_xmove[2].to_i if @battler.is_a?(Game_Actor)
       end
     end
     if skill_xymove[$i].include?("Y移动")
       case @skill_xmove[1]
    when "+"
       self.oy += @skill_xmove[2].to_i if @battler.is_a?(Game_Enemy)
       self.oy += @skill_xmove[2].to_i if @battler.is_a?(Game_Actor)
       when "-"
       self.oy -= @skill_xmove[2].to_i if @battler.is_a?(Game_Enemy)
       self.oy -= @skill_xmove[2].to_i if @battler.is_a?(Game_Actor)
     end
     end
   end
   if skill_xymove[$i].include?("受伤动作")
     $battler_damage = @skill_xmove[1].to_i
     end
   if skill_xymove[$i].include?("等待")
     $wait_count = @skill_xmove[1].to_i
     $skillmoveflag = "OFF"
      end
      $i += 1
      break if $wait_count > 0
      $skillmoveflag = "ON"
      end
  end
  end
  #=======================================
       # 修改:弹出伤害,权重计算
       #=======================================
       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
             t = t.to_i
             #在闪光不是最后一次的情况下,把这次伤害加入到已经发生的伤害中★★★★★★★★★★★★★★★★★★★★★★★★★★
             if frame_index != @_last_frame
             @p_dam+= t
             end
             #p @p_dam,"已发生伤害",@battler_damage,"总伤害"(调试用)★★★★★★★★★★★★★★★★★★★★★★★★★★
             #闪光为最后一次的情况下,改变这次伤害的计算方法(总伤害-已经发生伤害)★★★★★★★★★★★★★★★★★★★★★★★★★★
             if frame_index == @_last_frame
               t= @battler_damage-@p_dam
             end
             #p t,"当前伤害",@battler_damage,"总伤害"
             # 最后一次闪光的话,伤害修正
             if frame_index == @_last_frame
               @_total_damage = @battler_damage - t
               @p_dam=0      #已经发生的伤害归0★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
            end
             #p t,@battler_damage,@all_quanzhong
             damage(t,@battler_critical) if timing.flash_scope != 3
            #连击次数归0★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
            if frame_index == @_last_frame
                      ############ #小改动
                      @last_hits=1
                      @temp_hits=0
                      ############
                      @hits=0
            end
           # 防止重复播放miss
           elsif !@battler_damage.is_a?(Numeric) and timing.flash_scope != 0
             damage(@battler_damage,@battler_critical)
           end
         end
       end
     else
       dispose_animation
       end
end
end
end


class Sprite_Battler < RPG::Sprite
  #--------------------------------------------------------------------------
  # ● 处理角色动作
  #--------------------------------------------------------------------------
  def update_actor_animation
    if @battler.is_a?(Game_Actor)
      if @battler.show_damage_value != nil
        self.damage(@battler.show_damage_value, false)
        @battler.show_damage(nil)
        @battler.setup_battler_ani(@battler.battler_name.split(/★/)[$battler_damage], 1)
        @battler.setup_battler_hurt_ani(1)
      end
      @last_frame = $fanime_frame_max if $fanime_frame_max > @last_frame
      if @battler.current_action.kind == 0 and @battler.current_action.basic == 1 and @battler.show_damage_value != nil
        # 防御的时候
        if @hits > @temp_hits and not @battler.dead?
          ############ #小改动
          @temp_hits+=1
          ############
          @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
          @battler.setup_battler_hurt_ani(1)
          #################################################################
        elsif @last_hits == 1 and not @battler.dead?
          ############ #小改动
          @last_hits = 0
          ############
          @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
          @battler.setup_battler_hurt_ani(1)
          #################################################################
        elsif @frame_index != -1 and @frame_index != @last_frame and not @battler.dead? and !@battler.damage.is_a?(Numeric)
          @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
          @battler.setup_battler_hurt_ani(1)
          #################################################################
        elsif @last_hits == 1 and not @battler.dead? and !@battler.damage.is_a?(Numeric)
          ############ #小改动
          @last_hits = 0
          ############
          @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
          @battler.setup_battler_hurt_ani(1)
          #################################################################
        end
      else
        # 单回合只有一次攻击
       if @last_hits == 1 and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and $fangyu != 1
          ############ #小改动
          @last_hits = 0
          ############
          @battler.setup_battler_ani(@battler.battler_name.split(/★/)[$battler_damage], 1)
          @battler.setup_battler_hurt_ani(1)
          #################################################################
        # 单回合多次攻击
       elsif @hits > @temp_hits and @frame_index != @last_frame and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and  
$fangyu != 1
          ############ #小改动
          @temp_hits+=1
          ############
          @battler.setup_battler_ani(@battler.battler_name.split(/★/)[$battler_damage], 1)
          @battler.setup_battler_hurt_ani(1)
        ########################################################################
        # 死亡之前攻击
       elsif @hits > @temp_hits and @frame_index != @last_frame and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and $fangyu != 1 and  
@battler.dead? and @battler.battler_dead_ani != 1
          ############ #小改动
          @temp_hits+=1
          ############
          @battler.setup_battler_ani(@battler.battler_name.split(/★/)[$battler_damage], 1)
          @battler.setup_battler_hurt_ani(1)
          #################################################################
        # 闪避的回合
       elsif !@battler_damage.is_a?(Numeric) and @last_hits == 1 and @frame_index == @last_frame
          @last_hits = 0
          #################################################################
        # 无伤害的攻击
        elsif @battler_damage.is_a?(Numeric) and @battler.damage == 0 and @last_hits == 1 and @frame_index == @last_frame
          @last_hits = 0
          #################################################################
        # 死亡判定
        elsif @frame_index == @last_frame and @battler.dead? and @battler.battler_dead_ani != 1
          #p 111
       #elsif @last_hits == 1 and @frame_index == @last_frame and @battler.dead? and @battler.battler_dead_ani != 1
          @last_hits = 0
          @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
          #@battler.setup_battler_dead_ani(1)
          #################################################################
        # 胜利判定
       elsif $scene.phase == 5 and @once == 0 and @battler_name != nil and not @battler.hidden and not @battler.dead? and $game_temp.battle_proc == nil
             @once = 1
             @battler.setup_battler_ani(@battler_name.split(/★/)[6], 1)
        end
      end
      @battler.setup_battler_ani(@battler.battler_name.split(/★/)[$battler_damage], 1) if @frame_index < @last_frame and @frame_index > 0 and @battler.battler_dead_ani != 1 and $battler_damage != 3 and @battler.damage.is_a?(Numeric)
    end
  end
  #--------------------------------------------------------------------------
  # ● 处理敌人动作
  #--------------------------------------------------------------------------
  def update_enemy_animation
    if @battler.is_a?(Game_Enemy)
      if @battler.show_damage_value != nil
        self.damage(@battler.show_damage_value, false)
        @battler.show_damage(nil)
        @battler.setup_battler_ani(@battler.battler_name.split(/★/)[$battler_damage], 1)
        @battler.setup_battler_hurt_ani(1)
      end
      @last_frame = $fanime_frame_max if $fanime_frame_max > @last_frame
      if @battler.current_action.kind == 0 and @battler.current_action.basic == 1
      else
        # 单回合只有一次攻击
        if @last_hits == 1 and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0
          ############ #小改动
          #p 222
          @last_hits = 0
          ############
          @battler.setup_battler_ani(@battler.battler_name.split(/★/)[$battler_damage], 1)
          @battler.setup_battler_hurt_ani(1)
          #################################################################
        # 单回合多次攻击
       elsif @hits > @temp_hits and @frame_index != @last_frame and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0
          ############ #小改动
          #p 111
          @temp_hits+=1
          ############
          @battler.setup_battler_ani(@battler.battler_name.split(/★/)[$battler_damage], 1)
          @battler.setup_battler_hurt_ani(1)
          #################################################################
        # 死亡之前攻击
       elsif @hits > @temp_hits and @frame_index != @last_frame and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and @battler.dead? and @battler.battler_dead_ani != 1
          ############ #小改动
          #p 333
          @temp_hits+=1
          ############
          @battler.setup_battler_ani(@battler.battler_name.split(/★/)[$battler_damage], 1)
          @battler.setup_battler_hurt_ani(1)
          #################################################################
        # 无伤害的攻击
        elsif !@battler_damage.is_a?(Numeric) and @last_hits == 1 and @frame_index == @last_frame
          @last_hits = 0
          #################################################################
        # 闪避的回合
        elsif @battler_damage.is_a?(Numeric) and @battler.damage == 0 and @last_hits == 1 and @frame_index == @last_frame
          @last_hits = 0
          #################################################################
        # 死亡判定
        elsif @frame_index == @last_frame and @battler.dead? and @battler.battler_dead_ani != 1
          #p $fanime_frame_max
        #elsif @last_hits == 1 and @frame_index == @last_frame and @battler.dead? and @battler.battler_dead_ani != 1
          @last_hits = 0
          @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
          @battler.setup_battler_dead_ani(1)
          collapse
        end
      end
      @battler.setup_battler_ani(@battler.battler_name.split(/★/)[$battler_damage], 1) if @frame_index < @last_frame and @frame_index > 0 and @battler.battler_dead_ani != 1 and $battler_damage != 3 and @battler.damage.is_a?(Numeric)
    end
  end
end[/pre]
之前让你插入的脚本替换这个..

点评

位移写好了  发表于 2017-8-15 20:51
因为上述三种角度是标准图块类ACT地图常用的角度,操作是拉方向键前后,是与产生相应角度的位移,Y数值增加或者减小。  发表于 2017-8-15 17:30
重力系统显示异常bug修正以后,我又能在后面剧情里加ACT用的地图了。这次可以考虑做遇敌与各种2Dact机关,因此需要解决操作恶心的问题  发表于 2017-8-15 17:29
说起来 XP有办法实现2Dact系统或者rpg系统下的斜角移动吗22.5度30度45度三种每次上楼梯都得蹦,下楼梯都得下落而不是走 很不爽啊- -b  发表于 2017-8-15 17:27
程序方面就全靠你了,我只能拿素材来测试,报告bug  发表于 2017-8-15 16:38
回复

使用道具 举报

梦石
0
星屑
35248
在线时间
4171 小时
注册时间
2007-12-15
回帖
9489
 楼主| 发表于 2017-8-15 22:03:37 | 显示全部楼层
本帖最后由 89444640 于 2017-8-15 22:05 编辑

能不能用先放一边,RXDataEditor保存修改未响应半天,如果中间一直未响应,强制关闭 就无法在打开数据库了,感觉非常不安全。也许是我数据库太大了?
上面的说明我不太理解
比如我对敌人攻击造成位移,描述是 X+32 Y+16
等待是什么意思?受创持续时间?还是第几帧的时候出现受创位移?
然后受创动作 用星号隔开的编号,比如正常情况敌人如果有受创的话应该是第三个星号 我就写3?

最后RXDataEdito 姑且称之为战斗位移编辑器吧
这里面写的应该是
X+32
Y+16
14
3

然后 我要是多段技能呢?比如4连斩的招式,中间会出现好几次位移不但角色有位移 敌人也应该有,
怎么处理?

先不说这个,我就写了个位移数值
X+32
y+16
然后进游戏测试 普通攻击就出这个
01.png
不知道哪里冲突了

点评

另外命令是没次序的..只要没有等待命令都是同一帧执行..  发表于 2017-8-16 10:14
等待:10 受伤动作:7 这样写才对..  发表于 2017-8-16 10:13
另外用星号隔开的编号..你可以在战斗图名字后面加星来新加动作的. .我测试过.没影响..  发表于 2017-8-16 10:11
保存后关掉RXDataEditor才正常保存?  发表于 2017-8-16 10:09
读取RXDataEditor修改前的DAT..所以最好关掉再打开RMXP..另外你应该有把RXDataEditor相关的脚本加在脚本编辑器最上吧?  发表于 2017-8-16 10:07
回复

使用道具 举报

梦石
0
星屑
39236
在线时间
11155 小时
注册时间
2009-3-15
回帖
4768
发表于 2017-8-16 10:03:36 | 显示全部楼层
89444640 发表于 2017-8-15 22:03
能不能用先放一边,RXDataEditor保存修改未响应半天,如果中间一直未响应,强制关闭 就无法在打开数据库了 ...

你写错命令了..
是这样写的..
X移动:+:32

等待是等一定帧数后才继续执行下个命令..

点评

RXDataEditor保存修改我一会就好了..然后好像要关掉这个工具才正常..另外RMXP编辑器最好是未打开时编辑备注...因为即使重新读取工程文件也是读取  发表于 2017-8-16 10:05
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部