Jump to content
Rpg²S Forum

*Database Mostri Avanzato


friday666
 Share

Recommended Posts

Bestiario avanzato

Descrizione

Questo script permette di dividere i mostri in diversi gruppi: potreste pure dividerli in classi se volete XD

Autore

???

Allegati

http://i24.photobucket.com/albums/c33/RPGArchive/aa2b9add.gif
http://i24.photobucket.com/albums/c33/RPGArchive/dbbbf8f1.gif

Istruzioni per l'uso


Copiare il Codice dello Script usando il Tag per i pezzi di codice molto brevi (4 o 5 righe) e il tag abbinato al per tutti gli altri
- Per aggiungere dei mostri in un gruppo dovrete mettere nel database, affianco al nome del mostro e tra parentesi, il nome del gruppo ad esempio:

- Per richiamare lo script usate questo call script:

$scene = Scene_Beastairy.new

001:Ghost(Gruppo1)

Ora lo script:

 

 

#==============================================================================
# Advanced Monster Database
#--------------------------------------------------------------------------
# Created By SephirothSpawn (11.18.05)
# Last Updated: 11.19.05
#==============================================================================

#==============================================================================
# ** Class Scene Title
#==============================================================================
class Scene_Title
	#--------------------------------------------------------------------------
	# * Alias' New Game Method
	#--------------------------------------------------------------------------
	alias new_game command_new_game
	#--------------------------------------------------------------------------
	# * Adds Beastairy Game Variables
	#--------------------------------------------------------------------------
	def command_new_game
		# Sets Up Smithery List
		$game_beastairy = Game_Beastairy.new
		new_game
	end
end

#==============================================================================
# ** Game_Temp
#==============================================================================
class Game_Temp
	#--------------------------------------------------------------------------
	# * Public Instance Variables
	#--------------------------------------------------------------------------
	attr_accessor :beastairy_return
	#--------------------------------------------------------------------------
	# * Alias Initialization
	#--------------------------------------------------------------------------
	alias beastairy_initialize initialize
	#--------------------------------------------------------------------------
	# * Object Initialization
	#--------------------------------------------------------------------------
	def initialize
		beastairy_initialize
		@beastairy_return = false
	end
end

