Habitant Lv.6
Age : 34 Inscrit le : 04/12/2009 Messages : 125
| Sujet: [VX] Animal Lun 15 Fév 2010 - 7:57 | |
| Version : 1.3 Auteur :OriginalWij. Améliorations : v1.3 * L' animal peux ne pas se joindre à l'équipe * L' animal peux ne pas apparaître dans le menu * L' animal peut être présent ou non via un switch définit par vous même * L' animal peux se battre tout seul (IA) quand il y a moins de 4 personnes dans l'équipe * L' animal peut se soigner tout seul après un combat * Le game over intervient si le seul survivant est l' animalScript :- Spoiler:
- Code:
-
#============================================================================== # Pet #============================================================================== # Author : OriginalWij # Version : 1.3 #==============================================================================
#============================================================================== # v1.0 # - Initial release # v1.1 # - Added options to have pet in battle (auto-battle only) # v1.2 # - Won't show pet if in vehicle # v1.3 # - Added option to allow gameover if only the pet survives battle #==============================================================================
#============================================================================== # Config #==============================================================================
module OW_PET # Pet enable switch number PET_ENABLE_SWITCH = 1 # Pet ID (database actor number) [IMPORTANT: MUST be set to 'Auto-Battle'] PET_ID = 5 # Use pet in battle? PET_BATTLE = true # Heal pet after each battle? (if above = true) PET_HEAL = true # Allow game-over if the pet is the ONLY party member alive PET_GAMEOVER = true end
#============================================================================== # Game_Character #==============================================================================
class Game_Character #-------------------------------------------------------------------------- # Public instance variables (New) #-------------------------------------------------------------------------- attr_accessor :priority_type end
#============================================================================== # Game_Player #==============================================================================
class Game_Player #-------------------------------------------------------------------------- # Public instance variables (New) #-------------------------------------------------------------------------- attr_reader :move_speed #-------------------------------------------------------------------------- # Update (Mod) #-------------------------------------------------------------------------- alias ow_pet_game_player_update update unless $@ def update $game_party.update_pet ow_pet_game_player_update end #-------------------------------------------------------------------------- # Move to (Mod) #-------------------------------------------------------------------------- alias ow_pet_game_player_moveto moveto unless $@ def moveto(x, y) $game_party.moveto_pet(x, y) ow_pet_game_player_moveto(x, y) end #-------------------------------------------------------------------------- # Move down (Mod) #-------------------------------------------------------------------------- alias ow_pet_game_player_move_down move_down unless $@ def move_down(turn = true) if passable?(@x, @y + 1) $game_party.move_pet(2, turn) end ow_pet_game_player_move_down(turn) end #-------------------------------------------------------------------------- # Move left (Mod) #-------------------------------------------------------------------------- alias ow_pet_game_player_move_left move_left unless $@ def move_left(turn = true) if passable?(@x - 1, @y) $game_party.move_pet(4, turn) end ow_pet_game_player_move_left(turn) end #-------------------------------------------------------------------------- # Move right (Mod) #-------------------------------------------------------------------------- alias ow_pet_game_player_move_right move_right unless $@ def move_right(turn = true) if passable?(@x + 1, @y) $game_party.move_pet(6, turn) end ow_pet_game_player_move_right(turn) end #-------------------------------------------------------------------------- # Move up (Mod) #-------------------------------------------------------------------------- alias ow_pet_game_player_move_up move_up unless $@ def move_up(turn = true) if passable?(@x, @y - 1) $game_party.move_pet(8, turn) end ow_pet_game_player_move_up(turn) end #-------------------------------------------------------------------------- # Move down left (Mod) #-------------------------------------------------------------------------- alias ow_pet_game_playermove_lower_left move_lower_left unless $@ def move_lower_left if passable?(@x - 1, @y + 1) $game_party.move_pet(1) end ow_pet_game_playermove_lower_left end #-------------------------------------------------------------------------- # Move down right (Mod) #-------------------------------------------------------------------------- alias ow_pet_game_playermove_lower_right move_lower_right unless $@ def move_lower_right if passable?(@x + 1, @y + 1) $game_party.move_pet(3) end ow_pet_game_playermove_lower_right end #-------------------------------------------------------------------------- # Move up left (Mod) #-------------------------------------------------------------------------- alias ow_pet_game_player_move_upper_left move_upper_left unless $@ def move_upper_left if passable?(@x - 1, @y - 1) $game_party.move_pet(5) end ow_pet_game_player_move_upper_left end #-------------------------------------------------------------------------- # Move up right (Mod) #-------------------------------------------------------------------------- alias ow_pet_game_player_move_upper_right move_upper_right unless $@ def move_upper_right if passable?(@x + 1, @y - 1) $game_party.move_pet(7) end ow_pet_game_player_move_upper_right end #-------------------------------------------------------------------------- # Jump (Mod) #-------------------------------------------------------------------------- alias ow_pet_game_player_jump jump unless $@ def jump(ow_pet_x, ow_pet_y) new_x = @x + ow_pet_x new_y = @y + ow_pet_y if (ow_pet_x == 0 and ow_pet_y == 0) or passable?(new_x, new_y) $game_party.move_pet(9, [ow_pet_x, ow_pet_y]) end ow_pet_game_player_jump(ow_pet_x, ow_pet_y) end end
#============================================================================== # Game_Party #==============================================================================
class Game_Party #-------------------------------------------------------------------------- # Include (New) #-------------------------------------------------------------------------- include OW_PET #-------------------------------------------------------------------------- # Public instance variables (New) #-------------------------------------------------------------------------- attr_reader :pet #-------------------------------------------------------------------------- # Initialize (Mod) #-------------------------------------------------------------------------- alias ow_pet_game_party_initialize initialize unless $@ def initialize ow_pet_game_party_initialize @pet = Game_Pet.new(nil) @move_pet = [] end #-------------------------------------------------------------------------- # Update pet (New) #-------------------------------------------------------------------------- def update_pet @pet.actor = PET_ID @pet.move_speed = $game_player.move_speed if $game_player.dash? @pet.move_speed += 1 end @pet.update @pet.transparent = !$game_switches[PET_ENABLE_SWITCH] @pet.transparent = true if $game_player.in_vehicle? end #-------------------------------------------------------------------------- # Determine Everyone is Dead (Mod) #-------------------------------------------------------------------------- alias ow_pet_game_party_all_dead? all_dead? unless $@ def all_dead? if $game_switches[PET_ENABLE_SWITCH] and PET_GAMEOVER and $game_temp.in_battle and existing_members == [$game_actors[PET_ID]] return true end ow_pet_game_party_all_dead? end #-------------------------------------------------------------------------- # Move to (pet) (New) #-------------------------------------------------------------------------- def moveto_pet(x, y) @pet.moveto(x, y) @move_pet.clear end #-------------------------------------------------------------------------- # Move pet (New) #-------------------------------------------------------------------------- def move_pet(type, turn = false) if @move_pet == nil @move_pet = [type, turn] do_type = 0 else do_type = @move_pet[0] do_turn = @move_pet[1] @move_pet = [type, turn] end case do_type when 1 @pet.move_lower_left when 2 @pet.move_down(do_turn) when 3 @pet.move_lower_right when 4 @pet.move_left(do_turn) when 5 @pet.move_upper_left when 6 @pet.move_right(do_turn) when 7 @pet.move_upper_right when 8 @pet.move_up(do_turn) when 9 @pet.jump(do_turn[0], do_turn[1]) end end end
#============================================================================== # Game_Pet (New) #==============================================================================
class Game_Pet < Game_Character #-------------------------------------------------------------------------- # Public instance variables #-------------------------------------------------------------------------- attr_reader :actor attr_accessor :move_speed #-------------------------------------------------------------------------- # Initialize #-------------------------------------------------------------------------- def initialize(actor) super() @through = true @actor = actor end #-------------------------------------------------------------------------- # Set actor #-------------------------------------------------------------------------- def actor=(actor) @actor = actor setup end #-------------------------------------------------------------------------- # Setup #-------------------------------------------------------------------------- def setup if @actor != nil @character_name = $game_actors[@actor].character_name @character_index = $game_actors[@actor].character_index else @character_name = "" @character_index = 0 end @priority_type = $game_player.priority_type end #-------------------------------------------------------------------------- # Get screen Z #-------------------------------------------------------------------------- def screen_z if $game_player.x == @x and $game_player.y == @y return $game_player.screen_z - 1 end super end #-------------------------------------------------------------------------- # Chek event trigger (here) #-------------------------------------------------------------------------- def check_event_trigger_here(triggers) return false end #-------------------------------------------------------------------------- # Check event trigger (there) #-------------------------------------------------------------------------- def check_event_trigger_there(triggers) return false end #-------------------------------------------------------------------------- # Check event trigger (touch) #-------------------------------------------------------------------------- def check_event_trigger_touch(x, y) return false end #-------------------------------------------------------------------------- # Jump #-------------------------------------------------------------------------- def jump(x, y) super(x, y) end end
#============================================================================== # Spriteset_Map #==============================================================================
class Spriteset_Map #-------------------------------------------------------------------------- # Create characters (Mod) #-------------------------------------------------------------------------- alias ow_pet_spriteset_map_create_characters create_characters unless $@ def create_characters ow_pet_spriteset_map_create_characters @character_sprites << Sprite_Character.new(@viewport1, $game_party.pet) end end
#============================================================================== # Scene_Battle #==============================================================================
class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # Include (New) #-------------------------------------------------------------------------- include OW_PET #-------------------------------------------------------------------------- # Start (Mod) #-------------------------------------------------------------------------- alias ow_pet_scene_battle_start start unless $@ def start if $game_party.members.size < 4 and $game_switches[PET_ENABLE_SWITCH] and PET_BATTLE $game_party.add_actor(PET_ID) end ow_pet_scene_battle_start end #-------------------------------------------------------------------------- # End battle (Mod) #-------------------------------------------------------------------------- alias ow_pet_scene_battle_battle_end battle_end unless $@ def battle_end(result) $game_party.remove_actor(PET_ID) ow_pet_scene_battle_battle_end(result) $game_actors[PET_ID].recover_all if PET_HEAL end end
Configurations :- Spoiler:
# interrupteur permettant d'activer votre animal PET_ENABLE_SWITCH = 1
# Actor id de l'animal dans la base de données [IMPORTANT: mettre en 'Auto-Battle'] PET_ID = 5
# Utiliser l'animal en bataille ? PET_BATTLE = true
# Soigner l'animal aprés chaque bataille ? PET_HEAL = true
# Doit on faire gameover si l'animal est le seul membre restant de l'equipe ? PET_GAMEOVER = true Screenshot :- Spoiler:
Crédit :OriginalWij. |
|
Age : 33 Inscrit le : 27/06/2008 Messages : 10881
| Sujet: Re: [VX] Animal Lun 15 Fév 2010 - 9:49 | |
| Ca gère ! Par contre, niveau compatibilité ? Par exemple, ça marche avec le PHS, etc ? +1 en participation, Merci du partage |
|
Habitant Lv.6
Age : 34 Inscrit le : 04/12/2009 Messages : 125
| Sujet: Re: [VX] Animal Lun 15 Fév 2010 - 10:12 | |
| ^^ Merci Matsuo, j'utilise le PHS, le SBS 3.3d, l'ATB 1.1f et tout fonctionne bien . Il est normalement compatible avec la plupart des systèmes de combats. |
|
Poulet Lv.1
Inscrit le : 19/08/2011 Messages : 7
| Sujet: Re: [VX] Animal Lun 22 Aoû 2011 - 13:41 | |
| il est compatible avec le system abs ? |
|
Habitant Lv.6
Inscrit le : 02/09/2011 Messages : 115
| Sujet: Re: [VX] Animal Lun 5 Sep 2011 - 17:57 | |
| Bonjour, Il est super ce script . Mais est-ce que tu pourrais faire que l'on puisse équipée son animal . En script je ne suis pas un pro ! (pour les illettrés) pas mais !!! |
|