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

Project1

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

[已经解决] 请问如何修改伤害显示脚本中的字体?

[复制链接]

Lv4.逐梦者

梦石
1
星屑
5149
在线时间
1004 小时
注册时间
2012-5-14
帖子
69

开拓者

跳转到指定楼层
1
发表于 2016-3-18 23:42:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
求到了一个VA的伤害显示脚本,但是伤害显示的字体和我系统字体不一样,感觉这个伤害显示的字体不是很好看,想改成系统用的字体,请问怎么修改法?


RUBY 代码复制
  1. $imported = {} if $imported.nil?
  2. $imported["YES-BattlePopup"] = true
  3.  
  4. #==============================================================================
  5. # ■ BattleLuna
  6. #==============================================================================
  7.  
  8. module BattleLuna
  9.   module Addon
  10.  
  11.     BATTLE_POPUP = {
  12.       # Basic Configuration.
  13.       :basic_setting  =>  {
  14.         :enable      =>  true,       # Set to false to disable popup.
  15.         :state_popup =>  true,       # Set to false to disable state popup.
  16.         :buff_popup  =>  true,       # Set to false to disable buff popup.
  17.         :delay       =>  4,          # Delay between each popup.
  18.         :no_delay    =>  [:critical, :drained, :weakpoint, :resistant, :absorbed],
  19.       },
  20.  
  21.       # Configuration for words.
  22.       :word_setting   =>  {
  23.         :default    => "%s",        # SprintF for Default.
  24.         :hp_dmg     => "-%s ",      # SprintF for HP damage.
  25.         :hp_heal    => "+%s ",      # SprintF for HP healing.
  26.         :mp_dmg     => "-%s MP",    # SprintF for MP damage.
  27.         :mp_heal    => "+%s MP",    # SprintF for MP healing.
  28.         :tp_dmg     => "-%s CP",    # SprintF for MP damage.
  29.         :tp_heal    => "+%s CP",    # SprintF for MP healing.
  30.         :drained    => "吸收",     # Text display for draining HP/MP.
  31.         :critical   => "要害!", # Text display for critical hit.
  32.         :missed     => "未命中",      # Text display for missed attack.
  33.         :evaded     => "避开!",    # Text display for evaded attack.
  34.         :nulled     => "格挡",      # Text display for nulled attack.
  35.         :failed     => "失败",    # Text display for a failed attack.
  36.         :add_state  => "+%s",       # SprintF for added states.
  37.         :rem_state  => "-%s",       # SprintF for removed states.
  38.         :dur_state  => "%s",        # SprintF for during states.
  39.         :weakpoint  => "弱点", # Appears if foe is weak to element.
  40.         :resistant  => "抵抗",    # Appears if foe is resistant to element.
  41.         :immune     => "免疫",    # Appears if foe is immune to element.
  42.         :absorbed   => "吸收",    # Appears if foe can absorb the element.
  43.         :add_buff   => "%s",        # Appears when a positive buff is applied.
  44.         :add_debuff => "%s",        # Appears when a negative buff is applied.
  45.       },
  46.  
  47.       # Configuration for popup visual.
  48.       :style_setting  =>  {
  49.         # Type      => [Red, Green, Blue, Size, Bold, Italic, Font],
  50.         :default    => [255,   255,  255,   20, true,  false, Font.default_name],
  51.         :hp_dmg     => [246,   255,  0,   30, true,  false, Font.default_name],
  52.         :hp_heal    => [93,   255,  108,   20, true,  false, Font.default_name],
  53.         :mp_dmg     => [213,   46,  255,   20, true,  false, Font.default_name],
  54.         :mp_heal    => [0,   150,  255,   20, true,  false, Font.default_name],
  55.         :tp_dmg     => [255,   255,  255,   20, true,  false, Font.default_name],
  56.         :tp_heal    => [255,   255,  255,   20, true,  false, Font.default_name],
  57.         :drained    => [255,   255,  255,   20, true,  false, Font.default_name],
  58.         :critical   => [255,   174,  0,   40, true,  false, Font.default_name],
  59.         :missed     => [255,   255,  255,   20, true,  false, Font.default_name],
  60.         :evaded     => [255,   255,  255,   20, true,  false, Font.default_name],
  61.         :nulled     => [255,   255,  255,   20, true,  false, Font.default_name],
  62.         :failed     => [255,   255,  255,   20, true,  false, Font.default_name],
  63.         :add_state  => [255,   120,  0,   20, true,  false, Font.default_name],
  64.         :rem_state  => [255,   120,  0,   20, true,  false, Font.default_name],
  65.         :dur_state  => [255,   120,  0,   20, true,  false, Font.default_name],
  66.         :weakpoint  => [255,   0,  0,   20, true,  false, Font.default_name],
  67.         :resistant  => [255,   212,  238,   20, true,  false, Font.default_name],
  68.         :immune     => [207,   207,  207,   30, true,  false, Font.default_name],
  69.         :absorbed   => [255,   255,  255,   20, true,  false, Font.default_name],
  70.         :add_buff   => [216,   129,  166,   20, true,  false, Font.default_name],
  71.         :add_debuff => [216,   129,  166,   20, true,  false, Font.default_name],
  72.         :lvup       => [186,   255,  0,   20, false, false, Font.default_name],
  73.       },
  74.  
  75.       # Configuration for popup effect.
  76.       :effect_setting =>  {
  77.         # Type      => [Effect sequence],
  78.         :default    => [:up, :wait],
  79.         :hp_dmg     => [:jump_1, :jump_2, :wait],
  80.         :hp_heal    => [:jump_1, :jump_2, :wait],
  81.         :mp_dmg     => [:jump_1, :jump_2, :wait],
  82.         :mp_heal    => [:jump_1, :jump_2, :wait],
  83.         :tp_dmg     => [:jump_1, :jump_2, :wait],
  84.         :tp_heal    => [:jump_1, :jump_2, :wait],
  85.         :drained    => [:affect, :up    , :wait],
  86.         :critical   => [:affect, :up    , :wait],
  87.         :missed     => [:up    , :wait],
  88.         :evaded     => [:up    , :wait],
  89.         :nulled     => [:up    , :wait],
  90.         :failed     => [:up    , :wait],
  91.         :add_state  => [:affect, :up    , :wait],
  92.         :rem_state  => [:affect, :up    , :wait],
  93.         :dur_state  => [:affect, :up    , :wait],
  94.         :weakpoint  => [:affect, :up    , :wait],
  95.         :resistant  => [:affect, :up    , :wait],
  96.         :immune     => [:up    , :wait],
  97.         :absorbed   => [:affect, :up    , :wait],
  98.         :add_buff   => [:affect, :up    , :wait],
  99.         :add_debuff => [:affect, :up    , :wait],
  100.         :lvup       => [:up, :wait],
  101.       },
  102.  
  103.       :effect_setup   =>  {
  104.         #:type   => [ZoomX, ZoomY, StartX, StartY, MoveX, MoveY, Gravt, Opacity, Dur, Random],
  105.         :up      => [1.0  , 1.0  , 0.0   , 0.0   , 0.0  , -1.0 , 0.0  , 255    , 32 , false ],
  106.         :jump_1  => [1.0  , 1.0  , 0.0   , 0.0   , 0.0  , -6.4 , 0.4  , 255    , 33 , false ],
  107.         :jump_2  => [1.0  , 1.0  , 0.0   , 0.0   , 0.0  , -3.2 , 0.2  , 255    , 33 , false ],
  108.         :wait    => [1.0  , 1.0  , 0.0   , 0.0   , 0.0  , 0.0  , 0.0  , 0      , 20 , false ],
  109.         :affect  => [1.0  , 1.0  , 0.0   , -32.0 , 0.0  , 0.0  , 0.0  , 255    , 1  , false ],
  110.       },
  111.  
  112.     } # End BATTLE_POPUP.
  113.  
  114.   end # Addon
  115. end # BattleLuna
  116.  
  117. #==============================================================================
  118. # ■ Game_BattlerBase
  119. #==============================================================================
  120.  
  121. class Game_BattlerBase
  122.  
  123.   #--------------------------------------------------------------------------
  124.   # * Public Instance Variables
  125.   #--------------------------------------------------------------------------
  126.   attr_accessor :popups
  127.  
  128.   #--------------------------------------------------------------------------
  129.   # new method: create_popup
  130.   #--------------------------------------------------------------------------
  131.   def create_popup(data, rule = :default)
  132.     return unless SceneManager.scene_is?(Scene_Battle)
  133.     return unless BattleLuna::Addon::BATTLE_POPUP[:basic_setting][:enable]
  134.     @popups ||= []
  135.     @popups.push([data, rule])
  136.   end
  137.  
  138.   #--------------------------------------------------------------------------
  139.   # new method: make_damage_popups
  140.   #--------------------------------------------------------------------------
  141.   def make_damage_popups(user)
  142.     if @result.hp_drain != 0
  143.       rule = :drained
  144.       user.create_popup(["", nil], rule)
  145.       rule = :hp_dmg  if @result.hp_drain < 0
  146.       rule = :hp_heal if @result.hp_drain > 0
  147.       value = @result.hp_drain.abs
  148.       user.create_popup(["#{value}", nil], rule)
  149.     end
  150.     if @result.mp_drain != 0
  151.       rule = :drained
  152.       user.create_popup(["", nil], rule)
  153.       rule = :mp_dmg  if @result.mp_drain < 0
  154.       rule = :mp_heal if @result.mp_drain > 0
  155.       value = @result.mp_drain.abs
  156.       user.create_popup(["#{value}", nil], rule)
  157.     end
  158.     #---
  159.     rule = :critical
  160.     create_popup(["", nil], rule) if @result.critical
  161.     if @result.hp_damage != 0
  162.       rule = :hp_dmg  if @result.hp_damage > 0
  163.       rule = :hp_heal if @result.hp_damage < 0
  164.       value = @result.hp_damage.abs
  165.       create_popup(["#{value}", nil], rule)
  166.     end
  167.     if @result.mp_damage != 0
  168.       rule = :mp_dmg  if @result.mp_damage > 0
  169.       rule = :mp_heal if @result.mp_damage < 0
  170.       value = @result.mp_damage.abs
  171.       create_popup(["#{value}", nil], rule)
  172.     end
  173.     if @result.tp_damage != 0
  174.       rule = :tp_dmg  if @result.tp_damage > 0
  175.       rule = :tp_heal if @result.tp_damage < 0
  176.       value = @result.tp_damage.abs
  177.       create_popup(["#{value}", nil], rule)
  178.     end
  179.   end
  180.  
  181.   #--------------------------------------------------------------------------
  182.   # alias method: erase_state
  183.   #--------------------------------------------------------------------------
  184.   alias battle_luna_dp_erase_state erase_state unless $imported["YEA-BattleEngine"]
  185.   def erase_state(state_id)
  186.     make_state_popup(state_id, :rem_state) if @states.include?(state_id)
  187.     if $imported["YEA-BattleEngine"]
  188.       game_battlerbase_erase_state_abe(state_id)
  189.     else
  190.       battle_luna_dp_erase_state(state_id)
  191.     end
  192.   end
  193.  
  194.   #--------------------------------------------------------------------------
  195.   # new method: make_during_state_popup
  196.   #--------------------------------------------------------------------------
  197.   def make_during_state_popup
  198.     state_id = most_important_state_id
  199.     return if state_id == 0
  200.     make_state_popup(state_id, :dur_state)
  201.   end
  202.  
  203.   #--------------------------------------------------------------------------
  204.   # new method: most_important_state_id
  205.   #--------------------------------------------------------------------------
  206.   def most_important_state_id
  207.     states.each {|state| return state.id unless state.message3.empty? }
  208.     return 0
  209.   end
  210.  
  211.   #--------------------------------------------------------------------------
  212.   # new method: make_state_popup
  213.   #--------------------------------------------------------------------------
  214.   def make_state_popup(state_id, type)
  215.     return unless BattleLuna::Addon::BATTLE_POPUP[:basic_setting][:state_popup]
  216.     state = $data_states[state_id]
  217.     return if state.icon_index == 0
  218.     create_popup(["#{state.name}", state.icon_index], type)
  219.   end
  220.  
  221.   #--------------------------------------------------------------------------
  222.   # new method: make_miss_popups
  223.   #--------------------------------------------------------------------------
  224.   def make_miss_popups(user, item)
  225.     return if dead?
  226.     if @result.missed
  227.       rule = :missed
  228.       create_popup(["", nil], rule)
  229.     end
  230.     if @result.evaded
  231.       rule = :evaded
  232.       create_popup(["", nil], rule)
  233.     end
  234.     if @result.hit? && !@result.success
  235.       rule = :failed
  236.       create_popup(["", nil], rule)
  237.     end
  238.     if @result.hit? && item.damage.to_hp?
  239.       if @result.hp_damage == 0 && @result.mp_damage == 0
  240.         rule = :nulled
  241.         create_popup(["", nil], rule)
  242.       end
  243.     end
  244.   end
  245.  
  246.   #--------------------------------------------------------------------------
  247.   # new method: make_rate_popup
  248.   #--------------------------------------------------------------------------
  249.   def make_rate_popup(rate)
  250.     return if rate == 1.0
  251.     if rate > 1.0
  252.       rule = :weakpoint
  253.     elsif rate == 0.0
  254.       rule = :immune
  255.     elsif rate < 0.0
  256.       rule = :absorbed
  257.     else
  258.       rule = :resistant
  259.     end
  260.     create_popup(["", nil], rule)
  261.   end
  262.  
  263.   #--------------------------------------------------------------------------
  264.   # new method: make_buff_popup
  265.   #--------------------------------------------------------------------------
  266.   def make_buff_popup(param_id, positive = true)
  267.     return unless BattleLuna::Addon::BATTLE_POPUP[:basic_setting][:buff_popup]
  268.     return unless SceneManager.scene_is?(Scene_Battle)
  269.     return unless alive?
  270.     name = Vocab::param(param_id)
  271.     if positive
  272.       rule = :add_buff
  273.       buff_level = 1
  274.     else
  275.       rule = :add_debuff
  276.       buff_level = -1
  277.     end
  278.     icon = buff_icon_index(buff_level, param_id)
  279.     create_popup(["#{name}", icon], rule)
  280.   end
  281.  
  282. end # Game_BattlerBase
  283.  
  284. #==============================================================================
  285. # ■ Game_Battler
  286. #==============================================================================
  287.  
  288. class Game_Battler < Game_BattlerBase
  289.  
  290.   #--------------------------------------------------------------------------
  291.   # alias method: on_battle_end
  292.   #--------------------------------------------------------------------------
  293.   alias battle_luna_dp_on_battle_end on_battle_end
  294.   def on_battle_end
  295.     battle_luna_dp_on_battle_end
  296.     @popups ||= []
  297.     @popups.clear
  298.   end
  299.  
  300.   #--------------------------------------------------------------------------
  301.   # alias method: item_apply
  302.   #--------------------------------------------------------------------------
  303.   alias battle_luna_dp_item_apply item_apply unless $imported["YEA-BattleEngine"]
  304.   def item_apply(user, item)
  305.     if $imported["YEA-BattleEngine"]
  306.       game_battler_item_apply_abe(user, item)
  307.     else
  308.       battle_luna_dp_item_apply(user, item)
  309.     end   
  310.     @result.restore_damage
  311.     make_miss_popups(user, item)
  312.     make_damage_popups(user)
  313.   end
  314.  
  315.   #--------------------------------------------------------------------------
  316.   # alias method: make_damage_value
  317.   #--------------------------------------------------------------------------
  318.   alias battle_luna_dp_make_damage_value make_damage_value unless $imported["YEA-BattleEngine"]
  319.   def make_damage_value(user, item)
  320.     if $imported["YEA-BattleEngine"]
  321.       game_battler_make_damage_value_abe(user, item)
  322.     else
  323.       battle_luna_dp_make_damage_value(user, item)
  324.     end   
  325.     rate = item_element_rate(user, item)
  326.     make_rate_popup(rate)
  327.   end
  328.  
  329.   #--------------------------------------------------------------------------
  330.   # alias method: execute_damage
  331.   #--------------------------------------------------------------------------
  332.   alias battle_luna_dp_execute_damage execute_damage unless $imported["YEA-BattleEngine"]
  333.   def execute_damage(user)
  334.     if $imported["YEA-BattleEngine"]
  335.       game_battler_execute_damage_abe(user)
  336.     else
  337.       battle_luna_dp_execute_damage(user)
  338.     end   
  339.     #make_damage_popups(user)
  340.   end
  341.  
  342.   #--------------------------------------------------------------------------
  343.   # alias method: item_effect_recover_hp
  344.   #--------------------------------------------------------------------------
  345.   alias battle_luna_dp_item_effect_recover_hp item_effect_recover_hp unless $imported["YEA-BattleEngine"]
  346.   def item_effect_recover_hp(user, item, effect)
  347.     if $imported["YEA-BattleEngine"]
  348.       game_battler_item_effect_recover_hp_abe(user, item, effect)
  349.     else
  350.       battle_luna_dp_item_effect_recover_hp(user, item, effect)
  351.     end   
  352.     #make_damage_popups(user)
  353.   end
  354.  
  355.   #--------------------------------------------------------------------------
  356.   # alias method: item_effect_recover_mp
  357.   #--------------------------------------------------------------------------
  358.   alias battle_luna_item_effect_recover_mp item_effect_recover_mp unless $imported["YEA-BattleEngine"]
  359.   def item_effect_recover_mp(user, item, effect)
  360.     if $imported["YEA-BattleEngine"]
  361.       game_battler_item_effect_recover_mp_abe(user, item, effect)
  362.     else
  363.       battle_luna_item_effect_recover_mp(user, item, effect)
  364.     end  
  365.     #make_damage_popups(user)
  366.   end
  367.  
  368.   #--------------------------------------------------------------------------
  369.   # alias method: item_effect_gain_tp
  370.   #--------------------------------------------------------------------------
  371.   alias battle_luna_item_effect_gain_tp item_effect_gain_tp unless $imported["YEA-BattleEngine"]
  372.   def item_effect_gain_tp(user, item, effect)
  373.     if $imported["YEA-BattleEngine"]
  374.       game_battler_item_effect_gain_tp_abe(user, item, effect)
  375.     else
  376.       battle_luna_item_effect_gain_tp(user, item, effect)
  377.     end  
  378.     #make_damage_popups(user)
  379.   end
  380.  
  381.   #--------------------------------------------------------------------------
  382.   # alias method: add_new_state
  383.   #--------------------------------------------------------------------------
  384.   alias battle_luna_dp_add_new_state add_new_state unless $imported["YEA-BattleEngine"]
  385.   def add_new_state(state_id)
  386.     if $imported["YEA-BattleEngine"]
  387.       game_battler_add_new_state_abe(state_id)
  388.     else
  389.       battle_luna_dp_add_new_state(state_id)
  390.     end  
  391.     make_state_popup(state_id, :add_state) if @states.include?(state_id)
  392.   end
  393.  
  394.   #--------------------------------------------------------------------------
  395.   # alias method: add_buff
  396.   #--------------------------------------------------------------------------
  397.   alias battle_luna_dp_add_buff add_buff unless $imported["YEA-BattleEngine"]
  398.   def add_buff(param_id, turns)
  399.     make_buff_popup(param_id, true)
  400.     if $imported["YEA-BattleEngine"]
  401.       game_battler_add_buff_abe(param_id, turns)
  402.     else
  403.       battle_luna_dp_add_buff(param_id, turns)
  404.     end  
  405.   end
  406.  
  407.   #--------------------------------------------------------------------------
  408.   # alias method: add_debuff
  409.   #--------------------------------------------------------------------------
  410.   alias battle_luna_dp_add_debuff add_debuff unless $imported["YEA-BattleEngine"]
  411.   def add_debuff(param_id, turns)
  412.     make_buff_popup(param_id, false)
  413.     if $imported["YEA-BattleEngine"]
  414.       game_battler_add_debuff_abe(param_id, turns)
  415.     else
  416.       battle_luna_dp_add_debuff(param_id, turns)
  417.     end  
  418.   end
  419.  
  420.   #--------------------------------------------------------------------------
  421.   # alias method: regenerate_all
  422.   #--------------------------------------------------------------------------
  423.   alias battle_luna_dp_regenerate_all regenerate_all unless $imported["YEA-BattleEngine"]
  424.   def regenerate_all
  425.     if $imported["YEA-BattleEngine"]
  426.       game_battler_regenerate_all_abe
  427.     else
  428.       battle_luna_dp_regenerate_all
  429.     end  
  430.     return unless alive?
  431.     make_damage_popups(self)
  432.   end
  433.  
  434. end # Game_Battler
  435.  
  436. #==============================================================================
  437. # ■ Sprite_Battler
  438. #==============================================================================
  439.  
  440. class Game_Actor < Game_Battler
  441.  
  442.   #--------------------------------------------------------------------------
  443.   # new method: screen_x
  444.   #--------------------------------------------------------------------------
  445.   unless Game_Actor.instance_methods.include?(:screen_x)
  446.   def screen_x
  447.     0
  448.   end
  449.   end
  450.  
  451.   #--------------------------------------------------------------------------
  452.   # new method: screen_y
  453.   #--------------------------------------------------------------------------
  454.   unless Game_Actor.instance_methods.include?(:screen_y)
  455.   def screen_y
  456.     0
  457.   end
  458.   end
  459.  
  460.   #--------------------------------------------------------------------------
  461.   # new method: screen_z
  462.   #--------------------------------------------------------------------------
  463.   unless Game_Actor.instance_methods.include?(:screen_z)
  464.   def screen_y
  465.     0
  466.   end
  467.   end
  468.  
  469. end # Game_Actor
  470.  
  471. #==============================================================================
  472. # ■ Sprite_Battler
  473. #==============================================================================
  474.  
  475. class Sprite_Battler < Sprite_Base
  476.  
  477.   #--------------------------------------------------------------------------
  478.   # alias method: initialize
  479.   #--------------------------------------------------------------------------
  480.   alias battle_luna_dp_initialize initialize
  481.   def initialize(viewport, battler = nil)
  482.     battle_luna_dp_initialize(viewport, battler)
  483.     @popups = []
  484.     @popup_delay = 0
  485.   end
  486.  
  487.   #--------------------------------------------------------------------------
  488.   # alias method: setup_new_effect
  489.   #--------------------------------------------------------------------------
  490.   alias battle_luna_dp_setup_new_effect setup_new_effect
  491.   def setup_new_effect
  492.     battle_luna_dp_setup_new_effect
  493.     setup_popups
  494.   end
  495.  
  496.   #--------------------------------------------------------------------------
  497.   # new method: setup_popups
  498.   #--------------------------------------------------------------------------
  499.   def setup_popups
  500.     setting = BattleLuna::Addon::BATTLE_POPUP
  501.     return unless @battler.use_sprite?
  502.     @battler.popups ||= []
  503.     @popup_delay -= 1
  504.     return if @popup_delay > 0
  505.     array = @battler.popups.shift
  506.     return if array.nil?
  507.     create_new_popup(array[0], array[1])
  508.     return if @battler.popups.size == 0
  509.     return if setting[:basic_setting][:no_delay].include?(array[1])
  510.     @popup_delay = setting[:basic_setting][:delay]
  511.   end
  512.  
  513.   #--------------------------------------------------------------------------
  514.   # new method: create_new_popup
  515.   #--------------------------------------------------------------------------
  516.   def create_new_popup(data, rule)
  517.     return unless @battler
  518.     return unless SceneManager.scene.is_a?(Scene_Battle)
  519.     viewport = self.viewport
  520.     popup = Sprite_PopupLuna.new(viewport, @battler, data, rule)
  521.     @popups.push(popup)
  522.   end
  523.  
  524.   #--------------------------------------------------------------------------
  525.   # alias method: update
  526.   #--------------------------------------------------------------------------
  527.   alias battle_luna_dp_update update
  528.   def update
  529.     battle_luna_dp_update
  530.     update_popups
  531.   end
  532.  
  533.   #--------------------------------------------------------------------------
  534.   # new method: update_popups
  535.   #--------------------------------------------------------------------------
  536.   def update_popups
  537.     @popups.each { |popup| popup.update }
  538.     @popups.each_with_index { |sprite, index|
  539.       next unless sprite.disposed?
  540.       @popups[index] = nil
  541.     }
  542.     @popups.compact!
  543.   end
  544.  
  545.   #--------------------------------------------------------------------------
  546.   # alias method: dispose
  547.   #--------------------------------------------------------------------------
  548.   alias battle_luna_dp_dispose dispose
  549.   def dispose
  550.     @popups.each { |popup| popup.dispose }
  551.     @popups.clear
  552.     battle_luna_dp_dispose
  553.   end
  554.  
  555. end # Sprite_Battler
  556.  
  557. #==============================================================================
  558. # ■ Sprite_PopupLuna
  559. #==============================================================================
  560.  
  561. class Sprite_PopupLuna < Sprite
  562.  
  563.   #--------------------------------------------------------------------------
  564.   # initialize
  565.   #--------------------------------------------------------------------------
  566.   def initialize(viewport, battler, data, rule)
  567.     super(viewport)
  568.     @data = data
  569.     @rule = rule
  570.     #---
  571.     @style = rule
  572.     @style = :default unless setting[:style_setting].has_key?(@style)
  573.     @style = setting[:style_setting][@style]
  574.     #---
  575.     @effects = rule
  576.     @effects = :default unless setting[:effect_setting].has_key?(@effects)
  577.     @effects = setting[:effect_setting][@effects].dup
  578.     #---
  579.     @current_effect = nil
  580.     @duration = 0
  581.     @battler = battler
  582.     #---
  583.     start_popup
  584.     start_effect
  585.     update
  586.   end
  587.  
  588.   #--------------------------------------------------------------------------
  589.   # setting
  590.   #--------------------------------------------------------------------------
  591.   def setting
  592.     BattleLuna::Addon::BATTLE_POPUP
  593.   end
  594.  
  595.   #--------------------------------------------------------------------------
  596.   # start_popup
  597.   #--------------------------------------------------------------------------
  598.   def start_popup
  599.     self.bitmap = create_bitmap
  600.     self.x = @battler.screen_x
  601.     self.y = @battler.screen_y
  602.     self.ox = self.bitmap.width / 2
  603.     self.oy = self.bitmap.height
  604.     self.z = @battler.screen_z + 350
  605.   end
  606.  
  607.   #--------------------------------------------------------------------------
  608.   # create_bitmap
  609.   #--------------------------------------------------------------------------
  610.   def create_bitmap
  611.     bw = Graphics.width
  612.     bw = bw + 48 if @data[1]
  613.     bh = @style[3] * 2
  614.     bitmap = Bitmap.new(bw, bh)
  615.     #---
  616.     bitmap.font.color.set(@style[0], @style[1], @style[2])
  617.     bitmap.font.size   = @style[3]
  618.     bitmap.font.bold   = @style[4]
  619.     bitmap.font.italic = @style[5]
  620.     bitmap.font.name   = @style[6]
  621.     #---
  622.     dx = @data[1] ? 24 : 0; dy = 0
  623.     text = setting[:word_setting][@rule]
  624.     text = setting[:word_setting][:default] unless text
  625.     text = sprintf(text, @data[0])
  626.     bitmap.draw_text(dx, dy, bw - dx, bh, text, 1)
  627.     #---
  628.     text_width = bitmap.text_size(text).width
  629.     if @data[1]
  630.       icon_bitmap = Cache.system("Iconset")
  631.       icon_index = @data[1].to_i
  632.       rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  633.       bitmap.blt((bw-text_width)/2-32, (bh - 24)/2, icon_bitmap, rect)
  634.     end
  635.     bitmap
  636.   end
  637.  
  638.   #--------------------------------------------------------------------------
  639.   # start_effect
  640.   #--------------------------------------------------------------------------
  641.   def start_effect
  642.     @current_effect = @effects.shift
  643.     return dispose if @current_effect.nil?
  644.     effect = setting[:effect_setup][@current_effect]
  645.     @duration = effect[8]
  646.     #---
  647.     @zoom_x_rate = (effect[0] - self.zoom_x) / @duration
  648.     @zoom_y_rate = (effect[1] - self.zoom_y) / @duration
  649.     #---
  650.     @move_x = effect[4]
  651.     @move_y = effect[5]
  652.     if effect[9]
  653.       @move_x = @move_x * rand(0)
  654.       @move_x = rand(10) % 2 == 0 ? -@move_x : @move_x
  655.     end
  656.     #---
  657.     @gravity = effect[6]
  658.     #---
  659.     @opacity_rate = (effect[7] - self.opacity) / @duration.to_f
  660.     #---
  661.     self.x += effect[2]
  662.     self.y += effect[3]
  663.   end
  664.  
  665.   #--------------------------------------------------------------------------
  666.   # update
  667.   #--------------------------------------------------------------------------
  668.   def update
  669.     super
  670.     update_zoom
  671.     update_move
  672.     update_opacity
  673.     update_effect
  674.   end
  675.  
  676.   #--------------------------------------------------------------------------
  677.   # update_effect
  678.   #--------------------------------------------------------------------------
  679.   def update_effect
  680.     @duration -= 1
  681.     return if @duration > 0
  682.     start_effect
  683.   end
  684.  
  685.   #--------------------------------------------------------------------------
  686.   # update_zoom
  687.   #--------------------------------------------------------------------------
  688.   def update_zoom
  689.     self.zoom_x += @zoom_x_rate
  690.     self.zoom_y += @zoom_y_rate
  691.   end
  692.  
  693.   #--------------------------------------------------------------------------
  694.   # update_move
  695.   #--------------------------------------------------------------------------
  696.   def update_move
  697.     self.x += @move_x
  698.     self.y += @move_y
  699.     @move_y += @gravity
  700.   end
  701.  
  702.   #--------------------------------------------------------------------------
  703.   # update_opacity
  704.   #--------------------------------------------------------------------------
  705.   def update_opacity
  706.     self.opacity += @opacity_rate
  707.   end
  708.  
  709.   #--------------------------------------------------------------------------
  710.   # dispose
  711.   #--------------------------------------------------------------------------
  712.   def dispose
  713.     self.bitmap.dispose if self.bitmap
  714.     super
  715.   end
  716.  
  717. end # Sprite_PopupLuna
  718.  
  719. #==============================================================================
  720. # ■ Window_BattleHelp
  721. #==============================================================================
  722. if $imported["YEA-BattleEngine"]
  723. class Window_BattleHelp < Window_Help
  724.  
  725.   #--------------------------------------------------------------------------
  726.   # alias method: update
  727.   #--------------------------------------------------------------------------
  728.   alias battle_luna_yea_be_update update
  729.   def update
  730.     battle_luna_yea_be_update
  731.     return unless $imported["YEA-BattleEngine"]
  732.     return unless @actor_window && @enemy_window
  733.     if !self.visible and @text != ""
  734.       @text = ""
  735.       return refresh
  736.     end
  737.     update_battler_name
  738.   end
  739.  
  740. end # Window_BattleHelp
  741. end
  742.  
  743. #==============================================================================
  744. # ■ Sprite_Battler
  745. #==============================================================================
  746.  
  747. class Sprite_Battler < Sprite_Base
  748.  
  749.   #--------------------------------------------------------------------------
  750.   # alias method: create_new_popup
  751.   # Compatible with YEA - Battle Engine.
  752.   #--------------------------------------------------------------------------
  753.   if $imported["YEA-BattleEngine"] && !$imported["YES-BattlePopup"]
  754.   alias battle_luna_yea_create_new_popup create_new_popup
  755.   def create_new_popup(value, rules, flags)
  756.     battle_luna_yea_create_new_popup(value, rules, flags)
  757.     @popups.each { |popup|
  758.       popup.viewport = nil
  759.       popup.z = @battler.screen_z + 1000
  760.     }
  761.   end
  762.   end
  763.  
  764. end # Sprite_Battler
  765.  
  766. #==============================================================================
  767. # ■ Game_ActionResult
  768. #==============================================================================
  769.  
  770. class Game_ActionResult
  771.  
  772.   #--------------------------------------------------------------------------
  773.   # alias method: clear_stored_damage
  774.   #--------------------------------------------------------------------------
  775.   alias battle_luna_yea_clear_stored_damage clear_stored_damage if $imported["YEA-BattleEngine"]
  776.   def clear_stored_damage
  777.     battle_luna_yea_clear_stored_damage unless $imported["YES-BattlePopup"]
  778.   end
  779.  
  780.   #--------------------------------------------------------------------------
  781.   # alias method: store_damage
  782.   #--------------------------------------------------------------------------
  783.   alias battle_luna_yea_store_damage store_damage if $imported["YEA-BattleEngine"]
  784.   def store_damage
  785.     battle_luna_yea_store_damage unless $imported["YES-BattlePopup"]
  786.   end
  787.  
  788.   #--------------------------------------------------------------------------
  789.   # alias method: restore_damage
  790.   #--------------------------------------------------------------------------
  791.   alias battle_luna_yea_restore_damage restore_damage if $imported["YEA-BattleEngine"]
  792.   def restore_damage
  793.     battle_luna_yea_restore_damage unless $imported["YES-BattlePopup"]
  794.   end
  795.  
  796. end # Game_ActionResult

Lv1.梦旅人

梦石
0
星屑
50
在线时间
106 小时
注册时间
2011-9-26
帖子
23
2
发表于 2016-3-19 07:09:41 | 只看该作者
比如51行改为
:hp_dmg     => [246,   255,  0,   30, true,  false, “黑体”],
“”里的字体改为你想改并电脑里有的字体

评分

参与人数 1梦石 +1 收起 理由
丿梁丶小柒 + 1 认可答案

查看全部评分

回复 支持 0 反对 1

使用道具 举报

Lv4.逐梦者

梦石
1
星屑
5149
在线时间
1004 小时
注册时间
2012-5-14
帖子
69

开拓者

3
 楼主| 发表于 2016-3-19 12:55:14 | 只看该作者
xiaox0099 发表于 2016-3-19 07:09
比如51行改为
:hp_dmg     => [246,   255,  0,   30, true,  false, “黑体”],
“”里的字体改为你想改并 ...

非常感谢!托你的福,这几天解决了好几个问题了。
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-6-18 00:57

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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