deadcell Trouvère Follet
Nombre de messages : 625 Age : 35 Niveau Rpg Maker : Excellent Niveau Jeux Préférés : Final Fantasy, Resident evil... Date d'inscription : 21/03/2007
| Sujet: Nouveau style barre HP / MP en combat v1 Mar 03 Juil 2007, 08:47 | |
| Moi j'aime beaucoup ce script, cela change l'apparence des combats et donne un peut plus de réalisme. Ce script vous donne un nouveau style de barre HP / MP pendant les combats. - Auteur : Inconnu- Screen : - Installation : Vous créez un script au-dessus de Main nommé HPMP1 et vous collez le code ci-dessous : - Code:
-
# HP,SPƒQ�[ƒW•\Ž¦ƒXƒNƒŠƒvƒgVer1.12
#============================================================================== # �¡ Window_Base #------------------------------------------------------------------------------ # �@ƒQ�[ƒ€’†‚Ì‚•‚ׂẴEƒBƒ“ƒhƒE‚̃X�[ƒp�[ƒNƒ‰ƒX‚Å‚•�B #==============================================================================
class Window_Base < Window #-------------------------------------------------------------------------- # �œ HP ‚Ì•`‰æ # actor : ƒAƒNƒ^�[ # x : •`‰æ�æ X �À•W # y : •`‰æ�æ Y �À•W # width : •`‰æ�æ‚Ì•� #-------------------------------------------------------------------------- def draw_actor_hp(actor, x, y, width = 144) # •Ï�”hp‚É•`‰æ‚•‚éƒQ�[ƒW‚Ì•�‚ð‘ã“ü hp = width * actor.hp / actor.maxhp # ˜g•`‰æ self.contents.fill_rect(x - 2, y + 15, width + 4, 10, Color.new(0, 0, 0, 192)) self.contents.fill_rect(x - 1, y + 16, width + 2, 8, Color.new(255, 255, 192, 192)) for i in y..y + 5 red = 96 - 96 * (i - y) / 5 green = 0 blue = 0 self.contents.fill_rect(x, i + 17, width, 1, Color.new(red, green, blue, 192)) end # ƒQ�[ƒW‚Ì•`‰æ�ˆ—��BŒ»�Ý‚ÌHP‚É‚æ‚Á‚Ä•`‰æ�F‚ð•Ï‰»‚³‚¹‚é�B for i in x..x + hp - 1 red = 80 + 160 * (i - x) / hp green = 80 * hp / width + 160 * (i - x) / width blue = 0 self.contents.fill_rect(i, y + 17, 1, 6, Color.new(red, green, blue, 192)) end # •Žš—ñ "HP" ‚ð•`‰æ self.contents.font.color = system_color self.contents.draw_text(x, y - 9, 32, 32, $data_system.words.hp) # MaxHP ‚ð•`‰æ‚•‚éƒXƒy�[ƒX‚ª‚ ‚é‚©ŒvŽZ if width - 32 >= 108 hp_x = x + width - 108 flag = true elsif width - 32 >= 48 hp_x = x + width - 48 flag = false end # HP ‚ð•`‰æ self.contents.font.color = actor.hp == 0 ? knockout_color : actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color self.contents.draw_text(hp_x, y - 9, 48, 32, actor.hp.to_s, 2) # MaxHP ‚ð•`‰æ if flag self.contents.font.color = normal_color self.contents.draw_text(hp_x + 48, y - 9, 12, 32, "/", 1) self.contents.draw_text(hp_x + 60, y - 9, 48, 32, actor.maxhp.to_s) end end #-------------------------------------------------------------------------- # �œ SP ‚Ì•`‰æ # actor : ƒAƒNƒ^�[ # x : •`‰æ�æ X �À•W # y : •`‰æ�æ Y �À•W # width : •`‰æ�æ‚Ì•� #-------------------------------------------------------------------------- def draw_actor_sp(actor, x, y, width = 144) # •Ï�”sp‚É•`‰æ‚•‚éƒQ�[ƒW‚Ì•�‚ð‘ã“ü sp = width * actor.sp / actor.maxsp # ˜g•`‰æ self.contents.fill_rect(x - 2, y + 19, width + 4, 10, Color.new(0, 0, 0, 192)) self.contents.fill_rect(x - 1, y + 20, width + 2, 8, Color.new(255, 255, 192, 192)) for i in y..y + 5 red = 0 green = 96 - 96 * (i - y) / 5 blue = 0 self.contents.fill_rect(x, i + 21, width, 1, Color.new(red, green, blue, 192)) end # ƒQ�[ƒW‚Ì•`‰æ�ˆ—��BŒ»�Ý‚ÌSP‚É‚æ‚Á‚Ä•`‰æ�F‚ð•Ï‰»‚³‚¹‚é�B for i in x..x + sp - 1 red = 0 green = 80 + 160 * (i - x) / sp blue = 80 * sp / width + 160 * (i - x) / width self.contents.fill_rect(i, y + 21, 1, 6, Color.new(red, green, blue, 192)) end # •Žš—ñ "SP" ‚ð•`‰æ self.contents.font.color = system_color self.contents.draw_text(x, y - 5, 32, 32, $data_system.words.sp) # MaxSP ‚ð•`‰æ‚•‚éƒXƒy�[ƒX‚ª‚ ‚é‚©ŒvŽZ if width - 32 >= 108 sp_x = x + width - 108 flag = true elsif width - 32 >= 48 sp_x = x + width - 48 flag = false end # SP ‚ð•`‰æ self.contents.font.color = actor.sp == 0 ? knockout_color : actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color self.contents.draw_text(sp_x, y - 5, 48, 32, actor.sp.to_s, 2) # MaxSP ‚ð•`‰æ if flag self.contents.font.color = normal_color self.contents.draw_text(sp_x + 48, y - 5, 12, 32, "/", 1) self.contents.draw_text(sp_x + 60, y - 5, 48, 32, actor.maxsp.to_s) end end end
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 = "Arial Black" bitmap.font.size = 32 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.set(176, 255, 144) else bitmap.font.color.set(255, 255, 255) end bitmap.draw_text(0, 12, 160, 36, damage_string, 1) if critical bitmap.font.size = 20 bitmap.font.color.set(0, 0, 0) bitmap.draw_text(-1, -1, 160, 20, "Kritisch!", 1) bitmap.draw_text(+1, -1, 160, 20, "Kritisch!", 1) bitmap.draw_text(-1, +1, 160, 20, "Kritisch!", 1) bitmap.draw_text(+1, +1, 160, 20, "Kritisch!", 1) bitmap.font.color.set(255, 255, 255) bitmap.draw_text(0, 0, 160, 20, "Kritisch!", 1) end @_damage_sprite = ::Sprite.new @_damage_sprite.bitmap = bitmap @_damage_sprite.ox = 80 + self.viewport.ox @_damage_sprite.oy = 20 + self.viewport.oy @_damage_sprite.x = self.x + self.viewport.rect.x @_damage_sprite.y = self.y - self.oy / 2 + self.viewport.rect.y @_damage_sprite.z = 3000 @_damage_duration = 40 end def animation(animation, hit) dispose_animation @_animation = animation return if @_animation == nil @_animation_hit = hit @_animation_duration = @_animation.frame_max animation_name = @_animation.animation_name animation_hue = @_animation.animation_hue bitmap = RPG::Cache.animation(animation_name, animation_hue) if @@_reference_count.include?(bitmap) @@_reference_count[bitmap] += 1 else @@_reference_count[bitmap] = 1 end @_animation_sprites = [] if @_animation.position != 3 or not @@_animations.include?(animation) for i in 0..15 sprite = ::Sprite.new sprite.bitmap = bitmap sprite.visible = false @_animation_sprites.push(sprite) end unless @@_animations.include?(animation) @@_animations.push(animation) end end update_animation end def loop_animation(animation) return if animation == @_loop_animation dispose_loop_animation @_loop_animation = animation return if @_loop_animation == nil @_loop_animation_index = 0 animation_name = @_loop_animation.animation_name animation_hue = @_loop_animation.animation_hue bitmap = RPG::Cache.animation(animation_name, animation_hue) if @@_reference_count.include?(bitmap) @@_reference_count[bitmap] += 1 else @@_reference_count[bitmap] = 1 end @_loop_animation_sprites = [] for i in 0..15 sprite = ::Sprite.new sprite.bitmap = bitmap sprite.visible = false @_loop_animation_sprites.push(sprite) end update_loop_animation end def animation_set_sprites(sprites, cell_data, position) for i in 0..15 sprite = sprites[i] pattern = cell_data[i, 0] if sprite == nil or pattern == nil or pattern == -1 sprite.visible = false if sprite != nil next end sprite.visible = true sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192) if position == 3 if self.viewport != nil sprite.x = self.viewport.rect.width / 2 sprite.y = self.viewport.rect.height - 160 else sprite.x = 320 sprite.y = 240 end else sprite.x = self.x + self.viewport.rect.x - self.ox + self.src_rect.width / 2 sprite.y = self.y + self.viewport.rect.y - self.oy + self.src_rect.height / 2 sprite.y -= self.src_rect.height / 4 if position == 0 sprite.y += self.src_rect.height / 4 if position == 2 end sprite.x += cell_data[i, 1] sprite.y += cell_data[i, 2] sprite.z = 2000 sprite.ox = 96 sprite.oy = 96 sprite.zoom_x = cell_data[i, 3] / 100.0 sprite.zoom_y = cell_data[i, 3] / 100.0 sprite.angle = cell_data[i, 4] sprite.mirror = (cell_data[i, 5] == 1) sprite.opacity = cell_data[i, 6] * self.opacity / 255.0 sprite.blend_type = cell_data[i, 7] end end end end PS: NE PAS CONFONDRE CE SCRIPT AVEC CELUI DE LA JAUGE ATB TYPE FF | |
|