Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin =========================================================================
- Dekita's v1.0
- ★ TP Limit Breaker™ ★
- ================================================================================
- Script Information:
- ====================
- Simple script to allow for higher TP than normally allowed, e.g 1,000,000 tp.
- ================================================================================
- FEATURES:
- ==========
- - Big Numbers ^_^
- ================================================================================
- ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
- ================================================================================
- 1. You must give credit to "Dekita"
- 2. You are NOT allowed to repost this script.(or modified versions)
- 3. You are NOT allowed to convert this script.(into other game engines e.g RGSS2)
- 4. You are NOT allowed to use this script for Commercial games.
- 5. ENJOY!
- "FINE PRINT"
- By using this script you hereby agree to the above terms and conditions,
- if any violation of the above terms occurs "legal action" may be taken.
- Not understanding the above terms and conditions does NOT mean that
- they do not apply to you.
- If you wish to discuss the terms and conditions in further detail you can
- contact me at http://dekitarpg.wordpress.com/ or DekitaRPG@gmail.com
- ================================================================================
- History:
- =========
- D /M /Y
- 11/10/2o12 - Started and finished.
- ================================================================================
- INSTRUCTIONS:
- ==============
- Place this script UNDER "▼ Materials" and ABOVE "▼ Main" in your script editor.
- REQUIRES Dekita__CORE, place this below the core script.
- ================================================================================
- Notetags:
- ==========
- <inc tp: X>
- X = a value
- give this notetag to equipment to increase maximum tp while it is equipped
- =end
- module Dekita__TP_Limits
- Max_TP = 5
- Preserve_TP = true
- Initial_TP = 0
- Regen_TP = 0
- Take_HP_Damage = 1
- Deal_HP_Damage = 1
- Heal_HP_Damage = 0
- Take_MP_Damage = 0
- Deal_MP_Damage = 0
- Heal_MP_Damage = 0
- Kill_Enemy = 0
- # Do Not Remove this.
- p 'Loaded : DPBz - TP Limits'
- end # module Dekita__TP_Limits
- $imported = {} if $imported.nil?
- $imported[:Dekita__TP_Limits] = true
- #==============================================================================
- module DataManager
- #==============================================================================
- class <<self; alias load_database_TP_Limits_DPBz load_database; end
- def self.load_database
- load_database_TP_Limits_DPBz
- load_notetags_TP_Limits_DPBz
- end
- def self.load_notetags_TP_Limits_DPBz
- groups = [$data_weapons, $data_armors]
- for group in groups
- for obj in group
- next if obj.nil?
- obj.load_notetags_TP_Limits_DPBz
- end
- end
- end
- end # DataManager
- #==============================================================================
- class RPG::EquipItem < RPG::BaseItem
- #==============================================================================
- attr_accessor :max_tp_boost_DPBz
- def load_notetags_TP_Limits_DPBz
- @max_tp_boost_DPBz = 0
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when /<inc tp: (.*)>/i
- @max_tp_boost_DPBz += $1.to_i
- p "Loaded : DPBz - TP Limits - Max TP Limit Mod For #{name}"
- end
- } # self.note.split
- end
- end # RPG::EquipItem
- #==============================================================================
- class Game_BattlerBase
- #==============================================================================
- def tp_rate
- @tp.to_f / max_tp
- end
- alias preserve_tp_DPBz preserve_tp?
- def preserve_tp?
- return true if Dekita__TP_Limits::Preserve_TP
- return preserve_tp_DPBz
- end
- end # class Game_BattlerBase
- #==============================================================================
- class Game_Battler < Game_BattlerBase
- #==============================================================================
- def init_tp
- self.tp = Dekita__TP_Limits::Initial_TP
- end
- def charge_tp_by_damage(damage_rate)
- self.tp += Dekita__TP_Limits::Take_HP_Damage
- end
- def charge_tp_by_mp_damage(damage_rate)
- self.tp += Dekita__TP_Limits::Take_MP_Damage
- end
- def regenerate_tp
- self.tp += Dekita__TP_Limits::Regen_TP
- end
- alias execute_damage_DPBz_TP execute_damage
- def execute_damage(user)
- execute_damage_DPBz_TP(user)
- return unless $game_party.in_battle
- if @result.hp_damage > 0
- user.tp += Dekita__TP_Limits::Deal_HP_Damage
- elsif @result.hp_damage < 0
- user.tp += Dekita__TP_Limits::Heal_HP_Damage
- end
- if @result.mp_damage > 0
- user.tp += Dekita__TP_Limits::Deal_MP_Damage
- charge_tp_by_mp_damage(@result.mp_damage)
- elsif @result.mp_damage < 0
- user.tp += Dekita__TP_Limits::Heal_MP_Damage
- end
- user.tp += Dekita__TP_Limits::Kill_Enemy if self.hp == 0
- end
- alias item_effect_recover_hp_DPBz_TP item_effect_recover_hp
- def item_effect_recover_hp(user, item, effect)
- item_effect_recover_hp_DPBz_TP(user, item, effect)
- return unless $game_party.in_battle
- if @result.hp_damage > 0
- user.tp += Dekita__TP_Limits::Deal_HP_Damage
- elsif @result.hp_damage < 0
- user.tp += Dekita__TP_Limits::Heal_HP_Damage
- end
- end
- alias item_eff_DPBZ item_effect_recover_mp
- def item_effect_recover_mp(user, item, effect)
- item_eff_DPBZ(user, item, effect)
- return unless $game_party.in_battle
- if @result.mp_damage > 0
- user.tp += Dekita__TP_Limits::Deal_MP_Damage
- elsif @result.mp_damage < 0
- user.tp += Dekita__TP_Limits::Heal_MP_Damage
- end
- end
- end # Game_Battler
- #==============================================================================
- class Game_Actor < Game_Battler
- #==============================================================================
- def max_tp
- val = Dekita__TP_Limits::Max_TP
- val += equip_tp_limit_raise_DPBz
- end
- def equip_tp_limit_raise_DPBz
- rlval = 0.0
- rlval += equips.compact.inject(0) {|r, i| r += i.max_tp_boost_DPBz rescue 0 }
- return rlval
- end
- end # class Game_Actor < Game_Battler
- #===============================================================================#
- # - SCRIPT END - #
- #===============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #===============================================================================#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement