Advertisement
Trihan

HorrorVale - Disable enemy appear message

Jul 28th, 2023 (edited)
1,597
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.59 KB | Source Code | 0 0
  1. #-------------------------------------------------------------------------------
  2. # Don't remove this header!
  3. #-------------------------------------------------------------------------------
  4. # Disable Enemy Appear
  5. # by Trihan
  6. #
  7. # Version: 1.2
  8. #
  9. # This script is commissioned by Batworks Software.
  10. #-------------------------------------------------------------------------------
  11. #
  12. # To use, just use $game_system.appear_disabled = true to turn the enemy
  13. # appear message off, and $game_system.appear_disabled = false to turn it
  14. # back on.
  15. #
  16. #-------------------------------------------------------------------------------
  17. # Version History
  18. #-------------------------------------------------------------------------------
  19. # 1.2 - Disabled battle transition
  20. # 1.1 - Disabled battle BGM and start sound
  21. # 1.0 - Initial script.
  22. #-------------------------------------------------------------------------------
  23.  
  24. module BattleManager
  25.   def self.battle_start
  26.     $game_system.battle_count += 1
  27.     $game_party.on_battle_start
  28.     $game_troop.on_battle_start
  29.     if !$game_system.appear_disabled
  30.       $game_troop.enemy_names.each do |name|
  31.         next if (name == "Cliff")
  32.         $game_message.add(sprintf(Vocab::Emerge, name))
  33.       end
  34.      
  35.       if @preemptive
  36.         $game_message.add(sprintf(Vocab::Preemptive, $game_party.name))
  37.       elsif @surprise
  38.         $game_message.add(sprintf(Vocab::Surprise, $game_party.name))
  39.       end
  40.       wait_for_message
  41.     end
  42.   end
  43. end
  44.  
  45. class Game_System
  46.   attr_accessor :appear_disabled
  47.  
  48.   alias :tlb_disableappear_initialize_8nf1 :initialize
  49.   def initialize
  50.     tlb_disableappear_initialize_8nf1
  51.     @appear_disabled = false
  52.   end
  53. end
  54.  
  55. class Scene_Map < Scene_Base
  56.   def pre_battle_scene
  57.     Graphics.update
  58.     Graphics.freeze
  59.     @spriteset.dispose_characters
  60.     BattleManager.save_bgm_and_bgs
  61.     if !$game_system.appear_disabled
  62.       BattleManager.play_battle_bgm
  63.       Sound.play_battle_start
  64.     end
  65.   end
  66.  
  67.   alias :tlb_disableappear_perform_battle_transition_3gu3 :perform_battle_transition
  68.   def perform_battle_transition
  69.      if $game_system.appear_disabled    
  70.         Graphics.transition(0)
  71.         Graphics.freeze
  72.       else
  73.         tlb_disableappear_perform_battle_transition_3gu3
  74.      end
  75.  end
  76. end
  77.  
  78. class Scene_Battle < Scene_Base
  79.   alias :tlb_disableappear_perform_transition_9ib2 :perform_transition
  80.   def perform_transition
  81.      if $game_system.appear_disabled
  82.         Graphics.transition(0)
  83.         Graphics.update
  84.      else        
  85.         tlb_disableappear_perform_transition_9ib2
  86.      end
  87.   end
  88. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement