Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- #
- # ▼ Yanfly Engine Ace - Dynamic Victory Aftermath (Addon)
- # -- Level: Normal, Hard
- # -- Requires: YEA - Victory Aftermath
- #
- #------------------------------------------------------------------------------
- #
- # Edited by : TheoAllen
- # Version : 1.0
- # Contact : www.rpgmakerid.com (or) http://theolized.blogspot.com
- # (This script documentation is written in informal indonesian language)
- #
- #==============================================================================
- $imported = {} if $imported.nil?
- if $imported["YEA-VictoryAftermath"]
- $imported[:Theo_DynamicYEA_VA] = true
- #==============================================================================
- =begin
- Perkenalan :
- Script ini adalah addon untuk yanfly victory aftermath. Dimana kamu bisa
- mengganti quote actor secara dinamis. Seperti mengganti face atau beberapa
- kutipan hanya bisa muncul di saat-saat tertentu.
- Cara penggunaan :
- Berikut adalah notetag yang bisa digunain.
- <win: constant>
- <level: constant>
- <drops: constant>
- contants adalah nama konstanta yang kamu definisikan dibawah. Keterangannya
- silahkan dibaca sendiri dibawah sana
- =end
- #=============================================================================
- # Editable region
- #=============================================================================
- module TLZ # <-- jangan disentuh
- # --------------------------------------------------------------------------
- # Waktu untuk nunggu berapa frame sebelum window victory aftermath
- # dimunculkan
- # --------------------------------------------------------------------------
- Wait = 160
- # ==========================================================================
- # Setelah keterangan ini, adalah tempat kamu ngebikin custom quote buat
- # karakter-karaktermu entar. Dan inget, settingannya rada ribet.
- # Format penulisan :
- # --------------------------------------------------------------------------
- # Quote = [
- # ["face_name", face_index, "text","kondisi"],
- # ]
- #
- # Keterangan :
- # Quote >> Nama konstanta yang akan kamu berikan pada notetag. Harus diawali
- # dengan huruf besar. Semisal kamu menulisnya adalah Ralph_Win,
- # nanti dalam notetag, kamu harus menuliskannya <win: Ralph_Win>
- # face_name >> Nama faceset yang akan digunakan. Kosongkan jika kamu mau
- # make faceset yang sekarang sedang dipake actor kamu.
- # face_index >> Index faceset. Dari pojok kiri atas sampai kanan bawah
- # adalah 0 - 7
- # text >> Texts yang akan jadi tulisan dalam victory aftermath
- # kondisi >> Kondisi yang akan dievaluasi secara script. Tulis "true" jika
- # kamu ingin texts kamu selalu muncul di berbagai kondisi apapun
- # ==========================================================================
- # --------------------------------------------------------------------------
- Stella_Quotes = [
- ["Actor28_ex",3,"Maaf ya","true"],
- ["Actor28_ex",3,"Kalian tahu? aku berhasil mengeluarkan " +
- "\ntiga peluru dalam satu tembakan","true"],
- ["Actor28_ex",3,"Tadi itu tembakanku keren banget","true"],
- ["",4,"Fuuhh.... Hampir saja","hp_rate <= 0.5"],
- ["",7,"Cih, merusak rambutku saja","true"],
- ["",1,"Kamu dengar ga sih? Udah kubilang \nminggir kan!","true"],
- ["",7,"Kalian mau menantang penembak jitu \nsepertiku?", "true"],
- ]
- # --------------------------------------------------------------------------
- Stella_Level = [
- ["Actor28_ex",3,"Tembakanku makin keren aja","true"],
- ]
- # --------------------------------------------------------------------------
- Stella_Drops = [
- ["",1,"Ini milikku!","true"],
- ["Actor28_ex",3,"Wah ada uang!","true"],
- ["Actor28_ex",3,"Wah... health potion!",
- "$game_temp.drops.include?($data_items[1])"],
- ["Actor28_ex",2,"Banyak bener!",
- "$game_temp.drops.size > 2"],
- ]
- # --------------------------------------------------------------------------
- Lunar_Quotes = [
- ["",0,"Kalian harus banyak berlatih sebelum \nmenghadapiku","hp_rate > 0.5"],
- ["",7,"Sihirku tadi keren kan?","true"],
- ["",5,"Siapa sih yang membuat dungeon ini? \nsusah bener...",
- "hp_rate <= 0.45"],
- ["",3,"Untungnya ada aku disini ...","true"],
- ]
- Lunar_Level = [
- ["",7,"Pengalaman adalah guru yang baik","true"],
- ]
- Lunar_Drops = [
- ["",3,"Lekas bawa barangnya ...","true"],
- ["",7,"Health potion,\\. lumayan juga",
- "$game_temp.drops.include?($data_items[1])"],
- ]
- # --------------------------------------------------------------------------
- Soleil_Quotes = [
- ["Actor63_ex",0,"Tadi itu lumayan juga!","true"],
- ["Actor63_ex",4,"Woi, Stella.\. Hati-hati dong kalo nembak!","true"],
- ["Actor63_ex",6,"Hah, cuman segitu saja?","$game_troop.turn_count <= 2"],
- ["Actor63_ex",3,"Aku sudah berpengalaman menjelajah dungeon \nseperti ini",
- "true"],
- ["",1,"Woi, Lunar! Kalau nge-heal yang \nbener dong!","hp_rate <= 0.5"],
- ["",1,"Ayo! Mana yang lain?!","hp_rate > 0.5"],
- ["",0,"Ga buruk juga....","true"],
- ["",7,"Pertarungan yang bagus....","true"],
- ]
- Soleil_Level = [
- ["",7,"Makin menarik saja isi dungeon ini.","true"],
- ]
- Soleil_Drops = [
- ["",3,"Diam kalian semua! biar aku aja \nyang ambil","true"],
- ["",7,"Bolehlah...","true"],
- ["",6,"Lah\\..\\..\\.. ga dapet apa-apa",
- "$game_temp.drops.empty?"],
- ["Actor63_ex",2,"Wah, panen nih!",
- "$game_temp.drops.size >= 2"],
- ]
- # --------------------------------------------------------------------------
- # Regular expression buat baca notetag. Kalo ga ngerti ga usah diedit-edit
- # --------------------------------------------------------------------------
- WinQuoteREGX = /<win\s*:\s*(.+)>/i
- LevelQuoteREGX = /<level\s*:\s*(.+)>/i
- DropsQuoteREGX = /<drops\s*:\s*(.+)>/i
- # --------------------------------------------------------------------------
- end
- # ============================================================================
- # End of editable region
- # ============================================================================
- class RPG::Actor
- attr_accessor :tlz_win
- attr_accessor :tlz_level
- attr_accessor :tlz_drops
- def load_actor_quotes
- note.split(/[\r\n]+/).each do |line|
- case line
- when TLZ::WinQuoteREGX
- @tlz_win = $1.to_s
- when TLZ::LevelQuoteREGX
- @tlz_level = $1.to_s
- when TLZ::DropsQuoteREGX
- @tlz_drops = $1.to_s
- end
- end
- end
- end
- class << DataManager
- alias yea_va_tlz_load_db load_database
- def load_database
- yea_va_tlz_load_db
- load_tlz_va_quotes
- end
- def load_tlz_va_quotes
- $data_actors.compact.each do |actor|
- actor.load_actor_quotes
- end
- end
- end
- class Game_Temp
- attr_accessor :drops
- alias yea_va_tlz_init initialize
- def initialize
- yea_va_tlz_init
- @drops = []
- end
- end
- class Game_Actor < Game_Battler
- def tlz_win_quotes
- ary = eval("TLZ::#{actor.tlz_win}").select do |quote|
- eval(quote[3])
- end
- return ary[rand(ary.size)]
- end
- def tlz_level_quotes
- ary = eval("TLZ::#{actor.tlz_level}").select do |quote|
- eval(quote[3])
- end
- return ary[rand(ary.size)]
- end
- def tlz_drops_quotes
- ary = eval("TLZ::#{actor.tlz_drops}").select do |quote|
- eval(quote[3])
- end
- return ary[rand(ary.size)]
- end
- def win_type_defined?(type)
- case type
- when :win
- return !actor.tlz_win.nil?
- when :level
- return !actor.tlz_level.nil?
- when :drops
- return !actor.tlz_drops.nil?
- end
- end
- def tlz_victory_quotes(type)
- case type
- when :win
- return tlz_win_quotes
- when :level
- return tlz_level_quotes
- when :drops
- return tlz_drops_quotes
- end
- end
- end
- class << BattleManager
- alias yea_va_tlz_set_victory_text set_victory_text
- def set_victory_text(actor, type)
- return yea_va_tlz_set_victory_text(actor, type) unless
- actor.win_type_defined?(type)
- return tlz_va_text(actor, type)
- end
- def tlz_va_text(actor, type)
- array = actor.tlz_victory_quotes(type)
- text = "" + sprintf(YEA::VICTORY_AFTERMATH::HEADER_TEXT, actor.name)
- text += array[2]
- text += YEA::VICTORY_AFTERMATH::FOOTER_TEXT
- $game_message.face_name = (array[0].empty? ? actor.face_name : array[0])
- $game_message.face_index = array[1]
- $game_message.add(text)
- wait_for_message
- end
- alias tlz_display_exp display_exp
- def display_exp
- SceneManager.scene.va_wait(TLZ::Wait)
- tlz_display_exp
- end
- #--------------------------------------------------------------------------
- # overwrite method: self.gain_drop_items
- #--------------------------------------------------------------------------
- def gain_drop_items
- drops = []
- $game_troop.make_drop_items.each do |item|
- $game_party.gain_item(item, 1)
- drops.push(item)
- end
- $game_temp.drops = drops
- SceneManager.scene.show_victory_spoils($game_troop.gold_total, drops)
- set_victory_text(@victory_actor, :drops)
- wait_for_message
- end
- end
- class Scene_Battle
- def va_wait(dur)
- dur.times do
- if Input.trigger?(:C)
- Input.update
- break
- end
- update_basic
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment