Here is full script list :
I'm using SBS Tanketai Battle System:
http://www.rmxpunlimited.net/resources/scr...em-tankentai-xpMinimap By Selwyn
CODE
#==============================================================================
# à ¹‚– Passability Mini Map
#------------------------------------------------------------------------------
# made by Selwyn/Squall // selwyn@rmxp.ch
# released the 30th of May 2006
#==============================================================================
#==============================================================================
# à ¹‚– Scene_Map
#------------------------------------------------------------------------------
# draw the mini map
# @corner is the corner you want the mini map to be displayed in.
# 1 is upper left, 2 is upper right, 3 is bottom left and 4 is bottom right
#==============================================================================
class Scene_Map
alias main_passminimap main
alias update_passminimap update
alias transfer_passminimap transfer_player
#--------------------------------------------------------------------------
# à ¹‚â€â€Ã¯Â¿Â½ initialize
#--------------------------------------------------------------------------
def initialize
@corner = 4 # 1 or 2 or 3 or 4
end
#--------------------------------------------------------------------------
# à ¹‚â€â€Ã¯Â¿Â½ main
#--------------------------------------------------------------------------
def main
@mini_map = Map_Event.new(@corner)
main_passminimap
@mini_map.dispose
end
#--------------------------------------------------------------------------
# à ¹‚â€â€Ã¯Â¿Â½ update
#--------------------------------------------------------------------------
def update
@mini_map.update
if $game_system.map_interpreter.running?
@mini_map.visible = false
elsif not $game_system.map_interpreter.running? and @mini_map.on?
@mini_map.visible = true
end
update_passminimap
end
#--------------------------------------------------------------------------
# à ¹‚â€â€Ã¯Â¿Â½ transfer_player
#--------------------------------------------------------------------------
def transfer_player
transfer_passminimap
@mini_map.dispose
@mini_map = Map_Event.new(@corner)
end
end
#==============================================================================
# à ¹‚– Map_Base
#------------------------------------------------------------------------------
# à ¹�'€€Base class for mini maps
#==============================================================================
class Map_Base < Sprite
#--------------------------------------------------------------------------
# à ¹‚â€â€Ã¯Â¿Â½ constants and instances
#--------------------------------------------------------------------------
PMP_VERSION = 6
ACTIVATED_ID = 22 # set the switch id for the minimap display (on/off)
attr_reader :event
#--------------------------------------------------------------------------
# à ¹‚â€â€Ã¯Â¿Â½ initialize
#--------------------------------------------------------------------------
def initialize(corner)
super(Viewport.new(16, 16, width, height))
viewport.z = 8000
@border = Sprite.new
@border.x = viewport.rect.x - 6
@border.y = viewport.rect.y - 6
@border.z = viewport.z - 1
@border.bitmap = RPG::Cache.picture("mapback")
self.visible = on?
self.opacity = 180
case corner
when 1
self.x = 16
self.y = 16
when 2
self.x = 640 - width - 16
self.y = 16
when 3
self.x = 16
self.y = 480 - height - 16
when 4
self.x = 640 - width - 16
self.y = 480 - height - 16
else
self.x = 16
self.y = 16
end
self.visible = on?
end
#--------------------------------------------------------------------------
# à ¹‚â€â€Ã¯Â¿Â½ dispose
#--------------------------------------------------------------------------
def dispose
@border.dispose
super
end
#--------------------------------------------------------------------------
# à ¹‚â€â€Ã¯Â¿Â½ x=
#--------------------------------------------------------------------------
def x=(x)
self.viewport.rect.x = x
@border.x = x - 6
end
#--------------------------------------------------------------------------
# à ¹‚â€â€Ã¯Â¿Â½ y=
#--------------------------------------------------------------------------
def y=(y)
self.viewport.rect.y = y
@border.y = y - 6
end
#--------------------------------------------------------------------------
# à ¹‚â€â€Ã¯Â¿Â½ visible=
#--------------------------------------------------------------------------
def visible=(bool)
super
self.viewport.visible = bool
@border.visible = bool
end
#--------------------------------------------------------------------------
# à ¹‚â€â€Ã¯Â¿Â½ minimap_on?
#--------------------------------------------------------------------------
def on?
return $game_switches[ACTIVATED_ID]
end
#--------------------------------------------------------------------------
# à ¹‚â€â€Ã¯Â¿Â½ update
#--------------------------------------------------------------------------
def update
super
self.visible = on?
if viewport.ox < display_x
viewport.ox += 1
elsif viewport.ox > display_x
viewport.ox -= 1
end
if viewport.oy < display_y
viewport.oy += 1
elsif viewport.oy > display_y
viewport.oy -= 1
end
end
#--------------------------------------------------------------------------
# à ¹‚â€â€Ã¯Â¿Â½ width
#--------------------------------------------------------------------------
def width
return 120
end
#--------------------------------------------------------------------------
# à ¹‚â€â€Ã¯Â¿Â½ height
#--------------------------------------------------------------------------
def height
return 90
end
#--------------------------------------------------------------------------
# à ¹‚â€â€Ã¯Â¿Â½ display_x
#--------------------------------------------------------------------------
def display_x
return $game_map.display_x * 3 / 64
end
#--------------------------------------------------------------------------
# à ¹‚â€â€Ã¯Â¿Â½ display_y
#--------------------------------------------------------------------------
def display_y
return $game_map.display_y * 3 / 64
end
end
#==============================================================================
# à ¹‚– Map_Passability
#------------------------------------------------------------------------------
# draws the mini map
#
# à ¹�'€€thanks to Fanha Giang (aka fanha99) for the autotile drawing method
#==============================================================================
class Map_Passability < Map_Base
#--------------------------------------------------------------------------
# à ¹‚â€â€Ã¯Â¿Â½ constants
#--------------------------------------------------------------------------
INDEX =
[
26, 27, 32, 33, 4, 27, 32, 33, 26, 5, 32, 33, 4, 5, 32, 33,
26, 27, 32, 11, 4, 27, 32, 11, 26, 5, 32, 11, 4, 5, 32, 11,
26, 27, 10, 33, 4, 27, 10, 33, 26, 5, 10, 33, 4, 5, 10, 33,
26, 27, 10, 11, 4, 27, 10, 11, 26, 5, 10, 11, 4, 5, 10, 11,
24, 25, 30, 31, 24, 5, 30, 31, 24, 25, 30, 11, 24, 5, 30, 11,
14, 15, 20, 21, 14, 15, 20, 11, 14, 15, 10, 21, 14, 15, 10, 11,
28, 29, 34, 35, 28, 29, 10, 35, 4, 29, 34, 35, 4, 29, 10, 35,
38, 39, 44, 45, 4, 39, 44, 45, 38, 5, 44, 45, 4, 5, 44, 45,
24, 29, 30, 35, 14, 15, 44, 45, 12, 13, 18, 19, 12, 13, 18, 11,
16, 17, 22, 23, 16, 17, 10, 23, 40, 41, 46, 47, 4, 41, 46, 47,
36, 37, 42, 43, 36, 5, 42, 43, 12, 17, 18, 23, 12, 13, 42, 43,
36, 41, 42, 47, 16, 17, 46, 47, 12, 17, 42, 47, 0, 1, 6, 7
]
X = [0, 1, 0, 1]
Y = [0, 0, 1, 1]
#--------------------------------------------------------------------------
# à ¹‚â€â€Ã¯Â¿Â½ initialize
#--------------------------------------------------------------------------
def initialize(corner)
super(corner)
@autotile = RPG::Cache.picture("minimap_tiles")
setup()
end
#--------------------------------------------------------------------------
# à ¹‚â€â€Ã¯Â¿Â½ setup
#--------------------------------------------------------------------------
def setup()
@map = load_data(sprintf("Data/Map%03d.rxdata", $game_map.map_id))
tileset = $data_tilesets[@map.tileset_id]
@passages = tileset.passages
@priorities = tileset.priorities
redefine_tiles
refresh
end
#--------------------------------------------------------------------------
# à ¹‚â€â€Ã¯Â¿Â½ pass
#--------------------------------------------------------------------------
def pass(tile_id)
return 15 if tile_id == nil
return @passages[tile_id] != nil ? @passages[tile_id] : 15
end
#--------------------------------------------------------------------------
# à ¹‚â€â€Ã¯Â¿Â½ passable
#--------------------------------------------------------------------------
def passable(tile_id)
return pass(tile_id) < 15
end
#--------------------------------------------------------------------------
# à ¹‚â€â€Ã¯Â¿Â½ redefine_tile
#--------------------------------------------------------------------------
def redefine_tiles
width = @map.width
height = @map.height
map = RPG::Map.new(width, height)
map.data = @map.data.dup
for x in 0...width
for y in 0...height
for level in [1, 2]
id = @map.data[x, y, level]
if id != 0 and @priorities[id] == 0
@map.data[x, y, 0] = id
@passages[@map.data[x, y, 0]] = @passages[id]
end
end
end
end
for x in 0...width
for y in 0...height
for level in [0]
tile = @map.data[x, y, level]
u = @map.data[x, y-1, level]
l = @map.data[x-1, y, level]
r = @map.data[x+1, y, level]
d = @map.data[x, y+1, level]
if !passable(tile)
map.data[x, y] = 0
else
if tile == 0
map.data[x, y, level] = 0
next
end
if pass(tile) < 15
if !passable(u) and !passable(l) and !passable(r) and !passable(d)
map.data[x, y, level] = 0
elsif !passable(u) and !passable(l) and !passable(r) and passable(d)
map.data[x, y, level] = 90
elsif !passable(u) and !passable(l) and !passable(d) and passable(r)
map.data[x, y, level] = 91
elsif !passable(u) and !passable(r) and !passable(d) and passable(l)
map.data[x, y, level] = 93
elsif !passable(l) and !passable(r) and !passable(d) and passable(u)
map.data[x, y, level] = 92
elsif !passable(u) and !passable(d) and passable(r) and passable(l)
map.data[x, y, level] = 81
elsif !passable(u) and !passable(r) and passable(d) and passable(l)
map.data[x, y, level] = 84
elsif !passable(u) and !passable(l) and passable(d) and passable(r)
map.data[x, y, level] = 82
elsif !passable(d) and !passable(r) and passable(l) and passable(u)
map.data[x, y, level] = 86
elsif !passable(d) and !passable(l) and passable(r) and passable(u)
map.data[x, y, level] = 88
elsif !passable(r) and !passable(l) and passable(d) and passable(u)
map.data[x, y, level] = 80
elsif !passable(u) and passable(d) and passable(r) and passable(l)
map.data[x, y, level] = 68
elsif !passable(d) and passable(u) and passable(r) and passable(l)
map.data[x, y, level] = 76
elsif !passable(r) and passable(d) and passable(u) and passable(l)
map.data[x, y, level] = 72
elsif !passable(l) and passable(d) and passable(u) and passable(r)
map.data[x, y, level] = 64
else
map.data[x, y, level] = 48
end
else
map.data[x, y, level] = 0
end
end
end
end
end
@map = map.dup
map = nil
end
#--------------------------------------------------------------------------
# à ¹‚â€â€Ã¯Â¿Â½ refresh
#--------------------------------------------------------------------------
def refresh
self.visible = false
self.bitmap = Bitmap.new(@map.width * 6, @map.height * 6)
bitmap = Bitmap.new(@map.width * 6, @map.height * 6)
rect1 = Rect.new(6, 0, 6, 6)
for y in 0...@map.height
for x in 0...@map.width
for level in [0]
tile_id = @map.data[x, y, level]
next if tile_id == 0
id = tile_id / 48 - 1
tile_id %= 48
for g in 0..3
h = 4 * tile_id + g
y1 = INDEX[h] / 6
x1 = INDEX[h] % 6
rect2 = Rect.new(x1 * 3, y1 * 3, 3, 3)
bitmap.blt(x * 6 + X[g] * 3, y * 6 + Y[g] * 3, @autotile, rect2)
end
end
end
end
d_rect = Rect.new(0, 0, @map.width * 6, @map.height * 6)
s_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.bitmap.stretch_blt(d_rect, bitmap, s_rect)
self.viewport.ox = display_x
self.viewport.oy = display_y
bitmap.clear
bitmap.dispose
end
end
#==============================================================================
# à ¹‚– Map_Event
#------------------------------------------------------------------------------
# à ¹�'€€draw the events and hero position
#==============================================================================
class Map_Event < Map_Passability
#--------------------------------------------------------------------------
# à ¹‚â€â€Ã¯Â¿Â½ initialize
#--------------------------------------------------------------------------
def initialize(corner = 4)
super(corner)
@dots = []
@player = Sprite.new(self.viewport)
@player.bitmap = RPG::Cache.picture("mmcursors")
@player.src_rect = Rect.new(0, 0, 15, 15)
@player.z = self.z + 3
@events = {}
for key in $game_map.events.keys
event = $game_map.events[key]
next if event.list == nil
for i in 0...event.list.size
next if event.list[i].code != 108
@events[key] = Sprite.new(self.viewport)
@events[key].z = self.z + 2
if !event.name.include?("event")
@events[key].bitmap = RPG::Cache.picture("event")
elsif !event.name.include?("enemy")
@events[key].bitmap = RPG::Cache.picture("enemy")
elsif !event.name.include?("teleport")
@events[key].bitmap = RPG::Cache.picture("teleport")
elsif !event.name.include?("chest")
@events[key].bitmap = RPG::Cache.picture("chest")
elsif !event.name.include?("npc")
@events[key].bitmap = RPG::Cache.picture("npc")
elsif !event.name.include?("savepoint")
@events[key].bitmap = RPG::Cache.picture("savepoint")
end
end
end
end
#--------------------------------------------------------------------------
# à ¹‚â€â€Ã¯Â¿Â½ dispose
#--------------------------------------------------------------------------
def dispose
@player.dispose
for event in @events.values
event.dispose
end
super
end
#--------------------------------------------------------------------------
# à ¹‚â€â€Ã¯Â¿Â½ update
#--------------------------------------------------------------------------
def update
super
@player.x = $game_player.real_x * 3 / 64 - 5
@player.y = $game_player.real_y * 3 / 64 - 4
@player.src_rect.x = ($game_player.direction / 2 - 1) * 15
for key in @events.keys
event = @events[key]
mapevent = $game_map.events[key]
event.x = mapevent.real_x * 3 / 64
event.y = mapevent.real_y * 3 / 64
end
end
end
"The Law's Quicksave ( edited it a little bit )"
CODE
#------------------------------------------------------------------------------
#==============================================================================
#==============================================================================
#======================*Law's QuickSave System*================================
#=========================Author: The Law G14==================================
#============================Version 1.0=======================================
#==============================================================================
#------------------------------------------------------------------------------
#==============================================================================
Quick_Save_Path = 'Data/'
Quick_Save_Name = 'Quicksave'
Quick_Save_Ext = ''
Quick_Save = Quick_Save_Path + Quick_Save_Name + '.' + Quick_Save_Ext
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs menu screen processing.
#==============================================================================
class Scene_Menu
#--------------------------------------------------------------------------
# * Object Initialization
# menu_index : command cursor's initial position
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Make command window
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "Status"
s5 = "Save"
s6 = "QuickSave"
s7 = "End Game"
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
@command_window.index = @menu_index
# If number of party members is 0
if $game_party.actors.size == 0
# Disable items, skills, equipment, and status
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
# If save is forbidden
if $game_system.save_disabled
# Disable save
@command_window.disable_item(4)
end
# Make play time window
@playtime_window = Window_PlayTime.new
@playtime_window.x = 0
@playtime_window.y = 256
# Make steps window
@steps_window = Window_Steps.new
@steps_window.x = 0
@steps_window.y = 336
# Make gold window
@gold_window = Window_Gold.new
@gold_window.x = 0
@gold_window.y = 416
# Make status window
@status_window = Window_MenuStatus.new
@status_window.x = 160
@status_window.y = 0
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@command_window.dispose
@playtime_window.dispose
@steps_window.dispose
@gold_window.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@command_window.update
@playtime_window.update
@steps_window.update
@gold_window.update
@status_window.update
# If command window is active: call update_command
if @command_window.active
update_command
return
end
# If status window is active: call update_status
if @status_window.active
update_status
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when command window is active)
#--------------------------------------------------------------------------
def update_command
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to map screen
$scene = Scene_Map.new
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# If command other than save or end game, and party members = 0
if $game_party.actors.size == 0 and @command_window.index < 4
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Branch by command window cursor position
case @command_window.index
when 0 # item
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to item screen
$scene = Scene_FAFAF.new
when 1 # skill
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2 # equipment
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3 # status
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4 # save
# If saving is forbidden
if $game_system.save_disabled
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to save screen
$scene = Scene_Save.new
when 5 # quicksave
# Switch to save screen
$scene = Scene_Warning.new
when 6 # end game
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to end game screen
$scene = Scene_End.new
end
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when status window is active)
#--------------------------------------------------------------------------
def update_status
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Make command window active
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 1 # skill
# If this actor's action limit is 2 or more
if $game_party.actors[@status_window.index].restriction >= 2
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to skill screen
$scene = Scene_Skill.new(@status_window.index)
when 2 # equipment
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to equipment screen
$scene = Scene_Equip.new(@status_window.index)
when 3 # status
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to status screen
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end
#==============================================================================
# ** Scene_Title
#------------------------------------------------------------------------------
# This class performs title screen processing.
#==============================================================================
class Scene_Title
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# If battle test
if $BTEST
battle_test
return
end
# Load database
$data_actors = load_data("Data/Actors.rxdata")
$data_classes = load_data("Data/Classes.rxdata")
$data_skills = load_data("Data/Skills.rxdata")
$data_items = load_data("Data/Items.rxdata")
$data_weapons = load_data("Data/Weapons.rxdata")
$data_armors = load_data("Data/Armors.rxdata")
$data_enemies = load_data("Data/Enemies.rxdata")
$data_troops = load_data("Data/Troops.rxdata")
$data_states = load_data("Data/States.rxdata")
$data_animations = load_data("Data/Animations.rxdata")
$data_tilesets = load_data("Data/Tilesets.rxdata")
$data_common_events = load_data("Data/CommonEvents.rxdata")
$data_system = load_data("Data/System.rxdata")
# Make system object
$game_system = Game_System.new
# Make title graphic
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
# Make command window
s1 = "Quickload"
s2 = "New Game"
s3 = "Continue"
s4 = "Shutdown"
@command_window = Window_Command.new(192, [s1, s2, s3, s4])
@command_window.back_opacity = 160
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 288
# Continue enabled determinant
# Check if at least one save file exists
# If enabled, make @continue_enabled true; if disabled, make it false
@continue_enabled = false
for i in 0..3
if FileTest.exist?("Save#{i+1}.rxdata")
@continue_enabled = true
end
end
# If continue is enabled, move cursor to "Continue"
# If disabled, display "Continue" text in gray
if @continue_enabled
@command_window.index = 2
else
@command_window.disable_item(2)
end
# Quickload enabled determinant
# Check if Quick_Save exists
# If enabled, make @quickload_enabled true; if disabled, make it false
@quickload_enabled = false
if FileTest.exist?(Quick_Save)
@quickload_enabled = true
end
# If quickload is enabled, move cursor to "Quickload"
# If disabled, display "Quickload" text in gray
if @quickload_enabled
@command_window.index = 1
else
@command_window.disable_item(0)
end
# Play title BGM
$game_system.bgm_play($data_system.title_bgm)
# Stop playing ME and BGS
Audio.me_stop
Audio.bgs_stop
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of command window
@command_window.dispose
# Dispose of title graphic
@sprite.bitmap.dispose
@sprite.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update command window
@command_window.update
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 0 # Quickload
command_quickload
when 1 # New game
command_new_game
when 2 # Continue
command_continue
when 3 # Shutdown
command_shutdown
end
end
end
#--------------------------------------------------------------------------
# * Command: New Game
#--------------------------------------------------------------------------
def command_new_game
# 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
$scene = Scene_Map.new
if FileTest.exist?(Quick_Save)
$scene = Scene_QuicksaveWarning.new
end
end
#--------------------------------------------------------------------------
# * Command: Continue
#--------------------------------------------------------------------------
def command_continue
# If continue is disabled
unless @continue_enabled
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to load screen
$scene = Scene_Load.new
if FileTest.exist?(Quick_Save)
# Stop BGM
Audio.bgm_stop
$scene = Scene_ContinueWarning.new
end
end
end
#--------------------------------------------------------------------------
# * Command: Shutdown
#--------------------------------------------------------------------------
def command_shutdown
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Fade out BGM, BGS, and ME
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
if FileTest.exist(Quick_Save)
quicksave
end
# Shutdown
$scene = nil
end
#--------------------------------------------------------------------------
# * Command: Quickload
#--------------------------------------------------------------------------
def command_quickload
# If continue is disabled
unless @quickload_enabled
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Quickload Quick_Save data
quickload
end
#--------------------------------------------------------------------------
# * Battle Test
#--------------------------------------------------------------------------
def battle_test
# Load database (for battle test)
$data_actors = load_data("Data/BT_Actors.rxdata")
$data_classes = load_data("Data/BT_Classes.rxdata")
$data_skills = load_data("Data/BT_Skills.rxdata")
$data_items = load_data("Data/BT_Items.rxdata")
$data_weapons = load_data("Data/BT_Weapons.rxdata")
$data_armors = load_data("Data/BT_Armors.rxdata")
$data_enemies = load_data("Data/BT_Enemies.rxdata")
$data_troops = load_data("Data/BT_Troops.rxdata")
$data_states = load_data("Data/BT_States.rxdata")
$data_animations = load_data("Data/BT_Animations.rxdata")
$data_tilesets = load_data("Data/BT_Tilesets.rxdata")
$data_common_events = load_data("Data/BT_CommonEvents.rxdata")
$data_system = load_data("Data/BT_System.rxdata")
# Reset frame count for measuring play time
Graphics.frame_count = 0
# Make each 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 party for battle test
$game_party.setup_battle_test_members
# Set troop ID, can escape flag, and battleback
$game_temp.battle_troop_id = $data_system.test_troop_id
$game_temp.battle_can_escape = true
$game_map.battleback_name = $data_system.battleback_name
# Play battle start SE
$game_system.se_play($data_system.battle_start_se)
# Play battle BGM
$game_system.bgm_play($game_system.battle_bgm)
# Switch to battle screen
$scene = Scene_Battle.new
end
#===============================================================================
# ** Scene_Warning
#-------------------------------------------------------------------------------
# This class performs warning screen processing.
#===============================================================================
class Scene_Warning
def main
#---------------------------------------------------------------------------
# * Make Command Window
#---------------------------------------------------------------------------
s1 = "No"
s2 = "Yes"
@command_window = Window_Command.new(120, [s1, s2])
@command_window.back_opacity = 100
@command_window.x = 253
@command_window.y = 230
# Make Warning Window
@warning_window = Window_Warning.new
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@warning_window.dispose
@command_window.dispose
end
#-----------------------------------------------------------------------------
# * Update Window
#-----------------------------------------------------------------------------
def update
@command_window.update
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 0 # No
command_no
when 1 # Yes
command_yes
# Update warning window
@warning_window.update
end
end
end
#-----------------------------------------------------------------------------
# * Command_No
#-----------------------------------------------------------------------------
def command_no
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new
end
#-----------------------------------------------------------------------------
# * Command_Yes
#-----------------------------------------------------------------------------
def command_yes
$game_system.se_play($data_system.save_se)
quicksave
end
end
#===============================================================================
# ** Window_Warning
#-------------------------------------------------------------------------------
# This window displays warning text.
#===============================================================================
class Window_Warning < Window_Base
#-----------------------------------------------------------------------------
# * Object Initialization
#-----------------------------------------------------------------------------
def initialize
super(0, 0, 640, 480)
self.back_opacity = 0
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#-----------------------------------------------------------------------------
# * Refresh
#-----------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = knockout_color
self.contents.draw_text(250, 80, 640, 100, "WARNING")
self.contents.draw_text(80, 120, 640, 100, "Are you sure you would like to quicksave game data?")
end
end
#-------------------------------------------------------------------------------
# * Quicksave
#-------------------------------------------------------------------------------
def quicksave
file = File.open(Quick_Save, 'wb')
characters = []
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
characters.push([actor.character_name, actor.character_hue])
end
# Write character data for drawing save file
Marshal.dump(characters, file)
# Wrire frame count for measuring play time
Marshal.dump(Graphics.frame_count, file)
# Increase save count by 1
$game_system.save_count += 1
# Save magic number
# (A random value will be written each time saving with editor)
$game_system.magic_number = $data_system.magic_number
# Write each type of game object
Marshal.dump($game_system, file)
Marshal.dump($game_switches, file)
Marshal.dump($game_variables, file)
Marshal.dump($game_self_switches, file)
Marshal.dump($game_screen, file)
Marshal.dump($game_actors, file)
Marshal.dump($game_party, file)
Marshal.dump($game_troop, file)
Marshal.dump($game_map, file)
Marshal.dump($game_player, file)
file.close
$scene = Scene_Title.new
end
#-------------------------------------------------------------------------------
# * Quickload
#-------------------------------------------------------------------------------
def quickload
$game_temp = Game_Temp.new unless $game_temp
file = File.open(Quick_Save)
read_save_data(file)
file.close
File.delete(Quick_Save)
$game_system.bgm_play($game_system.playing_bgm)
$game_system.bgs_play($game_system.playing_bgs)
$game_map.update
$scene = Scene_Map.new
end
def read_save_data(file)
# 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)
$game_self_switches = Marshal.load(file)
$game_screen = Marshal.load(file)
$game_actors = Marshal.load(file)
$game_party = Marshal.load(file)
$game_troop = Marshal.load(file)
$game_map = Marshal.load(file)
$game_player = Marshal.load(file)
# If magic number is different from when saving
# (if editing was added with editor)
if $game_system.magic_number != $data_system.magic_number
# Load map
$game_map.setup($game_map.map_id)
$game_player.center($game_player.x, $game_player.y)
end
# Refresh party members
$game_party.refresh
end
#===============================================================================
# ** Scene_QuicksaveWarning
#-------------------------------------------------------------------------------
# This class performs warning screen processing.
#===============================================================================
class Scene_QuicksaveWarning
def main
#---------------------------------------------------------------------------
# * Make Command Window
#---------------------------------------------------------------------------
s1 = "No"
s2 = "Yes"
@command_window = Window_Command.new(120, [s1, s2])
@command_window.back_opacity = 100
@command_window.x = 253
@command_window.y = 240
# Make Warning Window
@warnings_window = Window_QuicksaveWarning.new
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@warnings_window.dispose
@command_window.dispose
end
#-----------------------------------------------------------------------------
# * Update Window
#-----------------------------------------------------------------------------
def update
@command_window.update
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 0 # No
command_no
when 1 # Yes
command_yes
# Update warning window
@warnings_window.update
end
end
end
#-----------------------------------------------------------------------------
# * Command_No
#-----------------------------------------------------------------------------
def command_no
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Title.new
end
#-----------------------------------------------------------------------------
# * Command_Yes
#-----------------------------------------------------------------------------
def command_yes
$game_system.se_play($data_system.decision_se)
File.delete(Quick_Save)
# 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
$scene = Scene_Map.new
end
end
#===============================================================================
# ** Window_QuicksaveWarning
#-------------------------------------------------------------------------------
# This window displays warning text.
#===============================================================================
class Window_QuicksaveWarning < Window_Base
#-----------------------------------------------------------------------------
# * Object Initialization
#-----------------------------------------------------------------------------
def initialize
super(0, 0, 640, 480)
self.back_opacity = 0
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.clear
self.contents.font.color = knockout_color
self.contents.draw_text(250, 80, 640, 100, "WARNING")
self.contents.draw_text(80, 120, 640, 100, "Continuing this action will delete any quicksave files.")
self.contents.draw_text(130, 160, 640, 100, "Are you sure you would like to continue?")
end
end
#===============================================================================
# ** Scene_ContinueWarning
#-------------------------------------------------------------------------------
# This class performs warning screen processing.
#===============================================================================
class Scene_ContinueWarning
def main
#---------------------------------------------------------------------------
# * Make Command Window
#---------------------------------------------------------------------------
s1 = "No"
s2 = "Yes"
@command_window = Window_Command.new(120, [s1, s2])
@command_window.back_opacity = 100
@command_window.x = 253
@command_window.y = 240
# Make Warning Window
@warnings_window = Window_QuicksaveWarning.new
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@warnings_window.dispose
@command_window.dispose
end
#-----------------------------------------------------------------------------
# * Update Window
#-----------------------------------------------------------------------------
def update
@command_window.update
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 0 # No
command_no
when 1 # Yes
command_yes
# Update warning window
@warnings_window.update
end
end
end
#-----------------------------------------------------------------------------
# * Command_No
#-----------------------------------------------------------------------------
def command_no
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Title.new
end
#-----------------------------------------------------------------------------
# * Command_Yes
#-----------------------------------------------------------------------------
def command_yes
$game_system.se_play($data_system.decision_se)
File.delete(Quick_Save)
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to load screen
$scene = Scene_Load.new
end
end
#===============================================================================
# ** Window_ContinueWarning
#-------------------------------------------------------------------------------
# This window displays warning text.
#===============================================================================
class Window_ContinueWarning < Window_Base
#-----------------------------------------------------------------------------
# * Object Initialization
#-----------------------------------------------------------------------------
def initialize
super(0, 0, 640, 480)
self.back_opacity = 0
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.clear
self.contents.font.color = knockout_color
self.contents.draw_text(250, 80, 640, 100, "WARNING")
self.contents.draw_text(80, 120, 640, 100, "Continuing this action will delete any quicksave files.")
self.contents.draw_text(130, 160, 640, 100, "Are you sure you would like to continue?")
end
end
#==============================================================================
# ** Window_PlayTime
#------------------------------------------------------------------------------
# This window displays play time on the menu screen.
#==============================================================================
class Window_PlayTime < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 80)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 120, 32, "Play Time")
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
text = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(4, 20, 120, 32, text, 2)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
#==============================================================================
# ** Window_Steps
#------------------------------------------------------------------------------
# This window displays step count on the menu screen.
#==============================================================================
class Window_Steps < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 80)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 120, 32, "Step Count")
self.contents.font.color = normal_color
self.contents.draw_text(4, 24, 120, 32, $game_party.steps.to_s, 2)
end
end
"Custom Menu System (FF7 Style)"
CODE
#*********************************************************
#Final Fantasy VII menu setup
#*********************************************************
#To use:
#If you do not want Faces, go to line 94
#and change delete the # of draw_actor_graphic
#and put a # infront of draw_actor_face
#
#Create a new folder in the Characters folder, and call it Faces
#Adding faces: add a 80x80 picture with the same name as the characterset it
#corrosponds with in the Faces folder
#========================================
#�ˇ Window_Base
#--------------------------------------------------------------------------------
# Setting functions for the "Base"
#========================================
class Window_Base < Window
def draw_actor_face(actor, x, y)
face = RPG::Cache.character("Faces/" + actor.character_name, actor.character_hue)
fw = face.width
fh = face.height
src_rect = Rect.new(0, 0, fw, fh)
self.contents.blt(x - fw / 23, y - fh, face, src_rect)
end
end
def draw_actor_battler_graphic(actor, x, y)
bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
#========================================
#�ˇ Game_Map
#--------------------------------------------------------------------------------
# Setting functions for the Map
#========================================
class Game_Map
def name
$map_infos[@map_id]
end
end
#========================================
#�ˇ Window_Title
#--------------------------------------------------------------------------------
# Setting functions for the Title
#========================================
class Scene_Title
$map_infos = load_data("Data/MapInfos.rxdata")
for key in $map_infos.keys
$map_infos[key] = $map_infos[key].name
end
end
#==============================================================================
# �ˇ Window_MenuStatus
#------------------------------------------------------------------------------
# Sets up the Choosing.
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# Set up
#--------------------------------------------------------------------------
def initialize
super(0, 0, 560, 454)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Arial"
self.contents.font.size = 18
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# Drawing Info on Screen
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 94
y = i * 110
actor = $game_party.actors[i]
# draw_actor_face(actor, 12, y + 90) #To get rid of the Face, put a "#" before the draw_ of this line
draw_actor_graphic(actor, 48, y + 65) #and delete the "#" infront of draw of this line
draw_actor_name(actor, x, y)
draw_actor_level(actor, x + 144, y)
draw_actor_state(actor, x + 280, y )
draw_actor_exp(actor, x+ 144, y + 38)
draw_actor_hp(actor, x, y + 38)
draw_actor_sp(actor, x, y + 58)
end
end
#--------------------------------------------------------------------------
# Update of Cursor
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 110, self.width - 32, 96)
end
end
end
#=======================================#
# �ˇWindow_GameStats #
# written by AcedentProne #
#------------------------------------------------------------------------------#
class Window_GameStats < Window_Base
def initialize
super(0, 0, 160, 60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Arial"
self.contents.font.size = 18
refresh
end
def refresh
self.contents.clear
#Drawing gold into separate commas by Dubealex
case $game_party.gold
when 0..9999
gold = $game_party.gold
when 10000..99999
gold = $game_party.gold.to_s
array = gold.split(//)
gold = array[0].to_s+array[1].to_s+","+array[2].to_s+array[3].to_s+array[4].to_s
when 100000..999999
gold = $game_party.gold.to_s
array = gold.split(//)
gold = array[0].to_s+array[1].to_s+array[2].to_s+","+array[3].to_s+array[4].to_s+array[5].to_s
when 1000000..9999999
gold = $game_party.gold.to_s
array = gold.split(//)
gold = array[0].to_s+","+array[1].to_s+array[2].to_s+array[3].to_s+","+array[4].to_s+array[5].to_s+array[6].to_s
end
#Draw Gold
self.contents.font.color = system_color
gold_word = $data_system.words.gold.to_s
cx = contents.text_size(gold_word).width
cx2=contents.text_size(gold.to_s).width
self.contents.draw_text(4, 4, 120-cx-2, 32, gold_word)
self.contents.font.color = normal_color
self.contents.draw_text(124-cx2+1, 4, cx2, 32, gold.to_s, 2)
self.contents.font.color = system_color
# Draw "Time"
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
text = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(4, -10, 120, 32, text, 2)
self.contents.font.color = system_color
self.contents.draw_text(4, -10, 120, 32, "Time")
end
#--------------------------------------------------------------------------
# Update of The count
#--------------------------------------------------------------------------
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
#==============================================================================
# �ˇ Window_Mapname
#------------------------------------------------------------------------------
# �@Draws the Map name
#==============================================================================
class Window_Mapname < Window_Base
#--------------------------------------------------------------------------
# Set up
#--------------------------------------------------------------------------
def initialize
super(0, 0, 320, 44)
self.contents = Bitmap.new(width - 60, height - 32)
self.contents.font.name = "Arial"
self.contents.font.size = 17
refresh
end
#--------------------------------------------------------------------------
# Draws info on screen
#--------------------------------------------------------------------------
def refresh
self.contents.clear
# Map Name
#map = $game_map.name
self.contents.font.color = system_color
self.contents.draw_text(4, -10, 220, 32, "Location")
self.contents.font.color = normal_color
self.contents.draw_text(175, -10, 80, 32, $game_map.name)
end
end
#==============================================================================
# �ˇ Scene_Menu
#------------------------------------------------------------------------------
# FF7 menu layout as requested by AcedentProne.
#==============================================================================
class Scene_Menu
#--------------------------- edit-------------------------------
attr_reader :status_window
#/--------------------------- edit-------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "Status"
s5 = "Memory"
s6 = "Quicksave"
s7 = "Quit"
#--------------------------- edit-------------------------------
# Command menu
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6,s7])
@command_window.x = 640 - @command_window.width
@command_window.y = 480
@command_window.z = 110
@command_window.index = @menu_index
#If certain options are avaliable
if $game_party.actors.size == 0
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
if $game_system.save_disabled
@command_window.disable_item(4)
end
#Showing location window
@map = Window_Mapname.new
@map.x = 640 - @map.width
@map.y = 0 - @map.height - 1
@map.z = 110
#Showing the game stats
@game_stats_window = Window_GameStats.new
@game_stats_window.x = 0 - @game_stats_window.width
@game_stats_window.y = 480 - @map.height - @game_stats_window.height
@game_stats_window.z =110
#Showing the Menu Status window
@status_window = Window_MenuStatus.new
@status_window.x = 640
@status_window.y = 8
@status_window.z = 100
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@game_stats_window.dispose
@status_window.dispose
@map.dispose
end
#--------------------------------------------------------------------------
#Defining the delay
#--------------------------------------------------------------------------
def delay(seconds)
for i in 0...(seconds * 1)
sleep 0.01
Graphics.update
end
end
#--------------------------------------------------------------------------
# Updating
#--------------------------------------------------------------------------
def update
@command_window.update
@status_window.update
@map.update
#Moving Windows inplace
gamepos = 640 - @game_stats_window.width
mappos = 480 - @map.height - 1
if @command_window.y > 0
@command_window.y -= 60
end
if @game_stats_window.x < gamepos
@game_stats_window.x += 80
end
if @map.y < mappos
@map.y += 80
end
if @status_window.x > 0
@status_window.x -= 80
end
#Saying if options are active
if @command_window.active
update_command
return
end
if @status_window.active
update_status
return
end
end
#--------------------------------------------------------------------------
# Updating the Command Selection
#--------------------------------------------------------------------------
def update_command
# If B button is pushed
if Input.trigger?(Input::B)
# Plays assigned SE
$game_system.se_play($data_system.cancel_se)
#Looping for moving windows out
loop do
if @command_window.y < 480
@command_window.y += 40
end
if @game_stats_window.x > 0 - @game_stats_window.width
@game_stats_window.x -= 40
end
if @map.y > 0 - @map.height
@map.y -= 40
end
if @status_window.x < 640
@status_window.x += 40
end
delay(0.5)
if @status_window.x >= 640
break
end
end
# Go to Map
$scene = Scene_Map.new
return
end
# If C button is pused
if Input.trigger?(Input::C)
# Checks actor size
if $game_party.actors.size == 0 and @command_window.index < 4
# plays SE
$game_system.se_play($data_system.buzzer_se)
return
end
case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
loop do
if @command_window.y < 480
@command_window.y += 40
end
if @game_stats_window.x > 0 - @game_stats_window.width
@game_stats_window.x -= 40
end
if @map.y > 0 - @map.height
@map.y -= 40
end
if @status_window.x < 640
@status_window.x += 40
end
delay(0.5)
if @status_window.x >= 640
break
end
end
$scene = Scene_Item.new
when 1
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4
if $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
loop do
if @command_window.y < 480
@command_window.y += 40
end
if @game_stats_window.x > 0 - @game_stats_window.width
@game_stats_window.x -= 40
end
if @map.y > 0 - @map.height
@map.y -= 40
end
if @status_window.x < 640
@status_window.x += 40
end
delay(0.5)
if @status_window.x >= 640
break
end
end
$scene = Scene_Save.new
when 5
# Switch to save screen
$scene = Scene_Warning.new
when 6
$game_system.se_play($data_system.decision_se)
loop do
if @command_window.y < 480
@command_window.y += 40
end
if @game_stats_window.x > 0 - @game_stats_window.width
@game_stats_window.x -= 40
end
if @map.y > 0 - @map.height
@map.y -= 40
end
if @status_window.x < 640
@status_window.x += 40
end
delay(0.5)
if @status_window.x >= 640
break
end
end
$scene = Scene_End.new
return
end
end
#--------------------------------------------------------------------------
# Updating Status Screen
#--------------------------------------------------------------------------
def update_status
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
if Input.trigger?(Input::C)
case @command_window.index
when 1 # ƒXƒLƒ‹
# ‚�‚ĚƒAƒNƒ^�[‚ĚŤs“���ŚŔ‚Ş 2 ˆČŹă‚̏ꍇ
if $game_party.actors[@status_window.index].restriction >= 2
# ƒuƒU�[ SE ‚đ‰‰‘t
$game_system.se_play($data_system.buzzer_se)
return
end
# Śˆ’č SE ‚đ‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒXƒLƒ‹‰ć–Ę‚ɐŘ‚č‘�‚�
$scene = Scene_Skill.new(@status_window.index)
when 2
$game_system.se_play($data_system.decision_se)
loop do
if @command_window.y < 480
@command_window.y += 40
end
if @game_stats_window.x > 0 - @game_stats_window.width
@game_stats_window.x -= 40
end
if @map.y > 0 - @map.height
@map.y -= 40
end
if @status_window.x < 640
@status_window.x += 40
end
delay(0.5)
if @status_window.x >= 640
break
end
end
$scene = Scene_Equip.new(@status_window.index)
when 3
$game_system.se_play($data_system.decision_se)
loop do
if @command_window.y < 480
@command_window.y += 40
end
if @game_stats_window.x > 0 - @game_stats_window.width
@game_stats_window.x -= 40
end
if @map.y > 0 - @map.height
@map.y -= 40
end
if @status_window.x < 640
@status_window.x += 40
end
delay(0.5)
if @status_window.x >= 640
break
end
end
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end
end
"Custom Skill Script"
CODE
#==============================================================================
# ** Window_Skill
#------------------------------------------------------------------------------
# This window displays usable skills on the skill and battle screens.
#==============================================================================
class Window_Skill < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
# actor : actor
#--------------------------------------------------------------------------
def initialize(actor)
super(300, 64, 340, 416)
@actor = actor
@column_max = 1
refresh
self.index = 0
# If in battle, move window to center of screen
# and make it semi-transparent
if $game_temp.in_battle
self.y = 64
self.height = 256
self.back_opacity = 160
end
end
#--------------------------------------------------------------------------
# * Acquiring Skill
#--------------------------------------------------------------------------
def skill
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 0...@actor.skills.size
skill = $data_skills[@actor.skills[i]]
if skill != nil
@data.push(skill)
end
end
# If item count is not 0, make a bit map and draw all items
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
skill = @data[index]
if @actor.skill_can_use?(skill.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
y = index / 1 * 32
x = 4 + index % 1 * (288 + 32)
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
self.contents.draw_text(x + 200, y, 48, 32, skill.sp_cost.to_s, 2)
end
#--------------------------------------------------------------------------
# * Help Text Update
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.skill == nil ? "" : self.skill.description)
end
end
#==============================================================================
# ** Window_SkillStatus
#------------------------------------------------------------------------------
# This window displays the skill user's status on the skill screen.
#==============================================================================
class Window_SkillStatus < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
# actor : actor
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 64, 300, 416)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# * Draw Face Graphic
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_actor_face_graphic(actor, x, y)
bitmap = RPG::Cache.picture(actor.id.to_s)
self.contents.blt(x, y, bitmap, Rect.new(0, 0, bitmap.width, bitmap.height))
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(15, 125, 100, 100,"State:", 2)
self.contents.draw_text(15, 155, 100, 100,"Class:", 2)
draw_actor_graphic(@actor, 10, 50)
draw_actor_name(@actor, 30, 10)
draw_actor_state(@actor, 125, 159)
draw_actor_class(@actor, 125, 189)
draw_actor_hp(@actor, 120, 60)
draw_actor_sp(@actor, 120, 110)
end
end
"The Law's Custom Shop Script
CODE
#==============================================================================
# ** Module_Customization
#------------------------------------------------------------------------------
# This module contains the customization of the script.
#==============================================================================
module Customization
# true = ON / false = OFF
Music_On = true
# 1 = item price / 5
# 2 = item price / 4
# 3 = item price / 2 (Default)
# 4 = item price / 1
# 5 = item price * 2
Sell_Price = 3
# true = ON / false = OFF
Background_Pic = true
end
#==============================================================================
# ** Window_Gold
#------------------------------------------------------------------------------
# This window displays amount of gold.
#==============================================================================
class Window_Gold < Window_Base
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
alias custom_shop_law_refresh refresh
#--------------------------------------------------------------------------
# * Draw Picture
#--------------------------------------------------------------------------
def draw_picture(x, y)
bitmap = RPG::Cache.picture("Coin")
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x, y, bitmap, src_rect)
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
custom_shop_law_refresh
self.contents.clear
draw_picture(105, 4)
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(0, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)
end
end
#==============================================================================
# ** Window_ShopStatus
#------------------------------------------------------------------------------
# This window displays number of items in possession and the actor's equipment
# on the shop screen.
#==============================================================================
class Window_ShopStatus < Window_Base
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
alias custom_shop_law_refresh2 refresh
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
custom_shop_law_refresh2
self.contents.clear
if @item == nil
return
end
case @item
when RPG::Item
number = $game_party.item_number(@item.id)
when RPG::Weapon
number = $game_party.weapon_number(@item.id)
when RPG::Armor
number = $game_party.armor_number(@item.id)
end
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 200, 32, "Number in possession")
self.contents.font.color = normal_color
self.contents.draw_text(204, 0, 32, 32, number.to_s, 2)
if @item.is_a?(RPG::Item)
return
end
# Equipment adding information
for i in 0...$game_party.actors.size
# Get actor
actor = $game_party.actors[i]
# If equippable, then set to normal text color. If not, set to
# invalid text color.
if actor.equippable?(@item)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
# Draw actor's name
self.contents.draw_text(30, 64 + 64 * i, 120, 32, actor.name)
# Draw actor's Character Graphic
draw_actor_graphic(actor, 10, 114 + 64 * i)
# Get current equipment
if @item.is_a?(RPG::Weapon)
item1 = $data_weapons[actor.weapon_id]
elsif @item.kind == 0
item1 = $data_armors[actor.armor1_id]
elsif @item.kind == 1
item1 = $data_armors[actor.armor2_id]
elsif @item.kind == 2
item1 = $data_armors[actor.armor3_id]
else
item1 = $data_armors[actor.armor4_id]
end
# If equippable
if actor.equippable?(@item)
# If weapon
if @item.is_a?(RPG::Weapon)
atk1 = item1 != nil ? item1.atk : 0
atk2 = @item != nil ? @item.atk : 0
change = atk2 - atk1
end
# If armor
if @item.is_a?(RPG::Armor)
pdef1 = item1 != nil ? item1.pdef : 0
mdef1 = item1 != nil ? item1.mdef : 0
pdef2 = @item != nil ? @item.pdef : 0
mdef2 = @item != nil ? @item.mdef : 0
change = pdef2 - pdef1 + mdef2 - mdef1
end
# Draw parameter change values
self.contents.draw_text(124, 64 + 64 * i, 112, 32,
sprintf("%+d", change), 2)
end
# Draw item
if item1 != nil
x = 40
y = 64 + 64 * i + 32
bitmap = RPG::Cache.icon(item1.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 212, 32, item1.name)
end
end
end
end
#==============================================================================
# ** Scene_Shop
#------------------------------------------------------------------------------
# This class performs shop screen processing.
#==============================================================================
class Scene_Shop
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Make help window
@help_window = Window_Help.new
# Make command window
@command_window = Window_ShopCommand.new
# Make gold window
@gold_window = Window_Gold.new
@gold_window.x = 480
@gold_window.y = 64
# Make dummy window
@dummy_window = Window_Base.new(0, 128, 640, 352)
# Make buy window
@buy_window = Window_ShopBuy.new($game_temp.shop_goods)
@buy_window.active = false
@buy_window.visible = false
@buy_window.help_window = @help_window
# Make sell window
@sell_window = Window_ShopSell.new
@sell_window.active = false
@sell_window.visible = false
@sell_window.help_window = @help_window
# Make quantity input window
@number_window = Window_ShopNumber.new
@number_window.active = false
@number_window.visible = false
# Make status window
@status_window = Window_ShopStatus.new
@status_window.visible = false
if Customization::Background_Pic
@help_window.opacity = 100
@command_window.opacity = 100
@gold_window.opacity = 100
@dummy_window.opacity = 100
@buy_window.opacity = 100
@sell_window.opacity = 100
@number_window.opacity = 100
@status_window.opacity = 100
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.picture("background")
end
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@help_window.dispose
@command_window.dispose
@gold_window.dispose
@dummy_window.dispose
@buy_window.dispose
@sell_window.dispose
@number_window.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
if Customization::Music_On
$game_system.bgm_memorize
end
# Update windows
@help_window.update
@command_window.update
@gold_window.update
@dummy_window.update
@buy_window.update
@sell_window.update
@number_window.update
@status_window.update
if Customization::Music_On
Audio.bgm_play("Audio/BGM/001-Battle01", 100, 100)
end
# If command window is active: call update_command
if @command_window.active
update_command
return
end
# If buy window is active: call update_buy
if @buy_window.active
update_buy
return
end
# If sell window is active: call update_sell
if @sell_window.active
update_sell
return
end
# If quantity input window is active: call update_number
if @number_window.active
update_number
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when command window is active)
#--------------------------------------------------------------------------
def update_command
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to map screen
if Customization::Music_On
$game_system.bgm_restore
end
$scene = Scene_Map.new
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 0 # buy
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Change windows to buy mode
@command_window.active = false
@dummy_window.visible = false
@buy_window.active = true
@buy_window.visible = true
@buy_window.refresh
@status_window.visible = true
when 1 # sell
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Change windows to sell mode
@command_window.active = false
@dummy_window.visible = false
@sell_window.active = true
@sell_window.visible = true
@sell_window.refresh
when 2 # quit
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to map screen
if Customization::Music_On
$game_system.bgm_restore
end
$scene = Scene_Map.new
end
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when command window is active)
#--------------------------------------------------------------------------
def update_buy
# Set status window item
@status_window.item = @buy_window.item
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Change windows to initial mode
@command_window.active = true
@dummy_window.visible = true
@buy_window.active = false
@buy_window.visible = false
@status_window.visible = false
@status_window.item = nil
# Erase help text
@help_window.set_text("")
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Get item
@item = @buy_window.item
# If item is invalid, or price is higher than money possessed
if @item == nil or @item.price > $game_party.gold
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Get items in possession count
case @item
when RPG::Item
number = $game_party.item_number(@item.id)
when RPG::Weapon
number = $game_party.weapon_number(@item.id)
when RPG::Armor
number = $game_party.armor_number(@item.id)
end
# If 99 items are already in possession
if number == 99
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Calculate maximum amount possible to buy
max = @item.price == 0 ? 99 : $game_party.gold / @item.price
max = [max, 99 - number].min
# Change windows to quantity input mode
@buy_window.active = false
@buy_window.visible = false
@number_window.set(@item, max, @item.price)
@number_window.active = true
@number_window.visible = true
end
end
#--------------------------------------------------------------------------
# * Frame Update (when sell window is active)
#--------------------------------------------------------------------------
def update_sell
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Change windows to initial mode
@command_window.active = true
@dummy_window.visible = true
@sell_window.active = false
@sell_window.visible = false
@status_window.item = nil
# Erase help text
@help_window.set_text("")
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Get item
@item = @sell_window.item
# Set status window item
@status_window.item = @item
# If item is invalid, or item price is 0 (unable to sell)
if @item == nil or @item.price == 0
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Get items in possession count
case @item
when RPG::Item
number = $game_party.item_number(@item.id)
when RPG::Weapon
number = $game_party.weapon_number(@item.id)
when RPG::Armor
number = $game_party.armor_number(@item.id)
end
# Maximum quanitity to sell = number of items in possession
max = number
# Change windows to quantity input mode
@sell_window.active = false
@sell_window.visible = false
case Customization::Sell_Price
when 1
@number_window.set(@item, max, @item.price / 5)
when 2
@number_window.set(@item, max, @item.price / 4)
when 3
@number_window.set(@item, max, @item.price / 2)
when 4
@number_window.set(@item, max, @item.price / 1)
when 5
@number_window.set(@item, max, @item.price * 2)
end
@number_window.active = true
@number_window.visible = true
@status_window.visible = true
end
end
#--------------------------------------------------------------------------
# * Frame Update (when quantity input window is active)
#--------------------------------------------------------------------------
def update_number
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Set quantity input window to inactive / invisible
@number_window.active = false
@number_window.visible = false
# Branch by command window cursor position
case @command_window.index
when 0 # buy
# Change windows to buy mode
@buy_window.active = true
@buy_window.visible = true
when 1 # sell
# Change windows to sell mode
@sell_window.active = true
@sell_window.visible = true
@status_window.visible = false
end
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Play shop SE
$game_system.se_play($data_system.shop_se)
# Set quantity input window to inactive / invisible
@number_window.active = false
@number_window.visible = false
# Branch by command window cursor position
case @command_window.index
when 0 # buy
# Buy process
$game_party.lose_gold(@number_window.number * @item.price)
case @item
when RPG::Item
$game_party.gain_item(@item.id, @number_window.number)
when RPG::Weapon
$game_party.gain_weapon(@item.id, @number_window.number)
when RPG::Armor
$game_party.gain_armor(@item.id, @number_window.number)
end
# Refresh each window
@gold_window.refresh
@buy_window.refresh
@status_window.refresh
# Change windows to buy mode
@buy_window.active = true
@buy_window.visible = true
when 1 # sell
# Sell process
$game_party.gain_gold(@number_window.number * (@item.price / 2))
case @item
when RPG::Item
$game_party.lose_item(@item.id, @number_window.number)
when RPG::Weapon
$game_party.lose_weapon(@item.id, @number_window.number)
when RPG::Armor
$game_party.lose_armor(@item.id, @number_window.number)
end
# Refresh each window
@gold_window.refresh
@sell_window.refresh
@status_window.refresh
# Change windows to sell mode
@sell_window.active = true
@sell_window.visible = true
@status_window.visible = false
end
return
end
end
end
"Splash Screen Script"
CODE
#==============================================================================
# ** Scene_Splash (Ultimate Splash Scene 3.1.2 Plug-n-Play Edition)
# By: XeroVolume
# Date: Friday, June 11, 2010
#------------------------------------------------------------------------------
# Special Thanks: Brewmeister for help with the original counter!
#------------------------------------------------------------------------------
# This class performs Splash screen processing
#==============================================================================
class Scene_Splash
#----------------------------------------------------------------------------
# * Object Initialization
#----------------------------------------------------------------------------
def initialize
#--------------------------------------------------------------------------
# The following variables can be customized to fit your preferences
#--------------------------------------------------------------------------
# Allow splash screen during playtest? (true = allow / false = do not allow)
@playtest = false
# Allow skip to title with SPACE or C? (true = allow / false = do not allow)
@skip = true
# Set the total amount of splash screens to be displayed (Default = 2)
@amount = 2
# Set amount of time between each splash screen (Default = 51)
@space = 51
# Set amount of time between final splash and title (Default = 0)
@title_space = 0
#--------------------------------------------------------------------------
# Audio Options
#--------------------------------------------------------------------------
# Allow SE when skipping to title? (true = allow / false = do not allow)
@skip_se_allow = true
# Allow BGM for splash screen 1? (true = allow / false = do not allow)
@bgm1_allow = true
# Allow BGM for splash screen 2? (true = allow / false = do not allow)
@bgm2_allow = false
# Set BGM for splash screen 1 (Default = 061-Slow04)
@bgm1 = 'Sakura Drops'
# Set BGM for splash screen 2 (Default = 062-Slow05)
@bgm2 = 'Sakura Drops'
# Set SE for skip to title function (Default = 003-System03)
@skip_se = '003-System03'
# Set fade out time (in seconds) for splash screen 1 audio (Default = 2.5)
@bgm1_out = 20
# Set fade out time (in seconds) for splash screen 2 audio (Default = 2.5)
@bgm2_out = 0
#--------------------------------------------------------------------------
# Splash Screen 1 Options
#--------------------------------------------------------------------------
# Set file to be used for splash screen 1
@splash1 = 'School Transition'
# Set amount of frames it takes for splash 1 to fade in (Default = 51)
@in_time1 = 51
# Set amount of frames that splash screen 1 stays opaque (Default = 102)
@pause_time1 = 102
# Set amount of frames it takes for splash 1 to fade out (Default = 51)
@out_time1 = 51
#--------------------------------------------------------------------------
# Splash Screen 2 Options
#--------------------------------------------------------------------------
# Set file to be used for splash screen 2
@splash2 = 'School Transition2'
# Set amount of frames it takes for splash 2 to fade in (Default = 51)
@in_time2 = 51
# Set amount of frames that splash screen 2 stays opaque (Default = 102)
@pause_time2 = 102
# Set amount of frames it takes for splash 2 to fade out (Default = 51)
@out_time2 = 51
#------------------------------------------------------------------------
# The following variables should not be adjusted
#------------------------------------------------------------------------
# Create loop counter (Must start at zero)
@counter = 0
# Set initial splash screen opacity (Must start at 0.0)
@fade = 0.0
# Calculate splash 1 fade in speed
@in_speed1 = (255.0 / @in_time1)
# Calculate splash 1 fade out speed
@out_speed1 = (255.0 / @out_time1)
# Calculate splash 2 fade in speed
@in_speed2 = (255.0 / @in_time2)
# Calculate splash 2 fade out speed
@out_speed2 = (255.0 / @out_time2)
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Check for Battle Test
if $BTEST
# Switch to Title Screen
$scene = Scene_Title.new
end
# Check for Play Test
if $DEBUG && @playtest == false
# Switch to Title Screen
$scene = Scene_Title.new
end
# Load the System database & create a new game
$data_system = load_data("Data/System.rxdata")
$game_system = Game_System.new
# Create splash screen 1 graphic
@sprite1 = Sprite.new
@sprite1.bitmap = RPG::Cache.title(@splash1)
# Adjust sprite properties
@sprite1.ox = @sprite1.bitmap.width / 2
@sprite1.oy = @sprite1.bitmap.height / 2
# Center sprite on screen
@sprite1.x = 320
@sprite1.y = 240
# Set initial opacity
@sprite1.opacity = 0
# Create splash screen 2 graphic
@sprite2 = Sprite.new
@sprite2.bitmap = RPG::Cache.title(@splash2)
# Adjust sprite properties
@sprite2.ox = @sprite2.bitmap.width / 2
@sprite2.oy = @sprite2.bitmap.height / 2
# Center sprite on screen
@sprite2.x = 320
@sprite2.y = 240
# Set initial opacity
@sprite2.opacity = 0
# Stop playing ME and BGS
Audio.me_stop
Audio.bgs_stop
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
# Update loop counter
@counter += 1
end
# Prepare for transition
Graphics.freeze
# Dispose of Splash Screen graphics
@sprite1.dispose
@sprite1.bitmap.dispose
@sprite2.dispose
@sprite2.bitmap.dispose
end
#--------------------------------------------------------------------------
# * Frame update
#--------------------------------------------------------------------------
def update
# If C button was pressed
if Input.trigger?(Input::C) && @skip == true
if @skip_se_allow == true
# Play decision SE
$game_system.se_play(RPG::AudioFile.new(@skip_se))
end
# Switch to title screen
$scene = Scene_Title.new
end
# Fade Cycle
fade_cycle
# Update Graphics
@sprite1.update
@sprite2.update
end
#--------------------------------------------------------------------------
# * Fade Cycle
#--------------------------------------------------------------------------
def fade_cycle
# Determinent (Based on amount of splash screens remaining)
case @amount
# When 2 splash screens remain
when 2
# Check for audio
if @counter == 1 && @bgm1_allow == true
$game_system.bgm_play(RPG::AudioFile.new(@bgm1))
end
# Set splash screen 1's opacity level equal to @fade variable's value
@sprite1.opacity = @fade
# Fade in
if @counter <= @in_time1
@fade += @in_speed1
end
# Pause splash screen 1
if @counter >= @in_time1 + @pause_time1
# Fade out graphics
@fade -= @out_speed1
end
# Fade out BGM
if @counter == @in_time1 + @pause_time1
Audio.bgm_fade(@bgm1_out * 1000)
end
# Space between splash screens
if @counter >= @in_time1 + @out_time1 + @pause_time1 + @space
# Update splash screen amount
@amount -= 1
# Reset loop counter
@counter = 0
# Reset opacity variable
@fade = 0
end
# When 1 splash screen remains
when 1
# Check for audio
if @counter == 1 && @bgm2_allow == true
$game_system.bgm_play(RPG::AudioFile.new(@bgm2))
end
# Set splash screen 2's opacity level equal to @fade variable's value
@sprite2.opacity = @fade
# Fade in
if @counter <= @in_time2
@fade += @in_speed2
end
# Pause splash screen 2
if @counter >= @in_time2 + @pause_time2
# Fade out graphics
@fade -= @out_speed2
end
# Fade out BGM
if @counter == @in_time2 + @pause_time2
Audio.bgm_fade(@bgm2_out * 1000)
end
# Space between splash screen and title screen
if @counter >= @in_time2 + @out_time2 + @pause_time2 + @title_space
# Update splash screen amount
@amount -= 1
end
# When 0 splash screens remain
when 0
# Switch to Title Screen
$scene = Scene_Title.new
end
end
#--------------------------------------------------------------------------
# * Plug-n-Play Functionality
#--------------------------------------------------------------------------
$scene = Scene_Splash.new
$scene.main while $scene.is_a?(self)
end
"Defence Script"
CODE
#==============================================================================
# ** Night_Runner's Base Defence Script.
#-----------------------------------------------------------------------------
# History:
# Date Created: 25/Aug/2011
# Created for: TheLiquidPlumber
# @> http://www.rpgrevolution.com/forums/index.php?showtopic=52948
#
# Description:
# This script allows the developer to give actors a mdef and pdef
# parameters that are only dependant on the actors' level.
#
# How to Install:
# Highlight and copy this entire script. In your game editor, select
# Tools >> Script Editor.
# Along the left, scroll all the way to the bottom, right click on
# 'Main', select 'Insert', and paste the code on the blank window
# on the right.
#
# How to Use:
# Example code is provided, and demonstrates the formula
# ActorPDef[1] = Curve.new( 50, 600, 0 )
# Where 1 refers to the first actor in the database, 50 is Physical defence
# at level 1, 600 is the Physical defence at level 99, and 0 refers to
# the speed at which the curve accellerates (0 means slow at the start,
# but fast at the end, 50 means a linear curve, 100 means fast at the
# level 1, but slower towards level 99, and you may use any number between
# 0 and 100 to get varying rates).
# In the example, ActorPDef was used to refer to the physical defence, and
# ActorMDef can be used to refer to Magic defence.
# If no curves are defined in this code, the actor will get 0 base defence.
#
#==============================================================================
#==============================================================================
# ** Customisation
#==============================================================================
module NR_BaseDef
# Initialising variables
Curve = Struct.new( :start_val, :end_val, :speed )
ActorPDef = []
ActorMDef = []
# Akichi's Base defence
ActorPDef[1] = Curve.new( 25, 600, 0 )
ActorMDef[1] = Curve.new( 10, 600, 25 )
# Kaede's Base defence
ActorPDef[3] = Curve.new( 50, 600, 100 )
ActorMDef[3] = Curve.new( 5, 400, 47 )
# Shiori's Base defence
ActorPDef[2] = Curve.new( 25, 400, 50 )
ActorMDef[2] = Curve.new( 10, 1000, 90 )
end
#==============================================================================
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# Edited to have a base pdef and mdef
#==============================================================================
class Game_Actor
#--------------------------------------------------------------------------
# * Alias Methods
#--------------------------------------------------------------------------
alias nr_baseDef_pdef pdef unless $@
alias nr_baseDef_mdef mdef unless $@
#--------------------------------------------------------------------------
# * PDef
#--------------------------------------------------------------------------
def pdef(*args)
# Get the original pdef
orig_pdef = nr_baseDef_pdef(*args)
# Check to see if the actor has a custom base pdef
if NR_BaseDef::ActorPDef[@actor_id] != nil
# Get the parabola that describes this actor
y1 = NR_BaseDef::ActorPDef[@actor_id].start_val
y2 = NR_BaseDef::ActorPDef[@actor_id].end_val
rise = NR_BaseDef::ActorPDef[@actor_id].speed
a1 = ( 1.0 / ( 2.0 * ( 99.0 - 1.0 ) ) )
a2 = ( ( 100.0 - rise ) / 50.0 )
a3 = ( (rise) / 50.0 )
a4 = ( ( y2 - y1 ) / ( 99.0 - 1.0 ) )
a = a1 * a4 * (a2 - a3)
b = a3 * a4 - 2.0 * a
c = y1 - ( a + b )
# Add the axtra
orig_pdef += Integer( a * (self.level)**2 + b * ( self.level ) + c + 0.5 )
end
return orig_pdef
end
#--------------------------------------------------------------------------
# *MDef
#--------------------------------------------------------------------------
def mdef(*args)
# Get the original mdef
orig_mdef = nr_baseDef_mdef(*args)
# Check to see if the actor has a custom base mdef
if NR_BaseDef::ActorMDef[@actor_id] != nil
# Get the parabola that describes this actor
y1 = NR_BaseDef::ActorMDef[@actor_id].start_val
y2 = NR_BaseDef::ActorMDef[@actor_id].end_val
rise = NR_BaseDef::ActorMDef[@actor_id].speed
a1 = ( 1.0 / ( 2.0 * ( 99.0 - 1.0 ) ) )
a2 = ( ( 100.0 - rise ) / 50.0 )
a3 = ( (rise) / 50.0 )
a4 = ( ( y2 - y1 ) / ( 99.0 - 1.0 ) )
a = a1 * a4 * (a2 - a3)
b = a3 * a4 - 2.0 * a
c = y1 - ( a + b )
# Add the axtra
orig_mdef += Integer( a * (self.level)**2 + b * ( self.level ) + c + 0.5 )
end
return orig_mdef
end
end
#==============================================================================
# ** End of Script.
#==============================================================================
And that almost covers it all ...