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
497 메시지 얼굴표시 9 허걱 2009.09.23 5001
496 상태/속성 어떤 상태일때에만 사용가능한 스킬 14 file 좀비사냥꾼 2009.03.25 3266
495 메시지 어드밴스 텍스트 시스템 13 file 카르와푸딩의아틀리에 2009.06.30 4918
494 기타 액터선택지제작 간편화 스크립트 7 Evangelista 2009.02.26 4082
493 액알 스크립트 33 츠키아 2008.08.11 5828
492 버그픽스 애니메이션 표시 위치 수정 (Fix Animation Position) 2 file AltusZeon 2014.02.12 1289
491 기타 앞에있는 이벤트 아이디 찾기 6 허걱 2009.08.21 2091
490 기타 아키루냥님 요청 스크립트(자작) 4 file Last H 2009.02.22 2754
489 아이템 아이템입수 화면 16 file RPGbooster 2008.10.08 4526
488 아이템 아이템의 공격횟수 추가 8 star211 2010.01.19 2413
487 이름입력 아이템, 장비, 스킬 이름 색깔 바꾸기 14 까까까 2011.03.04 3732
486 아이템 아이템 획득 팝업 스크립트 24 아방스 2009.01.07 3805
485 아이템 아이템 프라이스 체인저?? Man... 2008.10.28 2385
484 장비 아이템 장비시 스킬습득, 'SW_EquipFinisher' by Siot Warrior 19 file 시옷전사 2010.08.31 3029
483 이름입력 아이템 이름을 내마음대로 정하자! name_changer 1.0v 26 file Last H 2009.02.25 4067
482 이름입력 아이템 이름 바꾸기 버전 (헤르코스님의 한글 입력) 7 Last H 2009.12.20 2722
481 아이템 아이템 분류 19 file RPGbooster 2008.10.11 3309
480 아이템 아이템 믹서 21 file 미양 2010.07.02 3983
479 아이템 아이템 무게, 아이템별 소지수 적용 16 file 허걱 2010.11.11 2981
478 기타 아이콘 캐릭터 17 file 허걱 2010.02.28 4225
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