panchokoster
Member
Difficulty script + Difficult-Unlocker v.2
What it does?
Èxsharaèn :
let's say a player choose Easy difficulty (while the only difficulty available is Easy). After s/he beats the game once, s/he will unlock Normal difficulty. And so on, beating Normal will reveal Hard, and Hard reveals Nightmare (just as Diablo II and Dungeon Siege II do, if you play either).
http://img241.imageshack.us/img241/4710/dibujo2um7.th.jpg[/IMG]http://img171.imageshack.us/img171/6492/dibujokx4.th.jpg[/IMG]
Code:
#Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©
#Difficult-Unlocker by panchokoster
#Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©
#Panchokoster
# Version 2
#
#Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©
module DIFFICULT
SPRITESET_TYPE = 1 #choose spriteset type, 1=>title screen, 2=>picture, 3+map
PICTURE_NAME = "picture name" #choose spriteset typen 2 to use, put the image in yours pictures folder
#game_switches used in the script
HARD = 6
MANIA = 7
# UNKNOWN = 8
# DIVINE = 9
BEAT_GAME = 10
end
#Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©
# Scenes
#Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©
class Scene_Title
alias old_command_new_game command_new_game
def command_new_game
old_command_new_game
$scene =Scene_select_yes_no.new
if FileTest.exist?("Save1.rxdata")#Checks if the save file exists
file = File.open("Save1.rxdata")#Opens save
# Read character data for drawing save file
characters = Marshal.load(file)
# Read frame count for measuring play time
Graphics.frame_count = Marshal.load(file)
# Read each type of game object
$game_system = Marshal.load(file)
$game_switches = Marshal.load(file)
$game_variables = Marshal.load(file)
file.close
end
end
end
class Scene_difficult_menu
def initialize(menu_index = 2)
@menu_index = menu_index
end
def main
case DIFFICULT::SPRITESET_TYPE
when 1
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
when 2
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.picture(DIFFICULT::PICTURE_NAME)
when 3
@spriteset = Spriteset_Map.new
end
@window_q2 = Window_question2.new
@window_q2.x = 50
@window_q2.y = 125-64
@window_help = Window_Help_dif_menu.new
@window_help.update(" ")
s1 = "Rookie"
s2 = "Easy"
s3 = "Normal"
s4 = "Hard"
s5 = "Mania"
@window_help.x = 50
@window_help.y = 125
@window_command_dif = Window_Command.new(200, [s1,s2,s3,s4,s5])
@window_command_dif.y = 189
@window_command_dif.x = 220
@window_command_dif.index = @menu_index
if $game_switches[DIFFICULT::HARD] == false
@window_command_dif.disable_item(3)
end
if $game_switches[DIFFICULT::MANIA] == false
@window_command_dif.disable_item(4)
end
@dif = true if $game_switches[DIFFICULT::HARD]
@dif_2 = true if $game_switches[DIFFICULT::MANIA]
@dif_5 = true if $game_switches[DIFFICULT::BEAT_GAME]
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
#Execute when exiting the scene:
Graphics.freeze
@window_command_dif.dispose
@window_help.dispose
@window_q2.dispose
case DIFFICULT::SPRITESET_TYPE
when 1 , 2
@sprite.bitmap.dispose
@sprite.dispose
when 3
@spriteset.dispose
end
end
#--------------------------------------------------------------------------------------------------------
def update
@window_command_dif.update
case @window_command_dif.index
when 0
@window_help.update("The minimal difficulty only for losers") #"Rookie"
when 1
@window_help.update("An easy difficult level for kids") #"Easy"
when 2
@window_help.update("The defaut game difficluty") #"Normal"
when 3
if $game_switches[DIFFICULT::HARD]
@window_help.update("Start fighting stronger monsters")
else
@window_help.update("to have this option you must finish the game one time")#"Hard"
end
when 4
if $game_switches[DIFFICULT::MANIA]
@window_help.update("Maniac difficult level, only for advanced gamers")
else
@window_help.update("to have this option you must beat ''Hard''")#"Mania"
end
end
if Input.trigger?(Input::C)
case @window_command_dif.index
when 0
rookie
when 1
easy
when 2
normal
when 3
if $game_switches[DIFFICULT::HARD]
hard
end
when 4
if $game_switches[DIFFICULT::MANIA]
mania
end
end
end
end
def resetear_todo
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Stop BGM
Audio.bgm_stop
# Reset frame count for measuring play time
Graphics.frame_count = 0
# Make each type of game object
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
# Set up initial party
$game_party.setup_starting_members
# Set up initial map position
$game_map.setup($data_system.start_map_id)
# Move player to initial position
$game_player.moveto($data_system.start_x, $data_system.start_y)
# Refresh player
$game_player.refresh
# Run automatic change for BGM and BGS set with map
$game_map.autoplay
# Update map (run parallel process event)
$game_map.update
# Switch to map screen
$game_switches[DIFFICULT::HARD] = @dif
$game_switches[DIFFICULT::MANIA] = @dif_2
$game_switches[DIFFICULT::BEAT_GAME] = @dif_5
end
def rookie #s1
$game_system.se_play($data_system.decision_se)
resetear_todo
$game_difficulty.difficulty = 0
$scene = Scene_Map.new
end
def easy #s2
$game_system.se_play($data_system.decision_se)
resetear_todo
$game_difficulty.difficulty = 1
$scene = Scene_Map.new
end
def normal #s3
$game_system.se_play($data_system.decision_se)
resetear_todo
$game_difficulty.difficulty = 2
$scene = Scene_Map.new
end
def hard #s4
$game_system.se_play($data_system.decision_se)
resetear_todo
$game_difficulty.difficulty = 3
$dif = 1
$scene = Scene_Map.new
end
def mania #s5
$game_system.se_play($data_system.decision_se)
resetear_todo
$game_difficulty.difficulty = 4
$dif = 2
$scene = Scene_Map.new
end
end
class Scene_select_yes_no
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
case DIFFICULT::SPRITESET_TYPE
when 1
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
when 2
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.picture(DIFFICULT::PICTURE_NAME)
when 3
@spriteset = Spriteset_Map.new
end
@window_q=Window_question.new
@window_q.x = 200
@window_q.y = 220-64
s1 = "yes"
s2 = "not right now"
@window_yes_no = Window_Command.new(200, [s1,s2])
@window_yes_no.y = 220
@window_yes_no.x = 220
@window_yes_no.index = @menu_index
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@window_yes_no.dispose
@window_q.dispose
case DIFFICULT::SPRITESET_TYPE
when 1..2
@sprite.bitmap.dispose
@sprite.dispose
when 3
@spriteset.dispose
end
end
def update
@window_yes_no.update
if Input.trigger?(Input::C)
case @window_yes_no.index
when 0
yes
when 1
no
end
end
end
def yes
$game_system.se_play($data_system.decision_se)
$scene = Scene_difficult_menu.new
end
def no
$game_system.se_play($data_system.decision_se)
$game_difficulty.difficulty = 2
$scene = Scene_Map.new
end
end
class Scene_unlock_dif
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
$game_system.me_play($game_system.battle_end_me)
@spriteset = Spriteset_Map.new
@window_c=Window_unlock.new
@window_c.x = 200
@window_c.y = 220-64
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@window_c.dispose
@spriteset.dispose
end
def update
if Input.trigger?(Input::C)
$scene = Scene_Map.new
$game_map.autoplay
end
end
end
#Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©
#Windows
#Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©
class Window_Help_dif_menu < Window_Base
def initialize
super(0, 0, 540,64)
self.contents = Bitmap.new(width-32, height-32)
end
def update(help_text)
self.contents.clear
self.contents.draw_text(0, 0, 440, 32, help_text)
end
end
class Window_question < Window_Base
def initialize
super(0, 0, 240,64)
self.contents = Bitmap.new(width-32, height-32)
self.contents.draw_text(0, 0, 210, 32, " Change game difficulty?")
end
end
class Window_question2 < Window_Base
def initialize
super(0, 0, 240,64)
self.contents = Bitmap.new(width-32, height-32)
self.contents.draw_text(0, 0, 210, 32, "Choose the difficult Level... ")
end
end
class Window_unlock < Window_Base
def initialize
super(0, 0, 240,96)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.size = 26
show_dif
end
def show_dif
if $game_switches[DIFFICULT::MANIA]
$game_switches[DIFFICULT::BEAT_GAME] = true
self.contents.draw_text(0, 0, 210, 32, "congratulations, you beated")
self.contents.draw_text(64, 34, 210, 32, "the game")
elsif $game_switches[DIFFICULT::HARD] && $dif == 1
if $game_switches[DIFFICULT::MANIA]
self.contents.draw_text(0, 10, 210, 32, "difficulty already unlocked")
else
$game_switches[DIFFICULT::MANIA] = true
self.contents.draw_text(0, 0, 210, 32, " ''Mania'' difficulty")
self.contents.draw_text(64, 34, 210, 32, "unlocked")
end
else
if $game_switches[DIFFICULT::HARD]
self.contents.draw_text(0, 10, 210, 32, "difficulty already unlocked")
else
$game_switches[DIFFICULT::HARD] = true
self.contents.draw_text(0, 0, 210, 32, " ''Hard'' difficulty")
self.contents.draw_text(64, 34, 210, 32, "unlocked")
end
end
end
end
Code:
#Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©
#Difficult-Unlocker by panchokoster
#Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©
#Panchokoster
# Version 2
#
#Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©
module DIFFICULT
SPRITESET_TYPE = 1 #choose spriteset type, 1=>title screen, 2=>picture, 3+map
PICTURE_NAME = "picture name" #choose spriteset typen 2 to use, put the image in yours pictures folder
#game_switches used in the script
HARD = 6
MANIA = 7
UNKNOWN = 8
DIVINE = 9
BEAT_GAME = 10
end
#Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©
# Scenes
#Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©
class Scene_Title
alias old_command_new_game command_new_game
def command_new_game
old_command_new_game
$scene =Scene_select_yes_no.new
if FileTest.exist?("Save1.rxdata")#Checks if the save file exists
file = File.open("Save1.rxdata")#Opens save
# Read character data for drawing save file
characters = Marshal.load(file)
# Read frame count for measuring play time
Graphics.frame_count = Marshal.load(file)
# Read each type of game object
$game_system = Marshal.load(file)
$game_switches = Marshal.load(file)
$game_variables = Marshal.load(file)
file.close
end
end
end
class Scene_difficult_menu
def initialize(menu_index = 2)
@menu_index = menu_index
end
def main
case DIFFICULT::SPRITESET_TYPE
when 1
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
when 2
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.picture(DIFFICULT::PICTURE_NAME)
when 3
@spriteset = Spriteset_Map.new
end
@window_q2 = Window_question2.new
@window_q2.x = 50
@window_q2.y = 125-64
@window_help = Window_Help_dif_menu.new
@window_help.update(" ")
s1 = "Rookie"
s2 = "Easy"
s3 = "Normal"
s4 = "Hard"
s5 = "Mania"
s6 = "Unknown"
s7 = "Divine"
@window_help.x = 50
@window_help.y = 125
@window_command_dif = Window_Command.new(200, [s1,s2,s3,s4,s5,s6,s7])
@window_command_dif.y = 189
@window_command_dif.x = 220
@window_command_dif.index = @menu_index
if $game_switches[DIFFICULT::HARD] == false
@window_command_dif.disable_item(3)
end
if $game_switches[DIFFICULT::MANIA] == false
@window_command_dif.disable_item(4)
end
if $game_switches[DIFFICULT::UNKNOWN] == false
@window_command_dif.disable_item(5)
end
if $game_switches[DIFFICULT::DIVINE] == false
@window_command_dif.disable_item(6)
end
@dif = true if $game_switches[DIFFICULT::HARD]
@dif_2 = true if $game_switches[DIFFICULT::MANIA]
@dif_3 = true if $game_switches[DIFFICULT::UNKNOWN]
@dif_4 = true if $game_switches[DIFFICULT::DIVINE]
@dif_5 = true if $game_switches[DIFFICULT::BEAT_GAME]
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
#Execute when exiting the scene:
Graphics.freeze
@window_command_dif.dispose
@window_help.dispose
@window_q2.dispose
case DIFFICULT::SPRITESET_TYPE
when 1 , 2
@sprite.bitmap.dispose
@sprite.dispose
when 3
@spriteset.dispose
end
end
#--------------------------------------------------------------------------------------------------------
def update
@window_command_dif.update
case @window_command_dif.index
when 0
@window_help.update("The minimal difficulty only for losers") #"Rookie"
when 1
@window_help.update("An easy difficult level for kids") #"Easy"
when 2
@window_help.update("The defaut game difficluty") #"Normal"
when 3
if $game_switches[DIFFICULT::HARD]
@window_help.update("Start fighting stronger monsters")
else
@window_help.update("to have this option you must finish the game one time")#"Hard"
end
when 4
if $game_switches[DIFFICULT::MANIA]
@window_help.update("Maniac difficult level, only for advanced gamers")
else
@window_help.update("to have this option you must beat ''Hard''")#"Mania"
end
when 5
if $game_switches[DIFFICULT::UNKNOWN]
@window_help.update("????")
else
@window_help.update("to have this option you must beat ''Mania''")#"Unknown"
end
when 6
if $game_switches[DIFFICULT::DIVINE]
@window_help.update("Master the game fighting the strongest monsters")
else
@window_help.update("to have this option you must beat ''Unknown''")#"Divine"
end
end
if Input.trigger?(Input::C)
case @window_command_dif.index
when 0
rookie
when 1
easy
when 2
normal
when 3
if $game_switches[DIFFICULT::HARD]
hard
end
when 4
if $game_switches[DIFFICULT::MANIA]
mania
end
when 5
if $game_switches[DIFFICULT::UNKNOWN]
unknown
end
when 6
if $game_switches[DIFFICULT::DIVINE]
divine
end
end
end
end
def resetear_todo
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Stop BGM
Audio.bgm_stop
# Reset frame count for measuring play time
Graphics.frame_count = 0
# Make each type of game object
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
# Set up initial party
$game_party.setup_starting_members
# Set up initial map position
$game_map.setup($data_system.start_map_id)
# Move player to initial position
$game_player.moveto($data_system.start_x, $data_system.start_y)
# Refresh player
$game_player.refresh
# Run automatic change for BGM and BGS set with map
$game_map.autoplay
# Update map (run parallel process event)
$game_map.update
# Switch to map screen
$game_switches[DIFFICULT::HARD] = @dif
$game_switches[DIFFICULT::MANIA] = @dif_2
$game_switches[DIFFICULT::UNKNOWN] = @dif_3
$game_switches[DIFFICULT::DIVINE] = @dif_4
$game_switches[DIFFICULT::BEAT_GAME] = @dif_5
end
def rookie #s1
$game_system.se_play($data_system.decision_se)
resetear_todo
Difficulty.set(0)
$scene = Scene_Map.new
end
def easy #s2
$game_system.se_play($data_system.decision_se)
resetear_todo
Difficulty.set(1)
$scene = Scene_Map.new
end
def normal #s3
$game_system.se_play($data_system.decision_se)
resetear_todo
$scene = Scene_Map.new
end
def hard #s4
$game_system.se_play($data_system.decision_se)
resetear_todo
Difficulty.set(3)
$dif = 1
$scene = Scene_Map.new
end
def mania #s5
$game_system.se_play($data_system.decision_se)
resetear_todo
Difficulty.set(4)
$dif = 2
$scene = Scene_Map.new
end
def unknown #s6
$game_system.se_play($data_system.decision_se)
resetear_todo
Difficulty.set(5)
$dif = 3
$scene = Scene_Map.new
end
def divine #s7
$game_system.se_play($data_system.decision_se)
resetear_todo
Difficulty.set(6)
$dif = 4
$scene = Scene_Map.new
end
end
class Scene_select_yes_no
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
case DIFFICULT::SPRITESET_TYPE
when 1
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
when 2
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.picture(DIFFICULT::PICTURE_NAME)
when 3
@spriteset = Spriteset_Map.new
end
@window_q=Window_question.new
@window_q.x = 200
@window_q.y = 220-64
s1 = "yes"
s2 = "not right now"
@window_yes_no = Window_Command.new(200, [s1,s2])
@window_yes_no.y = 220
@window_yes_no.x = 220
@window_yes_no.index = @menu_index
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@window_yes_no.dispose
@window_q.dispose
case DIFFICULT::SPRITESET_TYPE
when 1..2
@sprite.bitmap.dispose
@sprite.dispose
when 3
@spriteset.dispose
end
end
def update
@window_yes_no.update
if Input.trigger?(Input::C)
case @window_yes_no.index
when 0
yes
when 1
no
end
end
end
def yes
$game_system.se_play($data_system.decision_se)
$scene = Scene_difficult_menu.new
end
def no
$game_system.se_play($data_system.decision_se)
Difficulty.set(2)
$scene = Scene_Map.new
end
end
class Scene_unlock_dif
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
$game_system.me_play($game_system.battle_end_me)
@spriteset = Spriteset_Map.new
@window_c=Window_unlock.new
@window_c.x = 200
@window_c.y = 220-64
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@window_c.dispose
@spriteset.dispose
end
def update
if Input.trigger?(Input::C)
$scene = Scene_Map.new
$game_map.autoplay
end
end
end
#Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©
#Windows
#Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©Û©
class Window_Help_dif_menu < Window_Base
def initialize
super(0, 0, 540,64)
self.contents = Bitmap.new(width-32, height-32)
end
def update(help_text)
self.contents.clear
self.contents.draw_text(0, 0, 440, 32, help_text)
end
end
class Window_question < Window_Base
def initialize
super(0, 0, 240,64)
self.contents = Bitmap.new(width-32, height-32)
self.contents.draw_text(0, 0, 210, 32, " Change game difficulty?")
end
end
class Window_question2 < Window_Base
def initialize
super(0, 0, 240,64)
self.contents = Bitmap.new(width-32, height-32)
self.contents.draw_text(0, 0, 210, 32, "Choose the difficult Level... ")
end
end
class Window_unlock < Window_Base
def initialize
super(0, 0, 240,96)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.size = 26
show_dif
end
def show_dif
if $game_switches[DIFFICULT::DIVINE] && $dif == 4
$game_switches[DIFFICULT::BEAT_GAME] = true
self.contents.draw_text(0, 0, 210, 32, "congratulations, you beated")
self.contents.draw_text(64, 34, 210, 32, "the game")
elsif $game_switches[DIFFICULT::UNKNOWN]&& $dif == 3
if $game_switches[DIFFICULT::DIVINE]
self.contents.draw_text(0, 10, 210, 32, "difficulty already unlocked")
else
$game_switches[DIFFICULT::DIVINE] = true
self.contents.draw_text(0, 0, 210, 32, " ''Divine'' difficulty")
self.contents.draw_text(64, 34, 210, 32, "unlocked")
end
elsif $game_switches[DIFFICULT::MANIA] && $dif == 2
if $game_switches[DIFFICULT::UNKNOWN]
self.contents.draw_text(0, 10, 210, 32, "difficulty already unlocked")
else
$game_switches[DIFFICULT::UNKNOWN] = true
self.contents.draw_text(0, 0, 210, 32, " ''Unknown'' difficulty")
self.contents.draw_text(64, 34, 210, 32, "unlocked")
end
elsif $game_switches[DIFFICULT::HARD] && $dif == 1
if $game_switches[DIFFICULT::MANIA]
self.contents.draw_text(0, 10, 210, 32, "difficulty already unlocked")
else
$game_switches[DIFFICULT::MANIA] = true
self.contents.draw_text(0, 0, 210, 32, " ''Mania'' difficulty")
self.contents.draw_text(64, 34, 210, 32, "unlocked")
end
else
if $game_switches[DIFFICULT::HARD]
self.contents.draw_text(0, 10, 210, 32, "difficulty already unlocked")
else
$game_switches[DIFFICULT::HARD] = true
self.contents.draw_text(0, 0, 210, 32, " ''Hard'' difficulty")
self.contents.draw_text(64, 34, 210, 32, "unlocked")
end
end
end
end
SephirothSpawn Dynamic Enemies & Game Difficulty
http://www.rmxp.org/forums/showthread.php?t=7144
http://img415.imageshack.us/img415/2610/dibujocb7.jpg[/IMG]
http://img415.imageshack.us/img415/4430/dibujo2df8.jpg[/IMG]
http://img415.imageshack.us/img415/4430/dibujo2df8.jpg[/IMG]
http://rapidshare.de/files/32786150/dificultad.rar.html
demo v.2
just add the two scripts above main
before the credits call a script with
note: in the game, the player must save in the slot 1,(there is a force save slot script but it was hacked)$scene = Scene_unlock_dif.new
you can change the background at this line
SPRITESET_TYPE = 2 #choose spriteset type, 1=>title screen, 2=>picture, 3+map
PICTURE_NAME = "picture name" #choose spriteset type 2 to use, put the image in yours pictures folder
thanks to Trickster, SephirothSpawn, and dubealex for the tutorials
Code:
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ?????? - KGC_BattleDifficulty?
#_/----------------------------------------------------------------------------
#_/ ?????????????????
#_/ (?????????????[MenuAlter][TitleOption]??)
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#==============================================================================
# ? ???????? ?
#==============================================================================
module KGC
# ??????
# «"??", HP, SP, ????, EXP, ????, ????????»
# ?????????(???)?
BD_DIFFICULTY_LIST = [
["Rookie", 60, 50, 60, 100, 100, 100],
["Easy", 80, 80, 70, 100, 100, 100],
["Normal", 100, 100, 100, 100, 100, 100],
["Hard", 150, 130, 120, 100, 100, 100],
["Mania", 200, 180, 150, 100, 100, 100],
["Unknown", 300, 260, 200, 100, 100, 100],
["Divine", 500, 400, 300, 100, 100, 100]
]
# ??????
# BD_DIFFICULTY_LIST ????????
BD_INITIAL_DIFFICULTY = 2
end
#???????????????????????????????????????
$imported = {} if $imported == nil
$imported["BattleDifficulty"] = true
module Difficulty
#--------------------------------------------------------------------------
# ? ???????
#--------------------------------------------------------------------------
def self.get
# ????????
return KGC::BD_DIFFICULTY_LIST[$game_system.difficulty]
end
#--------------------------------------------------------------------------
# ? ???????
#--------------------------------------------------------------------------
def self.set(index)
# ???????????
return if index < 0 || index >= KGC::BD_DIFFICULTY_LIST.size
$game_system.difficulty = index
end
#--------------------------------------------------------------------------
# ? ?????????????
#--------------------------------------------------------------------------
def self.get_revised_enemy(enemy)
en = enemy.clone
diff = self.get
en.maxhp = en.maxhp * diff[1] / 100
en.maxsp = en.maxsp * diff[2] / 100
en.str = en.str * diff[3] / 100
en.dex = en.dex * diff[3] / 100
en.agi = en.agi * diff[3] / 100
en.int = en.int * diff[3] / 100
en.atk = en.atk * diff[3] / 100
en.pdef = en.pdef * diff[3] / 100
en.mdef = en.mdef * diff[3] / 100
en.exp = en.exp * diff[4] / 100
en.gold = en.gold * diff[4] / 100
if en.treasure_prob < 100
en.treasure_prob = [en.treasure_prob * diff[5] / 100, 100].min
end
return en
end
end
#???????????????????????????????????????
#==============================================================================
# ¦ Game_System
#==============================================================================
class Game_System
attr_accessor :difficulty # ???
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
alias initialize_KGC_BattleDifficulty initialize
def initialize
# ???????
initialize_KGC_BattleDifficulty
@difficulty = KGC::BD_INITIAL_DIFFICULTY
end
#--------------------------------------------------------------------------
# ? ?????
#--------------------------------------------------------------------------
def difficulty_list
return KGC::BD_DIFFICULTY_LIST
end
end
#???????????????????????????????????????
#==============================================================================
# ¦ Game_Enemy
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ? ?? MaxHP ???
#--------------------------------------------------------------------------
alias base_maxhp_KGC_BattleDifficulty base_maxhp
def base_maxhp
n = base_maxhp_KGC_BattleDifficulty
n *= Difficulty.get[1]
return n / 100
end
#--------------------------------------------------------------------------
# ? ?? MaxSP ???
#--------------------------------------------------------------------------
alias base_maxsp_KGC_BattleDifficulty base_maxsp
def base_maxsp
n = base_maxsp_KGC_BattleDifficulty
n *= Difficulty.get[2]
return n / 100
end
#--------------------------------------------------------------------------
# ? ???????
#--------------------------------------------------------------------------
alias base_str_KGC_BattleDifficulty base_str
def base_str
n = base_str_KGC_BattleDifficulty
n *= Difficulty.get[3]
return n / 100
end
#--------------------------------------------------------------------------
# ? ????????
#--------------------------------------------------------------------------
alias base_dex_KGC_BattleDifficulty base_dex
def base_dex
n = base_dex_KGC_BattleDifficulty
n *= Difficulty.get[3]
return n / 100
end
#--------------------------------------------------------------------------
# ? ????????
#--------------------------------------------------------------------------
alias base_agi_KGC_BattleDifficulty base_agi
def base_agi
n = base_agi_KGC_BattleDifficulty
n *= Difficulty.get[3]
return n / 100
end
#--------------------------------------------------------------------------
# ? ???????
#--------------------------------------------------------------------------
alias base_int_KGC_BattleDifficulty base_int
def base_int
n = base_int_KGC_BattleDifficulty
n *= Difficulty.get[3]
return n / 100
end
#--------------------------------------------------------------------------
# ? ????????
#--------------------------------------------------------------------------
alias base_atk_KGC_BattleDifficulty base_atk
def base_atk
n = base_atk_KGC_BattleDifficulty
n *= Difficulty.get[3]
return n / 100
end
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
alias base_pdef_KGC_BattleDifficulty base_pdef
def base_pdef
n = base_pdef_KGC_BattleDifficulty
n *= Difficulty.get[3]
return n / 100
end
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
alias base_mdef_KGC_BattleDifficulty base_mdef
def base_mdef
n = base_mdef_KGC_BattleDifficulty
n *= Difficulty.get[3]
return n / 100
end
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
alias base_eva_KGC_BattleDifficulty base_eva
def base_eva
n = base_eva_KGC_BattleDifficulty
n *= Difficulty.get[3]
return n / 100
end
#--------------------------------------------------------------------------
# ? EXP ???
#--------------------------------------------------------------------------
alias exp_KGC_BattleDifficulty exp
def exp
n = exp_KGC_BattleDifficulty
n *= Difficulty.get[4]
return n / 100
end
#--------------------------------------------------------------------------
# ? ???????
#--------------------------------------------------------------------------
alias gold_KGC_BattleDifficulty gold
def gold
n = gold_KGC_BattleDifficulty
n *= Difficulty.get[5]
return n / 100
end
#--------------------------------------------------------------------------
# ? ???????????
#--------------------------------------------------------------------------
alias treasure_prob_KGC_BattleDifficulty treasure_prob
def treasure_prob
n = treasure_prob_KGC_BattleDifficulty
if n < 100
n *= Difficulty.get[6]
return [n / 100, 100].min
else
return n
end
end
end
Code:
#===================================================
#Scene_difficult_menu by panchokoster
#===================================================
module DIFFICULT
SPRITESET_TYPE = 2 #choose spriteset type, 1=>title screen, 2=>picture, 3+map
PICTURE_NAME = "picture name" #choose spriteset type 2 to use, put the image in yours pictures folder
end
class Scene_Title
alias old_command_new_game command_new_game
def command_new_game
old_command_new_game
$scene = Scene_select_yes_no.new
end
end
class Scene_select_yes_no
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
case DIFFICULT::SPRITESET_TYPE
when 1
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
when 2
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.picture(DIFFICULT::PICTURE_NAME)
when 3
@spriteset = Spriteset_Map.new
end
@window_q=Window_question.new
@window_q.x = 200
@window_q.y = 220-64
s1 = "yes"
s2 = "not right now"
@window_yes_no = Window_Command.new(200, [s1,s2])
@window_yes_no.y = 220
@window_yes_no.x = 220
@window_yes_no.index = @menu_index
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@window_yes_no.dispose
@window_q.dispose
case DIFFICULT::SPRITESET_TYPE
when 1..2
@sprite.bitmap.dispose
@sprite.dispose
when 3
@spriteset.dispose
end
end
def update
@window_yes_no.update
if Input.trigger?(Input::C)
case @window_yes_no.index
when 0
yes
when 1
no
end
end
end
def yes
$game_system.se_play($data_system.decision_se)
$scene = Scene_difficult_menu.new
end
def no
$game_system.se_play($data_system.decision_se)
Difficulty.set(2)
$scene = Scene_Map.new
end
end
#===================================================
#Scene_difficult_menu
#===================================================
class Scene_difficult_menu
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
case DIFFICULT::SPRITESET_TYPE
when 1
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
when 2
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.picture(DIFFICULT::PICTURE_NAME)
when 3
@spriteset = Spriteset_Map.new
end
@window_q2 = Window_question2.new
@window_q2.x = 50
@window_q2.y = 125-64
@window_help = Window_Help_dif_menu.new
@window_help.update(" ")
s1 = "Rookie"
s2 = "Easy"
s3 = "Normal"
s4 = "Hard"
s5 = "Mania"
s6 = "Unknown"
s7 = "Divine"
@window_help.x = 50
@window_help.y = 125
@window_command_dif = Window_Command.new(200, [s1,s2,s3,s4,s5,s6,s7])
@window_command_dif.y = 114+75
@window_command_dif.x = 220
@window_command_dif.index = @menu_index
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
#Execute when exiting the scene:
Graphics.freeze
@window_command_dif.dispose
@window_help.dispose
@window_q2.dispose
case DIFFICULT::SPRITESET_TYPE
when 1..2
@sprite.bitmap.dispose
@sprite.dispose
when 3
@spriteset.dispose
end
end
#--------------------------------------------------------------------------------------------------------
def update
@window_command_dif.update
case @window_command_dif.index
when 0
@window_help.update("The minimal difficulty only for losers") #"Rookie"
when 1
@window_help.update("An easy difficult level for kids") #"Easy"
when 2
@window_help.update("The defaut game difficluty") #"Normal"
when 3
@window_help.update("Start fighting stronger monsters") #"Hard"
when 4
@window_help.update("Maniac difficult level, only for advanced gamers") #"Mania"
when 5
@window_help.update("????")#"Unknown"
when 6
@window_help.update("Master the game fighting the strongest monsters")#"Divine"
end
#THIS IS FOR THE OPTION FUNCTIONS:
if Input.trigger?(Input::C)
case @window_command_dif.index
when 0
rookie
when 1
easy
when 2
normal
when 3
hard
when 4
mania
when 5
unknown
when 6
divine
end
end
end
def rookie #s1
$game_system.se_play($data_system.decision_se)
Difficulty.set(0)
$scene = Scene_Map.new
end
def easy #s2
$game_system.se_play($data_system.decision_se)
Difficulty.set(1)
$scene = Scene_Map.new
end
def normal #s3
$game_system.se_play($data_system.decision_se)
Difficulty.set(2)
$scene = Scene_Map.new
end
def hard #s4
$game_system.se_play($data_system.decision_se)
Difficulty.set(3)
$scene = Scene_Map.new
end
def mania #s5
$game_system.se_play($data_system.decision_se)
Difficulty.set(4)
$scene = Scene_Map.new
end
def unknown #s6
$game_system.se_play($data_system.decision_se)
Difficulty.set(5)
$scene = Scene_Map.new
end
def divine #s7
$game_system.se_play($data_system.decision_se)
Difficulty.set(6)
$scene = Scene_Map.new
end
end #of the Scene
#===================================================
#Window_Help_dif_menu
#===================================================
class Window_Help_dif_menu < Window_Base
def initialize
super(0, 0, 540,64)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = "Harlow Solid Italic"
self.contents.font.size = 20
end
def update(help_text)
self.contents.clear
self.contents.draw_text(0, 0, 440, 32, help_text)
end
end
class Window_question < Window_Base
def initialize
super(0, 0, 240,64)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = "Harlow Solid Italic"
self.contents.font.size = 20
self.contents.draw_text(0, 0, 210, 32, " Change game difficulty?")
end
end
class Window_question2 < Window_Base
def initialize
super(0, 0, 240,64)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = "Harlow Solid Italic"
self.contents.font.size = 20
self.contents.draw_text(0, 0, 210, 32, "Choose the difficult Level... ")
end
end