Guest User

Untitled

a guest
Jun 18th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 65.56 KB | None | 0 0
  1. #===============================================================================
  2. #
  3. # Yanfly Engine RD - Subclass Selection System
  4. # Last Date Updated: 2009.05.10
  5. # Level: Hard
  6. #
  7. # There's been a lot of scripts where class changing is possible, but I've yet
  8. # to see anything about a subclass system. Although this script allows changing
  9. # primary classes, its main focus is the subclass system. There are many rules
  10. # you may set for your subclass system. You can enable or disable equipment
  11. # sharing amongst classes. You can choose how subclasses affect your base stats
  12. # or not at all. You can determine how skills can be learned via subclass, etc.
  13. #
  14. # CLASS SYSTEM
  15. # Classes are now split between primary and secondary classes. You can set many
  16. # different rules for each class here inside the script. Secondary classes will
  17. # expand the skill pool and equipment pool an actor has. With the class system,
  18. # actors can also get a change in their base stats depending on which class they
  19. # have equipped at the time. They can also get different amounts of boosts for
  20. # their stats upon leveling up. The possibilities are vast.
  21. #
  22. # JP SYSTEM
  23. # There is a new stat for each actor called JP. This new stat can be earned
  24. # through various ways. It can be earned in battle, from items, attacking, using
  25. # skills and items, and guarding. All of that can be modified. What JP does is
  26. # allow your actors to learn new skills through a JP purchase system. These
  27. # skills are unlocked when JP is spent on them and an actor will permanently
  28. # have the skill at their disposal.
  29. #
  30. # UNLOCK SYSTEM
  31. # Classes are unlocked via directly class changing, items, or learning specific
  32. # skills. Scripted events can also directly unlock classes for actors if that's
  33. # what floats your boat. There is no direct tier system implemented with this
  34. # script since there is too many different ways people would love to have their
  35. # classes unlock and whatnot.
  36. #
  37. #===============================================================================
  38. # Updates:
  39. # ----------------------------------------------------------------------------
  40. # o 2009.05.10 - Upgrade Pack 1:
  41. # Even more lag reduction.
  42. # Added level requirements and skill requirements.
  43. # Added Actor-Specific Common Skills Options
  44. # Added Primary-Class Only Skills Options
  45. # Added Subclass Only Skills Options
  46. # Added percentile growth rates dependent on primary and subclass
  47. # Added Actor-Restricted Classes Options
  48. # Added Primary/Subclass Stat Rate Percentage Options
  49. # Added two states that affect JP gain rate.
  50. # Added mechanic: Learning certain skills can unlock classes.
  51. # Fixed a few bugs regarding HP/MP during class changing.
  52. # o 2009.05.08 - Compatibility update with YERD Equip Skill Slots.
  53. # o 2009.05.07 - Lag Reduction. Ironed out crashes if people didn't input their
  54. # class data in correctly.
  55. # o 2009.05.05 - Finished demo. Fix up remaining bugs.
  56. # o 2009.04.30 - Finished script. Started creating demo.
  57. # o 2009.04.29 - Started script.
  58. #===============================================================================
  59. # How to Use: Hard Mode
  60. #===============================================================================
  61. #
  62. # I'm going to label all of this script as hard mode and above for multiple
  63. # reasons. This script is not meant to be taken lightly nor does it provide the
  64. # comfort of regular plug and playing that scripts with normal mode offer. I
  65. # made as much of the script to be plug and play as possible but it will still
  66. # require you to modify your classes properly before this skill will work the
  67. # way you would want it to. After all, this is your game.
  68. #
  69. # ----------------------------------------------------------------------------
  70. #
  71. # Here are some tags you can put into your skills' noteboxes to give them JP
  72. # related effects. Note that if you're not using the JP system at all, you can
  73. # just flat out ignore most of these.
  74. #
  75. # <unlock class x>
  76. # If a skill is learned with this tag, it will unlock class x for the character.
  77. # Input multiple of these tags to unlock multiple classes. The lock class tag
  78. # is not included due to potential save corruption and crashes.
  79. #
  80. # <require level x>
  81. # The actor must be at least x level before they can buy the skill with JP.
  82. #
  83. # <require skill x>
  84. # The actor must know skill x before they can buy the skill with JP. Insert
  85. # multiple of these tags to increase the amount of skills required.
  86. #
  87. # <jp cost x>
  88. # The skill will cost x jp for the actor to learn it.
  89. #
  90. # <jp boost set x>
  91. # If an actor uses this skill, that actor will gain x set amount of JP.
  92. #
  93. # <jp boost ran x>
  94. # If an actor uses this skill, that actor will gain x random amount of JP.
  95. #
  96. # ----------------------------------------------------------------------------
  97. #
  98. # Here are some tags you can put into your items' noteboxes to give them new
  99. # effects. These include JP effects but not all of them. Use accordingly.
  100. #
  101. # <gain jp x>
  102. # The item will give the target ally JP of x amount. JP is given to whatever
  103. # the ally's current class is.
  104. #
  105. # <unlock class x>
  106. # The item will unlock class x for the target ally. Use multiple of these tags
  107. # if you want an item to unlock more than one class.
  108. #
  109. # <lock class x>
  110. # The item will lock class x for the target ally. Use multiple of these tags if
  111. # you want an item to lock more than one class. Unlike the skill counterpart,
  112. # this will not corrupt the save file nor crash the game.
  113. #
  114. # <set primary x> <set subclass x>
  115. # This item will cause the target character to change primary or subclass to
  116. # whatever class x is. If subclass is set to 0, it'll remove the subclass.
  117. #
  118. # ----------------------------------------------------------------------------
  119. #
  120. # There's not much for enemy tags but here it is.
  121. #
  122. # <enemy jp x>
  123. # This determines the amount of JP given by that enemy. If nothing is determined
  124. # by this set value and you allow your enemies to give JP, then the JP delivered
  125. # will equal to the ENEMIES_DEFAULT amount.
  126. #
  127. # ----------------------------------------------------------------------------
  128. #
  129. # There's also not much for state tags but here they are.
  130. #
  131. # <bonus jp per x>
  132. # JP gain rate is x%. If x is 200, then the JP gain rate is 200%.
  133. #
  134. # <bonus jp set x>
  135. # x is added to JP gain. This means if JP gain is 20 and x is 10, total is 30.
  136. #
  137. #===============================================================================
  138. #
  139. # Compatibility
  140. # - Works With: KGC HelpExtension, EquipExtension, CustomMenuCommand
  141. # - Works With: Yanfly Display Skill Query, Equip Skill Slots
  142. # - Alias: Game_Battler: attack_effect, skill_effect, item_effect, item_test
  143. # - Alias: Game_Actor: setup, class_id=, equippable?, level_up, skills, base_*
  144. # - Alias: Scene_Battle: process_battle_start, execute_action_guard
  145. # - Alias: Scene_Battle: display_exp_and_gold
  146. # - Alias: Scene_Menu: create_command_window, update_command_selection,
  147. # - Alias: Scene_Menu: update_actor_selection
  148. # - Alias: Scene_Title: create_game_objects
  149. # - Overwrites: Window_Base: draw_actor_class
  150. #
  151. #===============================================================================
  152. #
  153. # Credits:
  154. # KGC for Window_Command imports.
  155. #
  156. #===============================================================================
  157.  
  158. $imported = {} if $imported == nil
  159. $imported["SubclassSelectionSystem"] = true
  160.  
  161. module YE
  162. module SUBCLASS
  163.  
  164. #---------------------------------------------------------------------------
  165. # CLASS SYSTEM
  166. #---------------------------------------------------------------------------
  167.  
  168. # This part sets a bunch of rules regarding subclasses. Each one will allow
  169. # you to designate how you would like the subclass system rules to flow.
  170. # Read each part carefully since this will affect how the subclass system
  171. # will work for YOUR game.
  172.  
  173. #---This allows actors to be able to wear equipment that is otherwise only
  174. # available for their equipped subclass.
  175. ALLOW_EQUIP = true
  176.  
  177. #---These are two important switches for your game. If they are enabled,
  178. # their respective options will allow actors to switch their primary class
  179. # or their subclass. If not, the option to change them will not appear.
  180. ALLOW_CHANGE_PRIMARY_SWITCH = 12
  181. ALLOW_CHANGE_SUBCLASS_SWITCH = 13
  182.  
  183. #---These are two important switches for your game. If they are enabled,
  184. # their respective options will appear in the menu. If not, they'll be
  185. # skipped.
  186. ENABLE_CLASS_CHANGE_SWITCH = 14
  187. ENABLE_LEARN_SKILLS_SWITCH = 11
  188.  
  189. # This part affects all of the text you see inside the Class Change Menu.
  190. # Changing OPTION will enable/disable it inside your menu. Everything else
  191. # will adjust the text that appears.
  192. MENU_CLASS_CHANGE_OPTION = true
  193. MENU_CLASS_CHANGE_TITLE = "Subclass"
  194. MENU_CLASS_CHANGE_PRIM = "Primary"
  195. MENU_CLASS_CHANGE_SUB = "Subclass"
  196. MENU_CLASS_CHANGE_LEARN = "Learn Tech"
  197. MENU_CLASS_CHANGE_DONE = "Finish"
  198. MENU_CLASS_CHANGE_PARAM = ["HP", "FE", "Strength", "Defenese", "Magic", "Agility"]
  199. MENU_CLASS_CHANGE_ICONS = [ 149, 150, 4, 198, 192, 183]
  200.  
  201. # This adjusts how the stats and arrows will appear.
  202. MENU_CLASS_CHANGE_USE_ICON = false
  203. MENU_CLASS_CHANGE_ARROW = ">"
  204. MENU_CLASS_CHANGE_ICON = 196
  205.  
  206. # This affects the display type for new stats.
  207. # Type 1 - Shows the new stat itself.
  208. # Type 2 - Shows the increase/decrease in the stat.
  209. MENU_CLASS_CHANGE_SDISPLAY = 1
  210.  
  211. # This allows you to designate icons for your classes. These will show up
  212. # whenever the class name is drawn.
  213. CLASS_ICONS ={
  214. # Class.ID => Icon ID
  215. 0 => 149, # Nil Class
  216. 1 => 74, # Bryce
  217. 2 => 222, # Kaelem
  218. 3 => 286, # Daniel
  219. 4 => 18, # Marcus
  220. 5 => 28, # Mira
  221. 6 => 143, # Kale
  222. 7 => 99, # Astrid
  223. 8 => 36, # Oliver
  224. 9 => 159, # Alyx
  225. 10 => 173, # Mighty
  226. 11 => 171, # Protective
  227. 12 => 172, # Adept
  228. 13 => 170 #Nimble
  229. } # Do not remove this.
  230.  
  231. #---This determines how the class and subclass is displayed inside menus.
  232. DISPLAY_FORMAT = "%s/%s"
  233.  
  234. # This allows you to set how the class abbreviations will be displayed
  235. # in windows that will display the class abbreviations over the full name.
  236. CLASS_ABBREVIATIONS ={
  237. # Class.ID => Icon ID
  238. 0 => "", # Nil Class
  239. 1 => "FI", # Fighter
  240. 2 => "SC", # Spellcaster
  241. 3 => "AL", # Alchemist
  242. 4 => "GL", # Gladiator
  243. 5 => "ME", # Mercenary
  244. 6 => "BB", # Black Belt
  245. 7 => "AM", # Anima Mage
  246. 8 => "B", # Bandit
  247. 9 => "AS", # Assassin
  248. 10 => "S", # Mighty
  249. 11 => "D", # Protective
  250. 12 => "M", # Adept
  251. } # Do not remove this.
  252.  
  253. #---This allows you to set complex class names if your classes managed to
  254. # meet a specific combination. Take into consideration the slashes if
  255. # those are used in your display format.
  256. USE_COMPLEX_CLASS_NAMES = true
  257.  
  258. # This is the string transformation data for full complex class naming.
  259. # Make sure you match it with the display format in order for it to change.
  260. COMPLEX_CLASS_NAMES_FULL ={
  261. # Combination Required => New Class Name
  262. # "Knight/Warrior" => "Gladiator",
  263. # "Knight/Magician" => "Magic Knight",
  264. # "Knight/Paladin" => "White Knight",
  265. # "Knight/Dark Knight" => "Black Knight",
  266. # "Warrior/Knight" => "Combatant",
  267. # "Warrior/Grappler" => "Fighter",
  268. # "Warrior/Thief" => "Mercenary",
  269. # "Priest/Magician" => "Shaman",
  270. # "Priest/Paladin" => "Enchanter",
  271. # "Magician/Knight" => "Spell Sword",
  272. # "Magician/Priest" => "Archmage",
  273. # "Magician/Dark Knight" => "Necromancer",
  274. # "Paladin/Knight" => "Holy Knight",
  275. # "Paladin/Priest" => "Soul Knight",
  276. # "Paladin/Dark Knight" => "Arc Knight",
  277. # "Dark Knight/Knight" => "Hell Knight",
  278. # "Dark Knight/Magician" => "Death Knight",
  279. # "Dark Knight/Paladin" => "Night Blade",
  280. # "Grappler/Warrior" => "Brawler",
  281. # "Grappler/Thief" => "Wrestler",
  282. # "Thief/Warrior" => "Rogue Edge",
  283. # "Thief/Grappler" => "Assassin",
  284. } # Do not remove this.
  285.  
  286. # This is the string transformation data for abbreviated complex classes.
  287. # Make sure you match it with the display format in order for it to change.
  288. COMPLEX_CLASS_NAMES_ABBR ={
  289. # Combination Required => New Class Name
  290. # "Kn/Wa" => "Gl",
  291. # "Kn/Ma" => "MK",
  292. # "Kn/Pa" => "WK",
  293. # "Kn/DK" => "BK",
  294. # "Wa/Kn" => "Ct",
  295. # "Wa/Gr" => "Fi",
  296. # "Wa/Th" => "Mc",
  297. # "Pr/Ma" => "Sh",
  298. # "Pr/Pa" => "En",
  299. # "Ma/Kn" => "SS",
  300. # "Ma/Pr" => "AM",
  301. # "Ma/DK" => "Nm",
  302. # "Pa/Kn" => "HyK",
  303. # "Pa/Pr" => "SK",
  304. # "Pa/DK" => "AK",
  305. # "DK/Kn" => "HlK",
  306. # "DK/Ma" => "DtK",
  307. # "DK/Pa" => "NB",
  308. # "Gr/Wa" => "Br",
  309. # "Gr/Th" => "Wr",
  310. # "Th/Wa" => "RE",
  311. # "Th/Gr" => "As",
  312. } # Do not remove this.
  313.  
  314. #---This part determines whether or not some actors are restricted to only
  315. # a certain set of classes. If they're not on this list, those actors will
  316. # have access to all classes. There is no example shown in the demo.
  317. ACTOR_RESTRICTED_CLASSES ={
  318. # ActorID => [Class ID's]
  319. 1 => [1, 10, 11, 12, 13],
  320. 2 => [2],
  321. 3 => [3],
  322. 4 => [4],
  323. 5 => [5],
  324. 6 => [6],
  325. 7 => [7],
  326. 8 => [8],
  327. 9 => [9]
  328. } # Do not remove this.
  329.  
  330. #---This allows actors to instantly learn their subclasses skills if they
  331. # meet the level requirements upon leveling up or simply changing classes.
  332. ALLOW_RETRO_LEARN = true
  333.  
  334. # This allows you to set which classes allow the actor to use which skills.
  335. # Even if the actors have learned skills outside of their class/subclass,
  336. # they won't be able to use them unless the actors equipped those classes.
  337. # Class 0 designates common skills allowed for all classes.
  338. CLASS_SKILL_ALLOW ={
  339. # ClassID => [Skill ID's]
  340. 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],
  341. 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],
  342. 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],
  343. 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],
  344. 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],
  345. 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],
  346. 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],
  347. 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],
  348. 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],
  349. 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]
  350. } # Do not remove this.
  351.  
  352. #---This part determines actor-based common skills. In other words, these
  353. # skills will always be available for specific actors no matter what
  354. # primary class or subclass they have equipped
  355. ACTOR_COMMON_SKILLS ={
  356. # ActorID => [Skill ID's]
  357. 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],
  358. 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],
  359. 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],
  360. 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],
  361. 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],
  362. 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],
  363. 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],
  364. 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],
  365. 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],
  366. } # Do not remove this.
  367.  
  368. #---This part determines primary-class only skills. These skills will only
  369. # be available if the actor has the specific class equipped as primary.
  370. PRIMARY_ONLY_SKILLS ={
  371. # ClassID => [Skill ID's]
  372. 1 => [1],
  373. 2 => [1],
  374. 3 => [1],
  375. 4 => [1],
  376. 5 => [1],
  377. 6 => [1],
  378. 7 => [1],
  379. 8 => [1],
  380. 9 => [1]
  381. } # Do not remove this.
  382.  
  383. #---This part determines subclass only skills. These skills will only
  384. # be available if the actor has the specific class equipped as a subclass.
  385. # There is no example of this shown in the demo.
  386. SUBCLASS_ONLY_SKILLS ={
  387. # ClassID => [Skill ID's]
  388. 1 => [],
  389. 2 => [],
  390. 3 => [],
  391. 4 => [],
  392. 5 => [],
  393. 6 => [],
  394. 7 => [],
  395. 8 => [],
  396. 9 => [],
  397. 10 => [145, 146, 147],
  398. 11 => [135, 136, 137],
  399. 12 => [119, 120, 121],
  400. 13 => [167, 168, 169]
  401. } # Do not remove this.
  402.  
  403. #---This determines whether or not actor stats are affected by their what
  404. # class they have equipped. You can also change whether or not subclasses
  405. # will affect the character's base stats at all.
  406. AFFECT_STATS_PRIMARY = false
  407. AFFECT_STATS_SUBCLASS = false
  408.  
  409. # This adjusts how classes affect the actor's stats.
  410. CLASS_STAT_RATE ={
  411. # Class.ID => [MaxHP, MaxMP, ATK, DEF, SPI, AGI]
  412. 0 => [ 100, 100, 100, 100, 100, 100],
  413. 1 => [ 100, 100, 100, 100, 100, 100],
  414. 2 => [ 120, 70, 120, 140, 70, 100],
  415. 3 => [ 90, 110, 80, 80, 110, 80],
  416. 4 => [ 85, 120, 70, 75, 120, 85],
  417. 5 => [ 115, 110, 100, 100, 110, 90],
  418. 6 => [ 120, 90, 115, 75, 115, 100],
  419. 7 => [ 125, 70, 125, 80, 70, 80],
  420. 8 => [ 80, 80, 85, 70, 80, 150],
  421. } # Do not remove this.
  422.  
  423. # This determines what percentage primary and subclasses affect the class
  424. # stat rates. Normally, you should leave primary at 100% to avoid problems.
  425. PRIMARY_STAT_RATE = 100
  426. SUBCLASS_STAT_RATE = 50
  427.  
  428. #---This determines whether or not actors will gain extra stat bonuses for
  429. # leveling with a specific class. You can decide if their primary class
  430. # will get the stat bonuses, the subclass getting the bonuses, or both.
  431. LEVEL_UP_BONUS_PRIMARY = false
  432. LEVEL_UP_BONUS_SUBCLASS = true
  433.  
  434. # This determines the extra boost in stats actors will get when they level
  435. # up with that class as their primary or secondary (depending on which is
  436. # set to true). If a class's ID isn't included here, that class will not
  437. # get any bonus stats upon level up. Not even class 0.
  438. CLASS_STAT_BONUS_SET ={
  439. # Class.ID => [MaxHP, MaxMP, ATK, DEF, SPI, AGI]
  440. 1 => [ 0, 0, 0, 0, 0, 0],
  441. 2 => [ 0, 0, 0, 0, 0, 0],
  442. 3 => [ 0, 0, 0, 0, 0, 0],
  443. 4 => [ 0, 0, 0, 0, 0, 0],
  444. 5 => [ 0, 0, 0, 0, 0, 0],
  445. 6 => [ 0, 0, 0, 0, 0, 0],
  446. 7 => [ 0, 0, 0, 0, 0, 0],
  447. 8 => [ 0, 0, 0, 0, 0, 0],
  448. 9 => [ 0, 0, 0, 0, 0, 0],
  449. 10 => [ 0, 0, 2, 0, 0, 0],
  450. 11 => [ 0, 0, 0, 2, 0, 0],
  451. 12 => [ 0, 0, 0, 0, 2, 0],
  452. 11 => [ 0, 0, 0, 0, 0, 2]
  453. } # Do not remove this.
  454.  
  455. # This also determines the extra boost in stats when actors level up. This
  456. # is different than the other table in the way that these stats are random
  457. # increases. This means they can range anywhere from 0 to the numbered
  458. # amount. You have to enable this growth first.
  459. BONUS_RANDOM_PRIMARY = false
  460. BONUS_RANDOM_SUBCLASS = false
  461. CLASS_STAT_BONUS_RAN ={
  462. # Class.ID => [MaxHP, MaxMP, ATK, DEF, SPI, AGI]
  463. 1 => [ 5, 5, 2, 2, 2, 2],
  464. 2 => [ 5, 0, 2, 2, 0, 2],
  465. 3 => [ 0, 5, 0, 2, 2, 0],
  466. 4 => [ 0, 5, 0, 0, 2, 0],
  467. 5 => [ 5, 5, 2, 2, 2, 0],
  468. 6 => [ 5, 0, 2, 0, 2, 2],
  469. 7 => [ 5, 0, 2, 0, 0, 0],
  470. 8 => [ 1, 1, 1, 1, 1, 5],
  471. } # Do not remove this.
  472.  
  473. # This determines the percentage growth rate applied depending if it's the
  474. # primary class or subclass. This affects both set and random increases.
  475. PRIMARY_GROWTH_RATE = 100
  476. SUBCLASS_GROWTH_RATE = 50
  477.  
  478. #---------------------------------------------------------------------------
  479. # JP SYSTEM
  480. #---------------------------------------------------------------------------
  481.  
  482. # The JP system is a system adapted from Final Fantasy Tactics. Your classes
  483. # will earn JP over battles and can use them to purchase new skills inside a
  484. # particular menu. This section will allow you to change JP system rules for
  485. # your game should you desire to use it.
  486. USE_JP_SYSTEM = true
  487. MAX_JP_EARNED = 9999
  488. JP_DEFINITION = "%d JP"
  489. JP_ICON = 197
  490.  
  491. # This determines whether or not enemies will give JP if killed and the
  492. # default amount if not set with <enemy jp x>.
  493. ENEMIES_GIVE_JP = true
  494. ENEMIES_SHOW_MSG = false
  495. ENEMIES_DEFAULT = 1
  496. ENEMIES_MESSAGE = "%s has earned %s JP from battle."
  497.  
  498. # This sets whether or not you'd like your actors to display the JP they've
  499. # earned in battle (since every action adds JP).
  500. DISPLAY_ACTOR_JP = true
  501. DISPLAY_ACTOR_MSG = "%s gained %d JP this battle."
  502.  
  503. # This will determine whether or not the Learn Skill scene can be accessed
  504. # from the main menu. This also adjusts the text for the scene's options.
  505. LEARN_SKILL_OPTION = true
  506. LEARN_SKILL_TITLE = "Learn Skills"
  507. LEARN_SKILL_SELECT = "Learn"
  508. LEARN_SKILL_CHANGE = "Change"
  509. LEARN_SKILL_DONE = "Finish"
  510.  
  511. # This affects the string data for the status window shown on the side.
  512. # This also affects what sound effect is played when buying skills.
  513. LEARN_SKILL_STATUS_HELP = "Select class you would like to learn skills for."
  514. LEARN_SKILL_STATUS_LEARNED = "%d%% Mastery"
  515. LEARN_SKILL_STATUS_ALL = "Mastered!"
  516. LEARN_SKILL_SHOP_LEARNED = "Learned"
  517. LEARN_SKILL_SHOP_STRING = "%s JP"
  518. LEARN_SKILL_SHOP_SOUND = RPG::SE.new("Equip", 80, 100)
  519.  
  520. # This is the string data used for required skills and levels before the
  521. # skill can be purchased with JP.
  522. REQUIRE_SKILL = "Requires"
  523. REQUIRE_LEVEL = "Level %d"
  524.  
  525. # These icons will replace the JP icon if the class is a primary only skill
  526. # or a subclass only skill.
  527. PRIMARY_ONLY_ICON = 135
  528. SUBCLASS_ONLY_ICON = 140
  529.  
  530. # JP is earned throughout battle from different effects. You can determine
  531. # what will earn JP here and by how much. Set amounts are the increases that
  532. # will always occur so long as the action is enabled. Random amounts will
  533. # increase the JP earned from 0 to that amount.
  534.  
  535. EARN_JP_VIA_ATTACK_ENABLE = true # Normal attacks will earn JP.
  536. EARN_JP_VIA_ATTACK_AMOUNT = 2 # Earns at least this amount of JP.
  537. EARN_JP_VIA_ATTACK_RANDOM = 1 # Earns up to this random amount.
  538.  
  539. EARN_JP_VIA_SKILL_ENABLE = true # Skills will earn JP.
  540. EARN_JP_VIA_SKILL_AMOUNT = 2 # Earns at least this amount of JP.
  541. EARN_JP_VIA_SKILL_RANDOM = 1 # Earns up to this random amount.
  542.  
  543. EARN_JP_VIA_GUARD_ENABLE = true # Guarding will earn JP.
  544. EARN_JP_VIA_GUARD_AMOUNT = 0 # Earns at least this amount of JP.
  545. EARN_JP_VIA_GUARD_RANDOM = 0 # Earns up to this random amount.
  546.  
  547. EARN_JP_VIA_ITEMS_ENABLE = true # Using items will earn JP.
  548. EARN_JP_VIA_ITEMS_AMOUNT = 2 # Earns at least this amount of JP.
  549. EARN_JP_VIA_ITEMS_RANDOM = 1 # Earns up to this random amount.
  550.  
  551. # This will determine the multipliers for earning JP split between primary
  552. # and subclasses. This effect is determined every time "gain_jp" definition
  553. # occurs within the script.
  554.  
  555. EARN_JP_MULTIPLIER_PRIMARY = 100 # Percentage for primary JP earning.
  556. EARN_JP_MULTIPLIER_SUBCLASS = 50 # Percentage for subclass JP earning.
  557.  
  558. #---------------------------------------------------------------------------
  559. # COMPATIBILITY ADD-ONS
  560. #---------------------------------------------------------------------------
  561.  
  562. # This following section is to determine compatibility showing for Display
  563. # Skill Query if you wish for that to be enabled.
  564. ENABLE_SKILL_QUERY = true
  565. SHOW_QUERY_BUTTON = Input::A
  566. SHOW_QUERY_HELP_WIN = true
  567. QUERY_HELP_WIN_TEXT = "Press Shift to view skill info."
  568.  
  569. end
  570. end
  571.  
  572. #===============================================================================
  573. # Editting anything past this point may potentially result in causing computer
  574. # damage, incontinence, explosion of user's head, coma, death, and/or halitosis.
  575. # Therefore, edit at your own risk.
  576. #===============================================================================
  577.  
  578. module YE
  579. module REGEXP
  580. module BASEITEM
  581.  
  582. # These are skill related.
  583. JP_COST = /<(?:JP_COST|jp cost)[ ]*(\d+)>/i
  584. JP_BOOST_SET = /<(?:JP_BOOST_SET|jp boost set)[ ]*(\d+)>/i
  585. JP_BOOST_RAN = /<(?:JP_BOOST_RAN|jp boost ran)[ ]*(\d+)>/i
  586. REQUIRE_SKILL = /<(?:REQUIRE_SKILL|require skill)[ ]*(\d+)>/i
  587. REQUIRE_LEVEL = /<(?:REQUIRE_LEVEL|require level)[ ]*(\d+)>/i
  588.  
  589. # These are item related.
  590. GAIN_JP = /<(?:GAIN_JP|gain jp)[ ]*(\d+)>/i
  591. UNLOCK_CLASS = /<(?:UNLOCK_CLASS|unlock class)[ ]*(\d+)>/i
  592. LOCK_CLASS = /<(?:LOCK_CLASS|lock class)[ ]*(\d+)>/i
  593. SET_PRIMARY = /<(?:SET_PRIMARY|set primary)[ ]*(\d+)>/i
  594. SET_SUBCLASS = /<(?:SET_SUBCLASS|set subclass)[ ]*(\d+)>/i
  595.  
  596. end # BASEITEM
  597. module ENEMY
  598.  
  599. # These are enemy related
  600. ENEMY_JP = /<(?:ENEMY_JP|enemy jp)[ ]*(\d+)>/i
  601.  
  602. end # ENEMY
  603. module STATE
  604.  
  605. # This affects states.
  606. BONUS_JP_PER = /<(?:BONUS_JP_PER|bonus jp per)[ ]*(\d+)>/i
  607. BONUS_JP_SET = /<(?:BONUS_JP_SET|bonus jp set)[ ]*(\d+)>/i
  608.  
  609. end # STATE
  610. end # REGEXP
  611. end # YE
  612.  
  613. #===============================================================================
  614. # RPG::State
  615. #===============================================================================
  616.  
  617. class RPG::State
  618.  
  619. #--------------------------------------------------------------------------
  620. # Yanfly_Cache_SSS
  621. #--------------------------------------------------------------------------
  622. def yanfly_cache_state_sss
  623. @bonus_jp_per = 100; @bonus_jp_set = 0
  624.  
  625. self.note.split(/[\r\n]+/).each { |line|
  626. case line
  627. when YE::REGEXP::STATE::BONUS_JP_PER
  628. @bonus_jp_per = $1.to_i
  629. when YE::REGEXP::STATE::BONUS_JP_SET
  630. @bonus_jp_set = $1.to_i
  631. end
  632. }
  633. end # cache
  634.  
  635. #--------------------------------------------------------------------------
  636. # definitions
  637. #--------------------------------------------------------------------------
  638. def bonus_jp_per
  639. yanfly_cache_state_sss if @bonus_jp_per == nil
  640. return @bonus_jp_per
  641. end
  642. def bonus_jp_set
  643. yanfly_cache_state_sss if @bonus_jp_set == nil
  644. return @bonus_jp_set
  645. end
  646.  
  647. end
  648.  
  649. #===============================================================================
  650. # RPG::Enemy
  651. #===============================================================================
  652.  
  653. class RPG::Enemy
  654.  
  655. #--------------------------------------------------------------------------
  656. # Yanfly_Cache_SSS
  657. #--------------------------------------------------------------------------
  658. def yanfly_cache_enemy_sss
  659. @enemy_jp = YE::SUBCLASS::ENEMIES_DEFAULT
  660.  
  661. self.note.split(/[\r\n]+/).each { |line|
  662. case line
  663. when YE::REGEXP::ENEMY::ENEMY_JP
  664. @enemy_jp = $1.to_i
  665. end
  666. }
  667. end # cache
  668.  
  669. #--------------------------------------------------------------------------
  670. # definitions
  671. #--------------------------------------------------------------------------
  672. def enemy_jp
  673. yanfly_cache_enemy_sss if @enemy_jp == nil
  674. return @enemy_jp
  675. end
  676.  
  677. end
  678.  
  679. #===============================================================================
  680. # RPG::BaseItem
  681. #===============================================================================
  682.  
  683. class RPG::BaseItem
  684.  
  685. #--------------------------------------------------------------------------
  686. # Yanfly_Cache_SSS
  687. #--------------------------------------------------------------------------
  688. def yanfly_cache_baseitem_sss
  689. @jp_cost = 0; @jp_learn = false; @jp_boost_set = 0; @jp_boost_ran = 0
  690. @gain_jp = 0; @unlock_class = []; @lock_class = []
  691. @set_primary = 0; @set_subclass = -1
  692. @require_skill = []; @require_level = 0
  693.  
  694. self.note.split(/[\r\n]+/).each { |line|
  695. case line
  696. when YE::REGEXP::BASEITEM::JP_COST
  697. @jp_cost = $1.to_i
  698. @jp_learn = true
  699. when YE::REGEXP::BASEITEM::JP_BOOST_SET
  700. @jp_boost_set = $1.to_i
  701. when YE::REGEXP::BASEITEM::JP_BOOST_RAN
  702. @jp_boost_ran = $1.to_i
  703. when YE::REGEXP::BASEITEM::GAIN_JP
  704. @gain_jp = $1.to_i
  705. when YE::REGEXP::BASEITEM::REQUIRE_SKILL
  706. @require_skill.push($1.to_i)
  707. when YE::REGEXP::BASEITEM::REQUIRE_LEVEL
  708. @require_level = $1.to_i
  709.  
  710. when YE::REGEXP::BASEITEM::UNLOCK_CLASS
  711. @unlock_class.push($1.to_i)
  712. when YE::REGEXP::BASEITEM::LOCK_CLASS
  713. @lock_class.push($1.to_i)
  714. when YE::REGEXP::BASEITEM::SET_PRIMARY
  715. @set_primary = $1.to_i
  716. when YE::REGEXP::BASEITEM::SET_SUBCLASS
  717. @set_subclass = $1.to_i
  718. end
  719. }
  720. end # cache
  721.  
  722. #--------------------------------------------------------------------------
  723. # JP definitions
  724. #--------------------------------------------------------------------------
  725. def jp_cost
  726. yanfly_cache_baseitem_sss if @jp_cost == nil
  727. return @jp_cost
  728. end
  729.  
  730. def jp_learn?
  731. yanfly_cache_baseitem_sss if @jp_learn == nil
  732. return @jp_learn
  733. end
  734.  
  735. def jp_boost_set
  736. yanfly_cache_baseitem_sss if @jp_boost_set == nil
  737. return @jp_boost_set
  738. end
  739.  
  740. def jp_boost_ran
  741. yanfly_cache_baseitem_sss if @jp_boost_ran == nil
  742. return @jp_boost_ran
  743. end
  744.  
  745. def gain_jp
  746. yanfly_cache_baseitem_sss if @gain_jp == nil
  747. return @gain_jp
  748. end
  749.  
  750. def require_skill
  751. yanfly_cache_baseitem_sss if @require_skill == nil
  752. return @require_skill
  753. end
  754.  
  755. def require_level
  756. yanfly_cache_baseitem_sss if @require_level == nil
  757. return @require_level
  758. end
  759.  
  760. #--------------------------------------------------------------------------
  761. # class definitions
  762. #--------------------------------------------------------------------------
  763. def unlock_class
  764. yanfly_cache_baseitem_sss if @unlock_class == nil
  765. return @unlock_class
  766. end
  767.  
  768. def lock_class
  769. yanfly_cache_baseitem_sss if @lock_class == nil
  770. return @lock_class
  771. end
  772.  
  773. def set_primary
  774. yanfly_cache_baseitem_sss if @set_primary == nil
  775. return @set_primary
  776. end
  777.  
  778. def set_subclass
  779. yanfly_cache_baseitem_sss if @set_subclass == nil
  780. return @set_subclass
  781. end
  782.  
  783. end
  784.  
  785. #==============================================================================
  786. # Game_Battler
  787. #==============================================================================
  788.  
  789. class Game_Battler
  790.  
  791. #--------------------------------------------------------------------------
  792. # perform gain_jp
  793. #--------------------------------------------------------------------------
  794. def gain_jp(amount)
  795. return unless self.actor?
  796. class1 = self.class_id
  797. class2 = self.subclass_id unless self.subclass == nil
  798. for state in states
  799. amount *= state.bonus_jp_per
  800. amount /= 100
  801. end
  802. for state in states
  803. amount += state.bonus_jp_set
  804. end
  805. jp1 = amount * YE::SUBCLASS::EARN_JP_MULTIPLIER_PRIMARY
  806. jp1 /= 100
  807. jp2 = amount * YE::SUBCLASS::EARN_JP_MULTIPLIER_SUBCLASS
  808. jp2 /= 100
  809. self.jp_counter += [jp1, jp2].max if $scene.is_a?(Scene_Battle)
  810. change_jp(class1, jp1)
  811. change_jp(class2, jp2) unless self.subclass == nil
  812. end
  813.  
  814. #--------------------------------------------------------------------------
  815. # jp counter
  816. #--------------------------------------------------------------------------
  817. def jp_counter
  818. @jp_counter = 0 if @jp_counter == nil
  819. return @jp_counter
  820. end
  821.  
  822. def jp_counter=(newvalue)
  823. @jp_counter = 0 if @jp_counter == nil
  824. @jp_counter = newvalue
  825. end
  826.  
  827. #--------------------------------------------------------------------------
  828. # alias attack effect
  829. #--------------------------------------------------------------------------
  830. alias attack_effect_sss attack_effect
  831. def attack_effect(attacker)
  832. attack_effect_sss(attacker)
  833. return unless attacker.actor?
  834. return unless YE::SUBCLASS::EARN_JP_VIA_ATTACK_ENABLE
  835. amount = YE::SUBCLASS::EARN_JP_VIA_ATTACK_AMOUNT
  836. unless YE::SUBCLASS::EARN_JP_VIA_ATTACK_RANDOM == 0
  837. amount += rand(YE::SUBCLASS::EARN_JP_VIA_ATTACK_RANDOM)
  838. end
  839. attacker.gain_jp(amount)
  840. end
  841.  
  842. #--------------------------------------------------------------------------
  843. # alias skill effect
  844. #--------------------------------------------------------------------------
  845. alias skill_effect_sss skill_effect
  846. def skill_effect(user, skill)
  847. skill_effect_sss(user, skill)
  848. return unless user.actor?
  849. return unless YE::SUBCLASS::EARN_JP_VIA_SKILL_ENABLE
  850. return unless $scene.is_a?(Scene_Battle)
  851. amount = YE::SUBCLASS::EARN_JP_VIA_SKILL_AMOUNT
  852. unless YE::SUBCLASS::EARN_JP_VIA_SKILL_RANDOM == 0
  853. amount += rand(YE::SUBCLASS::EARN_JP_VIA_SKILL_RANDOM)
  854. end
  855. amount += skill.jp_boost_set unless skill.jp_boost_set <= 0
  856. amount += rand(skill.jp_boost_ran) unless skill.jp_boost_ran <= 0
  857. user.gain_jp(amount)
  858. end
  859.  
  860. #--------------------------------------------------------------------------
  861. # alias item effect
  862. #--------------------------------------------------------------------------
  863. alias item_effect_sss item_effect
  864. def item_effect(user, item)
  865. item_effect_sss(user, item)
  866. return unless user.actor?
  867. user.gain_jp(item.gain_jp)
  868. #----------------------------------
  869. if item.unlock_class != []
  870. for class_id in item.unlock_class
  871. user.unlock_class(class_id)
  872. end
  873. end
  874. if item.lock_class != []
  875. for class_id in item.lock_class
  876. user.lock_class(class_id)
  877. end
  878. end
  879. if item.set_primary > 0
  880. user.class_id = item.set_primary
  881. end
  882. if item.set_subclass > -1
  883. user.subclass_id = item.set_subclass
  884. end
  885. #----------------------------------
  886. return unless YE::SUBCLASS::EARN_JP_VIA_ITEMS_ENABLE
  887. return unless $scene.is_a?(Scene_Battle)
  888. amount = YE::SUBCLASS::EARN_JP_VIA_ITEMS_AMOUNT
  889. unless YE::SUBCLASS::EARN_JP_VIA_ITEMS_RANDOM == 0
  890. amount += rand(YE::SUBCLASS::EARN_JP_VIA_ITEMS_RANDOM)
  891. end
  892. user.gain_jp(amount)
  893. end
  894.  
  895. #--------------------------------------------------------------------------
  896. # alias item test
  897. #--------------------------------------------------------------------------
  898. alias item_test_sss item_test
  899. def item_test(user, item)
  900. if self.actor?
  901. return true if item.unlock_class != []
  902. return true if item.lock_class != []
  903. return true if item.gain_jp > 0
  904. return true if item.set_primary > 0
  905. return true if item.set_subclass > -1
  906. end
  907. item_test_sss(user, item)
  908. end
  909.  
  910. end
  911.  
  912. #===============================================================================
  913. # Game_Actor
  914. #===============================================================================
  915.  
  916. class Game_Actor < Game_Battler
  917.  
  918. #--------------------------------------------------------------------------
  919. # Public Instance Variables
  920. #--------------------------------------------------------------------------
  921. attr_accessor :subclass_id
  922.  
  923. #--------------------------------------------------------------------------
  924. # alias setup
  925. #--------------------------------------------------------------------------
  926. alias setup_sss setup
  927. def setup(actor_id)
  928. setup_sss(actor_id)
  929. @subclass_id = 0 # This determines the subclass ID.
  930. @unlocked_classes = [self.class.id] # What classes are unlocked.
  931. @class_jp = {}
  932. end
  933.  
  934. #--------------------------------------------------------------------------
  935. # alias learn skill
  936. #--------------------------------------------------------------------------
  937. alias learn_skill_sss learn_skill
  938. def learn_skill(skill_id)
  939. learn_skill_sss(skill_id)
  940. skill = $data_skills[skill_id]
  941. if skill.unlock_class != []
  942. for class_id in skill.unlock_class
  943. self.unlock_class(class_id)
  944. end
  945. end
  946. end
  947.  
  948. #--------------------------------------------------------------------------
  949. # alias class_id=
  950. #--------------------------------------------------------------------------
  951. alias class_id_equal_sss class_id=
  952. def class_id=(class_id)
  953. if YE::SUBCLASS::ACTOR_RESTRICTED_CLASSES.include?(self.id)
  954. unless YE::SUBCLASS::ACTOR_RESTRICTED_CLASSES[self.id].include?(class_id)
  955. return
  956. end
  957. end
  958. return if class_id == self.class.id
  959. hp_per = self.hp * 100.00 / self.maxhp
  960. mp_per = self.mp * 100.00 / self.maxmp
  961. class_id_equal_sss(class_id)
  962. if self.subclass_id == self.class_id
  963. self.subclass_id = 0
  964. end
  965. self.hp = Integer(hp_per * self.maxhp / 100)
  966. self.mp = Integer(mp_per * self.maxmp / 100)
  967. if YE::SUBCLASS::ALLOW_RETRO_LEARN
  968. for i in self.class.learnings
  969. learn_skill(i.skill_id) if i.level <= @level
  970. end
  971. end
  972. unless @unlocked_classes.include?(@class_id)
  973. @unlocked_classes.push(@class_id)
  974. end
  975. #---
  976. for i in 0..4
  977. change_equip(i, nil) unless equippable?(equips[i])
  978. end
  979. if $imported["EquipExtension"]
  980. return if extra_armor_number == 0
  981. for i in 5..armor_number
  982. change_equip(i, nil) unless equippable?(equips[i])
  983. end
  984. end
  985. purge_unequippable_skills if $imported["EquipSkillSlots"]
  986. @unlocked_classes.sort!
  987. end
  988.  
  989. #--------------------------------------------------------------------------
  990. # return Subclass
  991. #--------------------------------------------------------------------------
  992. def subclass
  993. @subclass_id = 0 if @subclass_id == nil
  994. return $data_classes[@subclass_id]
  995. end
  996.  
  997. #--------------------------------------------------------------------------
  998. # change Subclass ID
  999. #--------------------------------------------------------------------------
  1000. def subclass_id=(newvalue)
  1001. if YE::SUBCLASS::ACTOR_RESTRICTED_CLASSES.include?(self.id)
  1002. unless YE::SUBCLASS::ACTOR_RESTRICTED_CLASSES[self.id].include?(newvalue)
  1003. return
  1004. end
  1005. end
  1006. hp_per = self.hp * 100.00 / self.maxhp
  1007. mp_per = self.mp * 100.00 / self.maxmp
  1008. @subclass_id = newvalue
  1009. @subclass_id = 0 if @subclass_id == @class_id
  1010. self.hp = Integer(hp_per * self.maxhp / 100)
  1011. self.mp = Integer(mp_per * self.maxmp / 100)
  1012. return if @subclass_id == 0
  1013. if YE::SUBCLASS::ALLOW_RETRO_LEARN and self.subclass != nil
  1014. for i in self.subclass.learnings
  1015. learn_skill(i.skill_id) if i.level <= @level
  1016. end
  1017. end
  1018. unless @unlocked_classes.include?(@subclass_id)
  1019. @unlocked_classes.push(@subclass_id)
  1020. end
  1021. #---
  1022. for i in 0..4
  1023. change_equip(i, nil) unless equippable?(equips[i])
  1024. end
  1025. if $imported["EquipExtension"]
  1026. return if extra_armor_number == 0
  1027. for i in 5..armor_number
  1028. change_equip(i, nil) unless equippable?(equips[i])
  1029. end
  1030. end
  1031. purge_unequippable_skills if $imported["EquipSkillSlots"]
  1032. @unlocked_classes.sort!
  1033. end
  1034.  
  1035. #--------------------------------------------------------------------------
  1036. # clone class/subclass change
  1037. #--------------------------------------------------------------------------
  1038. def class_clone=(newvalue)
  1039. @class_id = newvalue
  1040. for i in 0..4
  1041. change_equip(i, nil, true) unless equippable?(equips[i])
  1042. end
  1043. if $imported["EquipExtension"]
  1044. return if extra_armor_number == 0
  1045. for i in 5..armor_number
  1046. change_equip(i, nil, true) unless equippable?(equips[i])
  1047. end
  1048. end
  1049. end
  1050.  
  1051. def subclass_clone=(newvalue)
  1052. @subclass_id = newvalue
  1053. @subclass_id = 0 if @subclass_id == @class_id
  1054. for i in 0..4
  1055. change_equip(i, nil, true) unless equippable?(equips[i])
  1056. end
  1057. if $imported["EquipExtension"]
  1058. return if extra_armor_number == 0
  1059. for i in 5..armor_number
  1060. change_equip(i, nil, true) unless equippable?(equips[i])
  1061. end
  1062. end
  1063. end
  1064.  
  1065. #--------------------------------------------------------------------------
  1066. # return unlocked classes
  1067. #--------------------------------------------------------------------------
  1068. def unlocked_classes
  1069. results = []
  1070. @unlocked_classes = [self.class.id] if @unlocked_classes == nil
  1071. @unlocked_classes.sort!
  1072. if YE::SUBCLASS::ACTOR_RESTRICTED_CLASSES.include?(self.id)
  1073. for class_id in @unlocked_classes
  1074. if YE::SUBCLASS::ACTOR_RESTRICTED_CLASSES[self.id].include?(class_id)
  1075. results.push(class_id)
  1076. end
  1077. end
  1078. else
  1079. results = @unlocked_classes
  1080. end
  1081. results.push(self.class.id) unless results.include?(self.class.id)
  1082. return results
  1083. end
  1084.  
  1085. #--------------------------------------------------------------------------
  1086. # perform unlock class
  1087. #--------------------------------------------------------------------------
  1088. def unlock_class(newclass_id)
  1089. @unlocked_classes = [self.class.id] if @unlocked_classes == nil
  1090. unless @unlocked_classes.include?(newclass_id)
  1091. @unlocked_classes.push(newclass_id)
  1092. end
  1093. @unlocked_classes.sort!
  1094. if YE::SUBCLASS::ALLOW_RETRO_LEARN
  1095. newsubclass = $data_classes[newclass_id]
  1096. for i in newsubclass.learnings
  1097. learn_skill(i.skill_id) if i.level <= @level
  1098. end
  1099. end
  1100. end
  1101.  
  1102. #--------------------------------------------------------------------------
  1103. # perform lock class
  1104. #--------------------------------------------------------------------------
  1105. def lock_class(newclass_id)
  1106. return if newclass_id == self.class.id
  1107. @unlocked_classes = [self.class.id] if @unlocked_classes == nil
  1108. @unlocked_classes.delete(newclass_id)
  1109. @unlocked_classes.sort!
  1110. end
  1111.  
  1112. #--------------------------------------------------------------------------
  1113. # perform unlock all classes
  1114. #--------------------------------------------------------------------------
  1115. def unlock_all_classes
  1116. for i in 0..$data_classes.size
  1117. unlock = $data_classes[i + 1]
  1118. self.unlock_class(unlock.id)
  1119. end
  1120. @unlocked_classes.sort!
  1121. end
  1122.  
  1123. #--------------------------------------------------------------------------
  1124. # perform lock all classes
  1125. #--------------------------------------------------------------------------
  1126. def lock_all_classes
  1127. for i in 0..$data_classes.size
  1128. unlock = $data_classes[i + 1]
  1129. self.lock_class(unlock.id)
  1130. end
  1131. @unlocked_classes.sort!
  1132. end
  1133.  
  1134. #--------------------------------------------------------------------------
  1135. # alias equippable?
  1136. #--------------------------------------------------------------------------
  1137. alias equippable_sss equippable?
  1138. def equippable?(item)
  1139. result = false
  1140. result = equippable_sss(item)
  1141. if YE::SUBCLASS::ALLOW_EQUIP and !result and self.subclass != nil
  1142. result = subclass_equippable?(item)
  1143. end
  1144. return result
  1145. end
  1146.  
  1147. #--------------------------------------------------------------------------
  1148. # subclass equippable?
  1149. #--------------------------------------------------------------------------
  1150. def subclass_equippable?(item)
  1151. if item.is_a?(RPG::Weapon)
  1152. return self.subclass.weapon_set.include?(item.id)
  1153. elsif item.is_a?(RPG::Armor)
  1154. return false if two_swords_style and item.kind == 0
  1155. return self.subclass.armor_set.include?(item.id)
  1156. end
  1157. return false
  1158. end
  1159.  
  1160. #--------------------------------------------------------------------------
  1161. # alias level_up
  1162. #--------------------------------------------------------------------------
  1163. alias level_up_sss level_up
  1164. def level_up
  1165. #-----
  1166. prm_rate = YE::SUBCLASS::PRIMARY_GROWTH_RATE
  1167. sub_rate = YE::SUBCLASS::SUBCLASS_GROWTH_RATE
  1168. if YE::SUBCLASS::LEVEL_UP_BONUS_PRIMARY
  1169. if YE::SUBCLASS::CLASS_STAT_BONUS_SET.include?(self.class.id)
  1170. narray = YE::SUBCLASS::CLASS_STAT_BONUS_SET[self.class.id]
  1171. self.maxhp += (narray[0] * prm_rate) / 100
  1172. self.maxmp += (narray[1] * prm_rate) / 100
  1173. self.atk += (narray[2] * prm_rate) / 100
  1174. self.def += (narray[3] * prm_rate) / 100
  1175. self.spi += (narray[4] * prm_rate) / 100
  1176. self.agi += (narray[5] * prm_rate) / 100
  1177. end
  1178. end
  1179. #-----
  1180. if YE::SUBCLASS::BONUS_RANDOM_PRIMARY
  1181. if YE::SUBCLASS::CLASS_STAT_BONUS_RAN.include?(self.class.id)
  1182. narray = YE::SUBCLASS::CLASS_STAT_BONUS_RAN[self.class.id]
  1183. self.maxhp += (rand(narray[0]) * prm_rate) / 100 unless narray[0] == 0
  1184. self.maxmp += (rand(narray[1]) * prm_rate) / 100 unless narray[1] == 0
  1185. self.atk += (rand(narray[2]) * prm_rate) / 100 unless narray[2] == 0
  1186. self.def += (rand(narray[3]) * prm_rate) / 100 unless narray[3] == 0
  1187. self.spi += (rand(narray[4]) * prm_rate) / 100 unless narray[4] == 0
  1188. self.agi += (rand(narray[5]) * prm_rate) / 100 unless narray[5] == 0
  1189. end
  1190. end
  1191. #-----
  1192. if YE::SUBCLASS::LEVEL_UP_BONUS_SUBCLASS and self.subclass != nil
  1193. if YE::SUBCLASS::CLASS_STAT_BONUS_SET.include?(self.class.id)
  1194. narray = YE::SUBCLASS::CLASS_STAT_BONUS_SET[self.class.id]
  1195. self.maxhp += (narray[0] * sub_rate) / 100
  1196. self.maxmp += (narray[1] * sub_rate) / 100
  1197. self.atk += (narray[2] * sub_rate) / 100
  1198. self.def += (narray[3] * sub_rate) / 100
  1199. self.spi += (narray[4] * sub_rate) / 100
  1200. self.agi += (narray[5] * sub_rate) / 100
  1201. end
  1202. end
  1203. #-----
  1204. if YE::SUBCLASS::BONUS_RANDOM_SUBCLASS and self.subclass != nil
  1205. if YE::SUBCLASS::CLASS_STAT_BONUS_RAN.include?(self.class.id)
  1206. narray = YE::SUBCLASS::CLASS_STAT_BONUS_RAN[self.class.id]
  1207. self.maxhp += (rand(narray[0]) * sub_rate) / 100 unless narray[0] == 0
  1208. self.maxmp += (rand(narray[1]) * sub_rate) / 100 unless narray[1] == 0
  1209. self.atk += (rand(narray[2]) * sub_rate) / 100 unless narray[2] == 0
  1210. self.def += (rand(narray[3]) * sub_rate) / 100 unless narray[3] == 0
  1211. self.spi += (rand(narray[4]) * sub_rate) / 100 unless narray[4] == 0
  1212. self.agi += (rand(narray[5]) * sub_rate) / 100 unless narray[5] == 0
  1213. end
  1214. end
  1215. #-----
  1216. if YE::SUBCLASS::ALLOW_RETRO_LEARN and self.subclass != nil
  1217. for i in self.subclass.learnings
  1218. learn_skill(i.skill_id) if i.level <= @level
  1219. end
  1220. end
  1221. #-----
  1222. level_up_sss
  1223. end
  1224.  
  1225. #--------------------------------------------------------------------------
  1226. # alias skills
  1227. #--------------------------------------------------------------------------
  1228. alias skills_sss skills
  1229. def skills
  1230. original_skills = skills_sss
  1231. allowed_skills = YE::SUBCLASS::CLASS_SKILL_ALLOW[0]
  1232. if YE::SUBCLASS::ACTOR_COMMON_SKILLS.include?(self.id)
  1233. allowed_skills += YE::SUBCLASS::ACTOR_COMMON_SKILLS[self.id]
  1234. end
  1235. if YE::SUBCLASS::CLASS_SKILL_ALLOW.include?(self.class.id)
  1236. allowed_skills += YE::SUBCLASS::CLASS_SKILL_ALLOW[self.class.id]
  1237. if YE::SUBCLASS::PRIMARY_ONLY_SKILLS.include?(self.class.id)
  1238. allowed_skills += YE::SUBCLASS::PRIMARY_ONLY_SKILLS[self.class.id]
  1239. end
  1240. end
  1241. unless self.subclass == nil
  1242. allowed_skills += YE::SUBCLASS::CLASS_SKILL_ALLOW[self.subclass.id]
  1243. if YE::SUBCLASS::SUBCLASS_ONLY_SKILLS.include?(self.subclass.id)
  1244. allowed_skills += YE::SUBCLASS::SUBCLASS_ONLY_SKILLS[self.subclass.id]
  1245. end
  1246. end
  1247. result = []
  1248. for skill in original_skills
  1249. skill_id = skill.id
  1250. result.push(skill) if allowed_skills.include?(skill_id)
  1251. end
  1252. return result
  1253. end
  1254.  
  1255. #--------------------------------------------------------------------------
  1256. # skills_learned
  1257. #--------------------------------------------------------------------------
  1258. def skills_learned(class_id)
  1259. result = []
  1260. if YE::SUBCLASS::CLASS_SKILL_ALLOW.include?(class_id)
  1261. class_skills = YE::SUBCLASS::CLASS_SKILL_ALLOW[class_id]
  1262. if YE::SUBCLASS::PRIMARY_ONLY_SKILLS.include?(class_id)
  1263. class_skills += YE::SUBCLASS::PRIMARY_ONLY_SKILLS[class_id]
  1264. end
  1265. if YE::SUBCLASS::SUBCLASS_ONLY_SKILLS.include?(class_id)
  1266. class_skills += YE::SUBCLASS::SUBCLASS_ONLY_SKILLS[class_id]
  1267. end
  1268. for i in class_skills
  1269. result.push($data_skills[i]) if @skills.include?(i)
  1270. end
  1271. end
  1272. return result
  1273. end
  1274.  
  1275. #--------------------------------------------------------------------------
  1276. # alias base stats
  1277. #--------------------------------------------------------------------------
  1278. alias base_maxhp_sss base_maxhp
  1279. def base_maxhp
  1280. n = base_maxhp_sss
  1281. if YE::SUBCLASS::AFFECT_STATS_PRIMARY
  1282. if YE::SUBCLASS::CLASS_STAT_RATE.include?(self.class.id)
  1283. narray = YE::SUBCLASS::CLASS_STAT_RATE[self.class.id]
  1284. else
  1285. narray = YE::SUBCLASS::CLASS_STAT_RATE[0]
  1286. end
  1287. # n *= 100 + ((narray[0]-100) * YE::SUBCLASS::PRIMARY_STAT_RATE/100)
  1288. n /= 100.0
  1289. end
  1290. if YE::SUBCLASS::AFFECT_STATS_SUBCLASS and self.subclass != nil
  1291. if YE::SUBCLASS::CLASS_STAT_RATE.include?(self.subclass.id)
  1292. narray = YE::SUBCLASS::CLASS_STAT_RATE[self.subclass.id]
  1293. else
  1294. narray = YE::SUBCLASS::CLASS_STAT_RATE[0]
  1295. end
  1296. n *= 100 + ((narray[0]-100) * YE::SUBCLASS::SUBCLASS_STAT_RATE/100)
  1297. n /= 100.0
  1298. end
  1299. return Integer(n)
  1300. end
  1301.  
  1302. alias base_maxmp_sss base_maxmp
  1303. def base_maxmp
  1304. n = base_maxmp_sss
  1305. if YE::SUBCLASS::AFFECT_STATS_PRIMARY
  1306. if YE::SUBCLASS::CLASS_STAT_RATE.include?(self.class.id)
  1307. narray = YE::SUBCLASS::CLASS_STAT_RATE[self.class.id]
  1308. else
  1309. narray = YE::SUBCLASS::CLASS_STAT_RATE[0]
  1310. end
  1311. # n *= 100 + ((narray[1]-100) * YE::SUBCLASS::PRIMARY_STAT_RATE/100)
  1312. n /= 100.0
  1313. end
  1314. if YE::SUBCLASS::AFFECT_STATS_SUBCLASS and self.subclass != nil
  1315. if YE::SUBCLASS::CLASS_STAT_RATE.include?(self.subclass.id)
  1316. narray = YE::SUBCLASS::CLASS_STAT_RATE[self.subclass.id]
  1317. else
  1318. narray = YE::SUBCLASS::CLASS_STAT_RATE[0]
  1319. end
  1320. n *= 100 + ((narray[1]-100) * YE::SUBCLASS::SUBCLASS_STAT_RATE/100)
  1321. n /= 100.0
  1322. end
  1323. return Integer(n)
  1324. end
  1325.  
  1326. alias base_atk_sss base_atk
  1327. def base_atk
  1328. n = base_atk_sss
  1329. if YE::SUBCLASS::AFFECT_STATS_PRIMARY
  1330. if YE::SUBCLASS::CLASS_STAT_RATE.include?(self.class.id)
  1331. narray = YE::SUBCLASS::CLASS_STAT_RATE[self.class.id]
  1332. else
  1333. narray = YE::SUBCLASS::CLASS_STAT_RATE[0]
  1334. end
  1335. n *= 100 + ((narray[2]-100) * YE::SUBCLASS::PRIMARY_STAT_RATE/100)
  1336. n /= 100.0
  1337. end
  1338. if YE::SUBCLASS::AFFECT_STATS_SUBCLASS and self.subclass != nil
  1339. if YE::SUBCLASS::CLASS_STAT_RATE.include?(self.subclass.id)
  1340. narray = YE::SUBCLASS::CLASS_STAT_RATE[self.subclass.id]
  1341. else
  1342. narray = YE::SUBCLASS::CLASS_STAT_RATE[0]
  1343. end
  1344. n *= 100 + ((narray[2]-100) * YE::SUBCLASS::SUBCLASS_STAT_RATE/100)
  1345. n /= 100.0
  1346. end
  1347. return Integer(n)
  1348. end
  1349.  
  1350. alias base_def_sss base_def
  1351. def base_def
  1352. n = base_def_sss
  1353. if YE::SUBCLASS::AFFECT_STATS_PRIMARY
  1354. if YE::SUBCLASS::CLASS_STAT_RATE.include?(self.class.id)
  1355. narray = YE::SUBCLASS::CLASS_STAT_RATE[self.class.id]
  1356. else
  1357. narray = YE::SUBCLASS::CLASS_STAT_RATE[0]
  1358. end
  1359. n *= 100 + ((narray[3]-100) * YE::SUBCLASS::PRIMARY_STAT_RATE/100)
  1360. n /= 100.0
  1361. end
  1362. if YE::SUBCLASS::AFFECT_STATS_SUBCLASS and self.subclass != nil
  1363. if YE::SUBCLASS::CLASS_STAT_RATE.include?(self.subclass.id)
  1364. narray = YE::SUBCLASS::CLASS_STAT_RATE[self.subclass.id]
  1365. else
  1366. narray = YE::SUBCLASS::CLASS_STAT_RATE[0]
  1367. end
  1368. n *= 100 + ((narray[3]-100) * YE::SUBCLASS::SUBCLASS_STAT_RATE/100)
  1369. n /= 100.0
  1370. end
  1371. return Integer(n)
  1372. end
  1373.  
  1374. alias base_spi_sss base_spi
  1375. def base_spi
  1376. n = base_spi_sss
  1377. if YE::SUBCLASS::AFFECT_STATS_PRIMARY
  1378. if YE::SUBCLASS::CLASS_STAT_RATE.include?(self.class.id)
  1379. narray = YE::SUBCLASS::CLASS_STAT_RATE[self.class.id]
  1380. else
  1381. narray = YE::SUBCLASS::CLASS_STAT_RATE[0]
  1382. end
  1383. n *= 100 + ((narray[4]-100) * YE::SUBCLASS::PRIMARY_STAT_RATE/100)
  1384. n /= 100.0
  1385. end
  1386. if YE::SUBCLASS::AFFECT_STATS_SUBCLASS and self.subclass != nil
  1387. if YE::SUBCLASS::CLASS_STAT_RATE.include?(self.subclass.id)
  1388. narray = YE::SUBCLASS::CLASS_STAT_RATE[self.subclass.id]
  1389. else
  1390. narray = YE::SUBCLASS::CLASS_STAT_RATE[0]
  1391. end
  1392. n *= 100 + ((narray[4]-100) * YE::SUBCLASS::SUBCLASS_STAT_RATE/100)
  1393. n /= 100.0
  1394. end
  1395. return Integer(n)
  1396. end
  1397.  
  1398. alias base_agi_sss base_agi
  1399. def base_agi
  1400. n = base_agi_sss
  1401. if YE::SUBCLASS::AFFECT_STATS_PRIMARY
  1402. if YE::SUBCLASS::CLASS_STAT_RATE.include?(self.class.id)
  1403. narray = YE::SUBCLASS::CLASS_STAT_RATE[self.class.id]
  1404. else
  1405. narray = YE::SUBCLASS::CLASS_STAT_RATE[0]
  1406. end
  1407. n *= 100 + ((narray[5]-100) * YE::SUBCLASS::PRIMARY_STAT_RATE/100)
  1408. n /= 100.0
  1409. end
  1410. if YE::SUBCLASS::AFFECT_STATS_SUBCLASS and self.subclass != nil
  1411. if YE::SUBCLASS::CLASS_STAT_RATE.include?(self.subclass.id)
  1412. narray = YE::SUBCLASS::CLASS_STAT_RATE[self.subclass.id]
  1413. else
  1414. narray = YE::SUBCLASS::CLASS_STAT_RATE[0]
  1415. end
  1416. n *= 100 + ((narray[5]-100) * YE::SUBCLASS::SUBCLASS_STAT_RATE/100)
  1417. n /= 100.0
  1418. end
  1419. return Integer(n)
  1420. end
  1421.  
  1422. #--------------------------------------------------------------------------
  1423. # return class_jp
  1424. #--------------------------------------------------------------------------
  1425. def class_jp(id_value)
  1426. @class_jp = {} if @class_jp == nil
  1427. @class_jp[id_value] = 0 if @class_jp[id_value] == nil
  1428. limit = YE::SUBCLASS::MAX_JP_EARNED
  1429. @class_jp[id_value] = [@class_jp[id_value], limit].min
  1430. return @class_jp[id_value]
  1431. end
  1432.  
  1433. #--------------------------------------------------------------------------
  1434. # action change jp
  1435. #--------------------------------------------------------------------------
  1436. def change_jp(id_value, jp_earned = 1)
  1437. @class_jp = {} if @class_jp == nil
  1438. @class_jp[id_value] = 0 if @class_jp[id_value] == nil
  1439. @class_jp[id_value] += jp_earned
  1440. limit = YE::SUBCLASS::MAX_JP_EARNED
  1441. @class_jp[id_value] = [[@class_jp[id_value], limit].min, 0].max
  1442. end
  1443.  
  1444. #--------------------------------------------------------------------------
  1445. # forget all skills
  1446. #--------------------------------------------------------------------------
  1447. def forget_all_skills
  1448. @skills = []
  1449. end
  1450.  
  1451. end # end Game Actor
  1452.  
  1453. #==============================================================================
  1454. # Game_Troop
  1455. #==============================================================================
  1456.  
  1457. class Game_Troop < Game_Unit
  1458.  
  1459. #--------------------------------------------------------------------------
  1460. # JP Total
  1461. #--------------------------------------------------------------------------
  1462. def jp_total
  1463. jp = 0
  1464. for enemy in dead_members
  1465. jp += enemy.enemy.enemy_jp unless enemy.hidden
  1466. end
  1467. return jp
  1468. end
  1469.  
  1470. end # Game_Troop
  1471.  
  1472. #==============================================================================
  1473. # Window_Command (imported from KGC)
  1474. #==============================================================================
  1475.  
  1476. class Window_Command < Window_Selectable
  1477. unless method_defined?(:add_command)
  1478. #--------------------------------------------------------------------------
  1479. # add command
  1480. #--------------------------------------------------------------------------
  1481. def add_command(command)
  1482. @commands << command
  1483. @item_max = @commands.size
  1484. item_index = @item_max - 1
  1485. refresh_command
  1486. draw_item(item_index)
  1487. return item_index
  1488. end
  1489. #--------------------------------------------------------------------------
  1490. # refresh command
  1491. #--------------------------------------------------------------------------
  1492. def refresh_command
  1493. buf = self.contents.clone
  1494. self.height = [self.height, row_max * WLH + 32].max
  1495. create_contents
  1496. self.contents.blt(0, 0, buf, buf.rect)
  1497. buf.dispose
  1498. end
  1499. #--------------------------------------------------------------------------
  1500. # insert command
  1501. #--------------------------------------------------------------------------
  1502. def insert_command(index, command)
  1503. @commands.insert(index, command)
  1504. @item_max = @commands.size
  1505. refresh_command
  1506. refresh
  1507. end
  1508. #--------------------------------------------------------------------------
  1509. # remove command
  1510. #--------------------------------------------------------------------------
  1511. def remove_command(command)
  1512. @commands.delete(command)
  1513. @item_max = @commands.size
  1514. refresh
  1515. end
  1516. end
  1517. end
  1518.  
  1519. #==============================================================================
  1520. # Scene_Battle
  1521. #==============================================================================
  1522.  
  1523. class Scene_Battle < Scene_Base
  1524.  
  1525. #--------------------------------------------------------------------------
  1526. # alias process_battle_start
  1527. #--------------------------------------------------------------------------
  1528. alias process_battle_start_sss process_battle_start
  1529. def process_battle_start
  1530. for actor in $game_party.members
  1531. actor.jp_counter = 0
  1532. end
  1533. process_battle_start_sss
  1534. end
  1535.  
  1536. #--------------------------------------------------------------------------
  1537. # alias execute_action_guard
  1538. #--------------------------------------------------------------------------
  1539. alias execute_action_guard_sss execute_action_guard
  1540. def execute_action_guard
  1541. execute_action_guard_sss
  1542. return unless @active_battler.actor?
  1543. return unless YE::SUBCLASS::EARN_JP_VIA_GUARD_ENABLE
  1544. amount = YE::SUBCLASS::EARN_JP_VIA_GUARD_AMOUNT
  1545. unless YE::SUBCLASS::EARN_JP_VIA_GUARD_RANDOM == 0
  1546. amount += rand(YE::SUBCLASS::EARN_JP_VIA_GUARD_RANDOM)
  1547. end
  1548. @active_battler.gain_jp(amount)
  1549. end
  1550.  
  1551. #--------------------------------------------------------------------------
  1552. # alias display_exp_and_gold
  1553. #--------------------------------------------------------------------------
  1554. alias display_exp_and_gold_sss display_exp_and_gold
  1555. def display_exp_and_gold
  1556. display_exp_and_gold_sss
  1557. return unless YE::SUBCLASS::USE_JP_SYSTEM
  1558. return unless YE::SUBCLASS::ENEMIES_GIVE_JP
  1559. jp = $game_troop.jp_total
  1560. if jp > 0
  1561. text = sprintf(YE::SUBCLASS::ENEMIES_MESSAGE, $game_party.name, jp)
  1562. $game_message.texts.push(text) if YE::SUBCLASS::ENEMIES_SHOW_MSG
  1563. end
  1564. if YE::SUBCLASS::DISPLAY_ACTOR_JP
  1565. $game_message.new_page
  1566. end
  1567. for actor in $game_party.members
  1568. actor.gain_jp(jp)
  1569. next unless YE::SUBCLASS::DISPLAY_ACTOR_JP
  1570. text = sprintf(YE::SUBCLASS::DISPLAY_ACTOR_MSG, actor.name, actor.jp_counter)
  1571. $game_message.texts.push('\>' + text)
  1572. end
  1573. wait_for_message if YE::SUBCLASS::DISPLAY_ACTOR_JP
  1574. end
  1575.  
  1576. end
  1577.  
  1578. #===============================================================================
  1579. # Scene Menu
  1580. #===============================================================================
  1581.  
  1582. class Scene_Menu < Scene_Base
  1583.  
  1584. #--------------------------------------------------------------------------
  1585. # alias create command window
  1586. #--------------------------------------------------------------------------
  1587. alias create_command_window_sss create_command_window
  1588. def create_command_window
  1589. create_command_window_sss
  1590. return if $imported["CustomMenuCommand"]
  1591. if YE::SUBCLASS::MENU_CLASS_CHANGE_OPTION and
  1592. $game_switches[YE::SUBCLASS::ENABLE_CLASS_CHANGE_SWITCH]
  1593. scc_text = YE::SUBCLASS::MENU_CLASS_CHANGE_TITLE
  1594. @command_class_change = @command_window.add_command(scc_text)
  1595. if @command_window.oy > 0
  1596. @command_window.oy -= Window_Base::WLH
  1597. end
  1598. end
  1599. if YE::SUBCLASS::USE_JP_SYSTEM and YE::SUBCLASS::LEARN_SKILL_OPTION and
  1600. $game_switches[YE:
Add Comment
Please, Sign In to add comment