Jump to content
Rpg²S Forum

Luigi

Utenti
  • Posts

    150
  • Joined

  • Last visited

Posts posted by Luigi

  1. Vabbè, non sono poi tanto bravo, molti script che sono postati su questo forum per me sono fantascienza, poi è il primo script. Comunque se me lo chiedi (e se ne sono in grado) qualche aiuto te lo posso dare, il tuo progetto mi piace
  2. Grazie luigi, gran bello script che hai fatto!Posso usarlo nel mio gioco?naturalmente nei crediti ci sara' anche il tuo nome :biggrin:

     

    certo che lo puoi usare, l'idea dello script è tua, ho deciso di provare a farlo dopo aver letto il topic in cui chiedevi uno script del genere.

  3. sebbene sia fattibilissimo a eventi, vedo finalmente qualcuno che chiama l'oceania OCEANIA e non Australia, odio quelli che confondono le 2 cose ^^;;;

    XD vero, ma è il primo script, mi avventuro in luoghi nuovi

  4. Teleport in World

    Descrizione

    Questo script permette di aprire una finestra da cui sarà possibile scegliere un continente e subito ci si sarà teletrasportati. Siate clementi, è il mio primo script!


    Autore

    Luigi (+ Window_Base by 桜雅 在土 da me modificata)


    Allegati

    http://img88.imageshack.us/img88/2066/catturaid6.png

     

    Demo:
    http://www.megaupload.com/?d=RF1KRZFB Link Scaduto
    http://www.mediafire.com/?9og7cmmvwtd Link Scaduto

    Script:

     

    Ho modificato il codice, adesso attivando la switch 1 sarà possibile andare in "Europa" altrimenti no (e così via per tutti i continenti)

    #==============================================================================
    # ** Scene_Teleport
    #------------------------------------------------------------------------------
    #  by Luigi
    #==============================================================================
    
    class Scene_Teleport
    	#--------------------------------------------------------------------------
    	# * Main Processing
    	#--------------------------------------------------------------------------
    	def main
    		# Impostazioni della grafica della finestra
    		s1 = "Europa"
    		s2 = "America"
    		s3 = "Asia"
    		s4 = "Oceania"
    		s5 = "Antartide"
    		@command_window = Window_Command.new(192, [s1, s2, s3, s4, s5])
    		@command_window.x = 100 - @command_window.width / 2
    		@command_window.y = 380 - @command_window.height / 2
    		
    		if $game_switches[1] == false
    			@command_window.disable_item(0)
    		end
    		if $game_switches[2] == false
    			@command_window.disable_item(1)
    		end
    		if $game_switches[3] == false
    			@command_window.disable_item(2)
    		end
    		if $game_switches[4] == false
    			@command_window.disable_item(3)
    		end
    		if $game_switches[5] == false
    			@command_window.disable_item(4)
    		end
    		
    		Graphics.transition
    		loop do
    			Graphics.update
    			Input.update
    			update
    			if $scene != self
    				break
    			end
    		end
    		Graphics.freeze
    		@command_window.dispose
    		if $scene.is_a?(Scene_Title)
    			Graphics.transition
    			Graphics.freeze
    		end
    	end
    	#--------------------------------------------------------------------------
    	# * Frame Update
    	#--------------------------------------------------------------------------
    	def update
    		@command_window.update
    		# Se è premuto il pulsante B
    		if Input.trigger?(Input::B)
    			# Suona la "cancel SE"
    			$game_system.se_play($data_system.cancel_se)
    			# Torna alla mappa
    			$scene = Scene_Map.new
    			return
    		end
    		# Sei il pulsante C è premuto
    		if Input.trigger?(Input::C)
    			case @command_window.index
    			when 0 
    				command_europa
    			when 1  
    				command_america
    			when 2  
    				command_asia
    			when 3  
    				command_oceania
    			when 4 
    				command_antartide
    			end
    			return
    		end
    	end
    	#--------------------------------------------------------------------------
    	# Europa
    	#--------------------------------------------------------------------------
    	def command_europa
    		if $game_switches[1] == true
    			$game_system.se_play($data_system.decision_se)
    			# Teletrasporto in Europa
    			$scene = Scene_Map.new
    			$game_temp.player_transferring = true #Lasciate sempre true
    			$game_temp.player_new_map_id = 002 #è l'id della mappa
    			$game_temp.player_new_x = 14 #è la coordinata x sulla mappa
    			$game_temp.player_new_y = 7 #è la coordinata y sulla mappa
    			$game_temp.player_new_direction = 02 #è la posizione dell'eroe (su/giù/dx/sx)
    			$game_temp.transition_processing = true
    			$game_temp.transition_name = "020-Flat01"
    		end
    		
    	end
    	#--------------------------------------------------------------------------
    	# America
    	#--------------------------------------------------------------------------
    	def command_america
    		if $game_switches[2] == true
    			$game_system.se_play($data_system.decision_se)
    			$game_temp.transition_name = "020-Flat01"
    			$scene = Scene_Map.new
    			$game_temp.player_transferring = true
    			$game_temp.player_new_map_id = 003
    			$game_temp.player_new_x = 5
    			$game_temp.player_new_y = 6
    			$game_temp.player_new_direction = 02
    			$game_temp.transition_processing = true
    		end
    	end
    	#--------------------------------------------------------------------------
    	# Asia
    	#--------------------------------------------------------------------------
    	def command_asia
    		if $game_switches[1] == true
    			$game_system.se_play($data_system.decision_se)
    			$scene = Scene_Map.new
    			$game_temp.transition_name = "020-Flat01"
    			$game_temp.player_transferring = true
    			$game_temp.player_new_map_id = 004
    			$game_temp.player_new_x = 4
    			$game_temp.player_new_y = 5
    			$game_temp.player_new_direction = 02
    			$game_temp.transition_processing = true
    		end
    	end
    	#--------------------------------------------------------------------------
    	# Oceania
    	#--------------------------------------------------------------------------
    	def command_oceania
    		if $game_switches[1] == true
    			$game_system.se_play($data_system.decision_se)
    			$scene = Scene_Map.new
    			$game_temp.player_transferring = true
    			$game_temp.player_new_map_id = 005
    			$game_temp.player_new_x = 10
    			$game_temp.player_new_y = 6
    			$game_temp.player_new_direction = 02
    			$game_temp.transition_processing = true
    			$game_temp.transition_name = "020-Flat01"
    		end
    	end
    	#--------------------------------------------------------------------------
    	# Antartide
    	#--------------------------------------------------------------------------
    	def command_antartide
    		if $game_switches[1] == true
    			$game_system.se_play($data_system.decision_se)
    			$scene = Scene_Map.new
    			$game_temp.player_transferring = true
    			$game_temp.player_new_map_id = 006
    			$game_temp.player_new_x = 9
    			$game_temp.player_new_y = 5
    			$game_temp.player_new_direction = 02
    			$game_temp.transition_processing = true
    			$game_temp.transition_name = "020-Flat01"
    		end
    	end
    	
    end
    

     

  5. Isometric View version 1.0

    Descrizione:
    Questa demo permette di creare delle mappe con un evolutissimo sistema di visuale isometrica, alternandolo anche a mappe normali, in cui sarà anche possibile creare scalinate che i pg potranno salire e scendere o mappe isometriche su più livelli d'altezza.

    Autore:
    by MGCaladtogel and Siegfried
    Translated (in english) enhancements by GubiD

     


    Screen

    http://i218.photobucket.com/albums/cc200/GubiD/Iso3.jpg
    http://i218.photobucket.com/albums/cc200/GubiD/Iso2.jpg
    http://i218.photobucket.com/albums/cc200/GubiD/Iso1.jpg

     

    Allegati
    Demo

     

    Istruzioni
    Create 2 nuove classi e incollateci questi 2 script. Le istruzioni sono all'interno della demo

     

    Script

     

     

     

    #-------------------------------------------------------------------------------
    # ? Script 2D_ISO, created by MGCaladtogel tranlated by GubiD
    #-------------------------------------------------------------------------------
    #==============================================================================
    # New Variables: 
    #  $game_map indicates the map of data (where you will place events)
    #  $game_map_iso indicates the map into 2d-isometric view, although containing no events.
    #==============================================================================
    
    #==============================================================================
    # ¦ Game_Map
    #==============================================================================
    class Game_Map
    	#--------------------------------------------------------------------------
    	# ? The scrolling must be carried out according to dimensions of chart
    	#	 into isometric
    	#--------------------------------------------------------------------------
    	def scroll_down(distance)
    		if $game_map.iso?
    			corr = (($game_map.height + $game_map.width)%2 == 0 ? 0 : 4*16)
    			@display_y = [@display_y + distance, 128*$game_map_iso.height - 4*480 - corr].min
    		else
    			@display_y = [@display_y + distance, (self.height - 15) * 128].min
    		end
    	end
    	#--------------------------------------------------------------------------
    	def scroll_right(distance)
    		if $game_map.iso?
    			@display_x = [@display_x + distance, 128*$game_map_iso.width - 4 * 640].min
    		else
    			@display_x = [@display_x + distance, (self.width - 20) * 128].min
    		end
    		
    	end
    end
    
    #==============================================================================
    # ¦ Game_Character
    #==============================================================================
    class Game_Character
    	#--------------------------------------------------------------------------
    	# ? Update the position of the characters to the screen according to x,y in isometric 
    	#--------------------------------------------------------------------------
    	def screen_x
    		if $game_map.iso?
    			return  (@real_x - @real_y)/4 + 32*$game_map.height - 0 - $game_map.display_x/4
    		else
    			return (@real_x - $game_map.display_x + 3) / 4 + 16
    		end
    	end
    	#--------------------------------------------------------------------------
    	def screen_y
    		if $game_map.iso?
    			y = (@real_y + @real_x) / 8 + 24 - $game_map.display_y/4
    			if @jump_count >= @jump_peak
    				n = @jump_count - @jump_peak
    			else
    				n = @jump_peak - @jump_count
    			end
    			return y - (@jump_peak * @jump_peak - n * n) / 2
    		else
    			y = (@real_y - $game_map.display_y + 3) / 4 + 32
    			# Make y-coordinate smaller via jump count
    			if @jump_count >= @jump_peak
    				n = @jump_count - @jump_peak
    			else
    				n = @jump_peak - @jump_count
    			end
    			return y - (@jump_peak * @jump_peak - n * n) / 2
    		end
    	end
    	#--------------------------------------------------------------------------
    	def screen_z(height = 0)
    		if $game_map.iso?
    			if @always_on_top
    				return 999
    			end
    			z = 9999#screen_y
    			if @tile_id > 0
    				return z + $game_map_iso.priorities[@tile_id] * (32 + (8*screen_th))
    			end
    		else # use default method
    			if @always_on_top
    				# 999, unconditional
    				return 999
    			end
    			# Get screen coordinates from real coordinates and map display position
    			z = (@real_y - $game_map.display_y + 3) / 4 + 32
    			# If tile
    			if @tile_id > 0
    				# Add tile priority * 32
    				return z + $game_map.priorities[@tile_id] * 32
    				# If character
    			else
    				# If height exceeds 32, then add 31
    				return z + ((height > 32) ? 31 : 0)
    			end
    		end
    	end
    end
    
    #==============================================================================
    # ¦ Game_Player
    #==============================================================================
    class Game_Player < Game_Character
    	#--------------------------------------------------------------------------
    	# ? Sets up use for directions using 1,3,7,9 coordinated to up/down/left/right
    	#	 so that the scrolling occurs cleaner.
    	#--------------------------------------------------------------------------
    	alias gmpl_iso_update update
    	def update
    		if $game_map.iso?
    			last_moving = moving?
    			unless moving? or $game_system.map_interpreter.running? or
    				@move_route_forcing or $game_temp.message_window_showing
    				case Input.dir8
    				when 1..2
    					move_down
    				when 3
    					move_right
    				when 4
    					move_left
    				when 7
    					move_left
    				when 6
    					move_right
    				when 8..9
    					move_up
    				end
    			end
    			last_real_x = @real_x
    			last_real_y = @real_y
    			super
    			disp_y = screen_y + $game_map.display_y/4
    			disp_x = screen_x + $game_map.display_x/4
    			if CENTER_Y - (4*disp_y - $game_map.display_y) < 0
    				$game_map.scroll_down(4*disp_y - $game_map.display_y - CENTER_Y)
    			end
    			if CENTER_X - (4*disp_x - $game_map.display_x) > 0
    				$game_map.scroll_left(CENTER_X - (4*disp_x - $game_map.display_x))
    			end
    			if CENTER_X - (4*disp_x - $game_map.display_x) < 0
    				$game_map.scroll_right(4*disp_x - $game_map.display_x - CENTER_X)
    			end
    			if CENTER_Y - (4*disp_y - $game_map.display_y) > 0
    				$game_map.scroll_up(CENTER_Y - (4*disp_y - $game_map.display_y))
    			end
    			unless moving?
    				if last_moving
    					result = check_event_trigger_here([1,2])
    					if result == false
    						unless $DEBUG and Input.press?(Input::CTRL)
    							if @encounter_count > 0
    								@encounter_count -= 1
    							end
    						end
    					end
    				end
    				if Input.trigger?(Input::C)
    					check_event_trigger_here([0])
    					check_event_trigger_there([0,1,2])
    				end
    			end
    		else
    			gmpl_iso_update
    		end
    	end
    	
    end
    
    #==============================================================================
    # ¦ Scene_Title
    #==============================================================================
    class Scene_Title
    	alias main_orig main
    	#--------------------------------------------------------------------------
    	# ? Loads MapInfos so that Iso map id's can be loaded according to the current map.
    	#--------------------------------------------------------------------------
    	def main
    		$data_map_infos		= load_data("Data/MapInfos.rxdata")
    		main_orig
    	end
    end
    
    #==============================================================================
    # ¦ Spriteset_Map
    #==============================================================================
    class Spriteset_Map
    	#--------------------------------------------------------------------------
    	# ? Generates the map, then lays the iso view map (parent map) over it, but uses
    	#	  $game_map for data
    	#--------------------------------------------------------------------------
    	def initialize
    		@viewport1 = Viewport.new(0, 0, 640, 480)
    		@viewport2 = Viewport.new(0, 0, 640, 480)
    		@viewport3 = Viewport.new(0, 0, 640, 480)
    		@viewport2.z = 200
    		@viewport3.z = 5000
    		@tilemap = Tilemap.new(@viewport1) #creates standard 2d map
    		if $game_map.iso?
    			map_infos = $data_map_infos[$game_map.map_id]
    			$game_map_iso = Game_Map.new #creates new iso map
    			$game_map_iso.setup(map_infos.parent_id) #draws map
    			@tilemap.tileset = RPG::Cache.tileset($game_map_iso.tileset_name) #sets correct tileset
    			for i in 0..6 #draws autotiles
    				autotile_name = $game_map.autotile_names[i]
    				@tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)
    			end
    			@tilemap.map_data = $game_map_iso.data #reads terrain tags and else
    			@tilemap.priorities = $game_map_iso.priorities #sets iso map priorities
    		else
    			@tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)
    			for i in 0..6
    				autotile_name = $game_map.autotile_names[i]
    				@tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)
    			end
    			@tilemap.map_data = $game_map.data
    			@tilemap.priorities = $game_map.priorities
    		end
    		@panorama = Plane.new(@viewport1) #create pan plane
    		@panorama.z = -1000
    		@fog = Plane.new(@viewport1)  #creates fog plane
    		@fog.z = 3000
    		@character_sprites = []#initializes character update thread
    		for i in $game_map.events.keys.sort #add events to map from $game_map, NOT ISO
    			sprite = Sprite_Character.new(@viewport1, $game_map.events[i])
    			@character_sprites.push(sprite)
    		end
    		@character_sprites.push(Sprite_Character.new(@viewport1, $game_player)) #add player to map
    		@weather = RPG::Weather.new(@viewport1) #draw weather
    		@picture_sprites = [] 
    		for i in 1..50 #draw setup pictures
    			@picture_sprites.push(Sprite_Picture.new(@viewport2,
    			$game_screen.pictures[i]))
    		end
    		@timer_sprite = Sprite_Timer.new #start timer
    		update
    	end
    	#--------------------------------------------------------------------------
    	# ? Caution: Updated the panorama to draw in the same fashion and update according to 
    	#				iso view settings
    	#	 Get the original displacement settings and expand them:
    	#	   @panorama.ox = $game_map.display_x / 4
    	#	   @panorama.oy = $game_map.display_y / 4
    	#	 to :
    	#	   @panorama.ox = $game_map.display_y / 8
    	#	   @panorama.oy = $game_map.display_y / 8
    	#--------------------------------------------------------------------------
    	alias upd_iso_map update
    	def update(map_id = $game_map.map_id)
    		#if pan settings changed.. update pan info
    		if $game_map.iso?
    			if @panorama_name != $game_map_iso.panorama_name or
    				@panorama_hue != $game_map_iso.panorama_hue
    				@panorama_name = $game_map_iso.panorama_name
    				@panorama_hue = $game_map_iso.panorama_hue
    				if @panorama.bitmap != nil
    					@panorama.bitmap.dispose
    					@panorama.bitmap = nil
    				end
    				if @panorama_name != ""
    					@panorama.bitmap = RPG::Cache.panorama(@panorama_name, @panorama_hue)
    				end
    				Graphics.frame_reset #reset frame count to 0
    			end
    			#if fog settings changed.. update fog info
    			if @fog_name != $game_map_iso.fog_name or @fog_hue != $game_map_iso.fog_hue
    				@fog_name = $game_map_iso.fog_name
    				@fog_hue = $game_map_iso.fog_hue
    				if @fog.bitmap != nil
    					@fog.bitmap.dispose
    					@fog.bitmap = nil
    				end
    				if @fog_name != ""
    					@fog.bitmap = RPG::Cache.fog(@fog_name, @fog_hue)
    				end
    				Graphics.frame_reset #reset frame count to 0
    			end
    			#update tilemap offset
    			@tilemap.ox = $game_map.display_x / 4
    			@tilemap.oy = $game_map.display_y / 4
    			#redraw tilemap to current offset
    			@tilemap.update
    			#update pan and fog offsets.
    			@panorama.ox = $game_map.display_x / 4
    			@panorama.oy = $game_map.display_y / 4
    			@fog.zoom_x = $game_map_iso.fog_zoom / 100.0
    			@fog.zoom_y = $game_map_iso.fog_zoom / 100.0
    			@fog.opacity = $game_map_iso.fog_opacity
    			@fog.blend_type = $game_map_iso.fog_blend_type
    			@fog.ox = $game_map.display_x / 4 + $game_map.fog_ox
    			@fog.oy = $game_map.display_y / 4 + $game_map.fog_oy
    			@fog.tone = $game_map.fog_tone
    			#update event and character sprites
    			for sprite in @character_sprites
    				sprite.update
    			end
    			#update weather
    			@weather.type = $game_screen.weather_type
    			@weather.max = $game_screen.weather_max
    			@weather.ox = $game_map.display_x / 4
    			@weather.oy = $game_map.display_y / 4
    			@weather.update
    			#update pictures
    			for sprite in @picture_sprites
    				sprite.update
    			end
    			@timer_sprite.update
    			#update screen tone/shake/flash
    			@viewport1.tone = $game_screen.tone
    			@viewport1.ox = $game_screen.shake
    			@viewport3.color = $game_screen.flash_color
    			@viewport1.update
    			@viewport3.update
    		else #use standard update process tilemap update process
    			upd_iso_map
    		end
    	end
    end
    
    #==============================================================================
    # ¦ Interpreter
    #==============================================================================
    class Interpreter
    	#--------------------------------------------------------------------------
    	# ? Change Map Settings
    	#--------------------------------------------------------------------------
    	def command_204
    		case @parameters[0]
    		when 0 #change panorama
    			if $game_map.iso?
    				$game_map_iso.panorama_name = @parameters[1]
    				$game_map_iso.panorama_hue = @parameters[2]
    			else
    				$game_map.panorama_name = @parameters[1]
    				$game_map.panorama_hue = @parameters[2]
    			end
    		when 1 #change fog settings
    			if $game_map.iso?
    				$game_map_iso.fog_name = @parameters[1]
    				$game_map_iso.fog_hue = @parameters[2]
    				$game_map_iso.fog_opacity = @parameters[3]
    				$game_map_iso.fog_blend_type = @parameters[4]
    				$game_map_iso.fog_zoom = @parameters[5]
    				$game_map_iso.fog_sx = @parameters[6]
    				$game_map_iso.fog_sy = @parameters[7]
    			else
    				$game_map.fog_name = @parameters[1]
    				$game_map.fog_hue = @parameters[2]
    				$game_map.fog_opacity = @parameters[3]
    				$game_map.fog_blend_type = @parameters[4]
    				$game_map.fog_zoom = @parameters[5]
    				$game_map.fog_sx = @parameters[6]
    				$game_map.fog_sy = @parameters[7]
    			end
    		when 2 #change battleback
    			if $game_map.iso?
    				$game_map_iso.battleback_name = @parameters[1]
    				$game_temp_iso.battleback_name = @parameters[1]
    			else
    				$game_map.battleback_name = @parameters[1]
    				$game_temp.battleback_name = @parameters[1]
    			end
    		end
    		return true
    	end
    	#--------------------------------------------------------------------------
    	# ? Change fog tone
    	#--------------------------------------------------------------------------
    	def command_205
    		if $game_map.iso?
    			$game_map_iso.start_fog_tone_change(@parameters[0], @parameters[1] * 2)
    		else
    			$game_map.start_fog_tone_change(@parameters[0], @parameters[1] * 2)
    		end
    		return true
    	end
    	#--------------------------------------------------------------------------
    	# ? Change fog opacity
    	#--------------------------------------------------------------------------
    	def command_206
    		if $game_map.iso?
    			$game_map_iso.start_fog_opacity_change(@parameters[0], @parameters[1] * 2)
    		else
    			$game_map.start_fog_opacity_change(@parameters[0], @parameters[1] * 2)
    		end
    		return true
    	end
    end
    

     

     

     

     

     

     

    #==============================================================================
    # o Sprite_Character add-on : Fix Pic
    #------------------------------------------------------------------------------
    # Script curtisy of Siegfried which is made to work with MGCaladtogel's iso script
    #------------------------------------------------------------------------------
    # Updates passability to check height changes
    #------------------------------------------------------------------------------
    # Rules for the map passabilities :
    # -Apply the numbered tileset
    # -Each number is equivalent to a height (tileset infinite, infinite height)
    # -For the nonpassable tiles, put an inaccessible height.
    #==============================================================================
    # o ISO_LVL2_Config
    #============================================================================== 
    module ISO_LVL2_Config
    	# Passable height from one tile to another
    	DIFF_N = 2
    	# Passable height from one tile to another: stairs, height change
    	DIFF_L = 2
    	# Falling speed
    	FALLING_SPEED = 0.5
    end
    
    #==============================================================================
    # o Game_Map
    #==============================================================================
    class Game_Map
    	#--------------------------------------------------------------------------
    	# o Attributes
    	#--------------------------------------------------------------------------
    	attr_accessor   :map
    	#is iso map?
    	def iso?
    		if $data_map_infos[@map_id].name.include?("ISO")
    			return true
    		else
    			return false
    		end
    	end
    end
    
    #==============================================================================
    # o Game_Character
    #==============================================================================
    class Game_Character
    	#--------------------------------------------------------------------------
    	# o Attributes
    	#--------------------------------------------------------------------------
    	attr_accessor   :x
    	attr_accessor   :y
    	attr_accessor   :h
    	attr_accessor   :th
    	
    	#--------------------------------------------------------------------------
    	# o Initialize
    	#--------------------------------------------------------------------------
    	alias sieg_iso_initialize initialize
    	def initialize
    		@h = 0
    		@th = 0
    		sieg_iso_initialize
    	end
    	#--------------------------------------------------------------------------
    	# o Screen_th : height of the ground
    	#--------------------------------------------------------------------------
    	def screen_th
    		tile_id = $game_map.map.data[self.x,self.y,0]
    		t_x = (tile_id - 384) % 8	 
    		t_y = (tile_id - 384) / 8
    		th = t_x + t_y * 8
    		return th
    	end
    	#--------------------------------------------------------------------------
    	# o Screen_h : height of the character
    	#--------------------------------------------------------------------------
    	def screen_h
    		return @h 
    	end
    	
    	#--------------------------------------------------------------------------
    	# Update character/event rise/fall according to position on map.
    	#--------------------------------------------------------------------------
    	alias iso_gm_update update
    	def update
    		if $game_map.iso?
    			if screen_h < screen_th
    				@h = screen_th
    			elsif screen_h > screen_th
    				if (screen_h - screen_th) > 1.5
    					@h -= [iSO_LVL2_Config::FALLING_SPEED * 3, 1].min
    				else
    					@h -= ISO_LVL2_Config::FALLING_SPEED
    				end
    			end 
    		end
    		iso_gm_update
    	end
    	#--------------------------------------------------------------------------
    	# o Screen_x
    	#--------------------------------------------------------------------------
    	alias iso_screen_x screen_x
    	def screen_x
    		return  iso_screen_x if !$game_map.iso?
    		return  (@real_x - @real_y)/4 + 32 * $game_map.height - 0 - $game_map.display_x / 4
    	end
    	#--------------------------------------------------------------------------
    	# o Screen_y
    	#--------------------------------------------------------------------------
    	alias iso_screen_y screen_y
    	def screen_y
    		return iso_screen_y if !$game_map.iso?
    		y = (@real_y + @real_x) / 8 + 24 - $game_map.display_y / 4 - (self.screen_h) * 8
    		if @jump_count >= @jump_peak
    			n = @jump_count - @jump_peak
    		else
    			n = @jump_peak - @jump_count
    		end
    		return y - (@jump_peak * @jump_peak - n * n) / 2
    	end
    	#--------------------------------------------------------------------------
    	# o Screen_z
    	#--------------------------------------------------------------------------
    	alias iso_screen_z screen_z
    	def screen_z(height = 0)
    		return iso_screen_z if !$game_map.iso?
    		if @always_on_top
    			return 999
    		end
    		z = screen_y
    		if @tile_id > 0
    			return z + $game_map_iso.priorities[@tile_id] * 32
    		else
    			return z + ((height > 32) ? 31 : 0)
    		end
    	end
    end
    
    #==============================================================================
    # o Passabilities and interactions with events
    #==============================================================================
    #==============================================================================
    # o Game_Character
    #==============================================================================
    class Game_Character
    	#--------------------------------------------------------------------------
    	# o Passable?
    	#--------------------------------------------------------------------------
    	alias sieg_gc_passable? passable?
    	def passable?(x, y, d)
    		if !$game_map.iso?
    			return sieg_gc_passable?(x, y, d)
    		end
    		@diff_n = ISO_LVL2_Config::DIFF_N
    		@diff_l = ISO_LVL2_Config::DIFF_L
    		
    		new_x = x + (d == 6 ? 1 : d == 4 ? -1 : d == 1 ? -1 : d == 3 ? 1 : d == 7 ? -1 : d == 9 ? 1 : 0)
    		new_y = y + (d == 2 ? 1 : d == 8 ? -1 : d == 1 ? 1 : d == 3 ? 1 : d == 7 ? -1 : d == 9 ? -1 : 0)
    		
    		
    		tile_id = $game_map.map.data[x, y, 0]
    		t_x= (tile_id - 384)%8	 
    		t_y= (tile_id - 384)/8
    		h = t_x + t_y * 8
    		
    		new_tile_id = $game_map.map.data[new_x, new_y,0]
    		new_t_x= (new_tile_id - 384)%8	 
    		new_t_y= (new_tile_id - 384)/8
    		new_h = new_t_x + new_t_y * 8
    		
    		tile_tag = $game_map.terrain_tag(x, y)
    		tile_tag_new = $game_map.terrain_tag(new_x, new_y)
    		
    		if tile_tag == 1
    			@diff = @diff_l
    		else
    			@diff = @diff_n
    		end
    		
    		unless $game_map.valid?(new_x, new_y) and (new_h - h) <= @diff and (new_h - h) >= -@diff
    			return false
    		end
    		
    		if @through
    			return true
    		end
    		
    		unless $game_map.passable?(x, y, d, self) and (new_h - h) <= @diff and (new_h - h) >= -@diff
    			return false
    		end
    		
    		unless $game_map.passable?(new_x, new_y, 10 - d) and (new_h - h) <= @diff and (new_h - h) >= -@diff
    			return false
    		end
    		
    		for event in $game_map.events.values
    			if event.x == new_x and event.y == new_y and (new_h - h) <= @diff and (new_h - h) >= -@diff
    				unless event.through and (new_h - h) <= @diff_n
    					if self != $game_player
    						return false
    					end
    					if event.character_name != ""
    						return false
    					end
    				end
    			end
    		end
    		
    		if $game_player.x == new_x and $game_player.y == new_y and (new_h - h) <= @diff and (new_h - h) >= -@diff
    			unless $game_player.through
    				if @character_name != ""
    					return false
    				end
    			end
    		end
    		
    		return true
    	end
    end
    
    #==============================================================================
    # o Game_Event
    #==============================================================================
    class Game_Event < Game_Character
    	#--------------------------------------------------------------------------
    	# o Start
    	#--------------------------------------------------------------------------
    	alias iso_evnt_start start
    	def start
    		if !$game_map.iso?
    			iso_evnt_start
    			return
    		end
    		@diff_n = 1
    		# Dialogue 
    		tile_id = $game_map.map.data[$game_player.x,$game_player.y,0]
    		t_x = (tile_id - 384) % 8	 
    		t_y = (tile_id - 384) / 8
    		h = t_x + t_y * 8
    		
    		ev_tile_id = $game_map.map.data[self.x,self.y,0]
    		ev_t_x = (ev_tile_id - 384) % 8	 
    		ev_t_y = (ev_tile_id - 384) / 8
    		ev_h = ev_t_x + ev_t_y * 8
    		
    		if @list.size > 1 and (ev_h - h).abs <= @diff_n
    			@starting = true
    		end
    	end
    end
    

     

     

     

×
×
  • Create New...