Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Theo
- # ---------------------------------------------------------------------------
- # Require : YEA - Battle Engine
- # ---------------------------------------------------------------------------
- DmgSound = {
- # ---------------------------------------------------------------------------
- # Daftarkan SE yang mo dipake disini dengan format
- # angka -> ["nama", volume, pitch]
- #
- # Setelah itu pake notetag
- # <dmgsound: n>
- # Dimana n adalah angka buat manggil database SE yang kamu daftarkan di sini
- # ---------------------------------------------------------------------------
- 1 => ["Damage1", 80, 100],
- 2 => ["Damage2", 80, 100],
- 3 => ["Damage3", 80, 100],
- 4 => ["Damage4", 80, 100],
- 5 => ["Damage5", 80, 100],
- # ---------------------------------------------------------------------------
- }
- end
- # -----------------------------------------------------------------------------
- # Udah, nyampe sini aje :v
- # -----------------------------------------------------------------------------
- class << DataManager
- alias theo_dmgsound_load_db load_database
- def load_database
- theo_dmgsound_load_db
- db = $data_actors + $data_enemies
- db.compact.each do |d|
- d.load_dmgsound
- end
- end
- end
- class RPG::BaseItem
- attr_accessor :sound_damage
- def load_dmgsound
- note.split(/[\r\n]+/).each do |line|
- if line =~ /<dmgsound\s*:\s*(\d+)>/i
- sound = Theo::DmgSound[$1.to_i]
- @sound_damage = RPG::SE.new
- @sound_damage.name = sound[0]
- @sound_damage.volume = sound[1]
- @sound_damage.pitch = sound[2]
- end
- end
- end
- end
- class Game_Actor < Game_Battler
- def perform_damage_effect
- $game_troop.screen.start_shake(5, 5, 10) if YEA::BATTLE::SCREEN_SHAKE
- @sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
- return actor.sound_damage.play if actor.sound_damage
- Sound.play_actor_damage
- end
- end
- class Game_Enemy < Game_Battler
- def perform_damage_effect
- @sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
- return enemy.sound_damage.play if enemy.sound_damage
- Sound.play_enemy_damage
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement