Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- #
- # Yanfly Engine RD - Subclass Selection System
- # Last Date Updated: 2009.05.10
- # Level: Hard
- #
- # There's been a lot of scripts where class changing is possible, but I've yet
- # to see anything about a subclass system. Although this script allows changing
- # primary classes, its main focus is the subclass system. There are many rules
- # you may set for your subclass system. You can enable or disable equipment
- # sharing amongst classes. You can choose how subclasses affect your base stats
- # or not at all. You can determine how skills can be learned via subclass, etc.
- #
- # CLASS SYSTEM
- # Classes are now split between primary and secondary classes. You can set many
- # different rules for each class here inside the script. Secondary classes will
- # expand the skill pool and equipment pool an actor has. With the class system,
- # actors can also get a change in their base stats depending on which class they
- # have equipped at the time. They can also get different amounts of boosts for
- # their stats upon leveling up. The possibilities are vast.
- #
- # JP SYSTEM
- # There is a new stat for each actor called JP. This new stat can be earned
- # through various ways. It can be earned in battle, from items, attacking, using
- # skills and items, and guarding. All of that can be modified. What JP does is
- # allow your actors to learn new skills through a JP purchase system. These
- # skills are unlocked when JP is spent on them and an actor will permanently
- # have the skill at their disposal.
- #
- # UNLOCK SYSTEM
- # Classes are unlocked via directly class changing, items, or learning specific
- # skills. Scripted events can also directly unlock classes for actors if that's
- # what floats your boat. There is no direct tier system implemented with this
- # script since there is too many different ways people would love to have their
- # classes unlock and whatnot.
- #
- #===============================================================================
- # Updates:
- # ----------------------------------------------------------------------------
- # o 2009.05.10 - Upgrade Pack 1:
- # Even more lag reduction.
- # Added level requirements and skill requirements.
- # Added Actor-Specific Common Skills Options
- # Added Primary-Class Only Skills Options
- # Added Subclass Only Skills Options
- # Added percentile growth rates dependent on primary and subclass
- # Added Actor-Restricted Classes Options
- # Added Primary/Subclass Stat Rate Percentage Options
- # Added two states that affect JP gain rate.
- # Added mechanic: Learning certain skills can unlock classes.
- # Fixed a few bugs regarding HP/MP during class changing.
- # o 2009.05.08 - Compatibility update with YERD Equip Skill Slots.
- # o 2009.05.07 - Lag Reduction. Ironed out crashes if people didn't input their
- # class data in correctly.
- # o 2009.05.05 - Finished demo. Fix up remaining bugs.
- # o 2009.04.30 - Finished script. Started creating demo.
- # o 2009.04.29 - Started script.
- #===============================================================================
- # How to Use: Hard Mode
- #===============================================================================
- #
- # I'm going to label all of this script as hard mode and above for multiple
- # reasons. This script is not meant to be taken lightly nor does it provide the
- # comfort of regular plug and playing that scripts with normal mode offer. I
- # made as much of the script to be plug and play as possible but it will still
- # require you to modify your classes properly before this skill will work the
- # way you would want it to. After all, this is your game.
- #
- # ----------------------------------------------------------------------------
- #
- # Here are some tags you can put into your skills' noteboxes to give them JP
- # related effects. Note that if you're not using the JP system at all, you can
- # just flat out ignore most of these.
- #
- # <unlock class x>
- # If a skill is learned with this tag, it will unlock class x for the character.
- # Input multiple of these tags to unlock multiple classes. The lock class tag
- # is not included due to potential save corruption and crashes.
- #
- # <require level x>
- # The actor must be at least x level before they can buy the skill with JP.
- #
- # <require skill x>
- # The actor must know skill x before they can buy the skill with JP. Insert
- # multiple of these tags to increase the amount of skills required.
- #
- # <jp cost x>
- # The skill will cost x jp for the actor to learn it.
- #
- # <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.
- #
- # ----------------------------------------------------------------------------
- #
- # Here are some tags you can put into your items' noteboxes to give them new
- # effects. These include JP effects but not all of them. Use accordingly.
- #
- # <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. Unlike the skill counterpart,
- # this will not corrupt the save file nor crash the game.
- #
- # <set primary x> <set subclass x>
- # This item will cause the target character to change primary or subclass to
- # whatever class x is. If subclass is set to 0, it'll remove the subclass.
- #
- # ----------------------------------------------------------------------------
- #
- # There's not much for enemy tags but here it is.
- #
- # <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.
- #
- # ----------------------------------------------------------------------------
- #
- # There's also not much for state tags but here they are.
- #
- # <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.
- #
- #===============================================================================
- #
- # Compatibility
- # - Works With: KGC HelpExtension, EquipExtension, CustomMenuCommand
- # - Works With: Yanfly Display Skill Query, Equip Skill Slots
- # - Alias: Game_Battler: attack_effect, skill_effect, item_effect, item_test
- # - Alias: Game_Actor: setup, class_id=, equippable?, level_up, skills, base_*
- # - Alias: Scene_Battle: process_battle_start, execute_action_guard
- # - Alias: Scene_Battle: display_exp_and_gold
- # - Alias: Scene_Menu: create_command_window, update_command_selection,
- # - Alias: Scene_Menu: update_actor_selection
- # - Alias: Scene_Title: create_game_objects
- # - Overwrites: Window_Base: draw_actor_class
- #
- #===============================================================================
- #
- # Credits:
- # KGC for Window_Command imports.
- #
- #===============================================================================
- $imported = {} if $imported == nil
- $imported["SubclassSelectionSystem"] = true
- module YE
- module SUBCLASS
- #---------------------------------------------------------------------------
- # CLASS SYSTEM
- #---------------------------------------------------------------------------
- # This part sets a bunch of rules regarding subclasses. Each one will allow
- # you to designate how you would like the subclass system rules to flow.
- # Read each part carefully since this will affect how the subclass system
- # will work for YOUR game.
- #---This allows actors to be able to wear equipment that is otherwise only
- # available for their equipped subclass.
- ALLOW_EQUIP = true
- #---These are two important switches for your game. If they are enabled,
- # their respective options will allow actors to switch their primary class
- # or their subclass. If not, the option to change them will not appear.
- ALLOW_CHANGE_PRIMARY_SWITCH = 12
- ALLOW_CHANGE_SUBCLASS_SWITCH = 13
- #---These are two important switches for your game. If they are enabled,
- # their respective options will appear in the menu. If not, they'll be
- # skipped.
- ENABLE_CLASS_CHANGE_SWITCH = 14
- ENABLE_LEARN_SKILLS_SWITCH = 11
- # This part affects all of the text you see inside the Class Change Menu.
- # Changing OPTION will enable/disable it inside your menu. Everything else
- # will adjust the text that appears.
- MENU_CLASS_CHANGE_OPTION = true
- MENU_CLASS_CHANGE_TITLE = "Subclass"
- MENU_CLASS_CHANGE_PRIM = "Primary"
- MENU_CLASS_CHANGE_SUB = "Subclass"
- MENU_CLASS_CHANGE_LEARN = "Learn Tech"
- MENU_CLASS_CHANGE_DONE = "Finish"
- MENU_CLASS_CHANGE_PARAM = ["HP", "FE", "Strength", "Defenese", "Magic", "Agility"]
- MENU_CLASS_CHANGE_ICONS = [ 149, 150, 4, 198, 192, 183]
- # This adjusts how the stats and arrows will appear.
- MENU_CLASS_CHANGE_USE_ICON = false
- MENU_CLASS_CHANGE_ARROW = ">"
- MENU_CLASS_CHANGE_ICON = 196
- # This affects the display type for new stats.
- # Type 1 - Shows the new stat itself.
- # Type 2 - Shows the increase/decrease in the stat.
- MENU_CLASS_CHANGE_SDISPLAY = 1
- # This allows you to designate icons for your classes. These will show up
- # whenever the class name is drawn.
- CLASS_ICONS ={
- # Class.ID => Icon ID
- 0 => 149, # Nil Class
- 1 => 74, # Bryce
- 2 => 222, # Kaelem
- 3 => 286, # Daniel
- 4 => 18, # Marcus
- 5 => 28, # Mira
- 6 => 143, # Kale
- 7 => 99, # Astrid
- 8 => 36, # Oliver
- 9 => 159, # Alyx
- 10 => 173, # Mighty
- 11 => 171, # Protective
- 12 => 172, # Adept
- 13 => 170 #Nimble
- } # Do not remove this.
- #---This determines how the class and subclass is displayed inside menus.
- DISPLAY_FORMAT = "%s/%s"
- # This allows you to set how the class abbreviations will be displayed
- # in windows that will display the class abbreviations over the full name.
- CLASS_ABBREVIATIONS ={
- # Class.ID => Icon ID
- 0 => "", # Nil Class
- 1 => "FI", # Fighter
- 2 => "SC", # Spellcaster
- 3 => "AL", # Alchemist
- 4 => "GL", # Gladiator
- 5 => "ME", # Mercenary
- 6 => "BB", # Black Belt
- 7 => "AM", # Anima Mage
- 8 => "B", # Bandit
- 9 => "AS", # Assassin
- 10 => "S", # Mighty
- 11 => "D", # Protective
- 12 => "M", # Adept
- } # Do not remove this.
- #---This allows you to set complex class names if your classes managed to
- # meet a specific combination. Take into consideration the slashes if
- # those are used in your display format.
- USE_COMPLEX_CLASS_NAMES = true
- # This is the string transformation data for full complex class naming.
- # Make sure you match it with the display format in order for it to change.
- COMPLEX_CLASS_NAMES_FULL ={
- # Combination Required => New Class Name
- # "Knight/Warrior" => "Gladiator",
- # "Knight/Magician" => "Magic Knight",
- # "Knight/Paladin" => "White Knight",
- # "Knight/Dark Knight" => "Black Knight",
- # "Warrior/Knight" => "Combatant",
- # "Warrior/Grappler" => "Fighter",
- # "Warrior/Thief" => "Mercenary",
- # "Priest/Magician" => "Shaman",
- # "Priest/Paladin" => "Enchanter",
- # "Magician/Knight" => "Spell Sword",
- # "Magician/Priest" => "Archmage",
- # "Magician/Dark Knight" => "Necromancer",
- # "Paladin/Knight" => "Holy Knight",
- # "Paladin/Priest" => "Soul Knight",
- # "Paladin/Dark Knight" => "Arc Knight",
- # "Dark Knight/Knight" => "Hell Knight",
- # "Dark Knight/Magician" => "Death Knight",
- # "Dark Knight/Paladin" => "Night Blade",
- # "Grappler/Warrior" => "Brawler",
- # "Grappler/Thief" => "Wrestler",
- # "Thief/Warrior" => "Rogue Edge",
- # "Thief/Grappler" => "Assassin",
- } # Do not remove this.
- # This is the string transformation data for abbreviated complex classes.
- # Make sure you match it with the display format in order for it to change.
- COMPLEX_CLASS_NAMES_ABBR ={
- # Combination Required => New Class Name
- # "Kn/Wa" => "Gl",
- # "Kn/Ma" => "MK",
- # "Kn/Pa" => "WK",
- # "Kn/DK" => "BK",
- # "Wa/Kn" => "Ct",
- # "Wa/Gr" => "Fi",
- # "Wa/Th" => "Mc",
- # "Pr/Ma" => "Sh",
- # "Pr/Pa" => "En",
- # "Ma/Kn" => "SS",
- # "Ma/Pr" => "AM",
- # "Ma/DK" => "Nm",
- # "Pa/Kn" => "HyK",
- # "Pa/Pr" => "SK",
- # "Pa/DK" => "AK",
- # "DK/Kn" => "HlK",
- # "DK/Ma" => "DtK",
- # "DK/Pa" => "NB",
- # "Gr/Wa" => "Br",
- # "Gr/Th" => "Wr",
- # "Th/Wa" => "RE",
- # "Th/Gr" => "As",
- } # Do not remove this.
- #---This part determines whether or not some actors are restricted to only
- # a certain set of classes. If they're not on this list, those actors will
- # have access to all classes. There is no example shown in the demo.
- ACTOR_RESTRICTED_CLASSES ={
- # ActorID => [Class ID's]
- 1 => [1, 10, 11, 12, 13],
- 2 => [2],
- 3 => [3],
- 4 => [4],
- 5 => [5],
- 6 => [6],
- 7 => [7],
- 8 => [8],
- 9 => [9]
- } # Do not remove this.
- #---This allows actors to instantly learn their subclasses skills if they
- # meet the level requirements upon leveling up or simply changing classes.
- ALLOW_RETRO_LEARN = true
- # This allows you to set which classes allow the actor to use which skills.
- # Even if the actors have learned skills outside of their class/subclass,
- # they won't be able to use them unless the actors equipped those classes.
- # Class 0 designates common skills allowed for all classes.
- CLASS_SKILL_ALLOW ={
- # ClassID => [Skill ID's]
- 0 => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65],
- 1 => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66],
- 2 => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65],
- 3 => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65],
- 4 => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65],
- 5 => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65],
- 6 => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65],
- 7 => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65],
- 8 => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65],
- 9 => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65]
- } # Do not remove this.
- #---This part determines actor-based common skills. In other words, these
- # skills will always be available for specific actors no matter what
- # primary class or subclass they have equipped
- ACTOR_COMMON_SKILLS ={
- # ActorID => [Skill ID's]
- 1 => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65],
- 2 => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65],
- 3 => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65],
- 4 => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65],
- 5 => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65],
- 6 => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65],
- 7 => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65],
- 8 => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65],
- 9 => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65],
- } # Do not remove this.
- #---This part determines primary-class only skills. These skills will only
- # be available if the actor has the specific class equipped as primary.
- PRIMARY_ONLY_SKILLS ={
- # ClassID => [Skill ID's]
- 1 => [1],
- 2 => [1],
- 3 => [1],
- 4 => [1],
- 5 => [1],
- 6 => [1],
- 7 => [1],
- 8 => [1],
- 9 => [1]
- } # Do not remove this.
- #---This part determines subclass only skills. These skills will only
- # be available if the actor has the specific class equipped as a subclass.
- # There is no example of this shown in the demo.
- SUBCLASS_ONLY_SKILLS ={
- # ClassID => [Skill ID's]
- 1 => [],
- 2 => [],
- 3 => [],
- 4 => [],
- 5 => [],
- 6 => [],
- 7 => [],
- 8 => [],
- 9 => [],
- 10 => [145, 146, 147],
- 11 => [135, 136, 137],
- 12 => [119, 120, 121],
- 13 => [167, 168, 169]
- } # Do not remove this.
- #---This determines whether or not actor stats are affected by their what
- # class they have equipped. You can also change whether or not subclasses
- # will affect the character's base stats at all.
- AFFECT_STATS_PRIMARY = false
- AFFECT_STATS_SUBCLASS = false
- # This adjusts how classes affect the actor's stats.
- CLASS_STAT_RATE ={
- # Class.ID => [MaxHP, MaxMP, ATK, DEF, SPI, AGI]
- 0 => [ 100, 100, 100, 100, 100, 100],
- 1 => [ 100, 100, 100, 100, 100, 100],
- 2 => [ 120, 70, 120, 140, 70, 100],
- 3 => [ 90, 110, 80, 80, 110, 80],
- 4 => [ 85, 120, 70, 75, 120, 85],
- 5 => [ 115, 110, 100, 100, 110, 90],
- 6 => [ 120, 90, 115, 75, 115, 100],
- 7 => [ 125, 70, 125, 80, 70, 80],
- 8 => [ 80, 80, 85, 70, 80, 150],
- } # Do not remove this.
- # This determines what percentage primary and subclasses affect the class
- # stat rates. Normally, you should leave primary at 100% to avoid problems.
- PRIMARY_STAT_RATE = 100
- SUBCLASS_STAT_RATE = 50
- #---This determines whether or not actors will gain extra stat bonuses for
- # leveling with a specific class. You can decide if their primary class
- # will get the stat bonuses, the subclass getting the bonuses, or both.
- LEVEL_UP_BONUS_PRIMARY = false
- LEVEL_UP_BONUS_SUBCLASS = true
- # This determines the extra boost in stats actors will get when they level
- # up with that class as their primary or secondary (depending on which is
- # set to true). If a class's ID isn't included here, that class will not
- # get any bonus stats upon level up. Not even class 0.
- CLASS_STAT_BONUS_SET ={
- # Class.ID => [MaxHP, MaxMP, ATK, DEF, SPI, AGI]
- 1 => [ 0, 0, 0, 0, 0, 0],
- 2 => [ 0, 0, 0, 0, 0, 0],
- 3 => [ 0, 0, 0, 0, 0, 0],
- 4 => [ 0, 0, 0, 0, 0, 0],
- 5 => [ 0, 0, 0, 0, 0, 0],
- 6 => [ 0, 0, 0, 0, 0, 0],
- 7 => [ 0, 0, 0, 0, 0, 0],
- 8 => [ 0, 0, 0, 0, 0, 0],
- 9 => [ 0, 0, 0, 0, 0, 0],
- 10 => [ 0, 0, 2, 0, 0, 0],
- 11 => [ 0, 0, 0, 2, 0, 0],
- 12 => [ 0, 0, 0, 0, 2, 0],
- 11 => [ 0, 0, 0, 0, 0, 2]
- } # Do not remove this.
- # This also determines the extra boost in stats when actors level up. This
- # is different than the other table in the way that these stats are random
- # increases. This means they can range anywhere from 0 to the numbered
- # amount. You have to enable this growth first.
- BONUS_RANDOM_PRIMARY = false
- BONUS_RANDOM_SUBCLASS = false
- CLASS_STAT_BONUS_RAN ={
- # Class.ID => [MaxHP, MaxMP, ATK, DEF, SPI, AGI]
- 1 => [ 5, 5, 2, 2, 2, 2],
- 2 => [ 5, 0, 2, 2, 0, 2],
- 3 => [ 0, 5, 0, 2, 2, 0],
- 4 => [ 0, 5, 0, 0, 2, 0],
- 5 => [ 5, 5, 2, 2, 2, 0],
- 6 => [ 5, 0, 2, 0, 2, 2],
- 7 => [ 5, 0, 2, 0, 0, 0],
- 8 => [ 1, 1, 1, 1, 1, 5],
- } # Do not remove this.
- # This determines the percentage growth rate applied depending if it's the
- # primary class or subclass. This affects both set and random increases.
- PRIMARY_GROWTH_RATE = 100
- SUBCLASS_GROWTH_RATE = 50
- #---------------------------------------------------------------------------
- # JP SYSTEM
- #---------------------------------------------------------------------------
- # The JP system is a system adapted from Final Fantasy Tactics. Your classes
- # will earn JP over battles and can use them to purchase new skills inside a
- # particular menu. This section will allow you to change JP system rules for
- # your game should you desire to use it.
- USE_JP_SYSTEM = true
- MAX_JP_EARNED = 9999
- JP_DEFINITION = "%d JP"
- JP_ICON = 197
- # 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_SHOW_MSG = false
- ENEMIES_DEFAULT = 1
- ENEMIES_MESSAGE = "%s has earned %s JP from battle."
- # 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_ACTOR_JP = true
- DISPLAY_ACTOR_MSG = "%s gained %d JP this battle."
- # This will determine whether or not the Learn Skill scene can be accessed
- # from the main menu. This also adjusts the text for the scene's options.
- LEARN_SKILL_OPTION = true
- LEARN_SKILL_TITLE = "Learn Skills"
- LEARN_SKILL_SELECT = "Learn"
- LEARN_SKILL_CHANGE = "Change"
- LEARN_SKILL_DONE = "Finish"
- # This affects the string data for the status window shown on the side.
- # This also affects what sound effect is played when buying skills.
- LEARN_SKILL_STATUS_HELP = "Select class you would like to learn skills for."
- LEARN_SKILL_STATUS_LEARNED = "%d%% Mastery"
- LEARN_SKILL_STATUS_ALL = "Mastered!"
- LEARN_SKILL_SHOP_LEARNED = "Learned"
- LEARN_SKILL_SHOP_STRING = "%s JP"
- LEARN_SKILL_SHOP_SOUND = RPG::SE.new("Equip", 80, 100)
- # This is the string data used for required skills and levels before the
- # skill can be purchased with JP.
- REQUIRE_SKILL = "Requires"
- REQUIRE_LEVEL = "Level %d"
- # These icons will replace the JP icon if the class is a primary only skill
- # or a subclass only skill.
- PRIMARY_ONLY_ICON = 135
- SUBCLASS_ONLY_ICON = 140
- # 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 = 2 # Earns at least this amount of JP.
- EARN_JP_VIA_ATTACK_RANDOM = 1 # Earns up to this random amount.
- EARN_JP_VIA_SKILL_ENABLE = true # Skills will earn JP.
- EARN_JP_VIA_SKILL_AMOUNT = 2 # Earns at least this amount of JP.
- EARN_JP_VIA_SKILL_RANDOM = 1 # Earns up to this random amount.
- EARN_JP_VIA_GUARD_ENABLE = true # Guarding will earn JP.
- EARN_JP_VIA_GUARD_AMOUNT = 0 # 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 = 2 # Earns at least this amount of JP.
- EARN_JP_VIA_ITEMS_RANDOM = 1 # Earns up to this random amount.
- # This will determine the multipliers for earning JP split between primary
- # and subclasses. This effect is determined every time "gain_jp" definition
- # occurs within the script.
- EARN_JP_MULTIPLIER_PRIMARY = 100 # Percentage for primary JP earning.
- EARN_JP_MULTIPLIER_SUBCLASS = 50 # Percentage for subclass JP earning.
- #---------------------------------------------------------------------------
- # COMPATIBILITY ADD-ONS
- #---------------------------------------------------------------------------
- # This following section is to determine compatibility showing for Display
- # Skill Query if you wish for that to be enabled.
- ENABLE_SKILL_QUERY = true
- SHOW_QUERY_BUTTON = Input::A
- SHOW_QUERY_HELP_WIN = true
- QUERY_HELP_WIN_TEXT = "Press Shift to view skill info."
- end
- end
- #===============================================================================
- # Editting anything past this point may potentially result in causing computer
- # damage, incontinence, explosion of user's head, coma, death, and/or halitosis.
- # Therefore, edit at your own risk.
- #===============================================================================
- module YE
- module REGEXP
- module BASEITEM
- # These are skill related.
- JP_COST = /<(?:JP_COST|jp cost)[ ]*(\d+)>/i
- JP_BOOST_SET = /<(?:JP_BOOST_SET|jp boost set)[ ]*(\d+)>/i
- JP_BOOST_RAN = /<(?:JP_BOOST_RAN|jp boost ran)[ ]*(\d+)>/i
- REQUIRE_SKILL = /<(?:REQUIRE_SKILL|require skill)[ ]*(\d+)>/i
- REQUIRE_LEVEL = /<(?:REQUIRE_LEVEL|require level)[ ]*(\d+)>/i
- # These are item related.
- GAIN_JP = /<(?:GAIN_JP|gain jp)[ ]*(\d+)>/i
- UNLOCK_CLASS = /<(?:UNLOCK_CLASS|unlock class)[ ]*(\d+)>/i
- LOCK_CLASS = /<(?:LOCK_CLASS|lock class)[ ]*(\d+)>/i
- SET_PRIMARY = /<(?:SET_PRIMARY|set primary)[ ]*(\d+)>/i
- SET_SUBCLASS = /<(?:SET_SUBCLASS|set subclass)[ ]*(\d+)>/i
- end # BASEITEM
- module ENEMY
- # These are enemy related
- ENEMY_JP = /<(?:ENEMY_JP|enemy jp)[ ]*(\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
- #===============================================================================
- 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::Enemy
- #===============================================================================
- class RPG::Enemy
- #--------------------------------------------------------------------------
- # Yanfly_Cache_SSS
- #--------------------------------------------------------------------------
- def yanfly_cache_enemy_sss
- @enemy_jp = YE::SUBCLASS::ENEMIES_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
- #===============================================================================
- # RPG::BaseItem
- #===============================================================================
- class RPG::BaseItem
- #--------------------------------------------------------------------------
- # Yanfly_Cache_SSS
- #--------------------------------------------------------------------------
- def yanfly_cache_baseitem_sss
- @jp_cost = 0; @jp_learn = false; @jp_boost_set = 0; @jp_boost_ran = 0
- @gain_jp = 0; @unlock_class = []; @lock_class = []
- @set_primary = 0; @set_subclass = -1
- @require_skill = []; @require_level = 0
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when YE::REGEXP::BASEITEM::JP_COST
- @jp_cost = $1.to_i
- @jp_learn = true
- 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::REQUIRE_SKILL
- @require_skill.push($1.to_i)
- when YE::REGEXP::BASEITEM::REQUIRE_LEVEL
- @require_level = $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)
- when YE::REGEXP::BASEITEM::SET_PRIMARY
- @set_primary = $1.to_i
- when YE::REGEXP::BASEITEM::SET_SUBCLASS
- @set_subclass = $1.to_i
- end
- }
- end # cache
- #--------------------------------------------------------------------------
- # JP definitions
- #--------------------------------------------------------------------------
- def jp_cost
- yanfly_cache_baseitem_sss if @jp_cost == nil
- return @jp_cost
- end
- def jp_learn?
- yanfly_cache_baseitem_sss if @jp_learn == nil
- return @jp_learn
- end
- 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
- def require_skill
- yanfly_cache_baseitem_sss if @require_skill == nil
- return @require_skill
- end
- def require_level
- yanfly_cache_baseitem_sss if @require_level == nil
- return @require_level
- 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
- def set_primary
- yanfly_cache_baseitem_sss if @set_primary == nil
- return @set_primary
- end
- def set_subclass
- yanfly_cache_baseitem_sss if @set_subclass == nil
- return @set_subclass
- end
- end
- #==============================================================================
- # Game_Battler
- #==============================================================================
- class Game_Battler
- #--------------------------------------------------------------------------
- # perform gain_jp
- #--------------------------------------------------------------------------
- def gain_jp(amount)
- return unless self.actor?
- class1 = self.class_id
- class2 = self.subclass_id unless self.subclass == nil
- for state in states
- amount *= state.bonus_jp_per
- amount /= 100
- end
- for state in states
- amount += state.bonus_jp_set
- end
- jp1 = amount * YE::SUBCLASS::EARN_JP_MULTIPLIER_PRIMARY
- jp1 /= 100
- jp2 = amount * YE::SUBCLASS::EARN_JP_MULTIPLIER_SUBCLASS
- jp2 /= 100
- self.jp_counter += [jp1, jp2].max if $scene.is_a?(Scene_Battle)
- change_jp(class1, jp1)
- change_jp(class2, jp2) unless self.subclass == nil
- 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
- def attack_effect(attacker)
- attack_effect_sss(attacker)
- return unless attacker.actor?
- return unless YE::SUBCLASS::EARN_JP_VIA_ATTACK_ENABLE
- amount = YE::SUBCLASS::EARN_JP_VIA_ATTACK_AMOUNT
- unless YE::SUBCLASS::EARN_JP_VIA_ATTACK_RANDOM == 0
- amount += rand(YE::SUBCLASS::EARN_JP_VIA_ATTACK_RANDOM)
- end
- attacker.gain_jp(amount)
- end
- #--------------------------------------------------------------------------
- # alias skill effect
- #--------------------------------------------------------------------------
- alias skill_effect_sss skill_effect
- def skill_effect(user, skill)
- skill_effect_sss(user, skill)
- return unless user.actor?
- return unless YE::SUBCLASS::EARN_JP_VIA_SKILL_ENABLE
- return unless $scene.is_a?(Scene_Battle)
- amount = YE::SUBCLASS::EARN_JP_VIA_SKILL_AMOUNT
- unless YE::SUBCLASS::EARN_JP_VIA_SKILL_RANDOM == 0
- amount += rand(YE::SUBCLASS::EARN_JP_VIA_SKILL_RANDOM)
- end
- amount += skill.jp_boost_set unless skill.jp_boost_set <= 0
- amount += rand(skill.jp_boost_ran) unless skill.jp_boost_ran <= 0
- user.gain_jp(amount)
- end
- #--------------------------------------------------------------------------
- # alias item effect
- #--------------------------------------------------------------------------
- alias item_effect_sss item_effect
- def item_effect(user, item)
- item_effect_sss(user, item)
- return unless user.actor?
- user.gain_jp(item.gain_jp)
- #----------------------------------
- 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
- if item.set_primary > 0
- user.class_id = item.set_primary
- end
- if item.set_subclass > -1
- user.subclass_id = item.set_subclass
- end
- #----------------------------------
- return unless YE::SUBCLASS::EARN_JP_VIA_ITEMS_ENABLE
- return unless $scene.is_a?(Scene_Battle)
- amount = YE::SUBCLASS::EARN_JP_VIA_ITEMS_AMOUNT
- unless YE::SUBCLASS::EARN_JP_VIA_ITEMS_RANDOM == 0
- amount += rand(YE::SUBCLASS::EARN_JP_VIA_ITEMS_RANDOM)
- end
- user.gain_jp(amount)
- end
- #--------------------------------------------------------------------------
- # alias item test
- #--------------------------------------------------------------------------
- alias item_test_sss item_test
- 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
- return true if item.set_primary > 0
- return true if item.set_subclass > -1
- end
- item_test_sss(user, item)
- end
- end
- #===============================================================================
- # Game_Actor
- #===============================================================================
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # Public Instance Variables
- #--------------------------------------------------------------------------
- attr_accessor :subclass_id
- #--------------------------------------------------------------------------
- # alias setup
- #--------------------------------------------------------------------------
- alias setup_sss setup
- def setup(actor_id)
- setup_sss(actor_id)
- @subclass_id = 0 # This determines the subclass ID.
- @unlocked_classes = [self.class.id] # What classes are unlocked.
- @class_jp = {}
- end
- #--------------------------------------------------------------------------
- # alias learn skill
- #--------------------------------------------------------------------------
- alias learn_skill_sss learn_skill
- def learn_skill(skill_id)
- learn_skill_sss(skill_id)
- skill = $data_skills[skill_id]
- if skill.unlock_class != []
- for class_id in skill.unlock_class
- self.unlock_class(class_id)
- end
- end
- end
- #--------------------------------------------------------------------------
- # alias class_id=
- #--------------------------------------------------------------------------
- alias class_id_equal_sss class_id=
- def class_id=(class_id)
- if YE::SUBCLASS::ACTOR_RESTRICTED_CLASSES.include?(self.id)
- unless YE::SUBCLASS::ACTOR_RESTRICTED_CLASSES[self.id].include?(class_id)
- return
- end
- end
- return if class_id == self.class.id
- hp_per = self.hp * 100.00 / self.maxhp
- mp_per = self.mp * 100.00 / self.maxmp
- class_id_equal_sss(class_id)
- if self.subclass_id == self.class_id
- self.subclass_id = 0
- end
- self.hp = Integer(hp_per * self.maxhp / 100)
- self.mp = Integer(mp_per * self.maxmp / 100)
- if YE::SUBCLASS::ALLOW_RETRO_LEARN
- for i in self.class.learnings
- learn_skill(i.skill_id) if i.level <= @level
- end
- end
- unless @unlocked_classes.include?(@class_id)
- @unlocked_classes.push(@class_id)
- end
- #---
- for i in 0..4
- 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_skills if $imported["EquipSkillSlots"]
- @unlocked_classes.sort!
- end
- #--------------------------------------------------------------------------
- # return Subclass
- #--------------------------------------------------------------------------
- def subclass
- @subclass_id = 0 if @subclass_id == nil
- return $data_classes[@subclass_id]
- end
- #--------------------------------------------------------------------------
- # change Subclass ID
- #--------------------------------------------------------------------------
- def subclass_id=(newvalue)
- if YE::SUBCLASS::ACTOR_RESTRICTED_CLASSES.include?(self.id)
- unless YE::SUBCLASS::ACTOR_RESTRICTED_CLASSES[self.id].include?(newvalue)
- return
- end
- end
- hp_per = self.hp * 100.00 / self.maxhp
- mp_per = self.mp * 100.00 / self.maxmp
- @subclass_id = newvalue
- @subclass_id = 0 if @subclass_id == @class_id
- self.hp = Integer(hp_per * self.maxhp / 100)
- self.mp = Integer(mp_per * self.maxmp / 100)
- return if @subclass_id == 0
- if YE::SUBCLASS::ALLOW_RETRO_LEARN and self.subclass != nil
- for i in self.subclass.learnings
- learn_skill(i.skill_id) if i.level <= @level
- end
- end
- unless @unlocked_classes.include?(@subclass_id)
- @unlocked_classes.push(@subclass_id)
- end
- #---
- for i in 0..4
- 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_skills if $imported["EquipSkillSlots"]
- @unlocked_classes.sort!
- end
- #--------------------------------------------------------------------------
- # clone class/subclass change
- #--------------------------------------------------------------------------
- def class_clone=(newvalue)
- @class_id = newvalue
- for i in 0..4
- change_equip(i, nil, true) unless equippable?(equips[i])
- end
- if $imported["EquipExtension"]
- return if extra_armor_number == 0
- for i in 5..armor_number
- change_equip(i, nil, true) unless equippable?(equips[i])
- end
- end
- end
- def subclass_clone=(newvalue)
- @subclass_id = newvalue
- @subclass_id = 0 if @subclass_id == @class_id
- for i in 0..4
- change_equip(i, nil, true) unless equippable?(equips[i])
- end
- if $imported["EquipExtension"]
- return if extra_armor_number == 0
- for i in 5..armor_number
- change_equip(i, nil, true) unless equippable?(equips[i])
- end
- end
- end
- #--------------------------------------------------------------------------
- # return unlocked classes
- #--------------------------------------------------------------------------
- def unlocked_classes
- results = []
- @unlocked_classes = [self.class.id] if @unlocked_classes == nil
- @unlocked_classes.sort!
- if YE::SUBCLASS::ACTOR_RESTRICTED_CLASSES.include?(self.id)
- for class_id in @unlocked_classes
- if YE::SUBCLASS::ACTOR_RESTRICTED_CLASSES[self.id].include?(class_id)
- results.push(class_id)
- end
- end
- else
- results = @unlocked_classes
- end
- 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!
- if YE::SUBCLASS::ALLOW_RETRO_LEARN
- newsubclass = $data_classes[newclass_id]
- for i in newsubclass.learnings
- learn_skill(i.skill_id) if i.level <= @level
- end
- end
- 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
- #--------------------------------------------------------------------------
- # alias equippable?
- #--------------------------------------------------------------------------
- alias equippable_sss equippable?
- def equippable?(item)
- result = false
- result = equippable_sss(item)
- if YE::SUBCLASS::ALLOW_EQUIP and !result and self.subclass != nil
- result = subclass_equippable?(item)
- end
- return result
- end
- #--------------------------------------------------------------------------
- # subclass equippable?
- #--------------------------------------------------------------------------
- def subclass_equippable?(item)
- if item.is_a?(RPG::Weapon)
- return self.subclass.weapon_set.include?(item.id)
- elsif item.is_a?(RPG::Armor)
- return false if two_swords_style and item.kind == 0
- return self.subclass.armor_set.include?(item.id)
- end
- return false
- end
- #--------------------------------------------------------------------------
- # alias level_up
- #--------------------------------------------------------------------------
- alias level_up_sss level_up
- def level_up
- #-----
- prm_rate = YE::SUBCLASS::PRIMARY_GROWTH_RATE
- sub_rate = YE::SUBCLASS::SUBCLASS_GROWTH_RATE
- if YE::SUBCLASS::LEVEL_UP_BONUS_PRIMARY
- if YE::SUBCLASS::CLASS_STAT_BONUS_SET.include?(self.class.id)
- narray = YE::SUBCLASS::CLASS_STAT_BONUS_SET[self.class.id]
- self.maxhp += (narray[0] * prm_rate) / 100
- self.maxmp += (narray[1] * prm_rate) / 100
- self.atk += (narray[2] * prm_rate) / 100
- self.def += (narray[3] * prm_rate) / 100
- self.spi += (narray[4] * prm_rate) / 100
- self.agi += (narray[5] * prm_rate) / 100
- end
- end
- #-----
- if YE::SUBCLASS::BONUS_RANDOM_PRIMARY
- if YE::SUBCLASS::CLASS_STAT_BONUS_RAN.include?(self.class.id)
- narray = YE::SUBCLASS::CLASS_STAT_BONUS_RAN[self.class.id]
- self.maxhp += (rand(narray[0]) * prm_rate) / 100 unless narray[0] == 0
- self.maxmp += (rand(narray[1]) * prm_rate) / 100 unless narray[1] == 0
- self.atk += (rand(narray[2]) * prm_rate) / 100 unless narray[2] == 0
- self.def += (rand(narray[3]) * prm_rate) / 100 unless narray[3] == 0
- self.spi += (rand(narray[4]) * prm_rate) / 100 unless narray[4] == 0
- self.agi += (rand(narray[5]) * prm_rate) / 100 unless narray[5] == 0
- end
- end
- #-----
- if YE::SUBCLASS::LEVEL_UP_BONUS_SUBCLASS and self.subclass != nil
- if YE::SUBCLASS::CLASS_STAT_BONUS_SET.include?(self.class.id)
- narray = YE::SUBCLASS::CLASS_STAT_BONUS_SET[self.class.id]
- self.maxhp += (narray[0] * sub_rate) / 100
- self.maxmp += (narray[1] * sub_rate) / 100
- self.atk += (narray[2] * sub_rate) / 100
- self.def += (narray[3] * sub_rate) / 100
- self.spi += (narray[4] * sub_rate) / 100
- self.agi += (narray[5] * sub_rate) / 100
- end
- end
- #-----
- if YE::SUBCLASS::BONUS_RANDOM_SUBCLASS and self.subclass != nil
- if YE::SUBCLASS::CLASS_STAT_BONUS_RAN.include?(self.class.id)
- narray = YE::SUBCLASS::CLASS_STAT_BONUS_RAN[self.class.id]
- self.maxhp += (rand(narray[0]) * sub_rate) / 100 unless narray[0] == 0
- self.maxmp += (rand(narray[1]) * sub_rate) / 100 unless narray[1] == 0
- self.atk += (rand(narray[2]) * sub_rate) / 100 unless narray[2] == 0
- self.def += (rand(narray[3]) * sub_rate) / 100 unless narray[3] == 0
- self.spi += (rand(narray[4]) * sub_rate) / 100 unless narray[4] == 0
- self.agi += (rand(narray[5]) * sub_rate) / 100 unless narray[5] == 0
- end
- end
- #-----
- if YE::SUBCLASS::ALLOW_RETRO_LEARN and self.subclass != nil
- for i in self.subclass.learnings
- learn_skill(i.skill_id) if i.level <= @level
- end
- end
- #-----
- level_up_sss
- end
- #--------------------------------------------------------------------------
- # alias skills
- #--------------------------------------------------------------------------
- alias skills_sss skills
- def skills
- original_skills = skills_sss
- allowed_skills = YE::SUBCLASS::CLASS_SKILL_ALLOW[0]
- if YE::SUBCLASS::ACTOR_COMMON_SKILLS.include?(self.id)
- allowed_skills += YE::SUBCLASS::ACTOR_COMMON_SKILLS[self.id]
- end
- if YE::SUBCLASS::CLASS_SKILL_ALLOW.include?(self.class.id)
- allowed_skills += YE::SUBCLASS::CLASS_SKILL_ALLOW[self.class.id]
- if YE::SUBCLASS::PRIMARY_ONLY_SKILLS.include?(self.class.id)
- allowed_skills += YE::SUBCLASS::PRIMARY_ONLY_SKILLS[self.class.id]
- end
- end
- unless self.subclass == nil
- allowed_skills += YE::SUBCLASS::CLASS_SKILL_ALLOW[self.subclass.id]
- if YE::SUBCLASS::SUBCLASS_ONLY_SKILLS.include?(self.subclass.id)
- allowed_skills += YE::SUBCLASS::SUBCLASS_ONLY_SKILLS[self.subclass.id]
- end
- end
- result = []
- for skill in original_skills
- skill_id = skill.id
- result.push(skill) if allowed_skills.include?(skill_id)
- end
- return result
- end
- #--------------------------------------------------------------------------
- # skills_learned
- #--------------------------------------------------------------------------
- def skills_learned(class_id)
- result = []
- if YE::SUBCLASS::CLASS_SKILL_ALLOW.include?(class_id)
- class_skills = YE::SUBCLASS::CLASS_SKILL_ALLOW[class_id]
- if YE::SUBCLASS::PRIMARY_ONLY_SKILLS.include?(class_id)
- class_skills += YE::SUBCLASS::PRIMARY_ONLY_SKILLS[class_id]
- end
- if YE::SUBCLASS::SUBCLASS_ONLY_SKILLS.include?(class_id)
- class_skills += YE::SUBCLASS::SUBCLASS_ONLY_SKILLS[class_id]
- end
- for i in class_skills
- result.push($data_skills[i]) if @skills.include?(i)
- end
- end
- return result
- end
- #--------------------------------------------------------------------------
- # alias base stats
- #--------------------------------------------------------------------------
- alias base_maxhp_sss base_maxhp
- def base_maxhp
- n = base_maxhp_sss
- if YE::SUBCLASS::AFFECT_STATS_PRIMARY
- if YE::SUBCLASS::CLASS_STAT_RATE.include?(self.class.id)
- narray = YE::SUBCLASS::CLASS_STAT_RATE[self.class.id]
- else
- narray = YE::SUBCLASS::CLASS_STAT_RATE[0]
- end
- # n *= 100 + ((narray[0]-100) * YE::SUBCLASS::PRIMARY_STAT_RATE/100)
- n /= 100.0
- end
- if YE::SUBCLASS::AFFECT_STATS_SUBCLASS and self.subclass != nil
- if YE::SUBCLASS::CLASS_STAT_RATE.include?(self.subclass.id)
- narray = YE::SUBCLASS::CLASS_STAT_RATE[self.subclass.id]
- else
- narray = YE::SUBCLASS::CLASS_STAT_RATE[0]
- end
- n *= 100 + ((narray[0]-100) * YE::SUBCLASS::SUBCLASS_STAT_RATE/100)
- n /= 100.0
- end
- return Integer(n)
- end
- alias base_maxmp_sss base_maxmp
- def base_maxmp
- n = base_maxmp_sss
- if YE::SUBCLASS::AFFECT_STATS_PRIMARY
- if YE::SUBCLASS::CLASS_STAT_RATE.include?(self.class.id)
- narray = YE::SUBCLASS::CLASS_STAT_RATE[self.class.id]
- else
- narray = YE::SUBCLASS::CLASS_STAT_RATE[0]
- end
- # n *= 100 + ((narray[1]-100) * YE::SUBCLASS::PRIMARY_STAT_RATE/100)
- n /= 100.0
- end
- if YE::SUBCLASS::AFFECT_STATS_SUBCLASS and self.subclass != nil
- if YE::SUBCLASS::CLASS_STAT_RATE.include?(self.subclass.id)
- narray = YE::SUBCLASS::CLASS_STAT_RATE[self.subclass.id]
- else
- narray = YE::SUBCLASS::CLASS_STAT_RATE[0]
- end
- n *= 100 + ((narray[1]-100) * YE::SUBCLASS::SUBCLASS_STAT_RATE/100)
- n /= 100.0
- end
- return Integer(n)
- end
- alias base_atk_sss base_atk
- def base_atk
- n = base_atk_sss
- if YE::SUBCLASS::AFFECT_STATS_PRIMARY
- if YE::SUBCLASS::CLASS_STAT_RATE.include?(self.class.id)
- narray = YE::SUBCLASS::CLASS_STAT_RATE[self.class.id]
- else
- narray = YE::SUBCLASS::CLASS_STAT_RATE[0]
- end
- n *= 100 + ((narray[2]-100) * YE::SUBCLASS::PRIMARY_STAT_RATE/100)
- n /= 100.0
- end
- if YE::SUBCLASS::AFFECT_STATS_SUBCLASS and self.subclass != nil
- if YE::SUBCLASS::CLASS_STAT_RATE.include?(self.subclass.id)
- narray = YE::SUBCLASS::CLASS_STAT_RATE[self.subclass.id]
- else
- narray = YE::SUBCLASS::CLASS_STAT_RATE[0]
- end
- n *= 100 + ((narray[2]-100) * YE::SUBCLASS::SUBCLASS_STAT_RATE/100)
- n /= 100.0
- end
- return Integer(n)
- end
- alias base_def_sss base_def
- def base_def
- n = base_def_sss
- if YE::SUBCLASS::AFFECT_STATS_PRIMARY
- if YE::SUBCLASS::CLASS_STAT_RATE.include?(self.class.id)
- narray = YE::SUBCLASS::CLASS_STAT_RATE[self.class.id]
- else
- narray = YE::SUBCLASS::CLASS_STAT_RATE[0]
- end
- n *= 100 + ((narray[3]-100) * YE::SUBCLASS::PRIMARY_STAT_RATE/100)
- n /= 100.0
- end
- if YE::SUBCLASS::AFFECT_STATS_SUBCLASS and self.subclass != nil
- if YE::SUBCLASS::CLASS_STAT_RATE.include?(self.subclass.id)
- narray = YE::SUBCLASS::CLASS_STAT_RATE[self.subclass.id]
- else
- narray = YE::SUBCLASS::CLASS_STAT_RATE[0]
- end
- n *= 100 + ((narray[3]-100) * YE::SUBCLASS::SUBCLASS_STAT_RATE/100)
- n /= 100.0
- end
- return Integer(n)
- end
- alias base_spi_sss base_spi
- def base_spi
- n = base_spi_sss
- if YE::SUBCLASS::AFFECT_STATS_PRIMARY
- if YE::SUBCLASS::CLASS_STAT_RATE.include?(self.class.id)
- narray = YE::SUBCLASS::CLASS_STAT_RATE[self.class.id]
- else
- narray = YE::SUBCLASS::CLASS_STAT_RATE[0]
- end
- n *= 100 + ((narray[4]-100) * YE::SUBCLASS::PRIMARY_STAT_RATE/100)
- n /= 100.0
- end
- if YE::SUBCLASS::AFFECT_STATS_SUBCLASS and self.subclass != nil
- if YE::SUBCLASS::CLASS_STAT_RATE.include?(self.subclass.id)
- narray = YE::SUBCLASS::CLASS_STAT_RATE[self.subclass.id]
- else
- narray = YE::SUBCLASS::CLASS_STAT_RATE[0]
- end
- n *= 100 + ((narray[4]-100) * YE::SUBCLASS::SUBCLASS_STAT_RATE/100)
- n /= 100.0
- end
- return Integer(n)
- end
- alias base_agi_sss base_agi
- def base_agi
- n = base_agi_sss
- if YE::SUBCLASS::AFFECT_STATS_PRIMARY
- if YE::SUBCLASS::CLASS_STAT_RATE.include?(self.class.id)
- narray = YE::SUBCLASS::CLASS_STAT_RATE[self.class.id]
- else
- narray = YE::SUBCLASS::CLASS_STAT_RATE[0]
- end
- n *= 100 + ((narray[5]-100) * YE::SUBCLASS::PRIMARY_STAT_RATE/100)
- n /= 100.0
- end
- if YE::SUBCLASS::AFFECT_STATS_SUBCLASS and self.subclass != nil
- if YE::SUBCLASS::CLASS_STAT_RATE.include?(self.subclass.id)
- narray = YE::SUBCLASS::CLASS_STAT_RATE[self.subclass.id]
- else
- narray = YE::SUBCLASS::CLASS_STAT_RATE[0]
- end
- n *= 100 + ((narray[5]-100) * YE::SUBCLASS::SUBCLASS_STAT_RATE/100)
- n /= 100.0
- end
- return Integer(n)
- end
- #--------------------------------------------------------------------------
- # return class_jp
- #--------------------------------------------------------------------------
- def class_jp(id_value)
- @class_jp = {} if @class_jp == nil
- @class_jp[id_value] = 0 if @class_jp[id_value] == nil
- limit = YE::SUBCLASS::MAX_JP_EARNED
- @class_jp[id_value] = [@class_jp[id_value], limit].min
- return @class_jp[id_value]
- end
- #--------------------------------------------------------------------------
- # action change jp
- #--------------------------------------------------------------------------
- def change_jp(id_value, jp_earned = 1)
- @class_jp = {} if @class_jp == nil
- @class_jp[id_value] = 0 if @class_jp[id_value] == nil
- @class_jp[id_value] += jp_earned
- limit = YE::SUBCLASS::MAX_JP_EARNED
- @class_jp[id_value] = [[@class_jp[id_value], limit].min, 0].max
- end
- #--------------------------------------------------------------------------
- # forget all skills
- #--------------------------------------------------------------------------
- def forget_all_skills
- @skills = []
- end
- end # end Game Actor
- #==============================================================================
- # Game_Troop
- #==============================================================================
- class Game_Troop < Game_Unit
- #--------------------------------------------------------------------------
- # JP Total
- #--------------------------------------------------------------------------
- def jp_total
- jp = 0
- for enemy in dead_members
- jp += enemy.enemy.enemy_jp unless enemy.hidden
- end
- return jp
- end
- end # Game_Troop
- #==============================================================================
- # 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_Battle
- #==============================================================================
- class Scene_Battle < Scene_Base
- #--------------------------------------------------------------------------
- # alias process_battle_start
- #--------------------------------------------------------------------------
- alias process_battle_start_sss process_battle_start
- 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
- def execute_action_guard
- execute_action_guard_sss
- return unless @active_battler.actor?
- return unless YE::SUBCLASS::EARN_JP_VIA_GUARD_ENABLE
- amount = YE::SUBCLASS::EARN_JP_VIA_GUARD_AMOUNT
- unless YE::SUBCLASS::EARN_JP_VIA_GUARD_RANDOM == 0
- amount += rand(YE::SUBCLASS::EARN_JP_VIA_GUARD_RANDOM)
- end
- @active_battler.gain_jp(amount)
- end
- #--------------------------------------------------------------------------
- # alias display_exp_and_gold
- #--------------------------------------------------------------------------
- alias display_exp_and_gold_sss display_exp_and_gold
- def display_exp_and_gold
- display_exp_and_gold_sss
- return unless YE::SUBCLASS::USE_JP_SYSTEM
- return unless YE::SUBCLASS::ENEMIES_GIVE_JP
- jp = $game_troop.jp_total
- if jp > 0
- text = sprintf(YE::SUBCLASS::ENEMIES_MESSAGE, $game_party.name, jp)
- $game_message.texts.push(text) if YE::SUBCLASS::ENEMIES_SHOW_MSG
- end
- if YE::SUBCLASS::DISPLAY_ACTOR_JP
- $game_message.new_page
- end
- for actor in $game_party.members
- actor.gain_jp(jp)
- next unless YE::SUBCLASS::DISPLAY_ACTOR_JP
- text = sprintf(YE::SUBCLASS::DISPLAY_ACTOR_MSG, actor.name, actor.jp_counter)
- $game_message.texts.push('\>' + text)
- end
- wait_for_message if YE::SUBCLASS::DISPLAY_ACTOR_JP
- end
- end
- #===============================================================================
- # Scene Menu
- #===============================================================================
- class Scene_Menu < Scene_Base
- #--------------------------------------------------------------------------
- # alias create command window
- #--------------------------------------------------------------------------
- alias create_command_window_sss create_command_window
- def create_command_window
- create_command_window_sss
- return if $imported["CustomMenuCommand"]
- if YE::SUBCLASS::MENU_CLASS_CHANGE_OPTION and
- $game_switches[YE::SUBCLASS::ENABLE_CLASS_CHANGE_SWITCH]
- scc_text = YE::SUBCLASS::MENU_CLASS_CHANGE_TITLE
- @command_class_change = @command_window.add_command(scc_text)
- if @command_window.oy > 0
- @command_window.oy -= Window_Base::WLH
- end
- end
- if YE::SUBCLASS::USE_JP_SYSTEM and YE::SUBCLASS::LEARN_SKILL_OPTION and
- $game_switches[YE:
Add Comment
Please, Sign In to add comment