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

Project1

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

[已经解决] yami的伤害显示脚本有个奇怪bug,望修复

[复制链接]

Lv4.逐梦者

梦石
1
星屑
14504
在线时间
2086 小时
注册时间
2017-9-28
帖子
662
跳转到指定楼层
1
发表于 2018-1-21 17:13:44 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 Nil2018 于 2018-1-21 17:14 编辑


凡是强化能力、弱化能力都会出现一个迷之"口"希望大家帮看一下哪里出了问题。

原脚本:
  1. $imported = {} if $imported.nil?
  2. $imported["YES-BattlePopup"] = true

  3. #==============================================================================
  4. # ■ BattleLuna
  5. #==============================================================================

  6. module BattleLuna
  7.   module Addon
  8.    
  9.     BATTLE_POPUP = {
  10.       # Basic Configuration.
  11.       :basic_setting  =>  {
  12.         :enable      =>  true,       # Set to false to disable popup.
  13.         :state_popup =>  true,       # Set to false to disable state popup.
  14.         :buff_popup  =>  true,       # Set to false to disable buff popup.
  15.         :delay       =>  2,          # Delay between each popup.
  16.         :no_delay    =>  [:critical, :drained, :weakpoint, :resistant, :absorbed],
  17.       },
  18.       
  19.       # Configuration for words.
  20.       :word_setting   =>  {
  21.         :default    => "%s",        # SprintF for Default.
  22.         :hp_dmg     => "-%s HP",      # SprintF for HP damage.
  23.         :hp_heal    => "+%s HP",      # SprintF for HP healing.
  24.         :mp_dmg     => "-%s MP",    # SprintF for MP damage.
  25.         :mp_heal    => "+%s MP",    # SprintF for MP healing.
  26.         :tp_dmg     => "-%s TP",    # SprintF for MP damage.
  27.         :tp_heal    => "+%s TP",    # SprintF for MP healing.
  28.         :drained    => "耗竭",     # Text display for draining HP/MP.
  29.         :critical   => "暴击!", # Text display for critical hit.
  30.         :missed     => "未命中",      # Text display for missed attack.
  31.         :evaded     => "闪避!",      # Text display for evaded attack.
  32.         :nulled     => "",         # Text display for nulled attack.
  33.         :failed     => "",          # Text display for a failed attack.
  34.         :add_state  => "+%s",       # SprintF for added states.
  35.         :rem_state  => "-%s",       # SprintF for removed states.
  36.         :dur_state  => "%s",        # SprintF for during states.
  37.         :weakpoint  => "弱点", # Appears if foe is weak to element.
  38.         :resistant  => "抵抗",    # Appears if foe is resistant to element.
  39.         :immune     => "免疫",    # Appears if foe is immune to element.
  40.         :absorbed   => "吸收",    # Appears if foe can absorb the element.
  41.         :add_buff   => "%s+",        # Appears when a positive buff is applied.
  42.         :add_debuff => "%s-",        # Appears when a negative buff is applied.
  43.       },
  44.       
  45.       # Configuration for popup visual.
  46.       :style_setting  =>  {
  47.         # Type      => [Red, Green, Blue, Size, Bold, Italic, Font],
  48.         :default    => [255,   255,  255,   32, true,  false, Font.default_name],
  49.         :hp_dmg     => [255,   255,  255,   32, true,  false, Font.default_name],
  50.         :hp_heal    => [100,   255,  100,   32, true,  false, Font.default_name],
  51.         :mp_dmg     => [255,   100,  255,   32, true,  false, Font.default_name],
  52.         :mp_heal    => [255,   100,  255,   32, true,  false, Font.default_name],
  53.         :tp_dmg     => [100,   255,  255,   32, true,  false, Font.default_name],
  54.         :tp_heal    => [100,   255,  255,   32, true,  false, Font.default_name],
  55.         :drained    => [255,   255,  255,   32, true,  false, Font.default_name],
  56.         :critical   => [255,   255,  255,   32, true,  false, Font.default_name],
  57.         :missed     => [255,   255,  255,   32, true,  false, Font.default_name],
  58.         :evaded     => [255,   255,  255,   32, true,  false, Font.default_name],
  59.         :nulled     => [255,   255,  255,   32, true,  false, Font.default_name],
  60.         :failed     => [255,   255,  255,   32, true,  false, Font.default_name],
  61.         :add_state  => [255,   255,  255,   32, true,  false, Font.default_name],
  62.         :rem_state  => [255,   255,  255,   32, true,  false, Font.default_name],
  63.         :dur_state  => [255,   255,  255,   32, true,  false, Font.default_name],
  64.         :weakpoint  => [255,   255,  255,   32, true,  false, Font.default_name],
  65.         :resistant  => [255,   255,  255,   32, true,  false, Font.default_name],
  66.         :immune     => [255,   255,  255,   32, true,  false, Font.default_name],
  67.         :absorbed   => [255,   255,  255,   32, true,  false, Font.default_name],
  68.         :add_buff   => [255,   255,  255,   32, true,  false, Font.default_name],
  69.         :add_debuff => [255,   255,  255,   32, true,  false, Font.default_name],
  70.         :lvup       => [255,   255,  255,   20, false, false, Font.default_name],
  71.       },
  72.       
  73.       # Configuration for popup effect.
  74.       :effect_setting =>  {
  75.         # Type      => [Effect sequence],
  76.         :default    => [:up, :wait],
  77.         :hp_dmg     => [:zoom1, :wait, :wait2],
  78.         :hp_heal    => [:zoom2, :wait, :wait2],
  79.         :mp_dmg     => [:zoom1, :wait, :wait2],
  80.         :mp_heal    => [:zoom2, :wait, :wait2],
  81.         :tp_dmg     => [:zoom1, :wait, :wait2],
  82.         :tp_heal    => [:zoom2, :wait, :wait2],
  83.         :drained    => [:affect, :up    , :wait],
  84.         :critical   => [:affect, :up    , :wait],
  85.         :missed     => [:up    , :wait],
  86.         :evaded     => [:up    , :wait],
  87.         :nulled     => [:up    , :wait],
  88.         :failed     => [:up    , :wait],
  89.         :add_state  => [:affect, :up    , :wait],
  90.         :rem_state  => [:affect, :up    , :wait],
  91.         :dur_state  => [:affect, :up    , :wait],
  92.         :weakpoint  => [:affect, :up    , :wait],
  93.         :resistant  => [:affect, :up    , :wait],
  94.         :immune     => [:up    , :wait],
  95.         :absorbed   => [:affect, :up    , :wait],
  96.         :add_buff   => [:affect, :up    , :wait],
  97.         :add_debuff => [:affect, :up    , :wait],
  98.         :lvup       => [:up, :wait],
  99.       },
  100.       
  101.       :effect_setup   =>  {
  102.         #:type   => [ZoomX, ZoomY, StartX, StartY, MoveX, MoveY, Gravt, Opacity, Dur, Random],
  103.         :up      => [1.0  , 1.0  , 0.0   , 0.0   , 0.0  , -1.0 , 0.0  , 255    , 32 , false ],
  104.         :jump_1  => [1.0  , 1.0  , 0.0   , 0.0   , 0.0  , -3.4 , 0.25  , 255    , 33 , false ],
  105.         :jump_2  => [1.0  , 1.0  , 0.0   , 0.0   , 0.0  , -3.2 , 0.2  , 255    , 33 , false ],
  106.         :wait    => [1.0  , 1.0  , 0.0   , 0.0   , 0.0  , 0.0  , 0.0  , 255      , 140 , false ],
  107.         :wait2   => [1.0  , 1.0  , 0.0   , 0.0   , 0.0  , 0.0  , 0.0  , 0     , 30 , false ],
  108.         :affect  => [2.0  , 2.0  , 0.0   , -32.0 , 0.0  , 0.0  , 0.0  , 255    , 1  , false ],
  109.         :zoom1   => [1.5  , 1.5  , 0.0   , 0.0   , 0.0  , -3.4 , 0.18  , 255    , 33 , false ],
  110.         :zoom2   => [1.5  , 1.5  , 0.0   , 0.0   , 0.0  , -1.0 , 0.0  , 255    , 33 , false ],
  111.         },
  112.       
  113.     } # End BATTLE_POPUP.
  114.    
  115.   end # Addon
  116. end # BattleLuna

  117. #==============================================================================
  118. # ■ Game_BattlerBase
  119. #==============================================================================

  120. class Game_BattlerBase
  121.   
  122.   #--------------------------------------------------------------------------
  123.   # * Public Instance Variables
  124.   #--------------------------------------------------------------------------
  125.   attr_accessor :popups
  126.   
  127.   #--------------------------------------------------------------------------
  128.   # new method: create_popup
  129.   #--------------------------------------------------------------------------
  130.   def create_popup(data, rule = :default)
  131.     return unless SceneManager.scene_is?(Scene_Battle)
  132.     return unless BattleLuna::Addon::BATTLE_POPUP[:basic_setting][:enable]
  133.     @popups ||= []
  134.     @popups.push([data, rule])
  135.   end
  136.   
  137.   #--------------------------------------------------------------------------
  138.   # new method: make_damage_popups
  139.   #--------------------------------------------------------------------------
  140.   def make_damage_popups(user)
  141.     if @result.hp_drain != 0
  142.       rule = :drained
  143.       user.create_popup(["", nil], rule)
  144.       rule = :hp_dmg  if @result.hp_drain < 0
  145.       rule = :hp_heal if @result.hp_drain > 0
  146.       value = @result.hp_drain.abs
  147.       user.create_popup(["#{value}", nil], rule)
  148.     end
  149.     if @result.mp_drain != 0
  150.       rule = :drained
  151.       user.create_popup(["", nil], rule)
  152.       rule = :mp_dmg  if @result.mp_drain < 0
  153.       rule = :mp_heal if @result.mp_drain > 0
  154.       value = @result.mp_drain.abs
  155.       user.create_popup(["#{value}", nil], rule)
  156.     end
  157.     #---
  158.     rule = :critical
  159.     create_popup(["", nil], rule) if @result.critical
  160.     if @result.hp_damage != 0
  161.       rule = :hp_dmg  if @result.hp_damage > 0
  162.       rule = :hp_heal if @result.hp_damage < 0
  163.       value = @result.hp_damage.abs
  164.       create_popup(["#{value}", nil], rule)
  165.     end
  166.     if @result.mp_damage != 0
  167.       rule = :mp_dmg  if @result.mp_damage > 0
  168.       rule = :mp_heal if @result.mp_damage < 0
  169.       value = @result.mp_damage.abs
  170.       create_popup(["#{value}", nil], rule)
  171.     end
  172.     if @result.tp_damage != 0
  173.       rule = :tp_dmg  if @result.tp_damage > 0
  174.       rule = :tp_heal if @result.tp_damage < 0
  175.       value = @result.tp_damage.abs
  176.       create_popup(["#{value}", nil], rule)
  177.     end
  178.   end
  179.   
  180.   #--------------------------------------------------------------------------
  181.   # alias method: erase_state
  182.   #--------------------------------------------------------------------------
  183.   alias battle_luna_dp_erase_state erase_state unless $imported["YEA-BattleEngine"]
  184.   def erase_state(state_id)
  185.     make_state_popup(state_id, :rem_state) if @states.include?(state_id)
  186.     if $imported["YEA-BattleEngine"]
  187.       game_battlerbase_erase_state_abe(state_id)
  188.     else
  189.       battle_luna_dp_erase_state(state_id)
  190.     end
  191.   end
  192.   
  193.   #--------------------------------------------------------------------------
  194.   # new method: make_during_state_popup
  195.   #--------------------------------------------------------------------------
  196.   def make_during_state_popup
  197.     state_id = most_important_state_id
  198.     return if state_id == 0
  199.     make_state_popup(state_id, :dur_state)
  200.   end
  201.   
  202.   #--------------------------------------------------------------------------
  203.   # new method: most_important_state_id
  204.   #--------------------------------------------------------------------------
  205.   def most_important_state_id
  206.     states.each {|state| return state.id unless state.message3.empty? }
  207.     return 0
  208.   end
  209.   
  210.   #--------------------------------------------------------------------------
  211.   # new method: make_state_popup
  212.   #--------------------------------------------------------------------------
  213.   def make_state_popup(state_id, type)
  214.     return unless BattleLuna::Addon::BATTLE_POPUP[:basic_setting][:state_popup]
  215.     state = $data_states[state_id]
  216.     return if state.icon_index == 0
  217.     create_popup(["#{state.name}", state.icon_index], type)
  218.   end
  219.   
  220.   #--------------------------------------------------------------------------
  221.   # new method: make_miss_popups
  222.   #--------------------------------------------------------------------------
  223.   def make_miss_popups(user, item)
  224.     return if dead?
  225.     if @result.missed
  226.       rule = :missed
  227.       create_popup(["", nil], rule)
  228.     end
  229.     if @result.evaded
  230.       rule = :evaded
  231.       create_popup(["", nil], rule)
  232.     end
  233.     if @result.hit? && [email protected]
  234.       rule = :failed
  235.       create_popup(["", nil], rule)
  236.     end
  237.     if @result.hit? && item.damage.to_hp?
  238.       if @result.hp_damage == 0 && @result.mp_damage == 0
  239.         rule = :nulled
  240.         create_popup(["", nil], rule)
  241.       end
  242.     end
  243.   end
  244.   
  245.   #--------------------------------------------------------------------------
  246.   # new method: make_rate_popup
  247.   #--------------------------------------------------------------------------
  248.   def make_rate_popup(rate)
  249.     return if rate == 1.0
  250.     if rate > 1.0
  251.       rule = :weakpoint
  252.     elsif rate == 0.0
  253.       rule = :immune
  254.     elsif rate < 0.0
  255.       rule = :absorbed
  256.     else
  257.       rule = :resistant
  258.     end
  259.     create_popup(["", nil], rule)
  260.   end
  261.   
  262.   #--------------------------------------------------------------------------
  263.   # new method: make_buff_popup
  264.   #--------------------------------------------------------------------------
  265.   def make_buff_popup(param_id, positive = true)
  266.     return unless BattleLuna::Addon::BATTLE_POPUP[:basic_setting][:buff_popup]
  267.     return unless SceneManager.scene_is?(Scene_Battle)
  268.     return unless alive?
  269.     name = Vocab::param(param_id)
  270.     if positive
  271.       rule = :add_buff
  272.       buff_level = 1
  273.     else
  274.       rule = :add_debuff
  275.       buff_level = -1
  276.     end
  277.     icon = buff_icon_index(buff_level, param_id)
  278.     create_popup(["#{name}", icon], rule)
  279.   end

  280. end # Game_BattlerBase

  281. #==============================================================================
  282. # ■ Game_Battler
  283. #==============================================================================

  284. class Game_Battler < Game_BattlerBase
  285.   
  286.   #--------------------------------------------------------------------------
  287.   # alias method: on_battle_end
  288.   #--------------------------------------------------------------------------
  289.   alias battle_luna_dp_on_battle_end on_battle_end
  290.   def on_battle_end
  291.     battle_luna_dp_on_battle_end
  292.     @popups ||= []
  293.     @popups.clear
  294.   end
  295.   
  296.   #--------------------------------------------------------------------------
  297.   # alias method: item_apply
  298.   #--------------------------------------------------------------------------
  299.   alias battle_luna_dp_item_apply item_apply unless $imported["YEA-BattleEngine"]
  300.   def item_apply(user, item)
  301.     if $imported["YEA-BattleEngine"]
  302.       game_battler_item_apply_abe(user, item)
  303.     else
  304.       battle_luna_dp_item_apply(user, item)
  305.     end   
  306.     @result.restore_damage
  307.     make_miss_popups(user, item)
  308.     make_damage_popups(user)
  309.   end
  310.   
  311.   #--------------------------------------------------------------------------
  312.   # alias method: make_damage_value
  313.   #--------------------------------------------------------------------------
  314.   alias battle_luna_dp_make_damage_value make_damage_value unless $imported["YEA-BattleEngine"]
  315.   def make_damage_value(user, item)
  316.     if $imported["YEA-BattleEngine"]
  317.       game_battler_make_damage_value_abe(user, item)
  318.     else
  319.       battle_luna_dp_make_damage_value(user, item)
  320.     end   
  321.     rate = item_element_rate(user, item)
  322.     make_rate_popup(rate)
  323.   end
  324.   
  325.   #--------------------------------------------------------------------------
  326.   # alias method: execute_damage
  327.   #--------------------------------------------------------------------------
  328.   alias battle_luna_dp_execute_damage execute_damage unless $imported["YEA-BattleEngine"]
  329.   def execute_damage(user)
  330.     if $imported["YEA-BattleEngine"]
  331.       game_battler_execute_damage_abe(user)
  332.     else
  333.       battle_luna_dp_execute_damage(user)
  334.     end   
  335.     #make_damage_popups(user)
  336.   end
  337.   
  338.   #--------------------------------------------------------------------------
  339.   # alias method: item_effect_recover_hp
  340.   #--------------------------------------------------------------------------
  341.   alias battle_luna_dp_item_effect_recover_hp item_effect_recover_hp unless $imported["YEA-BattleEngine"]
  342.   def item_effect_recover_hp(user, item, effect)
  343.     if $imported["YEA-BattleEngine"]
  344.       game_battler_item_effect_recover_hp_abe(user, item, effect)
  345.     else
  346.       battle_luna_dp_item_effect_recover_hp(user, item, effect)
  347.     end   
  348.     #make_damage_popups(user)
  349.   end
  350.   
  351.   #--------------------------------------------------------------------------
  352.   # alias method: item_effect_recover_mp
  353.   #--------------------------------------------------------------------------
  354.   alias battle_luna_item_effect_recover_mp item_effect_recover_mp unless $imported["YEA-BattleEngine"]
  355.   def item_effect_recover_mp(user, item, effect)
  356.     if $imported["YEA-BattleEngine"]
  357.       game_battler_item_effect_recover_mp_abe(user, item, effect)
  358.     else
  359.       battle_luna_item_effect_recover_mp(user, item, effect)
  360.     end  
  361.     #make_damage_popups(user)
  362.   end
  363.   
  364.   #--------------------------------------------------------------------------
  365.   # alias method: item_effect_gain_tp
  366.   #--------------------------------------------------------------------------
  367.   alias battle_luna_item_effect_gain_tp item_effect_gain_tp unless $imported["YEA-BattleEngine"]
  368.   def item_effect_gain_tp(user, item, effect)
  369.     if $imported["YEA-BattleEngine"]
  370.       game_battler_item_effect_gain_tp_abe(user, item, effect)
  371.     else
  372.       battle_luna_item_effect_gain_tp(user, item, effect)
  373.     end  
  374.     #make_damage_popups(user)
  375.   end
  376.   
  377.   #--------------------------------------------------------------------------
  378.   # alias method: add_new_state
  379.   #--------------------------------------------------------------------------
  380.   alias battle_luna_dp_add_new_state add_new_state unless $imported["YEA-BattleEngine"]
  381.   def add_new_state(state_id)
  382.     if $imported["YEA-BattleEngine"]
  383.       game_battler_add_new_state_abe(state_id)
  384.     else
  385.       battle_luna_dp_add_new_state(state_id)
  386.     end  
  387.     make_state_popup(state_id, :add_state) if @states.include?(state_id)
  388.   end
  389.   
  390.   #--------------------------------------------------------------------------
  391.   # alias method: add_buff
  392.   #--------------------------------------------------------------------------
  393.   alias battle_luna_dp_add_buff add_buff unless $imported["YEA-BattleEngine"]
  394.   def add_buff(param_id, turns)
  395.     make_buff_popup(param_id, true)
  396.     if $imported["YEA-BattleEngine"]
  397.       game_battler_add_buff_abe(param_id, turns)
  398.     else
  399.       battle_luna_dp_add_buff(param_id, turns)
  400.     end  
  401.   end
  402.   
  403.   #--------------------------------------------------------------------------
  404.   # alias method: add_debuff
  405.   #--------------------------------------------------------------------------
  406.   alias battle_luna_dp_add_debuff add_debuff unless $imported["YEA-BattleEngine"]
  407.   def add_debuff(param_id, turns)
  408.     make_buff_popup(param_id, false)
  409.     if $imported["YEA-BattleEngine"]
  410.       game_battler_add_debuff_abe(param_id, turns)
  411.     else
  412.       battle_luna_dp_add_debuff(param_id, turns)
  413.     end  
  414.   end
  415.   
  416.   #--------------------------------------------------------------------------
  417.   # alias method: regenerate_all
  418.   #--------------------------------------------------------------------------
  419.   alias battle_luna_dp_regenerate_all regenerate_all unless $imported["YEA-BattleEngine"]
  420.   def regenerate_all
  421.     if $imported["YEA-BattleEngine"]
  422.       game_battler_regenerate_all_abe
  423.     else
  424.       battle_luna_dp_regenerate_all
  425.     end  
  426.     return unless alive?
  427.     make_damage_popups(self)
  428.   end
  429.    
  430. end # Game_Battler

  431. #==============================================================================
  432. # ■ Sprite_Battler
  433. #==============================================================================

  434. class Game_Actor < Game_Battler
  435.   
  436.   #--------------------------------------------------------------------------
  437.   # new method: screen_x
  438.   #--------------------------------------------------------------------------
  439.   unless Game_Actor.instance_methods.include?(:screen_x)
  440.   def screen_x
  441.     0
  442.   end
  443.   end

  444.   #--------------------------------------------------------------------------
  445.   # new method: screen_y
  446.   #--------------------------------------------------------------------------
  447.   unless Game_Actor.instance_methods.include?(:screen_y)
  448.   def screen_y
  449.     0
  450.   end
  451.   end

  452.   #--------------------------------------------------------------------------
  453.   # new method: screen_z
  454.   #--------------------------------------------------------------------------
  455.   unless Game_Actor.instance_methods.include?(:screen_z)
  456.   def screen_y
  457.     0
  458.   end
  459.   end
  460.   
  461. end # Game_Actor

  462. #==============================================================================
  463. # ■ Sprite_Battler
  464. #==============================================================================

  465. class Sprite_Battler < Sprite_Base
  466.   
  467.   #--------------------------------------------------------------------------
  468.   # alias method: initialize
  469.   #--------------------------------------------------------------------------
  470.   alias battle_luna_dp_initialize initialize
  471.   def initialize(viewport, battler = nil)
  472.     battle_luna_dp_initialize(viewport, battler)
  473.     @popups = []
  474.     @popup_delay = 0
  475.   end
  476.   
  477.   #--------------------------------------------------------------------------
  478.   # alias method: setup_new_effect
  479.   #--------------------------------------------------------------------------
  480.   alias battle_luna_dp_setup_new_effect setup_new_effect
  481.   def setup_new_effect
  482.     battle_luna_dp_setup_new_effect
  483.     setup_popups
  484.   end
  485.   
  486.   #--------------------------------------------------------------------------
  487.   # new method: setup_popups
  488.   #--------------------------------------------------------------------------
  489.   def setup_popups
  490.     setting = BattleLuna::Addon::BATTLE_POPUP
  491.     return unless @battler.use_sprite?
  492.     @battler.popups ||= []
  493.     @popup_delay -= 1
  494.     return if @popup_delay > 0
  495.     array = @battler.popups.shift
  496.     return if array.nil?
  497.     create_new_popup(array[0], array[1])
  498.     return if @battler.popups.size == 0
  499.     return if setting[:basic_setting][:no_delay].include?(array[1])
  500.     @popup_delay = setting[:basic_setting][:delay]
  501.   end
  502.   
  503.   #--------------------------------------------------------------------------
  504.   # new method: create_new_popup
  505.   #--------------------------------------------------------------------------
  506.   def create_new_popup(data, rule)
  507.     return unless @battler
  508.     return unless SceneManager.scene.is_a?(Scene_Battle)
  509.     viewport = self.viewport
  510.     popup = Sprite_PopupLuna.new(viewport, @battler, data, rule)
  511.     @popups.push(popup)
  512.   end
  513.   
  514.   #--------------------------------------------------------------------------
  515.   # alias method: update
  516.   #--------------------------------------------------------------------------
  517.   alias battle_luna_dp_update update
  518.   def update
  519.     battle_luna_dp_update
  520.     update_popups
  521.   end
  522.   
  523.   #--------------------------------------------------------------------------
  524.   # new method: update_popups
  525.   #--------------------------------------------------------------------------
  526.   def update_popups
  527.     @popups.each { |popup| popup.update }
  528.     @popups.each_with_index { |sprite, index|
  529.       next unless sprite.disposed?
  530.       @popups[index] = nil
  531.     }
  532.     @popups.compact!
  533.   end
  534.   
  535.   #--------------------------------------------------------------------------
  536.   # alias method: dispose
  537.   #--------------------------------------------------------------------------
  538.   alias battle_luna_dp_dispose dispose
  539.   def dispose
  540.     @popups.each { |popup| popup.dispose }
  541.     @popups.clear
  542.     battle_luna_dp_dispose
  543.   end
  544.   
  545. end # Sprite_Battler

  546. #==============================================================================
  547. # ■ Sprite_PopupLuna
  548. #==============================================================================

  549. class Sprite_PopupLuna < Sprite
  550.   
  551.   #--------------------------------------------------------------------------
  552.   # initialize
  553.   #--------------------------------------------------------------------------
  554.   def initialize(viewport, battler, data, rule)
  555.     super(viewport)
  556.     @data = data
  557.     @rule = rule
  558.     #---
  559.     @style = rule
  560.     @style = :default unless setting[:style_setting].has_key?(@style)
  561.     @style = setting[:style_setting][@style]
  562.     #---
  563.     @effects = rule
  564.     @effects = :default unless setting[:effect_setting].has_key?(@effects)
  565.     @effects = setting[:effect_setting][@effects].dup
  566.     #---
  567.     @current_effect = nil
  568.     @duration = 0
  569.     @battler = battler
  570.     #---
  571.     start_popup
  572.     start_effect
  573.     update
  574.   end
  575.   
  576.   #--------------------------------------------------------------------------
  577.   # setting
  578.   #--------------------------------------------------------------------------
  579.   def setting
  580.     BattleLuna::Addon::BATTLE_POPUP
  581.   end
  582.   
  583.   #--------------------------------------------------------------------------
  584.   # start_popup
  585.   #--------------------------------------------------------------------------
  586.   def start_popup
  587.     self.bitmap = create_bitmap
  588.     self.x = @battler.screen_x
  589.     self.y = @battler.screen_y
  590.     self.ox = self.bitmap.width / 2
  591.     self.oy = self.bitmap.height
  592.     self.z = @battler.screen_z + 350
  593.   end
  594.   
  595.   #--------------------------------------------------------------------------
  596.   # create_bitmap
  597.   #--------------------------------------------------------------------------
  598.   def create_bitmap
  599.     bw = Graphics.width
  600.     bw = bw + 48 if @data[1]
  601.     bh = @style[3] * 2
  602.     bitmap = Bitmap.new(bw, bh)
  603.     #---
  604.     bitmap.font.color.set(@style[0], @style[1], @style[2])
  605.     bitmap.font.size   = @style[3]
  606.     bitmap.font.bold   = @style[4]
  607.     bitmap.font.italic = @style[5]
  608.     bitmap.font.name   = @style[6]
  609.     #---
  610.     dx = @data[1] ? 24 : 0; dy = 0
  611.     text = setting[:word_setting][@rule]
  612.     text = setting[:word_setting][:default] unless text
  613.     text = sprintf(text, @data[0])
  614.     bitmap.draw_text(dx, dy, bw - dx, bh, text, 1)
  615.     #---
  616.     text_width = bitmap.text_size(text).width
  617.     if @data[1]
  618.       icon_bitmap = Cache.system("Iconset")
  619.       icon_index = @data[1].to_i
  620.       rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  621.       bitmap.blt((bw-text_width)/2-32, (bh - 24)/2, icon_bitmap, rect)
  622.     end
  623.     bitmap
  624.   end
  625.   
  626.   #--------------------------------------------------------------------------
  627.   # start_effect
  628.   #--------------------------------------------------------------------------
  629.   def start_effect
  630.     @current_effect = @effects.shift
  631.     return dispose if @current_effect.nil?
  632.     effect = setting[:effect_setup][@current_effect]
  633.     @duration = effect[8]
  634.     #---
  635.     @zoom_x_rate = (effect[0] - self.zoom_x) / @duration
  636.     @zoom_y_rate = (effect[1] - self.zoom_y) / @duration
  637.     #---
  638.     @move_x = effect[4]
  639.     @move_y = effect[5]
  640.     if effect[9]
  641.       @move_x = @move_x * rand(0)
  642.       @move_x = rand(10) % 2 == 0 ? -@move_x : @move_x
  643.     end
  644.     #---
  645.     @gravity = effect[6]
  646.     #---
  647.     @opacity_rate = (effect[7] - self.opacity) / @duration.to_f
  648.     #---
  649.     self.x += effect[2]
  650.     self.y += effect[3]
  651.   end
  652.   
  653.   #--------------------------------------------------------------------------
  654.   # update
  655.   #--------------------------------------------------------------------------
  656.   def update
  657.     super
  658.     update_zoom
  659.     update_move
  660.     update_opacity
  661.     update_effect
  662.   end
  663.   
  664.   #--------------------------------------------------------------------------
  665.   # update_effect
  666.   #--------------------------------------------------------------------------
  667.   def update_effect
  668.     @duration -= 1
  669.     return if @duration > 0
  670.     start_effect
  671.   end
  672.   
  673.   #--------------------------------------------------------------------------
  674.   # update_zoom
  675.   #--------------------------------------------------------------------------
  676.   def update_zoom
  677.     self.zoom_x += @zoom_x_rate
  678.     self.zoom_y += @zoom_y_rate
  679.   end
  680.   
  681.   #--------------------------------------------------------------------------
  682.   # update_move
  683.   #--------------------------------------------------------------------------
  684.   def update_move
  685.     self.x += @move_x
  686.     self.y += @move_y
  687.     @move_y += @gravity
  688.   end
  689.   
  690.   #--------------------------------------------------------------------------
  691.   # update_opacity
  692.   #--------------------------------------------------------------------------
  693.   def update_opacity
  694.     self.opacity += @opacity_rate
  695.   end
  696.   
  697.   #--------------------------------------------------------------------------
  698.   # dispose
  699.   #--------------------------------------------------------------------------
  700.   def dispose
  701.     self.bitmap.dispose if self.bitmap
  702.     super
  703.   end
  704.   
  705. end # Sprite_PopupLuna

  706. #==============================================================================
  707. # ■ Window_BattleHelp
  708. #==============================================================================
  709. if $imported["YEA-BattleEngine"]
  710. class Window_BattleHelp < Window_Help
  711.   
  712.   #--------------------------------------------------------------------------
  713.   # alias method: update
  714.   #--------------------------------------------------------------------------
  715.   alias battle_luna_yea_be_update update
  716.   def update
  717.     battle_luna_yea_be_update
  718.     return unless $imported["YEA-BattleEngine"]
  719.     return unless @actor_window && @enemy_window
  720.     if !self.visible and @text != ""
  721.       @text = ""
  722.       return refresh
  723.     end
  724.     update_battler_name
  725.   end
  726.   
  727. end # Window_BattleHelp
  728. end

  729. #==============================================================================
  730. # ■ Sprite_Battler
  731. #==============================================================================

  732. class Sprite_Battler < Sprite_Base
  733.   
  734.   #--------------------------------------------------------------------------
  735.   # alias method: create_new_popup
  736.   # Compatible with YEA - Battle Engine.
  737.   #--------------------------------------------------------------------------
  738.   if $imported["YEA-BattleEngine"] && !$imported["YES-BattlePopup"]
  739.   alias battle_luna_yea_create_new_popup create_new_popup
  740.   def create_new_popup(value, rules, flags)
  741.     battle_luna_yea_create_new_popup(value, rules, flags)
  742.     @popups.each { |popup|
  743.       popup.viewport = nil
  744.       popup.z = @battler.screen_z + 1000
  745.     }
  746.   end
  747.   end
  748.   
  749. end # Sprite_Battler

  750. #==============================================================================
  751. # ■ Game_ActionResult
  752. #==============================================================================

  753. class Game_ActionResult
  754.   
  755.   #--------------------------------------------------------------------------
  756.   # alias method: clear_stored_damage
  757.   #--------------------------------------------------------------------------
  758.   alias battle_luna_yea_clear_stored_damage clear_stored_damage if $imported["YEA-BattleEngine"]
  759.   def clear_stored_damage
  760.     battle_luna_yea_clear_stored_damage unless $imported["YES-BattlePopup"]
  761.   end
  762.   
  763.   #--------------------------------------------------------------------------
  764.   # alias method: store_damage
  765.   #--------------------------------------------------------------------------
  766.   alias battle_luna_yea_store_damage store_damage if $imported["YEA-BattleEngine"]
  767.   def store_damage
  768.     battle_luna_yea_store_damage unless $imported["YES-BattlePopup"]
  769.   end
  770.   
  771.   #--------------------------------------------------------------------------
  772.   # alias method: restore_damage
  773.   #--------------------------------------------------------------------------
  774.   alias battle_luna_yea_restore_damage restore_damage if $imported["YEA-BattleEngine"]
  775.   def restore_damage
  776.     battle_luna_yea_restore_damage unless $imported["YES-BattlePopup"]
  777.   end
  778.   
  779. end # Game_ActionResult
复制代码
VA外站脚本汉化群:226308173   |    部分远古文件备份:https://wwzv.lanzoue.com/b02rac5pc  密码:acgm

Lv5.捕梦者

梦石
0
星屑
33208
在线时间
10495 小时
注册时间
2009-3-15
帖子
4756
2
发表于 2018-1-21 17:30:51 | 只看该作者
不是字体问题么?
回复 支持 反对

使用道具 举报

Lv6.析梦学徒

老鹰

梦石
40
星屑
33422
在线时间
6553 小时
注册时间
2012-5-26
帖子
3178

极短24评委极短23参与极短22参与极短21评委老司机慢点开短篇十吟唱者组别冠军开拓者剧作品鉴家

3
发表于 2018-1-21 18:21:27 | 只看该作者
43、44行的显示格式字符串,把  这个符号改一下不就行了

评分

参与人数 1+1 收起 理由
Nil2018 + 1 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
1
星屑
14504
在线时间
2086 小时
注册时间
2017-9-28
帖子
662
4
 楼主| 发表于 2018-1-21 18:27:04 | 只看该作者
百里_飞柳 发表于 2018-1-21 18:21
43、44行的显示格式字符串,把  这个符号改一下不就行了


谢谢你,原来有不能显示的东西隐藏在字符串里面了
VA外站脚本汉化群:226308173   |    部分远古文件备份:https://wwzv.lanzoue.com/b02rac5pc  密码:acgm
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-2 05:35

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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