Razzan Grand prophète
Nombre de messages : 246 Age : 38 Localisation : Nord Dunkerque Date d'inscription : 24/06/2007
Fueille de participation Niveau: 4 points d'Exp: (30/250)
| Sujet: Re: Menu bestiaire Sam 1 Déc - 16:03 | |
| - Code:
-
#============================== # ■ Window_details_monstre v2 par Krazplay #------------------------------ #Permet de créer une fenêtre avec les détails d'un ennemi #============================== class Window_details_monstre < Window_Base
def initialize(monstre_id) super(5, 5, 630, 470) self.contents = Bitmap.new(width-32, height-32) self.contents.font.name = "Arial" self.contents.clear draw_actor_battler($data_enemies[monstre_id], 215, 220) self.contents.font.size = 29 self.contents.font.color = Color.new(255, 155, 155, 255) monster_name_width = contents.text_size($data_enemies[monstre_id].name).width self.contents.draw_text(300 - (monster_name_width / 2), 0, 500, 32, $data_enemies[monstre_id].name) self.contents.font.size = 24 self.contents.font.color = normal_color self.contents.draw_text(50, 30, 300, 32, "HP : " + $data_enemies[monstre_id].maxhp.to_s) self.contents.draw_text(50, 55, 300, 32, "SP : " + $data_enemies[monstre_id].maxsp.to_s) self.contents.draw_text(400, 50, 300, 32, "Attaque :") self.contents.draw_text(550, 50, 300, 32, $data_enemies[monstre_id].atk.to_s) self.contents.draw_text(400, 80, 300, 32, "Déf physique :") self.contents.draw_text(550, 80, 300, 32, $data_enemies[monstre_id].pdef.to_s) self.contents.draw_text(400, 110, 300, 32, "Déf magique :") self.contents.draw_text(550, 110, 300, 32, $data_enemies[monstre_id].mdef.to_s) self.contents.draw_text(400, 140, 300, 32, "Force :") self.contents.draw_text(550, 140, 300, 32, $data_enemies[monstre_id].str.to_s) self.contents.draw_text(400, 170, 300, 32, "Dextérité :") self.contents.draw_text(550, 170, 300, 32, $data_enemies[monstre_id].dex.to_s) self.contents.draw_text(400, 200, 300, 32, "Agilité :") self.contents.draw_text(550, 200, 300, 32, $data_enemies[monstre_id].agi.to_s) self.contents.draw_text(400, 230, 300, 32, "Intelligence :") self.contents.draw_text(550, 230, 300, 32, $data_enemies[monstre_id].int.to_s) self.contents.draw_text(10, 360, 300, 30, "Expérience : " + $data_enemies[monstre_id].exp.to_s) self.contents.draw_text(10, 385, 300, 30, "Argent : " + $data_enemies[monstre_id].gold.to_s) self.contents.draw_text(10, 410, 300, 30, "Objet détenu : ")
if $data_enemies[monstre_id].weapon_id != 0 bitmap = RPG::Cache.icon($data_weapons[$data_enemies[monstre_id].weapon_id].icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(150, 410+4, bitmap, Rect.new(0, 0, 24, 24), opacity) #Icône self.contents.draw_text(150+30, 410, 212, 32, $data_weapons[$data_enemies[monstre_id].weapon_id].name, 0) #nom self.contents.draw_text(430, 410, 300, 30, $data_enemies[monstre_id].treasure_prob.to_s + " %") end if $data_enemies[monstre_id].armor_id != 0 bitmap = RPG::Cache.icon($data_armors[$data_enemies[monstre_id].armor_id].icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(150, 410+4, bitmap, Rect.new(0, 0, 24, 24), opacity) #Icône self.contents.draw_text(150+30, 410, 212, 32, $data_armors[$data_enemies[monstre_id].armor_id].name, 0) #nom self.contents.draw_text(430, 410, 300, 30, $data_enemies[monstre_id].treasure_prob.to_s + " %") end if $data_enemies[monstre_id].item_id != 0 bitmap = RPG::Cache.icon($data_items[$data_enemies[monstre_id].item_id].icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(150, 410+4, bitmap, Rect.new(0, 0, 24, 24), opacity) #Icône self.contents.draw_text(150+30, 410, 212, 32, $data_items[$data_enemies[monstre_id].item_id].name, 0) #nom self.contents.draw_text(430, 410, 300, 30, $data_enemies[monstre_id].treasure_prob.to_s + " %") end self.draw_enemy_element_radar_graph($data_enemies[monstre_id], 400, 270, radius = 30) end #def initialize end
#============================== # ■ Window_Monstres v2 par Krazplay #------------------------------ #Permet de créer une fenêtre avec le nom de tout les ennemis tués et combien de #fois ils ont été tués. #============================== class Window_Monstres < Window_Base
def initialize(page, ligne) @nomspardefaut = true @active = 1 @page = page @ligne = ligne #Taille du cadre que l'on voie, mais dont on ne peut pas écrire dessus : super(0, 0, 640, 480) #Image invisible où l'on va pouvoir écrire dessus : self.contents = Bitmap.new(width-32, height-32) self.contents.font.name = "Arial" self.contents.font.size = 24 self.contents.clear self.contents.draw_text(20, 0, 500, 32, "Noms des monstres :") self.contents.draw_text(400, 0, 500, 32, "Nombres tués :") #Call'aile du canard de la dernière page : @dernierepage = Integer($data_enemies.size / 15) + 1 @derniereligne = Integer($data_enemies.size % 15) - 1 refresh end #def initialize
def refresh self.contents.draw_text(240, 420, 500, 32, "Page " + (@page+1).to_s + " / " + @dernierepage.to_s) self.cursor_rect.set(0, (40 + 26*@ligne), 580, 27) m = 1 if @page == @dernierepage - 1 monstremoins = 15 - (($data_enemies.size - 1) % 15) else monstremoins = 0 end for i in (1 + 15*@page)...(16 + 15*@page - monstremoins) if $game_variables[4000 + i] != 0 or @nomspardefaut == true self.contents.draw_text(20, (26 * m) + 15, 500, 26, $data_enemies[i].name) else self.contents.draw_text(20, (26 * m) + 15, 500, 26, "Ennemi inconnu") end self.contents.draw_text(470, (26 * m) + 15, 500, 26, $game_variables[4000 + i].to_s) m += 1 end end #end refresh def pageplusun if @page < @dernierepage -1 @page += 1 end if @ligne > @derniereligne -1 and @page == @dernierepage -1 @ligne = @derniereligne -1 end end def pagemoinsun if @page > 0 @page -= 1 end end def ligneplusun if @ligne > 0 @ligne -= 1 end end def lignemoinsun if @ligne < 14 unless @ligne >= @derniereligne -1 and @page == @dernierepage -1 @ligne += 1 end end end def selection return (@ligne+1) + (@page*15) end def nettoyage self.contents.clear self.contents.draw_text(20, 0, 500, 32, "Noms des monstres :") self.contents.draw_text(400, 0, 500, 32, "Nombres tués :") end def active? return @active end def inactive @active=0 return [@page,@ligne] end end #class Window_Monstres
#------------------------------ # ● draw_actor_battler de Krazplay # Dessine le battler de l'acteur aux coordonnées x,y # L'acteur peut aussi bien être un monstre qu'un personnage #------------------------------ class Window_Base < Window 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 end
#============================== # Graphic_Def_Elem #============================== class Window_Base FONT_SIZE = 18 WORD_ELEMENT_GUARD = "Déf. Elémentale" NUMBER_OF_ELEMENTS = 8 ELEMENT_ORDER = [1,3,8,5,2,4,7,6] GRAPH_SCALINE_COLOR = Color.new(255, 255, 255, 128) GRAPH_SCALINE_COLOR_SHADOW = Color.new( 0, 0, 0, 192) GRAPH_LINE_COLOR = Color.new(255, 255, 64, 255) GRAPH_LINE_COLOR_MINUS = Color.new( 64, 255, 255, 255) GRAPH_LINE_COLOR_PLUS = Color.new(255, 64, 64, 255) end #============================== # �¡ Window_Status #============================== class Window_Base #------------------------------ def draw_enemy_element_radar_graph(enemy, x, y, radius = 56) cx = x + radius + FONT_SIZE + 48 cy = y + radius + FONT_SIZE + 32 self.contents.font.color = system_color #self.contents.draw_text(x, y, 104, 32, WORD_ELEMENT_GUARD) for loop_i in 0..NUMBER_OF_ELEMENTS if loop_i == 0
else @pre_x = @now_x @pre_y = @now_y @pre_ex = @now_ex @pre_ey = @now_ey @color1 = @color2 end if loop_i == NUMBER_OF_ELEMENTS eo = ELEMENT_ORDER[0] else eo = ELEMENT_ORDER[loop_i] end er = element_pourcent(enemy, eo) estr = $data_system.elements[eo] @color2 = er < 0 ? GRAPH_LINE_COLOR_MINUS : er > 100 ? GRAPH_LINE_COLOR_PLUS : GRAPH_LINE_COLOR th = Math::PI * (0.5 - 2.0 * loop_i / NUMBER_OF_ELEMENTS) @now_x = cx + (radius * Math.cos(th)).floor @now_y = cy - (radius * Math.sin(th)).floor @now_wx = cx + ((radius+FONT_SIZE*2/2) * Math.cos(th)).floor - FONT_SIZE @now_wy = cy - ((radius+FONT_SIZE*1/2) * Math.sin(th)).floor - FONT_SIZE/2 @now_vx = cx + ((radius+FONT_SIZE*6/2) * Math.cos(th)).floor - FONT_SIZE @now_vy = cy - ((radius+FONT_SIZE*3/2) * Math.sin(th)).floor - FONT_SIZE/2 @now_ex = cx + (er.abs*radius/100 * Math.cos(th)).floor @now_ey = cy - (er.abs*radius/100 * Math.sin(th)).floor if loop_i == 0 @pre_x = @now_x @pre_y = @now_y @pre_ex = @now_ex @pre_ey = @now_ey @color1 = @color2 else
end next if loop_i == 0 self.contents.draw_line(cx+1,cy+1, @now_x+1,@now_y+1, GRAPH_SCALINE_COLOR_SHADOW) self.contents.draw_line(@pre_x+1,@pre_y+1, @now_x+1,@now_y+1, GRAPH_SCALINE_COLOR_SHADOW) self.contents.draw_line(cx,cy, @now_x,@now_y, GRAPH_SCALINE_COLOR) self.contents.draw_line(@pre_x,@pre_y, @now_x,@now_y, GRAPH_SCALINE_COLOR) self.contents.draw_line(@pre_ex,@pre_ey, @now_ex,@now_ey, @color1, 2, @color2) self.contents.font.size = FONT_SIZE self.contents.font.color = system_color self.contents.draw_text(@now_wx,@now_wy, FONT_SIZE*2, FONT_SIZE, estr, 1) self.contents.font.color = Color.new(255,255,255,128) self.contents.draw_text(@now_vx,@now_vy, FONT_SIZE*2, FONT_SIZE, er.to_s + "%", 2) end end #end
#------------------------------ # ● 属性補正値の取得 # element_id : 属性 ID #------------------------------ def element_pourcent(enemy, element_id) table = [0,200,150,100,50,0,-100] return table[enemy.element_ranks[element_id]] end end #============================== # �¸ ¦O�����C�u���¦ #============================== class Bitmap 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.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 * (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 end end Ouvrez le script "Scene_Battle 2" et allez cherchez la ligne 147, il y a ceci : - Code:
-
unless enemy.hidden Rajoutez juste en dessous : - Code:
-
# Ajout pour la liste des monstres de Krazplay $game_variables[4000 + enemy.id] += 1 | |
|