Jump to content
Rpg²S Forum

*Colorare un mostro morente


Walrus1235
 Share

Recommended Posts

Volete che un mostro diventi colorato quando sta per schiattare? Ora si può fare senza usare change monster:

 

 

 

#????????
#
#???????HP??????????????
#
#2005.4.14 ????
#HP???????????????
#????????????????????

module Momo_Change_Tone
	# ????????????
	ACTOR_CHANGE_TONE = false
	# ???????????
	ENEMY_CHANGE_TONE = true
	# ??????
	TONE_RED = 0
	# ??????
	TONE_GREEN = 0
	# ??????
	TONE_BLUE = 0
end

class Game_Battler
	attr_accessor :tone_change
	alias game_battler_change_color_initialize initialize
	def initialize
		game_battler_change_color_initialize
		# ?????????
		@tone_change = false
	end
end

class Sprite_Battler < RPG::Sprite
	alias sprite_battler_change_color_initialize initialize
	def initialize(viewport, battler = nil)
		sprite_battler_change_color_initialize(viewport, battler)
		@change_tone = Tone.new(0, 0, 0)
	end
	alias sprite_battler_change_color_update update
	def update
		sprite_battler_change_color_update
		tone_update
	end
	def tone_update
		if @battler != nil
			if rest_hp_tone_change?
				if @battler.tone_change
					rest_hp_tone_change_set
					@battler.tone_change = false
				end
				self.tone = @change_tone
			end
		end
	end
	# ??????????
	def rest_hp_tone_change?
		if (Momo_Change_Tone::ACTOR_CHANGE_TONE and @battler.is_a?(Game_Actor)) or
			(Momo_Change_Tone::ENEMY_CHANGE_TONE and @battler.is_a?(Game_Enemy))
			return true
		end
		return false
	end
	# ??HP?????????
	def rest_hp_tone_change_set
		hp_rate = (@battler.hp.to_f / @battler.maxhp) * 100
		rate = 100 - hp_rate
		red = Momo_Change_Tone::TONE_RED * rate / 100
		green = Momo_Change_Tone::TONE_GREEN * rate / 100
		blue = Momo_Change_Tone::TONE_BLUE * rate / 100
		@change_tone.set(red, green, blue)
	end
end

class Spriteset_Battle
	alias spriteset_battle_change_color_initialize initialize
	def initialize
		spriteset_battle_change_color_initialize
		# ????????????
		for sprite in @actor_sprites
			if !sprite.battler.nil?
				sprite.battler.tone_change = true
				sprite.update
			end
		end
	end
end

class Scene_Battle
	alias scene_battle_change_color_update_phase4_step5 update_phase4_step5
	def update_phase4_step5
		scene_battle_change_color_update_phase4_step5
		# ?????????????????????
		for target in @target_battlers
			target.tone_change = true
		end
	end
end
 

 

 



Da qui si può cambiare la tonalità del colore:

# ??????
TONE_RED = 0
# ??????
TONE_GREEN = 0
# ??????
TONE_BLUE = 0
end 

 

 




Aggiungo che per editare l'HP sotto quale il mostro lascia colore è questo:
# ??HP?????????
def rest_hp_tone_change_set
	hp_rate = (@battler.hp.to_f / @battler.maxhp) * 100
	rate = 100 - hp_rate
	red = Momo_Change_Tone::TONE_RED * rate / 100
	green = Momo_Change_Tone::TONE_GREEN * rate / 100
	blue = Momo_Change_Tone::TONE_BLUE * rate / 100
	@change_tone.set(red, green, blue)
end
end

 

One flew east, one flew west, one flew over the cuckoo's nest.
Link to comment
Share on other sites

Non si può cambiare lo sprite di un mostro in battaglia (vero? :sisi: ), però basterebbe fare un change monster e mettere un altro mostro forte uguale ma di un altro colore...

L'avevo detto in alto che è uno script inutile

One flew east, one flew west, one flew over the cuckoo's nest.
Link to comment
Share on other sites

vabè, avere direttamente lo script è più veloce di cambiare il colore al nemico in ogni battaglia.. ;)

"Dopo gli ultimi Final Fantasy, ho capito solamente una cosa: che il gioco è bello quando Nomura poco."

Making is not dead. You are dead.
RELEASE: La Bussola d'Oro | Download | Video di anteprima - La Partenza di Hanna

http://i.imgur.com/cFgc2lW.png

Prova Standrama!

Link to comment
Share on other sites

Beh, quando un mostro muore fa già una sfumatura da opacità 255 a opacità 0: cosa si vuole di più? che lampeggi quando ha hp minore di 20? Quoto Walrus, non serve a nulla xD

http://img396.imageshack.us/img396/5114/bannerqj2.jpg

 

And the Dragon will Rise with the Twilight Star...

...again.

 

Sei nuovo? Leggi qui.

 

http://img505.imageshack.us/img505/210/banneradtnewnt7ew3.jpg

Link to comment
Share on other sites

in FF7 c'è come effetto (e mi pare pure nel 6) :wink:

"Dopo gli ultimi Final Fantasy, ho capito solamente una cosa: che il gioco è bello quando Nomura poco."

Making is not dead. You are dead.
RELEASE: La Bussola d'Oro | Download | Video di anteprima - La Partenza di Hanna

http://i.imgur.com/cFgc2lW.png

Prova Standrama!

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