#==============================================================================
# ** Class Game Beastairy
#==============================================================================
class Game_Beastairy
	#--------------------------------------------------------------------------
	# * Public Instance Variables
	#--------------------------------------------------------------------------
	attr_accessor :monster_groups
	#------------------------------------------------------------------#==============================================================================
	# Advanced Monster Database
	#--------------------------------------------------------------------------
	# Created By SephirothSpawn (11.18.05)
	# Last Updated: 11.19.05
	#==============================================================================
	
	#==============================================================================
	# ** Class Scene Title
	#==============================================================================
	class Scene_Title
		#--------------------------------------------------------------------------
		# * Alias' New Game Method
		#--------------------------------------------------------------------------
		alias new_game command_new_game
		#--------------------------------------------------------------------------
		# * Adds Beastairy Game Variables
		#--------------------------------------------------------------------------
		def command_new_game
			# Sets Up Smithery List
			$game_beastairy = Game_Beastairy.new
			new_game
		end
	end
	
	#==============================================================================
	# ** Game_Temp
	#==============================================================================
	class Game_Temp
		#--------------------------------------------------------------------------
		# * Public Instance Variables
		#--------------------------------------------------------------------------
		attr_accessor :beastairy_return
		#--------------------------------------------------------------------------
		# * Alias Initialization
		#--------------------------------------------------------------------------
		alias beastairy_initialize initialize
		#--------------------------------------------------------------------------
		# * Object Initialization
		#--------------------------------------------------------------------------
		def initialize
			beastairy_initialize
			@beastairy_return = false
		end
	end
	
	#==============================================================================
	# ** Class Game Beastairy
	#==============================================================================
	class Game_Beastairy
		#--------------------------------------------------------------------------
		# * Public Instance Variables
		#--------------------------------------------------------------------------
		attr_accessor :monster_groups
		#--------------------------------------------------------------------------
		# * Object Initialization
		#--------------------------------------------------------------------------
		def initialize
			@monster_groups = []
			for i in 1...$data_enemies.size
				$data_enemies[i].beastairy_setup
				unless @monster_groups.include?($data_enemies[i].group)
					@monster_groups.push($data_enemies[i].group)
				end
			end
		end
	end
	
	#==============================================================================
	# ** Module RPG
	#==============================================================================
	module RPG
		#=========================================================================
		# ** Class Enemy
		#=========================================================================
		class Enemy
			#--------------------------------------------------------------------------
			# * Public Instance Variables
			#--------------------------------------------------------------------------
			# Detectors
			attr_accessor :seen, :defeated, :group
			# Counters
			attr_accessor :seen_times, :defeated_times
			#--------------------------------------------------------------------------
			# * Setup Beastairy
			#--------------------------------------------------------------------------
			def beastairy_setup
				@seen_times, @defeated_times = 0, 0
				@seen, @defeated = false, false
				if @name.include?('(')
					a, b = @name.index('('), @name.index(')')
					@group = @name.slice!(a..b)
					@group.delete!('(')
					@group.delete!(')')
				else
					@group = "Unclassified"
				end
			end
			#--------------------------------------------------------------------------
			# * See Enemy
			#--------------------------------------------------------------------------
			def see
				@seen = true
				@seen_times += 1
			end
			#--------------------------------------------------------------------------
			# * Defeat Enemy
			#--------------------------------------------------------------------------
			def defeat
				@defeated = true
				@defeated_times += 1
			end
		end
	end
	
	#==============================================================================
	# ** Scene_Save
	#==============================================================================
	class Scene_Save < Scene_File
		#--------------------------------------------------------------------------
		# * Alias Save Data
		#--------------------------------------------------------------------------
		alias new_save write_save_data
		#--------------------------------------------------------------------------
		# * Write Save Data
		#--------------------------------------------------------------------------
		def write_save_data(file)
			new_save(file)
			Marshal.dump($game_beastairy, file)
		end
	end
	
	#==============================================================================
	# ** Scene_Load
	#==============================================================================
	class Scene_Load < Scene_File
		#--------------------------------------------------------------------------
		# * Alias Read Save Data
		#--------------------------------------------------------------------------
		alias new_load read_save_data
		#--------------------------------------------------------------------------
		# * Read Save Data
		#--------------------------------------------------------------------------
		def read_save_data(file)
			new_load(file)
			$game_beastairy = Marshal.load(file)
		end
	end
	
	#==============================================================================
	# ** Class Window Base
	#==============================================================================
	class Window_Base < Window
		#--------------------------------------------------------------------------
		# * Draw Enemy Sprite
		#--------------------------------------------------------------------------
		def draw_enemy_sprite(x, y, enemy_name, enemy_hue, pose, frame)
			bitmap = RPG::Cache.character(enemy_name, enemy_hue)
			cw = bitmap.width / 4
			ch = bitmap.height / 4
			# Facing Direction
			case pose
			when 0 ;a = 0 # Down
			when 1 ;a = ch # Left
			when 2 ;a = ch * 3 # Up
			when 3 ;a = ch * 2 # Right
			end
			# Current Animation Slide
			case frame
			when 0 ;b = 0
			when 1 ;b = cw
			when 2 ;b = cw * 2
			when 3 ;b = cw * 3
			end
			# Bitmap Rectange
			src_rect = Rect.new(b, a, cw, ch)
			# Draws Bitmap
			self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
		end
	end
	
	#==============================================================================
	# Window Monster Group Info
	#==============================================================================
	class Window_Monster_Group_Info < Window_Base
		#--------------------------------------------------------------------------
		# * Object Initialization
		#--------------------------------------------------------------------------
		def initialize
			super(200, 0, 440, 480)
			self.contents = Bitmap.new(width - 32, height - 32)
			refresh(0, 0, 0)
		end
		#--------------------------------------------------------------------------
		# * Refresh
		# index : Index of Group From Game_Beastairy.Groups
		# pose : Enemy Character Pose
		# frame : Frame of Pose
		#--------------------------------------------------------------------------
		def refresh(index, pose, frame)
			# Clears Window
			contents.clear
			# Sets Up Group Name
			group_name = $game_beastairy.monster_groups[index]
			# Sets Up Enemies In Group
			enemies = []
			for i in 1...$data_enemies.size
				if $data_enemies[i].group == group_name
					enemies.push($data_enemies[i])
				end
			end
			group_name = "Exit" if index == $game_beastairy.monster_groups.size
			# Draws Enemy Group Name
			contents.font.color = system_color
			contents.draw_text(0, 0, self.width - 32, 32, group_name, 1)
			unless index == $game_beastairy.monster_groups.size
				# Offsets Graphics X Position
				graphics_offset = contents.width / (enemies.size + 1)
				# Draws Enemies Graphics
				for i in 0...enemies.size
					draw_enemy_sprite(graphics_offset * (i + 1), 124, enemies[i].battler_name , enemies[i].battler_hue , pose, frame)
				end
				# HP, SP, and Gold Word
				hp_word = $data_system.words.hp
				sp_word = $data_system.words.sp
				gold_word = $data_system.words.gold
				# Draws Table Headings
				contents.draw_text(4, 128, width, 24, "Name")
				contents.draw_text(0, 128, 200, 24, "Max #{hp_word}", 2)
				contents.draw_text(0, 128, 300, 24, "Max #{sp_word}", 2)
				contents.draw_text(-4, 128, contents.width, 24, "#{gold_word} Award", 2)
				# Draws Enemies Stats
				contents.font.color = normal_color
				for i in 0...enemies.size
					# Sets Enemy Stats
					name, hp, sp, gold = "??????????", "???", "???", "?????"
					name, hp, sp = enemies[i].name, enemies[i].maxhp, enemies[i].maxsp if enemies[i].seen
					gold = enemies[i].gold if enemies[i].defeated
					# Draws Stats
					contents.draw_text(4, 152 + (i * 24), width, 24, name)
					contents.draw_text(0, 152 + (i * 24), 200, 24, "#{hp}", 2)
					contents.draw_text(0, 152 + (i * 24), 300, 24, "#{sp}", 2)
					contents.draw_text(-4, 152 + (i * 24), contents.width, 24, "#{gold}", 2)
				end
			end
		end
	end
	
	#==============================================================================
	# Window Monster Info
	#==============================================================================
	class Window_Monster_Info < Window_Base
		#--------------------------------------------------------------------------
		# * Object Initialization
		#--------------------------------------------------------------------------
		def initialize
			super(200, 0, 440, 480)
			self.contents = Bitmap.new(width - 32, height - 32)
		end
		#--------------------------------------------------------------------------
		# * Refresh
		# index : Index of enemy From $data_enemies
		# pose : Enemy Character Pose
		# frame : Frame of Pose
		#--------------------------------------------------------------------------
		def refresh(index, pose, frame)
			# Clears Window
			contents.clear
			# Enemy
			enemy = $data_enemies[index]
			# Graphic Image
			draw_enemy_sprite(52, 100, enemy.battler_name , enemy.battler_hue, pose, frame)
			# Default Stats Set
			name = "??????????"
			maxhp = maxsp = str = dex = agi = int = atk = pdef = mdef = eva = "???"
			exp = gold = item_id = weapon_id = armor_id = treasure_prob = "?????"
			item_icon = weapon_icon = armor_icon = "049-Skill06"
			armor_type = 2
			# If the Enemy has been seen
			if enemy.seen
				name = enemy.name
				maxhp = enemy.maxhp.to_s
				maxsp = enemy.maxsp.to_s
				str = enemy.str.to_s
				dex = enemy.dex.to_s
				agi = enemy.agi.to_s
				int = enemy.int.to_s
				atk = enemy.atk.to_s
				pdef = enemy.pdef.to_s
				mdef = enemy.mdef.to_s
				eva = enemy.eva.to_s
			end
			# If the Enemy has been Defeated
			if enemy.defeated
				exp = enemy.exp.to_s
				gold = enemy.gold.to_s
				if enemy.item_id == 0
					item_id = "Nothing"
					item_icon = "032-Item01"
				else
					item_id = $data_items[enemy.item_id].name
					item_icon = $data_items[enemy.item_id].icon_name
				end
				if enemy.weapon_id == 0
					weapon_id = "Nothing"
					weapon_icon = "032-Item01"
				else
					weapon_id = $data_weapons[enemy.weapon_id].name
					weapon_icon = $data_weapons[enemy.weapon_id].icon_name
				end
				if enemy.armor_id == 0
					armor_id = "Nothing"
					armor_icon = "032-Item01"
				else
					armor_id = $data_armors[enemy.armor_id].name
					armor_icon = $data_armors[enemy.armor_id].icon_name
					armor_type = $data_armors[enemy.armor_id].type
				end
				treasure_prob = enemy.treasure_prob.to_s
			end
			# System Words
			g_word = $data_system.words.gold
			hp_word = $data_system.words.hp
			sp_word = $data_system.words.sp
			str_word = $data_system.words.str
			dex_word = $data_system.words.dex
			agi_word = $data_system.words.agi
			int_word = $data_system.words.int
			atk_word = $data_system.words.atk
			pdef_word = $data_system.words.pdef
			mdef_word = $data_system.words.mdef
			weapon_word = $data_system.words.weapon
			case armor_type
			when 0 ;armor_type = $data_system.words.armor1
			when 1 ;armor_type = $data_system.words.armor2
			when 2 ;armor_type = $data_system.words.armor3
			when 3 ;armor_type = $data_system.words.armor4
			end
			item_word = $data_system.words.item
			# Draws Name
			contents.font.color = normal_color
			contents.draw_text(116, 0, contents.width - 116, 32, name)
			# Draws Times Seen & Defeated
			contents.font.color = system_color
			contents.draw_text(116, 32, contents.width - 116, 32, "Times Seen:")
			contents.draw_text(116, 64, contents.width - 116, 32, "Times Defeated:")
			contents.font.color = normal_color
			contents.draw_text(0, 32, contents.width, 32, "#{enemy.seen_times}", 2)
			contents.draw_text(0, 64, contents.width, 32, "#{enemy.defeated_times}", 2)
			# Organizes Stats
			colomn_a_left = ["Max #{hp_word}", "Max #{sp_word}", str_word, dex_word,
			agi_word, int_word, atk_word, pdef_word, mdef_word, "Evasion"]
			colomn_a_right = [maxhp, maxsp, str,dex , agi, int, atk, pdef, mdef, eva]
			# Organized Victory Settings
			column_b_left = ["Experience Given:", "#{g_word} Dropped:", "#{item_word} Dropped:", "",
			"#{weapon_word} Dropped:", "", "#{armor_type} Dropped:", "", "Drop Pobabilty:"]
			column_b_right = [exp, gold, "", item_id, "", weapon_id, "", armor_id, treasure_prob]
			# Draws Stats
			for i in 0...colomn_a_left.size
				contents.font.color = system_color
				contents.draw_text(4, 160 + i * 32, 160, 32, colomn_a_left[i])
				contents.font.color = normal_color
				contents.draw_text(-4, 160 + i * 32, 160, 32, colomn_a_right[i], 2)
			end
			# Draws Victory Settings
			for i in 0...column_b_left.size
				contents.font.color = system_color
				contents.draw_text(168, 160 + i * 32, contents.width, 32, column_b_left[i])
				x = -4
				x = -30 if i == 3 or i == 5 or i == 7
				contents.font.color = normal_color
				contents.draw_text(x, 160 + i * 32, contents.width, 32, column_b_right[i], 2)
			end
			# Draws Item Icons
			bitmap = RPG::Cache.icon(item_icon)
			self.contents.blt(contents.width - 24, 260, bitmap, Rect.new(0, 0, 24, 24))
			bitmap = RPG::Cache.icon(weapon_icon)
			self.contents.blt(contents.width - 24, 324, bitmap, Rect.new(0, 0, 24, 24))
			bitmap = RPG::Cache.icon(armor_icon)
			self.contents.blt(contents.width - 24, 388, bitmap, Rect.new(0, 0, 24, 24))
		end
	end
	
	#==============================================================================
	# Window Beastairy Controls
	#==============================================================================
	class Window_Beastairy_Controls < Window_Base
		#--------------------------------------------------------------------------
		# * Object Initialization
		#--------------------------------------------------------------------------
		def initialize
			super(0, 288, 200, 192)
			self.contents = Bitmap.new(width - 32, height - 32)
			self.z = 999
			refresh(0)
		end
		#--------------------------------------------------------------------------
		# * Refresh
		#--------------------------------------------------------------------------
		def refresh(phase)
			# Clears Window
			contents.clear
			disabled_system_color = Color.new(192, 224, 255, 128)
			contents.font.color = normal_color
			contents.draw_text(0, 0, contents.width, 24, "L / R : Change Pose")
			# Main Phase Controls
			contents.font.color = phase == 0 ? system_color : disabled_system_color
			contents.draw_text(4, 24, contents.width, 24, "Main")
			contents.font.color = phase == 0 ? normal_color : disabled_color
			contents.draw_text(8, 48, contents.width, 24, "B : Return to Map")
			contents.draw_text(8, 72, contents.width, 24, "C : Select Group")
			# Enemy Select Controls
			contents.font.color = phase == 1 ? system_color : disabled_system_color
			contents.draw_text(4, 96, contents.width, 24, "Enemy Select")
			contents.font.color = phase == 1 ? normal_color : disabled_color
			contents.draw_text(8, 120, contents.width, 24, "B : Return to Main")
			contents.draw_text(8, 140, contents.width, 24, "C : Test Battle")
		end
	end
	
	#==============================================================================
	# ** Class Scene Beastairy
	#==============================================================================
	class Scene_Beastairy
		#--------------------------------------------------------------------------
		# * Main Processing
		#--------------------------------------------------------------------------
		def main
			# Sets Main Phase
			@phase = 0
			# Enemies Graphic Animation
			@pose, @frame, @counting_frame= 0, 0, 0
			# Current Phase Window
			@phase_window = Window_Base.new(0, 0, width = 200, height = 64)
			@phase_window.contents = contents = Bitmap.new(width - 32, height - 32)
			@phase_window.contents.draw_text(0, 0, 168, 32, "Main Phase", 1)
			# Main Window (Enemy Groups)
			commands = $game_beastairy.monster_groups.dup
			commands.push("Exit")
			@enemy_groups = Window_Command.new(200, commands)
			@enemy_groups.y = 64
			@enemy_groups.height = 224
			# Controls Window
			@controls = Window_Beastairy_Controls.new
			# Monster Group Information Window
			@monster_window = Window_Monster_Group_Info.new
			@monster_window.refresh(0, 0, 0)
			# Enemy Information Window
			@enemy_window = Window_Monster_Info.new
			@enemy_window.visible = false
			# Scene Objects
			@objects = [@phase_window, @enemy_groups, @controls, @monster_window, @enemy_window]
			# Execute transition
			Graphics.transition
			# Main loop
			loop do
				# Update game screen
				Graphics.update
				# Update input information
				Input.update
				# Update Objects Information
				@objects.each {|x| x.update}
				# Frame update
				update
				# Abort loop if screen is changed
				break if $scene != self
			end
			# Prepare for transition
			Graphics.freeze
			# Dispose of Objects
			@objects.each {|x| x.dispose unless x.disposed?}
		end
		#--------------------------------------------------------------------------
		# * Frame Update
		#--------------------------------------------------------------------------
		def update
			# Visiblity Changes Between Methods
			case @phase
				# Main Phase
			when 0
				[@enemy_window].each {|x| x.visible = false if x.visible}
				[@enemy_groups, @monster_window].each {|x| x.visible = true unless x.visible}
				@enemy_groups.active = true
			when 1
				[@enemy_window].each {|x| x.visible = true unless x.visible}
				[@enemy_groups, @monster_window].each {|x| x.visible = false if x.visible}
				@enemy_groups.active = false
			end
			# Updates Enemy Animation
			@counting_frame += 1
			if @counting_frame == 8
				@counting_frame = 0
				@frame += 1
				@frame = 0 if @frame == 4
				if @phase == 0
					@monster_window.refresh(@enemy_groups.index, @pose, @frame)
				else
					enemy_id = @enemies[@groups_enemies.index].id
					@enemy_window.refresh(enemy_id, @pose, @frame)
				end
			end
			# Current Phase Update
			case @phase
			when 0; main_update
			when 1; enemy_select
			end
		end
		#--------------------------------------------------------------------------
		# * Main Frame Update
		#--------------------------------------------------------------------------
		def main_update
			# Exit Scene
			if Input.trigger?(Input::B)
				$game_system.se_play($data_system.cancel_se)
				$game_temp.beastairy_return = false
				$scene = Scene_Map.new
				# Enemy Select
			elsif Input.trigger?(Input::C)
				$game_system.se_play($data_system.decision_se)
				if @enemy_groups.index == $game_beastairy.monster_groups.size
					$game_temp.beastairy_return = false
					$scene = Scene_Map.new
				else
					commands, @enemies = [], []
					group = $game_beastairy.monster_groups[@enemy_groups.index]
					for i in 1...$data_enemies.size
						if $data_enemies[i].group == group
							commands.push($data_enemies[i].seen ? $data_enemies[i].name : "??????????")
							@enemies.push($data_enemies[i])
						end
					end
					@groups_enemies = Window_Command.new(200, commands)
					@groups_enemies.y = 64
					@groups_enemies.height = 224
					# Phase Window Update
					@phase_window.contents.clear
					@phase_window.contents.draw_text(0, 0, 168, 32, "Enemy Select", 1)
					# Adds Object (For Updating)
					@objects.push(@groups_enemies)
					# Updates Controls Window
					@controls.refresh(1)
					enemy_id = @enemies[@groups_enemies.index].id
					@enemy_window.refresh(enemy_id, @pose, @frame)
					# Changes Phase
					@phase = 1
				end
				# Changes Pose
			elsif Input.trigger?(Input::LEFT)
				$game_system.se_play($data_system.cursor_se)
				@pose == 0 ? @pose = 3 : @pose -= 1
			elsif Input.trigger?(Input::RIGHT)
				$game_system.se_play($data_system.cursor_se)
				@pose == 3 ? @pose = 0 : @pose += 1
			end
		end
		#--------------------------------------------------------------------------
		# * Enemy Frame Update
		#--------------------------------------------------------------------------
		def enemy_select
			# Exit Phase
			if Input.trigger?(Input::B)
				$game_system.se_play($data_system.cancel_se)
				@groups_enemies.dispose
				@objects.delete(@groups_enemies)
				# Phase Window Update
				@phase_window.contents.clear
				@phase_window.contents.draw_text(0, 0, 168, 32, "Main Phase", 1)
				# Updates Controls Window
				@controls.refresh(0)
				# Changes Phase
				@phase = 0
				# Enemy Select
			elsif Input.trigger?(Input::C)
				enemy = @enemies[@groups_enemies.index]
				if enemy.seen
					$game_system.se_play($data_system.decision_se)
					enemy_name = enemy.name
					for i in 1...$data_troops.size
						if $data_troops[i].name == enemy_name
							$game_temp.beastairy_return = true
							$game_temp.battle_troop_id = i
							$game_temp.battle_can_escape = true
							$game_temp.battle_can_lose = false
							$game_temp.battle_proc = nil
							# Memorize map BGM and stop BGM
							$game_temp.map_bgm = $game_system.playing_bgm
							$game_system.bgm_stop
							# Play battle start SE
							$game_system.se_play($data_system.battle_start_se)
							# Play battle BGM
							$game_system.bgm_play($game_system.battle_bgm)
							# Straighten player position
							$game_player.straighten
							# Switch to battle screen
							$scene = Scene_Battle.new
						end
					end
				else
					$game_system.se_play($data_system.buzzer_se)
				end
			elsif Input.trigger?(Input::LEFT)
				$game_system.se_play($data_system.cursor_se)
				@pose == 0 ? @pose = 3 : @pose -= 1
			elsif Input.trigger?(Input::RIGHT)
				$game_system.se_play($data_system.cursor_se)
				@pose == 3 ? @pose = 0 : @pose += 1
			end
		end
	end
	
	#==============================================================================
	# ** Scene_Battle
	#==============================================================================
	class Scene_Battle
		#--------------------------------------------------------------------------
		# * Alias Main Processing
		#--------------------------------------------------------------------------
		alias beastairy_main main
		#--------------------------------------------------------------------------
		# * Main Processing
		#--------------------------------------------------------------------------
		def main
			unless $game_temp.beastairy_return
				@beastairy_troop = []
				troop = $data_troops[$game_temp.battle_troop_id]
				for i in 0...troop.members.size
					enemy = $data_enemies[troop.members[i].enemy_id]
					@beastairy_troop.push(enemy)
					enemy.see
				end
			else
				@beastairy_troop = []
			end
			beastairy_main
		end
		#--------------------------------------------------------------------------
		# * Battle Ends
		# result : results (0:win 1:lose 2:escape)
		#--------------------------------------------------------------------------
		def battle_end(result)
			# Clear in battle flag
			$game_temp.in_battle = false
			# Clear entire party actions flag
			$game_party.clear_actions
			# Remove battle states
			for actor in $game_party.actors
				actor.remove_states_battle
			end
			# Clear enemies
			$game_troop.enemies.clear
			# Call battle callback
			if $game_temp.battle_proc != nil
				$game_temp.battle_proc.call(result)
				$game_temp.battle_proc = nil
			end
			if $game_temp.beastairy_return
				$scene = Scene_Beastairy.new
			else
				if result == 0
					for enemy in @beastairy_troop
						enemy.defeat
					end
				end
				$scene = Scene_Map.new
			end
		end
		#--------------------------------------------------------------------------
		# * Frame Update
		#--------------------------------------------------------------------------
		def update
			# If battle event is running
			if $game_system.battle_interpreter.running?
				# Update interpreter
				$game_system.battle_interpreter.update
				# If a battler which is forcing actions doesn't exist
				if $game_temp.forcing_battler == nil
					# If battle event has finished running
					unless $game_system.battle_interpreter.running?
						# Rerun battle event set up if battle continues
						unless judge
							setup_battle_event
						end
					end
					# If not after battle phase
					if @phase != 5
						# Refresh status window
						@status_window.refresh
					end
				end
			end
			# Update system (timer) and screen
			$game_system.update
			$game_screen.update
			# If timer has reached 0
			if $game_system.timer_working and $game_system.timer == 0
				# Abort battle
				$game_temp.battle_abort = true
			end
			# Update windows
			@help_window.update
			@party_command_window.update
			@actor_command_window.update
			@status_window.update
			@message_window.update
			# Update sprite set
			@spriteset.update
			# If transition is processing
			if $game_temp.transition_processing
				# Clear transition processing flag
				$game_temp.transition_processing = false
				# Execute transition
				if $game_temp.transition_name == ""
					Graphics.transition(20)
				else
					Graphics.transition(40, "Graphics/Transitions/" +
					$game_temp.transition_name)
				end
			end
			# If message window is showing
			if $game_temp.message_window_showing
				return
			end
			# If effect is showing
			if @spriteset.effect?
				return
			end
			# If game over
			if $game_temp.gameover
				# Switch to game over screen
				if $game_temp.beastairy_return
					$scene = Scene_Beastairy.new
				else
					$scene = Scene_Gameover.new
				end
			end
			# If returning to title screen
			if $game_temp.to_title
				# Switch to title screen
				$scene = Scene_Title.new
				return
			end
			# If battle is aborted
			if $game_temp.battle_abort
				# Return to BGM used before battle started
				$game_system.bgm_play($game_temp.map_bgm)
				# Battle ends
				battle_end(1)
				return
			end
			# If waiting
			if @wait_count > 0
				# Decrease wait count
				@wait_count -= 1
				return
			end
			# If battler forcing an action doesn't exist,
			# and battle event is running
			if $game_temp.forcing_battler == nil and
				$game_system.battle_interpreter.running?
				return
			end
			# Branch according to phase
			case @phase
			when 1 # pre-battle phase
				update_phase1
			when 2 # party command phase
				update_phase2
			when 3 # actor command phase
				update_phase3
			when 4 # main phase
				update_phase4
			when 5 # after battle phase
				update_phase5
			end
		end
		#--------------------------------------------------------------------------
		# * Start After Battle Phase
		#--------------------------------------------------------------------------
		def start_phase5
			# Shift to phase 5
			@phase = 5
			# Play battle end ME
			$game_system.me_play($game_system.battle_end_me)
			# Return to BGM before battle started
			$game_system.bgm_play($game_temp.map_bgm)
			# Initialize EXP, amount of gold, and treasure
			exp = 0
			gold = 0
			treasures = []
			# Loop
			for enemy in $game_troop.enemies
				# If enemy is not hidden
				unless enemy.hidden
					unless $game_temp.beastairy_return
						# Add EXP and amount of gold obtained
						exp += enemy.exp
						gold += enemy.gold
						# Determine if treasure appears
						if rand(100) < enemy.treasure_prob
							if enemy.item_id > 0
								treasures.push($data_items[enemy.item_id])
							end
							if enemy.weapon_id > 0
								treasures.push($data_weapons[enemy.weapon_id])
							end
							if enemy.armor_id > 0
								treasures.push($data_armors[enemy.armor_id])
							end
						end
					end
				end
			end
			# Treasure is limited to a maximum of 6 items
			treasures = treasures[0..5]
			# Obtaining EXP
			for i in 0...$game_party.actors.size
				actor = $game_party.actors[i]
				if actor.cant_get_exp? == false
					last_level = actor.level
					actor.exp += exp
					if actor.level > last_level
						@status_window.level_up(i)
					end
				end
			end
			# Obtaining gold
			$game_party.gain_gold(gold)
			# Obtaining treasure
			for item in treasures
				case item
				when RPG::Item
					$game_party.gain_item(item.id, 1)
				when RPG::Weapon
					$game_party.gain_weapon(item.id, 1)
				when RPG::Armor
					$game_party.gain_armor(item.id, 1)
				end
			end
			# Make battle result window
			@result_window = Window_BattleResult.new(exp, gold, treasures)
			# Set wait count
			@phase5_wait_count = 100
		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

  • 1 month later...
