Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.44 KB | None | 0 0
  1. # Scene_TechTree Setup
  2. # goes anywhere in the setup section, no dependences
  3.  
  4. # items marked ** need input/attention
  5.  
  6. module TechTree
  7.  
  8. BASE_FILENAME = "techtree2.png" # **
  9. # name of base fullscreen image
  10. # goes in graphics/system
  11.  
  12. LOCK_FILENAME = "techtreelock.png" # **
  13. # name of image file for the "lock" image
  14.  
  15. XP_BAR_FULL_FILENAME = "techtreexp.png" # **
  16. # name of the image file for the seperate, full version of the righthand xp bar
  17. # this will be overlayed on top of the base image
  18.  
  19. XP_BAR_FULL_X = 630 # **
  20. XP_BAR_FULL_Y = 86 # **
  21. # the x and y coordinates of the upper left hand corner of where the xp bar starts
  22.  
  23.  
  24. ALLOW_LOCK_CURSOR = true
  25. # allow cursor to move onto a locked item
  26.  
  27. HELP_WINDOW_LINES = 3
  28. HELP_WINDOW_X = 0
  29. HELP_WINDOW_Y = 384
  30. HELP_WINDOW_SHOW_WINDOWSKIN = false
  31. HELP_WINDOW_SHOW_BACKGROUND = false
  32.  
  33. BUTTON_RECT_WIDTH = 32
  34. BUTTON_RECT_HEIGHT = 32
  35.  
  36. SELECTION_RECT_PADDING = 2
  37. # in pixels
  38. # how far to draw the selection rect outside of the image box, in each direction
  39.  
  40. MOUSE_DETECTION_RECT_PADDING = 2
  41. # in pixels
  42. # this is how far outside the bounding box of the button rect
  43. # in any direction, you can be for the mouse to work
  44.  
  45.  
  46. INDEX_ID_MAP = [
  47. [:r, :r, 46, :l, :r, 47, :l, :r, 48, :l, :r, 49, :l, :r, 50, :l, 51],
  48. [:r, 32, 33, 34, 35, 0, 36, 37, 38, 39, 40, 0, 41, 42, 43, 44, :l],
  49. [16, 17, 18, 19, 20, 0, 21, 22, 23, 24, 25, 0, 26, 27, 28, 29, 30],
  50. [ 1, 2, 3, 4, 5, 0, 6, 7, 8, 9, 10, 0, 11, 12, 13, 14, 15],
  51. ]
  52. # a map of each techid and where it is in the window
  53. # each row should be equal length
  54. # padding can be used
  55. # :l, if encountered while moving up/down, attempts to move the cursor left
  56. # :r, if encountered while moving up/down, attempts to move the cursor right
  57. # 0 if encountered while moving up/down, it will move in the opposide direction
  58. # last moved (to put the cursor back approximately where it was)
  59. # otherwise, these are considered white space and skipped over in the direction
  60. # already being moved
  61. # when a cursor is forced moved, *row* is always preserved if possible
  62.  
  63.  
  64. # the numbers in this map should be matched with the techids themselves
  65. # the numbers themselves are otherwise arbitrary and can be changed
  66. # if this is confusing, pull up the base image side by side with this table
  67. # academy of war is 1-5, there is a 0 representing the space between
  68. # then tactics and command is 6-10, another 0 spacer, and 11-15 is crafts
  69. # this continues each row
  70. # when we get to the top, we have the white spaces, which, if moved into
  71. # attempt to keep the cursor in the same "tree"
  72. # pressing up into the top row moves to the nearest tech
  73. # so the rightmost/leftmost t3 techs will cursor up into the dual capstones
  74. # The capstone for crafts/academy can only be reached while already in the t4 row
  75. # to maintain consistency (to change this, the :l next to the 51 should be an :r)
  76. # you should avoid messing with this unless necessary, we can change
  77. # tech ids here easily if they need to match what is below
  78.  
  79.  
  80. INVERT_WINDOW_INDEXES = true
  81. # if window is inverted, index 0 starts at the bottom
  82. # (we want this, since we want to start on the bottom row and count up)
  83. # if false, index 0 is the upper left of the INDEX_ID_MAP
  84.  
  85. VERTICAL_WRAPAROUND = false
  86. # cursor can go from the bottom of the window to the top by pressing down and vice versa
  87.  
  88. HORIZONTAL_WRAPAROUND = true
  89. # cursor can go from the left edge to the right by pressing left and vice versa
  90.  
  91. TECHS = Hash.new { |h, k| h[k] = Hash.new }
  92.  
  93.  
  94.  
  95. # format is:
  96. # TECHS[id][property] = param
  97. # ** need one of the below
  98. # see above INDEX_ID_MAP to see what concides with which space on the board
  99. # (can be easily changed if need be, they mostly go in order along each row
  100. # starting at the bottom with 31 and 45 skipped to represent the "missing"
  101. # techs in academy and crafts, in case we want to add them)
  102.  
  103.  
  104. TECHS[1][:name] = "Spellweaver" # ** the name of the tech
  105. TECHS[1][:disabled_filename] = "tech_35.png" # ** filename from in graphics/system
  106. # the "greyed out" version of this tech to be overlayed when disabled
  107. TECHS[1][:button_x] = 16 # **the x coordinate of the upper leftmost pixel of the tech icon
  108. TECHS[1][:button_y] = 289 # ** the y coordinate of the upper leftmost pixel of the tech icon
  109. # these are used for mouse detection, image overlay positioning
  110. # and selection cursor positioning
  111. TECHS[1][:help] = "" # ** The help text when this tech is selected
  112. # multiline supported
  113. TECHS[1][:locked_help] = nil # if anything other than nil, this will be displayed
  114. # as the help text when having the cursor on the locked item
  115. # if nil, use the normal help text
  116. TECHS[1][:tier] = 1 # ** tier of the tech, for unlocking and counting purposes
  117. # effects and item linking to come later
  118.  
  119. TECHS[2][:name] = "Magician Academy"
  120. TECHS[2][:disabled_filename] = "tech_36.png"
  121. TECHS[2][:button_x] = 55
  122. TECHS[2][:button_y] = 289
  123. TECHS[2][:help] = ""
  124. TECHS[2][:locked_help] = nil #
  125. TECHS[2][:tier] = 1
  126.  
  127. TECHS[3][:name] = "Army Stables"
  128. TECHS[3][:disabled_filename] = "tech_37.png"
  129. TECHS[3][:button_x] = 94
  130. TECHS[3][:button_y] = 289
  131. TECHS[3][:help] = ""
  132. TECHS[3][:locked_help] = nil #
  133. TECHS[3][:tier] = 1
  134.  
  135. TECHS[4][:name] = "Donarโ€™s Acolytes"
  136. TECHS[4][:disabled_filename] = "tech_38.png"
  137. TECHS[4][:button_x] = 133
  138. TECHS[4][:button_y] = 289
  139. TECHS[4][:help] = ""
  140. TECHS[4][:locked_help] = nil #
  141. TECHS[4][:tier] = 1
  142.  
  143. TECHS[5][:name] = "Battle Medics"
  144. TECHS[5][:disabled_filename] = "tech_39.png"
  145. TECHS[5][:button_x] = 172
  146. TECHS[5][:button_y] = 289
  147. TECHS[5][:help] = ""
  148. TECHS[5][:locked_help] = nil #
  149. TECHS[5][:tier] = 1
  150.  
  151. TECHS[6][:name] = "Mentorship"
  152. TECHS[6][:disabled_filename] = "tech_40.png"
  153. TECHS[6][:button_x] = 231
  154. TECHS[6][:button_y] = 289
  155. TECHS[6][:help] = ""
  156. TECHS[6][:locked_help] = nil #
  157. TECHS[6][:tier] = 1
  158.  
  159. TECHS[7][:name] = "Mixed Unit Tactics"
  160. TECHS[7][:disabled_filename] = "tech_41.png"
  161. TECHS[7][:button_x] = 271
  162. TECHS[7][:button_y] = 289
  163. TECHS[7][:help] = ""
  164. TECHS[7][:locked_help] = nil #
  165. TECHS[7][:tier] = 1
  166.  
  167. TECHS[8][:name] = "Home Defense"
  168. TECHS[8][:disabled_filename] = "tech_42.png"
  169. TECHS[8][:button_x] = 309
  170. TECHS[8][:button_y] = 289
  171. TECHS[8][:help] = ""
  172. TECHS[8][:locked_help] = nil #
  173. TECHS[8][:tier] = 1
  174.  
  175. TECHS[9][:name] = "Conscription"
  176. TECHS[9][:disabled_filename] = "tech_43.png"
  177. TECHS[9][:button_x] = 348
  178. TECHS[9][:button_y] = 289
  179. TECHS[9][:help] = ""
  180. TECHS[9][:locked_help] = nil #
  181. TECHS[9][:tier] = 1
  182.  
  183. TECHS[10][:name] = "Mercenary Envoys"
  184. TECHS[10][:disabled_filename] = "tech_44.png"
  185. TECHS[10][:button_x] = 387
  186. TECHS[10][:button_y] = 289
  187. TECHS[10][:help] = ""
  188. TECHS[10][:locked_help] = nil #
  189. TECHS[10][:tier] = 1
  190.  
  191. TECHS[11][:name] = "Adept Blacksmith"
  192. TECHS[11][:disabled_filename] = "tech_45.png"
  193. TECHS[11][:button_x] = 445
  194. TECHS[11][:button_y] = 289
  195. TECHS[11][:help] = ""
  196. TECHS[11][:locked_help] = nil #
  197. TECHS[11][:tier] = 1
  198.  
  199. TECHS[12][:name] = "Jewelcrafting"
  200. TECHS[12][:disabled_filename] = "tech_46.png"
  201. TECHS[12][:button_x] = 483
  202. TECHS[12][:button_y] = 289
  203. TECHS[12][:help] = ""
  204. TECHS[12][:locked_help] = nil #
  205. TECHS[12][:tier] = 1
  206.  
  207. TECHS[13][:name] = "Iron Smelting"
  208. TECHS[13][:disabled_filename] = "tech_47.png"
  209. TECHS[13][:button_x] = 523
  210. TECHS[13][:button_y] = 289
  211. TECHS[13][:help] = ""
  212. TECHS[13][:locked_help] = nil #
  213. TECHS[13][:tier] = 1
  214.  
  215. TECHS[14][:name] = "Steel Forging"
  216. TECHS[14][:disabled_filename] = "tech_48.png"
  217. TECHS[14][:button_x] = 561
  218. TECHS[14][:button_y] = 289
  219. TECHS[14][:help] = ""
  220. TECHS[14][:locked_help] = nil #
  221. TECHS[14][:tier] = 1
  222.  
  223. TECHS[15][:name] = "Platina Alloys"
  224. TECHS[15][:disabled_filename] = "tech_49.png"
  225. TECHS[15][:button_x] = 600
  226. TECHS[15][:button_y] = 289
  227. TECHS[15][:help] = ""
  228. TECHS[15][:locked_help] = nil #
  229. TECHS[15][:tier] = 1
  230.  
  231. TECHS[16][:name] = "Sunstone Refining"
  232. TECHS[16][:disabled_filename] = "tech_20.png"
  233. TECHS[16][:button_x] = 16
  234. TECHS[16][:button_y] = 205
  235. TECHS[16][:help] = ""
  236. TECHS[16][:locked_help] = nil #
  237. TECHS[16][:tier] = 2
  238.  
  239. TECHS[17][:name] = "War Mages"
  240. TECHS[17][:disabled_filename] = "tech_21.png"
  241. TECHS[17][:button_x] = 55
  242. TECHS[17][:button_y] = 205
  243. TECHS[17][:help] = ""
  244. TECHS[17][:locked_help] = nil #
  245. TECHS[17][:tier] = 2
  246.  
  247. TECHS[18][:name] = "Warhorse Husbandry"
  248. TECHS[18][:disabled_filename] = "tech_22.png"
  249. TECHS[18][:button_x] = 94
  250. TECHS[18][:button_y] = 205
  251. TECHS[18][:help] = ""
  252. TECHS[18][:locked_help] = nil #
  253. TECHS[18][:tier] = 2
  254.  
  255. TECHS[19][:name] = "Sisterhood of Justice"
  256. TECHS[19][:disabled_filename] = "tech_23.png"
  257. TECHS[19][:button_x] = 133
  258. TECHS[19][:button_y] = 205
  259. TECHS[19][:help] = ""
  260. TECHS[19][:locked_help] = nil #
  261. TECHS[19][:tier] = 2
  262.  
  263. TECHS[20][:name] = "Gem Trader"
  264. TECHS[20][:disabled_filename] = "tech_24.png"
  265. TECHS[20][:button_x] = 172
  266. TECHS[20][:button_y] = 205
  267. TECHS[20][:help] = ""
  268. TECHS[20][:locked_help] = nil #
  269. TECHS[20][:tier] = 2
  270.  
  271. TECHS[21][:name] = "Advanced Flanking"
  272. TECHS[21][:disabled_filename] = "tech_25.png"
  273. TECHS[21][:button_x] = 231
  274. TECHS[21][:button_y] = 205
  275. TECHS[21][:help] = ""
  276. TECHS[21][:locked_help] = nil #
  277. TECHS[21][:tier] = 2
  278.  
  279. TECHS[22][:name] = "Swordsmanship"
  280. TECHS[22][:disabled_filename] = "tech_26.png"
  281. TECHS[22][:button_x] = 270
  282. TECHS[22][:button_y] = 205
  283. TECHS[22][:help] = ""
  284. TECHS[22][:locked_help] = nil #
  285. TECHS[22][:tier] = 2
  286.  
  287. TECHS[23][:name] = "Field Strongholds"
  288. TECHS[23][:disabled_filename] = "tech_27.png"
  289. TECHS[23][:button_x] = 309
  290. TECHS[23][:button_y] = 205
  291. TECHS[23][:help] = ""
  292. TECHS[23][:locked_help] = nil #
  293. TECHS[23][:tier] = 2
  294.  
  295. TECHS[24][:name] = "Steel Phalanx"
  296. TECHS[24][:disabled_filename] = "tech_28.png"
  297. TECHS[24][:button_x] = 348
  298. TECHS[24][:button_y] = 205
  299. TECHS[24][:help] = ""
  300. TECHS[24][:locked_help] = nil #
  301. TECHS[24][:tier] = 2
  302.  
  303. TECHS[25][:name] = "Bowmanship"
  304. TECHS[25][:disabled_filename] = "tech_29.png"
  305. TECHS[25][:button_x] = 387
  306. TECHS[25][:button_y] = 205
  307. TECHS[25][:help] = ""
  308. TECHS[25][:locked_help] = nil #
  309. TECHS[25][:tier] = 2
  310.  
  311. TECHS[26][:name] = "Journeyman Blacksmith"
  312. TECHS[26][:disabled_filename] = "tech_30.png"
  313. TECHS[26][:button_x] = 444
  314. TECHS[26][:button_y] = 205
  315. TECHS[26][:help] = ""
  316. TECHS[26][:locked_help] = nil #
  317. TECHS[26][:tier] = 2
  318.  
  319. TECHS[27][:name] = "Augmenteering"
  320. TECHS[27][:disabled_filename] = "tech_31.png"
  321. TECHS[27][:button_x] = 483
  322. TECHS[27][:button_y] = 205
  323. TECHS[27][:help] = ""
  324. TECHS[27][:locked_help] = nil #
  325. TECHS[27][:tier] = 2
  326.  
  327. TECHS[28][:name] = "Advanced Material Science"
  328. TECHS[28][:disabled_filename] = "tech_32.png"
  329. TECHS[28][:button_x] = 522
  330. TECHS[28][:button_y] = 205
  331. TECHS[28][:help] = ""
  332. TECHS[28][:locked_help] = nil #
  333. TECHS[28][:tier] = 2
  334.  
  335. TECHS[29][:name] = "Obsidian Forging"
  336. TECHS[29][:disabled_filename] = "tech_33.png"
  337. TECHS[29][:button_x] = 561
  338. TECHS[29][:button_y] = 205
  339. TECHS[29][:help] = ""
  340. TECHS[29][:locked_help] = nil #
  341. TECHS[29][:tier] = 2
  342.  
  343. TECHS[30][:name] = "Advanced Crossbows"
  344. TECHS[30][:disabled_filename] = "tech_34.png"
  345. TECHS[30][:button_x] = 600
  346. TECHS[30][:button_y] = 205
  347. TECHS[30][:help] = ""
  348. TECHS[30][:locked_help] = nil #
  349. TECHS[30][:tier] = 2
  350.  
  351. TECHS[32][:name] = "Magical Alacrity"
  352. TECHS[32][:disabled_filename] = "tech_7.png"
  353. TECHS[32][:button_x] = 55
  354. TECHS[32][:button_y] = 123
  355. TECHS[32][:help] = ""
  356. TECHS[32][:locked_help] = nil #
  357. TECHS[32][:tier] = 3
  358.  
  359. TECHS[33][:name] = "Fire Affinity"
  360. TECHS[33][:disabled_filename] = "tech_8.png"
  361. TECHS[33][:button_x] = 94
  362. TECHS[33][:button_y] = 123
  363. TECHS[33][:help] = ""
  364. TECHS[33][:locked_help] = nil #
  365. TECHS[33][:tier] = 3
  366.  
  367. TECHS[34][:name] = "Ice Affinity"
  368. TECHS[34][:disabled_filename] = "tech_9.png"
  369. TECHS[34][:button_x] = 133
  370. TECHS[34][:button_y] = 123
  371. TECHS[34][:help] = ""
  372. TECHS[34][:locked_help] = nil #
  373. TECHS[34][:tier] = 3
  374.  
  375. TECHS[35][:name] = "Ice Affinity"
  376. TECHS[35][:disabled_filename] = "tech_10.png"
  377. TECHS[35][:button_x] = 172
  378. TECHS[35][:button_y] = 123
  379. TECHS[35][:help] = ""
  380. TECHS[35][:locked_help] = nil #
  381. TECHS[35][:tier] = 3
  382.  
  383. TECHS[36][:name] = "Mobile Warfare"
  384. TECHS[36][:disabled_filename] = "tech_11.png"
  385. TECHS[36][:button_x] = 231
  386. TECHS[36][:button_y] = 123
  387. TECHS[36][:help] = ""
  388. TECHS[36][:locked_help] = nil #
  389. TECHS[36][:tier] = 3
  390.  
  391. TECHS[37][:name] = "Longsword Mastery"
  392. TECHS[37][:disabled_filename] = "tech_12.png"
  393. TECHS[37][:button_x] = 270
  394. TECHS[37][:button_y] = 123
  395. TECHS[37][:help] = ""
  396. TECHS[37][:locked_help] = nil #
  397. TECHS[37][:tier] = 3
  398.  
  399. TECHS[38][:name] = "Fixed Defenses"
  400. TECHS[38][:disabled_filename] = "tech_13.png"
  401. TECHS[38][:button_x] = 309
  402. TECHS[38][:button_y] = 123
  403. TECHS[38][:help] = ""
  404. TECHS[38][:locked_help] = nil #
  405. TECHS[38][:tier] = 3
  406.  
  407. TECHS[39][:name] = "Professionalism"
  408. TECHS[39][:disabled_filename] = "tech_14.png"
  409. TECHS[39][:button_x] = 348
  410. TECHS[39][:button_y] = 123
  411. TECHS[39][:help] = ""
  412. TECHS[39][:locked_help] = nil #
  413. TECHS[39][:tier] = 3
  414.  
  415. TECHS[40][:name] = "Archer General"
  416. TECHS[40][:disabled_filename] = "tech_15.png"
  417. TECHS[40][:button_x] = 387
  418. TECHS[40][:button_y] = 123
  419. TECHS[40][:help] = ""
  420. TECHS[40][:locked_help] = nil #
  421. TECHS[40][:tier] = 3
  422.  
  423. TECHS[41][:name] = "Master Blacksmith"
  424. TECHS[41][:disabled_filename] = "tech_16.png"
  425. TECHS[41][:button_x] = 444
  426. TECHS[41][:button_y] = 123
  427. TECHS[41][:help] = ""
  428. TECHS[41][:locked_help] = nil #
  429. TECHS[41][:tier] = 3
  430.  
  431. TECHS[42][:name] = "Grapeshot"
  432. TECHS[42][:disabled_filename] = "tech_17.png"
  433. TECHS[42][:button_x] = 483
  434. TECHS[42][:button_y] = 123
  435. TECHS[42][:help] = ""
  436. TECHS[42][:locked_help] = nil #
  437. TECHS[42][:tier] = 3
  438.  
  439. TECHS[43][:name] = "Rifled Artillery"
  440. TECHS[43][:disabled_filename] = "tech_18.png"
  441. TECHS[43][:button_x] = 522
  442. TECHS[43][:button_y] = 123
  443. TECHS[43][:help] = ""
  444. TECHS[43][:locked_help] = nil #
  445. TECHS[43][:tier] = 3
  446.  
  447. TECHS[44][:name] = "Breech-Loading Gun"
  448. TECHS[44][:disabled_filename] = "tech_19.png"
  449. TECHS[44][:button_x] = 561
  450. TECHS[44][:button_y] = 123
  451. TECHS[44][:help] = ""
  452. TECHS[44][:locked_help] = nil #
  453. TECHS[44][:tier] = 3
  454.  
  455. TECHS[46][:name] = "Mage Regiments"
  456. TECHS[46][:disabled_filename] = "tech_1.png"
  457. TECHS[46][:button_x] = 94
  458. TECHS[46][:button_y] = 41
  459. TECHS[46][:help] = ""
  460. TECHS[46][:locked_help] = nil #
  461. TECHS[46][:tier] = 4
  462.  
  463. TECHS[47][:name] = "Dragon Bond"
  464. TECHS[47][:disabled_filename] = "tech_2.png"
  465. TECHS[47][:button_x] = 201
  466. TECHS[47][:button_y] = 26
  467. TECHS[47][:help] = ""
  468. TECHS[47][:locked_help] = nil #
  469. TECHS[47][:tier] = 4
  470.  
  471. TECHS[48][:name] = "Grand Army"
  472. TECHS[48][:disabled_filename] = "tech_3.png"
  473. TECHS[48][:button_x] = 309
  474. TECHS[48][:button_y] = 41
  475. TECHS[48][:help] = ""
  476. TECHS[48][:locked_help] = nil #
  477. TECHS[48][:tier] = 4
  478.  
  479. TECHS[49][:name] = "Musketeering"
  480. TECHS[49][:disabled_filename] = "tech_4.png"
  481. TECHS[49][:button_x] = 415
  482. TECHS[49][:button_y] = 26
  483. TECHS[49][:help] = ""
  484. TECHS[49][:locked_help] = nil #
  485. TECHS[49][:tier] = 4
  486.  
  487. TECHS[50][:name] = "Grandmaster Artificer"
  488. TECHS[50][:disabled_filename] = "tech_5.png"
  489. TECHS[50][:button_x] = 522
  490. TECHS[50][:button_y] = 41
  491. TECHS[50][:help] = ""
  492. TECHS[50][:locked_help] = nil #
  493. TECHS[50][:tier] = 4
  494.  
  495. TECHS[51][:name] = "Arcane Forge"
  496. TECHS[51][:disabled_filename] = "tech_6.png"
  497. TECHS[51][:button_x] = 604
  498. TECHS[51][:button_y] = 41
  499. TECHS[51][:help] = ""
  500. TECHS[51][:locked_help] = nil #
  501. TECHS[51][:tier] = 4
  502.  
  503. end
  504.  
  505. # don't touch beyond here
  506.  
  507. class Scene_TechTree < Scene_Base
  508. include TechTree
  509.  
  510.  
  511. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement