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 6154
34 기타 레벨업시 전회복 by ccoa 8 백호 2009.02.22 2514
33 기타 멤버 교체 11 file 백호 2009.02.22 2525
32 기타 현재시간표시 33 file 코아 코스튬 2010.10.09 2529
31 기타 암울한스크립트? 엔딩후 캐릭터 이어서 새로운 게임시작 스크립트 5 *ps인간 2009.01.26 2533
30 기타 [RGSS XP] 게임 해상도 조절 스크립트 (*2) 11 file Cheapmunk 2014.10.03 2567
29 기타 4방향 마우스 스크립트 12 file 아방스 2009.02.28 2663
28 기타 몬스터 도감 18 file 백호 2009.02.22 2668
27 기타 appletree님 요청) 화면 명암 주기 3 file 뮤바보 2013.01.31 2724
26 기타 [KGC]HP&SP게이지 색다른것(글씨와 게이지가 안겹침) 10 file 백호 2009.02.21 2732
25 기타 폰트 자동 설치 스크립트 12 file 백호 2009.02.22 2865
24 기타 몬스터도감 - 개량형 ? 7 file 백호 2009.02.22 2884
23 기타 스탭 롤 9 file 허걱 2009.08.13 2905
22 기타 플레이어 발소리 스크립트 20 백호 2009.02.22 3107
21 기타 턴제새로운거. 39 file 이안 2010.01.17 3297
20 기타 횡스크롤 스크립트 한국말 번역. 15 file 백호 2009.02.21 3311
19 기타 레벨9999만들기스크립 23 해파리 2009.04.10 3344
18 기타 한글 입력 스크립트 입니다. (vx -> xp) 23 file 헤르코스 2009.04.18 3397
17 기타 FPLE 2 - First Person Labyrinth Explorer by MGC 1 Alkaid 2012.01.17 3415
16 기타 3d 렌더링스크립트 어렵게 찾음 9 라구나 2011.03.05 3610
15 기타 [신기술 체험] RPGXP 3D 9 file 백호 2009.02.22 3636
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 Next
/ 13