| Artisan (Nv 5) |
 |
Inscrit le: 22 Nov 2011, 22:01 Messages: 199 Niveau RPG Maker: Moyen Logiciel(s) préféré(s): RPG Maker XP Point(s) Fort(s): Scripts Sexe: Masculin Points d'aide: 17/60
Créations :
Voir ses créations
|
Oups j'ai oublié un truc... 2 minutes Edit:
- Code: Tout sélectionner
#============================================================================== # ■ Module Config # ---------------------- # Auteur: Bad_Maker #============================================================================== module Config FOND = "001-Title01" # Nom d'une image se trouvant dans le dossier Title OPACITE_FENETRE = 125 # Transparence des fenêtres POSITION_Y_ELEMENTS = 0 # Positions y des éléments TAILLE_TEXTE = 18 # Taille des textes POLICE_TEXTE = "Arial" # Police utilisée pour les textes # ------------------------------------------------- # ICI SE TROUVENT LES FUSIONS A CONFIGURER # FUSION[numéro de la fusion] = [a,b,c,d,e,f] # a : monstre pour la fusion # b : monstre pour la fusion # c : monstre obtenu après la fusion # d : toujours mettre false # e : niveau minimum du monstre 1 # f : niveau minimum du monstre 2 # ------------------------------------------------- FUSION = [] FUSION[0] = [1, 2, 3, false, 1, 1] FUSION[1] = [1, 3, 4, false, 1, 1] FUSION[2] = [2, 3, 5, false, 1, 1] FUSION[3] = [1, 4, 6, false, 1, 1] FUSION[4] = [4, 6, 7, false, 1, 1] # ------------------------------------------------- # ICI ON PEUT MODIFIER LES TEXTES # ------------------------------------------------- TEXTE1 = "Pas assez de monstres pour une fusion" TEXTE2 = "Aucune fusion n'est possible" TEXTE3 = "Choisir le premier monstre à fusionner" TEXTE4 = "Choisir le second monstre à fusionner" TEXTE5 = "Ce monstre ne peut pas être fusionné" TEXTE6 = "Fusion non existente" TEXTE7 = "Le monstre résultant de cette fusion est déjà dans l'équipe" TEXTE8 = "Êtes-vous sûr de vouloir fusionner ces monstres?" TEXTE9 = "La fusion a été effectuée avec succès" # ------------------------------------------------- end
#============================================================================== # ● Window_SelectCharasLeft # ---------------------- # Auteur: Bad_Maker #============================================================================== class Window_SelectCharasLeft < Window_Selectable def initialize(items, y) height = 168 if items == 2 height = 246 if items == 3 height = 328 if items == 4 super(0, y, 288, height) self.contents = Bitmap.new(288-64, height-32) self.opacity = Config::OPACITE_FENETRE self.contents.font.name = Config::POLICE_TEXTE self.contents.font.size = Config::TAILLE_TEXTE @item_max = items self.index = 0 self.visible = false self.active = false refresh end def refresh self.contents.clear y = 48 for actor in $game_party.actors self.draw_actor_facesets(actor, 32, y) self.draw_actor_name(actor, 64, y-48) self.draw_actor_class(actor, 64, y-24) self.draw_actor_level(actor, 160, y-48) y += 80 end end def update_cursor_rect if @index < 0 ; self.cursor_rect.empty ; return ; end if @index >= 0 y = 0 y += 80 if @index == 1 y += 80*2 if @index == 2 y += 80*3 if @index == 3 self.cursor_rect.set(0, y, 256, 56) end end end
#============================================================================== # ● Window_SelectCharasRight # ---------------------- # Auteur: Bad_Maker #============================================================================== class Window_SelectCharasRight < Window_Selectable def initialize(items, y) height = 168 if items == 2 height = 246 if items == 3 height = 328 if items == 4 super(0, y, 288, height) self.contents = Bitmap.new(288-64, height-32) self.opacity = Config::OPACITE_FENETRE self.contents.font.name = Config::POLICE_TEXTE self.contents.font.size = Config::TAILLE_TEXTE @item_max = items self.index = 0 self.visible = false self.active = false refresh end def refresh self.contents.clear y = 48 for actor in $game_party.actors self.draw_actor_facesets(actor, 32, y) self.draw_actor_name(actor, 64, y-48) self.draw_actor_class(actor, 64, y-24) self.draw_actor_level(actor, 160, y-48) y += 80 end end def update_cursor_rect if @index < 0 ; self.cursor_rect.empty ; return ; end if @index >= 0 y = 0 y += 80 if @index == 1 y += 80*2 if @index == 2 y += 80*3 if @index == 3 self.cursor_rect.set(0, y, 256, 56) end end end
#============================================================================== # ● Window_TransformedMonster # ---------------------- # Auteur: Bad_Maker #============================================================================== class Window_TransformedMonster < Window_Base def initialize super(0, 0, 136, 196) self.contents = Bitmap.new(136-32, 136-32) self.opacity = Config::OPACITE_FENETRE self.contents.font.name = Config::POLICE_TEXTE self.contents.font.size = Config::TAILLE_TEXTE self.visible = false refresh end def refresh end end
#============================================================================== # ■ Scene_FusionCharas # ---------------------- # Auteur: Bad_Maker #============================================================================== class Scene_FusionCharas def initialize(map=false, menu=true) @map = map @menu = menu end def main @fond_ecran = Sprite.new @fond_ecran.bitmap = RPG::Cache.title(Config::FOND) nombre_de_monstres definir_les_fusions fusion_possible? creer_fenetres unless @party_size @help_window.set_text(Config::TEXTE1) @quitter_scene = true else if @fusionspossibles == 0 @help_window.set_text(Config::TEXTE2) @quitter_scene = true end end if @party_size if @fusionspossibles > 0 @help_window.set_text(Config::TEXTE3) @left_window.active = true @left_window.visible = true end end Graphics.transition loop do Graphics.update Input.update update break if $scene != self end Graphics.freeze @help_window.dispose @left_window.dispose @right_window.dispose @main_window.dispose @decision_window.dispose @fond_ecran.dispose end def nombre_de_monstres @party_size = false @party_size = true if $game_party.actors.size > 1 end def definir_les_fusions @fusion = Config::FUSION end def fusion_possible? @fusionspossibles = 0 for i in 0..@fusion.size-1 for actors in 0..$game_party.actors.size-1 if @fusion[i][0] == $game_party.actors[actors].id if @fusion[i][4] <= $game_party.actors[actors].level for actors in 0..$game_party.actors.size-1 if @fusion[i][1] == $game_party.actors[actors].id if @fusion[i][5] <= $game_party.actors[actors].level value = false for t in 0..$game_party.actors.size-1 value = true if @fusion[i][2] == $game_party.actors[t].id end unless value @fusion[i][3] = true @fusionspossibles += 1 end end end end end end end end end def creer_fenetres @help_window = Window_Help.new @help_window.y = Config::POSITION_Y_ELEMENTS @help_window.opacity = Config::OPACITE_FENETRE @help_window.contents.font.name = Config::POLICE_TEXTE @help_window.contents.font.size = Config::TAILLE_TEXTE y = @help_window.y + @help_window.height @left_window = Window_SelectCharasLeft.new($game_party.actors.size, y) @right_window = Window_SelectCharasRight.new($game_party.actors.size, y) @right_window.x = 640-@right_window.width @main_window = Window_TransformedMonster.new @main_window.x = 320 - @main_window.width/2 @main_window.y = 240 - @main_window.height/2 @decision_window = Window_Command.new(80, ["Oui", "Non"]) @decision_window.active = false @decision_window.visible = false @decision_window.x = 320-@decision_window.width/2 @decision_window.y = @main_window.y+@main_window.height @decision_window.opacity = Config::OPACITE_FENETRE @decision_window.contents.font.name = Config::POLICE_TEXTE @decision_window.contents.font.size = Config::TAILLE_TEXTE end def update return_scene if @quitter_scene == true update_leftwindow if @left_window.active == true update_rightwindow if @right_window.active == true update_mainwindow if @main_window.visible == true end def update_leftwindow @left_window.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @quitter_scene = true Input.update end if Input.trigger?(Input::C) element_de_la_fusion_left? if @element1 == true $game_system.se_play($data_system.decision_se) @help_window.set_text(Config::TEXTE4) @left_window.active = false @right_window.active = true @right_window.visible = true Input.update else $game_system.se_play($data_system.buzzer_se) @help_window.set_text(Config::TEXTE5) end end end def update_rightwindow @right_window.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @help_window.set_text(Config::TEXTE3) @right_window.active = false @right_window.visible = false @left_window.active = true @left_window.visible = true Input.update end if Input.trigger?(Input::C) element_de_la_fusion_right? if @element2 == true $game_system.se_play($data_system.decision_se) @help_window.set_text(Config::TEXTE8) @left_window.visible = false @right_window.active = false @right_window.visible = false @main_window.visible = true @decision_window.active = true @decision_window.visible = true draw_main_window Input.update else $game_system.se_play($data_system.buzzer_se) @help_window.set_text(Config::TEXTE6) @help_window.set_text(Config::TEXTE7)if @monster_in_team end end end def update_mainwindow @main_window.update @decision_window.update if Input.trigger?(Input::C) if @decision_window.index == 0 $game_system.se_play($data_system.decision_se) @help_window.set_text(Config::TEXTE9) change_monsters Input.update return_scene elsif @decision_window.index == 1 $game_system.se_play($data_system.cancel_se) @help_window.set_text(Config::TEXTE4) @main_window.visible = false @decision_window.active = false @decision_window.visible = false @left_window.visible = true @right_window.active = true @right_window.visible = true Input.update end end if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @help_window.set_text(Config::TEXTE4) @main_window.visible = false @decision_window.active = false @decision_window.visible = false @left_window.visible = true @right_window.active = true @right_window.visible = true Input.update end end def element_de_la_fusion_left? @element1 = false for i in 0..@fusion.size-1 if @fusion[i][3] == true if $game_party.actors[@left_window.index].id == @fusion[i][0] @element1 = true end end end end def element_de_la_fusion_right? @element2 = false @monster_in_team = false unless @left_window.index == @right_window.index for i in 0..@fusion.size-1 if @fusion[i][0] == $game_party.actors[@left_window.index].id if @fusion[i][1] == $game_party.actors[@right_window.index].id value = false for j in 0..$game_party.actors.size-1 if @fusion[i][2] == $game_party.actors[j].id @monster_in_team = true value = true end end unless value @element2 = true end end end end end end def draw_main_window @main_window.contents.clear for i in 0..@fusion.size-1 if @fusion[i][0] == $game_party.actors[@left_window.index].id if @fusion[i][1] == $game_party.actors[@right_window.index].id @monster1 = @fusion[i][0] @monster2 = @fusion[i][1] @new_monster = @fusion[i][2] end end end @main_window.draw_actor_name($game_actors[@new_monster], 0, 0) @main_window.draw_actor_class($game_actors[@new_monster], 0, 24) @main_window.draw_actor_facesets($game_actors[@new_monster], 16, 104) end def change_monsters $game_party.remove_actor(@monster1) $game_party.remove_actor(@monster2) $game_party.add_actor(@new_monster) end def return_scene 60.times do ; Graphics.update ; end $scene = Scene_Map.new if @map $scene = Scene_Menu.new(4) if @menu end end def fusionner_monstres $game_system.se_play($data_system.decision_se) $scene = Scene_FusionCharas.new(true, false) end
_________________
--- Bad_maker ---
Dernière édition par Bad_maker le 04 Fév 2012, 18:00, édité 2 fois au total.
|
|