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 장비 KGC장비종류 추가 스크립트. 36 file 루시페르 2009.03.28 4674
496 제작도구 최대한 한글로 변혁 했음Window Maker V1.0(대박) 15 Man... 2008.10.29 4673
495 스킬 스킬 필요 조건(번역) 23 file 훈덕 2009.02.03 4644
494 기타 아이디를 띄우기 20 12345678 2011.11.07 4627
493 전투 VX SRPG3d 수정본(1) 12 아이미르 2011.10.19 4617
492 이동 및 탈것 점프를 제한 하는 스크립트 15 아방스 2008.01.31 4605
491 메시지 [완성]RPG Maker VX용 한글 조사 자동결정 10 file 시릴캣 2009.08.13 4598
490 퀘스트 오메가7 퀘스트 스크립트 한글화,사용법,데모게임 직접제작 32 file DH Games 2010.02.14 4578
489 메뉴 기본메인 메뉴 아이콘 추가 10 아방스 2010.12.11 4573
488 기타 간단한 스크립트의 사용법 6 아방스 2008.03.09 4552
487 아이템 레벨,능력치,아이템소지갯수,소지금의 한계돌파스크립트 21 file 이탁 2009.01.28 4547
486 메뉴 스타일 크로노 트리거 메뉴 31 file 콩밥 2010.07.19 4536
485 상태/속성 넓어진 상태창 v1.0 11 file 아방스 2009.01.20 4536
484 전투 스킬 커맨드 스크립트 16 아방스 2009.02.05 4535
483 타이틀/게임오버 까만화면으로 시작하기 27 file 허걱 2009.07.04 4528
482 아이템 아이템입수 화면 16 file RPGbooster 2008.10.08 4526
481 메뉴 메뉴 배경화면 바꾸는 스크립트 9 독도2005 2008.03.23 4520
480 전투 Target 몬스터 플래시 스크립트 16 아방스 2008.01.24 4513
479 기타 책 읽기 스크립트 44 file 히류 2010.10.05 4506
478 상점 스킬합성 상점 스크립트 23 file 미얼 2009.10.29 4498
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