| Ancien membre du staff |
 |
 |
Inscrit le: 11 Aoû 2006, 00:00 Messages: 1428 Niveau RPG Maker: IT'S OVER 9000!!! Logiciel(s) préféré(s): RMXP/VX Point(s) Fort(s): Scripts Sexe: Masculin Points d'aide: 26/60
Créations :
Voir ses créations
|
Bonjour tous le monde! Je vous offre un petit script de menu que j'ai trouvé je ne sais plus où... (Il me semblait que c'était sur ce forum, mais je ne retrouve plus le post en question...) Ce scripts permet d'avoir plein de héros en même temps! (Il est actuellement parametrer pour 20 héros, mais vous pouvez monter à l'infini!) En combat, seul les 4 premiers héros combattent, mais vous pouvez changer l'ordre des héros hors combats, donc c'est bon. J'ai un peu modifier le script, au passage. Il n'y avait pas de son lorsqu'on selectionnait les héros que l'on voulait inverser dans le menu, et il y avait un leger bug dans les battlers affichés (ils devaient à l'origine avoir le même nom que le character). Et zou, un screen! (issue de mon jeu)  (Pour le dragon jaune, il s'agit d'un autre perso se trouvant sur une ligne en dessous.) Tout le code suivant, et ceux des posts suivant, ne forment QU'UN SEUL script. Nommée-le "Game_Party". - Code: Tout sélectionner
#=================================# # Traduction par masterjojo. # Modifié par Sihn #=================================#
#============================================================================== # ¦ Game_Party #==============================================================================
class Game_Party #-------------------------------------------------------------------------- # ? define instance variable #-------------------------------------------------------------------------- attr_accessor :actors #-------------------------------------------------------------------------- # Vous pouvez changer le nombre rouge par celui de votre # choix: c'est le nombre max de personne pouvant integrer # votre équipe (par défaut: 20). #-------------------------------------------------------------------------- def add_actor(actor_id) actor = $game_actors[actor_id] if @actors.size < 20 and not @actors.include?(actor) @actors.push(actor) $game_player.refresh end end end
#============================================================================== # ¦ Window_Base #==============================================================================
class Window_Base < Window #-------------------------------------------------------------------------- # ? draw character's battle sprite #-------------------------------------------------------------------------- def draw_actor_battlegraphic(actor, x, y, opacity = 255) bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue) src_rect = Rect.new(0, 0, 111, 111) self.contents.blt(x, y, bitmap, src_rect, opacity) end #-------------------------------------------------------------------------- # ? draw character's HP meter #-------------------------------------------------------------------------- def draw_actor_hp_meter(actor, x, y, width = 70, type = 0) if type == 1 and actor.hp == 0 return end self.contents.font.color = system_color self.contents.fill_rect(x-1, y+27, width+2,5, Color.new(0, 0, 0, 255)) w = width * actor.hp / actor.maxhp self.contents.fill_rect(x, y+28, w,1, Color.new(174, 68, 89, 255)) self.contents.fill_rect(x, y+29, w,1, Color.new(156, 61, 80, 255)) self.contents.fill_rect(x, y+30, w,1, Color.new(138, 53, 70, 255)) end #-------------------------------------------------------------------------- # ? draw character's SP meter #-------------------------------------------------------------------------- def draw_actor_sp_meter(actor, x, y, width = 70, type = 0) if type == 1 and actor.sp == 0 return end self.contents.font.color = system_color self.contents.fill_rect(x-1, y+27, width+2,5, Color.new(0, 0, 0, 255)) w = width * actor.sp / actor.maxsp self.contents.fill_rect(x, y+28, w,1, Color.new(62, 72, 164, 255)) self.contents.fill_rect(x, y+29, w,1, Color.new(55, 65, 149, 255)) self.contents.fill_rect(x, y+30, w,1, Color.new(49, 57, 130, 255)) end #-------------------------------------------------------------------------- # ? define method to draw squares #-------------------------------------------------------------------------- def draw_square(x, y, width, color) self.contents.fill_rect(x, y, width, 1, color) self.contents.fill_rect(x, y, 1, width, color) self.contents.fill_rect(x + width, y, 1, width + 1, color) self.contents.fill_rect(x, y + width, width + 1, 1, color) end end
#============================================================================== # ¦ Window_Gold #------------------------------------------------------------------------------ # le texte a été remplacé par une icone #==============================================================================
class Window_Gold < Window_Base #-------------------------------------------------------------------------- # ? initialize #-------------------------------------------------------------------------- def initialize super(0, 0, 160, 64) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize refresh end #-------------------------------------------------------------------------- # ? refresh #-------------------------------------------------------------------------- def refresh self.contents.clear cx = 24 self.contents.font.color = normal_color self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 2) self.contents.font.color = system_color bitmap = RPG::Cache.icon("032-Item01") rect = Rect.new(0, 0, 24, 24) self.contents.blt(124-cx, 0, bitmap, rect) end end
#============================================================================== # ¦ Window_PlayTime #------------------------------------------------------------------------------ # cette fenêtre a été compacté pour montrer toutes les commandes dans le menu #==============================================================================
class Window_PlayTime < Window_Base #-------------------------------------------------------------------------- # ? initialize #-------------------------------------------------------------------------- def initialize super(0, 0, 160, 64) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize refresh end #-------------------------------------------------------------------------- # ? refresh #-------------------------------------------------------------------------- def refresh self.contents.clear @total_sec = Graphics.frame_count / Graphics.frame_rate hour = @total_sec / 60 / 60 min = @total_sec / 60 % 60 sec = @total_sec % 60 text = sprintf("%02d:%02d:%02d", hour, min, sec) self.contents.font.color = normal_color self.contents.draw_text(4, 0, 120, 32, text, 2) end #-------------------------------------------------------------------------- # ? redefine update method #-------------------------------------------------------------------------- def update super if Graphics.frame_count / Graphics.frame_rate != @total_sec refresh end end end
#============================================================================== # ¦ Window_MenuStatus #==============================================================================
class Window_MenuStatus < Window_Selectable #-------------------------------------------------------------------------- # ? initialize #-------------------------------------------------------------------------- def initialize super(0, 0, 480, 480) @column_max = 4 @item_max = $game_party.actors.size self.contents = Bitmap.new(width - 32, row_max * 112) self.contents.font.name = $fontface self.contents.font.size = $fontsize/1.2 refresh self.active = false self.index = -1 end
_________________
 - Scripteur à la retraite -
|
|