MP Damage Effect // When the player takes MP damage, a visual and audio effect happens (like with HP Damage).
Customization:
Customization:
- Change the SE for the damage effect.
- For advanced scripters, you can implement your own script calls in perform_mpdamage_effect.
- Paste under the Materials slot, above main.
- None.
- Don't remove the author part of the header.
- Script is allowed for commercial and non-commercial projects.
- Users are free to modify the script as they wish for their own projects.
- Original post: https://forums.rpgmakerweb.com/index.php?threads/add-mp-damage-effect-solved.107614/#post-959398
Code:
#==============================================================================
#
# ** Title: MP Damage SE 1.0
# Author: ZirconStorms
# Created: April 2019 (Forum request)
#
#------------------------------------------------------------------------------
#
# Script is allowed for commercial and non-commercial games.
# In the game's credits or read.me, credit "ZirconStorms".
#
#==============================================================================
# Customizable Section Begins Here.
#==============================================================================
module GhostMPDamage
MPDAMAGESOUND = RPG::SE.new("Blind", 80, 100)
#Put SE audio file name in between quotes.
#First number value is volume.
#Second number value is pitch. [Default: 100]
#You can adjust the commands in perform_mpdamage_effect if you want different
#screen effects or processes to run while the player gets MP Damage.
end
#==============================================================================
# Customizable Section Ends Here
#==============================================================================
class Game_Actor < Game_Battler
def perform_mpdamage_effect
$game_troop.screen.start_shake(5, 5, 10)
@sprite_effect_type = :blink
GhostMPDamage::MPDAMAGESOUND.play
end
end
class Window_BattleLog < Window_Selectable
alias ghost_display_mp_damage display_mp_damage
def display_mp_damage(target, item)
return if target.dead? || target.result.mp_damage == 0
if target.result.mp_damage > 0 && target.result.mp_drain == 0
target.perform_mpdamage_effect
end
Sound.play_recovery if target.result.mp_damage < 0
add_text(target.result.mp_damage_text)
wait
end
end
#===============================================================================
# End of Script
#===============================================================================