Well, setelah sekian lama memperhatikan bagaimana teknisi dari Lunatic Packagenya Yanfly dan dengan skill scripting saya yang near zero, akhirnya saya buat ni add on
Why? Karena saya emang kesengsem sama state effect yang satu ini
Mana Shield
Saat aktif, damage yang diiterima akan dialihkan ke MP.
- Code:
-
#----------------------------------------------------------------------
# Alfa Effect No.1: Mana Shield
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# You alreasy know what it does right :D
#
# Recommended notetag:
# <react effect: mana shield x%>
#
# Where x is the amount of damage absorbed by MP, as a percentage.
# 200% means each point of MP can absorb 2 points of damage
#----------------------------------------------------------------------
when /MANA SHIELD[ ](\d+)([%%])/i
return unless @result.hp_damage > 0
mp_dmg = @result.hp_damage * $1.to_i * 0.01
hp_dmg = @result.hp_damage * (100 - $1.to_i) * 0.01
if mp_dmg >= self.mp
@result.mp_damage = self.mp
if self.mp == 0
self.hp -= @result.hp_damage
else
@result.hp_damage = hp_dmg + (mp_dmg - @result.mp_damage)
self.hp -= @result.hp_damage
self.mp -= @result.mp_damage
end
else
@result.mp_damage = mp_dmg
@result.hp_damage = hp_dmg
self.hp -= hp_dmg
self.mp -= mp_dmg
end
return unless $imported["YEA-BattleEngine"]
make_damage_popups(user)
Required : YEA Lunatic States
Instruction : just put it
inside the Package's Addon
or if you insist, put this
below the YEA: Lunatic States
- Code:
-
#==============================================================================
#
# ▼ Yanfly Engine Ace - Lunatic States Alfa Effect v1.00
# -- Last Updated: 2012.11.21
# -- Level: Lunatic
# -- Requires: YEA - Lunatic States v1.00+
#
#==============================================================================
$imported = {} if $imported.nil?
$imported["YEA-Alfa-Effect"] = true
# ▼ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
#
# Install this script under YEA - Lunatic States.
#
#==============================================================================
if $imported["YEA-LunaticStates"]
class Game_BattlerBase
#----------------------------------------------------------------------
# Lunatic States: Alfa Effect No.1: Mana Shield
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# You alreasy know what it does right :D
#
# Recommended notetag:
# <react effect: mana shield x%>
#----------------------------------------------------------------------
when /MANA SHIELD[ ](\d+)([%%])/i
return unless @result.hp_damage > 0
mp_dmg = @result.hp_damage * $1.to_i * 0.01
hp_dmg = @result.hp_damage * (100 - $1.to_i) * 0.01
if mp_dmg >= self.mp
@result.mp_damage = self.mp
if self.mp == 0
self.hp -= @result.hp_damage
else
@result.hp_damage = hp_dmg + (mp_dmg - @result.mp_damage)
self.hp -= @result.hp_damage
self.mp -= @result.mp_damage
end
else
@result.mp_damage = mp_dmg
@result.hp_damage = hp_dmg
self.hp -= hp_dmg
self.mp -= mp_dmg
end
return unless $imported["YEA-BattleEngine"]
make_damage_popups(user)
#----------------------------------------------------------------------
# Stop editting past this point.
#----------------------------------------------------------------------
else
so = state_origin
lw = log_window
lunatic_state_extension_lsp2(effect, state, user, so, lw)
end
end
end # Game_BattlerBase
end # $imported["YEA-LunaticStates"]
#==============================================================================
#
# ▼ End of File
#
#==============================================================================
Credits : Of course you must credit Yanfly for this, not me