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

Project1

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

[已经解决] 【求提取】轩辕劫的连击脚本

[复制链接]

Lv2.观梦者

梦石
0
星屑
590
在线时间
392 小时
注册时间
2012-1-20
帖子
223

开拓者

跳转到指定楼层
1
发表于 2014-7-24 13:59:38 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
因为以前一直都是用的彩虹神剑脚本,但是不能显示事件扣血、中毒扣血和SP回复总觉得不太好= =,
最近发现《轩辕劫》这个游戏的连击脚本貌似还不错,想把它提取出来。
但是因为不懂脚本,工程的脚本编辑器里面脚本有很多,不知道哪些是有关连击的= =
所以请各位高手帮忙提取一下脚本吧~( ̄∇ ̄)( ̄∇ ̄)

下载链接:http://115.com/file/beh93fuj#
支持一下下我的这个游戏吧~~
大雄与空间军团

Lv1.梦旅人

薄凉看客

梦石
0
星屑
50
在线时间
1269 小时
注册时间
2010-6-20
帖子
1316
2
发表于 2014-7-24 14:27:44 | 只看该作者
本帖最后由 恐惧剑刃 于 2014-7-26 12:45 编辑

楼下更新
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
590
在线时间
392 小时
注册时间
2012-1-20
帖子
223

开拓者

3
 楼主| 发表于 2014-7-24 15:00:49 | 只看该作者
恐惧剑刃 发表于 2014-7-24 14:27

额,这不是一个技能一次性使用多次么= =虽然也是不错的技能啦,但是没有连击的效果啊

点评

看来你对“连击”概念的定义要求稍高。没有连击效果指的是?攻击不能“连击”?如果是这样请你确认你附加了攻击状态  发表于 2014-7-24 15:08
支持一下下我的这个游戏吧~~
大雄与空间军团
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
590
在线时间
392 小时
注册时间
2012-1-20
帖子
223

开拓者

4
 楼主| 发表于 2014-7-24 16:48:51 | 只看该作者
本帖最后由 哆啦溯 于 2014-7-24 16:53 编辑
恐惧剑刃 发表于 2014-7-24 14:27


恩……类似于彩虹神剑,在一个技能动画中,每闪烁一次显示一次扣血,闪烁的次数决定连击的次数;
而你给的脚本似乎是:设置连击几次就会显示几次攻击动画,每次攻击动画结束之后显示一次扣血


另外,普通攻击好像无法连击?按照图片↓上的做了以后,使用铜剑普通攻击仍然无法连击

1.png (2.85 KB, 下载次数: 1)

1.png

2.png (1.45 KB, 下载次数: 2)

2.png

3.png (29 KB, 下载次数: 5)

3.png
支持一下下我的这个游戏吧~~
大雄与空间军团
回复 支持 反对

使用道具 举报

Lv1.梦旅人

薄凉看客

梦石
0
星屑
50
在线时间
1269 小时
注册时间
2010-6-20
帖子
1316
5
发表于 2014-7-24 18:24:53 | 只看该作者
本帖最后由 恐惧剑刃 于 2014-7-26 14:02 编辑

更新在楼下

点评

哦,懂了,就是处于此状态的人【普通攻击】会变成多次攻击;而且可以设置技能技能一次性攻击多次  发表于 2014-7-24 19:22
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
590
在线时间
392 小时
注册时间
2012-1-20
帖子
223

开拓者

6
 楼主| 发表于 2014-7-24 19:02:58 | 只看该作者
恐惧剑刃 发表于 2014-7-24 18:24
这个是传统连击脚本和你要的那种多段伤害脚本有些差距!
如果你直接说多段伤害我会更容易理解……

恩,的确是变成了【3】这个状态,但还是无法连击。
啊,因为我只接触过彩虹神剑连击脚本啦,所以对连击的概念还不明确= =
话说《轩辕劫》里面的脚本真得无法提取吗?很好的脚本的说。

QQ截图20140724185941.png (398.35 KB, 下载次数: 4)

QQ截图20140724185941.png

点评

错了错了,是角色附加状态角色连击,敌人附加状态敌人连击  发表于 2014-7-24 19:08
支持一下下我的这个游戏吧~~
大雄与空间军团
回复 支持 反对

使用道具 举报

Lv1.梦旅人

薄凉看客

梦石
0
星屑
50
在线时间
1269 小时
注册时间
2010-6-20
帖子
1316
7
发表于 2014-7-26 12:43:53 | 只看该作者
本帖最后由 RyanBern 于 2014-7-26 20:02 编辑

