#==============================================================================
# ** JobChanger for VX, by Blackmorning
# last updated 31/07/10 (Version 2.02)
# Some features taken from tkblackknight, Prexus & Yanfly Job Changers
# and from Enelvon
#==============================================================================
=begin
********************************************************************************
Updates
********************************************************************************
31/07/10
- cleaned up a few points, some bugs fixed (higher class levels)
12/07/10
- compatible with YEM Battler Stat: RES and Battler Stat: DEX (requested by Kaimi)
23/06/10
- change in how skills are forgotten when changing classes
16/02/10
- compatible with YEZ Battler Stat: RES and Battler Stat: DEX (requested by sol003)
18/11/09
- fixed jp earned during fight (noticed by Slajmboll)
23/08/09
- minor visual improvements when no jp is used
04/08/09
- when not gaining jp by any means, skills are learnt by actor level (original way)
28/07/09
- can make items to add/remove classes
- fixed class adding and removing from list (now works when reloading)
- fixed when class level up bonus based on actor's level
22/07/09
- bug fix
# requests by Andrelvis
- can modify jp needed to go up a level
- icons can appear next to class in job changer window
20/07/09
- level up bonuses can be by either class level or actor level
- skills fix when initialized actor is higher level
16/07/09
- fixed minor issue with custom menus
14/07/09
- added check actor class list size
13/07/09
- customizable description of class on help window
30/06/09
- level up stat bonuses now based on class level.
( ie. stats increase as class level increases )
29/06/09
- compability fix with special classes (ie. OriginalWij sequence skills)
- issue fixed when regular level up
28/06/09
- minor formatting errors cleared up
- check any actor class level and assign it to a variable
( good for creating events to add classes )
- fixed issue with character change
26/06/09
- skill window help opacity 255
- item (jp gain) fixed
- can show class level in status & menu status screen
#===============================================================================
WHAT IT DOES:
* This script basically gives you an interface to allow the player to select
which Class to switch to for each character.
* Actors Base Stats can be changed based on class
* Added BigEd781's Class Dependant Stat Bonuses
* Actor options (ie. Super Guard, 2-swords, autobattle, pharmacology) can be
based on Class chosen
* Actor character graphic can be based on Class chosen
*******************************************************************************
Added = From Prexus - Job Changer (v1.0) & Yanfly
* Experience is totalled for characters and their Classes, individually.
* Classes gain levels, Jobs determine what skills you learn.
* Class Levels/Exp are remembered when changing jobs.
*******************************************************************************
Script calls (events):
To assign an actor's class list size to a variable
actor_class_list_size(actor, variable_id)
For example:
actor_class_list_size(1, 5)
assigns actor 1 class list size to variable 5
To assign an actor's class level to a variable
check_class_level(actor, class_id, variable_id)
For example:
check_class_level(1, 1, 5)
assigns actor 1 class 1 level to variable 5
To increase the level of a specific job for an actor:
<#Game_Actor>.class_level_up(ID of Class)
For example:
$game_party.members[0].class_level_up(2)
* Allows you to enable or disable the JobChange screen on the main command menu.
This also actives or deactivates CLASSES_SWITCH.
permit_jobchange(true/false)
New script commands: Used in script in Event Commands
Character_Class.new_class(actor,class_id):
*Adds a class to the selected actor:
Character_Class.new_class(1,6)
Ralph learns Dark Knight or:
Character_Class.new_class($game_party.actors[2].id,6)
party actor 2 learns Dark Knight
*Removes Class from character
Character_Class.remove_class(actor_id,class_id)
doesn't work if character is currently at that class
********************************************************************************
Added from Yanfly
********************
*SKILL TAGS - notebox.
********************
<jp_boost_set x>
If an actor uses this skill, that actor will gain x set amount of JP.
<jp_boost_ran x>
If an actor uses this skill, that actor will gain x random amount of JP.
********************
*ITEM TAGS - notebox.
********************
<gain_jp x>
The item will give the target ally JP of x amount. JP is given to whatever
the ally's current class is.
<unlock class x>
The item will unlock class x for the target ally. Use multiple of these tags
if you want an item to unlock more than one class.
<lock class x>
The item will lock class x for the target ally. Use multiple of these tags if
you want an item to lock more than one class.
********************
*ENEMY TAGS - notebox.
********************
<enemy_jp x>
This determines the amount of JP given by that enemy. If nothing is determined
by this set value and you allow your enemies to give JP, then the JP delivered
will equal to the ENEMIES_DEFAULT amount.
********************
*STATE TAGS - notebox
********************
<bonus_jp_per x>
JP gain rate is x%. If x is 200, then the JP gain rate is 200%.
<bonus_jp_set x>
x is added to JP gain. This means if JP gain is 20 and x is 10, total is 30.
********************************************************************************
* Not 100% tested, please report any bugs
********************************************************************************
=end
#===============================================================================
# * Customize *
#===============================================================================
module S_B
module CLASS
#-----------------------------------------------------------------------------
# Name for the experience gained for Job class
#-----------------------------------------------------------------------------
CLASS_EXP = "Job EXP"
CLASS_EXP_A = "JP"
#-----------------------------------------------------------------------------
# What appears in the menu to call script
#-----------------------------------------------------------------------------
MENU_CLASS_CHANGE_TITLE = "Job"
#-----------------------------------------------------------------------------
# Shows actors' class level in main menu & status screens
#-----------------------------------------------------------------------------
SHOW_CLASS_LVL_MAIN = true
SHOW_CLASS_LVL_STATUS = true
#-----------------------------------------------------------------------------
# Whether or not class changing is allowed at the begining of the game
#-----------------------------------------------------------------------------
MENU_CLASS_CHANGE_OPTION = false
#-----------------------------------------------------------------------------
# Switch ID to enable class changing in the menu
#-----------------------------------------------------------------------------
DISABLE_CLASS = 101
HIDE_CLASS = 102
#-----------------------------------------------------------------------------
# JP earned through various battle options *Yanfly
#-----------------------------------------------------------------------------
USE_BONUS_JP = false
# This sets whether or not you'd like your actors to display the JP they've
# earned in battle (since every action adds JP)
DISPLAY_BONUS_JP = false
DISPLAY_ACTOR_MSG = "%s earned %d #{S_B::CLASS::CLASS_EXP_A}!"
# JP is earned throughout battle from different effects. You can determine
# what will earn JP here and by how much. Set amounts are the increases that
# will always occur so long as the action is enabled. Random amounts will
# increase the JP earned from 0 to that amount.
EARN_JP_VIA_ATTACK_ENABLE = true # Normal attacks will earn JP.
EARN_JP_VIA_ATTACK_AMOUNT = 3 # Earns at least this amount of JP.
EARN_JP_VIA_ATTACK_RANDOM = 0 # Earns up to this random amount.
EARN_JP_VIA_SKILL_ENABLE = true # Skills will earn JP.
EARN_JP_VIA_SKILL_AMOUNT = 5 # Earns at least this amount of JP.
EARN_JP_VIA_SKILL_RANDOM = 0 # Earns up to this random amount.
EARN_JP_VIA_GUARD_ENABLE = false # Guarding will earn JP.
EARN_JP_VIA_GUARD_AMOUNT = 2 # Earns at least this amount of JP.
EARN_JP_VIA_GUARD_RANDOM = 0 # Earns up to this random amount.
EARN_JP_VIA_ITEMS_ENABLE = true # Using items will earn JP.
EARN_JP_VIA_ITEMS_AMOUNT = 1 # Earns at least this amount of JP.
EARN_JP_VIA_ITEMS_RANDOM = 0 # Earns up to this random amount.
#-----------------------------------------------------------------------------
# JP from enemies *Yanfly
# This determines whether or not enemies will give JP if killed and the
# default amount if not set with <enemy jp x>.
#-----------------------------------------------------------------------------
ENEMIES_GIVE_JP = true
ENEMIES_JP_DEFAULT = 0
#-----------------------------------------------------------------------------
# Vocab for end of combat *Prexus
#-----------------------------------------------------------------------------
ObtainClassExp = "%s #{S_B::CLASS::CLASS_EXP_A} was earned!"
# first %s is # of JP earned
ClassLevelUp = "%s is now %s %s %s!"
# first %s is actor, second %s is class, third & fourth %s is level
#-----------------------------------------------------------------------------
# Maximum level per job *Blackmorning and Mithran
# DO NOT go above 99
#-----------------------------------------------------------------------------
MAX_CLASS_LEVEL_DEFAULT = 99
CLASS_MAX_LEVELS = {} # Do not alter this line!
# Below here, set up the individiual max levels for each class.
# CLASS_MAX_LEVELS[class_id] = maxlevel
CLASS_MAX_LEVELS[1] = 99
# ie Paladin is capped at level 30
CLASS_MAX_LEVELS[2] = 99
# ie Warrior is capped at level 99
CLASS_MAX_LEVELS[3] = 99
# ie Priest is capped at level 99
CLASS_MAX_LEVELS[4] = 99
# ie Magician is capped at level 50
#-----------------------------------------------------------------------------
# Icon used to show MAX level *Blackmorning
#-----------------------------------------------------------------------------
MASTERED_ICON = 102
#-----------------------------------------------------------------------------
# Icon beside skills in class menu
#-----------------------------------------------------------------------------
Skills_Icon = 128
#-----------------------------------------------------------------------------
# Button to show skills window in job change
#-----------------------------------------------------------------------------
SHOW_SKILLS_WINDOW = Input::A
#-----------------------------------------------------------------------------
# CLASS SPECIFIC CHARACTER GFX - *Enelvon
# file format:
# $"actor_ID"_"class_ID"
# ie. $1_5 for actor 1, class 5
#-----------------------------------------------------------------------------
CHANGE_GRAPHIC = true
#-----------------------------------------------------------------------------
# Available classes are the classes that each actor starts out with.
AVAILABLE_CLASSES = { # don't remove
# format: actor_id => [class_id, class_id...],
#-----------------------------------------------------------------------------
1 => [1,2,3,4,5,6,7],
2 => [2,5],
3 => [3,6],
4 => [4,7],
5 => [1,2,5,6],
6 => [5,6],
7 => [7],
8 => [7,8],
} # don't remove
#-----------------------------------------------------------------------------
# If set to true, actor keeps skills learned when changing classes
# if false, loses ALL skills learnt by previous class (those specific to the class)
#-----------------------------------------------------------------------------
KEEP_SKILLS = true
#-----------------------------------------------------------------------------
# Enter the ID's of the characters that always keep their skills
# characters that ignore KEEP_SKILLS = false
#-----------------------------------------------------------------------------
SPECIAL_CLASS_ACTORS = [5]
#-----------------------------------------------------------------------------
# Define which Class_ID's use these special options. *TBK
#-----------------------------------------------------------------------------
CHANGE_ACTOR_OPTIONS = false
CRITICAL_CLASSES = [0]
TWOSWORDS_CLASSES = [0]
# Actor will automatically attack.
AUTOBATTLE_CLASSES = [0]
# Actor will take even less damage when guarding.
SUPERGUARD_CLASSES = [0,0,0]
# Items will have double effect when used by actor.
PHARMACOLOGY_CLASSES = [0]
#-----------------------------------------------------------------------------
HALP_MP_CLASSES = [9]
HP_RECOVER = [9]
FAST_ATTACK = [9,8]
#-----------------------------------------------------------------------------
# Yanfly Engine RD - Battler Stat: Barehand
# Last Date Updated: 2009.05.14
#-----------------------------------------------------------------------------
# For those that would like to give their actors stronger strength when no
# weapon is equipped, there is a barehand stat now. You can adjust how strong
# an actor's barehanded multiplier will grow each level so that way, you don't
# have your actors going over the top strong from the beginning.
#-----------------------------------------------------------------------------
# This is the array of classes that can fight barehanded.
BAREHANDED_CLASSES = [8]
# This is the multiplier given to base attack when no weapon is equipped.
BAREHAND_BASE_MULTIPLIER = 150
BAREHAND_PER_LEVEL_BOOST = 5 # based on class level
BAREHAND_MAX_MULTIPLIER = 400
#-----------------------------------------------------------------------------
# CLASS "BASED STAT MULTIPLIER" - *Enelv-on - specifically for the JobChanger
# Redesigned by Blackmorning
#-----------------------------------------------------------------------------
# Below are the Multipliers for each Class ID/Stat
# Class ID => Stat Multipliers
# example: if you want Class_ID #1 to have normal MAXHP (ie 100%)
# you would set the multiplier to 1.0
#-----------------------------------------------------------------------------
# This determines whether or not actor stats are affected by their what
# class they have equipped.
CHANGE_BASE_STATS = true
# This affects the display type for new stats.
# if true, Shows the increase/decrease in the stat.
# if false, Shows the new stat itself.
SHOW_DIFFERENCE = true
#-----------------------------------------------------------------------------
BASE_STAT_CHANGE = { # <--- Do not remove
# res and dex only active with YEZ Battler stats res and dex
# Class HP MP ATK DEF INT AGI RES DEX
0 => [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1, 1], #default
1 => [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1, 1], #default
2 => [ 0.9, 1.2, 0.8, 0.8, 1.2, 1.0, 0.9, 0.8], #Mage
3 => [ 1.2, 0.8, 1.2, 0.8, 0.8, 1.0, 0.5, 0.8], #Warrior
4 => [ 0.9, 1.0, 1.0, 0.8, 1.0, 1.2, 1.1, 0.8], #Sneak
5 => [ 1.0, 1.1, 0.9, 1.1, 1.1, 0.8, 1.1, 0.8], #Medic
6 => [ 1.1, 0.8, 1.1, 1.2, 0.8, 0.8, 1.0, 1.0], #Knight
7 => [ 0.8, 1.0, 1.0, 0.9, 1.1, 1.1, 1, 1], #Shadow
} # Do not remove this.
#==========================================================================
# BigEd781's Class Dependant Stat Bonuses
#--------------------------------------------------------------------------
# The purpose of this is to allow one to set stat
# bonuses upon class level up depending on the player's class.
#==========================================================================
# * When the below value is set to "true", the table of constant values
# below it are used to determine class level up bonuses are, depending
# on the class.
#-----------------------------------------------------------------------------
LEVEL_UP_BONUSES = true
CLASS_LEVEL_UP_BONUS_CLASS_DEP = false
# if true, bonuses based on class level
# if false, bonuses based on actor level
#-----------------------------------------------------------------------------
# * Configuration module
#-----------------------------------------------------------------------------
STAT_BONUS = { # <--- Do not remove
# res and dex only active with YEZ Battler stats res and dex
# Class HP MP ATK DEF INT AGI RES DEX
1 => [ 0, 0, 1, 0, 1, 0, 0, 0], #Paladin
2 => [ 0, 2, 0, 0, 1, 0, 0, 0], #Mage
3 => [ 4, 0, 1, 0, 0, 0, 0, 0], #Warrior
4 => [ 0, 0, 1, 0, 0, 1, 0, 0], #Thief
5 => [ 0, 2, 0, 1, 0, 0, 0, 0], #Medic
6 => [ 4, 0, 0, 1, 0, 0, 0, 0], #Knight
7 => [ 0, 0, 0, 0, 1, 1, 0, 0], #Phantom
} # Do not remove this.
#-----------------------------------------------------------------------------
# if level is decreased, are stat bonuses lost?
#=============================================================================
LOSE_STAT_BONUS = true
#=============================================================================
# Description of the class for the help window
#-----------------------------------------------------------------------------
# format: class_id => ["description"],
Class_Descriptions = { # <--- Do not remove
1 =>["[Wk: None][Res: None] Well rounded. Uses swords."], #Hero
2 =>["[Wk: Earth][Res: Electric] Frail, yet strong. Uses staves."], #Beserker
3 =>["[Wk: Water][Res: Fire] Very powerful. Uses axes."], #Priest
4 =>["[Wk: Electric][Res: Water] Quick and nimble. Uses knives."], #Magician
5 =>["[Wk: Ice][Res: Wind] Heals allies. Uses staves."],#Knight
6 =>["[Wk: Wind][Res: Earth] A durable defender. Uses axes."], #Dark Knight
7 =>["[Wk: Fire][Res: Ice] Clever and mysterious. Uses knives."], #Grappler
8 =>["Professional sneak and highwayman."],#Thief
}# <--- Do not remove
#=============================================================================
# icons appear next to class in job changer window # requested by Andrelvis
USE_ICONS_FOR_CLASSES = true
# format: class_id => [icon_id],
Class_Icons = { # <--- Do not remove
0 => 0, #default if no icon assigned
1 => 2,
2 => 32,
3 => 6,
4 => 48,
5 => 189,
6 => 52,
7 => 39,
8 => 147,
} # <--- Do not remove
#-----------------------------------------------------------------------------
Custom_JP_Needed_For_Level = true
# If true, uses exp_list as starting values and similar formula.
# If false, solely uses exp_list for jp needed for class level up.
CLASS_JP_MOD_BASIS = 20
CLASS_JP_MOD_INFLATION = 10
CLASS_JP_MOD = {# <--- Do not remove
#format: class_id => [basis, inflation],
9 => [20, 15],
10 => [10, 20],
11 => [25, 25],
}# <--- Do not remove
end
end
#=============================================================================
# * End Customization *
#=============================================================================
# Don't touch, all customizations can be done in the script above.
#===============================================================================
module S_B::CLASS
module_function
def permit_jobchange(enabled = true)
if enabled
$game_switches[S_B::CLASS::DISABLE_CLASS] = false
else
$game_switches[S_B::CLASS::DISABLE_CLASS] = true
end
end
#--------------------------------------------------------------------------
def check_class_level(actor, class_id, variable_id = 0)
level = 2
c = $data_classes[class_id]
level = $game_actors[actor].class_level[c.id]
$game_variables[variable_id] = level if variable_id > 0
return level
end
#--------------------------------------------------------------------------
def actor_class_list_size(actor, variable_id = 0)
class_list = $game_actors[actor].unlocked_classes
$game_variables[variable_id] = class_list.size if variable_id > 0
return class_list
end
end
#===============================================================================
class Game_Interpreter
include S_B::CLASS
end
#===============================================================================
module Vocab
ObtainClassExp = S_B::CLASS::ObtainClassExp
ClassLevelUp = S_B::CLASS::ClassLevelUp
Display_Actor_Msg = S_B::CLASS::DISPLAY_ACTOR_MSG
Classes_Vocab = S_B::CLASS::MENU_CLASS_CHANGE_TITLE
def self.jp
return S_B::CLASS::CLASS_EXP
end
def self.jp_a
return S_B::CLASS::CLASS_EXP_A
end
end
$imported = {} if $imported == nil
$imported["JobChange"] = true
#===============================================================================
module YE
module REGEXP
module BASEITEM
# These are skill related.
JP_BOOST_SET = /<(?:JP_BOOST_SET|jp_boost_set)\s*(\d+)>/i
JP_BOOST_RAN = /<(?:JP_BOOST_RAN|jp_boost_ran)\s*(\d+)>/i
# These are item related.
GAIN_JP = /<(?:GAIN_JP|gain_jp)\s*(\d+)>/i
UNLOCK_CLASS = /<(?:UNLOCK_CLASS|unlock class)[ ]*(\d+)>/i
LOCK_CLASS = /<(?:LOCK_CLASS|lock class)[ ]*(\d+)>/i
end # BASEITEM
module ENEMY
# These are enemy related
ENEMY_JP = /<(?:ENEMY_JP|enemy_jp)\s*(\d+)>/i
end # ENEMY
module STATE
# This affects states.
BONUS_JP_PER = /<(?:BONUS_JP_PER|bonus_jp_per)[ ]*(\d+)(?:%|%)?>/i
BONUS_JP_SET = /<(?:BONUS_JP_SET|bonus_jp_set)[ ]*(\d+)>/i
end # STATE
end # REGEXP
end # YE
#===============================================================================
# RPG::State *from yanfly
#===============================================================================
class RPG::State
#--------------------------------------------------------------------------
# Yanfly_Cache_SSS
#--------------------------------------------------------------------------
def yanfly_cache_state_sss
@bonus_jp_per = 100; @bonus_jp_set = 0
self.note.split(/[\r\n]+/).each { |line|
case line
when YE::REGEXP::STATE::BONUS_JP_PER
@bonus_jp_per = $1.to_i
when YE::REGEXP::STATE::BONUS_JP_SET
@bonus_jp_set = $1.to_i
end
}
end # cache
#--------------------------------------------------------------------------
# definitions
#--------------------------------------------------------------------------
def bonus_jp_per
yanfly_cache_state_sss if @bonus_jp_per == nil
return @bonus_jp_per
end
def bonus_jp_set
yanfly_cache_state_sss if @bonus_jp_set == nil
return @bonus_jp_set
end
end
#===============================================================================
# RPG::BaseItem *from yanfly
#===============================================================================
class RPG::BaseItem
#--------------------------------------------------------------------------
# Yanfly_Cache_SSS
#--------------------------------------------------------------------------
def yanfly_cache_baseitem_sss
@jp_boost_set = 0; @jp_boost_ran = 0
@gain_jp = 0; @unlock_class = []; @lock_class = []
self.note.split(/[\r\n]+/).each { |line|
case line
when YE::REGEXP::BASEITEM::JP_BOOST_SET
@jp_boost_set = $1.to_i
when YE::REGEXP::BASEITEM::JP_BOOST_RAN
@jp_boost_ran = $1.to_i
when YE::REGEXP::BASEITEM::GAIN_JP
@gain_jp = $1.to_i
when YE::REGEXP::BASEITEM::UNLOCK_CLASS
@unlock_class.push($1.to_i)
when YE::REGEXP::BASEITEM::LOCK_CLASS
@lock_class.push($1.to_i)
end
}
end # cache
#--------------------------------------------------------------------------
# JP definitions
#--------------------------------------------------------------------------
def jp_boost_set
yanfly_cache_baseitem_sss if @jp_boost_set == nil
return @jp_boost_set
end
def jp_boost_ran
yanfly_cache_baseitem_sss if @jp_boost_ran == nil
return @jp_boost_ran
end
def gain_jp
yanfly_cache_baseitem_sss if @gain_jp == nil
return @gain_jp
end
#--------------------------------------------------------------------------
# class definitions
#--------------------------------------------------------------------------
def unlock_class
yanfly_cache_baseitem_sss if @unlock_class == nil
return @unlock_class
end
def lock_class
yanfly_cache_baseitem_sss if @lock_class == nil
return @lock_class
end
end
#===============================================================================
# RPG::Enemy *from yanfly
#===============================================================================
class RPG::Enemy
#--------------------------------------------------------------------------
# Yanfly_Cache_SSS
#--------------------------------------------------------------------------
def yanfly_cache_enemy_sss
@enemy_jp = S_B::CLASS::ENEMIES_JP_DEFAULT
self.note.split(/[\r\n]+/).each { |line|
case line
when YE::REGEXP::ENEMY::ENEMY_JP
@enemy_jp = $1.to_i
end
}
end # cache
#--------------------------------------------------------------------------
# definitions
#--------------------------------------------------------------------------
def enemy_jp
yanfly_cache_enemy_sss if @enemy_jp == nil
return @enemy_jp
end
end
#==============================================================================
# ** Game_Actor *from prexus and TBK and blackmorning
#==============================================================================
class Game_Actor < Game_Battler
attr_accessor :jp_list
attr_accessor :jp_exp
attr_accessor :class_level
#--------------------------------------------------------------------------
alias job_initialize initialize unless $@
#--------------------------------------------------------------------------
def initialize(actor_id)
job_initialize(actor_id)
@exist_character_graphics = []
end
#--------------------------------------------------------------------------
alias job_setup setup unless $@
#--------------------------------------------------------------------------
def setup(actor_id)
job_setup(actor_id) #default
@jp_list = {}
for id in 1..$data_classes.size - 1
next unless $data_classes[id]
@jp_list[id] = Array.new(101)
end
make_jp_exp_list
@jp_exp = {}
@jp_exp.default = 0
@class_level = {}
@class_level.default = 1
@skills = []
define_skills
@unlocked_classes = S_B::CLASS::AVAILABLE_CLASSES[self.id] # What classes are unlocked.
@unlocked_classes = [self.class.id] if S_B::CLASS::AVAILABLE_CLASSES[self.id] == nil
end
#--------------------------------------------------------------------------
# * Calculate JP Experience
#--------------------------------------------------------------------------
def make_jp_exp_list
for id in 1..$data_classes.size - 1
next unless $data_classes[id]
if S_B::CLASS::Custom_JP_Needed_For_Level
if S_B::CLASS::CLASS_JP_MOD.include?(id)
jp_basis = S_B::CLASS::CLASS_JP_MOD[id][0]
jp_inflation = S_B::CLASS::CLASS_JP_MOD[id][1]
else
jp_basis = S_B::CLASS::CLASS_JP_MOD_BASIS
jp_inflation = S_B::CLASS::CLASS_JP_MOD_INFLATION
end
maxlevel = S_B::CLASS::CLASS_MAX_LEVELS[id]
maxlevel = S_B::CLASS::MAX_CLASS_LEVEL_DEFAULT if maxlevel == nil
@jp_list[id][1] = @jp_list[id][maxlevel+1] = 0
m = jp_basis
n = (0.5 + jp_inflation / 200.0);
for i in 2..(maxlevel)
@jp_list[id][i] = @jp_list[id][i - 1] + Integer(m)
m *= 1 + n;
n *= 0.895;
end
else
@jp_list[id] = @exp_list
end
end
end
#--------------------------------------------------------------------------
def forget_class_skills(id = nil)
id = @class_id if id == nil
for i in $data_classes[id].learnings
forget_skill(i.skill_id) unless S_B::CLASS::KEEP_SKILLS or S_B::CLASS::SPECIAL_CLASS_ACTORS.include?(actor.id)
end
end
#--------------------------------------------------------------------------
def define_skills(id = nil)
id = @class_id if id == nil
if !S_B::CLASS::USE_BONUS_JP && !S_B::CLASS::ENEMIES_GIVE_JP
for i in $data_classes[id].learnings
learn_skill(i.skill_id) if i.level <= @level
end
else
for i in $data_classes[id].learnings
learn_skill(i.skill_id) if i.level <= @class_level[id]
end
end
end
#--------------------------------------------------------------------------
def change_jp(jp, id = nil, show = false)
id = @class_id if id == nil
last_level = @class_level[id]
last_skills = skills
@jp_exp[id] = [[jp, 999999].min, 0].max
while @jp_exp[id] >= @jp_list[id][@class_level[id] + 1] and @jp_list[id][@class_level[id] + 1] > 0
class_level_up(id)
end
while @jp_exp[id] < @jp_list[id][@class_level[id]]
class_level_down(id)
end
if show and @class_level[id] > last_level
display_class_level_up(skills - last_skills, id)
end
end
#--------------------------------------------------------------------------
def jp_exp_s(id = nil)
id = @class_id if id == nil
return @jp_list[id][@class_level[id]+1] > 0 ? @jp_exp[id] : "-------"
end
#--------------------------------------------------------------------------
# * Get jp - numeric for calculations
#--------------------------------------------------------------------------
def now_jp_exp(id = nil)
id = @class_id if id == nil
return @jp_exp[id] - @jp_list[id][@class_level[id]]
end
#--------------------------------------------------------------------------
def next_jp_exp_s(id = nil)
id = @class_id if id == nil
return @jp_list[id][@class_level[id]+1] > 0 ? @jp_list[id][@class_level[id]+1] : "-------"
end
#--------------------------------------------------------------------------
def next_class_rest_exp_s(id = nil)
id = @class_id if id == nil
return @jp_list[id][@class_level[id]+1] > 0 ? (@jp_list[id][@class_level[id]+1] - @jp_exp[id]) : "-------"
end
#--------------------------------------------------------------------------
def class_level_up(id = nil, adjust = false)
id = @class_id if id == nil
maxlevel = S_B::CLASS::CLASS_MAX_LEVELS[id]
maxlevel = S_B::CLASS::MAX_CLASS_LEVEL_DEFAULT if maxlevel == nil
@class_level[id] += 1 unless @class_level[id] == maxlevel
@jp_exp[id] = @jp_list[id][@class_level[id]]
if S_B::CLASS::LEVEL_UP_BONUSES
if S_B::CLASS::CLASS_LEVEL_UP_BONUS_CLASS_DEP && S_B::CLASS::STAT_BONUS.include?(id)
self.maxhp += S_B::CLASS::STAT_BONUS[id][0]
self.maxmp += S_B::CLASS::STAT_BONUS[id][1]
self.atk += S_B::CLASS::STAT_BONUS[id][2]
self.def += S_B::CLASS::STAT_BONUS[id][3]
self.spi += S_B::CLASS::STAT_BONUS[id][4]
self.agi += S_B::CLASS::STAT_BONUS[id][5]
self.res += S_B::CLASS::STAT_BONUS[id][6] if $imported["BattlerStatRES"] or $imported["RES Stat"]
self.dex += S_B::CLASS::STAT_BONUS[id][7] if $imported["BattlerStatDEX"] or $imported["DEX Stat"]
end
end
define_skills
define_skills(id) if S_B::CLASS::KEEP_SKILLS or S_B::CLASS::SPECIAL_CLASS_ACTORS.include?(actor.id)
end
#--------------------------------------------------------------------------
def class_level_down(id = nil, adjust = false)
id = @class_id if id == nil
@class_level[id] -= 1 unless @class_level[id] == 1
@jp_exp[id] = @jp_list[id][@class_level[id]]
if S_B::CLASS::LEVEL_UP_BONUSES
if S_B::CLASS::CLASS_LEVEL_UP_BONUS_CLASS_DEP && S_B::CLASS::LOSE_STAT_BONUS && S_B::CLASS::STAT_BONUS.include?(id)
self.maxhp -= S_B::CLASS::STAT_BONUS[id][0]
self.maxmp -= S_B::CLASS::STAT_BONUS[id][1]
self.atk -= S_B::CLASS::STAT_BONUS[id][2]
self.def -= S_B::CLASS::STAT_BONUS[id][3]
self.spi -= S_B::CLASS::STAT_BONUS[id][4]
self.agi -= S_B::CLASS::STAT_BONUS[id][5]
self.res -= S_B::CLASS::STAT_BONUS[id][6] if $imported["BattlerStatRES"] or $imported["RES Stat"]
self.dex -= S_B::CLASS::STAT_BONUS[id][7] if $imported["BattlerStatDEX"] or $imported["DEX Stat"]
end
end
define_skills
define_skills(id) if S_B::CLASS::KEEP_SKILLS or S_B::CLASS::SPECIAL_CLASS_ACTORS.include?(actor.id)
end
#--------------------------------------------------------------------------
# level up
#--------------------------------------------------------------------------
def level_up
@level += 1
if S_B::CLASS::LEVEL_UP_BONUSES
if !S_B::CLASS::CLASS_LEVEL_UP_BONUS_CLASS_DEP && S_B::CLASS::STAT_BONUS.include?(id)
self.maxhp += S_B::CLASS::STAT_BONUS[id][0]
self.maxmp += S_B::CLASS::STAT_BONUS[id][1]
self.atk += S_B::CLASS::STAT_BONUS[id][2]
self.def += S_B::CLASS::STAT_BONUS[id][3]
self.spi += S_B::CLASS::STAT_BONUS[id][4]
self.agi += S_B::CLASS::STAT_BONUS[id][5]
self.res += S_B::CLASS::STAT_BONUS[id][6] if $imported["BattlerStatRES"] or $imported["RES Stat"]
self.dex += S_B::CLASS::STAT_BONUS[id][7] if $imported["BattlerStatDEX"] or $imported["DEX Stat"]
end
end
end
#--------------------------------------------------------------------------
alias jp_leveldown level_down unless $@
#--------------------------------------------------------------------------
def level_down
jp_leveldown
if S_B::CLASS::LEVEL_UP_BONUSES
if !S_B::CLASS::CLASS_LEVEL_UP_BONUS_CLASS_DEP && S_B::CLASS::LOSE_STAT_BONUS && S_B::CLASS::STAT_BONUS.include?(id)
self.maxhp -= S_B::CLASS::STAT_BONUS[id][0]
self.maxmp -= S_B::CLASS::STAT_BONUS[id][1]
self.atk -= S_B::CLASS::STAT_BONUS[id][2]
self.def -= S_B::CLASS::STAT_BONUS[id][3]
self.spi -= S_B::CLASS::STAT_BONUS[id][4]
self.agi -= S_B::CLASS::STAT_BONUS[id][5]
self.res -= S_B::CLASS::STAT_BONUS[id][6] if $imported["BattlerStatRES"] or $imported["RES Stat"]
self.dex -= S_B::CLASS::STAT_BONUS[id][7] if $imported["BattlerStatDEX"] or $imported["DEX Stat"]
end
end
end
#--------------------------------------------------------------------------
def jp_received(jp, id = nil, show = false)
id = @class_id if id == nil
change_jp(@jp_exp[id] + jp, id, show)
end
#--------------------------------------------------------------------------
# forget all skills
#--------------------------------------------------------------------------
def forget_all_skills
@skills = []
end
#--------------------------------------------------------------------------
def class_change_level(level, id = nil, show = false)
id = @class_id if id == nil
maxlevel = S_B::CLASS::CLASS_MAX_LEVELS[id]
maxlevel = S_B::CLASS::MAX_CLASS_LEVEL_DEFAULT if maxlevel == nil
level = [[level, maxlevel].min, 1].max
change_jp(@jp_list[id][level], id, show)
end
#--------------------------------------------------------------------------
def class_id=(class_id)
forget_class_skills
@class_id = class_id
for i in 0..4 # Remove unequippable items
change_equip(i, nil) unless equippable?(equips[i])
end
if $imported["EquipExtension"]
return if extra_armor_number == 0
for i in 5..armor_number
change_equip(i, nil) unless equippable?(equips[i])
end
end
purge_unequippable if $imported["EquipmentOverhaul"]
unless @unlocked_classes.include?(@class_id)
@unlocked_classes.push(@class_id)
end
@unlocked_classes.sort!
purge_unequippable_skills if $imported["SkillCPSystem"]
define_skills
pic_name = "$#{actor.id}_#{$data_classes[class_id].id}"
if S_B::CLASS::CHANGE_GRAPHIC && graphic_exist?(pic_name)
$game_actors[@actor_id].set_graphic(pic_name, 0, @face_name, @face_index)
$game_player.refresh
end
end
#--------------------------------------------------------------------------
# return unlocked classes
#--------------------------------------------------------------------------
def unlocked_classes
results = []
@unlocked_classes = [self.class.id] if @unlocked_classes == nil
@unlocked_classes.sort!
results = @unlocked_classes
results.push(self.class.id) unless results.include?(self.class.id)
return results
end
#--------------------------------------------------------------------------
# perform unlock class
#--------------------------------------------------------------------------
def unlock_class(newclass_id)
@unlocked_classes = [self.class.id] if @unlocked_classes == nil
unless @unlocked_classes.include?(newclass_id)
@unlocked_classes.push(newclass_id)
end
@unlocked_classes.sort!
end
#--------------------------------------------------------------------------
# perform lock class
#--------------------------------------------------------------------------
def lock_class(newclass_id)
return if newclass_id == self.class.id
@unlocked_classes = [self.class.id] if @unlocked_classes == nil
@unlocked_classes.delete(newclass_id)
@unlocked_classes.sort!
end
#--------------------------------------------------------------------------
# perform unlock all classes
#--------------------------------------------------------------------------
def unlock_all_classes
for i in 0..$data_classes.size
unlock = $data_classes[i + 1]
self.unlock_class(unlock.id)
end
@unlocked_classes.sort!
end
#--------------------------------------------------------------------------
# perform lock all classes
#--------------------------------------------------------------------------
def lock_all_classes
for i in 0..$data_classes.size
unlock = $data_classes[i + 1]
self.lock_class(unlock.id)
end
@unlocked_classes.sort!
end
#--------------------------------------------------------------------------
# * Determine if Graphic Filename Exists
#--------------------------------------------------------------------------
def graphic_exist?(filename)
return true if @exist_character_graphics.include?(filename)
begin
Cache.character(filename)
@exist_character_graphics.push(filename)
return true
rescue
return false
end
end
#--------------------------------------------------------------------------
def display_class_level_up(new_skills, id)
$game_message.new_page
i = @class_id
c = $data_classes[i]
level = @class_level[c.id]
text = sprintf(Vocab::ClassLevelUp, @name, $data_classes[id].name, Vocab::level, level.to_s)
$game_message.texts.push(text)
for skill in new_skills
text = sprintf(Vocab::ObtainSkill, skill.name)
$game_message.texts.push(text)
end
end
#--------------------------------------------------------------------------
# * Show Level Up Message
# new_skills : Array of newly learned skills
#--------------------------------------------------------------------------
def display_level_up(new_skills)
text = sprintf(Vocab::LevelUp, @name, Vocab::level, @level)
$game_message.texts.push(text)
for skills in new_skills
text = sprintf(Vocab::ObtainSkill, actor.name)
$game_message.texts.push(text)
end
end
#--------------------------------------------------------------------------
# * Get Critical Ratio
#--------------------------------------------------------------------------
alias job_cri cri unless $@
def cri
n = job_cri
n += 4 if self.job_critical_bonus
return n
end
#=============================================================================
# * Change Actor Options based on Class *from TBK
#=============================================================================
if S_B::CLASS::CHANGE_ACTOR_OPTIONS
#--------------------------------------------------------------------------
# * Get [Critical Bonus] Option
#--------------------------------------------------------------------------
def job_critical_bonus
return true if S_B::CLASS::CRITICAL_CLASSES.include?(@class_id)
end
#--------------------------------------------------------------------------
# * Get [Dual Wield] Option
#--------------------------------------------------------------------------
alias job_two_sword two_swords_style unless $@
def two_swords_style
return true if S_B::CLASS::TWOSWORDS_CLASSES.include?(@class_id)
job_two_sword
end
#--------------------------------------------------------------------------
# * Get [Automatic Battle] Option
#--------------------------------------------------------------------------
alias job_auto_battle auto_battle unless $@
def auto_battle
return true if S_B::CLASS::AUTOBATTLE_CLASSES.include?(@class_id)
job_auto_battle
end
#--------------------------------------------------------------------------
# * Get [Super Guard] Option
#--------------------------------------------------------------------------
alias job_super_guard super_guard unless $@
def super_guard
return true if S_B::CLASS::SUPERGUARD_CLASSES.include?(@class_id)
job_super_guard
end
#--------------------------------------------------------------------------
# * Get [Pharmocology] Option
#--------------------------------------------------------------------------
alias job_pharmacology pharmacology unless $@
def pharmacology
return true if S_B::CLASS::PHARMACOLOGY_CLASSES.include?(@class_id)
job_pharmacology
end
#--------------------------------------------------------------------------
# * Get [Half MP Cost] Option
#--------------------------------------------------------------------------
alias job_half_mp_cost half_mp_cost unless $@
def half_mp_cost
return true if S_B::CLASS::HALP_MP_CLASSES.include?(@class_id)
job_half_mp_cost
end
#--------------------------------------------------------------------------
# * Get [HP Recover] Option
#--------------------------------------------------------------------------
alias job_auto_hp_recover auto_hp_recover unless $@
def auto_hp_recover
return true if S_B::CLASS::HP_RECOVER.include?(@class_id)
job_auto_hp_recover
end
#--------------------------------------------------------------------------
# * Get [Fast Attack] Option
#--------------------------------------------------------------------------
alias job_fast_attack fast_attack unless $@
def fast_attack
return true if S_B::CLASS::FAST_ATTACK.include?(@class_id)
job_fast_attack
end
else
def job_critical_bonus
return false
end
end
def base_stat_class(type, actclass = @class_id)
if S_B::CLASS::CHANGE_BASE_STATS and S_B::CLASS::BASE_STAT_CHANGE.include?(actclass)
multiplier = S_B::CLASS::BASE_STAT_CHANGE[actclass][type] - 1
elsif S_B::CLASS::CHANGE_BASE_STATS
multiplier = S_B::CLASS::BASE_STAT_CHANGE[0][type] - 1
else
multiplier = 0
end
if type == 6 && $imported["BattlerStatRES"]
if YEZ::STAT::ACTOR_BASE_RES.include?(@actor_id)
n = eval(YEZ::STAT::ACTOR_BASE_RES[@actor_id])
else
n = eval(YEZ::STAT::ACTOR_BASE_RES[0])
end
value = multiplier * n
elsif type == 6 && $imported["RES Stat"]
if YEM::STATS::RES::ACTOR_BASE.include?(@actor_id)
n = eval(YEM::STATS::RES::ACTOR_BASE[@actor_id])
else
n = eval(YEM::STATS::RES::ACTOR_BASE[0])
end
value = multiplier * n
elsif type == 7 && $imported["BattlerStatDEX"]
if YEZ::STAT::ACTOR_BASE_DEX.include?(@actor_id)
n = eval(YEZ::STAT::ACTOR_BASE_DEX[@actor_id])
else
n = eval(YEZ::STAT::ACTOR_BASE_DEX[0])
end
value = multiplier * n
elsif type == 7 && $imported["DEX Stat"]
if YEM::STATS::DEX::ACTOR_BASE.include?(@actor_id)
n = eval(YEM::STATS::DEX::ACTOR_BASE[@actor_id])
else
n = eval(YEM::STATS::DEX::ACTOR_BASE[0])
end
value = multiplier * n
elsif $imported["LimitBreak"]
value = multiplier * base_parameter(type)
else
value = multiplier * actor.parameters[type, @level]
end
return Integer(value)
end
def barehand?
if S_B::CLASS::BAREHANDED_CLASSES.include?(@class_id)
if self.weapons[0] == nil and self.weapons[1] == nil
return true
else
return false
end
else
return false
end
end
#--------------------------------------------------------------------------
# bare handed multiplier
#--------------------------------------------------------------------------
def barehanded_multiplier(value)
multiplier = S_B::CLASS::BAREHAND_BASE_MULTIPLIER
id = @class_id
classlevel = @class_level[id]
multiplier += S_B::CLASS::BAREHAND_PER_LEVEL_BOOST * (classlevel - 1)
multiplier = [S_B::CLASS::BAREHAND_MAX_MULTIPLIER, multiplier].min
value *= multiplier
value /= 100
return value
end
#============================================================================#
# * Change Parameters based on Class #
#============================================================================#
#--------------------------------------------------------------------------
# * Get Basic Maximum HP
#--------------------------------------------------------------------------
alias job_base_maxhp base_maxhp unless $@
def base_maxhp
n = job_base_maxhp
n += base_stat_class(0)
return Integer(n)
end
#--------------------------------------------------------------------------
# * Get basic Maximum MP
#--------------------------------------------------------------------------
alias job_base_maxmp base_maxmp unless $@
def base_maxmp
n = job_base_maxmp
n += base_stat_class(1)
return Integer(n)
end
#--------------------------------------------------------------------------
# * Get Basic Attack
#--------------------------------------------------------------------------
alias job_base_atk base_atk unless $@
def base_atk
n = job_base_atk
n += base_stat_class(2)
barehand_trait = self.barehand?
n = barehanded_multiplier(n) if barehand_trait
return Integer(n)
end
#--------------------------------------------------------------------------
# * Get Basic Defense
#--------------------------------------------------------------------------
alias job_base_def base_def unless $@
def base_def
n = job_base_def
n += base_stat_class(3)
return Integer(n)
end
#--------------------------------------------------------------------------
# * Get Basic Spirit
#--------------------------------------------------------------------------
alias job_base_spi base_spi unless $@
def base_spi
n = job_base_spi
n += base_stat_class(4)
return Integer(n)
end
#--------------------------------------------------------------------------
# * Get Basic Agility
#--------------------------------------------------------------------------
alias job_base_agi base_agi unless $@
def base_agi
n = job_base_agi
n += base_stat_class(5)
return Integer(n)
end
#--------------------------------------------------------------------------
# * Get Basic Resistance
#--------------------------------------------------------------------------
if $imported["BattlerStatRES"] or $imported["RES Stat"]
alias job_base_res base_res unless $@
def base_res
n = job_base_res
n += base_stat_class(6)
return Integer(n)
end
end
#--------------------------------------------------------------------------
# * Get Basic Dexterity
#--------------------------------------------------------------------------
if $imported["BattlerStatDEX"] or $imported["DEX Stat"]
alias job_base_dex base_dex unless $@
def base_dex
n = job_base_dex
n += base_stat_class(7)
return Integer(n)
end
end
end
#===============================================================================
# *Window_Base
#===============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# * Draw Class Level
#--------------------------------------------------------------------------
def draw_class_level(actor, x, y)
w = 60
i = actor.class_id
c = $data_classes[i]
level = actor.class_level[c.id]
maxlevel = S_B::CLASS::CLASS_MAX_LEVELS[c.id]
maxlevel = S_B::CLASS::MAX_CLASS_LEVEL_DEFAULT if maxlevel == nil
unless level == maxlevel
self.contents.font.color = system_color
self.contents.draw_text(x, y, w - 30, WLH, "(#{Vocab::level_a}.")
self.contents.draw_text(x, y, w, WLH, "#{level.to_s})", 2)
end
end
#--------------------------------------------------------------------------
alias job_draw_actor_class draw_actor_class unless $@
#--------------------------------------------------------------------------
def draw_actor_class(actor, x, y)
i = actor.class_id
c = $data_classes[i]
level = actor.class_level[c.id]
maxlevel = S_B::CLASS::CLASS_MAX_LEVELS[c.id]
maxlevel = S_B::CLASS::MAX_CLASS_LEVEL_DEFAULT if maxlevel == nil
if level == maxlevel
w = x + 108
draw_icon(S_B::CLASS::MASTERED_ICON, x, y, enabled = true)
job_draw_actor_class(actor, x + 24, y)
else
job_draw_actor_class(actor, x, y)
end
end
#--------------------------------------------------------------------------
# * Draw Class Experience
#--------------------------------------------------------------------------
def draw_jp_exp(actor, x, y)
w = self.contents.width
i = actor.class_id
c = $data_classes[i]
level = actor.class_level[c.id]
maxlevel = S_B::CLASS::CLASS_MAX_LEVELS[c.id]
maxlevel = S_B::CLASS::MAX_CLASS_LEVEL_DEFAULT if maxlevel == nil
unless level == maxlevel
s1 = actor.jp_exp_s(c.id)
s2 = actor.next_class_rest_exp_s(c.id)
s_next = "#{Vocab.jp} needed"
self.contents.font.color = system_color
self.contents.draw_text(x, y, w, WLH, Vocab.jp)
self.contents.draw_text(x, y + WLH, w, WLH, s_next)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, w, WLH, s1, 2)
self.contents.draw_text(x, y + WLH, w, WLH, s2, 2)
end
end
end
#===============================================================================
# ¦ Scene_Title
#===============================================================================
class Scene_Title < Scene_Base
#--------------------------------------------------------------------------
# ? Create various game objects
#--------------------------------------------------------------------------
alias job_create_game_objects create_game_objects unless $@
def create_game_objects
job_create_game_objects
unless S_B::CLASS::MENU_CLASS_CHANGE_OPTION
$game_switches[S_B::CLASS::DISABLE_CLASS] = true
$game_switches[S_B::CLASS::HIDE_CLASS] = true
end
end
end
#===============================================================================
# ¦ Game_Party
#===============================================================================
class Game_Party
#--------------------------------------------------------------------------
def jobchange_enable?
if $game_switches[S_B::CLASS::DISABLE_CLASS]
return false
else
return true
end
end
end
#==============================================================================
# ** Game_Troop (addon) *from yanfly
#==============================================================================
class Game_Troop < Game_Unit
attr_accessor :jp_total
#--------------------------------------------------------------------------
def jp_total
jp = 0
if S_B::CLASS::ENEMIES_GIVE_JP
for enemy in dead_members
jp += enemy.enemy.enemy_jp unless enemy.hidden
end
end
return jp
end
end
#==============================================================================
# Game_Battler *from yanfly
#==============================================================================
class Game_Battler
attr_accessor :jp_counter
#--------------------------------------------------------------------------
# perform gain_jp
#--------------------------------------------------------------------------
def gain_jp_battle(amount)
return unless self.actor?
jp = amount
for state in states
jp *= state.bonus_jp_per
jp /= 100
end
for state in states
jp += state.bonus_jp_set
end
if double_exp_gain
jp *= 2
end
self.jp_counter += jp if $scene.is_a?(Scene_Battle)
end
#--------------------------------------------------------------------------
# jp counter
#--------------------------------------------------------------------------
def jp_counter
@jp_counter = 0 if @jp_counter == nil
return @jp_counter
end
def jp_counter=(newvalue)
@jp_counter = 0 if @jp_counter == nil
@jp_counter = newvalue
end
#--------------------------------------------------------------------------
# alias attack effect
#--------------------------------------------------------------------------
alias attack_effect_sss attack_effect unless $@
def attack_effect(attacker)
attack_effect_sss(attacker)
return unless attacker.actor?
return unless S_B::CLASS::USE_BONUS_JP
return unless S_B::CLASS::EARN_JP_VIA_ATTACK_ENABLE
amount = S_B::CLASS::EARN_JP_VIA_ATTACK_AMOUNT
unless S_B::CLASS::EARN_JP_VIA_ATTACK_RANDOM == 0
amount += rand(S_B::CLASS::EARN_JP_VIA_ATTACK_RANDOM)
end
attacker.gain_jp_battle(amount)
end
#--------------------------------------------------------------------------
# alias skill effect
#--------------------------------------------------------------------------
alias skill_effect_sss skill_effect unless $@
def skill_effect(user, skill)
skill_effect_sss(user, skill)
return unless user.actor?
return unless S_B::CLASS::USE_BONUS_JP
return unless S_B::CLASS::EARN_JP_VIA_SKILL_ENABLE
return unless $scene.is_a?(Scene_Battle)
amount = S_B::CLASS::EARN_JP_VIA_SKILL_AMOUNT
unless S_B::CLASS::EARN_JP_VIA_SKILL_RANDOM == 0
amount += rand(S_B::CLASS::EARN_JP_VIA_SKILL_RANDOM)
end
amount += skill.jp_boost_set unless skill.jp_boost_set <= 0
jp += rand(skill.jp_boost_ran) unless skill.jp_boost_ran <= 0
user.gain_jp_battle(amount)
end
#--------------------------------------------------------------------------
# alias item effect
#--------------------------------------------------------------------------
alias item_effect_sss item_effect unless $@
def item_effect(user, item)
item_effect_sss(user, item)
return unless user.actor?
user.jp_received(item.gain_jp, nil, true)
#----------------------------------
if item.unlock_class != []
for class_id in item.unlock_class
user.unlock_class(class_id)
end
end
if item.lock_class != []
for class_id in item.lock_class
user.lock_class(class_id)
end
end
#----------------------------------
return unless S_B::CLASS::USE_BONUS_JP
return unless S_B::CLASS::EARN_JP_VIA_ITEMS_ENABLE
return unless $scene.is_a?(Scene_Battle)
amount = S_B::CLASS::EARN_JP_VIA_ITEMS_AMOUNT
unless S_B::CLASS::EARN_JP_VIA_ITEMS_RANDOM == 0
amount += rand(S_B::CLASS::EARN_JP_VIA_ITEMS_RANDOM)
end
user.gain_jp_battle(amount)
end
#--------------------------------------------------------------------------
# alias item test
#--------------------------------------------------------------------------
alias item_test_sss item_test unless $@
def item_test(user, item)
if self.actor?
return true if item.unlock_class != []
return true if item.lock_class != []
return true if item.gain_jp > 0
end
return item_test_sss(user, item)
end
end
#==============================================================================
# ** Scene_Battle (addon) *from yanfly
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# alias process_battle_start
#--------------------------------------------------------------------------
alias process_battle_start_sss process_battle_start unless $@
def process_battle_start
for actor in $game_party.members
actor.jp_counter = 0
end
process_battle_start_sss
end
#--------------------------------------------------------------------------
# alias execute_action_guard
#--------------------------------------------------------------------------
alias execute_action_guard_sss execute_action_guard unless $@
def execute_action_guard
execute_action_guard_sss
return unless @active_battler.actor?
return unless S_B::CLASS::USE_BONUS_JP
return unless S_B::CLASS::EARN_JP_VIA_GUARD_ENABLE
amount = S_B::CLASS::EARN_JP_VIA_GUARD_AMOUNT
unless S_B::CLASS::EARN_JP_VIA_GUARD_RANDOM == 0
amount += rand(S_B::CLASS::EARN_JP_VIA_GUARD_RANDOM)
end
@active_battler.gain_jp_battle(amount)
end
alias job_display_exp_and_gold display_exp_and_gold unless $@
def display_exp_and_gold
@ignore_wait_for_message = true
# call the original code
job_display_exp_and_gold
display_JP
@ignore_wait_for_message = false
wait_for_message
end
#--------------------------------------------------------------------------
def display_JP
jp = 0
jp = $game_troop.jp_total if S_B::CLASS::ENEMIES_GIVE_JP
if jp > 0
text = sprintf(Vocab::ObtainClassExp, jp)
$game_message.texts.push('\.' + text)
end
for actor in $game_party.existing_members
jp = 0
jp = $game_troop.jp_total if S_B::CLASS::ENEMIES_GIVE_JP
unless $imported["battleresults"]
if S_B::CLASS::USE_BONUS_JP && S_B::CLASS::DISPLAY_BONUS_JP
i = actor.class_id
c = $data_classes[i]
maxlevel = S_B::CLASS::CLASS_MAX_LEVELS[c.id]
maxlevel = S_B::CLASS::MAX_CLASS_LEVEL_DEFAULT if maxlevel == nil
if actor.jp_counter > 0 && actor.class_level != maxlevel
text = sprintf(Vocab::Actor_Msg, actor.name, actor.jp_counter)
$game_message.texts.push('\>' + text)
end
end
end
if actor.double_exp_gain
jp *= 2
end
for state in actor.states
jp *= state.bonus_jp_per
jp /= 100
end
for state in actor.states
jp += state.bonus_jp_set
end
jp = jp + actor.jp_counter if S_B::CLASS::USE_BONUS_JP
last_level = actor.class_level
last_skills = actor.skills
actor.jp_received(jp, nil, true)
end
end
end
#==============================================================================
# ** Scene_Job (new) *from prexus
#==============================================================================
class Scene_Job < Scene_Base
#--------------------------------------------------------------------------
def initialize(actor_index = 0, menu_index = 0)
@menu_index = menu_index
@actor_index = actor_index
end
#--------------------------------------------------------------------------
def start
@actor = $game_party.members[@actor_index]
create_menu_background
create_windows
@classlist_window.refresh
end
#--------------------------------------------------------------------------
def create_windows
@classlist_window = Window_ClassPick.new(@actor)
@classchange_window = Window_Class_Change.new(@actor)
@skills_window = Window_ShowSkills.new(@actor)
@help_window = Window_Help.new
@help_window.visible = false
@help_window.close
@help_window2 = Window_Help.new
@classchange_window.x = 0
@classlist_window.y = @classchange_window.y = @help_window2.height
@classchange_window.width = @classlist_window.width = Graphics.width / 2
@classlist_window.x = @classchange_window.width
@classlist_window.height = @classchange_window.height = Graphics.height - @help_window2.height
@classlist_window.index = 0
@help_window.width = 544
@help_window.height = 64
@help_window.x = 0
@help_window.y = 354
@help_window.back_opacity = 255
@help_window.create_contents
@skills_window.help_window = @help_window
@skills_window.help_window.back_opacity = 255
@confirm_window = Window_Confirm.new
end
#--------------------------------------------------------------------------
def update_windows
@classlist_window.update(@actor)
@classchange_window.update
@skills_window.update
@help_window.update
@help_window2.update
@confirm_window.update
if @classlist_window.active
@classchange_window.set(@actor, @classlist_window.item)
id = @classlist_window.item.id
if S_B::CLASS::Class_Descriptions.include?(id)
@help_window2.set_text(S_B::CLASS::Class_Descriptions[id][0])
else
@help_window2.set_text("")
end
end
end
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@classlist_window.dispose
@classchange_window.dispose
@skills_window.dispose
@help_window.dispose
@help_window2.dispose
@confirm_window.dispose
end
#--------------------------------------------------------------------------
def update
super
update_menu_background
update_windows
if @classlist_window.active
update_class_list
elsif @skills_window.active
update_skills_list
elsif @confirm_window.active
update_confirm_window
end
end
#--------------------------------------------------------------------------
# * Switch to Next Actor Screen
#--------------------------------------------------------------------------
def next_actor
@actor_index += 1
@actor_index %= $game_party.members.size
$scene = Scene_Job.new(@actor_index, @menu_index)
end
#--------------------------------------------------------------------------
# * Switch to Previous Actor Screen
#--------------------------------------------------------------------------
def prev_actor
@actor_index += $game_party.members.size - 1
@actor_index %= $game_party.members.size
$scene = Scene_Job.new(@actor_index, @menu_index)
end
#--------------------------------------------------------------------------
# * Return to previous scene
#--------------------------------------------------------------------------
def return_scene
if $imported["SceneStatusReDux"]
update_menu_background
$scene = Scene_Menu.new(3)
elsif @menu_index == 0
$scene = Scene_Map.new
else
$scene = Scene_Menu.new(@menu_index)
end
end
#--------------------------------------------------------------------------
def update_class_list
if Input.trigger?(Input::B)
Sound.play_cancel
return_scene
elsif Input.trigger?(Input::C)
if @classlist_window.item.id == @classlist_window.actor.class_id
Sound.play_buzzer
return
end
Sound.play_decision
@confirm_window.visible = true
@confirm_window.active = true
@confirm_window.index = 0
@confirm_window.open
@classlist_window.active = false
elsif Input.trigger?(S_B::CLASS::SHOW_SKILLS_WINDOW)
Sound.play_decision
@skills_window.set(@actor, @classlist_window.item.id)
@skills_window.active = true
@skills_window.index = 1
@skills_window.open
@help_window.visible = true
@help_window.open
@classlist_window.active = false
elsif Input.trigger?(Input::R) or Input.trigger?(Input::RIGHT)
Sound.play_cursor
next_actor
elsif Input.trigger?(Input::L) or Input.trigger?(Input::LEFT)
Sound.play_cursor
prev_actor
end
end
def update_skills_list
if Input.trigger?(Input::B)
Sound.play_cancel
@classlist_window.active = true
@skills_window.active = false
@skills_window.index = -1
@skills_window.close
@help_window.close
end
end
def update_confirm_window
if Input.trigger?(Input::B)
Sound.play_cancel
if @confirm_window.index == 1
@confirm_window.active = false
@confirm_window.index = -1
@confirm_window.close
@classlist_window.active = true
return
else
@confirm_window.index = 1
return
end
elsif Input.trigger?(Input::C)
case @confirm_window.index
when 0
Sound.play_decision
actor = @classlist_window.actor
actor.class_id = @classlist_window.item.id
#Check to make sure that
if @actor.hp > @actor.maxhp
@actor.hp = @actor.maxhp
end
if @actor.mp > @actor.maxmp
@actor.mp = @actor.maxmp
end
@confirm_window.active = false
@confirm_window.index = -1
@confirm_window.close
@classlist_window.refresh
@classchange_window.refresh
@classlist_window.active = true
when 1
@confirm_window.active = false
@confirm_window.index = -1
@confirm_window.close
@classlist_window.active = true
return
end
end
end
end
#==============================================================================
# ** Window_ClassPick
# window where selectable class list is generated
#==============================================================================
class Window_ClassPick < Window_Selectable
#--------------------------------------------------------------------------
def initialize(actor)
super(Graphics.width / 2, 48, Graphics.width / 2, Graphics.height - (WLH + 32))
create_contents
@actor = actor
self.index = 0
self.active = true
refresh
end
#--------------------------------------------------------------------------
def update(actor = nil)
super()
return if actor == @actor
@actor = actor
refresh
end
#--------------------------------------------------------------------------
def actor
return @actor
end
#--------------------------------------------------------------------------
def item
return $data_classes[@actor.unlocked_classes[index]]
end
#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------
def refresh
@data = []
for class_id in @actor.unlocked_classes
@data.push(class_id)
end
@item_max = @data.size
create_contents
for i in 0...@item_max
draw_item(i)
end
end
#--------------------------------------------------------------------------
# draw item
#--------------------------------------------------------------------------
def draw_item(index)
rect = item_rect(index)
self.contents.clear_rect(rect)
iclass = $data_classes[@actor.unlocked_classes[index]]
if iclass.id != 0
rect.width -= 4
enabled = true
enabled = false if iclass == @actor.class
level = @actor.class_level[iclass.id]
maxlevel = S_B::CLASS::CLASS_MAX_LEVELS[iclass.id]
maxlevel = S_B::CLASS::MAX_CLASS_LEVEL_DEFAULT if maxlevel == nil
if level == maxlevel
icon = S_B::CLASS::MASTERED_ICON
elsif S_B::CLASS::USE_ICONS_FOR_CLASSES
if S_B::CLASS::Class_Icons.include?(iclass.id)
icon = S_B::CLASS::Class_Icons[iclass.id]
else
icon = S_B::CLASS::Class_Icons[0]
end
end
draw_icon(icon, rect.x, rect.y, enabled)
dx = rect.x
dy = rect.y
dw = rect.width
dh = rect.height
self.contents.font.color.alpha = enabled ? 255 : 128
self.contents.draw_text(dx+24, dy, dw-48, dh, iclass.name, 0)
unless !S_B::CLASS::USE_BONUS_JP && !S_B::CLASS::ENEMIES_GIVE_JP
self.contents.draw_text(dx, dy, dw, dh, "Lv. " + level.to_s, 2)
end
end
end
end
#==============================================================================
# ** Window_Class_Change
#==============================================================================
class Window_Class_Change < Window_Base
#--------------------------------------------------------------------------
def initialize(actor = nil, class_obj = nil)
super(0, 48, Graphics.width / 2, Graphics.height - (WLH + 32))
create_contents
@actor = actor
@class_obj = class_obj
refresh
end
#--------------------------------------------------------------------------
def actor
return @actor
end
#--------------------------------------------------------------------------
def item
return @class_obj
end
#--------------------------------------------------------------------------
def set(actor, class_obj)
old_actor = @actor
@actor = actor
old_class_obj = @class_obj
@class_obj = class_obj
refresh if (old_actor != @actor) or (old_class_obj != @class_obj)
end
#--------------------------------------------------------------------------
def refresh
self.contents.clear
return unless @actor
c = (@class_obj != nil ? @class_obj : $data_classes[@actor.class_id])
x, y = 0, 0
w = self.contents.width
hy = self.contents.height - WLH * 4
self.draw_actor_face(@actor, x + 2, y + 2)
draw_basic_info(112, 0)
self.contents.font.color = system_color
self.contents.draw_text(x, hy + WLH * 0, w, WLH, "Class:")
unless !S_B::CLASS::USE_BONUS_JP && !S_B::CLASS::ENEMIES_GIVE_JP
self.contents.draw_text(x, hy + WLH * 1, w, WLH, "Class #{Vocab::level_a}:")
s_next = ("#{Vocab.jp} needed:")
self.contents.draw_text(x, hy + WLH * 2, w, WLH, Vocab.jp)
self.contents.draw_text(x, hy + WLH * 3, w, WLH, s_next)
end
dy = WLH * 4
y1 = (hy - dy - 80)/2
y = y1 + dy
draw_parameters(x, y)
return unless @class_obj
self.contents.font.color = normal_color
self.contents.draw_text(x, hy + WLH * 0, w, WLH, c.name,2)
maxlevel = S_B::CLASS::CLASS_MAX_LEVELS[c.id]
maxlevel = S_B::CLASS::MAX_CLASS_LEVEL_DEFAULT if maxlevel == nil
s1 = @actor.jp_exp_s(c.id)
s2 = @actor.next_class_rest_exp_s(c.id)
if @actor.class_level[c.id] == maxlevel
draw_icon(S_B::CLASS::MASTERED_ICON, w - 24, hy + WLH * 1, enabled = true)
self.contents.font.color = normal_color
self.contents.draw_text(x, hy + WLH * 1, w - 24, WLH, "Mastered",2)
else
unless !S_B::CLASS::USE_BONUS_JP && !S_B::CLASS::ENEMIES_GIVE_JP
self.contents.draw_text(x, hy + WLH * 1, w, WLH, @actor.class_level[c.id], 2)
self.contents.font.color = normal_color
end
end
self.contents.draw_text(x, hy + WLH * 2, w, WLH, s1, 2)
self.contents.draw_text(x, hy + WLH * 3, w, WLH, s2, 2)
end
def draw_basic_info(x, y)
w = self.contents.width
self.contents.font.color = system_color
self.contents.draw_text(x, y + WLH * 0, w, WLH, "Name:")
self.contents.font.color = normal_color
self.contents.draw_text(x, y + WLH * 1, w - 112, WLH, actor.name, 2)
self.contents.font.color = system_color
self.contents.draw_text(x, y + WLH * 2, w, WLH, "Current Class:")
self.contents.font.color = normal_color
self.contents.draw_text(x, y + WLH * 3, w - 112, WLH, actor.class.name, 2)
self.draw_actor_level(@actor, x - 112, y + WLH * 4)
self.draw_icon(S_B::CLASS::Skills_Icon, w - 24, y + WLH * 4)
self.contents.font.color = system_color
self.contents.draw_text(x - 112, y + WLH * 4, w - 24, WLH, 'Skills', 2)
end
def draw_parameters(x, y)
last_font_size = self.contents.font.size
if $imported["BattlerStatRES"] || $imported["BattlerStatDEX"] || $imported["RES Stat"] || $imported["DEX Stat"]
self.contents.font.size = 13
a = 13
else
self.contents.font.size = 15
a = 15
end
draw_parameter(x, y + a * 0, 0)
draw_parameter(x, y + a * 1, 1)
draw_parameter(x, y + a * 2, 2)
draw_parameter(x, y + a * 3, 3)
draw_parameter(x, y + a * 4, 4)
draw_parameter(x, y + a * 5, 5)
b = 0
draw_parameter(x, y + a * 6, 6) if $imported["BattlerStatRES"] or $imported["RES Stat"]
b = 13 if $imported["BattlerStatRES"] or $imported["RES Stat"]
draw_parameter(x, y + a * 6 + b, 7) if $imported["BattlerStatDEX"] or $imported["DEX Stat"]
self.contents.font.size = last_font_size
end
#--------------------------------------------------------------------------
# * Draw Parameters
#--------------------------------------------------------------------------
def draw_parameter(x, y, type)
c = (@class_obj != nil ? @class_obj : $data_classes[@actor.class_id])
case type
when 0
name = Vocab::hp_a
value = @actor.maxhp
when 1
name = Vocab::mp_a
value = @actor.maxmp
when 2
name = Vocab::atk
value = @actor.atk
when 3
name = Vocab::def
value = @actor.def
when 4
name = Vocab::spi
value = @actor.spi
when 5
name = Vocab::agi
value = @actor.agi
when 6
name = "RES"
value = @actor.res
when 7
name = "DEX"
value = @actor.dex
end
old = @actor.base_stat_class(type)
if @class_obj
new = @actor.base_stat_class(type, c.id)
new_value = value - old + new
difference = new - old
if difference > 0
difference = "+ #{new - old}"
end
end
self.contents.font.color = system_color
self.contents.draw_text(x + 26, y, 80, WLH, name)
self.contents.font.color = normal_color
self.contents.draw_text(x + 70, y, 30, WLH, value, 2)
self.contents.font.color = system_color
self.contents.draw_text(x + 122, y, 20, WLH, "-->", 1)
if new_value != nil
self.contents.font.color = new_parameter_color(value, new_value)
if S_B::CLASS::SHOW_DIFFERENCE
if difference == 0
self.contents.draw_text(x + 152, y, 30, WLH, "---", 2)
else
self.contents.draw_text(x + 152, y, 30, WLH, difference, 2)
end
else
self.contents.draw_text(x + 152, y, 30, WLH, new_value, 2)
end
end
end
def new_parameter_color(old_value, new_value)
if new_value > old_value # Get stronger
return power_up_color
elsif new_value == old_value # No change
return normal_color
else # Get weaker
return power_down_color
end
end
end
#==============================================================================
# ** Window_ShowSkills
#==============================================================================
class Window_ShowSkills < Window_Selectable
#--------------------------------------------------------------------------
def initialize(actor, class_id = nil)
super(0, 56, 272, 360)
@actor = actor
@class_id = (class_id != nil ? class_id : @actor.class_id)
@item_max = $data_classes[@class_id].learnings.size
@column_max = 2
create_contents
self.index = -1
self.active = false
self.openness = 0
self.back_opacity = 255
refresh
end
#--------------------------------------------------------------------------
def set(actor, class_id)
old_actor = @actor
@actor = actor
old_class_id = @class_id
@class_id = class_id
@item_max = $data_classes[@class_id].learnings.size unless @class_id == nil
create_contents
refresh
end
#--------------------------------------------------------------------------
def refresh
return if @class_id == nil
return if $data_classes[@class_id].learnings.empty?
for i in 0...@item_max
rect = item_rect(i)
learning = $data_classes[@class_id].learnings[i]
next unless learning
self.contents.font.color.alpha = (@actor.class_level[@class_id] >= learning.level ? 255 : 128)
self.contents.draw_text(rect, $data_skills[learning.skill_id].name)
end
end
#--------------------------------------------------------------------------
def update_help
if $data_classes[@class_id].learnings.empty?
self.help_window.set_text('')
self.back_opacity = 255
return
end
level = $data_classes[@class_id].learnings[self.index].level
skill = $data_skills[$data_classes[@class_id].learnings[self.index].skill_id]
self.help_window.set_text(skill == nil ? '' : "[Level #{level}] #{skill.description}")
self.back_opacity = 255
end
end
#==============================================================================
# ** Window_Confirm
#==============================================================================
class Window_Confirm < Window_Selectable
#--------------------------------------------------------------------------
def initialize(index = -1)
dx = (Graphics.width - 160)/2
super(dx, 168, 160, 80)
create_contents
@item_max = 2
@column_max = 2
self.index = index
self.active = false
self.openness = 0
refresh
end
#--------------------------------------------------------------------------
def refresh
for i in 0..@item_max
rect = item_rect(i)
self.contents.clear_rect(rect)
end
self.contents.draw_text(0, 0, self.contents.width, WLH, "Confirm?", 1)
rect = item_rect(0)
self.contents.draw_text(rect, "Yes", 1)
rect = item_rect(1)
self.contents.draw_text(rect, "No", 1)
end
#--------------------------------------------------------------------------
def item_rect(index)
rect = Rect.new(0, 0, 0, 0)
rect.width = (contents.width + @spacing) / @column_max - @spacing
rect.height = WLH
rect.x = index % @column_max * (rect.width + @spacing)
rect.y = (index / @column_max * WLH) + WLH
return rect
end
end
#==============================================================================
# ** Character_Class
#==============================================================================
class Character_Class
def self.new_class(actor, class_id)
$game_actors[actor].unlock_class(class_id)
end
#--------------------------------------------------------------------------
def self.remove_class(actor, class_id)
$game_actors[actor].lock_class(class_id)
end
end
#==============================================================================
# Window_Command (imported from KGC)
#==============================================================================
class Window_Command < Window_Selectable
unless method_defined?(:add_command)
#--------------------------------------------------------------------------
# add command
#--------------------------------------------------------------------------
def add_command(command)
@commands << command
@item_max = @commands.size
item_index = @item_max - 1
refresh_command
draw_item(item_index)
return item_index
end
#--------------------------------------------------------------------------
# refresh command
#--------------------------------------------------------------------------
def refresh_command
buf = self.contents.clone
self.height = [self.height, row_max * WLH + 32].max
create_contents
self.contents.blt(0, 0, buf, buf.rect)
buf.dispose
end
#--------------------------------------------------------------------------
# insert command
#--------------------------------------------------------------------------
def insert_command(index, command)
@commands.insert(index, command)
@item_max = @commands.size
refresh_command
refresh
end
#--------------------------------------------------------------------------
# remove command
#--------------------------------------------------------------------------
def remove_command(command)
@commands.delete(command)
@item_max = @commands.size
refresh
end
end
end
#===============================================================================
# Scene Menu
#===============================================================================
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# alias create command window
#--------------------------------------------------------------------------
alias create_command_window_sss create_command_window unless $@
def create_command_window
create_command_window_sss
return if $imported["CustomMenuCommand"]
return if $game_switches[S_B::CLASS::HIDE_CLASS]
if S_B::CLASS::MENU_CLASS_CHANGE_OPTION || $game_party.jobchange_enable?
scc_text = Vocab::Classes_Vocab
@command_class_change = @command_window.add_command(scc_text)
@command_window.draw_item(@command_class_change,
$game_party.jobchange_enable?)
if @command_window.oy > 0
@command_window.oy -= Window_Base::WLH
end
end
@command_window.index = @menu_index
end
#--------------------------------------------------------------------------
# alias update command selection
#--------------------------------------------------------------------------
alias update_command_selection_sss update_command_selection unless $@
def update_command_selection
call_job_command = 0
if Input.trigger?(Input::C)
case @command_window.index
when @command_class_change
call_job_command = 1
end
end
if call_job_command == 1
if $game_party.members.size == 0 || !$game_party.jobchange_enable?
Sound.play_buzzer
return
end
Sound.play_decision
start_actor_selection
return
end
update_command_selection_sss
end
#--------------------------------------------------------------------------
# alias update actor selection
#--------------------------------------------------------------------------
alias update_actor_selection_sss update_actor_selection unless $@
def update_actor_selection
if Input.trigger?(Input::C)
$game_party.last_actor_index = @status_window.index
Sound.play_decision
case @command_window.index
when @command_class_change
$scene = Scene_Job.new(@status_window.index,
@command_class_change)
return
end
end
update_actor_selection_sss
end
end # Scene Menu
if S_B::CLASS::SHOW_CLASS_LVL_STATUS && (S_B::CLASS::USE_BONUS_JP || S_B::CLASS::ENEMIES_GIVE_JP)
#==============================================================================
# ** Window_MenuStatus
#==============================================================================
class Window_Status < Window_Base
def draw_actor_class(actor, x, y)
i = actor.class_id
c = $data_classes[i]
level = actor.class_level[c.id]
maxlevel = S_B::CLASS::CLASS_MAX_LEVELS[c.id]
maxlevel = S_B::CLASS::MAX_CLASS_LEVEL_DEFAULT if maxlevel == nil
if level == maxlevel
w = x + 108
draw_icon(S_B::CLASS::MASTERED_ICON, x, y, true)
job_draw_actor_class(actor, x + 24, y)
else
job_draw_actor_class(actor, x + 60, y)
draw_class_level(actor, x, y)
end
end
end
class Window_Status_Actor < Window_Base
def draw_actor_class(actor, x, y)
i = actor.class_id
c = $data_classes[i]
level = actor.class_level[c.id]
maxlevel = S_B::CLASS::CLASS_MAX_LEVELS[c.id]
maxlevel = S_B::CLASS::MAX_CLASS_LEVEL_DEFAULT if maxlevel == nil
if level == maxlevel
w = x + 108
draw_icon(S_B::CLASS::MASTERED_ICON, x, y, true)
job_draw_actor_class(actor, x + 24, y)
else
job_draw_actor_class(actor, x + 60, y)
draw_class_level(actor, x, y)
end
end
end
end
if S_B::CLASS::SHOW_CLASS_LVL_MAIN && (S_B::CLASS::USE_BONUS_JP || S_B::CLASS::ENEMIES_GIVE_JP)
class Window_MenuStatus < Window_Selectable
def draw_actor_class(actor, x, y)
i = actor.class_id
c = $data_classes[i]
level = actor.class_level[c.id]
maxlevel = S_B::CLASS::CLASS_MAX_LEVELS[c.id]
maxlevel = S_B::CLASS::MAX_CLASS_LEVEL_DEFAULT if maxlevel == nil
if level == maxlevel
w = x + 108
draw_icon(S_B::CLASS::MASTERED_ICON, x, y, true)
job_draw_actor_class(actor, x + 24, y)
else
self.contents.font.color = normal_color
self.contents.draw_text(x + 40, y, 108 - 20, WLH, actor.class.name)
draw_class_level(actor, x - 20, y)
end
end
end
end