Sign in to follow this  
Followers 0
xXDarkDragonXx

Da?o Gravedad

1 post in this topic

[center]Daño Gravedad[/center]
Por: XRXS

Descripción:

Lo que hace es que hace casi lo mismo que el script de 'Daño estilo FF10' pero este más bien es como el Ragnarok Online. Cuando haces daño, el mismo "brinca" para <- o para ->. Y cuando "cae" por decirlo así, se mueve un poquitín más al lado que "brinco". Para los que no entendieron tres carajos de lo que dije, una screen:

[spoiler]user posted image[/spoiler]

Veamos, en la izquierda ataqué al enemigo y el daño salió hacia arriba (no se puede apreciar mucho porque no tome screen en el momento adecuado) y luego en la derecha se muestra que el daño ha bajado después de subir. Luego de eso se mueve un poco al lado en donde brinco. Al lado en donde "brinca" es aleatorio. Funciona igualmente con habilidades de curar y demases.

Script:

Creen clase nueva arriba de Main pero debajo del XRXS Module y peguen dentro esto:

[spoiler]
CODE
################################################################################

################################### XMS ########################################
################################################################################

=begin
Gravity Effect

--------------------------------------------------------------------------------
Script criado pelo site XMS.
Created by XMS site.
Tradução e tutorial por Moghunter.
--------------------------------------------------------------------------------

FUNÇÃO
Permite que a apresentação do dano tenha o efeito de gravidade.

CUSTOMIZAÇÃO
=end
#-------------------------------------------------------------------------------
module XRXS_DAMAGE
def damage_x_init_velocity
#Quantidade de direções que o dano poderá pular.
return 1.2 * (rand(5) - 2)
end
def damage_y_init_velocity
#Velocidade do dano.
return 10
end
#Força da gravidade.
GRAVITY = 0.98
end
#-------------------------------------------------------------------------------
module XRXS_DAMAGE
def update
super
@damage_sprites = [] if @damage_sprites.nil?
@damage_durations = [] if @damage_durations.nil?
if @_damage_sprite != nil and @_damage_sprite.visible
x = damage_x_init_velocity
y = damage_y_init_velocity
d = @_damage_duration
@damage_sprites.push(Sprite_Damage.new(@_damage_sprite, x, y, d))
@_damage_sprite.visible = false
end
for damage_sprite in @damage_sprites
damage_sprite.update
end
for i in 0...@damage_sprites.size
@damage_sprites[i] = nil if @damage_sprites[i].disposed?
end
@damage_sprites.compact!
end
def dispose
super
if @damage_sprites != nil
for damage_sprite in @damage_sprites
damage_sprite.dispose
end
end
end
end
class RPG::Sprite < Sprite
include XRXS_DAMAGE
end
class Sprite_Damage < Sprite
def initialize(sprite, init_x_speed, init_y_speed, duration)
super(nil)
self.bitmap = sprite.bitmap.dup unless sprite.bitmap.nil?
self.opacity = sprite.opacity
self.x = sprite.x
self.y = sprite.y
self.z = sprite.z
self.ox = sprite.ox
self.oy = sprite.oy
@now_x_speed = init_x_speed
@now_y_speed = init_y_speed
@potential_x_energy = 0.0
@potential_y_energy = 0.0
@duration = duration
end
def update
super
n = self.oy + @now_y_speed
if n <= 0
@now_y_speed *= -1
@now_y_speed /= 2
@now_x_speed /= 2
end
self.oy = [n, 0].max
@potential_y_energy += XRXS_DAMAGE::GRAVITY
speed = @potential_y_energy.floor
@now_y_speed -= speed
@potential_y_energy -= speed
@potential_x_energy += @now_x_speed
speed = @potential_x_energy.floor
self.ox += speed
@potential_x_energy -= speed
@duration -= 1
if @duration == 0
self.dispose
end
end
end
[/spoiler]

Compatibilidad:
  • XRXS Module
  • Cualquier Sistema de Batalla (pueden haber excepciones)


0

Share this post


Link to post
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
Sign in to follow this  
Followers 0