Jump to content
Rpg²S Forum

*Banca e caricamento nel menu


friday666
 Share

Recommended Posts

Descrizione
inserire una banca e il menu di caricamento nel menu di gioco

Autore
rielaborato da me autori originalai vari(all'interno dello script...)

Istruzioni per l'Uso
Create quattro classi sopra main e inseriteci questi

 

 

 

#------------------------------------------------------------------------------
# KGC_Depository
#------------------------------------------------------------------------------
# Tradotto e modificato da Rinnegatamante e Friday666
#------------------------------------------------------------------------------
# Per richiamare lo script fare un evento
# con Call Script e scriverci chiama_banca
#------------------------------------------------------------------------------
module KGC
	$game_special_elements = {}
	$imported = {}
	$data_states = load_data("Data/States.rxdata")
	$data_system = load_data("Data/System.rxdata")
end
#==============================================================================
# Sistemazione Comandi Principali
#==============================================================================

module KGC
	# Comandi
	DEPOSITORY_COMMAND = [
	"Deposita Guil", # Comando di deposita soldi
	"Ritira Guil", # Comando di ritira soldi
	"Deposita Oggetti", # Comandi di deposita oggetti
	"Ritira Oggetti" # Comando di ritira oggetti
	]
	# Aggiornamento
	DEPOSITORY_HELP = [
	"Deposita Guil", # Comando di deposita soldi
	"Ritira Guil", # Comando di ritira soldi
	"Deposita Oggetti", # Comandi di deposita oggetti
	"Ritira Oggetti" # Comando di ritira oggetti
	]
	
	# Disposizione
	DEPOSITORY_GOLD_DIGITS = 7
	
	# Comando di deposita soldi
	DEPOSIT_GOLD = "Deposita Guil"
	# Comando di ritira soldi
	WDEPOSIT_GOLD = "Ritira Guil"
	# Comando di deposita oggetti
	DEPOSIT_ITEM = "Deposita Oggetti"
	# Comando di ritira oggetti
	WDEPOSIT_ITEM = "Ritira Oggetti"
end

# Importazione Comandi

$imported = {} if $imported == nil
$imported["Banca"] = true

#--------------------------------------------------------------------------
# Comando Richiama Script
#--------------------------------------------------------------------------
def chiama_banca
	# Richiama Script
	$game_player.straighten
	# Configurazione Script
	$scene = Scene_Depository.new
end
# Secondo Richiama Script

#==============================================================================
# ¦ Game_Party
#==============================================================================

class Game_Party
	#--------------------------------------------------------------------------
	# Inizializzazione Script
	#--------------------------------------------------------------------------
	alias initialize_KGC_Depository initialize
	def initialize
		# Inizializzazione Sistema Deposito
		initialize_KGC_Depository
		
		@deposit_gold = 0
		@deposit_item, @deposit_weapon, @deposit_armor = [], [], []
	end
	#--------------------------------------------------------------------------
	# Sistema Deposito
	#--------------------------------------------------------------------------
	def deposit_gold
		@deposit_gold = 0 if @deposit_gold == nil
		return @deposit_gold
	end
	#--------------------------------------------------------------------------
	# Sistema Deposito Particolare 1
	# Sistema Numeri
	#--------------------------------------------------------------------------
	def gain_deposit_gold(number)
		@deposit_gold = 0 if @deposit_gold == nil
		@deposit_gold += number
	end
	#--------------------------------------------------------------------------
	# Sistema Numeri Particolare 1
	# Aggiunta Sistema Allo Script
	#--------------------------------------------------------------------------
	def lose_deposit_gold(number)
		self.gain_deposit_gold(-number)
	end
	#--------------------------------------------------------------------------
	# Sistema Deposito Particolare 2
	# Sistema Oggetti
	#--------------------------------------------------------------------------
	def deposit_item_number(id)
		@deposit_item = [] if @deposit_item == nil
		return @deposit_item[id] != nil ? @deposit_item[id] : 0
	end
	#--------------------------------------------------------------------------
	# Aggiornamento Sistema Deposito
	# Sistema Oggetti
	# Sistema Numeri
	#--------------------------------------------------------------------------
	def gain_deposit_item(id, number)
		@deposit_item = [] if @deposit_item == nil
		@deposit_item[id] = 0 if @deposit_item[id] == nil
		@deposit_item[id] += number
	end
	#--------------------------------------------------------------------------
	# Aggiunta al Sistema Deposito
	# Sistema Oggetti
	# Sistema Numeri
	#--------------------------------------------------------------------------
	def lose_deposit_item(id, number)
		self.gain_deposit_item(id, -number)
	end
	#--------------------------------------------------------------------------
	# Aggiornamento
	# Sistema Oggetti
	#--------------------------------------------------------------------------
	def deposit_weapon_number(id)
		@deposit_weapon = [] if @deposit_weapon == nil
		return @deposit_weapon[id] != nil ? @deposit_weapon[id] : 0
	end
	#--------------------------------------------------------------------------
	# Configurazione
	# Sistema Oggetti
	# Sistema Numeri
	#--------------------------------------------------------------------------
	def gain_deposit_weapon(id, number)
		@deposit_weapon = [] if @deposit_weapon == nil
		@deposit_weapon[id] = 0 if @deposit_weapon[id] == nil
		@deposit_weapon[id] += number
	end
	#--------------------------------------------------------------------------
	# Inizializzazione
	# Sistema Oggetti
	# Sistema Numeri
	#--------------------------------------------------------------------------
	def lose_deposit_weapon(id, number)
		self.gain_deposit_weapon(id, -number)
	end
	#--------------------------------------------------------------------------
	# Riconoscimento
	# Sistema Oggetti
	#--------------------------------------------------------------------------
	def deposit_armor_number(id)
		@deposit_armor = [] if @deposit_armor == nil
		return @deposit_armor[id] != nil ? @deposit_armor[id] : 0
	end
	#--------------------------------------------------------------------------
	# Configurazione Sistema Deposito
	# Sistema Oggetti
	# Sistema Numeri
	#--------------------------------------------------------------------------
	def gain_deposit_armor(id, number)
		@deposit_armor = [] if @deposit_armor == nil
		@deposit_armor[id] = 0 if @deposit_armor[id] == nil
		@deposit_armor[id] += number
	end
	#--------------------------------------------------------------------------
	# Finalizzazione
	# Sistema Oggetti
	# Sistema Numeri
	#--------------------------------------------------------------------------
	def lose_deposit_armor(id, number)
		self.gain_deposit_armor(id, -number)
	end
end

#Fine Sistema Deposito

#==============================================================================
# ¦ Window_DepositoryCommand
#------------------------------------------------------------------------------
# Tradotto e modificato da Rinnegatamante
#==============================================================================

class Window_DepositoryCommand < Window_Selectable
	#--------------------------------------------------------------------------
	# ? ?????????
	#--------------------------------------------------------------------------
	def initialize
		super(0, 64, 640, 64)
		self.y = 128 if $imported["HelpExtension"]
		self.contents = Bitmap.new(width - 32, height - 32)
		# ?????????
		@commands = KGC::DEPOSITORY_COMMAND
		@item_max = @commands.size
		@column_max = @commands.size
		@item_width = (width - 32) / @commands.size
		self.back_opacity = 160
		self.index = 0
		refresh
	end
	#--------------------------------------------------------------------------
	# ? ??????
	#--------------------------------------------------------------------------
	def refresh
		for i in 0...@commands.size
			rect = Rect.new(@item_width * i, 0, @item_width, 32)
			self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
			self.contents.font.color = system_color
			self.contents.draw_text(rect, @commands[i], 1)
			self.contents.font.size = 28
			self.contents.font.name = "Monotype Corsiva"
		end
	end
	#--------------------------------------------------------------------------
	# ? ?????????
	#--------------------------------------------------------------------------
	def update_cursor_rect
		if index != -1
			self.cursor_rect.set(@item_width * index, 0, @item_width, 32)
		end
	end
	#--------------------------------------------------------------------------
	# ? ?????????
	#--------------------------------------------------------------------------
	def update_help
		@help_window.set_text(KGC::DEPOSITORY_HELP[self.index])
	end
end

#???????????????????????????????????????

#==============================================================================
# ¦ Window_DepositoryGold
#------------------------------------------------------------------------------
# ???????????????????????
#==============================================================================

class Window_DepositoryGold < Window_Base
	#--------------------------------------------------------------------------
	# ? ?????????
	#--------------------------------------------------------------------------
	def initialize
		super(0, 128, 640, 352)
		if $imported["HelpExtension"]
			self.y = 192
			self.height = 288
		end
		@digits_max = KGC::DEPOSITORY_GOLD_DIGITS
		# ??????????????? (0~9 ??????)
		dummy_bitmap = Bitmap.new(32, 32)
		@cursor_width = dummy_bitmap.text_size("0").width + 8
		dummy_bitmap.dispose
		self.contents = Bitmap.new(width - 32, height - 32)
		self.back_opacity = 160
		self.active = false
		self.visible = false
		@cursor_position = 0
		@max = 0
		@price = 0
		@index = 0
	end
	#--------------------------------------------------------------------------
	# ? ??????????
	#--------------------------------------------------------------------------
	def price
		return @price
	end
	#--------------------------------------------------------------------------
	# ? ?????
	# np : ?????
	#--------------------------------------------------------------------------
	def price=(np)
		@price = [[np, 0].max, @max].min
		redraw_price
	end
	#--------------------------------------------------------------------------
	# ? ????
	# type : ??
	#--------------------------------------------------------------------------
	def reset(type)
		@price = 0
		@index = @digits_max - 1
		refresh(type)
	end
	#--------------------------------------------------------------------------
	# ? ??????
	# type : ??
	#--------------------------------------------------------------------------
	def refresh(type)
		# ?????
		self.contents.clear
		$fontsize == 28
		$fontface == "Monotype Corsiva"
		domination = $data_system.words.gold
		cx = contents.text_size(domination).width
		@cursor_position = 332 - cx - @cursor_width * @digits_max
		self.contents.font.color = system_color
		self.contents.draw_text(0, 0, 608, 32, "Guil posseduti")
		self.contents.draw_text(0, 64, 608, 32, "Guil in banca")
		if type == 0
			self.contents.draw_text(0, 128, 608, 32, "Guil da depositare")
			@max = $game_party.gold
		else
			self.contents.draw_text(0, 128, 608, 32, "Guil da ritirare")
			@max = [10 ** @digits_max - $game_party.gold - 1, $game_party.deposit_gold].min
		end
		self.contents.font.color = normal_color
		self.contents.draw_text(4, 32, 326 - cx, 32, $game_party.gold.to_s, 2)
		self.contents.font.color = system_color
		self.contents.draw_text(332 - cx, 32, cx, 32, domination, 2)
		self.contents.font.color = normal_color
		self.contents.draw_text(4, 96, 326 - cx, 32, $game_party.deposit_gold.to_s, 2)
		self.contents.font.color = system_color
		self.contents.draw_text(332 - cx, 96, cx, 32, domination, 2)
		redraw_price
	end
	#--------------------------------------------------------------------------
	# ? ?????
	#--------------------------------------------------------------------------
	def redraw_price
		domination = $data_system.words.gold
		cx = contents.text_size(domination).width
		self.contents.fill_rect(0, 160, 608, 32, Color.new(0, 0, 0, 0))
		self.contents.font.color = normal_color
		text = sprintf("%0#{@digits_max}d", self.price)
		for i in 0...text.length
			x = @cursor_position + (i - 1) * @cursor_width
			self.contents.draw_text(x, 160, 32, 32, text[i, 1], 2)
			self.contents.font.size = 28
			self.contents.font.name = "Monotype Corsiva"
		end
		self.contents.font.color = system_color
		self.contents.draw_text(332 - cx, 160, cx, 32, domination, 2)
		self.contents.font.size = 28
		self.contents.font.name = "Monotype Corsiva"
	end
	#--------------------------------------------------------------------------
	# ? ?????????
	#--------------------------------------------------------------------------
	def update_cursor_rect
		x = @cursor_position + @index * @cursor_width
		self.cursor_rect.set(x, 160, @cursor_width, 32)
	end
	#--------------------------------------------------------------------------
	# ? ??????
	#--------------------------------------------------------------------------
	def update
		super
		return unless self.active
		# ????????????????
		if Input.repeat?(Input::UP) || Input.repeat?(Input::DOWN)
			$game_system.se_play($data_system.cursor_se)
			# ???????????????? 0 ???
			place = 10 ** (@digits_max - 1 - @index)
			n = self.price / place % 10
			self.price -= n * place
			# ??? +1???? -1
			n = (n + 1) % 10 if Input.repeat?(Input::UP)
			n = (n + 9) % 10 if Input.repeat?(Input::DOWN)
			# ???????????
			self.price += n * place
		end
		# ?????
		if Input.repeat?(Input::RIGHT)
			if @digits_max >= 2
				$game_system.se_play($data_system.cursor_se)
				@index = (@index + 1) % @digits_max
			end
		end
		# ?????
		if Input.repeat?(Input::LEFT)
			if @digits_max >= 2
				$game_system.se_play($data_system.cursor_se)
				@index = (@index + @digits_max - 1) % @digits_max
			end
		end
		update_cursor_rect
	end
end

#???????????????????????????????????????

#==============================================================================
# ¦ Window_DepositoryItem
#------------------------------------------------------------------------------
# ???????????????????????????????
#==============================================================================

class Window_DepositoryItem < Window_Selectable
	#--------------------------------------------------------------------------
	# ? ?????????
	#--------------------------------------------------------------------------
	def initialize
		super(0, 128, 640, 352)
		if $imported["HelpExtension"]
			self.y = 192
			self.height = 288
		end
		self.back_opacity = 160
		self.active = false
		self.visible = false
		@column_max = 2
		self.index = 0
	end
	#--------------------------------------------------------------------------
	# ? ???????
	#--------------------------------------------------------------------------
	def item
		return @data[self.index]
	end
	#--------------------------------------------------------------------------
	# ? ??????
	# type : ??
	#--------------------------------------------------------------------------
	def refresh(type)
		if self.contents != nil
			self.contents.dispose
			self.contents = nil
		end
		@data = []
		self.index = 0
		# ????·??·?????
		if type == 0
			for i in 1...$data_items.size
				if $game_party.item_number(i) > 0
					@data.push($data_items[i])
				end
			end
			for i in 1...$data_weapons.size
				if $game_party.weapon_number(i) > 0
					@data.push($data_weapons[i])
				end
			end
			for i in 1...$data_armors.size
				if $game_party.armor_number(i) > 0
					@data.push($data_armors[i])
				end
			end
		else
			for i in 1...$data_items.size
				if $game_party.deposit_item_number(i) > 0
					@data.push($data_items[i])
				end
			end
			for i in 1...$data_weapons.size
				if $game_party.deposit_weapon_number(i) > 0
					@data.push($data_weapons[i])
				end
			end
			for i in 1...$data_armors.size
				if $game_party.deposit_armor_number(i) > 0
					@data.push($data_armors[i])
				end
			end
			
		end
		# ???? 0 ??????????????????????
		@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, type)
			end
		end
	end
	#--------------------------------------------------------------------------
	# ? ?????
	# index : ????
	# type : ??
	#--------------------------------------------------------------------------
	def draw_item(index, type)
		item = @data[index]
		case item
		when RPG::Item
			number = type == 0 ? $game_party.item_number(item.id) :
			$game_party.deposit_item_number(item.id)
		when RPG::Weapon
			number = type == 0 ? $game_party.weapon_number(item.id) :
			$game_party.deposit_weapon_number(item.id)
		when RPG::Armor
			number = type == 0 ? $game_party.armor_number(item.id) :
			$game_party.deposit_armor_number(item.id)
		end
		x = 4 + index % 2 * (288 + 32)
		y = index / 2 * 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(item.icon_name)
		self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
		self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
		self.contents.font.size = 28
		self.contents.font.name = "Monotype Corsiva"
		self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
		self.contents.font.size = 28
		self.contents.font.name = "Monotype Corsiva"
		self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
		self.contents.font.size = 28
		self.contents.font.name = "Monotype Corsiva"
	end
	#--------------------------------------------------------------------------
	# ? ?????????
	#--------------------------------------------------------------------------
	def update_help
		@help_window.set_text(self.item == nil ? "" : self.item.description)
	end
