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

Project1

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

[已经过期] 两个问题请教

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
17 小时
注册时间
2014-9-30
帖子
18
跳转到指定楼层
1
发表于 2014-10-22 13:42:25 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
1.本人正在使用RTAB系统+RTAB连击+菜鸟横版脚本,在动画库中设置闪烁次数就是连击次数的那种,如何在技能使用后,根据所有连击伤害而显示出一个总伤害在敌人的头上?
2.找到一个动态EXP增长脚本,战斗结束时会动态显示角色经验值增长情况,但是这脚本插入到RTAB脚本下面提示123行错误,插入到RTAB脚本上面,经验条动态消失。注:本人脚本不太懂
  1. #==============================================================================
  2. #  战斗结束动态增加EXP条 v0.1    作者:灯笼菜刀王
  3. #==============================================================================
  4. class Window_BattleResult < Window_Base
  5.   #--------------------------------------------------------------------------
  6.   # ● 初始化对像
  7.   #     exp       : EXP
  8.   #     gold      : 金钱
  9.   #     treasures : 宝物
  10.   #--------------------------------------------------------------------------
  11.   def initialize(exp, gold, treasures)
  12.     @exp = exp
  13.     @gold = gold
  14.     @treasures = treasures
  15.     @expup = []
  16.     @expnow = []
  17.     for i in 0...$game_party.actors.size
  18.      actor = $game_party.actors[i]
  19.      now = actor.now_exp
  20.      max = actor.next_exp
  21.      now = now > max ? max : now
  22.      @expnow[i] = max != 0 ? 98 * now / max.to_f : 0
  23.       now2 = actor.now_exp - @exp
  24.       now2 = now2 > max ? max : now2
  25.      @expup[i] = max != 0 ? 98 * now2 / max.to_f : 0
  26.     end
  27.     super(140, 0, 400, 8 * 32 + 64)
  28.     self.contents = Bitmap.new(width - 32, height - 32)
  29.     self.y = 160 - height / 2
  30.     self.back_opacity = 160
  31.     self.visible = false
  32.     refresh
  33.   end
  34.   #--------------------------------------------------------------------------
  35.   # ● 刷新
  36.   #--------------------------------------------------------------------------
  37.   def refresh
  38.     self.contents.clear
  39.     x = 6
  40.     self.contents.font.color = normal_color
  41.     cx = contents.text_size(@exp.to_s).width
  42.     self.contents.draw_text(x, 0, cx, 32, @exp.to_s)
  43.     x += cx + 4
  44.     self.contents.font.color = system_color
  45.     cx = contents.text_size("EXP").width
  46.     self.contents.draw_text(x, 0, 64, 32, "EXP")
  47.     x += cx + 16
  48.     self.contents.font.color = normal_color
  49.     cx = contents.text_size(@gold.to_s).width
  50.     self.contents.draw_text(x, 0, cx, 32, @gold.to_s)
  51.     x += cx + 4
  52.     self.contents.font.color = system_color
  53.     self.contents.draw_text(x, 0, 128, 32, $data_system.words.gold)
  54.     cx = contents.text_size($data_system.words.gold).width
  55.     self.contents.draw_text(208,0,128,32,"战利品")
  56.     for i in 0...$game_party.actors.size
  57.       actor = $game_party.actors[i]
  58.       draw_actor_graphic(actor, 20, i*60+92)
  59.       draw_actor_name(actor, 34, i*60+42)
  60.       self.contents.fill_rect(26, i*60+76, 100, 8,Color.new(192,192,192,255))
  61.       self.contents.fill_rect(28, i*60+78, 96, 4, Color.new(128,128,128,128))
  62.       now = actor.now_exp - @exp
  63.       max = actor.next_exp
  64.       now = now > max ? max : now
  65.       a = max != 0 ? 78 * now / max.to_f : 0
  66.       self.contents.fill_rect(27, i*60+77, @expup[i], 6, Color.new(150, 255, 150, 255))
  67.     end
  68.     y = 32
  69.     for item in @treasures
  70.       draw_item_name(item, 180, y)
  71.       y += 32
  72.     end
  73.   end
  74. def update
  75.    for i in 0...$game_party.actors.size
  76.      if @expup[i] < @expnow[i]
  77.        @expup[i] += 1
  78.      end
  79.    end
  80.    refresh
  81. end
  82. end
  83. class Game_Actor < Game_Battler
  84.   def now_exp
  85.    return @exp - @exp_list[@level]
  86.   end
  87.   def next_exp
  88.    return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
  89.   end
  90. end
  91. class Scene_Battle
  92.   def update
  93.     # 执行战斗事件中的情况下
  94.     if $game_system.battle_interpreter.running?
  95.       # 刷新解释器
  96.       $game_system.battle_interpreter.update
  97.       # 强制行动的战斗者不存在的情况下
  98.       if $game_temp.forcing_battler == nil
  99.         # 执行战斗事件结束的情况下
  100.         unless $game_system.battle_interpreter.running?
  101.           # 继续战斗的情况下、再执行战斗事件的设置
  102.           unless judge
  103.             setup_battle_event
  104.           end
  105.         end
  106.         # 如果不是结束战斗回合的情况下
  107.         if @phase != 5
  108.           # 刷新状态窗口
  109.           @status_window.refresh
  110.         end
  111.       end
  112.     end
  113.     # 系统 (计时器)、刷新画面
  114.     $game_system.update
  115.     $game_screen.update
  116.     # 计时器为 0 的情况下
  117.     if $game_system.timer_working and $game_system.timer == 0
  118.       # 中断战斗
  119.       $game_temp.battle_abort = true
  120.     end
  121.     # 刷新窗口
  122.     @help_window.update
  123.     @party_command_window.update
  124.     @actor_command_window.update
  125.     @status_window.update
  126.     @message_window.update
  127.     #####菜刀王到此一游################
  128.     if @result_window != nil
  129.       @result_window.update
  130.     end
  131.     ###################################
  132.     # 刷新活动块
  133.     @spriteset.update
  134.     # 处理过渡中的情况下
  135.     if $game_temp.transition_processing
  136.       # 清除处理过渡中标志
  137.       $game_temp.transition_processing = false
  138.       # 执行过渡
  139.       if $game_temp.transition_name == ""
  140.         Graphics.transition(20)
  141.       else
  142.         Graphics.transition(40, "Graphics/Transitions/" +
  143.           $game_temp.transition_name)
  144.       end
  145.     end
  146.     # 显示信息窗口中的情况下
  147.     if $game_temp.message_window_showing
  148.       return
  149.     end
  150.     # 显示效果中的情况下
  151.     if @spriteset.effect?
  152.       return
  153.     end
  154.     # 游戏结束的情况下
  155.     if $game_temp.gameover
  156.       # 切换到游戏结束画面
  157.       $scene = Scene_Gameover.new
  158.       return
  159.     end
  160.     # 返回标题画面的情况下
  161.     if $game_temp.to_title
  162.       # 切换到标题画面
  163.       $scene = Scene_Title.new
  164.       return
  165.     end
  166.     # 中断战斗的情况下
  167.     if $game_temp.battle_abort
  168.       # 还原为战斗前的 BGM
  169.       $game_system.bgm_play($game_temp.map_bgm)
  170.       # 战斗结束
  171.       battle_end(1)
  172.       return
  173.     end
  174.     # 等待中的情况下
  175.     if @wait_count > 0
  176.       # 减少等待计数
  177.       @wait_count -= 1
  178.       return
  179.     end
  180.     # 强制行动的角色存在、
  181.     # 并且战斗事件正在执行的情况下
  182.     if $game_temp.forcing_battler == nil and
  183.        $game_system.battle_interpreter.running?
  184.       return
  185.     end
  186.     # 回合分支
  187.     case @phase
  188.     when 1  # 自由战斗回合
  189.       update_phase1
  190.     when 2  # 同伴命令回合
  191.       update_phase2
  192.     when 3  # 角色命令回合
  193.       update_phase3
  194.     when 4  # 主回合
  195.       update_phase4
  196.     when 5  # 战斗结束回合
  197.       update_phase5
  198.     end
  199.   end
  200.   def start_phase5
  201.     # 转移到回合 5
  202.     @phase = 5
  203.     # 演奏战斗结束 ME
  204.     $game_system.me_play($game_system.battle_end_me)
  205.     # 还原为战斗开始前的 BGM
  206.     $game_system.bgm_play($game_temp.map_bgm)
  207.     # 初始化 EXP、金钱、宝物
  208.     exp = 0
  209.     gold = 0
  210.     treasures = []
  211.     # 循环
  212.     for enemy in $game_troop.enemies
  213.       # 敌人不是隐藏状态的情况下
  214.       unless enemy.hidden
  215.         # 获得 EXP、增加金钱
  216.         exp += enemy.exp
  217.         gold += enemy.gold
  218.         # 出现宝物判定
  219.         if rand(100) < enemy.treasure_prob
  220.           if enemy.item_id > 0
  221.             treasures.push($data_items[enemy.item_id])
  222.           end
  223.           if enemy.weapon_id > 0
  224.             treasures.push($data_weapons[enemy.weapon_id])
  225.           end
  226.           if enemy.armor_id > 0
  227.             treasures.push($data_armors[enemy.armor_id])
  228.           end
  229.         end
  230.       end
  231.     end
  232.     # 限制宝物数为 6 个
  233.     treasures = treasures[0..5]
  234.     # 获得 EXP
  235.     for i in 0...$game_party.actors.size
  236.       actor = $game_party.actors[i]
  237.       if actor.cant_get_exp? == false
  238.         last_level = actor.level
  239.         actor.exp += exp
  240.         if actor.level > last_level
  241.           @status_window.level_up(i)
  242.         end
  243.       end
  244.     end
  245.     # 获得金钱
  246.     $game_party.gain_gold(gold)
  247.     # 获得宝物
  248.     for item in treasures
  249.       case item
  250.       when RPG::Item
  251.         $game_party.gain_item(item.id, 1)
  252.       when RPG::Weapon
  253.         $game_party.gain_weapon(item.id, 1)
  254.       when RPG::Armor
  255.         $game_party.gain_armor(item.id, 1)
  256.       end
  257.     end
  258.     # 生成战斗结果窗口
  259.     @result_window = Window_BattleResult.new(exp, gold, treasures)
  260.     ######菜刀王到此一游###############
  261.     @result_window.visible = true
  262.     ###################################
  263.     # 设置等待计数
  264.     @phase5_wait_count = 100
  265.   end
  266. end
