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

Project1

 找回密码
 注册会员
搜索
12
返回列表 发新帖
楼主: 89444640
打印 上一主题 下一主题

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

[复制链接]

Lv5.捕梦者

梦石
0
星屑
35138
在线时间
4164 小时
注册时间
2007-12-15
帖子
10061
11
 楼主| 发表于 2017-8-16 15:18:20 | 只看该作者
本帖最后由 89444640 于 2017-8-18 11:28 编辑

看来还是得清楚个别的工程测试,太危险--
我先理解一下……

需要插入的脚背插入rm的脚本最顶层

脚本编辑器打开后前外别开游戏直到保正常存以后,

脚本中的备注方式是
X移动:+:32    含义 敌方向左移动32像素
Y移动:+:16    含义 敌方向上移动16像素
等待:10         含义 受创显示10帧后,在已经产生位移的地方,执行下一个受创位移动作

由于全动画脚本的描述是这样
名字★待机★防御★挨打★死亡动态★死亡静态★胜利动态★胜利静态
因此受创动作描述应该是
受伤动作:3

可能存在问题,
敌人位于左侧版边,由于主角很多多段技能,如果可以出位移,经常会把敌人打消失,怎么办- -b
如果上述描述正确的话,那么我吧敌人打浮空以后敌人会有向下降落,这个过程如果想要手感好,必须得有个加速减速速度变化- -b
就需要按照运动规律写三四种速度变化但是XP动画中调节,一个缺点是缩为二分之一,好多细节我看不清,只能进去测试
另一个缺点就是敌人xy坐标变化后,好难控制主角动作的第二招也能打到敌人合适的位置,敌人体型有区别,目前最小的xp行走图的老鼠,最大的以前划过的大章鱼
如果都能产生位移说不过去啊,那么大的章鱼能打飞?
这招式调起来估计得死人==b
如果没有类似格斗游戏的那种直观的编辑器,那么其使用难度……

总之我晚上回去再试试吧。昨天折腾到半夜今天可不能再这样了,今天一整天都没精神

点评

受伤动作不一定是3..你可以用其他数字..战斗图文件往后加新动作也可以的..  发表于 2017-8-16 15:36
如果只是大型的不能打飞是很简单的..  发表于 2017-8-16 15:35
如果还是介意体型的话..可以在敌人备注弄一下..  发表于 2017-8-16 15:35
其实还可以写个每帧位移持续多少帧数的命令..  发表于 2017-8-16 15:31
体型没所谓..照样打飞吧..  发表于 2017-8-16 15:28
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
36124
在线时间
10712 小时
注册时间
2009-3-15
帖子
4806
12
发表于 2017-8-16 18:50:48 | 只看该作者
本帖最后由 soulsaga 于 2017-8-18 12:03 编辑
89444640 发表于 2017-8-16 15:18
看来还是得清楚个别的工程测试,太危险--
我先理解一下……


