Jump to content
Rpg²S Forum

*Effetto terremoto


.::nikokun::.
 Share

Recommended Posts

ciao a tutti!!!
giravo x la rete ed ho trovato questo script x l'efetto terremoto e ho visto ke nei topic non c'era niente su questo genere kosì lo posto

Autore : intersimone999

Istruzioni : inserire lo script sopra main e sotto tutti gli altri altrimenti c'è il rischio ke non funzioni

suggerimenti : Il terremoto non è bello con velocità come 1 o 2 perkè risulta molto piccolo di intensità. Consiglio solo le velocità superiori a 5 (esce veramente bene)

lo script lo allegato al topic

spero ke possa essere utile a quakuno della community ;D

 

EDIT By ProGM:

Rimosso allegato, ecco lo script!

 

 


class Game_Screen
	attr_reader  :shake_v
	def initialize
		@shake_v = 0
	end
	
	def update
		if @tone_duration >= 1
			d = @tone_duration
			@tone.red = (@tone.red * (d - 1) + @tone_target.red) / d
			@tone.green = (@tone.green * (d - 1) + @tone_target.green) / d
			@tone.blue = (@tone.blue * (d - 1) + @tone_target.blue) / d
			@tone.gray = (@tone.gray * (d - 1) + @tone_target.gray) / d
			@tone_duration -= 1
		end
		if @flash_duration >= 1
			d = @flash_duration
			@flash_color.alpha = @flash_color.alpha * (d - 1) / d
			@flash_duration -= 1
		end
		if @shake_duration >= 1 or @shake != 0
			delta = @poss_x[[rand(@poss_x.size),0].max]
			delta2 = @poss_y[[rand(@poss_y.size),0].max]
			if @shake_duration <= 1 #and @shake * (@shake + delta) < 0
				@shake = 0
				@shake_v = 0
			else
				@timing_speed += @shake_speed
				if @timing_speed >= 10
					@timing_speed = 0
					@shake = delta
					@shake_v = delta2
				end
			end
			if @shake > @shake_power * 2
				@shake_direction = -1
			end
			if @shake < - @shake_power * 2
				@shake_direction = 1
			end
			if @shake_duration >= 1
				@shake_duration -= 1
			end
		end
		if @weather_duration >= 1
			d = @weather_duration
			@weather_max = (@weather_max * (d - 1) + @weather_max_target) / d
			@weather_duration -= 1
			if @weather_duration == 0
				@weather_type = @weather_type_target
			end
		end
		if $game_temp.in_battle
			for i in 51..100
				@pictures[i].update
			end
		else
			for i in 1..50
				@pictures[i].update
			end
		end
	end
end

class Spriteset_Map
	def update
		# パノラマが現在のものと異なる場合
		if @panorama_name != $game_map.panorama_name or
			@panorama_hue != $game_map.panorama_hue
			@panorama_name = $game_map.panorama_name
			@panorama_hue = $game_map.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
		end
		# フォグが現在のものと異なる場合
		if @fog_name != $game_map.fog_name or @fog_hue != $game_map.fog_hue
			@fog_name = $game_map.fog_name
			@fog_hue = $game_map.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
		end
		# タイルマップを更新
		@tilemap.ox = $game_map.display_x / 4
		@tilemap.oy = $game_map.display_y / 4
		@tilemap.update
		# パノラマプレーンを更新
		@panorama.ox = $game_map.display_x / 8
		@panorama.oy = $game_map.display_y / 8
		# フォグプレーンを更新
		@fog.zoom_x = $game_map.fog_zoom / 100.0
		@fog.zoom_y = $game_map.fog_zoom / 100.0
		@fog.opacity = $game_map.fog_opacity
		@fog.blend_type = $game_map.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
		# キャラクタースプライトを更新
		for sprite in @character_sprites
			sprite.update
		end
		# 天候グラフィックを更新
		@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
		# ピクチャを更新
		for sprite in @picture_sprites
			sprite.update
		end
		# タイマースプライトを更新
		@timer_sprite.update
		# 画面の色調とシェイク位置を設定
		@viewport1.tone = $game_screen.tone
		@viewport1.ox = $game_screen.shake
		@viewport1.oy = $game_screen.shake_v
		# 画面のフラッシュ色を設定
		@viewport3.color = $game_screen.flash_color
		# ビューポートを更新
		@viewport1.update
		@viewport3.update
	end
end
 

 

 

 

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

Create an account or sign in to comment

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

Create an account

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

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...