OK 这就是你要的脚本了
@battler @height 防止出错
  1. # 核心的说明:
  2. # damage_pop 不再附带damage()的功能,这个放到animation里面去了

  3. module RPG
  4.   class Sprite < ::Sprite
  5.     @@_animations = []
  6.     @@_reference_count = {}
  7.     #==========================================
  8.     # 修改说明:
  9.     # @flash_shake用来制作挨打时候跳跃
  10.     # @_damage    用来记录每次打击之后弹出数字
  11.     #==========================================
  12.     def initialize(viewport = nil)
  13.       super(viewport)
  14.       @flash_shake = 0
  15.       @_whiten_duration = 0
  16.       @_appear_duration = 0
  17.       @_escape_duration = 0
  18.       @_collapse_duration = 0
  19.       @_damage_duration = 0
  20.       @_animation_duration = 0
  21.       @_blink = false
  22.       @_damage = [] #~66RPG~#
  23.       @py_y = 0
  24.     end
  25.     def damage(value, critical)
  26.       if value.is_a?(Numeric)
  27.         damage_string = value.abs.to_s
  28.       else
  29.         damage_string = value.to_s
  30.       end
  31.       bitmap = Bitmap.new(160, 48)
  32.       bitmap.font.name = "Arial Black"
  33.       bitmap.font.size = 32
  34.       bitmap.font.color.set(0, 0, 0)
  35.       bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
  36.       bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
  37.       bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
  38.       bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
  39.       #=======================================
  40.       # 修改:颜色
  41.       #=======================================
  42.       if value.is_a?(Numeric) and value < 0
  43.         bitmap.font.color.set(176, 255, 144)
  44.       else
  45.         bitmap.font.color.set(255, 55, 55)
  46.       end
  47.       bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
  48.       if critical
  49.         bitmap.font.size = 20
  50.         bitmap.font.color.set(0, 0, 0)
  51.         bitmap.draw_text(-1, -1, 160, 20, "CRITICAL", 1)
  52.         bitmap.draw_text(+1, -1, 160, 20, "CRITICAL", 1)
  53.         bitmap.draw_text(-1, +1, 160, 20, "CRITICAL", 1)
  54.         bitmap.draw_text(+1, +1, 160, 20, "CRITICAL", 1)
  55.         bitmap.font.color.set(255, 255, 255)
  56.         bitmap.draw_text(0, 0, 160, 20, "CRITICAL", 1)
  57.       end
  58.       @_damage_sprite = ::Sprite.new(self.viewport)
  59.       @_damage_sprite.bitmap = bitmap
  60.       @_damage_sprite.ox = 80
  61.       @_damage_sprite.oy = 20
  62.       @_damage_sprite.x = self.x
  63.       @_damage_sprite.y = self.y - self.oy / 2
  64.       @_damage_sprite.z = 3000
  65.       @_damage_duration = 40
  66.       #=======================================
  67.       # 修改:推入新的伤害
  68.       #=======================================
  69.       @_damage.push([@_damage_sprite,@_damage_duration-10,0, rand(30) - 15, rand(3)])
  70.     end
  71.     def animation(animation, hit, battler_damage="", battler_critical=false)
  72.       dispose_animation      
  73.       #=======================================
  74.       # 修改:记录伤害和critical
  75.       #=======================================
  76.       @battler_damage = battler_damage
  77.       @battler_critical = battler_critical
  78.       @_animation = animation
  79.       return if @_animation == nil
  80.       @_animation_hit = hit
  81.       @_animation_duration = @_animation.frame_max
  82.       animation_name = @_animation.animation_name
  83.       animation_hue = @_animation.animation_hue
  84.       bitmap = RPG::Cache.animation(animation_name, animation_hue)
  85.       #=======================================
  86.       # 修改:计算总闪光权限值
  87.       #=======================================
  88.       for timing in @_animation.timings
  89.         @all_quanzhong += animation_process_timing(timing, @_animation_hit)        
  90.       end      
  91.       if @@_reference_count.include?(bitmap)
  92.         @@_reference_count[bitmap] += 1
  93.       else
  94.         @@_reference_count[bitmap] = 1
  95.       end
  96.       @_animation_sprites = []
  97.       if @_animation.position != 3 or not @@_animations.include?(animation)
  98.         for i in 0..15
  99.           sprite = ::Sprite.new(self.viewport)
  100.           sprite.bitmap = bitmap
  101.           sprite.visible = false
  102.           @_animation_sprites.push(sprite)
  103.         end
  104.         unless @@_animations.include?(animation)
  105.           @@_animations.push(animation)
  106.         end
  107.       end
  108.       update_animation
  109.     end
  110.     #=======================================
  111.     # 修改:更换清除伤害的算法,以防万一
  112.     #       本内容在脚本中没有使用过
  113.     #=======================================
  114.     def dispose_damage
  115.       for damage in @_damage.reverse
  116.         damage[0].bitmap.dispose
  117.         damage[0].dispose
  118.         @_damage.delete(damage)
  119.       end
  120.     end
  121.     def dispose_animation
  122.       #=======================================
  123.       # 修改:清除记录的伤害,清除权重记录
  124.       #=======================================
  125.       @battler_damage = nil
  126.       @battler_critical = nil
  127.       @all_quanzhong = 1
  128.       if @_animation_sprites != nil
  129.         sprite = @_animation_sprites[0]
  130.         if sprite != nil
  131.           @@_reference_count[sprite.bitmap] -= 1
  132.           if @@_reference_count[sprite.bitmap] == 0
  133.             sprite.bitmap.dispose
  134.           end
  135.         end
  136.         for sprite in @_animation_sprites
  137.           sprite.dispose
  138.         end
  139.         @_animation_sprites = nil
  140.         @_animation = nil
  141.       end
  142.     end
  143.     def update
  144.       super
  145.       if @_whiten_duration > 0
  146.         @_whiten_duration -= 1
  147.         self.color.alpha = 128 - (16 - @_whiten_duration) * 10
  148.       end
  149.       if @_appear_duration > 0
  150.         @_appear_duration -= 1
  151.         self.opacity = (16 - @_appear_duration) * 16
  152.       end
  153.       if @_escape_duration > 0
  154.         @_escape_duration -= 1
  155.         self.opacity = 256 - (32 - @_escape_duration) * 10
  156.       end
  157.       if @_collapse_duration > 0
  158.         @_collapse_duration -= 1
  159.         self.opacity = 256 - (48 - @_collapse_duration) * 6
  160.       end
  161.       #=======================================
  162.       # 修改:更新算法,更新弹出
  163.       #=======================================
  164.       if @_damage_duration > 0
  165.         @_damage_duration -= 1
  166.         for damage in @_damage
  167.           damage[0].x = self.x + self.viewport.rect.x -
  168.                         self.ox + self.src_rect.width / 2 +
  169.                         (40 - damage[1]) * damage[3] / 10
  170.           damage[0].y -= damage[4]+damage[1]/10
  171.           damage[0].opacity = damage[1]*20
  172.           damage[1] -= 1
  173.           if damage[1]==0
  174.             damage[0].bitmap.dispose
  175.             damage[0].dispose
  176.             @_damage.delete(damage)
  177.             next
  178.           end
  179.         end
  180.       end
  181.       if @_animation != nil and (Graphics.frame_count % 2 == 0)
  182.         @_animation_duration -= 1
  183.         update_animation
  184.       end
  185.       if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
  186.         update_loop_animation
  187.         @_loop_animation_index += 1
  188.         @_loop_animation_index %= @_loop_animation.frame_max
  189.       end
  190.       if @_blink
  191.         @_blink_count = (@_blink_count + 1) % 32
  192.         if @_blink_count < 16
  193.           alpha = (16 - @_blink_count) * 6
  194.         else
  195.           alpha = (@_blink_count - 16) * 6
  196.         end
  197.         self.color.set(255, 255, 255, alpha)
  198.       end
  199.       @@_animations.clear
  200.     end
  201.     def update_animation
  202.       if @_animation_duration > 0
  203.         frame_index = @_animation.frame_max - @_animation_duration
  204.         cell_data = @_animation.frames[frame_index].cell_data
  205.         position = @_animation.position
  206.         animation_set_sprites(@_animation_sprites, cell_data, position)
  207.         #=======================================
  208.         # 修改:弹出伤害,权重计算
  209.         #=======================================
  210.         for timing in @_animation.timings
  211.           if timing.frame == frame_index
  212.             t = 1.0 * animation_process_timing(timing, @_animation_hit)            
  213.             #p t,"当前权重", @all_quanzhong,"总权重"
  214.             if @battler_damage.is_a?(Numeric) and t != 0
  215.               t *= @battler_damage
  216.               t /= @all_quanzhong
  217.               #p t,"当前伤害",@battler_damage,"总伤害"
  218.               t = t.to_i
  219.               #p t,@battler_damage,@all_quanzhong
  220.               damage(t,@battler_critical)
  221.             elsif !@battler_damage.is_a?(Numeric)
  222.               damage(@battler_damage,@battler_critical)
  223.             end
  224.           end
  225.         end
  226.       else
  227.         dispose_animation
  228.       end
  229.     end
  230.     #=======================================
  231.     # 修改:敌人跳跃的功能 + 添加返回数值
  232.     #=======================================
  233.      def animation_process_timing(timing, hit)
  234.        if (timing.condition == 0) or
  235.           (timing.condition == 1 and hit == true) or
  236.           (timing.condition == 2 and hit == false)
  237.          if timing.se.name != ""
  238.            se = timing.se
  239.            Audio.se_play("Audio/SE/" + se.name, se.volume, se.pitch)
  240.          end
  241.          case timing.flash_scope
  242.          when 1
  243.            self.flash(timing.flash_color, timing.flash_duration * 2)
  244.            @flash_shake_switch = true
  245.            @flash_shake = 10
  246.            return timing.flash_color.alpha * timing.flash_duration
  247.          when 2
  248.            if self.viewport != nil
  249.              self.viewport.flash(timing.flash_color, timing.flash_duration * 2)
  250.              return timing.flash_color.alpha * timing.flash_duration
  251.            end
  252.          when 3
  253.            self.flash(nil, timing.flash_duration * 2)
  254.            return timing.flash_color.alpha * timing.flash_duration
  255.          end
  256.        end      
  257.        return 0
  258.      end   
  259.   end
  260. end
  261. #==============================================================================
  262. # ■ Sprite_Battler
  263. #==============================================================================
  264. class Sprite_Battler < RPG::Sprite
  265. #--------------------------------------------------------------------------
  266. # ● 初始化对像
  267. #    添加跳跃记录
  268. #--------------------------------------------------------------------------
  269. def initialize(viewport, battler = nil)
  270.    super(viewport)
  271.    [url=home.php?mod=space&uid=133701]@battler[/url] = battler
  272.    @battler_visible = false
  273.    @flash_shake_switch = true
  274. end
  275. #--------------------------------------------------------------------------
  276. # ● 刷新画面
  277. #    增添跳跃功能
  278. #--------------------------------------------------------------------------
  279. def update
  280.    super
  281.    # 战斗者为 nil 的情况下
  282.    if @battler == nil
  283.      self.bitmap = nil
  284.      loop_animation(nil)
  285.      return
  286.    end
  287.    # 文件名和色相与当前情况有差异的情况下
  288.    if @battler.battler_name != @battler_name or
  289.       @battler.battler_hue != @battler_hue
  290.      # 获取、设置位图
  291.      @battler_name = @battler.battler_name
  292.      @battler_hue = @battler.battler_hue
  293.      self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  294.      @width = bitmap.width
  295.      @height = bitmap.height
  296.      self.ox = @width / 2
  297.      self.oy = @height
  298.      # 如果是战斗不能或者是隐藏状态就把透明度设置成 0
  299.      if @battler.dead? or @battler.hidden
  300.        self.opacity = 0
  301.      end
  302.    end
  303.    # 动画 ID 与当前的情况有差异的情况下
  304.    if @battler.damage == nil and
  305.       @battler.state_animation_id != @state_animation_id
  306.      @state_animation_id = @battler.state_animation_id
  307.      loop_animation($data_animations[@state_animation_id])
  308.    end
  309.    # 应该被显示的角色的情况下
  310.    if @battler.is_a?(Game_Actor) and @battler_visible
  311.      # 不是主状态的时候稍稍降低点透明度
  312.      if $game_temp.battle_main_phase
  313.        self.opacity += 3 if self.opacity < 255
  314.      else
  315.        self.opacity -= 3 if self.opacity > 207
  316.      end
  317.    end
  318.    # 明灭
  319.    if @battler.blink
  320.      blink_on
  321.    else
  322.      blink_off
  323.    end
  324.    # 不可见的情况下
  325.    unless @battler_visible
  326.      # 出现
  327.      if not @battler.hidden and not @battler.dead? and
  328.         (@battler.damage == nil or @battler.damage_pop)
  329.        appear
  330.        @battler_visible = true
  331.      end
  332.    end
  333.    # 可见的情况下
  334.    if @battler_visible
  335.      # 逃跑
  336.      if @battler.hidden
  337.        $game_system.se_play($data_system.escape_se)
  338.        escape
  339.        @battler_visible = false
  340.      end
  341.      # 白色闪烁
  342.      if @battler.white_flash
  343.        whiten
  344.        @battler.white_flash = false
  345.      end
  346.      # 动画
  347.      if @battler.animation_id != 0
  348.        animation = $data_animations[@battler.animation_id]
  349.        animation(animation, @battler.animation_hit,@battler.damage, @battler.critical)
  350.        @battler.animation_id = 0
  351.      end
  352.      # 伤害
  353.      if @battler.damage_pop
  354.        @battler.damage = nil
  355.        @battler.critical = false
  356.        @battler.damage_pop = false
  357.      end
  358.      # korapusu
  359.      if @battler.damage == nil and @battler.dead?
  360.        if @battler.is_a?(Game_Enemy)
  361.          $game_system.se_play($data_system.enemy_collapse_se)
  362.        else
  363.          $game_system.se_play($data_system.actor_collapse_se)
  364.        end
  365.        collapse
  366.        @battler_visible = false
  367.      end
  368.    end
  369.    # 设置活动块的坐标
  370.    if @flash_shake_switch == true
  371.      self.x = @battler.screen_x
  372.      self.y = @battler.screen_y
  373.      self.z = @battler.screen_z
  374.      @flash_shake_switch = false
  375.    end
  376.    if @flash_shake != 0 and @battler.damage != nil
  377.      case @flash_shake
  378.      when 9..10
  379.        self.x = @battler.screen_x
  380.        self.y -=4
  381.        self.z = @battler.screen_z
  382.      when 6..8
  383.        self.x = @battler.screen_x
  384.        self.y -=2
  385.        self.z = @battler.screen_z
  386.      when 3..5
  387.        self.x = @battler.screen_x
  388.        self.y +=2
  389.        self.z = @battler.screen_z
  390.      when 2
  391.        self.x = @battler.screen_x
  392.        self.y += 4
  393.        self.z = @battler.screen_z
  394.      when 1
  395.        self.x = @battler.screen_x
  396.        self.y = @battler.screen_y
  397.        self.z = @battler.screen_z
  398.      end
  399.      @flash_shake -= 1
  400.    end
  401. end
  402. end
复制代码

点评

谢大神  发表于 2014-7-26 20:04

评分

参与人数 1星屑 +200 收起 理由
RyanBern + 200 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
590
在线时间
392 小时
注册时间
2012-1-20
帖子
223

开拓者

8
 楼主| 发表于 2014-7-26 19:36:10 | 只看该作者
本帖最后由 哆啦溯 于 2014-7-26 19:37 编辑
恐惧剑刃 发表于 2014-7-26 12:43
OK 这就是你要的脚本了


谢谢!不过……
第272行
有错误……

QQ截图20140726193534.png (703 Bytes, 下载次数: 4)

QQ截图20140726193534.png

QQ截图20140726193534.png (1.35 KB, 下载次数: 7)

QQ截图20140726193534.png

点评

改成 @battler = battler  发表于 2014-7-26 19:39
支持一下下我的这个游戏吧~~
大雄与空间军团
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
590
在线时间
392 小时
注册时间
2012-1-20
帖子
223

开拓者

9
 楼主| 发表于 2014-7-26 19:41:48 | 只看该作者
恐惧剑刃 发表于 2014-7-26 12:43
OK 这就是你要的脚本了

回复好快!
这样……?但好像还是不行的样子?

QQ截图20140726193534.png (1.08 KB, 下载次数: 4)

QQ截图20140726193534.png

点评

url那个是论坛BUG,你懂得……把整个272行改成@battler = battler,不要url  发表于 2014-7-26 19:47
支持一下下我的这个游戏吧~~
大雄与空间军团
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
590
在线时间
392 小时
注册时间
2012-1-20
帖子
223

开拓者

10
 楼主| 发表于 2014-7-26 19:52:02 | 只看该作者
恐惧剑刃 发表于 2014-7-26 12:43
OK 这就是你要的脚本了
@battler 防止出错

额……这样?

QQ截图20140726193534.png (1.26 KB, 下载次数: 1)

QQ截图20140726193534.png

点评

把272行整个删掉,换成@battler = battler,或者把恐惧剑刃的脚本再复制一遍也行,我已经把有问题的地方改了  发表于 2014-7-26 19:53
支持一下下我的这个游戏吧~~
大雄与空间军团
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-10-1 03:26

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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