Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Script Merge Para CBS w/ HP/SP Regen

I wish legend in his own mind's Hp/SP regen Script to be merge with ParaDog's CBS. All I want is that these 2 script to work with each other.

#-------------------------------------------------
#---- Scene_Battle addon : SP/HP regeneration ----
#-------------------------------------------------
# To use this script you need to make three elements, 'SP Regeneration'
# 'HP Regeneration' and 'HP & SP Regeneration'.
# Once you've made them, add them to any equipment that you want to regenerate
# and voila! You've got regenerating equipment!
#-------------------------------------------------
# Place this script below any other Scene_Battle modifying scripts, and the
# SDK, but... of course, above Main.

class Scene_Battle
# Aliases
alias lihom_mv main_variable
alias lihom_up3bc update_phase3_basic_command
def main_variable
# Original
lihom_mv
# New
@turn = []
for turn in 0...$game_party.actors.size
@turn.push(0)
end
end
def update_phase3_basic_command
# Original
lihom_up3bc
# New
unless @active_battler == nil
@actor = @active_battler
@actor_id = @actor.id
@equipment = []
@equipment.push($data_weapons[@actor.weapon_id]) if @actor.weapon_id != 0 #Weapon
@equipment.push($data_armors[@actor.armor1_id]) if @actor.armor1_id != 0 #Shield
@equipment.push($data_armors[@actor.armor2_id]) if @actor.armor2_id != 0 #Helm
@equipment.push($data_armors[@actor.armor3_id]) if @actor.armor3_id != 0 #Body
@equipment.push($data_armors[@actor.armor4_id]) if @actor.armor4_id != 0 #Accessory
for equip in @equipment
if equip.is_a?(RPG::Armor)
if equip.guard_element_set.include?(10) # change 10 to the SP regeneration element ID
if @turn[@actor_id-1] == $game_temp.battle_turn
@actor.sp = [(@actor.sp + (@actor.maxsp * 0.1).to_i), @actor.maxsp].min if not @actor.dead?
@status_window.refresh
@turn[@actor_id-1] += 1
end
elsif equip.guard_element_set.include?(11) # change 11 to the HP regeneration element ID
if @turn[@actor_id-1] == $game_temp.battle_turn
@actor.hp = [(@actor.hp + (@actor.maxhp * 0.05).to_i), @actor.maxhp].min if not @actor.dead?
@status_window.refresh
@turn[@actor_id-1] += 1
end
elsif equip.guard_element_set.include?(12) # change 12 to the HP & SP regeneration element ID
if @turn[@actor_id-1] == $game_temp.battle_turn
@actor.hp = [(@actor.hp + (@actor.maxhp * 0.05).to_i), @actor.maxhp].min if not @actor.dead?
@actor.sp = [(@actor.sp + (@actor.maxsp * 0.1).to_i), @actor.maxsp].min if not @actor.dead?
@status_window.refresh
@turn[@actor_id-1] += 1
end
end
elsif equip.is_a?(RPG::Weapon)
if equip.element_set.include?(10) # change 10 to the SP regeneration element ID
if @turn[@actor_id-1] == $game_temp.battle_turn
@actor.sp = [(@actor.sp + (@actor.maxsp * 0.1).to_i), @actor.maxsp].min if not @actor.dead?
@status_window.refresh
@turn[@actor_id-1] += 1
end
elsif equip.element_set.include?(11) # change 11 to the HP regeneration element ID
if @turn[@actor_id-1] == $game_temp.battle_turn
@actor.hp = [(@actor.hp + (@actor.maxhp * 0.05).to_i), @actor.maxhp].min if not @actor.dead?
@status_window.refresh
@turn[@actor_id-1] += 1
end
elsif equip.element_set.include?(12) # change 12 to the HP & SP regeneration element ID
if @turn[@actor_id-1] == $game_temp.battle_turn
@actor.hp = [(@actor.hp + (@actor.maxhp * 0.05).to_i), @actor.maxhp].min if not @actor.dead?
@actor.sp = [(@actor.sp + (@actor.maxsp * 0.1).to_i), @actor.maxsp].min if not @actor.dead?
@status_window.refresh
@turn[@actor_id-1] += 1
end
end
end
end
end
end
end

and Paradog CBS
http://www.rmxp.org/forums/showthread.php?t=11443
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top