Mi da errore all'ultima riga. Come risolvo????????????????? :rovatfl:

I miei tutorial
BS in tempo reale ad eventi
Tecnica Ruba
Pesca ad eventi
Evocare
Lancio del masso
Minigioco del Negozio

Partecipante al Rpg2s.net Game Contest 2008/2009
http://www.rpg2s.net/contest/GameContest0809/gc0809-bannerino.jpg
Gioco in Sviluppo: Factions

http://img252.imageshack.us/img252/8742/bannerinoteamlrmiu6.png
 

http://img393.imageshack.us/img393/9920/legenrpgmaniamu3.gif
Forum:The legend of making

 

 

26373462 I love you!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Mai Dire Speciale Cinema
L'Uomo che Usciva Tutti
Botte e Risposte / Rapine a mano a mano
Mobbasta
Mobbasta veramente per�
Mani in Alto
Per un pelo
Giammangiato
Anche no / Il buio / Ahia
Burle
Acqua Corrente / Urgenze

LegendRpgMania

Il 70% dei ragazzi pensa che GTA sia il miglior gioco del mondo. Il restante 30% pensa che Kingdom Hearts sia il gioco pi� bello. Se fai parte di questo 30% copia e incolla questa frase nella tua firma/blog.

MITICO OBSIDIAN LORD!!!
The March of The Swordmaster
Holy Thunderforce
Bard's Song

