deadcell Trouvère Follet
Nombre de messages : 625 Age : 35 Niveau Rpg Maker : Excellent Niveau Jeux Préférés : Final Fantasy, Resident evil... Date d'inscription : 21/03/2007
| Sujet: Auto Combat Ven 06 Juil 2007, 23:37 | |
| Ce script vous permet d'ajouter l'option auto-combat qui fait combattre vos personages automatiquement comme dans rpg maker 2000/2003. - Auteur : Thousand Dragoon Link et Sir_KnightDragoonCommentaires # par Thousand Dragoon Link- Screen : - Installation : Créez un script au-dessus de Main appellez-le "Auto_Battle". Puis collez ce code : - Code:
-
#============================================================================== # ■ Auto_Battle #------------------------------------------------------------------------------ # Edited from default scripts by Thousand Dragoon Link and Sir_KnightDragoon # Comments by Thousand Dragoon Link #============================================================================== class Scene_Battle #-------------------------------------------------------------------------- # ● Renewal of a frame (party command phase) #-------------------------------------------------------------------------- def update_phase2 if Input.trigger?(Input::C) case @party_command_window.index when 0 # Fight # Determine if a SE is performed. $game_system.se_play($data_system.decision_se) start_phase3 when 1 # Escape. # escape is not possible if $game_temp.battle_can_escape == false $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) update_phase2_escape when 2 # Auto-Battle $game_system.se_play($data_system.decision_se) update_phase2_auto end return end end #-------------------------------------------------------------------------- # Renewal of a frame (party command phase : auto) #-------------------------------------------------------------------------- def update_phase2_auto loop do if @actor_index == $game_party.actors.size-1 start_phase4 return end @actor_index += 1 $game_party.actors[@actor_index].current_action.kind = 0 $game_party.actors[@actor_index].current_action.basic = 0 $game_party.actors[@actor_index].current_action.decide_random_target_for_actor end end end
class Window_PartyCommand < Window_Selectable #-------------------------------------------------------------------------- # object initialization #-------------------------------------------------------------------------- def initialize super(0, 0, 640, 64) self.contents = Bitmap.new(width - 32, height - 32) self.back_opacity = 160 self.contents.font.name = $fontface self.contents.font.size = $fontsize #Change the commands to what you want them to say @commands = ["Combat", "Fuite", "Auto-Combat"] @item_max = 3 @column_max = 3 draw_item(0, normal_color) draw_item(1, $game_temp.battle_can_escape ? normal_color : disabled_color) draw_item(2, normal_color) self.active = false self.visible = false self.index = 0 end #-------------------------------------------------------------------------- def draw_item(index, color) self.contents.font.color = color rect = Rect.new(80 + index * 160 + 4, 0, 128 - 10, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) self.contents.draw_text(rect, @commands[index], 1) end #-------------------------------------------------------------------------- # Renewal of the rectangle cursor #-------------------------------------------------------------------------- def update_cursor_rect self.cursor_rect.set(80 + index * 160, 0, 128, 32) end end | |
|
Don Estebahn Maître du Savoir
Nombre de messages : 2145 Age : 33 Jeux Préférés : Soul Reaver, Morrowind, Way of the Samurai Date d'inscription : 18/02/2007
| Sujet: Re: Auto Combat Lun 09 Juil 2007, 15:43 | |
| Arf, l'option de Rpg Maker 2000 que j'étais content d'avoir laissée derrière moi en téléchargeant XP . Enfin, même si je ne l'aime pas tellement, je reconnaît que ça peut parfois avoir de l'intérêt (admettons si on veut rapidement faire du Level Up), et que l'avoir dans son projet peut apporter une petite touche d'originalité par rapport aux autres productions. Bref, en tout cas joli script bien présenté comme toujours. Merci à toi . | |
|