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

Project1

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

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

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
19 小时
注册时间
2013-3-15
帖子
23
跳转到指定楼层
1
发表于 2014-11-19 05:04:23 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

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

如题:
RUBY 代码复制
  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.     # 基本數據設定
  140. =begin
  141.     name_size = 名字文字大小
  142.     size = 描述文字大小
  143.     word = 每行的描述文字數
  144.     move = 全體描述偏移幅度
  145. =end
  146.     name_size = 18
  147.     size = 14
  148.     word = 12
  149.     move = 80
  150.     #------------------------------------------------------------------------
  151.     # ● 確定背景圖片的高度
  152.     #------------------------------------------------------------------------
  153.     h += (description.size/3/word)
  154.     h += 1 if (description.size/3%word) > 0
  155.     h += 1 if equipment.is_a?(RPG::Weapon)
  156.     now_h = h
  157.     h += 1
  158.     h += 1 unless equipment.pdef.zero?
  159.     h += 1 unless equipment.mdef.zero?
  160.     h += 1 if element_set.size > 0
  161.     h += 1 if element_set.size >= 5
  162.     case equipment
  163.     when RPG::Weapon
  164.       h += 1 unless minus_state_set.empty?
  165.       h += minus_state_set.size
  166.       h += 1 unless plus_state_set.empty?
  167.       h += plus_state_set.size
  168.     when RPG::Armor
  169.       h += 1 unless guard_state_set.empty?
  170.       h += guard_state_set.size
  171.       h += 1 unless auto_state_id.zero?
  172.     end
  173.     h += 1
  174.     h += 1 unless equipment.str_plus.zero?
  175.     h += 1 unless equipment.dex_plus.zero?
  176.     h += 1 unless equipment.agi_plus.zero?
  177.     h += 1 unless equipment.int_plus.zero?
  178.     h += materia_height_plus(equipment) unless self.materia.nil?
  179.     #------------------------------------------------------------------------
  180.     # ● 圖片顯示保證高度
  181.     #------------------------------------------------------------------------
  182.     h = 6 + now_h if (h - now_h) < 6
  183.     #------------------------------------------------------------------------
  184.     # ● 換算高度
  185.     #------------------------------------------------------------------------
  186.     self.height = h * size + name_size + 32
  187.     #------------------------------------------------------------------------
  188.     # ● 生成背景
  189.     #------------------------------------------------------------------------
  190.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  191.     self.contents.clear
  192.     #------------------------------------------------------------------------
  193.     # ● 名字描繪
  194.     #------------------------------------------------------------------------
  195.     text = equipment.name
  196.     self.contents.font.color = draw_name_color(equipment)
  197.     self.contents.font.size = name_size
  198.     if text.nil?
  199.       self.visible = false
  200.     else
  201.       self.visible = true
  202.       self.contents.draw_text(0, 0, text.size*7, name_size, text, 0)
  203.     end
  204.     #------------------------------------------------------------------------
  205.     # ● 說明描繪
  206.     #------------------------------------------------------------------------
  207.     x = 0
  208.     y += 1
  209.     while ((text = description.slice!(/./m)) != nil)
  210.       self.contents.font.color = normal_color
  211.       self.contents.font.size = size
  212.       self.contents.draw_text(x*size, y*size+5, size, size, text, 0)
  213.       x+=1
  214.       if x == word
  215.         x=0
  216.         y+=1   
  217.       end
  218.     end
  219.     #------------------------------------------------------------------------
  220.     # ● 圖標描繪
  221.     #------------------------------------------------------------------------
  222.     bitmap = RPG::Cache.icon(equipment.icon_name)
  223.     opacity = self.contents.font.color == normal_color ? 255 : 128
  224.     self.contents.blt(0 ,y*size + 20, bitmap, Rect.new(0, 0, 95, 100), 225)
  225.  
  226.     #------------------------------------------------------------------------
  227.     # ● 攻擊力描繪(武器)
  228.     #------------------------------------------------------------------------
  229.     if equipment.is_a?(RPG::Weapon)
  230.       x = 0
  231.       y += 1
  232.       text = $data_system.words.atk+":"+equipment.atk.to_s
  233.       self.contents.font.color = normal_color
  234.       self.contents.font.size = size
  235.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  236.     end
  237.     #------------------------------------------------------------------------
  238.     # ● 價格描繪
  239.     #------------------------------------------------------------------------
  240.     x = 0
  241.     y += 1
  242.     text = phrase["price"] + equipment.price.to_s
  243.     self.contents.font.color = normal_color
  244.     self.contents.font.size = size
  245.     self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  246.     #------------------------------------------------------------------------
  247.     # ● 物理防禦
  248.     #------------------------------------------------------------------------
  249.     unless equipment.pdef.zero?
  250.       x = 0
  251.       y += 1
  252.       text = $data_system.words.pdef+":"+equipment.pdef.to_s
  253.       self.contents.font.color = normal_color
  254.       self.contents.font.size = size
  255.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  256.     end
  257.     #------------------------------------------------------------------------
  258.     # ● 魔法防禦
  259.     #------------------------------------------------------------------------
  260.     unless equipment.mdef.zero?
  261.       x = 0
  262.       y += 1
  263.       text=$data_system.words.mdef+":"+equipment.mdef.to_s
  264.       self.contents.font.color = normal_color
  265.       self.contents.font.size = size
  266.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  267.     end
  268.     #------------------------------------------------------------------------
  269.     # ● 屬性
  270.     #------------------------------------------------------------------------
  271.     if element_set.size > 0
  272.       x = 0
  273.       y += 1
  274.       text = phrase["elements"]
  275.       for i in 0...element_set.size
  276.         break if i > 4
  277.         text += $data_system.elements[element_set[i]]
  278.       end
  279.       self.contents.font.color = normal_color
  280.       self.contents.font.size = size
  281.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  282.     end
  283.     if element_set.size >= 5
  284.       x = (phrase["elements"].size)*5-4
  285.       y += 1
  286.       text = ""
  287.       for i in 4...element_set.size
  288.         text += $data_system.elements[element_set[i]]
  289.       end
  290.       self.contents.font.color = normal_color
  291.       self.contents.font.size = size
  292.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  293.     end
  294.     #------------------------------------------------------------------------
  295.     # ● 描述分流 武器/防具
  296.     #------------------------------------------------------------------------
  297.     case equipment
  298.     when RPG::Weapon
  299.       #------------------------------------------------------------------------
  300.       # ● 解除狀態(武器)
  301.       #------------------------------------------------------------------------
  302.       unless minus_state_set.empty?
  303.         x = 0
  304.         y += 1
  305.         text=phrase["minus_states"]
  306.         text=phrase["guard_states"]
  307.         self.contents.font.color = normal_color
  308.         self.contents.font.size = size
  309.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  310.         for i in 0...minus_state_set.size
  311.           y += 1
  312.           text = $data_states[minus_state_set[i]].name        
  313.           self.contents.font.color = normal_color
  314.           self.contents.font.size = size
  315.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  316.         end
  317.       end
  318.       #------------------------------------------------------------------------
  319.       # ● 附加狀態(武器)
  320.       #------------------------------------------------------------------------
  321.       unless plus_state_set.empty?
  322.         x = 0
  323.         y += 1
  324.         text = phrase["plus_states"]
  325.         self.contents.font.color = normal_color
  326.         self.contents.font.size = size
  327.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  328.         for i in 0...plus_state_set.size
  329.           y += 1
  330.           text=$data_states[plus_state_set[i]].name        
  331.           self.contents.font.color = normal_color
  332.           self.contents.font.size = size
  333.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  334.         end  
  335.       end
  336.     when RPG::Armor
  337.       #------------------------------------------------------------------------
  338.       # ● 防禦狀態(防具)
  339.       #------------------------------------------------------------------------
  340.       unless guard_state_set.empty?
  341.         x = 0
  342.         y += 1
  343.         text=phrase["guard_states"]
  344.         self.contents.font.color = normal_color
  345.         self.contents.font.size = size
  346.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  347.         for i in 0...guard_state_set.size
  348.           y += 1
  349.           text = $data_states[guard_state_set[i]].name        
  350.           self.contents.font.color = normal_color
  351.           self.contents.font.size = size
  352.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  353.         end
  354.       end
  355.       #------------------------------------------------------------------------
  356.       # ● 自動狀態(防具)
  357.       #------------------------------------------------------------------------
  358.       unless auto_state_id.zero?
  359.         x = 0
  360.         y += 1
  361.         text = phrase["auto_state"] + $data_states[auto_state_id].name
  362.         self.contents.font.color = normal_color
  363.         self.contents.font.size = size
  364.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  365.       end
  366.     end
  367.     #------------------------------------------------------------------------
  368.     # ● 空行
  369.     #------------------------------------------------------------------------
  370.     y+=1
  371.     #------------------------------------------------------------------------
  372.     # ● 力量
  373.     #------------------------------------------------------------------------
  374.     unless equipment.str_plus.zero?
  375.       x = 0
  376.       y += 1
  377.       h += 1
  378.       if equipment.str_plus > 0
  379.         text=$data_system.words.str+" +"+ equipment.str_plus.to_s
  380.       else
  381.         text=$data_system.words.str+" -"+ (-equipment.str_plus).to_s
  382.       end
  383.       self.contents.font.color = normal_color
  384.       self.contents.font.size = size
  385.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)  
  386.     end
  387.     #------------------------------------------------------------------------
  388.     # ● 靈巧
  389.     #------------------------------------------------------------------------
  390.     unless equipment.dex_plus.zero?
  391.       x = 0
  392.       y += 1
  393.       h += 1
  394.       if equipment.dex_plus > 0
  395.         text=$data_system.words.dex+" +"+ equipment.dex_plus.to_s
  396.       else
  397.         text=$data_system.words.dex+" -"+ (-equipment.dex_plus).to_s
  398.       end
  399.       self.contents.font.color = normal_color
  400.       self.contents.font.size = size
  401.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  402.     end
  403.     #------------------------------------------------------------------------
  404.     # ● 速度
  405.     #------------------------------------------------------------------------
  406.     unless equipment.agi_plus.zero?
  407.       x = 0
  408.       y += 1
  409.       h += 1
  410.       if equipment.agi_plus > 0
  411.         text=$data_system.words.agi+" +"+ equipment.agi_plus.to_s
  412.       else
  413.         text=$data_system.words.agi+" -"+ (-equipment.agi_plus).to_s
  414.       end
  415.       self.contents.font.color = normal_color
  416.       self.contents.font.size = size
  417.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  418.     end
  419.     #------------------------------------------------------------------------
  420.     # ● 智力
  421.     #------------------------------------------------------------------------
  422.     unless equipment.int_plus.zero?
  423.       x = 0
  424.       y += 1
  425.       h += 1
  426.       if equipment.int_plus > 0
  427.         text=$data_system.words.int+" +"+ equipment.int_plus.to_s
  428.       else
  429.         text=$data_system.words.int+" -"+ (-equipment.int_plus).to_s
  430.       end
  431.       self.contents.font.color = normal_color
  432.       self.contents.font.size = size
  433.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  434.     end
  435.     #------------------------------------------------------------------------
  436.     # ● 魔力石描繪
  437.     #------------------------------------------------------------------------
  438.     y += draw_materia(equipment, move, y, size) unless self.materia.nil?
  439.   end
  440.   #--------------------------------------------------------------------------
  441.   # ● 物品幫助窗口
  442.   #--------------------------------------------------------------------------
  443.   def set_item_text(item)
  444.     # 取得描述
  445.     description = item.description.clone
  446.     # 取得屬性、附加狀態、解除狀態之副本
  447.     element_set = item.element_set.clone
  448.     plus_state_set = item.plus_state_set.clone
  449.     minus_state_set = item.minus_state_set.clone
  450.     # 過濾不顯示的描述
  451.     element_set -= @unshow_elements
  452.     plus_state_set -= @unshow_states
  453.     minus_state_set -= @unshow_states
  454.     # 初始化數據設定
  455.     x = 0
  456.     y = 0
  457.     h = 0
  458.     phrase = {}
  459.     scope ={}
  460.     parameter_type = {}
  461.  
  462.     # 基本數據設定
  463. =begin
  464.     name_size = 名字文字大小
  465.     size = 描述文字大小
  466.     word = 每行的描述文字數
  467.     move = 全體描述偏移幅度
  468. =end
  469.     name_size = 18
  470.     size = 14
  471.     word = 12
  472.     move = 80
  473.  
  474.     # 基本文字設定
  475.     phrase["scope"] = "范围:"
  476.     phrase["price"] = "价格:"
  477.     phrase["recover_hp_rate"] = "HP 回复率:"
  478.     phrase["recover_hp"] = "HP 回复量:"
  479.     phrase["recover_sp_rate"] = "SP 回复率:"
  480.     phrase["recover_sp"] = "SP 回复量:"
  481.     phrase["elements"] = "属性:"
  482.     phrase["plus"] = "附加"
  483.     phrase["minus"] = "解除"
  484.     phrase["states"] = "状态"
  485.     scope[0] = "特殊物品"
  486.     scope[1] = "特殊物品"
  487.     scope[2] = "敌单体"
  488.     scope[3] = "敌全体"
  489.     scope[4] = "己方单体"
  490.     scope[5] = "己方全体"
  491.     scope[6] = "己方昏死单体"
  492.     scope[7] = "己方昏死全体"
  493.     scope[8] = "使用者"
  494.  
  495.     parameter_type[1] = "MaxHP"
  496.     parameter_type[2] = "MaxSP"
  497.     parameter_type[3] = $data_system.words.str
  498.     parameter_type[4] = $data_system.words.dex
  499.     parameter_type[5] = $data_system.words.agi
  500.     parameter_type[6] = $data_system.words.int
  501.  
  502.     #依顯示内容確定自身高
  503.     h = (description.size/3/word)
  504.     h +=1 if (description.size/3%word)> 0
  505.     now_h = h
  506.     h +=3  # 空行,效果範圍,價格
  507.     h += 1 unless item.recover_hp_rate.zero?
  508.     h += 1 unless item.recover_hp.zero?
  509.     h += 1 unless item.recover_sp_rate.zero?
  510.     h += 1 unless item.recover_sp.zero?
  511.     h += 1 unless item.parameter_type.zero?
  512.     h += 1 unless element_set[0].nil?
  513.     h += 1 unless element_set[4].nil?
  514.     h += (1+plus_state_set.size) unless plus_state_set.empty?
  515.     h += (1+minus_state_set.size) unless minus_state_set.empty?
  516.     #------------------------------------------------------------------------
  517.     # ● 圖片顯示保證高度
  518.     #------------------------------------------------------------------------
  519.     h = 6 + now_h if (h - now_h) < 6
  520.     #------------------------------------------------------------------------
  521.     # ● 換算高度
  522.     #------------------------------------------------------------------------
  523.     self.height = h * size + name_size + 32
  524.     #------------------------------------------------------------------------
  525.     # ● 生成背景
  526.     #------------------------------------------------------------------------
  527.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  528.     self.contents.clear
  529.     #------------------------------------------------------------------------
  530.     # ● 名字描繪
  531.     #------------------------------------------------------------------------
  532.     text = item.name
  533.     self.contents.font.color = normal_color#顔色腳本
  534.     self.contents.font.size = name_size
  535.     if text.nil?
  536.       self.visible = false
  537.     else
  538.       self.visible = true
  539.       self.contents.draw_text(0,0, text.size*7, 20, text, 0)
  540.     end
  541.     #------------------------------------------------------------------------
  542.     # ● 說明描繪
  543.     #------------------------------------------------------------------------
  544.     x = 0
  545.     y += 1
  546.     while ((text = description.slice!(/./m)) != nil)
  547.       self.contents.font.color = normal_color
  548.       self.contents.font.size = size
  549.       self.contents.draw_text(x*size, y*size+5, size, size, text, 0)
  550.       x+=1
  551.       if x == word
  552.         x = 0
  553.         y += 1
  554.       end
  555.     end
  556.     #------------------------------------------------------------------------
  557.     # ● 圖標描繪
  558.     #------------------------------------------------------------------------
  559.     bitmap = RPG::Cache.icon(item.icon_name) unless item.icon_name.nil?
  560.     opacity = self.contents.font.color == normal_color ? 255 : 128
  561.     self.contents.blt(0 ,y*size + 20, bitmap, Rect.new(0, 0, 95, 100), 225)
  562.     #------------------------------------------------------------------------
  563.     # ● 魔力石接口
  564.     #------------------------------------------------------------------------
  565.     unless self.materia.nil?
  566.       return if is_materia?(item)
  567.     end
  568.     #------------------------------------------------------------------------
  569.     # ● 效果範圍
  570.     #------------------------------------------------------------------------
  571.     text= phrase["scope"] + scope[item.scope]
  572.     x = 0
  573.     y += 1
  574.     self.contents.font.color = normal_color
  575.     self.contents.font.size = size
  576.     self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  577.     #------------------------------------------------------------------------
  578.     # ● 價格
  579.     #------------------------------------------------------------------------
  580.     x = 0
  581.     y += 1      
  582.     text = phrase["price"] + item.price.to_s
  583.     self.contents.font.color = normal_color
  584.     self.contents.font.size = size
  585.     self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  586.  
  587.     #------------------------------------------------------------------------
  588.     # ● HP回復率
  589.     #------------------------------------------------------------------------
  590.     unless item.recover_hp_rate.zero?  
  591.       x = 0
  592.       y += 1
  593.       text = phrase["recover_hp_rate"] + item.recover_hp_rate.to_s+"%"
  594.       self.contents.font.color = normal_color
  595.       self.contents.font.size = size
  596.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)   
  597.     end
  598.     #------------------------------------------------------------------------
  599.     # ● HP回復量
  600.     #------------------------------------------------------------------------
  601.     unless item.recover_hp.zero?  
  602.       x = 0
  603.       y += 1      
  604.       text = phrase["recover_hp"] + item.recover_hp.to_s
  605.       self.contents.font.color = normal_color
  606.       self.contents.font.size = size
  607.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  608.     end
  609.     #------------------------------------------------------------------------
  610.     # ● SP回復率
  611.     #------------------------------------------------------------------------
  612.     unless item.recover_sp_rate.zero?
  613.       x = 0
  614.       y += 1      
  615.       text = phrase["recover_sp_rate"] + item.recover_sp_rate.to_s+"%"
  616.       self.contents.font.color = normal_color
  617.       self.contents.font.size = size
  618.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  619.     end
  620.     #------------------------------------------------------------------------
  621.     # ● SP回復量
  622.     #------------------------------------------------------------------------
  623.     unless item.recover_sp.zero?  
  624.       x = 0
  625.       y += 1      
  626.       text = phrase["elements"] + item.recover_sp.to_s
  627.       self.contents.font.color = normal_color
  628.       self.contents.font.size = size
  629.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  630.     end
  631.     #------------------------------------------------------------------------
  632.     # ● 能力值增加
  633.     #------------------------------------------------------------------------
  634.     unless item.parameter_type.zero?
  635.       x = 0
  636.       y += 1      
  637.       text= parameter_type[item.parameter_type]+" +"+item.parameter_points.to_s
  638.  
  639.       self.contents.font.color = normal_color
  640.       self.contents.font.size = size
  641.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  642.     end
  643.     #------------------------------------------------------------------------
  644.     # ● 屬性
  645.     #------------------------------------------------------------------------
  646.     if element_set.size > 0
  647.       x = 0
  648.       y += 1
  649.       text = phrase["elements"]
  650.       for i in 0...element_set.size
  651.         break if i > 4
  652.         text += $data_system.elements[element_set[i]]
  653.       end
  654.       self.contents.font.color = normal_color
  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.     if element_set.size >= 5
  659.       x = (phrase["elements"].size)*5-4
  660.       y += 1
  661.       text = ""
  662.       for i in 4...element_set.size
  663.         text += $data_system.elements[element_set[i]]
  664.       end
  665.       self.contents.font.color = normal_color
  666.       self.contents.font.size = size
  667.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  668.     end
  669.     #------------------------------------------------------------------------
  670.     # ● 狀態添加
  671.     #------------------------------------------------------------------------
  672.     unless plus_state_set.empty?
  673.       text = phrase["plus"]
  674.       x = 0
  675.       y += 1
  676.       self.contents.font.color = normal_color
  677.       self.contents.font.size = size
  678.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  679.       plus_state_set.each do |plus_state|
  680.         y += 1
  681.         text = $data_states[plus_state].name        
  682.         self.contents.font.color = normal_color
  683.         self.contents.font.size = size
  684.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)      
  685.       end  
  686.     end
  687.     #------------------------------------------------------------------------
  688.     # ● 狀態解除
  689.     #------------------------------------------------------------------------
  690.     unless minus_state_set.empty?
  691.       text = phrase["minus"]
  692.       x = 0
  693.       y += 1
  694.       self.contents.font.color = normal_color
  695.       self.contents.font.size = size
  696.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  697.       minus_state_set.each do |minus_state|
  698.         y += 1
  699.         text = $data_states[minus_state].name
  700.         self.contents.font.color = normal_color
  701.         self.contents.font.size = size
  702.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)   
  703.       end
  704.     end
  705.   end
  706.   #--------------------------------------------------------------------------
  707.   # ● 技能帮助窗口
  708.   #--------------------------------------------------------------------------
  709.   def set_skill_text(skill)
  710.     # 取得描述
  711.     description = skill.description.clone
  712.     # 取得屬性、附加狀態、解除狀態之副本
  713.     element_set = skill.element_set.clone
  714.     plus_state_set = skill.plus_state_set.clone
  715.     minus_state_set = skill.minus_state_set.clone
  716.     # 過濾不顯示的描述
  717.     element_set -= @unshow_elements
  718.     plus_state_set -= @unshow_states
  719.     minus_state_set -= @unshow_states
  720.     # 初始化設定
  721.     x = 0
  722.     y = 0
  723.     h = 0
  724.     phrase = {}
  725.     scope = {}
  726.  
  727.     # 基本數據設定
  728. =begin
  729.     name_size = 名字文字大小
  730.     size = 描述文字大小
  731.     word = 每行的描述文字數
  732.     move = 全體描述偏移幅度
  733. =end
  734.     name_size = 18
  735.     size = 14
  736.     word = 12
  737.     move = 80
  738.  
  739.     # 基本文字設定
  740.     phrase["scope"] = "范围:"
  741.     #
  742.     phrase["power"] = "威力:"
  743.     phrase["cost_sp"] = "消耗SP:"
  744.     phrase["hit_rate"] = "命中率:"
  745.     phrase["elements"] = "攻击属性"
  746.     #
  747.     phrase["plus"] = "附加"
  748.     phrase["minus"] = "解除"
  749.     phrase["states"] = "状态"
  750.     scope[0] = "特殊技能"
  751.     scope[1] = "敌单体"
  752.     scope[2] = "敌全体"
  753.     scope[3] = "我方单体"
  754.     scope[4] = "我方全体"
  755.     scope[5] = "我方昏死(单体)"
  756.     scope[6] = "我方昏死(全体)"
  757.     scope[7] = "自身"
  758.  
  759.  
  760.     #由描叙确定高
  761.     h =description.size/3/word
  762.     h += 1 if (description.size%3/word) > 0
  763.     h += 4  #空行,效果范围,消费SP,命中率
  764.     h += 1 unless skill.power.zero?
  765.     h += 1 unless element_set.empty?
  766.     h += 1 unless element_set[4].nil?
  767.     h += plus_state_set.size
  768.     h += minus_state_set.size
  769.     #------------------------------------------------------------------------
  770.     # ● 換算高度
  771.     #------------------------------------------------------------------------
  772.     self.height=h * size + name_size + 32  
  773.     self.contents = Bitmap.new(self.width - 32,self.height - 32)
  774.     self.contents.clear
  775.  
  776.     #------------------------------------------------------------------------
  777.     # ● 名字描述
  778.     #------------------------------------------------------------------------
  779.     text = skill.name
  780.     self.contents.font.color = Color.new(255, 255, 128, 255)
  781.     self.contents.font.size = name_size
  782.     if text!=nil
  783.       self.visible = true
  784.       self.contents.draw_text(0,0, text.size*7, name_size, text, 0)
  785.     else
  786.       self.visible = false
  787.     end
  788.  
  789.     #------------------------------------------------------------------------
  790.     # ● 說明描述
  791.     #------------------------------------------------------------------------
  792.     x = 0
  793.     y += 1
  794.     text = description
  795.     while ((text = description.slice!(/./m)) != nil)
  796.       self.contents.font.color = normal_color
  797.       self.contents.font.size = size
  798.       self.contents.draw_text(x*size, y*size+5, size, size, text, 0)
  799.       x+=1
  800.       if x==word#每行10个字
  801.         x = 0
  802.         y += 1      
  803.       end
  804.     end
  805.  
  806.     #------------------------------------------------------------------------
  807.     # ● 攻擊範圍
  808.     #------------------------------------------------------------------------
  809.     text = phrase["scope"] + scope[skill.scope]
  810.     x = 0
  811.     y += 1
  812.     self.contents.font.color = normal_color
  813.     self.contents.font.size = size
  814.     self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  815.     #------------------------------------------------------------------------
  816.     # ● 空一行
  817.     #------------------------------------------------------------------------
  818.     y += 1
  819.     #------------------------------------------------------------------------
  820.     # ● 威力描述
  821.     #------------------------------------------------------------------------
  822.     unless skill.power.zero?
  823.       power = skill.power > 0 ? skill.power : -1 * skill.power
  824.       text = phrase["power"] + power.to_s
  825.       x = 0
  826.       y += 1
  827.       self.contents.font.color = normal_color
  828.       self.contents.font.size = size  
  829.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  830.     end  
  831.     #------------------------------------------------------------------------
  832.     # ● 消費SP描述
  833.     #------------------------------------------------------------------------
  834.     text = phrase["cost_sp"] + skill.sp_cost.to_s
  835.     x = 0
  836.     y += 1
  837.     self.contents.font.color = normal_color
  838.     self.contents.font.size = size   
  839.     self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  840.     #------------------------------------------------------------------------
  841.     # ● 命中率描述
  842.     #------------------------------------------------------------------------
  843.     text = phrase["hit_rate"] + skill.hit.to_s + "%"
  844.     x = 0
  845.     y += 1
  846.     self.contents.font.color = normal_color
  847.     self.contents.font.size = size
  848.     self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  849.     #------------------------------------------------------------------------
  850.     # ● 攻擊屬性
  851.     #------------------------------------------------------------------------
  852.     if element_set.size > 0
  853.       text=phrase["elements"]
  854.       for i in 0...element_set.size
  855.         if i < 4
  856.           text+=$data_system.elements[element_set[i]]
  857.         else
  858.           break
  859.         end        
  860.       end
  861.       x = 0
  862.       y += 1
  863.       self.contents.font.color = normal_color
  864.       self.contents.font.size = size
  865.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  866.     end
  867.     if element_set.size >= 5
  868.       text=""
  869.       for i in 4...element_set.size
  870.         text+=$data_system.elements[element_set[i]]
  871.       end
  872.       x= (phrase["elements"].size)*3
  873.       y += 1
  874.       self.contents.font.color = normal_color
  875.       self.contents.font.size = size
  876.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  877.     end
  878.     #------------------------------------------------------------------------
  879.     # ● 狀態附加
  880.     #------------------------------------------------------------------------
  881.     unless plus_state_set.empty?
  882.       text= phrase["plus"]
  883.       x = 0
  884.       y += 1
  885.       self.contents.font.color = normal_color
  886.       self.contents.font.size = size
  887.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  888.       plus_state_set.each do |plus_state|
  889.         y += 1
  890.         text=$data_states[plus_state].name        
  891.         self.contents.font.color = normal_color
  892.         self.contents.font.size = size
  893.         self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)        
  894.       end  
  895.     end
  896.     #------------------------------------------------------------------------
  897.     # ●狀態解除
  898.     #------------------------------------------------------------------------
  899.     unless minus_state_set.empty?
  900.       text = phrase["minus"]
  901.       x = 0
  902.       y += 1
  903.       self.contents.font.color = normal_color
  904.       self.contents.font.size=size
  905.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  906.       minus_state_set.each do |minus_state|
  907.         y += 1
  908.         text=$data_states[minus_state].name        
  909.         self.contents.font.color = normal_color
  910.         self.contents.font.size=size
  911.         self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)        
  912.       end  
  913.     end     
  914.   end
  915.   #--------------------------------------------------------------------------
  916.   # ● 设置角色
  917.   #     actor : 要显示状态的角色
  918.   #--------------------------------------------------------------------------
  919.   def set_actor(actor)
  920.     if actor != @actor
  921.       self.contents.clear
  922.       draw_actor_name(actor, 4, 0)
  923.       draw_actor_state(actor, 140, 0)
  924.       draw_actor_hp(actor, 284, 0)
  925.       draw_actor_sp(actor, 460, 0)
  926.       @actor = actor
  927.       @text = nil
  928.       self.visible = true
  929.     end
  930.   end
  931.   #--------------------------------------------------------------------------
  932.   # ● 設置角色
  933.   #     actor : 要顯示狀態之角色
  934.   #--------------------------------------------------------------------------
  935.   def set_actor(actor)
  936.     self.contents = Bitmap.new(width - 32, height - 32) if self.contents.nil?
  937.     if actor != @actor
  938.       self.contents.clear
  939.       draw_actor_name(actor, 4, 0)
  940.       draw_actor_state(actor, 140, 0)
  941.       draw_actor_hp(actor, 284, 0)
  942.       draw_actor_sp(actor, 460, 0)
  943.       @actor = actor
  944.       @text = nil
  945.       self.visible = true
  946.     end
  947.   end
  948.   #--------------------------------------------------------------------------
  949.   # ● 設置敵人
  950.   #     enemy : 要顯示名字與狀態之敵人
  951.   #--------------------------------------------------------------------------
  952.   def set_enemy(enemy)
  953.     self.contents = Bitmap.new(width - 32, height - 32) if self.contents.nil?
  954.     text = enemy.name.sub(/\[Ff][([0-9]+)]/) {""}
  955.     state_text = make_battler_state_text(enemy, 112, false)
  956.     if state_text != ""
  957.       text += "  " + state_text
  958.     end
  959.     set_text(text, 1)
  960.     self.visible = true
  961.   end
  962.   #--------------------------------------------------------------------------
  963.   # ● 校正帮助窗口位置
  964.   #--------------------------------------------------------------------------
  965.   def set_pos(x,y,width,oy,index,column_max)
  966.     #光标坐标
  967.     cursor_width = width / column_max - 32
  968.     xx = index % column_max * (cursor_width + 32)
  969.     yy = index / column_max * 32 - oy
  970.     self.x=xx+x+150
  971.     self.y=yy+y+30
  972.     if self.x+self.width>640
  973.       self.x=640-self.width
  974.     end
  975.     if self.y+self.height>480
  976.       self.y=480-self.height
  977.     end  
  978.   end
  979.   #------------------------------------------------------------------------
  980.   # ● 裝備名字顔色變化 接口
  981.   #------------------------------------------------------------------------
  982.   def draw_name_color(equipment)
  983.     return normal_color
  984.   end
  985.   #------------------------------------------------------------------------
  986.   # ● 自身身份確認
  987.   #------------------------------------------------------------------------
  988.   def original_help?
  989.     return false
  990.   end
  991. end
  992.  
  993. #------------------------------------------------------------------------------
  994.  
  995.  
  996.  
  997. #------------------------------------------------------------------------------
  998. #==============================================================================
  999. # ■ Window_Item
  1000. #------------------------------------------------------------------------------
  1001. #  物品画面、战斗画面、显示浏览物品的窗口。
  1002. #==============================================================================
  1003.  
  1004. class Window_Item < Window_Selectable
  1005.   #--------------------------------------------------------------------------
  1006.   # ● 初始化对像
  1007.   #--------------------------------------------------------------------------
  1008.   def initialize
  1009.     super(0, 64-64, 640, 416+64)
  1010.     @column_max = 2
  1011.     refresh
  1012.     self.index = 0
  1013.     # 战斗中的情况下将窗口移至中央并将其半透明化
  1014.     if $game_temp.in_battle
  1015.       self.y = 64
  1016.       self.height = 256
  1017.       self.back_opacity = 160
  1018.     end
  1019.   end
  1020.   #--------------------------------------------------------------------------
  1021.   # ● 刷新帮助文本
  1022.   #--------------------------------------------------------------------------
  1023.   def update_help
  1024.     @help_window.set_text(item)
  1025.     #校正帮助窗口位置
  1026.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  1027.   end
  1028. end
  1029. #------------------------------------------------------------------------------
  1030.  
  1031.  
  1032.  
  1033. #------------------------------------------------------------------------------
  1034. #==============================================================================
  1035. # ■ Window_Skill
  1036. #------------------------------------------------------------------------------
  1037. #  特技画面、战斗画面、显示可以使用的特技浏览的窗口。
  1038. #==============================================================================
  1039.  
  1040. class Window_Skill < Window_Selectable
  1041.   #--------------------------------------------------------------------------
  1042.   # ● 初始化对像
  1043.   #     actor : 角色
  1044.   #--------------------------------------------------------------------------
  1045.   def initialize(actor)
  1046.     super(0, 128, 640, 352)
  1047.     @actor = actor
  1048.     @column_max = 2
  1049.  
  1050.     refresh
  1051.     self.index = 0
  1052.     # 战斗中的情况下将窗口移至中央并将其半透明化
  1053.     if $game_temp.in_battle
  1054.       self.y = 64
  1055.       self.height = 256
  1056.       self.back_opacity = 160
  1057.     end
  1058.   end
  1059.   #--------------------------------------------------------------------------
  1060.   # ● 刷新帮助文本
  1061.   #--------------------------------------------------------------------------
  1062.  
  1063.   def update_help
  1064.     @help_window.set_text(skill)
  1065.     #校正帮助窗口位置
  1066.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  1067.   end
  1068. end
  1069. #------------------------------------------------------------------------------
  1070.  
  1071.  
  1072.  
  1073. #------------------------------------------------------------------------------
  1074. #==============================================================================
  1075. # ■ Window_SkillStatus
  1076. #------------------------------------------------------------------------------
  1077. #  显示特技画面、特技使用者的窗口。
  1078. #==============================================================================
  1079.  
  1080. class Window_SkillStatus < Window_Base
  1081.   #--------------------------------------------------------------------------
  1082.   # ● 初始化对像
  1083.   #     actor : 角色
  1084.   #--------------------------------------------------------------------------
  1085.   def initialize(actor)
  1086. # -------------------
  1087. # 修改開始
  1088.     super(0, 64-64, 640, 64+64)#★★★★★★★★★★★★★★★★★★★★
  1089. # 修改終了
  1090. # -------------------
  1091.     self.contents = Bitmap.new(width - 32, height - 32)
  1092.     @actor = actor
  1093.     refresh
  1094.   end
  1095. end
  1096. #------------------------------------------------------------------------------
  1097.  
  1098.  
  1099.  
  1100. #------------------------------------------------------------------------------
  1101. #==============================================================================
  1102. # ■ Window_EquipLeft
  1103. #------------------------------------------------------------------------------
  1104. #  装备画面的、显示角色能力值变化的窗口。
  1105. #==============================================================================
  1106. class Window_EquipLeft < Window_Base
  1107.   #--------------------------------------------------------------------------
  1108.   # ● 初始化对像
  1109.   #     actor : 角色
  1110.   #--------------------------------------------------------------------------
  1111.   def initialize(actor)
  1112. # -------------------
  1113. # 修改開始
  1114.     super(0, 64-64, 272, 416+64)#★★★★★★★★★★★★★★★★★★★★
  1115. # 修改終了
  1116. # -------------------
  1117.     self.contents = Bitmap.new(width - 32, height - 32)
  1118.     @actor = actor
  1119.     refresh
  1120.   end
  1121. end
  1122. #------------------------------------------------------------------------------
  1123.  
  1124.  
  1125.  
  1126. #------------------------------------------------------------------------------
  1127. #==============================================================================
  1128. # ■ Window_EquipRight
  1129. #------------------------------------------------------------------------------
  1130. #  装备画面、显示角色现在装备的物品的窗口。
  1131. #==============================================================================
  1132.  
  1133. class Window_EquipRight < Window_Selectable
  1134.   #--------------------------------------------------------------------------
  1135.   # ● 初始化对像
  1136.   #     actor : 角色
  1137.   #--------------------------------------------------------------------------
  1138.   def initialize(actor)
  1139. # -------------------
  1140. # 修改開始
  1141.     super(272, 64-64, 368, 256+64)#★★★★★★★★★★★★★★★★★★★★
  1142. # 修改終了
  1143. # -------------------
  1144.     self.contents = Bitmap.new(width - 32, height - 32)
  1145.     @actor = actor
  1146.     refresh
  1147.     self.index = 0
  1148.   end
  1149.   #--------------------------------------------------------------------------
  1150.   # ● 刷新帮助文本
  1151.   #--------------------------------------------------------------------------
  1152.  
  1153.   def update_help
  1154.     @help_window.set_text(item)
  1155.     #校正帮助窗口位置
  1156.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  1157.   end
  1158. end
  1159. #------------------------------------------------------------------------------
  1160.  
  1161.  
  1162.  
  1163. #------------------------------------------------------------------------------
  1164. #==============================================================================
  1165. # ■ Window_EquipItem
  1166. #------------------------------------------------------------------------------
  1167. #  装备画面、显示浏览变更装备的候补物品的窗口。
  1168. #==============================================================================
  1169.  
  1170. class Window_EquipItem < Window_Selectable
  1171.   #--------------------------------------------------------------------------
  1172.   # ● 初始化对像
  1173.   #     actor      : 角色
  1174.   #     equip_type : 装备部位 (0~3)
  1175.   #--------------------------------------------------------------------------
  1176.   def initialize(actor, equip_type)
  1177. # -------------------
  1178. # 修改開始
  1179.     super(272, 320, 368, 160)#★★★★★★★★★★★★★★★★★★★★
  1180. # 修改終了
  1181. # -------------------
  1182.     @actor = actor
  1183.     @equip_type = equip_type
  1184.     @column_max = 1
  1185.  
  1186.     refresh
  1187.     self.active = false
  1188.     self.index = -1
  1189.   end
  1190.   def update_help
  1191.     @help_window.set_text(item)
  1192.     #校正帮助窗口位置
  1193.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  1194.   end
  1195. end
  1196. #------------------------------------------------------------------------------
  1197.  
  1198.  
  1199.  
  1200. #------------------------------------------------------------------------------
  1201. #==============================================================================
  1202. # ■ Window_ShopCommand
  1203. #------------------------------------------------------------------------------
  1204. #  商店画面、选择要做的事的窗口
  1205. #==============================================================================
  1206.  
  1207. class Window_ShopCommand < Window_Selectable
  1208.   #--------------------------------------------------------------------------
  1209.   # ● 初始化对像
  1210.   #--------------------------------------------------------------------------
  1211.   def initialize
  1212. # -------------------
  1213. # 修改開始
  1214.     super(0, 64-64, 480, 64)#★★★★★★★★★★★★★★★★★
  1215. # 修改終了
  1216. # -------------------
  1217.     self.contents = Bitmap.new(width - 32, height - 32)
  1218.     @item_max = 3
  1219.     @column_max = 3
  1220.     @commands = ["买", "卖", "取消"]
  1221.     refresh
  1222.     self.index = 0
  1223.   end
  1224. end
  1225. #------------------------------------------------------------------------------
  1226.  
  1227.  
  1228.  
  1229. #------------------------------------------------------------------------------
  1230. #========================================================================================================================
  1231. # ■ Window_ShopBuy
  1232. #------------------------------------------------------------------------------
  1233. #  商店画面、浏览显示可以购买的商品的窗口。
  1234. #==============================================================================
  1235.  
  1236. class Window_ShopBuy < Window_Selectable
  1237.   #--------------------------------------------------------------------------
  1238.   # ● 初始化对像
  1239.   #     shop_goods : 商品
  1240.   #--------------------------------------------------------------------------
  1241.   def initialize(shop_goods)
  1242. # -------------------
  1243. # 修改開始
  1244.     super(0, 128-64, 368, 352+64)#★★★★★★★★★★★★★★★★
  1245. # 修改終了
  1246. # -------------------
  1247.     @shop_goods = shop_goods
  1248.  
  1249.     refresh
  1250.     self.index = 0
  1251.   end
  1252.   #--------------------------------------------------------------------------
  1253.   # ● 刷新帮助文本
  1254.   #--------------------------------------------------------------------------
  1255.  
  1256.   def update_help
  1257.     @help_window.set_text(item)
  1258.     #校正帮助窗口位置
  1259.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  1260.   end
  1261. end
  1262. #------------------------------------------------------------------------------
  1263.  
  1264.  
  1265.  
  1266. #------------------------------------------------------------------------------
  1267. #==============================================================================
  1268. # ■ Window_ShopSell
  1269. #------------------------------------------------------------------------------
  1270. #  商店画面、浏览显示可以卖掉的商品的窗口。
  1271. #==============================================================================
  1272.  
  1273. class Window_ShopSell < Window_Selectable
  1274.   #--------------------------------------------------------------------------
  1275.   # ● 初始化对像
  1276.   #--------------------------------------------------------------------------
  1277.   def initialize
  1278. # -------------------
  1279. # 修改開始
  1280.     super(0, 128-64, 640, 352+64)#★★★★★★★★★★★★★★★★
  1281. # 修改終了
  1282. # -------------------
  1283.     @column_max = 2
  1284.  
  1285.     refresh
  1286.     self.index = 0
  1287.   end
  1288.   #--------------------------------------------------------------------------
  1289.   # ● 刷新帮助文本
  1290.   #--------------------------------------------------------------------------
  1291.  
  1292.   def update_help
  1293.     @help_window.set_text(item)
  1294.     #校正帮助窗口位置
  1295.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  1296.   end
  1297. end
  1298. #------------------------------------------------------------------------------
  1299.  
  1300.  
  1301.  
  1302. #------------------------------------------------------------------------------
  1303. #==============================================================================
  1304. # ■ Window_ShopNumber
  1305. #------------------------------------------------------------------------------
  1306. #  商店画面、输入买卖数量的窗口。
  1307. #==============================================================================
  1308. class Window_ShopNumber < Window_Base
  1309.   #--------------------------------------------------------------------------
  1310.   # ● 初始化对像
  1311.   #--------------------------------------------------------------------------
  1312.   def initialize
  1313. # -------------------
  1314. # 修改開始
  1315.     super(0, 128-64, 368, 352+64)#★★★★★★★★★★★★★★★★
  1316. # 修改終了
  1317. # -------------------
  1318.     self.contents = Bitmap.new(width - 32, height - 32)
  1319.     @item = nil
  1320.     [url=home.php?mod=space&uid=25307]@Max[/url] = 1
  1321.     @price = 0
  1322.     @number = 1
  1323.   end
  1324. end
  1325. #------------------------------------------------------------------------------
  1326.  
  1327.  
  1328.  
  1329. #------------------------------------------------------------------------------
  1330. #==============================================================================
  1331. # ■ Window_ShopStatus
  1332. #------------------------------------------------------------------------------
  1333. #  商店画面、显示物品所持数与角色装备的窗口。
  1334. #==============================================================================
  1335.  
  1336. class Window_ShopStatus < Window_Base
  1337.   #--------------------------------------------------------------------------
  1338.   # ● 初始化对像
  1339.   #--------------------------------------------------------------------------
  1340.   def initialize
  1341. # -------------------
  1342. # 修改開始
  1343.     super(368, 128-64, 272, 352+64)#★★★★★★★★★★★★
  1344. # 修改終了
  1345. # -------------------
  1346.     self.contents = Bitmap.new(width - 32, height - 32)
  1347.     @item = nil
  1348.     refresh
  1349.   end
  1350. end
  1351. #------------------------------------------------------------------------------
  1352.  
  1353.  
  1354.  
  1355. #------------------------------------------------------------------------------
  1356. #==============================================================================
  1357. # ■ Scene_Equip
  1358. #------------------------------------------------------------------------------
  1359. #  处理装备画面的类。
  1360. #==============================================================================
  1361.  
  1362. class Scene_Equip
  1363.   #--------------------------------------------------------------------------
  1364.   # ● 刷新画面 (右侧窗口被激活的情况下)
  1365.   #--------------------------------------------------------------------------
  1366.   def update_right
  1367. # -------------------
  1368. # 修改開始
  1369.     if @right_window.item==nil
  1370.         @help_window.visible=false
  1371.     else
  1372.         @help_window.visible=true
  1373.     end
  1374. # 修改終了
  1375. # -------------------
  1376.     # 按下 B 键的情况下
  1377.     if Input.trigger?(Input::B)
  1378.       # 演奏取消 SE
  1379.       $game_system.se_play($data_system.cancel_se)
  1380.       # 切换到菜单画面
  1381.       $scene = Scene_Menu.new(2)
  1382.       return
  1383.     end
  1384.     # 按下 C 键的情况下
  1385.     if Input.trigger?(Input::C)
  1386.       # 固定装备的情况下
  1387.       if @actor.equip_fix?(@right_window.index)
  1388.         # 演奏冻结 SE
  1389.         $game_system.se_play($data_system.buzzer_se)
  1390.         return
  1391.       end
  1392.       # 演奏确定 SE
  1393.       $game_system.se_play($data_system.decision_se)
  1394.       # 激活物品窗口
  1395.       @right_window.active = false
  1396.       @item_window.active = true
  1397.       @item_window.index = 0
  1398.       return
  1399.     end
  1400.     # 按下 R 键的情况下
  1401.     if Input.trigger?(Input::R)
  1402.       # 演奏光标 SE
  1403.       $game_system.se_play($data_system.cursor_se)
  1404.       # 移至下一位角色
  1405.       @actor_index += 1
  1406.       @actor_index %= $game_party.actors.size
  1407.       # 切换到别的装备画面
  1408.       $scene = Scene_Equip.new(@actor_index, @right_window.index)
  1409.       return
  1410.     end
  1411.     # 按下 L 键的情况下
  1412.     if Input.trigger?(Input::L)
  1413.       # 演奏光标 SE
  1414.       $game_system.se_play($data_system.cursor_se)
  1415.       # 移至上一位角色
  1416.       @actor_index += $game_party.actors.size - 1
  1417.       @actor_index %= $game_party.actors.size
  1418.       # 切换到别的装备画面
  1419.       $scene = Scene_Equip.new(@actor_index, @right_window.index)
  1420.       return
  1421.     end
  1422.   end
  1423.   #--------------------------------------------------------------------------
  1424.   # ● 刷新画面 (物品窗口被激活的情况下)
  1425.   #--------------------------------------------------------------------------
  1426.   def update_item
  1427. # -------------------
  1428. # 修改開始
  1429.     if @item_window.item==nil
  1430.         @help_window.visible=false
  1431.     else
  1432.         @help_window.visible=true
  1433.     end
  1434. # 修改終了
  1435. # -------------------
  1436.     # 按下 B 键的情况下
  1437.     if Input.trigger?(Input::B)
  1438.       # 演奏取消 SE
  1439.       $game_system.se_play($data_system.cancel_se)
  1440.       # 激活右侧窗口
  1441.       @right_window.active = true
  1442.       @item_window.active = false
  1443.       @item_window.index = -1
  1444.       return
  1445.     end
  1446.     # 按下 C 键的情况下
  1447.     if Input.trigger?(Input::C)
  1448.       # 演奏装备 SE
  1449.       $game_system.se_play($data_system.equip_se)
  1450.       # 获取物品窗口现在选择的装备数据
  1451.       item = @item_window.item
  1452.       # 变更装备
  1453.       @actor.equip(@right_window.index, item == nil ? 0 : item.id)
  1454.       # 激活右侧窗口
  1455.       @right_window.active = true
  1456.       @item_window.active = false
  1457.       @item_window.index = -1
  1458.       # 再生成右侧窗口、物品窗口的内容
  1459.       @right_window.refresh
  1460.       @item_window.refresh
  1461.       return
  1462.     end
  1463.   end
  1464. end
  1465. #------------------------------------------------------------------------------
  1466.  
  1467.  
  1468.  
  1469. #------------------------------------------------------------------------------
  1470. #========================================================================================================================
  1471. # ■ Scene_Battle (分割定义 3)
  1472. #------------------------------------------------------------------------------
  1473. #  处理战斗画面的类。
  1474. #========================================================================================================================
  1475.  
  1476. class Scene_Battle
  1477.   #--------------------------------------------------------------------------
  1478.   # ● 刷新画面 (角色命令回合 : 选择特技)
  1479.   #--------------------------------------------------------------------------
  1480.   alias first_reupdate_phase3_skill_select update_phase3_skill_select
  1481.   def update_phase3_skill_select
  1482. # -------------------
  1483. # 修改開始
  1484.     @skill_window.help_window.visible = false#★★★★★★★★★★★★★
  1485. # 修改終了
  1486. # -------------------
  1487.     first_reupdate_phase3_skill_select
  1488.   end
  1489.   #--------------------------------------------------------------------------
  1490.   # ● 刷新画面 (角色命令回合 : 选择物品)
  1491.   #--------------------------------------------------------------------------
  1492.   alias first_reupdate_phase3_item_select update_phase3_item_select  
  1493.   def update_phase3_item_select
  1494. # -------------------
  1495. # 修改開始
  1496.     @item_window.help_window.visible = false#★★★★★★★★★★★★
  1497. # 修改終了
  1498. # -------------------
  1499.     first_reupdate_phase3_item_select
  1500.   end
  1501.   #--------------------------------------------------------------------------
  1502.   # ● 开始选择特技
  1503.   #--------------------------------------------------------------------------
  1504.   def start_skill_select
  1505.     @skill_window = Window_Skill.new(@active_battler)
  1506.     @skill_window.help_window = Window_Help.new
  1507.     @actor_command_window.active = false
  1508.     @actor_command_window.visible = false
  1509.   end
  1510.   #--------------------------------------------------------------------------
  1511.   # ● 选择特技结束
  1512.   #--------------------------------------------------------------------------
  1513.   alias first_update_end_skill_select end_skill_select  
  1514.   def end_skill_select
  1515. # -------------------
  1516. # 修改開始
  1517.     @skill_window.help_window.visible = false#★★★★★★★★★★★★
  1518. # 修改終了
  1519. # -------------------
  1520.     first_update_end_skill_select
  1521.   end
  1522.   #--------------------------------------------------------------------------
  1523.   # ● 开始选择物品
  1524.   #--------------------------------------------------------------------------
  1525.   def start_item_select
  1526.     # 生成物品窗口
  1527.     @item_window = Window_Item.new
  1528.     # 关联帮助窗口
  1529. # -------------------
  1530. # 修改開始
  1531.     @item_window.help_window =  Window_Help.new#★★★★★★★★★★★★
  1532. # 修改終了
  1533. # -------------------
  1534.     # 无效化角色指令窗口
  1535.     @actor_command_window.active = false
  1536.     @actor_command_window.visible = false
  1537.   end
  1538.   #--------------------------------------------------------------------------
  1539.   # ● 结束选择物品
  1540.   #--------------------------------------------------------------------------
  1541.   alias first_update_end_item_select end_item_select
  1542.   def end_item_select
  1543. # -------------------
  1544. # 修改開始
  1545.     @item_window.help_window.visible = false#★★★★★★★★★★★★
  1546. # 修改終了
  1547. # -------------------
  1548.     first_update_end_item_select
  1549.   end
  1550. end
  1551. #------------------------------------------------------------------------------
  1552.  
  1553.  
  1554.  
  1555. #------------------------------------------------------------------------------
  1556. #==============================================================================
  1557. # ■ Scene_Shop
  1558. #------------------------------------------------------------------------------
  1559. #  处理商店画面的类。
  1560. #==============================================================================
  1561.  
  1562. class Scene_Shop
  1563.   #--------------------------------------------------------------------------
  1564.   # ● 主处理
  1565.   #--------------------------------------------------------------------------
  1566. # --------------------
  1567. # 衝突可能
  1568.   def main
  1569.     # 生成帮助窗口
  1570. # -------------------
  1571. # 修改開始
  1572.     @help_window = Window_Help.new#★★★★★★★★★★★★★★★★
  1573. # 修改終了
  1574. # -------------------
  1575.     # 生成指令窗口
  1576.     @command_window = Window_ShopCommand.new
  1577.     # 生成金钱窗口
  1578.     @gold_window = Window_Gold.new
  1579.     @gold_window.x = 480
  1580. # -------------------
  1581. # 修改開始
  1582.     @gold_window.y = 64-64#★★★★★★★★★★★★★
  1583. # 修改終了
  1584. # -------------------
  1585.     # 生成时间窗口
  1586. # -------------------
  1587. # 修改開始
  1588.     @dummy_window = Window_Base.new(0, 128-64, 640, 352+64)#★★★★★★★★★★★★★
  1589. # 修改終了
  1590. # -------------------
  1591.     # 生成购买窗口
  1592.     @buy_window = Window_ShopBuy.new($game_temp.shop_goods)
  1593.     @buy_window.active = false
  1594.     @buy_window.visible = false
  1595.     @buy_window.help_window = @help_window
  1596.     # 生成卖出窗口
  1597.     @sell_window = Window_ShopSell.new
  1598.     @sell_window.active = false
  1599.     @sell_window.visible = false
  1600.     @sell_window.help_window = @help_window
  1601.     # 生成数量输入窗口
  1602.     @number_window = Window_ShopNumber.new
  1603.     @number_window.active = false
  1604.     @number_window.visible = false
  1605.     # 生成状态窗口
  1606.     @status_window = Window_ShopStatus.new
  1607.     @status_window.visible = false
  1608.     # 执行过渡
  1609.     Graphics.transition
  1610.     # 主循环
  1611.     loop do
  1612.       # 刷新游戏画面
  1613.       Graphics.update
  1614.       # 刷新输入信息
  1615.       Input.update
  1616.       # 刷新画面
  1617.       update
  1618.       # 如果画面切换的话就中断循环
  1619.       if $scene != self
  1620.         break
  1621.       end
  1622.     end
  1623.     # 准备过渡
  1624.     Graphics.freeze
  1625.     # 释放窗口
  1626.     @help_window.dispose
  1627.     @command_window.dispose
  1628.     @gold_window.dispose
  1629.     @dummy_window.dispose
  1630.     @buy_window.dispose
  1631.     @sell_window.dispose
  1632.     @number_window.dispose
  1633.     @status_window.dispose
  1634.   end
  1635.   #--------------------------------------------------------------------------
  1636.   # ● 刷新画面
  1637.   #--------------------------------------------------------------------------
  1638. # --------------------
  1639. # 衝突可能
  1640.   def update
  1641.     # 刷新窗口
  1642.     @help_window.update
  1643.     @command_window.update
  1644.     @gold_window.update
  1645.     @dummy_window.update
  1646.     @buy_window.update
  1647.     @sell_window.update
  1648.     @number_window.update
  1649.     @status_window.update
  1650.     # 指令窗口激活的情况下: 调用 update_command
  1651.     if @command_window.active
  1652. # -------------------
  1653. # 修改開始
  1654.       @help_window.visible=false#★★★★★★★★★★★★★★★★
  1655. # 修改終了
  1656. # -------------------
  1657.       update_command
  1658.       return
  1659.     end
  1660.     # 购买窗口激活的情况下: 调用 update_buy
  1661.     if @buy_window.active
  1662. # -------------------
  1663. # 修改開始
  1664.       @help_window.visible=true#★★★★★★★★★★★★★★★★
  1665.       if @buy_window.item==nil#★★★★★★★★★★★★★★★★
  1666.         @help_window.visible=false#★★★★★★★★★★★★★★★★
  1667.       end #★★★★★★★★★★★★★★★★     
  1668. # 修改終了
  1669. # -------------------
  1670.       update_buy
  1671.       return
  1672.     end
  1673.     # 卖出窗口激活的情况下: 调用 update_sell
  1674.     if @sell_window.active
  1675. # -------------------
  1676. # 修改開始
  1677.       @help_window.visible=true#★★★★★★★★★★★★★★★★
  1678.       if @sell_window.item==nil#★★★★★★★★★★★★★★★★
  1679.         @help_window.visible=false#★★★★★★★★★★★★★★★★
  1680.       end #★★★★★★★★★★★★★★★★
  1681. # 修改終了
  1682. # -------------------      
  1683.       update_sell
  1684.       return
  1685.     end
  1686.     # 个数输入窗口激活的情况下: 调用 update_number
  1687.     if @number_window.active
  1688. # -------------------
  1689. # 修改開始
  1690.       @help_window.visible=false#★★★★★★★★★★★★★★★★
  1691. # 修改終了
  1692. # -------------------
  1693.       update_number
  1694.       return
  1695.     end
  1696.   end
  1697. end
  1698. #==============================================================================
  1699. # 禾西製作 / Created by Quarcy
  1700. #==============================================================================
  1701. class Window_Help < Window_Base
  1702.   attr_reader :materia
  1703.   #--------------------------------------------------------------------------
  1704.   # ● 定義不顯示的屬性與狀態
  1705.   #--------------------------------------------------------------------------
  1706.   def unshown
  1707.     @unshow_elements = [17, 18]
  1708.     @unshow_states = []
  1709.   end
  1710.   #--------------------------------------------------------------------------
  1711.   # ● 初始化對象
  1712.   #--------------------------------------------------------------------------
  1713.   def initialize
  1714.     super(0, 0, 640, 64)
  1715.     self.opacity = 150
  1716.     self.z=150
  1717.     self.visible = false
  1718.   end
  1719.   #--------------------------------------------------------------------------
  1720.   # ● 設置文本
  1721.   #     data  : 窗口顯示的字符串/物品資料
  1722.   #     align : 對齊方式 (0..左對齊、1..中間對齊、2..右對齊)
  1723.   #--------------------------------------------------------------------------
  1724.   def set_text(data, align=0)
  1725.     #------------------------------------------------------------------------
  1726.     # ● 當資料爲文字時候
  1727.     #------------------------------------------------------------------------
  1728.     # 如果文本或對齊方式至少一方与上次的不同
  1729.     if data != @text or align != @align
  1730.       if data.is_a?(String)
  1731.         # 再描繪文本
  1732.         self.width = 640
  1733.         self.height = 64
  1734.         self.x=0
  1735.         self.y=0
  1736.         self.contents = Bitmap.new(width - 32, height - 32) if self.contents.nil?
  1737.         self.contents.clear
  1738.         self.contents.font.color = normal_color
  1739.         self.contents.font.size = 20
  1740.         self.contents.draw_text(4, 0, self.width - 40, 32, data, align)
  1741.         @text = data
  1742.         @align = align
  1743.         @actor = nil
  1744.         self.visible = true
  1745.       end
  1746.     end
  1747.     return if data.is_a?(String)
  1748.     #------------------------------------------------------------------------
  1749.     # ● 當沒有資料時候
  1750.     #------------------------------------------------------------------------
  1751.     if data.nil?
  1752.       self.visible=false
  1753.     else
  1754.       self.visible=true
  1755.     end
  1756.     #------------------------------------------------------------------------
  1757.     # ● 當資料爲物品/技能時候
  1758.     #------------------------------------------------------------------------
  1759.     if data != nil && @data != data
  1760.       self.width = 210
  1761.       self.height = 430
  1762.       self.x=0
  1763.       self.y=200
  1764.       unshown
  1765.       non_auto_update(data)
  1766.     else
  1767.       return
  1768.     end
  1769.   end
  1770.   #--------------------------------------------------------------------------
  1771.   # ● 更新帮助窗口
  1772.   #--------------------------------------------------------------------------
  1773.   def non_auto_update(data=@data)
  1774.     @data = data
  1775.     case @data
  1776.     when RPG::Item
  1777.       set_item_text(@data)
  1778.     when RPG::Weapon
  1779.       set_equipment_text(@data)
  1780.     when RPG::Armor
  1781.       set_equipment_text(@data)
  1782.     when RPG::Skill
  1783.       set_skill_text(@data)
  1784.     end
  1785.   end
  1786.   #--------------------------------------------------------------------------
  1787.   # ● 裝備帮助窗口
  1788.   #--------------------------------------------------------------------------
  1789.   def set_equipment_text(equipment)
  1790.     #------------------------------------------------------------------------
  1791.     # ● 取得基本質料
  1792.     #------------------------------------------------------------------------
  1793.     # 取得屬性、附加狀態、解除狀態之副本
  1794.     case equipment
  1795.     when RPG::Weapon
  1796.       element_set = equipment.element_set.clone
  1797.       plus_state_set = equipment.plus_state_set.clone
  1798.       minus_state_set = equipment.minus_state_set.clone
  1799.       #----------------------#
  1800.       # 過濾不顯示的狀態描述 #
  1801.       #----------------------#
  1802.       plus_state_set -= @unshow_states
  1803.       minus_state_set -= @unshow_states
  1804.     when RPG::Armor
  1805.       element_set = equipment.guard_element_set.clone
  1806.       guard_state_set = equipment.guard_state_set.clone
  1807.       #----------------------#
  1808.       # 過濾不顯示的狀態描述 #
  1809.       #----------------------#
  1810.       auto_state_id = equipment.auto_state_id
  1811.       guard_state_set -= @unshow_states
  1812.     end
  1813.     #----------------------#
  1814.     # 過濾不顯示的屬性描述 #
  1815.     #----------------------#
  1816.     element_set -= @unshow_elements
  1817.     #--------------#
  1818.     # 取得說明文字 #
  1819.     #--------------#
  1820.     description = equipment.description.clone
  1821.     # 初始化數據設定
  1822.     x = 0
  1823.     y = 0
  1824.     h = 0
  1825.     phrase = {}
  1826.  
  1827.     # 基本文字設定
  1828.     phrase["price"] = "价格:"
  1829.     phrase["elements"] = "属性:"
  1830.     phrase["minus_states"] = "解除状态:"
  1831.     phrase["plus_states"] = "附加状态:"
  1832.     phrase["guard_elements"] = "防御属性"
  1833.     phrase["guard_states"] = "防御状态"
  1834.     phrase["auto_state"] = "自动状态"
  1835.  
  1836.     # 基本數據設定
  1837. =begin
  1838.     name_size = 名字文字大小
  1839.     size = 描述文字大小
  1840.     word = 每行的描述文字數
  1841.     move = 全體描述偏移幅度
  1842. =end
  1843.     name_size = 18
  1844.     size = 14
  1845.     word = 12
  1846.     move = 80
  1847.     #------------------------------------------------------------------------
  1848.     # ● 確定背景圖片的高度
  1849.     #------------------------------------------------------------------------
  1850.     h += (description.size/3/word)
  1851.     h += 1 if (description.size/3%word) > 0
  1852.     h += 1 if equipment.is_a?(RPG::Weapon)
  1853.     now_h = h
  1854.     h += 1
  1855.     h += 1 unless equipment.pdef.zero?
  1856.     h += 1 unless equipment.mdef.zero?
  1857.     h += 1 if element_set.size > 0
  1858.     h += 1 if element_set.size >= 5
  1859.     case equipment
  1860.     when RPG::Weapon
  1861.       h += 1 unless minus_state_set.empty?
  1862.       h += minus_state_set.size
  1863.       h += 1 unless plus_state_set.empty?
  1864.       h += plus_state_set.size
  1865.     when RPG::Armor
  1866.       h += 1 unless guard_state_set.empty?
  1867.       h += guard_state_set.size
  1868.       h += 1 unless auto_state_id.zero?
  1869.     end
  1870.     h += 1
  1871.     h += 1 unless equipment.str_plus.zero?
  1872.     h += 1 unless equipment.dex_plus.zero?
  1873.     h += 1 unless equipment.agi_plus.zero?
  1874.     h += 1 unless equipment.int_plus.zero?
  1875.     h += materia_height_plus(equipment) unless self.materia.nil?
  1876.     #------------------------------------------------------------------------
  1877.     # ● 圖片顯示保證高度
  1878.     #------------------------------------------------------------------------
  1879.     h = 6 + now_h if (h - now_h) < 6
  1880.     #------------------------------------------------------------------------
  1881.     # ● 換算高度
  1882.     #------------------------------------------------------------------------
  1883.     self.height = h * size + name_size + 32
  1884.     #------------------------------------------------------------------------
  1885.     # ● 生成背景
  1886.     #------------------------------------------------------------------------
  1887.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  1888.     self.contents.clear
  1889.     #------------------------------------------------------------------------
  1890.     # ● 名字描繪
  1891.     #------------------------------------------------------------------------
  1892.     text = equipment.name
  1893.     self.contents.font.color = draw_name_color(equipment)
  1894.     self.contents.font.size = name_size
  1895.     if text.nil?
  1896.       self.visible = false
  1897.     else
  1898.       self.visible = true
  1899.       self.contents.draw_text(0, 0, text.size*7, name_size, text, 0)
  1900.     end
  1901.     #------------------------------------------------------------------------
  1902.     # ● 說明描繪
  1903.     #------------------------------------------------------------------------
  1904.     x = 0
  1905.     y += 1
  1906.     while ((text = description.slice!(/./m)) != nil)
  1907.       self.contents.font.color = normal_color
  1908.       self.contents.font.size = size
  1909.       self.contents.draw_text(x*size, y*size+5, size, size, text, 0)
  1910.       x+=1
  1911.       if x == word
  1912.         x=0
  1913.         y+=1   
  1914.       end
  1915.     end
  1916.     #------------------------------------------------------------------------
  1917.     # ● 圖標描繪
  1918.     #------------------------------------------------------------------------
  1919.     bitmap = RPG::Cache.icon(equipment.icon_name)
  1920.     opacity = self.contents.font.color == normal_color ? 255 : 128
  1921.     self.contents.blt(0 ,y*size + 20, bitmap, Rect.new(0, 0, 95, 100), 225)
  1922.  
  1923.     #------------------------------------------------------------------------
  1924.     # ● 攻擊力描繪(武器)
  1925.     #------------------------------------------------------------------------
  1926.     if equipment.is_a?(RPG::Weapon)
  1927.       x = 0
  1928.       y += 1
  1929.       text = $data_system.words.atk+":"+equipment.atk.to_s
  1930.       self.contents.font.color = normal_color
  1931.       self.contents.font.size = size
  1932.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  1933.     end
  1934.     #------------------------------------------------------------------------
  1935.     # ● 價格描繪
  1936.     #------------------------------------------------------------------------
  1937.     x = 0
  1938.     y += 1
  1939.     text = phrase["price"] + equipment.price.to_s
  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.     #------------------------------------------------------------------------
  1944.     # ● 物理防禦
  1945.     #------------------------------------------------------------------------
  1946.     unless equipment.pdef.zero?
  1947.       x = 0
  1948.       y += 1
  1949.       text = $data_system.words.pdef+":"+equipment.pdef.to_s
  1950.       self.contents.font.color = normal_color
  1951.       self.contents.font.size = size
  1952.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  1953.     end
  1954.     #------------------------------------------------------------------------
  1955.     # ● 魔法防禦
  1956.     #------------------------------------------------------------------------
  1957.     unless equipment.mdef.zero?
  1958.       x = 0
  1959.       y += 1
  1960.       text=$data_system.words.mdef+":"+equipment.mdef.to_s
  1961.       self.contents.font.color = normal_color
  1962.       self.contents.font.size = size
  1963.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  1964.     end
  1965.     #------------------------------------------------------------------------
  1966.     # ● 屬性
  1967.     #------------------------------------------------------------------------
  1968.     if element_set.size > 0
  1969.       x = 0
  1970.       y += 1
  1971.       text = phrase["elements"]
  1972.       for i in 0...element_set.size
  1973.         break if i > 4
  1974.         text += $data_system.elements[element_set[i]]
  1975.       end
  1976.       self.contents.font.color = normal_color
  1977.       self.contents.font.size = size
  1978.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  1979.     end
  1980.     if element_set.size >= 5
  1981.       x = (phrase["elements"].size)*5-4
  1982.       y += 1
  1983.       text = ""
  1984.       for i in 4...element_set.size
  1985.         text += $data_system.elements[element_set[i]]
  1986.       end
  1987.       self.contents.font.color = normal_color
  1988.       self.contents.font.size = size
  1989.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  1990.     end
  1991.     #------------------------------------------------------------------------
  1992.     # ● 描述分流 武器/防具
  1993.     #------------------------------------------------------------------------
  1994.     case equipment
  1995.     when RPG::Weapon
  1996.       #------------------------------------------------------------------------
  1997.       # ● 解除狀態(武器)
  1998.       #------------------------------------------------------------------------
  1999.       unless minus_state_set.empty?
  2000.         x = 0
  2001.         y += 1
  2002.         text=phrase["minus_states"]
  2003.         text=phrase["guard_states"]
  2004.         self.contents.font.color = normal_color
  2005.         self.contents.font.size = size
  2006.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2007.         for i in 0...minus_state_set.size
  2008.           y += 1
  2009.           text = $data_states[minus_state_set[i]].name        
  2010.           self.contents.font.color = normal_color
  2011.           self.contents.font.size = size
  2012.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  2013.         end
  2014.       end
  2015.       #------------------------------------------------------------------------
  2016.       # ● 附加狀態(武器)
  2017.       #------------------------------------------------------------------------
  2018.       unless plus_state_set.empty?
  2019.         x = 0
  2020.         y += 1
  2021.         text = phrase["plus_states"]
  2022.         self.contents.font.color = normal_color
  2023.         self.contents.font.size = size
  2024.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2025.         for i in 0...plus_state_set.size
  2026.           y += 1
  2027.           text=$data_states[plus_state_set[i]].name        
  2028.           self.contents.font.color = normal_color
  2029.           self.contents.font.size = size
  2030.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  2031.         end  
  2032.       end
  2033.     when RPG::Armor
  2034.       #------------------------------------------------------------------------
  2035.       # ● 防禦狀態(防具)
  2036.       #------------------------------------------------------------------------
  2037.       unless guard_state_set.empty?
  2038.         x = 0
  2039.         y += 1
  2040.         text=phrase["guard_states"]
  2041.         self.contents.font.color = normal_color
  2042.         self.contents.font.size = size
  2043.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2044.         for i in 0...guard_state_set.size
  2045.           y += 1
  2046.           text = $data_states[guard_state_set[i]].name        
  2047.           self.contents.font.color = normal_color
  2048.           self.contents.font.size = size
  2049.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  2050.         end
  2051.       end
  2052.       #------------------------------------------------------------------------
  2053.       # ● 自動狀態(防具)
  2054.       #------------------------------------------------------------------------
  2055.       unless auto_state_id.zero?
  2056.         x = 0
  2057.         y += 1
  2058.         text = phrase["auto_state"] + $data_states[auto_state_id].name
  2059.         self.contents.font.color = normal_color
  2060.         self.contents.font.size = size
  2061.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2062.       end
  2063.     end
  2064.     #------------------------------------------------------------------------
  2065.     # ● 空行
  2066.     #------------------------------------------------------------------------
  2067.     y+=1
  2068.     #------------------------------------------------------------------------
  2069.     # ● 力量
  2070.     #------------------------------------------------------------------------
  2071.     unless equipment.str_plus.zero?
  2072.       x = 0
  2073.       y += 1
  2074.       h += 1
  2075.       if equipment.str_plus > 0
  2076.         text=$data_system.words.str+" +"+ equipment.str_plus.to_s
  2077.       else
  2078.         text=$data_system.words.str+" -"+ (-equipment.str_plus).to_s
  2079.       end
  2080.       self.contents.font.color = normal_color
  2081.       self.contents.font.size = size
  2082.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)  
  2083.     end
  2084.     #------------------------------------------------------------------------
  2085.     # ● 靈巧
  2086.     #------------------------------------------------------------------------
  2087.     unless equipment.dex_plus.zero?
  2088.       x = 0
  2089.       y += 1
  2090.       h += 1
  2091.       if equipment.dex_plus > 0
  2092.         text=$data_system.words.dex+" +"+ equipment.dex_plus.to_s
  2093.       else
  2094.         text=$data_system.words.dex+" -"+ (-equipment.dex_plus).to_s
  2095.       end
  2096.       self.contents.font.color = normal_color
  2097.       self.contents.font.size = size
  2098.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2099.     end
  2100.     #------------------------------------------------------------------------
  2101.     # ● 速度
  2102.     #------------------------------------------------------------------------
  2103.     unless equipment.agi_plus.zero?
  2104.       x = 0
  2105.       y += 1
  2106.       h += 1
  2107.       if equipment.agi_plus > 0
  2108.         text=$data_system.words.agi+" +"+ equipment.agi_plus.to_s
  2109.       else
  2110.         text=$data_system.words.agi+" -"+ (-equipment.agi_plus).to_s
  2111.       end
  2112.       self.contents.font.color = normal_color
  2113.       self.contents.font.size = size
  2114.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2115.     end
  2116.     #------------------------------------------------------------------------
  2117.     # ● 智力
  2118.     #------------------------------------------------------------------------
  2119.     unless equipment.int_plus.zero?
  2120.       x = 0
  2121.       y += 1
  2122.       h += 1
  2123.       if equipment.int_plus > 0
  2124.         text=$data_system.words.int+" +"+ equipment.int_plus.to_s
  2125.       else
  2126.         text=$data_system.words.int+" -"+ (-equipment.int_plus).to_s
  2127.       end
  2128.       self.contents.font.color = normal_color
  2129.       self.contents.font.size = size
  2130.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2131.     end
  2132.     #------------------------------------------------------------------------
  2133.     # ● 魔力石描繪
  2134.     #------------------------------------------------------------------------
  2135.     y += draw_materia(equipment, move, y, size) unless self.materia.nil?
  2136.   end
  2137.   #--------------------------------------------------------------------------
  2138.   # ● 物品幫助窗口
  2139.   #--------------------------------------------------------------------------
  2140.   def set_item_text(item)
  2141.     # 取得描述
  2142.     description = item.description.clone
  2143.     # 取得屬性、附加狀態、解除狀態之副本
  2144.     element_set = item.element_set.clone
  2145.     plus_state_set = item.plus_state_set.clone
  2146.     minus_state_set = item.minus_state_set.clone
  2147.     # 過濾不顯示的描述
  2148.     element_set -= @unshow_elements
  2149.     plus_state_set -= @unshow_states
  2150.     minus_state_set -= @unshow_states
  2151.     # 初始化數據設定
  2152.     x = 0
  2153.     y = 0
  2154.     h = 0
  2155.     phrase = {}
  2156.     scope ={}
  2157.     parameter_type = {}
  2158.  
  2159.     # 基本數據設定
  2160. =begin
  2161.     name_size = 名字文字大小
  2162.     size = 描述文字大小
  2163.     word = 每行的描述文字數
  2164.     move = 全體描述偏移幅度
  2165. =end
  2166.     name_size = 18
  2167.     size = 14
  2168.     word = 12
  2169.     move = 80
  2170.  
  2171.     # 基本文字設定
  2172.     phrase["scope"] = "范围:"
  2173.     phrase["price"] = "价格:"
  2174.     phrase["recover_hp_rate"] = "HP 回复率:"
  2175.     phrase["recover_hp"] = "HP 回复量:"
  2176.     phrase["recover_sp_rate"] = "SP 回复率:"
  2177.     phrase["recover_sp"] = "SP 回复量:"
  2178.     phrase["elements"] = "属性:"
  2179.     phrase["plus"] = "附加"
  2180.     phrase["minus"] = "解除"
  2181.     phrase["states"] = "状态"
  2182.     scope[0] = "特殊物品"
  2183.     scope[1] = "特殊物品"
  2184.     scope[2] = "敌单体"
  2185.     scope[3] = "敌全体"
  2186.     scope[4] = "己方单体"
  2187.     scope[5] = "己方全体"
  2188.     scope[6] = "己方昏死单体"
  2189.     scope[7] = "己方昏死全体"
  2190.     scope[8] = "使用者"
  2191.  
  2192.     parameter_type[1] = "MaxHP"
  2193.     parameter_type[2] = "MaxSP"
  2194.     parameter_type[3] = $data_system.words.str
  2195.     parameter_type[4] = $data_system.words.dex
  2196.     parameter_type[5] = $data_system.words.agi
  2197.     parameter_type[6] = $data_system.words.int
  2198.  
  2199.     #依顯示内容確定自身高
  2200.     h = (description.size/3/word)
  2201.     h +=1 if (description.size/3%word)> 0
  2202.     now_h = h
  2203.     h +=3  # 空行,效果範圍,價格
  2204.     h += 1 unless item.recover_hp_rate.zero?
  2205.     h += 1 unless item.recover_hp.zero?
  2206.     h += 1 unless item.recover_sp_rate.zero?
  2207.     h += 1 unless item.recover_sp.zero?
  2208.     h += 1 unless item.parameter_type.zero?
  2209.     h += 1 unless element_set[0].nil?
  2210.     h += 1 unless element_set[4].nil?
  2211.     h += (1+plus_state_set.size) unless plus_state_set.empty?
  2212.     h += (1+minus_state_set.size) unless minus_state_set.empty?
  2213.     #------------------------------------------------------------------------
  2214.     # ● 圖片顯示保證高度
  2215.     #------------------------------------------------------------------------
  2216.     h = 6 + now_h if (h - now_h) < 6
  2217.     #------------------------------------------------------------------------
  2218.     # ● 換算高度
  2219.     #------------------------------------------------------------------------
  2220.     self.height = h * size + name_size + 32
  2221.     #------------------------------------------------------------------------
  2222.     # ● 生成背景
  2223.     #------------------------------------------------------------------------
  2224.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  2225.     self.contents.clear
  2226.     #------------------------------------------------------------------------
  2227.     # ● 名字描繪
  2228.     #------------------------------------------------------------------------
  2229.     text = item.name
  2230.     self.contents.font.color = normal_color#顔色腳本
  2231.     self.contents.font.size = name_size
  2232.     if text.nil?
  2233.       self.visible = false
  2234.     else
  2235.       self.visible = true
  2236.       self.contents.draw_text(0,0, text.size*7, 20, text, 0)
  2237.     end
  2238.     #------------------------------------------------------------------------
  2239.     # ● 說明描繪
  2240.     #------------------------------------------------------------------------
  2241.     x = 0
  2242.     y += 1
  2243.     while ((text = description.slice!(/./m)) != nil)
  2244.       self.contents.font.color = normal_color
  2245.       self.contents.font.size = size
  2246.       self.contents.draw_text(x*size, y*size+5, size, size, text, 0)
  2247.       x+=1
  2248.       if x == word
  2249.         x = 0
  2250.         y += 1
  2251.       end
  2252.     end
  2253.     #------------------------------------------------------------------------
  2254.     # ● 圖標描繪
  2255.     #------------------------------------------------------------------------
  2256.     bitmap = RPG::Cache.icon(item.icon_name) unless item.icon_name.nil?
  2257.     opacity = self.contents.font.color == normal_color ? 255 : 128
  2258.     self.contents.blt(0 ,y*size + 20, bitmap, Rect.new(0, 0, 95, 100), 225)
  2259.     #------------------------------------------------------------------------
  2260.     # ● 魔力石接口
  2261.     #------------------------------------------------------------------------
  2262.     unless self.materia.nil?
  2263.       return if is_materia?(item)
  2264.     end
  2265.     #------------------------------------------------------------------------
  2266.     # ● 效果範圍
  2267.     #------------------------------------------------------------------------
  2268.     text= phrase["scope"] + scope[item.scope]
  2269.     x = 0
  2270.     y += 1
  2271.     self.contents.font.color = normal_color
  2272.     self.contents.font.size = size
  2273.     self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2274.     #------------------------------------------------------------------------
  2275.     # ● 價格
  2276.     #------------------------------------------------------------------------
  2277.     x = 0
  2278.     y += 1      
  2279.     text = phrase["price"] + item.price.to_s
  2280.     self.contents.font.color = normal_color
  2281.     self.contents.font.size = size
  2282.     self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2283.  
  2284.     #------------------------------------------------------------------------
  2285.     # ● HP回復率
  2286.     #------------------------------------------------------------------------
  2287.     unless item.recover_hp_rate.zero?  
  2288.       x = 0
  2289.       y += 1
  2290.       text = phrase["recover_hp_rate"] + item.recover_hp_rate.to_s+"%"
  2291.       self.contents.font.color = normal_color
  2292.       self.contents.font.size = size
  2293.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)   
  2294.     end
  2295.     #------------------------------------------------------------------------
  2296.     # ● HP回復量
  2297.     #------------------------------------------------------------------------
  2298.     unless item.recover_hp.zero?  
  2299.       x = 0
  2300.       y += 1      
  2301.       text = phrase["recover_hp"] + item.recover_hp.to_s
  2302.       self.contents.font.color = normal_color
  2303.       self.contents.font.size = size
  2304.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2305.     end
  2306.     #------------------------------------------------------------------------
  2307.     # ● SP回復率
  2308.     #------------------------------------------------------------------------
  2309.     unless item.recover_sp_rate.zero?
  2310.       x = 0
  2311.       y += 1      
  2312.       text = phrase["recover_sp_rate"] + item.recover_sp_rate.to_s+"%"
  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.     #------------------------------------------------------------------------
  2318.     # ● SP回復量
  2319.     #------------------------------------------------------------------------
  2320.     unless item.recover_sp.zero?  
  2321.       x = 0
  2322.       y += 1      
  2323.       text = phrase["elements"] + item.recover_sp.to_s
  2324.       self.contents.font.color = normal_color
  2325.       self.contents.font.size = size
  2326.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2327.     end
  2328.     #------------------------------------------------------------------------
  2329.     # ● 能力值增加
  2330.     #------------------------------------------------------------------------
  2331.     unless item.parameter_type.zero?
  2332.       x = 0
  2333.       y += 1      
  2334.       text= parameter_type[item.parameter_type]+" +"+item.parameter_points.to_s
  2335.  
  2336.       self.contents.font.color = normal_color
  2337.       self.contents.font.size = size
  2338.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2339.     end
  2340.     #------------------------------------------------------------------------
  2341.     # ● 屬性
  2342.     #------------------------------------------------------------------------
  2343.     if element_set.size > 0
  2344.       x = 0
  2345.       y += 1
  2346.       text = phrase["elements"]
  2347.       for i in 0...element_set.size
  2348.         break if i > 4
  2349.         text += $data_system.elements[element_set[i]]
  2350.       end
  2351.       self.contents.font.color = normal_color
  2352.       self.contents.font.size = size
  2353.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2354.     end
  2355.     if element_set.size >= 5
  2356.       x = (phrase["elements"].size)*5-4
  2357.       y += 1
  2358.       text = ""
  2359.       for i in 4...element_set.size
  2360.         text += $data_system.elements[element_set[i]]
  2361.       end
  2362.       self.contents.font.color = normal_color
  2363.       self.contents.font.size = size
  2364.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2365.     end
  2366.     #------------------------------------------------------------------------
  2367.     # ● 狀態添加
  2368.     #------------------------------------------------------------------------
  2369.     unless plus_state_set.empty?
  2370.       text = phrase["plus"]
  2371.       x = 0
  2372.       y += 1
  2373.       self.contents.font.color = normal_color
  2374.       self.contents.font.size = size
  2375.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2376.       plus_state_set.each do |plus_state|
  2377.         y += 1
  2378.         text = $data_states[plus_state].name        
  2379.         self.contents.font.color = normal_color
  2380.         self.contents.font.size = size
  2381.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)      
  2382.       end  
  2383.     end
  2384.     #------------------------------------------------------------------------
  2385.     # ● 狀態解除
  2386.     #------------------------------------------------------------------------
  2387.     unless minus_state_set.empty?
  2388.       text = phrase["minus"]
  2389.       x = 0
  2390.       y += 1
  2391.       self.contents.font.color = normal_color
  2392.       self.contents.font.size = size
  2393.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2394.       minus_state_set.each do |minus_state|
  2395.         y += 1
  2396.         text = $data_states[minus_state].name
  2397.         self.contents.font.color = normal_color
  2398.         self.contents.font.size = size
  2399.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)   
  2400.       end
  2401.     end
  2402.   end
  2403.   #--------------------------------------------------------------------------
  2404.   # ● 技能帮助窗口
  2405.   #--------------------------------------------------------------------------
  2406.   def set_skill_text(skill)
  2407.     # 取得描述
  2408.     description = skill.description.clone
  2409.     # 取得屬性、附加狀態、解除狀態之副本
  2410.     element_set = skill.element_set.clone
  2411.     plus_state_set = skill.plus_state_set.clone
  2412.     minus_state_set = skill.minus_state_set.clone
  2413.     # 過濾不顯示的描述
  2414.     element_set -= @unshow_elements
  2415.     plus_state_set -= @unshow_states
  2416.     minus_state_set -= @unshow_states
  2417.     # 初始化設定
  2418.     x = 0
  2419.     y = 0
  2420.     h = 0
  2421.     phrase = {}
  2422.     scope = {}
  2423.  
  2424.     # 基本數據設定
  2425. =begin
  2426.     name_size = 名字文字大小
  2427.     size = 描述文字大小
  2428.     word = 每行的描述文字數
  2429.     move = 全體描述偏移幅度
  2430. =end
  2431.     name_size = 18
  2432.     size = 14
  2433.     word = 12
  2434.     move = 80
  2435.  
  2436.     # 基本文字設定
  2437.     phrase["scope"] = "范围:"
  2438.     #
  2439.     phrase["power"] = "威力:"
  2440.     phrase["cost_sp"] = "消耗SP:"
  2441.     phrase["hit_rate"] = "命中率:"
  2442.     phrase["elements"] = "攻击属性"
  2443.     #
  2444.     phrase["plus"] = "附加"
  2445.     phrase["minus"] = "解除"
  2446.     phrase["states"] = "状态"
  2447.     scope[0] = "特殊技能"
  2448.     scope[1] = "敌单体"
  2449.     scope[2] = "敌全体"
  2450.     scope[3] = "我方单体"
  2451.     scope[4] = "我方全体"
  2452.     scope[5] = "我方昏死(单体)"
  2453.     scope[6] = "我方昏死(全体)"
  2454.     scope[7] = "自身"
  2455.  
  2456.  
  2457.     #由描叙确定高
  2458.     h =description.size/3/word
  2459.     h += 1 if (description.size%3/word) > 0
  2460.     h += 4  #空行,效果范围,消费SP,命中率
  2461.     h += 1 unless skill.power.zero?
  2462.     h += 1 unless element_set.empty?
  2463.     h += 1 unless element_set[4].nil?
  2464.     h += plus_state_set.size
  2465.     h += minus_state_set.size
  2466.     #------------------------------------------------------------------------
  2467.     # ● 換算高度
  2468.     #------------------------------------------------------------------------
  2469.     self.height=h * size + name_size + 32  
  2470.     self.contents = Bitmap.new(self.width - 32,self.height - 32)
  2471.     self.contents.clear
  2472.  
  2473.     #------------------------------------------------------------------------
  2474.     # ● 名字描述
  2475.     #------------------------------------------------------------------------
  2476.     text = skill.name
  2477.     self.contents.font.color = Color.new(255, 255, 128, 255)
  2478.     self.contents.font.size = name_size
  2479.     if text!=nil
  2480.       self.visible = true
  2481.       self.contents.draw_text(0,0, text.size*7, name_size, text, 0)
  2482.     else
  2483.       self.visible = false
  2484.     end
  2485.  
  2486.     #------------------------------------------------------------------------
  2487.     # ● 說明描述
  2488.     #------------------------------------------------------------------------
  2489.     x = 0
  2490.     y += 1
  2491.     text = description
  2492.     while ((text = description.slice!(/./m)) != nil)
  2493.       self.contents.font.color = normal_color
  2494.       self.contents.font.size = size
  2495.       self.contents.draw_text(x*size, y*size+5, size, size, text, 0)
  2496.       x+=1
  2497.       if x==word#每行10个字
  2498.         x = 0
  2499.         y += 1      
  2500.       end
  2501.     end
  2502.  
  2503.     #------------------------------------------------------------------------
  2504.     # ● 攻擊範圍
  2505.     #------------------------------------------------------------------------
  2506.     text = phrase["scope"] + scope[skill.scope]
  2507.     x = 0
  2508.     y += 1
  2509.     self.contents.font.color = normal_color
  2510.     self.contents.font.size = size
  2511.     self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  2512.     #------------------------------------------------------------------------
  2513.     # ● 空一行
  2514.     #------------------------------------------------------------------------
  2515.     y += 1
  2516.     #------------------------------------------------------------------------
  2517.     # ● 威力描述
  2518.     #------------------------------------------------------------------------
  2519.     unless skill.power.zero?
  2520.       power = skill.power > 0 ? skill.power : -1 * skill.power
  2521.       text = phrase["power"] + power.to_s
  2522.       x = 0
  2523.       y += 1
  2524.       self.contents.font.color = normal_color
  2525.       self.contents.font.size = size  
  2526.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  2527.     end  
  2528.     #------------------------------------------------------------------------
  2529.     # ● 消費SP描述
  2530.     #------------------------------------------------------------------------
  2531.     text = phrase["cost_sp"] + skill.sp_cost.to_s
  2532.     x = 0
  2533.     y += 1
  2534.     self.contents.font.color = normal_color
  2535.     self.contents.font.size = size   
  2536.     self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  2537.     #------------------------------------------------------------------------
  2538.     # ● 命中率描述
  2539.     #------------------------------------------------------------------------
  2540.     text = phrase["hit_rate"] + skill.hit.to_s + "%"
  2541.     x = 0
  2542.     y += 1
  2543.     self.contents.font.color = normal_color
  2544.     self.contents.font.size = size
  2545.     self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  2546.     #------------------------------------------------------------------------
  2547.     # ● 攻擊屬性
  2548.     #------------------------------------------------------------------------
  2549.     if element_set.size > 0
  2550.       text=phrase["elements"]
  2551.       for i in 0...element_set.size
  2552.         if i < 4
  2553.           text+=$data_system.elements[element_set[i]]
  2554.         else
  2555.           break
  2556.         end        
  2557.       end
  2558.       x = 0
  2559.       y += 1
  2560.       self.contents.font.color = normal_color
  2561.       self.contents.font.size = size
  2562.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  2563.     end
  2564.     if element_set.size >= 5
  2565.       text=""
  2566.       for i in 4...element_set.size
  2567.         text+=$data_system.elements[element_set[i]]
  2568.       end
  2569.       x= (phrase["elements"].size)*3
  2570.       y += 1
  2571.       self.contents.font.color = normal_color
  2572.       self.contents.font.size = size
  2573.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  2574.     end
  2575.     #------------------------------------------------------------------------
  2576.     # ● 狀態附加
  2577.     #------------------------------------------------------------------------
  2578.     unless plus_state_set.empty?
  2579.       text= phrase["plus"]
  2580.       x = 0
  2581.       y += 1
  2582.       self.contents.font.color = normal_color
  2583.       self.contents.font.size = size
  2584.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  2585.       plus_state_set.each do |plus_state|
  2586.         y += 1
  2587.         text=$data_states[plus_state].name        
  2588.         self.contents.font.color = normal_color
  2589.         self.contents.font.size = size
  2590.         self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)        
  2591.       end  
  2592.     end
  2593.     #------------------------------------------------------------------------
  2594.     # ●狀態解除
  2595.     #------------------------------------------------------------------------
  2596.     unless minus_state_set.empty?
  2597.       text = phrase["minus"]
  2598.       x = 0
  2599.       y += 1
  2600.       self.contents.font.color = normal_color
  2601.       self.contents.font.size=size
  2602.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  2603.       minus_state_set.each do |minus_state|
  2604.         y += 1
  2605.         text=$data_states[minus_state].name        
  2606.         self.contents.font.color = normal_color
  2607.         self.contents.font.size=size
  2608.         self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)        
  2609.       end  
  2610.     end     
  2611.   end
  2612.   #--------------------------------------------------------------------------
  2613.   # ● 设置角色
  2614.   #     actor : 要显示状态的角色
  2615.   #--------------------------------------------------------------------------
  2616.   def set_actor(actor)
  2617.     if actor != @actor
  2618.       self.contents.clear
  2619.       draw_actor_name(actor, 4, 0)
  2620.       draw_actor_state(actor, 140, 0)
  2621.       draw_actor_hp(actor, 284, 0)
  2622.       draw_actor_sp(actor, 460, 0)
  2623.       @actor = actor
  2624.       @text = nil
  2625.       self.visible = true
  2626.     end
  2627.   end
  2628.   #--------------------------------------------------------------------------
  2629.   # ● 設置角色
  2630.   #     actor : 要顯示狀態之角色
  2631.   #--------------------------------------------------------------------------
  2632.   def set_actor(actor)
  2633.     self.contents = Bitmap.new(width - 32, height - 32) if self.contents.nil?
  2634.     if actor != @actor
  2635.       self.contents.clear
  2636.       draw_actor_name(actor, 4, 0)
  2637.       draw_actor_state(actor, 140, 0)
  2638.       draw_actor_hp(actor, 284, 0)
  2639.       draw_actor_sp(actor, 460, 0)
  2640.       @actor = actor
  2641.       @text = nil
  2642.       self.visible = true
  2643.     end
  2644.   end
  2645.   #--------------------------------------------------------------------------
  2646.   # ● 設置敵人
  2647.   #     enemy : 要顯示名字與狀態之敵人
  2648.   #--------------------------------------------------------------------------
  2649.   def set_enemy(enemy)
  2650.     self.contents = Bitmap.new(width - 32, height - 32) if self.contents.nil?
  2651.     text = enemy.name.sub(/\\[Ff]\[([0-9]+)\]/) {""}
  2652.     state_text = make_battler_state_text(enemy, 112, false)
  2653.     if state_text != ""
  2654.       text += "  " + state_text
  2655.     end
  2656.     set_text(text, 1)
  2657.     self.visible = true
  2658.   end
  2659.   #--------------------------------------------------------------------------
  2660.   # ● 校正帮助窗口位置
  2661.   #--------------------------------------------------------------------------
  2662.   def set_pos(x,y,width,oy,index,column_max)
  2663.     #光标坐标
  2664.     cursor_width = width / column_max - 32
  2665.     xx = index % column_max * (cursor_width + 32)
  2666.     yy = index / column_max * 32 - oy
  2667.     self.x=xx+x+150
  2668.     self.y=yy+y+30
  2669.     if self.x+self.width>640
  2670.       self.x=640-self.width
  2671.     end
  2672.     if self.y+self.height>480
  2673.       self.y=480-self.height
  2674.     end  
  2675.   end
  2676.   #------------------------------------------------------------------------
  2677.   # ● 裝備名字顔色變化 接口
  2678.   #------------------------------------------------------------------------
  2679.   def draw_name_color(equipment)
  2680.     return normal_color
  2681.   end
  2682.   #------------------------------------------------------------------------
  2683.   # ● 自身身份確認
  2684.   #------------------------------------------------------------------------
  2685.   def original_help?
  2686.     return false
  2687.   end
  2688. end
  2689.  
  2690. #------------------------------------------------------------------------------
  2691.  
  2692.  
  2693.  
  2694. #------------------------------------------------------------------------------
  2695. #==============================================================================
  2696. # ■ Window_Item
  2697. #------------------------------------------------------------------------------
  2698. #  物品画面、战斗画面、显示浏览物品的窗口。
  2699. #==============================================================================
  2700.  
  2701. class Window_Item < Window_Selectable
  2702.   #--------------------------------------------------------------------------
  2703.   # ● 初始化对像
  2704.   #--------------------------------------------------------------------------
  2705.   def initialize
  2706.     super(0, 64-64, 640, 416+64)
  2707.     @column_max = 2
  2708.     refresh
  2709.     self.index = 0
  2710.     # 战斗中的情况下将窗口移至中央并将其半透明化
  2711.     if $game_temp.in_battle
  2712.       self.y = 64
  2713.       self.height = 256
  2714.       self.back_opacity = 160
  2715.     end
  2716.   end
  2717.   #--------------------------------------------------------------------------
  2718.   # ● 刷新帮助文本
  2719.   #--------------------------------------------------------------------------
  2720.   def update_help
  2721.     @help_window.set_text(item)
  2722.     #校正帮助窗口位置
  2723.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  2724.   end
  2725. end
  2726. #------------------------------------------------------------------------------
  2727.  
  2728.  
  2729.  
  2730. #------------------------------------------------------------------------------
  2731. #==============================================================================
  2732. # ■ Window_Skill
  2733. #------------------------------------------------------------------------------
  2734. #  特技画面、战斗画面、显示可以使用的特技浏览的窗口。
  2735. #==============================================================================
  2736.  
  2737. class Window_Skill < Window_Selectable
  2738.   #--------------------------------------------------------------------------
  2739.   # ● 初始化对像
  2740.   #     actor : 角色
  2741.   #--------------------------------------------------------------------------
  2742.   def initialize(actor)
  2743.     super(0, 128, 640, 352)
  2744.     @actor = actor
  2745.     @column_max = 2
  2746.  
  2747.     refresh
  2748.     self.index = 0
  2749.     # 战斗中的情况下将窗口移至中央并将其半透明化
  2750.     if $game_temp.in_battle
  2751.       self.y = 64
  2752.       self.height = 256
  2753.       self.back_opacity = 160
  2754.     end
  2755.   end
  2756.   #--------------------------------------------------------------------------
  2757.   # ● 刷新帮助文本
  2758.   #--------------------------------------------------------------------------
  2759.  
  2760.   def update_help
  2761.     @help_window.set_text(skill)
  2762.     #校正帮助窗口位置
  2763.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  2764.   end
  2765. end
  2766. #------------------------------------------------------------------------------
  2767.  
  2768.  
  2769.  
  2770. #------------------------------------------------------------------------------
  2771. #==============================================================================
  2772. # ■ Window_SkillStatus
  2773. #------------------------------------------------------------------------------
  2774. #  显示特技画面、特技使用者的窗口。
  2775. #==============================================================================
  2776.  
  2777. class Window_SkillStatus < Window_Base
  2778.   #--------------------------------------------------------------------------
  2779.   # ● 初始化对像
  2780.   #     actor : 角色
  2781.   #--------------------------------------------------------------------------
  2782.   def initialize(actor)
  2783. # -------------------
  2784. # 修改開始
  2785.     super(0, 64-64, 640, 64+64)#★★★★★★★★★★★★★★★★★★★★
  2786. # 修改終了
  2787. # -------------------
  2788.     self.contents = Bitmap.new(width - 32, height - 32)
  2789.     @actor = actor
  2790.     refresh
  2791.   end
  2792. end
  2793. #------------------------------------------------------------------------------
  2794.  
  2795.  
  2796.  
  2797. #------------------------------------------------------------------------------
  2798. #==============================================================================
  2799. # ■ Window_EquipLeft
  2800. #------------------------------------------------------------------------------
  2801. #  装备画面的、显示角色能力值变化的窗口。
  2802. #==============================================================================
  2803. class Window_EquipLeft < Window_Base
  2804.   #--------------------------------------------------------------------------
  2805.   # ● 初始化对像
  2806.   #     actor : 角色
  2807.   #--------------------------------------------------------------------------
  2808.   def initialize(actor)
  2809. # -------------------
  2810. # 修改開始
  2811.     super(0, 64-64, 272, 416+64)#★★★★★★★★★★★★★★★★★★★★
  2812. # 修改終了
  2813. # -------------------
  2814.     self.contents = Bitmap.new(width - 32, height - 32)
  2815.     @actor = actor
  2816.     refresh
  2817.   end
  2818. end
  2819. #------------------------------------------------------------------------------
  2820.  
  2821.  
  2822.  
  2823. #------------------------------------------------------------------------------
  2824. #==============================================================================
  2825. # ■ Window_EquipRight
  2826. #------------------------------------------------------------------------------
  2827. #  装备画面、显示角色现在装备的物品的窗口。
  2828. #==============================================================================
  2829.  
  2830. class Window_EquipRight < Window_Selectable
  2831.   #--------------------------------------------------------------------------
  2832.   # ● 初始化对像
  2833.   #     actor : 角色
  2834.   #--------------------------------------------------------------------------
  2835.   def initialize(actor)
  2836. # -------------------
  2837. # 修改開始
  2838.     super(272, 64-64, 368, 256+64)#★★★★★★★★★★★★★★★★★★★★
  2839. # 修改終了
  2840. # -------------------
  2841.     self.contents = Bitmap.new(width - 32, height - 32)
  2842.     @actor = actor
  2843.     refresh
  2844.     self.index = 0
  2845.   end
  2846.   #--------------------------------------------------------------------------
  2847.   # ● 刷新帮助文本
  2848.   #--------------------------------------------------------------------------
  2849.  
  2850.   def update_help
  2851.     @help_window.set_text(item)
  2852.     #校正帮助窗口位置
  2853.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  2854.   end
  2855. end
  2856. #------------------------------------------------------------------------------
  2857.  
  2858.  
  2859.  
  2860. #------------------------------------------------------------------------------
  2861. #==============================================================================
  2862. # ■ Window_EquipItem
  2863. #------------------------------------------------------------------------------
  2864. #  装备画面、显示浏览变更装备的候补物品的窗口。
  2865. #==============================================================================
  2866.  
  2867. class Window_EquipItem < Window_Selectable
  2868.   #--------------------------------------------------------------------------
  2869.   # ● 初始化对像
  2870.   #     actor      : 角色
  2871.   #     equip_type : 装备部位 (0~3)
  2872.   #--------------------------------------------------------------------------
  2873.   def initialize(actor, equip_type)
  2874. # -------------------
  2875. # 修改開始
  2876.     super(272, 320, 368, 160)#★★★★★★★★★★★★★★★★★★★★
  2877. # 修改終了
  2878. # -------------------
  2879.     @actor = actor
  2880.     @equip_type = equip_type
  2881.     @column_max = 1
  2882.  
  2883.     refresh
  2884.     self.active = false
  2885.     self.index = -1
  2886.   end
  2887.   def update_help
  2888.     @help_window.set_text(item)
  2889.     #校正帮助窗口位置
  2890.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  2891.   end
  2892. end
  2893. #------------------------------------------------------------------------------
  2894.  
  2895.  
  2896.  
  2897. #------------------------------------------------------------------------------
  2898. #==============================================================================
  2899. # ■ Window_ShopCommand
  2900. #------------------------------------------------------------------------------
  2901. #  商店画面、选择要做的事的窗口
  2902. #==============================================================================
  2903.  
  2904. class Window_ShopCommand < Window_Selectable
  2905.   #--------------------------------------------------------------------------
  2906.   # ● 初始化对像
  2907.   #--------------------------------------------------------------------------
  2908.   def initialize
  2909. # -------------------
  2910. # 修改開始
  2911.     super(0, 64-64, 480, 64)#★★★★★★★★★★★★★★★★★
  2912. # 修改終了
  2913. # -------------------
  2914.     self.contents = Bitmap.new(width - 32, height - 32)
  2915.     @item_max = 3
  2916.     @column_max = 3
  2917.     @commands = ["买", "卖", "取消"]
  2918.     refresh
  2919.     self.index = 0
  2920.   end
  2921. end
  2922. #------------------------------------------------------------------------------
  2923.  
  2924.  
  2925.  
  2926. #------------------------------------------------------------------------------
  2927. #========================================================================================================================
  2928. # ■ Window_ShopBuy
  2929. #------------------------------------------------------------------------------
  2930. #  商店画面、浏览显示可以购买的商品的窗口。
  2931. #==============================================================================
  2932.  
  2933. class Window_ShopBuy < Window_Selectable
  2934.   #--------------------------------------------------------------------------
  2935.   # ● 初始化对像
  2936.   #     shop_goods : 商品
  2937.   #--------------------------------------------------------------------------
  2938.   def initialize(shop_goods)
  2939. # -------------------
  2940. # 修改開始
  2941.     super(0, 128-64, 368, 352+64)#★★★★★★★★★★★★★★★★
  2942. # 修改終了
  2943. # -------------------
  2944.     @shop_goods = shop_goods
  2945.  
  2946.     refresh
  2947.     self.index = 0
  2948.   end
  2949.   #--------------------------------------------------------------------------
  2950.   # ● 刷新帮助文本
  2951.   #--------------------------------------------------------------------------
  2952.  
  2953.   def update_help
  2954.     @help_window.set_text(item)
  2955.     #校正帮助窗口位置
  2956.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  2957.   end
  2958. end
  2959. #------------------------------------------------------------------------------
  2960.  
  2961.  
  2962.  
  2963. #------------------------------------------------------------------------------
  2964. #==============================================================================
  2965. # ■ Window_ShopSell
  2966. #------------------------------------------------------------------------------
  2967. #  商店画面、浏览显示可以卖掉的商品的窗口。
  2968. #==============================================================================
  2969.  
  2970. class Window_ShopSell < Window_Selectable
  2971.   #--------------------------------------------------------------------------
  2972.   # ● 初始化对像
  2973.   #--------------------------------------------------------------------------
  2974.   def initialize
  2975. # -------------------
  2976. # 修改開始
  2977.     super(0, 128-64, 640, 352+64)#★★★★★★★★★★★★★★★★
  2978. # 修改終了
  2979. # -------------------
  2980.     @column_max = 2
  2981.  
  2982.     refresh
  2983.     self.index = 0
  2984.   end
  2985.   #--------------------------------------------------------------------------
  2986.   # ● 刷新帮助文本
  2987.   #--------------------------------------------------------------------------
  2988.  
  2989.   def update_help
  2990.     @help_window.set_text(item)
  2991.     #校正帮助窗口位置
  2992.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  2993.   end
  2994. end
  2995. #------------------------------------------------------------------------------
  2996.  
  2997.  
  2998.  
  2999. #------------------------------------------------------------------------------
  3000. #==============================================================================
  3001. # ■ Window_ShopNumber
  3002. #------------------------------------------------------------------------------
  3003. #  商店画面、输入买卖数量的窗口。
  3004. #==============================================================================
  3005. class Window_ShopNumber < Window_Base
  3006.   #--------------------------------------------------------------------------
  3007.   # ● 初始化对像
  3008.   #--------------------------------------------------------------------------
  3009.   def initialize
  3010. # -------------------
  3011. # 修改開始
  3012.     super(0, 128-64, 368, 352+64)#★★★★★★★★★★★★★★★★
  3013. # 修改終了
  3014. # -------------------
  3015.     self.contents = Bitmap.new(width - 32, height - 32)
  3016.     @item = nil
  3017.     @max = 1
  3018.     @price = 0
  3019.     @number = 1
  3020.   end
  3021. end
  3022. #------------------------------------------------------------------------------
  3023.  
  3024.  
  3025.  
  3026. #------------------------------------------------------------------------------
  3027. #==============================================================================
  3028. # ■ Window_ShopStatus
  3029. #------------------------------------------------------------------------------
  3030. #  商店画面、显示物品所持数与角色装备的窗口。
  3031. #==============================================================================
  3032.  
  3033. class Window_ShopStatus < Window_Base
  3034.   #--------------------------------------------------------------------------
  3035.   # ● 初始化对像
  3036.   #--------------------------------------------------------------------------
  3037.   def initialize
  3038. # -------------------
  3039. # 修改開始
  3040.     super(368, 128-64, 272, 352+64)#★★★★★★★★★★★★
  3041. # 修改終了
  3042. # -------------------
  3043.     self.contents = Bitmap.new(width - 32, height - 32)
  3044.     @item = nil
  3045.     refresh
  3046.   end
  3047. end
  3048. #------------------------------------------------------------------------------
  3049.  
  3050.  
  3051.  
  3052. #------------------------------------------------------------------------------
  3053. #==============================================================================
  3054. # ■ Scene_Equip
  3055. #------------------------------------------------------------------------------
  3056. #  处理装备画面的类。
  3057. #==============================================================================
  3058.  
  3059. class Scene_Equip
  3060.   #--------------------------------------------------------------------------
  3061.   # ● 刷新画面 (右侧窗口被激活的情况下)
  3062.   #--------------------------------------------------------------------------
  3063.   def update_right
  3064. # -------------------
  3065. # 修改開始
  3066.     if @right_window.item==nil
  3067.         @help_window.visible=false
  3068.     else
  3069.         @help_window.visible=true
  3070.     end
  3071. # 修改終了
  3072. # -------------------
  3073.     # 按下 B 键的情况下
  3074.     if Input.trigger?(Input::B)
  3075.       # 演奏取消 SE
  3076.       $game_system.se_play($data_system.cancel_se)
  3077.       # 切换到菜单画面
  3078.       $scene = Scene_Menu.new(2)
  3079.       return
  3080.     end
  3081.     # 按下 C 键的情况下
  3082.     if Input.trigger?(Input::C)
  3083.       # 固定装备的情况下
  3084.       if @actor.equip_fix?(@right_window.index)
  3085.         # 演奏冻结 SE
  3086.         $game_system.se_play($data_system.buzzer_se)
  3087.         return
  3088.       end
  3089.       # 演奏确定 SE
  3090.       $game_system.se_play($data_system.decision_se)
  3091.       # 激活物品窗口
  3092.       @right_window.active = false
  3093.       @item_window.active = true
  3094.       @item_window.index = 0
  3095.       return
  3096.     end
  3097.     # 按下 R 键的情况下
  3098.     if Input.trigger?(Input::R)
  3099.       # 演奏光标 SE
  3100.       $game_system.se_play($data_system.cursor_se)
  3101.       # 移至下一位角色
  3102.       @actor_index += 1
  3103.       @actor_index %= $game_party.actors.size
  3104.       # 切换到别的装备画面
  3105.       $scene = Scene_Equip.new(@actor_index, @right_window.index)
  3106.       return
  3107.     end
  3108.     # 按下 L 键的情况下
  3109.     if Input.trigger?(Input::L)
  3110.       # 演奏光标 SE
  3111.       $game_system.se_play($data_system.cursor_se)
  3112.       # 移至上一位角色
  3113.       @actor_index += $game_party.actors.size - 1
  3114.       @actor_index %= $game_party.actors.size
  3115.       # 切换到别的装备画面
  3116.       $scene = Scene_Equip.new(@actor_index, @right_window.index)
  3117.       return
  3118.     end
  3119.   end
  3120.   #--------------------------------------------------------------------------
  3121.   # ● 刷新画面 (物品窗口被激活的情况下)
  3122.   #--------------------------------------------------------------------------
  3123.   def update_item
  3124. # -------------------
  3125. # 修改開始
  3126.     if @item_window.item==nil
  3127.         @help_window.visible=false
  3128.     else
  3129.         @help_window.visible=true
  3130.     end
  3131. # 修改終了
  3132. # -------------------
  3133.     # 按下 B 键的情况下
  3134.     if Input.trigger?(Input::B)
  3135.       # 演奏取消 SE
  3136.       $game_system.se_play($data_system.cancel_se)
  3137.       # 激活右侧窗口
  3138.       @right_window.active = true
  3139.       @item_window.active = false
  3140.       @item_window.index = -1
  3141.       return
  3142.     end
  3143.     # 按下 C 键的情况下
  3144.     if Input.trigger?(Input::C)
  3145.       # 演奏装备 SE
  3146.       $game_system.se_play($data_system.equip_se)
  3147.       # 获取物品窗口现在选择的装备数据
  3148.       item = @item_window.item
  3149.       # 变更装备
  3150.       @actor.equip(@right_window.index, item == nil ? 0 : item.id)
  3151.       # 激活右侧窗口
  3152.       @right_window.active = true
  3153.       @item_window.active = false
  3154.       @item_window.index = -1
  3155.       # 再生成右侧窗口、物品窗口的内容
  3156.       @right_window.refresh
  3157.       @item_window.refresh
  3158.       return
  3159.     end
  3160.   end
  3161. end
  3162. #------------------------------------------------------------------------------
  3163.  
  3164.  
  3165.  
  3166. #------------------------------------------------------------------------------
  3167. #========================================================================================================================
  3168. # ■ Scene_Battle (分割定义 3)
  3169. #------------------------------------------------------------------------------
  3170. #  处理战斗画面的类。
  3171. #========================================================================================================================
  3172.  
  3173. class Scene_Battle
  3174.   #--------------------------------------------------------------------------
  3175.   # ● 刷新画面 (角色命令回合 : 选择特技)
  3176.   #--------------------------------------------------------------------------
  3177.   alias first_reupdate_phase3_skill_select update_phase3_skill_select
  3178.   def update_phase3_skill_select
  3179. # -------------------
  3180. # 修改開始
  3181.     @skill_window.help_window.visible = false#★★★★★★★★★★★★★
  3182. # 修改終了
  3183. # -------------------
  3184.     first_reupdate_phase3_skill_select
  3185.   end
  3186.   #--------------------------------------------------------------------------
  3187.   # ● 刷新画面 (角色命令回合 : 选择物品)
  3188.   #--------------------------------------------------------------------------
  3189.   alias first_reupdate_phase3_item_select update_phase3_item_select  
  3190.   def update_phase3_item_select
  3191. # -------------------
  3192. # 修改開始
  3193.     @item_window.help_window.visible = false#★★★★★★★★★★★★
  3194. # 修改終了
  3195. # -------------------
  3196.     first_reupdate_phase3_item_select
  3197.   end
  3198.   #--------------------------------------------------------------------------
  3199.   # ● 开始选择特技
  3200.   #--------------------------------------------------------------------------
  3201.   def start_skill_select
  3202.     @skill_window = Window_Skill.new(@active_battler)
  3203.     @skill_window.help_window = Window_Help.new
  3204.     @actor_command_window.active = false
  3205.     @actor_command_window.visible = false
  3206.   end
  3207.   #--------------------------------------------------------------------------
  3208.   # ● 选择特技结束
  3209.   #--------------------------------------------------------------------------
  3210.   alias first_update_end_skill_select end_skill_select  
  3211.   def end_skill_select
  3212. # -------------------
  3213. # 修改開始
  3214.     @skill_window.help_window.visible = false#★★★★★★★★★★★★
  3215. # 修改終了
  3216. # -------------------
  3217.     first_update_end_skill_select
  3218.   end
  3219.   #--------------------------------------------------------------------------
  3220.   # ● 开始选择物品
  3221.   #--------------------------------------------------------------------------
  3222.   def start_item_select
  3223.     # 生成物品窗口
  3224.     @item_window = Window_Item.new
  3225.     # 关联帮助窗口
  3226. # -------------------
  3227. # 修改開始
  3228.     @item_window.help_window =  Window_Help.new#★★★★★★★★★★★★
  3229. # 修改終了
  3230. # -------------------
  3231.     # 无效化角色指令窗口
  3232.     @actor_command_window.active = false
  3233.     @actor_command_window.visible = false
  3234.   end
  3235.   #--------------------------------------------------------------------------
  3236.   # ● 结束选择物品
  3237.   #--------------------------------------------------------------------------
  3238.   alias first_update_end_item_select end_item_select
  3239.   def end_item_select
  3240. # -------------------
  3241. # 修改開始
  3242.     @item_window.help_window.visible = false#★★★★★★★★★★★★
  3243. # 修改終了
  3244. # -------------------
  3245.     first_update_end_item_select
  3246.   end
  3247. end
  3248. #------------------------------------------------------------------------------
  3249.  
  3250.  
  3251.  
  3252. #------------------------------------------------------------------------------
  3253. #==============================================================================
  3254. # ■ Scene_Shop
  3255. #------------------------------------------------------------------------------
  3256. #  处理商店画面的类。
  3257. #==============================================================================
  3258.  
  3259. class Scene_Shop
  3260.   #--------------------------------------------------------------------------
  3261.   # ● 主处理
  3262.   #--------------------------------------------------------------------------
  3263. # --------------------
  3264. # 衝突可能
  3265.   def main
  3266.     # 生成帮助窗口
  3267. # -------------------
  3268. # 修改開始
  3269.     @help_window = Window_Help.new#★★★★★★★★★★★★★★★★
  3270. # 修改終了
  3271. # -------------------
  3272.     # 生成指令窗口
  3273.     @command_window = Window_ShopCommand.new
  3274.     # 生成金钱窗口
  3275.     @gold_window = Window_Gold.new
  3276.     @gold_window.x = 480
  3277. # -------------------
  3278. # 修改開始
  3279.     @gold_window.y = 64-64#★★★★★★★★★★★★★
  3280. # 修改終了
  3281. # -------------------
  3282.     # 生成时间窗口
  3283. # -------------------
  3284. # 修改開始
  3285.     @dummy_window = Window_Base.new(0, 128-64, 640, 352+64)#★★★★★★★★★★★★★
  3286. # 修改終了
  3287. # -------------------
  3288.     # 生成购买窗口
  3289.     @buy_window = Window_ShopBuy.new($game_temp.shop_goods)
  3290.     @buy_window.active = false
  3291.     @buy_window.visible = false
  3292.     @buy_window.help_window = @help_window
  3293.     # 生成卖出窗口
  3294.     @sell_window = Window_ShopSell.new
  3295.     @sell_window.active = false
  3296.     @sell_window.visible = false
  3297.     @sell_window.help_window = @help_window
  3298.     # 生成数量输入窗口
  3299.     @number_window = Window_ShopNumber.new
  3300.     @number_window.active = false
  3301.     @number_window.visible = false
  3302.     # 生成状态窗口
  3303.     @status_window = Window_ShopStatus.new
  3304.     @status_window.visible = false
  3305.     # 执行过渡
  3306.     Graphics.transition
  3307.     # 主循环
  3308.     loop do
  3309.       # 刷新游戏画面
  3310.       Graphics.update
  3311.       # 刷新输入信息
  3312.       Input.update
  3313.       # 刷新画面
  3314.       update
  3315.       # 如果画面切换的话就中断循环
  3316.       if $scene != self
  3317.         break
  3318.       end
  3319.     end
  3320.     # 准备过渡
  3321.     Graphics.freeze
  3322.     # 释放窗口
  3323.     @help_window.dispose
  3324.     @command_window.dispose
  3325.     @gold_window.dispose
  3326.     @dummy_window.dispose
  3327.     @buy_window.dispose
  3328.     @sell_window.dispose
  3329.     @number_window.dispose
  3330.     @status_window.dispose
  3331.   end
  3332.   #--------------------------------------------------------------------------
  3333.   # ● 刷新画面
  3334.   #--------------------------------------------------------------------------
  3335. # --------------------
  3336. # 衝突可能
  3337.   def update
  3338.     # 刷新窗口
  3339.     @help_window.update
  3340.     @command_window.update
  3341.     @gold_window.update
  3342.     @dummy_window.update
  3343.     @buy_window.update
  3344.     @sell_window.update
  3345.     @number_window.update
  3346.     @status_window.update
  3347.     # 指令窗口激活的情况下: 调用 update_command
  3348.     if @command_window.active
  3349. # -------------------
  3350. # 修改開始
  3351.       @help_window.visible=false#★★★★★★★★★★★★★★★★
  3352. # 修改終了
  3353. # -------------------
  3354.       update_command
  3355.       return
  3356.     end
  3357.     # 购买窗口激活的情况下: 调用 update_buy
  3358.     if @buy_window.active
  3359. # -------------------
  3360. # 修改開始
  3361.       @help_window.visible=true#★★★★★★★★★★★★★★★★
  3362.       if @buy_window.item==nil#★★★★★★★★★★★★★★★★
  3363.         @help_window.visible=false#★★★★★★★★★★★★★★★★
  3364.       end #★★★★★★★★★★★★★★★★     
  3365. # 修改終了
  3366. # -------------------
  3367.       update_buy
  3368.       return
  3369.     end
  3370.     # 卖出窗口激活的情况下: 调用 update_sell
  3371.     if @sell_window.active
  3372. # -------------------
  3373. # 修改開始
  3374.       @help_window.visible=true#★★★★★★★★★★★★★★★★
  3375.       if @sell_window.item==nil#★★★★★★★★★★★★★★★★
  3376.         @help_window.visible=false#★★★★★★★★★★★★★★★★
  3377.       end #★★★★★★★★★★★★★★★★
  3378. # 修改終了
  3379. # -------------------      
  3380.       update_sell
  3381.       return
  3382.     end
  3383.     # 个数输入窗口激活的情况下: 调用 update_number
  3384.     if @number_window.active
  3385. # -------------------
  3386. # 修改開始
  3387.       @help_window.visible=false#★★★★★★★★★★★★★★★★
  3388. # 修改終了
  3389. # -------------------
  3390.       update_number
  3391.       return
  3392.     end
  3393.   end
  3394. end
  3395. =begin
  3396.   #--------------------------------------------------------------------------
  3397.  # ● 人物行走图做战斗图像(附加动画) ver1.02
  3398.   #--------------------------------------------------------------------------
  3399.   制作者 らい
  3400.   翻译:忧郁的涟漪
  3401.  
  3402.     
  3403.   图像文件的规格
  3404.  
  3405.   ● 巴特勒图像(似乎指的是战斗图像)
  3406.  
  3407.   使用步行图片。
  3408.    
  3409.   ● 武器的图像
  3410.  
  3411.   就是武器图标的图像(ICO图)  
  3412.       
  3413.  
  3414. ###############################################################################
  3415. 行走图横版战斗:
  3416. ------------------------------------------------------------------------------
  3417. 经过了两次的修改,终于完全实现了远距离攻击的效果(弓箭、铳类)
  3418. 另外,也实现了简单的回旋攻击(类似回力镖的攻击)和攻击道具(类似石头或炸弹)
  3419.  
  3420. 这个脚本的更动分为2部分:
  3421. 1)战斗动作 - 新加了数个动作,如:“弓箭攻击”、“远距离发动”等等
  3422. 2)战斗动画 - 基本上是脚本原带的。只是这个功能被隐藏起来了。现在已恢复。
  3423.  
  3424. 用法:
  3425. 在相应的脚本行加入武器/技能/道具的数据库id(id之间要用“,”来分开)
  3426. 如果不要某些功能的话就随便填一个外太空id就行了(没有用到的id)
  3427. 1)战斗动作(角色/行走图的动作)
  3428. 脚本355行:  远程武器的id  (普通攻击时使用远程射击)
  3429. 脚本357行:  回旋武器的id  (普通攻击时会飞回手上的武器,如:回力镖)
  3430. 脚本370行:  远程技能的id  (使用技能时是远程射击)
  3431. 脚本372行:  回旋技能的id  (使用技能时,飞出的武器会飞回手上)
  3432.  
  3433. 2)战斗动画(显示‘对象方的动画’之前先显示‘飞行武器射去敌人身上’的动画)
  3434. 脚本453行:  回旋武器的id  (攻击时会显示一段类似回力镖的动画)
  3435. 脚本455行:  弓箭武器的id  (攻击时会显示箭射去敌人身上的动画)
  3436. 脚本457行:  铳类武器的id  (攻击时会显示子弹射去敌人身上的动画)
  3437. 脚本470行:  回旋技能的id  (技能使用时会显示一段类似回力镖的动画)
  3438. 脚本472行:  弓箭技能的id  (技能使用时会显示箭射去敌人身上的动画)
  3439. 脚本474行:  铳类技能的id  (技能使用时会显示子弹射去敌人身上的动画)
  3440. 脚本486行:  抛击道具的id  (使用该道具时,道具被丢到敌人身上)
  3441.  
  3442. 〉注意:
  3443. 〉‘飞行武器射去敌人身上’的动画是在设定id之后的那句脚本里面设置
  3444. 〉例子:(脚本第455和456行)
  3445. 〉       when 17,18,19,20    #远程武器1(弓箭类)的id
  3446. 〉       return [101,32,false,false]
  3447. 〉这样,武器17~20(都是弓箭)在显示‘对象方的动画’之前会先显示第101号动画
  3448. 〉而动画的轨道是从使用者身上直到敌人身上(实现子弹射出的效果)
  3449.  
  3450. 还有:
  3451. 战斗队伍的画面位置已经被修改过,
  3452. 让角色的位置与默认的战斗背景图不会有视觉上的冲突。
  3453. 如果要更改请去脚本第113-116行改改就行了。
  3454.  
  3455. 脚本‘Arrow_Enemy’和‘Arrow_Actor’被稍微修改过(可以无视)
  3456.  
  3457. 这个范例附带了
  3458. 一张经过修改的战斗背景图(027-castle03),其他的战斗背景图可以使用默认的。
  3459. 一套横版的默认敌人的战斗图(从行走图改过来的)
  3460.  
  3461. =end                                                        #modify by darkten
  3462. ###############################################################################
  3463.  
  3464. module Side_view
  3465.   #--------------------------------------------------------------------------
  3466.   # ● 是否与RATB并用 ☆自动识别(这到是不错~省了~)
  3467.   #    在Scene_Battle计算方法是否是方法synthe?
  3468.   #    在自动不想认识的时候,请重写。
  3469.   #--------------------------------------------------------------------------
  3470.   if Scene_Battle.method_defined?("synthe?")
  3471.     RTAB = true
  3472.   else
  3473.     RTAB = false
  3474.   end
  3475.   #--------------------------------------------------------------------------
  3476.   # ● 改正RATB中的位置误差 ☆自动识别
  3477.   #    在自动不想认识的时候,请重写。
  3478.   #--------------------------------------------------------------------------
  3479.   def camera_correctness
  3480.     return false if !RTAB
  3481.     begin
  3482.       return $scene.drive
  3483.     rescue
  3484.       return false
  3485.     end
  3486.   end
  3487.   #--------------------------------------------------------------------------
  3488.   # ● 队伍中的最大人数
  3489.   #--------------------------------------------------------------------------
  3490.   Party_max = 4
  3491.   #--------------------------------------------------------------------------
  3492.   # ● 战斗图的扩大率(1.0的时候是保持原有大小)
  3493.   #--------------------------------------------------------------------------
  3494.   CHAR_ZOOM = 1.0
  3495.   #--------------------------------------------------------------------------
  3496.   # ● 光标的位置修正(基本不需要改~)
  3497.   #--------------------------------------------------------------------------
  3498.   ARROW_OX = 0
  3499.   ARROW_OY = 64
  3500.   #--------------------------------------------------------------------------
  3501.   # ● 名状态作为飞行管理的排列(不知道什么意思....)
  3502.   #--------------------------------------------------------------------------
  3503.   FLY_STATES = ["飛行"]
  3504.   #--------------------------------------------------------------------------
  3505.   # ● 战斗画面的位置
  3506.   #--------------------------------------------------------------------------
  3507.   PARTY_X = 455     # 队伍 X 位置
  3508.   PARTY_Y = 200     # 队伍 Y 位置
  3509.   FORMATION_X = 15  # 各个角色之间的间隔 X
  3510.   FORMATION_Y = 35  # 各个角色之间的间隔 Y
  3511.   #--------------------------------------------------------------------------
  3512.   # ● 自定义常数
  3513.   #--------------------------------------------------------------------------
  3514.   NORMAL   = "NORMAL"
  3515.   WALK_R   = "WALK_R"
  3516.   WALK_L   = "WALK_L"
  3517.   ATTACK   = "ATTACK"
  3518.   ATTACK_R = "ATTACK_R"
  3519.   ATTACK_L = "ATTACK_L"
  3520.   MAGIC    = "MAGIC"
  3521.   ITEM     = "ITEM"
  3522.   # 动画的设定
  3523.   ANIME = {
  3524.     # [画像ID,是否循环,アニメスピード,动画速度,不能指向动画,武器放在右手or左手]
  3525.     NORMAL            => [1,true , 0,false, true ,""    ], # 通常待击
  3526.     WALK_R            => [2,true , 2,false, false,""    ], # 右移动
  3527.     WALK_L            => [1,true , 2,false, false,""    ], # 左移动
  3528.     ATTACK_R          => [1,false, 2,true , false,"右手"], # 右手攻击
  3529.     ATTACK_L          => [1,false, 2,true , false,"左手"], # 左手攻击
  3530.     MAGIC             => [1,false, 2,false, false,""    ], # 右手攻击
  3531.     ITEM              => [1,false, 2,false, false,""    ], # 左手攻击
  3532.     }
  3533.  
  3534.   # 债务不履行声明价值的设定(一个字一个字翻译的,不知道啥意思)  
  3535.   ANIME.default = [1,false,12,false,"",""]
  3536.  
  3537.   # 在行动设定的时候 右手攻击 or 左手攻击 辨别を(这个不知道什么意思)的ANIME
  3538.   # "角色动画变更#ATTACK"在玩了と(还是不知道啥意思..)的时候,辨别ATTACK_R或者ATTACK_L
  3539.   DUAL_WEAPONS_ANIME = [ATTACK]
  3540.  
  3541.   #--------------------------------------------------------------------------
  3542.   # ● 摇晃的设定
  3543.   #--------------------------------------------------------------------------
  3544.   SHAKE_FILE = "摇晃"  # 文件名
  3545.   SHAKE_POWER = 5          # 强度
  3546.   SHAKE_SPEED = 5          # 速度
  3547.   SHAKE_DURATION = 5      # 时间
  3548.   #--------------------------------------------------------------------------
  3549.   # ● 上下反转地的设定
  3550.   #--------------------------------------------------------------------------
  3551.   UPSIDE_DOWN_FILE = "上下反转" # 文件名
  3552.   #--------------------------------------------------------------------------
  3553.   # ● 左右反转地的设定
  3554.   #--------------------------------------------------------------------------
  3555.   REVERSE_FILE = "左右反转" # 文件名
  3556.   #--------------------------------------------------------------------------
  3557.   # ● 回转地的设定
  3558.   #--------------------------------------------------------------------------
  3559.   TURNING_FILE = "回转" # 文件名
  3560.   TURNING_DIRECTION = 1 # 方向(1.逆时针,-1.顺时针)(|||-_-汗..怎么还有用-1做带入值的...)
  3561.   TURNING_SPEED = 40    # 速度
  3562.   TURNING_DURATION = 1  # 回转数
  3563.   #--------------------------------------------------------------------------
  3564.   # ● 移动的设定
  3565.   #--------------------------------------------------------------------------
  3566.   MOVE_FILE = "移动"             # 文件名
  3567.   MOVE_RETURN = 1                # 回到原来的位置吗?(光写了个1,也不知道不回到该怎么写?0?)
  3568.   MOVE_SPEED = 32                # 速度
  3569.   MOVE_COORDINATES = [0,-640]    # 原来位置的相对坐标
  3570.   #--------------------------------------------------------------------------
  3571.   # ● 动画追加的设定
  3572.   #--------------------------------------------------------------------------
  3573.   ADD_ANIME_FILE = "动画追加"  # 文件名
  3574.   ADD_ANIME_ID = 0               # 动画的ID
  3575.   #--------------------------------------------------------------------------
  3576.   # ● 债务不履行声明和RTAB的数据转换
  3577.   #--------------------------------------------------------------------------
  3578.   def convert_battler
  3579.     return RTAB ? @active_actor : @active_battler
  3580.   end
  3581.   #--------------------------------------------------------------------------
  3582.   # ● 债务不履行声明和RTAB的数据转换2
  3583.   #--------------------------------------------------------------------------
  3584.   def convert_battler2(*arg)
  3585.     return RTAB ? arg[0] : @active_battler
  3586.   end
  3587. end
  3588.  
  3589. #--------------------------------------------------------------------------
  3590. # ● 行动設定
  3591. #--------------------------------------------------------------------------
  3592. module BattleActions
  3593.  
  3594.   # 下のものはあくまでも一例なので
  3595.   # 独自に作ってください。
  3596.  
  3597.   Actions = {
  3598.  
  3599.   "通常攻撃" => [
  3600.  
  3601.   "閃きアニメ",
  3602.   "アクターアニメ変更#WALK_L",
  3603.   "移動#target,32,0,64,0",
  3604.   "行動アニメ",
  3605.   "アクターアニメ変更#ATTACK",
  3606.   "遠距離アニメ",
  3607.   "対象アニメ",
  3608.   "アクターアニメ変更#WALK_L",
  3609.   "SEの演奏#016-Jump02,80,100",
  3610.   "移動#self,0,0,48,32",
  3611.   "終了"
  3612.   ],
  3613.  
  3614.   "エネミー攻撃" => [
  3615.  
  3616.   "閃きアニメ",
  3617.   "アクターアニメ変更#WALK_L",
  3618.   "移動#self,-36,0,12,0",
  3619.   "行動アニメ",
  3620.   "アクターアニメ変更#ATTACK",
  3621.   "遠距離アニメ",
  3622.   "対象アニメ",
  3623.   "アクターアニメ変更#WALK_L",
  3624.   "移動#self,0,0,12,0",
  3625.   "終了"
  3626.   ],
  3627.  
  3628.   "術発動" => [
  3629.  
  3630.   "閃きアニメ",
  3631.   "アクターアニメ変更#WALK_L",
  3632.   "移動#self,-32,0,4,0",
  3633.   "アクターアニメ変更#MAGIC",
  3634.   "行動アニメ",
  3635.   "ウエイト#15",
  3636.   "遠距離アニメ",
  3637.   "対象アニメ",
  3638.   "アクターアニメ変更#WALK_L",
  3639.   "移動#self,0,0,4,2",
  3640.   "終了"
  3641.   ],
  3642.  
  3643.   "アイテム使用" => [
  3644.  
  3645.   "閃きアニメ",
  3646.   "アクターアニメ変更#WALK_L",
  3647.   "移動#self,-32,0,4,0",
  3648.   "行動アニメ",
  3649.   "アクターアニメ変更#ITEM",
  3650.   "ウエイト#15",
  3651.   "遠距離アニメ",
  3652.   "対象アニメ",
  3653.   "アクターアニメ変更#WALK_L",
  3654.   "移動#self,0,0,4,2",
  3655.   "終了"
  3656.   ],
  3657.  
  3658.   "払い抜け" => [
  3659.  
  3660.   "閃きアニメ",
  3661.   "アクターアニメ変更#WALK_L",
  3662.   "移動#target_near,50,0,48,30",  
  3663.   "左右反転",
  3664.   "アクターアニメ固定#ATTACK#3",
  3665.   "行動アニメ",
  3666.   "SEの演奏#135-Light01,100,100",
  3667.   "アニメーションの表示#self,42",
  3668.   "ウエイト#15",
  3669.   "左右反転",
  3670.   "残像表示",
  3671.   "移動#target_far,-50,0,48,0",
  3672.   "対象アニメ",
  3673.   "残像消去",
  3674.   "アニメ固定解除",
  3675.   "アクターアニメ変更#WALK_L",
  3676.   "移動#self,0,0,48,1,0",
  3677.   "終了"
  3678.   ],
  3679.  
  3680.   "弓箭攻撃" => [
  3681.  
  3682.   "閃きアニメ",
  3683.   "アクターアニメ変更#WALK_L",
  3684.   "移動#self,-32,0,4,0",
  3685.   "行動アニメ",
  3686.   "アクターアニメ変更#ATTACK",
  3687.   "遠距離アニメ",
  3688.   "対象アニメ",
  3689.   "アクターアニメ変更#WALK_L",
  3690.   "移動#self,0,0,4,2",
  3691.   "終了"
  3692.   ],
  3693.  
  3694.   "回旋攻撃" => [
  3695.  
  3696.   "閃きアニメ",
  3697.   "アクターアニメ変更#WALK_L",
  3698.   "移動#self,-32,0,4,0",
  3699.   "行動アニメ",
  3700.   "アクターアニメ変更#STAND_L",  
  3701.   "遠距離アニメ",
  3702.   "対象アニメ",
  3703.   "アクターアニメ変更#WALK_L",
  3704.   "移動#self,0,0,4,2",
  3705.   "終了"
  3706.   ],
  3707.  
  3708.   "远距离発動" => [
  3709.  
  3710.   "閃きアニメ",
  3711.   "アクターアニメ変更#WALK_L",
  3712.   "移動#self,-32,0,4,0",
  3713.   "アクターアニメ変更#MAGIC",
  3714.   "行動アニメ",
  3715.   "アクターアニメ変更#ATTACK",
  3716.   "遠距離アニメ",
  3717.   "対象アニメ",
  3718.   "アクターアニメ変更#WALK_L",
  3719.   "移動#self,0,0,4,2",
  3720.   "終了"
  3721.   ],
  3722.  
  3723.   "回旋発動" => [
  3724.  
  3725.   "閃きアニメ",
  3726.   "アクターアニメ変更#WALK_L",
  3727.   "移動#self,-32,0,4,0",
  3728.   "アクターアニメ変更#MAGIC",
  3729.   "行動アニメ",
  3730.   "アクターアニメ変更#STAND_L",  
  3731.   "遠距離アニメ",
  3732.   "対象アニメ",
  3733.   "アクターアニメ変更#WALK_L",
  3734.   "移動#self,0,0,4,2",
  3735.   "終了"
  3736.   ],
  3737.  
  3738.   } # ここで終わり 消さないでください
  3739.  
  3740. end
  3741.  
  3742. module RPG
  3743.   class Weapon
  3744.     #--------------------------------------------------------------------------
  3745.     # ● アクション設定
  3746.     #--------------------------------------------------------------------------
  3747.     def battle_actions
  3748.       case @id
  3749.       when 17,18,19,20,21,22,23,24  # 远程武器的id回旋攻撃
  3750.         return BattleActions::Actions["弓箭攻撃"]
  3751.       when 34                       # 回旋武器的id
  3752.         return BattleActions::Actions["回旋攻撃"]
  3753.       end
  3754.       else
  3755.       return BattleActions::Actions["通常攻撃"]
  3756.     end
  3757.   end
  3758.   class Skill
  3759.     #--------------------------------------------------------------------------
  3760.     # ● アクション設定
  3761.     #--------------------------------------------------------------------------
  3762.     def battle_actions
  3763.       case @id
  3764.       when 73,74,75,76,77,78,79,80  # 远程技能的id
  3765.         return BattleActions::Actions["远距离発動"]
  3766.       when 82                       # 回旋技能的id
  3767.         return BattleActions::Actions["回旋発動"]
  3768.       end
  3769.       else
  3770.       if self.magic?
  3771.         return BattleActions::Actions["術発動"]
  3772.       else
  3773.         return BattleActions::Actions["払い抜け"]
  3774.       end
  3775.     end
  3776.   end
  3777.   class Item
  3778.     #--------------------------------------------------------------------------
  3779.     # ● アクション設定
  3780.     #--------------------------------------------------------------------------
  3781.     def battle_actions
  3782.       return BattleActions::Actions["アイテム使用"]
  3783.     end
  3784.   end
  3785. end
  3786. class Game_Enemy < Game_Battler
  3787.   #--------------------------------------------------------------------------
  3788.   # ● アクション設定
  3789.   #--------------------------------------------------------------------------
  3790.   def battle_actions
  3791.     return BattleActions::Actions["エネミー攻撃"]
  3792.   end
  3793. end
  3794. =begin
  3795. #--------------------------------------------------------------------------
  3796. # ● 遠距離アニメーション
  3797. #--------------------------------------------------------------------------
  3798.  ☆ 説明
  3799.  
  3800.    行動者から対象者にアニメを飛ばします。
  3801.    飛ばすアニメを データベース‐アニメーション で作ります。
  3802.     [アニメーションID, スピード, 往復するか?,直線(false)or曲線(true)] で指定します。
  3803.  
  3804.  
  3805.   ● カスタマイズ方法
  3806.     
  3807.     case @id
  3808.     when 17,18,19,20
  3809.       return [101,32,false,false]
  3810.     when 21,22,23,24
  3811.       return [102,32,false,false]
  3812.     end
  3813.     return 0
  3814.     
  3815.     のように描くとID別に指定可能です。
  3816.     
  3817.     
  3818.   ● アニメーションID
  3819.  
  3820.   飛ばすアニメーションIDです。短い場合は繰り返しで表示されます。
  3821.  
  3822.     
  3823.   ● スピード
  3824.  
  3825.   大きいほうが早い(0だとアニメは移動しません)
  3826.  
  3827.   1 = 1フレームで1ドット進むと考えてください。
  3828.  
  3829.   ● 往復するか?
  3830.  
  3831.   true とした場合、ブーメランのようにアニメが戻ります。
  3832.  
  3833.   ● 直線(false)or曲線(true)
  3834.  
  3835.   true  = 対象に向かって曲線で、アニメが飛びます。(修正の余地ありですが・・・)
  3836.   false = 対象に向かって直線で、アニメが飛びます。
  3837.     
  3838. =end
  3839. module RPG
  3840.   class Weapon
  3841.     #--------------------------------------------------------------------------
  3842.     # ● 遠距離アニメーション
  3843.     #--------------------------------------------------------------------------
  3844.     def flying_anime
  3845.       # ID 指定 の例(武器的id,分类是根据飞行武器的动画id)
  3846.       case @id
  3847.       when 34             #回旋武器(类似回力镖)的id
  3848.         return [103,32,true,true]
  3849.       when 17,18,19,20    #远程武器1(弓箭类)的id
  3850.         return [101,32,false,false]
  3851.       when 21,22,23,24    #远程武器2(铳类)的id
  3852.         return [102,32,false,false]
  3853.       end
  3854.       return [0,0,false,false]
  3855.     end
  3856.   end
  3857.   class Skill
  3858.     #--------------------------------------------------------------------------
  3859.     # ● 遠距離アニメーション
  3860.     #--------------------------------------------------------------------------
  3861.     def flying_anime
  3862.       # ID 指定 の例(技能的id,分类是根据飞行武器的动画id)
  3863.       case @id
  3864.       when 82             #回旋技能(类似回力镖)的id
  3865.         return [103,32,true,true]
  3866.       when 73,74,75,76    #远程技能1(弓箭类)的id
  3867.         return [101,32,false,false]
  3868.       when 77,78,79,80    #远程技能2(铳类)的id
  3869.         return [102,32,false,false]
  3870.       end
  3871.       return [0,0,false,false]
  3872.     end
  3873.   end
  3874.   class Item
  3875.     #--------------------------------------------------------------------------
  3876.     # ● 遠距離アニメーション
  3877.     #--------------------------------------------------------------------------
  3878.     def flying_anime
  3879.       case @id
  3880.       when 34    #抛击类道具(如炸弹一类)的id
  3881.         return [104,32,false,true]
  3882.       end
  3883.       return [0,0,false,false]
  3884.     end
  3885.   end
  3886. end
  3887.  
  3888. class Game_Enemy < Game_Battler
  3889.   #--------------------------------------------------------------------------
  3890.   # ● 遠距離アニメーション
  3891.   #--------------------------------------------------------------------------
  3892.   def flying_anime
  3893.     return [0,0,false,false]
  3894.   end
  3895. end
  3896. #==============================================================================
  3897. # ■ Game_Battler
  3898. #==============================================================================
  3899. class Game_Battler
  3900.   include Side_view
  3901.   #--------------------------------------------------------------------------
  3902.   # ● 追加・公開インスタンス変数
  3903.   #--------------------------------------------------------------------------
  3904.   attr_accessor :height                  # 画像の高さ
  3905.   attr_accessor :real_x                  # X座標補正
  3906.   attr_accessor :real_y                  # Y座標補正
  3907.   attr_accessor :real_zoom               # 拡大率
  3908.   attr_accessor :wait_count              # アニメーション 待ち時間
  3909.   attr_accessor :wait_count2             # アニメーション 待ち時間2
  3910.   attr_accessor :pattern                 # アニメーション カウント(キャラ)
  3911.   attr_accessor :shake                   # シェイク開始フラッグ
  3912.   attr_accessor :reverse                 # 左右反転フラッグ
  3913.   attr_accessor :shadow                  # 残像フラッグ
  3914.   attr_accessor :flash_flag              # 閃きフラッグ
  3915.   attr_reader   :ox                      # X座標補正
  3916.   attr_reader   :oy                      # Y座標補正
  3917.   attr_reader   :flying_x                # 遠距離アニメX座標
  3918.   attr_reader   :flying_y                # 遠距離アニメY座標
  3919.   attr_reader   :flying_anime            # 遠距離アニメ
  3920.   attr_reader   :animation1_on           # 行動アニメ開始フラッグ
  3921.   attr_reader   :animation2_on           # 対象アニメ開始フラッグ
  3922.   #--------------------------------------------------------------------------
  3923.   # ● デフォルトのアニメーション待ち時間を取得
  3924.   #--------------------------------------------------------------------------
  3925.   def animation_duration=(animation_duration)
  3926.     @_animation_duration = animation_duration
  3927.   end
  3928.   #--------------------------------------------------------------------------
  3929.   # ● バトル開始時のセットアップ
  3930.   #--------------------------------------------------------------------------
  3931.   def start_battle
  3932.     [url=home.php?mod=space&uid=291977]@height[/url] = 0
  3933.     @real_x = 0
  3934.     @real_y = 0
  3935.     @real_zoom = 1.0
  3936.     @battler_condition = ""
  3937.     @action = nil
  3938.     @battle_actions = []
  3939.     @battler_action = false
  3940.     [url=home.php?mod=space&uid=2129346]@step[/url] = 0
  3941.     @anime_on = false
  3942.     @wait_count = 0
  3943.     @wait_count2 = 0
  3944.     @ox = 0
  3945.     @oy = 0
  3946.     @pattern = 0
  3947.     @pattern_log = true
  3948.     @pattern_freeze = false
  3949.     @condition_freeze = false
  3950.     @active = false
  3951.     @move_distance = nil
  3952.     @move_wait = 0
  3953.     @move_coordinates = [0,0,0,0]
  3954.     @flying_distance = nil
  3955.     @flying_wait = 0
  3956.     @flying_x = 0
  3957.     @flying_y = 0
  3958.     @flash_flag = {}
  3959.     self.flying_clear
  3960.   end
  3961.   #--------------------------------------------------------------------------
  3962.   # ● 移動中判定
  3963.   #--------------------------------------------------------------------------
  3964.   def moving?
  3965.     # X座標補正または、Y座標補正が0でなければ、移動中
  3966.     return (@ox != 0 or @oy != 0)
  3967.   end
  3968.   #--------------------------------------------------------------------------
  3969.   # ● 移動終了判定
  3970.   #--------------------------------------------------------------------------
  3971.   def move_end?
  3972.     return (@ox == @move_coordinates[0] and @oy == @move_coordinates[1])
  3973.   end
  3974.   #--------------------------------------------------------------------------
  3975.   # ● アクション開始設定
  3976.   #--------------------------------------------------------------------------
  3977.   def action(flag = true)
  3978.     @battler_action = flag
  3979.     @animation1_on = false
  3980.     @animation2_on = false
  3981.     @step = "setup"
  3982.   end   
  3983.   #--------------------------------------------------------------------------
  3984.   # ● アクション中判定
  3985.   #--------------------------------------------------------------------------
  3986.   def action?
  3987.     return @battler_action
  3988.   end
  3989.   #--------------------------------------------------------------------------
  3990.   # ● 閃き判定
  3991.   #--------------------------------------------------------------------------
  3992.   def flash?
  3993.     return @flash_flg
  3994.   end
  3995.   #--------------------------------------------------------------------------
  3996.   # ● 戦闘不能判定
  3997.   #--------------------------------------------------------------------------
  3998.   def anime_dead?
  3999.     if $game_temp.in_battle and !RTAB
  4000.       if [2,3,4,5].include?($scene.phase4_step)
  4001.         return @last_dead
  4002.       end
  4003.     end
  4004.     return @last_dead = self.dead?
  4005.   end
  4006.   #--------------------------------------------------------------------------
  4007.   # ● ピンチ状態判定
  4008.   #--------------------------------------------------------------------------
  4009.   def crisis?
  4010.     if $game_temp.in_battle and !RTAB
  4011.       if [2,3,4,5].include?($scene.phase4_step)
  4012.         return @last_crisis
  4013.       end
  4014.     end
  4015.     return @last_crisis = (self.hp <= self.maxhp / 4 or badstate?)
  4016.   end
  4017.   #--------------------------------------------------------------------------
  4018.   # ● バッドステート判定
  4019.   #--------------------------------------------------------------------------
  4020.   def badstate?
  4021.     for i in @states
  4022.       unless $data_states[i].nonresistance
  4023.         return true
  4024.       end
  4025.     end
  4026.     return false
  4027.   end
  4028.   #--------------------------------------------------------------------------
  4029.   # ● 飛行
  4030.   #--------------------------------------------------------------------------
  4031.   def fly
  4032.     if @fly != nil
  4033.       return @fly
  4034.     end
  4035.     for id in @states
  4036.       if FLY_STATES.include?($data_states[id].name)
  4037.         return 60
  4038.       end
  4039.     end
  4040.     return 0
  4041.   end
  4042.   #--------------------------------------------------------------------------
  4043.   # ● 遠距離アニメ目標座標の計算
  4044.   #--------------------------------------------------------------------------
  4045.   def flying_setup
  4046.     # 二度目は実行しない
  4047.     return if @flying_distance != nil && !camera_correctness
  4048.     if RTAB
  4049.       targets = @target
  4050.     else
  4051.       targets = $scene.target_battlers
  4052.     end
  4053.     # 目的座標を計算
  4054.     @f_target_x = 0
  4055.     @f_target_y = 0
  4056.     for t in targets
  4057.       @f_target_x += t.screen_x
  4058.       @f_target_y += t.screen_y
  4059.     end
  4060.     if targets != []
  4061.       @f_target_x /= targets.size
  4062.       @f_target_y /= targets.size
  4063.     else
  4064.       @flying_distance = 0
  4065.       return
  4066.     end
  4067.     # 距離の計算
  4068.     @flying_distance = (self.screen_x - @f_target_x).abs + (self.screen_y - @f_target_y).abs
  4069.   end
  4070.   #--------------------------------------------------------------------------
  4071.   # ● 遠距離アニメ
  4072.   #--------------------------------------------------------------------------
  4073.   def flying_animation
  4074.     # 戻る
  4075.     if @step != "flying" or @flying_distance.nil?
  4076.       return [false,true]
  4077.     end
  4078.     # あらかじめ計算
  4079.     self_x = self.screen_x
  4080.     self_y = self.screen_y
  4081.     @flying_distance = @flying_distance == 0 ? 1 : @flying_distance
  4082.     n1 = @flying_wait / @flying_distance.to_f
  4083.     if @flying_distance - @flying_wait > @flying_distance / 2
  4084.       n2 = 1.0 + 10.0 * @flying_wait / @flying_distance.to_f
  4085.     else
  4086.       n2 = 1.0 + 10.0 * (@flying_distance - @flying_wait) / @flying_distance.to_f
  4087.     end
  4088.     if !@flying_anime[4]
  4089.       # 直線移動
  4090.       x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
  4091.       y = (self_y + 1.0 * (@f_target_y - self_y) * n1).to_i
  4092.     else
  4093.       # 曲線移動
  4094.       if !@flying_proceed_end
  4095.         x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
  4096.         y = (self_y + 1.0 * (@f_target_y - self_y) * n1 - n2**2).to_i
  4097.       else
  4098.         x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
  4099.         y = (self_y + 1.0 * (@f_target_y - self_y) * n1 + n2**2).to_i
  4100.       end
  4101.     end
  4102.     # 座標代入
  4103.     @flying_x = x
  4104.     @flying_y = y
  4105.     # ウエイト
  4106.     if !@flying_proceed_end
  4107.       # 開始
  4108.       @flying_proceed_start = @flying_wait == 0
  4109.       @flying_wait += @flying_anime[1]
  4110.       @flying_wait = [@flying_wait,@flying_distance].min
  4111.       @flying_proceed_end = @flying_wait == @flying_distance
  4112.     else
  4113.       # 開始
  4114.       @flying_return_start = @flying_wait == @flying_distance
  4115.       @flying_wait -= @flying_anime[1]
  4116.       @flying_wait = [@flying_wait,0].max
  4117.       @flying_return_end = @flying_wait == 0
  4118.     end
  4119.     if @flying_anime[1] == 0
  4120.       @flying_end = true
  4121.     elsif !@flying_anime[2]
  4122.       @flying_end = @flying_proceed_end
  4123.     else
  4124.       @flying_end = @flying_return_end
  4125.     end
  4126.     # 値を返す(アニメ開始,アニメ終了)
  4127.     return [@flying_proceed_start,@flying_end]
  4128.   end
  4129.   #--------------------------------------------------------------------------
  4130.   # ● 遠距離アニメ初期化
  4131.   #--------------------------------------------------------------------------
  4132.   def flying_clear
  4133.     @flying_proceed_start = false
  4134.     @flying_proceed_end = false
  4135.     @flying_return_start = false
  4136.     @flying_return_end = false
  4137.     @flying_end = false
  4138.     @flying_anime = [0,0,false]
  4139.   end
  4140.   #--------------------------------------------------------------------------
  4141.   # ● 移動
  4142.   #--------------------------------------------------------------------------
  4143.   def move
  4144.     # 距離の計算
  4145.     @move_distance = (@move_coordinates[2] - @move_coordinates[0]).abs +
  4146.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  4147.     if @move_distance > 0
  4148.       return if @ox == @move_coordinates[0] and @oy == @move_coordinates[1]
  4149.       array = @move_coordinates
  4150.       # ジャンプ補正値の計算
  4151.       if @move_distance - @move_wait > @move_distance / 2
  4152.         jump = (@move_action[4] * @move_wait / @move_distance.to_f)**2
  4153.       else
  4154.         jump = (@move_action[4] * (@move_distance - @move_wait) / @move_distance.to_f)**2
  4155.       end
  4156.       jump = @move_action[4] > 0 ? -jump : jump
  4157.       @ox = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @move_wait) / @move_distance.to_f).to_i
  4158.       @oy = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @move_wait) / @move_distance.to_f + jump).to_i
  4159.       # ウエイト
  4160.       @move_wait -= @move_action[3]
  4161.       @move_wait = [@move_wait,0].max
  4162.     end
  4163.   end
  4164.   #--------------------------------------------------------------------------
  4165.   # ● 移動アクションの取得
  4166.   #--------------------------------------------------------------------------
  4167.   def get_move_action
  4168.     string = @action.split(/#/)[1]
  4169.     string = string.split(/,/)
  4170.     @move_action = [string[0],string[1].to_i,string[2].to_i,string[3].to_i,string[4].to_i,string[5].to_i]
  4171.   end
  4172.   #--------------------------------------------------------------------------
  4173.   # ● アクションの取得
  4174.   #--------------------------------------------------------------------------
  4175.   def get_step
  4176.     if @action.nil?
  4177.       @step = "finish"
  4178.       return
  4179.     end
  4180.     string = @action.split(/#/)[0]
  4181.     if string =~ "移動"
  4182.       @step = "moving_setup"
  4183.     elsif string =~ "アクターアニメ実行"
  4184.       @step = "action"
  4185.     elsif string =~ "遠距離アニメ"
  4186.       @step = "flying"
  4187.     elsif string =~ "アクターアニメ変更"
  4188.       @step = "change"
  4189.     elsif string =~ "行動アニメ"
  4190.       @step = "animation1"
  4191.     elsif string =~ "対象アニメ"
  4192.       @step = "animation2"
  4193.     elsif string =~ "ウエイト"
  4194.       @step = "wait"
  4195.     elsif string =~ "左右反転"
  4196.       @step = "reverse"
  4197.     elsif string =~ "閃きアニメ"
  4198.       @step = "flash"
  4199.     elsif string =~ "残像表示"
  4200.       @step = "shadow_on"
  4201.     elsif string =~ "残像消去"
  4202.       @step = "shadow_off"
  4203.     elsif string =~ "アクターアニメ固定"
  4204.       @step = "freeze"
  4205.     elsif string =~ "アニメ固定解除"
  4206.       @step = "freeze_lifting"
  4207.     elsif string =~ "アニメーションの表示"
  4208.       @step = "animation_start"
  4209.     elsif string =~ "SEの演奏"
  4210.       @step = "play_se"
  4211.     else
  4212.       @step = "finish"
  4213.     end
  4214.   end
  4215.   #--------------------------------------------------------------------------
  4216.   # ● フレーム更新 (次のアクションへ)
  4217.   #--------------------------------------------------------------------------
  4218.   def update_next
  4219.     @action = @battle_actions.shift
  4220.     @step = get_step
  4221.   end
  4222.   #--------------------------------------------------------------------------
  4223.   # ● フレーム更新 (動作取得)
  4224.   #--------------------------------------------------------------------------
  4225.   def update_setup
  4226.     # アクションの取得
  4227.     self.get_actions
  4228.     @action = @battle_actions.shift
  4229.     @step = get_step
  4230.   end
  4231.   #--------------------------------------------------------------------------
  4232.   # ● フレーム更新 (移動取得)
  4233.   #--------------------------------------------------------------------------
  4234.   def update_moving_setup
  4235.     # 移動アクションの取得
  4236.     self.get_move_action
  4237.     # 移動目標の設定
  4238.     self.move_setup
  4239.     @step = "moving"
  4240.   end
  4241.   #--------------------------------------------------------------------------
  4242.   # ● フレーム更新 (移動)
  4243.   #--------------------------------------------------------------------------
  4244.   def update_moving
  4245.     # 移動
  4246.     self.move
  4247.     self.condition = @battler_condition
  4248.     # 移動完了したら次のステップへ
  4249.     if move_end?
  4250.       @wait_count = 2
  4251.       @action = @battle_actions.shift
  4252.       @step = get_step
  4253.     end
  4254.   end
  4255.   #--------------------------------------------------------------------------
  4256.   # ● フレーム更新 (アニメ実行)
  4257.   #--------------------------------------------------------------------------
  4258.   def update_action
  4259.     con = @action.split(/#/)[1]
  4260.     # 右手・左手を分ける
  4261.     if DUAL_WEAPONS_ANIME.include?(con)
  4262.       if !@first_weapon and @second_weapon
  4263.         con = con + "_L"
  4264.       else
  4265.         con = con + "_R"
  4266.       end
  4267.     end
  4268.     # アニメ変更
  4269.     self.condition = con
  4270.     # ループか否か
  4271.     if !ANIME[@battler_condition][1]
  4272.       self.anime_on
  4273.     end
  4274.     @action = @battle_actions.shift
  4275.     @step = get_step
  4276.   end
  4277.   #--------------------------------------------------------------------------
  4278.   # ● フレーム更新 (遠距離アニメ)
  4279.   #--------------------------------------------------------------------------
  4280.   def update_flying
  4281.     # 目標の設定
  4282.     self.flying_setup
  4283.     # 遠距離アニメ終了
  4284.     if @flying_end
  4285.       self.flying_clear
  4286.       @action = @battle_actions.shift
  4287.       @step = get_step
  4288.     end
  4289.   end
  4290.   #--------------------------------------------------------------------------
  4291.   # ● フレーム更新 (アニメ変更)
  4292.   #--------------------------------------------------------------------------
  4293.   def update_change
  4294.     con = @action.split(/#/)[1]
  4295.     # 右手・左手を分ける
  4296.     if DUAL_WEAPONS_ANIME.include?(con)
  4297.       if !@first_weapon and @second_weapon
  4298.         con = con + "_L"
  4299.       else
  4300.         con = con + "_R"
  4301.       end
  4302.     end
  4303.     # アニメ変更
  4304.     self.condition = con
  4305.     # ループか否か
  4306.     if !ANIME[@battler_condition][1]
  4307.       self.anime_on
  4308.     end
  4309.     @action = @battle_actions.shift
  4310.     @step = get_step
  4311.   end
  4312.   #--------------------------------------------------------------------------
  4313.   # ● フレーム更新 (行動アニメ)
  4314.   #--------------------------------------------------------------------------
  4315.   def update_animation1
  4316.     @animation1_on = true
  4317.     # 行動アニメの後に行動を開始する
  4318.     if $scene.phase4_step == 3
  4319.       id = RTAB ? @anime1 : $scene.animation1_id
  4320.       animation = $data_animations[id]
  4321.       frame_max = animation != nil ? animation.frame_max : 0
  4322.       @wait_count2 = frame_max * 2
  4323.       return
  4324.     end
  4325.     @action = @battle_actions.shift
  4326.     @step = get_step
  4327.   end
  4328.   #--------------------------------------------------------------------------
  4329.   # ● フレーム更新 (対象アニメ)
  4330.   #--------------------------------------------------------------------------
  4331.   def update_animation2
  4332.     @animation2_on = true
  4333.     # 行動アニメの後に行動を開始する
  4334.     if $scene.phase4_step == 4
  4335.       id = RTAB ? @anime2 : $scene.animation2_id
  4336.       animation = $data_animations[id]
  4337.       frame_max = animation != nil ? animation.frame_max : 0
  4338.       @wait_count2 = frame_max * 2
  4339.       return
  4340.     end
  4341.     @action = @battle_actions.shift
  4342.     @step = get_step
  4343.   end
  4344.   #--------------------------------------------------------------------------
  4345.   # ● フレーム更新 (ウエイト)
  4346.   #--------------------------------------------------------------------------
  4347.   def update_wait
  4348.     @wait_count2 = @action.split(/#/)[1].to_i
  4349.     @action = @battle_actions.shift
  4350.     @step = get_step
  4351.   end
  4352.   #--------------------------------------------------------------------------
  4353.   # ● フレーム更新 (残像表示)
  4354.   #--------------------------------------------------------------------------
  4355.   def update_shadow_on
  4356.     @shadow = true
  4357.     @action = @battle_actions.shift
  4358.     @step = get_step
  4359.   end
  4360.   #--------------------------------------------------------------------------
  4361.   # ● フレーム更新 (残像消去)
  4362.   #--------------------------------------------------------------------------
  4363.   def update_shadow_off
  4364.     @shadow = false
  4365.     @action = @battle_actions.shift
  4366.     @step = get_step
  4367.   end
  4368.   #--------------------------------------------------------------------------
  4369.   # ● フレーム更新 (左右反転)
  4370.   #--------------------------------------------------------------------------
  4371.   def update_reverse
  4372.     @reverse = @reverse ? false : true
  4373.     @action = @battle_actions.shift
  4374.     @step = get_step
  4375.   end
  4376.   #--------------------------------------------------------------------------
  4377.   # ● フレーム更新 (閃きアニメ)
  4378.   #--------------------------------------------------------------------------
  4379.   def update_flash
  4380.     # 閃きアニメの後に行動を開始する
  4381.     if @flash_flag["normal"]
  4382.       @wait_count = $scene.flash_duration
  4383.       @flash_flag["normal"] = false
  4384.       return
  4385.     end
  4386.     @action = @battle_actions.shift
  4387.     @step = get_step
  4388.   end
  4389.   #--------------------------------------------------------------------------
  4390.   # ● フレーム更新 (SEの演奏)
  4391.   #--------------------------------------------------------------------------
  4392.   def update_play_se
  4393.     data = @action.split(/#/)[1]
  4394.     data = data.split(/,/)
  4395.     # SE を演奏
  4396.     Audio.se_play("Audio/SE/" + data[0], data[1].to_i, data[2].to_i)
  4397.     @action = @battle_actions.shift
  4398.     @step = get_step
  4399.   end
  4400.   #--------------------------------------------------------------------------
  4401.   # ● フレーム更新 (アクターアニメ固定)
  4402.   #--------------------------------------------------------------------------
  4403.   def update_freeze
  4404.     con = @action.split(/#/)[1]
  4405.     # 右手・左手を分ける
  4406.     if DUAL_WEAPONS_ANIME.include?(con)
  4407.       if !@first_weapon and @second_weapon
  4408.         con = con + "_L"
  4409.       else
  4410.         con = con + "_R"
  4411.       end
  4412.     end
  4413.     # アニメ変更
  4414.     self.condition = con
  4415.     @pattern = @action.split(/#/)[2].to_i
  4416.     @pattern_freeze = true
  4417.     @condition_freeze = true
  4418.     @action = @battle_actions.shift
  4419.     @step = get_step
  4420.   end
  4421.   #--------------------------------------------------------------------------
  4422.   # ● フレーム更新 (アクターアニメ固定解除)
  4423.   #--------------------------------------------------------------------------
  4424.   def update_freeze_lifting
  4425.     @pattern_freeze = false
  4426.     @condition_freeze = false
  4427.     @action = @battle_actions.shift
  4428.     @step = get_step
  4429.   end
  4430.   #--------------------------------------------------------------------------
  4431.   # ● フレーム更新 (アニメーションの表示)
  4432.   #--------------------------------------------------------------------------
  4433.   def update_animation_start
  4434.     data = @action.split(/#/)[1]
  4435.     data = data.split(/,/)
  4436.     target = data[0]
  4437.     animation_id = data[1].to_i
  4438.     if RTAB
  4439.       case target
  4440.       when "self"
  4441.         @animation.push([animation_id,true])
  4442.       when "target"
  4443.         for tar in @target
  4444.           tar.animation.push([animation_id, true])
  4445.         end
  4446.       end
  4447.     else
  4448.       case target
  4449.       when "self"
  4450.         @animation_id = animation_id
  4451.         @animation_hit = true
  4452.       when "target"
  4453.         for tar in $scene.target_battlers
  4454.           tar.animation_id = animation_id
  4455.           tar.animation_hit = true
  4456.         end
  4457.       end
  4458.     end
  4459.     @action = @battle_actions.shift
  4460.     @step = get_step
  4461.   end
  4462.   #--------------------------------------------------------------------------
  4463.   # ● フレーム更新 (動作終了)
  4464.   #--------------------------------------------------------------------------
  4465.   def update_finish
  4466.     # 動作終了
  4467.     @battler_action = false
  4468.     @step = "setup"
  4469.   end
  4470.   #--------------------------------------------------------------------------
  4471.   # ● バトラーの状態 変更(バトラーグラフィックのタイプ)
  4472.   #--------------------------------------------------------------------------
  4473.   def condition=(condition)
  4474.     return if @condition_freeze
  4475.     @battler_condition = condition
  4476.     @wait_count = ANIME[condition][2]
  4477.   end
  4478.   #--------------------------------------------------------------------------
  4479.   # ● バトラーの状態(バトラーグラフィックのタイプ)
  4480.   #--------------------------------------------------------------------------
  4481.   def condition
  4482.     return @battler_condition
  4483.   end
  4484.   #--------------------------------------------------------------------------
  4485.   # ● フレーム更新
  4486.   #--------------------------------------------------------------------------
  4487.   def update
  4488.     # ウェイト中の場合
  4489.     if @wait_count > 0
  4490.       return
  4491.     end
  4492.     # パターン更新
  4493.     self.char_animation
  4494.     # ウェイト中の場合
  4495.     if @wait_count2 > 0
  4496.       return
  4497.     end
  4498.  
  4499.     # 行動アニメーション
  4500.     if @battler_action
  4501.       method("update_" + @step).call
  4502.       return
  4503.     end
  4504.  
  4505.     # データ初期化
  4506.     @animation1_on = false
  4507.     @animation2_on = false
  4508.     @action = nil
  4509.     @battle_actions = []
  4510.     @move_wait = 0
  4511.     @move_distance = nil
  4512.     @flying_wait = 0
  4513.     @flying_distance = nil
  4514.     @flash = false
  4515.  
  4516.     # RTAB対応
  4517.     # 通常・待機
  4518.     return self.condition = NORMAL
  4519.   end
  4520.   #--------------------------------------------------------------------------
  4521.   # ● アクションの取得
  4522.   #--------------------------------------------------------------------------
  4523.   def get_actions
  4524.     skill = $data_skills[self.current_action.skill_id]
  4525.     item = $data_items[self.current_action.item_id]
  4526.     kind = self.current_action.kind
  4527.     # 動作取得
  4528.     @battle_actions = []
  4529.     # スキル
  4530.     if skill != nil && kind == 1
  4531.       @battle_actions = skill.battle_actions.dup
  4532.       @flying_anime = skill.flying_anime
  4533.     # アイテム
  4534.     elsif item != nil && kind == 2
  4535.       @battle_actions = item.battle_actions.dup
  4536.       @flying_anime = item.flying_anime
  4537.     # 左手攻撃
  4538.     elsif !@first_weapon and @second_weapon and self.is_a?(Game_Actor)
  4539.       @battle_actions = self.battle_actions2.dup
  4540.       @flying_anime = self.flying_anime2
  4541.     # 右手攻撃
  4542.     elsif self.current_action.basic == 0 and
  4543.       self.is_a?(Game_Actor) and self.current_action.kind == 0
  4544.       @battle_actions = self.battle_actions1.dup
  4545.       @flying_anime = self.flying_anime1
  4546.     # 通常攻撃
  4547.     elsif self.current_action.basic == 0 and self.current_action.kind == 0
  4548.       @battle_actions = self.battle_actions.dup
  4549.       @flying_anime = self.flying_anime
  4550.     else
  4551.       @battle_actions = ["終了"]
  4552.       @flying_anime = [0,0,false,false]
  4553.     end
  4554.   end
  4555.   #--------------------------------------------------------------------------
  4556.   # ● ループしないアニメのセット
  4557.   #--------------------------------------------------------------------------
  4558.   def anime_on
  4559.     @pattern = 0
  4560.     @pattern_log = true
  4561.     return
  4562.   end
  4563.   #--------------------------------------------------------------------------
  4564.   # ● パターン更新
  4565.   #--------------------------------------------------------------------------
  4566.   def char_animation
  4567.     # パタン固定の場合もどる
  4568.     return if @pattern_freeze
  4569.     # ループしないアニメの場合 1234 で止まる
  4570.     if !ANIME[@battler_condition][1] && @pattern == 3
  4571.       return
  4572.     end
  4573.     # アニメさせない場合 1 で止まる
  4574.     if ANIME[@battler_condition][4]
  4575.       @pattern = 0
  4576.       return
  4577.     end
  4578.     @pattern = (@pattern + 1) % 4
  4579.   end
  4580.   #--------------------------------------------------------------------------
  4581.   # ● アニメタイプ
  4582.   #--------------------------------------------------------------------------
  4583.   def anime_type
  4584.     return ANIME[self.condition] != nil ? ANIME[self.condition][0] : 0
  4585.   end
  4586. end
  4587. #==============================================================================
  4588. # ■ Game_Actor
  4589. #==============================================================================
  4590. class Game_Actor < Game_Battler
  4591.   include Side_view
  4592.   #--------------------------------------------------------------------------
  4593.   # ● セットアップ
  4594.   #--------------------------------------------------------------------------
  4595.   alias side_view_setup setup
  4596.   def setup(actor_id)
  4597.     side_view_setup(actor_id)
  4598.     start_battle
  4599.   end
  4600.   #--------------------------------------------------------------------------
  4601.   # ● 二刀武器のID取得 ※エラー回避用
  4602.   #--------------------------------------------------------------------------
  4603.   def weapon2_id
  4604.     return @weapon2_id != nil ? @weapon2_id : 0
  4605.   end
  4606.   #--------------------------------------------------------------------------
  4607.   # ● X方向 ポジション 取得 (陣形スクリプト拡張用)
  4608.   #--------------------------------------------------------------------------
  4609.   def position
  4610.     return $data_classes[@class_id].position
  4611.   end
  4612.   #--------------------------------------------------------------------------
  4613.   # ● Y方向 ポジション 取得 (陣形スクリプト拡張用)
  4614.   #--------------------------------------------------------------------------
  4615.   def position2
  4616.     return self.index
  4617.   end
  4618.   #--------------------------------------------------------------------------
  4619.   # ● 武器アニメタイプ
  4620.   #--------------------------------------------------------------------------
  4621.   def weapon_anime_type(type)
  4622.     file_name  = weapon_anime_type0(type)
  4623.     visible   = weapon_anime_type1(type)
  4624.     z         = weapon_anime_type2(type)
  4625.     return [file_name,visible,z]
  4626.   end
  4627.   # 武器アイコン取得
  4628.   def weapon_anime_type0(type)
  4629.     type = ANIME[type][5]
  4630.     return weapon_anime1 if type == "右手"
  4631.     return weapon_anime2 if type == "左手"
  4632.     return nil
  4633.   end
  4634.   # 表示・非表示の取得
  4635.   def weapon_anime_type1(type)
  4636.     return ANIME[type][3]
  4637.   end
  4638.   # バトラーより上に表示するかどうか
  4639.   def weapon_anime_type2(type)
  4640.     type = ANIME[type][5]
  4641.     return true if type == "左手"
  4642.     return false
  4643.   end
  4644.   #--------------------------------------------------------------------------
  4645.   # ● バトル画面 X 座標の取得(カメラ補正無し)
  4646.   #--------------------------------------------------------------------------
  4647.   def true_x
  4648.     return PARTY_X + position * FORMATION_X + @ox
  4649.   end
  4650.   #--------------------------------------------------------------------------
  4651.   # ● バトル画面 Y 座標の取得(カメラ補正無し)
  4652.   #--------------------------------------------------------------------------
  4653.   def true_y
  4654.     # パーティ内の並び順から Y 座標を計算して返す
  4655.     if self.index != nil
  4656.       y = position2 * FORMATION_Y + PARTY_Y + @oy - @height / 2
  4657.       return y
  4658.     else
  4659.       return 0
  4660.     end
  4661.   end
  4662.   #--------------------------------------------------------------------------
  4663.   # ● バトル画面 X 座標の取得
  4664.   #--------------------------------------------------------------------------
  4665.   def screen_x(true_x = self.true_x)
  4666.     return 320 + (true_x - 320) * @real_zoom + @real_x
  4667.   end
  4668.   #--------------------------------------------------------------------------
  4669.   # ● バトル画面 Y 座標の取得
  4670.   #--------------------------------------------------------------------------
  4671.   def screen_y(true_y = self.true_y)
  4672.     return true_y * @real_zoom + @real_y
  4673.   end
  4674.   #--------------------------------------------------------------------------
  4675.   # ● バトル画面 Z 座標の取得
  4676.   #--------------------------------------------------------------------------
  4677.   def screen_z
  4678.     return screen_y + 1000
  4679.   end
  4680.   #--------------------------------------------------------------------------
  4681.   # ● バトル画面 X 座標の取得(移動などしていない場合)
  4682.   #--------------------------------------------------------------------------
  4683.   def base_x
  4684.     return 320 + (true_x - @ox - 320) * @real_zoom + @real_x
  4685.   end
  4686.   #--------------------------------------------------------------------------
  4687.   # ● バトル画面 Y 座標の取得
  4688.   #--------------------------------------------------------------------------
  4689.   def base_y
  4690.     return (true_y - @oy) * @real_zoom + @real_y
  4691.   end
  4692.   #--------------------------------------------------------------------------
  4693.   # ● バトル画面 拡大率の取得
  4694.   #--------------------------------------------------------------------------
  4695.   def zoom
  4696.     return ($scene.zoom_rate[1] - $scene.zoom_rate[0]) *
  4697.                           (true_x + @fly) / 480 + $scene.zoom_rate[0]
  4698.   end
  4699.   #--------------------------------------------------------------------------
  4700.   # ● 攻撃用、バトル画面 X 座標の取得
  4701.   #--------------------------------------------------------------------------
  4702.   def attack_x(z)
  4703.     return (320 - true_x) * z * 0.75
  4704.   end
  4705.   #--------------------------------------------------------------------------
  4706.   # ● 攻撃用、バトル画面 Y 座標の取得
  4707.   #--------------------------------------------------------------------------
  4708.   def attack_y(z)
  4709.     return (160 - (true_y + fly / 4) * z + @height * zoom * z / 2) * 0.75
  4710.   end
  4711.   #--------------------------------------------------------------------------
  4712.   # ● 閃き待ち時間
  4713.   #--------------------------------------------------------------------------
  4714.   def flash_duration
  4715.     return $scene.flash_duration
  4716.   end
  4717.   #--------------------------------------------------------------------------
  4718.   # ● アニメーション取得
  4719.   #--------------------------------------------------------------------------
  4720.   def battle_actions1
  4721.     weapon = $data_weapons[@weapon_id]
  4722.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  4723.   end
  4724.   #--------------------------------------------------------------------------
  4725.   # ● アニメーション取得
  4726.   #--------------------------------------------------------------------------
  4727.   def battle_actions2
  4728.     weapon = $data_weapons[@weapon2_id]
  4729.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  4730.   end
  4731.   #--------------------------------------------------------------------------
  4732.   # ● 武器アニメーション取得
  4733.   #--------------------------------------------------------------------------
  4734.   def weapon_anime1
  4735.     weapon = $data_weapons[@weapon_id]
  4736.     return weapon != nil ? weapon.icon_name : ""
  4737.   end
  4738.   #--------------------------------------------------------------------------
  4739.   # ● 武器アニメーション取得
  4740.   #--------------------------------------------------------------------------
  4741.   def weapon_anime2
  4742.     weapon = $data_weapons[@weapon2_id]
  4743.     return weapon != nil ? weapon.icon_name : ""
  4744.   end
  4745.   #--------------------------------------------------------------------------
  4746.   # ● 遠距離アニメーション取得
  4747.   #--------------------------------------------------------------------------
  4748.   def flying_anime1
  4749.     weapon = $data_weapons[@weapon_id]
  4750.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  4751.   end
  4752.   #--------------------------------------------------------------------------
  4753.   # ● 遠距離アニメーション取得
  4754.   #--------------------------------------------------------------------------
  4755.   def flying_anime2
  4756.     weapon = $data_weapons[@weapon2_id]
  4757.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  4758.   end
  4759.   #--------------------------------------------------------------------------
  4760.   # ● 移動目標座標の計算
  4761.   #--------------------------------------------------------------------------
  4762.   def move_setup
  4763.     if RTAB
  4764.       targets = @target
  4765.     else
  4766.       targets = $scene.target_battlers
  4767.     end
  4768.     case @move_action[0]
  4769.     when "self" # 自分
  4770.       @target_x = self.base_x
  4771.       @target_y = self.base_y
  4772.     when "target_near" # 一番近くのターゲット
  4773.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  4774.       targets.reverse!
  4775.       if targets != []
  4776.         @target_x = targets[0].screen_x
  4777.         @target_y = targets[0].screen_y
  4778.       else
  4779.         @target_x = self.base_x
  4780.         @target_y = self.base_y
  4781.       end
  4782.     when "target_far" # 一番遠くのターゲット
  4783.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  4784.       if targets != []
  4785.         @target_x = targets[0].screen_x
  4786.         @target_y = targets[0].screen_y
  4787.       else
  4788.         @target_x = self.base_x
  4789.         @target_y = self.base_y
  4790.       end
  4791.     when "target" # ターゲット中央
  4792.       @target_x = 0
  4793.       @target_y = 0
  4794.       for t in targets
  4795.         @target_x += t.screen_x
  4796.         @target_y += t.screen_y
  4797.       end
  4798.       if targets != []
  4799.         @target_x /= targets.size
  4800.         @target_y /= targets.size
  4801.       end
  4802.     when "troop" # "トループ中央"
  4803.       @target_x = 0
  4804.       @target_y = 0
  4805.       for t in $game_troop.enemies
  4806.         @target_x += t.screen_x
  4807.         @target_y += t.screen_y
  4808.       end
  4809.       if $game_troop.enemies != []
  4810.         @target_x /= $game_troop.enemies.size
  4811.         @target_y /= $game_troop.enemies.size
  4812.       end
  4813.     when "party" # "パーティ中央"
  4814.       @target_x = 0
  4815.       @target_y = 0
  4816.       for t in $game_party.actors
  4817.         @target_x += t.screen_x
  4818.         @target_y += t.screen_y
  4819.       end
  4820.       if $game_party.actors != []
  4821.         @target_x /= $game_party.actors.size
  4822.         @target_y /= $game_party.actors.size
  4823.       end
  4824.     when "screen" # "画面"
  4825.       @target_x = self.base_x
  4826.       @target_y = self.base_y
  4827.     end
  4828.     # 補正
  4829.     @target_x += @move_action[1] - self.base_x
  4830.     @target_y += @move_action[2] - self.base_y
  4831.     # 移動目標の座標をセット
  4832.     @move_coordinates = [@target_x.to_i,@target_y.to_i,@move_coordinates[0],@move_coordinates[1]]
  4833.     # 距離の計算(ウエイトの設定)
  4834.     @move_wait     = (@move_coordinates[2] - @move_coordinates[0]).abs +
  4835.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  4836.   end
  4837. end
  4838. #==============================================================================
  4839. # ■ Game_Enemy
  4840. #==============================================================================
  4841. class Game_Enemy < Game_Battler
  4842.   #--------------------------------------------------------------------------
  4843.   # ● セットアップ
  4844.   #--------------------------------------------------------------------------
  4845.   alias side_view_initialize initialize
  4846.   def initialize(troop_id, member_index)
  4847.     side_view_initialize(troop_id, member_index)
  4848.     start_battle
  4849.   end
  4850.   #--------------------------------------------------------------------------
  4851.   # ● 移動
  4852.   #--------------------------------------------------------------------------
  4853.   def move
  4854.     # 距離の計算
  4855.     @move_distance = (@move_coordinates[2] - @move_coordinates[0]).abs +
  4856.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  4857.     if @move_distance > 0
  4858.       return if @ox == @move_coordinates[0] and @oy == @move_coordinates[1]
  4859.       array = @move_coordinates
  4860.       # ジャンプ補正値の計算
  4861.       if @move_distance - @move_wait > @move_distance / 2
  4862.         jump = (@move_action[4] * @move_wait / @move_distance.to_f)**2
  4863.       else
  4864.         jump = (@move_action[4] * (@move_distance - @move_wait) / @move_distance.to_f)**2
  4865.       end
  4866.       jump = @move_action[4] > 0 ? -jump : jump
  4867.       @ox = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @move_wait) / @move_distance.to_f).to_i
  4868.       @oy = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @move_wait) / @move_distance.to_f + jump).to_i
  4869.       # ウエイト
  4870.       @move_wait -= @move_action[3]
  4871.       @move_wait = [@move_wait,0].max
  4872.     end
  4873.   end
  4874.   #--------------------------------------------------------------------------
  4875.   # ● 移動目標座標の計算
  4876.   #--------------------------------------------------------------------------
  4877.   def move_setup
  4878.     if RTAB
  4879.       targets = @target
  4880.     else
  4881.       targets = $scene.target_battlers
  4882.     end
  4883.     case @move_action[0]
  4884.     when "self" # 自分
  4885.       @target_x = self.base_x
  4886.       @target_y = self.base_y
  4887.     when "target_near" # 一番近くのターゲット
  4888.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  4889.       if targets != []
  4890.         @target_x = targets[0].screen_x
  4891.         @target_y = targets[0].screen_y
  4892.       else
  4893.         @target_x = self.base_x
  4894.         @target_y = self.base_y
  4895.       end
  4896.     when "target_far" # 一番遠くのターゲット
  4897.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  4898.       targets.reverse!
  4899.       if targets != []
  4900.         @target_x = targets[0].screen_x
  4901.         @target_y = targets[0].screen_y
  4902.       else
  4903.         @target_x = self.base_x
  4904.         @target_y = self.base_y
  4905.       end
  4906.     when "target" # ターゲット中央
  4907.       @target_x = 0
  4908.       @target_y = 0
  4909.       for t in targets
  4910.         @target_x += t.screen_x
  4911.         @target_y += t.screen_y
  4912.       end
  4913.       if targets != []
  4914.         @target_x /= targets.size
  4915.         @target_y /= targets.size
  4916.       end
  4917.     when  "party" # "トループ中央"
  4918.       @target_x = 0
  4919.       @target_y = 0
  4920.       for t in $game_troop.enemies
  4921.         @target_x += t.screen_x
  4922.         @target_y += t.screen_y
  4923.       end
  4924.       if $game_troop.enemies != []
  4925.         @target_x /= $game_troop.enemies.size
  4926.         @target_y /= $game_troop.enemies.size
  4927.       end
  4928.     when "troop" # "パーティ中央"
  4929.       @target_x = 0
  4930.       @target_y = 0
  4931.       for t in $game_party.actors
  4932.         @target_x += t.screen_x
  4933.         @target_y += t.screen_y
  4934.       end
  4935.       if $game_party.actors != []
  4936.         @target_x /= $game_party.actors.size
  4937.         @target_y /= $game_party.actors.size
  4938.       end
  4939.     when "screen" # "画面"
  4940.       @target_x = self.base_x
  4941.       @target_y = self.base_y
  4942.     end
  4943.     # 補正
  4944.     @target_x -= @move_action[1] + self.base_x
  4945.     @target_y -= @move_action[2] + self.base_y
  4946.     # 移動目標の座標をセット
  4947.     @move_coordinates = [@target_x.to_i,@target_y.to_i,@move_coordinates[0],@move_coordinates[1]]
  4948.     # 距離の計算(ウエイトの設定)
  4949.     @move_wait     = (@move_coordinates[2] - @move_coordinates[0]).abs +
  4950.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  4951.   end
  4952.   if RTAB
  4953.   alias original_x true_x
  4954.   alias original_y true_y
  4955.   else
  4956.   alias original_x screen_x
  4957.   alias original_y screen_y
  4958.   end
  4959.   #--------------------------------------------------------------------------
  4960.   # ● バトル画面 X 座標の取得(カメラ補正無し)
  4961.   #--------------------------------------------------------------------------
  4962.   def true_x
  4963.     return original_x + @ox
  4964.   end
  4965.   #--------------------------------------------------------------------------
  4966.   # ● バトル画面 Y 座標の取得(カメラ補正無し)
  4967.   #--------------------------------------------------------------------------
  4968.   def true_y
  4969.     return original_y - @height / 2 + @oy
  4970.   end
  4971.   #--------------------------------------------------------------------------
  4972.   # ● バトル画面 X 座標の取得
  4973.   #--------------------------------------------------------------------------
  4974.   def screen_x(true_x = self.true_x)
  4975.     return true_x * @real_zoom + @real_x
  4976.   end
  4977.   #--------------------------------------------------------------------------
  4978.   # ● バトル画面 Y 座標の取得
  4979.   #--------------------------------------------------------------------------
  4980.   def screen_y(true_y = self.true_y)
  4981.     return true_y * @real_zoom + @real_y
  4982.   end
  4983.   #--------------------------------------------------------------------------
  4984.   # ● バトル画面 X 座標の取得(移動などしていない場合)
  4985.   #--------------------------------------------------------------------------
  4986.   def base_x(true_x = self.true_x)
  4987.     return (true_x - @ox) * @real_zoom + @real_x
  4988.   end
  4989.   #--------------------------------------------------------------------------
  4990.   # ● バトル画面 Y 座標の取得(移動などしていない場合)
  4991.   #--------------------------------------------------------------------------
  4992.   def base_y(true_y = self.true_y)
  4993.     return (true_y - @oy) * @real_zoom + @real_y
  4994.   end
  4995. end
  4996. #==============================================================================
  4997. # ■ Game_Party
  4998. #==============================================================================
  4999. class Game_Party
  5000.   #--------------------------------------------------------------------------
  5001.   # ● アクターを加える
  5002.   #     actor_id : アクター ID
  5003.   #--------------------------------------------------------------------------
  5004.   alias side_view_add_actor add_actor
  5005.   def add_actor(actor_id)
  5006.     # アクターを取得
  5007.     actor = $game_actors[actor_id]
  5008.     # サイドビューデータの初期化
  5009.     actor.start_battle
  5010.     # 戻す
  5011.     side_view_add_actor(actor_id)
  5012.   end
  5013. end
  5014. #==============================================================================
  5015. # ■ Scene_Battle
  5016. #==============================================================================
  5017. class Scene_Battle
  5018.   include Side_view
  5019.   #--------------------------------------------------------------------------
  5020.   # ● 公開インスタンス変数
  5021.   #--------------------------------------------------------------------------
  5022.   attr_reader   :phase            # フェーズ
  5023.   attr_reader   :phase4_step      # フェーズ4ステップ
  5024.   attr_reader   :active_battler   # 対象の配列
  5025.   attr_reader   :target_battlers  # 対象の配列
  5026.   attr_reader   :animation1_id    # 行動アニメID
  5027.   attr_reader   :animation2_id    # 対象アニメID
  5028.   #--------------------------------------------------------------------------
  5029.   # ● メイン処理
  5030.   #--------------------------------------------------------------------------
  5031.   alias side_view_main main
  5032.   def main
  5033.     # バトラー初期化
  5034.     for battler in $game_party.actors + $game_troop.enemies
  5035.       battler.start_battle
  5036.     end
  5037.     # 戻す
  5038.     side_view_main
  5039.   end
  5040.   #--------------------------------------------------------------------------
  5041.   # ● 閃き判定
  5042.   #--------------------------------------------------------------------------
  5043.   def flash?
  5044.     return @flash_flag ? true : false
  5045.   end  
  5046.   #--------------------------------------------------------------------------
  5047.   # ● 閃きアニメ待ち時間取得
  5048.   #--------------------------------------------------------------------------
  5049.   def flash_duration
  5050.     animation = nil
  5051.     if FLASH_ANIME
  5052.       animation = $data_animations[FLASH_ANIMATION_ID]
  5053.     end
  5054.     return animation != nil ? animation.frame_max * 2 + 2 : 0
  5055.   end
  5056.   #--------------------------------------------------------------------------
  5057.   # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  5058.   #--------------------------------------------------------------------------
  5059.   alias side_view_update_phase4_step2 update_phase4_step2
  5060.   def update_phase4_step2(*arg)
  5061.     battler = convert_battler2(*arg)
  5062.     battler.action
  5063.     side_view_update_phase4_step2(*arg)
  5064.   end
  5065.   #--------------------------------------------------------------------------
  5066.   # ● フレーム更新 (メインフェーズ ステップ 3 : 行動側アニメーション)
  5067.   #--------------------------------------------------------------------------
  5068.   alias side_view_update_phase4_step3 update_phase4_step3
  5069.   def update_phase4_step3(*arg)
  5070.     battler = convert_battler2(*arg)
  5071.     return if !battler.animation1_on and battler.action? and !battler.flash?
  5072.     if battler.flash? and FLASH_ANIME
  5073.       battler.flash_flag["normal"] = true
  5074.     end
  5075.     side_view_update_phase4_step3(*arg)
  5076.   end
  5077.   #--------------------------------------------------------------------------
  5078.   # ● フレーム更新 (メインフェーズ ステップ 4 : 対象側アニメーション)
  5079.   #--------------------------------------------------------------------------
  5080.   alias side_view_update_phase4_step4 update_phase4_step4
  5081.   def update_phase4_step4(*arg)
  5082.     battler = convert_battler2(*arg)
  5083.     targets = RTAB ? battler.target : @target_battlers
  5084.     return if !battler.animation2_on and battler.action?
  5085.     side_view_update_phase4_step4(*arg)
  5086.     for target in targets
  5087.       if RTAB
  5088.         value = nil
  5089.         if target.damage_sp.include?(battler)
  5090.           value = target.damage_sp[battler]
  5091.         end
  5092.         if target.damage.include?(battler)
  5093.           if value == nil or value == "Miss"
  5094.             value = target.damage[battler]
  5095.           elsif value.is_a?(Numeric) && value > 0
  5096.             value = target.damage[battler] == "Miss" ? value : target.damage[battler]
  5097.           end
  5098.         end
  5099.       else
  5100.         value = target.damage
  5101.       end
  5102.       if target.is_a?(Game_Actor)
  5103.         # ダメージの場合
  5104.         if value.is_a?(Numeric) && value > 0
  5105.           # シェイクを開始
  5106.           target.shake = true
  5107.         end
  5108.       elsif target.is_a?(Game_Enemy)
  5109.         # ダメージの場合
  5110.         if value.is_a?(Numeric) && value > 0
  5111.           # シェイクを開始
  5112.           target.shake = true
  5113.         end
  5114.       end
  5115.     end
  5116.   end
  5117.   #--------------------------------------------------------------------------
  5118.   # ● プレバトルフェーズ開始
  5119.   #--------------------------------------------------------------------------
  5120.   alias start_phase1_correct start_phase1
  5121.   def start_phase1
  5122.     # カメラの設定
  5123.     # 元々フロントビュー向けの数値になっているため
  5124.     @zoom_rate = [1.0, 1.0]
  5125.     start_phase1_correct
  5126.   end
  5127.   #--------------------------------------------------------------------------
  5128.   # ● アクターコマンドフェーズ開始
  5129.   #--------------------------------------------------------------------------
  5130.   alias start_phase3_correct start_phase3
  5131.   def start_phase3
  5132.     battler = convert_battler
  5133.     start_phase3_correct
  5134.     if RTAB
  5135.       # カメラの設定
  5136.       # 元々フロントビュー向けの数値になっているため
  5137.       @camera = "command"
  5138.       @spriteset.screen_target(0, 0, 1.0)
  5139.     end
  5140.   end
  5141. end
  5142.  
  5143. class Spriteset_Battle
  5144.   include Side_view
  5145.   #--------------------------------------------------------------------------
  5146.   # ● オブジェクト初期化
  5147.   #--------------------------------------------------------------------------
  5148.   alias side_veiw_initialize initialize
  5149.   def initialize
  5150.     side_veiw_initialize
  5151.     # アクタースプライトを解放
  5152.     for sprite in @actor_sprites
  5153.       sprite.dispose
  5154.     end
  5155.     # アクタースプライトを作成
  5156.     @actor_sprites = []
  5157.     for i in 1..Party_max
  5158.       @actor_sprites.push(Sprite_Battler.new(@viewport1))
  5159.     end
  5160.     update
  5161.   end
  5162.   #--------------------------------------------------------------------------
  5163.   # ● 画面のスクロール
  5164.   #--------------------------------------------------------------------------
  5165.   if method_defined?("screen_scroll")
  5166.   alias side_view_screen_scroll screen_scroll
  5167.   def screen_scroll
  5168.     side_view_screen_scroll
  5169.     # アクターの位置補正
  5170.     for actor in $game_party.actors
  5171.       actor.real_x = @real_x
  5172.       actor.real_y = @real_y
  5173.       actor.real_zoom = @real_zoom
  5174.     end
  5175.   end
  5176.   end
  5177. end
  5178.  
  5179. class Sprite_Battler < RPG::Sprite
  5180.   include Side_view
  5181.   #--------------------------------------------------------------------------
  5182.   # ● オブジェクト初期化
  5183.   #     viewport : ビューポート
  5184.   #     battler  : バトラー (Game_Battler)
  5185.   #--------------------------------------------------------------------------
  5186.   def initialize(viewport, battler = nil)
  5187.     super(viewport)
  5188.     @battler = battler
  5189.     @battler_visible = false
  5190.     @weapon = Sprite_Weapon.new(viewport, battler)
  5191.     @flying = Sprite_Flying.new(viewport, battler)
  5192.     @shadow = []
  5193.     @fly = 0
  5194.     @fly_direction = 1
  5195.     @rand = rand(10)
  5196.     self.effect_clear
  5197.   end
  5198.   #--------------------------------------------------------------------------
  5199.   # ● 解放
  5200.   #--------------------------------------------------------------------------
  5201.   alias side_view_dispose dispose
  5202.   def dispose
  5203.     side_view_dispose
  5204.     @weapon.dispose
  5205.     @flying.dispose
  5206.     if @_target_sprite != nil
  5207.       @_target_sprite.bitmap.dispose
  5208.       @_target_sprite.dispose
  5209.       @_target_sprite = nil
  5210.     end
  5211.   end
  5212.   #--------------------------------------------------------------------------
  5213.   # ● フレーム更新
  5214.   #--------------------------------------------------------------------------
  5215.   def update
  5216.     super
  5217.     # バトラーが nil の場合
  5218.     if @battler == nil
  5219.       self.bitmap = nil
  5220.       @weapon.bitmap = nil
  5221.       loop_animation(nil)
  5222.       return
  5223.     end
  5224.     # バトラー更新
  5225.     @battler.update
  5226.     # バトラーアニメのデータ取得
  5227.     @anime_type = @battler.anime_type
  5228.     # ファイル名か色相が現在のものと異なる場合
  5229.     if @battler.is_a?(Game_Actor)
  5230.       change = (@battler.character_name != @battler_name or @battler.character_hue != @battler_hue)
  5231.     elsif @battler.is_a?(Game_Enemy)
  5232.       change = (@battler.battler_name != @battler_name or @battler.battler_hue != @battler_hue)
  5233.     else
  5234.       return
  5235.     end
  5236.     if change
  5237.       # ビットマップを取得、設定
  5238.       if @battler.is_a?(Game_Actor)
  5239.         @battler_name = @battler.character_name
  5240.         @battler_hue = @battler.character_hue
  5241.         self.bitmap = RPG::Cache.character(@battler_name, @battler_hue)
  5242.         @width = bitmap.width / 4
  5243.         @height = bitmap.height / 4
  5244.       else
  5245.         @battler_name = @battler.battler_name
  5246.         @battler_hue = @battler.battler_hue
  5247.         self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  5248.         @width = bitmap.width
  5249.         @height = bitmap.height
  5250.       end
  5251.       self.ox = @width / 2
  5252.       self.oy = @height / 2
  5253.       @battler.height = @height
  5254.       @flag = true
  5255.       # 戦闘不能または隠れ状態なら不透明度を 0 にする
  5256.       if @battler.dead? or @battler.hidden
  5257.         self.opacity = 0
  5258.       end
  5259.     end
  5260.     if @battler.is_a?(Game_Actor) and
  5261.       (@battler.anime_type != @anime_type or @battler.pattern != @pattern or @flag)
  5262.       # ビットマップを取得、設定
  5263.       @pattern = @battler.pattern
  5264.       self.ox = @width / 2
  5265.       self.oy = @height / 2
  5266.       @sx = @pattern * @width
  5267.       @sy = @anime_type % 4 * @height
  5268.       self.src_rect.set(@sx, @sy, @width, @height)
  5269.       self.zoom_x = CHAR_ZOOM
  5270.       self.zoom_y = CHAR_ZOOM
  5271.       @battler.height = @height
  5272.       @flag = false
  5273.     end
  5274.     # 飛行
  5275.     update_fly
  5276.     # シェイク
  5277.     update_shake
  5278.     # 回転
  5279.     update_turning
  5280.     # 反転
  5281.     update_reverse   
  5282.     # 移動
  5283.     update_moving
  5284.     # 追加アニメ
  5285.     update_add_anime
  5286.     # エフェクト効果の適用
  5287.     update_effect
  5288.     # アニメーション ID が現在のものと異なる場合
  5289.     flag = RTAB ? true : @battler.damage == nil
  5290.     if flag and @battler.state_animation_id != @state_animation_id
  5291.       @state_animation_id = @battler.state_animation_id
  5292.       loop_animation($data_animations[@state_animation_id])
  5293.     end
  5294.     # シェイク
  5295.     if @battler.shake
  5296.       self.start_shake(5, 5, 5)
  5297.       @battler.shake = false
  5298.     end
  5299.     # 明滅
  5300.     if @battler.blink
  5301.       blink_on
  5302.     else
  5303.       blink_off
  5304.     end
  5305.     # 不可視の場合
  5306.     unless @battler_visible
  5307.       flag = RTAB ? (@battler.damage.size < 2 or @battler.damage_pop.size < 2) :
  5308.                     (@battler.damage == nil or @battler.damage_pop)
  5309.       # 出現
  5310.       if not @battler.hidden and not @battler.dead? and flag
  5311.         appear
  5312.         @battler_visible = true
  5313.       end
  5314.     end
  5315.     if RTAB
  5316.     # ダメージ
  5317.     for battler in @battler.damage_pop
  5318.       if battler[0].class == Array
  5319.         if battler[0][1] >= 0
  5320.           $scene.skill_se
  5321.         else
  5322.           $scene.levelup_se
  5323.         end
  5324.         damage(@battler.damage[battler[0]], false, 2)
  5325.       else
  5326.         damage(@battler.damage[battler[0]], @battler.critical[battler[0]])
  5327.       end
  5328.       if @battler.damage_sp.include?(battler[0])
  5329.         damage(@battler.damage_sp[battler[0]],
  5330.                 @battler.critical[battler[0]], 1)
  5331.         @battler.damage_sp.delete(battler[0])
  5332.       end
  5333.       @battler.damage_pop.delete(battler[0])
  5334.       @battler.damage.delete(battler[0])
  5335.       @battler.critical.delete(battler[0])
  5336.     end
  5337.     end
  5338.     # 可視の場合
  5339.     if @battler_visible
  5340.       # 武器アニメ
  5341.       @weapon.battler = @battler
  5342.       @weapon.update
  5343.       # 遠距離アニメ
  5344.       @flying.battler = @battler
  5345.       @flying.update
  5346.       # 逃走
  5347.       if @battler.hidden
  5348.         $game_system.se_play($data_system.escape_se)
  5349.         escape
  5350.         @battler_visible = false
  5351.       end
  5352.       # 白フラッシュ
  5353.       if @battler.white_flash
  5354.         whiten
  5355.         @battler.white_flash = false
  5356.       end
  5357.       if RTAB
  5358.       # アニメーション
  5359.       if !@battler.animation.empty?
  5360.         for animation in @battler.animation.reverse
  5361.           if animation[2]
  5362.             animation($data_animations[animation[0]], animation[1], true)
  5363.           else
  5364.             animation($data_animations[animation[0]], animation[1])
  5365.           end
  5366.           @battler.animation.delete(animation)
  5367.         end
  5368.       end
  5369.       else
  5370.       # アニメーション
  5371.       if @battler.animation_id != 0
  5372.         animation = $data_animations[@battler.animation_id]
  5373.         animation(animation, @battler.animation_hit)
  5374.         @battler.animation_id = 0
  5375.       end
  5376.       end
  5377.       # ダメージ
  5378.       if !RTAB and @battler.damage_pop
  5379.         damage(@battler.damage, @battler.critical)
  5380.         @battler.damage = nil
  5381.         @battler.critical = false
  5382.         @battler.damage_pop = false
  5383.       end
  5384.       flag = RTAB ? (@battler.damage.empty? and $scene.dead_ok?(@battler)) :
  5385.                      @battler.damage == nil
  5386.       # コラプス
  5387.       if flag and @battler.dead?
  5388.         if @battler.is_a?(Game_Actor)
  5389.           $game_system.se_play($data_system.actor_collapse_se)
  5390.         elsif @battler.is_a?(Game_Enemy)
  5391.           $game_system.se_play($data_system.enemy_collapse_se)
  5392.         end
  5393.         collapse
  5394.         @battler_visible = false
  5395.       end
  5396.     end
  5397.     # スプライトの座標を設定
  5398.     self.x = @battler.screen_x + @effect_ox
  5399.     self.y = @battler.screen_y + @effect_oy
  5400.     self.z = @battler.screen_z
  5401.     self.zoom_x = @battler.real_zoom
  5402.     self.zoom_y = @battler.real_zoom
  5403.     # ウェイトカウントを減らす
  5404.     @battler.wait_count -= 1
  5405.     @battler.wait_count2 -= 1
  5406.     # アニメーション待ち時間取得
  5407.     @battler.animation_duration = @_animation_duration
  5408.     if @battler.is_a?(Game_Actor)
  5409.       self.zoom_x *= CHAR_ZOOM
  5410.       self.zoom_y *= CHAR_ZOOM
  5411.       @weapon.x = self.x + 2
  5412.       @weapon.y = self.y + 6
  5413.       @weapon.angle = 75 - (4 - @battler.pattern) * 45
  5414.       if self.mirror
  5415.         @weapon.angle += @weapon.angle - 180
  5416.       end
  5417.     end
  5418.     # 残像
  5419.     if @battler.shadow
  5420.       if Graphics.frame_count % 2 == 0
  5421.         shadow = ::Sprite.new(self.viewport)
  5422.         shadow.bitmap = self.bitmap.dup
  5423.         shadow.x = self.x
  5424.         shadow.y = self.y
  5425.         shadow.ox = self.ox
  5426.         shadow.oy = self.oy
  5427.         shadow.mirror = self.mirror
  5428.         shadow.angle = self.angle
  5429.         shadow.opacity = 160
  5430.         shadow.zoom_x = self.zoom_x
  5431.         shadow.zoom_y = self.zoom_y
  5432.         if @battler.is_a?(Game_Actor)
  5433.           shadow.src_rect.set(@sx, @sy, @width, @height)
  5434.         else
  5435.           shadow.src_rect.set(0, 0, @width, @height)
  5436.         end
  5437.         @shadow.push([shadow,duration = 10,@battler.true_x + @effect_ox,@battler.true_y + @effect_oy])
  5438.       end
  5439.     end
  5440.     for s in @shadow
  5441.       if !s[0].disposed?
  5442.         s[0].update
  5443.         s[1] -= 1
  5444.         if s[1] < 1
  5445.           if s[0].bitmap != nil
  5446.             s[0].bitmap.dispose
  5447.           end
  5448.           s[0].dispose
  5449.         else
  5450.           s[0].x = @battler.screen_x(s[2])
  5451.           s[0].y = @battler.screen_y(s[3])
  5452.         end
  5453.       else
  5454.         s = nil
  5455.       end
  5456.     end
  5457.     @shadow.compact!
  5458.   end
  5459.   #--------------------------------------------------------------------------
  5460.   # ● エフェクトによる座標系の更新
  5461.   #--------------------------------------------------------------------------
  5462.   def update_effect
  5463.     # 角度の修正
  5464.     if @_upside_down
  5465.       self.angle = (@_turning + 180) % 360
  5466.     else
  5467.       self.angle = @_turning
  5468.     end
  5469.     # X 座標の修正値
  5470.     @effect_ox = @_shake + @_moving[0]
  5471.     # Y 座標の修正値
  5472.     @effect_oy = -@fly + @_moving[1]
  5473.     if  @_animation == nil or (RTAB and @_animation.empty?)
  5474.       self.effect_clear
  5475.     end
  5476.   end
  5477.   #--------------------------------------------------------------------------
  5478.   # ● シェイク更新
  5479.   #--------------------------------------------------------------------------
  5480.   def update_shake
  5481.     if @_shake_duration >= 1 or @_shake != 0
  5482.       delta = (@_shake_power * @_shake_speed * @_shake_direction) / 10.0
  5483.       if @_shake_duration <= 1 and @_shake * (@_shake + delta) < 0
  5484.         @_shake = 0
  5485.       else
  5486.         @_shake += delta
  5487.       end
  5488.       if @_shake > @_shake_power * 2
  5489.         @_shake_direction = -1
  5490.       end
  5491.       if @_shake < - @_shake_power * 2
  5492.         @_shake_direction = 1
  5493.       end
  5494.       if @_shake_duration >= 1
  5495.         @_shake_duration -= 1
  5496.       end
  5497.     end
  5498.   end
  5499.   #--------------------------------------------------------------------------
  5500.   # ● 飛行更新
  5501.   #--------------------------------------------------------------------------
  5502.   def update_fly
  5503.     if @rand > 0
  5504.       @rand -= 1
  5505.       return
  5506.     end
  5507.     if @battler.fly != 0
  5508.       if @fly < @battler.fly / 4
  5509.         @fly_direction = 1
  5510.       elsif @fly > @battler.fly / 2
  5511.         @fly_direction = -1
  5512.       end
  5513.       @fly += 0.5 * @fly_direction
  5514.     end
  5515.   end
  5516.   #--------------------------------------------------------------------------
  5517.   # ● 回転更新
  5518.   #--------------------------------------------------------------------------
  5519.   def update_turning
  5520.     if @_turning_duration > 0 or @_turning != 0
  5521.       @_turning += @_turning_direction * @_turning_speed / 2.0
  5522.       # 残り回転数を減らす
  5523.       if @_turning_direction == -1
  5524.         if @_turning_duration > 0 and @_turning < 0
  5525.           @_turning_duration -= 1
  5526.         end
  5527.       elsif @_turning_direction == 1
  5528.         if @_turning_duration > 0 and @_turning >= 360
  5529.           @_turning_duration -= 1
  5530.         end
  5531.       end
  5532.       # 以下補正
  5533.       while @_turning < 0
  5534.         @_turning += 360
  5535.       end
  5536.       if @_turning_duration <= 0
  5537.         @_turning = 0
  5538.       end
  5539.       @_turning %= 360
  5540.     end
  5541.   end
  5542.   #--------------------------------------------------------------------------
  5543.   # ● 左右反転更新
  5544.   #--------------------------------------------------------------------------
  5545.   def update_reverse
  5546.     if @last_reverse != (@_reverse or @battler.reverse)
  5547.       self.mirror = (@_reverse or @battler.reverse)
  5548.       @last_reverse = (@_reverse or @battler.reverse)
  5549.     end
  5550.   end
  5551.   #--------------------------------------------------------------------------
  5552.   # ● 移動更新
  5553.   #--------------------------------------------------------------------------
  5554.   def update_moving
  5555.     @move_distance = (@_move_coordinates[2] - @_move_coordinates[0]).abs +
  5556.                      (@_move_coordinates[3] - @_move_coordinates[1]).abs
  5557.     if @move_distance > 0
  5558.       return if @_moving[0] == @_move_coordinates[0] and @_moving[1] == @_move_coordinates[1]
  5559.       array = @_move_coordinates
  5560.       x = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @_move_duration) / @move_distance.to_f).to_i
  5561.       y = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @_move_duration) / @move_distance.to_f).to_i
  5562.       @_moving = [x, y]
  5563.       if @_move_quick_return and @_move_duration == 0
  5564.         @_move_coordinates = [0,0,array[0],array[1]]
  5565.         @_move_duration = @move_distance
  5566.       end
  5567.       @_move_duration -= @_move_speed
  5568.       @_move_duration = [@_move_duration, 0].max
  5569.     end
  5570.   end
  5571.   #--------------------------------------------------------------------------
  5572.   # ● 追加アニメ更新 (RTAB限定機能)
  5573.   #--------------------------------------------------------------------------
  5574.   def update_add_anime
  5575.     if RTAB
  5576.     # アニメーション
  5577.     if @_add_anime_id != 0
  5578.       animation = $data_animations[@_add_anime_id]
  5579.       animation(animation, true)
  5580.       @_add_anime_id = 0
  5581.     end
  5582.     end
  5583.   end
  5584.   #--------------------------------------------------------------------------
  5585.   # ● エフェクト初期化
  5586.   #--------------------------------------------------------------------------
  5587.   def effect_clear
  5588.     @_effect_ox = 0
  5589.     @_effect_oy = 0
  5590.     @_shake_power = 0
  5591.     @_shake_speed = 0
  5592.     @_shake_duration = 0
  5593.     @_shake_direction = 1
  5594.     @_shake = 0
  5595.     @_upside_down = false
  5596.     @_reverse = false
  5597.     @_turning_direction = 1
  5598.     @_turning_speed = 0
  5599.     @_turning_duration = 0
  5600.     @_turning = 0
  5601.     @_move_quick_return = true
  5602.     @_move_speed = 0
  5603.     @_move_coordinates = [0,0,0,0]
  5604.     @_move_jump = false
  5605.     @_move_duration = 0
  5606.     @_moving = [0,0]
  5607.     @_add_anime_id = 0
  5608.   end
  5609.   #--------------------------------------------------------------------------
  5610.   # ● シェイクの開始
  5611.   #     power    : 強さ
  5612.   #     speed    : 速さ
  5613.   #     duration : 時間
  5614.   #--------------------------------------------------------------------------
  5615.   def start_shake(power, speed, duration)
  5616.     @_shake_power = power
  5617.     @_shake_speed = speed
  5618.     @_shake_duration = duration
  5619.   end
  5620.   #--------------------------------------------------------------------------
  5621.   # ● 上下反転を開始
  5622.   #--------------------------------------------------------------------------
  5623.   def start_upside_down
  5624.     @_upside_down = @_upside_down ? false : true
  5625.   end
  5626.   #--------------------------------------------------------------------------
  5627.   # ● 左右反転を開始
  5628.   #--------------------------------------------------------------------------
  5629.   def start_reverse
  5630.     @_reverse = @_reverse ? false : true
  5631.   end
  5632.   #--------------------------------------------------------------------------
  5633.   # ● 回転を開始
  5634.   #     direction: 方向
  5635.   #     speed    : 速さ
  5636.   #     duration : 時間
  5637.   #--------------------------------------------------------------------------
  5638.   def start_turning(direction, speed, duration)
  5639.     @_turning_direction = direction
  5640.     @_turning_speed = speed
  5641.     @_turning_duration = duration
  5642.     @_turning = @_turning_direction == 1 ? 0 : 360
  5643.   end
  5644.   #--------------------------------------------------------------------------
  5645.   # ● 移動を開始
  5646.   #     quick_return : 戻るかどうか
  5647.   #     speed        : 速さ
  5648.   #     x            : X 座標
  5649.   #     y            : Y 座標
  5650.   #--------------------------------------------------------------------------
  5651.   def start_moving(quick_return, speed, x, y)
  5652.     @_move_quick_return = quick_return == 0 ? false : true
  5653.     @_move_speed = speed
  5654.     @_move_coordinates = [x,y,@_move_coordinates[0],@_move_coordinates[1]]
  5655.     distance = (@_move_coordinates[2] - @_move_coordinates[0]).abs +
  5656.                (@_move_coordinates[3] - @_move_coordinates[1]).abs
  5657.     @_move_duration = distance
  5658.   end
  5659.   #--------------------------------------------------------------------------
  5660.   # ● アニメ追加を開始
  5661.   #     id           : ID
  5662.   #     hit          : 命中フラッグ
  5663.   #--------------------------------------------------------------------------
  5664.   def start_add_anime(id)
  5665.     @_add_anime_id = id
  5666.   end
  5667.   #--------------------------------------------------------------------------
  5668.   # ● 各種エフェクトの開始判定
  5669.   #--------------------------------------------------------------------------
  5670.   if !method_defined?("side_view_animation_process_timing")
  5671.     alias side_view_animation_process_timing animation_process_timing
  5672.   end
  5673.   def animation_process_timing(timing, hit)
  5674.     side_view_animation_process_timing(timing, hit)
  5675.     if (timing.condition == 0) or
  5676.        (timing.condition == 1 and hit == true) or
  5677.        (timing.condition == 2 and hit == false)
  5678.       if timing.se.name =~ SHAKE_FILE
  5679.         names = timing.se.name.split(/#/)
  5680.         power    = names[1].nil? ? SHAKE_POWER    : names[1].to_i
  5681.         speed    = names[2].nil? ? SHAKE_SPEED    : names[2].to_i
  5682.         duration = names[3].nil? ? SHAKE_DURATION : names[3].to_i
  5683.         # シェイクを開始
  5684.         self.start_shake(power, speed, duration)
  5685.       end
  5686.       if timing.se.name == UPSIDE_DOWN_FILE
  5687.         # 上下反転を開始
  5688.         self.start_upside_down
  5689.       end
  5690.       if timing.se.name == REVERSE_FILE
  5691.         # 左右反転を開始
  5692.         self.start_reverse
  5693.       end
  5694.       if timing.se.name =~ TURNING_FILE
  5695.         names = timing.se.name.split(/#/)
  5696.         direction = names[1].nil? ? TURNING_DIRECTION : names[1].to_i
  5697.         speed     = names[2].nil? ? TURNING_SPEED     : names[2].to_i
  5698.         duration  = names[3].nil? ? TURNING_DURATION  : names[3].to_i
  5699.         # 回転を開始
  5700.         self.start_turning(direction, speed, duration)
  5701.       end
  5702.       if timing.se.name =~ MOVE_FILE
  5703.         names = timing.se.name.split(/#/)
  5704.         quick_return= names[1].nil? ? MOVE_RETURN      : names[1].to_i
  5705.         speed       = names[2].nil? ? MOVE_SPEED       : names[2].to_i
  5706.         x           = names[3].nil? ? MOVE_COORDINATES[0] : names[3].to_i
  5707.         y           = names[3].nil? ? MOVE_COORDINATES[1] : names[4].to_i
  5708.         # 移動を開始
  5709.         self.start_moving(quick_return, speed, x, y)
  5710.       end
  5711.       if timing.se.name =~ ADD_ANIME_FILE
  5712.         names = timing.se.name.split(/#/)
  5713.         id = names[1].nil? ? ADD_ANIME_ID      : names[1].to_i
  5714.         # アニメ追加を開始
  5715.         self.start_add_anime(id)
  5716.       end
  5717.     end
  5718.   end
  5719. end
  5720. #==============================================================================
  5721. # ■ Sprite_Weapon
  5722. #------------------------------------------------------------------------------
  5723. #  バトラー表示用のスプライトです。Game_Battler クラスのインスタンスを監視し、
  5724. # スプライトの状態を自動的に変化させます。
  5725. #==============================================================================
  5726.  
  5727. class Sprite_Weapon < RPG::Sprite
  5728.   include Side_view
  5729.   #--------------------------------------------------------------------------
  5730.   # ● 公開インスタンス変数
  5731.   #--------------------------------------------------------------------------
  5732.   attr_accessor :battler                  # バトラー
  5733.   attr_reader   :cw                       # グラフィックの幅
  5734.   attr_reader   :ch                       # グラフィックの高さ
  5735.   #--------------------------------------------------------------------------
  5736.   # ● オブジェクト初期化
  5737.   #     viewport : ビューポート
  5738.   #     battler  : バトラー (Game_Battler)
  5739.   #--------------------------------------------------------------------------
  5740.   def initialize(viewport, battler = nil)
  5741.     super(viewport)
  5742.     @battler = battler
  5743.     @battler_visible = false
  5744.   end
  5745.   #--------------------------------------------------------------------------
  5746.   # ● 解放
  5747.   #--------------------------------------------------------------------------
  5748.   def dispose
  5749.     if self.bitmap != nil
  5750.       self.bitmap.dispose
  5751.     end
  5752.     super
  5753.   end
  5754.   #--------------------------------------------------------------------------
  5755.   # ● フレーム更新
  5756.   #--------------------------------------------------------------------------
  5757.   def update
  5758.     super
  5759.     # バトラーが nil の場合
  5760.     if @battler == nil or !@battler.is_a?(Game_Actor)
  5761.       self.bitmap = nil
  5762.       return
  5763.     end
  5764.     # ウエポンアニメのデータ取得
  5765.     @weapon_anime_type = @battler.weapon_anime_type(@battler.condition)
  5766.     # 設定が「非表示」の場合
  5767.     if !@weapon_anime_type[1] or @weapon_anime_type[0].nil?
  5768.       self.visible = false
  5769.       return
  5770.     else
  5771.       self.visible = true
  5772.     end
  5773.     # ファイル名が現在のものと異なる場合
  5774.     if @weapon_anime_type[0] != @weapon_name
  5775.       @weapon_name = @weapon_anime_type[0]
  5776.       # ビットマップを取得、設定
  5777.       self.bitmap = RPG::Cache.icon(@weapon_name)
  5778.       @width = bitmap.width
  5779.       @height = bitmap.height
  5780.       @flag = true
  5781.     end
  5782.     # 現在アニメパターンが現在のものと異なる場合
  5783.     if @pattern != @battler.pattern or @flag or @condition != @battler.condition
  5784.       @pattern = @battler.pattern
  5785.       @condition = @battler.condition
  5786.       self.ox = @width
  5787.       self.oy = @height
  5788.       self.z = battler.screen_z
  5789.       self.zoom_x = @battler.real_zoom * CHAR_ZOOM
  5790.       self.zoom_y = @battler.real_zoom * CHAR_ZOOM
  5791.       self.src_rect.set(0, 0, @width, @height)
  5792.       self.opacity = 255
  5793.       # バトラーより手前に表示
  5794.       if @weapon_anime_type[2]
  5795.         self.z += 10
  5796.       # バトラーより奥に表示
  5797.       else
  5798.         self.z -= 10
  5799.       end
  5800.       @flag = false
  5801.     end
  5802.   end
  5803. end
  5804.  
  5805. #==============================================================================
  5806. # ■ Sprite_Flying
  5807. #------------------------------------------------------------------------------
  5808. #  バトラー表示用のスプライトです。Game_Battler クラスのインスタンスを監視し、
  5809. # スプライトの状態を自動的に変化させます。
  5810. #==============================================================================
  5811.  
  5812. class Sprite_Flying < RPG::Sprite
  5813.   include Side_view
  5814.   #--------------------------------------------------------------------------
  5815.   # ● 公開インスタンス変数
  5816.   #--------------------------------------------------------------------------
  5817.   attr_accessor :battler                  # バトラー
  5818.   #--------------------------------------------------------------------------
  5819.   # ● オブジェクト初期化
  5820.   #     viewport : ビューポート
  5821.   #     battler  : バトラー (Game_Battler)
  5822.   #--------------------------------------------------------------------------
  5823.   def initialize(viewport, battler = nil)
  5824.     super(viewport)
  5825.     @battler = battler
  5826.     @battler_visible = false
  5827.   end
  5828.   #--------------------------------------------------------------------------
  5829.   # ● 解放
  5830.   #--------------------------------------------------------------------------
  5831.   def dispose
  5832.     if self.bitmap != nil
  5833.       self.bitmap.dispose
  5834.     end
  5835.     super
  5836.   end
  5837.   #--------------------------------------------------------------------------
  5838.   # ● フレーム更新
  5839.   #--------------------------------------------------------------------------
  5840.   def update
  5841.     super
  5842.     # バトラーが nil の場合
  5843.     if @battler == nil
  5844.       self.bitmap = nil
  5845.       loop_animation(nil)
  5846.       return
  5847.     end
  5848.     # 遠距離アニメ
  5849.     flying_animation = @battler.flying_animation
  5850.     flying_start = flying_animation[0]
  5851.     flying_end   = flying_animation[1]
  5852.     # アニメーション ID が現在のものと異なる場合
  5853.     if @anime_id != @battler.flying_anime[0]
  5854.       @anime_id = @battler.flying_anime[0]
  5855.       @animation = $data_animations[@anime_id]
  5856.     end
  5857.     # アニメーション 開始
  5858.     if flying_start
  5859.       loop_animation(@animation)
  5860.     elsif flying_end
  5861.       loop_animation(nil)
  5862.     end
  5863.     self.x = @battler.flying_x
  5864.     self.y = @battler.flying_y
  5865.     self.z = @battler.screen_z + 1000
  5866.   end
  5867. end
  5868.  
  5869. module RPG
  5870.   class Skill
  5871.     #--------------------------------------------------------------------------
  5872.     # ● 魔法かどうかの判断
  5873.     #--------------------------------------------------------------------------
  5874.     def magic?
  5875.       if @atk_f == 0
  5876.         return true
  5877.       else
  5878.         return false
  5879.       end
  5880.     end
  5881.   end
  5882. end
  5883.  
  5884. # アローカーソルの位置修正
  5885.  
  5886. class Arrow_Actor < Arrow_Base
  5887.   include Side_view
  5888.   #--------------------------------------------------------------------------
  5889.   # ● フレーム更新
  5890.   #--------------------------------------------------------------------------
  5891.   alias side_view_update update
  5892.   def update
  5893.     side_view_update
  5894.     # スプライトの座標を設定
  5895.     if self.actor != nil && (self.x != self.actor.screen_x + ARROW_OX or self.y != self.actor.screen_y + ARROW_OY)
  5896.       self.x = self.actor.screen_x + ARROW_OX
  5897.       self.y = self.actor.screen_y + ARROW_OY
  5898.     end
  5899.   end
  5900. end
  5901. class Arrow_Enemy < Arrow_Base
  5902.   include Side_view
  5903.   #--------------------------------------------------------------------------
  5904.   # ● フレーム更新
  5905.   #--------------------------------------------------------------------------
  5906.   alias side_view_update update
  5907.   def update
  5908.     side_view_update
  5909.     # スプライトの座標を設定
  5910.     if self.enemy != nil && self.y != self.enemy.screen_y + self.enemy.height/2
  5911.       self.x = self.enemy.screen_x
  5912.       self.y = self.enemy.screen_y + self.enemy.height/2
  5913.     end
  5914.   end
  5915. 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#★★★★★★★★★★★★★
出现问题


  我对于脚本神马的一窍不通     想求求各位路过的大神们解救

Lv4.逐梦者

梦石
0
星屑
12157
在线时间
4435 小时
注册时间
2014-4-11
帖子
5955

开拓者

2
发表于 2014-11-19 12:15:40 | 只看该作者
本帖最后由 yang1zhi 于 2014-11-19 12:17 编辑

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


菜鸟横版modified(敌人也玩行走图)
RUBY 代码复制
  1. =begin
  2. ###############################################################################
  3.  
  4. 全局行走图战斗 v1.1
  5. 本版本只经低测试,可能存在某些bug。
  6. 请注意更新
  7. [url]http://rpg.blue/viewthread.php?tid=129875&extra=page%3D1[/url]
  8.  
  9. ###############################################################################
  10. ------------------------------------------------------------------------------
  11. 经过了两次的修改,终于完全实现了远距离攻击的效果(弓箭、铳类)
  12. 另外,也实现了简单的回旋攻击(类似回力镖的攻击)和攻击道具(类似石头或炸弹)
  13.  
  14. 这个脚本的更动分为2部分:
  15. 1)战斗动作 - 新加了数个动作,如:“弓箭攻击”、“远距离发动”等等
  16. 2)战斗动画 - 基本上是脚本原带的。只是这个功能被隐藏起来了。现在已恢复。
  17.  
  18. 用法:
  19. 在相应的脚本行加入武器/技能/道具的数据库id(id之间要用“,”来分开)
  20. 如果不要某些功能的话就随便填一个外太空id就行了(没有用到的id)
  21. 1)战斗动作(角色/行走图的动作)
  22. 脚本355行:  远程武器的id  (普通攻击时使用远程射击)
  23. 脚本357行:  回旋武器的id  (普通攻击时会飞回手上的武器,如:回力镖)
  24. 脚本370行:  远程技能的id  (使用技能时是远程射击)
  25. 脚本372行:  回旋技能的id  (使用技能时,飞出的武器会飞回手上)
  26.  
  27. 2)战斗动画(显示‘对象方的动画’之前先显示‘飞行武器射去敌人身上’的动画)
  28. 脚本453行:  回旋武器的id  (攻击时会显示一段类似回力镖的动画)
  29. 脚本455行:  弓箭武器的id  (攻击时会显示箭射去敌人身上的动画)
  30. 脚本457行:  铳类武器的id  (攻击时会显示子弹射去敌人身上的动画)
  31. 脚本470行:  回旋技能的id  (技能使用时会显示一段类似回力镖的动画)
  32. 脚本472行:  弓箭技能的id  (技能使用时会显示箭射去敌人身上的动画)
  33. 脚本474行:  铳类技能的id  (技能使用时会显示子弹射去敌人身上的动画)
  34. 脚本486行:  抛击道具的id  (使用该道具时,道具被丢到敌人身上)
  35.  
  36. 〉注意:
  37. 〉‘飞行武器射去敌人身上’的动画是在设定id之后的那句脚本里面设置
  38. 〉例子:(脚本第455和456行)
  39. 〉       when 17,18,19,20    #远程武器1(弓箭类)的id
  40. 〉       return [101,32,false,false]
  41. 〉这样,武器17~20(都是弓箭)在显示‘对象方的动画’之前会先显示第101号动画
  42. 〉而动画的轨道是从使用者身上直到敌人身上(实现子弹射出的效果)
  43.  
  44. 还有:
  45. 战斗队伍的画面位置已经被修改过,
  46. 让角色的位置与默认的战斗背景图不会有视觉上的冲突。
  47. 如果要更改请去脚本第113-116行改改就行了。
  48.  
  49. 脚本‘Arrow_Enemy’和‘Arrow_Actor’被稍微修改过(可以无视)
  50.  
  51. 这个范例附带了
  52. 一张经过修改的战斗背景图(027-castle03),其他的战斗背景图可以使用默认的。
  53. 一套横版的默认敌人的战斗图(从行走图改过来的)
  54.  
  55. =end                                                        #modify by darkten
  56.  
  57. ###############################################################################
  58.  
  59. =begin
  60.  
  61. 此版本更新了以下几点:
  62.  1.支持敌人行走图战斗
  63.  2.修正与RTAB并用的bug。
  64.  3.支持敌人也玩小石头
  65.  
  66. 使用方法:
  67.  1.敌人的战斗图名称要与敌人的行走图名称相一致,具体查看本范例编号为2的敌人。
  68.  2.请自行设置 160 ~ 173 行的内容。
  69.  
  70.                                                                   by ONEWateR
  71. =end
  72. ###############################################################################
  73.  
  74. module Side_view
  75.   #--------------------------------------------------------------------------
  76.   # ● 是否与RATB并用 ☆自动识别(这到是不错~省了~)
  77.   #    在Scene_Battle计算方法是否是方法synthe?
  78.   #    在自动不想认识的时候,请重写。
  79.   #--------------------------------------------------------------------------
  80.   if Scene_Battle.method_defined?("synthe?")
  81.     RTAB = true
  82.   else
  83.     RTAB = false
  84.   end
  85.   #--------------------------------------------------------------------------
  86.   # ● 改正RATB中的位置误差 ☆自动识别
  87.   #    在自动不想认识的时候,请重写。
  88.   #--------------------------------------------------------------------------
  89.   def camera_correctness
  90.     return false if !RTAB
  91.     begin
  92.       return $scene.drive
  93.     rescue
  94.       return false
  95.     end
  96.   end
  97.   #--------------------------------------------------------------------------
  98.   # ● 队伍中的最大人数
  99.   #--------------------------------------------------------------------------
  100.   Party_max = 4
  101.   #--------------------------------------------------------------------------
  102.   # ● 战斗图的扩大率(1.0的时候是保持原有大小)
  103.   #--------------------------------------------------------------------------
  104.   CHAR_ZOOM = 1.0
  105.   #--------------------------------------------------------------------------
  106.   # ● 光标的位置修正(基本不需要改~)
  107.   #--------------------------------------------------------------------------
  108.   ARROW_OX = 0
  109.   ARROW_OY = 64
  110.   #--------------------------------------------------------------------------
  111.   # ● 名状态作为飞行管理的排列(不知道什么意思....)
  112.   #--------------------------------------------------------------------------
  113.   FLY_STATES = ["飛行"]
  114.   #--------------------------------------------------------------------------
  115.   # ● 战斗画面的位置
  116.   #--------------------------------------------------------------------------
  117.   PARTY_X = 455     # 队伍 X 位置
  118.   PARTY_Y = 200     # 队伍 Y 位置
  119.   FORMATION_X = 15  # 各个角色之间的间隔 X
  120.   FORMATION_Y = 35  # 各个角色之间的间隔 Y
  121.   #--------------------------------------------------------------------------
  122.   # ● 自定义常数
  123.   #--------------------------------------------------------------------------
  124.   NORMAL   = "NORMAL"
  125.   WALK_R   = "WALK_R"
  126.   WALK_L   = "WALK_L"
  127.   ATTACK   = "ATTACK"
  128.   ATTACK_R = "ATTACK_R"
  129.   ATTACK_L = "ATTACK_L"
  130.   MAGIC    = "MAGIC"
  131.   ITEM     = "ITEM"
  132.   # 动画的设定
  133.   ANIME = {
  134.     # [画像ID,是否循环,アニメスピード,动画速度,不能指向动画,武器放在右手or左手]
  135.     NORMAL            => [1,true , 0,false, true ,""    ], # 通常待击
  136.     WALK_R            => [2,true , 2,false, false,""    ], # 右移动
  137.     WALK_L            => [1,true , 2,false, false,""    ], # 左移动
  138.     ATTACK_R          => [1,false, 2,true , false,"右手"], # 右手攻击
  139.     ATTACK_L          => [1,false, 2,true , false,"左手"], # 左手攻击
  140.     MAGIC             => [1,false, 2,false, false,""    ], # 右手攻击
  141.     ITEM              => [1,false, 2,false, false,""    ], # 左手攻击
  142.     }
  143.  
  144.   # 债务不履行声明价值的设定(一个字一个字翻译的,不知道啥意思)  
  145.   ANIME.default = [1,false,12,false,"",""]
  146.  
  147.   # 在行动设定的时候 右手攻击 or 左手攻击 辨别を(这个不知道什么意思)的ANIME
  148.   # "角色动画变更#ATTACK"在玩了と(还是不知道啥意思..)的时候,辨别ATTACK_R或者ATTACK_L
  149.   DUAL_WEAPONS_ANIME = [ATTACK]
  150.  
  151.  
  152.   #--------------------------------------------------------------------------
  153.   # ● 战斗图不是行走图的敌人编号
  154.   #--------------------------------------------------------------------------
  155.   NOT_CHARACTER_EMEMY = [999]
  156.   #--------------------------------------------------------------------------
  157.   # ● 敌人使用的武器
  158.   #    敌人编号=>武器编号
  159.   #--------------------------------------------------------------------------
  160.   EMEMY_WEAPO = {33=>2,7=>17}
  161.   EMEMY_WEAPO = {8=>9,9=>10}
  162.   #--------------------------------------------------------------------------
  163.   # ● 敌人使用的武器 (二刀流)
  164.   #    敌人编号=>武器编号
  165.   #--------------------------------------------------------------------------
  166.   EMEMY_WEAPO2 = {}
  167.  
  168.  
  169.   #--------------------------------------------------------------------------
  170.   # ● 摇晃的设定
  171.   #--------------------------------------------------------------------------
  172.   SHAKE_FILE = "摇晃"  # 文件名
  173.   SHAKE_POWER = 5          # 强度
  174.   SHAKE_SPEED = 5          # 速度
  175.   SHAKE_DURATION = 5      # 时间
  176.   #--------------------------------------------------------------------------
  177.   # ● 上下反转地的设定
  178.   #--------------------------------------------------------------------------
  179.   UPSIDE_DOWN_FILE = "上下反转" # 文件名
  180.   #--------------------------------------------------------------------------
  181.   # ● 左右反转地的设定
  182.   #--------------------------------------------------------------------------
  183.   REVERSE_FILE = "左右反转" # 文件名
  184.   #--------------------------------------------------------------------------
  185.   # ● 回转地的设定
  186.   #--------------------------------------------------------------------------
  187.   TURNING_FILE = "回转" # 文件名
  188.   TURNING_DIRECTION = 1 # 方向(1.逆时针,-1.顺时针)(|||-_-汗..怎么还有用-1做带入值的...)
  189.   TURNING_SPEED = 40    # 速度
  190.   TURNING_DURATION = 1  # 回转数
  191.   #--------------------------------------------------------------------------
  192.   # ● 移动的设定
  193.   #--------------------------------------------------------------------------
  194.   MOVE_FILE = "移动"             # 文件名
  195.   MOVE_RETURN = 1                # 回到原来的位置吗?(光写了个1,也不知道不回到该怎么写?0?)
  196.   MOVE_SPEED = 32                # 速度
  197.   MOVE_COORDINATES = [0,-640]    # 原来位置的相对坐标
  198.   #--------------------------------------------------------------------------
  199.   # ● 动画追加的设定
  200.   #--------------------------------------------------------------------------
  201.   ADD_ANIME_FILE = "动画追加"  # 文件名
  202.   ADD_ANIME_ID = 0               # 动画的ID
  203.   #--------------------------------------------------------------------------
  204.   # ● 债务不履行声明和RTAB的数据转换
  205.   #--------------------------------------------------------------------------
  206.   def convert_battler
  207.     return RTAB ? @active_actor : @active_battler
  208.   end
  209.   #--------------------------------------------------------------------------
  210.   # ● 债务不履行声明和RTAB的数据转换2
  211.   #--------------------------------------------------------------------------
  212.   def convert_battler2(*arg)
  213.     return RTAB ? arg[0] : @active_battler
  214.   end
  215. end
  216.  
  217. #--------------------------------------------------------------------------
  218. # ● 行动設定
  219. #--------------------------------------------------------------------------
  220. module BattleActions
  221.  
  222.   # 下のものはあくまでも一例なので
  223.   # 独自に作ってください。
  224.  
  225.   Actions = {
  226.  
  227.   "通常攻撃" => [
  228.  
  229.   "閃きアニメ",
  230.   "アクターアニメ変更#WALK_L",
  231.   "移動#target,32,0,64,0",
  232.   "行動アニメ",
  233.   "アクターアニメ変更#ATTACK",
  234.   "遠距離アニメ",
  235.   "対象アニメ",
  236.   "アクターアニメ変更#WALK_L",
  237.   "SEの演奏#016-Jump02,80,100",
  238.   "移動#self,0,0,48,32",
  239.   "終了"
  240.   ],
  241.  
  242.   "エネミー攻撃" => [
  243.  
  244.   "閃きアニメ",
  245.   "アクターアニメ変更#WALK_L",
  246.   "移動#self,-36,0,12,0",
  247.   "行動アニメ",
  248.   "アクターアニメ変更#ATTACK",
  249.   "遠距離アニメ",
  250.   "対象アニメ",
  251.   "アクターアニメ変更#WALK_L",
  252.   "移動#self,0,0,12,0",
  253.   "終了"
  254.   ],
  255.  
  256.   "術発動" => [
  257.  
  258.   "閃きアニメ",
  259.   "アクターアニメ変更#WALK_L",
  260.   "移動#self,-32,0,4,0",
  261.   "アクターアニメ変更#MAGIC",
  262.   "行動アニメ",
  263.   "ウエイト#15",
  264.   "遠距離アニメ",
  265.   "対象アニメ",
  266.   "アクターアニメ変更#WALK_L",
  267.   "移動#self,0,0,4,2",
  268.   "終了"
  269.   ],
  270.  
  271.   "アイテム使用" => [
  272.  
  273.   "閃きアニメ",
  274.   "アクターアニメ変更#WALK_L",
  275.   "移動#self,-32,0,4,0",
  276.   "行動アニメ",
  277.   "アクターアニメ変更#ITEM",
  278.   "ウエイト#15",
  279.   "遠距離アニメ",
  280.   "対象アニメ",
  281.   "アクターアニメ変更#WALK_L",
  282.   "移動#self,0,0,4,2",
  283.   "終了"
  284.   ],
  285.  
  286.   "払い抜け" => [
  287.  
  288.   "閃きアニメ",
  289.   "アクターアニメ変更#WALK_L",
  290.   "移動#target_near,50,0,48,30",  
  291.   "左右反転",
  292.   "アクターアニメ固定#ATTACK#3",
  293.   "行動アニメ",
  294.   "SEの演奏#135-Light01,100,100",
  295.   "アニメーションの表示#self,42",
  296.   "ウエイト#15",
  297.   "左右反転",
  298.   "残像表示",
  299.   "移動#target_far,-50,0,48,0",
  300.   "対象アニメ",
  301.   "残像消去",
  302.   "アニメ固定解除",
  303.   "アクターアニメ変更#WALK_L",
  304.   "移動#self,0,0,48,1,0",
  305.   "終了"
  306.   ],
  307.  
  308.   "弓箭攻撃" => [
  309.  
  310.   "閃きアニメ",
  311.   "アクターアニメ変更#WALK_L",
  312.   "移動#self,-32,0,4,0",
  313.   "行動アニメ",
  314.   "アクターアニメ変更#ATTACK",
  315.   "遠距離アニメ",
  316.   "対象アニメ",
  317.   "アクターアニメ変更#WALK_L",
  318.   "移動#self,0,0,4,2",
  319.   "終了"
  320.   ],
  321.  
  322.   "回旋攻撃" => [
  323.  
  324.   "閃きアニメ",
  325.   "アクターアニメ変更#WALK_L",
  326.   "移動#self,-32,0,4,0",
  327.   "行動アニメ",
  328.   "アクターアニメ変更#STAND_L",  
  329.   "遠距離アニメ",
  330.   "対象アニメ",
  331.   "アクターアニメ変更#WALK_L",
  332.   "移動#self,0,0,4,2",
  333.   "終了"
  334.   ],
  335.  
  336.   "远距离発動" => [
  337.  
  338.   "閃きアニメ",
  339.   "アクターアニメ変更#WALK_L",
  340.   "移動#self,-32,0,4,0",
  341.   "アクターアニメ変更#MAGIC",
  342.   "行動アニメ",
  343.   "アクターアニメ変更#ATTACK",
  344.   "遠距離アニメ",
  345.   "対象アニメ",
  346.   "アクターアニメ変更#WALK_L",
  347.   "移動#self,0,0,4,2",
  348.   "終了"
  349.   ],
  350.  
  351.   "回旋発動" => [
  352.  
  353.   "閃きアニメ",
  354.   "アクターアニメ変更#WALK_L",
  355.   "移動#self,-32,0,4,0",
  356.   "アクターアニメ変更#MAGIC",
  357.   "行動アニメ",
  358.   "アクターアニメ変更#STAND_L",  
  359.   "遠距離アニメ",
  360.   "対象アニメ",
  361.   "アクターアニメ変更#WALK_L",
  362.   "移動#self,0,0,4,2",
  363.   "終了"
  364.   ],
  365.  
  366.   } # ここで終わり 消さないでください
  367.  
  368. end
  369.  
  370. module RPG
  371.   class Weapon
  372.     #--------------------------------------------------------------------------
  373.     # ● アクション設定
  374.     #--------------------------------------------------------------------------
  375.     def battle_actions
  376.       case @id
  377.       when 17,18,19,20,21,22,23,24  # 远程武器的id回旋攻撃
  378.         return BattleActions::Actions["弓箭攻撃"]
  379.       when 34                       # 回旋武器的id
  380.         return BattleActions::Actions["回旋攻撃"]
  381.       end
  382.       else
  383.       return BattleActions::Actions["通常攻撃"]
  384.     end
  385.   end
  386.   class Skill
  387.     #--------------------------------------------------------------------------
  388.     # ● アクション設定
  389.     #--------------------------------------------------------------------------
  390.     def battle_actions
  391.       case @id
  392.       when 2,3,4,98,73,74,75,76,77,78,79,80  # 远程技能的id
  393.         return BattleActions::Actions["远距离発動"]
  394.       when 82                     # 回旋技能的id
  395.         return BattleActions::Actions["回旋発動"]
  396.       end
  397.       else
  398.       if self.magic?
  399.         return BattleActions::Actions["術発動"]
  400.       else
  401.         return BattleActions::Actions["払い抜け"]
  402.       end
  403.     end
  404.   end
  405.   class Item
  406.     #--------------------------------------------------------------------------
  407.     # ● アクション設定
  408.     #--------------------------------------------------------------------------
  409.     def battle_actions
  410.       return BattleActions::Actions["アイテム使用"]
  411.     end
  412.   end
  413. end
  414. #class Game_Enemy < Game_Battler
  415.   #--------------------------------------------------------------------------
  416.   # ● アクション設定
  417.   #--------------------------------------------------------------------------
  418. #~  def battle_actions
  419. #~    return BattleActions::Actions["エネミー攻撃"]
  420. #~  end
  421. #end
  422. =begin
  423. #--------------------------------------------------------------------------
  424. # ● 遠距離アニメーション
  425. #--------------------------------------------------------------------------
  426.  ☆ 説明
  427.  
  428.    行動者から対象者にアニメを飛ばします。
  429.    飛ばすアニメを データベース‐アニメーション で作ります。
  430.     [アニメーションID, スピード, 往復するか?,直線(false)or曲線(true)] で指定します。
  431.  
  432.  
  433.   ● カスタマイズ方法
  434.     
  435.     case @id
  436.     when 17,18,19,20
  437.       return [101,32,false,false]
  438.     when 21,22,23,24
  439.       return [102,32,false,false]
  440.     end
  441.     return 0
  442.     
  443.     のように描くとID別に指定可能です。
  444.     
  445.     
  446.   ● アニメーションID
  447.  
  448.   飛ばすアニメーションIDです。短い場合は繰り返しで表示されます。
  449.  
  450.     
  451.   ● スピード
  452.  
  453.   大きいほうが早い(0だとアニメは移動しません)
  454.  
  455.   1 = 1フレームで1ドット進むと考えてください。
  456.  
  457.   ● 往復するか?
  458.  
  459.   true とした場合、ブーメランのようにアニメが戻ります。
  460.  
  461.   ● 直線(false)or曲線(true)
  462.  
  463.   true  = 対象に向かって曲線で、アニメが飛びます。(修正の余地ありですが・・・)
  464.   false = 対象に向かって直線で、アニメが飛びます。
  465.     
  466. =end
  467. module RPG
  468.   class Weapon
  469.     #--------------------------------------------------------------------------
  470.     # ● 遠距離アニメーション
  471.     #--------------------------------------------------------------------------
  472.     def flying_anime
  473.       # ID 指定 の例(武器的id,分类是根据飞行武器的动画id)
  474.       case @id
  475.       when 34             #回旋武器(类似回力镖)的id
  476.         return [103,32,true,true]
  477.       when 17,18,19,20    #远程武器1(弓箭类)的id
  478.         return [101,32,false,false]
  479.       when 21,22,23,24    #远程武器2(铳类)的id
  480.         return [102,32,false,false]
  481.       end
  482.       return [0,0,false,false]
  483.     end
  484.   end
  485.   class Skill
  486.     #--------------------------------------------------------------------------
  487.     # ● 遠距離アニメーション
  488.     #--------------------------------------------------------------------------
  489.     def flying_anime
  490.       # ID 指定 の例(技能的id,分类是根据飞行武器的动画id)
  491.       case @id
  492.       when 82             #回旋技能(类似回力镖)的id
  493.         return [103,32,true,true]
  494.       when 73,74,75,76    #远程技能1(弓箭类)的id
  495.         return [101,32,false,false]
  496.       when 4,77,78,79,80    #远程技能2(铳类)的id
  497.         return [125,22,false,false]
  498.         when 2    #投石头的id
  499.         return [116,12,false,false]
  500.         when 3    #投石堆的id
  501.         return [124,12,false,false]
  502.         when 98    #泼沙的id
  503.         return [110,22,false,false]
  504.       end
  505.       return [0,0,false,false]
  506.     end
  507.   end
  508.   class Item
  509.     #--------------------------------------------------------------------------
  510.     # ● 遠距離アニメーション
  511.     #--------------------------------------------------------------------------
  512.     def flying_anime
  513.       case @id
  514.       when 49    #抛击类道具(如炸弹一类)的id
  515.         return [112,12,false,true]
  516.         when 61    #抛击类道具(如炸弹一类)的id
  517.         return [116,12,false,true]
  518.       end
  519.       return [0,0,false,false]
  520.     end
  521.   end
  522. end
  523.  
  524. #class Game_Enemy < Game_Battler
  525.   #--------------------------------------------------------------------------
  526.   # ● 遠距離アニメーション
  527.   #--------------------------------------------------------------------------
  528. #~  def flying_anime
  529. #~    return [0,0,false,false]
  530. #~  end
  531. #end
  532.  
  533.  
  534.  
  535. #==============================================================================
  536. # ■ Game_Battler
  537. #==============================================================================
  538. class Game_Battler
  539.   include Side_view
  540.   #--------------------------------------------------------------------------
  541.   # ● 追加・公開インスタンス変数
  542.   #--------------------------------------------------------------------------
  543.   attr_accessor :height                  # 画像の高さ
  544.   attr_accessor :real_x                  # X座標補正
  545.   attr_accessor :real_y                  # Y座標補正
  546.   attr_accessor :real_zoom               # 拡大率
  547.   attr_accessor :wait_count              # アニメーション 待ち時間
  548.   attr_accessor :wait_count2             # アニメーション 待ち時間2
  549.   attr_accessor :pattern                 # アニメーション カウント(キャラ)
  550.   attr_accessor :shake                   # シェイク開始フラッグ
  551.   attr_accessor :reverse                 # 左右反転フラッグ
  552.   attr_accessor :shadow                  # 残像フラッグ
  553.   attr_accessor :flash_flag              # 閃きフラッグ
  554.   attr_reader   :ox                      # X座標補正
  555.   attr_reader   :oy                      # Y座標補正
  556.   attr_reader   :flying_x                # 遠距離アニメX座標
  557.   attr_reader   :flying_y                # 遠距離アニメY座標
  558.   attr_reader   :flying_anime            # 遠距離アニメ
  559.   attr_reader   :animation1_on           # 行動アニメ開始フラッグ
  560.   attr_reader   :animation2_on           # 対象アニメ開始フラッグ
  561.   #--------------------------------------------------------------------------
  562.   # ● デフォルトのアニメーション待ち時間を取得
  563.   #--------------------------------------------------------------------------
  564.   def animation_duration=(animation_duration)
  565.     @_animation_duration = animation_duration
  566.   end
  567.   #--------------------------------------------------------------------------
  568.   # ● バトル開始時のセットアップ
  569.   #--------------------------------------------------------------------------
  570.   def start_battle
  571.     [url=home.php?mod=space&uid=291977]@height[/url] = 0
  572.     @real_x = 0
  573.     @real_y = 0
  574.     @real_zoom = 1.0
  575.     @battler_condition = ""
  576.     @action = nil
  577.     @battle_actions = []
  578.     @battler_action = false
  579.     [url=home.php?mod=space&uid=2129346]@step[/url] = 0
  580.     @anime_on = false
  581.     @wait_count = 0
  582.     @wait_count2 = 0
  583.     @ox = 0
  584.     @oy = 0
  585.     @pattern = 0
  586.     @pattern_log = true
  587.     @pattern_freeze = false
  588.     @condition_freeze = false
  589.     @active = false
  590.     @move_distance = nil
  591.     @move_wait = 0
  592.     @move_coordinates = [0,0,0,0]
  593.     @flying_distance = nil
  594.     @flying_wait = 0
  595.     @flying_x = 0
  596.     @flying_y = 0
  597.     @flash_flag = {}
  598.     self.flying_clear
  599.   end
  600.   #--------------------------------------------------------------------------
  601.   # ● 移動中判定
  602.   #--------------------------------------------------------------------------
  603.   def moving?
  604.     # X座標補正または、Y座標補正が0でなければ、移動中
  605.     return (@ox != 0 or @oy != 0)
  606.   end
  607.   #--------------------------------------------------------------------------
  608.   # ● 移動終了判定
  609.   #--------------------------------------------------------------------------
  610.   def move_end?
  611.     return (@ox == @move_coordinates[0] and @oy == @move_coordinates[1])
  612.   end
  613.   #--------------------------------------------------------------------------
  614.   # ● アクション開始設定
  615.   #--------------------------------------------------------------------------
  616.   def action(flag = true)
  617.     @battler_action = flag
  618.     @animation1_on = false
  619.     @animation2_on = false
  620.     @step = "setup"
  621.   end   
  622.   #--------------------------------------------------------------------------
  623.   # ● アクション中判定
  624.   #--------------------------------------------------------------------------
  625.   def action?
  626.     return @battler_action
  627.   end
  628.   #--------------------------------------------------------------------------
  629.   # ● 閃き判定
  630.   #--------------------------------------------------------------------------
  631.   def flash?
  632.     return @flash_flg
  633.   end
  634.   #--------------------------------------------------------------------------
  635.   # ● 戦闘不能判定
  636.   #--------------------------------------------------------------------------
  637.   def anime_dead?
  638.     if $game_temp.in_battle and !RTAB
  639.       if [2,3,4,5].include?($scene.phase4_step)
  640.         return @last_dead
  641.       end
  642.     end
  643.     return @last_dead = self.dead?
  644.   end
  645.   #--------------------------------------------------------------------------
  646.   # ● ピンチ状態判定
  647.   #--------------------------------------------------------------------------
  648.   def crisis?
  649.     if $game_temp.in_battle and !RTAB
  650.       if [2,3,4,5].include?($scene.phase4_step)
  651.         return @last_crisis
  652.       end
  653.     end
  654.     return @last_crisis = (self.hp <= self.maxhp / 4 or badstate?)
  655.   end
  656.   #--------------------------------------------------------------------------
  657.   # ● バッドステート判定
  658.   #--------------------------------------------------------------------------
  659.   def badstate?
  660.     for i in @states
  661.       unless $data_states[i].nonresistance
  662.         return true
  663.       end
  664.     end
  665.     return false
  666.   end
  667.   #--------------------------------------------------------------------------
  668.   # ● 飛行
  669.   #--------------------------------------------------------------------------
  670.   def fly
  671.     if [url=home.php?mod=space&uid=14121]@fly[/url] != nil
  672.       return @fly
  673.     end
  674.     for id in @states
  675.       if FLY_STATES.include?($data_states[id].name)
  676.         return 60
  677.       end
  678.     end
  679.     return 0
  680.   end
  681.   #--------------------------------------------------------------------------
  682.   # ● 遠距離アニメ目標座標の計算
  683.   #--------------------------------------------------------------------------
  684.   def flying_setup
  685.     # 二度目は実行しない
  686.     return if @flying_distance != nil && !camera_correctness
  687.     if RTAB
  688.       targets = @target
  689.     else
  690.       targets = $scene.target_battlers
  691.     end
  692.     # 目的座標を計算
  693.     @f_target_x = 0
  694.     @f_target_y = 0
  695.     for t in targets
  696.       @f_target_x += t.screen_x
  697.       @f_target_y += t.screen_y
  698.     end
  699.     if targets != []
  700.       @f_target_x /= targets.size
  701.       @f_target_y /= targets.size
  702.     else
  703.       @flying_distance = 0
  704.       return
  705.     end
  706.     # 距離の計算
  707.     @flying_distance = (self.screen_x - @f_target_x).abs + (self.screen_y - @f_target_y).abs
  708.   end
  709.   #--------------------------------------------------------------------------
  710.   # ● 遠距離アニメ
  711.   #--------------------------------------------------------------------------
  712.   def flying_animation
  713.     # 戻る
  714.     if @step != "flying" or @flying_distance.nil?
  715.       return [false,true]
  716.     end
  717.     # あらかじめ計算
  718.     self_x = self.screen_x
  719.     self_y = self.screen_y
  720.     @flying_distance = @flying_distance == 0 ? 1 : @flying_distance
  721.     n1 = @flying_wait / @flying_distance.to_f
  722.     if @flying_distance - @flying_wait > @flying_distance / 2
  723.       n2 = 1.0 + 10.0 * @flying_wait / @flying_distance.to_f
  724.     else
  725.       n2 = 1.0 + 10.0 * (@flying_distance - @flying_wait) / @flying_distance.to_f
  726.     end
  727.     if !@flying_anime[4]
  728.       # 直線移動
  729.       x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
  730.       y = (self_y + 1.0 * (@f_target_y - self_y) * n1).to_i
  731.     else
  732.       # 曲線移動
  733.       if !@flying_proceed_end
  734.         x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
  735.         y = (self_y + 1.0 * (@f_target_y - self_y) * n1 - n2**2).to_i
  736.       else
  737.         x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
  738.         y = (self_y + 1.0 * (@f_target_y - self_y) * n1 + n2**2).to_i
  739.       end
  740.     end
  741.     # 座標代入
  742.     @flying_x = x
  743.     @flying_y = y
  744.     # ウエイト
  745.     if !@flying_proceed_end
  746.       # 開始
  747.       @flying_proceed_start = @flying_wait == 0
  748.       @flying_wait += @flying_anime[1]
  749.       @flying_wait = [@flying_wait,@flying_distance].min
  750.       @flying_proceed_end = @flying_wait == @flying_distance
  751.     else
  752.       # 開始
  753.       @flying_return_start = @flying_wait == @flying_distance
  754.       @flying_wait -= @flying_anime[1]
  755.       @flying_wait = [@flying_wait,0].max
  756.       @flying_return_end = @flying_wait == 0
  757.     end
  758.     if @flying_anime[1] == 0
  759.       @flying_end = true
  760.     elsif !@flying_anime[2]
  761.       @flying_end = @flying_proceed_end
  762.     else
  763.       @flying_end = @flying_return_end
  764.     end
  765.     # 値を返す(アニメ開始,アニメ終了)
  766.     return [@flying_proceed_start,@flying_end]
  767.   end
  768.   #--------------------------------------------------------------------------
  769.   # ● 遠距離アニメ初期化
  770.   #--------------------------------------------------------------------------
  771.   def flying_clear
  772.     @flying_proceed_start = false
  773.     @flying_proceed_end = false
  774.     @flying_return_start = false
  775.     @flying_return_end = false
  776.     @flying_end = false
  777.     @flying_anime = [0,0,false]
  778.   end
  779.   #--------------------------------------------------------------------------
  780.   # ● 移動
  781.   #--------------------------------------------------------------------------
  782.   def move
  783.     # 距離の計算
  784.     @move_distance = (@move_coordinates[2] - @move_coordinates[0]).abs +
  785.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  786.     if @move_distance > 0
  787.       return if @ox == @move_coordinates[0] and @oy == @move_coordinates[1]
  788.       array = @move_coordinates
  789.       # ジャンプ補正値の計算
  790.       if @move_distance - @move_wait > @move_distance / 2
  791.         jump = (@move_action[4] * @move_wait / @move_distance.to_f)**2        
  792.       else
  793.         jump = (@move_action[4] * (@move_distance - @move_wait) / @move_distance.to_f)**2
  794.       end
  795.       jump = @move_action[4] > 0 ? -jump : jump
  796.       @ox = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @move_wait) / @move_distance.to_f).to_i
  797.  
  798.       @oy = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @move_wait) / @move_distance.to_f + jump).to_i
  799.       # ウエイト
  800.       @move_wait -= @move_action[3]
  801.       @move_wait = [@move_wait,0].max
  802.     end
  803.   end
  804.   #--------------------------------------------------------------------------
  805.   # ● 移動アクションの取得
  806.   #--------------------------------------------------------------------------
  807.   def get_move_action
  808.     string = @action.split(/#/)[1]
  809.     string = string.split(/,/)
  810.     @move_action = [string[0],string[1].to_i,string[2].to_i,string[3].to_i,string[4].to_i,string[5].to_i]
  811.   end
  812.   #--------------------------------------------------------------------------
  813.   # ● アクションの取得
  814.   #--------------------------------------------------------------------------
  815.   def get_step
  816.     if @action.nil?
  817.       @step = "finish"
  818.       return
  819.     end
  820.     string = @action.split(/#/)[0]
  821.     if string =~ "移動"
  822.       @step = "moving_setup"
  823.     elsif string =~ "アクターアニメ実行"
  824.       @step = "action"
  825.     elsif string =~ "遠距離アニメ"
  826.       @step = "flying"
  827.     elsif string =~ "アクターアニメ変更"
  828.       @step = "change"
  829.     elsif string =~ "行動アニメ"
  830.       @step = "animation1"
  831.     elsif string =~ "対象アニメ"
  832.       @step = "animation2"
  833.     elsif string =~ "ウエイト"
  834.       @step = "wait"
  835.     elsif string =~ "左右反転"
  836.       @step = "reverse"
  837.     elsif string =~ "閃きアニメ"
  838.       @step = "flash"
  839.     elsif string =~ "残像表示"
  840.       @step = "shadow_on"
  841.     elsif string =~ "残像消去"
  842.       @step = "shadow_off"
  843.     elsif string =~ "アクターアニメ固定"
  844.       @step = "freeze"
  845.     elsif string =~ "アニメ固定解除"
  846.       @step = "freeze_lifting"
  847.     elsif string =~ "アニメーションの表示"
  848.       @step = "animation_start"
  849.     elsif string =~ "SEの演奏"
  850.       @step = "play_se"
  851.     else
  852.       @step = "finish"
  853.     end
  854.   end
  855.   #--------------------------------------------------------------------------
  856.   # ● フレーム更新 (次のアクションへ)
  857.   #--------------------------------------------------------------------------
  858.   def update_next
  859.     @action = @battle_actions.shift
  860.     @step = get_step
  861.   end
  862.   #--------------------------------------------------------------------------
  863.   # ● フレーム更新 (動作取得)
  864.   #--------------------------------------------------------------------------
  865.   def update_setup
  866.     # アクションの取得
  867.     self.get_actions
  868.     @action = @battle_actions.shift
  869.     @step = get_step
  870.   end
  871.   #--------------------------------------------------------------------------
  872.   # ● フレーム更新 (移動取得)
  873.   #--------------------------------------------------------------------------
  874.   def update_moving_setup
  875.     # 移動アクションの取得
  876.     self.get_move_action
  877.     # 移動目標の設定
  878.     self.move_setup
  879.     @step = "moving"
  880.   end
  881.   #--------------------------------------------------------------------------
  882.   # ● フレーム更新 (移動)
  883.   #--------------------------------------------------------------------------
  884.   def update_moving
  885.     # 移動
  886.     self.move
  887.     self.condition = @battler_condition
  888.     # 移動完了したら次のステップへ
  889.     if move_end?
  890.       @wait_count = 2
  891.       @action = @battle_actions.shift
  892.       @step = get_step
  893.     end
  894.   end
  895.   #--------------------------------------------------------------------------
  896.   # ● フレーム更新 (アニメ実行)
  897.   #--------------------------------------------------------------------------
  898.   def update_action
  899.     con = @action.split(/#/)[1]
  900.     # 右手・左手を分ける
  901.     if DUAL_WEAPONS_ANIME.include?(con)
  902.       if !@first_weapon and @second_weapon
  903.         con = con + "_L"
  904.       else
  905.         con = con + "_R"
  906.       end
  907.     end
  908.     # アニメ変更
  909.     self.condition = con
  910.     # ループか否か
  911.     if !ANIME[@battler_condition][1]
  912.       self.anime_on
  913.     end
  914.     @action = @battle_actions.shift
  915.     @step = get_step
  916.   end
  917.   #--------------------------------------------------------------------------
  918.   # ● フレーム更新 (遠距離アニメ)
  919.   #--------------------------------------------------------------------------
  920.   def update_flying
  921.     # 目標の設定
  922.     self.flying_setup
  923.     # 遠距離アニメ終了
  924.     if @flying_end
  925.       self.flying_clear
  926.       @action = @battle_actions.shift
  927.       @step = get_step
  928.     end
  929.   end
  930.   #--------------------------------------------------------------------------
  931.   # ● フレーム更新 (アニメ変更)
  932.   #--------------------------------------------------------------------------
  933.   def update_change
  934.     con = @action.split(/#/)[1]
  935.     # 右手・左手を分ける
  936.     if DUAL_WEAPONS_ANIME.include?(con)
  937.       if !@first_weapon and @second_weapon
  938.         con = con + "_L"
  939.       else
  940.         con = con + "_R"
  941.       end
  942.     end
  943.     # アニメ変更
  944.     self.condition = con
  945.     # ループか否か
  946.     if !ANIME[@battler_condition][1]
  947.       self.anime_on
  948.     end
  949.     @action = @battle_actions.shift
  950.     @step = get_step
  951.   end
  952.   #--------------------------------------------------------------------------
  953.   # ● フレーム更新 (行動アニメ)
  954.   #--------------------------------------------------------------------------
  955.   def update_animation1
  956.     @animation1_on = true
  957.     # 行動アニメの後に行動を開始する
  958.     if $scene.phase4_step == 3
  959.       id = RTAB ? @anime1 : $scene.animation1_id
  960.       animation = $data_animations[id]
  961.       frame_max = animation != nil ? animation.frame_max : 0
  962.       @wait_count2 = frame_max * 2
  963.       return
  964.     end
  965.     @action = @battle_actions.shift
  966.     @step = get_step
  967.   end
  968.   #--------------------------------------------------------------------------
  969.   # ● フレーム更新 (対象アニメ)
  970.   #--------------------------------------------------------------------------
  971.   def update_animation2
  972.     @animation2_on = true
  973.     # 行動アニメの後に行動を開始する
  974.     if $scene.phase4_step == 4
  975.       id = RTAB ? @anime2 : $scene.animation2_id
  976.       animation = $data_animations[id]
  977.       frame_max = animation != nil ? animation.frame_max : 0
  978.       @wait_count2 = frame_max * 2
  979.       return
  980.     end
  981.     @action = @battle_actions.shift
  982.     @step = get_step
  983.   end
  984.   #--------------------------------------------------------------------------
  985.   # ● フレーム更新 (ウエイト)
  986.   #--------------------------------------------------------------------------
  987.   def update_wait
  988.     @wait_count2 = @action.split(/#/)[1].to_i
  989.     @action = @battle_actions.shift
  990.     @step = get_step
  991.   end
  992.   #--------------------------------------------------------------------------
  993.   # ● フレーム更新 (残像表示)
  994.   #--------------------------------------------------------------------------
  995.   def update_shadow_on
  996.     [url=home.php?mod=space&uid=31758]@Shadow[/url] = true
  997.     @action = @battle_actions.shift
  998.     @step = get_step
  999.   end
  1000.   #--------------------------------------------------------------------------
  1001.   # ● フレーム更新 (残像消去)
  1002.   #--------------------------------------------------------------------------
  1003.   def update_shadow_off
  1004.     @shadow = false
  1005.     @action = @battle_actions.shift
  1006.     @step = get_step
  1007.   end
  1008.   #--------------------------------------------------------------------------
  1009.   # ● フレーム更新 (左右反転)
  1010.   #--------------------------------------------------------------------------
  1011.   def update_reverse
  1012.     [url=home.php?mod=space&uid=30269]@reverse[/url] = @reverse ? false : true
  1013.     @action = @battle_actions.shift
  1014.     @step = get_step
  1015.   end
  1016.   #--------------------------------------------------------------------------
  1017.   # ● フレーム更新 (閃きアニメ)
  1018.   #--------------------------------------------------------------------------
  1019.   def update_flash
  1020.     # 閃きアニメの後に行動を開始する
  1021.     if @flash_flag["normal"]
  1022.       @wait_count = $scene.flash_duration
  1023.       @flash_flag["normal"] = false
  1024.       return
  1025.     end
  1026.     @action = @battle_actions.shift
  1027.     @step = get_step
  1028.   end
  1029.   #--------------------------------------------------------------------------
  1030.   # ● フレーム更新 (SEの演奏)
  1031.   #--------------------------------------------------------------------------
  1032.   def update_play_se
  1033.     data = @action.split(/#/)[1]
  1034.     data = data.split(/,/)
  1035.     # SE を演奏
  1036.     Audio.se_play("Audio/SE/" + data[0], data[1].to_i, data[2].to_i)
  1037.     @action = @battle_actions.shift
  1038.     @step = get_step
  1039.   end
  1040.   #--------------------------------------------------------------------------
  1041.   # ● フレーム更新 (アクターアニメ固定)
  1042.   #--------------------------------------------------------------------------
  1043.   def update_freeze
  1044.     con = @action.split(/#/)[1]
  1045.     # 右手・左手を分ける
  1046.     if DUAL_WEAPONS_ANIME.include?(con)
  1047.       if !@first_weapon and @second_weapon
  1048.         con = con + "_L"
  1049.       else
  1050.         con = con + "_R"
  1051.       end
  1052.     end
  1053.     # アニメ変更
  1054.     self.condition = con
  1055.     @pattern = @action.split(/#/)[2].to_i
  1056.     @pattern_freeze = true
  1057.     @condition_freeze = true
  1058.     @action = @battle_actions.shift
  1059.     @step = get_step
  1060.   end
  1061.   #--------------------------------------------------------------------------
  1062.   # ● フレーム更新 (アクターアニメ固定解除)
  1063.   #--------------------------------------------------------------------------
  1064.   def update_freeze_lifting
  1065.     @pattern_freeze = false
  1066.     @condition_freeze = false
  1067.     @action = @battle_actions.shift
  1068.     @step = get_step
  1069.   end
  1070.   #--------------------------------------------------------------------------
  1071.   # ● フレーム更新 (アニメーションの表示)
  1072.   #--------------------------------------------------------------------------
  1073.   def update_animation_start
  1074.     data = @action.split(/#/)[1]
  1075.     data = data.split(/,/)
  1076.     target = data[0]
  1077.     animation_id = data[1].to_i
  1078.     if RTAB
  1079.       case target
  1080.       when "self"
  1081.         @animation.push([animation_id,true])
  1082.       when "target"
  1083.         for tar in @target
  1084.           tar.animation.push([animation_id, true])
  1085.         end
  1086.       end
  1087.     else
  1088.       case target
  1089.       when "self"
  1090.         @animation_id = animation_id
  1091.         @animation_hit = true
  1092.       when "target"
  1093.         for tar in $scene.target_battlers
  1094.           tar.animation_id = animation_id
  1095.           tar.animation_hit = true
  1096.         end
  1097.       end
  1098.     end
  1099.     @action = @battle_actions.shift
  1100.     @step = get_step
  1101.   end
  1102.   #--------------------------------------------------------------------------
  1103.   # ● フレーム更新 (動作終了)
  1104.   #--------------------------------------------------------------------------
  1105.   def update_finish
  1106.     # 動作終了
  1107.     @battler_action = false
  1108.     @step = "setup"
  1109.   end
  1110.   #--------------------------------------------------------------------------
  1111.   # ● バトラーの状態 変更(バトラーグラフィックのタイプ)
  1112.   #--------------------------------------------------------------------------
  1113.   def condition=(condition)
  1114.     return if @condition_freeze
  1115.     @battler_condition = condition
  1116.     @wait_count = ANIME[condition][2]
  1117.   end
  1118.   #--------------------------------------------------------------------------
  1119.   # ● バトラーの状態(バトラーグラフィックのタイプ)
  1120.   #--------------------------------------------------------------------------
  1121.   def condition
  1122.     return @battler_condition
  1123.   end
  1124.   #--------------------------------------------------------------------------
  1125.   # ● フレーム更新
  1126.   #--------------------------------------------------------------------------
  1127.   def update
  1128.     # ウェイト中の場合
  1129.     if @wait_count > 0
  1130.       return
  1131.     end
  1132.     # パターン更新
  1133.     self.char_animation
  1134.     # ウェイト中の場合
  1135.     if @wait_count2 > 0
  1136.       return
  1137.     end
  1138.  
  1139.     # 行動アニメーション
  1140.     if @battler_action
  1141.       method("update_" + @step).call
  1142.       return
  1143.     end
  1144.  
  1145.     # データ初期化
  1146.     @animation1_on = false
  1147.     @animation2_on = false
  1148.     @action = nil
  1149.     @battle_actions = []
  1150.     @move_wait = 0
  1151.     @move_distance = nil
  1152.     @flying_wait = 0
  1153.     @flying_distance = nil
  1154.     [url=home.php?mod=space&uid=14082]@Flash[/url] = false
  1155.  
  1156.     # RTAB対応
  1157.     # 通常・待機
  1158.     return self.condition = NORMAL
  1159.   end
  1160.   #--------------------------------------------------------------------------
  1161.   # ● アクションの取得
  1162.   #--------------------------------------------------------------------------
  1163.   def get_actions
  1164.     skill = $data_skills[self.current_action.skill_id]
  1165.     item = $data_items[self.current_action.item_id]
  1166.     kind = self.current_action.kind
  1167.     # 動作取得
  1168.     @battle_actions = []
  1169.     # スキル
  1170.     if skill != nil && kind == 1
  1171.       @battle_actions = skill.battle_actions.dup
  1172.       @flying_anime = skill.flying_anime
  1173.     # アイテム
  1174.     elsif item != nil && kind == 2
  1175.       @battle_actions = item.battle_actions.dup
  1176.       @flying_anime = item.flying_anime
  1177.     # 左手攻撃
  1178.     elsif !@first_weapon and @second_weapon and (self.is_a?(Game_Actor) or (!self.is_a?(Game_Actor) and !self.nce))
  1179.  
  1180.       @battle_actions = self.battle_actions2.dup
  1181.       @flying_anime = self.flying_anime2
  1182.     # 右手攻撃
  1183.     elsif self.current_action.basic == 0 and
  1184.       (self.is_a?(Game_Actor) or (!self.is_a?(Game_Actor) and !self.nce)) and self.current_action.kind == 0
  1185.       @battle_actions = self.battle_actions1.dup
  1186.       @flying_anime = self.flying_anime1
  1187.     # 通常攻撃
  1188.     elsif self.current_action.basic == 0 and self.current_action.kind == 0
  1189.       # 这里啊~~ =。=b
  1190.       if !self.is_a?(Game_Actor) and !self.nce
  1191.         @battle_actions = self.battle_actions1.dup
  1192.       else
  1193.         @battle_actions = BattleActions::Actions["エネミー攻撃"].dup
  1194.       end
  1195.       @flying_anime = self.flying_anime
  1196.     else
  1197.       @battle_actions = ["終了"]
  1198.       @flying_anime = [0,0,false,false]
  1199.     end
  1200.   end
  1201.   #--------------------------------------------------------------------------
  1202.   # ● ループしないアニメのセット
  1203.   #--------------------------------------------------------------------------
  1204.   def anime_on
  1205.     @pattern = 0
  1206.     @pattern_log = true
  1207.     return
  1208.   end
  1209.   #--------------------------------------------------------------------------
  1210.   # ● パターン更新
  1211.   #--------------------------------------------------------------------------
  1212.   def char_animation
  1213.     # パタン固定の場合もどる
  1214.     return if @pattern_freeze
  1215.     # ループしないアニメの場合 1234 で止まる
  1216.     if !ANIME[@battler_condition][1] && @pattern == 3
  1217.       return
  1218.     end
  1219.     # アニメさせない場合 1 で止まる
  1220.     if ANIME[@battler_condition][4]
  1221.       @pattern = 0
  1222.       return
  1223.     end
  1224.     @pattern = (@pattern + 1) % 4
  1225.   end
  1226.   #--------------------------------------------------------------------------
  1227.   # ● アニメタイプ
  1228.   #--------------------------------------------------------------------------
  1229.   def anime_type
  1230.     return ANIME[self.condition] != nil ? ANIME[self.condition][0] : 0
  1231.   end
  1232. end
  1233. #==============================================================================
  1234. # ■ Game_Actor
  1235. #==============================================================================
  1236. class Game_Actor < Game_Battler
  1237.   include Side_view
  1238.   #--------------------------------------------------------------------------
  1239.   # ● セットアップ
  1240.   #--------------------------------------------------------------------------
  1241.   alias side_view_setup setup
  1242.   def setup(actor_id)
  1243.     side_view_setup(actor_id)
  1244.     start_battle
  1245.   end
  1246.   #--------------------------------------------------------------------------
  1247.   # ● 二刀武器のID取得 ※エラー回避用
  1248.   #--------------------------------------------------------------------------
  1249.   def weapon2_id
  1250.     return @weapon2_id != nil ? @weapon2_id : 0
  1251.   end
  1252.   #--------------------------------------------------------------------------
  1253.   # ● X方向 ポジション 取得 (陣形スクリプト拡張用)
  1254.   #--------------------------------------------------------------------------
  1255.   def position
  1256.     return $data_classes[@class_id].position
  1257.   end
  1258.   #--------------------------------------------------------------------------
  1259.   # ● Y方向 ポジション 取得 (陣形スクリプト拡張用)
  1260.   #--------------------------------------------------------------------------
  1261.   def position2
  1262.     return self.index
  1263.   end
  1264.   #--------------------------------------------------------------------------
  1265.   # ● 武器アニメタイプ
  1266.   #--------------------------------------------------------------------------
  1267.   def weapon_anime_type(type)
  1268.     file_name  = weapon_anime_type0(type)
  1269.     visible   = weapon_anime_type1(type)
  1270.     z         = weapon_anime_type2(type)
  1271.     return [file_name,visible,z]
  1272.   end
  1273.   # 武器アイコン取得
  1274.   def weapon_anime_type0(type)
  1275.     type = ANIME[type][5]
  1276.     return weapon_anime1 if type == "右手"
  1277.     return weapon_anime2 if type == "左手"
  1278.     return nil
  1279.   end
  1280.   # 表示・非表示の取得
  1281.   def weapon_anime_type1(type)
  1282.     return ANIME[type][3]
  1283.   end
  1284.   # バトラーより上に表示するかどうか
  1285.   def weapon_anime_type2(type)
  1286.     type = ANIME[type][5]
  1287.     return true if type == "左手"
  1288.     return false
  1289.   end
  1290.   #--------------------------------------------------------------------------
  1291.   # ● バトル画面 X 座標の取得(カメラ補正無し)
  1292.   #--------------------------------------------------------------------------
  1293.   def true_x
  1294.     return PARTY_X + position * FORMATION_X + @ox
  1295.   end
  1296.   #--------------------------------------------------------------------------
  1297.   # ● バトル画面 Y 座標の取得(カメラ補正無し)
  1298.   #--------------------------------------------------------------------------
  1299.   def true_y
  1300.     # パーティ内の並び順から Y 座標を計算して返す
  1301.     if self.index != nil
  1302.       y = position2 * FORMATION_Y + PARTY_Y + @oy - @height / 2
  1303.       return y
  1304.     else
  1305.       return 0
  1306.     end
  1307.   end
  1308.   #--------------------------------------------------------------------------
  1309.   # ● バトル画面 X 座標の取得
  1310.   #--------------------------------------------------------------------------
  1311.   def screen_x(true_x = self.true_x)
  1312.     return 320 + (true_x - 320) * @real_zoom + @real_x
  1313.   end
  1314.   #--------------------------------------------------------------------------
  1315.   # ● バトル画面 Y 座標の取得
  1316.   #--------------------------------------------------------------------------
  1317.   def screen_y(true_y = self.true_y)
  1318.     return true_y * @real_zoom + @real_y
  1319.   end
  1320.   #--------------------------------------------------------------------------
  1321.   # ● バトル画面 Z 座標の取得
  1322.   #--------------------------------------------------------------------------
  1323.   def screen_z
  1324.     return screen_y + 1000
  1325.   end
  1326.   #--------------------------------------------------------------------------
  1327.   # ● バトル画面 X 座標の取得(移動などしていない場合)
  1328.   #--------------------------------------------------------------------------
  1329.   def base_x
  1330.     return 320 + (true_x - @ox - 320) * @real_zoom + @real_x
  1331.   end
  1332.   #--------------------------------------------------------------------------
  1333.   # ● バトル画面 Y 座標の取得
  1334.   #--------------------------------------------------------------------------
  1335.   def base_y
  1336.     return (true_y - @oy) * @real_zoom + @real_y
  1337.   end
  1338.   #--------------------------------------------------------------------------
  1339.   # ● バトル画面 拡大率の取得
  1340.   #--------------------------------------------------------------------------
  1341.   def zoom
  1342.     return ($scene.zoom_rate[1] - $scene.zoom_rate[0]) *
  1343.                           (true_x + @fly) / 480 + $scene.zoom_rate[0]
  1344.   end
  1345.   #--------------------------------------------------------------------------
  1346.   # ● 攻撃用、バトル画面 X 座標の取得
  1347.   #--------------------------------------------------------------------------
  1348.   def attack_x(z)
  1349.     return (320 - true_x) * z * 0.75
  1350.   end
  1351.   #--------------------------------------------------------------------------
  1352.   # ● 攻撃用、バトル画面 Y 座標の取得
  1353.   #--------------------------------------------------------------------------
  1354.   def attack_y(z)
  1355.     return (160 - (true_y + fly / 4) * z + @height * zoom * z / 2) * 0.75
  1356.   end
  1357.   #--------------------------------------------------------------------------
  1358.   # ● 閃き待ち時間
  1359.   #--------------------------------------------------------------------------
  1360.   def flash_duration
  1361.     return $scene.flash_duration
  1362.   end
  1363.   #--------------------------------------------------------------------------
  1364.   # ● アニメーション取得
  1365.   #--------------------------------------------------------------------------
  1366.   def battle_actions1
  1367.     weapon = $data_weapons[@weapon_id]
  1368.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1369.   end
  1370.   #--------------------------------------------------------------------------
  1371.   # ● アニメーション取得
  1372.   #--------------------------------------------------------------------------
  1373.   def battle_actions2
  1374.     weapon = $data_weapons[@weapon2_id]
  1375.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1376.   end
  1377.   #--------------------------------------------------------------------------
  1378.   # ● 武器アニメーション取得
  1379.   #--------------------------------------------------------------------------
  1380.   def weapon_anime1
  1381.     weapon = $data_weapons[@weapon_id]
  1382.     return weapon != nil ? weapon.icon_name : ""
  1383.   end
  1384.   #--------------------------------------------------------------------------
  1385.   # ● 武器アニメーション取得
  1386.   #--------------------------------------------------------------------------
  1387.   def weapon_anime2
  1388.     weapon = $data_weapons[@weapon2_id]
  1389.     return weapon != nil ? weapon.icon_name : ""
  1390.   end
  1391.   #--------------------------------------------------------------------------
  1392.   # ● 遠距離アニメーション取得
  1393.   #--------------------------------------------------------------------------
  1394.   def flying_anime1
  1395.     weapon = $data_weapons[@weapon_id]
  1396.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1397.   end
  1398.   #--------------------------------------------------------------------------
  1399.   # ● 遠距離アニメーション取得
  1400.   #--------------------------------------------------------------------------
  1401.   def flying_anime2
  1402.     weapon = $data_weapons[@weapon2_id]
  1403.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1404.   end
  1405.   #--------------------------------------------------------------------------
  1406.   # ● 移動目標座標の計算
  1407.   #--------------------------------------------------------------------------
  1408.   def move_setup
  1409.     if RTAB
  1410.       targets = @target
  1411.     else
  1412.       targets = $scene.target_battlers
  1413.     end
  1414.     case @move_action[0]
  1415.     when "self" # 自分
  1416.       @target_x = self.base_x
  1417.       @target_y = self.base_y
  1418.     when "target_near" # 一番近くのターゲット
  1419.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  1420.       targets.reverse!
  1421.       if targets != []
  1422.         @target_x = targets[0].screen_x
  1423.         @target_y = targets[0].screen_y
  1424.       else
  1425.         @target_x = self.base_x
  1426.         @target_y = self.base_y
  1427.       end
  1428.     when "target_far" # 一番遠くのターゲット
  1429.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  1430.       if targets != []
  1431.         @target_x = targets[0].screen_x
  1432.         @target_y = targets[0].screen_y
  1433.       else
  1434.         @target_x = self.base_x
  1435.         @target_y = self.base_y
  1436.       end
  1437.     when "target" # ターゲット中央
  1438.       @target_x = 0
  1439.       @target_y = 0
  1440.       for t in targets
  1441.         @target_x += t.screen_x
  1442.         @target_y += t.screen_y
  1443.       end
  1444.       if targets != []
  1445.         @target_x /= targets.size
  1446.         @target_y /= targets.size
  1447.       end
  1448.     when "troop" # "トループ中央"
  1449.       @target_x = 0
  1450.       @target_y = 0
  1451.       for t in $game_troop.enemies
  1452.         @target_x += t.screen_x
  1453.         @target_y += t.screen_y
  1454.       end
  1455.       if $game_troop.enemies != []
  1456.         @target_x /= $game_troop.enemies.size
  1457.         @target_y /= $game_troop.enemies.size
  1458.       end
  1459.     when "party" # "パーティ中央"
  1460.       @target_x = 0
  1461.       @target_y = 0
  1462.       for t in $game_party.actors
  1463.         @target_x += t.screen_x
  1464.         @target_y += t.screen_y
  1465.       end
  1466.       if $game_party.actors != []
  1467.         @target_x /= $game_party.actors.size
  1468.         @target_y /= $game_party.actors.size
  1469.       end
  1470.     when "screen" # "画面"
  1471.       @target_x = self.base_x
  1472.       @target_y = self.base_y
  1473.     end
  1474.     # 補正
  1475.     @target_x += @move_action[1] - self.base_x
  1476.     @target_y += @move_action[2] - self.base_y
  1477.     # 移動目標の座標をセット
  1478.     @move_coordinates = [@target_x.to_i,@target_y.to_i,@move_coordinates[0],@move_coordinates[1]]
  1479.     # 距離の計算(ウエイトの設定)
  1480.     @move_wait     = (@move_coordinates[2] - @move_coordinates[0]).abs +
  1481.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  1482.   end
  1483. end
  1484. #==============================================================================
  1485. # ■ Game_Enemy
  1486. #==============================================================================
  1487. class Game_Enemy < Game_Battler
  1488.   attr_reader   :nce
  1489.   #--------------------------------------------------------------------------
  1490.   # ● セットアップ
  1491.   #--------------------------------------------------------------------------
  1492.   alias side_view_initialize initialize
  1493.   def initialize(troop_id, member_index)
  1494.     side_view_initialize(troop_id, member_index)
  1495.     start_battle
  1496.     @nce = NOT_CHARACTER_EMEMY.include? @enemy_id
  1497.     @weapon_id  = EMEMY_WEAPO[@enemy_id] != nil ? EMEMY_WEAPO[@enemy_id] : 0
  1498.     @weapon_id2  = EMEMY_WEAPO2[@enemy_id] != nil ? EMEMY_WEAPO2[@enemy_id] : 0
  1499.   end
  1500.   def character_name
  1501.     return self.battler_name
  1502.   end
  1503.   def character_hue
  1504.     return self.battler_hue
  1505.   end
  1506.   #--------------------------------------------------------------------------
  1507.   # ● 移動
  1508.   #--------------------------------------------------------------------------
  1509.   def move
  1510.     # 距離の計算
  1511.     @move_distance = (@move_coordinates[2] - @move_coordinates[0]).abs +
  1512.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  1513.     if @move_distance > 0
  1514.       return if @ox == @move_coordinates[0] and @oy == @move_coordinates[1]
  1515.       array = @move_coordinates
  1516.       # ジャンプ補正値の計算
  1517.       if @move_distance - @move_wait > @move_distance / 2
  1518.         jump = (@move_action[4] * @move_wait / @move_distance.to_f)**2        
  1519.       else
  1520.         jump = (@move_action[4] * (@move_distance - @move_wait) / @move_distance.to_f)**2
  1521.       end
  1522.       jump = @move_action[4] > 0 ? -jump : jump
  1523.       jump = 0 if @weapon_id + @weapon_id2 == 0
  1524.       @ox = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @move_wait) / @move_distance.to_f).to_i
  1525.       @oy = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @move_wait) / @move_distance.to_f + jump).to_i
  1526.       # ウエイト
  1527.       @move_wait -= @move_action[3]
  1528.       @move_wait = [@move_wait,0].max
  1529.     end
  1530.   end
  1531.   #--------------------------------------------------------------------------
  1532.   # ● 武器アニメタイプ
  1533.   #--------------------------------------------------------------------------
  1534.   def weapon_anime_type(type)
  1535.     file_name  = weapon_anime_type0(type)
  1536.     visible   = weapon_anime_type1(type)
  1537.     z         = weapon_anime_type2(type)
  1538.     return [file_name,visible,z]
  1539.   end
  1540.   # 武器アイコン取得
  1541.   def weapon_anime_type0(type)
  1542.     type = ANIME[type][5]
  1543.     return weapon_anime1 if type == "右手"
  1544.     return weapon_anime2 if type == "左手"
  1545.     return nil
  1546.   end
  1547.   # 表示・非表示の取得
  1548.   def weapon_anime_type1(type)
  1549.     return ANIME[type][3]
  1550.   end
  1551.   # バトラーより上に表示するかどうか
  1552.   def weapon_anime_type2(type)
  1553.     type = ANIME[type][5]
  1554.     return true if type == "左手"
  1555.     return false
  1556.   end
  1557.  
  1558.   #--------------------------------------------------------------------------
  1559.   # ● 移動目標座標の計算
  1560.   #--------------------------------------------------------------------------
  1561.   def move_setup
  1562.     if RTAB
  1563.       targets = @target
  1564.     else
  1565.       targets = $scene.target_battlers
  1566.     end
  1567.     case @move_action[0]
  1568.     when "self" # 自分
  1569.       @target_x = self.base_x
  1570.       @target_y = self.base_y
  1571.     when "target_near" # 一番近くのターゲット
  1572.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  1573.       if targets != []
  1574.         @target_x = targets[0].screen_x
  1575.         @target_y = targets[0].screen_y
  1576.       else
  1577.         @target_x = self.base_x
  1578.         @target_y = self.base_y
  1579.       end
  1580.     when "target_far" # 一番遠くのターゲット
  1581.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  1582.       targets.reverse!
  1583.       if targets != []
  1584.         @target_x = targets[0].screen_x
  1585.         @target_y = targets[0].screen_y
  1586.       else
  1587.         @target_x = self.base_x
  1588.         @target_y = self.base_y
  1589.       end
  1590.     when "target" # ターゲット中央
  1591.       @target_x = 0
  1592.       @target_y = 0
  1593.       for t in targets
  1594.         @target_x += t.screen_x
  1595.         @target_y += t.screen_y
  1596.       end
  1597.       if targets != []
  1598.         @target_x /= targets.size
  1599.         @target_y /= targets.size
  1600.       end
  1601.     when  "party" # "トループ中央"
  1602.       @target_x = 0
  1603.       @target_y = 0
  1604.       for t in $game_troop.enemies
  1605.         @target_x += t.screen_x
  1606.         @target_y += t.screen_y
  1607.       end
  1608.       if $game_troop.enemies != []
  1609.         @target_x /= $game_troop.enemies.size
  1610.         @target_y /= $game_troop.enemies.size
  1611.       end
  1612.     when "troop" # "パーティ中央"
  1613.       @target_x = 0
  1614.       @target_y = 0
  1615.       for t in $game_party.actors
  1616.         @target_x += t.screen_x
  1617.         @target_y += t.screen_y
  1618.       end
  1619.       if $game_party.actors != []
  1620.         @target_x /= $game_party.actors.size
  1621.         @target_y /= $game_party.actors.size
  1622.       end
  1623.     when "screen" # "画面"
  1624.       @target_x = self.base_x
  1625.       @target_y = self.base_y
  1626.     end
  1627.     # 補正
  1628.     @target_x -= @move_action[1] + self.base_x
  1629.     @target_y -= @move_action[2] + self.base_y
  1630.     # 移動目標の座標をセット
  1631.     @move_coordinates = [@target_x.to_i,@target_y.to_i,@move_coordinates[0],@move_coordinates[1]]
  1632.     # 距離の計算(ウエイトの設定)
  1633.     @move_wait     = (@move_coordinates[2] - @move_coordinates[0]).abs +
  1634.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  1635.   end
  1636.   if RTAB
  1637.   alias original_x true_x
  1638.   alias original_y true_y
  1639.   else
  1640.   alias original_x screen_x
  1641.   alias original_y screen_y
  1642.   end
  1643.   #--------------------------------------------------------------------------
  1644.   # ● バトル画面 X 座標の取得(カメラ補正無し)
  1645.   #--------------------------------------------------------------------------
  1646.   def true_x
  1647.     return original_x + @ox
  1648.   end
  1649.   #--------------------------------------------------------------------------
  1650.   # ● バトル画面 Y 座標の取得(カメラ補正無し)
  1651.   #--------------------------------------------------------------------------
  1652.   def true_y
  1653.     return original_y - @height / 2 + @oy
  1654.   end
  1655.   #--------------------------------------------------------------------------
  1656.   # ● バトル画面 X 座標の取得
  1657.   #--------------------------------------------------------------------------
  1658.   def screen_x(true_x = self.true_x)
  1659.     return true_x * @real_zoom + @real_x
  1660.   end
  1661.   #--------------------------------------------------------------------------
  1662.   # ● バトル画面 Y 座標の取得
  1663.   #--------------------------------------------------------------------------
  1664.   def screen_y(true_y = self.true_y)
  1665.     return true_y * @real_zoom + @real_y
  1666.   end
  1667.   #--------------------------------------------------------------------------
  1668.   # ● バトル画面 X 座標の取得(移動などしていない場合)
  1669.   #--------------------------------------------------------------------------
  1670.   def base_x(true_x = self.true_x)
  1671.     return (true_x - @ox) * @real_zoom + @real_x
  1672.   end
  1673.   #--------------------------------------------------------------------------
  1674.   # ● バトル画面 Y 座標の取得(移動などしていない場合)
  1675.   #--------------------------------------------------------------------------
  1676.   # ● アニメーション取得
  1677.   #--------------------------------------------------------------------------
  1678.   def battle_actions1
  1679.     weapon = $data_weapons[@weapon_id]
  1680.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1681.   end
  1682.   #--------------------------------------------------------------------------
  1683.   # ● アニメーション取得
  1684.   #--------------------------------------------------------------------------
  1685.   def battle_actions2
  1686.     weapon = $data_weapons[@weapon2_id]
  1687.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1688.   end
  1689.   #--------------------------------------------------------------------------
  1690.   # ● 武器アニメーション取得
  1691.   #--------------------------------------------------------------------------
  1692.   def weapon_anime1
  1693.     weapon = $data_weapons[@weapon_id]
  1694.     return weapon != nil ? weapon.icon_name : ""
  1695.   end
  1696.   #--------------------------------------------------------------------------
  1697.   # ● 武器アニメーション取得
  1698.   #--------------------------------------------------------------------------
  1699.   def weapon_anime2
  1700.     weapon = $data_weapons[@weapon2_id]
  1701.     return weapon != nil ? weapon.icon_name : ""
  1702.   end
  1703.   #--------------------------------------------------------------------------
  1704.   # ● 遠距離アニメーション取得
  1705.   #--------------------------------------------------------------------------
  1706.   def flying_anime1
  1707.     weapon = $data_weapons[@weapon_id]
  1708.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1709.   end
  1710.   #--------------------------------------------------------------------------
  1711.   # ● 遠距離アニメーション取得
  1712.   #--------------------------------------------------------------------------
  1713.   def flying_anime2
  1714.     weapon = $data_weapons[@weapon2_id]
  1715.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1716.   end
  1717.   def base_y(true_y = self.true_y)
  1718.     return (true_y - @oy) * @real_zoom + @real_y
  1719.   end
  1720.   #--------------------------------------------------------------------------
  1721.  
  1722.  
  1723.  
  1724.   #--------------------------------------------------------------------------
  1725.   # ● アニメーション取得
  1726.   #--------------------------------------------------------------------------
  1727.   def battle_actions1
  1728.     weapon = $data_weapons[@weapon_id]
  1729.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1730.   end
  1731.   #--------------------------------------------------------------------------
  1732.   # ● アニメーション取得
  1733.   #--------------------------------------------------------------------------
  1734.   def battle_actions2
  1735.     weapon = $data_weapons[@weapon2_id]
  1736.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1737.   end
  1738.   #--------------------------------------------------------------------------
  1739.   # ● 武器アニメーション取得
  1740.   #--------------------------------------------------------------------------
  1741.   def weapon_anime1
  1742.     weapon = $data_weapons[@weapon_id]
  1743.     return weapon != nil ? weapon.icon_name : ""
  1744.   end
  1745.   #--------------------------------------------------------------------------
  1746.   # ● 武器アニメーション取得
  1747.   #--------------------------------------------------------------------------
  1748.   def weapon_anime2
  1749.     weapon = $data_weapons[@weapon2_id]
  1750.     return weapon != nil ? weapon.icon_name : ""
  1751.   end
  1752.   #--------------------------------------------------------------------------
  1753.   # ● 遠距離アニメーション取得
  1754.   #--------------------------------------------------------------------------
  1755.   def flying_anime1
  1756.     weapon = $data_weapons[@weapon_id]
  1757.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1758.   end
  1759.   #--------------------------------------------------------------------------
  1760.   # ● 遠距離アニメーション取得
  1761.   #--------------------------------------------------------------------------
  1762.   def flying_anime2
  1763.     weapon = $data_weapons[@weapon2_id]
  1764.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1765.   end  
  1766. end
  1767. #==============================================================================
  1768. # ■ Game_Party
  1769. #==============================================================================
  1770. class Game_Party
  1771.   #--------------------------------------------------------------------------
  1772.   # ● アクターを加える
  1773.   #     actor_id : アクター ID
  1774.   #--------------------------------------------------------------------------
  1775.   alias side_view_add_actor add_actor
  1776.   def add_actor(actor_id)
  1777.     # アクターを取得
  1778.     actor = $game_actors[actor_id]
  1779.     # サイドビューデータの初期化
  1780.     actor.start_battle
  1781.     # 戻す
  1782.     side_view_add_actor(actor_id)
  1783.   end
  1784. end
  1785.  
  1786. class Spriteset_Battle
  1787.   include Side_view
  1788.   #--------------------------------------------------------------------------
  1789.   # ● オブジェクト初期化
  1790.   #--------------------------------------------------------------------------
  1791.   alias side_veiw_initialize initialize
  1792.   def initialize
  1793.     side_veiw_initialize
  1794.     # アクタースプライトを解放
  1795.     for sprite in @actor_sprites
  1796.       sprite.dispose
  1797.     end
  1798.     # アクタースプライトを作成
  1799.     @actor_sprites = []
  1800.     for i in 1..Party_max
  1801.       @actor_sprites.push(Sprite_Battler.new(@viewport1))
  1802.     end
  1803.     update
  1804.   end
  1805.   #--------------------------------------------------------------------------
  1806.   # ● 画面のスクロール
  1807.   #--------------------------------------------------------------------------
  1808.   if method_defined?("screen_scroll")
  1809.   alias side_view_screen_scroll screen_scroll
  1810.   def screen_scroll
  1811.     side_view_screen_scroll
  1812.     # アクターの位置補正
  1813.     for actor in $game_party.actors
  1814.       actor.real_x = @real_x
  1815.       actor.real_y = @real_y
  1816.       actor.real_zoom = @real_zoom
  1817.     end
  1818.   end
  1819.   end
  1820. end
  1821.  
  1822. class Sprite_Battler < RPG::Sprite
  1823.   include Side_view
  1824.   #--------------------------------------------------------------------------
  1825.   # ● オブジェクト初期化
  1826.   #     viewport : ビューポート
  1827.   #     battler  : バトラー (Game_Battler)
  1828.   #--------------------------------------------------------------------------
  1829.   def initialize(viewport, battler = nil)
  1830.     super(viewport)
  1831.     @battler = battler
  1832.     @battler_visible = false
  1833.     @weapon = Sprite_Weapon.new(viewport, battler)
  1834.     @flying = Sprite_Flying.new(viewport, battler)
  1835.     @shadow = []
  1836.     @fly = 0
  1837.     @fly_direction = 1
  1838.     @rand = rand(10)
  1839.     self.effect_clear
  1840.   end
  1841.   #--------------------------------------------------------------------------
  1842.   # ● 解放
  1843.   #--------------------------------------------------------------------------
  1844.   alias side_view_dispose dispose
  1845.   def dispose
  1846.     side_view_dispose
  1847.     @weapon.dispose
  1848.     @flying.dispose
  1849.     if @_target_sprite != nil
  1850.       @_target_sprite.bitmap.dispose
  1851.       @_target_sprite.dispose
  1852.       @_target_sprite = nil
  1853.     end
  1854.   end
  1855.   #--------------------------------------------------------------------------
  1856.   # ● フレーム更新
  1857.   #--------------------------------------------------------------------------
  1858.   def update
  1859.     super
  1860.     # バトラーが nil の場合
  1861.     if @battler == nil
  1862.       self.bitmap = nil
  1863.       @weapon.bitmap = nil
  1864.       loop_animation(nil)
  1865.       return
  1866.     end
  1867.     # バトラー更新
  1868.     @battler.update
  1869.     # バトラーアニメのデータ取得
  1870.     @anime_type = @battler.anime_type
  1871.     # ファイル名か色相が現在のものと異なる場合
  1872.     if @battler.is_a?(Game_Actor) or (!@battler.is_a?(Game_Actor) and !@battler.nce)
  1873.       change = (@battler.character_name != @battler_name or @battler.character_hue != @battler_hue)
  1874.     elsif @battler.is_a?(Game_Enemy)
  1875.       change = (@battler.battler_name != @battler_name or @battler.battler_hue != @battler_hue)
  1876.     else
  1877.       return
  1878.     end
  1879.     if change
  1880.       # ビットマップを取得、設定
  1881.       if @battler.is_a?(Game_Actor) or (!@battler.is_a?(Game_Actor) and !@battler.nce)
  1882.         @battler_name = @battler.character_name
  1883.         @battler_hue = @battler.character_hue
  1884.         self.bitmap = RPG::Cache.character(@battler_name, @battler_hue)
  1885.         @width = bitmap.width / 4
  1886.         @height = bitmap.height / 4
  1887.       else
  1888.         @battler_name = @battler.battler_name
  1889.         @battler_hue = @battler.battler_hue
  1890.         self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  1891.         @width = bitmap.width
  1892.         @height = bitmap.height
  1893.       end
  1894.       self.ox = @width / 2
  1895.       self.oy = @height / 2
  1896.       @battler.height = @height
  1897.       @flag = true
  1898.       # 戦闘不能または隠れ状態なら不透明度を 0 にする
  1899.       if @battler.dead? or @battler.hidden
  1900.         self.opacity = 0
  1901.       end
  1902.     end
  1903.     if (@battler.is_a?(Game_Actor) and
  1904.       (@battler.anime_type != @anime_type or @battler.pattern != @pattern or @flag)) or
  1905.       (!@battler.is_a?(Game_Actor) and !@battler.nce)
  1906.       # ビットマップを取得、設定
  1907.       @pattern = @battler.pattern
  1908.       self.ox = @width / 2
  1909.       self.oy = @height / 2
  1910.       @sx = @pattern * @width
  1911.       sy = @anime_type % 4 * @height
  1912.       x   = sy / (@height * 2) + 4
  1913.       if !@battler.is_a?(Game_Actor) and !@battler.nce and x == 4
  1914.         x = 6
  1915.       end    # here!!
  1916.       @sy = (x - 2) / 2 * @height
  1917.       self.src_rect.set(@sx, @sy, @width, @height)
  1918.       self.zoom_x = CHAR_ZOOM
  1919.       self.zoom_y = CHAR_ZOOM
  1920.       @battler.height = @height
  1921.       @flag = false
  1922.     end
  1923.     # 飛行
  1924.     update_fly
  1925.     # シェイク
  1926.     update_shake
  1927.     # 回転
  1928.     update_turning
  1929.     # 反転
  1930.     update_reverse   
  1931.     # 移動
  1932.     update_moving
  1933.     # 追加アニメ
  1934.     update_add_anime
  1935.     # エフェクト効果の適用
  1936.     update_effect
  1937.     # アニメーション ID が現在のものと異なる場合
  1938.     flag = RTAB ? true : @battler.damage == nil
  1939.     if flag and @battler.state_animation_id != @state_animation_id
  1940.       @state_animation_id = @battler.state_animation_id
  1941.       loop_animation($data_animations[@state_animation_id])
  1942.     end
  1943.     # シェイク
  1944.     if @battler.shake
  1945.       self.start_shake(5, 5, 5)
  1946.       @battler.shake = false
  1947.     end
  1948.     # 明滅
  1949.     if @battler.blink
  1950.       blink_on
  1951.     else
  1952.       blink_off
  1953.     end
  1954.     # 不可視の場合
  1955.     unless @battler_visible
  1956.       flag = RTAB ? (@battler.damage.size < 2 or @battler.damage_pop.size < 2) :
  1957.                     (@battler.damage == nil or @battler.damage_pop)
  1958.       # 出現
  1959.       if not @battler.hidden and not @battler.dead? and flag
  1960.         appear
  1961.         @battler_visible = true
  1962.       end
  1963.     end
  1964.     if RTAB
  1965.     # ダメージ
  1966.     for battler in @battler.damage_pop
  1967.       if battler[0].class == Array
  1968.         if battler[0][1] >= 0
  1969.           $scene.skill_se
  1970.         else
  1971.           $scene.levelup_se
  1972.         end
  1973.         damage(@battler.damage[battler[0]], false, 2)
  1974.       else
  1975.         damage(@battler.damage[battler[0]], @battler.critical[battler[0]])
  1976.       end
  1977.       if @battler.damage_sp.include?(battler[0])
  1978.         damage(@battler.damage_sp[battler[0]],
  1979.                 @battler.critical[battler[0]], 1)
  1980.         @battler.damage_sp.delete(battler[0])
  1981.       end
  1982.       @battler.damage_pop.delete(battler[0])
  1983.       @battler.damage.delete(battler[0])
  1984.       @battler.critical.delete(battler[0])
  1985.     end
  1986.     end
  1987.     # 可視の場合
  1988.     if @battler_visible
  1989.       # 武器アニメ
  1990.       @weapon.battler = @battler
  1991.       @weapon.update
  1992.       # 遠距離アニメ
  1993.       @flying.battler = @battler
  1994.       @flying.update
  1995.       # 逃走
  1996.       if @battler.hidden
  1997.         $game_system.se_play($data_system.escape_se)
  1998.         escape
  1999.         @battler_visible = false
  2000.       end
  2001.       # 白フラッシュ
  2002.       if @battler.white_flash
  2003.         whiten
  2004.         @battler.white_flash = false
  2005.       end
  2006.       if RTAB
  2007.       # アニメーション
  2008.       if !@battler.animation.empty?
  2009.         for animation in @battler.animation.reverse
  2010.           if animation[2]
  2011.             animation($data_animations[animation[0]], animation[1], true)
  2012.           else
  2013.             animation($data_animations[animation[0]], animation[1])
  2014.           end
  2015.           @battler.animation.delete(animation)
  2016.         end
  2017.       end
  2018.       else
  2019.       # アニメーション
  2020.       if @battler.animation_id != 0
  2021.         animation = $data_animations[@battler.animation_id]
  2022.         animation(animation, @battler.animation_hit)
  2023.         @battler.animation_id = 0
  2024.       end
  2025.       end
  2026.       # ダメージ
  2027.       if !RTAB and @battler.damage_pop
  2028.         damage(@battler.damage, @battler.critical)
  2029.         @battler.damage = nil
  2030.         @battler.critical = false
  2031.         @battler.damage_pop = false
  2032.       end
  2033.       flag = RTAB ? (@battler.damage.empty? and $scene.dead_ok?(@battler)) :
  2034.                      @battler.damage == nil
  2035.       # コラプス
  2036.       if flag and @battler.dead?
  2037.         if @battler.is_a?(Game_Actor)
  2038.           $game_system.se_play($data_system.actor_collapse_se)
  2039.         elsif @battler.is_a?(Game_Enemy)
  2040.           $game_system.se_play($data_system.enemy_collapse_se)
  2041.         end
  2042.         collapse
  2043.         @battler_visible = false
  2044.       end
  2045.     end
  2046.     # スプライトの座標を設定
  2047.     self.x = @battler.screen_x + @effect_ox
  2048.     self.y = @battler.screen_y + @effect_oy
  2049.     self.z = @battler.screen_z
  2050.     self.zoom_x = @battler.real_zoom
  2051.     self.zoom_y = @battler.real_zoom
  2052.     # ウェイトカウントを減らす
  2053.     @battler.wait_count -= 1
  2054.     @battler.wait_count2 -= 1
  2055.     # アニメーション待ち時間取得
  2056.     @battler.animation_duration = @_animation_duration
  2057.     if @battler.is_a?(Game_Actor) or (!@battler.is_a?(Game_Actor) and !@battler.nce)
  2058.       self.zoom_x *= CHAR_ZOOM
  2059.       self.zoom_y *= CHAR_ZOOM
  2060.       @weapon.x = self.x + 2
  2061.       @weapon.y = self.y + 6
  2062.       @weapon.angle = 75 - (4 - @battler.pattern) * 45
  2063.       if self.mirror
  2064.         @weapon.angle += @weapon.angle - 180
  2065.       end
  2066.       if (!@battler.is_a?(Game_Actor) and !@battler.nce)
  2067.         @weapon.angle = [email]-@weapon.angle[/email]-90
  2068.       end
  2069.     end
  2070.     # 残像
  2071.     if @battler.shadow
  2072.       if Graphics.frame_count % 2 == 0
  2073.         shadow = ::Sprite.new(self.viewport)
  2074.         shadow.bitmap = self.bitmap.dup
  2075.         shadow.x = self.x
  2076.         shadow.y = self.y
  2077.         shadow.ox = self.ox
  2078.         shadow.oy = self.oy
  2079.         shadow.mirror = self.mirror
  2080.         shadow.angle = self.angle
  2081.         shadow.opacity = 160
  2082.         shadow.zoom_x = self.zoom_x
  2083.         shadow.zoom_y = self.zoom_y
  2084.         if @battler.is_a?(Game_Actor) or (!@battler.is_a?(Game_Actor) and !@battler.nce)
  2085.           shadow.src_rect.set(@sx, @sy, @width, @height)
  2086.         else
  2087.           shadow.src_rect.set(0, 0, @width, @height)
  2088.         end
  2089.         @shadow.push([shadow,duration = 10,@battler.true_x + @effect_ox,@battler.true_y + @effect_oy])
  2090.       end
  2091.     end
  2092.     for s in @shadow
  2093.       if !s[0].disposed?
  2094.         s[0].update
  2095.         s[1] -= 1
  2096.         if s[1] < 1
  2097.           if s[0].bitmap != nil
  2098.             s[0].bitmap.dispose
  2099.           end
  2100.           s[0].dispose
  2101.         else
  2102.           s[0].x = @battler.screen_x(s[2])
  2103.           s[0].y = @battler.screen_y(s[3])
  2104.         end
  2105.       else
  2106.         s = nil
  2107.       end
  2108.     end
  2109.     @shadow.compact!
  2110.   end
  2111.   #--------------------------------------------------------------------------
  2112.   # ● エフェクトによる座標系の更新
  2113.   #--------------------------------------------------------------------------
  2114.   def update_effect
  2115.     # 角度の修正
  2116.     if @_upside_down
  2117.       self.angle = (@_turning + 180) % 360
  2118.     else
  2119.       self.angle = @_turning
  2120.     end
  2121.     # X 座標の修正値
  2122.     @effect_ox = @_shake + @_moving[0]
  2123.     # Y 座標の修正値
  2124.     @effect_oy = -@fly + @_moving[1]
  2125.     if  @_animation == nil or (RTAB and @_animation.empty?)
  2126.       self.effect_clear
  2127.     end
  2128.   end
  2129.   #--------------------------------------------------------------------------
  2130.   # ● シェイク更新
  2131.   #--------------------------------------------------------------------------
  2132.   def update_shake
  2133.     if @_shake_duration >= 1 or @_shake != 0
  2134.       delta = (@_shake_power * @_shake_speed * @_shake_direction) / 10.0
  2135.       if @_shake_duration <= 1 and @_shake * (@_shake + delta) < 0
  2136.         @_shake = 0
  2137.       else
  2138.         @_shake += delta
  2139.       end
  2140.       if @_shake > @_shake_power * 2
  2141.         @_shake_direction = -1
  2142.       end
  2143.       if @_shake < - @_shake_power * 2
  2144.         @_shake_direction = 1
  2145.       end
  2146.       if @_shake_duration >= 1
  2147.         @_shake_duration -= 1
  2148.       end
  2149.     end
  2150.   end
  2151.   #--------------------------------------------------------------------------
  2152.   # ● 飛行更新
  2153.   #--------------------------------------------------------------------------
  2154.   def update_fly
  2155.     if @rand > 0
  2156.       @rand -= 1
  2157.       return
  2158.     end
  2159.     if @battler.fly != 0
  2160.       if @fly < @battler.fly / 4
  2161.         @fly_direction = 1
  2162.       elsif @fly > @battler.fly / 2
  2163.         @fly_direction = -1
  2164.       end
  2165.       @fly += 0.5 * @fly_direction
  2166.     end
  2167.   end
  2168.   #--------------------------------------------------------------------------
  2169.   # ● 回転更新
  2170.   #--------------------------------------------------------------------------
  2171.   def update_turning
  2172.     if @_turning_duration > 0 or @_turning != 0
  2173.       @_turning += @_turning_direction * @_turning_speed / 2.0
  2174.       # 残り回転数を減らす
  2175.       if @_turning_direction == -1
  2176.         if @_turning_duration > 0 and @_turning < 0
  2177.           @_turning_duration -= 1
  2178.         end
  2179.       elsif @_turning_direction == 1
  2180.         if @_turning_duration > 0 and @_turning >= 360
  2181.           @_turning_duration -= 1
  2182.         end
  2183.       end
  2184.       # 以下補正
  2185.       while @_turning < 0
  2186.         @_turning += 360
  2187.       end
  2188.       if @_turning_duration <= 0
  2189.         @_turning = 0
  2190.       end
  2191.       @_turning %= 360
  2192.     end
  2193.   end
  2194.   #--------------------------------------------------------------------------
  2195.   # ● 左右反転更新
  2196.   #--------------------------------------------------------------------------
  2197.   def update_reverse
  2198.     if @last_reverse != (@_reverse or @battler.reverse)
  2199.       self.mirror = (@_reverse or @battler.reverse)
  2200.       @last_reverse = (@_reverse or @battler.reverse)
  2201.     end
  2202.   end
  2203.   #--------------------------------------------------------------------------
  2204.   # ● 移動更新
  2205.   #--------------------------------------------------------------------------
  2206.   def update_moving
  2207.     @move_distance = (@_move_coordinates[2] - @_move_coordinates[0]).abs +
  2208.                      (@_move_coordinates[3] - @_move_coordinates[1]).abs
  2209.     if @move_distance > 0
  2210.       return if @_moving[0] == @_move_coordinates[0] and @_moving[1] == @_move_coordinates[1]
  2211.       array = @_move_coordinates
  2212.       x = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @_move_duration) / @move_distance.to_f).to_i
  2213.       y = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @_move_duration) / @move_distance.to_f).to_i
  2214.       @_moving = [x, y]
  2215.       if @_move_quick_return and @_move_duration == 0
  2216.         @_move_coordinates = [0,0,array[0],array[1]]
  2217.         @_move_duration = @move_distance
  2218.       end
  2219.       @_move_duration -= @_move_speed
  2220.       @_move_duration = [@_move_duration, 0].max
  2221.     end
  2222.   end
  2223.   #--------------------------------------------------------------------------
  2224.   # ● 追加アニメ更新 (RTAB限定機能)
  2225.   #--------------------------------------------------------------------------
  2226.   def update_add_anime
  2227.     if RTAB
  2228.     # アニメーション
  2229.     if @_add_anime_id != 0
  2230.       animation = $data_animations[@_add_anime_id]
  2231.       animation(animation, true)
  2232.       @_add_anime_id = 0
  2233.     end
  2234.     end
  2235.   end
  2236.   #--------------------------------------------------------------------------
  2237.   # ● エフェクト初期化
  2238.   #--------------------------------------------------------------------------
  2239.   def effect_clear
  2240.     @_effect_ox = 0
  2241.     @_effect_oy = 0
  2242.     @_shake_power = 0
  2243.     @_shake_speed = 0
  2244.     @_shake_duration = 0
  2245.     @_shake_direction = 1
  2246.     @_shake = 0
  2247.     @_upside_down = false
  2248.     @_reverse = false
  2249.     @_turning_direction = 1
  2250.     @_turning_speed = 0
  2251.     @_turning_duration = 0
  2252.     @_turning = 0
  2253.     @_move_quick_return = true
  2254.     @_move_speed = 0
  2255.     @_move_coordinates = [0,0,0,0]
  2256.     @_move_jump = false
  2257.     @_move_duration = 0
  2258.     @_moving = [0,0]
  2259.     @_add_anime_id = 0
  2260.   end
  2261.   #--------------------------------------------------------------------------
  2262.   # ● シェイクの開始
  2263.   #     power    : 強さ
  2264.   #     speed    : 速さ
  2265.   #     duration : 時間
  2266.   #--------------------------------------------------------------------------
  2267.   def start_shake(power, speed, duration)
  2268.     @_shake_power = power
  2269.     @_shake_speed = speed
  2270.     @_shake_duration = duration
  2271.   end
  2272.   #--------------------------------------------------------------------------
  2273.   # ● 上下反転を開始
  2274.   #--------------------------------------------------------------------------
  2275.   def start_upside_down
  2276.     @_upside_down = @_upside_down ? false : true
  2277.   end
  2278.   #--------------------------------------------------------------------------
  2279.   # ● 左右反転を開始
  2280.   #--------------------------------------------------------------------------
  2281.   def start_reverse
  2282.     @_reverse = @_reverse ? false : true
  2283.   end
  2284.   #--------------------------------------------------------------------------
  2285.   # ● 回転を開始
  2286.   #     direction: 方向
  2287.   #     speed    : 速さ
  2288.   #     duration : 時間
  2289.   #--------------------------------------------------------------------------
  2290.   def start_turning(direction, speed, duration)
  2291.     @_turning_direction = direction
  2292.     @_turning_speed = speed
  2293.     @_turning_duration = duration
  2294.     @_turning = @_turning_direction == 1 ? 0 : 360
  2295.   end
  2296.   #--------------------------------------------------------------------------
  2297.   # ● 移動を開始
  2298.   #     quick_return : 戻るかどうか
  2299.   #     speed        : 速さ
  2300.   #     x            : X 座標
  2301.   #     y            : Y 座標
  2302.   #--------------------------------------------------------------------------
  2303.   def start_moving(quick_return, speed, x, y)
  2304.     @_move_quick_return = quick_return == 0 ? false : true
  2305.     @_move_speed = speed
  2306.     @_move_coordinates = [x,y,@_move_coordinates[0],@_move_coordinates[1]]
  2307.     distance = (@_move_coordinates[2] - @_move_coordinates[0]).abs +
  2308.                (@_move_coordinates[3] - @_move_coordinates[1]).abs
  2309.     @_move_duration = distance
  2310.   end
  2311.   #--------------------------------------------------------------------------
  2312.   # ● アニメ追加を開始
  2313.   #     id           : ID
  2314.   #     hit          : 命中フラッグ
  2315.   #--------------------------------------------------------------------------
  2316.   def start_add_anime(id)
  2317.     @_add_anime_id = id
  2318.   end
  2319.   #--------------------------------------------------------------------------
  2320.   # ● 各種エフェクトの開始判定
  2321.   #--------------------------------------------------------------------------
  2322.   if !method_defined?("side_view_animation_process_timing")
  2323.     alias side_view_animation_process_timing animation_process_timing
  2324.   end
  2325.   def animation_process_timing(timing, hit)
  2326.     side_view_animation_process_timing(timing, hit)
  2327.     if (timing.condition == 0) or
  2328.        (timing.condition == 1 and hit == true) or
  2329.        (timing.condition == 2 and hit == false)
  2330.       if timing.se.name =~ SHAKE_FILE
  2331.         names = timing.se.name.split(/#/)
  2332.         power    = names[1].nil? ? SHAKE_POWER    : names[1].to_i
  2333.         speed    = names[2].nil? ? SHAKE_SPEED    : names[2].to_i
  2334.         duration = names[3].nil? ? SHAKE_DURATION : names[3].to_i
  2335.         # シェイクを開始
  2336.         self.start_shake(power, speed, duration)
  2337.       end
  2338.       if timing.se.name == UPSIDE_DOWN_FILE
  2339.         # 上下反転を開始
  2340.         self.start_upside_down
  2341.       end
  2342.       if timing.se.name == REVERSE_FILE
  2343.         # 左右反転を開始
  2344.         self.start_reverse
  2345.       end
  2346.       if timing.se.name =~ TURNING_FILE
  2347.         names = timing.se.name.split(/#/)
  2348.         direction = names[1].nil? ? TURNING_DIRECTION : names[1].to_i
  2349.         speed     = names[2].nil? ? TURNING_SPEED     : names[2].to_i
  2350.         duration  = names[3].nil? ? TURNING_DURATION  : names[3].to_i
  2351.         # 回転を開始
  2352.         self.start_turning(direction, speed, duration)
  2353.       end
  2354.       if timing.se.name =~ MOVE_FILE
  2355.         names = timing.se.name.split(/#/)
  2356.         quick_return= names[1].nil? ? MOVE_RETURN      : names[1].to_i
  2357.         speed       = names[2].nil? ? MOVE_SPEED       : names[2].to_i
  2358.         x           = names[3].nil? ? MOVE_COORDINATES[0] : names[3].to_i
  2359.         y           = names[3].nil? ? MOVE_COORDINATES[1] : names[4].to_i
  2360.         # 移動を開始
  2361.         self.start_moving(quick_return, speed, x, y)
  2362.       end
  2363.       if timing.se.name =~ ADD_ANIME_FILE
  2364.         names = timing.se.name.split(/#/)
  2365.         id = names[1].nil? ? ADD_ANIME_ID      : names[1].to_i
  2366.         # アニメ追加を開始
  2367.         self.start_add_anime(id)
  2368.       end
  2369.     end
  2370.   end
  2371. end
  2372.  
  2373. #==============================================================================
  2374. # ■ Sprite_Weapon
  2375. #------------------------------------------------------------------------------
  2376. #  バトラー表示用のスプライトです。Game_Battler クラスのインスタンスを監視し、
  2377. # スプライトの状態を自動的に変化させます。
  2378. #==============================================================================
  2379.  
  2380. class Sprite_Weapon < RPG::Sprite
  2381.   include Side_view
  2382.   #--------------------------------------------------------------------------
  2383.   # ● 公開インスタンス変数
  2384.   #--------------------------------------------------------------------------
  2385.   attr_accessor :battler                  # バトラー
  2386.   attr_reader   :cw                       # グラフィックの幅
  2387.   attr_reader   :ch                       # グラフィックの高さ
  2388.   #--------------------------------------------------------------------------
  2389.   # ● オブジェクト初期化
  2390.   #     viewport : ビューポート
  2391.   #     battler  : バトラー (Game_Battler)
  2392.   #--------------------------------------------------------------------------
  2393.   def initialize(viewport, battler = nil)
  2394.     super(viewport)
  2395.     @battler = battler
  2396.     @battler_visible = false
  2397.   end
  2398.   #--------------------------------------------------------------------------
  2399.   # ● 解放
  2400.   #--------------------------------------------------------------------------
  2401.   def dispose
  2402.     if self.bitmap != nil
  2403.       self.bitmap.dispose
  2404.     end
  2405.     super
  2406.   end
  2407.   #--------------------------------------------------------------------------
  2408.   # ● フレーム更新
  2409.   #--------------------------------------------------------------------------
  2410.   def update
  2411.     super
  2412.     # バトラーが nil の場合
  2413.     if @battler == nil or (!@battler.is_a?(Game_Actor) and @battler.nce)
  2414.       self.bitmap = nil
  2415.       return
  2416.     end
  2417.     # ウエポンアニメのデータ取得
  2418.     @weapon_anime_type = @battler.weapon_anime_type(@battler.condition)
  2419.     # 設定が「非表示」の場合
  2420.     if !@weapon_anime_type[1] or @weapon_anime_type[0].nil?
  2421.       self.visible = false
  2422.       return
  2423.     else
  2424.       self.visible = true
  2425.     end
  2426.     # ファイル名が現在のものと異なる場合
  2427.     if @weapon_anime_type[0] != @weapon_name
  2428.       @weapon_name = @weapon_anime_type[0]
  2429.       # ビットマップを取得、設定
  2430.       self.bitmap = RPG::Cache.icon(@weapon_name)
  2431.       @width = bitmap.width
  2432.       @height = bitmap.height
  2433.       @flag = true
  2434.     end
  2435.     # 現在アニメパターンが現在のものと異なる場合
  2436.     if @pattern != @battler.pattern or @flag or @condition != @battler.condition
  2437.       @pattern = @battler.pattern
  2438.       @condition = @battler.condition
  2439.       self.ox = @width
  2440.       self.oy = @height
  2441.       self.z = battler.screen_z
  2442.       self.zoom_x = @battler.real_zoom * CHAR_ZOOM
  2443.       self.zoom_y = @battler.real_zoom * CHAR_ZOOM
  2444.       self.src_rect.set(0, 0, @width, @height)
  2445.       self.opacity = 255
  2446.       # バトラーより手前に表示
  2447.       if @weapon_anime_type[2]
  2448.         self.z += 10
  2449.       # バトラーより奥に表示
  2450.       else
  2451.         self.z -= 10
  2452.       end
  2453.       @flag = false
  2454.     end
  2455.   end
  2456. end
  2457.  
  2458. #==============================================================================
  2459. # ■ Sprite_Flying
  2460. #------------------------------------------------------------------------------
  2461. #  バトラー表示用のスプライトです。Game_Battler クラスのインスタンスを監視し、
  2462. # スプライトの状態を自動的に変化させます。
  2463. #==============================================================================
  2464.  
  2465. class Sprite_Flying < RPG::Sprite
  2466.   include Side_view
  2467.   #--------------------------------------------------------------------------
  2468.   # ● 公開インスタンス変数
  2469.   #--------------------------------------------------------------------------
  2470.   attr_accessor :battler                  # バトラー
  2471.   #--------------------------------------------------------------------------
  2472.   # ● オブジェクト初期化
  2473.   #     viewport : ビューポート
  2474.   #     battler  : バトラー (Game_Battler)
  2475.   #--------------------------------------------------------------------------
  2476.   def initialize(viewport, battler = nil)
  2477.     super(viewport)
  2478.     @battler = battler
  2479.     @battler_visible = false
  2480.   end
  2481.   #--------------------------------------------------------------------------
  2482.   # ● 解放
  2483.   #--------------------------------------------------------------------------
  2484.   def dispose
  2485.     if self.bitmap != nil
  2486.       self.bitmap.dispose
  2487.     end
  2488.     super
  2489.   end
  2490.   #--------------------------------------------------------------------------
  2491.   # ● フレーム更新
  2492.   #--------------------------------------------------------------------------
  2493.   def update
  2494.     super
  2495.     # バトラーが nil の場合
  2496.     if @battler == nil
  2497.       self.bitmap = nil
  2498.       loop_animation(nil)
  2499.       return
  2500.     end
  2501.     # 遠距離アニメ
  2502.     flying_animation = @battler.flying_animation
  2503.     flying_start = flying_animation[0]
  2504.     flying_end   = flying_animation[1]
  2505.     # アニメーション ID が現在のものと異なる場合
  2506.     if @anime_id != @battler.flying_anime[0]
  2507.       @anime_id = @battler.flying_anime[0]
  2508.       @animation = $data_animations[@anime_id]
  2509.     end
  2510.     # アニメーション 開始
  2511.     if flying_start
  2512.       loop_animation(@animation)
  2513.     elsif flying_end
  2514.       loop_animation(nil)
  2515.     end
  2516.     self.x = @battler.flying_x
  2517.     self.y = @battler.flying_y
  2518.     self.z = @battler.screen_z + 1000
  2519.   end
  2520. end
  2521.  
  2522. module RPG
  2523.   class Skill
  2524.     #--------------------------------------------------------------------------
  2525.     # ● 魔法かどうかの判断
  2526.     #--------------------------------------------------------------------------
  2527.     def magic?
  2528.       if @atk_f == 0
  2529.         return true
  2530.       else
  2531.         return false
  2532.       end
  2533.     end
  2534.   end
  2535. end
  2536.  
  2537. # アローカーソルの位置修正
  2538.  
  2539. class Arrow_Actor < Arrow_Base
  2540.   include Side_view
  2541.   #--------------------------------------------------------------------------
  2542.   # ● フレーム更新
  2543.   #--------------------------------------------------------------------------
  2544.   alias side_view_update update
  2545.   def update
  2546.     side_view_update
  2547.     # スプライトの座標を設定
  2548.     if self.actor != nil && (self.x != self.actor.screen_x + ARROW_OX or self.y != self.actor.screen_y + ARROW_OY)
  2549.       self.x = self.actor.screen_x + ARROW_OX
  2550.       self.y = self.actor.screen_y + ARROW_OY
  2551.     end
  2552.   end
  2553. end
  2554. class Arrow_Enemy < Arrow_Base
  2555.   include Side_view
  2556.   #--------------------------------------------------------------------------
  2557.   # ● フレーム更新
  2558.   #--------------------------------------------------------------------------
  2559.   alias side_view_update update
  2560.   def update
  2561.     side_view_update
  2562.     # スプライトの座標を設定
  2563.     if self.enemy != nil && self.y != self.enemy.screen_y + self.enemy.height/2
  2564.       self.x = self.enemy.screen_x
  2565.       self.y = self.enemy.screen_y + self.enemy.height/2
  2566.     end
  2567.   end
  2568. end
  2569. module Rtab_use
  2570.   def update_phase4_step3(battler)
  2571.     # ヘルプウィンドウの更新。アクションの種別で分岐
  2572.     case battler.current_action.kind
  2573.     when 0  # 基本
  2574.       if battler.current_action.basic == 1
  2575.         @help_window.set_text($data_system.words.guard, 1)
  2576.         @help_wait = @help_time
  2577.       end
  2578.       if battler.is_a?(Game_Enemy) and battler.current_action.basic == 2
  2579.         @help_window.set_text("逃げる", 1)
  2580.         @help_wait = @help_time
  2581.       end
  2582.     when 1  # スキル
  2583.       skill =  $data_skills[battler.current_action.skill_id]
  2584.       @help_window.set_text(skill.name, 1)
  2585.       @help_wait = @help_time
  2586.     when 2  # アイテム
  2587.       item = $data_items[battler.current_action.item_id]
  2588.       @help_window.set_text(item.name, 1)
  2589.       @help_wait = @help_time
  2590.     end
  2591.     # 行動側アニメーション (ID が 0 の場合は白フラッシュ)
  2592.     if battler.anime1 == 0
  2593.       battler.white_flash = true
  2594.       battler.wait = 5
  2595.       # カメラ設定
  2596.       if battler.target[0].is_a?(Game_Enemy)
  2597.         camera_set(battler)
  2598.       end
  2599.     else
  2600.       battler.animation.push([battler.anime1, true])
  2601.       speller = synthe?(battler)
  2602.       if speller != nil
  2603.         for spell in speller
  2604.           if spell != battler
  2605.             if spell.current_action.spell_id == 0
  2606.               spell.animation.push([battler.anime1, true])
  2607.             else
  2608.               skill = spell.current_action.spell_id
  2609.               spell.animation.push([$data_skills[skill].animation1_id, true])
  2610.               spell.current_action.spell_id = 0
  2611.             end
  2612.           end
  2613.         end
  2614.       end
  2615.       battler.wait = 2 * $data_animations[battler.anime1].frame_max - 10
  2616.       battler.anime1 = 0
  2617.     end
  2618.     # ステップ 4 に移行
  2619.     battler.phase = 4 if !(!battler.animation1_on and battler.action? and !battler.flash?)
  2620.   end
  2621. end
  2622.  
  2623. #==============================================================================
  2624. # ■ Scene_Battle
  2625. #==============================================================================
  2626. class Scene_Battle
  2627.   include Side_view
  2628.   include Rtab_use if RTAB
  2629.   #--------------------------------------------------------------------------
  2630.   # ● 公開インスタンス変数
  2631.   #--------------------------------------------------------------------------
  2632.   attr_reader   :phase            # フェーズ
  2633.   attr_reader   :phase4_step      # フェーズ4ステップ
  2634.   attr_reader   :active_battler   # 対象の配列
  2635.   attr_reader   :target_battlers  # 対象の配列
  2636.   attr_reader   :animation1_id    # 行動アニメID
  2637.   attr_reader   :animation2_id    # 対象アニメID
  2638.   #--------------------------------------------------------------------------
  2639.   # ● メイン処理
  2640.   #--------------------------------------------------------------------------
  2641.   alias side_view_main main
  2642.   def main
  2643.     # バトラー初期化
  2644.     for battler in $game_party.actors + $game_troop.enemies
  2645.       battler.start_battle
  2646.     end
  2647.     # 戻す
  2648.     side_view_main
  2649.   end
  2650.   #--------------------------------------------------------------------------
  2651.   # ● 閃き判定
  2652.   #--------------------------------------------------------------------------
  2653.   def flash?
  2654.     return @flash_flag ? true : false
  2655.   end  
  2656.   #--------------------------------------------------------------------------
  2657.   # ● 閃きアニメ待ち時間取得
  2658.   #--------------------------------------------------------------------------
  2659.   def flash_duration
  2660.     animation = nil
  2661.     if FLASH_ANIME
  2662.       animation = $data_animations[FLASH_ANIMATION_ID]
  2663.     end
  2664.     return animation != nil ? animation.frame_max * 2 + 2 : 0
  2665.   end
  2666.   #--------------------------------------------------------------------------
  2667.   # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  2668.   #--------------------------------------------------------------------------
  2669.   alias side_view_update_phase4_step2 update_phase4_step2
  2670.   def update_phase4_step2(*arg)
  2671.     battler = convert_battler2(*arg)
  2672.     battler.action
  2673.     side_view_update_phase4_step2(*arg)
  2674.   end
  2675.   #--------------------------------------------------------------------------
  2676.   # ● フレーム更新 (メインフェーズ ステップ 3 : 行動側アニメーション)
  2677.   #--------------------------------------------------------------------------
  2678.   alias side_view_update_phase4_step3 update_phase4_step3
  2679.   def update_phase4_step3(*arg)
  2680.     battler = convert_battler2(*arg)
  2681.     if battler.flash? and FLASH_ANIME
  2682.       battler.flash_flag["normal"] = true
  2683.     end
  2684.     side_view_update_phase4_step3(*arg)
  2685.   end
  2686.   #--------------------------------------------------------------------------
  2687.   # ● フレーム更新 (メインフェーズ ステップ 4 : 対象側アニメーション)
  2688.   #--------------------------------------------------------------------------
  2689.   alias side_view_update_phase4_step4 update_phase4_step4
  2690.   def update_phase4_step4(*arg)
  2691.     battler = convert_battler2(*arg)
  2692.     targets = RTAB ? battler.target : @target_battlers
  2693.     return if !battler.animation2_on and battler.action? if !RTAB
  2694.     side_view_update_phase4_step4(*arg)
  2695.     for target in targets
  2696.       if RTAB
  2697.         value = nil
  2698.         if target.damage_sp.include?(battler)
  2699.           value = target.damage_sp[battler]
  2700.         end
  2701.         if target.damage.include?(battler)
  2702.           if value == nil or value == "Miss"
  2703.             value = target.damage[battler]
  2704.           elsif value.is_a?(Numeric) && value > 0
  2705.             value = target.damage[battler] == "Miss" ? value : target.damage[battler]
  2706.           end
  2707.         end
  2708.       else
  2709.         value = target.damage
  2710.       end
  2711.       if target.is_a?(Game_Actor)
  2712.         # ダメージの場合
  2713.         if value.is_a?(Numeric) && value > 0
  2714.           # シェイクを開始
  2715.           target.shake = true
  2716.         end
  2717.       elsif target.is_a?(Game_Enemy)
  2718.         # ダメージの場合
  2719.         if value.is_a?(Numeric) && value > 0
  2720.           # シェイクを開始
  2721.           target.shake = true
  2722.         end
  2723.       end
  2724.     end
  2725.   end
  2726.   #--------------------------------------------------------------------------
  2727.   # ● プレバトルフェーズ開始
  2728.   #--------------------------------------------------------------------------
  2729.   alias start_phase1_correct start_phase1
  2730.   def start_phase1
  2731.     # カメラの設定
  2732.     # 元々フロントビュー向けの数値になっているため
  2733.     @zoom_rate = [1.0, 1.0]
  2734.     start_phase1_correct
  2735.   end
  2736.   #--------------------------------------------------------------------------
  2737.   # ● アクターコマンドフェーズ開始
  2738.   #--------------------------------------------------------------------------
  2739.   alias start_phase3_correct start_phase3
  2740.   def start_phase3
  2741.     battler = convert_battler
  2742.     start_phase3_correct
  2743.     if RTAB
  2744.       # カメラの設定
  2745.       # 元々フロントビュー向けの数値になっているため
  2746.       @camera = "command"
  2747. #      @spriteset.screen_target(0, 0, 1.0)
  2748.     end
  2749.   end
  2750.  
  2751.  
  2752.   def action_phase(battler)
  2753.     # action が 1 の場合、バトラーが行動中かどうか確認
  2754.     if @action == 1 and battler.phase < 3
  2755.       for target in battler.target
  2756.         speller = synthe?(target)
  2757.         if speller == nil
  2758.           # ターゲットが通常行動中の場合
  2759.           if @action_battlers.include?(target)
  2760.             if target.phase > 2
  2761.               return
  2762.             end
  2763.           end
  2764.         else
  2765.           # ターゲットが連携スキル発動中の場合
  2766.           for spell in speller
  2767.             if @action_battlers.include?(spell)
  2768.               if spell.phase > 2
  2769.                 return
  2770.               end
  2771.             end
  2772.           end
  2773.         end
  2774.       end
  2775.     end
  2776. case battler.phase
  2777.   when 1
  2778.     update_phase4_step1(battler)
  2779.   when 2
  2780.     update_phase4_step2(battler)
  2781.   when 3  
  2782.     update_phase4_step3(battler) if !(!battler.animation1_on and battler.action? and !battler.flash?)
  2783.   when 4
  2784.     update_phase4_step4(battler) if !(!battler.animation2_on and battler.action?)
  2785.   when 5
  2786.     update_phase4_step5(battler)
  2787.       when 6
  2788.     update_phase4_step6(battler)
  2789.   end
  2790. end
  2791. end


■ 物品詳細幫助窗口
RUBY 代码复制
  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.     # 基本數據設定
  142. =begin
  143.     name_size = 名字文字大小
  144.     size = 描述文字大小
  145.     word = 每行的描述文字數
  146.     move = 全體描述偏移幅度
  147. =end
  148.     name_size = 18
  149.     size = 14
  150.     word = 12
  151.     move = 80
  152.     #------------------------------------------------------------------------
  153.     # ● 確定背景圖片的高度
  154.     #------------------------------------------------------------------------
  155.     h += (description.size/3/word)
  156.     h += 1 if (description.size/3%word) > 0
  157.     h += 1 if equipment.is_a?(RPG::Weapon)
  158.     now_h = h
  159.     h += 1
  160.     h += 1 unless equipment.pdef.zero?
  161.     h += 1 unless equipment.mdef.zero?
  162.     h += 1 if element_set.size > 0
  163.     h += 1 if element_set.size >= 5
  164.     case equipment
  165.     when RPG::Weapon
  166.       h += 1 unless minus_state_set.empty?
  167.       h += minus_state_set.size
  168.       h += 1 unless plus_state_set.empty?
  169.       h += plus_state_set.size
  170.     when RPG::Armor
  171.       h += 1 unless guard_state_set.empty?
  172.       h += guard_state_set.size
  173.       h += 1 unless auto_state_id.zero?
  174.     end
  175.     h += 1
  176.     h += 1 unless equipment.str_plus.zero?
  177.     h += 1 unless equipment.dex_plus.zero?
  178.     h += 1 unless equipment.agi_plus.zero?
  179.     h += 1 unless equipment.int_plus.zero?
  180.     #h += 1 unless equipment.hp_plus.zero?
  181.     h += materia_height_plus(equipment) unless self.materia.nil?
  182.     #------------------------------------------------------------------------
  183.     # ● 圖片顯示保證高度
  184.     #------------------------------------------------------------------------
  185.     h = 6 + now_h if (h - now_h) < 6
  186.     #------------------------------------------------------------------------
  187.     # ● 換算高度
  188.     #------------------------------------------------------------------------
  189.     self.height = h * size + name_size + 32
  190.     #------------------------------------------------------------------------
  191.     # ● 生成背景
  192.     #------------------------------------------------------------------------
  193.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  194.     self.contents.clear
  195.     #------------------------------------------------------------------------
  196.     # ● 名字描繪
  197.     #------------------------------------------------------------------------
  198.     text = equipment.name
  199.     self.contents.font.color = text_color(1)#(equipment.name_color)
  200.     self.contents.font.size = name_size
  201.     if text.nil?
  202.       self.visible = false
  203.     else
  204.       self.visible = true
  205.       self.contents.draw_text(0, 0, text.size*7, name_size, text, 0)
  206.     end
  207.     #------------------------------------------------------------------------
  208.     # ● 說明描繪
  209.     #------------------------------------------------------------------------
  210.     x = 0
  211.     y += 1
  212.     while ((text = description.slice!(/./m)) != nil)
  213.       self.contents.font.color = system_color
  214.       self.contents.font.size = size
  215.       self.contents.draw_text(x*size, y*size+5, size, size, text, 0)
  216.       x+=1
  217.       if x == word
  218.         x=0
  219.         y+=1   
  220.       end
  221.     end
  222.     #------------------------------------------------------------------------
  223.     # ● 圖標描繪
  224.     #------------------------------------------------------------------------
  225.     bitmap = RPG::Cache.icon(equipment.icon_name)
  226.     opacity = self.contents.font.color == normal_color ? 255 : 128
  227.     self.contents.blt(0 ,y*size + 20, bitmap, Rect.new(0, 0, 95, 100), 225)
  228.     #------------------------------------------------------------------------
  229.     # ● 攻擊力描繪(武器)
  230.     #------------------------------------------------------------------------
  231.     if equipment.is_a?(RPG::Weapon)
  232.       x = 0
  233.       y += 1
  234.       text = $data_system.words.atk+":"+equipment.atk.to_s
  235.       self.contents.font.color = Color.new(255, 0, 0, 255)
  236.       self.contents.font.size = size
  237.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  238.     end
  239.     #------------------------------------------------------------------------
  240.     # ● 價格描繪
  241.     #------------------------------------------------------------------------
  242.     x = 0
  243.     y += 1
  244.     text = phrase["price"] + equipment.price.to_s
  245.     self.contents.font.color = Color.new(255, 255, 0, 255)
  246.     self.contents.font.size = size
  247.     self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  248.     #------------------------------------------------------------------------
  249.     # ● 物理防禦
  250.     #------------------------------------------------------------------------
  251.     unless equipment.pdef.zero?
  252.       x = 0
  253.       y += 1
  254.       text = $data_system.words.pdef+":"+equipment.pdef.to_s
  255.       self.contents.font.color = Color.new(0, 255, 255, 255)
  256.       self.contents.font.size = size
  257.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  258.     end
  259.     #------------------------------------------------------------------------
  260.     # ● 魔法防禦
  261.     #------------------------------------------------------------------------
  262.     unless equipment.mdef.zero?
  263.       x = 0
  264.       y += 1
  265.       text=$data_system.words.mdef+":"+equipment.mdef.to_s
  266.       self.contents.font.color = Color.new(255, 0, 255, 255)
  267.       self.contents.font.size = size
  268.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  269.     end
  270.     #------------------------------------------------------------------------
  271.     # ● 屬性
  272.     #------------------------------------------------------------------------
  273.     if element_set.size > 0
  274.       x = 0
  275.       y += 1
  276.       text = phrase["elements"]
  277.       for i in 0...element_set.size
  278.         break if i > 4
  279.         text += $data_system.elements[element_set[i]]
  280.       end
  281.       self.contents.font.color = Color.new(0, 255, 0, 255)
  282.       self.contents.font.size = size
  283.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  284.     end
  285.     if element_set.size >= 5
  286.       x = (phrase["elements"].size)*5-4
  287.       y += 1
  288.       text = ""
  289.       for i in 4...element_set.size
  290.         text += $data_system.elements[element_set[i]]
  291.       end
  292.       self.contents.font.color = Color.new(0, 255, 0, 255)
  293.       self.contents.font.size = size
  294.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  295.     end
  296.     #------------------------------------------------------------------------
  297.     # ● 描述分流 武器/防具
  298.     #------------------------------------------------------------------------
  299.     case equipment
  300.     when RPG::Weapon
  301.       #------------------------------------------------------------------------
  302.       # ● 解除狀態(武器)
  303.       #------------------------------------------------------------------------
  304.       unless minus_state_set.empty?
  305.         x = 0
  306.         y += 1
  307.         text=phrase["minus_states"]
  308.         text=phrase["guard_states"]
  309.         self.contents.font.color = Color.new(0, 255, 255, 255)
  310.         self.contents.font.size = size
  311.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  312.         for i in 0...minus_state_set.size
  313.           y += 1
  314.           text = $data_states[minus_state_set[i]].name        
  315.           self.contents.font.color = Color.new(0, 255, 255, 255)
  316.           self.contents.font.size = size
  317.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  318.         end
  319.       end
  320.       #------------------------------------------------------------------------
  321.       # ● 附加狀態(武器)
  322.       #------------------------------------------------------------------------
  323.       unless plus_state_set.empty?
  324.         x = 0
  325.         y += 1
  326.         text = phrase["plus_states"]
  327.         self.contents.font.color = Color.new(255, 0, 0, 255)
  328.         self.contents.font.size = size
  329.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  330.         for i in 0...plus_state_set.size
  331.           y += 1
  332.           text=$data_states[plus_state_set[i]].name        
  333.           self.contents.font.color = Color.new(255, 0, 0, 255)
  334.           self.contents.font.size = size
  335.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  336.         end  
  337.       end
  338.     when RPG::Armor
  339.       #------------------------------------------------------------------------
  340.       # ● 防禦狀態(防具)
  341.       #------------------------------------------------------------------------
  342.       unless guard_state_set.empty?
  343.         x = 0
  344.         y += 1
  345.         text=phrase["guard_states"]
  346.         self.contents.font.color = Color.new(0, 255, 0, 255)
  347.         self.contents.font.size = size
  348.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  349.         for i in 0...guard_state_set.size
  350.           y += 1
  351.           text = $data_states[guard_state_set[i]].name        
  352.           self.contents.font.color = Color.new(0, 255, 0, 255)
  353.           self.contents.font.size = size
  354.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  355.         end
  356.       end
  357.       #------------------------------------------------------------------------
  358.       # ● 自動狀態(防具)
  359.       #------------------------------------------------------------------------
  360.       unless auto_state_id.zero?
  361.         x = 0
  362.         y += 1
  363.         text = phrase["auto_state"] + $data_states[auto_state_id].name
  364.         self.contents.font.color = Color.new(0, 255, 0, 255)
  365.         self.contents.font.size = size
  366.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  367.       end
  368.     end
  369.     #------------------------------------------------------------------------
  370.     # ● 空行
  371.     #------------------------------------------------------------------------
  372.     y+=1
  373.     #------------------------------------------------------------------------
  374.     # ● 力量
  375.     #------------------------------------------------------------------------
  376.     unless equipment.str_plus.zero?
  377.       x = 0
  378.       y += 1
  379.       h += 1
  380.       if equipment.str_plus > 0
  381.         text=$data_system.words.str+" +"+ equipment.str_plus.to_s
  382.       else
  383.         text=$data_system.words.str+" -"+ (-equipment.str_plus).to_s
  384.       end
  385.       self.contents.font.color = Color.new(255, 0, 0, 255)
  386.       self.contents.font.size = size
  387.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)  
  388.     end
  389.     #------------------------------------------------------------------------
  390.     # ● 靈巧
  391.     #------------------------------------------------------------------------
  392.     unless equipment.dex_plus.zero?
  393.       x = 0
  394.       y += 1
  395.       h += 1
  396.       if equipment.dex_plus > 0
  397.         text=$data_system.words.dex+" +"+ equipment.dex_plus.to_s
  398.       else
  399.         text=$data_system.words.dex+" -"+ (-equipment.dex_plus).to_s
  400.       end
  401.       self.contents.font.color = Color.new(255, 255, 0, 255)
  402.       self.contents.font.size = size
  403.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  404.     end
  405.     #------------------------------------------------------------------------
  406.     # ● 速度
  407.     #------------------------------------------------------------------------
  408.     unless equipment.agi_plus.zero?
  409.       x = 0
  410.       y += 1
  411.       h += 1
  412.       if equipment.agi_plus > 0
  413.         text=$data_system.words.agi+" +"+ equipment.agi_plus.to_s
  414.       else
  415.         text=$data_system.words.agi+" -"+ (-equipment.agi_plus).to_s
  416.       end
  417.       self.contents.font.color = Color.new(0, 255, 255, 255)
  418.       self.contents.font.size = size
  419.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  420.     end
  421.     #------------------------------------------------------------------------
  422.     # ● 智力
  423.     #------------------------------------------------------------------------
  424.     unless equipment.int_plus.zero?
  425.       x = 0
  426.       y += 1
  427.       h += 1
  428.       if equipment.int_plus > 0
  429.         text=$data_system.words.int+" +"+ equipment.int_plus.to_s
  430.       else
  431.         text=$data_system.words.int+" -"+ (-equipment.int_plus).to_s
  432.       end
  433.       self.contents.font.color = Color.new(255, 0, 255, 255)
  434.       self.contents.font.size = size
  435.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  436.     end
  437.     #------------------------------------------------------------------------
  438.     # ● HP MAX增加值
  439.     #------------------------------------------------------------------------
  440.     #unless equipment.hp_plus.zero?
  441.     #  x = 0
  442.     #  y += 1
  443.     #  h += 1
  444.     #  if equipment.hp_plus > 0
  445.     #    text=phrase["hp-max"]+" +"+ equipment.hp_plus.to_s
  446.     #  else
  447.     #    text=phrase["hp-max"]+" -"+ (-equipment.hp_plus).to_s
  448.     #  end
  449.     #  self.contents.font.color = normal_color
  450.      # self.contents.font.size = size
  451.      # self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  452.     #end
  453.     #------------------------------------------------------------------------
  454.     # ● 魔力石描繪
  455.     #------------------------------------------------------------------------
  456.     y += draw_materia(equipment, move, y, size) unless self.materia.nil?
  457.   end
  458.   #--------------------------------------------------------------------------
  459.   # ● 物品幫助窗口
  460.   #--------------------------------------------------------------------------
  461.   def set_item_text(item)
  462.     # 取得描述
  463.     description = item.description.clone
  464.     # 取得屬性、附加狀態、解除狀態之副本
  465.     element_set = item.element_set.clone
  466.     plus_state_set = item.plus_state_set.clone
  467.     minus_state_set = item.minus_state_set.clone
  468.     # 過濾不顯示的描述
  469.     element_set -= @unshow_elements
  470.     plus_state_set -= @unshow_states
  471.     minus_state_set -= @unshow_states
  472.     # 初始化數據設定
  473.     x = 0
  474.     y = 0
  475.     h = 0
  476.     phrase = {}
  477.     scope ={}
  478.     parameter_type = {}
  479.  
  480.     # 基本數據設定
  481. =begin
  482.     name_size = 名字文字大小
  483.     size = 描述文字大小
  484.     word = 每行的描述文字數
  485.     move = 全體描述偏移幅度
  486. =end
  487.     name_size = 18
  488.     size = 14
  489.     word = 12
  490.     move = 80
  491.  
  492.     # 基本文字設定
  493.     phrase["scope"] = "范围:"
  494.     phrase["price"] = "价格:"
  495.     phrase["recover_hp_rate"] = "HP 回复率:"
  496.     phrase["recover_hp"] = "HP 回复:"
  497.     phrase["recover_sp_rate"] = "SP 回复率:"
  498.     phrase["recover_sp"] = "SP 回复:"
  499.     phrase["elements"] = "属性:"
  500.     phrase["plus"] = "附加"
  501.     phrase["minus"] = "解除"
  502.     phrase["states"] = "状态"
  503.     scope[0] = "特殊物品"
  504.     scope[1] = "敌单体"
  505.     scope[2] = "敌全体"
  506.     scope[3] = "己方单体"
  507.     scope[4] = "己方全体"
  508.     scope[5] = "己方单体(HP=0)"
  509.     scope[6] = "己方全体(HP=0)"
  510.     scope[7] = "使用者"
  511.     scope[8] = "使用者"
  512.  
  513.     parameter_type[1] = "MaxHP"
  514.     parameter_type[2] = "MaxSP"
  515.     parameter_type[3] = $data_system.words.str
  516.     parameter_type[4] = $data_system.words.dex
  517.     parameter_type[5] = $data_system.words.agi
  518.     parameter_type[6] = $data_system.words.int
  519.  
  520.     #依顯示内容確定自身高
  521.     h = (description.size/3/word)
  522.     h +=1 if (description.size/3%word)> 0
  523.     now_h = h
  524.     h +=3  # 空行,效果範圍,價格
  525.     h += 1 unless item.recover_hp_rate.zero?
  526.     h += 1 unless item.recover_hp.zero?
  527.     h += 1 unless item.recover_sp_rate.zero?
  528.     h += 1 unless item.recover_sp.zero?
  529.     h += 1 unless item.parameter_type.zero?
  530.     h += 1 unless element_set[0].nil?
  531.     h += 1 unless element_set[4].nil?
  532.     h += (1+plus_state_set.size) unless plus_state_set.empty?
  533.     h += (1+minus_state_set.size) unless minus_state_set.empty?
  534.     #------------------------------------------------------------------------
  535.     # ● 圖片顯示保證高度
  536.     #------------------------------------------------------------------------
  537.     h = 6 + now_h if (h - now_h) < 6
  538.     #------------------------------------------------------------------------
  539.     # ● 換算高度
  540.     #------------------------------------------------------------------------
  541.     self.height = h * size + name_size + 32
  542.     #------------------------------------------------------------------------
  543.     # ● 生成背景
  544.     #------------------------------------------------------------------------
  545.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  546.     self.contents.clear
  547.     #------------------------------------------------------------------------
  548.     # ● 名字描繪
  549.     #------------------------------------------------------------------------
  550.     text = item.name
  551.     self.contents.font.color = Color.new(0, 0, 255, 255)
  552.     self.contents.font.size = name_size
  553.     if text.nil?
  554.       self.visible = false
  555.     else
  556.       self.visible = true
  557.       self.contents.draw_text(0,0, text.size*7, 20, text, 0)
  558.     end
  559.     #------------------------------------------------------------------------
  560.     # ● 說明描繪
  561.     #------------------------------------------------------------------------
  562.     x = 0
  563.     y += 1
  564.     while ((text = description.slice!(/./m)) != nil)
  565.       self.contents.font.color = system_color
  566.       self.contents.font.size = size
  567.       self.contents.draw_text(x*size, y*size+5, size, size, text, 0)
  568.       x+=1
  569.       if x == word
  570.         x = 0
  571.         y += 1
  572.       end
  573.     end
  574.     #------------------------------------------------------------------------
  575.     # ● 圖標描繪
  576.     #------------------------------------------------------------------------
  577.     bitmap = RPG::Cache.icon(item.icon_name) unless item.icon_name.nil?
  578.     opacity = self.contents.font.color == normal_color ? 255 : 128
  579.     self.contents.blt(0 ,y*size + 20, bitmap, Rect.new(0, 0, 95, 100), 225)
  580.     #------------------------------------------------------------------------
  581.     # ● 魔力石接口
  582.     #------------------------------------------------------------------------
  583.     unless self.materia.nil?
  584.       return if is_materia?(item)
  585.     end
  586.     #------------------------------------------------------------------------
  587.     # ● 效果範圍
  588.     #------------------------------------------------------------------------
  589.     text= phrase["scope"] + scope[item.scope]
  590.     x = 0
  591.     y += 1
  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.     #------------------------------------------------------------------------
  596.     # ● 價格
  597.     #------------------------------------------------------------------------
  598.     x = 0
  599.     y += 1      
  600.     text = phrase["price"] + item.price.to_s
  601.     self.contents.font.color = Color.new(255, 255, 0, 255)
  602.     self.contents.font.size = size
  603.     self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  604.  
  605.     #------------------------------------------------------------------------
  606.     # ● HP回復率
  607.     #------------------------------------------------------------------------
  608.     unless item.recover_hp_rate.zero?  
  609.       x = 0
  610.       y += 1
  611.       text = phrase["recover_hp_rate"] + item.recover_hp_rate.to_s+"%"
  612.       self.contents.font.color = Color.new(255, 0, 0, 255)
  613.       self.contents.font.size = size
  614.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)   
  615.     end
  616.     #------------------------------------------------------------------------
  617.     # ● HP回復量
  618.     #------------------------------------------------------------------------
  619.     unless item.recover_hp.zero?  
  620.       x = 0
  621.       y += 1      
  622.       text = phrase["recover_hp"] + item.recover_hp.to_s
  623.       self.contents.font.color = Color.new(255, 0, 100, 255)
  624.       self.contents.font.size = size
  625.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  626.     end
  627.     #------------------------------------------------------------------------
  628.     # ● SP回復率
  629.     #------------------------------------------------------------------------
  630.     unless item.recover_sp_rate.zero?
  631.       x = 0
  632.       y += 1      
  633.       text = phrase["recover_sp_rate"] + item.recover_sp_rate.to_s+"%"
  634.       self.contents.font.color = Color.new(0, 0, 255, 255)
  635.       self.contents.font.size = size
  636.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  637.     end
  638.     #------------------------------------------------------------------------
  639.     # ● SP回復量
  640.     #------------------------------------------------------------------------
  641.     unless item.recover_sp.zero?  
  642.       x = 0
  643.       y += 1      
  644.       text = phrase["recover_sp"] + item.recover_sp.to_s
  645.       self.contents.font.color = Color.new(0, 100, 255, 255)
  646.       self.contents.font.size = size
  647.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  648.     end
  649.     #------------------------------------------------------------------------
  650.     # ● 能力值增加
  651.     #------------------------------------------------------------------------
  652.     unless item.parameter_type.zero?
  653.       x = 0
  654.       y += 1      
  655.       text= parameter_type[item.parameter_type]+" +"+item.parameter_points.to_s
  656.  
  657.       self.contents.font.color = Color.new(0, 255, 0, 255)
  658.       self.contents.font.size = size
  659.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  660.     end
  661.     #------------------------------------------------------------------------
  662.     # ● 屬性
  663.     #------------------------------------------------------------------------
  664.     if element_set.size > 0
  665.       x = 0
  666.       y += 1
  667.       text = phrase["elements"]
  668.       for i in 0...element_set.size
  669.         break if i > 4
  670.         text += $data_system.elements[element_set[i]]
  671.       end
  672.       self.contents.font.color = Color.new(255, 0, 255, 255)
  673.       self.contents.font.size = size
  674.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  675.     end
  676.     if element_set.size >= 5
  677.       x = (phrase["elements"].size)*5-4
  678.       y += 1
  679.       text = ""
  680.       for i in 4...element_set.size
  681.         text += $data_system.elements[element_set[i]]
  682.       end
  683.       self.contents.font.color = Color.new(255, 0, 255, 255)
  684.       self.contents.font.size = size
  685.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  686.     end
  687.     #------------------------------------------------------------------------
  688.     # ● 狀態添加
  689.     #------------------------------------------------------------------------
  690.     unless plus_state_set.empty?
  691.       text = phrase["plus"]
  692.       x = 0
  693.       y += 1
  694.       self.contents.font.color = normal_color
  695.       self.contents.font.size = size
  696.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  697.       plus_state_set.each do |plus_state|
  698.         y += 1
  699.         text = $data_states[plus_state].name        
  700.         self.contents.font.color = Color.new(255, 100, 0, 255)
  701.         self.contents.font.size = size
  702.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)      
  703.       end  
  704.     end
  705.     #------------------------------------------------------------------------
  706.     # ● 狀態解除
  707.     #------------------------------------------------------------------------
  708.     unless minus_state_set.empty?
  709.       text = phrase["minus"]
  710.       x = 0
  711.       y += 1
  712.       self.contents.font.color = Color.new(100, 0, 200, 255)
  713.       self.contents.font.size = size
  714.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  715.       minus_state_set.each do |minus_state|
  716.         y += 1
  717.         text = $data_states[minus_state].name
  718.         self.contents.font.color = Color.new(100, 0, 200, 255)
  719.         self.contents.font.size = size
  720.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)   
  721.       end
  722.     end
  723.   end
  724.   #--------------------------------------------------------------------------
  725.   # ● 设置角色
  726.   #     actor : 要显示状态的角色
  727.   #--------------------------------------------------------------------------
  728.   def set_actor(actor)
  729.     if actor != @actor
  730.       self.contents.clear
  731.       draw_actor_name(actor, 4, 0)
  732.       draw_actor_state(actor, 140, 0)
  733.       draw_actor_hp(actor, 284, 0)
  734.       draw_actor_sp(actor, 460, 0)
  735.       @actor = actor
  736.       @text = nil
  737.       self.visible = true
  738.     end
  739.   end
  740.   #--------------------------------------------------------------------------
  741.   # ● 設置角色
  742.   #     actor : 要顯示狀態之角色
  743.   #--------------------------------------------------------------------------
  744.   def set_actor(actor)
  745.     self.contents = Bitmap.new(width - 32, height - 32) if self.contents.nil?
  746.     if actor != @actor
  747.       self.contents.clear
  748.       draw_actor_name(actor, 4, 0)
  749.       draw_actor_state(actor, 140, 0)
  750.       draw_actor_hp(actor, 284, 0)
  751.       draw_actor_sp(actor, 460, 0)
  752.       @actor = actor
  753.       @text = nil
  754.       self.visible = true
  755.     end
  756.   end
  757.   #--------------------------------------------------------------------------
  758.   # ● 設置敵人
  759.   #     enemy : 要顯示名字與狀態之敵人
  760.   #--------------------------------------------------------------------------
  761.   def set_enemy(enemy)
  762.     self.contents = Bitmap.new(width - 32, height - 32) if self.contents.nil?
  763.     text = enemy.name.sub(/\\[Ff]\[([0-9]+)\]/) {""}
  764.     state_text = make_battler_state_text(enemy, 112, false)
  765.     if state_text != ""
  766.       text += "  " + state_text
  767.     end
  768.     set_text(text, 1)
  769.     self.visible = true
  770.   end
  771.   #--------------------------------------------------------------------------
  772.   # ● 校正帮助窗口位置
  773.   #--------------------------------------------------------------------------
  774.   def set_pos(x,y,width,oy,index,column_max)
  775.     #光标坐标
  776.     cursor_width = width / column_max - 32
  777.     xx = index % column_max * (cursor_width + 32)
  778.     yy = index / column_max * 32 - oy
  779.     self.x=xx+x+150
  780.     self.y=yy+y+30
  781.     if self.x+self.width>640
  782.       self.x=640-self.width
  783.     end
  784.     if self.y+self.height>480
  785.       self.y=480-self.height
  786.     end  
  787.   end
  788.   #------------------------------------------------------------------------
  789.   # ● 裝備名字顔色變化 接口
  790.   #------------------------------------------------------------------------
  791.   def draw_name_color(equipment)
  792.     return normal_color
  793.   end
  794.   #------------------------------------------------------------------------
  795.   # ● 自身身份確認
  796.   #------------------------------------------------------------------------
  797.   def original_help?
  798.     return false
  799.   end
  800. end
  801.  
  802. #------------------------------------------------------------------------------
  803.  
  804.  
  805.  
  806. #------------------------------------------------------------------------------
  807. #==============================================================================
  808. # ■ Window_Item
  809. #------------------------------------------------------------------------------
  810. #  物品画面、战斗画面、显示浏览物品的窗口。
  811. #==============================================================================
  812.  
  813. class Window_Item < Window_Selectable
  814.   #--------------------------------------------------------------------------
  815.   # ● 初始化对像
  816.   #--------------------------------------------------------------------------
  817.   def initialize
  818.     super(0, 0, 640, 480)
  819.     @column_max = 2
  820.     unless  $scene.is_a?Scene_Battle
  821.     self.opacity = 0#■■■透明
  822.     end
  823.     refresh
  824.     self.index = 0
  825.     # 战斗中的情况下将窗口移至中央并将其半透明化
  826.     if $game_temp.in_battle
  827.       self.y = 64
  828.       self.height = 256
  829.       self.back_opacity = 160
  830.     end
  831.   end
  832.   #--------------------------------------------------------------------------
  833.   # ● 刷新帮助文本
  834.   #--------------------------------------------------------------------------
  835.   def update_help
  836.     @help_window.set_text(item)
  837.     #校正帮助窗口位置
  838.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  839.   end
  840. end
  841. #==============================================================================
  842. # ■ Window_EquipLeft
  843. #------------------------------------------------------------------------------
  844. #  装备画面的、显示角色能力值变化的窗口。
  845. #==============================================================================
  846. class Window_EquipLeft < Window_Base
  847.   #--------------------------------------------------------------------------
  848.   # ● 初始化对像
  849.   #     actor : 角色
  850.   #--------------------------------------------------------------------------
  851.   def initialize(actor)
  852. # -------------------
  853. # 修改開始
  854.     super(0, 64-64, 272, 416+64)#★★★★★★★★★★★★★★★★★★★★
  855. # 修改終了
  856. # -------------------
  857.     self.contents = Bitmap.new(width - 32, height - 32)
  858.     @actor = actor
  859.     self.opacity = 0#■■■透明
  860.     refresh
  861.   end
  862. end
  863. #------------------------------------------------------------------------------
  864.  
  865.  
  866.  
  867. #------------------------------------------------------------------------------
  868. #==============================================================================
  869. # ■ Window_EquipRight
  870. #------------------------------------------------------------------------------
  871. #  装备画面、显示角色现在装备的物品的窗口。
  872. #==============================================================================
  873.  
  874. class Window_EquipRight < Window_Selectable
  875.   #--------------------------------------------------------------------------
  876.   # ● 初始化对像
  877.   #     actor : 角色
  878.   #--------------------------------------------------------------------------
  879.   def initialize(actor)
  880. # -------------------
  881. # 修改開始
  882.     super(272, 64-64, 368, 192)#★★★★★★★★★★★★★★★★★★★★
  883. # 修改終了
  884. # -------------------
  885.     self.contents = Bitmap.new(width - 32, height - 32)
  886.     @actor = actor
  887.     self.opacity = 0#■■■透明
  888.     refresh
  889.     self.index = 0
  890.   end
  891.   #--------------------------------------------------------------------------
  892.   # ● 刷新帮助文本
  893.   #--------------------------------------------------------------------------
  894.  
  895.   def update_help
  896.     @help_window.set_text(item)
  897.     #校正帮助窗口位置
  898.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  899.   end
  900. end
  901. #------------------------------------------------------------------------------
  902.  
  903.  
  904.  
  905. #------------------------------------------------------------------------------
  906. #==============================================================================
  907. # ■ Window_EquipItem
  908. #------------------------------------------------------------------------------
  909. #  装备画面、显示浏览变更装备的候补物品的窗口。
  910. #==============================================================================
  911.  
  912. class Window_EquipItem < Window_Selectable
  913.   #--------------------------------------------------------------------------
  914.   # ● 初始化对像
  915.   #     actor      : 角色
  916.   #     equip_type : 装备部位 (0~3)
  917.   #--------------------------------------------------------------------------
  918.   def initialize(actor, equip_type)
  919. # -------------------
  920. # 修改開始
  921.     super(272, 320, 368, 160)#★★★★★★★★★★★★★★★★★★★★
  922. # 修改終了
  923. # -------------------
  924.     @actor = actor
  925.     @equip_type = equip_type
  926.     @column_max = 1
  927.     self.opacity = 0#■■■透明
  928.     refresh
  929.     self.active = false
  930.     self.index = -1
  931.   end
  932.   def update_help
  933.     @help_window.set_text(item)
  934.     #校正帮助窗口位置
  935.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  936.   end
  937. end
  938. #------------------------------------------------------------------------------
  939.  
  940.  
  941.  
  942. #------------------------------------------------------------------------------
  943. #==============================================================================
  944. # ■ Window_ShopCommand
  945. #------------------------------------------------------------------------------
  946. #  商店画面、选择要做的事的窗口
  947. #==============================================================================
  948.  
  949. class Window_ShopCommand < Window_Selectable
  950.   #--------------------------------------------------------------------------
  951.   # ● 初始化对像
  952.   #--------------------------------------------------------------------------
  953.   def initialize
  954. # -------------------
  955. # 修改開始
  956.     super(0, 64-64, 480, 64)#★★★★★★★★★★★★★★★★★
  957. # 修改終了
  958. # -------------------
  959.     self.contents = Bitmap.new(width - 32, height - 32)
  960.     @item_max = 3
  961.     @column_max = 3
  962.     @commands = ["买", "卖", "取消"]
  963.     refresh
  964.     self.index = 0
  965.   end
  966. end
  967. #------------------------------------------------------------------------------
  968.  
  969.  
  970.  
  971. #------------------------------------------------------------------------------
  972. #========================================================================================================================
  973. # ■ Window_ShopBuy
  974. #------------------------------------------------------------------------------
  975. #  商店画面、浏览显示可以购买的商品的窗口。
  976. #==============================================================================
  977.  
  978. class Window_ShopBuy < Window_Selectable
  979.   #--------------------------------------------------------------------------
  980.   # ● 初始化对像
  981.   #     shop_goods : 商品
  982.   #--------------------------------------------------------------------------
  983.   def initialize(shop_goods)
  984. # -------------------
  985. # 修改開始
  986.     super(0, 128-64, 368, 352+64)#★★★★★★★★★★★★★★★★
  987. # 修改終了
  988. # -------------------
  989.     @shop_goods = shop_goods
  990.     refresh
  991.     self.index = 0
  992.   end
  993.   #--------------------------------------------------------------------------
  994.   # ● 刷新帮助文本
  995.   #--------------------------------------------------------------------------
  996.  
  997.   def update_help
  998.     @help_window.set_text(item)
  999.     #校正帮助窗口位置
  1000.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  1001.   end
  1002. end
  1003. #------------------------------------------------------------------------------
  1004.  
  1005.  
  1006.  
  1007. #------------------------------------------------------------------------------
  1008. #==============================================================================
  1009. # ■ Window_ShopSell
  1010. #------------------------------------------------------------------------------
  1011. #  商店画面、浏览显示可以卖掉的商品的窗口。
  1012. #==============================================================================
  1013.  
  1014. class Window_ShopSell < Window_Selectable
  1015.   #--------------------------------------------------------------------------
  1016.   # ● 初始化对像
  1017.   #--------------------------------------------------------------------------
  1018.   def initialize
  1019. # -------------------
  1020. # 修改開始
  1021.     super(0, 128-64, 640, 352+64)#★★★★★★★★★★★★★★★★
  1022. # 修改終了
  1023. # -------------------
  1024.     @column_max = 2
  1025.     refresh
  1026.     self.index = 0
  1027.   end
  1028.   #--------------------------------------------------------------------------
  1029.   # ● 刷新帮助文本
  1030.   #--------------------------------------------------------------------------
  1031.  
  1032.   def update_help
  1033.     @help_window.set_text(item)
  1034.     #校正帮助窗口位置
  1035.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  1036.   end
  1037. end
  1038. #------------------------------------------------------------------------------
  1039.  
  1040.  
  1041.  
  1042. #------------------------------------------------------------------------------
  1043. #==============================================================================
  1044. # ■ Window_ShopNumber
  1045. #------------------------------------------------------------------------------
  1046. #  商店画面、输入买卖数量的窗口。
  1047. #==============================================================================
  1048. class Window_ShopNumber < Window_Base
  1049.   #--------------------------------------------------------------------------
  1050.   # ● 初始化对像
  1051.   #--------------------------------------------------------------------------
  1052.   def initialize
  1053. # -------------------
  1054. # 修改開始
  1055.     super(0, 128-64, 368, 352+64)#★★★★★★★★★★★★★★★★
  1056. # 修改終了
  1057. # -------------------
  1058.     self.contents = Bitmap.new(width - 32, height - 32)
  1059.     @item = nil
  1060.     @max = 1
  1061.     @price = 0
  1062.     @number = 1
  1063.   end
  1064. end
  1065. #------------------------------------------------------------------------------
  1066.  
  1067.  
  1068.  
  1069. #------------------------------------------------------------------------------
  1070. #==============================================================================
  1071. # ■ Window_ShopStatus
  1072. #------------------------------------------------------------------------------
  1073. #  商店画面、显示物品所持数与角色装备的窗口。
  1074. #==============================================================================
  1075.  
  1076. class Window_ShopStatus < Window_Base
  1077.   #--------------------------------------------------------------------------
  1078.   # ● 初始化对像
  1079.   #--------------------------------------------------------------------------
  1080.   def initialize
  1081. # -------------------
  1082. # 修改開始
  1083.     super(368, 128-64, 272, 352+64)#★★★★★★★★★★★★
  1084. # 修改終了
  1085. # -------------------
  1086.     self.contents = Bitmap.new(width - 32, height - 32)
  1087.     @item = nil
  1088.     refresh
  1089.   end
  1090. end
  1091. #------------------------------------------------------------------------------
  1092.  
  1093.  
  1094.  
  1095. #------------------------------------------------------------------------------
  1096. #==============================================================================
  1097. # ■ Scene_Equip
  1098. #------------------------------------------------------------------------------
  1099. #  处理装备画面的类。
  1100. #==============================================================================
  1101.  
  1102. class Scene_Equip
  1103.   #--------------------------------------------------------------------------
  1104.   # ● 刷新画面 (右侧窗口被激活的情况下)
  1105.   #--------------------------------------------------------------------------
  1106.   def update_right
  1107. # -------------------
  1108. # 修改開始
  1109.     if @right_window.item==nil
  1110.         @help_window.visible=false
  1111.     else
  1112.         @help_window.visible=true
  1113.     end
  1114. # 修改終了
  1115. # -------------------
  1116.     # 按下 B 键的情况下
  1117.     if Input.trigger?(Input::B)
  1118.       # 演奏取消 SE
  1119.       $game_system.se_play($data_system.cancel_se)
  1120.       # 切换到菜单画面
  1121.       $scene = Scene_Menu.new(2)
  1122.       return
  1123.     end
  1124.     # 按下 C 键的情况下
  1125.     if Input.trigger?(Input::C)
  1126.       # 固定装备的情况下
  1127.       if @actor.equip_fix?(@right_window.index)
  1128.         # 演奏冻结 SE
  1129.         $game_system.se_play($data_system.buzzer_se)
  1130.         return
  1131.       end
  1132.       # 演奏确定 SE
  1133.       $game_system.se_play($data_system.decision_se)
  1134.       # 激活物品窗口
  1135.       @right_window.active = false
  1136.       @item_window.active = true
  1137.       @item_window.index = 0
  1138.       return
  1139.     end
  1140.     # 按下 R 键的情况下
  1141.     if Input.trigger?(Input::R)
  1142.       # 演奏光标 SE
  1143.       $game_system.se_play($data_system.cursor_se)
  1144.       # 移至下一位角色
  1145.       @actor_index += 1
  1146.       @actor_index %= $game_party.actors.size
  1147.       # 切换到别的装备画面
  1148.       $scene = Scene_Equip.new(@actor_index, @right_window.index)
  1149.       return
  1150.     end
  1151.     # 按下 L 键的情况下
  1152.     if Input.trigger?(Input::L)
  1153.       # 演奏光标 SE
  1154.       $game_system.se_play($data_system.cursor_se)
  1155.       # 移至上一位角色
  1156.       @actor_index += $game_party.actors.size - 1
  1157.       @actor_index %= $game_party.actors.size
  1158.       # 切换到别的装备画面
  1159.       $scene = Scene_Equip.new(@actor_index, @right_window.index)
  1160.       return
  1161.     end
  1162.   end
  1163.   #--------------------------------------------------------------------------
  1164.   # ● 刷新画面 (物品窗口被激活的情况下)
  1165.   #--------------------------------------------------------------------------
  1166.   def update_item
  1167. # -------------------
  1168. # 修改開始
  1169.     if @item_window.item==nil
  1170.         @help_window.visible=false
  1171.     else
  1172.         @help_window.visible=true
  1173.     end
  1174. # 修改終了
  1175. # -------------------
  1176.     # 按下 B 键的情况下
  1177.     if Input.trigger?(Input::B)
  1178.       # 演奏取消 SE
  1179.       $game_system.se_play($data_system.cancel_se)
  1180.       # 激活右侧窗口
  1181.       @right_window.active = true
  1182.       @item_window.active = false
  1183.       @item_window.index = -1
  1184.       return
  1185.     end
  1186.     # 按下 C 键的情况下
  1187.     if Input.trigger?(Input::C)
  1188.       # 演奏装备 SE
  1189.       $game_system.se_play($data_system.equip_se)
  1190.       # 获取物品窗口现在选择的装备数据
  1191.       item = @item_window.item
  1192.       # 变更装备
  1193.       @actor.equip(@right_window.index, item == nil ? 0 : item.id)
  1194.       # 激活右侧窗口
  1195.       @right_window.active = true
  1196.       @item_window.active = false
  1197.       @item_window.index = -1
  1198.       # 再生成右侧窗口、物品窗口的内容
  1199.       @right_window.refresh
  1200.       @item_window.refresh
  1201.       @sprite.bitmap.clear
  1202.       @sprite.bitmap.draw_actor_element_radar_graph(@actor,16,255+16)
  1203.       return
  1204.     end
  1205.   end
  1206. end
  1207. #------------------------------------------------------------------------------
  1208.  
  1209.  
  1210.  
  1211. #------------------------------------------------------------------------------
  1212. #========================================================================================================================
  1213. # ■ Scene_Battle (分割定义 3)
  1214. #------------------------------------------------------------------------------
  1215. #  处理战斗画面的类。
  1216. #========================================================================================================================
  1217.  
  1218. class Scene_Battle
  1219.   #--------------------------------------------------------------------------
  1220.   # ● 刷新画面 (角色命令回合 : 选择物品)
  1221.   #--------------------------------------------------------------------------
  1222.   alias first_reupdate_phase3_item_select update_phase3_item_select  
  1223.   def update_phase3_item_select
  1224. # -------------------
  1225. # 修改開始
  1226.     @item_window.help_window.visible = false#★★★★★★★★★★★★
  1227. # 修改終了
  1228. # -------------------
  1229.     first_reupdate_phase3_item_select
  1230.   end
  1231.   #--------------------------------------------------------------------------
  1232.   # ● 开始选择物品
  1233.   #--------------------------------------------------------------------------
  1234.   def start_item_select
  1235.     # 生成物品窗口
  1236.     @item_window = Window_Item.new
  1237.     # 关联帮助窗口
  1238. # -------------------
  1239. # 修改開始
  1240.     @item_window.help_window =  Window_Help.new#★★★★★★★★★★★★
  1241. # 修改終了
  1242. # -------------------
  1243.     # 无效化角色指令窗口
  1244.     @actor_command_window.active = false
  1245.     @actor_command_window.visible = false
  1246.   end
  1247.   #--------------------------------------------------------------------------
  1248.   # ● 结束选择物品
  1249.   #--------------------------------------------------------------------------
  1250.   alias first_update_end_item_select end_item_select
  1251.   def end_item_select
  1252. # -------------------
  1253. # 修改開始
  1254.     @item_window.help_window.visible = false#★★★★★★★★★★★★
  1255. # 修改終了
  1256. # -------------------
  1257.     first_update_end_item_select
  1258.   end
  1259. end
  1260. #------------------------------------------------------------------------------
  1261.  
  1262.  
  1263.  
  1264. #------------------------------------------------------------------------------
  1265. #==============================================================================
  1266. # ■ Scene_Shop
  1267. #------------------------------------------------------------------------------
  1268. #  处理商店画面的类。
  1269. #==============================================================================
  1270.  
  1271. class Scene_Shop
  1272.   #--------------------------------------------------------------------------
  1273.   # ● 主处理
  1274.   #--------------------------------------------------------------------------
  1275. # --------------------
  1276. # 衝突可能
  1277.   def main
  1278.  
  1279.     # 生成帮助窗口
  1280. # -------------------
  1281. # 修改開始
  1282.     @help_window = Window_Help.new#★★★★★★★★★★★★★★★★
  1283. # 修改終了
  1284. # -------------------
  1285.     # 生成指令窗口
  1286.     @command_window = Window_ShopCommand.new
  1287.         # 生成金钱窗口
  1288.     @gold_window = Window_Gold.new
  1289.     @gold_window.x = 480
  1290.     @gold_window.y = 0
  1291.  
  1292. # -------------------
  1293. # 修改終了
  1294. # -------------------
  1295.     # 生成时间窗口
  1296. # -------------------
  1297. # 修改開始
  1298.     @dummy_window = Window_Base.new(0, 128-64, 640, 352+64)#★★★★★★★★★★★★★
  1299. # 修改終了
  1300. # -------------------
  1301.  
  1302.     # 生成购买窗口
  1303.  
  1304.     @buy_window = Window_ShopBuy.new($game_temp.shop_goods)
  1305.     @buy_window.active = false
  1306.     @buy_window.visible = false
  1307.     @buy_window.help_window = @help_window
  1308.  
  1309.     # 生成卖出窗口
  1310.     @sell_window = Window_ShopSell.new
  1311.     @sell_window.active = false
  1312.     @sell_window.visible = false
  1313.     @sell_window.help_window = @help_window
  1314.     # 生成数量输入窗口
  1315.     @number_window = Window_ShopNumber.new
  1316.     @number_window.active = false
  1317.     @number_window.visible = false
  1318.     # 生成状态窗口
  1319.     @status_window = Window_ShopStatus.new
  1320.     @status_window.visible = false
  1321.     # 执行过渡
  1322.     Graphics.transition
  1323.     # 主循环
  1324.     loop do
  1325.       # 刷新游戏画面
  1326.       Graphics.update
  1327.       # 刷新输入信息
  1328.       Input.update
  1329.       # 刷新画面
  1330.       update
  1331.       # 如果画面切换的话就中断循环
  1332.       if $scene != self
  1333.         break
  1334.       end
  1335.     end
  1336.     # 准备过渡
  1337.     Graphics.freeze
  1338.     # 释放窗口
  1339.  
  1340.     @help_window.dispose
  1341.     @command_window.dispose
  1342.     @gold_window.dispose
  1343.     @dummy_window.dispose
  1344.     @buy_window.dispose
  1345.     @sell_window.dispose
  1346.     @number_window.dispose
  1347.     @status_window.dispose
  1348.   end
  1349.   #--------------------------------------------------------------------------
  1350.   # ● 刷新画面
  1351.   #--------------------------------------------------------------------------
  1352. # --------------------
  1353. # 衝突可能
  1354.   def update
  1355.     # 刷新窗口
  1356.     @help_window.update
  1357.     @command_window.update
  1358.     @gold_window.update
  1359.     @dummy_window.update
  1360.     @buy_window.update
  1361.     @sell_window.update
  1362.     @number_window.update
  1363.     @status_window.update
  1364.     # 指令窗口激活的情况下: 调用 update_command
  1365.     if @command_window.active
  1366. # -------------------
  1367. # 修改開始
  1368.       @help_window.visible=false
  1369. # 修改終了
  1370. # -------------------
  1371.       update_command
  1372.       return
  1373.     end
  1374.     # 购买窗口激活的情况下: 调用 update_buy
  1375.     if @buy_window.active
  1376. # -------------------
  1377. # 修改開始
  1378.       @help_window.visible=true#★★★★★★★★★★★★★★★★
  1379.       if @buy_window.item==nil#★★★★★★★★★★★★★★★★
  1380.         @help_window.visible=false#★★★★★★★★★★★★★★★★
  1381.       end #★★★★★★★★★★★★★★★★     
  1382. # 修改終了
  1383. # -------------------
  1384.       update_buy
  1385.       return
  1386.     end
  1387.     # 卖出窗口激活的情况下: 调用 update_sell
  1388.     if @sell_window.active
  1389. # -------------------
  1390. # 修改開始
  1391.       @help_window.visible=true#★★★★★★★★★★★★★★★★
  1392.       if @sell_window.item==nil#★★★★★★★★★★★★★★★★
  1393.         @help_window.visible=false#★★★★★★★★★★★★★★★★
  1394.       end #★★★★★★★★★★★★★★★★
  1395. # 修改終了
  1396. # -------------------      
  1397.       update_sell
  1398.       return
  1399.     end
  1400.     # 个数输入窗口激活的情况下: 调用 update_number
  1401.     if @number_window.active
  1402. # -------------------
  1403. # 修改開始
  1404.       @help_window.visible=false#★★★★★★★★★★★★★★★★
  1405. # 修改終了
  1406. # -------------------
  1407.       update_number
  1408.       return
  1409.     end
  1410.   end
  1411. end
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
19 小时
注册时间
2013-3-15
帖子
23
3
 楼主| 发表于 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
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9280
在线时间
2504 小时
注册时间
2011-5-20
帖子
15389

开拓者

4
发表于 2014-11-21 17:43:40 | 只看该作者
太长了而且没框脚本···这种情况你老老实实传工程不行吗···
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复 支持 反对

使用道具 举报

Lv1.梦旅人

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

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

点评

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

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-22 11:38

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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