TALES OF MAGIC
Entra nella scuola di magia e diventa il mago pi� grande del mondo!

Tales of Magic � completamente gratuito e senza alcun obbligo! Il manuale ti fornir� informazioni sulle modalit� di funzionamento del gioco.
LINK DEL GIOCO

Bunnies Area
Bunnies Can't Phone
Bunnies Can't play 360
Bunnies Can't play Rugby
Bunnies Can't win races
Bunnies Can't Cook Eggs
Bunnies Can't cook turkey
Bunnies Can't Date
Bunnies Can't Park
Bunnies Can't play with Fireworks


Mi conoscete???
Se s� cliccate qui

 



Epitaffi:
1)E' diventato carne secca...
2)Giocava a buttarsi gi� dal castello...
3)Stava abbracciando una bomba a mano...
4)Gli piaceva bere nitroglicerina...
5)Ha ingoiato un candelotto di dinamite...
6)Ha effettuato il salto in lungo nel cratere di un vulcano...
7)Quando i suoi compagni di classe giocavano a calcio lui era la palla...



________________________________________________________________________________
A prescindere dal colore della pelle e dalla religione siamo tutti uguali e tutti abbiamo ugal diritto di vivere. Credi la scuola sia una seccatura? Un'imposizione dei genitori? Sai quanto darebbero questi bambini per avere un'istruzione? Invece loro ed i loro genitori vengono sfruttati nelle industrie delle pi� note multinazionali americane ed europee: Nike, Nestl�, Kraft...
Se sei anche tu contro il razzismo e contro lo sfruttamento inserisci questa frase nella tua firma.
________________________________________________________________________________
Now Playing:
PS3 : Soul Calibur 4
PS2 : Kingdom Hearts Re Chain of Memories
DS : Final Fantasy IV / Final Fantasy XII : Revenant Wings / Spore Creatures / Dinosaur King
PSP : Ratchet and Clank : Size Matters / Secret Agent Clank / Naruto Ultimate Ninja Heroes 2 / GuitarWay To Heaven 4 Amplified
PC : Frets on Fire con la chitarra!!! O_O

Rpg Maker Xp

I miei progetti:

Per ora nulla...

http://team.ffonline.it/imgpersonaggio/cloud_it.jpg
http://img230.imageshack.us/img230/608/pencehaynerroxasolettejyt1.th.jpg
http://r3.fodey.com/15d01c4c6f2dd4908b320f697f7fbe7bd.1.gif


http://img801.mytextgraphics.com/flamewordmaker/2008/03/28/2554b85201dbda32d87d5873d964a4fd.gif

 

 

Link to comment
Share on other sites

  • 1 month later...
Ma ragazzi,state dormendo?????????? Come risolvo il mio problema scritto nel post precedente?????

I miei tutorial
BS in tempo reale ad eventi
Tecnica Ruba
Pesca ad eventi
Evocare
Lancio del masso
Minigioco del Negozio

Partecipante al Rpg2s.net Game Contest 2008/2009
http://www.rpg2s.net/contest/GameContest0809/gc0809-bannerino.jpg
Gioco in Sviluppo: Factions

http://img252.imageshack.us/img252/8742/bannerinoteamlrmiu6.png
 

http://img393.imageshack.us/img393/9920/legenrpgmaniamu3.gif
Forum:The legend of making

 

 

26373462 I love you!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Mai Dire Speciale Cinema
L'Uomo che Usciva Tutti
Botte e Risposte / Rapine a mano a mano
Mobbasta
Mobbasta veramente per�
Mani in Alto
Per un pelo
Giammangiato
Anche no / Il buio / Ahia
Burle
Acqua Corrente / Urgenze

LegendRpgMania

Il 70% dei ragazzi pensa che GTA sia il miglior gioco del mondo. Il restante 30% pensa che Kingdom Hearts sia il gioco pi� bello. Se fai parte di questo 30% copia e incolla questa frase nella tua firma/blog.

MITICO OBSIDIAN LORD!!!
The March of The Swordmaster
Holy Thunderforce
Bard's Song

TALES OF MAGIC
Entra nella scuola di magia e diventa il mago pi� grande del mondo!

Tales of Magic � completamente gratuito e senza alcun obbligo! Il manuale ti fornir� informazioni sulle modalit� di funzionamento del gioco.
LINK DEL GIOCO

Bunnies Area
Bunnies Can't Phone
Bunnies Can't play 360
Bunnies Can't play Rugby
Bunnies Can't win races
Bunnies Can't Cook Eggs
Bunnies Can't cook turkey
Bunnies Can't Date
Bunnies Can't Park
Bunnies Can't play with Fireworks


Mi conoscete???
Se s� cliccate qui

 



Epitaffi:
1)E' diventato carne secca...
2)Giocava a buttarsi gi� dal castello...
3)Stava abbracciando una bomba a mano...
4)Gli piaceva bere nitroglicerina...
5)Ha ingoiato un candelotto di dinamite...
6)Ha effettuato il salto in lungo nel cratere di un vulcano...
7)Quando i suoi compagni di classe giocavano a calcio lui era la palla...



________________________________________________________________________________
A prescindere dal colore della pelle e dalla religione siamo tutti uguali e tutti abbiamo ugal diritto di vivere. Credi la scuola sia una seccatura? Un'imposizione dei genitori? Sai quanto darebbero questi bambini per avere un'istruzione? Invece loro ed i loro genitori vengono sfruttati nelle industrie delle pi� note multinazionali americane ed europee: Nike, Nestl�, Kraft...
Se sei anche tu contro il razzismo e contro lo sfruttamento inserisci questa frase nella tua firma.
________________________________________________________________________________
Now Playing:
PS3 : Soul Calibur 4
PS2 : Kingdom Hearts Re Chain of Memories
DS : Final Fantasy IV / Final Fantasy XII : Revenant Wings / Spore Creatures / Dinosaur King
PSP : Ratchet and Clank : Size Matters / Secret Agent Clank / Naruto Ultimate Ninja Heroes 2 / GuitarWay To Heaven 4 Amplified
PC : Frets on Fire con la chitarra!!! O_O

Rpg Maker Xp

I miei progetti:

Per ora nulla...

http://team.ffonline.it/imgpersonaggio/cloud_it.jpg
http://img230.imageshack.us/img230/608/pencehaynerroxasolettejyt1.th.jpg
http://r3.fodey.com/15d01c4c6f2dd4908b320f697f7fbe7bd.1.gif


http://img801.mytextgraphics.com/flamewordmaker/2008/03/28/2554b85201dbda32d87d5873d964a4fd.gif

 

 

Link to comment
Share on other sites

Dark Sora vedi di darti una calmata. Se nessuno ha risposto è perchè non si è riscontrato l'errore.

