Advertisement
Lucidious89

Pokemon Birthsigns Script

Apr 18th, 2016
1,086
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 230.55 KB | None | 0 0
  1. #===============================================================================
  2. #
  3. # Pokémon Birthsigns - By Lucidious89
  4. # For -Pokémon Essentials v17-
  5. #
  6. #===============================================================================
  7. # This script intends to add a new mechanic known as "Birthsigns" to
  8. # Pokémon breeding. Each month of the year corresponds to a different sign,
  9. # and a Pokémon born under these signs will be infused with their bonuses.
  10. #
  11. # These scripts add 33 unique Birthsigns to choose from that can be grouped into
  12. # sets of 12 that act as a 12-month zodiac.
  13. #
  14. # You can swap between zodiacs by setting the "ZODIACSET" toggle to the desired
  15. # set number. You may also add a Birthsign to a Pokémon manually through scripts.
  16. #
  17. # Use the "WILDBIRTHSIGNS" toggle to give wild Pokemon birthsigns, too.
  18. #
  19. #===============================================================================
  20. # ~Installation~
  21. #===============================================================================
  22. # To install, insert a new section above Main, and paste this there. Name
  23. # this new section whatever you wish. This is a plug-n-play addition, and
  24. # doesn't require any other changes.
  25. #
  26. # However, several areas of the default scripts are overwritten here to
  27. # allow Pokémon Birthsigns to work. So it's recommended that this be
  28. # installed in a fresh copy of Essentials.
  29. #
  30. # These overwritten sections include:
  31. # -PField_Time
  32. # -PokeBattle_Pokemon
  33. # -PScreen_Party
  34. # -PScreen_Summary
  35. # -PField_DayCare
  36. # -PScreen_EggHatching
  37. # -PokeBattle_Battle
  38. # -PField_Field
  39. # -PScreen_Storage
  40. #
  41. # And possibly a few others.
  42. #
  43. #===============================================================================
  44. # Add-Ons and optional scripts to further enhance Pokemon Birthsigns:
  45. #===============================================================================
  46. # Birthsigns Journal Script : https://pastebin.com/raw/XqQTbPcF
  47. #
  48. # Birthsign Events Script : https://pastebin.com/raw/2GKL2P6f
  49. #
  50. # Zodiac Powers Script : https://pastebin.com/raw/Vxj8yihR
  51. #
  52. # Debug_Pokemon Update : https://pastebin.com/raw/TqG1EtCP
  53. #
  54. # Debug_Menu Update : https://pastebin.com/raw/FR4RLhkc
  55. #===============================================================================
  56. # Birthsigns graphics & Pokegear Icon:
  57. # https://www.dropbox.com/sh/kyrxchab1hsu8m5/AAAFVCHiMtsBnkk-zLFiPhAba?dl=0
  58. #===============================================================================
  59.  
  60. #########[SECTION 1 - CUSTOMIZATION]##########
  61. #===============================================================================
  62. # Compatibility with other scripts
  63. #===============================================================================
  64. SHOW_IV_STARS = false # Shows stars in summary/storage to indicate IV quality
  65. SHOW_EGG_GROUPS = false # Shows Egg Groups in the summary (Page 2)
  66. SHOW_SHINY_LEAF = false # Adds HGSS Shiny Leaf functionality
  67. SHOW_FAMILYTREE = false # Compatibility with FL's 'Family Tree' script
  68. INCLUDE_ZMOVES = false # Compatibility with AmethystRain's 'Z-Move' scripts
  69. #===============================================================================
  70. # Toggles the use and display of Zodiac Powers.
  71. #===============================================================================
  72. INCLUDE_ZPOWER = true
  73.  
  74. #===============================================================================
  75. # The switch numbers used for Summons and Celestial Bosses
  76. #===============================================================================
  77. BOSS_SWITCH = 109
  78. SUMMON_SWITCH = 110
  79.  
  80. #===============================================================================
  81. # Toggles birthsigns for wild Pokemon
  82. #===============================================================================
  83. # 0 = No signs
  84. # 1 = Current sign (Based on your active ZODIACSET)
  85. # 2 = Random Partner/Rival (Based on the current month and active ZODIACSET)
  86. # 3 = Random zodiac sign (Based on your active ZODIACSET)
  87. # 4 = Random birthsign (Out of all possible signs)
  88. #===============================================================================
  89. WILDBIRTHSIGNS = 0
  90.  
  91. #===============================================================================
  92. # Toggles between different Zodiac Sets
  93. #===============================================================================
  94. # 0 = Null Set (No zodiac, but can still give signs through scripts)
  95. # 1 = Birthsigns Set 1 (Uses signs 1-12 to make a zodiac)
  96. # 2 = Birthsigns Set 2 (Uses signs 13-24 to make a zodiac)
  97. # 3 = Randomized Set (Compiles a random zodiac out of all signs)
  98. # 4+ = Custom Sets (Make your own zodiacs)
  99. #===============================================================================
  100. ZODIACSET = 1
  101.  
  102. ################################################################################
  103. ################################################################################
  104. #===============================================================================
  105. # Creating a custom zodiac simply requires you to set each month's BIRTHSIGN to
  106. # a number corresponding to a birthsign. Here's a chart of all the sign numbers:
  107. #===============================================================================
  108. # 0 = Void 1 = Apprentice 2 = Companion 3 = Beacon 4 = Savage
  109. # 5 = Prodigy 6 = Martyr 7 = Maiden 8 = Gladiator 9 = Voyager
  110. # 10 = Thief 11 = Glutton 12 = Wishmaker 13 = Phoenix 14 = Scholar
  111. # 15 = Fugitive 16 = Aristocrat 17 = Cleric 18 = Monk 19 = Ancestor
  112. # 20 = Specialist 21 = Assassin 22 = Parent 23 = Hunter 24 = Eternal
  113. # 25 = Bard 26 = Empath 27 = Mirror 28 = Tactician 29 = Fool
  114. # 30 = Alchemist 31 = Vampire 32 = Soulmate 33 = Cultist
  115. #===============================================================================
  116. # Custom Set (4)
  117. #===============================================================================
  118. if ZODIACSET==4 # Renumber all the zeroes below with your desired sign numbers
  119. JAN_BIRTHSIGN = 0
  120. FEB_BIRTHSIGN = 0
  121. MAR_BIRTHSIGN = 0
  122. APR_BIRTHSIGN = 0
  123. MAY_BIRTHSIGN = 0
  124. JUN_BIRTHSIGN = 0
  125. JUL_BIRTHSIGN = 0
  126. AUG_BIRTHSIGN = 0
  127. SEP_BIRTHSIGN = 0
  128. OCT_BIRTHSIGN = 0
  129. NOV_BIRTHSIGN = 0
  130. DEC_BIRTHSIGN = 0
  131. end
  132. ################################################################################
  133. ################################################################################
  134. #===============================================================================
  135. # Null Set (0)
  136. #===============================================================================
  137. # Using this set means you won't have any birthsigns in your 12 month zodiac.
  138. # No Pokemon will naturally inherit any sign through breeding or in the wild.
  139. # However, you may still manually give Pokemon a sign.
  140. #===============================================================================
  141. if ZODIACSET==0
  142. JAN_BIRTHSIGN = 0
  143. FEB_BIRTHSIGN = 0
  144. MAR_BIRTHSIGN = 0
  145. APR_BIRTHSIGN = 0
  146. MAY_BIRTHSIGN = 0
  147. JUN_BIRTHSIGN = 0
  148. JUL_BIRTHSIGN = 0
  149. AUG_BIRTHSIGN = 0
  150. SEP_BIRTHSIGN = 0
  151. OCT_BIRTHSIGN = 0
  152. NOV_BIRTHSIGN = 0
  153. DEC_BIRTHSIGN = 0
  154. end
  155. #===============================================================================
  156. # Birthsigns Set 1 (1)
  157. #===============================================================================
  158. # Utilizes the original signs (1-12) to build a zodiac.
  159. #===============================================================================
  160. if ZODIACSET==1
  161. JAN_BIRTHSIGN = 1
  162. FEB_BIRTHSIGN = 2
  163. MAR_BIRTHSIGN = 3
  164. APR_BIRTHSIGN = 4
  165. MAY_BIRTHSIGN = 5
  166. JUN_BIRTHSIGN = 6
  167. JUL_BIRTHSIGN = 7
  168. AUG_BIRTHSIGN = 8
  169. SEP_BIRTHSIGN = 9
  170. OCT_BIRTHSIGN = 10
  171. NOV_BIRTHSIGN = 11
  172. DEC_BIRTHSIGN = 12
  173. end
  174. #===============================================================================
  175. # Birthsigns Set 2 (2)
  176. #===============================================================================
  177. # Utilizes the second set of signs (13-24) to build a zodiac
  178. #===============================================================================
  179. if ZODIACSET==2
  180. JAN_BIRTHSIGN = 13
  181. FEB_BIRTHSIGN = 14
  182. MAR_BIRTHSIGN = 15
  183. APR_BIRTHSIGN = 16
  184. MAY_BIRTHSIGN = 17
  185. JUN_BIRTHSIGN = 18
  186. JUL_BIRTHSIGN = 19
  187. AUG_BIRTHSIGN = 20
  188. SEP_BIRTHSIGN = 21
  189. OCT_BIRTHSIGN = 22
  190. NOV_BIRTHSIGN = 23
  191. DEC_BIRTHSIGN = 24
  192. end
  193. #===============================================================================
  194. # Randomized Set (3)
  195. #===============================================================================
  196. # Builds a semi-randomized zodiac out of all possible signs.
  197. # Ensures no duplicate signs are used, and avoids picking sign 0 (no sign).
  198. # This set will randomize EACH TIME you load up your game.
  199. #===============================================================================
  200. def getSignList(month)
  201. return [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,
  202. 19,20,21,22,23,24,25,26,27,28,29,30,31,32,33][month-1]
  203. end
  204. if ZODIACSET==3 # Zodiac uses random signs
  205. rndm=rand(32)
  206. JAN_BIRTHSIGN = getSignList(rndm)
  207. FEB_BIRTHSIGN = getSignList((rndm+6)%33)
  208. MAR_BIRTHSIGN = getSignList((rndm+11)%33)
  209. APR_BIRTHSIGN = getSignList((rndm+2)%33)
  210. MAY_BIRTHSIGN = getSignList((rndm+8)%33)
  211. JUN_BIRTHSIGN = getSignList((rndm+3)%33)
  212. JUL_BIRTHSIGN = getSignList((rndm+7)%33)
  213. AUG_BIRTHSIGN = getSignList((rndm+4)%33)
  214. SEP_BIRTHSIGN = getSignList((rndm+10)%33)
  215. OCT_BIRTHSIGN = getSignList((rndm+1)%33)
  216. NOV_BIRTHSIGN = getSignList((rndm+9)%33)
  217. DEC_BIRTHSIGN = getSignList((rndm+5)%33)
  218. end
  219.  
  220. #===============================================================================
  221. # Birthsign Names
  222. #===============================================================================
  223. # You may rename signs here. They will be recognized by the rest of the script.
  224. #===============================================================================
  225. BIRTHSIGN_00 = _INTL("'The Void'")
  226. BIRTHSIGN_01 = _INTL("'The Apprentice'")
  227. BIRTHSIGN_02 = _INTL("'The Companion'")
  228. BIRTHSIGN_03 = _INTL("'The Beacon'")
  229. BIRTHSIGN_04 = _INTL("'The Savage'")
  230. BIRTHSIGN_05 = _INTL("'The Prodigy'")
  231. BIRTHSIGN_06 = _INTL("'The Martyr'")
  232. BIRTHSIGN_07 = _INTL("'The Maiden'")
  233. BIRTHSIGN_08 = _INTL("'The Gladiator'")
  234. BIRTHSIGN_09 = _INTL("'The Voyager'")
  235. BIRTHSIGN_10 = _INTL("'The Thief'")
  236. BIRTHSIGN_11 = _INTL("'The Glutton'")
  237. BIRTHSIGN_12 = _INTL("'The Wishmaker'")
  238. BIRTHSIGN_13 = _INTL("'The Phoenix'")
  239. BIRTHSIGN_14 = _INTL("'The Scholar'")
  240. BIRTHSIGN_15 = _INTL("'The Fugitive'")
  241. BIRTHSIGN_16 = _INTL("'The Aristocrat'")
  242. BIRTHSIGN_17 = _INTL("'The Cleric'")
  243. BIRTHSIGN_18 = _INTL("'The Monk'")
  244. BIRTHSIGN_19 = _INTL("'The Ancestor'")
  245. BIRTHSIGN_20 = _INTL("'The Specialist'")
  246. BIRTHSIGN_21 = _INTL("'The Assassin'")
  247. BIRTHSIGN_22 = _INTL("'The Parent'")
  248. BIRTHSIGN_23 = _INTL("'The Hunter'")
  249. BIRTHSIGN_24 = _INTL("'The Eternal'")
  250. BIRTHSIGN_25 = _INTL("'The Bard'")
  251. BIRTHSIGN_26 = _INTL("'The Empath'")
  252. BIRTHSIGN_27 = _INTL("'The Mirror'")
  253. BIRTHSIGN_28 = _INTL("'The Tactician'")
  254. BIRTHSIGN_29 = _INTL("'The Fool'")
  255. BIRTHSIGN_30 = _INTL("'The Alchemist'")
  256. BIRTHSIGN_31 = _INTL("'The Vampire'")
  257. BIRTHSIGN_32 = _INTL("'The Soulmate'")
  258. BIRTHSIGN_33 = _INTL("'The Cultist'")
  259.  
  260. #===============================================================================
  261. # Zodiac Power Names
  262. #===============================================================================
  263. # The names for each Zodiac Power's effects in battle.
  264. #===============================================================================
  265. def pbGetPowerName(sign)
  266. return [_INTL("Empty Gesture"), #'The Void'
  267. _INTL("Understudy"), #'The Apprentice'
  268. _INTL("Friend Boost"), #'The Companion'
  269. _INTL("Blinding Light"), #'The Beacon'
  270. _INTL("Feral Frenzy"), #'The Savage'
  271. _INTL("Ability Whiz"), #'The Prodigy'
  272. _INTL("Self Sacrifice"), #'The Martyr'
  273. _INTL("Beauty Queen"), #'The Maiden'
  274. _INTL("Battle Cry"), #'The Gladiator'
  275. _INTL("Tour Guide"), #'The Voyager'
  276. _INTL("Hit & Run"), #'The Thief'
  277. _INTL("Pig Out"), #'The Glutton'
  278. _INTL("Lucky Boost"), #'The Wishmaker'
  279. _INTL("Last Stand"), #'The Phoenix'
  280. _INTL("Quick Study"), #'The Scholar'
  281. _INTL("Escape Artist"), #'The Fugitive'
  282. _INTL("Market Crash"), #'The Aristocrat'
  283. _INTL("Great Purge"), #'The Cleric'
  284. _INTL("Untouchable"), #'The Monk'
  285. _INTL("Spirit Guard"), #'The Ancestor'
  286. _INTL("Lock Down"), #'The Specialist'
  287. _INTL("Ambush"), #'The Assassin'
  288. _INTL("Bodyguard"), #'The Parent'
  289. _INTL("Corner Strike"), #'The Hunter'
  290. _INTL("Lottery"), #'The Eternal'
  291. _INTL("Stifling Song"), #'The Bard'
  292. _INTL("Solidarity"), #'The Empath'
  293. _INTL("Mirror Image"), #'The Mirror'
  294. _INTL("Table Turn"), #'The Tactician'
  295. _INTL("Big Gamble"), #'The Fool'
  296. _INTL("Transmogrify"), #'The Alchemist'
  297. _INTL("Life Drain"), #'The Vampire'
  298. _INTL("Star-Crossed"), #'The Soulmate'
  299. _INTL("Dark Pact")][sign] #'The Cultist'
  300. end
  301.  
  302. # Used to get specific power names for the different effects of Stifling Song
  303. def pbGetSongName(value)
  304. return [_INTL("Stifling Song"),
  305. _INTL("Brittle Ballad"), # Lowers Attack
  306. _INTL("Silent Serenade"), # Lowers Sp.Atk
  307. _INTL("Lagging Lullaby")][value] # Lowers Speed
  308. end
  309.  
  310. #===============================================================================
  311. # Celestial Boss Names
  312. #===============================================================================
  313. # The names for each sign's Celestial Boss.
  314. #===============================================================================
  315. def pbGetBossName(sign)
  316. return [_INTL("???"), #'The Void'
  317. _INTL("Zealos"), #'The Apprentice'
  318. _INTL("Deliphis"), #'The Companion'
  319. _INTL("Phobos"), #'The Beacon'
  320. _INTL("Reivolt"), #'The Savage'
  321. _INTL("Klevar"), #'The Prodigy'
  322. _INTL("Mediva"), #'The Martyr'
  323. _INTL("Damsella"), #'The Maiden'
  324. _INTL("Bat'aal"), #'The Gladiator'
  325. _INTL("Ragnarova"), #'The Voyager'
  326. _INTL("Swyndell"), #'The Thief'
  327. _INTL("Gorvus"), #'The Glutton'
  328. _INTL("Alistaar"), #'The Wishmaker'
  329. _INTL("Ashbeyard"), #'The Phoenix'
  330. _INTL("Astuvius"), #'The Scholar'
  331. _INTL("Eluzi"), #'The Fugitive'
  332. _INTL("Koynn"), #'The Aristocrat'
  333. _INTL("Quu'ral"), #'The Cleric'
  334. _INTL("Luminatta"), #'The Monk'
  335. _INTL("Artu'fak"), #'The Ancestor'
  336. _INTL("Dopple"), #'The Specialist'
  337. _INTL("Deimos"), #'The Assassin'
  338. _INTL("Matria"), #'The Parent'
  339. _INTL("Maulgriev"), #'The Hunter'
  340. _INTL("Astrol"), #'The Eternal'
  341. _INTL("Ballaborg"), #'The Bard'
  342. _INTL("Sentimus"), #'The Empath'
  343. _INTL("Xerok"), #'The Mirror'
  344. _INTL("Griddeous"), #'The Tactician'
  345. _INTL("Turvii"), #'The Fool'
  346. _INTL("Boddelgeuz"), #'The Alchemist'
  347. _INTL("Vladimorg"), #'The Vampire'
  348. _INTL("Vymm & Vygor"), #'The Soulmate'
  349. _INTL("Lucifus")][sign] #'The Cultist'
  350. end
  351.  
  352. # Used to get individual boss names for 'The Soulmate' (0 or 1)
  353. def pbGetDoubleBoss(value)
  354. return [_INTL("Vymm"),_INTL("Vygor")][value]
  355. end
  356.  
  357. #===============================================================================
  358. # Birthsign Descriptions
  359. #===============================================================================
  360. # Text for each birthsign's effect in the Summary.
  361. #===============================================================================
  362. def pbGetZodiacDesc(sign)
  363. return [_INTL("Unknown."),
  364. _INTL("The Pokémon gains twice as many EV's from battle."),
  365. _INTL("Wild encounters share in the Pokémon's increased joy."),
  366. _INTL("The Pokémon may brighten up dark areas with Starlight."),
  367. _INTL("The Pokémon has max IV's in offense & speed, but 0 HP."),
  368. _INTL("The Pokémon may swap to one of its other Abilities."),
  369. _INTL("The Pokémon may sacrifice HP to Rescue a hurt ally."),
  370. _INTL("The Pokémon has 150 Sp.Atk EV's. High female ratio."),
  371. _INTL("The Pokémon has 150 Attack EV's. High male ratio."),
  372. _INTL("The Pokémon may use the stars to Navigate to safety."),
  373. _INTL("The Pokémon may find wild Pokémon holding treasure."),
  374. _INTL("The Pokémon has max IV's in defenses & HP, but 0 speed."),
  375. _INTL("The Pokémon has higher odds of being shiny."),
  376. _INTL("The Pokémon may revive itself from the party menu."),
  377. _INTL("The Pokémon gains 20% more exp. points from battles."),
  378. _INTL("The Pokémon may Escape to safety from dungeons."),
  379. _INTL("The Pokémon may find extra money while leading."),
  380. _INTL("The Pokémon may sacrifice HP to Cure an ally's status."),
  381. _INTL("The Pokémon may enter a Trance to relearn moves."),
  382. _INTL("The Pokémon may pass down its EV's to its progeny."),
  383. _INTL("The Pokémon may Re-roll for a new Hidden Power."),
  384. _INTL("The Pokémon may sneak up on sleeping wild Pokémon."),
  385. _INTL("The Pokémon may Incubate eggs to hatch them earlier."),
  386. _INTL("The Pokémon raises capture rates by 20% when leading."),
  387. _INTL("The Pokémon may begin anew and Reincarnate itself."),
  388. _INTL("The Pokémon may Harmonize to lure/repel wild Pokémon."),
  389. _INTL("The Pokémon Bonds with allies & copies their nature."),
  390. _INTL("The Pokémon may find wild Pokémon with similar IV's."),
  391. _INTL("The Pokémon may use a Gambit to reallocate its EV's."),
  392. _INTL("The Pokémon may give away its levels with Lunacy."),
  393. _INTL("Items may be Transmuted by utilizing Stardust."),
  394. _INTL("Walking at night heals the Pokémon. Daylight burns."),
  395. _INTL("Wild Pokémon may share compatible partner signs."),
  396. _INTL("The Pokemon may Summon by sacrificing its stats.")][sign]
  397. end
  398.  
  399. #===============================================================================
  400. # Birthsign Values
  401. #===============================================================================
  402. # The name and numbers that represent each birthsign.
  403. #===============================================================================
  404. module PBBirthsigns
  405. SIGN00 = 0 #'The Void'
  406. SIGN01 = 1 #'The Apprentice'
  407. SIGN02 = 2 #'The Companion'
  408. SIGN03 = 3 #'The Beacon'
  409. SIGN04 = 4 #'The Savage'
  410. SIGN05 = 5 #'The Prodigy'
  411. SIGN06 = 6 #'The Martyr'
  412. SIGN07 = 7 #'The Maiden'
  413. SIGN08 = 8 #'The Gladiator'
  414. SIGN09 = 9 #'The Voyager'
  415. SIGN10 = 10 #'The Thief'
  416. SIGN11 = 11 #'The Glutton'
  417. SIGN12 = 12 #'The Wishmaker'
  418. SIGN13 = 13 #'The Phoenix'
  419. SIGN14 = 14 #'The Scholar'
  420. SIGN15 = 15 #'The Fugitive'
  421. SIGN16 = 16 #'The Aristocrat'
  422. SIGN17 = 17 #'The Cleric'
  423. SIGN18 = 18 #'The Monk'
  424. SIGN19 = 19 #'The Ancestor'
  425. SIGN20 = 20 #'The Specialist'
  426. SIGN21 = 21 #'The Assassin'
  427. SIGN22 = 22 #'The Parent'
  428. SIGN23 = 23 #'The Hunter'
  429. SIGN24 = 24 #'The Eternal'
  430. SIGN25 = 25 #'The Bard'
  431. SIGN26 = 26 #'The Empath'
  432. SIGN27 = 27 #'The Mirror'
  433. SIGN28 = 28 #'The Tactician'
  434. SIGN29 = 29 #'The Fool'
  435. SIGN30 = 30 #'The Alchemist'
  436. SIGN31 = 31 #'The Vampire'
  437. SIGN32 = 32 #'The Soulmate'
  438. SIGN33 = 33 #'The Cultist'
  439. end
  440.  
  441. def PBBirthsigns.maxValue; 33; end
  442. def PBBirthsigns.getCount; 34; end
  443.  
  444. def PBBirthsigns.signValue(id)
  445. return (id)%34
  446. end
  447.  
  448. def PBBirthsigns.getName(id)
  449. names=[
  450. BIRTHSIGN_00, #'The Void'
  451. BIRTHSIGN_01, #'The Apprentice'
  452. BIRTHSIGN_02, #'The Companion'
  453. BIRTHSIGN_03, #'The Beacon'
  454. BIRTHSIGN_04, #'The Savage'
  455. BIRTHSIGN_05, #'The Prodigy'
  456. BIRTHSIGN_06, #'The Martyr'
  457. BIRTHSIGN_07, #'The Maiden'
  458. BIRTHSIGN_08, #'The Gladiator'
  459. BIRTHSIGN_09, #'The Voyager'
  460. BIRTHSIGN_10, #'The Thief'
  461. BIRTHSIGN_11, #'The Glutton'
  462. BIRTHSIGN_12, #'The Wishmaker'
  463. BIRTHSIGN_13, #'The Phoenix'
  464. BIRTHSIGN_14, #'The Scholar'
  465. BIRTHSIGN_15, #'The Fugitive'
  466. BIRTHSIGN_16, #'The Aristocrat'
  467. BIRTHSIGN_17, #'The Cleric'
  468. BIRTHSIGN_18, #'The Monk'
  469. BIRTHSIGN_19, #'The Ancestor'
  470. BIRTHSIGN_20, #'The Specialist'
  471. BIRTHSIGN_21, #'The Assassin'
  472. BIRTHSIGN_22, #'The Parent'
  473. BIRTHSIGN_23, #'The Hunter'
  474. BIRTHSIGN_24, #'The Eternal'
  475. BIRTHSIGN_25, #'The Bard'
  476. BIRTHSIGN_26, #'The Empath'
  477. BIRTHSIGN_27, #'The Mirror'
  478. BIRTHSIGN_28, #'The Tactician'
  479. BIRTHSIGN_29, #'The Fool'
  480. BIRTHSIGN_30, #'The Alchemist'
  481. BIRTHSIGN_31, #'The Vampire'
  482. BIRTHSIGN_32, #'The Soulmate'
  483. BIRTHSIGN_33 #'The Cultist'
  484. ]
  485. return names[id]
  486. end
  487.  
  488. # Used for Debug
  489. def pbChooseBirthsignList(default=0)
  490. commands = []
  491. for i in 1..PBBirthsigns.maxValue
  492. cname = getConstantName(PBBirthsigns,i) rescue nil
  493. commands.push([i,PBBirthsigns.getName(i)]) if cname
  494. end
  495. return pbChooseList(commands,default,-1)
  496. end
  497.  
  498. #===============================================================================
  499. # Zodiac Values
  500. #===============================================================================
  501. # The name and numbers that represent each zodiac sign.
  502. #===============================================================================
  503. module PBZodiacsigns
  504. JAN = 1
  505. FEB = 2
  506. MAR = 3
  507. APR = 4
  508. MAY = 5
  509. JUN = 6
  510. JUL = 7
  511. AUG = 8
  512. SEP = 9
  513. OCT = 10
  514. NOV = 11
  515. DEC = 12
  516. end
  517.  
  518. def PBZodiacsigns.maxValue; 12; end
  519. def PBZodiacsigns.getCount; 13; end
  520.  
  521. def PBZodiacsigns.signValue(id)
  522. return (id)%13
  523. end
  524.  
  525. def PBZodiacsigns.getName(id)
  526. names=[
  527. _INTL("-Clear Sign-"),
  528. PBBirthsigns.getName(JAN_BIRTHSIGN),
  529. PBBirthsigns.getName(FEB_BIRTHSIGN),
  530. PBBirthsigns.getName(MAR_BIRTHSIGN),
  531. PBBirthsigns.getName(APR_BIRTHSIGN),
  532. PBBirthsigns.getName(MAY_BIRTHSIGN),
  533. PBBirthsigns.getName(JUN_BIRTHSIGN),
  534. PBBirthsigns.getName(JUL_BIRTHSIGN),
  535. PBBirthsigns.getName(AUG_BIRTHSIGN),
  536. PBBirthsigns.getName(SEP_BIRTHSIGN),
  537. PBBirthsigns.getName(OCT_BIRTHSIGN),
  538. PBBirthsigns.getName(NOV_BIRTHSIGN),
  539. PBBirthsigns.getName(DEC_BIRTHSIGN)
  540. ]
  541. return names[id]
  542. end
  543.  
  544. # Used for debug
  545. def pbChooseZodiacList(default=0)
  546. commands = []
  547. for i in 1..PBZodiacsigns.maxValue
  548. cname = getConstantName(PBZodiacsigns,i) rescue nil
  549. commands.push([i,PBZodiacsigns.getName(i)]) if cname
  550. end
  551. return pbChooseList(commands,default,-1)
  552. end
  553.  
  554. #########[SECTION 2 - METHODS]##########
  555. #===============================================================================
  556. # Birthsign Checks
  557. #===============================================================================
  558. # Returns true if the Pokemon has any birthsign
  559. def hasBirthsign?
  560. if !(self.isShadow? rescue false) && !egg?
  561. if birthsign>0
  562. return true
  563. end
  564. end
  565. end
  566.  
  567. # Returns true if the Pokemon has a zodiac sign
  568. def hasZodiacsign?
  569. if !(self.isShadow? rescue false) && !egg?
  570. if monthsign!=nil
  571. return true
  572. end
  573. end
  574. end
  575.  
  576. #===============================================================================
  577. # Month Checks
  578. #===============================================================================
  579. # January
  580. def hasJanBirthsign?
  581. if birthsign==JAN_BIRTHSIGN
  582. return true
  583. end
  584. end
  585.  
  586. # February
  587. def hasFebBirthsign?
  588. if birthsign==FEB_BIRTHSIGN
  589. return true
  590. end
  591. end
  592.  
  593. # March
  594. def hasMarBirthsign?
  595. if birthsign==MAR_BIRTHSIGN
  596. return true
  597. end
  598. end
  599.  
  600. # April
  601. def hasAprBirthsign?
  602. if birthsign==APR_BIRTHSIGN
  603. return true
  604. end
  605. end
  606.  
  607. # May
  608. def hasMayBirthsign?
  609. if birthsign==MAY_BIRTHSIGN
  610. return true
  611. end
  612. end
  613.  
  614. # June
  615. def hasJunBirthsign?
  616. if birthsign==JUN_BIRTHSIGN
  617. return true
  618. end
  619. end
  620.  
  621. # July
  622. def hasJulBirthsign?
  623. if birthsign==JUL_BIRTHSIGN
  624. return true
  625. end
  626. end
  627.  
  628. # August
  629. def hasAugBirthsign?
  630. if birthsign==AUG_BIRTHSIGN
  631. return true
  632. end
  633. end
  634.  
  635. # September
  636. def hasSepBirthsign?
  637. if birthsign==SEP_BIRTHSIGN
  638. return true
  639. end
  640. end
  641.  
  642. # October
  643. def hasOctBirthsign?
  644. if birthsign==OCT_BIRTHSIGN
  645. return true
  646. end
  647. end
  648.  
  649. # November
  650. def hasNovBirthsign?
  651. if birthsign==NOV_BIRTHSIGN
  652. return true
  653. end
  654. end
  655.  
  656. # December
  657. def hasDecBirthsign?
  658. if birthsign==DEC_BIRTHSIGN
  659. return true
  660. end
  661. end
  662.  
  663. #===============================================================================
  664. # Relative Sign Checks
  665. #===============================================================================
  666. # Returns true if the Pokemon has the zodiac sign relative to the current month
  667. def hasCurrentsign?
  668. return true if getCalendarsign==Time.now.mon
  669. end
  670.  
  671. # Returns true if a Pokemon has the Rival sign relative to (value)
  672. # Note: Don't set (value) to a Pokemon, use phShareRivalsign? instead
  673. def hasRivalsign?(value)
  674. return true if monthsign==zodiacOpposite(value-1)
  675. end
  676.  
  677. # Returns true if a Pokemon has a Partner sign relative to (value)
  678. # Note: Don't set (value) to a Pokemon, use phSharePartnersign? instead
  679. def hasPartnersign?(value)
  680. value-=1
  681. return true if monthsign==(value+4)%12
  682. return true if monthsign==(value+8)%12
  683. end
  684.  
  685. #===============================================================================
  686. # Sign Sharing Checks
  687. #===============================================================================
  688. # Returns true if pkmn1 and pkmn2 share a birthsign
  689. def pbShareBirthsign?(pkmn1,pkmn2)
  690. if pkmn1.birthsign==pkmn2.birthsign
  691. return true
  692. end
  693. end
  694.  
  695. # Returns true if pkmn1 and pkmn2 share a zodiac sign
  696. def pbShareZodiacsign?(pkmn1,pkmn2)
  697. if pkmn1.monthsign==pkmn2.monthsign
  698. return true
  699. end
  700. end
  701.  
  702. # Returns true if pkmn1 and pkmn2 share a Rival sign
  703. def pbShareRivalsign?(pkmn1,pkmn2)
  704. if pkmn1.monthsign==zodiacOpposite(pkmn2.monthsign)
  705. return true
  706. end
  707. end
  708.  
  709. # Returns true if pkmn1 and pkmn2 share a Partner sign
  710. def pbSharePartnersign?(pkmn1,pkmn2)
  711. return true if pkmn1.monthsign==(pkmn2.monthsign+4)%12
  712. return true if pkmn1.monthsign==(pkmn2.monthsign+8)%12
  713. end
  714.  
  715. #===============================================================================
  716. # Checking for a particular sign
  717. #===============================================================================
  718. # Returns the calander month number associated with a Pokemon's zodiac sign
  719. def getCalendarsign
  720. if monthsign!=nil
  721. return (1+monthsign)
  722. end
  723. end
  724.  
  725. # Returns the calander month number associated with a Pokemon's rival sign
  726. def getRivalsign
  727. return (1+zodiacOpposite(self.monthsign))
  728. end
  729.  
  730. # Returns the calander month numbers associated with a Pokemon's partner signs
  731. # Note: Set (num) to 1 or 2 to get the first or second partner, respectively
  732. def getPartnersign(num)
  733. return (1+((self.monthsign+4)%12)) if num==1
  734. return (1+((self.monthsign+8)%12)) if num==2
  735. end
  736.  
  737. #===============================================================================
  738. # Checks for a particular sign number from a list
  739. #===============================================================================
  740. # Returns the internal month number for each zodiac sign
  741. def monthsign
  742. if hasJanBirthsign?
  743. return 0
  744. elsif hasFebBirthsign?
  745. return 1
  746. elsif hasMarBirthsign?
  747. return 2
  748. elsif hasAprBirthsign?
  749. return 3
  750. elsif hasMayBirthsign?
  751. return 4
  752. elsif hasJunBirthsign?
  753. return 5
  754. elsif hasJulBirthsign?
  755. return 6
  756. elsif hasAugBirthsign?
  757. return 7
  758. elsif hasSepBirthsign?
  759. return 8
  760. elsif hasOctBirthsign?
  761. return 9
  762. elsif hasNovBirthsign?
  763. return 10
  764. elsif hasDecBirthsign?
  765. return 11
  766. else
  767. return nil
  768. end
  769. end
  770.  
  771. # Returns the birthsign number of a particular month's zodiac sign
  772. def getZodiacList(month)
  773. return [JAN_BIRTHSIGN,FEB_BIRTHSIGN,MAR_BIRTHSIGN,APR_BIRTHSIGN,MAY_BIRTHSIGN,
  774. JUN_BIRTHSIGN,JUL_BIRTHSIGN,AUG_BIRTHSIGN,SEP_BIRTHSIGN,OCT_BIRTHSIGN,
  775. NOV_BIRTHSIGN,DEC_BIRTHSIGN][month-1]
  776. end
  777.  
  778. # Returns a zodiac gem out of a list, relative to (month) (0-11)
  779. def getZodiacGem(month)
  780. return [:JANZODICA,:FEBZODICA,:MARZODICA,:APRIZODICA,:MAYZODICA,:JUNZODICA,
  781. :JULZODICA,:AUGZODICA,:SEPZODICA,:OCTZODICA,:NOVIZODICA,:DECIZODICA][month]
  782. end
  783.  
  784. #===============================================================================
  785. # Miscellaneous
  786. #===============================================================================
  787. # Returns true if the current day is the user's birthday. (Hatched Pokemon)
  788. def isBirthday?
  789. # Determines the current date
  790. year=Time.now.year
  791. month=Time.now.mon
  792. day=Time.now.day
  793. # Determines date of birth
  794. birthyear=timeEggHatched.year
  795. birthmonth=timeEggHatched.mon
  796. birthday=timeEggHatched.day
  797. # Determines if there is a match
  798. if obtainMode==1
  799. if (birthmonth==month) && (birthday==day) && (birthyear<year)
  800. return true
  801. end
  802. end
  803. end
  804.  
  805. # Returns true if the current day is the anniversary of the Player's start time.
  806. def pbAnniversaryCheck
  807. # Determines the current date
  808. year=Time.now.year
  809. month=Time.now.mon
  810. day=Time.now.day
  811. # Determines date of start time
  812. startyear=$PokemonGlobal.startTime.year
  813. startmonth=$PokemonGlobal.startTime.mon
  814. startday=$PokemonGlobal.startTime.day
  815. # Determines if there is a match
  816. if (startmonth==month) && (startday==day) && (startyear<year)
  817. return true
  818. end
  819. end
  820.  
  821. # Returns the name of a Pokemon's birthsign
  822. def pbGetBirthsignName
  823. PBBirthsigns.getName(self.birthsign)
  824. end
  825.  
  826. # Returns the description of a Pokemon's birthsign effect (Summary)
  827. def pbGetBirthsignDesc
  828. pbGetZodiacDesc(self.birthsign)
  829. end
  830.  
  831. # Returns the range of the zodiac month
  832. def pbLastMonthDay
  833. if hasZodiacsign?
  834. if hasFebBirthsign?
  835. return _INTL("1st - 28th")
  836. elsif hasAprBirthsign? ||
  837. hasJunBirthsign? ||
  838. hasSepBirthsign? ||
  839. hasNovBirthsign?
  840. return _INTL("1st - 30th")
  841. else
  842. return _INTL("1st - 31st")
  843. end
  844. else
  845. return _INTL("Unknown")
  846. end
  847. end
  848.  
  849. # Resets celestial boss counter
  850. def pbBossCountReset
  851. for i in 0..12
  852. $Trainer.celestialcheck[i]=nil
  853. end
  854. end
  855.  
  856. #===============================================================================
  857. # Zodiac Gems
  858. #===============================================================================
  859. # Defines Zodiac Gems as an item type
  860. def pbIsZodiacGem?(item)
  861. return $ItemData[item] && $ItemData[item][ITEMTYPE]==15
  862. end
  863.  
  864. # Allows Zodiac Gems to be used by Fling
  865. class PokeBattle_Move_0F7 < PokeBattle_Move
  866. def pbMoveFailed(attacker,opponent)
  867. return true if attacker.item==0 ||
  868. @battle.pbIsUnlosableItem(attacker,attacker.item) ||
  869. pbIsPokeBall?(attacker.item) ||
  870. @battle.field.effects[PBEffects::MagicRoom]>0 ||
  871. attacker.hasWorkingAbility(:KLUTZ) ||
  872. attacker.effects[PBEffects::Embargo]>0
  873. for i in flingarray.keys
  874. if flingarray[i]
  875. for j in flingarray[i]
  876. return false if isConst?(attacker.item,PBItems,j)
  877. end
  878. end
  879. end
  880. return false if pbIsBerry?(attacker.item) &&
  881. !attacker.pbOpposing1.hasWorkingAbility(:UNNERVE) &&
  882. !attacker.pbOpposing2.hasWorkingAbility(:UNNERVE)
  883. return false if pbIsMegaStone?(attacker.item) && !pbIsUnlosableItem(attacker,item)
  884. return false if pbIsZodiacGem?(attacker.item)
  885. return true
  886. end
  887.  
  888. def pbBaseDamage(basedmg,attacker,opponent)
  889. return 10 if pbIsBerry?(attacker.item)
  890. return 80 if pbIsMegaStone?(attacker.item) || pbIsZodiacGem?(attacker.item)
  891. for i in flingarray.keys
  892. if flingarray[i]
  893. for j in flingarray[i]
  894. return i if isConst?(attacker.item,PBItems,j)
  895. end
  896. end
  897. end
  898. return 1
  899. end
  900. end
  901.  
  902. #===============================================================================
  903. # Birthsign Bonuses - Passive Effects
  904. #===============================================================================
  905. def applyBirthsignBonuses
  906. if hasBirthsign?
  907. # The Void
  908. if birthsign==0
  909. @shinyflag=nil
  910. @abilityflag=nil
  911. @genderflag=nil
  912. @zodiacflag=0
  913. end
  914. # The Companion
  915. if birthsign==2
  916. @happiness=@happiness*2
  917. end
  918. # The Savage
  919. if birthsign==4
  920. @iv[0]=0
  921. @iv[1]=31
  922. @iv[3]=31
  923. @iv[4]=31
  924. end
  925. # The Maiden
  926. if birthsign==7
  927. @ev=[0,0,0,0,150,0]
  928. if isSingleGendered?
  929. genderflag = nil
  930. elsif rand(100)<75 || $DEBUG
  931. makeFemale
  932. end
  933. end
  934. # The Gladiator
  935. if birthsign==8
  936. @ev=[0,150,0,0,0,0]
  937. if isSingleGendered?
  938. genderflag = nil
  939. elsif rand(100)<75 || $DEBUG
  940. makeMale
  941. end
  942. end
  943. # The Glutton
  944. if birthsign==11
  945. @iv[0]=31
  946. @iv[2]=31
  947. @iv[3]=0
  948. @iv[5]=31
  949. end
  950. # The Wishmaker
  951. if birthsign==12
  952. if (!isShiny? && rand(512)<1) || $DEBUG
  953. makeShiny
  954. end
  955. end
  956. end
  957. end
  958.  
  959. #########[SECTION 3 - CORE MECHANICS]##########
  960. #===============================================================================
  961. # New Zodiac
  962. #===============================================================================
  963. # Overwrites the default zodiac in PField_Time.
  964. #===============================================================================
  965. def zodiac(month,day)
  966. time=[
  967. 1,1,1,31,
  968. 2,1,2,28,
  969. 3,1,3,31,
  970. 4,1,4,30,
  971. 5,1,5,31,
  972. 6,1,6,30,
  973. 7,1,7,31,
  974. 8,1,8,31,
  975. 9,1,9,30,
  976. 10,1,10,31,
  977. 11,1,11,30,
  978. 12,1,12,31
  979. ]
  980. for i in 0...12
  981. return i if month==time[i*4] && day>=time[i*4+1]
  982. return i if month==time[i*4+2] && day<=time[i*4+2]
  983. end
  984. return 0
  985. end
  986.  
  987. #===============================================================================
  988. # Implementing Pokemon Flags - Birthsigns, Blessed, Celestial, Shiny Leaf
  989. #===============================================================================
  990. # The core components that the rest of the Birthsigns script is built on.
  991. # Overwrite sections in PokeBattle_Pokemon.
  992. #===============================================================================
  993. class PokeBattle_Pokemon
  994. attr_accessor(:zodiacflag)
  995. attr_accessor(:leafflag)
  996. attr_accessor(:celestial)
  997. attr_accessor(:blessed)
  998.  
  999. #===============================================================================
  1000. # Defining Blessed Pokemon
  1001. #===============================================================================
  1002. # Flags a Pokemon as blessed
  1003. def makeBlessed
  1004. if self.hasBirthsign?
  1005. self.blessed=true
  1006. end
  1007. end
  1008.  
  1009. # Unflags a Pokemon's blessing
  1010. def makeUnblessed
  1011. self.blessed=false
  1012. end
  1013.  
  1014. # Determines if the Pokemon is blessed
  1015. def isBlessed?
  1016. if self.blessed
  1017. return true
  1018. end
  1019. end
  1020.  
  1021. #===============================================================================
  1022. # Defining Celestial Pokemon
  1023. #===============================================================================
  1024. # Makes a Pokemon into a Celestial species
  1025. def makeCelestial
  1026. if hasBirthsign?
  1027. self.celestial=true
  1028. self.makeBlessed
  1029. self.form=30
  1030. end
  1031. end
  1032.  
  1033. # Removes the Celestial flag from a Pokemon
  1034. def removeCelestial
  1035. self.celestial=false
  1036. self.blessed=false
  1037. self.form=0
  1038. end
  1039.  
  1040. # Determines whether a Pokemon is a Celestial species
  1041. def isCelestial?
  1042. if self.celestial
  1043. return true
  1044. end
  1045. end
  1046.  
  1047. #===============================================================================
  1048. # Defining & Setting Birthsigns
  1049. #===============================================================================
  1050. # Defines birthsigns
  1051. def birthsign
  1052. return @zodiacflag if @zodiacflag!=nil
  1053. return @personalID%34
  1054. end
  1055.  
  1056. # Sets a specific birthsign on a Pokemon (0-34)
  1057. def setBirthsign(value)
  1058. if !(self.isShadow? rescue false) && !egg? && !isBlessed?
  1059. if value.is_a?(String) || value.is_a?(Symbol)
  1060. value=getID(PBBirthsigns,value)
  1061. end
  1062. if value!=nil
  1063. @zodiacflag=value
  1064. applyBirthsignBonuses
  1065. self.calcStats
  1066. end
  1067. else
  1068. return false
  1069. end
  1070. end
  1071.  
  1072. # Sets a random birthsign on a Pokemon (1-33)
  1073. def setRandomsign
  1074. randsign=(1+rand(33))
  1075. setBirthsign(randsign)
  1076. end
  1077.  
  1078. # Sets a specific zodiac sign on a Pokemon (1-12)
  1079. def setZodiacsign(value)
  1080. if !(self.isShadow? rescue false) && !egg? && !isBlessed?
  1081. if value.is_a?(String) || value.is_a?(Symbol)
  1082. value=getID(PBZodiacsigns,value)
  1083. end
  1084. if value!=nil
  1085. @zodiacflag=getZodiacList(value)
  1086. applyBirthsignBonuses
  1087. self.calcStats
  1088. end
  1089. else
  1090. return false
  1091. end
  1092. end
  1093.  
  1094. # Sets a random zodiac sign on a Pokemon
  1095. def setRandomZodiac
  1096. randsign=(1+rand(11))
  1097. setZodiacsign(randsign)
  1098. end
  1099.  
  1100. # Sets a rival sign on a Pokemon relative to (value)
  1101. def setRivalsign(value)
  1102. if !(self.isShadow? rescue false) && !egg? && !isBlessed?
  1103. if value.is_a?(String) || value.is_a?(Symbol)
  1104. value=getID(PBZodiacsigns,value)
  1105. end
  1106. if value!=nil
  1107. @zodiacflag=getZodiacList((value+6)%12)
  1108. applyBirthsignBonuses
  1109. self.calcStats
  1110. end
  1111. else
  1112. return false
  1113. end
  1114. end
  1115.  
  1116. # Sets a particular partner sign (num) on a Pokemon relative to (value)
  1117. def setPartnersign(value,num=nil)
  1118. if !(self.isShadow? rescue false) && !egg? && !isBlessed?
  1119. if value.is_a?(String) || value.is_a?(Symbol)
  1120. value=getID(PBZodiacsigns,value)
  1121. end
  1122. if value!=nil
  1123. randsign=rand(10)
  1124. case num
  1125. when nil,0
  1126. if randsign>5
  1127. @zodiacflag=getZodiacList((value+4)%12)
  1128. else
  1129. @zodiacflag=getZodiacList((value+8)%12)
  1130. end
  1131. when 1
  1132. @zodiacflag=getZodiacList((value+4)%12)
  1133. when 2
  1134. @zodiacflag=getZodiacList((value+8)%12)
  1135. end
  1136. applyBirthsignBonuses
  1137. self.calcStats
  1138. end
  1139. else
  1140. return false
  1141. end
  1142. end
  1143.  
  1144. #===============================================================================
  1145. # Defining Shiny Leaf
  1146. #===============================================================================
  1147. # Defines shiny leaf
  1148. def shinyleaf
  1149. return @leafflag if @leafflag!=nil
  1150. end
  1151.  
  1152. # Sets a number of shiny leaves on a Pokemon. 6 leaves make a crown.
  1153. def setShinyLeaf(value)
  1154. if !egg?
  1155. @leafflag=value
  1156. end
  1157. end
  1158.  
  1159. # Adds 1 shiny leaf to a Pokemon's total, up to 6.
  1160. def addShinyLeaf
  1161. if !egg?
  1162. if @leafflag==nil
  1163. setShinyLeaf(0)
  1164. elsif @leafflag<0
  1165. @leafflag+=-@leafflag
  1166. end
  1167. if @leafflag<6
  1168. @leafflag+=1
  1169. end
  1170. end
  1171. end
  1172.  
  1173. # Subtracts 1 shiny leaf from a Pokemon's total, down to 0.
  1174. def removeShinyLeaf
  1175. if @leafflag==nil
  1176. setShinyLeaf(0)
  1177. elsif @leafflag>6
  1178. @leafflag-=self.leafflag
  1179. @leafflag+=6
  1180. end
  1181. if @leafflag>0
  1182. @leafflag-=1
  1183. end
  1184. end
  1185.  
  1186. # Checks to see if the Pokemon has a leaf crown.
  1187. def hasLeafCrown?
  1188. if @leafflag==6 || @leafflag>6
  1189. return true
  1190. end
  1191. end
  1192. #===============================================================================
  1193.  
  1194. alias birthsign_initialize initialize
  1195. def initialize(*args)
  1196. birthsign_initialize(*args)
  1197. #===========================================================================
  1198. # Newly generated Pokemon have all flags set to neutral
  1199. #===========================================================================
  1200. @zodiacflag = 0
  1201. @leafflag = 0
  1202. @celestial = false
  1203. @blessed = false
  1204. #===========================================================================
  1205. end
  1206. end
  1207.  
  1208. #===============================================================================
  1209. # Birthsigns for Player and Trainers
  1210. #===============================================================================
  1211. class PokeBattle_Trainer
  1212. attr_accessor(:zodiacflag)
  1213. attr_accessor(:blessed)
  1214. attr_accessor(:celestialcheck)
  1215.  
  1216. #===============================================================================
  1217. # Blessed Trainer Signs
  1218. #===============================================================================
  1219. def makeBlessed
  1220. if self.birthsign>0
  1221. self.blessed=true
  1222. end
  1223. end
  1224.  
  1225. def makeUnblessed
  1226. self.blessed=false
  1227. end
  1228.  
  1229. def isBlessed?
  1230. if self.blessed
  1231. return true
  1232. end
  1233. end
  1234.  
  1235. #===============================================================================
  1236. # Defining Trainer Signs
  1237. #===============================================================================
  1238. def birthsign
  1239. return @zodiacflag if @zodiacflag!=nil
  1240. end
  1241.  
  1242. def setBirthsign(value)
  1243. if !isBlessed?
  1244. if value.is_a?(String) || value.is_a?(Symbol)
  1245. value=getID(PBBirthsigns,value)
  1246. end
  1247. if value!=0 || value!=nil
  1248. @zodiacflag=value
  1249. end
  1250. end
  1251. end
  1252.  
  1253. def setRandomsign
  1254. randsign=(1+rand(33))
  1255. setBirthsign(randsign)
  1256. end
  1257.  
  1258. def setZodiacsign(value)
  1259. if !isBlessed?
  1260. if value.is_a?(String) || value.is_a?(Symbol)
  1261. value=getID(PBZodiacsigns,value)
  1262. end
  1263. if value!=0 || value!=nil
  1264. @zodiacflag=getZodiacList(value)
  1265. end
  1266. end
  1267. end
  1268.  
  1269. def setRandomZodiac
  1270. randsign=rand(12)
  1271. setZodiacsign(randsign)
  1272. end
  1273.  
  1274. def setRivalsign(value)
  1275. if !isBlessed?
  1276. if value.is_a?(String) || value.is_a?(Symbol)
  1277. value=getID(PBZodiacsigns,value)
  1278. end
  1279. if value!=0 || value!=nil
  1280. @zodiacflag=getZodiacList((value+6)%12)
  1281. end
  1282. end
  1283. end
  1284.  
  1285. def setPartnersign(value,num=nil)
  1286. if !isBlessed?
  1287. if value.is_a?(String) || value.is_a?(Symbol)
  1288. value=getID(PBZodiacsigns,value)
  1289. end
  1290. if value!=0 || value!=nil
  1291. randsign=rand(10)
  1292. case num
  1293. when nil,0
  1294. if randsign>5
  1295. @zodiacflag=getZodiacList((value+4)%12)
  1296. else
  1297. @zodiacflag=getZodiacList((value+8)%12)
  1298. end
  1299. when 1
  1300. @zodiacflag=getZodiacList((value+4)%12)
  1301. when 2
  1302. @zodiacflag=getZodiacList((value+8)%12)
  1303. end
  1304. end
  1305. end
  1306. end
  1307.  
  1308. # Checks for any birthsign
  1309. def hasBirthsign?
  1310. if birthsign>0
  1311. return true
  1312. end
  1313. end
  1314.  
  1315. # Checks for any zodiac sign
  1316. def hasZodiacsign?
  1317. if monthsign!=nil
  1318. return true
  1319. end
  1320. end
  1321.  
  1322. # Trainer sign is set to adventure start month by default
  1323. alias birthsign_initialize initialize
  1324. def initialize(name,trainertype)
  1325. birthsign_initialize(name,trainertype)
  1326. @zodiacflag=$PokemonGlobal.startTime.mon
  1327. @blessed=false
  1328. @celestialcheck=[]
  1329. for i in 0..12
  1330. @celestialcheck[i]=nil
  1331. end
  1332. end
  1333. end
  1334.  
  1335. #===============================================================================
  1336. # Trainer Card
  1337. #===============================================================================
  1338. # Display's the trainer's birthsign on their trainer card.
  1339. #===============================================================================
  1340. class PokemonTrainerCard_Scene
  1341. alias birthsigns_TrainerCard pbDrawTrainerCardFront
  1342. def pbDrawTrainerCardFront
  1343. birthsigns_TrainerCard
  1344. #===========================================================================
  1345. # Birthsign Token graphic
  1346. #===========================================================================
  1347. overlay = @sprites["overlay"].bitmap
  1348. imagePositions = []
  1349. tokenpath1="Graphics/Pictures/Birthsigns/token%02d"
  1350. tokenpath2="Graphics/Pictures/Birthsigns/bless_token%02d"
  1351. if $Trainer.isBlessed?
  1352. zodiactoken=sprintf(tokenpath2,PBBirthsigns.signValue($Trainer.birthsign))
  1353. else
  1354. zodiactoken=sprintf(tokenpath1,PBBirthsigns.signValue($Trainer.birthsign))
  1355. end
  1356. imagePositions.push([zodiactoken,425,251,0,0,-1,-1])
  1357. #===========================================================================
  1358. pbDrawImagePositions(overlay,imagePositions)
  1359. end
  1360. end
  1361.  
  1362. #########[SECTION 4 - COMMAND SKILLS]##########
  1363. #===============================================================================
  1364. # Ritual Animation. Same as the Hidden Moves animation, with new graphics.
  1365. #===============================================================================
  1366. def pbRitualAnimation(pokemon)
  1367. return false if !pokemon
  1368. viewport=Viewport.new(0,0,0,0)
  1369. viewport.z=99999
  1370. bg=Sprite.new(viewport)
  1371. bg.bitmap=BitmapCache.load_bitmap("Graphics/Pictures/Birthsigns/Other/ritualbg")
  1372. sprite=PokemonSprite.new(viewport)
  1373. sprite.setOffset(PictureOrigin::Center)
  1374. sprite.setPokemonBitmap(pokemon)
  1375. sprite.z=1
  1376. sprite.visible=false
  1377. strobebitmap=AnimatedBitmap.new("Graphics/Pictures/Birthsigns/Other/ritualStrobes")
  1378. strobes=[]
  1379. 15.times do |i|
  1380. strobe=BitmapSprite.new(26*2,8*2,viewport)
  1381. strobe.bitmap.blt(0,0,strobebitmap.bitmap,Rect.new(0,(i%2)*8*2,26*2,8*2))
  1382. strobe.z=((i%2)==0 ? 2 : 0)
  1383. strobe.visible=false
  1384. strobes.push(strobe)
  1385. end
  1386. strobebitmap.dispose
  1387. interp=RectInterpolator.new(
  1388. Rect.new(0,Graphics.height/2,Graphics.width,0),
  1389. Rect.new(0,(Graphics.height-bg.bitmap.height)/2,Graphics.width,bg.bitmap.height),
  1390. 10)
  1391. ptinterp=nil
  1392. phase=1
  1393. frames=0
  1394. begin
  1395. Graphics.update
  1396. Input.update
  1397. sprite.update
  1398. case phase
  1399. when 1 # Expand viewport height from zero to full
  1400. interp.update
  1401. interp.set(viewport.rect)
  1402. bg.oy=(bg.bitmap.height-viewport.rect.height)/2
  1403. if interp.done?
  1404. phase=2
  1405. ptinterp=PointInterpolator.new(
  1406. Graphics.width+(sprite.bitmap.width/2),bg.bitmap.height/2,
  1407. Graphics.width/2,bg.bitmap.height/2,
  1408. 16)
  1409. end
  1410. when 2 # Slide Pokémon sprite in from right to centre
  1411. ptinterp.update
  1412. sprite.x=ptinterp.x
  1413. sprite.y=ptinterp.y
  1414. sprite.visible=true
  1415. if ptinterp.done?
  1416. phase=3
  1417. pbPlayCry(pokemon)
  1418. frames=0
  1419. end
  1420. when 3 # Wait
  1421. frames+=1
  1422. if frames>30
  1423. phase=4
  1424. ptinterp=PointInterpolator.new(
  1425. Graphics.width/2,bg.bitmap.height/2,
  1426. -(sprite.bitmap.width/2),bg.bitmap.height/2,
  1427. 16)
  1428. frames=0
  1429. end
  1430. when 4 # Slide Pokémon sprite off from centre to left
  1431. ptinterp.update
  1432. sprite.x=ptinterp.x
  1433. sprite.y=ptinterp.y
  1434. if ptinterp.done?
  1435. phase=5
  1436. sprite.visible=false
  1437. interp=RectInterpolator.new(
  1438. Rect.new(0,(Graphics.height-bg.bitmap.height)/2,Graphics.width,bg.bitmap.height),
  1439. Rect.new(0,Graphics.height/2,Graphics.width,0),
  1440. 10)
  1441. end
  1442. when 5 # Shrink viewport height from full to zero
  1443. interp.update
  1444. interp.set(viewport.rect)
  1445. bg.oy=(bg.bitmap.height-viewport.rect.height)/2
  1446. phase=6 if interp.done?
  1447. end
  1448. for strobe in strobes
  1449. strobe.ox=strobe.viewport.rect.x
  1450. strobe.oy=strobe.viewport.rect.y
  1451. if !strobe.visible
  1452. randomY=16*(1+rand(bg.bitmap.height/16-2))
  1453. strobe.y=randomY+(Graphics.height-bg.bitmap.height)/2
  1454. strobe.x=rand(Graphics.width)
  1455. strobe.visible=true
  1456. elsif strobe.x<Graphics.width
  1457. strobe.x+=32
  1458. else
  1459. randomY=16*(1+rand(bg.bitmap.height/16-2))
  1460. strobe.y=randomY+(Graphics.height-bg.bitmap.height)/2
  1461. strobe.x=-strobe.bitmap.width-rand(Graphics.width/4)
  1462. end
  1463. end
  1464. pbUpdateSceneMap
  1465. end while phase!=6
  1466. sprite.dispose
  1467. for strobe in strobes
  1468. strobe.dispose
  1469. end
  1470. strobes.clear
  1471. bg.dispose
  1472. viewport.dispose
  1473. return true
  1474. end
  1475.  
  1476. #===============================================================================
  1477. # Birthsigns - Command & Event Resets
  1478. #===============================================================================
  1479. # Counts steps to reset certain birthsign effects.
  1480. #===============================================================================
  1481. class PokemonGlobalMetadata
  1482. attr_accessor :resetBirthsignHarmonize
  1483. attr_accessor :resetBirthsignIncubate
  1484. attr_accessor :resetFortuneTeller
  1485. attr_accessor :fortuneEqual
  1486. attr_accessor :fortuneBad
  1487. attr_accessor :fortuneGood
  1488. alias new_initialize initialize
  1489. def initialize
  1490. new_initialize
  1491. @resetBirthsignHarmonize = 0
  1492. @resetBirthsignIncubate = 0
  1493. @resetFortuneTeller = 0
  1494. @fortuneEqual = false
  1495. @fortuneBad = false
  1496. @fortuneGood = false
  1497. end
  1498. end
  1499.  
  1500. Events.onStepTaken+=proc {|sender,e|
  1501. if $PokemonGlobal.resetBirthsignHarmonize && $PokemonGlobal.resetBirthsignHarmonize>0
  1502. $PokemonGlobal.resetBirthsignHarmonize -= 1
  1503. end
  1504. if $PokemonGlobal.resetBirthsignIncubate && $PokemonGlobal.resetBirthsignIncubate>0
  1505. $PokemonGlobal.resetBirthsignIncubate -= 1
  1506. end
  1507. if $PokemonGlobal.resetFortuneTeller && $PokemonGlobal.resetFortuneTeller>0
  1508. $PokemonGlobal.resetFortuneTeller -= 1
  1509. end
  1510. }
  1511. #===============================================================================
  1512. # Sets the step counter for 'The Parent' to 1,000 steps on use.
  1513. #===============================================================================
  1514. def pbCanUseBirthsignIncubate?
  1515. return true if $DEBUG && Input.press?(Input::CTRL)
  1516. if $PokemonGlobal.resetBirthsignIncubate && $PokemonGlobal.resetBirthsignIncubate>0
  1517. return false
  1518. end
  1519. return true
  1520. end
  1521.  
  1522. def pbUseBirthsignEffectIncubate
  1523. if pbCanUseBirthsignIncubate?
  1524. $PokemonGlobal.resetBirthsignIncubate = 1000
  1525. return true
  1526. end
  1527. return false
  1528. end
  1529. #===============================================================================
  1530. # Sets the step counter for 'The Bard' to 400 steps on use.
  1531. #===============================================================================
  1532. def pbCanUseBirthsignHarmonize?
  1533. return true if $DEBUG && Input.press?(Input::CTRL)
  1534. if $PokemonGlobal.resetBirthsignHarmonize && $PokemonGlobal.resetBirthsignHarmonize>0
  1535. return false
  1536. end
  1537. return true
  1538. end
  1539.  
  1540. def pbUseBirthsignEffectHarmonize
  1541. if pbCanUseBirthsignHarmonize?
  1542. $PokemonGlobal.resetBirthsignHarmonize = 400
  1543. return true
  1544. end
  1545. return false
  1546. end
  1547. #===============================================================================
  1548. # Sets the step counter for the Fortune Teller effect to 2,500 steps on use.
  1549. #===============================================================================
  1550. def pbFortuneEffectActive?
  1551. if $PokemonGlobal.resetFortuneTeller && $PokemonGlobal.resetFortuneTeller>0
  1552. return true
  1553. else
  1554. return false
  1555. end
  1556. end
  1557.  
  1558. def pbActivateFortuneEffect
  1559. $PokemonGlobal.resetFortuneTeller = 2500
  1560. end
  1561.  
  1562. #===============================================================================
  1563. # Birthsign Command Checks
  1564. #===============================================================================
  1565. # Returns true if the user has a particular command through a birthsign.
  1566. # Used to eliminate redundant commands.
  1567. #===============================================================================
  1568. # The Beacon
  1569. def hasStarlightCmd?
  1570. if hasZodiacsign? && birthsign==3
  1571. return true
  1572. end
  1573. end
  1574.  
  1575. # The Martyr
  1576. def hasRescueCmd?
  1577. if hasZodiacsign? && birthsign==6
  1578. return true
  1579. end
  1580. end
  1581.  
  1582. # The Voyager
  1583. def hasNavigateCmd?
  1584. if hasZodiacsign? && birthsign==9
  1585. return true
  1586. end
  1587. end
  1588.  
  1589. # The Fugitive
  1590. def hasEscapeCmd?
  1591. if hasZodiacsign? && birthsign==15
  1592. return true
  1593. end
  1594. end
  1595.  
  1596. # The Bard
  1597. def hasHarmonizeCmd?
  1598. if hasZodiacsign? && birthsign==25
  1599. return true
  1600. end
  1601. end
  1602.  
  1603. #===============================================================================
  1604. # Birthsign Commands
  1605. #===============================================================================
  1606. # This section overwrites the section in PScreen_Party that creates command
  1607. # menu options.
  1608. #===============================================================================
  1609. class Window_CommandPokemonColor < Window_CommandPokemon
  1610. def drawItem(index,count,rect)
  1611. pbSetSystemFont(self.contents) if @starting
  1612. rect = drawCursor(index,rect)
  1613. base = self.baseColor
  1614. shadow = self.shadowColor
  1615. if @colorKey[index] && @colorKey[index]==1
  1616. base = Color.new(0,80,160)
  1617. shadow = Color.new(128,192,240)
  1618. end
  1619. #===========================================================================
  1620. # Color coats birthsign commands
  1621. #===========================================================================
  1622. # Colors usable commands purple
  1623. if @colorKey[index] && @colorKey[index]==2
  1624. base = Color.new(149,33,246)
  1625. shadow = Color.new(261,161,326)
  1626. end
  1627. # Colors unusable commands grey
  1628. if @colorKey[index] && @colorKey[index]==3
  1629. base = Color.new(184,184,184)
  1630. shadow = Color.new(96,96,96)
  1631. end
  1632. #===========================================================================
  1633. pbDrawShadowText(self.contents,rect.x,rect.y,rect.width,rect.height,@commands[index],base,shadow)
  1634. end
  1635. end
  1636.  
  1637. class PokemonPartyScreen
  1638. def pbPokemonScreen
  1639. @scene.pbStartScene(@party,
  1640. (@party.length>1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."),nil)
  1641. loop do
  1642. @scene.pbSetHelpText((@party.length>1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."))
  1643. pkmnid = @scene.pbChoosePokemon(false,-1,1)
  1644. break if (pkmnid.is_a?(Numeric) && pkmnid<0) || (pkmnid.is_a?(Array) && pkmnid[1]<0)
  1645. if pkmnid.is_a?(Array) && pkmnid[0]==1 # Switch
  1646. @scene.pbSetHelpText(_INTL("Move to where?"))
  1647. oldpkmnid = pkmnid[1]
  1648. pkmnid = @scene.pbChoosePokemon(true,-1,2)
  1649. if pkmnid>=0 && pkmnid!=oldpkmnid
  1650. pbSwitch(oldpkmnid,pkmnid)
  1651. end
  1652. next
  1653. end
  1654. pkmn = @party[pkmnid]
  1655. commands = []
  1656. cmdSummary = -1
  1657. cmdDebug = -1
  1658. cmdMoves = [-1,-1,-1,-1]
  1659. cmdSwitch = -1
  1660. cmdMail = -1
  1661. cmdItem = -1
  1662. #=========================================================================
  1663. # Celestial Commands
  1664. #=========================================================================
  1665. cmdBlessing = -1
  1666. #=========================================================================
  1667. # Birthsigns Commands
  1668. #=========================================================================
  1669. cmdStarlight = -1
  1670. cmdAbilitySwap = -1
  1671. cmdRescue = -1
  1672. cmdNavigate = -1
  1673. cmdRebirth = -1
  1674. cmdEscape = -1
  1675. cmdCure = -1
  1676. cmdTrance = -1
  1677. cmdInherit = -1
  1678. cmdIncubate = -1
  1679. cmdReroll = -1
  1680. cmdReincarnate = -1
  1681. cmdHarmonize = -1
  1682. cmdBond = -1
  1683. cmdGambit = -1
  1684. cmdLunacy = -1
  1685. cmdTransmute = -1
  1686. cmdSummon = -1
  1687. #=========================================================================
  1688. # Build the commands
  1689. commands[cmdSummary = commands.length] = _INTL("Summary")
  1690. commands[cmdDebug = commands.length] = _INTL("Debug") if $DEBUG
  1691. for i in 0...pkmn.moves.length
  1692. move = pkmn.moves[i]
  1693. # Check for hidden moves and add any that were found
  1694. if !pkmn.egg? &&
  1695. #=====================================================================
  1696. # HM's - Creates commands for HM moves in the party menu.
  1697. #=====================================================================
  1698. (isConst?(move.id,PBMoves,:CUT) ||
  1699. isConst?(move.id,PBMoves,:FLY) ||
  1700. isConst?(move.id,PBMoves,:SURF) ||
  1701. isConst?(move.id,PBMoves,:STRENGTH) ||
  1702. isConst?(move.id,PBMoves,:ROCKSMASH) ||
  1703. isConst?(move.id,PBMoves,:WATERFALL) ||
  1704. isConst?(move.id,PBMoves,:DIVE) ||
  1705. #=====================================================================
  1706. # Other field commands - Creates commands for other field moves.
  1707. #=====================================================================
  1708. isConst?(move.id,PBMoves,:MILKDRINK) ||
  1709. isConst?(move.id,PBMoves,:HEADBUTT) ||
  1710. isConst?(move.id,PBMoves,:CHATTER) ||
  1711. #=====================================================================
  1712. # Unsupported commands as of Essentials v17.
  1713. # Remove comment tag from field moves you've added yourself.
  1714. # Any custom field moves must be added to this list.
  1715. #=====================================================================
  1716. #isConst?(move.id,PBMoves,:WHIRLPOOL) ||
  1717. #isConst?(move.id,PBMoves,:ROCKCLIMB) ||
  1718. #isConst?(move.id,PBMoves,:SECRETPOWER) ||
  1719. #isConst?(move.id,PBMoves,:DEFOG) ||
  1720. #=====================================================================
  1721. # Birthsign commands - Hides redundant birthsign commands.
  1722. # Adds field commands otherwise.
  1723. #=====================================================================
  1724. # The Beacon
  1725. (isConst?(move.id,PBMoves,:FLASH) && !pkmn.hasStarlightCmd?) ||
  1726. # The Martyr
  1727. (isConst?(move.id,PBMoves,:SOFTBOILED) && !pkmn.hasRescueCmd?) ||
  1728. # The Voyager
  1729. (isConst?(move.id,PBMoves,:TELEPORT) && !pkmn.hasNavigateCmd?) ||
  1730. # The Fugitive
  1731. (isConst?(move.id,PBMoves,:DIG) && !pkmn.hasEscapeCmd?) ||
  1732. # The Bard
  1733. (isConst?(move.id,PBMoves,:SWEETSCENT) && !pkmn.hasHarmonizeCmd?))
  1734. #=====================================================================
  1735. commands[cmdMoves[i] = commands.length] = [PBMoves.getName(move.id),1]
  1736. end
  1737. end
  1738. # Pokemon Following compatibility
  1739. if defined? pbToggleFollowingPokemon
  1740. follower=($game_player.pbHasDependentEvents? && !$game_switches[Following_Activated_Switch])
  1741. else
  1742. follower=$game_player.pbHasDependentEvents?
  1743. end
  1744. #=========================================================================
  1745. # Celestial Pokemon - Blessing Command
  1746. #=========================================================================
  1747. if pkmn.hasBirthsign? && pkmn.isCelestial?
  1748. if $Trainer.party.length<=1
  1749. commands[cmdBlessing = commands.length] = [_INTL("Blessing"),3]
  1750. else
  1751. commands[cmdBlessing = commands.length] = [_INTL("Blessing"),2]
  1752. end
  1753. end
  1754. #=========================================================================
  1755. # Birthsign Commands
  1756. #=========================================================================
  1757. # The Beacon
  1758. if pkmn.hasBirthsign? && pkmn.birthsign==3
  1759. if !pbGetMetadata($game_map.map_id,MetadataDarkMap) || $PokemonGlobal.flashUsed
  1760. commands[cmdStarlight = commands.length] = [_INTL("Starlight"),3]
  1761. else
  1762. commands[cmdStarlight = commands.length] = [_INTL("Starlight"),2]
  1763. end
  1764. end
  1765. # The Prodigy
  1766. abils=pkmn.getAbilityList
  1767. if pkmn.hasBirthsign? && pkmn.birthsign==5 && abils.length>1
  1768. commands[cmdAbilitySwap = commands.length] = [_INTL("Ability Swap"),2]
  1769. end
  1770. # The Martyr
  1771. if pkmn.hasBirthsign? && pkmn.birthsign==6
  1772. if pkmn.hp<=(pkmn.totalhp/5).floor || $Trainer.party.length<=1
  1773. commands[cmdRescue = commands.length] = [_INTL("Rescue"),3]
  1774. else
  1775. commands[cmdRescue = commands.length] = [_INTL("Rescue"),2]
  1776. end
  1777. end
  1778. # The Voyager
  1779. if pkmn.hasBirthsign? && pkmn.birthsign==9
  1780. if !pbGetMetadata($game_map.map_id,MetadataOutdoor) || follower
  1781. commands[cmdNavigate = commands.length] = [_INTL("Navigate"),3]
  1782. else
  1783. commands[cmdNavigate = commands.length] = [_INTL("Navigate"),2]
  1784. end
  1785. end
  1786. # The Phoenix
  1787. if pkmn.hasBirthsign? && pkmn.birthsign==13
  1788. if !pkmn.fainted?
  1789. commands[cmdRebirth = commands.length] = [_INTL("Rebirth"),3]
  1790. else
  1791. commands[cmdRebirth = commands.length] = [_INTL("Rebirth"),2]
  1792. end
  1793. end
  1794. # The Fugitive
  1795. if pkmn.hasBirthsign? && pkmn.birthsign==15
  1796. escape=($PokemonGlobal.escapePoint rescue nil)
  1797. outdoors=pbGetMetadata($game_map.map_id,MetadataOutdoor)
  1798. if !escape || escape==[] || outdoors || follower
  1799. commands[cmdEscape = commands.length] = [_INTL("Escape"),3]
  1800. else
  1801. commands[cmdEscape = commands.length] = [_INTL("Escape"),2]
  1802. end
  1803. end
  1804. # The Cleric
  1805. if pkmn.hasBirthsign? && pkmn.birthsign==17
  1806. if pkmn.hp<=(pkmn.totalhp/5).floor || $Trainer.party.length<=1
  1807. commands[cmdCure = commands.length] = [_INTL("Cure"),3]
  1808. else
  1809. commands[cmdCure = commands.length] = [_INTL("Cure"),2]
  1810. end
  1811. end
  1812. # The Monk
  1813. if pkmn.hasBirthsign? && pkmn.birthsign==18
  1814. if pbGetRelearnableMoves(pkmn).length<=0
  1815. commands[cmdTrance = commands.length] = [_INTL("Trance"),3]
  1816. else
  1817. commands[cmdTrance = commands.length] = [_INTL("Trance"),2]
  1818. end
  1819. end
  1820. # The Ancestor
  1821. dexdata=pbOpenDexData
  1822. pbDexDataOffset(dexdata,pkmn.species,31)
  1823. compat10=dexdata.fgetb
  1824. compat11=dexdata.fgetb
  1825. if pkmn.hasBirthsign? && pkmn.birthsign==19 && (pkmn.isCelestial? || compat10==0)
  1826. totalev=0
  1827. for k in 0...6
  1828. totalev+=pkmn.ev[k]
  1829. end
  1830. if totalev==0 || pkmn.fainted?
  1831. commands[cmdInherit = commands.length] = [_INTL("Inherit"),3]
  1832. else
  1833. commands[cmdInherit = commands.length] = [_INTL("Inherit"),2]
  1834. end
  1835. end
  1836. # The Specialist
  1837. if pkmn.hasBirthsign? && pkmn.birthsign==20
  1838. if pkmn.fainted?
  1839. commands[cmdReroll = commands.length] = [_INTL("Re-roll"),3]
  1840. else
  1841. commands[cmdReroll = commands.length] = [_INTL("Re-roll"),2]
  1842. end
  1843. end
  1844. # The Parent
  1845. if pkmn.hasBirthsign? && pkmn.birthsign==22
  1846. if $Trainer.party.length<=1 || !pbCanUseBirthsignIncubate?
  1847. commands[cmdIncubate = commands.length] = [_INTL("Incubate"),3]
  1848. else
  1849. commands[cmdIncubate = commands.length] = [_INTL("Incubate"),2]
  1850. end
  1851. end
  1852. # The Eternal
  1853. if pkmn.hasBirthsign? && pkmn.birthsign==24
  1854. if pkmn.hasCurrentsign? && !pkmn.isCelestial
  1855. commands[cmdReincarnate = commands.length] = [_INTL("Reincarnate"),3]
  1856. else
  1857. commands[cmdReincarnate = commands.length] = [_INTL("Reincarnate"),2]
  1858. end
  1859. end
  1860. # The Bard
  1861. if pkmn.hasBirthsign? && pkmn.birthsign==25
  1862. if !pbCanUseBirthsignHarmonize? || $game_screen.weather_type!=PBFieldWeather::None ||
  1863. !$PokemonEncounters.isEncounterPossibleHere?
  1864. commands[cmdHarmonize = commands.length] = [_INTL("Harmonize"),3]
  1865. else
  1866. commands[cmdHarmonize = commands.length] = [_INTL("Harmonize"),2]
  1867. end
  1868. end
  1869. # The Empath
  1870. if pkmn.hasBirthsign? && pkmn.birthsign==26
  1871. if $Trainer.party.length<=1
  1872. commands[cmdBond = commands.length] = [_INTL("Bond"),3]
  1873. else
  1874. commands[cmdBond = commands.length] = [_INTL("Bond"),2]
  1875. end
  1876. end
  1877. # The Tactician
  1878. if pkmn.hasBirthsign? && pkmn.birthsign==28
  1879. totalev=0
  1880. for k in 0...6
  1881. totalev+=pkmn.ev[k]
  1882. end
  1883. if totalev!=PokeBattle_Pokemon::EVLIMIT || pkmn.fainted?
  1884. commands[cmdGambit = commands.length] = [_INTL("Gambit"),3]
  1885. else
  1886. commands[cmdGambit = commands.length] = [_INTL("Gambit"),2]
  1887. end
  1888. end
  1889. # The Fool
  1890. if pkmn.hasBirthsign? && pkmn.birthsign==29
  1891. if pkmn.level<5 || pkmn.fainted? || $Trainer.party.length<=1
  1892. commands[cmdLunacy = commands.length] = [_INTL("Lunacy"),3]
  1893. else
  1894. commands[cmdLunacy = commands.length] = [_INTL("Lunacy"),2]
  1895. end
  1896. end
  1897. # The Alchemist
  1898. if pkmn.hasBirthsign? && pkmn.birthsign==30
  1899. if !pkmn.hasItem? || !$PokemonBag.pbHasItem?(:STARDUST)
  1900. commands[cmdTransmute = commands.length] = [_INTL("Transmute"),3]
  1901. else
  1902. commands[cmdTransmute = commands.length] = [_INTL("Transmute"),2]
  1903. end
  1904. end
  1905. # The Cultist
  1906. totalIVs=(pkmn.iv[0]+pkmn.iv[1]+pkmn.iv[2]+pkmn.iv[3]+pkmn.iv[4]+pkmn.iv[5])
  1907. if pkmn.hasBirthsign? && pkmn.birthsign==33
  1908. if (!PBDayNight.isNight? && !$DEBUG) || totalIVs==0 || follower
  1909. commands[cmdSummon = commands.length] = [_INTL("Summon"),3]
  1910. else
  1911. commands[cmdSummon = commands.length] = [_INTL("Summon"),2]
  1912. end
  1913. end
  1914. #=========================================================================
  1915. commands[cmdSwitch = commands.length] = _INTL("Switch") if @party.length>1
  1916. if !pkmn.egg?
  1917. if pkmn.mail
  1918. commands[cmdMail = commands.length] = _INTL("Mail")
  1919. else
  1920. commands[cmdItem = commands.length] = _INTL("Item")
  1921. end
  1922. end
  1923. commands[commands.length] = _INTL("Cancel")
  1924. command = @scene.pbShowCommands(_INTL("Do what with {1}?",pkmn.name),commands)
  1925. havecommand = false
  1926. for i in 0...4
  1927. if cmdMoves[i]>=0 && command==cmdMoves[i]
  1928. havecommand = true
  1929. if isConst?(pkmn.moves[i].id,PBMoves,:SOFTBOILED) ||
  1930. isConst?(pkmn.moves[i].id,PBMoves,:MILKDRINK)
  1931. amt = [(pkmn.totalhp/5).floor,1].max
  1932. if pkmn.hp<=amt
  1933. pbDisplay(_INTL("Not enough HP..."))
  1934. break
  1935. end
  1936. @scene.pbSetHelpText(_INTL("Use on which Pokémon?"))
  1937. oldpkmnid = pkmnid
  1938. loop do
  1939. @scene.pbPreSelect(oldpkmnid)
  1940. pkmnid = @scene.pbChoosePokemon(true,pkmnid)
  1941. break if pkmnid<0
  1942. newpkmn = @party[pkmnid]
  1943. movename = PBMoves.getName(pkmn.moves[i].id)
  1944. if pkmnid==oldpkmnid
  1945. pbDisplay(_INTL("{1} can't use {2} on itself!",pkmn.name,movename))
  1946. elsif newpkmn.egg?
  1947. pbDisplay(_INTL("{1} can't be used on an Egg!",movename))
  1948. elsif newpkmn.hp==0 || newpkmn.hp==newpkmn.totalhp
  1949. pbDisplay(_INTL("{1} can't be used on that Pokémon.",movename))
  1950. else
  1951. pkmn.hp -= amt
  1952. hpgain = pbItemRestoreHP(newpkmn,amt)
  1953. @scene.pbDisplay(_INTL("{1}'s HP was restored by {2} points.",newpkmn.name,hpgain))
  1954. pbRefresh
  1955. end
  1956. break if pkmn.hp<=amt
  1957. end
  1958. @scene.pbSelect(oldpkmnid)
  1959. pbRefresh
  1960. break
  1961. elsif Kernel.pbCanUseHiddenMove?(pkmn,pkmn.moves[i].id)
  1962. if Kernel.pbConfirmUseHiddenMove(pkmn,pkmn.moves[i].id)
  1963. @scene.pbEndScene
  1964. if isConst?(pkmn.moves[i].id,PBMoves,:FLY)
  1965. scene = PokemonRegionMap_Scene.new(-1,false)
  1966. screen = PokemonRegionMapScreen.new(scene)
  1967. ret = screen.pbStartFlyScreen
  1968. if ret
  1969. $PokemonTemp.flydata=ret
  1970. return [pkmn,pkmn.moves[i].id]
  1971. end
  1972. @scene.pbStartScene(@party,
  1973. (@party.length>1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."))
  1974. break
  1975. end
  1976. return [pkmn,pkmn.moves[i].id]
  1977. end
  1978. else
  1979. break
  1980. end
  1981. end
  1982. end
  1983. next if havecommand
  1984. if cmdSummary>=0 && command==cmdSummary
  1985. @scene.pbSummary(pkmnid)
  1986. elsif cmdDebug>=0 && command==cmdDebug
  1987. pbPokemonDebug(pkmn,pkmnid)
  1988. elsif cmdSwitch>=0 && command==cmdSwitch
  1989. @scene.pbSetHelpText(_INTL("Move to where?"))
  1990. oldpkmnid = pkmnid
  1991. pkmnid = @scene.pbChoosePokemon(true)
  1992. if pkmnid>=0 && pkmnid!=oldpkmnid
  1993. pbSwitch(oldpkmnid,pkmnid)
  1994. end
  1995. #===============================================================================
  1996. # Celestial Pokemon
  1997. # Blessing Skill effect: Bestows the user's birthsign onto other party members.
  1998. #===============================================================================
  1999. elsif cmdBlessing>=0 && command==cmdBlessing
  2000. if $Trainer.party.length<=1
  2001. Kernel.pbMessage(_INTL("But there aren't any other Pokémon in the party!"))
  2002. elsif !pkmn.hasBirthsign?
  2003. Kernel.pbMessage(_INTL("Doesn't have a birthsign to bestow!"))
  2004. else
  2005. if Kernel.pbConfirmMessage(_INTL("Activate {1}'s power?",pkmn.name))
  2006. Kernel.pbMessage(_INTL("Choose a Pokémon for {1} to bless.",pkmn.name))
  2007. @scene.pbSetHelpText(_INTL("Bless with which Pokémon?"))
  2008. oldpkmnid=pkmnid
  2009. loop do
  2010. @scene.pbPreSelect(oldpkmnid)
  2011. pkmnid=@scene.pbChoosePokemon(true,pkmnid)
  2012. break if pkmnid<0
  2013. newpkmn=@party[pkmnid]
  2014. if pkmnid==oldpkmnid
  2015. Kernel.pbMessage(_INTL("{1} can't bless itself!",pkmn.name))
  2016. elsif newpkmn.egg?
  2017. Kernel.pbMessage(_INTL("This power cannot be used on eggs!"))
  2018. elsif (newpkmn.isShadow? rescue false)
  2019. Kernel.pbMessage(_INTL("Shadow Pokémon cannot be blessed."))
  2020. elsif newpkmn.isCelestial?
  2021. Kernel.pbMessage(_INTL("Celestial Pokémon cannot be blessed."))
  2022. elsif pbShareBirthsign?(pkmn,newpkmn)
  2023. Kernel.pbMessage(_INTL("{1} already has that birthsign!",newpkmn.name))
  2024. elsif newpkmn.isBlessed?
  2025. Kernel.pbMessage(_INTL("{1} has already been blessed!",newpkmn.name))
  2026. else
  2027. if newpkmn.hasBirthsign?
  2028. Kernel.pbMessage(_INTL("Using this power on {1} will replace its current birthsign, and prevent it from receiving another blessing.",newpkmn.name))
  2029. pbWait(10)
  2030. if Kernel.pbConfirmMessage(_INTL("Are you sure you want to bless {1}?",newpkmn.name))
  2031. pbRitualAnimation(pkmn)
  2032. pbWait(1)
  2033. Kernel.pbMessage(_INTL("{1} lost the power of <c2=65467b14>{2}</c2>...",newpkmn.name,newpkmn.pbGetBirthsignName))
  2034. Kernel.pbMessage(_INTL("And..."))
  2035. newpkmn.setBirthsign(pkmn.birthsign)
  2036. newpkmn.makeBlessed
  2037. pbRefresh
  2038. pbMEPlay("Evolution success")
  2039. Kernel.pbMessage(_INTL("\\se[]{1} was blessed with the power of <c2=65467b14>{2}</c2>!\\wt[80]",
  2040. newpkmn.name,newpkmn.pbGetBirthsignName))
  2041. pbWait(2)
  2042. end
  2043. else
  2044. Kernel.pbMessage(_INTL("Once blessed, {1} won't be able to receive another blessing.",newpkmn.name))
  2045. if Kernel.pbConfirmMessage(_INTL("Are you sure you want to bless {1}?",newpkmn.name))
  2046. pbRitualAnimation(pkmn)
  2047. newpkmn.setBirthsign(pkmn.birthsign)
  2048. newpkmn.makeBlessed
  2049. pbRefresh
  2050. pbWait(1)
  2051. pbMEPlay("Pkmn get")
  2052. Kernel.pbMessage(_INTL("{1} was blessed with the power of <c2=65467b14>{2}</c2>!",
  2053. newpkmn.name,newpkmn.pbGetBirthsignName))
  2054. pbWait(2)
  2055. end
  2056. end
  2057. end
  2058. break
  2059. end
  2060. pbRefresh
  2061. end
  2062. end
  2063. #===============================================================================
  2064. # Birthsigns - The Beacon
  2065. # Starlight Skill effect: Mimics the effect of 'Flash'.
  2066. #===============================================================================
  2067. elsif cmdStarlight>=0 && command==cmdStarlight
  2068. if !pbGetMetadata($game_map.map_id,MetadataDarkMap) || $PokemonGlobal.flashUsed
  2069. Kernel.pbMessage(_INTL("It's already well-lit here!"))
  2070. else
  2071. if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
  2072. @scene.pbEndScene
  2073. darkness=$PokemonTemp.darknessSprite
  2074. return false if !darkness || darkness.disposed?
  2075. if !pbRitualAnimation(pkmn)
  2076. Kernel.pbMessage(_INTL("A twinkling starlight surrounded {1}!",pkmn.name))
  2077. end
  2078. $PokemonGlobal.flashUsed=true
  2079. pbWait(1)
  2080. pbSEPlay("Vs flash")
  2081. Kernel.pbMessage(_INTL("{1} brightened the area by using the power of <c2=65467b14>{2}</c2>!",
  2082. pkmn.name,pkmn.pbGetBirthsignName))
  2083. pbWait(2)
  2084. while darkness.radius<176
  2085. Graphics.update
  2086. Input.update
  2087. pbUpdateSceneMap
  2088. darkness.radius+=4
  2089. end
  2090. pbRefresh
  2091. break
  2092. end
  2093. end
  2094. #===============================================================================
  2095. # Birthsigns - The Prodigy
  2096. # Ability Swap Skill effect: Swaps to another of the users's Abilities.
  2097. #===============================================================================
  2098. elsif cmdAbilitySwap>=0 && command==cmdAbilitySwap
  2099. abils=pkmn.getAbilityList
  2100. oldabil=PBAbilities.getName(pkmn.ability)
  2101. if abils.length<=1
  2102. Kernel.pbMessage(_INTL("But {1} only has the {2} ability!",
  2103. pkmn.name,PBAbilities.getName(pkmn.ability)))
  2104. else
  2105. if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
  2106. Kernel.pbMessage(_INTL("Choose an ability to swap to."))
  2107. cmd=0
  2108. loop do
  2109. commands=[]
  2110. for i in abils
  2111. commands.push((i[1]<2 ? "" : "(H) ")+PBAbilities.getName(i[0]))
  2112. end
  2113. commands.push(_INTL("Cancel"))
  2114. msg=[_INTL("Active ability: \n{1}",oldabil),
  2115. _INTL("Active ability: \n{1}",oldabil)][pkmn.abilityflag!=nil ? 1 : 0]
  2116. cmd=@scene.pbShowCommands(msg,commands,cmd)
  2117. break if cmd==-1
  2118. if cmd>=0 && cmd<abils.length
  2119. pkmn.setAbility(abils[cmd][1])
  2120. pbRitualAnimation(pkmn)
  2121. pbWait(1)
  2122. pbMEPlay("Pkmn get")
  2123. Kernel.pbMessage(_INTL("{1} swapped abilities with the power of <c2=65467b14>{2}</c2>!",
  2124. pkmn.name,pkmn.pbGetBirthsignName))
  2125. pbWait(2)
  2126. break
  2127. end
  2128. end
  2129. end
  2130. pbRefresh
  2131. end
  2132. #===============================================================================
  2133. # Birthsigns - The Martyr
  2134. # Rescue Skill effect: Mimics the effect of 'Soft-Boiled'.
  2135. #===============================================================================
  2136. elsif cmdRescue>=0 && command==cmdRescue
  2137. if $Trainer.party.length<=1
  2138. Kernel.pbMessage(_INTL("But there aren't any other Pokémon in the party!"))
  2139. elsif pkmn.hp<=(pkmn.totalhp/5).floor
  2140. Kernel.pbMessage(_INTL("{1} is too weak to rescue its allies!",pkmn.name))
  2141. else
  2142. if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
  2143. pbRitualAnimation(pkmn)
  2144. Kernel.pbMessage(_INTL("Choose a Pokémon for {1} to rescue.",pkmn.name))
  2145. @scene.pbSetHelpText(_INTL("Rescue which Pokémon?"))
  2146. oldpkmnid=pkmnid
  2147. loop do
  2148. @scene.pbPreSelect(oldpkmnid)
  2149. pkmnid=@scene.pbChoosePokemon(true,pkmnid)
  2150. break if pkmnid<0
  2151. newpkmn=@party[pkmnid]
  2152. if pkmnid==oldpkmnid
  2153. Kernel.pbMessage(_INTL("{1} can't rescue itself!",pkmn.name))
  2154. elsif newpkmn.egg?
  2155. Kernel.pbMessage(_INTL("This power can't be used on eggs!"))
  2156. elsif newpkmn.hp==0
  2157. Kernel.pbMessage(_INTL("It's too late to rescue that Pokémon..."))
  2158. elsif newpkmn.hp==newpkmn.totalhp
  2159. Kernel.pbMessage(_INTL("That Pokémon doesn't need rescuing!"))
  2160. else
  2161. pkmn.hp-=(pkmn.totalhp/5).floor
  2162. hpgain=pbItemRestoreHP(newpkmn,(pkmn.totalhp/5).floor)
  2163. pbRefresh
  2164. pbWait(1)
  2165. pbMEPlay("Pkmn get")
  2166. @scene.pbDisplay(_INTL("{1}'s HP was restored by the power of <c2=65467b14>{2}</c2>!",
  2167. newpkmn.name,pkmn.pbGetBirthsignName))
  2168. pbWait(20)
  2169. end
  2170. break if pkmn.hp<=(pkmn.totalhp/5).floor
  2171. end
  2172. pbRefresh
  2173. end
  2174. end
  2175. #===============================================================================
  2176. # Birthsigns - The Voyager
  2177. # Navigate Skill effect: Mimics the effect of 'Teleport'.
  2178. #===============================================================================
  2179. elsif cmdNavigate>=0 && command==cmdNavigate
  2180. if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
  2181. Kernel.pbMessage(_INTL("{1} can't find any stars to navigate with in here!",pkmn.name))
  2182. elsif follower
  2183. Kernel.pbMessage(_INTL("This power can't be used when you have someone with you."))
  2184. else
  2185. if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
  2186. healing=$PokemonGlobal.healingSpot
  2187. if !healing
  2188. healing=pbGetMetadata(0,MetadataHome) # Home
  2189. elsif healing
  2190. mapname=pbGetMapNameFromId(healing[0])
  2191. if Kernel.pbConfirmMessage(_INTL("Navigate to <c2=65467b14>{1}</c2>?",mapname))
  2192. @scene.pbEndScene
  2193. if !pbRitualAnimation(pkmn)
  2194. pbWait(1)
  2195. Kernel.pbMessage(_INTL("{1} led you to safety!",pkmn.name))
  2196. end
  2197. pbFadeOutIn(99999){
  2198. pbSEPlay("Battle flee")
  2199. Kernel.pbCancelVehicles
  2200. $game_temp.player_new_map_id=healing[0]
  2201. $game_temp.player_new_x=healing[1]
  2202. $game_temp.player_new_y=healing[2]
  2203. $game_temp.player_new_direction=2
  2204. $scene.transfer_player
  2205. $game_map.autoplay
  2206. $game_map.refresh
  2207. }
  2208. pbEraseEscapePoint
  2209. pbWait(2)
  2210. Kernel.pbMessage(_INTL("You returned to <c2=65467b14>{1}</c2> using the power of <c2=65467b14>{2}</c2>!",
  2211. mapname,pkmn.pbGetBirthsignName))
  2212. pbRefresh
  2213. break
  2214. end
  2215. end
  2216. end
  2217. end
  2218. #===============================================================================
  2219. # Birthsigns - The Phoenix
  2220. # Rebirth Skill effect: Revives the user with roughly 1/16th its max hp.
  2221. #===============================================================================
  2222. elsif cmdRebirth>=0 && command==cmdRebirth
  2223. if !pkmn.fainted?
  2224. Kernel.pbMessage(_INTL("{1} has no need for this power right now.",pkmn.name))
  2225. else
  2226. if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
  2227. hpgain=pbItemRestoreHP(pkmn,pkmn.totalhp/16.floor+1)
  2228. pbRefresh
  2229. pbRitualAnimation(pkmn)
  2230. pbWait(1)
  2231. pbMEPlay("Pkmn get")
  2232. Kernel.pbMessage(_INTL("{1} was revived by the power of <c2=65467b14>{2}</c2>!",
  2233. pkmn.name,pkmn.pbGetBirthsignName))
  2234. pbWait(2)
  2235. end
  2236. pbRefresh
  2237. end
  2238. #===============================================================================
  2239. # Birthsigns - The Fugitive
  2240. # Escape Skill effect: Mimics the effects of 'Dig' or 'Escape Rope'.
  2241. #===============================================================================
  2242. elsif cmdEscape>=0 && command==cmdEscape
  2243. escape=($PokemonGlobal.escapePoint rescue nil)
  2244. outdoors=pbGetMetadata($game_map.map_id,MetadataOutdoor)
  2245. if !escape || escape==[] || outdoors
  2246. Kernel.pbMessage(_INTL("But there's no where to escape to!"))
  2247. elsif follower
  2248. Kernel.pbMessage(_INTL("This power can't be used when you have someone with you."))
  2249. else
  2250. if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
  2251. mapname=pbGetMapNameFromId(escape[0])
  2252. if Kernel.pbConfirmMessage(_INTL("Escape to <c2=65467b14>{1}</c2>?",mapname))
  2253. if escape
  2254. @scene.pbEndScene
  2255. if !pbRitualAnimation(pkmn)
  2256. pbWait(1)
  2257. Kernel.pbMessage(_INTL("{1} led you to safety!",pkmn.name))
  2258. end
  2259. pbFadeOutIn(99999){
  2260. pbSEPlay("Door exit")
  2261. Kernel.pbCancelVehicles
  2262. $game_temp.player_new_map_id=escape[0]
  2263. $game_temp.player_new_x=escape[1]
  2264. $game_temp.player_new_y=escape[2]
  2265. $game_temp.player_new_direction=escape[3]
  2266. $scene.transfer_player
  2267. $game_map.autoplay
  2268. $game_map.refresh
  2269. }
  2270. pbEraseEscapePoint
  2271. pbWait(2)
  2272. Kernel.pbMessage(_INTL("You escaped to <c2=65467b14>{1}</c2> by using the power of <c2=65467b14>{2}</c2>!",
  2273. mapname,pkmn.pbGetBirthsignName))
  2274. pbRefresh
  2275. break
  2276. end
  2277. end
  2278. end
  2279. end
  2280. #===============================================================================
  2281. # Birthsigns - The Cleric
  2282. # Cure Skill effect: Heals the party's status conditions at the cost of HP.
  2283. #===============================================================================
  2284. elsif cmdCure>=0 && command==cmdCure
  2285. if $Trainer.party.length<=1
  2286. Kernel.pbMessage(_INTL("But there aren't any other Pokémon in the party!"))
  2287. elsif pkmn.hp<=(pkmn.totalhp/5).floor
  2288. Kernel.pbMessage(_INTL("{1} is too weak to cure its allies!",pkmn.name))
  2289. else
  2290. if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
  2291. pbRitualAnimation(pkmn)
  2292. Kernel.pbMessage(_INTL("Choose a Pokémon for {1} to cure.",pkmn.name))
  2293. @scene.pbSetHelpText(_INTL("Cure which Pokémon?"))
  2294. oldpkmnid=pkmnid
  2295. loop do
  2296. @scene.pbPreSelect(oldpkmnid)
  2297. pkmnid=@scene.pbChoosePokemon(true,pkmnid)
  2298. break if pkmnid<0
  2299. newpkmn=@party[pkmnid]
  2300. if pkmnid==oldpkmnid
  2301. Kernel.pbMessage(_INTL("{1} can't cure itself!",pkmn.name))
  2302. elsif newpkmn.egg?
  2303. Kernel.pbMessage(_INTL("This power can't be used on eggs!"))
  2304. elsif newpkmn.hp==0
  2305. Kernel.pbMessage(_INTL("It's too late to cure that Pokémon..."))
  2306. elsif newpkmn.status>0
  2307. pkmn.hp-=(pkmn.totalhp/5).floor
  2308. newpkmn.status=0
  2309. newpkmn.statusCount=0
  2310. pbRefresh
  2311. pbWait(1)
  2312. pbMEPlay("Pkmn get")
  2313. Kernel.pbMessage(_INTL("{1}'s condition was healed by the power of <c2=65467b14>{2}</c2>!",
  2314. newpkmn.name,pkmn.pbGetBirthsignName))
  2315. pbWait(2)
  2316. else
  2317. Kernel.pbMessage(_INTL("That Pokémon doesn't need to be cured!"))
  2318. end
  2319. break if pkmn.hp<=(pkmn.totalhp/5).floor
  2320. end
  2321. pbRefresh
  2322. end
  2323. end
  2324. #===============================================================================
  2325. # Birthsigns - The Monk
  2326. # Trance Skill effect: Relearns old moves.
  2327. #===============================================================================
  2328. elsif cmdTrance>=0 && command==cmdTrance
  2329. if pbGetRelearnableMoves(pkmn).length<=0
  2330. Kernel.pbMessage(_INTL("But {1} has no moves to recall!",pkmn.name))
  2331. else
  2332. if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
  2333. Kernel.pbMessage(_INTL("{1} entered a deep trance...",pkmn.name))
  2334. if pbGetRelearnableMoves(pkmn).length>0
  2335. pbRitualAnimation(pkmn)
  2336. pbRelearnMoveScreen(pkmn)
  2337. else
  2338. Kernel.pbMessage(_INTL("...but it couldn't recall anything."))
  2339. end
  2340. pbRefresh
  2341. end
  2342. end
  2343. #===============================================================================
  2344. # Birthsigns - The Ancestor
  2345. # Inherit Skill effect: Passes along the user's EV spread.
  2346. #===============================================================================
  2347. elsif cmdInherit>=0 && command==cmdInherit
  2348. totalev=0
  2349. for k in 0...6
  2350. totalev+=pkmn.ev[k]
  2351. end
  2352. if pkmn.fainted?
  2353. Kernel.pbMessage(_INTL("{1} can't use this power while fainted!",pkmn.name))
  2354. elsif totalev==0
  2355. Kernel.pbMessage(_INTL("{1} needs to put in more effort before it can pass anything down!",pkmn.name))
  2356. else
  2357. if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
  2358. Kernel.pbMessage(_INTL("Activating this birthsign will transfer all of {1}'s effort points to a party member.",pkmn.name))
  2359. pbWait(5)
  2360. if Kernel.pbConfirmMessage(_INTL("Are you sure you want to activate this birthsign?"))
  2361. Kernel.pbMessage(_INTL("Choose a Pokémon to inherit {1}'s effort points.",pkmn.name))
  2362. @scene.pbSetHelpText(_INTL("Give to which Pokémon?"))
  2363. oldpkmnid=pkmnid
  2364. loop do
  2365. @scene.pbPreSelect(oldpkmnid)
  2366. pkmnid=@scene.pbChoosePokemon(true,pkmnid)
  2367. break if pkmnid<0
  2368. newpkmn=@party[pkmnid]
  2369. if pkmnid==oldpkmnid
  2370. Kernel.pbMessage(_INTL("{1} can't inherit its own points!",pkmn.name))
  2371. elsif newpkmn.egg?
  2372. Kernel.pbMessage(_INTL("This power can't be used on eggs!"))
  2373. elsif (newpkmn.isShadow? rescue false)
  2374. Kernel.pbMessage(_INTL("Shadow Pokémon can't inherit anything."))
  2375. else
  2376. pbRitualAnimation(pkmn)
  2377. newpkmn.ev[0]=pkmn.ev[0]
  2378. newpkmn.ev[1]=pkmn.ev[1]
  2379. newpkmn.ev[2]=pkmn.ev[2]
  2380. newpkmn.ev[3]=pkmn.ev[3]
  2381. newpkmn.ev[4]=pkmn.ev[4]
  2382. newpkmn.ev[5]=pkmn.ev[5]
  2383. Kernel.pbMessage(_INTL("{1} inherited effort points with the power of <c2=65467b14>{2}</c2>!",
  2384. newpkmn.name,pkmn.pbGetBirthsignName))
  2385. pkmn.ev=[0,0,0,0,0,0]
  2386. newpkmn.calcStats
  2387. pkmn.calcStats
  2388. pbRefresh
  2389. break
  2390. end
  2391. break if totalev==0
  2392. end
  2393. pbRefresh
  2394. end
  2395. end
  2396. end
  2397. #===============================================================================
  2398. # Birthsigns - The Specialist
  2399. # Re-roll Skill effect: IV's are reset to yield a new Hidden Power.
  2400. #===============================================================================
  2401. elsif cmdReroll>=0 && command==cmdReroll
  2402. #=======================================================================
  2403. # IV Settings
  2404. # The IV numbers set to odd and even that determines hidden power.
  2405. #=======================================================================
  2406. if pkmn.level>=100 # Lvl 100 Pokemon have IV's rolled between 30-31
  2407. odd = 31
  2408. evn = 30
  2409. elsif pkmn.level>=50 # Lvl 50+ Pokemon have IV's rolled between 25-26
  2410. odd = 25
  2411. evn = 26
  2412. else # All other Pokemon have IV's totally randomized
  2413. odd = (rand(32)/2.floor*2+1)
  2414. evn = (rand(32)/2.floor*2)
  2415. end
  2416. #=======================================================================
  2417. if pkmn.fainted?
  2418. Kernel.pbMessage(_INTL("{1} can't use this power while fainted!",pkmn.name))
  2419. else
  2420. if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
  2421. Kernel.pbMessage(_INTL("Please select a new Hidden Power type."))
  2422. currentpower=pbHiddenPower(pkmn.iv)
  2423. command=0
  2424. loop do
  2425. command=@scene.pbShowCommands(_INTL("Current Type: {1}",
  2426. PBTypes.getName(currentpower[0])),[
  2427. _INTL("Grass"),
  2428. _INTL("Fire"),
  2429. _INTL("Water"),
  2430. _INTL("Electric"),
  2431. _INTL("Ice"),
  2432. _INTL("Fighting"),
  2433. _INTL("Flying"),
  2434. _INTL("Poison"),
  2435. _INTL("Ground"),
  2436. _INTL("Rock"),
  2437. _INTL("Bug"),
  2438. _INTL("Ghost"),
  2439. _INTL("Steel"),
  2440. _INTL("Psychic"),
  2441. _INTL("Dragon"),
  2442. _INTL("Dark"),
  2443. _INTL("Fairy"),
  2444. _INTL("*Random*"),
  2445. _INTL("Cancel")
  2446. ],command)
  2447. case command
  2448. when -1, 18
  2449. break
  2450. #Re-rolls the user's IV's for a new Hidden Power.
  2451. when 0 # Grass
  2452. pkmn.iv=[odd,odd,evn,odd,evn,odd]
  2453. when 1 # Fire
  2454. pkmn.iv=[odd,odd,evn,evn,evn,odd]
  2455. when 2 # Water
  2456. pkmn.iv=[odd,odd,odd,evn,evn,odd]
  2457. when 3 # Electric
  2458. pkmn.iv=[odd,odd,odd,odd,evn,odd]
  2459. when 4 # Ice
  2460. pkmn.iv=[odd,odd,odd,evn,odd,odd]
  2461. when 5 # Fighting
  2462. pkmn.iv=[odd,odd,evn,evn,evn,evn]
  2463. when 6 # Flying
  2464. pkmn.iv=[odd,odd,odd,evn,evn,evn]
  2465. when 7 # Poison
  2466. pkmn.iv=[odd,odd,evn,odd,evn,evn]
  2467. when 8 # Ground
  2468. pkmn.iv=[odd,odd,odd,odd,evn,evn]
  2469. when 9 # Rock
  2470. pkmn.iv=[odd,odd,evn,evn,odd,evn]
  2471. when 10# Bug
  2472. pkmn.iv=[odd,odd,odd,evn,odd,evn]
  2473. when 11# Ghost
  2474. pkmn.iv=[odd,odd,evn,odd,odd,evn]
  2475. when 12# Steel
  2476. pkmn.iv=[odd,odd,odd,odd,odd,evn]
  2477. when 13# Psychic
  2478. pkmn.iv=[odd,odd,evn,evn,odd,odd]
  2479. when 14# Dragon
  2480. pkmn.iv=[odd,odd,evn,odd,odd,odd]
  2481. #=====================================================================
  2482. # Types PBS file must include Fairy type for the below to work.
  2483. # Otherwise it will just return HP Dragon.
  2484. #=====================================================================
  2485. when 15# Dark
  2486. pkmn.iv=[odd,evn,odd,odd,odd,odd]
  2487. #=====================================================================
  2488. # Types PBS file must include Fairy type for the below to work.
  2489. # Otherwise it will just return HP Dark.
  2490. #=====================================================================
  2491. when 16# Fairy
  2492. pkmn.iv=[odd,odd,odd,odd,odd,odd]
  2493. #=====================================================================
  2494. # Randomizes the user's IV's and returns their new values.
  2495. #=====================================================================
  2496. when 17# Randomize
  2497. if pkmn.level>49 #Users level 50 and higher have better IV rolls.
  2498. pkmn.iv[0]=25+rand(7)
  2499. pkmn.iv[1]=25+rand(7)
  2500. pkmn.iv[2]=25+rand(7)
  2501. pkmn.iv[3]=25+rand(7)
  2502. pkmn.iv[4]=25+rand(7)
  2503. pkmn.iv[5]=25+rand(7)
  2504. else
  2505. pkmn.iv[0]=rand(32)
  2506. pkmn.iv[1]=rand(32)
  2507. pkmn.iv[2]=rand(32)
  2508. pkmn.iv[3]=rand(32)
  2509. pkmn.iv[4]=rand(32)
  2510. pkmn.iv[5]=rand(32)
  2511. end
  2512. end
  2513. #=====================================================================
  2514. Kernel.pbMessage(_INTL("Re-roll:\n{1}/{2}/{3}/{4}/{5}/{6}",
  2515. pkmn.iv[0],pkmn.iv[1],pkmn.iv[2],pkmn.iv[4],pkmn.iv[5],pkmn.iv[3]))
  2516. pbRitualAnimation(pkmn)
  2517. pbRefresh
  2518. pkmn.calcStats
  2519. pkmn.hp=1 if pkmn.hp<=0
  2520. pbWait(1)
  2521. pbMEPlay("Pkmn get")
  2522. newpower=pbHiddenPower(pkmn.iv)
  2523. Kernel.pbMessage(_INTL("The power of <c2=65467b14>{1}</c2> changed {2}'s Hidden Power to <c2=65467b14>{3}</c2>!",
  2524. pkmn.pbGetBirthsignName,pkmn.name,PBTypes.getName(newpower[0])))
  2525. pbWait(2)
  2526. pbRefresh
  2527. break
  2528. end
  2529. end
  2530. end
  2531. #===============================================================================
  2532. # Birthsigns - The Parent
  2533. # Incubate Skill effect: Reduces an egg's stepcount to 1, instantly hatching it.
  2534. #===============================================================================
  2535. elsif cmdIncubate>=0 && command==cmdIncubate
  2536. if $Trainer.party.length<=1
  2537. Kernel.pbMessage(_INTL("But there aren't any other Pokémon in the party!"))
  2538. elsif !pbCanUseBirthsignIncubate?
  2539. Kernel.pbMessage(_INTL("This power needs recharging before it may be used again."))
  2540. else
  2541. if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
  2542. Kernel.pbMessage(_INTL("Choose an egg for {1} to incubate.",pkmn.name))
  2543. @scene.pbSetHelpText(_INTL("Incubate which egg?"))
  2544. oldpkmnid=pkmnid
  2545. loop do
  2546. @scene.pbPreSelect(oldpkmnid)
  2547. pkmnid=@scene.pbChoosePokemon(true,pkmnid)
  2548. break if pkmnid<0
  2549. newpkmn=@party[pkmnid]
  2550. if Input.trigger?(Input::B)
  2551. break
  2552. elsif newpkmn.egg?
  2553. pbRitualAnimation(pkmn)
  2554. Kernel.pbMessage(_INTL("{1} incubated the egg with the power of <c2=65467b14>{2}</c2>!",
  2555. pkmn.name,pkmn.pbGetBirthsignName))
  2556. newpkmn.eggsteps=1
  2557. pbWait(1)
  2558. pbMEPlay("Pkmn get")
  2559. Kernel.pbMessage(_INTL("The egg is now ready to hatch!"))
  2560. pbWait(2)
  2561. pbUseBirthsignEffectIncubate
  2562. break
  2563. else
  2564. Kernel.pbMessage(_INTL("This power only works on eggs!"))
  2565. end
  2566. end
  2567. pbRefresh
  2568. end
  2569. end
  2570. #===============================================================================
  2571. # Birthsigns - The Eternal
  2572. # Reincarnate Skill effect: Resets the user's birthsign and attributes.
  2573. #===============================================================================
  2574. elsif cmdReincarnate>=0 && command==cmdReincarnate
  2575. if pkmn.hasCurrentsign? && !pkmn.isCelestial?
  2576. Kernel.pbMessage(_INTL("This power won't work unless its a different month!"))
  2577. else
  2578. if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
  2579. Kernel.pbMessage(_INTL("Activating this birthsign may reset {1}'s zodiac sign, level,\nand many other attributes.",pkmn.name))
  2580. pbWait(10)
  2581. if Kernel.pbConfirmMessage(_INTL("Are you sure you want to activate this birthsign?"))
  2582. pbRitualAnimation(pkmn)
  2583. pkmn.hp=pkmn.totalhp
  2584. pkmn.status=0
  2585. pkmn.statusCount=0
  2586. pkmn.level=EGGINITIALLEVEL
  2587. pkmn.ev=[0,0,0,0,0,0]
  2588. pkmn.happiness=120
  2589. pkmn.pokerus=0
  2590. pkmn.timeEggHatched=pbGetTimeNow
  2591. pkmn.obtainText=_INTL("Reincarnated.")
  2592. pkmn.giveRibbon(:SECONDSTEP)
  2593. # Celestial Pokemon keep their trainer data
  2594. if !pkmn.isCelestial?
  2595. pkmn.trainerID = $Trainer.id
  2596. pkmn.ot = $Trainer.name
  2597. pkmn.otgender = $Trainer.gender
  2598. end
  2599. # Celestial Pokemon keep their sign
  2600. if !pkmn.isCelestial? || !ZODIACSET==0
  2601. pkmn.setZodiacsign(Time.now.mon)
  2602. end
  2603. pkmn.makeBlessed
  2604. pkmn.calcStats
  2605. pbMEPlay("Pkmn get") if pkmn.isCelestial?
  2606. Kernel.pbMessage(_INTL("{1} was reincarnated by the power of <c2=65467b14>{2}</c2>!",
  2607. pkmn.name,PBBirthsigns.getName(24)))
  2608. if !pkmn.isCelestial?
  2609. Kernel.pbMessage(_INTL("And..."))
  2610. pbRefresh
  2611. pbMEPlay("Evolution success")
  2612. Kernel.pbMessage(_INTL("\\se[]{1} gained the power of\n<c2=65467b14>{2}</c2>!\\wt[80]",
  2613. pkmn.name,pkmn.pbGetBirthsignName))
  2614. if Kernel.pbConfirmMessage(_INTL("Would you like to rename the reincarnated Pokémon?"))
  2615. species=PBSpecies.getName(pkmn.species)
  2616. nickname=pbEnterPokemonName(_INTL("{1}'s new name?",pkmn.name),0,10,"",pkmn)
  2617. pkmn.name=nickname if nickname!=""
  2618. pbRefresh
  2619. end
  2620. end
  2621. if pkmn.hasRibbon?(:SECONDSTEP)
  2622. Kernel.pbMessage(_INTL("You put the <c2=65467b14>Second Step Ribbon</c2> on {1} to commemorate new life.",pkmn.name))
  2623. end
  2624. pbRefresh
  2625. end
  2626. end
  2627. end
  2628. #===============================================================================
  2629. # Birthsigns - The Bard
  2630. # Harmonize Skill effect: Choose from a list of songs with varying effects.
  2631. #===============================================================================
  2632. # Alluring Aria: Mimics the effect of 'White Flute', and lures a wild Pokemon.
  2633. # Repellent Rapture: Mimics the effect of 'Black Flute', and repels wild Pokemon.
  2634. # Mysterious Melody: Attempts to lure a wild Pokemon exclusive to the PokeRadar.
  2635. #===============================================================================
  2636. elsif cmdHarmonize>=0 && command==cmdHarmonize
  2637. if !pbCanUseBirthsignHarmonize?
  2638. Kernel.pbMessage(_INTL("This power needs recharging before it may be used again."))
  2639. elsif !$PokemonEncounters.isEncounterPossibleHere?
  2640. Kernel.pbMessage(_INTL("But there's nothing nearby to hear {1}'s tune...",pkmn.name))
  2641. elsif $game_screen.weather_type!=PBFieldWeather::None
  2642. Kernel.pbMessage(_INTL("{1}'s tune doesn't seem to travel well right now...",pkmn.name))
  2643. else
  2644. if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
  2645. Kernel.pbMessage(_INTL("Which song should {1} sing?",pkmn.name))
  2646. command=0
  2647. loop do
  2648. command=@scene.pbShowCommands(_INTL("Choose a song."),[
  2649. _INTL("Alluring Aria"),
  2650. _INTL("Repellent Rapture"),
  2651. _INTL("Mysterious Melody"),
  2652. _INTL("Cancel")
  2653. ],command)
  2654. case command
  2655. when -1, 3
  2656. break
  2657. when 0 # Alluring Aria
  2658. @scene.pbEndScene
  2659. pbUseBirthsignEffectHarmonize
  2660. pbRitualAnimation(pkmn)
  2661. pbWait(1)
  2662. pbSEPlay("Anim/Sing")
  2663. Kernel.pbMessage(_INTL("\\se[]With the power of <c2=65467b14>{1}</c2>, {2} emits an alluring tune...\\wt[80]",
  2664. pkmn.pbGetBirthsignName,pkmn.name))
  2665. $PokemonMap.whiteFluteUsed = true if $PokemonMap
  2666. $PokemonMap.blackFluteUsed = false if $PokemonMap
  2667. pbWait(10)
  2668. encounter = nil
  2669. enctype = $PokemonEncounters.pbEncounterType
  2670. Kernel.pbMessage(_INTL("{1}'s tune seems to have attracted something!",pkmn.name))
  2671. pbWait(10)
  2672. if enctype<0 || !$PokemonEncounters.isEncounterPossibleHere? || !pbEncounter(enctype)
  2673. Kernel.pbMessage(_INTL("{1}'s tune didn't seem to attract anything...",pkmn.name))
  2674. end
  2675. when 1 # Repellent Rapture
  2676. @scene.pbEndScene
  2677. pbUseBirthsignEffectHarmonize
  2678. pbRitualAnimation(pkmn)
  2679. pbWait(1)
  2680. pbSEPlay("Anim/Sing")
  2681. Kernel.pbMessage(_INTL("\\se[]With the power of <c2=65467b14>{1}</c2>, {2} emits a repulsive tune...\\wt[80]",
  2682. pkmn.pbGetBirthsignName,pkmn.name))
  2683. $PokemonMap.whiteFluteUsed = false if $PokemonMap
  2684. $PokemonMap.blackFluteUsed = true if $PokemonMap
  2685. pbWait(10)
  2686. Kernel.pbMessage(_INTL("{1}'s tune seems to have scared away wild Pokémon!",pkmn.name))
  2687. $PokemonGlobal.repel=250 if pkmn.level>50
  2688. $PokemonGlobal.repel=200 if pkmn.level>25
  2689. $PokemonGlobal.repel=100 if pkmn.level<25
  2690. when 2 # Mysterious Melody
  2691. @scene.pbEndScene
  2692. pbUseBirthsignEffectHarmonize
  2693. pbRitualAnimation(pkmn)
  2694. pbWait(1)
  2695. pbSEPlay("Anim/Sing")
  2696. Kernel.pbMessage(_INTL("\\se[]With the power of <c2=65467b14>{1}</c2>, {2} emits an odd tune...\\wt[80]",
  2697. pkmn.pbGetBirthsignName,pkmn.name))
  2698. pbWait(10)
  2699. enctype = $PokemonEncounters.pbEncounterType
  2700. map = $game_map.map_id rescue 0
  2701. array = []
  2702. for enc in POKERADAREXCLUSIVES
  2703. array.push(enc) if enc.length>=4 && enc[0]==map && getID(PBSpecies,enc[2])>0
  2704. species=getID(PBSpecies,enc[2])
  2705. end
  2706. if array.length>0
  2707. for enc in array
  2708. upper = (enc[4]!=nil) ? enc[4] : enc[3]
  2709. level = enc[3]+rand(1+upper-enc[3])
  2710. if enctype<0 || !$PokemonEncounters.isEncounterPossibleHere?
  2711. Kernel.pbMessage(_INTL("{1}'s tune didn't seem to attract anything...",pkmn.name))
  2712. else
  2713. Kernel.pbMessage(_INTL("{1}'s tune seems to have attracted something!",pkmn.name))
  2714. pbWait(10)
  2715. $PokemonTemp.forceSingleBattle = true
  2716. pbWildBattle(species,level)
  2717. end
  2718. break
  2719. end
  2720. else
  2721. Kernel.pbMessage(_INTL("{1}'s tune didn't seem to attract anything...",pkmn.name))
  2722. end
  2723. end
  2724. break
  2725. end
  2726. break
  2727. end
  2728. end
  2729. #===============================================================================
  2730. # Birthsigns - The Empath
  2731. # Bond Skill effect: Copies the nature of a party member.
  2732. #===============================================================================
  2733. elsif cmdBond>=0 && command==cmdBond
  2734. if $Trainer.party.length<=1
  2735. Kernel.pbMessage(_INTL("But there aren't any other Pokémon in the party!"))
  2736. else
  2737. if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
  2738. Kernel.pbMessage(_INTL("Choose a Pokémon for {1} to bond with.",pkmn.name))
  2739. @scene.pbSetHelpText(_INTL("Bond with which Pokémon?"))
  2740. oldpkmnid=pkmnid
  2741. loop do
  2742. @scene.pbPreSelect(oldpkmnid)
  2743. pkmnid=@scene.pbChoosePokemon(true,pkmnid)
  2744. break if pkmnid<0
  2745. newpkmn=@party[pkmnid]
  2746. if pkmnid==oldpkmnid
  2747. Kernel.pbMessage(_INTL("{1} can't bond with itself!",pkmn.name))
  2748. elsif newpkmn.egg?
  2749. Kernel.pbMessage(_INTL("This power can't be used on eggs!"))
  2750. elsif (newpkmn.isShadow? rescue false)
  2751. Kernel.pbMessage(_INTL("That Pokémon doesn't seem willing to bond..."))
  2752. elsif pkmn.nature==newpkmn.nature
  2753. Kernel.pbMessage(_INTL("{1} doesn't seem interested in that Pokémon...",pkmn.name))
  2754. else
  2755. pbRitualAnimation(pkmn)
  2756. pkmn.setNature(newpkmn.nature)
  2757. pbRefresh
  2758. pbWait(1)
  2759. pbMEPlay("Pkmn get")
  2760. Kernel.pbMessage(_INTL("{1} is feeling <c2=65467b14>{2}</c2> by using the power of <c2=65467b14>{3}</c2>!",
  2761. pkmn.name,PBNatures.getName(pkmn.nature),pkmn.pbGetBirthsignName))
  2762. pbWait(2)
  2763. end
  2764. break
  2765. end
  2766. pbRefresh
  2767. end
  2768. end
  2769. #===============================================================================
  2770. # Birthsigns - The Tactician
  2771. # Gambit Skill effect: Allows the user to reallocate EV's.
  2772. #===============================================================================
  2773. elsif cmdGambit>=0 && command==cmdGambit
  2774. totalev=0
  2775. for k in 0...6
  2776. totalev+=pkmn.ev[k]
  2777. end
  2778. if pkmn.fainted?
  2779. Kernel.pbMessage(_INTL("{1} can't use this power while fainted!",pkmn.name))
  2780. elsif totalev!=PokeBattle_Pokemon::EVLIMIT
  2781. Kernel.pbMessage(_INTL("{1} needs to put in more effort before it may use this power!",pkmn.name))
  2782. else
  2783. if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
  2784. Kernel.pbMessage(_INTL("Activating this birthsign will reset any accumulated effort points."))
  2785. pbWait(5)
  2786. if Kernel.pbConfirmMessage(_INTL("Are you sure you want to activate this birthsign?"))
  2787. pkmn.ev=[0,0,0,0,0,0]
  2788. Kernel.pbMessage(_INTL("Please reallocate {1}'s effort points.",pkmn.name))
  2789. command = 0
  2790. loop do
  2791. totalev=0
  2792. for k in 0...6
  2793. totalev+=pkmn.ev[k]
  2794. end
  2795. evcommands = []
  2796. for i in 0...6
  2797. evcommands.push(PBStats.getName(i)+" (#{pkmn.ev[i]})")
  2798. end
  2799. evcommands.push(_INTL("-Done-"))
  2800. evtotal=(PokeBattle_Pokemon::EVLIMIT-totalev)
  2801. command=@scene.pbShowCommands(_INTL("{1} total points remaining.",evtotal),evcommands,command)
  2802. if command>=0 && command<6
  2803. remainder=(PokeBattle_Pokemon::EVLIMIT-PokeBattle_Pokemon::EVSTATLIMIT)
  2804. if totalev<=remainder
  2805. statcap=PokeBattle_Pokemon::EVSTATLIMIT
  2806. elsif totalev>remainder
  2807. statcap=(PokeBattle_Pokemon::EVLIMIT-totalev)
  2808. end
  2809. params = ChooseNumberParams.new
  2810. params.setRange(0,statcap)
  2811. params.setDefaultValue(pkmn.ev[command])
  2812. params.setCancelValue(pkmn.ev[command])
  2813. f = Kernel.pbMessageChooseNumber(_INTL("Set effort for {1}.\nPoints available: {2}",
  2814. PBStats.getName(command),statcap),params) { @scene.update }
  2815. if f!=pkmn.ev[command]
  2816. pkmn.ev[command] = f
  2817. pkmn.calcStats
  2818. pkmn.hp=1 if pkmn.hp<=0
  2819. pbRefreshSingle(pkmnid)
  2820. end
  2821. else
  2822. if Kernel.pbConfirmMessage(_INTL("Are you sure you want this effort spread?"))
  2823. pbRitualAnimation(pkmn)
  2824. pbWait(1)
  2825. pbMEPlay("Pkmn get")
  2826. Kernel.pbMessage(_INTL("{1} reallocated its effort points with the power of <c2=65467b14>{2}</c2>!",
  2827. pkmn.name,pkmn.pbGetBirthsignName))
  2828. pbWait(2)
  2829. pbRefreshSingle(pkmnid)
  2830. break
  2831. else
  2832. pkmn.ev=[0,0,0,0,0,0]
  2833. Kernel.pbMessage(_INTL("Please reallocate {1}'s effort points.",pkmn.name))
  2834. command=0
  2835. end
  2836. end
  2837. pkmn.calcStats
  2838. pbRefreshSingle(pkmnid)
  2839. pbRefresh
  2840. end
  2841. end
  2842. end
  2843. end
  2844. #===============================================================================
  2845. # Birthsigns - The Fool
  2846. # Lunacy Skill effect: Reduces the user's level to raise a party member's level.
  2847. #===============================================================================
  2848. elsif cmdLunacy>=0 && command==cmdLunacy
  2849. if pkmn.fainted?
  2850. Kernel.pbMessage(_INTL("{1} can't use this power while fainted!",pkmn.name))
  2851. elsif pkmn.level<5
  2852. Kernel.pbMessage(_INTL("{1} needs to be a higher level to use this power!",pkmn.name))
  2853. elsif $Trainer.party.length<=1
  2854. Kernel.pbMessage(_INTL("But there aren't any other Pokémon in the party!"))
  2855. else
  2856. if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
  2857. Kernel.pbMessage(_INTL("Using this power will lower {1}'s level by 3...",pkmn.name))
  2858. pbWait(5)
  2859. if Kernel.pbConfirmMessage(_INTL("Are you sure you want to activate this power?"))
  2860. Kernel.pbMessage(_INTL("Choose a Pokémon for {1} to level up.",pkmn.name))
  2861. @scene.pbSetHelpText(_INTL("Level up which Pokémon?"))
  2862. oldpkmnid=pkmnid
  2863. maxlevel=PBExperience::MAXLEVEL
  2864. loop do
  2865. @scene.pbPreSelect(oldpkmnid)
  2866. pkmnid=@scene.pbChoosePokemon(true,pkmnid)
  2867. break if pkmnid<0
  2868. newpkmn=@party[pkmnid]
  2869. if pkmnid==oldpkmnid
  2870. Kernel.pbMessage(_INTL("{1} can't use this power to level itself!",pkmn.name))
  2871. elsif newpkmn.egg?
  2872. Kernel.pbMessage(_INTL("This power can't be used on eggs!"))
  2873. elsif (newpkmn.isShadow? rescue false)
  2874. Kernel.pbMessage(_INTL("This power won't work on that Pokémon."))
  2875. elsif pkmn.level<newpkmn.level || newpkmn.level==maxlevel
  2876. Kernel.pbMessage(_INTL("{1}'s level is too high for this power!",newpkmn.name))
  2877. else
  2878. pbRitualAnimation(pkmn)
  2879. #=============================================================
  2880. # De-leveling User
  2881. #=============================================================
  2882. pkmn.level-=3
  2883. pkmn.calcStats
  2884. pkmn.hp=1 if pkmn.hp<=0
  2885. pbRefresh
  2886. Kernel.pbMessage(_INTL("{1} fell to Level {2}...",pkmn.name,pkmn.level))
  2887. Kernel.pbMessage(_INTL("But..."))
  2888. #=============================================================
  2889. # Leveling Ally
  2890. #=============================================================
  2891. attackdiff=newpkmn.attack
  2892. defensediff=newpkmn.defense
  2893. speeddiff=newpkmn.speed
  2894. spatkdiff=newpkmn.spatk
  2895. spdefdiff=newpkmn.spdef
  2896. totalhpdiff=newpkmn.totalhp
  2897. newpkmn.level+=(1+rand(5))
  2898. newpkmn.changeHappiness("levelup")
  2899. newpkmn.calcStats
  2900. pbRefresh
  2901. pbWait(1)
  2902. pbMEPlay("Pkmn get")
  2903. Kernel.pbMessage(_INTL("The power of <c2=65467b14>{1}</c2> elevated {2} to Level {3}!",
  2904. pkmn.pbGetBirthsignName,newpkmn.name,newpkmn.level))
  2905. pbWait(2)
  2906. attackdiff=newpkmn.attack-attackdiff
  2907. defensediff=newpkmn.defense-defensediff
  2908. speeddiff=newpkmn.speed-speeddiff
  2909. spatkdiff=newpkmn.spatk-spatkdiff
  2910. spdefdiff=newpkmn.spdef-spdefdiff
  2911. totalhpdiff=newpkmn.totalhp-totalhpdiff
  2912. pbTopRightWindow(_INTL("Max. HP<r>+{1}\r\nAttack<r>+{2}\r\nDefense<r>+{3}\r\nSp. Atk<r>+{4}\r\nSp. Def<r>+{5}\r\nSpeed<r>+{6}",
  2913. totalhpdiff,attackdiff,defensediff,spatkdiff,spdefdiff,speeddiff))
  2914. pbTopRightWindow(_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}",
  2915. newpkmn.totalhp,newpkmn.attack,newpkmn.defense,newpkmn.spatk,newpkmn.spdef,newpkmn.speed))
  2916. movelist=newpkmn.getMoveList
  2917. for i in movelist
  2918. if i[0]==newpkmn.level # Learned a new move
  2919. pbLearnMove(newpkmn,i[1],true)
  2920. end
  2921. end
  2922. newspecies=pbCheckEvolution(newpkmn)
  2923. if newspecies>0
  2924. pbFadeOutInWithMusic(99999){
  2925. evo=PokemonEvolutionScene.new
  2926. evo.pbStartScreen(newpkmn,newspecies)
  2927. evo.pbEvolution
  2928. evo.pbEndScreen
  2929. }
  2930. break
  2931. end
  2932. end
  2933. break if pkmn.level<newpkmn.level
  2934. end
  2935. pbRefresh
  2936. end
  2937. end
  2938. end
  2939. #===============================================================================
  2940. # Birthsigns - The Alchemist
  2941. # Transmute Skill effect: Uses Stardust to morph held items into new ones.
  2942. #===============================================================================
  2943. elsif cmdTransmute>=0 && command==cmdTransmute
  2944. # Items that should not be transmutable must be added to this list below
  2945. nontransmutable = (pbIsKeyItem?(pkmn.item) ||
  2946. pbIsMachine?(pkmn.item) ||
  2947. pbIsMegaStone?(pkmn.item) ||
  2948. (pbIsZCrystal?(pkmn.item) if INCLUDE_ZMOVES) ||
  2949. (pbIsZCrystal2?(pkmn.item) if INCLUDE_ZMOVES) ||
  2950. isConst?(pkmn.item,PBItems,:REDORB) ||
  2951. isConst?(pkmn.item,PBItems,:BLUEORB) ||
  2952. isConst?(pkmn.item,PBItems,:ADAMANTORB) ||
  2953. isConst?(pkmn.item,PBItems,:LUSTROUSORB) ||
  2954. isConst?(pkmn.item,PBItems,:GRISEOUSORB) ||
  2955. isConst?(pkmn.item,PBItems,:SOULDEW) ||
  2956. isConst?(pkmn.item,PBItems,:BURNDRIVE) ||
  2957. isConst?(pkmn.item,PBItems,:CHILLDRIVE) ||
  2958. isConst?(pkmn.item,PBItems,:SHOCKDRIVE) ||
  2959. isConst?(pkmn.item,PBItems,:DOUSEDRIVE) ||
  2960. isConst?(pkmn.item,PBItems,:RUSTEDSHIELD) ||
  2961. isConst?(pkmn.item,PBItems,:RUSTEDSWORD) ||
  2962. isConst?(pkmn.item,PBItems,:STARDUST) ||
  2963. isConst?(pkmn.item,PBItems,:MASTERBALL))
  2964. stardust=PBItems.getName(PBItems::STARDUST)
  2965. if !pkmn.hasItem?
  2966. Kernel.pbMessage(_INTL("{1} isn't holding an item to transmute!",pkmn.name))
  2967. elsif nontransmutable
  2968. Kernel.pbMessage(_INTL("{1} isn't a transmutable item!",PBItems.getName(pkmn.item)))
  2969. elsif !$PokemonBag.pbHasItem?(:STARDUST)
  2970. Kernel.pbMessage(_INTL("You need more <c2=65467b14>{1}</c2> to use this power!",stardust))
  2971. else
  2972. if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
  2973. Kernel.pbMessage(_INTL("Activating this birthsign will consume <c2=65467b14>{1}</c2>, and permanently change the item {2} is holding.",stardust,pkmn.name))
  2974. if Kernel.pbConfirmMessage(_INTL("Should <c2=65467b14>{1}</c2> be transmuted?",PBItems.getName(pkmn.item)))
  2975. #===============================================================================
  2976. # Creation List
  2977. #===============================================================================
  2978. # Includes most items up to Gen 8; no consequences if all items aren't present.
  2979. #===============================================================================
  2980. excavation = [:HEATROCK,:ICYROCK,:DAMPROCK,:SMOOTHROCK,:LIGHTCLAY,:EVIOLITE,
  2981. :ODDKEYSTONE,:HARDSTONE,:EVERSTONE,:FLOATSTONE,:OVALSTONE,:REDSHARD,
  2982. :BLUESHARD,:YELLOWSHARD,:GREENSHARD,:COMETSHARD,:SHOALSHELL,:REVIVE,
  2983. :MAXREVIVE,:NUGGET,:BIGNUGGET,:PEARL,:BIGPEARL,:SOFTSAND,:RAREBONE,
  2984. :WISHINGPIECE]
  2985. #26===============================================================
  2986. mints = [:LONELYMINT,:ADAMANTMINT,:NAUGHTYMINT,:BRAVEMINT,:BOLDMINT,:IMPISHMINT,
  2987. :LAXMINT,:RELAXEDMINT,:MODESTMINT,:MILDMINT,:RASHMINT,:QUIETMINT,:CALMMINT,
  2988. :GENTLEMINT,:CAREFULMINT,:SASSYMINT,:TIMIDMINT,:HASTYMINT,:JOLLYMINT,
  2989. :NAIVEMINT,:SERIOUSMINT]
  2990. #21===============================================================
  2991. beastparts = [:DEEPSEASCALE,:DRAGONSCALE,:HEARTSCALE,:PRISMSCALE,:DEEPSEATOOTH,
  2992. :DRAGONFANG,:RAZORFANG,:GRIPCLAW,:QUICKCLAW,:RAZORCLAW,:LAGGINGTAIL,
  2993. :SLOWPOKETAIL,:SHARPBEAK,:PRETTYWING,:POISONBARB,:STICKYBARB,
  2994. :SHEDSHELL,:SHOALSHELL,:RAREBONE,:BERSERKGENE]
  2995. #20===============================================================
  2996. plates = [:FLAMEPLATE,:SPLASHPLATE,:ZAPPLATE,:MEADOWPLATE,:ICICLEPLATE,:FISTPLATE,
  2997. :TOXICPLATE,:EARTHPLATE,:SKYPLATE,:MINDPLATE,:INSECTPLATE,:STONEPLATE,
  2998. :SPOOKYPLATE,:DRACOPLATE,:DREADPLATE,:IRONPLATE,:PIXIEPLATE,
  2999. :DIVINEPLATE,:FALSEPLATE]
  3000. #19===============================================================
  3001. memories = [:BUGMEMORY,:DARKMEMORY,:DRAGONMEMORY,:ELECTRICMEMORY,:FAIRYMEMORY,
  3002. :FIGHTINGMEMORY,:FIREMEMORY,:FLYINGMEMORY,:GHOSTMEMORY,:GRASSMEMORY,
  3003. :GROUNDMEMORY,:ICEMEMORY,:POISONMEMORY,:PSYCHICMEMORY,:ROCKMEMORY,
  3004. :STEELMEMORY,:WATERMEMORY]
  3005. #17===============================================================
  3006. evostones = [:FIRESTONE,:WATERSTONE,:LEAFSTONE,:THUNDERSTONE,:MOONSTONE,:SUNSTONE,
  3007. :DUSKSTONE,:DAWNSTONE,:SHINYSTONE,:REDSHARD,:BLUESHARD,:YELLOWSHARD,
  3008. :GREENSHARD,:EVERSTONE,:EVIOLITE,:ICESTONE,:OVALSTONE]
  3009. #17===============================================================
  3010. gadgets = [:MAGNET,:RINGTARGET,:METRONOME,:EJECTBUTTON,:CELLBATTERY,:MACHOBRACE,
  3011. :SOOTHEBELL,:UPGRADE,:DUBIOUSDISC,:ELECTIRIZER,:MAGMARIZER,:PROTECTOR,
  3012. :EXPSHARE,:TERRAINEXTENDER,:ASSAULTVEST,:PROTECTIVEPADS,:EJECTPACK,
  3013. :HEAVYDUTYBOOTS,:ROOMSERVICE,:UTILITYUMBRELLA]
  3014. #20===============================================================
  3015. clothing = [:CHOICESCARF,:CHOICEBAND,:EXPERTBELT,:MUSCLEBAND,:FOCUSBAND,:FOCUSSASH,
  3016. :BINDINGBAND,:BLACKBELT,:SILKSCARF,:REDSCARF,:BLUESCARF,:PINKSCARF,
  3017. :GREENSCARF,:YELLOWSCARF]
  3018. #14===============================================================
  3019. junkitem = [:SHOALSALT,:BRIGHTPOWDER,:SILVERPOWDER,:QUICKPOWDER,:ENERGYPOWDER,
  3020. :HEALPOWDER,:GROWTHMULCH,:DAMPMULCH,:STABLEMULCH,:GOOEYMULCH,
  3021. :SACREDASH,:CHARCOAL,:BLACKSLUDGE]
  3022. #13===============================================================
  3023. fossils = [:HELIXFOSSIL,:DOMEFOSSIL,:ROOTFOSSIL,:CLAWFOSSIL,:SKULLFOSSIL,
  3024. :ARMORFOSSIL,:COVERFOSSIL,:PLUMEFOSSIL,:OLDAMBER,:SAILFOSSIL,
  3025. :JAWFOSSIL,:FOSSILIZEDBIRD,:FOSSILIZEDDINO,:FOSSILIZEDDRAKE,
  3026. :FOSSILIZEDFISH,:THICKCLUB,:SACREDASH]
  3027. #17===============================================================
  3028. zodiacgem = [:JANZODICA,:FEBZODICA,:MARZODICA,:APRIZODICA,:MAYZODICA,:JUNZODICA,
  3029. :JULZODICA,:AUGZODICA,:SEPZODICA,:OCTZODICA,:NOVIZODICA,:DECIZODICA]
  3030. #12===============================================================
  3031. herbs = [:ENERGYROOT,:REVIVALHERB,:ABSORBBULB,:MENTALHERB,:POWERHERB,:WHITEHERB,
  3032. :TINYMUSHROOM,:BIGMUSHROOM,:BALMMUSHROOM,:BIGROOT,:STICK,:LUMINOUSMOSS,
  3033. :SWEETAPPLE,:TARTAPPLE,:LEFTOVERS]
  3034. #15===============================================================
  3035. treasure1 = [:RELICCOPPER,:RELICCOPPER,:RELICSILVER,:BOTTLECAP,:NUGGET,:BIGNUGGET,
  3036. :STARPIECE,:SOFTSAND,:KINGSROCK,:REVIVE,:MAXREVIVE,:CRACKEDPOT]
  3037. #12===============================================================
  3038. treasure2 = [:RELICGOLD,:RELICGOLD,:RELICVASE,:RELICBAND,:RELICSTATUE,:KINGSROCK,
  3039. :RELICCROWN,:AMULETCOIN,:BOTTLECAP,:BOTTLECAP,:GOLDBOTTLECAP,:CHIPPEDPOT]
  3040. #12===============================================================
  3041. incenses = [:LAXINCENSE,:FULLINCENSE,:LUCKINCENSE,:PUREINCENSE,:SEAINCENSE,
  3042. :WAVEINCENSE,:ROSEINCENSE,:ODDINCENSE,:ROCKINCENSE,:SACHET]
  3043. #10================================================================
  3044. liquids = [:MYSTICWATER,:MYSTICWATER,:SODAPOP,:LEMONADE,:MOOMOOMILK,:BERRYJUICE,
  3045. :NEVERMELTICE,:SNOWBALL,:THROATSPRAY]
  3046. #9===============================================================
  3047. vitamins = [:PPUP,:PPMAX,:HPUP,:PROTEIN,:IRON,:CALCIUM,:ZINC,:CARBOS,:ABILITYCAPSULE]
  3048. #9================================================================
  3049. apricorn = [:REDAPRICORN,:YLWAPRICORN,:BLUAPRICORN,:GRNAPRICORN,:PNKAPRICORN,
  3050. :WHTAPRICORN,:BLKAPRICORN]
  3051. #7================================================================
  3052. orbs = [:LIFEORB,:LIGHTORB,:FLAMEORB,:TOXICORB,:SMOKEBALL,:IRONBALL,
  3053. :PEARLSTRING,:ADRENALINEORB]
  3054. #8================================================================
  3055. glass = [:CHOICESPECS,:BLACKGLASSES,:WISEGLASSES,:SCOPELENS,:WIDELENS,
  3056. :ZOOMLENS,:SAFETYGOGGLES,:BLACKFLUTE,:BLUEFLUTE,:REDFLUTE,
  3057. :WHITEFLUTE,:YELLOWFLUTE]
  3058. #12================================================================
  3059. sweets = [:STRAWBERRYSWEET,:LOVESWEET,:BERRYSWEET,:CLOVERSWEET,:FLOWERSWEET,
  3060. :STARSWEET,:RIBBONSWEET,:SWEETHEART,:CASTELIACONE,:OLDGATEAU,
  3061. :LAVACOOKIE,:RAGECANDYBAR,:PEWTERCRUNCHIES,:WHIPPEDDREAM,:RARECANDY,
  3062. :DYNAMAXCANDY]
  3063. #16===============================================================
  3064. expcandy = [:EXPCANDYXS,:EXPCANDYXS,:EXPCANDYS,:EXPCANDYS,:EXPCANDYM,:EXPCANDYM,
  3065. :EXPCANDYL,:EXPCANDYXL,:RARECANDY,:DYNAMAXCANDY]
  3066. #10===============================================================
  3067. berryscrap = [:BERRYJUICE,:BERRYJUICE,:BLACKSLUDGE,:MIRACLESEED,:MIRACLESEED,:LEFTOVERS]
  3068. #6================================================================
  3069. poweritem = [:POWERWEIGHT,:POWERBRACER,:POWERBELT,:POWERLENS,:POWERBAND,:POWERANKLET]
  3070. #6================================================================
  3071. wings = [:HEALTHWING,:MUSCLEWING,:RESISTWING,:GENIUSWING,:CLEVERWING,:SWIFTWING]
  3072. #6================================================================
  3073. potions = [:POTION,:SUPERPOTION,:SUPERPOTION,:HYPERPOTION,:MAXPOTION,:FULLRESTORE]
  3074. #6================================================================
  3075. statusitem = [:ANTIDOTE,:BURNHEAL,:AWAKENING,:ICEHEAL,:PARALYZEHEAL,:FULLHEAL]
  3076. #6================================================================
  3077. paperitem = [:REDCARD,:CLEANSETAG,:CLEANSETAG,:SPELLTAG,:DISCOUNTCOUPON,
  3078. :WEAKNESSPOLICY,:BLUNDERPOLICY]
  3079. #7================================================================
  3080. repels = [:REPEL,:REPEL,:SUPERREPEL,:SUPERREPEL,:MAXREPEL]
  3081. #5================================================================
  3082.  
  3083. #===============================================================================
  3084. # Creates items
  3085. #===============================================================================
  3086. # CREATES ELEMENTAL MATERIALS
  3087. if isConst?(pkmn.item,PBItems,:SACREDASH)
  3088. pkmn.setItem(:MIRACLESEED) if rand(100)>75
  3089. pkmn.setItem(:MYSTICWATER) if rand(100)>50
  3090. pkmn.setItem(:CHARCOAL) if rand(100)>25
  3091. pkmn.setItem(:RAREBONE) if rand(100)<25
  3092. # CREATES FRESH WATER
  3093. elsif (isConst?(pkmn.item,PBItems,:MYSTICWATER) ||
  3094. isConst?(pkmn.item,PBItems,:NEVERMELTICE))
  3095. pkmn.setItem(:FRESHWATER)
  3096. # CREATES NEVER-MELT ICE
  3097. elsif (isConst?(pkmn.item,PBItems,:CASTELIACONE) ||
  3098. isConst?(pkmn.item,PBItems,:SNOWBALL))
  3099. pkmn.setItem(:NEVERMELTICE)
  3100. # CREATES HONEY
  3101. elsif (isConst?(pkmn.item,PBItems,:BERRYJUICE) ||
  3102. isConst?(pkmn.item,PBItems,:LEMONADE) ||
  3103. isConst?(pkmn.item,PBItems,:SODAPOP) ||
  3104. isConst?(pkmn.item,PBItems,:PINKNECTAR) ||
  3105. isConst?(pkmn.item,PBItems,:PURPLENECTAR) ||
  3106. isConst?(pkmn.item,PBItems,:REDNECTAR) ||
  3107. isConst?(pkmn.item,PBItems,:YELLOWNECTAR))
  3108. pkmn.setItem(:HONEY)
  3109. # CREATES SEEDS & JUICE
  3110. elsif isConst?(pkmn.item,PBItems,:RINDOBERRY)
  3111. pkmn.setItem(:GRASSYSEED)
  3112. elsif isConst?(pkmn.item,PBItems,:WACANBERRY)
  3113. pkmn.setItem(:ELECTRICSEED)
  3114. elsif isConst?(pkmn.item,PBItems,:PAYAPABERRY)
  3115. pkmn.setItem(:PSYCHICSEED)
  3116. elsif isConst?(pkmn.item,PBItems,:ROSELIBERRY)
  3117. pkmn.setItem(:MISTYSEED)
  3118. elsif pbIsBerry?(pkmn.item)
  3119. pkmn.setItem(berryscrap[rand(5)])
  3120. # CREATES HERBS & ROOTS
  3121. elsif (isConst?(pkmn.item,PBItems,:MIRACLESEED) ||
  3122. isConst?(pkmn.item,PBItems,:GRASSYSEED) ||
  3123. isConst?(pkmn.item,PBItems,:ELECTRICSEED) ||
  3124. isConst?(pkmn.item,PBItems,:PSYCHICSEED) ||
  3125. isConst?(pkmn.item,PBItems,:MISTYSEED))
  3126. pkmn.setItem(herbs[rand(14)])
  3127. # CREATES MINTS
  3128. elsif (isConst?(pkmn.item,PBItems,:REVIVALHERB) ||
  3129. isConst?(pkmn.item,PBItems,:WHITEHERB) ||
  3130. isConst?(pkmn.item,PBItems,:POWERHERB) ||
  3131. isConst?(pkmn.item,PBItems,:MENTALHERB))
  3132. pkmn.setItem(mints[rand(20)])
  3133. # CREATES APRICORN
  3134. elsif (isConst?(pkmn.item,PBItems,:LEVELBALL) ||
  3135. isConst?(pkmn.item,PBItems,:REPEATBALL))
  3136. pkmn.setItem(:REDAPRICORN)
  3137. elsif (isConst?(pkmn.item,PBItems,:MOONBALL) ||
  3138. isConst?(pkmn.item,PBItems,:QUICKBALL))
  3139. pkmn.setItem(:YLWAPRICORN)
  3140. elsif (isConst?(pkmn.item,PBItems,:LUREBALL) ||
  3141. isConst?(pkmn.item,PBItems,:DIVEBALL) ||
  3142. isConst?(pkmn.item,PBItems,:NETBALL))
  3143. pkmn.setItem(:BLUAPRICORN)
  3144. elsif (isConst?(pkmn.item,PBItems,:FRIENDBALL) ||
  3145. isConst?(pkmn.item,PBItems,:NESTBALL))
  3146. pkmn.setItem(:GRENAPRICORN)
  3147. elsif (isConst?(pkmn.item,PBItems,:LOVEBALL) ||
  3148. isConst?(pkmn.item,PBItems,:HEALBALL) ||
  3149. isConst?(pkmn.item,PBItems,:DREAMBALL))
  3150. pkmn.setItem(:PNKAPRICORN)
  3151. elsif (isConst?(pkmn.item,PBItems,:FASTBALL) ||
  3152. isConst?(pkmn.item,PBItems,:PREMIERBALL) ||
  3153. isConst?(pkmn.item,PBItems,:TIMERBALL))
  3154. pkmn.setItem(:WHTAPRICORN)
  3155. elsif (isConst?(pkmn.item,PBItems,:HEAVYBALL) ||
  3156. isConst?(pkmn.item,PBItems,:LUXURYBALL) ||
  3157. isConst?(pkmn.item,PBItems,:DUSKBALL))
  3158. pkmn.setItem(:BLKAPRICORN)
  3159. elsif pbIsPokeBall?(pkmn.item)
  3160. pkmn.setItem(apricorn[rand(6)])
  3161. # CREATES INCENSE
  3162. elsif (isConst?(pkmn.item,PBItems,:SHOALSALT) ||
  3163. isConst?(pkmn.item,PBItems,:BRIGHTPOWDER) ||
  3164. isConst?(pkmn.item,PBItems,:QUICKPOWDER) ||
  3165. isConst?(pkmn.item,PBItems,:SILVERPOWDER))
  3166. pkmn.setItem(incenses[rand(9)])
  3167. # CREATES MONSTER PARTS
  3168. elsif isConst?(pkmn.item,PBItems,:LUCKYEGG)
  3169. pkmn.setItem(beastparts[rand(19)])
  3170. # CREATES FOSSILS
  3171. elsif isConst?(pkmn.item,PBItems,:RAREBONE)
  3172. pkmn.setItem(fossils[rand(16)])
  3173. # CREATES EXCAVATION ITEMS
  3174. elsif isConst?(pkmn.item,PBItems,:FIRESTONE)
  3175. pkmn.setItem(:HEATROCK)
  3176. elsif isConst?(pkmn.item,PBItems,:WATERSTONE)
  3177. pkmn.setItem(:DAMPROCK)
  3178. elsif isConst?(pkmn.item,PBItems,:ICESTONE)
  3179. pkmn.setItem(:ICYROCK)
  3180. elsif pbIsFossil?(pkmn.item) || pbIsEvolutionStone?(pkmn.item)
  3181. pkmn.setItem(excavation[rand(25)])
  3182. # CREATES PLATES
  3183. elsif (isConst?(pkmn.item,PBItems,:REDSHARD) ||
  3184. isConst?(pkmn.item,PBItems,:BLUESHARD) ||
  3185. isConst?(pkmn.item,PBItems,:GREENSHARD) ||
  3186. isConst?(pkmn.item,PBItems,:YELLOWSHARD))
  3187. pkmn.setItem(plates[rand(18)])
  3188. # CREATES ORBS
  3189. elsif (isConst?(pkmn.item,PBItems,:PEARL) ||
  3190. isConst?(pkmn.item,PBItems,:BIGPEARL))
  3191. pkmn.setItem(orbs[rand(7)])
  3192. # CREATES TREASURE
  3193. elsif (isConst?(pkmn.item,PBItems,:HARDSTONE) ||
  3194. isConst?(pkmn.item,PBItems,:EVERSTONE) ||
  3195. isConst?(pkmn.item,PBItems,:FLOATSTONE) ||
  3196. isConst?(pkmn.item,PBItems,:OVALSTONE) ||
  3197. isConst?(pkmn.item,PBItems,:CHARCOAL))
  3198. pkmn.setItem(treasure1[rand(11)])
  3199. elsif (isConst?(pkmn.item,PBItems,:NUGGET) ||
  3200. isConst?(pkmn.item,PBItems,:BIGNUGGET))
  3201. pkmn.setItem(treasure2[rand(11)])
  3202. # CREATES EVOLUTION STONES
  3203. elsif isConst?(pkmn.item,PBItems,:FIREGEM)
  3204. pkmn.setItem(:FIRESTONE)
  3205. elsif isConst?(pkmn.item,PBItems,:WATERGEM)
  3206. pkmn.setItem(:WATERSTONE)
  3207. elsif isConst?(pkmn.item,PBItems,:ELECTRICGEM)
  3208. pkmn.setItem(:THUNDERSTONE)
  3209. elsif isConst?(pkmn.item,PBItems,:GRASSGEM)
  3210. pkmn.setItem(:LEAFSTONE)
  3211. elsif isConst?(pkmn.item,PBItems,:ICEGEM)
  3212. pkmn.setItem(:ICESTONE)
  3213. elsif (isConst?(pkmn.item,PBItems,:DARKGEM) ||
  3214. isConst?(pkmn.item,PBItems,:GHOSTGEM))
  3215. pkmn.setItem(:DUSKSTONE)
  3216. elsif (isConst?(pkmn.item,PBItems,:FAIRYGEM) ||
  3217. isConst?(pkmn.item,PBItems,:NORMALGEM))
  3218. pkmn.setItem(:SHINYSTONE)
  3219. elsif (isConst?(pkmn.item,PBItems,:FIGHTINGGEM) ||
  3220. isConst?(pkmn.item,PBItems,:PSYCHICGEM))
  3221. pkmn.setItem(:DAWNSTONE)
  3222. elsif pbIsGem?(pkmn.item)
  3223. pkmn.setItem(evostones[rand(16)])
  3224. # CREATES EVIOLITE
  3225. elsif isConst?(pkmn.item,PBItems,:EVERSTONE)
  3226. pkmn.setItem(:EVIOLITE)
  3227. # CREATES SOFT SAND
  3228. elsif (isConst?(pkmn.item,PBItems,:ROCKYHELMET) ||
  3229. isConst?(pkmn.item,PBItems,:RELICSTATUE) ||
  3230. isConst?(pkmn.item,PBItems,:RELICVASE) ||
  3231. isConst?(pkmn.item,PBItems,:SMOOTHROCK) ||
  3232. isConst?(pkmn.item,PBItems,:ODDKEYSTONE) ||
  3233. isConst?(pkmn.item,PBItems,:LIGHTCLAY) ||
  3234. isConst?(pkmn.item,PBItems,:STRANGESOUVENIR))
  3235. pkmn.setItem(:SOFTSAND)
  3236. # CREATES SHELL BELL
  3237. elsif isConst?(pkmn.item,PBItems,:SHOALSHELL)
  3238. pkmn.setItem(:SHELLBELL)
  3239. # CREATES REPELS
  3240. elsif (pbIsMulch?(pkmn.item) ||
  3241. isConst?(pkmn.item,PBItems,:BLACKSLUDGE))
  3242. pkmn.setItem(repels[rand(4)])
  3243. # CREATES POTIONS
  3244. elsif isConst?(pkmn.item,PBItems,:ENERGYPOWDER)
  3245. pkmn.setItem(potions[rand(5)])
  3246. # CREATES STATUS CURES
  3247. elsif isConst?(pkmn.item,PBItems,:HEALPOWDER)
  3248. pkmn.setItem(statusitem[rand(5)])
  3249. # CREATES DRINKS
  3250. elsif isConst?(pkmn.item,PBItems,:FRESHWATER)
  3251. pkmn.setItem(liquids[rand(8)])
  3252. # CREATES SWEETS
  3253. elsif (isConst?(pkmn.item,PBItems,:HONEY) ||
  3254. isConst?(pkmn.item,PBItems,:MOOMOOMILK))
  3255. pkmn.setItem(sweets[rand(15)])
  3256. # CREATES GROWTH CANDY
  3257. elsif (isConst?(pkmn.item,PBItems,:SWEETHEART) ||
  3258. isConst?(pkmn.item,PBItems,:RAGECANDYBAR) ||
  3259. isConst?(pkmn.item,PBItems,:OLDGATEAU) ||
  3260. isConst?(pkmn.item,PBItems,:LAVACOOKIE) ||
  3261. isConst?(pkmn.item,PBItems,:CASTELIACONE) ||
  3262. isConst?(pkmn.item,PBItems,:PEWTERCRUNCHIES) ||
  3263. isConst?(pkmn.item,PBItems,:BIGMALASADA) ||
  3264. isConst?(pkmn.item,PBItems,:LUMIOSEGALETTE) ||
  3265. isConst?(pkmn.item,PBItems,:SHALOURSABLE))
  3266. pkmn.setItem(expcandy[rand(9)])
  3267. elsif (isConst?(pkmn.item,PBItems,:EXPCANDYXS) ||
  3268. isConst?(pkmn.item,PBItems,:EXPCANDYS) ||
  3269. isConst?(pkmn.item,PBItems,:EXPCANDYM) ||
  3270. isConst?(pkmn.item,PBItems,:EXPCANDYXL) ||
  3271. isConst?(pkmn.item,PBItems,:EXPCANDYXL) ||
  3272. isConst?(pkmn.item,PBItems,:DYNAMAXCANDY))
  3273. pkmn.setItem(:RARECANDY)
  3274. # CREATES WING ITEMS
  3275. elsif isConst?(pkmn.item,PBItems,:PRETTYWING)
  3276. pkmn.setItem(wings[rand(5)])
  3277. # CREATES VITAMINS
  3278. elsif (isConst?(pkmn.item,PBItems,:XATTACK) ||
  3279. isConst?(pkmn.item,PBItems,:XDEFENSE) ||
  3280. isConst?(pkmn.item,PBItems,:XSPATK) ||
  3281. isConst?(pkmn.item,PBItems,:XSPDEF) ||
  3282. isConst?(pkmn.item,PBItems,:XSPEED) ||
  3283. isConst?(pkmn.item,PBItems,:XACCURACY) ||
  3284. isConst?(pkmn.item,PBItems,:DIREHIT) ||
  3285. isConst?(pkmn.item,PBItems,:GUARDSPEC))
  3286. pkmn.setItem(vitamins[rand(8)])
  3287. # CREATES PP UP
  3288. elsif (isConst?(pkmn.item,PBItems,:ETHER) ||
  3289. isConst?(pkmn.item,PBItems,:MAXETHER))
  3290. pkmn.setItem(:PPUP)
  3291. # CREATES PP MAX
  3292. elsif (isConst?(pkmn.item,PBItems,:ELIXIR) ||
  3293. isConst?(pkmn.item,PBItems,:MAXELIXIR) ||
  3294. isConst?(pkmn.item,PBItems,:RARECANDY) ||
  3295. isConst?(pkmn.item,PBItems,:DYNAMAXCANDY) ||
  3296. isConst?(pkmn.item,PBItems,:ABILITYCAPSULE) ||
  3297. isConst?(pkmn.item,PBItems,:PPUP))
  3298. pkmn.setItem(:PPMAX)
  3299. # CREATES ABILITY CAPSULE
  3300. elsif isConst?(pkmn.item,PBItems,:PPMAX)
  3301. pkmn.setItem(:ABILITYCAPSULE)
  3302. # CREATES PAPER ITEMS
  3303. elsif pbIsMail?(pkmn.item)
  3304. pkmn.setItem(paperitem[rand(6)])
  3305. # CREATES GLASS ITEMS
  3306. elsif isConst?(pkmn.item,PBItems,:SOFTSAND)
  3307. pkmn.setItem(lenses[rand(11)])
  3308. # CREATES GROWTH GEAR
  3309. elsif (isConst?(pkmn.item,PBItems,:MACHOBRACE) ||
  3310. isConst?(pkmn.item,PBItems,:EXPSHARE))
  3311. pkmn.setItem(poweritem[rand(5)])
  3312. # CREATES ASSAULT VEST
  3313. elsif isConst?(pkmn.item,PBItems,:PROTECTOR)
  3314. pkmn.setItem(:ASSAULTVEST)
  3315. # CREATES ROCKY HELMET
  3316. elsif (isConst?(pkmn.item,PBItems,:KINGSROCK) ||
  3317. isConst?(pkmn.item,PBItems,:RELICCROWN))
  3318. pkmn.setItem(:ROCKYHELMET)
  3319. # CREATES CHIPPED POT
  3320. elsif isConst?(pkmn.item,PBItems,:CRACKEDPOT)
  3321. pkmn.setItem(:CHIPPEDPOT)
  3322. # CREATES FABRIC & CLOTHING
  3323. elsif (isConst?(pkmn.item,PBItems,:DESTINYKNOT) ||
  3324. isConst?(pkmn.item,PBItems,:REAPERCLOTH))
  3325. pkmn.setItem(clothing[rand(13)])
  3326. elsif (isConst?(pkmn.item,PBItems,:REDSCARF) ||
  3327. isConst?(pkmn.item,PBItems,:BLUESCARF) ||
  3328. isConst?(pkmn.item,PBItems,:PINKSCARF) ||
  3329. isConst?(pkmn.item,PBItems,:GREENSCARF) ||
  3330. isConst?(pkmn.item,PBItems,:YELLOWSCARF) ||
  3331. isConst?(pkmn.item,PBItems,:SILKSCARF) ||
  3332. isConst?(pkmn.item,PBItems,:FOCUSSASH) ||
  3333. isConst?(pkmn.item,PBItems,:POKEDOLL))
  3334. pkmn.setItem(:REAPERCLOTH)
  3335. elsif (isConst?(pkmn.item,PBItems,:EXPERTBELT) ||
  3336. isConst?(pkmn.item,PBItems,:MUSCLEBAND) ||
  3337. isConst?(pkmn.item,PBItems,:FOCUSBAND) ||
  3338. isConst?(pkmn.item,PBItems,:BINDINGBAND) ||
  3339. isConst?(pkmn.item,PBItems,:BLACKBELT) ||
  3340. isConst?(pkmn.item,PBItems,:ESCAPEROPE) ||
  3341. isConst?(pkmn.item,PBItems,:FLUFFYTAIL))
  3342. pkmn.setItem(:DESTINYKNOT)
  3343. # CREATES GADGETS & METALS
  3344. elsif (isConst?(pkmn.item,PBItems,:METALCOAT) ||
  3345. isConst?(pkmn.item,PBItems,:IRONBALL) ||
  3346. isConst?(pkmn.item,PBItems,:LUCKYPUNCH) ||
  3347. isConst?(pkmn.item,PBItems,:CELLBATTERY))
  3348. pkmn.setItem(gadgets[rand(19)])
  3349. elsif (isConst?(pkmn.item,PBItems,:SOOTHEBELL) ||
  3350. isConst?(pkmn.item,PBItems,:RELICSILVER) ||
  3351. isConst?(pkmn.item,PBItems,:RELICCOPPER) ||
  3352. isConst?(pkmn.item,PBItems,:RELICGOLD) ||
  3353. isConst?(pkmn.item,PBItems,:RELICBAND) ||
  3354. isConst?(pkmn.item,PBItems,:TWISTEDSPOON))
  3355. pkmn.setItem(:METALPOWDER)
  3356. elsif isConst?(pkmn.item,PBItems,:METALPOWDER)
  3357. pkmn.setItem(:METALCOAT)
  3358. # CREATES CELL BATTERY
  3359. elsif (isConst?(pkmn.item,PBItems,:EJECTBUTTON) ||
  3360. isConst?(pkmn.item,PBItems,:ELECTIRIZER) ||
  3361. isConst?(pkmn.item,PBItems,:EJECTPACK))
  3362. pkmn.setItem(:CELLBATTERY)
  3363. # CREATES MEMORIES
  3364. elsif (isConst?(pkmn.item,PBItems,:UPGRADE) ||
  3365. isConst?(pkmn.item,PBItems,:DUBIOUSDISC))
  3366. pkmn.setItem(memories[rand(16)])
  3367. # CREATES POKEBALLS
  3368. elsif isConst?(pkmn.item,PBItems,:REDAPRICORN)
  3369. pkmn.setItem(:LEVELBALL)
  3370. elsif isConst?(pkmn.item,PBItems,:YLWAPRICORN)
  3371. pkmn.setItem(:MOONBALL)
  3372. elsif isConst?(pkmn.item,PBItems,:BLUAPRICORN)
  3373. pkmn.setItem(:LUREBALL)
  3374. elsif isConst?(pkmn.item,PBItems,:GRNAPRICORN)
  3375. pkmn.setItem(:FRIENDBALL)
  3376. elsif isConst?(pkmn.item,PBItems,:PNKAPRICORN)
  3377. pkmn.setItem(:LOVEBALL)
  3378. elsif isConst?(pkmn.item,PBItems,:WHTAPRICORN)
  3379. pkmn.setItem(:FASTBALL)
  3380. elsif isConst?(pkmn.item,PBItems,:BLKAPRICORN)
  3381. pkmn.setItem(:HEAVYBALL)
  3382. # CREATES ZODIAC GEMS
  3383. elsif (isConst?(pkmn.item,PBItems,:STARPIECE) ||
  3384. isConst?(pkmn.item,PBItems,:COMETSHARD) ||
  3385. isConst?(pkmn.item,PBItems,:WISHINGPIECE))
  3386. pkmn.setItem(zodiacgem[rand(11)])
  3387. # CREATES STARDUST
  3388. elsif pbIsZodiacGem?(pkmn.item)
  3389. pkmn.setItem(:STARDUST)
  3390. $PokemonBag.pbStoreItem(:STARDUST)
  3391. else
  3392. # CREATES POWDER
  3393. pkmn.setItem(junkitem[rand(12)])
  3394. end
  3395. if !pkmn.hasItem? #Gives junk item if named item isn't present
  3396. pkmn.setItem(junkitem[rand(12)])
  3397. end
  3398. pbRitualAnimation(pkmn)
  3399. $PokemonBag.pbDeleteItem(:STARDUST)
  3400. pbWait(1)
  3401. pbMEPlay("Pkmn get")
  3402. if isConst?(pkmn.item,PBItems,:LEFTOVERS)
  3403. Kernel.pbMessage(_INTL("{1} created some <c2=65467b14>{2}</c2> using the power of <c2=65467b14>{3}</c2>!",
  3404. pkmn.name,PBItems.getName(pkmn.item),pkmn.pbGetBirthsignName))
  3405. elsif ['a','e','i','o','u'].include?(PBItems.getName(pkmn.item)[0,1].downcase)
  3406. Kernel.pbMessage(_INTL("{1} created an <c2=65467b14>{2}</c2> using the power of <c2=65467b14>{3}</c2>!",
  3407. pkmn.name,PBItems.getName(pkmn.item),pkmn.pbGetBirthsignName))
  3408. else
  3409. Kernel.pbMessage(_INTL("{1} created a <c2=65467b14>{2}</c2> using the power of <c2=65467b14>{3}</c2>!",
  3410. pkmn.name,PBItems.getName(pkmn.item),pkmn.pbGetBirthsignName))
  3411. end
  3412. pbWait(2)
  3413. end
  3414. end
  3415. end
  3416. #===============================================================================
  3417. # Birthsigns - The Cultist
  3418. # Summon Skill effect: Spawns a wild Shadow Pokemon by sacrificing stats.
  3419. #===============================================================================
  3420. elsif cmdSummon>=0 && command==cmdSummon
  3421. # The species list that may be summoned
  3422. speciesS=[:MEWTWO,:LUGIA,:REGIGIGAS,:GIRATINA,:DARKRAI,:ARCEUS,:DIALGA,
  3423. :PALKIA,:ZEKROM,:RESHIRAM]
  3424. speciesA=[:GENGAR,:MISMAGIUS,:CHANDELURE,:COFAGRIGUS,:HYDREIGON,:GOLURK,
  3425. :GOTHITELLE,:GLISCOR,:DUSKNOIR,:SPIRITOMB]
  3426. speciesB=[:WEEZING,:BANNET,:DUSCLOPS,:ABSOL,:SWOOBAT,:LIEPARD,:ZWEILOUS,
  3427. :ZOROARK,:SABLEYE,:GOTHORITA]
  3428. speciesC=[:RATICATE,:ARBOK,:HYPNO,:GOLBAT,:MAROWAK,:HAUNTER,:ARIADOS,
  3429. :GLIGAR,:LAMPENT,:HOUNDOOM]
  3430. speciesD=[:KOFFING,:SHUPPET,:DUSKULL,:YAMASK,:WOOBAT,:PURRLOIN,:DEINO,
  3431. :ZORUA,:GOLET,:GOTHITA]
  3432. speciesE=[:RATTATA,:EKANS,:DROWZEE,:ZUBAT,:CUBONE,:GASTLY,:SPINARAK,
  3433. :MISDREAVUS,:LITWICK,:HOUNDOUR]
  3434. # The items that may be randomly held
  3435. itemS=[:OLDAMBER,:COMETSHARD,:RELICSTATUE,:RELICCROWN,:LUCKYEGG,:LIFEORB,
  3436. :ODDKEYSTONE,:REAPERCLOTH,:SACREDASH,:STARDUST]
  3437. itemA=[:DUSKSTONE,:DAWNSTONE,:SHINYSTONE,:SKULLFOSSIL,:DOMEFOSSIL,
  3438. :ODDKEYSTONE,:RELICBAND,:LUCKYEGG,:BIGNUGGET,:STARDUST]
  3439. itemB=[:MOONSTONE,:SUNSTONE,:HELIXFOSSIL,:CLAWFOSSIL,:PLUMEFOSSIL,
  3440. :LUCKYEGG,:RAREBONE,:NUGGET,:STARPIECE,:STARDUST]
  3441. itemC=[:ROOTFOSSIL,:COVERFOSSIL,:ARMORFOSSIL,:SMOKEBALL,:STICKYBARB,
  3442. :SPELLTAG,:STARPIECE,:STARDUST,:STARDUST,:STARDUST]
  3443. itemD=[:REDSHARD,:YELLOWSHARD,:BLUESHARD,:GREENSHARD,:SMOKEBALL,
  3444. :STICKYBARB,:CLEANSETAG,:STARDUST,:STARDUST,:STARDUST]
  3445. itemE=[:ENERGYPOWDER,:HEALPOWDER,:CHARCOAL,:STICKYBARB,:EVERSTONE,
  3446. :STARDUST,:STARDUST,:STARDUST,:STARDUST,:STARDUST]
  3447. # The possible level ranges for each species rank
  3448. levelS=[52,54,56,58,60,62,64,66,68,70]
  3449. levelA=[40,41,42,43,44,45,46,47,48,49]
  3450. levelB=[30,31,32,33,34,35,36,37,38,39]
  3451. levelC=[20,21,22,23,24,25,26,27,28,29]
  3452. levelD=[10,11,12,13,14,15,16,17,18,19]
  3453. levelE=[2,3,4,4,5,5,6,7,8,9]
  3454. if (!pbGetMetadata($game_map.map_id,MetadataOutdoor) || !PBDayNight.isNight?) && !$DEBUG
  3455. Kernel.pbMessage(_INTL("This power can only be used under a night sky.",pkmn.name))
  3456. elsif totalIVs==0
  3457. Kernel.pbMessage(_INTL("{1}'s stats are too drained to summon anymore...",pkmn.name))
  3458. elsif follower
  3459. Kernel.pbMessage(_INTL("This power can't be used when you have someone with you."))
  3460. else
  3461. rank=["?","E","D","C","B","A","S"]
  3462. if totalIVs>=180 && pkmn.level>=50 # Rank:S
  3463. quality=6
  3464. elsif totalIVs>=144 && pkmn.level>=40 # Rank:A
  3465. quality=5
  3466. elsif totalIVs>=108 && pkmn.level>=30 # Rank:B
  3467. quality=4
  3468. elsif totalIVs>=72 && pkmn.level>=20 # Rank:C
  3469. quality=3
  3470. elsif totalIVs>=36 && pkmn.level>=10 # Rank:D
  3471. quality=2
  3472. elsif totalIVs<36 || pkmn.level<10 # Rank:E
  3473. quality=1
  3474. end
  3475. if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?\n<c2=65467b14>Summon Rank: {2}</c2>",pkmn.name,rank[quality]))
  3476. Kernel.pbMessage(_INTL("Activating this birthsign will drain {1}'s IV's.",pkmn.name))
  3477. pbWait(10)
  3478. if Kernel.pbConfirmMessage(_INTL("Continue summoning anyway?\n<c2=65467b14>Summon Rank: {1}</c2>",rank[quality]))
  3479. Kernel.pbMessage(_INTL("{1}'s IV's were all reduced by {2}!",pkmn.name,quality))
  3480. @scene.pbEndScene
  3481. # Reduces user's IV's with each Summon
  3482. pkmn.iv[0]-=quality
  3483. pkmn.iv[0]=0 if pkmn.iv[0]<=0
  3484. pkmn.iv[1]-=quality
  3485. pkmn.iv[1]=0 if pkmn.iv[1]<=0
  3486. pkmn.iv[2]-=quality
  3487. pkmn.iv[2]=0 if pkmn.iv[2]<=0
  3488. pkmn.iv[3]-=quality
  3489. pkmn.iv[3]=0 if pkmn.iv[3]<=0
  3490. pkmn.iv[4]-=quality
  3491. pkmn.iv[4]=0 if pkmn.iv[4]<=0
  3492. pkmn.iv[5]-=quality
  3493. pkmn.iv[5]=0 if pkmn.iv[5]<=0
  3494. pkmn.calcStats
  3495. pkmn.hp=1 if pkmn.hp<=0
  3496. pbRefresh
  3497. pbRitualAnimation(pkmn)
  3498. pbWait(10)
  3499. Kernel.pbMessage(_INTL("A wild Pokémon was pulled from the void!"))
  3500. Kernel.pbMessage(_INTL("The wild Pokémon attacked in a rage!"))
  3501. pbWait(10)
  3502. $game_switches[SUMMON_SWITCH]=true
  3503. Events.onWildPokemonCreate+=proc {|sender,e|
  3504. pokemon=e[0]
  3505. if $game_switches[SUMMON_SWITCH]
  3506. pokemon.iv=[31,31,31,31,31,31]
  3507. pokemon.obtainText=_INTL("Summoned from the void.")
  3508. pokemon.setAbility(2)
  3509. pokemon.setBirthsign(0)
  3510. pokemon.makeShadow
  3511. if rand(100)>50
  3512. pokemon.setItem(itemS[rand(9)]) if quality==6 # Rank:S
  3513. pokemon.setItem(itemA[rand(9)]) if quality==5 # Rank:A
  3514. pokemon.setItem(itemB[rand(9)]) if quality==4 # Rank:B
  3515. pokemon.setItem(itemC[rand(9)]) if quality==3 # Rank:C
  3516. pokemon.setItem(itemD[rand(9)]) if quality==2 # Rank:D
  3517. pokemon.setItem(itemE[rand(9)]) if quality==1 # Rank:E
  3518. end
  3519. end
  3520. }
  3521. $PokemonGlobal.nextBattleBGM="Summon Battle"
  3522. if quality==6 # Rank:S
  3523. pbWildBattle(speciesS[rand(9)],levelS[rand(9)])
  3524. elsif quality==5 # Rank:A
  3525. pbWildBattle(speciesA[rand(9)],levelA[rand(9)])
  3526. elsif quality==4 # Rank:B
  3527. pbWildBattle(speciesB[rand(9)],levelB[rand(9)])
  3528. elsif quality==3 # Rank:C
  3529. pbWildBattle(speciesC[rand(9)],levelC[rand(9)])
  3530. elsif quality==2 # Rank:D
  3531. pbWildBattle(speciesD[rand(9)],levelD[rand(9)])
  3532. elsif quality==1 # Rank:E
  3533. pbWildBattle(speciesE[rand(9)],levelE[rand(9)])
  3534. end
  3535. $game_switches[SUMMON_SWITCH]=false
  3536. end
  3537. pbRefresh
  3538. break
  3539. end
  3540. end
  3541. #===============================================================================
  3542. elsif cmdMail>=0 && command==cmdMail
  3543. command = @scene.pbShowCommands(_INTL("Do what with the mail?"),
  3544. [_INTL("Read"),_INTL("Take"),_INTL("Cancel")])
  3545. case command
  3546. when 0 # Read
  3547. pbFadeOutIn(99999){ pbDisplayMail(pkmn.mail,pkmn) }
  3548. when 1 # Take
  3549. if pbTakeItemFromPokemon(pkmn,self)
  3550. pbRefreshSingle(pkmnid)
  3551. end
  3552. end
  3553. elsif cmdItem>=0 && command==cmdItem
  3554. itemcommands = []
  3555. cmdUseItem = -1
  3556. cmdGiveItem = -1
  3557. cmdTakeItem = -1
  3558. cmdMoveItem = -1
  3559. # Build the commands
  3560. itemcommands[cmdUseItem=itemcommands.length] = _INTL("Use")
  3561. itemcommands[cmdGiveItem=itemcommands.length] = _INTL("Give")
  3562. itemcommands[cmdTakeItem=itemcommands.length] = _INTL("Take") if pkmn.hasItem?
  3563. itemcommands[cmdMoveItem=itemcommands.length] = _INTL("Move") if pkmn.hasItem? && !pbIsMail?(pkmn.item)
  3564. itemcommands[itemcommands.length] = _INTL("Cancel")
  3565. command = @scene.pbShowCommands(_INTL("Do what with an item?"),itemcommands)
  3566. if cmdUseItem>=0 && command==cmdUseItem # Use
  3567. item = @scene.pbUseItem($PokemonBag,pkmn)
  3568. if item>0
  3569. pbUseItemOnPokemon(item,pkmn,self)
  3570. pbRefreshSingle(pkmnid)
  3571. end
  3572. elsif cmdGiveItem>=0 && command==cmdGiveItem # Give
  3573. item = @scene.pbChooseItem($PokemonBag)
  3574. if item>0
  3575. if pbGiveItemToPokemon(item,pkmn,self,pkmnid)
  3576. pbRefreshSingle(pkmnid)
  3577. end
  3578. end
  3579. elsif cmdTakeItem>=0 && command==cmdTakeItem # Take
  3580. if pbTakeItemFromPokemon(pkmn,self)
  3581. pbRefreshSingle(pkmnid)
  3582. end
  3583. elsif cmdMoveItem>=0 && command==cmdMoveItem # Move
  3584. item = pkmn.item
  3585. itemname = PBItems.getName(item)
  3586. @scene.pbSetHelpText(_INTL("Move {1} to where?",itemname))
  3587. oldpkmnid = pkmnid
  3588. loop do
  3589. @scene.pbPreSelect(oldpkmnid)
  3590. pkmnid = @scene.pbChoosePokemon(true,pkmnid)
  3591. break if pkmnid<0
  3592. newpkmn = @party[pkmnid]
  3593. if pkmnid==oldpkmnid
  3594. break
  3595. elsif newpkmn.egg?
  3596. pbDisplay(_INTL("Eggs can't hold items."))
  3597. elsif !newpkmn.hasItem?
  3598. newpkmn.setItem(item)
  3599. pkmn.setItem(0)
  3600. @scene.pbClearSwitching
  3601. pbRefresh
  3602. pbDisplay(_INTL("{1} was given the {2} to hold.",newpkmn.name,itemname))
  3603. break
  3604. elsif pbIsMail?(newpkmn.item)
  3605. pbDisplay(_INTL("{1}'s mail must be removed before giving it an item.",newpkmn.name))
  3606. else
  3607. newitem = newpkmn.item
  3608. newitemname = PBItems.getName(newitem)
  3609. if isConst?(newitem,PBItems,:LEFTOVERS)
  3610. pbDisplay(_INTL("{1} is already holding some {2}.\1",newpkmn.name,newitemname))
  3611. elsif ['a','e','i','o','u'].include?(newitemname[0,1].downcase)
  3612. pbDisplay(_INTL("{1} is already holding an {2}.\1",newpkmn.name,newitemname))
  3613. else
  3614. pbDisplay(_INTL("{1} is already holding a {2}.\1",newpkmn.name,newitemname))
  3615. end
  3616. if pbConfirm(_INTL("Would you like to switch the two items?"))
  3617. newpkmn.setItem(item)
  3618. pkmn.setItem(newitem)
  3619. @scene.pbClearSwitching
  3620. pbRefresh
  3621. pbDisplay(_INTL("{1} was given the {2} to hold.",newpkmn.name,itemname))
  3622. pbDisplay(_INTL("{1} was given the {2} to hold.",pkmn.name,newitemname))
  3623. break
  3624. end
  3625. end
  3626. end
  3627. end
  3628. end
  3629. end
  3630. @scene.pbEndScene
  3631. return nil
  3632. end
  3633. end
  3634.  
  3635. #########[SECTION 5 - SUMMARY DISPLAY]##########
  3636. #===============================================================================
  3637. # Birthsigns Summary - Page rewrites
  3638. #===============================================================================
  3639. # Overwrites areas within the PScreen_Summary section.
  3640. #===============================================================================
  3641. class PokemonSummary_Scene
  3642. #=============================================================================
  3643. # Zodiac Token
  3644. #=============================================================================
  3645. def pbDisplaySummaryToken
  3646. if @pokemon.hasBirthsign?
  3647. overlay = @sprites["overlay"].bitmap
  3648. imagepos=[]
  3649. tokenpath1="Graphics/Pictures/Birthsigns/token%02d"
  3650. tokenpath2="Graphics/Pictures/Birthsigns/bless_token%02d"
  3651. if @pokemon.isBlessed?
  3652. zodiactoken=sprintf(tokenpath2,PBBirthsigns.signValue(@pokemon.birthsign))
  3653. else
  3654. zodiactoken=sprintf(tokenpath1,PBBirthsigns.signValue(@pokemon.birthsign))
  3655. end
  3656. imagepos.push([zodiactoken,0,234,0,0,-1,-1])
  3657. pbDrawImagePositions(overlay,imagepos)
  3658. end
  3659. end
  3660. #===========================================================================
  3661. # Birthsign Page Button
  3662. #===========================================================================
  3663. def pbDisplayZodiacButton
  3664. if @pokemon.hasBirthsign?
  3665. overlay = @sprites["overlay"].bitmap
  3666. imagepos=[]
  3667. button = sprintf("Graphics/Pictures/Birthsigns/Other/summarybutton")
  3668. imagepos.push([button,158,316,0,0,-1,-1])
  3669. pbDrawImagePositions(overlay,imagepos)
  3670. end
  3671. end
  3672. #=============================================================================
  3673. # Shiny Leaf - Shows Shiny Leaves or Crown
  3674. #=============================================================================
  3675. def pbDisplayShinyLeaf
  3676. if SHOW_SHINY_LEAF
  3677. leaf="Graphics/Pictures/Birthsigns/Other/leaf"
  3678. leafcrown="Graphics/Pictures/Birthsigns/Other/leafcrown"
  3679. overlay = @sprites["overlay"].bitmap
  3680. imagepos=[]
  3681. if @pokemon.leafflag!=nil && !@pokemon.egg?
  3682. if @pokemon.shinyleaf==6 || @pokemon.shinyleaf>6
  3683. imagepos.push([leafcrown,164,121,0,0,-1,-1])
  3684. else
  3685. imagepos.push([leaf,142,124,0,0,-1,-1]) if @pokemon.shinyleaf>4
  3686. imagepos.push([leaf,152,124,0,0,-1,-1]) if @pokemon.shinyleaf>3
  3687. imagepos.push([leaf,162,124,0,0,-1,-1]) if @pokemon.shinyleaf>2
  3688. imagepos.push([leaf,172,124,0,0,-1,-1]) if @pokemon.shinyleaf>1
  3689. imagepos.push([leaf,182,124,0,0,-1,-1]) if @pokemon.shinyleaf>0
  3690. end
  3691. end
  3692. pbDrawImagePositions(overlay,imagepos)
  3693. end
  3694. end
  3695. #=============================================================================
  3696. # Egg Groups - Shows Pokemon's Egg Groups on Page 2 (Memo)
  3697. #=============================================================================
  3698. def pbDisplayEggGroups
  3699. if SHOW_EGG_GROUPS
  3700. if !@pokemon.egg?
  3701. dexdata=pbOpenDexData
  3702. pbDexDataOffset(dexdata,@pokemon.species,31)
  3703. compat10=dexdata.fgetb
  3704. compat11=dexdata.fgetb
  3705. noGender=(@pokemon.isGenderless? && !isConst?(@pokemon.species,PBSpecies,:DITTO))
  3706. eggGroupbitmap=AnimatedBitmap.new(_INTL("Graphics/Pictures/Birthsigns/Other/typesEgg"))
  3707. eggGroup0rect=Rect.new(0,700,64,28)
  3708. eggGroup1rect=Rect.new(0,compat10*28,64,28)
  3709. eggGroup2rect=Rect.new(0,compat11*28,64,28)
  3710. overlay = @sprites["overlay"].bitmap
  3711. if (noGender && compat10!=0) || @pokemon.isCelestial?
  3712. overlay.blt(364,336,eggGroupbitmap.bitmap,eggGroup0rect)
  3713. elsif compat10==compat11
  3714. overlay.blt(364,336,eggGroupbitmap.bitmap,eggGroup1rect)
  3715. else
  3716. overlay.blt(364,336,eggGroupbitmap.bitmap,eggGroup1rect)
  3717. overlay.blt(432,336,eggGroupbitmap.bitmap,eggGroup2rect)
  3718. end
  3719. dexdata.close
  3720. end
  3721. if compat10>14 || @pokemon.isCelestial?
  3722. textpos=[[_INTL("Egg Groups:"),234,334,0,Color.new(41,86,143),Color.new(150,177,210)]]
  3723. else
  3724. textpos=[[_INTL("Egg Groups:"),234,334,0,Color.new(64,64,64),Color.new(176,176,176)]]
  3725. end
  3726. pbDrawTextPositions(overlay,textpos)
  3727. end
  3728. end
  3729. #=============================================================================
  3730. # IV Stars - Shows IV Star ratings on Page 3 (Stats)
  3731. #=============================================================================
  3732. def pbDisplayIVStars
  3733. if SHOW_IV_STARS
  3734. nostar="Graphics/Pictures/Birthsigns/Other/starempty"
  3735. lowstar="Graphics/Pictures/Birthsigns/Other/starlow"
  3736. highstar="Graphics/Pictures/Birthsigns/Other/starhigh"
  3737. perfectstar="Graphics/Pictures/Birthsigns/Other/starperfect"
  3738. overlay = @sprites["overlay"].bitmap
  3739. imagepos=[]
  3740. imagepos.push([nostar,465,82,0,0,-1,-1])
  3741. imagepos.push([nostar,465,126,0,0,-1,-1])
  3742. imagepos.push([nostar,465,158,0,0,-1,-1])
  3743. imagepos.push([nostar,465,190,0,0,-1,-1])
  3744. imagepos.push([nostar,465,222,0,0,-1,-1])
  3745. imagepos.push([nostar,465,254,0,0,-1,-1])
  3746. #HP
  3747. if @pokemon.iv[0]>30
  3748. imagepos.push([perfectstar,465,82,0,0,-1,-1])
  3749. elsif @pokemon.iv[0]>29
  3750. imagepos.push([highstar,465,82,0,0,-1,-1])
  3751. elsif @pokemon.iv[0]>0 && @pokemon.iv[0]<30
  3752. imagepos.push([lowstar,465,82,0,0,-1,-1])
  3753. end
  3754. #Atk
  3755. if @pokemon.iv[1]>30
  3756. imagepos.push([perfectstar,465,126,0,0,-1,-1])
  3757. elsif @pokemon.iv[1]>29
  3758. imagepos.push([highstar,465,126,0,0,-1,-1])
  3759. elsif @pokemon.iv[1]>0 && @pokemon.iv[1]<30
  3760. imagepos.push([lowstar,465,126,0,0,-1,-1])
  3761. end
  3762. #Def
  3763. if @pokemon.iv[2]>30
  3764. imagepos.push([perfectstar,465,158,0,0,-1,-1])
  3765. elsif @pokemon.iv[2]>29
  3766. imagepos.push([highstar,465,158,0,0,-1,-1])
  3767. elsif @pokemon.iv[2]>0 && @pokemon.iv[2]<30
  3768. imagepos.push([lowstar,465,158,0,0,-1,-1])
  3769. end
  3770. #SpAtk
  3771. if @pokemon.iv[4]>30
  3772. imagepos.push([perfectstar,465,190,0,0,-1,-1])
  3773. elsif @pokemon.iv[4]>29
  3774. imagepos.push([highstar,465,190,0,0,-1,-1])
  3775. elsif @pokemon.iv[4]>0 && @pokemon.iv[4]<30
  3776. imagepos.push([lowstar,465,190,0,0,-1,-1])
  3777. end
  3778. #SpDef
  3779. if @pokemon.iv[5]>30
  3780. imagepos.push([perfectstar,465,222,0,0,-1,-1])
  3781. elsif @pokemon.iv[5]>29
  3782. imagepos.push([highstar,465,222,0,0,-1,-1])
  3783. elsif @pokemon.iv[5]>0 && @pokemon.iv[5]<30
  3784. imagepos.push([lowstar,465,222,0,0,-1,-1])
  3785. end
  3786. #Speed
  3787. if @pokemon.iv[3]>30
  3788. imagepos.push([perfectstar,465,254,0,0,-1,-1])
  3789. elsif @pokemon.iv[3]>29
  3790. imagepos.push([highstar,465,254,0,0,-1,-1])
  3791. elsif @pokemon.iv[3]>0 && @pokemon.iv[3]<30
  3792. imagepos.push([lowstar,465,254,0,0,-1,-1])
  3793. end
  3794. pbDrawImagePositions(overlay,imagepos)
  3795. end
  3796. end
  3797. #=============================================================================
  3798.  
  3799. def drawPage(page)
  3800. if @pokemon.egg?
  3801. drawPageOneEgg; return
  3802. end
  3803. @sprites["pokemon"].z = 255
  3804. @sprites["itemicon"].item = @pokemon.item
  3805. @sprites["itemicon"].visible = true
  3806. overlay = @sprites["overlay"].bitmap
  3807. overlay.clear
  3808. base = Color.new(248,248,248)
  3809. shadow = Color.new(104,104,104)
  3810. # Set background image
  3811. @sprites["background"].setBitmap("Graphics/Pictures/Summary/bg_#{page}")
  3812. imagepos=[]
  3813. # Show the Poké Ball containing the Pokémon
  3814. ballimage = sprintf("Graphics/Pictures/Summary/icon_ball_%02d",@pokemon.ballused)
  3815. imagepos.push([ballimage,14,60,0,0,-1,-1])
  3816. # Show status/fainted/Pokérus infected icon
  3817. status = -1
  3818. status = 6 if @pokemon.pokerusStage==1
  3819. status = @pokemon.status-1 if @pokemon.status>0
  3820. status = 5 if @pokemon.hp==0
  3821. if status>=0
  3822. imagepos.push(["Graphics/Pictures/statuses",124,100,0,16*status,44,16])
  3823. end
  3824. # Show Pokérus cured icon
  3825. if @pokemon.pokerusStage==2
  3826. imagepos.push([sprintf("Graphics/Pictures/Summary/icon_pokerus"),176,100,0,0,-1,-1])
  3827. end
  3828. # Show shininess star
  3829. if @pokemon.isShiny?
  3830. imagepos.push([sprintf("Graphics/Pictures/shiny"),2,134,0,0,-1,-1])
  3831. end
  3832. #===========================================================================
  3833. # Page additions
  3834. #===========================================================================
  3835. pbDisplaySummaryToken
  3836. pbDisplayShinyLeaf
  3837. pbDisplayZodiacButton if @page==2
  3838. pbDisplayEggGroups if @page==2
  3839. pbDisplayIVStars if @page==3
  3840. #===========================================================================
  3841. # Draw all images
  3842. pbDrawImagePositions(overlay,imagepos)
  3843. textpos = []
  3844. # Write various bits of text
  3845. pagename = [_INTL("INFO"),
  3846. _INTL("TRAINER MEMO"),
  3847. _INTL("SKILLS"),
  3848. _INTL("MOVES"),
  3849. _INTL("RIBBONS"),
  3850. # Family Tree compatibility
  3851. if SHOW_FAMILYTREE
  3852. _INTL("FAMILY TREE")
  3853. end][page-1]
  3854. textpos = [
  3855. [pagename,26,16,0,base,shadow],
  3856. [@pokemon.name,46,62,0,base,shadow],
  3857. [@pokemon.level.to_s,46,92,0,Color.new(64,64,64),Color.new(176,176,176)],
  3858. [_INTL("Item"),66,318,0,base,shadow]
  3859. ]
  3860. # Write the held item's name
  3861. if @pokemon.hasItem?
  3862. textpos.push([PBItems.getName(@pokemon.item),16,352,0,Color.new(64,64,64),Color.new(176,176,176)])
  3863. else
  3864. textpos.push([_INTL("None"),16,352,0,Color.new(192,200,208),Color.new(208,216,224)])
  3865. end
  3866. # Write the gender symbol
  3867. if @pokemon.isMale?
  3868. textpos.push([_INTL("♂"),178,62,0,Color.new(24,112,216),Color.new(136,168,208)])
  3869. elsif @pokemon.isFemale?
  3870. textpos.push([_INTL("♀"),178,62,0,Color.new(248,56,32),Color.new(224,152,144)])
  3871. end
  3872. # Draw all text
  3873. pbDrawTextPositions(overlay,textpos)
  3874. # Draw the Pokémon's markings
  3875. drawMarkings(overlay,84,292)
  3876. # Draw page-specific information
  3877. case page
  3878. when 1; drawPageOne
  3879. when 2; drawPageTwo
  3880. when 3; drawPageThree
  3881. when 4; drawPageFour
  3882. when 5; drawPageFive
  3883. # Family Tree compatibility
  3884. when 6; drawPageSix if SHOW_FAMILYTREE
  3885. end
  3886. end
  3887.  
  3888. #===============================================================================
  3889. # Page 1: Egg
  3890. # Change: Item text is now hidden. Used for Partner Sign breeding effects.
  3891. #===============================================================================
  3892. def drawPageOneEgg
  3893. @sprites["itemicon"].visible = false
  3894. overlay = @sprites["overlay"].bitmap
  3895. overlay.clear
  3896. base = Color.new(248,248,248)
  3897. shadow = Color.new(104,104,104)
  3898. pbSetSystemFont(overlay)
  3899. # Set background image
  3900. @sprites["background"].setBitmap("Graphics/Pictures/Summary/bg_egg")
  3901. imagepos = []
  3902. # Show the Poké Ball containing the Pokémon
  3903. ballimage = sprintf("Graphics/Pictures/Summary/icon_ball_%02d",@pokemon.ballused)
  3904. imagepos.push([ballimage,14,60,0,0,-1,-1])
  3905. # Draw all images
  3906. pbDrawImagePositions(overlay,imagepos)
  3907. # Write various bits of text
  3908. textpos=[
  3909. [_INTL("TRAINER MEMO"),26,16,0,base,shadow],
  3910. [@pokemon.name,46,62,0,base,shadow]
  3911. ]
  3912. # Draw all text
  3913. pbDrawTextPositions(overlay,textpos)
  3914. memo = ""
  3915. # Write date received
  3916. if @pokemon.timeReceived
  3917. date = @pokemon.timeReceived.day
  3918. month = pbGetMonthName(@pokemon.timeReceived.mon)
  3919. year = @pokemon.timeReceived.year
  3920. memo += _INTL("<c3=404040,B0B0B0>{1} {2}, {3}\n",date,month,year)
  3921. end
  3922. # Write map name egg was received on
  3923. mapname = pbGetMapNameFromId(@pokemon.obtainMap)
  3924. if (@pokemon.obtainText rescue false) && @pokemon.obtainText!=""
  3925. mapname=@pokemon.obtainText
  3926. end
  3927. if mapname && mapname!=""
  3928. memo+=_INTL("<c3=404040,B0B0B0>A mysterious Pokémon Egg received from <c3=F83820,E09890>{1}<c3=404040,B0B0B0>.\n",mapname)
  3929. else
  3930. memo+=_INTL("<c3=404040,B0B0B0>A mysterious Pokémon Egg.\n",mapname)
  3931. end
  3932. memo+="\n" # Empty line
  3933. # Write Egg Watch blurb
  3934. memo += _INTL("<c3=404040,B0B0B0>\"The Egg Watch\"\n")
  3935. eggstate = _INTL("It looks like this Egg will take a long time to hatch.")
  3936. eggstate = _INTL("What will hatch from this? It doesn't seem close to hatching.") if @pokemon.eggsteps<10200
  3937. eggstate = _INTL("It appears to move occasionally. It may be close to hatching.") if @pokemon.eggsteps<2550
  3938. eggstate = _INTL("Sounds can be heard coming from inside! It will hatch soon!") if @pokemon.eggsteps<1275
  3939. memo += sprintf("<c3=404040,B0B0B0>%s\n",eggstate)
  3940. # Draw all text
  3941. drawFormattedTextEx(overlay,232,78,268,memo)
  3942. # Draw the Pokémon's markings
  3943. drawMarkings(overlay,82,292)
  3944. end
  3945.  
  3946. #===============================================================================
  3947. # Summary - Birthsign Page
  3948. #===============================================================================
  3949. # Draws the Birthsign Summary Page, accessible by pressing the confirm
  3950. # button on the Memo Page (Page 2).
  3951. #===============================================================================
  3952. def drawBirthsignPage
  3953. if @pokemon.hasBirthsign?
  3954. overlay=@sprites["overlay"].bitmap
  3955. overlay.clear
  3956. imagepos=[]
  3957. #=========================================================================
  3958. # Images
  3959. #=========================================================================
  3960. bgpath="Graphics/Pictures/Birthsigns/birthsign%02d"
  3961. zodiacimage=sprintf(bgpath,PBBirthsigns.signValue(@pokemon.birthsign))
  3962. imagepos.push([zodiacimage,0,0,0,0,-1,-1])
  3963. if SHOW_FAMILYTREE
  3964. imagepos.push(["Graphics/Pictures/Birthsigns/Other/summaryFamilyTree",0,0,0,0,-1,-1])
  3965. else
  3966. imagepos.push(["Graphics/Pictures/Birthsigns/Other/summaryzboarder",0,0,0,0,-1,-1])
  3967. end
  3968. if @pokemon.isBirthday?
  3969. imagepos.push(["Graphics/Pictures/Birthsigns/Other/bdayicon",190,316,0,0,-1,-1])
  3970. end
  3971. pbDrawImagePositions(overlay,imagepos)
  3972. pbDisplaySummaryToken
  3973. #=========================================================================
  3974. # Text
  3975. #=========================================================================
  3976. zodiac=@pokemon.pbGetBirthsignName
  3977. zodiacdesc=@pokemon.pbGetBirthsignDesc
  3978. hatch=pbGetAbbrevMonthName(@pokemon.timeEggHatched.mon)
  3979. if @pokemon.monthsign==nil
  3980. month=pbGetAbbrevMonthName(0)
  3981. else
  3982. month=pbGetAbbrevMonthName(@pokemon.getCalendarsign)
  3983. end
  3984. lastday=@pokemon.pbLastMonthDay
  3985. pokename=@pokemon.name
  3986. # White Text
  3987. base=Color.new(248,248,248)
  3988. shadow=Color.new(104,104,104)
  3989. # Black Text
  3990. base2=Color.new(64,64,64)
  3991. shadow2=Color.new(176,176,176)
  3992. # Birthday Text
  3993. bdaycolor1=Color.new(255,215,0)
  3994. bdaycolor2=Color.new(0,0,125)
  3995. pbSetSystemFont(overlay)
  3996. textpos=[
  3997. [_INTL("BIRTHSIGN"),26,16,0,base,shadow],
  3998. [_INTL("{1}'s Birthsign",pokename),123,60,2,base,shadow],
  3999. [zodiac,121,90,2,base2,shadow2],
  4000. [_INTL("Sign: {1} {2}",month,lastday),4,352,0,base2,shadow2]
  4001. ]
  4002. if @pokemon.obtainMode==1
  4003. if @pokemon.timeEggHatched
  4004. date=@pokemon.timeEggHatched.day
  4005. year=@pokemon.timeEggHatched.year
  4006. if @pokemon.isBirthday?
  4007. textpos.push([_INTL("Happy Birthday!"),22,320,0,bdaycolor1,bdaycolor2])
  4008. else
  4009. textpos.push([_INTL("Birthday: {1} {2}, {3}",hatch,date,year),4,320,0,base,shadow])
  4010. end
  4011. end
  4012. else
  4013. textpos.push([_INTL("Birthday: Unknown"),4,320,0,base,shadow])
  4014. end
  4015. pbDrawTextPositions(overlay,textpos)
  4016. pbSetSmallFont(overlay)
  4017. drawTextEx(overlay,254,320,258,0,zodiacdesc,base,shadow)
  4018. pbSetSystemFont(overlay)
  4019. end
  4020. end
  4021.  
  4022. #===============================================================================
  4023. # Family Tree compatibility
  4024. #===============================================================================
  4025. def pbGoToPrevious
  4026. newindex = @partyindex
  4027. while newindex>0
  4028. newindex -= 1
  4029. if @party[newindex] && (@page==1 || !@party[newindex].egg? ||
  4030. (SHOW_FAMILYTREE && (@page==6 && SHOWFAMILYEGG)))
  4031. @partyindex = newindex
  4032. break
  4033. end
  4034. end
  4035. end
  4036.  
  4037. def pbGoToNext
  4038. newindex = @partyindex
  4039. while newindex<@party.length-1
  4040. newindex += 1
  4041. if @party[newindex] && (@page==1 || !@party[newindex].egg? ||
  4042. (SHOW_FAMILYTREE && (@page==6 && SHOWFAMILYEGG)))
  4043. @partyindex = newindex
  4044. break
  4045. end
  4046. end
  4047. end
  4048.  
  4049. #===============================================================================
  4050. # Summary Options
  4051. # Hides item options for Eggs.
  4052. #===============================================================================
  4053. def pbOptions
  4054. dorefresh = false
  4055. commands = []
  4056. cmdGiveItem = -1
  4057. cmdTakeItem = -1
  4058. cmdPokedex = -1
  4059. cmdMark = -1
  4060. if !@pokemon.egg?
  4061. commands[cmdGiveItem = commands.length] = _INTL("Give item")
  4062. commands[cmdTakeItem = commands.length] = _INTL("Take item") if @pokemon.hasItem?
  4063. commands[cmdPokedex = commands.length] = _INTL("View Pokédex")
  4064. end
  4065. commands[cmdMark = commands.length] = _INTL("Mark")
  4066. commands[commands.length] = _INTL("Cancel")
  4067. command = pbShowCommands(commands)
  4068. if cmdGiveItem>=0 && command==cmdGiveItem
  4069. item = 0
  4070. pbFadeOutIn(99999){
  4071. scene = PokemonBag_Scene.new
  4072. screen = PokemonBagScreen.new(scene,$PokemonBag)
  4073. item = screen.pbChooseItemScreen(Proc.new{|item| pbCanHoldItem?(item) })
  4074. }
  4075. if item>0
  4076. dorefresh = pbGiveItemToPokemon(item,@pokemon,self,@partyindex)
  4077. end
  4078. elsif cmdTakeItem>=0 && command==cmdTakeItem
  4079. dorefresh = pbTakeItemFromPokemon(@pokemon,self)
  4080. elsif cmdPokedex>=0 && command==cmdPokedex
  4081. pbUpdateLastSeenForm(@pokemon)
  4082. pbFadeOutIn(99999){
  4083. scene = PokemonPokedexInfo_Scene.new
  4084. screen = PokemonPokedexInfoScreen.new(scene)
  4085. screen.pbStartSceneSingle(@pokemon.species)
  4086. }
  4087. dorefresh = true
  4088. elsif cmdMark>=0 && command==cmdMark
  4089. dorefresh = pbMarking(@pokemon)
  4090. end
  4091. return dorefresh
  4092. end
  4093.  
  4094. #===============================================================================
  4095. # Summary - Page access
  4096. #===============================================================================
  4097. def pbScene
  4098. pbPlayCry(@pokemon)
  4099. loop do
  4100. Graphics.update
  4101. Input.update
  4102. pbUpdate
  4103. dorefresh = false
  4104. # Family Tree compatibility
  4105. if SHOW_FAMILYTREE
  4106. handleInputsEgg
  4107. end
  4108. if Input.trigger?(Input::A)
  4109. pbSEStop; pbPlayCry(@pokemon)
  4110. elsif Input.trigger?(Input::B)
  4111. pbPlayCancelSE
  4112. break
  4113. elsif Input.trigger?(Input::C)
  4114. pbPlayDecisionSE
  4115. #=======================================================================
  4116. if @page==2 && @pokemon.hasBirthsign?
  4117. drawBirthsignPage
  4118. #=======================================================================
  4119. elsif @page==4
  4120. pbMoveSelection
  4121. dorefresh = true
  4122. elsif @page==5
  4123. pbRibbonSelection
  4124. dorefresh = true
  4125. else
  4126. dorefresh = pbOptions
  4127. end
  4128. elsif Input.trigger?(Input::UP) && @partyindex>0
  4129. oldindex = @partyindex
  4130. pbGoToPrevious
  4131. if @partyindex!=oldindex
  4132. @pokemon = @party[@partyindex]
  4133. @sprites["pokemon"].setPokemonBitmap(@pokemon)
  4134. @sprites["itemicon"].item = @pokemon.item
  4135. pbSEStop; pbPlayCry(@pokemon)
  4136. @ribbonOffset = 0
  4137. # Family Tree compatibility
  4138. if SHOW_FAMILYTREE
  4139. if SHOWFAMILYEGG && @pokemon.isEgg? && @page==6
  4140. dorefresh = false
  4141. drawPageSix
  4142. else
  4143. dorefresh = true
  4144. end
  4145. else
  4146. dorefresh = true
  4147. end
  4148. end
  4149. elsif Input.trigger?(Input::DOWN) && @partyindex<@party.length-1
  4150. oldindex = @partyindex
  4151. pbGoToNext
  4152. if @partyindex!=oldindex
  4153. @pokemon = @party[@partyindex]
  4154. @sprites["pokemon"].setPokemonBitmap(@pokemon)
  4155. @sprites["itemicon"].item = @pokemon.item
  4156. pbSEStop; pbPlayCry(@pokemon)
  4157. @ribbonOffset = 0
  4158. # Family Tree compatibility
  4159. if SHOW_FAMILYTREE
  4160. if SHOWFAMILYEGG && @pokemon.isEgg? && @page==6
  4161. dorefresh = false
  4162. drawPageSix
  4163. else
  4164. dorefresh = true
  4165. end
  4166. else
  4167. dorefresh = true
  4168. end
  4169. end
  4170. elsif Input.trigger?(Input::LEFT) && !@pokemon.egg?
  4171. oldpage = @page
  4172. @page -= 1
  4173. @page = 1 if @page<1
  4174. # Family Tree compatibility
  4175. if SHOW_FAMILYTREE
  4176. @page = 6 if @page>6
  4177. else
  4178. @page = 5 if @page>5
  4179. end
  4180. if @page!=oldpage # Move to next page
  4181. pbPlayCursorSE
  4182. @ribbonOffset = 0
  4183. dorefresh = true
  4184. end
  4185. elsif Input.trigger?(Input::RIGHT) && !@pokemon.egg?
  4186. oldpage = @page
  4187. @page += 1
  4188. @page = 1 if @page<1
  4189. # Family Tree compatibility
  4190. if SHOW_FAMILYTREE
  4191. @page = 6 if @page>6
  4192. else
  4193. @page = 5 if @page>5
  4194. end
  4195. if @page!=oldpage # Move to next page
  4196. pbPlayCursorSE
  4197. @ribbonOffset = 0
  4198. dorefresh = true
  4199. end
  4200. end
  4201. if dorefresh
  4202. drawPage(@page)
  4203. end
  4204. end
  4205. return @partyindex
  4206. end
  4207.  
  4208. end
  4209.  
  4210. #########[SECTION 6 - BREEDING MECHANICS]##########
  4211. #===============================================================================
  4212. # Birthsign Bonuses - Hatch effects
  4213. #===============================================================================
  4214. # Applies Birthsign effects to eggs.
  4215. # Overwrites sections in PField_DayCare & PScreen_EggHatching
  4216. #===============================================================================
  4217.  
  4218. #===============================================================================
  4219. # Legendary Breeding - Mew
  4220. #===============================================================================
  4221. # Defines Mew as a parent so that it may be used similarly to Ditto.
  4222. #===============================================================================
  4223. def pbIsMew?(pokemon)
  4224. dexdata=pbOpenDexData
  4225. pbDexDataOffset(dexdata,pokemon.species,31)
  4226. compat10=dexdata.fgetb
  4227. compat11=dexdata.fgetb
  4228. dexdata.close
  4229. return isConst?(compat10,PBEggGroups,:Ancestor) ||
  4230. isConst?(compat11,PBEggGroups,:Ancestor)
  4231. end
  4232. #===============================================================================
  4233.  
  4234. def pbDayCareGetCompat
  4235. if pbDayCareDeposited==2
  4236. pokemon1=$PokemonGlobal.daycare[0][0]
  4237. pokemon2=$PokemonGlobal.daycare[1][0]
  4238. return 0 if (pokemon1.isShadow? rescue false)
  4239. return 0 if (pokemon2.isShadow? rescue false)
  4240. #===========================================================================
  4241. # Makes celestial species unbreedable
  4242. #===========================================================================
  4243. return 0 if pokemon1.isCelestial?
  4244. return 0 if pokemon2.isCelestial?
  4245. # Insert code here if certain forms of certain species cannot breed
  4246. #===========================================================================
  4247. # Legendary Breeding - Exceptions
  4248. #===========================================================================
  4249. # Prevents certain forms of legendaries from breeding.
  4250. #===========================================================================
  4251. return 0 if (isConst?(pokemon1.species,PBSpecies,:TORNADUS) && pokemon1.form!=1)
  4252. return 0 if (isConst?(pokemon2.species,PBSpecies,:TORNADUS) && pokemon2.form!=1)
  4253. return 0 if (isConst?(pokemon1.species,PBSpecies,:THUNDURUS) && pokemon1.form!=1)
  4254. return 0 if (isConst?(pokemon2.species,PBSpecies,:THUNDURUS) && pokemon2.form!=1)
  4255. return 0 if (isConst?(pokemon1.species,PBSpecies,:LANDORUS) && pokemon1.form!=1)
  4256. return 0 if (isConst?(pokemon2.species,PBSpecies,:LANDORUS) && pokemon2.form!=1)
  4257. return 0 if (isConst?(pokemon1.species,PBSpecies,:KYUREM) && pokemon1.form!=0)
  4258. return 0 if (isConst?(pokemon2.species,PBSpecies,:KYUREM) && pokemon2.form!=0)
  4259. return 0 if (isConst?(pokemon1.species,PBSpecies,:ZYGARDE) && pokemon1.form!=0)
  4260. return 0 if (isConst?(pokemon2.species,PBSpecies,:ZYGARDE) && pokemon2.form!=0)
  4261. return 0 if (isConst?(pokemon1.species,PBSpecies,:NECROZMA) && pokemon1.form!=0)
  4262. return 0 if (isConst?(pokemon2.species,PBSpecies,:NECROZMA) && pokemon2.form!=0)
  4263. #===========================================================================
  4264. dexdata=pbOpenDexData
  4265. pbDexDataOffset(dexdata,pokemon1.species,31)
  4266. compat10=dexdata.fgetb
  4267. compat11=dexdata.fgetb
  4268. pbDexDataOffset(dexdata,pokemon2.species,31)
  4269. compat20=dexdata.fgetb
  4270. compat21=dexdata.fgetb
  4271. dexdata.close
  4272. if !isConst?(compat10,PBEggGroups,:Undiscovered) &&
  4273. !isConst?(compat11,PBEggGroups,:Undiscovered) &&
  4274. !isConst?(compat20,PBEggGroups,:Undiscovered) &&
  4275. !isConst?(compat21,PBEggGroups,:Undiscovered)
  4276. if compat10==compat20 || compat11==compat20 ||
  4277. compat10==compat21 || compat11==compat21 ||
  4278. #======================================================================
  4279. # Legendary Breeding - Compatibility
  4280. #======================================================================
  4281. # Determines compatibility between Ditto/Mew and Legendaries/UB's.
  4282. #======================================================================
  4283. # Ditto can breed with any regular species.
  4284. ((isConst?(compat10,PBEggGroups,:Ditto) ||
  4285. isConst?(compat11,PBEggGroups,:Ditto) ||
  4286. isConst?(compat20,PBEggGroups,:Ditto) ||
  4287. isConst?(compat21,PBEggGroups,:Ditto)) &&
  4288. # Ditto can't breed with legendary species or Ultra Beasts.
  4289. !(isConst?(compat10,PBEggGroups,:Skycrest) ||
  4290. isConst?(compat11,PBEggGroups,:Skycrest) ||
  4291. isConst?(compat20,PBEggGroups,:Skycrest) ||
  4292. isConst?(compat21,PBEggGroups,:Skycrest) ||
  4293. isConst?(compat10,PBEggGroups,:Bestial) ||
  4294. isConst?(compat11,PBEggGroups,:Bestial) ||
  4295. isConst?(compat20,PBEggGroups,:Bestial) ||
  4296. isConst?(compat21,PBEggGroups,:Bestial) ||
  4297. isConst?(compat10,PBEggGroups,:Titan) ||
  4298. isConst?(compat11,PBEggGroups,:Titan) ||
  4299. isConst?(compat20,PBEggGroups,:Titan) ||
  4300. isConst?(compat21,PBEggGroups,:Titan) ||
  4301. isConst?(compat10,PBEggGroups,:Overlord) ||
  4302. isConst?(compat11,PBEggGroups,:Overlord) ||
  4303. isConst?(compat20,PBEggGroups,:Overlord) ||
  4304. isConst?(compat21,PBEggGroups,:Overlord) ||
  4305. isConst?(compat10,PBEggGroups,:Nebulous) ||
  4306. isConst?(compat11,PBEggGroups,:Nebulous) ||
  4307. isConst?(compat20,PBEggGroups,:Nebulous) ||
  4308. isConst?(compat21,PBEggGroups,:Nebulous) ||
  4309. isConst?(compat10,PBEggGroups,:Enchanted) ||
  4310. isConst?(compat11,PBEggGroups,:Enchanted) ||
  4311. isConst?(compat20,PBEggGroups,:Enchanted) ||
  4312. isConst?(compat21,PBEggGroups,:Enchanted) ||
  4313. isConst?(compat10,PBEggGroups,:Ancestor) ||
  4314. isConst?(compat11,PBEggGroups,:Ancestor) ||
  4315. isConst?(compat20,PBEggGroups,:Ancestor) ||
  4316. isConst?(compat21,PBEggGroups,:Ancestor) ||
  4317. isConst?(compat10,PBEggGroups,:Ultra) ||
  4318. isConst?(compat11,PBEggGroups,:Ultra) ||
  4319. isConst?(compat20,PBEggGroups,:Ultra) ||
  4320. isConst?(compat21,PBEggGroups,:Ultra)
  4321. )) ||
  4322. # Mew can breed with any regular or legendary species.
  4323. ((isConst?(compat10,PBEggGroups,:Ancestor) ||
  4324. isConst?(compat11,PBEggGroups,:Ancestor) ||
  4325. isConst?(compat20,PBEggGroups,:Ancestor) ||
  4326. isConst?(compat21,PBEggGroups,:Ancestor)) &&
  4327. # Mew cannot breed with Ditto or Ultra Beasts.
  4328. !(isConst?(compat10,PBEggGroups,:Ditto) ||
  4329. isConst?(compat11,PBEggGroups,:Ditto) ||
  4330. isConst?(compat20,PBEggGroups,:Ditto) ||
  4331. isConst?(compat21,PBEggGroups,:Ditto) ||
  4332. isConst?(compat10,PBEggGroups,:Ultra) ||
  4333. isConst?(compat11,PBEggGroups,:Ultra) ||
  4334. isConst?(compat20,PBEggGroups,:Ultra) ||
  4335. isConst?(compat21,PBEggGroups,:Ultra)
  4336. ))
  4337. #======================================================================
  4338. if pbDayCareCompatibleGender(pokemon1,pokemon2)
  4339. ret=1
  4340. ret+=1 if pokemon1.species==pokemon2.species
  4341. ret+=1 if pokemon1.trainerID!=pokemon2.trainerID
  4342. return ret
  4343. end
  4344. end
  4345. end
  4346. end
  4347. return 0
  4348. end
  4349.  
  4350. def pbDayCareGenerateEgg
  4351. return if pbDayCareDeposited!=2
  4352. if $Trainer.party.length>=6
  4353. raise _INTL("Can't store the egg")
  4354. end
  4355. pokemon0=$PokemonGlobal.daycare[0][0]
  4356. pokemon1=$PokemonGlobal.daycare[1][0]
  4357. mother=nil
  4358. father=nil
  4359. babyspecies=0
  4360. ditto0=pbIsDitto?(pokemon0)
  4361. ditto1=pbIsDitto?(pokemon1)
  4362. #=============================================================================
  4363. # Legendary Breeding - Egg Species
  4364. #=============================================================================
  4365. # Egg is always partner's species when breeding with Ditto or Mew.
  4366. #=============================================================================
  4367. mew0=pbIsMew?(pokemon0)
  4368. mew1=pbIsMew?(pokemon1)
  4369. if pokemon0.isFemale? || ditto0 || mew0
  4370. babyspecies=(ditto0 || mew0) ? pokemon1.species : pokemon0.species
  4371. mother=pokemon0
  4372. father=pokemon1
  4373. else
  4374. babyspecies=(ditto1 || mew1) ? pokemon0.species : pokemon1.species
  4375. mother=pokemon1
  4376. father=pokemon0
  4377. end
  4378. #=============================================================================
  4379. babyspecies=pbGetBabySpecies(babyspecies,mother.item,father.item)
  4380. if (isConst?(babyspecies,PBSpecies,:NIDORANfE) && hasConst?(PBSpecies,:NIDORANmA)) ||
  4381. (isConst?(babyspecies,PBSpecies,:NIDORANmA) && hasConst?(PBSpecies,:NIDORANfE))
  4382. babyspecies=[getConst(PBSpecies,:NIDORANmA),
  4383. getConst(PBSpecies,:NIDORANfE)][rand(2)]
  4384. elsif (isConst?(babyspecies,PBSpecies,:VOLBEAT) && hasConst?(PBSpecies,:ILLUMISE)) ||
  4385. (isConst?(babyspecies,PBSpecies,:ILLUMISE) && hasConst?(PBSpecies,:VOLBEAT))
  4386. babyspecies=[getConst(PBSpecies,:VOLBEAT),
  4387. getConst(PBSpecies,:ILLUMISE)][rand(2)]
  4388. #=============================================================================
  4389. # Legendary Breeding - Baby Species
  4390. #=============================================================================
  4391. # Gets different species for legendary offsping under certain conditions.
  4392. #=============================================================================
  4393. # Manaphy produces Phione eggs unless mother is holding Mystic Water.
  4394. elsif (isConst?(babyspecies,PBSpecies,:MANAPHY) && hasConst?(PBSpecies,:PHIONE) &&
  4395. !isConst?(mother.item,PBItems,:MYSTICWATER))
  4396. babyspecies=getConst(PBSpecies,:PHIONE)
  4397. # Latias can produce Latias or Latios eggs.
  4398. elsif (isConst?(babyspecies,PBSpecies,:LATIAS) && hasConst?(PBSpecies,:LATIOS)) ||
  4399. (isConst?(babyspecies,PBSpecies,:LATIOS) && hasConst?(PBSpecies,:LATIAS))
  4400. babyspecies=[getConst(PBSpecies,:LATIOS),
  4401. getConst(PBSpecies,:LATIAS)][rand(2)]
  4402. end
  4403. # Mew can produce Mewtwo eggs while holding Berserk Gene.
  4404. if (isConst?(mother.species,PBSpecies,:MEW) &&
  4405. isConst?(father.species,PBSpecies,:MEW) &&
  4406. isConst?(mother.item,PBItems,:BERSERKGENE))
  4407. babyspecies=getConst(PBSpecies,:MEWTWO)
  4408. # Regigigas can produce other Regi's eggs depending on held item.
  4409. elsif (isConst?(mother.species,PBSpecies,:REGIGIGAS) &&
  4410. isConst?(father.species,PBSpecies,:REGIGIGAS) &&
  4411. isConst?(mother.item,PBItems,:HARDSTONE))
  4412. babyspecies=getConst(PBSpecies,:REGIROCK)
  4413. elsif (isConst?(mother.species,PBSpecies,:REGIGIGAS) &&
  4414. isConst?(father.species,PBSpecies,:REGIGIGAS) &&
  4415. isConst?(mother.item,PBItems,:NEVERMELTICE))
  4416. babyspecies=getConst(PBSpecies,:REGICE)
  4417. elsif (isConst?(mother.species,PBSpecies,:REGIGIGAS) &&
  4418. isConst?(father.species,PBSpecies,:REGIGIGAS) &&
  4419. isConst?(mother.item,PBItems,:IRONBALL))
  4420. babyspecies=getConst(PBSpecies,:REGISTEEL)
  4421. #=============================================================================
  4422. end
  4423. # Generate egg
  4424. egg=PokeBattle_Pokemon.new(babyspecies,EGGINITIALLEVEL,$Trainer)
  4425. # Randomise personal ID
  4426. pid=rand(65536)
  4427. pid|=(rand(65536)<<16)
  4428. egg.personalID=pid
  4429. # Inheriting form
  4430. if isConst?(babyspecies,PBSpecies,:BURMY) ||
  4431. isConst?(babyspecies,PBSpecies,:SHELLOS) ||
  4432. isConst?(babyspecies,PBSpecies,:BASCULIN) ||
  4433. isConst?(babyspecies,PBSpecies,:FLABEBE) ||
  4434. isConst?(babyspecies,PBSpecies,:PUMPKABOO) ||
  4435. isConst?(babyspecies,PBSpecies,:ORICORIO) ||
  4436. isConst?(babyspecies,PBSpecies,:MINIOR) ||
  4437. #=============================================================================
  4438. # Legendary Breeding - Form Inheritence
  4439. #=============================================================================
  4440. # Inherits mother's form, or partner's form if breeding with Ditto/Mew
  4441. #=============================================================================
  4442. isConst?(babyspecies,PBSpecies,:DEOXYS) ||
  4443. isConst?(babyspecies,PBSpecies,:TORNADUS) ||
  4444. isConst?(babyspecies,PBSpecies,:THUNDURUS) ||
  4445. isConst?(babyspecies,PBSpecies,:LANDORUS)
  4446. if pbIsDitto?(mother) || pbIsMew?(mother)
  4447. egg.form=father.form
  4448. else
  4449. egg.form=mother.form
  4450. end
  4451. end
  4452. # Zygarde always hatches in its 10% form
  4453. if isConst?(babyspecies,PBSpecies,:ZYGARDE)
  4454. egg.form=1 #Assumes form 0 is 50% Forme, and form 1 is 10% Forme.
  4455. end
  4456. #=============================================================================
  4457. # Inheriting Moves
  4458. moves=[]
  4459. othermoves=[]
  4460. movefather=father; movemother=mother
  4461. if pbIsDitto?(movefather) && !mother.isFemale?
  4462. movefather=mother; movemother=father
  4463. end
  4464. # Initial Moves
  4465. initialmoves=egg.getMoveList
  4466. for k in initialmoves
  4467. if k[0]<=EGGINITIALLEVEL
  4468. moves.push(k[1])
  4469. else
  4470. othermoves.push(k[1]) if mother.hasMove?(k[1]) && father.hasMove?(k[1])
  4471. end
  4472. end
  4473. # Inheriting Natural Moves
  4474. for move in othermoves
  4475. moves.push(move)
  4476. end
  4477. # Inheriting Machine Moves
  4478. if !USENEWBATTLEMECHANICS
  4479. for i in 0...$ItemData.length
  4480. next if !$ItemData[i]
  4481. atk=$ItemData[i][ITEMMACHINE]
  4482. next if !atk || atk==0
  4483. if egg.isCompatibleWithMove?(atk)
  4484. moves.push(atk) if movefather.hasMove?(atk)
  4485. end
  4486. end
  4487. end
  4488. # Inheriting Egg Moves
  4489. if movefather.isMale?
  4490. pbRgssOpen("Data/eggEmerald.dat","rb"){|f|
  4491. f.pos=(egg.fSpecies-1)*8
  4492. offset=f.fgetdw
  4493. length=f.fgetdw
  4494. if length>0
  4495. f.pos=offset
  4496. i=0; loop do break unless i<length
  4497. atk=f.fgetw
  4498. moves.push(atk) if movefather.hasMove?(atk)
  4499. i+=1
  4500. end
  4501. end
  4502. }
  4503. end
  4504. if USENEWBATTLEMECHANICS
  4505. pbRgssOpen("Data/eggEmerald.dat","rb"){|f|
  4506. f.pos=(egg.fSpecies-1)*8
  4507. offset=f.fgetdw
  4508. length=f.fgetdw
  4509. if length>0
  4510. f.pos=offset
  4511. i=0; loop do break unless i<length
  4512. atk=f.fgetw
  4513. moves.push(atk) if movemother.hasMove?(atk)
  4514. i+=1
  4515. end
  4516. end
  4517. }
  4518. end
  4519. # Volt Tackle
  4520. lightball=false
  4521. if (isConst?(father.species,PBSpecies,:PIKACHU) ||
  4522. isConst?(father.species,PBSpecies,:RAICHU)) &&
  4523. isConst?(father.item,PBItems,:LIGHTBALL)
  4524. lightball=true
  4525. end
  4526. if (isConst?(mother.species,PBSpecies,:PIKACHU) ||
  4527. isConst?(mother.species,PBSpecies,:RAICHU)) &&
  4528. isConst?(mother.item,PBItems,:LIGHTBALL)
  4529. lightball=true
  4530. end
  4531. if lightball && isConst?(babyspecies,PBSpecies,:PICHU) &&
  4532. hasConst?(PBMoves,:VOLTTACKLE)
  4533. moves.push(getConst(PBMoves,:VOLTTACKLE))
  4534. end
  4535. moves|=[] # remove duplicates
  4536. # Assembling move list
  4537. finalmoves=[]
  4538. listend=moves.length-4
  4539. listend=0 if listend<0
  4540. j=0
  4541. for i in listend..listend+3
  4542. moveid=(i>=moves.length) ? 0 : moves[i]
  4543. finalmoves[j]=PBMove.new(moveid)
  4544. j+=1
  4545. end
  4546. # Inheriting Individual Values
  4547. ivs=[]
  4548. for i in 0...6
  4549. ivs[i]=rand(32)
  4550. end
  4551. ivinherit=[]
  4552. for i in 0...2
  4553. parent=[mother,father][i]
  4554. ivinherit[i]=PBStats::HP if isConst?(parent.item,PBItems,:POWERWEIGHT)
  4555. ivinherit[i]=PBStats::ATTACK if isConst?(parent.item,PBItems,:POWERBRACER)
  4556. ivinherit[i]=PBStats::DEFENSE if isConst?(parent.item,PBItems,:POWERBELT)
  4557. ivinherit[i]=PBStats::SPEED if isConst?(parent.item,PBItems,:POWERANKLET)
  4558. ivinherit[i]=PBStats::SPATK if isConst?(parent.item,PBItems,:POWERLENS)
  4559. ivinherit[i]=PBStats::SPDEF if isConst?(parent.item,PBItems,:POWERBAND)
  4560. end
  4561. num=0; r=rand(2)
  4562. for i in 0...2
  4563. if ivinherit[r]!=nil
  4564. parent=[mother,father][r]
  4565. ivs[ivinherit[r]]=parent.iv[ivinherit[r]]
  4566. num+=1
  4567. break
  4568. end
  4569. r=(r+1)%2
  4570. end
  4571. stats=[PBStats::HP,PBStats::ATTACK,PBStats::DEFENSE,
  4572. PBStats::SPEED,PBStats::SPATK,PBStats::SPDEF]
  4573. limit=(USENEWBATTLEMECHANICS && (isConst?(mother.item,PBItems,:DESTINYKNOT) ||
  4574. isConst?(father.item,PBItems,:DESTINYKNOT))) ? 5 : 3
  4575. loop do
  4576. freestats=[]
  4577. for i in stats
  4578. freestats.push(i) if !ivinherit.include?(i)
  4579. end
  4580. break if freestats.length==0
  4581. r=freestats[rand(freestats.length)]
  4582. parent=[mother,father][rand(2)]
  4583. ivs[r]=parent.iv[r]
  4584. ivinherit.push(r)
  4585. num+=1
  4586. break if num>=limit
  4587. end
  4588. # Inheriting nature
  4589. newnatures=[]
  4590. newnatures.push(mother.nature) if isConst?(mother.item,PBItems,:EVERSTONE)
  4591. newnatures.push(father.nature) if isConst?(father.item,PBItems,:EVERSTONE)
  4592. if newnatures.length>0
  4593. egg.setNature(newnatures[rand(newnatures.length)])
  4594. end
  4595. # Masuda method and Shiny Charm
  4596. shinyretries=0
  4597. shinyretries+=5 if father.language!=mother.language
  4598. shinyretries+=2 if hasConst?(PBItems,:SHINYCHARM) &&
  4599. $PokemonBag.pbHasItem?(:SHINYCHARM)
  4600. if shinyretries>0
  4601. for i in 0...shinyretries
  4602. break if egg.isShiny?
  4603. egg.personalID=rand(65536)|(rand(65536)<<16)
  4604. end
  4605. end
  4606. # Inheriting ability from the mother
  4607. if (!ditto0 && !ditto1)
  4608. if mother.hasHiddenAbility?
  4609. egg.setAbility(mother.abilityIndex) if rand(10)<6
  4610. else
  4611. if rand(10)<8
  4612. egg.setAbility(mother.abilityIndex)
  4613. else
  4614. egg.setAbility((mother.abilityIndex+1)%2)
  4615. end
  4616. end
  4617. elsif ((!ditto0 && ditto1) || (!ditto1 && ditto0)) && USENEWBATTLEMECHANICS
  4618. parent=(!ditto0) ? mother : father
  4619. if parent.hasHiddenAbility?
  4620. egg.setAbility(parent.abilityIndex) if rand(10)<6
  4621. end
  4622. end
  4623. # Inheriting Poké Ball from the mother
  4624. if mother.isFemale? &&
  4625. !isConst?(pbBallTypeToBall(mother.ballused),PBItems,:MASTERBALL) &&
  4626. !isConst?(pbBallTypeToBall(mother.ballused),PBItems,:CHERISHBALL)
  4627. egg.ballused=mother.ballused
  4628. end
  4629. egg.iv[0]=ivs[0]
  4630. egg.iv[1]=ivs[1]
  4631. egg.iv[2]=ivs[2]
  4632. egg.iv[3]=ivs[3]
  4633. egg.iv[4]=ivs[4]
  4634. egg.iv[5]=ivs[5]
  4635. egg.moves[0]=finalmoves[0]
  4636. egg.moves[1]=finalmoves[1]
  4637. egg.moves[2]=finalmoves[2]
  4638. egg.moves[3]=finalmoves[3]
  4639. #=============================================================================
  4640. # Birthsigns - The Ancestor
  4641. # Passes down EV spreads of the parent to the offspring.
  4642. #=============================================================================
  4643. egg.ev=mother.ev if (mother.hasBirthsign? && mother.birthsign==19)
  4644. egg.ev=father.ev if (father.hasBirthsign? && father.birthsign==19)
  4645. if (mother.hasBirthsign? && mother.birthsign==19) &&
  4646. (father.hasBirthsign? && father.birthsign==19)
  4647. if rand(100)<50
  4648. egg.ev=mother.ev
  4649. else
  4650. egg.ev=father.ev
  4651. end
  4652. end
  4653. #=============================================================================
  4654. egg.calcStats
  4655. egg.obtainText=_INTL("Day-Care Couple")
  4656. egg.name=_INTL("Egg")
  4657. dexdata=pbOpenDexData
  4658. pbDexDataOffset(dexdata,babyspecies,21)
  4659. eggsteps=dexdata.fgetw
  4660. dexdata.close
  4661. egg.eggsteps=eggsteps
  4662. #===============================================================================
  4663. # Birthsigns - Partner & Rival sign bonuses
  4664. #===============================================================================
  4665. if ZODIACSET!=0
  4666. rivalmatch = pbShareRivalsign?(mother,father)
  4667. allymatch = pbSharePartnersign?(mother,father)
  4668. allymonth = (mother.hasPartnersign?(Time.now.mon) || father.hasPartnersign?(Time.now.mon))
  4669. mothergem = getZodiacGem(mother.monthsign)
  4670. fathergem = getZodiacGem(father.monthsign)
  4671. baseitem = [:STARDUST,:STARDUST,:STARDUST,:STARPIECE]
  4672. rareitem = [:EVIOLITE,:SHEDSHELL,:LEFTOVERS,:LUCKYEGG]
  4673. #===========================================================================
  4674. # PARTNERS
  4675. #===========================================================================
  4676. # Has a 50% chance of inheriting only the parent's 30/31 IV's.
  4677. # Egg steps required are halved, or even quartered.
  4678. # Eggs sometimes hatch holding random item.
  4679. #===========================================================================
  4680. if allymatch
  4681. # Passes down parent's IV's
  4682. if rand(10)<5
  4683. egg.iv[0]=mother.iv[0] if mother.iv[0]>29
  4684. egg.iv[1]=mother.iv[1] if mother.iv[1]>29
  4685. egg.iv[2]=mother.iv[2] if mother.iv[2]>29
  4686. egg.iv[3]=mother.iv[3] if mother.iv[3]>29
  4687. egg.iv[4]=mother.iv[4] if mother.iv[4]>29
  4688. egg.iv[5]=mother.iv[5] if mother.iv[5]>29
  4689. end
  4690. if rand(10)<5
  4691. egg.iv[0]=father.iv[0] if father.iv[0]>29
  4692. egg.iv[1]=father.iv[1] if father.iv[1]>29
  4693. egg.iv[2]=father.iv[2] if father.iv[2]>29
  4694. egg.iv[3]=father.iv[3] if father.iv[3]>29
  4695. egg.iv[4]=father.iv[4] if father.iv[4]>29
  4696. egg.iv[5]=father.iv[5] if father.iv[5]>29
  4697. end
  4698. # Egg hatches with an item
  4699. if rand(10)<5
  4700. mothersign=(mother.monthsign)
  4701. fathersign=(father.monthsign)
  4702. egg.setItem(baseitem[rand(3)]) if rand(100)<=50
  4703. if INCLUDE_ZPOWER
  4704. egg.setItem(mothergem) if rand(100)<=25
  4705. egg.setItem(fathergem) if rand(100)<=15
  4706. end
  4707. egg.setItem(rareitem[rand(3)]) if rand(100)<=5
  4708. end
  4709. # Egg steps are reduced
  4710. if allymonth
  4711. egg.eggsteps=eggsteps/4
  4712. else
  4713. egg.eggsteps=eggsteps/2
  4714. end
  4715. egg.calcStats
  4716. end
  4717. #===========================================================================
  4718. # RIVALS
  4719. #===========================================================================
  4720. # Has a 50% chance of inheriting only the parent's 0 IV's.
  4721. # Egg steps needed to hatch are increased.
  4722. # Don't hatch with any bonus items.
  4723. #===========================================================================
  4724. if rivalmatch
  4725. if rand(10)<5
  4726. egg.iv[0]=mother.iv[0] if mother.iv[0]=0
  4727. egg.iv[1]=mother.iv[1] if mother.iv[1]=0
  4728. egg.iv[2]=mother.iv[2] if mother.iv[2]=0
  4729. egg.iv[3]=mother.iv[3] if mother.iv[3]=0
  4730. egg.iv[4]=mother.iv[4] if mother.iv[4]=0
  4731. egg.iv[5]=mother.iv[5] if mother.iv[5]=0
  4732. egg.iv[0]=father.iv[0] if father.iv[0]=0
  4733. egg.iv[1]=father.iv[1] if father.iv[1]=0
  4734. egg.iv[2]=father.iv[2] if father.iv[2]=0
  4735. egg.iv[3]=father.iv[3] if father.iv[3]=0
  4736. egg.iv[4]=father.iv[4] if father.iv[4]=0
  4737. egg.iv[5]=father.iv[5] if father.iv[5]=0
  4738. egg.calcStats
  4739. end
  4740. egg.eggsteps=eggsteps+1500
  4741. end
  4742. end
  4743. #=============================================================================
  4744. if rand(65536)<POKERUSCHANCE
  4745. egg.givePokerus
  4746. end
  4747. # Family Tree compatibility
  4748. if SHOW_FAMILYTREE
  4749. egg.family = PokemonFamily.new(egg, father, mother)
  4750. end
  4751. $Trainer.party[$Trainer.party.length]=egg
  4752. end
  4753.  
  4754. #===============================================================================
  4755. # Birthsigns - The Parent
  4756. # Halves the steps needed to hatch an egg while in the party.
  4757. #===============================================================================
  4758. Events.onStepTaken+=proc {|sender,e|
  4759. next if !$Trainer
  4760. for egg in $Trainer.party
  4761. if egg.eggsteps>0
  4762. egg.eggsteps-=1
  4763. for i in $Trainer.pokemonParty
  4764. if isConst?(i.ability,PBAbilities,:FLAMEBODY) ||
  4765. isConst?(i.ability,PBAbilities,:MAGMAARMOR) ||
  4766. (i.hasBirthsign? && i.birthsign==22)
  4767. egg.eggsteps-=1
  4768. break
  4769. end
  4770. end
  4771. if egg.eggsteps<=0
  4772. egg.eggsteps=0
  4773. pbHatch(egg)
  4774. end
  4775. end
  4776. end
  4777. }
  4778.  
  4779. #===============================================================================
  4780. # Legendary Breeding - Forming eggs with Arceus
  4781. #===============================================================================
  4782. def pbArceusEggSpawn
  4783. if Kernel.pbConfirmMessage(_INTL("Would you like a Pokémon to form an egg?"))
  4784. if $Trainer.party.length>=6
  4785. Kernel.pbMessage(_INTL("There isn't enough space to carry an egg!"))
  4786. else
  4787. Kernel.pbMessage(_INTL("Please select a Pokémon."))
  4788. pbChoosePokemon(1,3)
  4789. poke=pbGetPokemon(1)
  4790. if isConst?(poke.species,PBSpecies,:ARCEUS)
  4791. if poke.egg?
  4792. Kernel.pbMessage(_INTL("That Pokémon must be hatched before it can form an egg."))
  4793. elsif (poke.isShadow? rescue false)
  4794. Kernel.pbMessage(_INTL("{1} must be purified before it can form an egg.",poke.name))
  4795. # Creates a Dialga egg
  4796. elsif isConst?(poke.item,PBItems,:ADAMANTORB)
  4797. Kernel.pbMessage(_INTL("{1} is radiating a mysterious energy...",poke.name))
  4798. if Kernel.pbConfirmMessage(_INTL("Should {1} create an egg?",poke.name))
  4799. pbRitualAnimation(poke)
  4800. pbGenerateEgg(:DIALGA,_I("A Divine Force."))
  4801. pkmn=$Trainer.lastParty
  4802. pkmn.setItem(:ADAMANTORB)
  4803. if poke.ballused!=4 && poke.ballused!=15
  4804. pkmn.ballused=poke.ballused
  4805. end
  4806. pkmn.setNature(poke.nature) if rand(10)<5
  4807. pkmn.iv[0]=poke.iv[0] if rand(10)<8
  4808. pkmn.iv[1]=poke.iv[1] if rand(10)<8
  4809. pkmn.iv[2]=poke.iv[2] if rand(10)<8
  4810. pkmn.iv[3]=poke.iv[3] if rand(10)<8
  4811. pkmn.iv[4]=poke.iv[4] if rand(10)<8
  4812. pkmn.iv[5]=poke.iv[5] if rand(10)<8
  4813. pbWait(1)
  4814. pbMEPlay("Pkmn get")
  4815. Kernel.pbMessage(_INTL("{1} formed an egg!",poke.name))
  4816. pbWait(5)
  4817. Kernel.pbMessage(_INTL("{1}'s {2} fused with the egg!",
  4818. poke.name,PBItems.getName(poke.item)))
  4819. poke.item=0
  4820. else
  4821. Kernel.pbMessage(_INTL("You decided not to form an egg."))
  4822. end
  4823. # Creates a Palkia egg
  4824. elsif isConst?(poke.item,PBItems,:LUSTROUSORB)
  4825. Kernel.pbMessage(_INTL("{1} is radiating a mysterious energy...",poke.name))
  4826. if Kernel.pbConfirmMessage(_INTL("Should {1} create an egg?",poke.name))
  4827. pbRitualAnimation(poke)
  4828. pbGenerateEgg(:PALKIA,_I("A Divine Force."))
  4829. pkmn=$Trainer.lastParty
  4830. pkmn.setItem(:LUSTROUSORB)
  4831. if poke.ballused!=4 && poke.ballused!=15
  4832. pkmn.ballused=poke.ballused
  4833. end
  4834. pkmn.setNature(poke.nature) if rand(10)<5
  4835. pkmn.iv[0]=poke.iv[0] if rand(10)<8
  4836. pkmn.iv[1]=poke.iv[1] if rand(10)<8
  4837. pkmn.iv[2]=poke.iv[2] if rand(10)<8
  4838. pkmn.iv[3]=poke.iv[3] if rand(10)<8
  4839. pkmn.iv[4]=poke.iv[4] if rand(10)<8
  4840. pkmn.iv[5]=poke.iv[5] if rand(10)<8
  4841. pbWait(1)
  4842. pbMEPlay("Pkmn get")
  4843. Kernel.pbMessage(_INTL("{1} formed an egg!",poke.name))
  4844. pbWait(5)
  4845. Kernel.pbMessage(_INTL("{1}'s {2} fused with the egg!",
  4846. poke.name,PBItems.getName(poke.item)))
  4847. poke.item=0
  4848. else
  4849. Kernel.pbMessage(_INTL("You decided not to form an egg."))
  4850. end
  4851. # Creates a Giratina egg
  4852. elsif isConst?(poke.item,PBItems,:GRISEOUSORB)
  4853. Kernel.pbMessage(_INTL("{1} is radiating a mysterious energy...",poke.name))
  4854. if Kernel.pbConfirmMessage(_INTL("Should {1} create an egg?",poke.name))
  4855. pbRitualAnimation(poke)
  4856. pbGenerateEgg(:GIRATINA,_I("A Divine Force."))
  4857. pkmn=$Trainer.lastParty
  4858. pkmn.setItem(:GRISEOUSORB)
  4859. if poke.ballused!=4 && poke.ballused!=15
  4860. pkmn.ballused=poke.ballused
  4861. end
  4862. pkmn.setNature(poke.nature) if rand(10)<5
  4863. pkmn.iv[0]=poke.iv[0] if rand(10)<8
  4864. pkmn.iv[1]=poke.iv[1] if rand(10)<8
  4865. pkmn.iv[2]=poke.iv[2] if rand(10)<8
  4866. pkmn.iv[3]=poke.iv[3] if rand(10)<8
  4867. pkmn.iv[4]=poke.iv[4] if rand(10)<8
  4868. pkmn.iv[5]=poke.iv[5] if rand(10)<8
  4869. pbWait(1)
  4870. pbMEPlay("Pkmn get")
  4871. Kernel.pbMessage(_INTL("{1} formed an egg!",poke.name))
  4872. pbWait(5)
  4873. Kernel.pbMessage(_INTL("{1}'s {2} fused with the egg!",
  4874. poke.name,PBItems.getName(poke.item)))
  4875. poke.item=0
  4876. else
  4877. Kernel.pbMessage(_INTL("You decided not to form an egg."))
  4878. end
  4879. # Creates an Arceus egg
  4880. elsif isConst?(poke.item,PBItems,:DIVINEPLATE)
  4881. Kernel.pbMessage(_INTL("{1} is radiating a mysterious energy...",poke.name))
  4882. if Kernel.pbConfirmMessage(_INTL("Should {1} create an egg?",poke.name))
  4883. pbRitualAnimation(poke)
  4884. pbGenerateEgg(:ARCEUS,_I("A Divine Force."))
  4885. pkmn=$Trainer.lastParty
  4886. if poke.ballused!=4 && poke.ballused!=15
  4887. pkmn.ballused=poke.ballused
  4888. end
  4889. pkmn.setNature(poke.nature)
  4890. pkmn.iv[0]=31
  4891. pkmn.iv[1]=31
  4892. pkmn.iv[2]=31
  4893. pkmn.iv[3]=31
  4894. pkmn.iv[4]=31
  4895. pkmn.iv[5]=31
  4896. pbWait(1)
  4897. pbMEPlay("Pkmn get")
  4898. Kernel.pbMessage(_INTL("{1} formed an egg!",poke.name))
  4899. pbWait(5)
  4900. Kernel.pbMessage(_INTL("{1}'s {2} shattered!",
  4901. poke.name,PBItems.getName(poke.item)))
  4902. poke.item=0
  4903. else
  4904. Kernel.pbMessage(_INTL("You decided not to form an egg."))
  4905. end
  4906. # Creates a Type: Null egg
  4907. elsif isConst?(poke.item,PBItems,:FALSEPLATE)
  4908. Kernel.pbMessage(_INTL("{1} is radiating a mysterious energy...",poke.name))
  4909. if Kernel.pbConfirmMessage(_INTL("Should {1} create an egg?",poke.name))
  4910. pbRitualAnimation(poke)
  4911. pbGenerateEgg(:TYPENULL,_I("A Corrupted Force."))
  4912. pkmn=$Trainer.lastParty
  4913. if poke.ballused!=4 && poke.ballused!=15
  4914. pkmn.ballused=poke.ballused
  4915. end
  4916. pkmn.setNature(poke.nature)
  4917. pkmn.iv[0]=poke.iv[0]
  4918. pkmn.iv[1]=poke.iv[1]
  4919. pkmn.iv[2]=poke.iv[2]
  4920. pkmn.iv[3]=poke.iv[3]
  4921. pkmn.iv[4]=poke.iv[4]
  4922. pkmn.iv[5]=poke.iv[5]
  4923. pbWait(1)
  4924. pbMEPlay("Pkmn get")
  4925. Kernel.pbMessage(_INTL("{1} formed an egg!",poke.name))
  4926. pbWait(5)
  4927. Kernel.pbMessage(_INTL("{1}'s {2} shattered!",
  4928. poke.name,PBItems.getName(poke.item)))
  4929. poke.item=0
  4930. else
  4931. Kernel.pbMessage(_INTL("You decided not to form an egg."))
  4932. end
  4933. else
  4934. Kernel.pbMessage(_INTL("{1} isn't holding the correct item to form an egg.",poke.name))
  4935. end
  4936. elsif $game_variables[1]<0
  4937. Kernel.pbMessage(_INTL("You decided not to form an egg."))
  4938. elsif !isConst?(poke.species,PBSpecies,:ARCEUS)
  4939. Kernel.pbMessage(_INTL("That Pokémon isn't capable of forming an egg."))
  4940. end
  4941. end
  4942. $game_variables[1]=-1
  4943. end
  4944. end
  4945. #===============================================================================
  4946.  
  4947. alias birthsigns_hatch pbHatch
  4948. def pbHatch(pokemon)
  4949. birthsigns_hatch(pokemon)
  4950. #=============================================================================
  4951. # Applies corresponding Birthsign upon hatching
  4952. #=============================================================================
  4953. pokemon.setZodiacsign(Time.now.mon) if ZODIACSET!=0
  4954. #=============================================================================
  4955. end
  4956.  
  4957. #===============================================================================
  4958. # Birthsigns Bonuses - Shadow Pokemon
  4959. #===============================================================================
  4960. # Applies passive birthsign effects to a purified Shadow Pokemon if it was
  4961. # obtained through an egg.
  4962. #===============================================================================
  4963. alias birthsigns_purify pbPurify
  4964. def pbPurify(pokemon,scene)
  4965. birthsigns_purify(pokemon,scene)
  4966. #===========================================================================
  4967. # Unlocks latent Birthsign on Shadow Pokemon
  4968. #===========================================================================
  4969. if pokemon.hasBirthsign?
  4970. pokemon.applyBirthsignBonuses
  4971. scene.pbDisplay(_INTL("{1} unlocked its birthsign!",pokemon.name))
  4972. scene.pbDisplay(_INTL("{1} inherits the power of <c2=65467b14>{2}</c2>!",pokemon.name,pokemon.pbGetBirthsignName))
  4973. end
  4974. #===========================================================================
  4975. end
  4976.  
  4977. #########[SECTION 7 - BATTLE MECHANICS]##########
  4978. #===============================================================================
  4979. # Birthsign Bonuses - Battle Effects
  4980. #===============================================================================
  4981. # Applies Birthsign effects that alter conditions during or after battle.
  4982. # Overwrites sections in PokeBattle_Battle & PField_Field.
  4983. #===============================================================================
  4984. def pbGenerateWildPokemon(species,level,isroamer=false)
  4985. shadowpkmn=false
  4986. genwildpoke = PokeBattle_Pokemon.new(species,level,$Trainer)
  4987. items = genwildpoke.wildHoldItems
  4988. firstpoke = $Trainer.firstPokemon
  4989. chances = [50,5,1]
  4990. chances = [60,20,5] if firstpoke && !firstpoke.egg? && isConst?(firstpoke.ability,PBAbilities,:COMPOUNDEYES)
  4991. itemrnd = rand(100)
  4992. if itemrnd<chances[0] || (items[0]==items[1] && items[1]==items[2])
  4993. genwildpoke.setItem(items[0])
  4994. elsif itemrnd<(chances[0]+chances[1])
  4995. genwildpoke.setItem(items[1])
  4996. elsif itemrnd<(chances[0]+chances[1]+chances[2])
  4997. genwildpoke.setItem(items[2])
  4998. end
  4999. #=============================================================================
  5000. # Birthsigns - The Thief
  5001. # Wild Pokemon have a chance of holding treasure when leading.
  5002. #=============================================================================
  5003. if genwildpoke.item==0
  5004. baseloot = [:PEARL,:BIGPEARL,:RELICCOPPER,:NUGGET]
  5005. rareloot = [:RELICSILVER,:PEARLSTRING,:RELICGOLD,:BIGNUGGET]
  5006. epicloot = [:RELICVASE,:RELICBAND,:RELICSTATUE,:RELICCROWN]
  5007. if firstpoke.hasBirthsign? && firstpoke.birthsign==10 && !firstpoke.fainted?
  5008. genwildpoke.setItem(baseloot[rand(3)]) if rand(100)<=10
  5009. genwildpoke.setItem(rareloot[rand(3)]) if rand(100)<=5
  5010. genwildpoke.setItem(epicloot[rand(3)]) if rand(100)<1
  5011. end
  5012. end
  5013. #=============================================================================
  5014. # Birthsigns - The Companion
  5015. # Wild Pokemon have a higher base happiness when leading.
  5016. #=============================================================================
  5017. if firstpoke.hasBirthsign? && firstpoke.birthsign==2 && !firstpoke.fainted?
  5018. genwildpoke.happiness=genwildpoke.happiness*2
  5019. end
  5020. #=============================================================================
  5021. # Birthsign - The Assassin
  5022. # Wild Pokemon have a chance of being asleep for 1 turn when leading.
  5023. #=============================================================================
  5024. if firstpoke.hasBirthsign? && firstpoke.birthsign==21 && !firstpoke.fainted?
  5025. if !isConst?(genwildpoke.ability,PBAbilities,:INSOMNIA) &&
  5026. !isConst?(genwildpoke.ability,PBAbilities,:VITALSPIRIT) &&
  5027. genwildpoke.status=0
  5028. # The odds of encountering sleeping Pokemon at night (70%)
  5029. if PBDayNight.isNight?(pbGetTimeNow) && rand(100)<70
  5030. genwildpoke.status=1
  5031. genwildpoke.statusCount=2
  5032. # The odds of encountering sleeping Pokemon in day (30%)
  5033. elsif PBDayNight.isDay?(pbGetTimeNow) && rand(100)<30
  5034. genwildpoke.status=1
  5035. genwildpoke.statusCount=2
  5036. end
  5037. end
  5038. end
  5039. #=============================================================================
  5040. # Birthsign - The Mirror
  5041. # Wild Pokemon have a 50% chance of sharing each IV with the leading Pokemon.
  5042. #=============================================================================
  5043. if firstpoke.hasBirthsign? && firstpoke.birthsign==27 && !firstpoke.fainted?
  5044. genwildpoke.iv[0]=firstpoke.iv[0] if !isroamer && rand(10)<5
  5045. genwildpoke.iv[1]=firstpoke.iv[1] if !isroamer && rand(10)<5
  5046. genwildpoke.iv[2]=firstpoke.iv[2] if !isroamer && rand(10)<5
  5047. genwildpoke.iv[3]=firstpoke.iv[3] if !isroamer && rand(10)<5
  5048. genwildpoke.iv[4]=firstpoke.iv[4] if !isroamer && rand(10)<5
  5049. genwildpoke.iv[5]=firstpoke.iv[5] if !isroamer && rand(10)<5
  5050. end
  5051. #=============================================================================
  5052. if hasConst?(PBItems,:SHINYCHARM) && $PokemonBag.pbHasItem?(:SHINYCHARM)
  5053. for i in 0...2 # 3 times as likely
  5054. break if genwildpoke.isShiny?
  5055. genwildpoke.personalID = rand(65536)|(rand(65536)<<16)
  5056. end
  5057. end
  5058. if rand(65536)<POKERUSCHANCE
  5059. genwildpoke.givePokerus
  5060. end
  5061. if firstpoke && !firstpoke.egg?
  5062. if isConst?(firstpoke.ability,PBAbilities,:CUTECHARM) && !genwildpoke.isSingleGendered?
  5063. if firstpoke.isMale?
  5064. (rand(3)<2) ? genwildpoke.makeFemale : genwildpoke.makeMale
  5065. elsif firstpoke.isFemale?
  5066. (rand(3)<2) ? genwildpoke.makeMale : genwildpoke.makeFemale
  5067. end
  5068. elsif isConst?(firstpoke.ability,PBAbilities,:SYNCHRONIZE)
  5069. genwildpoke.setNature(firstpoke.nature) if !isroamer && rand(10)<5
  5070. end
  5071. end
  5072. #=============================================================================
  5073. # Fortune Teller Event
  5074. #=============================================================================
  5075. # Wild Pokemon spawn with a sign relative to the player's trainer sign.
  5076. #=============================================================================
  5077. if !genwildpoke.isBlessed?
  5078. if pbFortuneEffectActive?
  5079. if $PokemonGlobal.fortuneEqual==true
  5080. genwildpoke.setZodiacsign($Trainer.getCalendarsign)
  5081. elsif $PokemonGlobal.fortuneGood==true
  5082. genwildpoke.setPartnersign($Trainer.getCalendarsign)
  5083. genwildpoke.happiness=genwildpoke.happiness*1.5
  5084. genwildpoke.setItem(getZodiacGem(genwildpoke.monthsign)) if rand(10)<5
  5085. elsif $PokemonGlobal.fortuneBad==true
  5086. genwildpoke.setRivalsign($Trainer.getCalendarsign)
  5087. genwildpoke.happiness=genwildpoke.happiness/2
  5088. end
  5089. #=============================================================================
  5090. # Birthsign - The Soulmate
  5091. #=============================================================================
  5092. # Wild Pokemon spawn with one of the user's Partner signs when leading.
  5093. #=============================================================================
  5094. elsif firstpoke.hasZodiacsign? && firstpoke.birthsign==32 && !firstpoke.fainted?
  5095. genwildpoke.setPartnersign(firstpoke.getCalendarsign)
  5096. else
  5097. #=============================================================================
  5098. # Birthsigns for wild encounters
  5099. #=============================================================================
  5100. if WILDBIRTHSIGNS==1
  5101. # Generates wild Pokemon with the current month's sign
  5102. genwildpoke.setZodiacsign(Time.now.mon)
  5103. elsif WILDBIRTHSIGNS==2
  5104. # Generates wild Pokemon with partner/rival signs of the current month
  5105. randsign=rand(10)
  5106. if randsign>5
  5107. genwildpoke.setPartnersign(Time.now.mon)
  5108. else
  5109. genwildpoke.setRivalsign(Time.now.mon)
  5110. end
  5111. elsif WILDBIRTHSIGNS==3
  5112. # Generates wild Pokemon with random zodiac signs
  5113. genwildpoke.setRandomZodiac
  5114. elsif WILDBIRTHSIGNS==4
  5115. # Generates wild Pokemon with completely random signs
  5116. genwildpoke.setRandomsign
  5117. else
  5118. # Generates wild Pokemon with no sign
  5119. genwildpoke.setBirthsign(0)
  5120. end
  5121. end
  5122. end
  5123. #=============================================================================
  5124. Events.onWildPokemonCreate.trigger(nil,genwildpoke)
  5125. return genwildpoke
  5126. end
  5127.  
  5128. class PokeBattle_Battle
  5129.  
  5130. def pbGainExpOne(index,defeated,partic,expshare,haveexpall,showmessages=true)
  5131. thispoke=@party1[index]
  5132. # Original species, not current species
  5133. level=defeated.level
  5134. baseexp=defeated.pokemon.baseExp
  5135. evyield=defeated.pokemon.evYield
  5136. # Gain effort value points, using RS effort values
  5137. totalev=0
  5138. for k in 0...6
  5139. totalev+=thispoke.ev[k]
  5140. end
  5141. for k in 0...6
  5142. evgain=evyield[k]
  5143. evgain*=2 if isConst?(thispoke.item,PBItems,:MACHOBRACE) ||
  5144. isConst?(thispoke.itemInitial,PBItems,:MACHOBRACE)
  5145. case k
  5146. when PBStats::HP
  5147. evgain+=4 if isConst?(thispoke.item,PBItems,:POWERWEIGHT) ||
  5148. isConst?(thispoke.itemInitial,PBItems,:POWERWEIGHT)
  5149. when PBStats::ATTACK
  5150. evgain+=4 if isConst?(thispoke.item,PBItems,:POWERBRACER) ||
  5151. isConst?(thispoke.itemInitial,PBItems,:POWERBRACER)
  5152. when PBStats::DEFENSE
  5153. evgain+=4 if isConst?(thispoke.item,PBItems,:POWERBELT) ||
  5154. isConst?(thispoke.itemInitial,PBItems,:POWERBELT)
  5155. when PBStats::SPATK
  5156. evgain+=4 if isConst?(thispoke.item,PBItems,:POWERLENS) ||
  5157. isConst?(thispoke.itemInitial,PBItems,:POWERLENS)
  5158. when PBStats::SPDEF
  5159. evgain+=4 if isConst?(thispoke.item,PBItems,:POWERBAND) ||
  5160. isConst?(thispoke.itemInitial,PBItems,:POWERBAND)
  5161. when PBStats::SPEED
  5162. evgain+=4 if isConst?(thispoke.item,PBItems,:POWERANKLET) ||
  5163. isConst?(thispoke.itemInitial,PBItems,:POWERANKLET)
  5164. end
  5165. #=========================================================================
  5166. # Birthsigns - The Apprentice
  5167. # Doubles EV's gained from battles. Stacks with similar effects.
  5168. #=========================================================================
  5169. evgain*=2 if thispoke.birthsign==1 && !(thispoke.isShadow? rescue false)
  5170. #=========================================================================
  5171. evgain*=2 if thispoke.pokerusStage>=1 # Infected or cured
  5172. if evgain>0
  5173. # Can't exceed overall limit
  5174. evgain-=totalev+evgain-PokeBattle_Pokemon::EVLIMIT if totalev+evgain>PokeBattle_Pokemon::EVLIMIT
  5175. # Can't exceed stat limit
  5176. evgain-=thispoke.ev[k]+evgain-PokeBattle_Pokemon::EVSTATLIMIT if thispoke.ev[k]+evgain>PokeBattle_Pokemon::EVSTATLIMIT
  5177. # Add EV gain
  5178. thispoke.ev[k]+=evgain
  5179. if thispoke.ev[k]>PokeBattle_Pokemon::EVSTATLIMIT
  5180. print "Single-stat EV limit #{PokeBattle_Pokemon::EVSTATLIMIT} exceeded.\r\nStat: #{k} EV gain: #{evgain} EVs: #{thispoke.ev.inspect}"
  5181. thispoke.ev[k]=PokeBattle_Pokemon::EVSTATLIMIT
  5182. end
  5183. totalev+=evgain
  5184. if totalev>PokeBattle_Pokemon::EVLIMIT
  5185. print "EV limit #{PokeBattle_Pokemon::EVLIMIT} exceeded.\r\nTotal EVs: #{totalev} EV gain: #{evgain} EVs: #{thispoke.ev.inspect}"
  5186. end
  5187. end
  5188. end
  5189. # Gain experience
  5190. ispartic=0
  5191. ispartic=1 if defeated.participants.include?(index)
  5192. haveexpshare=(isConst?(thispoke.item,PBItems,:EXPSHARE) ||
  5193. isConst?(thispoke.itemInitial,PBItems,:EXPSHARE)) ? 1 : 0
  5194. exp=0
  5195. if expshare>0
  5196. if partic==0 # No participants, all Exp goes to Exp Share holders
  5197. exp=(level*baseexp).floor
  5198. exp=(exp/(NOSPLITEXP ? 1 : expshare)).floor*haveexpshare
  5199. else
  5200. if NOSPLITEXP
  5201. exp=(level*baseexp).floor*ispartic
  5202. exp=(level*baseexp/2).floor*haveexpshare if ispartic==0
  5203. else
  5204. exp=(level*baseexp/2).floor
  5205. exp=(exp/partic).floor*ispartic + (exp/expshare).floor*haveexpshare
  5206. end
  5207. end
  5208. elsif ispartic==1
  5209. exp=(level*baseexp/(NOSPLITEXP ? 1 : partic)).floor
  5210. elsif haveexpall
  5211. exp=(level*baseexp/2).floor
  5212. end
  5213. return if exp<=0
  5214. #===========================================================================
  5215. # Birthsign - The Scholar
  5216. # The Pokemon gains 20% more exp than normal.
  5217. #===========================================================================
  5218. if thispoke.birthsign==14 && !(thispoke.isShadow? rescue false)
  5219. exp=(exp*3/2.5).floor
  5220. end
  5221. #===========================================================================
  5222. exp=(exp*3/2).floor if @opponent
  5223. if USESCALEDEXPFORMULA
  5224. exp=(exp/5).floor
  5225. leveladjust=(2*level+10.0)/(level+thispoke.level+10.0)
  5226. leveladjust=leveladjust**5
  5227. leveladjust=Math.sqrt(leveladjust)
  5228. exp=(exp*leveladjust).floor
  5229. exp+=1 if ispartic>0 || haveexpshare>0
  5230. else
  5231. exp=(exp/7).floor
  5232. end
  5233. isOutsider=(thispoke.trainerID!=self.pbPlayer.id ||
  5234. (thispoke.language!=0 && thispoke.language!=self.pbPlayer.language))
  5235. if isOutsider
  5236. if thispoke.language!=0 && thispoke.language!=self.pbPlayer.language
  5237. exp=(exp*1.7).floor
  5238. else
  5239. exp=(exp*3/2).floor
  5240. end
  5241. end
  5242. exp=(exp*3/2).floor if isConst?(thispoke.item,PBItems,:LUCKYEGG) ||
  5243. isConst?(thispoke.itemInitial,PBItems,:LUCKYEGG)
  5244. growthrate=thispoke.growthrate
  5245. newexp=PBExperience.pbAddExperience(thispoke.exp,exp,growthrate)
  5246. exp=newexp-thispoke.exp
  5247. if exp>0
  5248. if showmessages
  5249. if isOutsider
  5250. pbDisplayPaused(_INTL("{1} gained a boosted {2} Exp. Points!",thispoke.name,exp))
  5251. else
  5252. pbDisplayPaused(_INTL("{1} gained {2} Exp. Points!",thispoke.name,exp))
  5253. end
  5254. end
  5255. newlevel=PBExperience.pbGetLevelFromExperience(newexp,growthrate)
  5256. tempexp=0
  5257. curlevel=thispoke.level
  5258. if newlevel<curlevel
  5259. debuginfo="#{thispoke.name}: #{thispoke.level}/#{newlevel} | #{thispoke.exp}/#{newexp} | gain: #{exp}"
  5260. raise RuntimeError.new(_INTL("The new level ({1}) is less than the Pokémon's\r\ncurrent level ({2}), which shouldn't happen.\r\n[Debug: {3}]",
  5261. newlevel,curlevel,debuginfo))
  5262. return
  5263. end
  5264. if thispoke.respond_to?("isShadow?") && thispoke.isShadow?
  5265. thispoke.exp+=exp
  5266. else
  5267. tempexp1=thispoke.exp
  5268. tempexp2=0
  5269. # Find battler
  5270. battler=pbFindPlayerBattler(index)
  5271. loop do
  5272. # EXP Bar animation
  5273. startexp=PBExperience.pbGetStartExperience(curlevel,growthrate)
  5274. endexp=PBExperience.pbGetStartExperience(curlevel+1,growthrate)
  5275. tempexp2=(endexp<newexp) ? endexp : newexp
  5276. thispoke.exp=tempexp2
  5277. @scene.pbEXPBar(thispoke,battler,startexp,endexp,tempexp1,tempexp2)
  5278. tempexp1=tempexp2
  5279. curlevel+=1
  5280. if curlevel>newlevel
  5281. thispoke.calcStats
  5282. battler.pbUpdate(false) if battler
  5283. @scene.pbRefresh
  5284. break
  5285. end
  5286. oldtotalhp=thispoke.totalhp
  5287. oldattack=thispoke.attack
  5288. olddefense=thispoke.defense
  5289. oldspeed=thispoke.speed
  5290. oldspatk=thispoke.spatk
  5291. oldspdef=thispoke.spdef
  5292. if battler && battler.pokemon && @internalbattle
  5293. battler.pokemon.changeHappiness("levelup")
  5294. end
  5295. thispoke.calcStats
  5296. battler.pbUpdate(false) if battler
  5297. @scene.pbRefresh
  5298. pbDisplayPaused(_INTL("{1} grew to Level {2}!",thispoke.name,curlevel))
  5299. @scene.pbLevelUp(thispoke,battler,oldtotalhp,oldattack,
  5300. olddefense,oldspeed,oldspatk,oldspdef)
  5301. # Finding all moves learned at this level
  5302. movelist=thispoke.getMoveList
  5303. for k in movelist
  5304. if k[0]==thispoke.level # Learned a new move
  5305. pbLearnMove(index,k[1])
  5306. end
  5307. end
  5308. end
  5309. end
  5310. end
  5311. end
  5312.  
  5313. def pbEndOfBattle(canlose=false)
  5314. case @decision
  5315. ##### WIN #####
  5316. when 1
  5317. PBDebug.log("")
  5318. PBDebug.log("***Player won***")
  5319. if @opponent
  5320. @scene.pbTrainerBattleSuccess
  5321. if @opponent.is_a?(Array)
  5322. pbDisplayPaused(_INTL("{1} defeated {2} and {3}!",self.pbPlayer.name,@opponent[0].fullname,@opponent[1].fullname))
  5323. else
  5324. pbDisplayPaused(_INTL("{1} defeated\r\n{2}!",self.pbPlayer.name,@opponent.fullname))
  5325. end
  5326. @scene.pbShowOpponent(0)
  5327. pbDisplayPaused(@endspeech.gsub(/\\[Pp][Nn]/,self.pbPlayer.name))
  5328. if @opponent.is_a?(Array)
  5329. @scene.pbHideOpponent
  5330. @scene.pbShowOpponent(1)
  5331. pbDisplayPaused(@endspeech2.gsub(/\\[Pp][Nn]/,self.pbPlayer.name))
  5332. end
  5333. # Calculate money gained for winning
  5334. if @internalbattle
  5335. tmoney=0
  5336. if @opponent.is_a?(Array) # Double battles
  5337. maxlevel1=0; maxlevel2=0; limit=pbSecondPartyBegin(1)
  5338. for i in 0...limit
  5339. if @party2[i]
  5340. maxlevel1=@party2[i].level if maxlevel1<@party2[i].level
  5341. end
  5342. if @party2[i+limit]
  5343. maxlevel2=@party2[i+limit].level if maxlevel1<@party2[i+limit].level
  5344. end
  5345. end
  5346. tmoney+=maxlevel1*@opponent[0].moneyEarned
  5347. tmoney+=maxlevel2*@opponent[1].moneyEarned
  5348. else
  5349. maxlevel=0
  5350. for i in @party2
  5351. next if !i
  5352. maxlevel=i.level if maxlevel<i.level
  5353. end
  5354. tmoney+=maxlevel*@opponent.moneyEarned
  5355. end
  5356. # If Amulet Coin/Luck Incense's effect applies, double money earned
  5357. tmoney*=2 if @amuletcoin
  5358. # If Happy Hour's effect applies, double money earned
  5359. tmoney*=2 if @doublemoney
  5360. #=====================================================================
  5361. # Birthsign - The Aristocrat
  5362. # Gains 20% more prize money when leading.
  5363. #=====================================================================
  5364. firstpoke=$Trainer.party[0]
  5365. if firstpoke.hasBirthsign? && firstpoke.birthsign==16 && !firstpoke.fainted?
  5366. tmoney=(tmoney*3/2.5).floor
  5367. end
  5368. #=====================================================================
  5369. oldmoney=self.pbPlayer.money
  5370. self.pbPlayer.money+=tmoney
  5371. moneygained=self.pbPlayer.money-oldmoney
  5372. if moneygained>0
  5373. pbDisplayPaused(_INTL("{1} got ${2}\r\nfor winning!",self.pbPlayer.name,pbCommaNumber(tmoney)))
  5374. end
  5375. end
  5376. end
  5377. #=========================================================================
  5378. # Birthsign - The Aristocrat
  5379. # Has a 50% chance of picking up spare change after wild battles.
  5380. #=========================================================================
  5381. firstpoke=$Trainer.party[0]
  5382. if firstpoke.hasBirthsign? && firstpoke.birthsign==16 && !firstpoke.fainted?
  5383. if rand(10)<5
  5384. @extramoney+=5*firstpoke.level/2
  5385. @extramoney=MAXMONEY if @extramoney>MAXMONEY
  5386. end
  5387. end
  5388. #=========================================================================
  5389. if @internalbattle && @extramoney>0
  5390. @extramoney*=2 if @amuletcoin
  5391. @extramoney*=2 if @doublemoney
  5392. oldmoney=self.pbPlayer.money
  5393. self.pbPlayer.money+=@extramoney
  5394. moneygained=self.pbPlayer.money-oldmoney
  5395. if moneygained>0
  5396. pbDisplayPaused(_INTL("{1} picked up ${2}!",self.pbPlayer.name,pbCommaNumber(@extramoney)))
  5397. end
  5398. end
  5399. for pkmn in @snaggedpokemon
  5400. pbStorePokemon(pkmn)
  5401. self.pbPlayer.shadowcaught=[] if !self.pbPlayer.shadowcaught
  5402. self.pbPlayer.shadowcaught[pkmn.species]=true
  5403. end
  5404. @snaggedpokemon.clear
  5405. ##### LOSE, DRAW #####
  5406. when 2, 5
  5407. PBDebug.log("")
  5408. PBDebug.log("***Player lost***") if @decision==2
  5409. PBDebug.log("***Player drew with opponent***") if @decision==5
  5410. if @internalbattle
  5411. moneylost=pbMaxLevelFromIndex(0) # Player's Pokémon only, not partner's
  5412. multiplier=[8,16,24,36,48,64,80,100,120]
  5413. moneylost*=multiplier[[multiplier.length-1,self.pbPlayer.numbadges].min]
  5414. moneylost=self.pbPlayer.money if moneylost>self.pbPlayer.money
  5415. moneylost=0 if $game_switches[NO_MONEY_LOSS]
  5416. oldmoney=self.pbPlayer.money
  5417. self.pbPlayer.money-=moneylost
  5418. lostmoney=oldmoney-self.pbPlayer.money
  5419. if @opponent
  5420. if @opponent.is_a?(Array)
  5421. pbDisplayPaused(_INTL("You lost against {1} and {2}!",@opponent[0].fullname,@opponent[1].fullname))
  5422. else
  5423. pbDisplayPaused(_INTL("You lost against\r\n{1}!",@opponent.fullname))
  5424. end
  5425. if moneylost>0
  5426. pbDisplayPaused(_INTL("You gave ${1} to the winner...",pbCommaNumber(lostmoney)))
  5427. end
  5428. else
  5429. pbDisplayPaused(_INTL("You have no more Pokémon that can fight!"))
  5430. if moneylost>0
  5431. pbDisplayPaused(_INTL("You panicked and dropped\r\n${1}...",pbCommaNumber(lostmoney)))
  5432. end
  5433. end
  5434. pbDisplayPaused(_INTL("You blacked out!")) if !canlose
  5435. elsif @decision==2
  5436. @scene.pbShowOpponent(0)
  5437. pbDisplayPaused(@endspeechwin.gsub(/\\[Pp][Nn]/,self.pbPlayer.name))
  5438. if @opponent.is_a?(Array)
  5439. @scene.pbHideOpponent
  5440. @scene.pbShowOpponent(1)
  5441. pbDisplayPaused(@endspeechwin2.gsub(/\\[Pp][Nn]/,self.pbPlayer.name))
  5442. end
  5443. end
  5444. end
  5445. # Pass on Pokérus within the party
  5446. infected=[]
  5447. for i in 0...$Trainer.party.length
  5448. if $Trainer.party[i].pokerusStage==1
  5449. infected.push(i)
  5450. end
  5451. end
  5452. if infected.length>=1
  5453. for i in infected
  5454. strain=$Trainer.party[i].pokerusStrain
  5455. if i>0 && $Trainer.party[i-1].pokerusStage==0
  5456. $Trainer.party[i-1].givePokerus(strain) if rand(3)==0
  5457. end
  5458. if i<$Trainer.party.length-1 && $Trainer.party[i+1].pokerusStage==0
  5459. $Trainer.party[i+1].givePokerus(strain) if rand(3)==0
  5460. end
  5461. end
  5462. end
  5463. @scene.pbEndBattle(@decision)
  5464. for i in @battlers
  5465. i.pbResetForm
  5466. if i.hasWorkingAbility(:NATURALCURE)
  5467. i.status=0
  5468. end
  5469. end
  5470. for i in $Trainer.party
  5471. i.setItem(i.itemInitial)
  5472. i.itemInitial=i.itemRecycle=0
  5473. i.belch=false
  5474. end
  5475. return @decision
  5476. end
  5477. end
  5478.  
  5479. module PokeBattle_BattleCommon
  5480.  
  5481. def pbThrowPokeBall(idxPokemon,ball,rareness=nil,showplayer=false)
  5482. itemname=PBItems.getName(ball)
  5483. battler=nil
  5484. if pbIsOpposing?(idxPokemon)
  5485. battler=self.battlers[idxPokemon]
  5486. else
  5487. battler=self.battlers[idxPokemon].pbOppositeOpposing
  5488. end
  5489. if battler.fainted?
  5490. battler=battler.pbPartner
  5491. end
  5492. pbDisplayBrief(_INTL("{1} threw one {2}!",self.pbPlayer.name,itemname))
  5493. if battler.fainted?
  5494. pbDisplay(_INTL("But there was no target..."))
  5495. return
  5496. end
  5497. if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
  5498. @scene.pbThrowAndDeflect(ball,1)
  5499. pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
  5500. else
  5501. pokemon=battler.pokemon
  5502. species=pokemon.species
  5503. if $DEBUG && Input.press?(Input::CTRL)
  5504. shakes=4
  5505. else
  5506. if !rareness
  5507. dexdata=pbOpenDexData
  5508. pbDexDataOffset(dexdata,pokemon.fSpecies,16)
  5509. rareness=dexdata.fgetb # Get rareness from dexdata file
  5510. dexdata.close
  5511. end
  5512. a=battler.totalhp
  5513. b=battler.hp
  5514. rareness=BallHandlers.modifyCatchRate(ball,rareness,self,battler)
  5515. x=(((a*3-b*2)*rareness)/(a*3)).floor
  5516. if battler.status==PBStatuses::SLEEP || battler.status==PBStatuses::FROZEN
  5517. x=(x*2.5).floor
  5518. elsif battler.status!=0
  5519. x=(x*1.5).floor
  5520. end
  5521. c=0
  5522. if $Trainer
  5523. if $Trainer.pokedexOwned>600
  5524. c=(x*2.5/6).floor
  5525. elsif $Trainer.pokedexOwned>450
  5526. c=(x*2/6).floor
  5527. elsif $Trainer.pokedexOwned>300
  5528. c=(x*1.5/6).floor
  5529. elsif $Trainer.pokedexOwned>150
  5530. c=(x*1/6).floor
  5531. elsif $Trainer.pokedexOwned>30
  5532. c=(x*0.5/6).floor
  5533. end
  5534. end
  5535. #=======================================================================
  5536. # Birthsign - The Hunter
  5537. # Increases the capture rate by 20% when leading.
  5538. #=======================================================================
  5539. firstpoke=$Trainer.party[0]
  5540. if firstpoke.hasBirthsign? && firstpoke.birthsign==23 && !firstpoke.fainted?
  5541. x=(x*3/2.5).floor
  5542. #x=(x*255).floor #Makes catch rate 100%. Used for testing.
  5543. end
  5544. #=======================================================================
  5545. shakes=0; critical=false
  5546. if x>255 || BallHandlers.isUnconditional?(ball,self,battler)
  5547. shakes=4
  5548. else
  5549. x=1 if x<1
  5550. y = ( 65536 / ((255.0/x)**0.1875) ).floor
  5551. if USECRITICALCAPTURE && pbRandom(256)<c
  5552. critical=true
  5553. shakes=4 if pbRandom(65536)<y
  5554. else
  5555. shakes+=1 if pbRandom(65536)<y
  5556. shakes+=1 if pbRandom(65536)<y && shakes==1
  5557. shakes+=1 if pbRandom(65536)<y && shakes==2
  5558. shakes+=1 if pbRandom(65536)<y && shakes==3
  5559. end
  5560. end
  5561. end
  5562. PBDebug.log("[Threw Poké Ball] #{itemname}, #{shakes} shakes (4=capture)")
  5563. @scene.pbThrow(ball,shakes,critical,battler.index,showplayer)
  5564. case shakes
  5565. when 0
  5566. pbDisplay(_INTL("Oh no! The Pokémon broke free!"))
  5567. BallHandlers.onFailCatch(ball,self,battler)
  5568. when 1
  5569. pbDisplay(_INTL("Aww... It appeared to be caught!"))
  5570. BallHandlers.onFailCatch(ball,self,battler)
  5571. when 2
  5572. pbDisplay(_INTL("Aargh! Almost had it!"))
  5573. BallHandlers.onFailCatch(ball,self,battler)
  5574. when 3
  5575. pbDisplay(_INTL("Gah! It was so close, too!"))
  5576. BallHandlers.onFailCatch(ball,self,battler)
  5577. when 4
  5578. pbDisplayBrief(_INTL("Gotcha! {1} was caught!",pokemon.name))
  5579. @scene.pbThrowSuccess
  5580. if pbIsSnagBall?(ball) && @opponent
  5581. pbRemoveFromParty(battler.index,battler.pokemonIndex)
  5582. battler.pbReset
  5583. battler.participants=[]
  5584. else
  5585. @decision=4
  5586. end
  5587. if pbIsSnagBall?(ball)
  5588. pokemon.ot=self.pbPlayer.name
  5589. pokemon.trainerID=self.pbPlayer.id
  5590. end
  5591. BallHandlers.onCatch(ball,self,pokemon)
  5592. pokemon.ballused=pbGetBallType(ball)
  5593. ((pokemon.makeUnmega if pokemon.isMega?) rescue nil)
  5594. pokemon.makeUnprimal rescue nil
  5595. pokemon.pbRecordFirstMoves
  5596. if GAINEXPFORCAPTURE
  5597. battler.captured=true
  5598. pbGainEXP
  5599. battler.captured=false
  5600. end
  5601. if !self.pbPlayer.hasOwned?(species)
  5602. self.pbPlayer.setOwned(species)
  5603. if $Trainer.pokedex
  5604. pbDisplayPaused(_INTL("{1}'s data was added to the Pokédex.",pokemon.name))
  5605. @scene.pbShowPokedex(species)
  5606. end
  5607. end
  5608. pokemon.forcedForm = false if MultipleForms.hasFunction?(pokemon.species,"getForm")
  5609. @scene.pbHideCaptureBall
  5610. if pbIsSnagBall?(ball) && @opponent
  5611. pokemon.pbUpdateShadowMoves rescue nil
  5612. @snaggedpokemon.push(pokemon)
  5613. else
  5614. pbStorePokemon(pokemon)
  5615. end
  5616. end
  5617. end
  5618. end
  5619. end
  5620.  
  5621. #===============================================================================
  5622. # Birthsign - The Vampire
  5623. #===============================================================================
  5624. # Heals user while walking at night. Harms/Burns user while walking in daylight.
  5625. #===============================================================================
  5626. Events.onStepTakenTransferPossible+=proc {|sender,e|
  5627. handled = e[0]
  5628. next if handled[0]
  5629. if $PokemonGlobal.stepcount%4==0
  5630. flashed = false
  5631. firstpoke=$Trainer.party[0]
  5632. if $Trainer.party.length>0
  5633. # Heals all users in the party with each step at night.
  5634. if PBDayNight.isNight? && pbGetMetadata($game_map.map_id,MetadataOutdoor)
  5635. for i in $Trainer.ablePokemonParty
  5636. if i.birthsign==31
  5637. i.hp += 1 if i.hp<i.totalhp
  5638. i.healStatus
  5639. end
  5640. end
  5641. end
  5642. # Harms/Burns the user with each step outside during the day when leading.
  5643. if (PBDayNight.isDay? && pbGetMetadata($game_map.map_id,MetadataOutdoor) &&
  5644. firstpoke.birthsign==31 && !firstpoke.fainted?)
  5645. if !flashed
  5646. $game_screen.start_flash(Color.new(255,0,0,128), 4)
  5647. flashed = true
  5648. end
  5649. firstpoke.hp -= 1 if firstpoke.hp>0
  5650. # Immune to Burn effect if the user has the following Abilities/Type
  5651. if (!firstpoke.isConst?(firstpoke.ability,PBAbilities,:WATERVEIL) &&
  5652. !firstpoke.isConst?(firstpoke.ability,PBAbilities,:WATERBUBBLE) &&
  5653. !firstpoke.isConst?(firstpoke.ability,PBAbilities,:COMATOSE) &&
  5654. !firstpoke.pbHasType?(:FIRE))
  5655. firstpoke.status = 3
  5656. end
  5657. if firstpoke.hp==0
  5658. firstpoke.changeHappiness("faint")
  5659. firstpoke.status = 0
  5660. Kernel.pbMessage(_INTL("{1} fainted...",firstpoke.name))
  5661. if defined? pbToggleFollowingPokemon
  5662. $PokemonTemp.dependentEvents.refresh_sprite
  5663. end
  5664. end
  5665. if pbAllFainted
  5666. handled[0] = true
  5667. pbCheckAllFainted
  5668. end
  5669. end
  5670. end
  5671. end
  5672. }
  5673.  
  5674. #===============================================================================
  5675. # NPC Trainers - Party birthsigns
  5676. #===============================================================================
  5677. # Allows you to give birthsigns to NPC trainers' Pokemon.
  5678. #
  5679. # In the Trainer PBS file, you may add birthsigns to a trainer's Pokemon as the
  5680. # 17th variable. Enter this sign in this format: "SIGN00" replacing the 00's
  5681. # with the number of your desired birthsign (01-33).
  5682. #
  5683. # If you equip the appropriate Zodiac Gem to one of these Pokemon, they will
  5684. # automatically activate its Zodiac Power on turn 1. Must have the Zodiac Power
  5685. # add-on script installed for this to occur.
  5686. #===============================================================================
  5687. TPBIRTHSIGN = 17
  5688. TPDEFAULTS = [0,10,0,0,0,0,0,nil,nil,0,false,nil,10,70,nil,false,0,0]
  5689.  
  5690. def pbLoadTrainer(trainerid,trainername,partyid=0)
  5691. if trainerid.is_a?(String) || trainerid.is_a?(Symbol)
  5692. if !hasConst?(PBTrainers,trainerid)
  5693. raise _INTL("Trainer type does not exist ({1}, {2}, ID {3})",trainerid,trainername,partyid)
  5694. end
  5695. trainerid=getID(PBTrainers,trainerid)
  5696. end
  5697. success=false
  5698. items=[]
  5699. party=[]
  5700. opponent=nil
  5701. trainers=load_data("Data/trainers.dat")
  5702. for trainer in trainers
  5703. name=trainer[1]
  5704. thistrainerid=trainer[0]
  5705. thispartyid=trainer[4]
  5706. next if trainerid!=thistrainerid || name!=trainername || partyid!=thispartyid
  5707. items=trainer[2].clone
  5708. name=pbGetMessageFromHash(MessageTypes::TrainerNames,name)
  5709. for i in RIVALNAMES
  5710. if isConst?(trainerid,PBTrainers,i[0]) && $game_variables[i[1]]!=0
  5711. name=$game_variables[i[1]]
  5712. end
  5713. end
  5714. opponent=PokeBattle_Trainer.new(name,thistrainerid)
  5715. opponent.setForeignID($Trainer) if $Trainer
  5716. for poke in trainer[3]
  5717. species=poke[TPSPECIES]
  5718. level=poke[TPLEVEL]
  5719. pokemon=PokeBattle_Pokemon.new(species,level,opponent)
  5720. pokemon.forcedForm = true if poke[TPFORM]!=0 && MultipleForms.hasFunction?(pokemon.species,"getForm")
  5721. pokemon.formNoCall=poke[TPFORM]
  5722. pokemon.resetMoves
  5723. pokemon.setItem(poke[TPITEM])
  5724. if poke[TPMOVE1]>0 || poke[TPMOVE2]>0 || poke[TPMOVE3]>0 || poke[TPMOVE4]>0
  5725. k=0
  5726. for move in [TPMOVE1,TPMOVE2,TPMOVE3,TPMOVE4]
  5727. pokemon.moves[k]=PBMove.new(poke[move])
  5728. k+=1
  5729. end
  5730. pokemon.moves.compact!
  5731. end
  5732. pokemon.setAbility(poke[TPABILITY])
  5733. pokemon.setGender(poke[TPGENDER])
  5734. if poke[TPSHINY] # if this is a shiny Pokémon
  5735. pokemon.makeShiny
  5736. else
  5737. pokemon.makeNotShiny
  5738. end
  5739. pokemon.setNature(poke[TPNATURE])
  5740. iv=poke[TPIV]
  5741. for i in 0...6
  5742. pokemon.iv[i]=iv&0x1F
  5743. pokemon.ev[i]=[85,level*3/2].min
  5744. end
  5745. pokemon.happiness=poke[TPHAPPINESS]
  5746. pokemon.name=poke[TPNAME] if poke[TPNAME] && poke[TPNAME]!=""
  5747. if poke[TPSHADOW] # if this is a Shadow Pokémon
  5748. pokemon.makeShadow rescue nil
  5749. pokemon.pbUpdateShadowMoves(true) rescue nil
  5750. pokemon.makeNotShiny
  5751. end
  5752. pokemon.ballused=poke[TPBALL]
  5753. pokemon.setBirthsign(poke[TPBIRTHSIGN])
  5754. pokemon.calcStats
  5755. party.push(pokemon)
  5756. end
  5757. success=true
  5758. break
  5759. end
  5760. return success ? [opponent,items,party] : nil
  5761. end
  5762.  
  5763. #########[SECTION 8 - STORAGE DISPLAY]##########
  5764. #===============================================================================
  5765. # PC Modifications - Storage Scene
  5766. #===============================================================================
  5767. # Allows birthsign tokens to be displayed in the PC storage window.
  5768. # Overwrites sections in PScreen_Storage.
  5769. #===============================================================================
  5770. class PokemonStorageScene
  5771.  
  5772. def pbUpdateOverlay(selection,party=nil)
  5773. overlay = @sprites["overlay"].bitmap
  5774. overlay.clear
  5775. buttonbase = Color.new(248,248,248)
  5776. buttonshadow = Color.new(80,80,80)
  5777. pbDrawTextPositions(overlay,[
  5778. [_INTL("Party: {1}",(@storage.party.length rescue 0)),270,328,2,buttonbase,buttonshadow,1],
  5779. [_INTL("Exit"),446,328,2,buttonbase,buttonshadow,1],
  5780. ])
  5781. pokemon = nil
  5782. if @screen.pbHeldPokemon
  5783. pokemon = @screen.pbHeldPokemon
  5784. elsif selection>=0
  5785. pokemon = (party) ? party[selection] : @storage[@storage.currentBox,selection]
  5786. end
  5787. if !pokemon
  5788. @sprites["pokemon"].visible = false
  5789. return
  5790. end
  5791. @sprites["pokemon"].visible = true
  5792. @sprites["pokemon"].z = 0
  5793. base = Color.new(88,88,80)
  5794. shadow = Color.new(168,184,184)
  5795. nonbase = Color.new(208,208,208)
  5796. nonshadow = Color.new(224,224,224)
  5797. pokename = pokemon.name
  5798. textstrings = [
  5799. [pokename,10,8,false,base,shadow]
  5800. ]
  5801. if !pokemon.egg?
  5802. imagepos = []
  5803. if pokemon.isMale?
  5804. textstrings.push([_INTL("♂"),148,8,false,Color.new(24,112,216),Color.new(136,168,208)])
  5805. elsif pokemon.isFemale?
  5806. textstrings.push([_INTL("♀"),148,8,false,Color.new(248,56,32),Color.new(224,152,144)])
  5807. end
  5808. imagepos.push(["Graphics/Pictures/Storage/overlay_lv",6,246,0,0,-1,-1])
  5809. textstrings.push([pokemon.level.to_s,28,234,false,base,shadow])
  5810. if pokemon.ability>0
  5811. textstrings.push([PBAbilities.getName(pokemon.ability),86,306,2,base,shadow])
  5812. else
  5813. textstrings.push([_INTL("No ability"),86,306,2,nonbase,nonshadow])
  5814. end
  5815. if pokemon.item>0
  5816. textstrings.push([PBItems.getName(pokemon.item),86,342,2,base,shadow])
  5817. else
  5818. textstrings.push([_INTL("No item"),86,342,2,nonbase,nonshadow])
  5819. end
  5820. if pokemon.isShiny?
  5821. imagepos.push(["Graphics/Pictures/shiny",156,198,0,0,-1,-1])
  5822. end
  5823. #=========================================================================
  5824. # Birthsigns - Token Display
  5825. #=========================================================================
  5826. if pokemon.birthsign>0 && !(pokemon.isShadow? rescue false) && !pokemon.egg?
  5827. imagepos.push(["Graphics/Pictures/Birthsigns/Other/storagesign",142,161,0,0,-1,-1])
  5828. tokenpath1="Graphics/Pictures/Birthsigns/token%02d"
  5829. tokenpath2="Graphics/Pictures/Birthsigns/bless_token%02d"
  5830. if pokemon.isBlessed?
  5831. zodiactoken=sprintf(tokenpath2,PBBirthsigns.signValue(pokemon.birthsign))
  5832. else
  5833. zodiactoken=sprintf(tokenpath1,PBBirthsigns.signValue(pokemon.birthsign))
  5834. end
  5835. imagepos.push([zodiactoken,148,166,0,0,-1,-1])
  5836. end
  5837. #=========================================================================
  5838. # Shiny Leaf
  5839. #=========================================================================
  5840. if SHOW_SHINY_LEAF
  5841. leaf="Graphics/Pictures/Birthsigns/Other/leaf"
  5842. leafcrown="Graphics/Pictures/Birthsigns/Other/leafcrown"
  5843. if pokemon.leafflag!=nil
  5844. if pokemon.shinyleaf==6 || pokemon.shinyleaf>6
  5845. imagepos.push([leafcrown,140,47,0,0,-1,-1])
  5846. else
  5847. imagepos.push([leaf,118,50,0,0,-1,-1]) if pokemon.shinyleaf>4
  5848. imagepos.push([leaf,128,50,0,0,-1,-1]) if pokemon.shinyleaf>3
  5849. imagepos.push([leaf,138,50,0,0,-1,-1]) if pokemon.shinyleaf>2
  5850. imagepos.push([leaf,148,50,0,0,-1,-1]) if pokemon.shinyleaf>1
  5851. imagepos.push([leaf,158,50,0,0,-1,-1]) if pokemon.shinyleaf>0
  5852. end
  5853. end
  5854. end
  5855. #=========================================================================
  5856. # IV Star Gauge
  5857. #=========================================================================
  5858. if SHOW_IV_STARS
  5859. nostar="Graphics/Pictures/Birthsigns/Other/starempty"
  5860. lowstar="Graphics/Pictures/Birthsigns/Other/starlow"
  5861. highstar="Graphics/Pictures/Birthsigns/Other/starhigh"
  5862. perfectstar="Graphics/Pictures/Birthsigns/Other/starperfect"
  5863. #HP
  5864. if pokemon.iv[0]>30
  5865. imagepos.push([perfectstar,8,198,0,0,-1,-1])
  5866. elsif pokemon.iv[0]>29
  5867. imagepos.push([highstar,8,198,0,0,-1,-1])
  5868. elsif pokemon.iv[0]>0 && pokemon.iv[0]<30
  5869. imagepos.push([lowstar,8,198,0,0,-1,-1])
  5870. else
  5871. imagepos.push([nostar,8,198,0,0,-1,-1])
  5872. end
  5873. #Atk
  5874. if pokemon.iv[1]>30
  5875. imagepos.push([perfectstar,24,198,0,0,-1,-1])
  5876. elsif pokemon.iv[1]>29
  5877. imagepos.push([highstar,24,198,0,0,-1,-1])
  5878. elsif pokemon.iv[1]>0 && pokemon.iv[1]<30
  5879. imagepos.push([lowstar,24,198,0,0,-1,-1])
  5880. else
  5881. imagepos.push([nostar,24,198,0,0,-1,-1])
  5882. end
  5883. #Def
  5884. if pokemon.iv[2]>30
  5885. imagepos.push([perfectstar,40,198,0,0,-1,-1])
  5886. elsif pokemon.iv[2]>29
  5887. imagepos.push([highstar,40,198,0,0,-1,-1])
  5888. elsif pokemon.iv[2]>0 && pokemon.iv[2]<30
  5889. imagepos.push([lowstar,40,198,0,0,-1,-1])
  5890. else
  5891. imagepos.push([nostar,40,198,0,0,-1,-1])
  5892. end
  5893. #SpAtk
  5894. if pokemon.iv[4]>30
  5895. imagepos.push([perfectstar,56,198,0,0,-1,-1])
  5896. elsif pokemon.iv[4]>29
  5897. imagepos.push([highstar,56,198,0,0,-1,-1])
  5898. elsif pokemon.iv[4]>0 && pokemon.iv[4]<30
  5899. imagepos.push([lowstar,56,198,0,0,-1,-1])
  5900. else
  5901. imagepos.push([nostar,56,198,0,0,-1,-1])
  5902. end
  5903. #SpDef
  5904. if pokemon.iv[5]>30
  5905. imagepos.push([perfectstar,72,198,0,0,-1,-1])
  5906. elsif pokemon.iv[5]>29
  5907. imagepos.push([highstar,72,198,0,0,-1,-1])
  5908. elsif pokemon.iv[5]>0 && pokemon.iv[5]<30
  5909. imagepos.push([lowstar,72,198,0,0,-1,-1])
  5910. else
  5911. imagepos.push([nostar,72,198,0,0,-1,-1])
  5912. end
  5913. #Speed
  5914. if pokemon.iv[3]>30
  5915. imagepos.push([perfectstar,88,198,0,0,-1,-1])
  5916. elsif pokemon.iv[3]>29
  5917. imagepos.push([highstar,88,198,0,0,-1,-1])
  5918. elsif pokemon.iv[3]>0 && pokemon.iv[3]<30
  5919. imagepos.push([lowstar,88,198,0,0,-1,-1])
  5920. else
  5921. imagepos.push([nostar,88,198,0,0,-1,-1])
  5922. end
  5923. end
  5924. #=========================================================================
  5925. typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/types"))
  5926. type1rect = Rect.new(0,pokemon.type1*28,64,28)
  5927. type2rect = Rect.new(0,pokemon.type2*28,64,28)
  5928. if pokemon.type1==pokemon.type2
  5929. overlay.blt(52,272,typebitmap.bitmap,type1rect)
  5930. else
  5931. overlay.blt(18,272,typebitmap.bitmap,type1rect)
  5932. overlay.blt(88,272,typebitmap.bitmap,type2rect)
  5933. end
  5934. drawMarkings(overlay,70,240,128,20,pokemon.markings)
  5935. pbDrawImagePositions(overlay,imagepos)
  5936. end
  5937. pbDrawTextPositions(overlay,textstrings)
  5938. @sprites["pokemon"].setPokemonBitmap(pokemon)
  5939. end
  5940. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement