XP 스크립트

http://www.dubealex.com/asylum/index.php?showtopic=10291

방어구에 물리공격이나 마법공격 대미지 경감을 붙일 수 있게 합니다. 대미지 경감의 유형과 사용법은 스크립트 서두의 주석을 참조하세요.



#==============================================================================
# ** Damage Reductions
#==============================================================================
# SephirothSpawn
# Version 1
# 2006-07-29
#------------------------------------------------------------------------------
# * Descript-xion:
#
# ~ Allows You to Assign Physical and Magical Damage Reductions to Armors
#
# ~ Reduction A : If the Final Damage is less than the damage reduction, the
# damage is reduced to 0
# ~ Reduction B : Takes the Final Damage and subracts the damage reduction
#
#------------------------------------------------------------------------------
# * Installation:
#
# ~ Place below the RMXP SDK and above Main
#------------------------------------------------------------------------------
# * Customization:
#
# ~ A-Type Reductions
#
# Phy_Dmg_Red_A = { armor_id => reduction, ... }
# Mag_Dmg_Red_A = { armor_id => reduction, ... }
#
# ~ B-Type Reductions
#
# Phy_Dmg_Red_B = { armor_id => reduction, ... }
# Mag_Dmg_Red_B = { armor_id => reduction, ... }
#------------------------------------------------------------------------------
# * Syntax:
#
# ~ A-Type Reductions
# Armor Physical Reduction : .phy_dmg_red_a
# Armor Magical Reduction : .mag_dmg_red_a
#
# ~ B-Type Reductions
# Armor Physical Reduction : .phy_dmg_red_b
# Armor Magical Reduction : .mag_dmg_red_b
#
# ~ Actor Total A-Type Reductions
# .phy_dmg_red_a
# .mag_dmg_red_b
#
# ~ Actor Total B-Type Reductions
# .phy_dmg_red_b
# .mag_dmg_red_b
#==============================================================================

#------------------------------------------------------------------------------
# * SDK Log Script-x
#------------------------------------------------------------------------------
SDK.log('Damage Reductions', 'SephirothSpawn', 1, '2006-07-29')

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state('Damage Reductions')

#==============================================================================
# ** RPG::Armor
#==============================================================================

class RPG::Armor
#--------------------------------------------------------------------------
# * Physical And Magical Damage Reductions
# ~ armor_id => reduction_value
#--------------------------------------------------------------------------
Phy_Dmg_Red_A = {}
Mag_Dmg_Red_A = {}
Phy_Dmg_Red_B = {}
Mag_Dmg_Red_B = {}
#--------------------------------------------------------------------------
# * Physical Damage Reductions (Type A)
#--------------------------------------------------------------------------
def phy_dmg_red_a
return Phy_Dmg_Red_A.has_key?(@id) ? Phy_Dmg_Red_A[@id] : 0
end
#--------------------------------------------------------------------------
# * Magical Damage Reductions (Type A)
#--------------------------------------------------------------------------
def mag_dmg_red_a
return Mag_Dmg_Red_A.has_key?(@id) ? Mag_Dmg_Red_A[@id] : 0
end
#--------------------------------------------------------------------------
# * Physical Damage Reductions (Type B)
#--------------------------------------------------------------------------
def phy_dmg_red_b
return Phy_Dmg_Red_B.has_key?(@id) ? Phy_Dmg_Red_B[@id] : 0
end
#--------------------------------------------------------------------------
# * Magical Damage Reductions (Type B)
#--------------------------------------------------------------------------
def mag_dmg_red_b
return Mag_Dmg_Red_B.has_key?(@id) ? Mag_Dmg_Red_B[@id] : 0
end
end

#==============================================================================
# ** Game_Battler
#==============================================================================

class Game_Battler
#--------------------------------------------------------------------------
# * Lias Listings
#--------------------------------------------------------------------------
alias seph_dmgred_gmbtlr_ae attack_effect
alias seph_dmgred_gmbtlr_se skill_effect
#--------------------------------------------------------------------------
# * Applying Normal Attack Effects
#--------------------------------------------------------------------------
def attack_effect(attacker)
# Original Attack Effect
seph_dmgred_gmbtlr_ae(attacker)
# If Self is an Actor
if self.is_a?(Game_Actor)
# Unless Missed
if self.damage.is_a?(Fixnum)
# If Damage was dealt
if self.damage > 0
# If Damage is Less than Physical Damage Reduction
unless self.damage > self.phy_dmg_red_a
self.hp += damage
self.damage = 0
self.critical = false
else
self.hp += self.phy_dmg_red_b
self.damage -= self.phy_dmg_red_b
end
end
end
end
return true
end
#--------------------------------------------------------------------------
# * Apply Skill Effects
#--------------------------------------------------------------------------
def skill_effect(user, skill)
# Original Skill Effect
effective = seph_dmgred_gmbtlr_se(user, skill)
# If Self is an Actor
if self.is_a?(Game_Actor)
# Unless Missed
if self.damage.is_a?(Fixnum)
# If Damage was dealt
if self.damage > 0
# Gets Damage Reduction Value
reduction = skill.atk_f > 0 ? self.phy_dmg_red_a :
self.mag_dmg_red_a
# If Damage is Less than Damage Reduction
unless self.damage > reduction
self.hp += damage
self.damage = 0
self.critical = false
else
# Gets Damage Reduction Value
reduction = skill.atk_f > 0 ? self.phy_dmg_red_b :
self.mag_dmg_red_b
self.hp += reduction
self.damage -= reduction
end
end
end
end
# End Method
return effective
end
end

#==============================================================================
# ** Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Physical Damage Reduction (Type A)
#--------------------------------------------------------------------------
def phy_dmg_red_a
n = 0
for i in 1..4
unless (eval "$data_armors[@armor#{i}_id].nil?")
n += eval "$data_armors[@armor#{i}_id].phy_dmg_red_a"
end
end
return n
end
#--------------------------------------------------------------------------
# * Magical Damage Reduction (Type A)
#--------------------------------------------------------------------------
def mag_dmg_red_a
n = 0
for i in 1..4
unless (eval "$data_armors[@armor#{i}_id].nil?")
n += eval "$data_armors[@armor#{i}_id].mag_dmg_red_a"
end
end
return n
end
#--------------------------------------------------------------------------
# * Physical Damage Reduction (Type B)
#--------------------------------------------------------------------------
def phy_dmg_red_b
n = 0
for i in 1..4
unless (eval "$data_armors[@armor#{i}_id].nil?")
n += eval "$data_armors[@armor#{i}_id].phy_dmg_red_b"
end
end
return n
end
#--------------------------------------------------------------------------
# * Magical Damage Reduction (Type B)
#--------------------------------------------------------------------------
def mag_dmg_red_b
n = 0
for i in 1..4
unless (eval "$data_armors[@armor#{i}_id].nil?")
n += eval "$data_armors[@armor#{i}_id].mag_dmg_red_b"
end
end
return n
end
end

#------------------------------------------------------------------------------
# * End SDK Enable Test
#------------------------------------------------------------------------------
end

Who's 백호

?

이상혁입니다.

http://elab.kr

Comment '1'
  • ?
    내로미 2010.05.07 15:56

    아.. 쓸데없는건데... 제목이 영어라서 낚인..;;;

    내 포인트.. 아까운..;;


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
254 기타 [All RGSS] FileTest (Unicode) file Cheapmunk 2014.12.29 611
253 기타 에어리어 설정 by RPG Advocate 백호 2009.02.22 709
252 기타 Boat Script 백호 2009.02.21 729
251 기타 Localization by ForeverZer0, KK20 습작 2013.04.26 738
250 기타 Materia System file 백호 2009.02.21 749
249 기타 Real-Time Day Night 3 백호 2009.02.22 751
248 기타 killer님 요청하신 스크립트 두번째입니다. 나뚜루 2009.02.21 759
247 기타 Letter by Letter Message Window by slipknot@rmxp.org (SDK호환) 1 file 백호 2009.02.22 760
246 기타 Advanced Gold display by Dubealex 1 백호 2009.02.22 761
245 기타 Sphere Grid System file 백호 2009.02.21 765
244 기타 AMS-Advanced Message Script Edited by Dubleax 3 file 백호 2009.02.21 765
243 기타 Activation_system file 백호 2009.02.22 775
242 기타 Terrain Encounter Areas by SephirothSpawn 백호 2009.02.22 778
» 기타 Damage Reductions by SephirothSpawn (SDK호환) 1 백호 2009.02.22 779
240 기타 killer님 요청하신 스크립트입니다. 1 나뚜루 2009.02.21 784
239 기타 Selected phyolomortis.com scripts 1 file 백호 2009.02.22 789
238 기타 Hero Databass 4 file 백호 2009.02.22 797
237 기타 SG_Call Script Fix by sandgolem (SDK호환) 백호 2009.02.22 802
236 기타 SG_Multiple Currencies v3 by sandgolem (SDK호환) 백호 2009.02.22 803
235 기타 Weather Script 1.02 by ccoa 1 file 백호 2009.02.22 809
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 Next
/ 13