end

#???????????????????????????????????????

#==============================================================================
# ¦ Window_DepositoryNumber
#------------------------------------------------------------------------------
# ????????????????????????
#==============================================================================

class Window_DepositoryNumber < Window_Base
	#--------------------------------------------------------------------------
	# ? ?????????
	#--------------------------------------------------------------------------
	def initialize
		@digits_max, @number = 2, 0
		# ??????????????? (0~9 ??????)
		dummy_bitmap = Bitmap.new(32, 32)
		@cursor_width = dummy_bitmap.text_size("0").width + 8
		dummy_bitmap.dispose
		@default_size = @cursor_width * @digits_max + 32
		super(0, 0, @default_size, 128)
		self.contents = Bitmap.new(width - 32, height - 32)
		self.z = 1000
		self.back_opacity = 160
		self.active = false
		self.visible = false
		@index = 0
		@item = nil
		refresh
		update_cursor_rect
	end
	#--------------------------------------------------------------------------
	# ? ???????
	# item : ????
	#--------------------------------------------------------------------------
	def item=(item)
		@item = item
	end
	#--------------------------------------------------------------------------
	# ? ?????
	#--------------------------------------------------------------------------
	def number
		return @number
	end
	#--------------------------------------------------------------------------
	# ? ?????
	# number : ?????
	#--------------------------------------------------------------------------
	def number=(number)
		@number = [[number, 0].max, @max].min
		refresh
	end
	#--------------------------------------------------------------------------
	# ? ?????????
	#--------------------------------------------------------------------------
	def update_cursor_rect
		self.cursor_rect.set(@index * @cursor_width, 32, @cursor_width, 32)
	end
	#--------------------------------------------------------------------------
	# ? ????
	#--------------------------------------------------------------------------
	def reset(type)
		@number = 0
		@index = @digits_max - 1
		if type == 0
			case @item
			when RPG::Item
				@max = $game_party.item_number(@item.id)
				dep = $game_party.deposit_item_number(@item.id)
			when RPG::Weapon
				@max = $game_party.weapon_number(@item.id)
				dep = $game_party.deposit_weapon_number(@item.id)
			when RPG::Armor
				@max = $game_party.armor_number(@item.id)
				dep = $game_party.deposit_armor_number(@item.id)
			end
			# ??????????
			self.contents.fill_rect(0, 64, width - 32, 32, Color.new(0, 0, 0, 0))
			self.contents.font.color = system_color
			self.contents.draw_text(0, 64, width - 32, 32, "#{dep}In banca")
			self.contents.font.size = 28
			self.contents.font.name = "Monotype Corsiva"
		else
			case @item
			when RPG::Item
				@max = [$game_party.deposit_item_number(@item.id),
				10 ** @digits_max - $game_party.item_number(@item.id) - 1].min
				having = $game_party.item_number(@item.id)
			when RPG::Weapon
				@max = [$game_party.deposit_weapon_number(@item.id),
				10 ** @digits_max - $game_party.weapon_number(@item.id) - 1].min
				having = $game_party.weapon_number(@item.id)
			when RPG::Armor
				@max = [$game_party.deposit_armor_number(@item.id),
				10 ** @digits_max - $game_party.armor_number(@item.id) - 1].min
				having = $game_party.armor_number(@item.id)
			end
			# ??????
			self.contents.fill_rect(0, 64, width - 32, 32, Color.new(0, 0, 0, 0))
			self.contents.font.color = system_color
			self.contents.draw_text(0, 64, width - 32, 32, "#{having}Dalla Banca")
			self.contents.font.size = 28
			self.contents.font.name = "Monotype Corsiva"
		end
		refresh
	end
	#--------------------------------------------------------------------------
	# ? ??????
	#--------------------------------------------------------------------------
	def refresh
		self.contents.fill_rect(0, 32, width - 32, 32, Color.new(0, 0, 0, 0))
		self.contents.font.color = normal_color
		s = sprintf("%0*d", @digits_max, @number)
		for i in 0...@digits_max
			self.contents.draw_text(i * @cursor_width + 4, 32, 32, 32, s[i,1])
			self.contents.font.size = 28
			self.contents.font.name = "Monotype Corsiva"
		end
	end
	#--------------------------------------------------------------------------
	# ? ?????
	# string : ?????
	#--------------------------------------------------------------------------
	def set_text(string = " ")
		self.resize(self.contents.text_size(string).width + 40)
		self.contents.fill_rect(0, 0, width - 32, 32, Color.new(0, 0, 0, 0))
		self.contents.font.color = normal_color
		self.contents.draw_text(0, 0, width - 32, 32, string, 1)
		self.contents.font.size = 28
		self.contents.font.name = "Monotype Corsiva"
		refresh
		centering
	end
	#--------------------------------------------------------------------------
	# ? ?????
	# nw : ????
	#--------------------------------------------------------------------------
	def resize(nw)
		self.width = nw
		buf = self.contents.dup
		self.contents.dispose
		self.contents = Bitmap.new(nw - 32, 96)
		self.contents.blt(0, 0, buf, buf.rect)
		buf.dispose
	end
	#--------------------------------------------------------------------------
	# ? ????
	#--------------------------------------------------------------------------
	def centering
		self.x = 320 - self.width / 2
		self.y = 240 - self.height / 2
	end
	#--------------------------------------------------------------------------
	# ? ??????
	#--------------------------------------------------------------------------
	def update
		super
		return unless self.active
		# ????????????????
		if Input.repeat?(Input::UP) || Input.repeat?(Input::DOWN)
			$game_system.se_play($data_system.cursor_se)
			# ???????????????? 0 ???
			place = 10 ** (@digits_max - 1 - @index)
			n = self.number / place % 10
			self.number -= n * place
			# ??? +1???? -1
			n = (n + 1) % 10 if Input.repeat?(Input::UP)
			n = (n + 9) % 10 if Input.repeat?(Input::DOWN)
			# ???????????
			self.number += n * place
			refresh
		end
		# ?????
		if Input.repeat?(Input::RIGHT)
			if @digits_max >= 2
				$game_system.se_play($data_system.cursor_se)
				@index = (@index + 1) % @digits_max
			end
		end
		# ?????
		if Input.repeat?(Input::LEFT)
			if @digits_max >= 2
				$game_system.se_play($data_system.cursor_se)
				@index = (@index + @digits_max - 1) % @digits_max
			end
		end
		update_cursor_rect
	end
