Jump to content
Rpg²S Forum

Andre4e

Utenti
  • Posts

    158
  • Joined

  • Last visited

Posts posted by Andre4e

  1. :biggrin: :rovatfl: :rovatfl: :rovatfl: :rovatfl: :rovatfl: :rovatfl: :rovatfl: :rovatfl: :rovatfl: :rovatfl:

    Questa è la discussione più divertente del mondo..dovrebbe entrare nel guiness..e lo dovrebbe entrare anke phatimo

    con il suo chara con la spada più forte del gioco :rovatfl: :rovatfl: :rovatfl: :rovatfl: :rovatfl: :rovatfl:

  2. Devi avere il Main modificato!

    Ormai ce lo dovrebbero avere tutti!

     

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

    # ** Main

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

    # After defining each class, actual processing begins here.

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

     

    begin

     

    # This variable determines the default font type

    $defaultfonttype = $fontface = $fontname = Font.default_name = "Arial"

    # This variable determines the default font size

    $defaultfontsize = $fontsize = Font.default_size = 20

     

     

     

    #Schermo intero-----------------------------------

    #$win_event = Win32API.new 'user32', 'keybd_event', %w(l l l l), ''

    # $win_event.call(18,1,0,0)

    # $win_event.call(13,1,0,0)

    # $win_event.call(18,1,2,0)

    # $win_event.call(13,1,2,0)

    # Prepare for transition

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

    Graphics.freeze

    # Make scene object (title screen)

    $scene = Scene_Title.new

    # Call main method as long as $scene is effective

    while $scene != nil

    $scene.main

    end

    # Fade out

    Graphics.transition(20)

    rescue Errno::ENOENT

    # Supplement Errno::ENOENT exception

    # If unable to open file, display message and end

    filename = $!.message.sub("No such file or directory - ", "")

    print("Unable to find file #{filename}.")

    end

  3. Banca x oggetti e Banca x soldi

    Descrizione


    Visto che serve a molti, ho deciso di postarle qui!
    Praticamente è la banca oggetti divisa in 2:
    Una Banca x oggetti e Una banca x i soldi


    Autore


    Creatore della banca: Sconosciuto (O almeno io non so chi è)
    Modifica e divisione della banca in 2 parti: Andre4e

     

    Allegati


    Screenshot:
    Screen 1
    Screen 2

    Demo


    Istruzioni per l'uso


    Inserite gli script in una nuova classe sopra main!
    Per richiamare la banca creare un evento e con il chiama script
    Inserire :
    banca_oggetti Per la banca oggetti
    banca_soldi Per la banca soldi


    Script


    Banca oggetti:


     

    #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
    #_/script da fare nell'evento: --> Banca_oggetti <--
    #_/----------------------------------------------------------------------------
    #_/ ??????????????????????????
    #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
    module KGCO
    	$game_special_elements = {}
    	$imported = {}
    	$data_states = load_data("Data/States.rxdata")
    	$data_system = load_data("Data/System.rxdata")
    end
    #==============================================================================
    # ? ???????? ?
    #==============================================================================
    
    module KGCO
    	
    	# ??????????????
    	NewDepository_COMMAND = [
    	"Deposita Oggetti",
    	"Ritira Oggetti"
    	]
    	# ????????????
    	NewDepository_HELP = [
    	"Deposita Oggetti",
    	"Ritira Oggetti"
    	]
    	
    	
    	DEPOSIT_ITEM = "Deposita Oggetti"
    	# ?????????????????(???????)
    	WDEPOSIT_ITEM = "Ritira Oggetti"
    end
    
    #???????????????????????????????????????
    
    $imported = {} if $imported == nil
    $imported["Banca"] = true
    
    #--------------------------------------------------------------------------
    # ? ????????
    #--------------------------------------------------------------------------
    def banca_oggetti
    	# ???????????
    	$game_player.straighten
    	# ???????????
    	$scene = Scene_NewDepository.new
    end
    
    #???????????????????????????????????????
    
    #==============================================================================
    # ¦ Game_Party
    #==============================================================================
    
    class Game_Party
    	#--------------------------------------------------------------------------
    	# ? ?????????
    	#--------------------------------------------------------------------------
    	alias initialize_KGCO_NewDepository initialize
    	def initialize
    		# ???????
    		initialize_KGCO_NewDepository
    		$defaultfonttype = $fontface
    		
    		@deposit_gold = 0
    		@deposit_item, @deposit_weapon, @deposit_armor = [], [], []
    	end
    	#--------------------------------------------------------------------------
    	# ? ??????
    	#--------------------------------------------------------------------------
    	def deposit_gold
    		@deposit_gold = 0 if @deposit_gold == nil
    		return @deposit_gold
    	end
    	#--------------------------------------------------------------------------
    	# ? ??????
    	# number : ???
    	#--------------------------------------------------------------------------
    	def gain_deposit_gold(number)
    		@deposit_gold = 0 if @deposit_gold == nil
    		@deposit_gold += number
    	end
    	#--------------------------------------------------------------------------
    	# ? ??????
    	# number : ???
    	#--------------------------------------------------------------------------
    	def lose_deposit_gold(number)
    		self.gain_deposit_gold(-number)
    	end
    	#--------------------------------------------------------------------------
    	# ? ?????????
    	# id : ID
    	#--------------------------------------------------------------------------
    	def deposit_item_number(id)
    		$defaultfonttype = $fontface
    		@deposit_item = [] if @deposit_item == nil
    		return @deposit_item[id] != nil ? @deposit_item[id] : 0
    	end
    	#--------------------------------------------------------------------------
    	# ? ?????????
    	# id : ID
    	# number : ??
    	#--------------------------------------------------------------------------
    	def gain_deposit_item(id, number)
    		$defaultfonttype = $fontface
    		@deposit_item = [] if @deposit_item == nil
    		@deposit_item[id] = 0 if @deposit_item[id] == nil
    		@deposit_item[id] += number
    	end
    	#--------------------------------------------------------------------------
    	# ? ?????????
    	# id : ID
    	# number : ??
    	#--------------------------------------------------------------------------
    	def lose_deposit_item(id, number)
    		$defaultfonttype = $fontface
    		self.gain_deposit_item(id, -number)
    	end
    	#--------------------------------------------------------------------------
    	# ? ???????
    	# id : ID
    	#--------------------------------------------------------------------------
    	def deposit_weapon_number(id)
    		@deposit_weapon = [] if @deposit_weapon == nil
    		return @deposit_weapon[id] != nil ? @deposit_weapon[id] : 0
    	end
    	#--------------------------------------------------------------------------
    	# ? ???????
    	# id : ID
    	# number : ??
    	#--------------------------------------------------------------------------
    	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
    	#--------------------------------------------------------------------------
    	# ? ???????
    	# id : ID
    	# number : ??
    	#--------------------------------------------------------------------------
    	def lose_deposit_weapon(id, number)
    		self.gain_deposit_weapon(id, -number)
    	end
    	#--------------------------------------------------------------------------
    	# ? ???????
    	# id : ID
    	#--------------------------------------------------------------------------
    	def deposit_armor_number(id)
    		@deposit_armor = [] if @deposit_armor == nil
    		return @deposit_armor[id] != nil ? @deposit_armor[id] : 0
    	end
    	#--------------------------------------------------------------------------
    	# ? ???????
    	# id : ID
    	# number : ??
    	#--------------------------------------------------------------------------
    	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
    	#--------------------------------------------------------------------------
    	# ? ???????
    	# id : ID
    	# number : ??
    	#--------------------------------------------------------------------------
    	def lose_deposit_armor(id, number)
    		self.gain_deposit_armor(id, -number)
    	end
    end
    #???????????????????????????????????????
    
    #==============================================================================
    # ¦ Window_NewDepositoryCommand
    #------------------------------------------------------------------------------
    # ???????????????????????
    #==============================================================================
    
    class Window_NewDepositoryCommand < Window_Selectable
    	#--------------------------------------------------------------------------
    	# ? ?????????
    	#--------------------------------------------------------------------------
    	def initialize
    		super(0, 64, 640, 64)
    		self.y = 128 if $imported["HelpExtension"]
    		self.contents = Bitmap.new(width - 32, height - 32)
    		self.contents.font.name = $fontface
    		self.contents.font.size = 20
    		# ?????????
    		@commands = KGCO::NewDepository_COMMAND
    		@item_max = @commands.size
    		@column_max = @commands.size
    		@item_width = (width - 32 - 320) / @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 + 160, 0, @item_width, 32)
    			self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    			self.contents.font.color = system_color
    			self.contents.font.name = $fontface
    			self.contents.draw_text(rect, @commands[i], 1)
    		end
    	end
    	#--------------------------------------------------------------------------
    	# ? ?????????
    	#--------------------------------------------------------------------------
    	def update_cursor_rect
    		if index != -1
    			self.cursor_rect.set(@item_width * index + 160, 0, @item_width, 32)
    		end
    	end
    	#--------------------------------------------------------------------------
    	# ? ?????????
    	#--------------------------------------------------------------------------
    	def update_help
    		$defaultfonttype = $fontface
    		@help_window.set_text(KGCO::NewDepository_HELP[self.index])
    	end
    end
    
    
    
    #==============================================================================
    # ¦ Window_NewDepositoryItem
    #------------------------------------------------------------------------------
    # ???????????????????????????????
    #==============================================================================
    
    class Window_NewDepositoryItem < 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.contents.font.name = "Arial"
    		#self.contents.font.size = 20
    		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)
    		$defaultfonttype = $fontface
    		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.draw_text(x + 240, y, 16, 32, ":", 1)
    		self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
    	end
    	#--------------------------------------------------------------------------
    	# ? ?????????
    	#--------------------------------------------------------------------------
    	def update_help
    		$defaultfonttype = $fontface
    		
    		@help_window.set_text(self.item == nil ? "" : self.item.description)
    	end
    end
    
    #???????????????????????????????????????
    
    #==============================================================================
    # ¦ Window_NewDepositoryNumber
    #------------------------------------------------------------------------------
    # ????????????????????????
    #==============================================================================
    
    class Window_NewDepositoryNumber < Window_Base
    	#--------------------------------------------------------------------------
    	# ? ?????????
    	#--------------------------------------------------------------------------
    	def initialize
    		$defaultfonttype = $fontface
    		@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
    		self.contents.font.name = $fontface
    		self.contents.font.size = 20
    	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.font.name = $fontface
    			self.contents.draw_text(0, 64, width - 32, 32, "#{dep} Depositati")
    		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.font.name = $fontface
    			self.contents.draw_text(0, 64, width - 32, 32, "#{having} Posseduti")
    		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])
    		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)
    		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_NewDepository
    #------------------------------------------------------------------------------
    # ??????????????????
    #==============================================================================
    
    class Scene_NewDepository
    	#--------------------------------------------------------------------------
    	# ? ?????
    	#--------------------------------------------------------------------------
    	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_NewDepositoryCommand.new
    		@item_window = Window_NewDepositoryItem.new
    		@number_window = Window_NewDepositoryNumber.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
    		
    		@item_window.dispose
    		@number_window.dispose
    	end
    	#--------------------------------------------------------------------------
    	# ? ??????
    	#--------------------------------------------------------------------------
    	def update
    		# ????????
    		@dummy_window.update
    		@help_window.update
    		@command_window.update
    		
    		@item_window.update
    		@number_window.update
    		# ??????????????????: update_command ???
    		if @command_window.active
    			update_command
    			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
    				# ??????????????
    				@item_window.active = true
    				@item_window.visible = true
    				@item_window.refresh(0)
    			when 1
    				# ??????????????
    				@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_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 0 # ???
    				@number_window.set_text(KGCO::DEPOSIT_ITEM)
    			when 1 # ????
    				@number_window.set_text(KGCO::WDEPOSIT_ITEM)
    			end
    			# ????????????
    			@number_window.reset(@command_window.index)
    			# ????????????
    			@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 0 # ???
    				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 1 # ????
    				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)
    			# ??????????????
    			@item_window.active = true
    			@number_window.active = false
    			@number_window.visible = false
    			return
    		end
    	end
    end
    

     

     

     

    Banca soldi:

     

     

     

    #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
    #_/script da fare nell'evento: --> banca_soldi <--
    #_/----------------------------------------------------------------------------
    #_/ ??????????????????????????
    #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
    module KGC
    	$game_special_elements = {}
    	$imported = {}
    	$data_states = load_data("Data/States.rxdata")
    	$data_system = load_data("Data/System.rxdata")
    end
    #==============================================================================
    # ? ???????? ?
    #==============================================================================
    
    module KGC
    	
    	# ??????????????
    	DEPOSITORY_COMMAND = [
    	
    	"Deposita Denaro",#+ $data_system.words.gold, # ??????
    	"Ritira Denaro"# + $data_system.words.gold, # ???????
    	
    	]
    	# ????????????
    	DEPOSITORY_HELP = [
    	"Deposita Denaro",
    	"Ritira Denaro"
    	
    	]
    	
    	# ????????
    	DEPOSITORY_GOLD_DIGITS = 7
    	
    	# ????????????????(????????)
    	DEPOSIT_GOLD = "Deposita Denaro"#+ $data_system.words.gold
    	# ?????????????????(????????)
    	WDEPOSIT_GOLD = "Ritira Denaro"#+ $data_system.words.gold
    	
    end
    
    #???????????????????????????????????????
    
    $imported = {} if $imported == nil
    $imported["Banca"] = true
    
    #--------------------------------------------------------------------------
    # ? ????????
    #--------------------------------------------------------------------------
    def banca_soldi
    	# ???????????
    	$game_player.straighten
    	# ???????????
    	$scene = Scene_Depository.new
    end
    
    #???????????????????????????????????????
    
    #==============================================================================
    # ¦ Game_Party
    #==============================================================================
    
    class Game_Party
    	#--------------------------------------------------------------------------
    	# ? ?????????
    	#--------------------------------------------------------------------------
    	alias initialize_KGC_Depository initialize
    	def initialize
    		# ???????
    		initialize_KGC_Depository
    		$defaultfonttype = $fontface
    		
    		@deposit_gold = 0
    		
    	end
    	#--------------------------------------------------------------------------
    	# ? ??????
    	#--------------------------------------------------------------------------
    	def deposit_gold
    		@deposit_gold = 0 if @deposit_gold == nil
    		return @deposit_gold
    	end
    	#--------------------------------------------------------------------------
    	# ? ??????
    	# number : ???
    	#--------------------------------------------------------------------------
    	def gain_deposit_gold(number)
    		@deposit_gold = 0 if @deposit_gold == nil
    		@deposit_gold += number
    	end
    	#--------------------------------------------------------------------------
    	# ? ??????
    	# number : ???
    	#--------------------------------------------------------------------------
    	def lose_deposit_gold(number)
    		self.gain_deposit_gold(-number)
    	end
    end
    
    
    #==============================================================================
    # ¦ Window_DepositoryCommand
    #------------------------------------------------------------------------------
    # ???????????????????????
    #==============================================================================
    
    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)
    		self.contents.font.name = $fontface
    		self.contents.font.size = 20
    		# ?????????
    		@commands = KGC::DEPOSITORY_COMMAND
    		@item_max = @commands.size
    		@column_max = @commands.size
    		@item_width = (width - 32 - 320) / @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 + 160, 0, @item_width, 32)
    			self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    			self.contents.font.color = system_color
    			self.contents.font.name = $fontface
    			self.contents.draw_text(rect, @commands[i], 1)
    		end
    	end
    	#--------------------------------------------------------------------------
    	# ? ?????????
    	#--------------------------------------------------------------------------
    	def update_cursor_rect
    		if index != -1
    			self.cursor_rect.set(@item_width * index + 160, 0, @item_width, 32)
    		end
    	end
    	#--------------------------------------------------------------------------
    	# ? ?????????
    	#--------------------------------------------------------------------------
    	def update_help
    		$defaultfonttype = $fontface
    		@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.contents.font.name = $fontface
    			self.contents.font.size = 20
    			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
    		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.font.name = $fontface
    		self.contents.font.size = 20
    		self.contents.draw_text(0, 0, 608, 32, "Posseduti")
    		self.contents.draw_text(0, 64, 608, 32, "Depositati")
    		self.contents.font.name = $fontface
    		self.contents.font.size = 20
    		if type == 0
    			self.contents.draw_text(0, 128, 608, 32, "Inserisci numero di soldi da depositare")
    			self.contents.font.name = $fontface
    			self.contents.font.size = 20
    			@max = $game_party.gold
    		else
    			self.contents.draw_text(0, 128, 608, 32, "Inserisci numero di soldi da prelevare")
    			@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)
    		self.contents.font.name = $fontface
    		self.contents.font.size = 20
    		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)
    		end
    		self.contents.font.color = system_color
    		self.contents.draw_text(332 - cx, 160, cx, 32, domination, 2)
    	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
    
    
    
    #==============================================================================
    # ¦ 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
    		
    		# ?????????????
    		@command_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
    		
    	end
    	#--------------------------------------------------------------------------
    	# ? ??????
    	#--------------------------------------------------------------------------
    	def update
    		# ????????
    		@dummy_window.update
    		@help_window.update
    		@command_window.update
    		@gold_window.update
    		
    		# ??????????????????: update_command ???
    		if @command_window.active
    			update_command
    			return
    		end
    		# ??????????????????: update_gold ???
    		if @gold_window.active
    			update_gold
    			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)
    			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
    	
    end
    

     


    Bugs e Conflitti Noti


    N/A


    Altri Dettagli


    N/A

  4. Veramente fantastico questo gioco!

    é ricchissimo di storia ma allo stesso tempo lascia nache un po di libertà al giocatore!

    Per ora sono ancora agli inizi xk mettere a dura prova le nostre abilità a giocare!!

    Adesso sono nel punto in cui dobbiamo sconfiggere il troll!!

    Ahhhhhhh!é una bestia, con un colpo ti uccide...ma prima o poi lo sconfiggerò :biggrin:

     

     

    Solo una cosa non mi piace del gioco..cioè il tempo di frequenza impostato alle battaglie, cioè dopo 2 passi ti appare subito un mostro e anche se cè il comando fuga, per passare da una mappa all'altra uno ci mette 3 giorni

     

    Comunque stupendo!!

    Provatelo!! :biggrin:

  5. Però non ho capito una cosa di quello script!

    Cioè se io metto un messaggio qualsiasi, mi compare automaticamente il face di quell'evento!

    e fin qui ci sono arrivato!

    Ma poi dice che x visualizzare il face dell'eroe bisogna mettere il nome dell' eroe all'inizio del discorso attraverso il comando \n[numeroeroe]

     

    Però che significa?

     

    cioè io ho fatto un messaggio e ho messo il "\n[1]" all'inizio ma mi compare sempre il face del pg dell'evento

    Poi ho provato a mettere "\name[\n[1]]", ma compare solo il nome del pg.

     

    Quindi come si fa a far vedere il face dell'eroe??

  6. Allora io all'inizio faccio scegliere quale pg fra gli 8 si vuole utilizzare!

    Però poi quando nel corso del gioco c'è un messaggio che mostra il face del pg

    Utilizzando l'AMS

    io con il comando \f[File_GRAFICO] gli devo dire il nome del file grafico non posso mettere variabili all'interno

    o altro e quindi non so come far visualizzare il faceset del pg giusto!

×
×
  • Create New...