Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Advanced Direction Fix v. 1.1
- # VX Ace version
- # by mikb89
- # Dettagli:
- # Questo script permette di utilizzare la direzione fissa con le sole direzioni
- # stabilite. Gli altri eroi del caterpillar avranno le stesse direzioni fisse.
- # Via chiama script si possono inserire le istruzioni su quale direzione
- # bloccare o sbloccare.
- # fix_right farà in modo che la grafica di destra non si veda.
- # no_fix_down sbloccherà quella in giù (se era bloccata).
- # Metto giusto questi a titolo di esempio, per operare con sinistra e su
- # chiaramente basta sostituire right o down con left per sinistra e up per su.
- # In ogni caso attivando l'opzione sottostante si possono avere i comandi in
- # italiano, molto più comodi, probabilmente ^^
- #
- # Attenzione: questo script sovrascrive la direzione fissa standard. Vale a
- # dire, attivarla equivale a chiamare fix_ per tutte le direzioni
- # e disattivarla vale come un no_fix_.
- # Configurazioni:
- module FIDIR
- COMANDI_ITA = true
- # Permette di avere i comandi in italiano come fix_dx, fix_giu, no_fix_giu
- end
- #Codename: fidir
- ($imported ||= {})[:mikb89_fidir] = true
- # License:
- # - You can ask me to include support for other scripts as long as these scripts
- # use the $imported[script] = true;
- # - You can modify and even repost my scripts, after having received a response
- # by me. For reposting it, anyway, you must have done heavy edit or porting,
- # you can't do a post with the script as is;
- # - You can use my scripts for whatever you want, from free to open to
- # commercial games. I'd appreciate by the way if you let me know about what
- # you're doing;
- # - You must credit me, if you use this script or part of it.
- class Game_Player < Game_Character
- attr_accessor :fidirs
- alias_method(:init_b4_fidir, :initialize) unless method_defined?(:init_b4_fidir)
- def initialize
- init_b4_fidir
- @fidirs = []
- end
- alias_method(:mv_strait_b4_fidir, :move_straight) unless method_defined?(:mv_strait_b4_fidir)
- def move_straight(d, turn_ok = true)
- @direction_fix = true if @fidirs.include?(d)
- mv_strait_b4_fidir(d, turn_ok)
- @direction_fix = false if @fidirs.include?(d)
- end
- if method_defined?(:process_move_command)
- alias_method(:proc_mv_cmd_b4_fidir, :process_move_command) unless method_defined?(:proc_mv_cmd_b4_fidir)
- end
- def process_move_command(command)
- if command.code == ROUTE_DIR_FIX_ON
- @fidirs = [2, 4, 6, 8]
- elsif command.code == ROUTE_DIR_FIX_OFF
- @fidirs.clear
- else
- if respond_to?(:proc_mv_cmd_b4_fidir)
- proc_mv_cmd_b4_fidir(command)
- else
- super
- end
- end
- end
- end
- class Game_Follower < Game_Character
- if method_defined?(:move_straight)
- alias_method(:mv_straitGF_b4_fidir, :move_straight) unless method_defined?(:mv_straitGF_b4_fidir)
- end
- def move_straight(d, turn_ok = true)
- @direction_fix = true if $game_player.fidirs.include?(d)
- if respond_to?(:mv_straitGF_b4_fidir)
- mv_straitGF_b4_fidir(d, turn_ok)
- else
- super
- end
- @direction_fix = false if $game_player.fidirs.include?(d)
- end
- end
- class Game_Interpreter
- def fix_dir(m)
- $game_player.fidirs << m
- $game_player.fidirs.uniq!
- end
- def no_fix_dir(m)
- $game_player.fidirs.delete(m)
- $game_player.fidirs.uniq!
- end
- def fix_right
- fix_dir(6)
- end
- def fix_left
- fix_dir(4)
- end
- def fix_up
- fix_dir(8)
- end
- def fix_down
- fix_dir(2)
- end
- def no_fix_right
- no_fix_dir(6)
- end
- def no_fix_left
- no_fix_dir(4)
- end
- def no_fix_up
- no_fix_dir(8)
- end
- def no_fix_down
- no_fix_dir(2)
- end
- if FIDIR::COMANDI_ITA
- def fix_dx
- fix_dir(6)
- end
- def fix_sx
- fix_dir(4)
- end
- def fix_su
- fix_dir(8)
- end
- def fix_giu
- fix_dir(2)
- end
- def no_fix_dx
- no_fix_dir(6)
- end
- def no_fix_sx
- no_fix_dir(4)
- end
- def no_fix_su
- no_fix_dir(8)
- end
- def no_fix_giu
- no_fix_dir(2)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment