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
234 기타 Character Creator by Leon@Creation Asylum 2 file 백호 2009.02.22 1511
233 기타 Complete Climate and Time System 1.2 by ForeverZer0 1 Alkaid 2010.09.17 1310
232 기타 Crafting/Recipe system script by Axe Man Deke 백호 2009.02.22 829
» 기타 Damage Reductions by SephirothSpawn (SDK호환) 1 백호 2009.02.22 779
230 기타 Defining Encounter Areas by RPG Advocate (사용법 첨부) file 백호 2009.02.22 1201
229 기타 Difficulty Options by SephirothSpawn 백호 2009.02.22 869
228 기타 Drago - Custom Resolution by LiTTleDRAgo Alkaid 2014.02.13 1110
227 기타 Dynamic Stores by Astro_mech@rmxp.net 1 file 백호 2009.02.22 878
226 기타 Economy System by Nick@Creation Asylum 1 file 백호 2009.02.22 934
225 기타 Encounter Control by SephirothSpawn (SDK호환) 4 file 백호 2009.02.22 1157
224 기타 endroll 주석 번역 6 file insertend 2010.05.15 1638
223 기타 Etude87_Bone_Animation_Character ver.1.2 4 습작 2012.07.06 1255
222 기타 FPLE 2 - First Person Labyrinth Explorer by MGC 1 Alkaid 2012.01.17 3415
221 기타 Free Window Demo 1 file 백호 2009.02.22 1002
220 기타 Golden_sun_intro v1 1 백호 2009.02.22 1262
219 기타 Hero Databass 4 file 백호 2009.02.22 797
218 기타 House Decoration System 1.6 by MephistoX (SDK 2.x, MACL 2.x 필요) 1 file Alkaid 2010.09.02 1489
217 기타 ID띄우기 스크립트(新) 3 백호 2009.02.22 1280
216 기타 Introduction & optional Splash 2.1 by SephirothSpawn (SDK호환) 1 백호 2009.02.22 860
215 기타 KGC - RMXP 스크립트 개발용 프로젝트 1.01 4 file 백호 2009.02.22 1515
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 Next
/ 13