Jump to content


Photo
- - - - -

modifica script


  • Please log in to reply
7 replies to this topic

#1 nejijuga

nejijuga

    Signore del Nulla

  • Members
  • PipPipPip
  • 216 posts

Posted 11 January 2008 - 01:37 PM

salve a tt
questo script permette di fare in modo che quando i nemici hanno un tot di hp diventano di un colore
io vorrei che oltra e diventare di quel colore lampeggiassero qualcuno puo farlo?

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

module Momo_Change_Tone
# ????????????
ACTOR_CHANGE_TONE = false
# ???????????
ENEMY_CHANGE_TONE = true
# ??????
TONE_RED = 128
# ??????
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


anchio faccio parte dei cercatori!!!
incolla il codice sottostante nella tua firma se aderisci al movimento!
CODICE
[img]http://img178.imageshack.us/img178/5017/tastocercapz2.gif[/img]



--->storia di un abile hacker italiano<---

#2 :^:Riku:^:

:^:Riku:^:

    Ciambellano Demente

  • Members
  • PipPipPipPip
  • 359 posts

Posted 11 January 2008 - 03:30 PM

Non ci capsico niente degli script, ma non




I miei progetti!

ThE nEw ErA - -------- - 0%

#3 Ospite_Dex_*

Ospite_Dex_*
  • Guests

Posted 11 January 2008 - 04:55 PM

Come suggeriresti di farlo ad eventi, riku?
Intendo il procedimento da utilizzare per farlo.

Edited by Dex, 11 January 2008 - 04:55 PM.


#4 Zen

Zen

    Molosso Infernale

  • Members
  • PipPipPipPipPip
  • 613 posts

Posted 11 January 2008 - 05:12 PM

class Window_Base < Window
#--------------------------------------------------------------------------
# * Draw Slant Bar(by SephirothSpawn)
#--------------------------------------------------------------------------
def draw_slant_bar(x, y, min, max, width = 152, height = 6,
bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255))
# Draw Border
for i in 0..height
self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
end
# Draw Background
for i in 1..(height - 1)
r = 100 * (height - i) / height + 0 * i / height
g = 100 * (height - i) / height + 0 * i / height
b = 100 * (height - i) / height + 0 * i / height
a = 255 * (height - i) / height + 255 * i / height
self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
end
# Draws Bar
for i in 1..( (min / max.to_f) * width - 1)
for j in 1..(height - 1)
r = bar_color.red * (width - i) / width + end_color.red * i / width
g = bar_color.green * (width - i) / width + end_color.green * i / width
b = bar_color.blue * (width - i) / width + end_color.blue * i / width
a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
end
end
end
end


class Window_EnemyHP < Window_Base

def initialize
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
refresh
end

def refresh
self.contents.clear
for i in 0...$game_troop.enemies.size
@enemy = $game_troop.enemies[i]
@percent = (@enemy.hp * 100) / @enemy.maxhp
unless @enemy.hp == 0
draw_slant_bar(@enemy.screen_x - 55, @enemy.screen_y - 10, @enemy.hp, @enemy.maxhp, width = 75, height = 6, bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255))
self.contents.draw_text(@enemy.screen_x - 39, @enemy.screen_y - 22, 100, 32, "#{@percent}" + "%")
end
end
end
end

class Scene_Battle

alias raz_update update
alias raz_update_phase5 update_phase5
alias raz_update_phase4_step1 update_phase4_step1
alias raz_update_phase4_step5 update_phase4_step5
alias raz_enemy_hp_main main

def main
@troop_id = $game_temp.battle_troop_id
$game_troop.setup(@troop_id)
@enemy_window = Window_EnemyHP.new
@enemy_window.z = 95
raz_enemy_hp_main
@enemy_window.dispose
end

def update
@enemy_window.update
raz_update
end

def update_phase5
# If wait count is larger than 0
if @phase5_wait_count > 0
# Decrease wait count
@phase5_wait_count -= 1
# If wait count reaches 0
if @phase5_wait_count == 0
@enemy_window.visible = false
# Show result window
@result_window.visible = true
# Clear main phase flag
$game_temp.battle_main_phase = false
# Refresh status window
@status_window.refresh
@enemy_window.refresh
end
return
end
raz_update_phase5
end

def update_phase4_step1
raz_update_phase4_step1
@enemy_window.refresh
end

def update_phase4_step5
# Hide help window
@help_window.visible = false
# Refresh status window
@status_window.refresh
@enemy_window.refresh
raz_update_phase4_step5
end
end


Questo script serve per far vedere una barra sotto al nemico,dove indica la percentuale dei suoi Hp.........Molto meglio di questo che brilla........



Dalle fiamme rosse e blu compaiono due guerrieri.....Siete pronti per l'eterna lotta fra la fiamma blu e la fiamma rossa????
"T2F"The Two Flames:La leggenda delle due fiammeGioco realizzato per RPGMAKER XP 1.02 con il nuovissimo e unico MBS(Multi-Battle-Sistem)......Prima demo del Bs......
http://lnx.phantomca...?showtopic=2009

#5 Ospite_Dex_*

Ospite_Dex_*
  • Guests

Posted 11 January 2008 - 05:49 PM

Non avrebbe fatto male usare i tag [code=auto:0] winkr.gif

#6 :^:Riku:^:

:^:Riku:^:

    Ciambellano Demente

  • Members
  • PipPipPipPip
  • 359 posts

Posted 11 January 2008 - 05:59 PM

CITAZIONE (Dex @ Jan 11 2008, 05:55 PM) <{POST_SNAPBACK}>
Come suggeriresti di farlo ad eventi, riku?
Intendo il procedimento da utilizzare per farlo.

Non ho provato, a ma dovrebbe essere cos




I miei progetti!

ThE nEw ErA - -------- - 0%

#7 nejijuga

nejijuga

    Signore del Nulla

  • Members
  • PipPipPip
  • 216 posts

Posted 11 January 2008 - 08:00 PM

grazie zen e a te riku ve bah cn gli eventi ma quelli preferisco lasciarli stare se c'

anchio faccio parte dei cercatori!!!
incolla il codice sottostante nella tua firma se aderisci al movimento!
CODICE
[img]http://img178.imageshack.us/img178/5017/tastocercapz2.gif[/img]



--->storia di un abile hacker italiano<---

#8 :^:Riku:^:

:^:Riku:^:

    Ciambellano Demente

  • Members
  • PipPipPipPip
  • 359 posts

Posted 11 January 2008 - 08:57 PM

Io invece prefersico usare gli eventi, cos




I miei progetti!

ThE nEw ErA - -------- - 0%



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users