This script improves a scrip called Combohit, i think that for xrsr cbs. I have modified it to show not only hits but the total damage accumulated.
You can ask for bugs, suggerences, compatibilitzations and any other things.
You can also get the code in this simple web. Im going to use it on now because it saves alot of time updating posts and other things. It haves all my other scripts and a few other things.
http://usuarios.multimania.es/kisap/english_list.html################################################################################
############################# 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
################################################################################
# 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
#==============================================================================
# Modifiy combat step rate command
# By gerkrt/gerrtunk
# Version: 1
# License: GPL, credits
# Date: 4/1/2011
# For the latests updates or bugs fixes of this script check here:
# http://usuarios.multimania.es/kisap/english_list.html
#==============================================================================
=begin
---------INTRODUCTION----------
This script adds a lost feature from old rpgmakers: the changue combate rate
command. It also lets you restart it.
--------INSTRUCTIONS------------
modify_step_count(new_step_count, map_id): This lets you changue the basic value
of step counts calculation. You have to pass first the new steps value.
If you dont pass a map id value it will use the map where you are.
restart_step_count(map id): This restarts the actual step count, putting it
in a similar initital value. If you dont pass a map id value it will use the
map where you are.
-Note that the script tries to save the actual steps of the player and add
that in the new step count. You can anulate that calling the restart method
before modifing it.
-The information is saved when you save the game and its permanent.
----------EXAMPLES--------------
modify_step_count (56) --> This changues the steps count of the actual map
to 56.
modify_step_count (5, 34) --> This changues the map 5 to 34 steps count.
=end
class Interpreter
#--------------------------------------------------------------------------
# * Restart Encounter Count
# alias gameplayer method and check map id
#--------------------------------------------------------------------------
# If you want to not save the actual steps, use it
def restart_step_count(map_id=-1)
# If the map id is -1, mark of actual default map, use actual map_id
if map_id == -1
map = $game_map.map_id
# If not, changue the id specified
else
map = map_id
end
# Call the real method
$game_player.restart_step_count(map)
end
#--------------------------------------------------------------------------
# * Modify Step Count
# add or update a new step count in list and call apply in gameplayer
#--------------------------------------------------------------------------
def modify_step_count(value, map_id=-1)
# If the map id is -1, mark of actual default map, use actual map_id
if map_id == -1
map = $game_map.map_id
# If not, changue the id specified
else
map = map_id
end
# Add or update value.
$game_system.moded_steps_counts[map] = value
# Apply it
$game_player.apply_step_count(value, map)
end
end
class Game_System
attr_accessor :moded_steps_counts # List of new steps counts pushed
alias gs_init_wep_msc initialize
def initialize
@moded_steps_counts = []
gs_init_wep_msc
end
end
class Game_Player
#--------------------------------------------------------------------------
# * Get Encounter Count
#--------------------------------------------------------------------------
def encounter_count
return @encounter_count
end
#--------------------------------------------------------------------------
# * Restart Encounter Count
#
#--------------------------------------------------------------------------
def restart_step_count(map)
# If exist a modified rate use it
if $game_system.moded_steps_counts[map] != nil
n = $game_system.moded_steps_counts[map]
# If not use bd one. It needs to load it.
else
bdmap = load_data(sprintf("Data/Map%03d.rxdata", map))
n = bdmap.encounter_step
end
@encounter_count = rand(n) + rand(n) + 1
end
#--------------------------------------------------------------------------
# * Apply Step Count
#--------------------------------------------------------------------------
def apply_step_count(value, map)
# First calculate the number of steps using base map/moded array - actual
# If exist a modified rate use it
if $game_system.moded_steps_counts[map] != nil
n = $game_system.moded_steps_counts[map]
# If not use bd one
else
bdmap = load_data(sprintf("Data/Map%03d.rxdata", map))
n = bdmap.encounter_step
end
# Rest it, and make that cant be negative.
c = (@encounter_count - n).abs
# Create the new count adding the actual steps
@encounter_count = rand(n) + rand(n) + 1 + c
# Make sure that its at less 0
@encounter_count.abs
end
#--------------------------------------------------------------------------
# * Make Encounter Count
# moded to check for moded steps rates
# no es reseteja cuan surts del mapa x ho pot ser x una altre cosa
#--------------------------------------------------------------------------
def make_encounter_count
# Image of two dice rolling
if $game_map.map_id != 0
# If exist a modified rate use it
if $game_system.moded_steps_counts[$game_map.map_id] != nil
n = $game_system.moded_steps_counts[$game_map.map_id]
# If not use bd one
else
n = $game_map.encounter_step
end
#p 'encounter fet, n', n
@encounter_count = rand(n) + rand(n) + 1
end
end
end