VX 스크립트

변수/스위치
2008.10.28 19:06

Variable Criticals

조회 수 1480 추천 수 0 댓글 0
Variable Criticals

By adding a special line to the notes field, you can change how powerful a critical is for a weapon or enemy.

<critical_multiplier n>

Note that this will only be relevant for enemies if they are capable of dealing critical hits. The default, without this script, is 3. The default with the script is 3, except for unarmed actors where it is 2. Where a character is wielding two weapons, the better multiplier is used.

This script requires the TagNote 2.0 cript to function.

Download: http://chthonic.150m.com/scratch/Queex_scripts.zip
################################
# Variable Criticals #
########################################################
# Version 1.1 #
# Author: Queex #
# Licence: Creative Commons non-commercial attributive #
# Requires: TagNote 2.0+ #
#########################################################
# This replaces the fixed critical hit damage multipler #
# As before, weapons and enemies have a multiplier of 3 #
# if a new one is not specified. To give a weapon or #
# enemy a different bonus, include: #
# <critical_multiplier n> #
# in the note field. Decimals are allowed. This system #
# currently allows values less than 1 (so on a #
# critical, less damage is done). You can also adjust #
# the default unarmed multiplier, and the default #
# multipliers for weapons where it is not specified in #
# the notes field. #
# #
# Version History: #
# 1.0 First version #
# 1.1 Updated to TagNote 2.0 RELEASE #
#########################################################

class Game_Actor < Game_Battler

include TAGNOTE

UNARMED_MULTIPLIER=2
DEFAULT_MULTIPLIER=3

def critical_multiplier
multi=-1;

for weapon in weapons.compact
tmp = weapon_crit_multiplier(weapon)
multi = tmp if tmp > multi
end

multi = UNARMED_MULTIPLIER if multi < 0

return multi
end

def weapon_crit_multiplier(weapon)
tmp = get_tag(weapon.note,"critical_multiplier")
return tmp.to_f unless tmp==nil
return DEFAULT_MULTIPLIER
end
end

class Game_Enemy < Game_Battler

DEFAULT_MULTIPLIER=3

def critical_multiplier

tmp = get_tag(enemy.note,"critical_multiplier")
return tmp.to_f unless tmp==nil
return DEFAULT_MULTIPLIER
end
end

class Game_Battler
#--------------------------------------------------------------------------
# * Calculation of Damage From Normal Attack
# attacker : Attacker
# The results are substituted for @hp_damage
#--------------------------------------------------------------------------
def make_attack_damage_value(attacker)
damage = attacker.atk * 4 - self.def * 2 # base calculation
damage = 0 if damage < 0 # if negative, make 0
damage *= elements_max_rate(attacker.element_set) # elemental adjustment
damage /= 100
if damage == 0 # if damage is 0,
damage = rand(2) # half of the time, 1 dmg
elsif damage > 0 # a positive number?
@critical = (rand(100) < attacker.cri) # critical hit?
@critical = false if prevent_critical # criticals prevented?
if @critical
damage *= critical_multiplier # critical adjustment
damage = damage.to_i
end
end
damage = apply_variance(damage, 20) # variance
damage = apply_guard(damage) # guard adjustment
@hp_damage = damage # damage HP
end
end

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 3 습작 2012.12.24 5398
437 상태/속성 상태 메뉴 변경 스크립트 45 죄송해욧! 2008.03.01 4284
436 상점 상점의 자세한 표시 32 file RPGbooster 2008.10.11 4008
435 상점 상점을 색다르게 바꿔주는 스크립트 34 file 할렘 2009.02.02 6301
434 상점 상점에서 아이템 분류 5 file 파이어 2011.01.23 3510
433 상점 상점 할인 스크립트(변수를 이용한 물건 가격 조정) 9 달표범 2009.09.04 3185
432 상점 상점 아이템 목록 정리 14 정의로운녀석 2008.07.22 3771
431 상점 상점 무기, 방어구 능력치 비교 스크립트! 18 불독 2008.12.25 3611
430 기타 사이드뷰배틀에서 찌르기 공격 가능하게(Upgrade!) 6 078656577er 2009.10.15 2838
429 전투 사이드뷰배틀에서 찌르기 공격 가능하게 7 078656577er 2009.09.16 3223
428 전투 사이드뷰배틀에서 시각적으로 위치 지정하기 9 file 078656577er 2009.10.14 4910
427 전투 사이드뷰배틀3.3 + ATB1.1 스크립트. 65 할렘 2009.02.01 10946
426 전투 사이드뷰 애드온 7 비극ㆍ 2010.08.21 6758
425 전투 사이드뷰 스크립트 [2003 전투 방식] 39 아방스 2008.03.09 8406
424 전투 사이드 뷰 시스템 [시트르산님 제공] 56 아방스 2010.11.29 7499
423 오디오 사운드테스트 스크립트 13 file 카르와푸딩의아틀리에 2009.08.19 2106
422 오디오 사운드 자동 변환 설정 rukan 2009.07.01 1461
421 빠른 스킬사용 6 file RPGbooster 2008.10.08 2814
420 기타 빛 이펙트 71 file DEVIL<Li Patanis Roni Kraudus> 2008.06.06 5861
419 기타 블록 미니게임 11 file 사람이라면? 2010.08.15 2269
418 기타 블랙잭, 룰렛, 포커 스크립트 종합 9 file 도심 2010.08.22 2643
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 32 Next
/ 32