Scripts RPG Maker XP Agrandir/Rapetisser la taille des héros
Auteur : Inconnu
Fonction : Permet d'agrandir ou de rapetisser le héros (Utile pour les maps du monde)
Image(s) : Image n°1 Image n°2
Ressource(s) : Aucune
Démo : Aucune
Remarque : Testé et fonctionnel. Dans ces script, les héros se suivent en chenille.
Nombre de scripts : 5
Installation : Ouvrez l'éditeur de script (F11) et suivez les instructions ci-dessous :
Utilisation : Pour que le héros soit grand, mettez à la fin du nom de votre carte : *B ( ex : Map001*B)
Pour que le héros soit petit, mettez à la fin du nom de votre carte : *W (ex : Map002*W)
Code :
Allez dans l'éditeur de script ( F11 ), créez un nouveau script au dessus de "Main" et nommez le "Caterpillar"
Créez un nouveau script au dessus de "Main" et nommez le "Sprite_Character"
#======================================================
# ¦ Sprite_Character
#------------------------------------------------------------------------------
# ??????????????????Game_Character ???????????
# ????????????????????????
#======================================================
class Sprite_Character < RPG::Sprite
#--------------------------------------------------------------------------
# ? ??????????
#--------------------------------------------------------------------------
attr_accessor :character # ??????
#--------------------------------------------------------------------------
# ? ?????????
# viewport : ??????
# character : ?????? (Game_Character)
#--------------------------------------------------------------------------
def initialize(viewport, character = nil)
super(viewport)
@character = character
if (character.is_a?(Game_Event) and character.list!=nil and character.list[0].code == 108 and character.list[0].parameters == ["w_sm"]) # Here
@event_size = true # Here, ^ too
else # Here
@event_size = false # Here
end # Here
if $game_map.worldmap # Here
@zoom_y = 0.3 # Here
@zoom_x = 0.3 # Here
elsif $game_map.bigger # Optional
@zoom_y = 1.9 # Optional
@zoom_x = 1.9 # Optional
else # Here
@zoom_y = 1 # Here
@zoom_x = 1 # Here
end # Here
update
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def update
super
# ??? ID?????????????????????????
if @tile_id != @character.tile_id or
@character_name != @character.character_name or
@character_hue != @character.character_hue
# ??? ID ????????????
@tile_id = @character.tile_id
@character_name = @character.character_name
@character_hue = @character.character_hue
# ??? ID ????????
if @tile_id >= 384
self.bitmap = RPG::Cache.tile($game_map.tileset_name,
@tile_id, @character.character_hue)
self.src_rect.set(0, 0, 32, 32)
self.ox = 16
self.oy = 32
# ??? ID ????????
else
self.bitmap = RPG::Cache.character(@character.character_name,
@character.character_hue)
@cw = bitmap.width / 4
@ch = bitmap.height / 4
self.ox = @cw / 2
self.oy = @ch
if @character.is_a?(Game_Player) or @event_size or @character.is_a?(Game_Party_Actor) # Here, for Caterpillar users, if you don't use it:
# if @character.is_a?(Game_Player) or @event_size
self.zoom_x = @zoom_x # Here
self.zoom_y = @zoom_y # Here
end
end
end
# ???????
self.visible = (not @character.transparent)
# ????????????????
if @tile_id == 0
# ?????????
sx = @character.pattern * @cw
sy = (@character.direction - 2) / 2 * @ch
self.src_rect.set(sx, sy, @cw, @ch)
end
# ???????????
self.x = @character.screen_x
self.y = @character.screen_y
self.z = @character.screen_z(@ch)
# ?????????????????
self.opacity = @character.opacity
self.blend_type = @character.blend_type
self.bush_depth = @character.bush_depth
# ???????
if @character.animation_id != 0
animation = $data_animations[@character.animation_id]
animation(animation, true)
@character.animation_id = 0
end
end
end
Créez un nouveau script au dessus de "Main" et nommez le "Game_Player"
#==============================================================================
# ? Game_Player
#------------------------------------------------------------------------------
# ?????????????????????????????????????
# ??????????????????????? $game_player ????????
#==============================================================================
class Game_Player < Game_Character
attr_accessor :move_speed # Here
#--------------------------------------------------------------------------
# ? ??
#--------------------------------------------------------------------------
CENTER_X = (320 - 16) * 4 # ????? X ?? * 4
CENTER_Y = (240 - 16) * 4 # ????? Y ?? * 4
#--------------------------------------------------------------------------
# ? ??????
# x : X ??
# y : Y ??
# d : ?? (0,2,4,6,8) ? 0 = ????????????? (?????)
#--------------------------------------------------------------------------
def passable?(x, y, d)
# ?????????
new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
# ??????????
unless $game_map.valid?(new_x, new_y)
# ????
return false
end
# ???????? ON ?? CTRL ???????????
if $DEBUG and Input.press?(Input::CTRL)
# ???
return true
end
super
end
#--------------------------------------------------------------------------
# ? ?????????????????????
#--------------------------------------------------------------------------
def center(x, y)
max_x = ($game_map.width - 20) * 128
max_y = ($game_map.height - 15) * 128
$game_map.display_x = [0, [x * 128 - CENTER_X, max_x].min].max
$game_map.display_y = [0, [y * 128 - CENTER_Y, max_y].min].max
end
#--------------------------------------------------------------------------
# ? ???????
# x : X ??
# y : Y ??
#--------------------------------------------------------------------------
def moveto(x, y)
super
# ??????
center(x, y)
# ?????? ???????
make_encounter_count
end
#--------------------------------------------------------------------------
# ? ????
#--------------------------------------------------------------------------
def increase_steps
super
# ??????????????
unless @move_route_forcing
# ????
$game_party.increase_steps
# ????????
if $game_party.steps % 2 == 0
# ????????????
$game_party.check_map_slip_damage
end
end
end
#--------------------------------------------------------------------------
# ? ?????? ??????
#--------------------------------------------------------------------------
def encounter_count
return @encounter_count
end
#--------------------------------------------------------------------------
# ? ?????? ??????
#--------------------------------------------------------------------------
def make_encounter_count
# ????? 2 ???????
if $game_map.map_id != 0
n = $game_map.encounter_step
@encounter_count = rand(n) + rand(n) + 1
end
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def refresh
@move_speed = move_speed # Here
# ??????? 0 ????
if $game_party.actors.size == 0
# ???????????????????
@character_name = ""
@character_hue = 0
# ??????
return
end
# ??????????
actor = $game_party.actors[0]
# ??????????????????
@character_name = actor.character_name
@character_hue = actor.character_hue
# ?????????????
@opacity = 255
@blend_type = 0
end
#--------------------------------------------------------------------------
# ? ????????????
#--------------------------------------------------------------------------
def check_event_trigger_here(triggers)
result = false
# ??????????
if $game_system.map_interpreter.running?
return result
end
# ?????????
for event in $game_map.events.values
# ???????????????????
if event.x == @x and event.y == @y and triggers.include?(event.trigger)
# ????????????????????????
if not event.jumping? and event.over_trigger?
event.start
result = true
end
end
end
return result
end
#--------------------------------------------------------------------------
# ? ???????????
#--------------------------------------------------------------------------
def check_event_trigger_there(triggers)
result = false
# ??????????
if $game_system.map_interpreter.running?
return result
end
# ????????
new_x = @x + (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
new_y = @y + (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
# ?????????
for event in $game_map.events.values
# ???????????????????
if event.x == new_x and event.y == new_y and
triggers.include?(event.trigger)
# ???????????????????????
if not event.jumping? and not event.over_trigger?
event.start
result = true
end
end
end
# ???????????????????
if result == false
# ??????????????
if $game_map.counter?(new_x, new_y)
# 1 ??????????
new_x += (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
new_y += (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
# ?????????
for event in $game_map.events.values
# ???????????????????
if event.x == new_x and event.y == new_y and
triggers.include?(event.trigger)
# ???????????????????????
if not event.jumping? and not event.over_trigger?
event.start
result = true
end
end
end
end
end
return result
end
#--------------------------------------------------------------------------
# ? ???????????
#--------------------------------------------------------------------------
def check_event_trigger_touch(x, y)
result = false
# ??????????
if $game_system.map_interpreter.running?
return result
end
# ?????????
for event in $game_map.events.values
# ???????????????????
if event.x == x and event.y == y and [1,2].include?(event.trigger)
# ???????????????????????
if not event.jumping? and not event.over_trigger?
event.start
result = true
end
end
end
return result
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def update
# ?????????????????
last_moving = moving?
# ?????????????????????
# ???????????????????????
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
# ???????????????????????????
case Input.dir4
when 2
move_down
when 4
move_left
when 6
move_right
when 8
move_up
end
end
# ????????????
last_real_x = @real_x
last_real_y = @real_y
super
# ??????????????????????????????
if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
# ???????????
$game_map.scroll_down(@real_y - last_real_y)
end
# ??????????????????????????????
if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
# ???????????
$game_map.scroll_left(last_real_x - @real_x)
end
# ??????????????????????????????
if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
# ???????????
$game_map.scroll_right(@real_x - last_real_x)
end
# ??????????????????????????????
if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
# ???????????
$game_map.scroll_up(last_real_y - @real_y)
end
# ?????????
unless moving?
# ????????????????
if last_moving
# ???????????????????????
result = check_event_trigger_here([1,2])
# ?????????????
if result == false
# ???????? ON ?? CTRL ??????????????
unless $DEBUG and Input.press?(Input::CTRL)
# ?????? ???????
if @encounter_count > 0
@encounter_count -= 1
end
end
end
end
# C ??????????
if Input.trigger?(Input::C)
# ?????????????????
check_event_trigger_here([0])
check_event_trigger_there([0,1,2])
end
end
end
end
Créez un nouveau script au dessus de "Main" et nommez le "Game_Map"
#==============================================================================
# ? Game_Map
#------------------------------------------------------------------------------
# ?????????????????????????????????????
# ????????????? $game_map ????????
#==============================================================================
class Game_Map
#--------------------------------------------------------------------------
# ? ??????????
#--------------------------------------------------------------------------
attr_accessor :tileset_name # ?????? ?????
attr_accessor :autotile_names # ?????? ?????
attr_accessor :panorama_name # ???? ?????
attr_accessor :panorama_hue # ???? ??
attr_accessor :fog_name # ??? ?????
attr_accessor :fog_hue # ??? ??
attr_accessor :fog_opacity # ??? ????
attr_accessor :fog_blend_type # ??? ??????
attr_accessor :fog_zoom # ??? ???
attr_accessor :fog_sx # ??? SX
attr_accessor :fog_sy # ??? SY
attr_accessor :battleback_name # ?????? ?????
attr_accessor :display_x # ?? X ?? * 128
attr_accessor :display_y # ?? Y ?? * 128
attr_accessor :need_refresh # ???????????
attr_reader :passages # ?? ????
attr_reader :priorities # ??????? ????
attr_reader :terrain_tags # ???? ????
attr_reader :events # ????
attr_reader :fog_ox # ??? ?? X ??
attr_reader :fog_oy # ??? ?? Y ??
attr_reader :fog_tone # ??? ??
attr_accessor :worldmap # Here
attr_accessor :bigger # Optional
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
def initialize
@map_id = 0
@display_x = 0
@display_y = 0
@worldmap = false # Here
@bigger = false # Optional
end
#--------------------------------------------------------------------------
# ? ??????
# map_id : ??? ID
#--------------------------------------------------------------------------
def setup(map_id)
# ??? ID ? @map_id ???
@map_id = map_id
# ???????????????@map ???
@map = load_data(sprintf("Data/Map%03d.rxdata", @map_id))
if self.name.include?("*W") # Here
@bigger = false # Here
@worldmap = true # Optional
$game_player.move_speed = 2 # Optional
elsif self.name.include?("*B") # Optional
@worldmap = false # Optional
@bigger = true # Optional
$game_player.move_speed = 4 # Optional
else # Here
@worldmap = false # Here
@bigger = false # Optional
$game_player.move_speed = 4 # Optional
end # Here
# ???????????????????????
tileset = $data_tilesets[@map.tileset_id]
@tileset_name = tileset.tileset_name
@autotile_names = tileset.autotile_names
@panorama_name = tileset.panorama_name
@panorama_hue = tileset.panorama_hue
@fog_name = tileset.fog_name
@fog_hue = tileset.fog_hue
@fog_opacity = tileset.fog_opacity
@fog_blend_type = tileset.fog_blend_type
@fog_zoom = tileset.fog_zoom
@fog_sx = tileset.fog_sx
@fog_sy = tileset.fog_sy
@battleback_name = tileset.battleback_name
@passages = tileset.passages
@priorities = tileset.priorities
@terrain_tags = tileset.terrain_tags
# ????????
@display_x = 0
@display_y = 0
# ???????????????
@need_refresh = false
# ??????????????
@events = {}
for i in @map.events.keys
@events[i] = Game_Event.new(@map_id, @map.events[i])
end
# ??????????????
@common_events = {}
for i in 1...$data_common_events.size
@common_events[i] = Game_CommonEvent.new(i)
end
# ???????????
@fog_ox = 0
@fog_oy = 0
@fog_tone = Tone.new(0, 0, 0, 0)
@fog_tone_target = Tone.new(0, 0, 0, 0)
@fog_tone_duration = 0
@fog_opacity_duration = 0
@fog_opacity_target = 0
# ???????????
@scroll_direction = 2
@scroll_rest = 0
@scroll_speed = 4
end
#--------------------------------------------------------------------------
# ? ??? ID ???
#--------------------------------------------------------------------------
def map_id
return @map_id
end
#--------------------------------------------------------------------------
# ? ????
#--------------------------------------------------------------------------
def width
return @map.width
end
#--------------------------------------------------------------------------
# ? ?????
#--------------------------------------------------------------------------
def height
return @map.height
end
#--------------------------------------------------------------------------
# ? ????????????
#--------------------------------------------------------------------------
def encounter_list
return @map.encounter_list
end
#--------------------------------------------------------------------------
# ? ???????????
#--------------------------------------------------------------------------
def encounter_step
return @map.encounter_step
end
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
def data
return @map.data
end
#--------------------------------------------------------------------------
# ? BGM / BGS ??????
#--------------------------------------------------------------------------
def autoplay
if @map.autoplay_bgm
$game_system.bgm_play(@map.bgm)
end
if @map.autoplay_bgs
$game_system.bgs_play(@map.bgs)
end
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def refresh
# ??? ID ?????
if @map_id > 0
# ??????????????????
for event in @events.values
event.refresh
end
# ??????????????????
for common_event in @common_events.values
common_event.refresh
end
end
# ???????????????
@need_refresh = false
end
#--------------------------------------------------------------------------
# ? ???????
# distance : ?????????
#--------------------------------------------------------------------------
def scroll_down(distance)
@display_y = [@display_y + distance, (self.height - 15) * 128].min
end
#--------------------------------------------------------------------------
# ? ???????
# distance : ?????????
#--------------------------------------------------------------------------
def scroll_left(distance)
@display_x = [@display_x - distance, 0].max
end
#--------------------------------------------------------------------------
# ? ???????
# distance : ?????????
#--------------------------------------------------------------------------
def scroll_right(distance)
@display_x = [@display_x + distance, (self.width - 20) * 128].min
end
#--------------------------------------------------------------------------
# ? ???????
# distance : ?????????
#--------------------------------------------------------------------------
def scroll_up(distance)
@display_y = [@display_y - distance, 0].max
end
#--------------------------------------------------------------------------
# ? ??????
# x : X ??
# y : Y ??
#--------------------------------------------------------------------------
def valid?(x, y)
return (x >= 0 and x < width and y >= 0 and y < height)
end
#--------------------------------------------------------------------------
# ? ??????
# x : X ??
# y : Y ??
# d : ?? (0,2,4,6,8,10)
# ? 0,10 = ????????????? (??????)
# self_event : ?? (??????????????)
#--------------------------------------------------------------------------
def passable?(x, y, d, self_event = nil)
# ???????????????
unless valid?(x, y)
# ????
return false
end
# ?? (0,2,4,6,8,10) ?? ?????? (0,1,2,4,8,0) ???
bit = (1 << (d / 2 - 1)) & 0x0f
# ????????????
for event in events.values
# ??????????????????
if event.tile_id >= 0 and event != self_event and
event.x == x and event.y == y and not event.through
# ?????????????????
if @passages[event.tile_id] & bit != 0
# ????
return false
# ?????????????????????
elsif @passages[event.tile_id] & 0x0f == 0x0f
# ????
return false
# ????? ???????? 0 ???
elsif @priorities[event.tile_id] == 0
# ???
return true
end
end
end
# ????????????????
for i in [2, 1, 0]
# ??? ID ???
tile_id = data[x, y, i]
# ??? ID ????
if tile_id == nil
# ????
return false
# ?????????????????
elsif @passages[tile_id] & bit != 0
# ????
return false
# ?????????????????????
elsif @passages[tile_id] & 0x0f == 0x0f
# ????
return false
# ????? ???????? 0 ???
elsif @priorities[tile_id] == 0
# ???
return true
end
end
# ???
return true
end
#--------------------------------------------------------------------------
# ? ????
# x : X ??
# y : Y ??
#--------------------------------------------------------------------------
def bush?(x, y)
if @map_id != 0
for i in [2, 1, 0]
tile_id = data[x, y, i]
if tile_id == nil
return false
elsif @passages[tile_id] & 0x40 == 0x40
return true
end
end
end
return false
end
#--------------------------------------------------------------------------
# ? ???????
# x : X ??
# y : Y ??
#--------------------------------------------------------------------------
def counter?(x, y)
if @map_id != 0
for i in [2, 1, 0]
tile_id = data[x, y, i]
if tile_id == nil
return false
elsif @passages[tile_id] & 0x80 == 0x80
return true
end
end
end
return false
end
#--------------------------------------------------------------------------
# ? ???????
# x : X ??
# y : Y ??
#--------------------------------------------------------------------------
def terrain_tag(x, y)
if @map_id != 0
for i in [2, 1, 0]
tile_id = data[x, y, i]
if tile_id == nil
return 0
elsif @terrain_tags[tile_id] > 0
return @terrain_tags[tile_id]
end
end
end
return 0
end
#--------------------------------------------------------------------------
# ? ????????? ID ??
# x : X ??
# y : Y ??
#--------------------------------------------------------------------------
def check_event(x, y)
for event in $game_map.events.values
if event.x == x and event.y == y
return event.id
end
end
end
#--------------------------------------------------------------------------
# ? ????????
# direction : ?????????
# distance : ?????????
# speed : ?????????
#--------------------------------------------------------------------------
def start_scroll(direction, distance, speed)
@scroll_direction = direction
@scroll_rest = distance * 128
@scroll_speed = speed
end
#--------------------------------------------------------------------------
# ? ????????
#--------------------------------------------------------------------------
def scrolling?
return @scroll_rest > 0
end
#--------------------------------------------------------------------------
# ? ???????????
# tone : ??
# duration : ??
#--------------------------------------------------------------------------
def start_fog_tone_change(tone, duration)
@fog_tone_target = tone.clone
@fog_tone_duration = duration
if @fog_tone_duration == 0
@fog_tone = @fog_tone_target.clone
end
end
#--------------------------------------------------------------------------
# ? ?????????????
# opacity : ????
# duration : ??
#--------------------------------------------------------------------------
def start_fog_opacity_change(opacity, duration)
@fog_opacity_target = opacity * 1.0
@fog_opacity_duration = duration
if @fog_opacity_duration == 0
@fog_opacity = @fog_opacity_target
end
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def update
# ??????????????
if $game_map.need_refresh
refresh
end
# ?????????
if @scroll_rest > 0
# ??????????????????????
distance = 2 ** @scroll_speed
# ????????
case @scroll_direction
when 2 # ?
scroll_down(distance)
when 4 # ?
scroll_left(distance)
when 6 # ?
scroll_right(distance)
when 8 # ?
scroll_up(distance)
end
# ????????????
@scroll_rest -= distance
end
# ??????????
for event in @events.values
event.update
end
# ??????????
for common_event in @common_events.values
common_event.update
end
# ???????????
@fog_ox -= @fog_sx / 8.0
@fog_oy -= @fog_sy / 8.0
# ??????????
if @fog_tone_duration >= 1
d = @fog_tone_duration
target = @fog_tone_target
@fog_tone.red = (@fog_tone.red * (d - 1) + target.red) / d
@fog_tone.green = (@fog_tone.green * (d - 1) + target.green) / d
@fog_tone.blue = (@fog_tone.blue * (d - 1) + target.blue) / d
@fog_tone.gray = (@fog_tone.gray * (d - 1) + target.gray) / d
@fog_tone_duration -= 1
end
# ????????????
if @fog_opacity_duration >= 1
d = @fog_opacity_duration
@fog_opacity = (@fog_opacity * (d - 1) + @fog_opacity_target) / d
@fog_opacity_duration -= 1
end
end
def name # Here
$map_infos[@map_id] # Here
end # Here
end
Créez un nouveau script au dessus de "Main" et nommez le "Scene_Title"
#==============================================================================
# ? Scene_Title
#------------------------------------------------------------------------------
# ??????????????????
#==============================================================================
class Scene_Title
#--------------------------------------------------------------------------
# ? ?????
#--------------------------------------------------------------------------
def main
# ????????
if $BTEST
battle_test
return
end
# ??????????
$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")
# ?????????????
$game_system = Game_System.new
# ?????????????
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
$map_infos = load_data("Data/MapInfos.rxdata") # Here
for key in $map_infos.keys # Here
$map_infos[key] = $map_infos[key].name # Here
end # Here
# ????????????
s1 = "Nouvelle partie"
s2 = "Continuer"
s3 = "Quitter"
@command_window = Window_Command.new(192, [s1, s2, s3])
@command_window.back_opacity = 160
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 288
# ???????????
# ?????????????????????????
# ???? @continue_enabled ? true????? false ???
@continue_enabled = false
for i in 0..3
if FileTest.exist?("Save#{i+1}.sav")
@continue_enabled = true
end
end
# ???????????????????????????????
# ?????????????????????????
if @continue_enabled
@command_window.index = 1
else
@command_window.disable_item(1)
end
# ???? BGM ???
$game_system.bgm_play($data_system.title_bgm)
# ME?BGS ??????
Audio.me_stop
Audio.bgs_stop
# ?????????
Graphics.transition
# ??????
loop do
# ????????
Graphics.update
# ???????
Input.update
# ??????
update
# ????????????????
if $scene != self
break
end
end
# ?????????
Graphics.freeze
# ????????????
@command_window.dispose
# ?????????????
@sprite.bitmap.dispose
@sprite.dispose
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def update
# ????????????
@command_window.update
# C ??????????
if Input.trigger?(Input::C)
# ???????????????????
case @command_window.index
when 0 # ??????
command_new_game
when 1 # ???????
command_continue
when 2 # ???????
command_shutdown
end
end
end
#--------------------------------------------------------------------------
# ? ???? : ??????
#--------------------------------------------------------------------------
def command_new_game
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# BGM ???
Audio.bgm_stop
# ??????????????????????
Graphics.frame_count = 0
# ??????????????
$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
# ?????????????
$game_party.setup_starting_members
# ???????????????
$game_map.setup($data_system.start_map_id)
# ?????????????
$game_player.moveto($data_system.start_x, $data_system.start_y)
# ????????????
$game_player.refresh
# ??????????? BGM ? BGS ??????????
$game_map.autoplay
# ?????? (????????)
$game_map.update
# ??????????
$scene = Scene_Map.new
end
#--------------------------------------------------------------------------
# ? ???? : ???????
#--------------------------------------------------------------------------
def command_continue
# ?????????????
unless @continue_enabled
# ??? SE ???
$game_system.se_play($data_system.buzzer_se)
return
end
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ??????????
$scene = Scene_Load.new
end
#--------------------------------------------------------------------------
# ? ???? : ???????
#--------------------------------------------------------------------------
def command_shutdown
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# BGM?BGS?ME ????????
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
# ???????
$scene = nil
end
#--------------------------------------------------------------------------
# ? ?????
#--------------------------------------------------------------------------
def 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")
# ??????????????????????
Graphics.frame_count = 0
# ??????????????
$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
# ??????????????????
$game_party.setup_battle_test_members
# ???? ID??????????????????
$game_temp.battle_troop_id = $data_system.test_troop_id
$game_temp.battle_can_escape = true
$game_map.battleback_name = $data_system.battleback_name
# ????? SE ???
$game_system.se_play($data_system.battle_start_se)
# ??? BGM ???
$game_system.bgm_play($game_system.battle_bgm)
# ??????????
$scene = Scene_Battle.new
end
end