08-17-2020, 07:17 AM
KBattlePause XP
by Kyonides Arkanthes
Introduction
I've been fiddling with a new scriptlet. This one would let you fight some monsters as usual.

But I can guarantee you there's a catch!

What is it?

Your enemies
might still face you again.




Yes, the very same foes with the same stats as they had when you left them biting the dust! 

Unless you take too long to fight them letting them get fully healed.

I seriously suspect this kind of script would work best if used in boss and sub boss battles.

My script only has a single script call but you might know that using it is completely optional.
Besides I have not define a way to activate this new feature after N turns.

The Script
Code:
# * KBattlePause XP
# Scripter : Kyonides Arkanthes
# 2020-08-17 - v0.8.0
# Are you planning to make your heroes running away? You better think it twice!
# This script might not deter them from chickening out but it surely does keep
# them trapped. How is that possible!?
# Well, next time you could notice that your next normal or random encounter
# might lead you to facing the very same foes you fought against a while ago!
# Keep in mind that clock is ticking so you better face it before your foes get
# a chance to be fully healed automatically.
# This is not really a plug and play script, you do need to setup the KBPause
# module first to let it run smoothly.
# * Optional Script Call * #
# KBPause.boss_heal_timer = Time in Minutes
module KBPause
SWITCH = 1
TROOP_ID_VARIABLE = 1
ENEMIES_VARIABLE = 2
TURNS_VARIABLE = 3 # Not Implemented Yet
@boss_heal_timer = 1 # In minutes
def self.boss_heal_timer() @boss_heal_timer end
def self.boss_heal_timer=(time) @boss_heal_timer = time end
end
class Game_Troop
alias :kyon_btl_pause_gm_troop_setup :setup
def setup(troop_id)
enemies_var = $game_variables[KBPause::ENEMIES_VARIABLE]
$game_variables[KBPause::ENEMIES_VARIABLE] = 0
if $game_switches[KBPause::SWITCH]
if @battle_pause_timer == 0
$game_switches[KBPause::SWITCH] = false
troop_id = $game_variables[KBPause::TROOP_ID_VARIABLE]
$game_variables[KBPause::TROOP_ID_VARIABLE] = 0
elsif enemies_var.is_a?(Array)#and enemies_var[0].is_a?(Game_Enemy)
@enemies = enemies_var
$game_variables[KBPause::TROOP_ID_VARIABLE] = 0
$game_switches[KBPause::SWITCH] = false
return $game_temp.battle_troop_id = nil
end
end
kyon_btl_pause_gm_troop_setup(troop_id)
end
end
class Game_System
alias :kyon_btl_pause_gm_sys_init :initialize
alias :kyon_btl_pause_gm_sys_up :update
def initialize
kyon_btl_pause_gm_sys_init
@battle_pause_timer = 0
end
def update
kyon_btl_pause_gm_sys_up
return if @battle_pause_timer == 0
@battle_pause_timer -= 1
end
def reset_battle_pause_timer
@battle_pause_timer = Graphics.frame_rate * KBPause.boss_heal_timer * 60
@battle_pause_timer = @battle_pause_timer.abs
end
end
class Scene_Battle
alias :kyon_btl_pause_scn_btl_blt_end :battle_end
def battle_end(result)
if $game_switches[KBPause::SWITCH] and result == 1
$game_variables[KBPause::TROOP_ID_VARIABLE] = $game_temp.battle_troop_id
$game_variables[KBPause::ENEMIES_VARIABLE] = $game_troop.enemies
$game_system.reset_battle_pause_timer
end
kyon_btl_pause_scn_btl_blt_end(result)
end
end
Terms & Conditions & Oddities
Free for use in any game.
Include me in your game credits.
Mention this forum as well.
Send me a free copy of your finished game if you include 2 or more of my scripts in your project.