Game Development Reference
In-Depth Information
The other result is the on_battle_end method, which covers things that are resolved at the end of a battle, such as
states that expire on battle end.
def on_battle_end
@result.clear
remove_battle_states
remove_all_buffs
clear_actions
clear_tp unless preserve_tp?
appear
Tweaking the TP Preserve Methods
Now, after that is said and done, take a look at the following code for the tweaked methods that should be present
within a new script page. I commented out the lines of code that need to be removed.
class Game_Battler
def on_battle_start
# init_tp unless preserve_tp?
end
def on_battle_end
@result.clear
remove_battle_states
remove_all_buffs
clear_actions
# clear_tp unless preserve_tp?
appear
end
end
Play-test the game afterward and note the following:
Your party members start their first battle with 0 TP (
init_tp handles the randomization of TP,
but we removed it from on_battle_start ).
More important, your party members should now be able to carry over their TP from battle to
battle (as we removed clear_tp , which handles the removal of TP at the end of battle).
Pretty awesome, isn't it?
Other TP Considerations
While we're on the subject of TP, we also have the max_tp method in line 494 of Game_BattlerBase . You can increase
or decrease the maximum amount of TP that a player can stockpile. You could have skills that require more than 100
TP to use, in theory. In practice, the Database enforces the cap on TP cost of skills and TP gain from skills.
 
Search WWH ::




Custom Search