end

#???????????????????????????????????????

#==============================================================================
# ¦ Scene_Depository
#------------------------------------------------------------------------------
# ??????????????????
#==============================================================================

class Scene_Depository
	#--------------------------------------------------------------------------
	# ? ?????
	#--------------------------------------------------------------------------
	def main
		# ??????????
		@spriteset = Spriteset_Map.new
		# ??????????
		if $imported["HelpExtension"]
			@dummy_window = Window_Base.new(0, 192, 640, 288)
			@help_window = Window_HelpExtension.new
		else
			@dummy_window = Window_Base.new(0, 128, 640, 352)
			@help_window = Window_Help.new
		end
		@dummy_window.back_opacity = 160
		@help_window.back_opacity = 160
		@command_window = Window_DepositoryCommand.new
		@gold_window = Window_DepositoryGold.new
		@item_window = Window_DepositoryItem.new
		@number_window = Window_DepositoryNumber.new
		# ?????????????
		@command_window.help_window = @help_window
		@item_window.help_window = @help_window
		# ?????????
		Graphics.transition
		# ??????
		loop do
			# ????????
			Graphics.update
			# ???????
			Input.update
			# ??????
			update
			# ????????????????
			if $scene != self
				break
			end
		end
		# ?????????
		Graphics.freeze
		# ??
		@spriteset.dispose
		@dummy_window.dispose
		@help_window.dispose
		@command_window.dispose
		@gold_window.dispose
		@item_window.dispose
		@number_window.dispose
	end
	#--------------------------------------------------------------------------
	# ? ??????
	#--------------------------------------------------------------------------
	def update
		# ????????
		@dummy_window.update
		@help_window.update
		@command_window.update
		@gold_window.update
		@item_window.update
		@number_window.update
		# ??????????????????: update_command ???
		if @command_window.active
			update_command
			return
		end
		# ??????????????????: update_gold ???
		if @gold_window.active
			update_gold
			return
		end
		# ??????????????????: update_item ???
		if @item_window.active
			update_item
			return
		end
		# ????????????????: update_number ???
		if @number_window.active
			update_number
			return
		end
	end
	#--------------------------------------------------------------------------
	# ? ?????? (??????????????????)
	#--------------------------------------------------------------------------
	def update_command
		# B ??????????
		if Input.trigger?(Input::B)
			# ????? SE ???
			$game_system.se_play($data_system.cancel_se)
			# ??????????
			$scene = Scene_Map.new
			return
		end
		# C ??????????
		if Input.trigger?(Input::C)
			# ?? SE ???
			$game_system.se_play($data_system.decision_se)
			# ?????????
			case @command_window.index
			when 0
				# ??????????????
				@gold_window.active = true
				@gold_window.visible = true
				@gold_window.reset(0)
				@help_window.set_text(KGC::DEPOSIT_GOLD)
			when 1
				# ??????????????
				@gold_window.active = true
				@gold_window.visible = true
				@gold_window.reset(1)
				@help_window.set_text(KGC::WDEPOSIT_GOLD)
			when 2
				# ??????????????
				@item_window.active = true
				@item_window.visible = true
				@item_window.refresh(0)
			when 3
				# ??????????????
				@item_window.active = true
				@item_window.visible = true
				@item_window.refresh(1)
			end
			@command_window.active = false
			# ??????????
			@dummy_window.visible = false
			return
		end
	end
	#--------------------------------------------------------------------------
	# ? ?????? (??????????????????)
	#--------------------------------------------------------------------------
	def update_gold
		# B ??????????
		if Input.trigger?(Input::B)
			# ????? SE ???
			$game_system.se_play($data_system.cancel_se)
			# ??????????????
			@command_window.active = true
			@gold_window.active = false
			@gold_window.visible = false
			@dummy_window.visible = true
			return
		end
		# C ??????????
		if Input.trigger?(Input::C)
			# ?????????
			price = @gold_window.price
			# ??? 0 ???
			if price == 0
				# ?? SE ???
				$game_system.se_play($data_system.decision_se)
				# ??????????????
				@command_window.active = true
				@gold_window.active = false
				@gold_window.visible = false
				@dummy_window.visible = true
				return
			end
			# ???? SE ???
			$game_system.se_play($data_system.shop_se)
			# ?????????
			case @command_window.index
			when 0 # ???
				$game_party.lose_gold(price)
				$game_party.gain_deposit_gold(price)
			when 1 # ????
				$game_party.gain_gold(price)
				$game_party.lose_deposit_gold(price)
			end
			# ??????????????
			@gold_window.reset(@command_window.index)
			return
		end
	end
	#--------------------------------------------------------------------------
	# ? ?????? (??????????????????)
	#--------------------------------------------------------------------------
	def update_item
		# B ??????????
		if Input.trigger?(Input::B)
			# ????? SE ???
			$game_system.se_play($data_system.cancel_se)
			# ??????????????
			@command_window.active = true
			@item_window.active = false
			@item_window.visible = false
			@dummy_window.visible = true
			return
		end
		# C ??????????
		if Input.trigger?(Input::C)
			# ?????????
			@item = @item_window.item
			# ?????
			if @item == nil
				# ??? SE ???
				$game_system.se_play($data_system.buzzer_se)
				return
			end
			# ???????????????
			@number_window.item = @item
			# ?? SE ???
			$game_system.se_play($data_system.decision_se)
			# ?????????
			case @command_window.index
			when 2 # ???
				@number_window.set_text(KGC::DEPOSIT_ITEM)
			when 3 # ????
				@number_window.set_text(KGC::WDEPOSIT_ITEM)
			end
			# ????????????
			@number_window.reset(@command_window.index - 2)
			# ????????????
			@item_window.active = false
			@number_window.active = true
			@number_window.visible = true
			return
		end
	end
	#--------------------------------------------------------------------------
	# ? ?????? (????????????????)
	#--------------------------------------------------------------------------
	def update_number
		# B ??????????
		if Input.trigger?(Input::B)
			# ????? SE ???
			$game_system.se_play($data_system.cancel_se)
			# ??????????????
			@item_window.active = true
			@number_window.active = false
			@number_window.visible = false
			return
		end
		# C ??????????
		if Input.trigger?(Input::C)
			# ?? SE ???
			$game_system.se_play($data_system.decision_se)
			number = @number_window.number
			# ?????????
			case @command_window.index
			when 2 # ???
				case @item
				when RPG::Item
					$game_party.lose_item(@item.id, number)
					$game_party.gain_deposit_item(@item.id, number)
				when RPG::Weapon
					$game_party.lose_weapon(@item.id, number)
					$game_party.gain_deposit_weapon(@item.id, number)
				when RPG::Armor
					$game_party.lose_armor(@item.id, number)
					$game_party.gain_deposit_armor(@item.id, number)
				end
			when 3 # ????
				case @item
				when RPG::Item
					$game_party.gain_item(@item.id, number)
					$game_party.lose_deposit_item(@item.id, number)
				when RPG::Weapon
					$game_party.gain_weapon(@item.id, number)
					$game_party.lose_deposit_weapon(@item.id, number)
				when RPG::Armor
					$game_party.gain_armor(@item.id, number)
					$game_party.lose_deposit_armor(@item.id, number)
				end
			end
			# ????????????????
			@item_window.refresh(@command_window.index - 2)
			# ??????????????
			@item_window.active = true
			@number_window.active = false
			@number_window.visible = false
			return
		end
	end
