查看: 2455|回复: 5

[已经过期] 求物品與技能的說明窗口腳本..拜託

[复制链接]
梦石
0
星屑
65
在线时间
141 小时
注册时间
2012-4-29
回帖
32
发表于 2016-11-4 23:07:42 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 RyanBern 于 2016-11-5 21:30 编辑

各位前輩好,請問有能給我能和這個腳本共存的物品與技能的說明窗口嗎?


原帖



腳本:


  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #
  4. # ■ 熊式横版战斗 by 弗雷德   真移位:神思
  5. #==============================================================================
  6. #如果要需要Game_Battler3类的攻击、特技、物品的方法,请移至161-470行
  7. #因为重写过这三个方法,在原方法里改是不会生效的。





  8. #--------------------------------------------------------------------------
  9. #  ● 设定开始
  10. #--------------------------------------------------------------------------
  11. #伤害为0的时候是否显示无效文字,1为显示,0为不显示。
  12. INVALIDSWITCH = 1

  13. # 是否显示死亡图 1为显示,0为不显示。
  14. DEADPIC = 1

  15. # 是否显示总伤害 1为显示,0为不显示。
  16. SHOW_TOTAL_DAMAGE = 1

  17. # 是否显示连击数值 1为显示,0为不显示。
  18. HITSWITCH = 1

  19. # 是否显示SP伤害数值 1为显示,0为不显示。
  20. SDMGSWITCH = 1

  21. # 不是主状态的时候是否稍稍降低点透明度  1为降低,0为不降低
  22. NACTSWITCH = 1

  23. # 会心一击时的音效,不设置为不使用音效。
  24. CRIVOICE = "Critital_hit"

  25. # 会心一击是否开启画面晃动 1为开启,0为关闭
  26. CRISHAKE = 1

  27. # 会心一击是否开启画面闪烁,1为开启,0为关闭
  28. CRIFLASH = 1

  29. # 攻击时不移动的属性编号 默认为29号 参考数据库的设置
  30. # 比如职业枪兵勾上了29号属性,那么当枪兵使用普通攻击时将不会移动。技能也是如此。
  31. UNMOVE = 29

  32. # 攻击到与敌人同一水平线前的属性编号 默认为30号 参考数据库的设置
  33. HOMOVE = 30

  34. ##################################################################
  35. module Scene_BattleName
  36.   # 设定移动速度
  37.   Move_Duration = 28
  38.   #设定人物的单帧图,如果不做设定,将直接使用默认的战斗图。
  39.   BattlerName = {
  40.   "佛雷德" => {
  41.   "待机" => ["Fred_s1","Fred_s2","Fred_s3","Fred_s4"],
  42.   "移动" => ["Fred_r1","Fred_r2","Fred_r3","Fred_r4"],
  43.   "返回" => ["Fred_b1","Fred_b2","Fred_b3","Fred_b4"],
  44.   "受伤" => ["Fred_h"],
  45.   "防御" => ["Fred_d"],
  46.   "死亡" => ["Fred_die1","Fred_die2"]
  47.   },
  48.   
  49.   "女法師" => {
  50.   "待机" => ["01-1","01-2","01-3","01-4"],
  51.   "移动" => ["01-1"],
  52.   "返回" => ["01-5"],
  53.   "受伤" => ["01-7"],
  54.   "防御" => ["01-1"],
  55.   "死亡" => ["01-6"]
  56.   },
  57.   
  58.   "大熊" => {
  59.   "待机" => ["bear_s11","bear_s12","bear_s13","bear_s14"],
  60.   "移动" => ["bear_b1","bear_b2","bear_b3","bear_b4"],
  61.   "返回" => ["bear_r1","bear_r2","bear_r3","bear_r4"],
  62.   "受伤" => ["bear_h1"],
  63.   "防御" => ["bear_d1"],
  64.   "死亡" => ["bear_die11","bear_die12"]
  65.   },
  66.   
  67.   "蜘蛛" => {
  68.   "待机" => ["spider_s11"],
  69.   "移动" => ["spider_b1"],
  70.   "返回" => ["spider_r1"],
  71.   "受伤" => ["spider_h1"],
  72.   "防御" => ["spider_h1"],
  73.   "死亡" => ["spider_die11","spider_die12"]
  74.   },
  75.   
  76.   "鬼幽靈" => {
  77.   "待机" => ["ghost_s11","ghost_s12","ghost_s13","ghost_s14"],
  78.   "移动" => ["ghost_b1","ghost_b2","ghost_b3","ghost_b4"],
  79.   "返回" => ["ghost_r1","ghost_r2","ghost_r3","ghost_r4"],
  80.   "受伤" => ["ghost_h1"],
  81.   "防御" => ["ghost_d1"],
  82.   "死亡" => ["ghost_die11","ghost_die12"]
  83.   },
  84.   
  85.    "惡佛雷德" => {
  86.   "待机" => ["Fred_s11","Fred_s12","Fred_s13","Fred_s14"],
  87.   "移动" => ["Fred_b1","Fred_b2","Fred_b3","Fred_b4"],
  88.   "返回" => ["Fred_r1","Fred_r2","Fred_r3","Fred_r4"],
  89.   "受伤" => ["Fred_h1"],
  90.   "防御" => ["Fred_d1"],
  91.   "死亡" => ["Fred_die11","Fred_die12"]
  92.   },
  93.   
  94.   "惡熊" => {
  95.   "待机" => ["bear_s1","bear_s2","bear_s3","bear_s4"],
  96.   "移动" => ["bear_r1","bear_r2","bear_r3","bear_r4"],
  97.   "返回" => ["bear_b1","bear_b2","bear_b3","bear_b4"],
  98.   "受伤" => ["bear_h"],
  99.   "防御" => ["bear_d"],
  100.   "死亡" => ["bear_die1","bear_die2"]
  101.   },
  102.   
  103.   "惡蜘蛛" => {
  104.   "待机" => ["spider_s1"],
  105.   "移动" => ["spider_r1"],
  106.   "返回" => ["spider_b1"],
  107.   "受伤" => ["spider_h"],
  108.   "防御" => ["spider_h"],
  109.   "死亡" => ["spider_die1","spider_die2"]
  110.   },
  111.   
  112.   "巨大鬼幽靈" => {
  113.   "待机" => ["ghost_s1","ghost_s2","ghost_s3","ghost_s4"],
  114.   "移动" => ["ghost_r1","ghost_r2","ghost_r3","ghost_r4"],
  115.   "返回" => ["ghost_b1","ghost_b2","ghost_b3","ghost_b4"],
  116.   "受伤" => ["ghost_h"],
  117.   "防御" => ["ghost_d"],
  118.   "死亡" => ["ghost_die1","ghost_die2"]
  119.   },
  120. }
  121. end
  122. #至于其它的:

  123. #HP伤害数字间距偏移在602行修改。

  124. #SP伤害数字间距偏移在667行修改。

  125. #连击数字间距偏移在713行修改。

  126. #总伤害数字间距偏移在759行修改。

  127. #--------------------------------------------------------------------------
  128. #  ● 设定结束
  129. #--------------------------------------------------------------------------










  130. class Game_Battler
  131.   attr_accessor :movex                    # X坐标修正
  132.   attr_accessor :movey                    # Y坐标修正
  133.   attr_accessor :startactive              # 行为
  134.   attr_accessor :damage_sp                # 精神伤害值
  135.   alias bearrpg_initialize initialize
  136.   def initialize
  137.     bearrpg_initialize
  138.     @damage_sp = 0
  139.     @movex = 0
  140.     @movey = 0
  141.     @startactive = "待机"
  142.   end
  143.   def width #获取战斗图宽
  144.     return RPG::Cache.battler(@battler_name, @battler_hue).width
  145.   end
  146.   def height #获取战斗图高
  147.     return RPG::Cache.battler(@battler_name, @battler_hue).height
  148.   end
  149.   #--------------------------------------------------------------------------
  150.   # ● 应用通常攻击效果
  151.   #     attacker : 攻击者 (battler)
  152.   #--------------------------------------------------------------------------
  153.   def attack_effect(attacker)
  154.     # 清除会心一击标志
  155.     self.critical = false
  156.     #######伤害开关初始化##################################################bearrpg
  157.     $damage_hp = false
  158.     $damage_sp = false
  159.     # 第一命中判定
  160.     hit_result = (rand(100) < attacker.hit)
  161.     # 命中的情况下
  162.     if hit_result == true
  163.       # 计算基本伤害
  164.       atk = [attacker.atk - self.pdef / 2, 0].max
  165.       self.damage = atk * (20 + attacker.str) / 20
  166.       # 属性修正
  167.       self.damage *= elements_correct(attacker.element_set)
  168.       self.damage /= 100
  169.       # 伤害符号正确的情况下
  170.       if self.damage > 0
  171.         # 会心一击修正
  172.         if rand(100) < 4 * attacker.dex / self.agi
  173.           self.damage *= 2
  174.           self.critical = true
  175.         end
  176.         # 防御修正
  177.         if self.guarding?
  178.           self.damage /= 2
  179.         end
  180.       end
  181.       $damage_hp = true if self.damage.is_a?(Numeric)
  182.     #  $damage_sp = true if self.damage_sp != 0 SP伤害数值开关
  183.       # 分散
  184.       if self.damage.abs > 0
  185.         amp = [self.damage.abs * 15 / 100, 1].max
  186.         self.damage += rand(amp+1) + rand(amp+1) - amp
  187.       end
  188.       # 第二命中判定
  189.       eva = 8 * self.agi / attacker.dex + self.eva
  190.       hit = self.damage < 0 ? 100 : 100 - eva
  191.       hit = self.cant_evade? ? 100 : hit
  192.       hit_result = (rand(100) < hit)
  193.     end
  194.     #####################################bearrpg
  195.     # 命中的情况下
  196.     if hit_result == true
  197.       # 状态冲击解除
  198.       remove_states_shock
  199.       # HP 的伤害计算
  200.       self.hp -= self.damage
  201.       # 状态变化
  202.       @state_changed = false
  203.       states_plus(attacker.plus_state_set)
  204.       states_minus(attacker.minus_state_set)
  205.       if self.damage == 0
  206.            self.damage = "无效" if INVALIDSWITCH >0
  207.          self.critical = false
  208.        end
  209.     # Miss 的情况下
  210.     else
  211.       # 伤害设置为 "Miss"
  212.       self.damage = "Miss"
  213.       # 清除会心一击标志
  214.       self.critical = false
  215.     end
  216.     # 过程结束
  217.     return true
  218.   end
  219.   #############################################bearrpg
  220.   #--------------------------------------------------------------------------
  221.   # ● 应用特技效果
  222.   #     user  : 特技的使用者 (battler)
  223.   #     skill : 特技
  224.   #--------------------------------------------------------------------------
  225.   def skill_effect(user, skill)
  226.     #######伤害开关初始化##################################################bearrpg
  227.     $damage_hp = false
  228.     $damage_sp = false
  229.     # 清除会心一击标志
  230.     self.critical = false
  231.     # 特技的效果范围是 HP 1 以上的己方、自己的 HP 为 0、
  232.     # 或者特技的效果范围是 HP 0 的己方、自己的 HP 为 1 以上的情况下
  233.     if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or
  234.        ((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)
  235.       # 过程结束
  236.       return false
  237.     end
  238.     # 清除有效标志
  239.     effective = false
  240.     # 公共事件 ID 是有效的情况下,设置为有效标志
  241.     effective |= skill.common_event_id > 0
  242.     # 第一命中判定
  243.     hit = skill.hit
  244.     if skill.atk_f > 0
  245.       hit *= user.hit / 100
  246.     end
  247.     hit_result = (rand(100) < hit)
  248.     # 不确定的特技的情况下设置为有效标志
  249.     effective |= hit < 100
  250.     # 命中的情况下
  251.     if hit_result == true
  252.       # 计算威力
  253.       power = skill.power + user.atk * skill.atk_f / 100
  254.       if power > 0
  255.         power -= self.pdef * skill.pdef_f / 200
  256.         power -= self.mdef * skill.mdef_f / 200
  257.         power = [power, 0].max
  258.       end
  259.       # 计算倍率
  260.       rate = 20
  261.       rate += (user.str * skill.str_f / 100)
  262.       rate += (user.dex * skill.dex_f / 100)
  263.       rate += (user.agi * skill.agi_f / 100)
  264.       rate += (user.int * skill.int_f / 100)
  265.       # 计算基本伤害
  266.       self.damage = power * rate / 20
  267.       # 属性修正
  268.       self.damage *= elements_correct(skill.element_set)
  269.       self.damage /= 100
  270.       # 伤害符号正确的情况下
  271.       if self.damage > 0
  272.         # 防御修正
  273.         if self.guarding?
  274.           self.damage /= 2
  275.         end
  276.       end
  277.       # 分散
  278.       if skill.variance > 0 and self.damage.abs > 0
  279.         amp = [self.damage.abs * skill.variance / 100, 1].max
  280.         self.damage += rand(amp+1) + rand(amp+1) - amp
  281.       end
  282.       # 第二命中判定
  283.       eva = 8 * self.agi / user.dex + self.eva
  284.       hit = self.damage < 0 ? 100 : 100 - eva * skill.eva_f / 100
  285.       hit = self.cant_evade? ? 100 : hit
  286.       hit_result = (rand(100) < hit)
  287.       # 不确定的特技的情况下设置为有效标志
  288.       effective |= hit < 100
  289.     end
  290.     $damage_hp = true if self.damage.is_a?(Numeric)
  291.    # $damage_sp = true if self.damage_sp != 0 SP伤害数值开关
  292.     # 命中的情况下
  293.     if hit_result == true
  294.       # 威力 0 以外的物理攻击的情况下
  295.       if skill.power != 0 and skill.atk_f > 0
  296.         # 状态冲击解除
  297.         remove_states_shock
  298.         # 设置有效标志
  299.         effective = true
  300.       end
  301.       # HP 的伤害减法运算
  302.       last_hp = self.hp
  303.       self.hp -= self.damage
  304.       effective |= self.hp != last_hp
  305.       # 状态变化
  306.       @state_changed = false
  307.       effective |= states_plus(skill.plus_state_set)
  308.       effective |= states_minus(skill.minus_state_set)
  309.       #############################################bearrpg
  310.       # 威力为 0 的场合
  311.       if skill.power == 0
  312.         # 伤害设置为空的字串
  313.         self.damage = ""
  314.         # 状态没有变化的情况下
  315.         unless @state_changed
  316.           # 伤害设置为 "Miss"
  317.           self.damage = "Miss"
  318.         end
  319.       elsif self.damage == 0
  320.         unless @state_changed
  321.            self.damage = "无效" if INVALIDSWITCH >0
  322.          else
  323.           self.damage = ""
  324.         end
  325.       end
  326.     # Miss 的情况下
  327.     else
  328.       # 伤害设置为 "Miss"
  329.       self.damage = "Miss"
  330.     end
  331.     # 不在战斗中的情况下
  332.     unless $game_temp.in_battle
  333.       # 伤害设置为 nil
  334.       self.damage = nil
  335.     end
  336.     # 过程结束
  337.     return effective
  338.   end
  339.   #############################################bearrpg
  340.   #--------------------------------------------------------------------------
  341.   # ● 应用物品效果
  342.   #     item : 物品
  343.   #--------------------------------------------------------------------------
  344.   def item_effect(item)
  345.     # 清除会心一击标志
  346.     self.critical = false
  347.     # 物品的效果范围是 HP 1 以上的己方、自己的 HP 为 0、
  348.     # 或者物品的效果范围是 HP 0 的己方、自己的 HP 为 1 以上的情况下
  349.     if ((item.scope == 3 or item.scope == 4) and self.hp == 0) or
  350.        ((item.scope == 5 or item.scope == 6) and self.hp >= 1)
  351.       # 过程结束
  352.       return false
  353.     end
  354.     # 清除有效标志
  355.     effective = false
  356.     # 公共事件 ID 是有效的情况下,设置为有效标志
  357.     effective |= item.common_event_id > 0
  358.     # 命中判定
  359.     hit_result = (rand(100) < item.hit)
  360.     # 不确定的特技的情况下设置为有效标志
  361.     effective |= item.hit < 100
  362.     # 命中的情况
  363.     if hit_result == true
  364.       # 计算回复量
  365.       recover_hp = maxhp * item.recover_hp_rate / 100 + item.recover_hp
  366.       recover_sp = maxsp * item.recover_sp_rate / 100 + item.recover_sp
  367.       if recover_hp < 0
  368.         recover_hp += self.pdef * item.pdef_f / 20
  369.         recover_hp += self.mdef * item.mdef_f / 20
  370.         recover_hp = [recover_hp, 0].min
  371.       end
  372.       # 属性修正
  373.       recover_hp *= elements_correct(item.element_set)
  374.       recover_hp /= 100
  375.       recover_sp *= elements_correct(item.element_set)
  376.       recover_sp /= 100
  377.       # 分散
  378.       if item.variance > 0 and recover_hp.abs > 0
  379.         amp = [recover_hp.abs * item.variance / 100, 1].max
  380.         recover_hp += rand(amp+1) + rand(amp+1) - amp
  381.       end
  382.       if item.variance > 0 and recover_sp.abs > 0
  383.         amp = [recover_sp.abs * item.variance / 100, 1].max
  384.         recover_sp += rand(amp+1) + rand(amp+1) - amp
  385.       end
  386.       # 回复量符号为负的情况下
  387.       if recover_hp < 0
  388.         # 防御修正
  389.         if self.guarding?
  390.           recover_hp /= 2
  391.         end
  392.       end
  393.       # HP 回复量符号的反转、设置伤害值
  394.       self.damage = -recover_hp
  395.       self.damage_sp = -recover_sp  
  396.       # HP 以及 SP 的回复
  397.       last_hp = self.hp
  398.       last_sp = self.sp
  399.       self.hp += recover_hp
  400.       self.sp += recover_sp
  401.       ###################################################################bearrpg
  402.       $damage_hp = true if self.damage.is_a?(Numeric)
  403.       $damage_sp = true if self.damage_sp.is_a?(Numeric) and recover_sp != 0
  404.       ###################################################################bearrpg
  405.       effective |= self.hp != last_hp
  406.       effective |= self.sp != last_sp
  407.       # 状态变化
  408.       @state_changed = false
  409.       effective |= states_plus(item.plus_state_set)
  410.       effective |= states_minus(item.minus_state_set)
  411.       # 能力上升值有效的情况下
  412.       if item.parameter_type > 0 and item.parameter_points != 0
  413.         # 能力值的分支
  414.         case item.parameter_type
  415.         when 1  # MaxHP
  416.           @maxhp_plus += item.parameter_points
  417.         when 2  # MaxSP
  418.           @maxsp_plus += item.parameter_points
  419.         when 3  # 力量
  420.           @str_plus += item.parameter_points
  421.         when 4  # 灵巧
  422.           @dex_plus += item.parameter_points
  423.         when 5  # 速度
  424.           @agi_plus += item.parameter_points
  425.         when 6  # 魔力
  426.           @int_plus += item.parameter_points
  427.         end
  428.         # 设置有效标志
  429.         effective = true
  430.       end
  431.       # HP 回复率与回复量为 0 的情况下
  432.       if item.recover_hp_rate == 0 and item.recover_hp == 0
  433.         # 设置伤害为空的字符串
  434.         self.damage = ""
  435.         # SP 回复率与回复量为 0、能力上升值无效的情况下
  436.         if item.recover_sp_rate == 0 and item.recover_sp == 0 and
  437.            (item.parameter_type == 0 or item.parameter_points == 0)
  438.           # 状态没有变化的情况下
  439.           unless @state_changed
  440.             # 伤害设置为 "Miss"
  441.             self.damage = "Miss"
  442.           end
  443.         end
  444.       end
  445.     # Miss 的情况下
  446.     else
  447.       # 伤害设置为 "Miss"
  448.       self.damage = "Miss"
  449.     end
  450.     # 不在战斗中的情况下
  451.     unless $game_temp.in_battle
  452.       # 伤害设置为 nil
  453.       self.damage = nil
  454.     end
  455.     # 过程结束
  456.     return effective
  457.   end
  458. end

  459. class Game_Actor
  460.   def screen_x
  461.     if self.index != nil
  462.       return (640-self.index*50)/2 + 240 + @movex
  463.     else
  464.       return 0
  465.     end
  466.   end
  467.   def screen_y
  468.     return self.index*70+self.height/2 + 55 + @movey #(320-self.index*91+self.height)/2 + 100 + @movey
  469.   end
  470.   def screen_z
  471.     return self.screen_y-self.index * 10
  472.   end
  473. end
  474. class Game_Enemy
  475.   def screen_x
  476.     return $data_troops[@troop_id].members[@member_index].x + @movex
  477.   end
  478.   def screen_y
  479.     return $data_troops[@troop_id].members[@member_index].y + @movey
  480.   end
  481.   def screen_z
  482.     return self.screen_y#+self.height
  483.   end
  484. end

  485. class Sprite_Battler
  486.   include Scene_BattleName
  487. end
  488. module RPG
  489. class Sprite < ::Sprite
  490. #==========================================
  491. def initialize(viewport = nil)
  492. super(viewport)
  493. @_whiten_duration = 0
  494. @_appear_duration = 0
  495. @_escape_duration = 0
  496. @_collapse_duration = 0
  497. @_damage_duration = 0
  498. @_animation_duration = 0
  499. @_blink = false  
  500. @flash_shake = 0
  501. @_damage = []  
  502. @_damage_sp = []
  503. @_total_damage = 0
  504. @_total_damage_duration = 0
  505. @p_dam=0
  506. @hits=0
  507. end
  508. def animation_set_sprites(sprites, cell_data, position)
  509.    for i in 0..15
  510.    sprite = sprites[i]
  511.    pattern = cell_data[i, 0]
  512.    if sprite == nil or pattern == nil or pattern == -1
  513.      sprite.visible = false if sprite != nil
  514.      next
  515.    end
  516.    sprite.visible = true
  517.    sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
  518.    if position == 3
  519.      if self.viewport != nil
  520.        sprite.x = self.viewport.rect.width / 2
  521.        sprite.y = self.viewport.rect.height - 160
  522.      else
  523.        sprite.x = 320
  524.        sprite.y = 240
  525.      end
  526.      else
  527.      sprite.x = self.x - self.ox + self.src_rect.width / 2
  528.      sprite.y = self.y - self.oy + self.src_rect.height / 2
  529.      sprite.y -= self.src_rect.height / 4 if position == 0
  530.      sprite.y += self.src_rect.height / 4 if position == 2
  531.    end
  532.    sprite.x += cell_data[i, 1]
  533.    sprite.y += cell_data[i, 2]
  534.    if $scene.is_a?(Scene_Battle)
  535.    sprite.z = battler.screen_z+20
  536. else
  537.    sprite.z = 9990
  538.    end
  539.    sprite.ox = 96
  540.    sprite.oy = 96
  541.    sprite.zoom_x = cell_data[i, 3] / 100.0
  542.    sprite.zoom_y = cell_data[i, 3] / 100.0
  543.    sprite.angle = cell_data[i, 4]
  544.    sprite.mirror = (cell_data[i, 5] == 1)
  545.    sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
  546.    sprite.blend_type = cell_data[i, 7]
  547.    end
  548. end
  549. def damage(value, critical)
  550.   dispose_hit
  551.     if value.is_a?(Numeric)
  552.       damage_string = value.abs.to_s
  553.     else
  554.       damage_string = value.to_s
  555.     end
  556.     bitmap = Bitmap.new(300, 150)
  557.     bitmap.font.name = ["黑体","华文行楷", "宋体"]
  558.     bitmap.font.size = 32
  559.     if value.is_a?(Numeric)
  560.   # 分割伤害值字符串
  561.       damage_array = damage_string.scan(/./)
  562.       damage_x = 81 - damage_string.size * 9
  563.   # 会心一击标志打开的情况
  564.       if critical and value != "无效"
  565.   # 显示会心一击图画
  566.         cri_bitmap = RPG::Cache.picture("Critital")
  567.         bitmap.blt(damage_x+cri_bitmap.width, cri_bitmap.height*2, cri_bitmap, Rect.new(0, 0, cri_bitmap.width, cri_bitmap.height))
  568.         Audio.se_play("Audio/SE/"+CRIVOICE,100,100) if CRIVOICE != nil and CRIVOICE != ""
  569.         $game_screen.start_flash(Color.new(255, 5, 5, 155), 5) if CRIFLASH >0
  570.         $game_screen.start_shake(2,9,3) if CRISHAKE >0
  571.       end
  572.   # 伤害值为负的情况下
  573.     dmg_bitmap = RPG::Cache.picture("Normal_Damage")
  574.       if value < 0
  575.   # 调用回复数字表
  576.         bitmap.blt(damage_x-14, 32,dmg_bitmap,Rect.new(dmg_bitmap.width/12*10, 0, dmg_bitmap.width/12, dmg_bitmap.height/2))
  577.       else
  578.   # 调用伤害数字表
  579.         bitmap.blt(damage_x-14, 32, dmg_bitmap,Rect.new(dmg_bitmap.width/12*11, 0, dmg_bitmap.width/12, dmg_bitmap.height/2))
  580.       end
  581.   # 循环伤害值字符串
  582.       for char in damage_array
  583.         number = char.to_i
  584.   # 显示伤害数字
  585.         bitmap.blt(damage_x, 32, dmg_bitmap,
  586.         Rect.new(number * dmg_bitmap.width/12, 0, dmg_bitmap.width/12, dmg_bitmap.height/2))
  587. #################################################################普通伤害数值
  588.         damage_x += dmg_bitmap.width/12 - 4#间距缩小4个像素,可以自行调整
  589. #################################################################普通伤害数值
  590.       end  
  591.     else
  592.       if value == "Miss"
  593.         miss_dmg = RPG::Cache.picture("miss")
  594.         bitmap.blt(miss_dmg.width, 0,miss_dmg, Rect.new(0, 0, miss_dmg.width, miss_dmg.height))
  595.       elsif value == "无效"
  596.         invalid_dmg = RPG::Cache.picture("invalid")
  597.         bitmap.blt(invalid_dmg.width, 0,invalid_dmg, Rect.new(0, 0, invalid_dmg.width,invalid_dmg.height))
  598.       #end
  599.       end
  600.     end
  601. # 伤害值定位
  602.     @_damage_sprite = ::Sprite.new(self.viewport)
  603.     @_damage_sprite.bitmap = bitmap
  604.     @_damage_sprite.ox = 80
  605.     @_damage_sprite.oy = 20
  606.     @_damage_sprite.x = self.x
  607.     @_damage_sprite.y = self.y - self.oy / 2
  608.     @_damage_sprite.z = 3000
  609.     @_damage_duration = 40
  610.     @_damage.push([@_damage_sprite,@_damage_duration-10,0, rand(30) - 15, rand(3)])
  611.     make_total_damage(value)
  612.   end
  613. ##################################################################sp伤害数值
  614. def damage_sp(value, critical)
  615.   dispose_hit
  616.     if value.is_a?(Numeric)
  617.       damage_string = value.abs.to_s
  618.     else
  619.       damage_string = value.to_s
  620.     end
  621.     bitmap = Bitmap.new(300, 150)
  622.     bitmap.font.name = ["黑体","华文行楷", "宋体"]
  623.     bitmap.font.size = 32
  624.     if value.is_a?(Numeric)
  625.   # 分割伤害值字符串
  626.       damage_array = damage_string.scan(/./)
  627.       damage_x = 81 - damage_string.size * 9
  628.   # 会心一击标志打开的情况
  629.       if critical and value != "无效"
  630.   # 显示会心一击图画
  631.         cri_bitmap = RPG::Cache.picture("Critital")
  632.         bitmap.blt(damage_x+cri_bitmap.width, cri_bitmap.height*2, cri_bitmap, Rect.new(0, 0, cri_bitmap.width, cri_bitmap.height))
  633.         Audio.se_play("Audio/SE/"+CRIVOICE,100,100) if CRIVOICE != nil and CRIVOICE != ""
  634.         $game_screen.start_flash(Color.new(255, 5, 5, 155), 5) if CRIFLASH >0
  635.         $game_screen.start_shake(2,9,3) if CRISHAKE >0
  636.       end
  637.   # 伤害值为负的情况下
  638.     dmg_bitmap = RPG::Cache.picture("Normal_Damage")
  639.       if value < 0
  640.   # 调用回复数字表
  641.         bitmap.blt(damage_x-14, 32,dmg_bitmap,Rect.new(dmg_bitmap.width/12*10, dmg_bitmap.height/2, dmg_bitmap.width/12, dmg_bitmap.height/2))
  642.       else
  643.   # 调用伤害数字表
  644.         bitmap.blt(damage_x-14, 32, dmg_bitmap,Rect.new(dmg_bitmap.width/12*11, dmg_bitmap.height/2, dmg_bitmap.width/12, dmg_bitmap.height/2))
  645.       end
  646.   # 循环伤害值字符串
  647.       for char in damage_array
  648.         number = char.to_i
  649.   # 显示伤害数字
  650.         bitmap.blt(damage_x, 32, dmg_bitmap,
  651.         Rect.new(number * dmg_bitmap.width/12, dmg_bitmap.height/2, dmg_bitmap.width/12, dmg_bitmap.height/2))
  652. #################################################################普通伤害数值
  653.         damage_x += dmg_bitmap.width/12 - 4#间距缩小4个像素,可以自行调整
  654. #################################################################普通伤害数值
  655.       end  
  656.     else
  657.       if value == "Miss"
  658.         miss_dmg = RPG::Cache.picture("miss")
  659.         bitmap.blt(miss_dmg.width, 0,miss_dmg, Rect.new(0, 0, miss_dmg.width, miss_dmg.height))
  660.       elsif value == "无效"
  661.         invalid_dmg = RPG::Cache.picture("invalid")
  662.         bitmap.blt(invalid_dmg.width, 0,invalid_dmg, Rect.new(0, 0, invalid_dmg.width,invalid_dmg.height))
  663.       #end
  664.       end
  665.     end
  666. # 伤害值定位
  667.     @_damage_sprite = ::Sprite.new(self.viewport)
  668.     @_damage_sprite.bitmap = bitmap
  669.     @_damage_sprite.ox = 80
  670.     @_damage_sprite.oy = 20
  671.     @_damage_sprite.x = self.x
  672.     @_damage_sprite.y = self.y - self.oy / 2
  673.     @_damage_sprite.z = 3000
  674.     @_damage_duration = 40
  675.     @_damage_sp.push([@_damage_sprite,@_damage_duration-10,0, rand(30) - 15, rand(3)])
  676.    # make_total_damage(value)
  677.   end  
  678. def hit
  679. # 如果伤害值是数值
  680. # 转为字符串
  681. value=@hits
  682. hits_string = value.to_s
  683. # 初始化位图
  684. bitmap = Bitmap.new(320, 64)
  685. bitmap.font.name = "Arial Black"
  686. bitmap.font.size = 32
  687. # 分割伤害值字符串
  688. hits_array = hits_string.scan(/./)
  689. hits_x = 81 - hits_string.size * 18.1
  690. rect_y = 0
  691. # 循环伤害值字符串
  692. for char in hits_array
  693. number = char.to_i
  694. # 显示伤害数字
  695. combo_num = RPG::Cache.picture("combo_num")
  696. bitmap.blt(hits_x, 0, combo_num,
  697. Rect.new(number * combo_num.width/10, 0, combo_num.width/10, combo_num.height))
  698. #################################################################连击数数值
  699. hits_x += combo_num.width/10 - 3#间距缩小3个像素,可以自行调整
  700. #################################################################连击数数值
  701. end
  702. combo_tx = RPG::Cache.picture("combo_text")
  703. bitmap.blt(hits_x, 0,combo_tx ,
  704. Rect.new(0, 0, combo_tx.width, combo_tx.height))
  705. # 伤害值定位
  706. @_hits_sprite = ::Sprite.new(self.viewport)
  707. @_hits_sprite.bitmap = bitmap
  708. @_hits_sprite.ox = 81
  709. @_hits_sprite.oy = 20
  710. @_hits_sprite.x = 500
  711. @_hits_sprite.y = 100
  712. @_hits_sprite.opacity = HITSWITCH > 0 ? 255 : 0
  713. @_hits_sprite.z = 3000
  714. @_hits_duration = 40
  715. end
  716. #--------------------------------------------------------------------------
  717. # ● 总伤害处理
  718. #--------------------------------------------------------------------------
  719. def make_total_damage(value)
  720. if value.is_a?(Numeric) and SHOW_TOTAL_DAMAGE > 0
  721. @_total_damage += value
  722. # 绝对值转为字符串
  723. damage_string = @_total_damage.abs.to_s
  724. else
  725. return
  726. end
  727. # 初始化位图
  728. bitmap = Bitmap.new(350, 150)
  729. bitmap.font.name = "Arial Black"
  730. bitmap.font.size = 32
  731. # 伤害值是数值的情况下
  732. if value.is_a?(Numeric)
  733. # 分割伤害值字符串
  734. damage_array = damage_string.scan(/./)
  735. damage_x = 40 - damage_string.size * 9
  736. # 伤害值为负的情况下
  737. name=RPG::Cache.picture("total_damage")
  738. # 循环伤害值字符串
  739. for char in damage_array
  740. number = char.to_i
  741. # 显示伤害数字
  742. bitmap.blt(damage_x, 0, name,
  743. Rect.new(number * name.width/10, 0, name.width/10, name.height))
  744. #################################################################总伤害数值
  745. damage_x += name.width/10 - 3 #间距缩小3个像素,可以自行调整
  746. #################################################################总伤害数值
  747. end
  748. end
  749. if @_total_damage_sprite.nil?
  750. @_total_damage_sprite = ::Sprite.new(self.viewport)
  751. @_total_damage_sprite.ox = 80
  752. @_total_damage_sprite.oy = 40
  753. @_total_damage_sprite.z = 3000
  754. end
  755. @_total_damage_sprite.bitmap = bitmap
  756. @_total_damage_sprite.zoom_x = 1.0
  757. @_total_damage_sprite.zoom_y = 1.0
  758. @_total_damage_sprite.x = self.x
  759. @_total_damage_sprite.y = self.y - self.oy / 2
  760. @_total_damage_sprite.z = 3001
  761. @_total_damage_duration = 80
  762. #hit数描绘
  763. @hits+=1
  764. if @_total_damage > 0
  765.   hit
  766. end
  767. end
  768. def animation(animation, hit, battler_damage="", battler_damage_sp="",battler_critical=false)
  769. dispose_animation
  770. @battler_damage = battler_damage
  771. @battler_damage_sp = battler_damage_sp
  772. @battler_critical = battler_critical
  773. @_animation = animation
  774. return if @_animation == nil
  775. @_animation_hit = hit
  776. @_animation_duration = @_animation.frame_max
  777. animation_name = @_animation.animation_name
  778. animation_hue = @_animation.animation_hue
  779. bitmap = RPG::Cache.animation(animation_name, animation_hue)
  780. for timing in @_animation.timings
  781. quanzhong = animation_process_timing(timing, @_animation_hit,true)
  782. @all_quanzhong += quanzhong
  783. @_last_frame = timing.frame if quanzhong != 0
  784. end
  785. if @@_reference_count.include?(bitmap)
  786. @@_reference_count[bitmap] += 1
  787. else
  788. @@_reference_count[bitmap] = 1
  789. end  
  790. if $scene.is_a?(Scene_Battle)
  791. if $scene.animation1_id == @battler.animation_id
  792. @battler_damage = ""
  793. @battler_damage_sp = ""
  794. end
  795. end
  796. @_animation_sprites = []
  797. if @_animation.position != 3 or not @@_animations.include?(animation)
  798. for i in 0..15
  799. sprite = ::Sprite.new(self.viewport)
  800. sprite.bitmap = bitmap
  801. sprite.visible = false
  802. @_animation_sprites.push(sprite)
  803. end
  804. unless @@_animations.include?(animation)
  805. @@_animations.push(animation)
  806. end
  807. end
  808. update_animation
  809. end  
  810. def dispose_damage
  811. for damage in @_damage.reverse
  812. damage[0].bitmap.dispose
  813. damage[0].dispose
  814. @_damage.delete(damage)
  815. end
  816. for damage_sp in @_damage_sp.reverse
  817. damage_sp[0].bitmap.dispose
  818. damage_sp[0].dispose
  819. @_damage_sp.delete(damage_sp)
  820. end
  821. @_total_damage = 0
  822. @_last_frame = -1
  823. if @_total_damage_sprite != nil
  824. @_total_damage_duration = 0
  825. @_total_damage_sprite.bitmap.dispose
  826. @_total_damage_sprite.dispose
  827. @_total_damage_sprite = nil
  828. end
  829. end
  830. def dispose_hit
  831. if @_hits_sprite != nil
  832. @_hits_sprite.bitmap.dispose
  833. @_hits_sprite.dispose
  834. @_hits_sprite = nil
  835. end
  836. end
  837. def dispose_animation
  838. @battler_damage = nil
  839. @battler_damage_sp = nil
  840. @battler_critical = nil
  841. @all_quanzhong = 1
  842. @_total_damage = 0
  843. @_last_frame = -1
  844. if @_animation_sprites != nil
  845. sprite = @_animation_sprites[0]
  846. if sprite != nil
  847. @@_reference_count[sprite.bitmap] -= 1
  848. if @@_reference_count[sprite.bitmap] == 0
  849. sprite.bitmap.dispose
  850. end
  851. end
  852. for sprite in @_animation_sprites
  853. sprite.dispose
  854. end
  855. @_animation_sprites = nil
  856. @_animation = nil
  857. end
  858. end
  859. def update
  860. super
  861. if @_whiten_duration > 0
  862. @_whiten_duration -= 1
  863. self.color.alpha = 128 - (16 - @_whiten_duration) * 10
  864. end
  865. if @_appear_duration > 0
  866. @_appear_duration -= 1
  867. self.opacity = (16 - @_appear_duration) * 16
  868. end
  869. if @_escape_duration > 0
  870. @_escape_duration -= 1
  871. self.opacity = 256 - (32 - @_escape_duration) * 10
  872. end
  873. if @_collapse_duration > 0
  874. @_collapse_duration -= 1
  875. self.opacity = 256 - (48 - @_collapse_duration) * 6
  876. end
  877. if @_damage_duration > 0
  878. @_damage_duration -= 1
  879. for damage in @_damage
  880. damage[0].x = self.x + self.viewport.rect.x -
  881. self.ox + self.src_rect.width / 2 +
  882. (40 - damage[1]) * damage[3] / 10
  883. damage[0].y -= damage[4]+damage[1]/10
  884. damage[0].opacity = damage[1]*20
  885. damage[1] -= 1
  886. if damage[1]==0
  887. damage[0].bitmap.dispose
  888. damage[0].dispose
  889. @_damage.delete(damage)
  890. next
  891. end
  892. end
  893. for damage_sp in @_damage_sp
  894. damage_sp[0].x = self.x + self.viewport.rect.x -
  895. self.ox + self.src_rect.width / 2 +
  896. (40 - damage_sp[1]) * damage_sp[3] / 10
  897. damage_sp[0].y -= damage_sp[4]+damage_sp[1]/10
  898. damage_sp[0].opacity = damage_sp[1]*20
  899. damage_sp[1] -= 1
  900. if damage_sp[1]==0
  901. damage_sp[0].bitmap.dispose
  902. damage_sp[0].dispose
  903. @_damage_sp.delete(damage_sp)
  904. next
  905. end
  906. end
  907. end
  908. if @_total_damage_duration > 0
  909. @_total_damage_duration -= 1
  910. @_total_damage_sprite.y -= 1 if @_total_damage_duration % 2 == 0
  911. if @_total_damage_sprite.zoom_x > 1.0
  912. @_total_damage_sprite.zoom_x -= 0.05
  913. end
  914. if @_total_damage_sprite.zoom_y > 1.0
  915. @_total_damage_sprite.zoom_y -= 0.05
  916. end
  917. @_total_damage_sprite.opacity = 256 - (24 - @_total_damage_duration) * 16
  918. if @_total_damage_duration <= 0
  919. dispose_hit
  920. @_total_damage = 0
  921. @_total_damage_duration = 0
  922. @_total_damage_sprite.bitmap.dispose
  923. @_total_damage_sprite.dispose
  924. @_total_damage_sprite = nil
  925. end
  926. end
  927. #=======================================
  928.     if @_animation != nil and (Graphics.frame_count % 2 == 0)
  929.       @_animation_duration -= 1
  930.       update_animation
  931.     end
  932.   if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
  933.       update_loop_animation
  934.       @_loop_animation_index += 1
  935.       @_loop_animation_index %= @_loop_animation.frame_max
  936.     end
  937.   if @_blink
  938.     @_blink_count = (@_blink_count + 1) % 32
  939.       if @_blink_count < 16
  940.         alpha = (16 - @_blink_count) * 6
  941.       else
  942.         alpha = (@_blink_count - 16) * 6
  943.       end
  944.       self.color.set(255, 255, 255, alpha)
  945.     end
  946.     @@_animations.clear
  947.   end
  948. def update_animation
  949.   if @_animation_duration > 0
  950.     frame_index = @_animation.frame_max - @_animation_duration
  951.     cell_data = @_animation.frames[frame_index].cell_data
  952.     position = @_animation.position
  953.     animation_set_sprites(@_animation_sprites, cell_data, position)
  954.       for timing in @_animation.timings
  955.         if timing.frame == frame_index
  956.           t = 1.0 * animation_process_timing(timing, @_animation_hit)
  957.           ts = 1.0 * animation_process_timing(timing, @_animation_hit)
  958.           if timing.se.name != ""
  959.             se=timing.se
  960.             Audio.se_play("Audio/SE/" + se.name, se.volume, se.pitch)
  961.           end
  962.           if @battler_damage.is_a?(Numeric) and t != 0
  963.             if @battler.guarding?
  964.               @battler.startactive = "防御" if @battler_damage > 0
  965.            else
  966.               @battler.startactive = "受伤" if @battler_damage > 0
  967.             end
  968.             t *= @battler_damage
  969.             t /= @all_quanzhong
  970.             ts *= @battler_damage_sp
  971.             ts /= @all_quanzhong
  972.             t = t.to_i
  973.             ts = ts.to_i
  974.   if frame_index != @_last_frame
  975.     @p_dam+= t
  976.   end
  977.       if frame_index == @_last_frame
  978.         t=@battler_damage-@p_dam
  979.       end
  980.     if frame_index == @_last_frame
  981.       @_total_damage = @battler_damage - t
  982.       @p_dam=0
  983.     end
  984.       damage(t,@battler_critical) if $damage_hp == true
  985.       damage_sp(ts,@battler_critical) if $damage_sp == true
  986.     if frame_index == @_last_frame
  987.       @hits=0
  988.      end
  989.       elsif !@battler_damage.is_a?(Numeric) and timing.flash_scope != 0
  990.         damage(@battler_damage,@battler_critical)
  991.         damage_sp(@battler_damage_sp,@battler_critical) if $damage_sp == true
  992.        end
  993.       end
  994.       end
  995.     else
  996.       dispose_animation
  997.     end
  998.   end
  999. def animation_process_timing(timing, hit,dontflash=false)
  1000.   if (timing.condition == 0) or
  1001.     (timing.condition == 1 and hit == true) or
  1002.     (timing.condition == 2 and hit == false)
  1003.   case timing.flash_scope
  1004.     when 1
  1005.       unless dontflash
  1006.         self.flash(timing.flash_color, timing.flash_duration * 2)
  1007.         if @_total_damage >0
  1008.           @flash_shake_switch = true
  1009.           @flash_shake = 10
  1010.         end
  1011.       end
  1012.       return timing.flash_color.alpha * timing.flash_duration
  1013.     when 2
  1014.       unless dontflash
  1015.         if self.viewport != nil
  1016.           self.viewport.flash(timing.flash_color, timing.flash_duration * 2)
  1017.         end
  1018.       end
  1019.       return timing.flash_color.alpha * timing.flash_duration
  1020.     when 3
  1021.       unless dontflash
  1022.         self.flash(nil, timing.flash_duration * 2)
  1023.       end
  1024.         return timing.flash_color.alpha * timing.flash_duration
  1025.       end
  1026.     end
  1027.       return 0
  1028.     end
  1029.   end
  1030. end

  1031. class Sprite_Battler < RPG::Sprite
  1032.   def initialize(viewport, battler = nil)
  1033.     super(viewport)
  1034.     @battler = battler
  1035.     @battler_visible = false
  1036.     @flash_shake_switch = true
  1037.     @number = 0#初始化编号
  1038.   end
  1039.   def update
  1040.     super
  1041.     # 战斗者为 nil 的情况下
  1042.     if @battler == nil
  1043.       self.bitmap = nil
  1044.       loop_animation(nil)
  1045.       return
  1046.     end
  1047.     # 文件名和色相与当前情况有差异的情况下
  1048.     if @battler.battler_name != @battler_name or
  1049.        @battler.battler_hue != @battler_hue
  1050.       # 获取、设置位图
  1051.       @battler_name = @battler.battler_name
  1052.       @battler_hue = @battler.battler_hue
  1053.       self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  1054.       @width = bitmap.width
  1055.       @height = bitmap.height
  1056.       self.ox = @width / 2
  1057.       self.oy = @height
  1058.       # 如果是战斗不能或者是隐藏状态就把透明度设置成 0
  1059.       if @battler.dead? or @battler.hidden
  1060.         self.opacity = 0  if DEADPIC != 1
  1061.       end
  1062.     end
  1063.     ###################################万兽熊最高#########################################
  1064.         if @battler.startactive == "移动" or @battler.startactive == "返回"
  1065.       if Graphics.frame_count % 4 == 0
  1066.         unless BattlerName[@battler.name].nil?
  1067.           @number = (@number + 1) % BattlerName[@battler.name][@battler.startactive].size
  1068.           self.bitmap = RPG::Cache.battler(BattlerName[@battler.name][@battler.startactive][@number], @battler_hue)
  1069.         end
  1070.       end
  1071.     elsif @battler.startactive == "死亡"
  1072.        if Graphics.frame_count % 4 == 0
  1073.         unless BattlerName[@battler.name].nil?
  1074.           if @number +1 <= BattlerName[@battler.name][@battler.startactive].size
  1075.           self.bitmap = RPG::Cache.battler(BattlerName[@battler.name][@battler.startactive][@number], @battler_hue)
  1076.           @number += 1
  1077.         else
  1078.           self.bitmap = RPG::Cache.battler(BattlerName[@battler.name][@battler.startactive][BattlerName[@battler.name][@battler.startactive].size-1], @battler_hue)
  1079.           end
  1080.         end
  1081.       end
  1082.       else
  1083.       if Graphics.frame_count % 10 == 0
  1084.         unless BattlerName[@battler.name].nil?
  1085.           @number = (@number + 1) % BattlerName[@battler.name][@battler.startactive].size
  1086.           self.bitmap = RPG::Cache.battler(BattlerName[@battler.name][@battler.startactive][@number], @battler_hue)
  1087.         end
  1088.       end
  1089.     end
  1090.     #######################################################################################
  1091.     # 动画 ID 与当前的情况有差异的情况下
  1092.     if @battler.damage == nil and
  1093.        @battler.state_animation_id != @state_animation_id
  1094.       @state_animation_id = @battler.state_animation_id
  1095.       loop_animation($data_animations[@state_animation_id])
  1096.     end
  1097.     # 应该被显示的角色的情况下
  1098.    if NACTSWITCH > 0
  1099.     if @battler.is_a?(Game_Actor) and @battler_visible
  1100.       # 不是主状态的时候稍稍降低点透明度
  1101.       if $game_temp.battle_main_phase
  1102.         self.opacity += 3 if self.opacity < 255
  1103.       else
  1104.         self.opacity -= 3 if self.opacity > 207
  1105.       end
  1106.     end
  1107.   end
  1108.     if @battler.blink
  1109.       blink_on
  1110.     else
  1111.       blink_off
  1112.     end
  1113.     unless @battler_visible
  1114.       if not @battler.hidden and not @battler.dead? and
  1115.          (@battler.damage == nil or @battler.damage_pop)
  1116.         appear
  1117.         @battler_visible = true
  1118.       end
  1119.     end
  1120.     if @battler_visible
  1121.       if @battler.hidden
  1122.         $game_system.se_play($data_system.escape_se)
  1123.         escape
  1124.         @battler_visible = false
  1125.       end
  1126.       if @battler.white_flash
  1127.         whiten
  1128.         @battler.white_flash = false   
  1129.       end
  1130.         if @battler.animation_id != 0
  1131.         animation = $data_animations[@battler.animation_id]
  1132.         animation(animation, @battler.animation_hit,@battler.damage,@battler.damage_sp, @battler.critical)
  1133.         @battler.animation_id = 0
  1134.       end
  1135.       if @battler.damage_pop
  1136.         @battler.damage = nil
  1137.         @battler.damage_sp = 0
  1138.         @battler.critical = false
  1139.         @battler.damage_pop = false
  1140.       end
  1141.       if @battler.damage == nil and @battler.dead?
  1142.         if DEADPIC >0
  1143.           @battler.startactive = "死亡"
  1144.           else
  1145.         if @battler.is_a?(Game_Enemy)
  1146.           $game_system.se_play($data_system.enemy_collapse_se)
  1147.         else
  1148.           $game_system.se_play($data_system.actor_collapse_se)
  1149.         end
  1150.         collapse
  1151.         @battler_visible = false
  1152.         end
  1153.       end
  1154.     end
  1155.      self.x = @battler.screen_x
  1156.      self.y = @battler.screen_y
  1157.      self.z = @battler.screen_z
  1158.   end
  1159. end

  1160. class Spriteset_Battle
  1161. alias bearrpg_initialize initialize
  1162.   def initialize
  1163.     @enemy_sprites = []
  1164.     for enemy in $game_troop.enemies.reverse
  1165.       #####修改敌人显示端口,与角色一样。
  1166.       @enemy_sprites.push(Sprite_Battler.new(@viewport2, enemy))
  1167.     end
  1168.     bearrpg_initialize
  1169.   end
  1170. end

  1171. class Arrow_Enemy < Arrow_Base
  1172.   def update
  1173.     super
  1174.     $game_troop.enemies.size.times do
  1175.       break if self.enemy.exist?
  1176.       @index += 1
  1177.       @index %= $game_troop.enemies.size
  1178.     end
  1179.     if Input.repeat?(Input::UP)
  1180.       $game_system.se_play($data_system.cursor_se)
  1181.       $game_troop.enemies.size.times do
  1182.         @index += 1
  1183.         @index %= $game_troop.enemies.size
  1184.         break if self.enemy.exist?
  1185.       end
  1186.     end
  1187.     if Input.repeat?(Input::DOWN)
  1188.       $game_system.se_play($data_system.cursor_se)
  1189.       $game_troop.enemies.size.times do
  1190.         @index += $game_troop.enemies.size - 1
  1191.         @index %= $game_troop.enemies.size
  1192.         break if self.enemy.exist?
  1193.       end
  1194.     end
  1195.     if self.enemy != nil
  1196.       self.x = self.enemy.screen_x
  1197.       self.y = self.enemy.screen_y
  1198.     end
  1199.   end
  1200. end

  1201. class Arrow_Actor < Arrow_Base
  1202.   def update
  1203.     super
  1204.     if Input.repeat?(Input::UP)
  1205.       $game_system.se_play($data_system.cursor_se)
  1206.       @index += 1
  1207.       @index %= $game_party.actors.size
  1208.     end
  1209.     if Input.repeat?(Input::DOWN)
  1210.       $game_system.se_play($data_system.cursor_se)
  1211.       @index += $game_party.actors.size - 1
  1212.       @index %= $game_party.actors.size
  1213.     end
  1214.     if self.actor != nil
  1215.       self.x = self.actor.screen_x
  1216.       self.y = self.actor.screen_y
  1217.     end
  1218.   end
  1219. end

  1220. class Scene_Battle
  1221. include Scene_BattleName
  1222. attr_reader :animation1_id
  1223.   def main
  1224.     $game_temp.in_battle = true
  1225.     $game_temp.battle_turn = 0
  1226.     $game_temp.battle_event_flags.clear
  1227.     $game_temp.battle_abort = false
  1228.     $game_temp.battle_main_phase = false
  1229.     $game_temp.battleback_name = $game_map.battleback_name
  1230.     $game_temp.forcing_battler = nil
  1231.     @_move_duration = 0
  1232.     $game_system.battle_interpreter.setup(nil, 0)
  1233.     @troop_id = $game_temp.battle_troop_id
  1234.     $game_troop.setup(@troop_id)
  1235.     s1 = $data_system.words.attack
  1236.     s2 = $data_system.words.skill
  1237.     s3 = $data_system.words.guard
  1238.     s4 = $data_system.words.item
  1239.     @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
  1240.     @actor_command_window.z = 900
  1241.     @actor_command_window.y = 160
  1242.     @actor_command_window.back_opacity = 160
  1243.     @actor_command_window.active = false
  1244.     @actor_command_window.visible = false
  1245.     @party_command_window = Window_PartyCommand.new
  1246.     @party_command_window.z = 910
  1247.     @help_window = Window_Help.new
  1248.     @help_window.back_opacity = 160
  1249.     @help_window.z = 920
  1250.     @help_window.visible = false
  1251.     @status_window = Window_BattleStatus.new
  1252.     @status_window.z = 930
  1253.     @message_window = Window_Message.new
  1254.     @message_window.z = 940
  1255.     @spriteset = Spriteset_Battle.new
  1256.     @wait_count = 0
  1257.     if $data_system.battle_transition == ""
  1258.       Graphics.transition(20)
  1259.     else
  1260.       Graphics.transition(40, "Graphics/Transitions/" +
  1261.         $data_system.battle_transition)
  1262.     end
  1263.     start_phase1
  1264.     loop do
  1265.       Graphics.update
  1266.       Input.update
  1267.       update
  1268.       if $scene != self
  1269.         break
  1270.       end
  1271.     end
  1272.     $game_map.refresh
  1273.     Graphics.freeze
  1274.     @actor_command_window.dispose
  1275.     @party_command_window.dispose
  1276.     @help_window.dispose
  1277.     @status_window.dispose
  1278.     @message_window.dispose
  1279.     if @skill_window != nil
  1280.       @skill_window.dispose
  1281.     end
  1282.     if @item_window != nil
  1283.       @item_window.dispose
  1284.     end
  1285.     if @result_window != nil
  1286.       @result_window.dispose
  1287.     end
  1288.     @spriteset.dispose
  1289.     if $scene.is_a?(Scene_Title)
  1290.       Graphics.transition
  1291.       Graphics.freeze
  1292.     end
  1293.     if $BTEST and not $scene.is_a?(Scene_Gameover)
  1294.       $scene = nil
  1295.     end
  1296.   end
  1297.   def start_phase1
  1298.     # 转移到回合 1
  1299.     @phase = 1
  1300.     # 清除全体同伴的行动
  1301.     $game_party.clear_actions
  1302.     for actor in $game_party.actors
  1303.      actor.startactive = actor.hp>0? "待机" : "死亡"
  1304.     end
  1305.     # 设置战斗事件
  1306.     setup_battle_event
  1307.   end
  1308.   alias bearrpg_start_phase5 start_phase5
  1309. def start_phase5
  1310.    bearrpg_start_phase5
  1311.     @result_window.z = 999
  1312.     @phase5_wait_count = 100
  1313.   end
  1314.   def start_enemy_select
  1315.     @enemy_arrow = Arrow_Enemy.new(@spriteset.viewport2)
  1316.     @enemy_arrow.help_window = @help_window
  1317.     @actor_command_window.active = false
  1318.     @actor_command_window.visible = false
  1319.   end
  1320.   alias bearrpg_start_skill_select start_skill_select
  1321.    def start_skill_select
  1322.       bearrpg_start_skill_select
  1323.       @skill_window.z = 999
  1324.     end
  1325.    alias bearrpg_start_item_select start_item_select
  1326.     def start_item_select
  1327.       bearrpg_start_item_select
  1328.       @item_window.z = 999
  1329.     end
  1330.   def move(active_battler, target, ox, oy, 返回标记 = false)
  1331.     ta_x = target[0]
  1332.     ta_y = target[1]
  1333.     if 返回标记
  1334.       active_battler.movex = (active_battler.movex * (@_move_duration - 1) + ta_x.to_f - ox) / @_move_duration
  1335.       active_battler.movey = (active_battler.movey * (@_move_duration - 1) + ta_y.to_f - oy) / @_move_duration
  1336.     else
  1337.       if @active_battler.is_a?(Game_Enemy)
  1338.         active_battler.movex = (active_battler.movex * (@_move_duration - 1) + ta_x.to_f - ox ) / @_move_duration
  1339.         active_battler.movey = (active_battler.movey * (@_move_duration - 1) + ta_y.to_f - oy ) / @_move_duration
  1340.       else
  1341.         active_battler.movex =  (active_battler.movex * (@_move_duration - 1) + ta_x.to_f - ox ) / @_move_duration
  1342.         active_battler.movey = (active_battler.movey * (@_move_duration - 1) + ta_y.to_f - oy ) / @_move_duration
  1343.       end
  1344.     end
  1345.   end
  1346.   def update_phase4_step3
  1347.     ####普通攻击的场合############################################################
  1348.     if @active_battler.current_action.basic == 0 and
  1349.       @active_battler.current_action.kind == 0
  1350.       #开始执行移动
  1351.      if not @active_battler.element_rate(UNMOVE)>100# 如果属性“不移动”不大于100
  1352.         @active_battler.startactive = "移动"
  1353.         @oldxy = [@active_battler.screen_x,@active_battler.screen_y]
  1354.         ox,oy = @active_battler.screen_x,@active_battler.screen_y
  1355.       if @active_battler.element_rate(HOMOVE)>100# 如果属性“半距离”大于100
  1356.         @_move_duration = Move_Duration/2
  1357.        while @_move_duration > 0
  1358.         Graphics.update
  1359.         Input.update
  1360.         @spriteset.update
  1361.         if @target_battlers[0].is_a?(Game_Actor)
  1362.         tag = [@target_battlers[0].screen_x-@target_battlers[0].width-(@target_battlers[0].screen_x-ox).abs/2.abs,@target_battlers[0].screen_y+1]
  1363.         else
  1364.         tag = [(@target_battlers[0].screen_x+@target_battlers[0].width/1.5)+(@target_battlers[0].screen_x-ox).abs/2,@target_battlers[0].screen_y+2]
  1365.         end
  1366.         move(@active_battler, tag, ox, oy)
  1367.         @_move_duration -= 1
  1368.       end
  1369.     else
  1370.       @_move_duration = Move_Duration
  1371.         while @_move_duration > 0
  1372.         Graphics.update
  1373.         Input.update
  1374.         @spriteset.update
  1375.         if @target_battlers[0].is_a?(Game_Actor)
  1376.         tag = [@target_battlers[0].screen_x-@target_battlers[0].width/2,@target_battlers[0].screen_y+1]
  1377.         else
  1378.         tag = [@target_battlers[0].screen_x+@target_battlers[0].width/1.5,@target_battlers[0].screen_y+2]
  1379.         end
  1380.         move(@active_battler, tag, ox, oy)
  1381.         @_move_duration -= 1
  1382.       end
  1383.       end
  1384.     end
  1385.    ####普通攻击的场合############################################################
  1386.     elsif @active_battler.current_action.kind == 1
  1387.     ####使用特技的场合############################################################
  1388.       if not @skill.element_set.include?(UNMOVE)# 如果技能不包含“不移动属性”
  1389.         @active_battler.startactive = "移动"
  1390.         @oldxy = [@active_battler.screen_x,@active_battler.screen_y]
  1391.         ox,oy = @active_battler.screen_x,@active_battler.screen_y
  1392.       if @skill.element_set.include?(HOMOVE)#如果技能不包含“半距离”属性
  1393.         @_move_duration = Move_Duration/2
  1394.        while @_move_duration > 0
  1395.         Graphics.update
  1396.         Input.update
  1397.         @spriteset.update
  1398.         if @target_battlers[0].is_a?(Game_Actor)
  1399.         tag = [@target_battlers[0].screen_x-@target_battlers[0].width-(@target_battlers[0].screen_x-ox).abs/2.abs,@target_battlers[0].screen_y+1]
  1400.         else
  1401.         tag = [(@target_battlers[0].screen_x+@target_battlers[0].width/1.5)+(@target_battlers[0].screen_x-ox).abs/2,@target_battlers[0].screen_y+2]
  1402.         end
  1403.         move(@active_battler, tag, ox, oy)
  1404.         @_move_duration -= 1
  1405.       end
  1406.     else
  1407.       @_move_duration = Move_Duration
  1408.         while @_move_duration > 0
  1409.         Graphics.update
  1410.         Input.update
  1411.         @spriteset.update
  1412.         if @target_battlers[0].is_a?(Game_Actor)
  1413.         tag = [@target_battlers[0].screen_x-@target_battlers[0].width,@target_battlers[0].screen_y+1]
  1414.         else
  1415.         tag = [@target_battlers[0].screen_x+@target_battlers[0].width/1.5,@target_battlers[0].screen_y+2]
  1416.         end
  1417.         move(@active_battler, tag, ox, oy)
  1418.         @_move_duration -= 1
  1419.       end
  1420.       end
  1421.     end
  1422.    #####使用特技的场合##############################################################
  1423. end
  1424. if @active_battler.startactive != "防御"
  1425.     @active_battler.startactive = "待机"
  1426.    end
  1427.     # 行动方动画 (ID 为 0 的情况下是白色闪烁)
  1428.     if @animation1_id == 0
  1429.       @active_battler.white_flash = true
  1430.     else
  1431.       @active_battler.animation_id = @animation1_id
  1432.       @active_battler.animation_hit = true
  1433.     end
  1434.     for target in @target_battlers
  1435.       if target.guarding? and target.damage.is_a?(Numeric)
  1436.         target.startactive = "防御" if target.damage > 0
  1437.         end
  1438.       target.animation_id = @animation2_id
  1439.       target.animation_hit = (target.damage != "Miss")
  1440.     end
  1441.     # 移至步骤 4
  1442.     @phase4_step = 4
  1443.   end
  1444.   ##############################################################################
  1445.   def update_phase4_step4
  1446.    ###########################万兽熊最高########################################
  1447.     # 对像方动画
  1448.      for target in @target_battlers
  1449.        if target.damage != nil
  1450.          target.damage_pop = true
  1451.        end
  1452.      end
  1453.     # 限制动画长度、最低 8 帧
  1454.   #  @wait_count = 8
  1455.   ##############################################################################
  1456.     # 移至步骤 5
  1457.     @phase4_step = 5
  1458.   end
  1459. ####################万兽熊最高############################
  1460.   def update_phase4_step5
  1461.     # 隐藏帮助窗口
  1462.     @help_window.visible = false
  1463.     if @active_battler.current_action.basic == 0 and
  1464.       @active_battler.current_action.kind == 0
  1465.    ####普通攻击的场合############################################################   
  1466.       #执行返回
  1467.     if not @active_battler.element_rate(UNMOVE)>100# 如果属性“不移动”不大于100
  1468.       @active_battler.startactive = "返回"
  1469.       if @active_battler.element_rate(HOMOVE)>100# 如果属性“半距离”大于100
  1470.       @_move_duration = Move_Duration/2
  1471.       else
  1472.       @_move_duration = Move_Duration   
  1473.       end
  1474.       ox,oy = @active_battler.screen_x - @active_battler.movex,\
  1475.       @active_battler.screen_y - @active_battler.movey
  1476.       while @_move_duration > 0
  1477.         Graphics.update
  1478.         Input.update
  1479.         @spriteset.update
  1480.         move(@active_battler, @oldxy, ox, oy, true)
  1481.         @_move_duration -= 1
  1482.       end
  1483.     end
  1484.    ####普通攻击的场合############################################################
  1485.     elsif @active_battler.current_action.kind == 1
  1486.       if not @skill.element_set.include?(UNMOVE)#如果技能不包含“不移动”属性
  1487.       @active_battler.startactive = "返回"
  1488.       if @skill.element_set.include?(HOMOVE)#如果技能包含“半距离”属性
  1489.       @_move_duration = Move_Duration/2
  1490.       else
  1491.       @_move_duration = Move_Duration   
  1492.       end
  1493.       ox,oy = @active_battler.screen_x - @active_battler.movex,\
  1494.       @active_battler.screen_y - @active_battler.movey
  1495.       while @_move_duration > 0
  1496.         Graphics.update
  1497.         Input.update
  1498.         @spriteset.update
  1499.         move(@active_battler, @oldxy, ox, oy, true)
  1500.         @_move_duration -= 1
  1501.       end
  1502.     end
  1503.    ####使用特技的场合############################################################
  1504. end
  1505. if @active_battler.startactive != "防御"
  1506.     @active_battler.startactive = "待机"
  1507.    end
  1508.     # 刷新状态窗口
  1509.     @status_window.refresh
  1510.     # 显示伤害
  1511.     for target in @target_battlers
  1512.       target.startactive = "待机"
  1513.       if target.damage != nil
  1514.         target.damage_pop = true
  1515.       end
  1516.     end
  1517.     # 移至步骤 6
  1518.     @phase4_step = 6
  1519.   end
  1520.   def update_phase4_step6
  1521.     # 清除强制行动对像的战斗者
  1522.     $game_temp.forcing_battler = nil
  1523.     @active_battler.movex = 0
  1524.     @active_battler.movey = 0
  1525.     @active_battler.startactive = "待机" if @active_battler.startactive != "死亡"
  1526.     # 公共事件 ID 有效的情况下
  1527.     if @common_event_id > 0
  1528.       # 设置事件
  1529.       common_event = $data_common_events[@common_event_id]
  1530.       $game_system.battle_interpreter.setup(common_event.list, 0)
  1531.     end
  1532.     # 移至步骤 1
  1533.     @phase4_step = 1
  1534.   end
  1535. end

  1536. -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

  1537. 這是我原本用的:


  1538. module Sword
  1539. #=======================================
  1540. #★ 魔劍工舖 - 跟隨型說明窗口(2)
  1541. # [url]http://blog.yam.com/a870053jjkj/article/26694783[/url]
  1542. #=======================================
  1543. =begin
  1544. ● 所需腳本
  1545. 魔劍工舖整合腳本:[url]http://blog.yam.com/a870053jjkj/article/25751998[/url]
  1546. 控制碼轉換:[url]http://blog.yam.com/a870053jjkj/article/28082241[/url]
  1547. ========================================
  1548. ● 控制碼(可以使用「控制碼轉換」中的控制碼,並且本腳本在新增以下控制碼)
  1549. \! : 該行控制碼之後內容為'0'、'0%'或沒內容時(換行為結尾),就清除該行
  1550. =end
  1551. #=======================================
  1552. #● 功能設定
  1553. S8_Width = 240 # 設定幫助窗口的寬度,當內容顯示不下也依此設置自動換行
  1554. S8_XY = [30, 20] # 可以對跟隨窗口的 [X座標, Y座標] 進行些微調整
  1555. #--------------------------------------------------------------
  1556. #○ 幫助窗口顯示突破的處理設定
  1557. #設置法1:S8_Location = 數值(數值選擇以下這些各有功能)
  1558. #(0直接超出;1底部為限;2頂部為限;3底部移動;4頂部移動;5一律居中)
  1559. #設置法2:S8_Location = [X座標, Y座標](自行指定顯示的位置)
  1560. S8_Location =1
  1561. #--------------------------------------------------------------
  1562. #○ 幫助窗口格式設定
  1563. # 技能-------------------------------------------------------
  1564. S8_Skill = '\FS[20]\C[6]\DA[name]\C[0]\FS[18]
  1565. \DA[description]
  1566. \C[192,224,255]威力:\C[0]\!\DA[power]
  1567. \C[192,224,255]命中率:\C[0]\!\DA[hit]
  1568. \C[192,224,255]攻擊力:\C[0]\!\DA[atk_f]%
  1569. \C[192,224,255]力量:\C[0]\!\DA[str_f]%
  1570. \C[192,244,255]靈巧:\C[0]\!\DA[dex_f]%
  1571. \C[192,244,255]速度:\C[0]\!\DA[agi_f]%
  1572. \C[192,224,255]迴避:\C[0]\!\DA[eva_f]%
  1573. \C[192,224,255]屬性:\!\EF
  1574. \C[192,224,255]狀態:\!\SS'
  1575. # 物品-------------------------------------------------------
  1576. S8_Item = '\FS[20]\C[6]\DA[name]\C[0]\FS[18]
  1577. \DA[description]
  1578. \C[192,224,255]使用目標:\C[0]\SC[\DA[scope]]
  1579. \C[192,224,255]\TY[\DA[parameter_type]]\C[0]+\!\DA[parameter_points]
  1580. \C[192,224,255]HP恢復率:\C[50]\!\DA[recover_hp_rate]%
  1581. \C[192,224,255]HP恢復量:\C[0]\!\DA[recover_hp]
  1582. \C[192,224,255]SP恢復率:\C[0]\!\DA[recover_sp_rate]%
  1583. \C[192,224,255]SP恢復量:\C[0]\!\DA[recover_sp]
  1584. \C[192,244,255]命中率:\C[0]\!\DA[hit]%
  1585. \C[192,224,255]屬性:\!\EF
  1586. \C[192,224,255]狀態:\!\SS
  1587. \C[192,224,255]販賣價格:\C[0]\!\DA[price]'
  1588. # 武器-------------------------------------------------------
  1589. S8_Weapon = '\FS[20]\C[6]\DA[name]\C[0]\FS[18]
  1590. \DA[description]
  1591. \C[192,224,255]攻擊力:\C[100]\!\DA[atk]
  1592. \C[192,224,255]物理防禦:\C[0]\!\DA[pdef]
  1593. \C[192,224,255]魔法防禦:\C[0]\!\DA[mdef]
  1594. \C[192,224,255]力量:\C[0]\!\DA[str_plus]
  1595. \C[192,244,255]靈巧:\C[0]\!\DA[dex_plus]
  1596. \C[192,244,255]速度:\C[0]\!\DA[agi_plus]
  1597. \C[192,244,255]魔力:\C[0]\!\DA[int_plus]
  1598. \C[192,224,255]屬性:\!\EF
  1599. \C[192,224,255]狀態:\!\SS
  1600. \C[192,224,255]販賣價格:\C[1000]\!\DA[price]'
  1601. # 防具-------------------------------------------------------
  1602. S8_Armor = '\FS[20]\C[6]\DA[name]\C[0]\FS[18]
  1603. \DA[description]
  1604. \C[192,224,255]附加狀態:\C[0]\!\TN[\DA[auto_state_id]]
  1605. \C[192,224,255]物理防禦:\C[0]\!\DA[pdef]
  1606. \C[192,224,255]魔法防禦:\C[0]\!\DA[mdef]
  1607. \C[192,224,255]力量:\C[0]\!\DA[str_plus]
  1608. \C[192,244,255]靈巧:\C[0]\!\DA[dex_plus]
  1609. \C[192,244,255]速度:\C[0]\!\DA[agi_plus]
  1610. \C[192,244,255]魔力:\C[0]\!\DA[int_plus]
  1611. \C[192,224,255]迴避:\C[0]\!\DA[eva]%
  1612. \C[192,224,255]屬性免疫:\!\EF
  1613. \C[192,224,255]狀態免疫:\!\SS
  1614. \C[192,224,255]販賣價格:\C[0]\!\DA[price]'
  1615. #=======================================
  1616. #● 追加設定
  1617. # S8_Complete
  1618. #=======================================
  1619.   BEGIN{$Sword ? $Sword[8] = 2 : $Sword = {8=>2}} # 腳本使用標誌
  1620.   ($Sword_VX = defined?(RPG::Weather) ? false : true) if $Sword_VX.nil?
  1621.   S8_Complete = $Sword[59] ? S59_Complete : false unless defined?(S8_Complete)
  1622.   $Sword_F12_Error = {} unless $Sword_F12_Error # F12除錯標誌
  1623. end
  1624. #=======================================
  1625. #■ 小型幫助窗口
  1626. class WSword_Help < Window_Base
  1627.   attr_writer(:top_row) # 開頭行數
  1628.   attr_writer(:visible2) # 第2隱藏標誌
  1629.   attr_writer(:use_text) # 設定採用的描繪內容
  1630.   #-------------------------------------------------------------
  1631.   #● 初始化物件(關連被顯示窗口, 資料)
  1632.   def initialize(corelation, data)
  1633.     @setting_wsword = Window_Base.new(0, 0, Sword::S8_Width, 33)
  1634.     super(0, 0, 640, 480) ; self.contents = Bitmap.new(width - 32, height - 32)
  1635.     self.opacity = 0 ; self.z = 155
  1636.     @setting_wsword.z = 150 ; @setting_wsword.opacity = 150
  1637.     @me_index = -1 # 儲存上次的位置
  1638.     @corelation = corelation # 關連被顯示窗口
  1639.     @visible2, @contrast = true, data.id
  1640.     refresh(data)
  1641.   end
  1642.   #-------------------------------------------------------------
  1643.   #● 更新內容(資料)
  1644.   def refresh(data)
  1645.     return unless data
  1646.     if @use_text then text = @use_text # 採用其它
  1647.     else
  1648.       case data # 資料類型
  1649.       when RPG::Skill ; text = Sword::S8_Skill.clone # 技能
  1650.       when RPG::Item ; text = Sword::S8_Item.clone # 物品
  1651.       when RPG::Weapon ; text = Sword::S8_Weapon.clone # 武器
  1652.       when RPG::Armor ; text = Sword::S8_Armor.clone # 防具
  1653.       end
  1654.     end
  1655.     $game_system.swordM_data = data # 對象資料
  1656.     text = text.code_explain
  1657.     text_array = text.split(/\n/) # 依照換行分解,確認每行底部內容之用
  1658.     text = ''
  1659.     text_array.each{|item| next if /\\\!0?%?\Z/ === item ; text += item + "\n"}
  1660.     text.gsub!(/\\\!/){''} # 清空無用的\!控制碼
  1661.     contents.clear
  1662.     contents.blt(0, 0, text.bitmap_explain(Sword::S8_Width, 300){},
  1663.     Rect.new(0, 0, Sword::S8_Width, 300))
  1664.     @setting_wsword.height = $Sword46[0][1] - 24
  1665.     place
  1666.   end
  1667.   #-------------------------------------------------------------
  1668.   #● 更新窗口位置
  1669.   def place
  1670.     if Sword::S8_Complete
  1671.       coord = Mouse.coord ; self.x, self.y = coord[0], coord[1]
  1672.     else
  1673.       self.x = @corelation.x + @corelation.cursor_rect.x + 16 + Sword::S8_XY[0]
  1674.       self.y = @corelation.y + @corelation.cursor_rect.y + 16 + Sword::S8_XY[1]
  1675.     end
  1676.     if XPVX.height < @setting_wsword.y + @setting_wsword.height
  1677.       case Sword::S8_Location
  1678.       when Array # 指定座標
  1679.         @setting_wsword.x = Sword::S8_Location[0]
  1680.         @setting_wsword.y = Sword::S8_Location[1]
  1681.         self.x = Sword::S8_Location[0] - 12 ; self.y = Sword::S8_Location[1] - 12
  1682.       when 1 # 底部為限
  1683.         @setting_wsword.y = XPVX.height - @setting_wsword.height
  1684.         self.y = @setting_wsword.y - 12
  1685.       when 2 # 頂部為限
  1686.         @setting_wsword.y = 0 ; self.y = 12
  1687.       when 3 # 底部移動
  1688.         @setting_wsword.y += @setting_wsword.height
  1689.         self.y += @setting_wsword.height
  1690.       when 4 # 頂部移動
  1691.         @setting_wsword.y -= @setting_wsword.height
  1692.         self.y -= @setting_wsword.height
  1693.       when 5 # 一律居中
  1694.         @setting_wsword.x = (XPVX.width - @setting_wsword.width) / 2
  1695.         @setting_wsword.y = (XPVX.height - @setting_wsword.height) / 2
  1696.         self.x = @setting_wsword.x - 12 ; self.y = @setting_wsword.y - 12
  1697.       end
  1698.     end
  1699.     #(self.x += 2 ; self.y += 2 ; @setting_wsword.height += 2) if Sword8_XPVX # VX顯示修正
  1700.   end
  1701.   #-------------------------------------------------------------
  1702.   #● 變更X座標
  1703.   def x=(x) ; @setting_wsword.x = x + 12 ; super ; end
  1704.   #-------------------------------------------------------------
  1705.   #● 變更Y座標
  1706.   def y=(y) ; @setting_wsword.y = y + 12 ; super ; end
  1707.   #-------------------------------------------------------------
  1708.   #● 釋放窗口
  1709.   def dispose ; @setting_wsword.dispose ; super ; end
  1710.   #-------------------------------------------------------------
  1711.   #● 隱藏窗口(隱藏標誌)
  1712.   def visible=(s) ; @setting_wsword.visible = s ; super ; end
  1713.   #-------------------------------------------------------------
  1714.   #● 更新窗口(索引, 對象, 強制更新標誌)
  1715.   def update(index, data, force = false)
  1716.     self.visible = data ? @visible2 : false  # 如果沒有資料就隱藏窗口
  1717.     place
  1718.     return if @me_index == index && @contrast == data.id or ! data unless force
  1719.     @me_index, @contrast = index, data.id ; refresh(data)
  1720.   end
  1721. end
  1722. #=======================================
  1723. #■ 物品窗口
  1724. class Window_Item
  1725.   #-------------------------------------------------------------
  1726.   #● 初始化物件
  1727.   alias sword8_initialize initialize
  1728.   def initialize(*args)
  1729.     $Sword_VX ? sword8_initialize(*args) : sword8_initialize
  1730.     @help_wsword = WSword_Help.new(self, item)
  1731.     @help_wsword.visible = false if $Sword_VX && $scene.is_a?(Scene_Equip)
  1732.   end
  1733.   #-------------------------------------------------------------
  1734.   #● 更新窗口
  1735.   alias sword8_update update unless $Sword_F12_Error[8]
  1736.   def update
  1737.     sword8_update
  1738.     @help_wsword.top_row = top_row
  1739.     @help_wsword.update(index, item)
  1740.   end
  1741.   #-------------------------------------------------------------
  1742.   #● 釋放窗口
  1743.   alias sword8_dispose dispose unless $Sword_F12_Error[8]
  1744.   def dispose
  1745.     sword8_dispose ; @help_wsword.dispose
  1746.   end
  1747.   #-------------------------------------------------------------
  1748.   #● 窗口顯示狀態=(顯示標誌)
  1749.   alias sword8_visible= visible= unless $Sword_F12_Error[8]
  1750.   def visible=(visible)
  1751.     @help_wsword.visible = @help_wsword.visible2 = visible
  1752.     self.sword8_visible = visible
  1753.   end
  1754.   #-------------------------------------------------------------
  1755.   #● 裝備壞面一開始隱藏跟隨型說明窗口
  1756.   if $Sword_VX
  1757.     def sword8_no_visible
  1758.       @help_wsword.visible = false
  1759.     end
  1760.   end
  1761. end
  1762. #=======================================
  1763. #■ 技能窗口
  1764. class Window_Skill
  1765.   #-------------------------------------------------------------
  1766.   #● 初始化物件(角色編號)
  1767.   alias sword8_initialize initialize
  1768.   def initialize(*args)
  1769.     $Sword_VX ? sword8_initialize(*args) : sword8_initialize(*args)
  1770.     @help_wsword = WSword_Help.new(self, skill)
  1771.   end
  1772.   #-------------------------------------------------------------
  1773.   #● 更新窗口
  1774.   alias sword8_update update unless $Sword_F12_Error[8]
  1775.   def update
  1776.     sword8_update
  1777.     @help_wsword.top_row = top_row
  1778.     @help_wsword.update(index, skill)
  1779.   end
  1780.   #-------------------------------------------------------------
  1781.   #● 釋放窗口
  1782.   alias sword8_dispose dispose unless $Sword_F12_Error[8]
  1783.   def dispose
  1784.     sword8_dispose ; @help_wsword.dispose
  1785.   end
  1786.   #-------------------------------------------------------------
  1787.   #● 窗口顯示狀態=(顯示標誌)
  1788.   alias sword8_visible= visible= unless $Sword_F12_Error[8]
  1789.   def visible=(visible)
  1790.     @help_wsword.visible = @help_wsword.visible2 = visible
  1791.     self.sword8_visible = visible
  1792.   end
  1793. end
  1794. #=======================================
  1795. #■ 購買窗口
  1796. class Window_ShopBuy
  1797.   #-------------------------------------------------------------
  1798.   #● 初始化物件(商品資料)
  1799.   alias sword8_initialize initialize
  1800.   def initialize(*args)
  1801.     sword8_initialize(*args)
  1802.     @help_wsword = WSword_Help.new(self, item)
  1803.   end
  1804.   #-------------------------------------------------------------
  1805.   #● 更新窗口
  1806.   alias sword8_update update unless $Sword_F12_Error[8]
  1807.   def update
  1808.     sword8_update
  1809.     @help_wsword.top_row = top_row
  1810.     @help_wsword.update(index, item)
  1811.   end
  1812.   #-------------------------------------------------------------
  1813.   #● 釋放窗口
  1814.   alias sword8_dispose dispose unless $Sword_F12_Error[8]
  1815.   def dispose
  1816.     sword8_dispose ; @help_wsword.dispose
  1817.   end
  1818.   #-------------------------------------------------------------
  1819.   #● 窗口顯示狀態=(顯示標誌)
  1820.   alias sword8_visible= visible= unless $Sword_F12_Error[8]
  1821.   def visible=(visible)
  1822.     @help_wsword.visible = @help_wsword.visible2 = visible
  1823.     self.sword8_visible = visible
  1824.   end
  1825. end
  1826. #=======================================
  1827. #■ 販賣窗口
  1828. unless $Sword_VX
  1829. class Window_ShopSell
  1830.   #-------------------------------------------------------------
  1831.   #● 初始化物件
  1832.   alias sword8_initialize initialize
  1833.   def initialize
  1834.     sword8_initialize
  1835.     @help_wsword = WSword_Help.new(self, item)
  1836.   end
  1837.   #-------------------------------------------------------------
  1838.   #● 更新窗口
  1839.   alias sword8_update update unless $Sword_F12_Error[8]
  1840.   def update
  1841.     sword8_update
  1842.     @help_wsword.top_row = top_row
  1843.     @help_wsword.update(index, item)
  1844.   end
  1845.   #-------------------------------------------------------------
  1846.   #● 釋放窗口
  1847.   alias sword8_dispose dispose unless $Sword_F12_Error[8]
  1848.   def dispose
  1849.     sword8_dispose ; @help_wsword.dispose
  1850.   end
  1851.   #-------------------------------------------------------------
  1852.   #● 窗口顯示狀態=(顯示標誌)
  1853.   alias sword8_visible= visible= unless $Sword_F12_Error[8]
  1854.   def visible=(visible)
  1855.     @help_wsword.visible = @help_wsword.visible2 = visible
  1856.     self.sword8_visible = visible
  1857.   end
  1858. end end
  1859. #=======================================
  1860. #■ 目前裝備窗口
  1861. eval("
  1862. class #{$Sword_VX ? 'Window_Equip' : 'Window_EquipRight'}
  1863.   #-------------------------------------------------------------
  1864.   #● 初始化物件(角色)
  1865.   alias sword8_initialize initialize
  1866.   def initialize(*args)
  1867.     sword8_initialize(*args)
  1868.     @help_wsword = WSword_Help.new(self, item)
  1869.   end
  1870.   #-------------------------------------------------------------
  1871.   #● 更新窗口
  1872.   alias sword8_update update unless $Sword_F12_Error[8]
  1873.   def update
  1874.     sword8_update
  1875.     @help_wsword.top_row = top_row
  1876.     @help_wsword.update(index, item)
  1877.   end
  1878.   #-------------------------------------------------------------
  1879.   #● 釋放窗口
  1880.   alias sword8_dispose dispose unless $Sword_F12_Error[8]
  1881.   def dispose
  1882.     sword8_dispose ; @help_wsword.dispose
  1883.   end
  1884.   #-------------------------------------------------------------
  1885.   #● 窗口顯示狀態=(顯示標誌)
  1886.   alias sword8_visible= visible= unless $Sword_F12_Error[8]
  1887.   def visible=(visible)
  1888.     @help_wsword.visible = @help_wsword.visible2 = visible
  1889.     self.sword8_visible = visible
  1890.   end
  1891. end")
  1892. #=======================================
  1893. #■ 選擇裝備窗口
  1894. unless $Sword_VX
  1895. class Window_EquipItem
  1896.   #-------------------------------------------------------------
  1897.   #● 初始化物件(角色, 裝備部位)
  1898.   alias sword8_initialize initialize
  1899.   def initialize(*args)
  1900.     sword8_initialize(*args)
  1901.     @help_wsword = WSword_Help.new(self, item)
  1902.     @help_wsword.visible = false
  1903.   end
  1904.   #-------------------------------------------------------------
  1905.   #● 更新窗口
  1906.   alias sword8_update update unless $Sword_F12_Error[8]
  1907.   def update
  1908.     sword8_update
  1909.     @help_wsword.top_row = top_row
  1910.     @help_wsword.update(index, item)
  1911.   end
  1912.   #-------------------------------------------------------------
  1913.   #● 釋放窗口
  1914.   alias sword8_dispose dispose unless $Sword_F12_Error[8]
  1915.   def dispose
  1916.     sword8_dispose ; @help_wsword.dispose
  1917.   end
  1918.   #-------------------------------------------------------------
  1919.   #● 窗口顯示狀態=(顯示標誌)
  1920.   alias sword8_visible= visible= unless $Sword_F12_Error[8]
  1921.   def visible=(visible)
  1922.     @help_wsword.visible = @help_wsword.visible2 = visible if active and item
  1923.     self.sword8_visible = visible
  1924.   end
  1925. end end
  1926. #=======================================
  1927. #■ 裝備畫面
  1928. if $Sword_VX
  1929. class Scene_Equip
  1930.   #---------------------------------------------------------------
  1931.   #● 創建可裝備窗口
  1932.   alias sword8_create_item_windows create_item_windows
  1933.   def create_item_windows
  1934.     sword8_create_item_windows
  1935.     (0...EQUIP_TYPE_MAX).each{|i| @item_windows[i].sword8_no_visible}
  1936.   end
  1937. end end
  1938. $Sword_F12_Error[8] = true
复制代码


-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
但都會被橫版那個腳本影響...技能說明窗口被技能欄覆蓋...請前輩大大幫忙,拜託!!

問題3.png

問題3-2.png
梦石
0
星屑
251
在线时间
252 小时
注册时间
2013-11-9
回帖
88
发表于 2016-11-22 22:39:18 | 显示全部楼层
本帖最后由 泪的苍白 于 2016-11-22 22:41 编辑

会出现这种情况不是因为不共存,而是技能说明窗口的Z值太小了,导致窗口被盖住了。(Z值大的窗口显示在上面。)
你在你使用的帮助窗口(或者在脚本里搜Window_Help)
在
  1. class Window_Help < Window_Base
  2. #--------------------------------------------------------------------------
  3.   # ● 初始化对像
  4.   #--------------------------------------------------------------------------
  5.   def initialize
  6. super(x, x, x, x)
复制代码
的下面插一句self.z = 99990
这样应该可以了- -
另外:下次提问的时候记得把帮助脚本也一起贴上来><~那样别人才能更快地帮助你。

点评

能帮上忙就好XD  发表于 2016-11-26 11:17
大大有了,在我用個幫助窗口的第98行有個self.z = 155 我改成99990就好了,謝謝你,太感恩了  发表于 2016-11-24 21:26
头像来自百度搜索,自改了一(小)部分。
回复

使用道具 举报

梦石
0
星屑
65
在线时间
141 小时
注册时间
2012-4-29
回帖
32
 楼主| 发表于 2016-11-23 23:36:12 | 显示全部楼层
泪的苍白 发表于 2016-11-22 22:39
会出现这种情况不是因为不共存,而是技能说明窗口的Z值太小了,导致窗口被盖住了。(Z值大的窗口显示在上面 ...

大大,我到我的幫助窗口腳本裡搜尋,找不到你說的那一段耶...

這是我用的幫助窗口:

  1. module Sword
  2. #=======================================
  3. #★ 魔劍工舖 - 跟隨型說明窗口(2)
  4. # http://blog.yam.com/a870053jjkj/article/26694783
  5. #=======================================
  6. =begin
  7. ● 所需腳本
  8. 魔劍工舖整合腳本:http://blog.yam.com/a870053jjkj/article/25751998
  9. 控制碼轉換:http://blog.yam.com/a870053jjkj/article/28082241
  10. ========================================
  11. ● 控制碼(可以使用「控制碼轉換」中的控制碼,並且本腳本在新增以下控制碼)
  12. \! : 該行控制碼之後內容為'0'、'0%'或沒內容時(換行為結尾),就清除該行
  13. =end
  14. #=======================================
  15. #● 功能設定
  16. S8_Width = 240 # 設定幫助窗口的寬度,當內容顯示不下也依此設置自動換行
  17. S8_XY = [30, 20] # 可以對跟隨窗口的 [X座標, Y座標] 進行些微調整
  18. #--------------------------------------------------------------
  19. #○ 幫助窗口顯示突破的處理設定
  20. #設置法1:S8_Location = 數值(數值選擇以下這些各有功能)
  21. #(0直接超出;1底部為限;2頂部為限;3底部移動;4頂部移動;5一律居中)
  22. #設置法2:S8_Location = [X座標, Y座標](自行指定顯示的位置)
  23. S8_Location = 1
  24. #--------------------------------------------------------------
  25. #○ 幫助窗口格式設定
  26. # 技能-------------------------------------------------------
  27. S8_Skill = '\FS[20]\C[6]\DA[name]\C[0]\FS[18]
  28. \DA[description]
  29. \C[192,224,255]威力:\C[0]\!\DA[power]
  30. \C[192,224,255]命中率:\C[0]\!\DA[hit]
  31. \C[192,224,255]攻擊力:\C[0]\!\DA[atk_f]%
  32. \C[192,224,255]力量:\C[0]\!\DA[str_f]%
  33. \C[192,244,255]靈巧:\C[0]\!\DA[dex_f]%
  34. \C[192,244,255]速度:\C[0]\!\DA[agi_f]%
  35. \C[192,224,255]迴避:\C[0]\!\DA[eva_f]%
  36. \C[192,224,255]屬性:\!\EF
  37. \C[192,224,255]狀態:\!\SS'
  38. # 物品-------------------------------------------------------
  39. S8_Item = '\FS[20]\C[6]\DA[name]\C[0]\FS[18]
  40. \DA[description]
  41. \C[192,224,255]使用目標:\C[0]\SC[\DA[scope]]
  42. \C[192,224,255]\TY[\DA[parameter_type]]\C[0]+\!\DA[parameter_points]
  43. \C[192,224,255]HP恢復率:\C[50]\!\DA[recover_hp_rate]%
  44. \C[192,224,255]HP恢復量:\C[0]\!\DA[recover_hp]
  45. \C[192,224,255]SP恢復率:\C[0]\!\DA[recover_sp_rate]%
  46. \C[192,224,255]SP恢復量:\C[0]\!\DA[recover_sp]
  47. \C[192,244,255]命中率:\C[0]\!\DA[hit]%
  48. \C[192,224,255]屬性:\!\EF
  49. \C[192,224,255]狀態:\!\SS
  50. \C[192,224,255]販賣價格:\C[0]\!\DA[price]'
  51. # 武器-------------------------------------------------------
  52. S8_Weapon = '\FS[20]\C[6]\DA[name]\C[0]\FS[18]
  53. \DA[description]
  54. \C[192,224,255]攻擊力:\C[100]\!\DA[atk]
  55. \C[192,224,255]物理防禦:\C[0]\!\DA[pdef]
  56. \C[192,224,255]魔法防禦:\C[0]\!\DA[mdef]
  57. \C[192,224,255]力量:\C[0]\!\DA[str_plus]
  58. \C[192,244,255]靈巧:\C[0]\!\DA[dex_plus]
  59. \C[192,244,255]速度:\C[0]\!\DA[agi_plus]
  60. \C[192,244,255]魔力:\C[0]\!\DA[int_plus]
  61. \C[192,224,255]屬性:\!\EF
  62. \C[192,224,255]狀態:\!\SS
  63. \C[192,224,255]販賣價格:\C[1000]\!\DA[price]'
  64. # 防具-------------------------------------------------------
  65. S8_Armor = '\FS[20]\C[6]\DA[name]\C[0]\FS[18]
  66. \DA[description]
  67. \C[192,224,255]附加狀態:\C[0]\!\TN[\DA[auto_state_id]]
  68. \C[192,224,255]物理防禦:\C[0]\!\DA[pdef]
  69. \C[192,224,255]魔法防禦:\C[0]\!\DA[mdef]
  70. \C[192,224,255]力量:\C[0]\!\DA[str_plus]
  71. \C[192,244,255]靈巧:\C[0]\!\DA[dex_plus]
  72. \C[192,244,255]速度:\C[0]\!\DA[agi_plus]
  73. \C[192,244,255]魔力:\C[0]\!\DA[int_plus]
  74. \C[192,224,255]迴避:\C[0]\!\DA[eva]%
  75. \C[192,224,255]屬性免疫:\!\EF
  76. \C[192,224,255]狀態免疫:\!\SS
  77. \C[192,224,255]販賣價格:\C[0]\!\DA[price]'
  78. #=======================================
  79. #● 追加設定
  80. # S8_Complete
  81. #=======================================
  82.   BEGIN{$Sword ? $Sword[8] = 2 : $Sword = {8=>2}} # 腳本使用標誌
  83.   ($Sword_VX = defined?(RPG::Weather) ? false : true) if $Sword_VX.nil?
  84.   S8_Complete = $Sword[59] ? S59_Complete : false unless defined?(S8_Complete)
  85.   $Sword_F12_Error = {} unless $Sword_F12_Error # F12除錯標誌
  86. end
  87. #=======================================
  88. #■ 小型幫助窗口
  89. class WSword_Help < Window_Base
  90.   attr_writer(:top_row) # 開頭行數
  91.   attr_writer(:visible2) # 第2隱藏標誌
  92.   attr_writer(:use_text) # 設定採用的描繪內容
  93.   #-------------------------------------------------------------
  94.   #● 初始化物件(關連被顯示窗口, 資料)
  95.   def initialize(corelation, data)
  96.     @setting_wsword = Window_Base.new(0, 0, Sword::S8_Width, 33)
  97.     super(0, 0, 640, 480) ; self.contents = Bitmap.new(width - 32, height - 32)
  98.     self.opacity = 0 ; self.z = 155
  99.     @setting_wsword.z = 150 ; @setting_wsword.opacity = 150
  100.     @me_index = -1 # 儲存上次的位置
  101.     @corelation = corelation # 關連被顯示窗口
  102.     @visible2, @contrast = true, data.id
  103.     refresh(data)
  104.   end
  105.   #-------------------------------------------------------------
  106.   #● 更新內容(資料)
  107.   def refresh(data)
  108.     return unless data
  109.     if @use_text then text = @use_text # 採用其它
  110.     else
  111.       case data # 資料類型
  112.       when RPG::Skill ; text = Sword::S8_Skill.clone # 技能
  113.       when RPG::Item ; text = Sword::S8_Item.clone # 物品
  114.       when RPG::Weapon ; text = Sword::S8_Weapon.clone # 武器
  115.       when RPG::Armor ; text = Sword::S8_Armor.clone # 防具
  116.       end
  117.     end
  118.     $game_system.swordM_data = data # 對象資料
  119.     text = text.code_explain
  120.     text_array = text.split(/\n/) # 依照換行分解,確認每行底部內容之用
  121.     text = ''
  122.     text_array.each{|item| next if /\\\!0?%?\Z/ === item ; text += item + "\n"}
  123.     text.gsub!(/\\\!/){''} # 清空無用的\!控制碼
  124.     contents.clear
  125.     contents.blt(0, 0, text.bitmap_explain(Sword::S8_Width, 300){},
  126.     Rect.new(0, 0, Sword::S8_Width, 300))
  127.     @setting_wsword.height = $Sword46[0][1] - 24
  128.     place
  129.   end
  130.   #-------------------------------------------------------------
  131.   #● 更新窗口位置
  132.   def place
  133.     if Sword::S8_Complete
  134.       coord = Mouse.coord ; self.x, self.y = coord[0], coord[1]
  135.     else
  136.       self.x = @corelation.x + @corelation.cursor_rect.x + 16 + Sword::S8_XY[0]
  137.       self.y = @corelation.y + @corelation.cursor_rect.y + 16 + Sword::S8_XY[1]
  138.     end
  139.     if XPVX.height < @setting_wsword.y + @setting_wsword.height
  140.       case Sword::S8_Location
  141.       when Array # 指定座標
  142.         @setting_wsword.x = Sword::S8_Location[0]
  143.         @setting_wsword.y = Sword::S8_Location[1]
  144.         self.x = Sword::S8_Location[0] - 12 ; self.y = Sword::S8_Location[1] - 12
  145.       when 1 # 底部為限
  146.         @setting_wsword.y = XPVX.height - @setting_wsword.height
  147.         self.y = @setting_wsword.y - 12
  148.       when 2 # 頂部為限
  149.         @setting_wsword.y = 0 ; self.y = 12
  150.       when 3 # 底部移動
  151.         @setting_wsword.y += @setting_wsword.height
  152.         self.y += @setting_wsword.height
  153.       when 4 # 頂部移動
  154.         @setting_wsword.y -= @setting_wsword.height
  155.         self.y -= @setting_wsword.height
  156.       when 5 # 一律居中
  157.         @setting_wsword.x = (XPVX.width - @setting_wsword.width) / 2
  158.         @setting_wsword.y = (XPVX.height - @setting_wsword.height) / 2
  159.         self.x = @setting_wsword.x - 12 ; self.y = @setting_wsword.y - 12
  160.       end
  161.     end
  162.     #(self.x += 2 ; self.y += 2 ; @setting_wsword.height += 2) if Sword8_XPVX # VX顯示修正
  163.   end
  164.   #-------------------------------------------------------------
  165.   #● 變更X座標
  166.   def x=(x) ; @setting_wsword.x = x + 12 ; super ; end
  167.   #-------------------------------------------------------------
  168.   #● 變更Y座標
  169.   def y=(y) ; @setting_wsword.y = y + 12 ; super ; end
  170.   #-------------------------------------------------------------
  171.   #● 釋放窗口
  172.   def dispose ; @setting_wsword.dispose ; super ; end
  173.   #-------------------------------------------------------------
  174.   #● 隱藏窗口(隱藏標誌)
  175.   def visible=(s) ; @setting_wsword.visible = s ; super ; end
  176.   #-------------------------------------------------------------
  177.   #● 更新窗口(索引, 對象, 強制更新標誌)
  178.   def update(index, data, force = false)
  179.     self.visible = data ? @visible2 : false  # 如果沒有資料就隱藏窗口
  180.     place
  181.     return if @me_index == index && @contrast == data.id or ! data unless force
  182.     @me_index, @contrast = index, data.id ; refresh(data)
  183.   end
  184. end
  185. #=======================================
  186. #■ 物品窗口
  187. class Window_Item
  188.   #-------------------------------------------------------------
  189.   #● 初始化物件
  190.   alias sword8_initialize initialize
  191.   def initialize(*args)
  192.     $Sword_VX ? sword8_initialize(*args) : sword8_initialize
  193.     @help_wsword = WSword_Help.new(self, item)
  194.     @help_wsword.visible = false if $Sword_VX && $scene.is_a?(Scene_Equip)
  195.   end
  196.   #-------------------------------------------------------------
  197.   #● 更新窗口
  198.   alias sword8_update update unless $Sword_F12_Error[8]
  199.   def update
  200.     sword8_update
  201.     @help_wsword.top_row = top_row
  202.     @help_wsword.update(index, item)
  203.   end
  204.   #-------------------------------------------------------------
  205.   #● 釋放窗口
  206.   alias sword8_dispose dispose unless $Sword_F12_Error[8]
  207.   def dispose
  208.     sword8_dispose ; @help_wsword.dispose
  209.   end
  210.   #-------------------------------------------------------------
  211.   #● 窗口顯示狀態=(顯示標誌)
  212.   alias sword8_visible= visible= unless $Sword_F12_Error[8]
  213.   def visible=(visible)
  214.     @help_wsword.visible = @help_wsword.visible2 = visible
  215.     self.sword8_visible = visible
  216.   end
  217.   #-------------------------------------------------------------
  218.   #● 裝備壞面一開始隱藏跟隨型說明窗口
  219.   if $Sword_VX
  220.     def sword8_no_visible
  221.       @help_wsword.visible = false
  222.     end
  223.   end
  224. end
  225. #=======================================
  226. #■ 技能窗口
  227. class Window_Skill
  228.   #-------------------------------------------------------------
  229.   #● 初始化物件(角色編號)
  230.   alias sword8_initialize initialize
  231.   def initialize(*args)
  232.     $Sword_VX ? sword8_initialize(*args) : sword8_initialize(*args)
  233.     @help_wsword = WSword_Help.new(self, skill)
  234.   end
  235.   #-------------------------------------------------------------
  236.   #● 更新窗口
  237.   alias sword8_update update unless $Sword_F12_Error[8]
  238.   def update
  239.     sword8_update
  240.     @help_wsword.top_row = top_row
  241.     @help_wsword.update(index, skill)
  242.   end
  243.   #-------------------------------------------------------------
  244.   #● 釋放窗口
  245.   alias sword8_dispose dispose unless $Sword_F12_Error[8]
  246.   def dispose
  247.     sword8_dispose ; @help_wsword.dispose
  248.   end
  249.   #-------------------------------------------------------------
  250.   #● 窗口顯示狀態=(顯示標誌)
  251.   alias sword8_visible= visible= unless $Sword_F12_Error[8]
  252.   def visible=(visible)
  253.     @help_wsword.visible = @help_wsword.visible2 = visible
  254.     self.sword8_visible = visible
  255.   end
  256. end
  257. #=======================================
  258. #■ 購買窗口
  259. class Window_ShopBuy
  260.   #-------------------------------------------------------------
  261.   #● 初始化物件(商品資料)
  262.   alias sword8_initialize initialize
  263.   def initialize(*args)
  264.     sword8_initialize(*args)
  265.     @help_wsword = WSword_Help.new(self, item)
  266.   end
  267.   #-------------------------------------------------------------
  268.   #● 更新窗口
  269.   alias sword8_update update unless $Sword_F12_Error[8]
  270.   def update
  271.     sword8_update
  272.     @help_wsword.top_row = top_row
  273.     @help_wsword.update(index, item)
  274.   end
  275.   #-------------------------------------------------------------
  276.   #● 釋放窗口
  277.   alias sword8_dispose dispose unless $Sword_F12_Error[8]
  278.   def dispose
  279.     sword8_dispose ; @help_wsword.dispose
  280.   end
  281.   #-------------------------------------------------------------
  282.   #● 窗口顯示狀態=(顯示標誌)
  283.   alias sword8_visible= visible= unless $Sword_F12_Error[8]
  284.   def visible=(visible)
  285.     @help_wsword.visible = @help_wsword.visible2 = visible
  286.     self.sword8_visible = visible
  287.   end
  288. end
  289. #=======================================
  290. #■ 販賣窗口
  291. unless $Sword_VX
  292. class Window_ShopSell
  293.   #-------------------------------------------------------------
  294.   #● 初始化物件
  295.   alias sword8_initialize initialize
  296.   def initialize
  297.     sword8_initialize
  298.     @help_wsword = WSword_Help.new(self, item)
  299.   end
  300.   #-------------------------------------------------------------
  301.   #● 更新窗口
  302.   alias sword8_update update unless $Sword_F12_Error[8]
  303.   def update
  304.     sword8_update
  305.     @help_wsword.top_row = top_row
  306.     @help_wsword.update(index, item)
  307.   end
  308.   #-------------------------------------------------------------
  309.   #● 釋放窗口
  310.   alias sword8_dispose dispose unless $Sword_F12_Error[8]
  311.   def dispose
  312.     sword8_dispose ; @help_wsword.dispose
  313.   end
  314.   #-------------------------------------------------------------
  315.   #● 窗口顯示狀態=(顯示標誌)
  316.   alias sword8_visible= visible= unless $Sword_F12_Error[8]
  317.   def visible=(visible)
  318.     @help_wsword.visible = @help_wsword.visible2 = visible
  319.     self.sword8_visible = visible
  320.   end
  321. end end
  322. #=======================================
  323. #■ 目前裝備窗口
  324. eval("
  325. class #{$Sword_VX ? 'Window_Equip' : 'Window_EquipRight'}
  326.   #-------------------------------------------------------------
  327.   #● 初始化物件(角色)
  328.   alias sword8_initialize initialize
  329.   def initialize(*args)
  330.     sword8_initialize(*args)
  331.     @help_wsword = WSword_Help.new(self, item)
  332.   end
  333.   #-------------------------------------------------------------
  334.   #● 更新窗口
  335.   alias sword8_update update unless $Sword_F12_Error[8]
  336.   def update
  337.     sword8_update
  338.     @help_wsword.top_row = top_row
  339.     @help_wsword.update(index, item)
  340.   end
  341.   #-------------------------------------------------------------
  342.   #● 釋放窗口
  343.   alias sword8_dispose dispose unless $Sword_F12_Error[8]
  344.   def dispose
  345.     sword8_dispose ; @help_wsword.dispose
  346.   end
  347.   #-------------------------------------------------------------
  348.   #● 窗口顯示狀態=(顯示標誌)
  349.   alias sword8_visible= visible= unless $Sword_F12_Error[8]
  350.   def visible=(visible)
  351.     @help_wsword.visible = @help_wsword.visible2 = visible
  352.     self.sword8_visible = visible
  353.   end
  354. end")
  355. #=======================================
  356. #■ 選擇裝備窗口
  357. unless $Sword_VX
  358. class Window_EquipItem
  359.   #-------------------------------------------------------------
  360.   #● 初始化物件(角色, 裝備部位)
  361.   alias sword8_initialize initialize
  362.   def initialize(*args)
  363.     sword8_initialize(*args)
  364.     @help_wsword = WSword_Help.new(self, item)
  365.     @help_wsword.visible = false
  366.   end
  367.   #-------------------------------------------------------------
  368.   #● 更新窗口
  369.   alias sword8_update update unless $Sword_F12_Error[8]
  370.   def update
  371.     sword8_update
  372.     @help_wsword.top_row = top_row
  373.     @help_wsword.update(index, item)
  374.   end
  375.   #-------------------------------------------------------------
  376.   #● 釋放窗口
  377.   alias sword8_dispose dispose unless $Sword_F12_Error[8]
  378.   def dispose
  379.     sword8_dispose ; @help_wsword.dispose
  380.   end
  381.   #-------------------------------------------------------------
  382.   #● 窗口顯示狀態=(顯示標誌)
  383.   alias sword8_visible= visible= unless $Sword_F12_Error[8]
  384.   def visible=(visible)
  385.     @help_wsword.visible = @help_wsword.visible2 = visible if active and item
  386.     self.sword8_visible = visible
  387.   end
  388. end end
  389. #=======================================
  390. #■ 裝備畫面
  391. if $Sword_VX
  392. class Scene_Equip
  393.   #---------------------------------------------------------------
  394.   #● 創建可裝備窗口
  395.   alias sword8_create_item_windows create_item_windows
  396.   def create_item_windows
  397.     sword8_create_item_windows
  398.     (0...EQUIP_TYPE_MAX).each{|i| @item_windows[i].sword8_no_visible}
  399.   end
  400. end end
  401. $Sword_F12_Error[8] = true
复制代码

点评

把self.z = 155的155调大  发表于 2016-11-26 11:13
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部