Comunque quando si verifica un errore all'ultima riga è perchè manca un "end" da qualche parte. Assicurati di aver copiato bene lo script e controlla che tutte le def e la class abbiano i rispettivi end.

 

@Friday666: prima di postarlo l'hai provato? Se si cerca di aiutare Dark Sora a risolvere il suo problema. Se non l'hai provato evita in futuro di postarli, altrimenti se non sono funzionanti non sono di alcuna utilità.

Mai rimanere in debito con i giudici di un contest...

 

 

http://img141.imageshack.us/img141/7035/renrenbf8.gif

Powered by Piccolo©

Link to comment
Share on other sites

Pultroppo devi aspettare Dark sora, Friday666 non si connette da un pò per problemi al pc..Dovrai aspettare che ritorni..

http://www.freankexpo.net/signature/1129.png

2986.png

BIM_Banner3.png

Premi RpgMaker

 


http://www.rpg2s.net/forum/uploads/monthly_01_2017/msg-293-0-48316500-1483794996.jpghttp://www.rpg2s.net/dax_games/r2s_regali2.pngContesthttp://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gif http://rpg2s.net/gif/SCContest1Oct.gif http://rpg2s.net/gif/SCContest2Oct.gif http://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest1Oct.gifhttp://www.rpg2s.net/awards/bestpixel2.jpghttp://www.rpg2s.net/awards/bestresourCSist2.jpghttp://www.rpg2s.net/awards/mostproductive1.jpghttp://i42.servimg.com/u/f42/13/12/87/37/iconap13.pnghttp://i42.servimg.com/u/f42/13/12/87/37/iconap14.pnghttp://i42.servimg.com/u/f42/13/12/87/37/iconap15.pnghttp://i42.servimg.com/u/f42/13/12/87/37/iconap16.pnghttp://i42.servimg.com/u/f42/13/12/87/37/screen10.pnghttp://www.rpgmkr.net/contest/screen-contest-primo.pnghttp://www.makerando.com/forum/uploads/jawards/iconawards3.png

Link to comment
Share on other sites

Ma a voi funziona questo script? Perchè a me prima funzionava e ad un tratto non andava più. Se a voi funziona postatemi una demo,please. Grazie :biggrin:

I miei tutorial
BS in tempo reale ad eventi
Tecnica Ruba
Pesca ad eventi
Evocare
Lancio del masso
Minigioco del Negozio

Partecipante al Rpg2s.net Game Contest 2008/2009
http://www.rpg2s.net/contest/GameContest0809/gc0809-bannerino.jpg
Gioco in Sviluppo: Factions

http://img252.imageshack.us/img252/8742/bannerinoteamlrmiu6.png
 

http://img393.imageshack.us/img393/9920/legenrpgmaniamu3.gif
Forum:The legend of making

 

 

26373462 I love you!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Mai Dire Speciale Cinema
L'Uomo che Usciva Tutti
Botte e Risposte / Rapine a mano a mano
Mobbasta
Mobbasta veramente per�
Mani in Alto
Per un pelo
Giammangiato
Anche no / Il buio / Ahia
Burle
Acqua Corrente / Urgenze

LegendRpgMania

Il 70% dei ragazzi pensa che GTA sia il miglior gioco del mondo. Il restante 30% pensa che Kingdom Hearts sia il gioco pi� bello. Se fai parte di questo 30% copia e incolla questa frase nella tua firma/blog.

MITICO OBSIDIAN LORD!!!
The March of The Swordmaster
Holy Thunderforce
Bard's Song

TALES OF MAGIC
Entra nella scuola di magia e diventa il mago pi� grande del mondo!

Tales of Magic � completamente gratuito e senza alcun obbligo! Il manuale ti fornir� informazioni sulle modalit� di funzionamento del gioco.
LINK DEL GIOCO

Bunnies Area
Bunnies Can't Phone
Bunnies Can't play 360
Bunnies Can't play Rugby
Bunnies Can't win races
Bunnies Can't Cook Eggs
Bunnies Can't cook turkey
Bunnies Can't Date
Bunnies Can't Park
Bunnies Can't play with Fireworks


Mi conoscete???
Se s� cliccate qui

 



Epitaffi:
1)E' diventato carne secca...
2)Giocava a buttarsi gi� dal castello...
3)Stava abbracciando una bomba a mano...
4)Gli piaceva bere nitroglicerina...
5)Ha ingoiato un candelotto di dinamite...
6)Ha effettuato il salto in lungo nel cratere di un vulcano...
7)Quando i suoi compagni di classe giocavano a calcio lui era la palla...



________________________________________________________________________________
A prescindere dal colore della pelle e dalla religione siamo tutti uguali e tutti abbiamo ugal diritto di vivere. Credi la scuola sia una seccatura? Un'imposizione dei genitori? Sai quanto darebbero questi bambini per avere un'istruzione? Invece loro ed i loro genitori vengono sfruttati nelle industrie delle pi� note multinazionali americane ed europee: Nike, Nestl�, Kraft...
Se sei anche tu contro il razzismo e contro lo sfruttamento inserisci questa frase nella tua firma.
________________________________________________________________________________
Now Playing:
PS3 : Soul Calibur 4
PS2 : Kingdom Hearts Re Chain of Memories
DS : Final Fantasy IV / Final Fantasy XII : Revenant Wings / Spore Creatures / Dinosaur King
PSP : Ratchet and Clank : Size Matters / Secret Agent Clank / Naruto Ultimate Ninja Heroes 2 / GuitarWay To Heaven 4 Amplified
PC : Frets on Fire con la chitarra!!! O_O

Rpg Maker Xp

I miei progetti:

Per ora nulla...

http://team.ffonline.it/imgpersonaggio/cloud_it.jpg
http://img230.imageshack.us/img230/608/pencehaynerroxasolettejyt1.th.jpg
http://r3.fodey.com/15d01c4c6f2dd4908b320f697f7fbe7bd.1.gif


http://img801.mytextgraphics.com/flamewordmaker/2008/03/28/2554b85201dbda32d87d5873d964a4fd.gif

 

 

Link to comment
Share on other sites

  • 1 month later...
  • 4 months later...
ciao ragazzi scusate...a me il codice funzionava perfettamente e ha continuato a funzionara...ora non lo uso piu da quando mi sono riparato il pc...perchè non ho voglia hihihihi cmq l end mi sa che devi inserirlo alla fine...

(\__/)

(='.'=)

(")_(")

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

  • 2 months later...

wella... scusate riesumo U.U (vabbè che non è nemmeno tanto vecchio l'ultimo post, quindi si può fare XD)

Mi serviva uno script per il bestiario... e per come lo devo usare io... questo è ottimo :D (suddivisione in tipi di avversari, Boss, midboss, angeli, demoni, arch) però, apparte l'END alla fine, non mi parte, perchè mi trova un problema nello Scene_title, sicuramente è dovuto al fatto che io ho modificato lo scene_title fino alla morte XD

se vi passo il mio scene_title + lo script del bestiario... qualcuno potrebbe rendermeli compatibili?

 

 

Membro # 8-8-8 [Hachi] della:

http://img3.imageshack.us/img3/9636/bannergm.png

Link to comment
Share on other sites

Scusate il doppio post con cos? poco tempo di stacco...
ma ho risistemato la sintassi dello script... che era un vero macello :\ (l'end non andava aggiunto alla fine, ma verso l'inizio)
ad ogni modo... ecco lo script riveduto e corretto U.U
 

 

 

#==============================================================================
# Advanced Monster Database
#--------------------------------------------------------------------------
# Created By SephirothSpawn (11.18.05)
# Last Updated: 11.19.05
#==============================================================================
#==============================================================================
# ** Class Scene Title
#==============================================================================
class Scene_Title
	#--------------------------------------------------------------------------
	# * Alias' New Game Method
	#--------------------------------------------------------------------------
	alias new_game command_new_game
	#--------------------------------------------------------------------------
	# * Adds Beastairy Game Variables
	#--------------------------------------------------------------------------
	def command_new_game
		# Sets Up Smithery List
		$game_beastairy = Game_Beastairy.new
		new_game
	end
end
#==============================================================================
# ** Game_Temp
#==============================================================================
class Game_Temp
	#--------------------------------------------------------------------------
	# * Public Instance Variables
	#--------------------------------------------------------------------------
	attr_accessor :beastairy_return
	#--------------------------------------------------------------------------
	# * Alias Initialization
	#--------------------------------------------------------------------------
	alias beastairy_initialize initialize
	#--------------------------------------------------------------------------
	# * Object Initialization
	#--------------------------------------------------------------------------
	def initialize
		beastairy_initialize
		@beastairy_return = false
	end
end
#==============================================================================
# ** Class Game Beastairy
#==============================================================================
class Game_Beastairy
	#--------------------------------------------------------------------------
	# * Public Instance Variables
	#--------------------------------------------------------------------------
	attr_accessor :monster_groups
	#------------------------------------------------------------------
	# Advanced Monster Database
	#--------------------------------------------------------------------------
	# Created By SephirothSpawn (11.18.05)
	# Last Updated: 11.19.05
	#==============================================================================
end
#==============================================================================
# ** Class Scene Title
#==============================================================================
class Scene_Title
	#--------------------------------------------------------------------------
	# * Alias' New Game Method
	#--------------------------------------------------------------------------
	alias new_game command_new_game
	#--------------------------------------------------------------------------
	# * Adds Beastairy Game Variables
	#--------------------------------------------------------------------------
	def command_new_game
		# Sets Up Smithery List
		$game_beastairy = Game_Beastairy.new
		new_game
	end
end
#==============================================================================
# ** Game_Temp
#==============================================================================
class Game_Temp
	#--------------------------------------------------------------------------
	# * Public Instance Variables
	#--------------------------------------------------------------------------
	attr_accessor :beastairy_return
	#--------------------------------------------------------------------------
	# * Alias Initialization
	#--------------------------------------------------------------------------
	alias beastairy_initialize initialize
	#--------------------------------------------------------------------------
	# * Object Initialization
	#--------------------------------------------------------------------------
	def initialize
		beastairy_initialize
		@beastairy_return = false
	end
end
#==============================================================================
# ** Class Game Beastairy
#==============================================================================
class Game_Beastairy
	#--------------------------------------------------------------------------
	# * Public Instance Variables
	#--------------------------------------------------------------------------
	attr_accessor :monster_groups
	#--------------------------------------------------------------------------
	# * Object Initialization
	#--------------------------------------------------------------------------
	def initialize
		@monster_groups = []
		for i in 1...$data_enemies.size
			$data_enemies[i].beastairy_setup
			unless @monster_groups.include?($data_enemies[i].group)
				@monster_groups.push($data_enemies[i].group)
			end
		end
	end
end
#==============================================================================
# ** Module RPG
#==============================================================================
module RPG
	#=========================================================================
	# ** Class Enemy
	#=========================================================================
	class Enemy
		#--------------------------------------------------------------------------
		# * Public Instance Variables
		#--------------------------------------------------------------------------
		# Detectors
		attr_accessor :seen, :defeated, :group
		# Counters
		attr_accessor :seen_times, :defeated_times
		#--------------------------------------------------------------------------
		# * Setup Beastairy
		#--------------------------------------------------------------------------
		def beastairy_setup
			@seen_times, @defeated_times = 0, 0
			@seen, @defeated = false, false
			if @name.include?('(')
				a, b = @name.index('('), @name.index(')')
				@group = @name.slice!(a..b)
				@group.delete!('(')
				@group.delete!(')')
			else
				@group = "Unclassified"
			end
		end
		#--------------------------------------------------------------------------
		# * See Enemy
		#--------------------------------------------------------------------------
		def see
			@seen = true
			@seen_times += 1
		end
		#--------------------------------------------------------------------------
		# * Defeat Enemy
		#--------------------------------------------------------------------------
		def defeat
			@defeated = true
			@defeated_times += 1
		end
	end
end
#==============================================================================
# ** Scene_Save
#==============================================================================
class Scene_Save < Scene_File
	#--------------------------------------------------------------------------
	# * Alias Save Data
	#--------------------------------------------------------------------------
	alias new_save write_save_data
	#--------------------------------------------------------------------------
	# * Write Save Data
	#--------------------------------------------------------------------------
	def write_save_data(file)
		new_save(file)
		Marshal.dump($game_beastairy, file)
	end
end
#==============================================================================
# ** Scene_Load
#==============================================================================
class Scene_Load < Scene_File
	#--------------------------------------------------------------------------
	# * Alias Read Save Data
	#--------------------------------------------------------------------------
	alias new_load read_save_data
	#--------------------------------------------------------------------------
	# * Read Save Data
	#--------------------------------------------------------------------------
	def read_save_data(file)
		new_load(file)
		$game_beastairy = Marshal.load(file)
	end
end
#==============================================================================
# ** Class Window Base
#==============================================================================
class Window_Base < Window
	#--------------------------------------------------------------------------
	# * Draw Enemy Sprite
	#--------------------------------------------------------------------------
	def draw_enemy_sprite(x, y, enemy_name, enemy_hue, pose, frame)
		bitmap = RPG::Cache.character(enemy_name, enemy_hue)
		cw = bitmap.width / 4
		ch = bitmap.height / 4
		# Facing Direction
		case pose
		when 0 ;a = 0 # Down
		when 1 ;a = ch # Left
		when 2 ;a = ch * 3 # Up
		when 3 ;a = ch * 2 # Right
		end
		# Current Animation Slide
		case frame
		when 0 ;b = 0
		when 1 ;b = cw
		when 2 ;b = cw * 2
		when 3 ;b = cw * 3
		end
		# Bitmap Rectange
		src_rect = Rect.new(b, a, cw, ch)
		# Draws Bitmap
		self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
	end
end
#==============================================================================
# Window Monster Group Info
#==============================================================================
class Window_Monster_Group_Info < Window_Base
	#--------------------------------------------------------------------------
	# * Object Initialization
	#--------------------------------------------------------------------------
	def initialize
		super(200, 0, 440, 480)
		self.contents = Bitmap.new(width - 32, height - 32)
		refresh(0, 0, 0)
	end
	#--------------------------------------------------------------------------
	# * Refresh
	# index : Index of Group From Game_Beastairy.Groups
	# pose : Enemy Character Pose
	# frame : Frame of Pose
	#--------------------------------------------------------------------------
	def refresh(index, pose, frame)
		# Clears Window
		contents.clear
		# Sets Up Group Name
		group_name = $game_beastairy.monster_groups[index]
		# Sets Up Enemies In Group
		enemies = []
		for i in 1...$data_enemies.size
			if $data_enemies[i].group == group_name
				enemies.push($data_enemies[i])
			end
		end
		group_name = "Exit" if index == $game_beastairy.monster_groups.size
		# Draws Enemy Group Name
		contents.font.color = system_color
		contents.draw_text(0, 0, self.width - 32, 32, group_name, 1)
		unless index == $game_beastairy.monster_groups.size
			# Offsets Graphics X Position
			graphics_offset = contents.width / (enemies.size + 1)
			# Draws Enemies Graphics
			for i in 0...enemies.size
				draw_enemy_sprite(graphics_offset * (i + 1), 124, enemies[i].battler_name , enemies[i].battler_hue , pose, frame)
			end
			# HP, SP, and Gold Word
			hp_word = $data_system.words.hp
			sp_word = $data_system.words.sp
			gold_word = $data_system.words.gold
			# Draws Table Headings
			contents.draw_text(4, 128, width, 24, "Name")
			contents.draw_text(0, 128, 200, 24, "Max #{hp_word}", 2)
			contents.draw_text(0, 128, 300, 24, "Max #{sp_word}", 2)
			contents.draw_text(-4, 128, contents.width, 24, "#{gold_word} Award", 2)
			# Draws Enemies Stats
			contents.font.color = normal_color
			for i in 0...enemies.size
				# Sets Enemy Stats
				name, hp, sp, gold = "??????????", "???", "???", "?????"
				name, hp, sp = enemies[i].name, enemies[i].maxhp, enemies[i].maxsp if enemies[i].seen
				gold = enemies[i].gold if enemies[i].defeated
				# Draws Stats
				contents.draw_text(4, 152 + (i * 24), width, 24, name)
				contents.draw_text(0, 152 + (i * 24), 200, 24, "#{hp}", 2)
				contents.draw_text(0, 152 + (i * 24), 300, 24, "#{sp}", 2)
				contents.draw_text(-4, 152 + (i * 24), contents.width, 24, "#{gold}", 2)
			end
		end
	end
end
#==============================================================================
# Window Monster Info
#==============================================================================
class Window_Monster_Info < Window_Base
	#--------------------------------------------------------------------------
	# * Object Initialization
	#--------------------------------------------------------------------------
	def initialize
		super(200, 0, 440, 480)
		self.contents = Bitmap.new(width - 32, height - 32)
	end
	#--------------------------------------------------------------------------
	# * Refresh
	# index : Index of enemy From $data_enemies
	# pose : Enemy Character Pose
	# frame : Frame of Pose
	#--------------------------------------------------------------------------
	def refresh(index, pose, frame)
		# Clears Window
		contents.clear
		# Enemy
		enemy = $data_enemies[index]
		# Graphic Image
		draw_enemy_sprite(52, 100, enemy.battler_name , enemy.battler_hue, pose, frame)
		# Default Stats Set
		name = "??????????"
		maxhp = maxsp = str = dex = agi = int = atk = pdef = mdef = eva = "???"
		exp = gold = item_id = weapon_id = armor_id = treasure_prob = "?????"
		item_icon = weapon_icon = armor_icon = "049-Skill06"
		armor_type = 2
		# If the Enemy has been seen
		if enemy.seen
			name = enemy.name
			maxhp = enemy.maxhp.to_s
			maxsp = enemy.maxsp.to_s
			str = enemy.str.to_s
			dex = enemy.dex.to_s
			agi = enemy.agi.to_s
			int = enemy.int.to_s
			atk = enemy.atk.to_s
			pdef = enemy.pdef.to_s
			mdef = enemy.mdef.to_s
			eva = enemy.eva.to_s
		end
		# If the Enemy has been Defeated
		if enemy.defeated
			exp = enemy.exp.to_s
			gold = enemy.gold.to_s
			if enemy.item_id == 0
				item_id = "Nothing"
				item_icon = "032-Item01"
			else
				item_id = $data_items[enemy.item_id].name
				item_icon = $data_items[enemy.item_id].icon_name
			end
			if enemy.weapon_id == 0
				weapon_id = "Nothing"
				weapon_icon = "032-Item01"
			else
				weapon_id = $data_weapons[enemy.weapon_id].name
				weapon_icon = $data_weapons[enemy.weapon_id].icon_name
			end
			if enemy.armor_id == 0
				armor_id = "Nothing"
				armor_icon = "032-Item01"
			else
				armor_id = $data_armors[enemy.armor_id].name
				armor_icon = $data_armors[enemy.armor_id].icon_name
				armor_type = $data_armors[enemy.armor_id].type
			end
			treasure_prob = enemy.treasure_prob.to_s
		end
		# System Words
		g_word = $data_system.words.gold
		hp_word = $data_system.words.hp
		sp_word = $data_system.words.sp
		str_word = $data_system.words.str
		dex_word = $data_system.words.dex
		agi_word = $data_system.words.agi
		int_word = $data_system.words.int
		atk_word = $data_system.words.atk
		pdef_word = $data_system.words.pdef
		mdef_word = $data_system.words.mdef
		weapon_word = $data_system.words.weapon
		case armor_type
		when 0 ;armor_type = $data_system.words.armor1
		when 1 ;armor_type = $data_system.words.armor2
		when 2 ;armor_type = $data_system.words.armor3
		when 3 ;armor_type = $data_system.words.armor4
		end
		item_word = $data_system.words.item
		# Draws Name
		contents.font.color = normal_color
		contents.draw_text(116, 0, contents.width - 116, 32, name)
		# Draws Times Seen & Defeated
		contents.font.color = system_color
		contents.draw_text(116, 32, contents.width - 116, 32, "Times Seen:")
		contents.draw_text(116, 64, contents.width - 116, 32, "Times Defeated:")
		contents.font.color = normal_color
		contents.draw_text(0, 32, contents.width, 32, "#{enemy.seen_times}", 2)
		contents.draw_text(0, 64, contents.width, 32, "#{enemy.defeated_times}", 2)
		# Organizes Stats
		colomn_a_left = ["Max #{hp_word}", "Max #{sp_word}", str_word, dex_word,
		agi_word, int_word, atk_word, pdef_word, mdef_word, "Evasion"]
		colomn_a_right = [maxhp, maxsp, str,dex , agi, int, atk, pdef, mdef, eva]
		# Organized Victory Settings
		column_b_left = ["Experience Given:", "#{g_word} Dropped:", "#{item_word} Dropped:", "",
		"#{weapon_word} Dropped:", "", "#{armor_type} Dropped:", "", "Drop Pobabilty:"]
		column_b_right = [exp, gold, "", item_id, "", weapon_id, "", armor_id, treasure_prob]
		# Draws Stats
		for i in 0...colomn_a_left.size
			contents.font.color = system_color
			contents.draw_text(4, 160 + i * 32, 160, 32, colomn_a_left[i])
			contents.font.color = normal_color
			contents.draw_text(-4, 160 + i * 32, 160, 32, colomn_a_right[i], 2)
		end
		# Draws Victory Settings
		for i in 0...column_b_left.size
			contents.font.color = system_color
			contents.draw_text(168, 160 + i * 32, contents.width, 32, column_b_left[i])
			x = -4
			x = -30 if i == 3 or i == 5 or i == 7
			contents.font.color = normal_color
			contents.draw_text(x, 160 + i * 32, contents.width, 32, column_b_right[i], 2)
		end
		# Draws Item Icons
		bitmap = RPG::Cache.icon(item_icon)
		self.contents.blt(contents.width - 24, 260, bitmap, Rect.new(0, 0, 24, 24))
		bitmap = RPG::Cache.icon(weapon_icon)
		self.contents.blt(contents.width - 24, 324, bitmap, Rect.new(0, 0, 24, 24))
		bitmap = RPG::Cache.icon(armor_icon)
		self.contents.blt(contents.width - 24, 388, bitmap, Rect.new(0, 0, 24, 24))
	end
end
#==============================================================================
# Window Beastairy Controls
#==============================================================================
class Window_Beastairy_Controls < Window_Base
	#--------------------------------------------------------------------------
	# * Object Initialization
	#--------------------------------------------------------------------------
	def initialize
		super(0, 288, 200, 192)
		self.contents = Bitmap.new(width - 32, height - 32)
		self.z = 999
		refresh(0)
	end
	#--------------------------------------------------------------------------
	# * Refresh
	#--------------------------------------------------------------------------
	def refresh(phase)
		# Clears Window
		contents.clear
		disabled_system_color = Color.new(192, 224, 255, 128)
		contents.font.color = normal_color
		contents.draw_text(0, 0, contents.width, 24, "L / R : Change Pose")
		# Main Phase Controls
		contents.font.color = phase == 0 ? system_color : disabled_system_color
		contents.draw_text(4, 24, contents.width, 24, "Main")
		contents.font.color = phase == 0 ? normal_color : disabled_color
		contents.draw_text(8, 48, contents.width, 24, "B : Return to Map")
		contents.draw_text(8, 72, contents.width, 24, "C : Select Group")
		# Enemy Select Controls
		contents.font.color = phase == 1 ? system_color : disabled_system_color
		contents.draw_text(4, 96, contents.width, 24, "Enemy Select")
		contents.font.color = phase == 1 ? normal_color : disabled_color
		contents.draw_text(8, 120, contents.width, 24, "B : Return to Main")
		contents.draw_text(8, 140, contents.width, 24, "C : Test Battle")
	end
end
#==============================================================================
# ** Class Scene Beastairy
#==============================================================================
class Scene_Bestiario
	#--------------------------------------------------------------------------
	# * Main Processing
	#--------------------------------------------------------------------------
	def main
		# Sets Main Phase
		@phase = 0
		# Enemies Graphic Animation
		@pose, @frame, @counting_frame= 0, 0, 0
		# Current Phase Window
		@phase_window = Window_Base.new(0, 0, width = 200, height = 64)
		@phase_window.contents = contents = Bitmap.new(width - 32, height - 32)
		@phase_window.contents.draw_text(0, 0, 168, 32, "Main Phase", 1)
		# Main Window (Enemy Groups)
		commands = $game_beastairy.monster_groups.dup
		commands.push("Exit")
		@enemy_groups = Window_Command.new(200, commands)
		@enemy_groups.y = 64
		@enemy_groups.height = 224
		# Controls Window
		@controls = Window_Beastairy_Controls.new
		# Monster Group Information Window
		@monster_window = Window_Monster_Group_Info.new
		@monster_window.refresh(0, 0, 0)
		# Enemy Information Window
		@enemy_window = Window_Monster_Info.new
		@enemy_window.visible = false
		# Scene Objects
		@objects = [@phase_window, @enemy_groups, @controls, @monster_window, @enemy_window]
		# Execute transition
		Graphics.transition
		# Main loop
		loop do
			# Update game screen
			Graphics.update
			# Update input information
			Input.update
			# Update Objects Information
			@objects.each {|x| x.update}
			# Frame update
			update
			# Abort loop if screen is changed
			break if $scene != self
		end
		# Prepare for transition
		Graphics.freeze
		# Dispose of Objects
		@objects.each {|x| x.dispose unless x.disposed?}
	end
	#--------------------------------------------------------------------------
	# * Frame Update
	#--------------------------------------------------------------------------
	def update
		# Visiblity Changes Between Methods
		case @phase
			# Main Phase
		when 0
			[@enemy_window].each {|x| x.visible = false if x.visible}
			[@enemy_groups, @monster_window].each {|x| x.visible = true unless x.visible}
			@enemy_groups.active = true
		when 1
			[@enemy_window].each {|x| x.visible = true unless x.visible}
			[@enemy_groups, @monster_window].each {|x| x.visible = false if x.visible}
			@enemy_groups.active = false
		end
		# Updates Enemy Animation
		@counting_frame += 1
		if @counting_frame == 8
			@counting_frame = 0
			@frame += 1
			@frame = 0 if @frame == 4
			if @phase == 0
				@monster_window.refresh(@enemy_groups.index, @pose, @frame)
			else
				enemy_id = @enemies[@groups_enemies.index].id
				@enemy_window.refresh(enemy_id, @pose, @frame)
			end
		end
		# Current Phase Update
		case @phase
		when 0; main_update
		when 1; enemy_select
		end
	end
	#--------------------------------------------------------------------------
	# * Main Frame Update
	#--------------------------------------------------------------------------
	def main_update
		# Exit Scene
		if Input.trigger?(Input::B)
			$game_system.se_play($data_system.cancel_se)
			$game_temp.beastairy_return = false
			$scene = Scene_Map.new
			# Enemy Select
		elsif Input.trigger?(Input::C)
			$game_system.se_play($data_system.decision_se)
			if @enemy_groups.index == $game_beastairy.monster_groups.size
				$game_temp.beastairy_return = false
				$scene = Scene_Map.new
			else
				commands, @enemies = [], []
				group = $game_beastairy.monster_groups[@enemy_groups.index]
				for i in 1...$data_enemies.size
					if $data_enemies[i].group == group
						commands.push($data_enemies[i].seen ? $data_enemies[i].name : "??????????")
						@enemies.push($data_enemies[i])
					end
				end
				@groups_enemies = Window_Command.new(200, commands)
				@groups_enemies.y = 64
				@groups_enemies.height = 224
				# Phase Window Update
				@phase_window.contents.clear
				@phase_window.contents.draw_text(0, 0, 168, 32, "Enemy Select", 1)
				# Adds Object (For Updating)
				@objects.push(@groups_enemies)
				# Updates Controls Window
				@controls.refresh(1)
				enemy_id = @enemies[@groups_enemies.index].id
				@enemy_window.refresh(enemy_id, @pose, @frame)
				# Changes Phase
				@phase = 1
			end
			# Changes Pose
		elsif Input.trigger?(Input::LEFT)
			$game_system.se_play($data_system.cursor_se)
			@pose == 0 ? @pose = 3 : @pose -= 1
		elsif Input.trigger?(Input::RIGHT)
			$game_system.se_play($data_system.cursor_se)
			@pose == 3 ? @pose = 0 : @pose += 1
		end
	end
	#--------------------------------------------------------------------------
	# * Enemy Frame Update
	#--------------------------------------------------------------------------
	def enemy_select
		# Exit Phase
		if Input.trigger?(Input::B)
			$game_system.se_play($data_system.cancel_se)
			@groups_enemies.dispose
			@objects.delete(@groups_enemies)
			# Phase Window Update
			@phase_window.contents.clear
			@phase_window.contents.draw_text(0, 0, 168, 32, "Main Phase", 1)
			# Updates Controls Window
			@controls.refresh(0)
			# Changes Phase
			@phase = 0
			# Enemy Select
		elsif Input.trigger?(Input::C)
			enemy = @enemies[@groups_enemies.index]
			if enemy.seen
				$game_system.se_play($data_system.decision_se)
				enemy_name = enemy.name
				for i in 1...$data_troops.size
					if $data_troops[i].name == enemy_name
						$game_temp.beastairy_return = true
						$game_temp.battle_troop_id = i
						$game_temp.battle_can_escape = true
						$game_temp.battle_can_lose = false
						$game_temp.battle_proc = nil
						# Memorize map BGM and stop BGM
						$game_temp.map_bgm = $game_system.playing_bgm
						$game_system.bgm_stop
						# Play battle start SE
						$game_system.se_play($data_system.battle_start_se)
						# Play battle BGM
						$game_system.bgm_play($game_system.battle_bgm)
						# Straighten player position
						$game_player.straighten
						# Switch to battle screen
						$scene = Scene_Battle.new
					end
				end
			else
				$game_system.se_play($data_system.buzzer_se)
			end
		elsif Input.trigger?(Input::LEFT)
			$game_system.se_play($data_system.cursor_se)
			@pose == 0 ? @pose = 3 : @pose -= 1
		elsif Input.trigger?(Input::RIGHT)
			$game_system.se_play($data_system.cursor_se)
			@pose == 3 ? @pose = 0 : @pose += 1
		end
	end
end
#==============================================================================
# ** Scene_Battle
#==============================================================================
class Scene_Battle
	#--------------------------------------------------------------------------
	# * Alias Main Processing
	#--------------------------------------------------------------------------
	alias beastairy_main main
	#--------------------------------------------------------------------------
	# * Main Processing
	#--------------------------------------------------------------------------
	def main
		unless $game_temp.beastairy_return
			@beastairy_troop = []
			troop = $data_troops[$game_temp.battle_troop_id]
			for i in 0...troop.members.size
				enemy = $data_enemies[troop.members[i].enemy_id]
				@beastairy_troop.push(enemy)
				enemy.see
			end
		else
			@beastairy_troop = []
		end
		beastairy_main
	end
	#--------------------------------------------------------------------------
	# * Battle Ends
	# result : results (0:win 1:lose 2:escape)
	#--------------------------------------------------------------------------
	def battle_end(result)
		# Clear in battle flag
		$game_temp.in_battle = false
		# Clear entire party actions flag
		$game_party.clear_actions
		# Remove battle states
		for actor in $game_party.actors
			actor.remove_states_battle
		end
		# Clear enemies
		$game_troop.enemies.clear
		# Call battle callback
		if $game_temp.battle_proc != nil
			$game_temp.battle_proc.call(result)
			$game_temp.battle_proc = nil
		end
		if $game_temp.beastairy_return
			$scene = Scene_Beastairy.new
		else
			if result == 0
				for enemy in @beastairy_troop
					enemy.defeat
				end
			end
			$scene = Scene_Map.new
		end
	end
	#--------------------------------------------------------------------------
	# * Frame Update
	#--------------------------------------------------------------------------
	def update
		# If battle event is running
		if $game_system.battle_interpreter.running?
			# Update interpreter
			$game_system.battle_interpreter.update
			# If a battler which is forcing actions doesn't exist
			if $game_temp.forcing_battler == nil
				# If battle event has finished running
				unless $game_system.battle_interpreter.running?
					# Rerun battle event set up if battle continues
					unless judge
						setup_battle_event
					end
				end
				# If not after battle phase
				if @phase != 5
					# Refresh status window
					@status_window.refresh
				end
			end
		end
		# Update system (timer) and screen
		$game_system.update
		$game_screen.update
		# If timer has reached 0
		if $game_system.timer_working and $game_system.timer == 0
			# Abort battle
			$game_temp.battle_abort = true
		end
		# Update windows
		@help_window.update
		@party_command_window.update
		@actor_command_window.update
		@status_window.update
		@message_window.update
		# Update sprite set
		@spriteset.update
		# If transition is processing
		if $game_temp.transition_processing
			# Clear transition processing flag
			$game_temp.transition_processing = false
			# Execute transition
			if $game_temp.transition_name == ""
				Graphics.transition(20)
			else
				Graphics.transition(40, "Graphics/Transitions/" +
				$game_temp.transition_name)
			end
		end
		# If message window is showing
		if $game_temp.message_window_showing
			return
		end
		# If effect is showing
		if @spriteset.effect?
			return
		end
		# If game over
		if $game_temp.gameover
			# Switch to game over screen
			if $game_temp.beastairy_return
				$scene = Scene_Beastairy.new
			else
				$scene = Scene_Gameover.new
			end
		end
		# If returning to title screen
		if $game_temp.to_title
			# Switch to title screen
			$scene = Scene_Title.new
			return
		end
		# If battle is aborted
		if $game_temp.battle_abort
			# Return to BGM used before battle started
			$game_system.bgm_play($game_temp.map_bgm)
			# Battle ends
			battle_end(1)
			return
		end
		# If waiting
		if @wait_count > 0
			# Decrease wait count
			@wait_count -= 1
			return
		end
		# If battler forcing an action doesn't exist,
		# and battle event is running
		if $game_temp.forcing_battler == nil and
			$game_system.battle_interpreter.running?
			return
		end
		# Branch according to phase
		case @phase
		when 1 # pre-battle phase
			update_phase1
		when 2 # party command phase
			update_phase2
		when 3 # actor command phase
			update_phase3
		when 4 # main phase
			update_phase4
		when 5 # after battle phase
			update_phase5
		end
	end
	#--------------------------------------------------------------------------
	# * Start After Battle Phase
	#--------------------------------------------------------------------------
	def start_phase5
		# Shift to phase 5
		@phase = 5
		# Play battle end ME
		$game_system.me_play($game_system.battle_end_me)
		# Return to BGM before battle started
		$game_system.bgm_play($game_temp.map_bgm)
		# Initialize EXP, amount of gold, and treasure
		exp = 0
		gold = 0
		treasures = []
		# Loop
		for enemy in $game_troop.enemies
			# If enemy is not hidden
			unless enemy.hidden
				unless $game_temp.beastairy_return
					# Add EXP and amount of gold obtained
					exp += enemy.exp
					gold += enemy.gold
					# Determine if treasure appears
					if rand(100) < enemy.treasure_prob
						if enemy.item_id > 0
							treasures.push($data_items[enemy.item_id])
						end
						if enemy.weapon_id > 0
							treasures.push($data_weapons[enemy.weapon_id])
						end
						if enemy.armor_id > 0
							treasures.push($data_armors[enemy.armor_id])
						end
					end
				end
			end
		end
		# Treasure is limited to a maximum of 6 items
		treasures = treasures[0..5]
		# Obtaining EXP
		for i in 0...$game_party.actors.size
			actor = $game_party.actors[i]
			if actor.cant_get_exp? == false
				last_level = actor.level
				actor.exp += exp
				if actor.level > last_level
					@status_window.level_up(i)
				end
			end
		end
		# Obtaining gold
		$game_party.gain_gold(gold)
		# Obtaining treasure
		for item in treasures
			case item
			when RPG::Item
				$game_party.gain_item(item.id, 1)
			when RPG::Weapon
				$game_party.gain_weapon(item.id, 1)
			when RPG::Armor
				$game_party.gain_armor(item.id, 1)
			end
		end
		# Make battle result window
		@result_window = Window_BattleResult.new(exp, gold, treasures)
		# Set wait count
		@phase5_wait_count = 100
	end
end

 



A me cmq continua a dare errore...
 

Script 'BESTIARIO' line 121: SystemStackError occurred.

stack level too deep



Se qualcuno sa come risolvere questo tipo di problema cerchi di dare una mano XD (ho visto che non sono il solo ad andare appresso a sto script U.U)
(Io ho aiutato per quel che ho potuto...)

 

 

Membro # 8-8-8 [Hachi] della:

http://img3.imageshack.us/img3/9636/bannergm.png

Link to comment
Share on other sites

Lo script adesso parte e sembra funzionare, incluso l'aggiornamento delle statistiche dopo una battaglia.

Allego la versione corretta in un file di testo zippato . . .

 

 

Edited by giver

 


SCRIPT RGSS (RPG Maker XP) VINTAGE LIBRARY [2018+]


Breaking (in ogni senso) News: "Treno deraglia per via del seno di Sakurai Aoi . . ." - Info nello spoiler !!

 


http://afantasymachine.altervista.org/_altervista_ht/NOOOOOOOOOilMIOtreninooooo_500.gif


Non riesco a smettere di essere affascinato da immagini come questa . . .

http://anime.vl-vostok.ru/art/photos2011/17/78049800/wall_VladAnime_WWA_1885-1680x1050.jpg


Alcuni wallpapers che faccio ruotare sul mio vecchio PC . . .


http://afantasymachine.altervista.org/_altervista_ht/gits_window.jpg

http://afantasymachine.altervista.org/_altervista_ht/madoka_group01.jpg
http://afantasymachine.altervista.org/_altervista_ht/arisu_picipici_01.jpg
http://afantasymachine.altervista.org/_altervista_ht/phantom_wp01_einzwei.jpg


La parte più spassosa della mia vita è quando gli altri cercano di spiegarmi i miei pensieri . . .


BBCode Testing


Typeface & Size



Link to comment
Share on other sites

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...