end

 

 

 

 

#======================================================================

# ¦ Scene_Save

#------------------------------------------------------------------------------

# ?????????????????

#==============================================================================



class Scene_Save2 < Scene_File
	
	#--------------------------------------------------------------------------
	
	# ? ?????????
	
	#--------------------------------------------------------------------------
	
	def initialize
		
		super("Dove Salvo?")
		
	end
	
	#--------------------------------------------------------------------------
	
	# ? ??????
	
	#--------------------------------------------------------------------------
	
	def on_decision(filename)
		
		# ??? SE ???
		
		$game_system.se_play($data_system.save_se)
		
		# ???????????
		
		file = File.open(filename, "wb")
		
		write_save_data(file)
		
		file.close
		
		# ????????????????
		
		if $game_temp.save_calling
			
			# ??????????????
			
			$game_temp.save_calling = false
			
			# ??????????
			
			$scene = Scene_Map.new
			
			return
			
		end
		
		# ???????????
		
		scene = Scene_Map.new
		
	end
	
	#--------------------------------------------------------------------------
	
	# ? ?????????
	
	#--------------------------------------------------------------------------
	
	def on_cancel
		
		# ????? SE ???
		
		$game_system.se_play($data_system.cancel_se)
		
		# ????????????????
		
		if $game_temp.save_calling
			
			# ??????????????
			
			$game_temp.save_calling = false
			
			# ??????????
			
			$scene = Scene_Map.new
			
			return
			
		end
		
		# ???????????
		
		$scene = Scene_Menu.new(4)
		
	end
	
	#--------------------------------------------------------------------------
	
	# ? ???????????
	
	# file : ??????????????? (??????)
	
	#--------------------------------------------------------------------------
	
	def write_save_data(file)
		
		# ???????????????????????
		
		characters = []
		
		for i in 0...$game_party.actors.size
			
			actor = $game_party.actors[i]
			
			characters.push([actor.character_name, actor.character_hue])
			
		end
		
		# ?????????????????????????
		
		Marshal.dump(characters, file)
		
		# ??????????????????????
		
		Marshal.dump(Graphics.frame_count, file)
		
		# ?????? 1 ???
		
		$game_system.save_count += 1
		
		# ?????????????
		
		# (??????????????????????????)
		
		$game_system.magic_number = $data_system.magic_number
		
		# ????????????????
		
		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)
		
	end
	
end

 

 

 

 

#======================================================================

# ¦ Scene_Load

#------------------------------------------------------------------------------

# ?????????????????

#==============================================================================



class Scene_Load2 < Scene_File
	
	#--------------------------------------------------------------------------
	
	# ? ?????????
	
	#--------------------------------------------------------------------------
	
	def initialize
		
		# ???????????????
		
		$game_temp = Game_Temp.new
		
		# ??????????????????
		
		$game_temp.last_file_index = 0
		
		latest_time = Time.at(0)
		
		for i in 0..3
			
			filename = make_filename(i)
			
			if FileTest.exist?(filename)
				
				file = File.open(filename, "r")
				
				if file.mtime > latest_time
					
					latest_time = file.mtime
					
					$game_temp.last_file_index = i
					
				end
				
				file.close
				
			end
			
		end
		
		super("Quale Salvataggio?")
		
	end
	
	#--------------------------------------------------------------------------
	
	# ? ??????
	
	#--------------------------------------------------------------------------
	
	def on_decision(filename)
		
		# ????????????
		
		unless FileTest.exist?(filename)
			
			# ??? SE ???
			
			$game_system.se_play($data_system.buzzer_se)
			
			return
			
		end
		
		# ??? SE ???
		
		$game_system.se_play($data_system.load_se)
		
		# ???????????
		
		file = File.open(filename, "rb")
		
		read_save_data(file)
		
		file.close
		
		# BGM?BGS ???
		
		$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 on_cancel
		
		# ????? SE ???
		
		$game_system.se_play($data_system.cancel_se)
		
		# ???????????
		
		$scene = Scene_Title.new
		
	end
	
	#--------------------------------------------------------------------------
	
	# ? ???????????
	
	# file : ??????????????? (??????)
	
	#--------------------------------------------------------------------------
	
	def read_save_data(file)
		
		# ?????????????????????????
		
		characters = Marshal.load(file)
		
		# ??????????????????????
		
		Graphics.frame_count = Marshal.load(file)
		
		# ????????????????
		
		$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 $game_system.magic_number != $data_system.magic_number
			
			# ????????
			
			$game_map.setup($game_map.map_id)
			
			$game_player.center($game_player.x, $game_player.y)
			
		end
		
		# ???????????????
		
		$game_party.refresh
		
	end
	
