Spike92 Posted October 14, 2006 Share Posted October 14, 2006 CMS Menu DescrizioneEccovi un nuovo menù personalizzato creato da Krazplay e segnalatomi dal mitico Ally. :rulezza: AutoreKrazplay Screen:http://imageshack.us/scaled/landing/488/menu9zs1ep.png Script:Create una nuova classe sopra main ed inserite questo codice: class Window_Base < Window #--------------------------------- # By Krazplay #--------------------------------- def draw_actor_battler(actor, x, y) bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue) cw = bitmap.width ch = bitmap.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x - cw/2, y - ch/2, bitmap, src_rect) end #--------------------------------- # Def Draw line #--------------------------------- def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color) # ??????????????????? distance = (start_x - end_x).abs + (start_y - end_y).abs # ???? if end_color == start_color for i in 1..distance x = (start_x + 1.0 * (end_x - start_x) * i/distance).to_i y = (start_y + 1.0 * (end_y - start_y) * i/distance).to_i if width == 1 self.contents.set_pixel(x, y, start_color) else self.contents.fill_rect(x, y, width, width, start_color) end end else for i in 1..distance x = (start_x + 1.0 * (end_x - start_x) * I/distance).to_i y = (start_y + 1.0 * (end_y - start_y) * I/distance).to_i r = start_color.red * (distance-i)/distance + end_color.red * i/distance g = start_color.green * (distance-i)/distance + end_color.green * i/distance b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance a = start_color.alpha has * (distance-i)/distance + end_color.alpha * i/distance if width == 1 self.contents.set_pixel(x, y, Color.new(r, g, b, a)) else self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a)) end end end end #--------------------------------- # Def Draw polygon (to make contours of the faces) #--------------------------------- def draw_polygon(peaks, color, width = 1) # ?(=??)?????????? for i in 0... (peaks.size - 1) # ????????? draw_line(peaks[i][0 ], peaks[i][1 ], peaks[i+1][0 ], peaks[i+1][1 ], color, width) end # ?????????????? draw_line(peaks[peaks.size - 1][0 ], peaks[peaks.size - 1][1 ], peaks[0][0 ], peaks[0][1 ], color, width) end #--------------------------------- # def Draw face (faces to be strictly accurate ^^) #--------------------------------- def draw_facesquare(character_name, character_hue, x, y, size = 24) bitmap = RPG::Cache.character(character_name, character_hue) src_rect = Rect.new((bitmap.width/4 - size)/2, 0, size, size) self.contents.blt(x, y, bitmap, src_rect) self.draw_polygon([[x, y], [x+size, y], [x+size, y+size], [x, y+size ] ], Color.new(255,255,255,128)) end end Poi create un'altra classe sopra main, chiamatela Bars here e incollateci questo: # HP/SP/EXPƒQ?[ƒW•\' ¦ƒXƒNƒ¦ƒvƒg Worm 1.00 # "z•z¼³?EƒTƒ|?[ƒgURL # http://members.jcom.home.ne.jp/cogwheel/ #============================================================================== #? ¡ Game_Actor #------------------------------------------------------------------------------ #?@ƒAƒNƒ^?[' ðˆµ' ¤ƒNƒ‰ƒX' Å'·?B' ±' ̃Nƒ‰ƒX' Í Game_Actors ƒNƒ‰ƒX ($$game_actors) # ' Ì"à•"' Å' G -- p' ³' ê?AGame_Party ƒNƒ‰ƒX ($$game_party) ' ©' ç' à' Q?Æ' ³' ê' Ü'·?B #============================================================================== class Game_Actor < Game_Battler def now_exp return @exp - @exp_list[@level ] end def next_exp return @exp_list[@level+1 ] > 0? @exp_list[@level+1 ] - @exp_list[@level ]: 0 end end #============================================================================== #? ¡ Window_Base #------------------------------------------------------------------------------ #?@ƒQ?[ƒ¤' †' Ì'·' ×' Ä' ̃EƒBƒ"ƒhƒE' ̃X?[ƒp?[ƒNƒ‰ƒX' Å'·?B #============================================================================== class Window_Base < Window #-------------------------------------------------------------------------- #? ½ hp ƒQ?[ƒW' Ì•`‰æ #-------------------------------------------------------------------------- # ƒIƒ¦ƒWƒiƒ‹' ÌHP•`‰æ' ð draw_actor_hp_original ' Æ-¼' O•Ï?x alias:draw_actor_hp_original:draw_actor_hp def draw_actor_hp(actor, x, y, width = 144) # •Ï?"rate' 3rd ¼"?Ý' ÌHP/MHP' ð' ã"ü if actor.maxhp != 0 miss = actor.hp.to_f/actor.maxhp else miss = 0 end # plus_x:x?À•W' ̈Ê' u•â?³ rate_x:x?À•W' ̈Ê' u•â?³(%) plus_y:y?À•W' ̈Ê' u•â?³ # plus_width:•?' Ì•â?³ rate_width:•?' Ì•â?³(%) height:?c•? # align1:•`‰æƒ^ƒCƒv1 0:?¶‹l' ss 1:' †‰›' µ' ¦ 2:‰E‹l' ss # align2:•`‰æƒ^ƒCƒv2 0:?ã‹l' ss 1:' †‰›' µ' ¦ 2:‰º‹l' ss # align3:ƒQ?[ƒWƒ^ƒCƒv 0:?¶‹l' ss 1:‰E‹l' ss plus_x = 0 rate_x = 0 plus_y = 25 plus_width = 0 rate_width = 100 height = 10 align1 = 1 align2 = 2 align3 = 0 # ƒOƒ‰ƒf?[ƒVƒ‡ƒ"?Ý' 2nd grade1:‹óƒQ?[ƒW grade2:' ÀƒQ?[ƒW # (0:‰¡' ɃOƒ‰ƒf?[ƒVƒ‡ƒ "1:?c' ɃOƒ‰ƒf?[ƒVƒ‡ƒ" 2:' Î' ss' ɃOƒ‰ƒf?[ƒVƒ‡ƒ"(¼ƒ?d)?j grade1 = 1 grade2 = 0 #?F?Ý' è?Bcolor1:¦O˜g?Ccolor2:' †˜g # color3:‹óƒQ?[ƒWƒ_?[ƒNƒJƒ‰?[?Ccolor4:‹óƒQ?[ƒWƒ‰ƒCƒgƒJƒ‰?[ # color5:' ÀƒQ?[ƒWƒ_?[ƒNƒJƒ‰?[?Ccolor6:' ÀƒQ?[ƒWƒ‰ƒCƒgƒJƒ‰?[ color1 = Color.new(0, 0, 0, 192) color2 = Color.new(255, 255, 192, 192) color3 = Color.new(0, 0, 0, 192) color4 = Color.new(64, 0, 0, 192) color5 = Color.new(80 - 24 * miss, 80 * miss, 14 * miss, 192) color6 = Color.new(240 - 72 * miss, 240 * miss, 62 * miss, 192) # •Ï?"sp' É•`‰æ '·' éƒQ?[ƒW' Ì•?' ð' ã"ü if actor.maxhp != 0 hp = (width + plus_width) * actor.hp * rate_width/100/actor.maxhp else hp = 0 end # ƒQ?[ƒW' Ì•`‰æ gauge_rect(x + plus_x + width * rate_x/100, y + plus_y, width, plus_width + width * rate_width/100, height, hp, align1, align2, align3, color1, color2, color3, color4, color5, color6, grade1, grade2) # ƒIƒ¦ƒWƒiƒ‹' ÌHP•`‰æ?ˆ --?' ð¼Ä' Ñ?o' µ draw_actor_hp_original(actor, x, y, width) end #-------------------------------------------------------------------------- #? ½ SP ƒQ?[ƒW' Ì•`‰æ #-------------------------------------------------------------------------- # ƒIƒ¦ƒWƒiƒ‹' ÌSP•`‰æ' ð draw_actor_sp_original ' Æ-¼' O•Ï?x alias:draw_actor_sp_original:draw_actor_sp def draw_actor_sp(actor, x, y, width = 144) # •Ï?"rate' 3rd ¼"?Ý' ÌSP/MSP' ð' ã"ü if actor.maxsp != 0 miss = actor.sp.to_f/actor.maxsp else miss = 1 end # plus_x:x?À•W' ̈Ê' u•â?³ rate_x:x?À•W' ̈Ê' u•â?³(%) plus_y:y?À•W' ̈Ê' u•â?³ # plus_width:•?' Ì•â?³ rate_width:•?' Ì•â?³(%) height:?c•? # align1:•`‰æƒ^ƒCƒv1 0:?¶‹l' ss 1:' †‰›' µ' ¦ 2:‰E‹l' ss # align2:•`‰æƒ^ƒCƒv2 0:?ã‹l' ss 1:' †‰›' µ' ¦ 2:‰º‹l' ss # align3:ƒQ?[ƒWƒ^ƒCƒv 0:?¶‹l' ss 1:‰E‹l' ss plus_x = 0 rate_x = 0 plus_y = 25 plus_width = 0 rate_width = 100 height = 10 align1 = 1 align2 = 2 align3 = 0 # ƒOƒ‰ƒf?[ƒVƒ‡ƒ"?Ý' 2nd grade1:‹óƒQ?[ƒW grade2:' ÀƒQ?[ƒW # (0:‰¡' ɃOƒ‰ƒf?[ƒVƒ‡ƒ "1:?c' ɃOƒ‰ƒf?[ƒVƒ‡ƒ" 2:' Î' ss' ɃOƒ‰ƒf?[ƒVƒ‡ƒ"(¼ƒ?d)?j grade1 = 1 grade2 = 0 #?F?Ý' è?Bcolor1:¦O˜g?Ccolor2:' †˜g # color3:‹óƒQ?[ƒWƒ_?[ƒNƒJƒ‰?[?Ccolor4:‹óƒQ?[ƒWƒ‰ƒCƒgƒJƒ‰?[ # color5:' ÀƒQ?[ƒWƒ_?[ƒNƒJƒ‰?[?Ccolor6:' ÀƒQ?[ƒWƒ‰ƒCƒgƒJƒ‰?[ color1 = Color.new(0, 0, 0, 192) color2 = Color.new(255, 255, 192, 192) color3 = Color.new(0, 0, 0, 192) color4 = Color.new(0, 64, 0, 192) color5 = Color.new(14 * miss, 80 - 24 * miss, 80 * miss, 192) color6 = Color.new(62 * miss, 240 - 72 * miss, 240 * miss, 192) # •Ï?"sp' É•`‰æ '·' éƒQ?[ƒW' Ì•?' ð' ã"ü if actor.maxsp != 0 sp = (width + plus_width) * actor.sp * rate_width/100/actor.maxsp else sp = (width + plus_width) * rate_width/100 end # ƒQ?[ƒW' Ì•`‰æ gauge_rect(x + plus_x + width * rate_x/100, y + plus_y, width, plus_width + width * rate_width/100, height, sp, align1, align2, align3, color1, color2, color3, color4, color5, color6, grade1, grade2) # ƒIƒ¦ƒWƒiƒ‹' ÌSP•`‰æ?ˆ --?' ð¼Ä' Ñ?o' µ draw_actor_sp_original(actor, x, y, width) end #-------------------------------------------------------------------------- #? ½ EXP ƒQ?[ƒW' Ì•`‰æ #-------------------------------------------------------------------------- # ƒIƒ¦ƒWƒiƒ‹' ÌEXP•`‰æ' ð draw_actor_sp_original ' Æ-¼' O•Ï?x alias:draw_actor_exp_original:draw_actor_exp def draw_actor_exp(actor, x, y, width = 204) # •Ï?"rate' 3rd ¼"?Ý' Ìexp/nextexp' ð' ã"ü if actor.next_exp != 0 miss = actor.now_exp.to_f/actor.next_exp else miss = 1 end # plus_x:x?À•W' ̈Ê' u•â?³ rate_x:x?À•W' ̈Ê' u•â?³(%) plus_y:y?À•W' ̈Ê' u•â?³ # plus_width:•?' Ì•â?³ rate_width:•?' Ì•â?³(%) height:?c•? # align1:•`‰æƒ^ƒCƒv1 0:?¶‹l' ss 1:' †‰›' µ' ¦ 2:‰E‹l' ss # align2:•`‰æƒ^ƒCƒv2 0:?ã‹l' ss 1:' †‰›' µ' ¦ 2:‰º‹l' ss # align3:ƒQ?[ƒWƒ^ƒCƒv 0:?¶‹l' ss 1:‰E‹l' ss plus_x = 0 rate_x = 0 plus_y = 25 plus_width = 0 rate_width = 100 height = 10 align1 = 1 align2 = 2 align3 = 0 # ƒOƒ‰ƒf?[ƒVƒ‡ƒ"?Ý' 2nd grade1:‹óƒQ?[ƒW grade2:' ÀƒQ?[ƒW # (0:‰¡' ɃOƒ‰ƒf?[ƒVƒ‡ƒ "1:?c' ɃOƒ‰ƒf?[ƒVƒ‡ƒ" 2:' Î' ss' ɃOƒ‰ƒf?[ƒVƒ‡ƒ"(¼ƒ?d)?j grade1 = 1 grade2 = 0 #?F?Ý' è?Bcolor1:¦O˜g?Ccolor2:' †˜g # color3:‹óƒQ?[ƒWƒ_?[ƒNƒJƒ‰?[?Ccolor4:‹óƒQ?[ƒWƒ‰ƒCƒgƒJƒ‰?[ # color5:' ÀƒQ?[ƒWƒ_?[ƒNƒJƒ‰?[?Ccolor6:' ÀƒQ?[ƒWƒ‰ƒCƒgƒJƒ‰?[ color1 = Color.new(0, 0, 0, 192) color2 = Color.new(255, 255, 192, 192) color3 = Color.new(0, 0, 0, 192) color4 = Color.new(64, 0, 0, 192) color5 = Color.new(80 * misses, 80 - 80 * misses ** 2, 80 - 80 * misses, 192) color6 = Color.new(240 * misses, 240 - 240 * misses ** 2, 240 - 240 * misses, 192) # •Ï?"exp' É•`‰æ '·' éƒQ?[ƒW' Ì•?' ð' ã"ü if actor.next_exp != 0 exp = (width + plus_width) * actor.now_exp * rate_width/ 100/actor.next_exp else exp = (width + plus_width) * rate_width/100 end # ƒQ?[ƒW' Ì•`‰æ gauge_rect(x + plus_x + width * rate_x/100, y + plus_y, width, plus_width + width * rate_width/100, height, exp, align1, align2, align3, color1, color2, color3, color4, color5, color6, grade1, grade2) # ƒIƒ¦ƒWƒiƒ‹' ÌEXP•`‰æ?ˆ --?' ð¼Ä' Ñ?o' µ draw_actor_exp_original(actor, x, y) end #-------------------------------------------------------------------------- #? ½ ƒQ?[ƒW' Ì•`‰æ #-------------------------------------------------------------------------- def gauge_rect(x, y, rect_width, width, height, gauge, align1, align2, align3, color1, color2, color3, color4, color5, color6, grade1, grade2) case align1 when 1 x += (rect_width - width)/2 when 2 x += rect_width - width end case align2 when 1 y -= height/2 when 2 y -= height end # ˜g•`‰æ self.contents.fill_rect(x, y, width, height, color1) self.contents.fill_rect(x + 1, y + 1, width - 2, height - 2, color2) if align3 == 0 if grade1 == 2 grade1 = 3 end if grade2 == 2 grade2 = 3 end end if (align3 == 1 and grade1 == 0) or grade1 > 0 color = color3 color3 = color4 color4 = color end if (align3 == 1 and grade2 == 0) or grade2 > 0 color = color5 color5 = color6 color6 = color end # ‹óƒQ?[ƒW' Ì•`‰æ self.contents.gradation_rect(x + 2, y + 2, width - 4, height - 4, color3, color4, grade1) if align3 == 1 x += width - gauge end # ' ÀƒQ?[ƒW' Ì•`‰æ self.contents.gradation_rect(x + 2, y + 2, gauge - 4, height - 4, color5, color6, grade2) end end #------------------------------------------------------------------------------ #?@BitmapƒNƒ‰ƒX' É?V' ½' È‹@"\' ð' ljÁ' µ' Ü'·?B #============================================================================== class Bitmap #-------------------------------------------------------------------------- #? ½ ‹é¼`' ðƒOƒ‰ƒf?[ƒVƒ‡ƒ"•\' ¦ # color1: ƒXƒ^?[ƒgƒJƒ‰?[ # color2: ƒGƒ"ƒhƒJƒ‰?[ # align: 0:‰¡' ɃOƒ‰ƒf?[ƒVƒ‡ƒ " # 1:?c' ɃOƒ‰ƒf?[ƒVƒ‡ƒ " # 2:' Î' ss' ɃOƒ‰ƒf?[ƒVƒ‡ƒ"?i¼ƒ?d' É' Â' "'?ˆÓ?j #-------------------------------------------------------------------------- def gradation_rect(x, y, width, height, color1, color2, align = 0) if align == 0 for i in x... x + width red = color1.red + (color2.red - color1.red) * (i - x)/(width - 1) green = color1.green + (color2.green - color1.green) * (i - x)/(width - 1) blue = color1.blue + (color2.blue - color1.blue) * (i - x)/(width - 1) alpha = color1.alpha + (color2.alpha - color1.alpha) * (i - x)/(width - 1) color = Color.new(red, green, blue, alpha) fill_rect(i, y, 1, height, color) end elsif align == 1 for i in y... y + height red = color1.red + (color2.red - color1.red) * (i - y)/(height - 1) green = color1.green + (color2.green - color1.green) * (i - y)/(height - 1) blue = color1.blue + (color2.blue - color1.blue) * (i - y)/(height - 1) alpha = color1.alpha + (color2.alpha - color1.alpha) * (i - y) / (height - 1) color = Color.new(red, green, blue, alpha) fill_rect(x, i, width, 1, color) end elsif align == 2 for i in x...x + width for j in y...y + height red = color1.red + (color2.red - color1.red) * ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 green = color1.green + (color2.green - color1.green) * ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 blue = color1.blue + (color2.blue - color1.blue) * ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 alpha = color1.alpha + (color2.alpha - color1.alpha) * ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 color = Color.new(red, green, blue, alpha) set_pixel(i, j, color) end end elsif align == 3 for i in x...x + width for j in y...y + height red = color1.red + (color2.red - color1.red) * ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 green = color1.green + (color2.green - color1.green) * ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 blue = color1.blue + (color2.blue - color1.blue) * ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 alpha = color1.alpha + (color2.alpha - color1.alpha) * ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 color = Color.new(red, green, blue, alpha) set_pixel(i, j, color) end end end end end #============================================================================== # ?¡ Spriteƒ‚ƒWƒ…?[ƒ‹ #------------------------------------------------------------------------------ # ?@ƒAƒjƒ??[ƒVƒ‡ƒ“‚̦Ǘ?‚ð?s‚¤ƒ‚ƒWƒ…?[ƒ‹‚Å‚·?B #============================================================================== 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, "CRITICAL", 1) bitmap.draw_text(+1, -1, 160, 20, "CRITICAL", 1) bitmap.draw_text(-1, +1, 160, 20, "CRITICAL", 1) bitmap.draw_text(+1, +1, 160, 20, "CRITICAL", 1) bitmap.font.color.set(255, 255, 255) bitmap.draw_text(0, 0, 160, 20, "CRITICAL", 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 Sostituiamo poi Window_Menustatus con questo: #============================================================================== # ■ Window_MenuStatus #------------------------------------------------------------------------------ # Menu spécial de Silversun #============================================================================== class Window_MenuStatus < Window_Selectable #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(0, 0, 480, 480) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize refresh self.active = false self.index = -1 end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear @item_max = $game_party.actors.size for i in 0...$game_party.actors.size y = 270 x = 220 actor = $game_party.actors[i] actor1 = $game_party.actors[0] actor2 = $game_party.actors[1] actor3 = $game_party.actors[2] actor4 = $game_party.actors[3] self.draw_facesquare(actor.character_name, actor.character_hue,10+32*i, 5 ) if @item_max >= 4 #variables cnw = contents.text_size(actor4.name).width cnh = contents.text_size(actor4.name).height ccw = contents.text_size(actor4.class_name).width cch = contents.text_size(actor4.class_name).height chpw = contents.text_size(actor4.hp.to_s).width cspw = contents.text_size(actor4.sp.to_s).width #draw draw_actor_battler(actor4,x, y-100) draw_actor_name(actor4, x-cnw/2, y-275) draw_actor_class(actor4, x-ccw/2, y-275+cnh) draw_actor_level(actor4, x-130, y - 275+cnh+cch/2) draw_actor_state(actor4, x +80, y - 275+cnh+cch/2) draw_actor_hp(actor4, x-chpw*2, y - 275+cnh*2) draw_actor_sp(actor4, x -cspw*2, y - 275+cnh*3) end if @item_max >= 3 #variables cnw = contents.text_size(actor3.name).width cnh = contents.text_size(actor3.name).height ccw = contents.text_size(actor3.class_name).width cch = contents.text_size(actor3.class_name).height clw = contents.text_size(actor3.level.to_s).width chpw = contents.text_size(actor3.hp.to_s).width cspw = contents.text_size(actor3.sp.to_s).width #draw draw_actor_battler(actor3, x+70, y - 70) draw_actor_name(actor3, x+180-cnw/2+10, y-140) draw_actor_class(actor3, x+180-cch/2-35, y-140+cnh) draw_actor_level(actor3, x+180-clw, y -140+cnh+cch) draw_actor_state(actor3, x+180-35, y -140+cnh*3) draw_actor_hp(actor3, x+180-100, y-140+cnh*4) draw_actor_sp(actor3, x+180-100, y-140+cnh*5) end if @item_max >= 2 #variables cnw = contents.text_size(actor2.name).width cnh = contents.text_size(actor2.name).height ccw = contents.text_size(actor2.class_name).width cch = contents.text_size(actor2.class_name).height #draw draw_actor_battler(actor2, x-70,y-70) draw_actor_name(actor2, x-220, y-140) draw_actor_class(actor2, x-220, y-140+cnh) draw_actor_level(actor2, x-220, y -140+cnh+cch) draw_actor_state(actor2, x-220, y -140+cnh*3) draw_actor_hp(actor2, x-220, y-140+cnh*4) draw_actor_sp(actor2, x-220, y-140+cnh*5) end if @item_max >= 1 #variables cnw = contents.text_size(actor1.name).width cnh = contents.text_size(actor1.name).height ccw = contents.text_size(actor1.class_name).width cch = contents.text_size(actor1.class_name).height chpw = contents.text_size(actor1.hp.to_s).width cspw = contents.text_size(actor1.sp.to_s).width #draw draw_actor_battler(actor1, x,y) draw_actor_name(actor1, x-cnw/2, y+80) draw_actor_class(actor1, x-ccw/2, y+80+cnh) draw_actor_level(actor1, x-130, y + 80+cnh+cch/2) draw_actor_state(actor1, x +80, y + 80+cnh+cch/2) draw_actor_hp(actor1, x-chpw*2, y + 80+cnh*2) draw_actor_sp(actor1, x -cspw*2, y + 80+cnh*3) end end end #-------------------------------------------------------------------------- # ● カーソルの矩形更新 #-------------------------------------------------------------------------- def update_cursor_rect if @index < 0 self.cursor_rect.empty else self.cursor_rect.set(7+@index*32, 2, 31, 31) end end end Bugs e Conflitti NotiBug Corretti :rulezza: Setta dei makeratori originali™ - SMO - #settadeimakeratorioriginalihttp://img131.imageshack.us/img131/3334/smobarpn5.png http://img138.imageshack.us/img138/7990/nonnafirmajz1kq9.jpg <DarK-SePHiRoTH-> raga sono mancato un anno ma a quanto vedo mahun non ha ancora imparato a disegnare :O <cip_e_ciop> picasso ha fatto per la pittura ciò che mahun ha fatto per i fumetti Link to comment Share on other sites More sharing options...
Orso_Balosso Posted November 16, 2006 Share Posted November 16, 2006 Mi dà errore di sintassi alla riga 326 di window_base Link to comment Share on other sites More sharing options...
Zerathul Posted November 16, 2006 Share Posted November 16, 2006 IdemComunque in pratica lo script si limita a spostare le finestre e le immagini, no? O_______________________________________________________O(metà delle cose che fanno le faccio anch'io zizi) (sto qua invece è un mostro....) Link to comment Share on other sites More sharing options...
Kenshin Posted February 5, 2008 Share Posted February 5, 2008 Qualcuno non potrebbe dirci come risolvere questo errore?, che mi piaceva molto questo nuovo statusLa riga che va in conflitto è la seguente:def draw_actor_battler(actor, X, y) "Giochiamo a: schiettezza o grande impresa eroica!" Personaggio PBF: LyrielPN: 12/20PV: 2/2PA: 4 (5 col mantello d'acero)Equipaggiamento:Spada comunePugnale comuneArco elfico (magico, ignifugo. Permette di colpire da lunghe distanze. Se distrutto si auto-restaura a fine battaglia. Le frecce scoccate con questo arco ottengono l'effetto dell'incantesimo Folata di vento permettendo di spazzare via piccoli oggetti e creature.)Faretra con 20 frecceCappuccioArmatura delle ombre borchiata (punti armatura 4, ignifuga, di notte +1 a furtività)2 anelli di valoreBorsa comune (10 slot)CordaPenna e calamaioLibro vuotoForma di formaggioMappaCannocchialeTagliola di ferroCampanellino di MaiaMantello d'Acero (+1PA): un mantello pesante di colore rossiccio che presenta dei motivi fiochi, dello stesso colore, a forma di foglie d'acero. E' dotato di un ampio cappuccio e può coprire completamente chi lo indossa. Se si resta fermi in un'area boschiva o tra un gruppo di alberi il mantello è in grado di celare completamente la presenza del possessore dando un grado di furtività pari a gr.5. Nel caso di bestie ed animali dalla visuale meno acuta, se il giocatore è già stato notato od ha notificato in qualche modo la sua presenza può gettarsi a terra tra un gruppo di foglie o tra i cespugli per scomparire completamente dalla visuale di tali nemici.181 monete d'oroCintura porta coltelli (6 slot)Coltello da lancio intarsiatoColtello da lancio in metalloColtello da lancio in metallo Campanellino di MaiaSe Lyriel, e solo lui, suona tre volte il campanellino può richiamare una creatura magica che combatterà al suo fianco al prezzo di 3 PN.L'animale ha l'aspetto di un leopardo delle nevi, i suoi occhi sono viola e così gli artigli, i denti e la punta della coda. Questa è lunga e larga, molto folta e corposa. Il manto a differenza dei leopardi è tutto bianco, inoltre ha una folta criniera circolare intorno al collo a mo' di sciarpa e che si unisce con la sommità della fronte creando un cresta non molto alta pettinata all'indietro.La creatura combatte indipendentemente dal possessore (il giocatore potrà descriverne il comportamento in battaglia e fuori, ma il master potrà riservarsi il diritto di far compiere alla creatura delle azioni per conto proprio).La creatura non deve per forza stare vicino all'utilizzatore, ma può essere mandata lontano e tornare da lui su comando.Lyriel e l'animale hanno un contatto mentale e possono comunicare anche a distanza.Non vi è limite alla permanenza della creatura una volta evocata, però se i suoi PV raggiungono lo zero dovrà essere risvegliata magicamente da un mago od un curatore esperto. Lyriel può richiamare all'interno del campanellino la creatura quando essa non è impegnata in combattimento od in altre prove senza sforzi, ma dovrà spendere di nuovo 3 PN per richiamarla. Può continuare a combattere se Lyriel viene sconfitto.L'animale vede bene anche di notte e se c'è nebbia.Caratteristiche della creatura:PV 2PA 2Atletica Gr.4Furtività Gr.1Attacco (tipo descritto dal giocatore nei limiti fisici di artigli e morso) di massimo Gr.5 può dichiarare DIRETTO su armature di cuoio o cuoio borchiato e MAGICO con tutti gli attacchi. Può dichiarare SONNO se artigli e denti viola entrano in contatto diretto con il sangue l'avversario. DIRETTO e SONNO sono due effetti, quindi come da regolamento solo uno può essere scelto. MAGICO può esser combinato con entrambi.Malus: il campanellino deve tintinnare, quindi Lyriel suonandolo tradirà la sua presenza.Il campanellino tutte le volte che viene suonato fa venire in mente Maia a Lyriel, quindi il giocatore dovrà scrivere una frase di almeno 3 parole per ricordare la bambina, ogni volta diversa, altrimenti l'evocazione non avrà esito. Personaggio PBF: WrenPN: 20/20PV:2/2PA:0Borsa Comune3 filoni di pane4 meleprosciuttoformaggiocoltello da cucina Link to comment Share on other sites More sharing options...
amivaleo Posted February 5, 2008 Share Posted February 5, 2008 non c'è solo un errore, ce n'è parecchi.per quanto riguarda quella riga, bisogna sostituire X con x (cioè usare lettere minuscole), nelle righe successive ci sono altre variabili maiuscole da sostituire con lettere minuscole.Poi darà un altro problema con un "else". non riesco a leggere bene lo script perchè non ci sono spazi prima delle righe e i commenti mi mandano in bestia. Quindi, spike, rivedi tu lo script. Link to comment Share on other sites More sharing options...
ProGM Posted February 5, 2008 Share Posted February 5, 2008 il problema è che non specifica che "in fondo a window base" significa "prima dell'ultimo end".incollate questo al posto di WIndow_Base, dovrebbe andare ^^ #============================================================================== # ** Window_Base #------------------------------------------------------------------------------ # This class is for all in-game windows. #============================================================================== class Window_Base < Window #-------------------------------------------------------------------------- # * Object Initialization # x : window x-coordinate # y : window y-coordinate # width : window width # height : window height #-------------------------------------------------------------------------- def initialize(x, y, width, height) super() @windowskin_name = $game_system.windowskin_name self.windowskin = RPG::Cache.windowskin(@windowskin_name) self.x = x self.y = y self.width = width self.height = height self.z = 100 end #-------------------------------------------------------------------------- # * Dispose #-------------------------------------------------------------------------- def dispose # Dispose if window contents bit map is set if self.contents != nil self.contents.dispose end super end #-------------------------------------------------------------------------- # * Get Text Color # n : text color number (0-7) #-------------------------------------------------------------------------- def text_color(n) case n when 0 return Color.new(255, 255, 255, 255) when 1 return Color.new(128, 128, 255, 255) when 2 return Color.new(255, 128, 128, 255) when 3 return Color.new(128, 255, 128, 255) when 4 return Color.new(128, 255, 255, 255) when 5 return Color.new(255, 128, 255, 255) when 6 return Color.new(255, 255, 128, 255) when 7 return Color.new(192, 192, 192, 255) else normal_color end end #-------------------------------------------------------------------------- # * Get Normal Text Color #-------------------------------------------------------------------------- def normal_color return Color.new(255, 255, 255, 255) end #-------------------------------------------------------------------------- # * Get Disabled Text Color #-------------------------------------------------------------------------- def disabled_color return Color.new(255, 255, 255, 128) end #-------------------------------------------------------------------------- # * Get System Text Color #-------------------------------------------------------------------------- def system_color return Color.new(192, 224, 255, 255) end #-------------------------------------------------------------------------- # * Get Crisis Text Color #-------------------------------------------------------------------------- def crisis_color return Color.new(255, 255, 64, 255) end #-------------------------------------------------------------------------- # * Get Knockout Text Color #-------------------------------------------------------------------------- def knockout_color return Color.new(255, 64, 0) end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super # Reset if windowskin was changed if $game_system.windowskin_name != @windowskin_name @windowskin_name = $game_system.windowskin_name self.windowskin = RPG::Cache.windowskin(@windowskin_name) end end #-------------------------------------------------------------------------- # * Draw Graphic # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate #-------------------------------------------------------------------------- def draw_actor_graphic(actor, x, y) bitmap = RPG::Cache.character(actor.character_name, actor.character_hue) cw = bitmap.width / 4 ch = bitmap.height / 4 src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect) end #-------------------------------------------------------------------------- # * Draw Name # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate #-------------------------------------------------------------------------- def draw_actor_name(actor, x, y) self.contents.font.color = normal_color self.contents.draw_text(x, y, 120, 32, actor.name) end #-------------------------------------------------------------------------- # * Draw Class # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate #-------------------------------------------------------------------------- def draw_actor_class(actor, x, y) self.contents.font.color = normal_color self.contents.draw_text(x, y, 236, 32, actor.class_name) end #-------------------------------------------------------------------------- # * Draw Level # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate #-------------------------------------------------------------------------- def draw_actor_level(actor, x, y) self.contents.font.color = system_color self.contents.draw_text(x, y, 32, 32, "Lv") self.contents.font.color = normal_color self.contents.draw_text(x + 32, y, 24, 32, actor.level.to_s, 2) end #-------------------------------------------------------------------------- # * Make State Text String for Drawing # actor : actor # width : draw spot width # need_normal : Whether or not [normal] is needed (true / false) #-------------------------------------------------------------------------- def make_battler_state_text(battler, width, need_normal) # Get width of brackets brackets_width = self.contents.text_size("[]").width # Make text string for state names text = "" for i in battler.states if $data_states[i].rating >= 1 if text == "" text = $data_states[i].name else new_text = text + "/" + $data_states[i].name text_width = self.contents.text_size(new_text).width if text_width > width - brackets_width break end text = new_text end end end # If text string for state names is empty, make it [normal] if text == "" if need_normal text = "[Normale]" end else # Attach brackets text = "[" + text + "]" end # Return completed text string return text end #-------------------------------------------------------------------------- # * Draw State # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate # width : draw spot width #-------------------------------------------------------------------------- def draw_actor_state(actor, x, y, width = 120) text = make_battler_state_text(actor, width, true) self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color self.contents.draw_text(x, y, width, 32, text) end #-------------------------------------------------------------------------- # * Draw EXP # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate #-------------------------------------------------------------------------- def draw_actor_exp(actor, x, y) self.contents.font.color = system_color self.contents.draw_text(x, y, 40, 32, "ESP") self.contents.font.color = normal_color self.contents.draw_text(x + 24, y, 84, 32, actor.exp_s, 2) self.contents.draw_text(x + 108, y, 12, 32, "/", 1) self.contents.draw_text(x + 120, y, 84, 32, actor.next_exp_s) end #-------------------------------------------------------------------------- # * Draw HP # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate # width : draw spot width #-------------------------------------------------------------------------- def draw_actor_hp(actor, x, y, width = 144) # Draw "HP" text string self.contents.font.color = system_color self.contents.draw_text(x, y, 32, 32, $data_system.words.hp) # Calculate if there is draw space for MaxHP if width - 32 >= 108 hp_x = x + width - 108 flag = true elsif width - 32 >= 48 hp_x = x + width - 48 flag = false end # Draw 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, 48, 32, actor.hp.to_s, 2) # Draw MaxHP if flag self.contents.font.color = normal_color self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1) self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s) end end #-------------------------------------------------------------------------- # * Draw SP # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate # width : draw spot width #-------------------------------------------------------------------------- def draw_actor_sp(actor, x, y, width = 144) # Draw "SP" text string self.contents.font.color = system_color self.contents.draw_text(x, y, 32, 32, $data_system.words.sp) # Calculate if there is draw space for MaxHP if width - 32 >= 108 sp_x = x + width - 108 flag = true elsif width - 32 >= 48 sp_x = x + width - 48 flag = false end # Draw 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, 48, 32, actor.sp.to_s, 2) # Draw MaxSP if flag self.contents.font.color = normal_color self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1) self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s) end end #-------------------------------------------------------------------------- # * Draw Parameter # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate # type : parameter type (0-6) #-------------------------------------------------------------------------- def draw_actor_parameter(actor, x, y, type) case type when 0 parameter_name = $data_system.words.atk parameter_value = actor.atk when 1 parameter_name = $data_system.words.pdef parameter_value = actor.pdef when 2 parameter_name = $data_system.words.mdef parameter_value = actor.mdef when 3 parameter_name = $data_system.words.str parameter_value = actor.str when 4 parameter_name = $data_system.words.dex parameter_value = actor.dex when 5 parameter_name = $data_system.words.agi parameter_value = actor.agi when 6 parameter_name = $data_system.words.int parameter_value = actor.int end self.contents.font.color = system_color self.contents.draw_text(x, y, 120, 32, parameter_name) self.contents.font.color = normal_color self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2) end #-------------------------------------------------------------------------- # * Draw Item Name # item : item # x : draw spot x-coordinate # y : draw spot y-coordinate #-------------------------------------------------------------------------- def draw_item_name(item, x, y) if item == nil return end bitmap = RPG::Cache.icon(item.icon_name) self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24)) self.contents.font.color = normal_color self.contents.draw_text(x + 28, y, 212, 32, item.name) end #--------------------------------- # By Krazplay #--------------------------------- def draw_actor_battler(actor, x, y) bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue) cw = bitmap.width ch = bitmap.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x - cw/2, y - ch/2, bitmap, src_rect) end #--------------------------------- # Def Draw line #--------------------------------- def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color) # ??????????????????? outdistance = (start_x - end_x).abs + (start_y - end_y).abs # ???? yew end_color == start_color for i in 1..distance x = (start_x + 1.0 * (end_x - start_x) * i/distance).to_i y = (start_y + 1.0 * (end_y - start_y) * i/distance).to_i if width == 1 self.set_pixel(x, y, start_color) else self.fill_rect(x, y, width, width, start_color) end end else for i in 1..distance x = (start_x + 1.0 * (end_x - start_x) * i/distance).to_i y = (start_y + 1.0 * (end_y - start_y) * i/distance).to_i r = start_color.red * (distance-i)/distance + end_color.red * i/distance g = start_color.green * (distance-i)/distance + end_color.green * i/distance b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance a = start_color.alpha has * (distance-i)/distance + end_color.alpha * i/distance if width == 1 self.set_pixel(x, y, Color.new(r, g, b, a)) else self.fill_rect(x, y, width, width, Color.new(r, g, b, a)) end end end #--------------------------------- # Def Draw polygon (to make contours of the faces) #--------------------------------- def draw_polygon(peaks, color, width = 1) # ?(=??)?????????? for i in 0... (peaks.size - 1) # ????????? draw_line(peaks[i][0 ], peaks[i][1 ], peaks[i+1][0 ], peaks[i+1][1 ], color, width) end # ?????????????? draw_line(peaks[peaks.size - 1][0 ], peaks[peaks.size - 1][1 ], peaks[0][0 ], peaks[0][1 ], color, width) end #--------------------------------- # def Draw face (faces to be strictly accurate ^^) #--------------------------------- def draw_facesquare(character_name, character_hue, x, y, size = 24) bitmap = RPG::Cache.character(character_name, character_hue) src_rect = Rect.new((bitmap.width/4 - size)/2, 0, size, size) self.blt(x, y, bitmap, src_rect) self.draw_polygon([[x, y], [x+size, y], [x+size, y+size], [x, y+size ] ], Color.new(255,255,255,128)) end end Progetti: http://i.imgur.com/jmLkIqi.pnghttp://i54.tinypic.com/2rh4ojq.pnghttps://github.com/ProGM Crea anche tu il tuo gioco per Game Boy! http://rpg2s.net/gif/SCContest3Oct.gifhttp://www.rpg2s.net/img/fablecontest1st.pnghttp://i43.tinypic.com/1zokd2s.png http://i.imgur.com/BEu6G.gifhttp://i.imgur.com/H1ARhq7.gifhttp://i.imgur.com/Af6ijZN.gifAOT: Associazione Odiamo la Telecom:http://i.imgur.com/aYJs89E.png"4 gattini... 4 stelline... E le 4 paperelle non ci stavano :3"Flame http://i30.tinypic.com/i27ypj.png Link to comment Share on other sites More sharing options...
Kenshin Posted February 5, 2008 Share Posted February 5, 2008 (edited) Grazie ProGM ^^Con la tua soluzione non mi da più errore Windows_Base, ma da troblemi Bars...Linea 34 ha una X maiuscola invece che minuscola:def draw_actor_hp(actor, x, y, width = 144)risolto quello, da problemi la riga 36... che non so correggere...yew actor.maxhp! = 0 Edited February 5, 2008 by Kenshin "Giochiamo a: schiettezza o grande impresa eroica!" Personaggio PBF: LyrielPN: 12/20PV: 2/2PA: 4 (5 col mantello d'acero)Equipaggiamento:Spada comunePugnale comuneArco elfico (magico, ignifugo. Permette di colpire da lunghe distanze. Se distrutto si auto-restaura a fine battaglia. Le frecce scoccate con questo arco ottengono l'effetto dell'incantesimo Folata di vento permettendo di spazzare via piccoli oggetti e creature.)Faretra con 20 frecceCappuccioArmatura delle ombre borchiata (punti armatura 4, ignifuga, di notte +1 a furtività)2 anelli di valoreBorsa comune (10 slot)CordaPenna e calamaioLibro vuotoForma di formaggioMappaCannocchialeTagliola di ferroCampanellino di MaiaMantello d'Acero (+1PA): un mantello pesante di colore rossiccio che presenta dei motivi fiochi, dello stesso colore, a forma di foglie d'acero. E' dotato di un ampio cappuccio e può coprire completamente chi lo indossa. Se si resta fermi in un'area boschiva o tra un gruppo di alberi il mantello è in grado di celare completamente la presenza del possessore dando un grado di furtività pari a gr.5. Nel caso di bestie ed animali dalla visuale meno acuta, se il giocatore è già stato notato od ha notificato in qualche modo la sua presenza può gettarsi a terra tra un gruppo di foglie o tra i cespugli per scomparire completamente dalla visuale di tali nemici.181 monete d'oroCintura porta coltelli (6 slot)Coltello da lancio intarsiatoColtello da lancio in metalloColtello da lancio in metallo Campanellino di MaiaSe Lyriel, e solo lui, suona tre volte il campanellino può richiamare una creatura magica che combatterà al suo fianco al prezzo di 3 PN.L'animale ha l'aspetto di un leopardo delle nevi, i suoi occhi sono viola e così gli artigli, i denti e la punta della coda. Questa è lunga e larga, molto folta e corposa. Il manto a differenza dei leopardi è tutto bianco, inoltre ha una folta criniera circolare intorno al collo a mo' di sciarpa e che si unisce con la sommità della fronte creando un cresta non molto alta pettinata all'indietro.La creatura combatte indipendentemente dal possessore (il giocatore potrà descriverne il comportamento in battaglia e fuori, ma il master potrà riservarsi il diritto di far compiere alla creatura delle azioni per conto proprio).La creatura non deve per forza stare vicino all'utilizzatore, ma può essere mandata lontano e tornare da lui su comando.Lyriel e l'animale hanno un contatto mentale e possono comunicare anche a distanza.Non vi è limite alla permanenza della creatura una volta evocata, però se i suoi PV raggiungono lo zero dovrà essere risvegliata magicamente da un mago od un curatore esperto. Lyriel può richiamare all'interno del campanellino la creatura quando essa non è impegnata in combattimento od in altre prove senza sforzi, ma dovrà spendere di nuovo 3 PN per richiamarla. Può continuare a combattere se Lyriel viene sconfitto.L'animale vede bene anche di notte e se c'è nebbia.Caratteristiche della creatura:PV 2PA 2Atletica Gr.4Furtività Gr.1Attacco (tipo descritto dal giocatore nei limiti fisici di artigli e morso) di massimo Gr.5 può dichiarare DIRETTO su armature di cuoio o cuoio borchiato e MAGICO con tutti gli attacchi. Può dichiarare SONNO se artigli e denti viola entrano in contatto diretto con il sangue l'avversario. DIRETTO e SONNO sono due effetti, quindi come da regolamento solo uno può essere scelto. MAGICO può esser combinato con entrambi.Malus: il campanellino deve tintinnare, quindi Lyriel suonandolo tradirà la sua presenza.Il campanellino tutte le volte che viene suonato fa venire in mente Maia a Lyriel, quindi il giocatore dovrà scrivere una frase di almeno 3 parole per ricordare la bambina, ogni volta diversa, altrimenti l'evocazione non avrà esito. Personaggio PBF: WrenPN: 20/20PV:2/2PA:0Borsa Comune3 filoni di pane4 meleprosciuttoformaggiocoltello da cucina Link to comment Share on other sites More sharing options...
maetel Posted April 3, 2008 Share Posted April 3, 2008 Grazie ProGM ^^Con la tua soluzione non mi da più errore Windows_Base, ma da troblemi Bars...Linea 34 ha una X maiuscola invece che minuscola:def draw_actor_hp(actor, x, y, width = 144)risolto quello, da problemi la riga 36... che non so correggere...yew actor.maxhp! = 0 La riga 36 non mi da piu' errore da quando ho tolto il punto esclamativo. yew actor.maxhp = 0 Ora pero' mi da errore sempre su Barsalla riga 123 dove risulta sritto semplicemente:else Questo non ho idea di come risolverlo... :rovatfl: Link to comment Share on other sites More sharing options...
friday666 Posted April 4, 2008 Share Posted April 4, 2008 Prova a cancellarlo oppure può essere perché ci manca un end... (\__/)(='.'=)(")_(")Questo è Bunny. Ho deciso di aiutarlo nella sua missione di conquista del mondo.Compagni di Bunny unitevi a me! http://img170.imageshack.us/img170/1858/pizzelartzzennm9.pngI chara da me postati: CLICCA QUI! PER XP - CLICCA QUI! PER XP(2) - CLICCA QUI! PER VX - CLICCA QUI! PER 2K/2K3!I tileset da me postati:CLICCA QUI! PER XPI Personaggi Completi da me postati: CLICCA QUI! PER XP I Face da me postati: CLICCA QUI! PER XPI Battlers da me postati: CLICCA QUI! PER XP!Le Windowskin da me postate: CLICCA QUI! PER XP!Risorse sonore da me postate: CLICCA QUI! PER SCARICARLE!Guida al Ruby: CLICCA QUI! PER SCARICARLA!Vi prego di inserirmi nei crediti...Grazie! Link to comment Share on other sites More sharing options...
maetel Posted April 4, 2008 Share Posted April 4, 2008 Prova a cancellarlo oppure può essere perché ci manca un end... Grazie per il consiglio! Bastava cancellarlo ora pero' mi da altro errore alla riga 190 :( when 1 Link to comment Share on other sites More sharing options...
friday666 Posted April 4, 2008 Share Posted April 4, 2008 when 0 parameter_name = $data_system.words.atk parameter_value = actor.atk when 1 parameter_name = $data_system.words.pdef parameter_value = actor.pdef when 2 parameter_name = $data_system.words.mdef parameter_value = actor.mdef when 3 parameter_name = $data_system.words.str parameter_value = actor.str when 4 parameter_name = $data_system.words.dex parameter_value = actor.dex when 5 parameter_name = $data_system.words.agi parameter_value = actor.agi when 6 parameter_name = $data_system.words.int parameter_value = actor.int end In questa parte?casomai prova ad aggiunger un # davanti (\__/)(='.'=)(")_(")Questo è Bunny. Ho deciso di aiutarlo nella sua missione di conquista del mondo.Compagni di Bunny unitevi a me! http://img170.imageshack.us/img170/1858/pizzelartzzennm9.pngI chara da me postati: CLICCA QUI! PER XP - CLICCA QUI! PER XP(2) - CLICCA QUI! PER VX - CLICCA QUI! PER 2K/2K3!I tileset da me postati:CLICCA QUI! PER XPI Personaggi Completi da me postati: CLICCA QUI! PER XP I Face da me postati: CLICCA QUI! PER XPI Battlers da me postati: CLICCA QUI! PER XP!Le Windowskin da me postate: CLICCA QUI! PER XP!Risorse sonore da me postate: CLICCA QUI! PER SCARICARLE!Guida al Ruby: CLICCA QUI! PER SCARICARLA!Vi prego di inserirmi nei crediti...Grazie! Link to comment Share on other sites More sharing options...
maetel Posted April 4, 2008 Share Posted April 4, 2008 In questa sempre su Bars: #-------------------------------------------------------------------------- #? ½ ƒQ?[ƒW' Ì•`‰æ #-------------------------------------------------------------------------- def gauge_rect(x, y, rect_width, width, height, gauge, align1, align2, align3, color1, color2, color3, color4, color5, color6, grade1, grade2) put align1 when 1 X + = (rect_width - width)/2 when 2 X + = rect_width - width end put align2 when 1 y - = height/2 when 2 y - = height end # ˜g•`‰æ self.contents.fill_rect(x, y, width, height, color1) self.contents.fill_rect(x + 1, y + 1, width - 2, height - 2, color2) yew align3 == 0 yew grade1 == 2 grade1 = 3 end yew grade2 == 2 grade2 = 3 end end yew (align3 == 1 and grade1 == 0) gold grade1 > 0 color = color3 color3 = color4 color4 = color end yew (align3 == 1 and grade2 == 0) gold grade2 > 0 color = color5 color5 = color6 color6 = color end # ‹óƒQ?[ƒW' Ì•`‰æ self.contents.gradation_rect(x + 2, y + 2, width - 4, height - 4, color3, color4, grade1) yew align3 == 1 X + = width - gauge end # ' ÀƒQ?[ƒW' Ì•`‰æ self.contents.gradation_rect(x + 2, y + 2, gauge - 4, height - 4, color5, color6, grade2) end end Link to comment Share on other sites More sharing options...
friday666 Posted April 4, 2008 Share Posted April 4, 2008 when 1 # ??? Prova cosi... se non funziona posta ancora... (\__/)(='.'=)(")_(")Questo è Bunny. Ho deciso di aiutarlo nella sua missione di conquista del mondo.Compagni di Bunny unitevi a me! http://img170.imageshack.us/img170/1858/pizzelartzzennm9.pngI chara da me postati: CLICCA QUI! PER XP - CLICCA QUI! PER XP(2) - CLICCA QUI! PER VX - CLICCA QUI! PER 2K/2K3!I tileset da me postati:CLICCA QUI! PER XPI Personaggi Completi da me postati: CLICCA QUI! PER XP I Face da me postati: CLICCA QUI! PER XPI Battlers da me postati: CLICCA QUI! PER XP!Le Windowskin da me postate: CLICCA QUI! PER XP!Risorse sonore da me postate: CLICCA QUI! PER SCARICARLE!Guida al Ruby: CLICCA QUI! PER SCARICARLA!Vi prego di inserirmi nei crediti...Grazie! Link to comment Share on other sites More sharing options...
maetel Posted April 4, 2008 Share Posted April 4, 2008 when 1 # ??? Prova cosi... se non funziona posta ancora... Ok questo me lo ha risolto mettendo :case put align1when 1 Ora pero' non gli piace: X + = (rect_width - width)/2alla riga 191...Ho anche provato a mettere la "x" minuscola ma non va ugualmente ç__ç Ora provo anche col tuo consiglio,grazie,sei gentilissimo :)EDIT Non va neppure mettendo quelo che mi hai detto ç_çla riga 191 continua a non piacergli... Link to comment Share on other sites More sharing options...
friday666 Posted April 4, 2008 Share Posted April 4, 2008 x + == (rect_width - width)/2 prova cosi... (\__/)(='.'=)(")_(")Questo è Bunny. Ho deciso di aiutarlo nella sua missione di conquista del mondo.Compagni di Bunny unitevi a me! http://img170.imageshack.us/img170/1858/pizzelartzzennm9.pngI chara da me postati: CLICCA QUI! PER XP - CLICCA QUI! PER XP(2) - CLICCA QUI! PER VX - CLICCA QUI! PER 2K/2K3!I tileset da me postati:CLICCA QUI! PER XPI Personaggi Completi da me postati: CLICCA QUI! PER XP I Face da me postati: CLICCA QUI! PER XPI Battlers da me postati: CLICCA QUI! PER XP!Le Windowskin da me postate: CLICCA QUI! PER XP!Risorse sonore da me postate: CLICCA QUI! PER SCARICARLE!Guida al Ruby: CLICCA QUI! PER SCARICARLA!Vi prego di inserirmi nei crediti...Grazie! Link to comment Share on other sites More sharing options...
maetel Posted April 4, 2008 Share Posted April 4, 2008 x + == (rect_width - width)/2 prova cosi... Continua a dare errore anche così...ç_çLe sto provando tutte... :( Link to comment Share on other sites More sharing options...
friday666 Posted April 4, 2008 Share Posted April 4, 2008 prova così x + = rect_width - width o così x + == rect_width - width ...speriamo... (\__/)(='.'=)(")_(")Questo è Bunny. Ho deciso di aiutarlo nella sua missione di conquista del mondo.Compagni di Bunny unitevi a me! http://img170.imageshack.us/img170/1858/pizzelartzzennm9.pngI chara da me postati: CLICCA QUI! PER XP - CLICCA QUI! PER XP(2) - CLICCA QUI! PER VX - CLICCA QUI! PER 2K/2K3!I tileset da me postati:CLICCA QUI! PER XPI Personaggi Completi da me postati: CLICCA QUI! PER XP I Face da me postati: CLICCA QUI! PER XPI Battlers da me postati: CLICCA QUI! PER XP!Le Windowskin da me postate: CLICCA QUI! PER XP!Risorse sonore da me postate: CLICCA QUI! PER SCARICARLE!Guida al Ruby: CLICCA QUI! PER SCARICARLA!Vi prego di inserirmi nei crediti...Grazie! Link to comment Share on other sites More sharing options...
maetel Posted April 4, 2008 Share Posted April 4, 2008 prova così x + = rect_width - width o così x + == rect_width - width ...speriamo...Ancora errore... ç__çComincio a chiedermi se esiste la soluzione Link to comment Share on other sites More sharing options...
friday666 Posted April 4, 2008 Share Posted April 4, 2008 L unica cosa che rimane e procedere a tentativi...prova a togliere il +... Ma prima di tutto prova a mettere # all inizio della linea...lasciando il resto come in origine...certo che sto script è fatto maluccio...prova prima con #...e fammi sapere come va'... (\__/)(='.'=)(")_(")Questo è Bunny. Ho deciso di aiutarlo nella sua missione di conquista del mondo.Compagni di Bunny unitevi a me! http://img170.imageshack.us/img170/1858/pizzelartzzennm9.pngI chara da me postati: CLICCA QUI! PER XP - CLICCA QUI! PER XP(2) - CLICCA QUI! PER VX - CLICCA QUI! PER 2K/2K3!I tileset da me postati:CLICCA QUI! PER XPI Personaggi Completi da me postati: CLICCA QUI! PER XP I Face da me postati: CLICCA QUI! PER XPI Battlers da me postati: CLICCA QUI! PER XP!Le Windowskin da me postate: CLICCA QUI! PER XP!Risorse sonore da me postate: CLICCA QUI! PER SCARICARLE!Guida al Ruby: CLICCA QUI! PER SCARICARLA!Vi prego di inserirmi nei crediti...Grazie! Link to comment Share on other sites More sharing options...
maetel Posted April 4, 2008 Share Posted April 4, 2008 L unica cosa che rimane e procedere a tentativi...prova a togliere il +... Ma prima di tutto prova a mettere # all inizio della linea...lasciando il resto come in origine...certo che sto script è fatto maluccio...prova prima con #...e fammi sapere come va'...Grande!!! Cos' si risolve ma non e' finita qui XDOra da errore alla riga 210dove ci sono scritti due endHo provato a toglierlo e nulla,ne ho aggiunto uno e nulla...Ho provato a metterne anche 3 di end ma nulla...Vorrei strozzare chi lo ha fatto ma saro' buona XDAdesso e' diventata una questione di testardaggine;Voglio che funzioni!!! Ecco la parte in questione: # ˜g•`‰æ self.contents.fill_rect(x, y, width, height, color1) self.contents.fill_rect(x + 1, y + 1, width - 2, height - 2, color2) yew align3 == 0 yew grade1 == 2 grade1 = 3 end yew grade2 == 2 grade2 = 3 end end yew (align3 == 1 and grade1 == 0) gold grade1 > 0 color = color3 color3 = color4 color4 = color end yew (align3 == 1 and grade2 == 0) gold grade2 > 0 color = color5 color5 = color6 color6 = color end # ‹óƒQ?[ƒW' Ì•`‰æ self.contents.gradation_rect(x + 2, y + 2, width - 4, height - 4, color3, color4, grade1) yew align3 == 1 X + = width - gauge end # ' ÀƒQ?[ƒW' Ì•`‰æ self.contents.gradation_rect(x + 2, y + 2, gauge - 4, height - 4, color5, color6, grade2) end end Link to comment Share on other sites More sharing options...
friday666 Posted April 4, 2008 Share Posted April 4, 2008 Dai piano piano ci riusciremo! Ti posso chiedere di postare la parte di script? Sai sono collegato tramite cell e non riesco a trovare bene le linee che dici...scusa... (\__/)(='.'=)(")_(")Questo è Bunny. Ho deciso di aiutarlo nella sua missione di conquista del mondo.Compagni di Bunny unitevi a me! http://img170.imageshack.us/img170/1858/pizzelartzzennm9.pngI chara da me postati: CLICCA QUI! PER XP - CLICCA QUI! PER XP(2) - CLICCA QUI! PER VX - CLICCA QUI! PER 2K/2K3!I tileset da me postati:CLICCA QUI! PER XPI Personaggi Completi da me postati: CLICCA QUI! PER XP I Face da me postati: CLICCA QUI! PER XPI Battlers da me postati: CLICCA QUI! PER XP!Le Windowskin da me postate: CLICCA QUI! PER XP!Risorse sonore da me postate: CLICCA QUI! PER SCARICARLE!Guida al Ruby: CLICCA QUI! PER SCARICARLA!Vi prego di inserirmi nei crediti...Grazie! Link to comment Share on other sites More sharing options...
maetel Posted April 4, 2008 Share Posted April 4, 2008 Dai piano piano ci riusciremo! Ti posso chiedere di postare la parte di script? Sai sono collegato tramite cell e non riesco a trovare bene le linee che dici...scusa...Tranquillo faccio subito ;) Allora ho risolto il problema del'end Ora il problema lo da alla riga 247 for I in x... x + width Ecco la parte del codice :) #-------------------------------------------------------------------------- #? ½ ‹é¼`' ðƒOƒ‰ƒf?[ƒVƒ‡ƒ"•\' ¦ # color1: ƒXƒ^?[ƒgƒJƒ‰?[ # color2: ƒGƒ"ƒhƒJƒ‰?[ # align: 0:‰¡' ɃOƒ‰ƒf?[ƒVƒ‡ƒ " # 1:?c' ɃOƒ‰ƒf?[ƒVƒ‡ƒ " # 2:' Î' ss' ɃOƒ‰ƒf?[ƒVƒ‡ƒ"?i¼ƒ?d' É' Â' "'?ˆÓ?j #-------------------------------------------------------------------------- def gradation_rect(x, y, width, height, color1, color2, align = 0) yew align == 0 for I in x... x + width red = color1.red + (color2.red - color1.red) * (I - X)/(width - 1) green = color1.green + (color2.green - color1.green) * (I - X)/(width - 1) blue = color1.blue + (color2.blue - color1.blue) * (I - X)/(width - 1) alpha = color1.alpha + (color2.alpha - color1.alpha) * (I - X)/(width - 1) color = Color.new(red, green, blue, alpha) fill_rect(i, y, 1, height, color) end elsif align == 1 for I in y... y + height red = color1.red + (color2.red - color1.red) * (I - y)/(height - 1) green = color1.green + (color2.green - color1.green) * (I - y)/(height - 1) blue = color1.blue + (color2.blue - color1.blue) * (I - y)/(height - 1) alpha = color1.alpha + (color2.alpha - color1.alpha) * (i - y) / (height - 1) color = Color.new(red, green, blue, alpha) fill_rect(x, i, width, 1, color) end elsif align == 2 for i in x...x + width for j in y...y + height red = color1.red + (color2.red - color1.red) * ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 green = color1.green + (color2.green - color1.green) * ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 blue = color1.blue + (color2.blue - color1.blue) * ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 alpha = color1.alpha + (color2.alpha - color1.alpha) * ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 color = Color.new(red, green, blue, alpha) set_pixel(i, j, color) end end elsif align == 3 for i in x...x + width for j in y...y + height red = color1.red + (color2.red - color1.red) * ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 green = color1.green + (color2.green - color1.green) * ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 blue = color1.blue + (color2.blue - color1.blue) * ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 alpha = color1.alpha + (color2.alpha - color1.alpha) * ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 color = Color.new(red, green, blue, alpha) set_pixel(i, j, color) end end end end end EDIT Ok risolto con # for I in x... x + width Ora c'e' dinuovo il rpblema dell'end...Ce ne sono 5 di fila nella riga 302 ,vedo se togliendo e aggiungendo va ^^ EDIT 2 Allora ne ho tolti due e ci siamo...Fin qui Ora il problema sta alla riga 65 (sempre su Bars) color5 = Color.new(80 - 24 * misses, 80 * misses, 14 * misses, 192) Di questa parte del codice (lo metto sotto spoiler se no il post e' kilometrico #============================================================================== #? ¡ Window_Base #------------------------------------------------------------------------------ #?@ƒQ?[ƒ¤' †' Ì'·' ×' Ä' ̃EƒBƒ"ƒhƒE' ̃X?[ƒp?[ƒNƒ‰ƒX' Å'·?B #============================================================================== class Window_Base < Window #-------------------------------------------------------------------------- #? ½ HP ƒQ?[ƒW' Ì•`‰æ #-------------------------------------------------------------------------- # ƒIƒ¦ƒWƒiƒ‹' ÌHP•`‰æ' ð draw_actor_hp_original ' Æ-¼' O•Ï?X alias:draw_actor_hp_original:draw_actor_hp def draw_actor_hp(actor, x, y, width = 144) # •Ï?"rate' 3rd ¼"?Ý' ÌHP/MHP' ð' ã"ü yew actor.maxhp = 0 miss = actor.hp.to_f/actor.maxhp else miss = 0 end # plus_x:X?À•W' ̈Ê' u•â?³ rate_x:X?À•W' ̈Ê' u•â?³(%) plus_y:Y?À•W' ̈Ê' u•â?³ # plus_width:•?' Ì•â?³ rate_width:•?' Ì•â?³(%) height:?c•? # align1:•`‰æƒ^ƒCƒv1 0:?¶‹l' ss 1:' †‰›' µ' ¦ 2:‰E‹l' ss # align2:•`‰æƒ^ƒCƒv2 0:?ã‹l' ss 1:' †‰›' µ' ¦ 2:‰º‹l' ss # align3:ƒQ?[ƒWƒ^ƒCƒv 0:?¶‹l' ss 1:‰E‹l' ss plus_x = 0 rate_x = 0 plus_y = 25 plus_width = 0 rate_width = 100 height = 10 align1 = 1 align2 = 2 align3 = 0 # ƒOƒ‰ƒf?[ƒVƒ‡ƒ"?Ý' 2nd grade1:‹óƒQ?[ƒW grade2:' ÀƒQ?[ƒW # (0:‰¡' ɃOƒ‰ƒf?[ƒVƒ‡ƒ "1:?c' ɃOƒ‰ƒf?[ƒVƒ‡ƒ" 2:' Î' ss' ɃOƒ‰ƒf?[ƒVƒ‡ƒ"(¼ƒ?d)?j grade1 = 1 grade2 = 0 #?F?Ý' è?Bcolor1:¦O˜g?Ccolor2:' †˜g # color3:‹óƒQ?[ƒWƒ_?[ƒNƒJƒ‰?[?Ccolor4:‹óƒQ?[ƒWƒ‰ƒCƒgƒJƒ‰?[ # color5:' ÀƒQ?[ƒWƒ_?[ƒNƒJƒ‰?[?Ccolor6:' ÀƒQ?[ƒWƒ‰ƒCƒgƒJƒ‰?[ color1 = Color.new(0, 0, 0, 192) color2 = Color.new(255, 255, 192, 192) color3 = Color.new(0, 0, 0, 192) color4 = Color.new(64, 0, 0, 192) color5 = Color.new(80 - 24 * misses, 80 * misses, 14 * misses, 192) color6 = Color.new(240 - 72 * misses, 240 * misses, 62 * misses, 192) # •Ï?"hp' É•`‰æ '·' éƒQ?[ƒW' Ì•?' ð' ã"ü yew actor.maxhp = 0 HP = (width + plus_width) * actor.hp * rate_width/100/actor.maxhp else HP = 0 end # ƒQ?[ƒW' Ì•`‰æ gauge_rect(x + plus_x + width * rate_x/100, y + plus_y, width, plus_width + width * rate_width/100, height, HP, align1, align2, align3, color1, color2, color3, color4, color5, color6, grade1, grade2) # ƒIƒ¦ƒWƒiƒ‹' ÌHP•`‰æ?ˆ --?' ð¼Ä' Ñ?o' µ def draw_actor_hp(actor, x, y, width) end Link to comment Share on other sites More sharing options...
friday666 Posted April 4, 2008 Share Posted April 4, 2008 Prova aggiungendo la virgola in questo modo: 80, -24 (\__/)(='.'=)(")_(")Questo è Bunny. Ho deciso di aiutarlo nella sua missione di conquista del mondo.Compagni di Bunny unitevi a me! http://img170.imageshack.us/img170/1858/pizzelartzzennm9.pngI chara da me postati: CLICCA QUI! PER XP - CLICCA QUI! PER XP(2) - CLICCA QUI! PER VX - CLICCA QUI! PER 2K/2K3!I tileset da me postati:CLICCA QUI! PER XPI Personaggi Completi da me postati: CLICCA QUI! PER XP I Face da me postati: CLICCA QUI! PER XPI Battlers da me postati: CLICCA QUI! PER XP!Le Windowskin da me postate: CLICCA QUI! PER XP!Risorse sonore da me postate: CLICCA QUI! PER SCARICARLE!Guida al Ruby: CLICCA QUI! PER SCARICARLA!Vi prego di inserirmi nei crediti...Grazie! Link to comment Share on other sites More sharing options...
maetel Posted April 4, 2008 Share Posted April 4, 2008 Prova aggiungendo la virgola in questo modo: 80, -24Fatto e ci siamo! **Ora il problema e' alla riga 443 cioe' la fine dove ci sono 4 EndEcco il codice: #============================================================================== # ?¡ Spriteƒ‚ƒWƒ…?[ƒ‹ #------------------------------------------------------------------------------ # ?@ƒAƒjƒ??[ƒVƒ‡ƒ“‚̦Ǘ?‚ð?s‚¤ƒ‚ƒWƒ…?[ƒ‹‚Å‚·?B #============================================================================== # 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, "CRITICAL", 1) bitmap.draw_text(+1, -1, 160, 20, "CRITICAL", 1) bitmap.draw_text(-1, +1, 160, 20, "CRITICAL", 1) bitmap.draw_text(+1, +1, 160, 20, "CRITICAL", 1) bitmap.font.color.set(255, 255, 255) bitmap.draw_text(0, 0, 160, 20, "CRITICAL", 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 Pare che se tolgo il penultimo end (appunto la riga 443) non gli va a genio la riga 444 con l'ultimo endAllora ho tolto anche quello ma mi da errore alla riga 443 che a questo punto,resterebbe vuota avendo tolto gli ultimi due end... Link to comment Share on other sites More sharing options...
marigno Posted April 4, 2008 Share Posted April 4, 2008 Prova a cancellare gli utlimi tre 'end'. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now