Code:
p @problem# => nil
p @problem# => nil
case #somethingwhen :something #then do codewhen :toerhthing #then do this codeend
case $game_variables[Bloody_Difficulty::Difficulty_Variable] when 0 (bloody_param(param_id) * Bloody_Difficulty::Easy).to_i # next line # next line # and so on when 1 (bloody_param(param_id) * Bloody_Difficulty::Normal).to_i # next line # next line # and so on when 2 (bloody_param(param_id) * Bloody_Difficulty::Hard).to_i when 3 (bloody_param(param_id) * Bloody_Difficulty::Insane).to_i else # if you need else end
case $game_variables[500]when 0 ; # codewhen 1 ; # codeelse ; # codeend
def param(param_id) case $game_variables[500] when 0 then (alias_name(param_id) * easy_param_mod(param_id)).to_i when 1 #... end end def easy_param_mod(param_id) case param_id when 0 then return 1.5 when 1 then return 1.5 when 2 then return 1.2 #... end end
#--------#Script By: Bloodmorphed#Difficulty Script v1.0##Change Log:#v1.0#Simple version. Checks difficulty and multiplies based on the difficulty, also#easily modified.####--------#-----------------# Determines what variable, and the multiplier based on difficulty## Feel free to edit these. Make sure you are using the right variable!#-----------------module Blood #-------------------------------------------------------------- # True or false, this determines to use the simplified version of the code, or # not. True means it will use it, false means it wont. #-------------------------------------------------------------- module Simple Simple = true Simple_Easy = 0.5 #If Simple = true this will be used for easy Simple_Normal = 1 #If Simple = true this will be used for normal Simple_Hard = 2 #If Simple = true this will be used for hard Simple_Insane = 4 #If Simple = true this will be used for insane end # ends Simple #-------------------------------------------------------------- # Variable to use. #-------------------------------------------------------------- module Variable Difficulty_Variable = 100 # Which variable to use? Default is 100 end #ends variable #-------------------------------------------------------------- # This part of the script gives you precise control over which gets edited # # MHP - Maximum Hit Points # MMP - Maximum Mana Points # ATK - Attack Power # DEF - Physical Defense # MAT - Magic Attack # MDF - Magic Defense # AGI - Agility # LUK - Luck # EXR - Experience Rate # # Default for Easy is 0.5 # Default for Normal is 1 # Default for Hard is 2 # Default for Insane is 4 # # Please note that this is MULTIPLYING not ADDING, so make small increments # otherwise you will have an extreme vamp. # # #-------------------------------------------------------------- module Easy MHP = 0.5 MMP = 0.5 ATK = 0.5 DEF = 0.5 MAT = 0.5 MDF = 0.5 AGI = 0.5 LUK = 0.5 EXR = 0.5 end #ends easy module Normal MHP = 1 MMP = 1 ATK = 1 DEF = 1 MAT = 1 MDF = 1 AGI = 1 LUK = 1 EXR = 1 end #ends normal module Hard MHP = 2 MMP = 2 ATK = 2 DEF = 2 MAT = 2 MDF = 2 AGI = 2 LUK = 2 EXR = 2 end #ends hard module Insane MHP = 4 MMP = 4 ATK = 4 DEF = 4 MAT = 4 MDF = 4 AGI = 4 LUK = 4 EXR = 4 end #ends insaneend #ends Blood #===============================================================================class Game_Enemy#=============================================================================== #----------------------------------------------------------------------------- # List Of Aliased Methods #----------------------------------------------------------------------------- alias :bloody_param :param :bloody_sparam :sparam #----------------------------------------------------------------------------- # Method to determine value of enemies params based on difficulty. #----------------------------------------------------------------------------- if Blood::Simple::Simple == true def param(param_id) case $game_variables[Blood::Difficulty_Variable] when 0 (bloody_param(param_id) * Blood::Simple::Simple_Easy).to_i when 1 (bloody_param(param_id) * Blood::Simple::Simple_Normal).to_i when 2 (bloody_param(param_id) * Blood::Simple::Simple_Hard).to_i when 3 (bloody_param(param_id) * Blood::Simple::Simple_Insane).to_i end #ends case end #ends def end #ends if if Blood::Simple::Simple == false def param(param_id) case $game_variables[Blood::Difficulty_Variable] when 0 (bloody_param(1) * Blood::Easy::MHP).to_i end #ends class
Nope.
Original thread: https://forums.rpgmakerweb.com/threads/ruby-rgssx-questions-that-dont-deserve-their-own-thread.150/