MOG_Damage System é um script para o RPG Maker XP, desenvolvido pelo Moghunter, que modifica como o dano é apresentado nas batalhas do projeto ou jogo que o usa.
Para instalar, basta inserir o código acima do Main e personalizar, se quiser. Existem 7 configurações pré-definidas que podem ser definidas logo no começo do script ou você pode customizá-lo da maneira que achar melhor ou necessário.
#_________________________________________________ # MOG_Damage System V1.2 #_________________________________________________ # By Moghunter # http://www.atelier-rgss.com #_________________________________________________ # Modifica como o dano é apresentado. ############## #Customização# ############## 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
Observação: se você gostou deste post ou ele lhe foi útil de alguma forma, por favor considere apoiar financeiramente a Gaming Room. Fico feliz só de ajudar, mas a contribuição do visitante é muito importante para que este site continua existindo e para que eu possa continuar provendo este tipo de conteúdo e melhorar cada vez mais. Acesse aqui e saiba como. Obrigado!