Guest User

Atoa's Materia (Cosplay Crisis version)

a guest
Nov 9th, 2010
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 108.22 KB | None | 0 0
  1. #==============================================================================
  2. # Materia System (FF:VII)
  3. #==============================================================================
  4. # Original Script from XP by SephirothSpawn
  5. # and Converted for VX by Atoa
  6. #------------------------------------------------------------------------------
  7. # Traslated by: Carbajosa... (Is this credit needed? lol)
  8. # Thaks Kain Nobel for the help in translation
  9. #------------------------------------------------------------------------------
  10. # Sorry if these translations are a bit messy, its because
  11. # this is a direct translation but the instructions provided
  12. # here is originaly made by Atoa (copied and pasted)
  13. #==============================================================================
  14. =begin
  15. ===================================================
  16. Materia Icons
  17. ===================================================
  18.  
  19. You can set individual icons for each materia, the icon must be on the Incon
  20. folder.
  21. The name of the icon must be the same of the Materia + "_m"
  22.  
  23. E.g
  24. Cure materia icon must be named "Cure_m"
  25. Ultima materia icon must be named "Ultima_m"
  26.  
  27. Materias without individual icons will have the default materia icon, the color
  28. of defaut icon depends on the materia type
  29.  
  30. ===================================================
  31. Configurating Materias
  32. ===================================================
  33.  
  34. To configure the materias, look for lines like these in the "module
  35. Materia_Config"
  36.  
  37. MATERIA_LIST << [ID, name, type, status, elements, status effects, price,
  38. master price, ap, skill, special effect]
  39.  
  40. * ID = Materia ID
  41. * name = materia Name
  42. * type = materia type (can be "Magic", "Command", "Summon", "Support"
  43. and "Independent")
  44. * status = status change of the materia.[hp, sp, str, dex, agi, int] in
  45. XP, [hp, mp, atk, def, spi, agi] in VX
  46. * elements = element id of materia. used when paired with elemental
  47. spuport materia. must be an array
  48. * status effect = status effect id of materia. used when paired with
  49. added effect spuport materia must. be an array
  50. * price = Price of materia with 0 AP
  51. * master price = Price of an level max materia
  52. * ap = ap nedded to level up. must be an array. the first value is the
  53. ap to level 2. Here is the place where you set the max level of materia,
  54. depending on how many values you add on the array.
  55.  
  56. E.G
  57. [1000, 2000 ,3000] = the materia will have 4 levels
  58. [2500, 5000, 10000, 20000, 40000] = the materia will have 6 levels
  59.  
  60. * skills = skills of the materia. must be an array. you can make an
  61. instace of this array = nil, so materia will "skip" this level
  62.  
  63. E.G
  64. [2,7,20] = materia gain skill ID 2 in level 1, skill ID 7 in level 2, and
  65. skill ID 20 in level 3.
  66. [nil,6,nil,13] = materia gain no skill in level 1, skill ID in level 2, no
  67. skill in level 3, and skill ID 13 in level 4.
  68.  
  69. * special effects = special effects of materia. one of these: "All",
  70. "Elemental", "Added Effect", "HP Absorb", "MP Absorb", "MP Turbo",
  71. "MP Cost Cut", "EXP plus", "Gil Plus", "Luck Plus"(only for XP),
  72. "HP Plus", "MP Plus", "Strength Plus", "Defense Plus", "Magic Plus",
  73. "Speed Plus", "Flee Plus", "Critical Rate Plus", "Critical Damage Plus",
  74. "Escape Plus", "Unnarmed Attack Plus" (only for XP), "HP <> MP"
  75.  
  76.  
  77. ===================================================
  78. Gain new Materia
  79. ===================================================
  80.  
  81. Use the Script Call event and add this code:
  82. $game_party.gain_materia(ID)
  83. where ID = the ID of materia
  84.  
  85. ===================================================
  86. Materia Shop
  87. ===================================================
  88.  
  89. to open an materia shop use the Script Call event and add this code:
  90. materia_avaliable = [ X, Y, Z]
  91. $scene = Scene_MateriaShop.new(materia_avaliable)
  92.  
  93. X,Y,Z = the ID of Materias
  94. You can add how many IDs you want.
  95.  
  96. ===================================================
  97. Set Enemy AP
  98. ===================================================
  99.  
  100. to set enemy AP, look for lines like these in the "module Materia_Config"
  101.  
  102. ENEMY_AP[ID] = X
  103.  
  104. ID = Enemy ID
  105. X = AP given by enemy
  106.  
  107. Enemys that don't have their IDs added to the list will give AP = their EXP/10
  108.  
  109. #==============================================================================
  110. =end
  111.  
  112. module Materia_Config
  113.  
  114. # Do not Erase the lines
  115. WEAPON_MATERIA_SLOTS = []
  116. ARMORS_MATERIA_SLOTS = []
  117. MATERIA_LIST = []
  118. ENEMY_AP = []
  119. # Do not Erase the lines
  120.  
  121. # Show Faces in the Materia Equip Window?
  122. Show_Faces = true
  123. # Faces must be in an folder named "Faces" in the Graphics/Character foder
  124. # and must have the same name as the charset graphic
  125.  
  126. # If true, when a materia reach a maximum level, you gain another
  127. # Stat in level 1, if false, nothing will happen
  128. Materia_Breeding = true
  129.  
  130. # Configuration of attributes IDs with special effects
  131. Negate_Absorb_ID = 17 # ID attribute to the effect "Negate Absorption"
  132. Negate_Turbo_ID = 18 # ID attribute to the effect "Negate MP Turbo"
  133. Negate_All_ID = 19 # ID attribute to the effect "Negate All"
  134.  
  135. # Materia Shop Message Configuration
  136. Shop_Message = 'How can I help you?' # ShoP Message
  137. Buy_Message = 'What Materia would you like to buy?' # Buy Message
  138. Sell_Message = 'Which materia do you want to sell?' # Selling Message
  139. Buy_Command = 'Buy Materia' # Name of Option to purchase the store Materias
  140. Sell_Command = 'Sell Materia' # Name of Option to sell the store Materias
  141. Empty_Message = 'None' # Message when Equiped...?
  142. Master_Text = 'Master' # Text that indicates a Materia in High Level
  143. AP_Total = 'Total AP:' # AP Attribute name (in the window of materials)
  144. AP_Name = 'AP' # AP Attribute name (shown ih the Battle Result Window)
  145. Hp_Text = 'HP' # HP Attribute name (in materia window)
  146. Sp_Text = 'SP' # SP Attribute name (in materia window)
  147. Str_Text = 'STR' # STR Attribute name (in materia window)
  148. Vit_Text = 'VIT' # VIT Attribute name (in *ALL* windows)
  149. Agi_Text = 'AGI' # AGI Attribute name (in materia window)
  150. Int_Text = 'INT' # INT Attribute name (in materia window)
  151.  
  152.  
  153. Default_Icon = 'Materia Icon' # Default Materia Icon
  154. Materia_Cursor = 'Materia Cursor' # Cursor Graphic Icon
  155. Single_Slot = 'Materia Single' # Single-Slot Icon
  156. Paired_Slot_Left = 'Materia Paired Left' # Paired-Slot Icon (Left)
  157. Paired_Slot_Right = 'Materia Paired Right' # Paired-Slot Icon (Right)
  158. Materia_Level = 'Star - Icon' # Level Icon
  159.  
  160. # Graphich Icon name when equip slot is empty
  161. Empty_Weapon = '001-Weapon01'
  162. Empty_Armor1 = '009-Shield01'
  163. Empty_Armor2 = '010-Head01'
  164. Empty_Armor3 = '014-Body02'
  165. Empty_Armor4 = '016-Accessory01'
  166.  
  167. #===============================================================================
  168. =begin
  169. ===================================================
  170. Equipment Slots
  171. ===================================================
  172.  
  173. To set the slots of equipment, look for lines like these in the
  174. "module Materia_Config"
  175.  
  176. WEAPON_MATERIA_SLOTS[ID] = [X , Y] for weapons
  177. ARMORS_MATERIA_SLOTS[ID] = [X , Y] for armors
  178.  
  179. ID = Equipment ID
  180. X = number of paired slots (count as 2 single slots)
  181. Y = nuber of single slots
  182.  
  183. The total slots will never be greater than 8, if you set more than 8 slots,
  184. the extra slots will be ignored
  185.  
  186. E.g
  187. ARMORS_MATERIA_SLOTS[5] = [2, 2]
  188. The armor ID 5 will have 6 slots
  189. (2 * 2) + 2 = 6
  190.  
  191. WEAPON_MATERIA_SLOTS[3] = [1, 5]
  192. The weapon ID 5 will have 7 slots
  193. (1 * 2) + 5 = 7
  194.  
  195. If you don't add an equipment ID on the list, the equip of this ID will have
  196. 0 slots
  197. =end
  198. #================================================================================
  199. # Weapon Slots
  200. WEAPON_MATERIA_SLOTS[1] = [1 , 1]
  201. WEAPON_MATERIA_SLOTS[2] = [1 , 2]
  202. WEAPON_MATERIA_SLOTS[3] = [2 , 2]
  203. WEAPON_MATERIA_SLOTS[4] = [0 , 2]
  204. WEAPON_MATERIA_SLOTS[5] = [1 , 0]
  205. WEAPON_MATERIA_SLOTS[6] = [0 , 5]
  206. WEAPON_MATERIA_SLOTS[7] = [2 , 3]
  207. WEAPON_MATERIA_SLOTS[8] = [3 , 2]
  208. WEAPON_MATERIA_SLOTS[9] = [0 , 0]
  209. WEAPON_MATERIA_SLOTS[10] = [0 , 2]
  210. WEAPON_MATERIA_SLOTS[11] = [1 , 0]
  211. WEAPON_MATERIA_SLOTS[12] = [2 , 0]
  212. WEAPON_MATERIA_SLOTS[13] = [2 , 2]
  213. WEAPON_MATERIA_SLOTS[14] = [4 , 0]
  214. WEAPON_MATERIA_SLOTS[15] = [2 , 2]
  215. WEAPON_MATERIA_SLOTS[16] = [4 , 0]
  216. WEAPON_MATERIA_SLOTS[17] = [1 , 1]
  217. WEAPON_MATERIA_SLOTS[18] = [1 , 2]
  218. WEAPON_MATERIA_SLOTS[19] = [2 , 1]
  219. WEAPON_MATERIA_SLOTS[20] = [4 , 0]
  220. WEAPON_MATERIA_SLOTS[21] = [1 , 0]
  221. WEAPON_MATERIA_SLOTS[22] = [0 , 3]
  222. WEAPON_MATERIA_SLOTS[23] = [0 , 5]
  223. WEAPON_MATERIA_SLOTS[24] = [4 , 0]
  224. WEAPON_MATERIA_SLOTS[25] = [1 , 1]
  225. WEAPON_MATERIA_SLOTS[26] = [1 , 2]
  226. WEAPON_MATERIA_SLOTS[27] = [2 , 2]
  227. WEAPON_MATERIA_SLOTS[28] = [4 , 0]
  228. WEAPON_MATERIA_SLOTS[29] = [1 , 1]
  229. WEAPON_MATERIA_SLOTS[30] = [1 , 2]
  230. WEAPON_MATERIA_SLOTS[31] = [2 , 2]
  231. WEAPON_MATERIA_SLOTS[32] = [4 , 0]
  232. WEAPON_MATERIA_SLOTS[33] = [0 , 2]
  233. WEAPON_MATERIA_SLOTS[34] = [1 , 1]
  234. WEAPON_MATERIA_SLOTS[35] = [2 , 0]
  235. WEAPON_MATERIA_SLOTS[36] = [3 , 1]
  236. WEAPON_MATERIA_SLOTS[37] = [1 , 2]
  237. WEAPON_MATERIA_SLOTS[38] = [2 , 2]
  238. WEAPON_MATERIA_SLOTS[39] = [4 , 0]
  239. WEAPON_MATERIA_SLOTS[40] = [1 , 1]
  240. WEAPON_MATERIA_SLOTS[41] = [1 , 2]
  241. WEAPON_MATERIA_SLOTS[42] = [2 , 2]
  242. WEAPON_MATERIA_SLOTS[43] = [4 , 0]
  243. WEAPON_MATERIA_SLOTS[44] = [1 , 1]
  244. WEAPON_MATERIA_SLOTS[45] = [0 , 2]
  245. WEAPON_MATERIA_SLOTS[46] = [2 , 2]
  246. WEAPON_MATERIA_SLOTS[47] = [4 , 0]
  247. WEAPON_MATERIA_SLOTS[48] = [4 , 0]
  248. WEAPON_MATERIA_SLOTS[49] = [0 , 1]
  249. WEAPON_MATERIA_SLOTS[50] = [0 , 4]
  250. WEAPON_MATERIA_SLOTS[51] = [2 , 1]
  251. WEAPON_MATERIA_SLOTS[52] = [4 , 0]
  252. WEAPON_MATERIA_SLOTS[53] = [0 , 1]
  253. WEAPON_MATERIA_SLOTS[54] = [0 , 1]
  254. WEAPON_MATERIA_SLOTS[55] = [1 , 0]
  255. WEAPON_MATERIA_SLOTS[56] = [0 , 2]
  256. WEAPON_MATERIA_SLOTS[57] = [1 , 1]
  257. WEAPON_MATERIA_SLOTS[58] = [1 , 1]
  258. WEAPON_MATERIA_SLOTS[59] = [0 , 6]
  259. WEAPON_MATERIA_SLOTS[60] = [0 , 3]
  260. WEAPON_MATERIA_SLOTS[61] = [2 , 0]
  261. WEAPON_MATERIA_SLOTS[62] = [0 , 2]
  262. WEAPON_MATERIA_SLOTS[63] = [0 , 6]
  263. WEAPON_MATERIA_SLOTS[64] = [1 , 2]
  264. WEAPON_MATERIA_SLOTS[65] = [2 , 1]
  265. WEAPON_MATERIA_SLOTS[66] = [0 , 3]
  266. WEAPON_MATERIA_SLOTS[67] = [2 , 2]
  267. WEAPON_MATERIA_SLOTS[68] = [1 , 1]
  268. WEAPON_MATERIA_SLOTS[69] = [3, 0]
  269. WEAPON_MATERIA_SLOTS[70] = [0 , 0]
  270. WEAPON_MATERIA_SLOTS[71] = [0 , 0]
  271. WEAPON_MATERIA_SLOTS[72] = [0 , 0]
  272. WEAPON_MATERIA_SLOTS[73] = [0 , 0]
  273. WEAPON_MATERIA_SLOTS[74] = [0 , 0]
  274. WEAPON_MATERIA_SLOTS[75] = [0 , 0]
  275. WEAPON_MATERIA_SLOTS[76] = [0 , 0]
  276. WEAPON_MATERIA_SLOTS[77] = [0 , 0]
  277.  
  278.  
  279. # Armor Slots
  280. ARMORS_MATERIA_SLOTS[1] = [1 , 0]
  281. ARMORS_MATERIA_SLOTS[2] = [2 , 0]
  282. ARMORS_MATERIA_SLOTS[3] = [2 , 0]
  283. ARMORS_MATERIA_SLOTS[4] = [2 , 0]
  284. ARMORS_MATERIA_SLOTS[5] = [0 , 0]
  285. ARMORS_MATERIA_SLOTS[6] = [1 , 1]
  286. ARMORS_MATERIA_SLOTS[7] = [0 , 4]
  287. ARMORS_MATERIA_SLOTS[8] = [3 , 0]
  288. ARMORS_MATERIA_SLOTS[9] = [2 , 1]
  289. ARMORS_MATERIA_SLOTS[10] = [3 , 0]
  290. ARMORS_MATERIA_SLOTS[11] = [0 , 7]
  291. ARMORS_MATERIA_SLOTS[12] = [3 , 0]
  292. ARMORS_MATERIA_SLOTS[13] = [2 , 0]
  293. ARMORS_MATERIA_SLOTS[14] = [0 , 4]
  294. ARMORS_MATERIA_SLOTS[15] = [2 , 1]
  295. ARMORS_MATERIA_SLOTS[16] = [2 , 1]
  296. ARMORS_MATERIA_SLOTS[17] = [2 , 0]
  297. ARMORS_MATERIA_SLOTS[18] = [3 , 0]
  298. ARMORS_MATERIA_SLOTS[19] = [0 , 1]
  299. ARMORS_MATERIA_SLOTS[20] = [3 , 0]
  300. ARMORS_MATERIA_SLOTS[21] = [3 , 0]
  301. ARMORS_MATERIA_SLOTS[22] = [1 , 0]
  302. ARMORS_MATERIA_SLOTS[23] = [0 , 2]
  303. ARMORS_MATERIA_SLOTS[24] = [0 , 8]
  304. ARMORS_MATERIA_SLOTS[25] = [0 , 4]
  305. ARMORS_MATERIA_SLOTS[26] = [3 , 0]
  306. ARMORS_MATERIA_SLOTS[27] = [1 , 2]
  307. ARMORS_MATERIA_SLOTS[28] = [1 , 2]
  308. ARMORS_MATERIA_SLOTS[29] = [0 , 2]
  309. ARMORS_MATERIA_SLOTS[30] = [2 , 0]
  310. ARMORS_MATERIA_SLOTS[31] = [4 , 0]
  311. ARMORS_MATERIA_SLOTS[32] = [0 , 0]
  312.  
  313.  
  314. #=#================================================================#=#
  315. #=# Enemy APs #=#
  316. #=#================================================================#=#
  317. #=# ENEMY_AP[ID] = x #=#
  318. #=# where ID = Enemy ID in the database #=#
  319. #=# and #=#
  320. #=# X is the AP that you will get from them. #=#
  321. #=# ex: ENEMY_AP[1] = 2 #=#
  322. #=# You will get 2 AP from a slime[ID:001] in the database #=#
  323. #=#================================================================#=#
  324. ENEMY_AP[1] = 2
  325. ENEMY_AP[2] = 3
  326. ENEMY_AP[3] = 24
  327. ENEMY_AP[4] = 14
  328. ENEMY_AP[5] = 16
  329. ENEMY_AP[6] = 2
  330. ENEMY_AP[7] = 3
  331. ENEMY_AP[8] = 7
  332. ENEMY_AP[9] = 2
  333. ENEMY_AP[10] = 2
  334. ENEMY_AP[11] = 3
  335. ENEMY_AP[12] = 5
  336. ENEMY_AP[13] = 15
  337. ENEMY_AP[14] = 26
  338. ENEMY_AP[15] = 64
  339. ENEMY_AP[16] = 72
  340. ENEMY_AP[17] = 80
  341. ENEMY_AP[18] = 9
  342. ENEMY_AP[19] = 8
  343. ENEMY_AP[20] = 7
  344. ENEMY_AP[21] = 11
  345. ENEMY_AP[22] = 9
  346. ENEMY_AP[23] = 9
  347. ENEMY_AP[24] = 89
  348. ENEMY_AP[25] = 7
  349. ENEMY_AP[26] = 8
  350. ENEMY_AP[27] = 10
  351. ENEMY_AP[28] = 8
  352. ENEMY_AP[29] = 9
  353. ENEMY_AP[30] = 7
  354. ENEMY_AP[31] = 8
  355. ENEMY_AP[32] = 8
  356. ENEMY_AP[33] = 0
  357. ENEMY_AP[34] = 0
  358. ENEMY_AP[35] = 0
  359. ENEMY_AP[36] = 0
  360. ENEMY_AP[37] = 11
  361. ENEMY_AP[38] = 9
  362. ENEMY_AP[39] = 8
  363. ENEMY_AP[40] = 11
  364. ENEMY_AP[41] = 9
  365. ENEMY_AP[42] = 8
  366. ENEMY_AP[43] = 28
  367. ENEMY_AP[44] = 11
  368. ENEMY_AP[45] = 11
  369. ENEMY_AP[46] = 9
  370. ENEMY_AP[47] = 8
  371. ENEMY_AP[48] = 7
  372. ENEMY_AP[49] = 7
  373. ENEMY_AP[59] = 2
  374. ENEMY_AP[74] = 5
  375. ENEMY_AP[76] = 8
  376. ENEMY_AP[78] = 12
  377. ENEMY_AP[61] = 4
  378. ENEMY_AP[62] = 6
  379. ENEMY_AP[73] = 22
  380. ENEMY_AP[104] = 20000
  381.  
  382.  
  383. # List of Materias
  384. #[id, name, type, attribute = [], elements = [], effects = [],
  385. # AP needed = min.500, Mastered AP Needed = min.1000,
  386. # skills = [], exp = [], special = nil]
  387.  
  388. # Magic Materias
  389. #ID Name Type HP MP STR VIT AGI INT element Effect AP MasterAP EXP SKILLS
  390. MATERIA_LIST << [0, 'Cure', 'Magic', [ -5, 5, -3, 0, 0, 3 ], [], [], 500, 7000, [500, 2000, 4000, 7000], [1, 2, 3, 6]]
  391. MATERIA_LIST << [1, 'Remedy', 'Magic', [ -4, 4, -3, 0, 0, 3 ], [], [], 750, 3250, [750, 3250], [4, 5]]
  392. MATERIA_LIST << [2, 'Fire', 'Magic', [ -3, 3, -1, 0, 0, 1 ], [1], [], 500, 4500, [500, 2000, 4500], [7, 8, 9]]
  393. MATERIA_LIST << [3, 'Ice', 'Magic', [ -3, 3, -1, 0, 0, 1 ], [2], [], 500, 7500, [500, 2000, 4500], [10, 11, 12]]
  394. MATERIA_LIST << [4, 'Thunder', 'Magic', [ -3, 3, -1, 0, 0, 1 ], [3], [], 500, 7500, [500, 2000, 4500], [13, 14, 15]]
  395. MATERIA_LIST << [5, 'Water', 'Magic', [ -3, 3, -1, 0, 0, 1 ], [4], [], 500, 7500, [500, 2000, 4500], [16, 17, 18]]
  396. MATERIA_LIST << [6, 'Earth', 'Magic', [ -3, 3, -1, 0, 0, 1 ], [5], [], 500, 7500, [500, 2000, 4500], [19, 20, 21]]
  397. MATERIA_LIST << [7, 'Wind', 'Magic', [ -3, 3, -1, 0, 0, 1 ], [6], [], 500, 7500, [500, 2000, 4500], [22, 23, 24]]
  398. MATERIA_LIST << [8, 'Light', 'Magic', [ -4, 4, -2, 0, 0, 2 ], [7], [], 500, 7500, [500, 2000, 4500], [25, 26, 27]]
  399. MATERIA_LIST << [9, 'Darkness', 'Magic', [ -4, 4, -2, 0, 0, 2 ], [8], [], 500, 7500, [500, 2000, 4500], [28, 29, 30]]
  400. MATERIA_LIST << [10, 'Ultima', 'Magic', [ -5, 5, -3, 0, 0, 3 ], [], [], 10000, 50000, [10000, 50000], [nil, 31, 32]]
  401. MATERIA_LIST << [11, 'Poison', 'Magic', [ -2, 2, 0, 0, 0, 0 ], [], [3], 750, 4500, [750, 4500], [33, 34]]
  402. MATERIA_LIST << [12, 'Blind', 'Magic', [ -2, 2, 0, 0, 0, 0 ], [], [4], 750, 4500, [750, 4500], [35, 36]]
  403. MATERIA_LIST << [13, 'Silence', 'Magic', [ -2, 2, 0, 0, 0, 0 ], [], [5], 750, 4500, [750, 4500], [37, 38]]
  404. MATERIA_LIST << [14, 'Confusion', 'Magic', [ -2, 2, 0, 0, 0, 0 ], [], [6], 750, 4500, [750, 4500], [39, 40]]
  405. MATERIA_LIST << [15, 'Sleep', 'Magic', [ -2, 2, 0, 0, 0, 0 ], [], [7], 750, 4500, [750, 4500], [41, 42]]
  406. MATERIA_LIST << [16, 'Time', 'Magic', [ -2, 2, 0, 0, 0, 0 ], [], [8], 750, 4500, [750, 4500], [43, 44, 86]]
  407. MATERIA_LIST << [17, 'Weakness', 'Magic', [ -2, 2, 0, 0, 0, 0 ], [], [9], 750, 4500, [750, 4500], [45, 46]]
  408. MATERIA_LIST << [18, 'Tiredness', 'Magic', [ -2, 2, 0, 0, 0, 0 ], [], [10], 750, 4500, [750, 4500], [47, 48]]
  409. MATERIA_LIST << [19, 'Slow', 'Magic', [ -2, 2, 0, 0, 0, 0 ], [], [11], 750, 4500, [750, 4500], [49, 50]]
  410. MATERIA_LIST << [20, 'Fever', 'Magic', [ -2, 2, 0, 0, 0, 0 ], [], [12], 750, 4500, [750, 4500], [51, 52]]
  411. MATERIA_LIST << [21, 'Strength', 'Magic', [ -2, 2, 0, 0, 0, 0 ], [], [13], 750, 4500, [3000], [nil, 53]]
  412. MATERIA_LIST << [22, 'Protect', 'Magic', [ -2, 2, 0, 0, 0, 0 ], [], [14], 750, 4500, [3000], [nil, 54]]
  413. MATERIA_LIST << [23, 'Barrier', 'Magic', [ -2, 2, 0, 0, 0, 0 ], [], [15], 750, 4500, [3000], [nil, 55]]
  414. MATERIA_LIST << [24, 'Speed', 'Magic', [ -2, 2, 0, 0, 0, 0 ], [], [16], 750, 4500, [3000], [nil, 56]]
  415. # Command Materias
  416. MATERIA_LIST << [25, 'Commando', 'Command', [0, 0, 5, 3, - 3, - 5], [], [], 1250, 9500, [1250, 2750, 4500, 7000], [57, 58, 59, 60]]
  417. MATERIA_LIST << [26, 'Dancer', 'Command', [2, -2, 4, 4, -2, -6], [], [], 1250, 9500, [1250, 2750, 4500, 7000], [61, 62, 63, 64]]
  418. MATERIA_LIST << [27, 'Saboteur', 'Command', [4, -2, 6, 4, -4, -8], [], [], 1250, 9500, [1250, 2750, 4500, 7000], [65, 66, 67, 68]]
  419. MATERIA_LIST << [28, 'Thief', 'Command', [0, -2, 2, -2, 8, -2], [], [], 1250, 9500, [1250, 2750, 4500, 7000], [69, 70, 71, 72]]
  420. MATERIA_LIST << [29, 'Hunter', 'Command', [-3, 2, -3, -2, 4, 4], [], [], 3000, 20000, [2500, 2750, 4500, 7000], [73, 74, 75, 76]]
  421. #Hunter is obsolete, disregard and do not use in the game.
  422. MATERIA_LIST << [30, 'Gunslinger', 'Command', [-2, 0, 3, -4, 5, 2], [], [], 1250, 9500, [1250, 5000, 4500, 7000], [77, 78, 79, 80]]
  423. # Summon Materias
  424. MATERIA_LIST << [31, 'Ifrit', 'Summon', [-10, 10, -5, -5, 0, 10], [1], [], 5000, 25000, [6500, 15000, 25000, 50000], [139]]
  425. MATERIA_LIST << [32, 'Shiva', 'Summon', [-10, 10, -5, -5, 0, 10], [2], [], 5000, 25000, [6500, 15000, 25000, 50000], [140]]
  426. MATERIA_LIST << [33, 'Ramuh', 'Summon', [-10, 10, -5, -5, 0, 10], [3], [], 5000, 25000, [6500, 15000, 25000, 50000], [141]]
  427. # Support Materia
  428. MATERIA_LIST << [34, 'All', 'Support', [0, 0, 0, 0, 0, 0], [], [], 2000, 10000, [2000, 4000, 7000, 11000], [], 'All']
  429. MATERIA_LIST << [35, 'Elemental', 'Support', [0, 0, 0, 0, 0, 0], [], [], 2000, 10000, [2000, 4000, 7000, 11000], [], 'Elemental']
  430. MATERIA_LIST << [36, 'Added Effect', 'Support', [0, 0, 0, 0, 0, 0], [], [], 2000, 10000, [2000, 4000, 7000, 11000], [], 'Added Effect']
  431. MATERIA_LIST << [37, 'Absorb HP', 'Support', [0, 0, 0, 0, 0, 0], [], [], 2000, 10000, [2000, 4000, 7000, 11000], [], 'Absorb HP']
  432. MATERIA_LIST << [38, 'Absorb MP', 'Support', [0, 0, 0, 0, 0, 0], [], [], 2000, 10000, [2000, 4000, 7000, 11000], [], 'Absorb MP']
  433. MATERIA_LIST << [39, 'MP Turbo', 'Support', [0, 0, 0, 0, 0, 0], [], [], 2000, 10000, [2000, 4000, 7000, 11000], [], 'MP Turbo']
  434. MATERIA_LIST << [40, 'Reduce Cost', 'Support', [0, 0, 0, 0, 0, 0], [], [], 2000, 10000, [2000, 4000, 7000, 11000], [], 'Reduce Cost']
  435. # Independent Materia
  436. MATERIA_LIST << [41, 'Exp Plus', 'Independent', [0, 0, 0, 0, 0, 0], [], [], 2000, 10000, [30000], [], 'Exp Plus']
  437. MATERIA_LIST << [42, '$ Plus', 'Independent', [0, 0, 0, 0, 0, 0], [], [], 2000, 10000, [2000, 4000, 7000, 11000], [], 'Gil Plus']
  438. MATERIA_LIST << [43, 'Luck Plus', 'Independent', [0, 0, 0, 0, 0, 0], [], [], 2000, 10000, [2000, 4000, 7000, 11000], [], 'Luck Plus']
  439. MATERIA_LIST << [44, 'HP Plus', 'Independent', [0, 0, 0, 0, 0, 0], [], [], 2000, 10000, [2000, 4000, 7000, 11000], [], 'HP Plus']
  440. MATERIA_LIST << [45, 'MP Plus', 'Independent', [0, 0, 0, 0, 0, 0], [], [], 2000, 10000, [2000, 4000, 7000, 11000], [], 'MP Plus']
  441. MATERIA_LIST << [46, 'Strength Plus', 'Independent', [0, 0, 0, 0, 0, 0], [], [], 2000, 10000, [2000, 4000, 7000, 11000], [], 'Strength Plus']
  442. MATERIA_LIST << [47, 'Defense Plus', 'Independent', [0, 0, 0, 0, 0, 0], [], [], 2000, 10000, [2000, 4000, 7000, 11000], [], 'Defense Plus']
  443. MATERIA_LIST << [48, 'Agility Plus', 'Independent', [0, 0, 0, 0, 0, 0], [], [], 2000, 10000, [2000, 4000, 7000, 11000], [], 'Agility Plus']
  444. MATERIA_LIST << [49, 'Magic Plus', 'Independent', [0, 0, 0, 0, 0, 0], [], [], 2000, 10000, [2000, 4000, 7000, 11000], [], 'Magic Plus']
  445. MATERIA_LIST << [50, 'Evasion Plus', 'Independent', [0, 0, 0, 0, 0, 0], [], [], 2000, 10000, [2000, 4000, 7000, 11000], [], 'Evasion Plus']
  446. MATERIA_LIST << [51, 'Critical Chance Plus', 'Independent', [0, 0, 0, 0, 0, 0], [], [], 2000, 10000, [2000, 4000, 7000, 11000], [], 'Critical Chance Plus']
  447. MATERIA_LIST << [52, 'Critical Damage Plus', 'Independent', [0, 0, 0, 0, 0, 0], [], [], 2000, 10000, [2000, 4000, 7000, 11000], [], 'Critical Damage Plus']
  448. MATERIA_LIST << [53, 'Escape Plus', 'Independent', [0, 0, 0, 0, 0, 0], [], [], 2000, 10000, [2000, 4000, 7000, 11000], [], 'Escape Plus']
  449. MATERIA_LIST << [54, 'Unnarmed Attack', 'Independent', [0, 0, 0, 0, 0, 0], [], [], 2000, 10000, [2000, 4000, 7000, 11000], [], 'Unnarmed Attack']
  450. MATERIA_LIST << [55, 'HP <> MP', 'Independent', [0, 0, 0, 0, 0, 0], [], [], 2000, 10000, [2000, 4000, 7000, 11000], [], 'HP <> MP']
  451. # Additional Materia
  452. MATERIA_LIST << [56, 'Dispel', 'Magic', [ -4, 4, -3, 0, 0, 3 ], [], [], 750, 5000, [750, 5000], [87, 88]]
  453. MATERIA_LIST << [57, 'Leviathan', 'Summon', [-10, 10, -5, -5, 0, 10], [4], [], 5000, 25000, [6500, 15000, 25000, 50000], [142]]
  454. MATERIA_LIST << [58, 'Bahamut', 'Summon', [-10, 10, -5, -5, 0, 10], [], [], 5000, 25000, [6500, 15000, 25000, 50000], [143]]
  455. end
  456.  
  457.  
  458. #==============================================================================
  459. # ** RPG
  460. #==============================================================================
  461. module RPG
  462. #============================================================================
  463. # ** Weapon
  464. #============================================================================
  465. class Weapon
  466. #--------------------------------------------------------------------------
  467. attr_accessor :paired_materia
  468. attr_accessor :single_materia
  469. #--------------------------------------------------------------------------
  470. def set_materia_slots(slots)
  471. @paired_materia, @single_materia = slots[0], slots[1]
  472. end
  473. end
  474. #============================================================================
  475. # ** Armor
  476. #============================================================================
  477. class Armor
  478. #--------------------------------------------------------------------------
  479. attr_accessor :paired_materia
  480. attr_accessor :single_materia
  481. #--------------------------------------------------------------------------
  482. def set_materia_slots(slots)
  483. @paired_materia, @single_materia = slots[0], slots[1]
  484. end
  485. end
  486. end
  487.  
  488. #==============================================================================
  489. # ** Materia
  490. #==============================================================================
  491. class Materia
  492. #--------------------------------------------------------------------------
  493. attr_reader :id
  494. attr_accessor :name
  495. attr_accessor :type
  496. attr_accessor :stat_effects
  497. attr_accessor :elements
  498. attr_accessor :states
  499. attr_accessor :new_value
  500. attr_accessor :master_value
  501. attr_accessor :skills
  502. attr_accessor :exp_levels
  503. attr_accessor :special_effect
  504. #--------------------------------------------------------------------------
  505. def initialize(id, name, type, stat_effects = [], elements = [], states = [],
  506. n_value = 500, m_value = 1000, skills = [], exp_levels = [], s_effect = nil)
  507. @id, @name, @type, @stat_effects, @elements, @states,
  508. @new_value, @master_value, @exp_levels, @skills, @special_effect =
  509. id, name, type, stat_effects, elements, states,
  510. n_value, m_value, skills, exp_levels, s_effect
  511. @experience = 0
  512. end
  513. #--------------------------------------------------------------------------
  514. def experience
  515. return @experience
  516. end
  517. #--------------------------------------------------------------------------
  518. def experience=(num)
  519. @experience = [num, @exp_levels[@exp_levels.size - 1]].min
  520. end
  521. #--------------------------------------------------------------------------
  522. def level
  523. for i in 0...@exp_levels.size
  524. if @experience >= @exp_levels[@exp_levels.size - (1 + i)]
  525. return @exp_levels.size - i + 1
  526. end
  527. end
  528. return 1
  529. end
  530. #--------------------------------------------------------------------------
  531. def buy_value
  532. return @new_value
  533. end
  534. #--------------------------------------------------------------------------
  535. def base_sell_value
  536. return @new_value / 2
  537. end
  538. #--------------------------------------------------------------------------
  539. def sell_value
  540. variation = @master_value - (@new_value / 2)
  541. price_rate = [@experience * 100 / @exp_levels[@exp_levels.size - 1], 100].min
  542. return [((variation * price_rate) / 100) + (@new_value / 2) ,0].max
  543. end
  544. #--------------------------------------------------------------------------
  545. def get_hue
  546. case @type
  547. when 'Magic'
  548. hue = 130
  549. when 'Command'
  550. hue = 60
  551. when 'Summon'
  552. hue = 10
  553. when 'Support'
  554. hue = 180
  555. when 'Independent'
  556. hue = 300
  557. end
  558. return hue
  559. end
  560. end
  561.  
  562. #==============================================================================
  563. # ** Materia_System
  564. #==============================================================================
  565. class Materia_System
  566. #--------------------------------------------------------------------------
  567. include Materia_Config
  568. #--------------------------------------------------------------------------
  569. attr_accessor :set_up_materias
  570. #--------------------------------------------------------------------------
  571. def set_up_materias
  572. materias = []
  573. for m in MATERIA_LIST
  574. materias[m[0]] = Materia.new(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10]) if m != nil
  575. end
  576. materias.sort! {|a, b| a.id <=> b.id}
  577. materias = materias.compact
  578. return materias
  579. end
  580. end
  581.  
  582. #==============================================================================
  583. # ** Game_Battler
  584. #==============================================================================
  585. class Game_Battler
  586. #--------------------------------------------------------------------------
  587. def skill_effect(user, skill)
  588. self.critical = false
  589. if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or
  590. ((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)
  591. return false
  592. end
  593. effective = false
  594. effective |= skill.common_event_id > 0
  595. hit = skill.hit
  596. if skill.atk_f > 0
  597. hit *= user.hit / 100
  598. end
  599. hit_result = (rand(100) < hit)
  600. effective |= hit < 100
  601. if hit_result == true
  602. power = skill.power + ((user.atk + 20) * skill.atk_f / 100)
  603. if power > 0
  604. power -= self.pdef * skill.pdef_f / 200
  605. power -= self.mdef * skill.mdef_f / 200
  606. power = [power, 0].max
  607. end
  608. rate = 50
  609. rate -= (self.dex / 2 * skill.pdef_f / 200)
  610. rate -= ((self.dex + self.int)/ 4 * skill.mdef_f / 200)
  611. rate += (user.str * skill.str_f / 100)
  612. rate += (user.dex * skill.dex_f / 100)
  613. rate += (user.agi * skill.agi_f / 100)
  614. rate += (user.int * skill.int_f / 100)
  615. self.damage = power * rate / 20
  616. self.damage *= elements_correct(skill.element_set)
  617. self.damage /= 100
  618. if self.damage > 0
  619. if self.guarding?
  620. self.damage /= 2
  621. end
  622. end
  623. if self.damage == 0
  624. dmg1 = (rand(100) < 40)
  625. self.damage = 1 if dmg1
  626. end
  627. if skill.variance > 0 and self.damage.abs > 0
  628. amp = [self.damage.abs * skill.variance / 100, 1].max
  629. self.damage += rand(amp+1) + rand(amp+1) - amp
  630. end
  631. eva = 8 * self.agi / user.agi + self.eva
  632. hit = self.damage < 0 ? 100 : 100 - eva * skill.eva_f / 100
  633. hit = self.cant_evade? ? 100 : hit
  634. hit_result = (rand(100) < hit)
  635. effective |= hit < 100
  636. end
  637. if hit_result == true
  638. if user.is_a?(Game_Actor)
  639. for materia in user.weapon_materia + user.armor1_materia + user.armor2_materia + user.armor3_materia + user.armor4_materia
  640. unless materia.nil?
  641. self.damage += (self.damage * materia.level * 0.2).to_i if self.damage != 0 and materia.type == 'Summon'
  642. end
  643. end
  644. materia_set = user.return_paired_materia
  645. for paired_set in materia_set
  646. materia = paired_set[2]
  647. other_materia = paired_set[3]
  648. if materia.special_effect == 'MP Turbo'
  649. for skill_id in other_materia.skills
  650. unless skill_id == 0
  651. m_skill = $data_skills[skill_id]
  652. if skill == m_skill
  653. unless skill.element_set.include?(Materia_Config::Negate_Turbo_ID)
  654. self.damage += (self.damage * materia.level * 0.2).to_i if self.damage != 0
  655. end
  656. end
  657. end
  658. end
  659. end
  660. if materia.special_effect =='Absorb HP'
  661. for skill_id in other_materia.skills
  662. unless skill_id == 0
  663. m_skill = $data_skills[skill_id]
  664. if skill == m_skill and $game_temp.in_battle
  665. unless skill.element_set.include?(Materia_Config::Negate_Absorb_ID)
  666. if self.damage > 0
  667. dreno = materia.level * 2
  668. hp = (self.damage * dreno / 100).to_i
  669. user.hp += [hp, user.maxhp - hp].min
  670. end
  671. end
  672. end
  673. end
  674. end
  675. end
  676. if materia.special_effect =='Absorb MP'
  677. for skill_id in other_materia.skills
  678. unless skill_id == 0
  679. m_skill = $data_skills[skill_id]
  680. if skill == m_skill and $game_temp.in_battle
  681. unless skill.element_set.include?(Materia_Config::Negate_Absorb_ID)
  682. if self.damage > 0
  683. dreno = materia.level
  684. sp = (self.damage * dreno / 100).to_i
  685. user.sp += [sp, user.maxsp - sp].min
  686. end
  687. end
  688. end
  689. end
  690. end
  691. end
  692. end
  693. end
  694. if skill.power != 0 and skill.atk_f > 0
  695. remove_states_shock
  696. effective = true
  697. end
  698. last_hp = self.hp
  699. self.hp -= self.damage
  700. effective |= self.hp != last_hp
  701. @state_changed = false
  702. effective |= states_plus(skill.plus_state_set)
  703. effective |= states_minus(skill.minus_state_set)
  704. if skill.power == 0
  705. self.damage = ""
  706. unless @state_changed
  707. self.damage = "Miss"
  708. end
  709. end
  710. else
  711. self.damage = "Miss"
  712. end
  713. unless $game_temp.in_battle
  714. self.damage = nil
  715. end
  716. return effective
  717. end
  718. #--------------------------------------------------------------------------
  719. def attack_effect(attacker)
  720. self.critical = false
  721. hit_result = (rand(100) < attacker.hit)
  722. if hit_result == true
  723. atk = [20 + attacker.atk - self.pdef / 2, 1].max
  724. str = [40 + attacker.str - self.dex / 2, 1].max
  725. self.damage = atk * str / 20
  726. self.damage *= elements_correct(attacker.element_set)
  727. self.damage /= 100
  728. if self.damage == 0
  729. dmg1 = (rand(100) < 40)
  730. self.damage = 1 if dmg1
  731. end
  732. if self.damage > 0
  733. if rand(100) < ((4 * attacker.agi / self.agi) + attacker.critrateplus)
  734. self.damage += ((self.damage * (100 + attacker.critdmgplus)) / 100)
  735. self.critical = true
  736. end
  737. if self.guarding?
  738. self.damage /= 2
  739. end
  740. end
  741. if self.damage.abs > 0
  742. amp = [self.damage.abs * 15 / 100, 1].max
  743. self.damage += rand(amp+1) + rand(amp+1) - amp
  744. end
  745. eva = 8 * self.agi / attacker.agi + self.eva
  746. hit = self.damage < 0 ? 100 : 100 - eva
  747. hit = self.cant_evade? ? 100 : hit
  748. hit_result = (rand(100) < hit)
  749. end
  750. if hit_result == true
  751. remove_states_shock
  752. self.hp -= self.damage
  753. @state_changed = false
  754. states_plus(attacker.plus_state_set)
  755. states_minus(attacker.minus_state_set)
  756. else
  757. self.damage = "Miss"
  758. self.critical = false
  759. end
  760. return true
  761. end
  762. #--------------------------------------------------------------------------
  763. def skill_can_use?(skill_id)
  764. skill = $data_skills[skill_id]
  765. return false if calc_sp_cost(self, skill) > self.sp
  766. return false if dead?
  767. return false if skill.atk_f == 0 and self.restriction == 1
  768. occasion = skill.occasion
  769. return (occasion == 0 or occasion == 1) if $game_temp.in_battle
  770. return (occasion == 0 or occasion == 2)
  771. end
  772. #--------------------------------------------------------------------------
  773. def calc_sp_cost(user, skill)
  774. cost = skill.sp_cost
  775. if user.is_a?(Game_Actor)
  776. materia_set = user.return_paired_materia
  777. for paired_set in materia_set
  778. materia = paired_set[2]
  779. other_materia = paired_set[3]
  780. if materia.special_effect == 'MP Turbo'
  781. for skill_id in other_materia.skills
  782. unless skill_id == 0
  783. m_skill = $data_skills[skill_id]
  784. if skill == m_skill and !skill.element_set.include?(Materia_Config::Negate_Turbo_ID)
  785. cost = (cost + (cost * materia.level * 0.2)).to_i
  786. end
  787. end
  788. end
  789. end
  790. if materia.special_effect == 'Reduce Cost'
  791. for skill_id in other_materia.skills
  792. unless skill_id == 0
  793. m_skill = $data_skills[skill_id]
  794. if skill == m_skill
  795. cost = (cost - (cost * materia.level * 0.1)).to_i
  796. end
  797. end
  798. end
  799. end
  800. end
  801. end
  802. return cost
  803. end
  804. #--------------------------------------------------------------------------
  805. def consum_skill_cost(skill)
  806. return false unless skill_can_use?(skill.id)
  807. cost = calc_sp_cost(self, skill)
  808. return self.sp -= cost
  809. end
  810. end
  811.  
  812. #==============================================================================
  813. # ** Game_Actor
  814. #==============================================================================
  815. class Game_Actor
  816. #--------------------------------------------------------------------------
  817. attr_accessor :weapon_materia
  818. attr_accessor :armor1_materia
  819. attr_accessor :armor2_materia
  820. attr_accessor :armor3_materia
  821. attr_accessor :armor4_materia
  822. attr_reader :ap
  823. #--------------------------------------------------------------------------
  824. alias seph_materiasystem_gameactor_init initialize
  825. alias seph_materiasystem_gameactor_setup setup
  826. alias seph_materiasystem_gameactor_skills skills
  827. alias seph_materiasystem_gameactor_equip equip
  828. alias seph_materiasystem_gameactor_exp exp
  829. alias seph_materiasystem_gameactor_elementrate element_rate
  830. alias seph_materiasystem_gameactor_stateguard? state_guard?
  831. alias seph_materiasystem_gameactor_elementset element_set
  832. alias seph_materiasystem_gameactor_plusstateset plus_state_set
  833. #--------------------------------------------------------------------------
  834. def initialize(actor_id)
  835. @weapon_materia = Array.new
  836. @armor1_materia = Array.new
  837. @armor2_materia = Array.new
  838. @armor3_materia = Array.new
  839. @armor4_materia = Array.new
  840. seph_materiasystem_gameactor_init(actor_id)
  841. end
  842. #--------------------------------------------------------------------------
  843. def setup(actor_id)
  844. seph_materiasystem_gameactor_setup(actor_id)
  845. @materia_skills = []
  846. sn = [$data_weapons[@weapon_id].paired_materia * 2 + $data_weapons[@weapon_id].single_materia, 8].min unless @weapon_id == 0
  847. @weapon_materia = @weapon_id == 0 ? [] : Array.new(sn, nil)
  848. sn = [$data_armors[@armor1_id].paired_materia * 2 + $data_armors[@armor1_id].single_materia, 8].min unless @armor1_id == 0
  849. @armor1_materia = @armor1_id == 0 ? [] : Array.new(sn, nil)
  850. sn = [$data_armors[@armor2_id].paired_materia * 2 + $data_armors[@armor2_id].single_materia, 8].min unless @armor2_id == 0
  851. @armor2_materia = @armor2_id == 0 ? [] : Array.new(sn, nil)
  852. sn = [$data_armors[@armor3_id].paired_materia * 2 + $data_armors[@armor3_id].single_materia, 8].min unless @armor3_id == 0
  853. @armor3_materia = @armor3_id == 0 ? [] : Array.new(sn, nil)
  854. sn = [$data_armors[@armor4_id].paired_materia * 2 + $data_armors[@armor4_id].single_materia, 8].min unless @armor4_id == 0
  855. @armor4_materia = @armor4_id == 0 ? [] : Array.new(sn, nil)
  856. end
  857. #--------------------------------------------------------------------------
  858. def weapons
  859. result = []
  860. result.push($data_weapons[@weapon_id])
  861. return result
  862. end
  863. #--------------------------------------------------------------------------
  864. def armors
  865. result = []
  866. result.push($data_armors[@armor1_id])
  867. result.push($data_armors[@armor2_id])
  868. result.push($data_armors[@armor3_id])
  869. result.push($data_armors[@armor4_id])
  870. return result
  871. end
  872. #--------------------------------------------------------------------------
  873. def equips
  874. return weapons + armors
  875. end
  876. #--------------------------------------------------------------------------
  877. def skills
  878. for skill_id in @materia_skills
  879. self.forget_skill(skill_id)
  880. end
  881. @skills = seph_materiasystem_gameactor_skills
  882. for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia
  883. self.learn_materia_skill(materia) unless materia.nil?
  884. end
  885. return @skills
  886. end
  887. #--------------------------------------------------------------------------
  888. def learn_materia_skill(materia)
  889. materia_level = materia.level == materia.exp_levels.size + 1 ? materia.level - 1 : materia.level
  890. for i in 0...materia_level
  891. if materia.skills[i] != nil and !skill_learn?(materia.skills[i])
  892. skill_id = materia.skills[i]
  893. self.learn_skill(skill_id)
  894. @materia_skills << skill_id
  895. end
  896. end
  897. end
  898. #--------------------------------------------------------------------------
  899. def base_maxhp
  900. n = $data_actors[@actor_id].parameters[0, @level]
  901. variance = 0
  902. for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia
  903. unless materia.nil?
  904. variance += materia.stat_effects[0]
  905. variance += (materia.level * 10) if materia.special_effect == 'HP Plus'
  906. n = $data_actors[@actor_id].parameters[1, @level] if materia.special_effect == 'HP <> MP'
  907. end
  908. end
  909. n *= ((100 + variance) / 100.0)
  910. return [[n, 1].max, 9999].min
  911. end
  912. #--------------------------------------------------------------------------
  913. def hp
  914. @hp = [@hp, maxhp].min
  915. return @hp
  916. end
  917. #--------------------------------------------------------------------------
  918. def base_maxsp
  919. n = $data_actors[@actor_id].parameters[1, @level]
  920. variance = 0
  921. for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia
  922. unless materia.nil?
  923. variance += materia.stat_effects[1]
  924. variance += (materia.level * 10) if materia.special_effect == 'MP Plus'
  925. n = $data_actors[@actor_id].parameters[0, @level] if materia.special_effect == 'HP <> MP'
  926. end
  927. end
  928. n *= ((100 + variance) / 100.0)
  929. return [[n, 1].max, 9999].min
  930. end
  931. #--------------------------------------------------------------------------
  932. def sp
  933. @sp = [@sp, maxsp].min
  934. return @sp
  935. end
  936. #--------------------------------------------------------------------------
  937. def base_str
  938. n = $data_actors[@actor_id].parameters[2, @level]
  939. for item in equips.compact do n += item.str_plus end
  940. variance = 0
  941. for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia
  942. unless materia.nil?
  943. variance += materia.stat_effects[2]
  944. variance += (materia.level * 5) if materia.special_effect == 'Strength Plus'
  945. end
  946. end
  947. n *= ((100 + variance) / 100.0)
  948. return [[n, 1].max, 999].min
  949. end
  950. #--------------------------------------------------------------------------
  951. def base_dex
  952. n = $data_actors[@actor_id].parameters[3, @level]
  953. for item in equips.compact do n += item.dex_plus end
  954. variance = 0
  955. for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia
  956. unless materia.nil?
  957. variance += materia.stat_effects[3]
  958. variance += (materia.level * 5) if materia.special_effect == 'Defense Plus'
  959. end
  960. end
  961. n *= ((100 + variance) / 100.0)
  962. return [[n, 1].max, 999].min
  963. end
  964. #--------------------------------------------------------------------------
  965. def base_agi
  966. n = $data_actors[@actor_id].parameters[4, @level]
  967. for item in equips.compact do n += item.agi_plus end
  968. variance = 0
  969. for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia
  970. unless materia.nil?
  971. variance += materia.stat_effects[4]
  972. variance += (materia.level * 5) if materia.special_effect == 'Agility Plus'
  973. end
  974. end
  975. n *= ((100 + variance) / 100.0)
  976. return [[n, 1].max, 999].min
  977. end
  978. #--------------------------------------------------------------------------
  979. def base_int
  980. n = $data_actors[@actor_id].parameters[5, @level]
  981. for item in equips.compact do n += item.int_plus end
  982. variance = 0
  983. for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia
  984. unless materia.nil?
  985. variance += materia.stat_effects[5]
  986. variance += (materia.level * 5) if materia.special_effect == 'Magic Plus'
  987. end
  988. end
  989. n *= ((100 + variance) / 100.0)
  990. return [[n, 1].max, 999].min
  991. end
  992. #--------------------------------------------------------------------------
  993. def base_eva
  994. n = 0
  995. for item in armors.compact do n += item.eva end
  996. for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia
  997. unless materia.nil?
  998. n += (materia.level * 2) if materia.special_effect == 'Evasion Plus'
  999. end
  1000. end
  1001. return n = [[Integer(n), 0].max, 100].min
  1002. end
  1003. #--------------------------------------------------------------------------
  1004. def critrateplus
  1005. variance = 0
  1006. for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia
  1007. unless materia.nil?
  1008. variance += (materia.level * 5) if materia.special_effect == 'Critical Chance Plus'
  1009. end
  1010. end
  1011. return variance
  1012. end
  1013. #--------------------------------------------------------------------------
  1014. def critdmgplus
  1015. variance = 0
  1016. for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia
  1017. unless materia.nil?
  1018. variance += (materia.level * 20) if materia.special_effect == 'Critical Damage Plus'
  1019. end
  1020. end
  1021. return variance
  1022. end
  1023. #--------------------------------------------------------------------------
  1024. def escapeplus
  1025. variance = 0
  1026. for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia
  1027. unless materia.nil?
  1028. variance += (materia.level * 2) if materia.special_effect == 'Escape Plus'
  1029. end
  1030. end
  1031. return variance
  1032. end
  1033. #--------------------------------------------------------------------------
  1034. def itemdropup
  1035. variance = 0
  1036. for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia
  1037. unless materia.nil?
  1038. variance += (materia.level * 2) if materia.special_effect == 'Luck Plus'
  1039. end
  1040. end
  1041. return variance
  1042. end
  1043. #--------------------------------------------------------------------------
  1044. def base_atk
  1045. n = 0
  1046. variance = 0
  1047. for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia
  1048. unless materia.nil?
  1049. variance += (materia.level * 20) if materia.special_effect == 'Unnarmed Attack'
  1050. end
  1051. end
  1052. for item in weapons.compact do n += item.atk end
  1053. weapon = $data_weapons[@weapon_id]
  1054. n = 20 + ((20 * variance) /100) if weapons[0] == nil
  1055. return n
  1056. end
  1057. #--------------------------------------------------------------------------
  1058. def animation2_id
  1059. weapon = $data_weapons[@weapon_id]
  1060. return weapon != nil ? weapon.animation2_id : 4
  1061. end
  1062. #--------------------------------------------------------------------------
  1063. def exp=(exp)
  1064. for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia
  1065. self.forget_skill(materia.id) unless materia.nil?
  1066. end
  1067. @materia_skills = []
  1068. if exp > @exp
  1069. new_exp = exp - @exp
  1070. exp_plus = 0
  1071. for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia
  1072. unless materia.nil?
  1073. if materia.special_effect == 'Exp Plus'
  1074. exp_plus += (materia.level * 10)
  1075. end
  1076. end
  1077. end
  1078. new_exp *= ((100 + exp_plus) / 100.0)
  1079. exp = new_exp.to_i + @exp
  1080. end
  1081. @exp = [[exp, 999999999999999].min, 0].max
  1082. while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
  1083. @level += 1
  1084. for j in $data_classes[@class_id].learnings
  1085. if j.level == @level
  1086. learn_skill(j.skill_id)
  1087. end
  1088. end
  1089. end
  1090. while @exp < @exp_list[@level]
  1091. @level -= 1
  1092. end
  1093. for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia
  1094. self.learn_materia_skill(materia) unless materia.nil?
  1095. end
  1096. @hp = [@hp, self.maxhp].min
  1097. @sp = [@sp, self.maxsp].min
  1098. end
  1099. #--------------------------------------------------------------------------
  1100. def ap
  1101. return @ap == nil ? 0 : @ap
  1102. end
  1103. #--------------------------------------------------------------------------
  1104. def ap=(ap)
  1105. @ap = ap
  1106. for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia
  1107. unless materia.nil?
  1108. initial_level = materia.level
  1109. materia.experience += @ap
  1110. final_level = materia.level
  1111. if initial_level < (materia.exp_levels.size + 1) and final_level == (materia.exp_levels.size + 1)
  1112. $game_party.gain_materia(materia.id)
  1113. end
  1114. end
  1115. end
  1116. @ap = 0
  1117. end
  1118. #--------------------------------------------------------------------------
  1119. def element_rate(element_id)
  1120. result = seph_materiasystem_gameactor_elementrate(element_id)
  1121. paired = return_paired_materia
  1122. for set in paired
  1123. if set[0] > 0
  1124. materia = set[2]
  1125. if materia.special_effect == 'Elemental'
  1126. other_materia = set[3]
  1127. if other_materia.elements.include?(element_id)
  1128. result /= 2
  1129. end
  1130. end
  1131. end
  1132. end
  1133. return result
  1134. end
  1135. #--------------------------------------------------------------------------
  1136. def state_guard?(state_id)
  1137. result = seph_materiasystem_gameactor_stateguard?(state_id)
  1138. unless result
  1139. paired = return_paired_materia
  1140. for set in paired
  1141. if set[0] > 0
  1142. materia = set[2]
  1143. if materia.special_effect == 'Added Effect'
  1144. other_materia = set[3]
  1145. if other_materia.states.include?(state_id)
  1146. result = true
  1147. end
  1148. end
  1149. end
  1150. end
  1151. end
  1152. return result
  1153. end
  1154. #--------------------------------------------------------------------------
  1155. def element_set
  1156. result = seph_materiasystem_gameactor_elementset
  1157. paired = return_paired_materia
  1158. for set in paired
  1159. if set[0] == 0
  1160. materia = set[2]
  1161. if materia.special_effect == 'Elemental'
  1162. other_materia = set[3]
  1163. for elem_id in other_materia.elements
  1164. result << elem_id unless set.include?(elem_id)
  1165. end
  1166. end
  1167. end
  1168. end
  1169. return result
  1170. end
  1171. #--------------------------------------------------------------------------
  1172. def plus_state_set
  1173. result = seph_materiasystem_gameactor_plusstateset
  1174. paired = return_paired_materia
  1175. for set in paired
  1176. if set[0] == 0
  1177. materia = set[2]
  1178. if materia.special_effect == 'Added Effect'
  1179. other_materia = set[3]
  1180. for state_id in other_materia.states
  1181. result << state_id unless set.include?(state_id)
  1182. end
  1183. end
  1184. end
  1185. end
  1186. return result
  1187. end
  1188. #------------------------------------------------------------------------------
  1189. def check_old_equip
  1190. @old_weapon_id = @weapon_id
  1191. @old_armor1_id = @armor1_id
  1192. @old_armor2_id = @armor2_id
  1193. @old_armor3_id = @armor3_id
  1194. @old_armor4_id = @armor4_id
  1195. end
  1196. #------------------------------------------------------------------------------
  1197. def check_equip_change
  1198. if @old_weapon_id != @weapon_id
  1199. for materia in @weapon_materia
  1200. $game_party.materia << materia unless materia.nil?
  1201. end
  1202. sn = [$data_weapons[@weapon_id].paired_materia * 2 + $data_weapons[@weapon_id].single_materia, 8].min unless @weapon_id == 0
  1203. @weapon_materia = @weapon_id == 0 ? [] : Array.new(sn, nil)
  1204. end
  1205. if @old_armor1_id != @armor1_id
  1206. for materia in @armor1_materia
  1207. $game_party.materia << materia unless materia.nil?
  1208. end
  1209. sn = [$data_armors[@armor1_id].paired_materia * 2 + $data_armors[@armor1_id].single_materia, 8].min unless @armor1_id == 0
  1210. @armor1_materia = @armor1_id == 0 ? [] : Array.new(sn, nil)
  1211. end
  1212. if @old_armor2_id != @armor2_id
  1213. for materia in @armor2_materia
  1214. $game_party.materia << materia unless materia.nil?
  1215. end
  1216. sn = [$data_armors[@armor2_id].paired_materia * 2 + $data_armors[@armor2_id].single_materia, 8].min unless @armor2_id == 0
  1217. @armor2_materia = @armor2_id == 0 ? [] : Array.new(sn, nil)
  1218. end
  1219. if @old_armor3_id != @armor3_id
  1220. for materia in @armor3_materia
  1221. $game_party.materia << materia unless materia.nil?
  1222. end
  1223. sn = [$data_armors[@armor3_id].paired_materia * 2 + $data_armors[@armor3_id].single_materia, 8].min unless @armor3_id == 0
  1224. @armor3_materia = @armor3_id == 0 ? [] : Array.new(sn, nil)
  1225. end
  1226. if @old_armor4_id != @armor4_id
  1227. for materia in @armor4_materia
  1228. $game_party.materia << materia unless materia.nil?
  1229. end
  1230. sn = [$data_armors[@armor4_id].paired_materia * 2 + $data_armors[@armor4_id].single_materia, 8].min unless @armor4_id == 0
  1231. @armor4_materia = @armor4_id == 0 ? [] : Array.new(sn, nil)
  1232. end
  1233. end
  1234. #--------------------------------------------------------------------------
  1235. def equip_materia(equip_type, slot_index, index)
  1236. new_materia = $game_party.materia[index]
  1237. materia = equip_type == 0 ? @weapon_materia[slot_index] : (eval "@armor#{equip_type}_materia")[slot_index]
  1238. $game_party.materia << materia unless materia.nil?
  1239. case equip_type
  1240. when 0
  1241. return if @weapon_materia.size == 0
  1242. @weapon_materia[slot_index] = new_materia
  1243. when 1
  1244. return if @armor1_materia.size == 0
  1245. @armor1_materia[slot_index] = new_materia
  1246. when 2
  1247. return if @armor2_materia.size == 0
  1248. @armor2_materia[slot_index] = new_materia
  1249. when 3
  1250. return if @armor3_materia.size == 0
  1251. @armor3_materia[slot_index] = new_materia
  1252. when 4
  1253. return if @armor4_materia.size == 0
  1254. @armor4_materia[slot_index] = new_materia
  1255. end
  1256. $game_party.materia.delete_at(index)
  1257. end
  1258. #--------------------------------------------------------------------------
  1259. def unequip_materia(equip_type, slot_index)
  1260. materia = equip_type == 0 ? @weapon_materia[slot_index] : (eval "@armor#{equip_type}_materia")[slot_index]
  1261. $game_party.materia << materia unless materia.nil?
  1262. equip_type == 0 ? @weapon_materia[slot_index] = nil : (eval "@armor#{equip_type}_materia")[slot_index] = nil
  1263. end
  1264. #--------------------------------------------------------------------------
  1265. def return_paired_materia
  1266. paired = []
  1267. unless @weapon_id == 0
  1268. if $data_weapons[@weapon_id].paired_materia > 0
  1269. for i in 0...($data_weapons[@weapon_id].paired_materia * 2)
  1270. materia = @weapon_materia[i]
  1271. if materia.type == 'Support'
  1272. o_i = i + ([0, 2, 4, 6].include?(i) ? 1 : - 1)
  1273. other_materia = @weapon_materia[o_i]
  1274. paired << [0, [i, o_i].min, materia, other_materia] unless other_materia.nil?
  1275. end
  1276. end
  1277. end
  1278. end
  1279. for a in 1..4
  1280. unless (eval "@armor#{a}_id") == 0
  1281. if (eval "$data_armors[@armor#{a}_id].paired_materia") > 0
  1282. for i in 0...((eval "$data_armors[@armor#{a}_id].paired_materia") * 2)
  1283. materia = (eval "@armor#{a}_materia")[i]
  1284. if materia.type == 'Support'
  1285. o_i = i + ([0, 2, 4, 6].include?(i) ? 1 : - 1)
  1286. other_materia = (eval "@armor#{a}_materia")[o_i]
  1287. paired << [a, [i, o_i].min, materia, other_materia] unless other_materia.nil?
  1288. end
  1289. end
  1290. end
  1291. end
  1292. end
  1293. return paired
  1294. end
  1295. #--------------------------------------------------------------------------
  1296. def return_paired_materia_type
  1297. unless @weapon_id == 0
  1298. if $data_weapons[@weapon_id].paired_materia > 0
  1299. for i in 0...($data_weapons[@weapon_id].paired_materia)
  1300. materia = @weapon_materia[i]
  1301. end
  1302. end
  1303. if $data_weapons[@weapon_id].single_materia > 0
  1304. for i in 0...($data_weapons[@weapon_id].single_materia)
  1305. materia = @weapon_materia[i]
  1306. end
  1307. end
  1308. end
  1309. for a in 1..4
  1310. unless (eval "@armor#{a}_id") == 0
  1311. if (eval "$data_armors[@armor#{a}_id].paired_materia") > 0
  1312. for i in 0...((eval "$data_armors[@armor#{a}_id].paired_materia"))
  1313. materia = (eval "@armor#{a}_materia")[i]
  1314. end
  1315. end
  1316. if (eval "$data_armors[@armor#{a}_id].single_materia") > 0
  1317. for i in 0...((eval "$data_armors[@armor#{a}_id].single_materia"))
  1318. materia = (eval "@armor#{a}_materia")[i]
  1319. end
  1320. end
  1321. end
  1322. end
  1323. return
  1324. end
  1325. end
  1326.  
  1327. #==============================================================================
  1328. # ** Game_Enemy
  1329. #==============================================================================
  1330. class Game_Enemy < Game_Battler
  1331. #------------------------------------------------------------------------------
  1332. attr_accessor :ap
  1333. #------------------------------------------------------------------------------
  1334. alias old_initialize initialize
  1335. def initialize(troop_id, member_index)
  1336. old_initialize(troop_id, member_index)
  1337. @enemy = $data_enemies[@enemy_id]
  1338. @ap = get_ap
  1339. end
  1340. #------------------------------------------------------------------------------
  1341. def get_ap
  1342. for i in 0...Materia_Config::ENEMY_AP.size
  1343. ap = Materia_Config::ENEMY_AP[i] if @enemy_id == i
  1344. end
  1345. return ap == nil ? (@enemy.exp / 10).to_i : ap
  1346. end
  1347. #------------------------------------------------------------------------------
  1348. def ap
  1349. return @ap == nil ? (@enemy.exp / 10).to_i : @ap
  1350. end
  1351. #------------------------------------------------------------------------------
  1352. def critrateplus
  1353. return 0
  1354. end
  1355. #--------------------------------------------------------------------------
  1356. def critdmgplus
  1357. return 0
  1358. end
  1359. end
  1360.  
  1361. #==============================================================================
  1362. # ** Game_Party
  1363. #==============================================================================
  1364. class Game_Party
  1365. #--------------------------------------------------------------------------
  1366. attr_accessor :materia
  1367. #--------------------------------------------------------------------------
  1368. alias seph_materiasystem_gameparty_init initialize
  1369. alias seph_materiasystem_gameparty_gaingold gain_gold
  1370. #--------------------------------------------------------------------------
  1371. def initialize
  1372. seph_materiasystem_gameparty_init
  1373. @materia = []
  1374. end
  1375. #--------------------------------------------------------------------------
  1376. def gain_materia(materia_index)
  1377. @materia << $data_materia[materia_index].dup
  1378. end
  1379. #--------------------------------------------------------------------------
  1380. def gain_gold(n)
  1381. gil_plus = 0
  1382. for actor in @actors
  1383. for materia in actor.weapon_materia + actor.armor1_materia +
  1384. actor.armor2_materia + actor.armor3_materia + actor.armor4_materia
  1385. unless materia.nil?
  1386. if materia.special_effect == 'Gil Plus'
  1387. gil_plus += (materia.level * 5)
  1388. end
  1389. end
  1390. end
  1391. end
  1392. n *= (100 + gil_plus) / 100.0
  1393. seph_materiasystem_gameparty_gaingold(n.to_i)
  1394. end
  1395. end
  1396.  
  1397. #==============================================================================
  1398. # Window Horizontal Command
  1399. #==============================================================================
  1400. class Window_HorizCommand < Window_Selectable
  1401. #--------------------------------------------------------------------------
  1402. def initialize(commands, width = 640, height = 64)
  1403. super(0, 0, width, height)
  1404. self.contents = Bitmap.new(width - 32, height - 32)
  1405. @commands = commands
  1406. @item_max = @commands.size
  1407. @column_max = @commands.size
  1408. refresh
  1409. self.index = 0
  1410. end
  1411. #--------------------------------------------------------------------------
  1412. def refresh
  1413. self.contents.clear
  1414. for i in 0...@item_max
  1415. draw_item(i, normal_color)
  1416. end
  1417. end
  1418. #--------------------------------------------------------------------------
  1419. def draw_item(index, color)
  1420. self.contents.font.color = color
  1421. x = width / @item_max * index
  1422. off = width / @item_max - 32
  1423. self.contents.draw_text(x, 0, off, 32, @commands[index], 1)
  1424. end
  1425. #--------------------------------------------------------------------------
  1426. def disable_item(index)
  1427. draw_item(index, disabled_color)
  1428. end
  1429. end
  1430.  
  1431. #==============================================================================
  1432. # ** Window_MateriaBio
  1433. #==============================================================================
  1434. class Window_MateriaBio < Window_Base
  1435. #--------------------------------------------------------------------------
  1436. def initialize
  1437. super(240, 128, 400, 352)
  1438. self.contents = Bitmap.new(width - 32, height - 32)
  1439. self.visible = false
  1440. end
  1441. #--------------------------------------------------------------------------
  1442. def refresh(materia)
  1443. self.contents.clear
  1444. return if materia.nil?
  1445. hue = materia.get_hue
  1446. begin
  1447. bitmap = RPG::Cache.icon(materia.name + "_m").dup
  1448. rescue
  1449. bitmap = RPG::Cache.icon(Materia_Config::Default_Icon).dup
  1450. bitmap.hue_change(hue)
  1451. end
  1452. self.contents.blt(4, 0, bitmap, Rect.new(0, 0, 24, 24))
  1453. self.contents.font.size = 22
  1454. self.contents.font.color = normal_color
  1455. self.contents.font.bold = false
  1456. self.contents.draw_text(32, 0, contents.width, 24, materia.name)
  1457. bitmap = RPG::Cache.icon(Materia_Config::Materia_Level).dup
  1458. bitmap.hue_change(hue)
  1459. start_x = contents.width / 2 - 20
  1460. materia.level.times do
  1461. self.contents.blt(start_x += 24, 0, bitmap, Rect.new(0, 0, 24, 24))
  1462. end
  1463. (materia.exp_levels.size + 1 - materia.level).times do
  1464. self.contents.blt(start_x += 24, 0, bitmap, Rect.new(0, 0, 24, 24), 100)
  1465. end
  1466. self.contents.font.size = 16
  1467. self.contents.font.bold = true
  1468. self.contents.draw_text(172, 44, 172, 16, 'Level:')
  1469. lev = materia.level == materia.exp_levels.size + 1 ? Materia_Config::Master_Text : materia.level.to_s
  1470. self.contents.draw_text(172, 44, 172, 16, lev, 2)
  1471. self.contents.draw_text(172, 60, 172, 16, Materia_Config::AP_Total)
  1472. self.contents.draw_text(172, 60, 172, 16, materia.experience.to_s, 2)
  1473. self.contents.draw_text(172, 76, 172, 16, 'Next Level:')
  1474. nxt = lev == Materia_Config::Master_Text ? '----------' : materia.exp_levels[materia.level - 1] - materia.experience
  1475. self.contents.draw_text(172, 76, 172, 16, nxt.to_s, 2)
  1476. self.contents.draw_text(4, 28, contents.width, 24, 'Skills:')
  1477. materia_y = 0
  1478. for i in 0...(materia.level)
  1479. self.contents.font.color = normal_color
  1480. unless materia.skills[i].nil?
  1481. self.contents.draw_text(16, 44 + materia_y, contents.width / 2 - 8, 16, $data_skills[materia.skills[i]].name)
  1482. materia_y += 16
  1483. end
  1484. end
  1485. for i in (materia.level)...materia.skills.size
  1486. self.contents.font.color = disabled_color
  1487. unless materia.skills[i].nil?
  1488. self.contents.draw_text(16, 44 + materia_y, contents.width / 2 - 8, 16, $data_skills[materia.skills[i]].name)
  1489. materia_y += 16
  1490. end
  1491. end
  1492. if materia.skills.size == 0
  1493. self.contents.draw_text(8, 52, contents.width / 2 - 8, 24, '')
  1494. end
  1495. self.contents.font.color = normal_color
  1496. se = materia.special_effect.nil? ? '----------' : materia.special_effect
  1497. self.contents.draw_text(8, 172, contents.width, 24, "Special Effect: #{se}")
  1498. self.contents.font.size = 16
  1499. self.contents.font.bold = true
  1500. self.contents.draw_text(8, 200, 160, 16, "Buy: #{materia.new_value}")
  1501. self.contents.draw_text(132, 200, 160, 16, "Sell: #{materia.base_sell_value}")
  1502. self.contents.draw_text(236, 200, 160, 16, Materia_Config::Master_Text + ": #{materia.master_value}")
  1503. self.contents.font.size = 14
  1504. self.contents.draw_text(8, 222, contents.width / 2, 14, 'Status:')
  1505. stat_names = [Materia_Config::Hp_Text, Materia_Config::Sp_Text, Materia_Config::Str_Text,Materia_Config::Vit_Text, Materia_Config::Agi_Text, Materia_Config::Int_Text]
  1506. for i in 0...materia.stat_effects.size
  1507. self.contents.draw_text(8, 222 + (i + 1) * 14, contents.width / 2, 14, stat_names[i])
  1508. self.contents.draw_text(- 8, 222 + (i + 1) * 14, contents.width / 2, 14, "#{materia.stat_effects[i]} %", 2)
  1509. end
  1510. self.contents.font.size = 14
  1511. x, y = contents.width / 2 + 4, 222
  1512. self.contents.draw_text(x, y, contents.width / 2, 14, 'Elements/Effects:')
  1513. if materia.elements.size + materia.states.size == 0
  1514. self.contents.draw_text(x + 4, y + 14, contents.width / 2, 14, '')
  1515. else
  1516. total = 1
  1517. for i in 0...materia.elements.size
  1518. total += 1
  1519. ox = 4 + total % 2 * (contents.width / 4)
  1520. oy = total / 2 * 14
  1521. self.contents.draw_text(x + ox, y + oy, contents.width / 2, 14, $data_system.elements[materia.elements[i]])
  1522. end
  1523. for i in 0...materia.states.size
  1524. total += 1
  1525. ox = 4 + total % 2 * (contents.width / 4)
  1526. oy = total / 2 * 14
  1527. self.contents.draw_text(x + ox, y + oy, contents.width / 2, 14, $data_states[materia.states[i]].name)
  1528. end
  1529. end
  1530. end
  1531. end
  1532.  
  1533. #==============================================================================
  1534. # ** Window_MateriaList
  1535. #==============================================================================
  1536. class Window_MateriaList < Window_Selectable
  1537. #--------------------------------------------------------------------------
  1538. def initialize(buying, materia_list = nil, show_cost = true)
  1539. super(0, 128, 240, 352)
  1540. self.visible = self.active = false
  1541. if buying
  1542. @materia = []
  1543. for index in materia_list
  1544. for materia in $data_materia
  1545. @materia << materia if index == materia.id
  1546. end
  1547. end
  1548. else
  1549. @materia = $game_party.materia.sort! {|a, b| a.id <=> b.id}
  1550. end
  1551. @buying, @show_cost = buying, show_cost
  1552. refresh
  1553. self.index = 0
  1554. end
  1555. #--------------------------------------------------------------------------
  1556. def materia
  1557. return @materia[self.index]
  1558. end
  1559. #--------------------------------------------------------------------------
  1560. def refresh
  1561. if self.contents != nil
  1562. self.contents.dispose
  1563. self.contents = nil
  1564. end
  1565. @materia.sort! {|a, b| a.id <=> b.id}
  1566. @item_max = @materia.size
  1567. if @item_max > 0
  1568. self.contents = Bitmap.new(width - 32, row_max * 32)
  1569. for i in 0...@item_max
  1570. draw_item(i)
  1571. end
  1572. end
  1573. end
  1574. #--------------------------------------------------------------------------
  1575. def draw_item(index)
  1576. if @buying
  1577. self.contents.font.color = materia.buy_value > $game_party.gold ? disabled_color : normal_color
  1578. end
  1579. materia = @materia[index]
  1580. hue = materia.get_hue
  1581. self.contents.fill_rect(Rect.new(0, index * 32, contents.width, 32), Color.new(0, 0, 0, 0))
  1582. begin
  1583. bitmap = RPG::Cache.icon(materia.name + "_m").dup
  1584. rescue
  1585. bitmap = RPG::Cache.icon(Materia_Config::Default_Icon).dup
  1586. bitmap.hue_change(hue)
  1587. end
  1588. self.contents.blt(4, index * 32 + 4, bitmap, Rect.new(0, 0, 24, 24))
  1589. self.contents.draw_text(28, index * 32, 128, 32, materia.name)
  1590. if @show_cost
  1591. value = @buying ? materia.buy_value : materia.sell_value
  1592. self.contents.draw_text(132, index * 32, 72, 32, ":#{value}", 2)
  1593. end
  1594. end
  1595. end
  1596.  
  1597. #==============================================================================
  1598. # ** Window_MateriaStatus
  1599. #==============================================================================
  1600. class Window_MateriaStatus < Window_Base
  1601. #--------------------------------------------------------------------------
  1602. def initialize(actor)
  1603. super(0, 0, 640, 152)
  1604. self.contents = Bitmap.new(width - 32, height - 32)
  1605. @actor = actor
  1606. @frame = 0
  1607. refresh
  1608. end
  1609. #--------------------------------------------------------------------------
  1610. def refresh(actor = @actor)
  1611. self.contents.clear
  1612. draw_actor_face(actor, 4, 16) if Materia_Config::Show_Faces
  1613. draw_actor_graphic(actor, 40, 80)unless Materia_Config::Show_Faces
  1614. draw_actor_name(actor, 92, 0)
  1615. draw_actor_level(actor, 92, 24)
  1616. draw_actor_hp(actor, 92, 52)
  1617. draw_actor_sp(actor, 92, 80)
  1618. end
  1619. #--------------------------------------------------------------------------
  1620. def update
  1621. super
  1622. end
  1623. end
  1624.  
  1625. #==============================================================================
  1626. # ** Window_MateriaActor
  1627. #==============================================================================
  1628. class Window_MateriaActor < Window_Base
  1629. #--------------------------------------------------------------------------
  1630. def initialize(actor)
  1631. super(0, 0, 640, 152)
  1632. self.contents = Bitmap.new(width - 32, height - 32)
  1633. self.opacity = 0
  1634. @actor = actor
  1635. @frame = 0
  1636. refresh
  1637. end
  1638. #--------------------------------------------------------------------------
  1639. def refresh(actor = @actor)
  1640. self.contents.clear
  1641. draw_actor_equipment
  1642. draw_actor_materia
  1643. end
  1644. #--------------------------------------------------------------------------
  1645. def draw_actor_equipment
  1646. draw_equipment(240, 0, $data_weapons[@actor.weapon_id], 0)
  1647. draw_equipment(240, 24, $data_armors[@actor.armor1_id], 1)
  1648. draw_equipment(240, 48, $data_armors[@actor.armor2_id], 2)
  1649. draw_equipment(240, 72, $data_armors[@actor.armor3_id], 3)
  1650. draw_equipment(240, 96, $data_armors[@actor.armor4_id], 4)
  1651. end
  1652. #--------------------------------------------------------------------------
  1653. def draw_actor_materia
  1654. self.contents.fill_rect(416, 0, 192, 120, Color.new(0, 0, 0, 0))
  1655. for i in 0..4
  1656. self.contents.fill_rect(416, i * 24 + 2, 192, 22, Color.new(0, 0, 0, 50))
  1657. end
  1658. for i in 0..4
  1659. slots_x, y = 416 - 24, i * 24
  1660. if i == 0
  1661. if @actor.weapon_id == 0
  1662. p_times, s_times = 0, 0
  1663. else
  1664. p_times = $data_weapons[@actor.weapon_id].paired_materia
  1665. s_times = $data_weapons[@actor.weapon_id].single_materia
  1666. end
  1667. else
  1668. if (eval "@actor.armor#{i}_id") == 0
  1669. p_times, s_times = 0, 0
  1670. else
  1671. p_times = eval "$data_armors[@actor.armor#{i}_id].paired_materia"
  1672. s_times = eval "$data_armors[@actor.armor#{i}_id].single_materia"
  1673. end
  1674. end
  1675. p_times.times do
  1676. bitmap = RPG::Cache.icon(Materia_Config::Paired_Slot_Left)
  1677. self.contents.blt(slots_x += 24, y, bitmap, Rect.new(0, 0, 24, 24))
  1678. bitmap = RPG::Cache.icon(Materia_Config::Paired_Slot_Right)
  1679. self.contents.blt(slots_x += 24, y, bitmap, Rect.new(0, 0, 24, 24))
  1680. end
  1681. s_times.times do
  1682. bitmap = RPG::Cache.icon(Materia_Config::Single_Slot)
  1683. self.contents.blt(slots_x += 24, y, bitmap, Rect.new(0, 0, 24, 24))
  1684. end
  1685. end
  1686. for i in [email protected]_materia.size
  1687. materia = @actor.weapon_materia[i]
  1688. unless materia.nil?
  1689. hue = materia.get_hue
  1690. begin
  1691. bitmap = RPG::Cache.icon(materia.name + "_m").dup
  1692. rescue
  1693. bitmap = RPG::Cache.icon(Materia_Config::Default_Icon).dup
  1694. bitmap.hue_change(hue)
  1695. end
  1696. self.contents.blt(416 + i * 24, 0, bitmap, Rect.new(0, 0, 24, 24))
  1697. end
  1698. end
  1699. for h in 1..4
  1700. size = eval "@actor.armor#{h}_materia.size"
  1701. for i in 0...size
  1702. list = eval "@actor.armor#{h}_materia"
  1703. materia = list[i]
  1704. unless materia.nil?
  1705. hue = materia.get_hue
  1706. begin
  1707. bitmap = RPG::Cache.icon(materia.name + "_m").dup
  1708. rescue
  1709. bitmap = RPG::Cache.icon(Materia_Config::Default_Icon).dup
  1710. bitmap.hue_change(hue)
  1711. end
  1712. self.contents.blt(416 + i * 24, 24 * h, bitmap, Rect.new(0, 0, 24, 24))
  1713. end
  1714. end
  1715. end
  1716. end
  1717. #--------------------------------------------------------------------------
  1718. def update
  1719. super
  1720. end
  1721. #--------------------------------------------------------------------------
  1722. def draw_equipment(x, y, item, type)
  1723. if item.nil?
  1724. case type
  1725. when 0
  1726. bitmap = RPG::Cache.icon(Materia_Config::Empty_Weapon)
  1727. when 1
  1728. bitmap = RPG::Cache.icon(Materia_Config::Empty_Armor1)
  1729. when 2
  1730. bitmap = RPG::Cache.icon(Materia_Config::Empty_Armor2)
  1731. when 3
  1732. bitmap = RPG::Cache.icon(Materia_Config::Empty_Armor3)
  1733. when 4
  1734. bitmap = RPG::Cache.icon(Materia_Config::Empty_Armor4)
  1735. end
  1736. contents.font.color, text, opacity = disabled_color, Materia_Config::Empty_Message, disabled_color.alpha
  1737. else
  1738. bitmap = RPG::Cache.icon(item.icon_name)
  1739. contents.font.color, text, opacity = normal_color, item.name, 255
  1740. end
  1741. self.contents.blt(x, y, bitmap, Rect.new(0, 0, 24, 24), opacity)
  1742. self.contents.draw_text(x + 28, y, 148, 24, text, 1)
  1743. end
  1744. end
  1745.  
  1746. #==============================================================================
  1747. # ** Window_MateriaEquipBio
  1748. #==============================================================================
  1749. class Window_MateriaEquipBio < Window_Base
  1750. #--------------------------------------------------------------------------
  1751. def initialize
  1752. super(0, 152, 400, 328)
  1753. self.contents = Bitmap.new(width - 32, height - 32)
  1754. end
  1755. #--------------------------------------------------------------------------
  1756. def refresh(materia)
  1757. self.contents.clear
  1758. return if materia.nil?
  1759. hue = materia.get_hue
  1760. begin
  1761. bitmap = RPG::Cache.icon(materia.name + "_m").dup
  1762. rescue
  1763. bitmap = RPG::Cache.icon(Materia_Config::Default_Icon).dup
  1764. bitmap.hue_change(hue)
  1765. end
  1766. self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 24, 24))
  1767. self.contents.font.color = normal_color
  1768. self.contents.font.size = 22
  1769. self.contents.font.bold = false
  1770. self.contents.draw_text(32, 0, contents.width, 24, materia.name)
  1771. bitmap = RPG::Cache.icon(Materia_Config::Materia_Level).dup
  1772. bitmap.hue_change(hue)
  1773. start_x = contents.width / 2 - 20
  1774. materia.level.times do
  1775. self.contents.blt(start_x += 24, 0, bitmap, Rect.new(0, 0, 24, 24))
  1776. end
  1777. (materia.exp_levels.size + 1 - materia.level).times do
  1778. self.contents.blt(start_x += 24, 0, bitmap, Rect.new(0, 0, 24, 24), 100)
  1779. end
  1780. self.contents.font.size = 16
  1781. self.contents.font.bold = true
  1782. self.contents.draw_text(4, 28, contents.width, 16, 'Skills:')
  1783. materia_y = 0
  1784. for i in 0...(materia.level)
  1785. self.contents.font.color = normal_color
  1786. unless materia.skills[i].nil?
  1787. self.contents.draw_text(16, 44 + materia_y, contents.width / 2 - 8, 16, $data_skills[materia.skills[i]].name)
  1788. materia_y += 16
  1789. end
  1790. end
  1791. for i in (materia.level)...materia.skills.size
  1792. self.contents.font.color = disabled_color
  1793. unless materia.skills[i].nil?
  1794. self.contents.draw_text(16, 44 + materia_y, contents.width / 2 - 8, 16, $data_skills[materia.skills[i]].name)
  1795. materia_y += 16
  1796. end
  1797. end
  1798. self.contents.font.color = normal_color
  1799. self.contents.draw_text(172, 44, 172, 16, 'Level:')
  1800. lev = materia.level == materia.exp_levels.size + 1 ? Materia_Config::Master_Text : materia.level.to_s
  1801. self.contents.draw_text(172, 44, 172, 16, lev, 2)
  1802. self.contents.draw_text(172, 60, 172, 16, Materia_Config::AP_Total)
  1803. self.contents.draw_text(172, 60, 172, 16, materia.experience.to_s, 2)
  1804. self.contents.draw_text(172, 76, 172, 16, 'Next Level:')
  1805. nxt = lev == Materia_Config::Master_Text ? '----------' : materia.exp_levels[materia.level - 1] - materia.experience
  1806. self.contents.draw_text(172, 76, 172, 16, nxt.to_s, 2)
  1807. se = materia.special_effect.nil? ? '----------' : materia.special_effect
  1808. self.contents.draw_text(8, 164, contents.width, 16, "Special Effect: #{se}")
  1809. self.contents.draw_text(8, 188, contents.width / 2, 16, 'Status:')
  1810. stat_names = [Materia_Config::Hp_Text, Materia_Config::Sp_Text, Materia_Config::Str_Text,Materia_Config::Vit_Text, Materia_Config::Agi_Text, Materia_Config::Int_Text]
  1811. for i in 0...materia.stat_effects.size
  1812. self.contents.draw_text(8, 188 + (i + 1) * 14, contents.width / 2, 16, stat_names[i])
  1813. self.contents.draw_text(- 8, 188 + (i + 1) * 14, contents.width / 2, 16, "#{materia.stat_effects[i]} %", 2)
  1814. end
  1815. x, y = contents.width / 2 + 4, 188
  1816. self.contents.draw_text(x, y, contents.width / 2, 16, 'Elements/Effects')
  1817. if materia.elements.size + materia.states.size == 0
  1818. self.contents.draw_text(x + 4, y + 14, contents.width / 2, 16, '')
  1819. else
  1820. total = 1
  1821. for i in 0...materia.elements.size
  1822. total += 1
  1823. ox = 4 + total % 2 * (contents.width / 4)
  1824. oy = total / 2 * 16
  1825. self.contents.draw_text(x + ox, y + oy, contents.width / 2, 16, $data_system.elements[materia.elements[i]])
  1826. end
  1827. for i in 0...materia.states.size
  1828. total += 1
  1829. ox = 4 + total % 2 * (contents.width / 4)
  1830. oy = total / 2 * 16
  1831. self.contents.draw_text(x + ox, y + oy, contents.width / 2, 16, $data_states[materia.states[i]].name)
  1832. end
  1833. end
  1834. end
  1835. end
  1836.  
  1837. #==============================================================================
  1838. # ** Window_Base
  1839. #==============================================================================
  1840. class Window_Base < Window
  1841. #--------------------------------------------------------------------------
  1842. def draw_actor_face(actor, x, y)
  1843. face = RPG::Cache.character("Faces/" + actor.character_name, actor.character_hue)
  1844. fw = face.width
  1845. fh = face.height
  1846. src_rect = Rect.new(0, 0, fw, fh)
  1847. self.contents.blt(x - fw / 23, y - fh, face, src_rect)
  1848. end
  1849. #--------------------------------------------------------------------------
  1850. def draw_actor_parameter(actor, x, y, type)
  1851. case type
  1852. when 0
  1853. parameter_name = $data_system.words.atk
  1854. parameter_value = actor.atk
  1855. when 1
  1856. parameter_name = $data_system.words.pdef
  1857. parameter_value = actor.pdef
  1858. when 2
  1859. parameter_name = $data_system.words.mdef
  1860. parameter_value = actor.mdef
  1861. when 3
  1862. parameter_name = $data_system.words.str
  1863. parameter_value = actor.str
  1864. when 4
  1865. parameter_name = Materia_Config::Vit_Text
  1866. parameter_value = actor.dex
  1867. when 5
  1868. parameter_name = $data_system.words.agi
  1869. parameter_value = actor.agi
  1870. when 6
  1871. parameter_name = $data_system.words.int
  1872. parameter_value = actor.int
  1873. end
  1874. self.contents.font.color = system_color
  1875. self.contents.draw_text(x, y, 120, 32, parameter_name)
  1876. self.contents.font.color = normal_color
  1877. self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
  1878. end
  1879. end
  1880.  
  1881. #==============================================================================
  1882. # Window_Command
  1883. #==============================================================================
  1884. class Window_Command_Materia < Window_Selectable
  1885. #--------------------------------------------------------------------------
  1886. def initialize(width, commands)
  1887. super(0, 0, width, 224)
  1888. @item_max = commands.size
  1889. @commands = commands
  1890. self.contents = Bitmap.new(width - 32, @item_max * 32)
  1891. refresh
  1892. self.index = 0
  1893. end
  1894. #--------------------------------------------------------------------------
  1895. def refresh
  1896. self.contents.clear
  1897. for i in 0...@item_max
  1898. draw_item(i, normal_color)
  1899. end
  1900. end
  1901. #--------------------------------------------------------------------------
  1902. def draw_item(index, color)
  1903. self.contents.font.color = color
  1904. rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
  1905. self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  1906. self.contents.draw_text(rect, @commands[index])
  1907. end
  1908. #--------------------------------------------------------------------------
  1909. def disable_item(index)
  1910. draw_item(index, disabled_color)
  1911. end
  1912. end
  1913.  
  1914. #==============================================================================
  1915. # ** Window_Skill
  1916. #==============================================================================
  1917. class Window_Skill < Window_Selectable
  1918. #--------------------------------------------------------------------------
  1919. def draw_item(index)
  1920. skill = @data[index]
  1921. if @actor.skill_can_use?(skill.id)
  1922. self.contents.font.color = normal_color
  1923. else
  1924. self.contents.font.color = disabled_color
  1925. end
  1926. x = 4 + index % 2 * (288 + 32)
  1927. y = index / 2 * 32
  1928. rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  1929. self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  1930. bitmap = RPG::Cache.icon(skill.icon_name)
  1931. opacity = self.contents.font.color == normal_color ? 255 : 128
  1932. self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  1933. self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
  1934. cost = @actor.calc_sp_cost(@actor, skill)
  1935. self.contents.draw_text(x + 232, y, 48, 32, cost.to_s, 2)
  1936. end
  1937. end
  1938.  
  1939. #==============================================================================
  1940. # ** Window_BattleResult
  1941. #==============================================================================
  1942. class Window_BattleResult < Window_Base
  1943. #------------------------------------------------------------------------------
  1944. def initialize(exp, gold, treasures, ap=0)
  1945. @ap = ap
  1946. @exp = exp
  1947. @gold = gold
  1948. @treasures = treasures
  1949. super(140, 0, 360, @treasures.size * 32 + 64)
  1950. self.contents = Bitmap.new(width - 32, height - 32)
  1951. self.contents.font.name = $fontface
  1952. self.contents.font.size = $fontsize
  1953. self.y = 160 - height / 2
  1954. self.back_opacity = 160
  1955. self.visible = false
  1956. refresh
  1957. end
  1958. #------------------------------------------------------------------------------
  1959. def refresh
  1960. self.contents.clear
  1961. x = 4
  1962. self.contents.font.color = normal_color
  1963. cx = contents.text_size(@exp.to_s).width
  1964. self.contents.draw_text(x, 0, cx, 32, @exp.to_s)
  1965. x += cx + 4
  1966. self.contents.font.color = system_color
  1967. cx = contents.text_size("EXP").width
  1968. self.contents.draw_text(x, 0, 64, 32, "EXP")
  1969. x += cx + 16
  1970. self.contents.font.color = normal_color
  1971. cx = contents.text_size(@gold.to_s).width
  1972. self.contents.draw_text(x, 0, cx, 32, @gold.to_s)
  1973. x += cx + 4
  1974. self.contents.font.color = system_color
  1975. self.contents.draw_text(x, 0, 128, 32, $data_system.words.gold)
  1976. x += cx + 16
  1977. self.contents.font.color = normal_color
  1978. cx = contents.text_size(@ap.to_s).width
  1979. self.contents.draw_text(x, 0, cx, 32, @ap.to_s)
  1980. x += cx + 4
  1981. self.contents.font.color = system_color
  1982. cx = contents.text_size(Materia_Config::AP_Name).width
  1983. self.contents.draw_text(x, 0, 64, 32, Materia_Config::AP_Name)
  1984. y = 32
  1985. for item in @treasures
  1986. draw_item_name(item, 4, y)
  1987. y += 32
  1988. end
  1989. end
  1990. end
  1991.  
  1992. #==============================================================================
  1993. # ** Interpreter
  1994. #==============================================================================
  1995. class Interpreter
  1996. #------------------------------------------------------------------------------
  1997. def command_319
  1998. actor = $game_actors[@parameters[0]]
  1999. actor.check_old_equip
  2000. if actor != nil
  2001. actor.equip(@parameters[1], @parameters[2])
  2002. end
  2003. actor.check_equip_change
  2004. return true
  2005. end
  2006. end
  2007.  
  2008. #==============================================================================
  2009. # ** Scene_Title
  2010. #==============================================================================
  2011. class Scene_Title
  2012. #--------------------------------------------------------------------------
  2013. include Materia_Config
  2014. #--------------------------------------------------------------------------
  2015. alias seph_materiasystem_scenetitle_main main
  2016. alias seph_materiasystem_scenetitle_newgame command_new_game
  2017. alias seph_materiasystem_scenetitle_continue command_continue
  2018. #--------------------------------------------------------------------------
  2019. def main
  2020. seph_materiasystem_scenetitle_main
  2021. materias = Materia_System.new
  2022. $data_materia = materias.set_up_materias
  2023. end
  2024. #--------------------------------------------------------------------------
  2025. def command_new_game
  2026. materias = Materia_System.new
  2027. $data_materia = materias.set_up_materias
  2028. for i in 1...$data_weapons.size
  2029. if WEAPON_MATERIA_SLOTS[i] != nil
  2030. $data_weapons[i].set_materia_slots(WEAPON_MATERIA_SLOTS[i])
  2031. else
  2032. $data_weapons[i].set_materia_slots([0,0])
  2033. end
  2034. end
  2035. for i in 1...$data_armors.size
  2036. if ARMORS_MATERIA_SLOTS[i] != nil
  2037. $data_armors[i].set_materia_slots(ARMORS_MATERIA_SLOTS[i])
  2038. else
  2039. $data_armors[i].set_materia_slots([0,0])
  2040. end
  2041. end
  2042. seph_materiasystem_scenetitle_newgame
  2043. end
  2044. #--------------------------------------------------------------------------
  2045. def command_continue
  2046. materias = Materia_System.new
  2047. $data_materia = materias.set_up_materias
  2048. for i in 1...$data_weapons.size
  2049. if WEAPON_MATERIA_SLOTS[i] != nil
  2050. $data_weapons[i].set_materia_slots(WEAPON_MATERIA_SLOTS[i])
  2051. else
  2052. $data_weapons[i].set_materia_slots([0,0])
  2053. end
  2054. end
  2055. for i in 1...$data_armors.size
  2056. if ARMORS_MATERIA_SLOTS[i] != nil
  2057. $data_armors[i].set_materia_slots(ARMORS_MATERIA_SLOTS[i])
  2058. else
  2059. $data_armors[i].set_materia_slots([0,0])
  2060. end
  2061. end
  2062. seph_materiasystem_scenetitle_continue
  2063. end
  2064. end
  2065.  
  2066. #==============================================================================
  2067. # ** Scene_Equip
  2068. #==============================================================================
  2069. class Scene_Equip
  2070. #------------------------------------------------------------------------------
  2071. alias seph_materiasystem_sceneequip_main main
  2072. def main
  2073. @actor = $game_party.actors[@actor_index]
  2074. @actor.check_old_equip
  2075. seph_materiasystem_sceneequip_main
  2076. @actor.check_equip_change
  2077. end
  2078. end
  2079.  
  2080. #==============================================================================
  2081. # ** Scene_MateriaShop
  2082. #==============================================================================
  2083. class Scene_MateriaShop
  2084. #--------------------------------------------------------------------------
  2085. def initialize(materia_avialable = [])
  2086. @materia_avialable = materia_avialable
  2087. end
  2088. #--------------------------------------------------------------------------
  2089. def main
  2090. @help_window = Window_Help.new
  2091. @help_window.set_text(Materia_Config::Shop_Message)
  2092. @shop_options_window = Window_HorizCommand.new(
  2093. [Materia_Config::Buy_Command, Materia_Config::Sell_Command, 'Sair'], 480)
  2094. @shop_options_window.y = 64
  2095. @gold_window = Window_Gold.new
  2096. @gold_window.x, @gold_window.y = 480, 64
  2097. @dummy_window = Window_Base.new(0, 128, 640, 352)
  2098. @buy_items = Window_MateriaList.new(true, @materia_avialable)
  2099. @sell_items = Window_MateriaList.new(false)
  2100. @materia_bio = Window_MateriaBio.new
  2101. @objects = [@help_window, @shop_options_window, @gold_window, @buy_items,
  2102. @sell_items, @dummy_window, @materia_bio]
  2103. Graphics.transition
  2104. while $scene == self
  2105. Graphics.update
  2106. Input.update
  2107. @objects.each {|x| x.update}
  2108. update
  2109. end
  2110. Graphics.freeze
  2111. @objects.each {|x| x.dispose}
  2112. end
  2113. #--------------------------------------------------------------------------
  2114. def update
  2115. if @shop_options_window.active
  2116. update_shop_commands
  2117. elsif @buy_items.active
  2118. update_buy_materia
  2119. elsif @sell_items.active
  2120. update_sell_materia
  2121. end
  2122. end
  2123. #--------------------------------------------------------------------------
  2124. def update_shop_commands
  2125. @help_window.set_text(Materia_Config::Shop_Message)
  2126. if Input.trigger?(Input::B)
  2127. $game_system.se_play($data_system.cancel_se)
  2128. $scene = Scene_Map.new
  2129. end
  2130. if Input.trigger?(Input::C)
  2131. $game_system.se_play($data_system.decision_se)
  2132. case @shop_options_window.index
  2133. when 0
  2134. @shop_options_window.active = false
  2135. @materia_bio.visible = true
  2136. @materia_bio.refresh(@buy_items.materia)
  2137. @buy_items.visible = @buy_items.active = true
  2138. when 1
  2139. @shop_options_window.active = false
  2140. @materia_bio.visible = true
  2141. @materia_bio.refresh(@sell_items.materia)
  2142. @sell_items.visible = @sell_items.active = true
  2143. when 2
  2144. $scene = Scene_Map.new
  2145. end
  2146. end
  2147. end
  2148. #--------------------------------------------------------------------------
  2149. def update_buy_materia
  2150. @help_window.set_text(Materia_Config::Buy_Message)
  2151. if Input.trigger?(Input::B)
  2152. $game_system.se_play($data_system.cancel_se)
  2153. @buy_items.visible = @buy_items.active = false
  2154. @buy_items.index = 0
  2155. @materia_bio.visible = false
  2156. @shop_options_window.active = true
  2157. end
  2158. if Input.trigger?(Input::C)
  2159. materia = @buy_items.materia
  2160. if $game_party.gold < materia.buy_value
  2161. $game_system.se_play($data_system.buzzer_se)
  2162. return
  2163. end
  2164. $game_system.se_play($data_system.shop_se)
  2165. $game_party.gain_materia(materia.id)
  2166. $game_party.lose_gold(materia.buy_value)
  2167. @gold_window.refresh
  2168. @buy_items.refresh
  2169. @sell_items.refresh
  2170. @materia_bio.refresh(@buy_items.materia)
  2171. end
  2172. if Input.trigger?(Input::UP) || Input.trigger?(Input::DOWN) ||
  2173. Input.press?(Input::UP) || Input.press?(Input::DOWN) ||
  2174. Input.trigger?(Input::R) || Input.trigger?(Input::L) ||
  2175. Input.press?(Input::R) || Input.press?(Input::L)
  2176. @materia_bio.refresh(@buy_items.materia)
  2177. end
  2178. end
  2179. #--------------------------------------------------------------------------
  2180. def update_sell_materia
  2181. @help_window.set_text(Materia_Config::Sell_Message)
  2182. if Input.trigger?(Input::B)
  2183. $game_system.se_play($data_system.cancel_se)
  2184. @sell_items.visible = @sell_items.active = false
  2185. @sell_items.index = 0
  2186. @materia_bio.visible = false
  2187. @shop_options_window.active = true
  2188. end
  2189. if Input.trigger?(Input::C)
  2190. if @sell_items.materia.nil?
  2191. $game_system.se_play($data_system.buzzer_se)
  2192. return
  2193. end
  2194. $game_system.se_play($data_system.shop_se)
  2195. $game_party.gain_gold(@sell_items.materia.sell_value)
  2196. @gold_window.refresh
  2197. $game_party.materia.delete_at(@sell_items.index)
  2198. @sell_items.refresh
  2199. @sell_items.index = 0
  2200. @materia_bio.refresh(@sell_items.materia)
  2201. end
  2202. if Input.trigger?(Input::UP) || Input.trigger?(Input::DOWN) ||
  2203. Input.press?(Input::UP) || Input.press?(Input::DOWN) ||
  2204. Input.trigger?(Input::R) || Input.trigger?(Input::L) ||
  2205. Input.press?(Input::R) || Input.press?(Input::L)
  2206. @materia_bio.refresh(@sell_items.materia)
  2207. end
  2208. end
  2209. end
  2210.  
  2211. #==============================================================================
  2212. # ** Scene_MateriaEquip
  2213. #==============================================================================
  2214. class Scene_MateriaEquip
  2215. #--------------------------------------------------------------------------
  2216. def initialize(actor_index = 0, equip_index = 0)
  2217. @actor_index = actor_index
  2218. @equip_index = equip_index
  2219. @materia_index = 0
  2220. @actor = $game_party.actors[@actor_index]
  2221. end
  2222. #--------------------------------------------------------------------------
  2223. def main
  2224. @status_bio_window = Window_MateriaStatus.new(@actor)
  2225. @character_bio_window = Window_MateriaActor.new(@actor)
  2226. @materia_bio_window = Window_MateriaEquipBio.new
  2227. @materia_list_window = Window_MateriaList.new(false, $game_party.materia, false)
  2228. @materia_list_window.x, @materia_list_window.y = 400, 152
  2229. @materia_list_window.height = 328
  2230. @materia_list_window.visible = true
  2231. @materia_bio_window.z = @materia_list_window.z = 1000
  2232. @pointer_sprite = Sprite.new
  2233. @pointer_sprite.x = 416 + (@materia_index + 1) * 24 - 28
  2234. @pointer_sprite.y = @equip_index * 24 + 18
  2235. @pointer_sprite.z = 9999
  2236. @pointer_sprite.bitmap = RPG::Cache.icon(Materia_Config::Materia_Cursor)
  2237. update_materia_bio
  2238. @objects = [@status_bio_window, @character_bio_window, @materia_bio_window,
  2239. @materia_list_window, @pointer_sprite]
  2240. Graphics.transition
  2241. while $scene == self
  2242. Graphics.update
  2243. Input.update
  2244. @objects.each {|x| x.update}
  2245. update
  2246. end
  2247. Graphics.freeze
  2248. @objects.each {|x| x.dispose}
  2249. end
  2250. #--------------------------------------------------------------------------
  2251. def update
  2252. !@materia_list_window.active ? update_weapon_select : update_materia_select
  2253. end
  2254. #--------------------------------------------------------------------------
  2255. def update_weapon_select
  2256. @pointer_sprite.x = 416 + (@materia_index + 1) * 24 - 28
  2257. @pointer_sprite.y = @equip_index * 24 + 18
  2258. if Input.trigger?(Input::UP)
  2259. $game_system.se_play($data_system.cursor_se)
  2260. @equip_index = @equip_index == 0 ? @equip_index = 4 : @equip_index -= 1
  2261. case @equip_index
  2262. when 0
  2263. max = [@actor.weapon_materia.size - 1, 0].max
  2264. when 1
  2265. max = [@actor.armor1_materia.size - 1, 0].max
  2266. when 2
  2267. max = [@actor.armor2_materia.size - 1, 0].max
  2268. when 3
  2269. max = [@actor.armor3_materia.size - 1, 0].max
  2270. when 4
  2271. max = [@actor.armor4_materia.size - 1, 0].max
  2272. end
  2273. @materia_index = [@materia_index, max].min
  2274. update_materia_bio
  2275. end
  2276. if Input.trigger?(Input::DOWN)
  2277. $game_system.se_play($data_system.cursor_se)
  2278. @equip_index = @equip_index == 4 ? @equip_index = 0 : @equip_index += 1
  2279. case @equip_index
  2280. when 0
  2281. max = [@actor.weapon_materia.size - 1, 0].max
  2282. when 1
  2283. max = [@actor.armor1_materia.size - 1, 0].max
  2284. when 2
  2285. max = [@actor.armor2_materia.size - 1, 0].max
  2286. when 3
  2287. max = [@actor.armor3_materia.size - 1, 0].max
  2288. when 4
  2289. max = [@actor.armor4_materia.size - 1, 0].max
  2290. end
  2291. @materia_index = [@materia_index, max].min
  2292. update_materia_bio
  2293. end
  2294. if Input.trigger?(Input::RIGHT)
  2295. $game_system.se_play($data_system.cursor_se)
  2296. case @equip_index
  2297. when 0
  2298. max = @actor.weapon_materia.size
  2299. when 1
  2300. max = @actor.armor1_materia.size
  2301. when 2
  2302. max = @actor.armor2_materia.size
  2303. when 3
  2304. max = @actor.armor3_materia.size
  2305. when 4
  2306. max = @actor.armor4_materia.size
  2307. end
  2308. return if max == 0
  2309. @materia_index = @materia_index == max - 1 ? @materia_index = 0 : @materia_index += 1
  2310. update_materia_bio
  2311. end
  2312. if Input.trigger?(Input::LEFT)
  2313. $game_system.se_play($data_system.cursor_se)
  2314. case @equip_index
  2315. when 0
  2316. max = @actor.weapon_materia.size
  2317. when 1
  2318. max = @actor.armor1_materia.size
  2319. when 2
  2320. max = @actor.armor2_materia.size
  2321. when 3
  2322. max = @actor.armor3_materia.size
  2323. when 4
  2324. max = @actor.armor4_materia.size
  2325. end
  2326. return if max == 0
  2327. @materia_index = @materia_index == 0 ? @materia_index = max - 1 : @materia_index -= 1
  2328. update_materia_bio
  2329. end
  2330. if Input.trigger?(Input::L)
  2331. @actor_index = @actor_index == 0 ?
  2332. @actor_index = $game_party.actors.size - 1 : @actor_index -= 1
  2333. $scene = Scene_MateriaEquip.new(@actor_index, @equip_index)
  2334. end
  2335. if Input.trigger?(Input::R)
  2336. @actor_index = @actor_index == $game_party.actors.size - 1 ?
  2337. @actor_index = 0: @actor_index += 1
  2338. $scene = Scene_MateriaEquip.new(@actor_index, @equip_index)
  2339. end
  2340. if Input.trigger?(Input::A)
  2341. $game_system.se_play($data_system.equip_se)
  2342. @actor.unequip_materia(@equip_index, @materia_index)
  2343. @materia_list_window.refresh
  2344. @status_bio_window.refresh
  2345. @character_bio_window.draw_actor_materia
  2346. update_materia_bio
  2347. end
  2348. if Input.trigger?(Input::B)
  2349. $game_system.se_play($data_system.cancel_se)
  2350. $scene = Scene_Menu.new(3)
  2351. end
  2352. if Input.trigger?(Input::C)
  2353. case @equip_index
  2354. when 0
  2355. max = @actor.weapon_materia.size
  2356. when 1
  2357. max = @actor.armor1_materia.size
  2358. when 2
  2359. max = @actor.armor2_materia.size
  2360. when 3
  2361. max = @actor.armor3_materia.size
  2362. when 4
  2363. max = @actor.armor4_materia.size
  2364. end
  2365. if max == 0
  2366. $game_system.se_play($data_system.buzzer_se)
  2367. return
  2368. else
  2369. $game_system.se_play($data_system.decision_se)
  2370. @materia_list_window.active = true
  2371. update_materia_bio
  2372. end
  2373. end
  2374. end
  2375. #--------------------------------------------------------------------------
  2376. def update_materia_select
  2377. if Input.trigger?(Input::B)
  2378. $game_system.se_play($data_system.cancel_se)
  2379. @materia_list_window.active = false
  2380. update_materia_bio
  2381. end
  2382. if Input.trigger?(Input::C)
  2383. if @materia_list_window.materia.nil?
  2384. $game_system.se_play($data_system.buzzer_se)
  2385. return
  2386. end
  2387. $game_system.se_play($data_system.equip_se)
  2388. @actor.equip_materia(@equip_index, @materia_index,
  2389. @materia_list_window.index)
  2390. @materia_list_window.refresh
  2391. @status_bio_window.refresh
  2392. @character_bio_window.draw_actor_materia
  2393. @materia_list_window.active = false
  2394. update_materia_bio
  2395. end
  2396. if Input.trigger?(Input::UP) || Input.trigger?(Input::DOWN) ||
  2397. Input.press?(Input::UP) || Input.press?(Input::DOWN) ||
  2398. Input.trigger?(Input::R) || Input.trigger?(Input::L) ||
  2399. Input.press?(Input::R) || Input.press?(Input::L)
  2400. update_materia_bio
  2401. end
  2402. end
  2403. #--------------------------------------------------------------------------
  2404. def update_materia_bio
  2405. if @materia_list_window.active
  2406. @materia_bio_window.refresh(@materia_list_window.materia)
  2407. else
  2408. case @equip_index
  2409. when 0
  2410. item = @actor.weapon_materia
  2411. when 1
  2412. item = @actor.armor1_materia
  2413. when 2
  2414. item = @actor.armor2_materia
  2415. when 3
  2416. item = @actor.armor3_materia
  2417. when 4
  2418. item = @actor.armor4_materia
  2419. end
  2420. @materia_bio_window.refresh(item[@materia_index])
  2421. end
  2422. end
  2423. end
  2424.  
  2425. #==============================================================================
  2426. # ** Scene_Battle
  2427. #==============================================================================
  2428. class Scene_Battle
  2429. #--------------------------------------------------------------------------
  2430. alias seph_materiasystem_scenebattle_setupcommandwindow phase3_setup_command_window
  2431. def phase3_setup_command_window
  2432. @update_skills_commands = Window_Skill.new(@active_battler)
  2433. @update_skills_commands.refresh
  2434. @update_skills_commands.update
  2435. @update_skills_commands.dispose
  2436. seph_materiasystem_scenebattle_setupcommandwindow
  2437. end
  2438. #--------------------------------------------------------------------------
  2439. alias seph_materiasystem_scenebattle_skillselect update_phase3_skill_select
  2440. def update_phase3_skill_select
  2441. if Input.trigger?(Input::C)
  2442. @skill = @skill_window.skill
  2443. if @skill == nil or not @active_battler.skill_can_use?(@skill.id)
  2444. $game_system.se_play($data_system.buzzer_se)
  2445. return
  2446. end
  2447. @active_battler.current_action.skill_id = @skill.id
  2448. paired_materia_set = @active_battler.return_paired_materia
  2449. for paired_set in paired_materia_set
  2450. materia = paired_set[2]
  2451. other_materia = paired_set[3]
  2452. if materia.special_effect == 'All'
  2453. for skill_id in other_materia.skills
  2454. if skill_id == @skill.id
  2455. unless @skill.element_set.include?(Materia_Config::Negate_All_ID)
  2456. @skill_window.visible = false
  2457. $game_system.se_play($data_system.decision_se)
  2458. end_skill_select
  2459. phase3_next_actor
  2460. return
  2461. end
  2462. end
  2463. end
  2464. end
  2465. end
  2466. end
  2467. seph_materiasystem_scenebattle_skillselect
  2468. end
  2469. #------------------------------------------------------------------------------
  2470. def make_skill_action_result
  2471. @skill = $data_skills[@active_battler.current_action.skill_id]
  2472. unless @active_battler.current_action.forcing
  2473. unless @active_battler.skill_can_use?(@skill.id)
  2474. $game_temp.forcing_battler = nil
  2475. @phase4_step = 1
  2476. return
  2477. end
  2478. end
  2479. @active_battler.sp -= @skill.sp_cost
  2480. @status_window.refresh
  2481. @help_window.set_text(@skill.name, 1)
  2482. @animation1_id = @skill.animation1_id
  2483. @animation2_id = @skill.animation2_id
  2484. @common_event_id = @skill.common_event_id
  2485. scope = @skill.scope
  2486. paired_materia_set = @active_battler.return_paired_materia
  2487. for paired_set in paired_materia_set
  2488. materia = paired_set[2]
  2489. other_materia = paired_set[3]
  2490. if materia.special_effect == 'All'
  2491. for skill_id in other_materia.skills
  2492. if skill_id == @skill.id
  2493. unless @skill.element_set.include?(Materia_Config::Negate_All_ID)
  2494. scope = 2 if @skill.scope == 1
  2495. scope = 4 if @skill.scope == 3 || @skill.scope == 7
  2496. scope = 6 if @skill.scope == 5
  2497. end
  2498. end
  2499. end
  2500. end
  2501. end
  2502. set_target_battlers(scope)
  2503. for target in @target_battlers
  2504. target.skill_effect(@active_battler, @skill)
  2505. end
  2506. end
  2507. #------------------------------------------------------------------------------
  2508. def update_phase2_escape
  2509. enemies_agi = 0
  2510. enemies_number = 0
  2511. for enemy in $game_troop.enemies
  2512. if enemy.exist?
  2513. enemies_agi += enemy.agi
  2514. enemies_number += 1
  2515. end
  2516. end
  2517. if enemies_number > 0
  2518. enemies_agi /= enemies_number
  2519. end
  2520. actors_agi = 0
  2521. actors_number = 0
  2522. for actor in $game_party.actors
  2523. if actor.exist?
  2524. actors_agi += actor.agi
  2525. actors_number += 1
  2526. end
  2527. end
  2528. if actors_number > 0
  2529. actors_agi /= actors_number
  2530. end
  2531. escapeplus = 0
  2532. for actor in $game_party.actors
  2533. escapeplus += actor.escapeplus if actor.exist?
  2534. end
  2535. success = rand(100) < 50 + escapeplus * actors_agi / enemies_agi
  2536. if success
  2537. $game_system.se_play($data_system.escape_se)
  2538. $game_system.bgm_play($game_temp.map_bgm)
  2539. battle_end(1)
  2540. else
  2541. $game_party.clear_actions
  2542. start_phase4
  2543. end
  2544. end
  2545. #------------------------------------------------------------------------------
  2546. def start_phase5
  2547. @phase = 5
  2548. $game_system.me_play($game_system.battle_end_me)
  2549. $game_system.bgm_play($game_temp.map_bgm)
  2550. exp = 0
  2551. ap = 0
  2552. gold = 0
  2553. treasures = []
  2554. dropup = 0
  2555. for actor in $game_party.actors
  2556. dropup += actor.itemdropup if actor.exist?
  2557. end
  2558. for enemy in $game_troop.enemies
  2559. unless enemy.hidden
  2560. exp += enemy.exp
  2561. gold += enemy.gold
  2562. ap += enemy.ap
  2563. if rand(100) < enemy.treasure_prob + dropup
  2564. if enemy.item_id > 0
  2565. treasures.push($data_items[enemy.item_id])
  2566. end
  2567. if enemy.weapon_id > 0
  2568. treasures.push($data_weapons[enemy.weapon_id])
  2569. end
  2570. if enemy.armor_id > 0
  2571. treasures.push($data_armors[enemy.armor_id])
  2572. end
  2573. end
  2574. end
  2575. end
  2576. treasures = treasures[0..5]
  2577. actors = $game_party.actors
  2578. for i in 0...$game_party.actors.size
  2579. actor = $game_party.actors[i]
  2580. if actor.cant_get_exp? == false
  2581. last_level = actor.level
  2582. actor.exp += exp
  2583. actor.ap += ap
  2584. if actor.level > last_level
  2585. @status_window.level_up(i)
  2586. end
  2587. end
  2588. end
  2589. $game_party.gain_gold(gold)
  2590. for item in treasures
  2591. case item
  2592. when RPG::Item
  2593. $game_party.gain_item(item.id, 1)
  2594. when RPG::Weapon
  2595. $game_party.gain_weapon(item.id, 1)
  2596. when RPG::Armor
  2597. $game_party.gain_armor(item.id, 1)
  2598. end
  2599. end
  2600. @result_window = Window_BattleResult.new(exp, gold, treasures, ap)
  2601. @phase5_wait_count = 100
  2602. end
  2603. end
  2604.  
  2605. #==============================================================================
  2606. # ** Scene_Menu
  2607. #==============================================================================
  2608. class Scene_Menu
  2609. #--------------------------------------------------------------------------
  2610. def main
  2611. s1 = $data_system.words.item
  2612. s2 = $data_system.words.skill
  2613. s3 = $data_system.words.equip
  2614. s4 = "Materias"
  2615. s5 = "Status"
  2616. s6 = "Save"
  2617. s7 = "End Game"
  2618. @command_window = Window_Command_Materia.new(160, [s1, s2, s3, s4, s5, s6, s7])
  2619. @command_window.index = @menu_index
  2620. if $game_party.actors.size == 0
  2621. @command_window.disable_item(0)
  2622. @command_window.disable_item(1)
  2623. @command_window.disable_item(2)
  2624. @command_window.disable_item(3)
  2625. @command_window.disable_item(4)
  2626. end
  2627. if $game_system.save_disabled
  2628. @command_window.disable_item(5)
  2629. end
  2630. @playtime_window = Window_PlayTime.new
  2631. @playtime_window.x = 0
  2632. @playtime_window.y = 224
  2633. @steps_window = Window_Steps.new
  2634. @steps_window.x = 0
  2635. @steps_window.y = 320
  2636. @gold_window = Window_Gold.new
  2637. @gold_window.x = 0
  2638. @gold_window.y = 416
  2639. @status_window = Window_MenuStatus.new
  2640. @status_window.x = 160
  2641. @status_window.y = 0
  2642. Graphics.transition
  2643. loop do
  2644. Graphics.update
  2645. Input.update
  2646. update
  2647. if $scene != self
  2648. break
  2649. end
  2650. end
  2651. Graphics.freeze
  2652. @command_window.dispose
  2653. @playtime_window.dispose
  2654. @steps_window.dispose
  2655. @gold_window.dispose
  2656. @status_window.dispose
  2657. end
  2658. #--------------------------------------------------------------------------
  2659. def update_command
  2660. if Input.trigger?(Input::B)
  2661. $game_system.se_play($data_system.cancel_se)
  2662. $scene = Scene_Map.new
  2663. return
  2664. end
  2665. if Input.trigger?(Input::C)
  2666. if $game_party.actors.size == 0 and @command_window.index < 4
  2667. $game_system.se_play($data_system.buzzer_se)
  2668. return
  2669. end
  2670. case @command_window.index
  2671. when 0
  2672. $game_system.se_play($data_system.decision_se)
  2673. $scene = Scene_Item.new
  2674. when 1
  2675. $game_system.se_play($data_system.decision_se)
  2676. @command_window.active = false
  2677. @status_window.active = true
  2678. @status_window.index = 0
  2679. when 2
  2680. $game_system.se_play($data_system.decision_se)
  2681. @command_window.active = false
  2682. @status_window.active = true
  2683. @status_window.index = 0
  2684. when 3
  2685. $game_system.se_play($data_system.decision_se)
  2686. @command_window.active = false
  2687. @status_window.active = true
  2688. @status_window.index = 0
  2689. when 4
  2690. $game_system.se_play($data_system.decision_se)
  2691. @command_window.active = false
  2692. @status_window.active = true
  2693. @status_window.index = 0
  2694. when 5
  2695. if $game_system.save_disabled
  2696. $game_system.se_play($data_system.buzzer_se)
  2697. return
  2698. end
  2699. $game_system.se_play($data_system.decision_se)
  2700. $scene = Scene_Save.new
  2701. when 6
  2702. $game_system.se_play($data_system.decision_se)
  2703. $scene = Scene_End.new
  2704. end
  2705. return
  2706. end
  2707. end
  2708. #--------------------------------------------------------------------------
  2709. def update_status
  2710. if Input.trigger?(Input::B)
  2711. $game_system.se_play($data_system.cancel_se)
  2712. @command_window.active = true
  2713. @status_window.active = false
  2714. @status_window.index = -1
  2715. return
  2716. end
  2717. if Input.trigger?(Input::C)
  2718. case @command_window.index
  2719. when 1
  2720. if $game_party.actors[@status_window.index].restriction >= 2
  2721. $game_system.se_play($data_system.buzzer_se)
  2722. return
  2723. end
  2724. $game_system.se_play($data_system.decision_se)
  2725. $scene = Scene_Skill.new(@status_window.index)
  2726. when 2
  2727. $game_system.se_play($data_system.decision_se)
  2728. $scene = Scene_Equip.new(@status_window.index)
  2729. when 3
  2730. $game_system.se_play($data_system.decision_se)
  2731. $scene = Scene_MateriaEquip.new(@status_window.index)
  2732. when 4
  2733. $game_system.se_play($data_system.decision_se)
  2734. $scene = Scene_Status.new(@status_window.index)
  2735. end
  2736. return
  2737. end
  2738. end
  2739. end
  2740.  
  2741. #==============================================================================
  2742. # ** Scene_Status
  2743. #==============================================================================
  2744. class Scene_Status
  2745. #--------------------------------------------------------------------------
  2746. def update
  2747. if Input.trigger?(Input::B)
  2748. $game_system.se_play($data_system.cancel_se)
  2749. $scene = Scene_Menu.new(4)
  2750. return
  2751. end
  2752. if Input.trigger?(Input::R)
  2753. $game_system.se_play($data_system.cursor_se)
  2754. @actor_index += 1
  2755. @actor_index %= $game_party.actors.size
  2756. $scene = Scene_Status.new(@actor_index)
  2757. return
  2758. end
  2759. if Input.trigger?(Input::L)
  2760. $game_system.se_play($data_system.cursor_se)
  2761. @actor_index += $game_party.actors.size - 1
  2762. @actor_index %= $game_party.actors.size
  2763. $scene = Scene_Status.new(@actor_index)
  2764. return
  2765. end
  2766. end
  2767. end
  2768.  
  2769. #==============================================================================
  2770. # ** Scene_Save
  2771. #==============================================================================
  2772. class Scene_Save < Scene_File
  2773. #--------------------------------------------------------------------------
  2774. def on_cancel
  2775. $game_system.se_play($data_system.cancel_se)
  2776. if $game_temp.save_calling
  2777. $game_temp.save_calling = false
  2778. $scene = Scene_Map.new
  2779. return
  2780. end
  2781. $scene = Scene_Menu.new(5)
  2782. end
  2783. end
  2784.  
  2785. #==============================================================================
  2786. # ** Scene_End
  2787. #==============================================================================
  2788. class Scene_End
  2789. #--------------------------------------------------------------------------
  2790. def update
  2791. @command_window.update
  2792. if Input.trigger?(Input::B)
  2793. $game_system.se_play($data_system.cancel_se)
  2794. $scene = Scene_Menu.new(6)
  2795. return
  2796. end
  2797. if Input.trigger?(Input::C)
  2798. case @command_window.index
  2799. when 0
  2800. command_to_title
  2801. when 1
  2802. command_shutdown
  2803. when 2
  2804. command_cancel
  2805. end
  2806. return
  2807. end
  2808. end
  2809. #--------------------------------------------------------------------------
  2810. def command_cancel
  2811. $game_system.se_play($data_system.decision_se)
  2812. $scene = Scene_Menu.new(6)
  2813. end
  2814. end
Advertisement
Add Comment
Please, Sign In to add comment