Brasil G4mes
Registre-se para ter acesso total à todas as seções do fórum!
Jogue, brinque e o mais importante, divirta-se!

Participe do fórum, é rápido e fácil

Brasil G4mes
Registre-se para ter acesso total à todas as seções do fórum!
Jogue, brinque e o mais importante, divirta-se!
Brasil G4mes
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

MOG - Damage System

Ir para baixo

MOG - Damage System Empty MOG - Damage System

Mensagem por Convidad Qua Abr 22, 2009 6:14 pm

MOG Damage System


Caracterí­sticas

Modifica como o dano é apresentado.

Utilização

Cole em uma Classe Acima do Main.


Script



Código:
#_______________________________________________________________________________
# MOG_Damage System V1.2           
#_______________________________________________________________________________
# By Moghunter
# http://www.atelier-rgss.com
#_______________________________________________________________________________
# Modifica como o dano é apresentado.
#_______________________________________________________________________________
module MOG
################################################################################ 
#Tipos de efeitos.
#
# 0 = Zoom com rotação.
# 1 = Zoom IN e OUT.
# 2 = Zoom OUT.
# 3 = Sem Gravidade.
# 4 = Com Gravidade.
# 5 = Fantasma.
# 6 = Normal.
#
################################################################################
TYPE = 0
################################################################################
#Nome da Fonte. 
FONT_NAME = "Georgia"
#Tamanho da Fonte.
FONT_SIZE = 24
#Ativar contorno.
FONT_BOLD = true
#Tamanho da Fonte do dano crí­tico.
FONT_SIZE_CRITICAL = 16
#String do dano crí­tico.
CRITICAL_NAME = "Critical"
#Cor da fonte do dano.
FONT_COLOR_DAMAGE =  Color.new(255, 255, 255)
#Cor da fonte do dano de cura.
FONT_COLOR_HEAL = Color.new(176, 255, 144)
#Cor da fonte do dano crí­tico
FONT_COLOR_CRITICAL = Color.new(255, 150, 0)
################################################################################
#Default(ZOOM_OUT = 0.1 / ZOOM_IN = 0.08 / ROT = 24 / DUR = 0)
################################################################################
#Zoom Externo
ZOOM_OUT = 0.1
#Zoom Interno
ZOOM_IN = 0.08
#Velocidade da Rotação
ROT = 24
#Duração extra do dano.
DUR = 0
################################################################################
end 
$mogscript = {} if $mogscript == nil
$mogscript["Damage_System"] = true
module RPG
class Sprite < ::Sprite
def damage(value, critical)
dispose_damage
if value.is_a?(Numeric)
damage_string = value.abs.to_s
else
damage_string = value.to_s
end
bitmap = Bitmap.new(160, 48)
bitmap.font.name = MOG::FONT_NAME
bitmap.font.size = MOG::FONT_SIZE
bitmap.font.bold = MOG::FONT_BOLD
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
if value.is_a?(Numeric) and value < 0
bitmap.font.color = MOG::FONT_COLOR_HEAL     
else
bitmap.font.color = MOG::FONT_COLOR_DAMAGE
end
bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
if critical
bitmap.font.size = MOG::FONT_SIZE_CRITICAL
bitmap.font.color = MOG::FONT_COLOR_CRITICAL
bitmap.font.bold = MOG::FONT_BOLD
bitmap.draw_text(-1, -1, 160, 20, MOG::CRITICAL_NAME, 1)
bitmap.draw_text(+1, -1, 160, 20, MOG::CRITICAL_NAME, 1)
bitmap.draw_text(-1, +1, 160, 20, MOG::CRITICAL_NAME, 1)
bitmap.draw_text(+1, +1, 160, 20, MOG::CRITICAL_NAME, 1)
bitmap.font.color.set(255, 255, 255)
bitmap.draw_text(0, 0, 160, 20, MOG::CRITICAL_NAME, 1)
end
@_damage_sprite = ::Sprite.new(self.viewport)
@_damage_sprite.bitmap = bitmap
@_damage_sprite.ox = 80
@_damage_sprite.oy = 20
@_damage_sprite.x = self.x
@_damage_sprite.y = self.y - self.oy / 2
@_damage_sprite.z = 3000
@_damage_duration = 40 + MOG::DUR
end   
def update
super
if @_whiten_duration > 0
@_whiten_duration -= 1
self.color.alpha = 128 - (16 - @_whiten_duration) * 10
end
if @_appear_duration > 0
@_appear_duration -= 1
self.opacity = (16 - @_appear_duration) * 16
end
if @_escape_duration > 0
@_escape_duration -= 1
self.opacity = 256 - (32 - @_escape_duration) * 10
end
if @_collapse_duration > 0
@_collapse_duration -= 1
self.opacity = 256 - (48 - @_collapse_duration) * 6
end
if @_damage_duration > 0
@_damage_duration -= 1
if MOG::TYPE == 0
case @_damage_duration
when 38..40 + MOG::DUR
@_damage_sprite.y -= 4
@_damage_sprite.zoom_x += MOG::ZOOM_OUT
@_damage_sprite.zoom_y += MOG::ZOOM_OUT     
@_damage_sprite.angle +=  MOG::ROT
when 36..37
@_damage_sprite.y -= 2
@_damage_sprite.zoom_x += MOG::ZOOM_OUT
@_damage_sprite.zoom_y += MOG::ZOOM_OUT     
@_damage_sprite.angle +=  MOG::ROT
when 34..35
@_damage_sprite.y -= 2
@_damage_sprite.zoom_x += MOG::ZOOM_OUT
@_damage_sprite.zoom_y += MOG::ZOOM_OUT       
@_damage_sprite.angle +=  MOG::ROT
when 23..33
@_damage_sprite.y -= 4
@_damage_sprite.zoom_x += MOG::ZOOM_OUT
@_damage_sprite.zoom_y += MOG::ZOOM_OUT
@_damage_sprite.angle +=  MOG::ROT
when 0..22
@_damage_sprite.angle = 0
@_damage_sprite.zoom_x -= MOG::ZOOM_IN
@_damage_sprite.zoom_y -= MOG::ZOOM_IN
@_damage_sprite.y -= 3
end
elsif MOG::TYPE == 1 
case @_damage_duration
when 38..40 + MOG::DUR
@_damage_sprite.y -= 4
@_damage_sprite.zoom_x += MOG::ZOOM_OUT
@_damage_sprite.zoom_y += MOG::ZOOM_OUT     
when 36..37
@_damage_sprite.y -= 2
@_damage_sprite.zoom_x += MOG::ZOOM_OUT
@_damage_sprite.zoom_y += MOG::ZOOM_OUT     
when 34..35
@_damage_sprite.y -= 2
@_damage_sprite.zoom_x += MOG::ZOOM_OUT
@_damage_sprite.zoom_y += MOG::ZOOM_OUT       
when 23..33
@_damage_sprite.y -= 4
@_damage_sprite.zoom_x += MOG::ZOOM_OUT
@_damage_sprite.zoom_y += MOG::ZOOM_OUT
when 0..22
@_damage_sprite.angle = 0
@_damage_sprite.zoom_x -= MOG::ZOOM_IN
@_damage_sprite.zoom_y -= MOG::ZOOM_IN
@_damage_sprite.y -= 3
end   
elsif MOG::TYPE == 2 
@_damage_sprite.y -= 1
@_damage_sprite.zoom_x += MOG::ZOOM_OUT
@_damage_sprite.zoom_y += MOG::ZOOM_OUT           
elsif MOG::TYPE == 3
@_damage_sprite.y -= 3   
elsif MOG::TYPE == 4
case @_damage_duration
when 30..40 + MOG::DUR
@_damage_sprite.y -= 5
when 20..29
@_damage_sprite.y += 7
when 10..19
@_damage_sprite.y -= 3
when 0..9
@_damage_sprite.y += 6
end             
elsif MOG::TYPE == 5
case @_damage_duration
when 30..40 + MOG::DUR
@_damage_sprite.y -= 10
@_damage_sprite.zoom_y += MOG::ZOOM_OUT * 5   
@_damage_sprite.zoom_x -= MOG::ZOOM_IN   
when 20..29
@_damage_sprite.y -= 1
@_damage_sprite.zoom_y -= MOG::ZOOM_OUT * 5
@_damage_sprite.zoom_x += MOG::ZOOM_IN   
when 0..19
@_damage_sprite.y -= 0
@_damage_sprite.zoom_y = 1
@_damage_sprite.zoom_x = 1
end       
else
case @_damage_duration
when 38..40 + MOG::DUR
@_damage_sprite.y -= 4
when 36..37
@_damage_sprite.y -= 2
when 34..35
@_damage_sprite.y += 2
when 28..33
@_damage_sprite.y += 4
end       
end
@_damage_sprite.opacity = 256 - (18 - @_damage_duration) * 12
if @_damage_duration == 0
dispose_damage
end
end
if @_animation != nil and (Graphics.frame_count % 2 == 0)
@_animation_duration -= 1
update_animation
end
if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
update_loop_animation
@_loop_animation_index += 1
@_loop_animation_index %= @_loop_animation.frame_max
end
if @_blink
@_blink_count = (@_blink_count + 1) % 32
if @_blink_count < 16
alpha = (16 - @_blink_count) * 6
else
alpha = (@_blink_count - 16) * 6
end
self.color.set(255, 255, 255, alpha)
end
@@_animations.clear
end
end
end

Créditos


MogHunter

Convidad
Convidado


Ir para o topo Ir para baixo

MOG - Damage System Empty Re: MOG - Damage System

Mensagem por VictorBG4 Qua Abr 22, 2009 6:15 pm

Simples e legal.
Com certeza da uma forma mais legal no sistema de batalha básico do RPG Maker!
Vlw ae
VictorBG4
VictorBG4
Administrador
Administrador

Mensagens Mensagens : 1807
Fama Fama : 198

http://www.brasilg4mes.com

Ir para o topo Ir para baixo

Ir para o topo

- Tópicos semelhantes

 
Permissões neste sub-fórum
Não podes responder a tópicos