Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # =============================================================================
- # ♫ ~ Difficulty setting by parameter by TheoAllen ~ ♫
- # Version : 1.1
- # Requires : N/A
- # Contact : www.rpgmakerid.com
- # =============================================================================
- # ♫ UPDATES :
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # 2013.03.01 - Add shop price change
- # - Add exp gain change
- # - Add gold drop change
- # - Compatibility Patch
- # 2013.02.24 - Fixed bugs
- # 2013.02.24 - Started and finished script
- #
- # =============================================================================
- # ♫ DESCRIPTION :
- # This script allow you to change enemy's parameter for difficulty setting.
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # ♫ INSTRUCTION :
- # Put this script below material but above main in script editor. Don't forget
- # to save.
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # ♫ HOW TO USE :
- # Edit the configuration below. Determine the variable id for parameter change.
- # WARNING! This script isn't plug an play! You need to do something with game
- # variable at the beginning of your game first!
- #
- # For example, if you set MHP_ID = 1
- # You need to set 1st id variable to 100 or another number as you like.
- # Remember. 100 stands for 100%. 50 stands for 50%
- # =============================================================================
- # ♫ TERMS OF USE :
- # - Credit me, TheoAllen. If you think it's necessary.
- # - You may use this script both commercial and non-commercial purposes or even
- # adult game as long as you don't claim it's yours.
- # - I'll be glad if you give me a free copy of your game if you use this script
- # in your commercial project.
- # =============================================================================
- $imported = {} if $imported.nil?
- $imported["Theo-DiffSetting"] = true
- # =============================================================================
- # ♫ CONFIGURATIONS ~ ♫
- # =============================================================================
- module THEOLIZED
- # Edit these setting to decide which variable id will be used for enemy's
- # parameter change. 0 to disable
- MHP_ID = 1
- MMP_ID = 2
- ATK_ID = 3
- DEF_ID = 4
- MAT_ID = 5
- MDF_ID = 6
- AGI_ID = 7
- LUK_ID = 8
- # Battle Related. If you also want to change total gained exp and gold drop.
- # 0 to disable
- EXP_ID = 0
- GOLD_ID = 0
- # Scene shop related. If you also want to change the buying price and selling
- # price. 0 to disable
- BUY_ID = 0
- SELL_ID = 0
- end
- # =============================================================================
- # ♫ Do not edit unless you know what to do ~ ♫
- # =============================================================================
- # SCRIPT INFOS:
- # ------------------------------------------
- # Rewriten method : N/A
- # ------------------------------------------
- # Aliased method :
- # - Game_Enemy
- # def mhp
- # def mmp
- # def atk
- # def def
- # def mat
- # def mdf
- # def agi
- # def luk
- # - Game_Troop
- # def exp_total
- # def gold_total
- # - Scene_Shop
- # def buying_price
- # def selling_price
- # =============================================================================
- # ♫ Game_Enemy ~ ♫
- # =============================================================================
- class Game_Enemy < Game_Battler
- #--------------------------------------------------------------------------
- # ♫ Maximum hit point
- #--------------------------------------------------------------------------
- alias theolized_mhp mhp
- def mhp
- check_var_id(diff_var_id(0)) ? theolized_mhp*$game_variables[diff_var_id(0)]/100 : theolized_mhp
- end
- #--------------------------------------------------------------------------
- # ♫ Maximum magic point
- #--------------------------------------------------------------------------
- alias theolized_mmp mmp
- def mmp
- check_var_id(diff_var_id(1)) ? theolized_mmp*$game_variables[diff_var_id(1)]/100 : theolized_mmp
- end
- #--------------------------------------------------------------------------
- # ♫ Attack point
- #--------------------------------------------------------------------------
- alias theolized_atk atk
- def atk
- check_var_id(diff_var_id(2)) ? theolized_atk*$game_variables[diff_var_id(2)]/100 : theolized_atk
- end
- #--------------------------------------------------------------------------
- # ♫ Defense point
- #--------------------------------------------------------------------------
- alias theolized_def def
- def def
- check_var_id(diff_var_id(3)) ? theolized_def*$game_variables[diff_var_id(3)]/100 : theolized_def
- end
- #--------------------------------------------------------------------------
- # ♫ Magic attack
- #--------------------------------------------------------------------------
- alias theolized_mat mat
- def mat
- check_var_id(diff_var_id(4)) ? theolized_mat*$game_variables[diff_var_id(4)]/100 : theolized_mat
- end
- #--------------------------------------------------------------------------
- # ♫ Magic defense
- #--------------------------------------------------------------------------
- alias theolized_mdf mdf
- def mdf
- check_var_id(diff_var_id(5)) ? theolized_mdf*$game_variables[diff_var_id(5)]/100 : theolized_mdf
- end
- #--------------------------------------------------------------------------
- # ♫ Agility point
- #--------------------------------------------------------------------------
- alias theolized_agi agi
- def agi
- check_var_id(diff_var_id(6)) ? theolized_agi*$game_variables[diff_var_id(6)]/100 : theolized_agi
- end
- #--------------------------------------------------------------------------
- # ♫ Luck point
- #--------------------------------------------------------------------------
- alias theolized_luk luk
- def luk
- check_var_id(diff_var_id(7)) ? theolized_luk*$game_variables[diff_var_id(7)]/100 : theolized_luk
- end
- #--------------------------------------------------------------------------
- # ♫ Get variable id
- #--------------------------------------------------------------------------
- def diff_var_id(id)
- case id
- when 0
- return THEOLIZED::MHP_ID
- when 1
- return THEOLIZED::MMP_ID
- when 2
- return THEOLIZED::ATK_ID
- when 3
- return THEOLIZED::DEF_ID
- when 4
- return THEOLIZED::MAT_ID
- when 5
- return THEOLIZED::MDF_ID
- when 6
- return THEOLIZED::AGI_ID
- when 7
- return THEOLIZED::LUK_ID
- else
- return 0
- end
- end
- #--------------------------------------------------------------------------
- # ♫ Check variable id
- #--------------------------------------------------------------------------
- def check_var_id(id)
- return true if id > 0
- return false
- end
- end
- # =============================================================================
- # ♫ Game_Troop ♫
- # =============================================================================
- class Game_Troop < Game_Unit
- #--------------------------------------------------------------------------
- # * Calculate Total Experience
- #--------------------------------------------------------------------------
- alias theolized_exp_total exp_total
- def exp_total
- check_var(battle_var(0)) ? theolized_exp_total*game_var(battle_var(0))/100 : theolized_exp_total
- end
- #--------------------------------------------------------------------------
- # * Calculate Total Gold
- #--------------------------------------------------------------------------
- alias theolized_gold_total gold_total
- def gold_total
- check_var(battle_var(1)) ? theolized_gold_total*game_var(battle_var(1))/100 : theolized_gold_total
- end
- #--------------------------------------------------------------------------
- # ♫ Get battle variable id
- #--------------------------------------------------------------------------
- def battle_var(id)
- case id
- when 0
- return THEOLIZED::EXP_ID
- when 1
- return THEOLIZED::GOLD_ID
- else
- return 0
- end # case
- end # battle var
- #--------------------------------------------------------------------------
- # ♫ Check variable id
- #--------------------------------------------------------------------------
- def check_var(index)
- return false unless index > 0
- return true
- end
- #--------------------------------------------------------------------------
- # ♫ Simplify game variable call
- #--------------------------------------------------------------------------
- def game_var(index)
- $game_variables[index]
- end
- end
- # =============================================================================
- # ♫ Scene_Shop ♫
- # =============================================================================
- class Scene_Shop < Scene_MenuBase
- #--------------------------------------------------------------------------
- # ♫ Get Purchase Price
- #--------------------------------------------------------------------------
- alias theolized_buy_price buying_price
- def buying_price
- check_var(price_var(0)) ? theolized_buy_price*game_var(price_var(0))/100 : theolized_buy_price
- end
- #--------------------------------------------------------------------------
- # ♫ Get Sale Price
- #--------------------------------------------------------------------------
- alias theolized_sell_price selling_price
- def selling_price
- check_var(price_var(1)) ? theolized_sell_price*game_var(price_var(1))/100 : theolized_sell_price
- end
- #--------------------------------------------------------------------------
- # ♫ Check variable id
- #--------------------------------------------------------------------------
- def check_var(index)
- return false unless index > 0
- return true
- end
- #--------------------------------------------------------------------------
- # ♫ Get price variable id
- #--------------------------------------------------------------------------
- def price_var(id)
- case id
- when 0
- return THEOLIZED::BUY_ID
- when 1
- return THEOLIZED::SELL_ID
- else
- return 0
- end # case
- end # price_var
- #--------------------------------------------------------------------------
- # ♫ Simplify game variable call
- #--------------------------------------------------------------------------
- def game_var(index)
- $game_variables[index]
- end
- end
- # =============================================================================
- # ♫ End of Script ♫
- # =============================================================================
Advertisement
Add Comment
Please, Sign In to add comment