Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ################################################################################
- ############################# XRXS #############################################
- ################################################################################
- # Ativa o sistema de Combo Hit
- # Improved by gerkrt/gerrtunk.
- # Check this page for
- # Now it can show the total acumulated damage and its better to configurate
- # For the latests updates or bugs fixes of this script check here:
- # http://usuarios.multimania.es/kisap/english_list.html
- ################################################################################
- # Nota: Puedes usar valores negativos en las posiciones de las ventanas para
- # forzarlos aun mas
- # Note: You can use negative values in the windows positions to force they more.
- # Define la posicion X del texto combohit cuando el objetivo es un enemigo
- # Defines the X position of the text when the objective is an enemy.
- $window_x = 420
- # Defines the X position of the text when the objective is an actor.
- $window_actor_x = -30
- # Define the Y position of the combohit text
- $window_y = 32
- # Define the vocabulary
- $golpes_texto = 'Hits: ' # word used for the total hits
- $total_texto = 'Total: ' # word used for the total damage
- class XRXS_BP19
- COMBOHIT_DURATION = 200
- end
- class Game_Battler
- DAMAGE_INCREASE_PER_HIT = 5
- end
- class Window_ComboHit < Window_Base
- COMBOHIT_FONTNAME = "Georgia"
- COMBOHIT_FONTCOLOR = Color.new(255,255,255,255) # rgba
- end
- # Modificado para poder configurar la Y
- class Window_ComboHit < Window_Base
- def initialize
- super($window_x, $window_y, 300, 140)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.opacity = 0
- self.visible = false
- @active = false
- @show_duration = 0
- @sliding_duration = 0
- self.contents.clear
- end
- def clear
- self.contents.clear
- self.visible = false
- end
- # Modificado para que muestre el texto de daño total
- def refresh(hit_combo, duration, total_damage)
- self.contents_opacity = 255
- self.visible = true
- @show_duration = duration
- @sliding_duration = 0
- self.contents.clear
- self.contents.font.name = COMBOHIT_FONTNAME
- self.contents.font.bold = true
- text = hit_combo.to_s + " "
- self.contents.font.size = 36
- self.contents.font.color = COMBOHIT_FONTCOLOR
- text = $golpes_texto + hit_combo.to_s + " "
- self.contents.font.size = 22
- self.contents.font.color.set( 0, 0, 0, 192)
- self.contents.font.color = COMBOHIT_FONTCOLOR
- self.contents.draw_text(64, 5, 300, 32, text, 0)
- self.contents.draw_text(64, 9, 300, 64, $total_texto + total_damage.to_s, 0)
- end
- #--------------------------------------------------------------------------
- # ? ??????
- #--------------------------------------------------------------------------
- def update
- if @sliding_duration > 0
- @sliding_duration -= 1
- self.contents_opacity -= 32
- self.x += 1
- if @sliding_duration == 0
- self.visible = false
- end
- elsif @show_duration > 0
- @show_duration -= 1
- if @show_duration == 0
- @sliding_duration = 8
- end
- end
- end
- end
- #==============================================================================
- # ¦ Game_Battler
- #==============================================================================
- class Game_Battler
- alias gb_wep_init initialize
- def initialize
- @total_damage = 0
- gb_wep_init
- end
- attr_accessor :total_damage
- #--------------------------------------------------------------------------
- # ? ??????????
- #--------------------------------------------------------------------------
- def combohit
- @combohit = 0 if @combohit.nil?
- @total_damage = 0 if @combohit.nil?
- return @combohit
- end
- def combohit_duration
- @combohit_duration = 0 if @combohit_duration.nil?
- return @combohit_duration
- end
- #--------------------------------------------------------------------------
- # ? ?????????
- # moded to restart damage
- #--------------------------------------------------------------------------
- def combohit_update
- # ????
- @combohit_duration = 0 if @combohit_duration.nil?
- # ????
- if @combohit_duration > 0
- @combohit_duration -= 1
- # Here the damage is restarted
- @combohit = 0 if @combohit_duration == 0
- @total_damage = 0 if @combohit_duration == 0
- end
- end
- #--------------------------------------------------------------------------
- # ? ???????????
- # modificado para reiniciar damage count si hace falta
- #--------------------------------------------------------------------------
- def combohit_count
- # ????$damage_count = 0
- @combohit = 0 if @combohit.nil?
- #$damage_count = 0 if @combohit.nil?
- # ????
- @combohit += 1
- @combohit_duration = XRXS_BP19::COMBOHIT_DURATION
- unless @motion.nil?
- # # ??FMBS??
- @combohit_duration = @motion.knock_back_duration
- end
- end
- #--------------------------------------------------------------------------
- # ? ??????????
- # modificado para que reincie el daño total
- #--------------------------------------------------------------------------
- def combohit_clear
- @combohit = nil
- @combohit_duration = nil
- #$damage_count = 0
- @total_damage = 0
- end
- #--------------------------------------------------------------------------
- # ? ?????????
- # moded to add damage to damage total
- #--------------------------------------------------------------------------
- alias xrxs_bp19_attack_effect attack_effect
- def attack_effect(attacker)
- # ????
- bool = xrxs_bp19_attack_effect(attacker)
- # ?????( ???? & ?????? )
- if bool and self.damage.to_i > 0
- # ?????
- add_damage = self.damage * ([self.combohit * DAMAGE_INCREASE_PER_HIT,-100].max)/100
- self.hp -= add_damage
- self.damage += add_damage
- # ??????+1
- self.combohit_count
- # Add to total damage
- @total_damage += self.damage.to_i
- end
- return bool
- end
- #--------------------------------------------------------------------------
- # ? ????????
- # moded to add damage to damage total
- #--------------------------------------------------------------------------
- alias xrxs_bp19_skill_effect skill_effect
- def skill_effect(user, skill)
- # ?????????????
- if skill.power <= 0
- # ????
- return xrxs_bp19_skill_effect(user, skill)
- end
- # ?????( ????????? )
- skill = skill.dup
- skill.power = skill.power * (100 + [self.combohit * DAMAGE_INCREASE_PER_HIT,-100].max)/100
- # ????
- bool = xrxs_bp19_skill_effect(user, skill)
- #p bool
- # ?????( ???? & ?????? )
- if bool and self.damage.to_i > 0
- # ??????+1
- self.combohit_count
- # Add to total damage
- @total_damage += self.damage.to_i
- end
- return bool
- end
- #--------------------------------------------------------------------------
- # ? ?????????
- # moded to add damage to damage total
- #--------------------------------------------------------------------------
- alias xrxs_bp19_item_effect item_effect
- def item_effect(item)
- # ??????????????
- unless (item.recover_hp < 0 or item.recover_hp_rate < 0)
- # ????
- return xrxs_bp19_item_effect(item)
- end
- # ??
- item = item.dup
- # ?????
- rate = (100 + [self.combohit * DAMAGE_INCREASE_PER_HIT,-100].max)
- item.recover_hp = item.recover_hp * rate / 100
- item.recover_hp_rate = item.recover_hp_rate * rate / 100
- # ????
- bool = xrxs_bp19_item_effect(item)
- # ?????( ???? & ?????? )
- if bool and self.damage.to_i > 0
- # ??????+1
- self.combohit_count
- # Add to total damage
- @total_damage += self.damage.to_i
- end
- return bool
- end
- end
- #==============================================================================
- # ¦ Scene_Battle
- #==============================================================================
- class Scene_Battle
- #--------------------------------------------------------------------------
- # ? ?????
- #--------------------------------------------------------------------------
- alias xrxs_bp19_main main
- def main
- # ??????????????
- @combohit_window = Window_ComboHit.new
- # ????
- xrxs_bp19_main
- # ????????
- @combohit_window.dispose
- # ??????
- $game_party.actors.each {|actor| actor.combohit_clear}
- end
- #--------------------------------------------------------------------------
- # ? ??????
- #--------------------------------------------------------------------------
- alias xrxs_bp19_update update
- def update
- # ??????
- @combohit_window.update
- $game_party.actors.each {|actor| actor.combohit_update}
- $game_troop.enemies.each{|enemy| enemy.combohit_update}
- # ????
- xrxs_bp19_update
- end
- #--------------------------------------------------------------------------
- # ? ?????? (??????? ???? 5 : ??????)
- # modificado para que ponga la X del combohit de forma configurada
- #--------------------------------------------------------------------------
- alias xrxs_bp19_update_phase4_step5 update_phase4_step5
- def update_phase4_step5
- # ????
- xrxs_bp19_update_phase4_step5
- # ?????????????????
- max = 0
- hit_target = nil
- for target in @target_battlers
- if target.combohit > max
- max = target.combohit
- hit_target = target
- end
- end
- # ????? 2 ??????????????????
- if max >= 2 and !hit_target.nil?
- # When target is enemy, window to right
- # When target is actor, window to left
- @combohit_window.x = hit_target.is_a?(Game_Enemy) ? $window_x : $window_actor_x
- @combohit_window.refresh(max, hit_target.combohit_duration, hit_target.total_damage)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment