if true # make false to disable script. true = enabled
#===============================================================================
#
# ☆ Dekita - Complicated Exp & Gold Formulas.
# -- Author : Dekita
# -- Version : 1.0
# -- Level : Complex
# -- Requires : N/A
# -- Engine : RPG Maker VX Ace.
#
#===============================================================================
# ☆ Import
#-------------------------------------------------------------------------------
($imported||={})[:Dekita_] = 1.0
#===============================================================================
# ☆ Updates
#-------------------------------------------------------------------------------
# D /M /Y
# 16/1o/2o14 -
#===============================================================================
# ☆ Introduction
#-------------------------------------------------------------------------------
# This script was origionally written by DekitaRPG for The Tomb Of Lost Art
# Challenge #5 - Theme: Unbreakable. This piece of 'art' simply shows off
# some code writing skills. :)
#
# This script creates my interpretation of the limit break system from Final
# Fantasy 7.
# As the theme was 'unbreakable', I have included the ability to notetag a
# state so that when the state is applied, your characters cannot break their
# limit. ie.. their limit is 'unbreakable' :p
#
#===============================================================================
# ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
#===============================================================================
# Please give credit to Dekita (or DekitaRPG). (requested, not required.)
# Free to use for all projects (commercial / non commercial).
#
# Please do not repost this script on other sites - if you wish, you can
# provide a link to the webpage below;
# [url]http://www.dekitarpg.wordpress.com[/url]
#
#===============================================================================
# ☆ Instructions
#-------------------------------------------------------------------------------
# Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
#
#===============================================================================
# ☆ Script Calls
#-------------------------------------------------------------------------------
# N/A
#
#===============================================================================
# ☆ Notetags (default)
#-------------------------------------------------------------------------------
# <unbreakable>
# Notetag used in states notebox to disallow limit break.
#
#===============================================================================
# ☆ HELP
#-------------------------------------------------------------------------------
# This script i provided as is; therefore, compatability updates will not be
# possible. However, bugs caused by this script can be reported and will be
# resolved asap.
# You can report bugs for any of MY scripts at the web page below;
# [url]http://dekitarpg.wordpress.com/bug-reports/[/url]
#
#===============================================================================
# [url]www.dekyde.com[/url]
# [url]www.dekitarpg.wordpress.com[/url]
#===============================================================================
module Limit_Break
#===============================================================================
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
Vocab = {
:menu_command => "Limit",
:battle_command => "Limit Skill",
:change_help => "View skill data and change active limit.",
:leave_help => "Leave Scene",
}
#-----------------------------------------------------------------------------
# Notetag used in states to disallow limit break.
# <unbreakable>
#-----------------------------------------------------------------------------
Notetag = /<unbreakable>/i
#-----------------------------------------------------------------------------
# true = override attack command
# false = place new command above it
#-----------------------------------------------------------------------------
Override = true
#-----------------------------------------------------------------------------
# Hash of actor id => [limit skilll id, limit skilll id, limit skilll id, ...]
#-----------------------------------------------------------------------------
Limits = {
1 =>[118,119,120,121,122,123,124,125], # << Actor 1
2 =>[118,119,120,121,122,123,124,125], # << Actor 2
3 =>[118,119,120,121,122,123,124,125], # << Actor 3
4 =>[118,119,120,121,122,123,124,125], # << Actor 4
5 =>[118,119,120,121,122,123,124,125], # << Actor 5
6 =>[118,119,120,121,122,123,124,125], # << Actor 6
7 =>[118,119,120,121,122,123,124,125], # << Actor 7
8 =>[118,119,120,121,122,123,124,125], # << Actor 8
9 =>[118,119,120,121,122,123,124,125], # << Actor 9
10 =>[118,119,120,121,122,123,124,125], # << Actor 10
}
#-----------------------------------------------------------------------------
# [ end module ]
#-----------------------------------------------------------------------------
end
#===============================================================================
module Text_Color
#===============================================================================
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# ☆ Color Settings
#-----------------------------------------------------------------------------
# You can use these colors in any of my scripts that offer color customisation.
# simply put Text_Color::THE_COLOR_YOU_WANT as the setting.
# eg.
# Text_Color::Pure_White
#-----------------------------------------------------------------------------
# Shade's
Pure_White = Color.new(255,255,255)
White = Color.new(222,222,222)
Grey = Color.new(111,111,111)
Black = Color.new(0 ,0 ,0 )
#-----------------------------------------------------------------------------
# Yellow's
Yellow = Color.new(255,255,0)
Gold = Color.new(212,212,64)
Orange = Color.new(255,182,0)
Deep_Orange = Color.new(212,64,0)
Dirt_Orange = Color.new(182,64,0)
Brown = Color.new(128,32,0)
#-----------------------------------------------------------------------------
# Red's
Red = Color.new(251,111,111)
Deep_Red = Color.new(222,60,60)
Pure_Red = Color.new(255,0,0)
Pink = Color.new(255,0,255)
Dark_Pink = Color.new(182,0,156)
#-----------------------------------------------------------------------------
# Blue's
Sky_Blue = Color.new(0,182,255)
Light_Blue = Color.new(64,128,255)
Dark_Blue = Color.new(32,64,255)
Purple = Color.new(182,64,255)
Magenta = Color.new(156,156,255)
#-----------------------------------------------------------------------------
# Green's
Green = Color.new(111,251,111)
Candy_Green = Color.new(0,255,0)
Dirty_Green = Color.new(128,182,0)
Khaki_Green = Color.new(111,156,64)
Turquoise = Color.new(0,255,182)
#-----------------------------------------------------------------------------
# [ end module ]
#-----------------------------------------------------------------------------
end
#===============================================================================
module Vocanicon
#===============================================================================
#-----------------------------------------------------------------------------
# Actor Info
# Format = ["Name:" , Text_Color::White, icon, hue]
#-----------------------------------------------------------------------------
Name = ["Name:" , Text_Color::White, 0, 0]
Nick = ["Alias:" , Text_Color::White, 0, 0]
Clas = ["Class:" , Text_Color::White, 0, 0]
Stts = ["↓ Status ↓" , Text_Color::White, 0, 0]
Level = ['Level:' , Text_Color::White, 0, 0]
TP = ["Chi" , Text_Color::White,119, 0]
Exp = ["Exp" , Text_Color::White, 60, 0]
#-----------------------------------------------------------------------------
# Parameters
def self.param(param_id)
case param_id
when 0 then ["Health" , Text_Color::White, 117, 0]
when 1 then ["Mana" , Text_Color::White, 118, 0]
end
end
#-----------------------------------------------------------------------------
# [ end module ]
#-----------------------------------------------------------------------------
end
#===============================================================================
module General
#===============================================================================
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# ☆ General Settings
#-----------------------------------------------------------------------------
# Gauges = [ Color 1 , Color 2 ]
Hp_Colors = [ Text_Color::Dirt_Orange , Text_Color::Gold ]
Mp_Colors = [ Text_Color::Dark_Blue , Text_Color::Sky_Blue ]
Tp_Colors = [ Text_Color::Grey , Text_Color::Pure_Red ]
Exp_Color = [ Text_Color::Deep_Red , Text_Color::Dark_Pink ]
#-----------------------------------------------------------------------------
# Customization Section End.
# There is really no point in trying to edit below this line...
#-----------------------------------------------------------------------------
end
#===============================================================================
# // Customization Section Has Ceased.
# // Only edit the code below if you are able to comprehend its processing.
# // This is a precaution to ensure your sanity remains intact. :)
#===============================================================================
# [url]www.dekyde.com[/url]
# [url]www.dekitarpg.wordpress.com[/url]
#===============================================================================
class RPG::State < RPG::BaseItem
#===============================================================================
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def unbreakable?
if @unbreakable.nil?
@unbreakable = false
if self.note =~ Limit_Break::Notetag
@unbreakable = true
end
end
@unbreakable
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
end
#===============================================================================
class Game_Battler < Game_BattlerBase
#===============================================================================
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
alias :use_item_for_limit :use_item
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def use_item(item)
process_limit_counter(item)
use_item_for_limit(item)
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def process_limit_counter(i)
return unless self.is_a?(Game_Actor)
add_limit_counter if can_process_limit_count?(i)
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def can_process_limit_count?(i)
all_limit_skills.include?(i.id)
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
end
#===============================================================================
class Game_Actor < Game_Battler
#===============================================================================
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
alias :setup_limits :setup
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def setup(actor_id)
setup_limits(actor_id)
setup_limit_break
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def setup_limit_break
@current_limit_skill_id = Limit_Break::Limits[@actor_id].first
@current_limit_arraypos = 0
@times_used_limits = [0] * Limit_Break::Limits[@actor_id].size
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def all_limit_skills
Limit_Break::Limits[@actor_id]
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def limit_skill
$data_skills[@current_limit_skill_id]
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def limit_count(limit_id)
@times_used_limits[limit_id]
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def limit_unlocked?(limit_id)
return true if limit_id == 0
return @times_used_limits[limit_id-1] >= ((limit_id) * 10)
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def add_limit_counter
@times_used_limits[@current_limit_arraypos] += 1
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def set_limit_skill(array_pos)
return unless Limit_Break::Limits[@actor_id][array_pos]
return unless Limit_Break::Limits[@actor_id][array_pos] != @current_limit_skill_id
@current_limit_skill_id = Limit_Break::Limits[@actor_id][array_pos]
@current_limit_arraypos = array_pos
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def can_limit_break?
return false unless tp >= max_tp
return false if states.compact.any? {|s| s.unbreakable? }
return true
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
end
#==============================================================================
class Window_Base < Window
#==============================================================================
#--------------------------------------------------------------------------
# Draw Gauge (w/height)
#--------------------------------------------------------------------------
def draw_deki_gauge(gx, gy, gw, gh, rate, color1, color2)
empty_gauge_color = Color.new(0,0,0,128)
fill_w = [(gw * rate).to_i, gw].min
gauge_h = gh
gauge_y = gy + line_height - 2 - gauge_h
contents.fill_rect(gx, gauge_y, gw, gauge_h, empty_gauge_color)
contents.gradient_fill_rect(gx, gauge_y, fill_w, gauge_h, color1, color2)
end
#--------------------------------------------------------------------------
# Draw Hp
#--------------------------------------------------------------------------
def draw_de_hp(x, y, wid = nil)
wid = self.width/2 - (standard_padding*2) if wid == nil
rate = @actor.hp_rate
color1 = General::Hp_Colors[0]
color2 = General::Hp_Colors[1]
draw_deki_gauge(x, y, wid-x-2, 2, rate, color1, color2)
draw_text(x+4, y, wid, line_height, Vocanicon.param(0)[0])
draw_text(x, y, wid-x-6, line_height, "#{@actor.hp}/#{@actor.mhp}",2)
end
#--------------------------------------------------------------------------
# Draw Mp
#--------------------------------------------------------------------------
def draw_de_mp(x, y, wid = nil)
wid = self.width/2 - (standard_padding*2) if wid == nil
rate = @actor.mp_rate
color1 = General::Mp_Colors[0]
color2 = General::Mp_Colors[1]
draw_deki_gauge(x, y, wid-x-2, 2, rate, color1, color2)
draw_text(x+4, y, wid, line_height, Vocanicon.param(1)[0])
draw_text(x, y, wid-x-6, line_height, "#{@actor.mp}/#{@actor.mmp}",2)
end
#--------------------------------------------------------------------------
# Draw Tp
#--------------------------------------------------------------------------
def draw_de_tp(x, y, wid = nil)
wid = self.width/2 - (standard_padding*2) if wid == nil
rate = @actor.max_tp == 0 ? 0 : @actor.tp.to_i.to_f / @actor.max_tp.to_i
color1 = General::Tp_Colors[0]
color2 = General::Tp_Colors[1]
draw_deki_gauge(x, y, wid-x-2, 2, rate, color1, color2)
draw_text(x+4, y, wid, line_height, Vocanicon::TP[0])
text = "#{(@actor.tp).to_i}/#{@actor.max_tp.to_i}"
draw_text(x, y, wid-x-6, line_height, text,2)
end
#--------------------------------------------------------------------------
# Draw Exp (w/gauge)
#--------------------------------------------------------------------------
def draw_de_xp(x, y, gauge = true)
s1 = @actor.current_level_exp
s2 = @actor.next_level_exp
s1_g = @actor.exp - @actor.current_level_exp
s2_g = @actor.next_level_exp - @actor.current_level_exp
wid = self.width/2 - (standard_padding*2)
wid_b = self.width/2 - (standard_padding)
rate = (s1_g).to_f / (s2_g)
color1 = General::Exp_Color[0]
color2 = General::Exp_Color[1]
draw_deki_gauge(wid_b, y, wid-x-2, 2, rate, color1, color2) if gauge
draw_text(wid_b+4, y, wid, line_height, Vocanicon::Exp[0])
draw_text(wid_b, y, wid-x-2, line_height, "#{@actor.exp}/#{s2}",2)
end
#--------------------------------------------------------------------------
# Draw Icon (w/Hue)
#--------------------------------------------------------------------------
def draw_de_icon(icon_index, x, y, hue = 0, enabled = true)
bitmap = Cache.icon("IconSet",hue)
rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
end
end
#===============================================================================
class Window_CurrentLimit < Window_Selectable
#===============================================================================
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def initialize(actor,y)
super(0, y, Graphics.width, fitting_height(1))
@actor = actor
refresh
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def actor=(actor)
return if @actor == actor
@actor = actor
refresh
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def refresh
contents.clear
text = "Current Limit : #{@actor.limit_skill.name}"
draw_text(0, 0, contents_width, line_height, text ,1)
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
end
#===============================================================================
class Window_LimitCommand < Window_Command
#===============================================================================
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def initialize
super(0, 0)
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def window_width
return Graphics.width / 4
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def visible_line_number
return 2
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def make_command_list
add_command("Change Limit", :change)
add_command("Leave", :leave)
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
end
#===============================================================================
class Window_LimitSelect < Window_Command
#===============================================================================
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def initialize(actor,y)
@actor = actor
@window_y = y
super(0, y)
deactivate
unselect
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def actor=(actor)
return unless @actor != actor
@actor = actor
refresh
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def window_width
return Graphics.width
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def window_height
return Graphics.height - @window_y
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def col_max
return 2
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def make_command_list
return unless @actor && Limit_Break::Limits[@actor.id]
i = 0
Limit_Break::Limits[@actor.id].each do |val|
add_command($data_skills[val].name, :limit_change, limit_locked?(i), val)
i += 1
end
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def limit_locked?(id)
@actor.limit_unlocked?(id)
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def current_limit
command_skill(@index)
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def command_skill(index)
return $data_skills[0] unless @list[index] && @list[index][:ext]
return $data_skills[@list[index][:ext]]
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def draw_item(index)
change_color(normal_color, limit_locked?(index))
p = item_rect_for_text(index)
draw_text(p.x,p.y,p.width,line_height,command_skill(index).name, 1)
draw_text(p.x,p.y+20,p.width,line_height,@actor.limit_count(index).to_s, 1)
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def item_height
(self.height - 24) / 4
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
end
#==============================================================================
class Limit_Help < Window_Base
#==============================================================================
#--------------------------------------------------------------------------
# Object Initialization
#--------------------------------------------------------------------------
def initialize(line_number = 2)
super(0, 0, Graphics.width/4*3, fitting_height(line_number))
@item = nil
end
#--------------------------------------------------------------------------
# Set Text
#--------------------------------------------------------------------------
def set_text(text)
if text != @text
@text = text
refresh
end
end
#--------------------------------------------------------------------------
# Clear
#--------------------------------------------------------------------------
def clear
set_text("")
end
#--------------------------------------------------------------------------
# Set Item , item : Skills and items etc.
#--------------------------------------------------------------------------
def set_item(item)
return if @item == item
@item = item
refresh
set_text(item ? item.description : "")
end
#--------------------------------------------------------------------------
# Refresh
#--------------------------------------------------------------------------
def refresh
contents.clear
draw_text_ex(4, 0, @text)
end
#--------------------------------------------------------------------------
# Reset Font Settings
#--------------------------------------------------------------------------
def reset_font_settings
change_color(normal_color)
self.contents.font.name = ["VL Gothic","Serif","Arial"]
self.contents.font.size = 18
self.contents.font.bold = false
end
end
#===============================================================================
class Window_StatusLimit < Window_Selectable
#===============================================================================
#-----------------------------------------------------------------------------
# Initialization
#-----------------------------------------------------------------------------
def initialize(actor, y)
super(0, y, Graphics.width, 104)
@actor = actor
refresh
end
#-----------------------------------------------------------------------------
# Line Height
#-----------------------------------------------------------------------------
def line_height
return 22
end
#-----------------------------------------------------------------------------
# Window Padding
#-----------------------------------------------------------------------------
def standard_padding
return 8
end
#-----------------------------------------------------------------------------
# Set Actor
#-----------------------------------------------------------------------------
def actor=(actor)
return unless @actor != actor
@actor = actor
refresh
end
#-----------------------------------------------------------------------------
# Do Refresh
#-----------------------------------------------------------------------------
def refresh
contents.clear
return unless @actor
self.contents.font.name = ["VL Gothic","Serif","Arial"]
self.contents.font.size = 18
self.contents.font.bold = false
draw_actor_face(@actor,0,-2,enabled = true)
draw_names
draw_infonshit
end
#-----------------------------------------------------------------------------
# Draw Info And Shit
#-----------------------------------------------------------------------------
def draw_infonshit
x = 104
y = line_height
w = self.width/2 - (standard_padding*2)
draw_info_box(x,y * 1,w-100)
draw_de_hp(x,y*1,w+6)
draw_info_box(x,y * 2,w-100)
draw_de_mp(x,y*2,w+6)
draw_info_box(x,y * 3,w-100)
draw_de_tp(x,y*3,w+6)
end
#-----------------------------------------------------------------------------
# Draw Names ( and Lv )
#-----------------------------------------------------------------------------
def draw_names
x = self.width/2-(standard_padding)+4
y = line_height
nx = self.width/2 - (standard_padding*2)
# // Name
draw_info_box(104,0,nx-100)
draw_text(108, 0, nx, line_height, Vocanicon::Name[0])
draw_text(108, 0, nx-108, line_height, @actor.name.to_s, 2)
# // NickName
draw_info_box(x,0,nx/2-2)
draw_text(x+4, 0, nx/2-2, line_height, Vocanicon::Nick[0])
draw_text(x, 0, nx/2-6, line_height, @actor.nickname.to_s, 2)
# // Class
draw_info_box(x,y*1,nx/2-2)
draw_text(x+4, y*1, nx/2-2, line_height, Vocanicon::Clas[0])
draw_text(x, y*1, nx/2-6, line_height, @actor.class.name,2)
# // Status(s)
draw_info_box(x+(nx/2),0,nx/2+4)
draw_text(x+(nx/2), 0, nx/2-4, line_height, Vocanicon::Stts[0],1)
draw_info_box(x+(nx/2),y*1,nx/2+4)
draw_actor_icons(@actor, x+(nx/2), line_height * 1 - 2,nx/2)
# // Level
lw = nx/3-2
draw_info_box(x,y*2,nx/3-2)
draw_text(x+4, y*2, nx/3-2, line_height, Vocanicon::Level[0])
draw_text(x , y*2, nx/3-6, line_height, "#{@actor.level}",2)
# // SPDS Stats
draw_info_box(x+(nx/3),y*2,nx/3)
if $D13x[:ISPDS]
draw_text(x+(nx/3)+2, y*2, nx/3, line_height, SPDS::DP_Vocab[0])
draw_text(x+(nx/3), y*2, nx/3-4, line_height, "#{@actor.points}", 2)
end
# // SUG Stats
draw_info_box(x+(nx/3*2)+2,y*2,nx/3+6)
if $D13x[:SUG]
draw_text(x+(nx/3*2)+6, y*2, nx/3, line_height, Skill_Upgrade::SP_Vocab[2])
draw_text(x+(nx/3*2), y*2, nx/3, line_height, "#{@actor.skill_points.to_i}", 2)
end
# // Exp
draw_info_box(x,y*3,nx+4)
draw_de_xp(x, y * 3)
end
#-----------------------------------------------------------------------------
# Draw Info Box
#-----------------------------------------------------------------------------
def draw_info_box(x,y,w)
contents.fill_rect(x,y+1,w,line_height-2,Color.new(0,0,0,64))
end
#-----------------------------------------------------------------------------
# Draw Exp (w/gauge)
#-----------------------------------------------------------------------------
def draw_de_xp(x, y, gauge = true)
s1 = @actor.exp # current_level_exp
s2 = @actor.next_level_exp
s1_g = @actor.exp - @actor.current_level_exp
s2_g = @actor.next_level_exp - @actor.current_level_exp
wid = self.width/2 - (standard_padding*2)
wid_b = self.width/2 - (standard_padding)
rate = (s1_g).to_f / (s2_g)
color1 = General::Exp_Color[0]
color2 = General::Exp_Color[1]
draw_deki_gauge(x, y, wid+4, 2, rate, color1, color2) if gauge
draw_text(x+4, y, wid, line_height, Vocanicon::Exp[0])
draw_text(x, y, wid, line_height, "#{s1}/#{s2}",2)
end
end
#===============================================================================
class Scene_Limit < Scene_MenuBase
#===============================================================================
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def start
super
make_command_window
make_help_window
make_status_window
make_current_window
make_select_window
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def make_command_window
@command_window = Window_LimitCommand.new
@command_window.set_handler(:change, method(:change_limit))
@command_window.set_handler(:leave, method(:return_scene))
@command_window.set_handler(:cancel, method(:return_scene))
@command_window.set_handler(:pagedown, method(:next_actor))
@command_window.set_handler(:pageup, method(:prev_actor))
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def make_help_window
@help_window = Limit_Help.new
@help_window.x = Graphics.width / 4
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def make_status_window
@status_window = Window_StatusLimit.new(@actor,@help_window.height)
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def make_current_window
y = @status_window.y + @status_window.height
@current_window = Window_CurrentLimit.new(@actor,y)
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def make_select_window
y = @current_window.y + @current_window.height
@select_window = Window_LimitSelect.new(@actor,y)
@select_window.set_handler(:limit_change, method(:set_limit))
@select_window.set_handler(:cancel , method(:bk2com))
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def change_limit
@command_window.deactivate
@select_window.select(0)
@select_window.activate
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def set_limit
Sound.play_equip
@actor.set_limit_skill(@select_window.index)
@status_window.refresh
@current_window.refresh
bk2com
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def bk2com
@select_window.deactivate
@select_window.unselect
@command_window.activate
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def update
super
updt_help
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def updt_help
if @select_window.active
@help_window.set_text(@select_window.current_limit.description)
elsif @command_window.active
case @command_window.current_symbol
when :change then @help_window.set_text(Limit_Break::Vocab[:change_help])
when :leave then @help_window.set_text(Limit_Break::Vocab[:leave_help])
end
else
@help_window.set_text("")
end
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def on_actor_change
@status_window.actor = @actor
@current_window.actor = @actor
@select_window.actor = @actor
@command_window.activate
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
end
#===============================================================================
class Window_MenuCommand < Window_Command
#===============================================================================
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
alias :amc_limits :add_main_commands
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def add_main_commands
amc_limits
add_command(Limit_Break::Vocab[:menu_command],:limit,main_commands_enabled)
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
end
#===============================================================================
class Scene_Menu < Scene_MenuBase
#===============================================================================
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
alias :ccw_limits_longassaliasname :create_command_window
alias :opoklimitz_longassaliasname :on_personal_ok
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def create_command_window
ccw_limits_longassaliasname
@command_window.set_handler(:limit, method(:command_personal))
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def on_personal_ok
opoklimitz_longassaliasname
if @command_window.current_symbol == :limit
SceneManager.call(Scene_Limit)
end
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
end
#===============================================================================
class Window_ActorCommand < Window_Command
#===============================================================================
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def add_attack_command
if @actor.can_limit_break?
add_command(Limit_Break::Vocab[:battle_command], :limit)
unless Limit_Break::Override
add_command(Vocab::attack, :attack, @actor.attack_usable?)
end
else
add_command(Vocab::attack, :attack, @actor.attack_usable?)
end
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def draw_item(index)
if index == 0 && @actor.can_limit_break?
change_color(Text_Color::Deep_Orange)
else
change_color(normal_color, command_enabled?(index))
end
draw_text(item_rect_for_text(index), command_name(index), alignment)
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
end
#===============================================================================
class Scene_Battle < Scene_Base
#===============================================================================
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
alias :limit_command :create_actor_command_window
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def create_actor_command_window
limit_command
@actor_command_window.set_handler(:limit, method(:command_limit))
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
def command_limit
@skill = BattleManager.actor.limit_skill
BattleManager.actor.input.set_skill(@skill.id)
BattleManager.actor.last_skill.object = @skill
if !@skill.need_selection?
@skill_window.hide
next_command
elsif @skill.for_opponent?
select_enemy_selection
else
select_actor_selection
end
end
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
end
#===============================================================================
# [url]http://dekitarpg.wordpress.com/[/url]
#===============================================================================
end # if false / true