end

 

 

 

 

#==============================================================================

# ¦ Scene_Menu

#------------------------------------------------------------------------------

# ??????????????????

#==============================================================================



class Scene_Menu
	
	#--------------------------------------------------------------------------
	
	# ? ?????????
	
	# menu_index : ?????????????
	
	#--------------------------------------------------------------------------
	
	
	
	#
	
	# ????????????
	
	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 = "Banca"
		
		s5 = "Status"
		
		s6 = "Salva"
		
		s7 = "Carica"
		
		s8 = "Esci dal gioco"
		
		@command_window = Window_Command.new(180, [s1, s2, s3, s4, s5, s6,s7,s8])
		
		@command_window.index = @menu_index
		
		# ??????? 0 ????
		
		# ????????
		
		
		
		# ????????
		
		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
		
		# ?????????????
		
		
		
		# ??????????
		
		@playtime_window = Window_PlayTime.new
		
		@playtime_window.x = 0
		
		@playtime_window.y = 320
		
		# ??????????
		
		
		
		# ????????????
		
		@gold_window = Window_Gold.new
		
		@gold_window.x = 0
		
		@gold_window.y = 416
		
		# ?????????????
		
		@status_window = Window_MenuStatus.new
		
		@status_window.x = 160
		
		@status_window.y = 0
		
		# ?????????
		
		Graphics.transition
		
		# ??????
		
		loop do
			
			# ????????
			
			Graphics.update
			
			# ???????
			
			Input.update
			
			# ??????
			
			update
			
			# ????????????????
			
			if $scene != self
				
				break
				
			end
			
		end
		
		# ?????????
		
		Graphics.freeze
		
		# ????????
		
		@command_window.dispose
		
		@playtime_window.dispose
		
		
		
		@gold_window.dispose
		
		@status_window.dispose
		
	end
	
	
	
	#--------------------------------------------------------------------------
	
	# ? ??????
	
	#--------------------------------------------------------------------------
	
	def update
		
		# ????????
		
		@command_window.update
		
		@playtime_window.update
		
		
		
		@gold_window.update
		
		@status_window.update
		
		# ??????????????????: update_command ???
		
		if @command_window.active
			
			update_command
			
			return
			
		end
		
		# ???????????????????: update_status ???
		
		if @status_window.active
			
			update_status
			
			return
			
		end
		
	end
	
	#--------------------------------------------------------------------------
	
	# ? ?????? (??????????????????)
	
	#--------------------------------------------------------------------------
	
	def update_command
		
		# B ??????????
		
		if Input.trigger?(Input::B)
			
			# ????? SE ???
			
			$game_system.se_play($data_system.cancel_se)
			
			# ??????????
			
			$scene = Scene_Map.new
			
			return
			
		end
		
		# C ??????????
		
		if Input.trigger?(Input::C)
			
			# ??????? 0 ??????????????????????
			
			if $game_party.actors.size == 0 and @command_window.index < 4
				
				# ??? SE ???
				
				$game_system.se_play($data_system.buzzer_se)
				
				return
				
			end
			
			# ???????????????????
			
			case @command_window.index
				
			when 0 # ????
				
				# ?? SE ???
				
				$game_system.se_play($data_system.decision_se)
				
				# ???????????
				
				$scene = Scene_Item.new
				
			when 1 # ???
				
				# ?? SE ???
				
				$game_system.se_play($data_system.decision_se)
				
				# ???????????????????
				
				@command_window.active = false
				
				@status_window.active = true
				
				@status_window.index = 0
				
			when 2 # ??
				
				# ?? SE ???
				
				$game_system.se_play($data_system.decision_se)
				
				# ???????????????????
				
				@command_window.active = false
				
				@status_window.active = true
				
				@status_window.index = 0
				
			when 4 # ?????
				
				# ?? SE ???
				
				$game_system.se_play($data_system.decision_se)
				
				# ???????????????????
				
				@command_window.active = false
				
				@status_window.active = true
				
				@status_window.index = 0
				
			when 5 # ???
				
				# ????????
				
				if $game_system.save_disabled
					
					# ??? SE ???
					
					$game_system.se_play($data_system.buzzer_se)
					
					return
					
				end
				
				# ?? SE ???
				
				$game_system.se_play($data_system.decision_se)
				
				# ??????????
				
				$scene = Scene_Save.new
				
			when 7 # ?????
				
				# ?? SE ???
				
				$game_system.se_play($data_system.decision_se)
				
				# ????????????
				
				$scene = Scene_End.new
				
			when 6 # ?????
				
				# ?? SE ???
				
				$game_system.se_play($data_system.decision_se)
				
				# ??????????
				
				$scene = Scene_Load.new
				
				return
				
			when 3 # ?????
				
				# ?? SE ???
				
				$game_system.se_play($data_system.decision_se)
				
				# ??????????
				
				$scene = chiama_banca
				
			end
			
			return
			
		end
		
	end
	
	#--------------------------------------------------------------------------
	
	# ? ?????? (???????????????????)
	
	#--------------------------------------------------------------------------
	
	def update_status
		
		# B ??????????
		
		if Input.trigger?(Input::B)
			
			# ????? SE ???
			
			$game_system.se_play($data_system.cancel_se)
			
			# ??????????????????
			
			@command_window.active = true
			
			@status_window.active = false
			
			@status_window.index = -1
			
			return
			
		end
		
		# C ??????????
		
		if Input.trigger?(Input::C)
			
			# ???????????????????
			
			case @command_window.index
				
			when 1 # ???
				
				# ???????????? 2 ?????
				
				if $game_party.actors[@status_window.index].restriction >= 2
					
					# ??? SE ???
					
					$game_system.se_play($data_system.buzzer_se)
					
					return
					
				end
				
				# ?? SE ???
				
				$game_system.se_play($data_system.decision_se)
				
				# ??????????
				
				$scene = Scene_Skill.new(@status_window.index)
				
			when 2 # ??
				
				# ?? SE ???
				
				$game_system.se_play($data_system.decision_se)
				
				# ?????????
				
				$scene = Scene_Equip.new(@status_window.index)
				
			when 4 # ?????
				
				# ?? SE ???
				
				$game_system.se_play($data_system.decision_se)
				
				# ????????????
				
				$scene = Scene_Status.new(@status_window.index)
				
			end
			
			return
			
		end
		
	end
	
end

 

 

Edited by Dilos
Applicato tag code.

(\__/)

(='.'=)

(")_(")

Questo è Bunny. Ho deciso di aiutarlo nella sua missione di conquista del mondo.

Compagni di Bunny unitevi a me!

 

http://img170.imageshack.us/img170/1858/pizzelartzzennm9.png

I chara da me postati: CLICCA QUI! PER XP - CLICCA QUI! PER XP(2) - CLICCA QUI! PER VX - CLICCA QUI! PER 2K/2K3!

I tileset da me postati:CLICCA QUI! PER XP

I Personaggi Completi da me postati: CLICCA QUI! PER XP

I Face da me postati: CLICCA QUI! PER XP

I Battlers da me postati: CLICCA QUI! PER XP!

Le Windowskin da me postate: CLICCA QUI! PER XP!

Risorse sonore da me postate: CLICCA QUI! PER SCARICARLE!

Guida al Ruby: CLICCA QUI! PER SCARICARLA!

Vi prego di inserirmi nei crediti...Grazie!

Link to comment
Share on other sites

  • 4 months later...
  • 10 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...