复制代码

Lv1.梦旅人

薄凉看客

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

1.没用过那种脚本,应该是重新定义了RPG::Sprite吧?
在F1中覆盖回来(误)

2.
  1. #==============================================================================
  2. #  战斗结束动态增加EXP条 v0.1    作者:灯笼菜刀王
  3. #==============================================================================
  4. class Window_BattleResult < Window_Base
  5.   #--------------------------------------------------------------------------
  6.   # ● 初始化对像
  7.   #     exp       : EXP
  8.   #     gold      : 金钱
  9.   #     treasures : 宝物
  10.   #--------------------------------------------------------------------------
  11.   def initialize(exp, gold, treasures)
  12.     @exp = exp
  13.     @gold = gold
  14.     @treasures = treasures
  15.     @expup = []
  16.     @expnow = []
  17.     for i in 0...$game_party.actors.size
  18.      actor = $game_party.actors[i]
  19.      now = actor.now_exp
  20.      max = actor.next_exp
  21.      now = now > max ? max : now
  22.      @expnow[i] = max != 0 ? 98 * now / max.to_f : 0
  23.       now2 = actor.now_exp - @exp
  24.       now2 = now2 > max ? max : now2
  25.      @expup[i] = max != 0 ? 98 * now2 / max.to_f : 0
  26.     end
  27.     super(140, 0, 400, 8 * 32 + 64)
  28.     self.contents = Bitmap.new(width - 32, height - 32)
  29.     self.y = 160 - height / 2
  30.     self.back_opacity = 160
  31.     #self.visible = false
  32.     refresh
  33.   end
  34.   #--------------------------------------------------------------------------
  35.   # ● 刷新
  36.   #--------------------------------------------------------------------------
  37.   def refresh
  38.     self.contents.clear
  39.     x = 6
  40.     self.contents.font.color = normal_color
  41.     cx = contents.text_size(@exp.to_s).width
  42.     self.contents.draw_text(x, 0, cx, 32, @exp.to_s)
  43.     x += cx + 4
  44.     self.contents.font.color = system_color
  45.     cx = contents.text_size("EXP").width
  46.     self.contents.draw_text(x, 0, 64, 32, "EXP")
  47.     x += cx + 16
  48.     self.contents.font.color = normal_color
  49.     cx = contents.text_size(@gold.to_s).width
  50.     self.contents.draw_text(x, 0, cx, 32, @gold.to_s)
  51.     x += cx + 4
  52.     self.contents.font.color = system_color
  53.     self.contents.draw_text(x, 0, 128, 32, $data_system.words.gold)
  54.     cx = contents.text_size($data_system.words.gold).width
  55.     self.contents.draw_text(208,0,128,32,"战利品")
  56.     for i in 0...$game_party.actors.size
  57.       actor = $game_party.actors[i]
  58.       draw_actor_graphic(actor, 20, i*60+92)
  59.       draw_actor_name(actor, 34, i*60+42)
  60.       self.contents.fill_rect(26, i*60+76, 100, 8,Color.new(192,192,192,255))
  61.       self.contents.fill_rect(28, i*60+78, 96, 4, Color.new(128,128,128,128))
  62.       now = actor.now_exp - @exp
  63.       max = actor.next_exp
  64.       now = now > max ? max : now
  65.       a = max != 0 ? 78 * now / max.to_f : 0
  66.       self.contents.fill_rect(27, i*60+77, @expup[i], 6, Color.new(150, 255, 150, 255))
  67.     end
  68.     y = 32
  69.     for item in @treasures
  70.       draw_item_name(item, 180, y)
  71.       y += 32
  72.     end
  73.   end
  74. def update
  75.    for i in 0...$game_party.actors.size
  76.      if @expup[i] < @expnow[i]
  77.        @expup[i] += 1
  78.      end
  79.    end
  80.    refresh
  81. end
  82. end
  83. class Game_Actor < Game_Battler
  84.   def now_exp
  85.    return @exp - @exp_list[@level]
  86.   end
  87.   def next_exp
  88.    return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
  89.   end
  90. end
  91. class Scene_Battle
  92.   alias dongtaiexp update
  93.   def update
  94.     #####菜刀王到此一游################
  95.     if @result_window != nil
  96.       @result_window.update
  97.     end
  98.     ###################################
  99.     dongtaiexp
  100.   end
  101. end
复制代码
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
17 小时
注册时间
2014-9-30
帖子
18
3
 楼主| 发表于 2014-10-24 16:18:13 | 只看该作者
恐惧剑刃 发表于 2014-10-22 20:24
1.没用过那种脚本,应该是重新定义了RPG::Sprite吧?
在F1中覆盖回来(误)

1.好像找到个叫彩虹神剑的脚本,但是会出错
2.成功解决,谢谢
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-22 14:25

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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