RUBY 代码复制
  1. #位移BY:SOULSAGA
  2. #使用方法:打开RMXP备注编辑器RXDataEditor.exe
  3. #在技能备注写
  4. #X移动:+:位移植
  5. #X移动:-:位移植
  6. #向左移是-向右移是+敌人打我方则相反
  7. #Y移动:+:位移植
  8. #Y移动:-:位移植
  9. #等待:帧数值   最大是动画总帧数+14 超过不会有效
  10. #受伤动作:战斗图用星号隔开的编号..
  11. #X持续移动:+或-:位移值:持续帧数   每1帧进行X位移持续指定帧数
  12. #Y持续移动:+或-:位移值:持续帧数   每1帧进行Y位移持续指定帧数
  13. #20170816新增版边限制
  14.  
  15. class Game_Battler
  16.   alias item_effectsoulsaga item_effect
  17.   def item_effect(item)
  18.     $skill_id = 1
  19.     $skillmoveflag = "OFF"
  20.     $wait_count = 0
  21.     @wait_skill = false
  22.     $i = 0
  23.     $battler_damage = 3
  24.     $xmove_time = 0
  25.     $xmove = 0
  26.     $ymove_time = 0
  27.     $ymove = 0
  28.     return item_effectsoulsaga(item)
  29.   end
  30.  
  31.     #--------------------------------------------------------------------------
  32.   # ● 应用通常攻击效果
  33.   #     attacker : 攻击者 (battler)
  34.   #--------------------------------------------------------------------------
  35.  
  36.  
  37. alias attack_effect20170814 attack_effect
  38.   def attack_effect(attacker)
  39.     $activebattler = attacker if attacker.is_a?(Game_Actor)#如果攻击者是角色就代入到变量里
  40.     $skill_id = 1
  41.     $skillmoveflag = "OFF"
  42.     $wait_count = 0
  43.     @wait_skill = false
  44.     $i = 0
  45.     $battler_damage = 3
  46.     $xmove_time = 0
  47.     $xmove = 0
  48.     $ymove_time = 0
  49.     $ymove = 0
  50.     return attack_effect20170814(attacker)
  51.   end
  52.     #--------------------------------------------------------------------------
  53.   # ● 应用特技效果
  54.   #     user  : 特技的使用者 (battler)
  55.   #     skill : 特技
  56.   #--------------------------------------------------------------------------
  57. alias skill_effect20170814 skill_effect
  58.   def skill_effect(user, skill)
  59.     $skill_id = skill.id
  60.     $skillmoveflag = "OFF"
  61.     $wait_count = 0
  62.     @wait_skill = false
  63.     $i = 0
  64.     $battler_damage = 3
  65.     $xmove_time = 0
  66.     $xmove = 0
  67.     $ymove_time = 0
  68.     $ymove = 0
  69.     $activebattler = user if user.is_a?(Game_Actor)#如果攻击者是角色就代入到变量里
  70.     return skill_effect20170814(user, skill)
  71.   end
  72. end
  73. module RPG
  74. class Sprite < ::Sprite
  75. #位移BY:SOULSAGA
  76.    #..........................................................................
  77.    def update_animation
  78.      if @_animation_duration > 0
  79.        frame_index = @_animation.frame_max - @_animation_duration
  80.        @frame_index = frame_index
  81.        cell_data = @_animation.frames[frame_index].cell_data
  82.        position = @_animation.position
  83.        animation_set_sprites(@_animation_sprites, cell_data, position)
  84. if $xmove_time > 0 and @battler.damage != "Miss" and @battler.damage != nil
  85.    case $xmoveif
  86.     when "-"
  87.   self.x -= $xmove if @battler.is_a?(Game_Enemy)
  88.   self.x += $xmove if @battler.is_a?(Game_Actor)
  89.     when "+"
  90.   self.x += $xmove if @battler.is_a?(Game_Enemy)
  91.   self.x -= $xmove if @battler.is_a?(Game_Actor)
  92.   end
  93.   $xmove_time -= 1
  94. end
  95. if $ymove_time > 0 and @battler.damage != "Miss" and @battler.damage != nil
  96.    case $ymoveif
  97.     when "-"
  98.   self.y -= $ymove if @battler.is_a?(Game_Enemy)
  99.   self.y += $ymove if @battler.is_a?(Game_Actor)
  100.     when "+"
  101.   self.y += $ymove if @battler.is_a?(Game_Enemy)
  102.   self.y -= $ymove if @battler.is_a?(Game_Actor)
  103.   end
  104.   $ymove_time -= 1
  105.   end
  106.       $ox = self.x if !$ox or $ox.nil?
  107.       $oy = self.y if !$oy or $oy.nil?
  108.        $wait_count -= 1 if $wait_count >= 1
  109.        if $skillmoveflag == "OFF"
  110.        @skill_xmove = []
  111. skill = $data_skills[$skill_id]
  112. skill_xymove = skill.note.split(/\r\n/)
  113. if $wait_count <= 0 and @battler.damage != "Miss" and @battler.damage != nil
  114.       while $i < skill_xymove.length
  115.         if $wait_count <= 0 and @battler.damage != "Miss" and @battler.damage != nil
  116.         @skill_xmove = skill_xymove[$i].split(/:/)
  117.       if skill_xymove[$i].include?("X移动")
  118.        case @skill_xmove[1]
  119.     when "-"
  120.        self.x -= @skill_xmove[2].to_i if @battler.is_a?(Game_Enemy)
  121.        self.x += @skill_xmove[2].to_i if @battler.is_a?(Game_Actor)
  122.        when "+"
  123.        self.x += @skill_xmove[2].to_i if @battler.is_a?(Game_Enemy)
  124.        self.x -= @skill_xmove[2].to_i if @battler.is_a?(Game_Actor)
  125.      end
  126.      end
  127.      if skill_xymove[$i].include?("Y移动")
  128.        case @skill_xmove[1]
  129.     when "+"
  130.        self.y += @skill_xmove[2].to_i if @battler.is_a?(Game_Enemy)
  131.        self.y += @skill_xmove[2].to_i if @battler.is_a?(Game_Actor)
  132.        when "-"
  133.        self.y -= @skill_xmove[2].to_i if @battler.is_a?(Game_Enemy)
  134.        self.y -= @skill_xmove[2].to_i if @battler.is_a?(Game_Actor)
  135.      end
  136.      end
  137.    end
  138.    if skill_xymove[$i].include?("X持续移动")
  139.        case @skill_xmove[1]
  140.     when "-"
  141.        self.x -= @skill_xmove[2].to_i if @battler.is_a?(Game_Enemy)
  142.        self.x += @skill_xmove[2].to_i if @battler.is_a?(Game_Actor)
  143.        $xmoveif = @skill_xmove[1]
  144.        $xmove = @skill_xmove[2].to_i
  145.        $xmove_time = @skill_xmove[3].to_i
  146.        when "+"
  147.        self.x += @skill_xmove[2].to_i if @battler.is_a?(Game_Enemy)
  148.        self.x -= @skill_xmove[2].to_i if @battler.is_a?(Game_Actor)
  149.        $xmoveif = @skill_xmove[1]
  150.        $xmove = @skill_xmove[2].to_i
  151.        $xmove_time = @skill_xmove[3].to_i
  152.      end
  153.    end
  154.    if skill_xymove[$i].include?("Y持续移动")
  155.        case @skill_xmove[1]
  156.     when "-"
  157.        self.y -= @skill_xmove[2].to_i if @battler.is_a?(Game_Enemy)
  158.        self.y += @skill_xmove[2].to_i if @battler.is_a?(Game_Actor)
  159.        $ymoveif = @skill_xmove[1]
  160.        $ymove = @skill_xmove[2].to_i
  161.        $ymove_time = @skill_xmove[3].to_i
  162.        when "+"
  163.        self.y += @skill_xmove[2].to_i if @battler.is_a?(Game_Enemy)
  164.        self.y -= @skill_xmove[2].to_i if @battler.is_a?(Game_Actor)
  165.        $ymoveif = @skill_xmove[1]
  166.        $ymove = @skill_xmove[2].to_i
  167.        $ymove_time = @skill_xmove[3].to_i
  168.      end
  169.      end
  170.    if skill_xymove[$i].include?("受伤动作")
  171.      $battler_damage = @skill_xmove[1].to_i
  172.      end
  173.    if skill_xymove[$i].include?("等待")
  174.      $wait_count = @skill_xmove[1].to_i
  175.      $skillmoveflag = "OFF"
  176.       end
  177.       $i += 1
  178.       break if $wait_count > 0
  179.       $skillmoveflag = "ON"
  180.       end
  181.   end
  182. end
  183. if frame_index == $fanime_frame_max-1
  184. self.x = $ox
  185. self.y = $oy
  186. $ox = nil
  187. $oy = nil
  188. end
  189. self.x = 640640-self.ox if self.x > 640-self.ox #if @battler.is_a?(Game_Enemy)
  190. self.x = 0+self.ox if self.x < 0+self.ox #if @battler.is_a?(Game_Actor)
  191.   #=======================================
  192.        # 修改:弹出伤害,权重计算
  193.        #=======================================
  194.        for timing in @_animation.timings
  195.          if timing.frame == frame_index
  196.            t = 1.0 * animation_process_timing(timing, @_animation_hit)            
  197.            #p t,"当前权重", @all_quanzhong,"总权重"
  198.            if @battler_damage.is_a?(Numeric) and t != 0
  199.              t *= @battler_damage
  200.              t /= @all_quanzhong
  201.              t = t.to_i
  202.              #在闪光不是最后一次的情况下,把这次伤害加入到已经发生的伤害中★★★★★★★★★★★★★★★★★★★★★★★★★★
  203.              if frame_index != @_last_frame
  204.              @p_dam+= t
  205.              end
  206.              #p @p_dam,"已发生伤害",@battler_damage,"总伤害"(调试用)★★★★★★★★★★★★★★★★★★★★★★★★★★
  207.              #闪光为最后一次的情况下,改变这次伤害的计算方法(总伤害-已经发生伤害)★★★★★★★★★★★★★★★★★★★★★★★★★★
  208.              if frame_index == @_last_frame
  209.                t= @battler_damage-@p_dam
  210.              end
  211.              #p t,"当前伤害",@battler_damage,"总伤害"
  212.              # 最后一次闪光的话,伤害修正
  213.              if frame_index == @_last_frame
  214.                @_total_damage = @battler_damage - t
  215.                @p_dam=0      #已经发生的伤害归0★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  216.             end
  217.              #p t,@battler_damage,@all_quanzhong
  218.              damage(t,@battler_critical) if timing.flash_scope != 3
  219.             #连击次数归0★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  220.             if frame_index == @_last_frame
  221.                       ############ #小改动
  222.                       @last_hits=1
  223.                       @temp_hits=0
  224.                       ############
  225.                       @hits=0
  226.             end
  227.            # 防止重复播放miss
  228.            elsif !@battler_damage.is_a?(Numeric) and timing.flash_scope != 0
  229.              damage(@battler_damage,@battler_critical)
  230.            end
  231.          end
  232.        end
  233.      else
  234.        dispose_animation
  235.        end
  236. end
  237. end
  238. end
  239.  
  240.  
  241. class Sprite_Battler < RPG::Sprite
  242.   #--------------------------------------------------------------------------
  243.   # ● 处理角色动作
  244.   #--------------------------------------------------------------------------
  245.   def update_actor_animation
  246.     if @battler.is_a?(Game_Actor)
  247.       if @battler.show_damage_value != nil
  248.         self.damage(@battler.show_damage_value, false)
  249.         @battler.show_damage(nil)
  250.         @battler.setup_battler_ani(@battler.battler_name.split(/★/)[$battler_damage], 1)
  251.         @battler.setup_battler_hurt_ani(1)
  252.       end
  253.       @last_frame = $fanime_frame_max if $fanime_frame_max > @last_frame
  254.       if @battler.current_action.kind == 0 and @battler.current_action.basic == 1 and @battler.show_damage_value != nil
  255.         # 防御的时候
  256.         if @hits > @temp_hits and not @battler.dead?
  257.           ############ #小改动
  258.           @temp_hits+=1
  259.           ############
  260.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
  261.           @battler.setup_battler_hurt_ani(1)
  262.           #################################################################
  263.         elsif @last_hits == 1 and not @battler.dead?
  264.           ############ #小改动
  265.           @last_hits = 0
  266.           ############
  267.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
  268.           @battler.setup_battler_hurt_ani(1)
  269.           #################################################################
  270.         elsif @frame_index != -1 and @frame_index != @last_frame and not @battler.dead? and !@battler.damage.is_a?(Numeric)
  271.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
  272.           @battler.setup_battler_hurt_ani(1)
  273.           #################################################################
  274.         elsif @last_hits == 1 and not @battler.dead? and !@battler.damage.is_a?(Numeric)
  275.           ############ #小改动
  276.           @last_hits = 0
  277.           ############
  278.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
  279.           @battler.setup_battler_hurt_ani(1)
  280.           #################################################################
  281.         end
  282.       else
  283.         # 单回合只有一次攻击
  284.        if @last_hits == 1 and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and $fangyu != 1
  285.           ############ #小改动
  286.           @last_hits = 0
  287.           ############
  288.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[$battler_damage], 1)
  289.           @battler.setup_battler_hurt_ani(1)
  290.           #################################################################
  291.         # 单回合多次攻击
  292.        elsif @hits > @temp_hits and @frame_index != @last_frame and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and  
  293. $fangyu != 1
  294.           ############ #小改动
  295.           @temp_hits+=1
  296.           ############
  297.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[$battler_damage], 1)
  298.           @battler.setup_battler_hurt_ani(1)
  299.         ########################################################################
  300.         # 死亡之前攻击
  301.        elsif @hits > @temp_hits and @frame_index != @last_frame and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and $fangyu != 1 and  
  302. @battler.dead? and @battler.battler_dead_ani != 1
  303.           ############ #小改动
  304.           @temp_hits+=1
  305.           ############
  306.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[$battler_damage], 1)
  307.           @battler.setup_battler_hurt_ani(1)
  308.           #################################################################
  309.         # 闪避的回合
  310.        elsif !@battler_damage.is_a?(Numeric) and @last_hits == 1 and @frame_index == @last_frame
  311.           @last_hits = 0
  312.           #################################################################
  313.         # 无伤害的攻击
  314.         elsif @battler_damage.is_a?(Numeric) and @battler.damage == 0 and @last_hits == 1 and @frame_index == @last_frame
  315.           @last_hits = 0
  316.           #################################################################
  317.         # 死亡判定
  318.         elsif @frame_index == @last_frame and @battler.dead? and @battler.battler_dead_ani != 1
  319.           #p 111
  320.        #elsif @last_hits == 1 and @frame_index == @last_frame and @battler.dead? and @battler.battler_dead_ani != 1
  321.           @last_hits = 0
  322.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
  323.           #@battler.setup_battler_dead_ani(1)
  324.           #################################################################
  325.         # 胜利判定
  326.        elsif $scene.phase == 5 and [url=home.php?mod=space&uid=2659152]@oNCE[/url] == 0 and @battler_name != nil and not @battler.hidden and not @battler.dead? and $game_temp.battle_proc == nil
  327.              @once = 1
  328.              @battler.setup_battler_ani(@battler_name.split(/★/)[6], 1)
  329.         end
  330.       end
  331.       @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)
  332.     end
  333.   end
  334.   #--------------------------------------------------------------------------
  335.   # ● 处理敌人动作
  336.   #--------------------------------------------------------------------------
  337.   def update_enemy_animation
  338.     if @battler.is_a?(Game_Enemy)
  339.       if @battler.show_damage_value != nil
  340.         self.damage(@battler.show_damage_value, false)
  341.         @battler.show_damage(nil)
  342.         @battler.setup_battler_ani(@battler.battler_name.split(/★/)[$battler_damage], 1)
  343.         @battler.setup_battler_hurt_ani(1)
  344.       end
  345.       @last_frame = $fanime_frame_max if $fanime_frame_max > @last_frame
  346.       if @battler.current_action.kind == 0 and @battler.current_action.basic == 1
  347.       else
  348.         # 单回合只有一次攻击
  349.         if @last_hits == 1 and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0
  350.           ############ #小改动
  351.           #p 222
  352.           @last_hits = 0
  353.           ############
  354.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[$battler_damage], 1)
  355.           @battler.setup_battler_hurt_ani(1)
  356.           #################################################################
  357.         # 单回合多次攻击
  358.        elsif @hits > @temp_hits and @frame_index != @last_frame and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0
  359.           ############ #小改动
  360.           #p 111
  361.           @temp_hits+=1
  362.           ############
  363.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[$battler_damage], 1)
  364.           @battler.setup_battler_hurt_ani(1)
  365.           #################################################################
  366.         # 死亡之前攻击
  367.        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
  368.           ############ #小改动
  369.           #p 333
  370.           @temp_hits+=1
  371.           ############
  372.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[$battler_damage], 1)
  373.           @battler.setup_battler_hurt_ani(1)
  374.           #################################################################
  375.         # 无伤害的攻击
  376.         elsif !@battler_damage.is_a?(Numeric) and @last_hits == 1 and @frame_index == @last_frame
  377.           @last_hits = 0
  378.           #################################################################
  379.         # 闪避的回合
  380.         elsif @battler_damage.is_a?(Numeric) and @battler.damage == 0 and @last_hits == 1 and @frame_index == @last_frame
  381.           @last_hits = 0
  382.           #################################################################
  383.         # 死亡判定
  384.         elsif @frame_index == @last_frame and @battler.dead? and @battler.battler_dead_ani != 1
  385.           #p $fanime_frame_max
  386.         #elsif @last_hits == 1 and @frame_index == @last_frame and @battler.dead? and @battler.battler_dead_ani != 1
  387.           @last_hits = 0
  388.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
  389.           @battler.setup_battler_dead_ani(1)
  390.           collapse
  391.         end
  392.       end
  393.       @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)
  394.     end
  395.   end
  396. end

更新脚本
注意+或-在这次更新掉转了..
备注工具保存后..RMXP编辑器要关闭再打开..

点评

逃跑异常脚本删了就好..位移脚本也有同样功能..  发表于 2017-8-18 11:34
我上传了改好的工程..  发表于 2017-8-18 11:13
你以后论坛复制脚本点脚本右上的复制..不然会出现URL码..  发表于 2017-8-18 11:13
测试好了..发现技能全体的话只有一个敌人会位移..但超出我能力了..  发表于 2017-8-17 21:16
弄不了,楼上放了个整合了两个攻击动画的工程,你测试吧。  发表于 2017-8-17 20:42
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-21 20:40

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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