查看: 1824|回复: 4

[已经过期] 为什么横版战斗脚本和显示装备属性脚本放一起会出问题

[复制链接]
梦石
0
星屑
50
在线时间
19 小时
注册时间
2013-3-15
回帖
19
发表于 2014-11-19 05:04:23 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 RyanBern 于 2014-11-23 17:23 编辑

如题:
  1. #==============================================================================
  2. # 禾西製作 / Created by Quarcy
  3. #==============================================================================
  4. class Window_Help < Window_Base
  5.   attr_reader :materia
  6.   #--------------------------------------------------------------------------
  7.   # ● 定義不顯示的屬性與狀態
  8.   #--------------------------------------------------------------------------
  9.   def unshown
  10.     @unshow_elements = [17, 18]
  11.     @unshow_states = []
  12.   end
  13.   #--------------------------------------------------------------------------
  14.   # ● 初始化對象
  15.   #--------------------------------------------------------------------------
  16.   def initialize
  17.     super(0, 0, 640, 64)
  18.     self.opacity = 150
  19.     self.z=150
  20.     self.visible = false
  21.   end
  22.   #--------------------------------------------------------------------------
  23.   # ● 設置文本
  24.   #     data  : 窗口顯示的字符串/物品資料
  25.   #     align : 對齊方式 (0..左對齊、1..中間對齊、2..右對齊)
  26.   #--------------------------------------------------------------------------
  27.   def set_text(data, align=0)
  28.     #------------------------------------------------------------------------
  29.     # ● 當資料爲文字時候
  30.     #------------------------------------------------------------------------
  31.     # 如果文本或對齊方式至少一方与上次的不同
  32.     if data != @text or align != @align
  33.       if data.is_a?(String)
  34.         # 再描繪文本
  35.         self.width = 640
  36.         self.height = 64
  37.         self.x=0
  38.         self.y=0
  39.         self.contents = Bitmap.new(width - 32, height - 32) if self.contents.nil?
  40.         self.contents.clear
  41.         self.contents.font.color = normal_color
  42.         self.contents.font.size = 20
  43.         self.contents.draw_text(4, 0, self.width - 40, 32, data, align)
  44.         @text = data
  45.         @align = align
  46.         @actor = nil
  47.         self.visible = true
  48.       end
  49.     end
  50.     return if data.is_a?(String)
  51.     #------------------------------------------------------------------------
  52.     # ● 當沒有資料時候
  53.     #------------------------------------------------------------------------
  54.     if data.nil?
  55.       self.visible=false
  56.     else
  57.       self.visible=true
  58.     end
  59.     #------------------------------------------------------------------------
  60.     # ● 當資料爲物品/技能時候
  61.     #------------------------------------------------------------------------
  62.     if data != nil && @data != data
  63.       self.width = 210
  64.       self.height = 430
  65.       self.x=0
  66.       self.y=200
  67.       unshown
  68.       non_auto_update(data)
  69.     else
  70.       return
  71.     end
  72.   end
  73.   #--------------------------------------------------------------------------
  74.   # ● 更新帮助窗口
  75.   #--------------------------------------------------------------------------
  76.   def non_auto_update(data=@data)
  77.     @data = data
  78.     case @data
  79.     when RPG::Item
  80.       set_item_text(@data)
  81.     when RPG::Weapon
  82.       set_equipment_text(@data)
  83.     when RPG::Armor
  84.       set_equipment_text(@data)
  85.     when RPG::Skill
  86.       set_skill_text(@data)
  87.     end
  88.   end
  89.   #--------------------------------------------------------------------------
  90.   # ● 裝備帮助窗口
  91.   #--------------------------------------------------------------------------
  92.   def set_equipment_text(equipment)
  93.     #------------------------------------------------------------------------
  94.     # ● 取得基本質料
  95.     #------------------------------------------------------------------------
  96.     # 取得屬性、附加狀態、解除狀態之副本
  97.     case equipment
  98.     when RPG::Weapon
  99.       element_set = equipment.element_set.clone
  100.       plus_state_set = equipment.plus_state_set.clone
  101.       minus_state_set = equipment.minus_state_set.clone
  102.       #----------------------#
  103.       # 過濾不顯示的狀態描述 #
  104.       #----------------------#
  105.       plus_state_set -= @unshow_states
  106.       minus_state_set -= @unshow_states
  107.     when RPG::Armor
  108.       element_set = equipment.guard_element_set.clone
  109.       guard_state_set = equipment.guard_state_set.clone
  110.       #----------------------#
  111.       # 過濾不顯示的狀態描述 #
  112.       #----------------------#
  113.       auto_state_id = equipment.auto_state_id
  114.       guard_state_set -= @unshow_states
  115.     end
  116.     #----------------------#
  117.     # 過濾不顯示的屬性描述 #
  118.     #----------------------#
  119.     element_set -= @unshow_elements
  120.     #--------------#
  121.     # 取得說明文字 #
  122.     #--------------#
  123.     description = equipment.description.clone
  124.     # 初始化數據設定
  125.     x = 0
  126.     y = 0
  127.     h = 0
  128.     phrase = {}
  129.    
  130.     # 基本文字設定
  131.     phrase["price"] = "价格:"
  132.     phrase["elements"] = "属性:"
  133.     phrase["minus_states"] = "解除状态:"
  134.     phrase["plus_states"] = "附加状态:"
  135.     phrase["guard_elements"] = "防御属性"
  136.     phrase["guard_states"] = "防御状态"
  137.     phrase["auto_state"] = "自动状态"

  138.     # 基本數據設定
  139. =begin
  140.     name_size = 名字文字大小
  141.     size = 描述文字大小
  142.     word = 每行的描述文字數
  143.     move = 全體描述偏移幅度
  144. =end
  145.     name_size = 18
  146.     size = 14
  147.     word = 12
  148.     move = 80
  149.     #------------------------------------------------------------------------
  150.     # ● 確定背景圖片的高度
  151.     #------------------------------------------------------------------------
  152.     h += (description.size/3/word)
  153.     h += 1 if (description.size/3%word) > 0
  154.     h += 1 if equipment.is_a?(RPG::Weapon)
  155.     now_h = h
  156.     h += 1
  157.     h += 1 unless equipment.pdef.zero?
  158.     h += 1 unless equipment.mdef.zero?
  159.     h += 1 if element_set.size > 0
  160.     h += 1 if element_set.size >= 5
  161.     case equipment
  162.     when RPG::Weapon
  163.       h += 1 unless minus_state_set.empty?
  164.       h += minus_state_set.size
  165.       h += 1 unless plus_state_set.empty?
  166.       h += plus_state_set.size
  167.     when RPG::Armor
  168.       h += 1 unless guard_state_set.empty?
  169.       h += guard_state_set.size
  170.       h += 1 unless auto_state_id.zero?
  171.     end
  172.     h += 1
  173.     h += 1 unless equipment.str_plus.zero?
  174.     h += 1 unless equipment.dex_plus.zero?
  175.     h += 1 unless equipment.agi_plus.zero?
  176.     h += 1 unless equipment.int_plus.zero?
  177.     h += materia_height_plus(equipment) unless self.materia.nil?
  178.     #------------------------------------------------------------------------
  179.     # ● 圖片顯示保證高度
  180.     #------------------------------------------------------------------------
  181.     h = 6 + now_h if (h - now_h) < 6
  182.     #------------------------------------------------------------------------
  183.     # ● 換算高度
  184.     #------------------------------------------------------------------------
  185.     self.height = h * size + name_size + 32
  186.     #------------------------------------------------------------------------
  187.     # ● 生成背景
  188.     #------------------------------------------------------------------------
  189.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  190.     self.contents.clear
  191.     #------------------------------------------------------------------------
  192.     # ● 名字描繪
  193.     #------------------------------------------------------------------------
  194.     text = equipment.name
  195.     self.contents.font.color = draw_name_color(equipment)
  196.     self.contents.font.size = name_size
  197.     if text.nil?
  198.       self.visible = false
  199.     else
  200.       self.visible = true
  201.       self.contents.draw_text(0, 0, text.size*7, name_size, text, 0)
  202.     end
  203.     #------------------------------------------------------------------------
  204.     # ● 說明描繪
  205.     #------------------------------------------------------------------------
  206.     x = 0
  207.     y += 1
  208.     while ((text = description.slice!(/./m)) != nil)
  209.       self.contents.font.color = normal_color
  210.       self.contents.font.size = size
  211.       self.contents.draw_text(x*size, y*size+5, size, size, text, 0)
  212.       x+=1
  213.       if x == word
  214.         x=0
  215.         y+=1   
  216.       end
  217.     end
  218.     #------------------------------------------------------------------------
  219.     # ● 圖標描繪
  220.     #------------------------------------------------------------------------
  221.     bitmap = RPG::Cache.icon(equipment.icon_name)
  222.     opacity = self.contents.font.color == normal_color ? 255 : 128
  223.     self.contents.blt(0 ,y*size + 20, bitmap, Rect.new(0, 0, 95, 100), 225)
  224.   
  225.     #------------------------------------------------------------------------
  226.     # ● 攻擊力描繪(武器)
  227.     #------------------------------------------------------------------------
  228.     if equipment.is_a?(RPG::Weapon)
  229.       x = 0
  230.       y += 1
  231.       text = $data_system.words.atk+":"+equipment.atk.to_s
  232.       self.contents.font.color = normal_color
  233.       self.contents.font.size = size
  234.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  235.     end
  236.     #------------------------------------------------------------------------
  237.     # ● 價格描繪
  238.     #------------------------------------------------------------------------
  239.     x = 0
  240.     y += 1
  241.     text = phrase["price"] + equipment.price.to_s
  242.     self.contents.font.color = normal_color
  243.     self.contents.font.size = size
  244.     self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  245.     #------------------------------------------------------------------------
  246.     # ● 物理防禦
  247.     #------------------------------------------------------------------------
  248.     unless equipment.pdef.zero?
  249.       x = 0
  250.       y += 1
  251.       text = $data_system.words.pdef+":"+equipment.pdef.to_s
  252.       self.contents.font.color = normal_color
  253.       self.contents.font.size = size
  254.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  255.     end
  256.     #------------------------------------------------------------------------
  257.     # ● 魔法防禦
  258.     #------------------------------------------------------------------------
  259.     unless equipment.mdef.zero?
  260.       x = 0
  261.       y += 1
  262.       text=$data_system.words.mdef+":"+equipment.mdef.to_s
  263.       self.contents.font.color = normal_color
  264.       self.contents.font.size = size
  265.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  266.     end
  267.     #------------------------------------------------------------------------
  268.     # ● 屬性
  269.     #------------------------------------------------------------------------
  270.     if element_set.size > 0
  271.       x = 0
  272.       y += 1
  273.       text = phrase["elements"]
  274.       for i in 0...element_set.size
  275.         break if i > 4
  276.         text += $data_system.elements[element_set[i]]
  277.       end
  278.       self.contents.font.color = normal_color
  279.       self.contents.font.size = size
  280.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  281.     end
  282.     if element_set.size >= 5
  283.       x = (phrase["elements"].size)*5-4
  284.       y += 1
  285.       text = ""
  286.       for i in 4...element_set.size
  287.         text += $data_system.elements[element_set[i]]
  288.       end
  289.       self.contents.font.color = normal_color
  290.       self.contents.font.size = size
  291.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  292.     end
  293.     #------------------------------------------------------------------------
  294.     # ● 描述分流 武器/防具
  295.     #------------------------------------------------------------------------
  296.     case equipment
  297.     when RPG::Weapon
  298.       #------------------------------------------------------------------------
  299.       # ● 解除狀態(武器)
  300.       #------------------------------------------------------------------------
  301.       unless minus_state_set.empty?
  302.         x = 0
  303.         y += 1
  304.         text=phrase["minus_states"]
  305.         text=phrase["guard_states"]
  306.         self.contents.font.color = normal_color
  307.         self.contents.font.size = size
  308.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  309.         for i in 0...minus_state_set.size
  310.           y += 1
  311.           text = $data_states[minus_state_set[i]].name        
  312.           self.contents.font.color = normal_color
  313.           self.contents.font.size = size
  314.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  315.         end
  316.       end
  317.       #------------------------------------------------------------------------
  318.       # ● 附加狀態(武器)
  319.       #------------------------------------------------------------------------
  320.       unless plus_state_set.empty?
  321.         x = 0
  322.         y += 1
  323.         text = phrase["plus_states"]
  324.         self.contents.font.color = normal_color
  325.         self.contents.font.size = size
  326.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  327.         for i in 0...plus_state_set.size
  328.           y += 1
  329.           text=$data_states[plus_state_set[i]].name        
  330.           self.contents.font.color = normal_color
  331.           self.contents.font.size = size
  332.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  333.         end  
  334.       end
  335.     when RPG::Armor
  336.       #------------------------------------------------------------------------
  337.       # ● 防禦狀態(防具)
  338.       #------------------------------------------------------------------------
  339.       unless guard_state_set.empty?
  340.         x = 0
  341.         y += 1
  342.         text=phrase["guard_states"]
  343.         self.contents.font.color = normal_color
  344.         self.contents.font.size = size
  345.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  346.         for i in 0...guard_state_set.size
  347.           y += 1
  348.           text = $data_states[guard_state_set[i]].name        
  349.           self.contents.font.color = normal_color
  350.           self.contents.font.size = size
  351.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  352.         end
  353.       end
  354.       #------------------------------------------------------------------------
  355.       # ● 自動狀態(防具)
  356.       #------------------------------------------------------------------------
  357.       unless auto_state_id.zero?
  358.         x = 0
  359.         y += 1
  360.         text = phrase["auto_state"] + $data_states[auto_state_id].name
  361.         self.contents.font.color = normal_color
  362.         self.contents.font.size = size
  363.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  364.       end
  365.     end
  366.     #------------------------------------------------------------------------
  367.     # ● 空行
  368.     #------------------------------------------------------------------------
  369.     y+=1
  370.     #------------------------------------------------------------------------
  371.     # ● 力量
  372.     #------------------------------------------------------------------------
  373.     unless equipment.str_plus.zero?
  374.       x = 0
  375.       y += 1
  376.       h += 1
  377.       if equipment.str_plus > 0
  378.         text=$data_system.words.str+" +"+ equipment.str_plus.to_s
  379.       else
  380.         text=$data_system.words.str+" -"+ (-equipment.str_plus).to_s
  381.       end
  382.       self.contents.font.color = normal_color
  383.       self.contents.font.size = size
  384.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)  
  385.     end
  386.     #------------------------------------------------------------------------
  387.     # ● 靈巧
  388.     #------------------------------------------------------------------------
  389.     unless equipment.dex_plus.zero?
  390.       x = 0
  391.       y += 1
  392.       h += 1
  393.       if equipment.dex_plus > 0
  394.         text=$data_system.words.dex+" +"+ equipment.dex_plus.to_s
  395.       else
  396.         text=$data_system.words.dex+" -"+ (-equipment.dex_plus).to_s
  397.       end
  398.       self.contents.font.color = normal_color
  399.       self.contents.font.size = size
  400.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  401.     end
  402.     #------------------------------------------------------------------------
  403.     # ● 速度
  404.     #------------------------------------------------------------------------
  405.     unless equipment.agi_plus.zero?
  406.       x = 0
  407.       y += 1
  408.       h += 1
  409.       if equipment.agi_plus > 0
  410.         text=$data_system.words.agi+" +"+ equipment.agi_plus.to_s
  411.       else
  412.         text=$data_system.words.agi+" -"+ (-equipment.agi_plus).to_s
  413.       end
  414.       self.contents.font.color = normal_color
  415.       self.contents.font.size = size
  416.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  417.     end
  418.     #------------------------------------------------------------------------
  419.     # ● 智力
  420.     #------------------------------------------------------------------------
  421.     unless equipment.int_plus.zero?
  422.       x = 0
  423.       y += 1
  424.       h += 1
  425.       if equipment.int_plus > 0
  426.         text=$data_system.words.int+" +"+ equipment.int_plus.to_s
  427.       else
  428.         text=$data_system.words.int+" -"+ (-equipment.int_plus).to_s
  429.       end
  430.       self.contents.font.color = normal_color
  431.       self.contents.font.size = size
  432.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  433.     end
  434.     #------------------------------------------------------------------------
  435.     # ● 魔力石描繪
  436.     #------------------------------------------------------------------------
  437.     y += draw_materia(equipment, move, y, size) unless self.materia.nil?
  438.   end
  439.   #--------------------------------------------------------------------------
  440.   # ● 物品幫助窗口
  441.   #--------------------------------------------------------------------------
  442.   def set_item_text(item)
  443.     # 取得描述
  444.     description = item.description.clone
  445.     # 取得屬性、附加狀態、解除狀態之副本
  446.     element_set = item.element_set.clone
  447.     plus_state_set = item.plus_state_set.clone
  448.     minus_state_set = item.minus_state_set.clone
  449.     # 過濾不顯示的描述
  450.     element_set -= @unshow_elements
  451.     plus_state_set -= @unshow_states
  452.     minus_state_set -= @unshow_states
  453.     # 初始化數據設定
  454.     x = 0
  455.     y = 0
  456.     h = 0
  457.     phrase = {}
  458.     scope ={}
  459.     parameter_type = {}
  460.    
  461.     # 基本數據設定
  462. =begin
  463.     name_size = 名字文字大小
  464.     size = 描述文字大小
  465.     word = 每行的描述文字數
  466.     move = 全體描述偏移幅度
  467. =end
  468.     name_size = 18
  469.     size = 14
  470.     word = 12
  471.     move = 80
  472.    
  473.     # 基本文字設定
  474.     phrase["scope"] = "范围:"
  475.     phrase["price"] = "价格:"
  476.     phrase["recover_hp_rate"] = "HP 回复率:"
  477.     phrase["recover_hp"] = "HP 回复量:"
  478.     phrase["recover_sp_rate"] = "SP 回复率:"
  479.     phrase["recover_sp"] = "SP 回复量:"
  480.     phrase["elements"] = "属性:"
  481.     phrase["plus"] = "附加"
  482.     phrase["minus"] = "解除"
  483.     phrase["states"] = "状态"
  484.     scope[0] = "特殊物品"
  485.     scope[1] = "特殊物品"
  486.     scope[2] = "敌单体"
  487.     scope[3] = "敌全体"
  488.     scope[4] = "己方单体"
  489.     scope[5] = "己方全体"
  490.     scope[6] = "己方昏死单体"
  491.     scope[7] = "己方昏死全体"
  492.     scope[8] = "使用者"

  493.     parameter_type[1] = "MaxHP"
  494.     parameter_type[2] = "MaxSP"
  495.     parameter_type[3] = $data_system.words.str
  496.     parameter_type[4] = $data_system.words.dex
  497.     parameter_type[5] = $data_system.words.agi
  498.     parameter_type[6] = $data_system.words.int
  499.    
  500.     #依顯示内容確定自身高
  501.     h = (description.size/3/word)
  502.     h +=1 if (description.size/3%word)> 0
  503.     now_h = h
  504.     h +=3  # 空行,效果範圍,價格
  505.     h += 1 unless item.recover_hp_rate.zero?
  506.     h += 1 unless item.recover_hp.zero?
  507.     h += 1 unless item.recover_sp_rate.zero?
  508.     h += 1 unless item.recover_sp.zero?
  509.     h += 1 unless item.parameter_type.zero?
  510.     h += 1 unless element_set[0].nil?
  511.     h += 1 unless element_set[4].nil?
  512.     h += (1+plus_state_set.size) unless plus_state_set.empty?
  513.     h += (1+minus_state_set.size) unless minus_state_set.empty?
  514.     #------------------------------------------------------------------------
  515.     # ● 圖片顯示保證高度
  516.     #------------------------------------------------------------------------
  517.     h = 6 + now_h if (h - now_h) < 6
  518.     #------------------------------------------------------------------------
  519.     # ● 換算高度
  520.     #------------------------------------------------------------------------
  521.     self.height = h * size + name_size + 32
  522.     #------------------------------------------------------------------------
  523.     # ● 生成背景
  524.     #------------------------------------------------------------------------
  525.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  526.     self.contents.clear
  527.     #------------------------------------------------------------------------
  528.     # ● 名字描繪
  529.     #------------------------------------------------------------------------
  530.     text = item.name
  531.     self.contents.font.color = normal_color#顔色腳本
  532.     self.contents.font.size = name_size
  533.     if text.nil?
  534.       self.visible = false
  535.     else
  536.       self.visible = true
  537.       self.contents.draw_text(0,0, text.size*7, 20, text, 0)
  538.     end
  539.     #------------------------------------------------------------------------
  540.     # ● 說明描繪
  541.     #------------------------------------------------------------------------
  542.     x = 0
  543.     y += 1
  544.     while ((text = description.slice!(/./m)) != nil)
  545.       self.contents.font.color = normal_color
  546.       self.contents.font.size = size
  547.       self.contents.draw_text(x*size, y*size+5, size, size, text, 0)
  548.       x+=1
  549.       if x == word
  550.         x = 0
  551.         y += 1
  552.       end
  553.     end
  554.     #------------------------------------------------------------------------
  555.     # ● 圖標描繪
  556.     #------------------------------------------------------------------------
  557.     bitmap = RPG::Cache.icon(item.icon_name) unless item.icon_name.nil?
  558.     opacity = self.contents.font.color == normal_color ? 255 : 128
  559.     self.contents.blt(0 ,y*size + 20, bitmap, Rect.new(0, 0, 95, 100), 225)
  560.     #------------------------------------------------------------------------
  561.     # ● 魔力石接口
  562.     #------------------------------------------------------------------------
  563.     unless self.materia.nil?
  564.       return if is_materia?(item)
  565.     end
  566.     #------------------------------------------------------------------------
  567.     # ● 效果範圍
  568.     #------------------------------------------------------------------------
  569.     text= phrase["scope"] + scope[item.scope]
  570.     x = 0
  571.     y += 1
  572.     self.contents.font.color = normal_color
  573.     self.contents.font.size = size
  574.     self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  575.     #------------------------------------------------------------------------
  576.     # ● 價格
  577.     #------------------------------------------------------------------------
  578.     x = 0
  579.     y += 1      
  580.     text = phrase["price"] + item.price.to_s
  581.     self.contents.font.color = normal_color
  582.     self.contents.font.size = size
  583.     self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  584.    
  585.     #------------------------------------------------------------------------
  586.     # ● HP回復率
  587.     #------------------------------------------------------------------------
  588.     unless item.recover_hp_rate.zero?  
  589.       x = 0
  590.       y += 1
  591.       text = phrase["recover_hp_rate"] + item.recover_hp_rate.to_s+"%"
  592.       self.contents.font.color = normal_color
  593.       self.contents.font.size = size
  594.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)   
  595.     end
  596.     #------------------------------------------------------------------------
  597.     # ● HP回復量
  598.     #------------------------------------------------------------------------
  599.     unless item.recover_hp.zero?  
  600.       x = 0
  601.       y += 1      
  602.       text = phrase["recover_hp"] + item.recover_hp.to_s
  603.       self.contents.font.color = normal_color
  604.       self.contents.font.size = size
  605.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  606.     end
  607.     #------------------------------------------------------------------------
  608.     # ● SP回復率
  609.     #------------------------------------------------------------------------
  610.     unless item.recover_sp_rate.zero?
  611.       x = 0
  612.       y += 1      
  613.       text = phrase["recover_sp_rate"] + item.recover_sp_rate.to_s+"%"
  614.       self.contents.font.color = normal_color
  615.       self.contents.font.size = size
  616.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  617.     end
  618.     #------------------------------------------------------------------------
  619.     # ● SP回復量
  620.     #------------------------------------------------------------------------
  621.     unless item.recover_sp.zero?  
  622.       x = 0
  623.       y += 1      
  624.       text = phrase["elements"] + item.recover_sp.to_s
  625.       self.contents.font.color = normal_color
  626.       self.contents.font.size = size
  627.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  628.     end
  629.     #------------------------------------------------------------------------
  630.     # ● 能力值增加
  631.     #------------------------------------------------------------------------
  632.     unless item.parameter_type.zero?
  633.       x = 0
  634.       y += 1      
  635.       text= parameter_type[item.parameter_type]+" +"+item.parameter_points.to_s

  636.       self.contents.font.color = normal_color
  637.       self.contents.font.size = size
  638.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  639.     end
  640.     #------------------------------------------------------------------------
  641.     # ● 屬性
  642.     #------------------------------------------------------------------------
  643.     if element_set.size > 0
  644.       x = 0
  645.       y += 1
  646.       text = phrase["elements"]
  647.       for i in 0...element_set.size
  648.         break if i > 4
  649.         text += $data_system.elements[element_set[i]]
  650.       end
  651.       self.contents.font.color = normal_color
  652.       self.contents.font.size = size
  653.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  654.     end
  655.     if element_set.size >= 5
  656.       x = (phrase["elements"].size)*5-4
  657.       y += 1
  658.       text = ""
  659.       for i in 4...element_set.size
  660.         text += $data_system.elements[element_set[i]]
  661.       end
  662.       self.contents.font.color = normal_color
  663.       self.contents.font.size = size
  664.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  665.     end
  666.     #------------------------------------------------------------------------
  667.     # ● 狀態添加
  668.     #------------------------------------------------------------------------
  669.     unless plus_state_set.empty?
  670.       text = phrase["plus"]
  671.       x = 0
  672.       y += 1
  673.       self.contents.font.color = normal_color
  674.       self.contents.font.size = size
  675.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  676.       plus_state_set.each do |plus_state|
  677.         y += 1
  678.         text = $data_states[plus_state].name        
  679.         self.contents.font.color = normal_color
  680.         self.contents.font.size = size
  681.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)      
  682.       end  
  683.     end
  684.     #------------------------------------------------------------------------
  685.     # ● 狀態解除
  686.     #------------------------------------------------------------------------
  687.     unless minus_state_set.empty?
  688.       text = phrase["minus"]
  689.       x = 0
  690.       y += 1
  691.       self.contents.font.color = normal_color
  692.       self.contents.font.size = size
  693.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  694.       minus_state_set.each do |minus_state|
  695.         y += 1
  696.         text = $data_states[minus_state].name
  697.         self.contents.font.color = normal_color
  698.         self.contents.font.size = size
  699.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)   
  700.       end
  701.     end
  702.   end
  703.   #--------------------------------------------------------------------------
  704.   # ● 技能帮助窗口
  705.   #--------------------------------------------------------------------------
  706.   def set_skill_text(skill)
  707.     # 取得描述
  708.     description = skill.description.clone
  709.     # 取得屬性、附加狀態、解除狀態之副本
  710.     element_set = skill.element_set.clone
  711.     plus_state_set = skill.plus_state_set.clone
  712.     minus_state_set = skill.minus_state_set.clone
  713.     # 過濾不顯示的描述
  714.     element_set -= @unshow_elements
  715.     plus_state_set -= @unshow_states
  716.     minus_state_set -= @unshow_states
  717.     # 初始化設定
  718.     x = 0
  719.     y = 0
  720.     h = 0
  721.     phrase = {}
  722.     scope = {}
  723.    
  724.     # 基本數據設定
  725. =begin
  726.     name_size = 名字文字大小
  727.     size = 描述文字大小
  728.     word = 每行的描述文字數
  729.     move = 全體描述偏移幅度
  730. =end
  731.     name_size = 18
  732.     size = 14
  733.     word = 12
  734.     move = 80
  735.    
  736.     # 基本文字設定
  737.     phrase["scope"] = "范围:"
  738.     #
  739.     phrase["power"] = "威力:"
  740.     phrase["cost_sp"] = "消耗SP:"
  741.     phrase["hit_rate"] = "命中率:"
  742.     phrase["elements"] = "攻击属性"
  743.     #
  744.     phrase["plus"] = "附加"
  745.     phrase["minus"] = "解除"
  746.     phrase["states"] = "状态"
  747.     scope[0] = "特殊技能"
  748.     scope[1] = "敌单体"
  749.     scope[2] = "敌全体"
  750.     scope[3] = "我方单体"
  751.     scope[4] = "我方全体"
  752.     scope[5] = "我方昏死(单体)"
  753.     scope[6] = "我方昏死(全体)"
  754.     scope[7] = "自身"

  755.    
  756.     #由描叙确定高
  757.     h =description.size/3/word
  758.     h += 1 if (description.size%3/word) > 0
  759.     h += 4  #空行,效果范围,消费SP,命中率
  760.     h += 1 unless skill.power.zero?
  761.     h += 1 unless element_set.empty?
  762.     h += 1 unless element_set[4].nil?
  763.     h += plus_state_set.size
  764.     h += minus_state_set.size
  765.     #------------------------------------------------------------------------
  766.     # ● 換算高度
  767.     #------------------------------------------------------------------------
  768.     self.height=h * size + name_size + 32  
  769.     self.contents = Bitmap.new(self.width - 32,self.height - 32)
  770.     self.contents.clear
  771.    
  772.     #------------------------------------------------------------------------
  773.     # ● 名字描述
  774.     #------------------------------------------------------------------------
  775.     text = skill.name
  776.     self.contents.font.color = Color.new(255, 255, 128, 255)
  777.     self.contents.font.size = name_size
  778.     if text!=nil
  779.       self.visible = true
  780.       self.contents.draw_text(0,0, text.size*7, name_size, text, 0)
  781.     else
  782.       self.visible = false
  783.     end
  784.    
  785.     #------------------------------------------------------------------------
  786.     # ● 說明描述
  787.     #------------------------------------------------------------------------
  788.     x = 0
  789.     y += 1
  790.     text = description
  791.     while ((text = description.slice!(/./m)) != nil)
  792.       self.contents.font.color = normal_color
  793.       self.contents.font.size = size
  794.       self.contents.draw_text(x*size, y*size+5, size, size, text, 0)
  795.       x+=1
  796.       if x==word#每行10个字
  797.         x = 0
  798.         y += 1      
  799.       end
  800.     end
  801.    
  802.     #------------------------------------------------------------------------
  803.     # ● 攻擊範圍
  804.     #------------------------------------------------------------------------
  805.     text = phrase["scope"] + scope[skill.scope]
  806.     x = 0
  807.     y += 1
  808.     self.contents.font.color = normal_color
  809.     self.contents.font.size = size
  810.     self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  811.     #------------------------------------------------------------------------
  812.     # ● 空一行
  813.     #------------------------------------------------------------------------
  814.     y += 1
  815.     #------------------------------------------------------------------------
  816.     # ● 威力描述
  817.     #------------------------------------------------------------------------
  818.     unless skill.power.zero?
  819.       power = skill.power > 0 ? skill.power : -1 * skill.power
  820.       text = phrase["power"] + power.to_s
  821.       x = 0
  822.       y += 1
  823.       self.contents.font.color = normal_color
  824.       self.contents.font.size = size  
  825.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  826.     end  
  827.     #------------------------------------------------------------------------
  828.     # ● 消費SP描述
  829.     #------------------------------------------------------------------------
  830.     text = phrase["cost_sp"] + skill.sp_cost.to_s
  831.     x = 0
  832.     y += 1
  833.     self.contents.font.color = normal_color
  834.     self.contents.font.size = size   
  835.     self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  836.     #------------------------------------------------------------------------
  837.     # ● 命中率描述
  838.     #------------------------------------------------------------------------
  839.     text = phrase["hit_rate"] + skill.hit.to_s + "%"
  840.     x = 0
  841.     y += 1
  842.     self.contents.font.color = normal_color
  843.     self.contents.font.size = size
  844.     self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  845.     #------------------------------------------------------------------------
  846.     # ● 攻擊屬性
  847.     #------------------------------------------------------------------------
  848.     if element_set.size > 0
  849.       text=phrase["elements"]
  850.       for i in 0...element_set.size
  851.         if i < 4
  852.           text+=$data_system.elements[element_set[i]]
  853.         else
  854.           break
  855.         end        
  856.       end
  857.       x = 0
  858.       y += 1
  859.       self.contents.font.color = normal_color
  860.       self.contents.font.size = size
  861.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  862.     end
  863.     if element_set.size >= 5
  864.       text=""
  865.       for i in 4...element_set.size
  866.         text+=$data_system.elements[element_set[i]]
  867.       end
  868.       x= (phrase["elements"].size)*3
  869.       y += 1
  870.       self.contents.font.color = normal_color
  871.       self.contents.font.size = size
  872.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  873.     end
  874.     #------------------------------------------------------------------------
  875.     # ● 狀態附加
  876.     #------------------------------------------------------------------------
  877.     unless plus_state_set.empty?
  878.       text= phrase["plus"]
  879.       x = 0
  880.       y += 1
  881.       self.contents.font.color = normal_color
  882.       self.contents.font.size = size
  883.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  884.       plus_state_set.each do |plus_state|
  885.         y += 1
  886.         text=$data_states[plus_state].name        
  887.         self.contents.font.color = normal_color
  888.         self.contents.font.size = size
  889.         self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)        
  890.       end  
  891.     end
  892.     #------------------------------------------------------------------------
  893.     # ●狀態解除
  894.     #------------------------------------------------------------------------
  895.     unless minus_state_set.empty?
  896.       text = phrase["minus"]
  897.       x = 0
  898.       y += 1
  899.       self.contents.font.color = normal_color
  900.       self.contents.font.size=size
  901.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  902.       minus_state_set.each do |minus_state|
  903.         y += 1
  904.         text=$data_states[minus_state].name        
  905.         self.contents.font.color = normal_color
  906.         self.contents.font.size=size
  907.         self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)        
  908.       end  
  909.     end     
  910.   end
  911.   #--------------------------------------------------------------------------
  912.   # ● 设置角色
  913.   #     actor : 要显示状态的角色
  914.   #--------------------------------------------------------------------------
  915.   def set_actor(actor)
  916.     if actor != @actor
  917.       self.contents.clear
  918.       draw_actor_name(actor, 4, 0)
  919.       draw_actor_state(actor, 140, 0)
  920.       draw_actor_hp(actor, 284, 0)
  921.       draw_actor_sp(actor, 460, 0)
  922.       @actor = actor
  923.       @text = nil
  924.       self.visible = true
  925.     end
  926.   end
  927.   #--------------------------------------------------------------------------
  928.   # ● 設置角色
  929.   #     actor : 要顯示狀態之角色
  930.   #--------------------------------------------------------------------------
  931.   def set_actor(actor)
  932.     self.contents = Bitmap.new(width - 32, height - 32) if self.contents.nil?
  933.     if actor != @actor
  934.       self.contents.clear
  935.       draw_actor_name(actor, 4, 0)
  936.       draw_actor_state(actor, 140, 0)
  937.       draw_actor_hp(actor, 284, 0)
  938.       draw_actor_sp(actor, 460, 0)
  939.       @actor = actor
  940.       @text = nil
  941.       self.visible = true
  942.     end
  943.   end
  944.   #--------------------------------------------------------------------------
  945.   # ● 設置敵人
  946.   #     enemy : 要顯示名字與狀態之敵人
  947.   #--------------------------------------------------------------------------
  948.   def set_enemy(enemy)
  949.     self.contents = Bitmap.new(width - 32, height - 32) if self.contents.nil?
  950.     text = enemy.name.sub(/\[Ff][([0-9]+)]/) {""}
  951.     state_text = make_battler_state_text(enemy, 112, false)
  952.     if state_text != ""
  953.       text += "  " + state_text
  954.     end
  955.     set_text(text, 1)
  956.     self.visible = true
  957.   end
  958.   #--------------------------------------------------------------------------
  959.   # ● 校正帮助窗口位置
  960.   #--------------------------------------------------------------------------
  961.   def set_pos(x,y,width,oy,index,column_max)
  962.     #光标坐标
  963.     cursor_width = width / column_max - 32
  964.     xx = index % column_max * (cursor_width + 32)
  965.     yy = index / column_max * 32 - oy
  966.     self.x=xx+x+150
  967.     self.y=yy+y+30
  968.     if self.x+self.width>640
  969.       self.x=640-self.width
  970.     end
  971.     if self.y+self.height>480
  972.       self.y=480-self.height
  973.     end  
  974.   end
  975.   #------------------------------------------------------------------------
  976.   # ● 裝備名字顔色變化 接口
  977.   #------------------------------------------------------------------------
  978.   def draw_name_color(equipment)
  979.     return normal_color
  980.   end
  981.   #------------------------------------------------------------------------
  982.   # ● 自身身份確認
  983.   #------------------------------------------------------------------------
  984.   def original_help?
  985.     return false
  986.   end
  987. end

  988. #------------------------------------------------------------------------------



  989. #------------------------------------------------------------------------------
  990. #==============================================================================
  991. # ■ Window_Item
  992. #------------------------------------------------------------------------------
  993. #  物品画面、战斗画面、显示浏览物品的窗口。
  994. #==============================================================================

  995. class Window_Item < Window_Selectable
  996.   #--------------------------------------------------------------------------
  997.   # ● 初始化对像
  998.   #--------------------------------------------------------------------------
  999.   def initialize
  1000.     super(0, 64-64, 640, 416+64)
  1001.     @column_max = 2
  1002.     refresh
  1003.     self.index = 0
  1004.     # 战斗中的情况下将窗口移至中央并将其半透明化
  1005.     if $game_temp.in_battle
  1006.       self.y = 64
  1007.       self.height = 256
  1008.       self.back_opacity = 160
  1009.     end
  1010.   end
  1011.   #--------------------------------------------------------------------------
  1012.   # ● 刷新帮助文本
  1013.   #--------------------------------------------------------------------------
  1014.   def update_help
  1015.     @help_window.set_text(item)
  1016.     #校正帮助窗口位置
  1017.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  1018.   end
  1019. end
  1020. #------------------------------------------------------------------------------



  1021. #------------------------------------------------------------------------------
  1022. #==============================================================================
  1023. # ■ Window_Skill
  1024. #------------------------------------------------------------------------------
  1025. #  特技画面、战斗画面、显示可以使用的特技浏览的窗口。
  1026. #==============================================================================

  1027. class Window_Skill < Window_Selectable
  1028.   #--------------------------------------------------------------------------
  1029.   # ● 初始化对像
  1030.   #     actor : 角色
  1031.   #--------------------------------------------------------------------------
  1032.   def initialize(actor)
  1033.     super(0, 128, 640, 352)
  1034.     @actor = actor
  1035.     @column_max = 2
  1036.    
  1037.     refresh
  1038.     self.index = 0
  1039.     # 战斗中的情况下将窗口移至中央并将其半透明化
  1040.     if $game_temp.in_battle
  1041.       self.y = 64
  1042.       self.height = 256
  1043.       self.back_opacity = 160
  1044.     end
  1045.   end
  1046.   #--------------------------------------------------------------------------
  1047.   # ● 刷新帮助文本
  1048.   #--------------------------------------------------------------------------

  1049.   def update_help
  1050.     @help_window.set_text(skill)
  1051.     #校正帮助窗口位置
  1052.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  1053.   end
  1054. end
  1055. #------------------------------------------------------------------------------



  1056. #------------------------------------------------------------------------------
  1057. #==============================================================================
  1058. # ■ Window_SkillStatus
  1059. #------------------------------------------------------------------------------
  1060. #  显示特技画面、特技使用者的窗口。
  1061. #==============================================================================

  1062. class Window_SkillStatus < Window_Base
  1063.   #--------------------------------------------------------------------------
  1064.   # ● 初始化对像
  1065.   #     actor : 角色
  1066.   #--------------------------------------------------------------------------
  1067.   def initialize(actor)
  1068. # -------------------
  1069. # 修改開始
  1070.     super(0, 64-64, 640, 64+64)#★★★★★★★★★★★★★★★★★★★★
  1071. # 修改終了
  1072. # -------------------
  1073.     self.contents = Bitmap.new(width - 32, height - 32)
  1074.     @actor = actor
  1075.     refresh
  1076.   end
  1077. end
  1078. #------------------------------------------------------------------------------



  1079. #------------------------------------------------------------------------------
  1080. #==============================================================================
  1081. # ■ Window_EquipLeft
  1082. #------------------------------------------------------------------------------
  1083. #  装备画面的、显示角色能力值变化的窗口。
  1084. #==============================================================================
  1085. class Window_EquipLeft < Window_Base
  1086.   #--------------------------------------------------------------------------
  1087.   # ● 初始化对像
  1088.   #     actor : 角色
  1089.   #--------------------------------------------------------------------------
  1090.   def initialize(actor)
  1091. # -------------------
  1092. # 修改開始
  1093.     super(0, 64-64, 272, 416+64)#★★★★★★★★★★★★★★★★★★★★
  1094. # 修改終了
  1095. # -------------------
  1096.     self.contents = Bitmap.new(width - 32, height - 32)
  1097.     @actor = actor
  1098.     refresh
  1099.   end
  1100. end
  1101. #------------------------------------------------------------------------------



  1102. #------------------------------------------------------------------------------
  1103. #==============================================================================
  1104. # ■ Window_EquipRight
  1105. #------------------------------------------------------------------------------
  1106. #  装备画面、显示角色现在装备的物品的窗口。
  1107. #==============================================================================

  1108. class Window_EquipRight < Window_Selectable
  1109.   #--------------------------------------------------------------------------
  1110.   # ● 初始化对像
  1111.   #     actor : 角色
  1112.   #--------------------------------------------------------------------------
  1113.   def initialize(actor)
  1114. # -------------------
  1115. # 修改開始
  1116.     super(272, 64-64, 368, 256+64)#★★★★★★★★★★★★★★★★★★★★
  1117. # 修改終了
  1118. # -------------------
  1119.     self.contents = Bitmap.new(width - 32, height - 32)
  1120.     @actor = actor
  1121.     refresh
  1122.     self.index = 0
  1123.   end
  1124.   #--------------------------------------------------------------------------
  1125.   # ● 刷新帮助文本
  1126.   #--------------------------------------------------------------------------

  1127.   def update_help
  1128.     @help_window.set_text(item)
  1129.     #校正帮助窗口位置
  1130.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  1131.   end
  1132. end
  1133. #------------------------------------------------------------------------------



  1134. #------------------------------------------------------------------------------
  1135. #==============================================================================
  1136. # ■ Window_EquipItem
  1137. #------------------------------------------------------------------------------
  1138. #  装备画面、显示浏览变更装备的候补物品的窗口。
  1139. #==============================================================================

  1140. class Window_EquipItem < Window_Selectable
  1141.   #--------------------------------------------------------------------------
  1142.   # ● 初始化对像
  1143.   #     actor      : 角色
  1144.   #     equip_type : 装备部位 (0~3)
  1145.   #--------------------------------------------------------------------------
  1146.   def initialize(actor, equip_type)
  1147. # -------------------
  1148. # 修改開始
  1149.     super(272, 320, 368, 160)#★★★★★★★★★★★★★★★★★★★★
  1150. # 修改終了
  1151. # -------------------
  1152.     @actor = actor
  1153.     @equip_type = equip_type
  1154.     @column_max = 1
  1155.    
  1156.     refresh
  1157.     self.active = false
  1158.     self.index = -1
  1159.   end
  1160.   def update_help
  1161.     @help_window.set_text(item)
  1162.     #校正帮助窗口位置
  1163.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  1164.   end
  1165. end
  1166. #------------------------------------------------------------------------------



  1167. #------------------------------------------------------------------------------
  1168. #==============================================================================
  1169. # ■ Window_ShopCommand
  1170. #------------------------------------------------------------------------------
  1171. #  商店画面、选择要做的事的窗口
  1172. #==============================================================================

  1173. class Window_ShopCommand < Window_Selectable
  1174.   #--------------------------------------------------------------------------
  1175.   # ● 初始化对像
  1176.   #--------------------------------------------------------------------------
  1177.   def initialize
  1178. # -------------------
  1179. # 修改開始
  1180.     super(0, 64-64, 480, 64)#★★★★★★★★★★★★★★★★★
  1181. # 修改終了
  1182. # -------------------
  1183.     self.contents = Bitmap.new(width - 32, height - 32)
  1184.     @item_max = 3
  1185.     @column_max = 3
  1186.     @commands = ["买", "卖", "取消"]
  1187.     refresh
  1188.     self.index = 0
  1189.   end
  1190. end
  1191. #------------------------------------------------------------------------------



  1192. #------------------------------------------------------------------------------
  1193. #========================================================================================================================
  1194. # ■ Window_ShopBuy
  1195. #------------------------------------------------------------------------------
  1196. #  商店画面、浏览显示可以购买的商品的窗口。
  1197. #==============================================================================

  1198. class Window_ShopBuy < Window_Selectable
  1199.   #--------------------------------------------------------------------------
  1200.   # ● 初始化对像
  1201.   #     shop_goods : 商品
  1202.   #--------------------------------------------------------------------------
  1203.   def initialize(shop_goods)
  1204. # -------------------
  1205. # 修改開始
  1206.     super(0, 128-64, 368, 352+64)#★★★★★★★★★★★★★★★★
  1207. # 修改終了
  1208. # -------------------
  1209.     @shop_goods = shop_goods
  1210.    
  1211.     refresh
  1212.     self.index = 0
  1213.   end
  1214.   #--------------------------------------------------------------------------
  1215.   # ● 刷新帮助文本
  1216.   #--------------------------------------------------------------------------

  1217.   def update_help
  1218.     @help_window.set_text(item)
  1219.     #校正帮助窗口位置
  1220.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  1221.   end
  1222. end
  1223. #------------------------------------------------------------------------------



  1224. #------------------------------------------------------------------------------
  1225. #==============================================================================
  1226. # ■ Window_ShopSell
  1227. #------------------------------------------------------------------------------
  1228. #  商店画面、浏览显示可以卖掉的商品的窗口。
  1229. #==============================================================================

  1230. class Window_ShopSell < Window_Selectable
  1231.   #--------------------------------------------------------------------------
  1232.   # ● 初始化对像
  1233.   #--------------------------------------------------------------------------
  1234.   def initialize
  1235. # -------------------
  1236. # 修改開始
  1237.     super(0, 128-64, 640, 352+64)#★★★★★★★★★★★★★★★★
  1238. # 修改終了
  1239. # -------------------
  1240.     @column_max = 2
  1241.    
  1242.     refresh
  1243.     self.index = 0
  1244.   end
  1245.   #--------------------------------------------------------------------------
  1246.   # ● 刷新帮助文本
  1247.   #--------------------------------------------------------------------------

  1248.   def update_help
  1249.     @help_window.set_text(item)
  1250.     #校正帮助窗口位置
  1251.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  1252.   end
  1253. end
  1254. #------------------------------------------------------------------------------



  1255. #------------------------------------------------------------------------------
  1256. #==============================================================================
  1257. # ■ Window_ShopNumber
  1258. #------------------------------------------------------------------------------
  1259. #  商店画面、输入买卖数量的窗口。
  1260. #==============================================================================
  1261. class Window_ShopNumber < Window_Base
  1262.   #--------------------------------------------------------------------------
  1263.   # ● 初始化对像
  1264.   #--------------------------------------------------------------------------
  1265.   def initialize
  1266. # -------------------
  1267. # 修改開始
  1268.     super(0, 128-64, 368, 352+64)#★★★★★★★★★★★★★★★★
  1269. # 修改終了
  1270. # -------------------
  1271.     self.contents = Bitmap.new(width - 32, height - 32)
  1272.     @item = nil
  1273.     [url=home.php?mod=space&uid=25307]@Max[/url] = 1
  1274.     @price = 0
  1275.     @number = 1
  1276.   end
  1277. end
  1278. #------------------------------------------------------------------------------



  1279. #------------------------------------------------------------------------------
  1280. #==============================================================================
  1281. # ■ Window_ShopStatus
  1282. #------------------------------------------------------------------------------
  1283. #  商店画面、显示物品所持数与角色装备的窗口。
  1284. #==============================================================================

  1285. class Window_ShopStatus < Window_Base
  1286.   #--------------------------------------------------------------------------
  1287.   # ● 初始化对像
  1288.   #--------------------------------------------------------------------------
  1289.   def initialize
  1290. # -------------------
  1291. # 修改開始
  1292.     super(368, 128-64, 272, 352+64)#★★★★★★★★★★★★
  1293. # 修改終了
  1294. # -------------------
  1295.     self.contents = Bitmap.new(width - 32, height - 32)
  1296.     @item = nil
  1297.     refresh
  1298.   end
  1299. end
  1300. #------------------------------------------------------------------------------



  1301. #------------------------------------------------------------------------------
  1302. #==============================================================================
  1303. # ■ Scene_Equip
  1304. #------------------------------------------------------------------------------
  1305. #  处理装备画面的类。
  1306. #==============================================================================

  1307. class Scene_Equip
  1308.   #--------------------------------------------------------------------------
  1309.   # ● 刷新画面 (右侧窗口被激活的情况下)
  1310.   #--------------------------------------------------------------------------
  1311.   def update_right
  1312. # -------------------
  1313. # 修改開始
  1314.     if @right_window.item==nil
  1315.         @help_window.visible=false
  1316.     else
  1317.         @help_window.visible=true
  1318.     end
  1319. # 修改終了
  1320. # -------------------
  1321.     # 按下 B 键的情况下
  1322.     if Input.trigger?(Input::B)
  1323.       # 演奏取消 SE
  1324.       $game_system.se_play($data_system.cancel_se)
  1325.       # 切换到菜单画面
  1326.       $scene = Scene_Menu.new(2)
  1327.       return
  1328.     end
  1329.     # 按下 C 键的情况下
  1330.     if Input.trigger?(Input::C)
  1331.       # 固定装备的情况下
  1332.       if @actor.equip_fix?(@right_window.index)
  1333.         # 演奏冻结 SE
  1334.         $game_system.se_play($data_system.buzzer_se)
  1335.         return
  1336.       end
  1337.       # 演奏确定 SE
  1338.       $game_system.se_play($data_system.decision_se)
  1339.       # 激活物品窗口
  1340.       @right_window.active = false
  1341.       @item_window.active = true
  1342.       @item_window.index = 0
  1343.       return
  1344.     end
  1345.     # 按下 R 键的情况下
  1346.     if Input.trigger?(Input::R)
  1347.       # 演奏光标 SE
  1348.       $game_system.se_play($data_system.cursor_se)
  1349.       # 移至下一位角色
  1350.       @actor_index += 1
  1351.       @actor_index %= $game_party.actors.size
  1352.       # 切换到别的装备画面
  1353.       $scene = Scene_Equip.new(@actor_index, @right_window.index)
  1354.       return
  1355.     end
  1356.     # 按下 L 键的情况下
  1357.     if Input.trigger?(Input::L)
  1358.       # 演奏光标 SE
  1359.       $game_system.se_play($data_system.cursor_se)
  1360.       # 移至上一位角色
  1361.       @actor_index += $game_party.actors.size - 1
  1362.       @actor_index %= $game_party.actors.size
  1363.       # 切换到别的装备画面
  1364.       $scene = Scene_Equip.new(@actor_index, @right_window.index)
  1365.       return
  1366.     end
  1367.   end
  1368.   #--------------------------------------------------------------------------
  1369.   # ● 刷新画面 (物品窗口被激活的情况下)
  1370.   #--------------------------------------------------------------------------
  1371.   def update_item
  1372. # -------------------
  1373. # 修改開始
  1374.     if @item_window.item==nil
  1375.         @help_window.visible=false
  1376.     else
  1377.         @help_window.visible=true
  1378.     end
  1379. # 修改終了
  1380. # -------------------
  1381.     # 按下 B 键的情况下
  1382.     if Input.trigger?(Input::B)
  1383.       # 演奏取消 SE
  1384.       $game_system.se_play($data_system.cancel_se)
  1385.       # 激活右侧窗口
  1386.       @right_window.active = true
  1387.       @item_window.active = false
  1388.       @item_window.index = -1
  1389.       return
  1390.     end
  1391.     # 按下 C 键的情况下
  1392.     if Input.trigger?(Input::C)
  1393.       # 演奏装备 SE
  1394.       $game_system.se_play($data_system.equip_se)
  1395.       # 获取物品窗口现在选择的装备数据
  1396.       item = @item_window.item
  1397.       # 变更装备
  1398.       @actor.equip(@right_window.index, item == nil ? 0 : item.id)
  1399.       # 激活右侧窗口
  1400.       @right_window.active = true
  1401.       @item_window.active = false
  1402.       @item_window.index = -1
  1403.       # 再生成右侧窗口、物品窗口的内容
  1404.       @right_window.refresh
  1405.       @item_window.refresh
  1406.       return
  1407.     end
  1408.   end
  1409. end
  1410. #------------------------------------------------------------------------------



  1411. #------------------------------------------------------------------------------
  1412. #========================================================================================================================
  1413. # ■ Scene_Battle (分割定义 3)
  1414. #------------------------------------------------------------------------------
  1415. #  处理战斗画面的类。
  1416. #========================================================================================================================

  1417. class Scene_Battle
  1418.   #--------------------------------------------------------------------------
  1419.   # ● 刷新画面 (角色命令回合 : 选择特技)
  1420.   #--------------------------------------------------------------------------
  1421.   alias first_reupdate_phase3_skill_select update_phase3_skill_select
  1422.   def update_phase3_skill_select
  1423. # -------------------
  1424. # 修改開始
  1425.     @skill_window.help_window.visible = false#★★★★★★★★★★★★★
  1426. # 修改終了
  1427. # -------------------
  1428.     first_reupdate_phase3_skill_select
  1429.   end
  1430.   #--------------------------------------------------------------------------
  1431.   # ● 刷新画面 (角色命令回合 : 选择物品)
  1432.   #--------------------------------------------------------------------------
  1433.   alias first_reupdate_phase3_item_select update_phase3_item_select  
  1434.   def update_phase3_item_select
  1435. # -------------------
  1436. # 修改開始
  1437.     @item_window.help_window.visible = false#★★★★★★★★★★★★
  1438. # 修改終了
  1439. # -------------------
  1440.     first_reupdate_phase3_item_select
  1441.   end
  1442.   #--------------------------------------------------------------------------
  1443.   # ● 开始选择特技
  1444.   #--------------------------------------------------------------------------
  1445.   def start_skill_select
  1446.     @skill_window = Window_Skill.new(@active_battler)
  1447.     @skill_window.help_window = Window_Help.new
  1448.     @actor_command_window.active = false
  1449.     @actor_command_window.visible = false
  1450.   end
  1451.   #--------------------------------------------------------------------------
  1452.   # ● 选择特技结束
  1453.   #--------------------------------------------------------------------------
  1454.   alias first_update_end_skill_select end_skill_select  
  1455.   def end_skill_select
  1456. # -------------------
  1457. # 修改開始
  1458.     @skill_window.help_window.visible = false#★★★★★★★★★★★★
  1459. # 修改終了
  1460. # -------------------
  1461.     first_update_end_skill_select
  1462.   end
  1463.   #--------------------------------------------------------------------------
  1464.   # ● 开始选择物品
  1465.   #--------------------------------------------------------------------------
  1466.   def start_item_select
  1467.     # 生成物品窗口
  1468.     @item_window = Window_Item.new
  1469.     # 关联帮助窗口
  1470. # -------------------
  1471. # 修改開始
  1472.     @item_window.help_window =  Window_Help.new#★★★★★★★★★★★★
  1473. # 修改終了
  1474. # -------------------
  1475.     # 无效化角色指令窗口
  1476.     @actor_command_window.active = false
  1477.     @actor_command_window.visible = false
  1478.   end
  1479.   #--------------------------------------------------------------------------
  1480.   # ● 结束选择物品
  1481.   #--------------------------------------------------------------------------
  1482.   alias first_update_end_item_select end_item_select
  1483.   def end_item_select
  1484. # -------------------
  1485. # 修改開始
  1486.     @item_window.help_window.visible = false#★★★★★★★★★★★★
  1487. # 修改終了
  1488. # -------------------
  1489.     first_update_end_item_select
  1490.   end
  1491. end
  1492. #------------------------------------------------------------------------------



  1493. #------------------------------------------------------------------------------
  1494. #==============================================================================
  1495. # ■ Scene_Shop
  1496. #------------------------------------------------------------------------------
  1497. #  处理商店画面的类。
  1498. #==============================================================================

  1499. class Scene_Shop
  1500.   #--------------------------------------------------------------------------
  1501.   # ● 主处理
  1502.   #--------------------------------------------------------------------------
  1503. # --------------------
  1504. # 衝突可能
  1505.   def main
  1506.     # 生成帮助窗口
  1507. # -------------------
  1508. # 修改開始
  1509.     @help_window = Window_Help.new#★★★★★★★★★★★★★★★★
  1510. # 修改終了
  1511. # -------------------
  1512.     # 生成指令窗口
  1513.     @command_window = Window_ShopCommand.new
  1514.     # 生成金钱窗口
  1515.     @gold_window = Window_Gold.new
  1516.     @gold_window.x = 480
  1517. # -------------------
  1518. # 修改開始
  1519.     @gold_window.y = 64-64#★★★★★★★★★★★★★
  1520. # 修改終了
  1521. # -------------------
  1522.     # 生成时间窗口
  1523. # -------------------
  1524. # 修改開始
  1525.     @dummy_window = Window_Base.new(0, 128-64, 640, 352+64)#★★★★★★★★★★★★★
  1526. # 修改終了
  1527. # -------------------
  1528.     # 生成购买窗口
  1529.     @buy_window = Window_ShopBuy.new($game_temp.shop_goods)
  1530.     @buy_window.active = false
  1531.     @buy_window.visible = false
  1532.     @buy_window.help_window = @help_window
  1533.     # 生成卖出窗口
  1534.     @sell_window = Window_ShopSell.new
  1535.     @sell_window.active = false
  1536.     @sell_window.visible = false
  1537.     @sell_window.help_window = @help_window
  1538.     # 生成数量输入窗口
  1539.     @number_window = Window_ShopNumber.new
  1540.     @number_window.active = false
  1541.     @number_window.visible = false
  1542.     # 生成状态窗口
  1543.     @status_window = Window_ShopStatus.new
  1544.     @status_window.visible = false
  1545.     # 执行过渡
  1546.     Graphics.transition
  1547.     # 主循环
  1548.     loop do
  1549.       # 刷新游戏画面
  1550.       Graphics.update
  1551.       # 刷新输入信息
  1552.       Input.update
  1553.       # 刷新画面
  1554.       update
  1555.       # 如果画面切换的话就中断循环
  1556.       if $scene != self
  1557.         break
  1558.       end
  1559.     end
  1560.     # 准备过渡
  1561.     Graphics.freeze
  1562.     # 释放窗口
  1563.     @help_window.dispose
  1564.     @command_window.dispose
  1565.     @gold_window.dispose
  1566.     @dummy_window.dispose
  1567.     @buy_window.dispose
  1568.     @sell_window.dispose
  1569.     @number_window.dispose
  1570.     @status_window.dispose
  1571.   end
  1572.   #--------------------------------------------------------------------------
  1573.   # ● 刷新画面
  1574.   #--------------------------------------------------------------------------
  1575. # --------------------
  1576. # 衝突可能
  1577.   def update
  1578.     # 刷新窗口
  1579.     @help_window.update
  1580.     @command_window.update
  1581.     @gold_window.update
  1582.     @dummy_window.update
  1583.     @buy_window.update
  1584.     @sell_window.update
  1585.     @number_window.update
  1586.     @status_window.update
  1587.     # 指令窗口激活的情况下: 调用 update_command
  1588.     if @command_window.active
  1589. # -------------------
  1590. # 修改開始
  1591.       @help_window.visible=false#★★★★★★★★★★★★★★★★
  1592. # 修改終了
  1593. # -------------------
  1594.       update_command
  1595.       return
  1596.     end
  1597.     # 购买窗口激活的情况下: 调用 update_buy
  1598.     if @buy_window.active
  1599. # -------------------
  1600. # 修改開始
  1601.       @help_window.visible=true#★★★★★★★★★★★★★★★★
  1602.       if @buy_window.item==nil#★★★★★★★★★★★★★★★★
  1603.         @help_window.visible=false#★★★★★★★★★★★★★★★★
  1604.       end #★★★★★★★★★★★★★★★★     
  1605. # 修改終了
  1606. # -------------------
  1607.       update_buy
  1608.       return
  1609.     end
  1610.     # 卖出窗口激活的情况下: 调用 update_sell
  1611.     if @sell_window.active
  1612. # -------------------
  1613. # 修改開始
  1614.       @help_window.visible=true#★★★★★★★★★★★★★★★★
  1615.       if @sell_window.item==nil#★★★★★★★★★★★★★★★★
  1616.         @help_window.visible=false#★★★★★★★★★★★★★★★★
  1617.       end #★★★★★★★★★★★★★★★★
  1618. # 修改終了
  1619. # -------------------      
  1620.       update_sell
  1621.       return
  1622.     end
  1623.     # 个数输入窗口激活的情况下: 调用 update_number
  1624.     if @number_window.active
  1625. # -------------------
  1626. # 修改開始
  1627.       @help_window.visible=false#★★★★★★★★★★★★★★★★
  1628. # 修改終了
  1629. # -------------------
  1630.       update_number
  1631.       return
  1632.     end
  1633.   end
  1634. end
  1635. #==============================================================================
  1636. # 禾西製作 / Created by Quarcy
  1637. #==============================================================================
  1638. class Window_Help < Window_Base
  1639.   attr_reader :materia
  1640.   #--------------------------------------------------------------------------
  1641.   # ● 定義不顯示的屬性與狀態
  1642.   #--------------------------------------------------------------------------
  1643.   def unshown
  1644.     @unshow_elements = [17, 18]
  1645.     @unshow_states = []
  1646.   end
  1647.   #--------------------------------------------------------------------------
  1648.   # ● 初始化對象
  1649.   #--------------------------------------------------------------------------
  1650.   def initialize
  1651.     super(0, 0, 640, 64)
  1652.     self.opacity = 150
  1653.     self.z=150
  1654.     self.visible = false
  1655.   end
  1656.   #--------------------------------------------------------------------------
  1657.   # ● 設置文本
  1658.   #     data  : 窗口顯示的字符串/物品資料
  1659.   #     align : 對齊方式 (0..左對齊、1..中間對齊、2..右對齊)
  1660.   #--------------------------------------------------------------------------
  1661.   def set_text(data, align=0)
  1662.     #------------------------------------------------------------------------
  1663.     # ● 當資料爲文字時候
  1664.     #------------------------------------------------------------------------
  1665.     # 如果文本或對齊方式至少一方与上次的不同
  1666.     if data != @text or align != @align
  1667.       if data.is_a?(String)
  1668.         # 再描繪文本
  1669.         self.width = 640
  1670.         self.height = 64
  1671.         self.x=0
  1672.         self.y=0
  1673.         self.contents = Bitmap.new(width - 32, height - 32) if self.contents.nil?
  1674.         self.contents.clear
  1675.         self.contents.font.color = normal_color
  1676.         self.contents.font.size = 20
  1677.         self.contents.draw_text(4, 0, self.width - 40, 32, data, align)
  1678.         @text = data
  1679.         @align = align
  1680.         @actor = nil
  1681.         self.visible = true
  1682.       end
  1683.     end
  1684.     return if data.is_a?(String)
  1685.     #------------------------------------------------------------------------
  1686.     # ● 當沒有資料時候
  1687.     #------------------------------------------------------------------------
  1688.     if data.nil?
  1689.       self.visible=false
  1690.     else
  1691.       self.visible=true
  1692.     end
  1693.     #------------------------------------------------------------------------
  1694.     # ● 當資料爲物品/技能時候
  1695.     #------------------------------------------------------------------------
  1696.     if data != nil && @data != data
  1697.       self.width = 210
  1698.       self.height = 430
  1699.       self.x=0
  1700.       self.y=200
  1701.       unshown
  1702.       non_auto_update(data)
  1703.     else
  1704.       return
  1705.     end
  1706.   end
  1707.   #--------------------------------------------------------------------------
  1708.   # ● 更新帮助窗口
  1709.   #--------------------------------------------------------------------------
  1710.   def non_auto_update(data=@data)
  1711.     @data = data
  1712.     case @data
  1713.     when RPG::Item
  1714.       set_item_text(@data)
  1715.     when RPG::Weapon
  1716.       set_equipment_text(@data)
  1717.     when RPG::Armor
  1718.       set_equipment_text(@data)
  1719.     when RPG::Skill
  1720.       set_skill_text(@data)
  1721.     end
  1722.   end
  1723.   #--------------------------------------------------------------------------
  1724.   # ● 裝備帮助窗口
  1725.   #--------------------------------------------------------------------------
  1726.   def set_equipment_text(equipment)
  1727.     #------------------------------------------------------------------------
  1728.     # ● 取得基本質料
  1729.     #------------------------------------------------------------------------
  1730.     # 取得屬性、附加狀態、解除狀態之副本
  1731.     case equipment
  1732.     when RPG::Weapon
  1733.       element_set = equipment.element_set.clone
  1734.       plus_state_set = equipment.plus_state_set.clone
  1735.       minus_state_set = equipment.minus_state_set.clone
  1736.       #----------------------#
  1737.       # 過濾不顯示的狀態描述 #
  1738.       #----------------------#
  1739.       plus_state_set -= @unshow_states
  1740.       minus_state_set -= @unshow_states
  1741.     when RPG::Armor
  1742.       element_set = equipment.guard_element_set.clone
  1743.       guard_state_set = equipment.guard_state_set.clone
  1744.       #----------------------#
  1745.       # 過濾不顯示的狀態描述 #
  1746.       #----------------------#
  1747.       auto_state_id = equipment.auto_state_id
  1748.       guard_state_set -= @unshow_states
  1749.     end
  1750.     #----------------------#
  1751.     # 過濾不顯示的屬性描述 #
  1752.     #----------------------#
  1753.     element_set -= @unshow_elements
  1754.     #--------------#
  1755.     # 取得說明文字 #
  1756.     #--------------#
  1757.     description = equipment.description.clone
  1758.     # 初始化數據設定
  1759.     x = 0
  1760.     y = 0
  1761.     h = 0
  1762.     phrase = {}
  1763.    
  1764.     # 基本文字設定
  1765.     phrase["price"] = "价格:"
  1766.     phrase["elements"] = "属性:"
  1767.     phrase["minus_states"] = "解除状态:"
  1768.     phrase["plus_states"] = "附加状态:"
  1769.     phrase["guard_elements"] = "防御属性"
  1770.     phrase["guard_states"] = "防御状态"
  1771.     phrase["auto_state"] = "自动状态"

  1772.     # 基本數據設定
  1773. =begin
  1774.     name_size = 名字文字大小
  1775.     size = 描述文字大小
  1776.     word = 每行的描述文字數
  1777.     move = 全體描述偏移幅度
  1778. =end
  1779.     name_size = 18
  1780.     size = 14
  1781.     word = 12
  1782.     move = 80
  1783.     #------------------------------------------------------------------------
  1784.     # ● 確定背景圖片的高度
  1785.     #------------------------------------------------------------------------
  1786.     h += (description.size/3/word)
  1787.     h += 1 if (description.size/3%word) > 0
  1788.     h += 1 if equipment.is_a?(RPG::Weapon)
  1789.     now_h = h
  1790.     h += 1
  1791.     h += 1 unless equipment.pdef.zero?
  1792.     h += 1 unless equipment.mdef.zero?
  1793.     h += 1 if element_set.size > 0
  1794.     h += 1 if element_set.size >= 5
  1795.     case equipment
  1796.     when RPG::Weapon
  1797.       h += 1 unless minus_state_set.empty?
  1798.       h += minus_state_set.size
  1799.       h += 1 unless plus_state_set.empty?
  1800.       h += plus_state_set.size
  1801.     when RPG::Armor
  1802.       h += 1 unless guard_state_set.empty?
  1803.       h += guard_state_set.size
  1804.       h += 1 unless auto_state_id.zero?
  1805.     end
  1806.     h += 1
  1807.     h += 1 unless equipment.str_plus.zero?
  1808.     h += 1 unless equipment.dex_plus.zero?
  1809.     h += 1 unless equipment.agi_plus.zero?
  1810.     h += 1 unless equipment.int_plus.zero?
  1811.     h += materia_height_plus(equipment) unless self.materia.nil?
  1812.     #------------------------------------------------------------------------
  1813.     # ● 圖片顯示保證高度
  1814.     #------------------------------------------------------------------------
  1815.     h = 6 + now_h if (h - now_h) < 6
  1816.     #------------------------------------------------------------------------
  1817.     # ● 換算高度
  1818.     #------------------------------------------------------------------------
  1819.     self.height = h * size + name_size + 32
  1820.     #------------------------------------------------------------------------
  1821.     # ● 生成背景
  1822.     #------------------------------------------------------------------------
  1823.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  1824.     self.contents.clear
  1825.     #------------------------------------------------------------------------
  1826.     # ● 名字描繪
  1827.     #------------------------------------------------------------------------
  1828.     text = equipment.name
  1829.     self.contents.font.color = draw_name_color(equipment)
  1830.     self.contents.font.size = name_size
  1831.     if text.nil?
  1832.       self.visible = false
  1833.     else
  1834.       self.visible = true
  1835.       self.contents.draw_text(0, 0, text.size*7, name_size, text, 0)
  1836.     end
  1837.     #------------------------------------------------------------------------
  1838.     # ● 說明描繪
  1839.     #------------------------------------------------------------------------
  1840.     x = 0
  1841.     y += 1
  1842.     while ((text = description.slice!(/./m)) != nil)
  1843.       self.contents.font.color = normal_color
  1844.       self.contents.font.size = size
  1845.       self.contents.draw_text(x*size, y*size+5, size, size, text, 0)
  1846.       x+=1
  1847.       if x == word
  1848.         x=0
  1849.         y+=1   
  1850.       end
  1851.     end
  1852.     #------------------------------------------------------------------------
  1853.     # ● 圖標描繪
  1854.     #------------------------------------------------------------------------
  1855.     bitmap = RPG::Cache.icon(equipment.icon_name)
  1856.     opacity = self.contents.font.color == normal_color ? 255 : 128
  1857.     self.contents.blt(0 ,y*size + 20, bitmap, Rect.new(0, 0, 95, 100), 225)
  1858.   
  1859.     #------------------------------------------------------------------------
  1860.     # ● 攻擊力描繪(武器)
  1861.     #------------------------------------------------------------------------
  1862.     if equipment.is_a?(RPG::Weapon)
  1863.       x = 0
  1864.       y += 1
  1865.       text = $data_system.words.atk+":"+equipment.atk.to_s
  1866.       self.contents.font.color = normal_color
  1867.       self.contents.font.size = size
  1868.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  1869.     end
  1870.     #------------------------------------------------------------------------
  1871.     # ● 價格描繪
  1872.     #------------------------------------------------------------------------
  1873.     x = 0
  1874.     y += 1
  1875.     text = phrase["price"] + equipment.price.to_s
  1876.     self.contents.font.color = normal_color
  1877.     self.contents.font.size = size
  1878.     self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  1879.     #------------------------------------------------------------------------
  1880.     # ● 物理防禦
  1881.     #------------------------------------------------------------------------
  1882.     unless equipment.pdef.zero?
  1883.       x = 0
  1884.       y += 1
  1885.       text = $data_system.words.pdef+":"+equipment.pdef.to_s
  1886.       self.contents.font.color = normal_color
  1887.       self.contents.font.size = size
  1888.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  1889.     end
  1890.     #------------------------------------------------------------------------
  1891.     # ● 魔法防禦
  1892.     #------------------------------------------------------------------------
  1893.     unless equipment.mdef.zero?
  1894.       x = 0
  1895.       y += 1
  1896.       text=$data_system.words.mdef+":"+equipment.mdef.to_s
  1897.       self.contents.font.color = normal_color
  1898.       self.contents.font.size = size
  1899.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  1900.     end
  1901.     #------------------------------------------------------------------------
  1902.     # ● 屬性
  1903.     #------------------------------------------------------------------------
  1904.     if element_set.size > 0
  1905.       x = 0
  1906.       y += 1
  1907.       text = phrase["elements"]
  1908.       for i in 0...element_set.size
  1909.         break if i > 4
  1910.         text += $data_system.elements[element_set[i]]
  1911.       end
  1912.       self.contents.font.color = normal_color
  1913.       self.contents.font.size = size
  1914.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  1915.     end
  1916.     if element_set.size >= 5
  1917.       x = (phrase["elements"].size)*5-4
  1918.       y += 1
  1919.       text = ""
  1920.       for i in 4...element_set.size
  1921.         text += $data_system.elements[element_set[i]]
  1922.       end
  1923.       self.contents.font.color = normal_color
  1924.       self.contents.font.size = size
  1925.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  1926.     end
  1927.     #------------------------------------------------------------------------
  1928.     # ● 描述分流 武器/防具
  1929.     #------------------------------------------------------------------------
  1930.     case equipment
  1931.     when RPG::Weapon
  1932.       #------------------------------------------------------------------------
  1933.       # ● 解除狀態(武器)
  1934.       #------------------------------------------------------------------------
  1935.       unless minus_state_set.empty?
  1936.         x = 0
  1937.         y += 1
  1938.         text=phrase["minus_states"]
  1939.         text=phrase["guard_states"]
  1940.         self.contents.font.color = normal_color
  1941.         self.contents.font.size = size
  1942.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  1943.         for i in 0...minus_state_set.size
  1944.           y += 1
  1945.           text = $data_states[minus_state_set[i]].name        
  1946.           self.contents.font.color = normal_color
  1947.           self.contents.font.size = size
  1948.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  1949.         end
  1950.       end
  1951.       #------------------------------------------------------------------------
  1952.       # ● 附加狀態(武器)
  1953.       #------------------------------------------------------------------------
  1954.       unless plus_state_set.empty?
  1955.         x = 0
  1956.         y += 1
  1957.         text = phrase["plus_states"]
  1958.         self.contents.font.color = normal_color
  1959.         self.contents.font.size = size
  1960.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  1961.         for i in 0...plus_state_set.size
  1962.           y += 1
  1963.           text=$data_states[plus_state_set[i]].name        
  1964.           self.contents.font.color = normal_color
  1965.           self.contents.font.size = size
  1966.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  1967.         end  
  1968.       end
  1969.     when RPG::Armor
  1970.       #------------------------------------------------------------------------
  1971.       # ● 防禦狀態(防具)
  1972.       #------------------------------------------------------------------------
  1973.       unless guard_state_set.empty?
  1974.         x = 0
  1975.         y += 1
  1976.         text=phrase["guard_states"]
  1977.         self.contents.font.color = normal_color
  1978.         self.contents.font.size = size
  1979.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  1980.         for i in 0...guard_state_set.size
  1981.           y += 1
  1982.           text = $data_states[guard_state_set[i]].name        
  1983.           self.contents.font.color = normal_color
  1984.           self.contents.font.size = size
  1985.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  1986.         end
  1987.       end
  1988.       #------------------------------------------------------------------------
  1989.       # ● 自動狀態(防具)
  1990.       #------------------------------------------------------------------------
  1991.       unless auto_state_id.zero?
  1992.         x = 0
  1993.         y += 1
  1994.         text = phrase["auto_state"] + $data_states[auto_state_id].name
  1995.         self.contents.font.color = normal_color
  1996.         self.contents.font.size = size
  1997.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  1998.       end
  1999.     end
  2000.     #------------------------------------------------------------------------
  2001.     # ● 空行
  2002.     #------------------------------------------------------------------------
  2003.     y+=1
  2004.     #------------------------------------------------------------------------
  2005.     # ● 力量
  2006.     #------------------------------------------------------------------------
  2007.     unless equipment.str_plus.zero?
  2008.       x = 0
  2009.       y += 1
  2010.       h += 1
  2011.       if equipment.str_plus > 0
  2012.         text=$data_system.words.str+" +"+ equipment.str_plus.to_s
  2013.       else
  2014.         text=$data_system.words.str+" -"+ (-equipment.str_plus).to_s
  2015.       end
  2016.       self.contents.font.color = normal_color
  2017.       self.contents.font.size = size
  2018.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)  
  2019.     end
  2020.     #------------------------------------------------------------------------
  2021.     # ● 靈巧
  2022.     #------------------------------------------------------------------------
  2023.     unless equipment.dex_plus.zero?
  2024.       x = 0
  2025.       y += 1
  2026.       h += 1
  2027.       if equipment.dex_plus > 0
  2028.         text=$data_system.words.dex+" +"+ equipment.dex_plus.to_s
  2029.       else
  2030.         text=$data_system.words.dex+" -"+ (-equipment.dex_plus).to_s
  2031.       end
  2032.       self.contents.font.color = normal_color
  2033.       self.contents.font.size = size
  2034.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2035.     end
  2036.     #------------------------------------------------------------------------
  2037.     # ● 速度
  2038.     #------------------------------------------------------------------------
  2039.     unless equipment.agi_plus.zero?
  2040.       x = 0
  2041.       y += 1
  2042.       h += 1
  2043.       if equipment.agi_plus > 0
  2044.         text=$data_system.words.agi+" +"+ equipment.agi_plus.to_s
  2045.       else
  2046.         text=$data_system.words.agi+" -"+ (-equipment.agi_plus).to_s
  2047.       end
  2048.       self.contents.font.color = normal_color
  2049.       self.contents.font.size = size
  2050.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2051.     end
  2052.     #------------------------------------------------------------------------
  2053.     # ● 智力
  2054.     #------------------------------------------------------------------------
  2055.     unless equipment.int_plus.zero?
  2056.       x = 0
  2057.       y += 1
  2058.       h += 1
  2059.       if equipment.int_plus > 0
  2060.         text=$data_system.words.int+" +"+ equipment.int_plus.to_s
  2061.       else
  2062.         text=$data_system.words.int+" -"+ (-equipment.int_plus).to_s
  2063.       end
  2064.       self.contents.font.color = normal_color
  2065.       self.contents.font.size = size
  2066.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2067.     end
  2068.     #------------------------------------------------------------------------
  2069.     # ● 魔力石描繪
  2070.     #------------------------------------------------------------------------
  2071.     y += draw_materia(equipment, move, y, size) unless self.materia.nil?
  2072.   end
  2073.   #--------------------------------------------------------------------------
  2074.   # ● 物品幫助窗口
  2075.   #--------------------------------------------------------------------------
  2076.   def set_item_text(item)
  2077.     # 取得描述
  2078.     description = item.description.clone
  2079.     # 取得屬性、附加狀態、解除狀態之副本
  2080.     element_set = item.element_set.clone
  2081.     plus_state_set = item.plus_state_set.clone
  2082.     minus_state_set = item.minus_state_set.clone
  2083.     # 過濾不顯示的描述
  2084.     element_set -= @unshow_elements
  2085.     plus_state_set -= @unshow_states
  2086.     minus_state_set -= @unshow_states
  2087.     # 初始化數據設定
  2088.     x = 0
  2089.     y = 0
  2090.     h = 0
  2091.     phrase = {}
  2092.     scope ={}
  2093.     parameter_type = {}
  2094.    
  2095.     # 基本數據設定
  2096. =begin
  2097.     name_size = 名字文字大小
  2098.     size = 描述文字大小
  2099.     word = 每行的描述文字數
  2100.     move = 全體描述偏移幅度
  2101. =end
  2102.     name_size = 18
  2103.     size = 14
  2104.     word = 12
  2105.     move = 80
  2106.    
  2107.     # 基本文字設定
  2108.     phrase["scope"] = "范围:"
  2109.     phrase["price"] = "价格:"
  2110.     phrase["recover_hp_rate"] = "HP 回复率:"
  2111.     phrase["recover_hp"] = "HP 回复量:"
  2112.     phrase["recover_sp_rate"] = "SP 回复率:"
  2113.     phrase["recover_sp"] = "SP 回复量:"
  2114.     phrase["elements"] = "属性:"
  2115.     phrase["plus"] = "附加"
  2116.     phrase["minus"] = "解除"
  2117.     phrase["states"] = "状态"
  2118.     scope[0] = "特殊物品"
  2119.     scope[1] = "特殊物品"
  2120.     scope[2] = "敌单体"
  2121.     scope[3] = "敌全体"
  2122.     scope[4] = "己方单体"
  2123.     scope[5] = "己方全体"
  2124.     scope[6] = "己方昏死单体"
  2125.     scope[7] = "己方昏死全体"
  2126.     scope[8] = "使用者"

  2127.     parameter_type[1] = "MaxHP"
  2128.     parameter_type[2] = "MaxSP"
  2129.     parameter_type[3] = $data_system.words.str
  2130.     parameter_type[4] = $data_system.words.dex
  2131.     parameter_type[5] = $data_system.words.agi
  2132.     parameter_type[6] = $data_system.words.int
  2133.    
  2134.     #依顯示内容確定自身高
  2135.     h = (description.size/3/word)
  2136.     h +=1 if (description.size/3%word)> 0
  2137.     now_h = h
  2138.     h +=3  # 空行,效果範圍,價格
  2139.     h += 1 unless item.recover_hp_rate.zero?
  2140.     h += 1 unless item.recover_hp.zero?
  2141.     h += 1 unless item.recover_sp_rate.zero?
  2142.     h += 1 unless item.recover_sp.zero?
  2143.     h += 1 unless item.parameter_type.zero?
  2144.     h += 1 unless element_set[0].nil?
  2145.     h += 1 unless element_set[4].nil?
  2146.     h += (1+plus_state_set.size) unless plus_state_set.empty?
  2147.     h += (1+minus_state_set.size) unless minus_state_set.empty?
  2148.     #------------------------------------------------------------------------
  2149.     # ● 圖片顯示保證高度
  2150.     #------------------------------------------------------------------------
  2151.     h = 6 + now_h if (h - now_h) < 6
  2152.     #------------------------------------------------------------------------
  2153.     # ● 換算高度
  2154.     #------------------------------------------------------------------------
  2155.     self.height = h * size + name_size + 32
  2156.     #------------------------------------------------------------------------
  2157.     # ● 生成背景
  2158.     #------------------------------------------------------------------------
  2159.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  2160.     self.contents.clear
  2161.     #------------------------------------------------------------------------
  2162.     # ● 名字描繪
  2163.     #------------------------------------------------------------------------
  2164.     text = item.name
  2165.     self.contents.font.color = normal_color#顔色腳本
  2166.     self.contents.font.size = name_size
  2167.     if text.nil?
  2168.       self.visible = false
  2169.     else
  2170.       self.visible = true
  2171.       self.contents.draw_text(0,0, text.size*7, 20, text, 0)
  2172.     end
  2173.     #------------------------------------------------------------------------
  2174.     # ● 說明描繪
  2175.     #------------------------------------------------------------------------
  2176.     x = 0
  2177.     y += 1
  2178.     while ((text = description.slice!(/./m)) != nil)
  2179.       self.contents.font.color = normal_color
  2180.       self.contents.font.size = size
  2181.       self.contents.draw_text(x*size, y*size+5, size, size, text, 0)
  2182.       x+=1
  2183.       if x == word
  2184.         x = 0
  2185.         y += 1
  2186.       end
  2187.     end
  2188.     #------------------------------------------------------------------------
  2189.     # ● 圖標描繪
  2190.     #------------------------------------------------------------------------
  2191.     bitmap = RPG::Cache.icon(item.icon_name) unless item.icon_name.nil?
  2192.     opacity = self.contents.font.color == normal_color ? 255 : 128
  2193.     self.contents.blt(0 ,y*size + 20, bitmap, Rect.new(0, 0, 95, 100), 225)
  2194.     #------------------------------------------------------------------------
  2195.     # ● 魔力石接口
  2196.     #------------------------------------------------------------------------
  2197.     unless self.materia.nil?
  2198.       return if is_materia?(item)
  2199.     end
  2200.     #------------------------------------------------------------------------
  2201.     # ● 效果範圍
  2202.     #------------------------------------------------------------------------
  2203.     text= phrase["scope"] + scope[item.scope]
  2204.     x = 0
  2205.     y += 1
  2206.     self.contents.font.color = normal_color
  2207.     self.contents.font.size = size
  2208.     self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2209.     #------------------------------------------------------------------------
  2210.     # ● 價格
  2211.     #------------------------------------------------------------------------
  2212.     x = 0
  2213.     y += 1      
  2214.     text = phrase["price"] + item.price.to_s
  2215.     self.contents.font.color = normal_color
  2216.     self.contents.font.size = size
  2217.     self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2218.    
  2219.     #------------------------------------------------------------------------
  2220.     # ● HP回復率
  2221.     #------------------------------------------------------------------------
  2222.     unless item.recover_hp_rate.zero?  
  2223.       x = 0
  2224.       y += 1
  2225.       text = phrase["recover_hp_rate"] + item.recover_hp_rate.to_s+"%"
  2226.       self.contents.font.color = normal_color
  2227.       self.contents.font.size = size
  2228.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)   
  2229.     end
  2230.     #------------------------------------------------------------------------
  2231.     # ● HP回復量
  2232.     #------------------------------------------------------------------------
  2233.     unless item.recover_hp.zero?  
  2234.       x = 0
  2235.       y += 1      
  2236.       text = phrase["recover_hp"] + item.recover_hp.to_s
  2237.       self.contents.font.color = normal_color
  2238.       self.contents.font.size = size
  2239.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2240.     end
  2241.     #------------------------------------------------------------------------
  2242.     # ● SP回復率
  2243.     #------------------------------------------------------------------------
  2244.     unless item.recover_sp_rate.zero?
  2245.       x = 0
  2246.       y += 1      
  2247.       text = phrase["recover_sp_rate"] + item.recover_sp_rate.to_s+"%"
  2248.       self.contents.font.color = normal_color
  2249.       self.contents.font.size = size
  2250.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2251.     end
  2252.     #------------------------------------------------------------------------
  2253.     # ● SP回復量
  2254.     #------------------------------------------------------------------------
  2255.     unless item.recover_sp.zero?  
  2256.       x = 0
  2257.       y += 1      
  2258.       text = phrase["elements"] + item.recover_sp.to_s
  2259.       self.contents.font.color = normal_color
  2260.       self.contents.font.size = size
  2261.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2262.     end
  2263.     #------------------------------------------------------------------------
  2264.     # ● 能力值增加
  2265.     #------------------------------------------------------------------------
  2266.     unless item.parameter_type.zero?
  2267.       x = 0
  2268.       y += 1      
  2269.       text= parameter_type[item.parameter_type]+" +"+item.parameter_points.to_s

  2270.       self.contents.font.color = normal_color
  2271.       self.contents.font.size = size
  2272.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2273.     end
  2274.     #------------------------------------------------------------------------
  2275.     # ● 屬性
  2276.     #------------------------------------------------------------------------
  2277.     if element_set.size > 0
  2278.       x = 0
  2279.       y += 1
  2280.       text = phrase["elements"]
  2281.       for i in 0...element_set.size
  2282.         break if i > 4
  2283.         text += $data_system.elements[element_set[i]]
  2284.       end
  2285.       self.contents.font.color = normal_color
  2286.       self.contents.font.size = size
  2287.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2288.     end
  2289.     if element_set.size >= 5
  2290.       x = (phrase["elements"].size)*5-4
  2291.       y += 1
  2292.       text = ""
  2293.       for i in 4...element_set.size
  2294.         text += $data_system.elements[element_set[i]]
  2295.       end
  2296.       self.contents.font.color = normal_color
  2297.       self.contents.font.size = size
  2298.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2299.     end
  2300.     #------------------------------------------------------------------------
  2301.     # ● 狀態添加
  2302.     #------------------------------------------------------------------------
  2303.     unless plus_state_set.empty?
  2304.       text = phrase["plus"]
  2305.       x = 0
  2306.       y += 1
  2307.       self.contents.font.color = normal_color
  2308.       self.contents.font.size = size
  2309.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2310.       plus_state_set.each do |plus_state|
  2311.         y += 1
  2312.         text = $data_states[plus_state].name        
  2313.         self.contents.font.color = normal_color
  2314.         self.contents.font.size = size
  2315.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)      
  2316.       end  
  2317.     end
  2318.     #------------------------------------------------------------------------
  2319.     # ● 狀態解除
  2320.     #------------------------------------------------------------------------
  2321.     unless minus_state_set.empty?
  2322.       text = phrase["minus"]
  2323.       x = 0
  2324.       y += 1
  2325.       self.contents.font.color = normal_color
  2326.       self.contents.font.size = size
  2327.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2328.       minus_state_set.each do |minus_state|
  2329.         y += 1
  2330.         text = $data_states[minus_state].name
  2331.         self.contents.font.color = normal_color
  2332.         self.contents.font.size = size
  2333.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)   
  2334.       end
  2335.     end
  2336.   end
  2337.   #--------------------------------------------------------------------------
  2338.   # ● 技能帮助窗口
  2339.   #--------------------------------------------------------------------------
  2340.   def set_skill_text(skill)
  2341.     # 取得描述
  2342.     description = skill.description.clone
  2343.     # 取得屬性、附加狀態、解除狀態之副本
  2344.     element_set = skill.element_set.clone
  2345.     plus_state_set = skill.plus_state_set.clone
  2346.     minus_state_set = skill.minus_state_set.clone
  2347.     # 過濾不顯示的描述
  2348.     element_set -= @unshow_elements
  2349.     plus_state_set -= @unshow_states
  2350.     minus_state_set -= @unshow_states
  2351.     # 初始化設定
  2352.     x = 0
  2353.     y = 0
  2354.     h = 0
  2355.     phrase = {}
  2356.     scope = {}
  2357.    
  2358.     # 基本數據設定
  2359. =begin
  2360.     name_size = 名字文字大小
  2361.     size = 描述文字大小
  2362.     word = 每行的描述文字數
  2363.     move = 全體描述偏移幅度
  2364. =end
  2365.     name_size = 18
  2366.     size = 14
  2367.     word = 12
  2368.     move = 80
  2369.    
  2370.     # 基本文字設定
  2371.     phrase["scope"] = "范围:"
  2372.     #
  2373.     phrase["power"] = "威力:"
  2374.     phrase["cost_sp"] = "消耗SP:"
  2375.     phrase["hit_rate"] = "命中率:"
  2376.     phrase["elements"] = "攻击属性"
  2377.     #
  2378.     phrase["plus"] = "附加"
  2379.     phrase["minus"] = "解除"
  2380.     phrase["states"] = "状态"
  2381.     scope[0] = "特殊技能"
  2382.     scope[1] = "敌单体"
  2383.     scope[2] = "敌全体"
  2384.     scope[3] = "我方单体"
  2385.     scope[4] = "我方全体"
  2386.     scope[5] = "我方昏死(单体)"
  2387.     scope[6] = "我方昏死(全体)"
  2388.     scope[7] = "自身"

  2389.    
  2390.     #由描叙确定高
  2391.     h =description.size/3/word
  2392.     h += 1 if (description.size%3/word) > 0
  2393.     h += 4  #空行,效果范围,消费SP,命中率
  2394.     h += 1 unless skill.power.zero?
  2395.     h += 1 unless element_set.empty?
  2396.     h += 1 unless element_set[4].nil?
  2397.     h += plus_state_set.size
  2398.     h += minus_state_set.size
  2399.     #------------------------------------------------------------------------
  2400.     # ● 換算高度
  2401.     #------------------------------------------------------------------------
  2402.     self.height=h * size + name_size + 32  
  2403.     self.contents = Bitmap.new(self.width - 32,self.height - 32)
  2404.     self.contents.clear
  2405.    
  2406.     #------------------------------------------------------------------------
  2407.     # ● 名字描述
  2408.     #------------------------------------------------------------------------
  2409.     text = skill.name
  2410.     self.contents.font.color = Color.new(255, 255, 128, 255)
  2411.     self.contents.font.size = name_size
  2412.     if text!=nil
  2413.       self.visible = true
  2414.       self.contents.draw_text(0,0, text.size*7, name_size, text, 0)
  2415.     else
  2416.       self.visible = false
  2417.     end
  2418.    
  2419.     #------------------------------------------------------------------------
  2420.     # ● 說明描述
  2421.     #------------------------------------------------------------------------
  2422.     x = 0
  2423.     y += 1
  2424.     text = description
  2425.     while ((text = description.slice!(/./m)) != nil)
  2426.       self.contents.font.color = normal_color
  2427.       self.contents.font.size = size
  2428.       self.contents.draw_text(x*size, y*size+5, size, size, text, 0)
  2429.       x+=1
  2430.       if x==word#每行10个字
  2431.         x = 0
  2432.         y += 1      
  2433.       end
  2434.     end
  2435.    
  2436.     #------------------------------------------------------------------------
  2437.     # ● 攻擊範圍
  2438.     #------------------------------------------------------------------------
  2439.     text = phrase["scope"] + scope[skill.scope]
  2440.     x = 0
  2441.     y += 1
  2442.     self.contents.font.color = normal_color
  2443.     self.contents.font.size = size
  2444.     self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  2445.     #------------------------------------------------------------------------
  2446.     # ● 空一行
  2447.     #------------------------------------------------------------------------
  2448.     y += 1
  2449.     #------------------------------------------------------------------------
  2450.     # ● 威力描述
  2451.     #------------------------------------------------------------------------
  2452.     unless skill.power.zero?
  2453.       power = skill.power > 0 ? skill.power : -1 * skill.power
  2454.       text = phrase["power"] + power.to_s
  2455.       x = 0
  2456.       y += 1
  2457.       self.contents.font.color = normal_color
  2458.       self.contents.font.size = size  
  2459.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  2460.     end  
  2461.     #------------------------------------------------------------------------
  2462.     # ● 消費SP描述
  2463.     #------------------------------------------------------------------------
  2464.     text = phrase["cost_sp"] + skill.sp_cost.to_s
  2465.     x = 0
  2466.     y += 1
  2467.     self.contents.font.color = normal_color
  2468.     self.contents.font.size = size   
  2469.     self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  2470.     #------------------------------------------------------------------------
  2471.     # ● 命中率描述
  2472.     #------------------------------------------------------------------------
  2473.     text = phrase["hit_rate"] + skill.hit.to_s + "%"
  2474.     x = 0
  2475.     y += 1
  2476.     self.contents.font.color = normal_color
  2477.     self.contents.font.size = size
  2478.     self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  2479.     #------------------------------------------------------------------------
  2480.     # ● 攻擊屬性
  2481.     #------------------------------------------------------------------------
  2482.     if element_set.size > 0
  2483.       text=phrase["elements"]
  2484.       for i in 0...element_set.size
  2485.         if i < 4
  2486.           text+=$data_system.elements[element_set[i]]
  2487.         else
  2488.           break
  2489.         end        
  2490.       end
  2491.       x = 0
  2492.       y += 1
  2493.       self.contents.font.color = normal_color
  2494.       self.contents.font.size = size
  2495.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  2496.     end
  2497.     if element_set.size >= 5
  2498.       text=""
  2499.       for i in 4...element_set.size
  2500.         text+=$data_system.elements[element_set[i]]
  2501.       end
  2502.       x= (phrase["elements"].size)*3
  2503.       y += 1
  2504.       self.contents.font.color = normal_color
  2505.       self.contents.font.size = size
  2506.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  2507.     end
  2508.     #------------------------------------------------------------------------
  2509.     # ● 狀態附加
  2510.     #------------------------------------------------------------------------
  2511.     unless plus_state_set.empty?
  2512.       text= phrase["plus"]
  2513.       x = 0
  2514.       y += 1
  2515.       self.contents.font.color = normal_color
  2516.       self.contents.font.size = size
  2517.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  2518.       plus_state_set.each do |plus_state|
  2519.         y += 1
  2520.         text=$data_states[plus_state].name        
  2521.         self.contents.font.color = normal_color
  2522.         self.contents.font.size = size
  2523.         self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)        
  2524.       end  
  2525.     end
  2526.     #------------------------------------------------------------------------
  2527.     # ●狀態解除
  2528.     #------------------------------------------------------------------------
  2529.     unless minus_state_set.empty?
  2530.       text = phrase["minus"]
  2531.       x = 0
  2532.       y += 1
  2533.       self.contents.font.color = normal_color
  2534.       self.contents.font.size=size
  2535.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  2536.       minus_state_set.each do |minus_state|
  2537.         y += 1
  2538.         text=$data_states[minus_state].name        
  2539.         self.contents.font.color = normal_color
  2540.         self.contents.font.size=size
  2541.         self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)        
  2542.       end  
  2543.     end     
  2544.   end
  2545.   #--------------------------------------------------------------------------
  2546.   # ● 设置角色
  2547.   #     actor : 要显示状态的角色
  2548.   #--------------------------------------------------------------------------
  2549.   def set_actor(actor)
  2550.     if actor != @actor
  2551.       self.contents.clear
  2552.       draw_actor_name(actor, 4, 0)
  2553.       draw_actor_state(actor, 140, 0)
  2554.       draw_actor_hp(actor, 284, 0)
  2555.       draw_actor_sp(actor, 460, 0)
  2556.       @actor = actor
  2557.       @text = nil
  2558.       self.visible = true
  2559.     end
  2560.   end
  2561.   #--------------------------------------------------------------------------
  2562.   # ● 設置角色
  2563.   #     actor : 要顯示狀態之角色
  2564.   #--------------------------------------------------------------------------
  2565.   def set_actor(actor)
  2566.     self.contents = Bitmap.new(width - 32, height - 32) if self.contents.nil?
  2567.     if actor != @actor
  2568.       self.contents.clear
  2569.       draw_actor_name(actor, 4, 0)
  2570.       draw_actor_state(actor, 140, 0)
  2571.       draw_actor_hp(actor, 284, 0)
  2572.       draw_actor_sp(actor, 460, 0)
  2573.       @actor = actor
  2574.       @text = nil
  2575.       self.visible = true
  2576.     end
  2577.   end
  2578.   #--------------------------------------------------------------------------
  2579.   # ● 設置敵人
  2580.   #     enemy : 要顯示名字與狀態之敵人
  2581.   #--------------------------------------------------------------------------
  2582.   def set_enemy(enemy)
  2583.     self.contents = Bitmap.new(width - 32, height - 32) if self.contents.nil?
  2584.     text = enemy.name.sub(/\\[Ff]\[([0-9]+)\]/) {""}
  2585.     state_text = make_battler_state_text(enemy, 112, false)
  2586.     if state_text != ""
  2587.       text += "  " + state_text
  2588.     end
  2589.     set_text(text, 1)
  2590.     self.visible = true
  2591.   end
  2592.   #--------------------------------------------------------------------------
  2593.   # ● 校正帮助窗口位置
  2594.   #--------------------------------------------------------------------------
  2595.   def set_pos(x,y,width,oy,index,column_max)
  2596.     #光标坐标
  2597.     cursor_width = width / column_max - 32
  2598.     xx = index % column_max * (cursor_width + 32)
  2599.     yy = index / column_max * 32 - oy
  2600.     self.x=xx+x+150
  2601.     self.y=yy+y+30
  2602.     if self.x+self.width>640
  2603.       self.x=640-self.width
  2604.     end
  2605.     if self.y+self.height>480
  2606.       self.y=480-self.height
  2607.     end  
  2608.   end
  2609.   #------------------------------------------------------------------------
  2610.   # ● 裝備名字顔色變化 接口
  2611.   #------------------------------------------------------------------------
  2612.   def draw_name_color(equipment)
  2613.     return normal_color
  2614.   end
  2615.   #------------------------------------------------------------------------
  2616.   # ● 自身身份確認
  2617.   #------------------------------------------------------------------------
  2618.   def original_help?
  2619.     return false
  2620.   end
  2621. end

  2622. #------------------------------------------------------------------------------



  2623. #------------------------------------------------------------------------------
  2624. #==============================================================================
  2625. # ■ Window_Item
  2626. #------------------------------------------------------------------------------
  2627. #  物品画面、战斗画面、显示浏览物品的窗口。
  2628. #==============================================================================

  2629. class Window_Item < Window_Selectable
  2630.   #--------------------------------------------------------------------------
  2631.   # ● 初始化对像
  2632.   #--------------------------------------------------------------------------
  2633.   def initialize
  2634.     super(0, 64-64, 640, 416+64)
  2635.     @column_max = 2
  2636.     refresh
  2637.     self.index = 0
  2638.     # 战斗中的情况下将窗口移至中央并将其半透明化
  2639.     if $game_temp.in_battle
  2640.       self.y = 64
  2641.       self.height = 256
  2642.       self.back_opacity = 160
  2643.     end
  2644.   end
  2645.   #--------------------------------------------------------------------------
  2646.   # ● 刷新帮助文本
  2647.   #--------------------------------------------------------------------------
  2648.   def update_help
  2649.     @help_window.set_text(item)
  2650.     #校正帮助窗口位置
  2651.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  2652.   end
  2653. end
  2654. #------------------------------------------------------------------------------



  2655. #------------------------------------------------------------------------------
  2656. #==============================================================================
  2657. # ■ Window_Skill
  2658. #------------------------------------------------------------------------------
  2659. #  特技画面、战斗画面、显示可以使用的特技浏览的窗口。
  2660. #==============================================================================

  2661. class Window_Skill < Window_Selectable
  2662.   #--------------------------------------------------------------------------
  2663.   # ● 初始化对像
  2664.   #     actor : 角色
  2665.   #--------------------------------------------------------------------------
  2666.   def initialize(actor)
  2667.     super(0, 128, 640, 352)
  2668.     @actor = actor
  2669.     @column_max = 2
  2670.    
  2671.     refresh
  2672.     self.index = 0
  2673.     # 战斗中的情况下将窗口移至中央并将其半透明化
  2674.     if $game_temp.in_battle
  2675.       self.y = 64
  2676.       self.height = 256
  2677.       self.back_opacity = 160
  2678.     end
  2679.   end
  2680.   #--------------------------------------------------------------------------
  2681.   # ● 刷新帮助文本
  2682.   #--------------------------------------------------------------------------

  2683.   def update_help
  2684.     @help_window.set_text(skill)
  2685.     #校正帮助窗口位置
  2686.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  2687.   end
  2688. end
  2689. #------------------------------------------------------------------------------



  2690. #------------------------------------------------------------------------------
  2691. #==============================================================================
  2692. # ■ Window_SkillStatus
  2693. #------------------------------------------------------------------------------
  2694. #  显示特技画面、特技使用者的窗口。
  2695. #==============================================================================

  2696. class Window_SkillStatus < Window_Base
  2697.   #--------------------------------------------------------------------------
  2698.   # ● 初始化对像
  2699.   #     actor : 角色
  2700.   #--------------------------------------------------------------------------
  2701.   def initialize(actor)
  2702. # -------------------
  2703. # 修改開始
  2704.     super(0, 64-64, 640, 64+64)#★★★★★★★★★★★★★★★★★★★★
  2705. # 修改終了
  2706. # -------------------
  2707.     self.contents = Bitmap.new(width - 32, height - 32)
  2708.     @actor = actor
  2709.     refresh
  2710.   end
  2711. end
  2712. #------------------------------------------------------------------------------



  2713. #------------------------------------------------------------------------------
  2714. #==============================================================================
  2715. # ■ Window_EquipLeft
  2716. #------------------------------------------------------------------------------
  2717. #  装备画面的、显示角色能力值变化的窗口。
  2718. #==============================================================================
  2719. class Window_EquipLeft < Window_Base
  2720.   #--------------------------------------------------------------------------
  2721.   # ● 初始化对像
  2722.   #     actor : 角色
  2723.   #--------------------------------------------------------------------------
  2724.   def initialize(actor)
  2725. # -------------------
  2726. # 修改開始
  2727.     super(0, 64-64, 272, 416+64)#★★★★★★★★★★★★★★★★★★★★
  2728. # 修改終了
  2729. # -------------------
  2730.     self.contents = Bitmap.new(width - 32, height - 32)
  2731.     @actor = actor
  2732.     refresh
  2733.   end
  2734. end
  2735. #------------------------------------------------------------------------------



  2736. #------------------------------------------------------------------------------
  2737. #==============================================================================
  2738. # ■ Window_EquipRight
  2739. #------------------------------------------------------------------------------
  2740. #  装备画面、显示角色现在装备的物品的窗口。
  2741. #==============================================================================

  2742. class Window_EquipRight < Window_Selectable
  2743.   #--------------------------------------------------------------------------
  2744.   # ● 初始化对像
  2745.   #     actor : 角色
  2746.   #--------------------------------------------------------------------------
  2747.   def initialize(actor)
  2748. # -------------------
  2749. # 修改開始
  2750.     super(272, 64-64, 368, 256+64)#★★★★★★★★★★★★★★★★★★★★
  2751. # 修改終了
  2752. # -------------------
  2753.     self.contents = Bitmap.new(width - 32, height - 32)
  2754.     @actor = actor
  2755.     refresh
  2756.     self.index = 0
  2757.   end
  2758.   #--------------------------------------------------------------------------
  2759.   # ● 刷新帮助文本
  2760.   #--------------------------------------------------------------------------

  2761.   def update_help
  2762.     @help_window.set_text(item)
  2763.     #校正帮助窗口位置
  2764.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  2765.   end
  2766. end
  2767. #------------------------------------------------------------------------------



  2768. #------------------------------------------------------------------------------
  2769. #==============================================================================
  2770. # ■ Window_EquipItem
  2771. #------------------------------------------------------------------------------
  2772. #  装备画面、显示浏览变更装备的候补物品的窗口。
  2773. #==============================================================================

  2774. class Window_EquipItem < Window_Selectable
  2775.   #--------------------------------------------------------------------------
  2776.   # ● 初始化对像
  2777.   #     actor      : 角色
  2778.   #     equip_type : 装备部位 (0~3)
  2779.   #--------------------------------------------------------------------------
  2780.   def initialize(actor, equip_type)
  2781. # -------------------
  2782. # 修改開始
  2783.     super(272, 320, 368, 160)#★★★★★★★★★★★★★★★★★★★★
  2784. # 修改終了
  2785. # -------------------
  2786.     @actor = actor
  2787.     @equip_type = equip_type
  2788.     @column_max = 1
  2789.    
  2790.     refresh
  2791.     self.active = false
  2792.     self.index = -1
  2793.   end
  2794.   def update_help
  2795.     @help_window.set_text(item)
  2796.     #校正帮助窗口位置
  2797.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  2798.   end
  2799. end
  2800. #------------------------------------------------------------------------------



  2801. #------------------------------------------------------------------------------
  2802. #==============================================================================
  2803. # ■ Window_ShopCommand
  2804. #------------------------------------------------------------------------------
  2805. #  商店画面、选择要做的事的窗口
  2806. #==============================================================================

  2807. class Window_ShopCommand < Window_Selectable
  2808.   #--------------------------------------------------------------------------
  2809.   # ● 初始化对像
  2810.   #--------------------------------------------------------------------------
  2811.   def initialize
  2812. # -------------------
  2813. # 修改開始
  2814.     super(0, 64-64, 480, 64)#★★★★★★★★★★★★★★★★★
  2815. # 修改終了
  2816. # -------------------
  2817.     self.contents = Bitmap.new(width - 32, height - 32)
  2818.     @item_max = 3
  2819.     @column_max = 3
  2820.     @commands = ["买", "卖", "取消"]
  2821.     refresh
  2822.     self.index = 0
  2823.   end
  2824. end
  2825. #------------------------------------------------------------------------------



  2826. #------------------------------------------------------------------------------
  2827. #========================================================================================================================
  2828. # ■ Window_ShopBuy
  2829. #------------------------------------------------------------------------------
  2830. #  商店画面、浏览显示可以购买的商品的窗口。
  2831. #==============================================================================

  2832. class Window_ShopBuy < Window_Selectable
  2833.   #--------------------------------------------------------------------------
  2834.   # ● 初始化对像
  2835.   #     shop_goods : 商品
  2836.   #--------------------------------------------------------------------------
  2837.   def initialize(shop_goods)
  2838. # -------------------
  2839. # 修改開始
  2840.     super(0, 128-64, 368, 352+64)#★★★★★★★★★★★★★★★★
  2841. # 修改終了
  2842. # -------------------
  2843.     @shop_goods = shop_goods
  2844.    
  2845.     refresh
  2846.     self.index = 0
  2847.   end
  2848.   #--------------------------------------------------------------------------
  2849.   # ● 刷新帮助文本
  2850.   #--------------------------------------------------------------------------

  2851.   def update_help
  2852.     @help_window.set_text(item)
  2853.     #校正帮助窗口位置
  2854.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  2855.   end
  2856. end
  2857. #------------------------------------------------------------------------------



  2858. #------------------------------------------------------------------------------
  2859. #==============================================================================
  2860. # ■ Window_ShopSell
  2861. #------------------------------------------------------------------------------
  2862. #  商店画面、浏览显示可以卖掉的商品的窗口。
  2863. #==============================================================================

  2864. class Window_ShopSell < Window_Selectable
  2865.   #--------------------------------------------------------------------------
  2866.   # ● 初始化对像
  2867.   #--------------------------------------------------------------------------
  2868.   def initialize
  2869. # -------------------
  2870. # 修改開始
  2871.     super(0, 128-64, 640, 352+64)#★★★★★★★★★★★★★★★★
  2872. # 修改終了
  2873. # -------------------
  2874.     @column_max = 2
  2875.    
  2876.     refresh
  2877.     self.index = 0
  2878.   end
  2879.   #--------------------------------------------------------------------------
  2880.   # ● 刷新帮助文本
  2881.   #--------------------------------------------------------------------------

  2882.   def update_help
  2883.     @help_window.set_text(item)
  2884.     #校正帮助窗口位置
  2885.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  2886.   end
  2887. end
  2888. #------------------------------------------------------------------------------



  2889. #------------------------------------------------------------------------------
  2890. #==============================================================================
  2891. # ■ Window_ShopNumber
  2892. #------------------------------------------------------------------------------
  2893. #  商店画面、输入买卖数量的窗口。
  2894. #==============================================================================
  2895. class Window_ShopNumber < Window_Base
  2896.   #--------------------------------------------------------------------------
  2897.   # ● 初始化对像
  2898.   #--------------------------------------------------------------------------
  2899.   def initialize
  2900. # -------------------
  2901. # 修改開始
  2902.     super(0, 128-64, 368, 352+64)#★★★★★★★★★★★★★★★★
  2903. # 修改終了
  2904. # -------------------
  2905.     self.contents = Bitmap.new(width - 32, height - 32)
  2906.     @item = nil
  2907.     @max = 1
  2908.     @price = 0
  2909.     @number = 1
  2910.   end
  2911. end
  2912. #------------------------------------------------------------------------------



  2913. #------------------------------------------------------------------------------
  2914. #==============================================================================
  2915. # ■ Window_ShopStatus
  2916. #------------------------------------------------------------------------------
  2917. #  商店画面、显示物品所持数与角色装备的窗口。
  2918. #==============================================================================

  2919. class Window_ShopStatus < Window_Base
  2920.   #--------------------------------------------------------------------------
  2921.   # ● 初始化对像
  2922.   #--------------------------------------------------------------------------
  2923.   def initialize
  2924. # -------------------
  2925. # 修改開始
  2926.     super(368, 128-64, 272, 352+64)#★★★★★★★★★★★★
  2927. # 修改終了
  2928. # -------------------
  2929.     self.contents = Bitmap.new(width - 32, height - 32)
  2930.     @item = nil
  2931.     refresh
  2932.   end
  2933. end
  2934. #------------------------------------------------------------------------------



  2935. #------------------------------------------------------------------------------
  2936. #==============================================================================
  2937. # ■ Scene_Equip
  2938. #------------------------------------------------------------------------------
  2939. #  处理装备画面的类。
  2940. #==============================================================================

  2941. class Scene_Equip
  2942.   #--------------------------------------------------------------------------
  2943.   # ● 刷新画面 (右侧窗口被激活的情况下)
  2944.   #--------------------------------------------------------------------------
  2945.   def update_right
  2946. # -------------------
  2947. # 修改開始
  2948.     if @right_window.item==nil
  2949.         @help_window.visible=false
  2950.     else
  2951.         @help_window.visible=true
  2952.     end
  2953. # 修改終了
  2954. # -------------------
  2955.     # 按下 B 键的情况下
  2956.     if Input.trigger?(Input::B)
  2957.       # 演奏取消 SE
  2958.       $game_system.se_play($data_system.cancel_se)
  2959.       # 切换到菜单画面
  2960.       $scene = Scene_Menu.new(2)
  2961.       return
  2962.     end
  2963.     # 按下 C 键的情况下
  2964.     if Input.trigger?(Input::C)
  2965.       # 固定装备的情况下
  2966.       if @actor.equip_fix?(@right_window.index)
  2967.         # 演奏冻结 SE
  2968.         $game_system.se_play($data_system.buzzer_se)
  2969.         return
  2970.       end
  2971.       # 演奏确定 SE
  2972.       $game_system.se_play($data_system.decision_se)
  2973.       # 激活物品窗口
  2974.       @right_window.active = false
  2975.       @item_window.active = true
  2976.       @item_window.index = 0
  2977.       return
  2978.     end
  2979.     # 按下 R 键的情况下
  2980.     if Input.trigger?(Input::R)
  2981.       # 演奏光标 SE
  2982.       $game_system.se_play($data_system.cursor_se)
  2983.       # 移至下一位角色
  2984.       @actor_index += 1
  2985.       @actor_index %= $game_party.actors.size
  2986.       # 切换到别的装备画面
  2987.       $scene = Scene_Equip.new(@actor_index, @right_window.index)
  2988.       return
  2989.     end
  2990.     # 按下 L 键的情况下
  2991.     if Input.trigger?(Input::L)
  2992.       # 演奏光标 SE
  2993.       $game_system.se_play($data_system.cursor_se)
  2994.       # 移至上一位角色
  2995.       @actor_index += $game_party.actors.size - 1
  2996.       @actor_index %= $game_party.actors.size
  2997.       # 切换到别的装备画面
  2998.       $scene = Scene_Equip.new(@actor_index, @right_window.index)
  2999.       return
  3000.     end
  3001.   end
  3002.   #--------------------------------------------------------------------------
  3003.   # ● 刷新画面 (物品窗口被激活的情况下)
  3004.   #--------------------------------------------------------------------------
  3005.   def update_item
  3006. # -------------------
  3007. # 修改開始
  3008.     if @item_window.item==nil
  3009.         @help_window.visible=false
  3010.     else
  3011.         @help_window.visible=true
  3012.     end
  3013. # 修改終了
  3014. # -------------------
  3015.     # 按下 B 键的情况下
  3016.     if Input.trigger?(Input::B)
  3017.       # 演奏取消 SE
  3018.       $game_system.se_play($data_system.cancel_se)
  3019.       # 激活右侧窗口
  3020.       @right_window.active = true
  3021.       @item_window.active = false
  3022.       @item_window.index = -1
  3023.       return
  3024.     end
  3025.     # 按下 C 键的情况下
  3026.     if Input.trigger?(Input::C)
  3027.       # 演奏装备 SE
  3028.       $game_system.se_play($data_system.equip_se)
  3029.       # 获取物品窗口现在选择的装备数据
  3030.       item = @item_window.item
  3031.       # 变更装备
  3032.       @actor.equip(@right_window.index, item == nil ? 0 : item.id)
  3033.       # 激活右侧窗口
  3034.       @right_window.active = true
  3035.       @item_window.active = false
  3036.       @item_window.index = -1
  3037.       # 再生成右侧窗口、物品窗口的内容
  3038.       @right_window.refresh
  3039.       @item_window.refresh
  3040.       return
  3041.     end
  3042.   end
  3043. end
  3044. #------------------------------------------------------------------------------



  3045. #------------------------------------------------------------------------------
  3046. #========================================================================================================================
  3047. # ■ Scene_Battle (分割定义 3)
  3048. #------------------------------------------------------------------------------
  3049. #  处理战斗画面的类。
  3050. #========================================================================================================================

  3051. class Scene_Battle
  3052.   #--------------------------------------------------------------------------
  3053.   # ● 刷新画面 (角色命令回合 : 选择特技)
  3054.   #--------------------------------------------------------------------------
  3055.   alias first_reupdate_phase3_skill_select update_phase3_skill_select
  3056.   def update_phase3_skill_select
  3057. # -------------------
  3058. # 修改開始
  3059.     @skill_window.help_window.visible = false#★★★★★★★★★★★★★
  3060. # 修改終了
  3061. # -------------------
  3062.     first_reupdate_phase3_skill_select
  3063.   end
  3064.   #--------------------------------------------------------------------------
  3065.   # ● 刷新画面 (角色命令回合 : 选择物品)
  3066.   #--------------------------------------------------------------------------
  3067.   alias first_reupdate_phase3_item_select update_phase3_item_select  
  3068.   def update_phase3_item_select
  3069. # -------------------
  3070. # 修改開始
  3071.     @item_window.help_window.visible = false#★★★★★★★★★★★★
  3072. # 修改終了
  3073. # -------------------
  3074.     first_reupdate_phase3_item_select
  3075.   end
  3076.   #--------------------------------------------------------------------------
  3077.   # ● 开始选择特技
  3078.   #--------------------------------------------------------------------------
  3079.   def start_skill_select
  3080.     @skill_window = Window_Skill.new(@active_battler)
  3081.     @skill_window.help_window = Window_Help.new
  3082.     @actor_command_window.active = false
  3083.     @actor_command_window.visible = false
  3084.   end
  3085.   #--------------------------------------------------------------------------
  3086.   # ● 选择特技结束
  3087.   #--------------------------------------------------------------------------
  3088.   alias first_update_end_skill_select end_skill_select  
  3089.   def end_skill_select
  3090. # -------------------
  3091. # 修改開始
  3092.     @skill_window.help_window.visible = false#★★★★★★★★★★★★
  3093. # 修改終了
  3094. # -------------------
  3095.     first_update_end_skill_select
  3096.   end
  3097.   #--------------------------------------------------------------------------
  3098.   # ● 开始选择物品
  3099.   #--------------------------------------------------------------------------
  3100.   def start_item_select
  3101.     # 生成物品窗口
  3102.     @item_window = Window_Item.new
  3103.     # 关联帮助窗口
  3104. # -------------------
  3105. # 修改開始
  3106.     @item_window.help_window =  Window_Help.new#★★★★★★★★★★★★
  3107. # 修改終了
  3108. # -------------------
  3109.     # 无效化角色指令窗口
  3110.     @actor_command_window.active = false
  3111.     @actor_command_window.visible = false
  3112.   end
  3113.   #--------------------------------------------------------------------------
  3114.   # ● 结束选择物品
  3115.   #--------------------------------------------------------------------------
  3116.   alias first_update_end_item_select end_item_select
  3117.   def end_item_select
  3118. # -------------------
  3119. # 修改開始
  3120.     @item_window.help_window.visible = false#★★★★★★★★★★★★
  3121. # 修改終了
  3122. # -------------------
  3123.     first_update_end_item_select
  3124.   end
  3125. end
  3126. #------------------------------------------------------------------------------



  3127. #------------------------------------------------------------------------------
  3128. #==============================================================================
  3129. # ■ Scene_Shop
  3130. #------------------------------------------------------------------------------
  3131. #  处理商店画面的类。
  3132. #==============================================================================

  3133. class Scene_Shop
  3134.   #--------------------------------------------------------------------------
  3135.   # ● 主处理
  3136.   #--------------------------------------------------------------------------
  3137. # --------------------
  3138. # 衝突可能
  3139.   def main
  3140.     # 生成帮助窗口
  3141. # -------------------
  3142. # 修改開始
  3143.     @help_window = Window_Help.new#★★★★★★★★★★★★★★★★
  3144. # 修改終了
  3145. # -------------------
  3146.     # 生成指令窗口
  3147.     @command_window = Window_ShopCommand.new
  3148.     # 生成金钱窗口
  3149.     @gold_window = Window_Gold.new
  3150.     @gold_window.x = 480
  3151. # -------------------
  3152. # 修改開始
  3153.     @gold_window.y = 64-64#★★★★★★★★★★★★★
  3154. # 修改終了
  3155. # -------------------
  3156.     # 生成时间窗口
  3157. # -------------------
  3158. # 修改開始
  3159.     @dummy_window = Window_Base.new(0, 128-64, 640, 352+64)#★★★★★★★★★★★★★
  3160. # 修改終了
  3161. # -------------------
  3162.     # 生成购买窗口
  3163.     @buy_window = Window_ShopBuy.new($game_temp.shop_goods)
  3164.     @buy_window.active = false
  3165.     @buy_window.visible = false
  3166.     @buy_window.help_window = @help_window
  3167.     # 生成卖出窗口
  3168.     @sell_window = Window_ShopSell.new
  3169.     @sell_window.active = false
  3170.     @sell_window.visible = false
  3171.     @sell_window.help_window = @help_window
  3172.     # 生成数量输入窗口
  3173.     @number_window = Window_ShopNumber.new
  3174.     @number_window.active = false
  3175.     @number_window.visible = false
  3176.     # 生成状态窗口
  3177.     @status_window = Window_ShopStatus.new
  3178.     @status_window.visible = false
  3179.     # 执行过渡
  3180.     Graphics.transition
  3181.     # 主循环
  3182.     loop do
  3183.       # 刷新游戏画面
  3184.       Graphics.update
  3185.       # 刷新输入信息
  3186.       Input.update
  3187.       # 刷新画面
  3188.       update
  3189.       # 如果画面切换的话就中断循环
  3190.       if $scene != self
  3191.         break
  3192.       end
  3193.     end
  3194.     # 准备过渡
  3195.     Graphics.freeze
  3196.     # 释放窗口
  3197.     @help_window.dispose
  3198.     @command_window.dispose
  3199.     @gold_window.dispose
  3200.     @dummy_window.dispose
  3201.     @buy_window.dispose
  3202.     @sell_window.dispose
  3203.     @number_window.dispose
  3204.     @status_window.dispose
  3205.   end
  3206.   #--------------------------------------------------------------------------
  3207.   # ● 刷新画面
  3208.   #--------------------------------------------------------------------------
  3209. # --------------------
  3210. # 衝突可能
  3211.   def update
  3212.     # 刷新窗口
  3213.     @help_window.update
  3214.     @command_window.update
  3215.     @gold_window.update
  3216.     @dummy_window.update
  3217.     @buy_window.update
  3218.     @sell_window.update
  3219.     @number_window.update
  3220.     @status_window.update
  3221.     # 指令窗口激活的情况下: 调用 update_command
  3222.     if @command_window.active
  3223. # -------------------
  3224. # 修改開始
  3225.       @help_window.visible=false#★★★★★★★★★★★★★★★★
  3226. # 修改終了
  3227. # -------------------
  3228.       update_command
  3229.       return
  3230.     end
  3231.     # 购买窗口激活的情况下: 调用 update_buy
  3232.     if @buy_window.active
  3233. # -------------------
  3234. # 修改開始
  3235.       @help_window.visible=true#★★★★★★★★★★★★★★★★
  3236.       if @buy_window.item==nil#★★★★★★★★★★★★★★★★
  3237.         @help_window.visible=false#★★★★★★★★★★★★★★★★
  3238.       end #★★★★★★★★★★★★★★★★     
  3239. # 修改終了
  3240. # -------------------
  3241.       update_buy
  3242.       return
  3243.     end
  3244.     # 卖出窗口激活的情况下: 调用 update_sell
  3245.     if @sell_window.active
  3246. # -------------------
  3247. # 修改開始
  3248.       @help_window.visible=true#★★★★★★★★★★★★★★★★
  3249.       if @sell_window.item==nil#★★★★★★★★★★★★★★★★
  3250.         @help_window.visible=false#★★★★★★★★★★★★★★★★
  3251.       end #★★★★★★★★★★★★★★★★
  3252. # 修改終了
  3253. # -------------------      
  3254.       update_sell
  3255.       return
  3256.     end
  3257.     # 个数输入窗口激活的情况下: 调用 update_number
  3258.     if @number_window.active
  3259. # -------------------
  3260. # 修改開始
  3261.       @help_window.visible=false#★★★★★★★★★★★★★★★★
  3262. # 修改終了
  3263. # -------------------
  3264.       update_number
  3265.       return
  3266.     end
  3267.   end
  3268. end
  3269. =begin
  3270.   #--------------------------------------------------------------------------
  3271.  # ● 人物行走图做战斗图像(附加动画) ver1.02
  3272.   #--------------------------------------------------------------------------
  3273.   制作者 らい
  3274.   翻译:忧郁的涟漪
  3275.   
  3276.    
  3277.   图像文件的规格
  3278.   
  3279.   ● 巴特勒图像(似乎指的是战斗图像)
  3280.   
  3281.   使用步行图片。
  3282.    
  3283.   ● 武器的图像
  3284.   
  3285.   就是武器图标的图像(ICO图)  
  3286.       

  3287. ###############################################################################
  3288. 行走图横版战斗:
  3289. ------------------------------------------------------------------------------
  3290. 经过了两次的修改,终于完全实现了远距离攻击的效果(弓箭、铳类)
  3291. 另外,也实现了简单的回旋攻击(类似回力镖的攻击)和攻击道具(类似石头或炸弹)

  3292. 这个脚本的更动分为2部分:
  3293. 1)战斗动作 - 新加了数个动作,如:“弓箭攻击”、“远距离发动”等等
  3294. 2)战斗动画 - 基本上是脚本原带的。只是这个功能被隐藏起来了。现在已恢复。

  3295. 用法:
  3296. 在相应的脚本行加入武器/技能/道具的数据库id(id之间要用“,”来分开)
  3297. 如果不要某些功能的话就随便填一个外太空id就行了(没有用到的id)
  3298. 1)战斗动作(角色/行走图的动作)
  3299. 脚本355行:  远程武器的id  (普通攻击时使用远程射击)
  3300. 脚本357行:  回旋武器的id  (普通攻击时会飞回手上的武器,如:回力镖)
  3301. 脚本370行:  远程技能的id  (使用技能时是远程射击)
  3302. 脚本372行:  回旋技能的id  (使用技能时,飞出的武器会飞回手上)

  3303. 2)战斗动画(显示‘对象方的动画’之前先显示‘飞行武器射去敌人身上’的动画)
  3304. 脚本453行:  回旋武器的id  (攻击时会显示一段类似回力镖的动画)
  3305. 脚本455行:  弓箭武器的id  (攻击时会显示箭射去敌人身上的动画)
  3306. 脚本457行:  铳类武器的id  (攻击时会显示子弹射去敌人身上的动画)
  3307. 脚本470行:  回旋技能的id  (技能使用时会显示一段类似回力镖的动画)
  3308. 脚本472行:  弓箭技能的id  (技能使用时会显示箭射去敌人身上的动画)
  3309. 脚本474行:  铳类技能的id  (技能使用时会显示子弹射去敌人身上的动画)
  3310. 脚本486行:  抛击道具的id  (使用该道具时,道具被丢到敌人身上)

  3311. 〉注意:
  3312. 〉‘飞行武器射去敌人身上’的动画是在设定id之后的那句脚本里面设置
  3313. 〉例子:(脚本第455和456行)
  3314. 〉       when 17,18,19,20    #远程武器1(弓箭类)的id
  3315. 〉       return [101,32,false,false]
  3316. 〉这样,武器17~20(都是弓箭)在显示‘对象方的动画’之前会先显示第101号动画
  3317. 〉而动画的轨道是从使用者身上直到敌人身上(实现子弹射出的效果)
  3318.   
  3319. 还有:
  3320. 战斗队伍的画面位置已经被修改过,
  3321. 让角色的位置与默认的战斗背景图不会有视觉上的冲突。
  3322. 如果要更改请去脚本第113-116行改改就行了。

  3323. 脚本‘Arrow_Enemy’和‘Arrow_Actor’被稍微修改过(可以无视)

  3324. 这个范例附带了
  3325. 一张经过修改的战斗背景图(027-castle03),其他的战斗背景图可以使用默认的。
  3326. 一套横版的默认敌人的战斗图(从行走图改过来的)

  3327. =end                                                        #modify by darkten
  3328. ###############################################################################
  3329.   
  3330. module Side_view
  3331.   #--------------------------------------------------------------------------
  3332.   # ● 是否与RATB并用 ☆自动识别(这到是不错~省了~)
  3333.   #    在Scene_Battle计算方法是否是方法synthe?
  3334.   #    在自动不想认识的时候,请重写。
  3335.   #--------------------------------------------------------------------------
  3336.   if Scene_Battle.method_defined?("synthe?")
  3337.     RTAB = true
  3338.   else
  3339.     RTAB = false
  3340.   end
  3341.   #--------------------------------------------------------------------------
  3342.   # ● 改正RATB中的位置误差 ☆自动识别
  3343.   #    在自动不想认识的时候,请重写。
  3344.   #--------------------------------------------------------------------------
  3345.   def camera_correctness
  3346.     return false if !RTAB
  3347.     begin
  3348.       return $scene.drive
  3349.     rescue
  3350.       return false
  3351.     end
  3352.   end
  3353.   #--------------------------------------------------------------------------
  3354.   # ● 队伍中的最大人数
  3355.   #--------------------------------------------------------------------------
  3356.   Party_max = 4
  3357.   #--------------------------------------------------------------------------
  3358.   # ● 战斗图的扩大率(1.0的时候是保持原有大小)
  3359.   #--------------------------------------------------------------------------
  3360.   CHAR_ZOOM = 1.0
  3361.   #--------------------------------------------------------------------------
  3362.   # ● 光标的位置修正(基本不需要改~)
  3363.   #--------------------------------------------------------------------------
  3364.   ARROW_OX = 0
  3365.   ARROW_OY = 64
  3366.   #--------------------------------------------------------------------------
  3367.   # ● 名状态作为飞行管理的排列(不知道什么意思....)
  3368.   #--------------------------------------------------------------------------
  3369.   FLY_STATES = ["飛行"]
  3370.   #--------------------------------------------------------------------------
  3371.   # ● 战斗画面的位置
  3372.   #--------------------------------------------------------------------------
  3373.   PARTY_X = 455     # 队伍 X 位置
  3374.   PARTY_Y = 200     # 队伍 Y 位置
  3375.   FORMATION_X = 15  # 各个角色之间的间隔 X
  3376.   FORMATION_Y = 35  # 各个角色之间的间隔 Y
  3377.   #--------------------------------------------------------------------------
  3378.   # ● 自定义常数
  3379.   #--------------------------------------------------------------------------
  3380.   NORMAL   = "NORMAL"
  3381.   WALK_R   = "WALK_R"
  3382.   WALK_L   = "WALK_L"
  3383.   ATTACK   = "ATTACK"
  3384.   ATTACK_R = "ATTACK_R"
  3385.   ATTACK_L = "ATTACK_L"
  3386.   MAGIC    = "MAGIC"
  3387.   ITEM     = "ITEM"
  3388.   # 动画的设定
  3389.   ANIME = {
  3390.     # [画像ID,是否循环,アニメスピード,动画速度,不能指向动画,武器放在右手or左手]
  3391.     NORMAL            => [1,true , 0,false, true ,""    ], # 通常待击
  3392.     WALK_R            => [2,true , 2,false, false,""    ], # 右移动
  3393.     WALK_L            => [1,true , 2,false, false,""    ], # 左移动
  3394.     ATTACK_R          => [1,false, 2,true , false,"右手"], # 右手攻击
  3395.     ATTACK_L          => [1,false, 2,true , false,"左手"], # 左手攻击
  3396.     MAGIC             => [1,false, 2,false, false,""    ], # 右手攻击
  3397.     ITEM              => [1,false, 2,false, false,""    ], # 左手攻击
  3398.     }
  3399.    
  3400.   # 债务不履行声明价值的设定(一个字一个字翻译的,不知道啥意思)  
  3401.   ANIME.default = [1,false,12,false,"",""]
  3402.   
  3403.   # 在行动设定的时候 右手攻击 or 左手攻击 辨别を(这个不知道什么意思)的ANIME
  3404.   # "角色动画变更#ATTACK"在玩了と(还是不知道啥意思..)的时候,辨别ATTACK_R或者ATTACK_L
  3405.   DUAL_WEAPONS_ANIME = [ATTACK]
  3406.   
  3407.   #--------------------------------------------------------------------------
  3408.   # ● 摇晃的设定
  3409.   #--------------------------------------------------------------------------
  3410.   SHAKE_FILE = "摇晃"  # 文件名
  3411.   SHAKE_POWER = 5          # 强度
  3412.   SHAKE_SPEED = 5          # 速度
  3413.   SHAKE_DURATION = 5      # 时间
  3414.   #--------------------------------------------------------------------------
  3415.   # ● 上下反转地的设定
  3416.   #--------------------------------------------------------------------------
  3417.   UPSIDE_DOWN_FILE = "上下反转" # 文件名
  3418.   #--------------------------------------------------------------------------
  3419.   # ● 左右反转地的设定
  3420.   #--------------------------------------------------------------------------
  3421.   REVERSE_FILE = "左右反转" # 文件名
  3422.   #--------------------------------------------------------------------------
  3423.   # ● 回转地的设定
  3424.   #--------------------------------------------------------------------------
  3425.   TURNING_FILE = "回转" # 文件名
  3426.   TURNING_DIRECTION = 1 # 方向(1.逆时针,-1.顺时针)(|||-_-汗..怎么还有用-1做带入值的...)
  3427.   TURNING_SPEED = 40    # 速度
  3428.   TURNING_DURATION = 1  # 回转数
  3429.   #--------------------------------------------------------------------------
  3430.   # ● 移动的设定
  3431.   #--------------------------------------------------------------------------
  3432.   MOVE_FILE = "移动"             # 文件名
  3433.   MOVE_RETURN = 1                # 回到原来的位置吗?(光写了个1,也不知道不回到该怎么写?0?)
  3434.   MOVE_SPEED = 32                # 速度
  3435.   MOVE_COORDINATES = [0,-640]    # 原来位置的相对坐标
  3436.   #--------------------------------------------------------------------------
  3437.   # ● 动画追加的设定
  3438.   #--------------------------------------------------------------------------
  3439.   ADD_ANIME_FILE = "动画追加"  # 文件名
  3440.   ADD_ANIME_ID = 0               # 动画的ID
  3441.   #--------------------------------------------------------------------------
  3442.   # ● 债务不履行声明和RTAB的数据转换
  3443.   #--------------------------------------------------------------------------
  3444.   def convert_battler
  3445.     return RTAB ? @active_actor : @active_battler
  3446.   end
  3447.   #--------------------------------------------------------------------------
  3448.   # ● 债务不履行声明和RTAB的数据转换2
  3449.   #--------------------------------------------------------------------------
  3450.   def convert_battler2(*arg)
  3451.     return RTAB ? arg[0] : @active_battler
  3452.   end
  3453. end

  3454. #--------------------------------------------------------------------------
  3455. # ● 行动設定
  3456. #--------------------------------------------------------------------------
  3457. module BattleActions
  3458.   
  3459.   # 下のものはあくまでも一例なので
  3460.   # 独自に作ってください。

  3461.   Actions = {

  3462.   "通常攻撃" => [
  3463.   
  3464.   "閃きアニメ",
  3465.   "アクターアニメ変更#WALK_L",
  3466.   "移動#target,32,0,64,0",
  3467.   "行動アニメ",
  3468.   "アクターアニメ変更#ATTACK",
  3469.   "遠距離アニメ",
  3470.   "対象アニメ",
  3471.   "アクターアニメ変更#WALK_L",
  3472.   "SEの演奏#016-Jump02,80,100",
  3473.   "移動#self,0,0,48,32",
  3474.   "終了"
  3475.   ],

  3476.   "エネミー攻撃" => [
  3477.   
  3478.   "閃きアニメ",
  3479.   "アクターアニメ変更#WALK_L",
  3480.   "移動#self,-36,0,12,0",
  3481.   "行動アニメ",
  3482.   "アクターアニメ変更#ATTACK",
  3483.   "遠距離アニメ",
  3484.   "対象アニメ",
  3485.   "アクターアニメ変更#WALK_L",
  3486.   "移動#self,0,0,12,0",
  3487.   "終了"
  3488.   ],
  3489.   
  3490.   "術発動" => [
  3491.   
  3492.   "閃きアニメ",
  3493.   "アクターアニメ変更#WALK_L",
  3494.   "移動#self,-32,0,4,0",
  3495.   "アクターアニメ変更#MAGIC",
  3496.   "行動アニメ",
  3497.   "ウエイト#15",
  3498.   "遠距離アニメ",
  3499.   "対象アニメ",
  3500.   "アクターアニメ変更#WALK_L",
  3501.   "移動#self,0,0,4,2",
  3502.   "終了"
  3503.   ],

  3504.   "アイテム使用" => [
  3505.   
  3506.   "閃きアニメ",
  3507.   "アクターアニメ変更#WALK_L",
  3508.   "移動#self,-32,0,4,0",
  3509.   "行動アニメ",
  3510.   "アクターアニメ変更#ITEM",
  3511.   "ウエイト#15",
  3512.   "遠距離アニメ",
  3513.   "対象アニメ",
  3514.   "アクターアニメ変更#WALK_L",
  3515.   "移動#self,0,0,4,2",
  3516.   "終了"
  3517.   ],
  3518.   
  3519.   "払い抜け" => [
  3520.   
  3521.   "閃きアニメ",
  3522.   "アクターアニメ変更#WALK_L",
  3523.   "移動#target_near,50,0,48,30",  
  3524.   "左右反転",
  3525.   "アクターアニメ固定#ATTACK#3",
  3526.   "行動アニメ",
  3527.   "SEの演奏#135-Light01,100,100",
  3528.   "アニメーションの表示#self,42",
  3529.   "ウエイト#15",
  3530.   "左右反転",
  3531.   "残像表示",
  3532.   "移動#target_far,-50,0,48,0",
  3533.   "対象アニメ",
  3534.   "残像消去",
  3535.   "アニメ固定解除",
  3536.   "アクターアニメ変更#WALK_L",
  3537.   "移動#self,0,0,48,1,0",
  3538.   "終了"
  3539.   ],

  3540.   "弓箭攻撃" => [
  3541.   
  3542.   "閃きアニメ",
  3543.   "アクターアニメ変更#WALK_L",
  3544.   "移動#self,-32,0,4,0",
  3545.   "行動アニメ",
  3546.   "アクターアニメ変更#ATTACK",
  3547.   "遠距離アニメ",
  3548.   "対象アニメ",
  3549.   "アクターアニメ変更#WALK_L",
  3550.   "移動#self,0,0,4,2",
  3551.   "終了"
  3552.   ],

  3553.   "回旋攻撃" => [
  3554.   
  3555.   "閃きアニメ",
  3556.   "アクターアニメ変更#WALK_L",
  3557.   "移動#self,-32,0,4,0",
  3558.   "行動アニメ",
  3559.   "アクターアニメ変更#STAND_L",  
  3560.   "遠距離アニメ",
  3561.   "対象アニメ",
  3562.   "アクターアニメ変更#WALK_L",
  3563.   "移動#self,0,0,4,2",
  3564.   "終了"
  3565.   ],
  3566.   
  3567.   "远距离発動" => [
  3568.   
  3569.   "閃きアニメ",
  3570.   "アクターアニメ変更#WALK_L",
  3571.   "移動#self,-32,0,4,0",
  3572.   "アクターアニメ変更#MAGIC",
  3573.   "行動アニメ",
  3574.   "アクターアニメ変更#ATTACK",
  3575.   "遠距離アニメ",
  3576.   "対象アニメ",
  3577.   "アクターアニメ変更#WALK_L",
  3578.   "移動#self,0,0,4,2",
  3579.   "終了"
  3580.   ],
  3581.   
  3582.   "回旋発動" => [
  3583.   
  3584.   "閃きアニメ",
  3585.   "アクターアニメ変更#WALK_L",
  3586.   "移動#self,-32,0,4,0",
  3587.   "アクターアニメ変更#MAGIC",
  3588.   "行動アニメ",
  3589.   "アクターアニメ変更#STAND_L",  
  3590.   "遠距離アニメ",
  3591.   "対象アニメ",
  3592.   "アクターアニメ変更#WALK_L",
  3593.   "移動#self,0,0,4,2",
  3594.   "終了"
  3595.   ],

  3596.   } # ここで終わり 消さないでください

  3597. end
  3598.   
  3599. module RPG
  3600.   class Weapon
  3601.     #--------------------------------------------------------------------------
  3602.     # ● アクション設定
  3603.     #--------------------------------------------------------------------------
  3604.     def battle_actions
  3605.       case @id
  3606.       when 17,18,19,20,21,22,23,24  # 远程武器的id回旋攻撃
  3607.         return BattleActions::Actions["弓箭攻撃"]
  3608.       when 34                       # 回旋武器的id
  3609.         return BattleActions::Actions["回旋攻撃"]
  3610.       end
  3611.       else
  3612.       return BattleActions::Actions["通常攻撃"]
  3613.     end
  3614.   end
  3615.   class Skill
  3616.     #--------------------------------------------------------------------------
  3617.     # ● アクション設定
  3618.     #--------------------------------------------------------------------------
  3619.     def battle_actions
  3620.       case @id
  3621.       when 73,74,75,76,77,78,79,80  # 远程技能的id
  3622.         return BattleActions::Actions["远距离発動"]
  3623.       when 82                       # 回旋技能的id
  3624.         return BattleActions::Actions["回旋発動"]
  3625.       end
  3626.       else
  3627.       if self.magic?
  3628.         return BattleActions::Actions["術発動"]
  3629.       else
  3630.         return BattleActions::Actions["払い抜け"]
  3631.       end
  3632.     end
  3633.   end
  3634.   class Item
  3635.     #--------------------------------------------------------------------------
  3636.     # ● アクション設定
  3637.     #--------------------------------------------------------------------------
  3638.     def battle_actions
  3639.       return BattleActions::Actions["アイテム使用"]
  3640.     end
  3641.   end
  3642. end
  3643. class Game_Enemy < Game_Battler
  3644.   #--------------------------------------------------------------------------
  3645.   # ● アクション設定
  3646.   #--------------------------------------------------------------------------
  3647.   def battle_actions
  3648.     return BattleActions::Actions["エネミー攻撃"]
  3649.   end
  3650. end
  3651. =begin
  3652. #--------------------------------------------------------------------------
  3653. # ● 遠距離アニメーション
  3654. #--------------------------------------------------------------------------
  3655.  ☆ 説明
  3656.   
  3657.    行動者から対象者にアニメを飛ばします。
  3658.    飛ばすアニメを データベース‐アニメーション で作ります。
  3659.     [アニメーションID, スピード, 往復するか?,直線(false)or曲線(true)] で指定します。


  3660.   ● カスタマイズ方法
  3661.    
  3662.     case @id
  3663.     when 17,18,19,20
  3664.       return [101,32,false,false]
  3665.     when 21,22,23,24
  3666.       return [102,32,false,false]
  3667.     end
  3668.     return 0
  3669.    
  3670.     のように描くとID別に指定可能です。
  3671.    
  3672.    
  3673.   ● アニメーションID
  3674.   
  3675.   飛ばすアニメーションIDです。短い場合は繰り返しで表示されます。
  3676.   
  3677.    
  3678.   ● スピード
  3679.   
  3680.   大きいほうが早い(0だとアニメは移動しません)
  3681.   
  3682.   1 = 1フレームで1ドット進むと考えてください。
  3683.   
  3684.   ● 往復するか?
  3685.   
  3686.   true とした場合、ブーメランのようにアニメが戻ります。
  3687.   
  3688.   ● 直線(false)or曲線(true)
  3689.   
  3690.   true  = 対象に向かって曲線で、アニメが飛びます。(修正の余地ありですが・・・)
  3691.   false = 対象に向かって直線で、アニメが飛びます。
  3692.    
  3693. =end
  3694. module RPG
  3695.   class Weapon
  3696.     #--------------------------------------------------------------------------
  3697.     # ● 遠距離アニメーション
  3698.     #--------------------------------------------------------------------------
  3699.     def flying_anime
  3700.       # ID 指定 の例(武器的id,分类是根据飞行武器的动画id)
  3701.       case @id
  3702.       when 34             #回旋武器(类似回力镖)的id
  3703.         return [103,32,true,true]
  3704.       when 17,18,19,20    #远程武器1(弓箭类)的id
  3705.         return [101,32,false,false]
  3706.       when 21,22,23,24    #远程武器2(铳类)的id
  3707.         return [102,32,false,false]
  3708.       end
  3709.       return [0,0,false,false]
  3710.     end
  3711.   end
  3712.   class Skill
  3713.     #--------------------------------------------------------------------------
  3714.     # ● 遠距離アニメーション
  3715.     #--------------------------------------------------------------------------
  3716.     def flying_anime
  3717.       # ID 指定 の例(技能的id,分类是根据飞行武器的动画id)
  3718.       case @id
  3719.       when 82             #回旋技能(类似回力镖)的id
  3720.         return [103,32,true,true]
  3721.       when 73,74,75,76    #远程技能1(弓箭类)的id
  3722.         return [101,32,false,false]
  3723.       when 77,78,79,80    #远程技能2(铳类)的id
  3724.         return [102,32,false,false]
  3725.       end
  3726.       return [0,0,false,false]
  3727.     end
  3728.   end
  3729.   class Item
  3730.     #--------------------------------------------------------------------------
  3731.     # ● 遠距離アニメーション
  3732.     #--------------------------------------------------------------------------
  3733.     def flying_anime
  3734.       case @id
  3735.       when 34    #抛击类道具(如炸弹一类)的id
  3736.         return [104,32,false,true]
  3737.       end
  3738.       return [0,0,false,false]
  3739.     end
  3740.   end
  3741. end

  3742. class Game_Enemy < Game_Battler
  3743.   #--------------------------------------------------------------------------
  3744.   # ● 遠距離アニメーション
  3745.   #--------------------------------------------------------------------------
  3746.   def flying_anime
  3747.     return [0,0,false,false]
  3748.   end
  3749. end
  3750. #==============================================================================
  3751. # ■ Game_Battler
  3752. #==============================================================================
  3753. class Game_Battler
  3754.   include Side_view
  3755.   #--------------------------------------------------------------------------
  3756.   # ● 追加・公開インスタンス変数
  3757.   #--------------------------------------------------------------------------
  3758.   attr_accessor :height                  # 画像の高さ
  3759.   attr_accessor :real_x                  # X座標補正
  3760.   attr_accessor :real_y                  # Y座標補正
  3761.   attr_accessor :real_zoom               # 拡大率
  3762.   attr_accessor :wait_count              # アニメーション 待ち時間
  3763.   attr_accessor :wait_count2             # アニメーション 待ち時間2
  3764.   attr_accessor :pattern                 # アニメーション カウント(キャラ)
  3765.   attr_accessor :shake                   # シェイク開始フラッグ
  3766.   attr_accessor :reverse                 # 左右反転フラッグ
  3767.   attr_accessor :shadow                  # 残像フラッグ
  3768.   attr_accessor :flash_flag              # 閃きフラッグ
  3769.   attr_reader   :ox                      # X座標補正
  3770.   attr_reader   :oy                      # Y座標補正
  3771.   attr_reader   :flying_x                # 遠距離アニメX座標
  3772.   attr_reader   :flying_y                # 遠距離アニメY座標
  3773.   attr_reader   :flying_anime            # 遠距離アニメ
  3774.   attr_reader   :animation1_on           # 行動アニメ開始フラッグ
  3775.   attr_reader   :animation2_on           # 対象アニメ開始フラッグ
  3776.   #--------------------------------------------------------------------------
  3777.   # ● デフォルトのアニメーション待ち時間を取得
  3778.   #--------------------------------------------------------------------------
  3779.   def animation_duration=(animation_duration)
  3780.     @_animation_duration = animation_duration
  3781.   end
  3782.   #--------------------------------------------------------------------------
  3783.   # ● バトル開始時のセットアップ
  3784.   #--------------------------------------------------------------------------
  3785.   def start_battle
  3786.     [url=home.php?mod=space&uid=291977]@height[/url] = 0
  3787.     @real_x = 0
  3788.     @real_y = 0
  3789.     @real_zoom = 1.0
  3790.     @battler_condition = ""
  3791.     @action = nil
  3792.     @battle_actions = []
  3793.     @battler_action = false
  3794.     [url=home.php?mod=space&uid=2129346]@step[/url] = 0
  3795.     @anime_on = false
  3796.     @wait_count = 0
  3797.     @wait_count2 = 0
  3798.     @ox = 0
  3799.     @oy = 0
  3800.     @pattern = 0
  3801.     @pattern_log = true
  3802.     @pattern_freeze = false
  3803.     @condition_freeze = false
  3804.     @active = false
  3805.     @move_distance = nil
  3806.     @move_wait = 0
  3807.     @move_coordinates = [0,0,0,0]
  3808.     @flying_distance = nil
  3809.     @flying_wait = 0
  3810.     @flying_x = 0
  3811.     @flying_y = 0
  3812.     @flash_flag = {}
  3813.     self.flying_clear
  3814.   end
  3815.   #--------------------------------------------------------------------------
  3816.   # ● 移動中判定
  3817.   #--------------------------------------------------------------------------
  3818.   def moving?
  3819.     # X座標補正または、Y座標補正が0でなければ、移動中
  3820.     return (@ox != 0 or @oy != 0)
  3821.   end
  3822.   #--------------------------------------------------------------------------
  3823.   # ● 移動終了判定
  3824.   #--------------------------------------------------------------------------
  3825.   def move_end?
  3826.     return (@ox == @move_coordinates[0] and @oy == @move_coordinates[1])
  3827.   end
  3828.   #--------------------------------------------------------------------------
  3829.   # ● アクション開始設定
  3830.   #--------------------------------------------------------------------------
  3831.   def action(flag = true)
  3832.     @battler_action = flag
  3833.     @animation1_on = false
  3834.     @animation2_on = false
  3835.     @step = "setup"
  3836.   end   
  3837.   #--------------------------------------------------------------------------
  3838.   # ● アクション中判定
  3839.   #--------------------------------------------------------------------------
  3840.   def action?
  3841.     return @battler_action
  3842.   end
  3843.   #--------------------------------------------------------------------------
  3844.   # ● 閃き判定
  3845.   #--------------------------------------------------------------------------
  3846.   def flash?
  3847.     return @flash_flg
  3848.   end
  3849.   #--------------------------------------------------------------------------
  3850.   # ● 戦闘不能判定
  3851.   #--------------------------------------------------------------------------
  3852.   def anime_dead?
  3853.     if $game_temp.in_battle and !RTAB
  3854.       if [2,3,4,5].include?($scene.phase4_step)
  3855.         return @last_dead
  3856.       end
  3857.     end
  3858.     return @last_dead = self.dead?
  3859.   end
  3860.   #--------------------------------------------------------------------------
  3861.   # ● ピンチ状態判定
  3862.   #--------------------------------------------------------------------------
  3863.   def crisis?
  3864.     if $game_temp.in_battle and !RTAB
  3865.       if [2,3,4,5].include?($scene.phase4_step)
  3866.         return @last_crisis
  3867.       end
  3868.     end
  3869.     return @last_crisis = (self.hp <= self.maxhp / 4 or badstate?)
  3870.   end
  3871.   #--------------------------------------------------------------------------
  3872.   # ● バッドステート判定
  3873.   #--------------------------------------------------------------------------
  3874.   def badstate?
  3875.     for i in @states
  3876.       unless $data_states[i].nonresistance
  3877.         return true
  3878.       end
  3879.     end
  3880.     return false
  3881.   end
  3882.   #--------------------------------------------------------------------------
  3883.   # ● 飛行
  3884.   #--------------------------------------------------------------------------
  3885.   def fly
  3886.     if @fly != nil
  3887.       return @fly
  3888.     end
  3889.     for id in @states
  3890.       if FLY_STATES.include?($data_states[id].name)
  3891.         return 60
  3892.       end
  3893.     end
  3894.     return 0
  3895.   end
  3896.   #--------------------------------------------------------------------------
  3897.   # ● 遠距離アニメ目標座標の計算
  3898.   #--------------------------------------------------------------------------
  3899.   def flying_setup
  3900.     # 二度目は実行しない
  3901.     return if @flying_distance != nil && !camera_correctness
  3902.     if RTAB
  3903.       targets = @target
  3904.     else
  3905.       targets = $scene.target_battlers
  3906.     end
  3907.     # 目的座標を計算
  3908.     @f_target_x = 0
  3909.     @f_target_y = 0
  3910.     for t in targets
  3911.       @f_target_x += t.screen_x
  3912.       @f_target_y += t.screen_y
  3913.     end
  3914.     if targets != []
  3915.       @f_target_x /= targets.size
  3916.       @f_target_y /= targets.size
  3917.     else
  3918.       @flying_distance = 0
  3919.       return
  3920.     end
  3921.     # 距離の計算
  3922.     @flying_distance = (self.screen_x - @f_target_x).abs + (self.screen_y - @f_target_y).abs
  3923.   end
  3924.   #--------------------------------------------------------------------------
  3925.   # ● 遠距離アニメ
  3926.   #--------------------------------------------------------------------------
  3927.   def flying_animation
  3928.     # 戻る
  3929.     if @step != "flying" or @flying_distance.nil?
  3930.       return [false,true]
  3931.     end
  3932.     # あらかじめ計算
  3933.     self_x = self.screen_x
  3934.     self_y = self.screen_y
  3935.     @flying_distance = @flying_distance == 0 ? 1 : @flying_distance
  3936.     n1 = @flying_wait / @flying_distance.to_f
  3937.     if @flying_distance - @flying_wait > @flying_distance / 2
  3938.       n2 = 1.0 + 10.0 * @flying_wait / @flying_distance.to_f
  3939.     else
  3940.       n2 = 1.0 + 10.0 * (@flying_distance - @flying_wait) / @flying_distance.to_f
  3941.     end
  3942.     if !@flying_anime[4]
  3943.       # 直線移動
  3944.       x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
  3945.       y = (self_y + 1.0 * (@f_target_y - self_y) * n1).to_i
  3946.     else
  3947.       # 曲線移動
  3948.       if !@flying_proceed_end
  3949.         x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
  3950.         y = (self_y + 1.0 * (@f_target_y - self_y) * n1 - n2**2).to_i
  3951.       else
  3952.         x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
  3953.         y = (self_y + 1.0 * (@f_target_y - self_y) * n1 + n2**2).to_i
  3954.       end
  3955.     end
  3956.     # 座標代入
  3957.     @flying_x = x
  3958.     @flying_y = y
  3959.     # ウエイト
  3960.     if !@flying_proceed_end
  3961.       # 開始
  3962.       @flying_proceed_start = @flying_wait == 0
  3963.       @flying_wait += @flying_anime[1]
  3964.       @flying_wait = [@flying_wait,@flying_distance].min
  3965.       @flying_proceed_end = @flying_wait == @flying_distance
  3966.     else
  3967.       # 開始
  3968.       @flying_return_start = @flying_wait == @flying_distance
  3969.       @flying_wait -= @flying_anime[1]
  3970.       @flying_wait = [@flying_wait,0].max
  3971.       @flying_return_end = @flying_wait == 0
  3972.     end
  3973.     if @flying_anime[1] == 0
  3974.       @flying_end = true
  3975.     elsif !@flying_anime[2]
  3976.       @flying_end = @flying_proceed_end
  3977.     else
  3978.       @flying_end = @flying_return_end
  3979.     end
  3980.     # 値を返す(アニメ開始,アニメ終了)
  3981.     return [@flying_proceed_start,@flying_end]
  3982.   end
  3983.   #--------------------------------------------------------------------------
  3984.   # ● 遠距離アニメ初期化
  3985.   #--------------------------------------------------------------------------
  3986.   def flying_clear
  3987.     @flying_proceed_start = false
  3988.     @flying_proceed_end = false
  3989.     @flying_return_start = false
  3990.     @flying_return_end = false
  3991.     @flying_end = false
  3992.     @flying_anime = [0,0,false]
  3993.   end
  3994.   #--------------------------------------------------------------------------
  3995.   # ● 移動
  3996.   #--------------------------------------------------------------------------
  3997.   def move
  3998.     # 距離の計算
  3999.     @move_distance = (@move_coordinates[2] - @move_coordinates[0]).abs +
  4000.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  4001.     if @move_distance > 0
  4002.       return if @ox == @move_coordinates[0] and @oy == @move_coordinates[1]
  4003.       array = @move_coordinates
  4004.       # ジャンプ補正値の計算
  4005.       if @move_distance - @move_wait > @move_distance / 2
  4006.         jump = (@move_action[4] * @move_wait / @move_distance.to_f)**2
  4007.       else
  4008.         jump = (@move_action[4] * (@move_distance - @move_wait) / @move_distance.to_f)**2
  4009.       end
  4010.       jump = @move_action[4] > 0 ? -jump : jump
  4011.       @ox = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @move_wait) / @move_distance.to_f).to_i
  4012.       @oy = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @move_wait) / @move_distance.to_f + jump).to_i
  4013.       # ウエイト
  4014.       @move_wait -= @move_action[3]
  4015.       @move_wait = [@move_wait,0].max
  4016.     end
  4017.   end
  4018.   #--------------------------------------------------------------------------
  4019.   # ● 移動アクションの取得
  4020.   #--------------------------------------------------------------------------
  4021.   def get_move_action
  4022.     string = @action.split(/#/)[1]
  4023.     string = string.split(/,/)
  4024.     @move_action = [string[0],string[1].to_i,string[2].to_i,string[3].to_i,string[4].to_i,string[5].to_i]
  4025.   end
  4026.   #--------------------------------------------------------------------------
  4027.   # ● アクションの取得
  4028.   #--------------------------------------------------------------------------
  4029.   def get_step
  4030.     if @action.nil?
  4031.       @step = "finish"
  4032.       return
  4033.     end
  4034.     string = @action.split(/#/)[0]
  4035.     if string =~ "移動"
  4036.       @step = "moving_setup"
  4037.     elsif string =~ "アクターアニメ実行"
  4038.       @step = "action"
  4039.     elsif string =~ "遠距離アニメ"
  4040.       @step = "flying"
  4041.     elsif string =~ "アクターアニメ変更"
  4042.       @step = "change"
  4043.     elsif string =~ "行動アニメ"
  4044.       @step = "animation1"
  4045.     elsif string =~ "対象アニメ"
  4046.       @step = "animation2"
  4047.     elsif string =~ "ウエイト"
  4048.       @step = "wait"
  4049.     elsif string =~ "左右反転"
  4050.       @step = "reverse"
  4051.     elsif string =~ "閃きアニメ"
  4052.       @step = "flash"
  4053.     elsif string =~ "残像表示"
  4054.       @step = "shadow_on"
  4055.     elsif string =~ "残像消去"
  4056.       @step = "shadow_off"
  4057.     elsif string =~ "アクターアニメ固定"
  4058.       @step = "freeze"
  4059.     elsif string =~ "アニメ固定解除"
  4060.       @step = "freeze_lifting"
  4061.     elsif string =~ "アニメーションの表示"
  4062.       @step = "animation_start"
  4063.     elsif string =~ "SEの演奏"
  4064.       @step = "play_se"
  4065.     else
  4066.       @step = "finish"
  4067.     end
  4068.   end
  4069.   #--------------------------------------------------------------------------
  4070.   # ● フレーム更新 (次のアクションへ)
  4071.   #--------------------------------------------------------------------------
  4072.   def update_next
  4073.     @action = @battle_actions.shift
  4074.     @step = get_step
  4075.   end
  4076.   #--------------------------------------------------------------------------
  4077.   # ● フレーム更新 (動作取得)
  4078.   #--------------------------------------------------------------------------
  4079.   def update_setup
  4080.     # アクションの取得
  4081.     self.get_actions
  4082.     @action = @battle_actions.shift
  4083.     @step = get_step
  4084.   end
  4085.   #--------------------------------------------------------------------------
  4086.   # ● フレーム更新 (移動取得)
  4087.   #--------------------------------------------------------------------------
  4088.   def update_moving_setup
  4089.     # 移動アクションの取得
  4090.     self.get_move_action
  4091.     # 移動目標の設定
  4092.     self.move_setup
  4093.     @step = "moving"
  4094.   end
  4095.   #--------------------------------------------------------------------------
  4096.   # ● フレーム更新 (移動)
  4097.   #--------------------------------------------------------------------------
  4098.   def update_moving
  4099.     # 移動
  4100.     self.move
  4101.     self.condition = @battler_condition
  4102.     # 移動完了したら次のステップへ
  4103.     if move_end?
  4104.       @wait_count = 2
  4105.       @action = @battle_actions.shift
  4106.       @step = get_step
  4107.     end
  4108.   end
  4109.   #--------------------------------------------------------------------------
  4110.   # ● フレーム更新 (アニメ実行)
  4111.   #--------------------------------------------------------------------------
  4112.   def update_action
  4113.     con = @action.split(/#/)[1]
  4114.     # 右手・左手を分ける
  4115.     if DUAL_WEAPONS_ANIME.include?(con)
  4116.       if !@first_weapon and @second_weapon
  4117.         con = con + "_L"
  4118.       else
  4119.         con = con + "_R"
  4120.       end
  4121.     end
  4122.     # アニメ変更
  4123.     self.condition = con
  4124.     # ループか否か
  4125.     if !ANIME[@battler_condition][1]
  4126.       self.anime_on
  4127.     end
  4128.     @action = @battle_actions.shift
  4129.     @step = get_step
  4130.   end
  4131.   #--------------------------------------------------------------------------
  4132.   # ● フレーム更新 (遠距離アニメ)
  4133.   #--------------------------------------------------------------------------
  4134.   def update_flying
  4135.     # 目標の設定
  4136.     self.flying_setup
  4137.     # 遠距離アニメ終了
  4138.     if @flying_end
  4139.       self.flying_clear
  4140.       @action = @battle_actions.shift
  4141.       @step = get_step
  4142.     end
  4143.   end
  4144.   #--------------------------------------------------------------------------
  4145.   # ● フレーム更新 (アニメ変更)
  4146.   #--------------------------------------------------------------------------
  4147.   def update_change
  4148.     con = @action.split(/#/)[1]
  4149.     # 右手・左手を分ける
  4150.     if DUAL_WEAPONS_ANIME.include?(con)
  4151.       if !@first_weapon and @second_weapon
  4152.         con = con + "_L"
  4153.       else
  4154.         con = con + "_R"
  4155.       end
  4156.     end
  4157.     # アニメ変更
  4158.     self.condition = con
  4159.     # ループか否か
  4160.     if !ANIME[@battler_condition][1]
  4161.       self.anime_on
  4162.     end
  4163.     @action = @battle_actions.shift
  4164.     @step = get_step
  4165.   end
  4166.   #--------------------------------------------------------------------------
  4167.   # ● フレーム更新 (行動アニメ)
  4168.   #--------------------------------------------------------------------------
  4169.   def update_animation1
  4170.     @animation1_on = true
  4171.     # 行動アニメの後に行動を開始する
  4172.     if $scene.phase4_step == 3
  4173.       id = RTAB ? @anime1 : $scene.animation1_id
  4174.       animation = $data_animations[id]
  4175.       frame_max = animation != nil ? animation.frame_max : 0
  4176.       @wait_count2 = frame_max * 2
  4177.       return
  4178.     end
  4179.     @action = @battle_actions.shift
  4180.     @step = get_step
  4181.   end
  4182.   #--------------------------------------------------------------------------
  4183.   # ● フレーム更新 (対象アニメ)
  4184.   #--------------------------------------------------------------------------
  4185.   def update_animation2
  4186.     @animation2_on = true
  4187.     # 行動アニメの後に行動を開始する
  4188.     if $scene.phase4_step == 4
  4189.       id = RTAB ? @anime2 : $scene.animation2_id
  4190.       animation = $data_animations[id]
  4191.       frame_max = animation != nil ? animation.frame_max : 0
  4192.       @wait_count2 = frame_max * 2
  4193.       return
  4194.     end
  4195.     @action = @battle_actions.shift
  4196.     @step = get_step
  4197.   end
  4198.   #--------------------------------------------------------------------------
  4199.   # ● フレーム更新 (ウエイト)
  4200.   #--------------------------------------------------------------------------
  4201.   def update_wait
  4202.     @wait_count2 = @action.split(/#/)[1].to_i
  4203.     @action = @battle_actions.shift
  4204.     @step = get_step
  4205.   end
  4206.   #--------------------------------------------------------------------------
  4207.   # ● フレーム更新 (残像表示)
  4208.   #--------------------------------------------------------------------------
  4209.   def update_shadow_on
  4210.     @shadow = true
  4211.     @action = @battle_actions.shift
  4212.     @step = get_step
  4213.   end
  4214.   #--------------------------------------------------------------------------
  4215.   # ● フレーム更新 (残像消去)
  4216.   #--------------------------------------------------------------------------
  4217.   def update_shadow_off
  4218.     @shadow = false
  4219.     @action = @battle_actions.shift
  4220.     @step = get_step
  4221.   end
  4222.   #--------------------------------------------------------------------------
  4223.   # ● フレーム更新 (左右反転)
  4224.   #--------------------------------------------------------------------------
  4225.   def update_reverse
  4226.     @reverse = @reverse ? false : true
  4227.     @action = @battle_actions.shift
  4228.     @step = get_step
  4229.   end
  4230.   #--------------------------------------------------------------------------
  4231.   # ● フレーム更新 (閃きアニメ)
  4232.   #--------------------------------------------------------------------------
  4233.   def update_flash
  4234.     # 閃きアニメの後に行動を開始する
  4235.     if @flash_flag["normal"]
  4236.       @wait_count = $scene.flash_duration
  4237.       @flash_flag["normal"] = false
  4238.       return
  4239.     end
  4240.     @action = @battle_actions.shift
  4241.     @step = get_step
  4242.   end
  4243.   #--------------------------------------------------------------------------
  4244.   # ● フレーム更新 (SEの演奏)
  4245.   #--------------------------------------------------------------------------
  4246.   def update_play_se
  4247.     data = @action.split(/#/)[1]
  4248.     data = data.split(/,/)
  4249.     # SE を演奏
  4250.     Audio.se_play("Audio/SE/" + data[0], data[1].to_i, data[2].to_i)
  4251.     @action = @battle_actions.shift
  4252.     @step = get_step
  4253.   end
  4254.   #--------------------------------------------------------------------------
  4255.   # ● フレーム更新 (アクターアニメ固定)
  4256.   #--------------------------------------------------------------------------
  4257.   def update_freeze
  4258.     con = @action.split(/#/)[1]
  4259.     # 右手・左手を分ける
  4260.     if DUAL_WEAPONS_ANIME.include?(con)
  4261.       if !@first_weapon and @second_weapon
  4262.         con = con + "_L"
  4263.       else
  4264.         con = con + "_R"
  4265.       end
  4266.     end
  4267.     # アニメ変更
  4268.     self.condition = con
  4269.     @pattern = @action.split(/#/)[2].to_i
  4270.     @pattern_freeze = true
  4271.     @condition_freeze = true
  4272.     @action = @battle_actions.shift
  4273.     @step = get_step
  4274.   end
  4275.   #--------------------------------------------------------------------------
  4276.   # ● フレーム更新 (アクターアニメ固定解除)
  4277.   #--------------------------------------------------------------------------
  4278.   def update_freeze_lifting
  4279.     @pattern_freeze = false
  4280.     @condition_freeze = false
  4281.     @action = @battle_actions.shift
  4282.     @step = get_step
  4283.   end
  4284.   #--------------------------------------------------------------------------
  4285.   # ● フレーム更新 (アニメーションの表示)
  4286.   #--------------------------------------------------------------------------
  4287.   def update_animation_start
  4288.     data = @action.split(/#/)[1]
  4289.     data = data.split(/,/)
  4290.     target = data[0]
  4291.     animation_id = data[1].to_i
  4292.     if RTAB
  4293.       case target
  4294.       when "self"
  4295.         @animation.push([animation_id,true])
  4296.       when "target"
  4297.         for tar in @target
  4298.           tar.animation.push([animation_id, true])
  4299.         end
  4300.       end
  4301.     else
  4302.       case target
  4303.       when "self"
  4304.         @animation_id = animation_id
  4305.         @animation_hit = true
  4306.       when "target"
  4307.         for tar in $scene.target_battlers
  4308.           tar.animation_id = animation_id
  4309.           tar.animation_hit = true
  4310.         end
  4311.       end
  4312.     end
  4313.     @action = @battle_actions.shift
  4314.     @step = get_step
  4315.   end
  4316.   #--------------------------------------------------------------------------
  4317.   # ● フレーム更新 (動作終了)
  4318.   #--------------------------------------------------------------------------
  4319.   def update_finish
  4320.     # 動作終了
  4321.     @battler_action = false
  4322.     @step = "setup"
  4323.   end
  4324.   #--------------------------------------------------------------------------
  4325.   # ● バトラーの状態 変更(バトラーグラフィックのタイプ)
  4326.   #--------------------------------------------------------------------------
  4327.   def condition=(condition)
  4328.     return if @condition_freeze
  4329.     @battler_condition = condition
  4330.     @wait_count = ANIME[condition][2]
  4331.   end
  4332.   #--------------------------------------------------------------------------
  4333.   # ● バトラーの状態(バトラーグラフィックのタイプ)
  4334.   #--------------------------------------------------------------------------
  4335.   def condition
  4336.     return @battler_condition
  4337.   end
  4338.   #--------------------------------------------------------------------------
  4339.   # ● フレーム更新
  4340.   #--------------------------------------------------------------------------
  4341.   def update
  4342.     # ウェイト中の場合
  4343.     if @wait_count > 0
  4344.       return
  4345.     end
  4346.     # パターン更新
  4347.     self.char_animation
  4348.     # ウェイト中の場合
  4349.     if @wait_count2 > 0
  4350.       return
  4351.     end
  4352.    
  4353.     # 行動アニメーション
  4354.     if @battler_action
  4355.       method("update_" + @step).call
  4356.       return
  4357.     end
  4358.    
  4359.     # データ初期化
  4360.     @animation1_on = false
  4361.     @animation2_on = false
  4362.     @action = nil
  4363.     @battle_actions = []
  4364.     @move_wait = 0
  4365.     @move_distance = nil
  4366.     @flying_wait = 0
  4367.     @flying_distance = nil
  4368.     @flash = false

  4369.     # RTAB対応
  4370.     # 通常・待機
  4371.     return self.condition = NORMAL
  4372.   end
  4373.   #--------------------------------------------------------------------------
  4374.   # ● アクションの取得
  4375.   #--------------------------------------------------------------------------
  4376.   def get_actions
  4377.     skill = $data_skills[self.current_action.skill_id]
  4378.     item = $data_items[self.current_action.item_id]
  4379.     kind = self.current_action.kind
  4380.     # 動作取得
  4381.     @battle_actions = []
  4382.     # スキル
  4383.     if skill != nil && kind == 1
  4384.       @battle_actions = skill.battle_actions.dup
  4385.       @flying_anime = skill.flying_anime
  4386.     # アイテム
  4387.     elsif item != nil && kind == 2
  4388.       @battle_actions = item.battle_actions.dup
  4389.       @flying_anime = item.flying_anime
  4390.     # 左手攻撃
  4391.     elsif !@first_weapon and @second_weapon and self.is_a?(Game_Actor)
  4392.       @battle_actions = self.battle_actions2.dup
  4393.       @flying_anime = self.flying_anime2
  4394.     # 右手攻撃
  4395.     elsif self.current_action.basic == 0 and
  4396.       self.is_a?(Game_Actor) and self.current_action.kind == 0
  4397.       @battle_actions = self.battle_actions1.dup
  4398.       @flying_anime = self.flying_anime1
  4399.     # 通常攻撃
  4400.     elsif self.current_action.basic == 0 and self.current_action.kind == 0
  4401.       @battle_actions = self.battle_actions.dup
  4402.       @flying_anime = self.flying_anime
  4403.     else
  4404.       @battle_actions = ["終了"]
  4405.       @flying_anime = [0,0,false,false]
  4406.     end
  4407.   end
  4408.   #--------------------------------------------------------------------------
  4409.   # ● ループしないアニメのセット
  4410.   #--------------------------------------------------------------------------
  4411.   def anime_on
  4412.     @pattern = 0
  4413.     @pattern_log = true
  4414.     return
  4415.   end
  4416.   #--------------------------------------------------------------------------
  4417.   # ● パターン更新
  4418.   #--------------------------------------------------------------------------
  4419.   def char_animation
  4420.     # パタン固定の場合もどる
  4421.     return if @pattern_freeze
  4422.     # ループしないアニメの場合 1234 で止まる
  4423.     if !ANIME[@battler_condition][1] && @pattern == 3
  4424.       return
  4425.     end
  4426.     # アニメさせない場合 1 で止まる
  4427.     if ANIME[@battler_condition][4]
  4428.       @pattern = 0
  4429.       return
  4430.     end
  4431.     @pattern = (@pattern + 1) % 4
  4432.   end
  4433.   #--------------------------------------------------------------------------
  4434.   # ● アニメタイプ
  4435.   #--------------------------------------------------------------------------
  4436.   def anime_type
  4437.     return ANIME[self.condition] != nil ? ANIME[self.condition][0] : 0
  4438.   end
  4439. end
  4440. #==============================================================================
  4441. # ■ Game_Actor
  4442. #==============================================================================
  4443. class Game_Actor < Game_Battler
  4444.   include Side_view
  4445.   #--------------------------------------------------------------------------
  4446.   # ● セットアップ
  4447.   #--------------------------------------------------------------------------
  4448.   alias side_view_setup setup
  4449.   def setup(actor_id)
  4450.     side_view_setup(actor_id)
  4451.     start_battle
  4452.   end
  4453.   #--------------------------------------------------------------------------
  4454.   # ● 二刀武器のID取得 ※エラー回避用
  4455.   #--------------------------------------------------------------------------
  4456.   def weapon2_id
  4457.     return @weapon2_id != nil ? @weapon2_id : 0
  4458.   end
  4459.   #--------------------------------------------------------------------------
  4460.   # ● X方向 ポジション 取得 (陣形スクリプト拡張用)
  4461.   #--------------------------------------------------------------------------
  4462.   def position
  4463.     return $data_classes[@class_id].position
  4464.   end
  4465.   #--------------------------------------------------------------------------
  4466.   # ● Y方向 ポジション 取得 (陣形スクリプト拡張用)
  4467.   #--------------------------------------------------------------------------
  4468.   def position2
  4469.     return self.index
  4470.   end
  4471.   #--------------------------------------------------------------------------
  4472.   # ● 武器アニメタイプ
  4473.   #--------------------------------------------------------------------------
  4474.   def weapon_anime_type(type)
  4475.     file_name  = weapon_anime_type0(type)
  4476.     visible   = weapon_anime_type1(type)
  4477.     z         = weapon_anime_type2(type)
  4478.     return [file_name,visible,z]
  4479.   end
  4480.   # 武器アイコン取得
  4481.   def weapon_anime_type0(type)
  4482.     type = ANIME[type][5]
  4483.     return weapon_anime1 if type == "右手"
  4484.     return weapon_anime2 if type == "左手"
  4485.     return nil
  4486.   end
  4487.   # 表示・非表示の取得
  4488.   def weapon_anime_type1(type)
  4489.     return ANIME[type][3]
  4490.   end
  4491.   # バトラーより上に表示するかどうか
  4492.   def weapon_anime_type2(type)
  4493.     type = ANIME[type][5]
  4494.     return true if type == "左手"
  4495.     return false
  4496.   end
  4497.   #--------------------------------------------------------------------------
  4498.   # ● バトル画面 X 座標の取得(カメラ補正無し)
  4499.   #--------------------------------------------------------------------------
  4500.   def true_x
  4501.     return PARTY_X + position * FORMATION_X + @ox
  4502.   end
  4503.   #--------------------------------------------------------------------------
  4504.   # ● バトル画面 Y 座標の取得(カメラ補正無し)
  4505.   #--------------------------------------------------------------------------
  4506.   def true_y
  4507.     # パーティ内の並び順から Y 座標を計算して返す
  4508.     if self.index != nil
  4509.       y = position2 * FORMATION_Y + PARTY_Y + @oy - @height / 2
  4510.       return y
  4511.     else
  4512.       return 0
  4513.     end
  4514.   end
  4515.   #--------------------------------------------------------------------------
  4516.   # ● バトル画面 X 座標の取得
  4517.   #--------------------------------------------------------------------------
  4518.   def screen_x(true_x = self.true_x)
  4519.     return 320 + (true_x - 320) * @real_zoom + @real_x
  4520.   end
  4521.   #--------------------------------------------------------------------------
  4522.   # ● バトル画面 Y 座標の取得
  4523.   #--------------------------------------------------------------------------
  4524.   def screen_y(true_y = self.true_y)
  4525.     return true_y * @real_zoom + @real_y
  4526.   end
  4527.   #--------------------------------------------------------------------------
  4528.   # ● バトル画面 Z 座標の取得
  4529.   #--------------------------------------------------------------------------
  4530.   def screen_z
  4531.     return screen_y + 1000
  4532.   end
  4533.   #--------------------------------------------------------------------------
  4534.   # ● バトル画面 X 座標の取得(移動などしていない場合)
  4535.   #--------------------------------------------------------------------------
  4536.   def base_x
  4537.     return 320 + (true_x - @ox - 320) * @real_zoom + @real_x
  4538.   end
  4539.   #--------------------------------------------------------------------------
  4540.   # ● バトル画面 Y 座標の取得
  4541.   #--------------------------------------------------------------------------
  4542.   def base_y
  4543.     return (true_y - @oy) * @real_zoom + @real_y
  4544.   end
  4545.   #--------------------------------------------------------------------------
  4546.   # ● バトル画面 拡大率の取得
  4547.   #--------------------------------------------------------------------------
  4548.   def zoom
  4549.     return ($scene.zoom_rate[1] - $scene.zoom_rate[0]) *
  4550.                           (true_x + @fly) / 480 + $scene.zoom_rate[0]
  4551.   end
  4552.   #--------------------------------------------------------------------------
  4553.   # ● 攻撃用、バトル画面 X 座標の取得
  4554.   #--------------------------------------------------------------------------
  4555.   def attack_x(z)
  4556.     return (320 - true_x) * z * 0.75
  4557.   end
  4558.   #--------------------------------------------------------------------------
  4559.   # ● 攻撃用、バトル画面 Y 座標の取得
  4560.   #--------------------------------------------------------------------------
  4561.   def attack_y(z)
  4562.     return (160 - (true_y + fly / 4) * z + @height * zoom * z / 2) * 0.75
  4563.   end
  4564.   #--------------------------------------------------------------------------
  4565.   # ● 閃き待ち時間
  4566.   #--------------------------------------------------------------------------
  4567.   def flash_duration
  4568.     return $scene.flash_duration
  4569.   end
  4570.   #--------------------------------------------------------------------------
  4571.   # ● アニメーション取得
  4572.   #--------------------------------------------------------------------------
  4573.   def battle_actions1
  4574.     weapon = $data_weapons[@weapon_id]
  4575.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  4576.   end
  4577.   #--------------------------------------------------------------------------
  4578.   # ● アニメーション取得
  4579.   #--------------------------------------------------------------------------
  4580.   def battle_actions2
  4581.     weapon = $data_weapons[@weapon2_id]
  4582.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  4583.   end
  4584.   #--------------------------------------------------------------------------
  4585.   # ● 武器アニメーション取得
  4586.   #--------------------------------------------------------------------------
  4587.   def weapon_anime1
  4588.     weapon = $data_weapons[@weapon_id]
  4589.     return weapon != nil ? weapon.icon_name : ""
  4590.   end
  4591.   #--------------------------------------------------------------------------
  4592.   # ● 武器アニメーション取得
  4593.   #--------------------------------------------------------------------------
  4594.   def weapon_anime2
  4595.     weapon = $data_weapons[@weapon2_id]
  4596.     return weapon != nil ? weapon.icon_name : ""
  4597.   end
  4598.   #--------------------------------------------------------------------------
  4599.   # ● 遠距離アニメーション取得
  4600.   #--------------------------------------------------------------------------
  4601.   def flying_anime1
  4602.     weapon = $data_weapons[@weapon_id]
  4603.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  4604.   end
  4605.   #--------------------------------------------------------------------------
  4606.   # ● 遠距離アニメーション取得
  4607.   #--------------------------------------------------------------------------
  4608.   def flying_anime2
  4609.     weapon = $data_weapons[@weapon2_id]
  4610.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  4611.   end
  4612.   #--------------------------------------------------------------------------
  4613.   # ● 移動目標座標の計算
  4614.   #--------------------------------------------------------------------------
  4615.   def move_setup
  4616.     if RTAB
  4617.       targets = @target
  4618.     else
  4619.       targets = $scene.target_battlers
  4620.     end
  4621.     case @move_action[0]
  4622.     when "self" # 自分
  4623.       @target_x = self.base_x
  4624.       @target_y = self.base_y
  4625.     when "target_near" # 一番近くのターゲット
  4626.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  4627.       targets.reverse!
  4628.       if targets != []
  4629.         @target_x = targets[0].screen_x
  4630.         @target_y = targets[0].screen_y
  4631.       else
  4632.         @target_x = self.base_x
  4633.         @target_y = self.base_y
  4634.       end
  4635.     when "target_far" # 一番遠くのターゲット
  4636.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  4637.       if targets != []
  4638.         @target_x = targets[0].screen_x
  4639.         @target_y = targets[0].screen_y
  4640.       else
  4641.         @target_x = self.base_x
  4642.         @target_y = self.base_y
  4643.       end
  4644.     when "target" # ターゲット中央
  4645.       @target_x = 0
  4646.       @target_y = 0
  4647.       for t in targets
  4648.         @target_x += t.screen_x
  4649.         @target_y += t.screen_y
  4650.       end
  4651.       if targets != []
  4652.         @target_x /= targets.size
  4653.         @target_y /= targets.size
  4654.       end
  4655.     when "troop" # "トループ中央"
  4656.       @target_x = 0
  4657.       @target_y = 0
  4658.       for t in $game_troop.enemies
  4659.         @target_x += t.screen_x
  4660.         @target_y += t.screen_y
  4661.       end
  4662.       if $game_troop.enemies != []
  4663.         @target_x /= $game_troop.enemies.size
  4664.         @target_y /= $game_troop.enemies.size
  4665.       end
  4666.     when "party" # "パーティ中央"
  4667.       @target_x = 0
  4668.       @target_y = 0
  4669.       for t in $game_party.actors
  4670.         @target_x += t.screen_x
  4671.         @target_y += t.screen_y
  4672.       end
  4673.       if $game_party.actors != []
  4674.         @target_x /= $game_party.actors.size
  4675.         @target_y /= $game_party.actors.size
  4676.       end
  4677.     when "screen" # "画面"
  4678.       @target_x = self.base_x
  4679.       @target_y = self.base_y
  4680.     end
  4681.     # 補正
  4682.     @target_x += @move_action[1] - self.base_x
  4683.     @target_y += @move_action[2] - self.base_y
  4684.     # 移動目標の座標をセット
  4685.     @move_coordinates = [@target_x.to_i,@target_y.to_i,@move_coordinates[0],@move_coordinates[1]]
  4686.     # 距離の計算(ウエイトの設定)
  4687.     @move_wait     = (@move_coordinates[2] - @move_coordinates[0]).abs +
  4688.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  4689.   end
  4690. end
  4691. #==============================================================================
  4692. # ■ Game_Enemy
  4693. #==============================================================================
  4694. class Game_Enemy < Game_Battler
  4695.   #--------------------------------------------------------------------------
  4696.   # ● セットアップ
  4697.   #--------------------------------------------------------------------------
  4698.   alias side_view_initialize initialize
  4699.   def initialize(troop_id, member_index)
  4700.     side_view_initialize(troop_id, member_index)
  4701.     start_battle
  4702.   end
  4703.   #--------------------------------------------------------------------------
  4704.   # ● 移動
  4705.   #--------------------------------------------------------------------------
  4706.   def move
  4707.     # 距離の計算
  4708.     @move_distance = (@move_coordinates[2] - @move_coordinates[0]).abs +
  4709.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  4710.     if @move_distance > 0
  4711.       return if @ox == @move_coordinates[0] and @oy == @move_coordinates[1]
  4712.       array = @move_coordinates
  4713.       # ジャンプ補正値の計算
  4714.       if @move_distance - @move_wait > @move_distance / 2
  4715.         jump = (@move_action[4] * @move_wait / @move_distance.to_f)**2
  4716.       else
  4717.         jump = (@move_action[4] * (@move_distance - @move_wait) / @move_distance.to_f)**2
  4718.       end
  4719.       jump = @move_action[4] > 0 ? -jump : jump
  4720.       @ox = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @move_wait) / @move_distance.to_f).to_i
  4721.       @oy = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @move_wait) / @move_distance.to_f + jump).to_i
  4722.       # ウエイト
  4723.       @move_wait -= @move_action[3]
  4724.       @move_wait = [@move_wait,0].max
  4725.     end
  4726.   end
  4727.   #--------------------------------------------------------------------------
  4728.   # ● 移動目標座標の計算
  4729.   #--------------------------------------------------------------------------
  4730.   def move_setup
  4731.     if RTAB
  4732.       targets = @target
  4733.     else
  4734.       targets = $scene.target_battlers
  4735.     end
  4736.     case @move_action[0]
  4737.     when "self" # 自分
  4738.       @target_x = self.base_x
  4739.       @target_y = self.base_y
  4740.     when "target_near" # 一番近くのターゲット
  4741.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  4742.       if targets != []
  4743.         @target_x = targets[0].screen_x
  4744.         @target_y = targets[0].screen_y
  4745.       else
  4746.         @target_x = self.base_x
  4747.         @target_y = self.base_y
  4748.       end
  4749.     when "target_far" # 一番遠くのターゲット
  4750.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  4751.       targets.reverse!
  4752.       if targets != []
  4753.         @target_x = targets[0].screen_x
  4754.         @target_y = targets[0].screen_y
  4755.       else
  4756.         @target_x = self.base_x
  4757.         @target_y = self.base_y
  4758.       end
  4759.     when "target" # ターゲット中央
  4760.       @target_x = 0
  4761.       @target_y = 0
  4762.       for t in targets
  4763.         @target_x += t.screen_x
  4764.         @target_y += t.screen_y
  4765.       end
  4766.       if targets != []
  4767.         @target_x /= targets.size
  4768.         @target_y /= targets.size
  4769.       end
  4770.     when  "party" # "トループ中央"
  4771.       @target_x = 0
  4772.       @target_y = 0
  4773.       for t in $game_troop.enemies
  4774.         @target_x += t.screen_x
  4775.         @target_y += t.screen_y
  4776.       end
  4777.       if $game_troop.enemies != []
  4778.         @target_x /= $game_troop.enemies.size
  4779.         @target_y /= $game_troop.enemies.size
  4780.       end
  4781.     when "troop" # "パーティ中央"
  4782.       @target_x = 0
  4783.       @target_y = 0
  4784.       for t in $game_party.actors
  4785.         @target_x += t.screen_x
  4786.         @target_y += t.screen_y
  4787.       end
  4788.       if $game_party.actors != []
  4789.         @target_x /= $game_party.actors.size
  4790.         @target_y /= $game_party.actors.size
  4791.       end
  4792.     when "screen" # "画面"
  4793.       @target_x = self.base_x
  4794.       @target_y = self.base_y
  4795.     end
  4796.     # 補正
  4797.     @target_x -= @move_action[1] + self.base_x
  4798.     @target_y -= @move_action[2] + self.base_y
  4799.     # 移動目標の座標をセット
  4800.     @move_coordinates = [@target_x.to_i,@target_y.to_i,@move_coordinates[0],@move_coordinates[1]]
  4801.     # 距離の計算(ウエイトの設定)
  4802.     @move_wait     = (@move_coordinates[2] - @move_coordinates[0]).abs +
  4803.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  4804.   end
  4805.   if RTAB
  4806.   alias original_x true_x
  4807.   alias original_y true_y
  4808.   else
  4809.   alias original_x screen_x
  4810.   alias original_y screen_y
  4811.   end
  4812.   #--------------------------------------------------------------------------
  4813.   # ● バトル画面 X 座標の取得(カメラ補正無し)
  4814.   #--------------------------------------------------------------------------
  4815.   def true_x
  4816.     return original_x + @ox
  4817.   end
  4818.   #--------------------------------------------------------------------------
  4819.   # ● バトル画面 Y 座標の取得(カメラ補正無し)
  4820.   #--------------------------------------------------------------------------
  4821.   def true_y
  4822.     return original_y - @height / 2 + @oy
  4823.   end
  4824.   #--------------------------------------------------------------------------
  4825.   # ● バトル画面 X 座標の取得
  4826.   #--------------------------------------------------------------------------
  4827.   def screen_x(true_x = self.true_x)
  4828.     return true_x * @real_zoom + @real_x
  4829.   end
  4830.   #--------------------------------------------------------------------------
  4831.   # ● バトル画面 Y 座標の取得
  4832.   #--------------------------------------------------------------------------
  4833.   def screen_y(true_y = self.true_y)
  4834.     return true_y * @real_zoom + @real_y
  4835.   end
  4836.   #--------------------------------------------------------------------------
  4837.   # ● バトル画面 X 座標の取得(移動などしていない場合)
  4838.   #--------------------------------------------------------------------------
  4839.   def base_x(true_x = self.true_x)
  4840.     return (true_x - @ox) * @real_zoom + @real_x
  4841.   end
  4842.   #--------------------------------------------------------------------------
  4843.   # ● バトル画面 Y 座標の取得(移動などしていない場合)
  4844.   #--------------------------------------------------------------------------
  4845.   def base_y(true_y = self.true_y)
  4846.     return (true_y - @oy) * @real_zoom + @real_y
  4847.   end
  4848. end
  4849. #==============================================================================
  4850. # ■ Game_Party
  4851. #==============================================================================
  4852. class Game_Party
  4853.   #--------------------------------------------------------------------------
  4854.   # ● アクターを加える
  4855.   #     actor_id : アクター ID
  4856.   #--------------------------------------------------------------------------
  4857.   alias side_view_add_actor add_actor
  4858.   def add_actor(actor_id)
  4859.     # アクターを取得
  4860.     actor = $game_actors[actor_id]
  4861.     # サイドビューデータの初期化
  4862.     actor.start_battle
  4863.     # 戻す
  4864.     side_view_add_actor(actor_id)
  4865.   end
  4866. end
  4867. #==============================================================================
  4868. # ■ Scene_Battle
  4869. #==============================================================================
  4870. class Scene_Battle
  4871.   include Side_view
  4872.   #--------------------------------------------------------------------------
  4873.   # ● 公開インスタンス変数
  4874.   #--------------------------------------------------------------------------
  4875.   attr_reader   :phase            # フェーズ
  4876.   attr_reader   :phase4_step      # フェーズ4ステップ
  4877.   attr_reader   :active_battler   # 対象の配列
  4878.   attr_reader   :target_battlers  # 対象の配列
  4879.   attr_reader   :animation1_id    # 行動アニメID
  4880.   attr_reader   :animation2_id    # 対象アニメID
  4881.   #--------------------------------------------------------------------------
  4882.   # ● メイン処理
  4883.   #--------------------------------------------------------------------------
  4884.   alias side_view_main main
  4885.   def main
  4886.     # バトラー初期化
  4887.     for battler in $game_party.actors + $game_troop.enemies
  4888.       battler.start_battle
  4889.     end
  4890.     # 戻す
  4891.     side_view_main
  4892.   end
  4893.   #--------------------------------------------------------------------------
  4894.   # ● 閃き判定
  4895.   #--------------------------------------------------------------------------
  4896.   def flash?
  4897.     return @flash_flag ? true : false
  4898.   end  
  4899.   #--------------------------------------------------------------------------
  4900.   # ● 閃きアニメ待ち時間取得
  4901.   #--------------------------------------------------------------------------
  4902.   def flash_duration
  4903.     animation = nil
  4904.     if FLASH_ANIME
  4905.       animation = $data_animations[FLASH_ANIMATION_ID]
  4906.     end
  4907.     return animation != nil ? animation.frame_max * 2 + 2 : 0
  4908.   end
  4909.   #--------------------------------------------------------------------------
  4910.   # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  4911.   #--------------------------------------------------------------------------
  4912.   alias side_view_update_phase4_step2 update_phase4_step2
  4913.   def update_phase4_step2(*arg)
  4914.     battler = convert_battler2(*arg)
  4915.     battler.action
  4916.     side_view_update_phase4_step2(*arg)
  4917.   end
  4918.   #--------------------------------------------------------------------------
  4919.   # ● フレーム更新 (メインフェーズ ステップ 3 : 行動側アニメーション)
  4920.   #--------------------------------------------------------------------------
  4921.   alias side_view_update_phase4_step3 update_phase4_step3
  4922.   def update_phase4_step3(*arg)
  4923.     battler = convert_battler2(*arg)
  4924.     return if !battler.animation1_on and battler.action? and !battler.flash?
  4925.     if battler.flash? and FLASH_ANIME
  4926.       battler.flash_flag["normal"] = true
  4927.     end
  4928.     side_view_update_phase4_step3(*arg)
  4929.   end
  4930.   #--------------------------------------------------------------------------
  4931.   # ● フレーム更新 (メインフェーズ ステップ 4 : 対象側アニメーション)
  4932.   #--------------------------------------------------------------------------
  4933.   alias side_view_update_phase4_step4 update_phase4_step4
  4934.   def update_phase4_step4(*arg)
  4935.     battler = convert_battler2(*arg)
  4936.     targets = RTAB ? battler.target : @target_battlers
  4937.     return if !battler.animation2_on and battler.action?
  4938.     side_view_update_phase4_step4(*arg)
  4939.     for target in targets
  4940.       if RTAB
  4941.         value = nil
  4942.         if target.damage_sp.include?(battler)
  4943.           value = target.damage_sp[battler]
  4944.         end
  4945.         if target.damage.include?(battler)
  4946.           if value == nil or value == "Miss"
  4947.             value = target.damage[battler]
  4948.           elsif value.is_a?(Numeric) && value > 0
  4949.             value = target.damage[battler] == "Miss" ? value : target.damage[battler]
  4950.           end
  4951.         end
  4952.       else
  4953.         value = target.damage
  4954.       end
  4955.       if target.is_a?(Game_Actor)
  4956.         # ダメージの場合
  4957.         if value.is_a?(Numeric) && value > 0
  4958.           # シェイクを開始
  4959.           target.shake = true
  4960.         end
  4961.       elsif target.is_a?(Game_Enemy)
  4962.         # ダメージの場合
  4963.         if value.is_a?(Numeric) && value > 0
  4964.           # シェイクを開始
  4965.           target.shake = true
  4966.         end
  4967.       end
  4968.     end
  4969.   end
  4970.   #--------------------------------------------------------------------------
  4971.   # ● プレバトルフェーズ開始
  4972.   #--------------------------------------------------------------------------
  4973.   alias start_phase1_correct start_phase1
  4974.   def start_phase1
  4975.     # カメラの設定
  4976.     # 元々フロントビュー向けの数値になっているため
  4977.     @zoom_rate = [1.0, 1.0]
  4978.     start_phase1_correct
  4979.   end
  4980.   #--------------------------------------------------------------------------
  4981.   # ● アクターコマンドフェーズ開始
  4982.   #--------------------------------------------------------------------------
  4983.   alias start_phase3_correct start_phase3
  4984.   def start_phase3
  4985.     battler = convert_battler
  4986.     start_phase3_correct
  4987.     if RTAB
  4988.       # カメラの設定
  4989.       # 元々フロントビュー向けの数値になっているため
  4990.       @camera = "command"
  4991.       @spriteset.screen_target(0, 0, 1.0)
  4992.     end
  4993.   end
  4994. end

  4995. class Spriteset_Battle
  4996.   include Side_view
  4997.   #--------------------------------------------------------------------------
  4998.   # ● オブジェクト初期化
  4999.   #--------------------------------------------------------------------------
  5000.   alias side_veiw_initialize initialize
  5001.   def initialize
  5002.     side_veiw_initialize
  5003.     # アクタースプライトを解放
  5004.     for sprite in @actor_sprites
  5005.       sprite.dispose
  5006.     end
  5007.     # アクタースプライトを作成
  5008.     @actor_sprites = []
  5009.     for i in 1..Party_max
  5010.       @actor_sprites.push(Sprite_Battler.new(@viewport1))
  5011.     end
  5012.     update
  5013.   end
  5014.   #--------------------------------------------------------------------------
  5015.   # ● 画面のスクロール
  5016.   #--------------------------------------------------------------------------
  5017.   if method_defined?("screen_scroll")
  5018.   alias side_view_screen_scroll screen_scroll
  5019.   def screen_scroll
  5020.     side_view_screen_scroll
  5021.     # アクターの位置補正
  5022.     for actor in $game_party.actors
  5023.       actor.real_x = @real_x
  5024.       actor.real_y = @real_y
  5025.       actor.real_zoom = @real_zoom
  5026.     end
  5027.   end
  5028.   end
  5029. end

  5030. class Sprite_Battler < RPG::Sprite
  5031.   include Side_view
  5032.   #--------------------------------------------------------------------------
  5033.   # ● オブジェクト初期化
  5034.   #     viewport : ビューポート
  5035.   #     battler  : バトラー (Game_Battler)
  5036.   #--------------------------------------------------------------------------
  5037.   def initialize(viewport, battler = nil)
  5038.     super(viewport)
  5039.     @battler = battler
  5040.     @battler_visible = false
  5041.     @weapon = Sprite_Weapon.new(viewport, battler)
  5042.     @flying = Sprite_Flying.new(viewport, battler)
  5043.     @shadow = []
  5044.     @fly = 0
  5045.     @fly_direction = 1
  5046.     @rand = rand(10)
  5047.     self.effect_clear
  5048.   end
  5049.   #--------------------------------------------------------------------------
  5050.   # ● 解放
  5051.   #--------------------------------------------------------------------------
  5052.   alias side_view_dispose dispose
  5053.   def dispose
  5054.     side_view_dispose
  5055.     @weapon.dispose
  5056.     @flying.dispose
  5057.     if @_target_sprite != nil
  5058.       @_target_sprite.bitmap.dispose
  5059.       @_target_sprite.dispose
  5060.       @_target_sprite = nil
  5061.     end
  5062.   end
  5063.   #--------------------------------------------------------------------------
  5064.   # ● フレーム更新
  5065.   #--------------------------------------------------------------------------
  5066.   def update
  5067.     super
  5068.     # バトラーが nil の場合
  5069.     if @battler == nil
  5070.       self.bitmap = nil
  5071.       @weapon.bitmap = nil
  5072.       loop_animation(nil)
  5073.       return
  5074.     end
  5075.     # バトラー更新
  5076.     @battler.update
  5077.     # バトラーアニメのデータ取得
  5078.     @anime_type = @battler.anime_type
  5079.     # ファイル名か色相が現在のものと異なる場合
  5080.     if @battler.is_a?(Game_Actor)
  5081.       change = (@battler.character_name != @battler_name or @battler.character_hue != @battler_hue)
  5082.     elsif @battler.is_a?(Game_Enemy)
  5083.       change = (@battler.battler_name != @battler_name or @battler.battler_hue != @battler_hue)
  5084.     else
  5085.       return
  5086.     end
  5087.     if change
  5088.       # ビットマップを取得、設定
  5089.       if @battler.is_a?(Game_Actor)
  5090.         @battler_name = @battler.character_name
  5091.         @battler_hue = @battler.character_hue
  5092.         self.bitmap = RPG::Cache.character(@battler_name, @battler_hue)
  5093.         @width = bitmap.width / 4
  5094.         @height = bitmap.height / 4
  5095.       else
  5096.         @battler_name = @battler.battler_name
  5097.         @battler_hue = @battler.battler_hue
  5098.         self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  5099.         @width = bitmap.width
  5100.         @height = bitmap.height
  5101.       end
  5102.       self.ox = @width / 2
  5103.       self.oy = @height / 2
  5104.       @battler.height = @height
  5105.       @flag = true
  5106.       # 戦闘不能または隠れ状態なら不透明度を 0 にする
  5107.       if @battler.dead? or @battler.hidden
  5108.         self.opacity = 0
  5109.       end
  5110.     end
  5111.     if @battler.is_a?(Game_Actor) and
  5112.       (@battler.anime_type != @anime_type or @battler.pattern != @pattern or @flag)
  5113.       # ビットマップを取得、設定
  5114.       @pattern = @battler.pattern
  5115.       self.ox = @width / 2
  5116.       self.oy = @height / 2
  5117.       @sx = @pattern * @width
  5118.       @sy = @anime_type % 4 * @height
  5119.       self.src_rect.set(@sx, @sy, @width, @height)
  5120.       self.zoom_x = CHAR_ZOOM
  5121.       self.zoom_y = CHAR_ZOOM
  5122.       @battler.height = @height
  5123.       @flag = false
  5124.     end
  5125.     # 飛行
  5126.     update_fly
  5127.     # シェイク
  5128.     update_shake
  5129.     # 回転
  5130.     update_turning
  5131.     # 反転
  5132.     update_reverse   
  5133.     # 移動
  5134.     update_moving
  5135.     # 追加アニメ
  5136.     update_add_anime
  5137.     # エフェクト効果の適用
  5138.     update_effect
  5139.     # アニメーション ID が現在のものと異なる場合
  5140.     flag = RTAB ? true : @battler.damage == nil
  5141.     if flag and @battler.state_animation_id != @state_animation_id
  5142.       @state_animation_id = @battler.state_animation_id
  5143.       loop_animation($data_animations[@state_animation_id])
  5144.     end
  5145.     # シェイク
  5146.     if @battler.shake
  5147.       self.start_shake(5, 5, 5)
  5148.       @battler.shake = false
  5149.     end
  5150.     # 明滅
  5151.     if @battler.blink
  5152.       blink_on
  5153.     else
  5154.       blink_off
  5155.     end
  5156.     # 不可視の場合
  5157.     unless @battler_visible
  5158.       flag = RTAB ? (@battler.damage.size < 2 or @battler.damage_pop.size < 2) :
  5159.                     (@battler.damage == nil or @battler.damage_pop)
  5160.       # 出現
  5161.       if not @battler.hidden and not @battler.dead? and flag
  5162.         appear
  5163.         @battler_visible = true
  5164.       end
  5165.     end
  5166.     if RTAB
  5167.     # ダメージ
  5168.     for battler in @battler.damage_pop
  5169.       if battler[0].class == Array
  5170.         if battler[0][1] >= 0
  5171.           $scene.skill_se
  5172.         else
  5173.           $scene.levelup_se
  5174.         end
  5175.         damage(@battler.damage[battler[0]], false, 2)
  5176.       else
  5177.         damage(@battler.damage[battler[0]], @battler.critical[battler[0]])
  5178.       end
  5179.       if @battler.damage_sp.include?(battler[0])
  5180.         damage(@battler.damage_sp[battler[0]],
  5181.                 @battler.critical[battler[0]], 1)
  5182.         @battler.damage_sp.delete(battler[0])
  5183.       end
  5184.       @battler.damage_pop.delete(battler[0])
  5185.       @battler.damage.delete(battler[0])
  5186.       @battler.critical.delete(battler[0])
  5187.     end
  5188.     end
  5189.     # 可視の場合
  5190.     if @battler_visible
  5191.       # 武器アニメ
  5192.       @weapon.battler = @battler
  5193.       @weapon.update
  5194.       # 遠距離アニメ
  5195.       @flying.battler = @battler
  5196.       @flying.update
  5197.       # 逃走
  5198.       if @battler.hidden
  5199.         $game_system.se_play($data_system.escape_se)
  5200.         escape
  5201.         @battler_visible = false
  5202.       end
  5203.       # 白フラッシュ
  5204.       if @battler.white_flash
  5205.         whiten
  5206.         @battler.white_flash = false
  5207.       end
  5208.       if RTAB
  5209.       # アニメーション
  5210.       if !@battler.animation.empty?
  5211.         for animation in @battler.animation.reverse
  5212.           if animation[2]
  5213.             animation($data_animations[animation[0]], animation[1], true)
  5214.           else
  5215.             animation($data_animations[animation[0]], animation[1])
  5216.           end
  5217.           @battler.animation.delete(animation)
  5218.         end
  5219.       end
  5220.       else
  5221.       # アニメーション
  5222.       if @battler.animation_id != 0
  5223.         animation = $data_animations[@battler.animation_id]
  5224.         animation(animation, @battler.animation_hit)
  5225.         @battler.animation_id = 0
  5226.       end
  5227.       end
  5228.       # ダメージ
  5229.       if !RTAB and @battler.damage_pop
  5230.         damage(@battler.damage, @battler.critical)
  5231.         @battler.damage = nil
  5232.         @battler.critical = false
  5233.         @battler.damage_pop = false
  5234.       end
  5235.       flag = RTAB ? (@battler.damage.empty? and $scene.dead_ok?(@battler)) :
  5236.                      @battler.damage == nil
  5237.       # コラプス
  5238.       if flag and @battler.dead?
  5239.         if @battler.is_a?(Game_Actor)
  5240.           $game_system.se_play($data_system.actor_collapse_se)
  5241.         elsif @battler.is_a?(Game_Enemy)
  5242.           $game_system.se_play($data_system.enemy_collapse_se)
  5243.         end
  5244.         collapse
  5245.         @battler_visible = false
  5246.       end
  5247.     end
  5248.     # スプライトの座標を設定
  5249.     self.x = @battler.screen_x + @effect_ox
  5250.     self.y = @battler.screen_y + @effect_oy
  5251.     self.z = @battler.screen_z
  5252.     self.zoom_x = @battler.real_zoom
  5253.     self.zoom_y = @battler.real_zoom
  5254.     # ウェイトカウントを減らす
  5255.     @battler.wait_count -= 1
  5256.     @battler.wait_count2 -= 1
  5257.     # アニメーション待ち時間取得
  5258.     @battler.animation_duration = @_animation_duration
  5259.     if @battler.is_a?(Game_Actor)
  5260.       self.zoom_x *= CHAR_ZOOM
  5261.       self.zoom_y *= CHAR_ZOOM
  5262.       @weapon.x = self.x + 2
  5263.       @weapon.y = self.y + 6
  5264.       @weapon.angle = 75 - (4 - @battler.pattern) * 45
  5265.       if self.mirror
  5266.         @weapon.angle += @weapon.angle - 180
  5267.       end
  5268.     end
  5269.     # 残像
  5270.     if @battler.shadow
  5271.       if Graphics.frame_count % 2 == 0
  5272.         shadow = ::Sprite.new(self.viewport)
  5273.         shadow.bitmap = self.bitmap.dup
  5274.         shadow.x = self.x
  5275.         shadow.y = self.y
  5276.         shadow.ox = self.ox
  5277.         shadow.oy = self.oy
  5278.         shadow.mirror = self.mirror
  5279.         shadow.angle = self.angle
  5280.         shadow.opacity = 160
  5281.         shadow.zoom_x = self.zoom_x
  5282.         shadow.zoom_y = self.zoom_y
  5283.         if @battler.is_a?(Game_Actor)
  5284.           shadow.src_rect.set(@sx, @sy, @width, @height)
  5285.         else
  5286.           shadow.src_rect.set(0, 0, @width, @height)
  5287.         end
  5288.         @shadow.push([shadow,duration = 10,@battler.true_x + @effect_ox,@battler.true_y + @effect_oy])
  5289.       end
  5290.     end
  5291.     for s in @shadow
  5292.       if !s[0].disposed?
  5293.         s[0].update
  5294.         s[1] -= 1
  5295.         if s[1] < 1
  5296.           if s[0].bitmap != nil
  5297.             s[0].bitmap.dispose
  5298.           end
  5299.           s[0].dispose
  5300.         else
  5301.           s[0].x = @battler.screen_x(s[2])
  5302.           s[0].y = @battler.screen_y(s[3])
  5303.         end
  5304.       else
  5305.         s = nil
  5306.       end
  5307.     end
  5308.     @shadow.compact!
  5309.   end
  5310.   #--------------------------------------------------------------------------
  5311.   # ● エフェクトによる座標系の更新
  5312.   #--------------------------------------------------------------------------
  5313.   def update_effect
  5314.     # 角度の修正
  5315.     if @_upside_down
  5316.       self.angle = (@_turning + 180) % 360
  5317.     else
  5318.       self.angle = @_turning
  5319.     end
  5320.     # X 座標の修正値
  5321.     @effect_ox = @_shake + @_moving[0]
  5322.     # Y 座標の修正値
  5323.     @effect_oy = -@fly + @_moving[1]
  5324.     if  @_animation == nil or (RTAB and @_animation.empty?)
  5325.       self.effect_clear
  5326.     end
  5327.   end
  5328.   #--------------------------------------------------------------------------
  5329.   # ● シェイク更新
  5330.   #--------------------------------------------------------------------------
  5331.   def update_shake
  5332.     if @_shake_duration >= 1 or @_shake != 0
  5333.       delta = (@_shake_power * @_shake_speed * @_shake_direction) / 10.0
  5334.       if @_shake_duration <= 1 and @_shake * (@_shake + delta) < 0
  5335.         @_shake = 0
  5336.       else
  5337.         @_shake += delta
  5338.       end
  5339.       if @_shake > @_shake_power * 2
  5340.         @_shake_direction = -1
  5341.       end
  5342.       if @_shake < - @_shake_power * 2
  5343.         @_shake_direction = 1
  5344.       end
  5345.       if @_shake_duration >= 1
  5346.         @_shake_duration -= 1
  5347.       end
  5348.     end
  5349.   end
  5350.   #--------------------------------------------------------------------------
  5351.   # ● 飛行更新
  5352.   #--------------------------------------------------------------------------
  5353.   def update_fly
  5354.     if @rand > 0
  5355.       @rand -= 1
  5356.       return
  5357.     end
  5358.     if @battler.fly != 0
  5359.       if @fly < @battler.fly / 4
  5360.         @fly_direction = 1
  5361.       elsif @fly > @battler.fly / 2
  5362.         @fly_direction = -1
  5363.       end
  5364.       @fly += 0.5 * @fly_direction
  5365.     end
  5366.   end
  5367.   #--------------------------------------------------------------------------
  5368.   # ● 回転更新
  5369.   #--------------------------------------------------------------------------
  5370.   def update_turning
  5371.     if @_turning_duration > 0 or @_turning != 0
  5372.       @_turning += @_turning_direction * @_turning_speed / 2.0
  5373.       # 残り回転数を減らす
  5374.       if @_turning_direction == -1
  5375.         if @_turning_duration > 0 and @_turning < 0
  5376.           @_turning_duration -= 1
  5377.         end
  5378.       elsif @_turning_direction == 1
  5379.         if @_turning_duration > 0 and @_turning >= 360
  5380.           @_turning_duration -= 1
  5381.         end
  5382.       end
  5383.       # 以下補正
  5384.       while @_turning < 0
  5385.         @_turning += 360
  5386.       end
  5387.       if @_turning_duration <= 0
  5388.         @_turning = 0
  5389.       end
  5390.       @_turning %= 360
  5391.     end
  5392.   end
  5393.   #--------------------------------------------------------------------------
  5394.   # ● 左右反転更新
  5395.   #--------------------------------------------------------------------------
  5396.   def update_reverse
  5397.     if @last_reverse != (@_reverse or @battler.reverse)
  5398.       self.mirror = (@_reverse or @battler.reverse)
  5399.       @last_reverse = (@_reverse or @battler.reverse)
  5400.     end
  5401.   end
  5402.   #--------------------------------------------------------------------------
  5403.   # ● 移動更新
  5404.   #--------------------------------------------------------------------------
  5405.   def update_moving
  5406.     @move_distance = (@_move_coordinates[2] - @_move_coordinates[0]).abs +
  5407.                      (@_move_coordinates[3] - @_move_coordinates[1]).abs
  5408.     if @move_distance > 0
  5409.       return if @_moving[0] == @_move_coordinates[0] and @_moving[1] == @_move_coordinates[1]
  5410.       array = @_move_coordinates
  5411.       x = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @_move_duration) / @move_distance.to_f).to_i
  5412.       y = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @_move_duration) / @move_distance.to_f).to_i
  5413.       @_moving = [x, y]
  5414.       if @_move_quick_return and @_move_duration == 0
  5415.         @_move_coordinates = [0,0,array[0],array[1]]
  5416.         @_move_duration = @move_distance
  5417.       end
  5418.       @_move_duration -= @_move_speed
  5419.       @_move_duration = [@_move_duration, 0].max
  5420.     end
  5421.   end
  5422.   #--------------------------------------------------------------------------
  5423.   # ● 追加アニメ更新 (RTAB限定機能)
  5424.   #--------------------------------------------------------------------------
  5425.   def update_add_anime
  5426.     if RTAB
  5427.     # アニメーション
  5428.     if @_add_anime_id != 0
  5429.       animation = $data_animations[@_add_anime_id]
  5430.       animation(animation, true)
  5431.       @_add_anime_id = 0
  5432.     end
  5433.     end
  5434.   end
  5435.   #--------------------------------------------------------------------------
  5436.   # ● エフェクト初期化
  5437.   #--------------------------------------------------------------------------
  5438.   def effect_clear
  5439.     @_effect_ox = 0
  5440.     @_effect_oy = 0
  5441.     @_shake_power = 0
  5442.     @_shake_speed = 0
  5443.     @_shake_duration = 0
  5444.     @_shake_direction = 1
  5445.     @_shake = 0
  5446.     @_upside_down = false
  5447.     @_reverse = false
  5448.     @_turning_direction = 1
  5449.     @_turning_speed = 0
  5450.     @_turning_duration = 0
  5451.     @_turning = 0
  5452.     @_move_quick_return = true
  5453.     @_move_speed = 0
  5454.     @_move_coordinates = [0,0,0,0]
  5455.     @_move_jump = false
  5456.     @_move_duration = 0
  5457.     @_moving = [0,0]
  5458.     @_add_anime_id = 0
  5459.   end
  5460.   #--------------------------------------------------------------------------
  5461.   # ● シェイクの開始
  5462.   #     power    : 強さ
  5463.   #     speed    : 速さ
  5464.   #     duration : 時間
  5465.   #--------------------------------------------------------------------------
  5466.   def start_shake(power, speed, duration)
  5467.     @_shake_power = power
  5468.     @_shake_speed = speed
  5469.     @_shake_duration = duration
  5470.   end
  5471.   #--------------------------------------------------------------------------
  5472.   # ● 上下反転を開始
  5473.   #--------------------------------------------------------------------------
  5474.   def start_upside_down
  5475.     @_upside_down = @_upside_down ? false : true
  5476.   end
  5477.   #--------------------------------------------------------------------------
  5478.   # ● 左右反転を開始
  5479.   #--------------------------------------------------------------------------
  5480.   def start_reverse
  5481.     @_reverse = @_reverse ? false : true
  5482.   end
  5483.   #--------------------------------------------------------------------------
  5484.   # ● 回転を開始
  5485.   #     direction: 方向
  5486.   #     speed    : 速さ
  5487.   #     duration : 時間
  5488.   #--------------------------------------------------------------------------
  5489.   def start_turning(direction, speed, duration)
  5490.     @_turning_direction = direction
  5491.     @_turning_speed = speed
  5492.     @_turning_duration = duration
  5493.     @_turning = @_turning_direction == 1 ? 0 : 360
  5494.   end
  5495.   #--------------------------------------------------------------------------
  5496.   # ● 移動を開始
  5497.   #     quick_return : 戻るかどうか
  5498.   #     speed        : 速さ
  5499.   #     x            : X 座標
  5500.   #     y            : Y 座標
  5501.   #--------------------------------------------------------------------------
  5502.   def start_moving(quick_return, speed, x, y)
  5503.     @_move_quick_return = quick_return == 0 ? false : true
  5504.     @_move_speed = speed
  5505.     @_move_coordinates = [x,y,@_move_coordinates[0],@_move_coordinates[1]]
  5506.     distance = (@_move_coordinates[2] - @_move_coordinates[0]).abs +
  5507.                (@_move_coordinates[3] - @_move_coordinates[1]).abs
  5508.     @_move_duration = distance
  5509.   end
  5510.   #--------------------------------------------------------------------------
  5511.   # ● アニメ追加を開始
  5512.   #     id           : ID
  5513.   #     hit          : 命中フラッグ
  5514.   #--------------------------------------------------------------------------
  5515.   def start_add_anime(id)
  5516.     @_add_anime_id = id
  5517.   end
  5518.   #--------------------------------------------------------------------------
  5519.   # ● 各種エフェクトの開始判定
  5520.   #--------------------------------------------------------------------------
  5521.   if !method_defined?("side_view_animation_process_timing")
  5522.     alias side_view_animation_process_timing animation_process_timing
  5523.   end
  5524.   def animation_process_timing(timing, hit)
  5525.     side_view_animation_process_timing(timing, hit)
  5526.     if (timing.condition == 0) or
  5527.        (timing.condition == 1 and hit == true) or
  5528.        (timing.condition == 2 and hit == false)
  5529.       if timing.se.name =~ SHAKE_FILE
  5530.         names = timing.se.name.split(/#/)
  5531.         power    = names[1].nil? ? SHAKE_POWER    : names[1].to_i
  5532.         speed    = names[2].nil? ? SHAKE_SPEED    : names[2].to_i
  5533.         duration = names[3].nil? ? SHAKE_DURATION : names[3].to_i
  5534.         # シェイクを開始
  5535.         self.start_shake(power, speed, duration)
  5536.       end
  5537.       if timing.se.name == UPSIDE_DOWN_FILE
  5538.         # 上下反転を開始
  5539.         self.start_upside_down
  5540.       end
  5541.       if timing.se.name == REVERSE_FILE
  5542.         # 左右反転を開始
  5543.         self.start_reverse
  5544.       end
  5545.       if timing.se.name =~ TURNING_FILE
  5546.         names = timing.se.name.split(/#/)
  5547.         direction = names[1].nil? ? TURNING_DIRECTION : names[1].to_i
  5548.         speed     = names[2].nil? ? TURNING_SPEED     : names[2].to_i
  5549.         duration  = names[3].nil? ? TURNING_DURATION  : names[3].to_i
  5550.         # 回転を開始
  5551.         self.start_turning(direction, speed, duration)
  5552.       end
  5553.       if timing.se.name =~ MOVE_FILE
  5554.         names = timing.se.name.split(/#/)
  5555.         quick_return= names[1].nil? ? MOVE_RETURN      : names[1].to_i
  5556.         speed       = names[2].nil? ? MOVE_SPEED       : names[2].to_i
  5557.         x           = names[3].nil? ? MOVE_COORDINATES[0] : names[3].to_i
  5558.         y           = names[3].nil? ? MOVE_COORDINATES[1] : names[4].to_i
  5559.         # 移動を開始
  5560.         self.start_moving(quick_return, speed, x, y)
  5561.       end
  5562.       if timing.se.name =~ ADD_ANIME_FILE
  5563.         names = timing.se.name.split(/#/)
  5564.         id = names[1].nil? ? ADD_ANIME_ID      : names[1].to_i
  5565.         # アニメ追加を開始
  5566.         self.start_add_anime(id)
  5567.       end
  5568.     end
  5569.   end
  5570. end
  5571. #==============================================================================
  5572. # ■ Sprite_Weapon
  5573. #------------------------------------------------------------------------------
  5574. #  バトラー表示用のスプライトです。Game_Battler クラスのインスタンスを監視し、
  5575. # スプライトの状態を自動的に変化させます。
  5576. #==============================================================================

  5577. class Sprite_Weapon < RPG::Sprite
  5578.   include Side_view
  5579.   #--------------------------------------------------------------------------
  5580.   # ● 公開インスタンス変数
  5581.   #--------------------------------------------------------------------------
  5582.   attr_accessor :battler                  # バトラー
  5583.   attr_reader   :cw                       # グラフィックの幅
  5584.   attr_reader   :ch                       # グラフィックの高さ
  5585.   #--------------------------------------------------------------------------
  5586.   # ● オブジェクト初期化
  5587.   #     viewport : ビューポート
  5588.   #     battler  : バトラー (Game_Battler)
  5589.   #--------------------------------------------------------------------------
  5590.   def initialize(viewport, battler = nil)
  5591.     super(viewport)
  5592.     @battler = battler
  5593.     @battler_visible = false
  5594.   end
  5595.   #--------------------------------------------------------------------------
  5596.   # ● 解放
  5597.   #--------------------------------------------------------------------------
  5598.   def dispose
  5599.     if self.bitmap != nil
  5600.       self.bitmap.dispose
  5601.     end
  5602.     super
  5603.   end
  5604.   #--------------------------------------------------------------------------
  5605.   # ● フレーム更新
  5606.   #--------------------------------------------------------------------------
  5607.   def update
  5608.     super
  5609.     # バトラーが nil の場合
  5610.     if @battler == nil or !@battler.is_a?(Game_Actor)
  5611.       self.bitmap = nil
  5612.       return
  5613.     end
  5614.     # ウエポンアニメのデータ取得
  5615.     @weapon_anime_type = @battler.weapon_anime_type(@battler.condition)
  5616.     # 設定が「非表示」の場合
  5617.     if !@weapon_anime_type[1] or @weapon_anime_type[0].nil?
  5618.       self.visible = false
  5619.       return
  5620.     else
  5621.       self.visible = true
  5622.     end
  5623.     # ファイル名が現在のものと異なる場合
  5624.     if @weapon_anime_type[0] != @weapon_name
  5625.       @weapon_name = @weapon_anime_type[0]
  5626.       # ビットマップを取得、設定
  5627.       self.bitmap = RPG::Cache.icon(@weapon_name)
  5628.       @width = bitmap.width
  5629.       @height = bitmap.height
  5630.       @flag = true
  5631.     end
  5632.     # 現在アニメパターンが現在のものと異なる場合
  5633.     if @pattern != @battler.pattern or @flag or @condition != @battler.condition
  5634.       @pattern = @battler.pattern
  5635.       @condition = @battler.condition
  5636.       self.ox = @width
  5637.       self.oy = @height
  5638.       self.z = battler.screen_z
  5639.       self.zoom_x = @battler.real_zoom * CHAR_ZOOM
  5640.       self.zoom_y = @battler.real_zoom * CHAR_ZOOM
  5641.       self.src_rect.set(0, 0, @width, @height)
  5642.       self.opacity = 255
  5643.       # バトラーより手前に表示
  5644.       if @weapon_anime_type[2]
  5645.         self.z += 10
  5646.       # バトラーより奥に表示
  5647.       else
  5648.         self.z -= 10
  5649.       end
  5650.       @flag = false
  5651.     end
  5652.   end
  5653. end

  5654. #==============================================================================
  5655. # ■ Sprite_Flying
  5656. #------------------------------------------------------------------------------
  5657. #  バトラー表示用のスプライトです。Game_Battler クラスのインスタンスを監視し、
  5658. # スプライトの状態を自動的に変化させます。
  5659. #==============================================================================

  5660. class Sprite_Flying < RPG::Sprite
  5661.   include Side_view
  5662.   #--------------------------------------------------------------------------
  5663.   # ● 公開インスタンス変数
  5664.   #--------------------------------------------------------------------------
  5665.   attr_accessor :battler                  # バトラー
  5666.   #--------------------------------------------------------------------------
  5667.   # ● オブジェクト初期化
  5668.   #     viewport : ビューポート
  5669.   #     battler  : バトラー (Game_Battler)
  5670.   #--------------------------------------------------------------------------
  5671.   def initialize(viewport, battler = nil)
  5672.     super(viewport)
  5673.     @battler = battler
  5674.     @battler_visible = false
  5675.   end
  5676.   #--------------------------------------------------------------------------
  5677.   # ● 解放
  5678.   #--------------------------------------------------------------------------
  5679.   def dispose
  5680.     if self.bitmap != nil
  5681.       self.bitmap.dispose
  5682.     end
  5683.     super
  5684.   end
  5685.   #--------------------------------------------------------------------------
  5686.   # ● フレーム更新
  5687.   #--------------------------------------------------------------------------
  5688.   def update
  5689.     super
  5690.     # バトラーが nil の場合
  5691.     if @battler == nil
  5692.       self.bitmap = nil
  5693.       loop_animation(nil)
  5694.       return
  5695.     end
  5696.     # 遠距離アニメ
  5697.     flying_animation = @battler.flying_animation
  5698.     flying_start = flying_animation[0]
  5699.     flying_end   = flying_animation[1]
  5700.     # アニメーション ID が現在のものと異なる場合
  5701.     if @anime_id != @battler.flying_anime[0]
  5702.       @anime_id = @battler.flying_anime[0]
  5703.       @animation = $data_animations[@anime_id]
  5704.     end
  5705.     # アニメーション 開始
  5706.     if flying_start
  5707.       loop_animation(@animation)
  5708.     elsif flying_end
  5709.       loop_animation(nil)
  5710.     end
  5711.     self.x = @battler.flying_x
  5712.     self.y = @battler.flying_y
  5713.     self.z = @battler.screen_z + 1000
  5714.   end
  5715. end

  5716. module RPG
  5717.   class Skill
  5718.     #--------------------------------------------------------------------------
  5719.     # ● 魔法かどうかの判断
  5720.     #--------------------------------------------------------------------------
  5721.     def magic?
  5722.       if @atk_f == 0
  5723.         return true
  5724.       else
  5725.         return false
  5726.       end
  5727.     end
  5728.   end
  5729. end

  5730. # アローカーソルの位置修正

  5731. class Arrow_Actor < Arrow_Base
  5732.   include Side_view
  5733.   #--------------------------------------------------------------------------
  5734.   # ● フレーム更新
  5735.   #--------------------------------------------------------------------------
  5736.   alias side_view_update update
  5737.   def update
  5738.     side_view_update
  5739.     # スプライトの座標を設定
  5740.     if self.actor != nil && (self.x != self.actor.screen_x + ARROW_OX or self.y != self.actor.screen_y + ARROW_OY)
  5741.       self.x = self.actor.screen_x + ARROW_OX
  5742.       self.y = self.actor.screen_y + ARROW_OY
  5743.     end
  5744.   end
  5745. end
  5746. class Arrow_Enemy < Arrow_Base
  5747.   include Side_view
  5748.   #--------------------------------------------------------------------------
  5749.   # ● フレーム更新
  5750.   #--------------------------------------------------------------------------
  5751.   alias side_view_update update
  5752.   def update
  5753.     side_view_update
  5754.     # スプライトの座標を設定
  5755.     if self.enemy != nil && self.y != self.enemy.screen_y + self.enemy.height/2
  5756.       self.x = self.enemy.screen_x
  5757.       self.y = self.enemy.screen_y + self.enemy.height/2
  5758.     end
  5759.   end
  5760. end
复制代码


放在一起时  无法发动技能    如果使用技能那么脚本中(加上mine)
  #--------------------------------------------------------------------------
  # ● 刷新画面 (角色命令回合 : 选择特技)
  #--------------------------------------------------------------------------
  alias first_reupdate_phase3_skill_select update_phase3_skill_select
  def update_phase3_skill_select
# -------------------
# 修改開始
    @skill_window.help_window.visible = false#★★★★★★★★★★★★★
# 修改終了
# -------------------
    first_reupdate_phase3_skill_select
  end

系统会报  1484行        @skill_window.help_window.visible = false#★★★★★★★★★★★★★
出现问题


  我对于脚本神马的一窍不通     想求求各位路过的大神们解救
梦石
0
星屑
12161
在线时间
4435 小时
注册时间
2014-4-11
回帖
5616

开拓者

发表于 2014-11-19 12:15:40 | 显示全部楼层
本帖最后由 yang1zhi 于 2014-11-19 12:17 编辑

这些我不懂。不过我用的是菜鸟横版加即时战斗系统,加连击,加技能特效,加物品分类,加物品详细介绍,加技能详细介绍,等等


菜鸟横版modified(敌人也玩行走图)
  1. =begin
  2. ###############################################################################

  3. 全局行走图战斗 v1.1
  4. 本版本只经低测试,可能存在某些bug。
  5. 请注意更新
  6. [url]http://rpg.blue/viewthread.php?tid=129875&extra=page%3D1[/url]

  7. ###############################################################################
  8. ------------------------------------------------------------------------------
  9. 经过了两次的修改,终于完全实现了远距离攻击的效果(弓箭、铳类)
  10. 另外,也实现了简单的回旋攻击(类似回力镖的攻击)和攻击道具(类似石头或炸弹)

  11. 这个脚本的更动分为2部分:
  12. 1)战斗动作 - 新加了数个动作,如:“弓箭攻击”、“远距离发动”等等
  13. 2)战斗动画 - 基本上是脚本原带的。只是这个功能被隐藏起来了。现在已恢复。

  14. 用法:
  15. 在相应的脚本行加入武器/技能/道具的数据库id(id之间要用“,”来分开)
  16. 如果不要某些功能的话就随便填一个外太空id就行了(没有用到的id)
  17. 1)战斗动作(角色/行走图的动作)
  18. 脚本355行:  远程武器的id  (普通攻击时使用远程射击)
  19. 脚本357行:  回旋武器的id  (普通攻击时会飞回手上的武器,如:回力镖)
  20. 脚本370行:  远程技能的id  (使用技能时是远程射击)
  21. 脚本372行:  回旋技能的id  (使用技能时,飞出的武器会飞回手上)

  22. 2)战斗动画(显示‘对象方的动画’之前先显示‘飞行武器射去敌人身上’的动画)
  23. 脚本453行:  回旋武器的id  (攻击时会显示一段类似回力镖的动画)
  24. 脚本455行:  弓箭武器的id  (攻击时会显示箭射去敌人身上的动画)
  25. 脚本457行:  铳类武器的id  (攻击时会显示子弹射去敌人身上的动画)
  26. 脚本470行:  回旋技能的id  (技能使用时会显示一段类似回力镖的动画)
  27. 脚本472行:  弓箭技能的id  (技能使用时会显示箭射去敌人身上的动画)
  28. 脚本474行:  铳类技能的id  (技能使用时会显示子弹射去敌人身上的动画)
  29. 脚本486行:  抛击道具的id  (使用该道具时,道具被丢到敌人身上)

  30. 〉注意:
  31. 〉‘飞行武器射去敌人身上’的动画是在设定id之后的那句脚本里面设置
  32. 〉例子:(脚本第455和456行)
  33. 〉       when 17,18,19,20    #远程武器1(弓箭类)的id
  34. 〉       return [101,32,false,false]
  35. 〉这样,武器17~20(都是弓箭)在显示‘对象方的动画’之前会先显示第101号动画
  36. 〉而动画的轨道是从使用者身上直到敌人身上(实现子弹射出的效果)
  37.   
  38. 还有:
  39. 战斗队伍的画面位置已经被修改过,
  40. 让角色的位置与默认的战斗背景图不会有视觉上的冲突。
  41. 如果要更改请去脚本第113-116行改改就行了。

  42. 脚本‘Arrow_Enemy’和‘Arrow_Actor’被稍微修改过(可以无视)

  43. 这个范例附带了
  44. 一张经过修改的战斗背景图(027-castle03),其他的战斗背景图可以使用默认的。
  45. 一套横版的默认敌人的战斗图(从行走图改过来的)

  46. =end                                                        #modify by darkten

  47. ###############################################################################

  48. =begin

  49. 此版本更新了以下几点:
  50. 1.支持敌人行走图战斗
  51. 2.修正与RTAB并用的bug。
  52. 3.支持敌人也玩小石头

  53. 使用方法:
  54. 1.敌人的战斗图名称要与敌人的行走图名称相一致,具体查看本范例编号为2的敌人。
  55. 2.请自行设置 160 ~ 173 行的内容。

  56.                                                                   by ONEWateR
  57. =end
  58. ###############################################################################
  59.   
  60. module Side_view
  61.   #--------------------------------------------------------------------------
  62.   # ● 是否与RATB并用 ☆自动识别(这到是不错~省了~)
  63.   #    在Scene_Battle计算方法是否是方法synthe?
  64.   #    在自动不想认识的时候,请重写。
  65.   #--------------------------------------------------------------------------
  66.   if Scene_Battle.method_defined?("synthe?")
  67.     RTAB = true
  68.   else
  69.     RTAB = false
  70.   end
  71.   #--------------------------------------------------------------------------
  72.   # ● 改正RATB中的位置误差 ☆自动识别
  73.   #    在自动不想认识的时候,请重写。
  74.   #--------------------------------------------------------------------------
  75.   def camera_correctness
  76.     return false if !RTAB
  77.     begin
  78.       return $scene.drive
  79.     rescue
  80.       return false
  81.     end
  82.   end
  83.   #--------------------------------------------------------------------------
  84.   # ● 队伍中的最大人数
  85.   #--------------------------------------------------------------------------
  86.   Party_max = 4
  87.   #--------------------------------------------------------------------------
  88.   # ● 战斗图的扩大率(1.0的时候是保持原有大小)
  89.   #--------------------------------------------------------------------------
  90.   CHAR_ZOOM = 1.0
  91.   #--------------------------------------------------------------------------
  92.   # ● 光标的位置修正(基本不需要改~)
  93.   #--------------------------------------------------------------------------
  94.   ARROW_OX = 0
  95.   ARROW_OY = 64
  96.   #--------------------------------------------------------------------------
  97.   # ● 名状态作为飞行管理的排列(不知道什么意思....)
  98.   #--------------------------------------------------------------------------
  99.   FLY_STATES = ["飛行"]
  100.   #--------------------------------------------------------------------------
  101.   # ● 战斗画面的位置
  102.   #--------------------------------------------------------------------------
  103.   PARTY_X = 455     # 队伍 X 位置
  104.   PARTY_Y = 200     # 队伍 Y 位置
  105.   FORMATION_X = 15  # 各个角色之间的间隔 X
  106.   FORMATION_Y = 35  # 各个角色之间的间隔 Y
  107.   #--------------------------------------------------------------------------
  108.   # ● 自定义常数
  109.   #--------------------------------------------------------------------------
  110.   NORMAL   = "NORMAL"
  111.   WALK_R   = "WALK_R"
  112.   WALK_L   = "WALK_L"
  113.   ATTACK   = "ATTACK"
  114.   ATTACK_R = "ATTACK_R"
  115.   ATTACK_L = "ATTACK_L"
  116.   MAGIC    = "MAGIC"
  117.   ITEM     = "ITEM"
  118.   # 动画的设定
  119.   ANIME = {
  120.     # [画像ID,是否循环,アニメスピード,动画速度,不能指向动画,武器放在右手or左手]
  121.     NORMAL            => [1,true , 0,false, true ,""    ], # 通常待击
  122.     WALK_R            => [2,true , 2,false, false,""    ], # 右移动
  123.     WALK_L            => [1,true , 2,false, false,""    ], # 左移动
  124.     ATTACK_R          => [1,false, 2,true , false,"右手"], # 右手攻击
  125.     ATTACK_L          => [1,false, 2,true , false,"左手"], # 左手攻击
  126.     MAGIC             => [1,false, 2,false, false,""    ], # 右手攻击
  127.     ITEM              => [1,false, 2,false, false,""    ], # 左手攻击
  128.     }
  129.    
  130.   # 债务不履行声明价值的设定(一个字一个字翻译的,不知道啥意思)  
  131.   ANIME.default = [1,false,12,false,"",""]
  132.   
  133.   # 在行动设定的时候 右手攻击 or 左手攻击 辨别を(这个不知道什么意思)的ANIME
  134.   # "角色动画变更#ATTACK"在玩了と(还是不知道啥意思..)的时候,辨别ATTACK_R或者ATTACK_L
  135.   DUAL_WEAPONS_ANIME = [ATTACK]
  136.   
  137.   
  138.   #--------------------------------------------------------------------------
  139.   # ● 战斗图不是行走图的敌人编号
  140.   #--------------------------------------------------------------------------
  141.   NOT_CHARACTER_EMEMY = [999]
  142.   #--------------------------------------------------------------------------
  143.   # ● 敌人使用的武器
  144.   #    敌人编号=>武器编号
  145.   #--------------------------------------------------------------------------
  146.   EMEMY_WEAPO = {33=>2,7=>17}
  147.   EMEMY_WEAPO = {8=>9,9=>10}
  148.   #--------------------------------------------------------------------------
  149.   # ● 敌人使用的武器 (二刀流)
  150.   #    敌人编号=>武器编号
  151.   #--------------------------------------------------------------------------
  152.   EMEMY_WEAPO2 = {}
  153.   
  154.   
  155.   #--------------------------------------------------------------------------
  156.   # ● 摇晃的设定
  157.   #--------------------------------------------------------------------------
  158.   SHAKE_FILE = "摇晃"  # 文件名
  159.   SHAKE_POWER = 5          # 强度
  160.   SHAKE_SPEED = 5          # 速度
  161.   SHAKE_DURATION = 5      # 时间
  162.   #--------------------------------------------------------------------------
  163.   # ● 上下反转地的设定
  164.   #--------------------------------------------------------------------------
  165.   UPSIDE_DOWN_FILE = "上下反转" # 文件名
  166.   #--------------------------------------------------------------------------
  167.   # ● 左右反转地的设定
  168.   #--------------------------------------------------------------------------
  169.   REVERSE_FILE = "左右反转" # 文件名
  170.   #--------------------------------------------------------------------------
  171.   # ● 回转地的设定
  172.   #--------------------------------------------------------------------------
  173.   TURNING_FILE = "回转" # 文件名
  174.   TURNING_DIRECTION = 1 # 方向(1.逆时针,-1.顺时针)(|||-_-汗..怎么还有用-1做带入值的...)
  175.   TURNING_SPEED = 40    # 速度
  176.   TURNING_DURATION = 1  # 回转数
  177.   #--------------------------------------------------------------------------
  178.   # ● 移动的设定
  179.   #--------------------------------------------------------------------------
  180.   MOVE_FILE = "移动"             # 文件名
  181.   MOVE_RETURN = 1                # 回到原来的位置吗?(光写了个1,也不知道不回到该怎么写?0?)
  182.   MOVE_SPEED = 32                # 速度
  183.   MOVE_COORDINATES = [0,-640]    # 原来位置的相对坐标
  184.   #--------------------------------------------------------------------------
  185.   # ● 动画追加的设定
  186.   #--------------------------------------------------------------------------
  187.   ADD_ANIME_FILE = "动画追加"  # 文件名
  188.   ADD_ANIME_ID = 0               # 动画的ID
  189.   #--------------------------------------------------------------------------
  190.   # ● 债务不履行声明和RTAB的数据转换
  191.   #--------------------------------------------------------------------------
  192.   def convert_battler
  193.     return RTAB ? @active_actor : @active_battler
  194.   end
  195.   #--------------------------------------------------------------------------
  196.   # ● 债务不履行声明和RTAB的数据转换2
  197.   #--------------------------------------------------------------------------
  198.   def convert_battler2(*arg)
  199.     return RTAB ? arg[0] : @active_battler
  200.   end
  201. end

  202. #--------------------------------------------------------------------------
  203. # ● 行动設定
  204. #--------------------------------------------------------------------------
  205. module BattleActions
  206.   
  207.   # 下のものはあくまでも一例なので
  208.   # 独自に作ってください。

  209.   Actions = {

  210.   "通常攻撃" => [
  211.   
  212.   "閃きアニメ",
  213.   "アクターアニメ変更#WALK_L",
  214.   "移動#target,32,0,64,0",
  215.   "行動アニメ",
  216.   "アクターアニメ変更#ATTACK",
  217.   "遠距離アニメ",
  218.   "対象アニメ",
  219.   "アクターアニメ変更#WALK_L",
  220.   "SEの演奏#016-Jump02,80,100",
  221.   "移動#self,0,0,48,32",
  222.   "終了"
  223.   ],

  224.   "エネミー攻撃" => [
  225.   
  226.   "閃きアニメ",
  227.   "アクターアニメ変更#WALK_L",
  228.   "移動#self,-36,0,12,0",
  229.   "行動アニメ",
  230.   "アクターアニメ変更#ATTACK",
  231.   "遠距離アニメ",
  232.   "対象アニメ",
  233.   "アクターアニメ変更#WALK_L",
  234.   "移動#self,0,0,12,0",
  235.   "終了"
  236.   ],
  237.   
  238.   "術発動" => [
  239.   
  240.   "閃きアニメ",
  241.   "アクターアニメ変更#WALK_L",
  242.   "移動#self,-32,0,4,0",
  243.   "アクターアニメ変更#MAGIC",
  244.   "行動アニメ",
  245.   "ウエイト#15",
  246.   "遠距離アニメ",
  247.   "対象アニメ",
  248.   "アクターアニメ変更#WALK_L",
  249.   "移動#self,0,0,4,2",
  250.   "終了"
  251.   ],

  252.   "アイテム使用" => [
  253.   
  254.   "閃きアニメ",
  255.   "アクターアニメ変更#WALK_L",
  256.   "移動#self,-32,0,4,0",
  257.   "行動アニメ",
  258.   "アクターアニメ変更#ITEM",
  259.   "ウエイト#15",
  260.   "遠距離アニメ",
  261.   "対象アニメ",
  262.   "アクターアニメ変更#WALK_L",
  263.   "移動#self,0,0,4,2",
  264.   "終了"
  265.   ],
  266.   
  267.   "払い抜け" => [
  268.   
  269.   "閃きアニメ",
  270.   "アクターアニメ変更#WALK_L",
  271.   "移動#target_near,50,0,48,30",  
  272.   "左右反転",
  273.   "アクターアニメ固定#ATTACK#3",
  274.   "行動アニメ",
  275.   "SEの演奏#135-Light01,100,100",
  276.   "アニメーションの表示#self,42",
  277.   "ウエイト#15",
  278.   "左右反転",
  279.   "残像表示",
  280.   "移動#target_far,-50,0,48,0",
  281.   "対象アニメ",
  282.   "残像消去",
  283.   "アニメ固定解除",
  284.   "アクターアニメ変更#WALK_L",
  285.   "移動#self,0,0,48,1,0",
  286.   "終了"
  287.   ],

  288.   "弓箭攻撃" => [
  289.   
  290.   "閃きアニメ",
  291.   "アクターアニメ変更#WALK_L",
  292.   "移動#self,-32,0,4,0",
  293.   "行動アニメ",
  294.   "アクターアニメ変更#ATTACK",
  295.   "遠距離アニメ",
  296.   "対象アニメ",
  297.   "アクターアニメ変更#WALK_L",
  298.   "移動#self,0,0,4,2",
  299.   "終了"
  300.   ],

  301.   "回旋攻撃" => [
  302.   
  303.   "閃きアニメ",
  304.   "アクターアニメ変更#WALK_L",
  305.   "移動#self,-32,0,4,0",
  306.   "行動アニメ",
  307.   "アクターアニメ変更#STAND_L",  
  308.   "遠距離アニメ",
  309.   "対象アニメ",
  310.   "アクターアニメ変更#WALK_L",
  311.   "移動#self,0,0,4,2",
  312.   "終了"
  313.   ],
  314.   
  315.   "远距离発動" => [
  316.   
  317.   "閃きアニメ",
  318.   "アクターアニメ変更#WALK_L",
  319.   "移動#self,-32,0,4,0",
  320.   "アクターアニメ変更#MAGIC",
  321.   "行動アニメ",
  322.   "アクターアニメ変更#ATTACK",
  323.   "遠距離アニメ",
  324.   "対象アニメ",
  325.   "アクターアニメ変更#WALK_L",
  326.   "移動#self,0,0,4,2",
  327.   "終了"
  328.   ],
  329.   
  330.   "回旋発動" => [
  331.   
  332.   "閃きアニメ",
  333.   "アクターアニメ変更#WALK_L",
  334.   "移動#self,-32,0,4,0",
  335.   "アクターアニメ変更#MAGIC",
  336.   "行動アニメ",
  337.   "アクターアニメ変更#STAND_L",  
  338.   "遠距離アニメ",
  339.   "対象アニメ",
  340.   "アクターアニメ変更#WALK_L",
  341.   "移動#self,0,0,4,2",
  342.   "終了"
  343.   ],

  344.   } # ここで終わり 消さないでください

  345. end
  346.   
  347. module RPG
  348.   class Weapon
  349.     #--------------------------------------------------------------------------
  350.     # ● アクション設定
  351.     #--------------------------------------------------------------------------
  352.     def battle_actions
  353.       case @id
  354.       when 17,18,19,20,21,22,23,24  # 远程武器的id回旋攻撃
  355.         return BattleActions::Actions["弓箭攻撃"]
  356.       when 34                       # 回旋武器的id
  357.         return BattleActions::Actions["回旋攻撃"]
  358.       end
  359.       else
  360.       return BattleActions::Actions["通常攻撃"]
  361.     end
  362.   end
  363.   class Skill
  364.     #--------------------------------------------------------------------------
  365.     # ● アクション設定
  366.     #--------------------------------------------------------------------------
  367.     def battle_actions
  368.       case @id
  369.       when 2,3,4,98,73,74,75,76,77,78,79,80  # 远程技能的id
  370.         return BattleActions::Actions["远距离発動"]
  371.       when 82                     # 回旋技能的id
  372.         return BattleActions::Actions["回旋発動"]
  373.       end
  374.       else
  375.       if self.magic?
  376.         return BattleActions::Actions["術発動"]
  377.       else
  378.         return BattleActions::Actions["払い抜け"]
  379.       end
  380.     end
  381.   end
  382.   class Item
  383.     #--------------------------------------------------------------------------
  384.     # ● アクション設定
  385.     #--------------------------------------------------------------------------
  386.     def battle_actions
  387.       return BattleActions::Actions["アイテム使用"]
  388.     end
  389.   end
  390. end
  391. #class Game_Enemy < Game_Battler
  392.   #--------------------------------------------------------------------------
  393.   # ● アクション設定
  394.   #--------------------------------------------------------------------------
  395. #~  def battle_actions
  396. #~    return BattleActions::Actions["エネミー攻撃"]
  397. #~  end
  398. #end
  399. =begin
  400. #--------------------------------------------------------------------------
  401. # ● 遠距離アニメーション
  402. #--------------------------------------------------------------------------
  403.  ☆ 説明
  404.   
  405.    行動者から対象者にアニメを飛ばします。
  406.    飛ばすアニメを データベース‐アニメーション で作ります。
  407.     [アニメーションID, スピード, 往復するか?,直線(false)or曲線(true)] で指定します。


  408.   ● カスタマイズ方法
  409.    
  410.     case @id
  411.     when 17,18,19,20
  412.       return [101,32,false,false]
  413.     when 21,22,23,24
  414.       return [102,32,false,false]
  415.     end
  416.     return 0
  417.    
  418.     のように描くとID別に指定可能です。
  419.    
  420.    
  421.   ● アニメーションID
  422.   
  423.   飛ばすアニメーションIDです。短い場合は繰り返しで表示されます。
  424.   
  425.    
  426.   ● スピード
  427.   
  428.   大きいほうが早い(0だとアニメは移動しません)
  429.   
  430.   1 = 1フレームで1ドット進むと考えてください。
  431.   
  432.   ● 往復するか?
  433.   
  434.   true とした場合、ブーメランのようにアニメが戻ります。
  435.   
  436.   ● 直線(false)or曲線(true)
  437.   
  438.   true  = 対象に向かって曲線で、アニメが飛びます。(修正の余地ありですが・・・)
  439.   false = 対象に向かって直線で、アニメが飛びます。
  440.    
  441. =end
  442. module RPG
  443.   class Weapon
  444.     #--------------------------------------------------------------------------
  445.     # ● 遠距離アニメーション
  446.     #--------------------------------------------------------------------------
  447.     def flying_anime
  448.       # ID 指定 の例(武器的id,分类是根据飞行武器的动画id)
  449.       case @id
  450.       when 34             #回旋武器(类似回力镖)的id
  451.         return [103,32,true,true]
  452.       when 17,18,19,20    #远程武器1(弓箭类)的id
  453.         return [101,32,false,false]
  454.       when 21,22,23,24    #远程武器2(铳类)的id
  455.         return [102,32,false,false]
  456.       end
  457.       return [0,0,false,false]
  458.     end
  459.   end
  460.   class Skill
  461.     #--------------------------------------------------------------------------
  462.     # ● 遠距離アニメーション
  463.     #--------------------------------------------------------------------------
  464.     def flying_anime
  465.       # ID 指定 の例(技能的id,分类是根据飞行武器的动画id)
  466.       case @id
  467.       when 82             #回旋技能(类似回力镖)的id
  468.         return [103,32,true,true]
  469.       when 73,74,75,76    #远程技能1(弓箭类)的id
  470.         return [101,32,false,false]
  471.       when 4,77,78,79,80    #远程技能2(铳类)的id
  472.         return [125,22,false,false]
  473.         when 2    #投石头的id
  474.         return [116,12,false,false]
  475.         when 3    #投石堆的id
  476.         return [124,12,false,false]
  477.         when 98    #泼沙的id
  478.         return [110,22,false,false]
  479.       end
  480.       return [0,0,false,false]
  481.     end
  482.   end
  483.   class Item
  484.     #--------------------------------------------------------------------------
  485.     # ● 遠距離アニメーション
  486.     #--------------------------------------------------------------------------
  487.     def flying_anime
  488.       case @id
  489.       when 49    #抛击类道具(如炸弹一类)的id
  490.         return [112,12,false,true]
  491.         when 61    #抛击类道具(如炸弹一类)的id
  492.         return [116,12,false,true]
  493.       end
  494.       return [0,0,false,false]
  495.     end
  496.   end
  497. end

  498. #class Game_Enemy < Game_Battler
  499.   #--------------------------------------------------------------------------
  500.   # ● 遠距離アニメーション
  501.   #--------------------------------------------------------------------------
  502. #~  def flying_anime
  503. #~    return [0,0,false,false]
  504. #~  end
  505. #end



  506. #==============================================================================
  507. # ■ Game_Battler
  508. #==============================================================================
  509. class Game_Battler
  510.   include Side_view
  511.   #--------------------------------------------------------------------------
  512.   # ● 追加・公開インスタンス変数
  513.   #--------------------------------------------------------------------------
  514.   attr_accessor :height                  # 画像の高さ
  515.   attr_accessor :real_x                  # X座標補正
  516.   attr_accessor :real_y                  # Y座標補正
  517.   attr_accessor :real_zoom               # 拡大率
  518.   attr_accessor :wait_count              # アニメーション 待ち時間
  519.   attr_accessor :wait_count2             # アニメーション 待ち時間2
  520.   attr_accessor :pattern                 # アニメーション カウント(キャラ)
  521.   attr_accessor :shake                   # シェイク開始フラッグ
  522.   attr_accessor :reverse                 # 左右反転フラッグ
  523.   attr_accessor :shadow                  # 残像フラッグ
  524.   attr_accessor :flash_flag              # 閃きフラッグ
  525.   attr_reader   :ox                      # X座標補正
  526.   attr_reader   :oy                      # Y座標補正
  527.   attr_reader   :flying_x                # 遠距離アニメX座標
  528.   attr_reader   :flying_y                # 遠距離アニメY座標
  529.   attr_reader   :flying_anime            # 遠距離アニメ
  530.   attr_reader   :animation1_on           # 行動アニメ開始フラッグ
  531.   attr_reader   :animation2_on           # 対象アニメ開始フラッグ
  532.   #--------------------------------------------------------------------------
  533.   # ● デフォルトのアニメーション待ち時間を取得
  534.   #--------------------------------------------------------------------------
  535.   def animation_duration=(animation_duration)
  536.     @_animation_duration = animation_duration
  537.   end
  538.   #--------------------------------------------------------------------------
  539.   # ● バトル開始時のセットアップ
  540.   #--------------------------------------------------------------------------
  541.   def start_battle
  542.     [url=home.php?mod=space&uid=291977]@height[/url] = 0
  543.     @real_x = 0
  544.     @real_y = 0
  545.     @real_zoom = 1.0
  546.     @battler_condition = ""
  547.     @action = nil
  548.     @battle_actions = []
  549.     @battler_action = false
  550.     [url=home.php?mod=space&uid=2129346]@step[/url] = 0
  551.     @anime_on = false
  552.     @wait_count = 0
  553.     @wait_count2 = 0
  554.     @ox = 0
  555.     @oy = 0
  556.     @pattern = 0
  557.     @pattern_log = true
  558.     @pattern_freeze = false
  559.     @condition_freeze = false
  560.     @active = false
  561.     @move_distance = nil
  562.     @move_wait = 0
  563.     @move_coordinates = [0,0,0,0]
  564.     @flying_distance = nil
  565.     @flying_wait = 0
  566.     @flying_x = 0
  567.     @flying_y = 0
  568.     @flash_flag = {}
  569.     self.flying_clear
  570.   end
  571.   #--------------------------------------------------------------------------
  572.   # ● 移動中判定
  573.   #--------------------------------------------------------------------------
  574.   def moving?
  575.     # X座標補正または、Y座標補正が0でなければ、移動中
  576.     return (@ox != 0 or @oy != 0)
  577.   end
  578.   #--------------------------------------------------------------------------
  579.   # ● 移動終了判定
  580.   #--------------------------------------------------------------------------
  581.   def move_end?
  582.     return (@ox == @move_coordinates[0] and @oy == @move_coordinates[1])
  583.   end
  584.   #--------------------------------------------------------------------------
  585.   # ● アクション開始設定
  586.   #--------------------------------------------------------------------------
  587.   def action(flag = true)
  588.     @battler_action = flag
  589.     @animation1_on = false
  590.     @animation2_on = false
  591.     @step = "setup"
  592.   end   
  593.   #--------------------------------------------------------------------------
  594.   # ● アクション中判定
  595.   #--------------------------------------------------------------------------
  596.   def action?
  597.     return @battler_action
  598.   end
  599.   #--------------------------------------------------------------------------
  600.   # ● 閃き判定
  601.   #--------------------------------------------------------------------------
  602.   def flash?
  603.     return @flash_flg
  604.   end
  605.   #--------------------------------------------------------------------------
  606.   # ● 戦闘不能判定
  607.   #--------------------------------------------------------------------------
  608.   def anime_dead?
  609.     if $game_temp.in_battle and !RTAB
  610.       if [2,3,4,5].include?($scene.phase4_step)
  611.         return @last_dead
  612.       end
  613.     end
  614.     return @last_dead = self.dead?
  615.   end
  616.   #--------------------------------------------------------------------------
  617.   # ● ピンチ状態判定
  618.   #--------------------------------------------------------------------------
  619.   def crisis?
  620.     if $game_temp.in_battle and !RTAB
  621.       if [2,3,4,5].include?($scene.phase4_step)
  622.         return @last_crisis
  623.       end
  624.     end
  625.     return @last_crisis = (self.hp <= self.maxhp / 4 or badstate?)
  626.   end
  627.   #--------------------------------------------------------------------------
  628.   # ● バッドステート判定
  629.   #--------------------------------------------------------------------------
  630.   def badstate?
  631.     for i in @states
  632.       unless $data_states[i].nonresistance
  633.         return true
  634.       end
  635.     end
  636.     return false
  637.   end
  638.   #--------------------------------------------------------------------------
  639.   # ● 飛行
  640.   #--------------------------------------------------------------------------
  641.   def fly
  642.     if [url=home.php?mod=space&uid=14121]@fly[/url] != nil
  643.       return @fly
  644.     end
  645.     for id in @states
  646.       if FLY_STATES.include?($data_states[id].name)
  647.         return 60
  648.       end
  649.     end
  650.     return 0
  651.   end
  652.   #--------------------------------------------------------------------------
  653.   # ● 遠距離アニメ目標座標の計算
  654.   #--------------------------------------------------------------------------
  655.   def flying_setup
  656.     # 二度目は実行しない
  657.     return if @flying_distance != nil && !camera_correctness
  658.     if RTAB
  659.       targets = @target
  660.     else
  661.       targets = $scene.target_battlers
  662.     end
  663.     # 目的座標を計算
  664.     @f_target_x = 0
  665.     @f_target_y = 0
  666.     for t in targets
  667.       @f_target_x += t.screen_x
  668.       @f_target_y += t.screen_y
  669.     end
  670.     if targets != []
  671.       @f_target_x /= targets.size
  672.       @f_target_y /= targets.size
  673.     else
  674.       @flying_distance = 0
  675.       return
  676.     end
  677.     # 距離の計算
  678.     @flying_distance = (self.screen_x - @f_target_x).abs + (self.screen_y - @f_target_y).abs
  679.   end
  680.   #--------------------------------------------------------------------------
  681.   # ● 遠距離アニメ
  682.   #--------------------------------------------------------------------------
  683.   def flying_animation
  684.     # 戻る
  685.     if @step != "flying" or @flying_distance.nil?
  686.       return [false,true]
  687.     end
  688.     # あらかじめ計算
  689.     self_x = self.screen_x
  690.     self_y = self.screen_y
  691.     @flying_distance = @flying_distance == 0 ? 1 : @flying_distance
  692.     n1 = @flying_wait / @flying_distance.to_f
  693.     if @flying_distance - @flying_wait > @flying_distance / 2
  694.       n2 = 1.0 + 10.0 * @flying_wait / @flying_distance.to_f
  695.     else
  696.       n2 = 1.0 + 10.0 * (@flying_distance - @flying_wait) / @flying_distance.to_f
  697.     end
  698.     if !@flying_anime[4]
  699.       # 直線移動
  700.       x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
  701.       y = (self_y + 1.0 * (@f_target_y - self_y) * n1).to_i
  702.     else
  703.       # 曲線移動
  704.       if !@flying_proceed_end
  705.         x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
  706.         y = (self_y + 1.0 * (@f_target_y - self_y) * n1 - n2**2).to_i
  707.       else
  708.         x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
  709.         y = (self_y + 1.0 * (@f_target_y - self_y) * n1 + n2**2).to_i
  710.       end
  711.     end
  712.     # 座標代入
  713.     @flying_x = x
  714.     @flying_y = y
  715.     # ウエイト
  716.     if !@flying_proceed_end
  717.       # 開始
  718.       @flying_proceed_start = @flying_wait == 0
  719.       @flying_wait += @flying_anime[1]
  720.       @flying_wait = [@flying_wait,@flying_distance].min
  721.       @flying_proceed_end = @flying_wait == @flying_distance
  722.     else
  723.       # 開始
  724.       @flying_return_start = @flying_wait == @flying_distance
  725.       @flying_wait -= @flying_anime[1]
  726.       @flying_wait = [@flying_wait,0].max
  727.       @flying_return_end = @flying_wait == 0
  728.     end
  729.     if @flying_anime[1] == 0
  730.       @flying_end = true
  731.     elsif !@flying_anime[2]
  732.       @flying_end = @flying_proceed_end
  733.     else
  734.       @flying_end = @flying_return_end
  735.     end
  736.     # 値を返す(アニメ開始,アニメ終了)
  737.     return [@flying_proceed_start,@flying_end]
  738.   end
  739.   #--------------------------------------------------------------------------
  740.   # ● 遠距離アニメ初期化
  741.   #--------------------------------------------------------------------------
  742.   def flying_clear
  743.     @flying_proceed_start = false
  744.     @flying_proceed_end = false
  745.     @flying_return_start = false
  746.     @flying_return_end = false
  747.     @flying_end = false
  748.     @flying_anime = [0,0,false]
  749.   end
  750.   #--------------------------------------------------------------------------
  751.   # ● 移動
  752.   #--------------------------------------------------------------------------
  753.   def move
  754.     # 距離の計算
  755.     @move_distance = (@move_coordinates[2] - @move_coordinates[0]).abs +
  756.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  757.     if @move_distance > 0
  758.       return if @ox == @move_coordinates[0] and @oy == @move_coordinates[1]
  759.       array = @move_coordinates
  760.       # ジャンプ補正値の計算
  761.       if @move_distance - @move_wait > @move_distance / 2
  762.         jump = (@move_action[4] * @move_wait / @move_distance.to_f)**2        
  763.       else
  764.         jump = (@move_action[4] * (@move_distance - @move_wait) / @move_distance.to_f)**2
  765.       end
  766.       jump = @move_action[4] > 0 ? -jump : jump
  767.       @ox = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @move_wait) / @move_distance.to_f).to_i
  768.       
  769.       @oy = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @move_wait) / @move_distance.to_f + jump).to_i
  770.       # ウエイト
  771.       @move_wait -= @move_action[3]
  772.       @move_wait = [@move_wait,0].max
  773.     end
  774.   end
  775.   #--------------------------------------------------------------------------
  776.   # ● 移動アクションの取得
  777.   #--------------------------------------------------------------------------
  778.   def get_move_action
  779.     string = @action.split(/#/)[1]
  780.     string = string.split(/,/)
  781.     @move_action = [string[0],string[1].to_i,string[2].to_i,string[3].to_i,string[4].to_i,string[5].to_i]
  782.   end
  783.   #--------------------------------------------------------------------------
  784.   # ● アクションの取得
  785.   #--------------------------------------------------------------------------
  786.   def get_step
  787.     if @action.nil?
  788.       @step = "finish"
  789.       return
  790.     end
  791.     string = @action.split(/#/)[0]
  792.     if string =~ "移動"
  793.       @step = "moving_setup"
  794.     elsif string =~ "アクターアニメ実行"
  795.       @step = "action"
  796.     elsif string =~ "遠距離アニメ"
  797.       @step = "flying"
  798.     elsif string =~ "アクターアニメ変更"
  799.       @step = "change"
  800.     elsif string =~ "行動アニメ"
  801.       @step = "animation1"
  802.     elsif string =~ "対象アニメ"
  803.       @step = "animation2"
  804.     elsif string =~ "ウエイト"
  805.       @step = "wait"
  806.     elsif string =~ "左右反転"
  807.       @step = "reverse"
  808.     elsif string =~ "閃きアニメ"
  809.       @step = "flash"
  810.     elsif string =~ "残像表示"
  811.       @step = "shadow_on"
  812.     elsif string =~ "残像消去"
  813.       @step = "shadow_off"
  814.     elsif string =~ "アクターアニメ固定"
  815.       @step = "freeze"
  816.     elsif string =~ "アニメ固定解除"
  817.       @step = "freeze_lifting"
  818.     elsif string =~ "アニメーションの表示"
  819.       @step = "animation_start"
  820.     elsif string =~ "SEの演奏"
  821.       @step = "play_se"
  822.     else
  823.       @step = "finish"
  824.     end
  825.   end
  826.   #--------------------------------------------------------------------------
  827.   # ● フレーム更新 (次のアクションへ)
  828.   #--------------------------------------------------------------------------
  829.   def update_next
  830.     @action = @battle_actions.shift
  831.     @step = get_step
  832.   end
  833.   #--------------------------------------------------------------------------
  834.   # ● フレーム更新 (動作取得)
  835.   #--------------------------------------------------------------------------
  836.   def update_setup
  837.     # アクションの取得
  838.     self.get_actions
  839.     @action = @battle_actions.shift
  840.     @step = get_step
  841.   end
  842.   #--------------------------------------------------------------------------
  843.   # ● フレーム更新 (移動取得)
  844.   #--------------------------------------------------------------------------
  845.   def update_moving_setup
  846.     # 移動アクションの取得
  847.     self.get_move_action
  848.     # 移動目標の設定
  849.     self.move_setup
  850.     @step = "moving"
  851.   end
  852.   #--------------------------------------------------------------------------
  853.   # ● フレーム更新 (移動)
  854.   #--------------------------------------------------------------------------
  855.   def update_moving
  856.     # 移動
  857.     self.move
  858.     self.condition = @battler_condition
  859.     # 移動完了したら次のステップへ
  860.     if move_end?
  861.       @wait_count = 2
  862.       @action = @battle_actions.shift
  863.       @step = get_step
  864.     end
  865.   end
  866.   #--------------------------------------------------------------------------
  867.   # ● フレーム更新 (アニメ実行)
  868.   #--------------------------------------------------------------------------
  869.   def update_action
  870.     con = @action.split(/#/)[1]
  871.     # 右手・左手を分ける
  872.     if DUAL_WEAPONS_ANIME.include?(con)
  873.       if !@first_weapon and @second_weapon
  874.         con = con + "_L"
  875.       else
  876.         con = con + "_R"
  877.       end
  878.     end
  879.     # アニメ変更
  880.     self.condition = con
  881.     # ループか否か
  882.     if !ANIME[@battler_condition][1]
  883.       self.anime_on
  884.     end
  885.     @action = @battle_actions.shift
  886.     @step = get_step
  887.   end
  888.   #--------------------------------------------------------------------------
  889.   # ● フレーム更新 (遠距離アニメ)
  890.   #--------------------------------------------------------------------------
  891.   def update_flying
  892.     # 目標の設定
  893.     self.flying_setup
  894.     # 遠距離アニメ終了
  895.     if @flying_end
  896.       self.flying_clear
  897.       @action = @battle_actions.shift
  898.       @step = get_step
  899.     end
  900.   end
  901.   #--------------------------------------------------------------------------
  902.   # ● フレーム更新 (アニメ変更)
  903.   #--------------------------------------------------------------------------
  904.   def update_change
  905.     con = @action.split(/#/)[1]
  906.     # 右手・左手を分ける
  907.     if DUAL_WEAPONS_ANIME.include?(con)
  908.       if !@first_weapon and @second_weapon
  909.         con = con + "_L"
  910.       else
  911.         con = con + "_R"
  912.       end
  913.     end
  914.     # アニメ変更
  915.     self.condition = con
  916.     # ループか否か
  917.     if !ANIME[@battler_condition][1]
  918.       self.anime_on
  919.     end
  920.     @action = @battle_actions.shift
  921.     @step = get_step
  922.   end
  923.   #--------------------------------------------------------------------------
  924.   # ● フレーム更新 (行動アニメ)
  925.   #--------------------------------------------------------------------------
  926.   def update_animation1
  927.     @animation1_on = true
  928.     # 行動アニメの後に行動を開始する
  929.     if $scene.phase4_step == 3
  930.       id = RTAB ? @anime1 : $scene.animation1_id
  931.       animation = $data_animations[id]
  932.       frame_max = animation != nil ? animation.frame_max : 0
  933.       @wait_count2 = frame_max * 2
  934.       return
  935.     end
  936.     @action = @battle_actions.shift
  937.     @step = get_step
  938.   end
  939.   #--------------------------------------------------------------------------
  940.   # ● フレーム更新 (対象アニメ)
  941.   #--------------------------------------------------------------------------
  942.   def update_animation2
  943.     @animation2_on = true
  944.     # 行動アニメの後に行動を開始する
  945.     if $scene.phase4_step == 4
  946.       id = RTAB ? @anime2 : $scene.animation2_id
  947.       animation = $data_animations[id]
  948.       frame_max = animation != nil ? animation.frame_max : 0
  949.       @wait_count2 = frame_max * 2
  950.       return
  951.     end
  952.     @action = @battle_actions.shift
  953.     @step = get_step
  954.   end
  955.   #--------------------------------------------------------------------------
  956.   # ● フレーム更新 (ウエイト)
  957.   #--------------------------------------------------------------------------
  958.   def update_wait
  959.     @wait_count2 = @action.split(/#/)[1].to_i
  960.     @action = @battle_actions.shift
  961.     @step = get_step
  962.   end
  963.   #--------------------------------------------------------------------------
  964.   # ● フレーム更新 (残像表示)
  965.   #--------------------------------------------------------------------------
  966.   def update_shadow_on
  967.     [url=home.php?mod=space&uid=31758]@Shadow[/url] = true
  968.     @action = @battle_actions.shift
  969.     @step = get_step
  970.   end
  971.   #--------------------------------------------------------------------------
  972.   # ● フレーム更新 (残像消去)
  973.   #--------------------------------------------------------------------------
  974.   def update_shadow_off
  975.     @shadow = false
  976.     @action = @battle_actions.shift
  977.     @step = get_step
  978.   end
  979.   #--------------------------------------------------------------------------
  980.   # ● フレーム更新 (左右反転)
  981.   #--------------------------------------------------------------------------
  982.   def update_reverse
  983.     [url=home.php?mod=space&uid=30269]@reverse[/url] = @reverse ? false : true
  984.     @action = @battle_actions.shift
  985.     @step = get_step
  986.   end
  987.   #--------------------------------------------------------------------------
  988.   # ● フレーム更新 (閃きアニメ)
  989.   #--------------------------------------------------------------------------
  990.   def update_flash
  991.     # 閃きアニメの後に行動を開始する
  992.     if @flash_flag["normal"]
  993.       @wait_count = $scene.flash_duration
  994.       @flash_flag["normal"] = false
  995.       return
  996.     end
  997.     @action = @battle_actions.shift
  998.     @step = get_step
  999.   end
  1000.   #--------------------------------------------------------------------------
  1001.   # ● フレーム更新 (SEの演奏)
  1002.   #--------------------------------------------------------------------------
  1003.   def update_play_se
  1004.     data = @action.split(/#/)[1]
  1005.     data = data.split(/,/)
  1006.     # SE を演奏
  1007.     Audio.se_play("Audio/SE/" + data[0], data[1].to_i, data[2].to_i)
  1008.     @action = @battle_actions.shift
  1009.     @step = get_step
  1010.   end
  1011.   #--------------------------------------------------------------------------
  1012.   # ● フレーム更新 (アクターアニメ固定)
  1013.   #--------------------------------------------------------------------------
  1014.   def update_freeze
  1015.     con = @action.split(/#/)[1]
  1016.     # 右手・左手を分ける
  1017.     if DUAL_WEAPONS_ANIME.include?(con)
  1018.       if !@first_weapon and @second_weapon
  1019.         con = con + "_L"
  1020.       else
  1021.         con = con + "_R"
  1022.       end
  1023.     end
  1024.     # アニメ変更
  1025.     self.condition = con
  1026.     @pattern = @action.split(/#/)[2].to_i
  1027.     @pattern_freeze = true
  1028.     @condition_freeze = true
  1029.     @action = @battle_actions.shift
  1030.     @step = get_step
  1031.   end
  1032.   #--------------------------------------------------------------------------
  1033.   # ● フレーム更新 (アクターアニメ固定解除)
  1034.   #--------------------------------------------------------------------------
  1035.   def update_freeze_lifting
  1036.     @pattern_freeze = false
  1037.     @condition_freeze = false
  1038.     @action = @battle_actions.shift
  1039.     @step = get_step
  1040.   end
  1041.   #--------------------------------------------------------------------------
  1042.   # ● フレーム更新 (アニメーションの表示)
  1043.   #--------------------------------------------------------------------------
  1044.   def update_animation_start
  1045.     data = @action.split(/#/)[1]
  1046.     data = data.split(/,/)
  1047.     target = data[0]
  1048.     animation_id = data[1].to_i
  1049.     if RTAB
  1050.       case target
  1051.       when "self"
  1052.         @animation.push([animation_id,true])
  1053.       when "target"
  1054.         for tar in @target
  1055.           tar.animation.push([animation_id, true])
  1056.         end
  1057.       end
  1058.     else
  1059.       case target
  1060.       when "self"
  1061.         @animation_id = animation_id
  1062.         @animation_hit = true
  1063.       when "target"
  1064.         for tar in $scene.target_battlers
  1065.           tar.animation_id = animation_id
  1066.           tar.animation_hit = true
  1067.         end
  1068.       end
  1069.     end
  1070.     @action = @battle_actions.shift
  1071.     @step = get_step
  1072.   end
  1073.   #--------------------------------------------------------------------------
  1074.   # ● フレーム更新 (動作終了)
  1075.   #--------------------------------------------------------------------------
  1076.   def update_finish
  1077.     # 動作終了
  1078.     @battler_action = false
  1079.     @step = "setup"
  1080.   end
  1081.   #--------------------------------------------------------------------------
  1082.   # ● バトラーの状態 変更(バトラーグラフィックのタイプ)
  1083.   #--------------------------------------------------------------------------
  1084.   def condition=(condition)
  1085.     return if @condition_freeze
  1086.     @battler_condition = condition
  1087.     @wait_count = ANIME[condition][2]
  1088.   end
  1089.   #--------------------------------------------------------------------------
  1090.   # ● バトラーの状態(バトラーグラフィックのタイプ)
  1091.   #--------------------------------------------------------------------------
  1092.   def condition
  1093.     return @battler_condition
  1094.   end
  1095.   #--------------------------------------------------------------------------
  1096.   # ● フレーム更新
  1097.   #--------------------------------------------------------------------------
  1098.   def update
  1099.     # ウェイト中の場合
  1100.     if @wait_count > 0
  1101.       return
  1102.     end
  1103.     # パターン更新
  1104.     self.char_animation
  1105.     # ウェイト中の場合
  1106.     if @wait_count2 > 0
  1107.       return
  1108.     end
  1109.    
  1110.     # 行動アニメーション
  1111.     if @battler_action
  1112.       method("update_" + @step).call
  1113.       return
  1114.     end
  1115.    
  1116.     # データ初期化
  1117.     @animation1_on = false
  1118.     @animation2_on = false
  1119.     @action = nil
  1120.     @battle_actions = []
  1121.     @move_wait = 0
  1122.     @move_distance = nil
  1123.     @flying_wait = 0
  1124.     @flying_distance = nil
  1125.     [url=home.php?mod=space&uid=14082]@Flash[/url] = false

  1126.     # RTAB対応
  1127.     # 通常・待機
  1128.     return self.condition = NORMAL
  1129.   end
  1130.   #--------------------------------------------------------------------------
  1131.   # ● アクションの取得
  1132.   #--------------------------------------------------------------------------
  1133.   def get_actions
  1134.     skill = $data_skills[self.current_action.skill_id]
  1135.     item = $data_items[self.current_action.item_id]
  1136.     kind = self.current_action.kind
  1137.     # 動作取得
  1138.     @battle_actions = []
  1139.     # スキル
  1140.     if skill != nil && kind == 1
  1141.       @battle_actions = skill.battle_actions.dup
  1142.       @flying_anime = skill.flying_anime
  1143.     # アイテム
  1144.     elsif item != nil && kind == 2
  1145.       @battle_actions = item.battle_actions.dup
  1146.       @flying_anime = item.flying_anime
  1147.     # 左手攻撃
  1148.     elsif !@first_weapon and @second_weapon and (self.is_a?(Game_Actor) or (!self.is_a?(Game_Actor) and !self.nce))

  1149.       @battle_actions = self.battle_actions2.dup
  1150.       @flying_anime = self.flying_anime2
  1151.     # 右手攻撃
  1152.     elsif self.current_action.basic == 0 and
  1153.       (self.is_a?(Game_Actor) or (!self.is_a?(Game_Actor) and !self.nce)) and self.current_action.kind == 0
  1154.       @battle_actions = self.battle_actions1.dup
  1155.       @flying_anime = self.flying_anime1
  1156.     # 通常攻撃
  1157.     elsif self.current_action.basic == 0 and self.current_action.kind == 0
  1158.       # 这里啊~~ =。=b
  1159.       if !self.is_a?(Game_Actor) and !self.nce
  1160.         @battle_actions = self.battle_actions1.dup
  1161.       else
  1162.         @battle_actions = BattleActions::Actions["エネミー攻撃"].dup
  1163.       end
  1164.       @flying_anime = self.flying_anime
  1165.     else
  1166.       @battle_actions = ["終了"]
  1167.       @flying_anime = [0,0,false,false]
  1168.     end
  1169.   end
  1170.   #--------------------------------------------------------------------------
  1171.   # ● ループしないアニメのセット
  1172.   #--------------------------------------------------------------------------
  1173.   def anime_on
  1174.     @pattern = 0
  1175.     @pattern_log = true
  1176.     return
  1177.   end
  1178.   #--------------------------------------------------------------------------
  1179.   # ● パターン更新
  1180.   #--------------------------------------------------------------------------
  1181.   def char_animation
  1182.     # パタン固定の場合もどる
  1183.     return if @pattern_freeze
  1184.     # ループしないアニメの場合 1234 で止まる
  1185.     if !ANIME[@battler_condition][1] && @pattern == 3
  1186.       return
  1187.     end
  1188.     # アニメさせない場合 1 で止まる
  1189.     if ANIME[@battler_condition][4]
  1190.       @pattern = 0
  1191.       return
  1192.     end
  1193.     @pattern = (@pattern + 1) % 4
  1194.   end
  1195.   #--------------------------------------------------------------------------
  1196.   # ● アニメタイプ
  1197.   #--------------------------------------------------------------------------
  1198.   def anime_type
  1199.     return ANIME[self.condition] != nil ? ANIME[self.condition][0] : 0
  1200.   end
  1201. end
  1202. #==============================================================================
  1203. # ■ Game_Actor
  1204. #==============================================================================
  1205. class Game_Actor < Game_Battler
  1206.   include Side_view
  1207.   #--------------------------------------------------------------------------
  1208.   # ● セットアップ
  1209.   #--------------------------------------------------------------------------
  1210.   alias side_view_setup setup
  1211.   def setup(actor_id)
  1212.     side_view_setup(actor_id)
  1213.     start_battle
  1214.   end
  1215.   #--------------------------------------------------------------------------
  1216.   # ● 二刀武器のID取得 ※エラー回避用
  1217.   #--------------------------------------------------------------------------
  1218.   def weapon2_id
  1219.     return @weapon2_id != nil ? @weapon2_id : 0
  1220.   end
  1221.   #--------------------------------------------------------------------------
  1222.   # ● X方向 ポジション 取得 (陣形スクリプト拡張用)
  1223.   #--------------------------------------------------------------------------
  1224.   def position
  1225.     return $data_classes[@class_id].position
  1226.   end
  1227.   #--------------------------------------------------------------------------
  1228.   # ● Y方向 ポジション 取得 (陣形スクリプト拡張用)
  1229.   #--------------------------------------------------------------------------
  1230.   def position2
  1231.     return self.index
  1232.   end
  1233.   #--------------------------------------------------------------------------
  1234.   # ● 武器アニメタイプ
  1235.   #--------------------------------------------------------------------------
  1236.   def weapon_anime_type(type)
  1237.     file_name  = weapon_anime_type0(type)
  1238.     visible   = weapon_anime_type1(type)
  1239.     z         = weapon_anime_type2(type)
  1240.     return [file_name,visible,z]
  1241.   end
  1242.   # 武器アイコン取得
  1243.   def weapon_anime_type0(type)
  1244.     type = ANIME[type][5]
  1245.     return weapon_anime1 if type == "右手"
  1246.     return weapon_anime2 if type == "左手"
  1247.     return nil
  1248.   end
  1249.   # 表示・非表示の取得
  1250.   def weapon_anime_type1(type)
  1251.     return ANIME[type][3]
  1252.   end
  1253.   # バトラーより上に表示するかどうか
  1254.   def weapon_anime_type2(type)
  1255.     type = ANIME[type][5]
  1256.     return true if type == "左手"
  1257.     return false
  1258.   end
  1259.   #--------------------------------------------------------------------------
  1260.   # ● バトル画面 X 座標の取得(カメラ補正無し)
  1261.   #--------------------------------------------------------------------------
  1262.   def true_x
  1263.     return PARTY_X + position * FORMATION_X + @ox
  1264.   end
  1265.   #--------------------------------------------------------------------------
  1266.   # ● バトル画面 Y 座標の取得(カメラ補正無し)
  1267.   #--------------------------------------------------------------------------
  1268.   def true_y
  1269.     # パーティ内の並び順から Y 座標を計算して返す
  1270.     if self.index != nil
  1271.       y = position2 * FORMATION_Y + PARTY_Y + @oy - @height / 2
  1272.       return y
  1273.     else
  1274.       return 0
  1275.     end
  1276.   end
  1277.   #--------------------------------------------------------------------------
  1278.   # ● バトル画面 X 座標の取得
  1279.   #--------------------------------------------------------------------------
  1280.   def screen_x(true_x = self.true_x)
  1281.     return 320 + (true_x - 320) * @real_zoom + @real_x
  1282.   end
  1283.   #--------------------------------------------------------------------------
  1284.   # ● バトル画面 Y 座標の取得
  1285.   #--------------------------------------------------------------------------
  1286.   def screen_y(true_y = self.true_y)
  1287.     return true_y * @real_zoom + @real_y
  1288.   end
  1289.   #--------------------------------------------------------------------------
  1290.   # ● バトル画面 Z 座標の取得
  1291.   #--------------------------------------------------------------------------
  1292.   def screen_z
  1293.     return screen_y + 1000
  1294.   end
  1295.   #--------------------------------------------------------------------------
  1296.   # ● バトル画面 X 座標の取得(移動などしていない場合)
  1297.   #--------------------------------------------------------------------------
  1298.   def base_x
  1299.     return 320 + (true_x - @ox - 320) * @real_zoom + @real_x
  1300.   end
  1301.   #--------------------------------------------------------------------------
  1302.   # ● バトル画面 Y 座標の取得
  1303.   #--------------------------------------------------------------------------
  1304.   def base_y
  1305.     return (true_y - @oy) * @real_zoom + @real_y
  1306.   end
  1307.   #--------------------------------------------------------------------------
  1308.   # ● バトル画面 拡大率の取得
  1309.   #--------------------------------------------------------------------------
  1310.   def zoom
  1311.     return ($scene.zoom_rate[1] - $scene.zoom_rate[0]) *
  1312.                           (true_x + @fly) / 480 + $scene.zoom_rate[0]
  1313.   end
  1314.   #--------------------------------------------------------------------------
  1315.   # ● 攻撃用、バトル画面 X 座標の取得
  1316.   #--------------------------------------------------------------------------
  1317.   def attack_x(z)
  1318.     return (320 - true_x) * z * 0.75
  1319.   end
  1320.   #--------------------------------------------------------------------------
  1321.   # ● 攻撃用、バトル画面 Y 座標の取得
  1322.   #--------------------------------------------------------------------------
  1323.   def attack_y(z)
  1324.     return (160 - (true_y + fly / 4) * z + @height * zoom * z / 2) * 0.75
  1325.   end
  1326.   #--------------------------------------------------------------------------
  1327.   # ● 閃き待ち時間
  1328.   #--------------------------------------------------------------------------
  1329.   def flash_duration
  1330.     return $scene.flash_duration
  1331.   end
  1332.   #--------------------------------------------------------------------------
  1333.   # ● アニメーション取得
  1334.   #--------------------------------------------------------------------------
  1335.   def battle_actions1
  1336.     weapon = $data_weapons[@weapon_id]
  1337.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1338.   end
  1339.   #--------------------------------------------------------------------------
  1340.   # ● アニメーション取得
  1341.   #--------------------------------------------------------------------------
  1342.   def battle_actions2
  1343.     weapon = $data_weapons[@weapon2_id]
  1344.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1345.   end
  1346.   #--------------------------------------------------------------------------
  1347.   # ● 武器アニメーション取得
  1348.   #--------------------------------------------------------------------------
  1349.   def weapon_anime1
  1350.     weapon = $data_weapons[@weapon_id]
  1351.     return weapon != nil ? weapon.icon_name : ""
  1352.   end
  1353.   #--------------------------------------------------------------------------
  1354.   # ● 武器アニメーション取得
  1355.   #--------------------------------------------------------------------------
  1356.   def weapon_anime2
  1357.     weapon = $data_weapons[@weapon2_id]
  1358.     return weapon != nil ? weapon.icon_name : ""
  1359.   end
  1360.   #--------------------------------------------------------------------------
  1361.   # ● 遠距離アニメーション取得
  1362.   #--------------------------------------------------------------------------
  1363.   def flying_anime1
  1364.     weapon = $data_weapons[@weapon_id]
  1365.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1366.   end
  1367.   #--------------------------------------------------------------------------
  1368.   # ● 遠距離アニメーション取得
  1369.   #--------------------------------------------------------------------------
  1370.   def flying_anime2
  1371.     weapon = $data_weapons[@weapon2_id]
  1372.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1373.   end
  1374.   #--------------------------------------------------------------------------
  1375.   # ● 移動目標座標の計算
  1376.   #--------------------------------------------------------------------------
  1377.   def move_setup
  1378.     if RTAB
  1379.       targets = @target
  1380.     else
  1381.       targets = $scene.target_battlers
  1382.     end
  1383.     case @move_action[0]
  1384.     when "self" # 自分
  1385.       @target_x = self.base_x
  1386.       @target_y = self.base_y
  1387.     when "target_near" # 一番近くのターゲット
  1388.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  1389.       targets.reverse!
  1390.       if targets != []
  1391.         @target_x = targets[0].screen_x
  1392.         @target_y = targets[0].screen_y
  1393.       else
  1394.         @target_x = self.base_x
  1395.         @target_y = self.base_y
  1396.       end
  1397.     when "target_far" # 一番遠くのターゲット
  1398.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  1399.       if targets != []
  1400.         @target_x = targets[0].screen_x
  1401.         @target_y = targets[0].screen_y
  1402.       else
  1403.         @target_x = self.base_x
  1404.         @target_y = self.base_y
  1405.       end
  1406.     when "target" # ターゲット中央
  1407.       @target_x = 0
  1408.       @target_y = 0
  1409.       for t in targets
  1410.         @target_x += t.screen_x
  1411.         @target_y += t.screen_y
  1412.       end
  1413.       if targets != []
  1414.         @target_x /= targets.size
  1415.         @target_y /= targets.size
  1416.       end
  1417.     when "troop" # "トループ中央"
  1418.       @target_x = 0
  1419.       @target_y = 0
  1420.       for t in $game_troop.enemies
  1421.         @target_x += t.screen_x
  1422.         @target_y += t.screen_y
  1423.       end
  1424.       if $game_troop.enemies != []
  1425.         @target_x /= $game_troop.enemies.size
  1426.         @target_y /= $game_troop.enemies.size
  1427.       end
  1428.     when "party" # "パーティ中央"
  1429.       @target_x = 0
  1430.       @target_y = 0
  1431.       for t in $game_party.actors
  1432.         @target_x += t.screen_x
  1433.         @target_y += t.screen_y
  1434.       end
  1435.       if $game_party.actors != []
  1436.         @target_x /= $game_party.actors.size
  1437.         @target_y /= $game_party.actors.size
  1438.       end
  1439.     when "screen" # "画面"
  1440.       @target_x = self.base_x
  1441.       @target_y = self.base_y
  1442.     end
  1443.     # 補正
  1444.     @target_x += @move_action[1] - self.base_x
  1445.     @target_y += @move_action[2] - self.base_y
  1446.     # 移動目標の座標をセット
  1447.     @move_coordinates = [@target_x.to_i,@target_y.to_i,@move_coordinates[0],@move_coordinates[1]]
  1448.     # 距離の計算(ウエイトの設定)
  1449.     @move_wait     = (@move_coordinates[2] - @move_coordinates[0]).abs +
  1450.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  1451.   end
  1452. end
  1453. #==============================================================================
  1454. # ■ Game_Enemy
  1455. #==============================================================================
  1456. class Game_Enemy < Game_Battler
  1457.   attr_reader   :nce
  1458.   #--------------------------------------------------------------------------
  1459.   # ● セットアップ
  1460.   #--------------------------------------------------------------------------
  1461.   alias side_view_initialize initialize
  1462.   def initialize(troop_id, member_index)
  1463.     side_view_initialize(troop_id, member_index)
  1464.     start_battle
  1465.     @nce = NOT_CHARACTER_EMEMY.include? @enemy_id
  1466.     @weapon_id  = EMEMY_WEAPO[@enemy_id] != nil ? EMEMY_WEAPO[@enemy_id] : 0
  1467.     @weapon_id2  = EMEMY_WEAPO2[@enemy_id] != nil ? EMEMY_WEAPO2[@enemy_id] : 0
  1468.   end
  1469.   def character_name
  1470.     return self.battler_name
  1471.   end
  1472.   def character_hue
  1473.     return self.battler_hue
  1474.   end
  1475.   #--------------------------------------------------------------------------
  1476.   # ● 移動
  1477.   #--------------------------------------------------------------------------
  1478.   def move
  1479.     # 距離の計算
  1480.     @move_distance = (@move_coordinates[2] - @move_coordinates[0]).abs +
  1481.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  1482.     if @move_distance > 0
  1483.       return if @ox == @move_coordinates[0] and @oy == @move_coordinates[1]
  1484.       array = @move_coordinates
  1485.       # ジャンプ補正値の計算
  1486.       if @move_distance - @move_wait > @move_distance / 2
  1487.         jump = (@move_action[4] * @move_wait / @move_distance.to_f)**2        
  1488.       else
  1489.         jump = (@move_action[4] * (@move_distance - @move_wait) / @move_distance.to_f)**2
  1490.       end
  1491.       jump = @move_action[4] > 0 ? -jump : jump
  1492.       jump = 0 if @weapon_id + @weapon_id2 == 0
  1493.       @ox = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @move_wait) / @move_distance.to_f).to_i
  1494.       @oy = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @move_wait) / @move_distance.to_f + jump).to_i
  1495.       # ウエイト
  1496.       @move_wait -= @move_action[3]
  1497.       @move_wait = [@move_wait,0].max
  1498.     end
  1499.   end
  1500.   #--------------------------------------------------------------------------
  1501.   # ● 武器アニメタイプ
  1502.   #--------------------------------------------------------------------------
  1503.   def weapon_anime_type(type)
  1504.     file_name  = weapon_anime_type0(type)
  1505.     visible   = weapon_anime_type1(type)
  1506.     z         = weapon_anime_type2(type)
  1507.     return [file_name,visible,z]
  1508.   end
  1509.   # 武器アイコン取得
  1510.   def weapon_anime_type0(type)
  1511.     type = ANIME[type][5]
  1512.     return weapon_anime1 if type == "右手"
  1513.     return weapon_anime2 if type == "左手"
  1514.     return nil
  1515.   end
  1516.   # 表示・非表示の取得
  1517.   def weapon_anime_type1(type)
  1518.     return ANIME[type][3]
  1519.   end
  1520.   # バトラーより上に表示するかどうか
  1521.   def weapon_anime_type2(type)
  1522.     type = ANIME[type][5]
  1523.     return true if type == "左手"
  1524.     return false
  1525.   end

  1526.   #--------------------------------------------------------------------------
  1527.   # ● 移動目標座標の計算
  1528.   #--------------------------------------------------------------------------
  1529.   def move_setup
  1530.     if RTAB
  1531.       targets = @target
  1532.     else
  1533.       targets = $scene.target_battlers
  1534.     end
  1535.     case @move_action[0]
  1536.     when "self" # 自分
  1537.       @target_x = self.base_x
  1538.       @target_y = self.base_y
  1539.     when "target_near" # 一番近くのターゲット
  1540.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  1541.       if targets != []
  1542.         @target_x = targets[0].screen_x
  1543.         @target_y = targets[0].screen_y
  1544.       else
  1545.         @target_x = self.base_x
  1546.         @target_y = self.base_y
  1547.       end
  1548.     when "target_far" # 一番遠くのターゲット
  1549.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  1550.       targets.reverse!
  1551.       if targets != []
  1552.         @target_x = targets[0].screen_x
  1553.         @target_y = targets[0].screen_y
  1554.       else
  1555.         @target_x = self.base_x
  1556.         @target_y = self.base_y
  1557.       end
  1558.     when "target" # ターゲット中央
  1559.       @target_x = 0
  1560.       @target_y = 0
  1561.       for t in targets
  1562.         @target_x += t.screen_x
  1563.         @target_y += t.screen_y
  1564.       end
  1565.       if targets != []
  1566.         @target_x /= targets.size
  1567.         @target_y /= targets.size
  1568.       end
  1569.     when  "party" # "トループ中央"
  1570.       @target_x = 0
  1571.       @target_y = 0
  1572.       for t in $game_troop.enemies
  1573.         @target_x += t.screen_x
  1574.         @target_y += t.screen_y
  1575.       end
  1576.       if $game_troop.enemies != []
  1577.         @target_x /= $game_troop.enemies.size
  1578.         @target_y /= $game_troop.enemies.size
  1579.       end
  1580.     when "troop" # "パーティ中央"
  1581.       @target_x = 0
  1582.       @target_y = 0
  1583.       for t in $game_party.actors
  1584.         @target_x += t.screen_x
  1585.         @target_y += t.screen_y
  1586.       end
  1587.       if $game_party.actors != []
  1588.         @target_x /= $game_party.actors.size
  1589.         @target_y /= $game_party.actors.size
  1590.       end
  1591.     when "screen" # "画面"
  1592.       @target_x = self.base_x
  1593.       @target_y = self.base_y
  1594.     end
  1595.     # 補正
  1596.     @target_x -= @move_action[1] + self.base_x
  1597.     @target_y -= @move_action[2] + self.base_y
  1598.     # 移動目標の座標をセット
  1599.     @move_coordinates = [@target_x.to_i,@target_y.to_i,@move_coordinates[0],@move_coordinates[1]]
  1600.     # 距離の計算(ウエイトの設定)
  1601.     @move_wait     = (@move_coordinates[2] - @move_coordinates[0]).abs +
  1602.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  1603.   end
  1604.   if RTAB
  1605.   alias original_x true_x
  1606.   alias original_y true_y
  1607.   else
  1608.   alias original_x screen_x
  1609.   alias original_y screen_y
  1610.   end
  1611.   #--------------------------------------------------------------------------
  1612.   # ● バトル画面 X 座標の取得(カメラ補正無し)
  1613.   #--------------------------------------------------------------------------
  1614.   def true_x
  1615.     return original_x + @ox
  1616.   end
  1617.   #--------------------------------------------------------------------------
  1618.   # ● バトル画面 Y 座標の取得(カメラ補正無し)
  1619.   #--------------------------------------------------------------------------
  1620.   def true_y
  1621.     return original_y - @height / 2 + @oy
  1622.   end
  1623.   #--------------------------------------------------------------------------
  1624.   # ● バトル画面 X 座標の取得
  1625.   #--------------------------------------------------------------------------
  1626.   def screen_x(true_x = self.true_x)
  1627.     return true_x * @real_zoom + @real_x
  1628.   end
  1629.   #--------------------------------------------------------------------------
  1630.   # ● バトル画面 Y 座標の取得
  1631.   #--------------------------------------------------------------------------
  1632.   def screen_y(true_y = self.true_y)
  1633.     return true_y * @real_zoom + @real_y
  1634.   end
  1635.   #--------------------------------------------------------------------------
  1636.   # ● バトル画面 X 座標の取得(移動などしていない場合)
  1637.   #--------------------------------------------------------------------------
  1638.   def base_x(true_x = self.true_x)
  1639.     return (true_x - @ox) * @real_zoom + @real_x
  1640.   end
  1641.   #--------------------------------------------------------------------------
  1642.   # ● バトル画面 Y 座標の取得(移動などしていない場合)
  1643.   #--------------------------------------------------------------------------
  1644.   # ● アニメーション取得
  1645.   #--------------------------------------------------------------------------
  1646.   def battle_actions1
  1647.     weapon = $data_weapons[@weapon_id]
  1648.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1649.   end
  1650.   #--------------------------------------------------------------------------
  1651.   # ● アニメーション取得
  1652.   #--------------------------------------------------------------------------
  1653.   def battle_actions2
  1654.     weapon = $data_weapons[@weapon2_id]
  1655.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1656.   end
  1657.   #--------------------------------------------------------------------------
  1658.   # ● 武器アニメーション取得
  1659.   #--------------------------------------------------------------------------
  1660.   def weapon_anime1
  1661.     weapon = $data_weapons[@weapon_id]
  1662.     return weapon != nil ? weapon.icon_name : ""
  1663.   end
  1664.   #--------------------------------------------------------------------------
  1665.   # ● 武器アニメーション取得
  1666.   #--------------------------------------------------------------------------
  1667.   def weapon_anime2
  1668.     weapon = $data_weapons[@weapon2_id]
  1669.     return weapon != nil ? weapon.icon_name : ""
  1670.   end
  1671.   #--------------------------------------------------------------------------
  1672.   # ● 遠距離アニメーション取得
  1673.   #--------------------------------------------------------------------------
  1674.   def flying_anime1
  1675.     weapon = $data_weapons[@weapon_id]
  1676.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1677.   end
  1678.   #--------------------------------------------------------------------------
  1679.   # ● 遠距離アニメーション取得
  1680.   #--------------------------------------------------------------------------
  1681.   def flying_anime2
  1682.     weapon = $data_weapons[@weapon2_id]
  1683.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1684.   end
  1685.   def base_y(true_y = self.true_y)
  1686.     return (true_y - @oy) * @real_zoom + @real_y
  1687.   end
  1688.   #--------------------------------------------------------------------------

  1689.   
  1690.   
  1691.   #--------------------------------------------------------------------------
  1692.   # ● アニメーション取得
  1693.   #--------------------------------------------------------------------------
  1694.   def battle_actions1
  1695.     weapon = $data_weapons[@weapon_id]
  1696.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1697.   end
  1698.   #--------------------------------------------------------------------------
  1699.   # ● アニメーション取得
  1700.   #--------------------------------------------------------------------------
  1701.   def battle_actions2
  1702.     weapon = $data_weapons[@weapon2_id]
  1703.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1704.   end
  1705.   #--------------------------------------------------------------------------
  1706.   # ● 武器アニメーション取得
  1707.   #--------------------------------------------------------------------------
  1708.   def weapon_anime1
  1709.     weapon = $data_weapons[@weapon_id]
  1710.     return weapon != nil ? weapon.icon_name : ""
  1711.   end
  1712.   #--------------------------------------------------------------------------
  1713.   # ● 武器アニメーション取得
  1714.   #--------------------------------------------------------------------------
  1715.   def weapon_anime2
  1716.     weapon = $data_weapons[@weapon2_id]
  1717.     return weapon != nil ? weapon.icon_name : ""
  1718.   end
  1719.   #--------------------------------------------------------------------------
  1720.   # ● 遠距離アニメーション取得
  1721.   #--------------------------------------------------------------------------
  1722.   def flying_anime1
  1723.     weapon = $data_weapons[@weapon_id]
  1724.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1725.   end
  1726.   #--------------------------------------------------------------------------
  1727.   # ● 遠距離アニメーション取得
  1728.   #--------------------------------------------------------------------------
  1729.   def flying_anime2
  1730.     weapon = $data_weapons[@weapon2_id]
  1731.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1732.   end  
  1733. end
  1734. #==============================================================================
  1735. # ■ Game_Party
  1736. #==============================================================================
  1737. class Game_Party
  1738.   #--------------------------------------------------------------------------
  1739.   # ● アクターを加える
  1740.   #     actor_id : アクター ID
  1741.   #--------------------------------------------------------------------------
  1742.   alias side_view_add_actor add_actor
  1743.   def add_actor(actor_id)
  1744.     # アクターを取得
  1745.     actor = $game_actors[actor_id]
  1746.     # サイドビューデータの初期化
  1747.     actor.start_battle
  1748.     # 戻す
  1749.     side_view_add_actor(actor_id)
  1750.   end
  1751. end

  1752. class Spriteset_Battle
  1753.   include Side_view
  1754.   #--------------------------------------------------------------------------
  1755.   # ● オブジェクト初期化
  1756.   #--------------------------------------------------------------------------
  1757.   alias side_veiw_initialize initialize
  1758.   def initialize
  1759.     side_veiw_initialize
  1760.     # アクタースプライトを解放
  1761.     for sprite in @actor_sprites
  1762.       sprite.dispose
  1763.     end
  1764.     # アクタースプライトを作成
  1765.     @actor_sprites = []
  1766.     for i in 1..Party_max
  1767.       @actor_sprites.push(Sprite_Battler.new(@viewport1))
  1768.     end
  1769.     update
  1770.   end
  1771.   #--------------------------------------------------------------------------
  1772.   # ● 画面のスクロール
  1773.   #--------------------------------------------------------------------------
  1774.   if method_defined?("screen_scroll")
  1775.   alias side_view_screen_scroll screen_scroll
  1776.   def screen_scroll
  1777.     side_view_screen_scroll
  1778.     # アクターの位置補正
  1779.     for actor in $game_party.actors
  1780.       actor.real_x = @real_x
  1781.       actor.real_y = @real_y
  1782.       actor.real_zoom = @real_zoom
  1783.     end
  1784.   end
  1785.   end
  1786. end

  1787. class Sprite_Battler < RPG::Sprite
  1788.   include Side_view
  1789.   #--------------------------------------------------------------------------
  1790.   # ● オブジェクト初期化
  1791.   #     viewport : ビューポート
  1792.   #     battler  : バトラー (Game_Battler)
  1793.   #--------------------------------------------------------------------------
  1794.   def initialize(viewport, battler = nil)
  1795.     super(viewport)
  1796.     @battler = battler
  1797.     @battler_visible = false
  1798.     @weapon = Sprite_Weapon.new(viewport, battler)
  1799.     @flying = Sprite_Flying.new(viewport, battler)
  1800.     @shadow = []
  1801.     @fly = 0
  1802.     @fly_direction = 1
  1803.     @rand = rand(10)
  1804.     self.effect_clear
  1805.   end
  1806.   #--------------------------------------------------------------------------
  1807.   # ● 解放
  1808.   #--------------------------------------------------------------------------
  1809.   alias side_view_dispose dispose
  1810.   def dispose
  1811.     side_view_dispose
  1812.     @weapon.dispose
  1813.     @flying.dispose
  1814.     if @_target_sprite != nil
  1815.       @_target_sprite.bitmap.dispose
  1816.       @_target_sprite.dispose
  1817.       @_target_sprite = nil
  1818.     end
  1819.   end
  1820.   #--------------------------------------------------------------------------
  1821.   # ● フレーム更新
  1822.   #--------------------------------------------------------------------------
  1823.   def update
  1824.     super
  1825.     # バトラーが nil の場合
  1826.     if @battler == nil
  1827.       self.bitmap = nil
  1828.       @weapon.bitmap = nil
  1829.       loop_animation(nil)
  1830.       return
  1831.     end
  1832.     # バトラー更新
  1833.     @battler.update
  1834.     # バトラーアニメのデータ取得
  1835.     @anime_type = @battler.anime_type
  1836.     # ファイル名か色相が現在のものと異なる場合
  1837.     if @battler.is_a?(Game_Actor) or (!@battler.is_a?(Game_Actor) and !@battler.nce)
  1838.       change = (@battler.character_name != @battler_name or @battler.character_hue != @battler_hue)
  1839.     elsif @battler.is_a?(Game_Enemy)
  1840.       change = (@battler.battler_name != @battler_name or @battler.battler_hue != @battler_hue)
  1841.     else
  1842.       return
  1843.     end
  1844.     if change
  1845.       # ビットマップを取得、設定
  1846.       if @battler.is_a?(Game_Actor) or (!@battler.is_a?(Game_Actor) and !@battler.nce)
  1847.         @battler_name = @battler.character_name
  1848.         @battler_hue = @battler.character_hue
  1849.         self.bitmap = RPG::Cache.character(@battler_name, @battler_hue)
  1850.         @width = bitmap.width / 4
  1851.         @height = bitmap.height / 4
  1852.       else
  1853.         @battler_name = @battler.battler_name
  1854.         @battler_hue = @battler.battler_hue
  1855.         self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  1856.         @width = bitmap.width
  1857.         @height = bitmap.height
  1858.       end
  1859.       self.ox = @width / 2
  1860.       self.oy = @height / 2
  1861.       @battler.height = @height
  1862.       @flag = true
  1863.       # 戦闘不能または隠れ状態なら不透明度を 0 にする
  1864.       if @battler.dead? or @battler.hidden
  1865.         self.opacity = 0
  1866.       end
  1867.     end
  1868.     if (@battler.is_a?(Game_Actor) and
  1869.       (@battler.anime_type != @anime_type or @battler.pattern != @pattern or @flag)) or
  1870.       (!@battler.is_a?(Game_Actor) and !@battler.nce)
  1871.       # ビットマップを取得、設定
  1872.       @pattern = @battler.pattern
  1873.       self.ox = @width / 2
  1874.       self.oy = @height / 2
  1875.       @sx = @pattern * @width
  1876.       sy = @anime_type % 4 * @height
  1877.       x   = sy / (@height * 2) + 4
  1878.       if !@battler.is_a?(Game_Actor) and !@battler.nce and x == 4
  1879.         x = 6
  1880.       end    # here!!
  1881.       @sy = (x - 2) / 2 * @height
  1882.       self.src_rect.set(@sx, @sy, @width, @height)
  1883.       self.zoom_x = CHAR_ZOOM
  1884.       self.zoom_y = CHAR_ZOOM
  1885.       @battler.height = @height
  1886.       @flag = false
  1887.     end
  1888.     # 飛行
  1889.     update_fly
  1890.     # シェイク
  1891.     update_shake
  1892.     # 回転
  1893.     update_turning
  1894.     # 反転
  1895.     update_reverse   
  1896.     # 移動
  1897.     update_moving
  1898.     # 追加アニメ
  1899.     update_add_anime
  1900.     # エフェクト効果の適用
  1901.     update_effect
  1902.     # アニメーション ID が現在のものと異なる場合
  1903.     flag = RTAB ? true : @battler.damage == nil
  1904.     if flag and @battler.state_animation_id != @state_animation_id
  1905.       @state_animation_id = @battler.state_animation_id
  1906.       loop_animation($data_animations[@state_animation_id])
  1907.     end
  1908.     # シェイク
  1909.     if @battler.shake
  1910.       self.start_shake(5, 5, 5)
  1911.       @battler.shake = false
  1912.     end
  1913.     # 明滅
  1914.     if @battler.blink
  1915.       blink_on
  1916.     else
  1917.       blink_off
  1918.     end
  1919.     # 不可視の場合
  1920.     unless @battler_visible
  1921.       flag = RTAB ? (@battler.damage.size < 2 or @battler.damage_pop.size < 2) :
  1922.                     (@battler.damage == nil or @battler.damage_pop)
  1923.       # 出現
  1924.       if not @battler.hidden and not @battler.dead? and flag
  1925.         appear
  1926.         @battler_visible = true
  1927.       end
  1928.     end
  1929.     if RTAB
  1930.     # ダメージ
  1931.     for battler in @battler.damage_pop
  1932.       if battler[0].class == Array
  1933.         if battler[0][1] >= 0
  1934.           $scene.skill_se
  1935.         else
  1936.           $scene.levelup_se
  1937.         end
  1938.         damage(@battler.damage[battler[0]], false, 2)
  1939.       else
  1940.         damage(@battler.damage[battler[0]], @battler.critical[battler[0]])
  1941.       end
  1942.       if @battler.damage_sp.include?(battler[0])
  1943.         damage(@battler.damage_sp[battler[0]],
  1944.                 @battler.critical[battler[0]], 1)
  1945.         @battler.damage_sp.delete(battler[0])
  1946.       end
  1947.       @battler.damage_pop.delete(battler[0])
  1948.       @battler.damage.delete(battler[0])
  1949.       @battler.critical.delete(battler[0])
  1950.     end
  1951.     end
  1952.     # 可視の場合
  1953.     if @battler_visible
  1954.       # 武器アニメ
  1955.       @weapon.battler = @battler
  1956.       @weapon.update
  1957.       # 遠距離アニメ
  1958.       @flying.battler = @battler
  1959.       @flying.update
  1960.       # 逃走
  1961.       if @battler.hidden
  1962.         $game_system.se_play($data_system.escape_se)
  1963.         escape
  1964.         @battler_visible = false
  1965.       end
  1966.       # 白フラッシュ
  1967.       if @battler.white_flash
  1968.         whiten
  1969.         @battler.white_flash = false
  1970.       end
  1971.       if RTAB
  1972.       # アニメーション
  1973.       if !@battler.animation.empty?
  1974.         for animation in @battler.animation.reverse
  1975.           if animation[2]
  1976.             animation($data_animations[animation[0]], animation[1], true)
  1977.           else
  1978.             animation($data_animations[animation[0]], animation[1])
  1979.           end
  1980.           @battler.animation.delete(animation)
  1981.         end
  1982.       end
  1983.       else
  1984.       # アニメーション
  1985.       if @battler.animation_id != 0
  1986.         animation = $data_animations[@battler.animation_id]
  1987.         animation(animation, @battler.animation_hit)
  1988.         @battler.animation_id = 0
  1989.       end
  1990.       end
  1991.       # ダメージ
  1992.       if !RTAB and @battler.damage_pop
  1993.         damage(@battler.damage, @battler.critical)
  1994.         @battler.damage = nil
  1995.         @battler.critical = false
  1996.         @battler.damage_pop = false
  1997.       end
  1998.       flag = RTAB ? (@battler.damage.empty? and $scene.dead_ok?(@battler)) :
  1999.                      @battler.damage == nil
  2000.       # コラプス
  2001.       if flag and @battler.dead?
  2002.         if @battler.is_a?(Game_Actor)
  2003.           $game_system.se_play($data_system.actor_collapse_se)
  2004.         elsif @battler.is_a?(Game_Enemy)
  2005.           $game_system.se_play($data_system.enemy_collapse_se)
  2006.         end
  2007.         collapse
  2008.         @battler_visible = false
  2009.       end
  2010.     end
  2011.     # スプライトの座標を設定
  2012.     self.x = @battler.screen_x + @effect_ox
  2013.     self.y = @battler.screen_y + @effect_oy
  2014.     self.z = @battler.screen_z
  2015.     self.zoom_x = @battler.real_zoom
  2016.     self.zoom_y = @battler.real_zoom
  2017.     # ウェイトカウントを減らす
  2018.     @battler.wait_count -= 1
  2019.     @battler.wait_count2 -= 1
  2020.     # アニメーション待ち時間取得
  2021.     @battler.animation_duration = @_animation_duration
  2022.     if @battler.is_a?(Game_Actor) or (!@battler.is_a?(Game_Actor) and !@battler.nce)
  2023.       self.zoom_x *= CHAR_ZOOM
  2024.       self.zoom_y *= CHAR_ZOOM
  2025.       @weapon.x = self.x + 2
  2026.       @weapon.y = self.y + 6
  2027.       @weapon.angle = 75 - (4 - @battler.pattern) * 45
  2028.       if self.mirror
  2029.         @weapon.angle += @weapon.angle - 180
  2030.       end
  2031.       if (!@battler.is_a?(Game_Actor) and !@battler.nce)
  2032.         @weapon.angle = [email]-@weapon.angle[/email]-90
  2033.       end
  2034.     end
  2035.     # 残像
  2036.     if @battler.shadow
  2037.       if Graphics.frame_count % 2 == 0
  2038.         shadow = ::Sprite.new(self.viewport)
  2039.         shadow.bitmap = self.bitmap.dup
  2040.         shadow.x = self.x
  2041.         shadow.y = self.y
  2042.         shadow.ox = self.ox
  2043.         shadow.oy = self.oy
  2044.         shadow.mirror = self.mirror
  2045.         shadow.angle = self.angle
  2046.         shadow.opacity = 160
  2047.         shadow.zoom_x = self.zoom_x
  2048.         shadow.zoom_y = self.zoom_y
  2049.         if @battler.is_a?(Game_Actor) or (!@battler.is_a?(Game_Actor) and !@battler.nce)
  2050.           shadow.src_rect.set(@sx, @sy, @width, @height)
  2051.         else
  2052.           shadow.src_rect.set(0, 0, @width, @height)
  2053.         end
  2054.         @shadow.push([shadow,duration = 10,@battler.true_x + @effect_ox,@battler.true_y + @effect_oy])
  2055.       end
  2056.     end
  2057.     for s in @shadow
  2058.       if !s[0].disposed?
  2059.         s[0].update
  2060.         s[1] -= 1
  2061.         if s[1] < 1
  2062.           if s[0].bitmap != nil
  2063.             s[0].bitmap.dispose
  2064.           end
  2065.           s[0].dispose
  2066.         else
  2067.           s[0].x = @battler.screen_x(s[2])
  2068.           s[0].y = @battler.screen_y(s[3])
  2069.         end
  2070.       else
  2071.         s = nil
  2072.       end
  2073.     end
  2074.     @shadow.compact!
  2075.   end
  2076.   #--------------------------------------------------------------------------
  2077.   # ● エフェクトによる座標系の更新
  2078.   #--------------------------------------------------------------------------
  2079.   def update_effect
  2080.     # 角度の修正
  2081.     if @_upside_down
  2082.       self.angle = (@_turning + 180) % 360
  2083.     else
  2084.       self.angle = @_turning
  2085.     end
  2086.     # X 座標の修正値
  2087.     @effect_ox = @_shake + @_moving[0]
  2088.     # Y 座標の修正値
  2089.     @effect_oy = -@fly + @_moving[1]
  2090.     if  @_animation == nil or (RTAB and @_animation.empty?)
  2091.       self.effect_clear
  2092.     end
  2093.   end
  2094.   #--------------------------------------------------------------------------
  2095.   # ● シェイク更新
  2096.   #--------------------------------------------------------------------------
  2097.   def update_shake
  2098.     if @_shake_duration >= 1 or @_shake != 0
  2099.       delta = (@_shake_power * @_shake_speed * @_shake_direction) / 10.0
  2100.       if @_shake_duration <= 1 and @_shake * (@_shake + delta) < 0
  2101.         @_shake = 0
  2102.       else
  2103.         @_shake += delta
  2104.       end
  2105.       if @_shake > @_shake_power * 2
  2106.         @_shake_direction = -1
  2107.       end
  2108.       if @_shake < - @_shake_power * 2
  2109.         @_shake_direction = 1
  2110.       end
  2111.       if @_shake_duration >= 1
  2112.         @_shake_duration -= 1
  2113.       end
  2114.     end
  2115.   end
  2116.   #--------------------------------------------------------------------------
  2117.   # ● 飛行更新
  2118.   #--------------------------------------------------------------------------
  2119.   def update_fly
  2120.     if @rand > 0
  2121.       @rand -= 1
  2122.       return
  2123.     end
  2124.     if @battler.fly != 0
  2125.       if @fly < @battler.fly / 4
  2126.         @fly_direction = 1
  2127.       elsif @fly > @battler.fly / 2
  2128.         @fly_direction = -1
  2129.       end
  2130.       @fly += 0.5 * @fly_direction
  2131.     end
  2132.   end
  2133.   #--------------------------------------------------------------------------
  2134.   # ● 回転更新
  2135.   #--------------------------------------------------------------------------
  2136.   def update_turning
  2137.     if @_turning_duration > 0 or @_turning != 0
  2138.       @_turning += @_turning_direction * @_turning_speed / 2.0
  2139.       # 残り回転数を減らす
  2140.       if @_turning_direction == -1
  2141.         if @_turning_duration > 0 and @_turning < 0
  2142.           @_turning_duration -= 1
  2143.         end
  2144.       elsif @_turning_direction == 1
  2145.         if @_turning_duration > 0 and @_turning >= 360
  2146.           @_turning_duration -= 1
  2147.         end
  2148.       end
  2149.       # 以下補正
  2150.       while @_turning < 0
  2151.         @_turning += 360
  2152.       end
  2153.       if @_turning_duration <= 0
  2154.         @_turning = 0
  2155.       end
  2156.       @_turning %= 360
  2157.     end
  2158.   end
  2159.   #--------------------------------------------------------------------------
  2160.   # ● 左右反転更新
  2161.   #--------------------------------------------------------------------------
  2162.   def update_reverse
  2163.     if @last_reverse != (@_reverse or @battler.reverse)
  2164.       self.mirror = (@_reverse or @battler.reverse)
  2165.       @last_reverse = (@_reverse or @battler.reverse)
  2166.     end
  2167.   end
  2168.   #--------------------------------------------------------------------------
  2169.   # ● 移動更新
  2170.   #--------------------------------------------------------------------------
  2171.   def update_moving
  2172.     @move_distance = (@_move_coordinates[2] - @_move_coordinates[0]).abs +
  2173.                      (@_move_coordinates[3] - @_move_coordinates[1]).abs
  2174.     if @move_distance > 0
  2175.       return if @_moving[0] == @_move_coordinates[0] and @_moving[1] == @_move_coordinates[1]
  2176.       array = @_move_coordinates
  2177.       x = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @_move_duration) / @move_distance.to_f).to_i
  2178.       y = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @_move_duration) / @move_distance.to_f).to_i
  2179.       @_moving = [x, y]
  2180.       if @_move_quick_return and @_move_duration == 0
  2181.         @_move_coordinates = [0,0,array[0],array[1]]
  2182.         @_move_duration = @move_distance
  2183.       end
  2184.       @_move_duration -= @_move_speed
  2185.       @_move_duration = [@_move_duration, 0].max
  2186.     end
  2187.   end
  2188.   #--------------------------------------------------------------------------
  2189.   # ● 追加アニメ更新 (RTAB限定機能)
  2190.   #--------------------------------------------------------------------------
  2191.   def update_add_anime
  2192.     if RTAB
  2193.     # アニメーション
  2194.     if @_add_anime_id != 0
  2195.       animation = $data_animations[@_add_anime_id]
  2196.       animation(animation, true)
  2197.       @_add_anime_id = 0
  2198.     end
  2199.     end
  2200.   end
  2201.   #--------------------------------------------------------------------------
  2202.   # ● エフェクト初期化
  2203.   #--------------------------------------------------------------------------
  2204.   def effect_clear
  2205.     @_effect_ox = 0
  2206.     @_effect_oy = 0
  2207.     @_shake_power = 0
  2208.     @_shake_speed = 0
  2209.     @_shake_duration = 0
  2210.     @_shake_direction = 1
  2211.     @_shake = 0
  2212.     @_upside_down = false
  2213.     @_reverse = false
  2214.     @_turning_direction = 1
  2215.     @_turning_speed = 0
  2216.     @_turning_duration = 0
  2217.     @_turning = 0
  2218.     @_move_quick_return = true
  2219.     @_move_speed = 0
  2220.     @_move_coordinates = [0,0,0,0]
  2221.     @_move_jump = false
  2222.     @_move_duration = 0
  2223.     @_moving = [0,0]
  2224.     @_add_anime_id = 0
  2225.   end
  2226.   #--------------------------------------------------------------------------
  2227.   # ● シェイクの開始
  2228.   #     power    : 強さ
  2229.   #     speed    : 速さ
  2230.   #     duration : 時間
  2231.   #--------------------------------------------------------------------------
  2232.   def start_shake(power, speed, duration)
  2233.     @_shake_power = power
  2234.     @_shake_speed = speed
  2235.     @_shake_duration = duration
  2236.   end
  2237.   #--------------------------------------------------------------------------
  2238.   # ● 上下反転を開始
  2239.   #--------------------------------------------------------------------------
  2240.   def start_upside_down
  2241.     @_upside_down = @_upside_down ? false : true
  2242.   end
  2243.   #--------------------------------------------------------------------------
  2244.   # ● 左右反転を開始
  2245.   #--------------------------------------------------------------------------
  2246.   def start_reverse
  2247.     @_reverse = @_reverse ? false : true
  2248.   end
  2249.   #--------------------------------------------------------------------------
  2250.   # ● 回転を開始
  2251.   #     direction: 方向
  2252.   #     speed    : 速さ
  2253.   #     duration : 時間
  2254.   #--------------------------------------------------------------------------
  2255.   def start_turning(direction, speed, duration)
  2256.     @_turning_direction = direction
  2257.     @_turning_speed = speed
  2258.     @_turning_duration = duration
  2259.     @_turning = @_turning_direction == 1 ? 0 : 360
  2260.   end
  2261.   #--------------------------------------------------------------------------
  2262.   # ● 移動を開始
  2263.   #     quick_return : 戻るかどうか
  2264.   #     speed        : 速さ
  2265.   #     x            : X 座標
  2266.   #     y            : Y 座標
  2267.   #--------------------------------------------------------------------------
  2268.   def start_moving(quick_return, speed, x, y)
  2269.     @_move_quick_return = quick_return == 0 ? false : true
  2270.     @_move_speed = speed
  2271.     @_move_coordinates = [x,y,@_move_coordinates[0],@_move_coordinates[1]]
  2272.     distance = (@_move_coordinates[2] - @_move_coordinates[0]).abs +
  2273.                (@_move_coordinates[3] - @_move_coordinates[1]).abs
  2274.     @_move_duration = distance
  2275.   end
  2276.   #--------------------------------------------------------------------------
  2277.   # ● アニメ追加を開始
  2278.   #     id           : ID
  2279.   #     hit          : 命中フラッグ
  2280.   #--------------------------------------------------------------------------
  2281.   def start_add_anime(id)
  2282.     @_add_anime_id = id
  2283.   end
  2284.   #--------------------------------------------------------------------------
  2285.   # ● 各種エフェクトの開始判定
  2286.   #--------------------------------------------------------------------------
  2287.   if !method_defined?("side_view_animation_process_timing")
  2288.     alias side_view_animation_process_timing animation_process_timing
  2289.   end
  2290.   def animation_process_timing(timing, hit)
  2291.     side_view_animation_process_timing(timing, hit)
  2292.     if (timing.condition == 0) or
  2293.        (timing.condition == 1 and hit == true) or
  2294.        (timing.condition == 2 and hit == false)
  2295.       if timing.se.name =~ SHAKE_FILE
  2296.         names = timing.se.name.split(/#/)
  2297.         power    = names[1].nil? ? SHAKE_POWER    : names[1].to_i
  2298.         speed    = names[2].nil? ? SHAKE_SPEED    : names[2].to_i
  2299.         duration = names[3].nil? ? SHAKE_DURATION : names[3].to_i
  2300.         # シェイクを開始
  2301.         self.start_shake(power, speed, duration)
  2302.       end
  2303.       if timing.se.name == UPSIDE_DOWN_FILE
  2304.         # 上下反転を開始
  2305.         self.start_upside_down
  2306.       end
  2307.       if timing.se.name == REVERSE_FILE
  2308.         # 左右反転を開始
  2309.         self.start_reverse
  2310.       end
  2311.       if timing.se.name =~ TURNING_FILE
  2312.         names = timing.se.name.split(/#/)
  2313.         direction = names[1].nil? ? TURNING_DIRECTION : names[1].to_i
  2314.         speed     = names[2].nil? ? TURNING_SPEED     : names[2].to_i
  2315.         duration  = names[3].nil? ? TURNING_DURATION  : names[3].to_i
  2316.         # 回転を開始
  2317.         self.start_turning(direction, speed, duration)
  2318.       end
  2319.       if timing.se.name =~ MOVE_FILE
  2320.         names = timing.se.name.split(/#/)
  2321.         quick_return= names[1].nil? ? MOVE_RETURN      : names[1].to_i
  2322.         speed       = names[2].nil? ? MOVE_SPEED       : names[2].to_i
  2323.         x           = names[3].nil? ? MOVE_COORDINATES[0] : names[3].to_i
  2324.         y           = names[3].nil? ? MOVE_COORDINATES[1] : names[4].to_i
  2325.         # 移動を開始
  2326.         self.start_moving(quick_return, speed, x, y)
  2327.       end
  2328.       if timing.se.name =~ ADD_ANIME_FILE
  2329.         names = timing.se.name.split(/#/)
  2330.         id = names[1].nil? ? ADD_ANIME_ID      : names[1].to_i
  2331.         # アニメ追加を開始
  2332.         self.start_add_anime(id)
  2333.       end
  2334.     end
  2335.   end
  2336. end

  2337. #==============================================================================
  2338. # ■ Sprite_Weapon
  2339. #------------------------------------------------------------------------------
  2340. #  バトラー表示用のスプライトです。Game_Battler クラスのインスタンスを監視し、
  2341. # スプライトの状態を自動的に変化させます。
  2342. #==============================================================================

  2343. class Sprite_Weapon < RPG::Sprite
  2344.   include Side_view
  2345.   #--------------------------------------------------------------------------
  2346.   # ● 公開インスタンス変数
  2347.   #--------------------------------------------------------------------------
  2348.   attr_accessor :battler                  # バトラー
  2349.   attr_reader   :cw                       # グラフィックの幅
  2350.   attr_reader   :ch                       # グラフィックの高さ
  2351.   #--------------------------------------------------------------------------
  2352.   # ● オブジェクト初期化
  2353.   #     viewport : ビューポート
  2354.   #     battler  : バトラー (Game_Battler)
  2355.   #--------------------------------------------------------------------------
  2356.   def initialize(viewport, battler = nil)
  2357.     super(viewport)
  2358.     @battler = battler
  2359.     @battler_visible = false
  2360.   end
  2361.   #--------------------------------------------------------------------------
  2362.   # ● 解放
  2363.   #--------------------------------------------------------------------------
  2364.   def dispose
  2365.     if self.bitmap != nil
  2366.       self.bitmap.dispose
  2367.     end
  2368.     super
  2369.   end
  2370.   #--------------------------------------------------------------------------
  2371.   # ● フレーム更新
  2372.   #--------------------------------------------------------------------------
  2373.   def update
  2374.     super
  2375.     # バトラーが nil の場合
  2376.     if @battler == nil or (!@battler.is_a?(Game_Actor) and @battler.nce)
  2377.       self.bitmap = nil
  2378.       return
  2379.     end
  2380.     # ウエポンアニメのデータ取得
  2381.     @weapon_anime_type = @battler.weapon_anime_type(@battler.condition)
  2382.     # 設定が「非表示」の場合
  2383.     if !@weapon_anime_type[1] or @weapon_anime_type[0].nil?
  2384.       self.visible = false
  2385.       return
  2386.     else
  2387.       self.visible = true
  2388.     end
  2389.     # ファイル名が現在のものと異なる場合
  2390.     if @weapon_anime_type[0] != @weapon_name
  2391.       @weapon_name = @weapon_anime_type[0]
  2392.       # ビットマップを取得、設定
  2393.       self.bitmap = RPG::Cache.icon(@weapon_name)
  2394.       @width = bitmap.width
  2395.       @height = bitmap.height
  2396.       @flag = true
  2397.     end
  2398.     # 現在アニメパターンが現在のものと異なる場合
  2399.     if @pattern != @battler.pattern or @flag or @condition != @battler.condition
  2400.       @pattern = @battler.pattern
  2401.       @condition = @battler.condition
  2402.       self.ox = @width
  2403.       self.oy = @height
  2404.       self.z = battler.screen_z
  2405.       self.zoom_x = @battler.real_zoom * CHAR_ZOOM
  2406.       self.zoom_y = @battler.real_zoom * CHAR_ZOOM
  2407.       self.src_rect.set(0, 0, @width, @height)
  2408.       self.opacity = 255
  2409.       # バトラーより手前に表示
  2410.       if @weapon_anime_type[2]
  2411.         self.z += 10
  2412.       # バトラーより奥に表示
  2413.       else
  2414.         self.z -= 10
  2415.       end
  2416.       @flag = false
  2417.     end
  2418.   end
  2419. end

  2420. #==============================================================================
  2421. # ■ Sprite_Flying
  2422. #------------------------------------------------------------------------------
  2423. #  バトラー表示用のスプライトです。Game_Battler クラスのインスタンスを監視し、
  2424. # スプライトの状態を自動的に変化させます。
  2425. #==============================================================================

  2426. class Sprite_Flying < RPG::Sprite
  2427.   include Side_view
  2428.   #--------------------------------------------------------------------------
  2429.   # ● 公開インスタンス変数
  2430.   #--------------------------------------------------------------------------
  2431.   attr_accessor :battler                  # バトラー
  2432.   #--------------------------------------------------------------------------
  2433.   # ● オブジェクト初期化
  2434.   #     viewport : ビューポート
  2435.   #     battler  : バトラー (Game_Battler)
  2436.   #--------------------------------------------------------------------------
  2437.   def initialize(viewport, battler = nil)
  2438.     super(viewport)
  2439.     @battler = battler
  2440.     @battler_visible = false
  2441.   end
  2442.   #--------------------------------------------------------------------------
  2443.   # ● 解放
  2444.   #--------------------------------------------------------------------------
  2445.   def dispose
  2446.     if self.bitmap != nil
  2447.       self.bitmap.dispose
  2448.     end
  2449.     super
  2450.   end
  2451.   #--------------------------------------------------------------------------
  2452.   # ● フレーム更新
  2453.   #--------------------------------------------------------------------------
  2454.   def update
  2455.     super
  2456.     # バトラーが nil の場合
  2457.     if @battler == nil
  2458.       self.bitmap = nil
  2459.       loop_animation(nil)
  2460.       return
  2461.     end
  2462.     # 遠距離アニメ
  2463.     flying_animation = @battler.flying_animation
  2464.     flying_start = flying_animation[0]
  2465.     flying_end   = flying_animation[1]
  2466.     # アニメーション ID が現在のものと異なる場合
  2467.     if @anime_id != @battler.flying_anime[0]
  2468.       @anime_id = @battler.flying_anime[0]
  2469.       @animation = $data_animations[@anime_id]
  2470.     end
  2471.     # アニメーション 開始
  2472.     if flying_start
  2473.       loop_animation(@animation)
  2474.     elsif flying_end
  2475.       loop_animation(nil)
  2476.     end
  2477.     self.x = @battler.flying_x
  2478.     self.y = @battler.flying_y
  2479.     self.z = @battler.screen_z + 1000
  2480.   end
  2481. end

  2482. module RPG
  2483.   class Skill
  2484.     #--------------------------------------------------------------------------
  2485.     # ● 魔法かどうかの判断
  2486.     #--------------------------------------------------------------------------
  2487.     def magic?
  2488.       if @atk_f == 0
  2489.         return true
  2490.       else
  2491.         return false
  2492.       end
  2493.     end
  2494.   end
  2495. end

  2496. # アローカーソルの位置修正

  2497. class Arrow_Actor < Arrow_Base
  2498.   include Side_view
  2499.   #--------------------------------------------------------------------------
  2500.   # ● フレーム更新
  2501.   #--------------------------------------------------------------------------
  2502.   alias side_view_update update
  2503.   def update
  2504.     side_view_update
  2505.     # スプライトの座標を設定
  2506.     if self.actor != nil && (self.x != self.actor.screen_x + ARROW_OX or self.y != self.actor.screen_y + ARROW_OY)
  2507.       self.x = self.actor.screen_x + ARROW_OX
  2508.       self.y = self.actor.screen_y + ARROW_OY
  2509.     end
  2510.   end
  2511. end
  2512. class Arrow_Enemy < Arrow_Base
  2513.   include Side_view
  2514.   #--------------------------------------------------------------------------
  2515.   # ● フレーム更新
  2516.   #--------------------------------------------------------------------------
  2517.   alias side_view_update update
  2518.   def update
  2519.     side_view_update
  2520.     # スプライトの座標を設定
  2521.     if self.enemy != nil && self.y != self.enemy.screen_y + self.enemy.height/2
  2522.       self.x = self.enemy.screen_x
  2523.       self.y = self.enemy.screen_y + self.enemy.height/2
  2524.     end
  2525.   end
  2526. end
  2527. module Rtab_use
  2528.   def update_phase4_step3(battler)
  2529.     # ヘルプウィンドウの更新。アクションの種別で分岐
  2530.     case battler.current_action.kind
  2531.     when 0  # 基本
  2532.       if battler.current_action.basic == 1
  2533.         @help_window.set_text($data_system.words.guard, 1)
  2534.         @help_wait = @help_time
  2535.       end
  2536.       if battler.is_a?(Game_Enemy) and battler.current_action.basic == 2
  2537.         @help_window.set_text("逃げる", 1)
  2538.         @help_wait = @help_time
  2539.       end
  2540.     when 1  # スキル
  2541.       skill =  $data_skills[battler.current_action.skill_id]
  2542.       @help_window.set_text(skill.name, 1)
  2543.       @help_wait = @help_time
  2544.     when 2  # アイテム
  2545.       item = $data_items[battler.current_action.item_id]
  2546.       @help_window.set_text(item.name, 1)
  2547.       @help_wait = @help_time
  2548.     end
  2549.     # 行動側アニメーション (ID が 0 の場合は白フラッシュ)
  2550.     if battler.anime1 == 0
  2551.       battler.white_flash = true
  2552.       battler.wait = 5
  2553.       # カメラ設定
  2554.       if battler.target[0].is_a?(Game_Enemy)
  2555.         camera_set(battler)
  2556.       end
  2557.     else
  2558.       battler.animation.push([battler.anime1, true])
  2559.       speller = synthe?(battler)
  2560.       if speller != nil
  2561.         for spell in speller
  2562.           if spell != battler
  2563.             if spell.current_action.spell_id == 0
  2564.               spell.animation.push([battler.anime1, true])
  2565.             else
  2566.               skill = spell.current_action.spell_id
  2567.               spell.animation.push([$data_skills[skill].animation1_id, true])
  2568.               spell.current_action.spell_id = 0
  2569.             end
  2570.           end
  2571.         end
  2572.       end
  2573.       battler.wait = 2 * $data_animations[battler.anime1].frame_max - 10
  2574.       battler.anime1 = 0
  2575.     end
  2576.     # ステップ 4 に移行
  2577.     battler.phase = 4 if !(!battler.animation1_on and battler.action? and !battler.flash?)
  2578.   end
  2579. end

  2580. #==============================================================================
  2581. # ■ Scene_Battle
  2582. #==============================================================================
  2583. class Scene_Battle
  2584.   include Side_view
  2585.   include Rtab_use if RTAB
  2586.   #--------------------------------------------------------------------------
  2587.   # ● 公開インスタンス変数
  2588.   #--------------------------------------------------------------------------
  2589.   attr_reader   :phase            # フェーズ
  2590.   attr_reader   :phase4_step      # フェーズ4ステップ
  2591.   attr_reader   :active_battler   # 対象の配列
  2592.   attr_reader   :target_battlers  # 対象の配列
  2593.   attr_reader   :animation1_id    # 行動アニメID
  2594.   attr_reader   :animation2_id    # 対象アニメID
  2595.   #--------------------------------------------------------------------------
  2596.   # ● メイン処理
  2597.   #--------------------------------------------------------------------------
  2598.   alias side_view_main main
  2599.   def main
  2600.     # バトラー初期化
  2601.     for battler in $game_party.actors + $game_troop.enemies
  2602.       battler.start_battle
  2603.     end
  2604.     # 戻す
  2605.     side_view_main
  2606.   end
  2607.   #--------------------------------------------------------------------------
  2608.   # ● 閃き判定
  2609.   #--------------------------------------------------------------------------
  2610.   def flash?
  2611.     return @flash_flag ? true : false
  2612.   end  
  2613.   #--------------------------------------------------------------------------
  2614.   # ● 閃きアニメ待ち時間取得
  2615.   #--------------------------------------------------------------------------
  2616.   def flash_duration
  2617.     animation = nil
  2618.     if FLASH_ANIME
  2619.       animation = $data_animations[FLASH_ANIMATION_ID]
  2620.     end
  2621.     return animation != nil ? animation.frame_max * 2 + 2 : 0
  2622.   end
  2623.   #--------------------------------------------------------------------------
  2624.   # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  2625.   #--------------------------------------------------------------------------
  2626.   alias side_view_update_phase4_step2 update_phase4_step2
  2627.   def update_phase4_step2(*arg)
  2628.     battler = convert_battler2(*arg)
  2629.     battler.action
  2630.     side_view_update_phase4_step2(*arg)
  2631.   end
  2632.   #--------------------------------------------------------------------------
  2633.   # ● フレーム更新 (メインフェーズ ステップ 3 : 行動側アニメーション)
  2634.   #--------------------------------------------------------------------------
  2635.   alias side_view_update_phase4_step3 update_phase4_step3
  2636.   def update_phase4_step3(*arg)
  2637.     battler = convert_battler2(*arg)
  2638.     if battler.flash? and FLASH_ANIME
  2639.       battler.flash_flag["normal"] = true
  2640.     end
  2641.     side_view_update_phase4_step3(*arg)
  2642.   end
  2643.   #--------------------------------------------------------------------------
  2644.   # ● フレーム更新 (メインフェーズ ステップ 4 : 対象側アニメーション)
  2645.   #--------------------------------------------------------------------------
  2646.   alias side_view_update_phase4_step4 update_phase4_step4
  2647.   def update_phase4_step4(*arg)
  2648.     battler = convert_battler2(*arg)
  2649.     targets = RTAB ? battler.target : @target_battlers
  2650.     return if !battler.animation2_on and battler.action? if !RTAB
  2651.     side_view_update_phase4_step4(*arg)
  2652.     for target in targets
  2653.       if RTAB
  2654.         value = nil
  2655.         if target.damage_sp.include?(battler)
  2656.           value = target.damage_sp[battler]
  2657.         end
  2658.         if target.damage.include?(battler)
  2659.           if value == nil or value == "Miss"
  2660.             value = target.damage[battler]
  2661.           elsif value.is_a?(Numeric) && value > 0
  2662.             value = target.damage[battler] == "Miss" ? value : target.damage[battler]
  2663.           end
  2664.         end
  2665.       else
  2666.         value = target.damage
  2667.       end
  2668.       if target.is_a?(Game_Actor)
  2669.         # ダメージの場合
  2670.         if value.is_a?(Numeric) && value > 0
  2671.           # シェイクを開始
  2672.           target.shake = true
  2673.         end
  2674.       elsif target.is_a?(Game_Enemy)
  2675.         # ダメージの場合
  2676.         if value.is_a?(Numeric) && value > 0
  2677.           # シェイクを開始
  2678.           target.shake = true
  2679.         end
  2680.       end
  2681.     end
  2682.   end
  2683.   #--------------------------------------------------------------------------
  2684.   # ● プレバトルフェーズ開始
  2685.   #--------------------------------------------------------------------------
  2686.   alias start_phase1_correct start_phase1
  2687.   def start_phase1
  2688.     # カメラの設定
  2689.     # 元々フロントビュー向けの数値になっているため
  2690.     @zoom_rate = [1.0, 1.0]
  2691.     start_phase1_correct
  2692.   end
  2693.   #--------------------------------------------------------------------------
  2694.   # ● アクターコマンドフェーズ開始
  2695.   #--------------------------------------------------------------------------
  2696.   alias start_phase3_correct start_phase3
  2697.   def start_phase3
  2698.     battler = convert_battler
  2699.     start_phase3_correct
  2700.     if RTAB
  2701.       # カメラの設定
  2702.       # 元々フロントビュー向けの数値になっているため
  2703.       @camera = "command"
  2704. #      @spriteset.screen_target(0, 0, 1.0)
  2705.     end
  2706.   end


  2707.   def action_phase(battler)
  2708.     # action が 1 の場合、バトラーが行動中かどうか確認
  2709.     if @action == 1 and battler.phase < 3
  2710.       for target in battler.target
  2711.         speller = synthe?(target)
  2712.         if speller == nil
  2713.           # ターゲットが通常行動中の場合
  2714.           if @action_battlers.include?(target)
  2715.             if target.phase > 2
  2716.               return
  2717.             end
  2718.           end
  2719.         else
  2720.           # ターゲットが連携スキル発動中の場合
  2721.           for spell in speller
  2722.             if @action_battlers.include?(spell)
  2723.               if spell.phase > 2
  2724.                 return
  2725.               end
  2726.             end
  2727.           end
  2728.         end
  2729.       end
  2730.     end
  2731. case battler.phase
  2732.   when 1
  2733.     update_phase4_step1(battler)
  2734.   when 2
  2735.     update_phase4_step2(battler)
  2736.   when 3  
  2737.     update_phase4_step3(battler) if !(!battler.animation1_on and battler.action? and !battler.flash?)
  2738.   when 4
  2739.     update_phase4_step4(battler) if !(!battler.animation2_on and battler.action?)
  2740.   when 5
  2741.     update_phase4_step5(battler)
  2742.       when 6
  2743.     update_phase4_step6(battler)
  2744.   end
  2745. end
  2746. end
复制代码


■ 物品詳細幫助窗口
  1. #==============================================================================
  2. # 禾西製作 / Created by Quarcy
  3. #==============================================================================
  4. class Window_Help < Window_Base
  5.   attr_reader :materia
  6.   #--------------------------------------------------------------------------
  7.   # ● 定義不顯示的屬性與狀態
  8.   #--------------------------------------------------------------------------
  9.   def unshown
  10.     @unshow_elements = []
  11.     @unshow_states = []
  12.   end
  13.   #--------------------------------------------------------------------------
  14.   # ● 初始化對象
  15.   #--------------------------------------------------------------------------
  16.   def initialize
  17.     super(0, 0, 640, 64)
  18.     self.opacity = 225
  19.     self.z=150
  20.     self.visible = false
  21.     unless $scene.is_a?Scene_Shop or $scene.is_a?Scene_Battle or $scene.is_a?Scene_Item or $scene.is_a?Scene_Equip
  22.     self.opacity = 0
  23.     end
  24.   end
  25.   #--------------------------------------------------------------------------
  26.   # ● 設置文本
  27.   #     data  : 窗口顯示的字符串/物品資料
  28.   #     align : 對齊方式 (0..左對齊、1..中間對齊、2..右對齊)
  29.   #--------------------------------------------------------------------------
  30.   def set_text(data, align=0)
  31.     #------------------------------------------------------------------------
  32.     # ● 當資料爲文字時候
  33.     #------------------------------------------------------------------------
  34.     # 如果文本或對齊方式至少一方与上次的不同
  35.     if data != @text or align != @align
  36.       if data.is_a?(String)
  37.         # 再描繪文本
  38.         self.width = 640
  39.         self.height = 64
  40.         self.x=0
  41.         self.y=0
  42.         self.contents = Bitmap.new(width - 32, height - 32) if self.contents.nil?
  43.         self.contents.clear
  44.         self.contents.font.color = normal_color
  45.         self.contents.font.size = 20
  46.         self.contents.draw_text(4, 0, self.width - 40, 32, data, align)
  47.         @text = data
  48.         @align = align
  49.         @actor = nil
  50.         self.visible = true
  51.       end
  52.     end
  53.     return if data.is_a?(String)
  54.     #------------------------------------------------------------------------
  55.     # ● 當沒有資料時候
  56.     #------------------------------------------------------------------------
  57.     if data.nil?
  58.       self.visible=false
  59.     else
  60.       self.visible=true
  61.     end
  62.     #------------------------------------------------------------------------
  63.     # ● 當資料爲物品/技能時候
  64.     #------------------------------------------------------------------------
  65.     if data != nil && @data != data
  66.       self.width = 210
  67.       self.height = 430
  68.       self.x=0
  69.       self.y=200
  70.       unshown
  71.       non_auto_update(data)
  72.     else
  73.       return
  74.     end
  75.   end
  76.   #--------------------------------------------------------------------------
  77.   # ● 更新帮助窗口
  78.   #--------------------------------------------------------------------------
  79.   def non_auto_update(data=@data)
  80.     @data = data
  81.     case @data
  82.     when RPG::Item
  83.       set_item_text(@data)
  84.     when RPG::Weapon
  85.       set_equipment_text(@data)
  86.     when RPG::Armor
  87.       set_equipment_text(@data)
  88.     end
  89.   end
  90.   #--------------------------------------------------------------------------
  91.   # ● 裝備帮助窗口
  92.   #--------------------------------------------------------------------------
  93.   def set_equipment_text(equipment)
  94.     #------------------------------------------------------------------------
  95.     # ● 取得基本質料
  96.     #------------------------------------------------------------------------
  97.     # 取得屬性、附加狀態、解除狀態之副本
  98.     case equipment
  99.     when RPG::Weapon
  100.       element_set = equipment.element_set.clone
  101.       plus_state_set = equipment.plus_state_set.clone
  102.       minus_state_set = equipment.minus_state_set.clone
  103.       #----------------------#
  104.       # 過濾不顯示的狀態描述 #
  105.       #----------------------#
  106.       plus_state_set -= @unshow_states
  107.       minus_state_set -= @unshow_states
  108.     when RPG::Armor
  109.       element_set = equipment.guard_element_set.clone
  110.       guard_state_set = equipment.guard_state_set.clone
  111.       #----------------------#
  112.       # 過濾不顯示的狀態描述 #
  113.       #----------------------#
  114.       auto_state_id = equipment.auto_state_id
  115.       guard_state_set -= @unshow_states
  116.     end
  117.     #----------------------#
  118.     # 過濾不顯示的屬性描述 #
  119.     #----------------------#
  120.     element_set -= @unshow_elements
  121.     #--------------#
  122.     # 取得說明文字 #
  123.     #--------------#
  124.     description = equipment.description.clone
  125.     # 初始化數據設定
  126.     x = 0
  127.     y = 0
  128.     h = 0
  129.     phrase = {}
  130.    
  131.     # 基本文字設定
  132.     phrase["price"] = "价格:"
  133.     phrase["elements"] = "属性:"
  134.     phrase["minus_states"] = "解除状态:"
  135.     phrase["plus_states"] = "附加状态:"
  136.     phrase["guard_elements"] = "防御属性"
  137.     phrase["guard_states"] = "防御状态"
  138.     phrase["auto_state"] = "附加:"
  139.     phrase["hp-max"] = "HP MAX:"

  140.     # 基本數據設定
  141. =begin
  142.     name_size = 名字文字大小
  143.     size = 描述文字大小
  144.     word = 每行的描述文字數
  145.     move = 全體描述偏移幅度
  146. =end
  147.     name_size = 18
  148.     size = 14
  149.     word = 12
  150.     move = 80
  151.     #------------------------------------------------------------------------
  152.     # ● 確定背景圖片的高度
  153.     #------------------------------------------------------------------------
  154.     h += (description.size/3/word)
  155.     h += 1 if (description.size/3%word) > 0
  156.     h += 1 if equipment.is_a?(RPG::Weapon)
  157.     now_h = h
  158.     h += 1
  159.     h += 1 unless equipment.pdef.zero?
  160.     h += 1 unless equipment.mdef.zero?
  161.     h += 1 if element_set.size > 0
  162.     h += 1 if element_set.size >= 5
  163.     case equipment
  164.     when RPG::Weapon
  165.       h += 1 unless minus_state_set.empty?
  166.       h += minus_state_set.size
  167.       h += 1 unless plus_state_set.empty?
  168.       h += plus_state_set.size
  169.     when RPG::Armor
  170.       h += 1 unless guard_state_set.empty?
  171.       h += guard_state_set.size
  172.       h += 1 unless auto_state_id.zero?
  173.     end
  174.     h += 1
  175.     h += 1 unless equipment.str_plus.zero?
  176.     h += 1 unless equipment.dex_plus.zero?
  177.     h += 1 unless equipment.agi_plus.zero?
  178.     h += 1 unless equipment.int_plus.zero?
  179.     #h += 1 unless equipment.hp_plus.zero?
  180.     h += materia_height_plus(equipment) unless self.materia.nil?
  181.     #------------------------------------------------------------------------
  182.     # ● 圖片顯示保證高度
  183.     #------------------------------------------------------------------------
  184.     h = 6 + now_h if (h - now_h) < 6
  185.     #------------------------------------------------------------------------
  186.     # ● 換算高度
  187.     #------------------------------------------------------------------------
  188.     self.height = h * size + name_size + 32
  189.     #------------------------------------------------------------------------
  190.     # ● 生成背景
  191.     #------------------------------------------------------------------------
  192.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  193.     self.contents.clear
  194.     #------------------------------------------------------------------------
  195.     # ● 名字描繪
  196.     #------------------------------------------------------------------------
  197.     text = equipment.name
  198.     self.contents.font.color = text_color(1)#(equipment.name_color)
  199.     self.contents.font.size = name_size
  200.     if text.nil?
  201.       self.visible = false
  202.     else
  203.       self.visible = true
  204.       self.contents.draw_text(0, 0, text.size*7, name_size, text, 0)
  205.     end
  206.     #------------------------------------------------------------------------
  207.     # ● 說明描繪
  208.     #------------------------------------------------------------------------
  209.     x = 0
  210.     y += 1
  211.     while ((text = description.slice!(/./m)) != nil)
  212.       self.contents.font.color = system_color
  213.       self.contents.font.size = size
  214.       self.contents.draw_text(x*size, y*size+5, size, size, text, 0)
  215.       x+=1
  216.       if x == word
  217.         x=0
  218.         y+=1   
  219.       end
  220.     end
  221.     #------------------------------------------------------------------------
  222.     # ● 圖標描繪
  223.     #------------------------------------------------------------------------
  224.     bitmap = RPG::Cache.icon(equipment.icon_name)
  225.     opacity = self.contents.font.color == normal_color ? 255 : 128
  226.     self.contents.blt(0 ,y*size + 20, bitmap, Rect.new(0, 0, 95, 100), 225)
  227.     #------------------------------------------------------------------------
  228.     # ● 攻擊力描繪(武器)
  229.     #------------------------------------------------------------------------
  230.     if equipment.is_a?(RPG::Weapon)
  231.       x = 0
  232.       y += 1
  233.       text = $data_system.words.atk+":"+equipment.atk.to_s
  234.       self.contents.font.color = Color.new(255, 0, 0, 255)
  235.       self.contents.font.size = size
  236.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  237.     end
  238.     #------------------------------------------------------------------------
  239.     # ● 價格描繪
  240.     #------------------------------------------------------------------------
  241.     x = 0
  242.     y += 1
  243.     text = phrase["price"] + equipment.price.to_s
  244.     self.contents.font.color = Color.new(255, 255, 0, 255)
  245.     self.contents.font.size = size
  246.     self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  247.     #------------------------------------------------------------------------
  248.     # ● 物理防禦
  249.     #------------------------------------------------------------------------
  250.     unless equipment.pdef.zero?
  251.       x = 0
  252.       y += 1
  253.       text = $data_system.words.pdef+":"+equipment.pdef.to_s
  254.       self.contents.font.color = Color.new(0, 255, 255, 255)
  255.       self.contents.font.size = size
  256.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  257.     end
  258.     #------------------------------------------------------------------------
  259.     # ● 魔法防禦
  260.     #------------------------------------------------------------------------
  261.     unless equipment.mdef.zero?
  262.       x = 0
  263.       y += 1
  264.       text=$data_system.words.mdef+":"+equipment.mdef.to_s
  265.       self.contents.font.color = Color.new(255, 0, 255, 255)
  266.       self.contents.font.size = size
  267.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  268.     end
  269.     #------------------------------------------------------------------------
  270.     # ● 屬性
  271.     #------------------------------------------------------------------------
  272.     if element_set.size > 0
  273.       x = 0
  274.       y += 1
  275.       text = phrase["elements"]
  276.       for i in 0...element_set.size
  277.         break if i > 4
  278.         text += $data_system.elements[element_set[i]]
  279.       end
  280.       self.contents.font.color = Color.new(0, 255, 0, 255)
  281.       self.contents.font.size = size
  282.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  283.     end
  284.     if element_set.size >= 5
  285.       x = (phrase["elements"].size)*5-4
  286.       y += 1
  287.       text = ""
  288.       for i in 4...element_set.size
  289.         text += $data_system.elements[element_set[i]]
  290.       end
  291.       self.contents.font.color = Color.new(0, 255, 0, 255)
  292.       self.contents.font.size = size
  293.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  294.     end
  295.     #------------------------------------------------------------------------
  296.     # ● 描述分流 武器/防具
  297.     #------------------------------------------------------------------------
  298.     case equipment
  299.     when RPG::Weapon
  300.       #------------------------------------------------------------------------
  301.       # ● 解除狀態(武器)
  302.       #------------------------------------------------------------------------
  303.       unless minus_state_set.empty?
  304.         x = 0
  305.         y += 1
  306.         text=phrase["minus_states"]
  307.         text=phrase["guard_states"]
  308.         self.contents.font.color = Color.new(0, 255, 255, 255)
  309.         self.contents.font.size = size
  310.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  311.         for i in 0...minus_state_set.size
  312.           y += 1
  313.           text = $data_states[minus_state_set[i]].name        
  314.           self.contents.font.color = Color.new(0, 255, 255, 255)
  315.           self.contents.font.size = size
  316.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  317.         end
  318.       end
  319.       #------------------------------------------------------------------------
  320.       # ● 附加狀態(武器)
  321.       #------------------------------------------------------------------------
  322.       unless plus_state_set.empty?
  323.         x = 0
  324.         y += 1
  325.         text = phrase["plus_states"]
  326.         self.contents.font.color = Color.new(255, 0, 0, 255)
  327.         self.contents.font.size = size
  328.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  329.         for i in 0...plus_state_set.size
  330.           y += 1
  331.           text=$data_states[plus_state_set[i]].name        
  332.           self.contents.font.color = Color.new(255, 0, 0, 255)
  333.           self.contents.font.size = size
  334.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  335.         end  
  336.       end
  337.     when RPG::Armor
  338.       #------------------------------------------------------------------------
  339.       # ● 防禦狀態(防具)
  340.       #------------------------------------------------------------------------
  341.       unless guard_state_set.empty?
  342.         x = 0
  343.         y += 1
  344.         text=phrase["guard_states"]
  345.         self.contents.font.color = Color.new(0, 255, 0, 255)
  346.         self.contents.font.size = size
  347.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  348.         for i in 0...guard_state_set.size
  349.           y += 1
  350.           text = $data_states[guard_state_set[i]].name        
  351.           self.contents.font.color = Color.new(0, 255, 0, 255)
  352.           self.contents.font.size = size
  353.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  354.         end
  355.       end
  356.       #------------------------------------------------------------------------
  357.       # ● 自動狀態(防具)
  358.       #------------------------------------------------------------------------
  359.       unless auto_state_id.zero?
  360.         x = 0
  361.         y += 1
  362.         text = phrase["auto_state"] + $data_states[auto_state_id].name
  363.         self.contents.font.color = Color.new(0, 255, 0, 255)
  364.         self.contents.font.size = size
  365.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  366.       end
  367.     end
  368.     #------------------------------------------------------------------------
  369.     # ● 空行
  370.     #------------------------------------------------------------------------
  371.     y+=1
  372.     #------------------------------------------------------------------------
  373.     # ● 力量
  374.     #------------------------------------------------------------------------
  375.     unless equipment.str_plus.zero?
  376.       x = 0
  377.       y += 1
  378.       h += 1
  379.       if equipment.str_plus > 0
  380.         text=$data_system.words.str+" +"+ equipment.str_plus.to_s
  381.       else
  382.         text=$data_system.words.str+" -"+ (-equipment.str_plus).to_s
  383.       end
  384.       self.contents.font.color = Color.new(255, 0, 0, 255)
  385.       self.contents.font.size = size
  386.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)  
  387.     end
  388.     #------------------------------------------------------------------------
  389.     # ● 靈巧
  390.     #------------------------------------------------------------------------
  391.     unless equipment.dex_plus.zero?
  392.       x = 0
  393.       y += 1
  394.       h += 1
  395.       if equipment.dex_plus > 0
  396.         text=$data_system.words.dex+" +"+ equipment.dex_plus.to_s
  397.       else
  398.         text=$data_system.words.dex+" -"+ (-equipment.dex_plus).to_s
  399.       end
  400.       self.contents.font.color = Color.new(255, 255, 0, 255)
  401.       self.contents.font.size = size
  402.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  403.     end
  404.     #------------------------------------------------------------------------
  405.     # ● 速度
  406.     #------------------------------------------------------------------------
  407.     unless equipment.agi_plus.zero?
  408.       x = 0
  409.       y += 1
  410.       h += 1
  411.       if equipment.agi_plus > 0
  412.         text=$data_system.words.agi+" +"+ equipment.agi_plus.to_s
  413.       else
  414.         text=$data_system.words.agi+" -"+ (-equipment.agi_plus).to_s
  415.       end
  416.       self.contents.font.color = Color.new(0, 255, 255, 255)
  417.       self.contents.font.size = size
  418.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  419.     end
  420.     #------------------------------------------------------------------------
  421.     # ● 智力
  422.     #------------------------------------------------------------------------
  423.     unless equipment.int_plus.zero?
  424.       x = 0
  425.       y += 1
  426.       h += 1
  427.       if equipment.int_plus > 0
  428.         text=$data_system.words.int+" +"+ equipment.int_plus.to_s
  429.       else
  430.         text=$data_system.words.int+" -"+ (-equipment.int_plus).to_s
  431.       end
  432.       self.contents.font.color = Color.new(255, 0, 255, 255)
  433.       self.contents.font.size = size
  434.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  435.     end
  436.     #------------------------------------------------------------------------
  437.     # ● HP MAX增加值
  438.     #------------------------------------------------------------------------
  439.     #unless equipment.hp_plus.zero?
  440.     #  x = 0
  441.     #  y += 1
  442.     #  h += 1
  443.     #  if equipment.hp_plus > 0
  444.     #    text=phrase["hp-max"]+" +"+ equipment.hp_plus.to_s
  445.     #  else
  446.     #    text=phrase["hp-max"]+" -"+ (-equipment.hp_plus).to_s
  447.     #  end
  448.     #  self.contents.font.color = normal_color
  449.      # self.contents.font.size = size
  450.      # self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  451.     #end
  452.     #------------------------------------------------------------------------
  453.     # ● 魔力石描繪
  454.     #------------------------------------------------------------------------
  455.     y += draw_materia(equipment, move, y, size) unless self.materia.nil?
  456.   end
  457.   #--------------------------------------------------------------------------
  458.   # ● 物品幫助窗口
  459.   #--------------------------------------------------------------------------
  460.   def set_item_text(item)
  461.     # 取得描述
  462.     description = item.description.clone
  463.     # 取得屬性、附加狀態、解除狀態之副本
  464.     element_set = item.element_set.clone
  465.     plus_state_set = item.plus_state_set.clone
  466.     minus_state_set = item.minus_state_set.clone
  467.     # 過濾不顯示的描述
  468.     element_set -= @unshow_elements
  469.     plus_state_set -= @unshow_states
  470.     minus_state_set -= @unshow_states
  471.     # 初始化數據設定
  472.     x = 0
  473.     y = 0
  474.     h = 0
  475.     phrase = {}
  476.     scope ={}
  477.     parameter_type = {}
  478.    
  479.     # 基本數據設定
  480. =begin
  481.     name_size = 名字文字大小
  482.     size = 描述文字大小
  483.     word = 每行的描述文字數
  484.     move = 全體描述偏移幅度
  485. =end
  486.     name_size = 18
  487.     size = 14
  488.     word = 12
  489.     move = 80
  490.    
  491.     # 基本文字設定
  492.     phrase["scope"] = "范围:"
  493.     phrase["price"] = "价格:"
  494.     phrase["recover_hp_rate"] = "HP 回复率:"
  495.     phrase["recover_hp"] = "HP 回复:"
  496.     phrase["recover_sp_rate"] = "SP 回复率:"
  497.     phrase["recover_sp"] = "SP 回复:"
  498.     phrase["elements"] = "属性:"
  499.     phrase["plus"] = "附加"
  500.     phrase["minus"] = "解除"
  501.     phrase["states"] = "状态"
  502.     scope[0] = "特殊物品"
  503.     scope[1] = "敌单体"
  504.     scope[2] = "敌全体"
  505.     scope[3] = "己方单体"
  506.     scope[4] = "己方全体"
  507.     scope[5] = "己方单体(HP=0)"
  508.     scope[6] = "己方全体(HP=0)"
  509.     scope[7] = "使用者"
  510.     scope[8] = "使用者"

  511.     parameter_type[1] = "MaxHP"
  512.     parameter_type[2] = "MaxSP"
  513.     parameter_type[3] = $data_system.words.str
  514.     parameter_type[4] = $data_system.words.dex
  515.     parameter_type[5] = $data_system.words.agi
  516.     parameter_type[6] = $data_system.words.int
  517.    
  518.     #依顯示内容確定自身高
  519.     h = (description.size/3/word)
  520.     h +=1 if (description.size/3%word)> 0
  521.     now_h = h
  522.     h +=3  # 空行,效果範圍,價格
  523.     h += 1 unless item.recover_hp_rate.zero?
  524.     h += 1 unless item.recover_hp.zero?
  525.     h += 1 unless item.recover_sp_rate.zero?
  526.     h += 1 unless item.recover_sp.zero?
  527.     h += 1 unless item.parameter_type.zero?
  528.     h += 1 unless element_set[0].nil?
  529.     h += 1 unless element_set[4].nil?
  530.     h += (1+plus_state_set.size) unless plus_state_set.empty?
  531.     h += (1+minus_state_set.size) unless minus_state_set.empty?
  532.     #------------------------------------------------------------------------
  533.     # ● 圖片顯示保證高度
  534.     #------------------------------------------------------------------------
  535.     h = 6 + now_h if (h - now_h) < 6
  536.     #------------------------------------------------------------------------
  537.     # ● 換算高度
  538.     #------------------------------------------------------------------------
  539.     self.height = h * size + name_size + 32
  540.     #------------------------------------------------------------------------
  541.     # ● 生成背景
  542.     #------------------------------------------------------------------------
  543.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  544.     self.contents.clear
  545.     #------------------------------------------------------------------------
  546.     # ● 名字描繪
  547.     #------------------------------------------------------------------------
  548.     text = item.name
  549.     self.contents.font.color = Color.new(0, 0, 255, 255)
  550.     self.contents.font.size = name_size
  551.     if text.nil?
  552.       self.visible = false
  553.     else
  554.       self.visible = true
  555.       self.contents.draw_text(0,0, text.size*7, 20, text, 0)
  556.     end
  557.     #------------------------------------------------------------------------
  558.     # ● 說明描繪
  559.     #------------------------------------------------------------------------
  560.     x = 0
  561.     y += 1
  562.     while ((text = description.slice!(/./m)) != nil)
  563.       self.contents.font.color = system_color
  564.       self.contents.font.size = size
  565.       self.contents.draw_text(x*size, y*size+5, size, size, text, 0)
  566.       x+=1
  567.       if x == word
  568.         x = 0
  569.         y += 1
  570.       end
  571.     end
  572.     #------------------------------------------------------------------------
  573.     # ● 圖標描繪
  574.     #------------------------------------------------------------------------
  575.     bitmap = RPG::Cache.icon(item.icon_name) unless item.icon_name.nil?
  576.     opacity = self.contents.font.color == normal_color ? 255 : 128
  577.     self.contents.blt(0 ,y*size + 20, bitmap, Rect.new(0, 0, 95, 100), 225)
  578.     #------------------------------------------------------------------------
  579.     # ● 魔力石接口
  580.     #------------------------------------------------------------------------
  581.     unless self.materia.nil?
  582.       return if is_materia?(item)
  583.     end
  584.     #------------------------------------------------------------------------
  585.     # ● 效果範圍
  586.     #------------------------------------------------------------------------
  587.     text= phrase["scope"] + scope[item.scope]
  588.     x = 0
  589.     y += 1
  590.     self.contents.font.color = normal_color
  591.     self.contents.font.size = size
  592.     self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  593.     #------------------------------------------------------------------------
  594.     # ● 價格
  595.     #------------------------------------------------------------------------
  596.     x = 0
  597.     y += 1      
  598.     text = phrase["price"] + item.price.to_s
  599.     self.contents.font.color = Color.new(255, 255, 0, 255)
  600.     self.contents.font.size = size
  601.     self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  602.    
  603.     #------------------------------------------------------------------------
  604.     # ● HP回復率
  605.     #------------------------------------------------------------------------
  606.     unless item.recover_hp_rate.zero?  
  607.       x = 0
  608.       y += 1
  609.       text = phrase["recover_hp_rate"] + item.recover_hp_rate.to_s+"%"
  610.       self.contents.font.color = Color.new(255, 0, 0, 255)
  611.       self.contents.font.size = size
  612.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)   
  613.     end
  614.     #------------------------------------------------------------------------
  615.     # ● HP回復量
  616.     #------------------------------------------------------------------------
  617.     unless item.recover_hp.zero?  
  618.       x = 0
  619.       y += 1      
  620.       text = phrase["recover_hp"] + item.recover_hp.to_s
  621.       self.contents.font.color = Color.new(255, 0, 100, 255)
  622.       self.contents.font.size = size
  623.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  624.     end
  625.     #------------------------------------------------------------------------
  626.     # ● SP回復率
  627.     #------------------------------------------------------------------------
  628.     unless item.recover_sp_rate.zero?
  629.       x = 0
  630.       y += 1      
  631.       text = phrase["recover_sp_rate"] + item.recover_sp_rate.to_s+"%"
  632.       self.contents.font.color = Color.new(0, 0, 255, 255)
  633.       self.contents.font.size = size
  634.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  635.     end
  636.     #------------------------------------------------------------------------
  637.     # ● SP回復量
  638.     #------------------------------------------------------------------------
  639.     unless item.recover_sp.zero?  
  640.       x = 0
  641.       y += 1      
  642.       text = phrase["recover_sp"] + item.recover_sp.to_s
  643.       self.contents.font.color = Color.new(0, 100, 255, 255)
  644.       self.contents.font.size = size
  645.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  646.     end
  647.     #------------------------------------------------------------------------
  648.     # ● 能力值增加
  649.     #------------------------------------------------------------------------
  650.     unless item.parameter_type.zero?
  651.       x = 0
  652.       y += 1      
  653.       text= parameter_type[item.parameter_type]+" +"+item.parameter_points.to_s

  654.       self.contents.font.color = Color.new(0, 255, 0, 255)
  655.       self.contents.font.size = size
  656.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  657.     end
  658.     #------------------------------------------------------------------------
  659.     # ● 屬性
  660.     #------------------------------------------------------------------------
  661.     if element_set.size > 0
  662.       x = 0
  663.       y += 1
  664.       text = phrase["elements"]
  665.       for i in 0...element_set.size
  666.         break if i > 4
  667.         text += $data_system.elements[element_set[i]]
  668.       end
  669.       self.contents.font.color = Color.new(255, 0, 255, 255)
  670.       self.contents.font.size = size
  671.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  672.     end
  673.     if element_set.size >= 5
  674.       x = (phrase["elements"].size)*5-4
  675.       y += 1
  676.       text = ""
  677.       for i in 4...element_set.size
  678.         text += $data_system.elements[element_set[i]]
  679.       end
  680.       self.contents.font.color = Color.new(255, 0, 255, 255)
  681.       self.contents.font.size = size
  682.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  683.     end
  684.     #------------------------------------------------------------------------
  685.     # ● 狀態添加
  686.     #------------------------------------------------------------------------
  687.     unless plus_state_set.empty?
  688.       text = phrase["plus"]
  689.       x = 0
  690.       y += 1
  691.       self.contents.font.color = normal_color
  692.       self.contents.font.size = size
  693.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  694.       plus_state_set.each do |plus_state|
  695.         y += 1
  696.         text = $data_states[plus_state].name        
  697.         self.contents.font.color = Color.new(255, 100, 0, 255)
  698.         self.contents.font.size = size
  699.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)      
  700.       end  
  701.     end
  702.     #------------------------------------------------------------------------
  703.     # ● 狀態解除
  704.     #------------------------------------------------------------------------
  705.     unless minus_state_set.empty?
  706.       text = phrase["minus"]
  707.       x = 0
  708.       y += 1
  709.       self.contents.font.color = Color.new(100, 0, 200, 255)
  710.       self.contents.font.size = size
  711.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  712.       minus_state_set.each do |minus_state|
  713.         y += 1
  714.         text = $data_states[minus_state].name
  715.         self.contents.font.color = Color.new(100, 0, 200, 255)
  716.         self.contents.font.size = size
  717.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)   
  718.       end
  719.     end
  720.   end
  721.   #--------------------------------------------------------------------------
  722.   # ● 设置角色
  723.   #     actor : 要显示状态的角色
  724.   #--------------------------------------------------------------------------
  725.   def set_actor(actor)
  726.     if actor != @actor
  727.       self.contents.clear
  728.       draw_actor_name(actor, 4, 0)
  729.       draw_actor_state(actor, 140, 0)
  730.       draw_actor_hp(actor, 284, 0)
  731.       draw_actor_sp(actor, 460, 0)
  732.       @actor = actor
  733.       @text = nil
  734.       self.visible = true
  735.     end
  736.   end
  737.   #--------------------------------------------------------------------------
  738.   # ● 設置角色
  739.   #     actor : 要顯示狀態之角色
  740.   #--------------------------------------------------------------------------
  741.   def set_actor(actor)
  742.     self.contents = Bitmap.new(width - 32, height - 32) if self.contents.nil?
  743.     if actor != @actor
  744.       self.contents.clear
  745.       draw_actor_name(actor, 4, 0)
  746.       draw_actor_state(actor, 140, 0)
  747.       draw_actor_hp(actor, 284, 0)
  748.       draw_actor_sp(actor, 460, 0)
  749.       @actor = actor
  750.       @text = nil
  751.       self.visible = true
  752.     end
  753.   end
  754.   #--------------------------------------------------------------------------
  755.   # ● 設置敵人
  756.   #     enemy : 要顯示名字與狀態之敵人
  757.   #--------------------------------------------------------------------------
  758.   def set_enemy(enemy)
  759.     self.contents = Bitmap.new(width - 32, height - 32) if self.contents.nil?
  760.     text = enemy.name.sub(/\\[Ff]\[([0-9]+)\]/) {""}
  761.     state_text = make_battler_state_text(enemy, 112, false)
  762.     if state_text != ""
  763.       text += "  " + state_text
  764.     end
  765.     set_text(text, 1)
  766.     self.visible = true
  767.   end
  768.   #--------------------------------------------------------------------------
  769.   # ● 校正帮助窗口位置
  770.   #--------------------------------------------------------------------------
  771.   def set_pos(x,y,width,oy,index,column_max)
  772.     #光标坐标
  773.     cursor_width = width / column_max - 32
  774.     xx = index % column_max * (cursor_width + 32)
  775.     yy = index / column_max * 32 - oy
  776.     self.x=xx+x+150
  777.     self.y=yy+y+30
  778.     if self.x+self.width>640
  779.       self.x=640-self.width
  780.     end
  781.     if self.y+self.height>480
  782.       self.y=480-self.height
  783.     end  
  784.   end
  785.   #------------------------------------------------------------------------
  786.   # ● 裝備名字顔色變化 接口
  787.   #------------------------------------------------------------------------
  788.   def draw_name_color(equipment)
  789.     return normal_color
  790.   end
  791.   #------------------------------------------------------------------------
  792.   # ● 自身身份確認
  793.   #------------------------------------------------------------------------
  794.   def original_help?
  795.     return false
  796.   end
  797. end

  798. #------------------------------------------------------------------------------



  799. #------------------------------------------------------------------------------
  800. #==============================================================================
  801. # ■ Window_Item
  802. #------------------------------------------------------------------------------
  803. #  物品画面、战斗画面、显示浏览物品的窗口。
  804. #==============================================================================

  805. class Window_Item < Window_Selectable
  806.   #--------------------------------------------------------------------------
  807.   # ● 初始化对像
  808.   #--------------------------------------------------------------------------
  809.   def initialize
  810.     super(0, 0, 640, 480)
  811.     @column_max = 2
  812.     unless  $scene.is_a?Scene_Battle
  813.     self.opacity = 0#■■■透明
  814.     end
  815.     refresh
  816.     self.index = 0
  817.     # 战斗中的情况下将窗口移至中央并将其半透明化
  818.     if $game_temp.in_battle
  819.       self.y = 64
  820.       self.height = 256
  821.       self.back_opacity = 160
  822.     end
  823.   end
  824.   #--------------------------------------------------------------------------
  825.   # ● 刷新帮助文本
  826.   #--------------------------------------------------------------------------
  827.   def update_help
  828.     @help_window.set_text(item)
  829.     #校正帮助窗口位置
  830.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  831.   end
  832. end
  833. #==============================================================================
  834. # ■ Window_EquipLeft
  835. #------------------------------------------------------------------------------
  836. #  装备画面的、显示角色能力值变化的窗口。
  837. #==============================================================================
  838. class Window_EquipLeft < Window_Base
  839.   #--------------------------------------------------------------------------
  840.   # ● 初始化对像
  841.   #     actor : 角色
  842.   #--------------------------------------------------------------------------
  843.   def initialize(actor)
  844. # -------------------
  845. # 修改開始
  846.     super(0, 64-64, 272, 416+64)#★★★★★★★★★★★★★★★★★★★★
  847. # 修改終了
  848. # -------------------
  849.     self.contents = Bitmap.new(width - 32, height - 32)
  850.     @actor = actor
  851.     self.opacity = 0#■■■透明
  852.     refresh
  853.   end
  854. end
  855. #------------------------------------------------------------------------------



  856. #------------------------------------------------------------------------------
  857. #==============================================================================
  858. # ■ Window_EquipRight
  859. #------------------------------------------------------------------------------
  860. #  装备画面、显示角色现在装备的物品的窗口。
  861. #==============================================================================

  862. class Window_EquipRight < Window_Selectable
  863.   #--------------------------------------------------------------------------
  864.   # ● 初始化对像
  865.   #     actor : 角色
  866.   #--------------------------------------------------------------------------
  867.   def initialize(actor)
  868. # -------------------
  869. # 修改開始
  870.     super(272, 64-64, 368, 192)#★★★★★★★★★★★★★★★★★★★★
  871. # 修改終了
  872. # -------------------
  873.     self.contents = Bitmap.new(width - 32, height - 32)
  874.     @actor = actor
  875.     self.opacity = 0#■■■透明
  876.     refresh
  877.     self.index = 0
  878.   end
  879.   #--------------------------------------------------------------------------
  880.   # ● 刷新帮助文本
  881.   #--------------------------------------------------------------------------

  882.   def update_help
  883.     @help_window.set_text(item)
  884.     #校正帮助窗口位置
  885.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  886.   end
  887. end
  888. #------------------------------------------------------------------------------



  889. #------------------------------------------------------------------------------
  890. #==============================================================================
  891. # ■ Window_EquipItem
  892. #------------------------------------------------------------------------------
  893. #  装备画面、显示浏览变更装备的候补物品的窗口。
  894. #==============================================================================

  895. class Window_EquipItem < Window_Selectable
  896.   #--------------------------------------------------------------------------
  897.   # ● 初始化对像
  898.   #     actor      : 角色
  899.   #     equip_type : 装备部位 (0~3)
  900.   #--------------------------------------------------------------------------
  901.   def initialize(actor, equip_type)
  902. # -------------------
  903. # 修改開始
  904.     super(272, 320, 368, 160)#★★★★★★★★★★★★★★★★★★★★
  905. # 修改終了
  906. # -------------------
  907.     @actor = actor
  908.     @equip_type = equip_type
  909.     @column_max = 1
  910.     self.opacity = 0#■■■透明
  911.     refresh
  912.     self.active = false
  913.     self.index = -1
  914.   end
  915.   def update_help
  916.     @help_window.set_text(item)
  917.     #校正帮助窗口位置
  918.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  919.   end
  920. end
  921. #------------------------------------------------------------------------------



  922. #------------------------------------------------------------------------------
  923. #==============================================================================
  924. # ■ Window_ShopCommand
  925. #------------------------------------------------------------------------------
  926. #  商店画面、选择要做的事的窗口
  927. #==============================================================================

  928. class Window_ShopCommand < Window_Selectable
  929.   #--------------------------------------------------------------------------
  930.   # ● 初始化对像
  931.   #--------------------------------------------------------------------------
  932.   def initialize
  933. # -------------------
  934. # 修改開始
  935.     super(0, 64-64, 480, 64)#★★★★★★★★★★★★★★★★★
  936. # 修改終了
  937. # -------------------
  938.     self.contents = Bitmap.new(width - 32, height - 32)
  939.     @item_max = 3
  940.     @column_max = 3
  941.     @commands = ["买", "卖", "取消"]
  942.     refresh
  943.     self.index = 0
  944.   end
  945. end
  946. #------------------------------------------------------------------------------



  947. #------------------------------------------------------------------------------
  948. #========================================================================================================================
  949. # ■ Window_ShopBuy
  950. #------------------------------------------------------------------------------
  951. #  商店画面、浏览显示可以购买的商品的窗口。
  952. #==============================================================================

  953. class Window_ShopBuy < Window_Selectable
  954.   #--------------------------------------------------------------------------
  955.   # ● 初始化对像
  956.   #     shop_goods : 商品
  957.   #--------------------------------------------------------------------------
  958.   def initialize(shop_goods)
  959. # -------------------
  960. # 修改開始
  961.     super(0, 128-64, 368, 352+64)#★★★★★★★★★★★★★★★★
  962. # 修改終了
  963. # -------------------
  964.     @shop_goods = shop_goods
  965.     refresh
  966.     self.index = 0
  967.   end
  968.   #--------------------------------------------------------------------------
  969.   # ● 刷新帮助文本
  970.   #--------------------------------------------------------------------------

  971.   def update_help
  972.     @help_window.set_text(item)
  973.     #校正帮助窗口位置
  974.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  975.   end
  976. end
  977. #------------------------------------------------------------------------------



  978. #------------------------------------------------------------------------------
  979. #==============================================================================
  980. # ■ Window_ShopSell
  981. #------------------------------------------------------------------------------
  982. #  商店画面、浏览显示可以卖掉的商品的窗口。
  983. #==============================================================================

  984. class Window_ShopSell < Window_Selectable
  985.   #--------------------------------------------------------------------------
  986.   # ● 初始化对像
  987.   #--------------------------------------------------------------------------
  988.   def initialize
  989. # -------------------
  990. # 修改開始
  991.     super(0, 128-64, 640, 352+64)#★★★★★★★★★★★★★★★★
  992. # 修改終了
  993. # -------------------
  994.     @column_max = 2
  995.     refresh
  996.     self.index = 0
  997.   end
  998.   #--------------------------------------------------------------------------
  999.   # ● 刷新帮助文本
  1000.   #--------------------------------------------------------------------------

  1001.   def update_help
  1002.     @help_window.set_text(item)
  1003.     #校正帮助窗口位置
  1004.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  1005.   end
  1006. end
  1007. #------------------------------------------------------------------------------



  1008. #------------------------------------------------------------------------------
  1009. #==============================================================================
  1010. # ■ Window_ShopNumber
  1011. #------------------------------------------------------------------------------
  1012. #  商店画面、输入买卖数量的窗口。
  1013. #==============================================================================
  1014. class Window_ShopNumber < Window_Base
  1015.   #--------------------------------------------------------------------------
  1016.   # ● 初始化对像
  1017.   #--------------------------------------------------------------------------
  1018.   def initialize
  1019. # -------------------
  1020. # 修改開始
  1021.     super(0, 128-64, 368, 352+64)#★★★★★★★★★★★★★★★★
  1022. # 修改終了
  1023. # -------------------
  1024.     self.contents = Bitmap.new(width - 32, height - 32)
  1025.     @item = nil
  1026.     @max = 1
  1027.     @price = 0
  1028.     @number = 1
  1029.   end
  1030. end
  1031. #------------------------------------------------------------------------------



  1032. #------------------------------------------------------------------------------
  1033. #==============================================================================
  1034. # ■ Window_ShopStatus
  1035. #------------------------------------------------------------------------------
  1036. #  商店画面、显示物品所持数与角色装备的窗口。
  1037. #==============================================================================

  1038. class Window_ShopStatus < Window_Base
  1039.   #--------------------------------------------------------------------------
  1040.   # ● 初始化对像
  1041.   #--------------------------------------------------------------------------
  1042.   def initialize
  1043. # -------------------
  1044. # 修改開始
  1045.     super(368, 128-64, 272, 352+64)#★★★★★★★★★★★★
  1046. # 修改終了
  1047. # -------------------
  1048.     self.contents = Bitmap.new(width - 32, height - 32)
  1049.     @item = nil
  1050.     refresh
  1051.   end
  1052. end
  1053. #------------------------------------------------------------------------------



  1054. #------------------------------------------------------------------------------
  1055. #==============================================================================
  1056. # ■ Scene_Equip
  1057. #------------------------------------------------------------------------------
  1058. #  处理装备画面的类。
  1059. #==============================================================================

  1060. class Scene_Equip
  1061.   #--------------------------------------------------------------------------
  1062.   # ● 刷新画面 (右侧窗口被激活的情况下)
  1063.   #--------------------------------------------------------------------------
  1064.   def update_right
  1065. # -------------------
  1066. # 修改開始
  1067.     if @right_window.item==nil
  1068.         @help_window.visible=false
  1069.     else
  1070.         @help_window.visible=true
  1071.     end
  1072. # 修改終了
  1073. # -------------------
  1074.     # 按下 B 键的情况下
  1075.     if Input.trigger?(Input::B)
  1076.       # 演奏取消 SE
  1077.       $game_system.se_play($data_system.cancel_se)
  1078.       # 切换到菜单画面
  1079.       $scene = Scene_Menu.new(2)
  1080.       return
  1081.     end
  1082.     # 按下 C 键的情况下
  1083.     if Input.trigger?(Input::C)
  1084.       # 固定装备的情况下
  1085.       if @actor.equip_fix?(@right_window.index)
  1086.         # 演奏冻结 SE
  1087.         $game_system.se_play($data_system.buzzer_se)
  1088.         return
  1089.       end
  1090.       # 演奏确定 SE
  1091.       $game_system.se_play($data_system.decision_se)
  1092.       # 激活物品窗口
  1093.       @right_window.active = false
  1094.       @item_window.active = true
  1095.       @item_window.index = 0
  1096.       return
  1097.     end
  1098.     # 按下 R 键的情况下
  1099.     if Input.trigger?(Input::R)
  1100.       # 演奏光标 SE
  1101.       $game_system.se_play($data_system.cursor_se)
  1102.       # 移至下一位角色
  1103.       @actor_index += 1
  1104.       @actor_index %= $game_party.actors.size
  1105.       # 切换到别的装备画面
  1106.       $scene = Scene_Equip.new(@actor_index, @right_window.index)
  1107.       return
  1108.     end
  1109.     # 按下 L 键的情况下
  1110.     if Input.trigger?(Input::L)
  1111.       # 演奏光标 SE
  1112.       $game_system.se_play($data_system.cursor_se)
  1113.       # 移至上一位角色
  1114.       @actor_index += $game_party.actors.size - 1
  1115.       @actor_index %= $game_party.actors.size
  1116.       # 切换到别的装备画面
  1117.       $scene = Scene_Equip.new(@actor_index, @right_window.index)
  1118.       return
  1119.     end
  1120.   end
  1121.   #--------------------------------------------------------------------------
  1122.   # ● 刷新画面 (物品窗口被激活的情况下)
  1123.   #--------------------------------------------------------------------------
  1124.   def update_item
  1125. # -------------------
  1126. # 修改開始
  1127.     if @item_window.item==nil
  1128.         @help_window.visible=false
  1129.     else
  1130.         @help_window.visible=true
  1131.     end
  1132. # 修改終了
  1133. # -------------------
  1134.     # 按下 B 键的情况下
  1135.     if Input.trigger?(Input::B)
  1136.       # 演奏取消 SE
  1137.       $game_system.se_play($data_system.cancel_se)
  1138.       # 激活右侧窗口
  1139.       @right_window.active = true
  1140.       @item_window.active = false
  1141.       @item_window.index = -1
  1142.       return
  1143.     end
  1144.     # 按下 C 键的情况下
  1145.     if Input.trigger?(Input::C)
  1146.       # 演奏装备 SE
  1147.       $game_system.se_play($data_system.equip_se)
  1148.       # 获取物品窗口现在选择的装备数据
  1149.       item = @item_window.item
  1150.       # 变更装备
  1151.       @actor.equip(@right_window.index, item == nil ? 0 : item.id)
  1152.       # 激活右侧窗口
  1153.       @right_window.active = true
  1154.       @item_window.active = false
  1155.       @item_window.index = -1
  1156.       # 再生成右侧窗口、物品窗口的内容
  1157.       @right_window.refresh
  1158.       @item_window.refresh
  1159.       @sprite.bitmap.clear
  1160.       @sprite.bitmap.draw_actor_element_radar_graph(@actor,16,255+16)
  1161.       return
  1162.     end
  1163.   end
  1164. end
  1165. #------------------------------------------------------------------------------



  1166. #------------------------------------------------------------------------------
  1167. #========================================================================================================================
  1168. # ■ Scene_Battle (分割定义 3)
  1169. #------------------------------------------------------------------------------
  1170. #  处理战斗画面的类。
  1171. #========================================================================================================================

  1172. class Scene_Battle
  1173.   #--------------------------------------------------------------------------
  1174.   # ● 刷新画面 (角色命令回合 : 选择物品)
  1175.   #--------------------------------------------------------------------------
  1176.   alias first_reupdate_phase3_item_select update_phase3_item_select  
  1177.   def update_phase3_item_select
  1178. # -------------------
  1179. # 修改開始
  1180.     @item_window.help_window.visible = false#★★★★★★★★★★★★
  1181. # 修改終了
  1182. # -------------------
  1183.     first_reupdate_phase3_item_select
  1184.   end
  1185.   #--------------------------------------------------------------------------
  1186.   # ● 开始选择物品
  1187.   #--------------------------------------------------------------------------
  1188.   def start_item_select
  1189.     # 生成物品窗口
  1190.     @item_window = Window_Item.new
  1191.     # 关联帮助窗口
  1192. # -------------------
  1193. # 修改開始
  1194.     @item_window.help_window =  Window_Help.new#★★★★★★★★★★★★
  1195. # 修改終了
  1196. # -------------------
  1197.     # 无效化角色指令窗口
  1198.     @actor_command_window.active = false
  1199.     @actor_command_window.visible = false
  1200.   end
  1201.   #--------------------------------------------------------------------------
  1202.   # ● 结束选择物品
  1203.   #--------------------------------------------------------------------------
  1204.   alias first_update_end_item_select end_item_select
  1205.   def end_item_select
  1206. # -------------------
  1207. # 修改開始
  1208.     @item_window.help_window.visible = false#★★★★★★★★★★★★
  1209. # 修改終了
  1210. # -------------------
  1211.     first_update_end_item_select
  1212.   end
  1213. end
  1214. #------------------------------------------------------------------------------



  1215. #------------------------------------------------------------------------------
  1216. #==============================================================================
  1217. # ■ Scene_Shop
  1218. #------------------------------------------------------------------------------
  1219. #  处理商店画面的类。
  1220. #==============================================================================

  1221. class Scene_Shop
  1222.   #--------------------------------------------------------------------------
  1223.   # ● 主处理
  1224.   #--------------------------------------------------------------------------
  1225. # --------------------
  1226. # 衝突可能
  1227.   def main

  1228.     # 生成帮助窗口
  1229. # -------------------
  1230. # 修改開始
  1231.     @help_window = Window_Help.new#★★★★★★★★★★★★★★★★
  1232. # 修改終了
  1233. # -------------------
  1234.     # 生成指令窗口
  1235.     @command_window = Window_ShopCommand.new
  1236.         # 生成金钱窗口
  1237.     @gold_window = Window_Gold.new
  1238.     @gold_window.x = 480
  1239.     @gold_window.y = 0

  1240. # -------------------
  1241. # 修改終了
  1242. # -------------------
  1243.     # 生成时间窗口
  1244. # -------------------
  1245. # 修改開始
  1246.     @dummy_window = Window_Base.new(0, 128-64, 640, 352+64)#★★★★★★★★★★★★★
  1247. # 修改終了
  1248. # -------------------

  1249.     # 生成购买窗口

  1250.     @buy_window = Window_ShopBuy.new($game_temp.shop_goods)
  1251.     @buy_window.active = false
  1252.     @buy_window.visible = false
  1253.     @buy_window.help_window = @help_window

  1254.     # 生成卖出窗口
  1255.     @sell_window = Window_ShopSell.new
  1256.     @sell_window.active = false
  1257.     @sell_window.visible = false
  1258.     @sell_window.help_window = @help_window
  1259.     # 生成数量输入窗口
  1260.     @number_window = Window_ShopNumber.new
  1261.     @number_window.active = false
  1262.     @number_window.visible = false
  1263.     # 生成状态窗口
  1264.     @status_window = Window_ShopStatus.new
  1265.     @status_window.visible = false
  1266.     # 执行过渡
  1267.     Graphics.transition
  1268.     # 主循环
  1269.     loop do
  1270.       # 刷新游戏画面
  1271.       Graphics.update
  1272.       # 刷新输入信息
  1273.       Input.update
  1274.       # 刷新画面
  1275.       update
  1276.       # 如果画面切换的话就中断循环
  1277.       if $scene != self
  1278.         break
  1279.       end
  1280.     end
  1281.     # 准备过渡
  1282.     Graphics.freeze
  1283.     # 释放窗口

  1284.     @help_window.dispose
  1285.     @command_window.dispose
  1286.     @gold_window.dispose
  1287.     @dummy_window.dispose
  1288.     @buy_window.dispose
  1289.     @sell_window.dispose
  1290.     @number_window.dispose
  1291.     @status_window.dispose
  1292.   end
  1293.   #--------------------------------------------------------------------------
  1294.   # ● 刷新画面
  1295.   #--------------------------------------------------------------------------
  1296. # --------------------
  1297. # 衝突可能
  1298.   def update
  1299.     # 刷新窗口
  1300.     @help_window.update
  1301.     @command_window.update
  1302.     @gold_window.update
  1303.     @dummy_window.update
  1304.     @buy_window.update
  1305.     @sell_window.update
  1306.     @number_window.update
  1307.     @status_window.update
  1308.     # 指令窗口激活的情况下: 调用 update_command
  1309.     if @command_window.active
  1310. # -------------------
  1311. # 修改開始
  1312.       @help_window.visible=false
  1313. # 修改終了
  1314. # -------------------
  1315.       update_command
  1316.       return
  1317.     end
  1318.     # 购买窗口激活的情况下: 调用 update_buy
  1319.     if @buy_window.active
  1320. # -------------------
  1321. # 修改開始
  1322.       @help_window.visible=true#★★★★★★★★★★★★★★★★
  1323.       if @buy_window.item==nil#★★★★★★★★★★★★★★★★
  1324.         @help_window.visible=false#★★★★★★★★★★★★★★★★
  1325.       end #★★★★★★★★★★★★★★★★     
  1326. # 修改終了
  1327. # -------------------
  1328.       update_buy
  1329.       return
  1330.     end
  1331.     # 卖出窗口激活的情况下: 调用 update_sell
  1332.     if @sell_window.active
  1333. # -------------------
  1334. # 修改開始
  1335.       @help_window.visible=true#★★★★★★★★★★★★★★★★
  1336.       if @sell_window.item==nil#★★★★★★★★★★★★★★★★
  1337.         @help_window.visible=false#★★★★★★★★★★★★★★★★
  1338.       end #★★★★★★★★★★★★★★★★
  1339. # 修改終了
  1340. # -------------------      
  1341.       update_sell
  1342.       return
  1343.     end
  1344.     # 个数输入窗口激活的情况下: 调用 update_number
  1345.     if @number_window.active
  1346. # -------------------
  1347. # 修改開始
  1348.       @help_window.visible=false#★★★★★★★★★★★★★★★★
  1349. # 修改終了
  1350. # -------------------
  1351.       update_number
  1352.       return
  1353.     end
  1354.   end
  1355. end
复制代码
回复

使用道具 举报

梦石
0
星屑
50
在线时间
19 小时
注册时间
2013-3-15
回帖
19
 楼主| 发表于 2014-11-19 14:23:25 | 显示全部楼层
yang1zhi 发表于 2014-11-19 12:15


  #--------------------------------------------------------------------------
  # ● バトル開始時のセットアップ
  #--------------------------------------------------------------------------
  def start_battle
    @height = 0
    @real_x = 0
    @real_y = 0
    @real_zoom = 1.0
    @battler_condition = ""
    @action = nil
    @battle_actions = []
    @battler_action = false
    @step = 0
    @anime_on = false
    @wait_count = 0
    @wait_count2 = 0
    @ox = 0
    @oy = 0
    @pattern = 0
    @pattern_log = true
    @pattern_freeze = false
    @condition_freeze = false
    @active = false
    @move_distance = nil
    @move_wait = 0
    @move_coordinates = [0,0,0,0]
    @flying_distance = nil
    @flying_wait = 0
    @flying_x = 0
    @flying_y = 0
    @flash_flag = {}
    self.flying_clear
  end
中   
您给的这两个放在一起后    全局行走图的   
@height = 0  
报错    求解  

点评

不可能,是不是你还放了其他脚本在里面。你放到干净的工程里试试看。还有脚本的上下排列顺序也会有关系。另外脚本发在论坛的时候要用<>括起来   发表于 2014-11-19 21:13
回复

使用道具 举报

梦石
0
星屑
9292
在线时间
2504 小时
注册时间
2011-5-20
回帖
14521

开拓者

发表于 2014-11-21 17:43:40 | 显示全部楼层
太长了而且没框脚本···这种情况你老老实实传工程不行吗···
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复

使用道具 举报

梦石
0
星屑
50
在线时间
19 小时
注册时间
2013-3-15
回帖
19
 楼主| 发表于 2014-11-23 15:17:34 | 显示全部楼层
chd114 发表于 2014-11-21 17:43
太长了而且没框脚本···这种情况你老老实实传工程不行吗···

.....怎么传啊...

点评

用[code][/code]框起来  发表于 2014-11-28 21:07
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部