Project1

标题: 雇佣兵 本身只有12000变量用完了这个如何增加 变量 [打印本页]

作者: j296196585    时间: 2016-12-5 03:05
标题: 雇佣兵 本身只有12000变量用完了这个如何增加 变量
RUBY 代码复制
  1. =begin 简单说明:                             【考虑到帮助窗口会盖住后边文本】
  2. 头像素材名称就是角色ID.png的图像              【所以,在系统中按下F5,会隐藏】
  3. 例如:阿尔西斯的头像素材名就该是 “1.png”    【帮助窗口(包括角色信息窗口和】
  4. 也可在脚本631行修改。                         【一般的命令选择行窗口)      】
  5. 融入了多货币系统,初始值在脚本81行修改
  6. 如果脚本有BUG欢迎联系作者薄凉看客。
  7. =end
  8. # ------------------------------------------
  9. # * Scene_Battle
  10. # ------------------------------------------
  11. class Scene_Battle
  12.   # ------------------------------------------
  13.   # * battle_end
  14.   # ------------------------------------------
  15.   def battle_end(result)#(0:胜利 1:失败 2:逃跑)
  16.     # 清除战斗中标志
  17.     $game_temp.in_battle = false
  18.     # 清除全体同伴的行动
  19.     $game_party.clear_actions
  20.     # 解除战斗用状态
  21.     for actor in $game_party.actors
  22.       actor.remove_states_battle
  23.     end
  24.     # 清除敌人
  25.     $game_troop.enemies.clear
  26.     # 调用战斗返回
  27.     if $game_temp.battle_proc != nil
  28.       $game_temp.battle_proc.call(result)
  29.       $game_temp.battle_proc = nil
  30.     end
  31.     # 处理战斗场次
  32.     if $game_temp.actors != []
  33.       for i in $game_temp.actors
  34.       id = i.id
  35.       time = $game_temp.actors_time_2[id] -= 1
  36.       if time == 0
  37.         $game_party.remove_actor(id)
  38.         $game_temp.actors_time_2[id] = $game_temp.actors_time[id]
  39.       end
  40.       end
  41.       $game_temp.actors = []
  42.       for i in 19..39
  43.       if i == 29
  44.         next
  45.       end
  46.       if $game_party.actors.include?($game_actors[i])
  47.       $game_temp.actors << $game_actors[i]
  48.       end
  49.       end
  50.     end
  51.     # 切换到地图画面
  52.     $scene = Scene_Map.new
  53.   end
  54. end
  55. # ------------------------------------------
  56. # * Game_Temp
  57. # ------------------------------------------
  58. class Game_Temp
  59.   # ------------------------------------------
  60.   # * $gold
  61.   # ------------------------------------------
  62.   attr_accessor :gold_bule
  63.   attr_accessor :gold_red
  64.   attr_accessor :gold_yellow
  65.   attr_accessor :gold_green
  66.   # ------------------------------------------
  67.   # * $ actors
  68.   # ------------------------------------------
  69.   attr_accessor :actors#队伍中雇佣角色(actors)的数组
  70.   attr_accessor :actors_2#仓库中雇佣角色(actors)的数组
  71.   # ------------------------------------------
  72.   # * $ 剩余战斗次数
  73.   # ------------------------------------------
  74.   attr_accessor :actors_time
  75.   attr_accessor :actors_time_2
  76.   # ------------------------------------------
  77.   # * initialize
  78.   # ------------------------------------------
  79.   alias initialize_actor_shop_old_kk_ initialize
  80.   def initialize
  81.   @gold_bule = 12000
  82.   @gold_red = 12000
  83.   @gold_yellow = 12000
  84.   @gold_green = 12000
  85.   @actors = []
  86.   @actors_2 = []
  87.   # 战斗场次在这里定义,前一个数字是ID后一个数字是可参与战斗场次数。
  88.   # 要改两次,下面@actors_time_2也要改,
  89.   @actors_time = {29=>1, 30=>2, 31=>3, 32=>4, 33=>5, 34=>1, 35=>2, 36=>3,
  90.   37=>4, 38=>5, 39=>1, 40=>2}
  91.   @actors_time_2 = {29=>1, 30=>2, 31=>3, 32=>4, 33=>5, 34=>1, 35=>2, 36=>3,
  92.   37=>4, 38=>5, 39=>1, 40=>2}
  93.   initialize_actor_shop_old_kk_
  94.   end
  95. end
  96. # ------------------------------------------
  97. # * ACTORSHOP
  98. # ------------------------------------------
  99. module ACTORSHOP
  100.   # ------------------------------------------
  101.   # * actors
  102.   # ------------------------------------------
  103.   # 说明:
  104.   # ITEM = [数组1, 数组2, ``````, 数组N]
  105.   # 数组 = [角色ID, 雇佣酬金, 酬金类型, 颜色(含天气背景), 美化图标(文件名),
  106.   # 图标后的显示的文字]
  107.   # ------------------------------------------
  108.   ITEM = [[29, 100, 0, 7, "深渊の呼唤.PNG", "深渊呼唤"],
  109.          [30, 200, 1, 1, "光明神の长枪.PNG", "光明神"],
  110.          [31, 300, 2, 2, "次元双刃斧.png", "次元双刃"],
  111.          [32, 400, 3, 3, "超级烈焰大炮.PNG", "超级烈焰"],
  112.          [33, 500, 0, 4, "深海の潜伏者.png", "深海潜伏者"],
  113.          [34, 600, 1, 5, "闪耀の拉克丝手枪.png", "闪耀拉克丝"],
  114.          [35, 700, 2, 6, "慈悲者の法杖.png", "慈悲者"],
  115.          [36, 800, 3, 7, "迷惑の黑暗圣杖.png", "迷惑黑暗"],
  116.          [37, 900, 0, 1, "凶残の撕裂者.png", "凶残撕裂者"],
  117.          [38, 1000, 1, 2, "b霍波尔斯特の次元盾(三阶).PNG", "霍波尔斯特"],
  118.          [39, 1100, 0, 7, "深渊の呼唤.PNG", "深渊呼唤"],
  119.          [40, 1200, 1, 1, "光明神の长枪.PNG", "光明神"]]
  120. end
  121. # ------------------------------------------
  122. # * include module and @@
  123. # ------------------------------------------
  124. class Actor_Shop_Command < Window_Selectable
  125.   include ACTORSHOP
  126.   @@item = ACTORSHOP::ITEM
  127. end
  128. class Actor_Shop_Message < Window_Base
  129.   include ACTORSHOP
  130.   @@item = ACTORSHOP::ITEM
  131. end
  132. class Scene_Actor_Shop
  133.   include ACTORSHOP
  134.   @@item = ACTORSHOP::ITEM
  135. end
  136. # ------------------------------------------
  137. # * Window_HelpCommand  # 一般命令窗体帮助
  138. # ------------------------------------------
  139. class Window_HelpCommand < Window_Base
  140.   # ------------------------------------------
  141.   # * initialize
  142.   # ------------------------------------------
  143.   def initialize
  144.     super(0, 0, 170, 96)
  145.     self.opacity= 0
  146.     self.contents_opacity= 0
  147.     self.z = 9998
  148.     self.contents = Bitmap.new(width - 32, height - 32)
  149.   end
  150.   # ------------------------------------------
  151.   # * set_text
  152.   # ------------------------------------------
  153.   def set_text(text1, text2, x, y)
  154.     if text1 != @text1 or x = @x or y = @y
  155.       self.contents.clear
  156.       self.x = x
  157.       self.y = y
  158.       self.contents.font.size = 15
  159.       self.contents.draw_text(10, 0, width - 8, 32, text1)
  160.       self.contents.draw_text(10, 32, width - 8, 32, text2)
  161.       @text1 = text1
  162.       @text2 = text2
  163.       @x = x
  164.       @y = y
  165.       @actor = nil
  166.     end
  167.     self.visible = true
  168.   end
  169. end
  170. # ------------------------------------------
  171. # * Window_Selectable # 命令窗体以及左右选
  172. # ------------------------------------------
  173. class Window_Selectable < Window_Base
  174.   # ------------------------------------------
  175.   # * update
  176.   # ------------------------------------------
  177.   def update
  178.     super
  179.     # 可以移动光标的情况下
  180.     if self.active and @item_max > 0 and @index >= 0
  181.       # 方向键下被按下的情况下
  182.       if Input.repeat?(Input::DOWN)
  183.         # 列数不是 1 并且不与方向键下的按下状态重复的情况、
  184.         # 或光标位置在(项目数-列数)之前的情况下
  185.         if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
  186.            @index < @item_max - @column_max
  187.           # 光标向下移动
  188.           $game_system.se_play($data_system.cursor_se)
  189.           @index = (@index + @column_max) % @item_max
  190.         end
  191.       end
  192.       # 方向键上被按下的情况下
  193.       if Input.repeat?(Input::UP)
  194.         # 列数不是 1 并且不与方向键下的按下状态重复的情况、
  195.         # 或光标位置在列之后的情况下
  196.         if (@column_max == 1 and Input.trigger?(Input::UP)) or
  197.            @index >= @column_max
  198.           # 光标向上移动
  199.           $game_system.se_play($data_system.cursor_se)
  200.           @index = (@index - @column_max + @item_max) % @item_max
  201.         end
  202.       end
  203.       # 方向键右被按下的情况下
  204.       if Input.repeat?(Input::RIGHT)
  205.         # 列数为 2 以上并且、光标位置在(项目数 - 1)之前的情况下
  206.         if @column_max >= 2# and @index < @item_max - 1
  207.           if @index < @item_max - 1
  208.           # 光标向右移动
  209.           $game_system.se_play($data_system.cursor_se)
  210.           @index += 1
  211.           else
  212.           @index = 0
  213.           end
  214.         end
  215.       end
  216.       # 方向键左被按下的情况下
  217.       if Input.repeat?(Input::LEFT)
  218.         # 列数为 2 以上并且、光标位置在 0 之后的情况下
  219.         if @column_max >= 2# and @index > 0
  220.           if @index > 0
  221.           # 光标向左移动
  222.           $game_system.se_play($data_system.cursor_se)
  223.           @index -= 1
  224.           else
  225.           @index = @item_max - 1
  226.           end
  227.         end
  228.       end
  229.       # R 键被按下的情况下
  230.       if Input.repeat?(Input::R)
  231.         # 显示的最后行在数据中最后行上方的情况下
  232.         if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
  233.           # 光标向后移动一页
  234.           $game_system.se_play($data_system.cursor_se)
  235.           @index = [@index + self.page_item_max, @item_max - 1].min
  236.           self.top_row += self.page_row_max
  237.         end
  238.       end
  239.       # L 键被按下的情况下
  240.       if Input.repeat?(Input::L)
  241.         # 显示的开头行在位置 0 之后的情况下
  242.         if self.top_row > 0
  243.           # 光标向前移动一页
  244.           $game_system.se_play($data_system.cursor_se)
  245.           @index = [@index - self.page_item_max, 0].max
  246.           self.top_row -= self.page_row_max
  247.         end
  248.       end
  249.     end
  250.     # 刷新帮助文本 (update_help 定义了继承目标)
  251.     if self.active and @help_window != nil
  252.       update_help
  253.     end
  254.     # 刷新光标矩形
  255.     update_cursor_rect
  256.   end
  257. end
  258. # ------------------------------------------
  259. # * Window_Command_Shop
  260. # ------------------------------------------
  261. class Window_Command_Shop < Window_Selectable
  262.   # ------------------------------------------
  263.   # * initialize
  264.   # ------------------------------------------
  265.   def initialize(width, commands, column_max = 1, size = 22)
  266.     super(0, 0, width, 0)
  267.     if column_max == 1
  268.       self.height = commands.size * 32 + 32
  269.     else
  270.       self.height = 64
  271.     end
  272.     @item_max = commands.size
  273.     @commands = commands
  274.     @column_max = column_max
  275.     @size = size
  276.     self.contents = Bitmap.new(width - 32, @item_max * 32)
  277.     refresh
  278.     self.index = 0
  279.   end
  280.   # ------------------------------------------
  281.   # * refresh
  282.   # ------------------------------------------
  283.   def refresh
  284.     self.contents.clear
  285.     for i in 0...@item_max
  286.       if @column_max != 1
  287.       if i == self.index
  288.         color = text_color(2)
  289.       else
  290.         color = normal_color
  291.       end
  292.       else
  293.       color = normal_color
  294.       end
  295.       draw_item(i, color)
  296.     end
  297.   end
  298.   # ------------------------------------------
  299.   # * draw_item
  300.   # ------------------------------------------
  301.   def draw_item(index, color)
  302.     self.contents.font.color = color
  303.     self.contents.font.size = @size
  304.     if @column_max == 1
  305.     self.contents.draw_text(4, 32 * index, width - 8, 32, @commands[index])
  306.     else
  307.     if @size == 15
  308.     self.contents.draw_text(
  309.     width / @column_max * index + 50, 0, width - 8, 32, @commands[index])
  310.     else
  311.     self.contents.draw_text(
  312.     width / @column_max * index + 20, 0, width - 8, 32, @commands[index])
  313.     end
  314.     end
  315.   end
  316.   # ------------------------------------------
  317.   # * disable_item
  318.   # ------------------------------------------
  319.   def disable_item(index)
  320.     draw_item(index, disabled_color)
  321.   end
  322.   # ------------------------------------------
  323.   # * update
  324.   # ------------------------------------------
  325.   def update
  326.     super
  327.     if self.index != @old_index
  328.     refresh
  329.     @old_index = self.index
  330.     end
  331.   end
  332.   # ------------------------------------------
  333.   # * update
  334.   # ------------------------------------------
  335.   def update_help
  336.     case self.index
  337.     when 0
  338.     @help_window.set_text("进行召唤并参战", "或加入掠阵队伍", 240, 64)
  339.     when 1
  340.     @help_window.set_text("查看已经召唤的", "十二生肖的属性", 640-170, 64)
  341.     end
  342.   end
  343. end
  344. # ------------------------------------------
  345. # * Window_Command_Shop
  346. # ------------------------------------------
  347. class Window_Command_Shop_2 < Window_Selectable
  348.   # ------------------------------------------
  349.   # * initialize
  350.   # ------------------------------------------
  351.   def initialize(width, commands, column_max = 1, size = 22)
  352.     super(0, 0, width, 0)
  353.     if column_max == 1
  354.       self.height = commands.size * 32 + 32
  355.     else
  356.       self.height = 64
  357.     end
  358.     @item_max = commands.size
  359.     @commands = commands
  360.     @column_max = column_max
  361.     @size = size
  362.     self.contents = Bitmap.new(width - 32, @item_max * 32)
  363.     refresh
  364.     self.index = 0
  365.   end
  366.   # ------------------------------------------
  367.   # * refresh
  368.   # ------------------------------------------
  369.   def refresh
  370.     self.contents.clear
  371.     for i in 0...@item_max
  372.       if @column_max != 1
  373.       if i == self.index
  374.         color = text_color(2)
  375.       else
  376.         color = normal_color
  377.       end
  378.       else
  379.       color = normal_color
  380.       end
  381.       draw_item(i, color)
  382.     end
  383.   end
  384.   # ------------------------------------------
  385.   # * draw_item
  386.   # ------------------------------------------
  387.   def draw_item(index, color)
  388.     self.contents.font.color = color
  389.     self.contents.font.size = @size
  390.     if @column_max == 1
  391.     self.contents.draw_text(4, 32 * index, width - 8, 32, @commands[index])
  392.     else
  393.     if @size == 15
  394.     self.contents.draw_text(
  395.     width / @column_max * index + 50, 0, width - 8, 32, @commands[index])
  396.     else
  397.     self.contents.draw_text(
  398.     width / @column_max * index + 20, 0, width - 8, 32, @commands[index])
  399.     end
  400.     end
  401.   end
  402.   # ------------------------------------------
  403.   # * disable_item
  404.   # ------------------------------------------
  405.   def disable_item(index)
  406.     draw_item(index, disabled_color)
  407.   end
  408.   # ------------------------------------------
  409.   # * update
  410.   # ------------------------------------------
  411.   def update
  412.     super
  413.     if self.index != @old_index
  414.     refresh
  415.     @old_index = self.index
  416.     end
  417.   end
  418.   # ------------------------------------------
  419.   # * update
  420.   # ------------------------------------------
  421.   def update_help
  422.     case self.index
  423.     when 0
  424.     @help_window.set_text("查看当前在队伍中", "的十二生肖属性", 440-170, 64)
  425.     when 1
  426.     @help_window.set_text("查看掠阵队伍中的", "十二生肖的属性", 440-170, 96)
  427.     end
  428.   end
  429. end
  430. # ------------------------------------------
  431. # * Window_Command_Shop
  432. # ------------------------------------------
  433. class Window_Command_Shop_3 < Window_Selectable
  434.   # ------------------------------------------
  435.   # * initialize
  436.   # ------------------------------------------
  437.   def initialize(width, commands, column_max = 1, size = 22)
  438.     super(0, 0, width, 0)
  439.     if column_max == 1
  440.       self.height = commands.size * 32 + 32
  441.     else
  442.       self.height = 64
  443.     end
  444.     @item_max = commands.size
  445.     @commands = commands
  446.     @column_max = column_max
  447.     @size = size
  448.     self.contents = Bitmap.new(width - 32, @item_max * 32)
  449.     refresh
  450.     self.index = 0
  451.   end
  452.   # ------------------------------------------
  453.   # * refresh
  454.   # ------------------------------------------
  455.   def refresh
  456.     self.contents.clear
  457.     for i in 0...@item_max
  458.       if @column_max != 1
  459.       if i == self.index
  460.         color = text_color(2)
  461.       else
  462.         color = normal_color
  463.       end
  464.       else
  465.       color = normal_color
  466.       end
  467.       draw_item(i, color)
  468.     end
  469.   end
  470.   # ------------------------------------------
  471.   # * draw_item
  472.   # ------------------------------------------
  473.   def draw_item(index, color)
  474.     self.contents.font.color = color
  475.     self.contents.font.size = @size
  476.     if @column_max == 1
  477.     self.contents.draw_text(4, 32 * index, width - 8, 32, @commands[index])
  478.     else
  479.     if @size == 15
  480.     self.contents.draw_text(
  481.     width / @column_max * index + 50, 0, width - 8, 32, @commands[index])
  482.     else
  483.     self.contents.draw_text(
  484.     width / @column_max * index + 20, 0, width - 8, 32, @commands[index])
  485.     end
  486.     end
  487.   end
  488.   # ------------------------------------------
  489.   # * disable_item
  490.   # ------------------------------------------
  491.   def disable_item(index)
  492.     draw_item(index, disabled_color)
  493.   end
  494.   # ------------------------------------------
  495.   # * update
  496.   # ------------------------------------------
  497.   def update
  498.     super
  499.     if self.index != @old_index
  500.     refresh
  501.     @old_index = self.index
  502.     end
  503.   end
  504.   # ------------------------------------------
  505.   # * update
  506.   # ------------------------------------------
  507.   def update_help
  508.     case self.index
  509.     when 0
  510.     @help_window.set_text("召唤生肖兽并且", "参加战斗。", 0, 480-92*2-32)
  511.     when 1
  512.     @help_window.set_text("召唤生肖兽加入", "掠阵队伍中", 240, 480-92*2-32)
  513.     end
  514.   end
  515. end
  516. # ------------------------------------------
  517. # * Window_TipCommand_help  # 参与N场战斗的提示
  518. # ------------------------------------------
  519. class Window_TipCommand_help < Window_Base
  520.   # ------------------------------------------
  521.   # * initialize
  522.   # ------------------------------------------
  523.   def initialize
  524.     super(0, 480 - 64 - 64, 450, 64)
  525.     self.z = 9998
  526.     self.opacity = 200
  527.     self.contents = Bitmap.new(width - 32, height - 32)
  528.     refresh
  529.   end
  530.   # ------------------------------------------
  531.   # * refresh
  532.   # ------------------------------------------
  533.   def refresh(actor = $game_actors[1], color = 1)
  534.     self.contents.clear
  535.     self.contents.font.size = 15
  536.     @bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
  537.     rect = Rect.new(0, 0, @bitmap.width / 4, @bitmap.height / 8)
  538.     self.contents.blt(0, 2, @bitmap, rect)
  539.     self.contents.font.color = text_color(color)
  540.     time = $game_temp.actors_time[actor.id]
  541.     text = "(只可参与#{time}场战斗)"
  542.     self.contents.draw_text(35, 0, width - 8, 32, actor.name + text)
  543.   end
  544.   # ------------------------------------------
  545.   # * dispose
  546.   # ------------------------------------------
  547.   def dispose
  548.     super
  549.     @bitmap.dispose
  550.   end
  551. end
  552. # ------------------------------------------
  553. # * Actor_Shop_Command_Help  # 雇佣兵雇佣选择列表帮助
  554. # ------------------------------------------
  555. class Actor_Shop_Command_Help < Window_Base
  556.   # ------------------------------------------
  557.   # * initialize
  558.   # ------------------------------------------
  559.   def initialize
  560.     super(150, 0, 240, 364)
  561.     self.z = 123
  562.     self.opacity = 160
  563.     self.contents = Bitmap.new(width - 32, height - 32)
  564.   end
  565.   # ------------------------------------------
  566.   # * dispose
  567.   # ------------------------------------------
  568.   def dispose
  569.     super
  570.     if @bitmap != nil
  571.     @bitmap.dispose
  572.     end
  573.     if @icon != nil
  574.     @icon.dispose
  575.     end
  576.   end
  577.   # ------------------------------------------
  578.   # * text_color
  579.   # ------------------------------------------
  580.   def text_color(n)
  581.     case n
  582.     when 0
  583.       return Color.new(255, 255, 255, 255)
  584.     when 1
  585.       return Color.new(0, 0, 255, 255)
  586.     when 2
  587.       return Color.new(255, 128, 128, 255)
  588.     when 3
  589.       return Color.new(128, 255, 128, 255)
  590.     when 4
  591.       return Color.new(128, 255, 255, 255)
  592.     when 5
  593.       return Color.new(255, 128, 255, 255)
  594.     when 6
  595.       return Color.new(255, 255, 128, 255)
  596.     when 7
  597.       return Color.new(192, 192, 192, 255)
  598.     else
  599.       normal_color
  600.     end
  601.   end
  602.   # ------------------------------------------
  603.   # * set_text
  604.   # ------------------------------------------
  605.   def set_text(actor_index, y, gold_type = nil, gold = nil, x = 150)
  606.     if actor_index != @actor_index or y != @y or gold_type != @gold_type or
  607.       gold != @gold
  608.       self.contents.clear
  609.       self.contents.font.color = normal_color
  610.       self.x = x
  611.       self.y = y
  612.       if actor_index != nil
  613.       # ------------------------------------------
  614.       # * dispose
  615.       # ------------------------------------------
  616.       if @bitmap != nil
  617.        @bitmap.dispose
  618.       end
  619.       # ------------------------------------------
  620.       # * face
  621.       # ------------------------------------------
  622.       @bitmap = RPG::Cache.picture(actor_index.id.to_s+".png")
  623.       w = @bitmap.width
  624.       h = @bitmap.height
  625.       self.contents.blt(-5, 35, @bitmap, Rect.new(0, 0, w, h), 160)
  626.       # ------------------------------------------
  627.       # * color
  628.       # ------------------------------------------
  629.       for b in 1..150
  630.       @color_2 = Color.new(255, 128, 255, 80 - b)
  631.       @color_3 = Color.new(255, 128, 255, 60 + b)
  632.       self.contents.fill_rect(
  633.       Rect.new(2 * b + 4, 0, 2, 30), @color_2)
  634.       self.contents.fill_rect(
  635.       Rect.new(2 * b + 4 - 32, 0, 2, 30), @color_3) if b < 20
  636.       @color_2 = Color.new(128, 128, 255, 80 - b)
  637.       @color_3 = Color.new(128, 128, 255, 60 + b)
  638.       self.contents.fill_rect(
  639.       Rect.new(2 * b + 96+30, 32, 2, 30), @color_2)
  640.       self.contents.fill_rect(
  641.       Rect.new(2 * b + 92, 32, 2, 30), @color_3) if b < 20
  642.       @color_2 = Color.new(255, 255, 128, 80 - b)
  643.       @color_3 = Color.new(255, 255, 128, 60 + b)
  644.       self.contents.fill_rect(
  645.       Rect.new(2 * b + 96+30, 64, 2, 30), @color_2)
  646.       self.contents.fill_rect(
  647.       Rect.new(2 * b + 92, 64, 2, 30), @color_3) if b < 20
  648.       @color_2 = Color.new(128, 255, 128, 80 - b)
  649.       @color_3 = Color.new(128, 255, 128, 60 + b)
  650.       self.contents.fill_rect(
  651.       Rect.new(2 * b + 96+30, 96, 2, 30), @color_2)
  652.       self.contents.fill_rect(
  653.       Rect.new(2 * b + 92, 96, 2, 30), @color_3) if b < 20
  654.       @color_2 = Color.new(128, 255, 255, 80 - b)
  655.       @color_3 = Color.new(128, 255, 255, 60 + b)
  656.       self.contents.fill_rect(
  657.       Rect.new(2 * b + 4, 96+32+10, 2, 30), @color_2)
  658.       self.contents.fill_rect(
  659.       Rect.new(2 * b + 4-32, 96+32+10, 2, 30), @color_3) if b < 20
  660.       @color_2 = Color.new(255, 128, 255, 80 - b)
  661.       @color_3 = Color.new(255, 128, 255, 60 + b)
  662.       self.contents.fill_rect(
  663.       Rect.new(2 * b + 4, 96+64+10, 2, 30), @color_2)
  664.       self.contents.fill_rect(
  665.       Rect.new(2 * b + 4-32, 96+64+10, 2, 30), @color_3) if b < 20
  666.       @color_2 = Color.new(255, 255, 128, 80 - b)
  667.       @color_3 = Color.new(255, 255, 128, 60 + b)
  668.       self.contents.fill_rect(
  669.       Rect.new(2 * b + 4, 96*2+10, 2, 30), @color_2)
  670.       self.contents.fill_rect(
  671.       Rect.new(2 * b + 4-32, 96*2+10, 2, 30), @color_3) if b < 20
  672.       @color_2 = Color.new(192, 192, 192, 80 - b)
  673.       @color_3 = Color.new(192, 192, 192, 60 + b)
  674.       self.contents.fill_rect(
  675.       Rect.new(2 * b + 4, 96*2+42, 2, 30), @color_2)
  676.       self.contents.fill_rect(
  677.       Rect.new(2 * b + 4-32, 96*2+42, 2, 30), @color_3) if b < 20  
  678.       @color_2 = Color.new(255, 128, 255, 80 - b)
  679.       @color_3 = Color.new(255, 128, 255, 60 + b)
  680.       self.contents.fill_rect(
  681.       Rect.new(2 * b + 4, 96*2+74, 2, 30), @color_2)
  682.       self.contents.fill_rect(
  683.       Rect.new(2 * b + 4-32, 96*2+74, 2, 30), @color_3) if b < 20  
  684.       @color_2 = Color.new(128, 255, 255, 80 - b)
  685.       @color_3 = Color.new(128, 255, 255, 60 + b)
  686.       self.contents.fill_rect(
  687.       Rect.new(2 * b + 4, 96*2+108, 2, 30), @color_2)
  688.       self.contents.fill_rect(
  689.       Rect.new(2 * b + 4-32, 96*2+108, 2, 30), @color_3) if b < 20  
  690.       end
  691.       # ------------------------------------------
  692.       # * text
  693.       # ------------------------------------------
  694.       self.contents.font.size = 15
  695.       draw_actor_name(actor_index, 4, 0)
  696.       name_x_p = contents.text_size(actor_index.name).width
  697.       self.contents.font.color = text_color(3)
  698.       self.contents.draw_text(
  699.       4+name_x_p, 0, width - 8, 32, "["<<actor_index.class_name<<"]")
  700.       draw_actor_level(actor_index, 96, 32)
  701.       self.contents.font.color = system_color
  702.       self.contents.draw_text(
  703.       96, 64, width - 8, 32, ""<<$data_system.words.hp)
  704.       self.contents.font.color = normal_color
  705.       self.contents.draw_text(
  706.       96+64, 64, width - 8, 32, actor_index.maxhp.to_s)
  707.       self.contents.font.color = system_color
  708.       self.contents.draw_text(
  709.       96, 96, width - 8, 32, ""<<$data_system.words.sp)
  710.       self.contents.font.color = normal_color
  711.       self.contents.draw_text(
  712.       96+64, 96, width - 8, 32, actor_index.maxsp.to_s)
  713.       draw_actor_parameter_new(actor_index, 4, 96+32+10, 3)
  714.       draw_actor_parameter_new(actor_index, 4, 96+64+10, 4)
  715.       draw_actor_parameter_new(actor_index, 4, 96*2+10, 5)
  716.       draw_actor_parameter_new(actor_index, 4, 96*2+32+10, 6)
  717.       draw_actor_parameter_new(actor_index, 4, 96*2+64+10, 1)
  718.       draw_actor_parameter_new(actor_index, 4, 96*3+10, 2)
  719.       # ------------------------------------------
  720.       # * gold
  721.       # ------------------------------------------
  722.       if gold_type != nil
  723.       cx = name_x_p+contents.text_size("["<<actor_index.class_name<<"]").width
  724.       @icon = RPG::Cache.icon(gold_type)
  725.       w = @icon.width
  726.       h = @icon.height
  727.       self.contents.blt(4 + cx, 3, @icon, Rect.new(0, 0, w, h))
  728.       case gold_type
  729.       when "0.PNG"
  730.       self.contents.font.color = text_color(1)
  731.       when "1.PNG"
  732.       self.contents.font.color = text_color(2)
  733.       when "2.PNG"
  734.       self.contents.font.color = text_color(6)
  735.       when "3.PNG"
  736.       self.contents.font.color = text_color(3)
  737.       end
  738.       self.contents.draw_text(4 + cx + w, 0, width - 8, 32, gold)
  739.       end
  740.       # ------------------------------------------
  741.       # * Equip
  742.       # ------------------------------------------
  743.       self.contents.font.color = system_color
  744.       self.contents.draw_text(100, 96+32+10, 96, 32, "装备")
  745.       draw_item_name($data_weapons[actor_index.weapon_id], 100, 96+64+10)
  746.       draw_item_name($data_armors[actor_index.armor1_id], 100, 96*2+10)
  747.       draw_item_name($data_armors[actor_index.armor2_id], 100, 96*2+42)
  748.       draw_item_name($data_armors[actor_index.armor3_id], 100, 96*2+64+10)
  749.       draw_item_name($data_armors[actor_index.armor4_id], 100, 96*3+10)
  750.       else
  751.       self.visible = false
  752.       end
  753.       @actor_index = actor_index
  754.       @y = y
  755.       @gold_type = gold_type
  756.       @gold = gold
  757.       @actor = nil
  758.     end
  759.     self.visible = true
  760.   end
  761.   # ------------------------------------------
  762.   # * draw_actor_parameter_new
  763.   # ------------------------------------------
  764.   def draw_actor_parameter_new(actor, x, y, type)
  765.     case type
  766.     when 0
  767.       parameter_name = $data_system.words.atk
  768.       parameter_value = actor.atk
  769.     when 1
  770.       parameter_name = $data_system.words.pdef
  771.       parameter_value = actor.pdef
  772.     when 2
  773.       parameter_name = $data_system.words.mdef
  774.       parameter_value = actor.mdef
  775.     when 3
  776.       parameter_name = $data_system.words.str
  777.       parameter_value = actor.str
  778.     when 4
  779.       parameter_name = $data_system.words.dex
  780.       parameter_value = actor.dex
  781.     when 5
  782.       parameter_name = $data_system.words.agi
  783.       parameter_value = actor.agi
  784.     when 6
  785.       parameter_name = $data_system.words.int
  786.       parameter_value = actor.int
  787.     end
  788.     self.contents.font.color = system_color
  789.     self.contents.draw_text(x, y, 120, 32, parameter_name)
  790.     self.contents.font.color = normal_color
  791.     self.contents.draw_text(x + 30, y, 36, 32, parameter_value.to_s, 2)
  792.   end
  793. end
  794. # ------------------------------------------
  795. # * Actor_Shop_Command  # 选择雇佣兵(列表)
  796. # ------------------------------------------
  797. class Actor_Shop_Command < Window_Selectable
  798.   # ------------------------------------------
  799.   # * initialize
  800.   # ------------------------------------------
  801.   def initialize
  802.     super(0, 0, 240, 480 + 80)
  803.     self.opacity = 100
  804.     @item_max = @@item.size
  805.     if @item_max > 10
  806.     self.contents = Bitmap.new(width - 32, 10 * 46)
  807.     else
  808.     self.contents = Bitmap.new(width - 32, @item_max * 46)
  809.     end
  810.     @column_max = 1
  811.     refresh
  812.     self.index = 0
  813.   end
  814.   # ------------------------------------------
  815.   # * refresh
  816.   # ------------------------------------------
  817.   def refresh(page = 1)
  818.     self.contents.clear
  819.     @commands = []
  820.     for i in 0...@item_max
  821.     @actor = $game_actors[@@item[i][0]]
  822.     @commands[i] = @actor.name
  823.     color = text_color(@@item[i][3].to_i)
  824.     shop_draw_item(i, color, @@item[i][3].to_i, page)
  825.     end
  826.   end
  827.   # ------------------------------------------
  828.   # * shop_draw_item
  829.   # ------------------------------------------
  830.   def shop_draw_item(i, color, color_2, page)
  831.     self.contents.font.size = 15
  832.     x = 36 + i % @column_max * (288 + 32)
  833.     if page == 1
  834.     y = i / @column_max * 46
  835.     else
  836.     y = (i - 10) / @column_max * 46
  837.     end
  838.     for b in 1..150
  839.     case color_2
  840.     when 1
  841.       @color_2 = Color.new(128, 128, 255, 80 - b)
  842.       @color_3 = Color.new(128, 128, 255, 60 + b)
  843.     when 2
  844.       @color_2 = Color.new(255, 128, 128, 80 - b)
  845.       @color_3 = Color.new(255, 128, 128, 60 + b)
  846.     when 3
  847.       @color_2 = Color.new(128, 255, 128, 80 - b)
  848.       @color_3 = Color.new(128, 255, 128, 60 + b)
  849.     when 4
  850.       @color_2 = Color.new(128, 255, 255, 80 - b)
  851.       @color_3 = Color.new(128, 255, 255, 60 + b)
  852.     when 5
  853.       @color_2 = Color.new(255, 128, 255, 80 - b)
  854.       @color_3 = Color.new(255, 128, 255, 60 + b)
  855.     when 6
  856.       @color_2 = Color.new(255, 255, 128, 80 - b)
  857.       @color_3 = Color.new(255, 255, 128, 60 + b)
  858.     when 7
  859.       @color_2 = Color.new(192, 192, 192, 80 - b)
  860.       @color_3 = Color.new(192, 192, 192, 60 + b)
  861.     end
  862.     self.contents.fill_rect(
  863.     Rect.new(2 * b + x, y, 2, 30), @color_2)
  864.     self.contents.fill_rect(
  865.     Rect.new(2 * b + x - 32, y, 2, 30), @color_3) if b < 20
  866.     end
  867.     self.contents.font.color = color
  868.     @bitmap = RPG::Cache.character(@actor.character_name, @actor.character_hue)
  869.     rect = Rect.new(0, 0, @bitmap.width / 4, @bitmap.height / 8)
  870.     self.contents.blt(x - 32, y + 3, @bitmap, rect)
  871.     self.contents.draw_text(x, y, width - 8, 32, @commands[i])
  872.     cx = contents.text_size("艾斯迪儿").width - 15
  873.     @icon = RPG::Cache.icon(@@item[i][4])
  874.     w = @icon.width
  875.     h = @icon.height
  876.     self.contents.blt(x + cx + 24, y + 3, @icon, Rect.new(0, 0, w, h))
  877.     self.contents.draw_text(x + cx + 52, y, width - 8, 32, @@item[i][5].to_s)
  878.   end
  879.   # ------------------------------------------
  880.   # * dispose
  881.   # ------------------------------------------
  882.   def dispose
  883.     super
  884.     @bitmap.dispose
  885.     @icon.dispose
  886.   end
  887.   # ------------------------------------------
  888.   # * update_cursor_rect
  889.   # ------------------------------------------
  890.   def update_cursor_rect
  891.     if @index < 0
  892.       self.cursor_rect.empty
  893.     end
  894.     cursor_width = self.width / @column_max - 32
  895.     x = @index % @column_max * (cursor_width + 32)
  896.     if @index < 10
  897.     y = @index / @column_max * 46 - self.oy
  898.     if @index != @old_index_index
  899.     refresh(1)
  900.     @old_index_index = @index
  901.     end
  902.     else
  903.     if @index != @old_index_index
  904.     refresh(2)
  905.     @old_index_index = @index
  906.     end
  907.     y = (@index - 10) / @column_max * 46 - self.oy
  908.     end
  909.     self.cursor_rect.set(x, y, cursor_width, 32)
  910.   end
  911.   # ------------------------------------------
  912.   # * update_help
  913.   # ------------------------------------------
  914.   def update_help
  915.     # ------------------------------------------
  916.     # * Actors and Y and Gold
  917.     # ------------------------------------------
  918.     case self.index
  919.     when 0...2
  920.     y = self.index * 45 + 64
  921.     when 2
  922.     y = 480 - 364
  923.     when 3
  924.     y = 480 - 364
  925.     when 4
  926.     y = 32
  927.     when 5
  928.     y = 32
  929.     when 6
  930.     y = 32
  931.     when 7
  932.     y = 64
  933.     when 8
  934.     y = 480 - 364
  935.     when 9
  936.     y = 480 - 364
  937.     when 10...12
  938.     y = (self.index - 10) * 45 + 64
  939.     when 12
  940.     y = 480 - 364
  941.     when 13
  942.     y = 480 - 364
  943.     when 14
  944.     y = 32
  945.     when 15
  946.     y = 32
  947.     when 16
  948.     y = 32
  949.     when 17
  950.     y = 64
  951.     when 18
  952.     y = 480 - 364
  953.     when 19
  954.     y = 480 - 364
  955.     end
  956.     @help_window.set_text(
  957.     $game_actors[@@item[self.index][0]], y, @@item[self.index][2].to_s<<".PNG",
  958.     @@item[self.index][1].to_s)
  959.   end
  960. end
  961. # ------------------------------------------
  962. # * Actor_Shop_Window_Gold # 显示现有资源的窗口
  963. # ------------------------------------------
  964. class Actor_Shop_Window_Gold < Window_Base
  965.   # ------------------------------------------
  966.   # * initialize
  967.   # ------------------------------------------
  968.   def initialize
  969.     super(240, 480 - 64, 400, 64)
  970.     self.opacity = 100
  971.     self.contents = Bitmap.new(width - 32, height - 32)
  972.     refresh
  973.   end
  974.   # ------------------------------------------
  975.   # * dispose
  976.   # ------------------------------------------
  977.   def dispose
  978.     super
  979.     for i in 0...4
  980.     @bitmap[i].dispose
  981.     end
  982.   end
  983.   # ------------------------------------------
  984.   # * refresh
  985.   # ------------------------------------------
  986.   def refresh
  987.     self.contents.clear
  988.     self.contents.font.size = 15
  989.     @bitmap = []
  990.     for i in 0...4
  991.     @bitmap[i] = RPG::Cache.icon("#{i}.PNG")
  992.     w = @bitmap[i].width - 5
  993.     self.contents.blt(i * 100, 4, @bitmap[i], Rect.new(0, 0, 24, 24))
  994.     wt = width - 8
  995.     ht = 32
  996.     case i
  997.     when 0
  998.     self.contents.font.color = text_color(1)
  999.     self.contents.draw_text(4+w+i*100, 0, wt, ht, $game_temp.gold_bule.to_s)
  1000.     when 1
  1001.     self.contents.font.color = text_color(2)
  1002.     self.contents.draw_text(4+w+i*100, 0, wt, ht, $game_temp.gold_red.to_s)
  1003.     when 2
  1004.     self.contents.font.color = text_color(6)
  1005.     self.contents.draw_text(4+w+i*100, 0, wt, ht, $game_temp.gold_yellow.to_s)
  1006.     when 3
  1007.     self.contents.font.color = text_color(3)
  1008.     self.contents.draw_text(4+w+i*100, 0, wt, ht, $game_temp.gold_green.to_s)
  1009.     end
  1010.     end
  1011.   end
  1012. end
  1013. # ------------------------------------------
  1014. # * Actor_Shop_Message_Save_2  # 显示仓库中雇佣角色的列表
  1015. # ------------------------------------------
  1016. class Actor_Shop_Message_Save_2 < Window_Selectable
  1017.   # ------------------------------------------
  1018.   # * initialize
  1019.   # ------------------------------------------
  1020.   def initialize
  1021.     super(240, 64 + (480 - 128) / 2, 400, (480 - 128) / 2)
  1022.     self.opacity = 100
  1023.     @column_max = 1
  1024.     self.contents = Bitmap.new(width - 32, 4*32)
  1025.     refresh
  1026.   end
  1027.   # ------------------------------------------
  1028.   # * refresh
  1029.   # ------------------------------------------
  1030.   def refresh(page = 1)
  1031.     self.contents.clear
  1032.     @item_max = $game_temp.actors_2.size
  1033.     self.contents.font.size = 15
  1034.     for b in 1..150
  1035.       @color_2 = Color.new(128, 128, 255, 120 - b)
  1036.       @color_3 = Color.new(128, 128, 255, 100 + b)
  1037.       self.contents.fill_rect(
  1038.       Rect.new(2 * b + 4, 32*0, 2, 30), @color_2)
  1039.       self.contents.fill_rect(
  1040.       Rect.new(2 * b + 4 - 32, 32*0, 2, 30), @color_3) if b < 20
  1041.       @color_2 = Color.new(192, 192, 192, 120 - b)
  1042.       @color_3 = Color.new(192, 192, 192, 100 + b)
  1043.       self.contents.fill_rect(
  1044.       Rect.new(2 * b + 4, 32*1, 2, 30), @color_2)
  1045.       self.contents.fill_rect(
  1046.       Rect.new(2 * b + 4 - 32, 32*1, 2, 30), @color_3) if b < 20
  1047.       @color_2 = Color.new(255, 255, 64, 120 - b)
  1048.       @color_3 = Color.new(255, 255, 64, 100 + b)
  1049.       self.contents.fill_rect(
  1050.       Rect.new(2 * b + 4, 32*2, 2, 30), @color_2)
  1051.       self.contents.fill_rect(
  1052.       Rect.new(2 * b + 4 - 32, 32*2, 2, 30), @color_3) if b < 20
  1053.       @color_2 = Color.new(128, 255, 255, 120 - b)
  1054.       @color_3 = Color.new(128, 255, 255, 100 + b)
  1055.       self.contents.fill_rect(
  1056.       Rect.new(2 * b + 4, 32*3, 2, 30), @color_2)
  1057.       self.contents.fill_rect(
  1058.       Rect.new(2 * b + 4 - 32, 32*3, 2, 30), @color_3) if b < 20
  1059.     end
  1060.     self.contents.draw_text(4, 0, width - 8, 32, "掠阵队伍中的生肖兽")
  1061.     for i in 0...@item_max
  1062.       item_actor(i, page)
  1063.     end
  1064.   end
  1065.   # ------------------------------------------
  1066.   # * dispose
  1067.   # ------------------------------------------
  1068.   def dispose
  1069.     super
  1070.     if @bitmap != nil
  1071.     @bitmap.dispose
  1072.     end
  1073.     if @bitmap_2 != nil
  1074.       @bitmap_2.dispose
  1075.     end
  1076.   end
  1077.   # ------------------------------------------
  1078.   # * item_actor
  1079.   # ------------------------------------------
  1080.   def item_actor(i, page)
  1081.     self.contents.font.size = 15
  1082.     if $game_temp.actors_2 != []
  1083.     @bitmap = RPG::Cache.character(
  1084.     $game_temp.actors_2[i].character_name,
  1085.     $game_temp.actors_2[i].character_hue)
  1086.     rect = Rect.new(0, 0, @bitmap.width / 4, @bitmap.height / 8)
  1087.     if page == 1
  1088.     self.contents.blt(0, 32*(i+1), @bitmap, rect)
  1089.     self.contents.draw_text(
  1090.     40, 32*(i+1), width - 8, 32, $game_temp.actors_2[i].name)
  1091.     else
  1092.     if i != 2
  1093.     self.contents.blt(0, 32*(i-2), @bitmap, rect)
  1094.     self.contents.draw_text(
  1095.     40, 32*(i-2), width - 8, 32, $game_temp.actors_2[i].name)
  1096.     end
  1097.     end
  1098.     end
  1099.   end
  1100.   # ------------------------------------------
  1101.   # * update_cursor_rect
  1102.   # ------------------------------------------
  1103.   def update_cursor_rect
  1104.     if self.index != @oldold_index
  1105.     if @index >= 3
  1106.     refresh(2)
  1107.     else
  1108.     refresh(1)
  1109.     end
  1110.     @oldold_index = self.index
  1111.     end
  1112.     if @index < 0
  1113.       self.cursor_rect.empty
  1114.     else
  1115.       if @index >= 3
  1116.       self.cursor_rect.set(0, (@index-2)*32, 240, 32)
  1117.       else
  1118.       self.cursor_rect.set(0, (@index+1)*32, 240, 32)
  1119.       end
  1120.     end
  1121.   end
  1122.   # ------------------------------------------
  1123.   # * update_help
  1124.   # ------------------------------------------
  1125.   def update_help
  1126.     if $game_temp.actors_2 != [] and self.index != -1
  1127.       actor_index = $game_temp.actors_2[self.index]
  1128.       y = 0
  1129.       y = self.index * 64 if self.index < 2
  1130.       y = 480 - 364 if self.index == 2
  1131.       y = (self.index-2) * 64 if self.index == 3
  1132.       y = (self.index-3) * 64 if self.index == 4 or self.index == 5
  1133.       y = 480 - 364 if self.index == 6
  1134.       @help_window.set_text(actor_index, y, nil, nil, 640 - 240)
  1135.     end
  1136.   end
  1137. end
  1138. # ------------------------------------------
  1139. # * Actor_Shop_Message_Save # 显示参战的雇佣角色的列表
  1140. # ------------------------------------------
  1141. class Actor_Shop_Message_Save < Window_Selectable
  1142.   # ------------------------------------------
  1143.   # * initialize
  1144.   # ------------------------------------------
  1145.   def initialize
  1146.     super(240, 64, 400, (480 - 128) / 2)
  1147.     self.opacity = 100
  1148.     @column_max = 1
  1149.     self.contents = Bitmap.new(width - 32, height - 32)
  1150.     refresh
  1151.   end
  1152.   # ------------------------------------------
  1153.   # * refresh
  1154.   # ------------------------------------------
  1155.   def refresh
  1156.     self.contents.clear
  1157.     @item_max = $game_temp.actors.size
  1158.     self.contents.font.size = 15
  1159.     for b in 1..150
  1160.       @color_2 = Color.new(255, 255, 128, 120 - b)
  1161.       @color_3 = Color.new(255, 255, 128, 100 + b)
  1162.       self.contents.fill_rect(
  1163.       Rect.new(2 * b + 4, 0, 2, 30), @color_2)
  1164.       self.contents.fill_rect(
  1165.       Rect.new(2 * b + 4 - 32, 0, 2, 30), @color_3) if b < 20
  1166.       @color_2 = Color.new(255, 128, 255, 120 - b)
  1167.       @color_3 = Color.new(255, 128, 255, 100 + b)
  1168.       self.contents.fill_rect(
  1169.       Rect.new(2 * b + 4, 32, 2, 30), @color_2)
  1170.       self.contents.fill_rect(
  1171.       Rect.new(2 * b + 4 - 32, 32, 2, 30), @color_3) if b < 20
  1172.       @color_2 = Color.new(128, 255, 255, 120 - b)
  1173.       @color_3 = Color.new(128, 255, 255, 100 + b)
  1174.       self.contents.fill_rect(
  1175.       Rect.new(2 * b + 4, 64, 2, 30), @color_2)
  1176.       self.contents.fill_rect(
  1177.       Rect.new(2 * b + 4 - 32, 64, 2, 30), @color_3) if b < 20
  1178.       @color_2 = Color.new(255, 128, 128, 120 - b)
  1179.       @color_3 = Color.new(255, 128, 128, 100 + b)
  1180.       self.contents.fill_rect(
  1181.       Rect.new(2 * b + 4, 96, 2, 30), @color_2)
  1182.       self.contents.fill_rect(
  1183.       Rect.new(2 * b + 4 - 32, 96, 2, 30), @color_3) if b < 20
  1184.     end
  1185.     self.contents.draw_text(4, 0, width - 8, 32, "参战的生肖兽")
  1186.     for i in 0...@item_max
  1187.       item_actor(i)
  1188.     end
  1189.   end
  1190.   # ------------------------------------------
  1191.   # * dispose
  1192.   # ------------------------------------------
  1193.   def dispose
  1194.     super
  1195.     if @bitmap != nil
  1196.     @bitmap.dispose
  1197.     end
  1198.     if @bitmap_2 != nil
  1199.       @bitmap_2.dispose
  1200.     end
  1201.   end
  1202.   # ------------------------------------------
  1203.   # * item_actor
  1204.   # ------------------------------------------
  1205.   def item_actor(i)
  1206.     self.contents.font.size = 15
  1207.     if $game_temp.actors != []
  1208.     @bitmap = RPG::Cache.character(
  1209.     $game_temp.actors[i].character_name, $game_temp.actors[i].character_hue)
  1210.     rect = Rect.new(0, 0, @bitmap.width / 4, @bitmap.height / 8)
  1211.     self.contents.blt(0, 32*(i+1), @bitmap, rect)
  1212.     self.contents.draw_text(
  1213.     40, 32*(i+1), width - 8, 32, $game_temp.actors[i].name)
  1214.     cx = contents.text_size($game_temp.actors[i].name).width
  1215.     id = $game_temp.actors[i].id
  1216.     self.contents.draw_text(
  1217.     50+cx, 32*(i+1), width - 8, 32, "剩余战斗次数:")
  1218.     dx = contents.text_size("剩余战斗次数:").width
  1219.     self.contents.draw_text(
  1220.     50+cx+dx, 32*(i+1), width - 8, 32, $game_temp.actors_time_2[id].to_s)
  1221.     end
  1222.   end
  1223.   # ------------------------------------------
  1224.   # * update_cursor_rect
  1225.   # ------------------------------------------
  1226.   def update_cursor_rect
  1227.     if self.index != @oldold_index
  1228.     refresh
  1229.     @oldold_index = self.index
  1230.     end
  1231.     if @index < 0
  1232.       self.cursor_rect.empty
  1233.     else
  1234.       self.cursor_rect.set(0, (@index+1)*32, 240, 32)
  1235.     end
  1236.   end
  1237.   # ------------------------------------------
  1238.   # * update_help
  1239.   # ------------------------------------------
  1240.   def update_help
  1241.     if $game_temp.actors != [] and self.index != -1
  1242.       actor_index = $game_temp.actors[self.index]
  1243.       y = self.index * 64 if self.index < 2
  1244.       y = 480 - 364 if self.index == 2
  1245.       y = (self.index-2) * 64 if self.index == 3
  1246.       @help_window.set_text(actor_index, y, nil, nil, 640 - 240)
  1247.     end
  1248.   end
  1249. end
  1250. # ------------------------------------------
  1251. # * Scene_Actor_Shop
  1252. # ------------------------------------------
  1253. class Scene_Actor_Shop
  1254.   # ------------------------------------------
  1255.   # * color
  1256.   # ------------------------------------------
  1257.   def text_color(n)
  1258.     case n
  1259.     when 0
  1260.       return Color.new(255, 255, 255, 255)
  1261.     when 1
  1262.       return Color.new(128, 128, 255, 255)
  1263.     when 2
  1264.       return Color.new(255, 128, 128, 255)
  1265.     when 3
  1266.       return Color.new(128, 255, 128, 255)
  1267.     when 4
  1268.       return Color.new(128, 255, 255, 255)
  1269.     when 5
  1270.       return Color.new(255, 128, 255, 255)
  1271.     when 6
  1272.       return Color.new(255, 255, 128, 255)
  1273.     when 7
  1274.       return Color.new(192, 192, 192, 255)
  1275.     else
  1276.       normal_color
  1277.     end
  1278.   end
  1279.   # ------------------------------------------
  1280.   # * main
  1281.   # ------------------------------------------
  1282.   def main
  1283.     map = Spriteset_Map.new
  1284.     @command = Actor_Shop_Command.new
  1285.     @command.x -= 200
  1286.     @command.active = false
  1287.     @command.index = -1
  1288.     @message = Actor_Shop_Message_Save.new
  1289.     @message.active = false
  1290.     @message.index = -1
  1291.     @message.x += 200
  1292.     @message_2 = Actor_Shop_Message_Save_2.new
  1293.     @message_2.active = false
  1294.     @message_2.index = -1
  1295.     @message_2.x += 200
  1296.     @gold = Actor_Shop_Window_Gold.new
  1297.     @gold.y += 50
  1298.     @help = Actor_Shop_Command_Help.new
  1299.     @help.visible = false
  1300.     @command.help_window = @help
  1301.     @message.help_window = @help
  1302.     @message_2.help_window = @help
  1303.     @tip_c = Window_TipCommand_help.new
  1304.     @tip_c.visible = false
  1305.     @flash_viewport_time = 20
  1306.     @flash_viewport = Viewport.new(240, 0, 400, 64)
  1307.     @flash_viewport.z = 9999
  1308.     @flash_viewport_2 = Viewport.new(0, 0, 240, 480)
  1309.     @flash_viewport_2.z = 9999
  1310.     @flash_viewport_2_2 = Viewport.new(240, 64, 150, 480 - 64)
  1311.     @flash_viewport_2_2.z = 9999
  1312.     @flash_viewport_3 = Viewport.new(0, 480 - 128, 450, 128)
  1313.     @flash_viewport_3.z = 9999
  1314.     @flash_viewport_4 = Viewport.new(240, 64, 640 - 240, (480 - 128) / 2)
  1315.     @flash_viewport_4.z = 9999
  1316.     @flash_viewport_5 = Viewport.new(
  1317.     240, 64 + (480 - 128) / 2, 640 - 240, (480 - 128) / 2)
  1318.     @flash_viewport_5.z = 9999
  1319.     @flash_viewport_6 = Viewport.new(440, 64, 200, 3 * 32)
  1320.     @flash_viewport_6.z = 9999
  1321.     black = Sprite.new
  1322.     black.bitmap = Bitmap.new(
  1323.     "Graphics/Pictures/color (6).png")
  1324.     black.opacity = 160
  1325.     @black_pictrue = []
  1326.     for i in 1..7
  1327.     @black_pictrue[i] = Sprite.new
  1328.     @black_pictrue[i].bitmap = Bitmap.new(
  1329.     "Graphics/Pictures/color (#{i - 1}).png")
  1330.     @black_pictrue[i].opacity = 0
  1331.     end
  1332.     @black_pictrue[(@@item[0][3].to_i)].opacity = 50
  1333.     $game_temp.map_bgm = $game_system.playing_bgm
  1334.     $game_system.bgm_stop
  1335.     Audio.bgm_play("Audio/BGM/058-Slow01.mid")
  1336.     @command_c = Window_Command_Shop_3.new(450,
  1337.     ["  参战", "  掠阵"], 2, 15)
  1338.     @command_c.opacity = 200
  1339.     @command_c.y = 480 - 64
  1340.     @command_c.z = 9998
  1341.     @command_c.active = false
  1342.     @command_c.visible = false
  1343.     @command_c.index = -1
  1344.     @command_s = Window_Command_Shop.new(400, ["  召唤", "  状态"], 2, 15)
  1345.     @command_s.opacity = 100
  1346.     @command_s.x = 240
  1347.     @command_s.y -= 50
  1348.     @command_status = Window_Command_Shop_2.new(
  1349.     200, ["当前队伍", "掠阵队伍"], 1, 15)
  1350.     @command_status.x = 640 - 200
  1351.     @command_status.y = 64
  1352.     @command_status.opacity = 200
  1353.     @command_status.active = false
  1354.     @command_status.index = -1
  1355.     @command_status.visible = false
  1356.     @help_command = Window_HelpCommand.new
  1357.     @help_command.y = -200
  1358.     @command_s.help_window = @help_command
  1359.     @command_status.help_window = @help_command
  1360.     @command_c.help_window = @help_command
  1361.     @command_canzhan = Window_Command_Shop.new(
  1362.     110, [" 加入掠阵队伍", "  取消"], 1, 15)
  1363.     @command_canzhan.active = false
  1364.     @command_canzhan.visible = false
  1365.     @command_canzhan.index = -1
  1366.     @command_canzhan.x = 300
  1367.     @command_canzhan.y = 150
  1368.     @command_canzhan.z = 9998
  1369.     @command_canzhan2 = Window_Command_Shop.new(
  1370.     110, [" 参与战斗", "  取消"], 1, 15)
  1371.     @command_canzhan2.active = false
  1372.     @command_canzhan2.visible = false
  1373.     @command_canzhan2.index = -1
  1374.     @command_canzhan2.x = 300
  1375.     @command_canzhan2.y = 300
  1376.     @command_canzhan2.z = 9998
  1377.     Graphics.transition
  1378.     for i in 1..21
  1379.       Graphics.update
  1380.       @command_s.y += 2
  1381.       @gold.y -= 2
  1382.       @message.x -= 10
  1383.       @message_2.x -= 10
  1384.       @command.x += 10
  1385.       @help_command.opacity += 10
  1386.       @help_command.contents_opacity += 10
  1387.       if i == 21
  1388.         @command_s.y = 0
  1389.         @gold.y = 480 - 64
  1390.         @message.x = 240
  1391.         @message_2.x = 240
  1392.         @command.x = 0
  1393.         @help_command.opacity = 200
  1394.         @help_command.contents_opacity = 200
  1395.       end
  1396.     end
  1397.     @flash_viewport.flash(Color.new(255,255,255,255),20)
  1398.     loop do
  1399.       Graphics.update
  1400.       Input.update
  1401.       update
  1402.       if $scene != self
  1403.         break
  1404.       end
  1405.     end
  1406.     for i in 1..21
  1407.       Graphics.update
  1408.       @command_s.y -= 2
  1409.       @gold.y += 2
  1410.       @message.x += 10
  1411.       @command.x -= 10
  1412.       @message_2.x += 10
  1413.       @help_command.y -= 10
  1414.       if i == 21
  1415.         @command_s.y = - 50
  1416.         @gold.y = 480 - 64 + 50
  1417.         @message.x = 240 + 200
  1418.         @message_2.x = 240 + 200
  1419.         @command.x = 0 - 200
  1420.         @help_command.y = 0 - 200
  1421.       end
  1422.     end
  1423.     Graphics.freeze
  1424.     $game_system.bgm_play($game_temp.map_bgm)
  1425.     @command.dispose
  1426.     @message.dispose
  1427.     @message_2.dispose
  1428.     @help.dispose
  1429.     @gold.dispose
  1430.     black.bitmap.dispose
  1431.     black.dispose
  1432.     map.dispose
  1433.     @command_c.dispose
  1434.     @command_s.dispose
  1435.     @tip_c.dispose
  1436.     @help_command.dispose
  1437.     @command_status.dispose
  1438.     @flash_viewport_2.dispose
  1439.     @flash_viewport_2_2.dispose
  1440.     @flash_viewport_3.dispose
  1441.     @flash_viewport_4.dispose
  1442.     @flash_viewport_5.dispose
  1443.     @command_canzhan.dispose
  1444.     @command_canzhan2.dispose
  1445.     for i in 1..7
  1446.     @black_pictrue[i].bitmap.dispose
  1447.     @black_pictrue[i].dispose
  1448.     end
  1449.     for i in 0..19
  1450.       @picture[i].bitmap.dispose
  1451.       @picture[i].dispose
  1452.     end
  1453.   end
  1454.   # ------------------------------------------
  1455.   # * update
  1456.   # ------------------------------------------
  1457.   def update
  1458.     @command_c.update
  1459.     @command_canzhan.update
  1460.     @command_canzhan2.update
  1461.     @command_s.update
  1462.     @message.update
  1463.     @actor = @@item[@command.index][0]
  1464.     if @flash_viewport_time >0
  1465.       @flash_viewport_time -= 1
  1466.       @flash_viewport.update
  1467.     end
  1468.     if @command.index != @oldindex
  1469.     if @command.index != -1
  1470.     @black_pictrue[(@@item[@command.index][3].to_i)].opacity = 50
  1471.     else
  1472.     @rand_num = rand(7) + 1
  1473.     @black_pictrue[(@@item[@rand_num][3].to_i)].opacity = 50
  1474.     end
  1475.     for i in 1..7
  1476.     if @command.index != -1
  1477.     @black_pictrue[i].opacity = 0 if i != (@@item[@command.index][3].to_i)
  1478.     else
  1479.     @black_pictrue[i].opacity = 0 if i != (@@item[@rand_num][3].to_i)
  1480.     end
  1481.     end
  1482.     @oldindex = @command.index
  1483.     end
  1484.     if @true_ == nil or @command.index != @oldindex_index
  1485.       if @picture != nil
  1486.         for i in 0..19
  1487.         @picture[i].bitmap.dispose
  1488.         @picture[i].dispose
  1489.         end
  1490.       end  
  1491.     @picture = []
  1492.     if @command.index != -1
  1493.     @picture_name = @@item[@command.index][3].to_i
  1494.     else
  1495.     @picture_name = @@item[rand(7) + 1][3].to_i
  1496.     end
  1497.     for i in 0..19
  1498.     @picture[i] = Sprite.new
  1499.     @picture[i].bitmap = Bitmap.new(
  1500.     "Graphics/Pictures/chage_picture#{@picture_name}.png")
  1501.     @picture[i].x, @picture[i].y = rand(640 - @picture[i].bitmap.width * 2) +
  1502.     1, rand(480 - @picture[i].bitmap.height * 2) + 1
  1503.     if @picture_name != 2
  1504.     rand_num = rand(5)
  1505.     case rand_num
  1506.     when 0
  1507.     @picture[i].zoom_x = 0.7
  1508.     @picture[i].zoom_x = 0.7
  1509.     when 1
  1510.     @picture[i].zoom_x = 0.8
  1511.     @picture[i].zoom_x = 0.8
  1512.     when 2
  1513.     @picture[i].zoom_x = 1.2
  1514.     @picture[i].zoom_x = 1.2
  1515.     when 3
  1516.     @picture[i].zoom_x = 1.3
  1517.     @picture[i].zoom_x = 1.3
  1518.     end
  1519.     end
  1520.     @picture[i].opacity = rand(50) + 206
  1521.     end
  1522.     @rand_picture = []
  1523.     for i in 0..5
  1524.       @rand_picture[i] = i - i * 2
  1525.     end
  1526.     @true_ = true
  1527.     @oldindex_index = @command.index
  1528.     end
  1529.     for i in 0..19
  1530.     @picture[i].x += rand(10) if i <= 9
  1531.     @picture[i].y += rand(10) if i <= 9
  1532.     @picture[i].x += rand(5) if i > 9
  1533.     @picture[i].y += rand(5) if i > 9
  1534.     if @picture_name != 2
  1535.     @picture[i].angle += @rand_picture[i] if i <= 5
  1536.     end
  1537.     @picture[i].opacity -= rand(10) + 1
  1538.      if @picture[i].opacity <= 50
  1539.        @picture[i].x, @picture[i].y = rand(640) + 1, rand(480) + 1
  1540.        @picture[i].opacity = 255
  1541.      end
  1542.     end
  1543.     @command.update
  1544.     @help.update
  1545.     @command_status.update
  1546.     @message_2.update
  1547.     if @command.active
  1548.       update_command
  1549.       return
  1550.     end
  1551.     if @command_c.active
  1552.       update_command_c
  1553.       return
  1554.     end
  1555.     if @command_s.active
  1556.       update_command_s
  1557.       return
  1558.     end
  1559.     if @message.active
  1560.       update_message
  1561.       return
  1562.     end
  1563.     if @message_2.active
  1564.       update_message_2
  1565.       return
  1566.     end
  1567.     if @command_status.active
  1568.       update_command_status
  1569.       return
  1570.     end
  1571.     if @command_canzhan.active
  1572.       update_command_canzhan
  1573.       return
  1574.     end
  1575.     if @command_canzhan2.active
  1576.       update_command_canzhan2
  1577.       return
  1578.     end
  1579.   end
  1580.   # ------------------------------------------
  1581.   # * update_command_status
  1582.   # ------------------------------------------
  1583.   def update_command_status
  1584.     if Input.press?(Input::F5)
  1585.       if @f3 == nil
  1586.       $game_system.se_play($data_system.decision_se)
  1587.       for i in 1..21
  1588.         Graphics.update
  1589.         @help_command.opacity -= 10
  1590.         @help_command.contents_opacity -= 10
  1591.         if i == 21
  1592.           @help_command.opacity = 0
  1593.           @help_command.contents_opacity = 0
  1594.         end
  1595.       end
  1596.       @f3 = true
  1597.       else
  1598.       for i in 1..21
  1599.         Graphics.update
  1600.         @help_command.opacity += 10
  1601.         @help_command.contents_opacity += 10
  1602.         if i == 21
  1603.           @help_command.opacity = 200
  1604.           @help_command.contents_opacity = 200
  1605.         end
  1606.       end
  1607.       @f3 = nil
  1608.       end
  1609.     end
  1610.     if Input.trigger?(Input::B)
  1611.       $game_system.se_play($data_system.cancel_se)
  1612.       @command_status.active = false
  1613.       @command_status.index = -1
  1614.       @command_status.visible = false
  1615.       @command_s.active = true
  1616.       @flash_viewport.flash(Color.new(255,255,255,255),20)
  1617.       for i in 1..22
  1618.         Graphics.update
  1619.         @flash_viewport.update
  1620.       end
  1621.     end
  1622.     if Input.trigger?(Input::C)
  1623.       $game_system.se_play($data_system.decision_se)
  1624.       case @command_status.index
  1625.       when 0
  1626.         if $game_temp.actors.size > 0
  1627.         @command_status.active = false
  1628.         @command_status.index = -1
  1629.         @command_status.visible = false
  1630.         @message.active = true
  1631.         @message.index = 0
  1632.         @help.visible = true if $game_temp.actors != []
  1633.         @help_command.visible = false
  1634.         @flash_viewport_4.flash(Color.new(255,255,255,255),20)
  1635.         for i in 1..22
  1636.           Graphics.update
  1637.           @flash_viewport_4.update
  1638.         end
  1639.         else
  1640.         $game_system.se_play($data_system.cancel_se)
  1641.         end
  1642.       when 1
  1643.         if $game_temp.actors_2.size > 0
  1644.         @command_status.active = false
  1645.         @command_status.index = -1
  1646.         @command_status.visible = false
  1647.         @message_2.active = true
  1648.         @message_2.index = 0
  1649.         @help.visible = true if $game_temp.actors_2 != []
  1650.         @help_command.visible = false
  1651.         @flash_viewport_5.flash(Color.new(255,255,255,255),20)
  1652.         for i in 1..22
  1653.           Graphics.update
  1654.           @flash_viewport_5.update
  1655.         end
  1656.         else
  1657.         $game_system.se_play($data_system.cancel_se)
  1658.         end
  1659.       end
  1660.     end
  1661.   end
  1662.   # ------------------------------------------
  1663.   # * update_command_canzhan
  1664.   # ------------------------------------------
  1665.   def update_command_canzhan
  1666.     if Input.trigger?(Input::B)
  1667.       $game_system.se_play($data_system.cancel_se)
  1668.       @command_canzhan.active = false
  1669.       @command_canzhan.index = -1
  1670.       @command_canzhan.visible = false
  1671.       @message.active = true
  1672.       @flash_viewport_4.flash(Color.new(255,255,255,255),20)
  1673.       for i in 1..22
  1674.         Graphics.update
  1675.         @flash_viewport_4.update
  1676.       end
  1677.     end
  1678.     if Input.trigger?(Input::C)
  1679.       $game_system.se_play($data_system.decision_se)
  1680.       case @command_canzhan.index
  1681.       when 0
  1682.       if $game_temp.actors.size > 0
  1683.       $game_temp.actors_2 << $game_temp.actors[@message.index]
  1684.       $game_party.remove_actor($game_temp.actors[@message.index].id)
  1685.       $game_temp.actors = []
  1686.       for i in 0...@@item.size
  1687.         if $game_party.actors.include?($game_actors[@@item[i][0]])
  1688.           $game_temp.actors << $game_actors[@@item[i][0]]
  1689.         end
  1690.       end
  1691.       @message.refresh
  1692.       @message_2.refresh
  1693.       @command_canzhan.active = false
  1694.       @command_canzhan.index = -1
  1695.       @command_canzhan.visible = false
  1696.       @message.active = true
  1697.       @flash_viewport_4.flash(Color.new(255,255,255,255),20)
  1698.       for i in 1..22
  1699.         Graphics.update
  1700.         @flash_viewport_4.update
  1701.       end
  1702.       else
  1703.       $game_system.se_play($data_system.cancel_se)
  1704.       end
  1705.       when 1
  1706.       @command_canzhan.active = false
  1707.       @command_canzhan.index = -1
  1708.       @command_canzhan.visible = false
  1709.       @message.active = true
  1710.       @flash_viewport_4.flash(Color.new(255,255,255,255),20)
  1711.       for i in 1..22
  1712.         Graphics.update
  1713.         @flash_viewport_4.update
  1714.       end
  1715.       end
  1716.     end
  1717.   end
  1718.   # ------------------------------------------
  1719.   # * update_message
  1720.   # ------------------------------------------
  1721.   def update_message
  1722.     if Input.trigger?(Input::B)
  1723.       $game_system.se_play($data_system.cancel_se)
  1724.       @message.active = false
  1725.       @message.index = -1
  1726.       @command_s.active = true
  1727.       @help.visible = false
  1728.       @help_command.visible = true
  1729.       @flash_viewport.flash(Color.new(255,255,255,255),20)
  1730.       for i in 1..22
  1731.         Graphics.update
  1732.         @flash_viewport.update
  1733.       end
  1734.     end
  1735.     if Input.trigger?(Input::C)
  1736.       $game_system.se_play($data_system.decision_se)
  1737.       if $game_temp.actors.size > 0
  1738.       @command_canzhan.active = true
  1739.       @command_canzhan.index = 0
  1740.       @command_canzhan.visible = true
  1741.       @message.active = false
  1742.       else
  1743.       $game_system.se_play($data_system.cancel_se)
  1744.       end
  1745.     end
  1746.   end
  1747.   # ------------------------------------------
  1748.   # * update_command_canzhan2
  1749.   # ------------------------------------------
  1750.   def update_command_canzhan2
  1751.     if Input.trigger?(Input::B)
  1752.       $game_system.se_play($data_system.cancel_se)
  1753.       @command_canzhan2.active = false
  1754.       @command_canzhan2.index = -1
  1755.       @command_canzhan2.visible = false
  1756.       @message_2.active = true
  1757.       @flash_viewport_5.flash(Color.new(255,255,255,255),20)
  1758.       for i in 1..22
  1759.         Graphics.update
  1760.         @flash_viewport_5.update
  1761.       end
  1762.     end
  1763.     if Input.trigger?(Input::C)
  1764.       $game_system.se_play($data_system.cancel_se)
  1765.       case @command_canzhan2.index
  1766.       when 0
  1767.       if $game_party.actors.size < 4
  1768.       $game_temp.actors << $game_temp.actors_2[@message_2.index]
  1769.       $game_party.add_actor($game_temp.actors_2[@message_2.index].id)
  1770.       $game_temp.actors_2.delete_at(@message_2.index)
  1771.       @message.refresh
  1772.       @message_2.refresh
  1773.       @command_canzhan2.active = false
  1774.       @command_canzhan2.index = -1
  1775.       @command_canzhan2.visible = false
  1776.       @message_2.active = true
  1777.       @flash_viewport_5.flash(Color.new(255,255,255,255),20)
  1778.       for i in 1..22
  1779.         Graphics.update
  1780.         @flash_viewport_5.update
  1781.       end
  1782.       else
  1783.       $game_system.se_play($data_system.cancel_se)
  1784.       end
  1785.       when 1
  1786.       $game_system.se_play($data_system.cancel_se)
  1787.       @command_canzhan2.active = false
  1788.       @command_canzhan2.index = -1
  1789.       @command_canzhan2.visible = false
  1790.       @message_2.active = true
  1791.       @flash_viewport_5.flash(Color.new(255,255,255,255),20)
  1792.       for i in 1..22
  1793.         Graphics.update
  1794.         @flash_viewport_5.update
  1795.       end
  1796.       end
  1797.     end
  1798.   end
  1799.   # ------------------------------------------
  1800.   # * update_message_2
  1801.   # ------------------------------------------
  1802.   def update_message_2
  1803.     if Input.trigger?(Input::B)
  1804.       $game_system.se_play($data_system.cancel_se)
  1805.       @message_2.active = false
  1806.       @message_2.index = -1
  1807.       @command_s.active = true
  1808.       @help.visible = false
  1809.       @help_command.visible = true
  1810.       @flash_viewport.flash(Color.new(255,255,255,255),20)
  1811.       for i in 1..22
  1812.         Graphics.update
  1813.         @flash_viewport.update
  1814.       end
  1815.     end
  1816.     if Input.trigger?(Input::C)
  1817.       $game_system.se_play($data_system.decision_se)
  1818.       if $game_temp.actors_2.size > 0
  1819.       @command_canzhan2.active = true
  1820.       @command_canzhan2.index = 0
  1821.       @command_canzhan2.visible = true
  1822.       @message_2.active = false
  1823.       else
  1824.       $game_system.se_play($data_system.cancel_se)
  1825.       end
  1826.     end
  1827.   end
  1828.   # ------------------------------------------
  1829.   # * update_command
  1830.   # ------------------------------------------
  1831.   def update_command
  1832.     if Input.press?(Input::F5)
  1833.       if @f7 == nil
  1834.       $game_system.se_play($data_system.decision_se)
  1835.       for i in 1..21
  1836.         Graphics.update
  1837.         @help.opacity -= 10
  1838.         @help.contents_opacity -= 10
  1839.         if i == 21
  1840.           @help.opacity = 0
  1841.           @help.contents_opacity = 0
  1842.         end
  1843.       end
  1844.       @f7 = true
  1845.       else
  1846.       for i in 1..21
  1847.         Graphics.update
  1848.         @help.opacity += 10
  1849.         @help.contents_opacity += 10
  1850.         if i == 21
  1851.           @help.opacity = 200
  1852.           @help.contents_opacity = 200
  1853.         end
  1854.       end
  1855.       @f7 = nil
  1856.       end
  1857.     end
  1858.     if Input.trigger?(Input::B)
  1859.       $game_system.se_play($data_system.cancel_se)
  1860.       @command.active = false
  1861.       @command.index = -1
  1862.       @command_s.active = true
  1863.       @help.visible = false
  1864.       @help_command.visible = true
  1865.       @flash_viewport.flash(Color.new(255,255,255,255),20)
  1866.       for i in 1..22
  1867.         Graphics.update
  1868.         @flash_viewport.update
  1869.       end
  1870.     end
  1871.     if Input.trigger?(Input::C)
  1872.       $game_system.se_play($data_system.decision_se)
  1873.       @command_c.active = true
  1874.       @command_c.visible = true
  1875.       @command_c.index = 0
  1876.       @command.active = false
  1877.       @tip_c.visible = true
  1878.       @tip_c.refresh($game_actors[@actor], @@item[@command.index][3])
  1879.       @flash_viewport_3.flash(Color.new(255,255,255,255),20)
  1880.       for i in 1..22
  1881.         Graphics.update
  1882.         @flash_viewport_3.update
  1883.       end
  1884.     end
  1885.   end
  1886.   # ------------------------------------------
  1887.   # * update_command_c
  1888.   # ------------------------------------------
  1889.   def update_command_c
  1890.     if Input.press?(Input::F5)
  1891.       if @f3 == nil
  1892.       $game_system.se_play($data_system.decision_se)
  1893.       for i in 1..21
  1894.         Graphics.update
  1895.         @help_command.opacity -= 10
  1896.         @help_command.contents_opacity -= 10
  1897.         if i == 21
  1898.           @help_command.opacity = 0
  1899.           @help_command.contents_opacity = 0
  1900.         end
  1901.       end
  1902.       @f3 = true
  1903.       else
  1904.       for i in 1..21
  1905.         Graphics.update
  1906.         @help_command.opacity += 10
  1907.         @help_command.contents_opacity += 10
  1908.         if i == 21
  1909.           @help_command.opacity = 200
  1910.           @help_command.contents_opacity = 200
  1911.         end
  1912.       end
  1913.       @f3 = nil
  1914.       end
  1915.     end
  1916.     if Input.trigger?(Input::B)
  1917.       $game_system.se_play($data_system.cancel_se)
  1918.       @command_c.active = false
  1919.       @command_c.visible = false
  1920.       @command_c.index = -1
  1921.       @tip_c.visible = false
  1922.       @command.active = true
  1923.       @help_command.visible = false
  1924.       @flash_viewport_2.flash(Color.new(255,255,255,255),20)
  1925.       @flash_viewport_2_2.flash(Color.new(255,255,255,255),20)
  1926.       for i in 1..22
  1927.         Graphics.update
  1928.         @flash_viewport_2.update
  1929.         @flash_viewport_2_2.update
  1930.       end
  1931.     end
  1932.     if Input.trigger?(Input::C)
  1933.       $game_system.se_play($data_system.decision_se)
  1934.       case @command_c.index
  1935.       when 0
  1936.       case @@item[@command.index][2]
  1937.       when 0
  1938.         if $game_temp.gold_bule >= @@item[@command.index][1]
  1939.           unless $game_party.actors.include?($game_actors[@actor]) or
  1940.             $game_temp.actors.include?($game_actors[@actor]) or
  1941.             $game_temp.actors_2.include?($game_actors[@actor])
  1942.           @buy = true
  1943.           $game_temp.gold_bule -= @@item[@command.index][1]
  1944.           @gold.refresh
  1945.           else
  1946.           $game_system.se_play($data_system.buzzer_se)
  1947.           end
  1948.         else
  1949.           @buy = false  
  1950.         end
  1951.       when 1
  1952.         if $game_temp.gold_red >= @@item[@command.index][1]
  1953.           unless $game_party.actors.include?($game_actors[@actor]) or
  1954.             $game_temp.actors.include?($game_actors[@actor]) or
  1955.             $game_temp.actors_2.include?($game_actors[@actor])
  1956.           @buy = true
  1957.           $game_temp.gold_red -= @@item[@command.index][1]
  1958.           @gold.refresh
  1959.           else
  1960.           $game_system.se_play($data_system.buzzer_se)
  1961.           end
  1962.         else
  1963.           @buy = false  
  1964.         end
  1965.       when 2
  1966.         if $game_temp.gold_yellow >= @@item[@command.index][1]
  1967.           unless $game_party.actors.include?($game_actors[@actor]) or
  1968.             $game_temp.actors.include?($game_actors[@actor]) or
  1969.             $game_temp.actors_2.include?($game_actors[@actor])
  1970.           @buy = true
  1971.           $game_temp.gold_yellow -= @@item[@command.index][1]
  1972.           @gold.refresh
  1973.           else
  1974.           $game_system.se_play($data_system.buzzer_se)
  1975.           end
  1976.         else
  1977.           @buy = false  
  1978.         end
  1979.       when 3
  1980.         if $game_temp.gold_green >= @@item[@command.index][1]
  1981.           unless $game_party.actors.include?($game_actors[@actor]) or
  1982.             $game_temp.actors.include?($game_actors[@actor]) or
  1983.             $game_temp.actors_2.include?($game_actors[@actor])
  1984.           @buy = true
  1985.           $game_temp.gold_green -= @@item[@command.index][1]
  1986.           @gold.refresh
  1987.           for i in 0...6
  1988.             Graphics.update
  1989.           end
  1990.           else
  1991.           $game_system.se_play($data_system.buzzer_se)
  1992.           end
  1993.         else
  1994.           @buy = false
  1995.         end
  1996.       end
  1997.       if @buy == true
  1998.       if $game_party.actors.size < 4
  1999.       unless $game_party.actors.include?($game_actors[@actor]) or
  2000.         $game_temp.actors.include?($game_actors[@actor]) or
  2001.         $game_temp.actors_2.include?($game_actors[@actor])
  2002.       $game_party.add_actor(@actor)
  2003.       $game_temp.actors << $game_actors[@actor]
  2004.       @message.refresh
  2005.       @tip = true
  2006.       else
  2007.       @tip = nil
  2008.       end
  2009.       else
  2010.       @tip = false
  2011.       end
  2012.       tip = Window_Base.new(150, 150, 340, 64)
  2013.       tip.z = 9999
  2014.       tip.opacity = 0
  2015.       tip.contents_opacity = 0
  2016.       tip.contents = Bitmap.new(tip.width - 32, tip.height - 32)
  2017.       tip.contents.font.color = text_color(@@item[@command.index][3])
  2018.       tip.contents.draw_text(
  2019.       40, 0, tip.width - 8, 32, $game_actors[@actor].name)
  2020.       cx = tip.contents.text_size($game_actors[@actor].name).width
  2021.       tip.contents.font.color = Color.new(255, 255, 255, 255)
  2022.       if @tip == true
  2023.       tip.contents.draw_text(
  2024.       40 + cx, 0, tip.width - 8, 32, "成功加入队伍")
  2025.       elsif @tip == false
  2026.       tip.contents.draw_text(
  2027.       40 + cx, 0, tip.width - 8, 32, "无法加入队伍")
  2028.       elsif @tip == nil
  2029.       tip.contents.draw_text(
  2030.       40 + cx, 0, tip.width - 8, 32, "已经在队伍中")
  2031.       end
  2032.       bitmap = RPG::Cache.character(
  2033.       $game_actors[@actor].character_name, $game_actors[@actor].character_hue)
  2034.       rect = Rect.new(0, 0, bitmap.width / 4, bitmap.height / 8)
  2035.       tip.contents.blt(0, 3, bitmap, rect)
  2036.       for i in 1..21
  2037.         Graphics.update
  2038.         tip.opacity += 10
  2039.         tip.contents_opacity += 10
  2040.         if i == 21
  2041.           tip.opacity = 200
  2042.           tip.contents_opacity = 200
  2043.         end
  2044.       end
  2045.       for i in 1..50
  2046.         Graphics.update
  2047.       end
  2048.       for i in 1..21
  2049.         Graphics.update
  2050.         tip.opacity -= 10
  2051.         tip.contents_opacity -= 10
  2052.         if i == 21
  2053.           tip.opacity = 0
  2054.           tip.contents_opacity = 0
  2055.         end
  2056.       end
  2057.       tip.dispose
  2058.       @command_c.active = false
  2059.       @command_c.visible = false
  2060.       @command_c.index = -1
  2061.       @command.active = true
  2062.       @tip_c.visible = false
  2063.       @help_command.visible = false
  2064.       @flash_viewport_2.flash(Color.new(255,255,255,255),20)
  2065.       @flash_viewport_2_2.flash(Color.new(255,255,255,255),20)
  2066.       for i in 1..22
  2067.         Graphics.update
  2068.         @flash_viewport_2.update
  2069.         @flash_viewport_2_2.update
  2070.       end
  2071.       else
  2072.       $game_system.se_play($data_system.buzzer_se)
  2073.       end
  2074.       when 1
  2075.       case @@item[@command.index][2]
  2076.       when 0
  2077.         if $game_temp.gold_bule >= @@item[@command.index][1]
  2078.           unless $game_party.actors.include?($game_actors[@actor]) or
  2079.            $game_temp.actors.include?($game_actors[@actor]) or
  2080.            $game_temp.actors_2.include?($game_actors[@actor])
  2081.           @buy = true
  2082.           $game_temp.gold_bule -= @@item[@command.index][1]
  2083.           @gold.refresh
  2084.           else
  2085.           $game_system.se_play($data_system.buzzer_se)
  2086.           end
  2087.         else
  2088.           @buy = false  
  2089.         end
  2090.       when 1
  2091.         if $game_temp.gold_red >= @@item[@command.index][1]
  2092.           unless $game_party.actors.include?($game_actors[@actor]) or
  2093.            $game_temp.actors.include?($game_actors[@actor]) or
  2094.            $game_temp.actors_2.include?($game_actors[@actor])
  2095.           @buy = true
  2096.           $game_temp.gold_red -= @@item[@command.index][1]
  2097.           @gold.refresh
  2098.           else
  2099.           $game_system.se_play($data_system.buzzer_se)
  2100.           end
  2101.         else
  2102.           @buy = false  
  2103.         end
  2104.       when 2
  2105.         if $game_temp.gold_yellow >= @@item[@command.index][1]
  2106.           unless $game_party.actors.include?($game_actors[@actor]) or
  2107.            $game_temp.actors.include?($game_actors[@actor]) or
  2108.            $game_temp.actors_2.include?($game_actors[@actor])
  2109.           @buy = true
  2110.           $game_temp.gold_yellow -= @@item[@command.index][1]
  2111.           @gold.refresh
  2112.           else
  2113.           $game_system.se_play($data_system.buzzer_se)
  2114.           end
  2115.         else
  2116.           @buy = false  
  2117.         end
  2118.       when 3
  2119.         if $game_temp.gold_green >= @@item[@command.index][1]
  2120.           unless $game_party.actors.include?($game_actors[@actor]) or
  2121.            $game_temp.actors.include?($game_actors[@actor]) or
  2122.            $game_temp.actors_2.include?($game_actors[@actor])
  2123.           @buy = true
  2124.           $game_temp.gold_green -= @@item[@command.index][1]
  2125.           @gold.refresh
  2126.           for i in 0...6
  2127.             Graphics.update
  2128.           end
  2129.           else
  2130.           $game_system.se_play($data_system.buzzer_se)
  2131.           end
  2132.         else
  2133.           @buy = false
  2134.         end
  2135.       end
  2136.       if @buy == true
  2137.       unless $game_party.actors.include?($game_actors[@actor]) or
  2138.            $game_temp.actors.include?($game_actors[@actor]) or
  2139.            $game_temp.actors_2.include?($game_actors[@actor])
  2140.       $game_temp.actors_2 << $game_actors[@actor]
  2141.       @message_2.refresh
  2142.       @tip = true
  2143.       else
  2144.       @tip = false
  2145.       end
  2146.       tip = Window_Base.new(150, 150, 340, 64)
  2147.       tip.z = 9999
  2148.       tip.opacity = 0
  2149.       tip.contents_opacity = 0
  2150.       tip.contents = Bitmap.new(tip.width - 32, tip.height - 32)
  2151.       tip.contents.font.color = text_color(@@item[@command.index][3])
  2152.       tip.contents.draw_text(
  2153.       40, 0, tip.width - 8, 32, $game_actors[@actor].name)
  2154.       cx = tip.contents.text_size($game_actors[@actor].name).width
  2155.       tip.contents.font.color = Color.new(255, 255, 255, 255)
  2156.       if @tip == true
  2157.       tip.contents.draw_text(
  2158.       40 + cx, 0, tip.width - 8, 32, "已经加入掠阵队伍")
  2159.       elsif @tip == false
  2160.       tip.contents.draw_text(
  2161.       40 + cx, 0, tip.width - 8, 32, "无法加入掠阵队伍")
  2162.       end
  2163.       bitmap = RPG::Cache.character(
  2164.       $game_actors[@actor].character_name, $game_actors[@actor].character_hue)
  2165.       rect = Rect.new(0, 0, bitmap.width / 4, bitmap.height / 8)
  2166.       tip.contents.blt(0, 3, bitmap, rect)
  2167.       for i in 1..21
  2168.         Graphics.update
  2169.         tip.opacity += 10
  2170.         tip.contents_opacity += 10
  2171.         if i == 21
  2172.           tip.opacity = 200
  2173.           tip.contents_opacity = 200
  2174.         end
  2175.       end
  2176.       for i in 1..50
  2177.         Graphics.update
  2178.       end
  2179.       for i in 1..21
  2180.         Graphics.update
  2181.         tip.opacity -= 10
  2182.         tip.contents_opacity -= 10
  2183.         if i == 21
  2184.           tip.opacity = 0
  2185.           tip.contents_opacity = 0
  2186.         end
  2187.       end
  2188.       tip.dispose
  2189.       @command_c.active = false
  2190.       @command_c.visible = false
  2191.       @command_c.index = -1
  2192.       @command.active = true
  2193.       @tip_c.visible = false
  2194.       @help_command.visible = false
  2195.       @flash_viewport_2.flash(Color.new(255,255,255,255),20)
  2196.       @flash_viewport_2_2.flash(Color.new(255,255,255,255),20)
  2197.       for i in 1..22
  2198.         Graphics.update
  2199.         @flash_viewport_2.update
  2200.         @flash_viewport_2_2.update
  2201.       end
  2202.       else
  2203.       $game_system.se_play($data_system.buzzer_se)
  2204.       end
  2205.       end
  2206.     end
  2207.   end
  2208.   # ------------------------------------------
  2209.   # * update_command_s
  2210.   # ------------------------------------------
  2211.   def update_command_s
  2212.     if Input.press?(Input::F5)
  2213.       if @f3 == nil
  2214.       $game_system.se_play($data_system.decision_se)
  2215.       for i in 1..21
  2216.         Graphics.update
  2217.         @help_command.opacity -= 10
  2218.         @help_command.contents_opacity -= 10
  2219.         if i == 21
  2220.           @help_command.opacity = 0
  2221.           @help_command.contents_opacity = 0
  2222.         end
  2223.       end
  2224.       @f3 = true
  2225.       else
  2226.       for i in 1..21
  2227.         Graphics.update
  2228.         @help_command.opacity += 10
  2229.         @help_command.contents_opacity += 10
  2230.         if i == 21
  2231.           @help_command.opacity = 200
  2232.           @help_command.contents_opacity = 200
  2233.         end
  2234.       end
  2235.       @f3 = nil
  2236.       end
  2237.     end
  2238.     if Input.trigger?(Input::B)
  2239.       $game_system.se_play($data_system.cancel_se)
  2240.       $scene = Scene_Map.new
  2241.     end
  2242.     if Input.trigger?(Input::C)
  2243.       $game_system.se_play($data_system.decision_se)
  2244.       case @command_s.index
  2245.       when 0
  2246.         if @@item.size > 0
  2247.         @help.visible = true
  2248.         @command_s.active = false
  2249.         @command.active = true
  2250.         @command.index = 0
  2251.         @help_command.visible = false
  2252.         @flash_viewport_2.flash(Color.new(255,255,255,255),20)
  2253.         @flash_viewport_2_2.flash(Color.new(255,255,255,255),20)
  2254.         for i in 1..22
  2255.           Graphics.update
  2256.           @flash_viewport_2.update
  2257.           @flash_viewport_2_2.update
  2258.         end
  2259.         else
  2260.         $game_system.se_play($data_system.cancel_se)
  2261.         end
  2262.       when 1
  2263.         @command_status.active = true
  2264.         @command_status.visible = true
  2265.         @command_status.index = 0
  2266.         @command_s.active = false
  2267.         @flash_viewport_6.flash(Color.new(255,255,255,255),20)
  2268.         for i in 1..22
  2269.           Graphics.update
  2270.           @flash_viewport_6.update
  2271.         end
  2272.       end
  2273.     end
  2274.   end
  2275. end

作者: cinderelmini    时间: 2016-12-5 21:55
游戏事件中用【脚本】功能输入:
  1. $game_temp.gold_bule += xxx  # 增加指定数值
  2. $game_temp.gold_bule = xxx  # 更改为指定数值
复制代码

red、yellow、green同理……




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