VX 스크립트

Overkill
Version
1
Author 332211or uresk
Release Date 23/8/08

Introduction
When you kill an enemy and make its hp drop below a custom number, you'll get one overkill.
Overkill gives you double exp and gold at the end of the battle.
Here it is an example:
Overkill_HP = {1 => 20}
Slime has 20/100HP
Slime is attacked for 50 damge.
Hp = 20 - 50 = - 30
Since 30 > 20 it's an overkill
여기서부터

Features
Customize overkill hp for each enemy.
###############################################################################
# Script: Overkill
# Version: 1 (28/8/08)
# Author: uresk (AKA 332211)
###############################################################################
#==============================================================================
# ** Module Overkill
#------------------------------------------------------------------------------
# Configuration
#
# Overkill_HP = {enemy_id => negative hp for overkill, ...}
#
# Overkill_text = "message for overkill when enemy dies"
# apears only when you overkill one enemy
#
# Overkill_Bonus_End = "message shown in the battle end before Exp and Gol gain"
#==============================================================================

module Overkill

Overkill_HP = {1 => 500, 2 => 10}

Overkill_text = "OVERKILL!!"

Overkill_Bonus_End = "Gained double Exp and %s for Overkill."
# %s = game currency

end


#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
# This class deals with battlers. It's used as a superclass of the Game_Actor
# and Game_Enemy classes.
#==============================================================================

class Game_Battler
#--------------------------------------------------------------------------
# * aliasing Change HP method
#--------------------------------------------------------------------------
alias overkill_hp hp=
#--------------------------------------------------------------------------
# * Change HP
# hp : new HP
#--------------------------------------------------------------------------
def hp=(hp)
self.dying_hp = hp unless self.actor?
overkill_hp(hp)
end
end


#==============================================================================
# ** Game_Enemy
#------------------------------------------------------------------------------
# This class handles enemy characters. It's used within the Game_Troop class
# ($game_troop).
#==============================================================================

class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables (new)
#--------------------------------------------------------------------------
attr_accessor:overkill
attr_accessor:dying_hp
#--------------------------------------------------------------------------
# * aliasing Object Initialization
#--------------------------------------------------------------------------
alias overkill_initialize initialize
#--------------------------------------------------------------------------
# * Object Initialization
# index : index in troop
# enemy_id : enemy ID
#--------------------------------------------------------------------------
def initialize(index, enemy_id)
overkill_initialize(index, enemy_id)
@overkill = false
@dying_hp = 0
end
end

#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================

class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# * include module Overkill
#--------------------------------------------------------------------------
include Overkill
#--------------------------------------------------------------------------
# * aliasing display_added_states method
#--------------------------------------------------------------------------
alias overkill_display_added_states display_added_states
#--------------------------------------------------------------------------
# * Show Added State
# target : Target
# obj : Skill or item
#--------------------------------------------------------------------------
def display_added_states(target, obj = nil)
overkill_display_added_states(target, obj = nil)
overkill(target) if target.actor? == false and target.dead?
end
#--------------------------------------------------------------------------
# * Overkill * checks for overkill
# target : Target
#--------------------------------------------------------------------------
def overkill(target)
if Overkill_HP[target.enemy_id] != nil # if there is a set Hp for overkill
dhp = 0
dhp -= target.dying_hp # get dying_hp
required_damage = Overkill_HP[target.enemy_id] # get required Hp for overkill
target.overkill = true if dhp >= required_damage # compare dying_hp with required hp
end
if target.overkill # show overkill in battle message
text = sprintf(Overkill::Overkill_text)
@message_window.add_instant_text(text)
end
end
#--------------------------------------------------------------------------
# * aliasing display_exp_and_gold method
#--------------------------------------------------------------------------
alias overkill_display_exp_and_gold display_exp_and_gold
#--------------------------------------------------------------------------
# * Display Gained Experience and Gold (overwriten)
#--------------------------------------------------------------------------
def display_exp_and_gold
exp = $game_troop.exp_total
gold = $game_troop.gold_total
for enemy in $game_troop.members # check all the enemies
next unless enemy.overkill # if one of the was overkilled
exp *= 2 # gain double exp
gold *= 2 # gain double gold
text = sprintf(Overkill::Overkill_Bonus_End,Vocab.gold) #show overkill
$game_message.texts.push('|' + text) # bonus message (battle end)
break
end
$game_party.gain_gold(gold)
text = sprintf(Vocab::Victory, $game_party.name)
$game_message.texts.push('|' + text)
if exp > 0
text = sprintf(Vocab::ObtainExp, exp)
$game_message.texts.push('.' + text)
end
if gold > 0
text = sprintf(Vocab::ObtainGold, gold, Vocab::gold)
$game_message.texts.push('.' + text)
end
wait_for_message
end
end
Comment '1'
  • ?
    KSG 2008.11.01 15:56
    뭔지도 모르고 퍼오시면 어떻합니까 ;;

    적 체력이상으로 큰 데미지로 죽이거나 하면 OVER KILL ! 이라면서

    골드랑 EXP 더주는 스크립트 같군요 ;

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 3 습작 2012.12.24 5398
637 ((대박!)) 게임상의 모든 글자에 효과 주기.. 33 미카엘 2008.08.20 5582
636 (?스크립트) 스크립트 읽어서 그래픽 넣으세요.(영어 잘하는 사람만 권장...) 2 Man... 2008.10.27 1444
635 메뉴 (모그메뉴 풀세트팩 SEL Style.) 유니크급 자료 147 file 할렘 2009.02.07 9558
634 상점 (수정)크리쳐 샵, 'SW_CreatureShop' by Siot Warrior 15 file 시옷전사 2010.09.03 3675
633 액터 (수정)크리쳐 합체, 'SW_CreatureMix' by SiotWarrior 22 file 시옷전사 2010.09.07 2972
632 기타 (이거 정말 좋군요) 말이나 용을 탈수있게 하는 스크립트. 31 file 아방스가 짱 2010.02.28 4261
631 기타 (좀 이상한 or 쓸모없을 듯 한)화면상에 몬스터와 만나려면 몇걸음 남았는지 표시하는 스크립트! 2 루시페르 2009.06.06 2318
630 기타 078656577er님의 스크립트를 개조한, 사격용 스크립트 1 file 타코 2012.03.16 2519
629 기타 2 Players Engine 11 레이니케 2008.03.28 2294
628 2 Players Engine 2인용하기 15 file RPGbooster 2008.10.08 3999
627 전투 2003식 사이드뷰 적들도 가까이와서 공격함 ㅇㅇ 51 배군 2008.05.02 6750
626 이동 및 탈것 2D 횡스크롤 스크립트 56 file 사람이라면? 2010.08.15 7570
625 이동 및 탈것 3D 던젼 스크립트 38 아방스 2010.12.06 5772
624 그래픽 3D그래픽 파티클엔진 45 file RPGbooster 2008.10.08 10130
623 파티 5인 파티 프로젝트 V1.1 4 file 지나가는떡꼬치 2012.06.30 2988
622 이동 및 탈것 8 방향 이동스크립트 + 스프라이트 효과 12 file 레오 2009.02.06 7557
621 기타 <중수이상>RPG VX의 대표적 참조값 6 까까까 2009.05.31 3236
620 영상 ??(Avi play ver beta 0.8) 4 Man... 2008.10.28 1575
619 ??(다 영어)여기서 부터 드레그만 빼고 Man... 2008.10.27 1078
» ??? 1 Man... 2008.10.27 1020
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