Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.42 KB | None | 0 0
  1. # ==============================================================================
  2. # richter_h's Smithing -- Simply Upgrade Your Weapon
  3. # v1.0 - June 5, 2013
  4. # Type: Actor Customization, Equipments
  5. # Level: Medium
  6. # ==============================================================================
  7. # Ever played Suikoden? That game has some blacksmithes that provide weapon
  8. # upgrades and some enchantments, making your fights would be easier than
  9. # using a simple stick to the brawl.
  10. # And based on that reason, I made this script.
  11. #
  12. # Here in this rather-simple-to-use script, you can add a simple upgrade
  13. # path for every assigned weapon below. Also, you can:
  14. # -> Add parameter in every weapon's level. So you can add some ATKs in
  15. # first levels, then add it more PLUS some SPI. Just for your pleasure.
  16. # -> Change your favorite weapon's name from simple "Longsword" into
  17. # "Longersword", "Cloudcleaver", or "Titan's Toothpick" or even
  18. # "Sword of the Dark Flame Master"? No problem.
  19. # You can set weapon's name in every level as you want.
  20. # -> Changing only the name won't impress you? You can change the icon
  21. # of the weapon as you desire. Just put the certain number and you'll
  22. # have a totally-epic-looking sword's icon once you upgrade them.
  23. # And for you Enu SBS a.k.a. Tankentai user, you'll be rejoiced by this,
  24. # if you know what I mean.
  25. # -> Not only the name, the description of assigned weapon can be changed
  26. # and whatever the "Longsword"'s description when upgraded is at your
  27. # hand.
  28. # -> The blacksmith can has lines to speak! It's highly customizable
  29. # as you want, however, only one kind of quote lines could be added;
  30. # A generic quote would work.
  31. #
  32. # There is another feature that I leave it behind for now. The 'Socket'ing
  33. # feature is in development. In different of your daily 'socket'ing and
  34. # all things 'socket'ery, I planned to just implying the feature brought
  35. # from the first Suikoden series; single-slot socketable in every weapon
  36. # that every Fragment socketed into it could be removed. For now, let's
  37. # don't talk about that 'socket'ery, kay? :D
  38. #
  39. # How to use this script?
  40. # Simply put this below Material and above Main in Script Editor. Don't ask me
  41. # how to put scripts on. Ask other for assistance.
  42. # (implying whoever has a use of this knows how to put scripts in Script Editor)
  43. #
  44. # Credits if you wanna. Don't claim as your own.
  45. # Also credit maximusPrime, since I worked this script based on his.
  46. #
  47. # Oh, don't forget to say a mention to Konami, since they'd made the
  48. # well-made traditional RPG back in 90s. (Not to mention that I only regard
  49. # those first two series, though.)
  50. # ==============================================================================
  51. # New Scene:
  52. # - Scene_Smith
  53. # New Windows:
  54. # - Window_SmithList
  55. # - Window_SmithList_Detail
  56. # Aliased:
  57. # - Scene_Title: load_database
  58. # Altered:
  59. # - RPG::Weapon
  60. # new methods: add_levels, get_next_cost, get_next_weapon, clone_data
  61. # new attributes: level, cost, upgrade_balance, next_weapon_id
  62. # ==============================================================================
  63.  
  64. # ==============================================================================
  65. # This is just to make sure the script is recognized in system.
  66. # A "scripter"'s stuff.
  67. # ==============================================================================
  68. $imported = {} if $imported == nil
  69. $imported["richter_h's Smithing"] = true
  70.  
  71. module Smithery
  72. # ============================================================================
  73. # So if you planned to set base price and inflation costs in every upgrades,
  74. # change those numbers below. Their name are self-explanatory.
  75. # ============================================================================
  76. module Pricing
  77. Base_Upgrade_Price = 10
  78. Inflation_Price = 2
  79. end
  80.  
  81. # ============================================================================
  82. # These variables are for some SEs when the upgrading is in progress.
  83. # A simple cosmetic, based on what the Suikoden's blacksmithes ever do.
  84. # ============================================================================
  85. SMITH_SE = RPG::SE.new("Sword1", 80, 100)
  86. SMITH_DONE_SE = RPG::SE.new("Sword2", 80, 100)
  87.  
  88.  
  89. # ============================================================================
  90. # Here's the main course of this script.
  91. # You can see what's happened below. Those lines are what I called the
  92. # 'upgrade tree.'
  93. # You must follow the rules of adding the tree to make sure the script will
  94. # work. Ready to follow the instruction? Here we go.
  95. # ============================================================================
  96. Upgrade_Table = {
  97.  
  98. 1 => [ [{:atk => 8, :agi => 2, :spi => 1}, -1, "Heavy Club",
  99. "Upgraded version of your daily clubs."],
  100. [{:atk => 2, :agi => 1, :spi => 4}, -1, "", ""],
  101. [{:atk => 10, :agi => 2, :spi => 0}, 15, "Flail",
  102. "Your everyday clubs won't be as cool as this!"],
  103. ],
  104.  
  105. 2 => [
  106. [{:atk => 3 }, -1, "", ""],
  107. [{:atk => 3 }, 2, "Longsword",
  108. "As described on the sword's label..."],
  109. [{:atk => 5 }, 2, "Bastard Sword",
  110. "Not to mention whoever wield this sword is bastard..."],
  111. [{:atk => 3, :agi => 5 }, -1, "", ""],
  112. [{:atk => 10, :agi => 10, :def => 10, :spi => 10 }, 26,
  113. "Sword of Dark Flame Master",
  114. "Once wielded by a boy who claims himself as the sword says."],
  115. ],
  116. 3 => [
  117. [{:atk => 3 }, -1, "", ""],
  118. [{:atk => 3 }, -1, "", ""],
  119. [{:atk => 3 }, -1, "", ""],
  120. ],
  121. 4 => [
  122. [{:spi => 3 }, -1, "", ""],
  123. [{:spi => 3 }, -1, "", ""],
  124. [{:spi => 3 }, -1, "", ""],
  125. ],
  126.  
  127. }
  128.  
  129. # ============================================================================
  130. # And here, for the joyment of smithing.
  131. # These lines are quotes for some of choice that would be made when accessing
  132. # a blacksmith.
  133. # Figure it out once if you want to change it.
  134. # ========================================================================
  135. module Smith_Quote
  136. Decide_service = "What can I do for you?"
  137. Select_weapon = "Whose weapon will be upgraded?"
  138. Decide_weapon = "Upgrade this weapon?"
  139. Upgrade_complete = "It's done."
  140. Refuse_upgrade = "Not enough money to upgrade."
  141. end
  142.  
  143. # ==============================================================================
  144. # Touching anything below is not good for our Dark Flame Master himself and
  145. # even for our drunken brawler Vent McGraves.
  146. # For whatever reason, don't change everything below unless you know what
  147. # you're doing below there.
  148. # ==============================================================================
  149.  
  150. module Weapon_Table
  151.  
  152. def self.set_class_weaponset(ori, adder)
  153. for data in $data_classes
  154. if(data != nil && data.weapon_set.include?(ori))
  155. data.weapon_set.push(adder)
  156. end
  157. end
  158. end
  159.  
  160. def self.initialize_weapons
  161. ori_weapon_table = []
  162. $data_weapons.each do |i|
  163. if i.nil?
  164. ori_weapon_table.push(i)
  165. else
  166. ori_weapon_table.push(i.clone_data)
  167. end
  168. end
  169.  
  170. temp_table2 = {}
  171. for item in Upgrade_Table
  172. next_weapon = nil
  173. temp_table = []
  174. for wep_lv in 0..item[1].size - 1
  175. prop = item[1][wep_lv]
  176. if(next_weapon == nil)
  177. next_weapon = ori_weapon_table[item[0]].clone_data
  178. next_weapon.next_weapon_id = item[1].size
  179. next_weapon.level = 1
  180. end
  181. if prop[0] != {}
  182. prop[0].each do |stat|
  183. case stat[0]
  184. when :atk, :str
  185. next_weapon.atk += stat[1]
  186. when :agi
  187. next_weapon.agi += stat[1]
  188. when :spi, :int
  189. next_weapon.spi += stat[1]
  190. when :def
  191. next_weapon.def += stat[1]
  192. end
  193. end
  194. end
  195. if prop[1] != -1
  196. next_weapon.icon_index = prop[1]
  197. end
  198. if prop[2] != ""
  199. next_weapon.name = prop[2]
  200. end
  201. if prop[3] != ""
  202. next_weapon.description = prop[3]
  203. end
  204. next_weapon.cost = next_weapon.get_next_cost(next_weapon)
  205. next_weapon.next_weapon_id -= 1
  206. next_weapon.level += 1
  207. temp_table.push(next_weapon.clone_data)
  208. end
  209. temp_table2[item[0]] = []
  210. for i in 0..temp_table.size - 1
  211. temp_table2[item[0]].push(temp_table[i])
  212. end
  213. end
  214. preprocess = []
  215. reprocess = []
  216. ori_weapon_table.each do |i|
  217. if i != nil
  218. i.add_levels
  219. end
  220. if temp_table2.has_key?(i.id)
  221. preprocess.push(nil)
  222. reprocess.push(i)
  223. else
  224. preprocess.push(i)
  225. end
  226. end
  227. reprocess.each do |i|
  228. next if i.nil?
  229. maxUpgrade = temp_table2[i.id].size
  230. currentSize = preprocess.size
  231. oriNextUpgrade = 0
  232. temp_table2[i.id].each do |z|
  233. actualCurrentID = preprocess.size
  234. if(z.next_weapon_id > 0)
  235. z.next_weapon_id = currentSize + (maxUpgrade - z.next_weapon_id)
  236. end
  237. z.id = actualCurrentID
  238. if(oriNextUpgrade == 0)
  239. oriNextUpgrade = z.id
  240. end
  241. preprocess.push(z.clone_data)
  242. set_class_weaponset(i.id, z.id)
  243. end
  244. i.next_weapon_id = oriNextUpgrade
  245. preprocess[i.id] = i.clone_data
  246. end
  247. reprocess.clear
  248. reprocess = nil
  249. $data_weapons = preprocess
  250. preprocess = nil
  251. temp_table2 = nil
  252. temp_table = nil
  253. end
  254. end
  255. end
  256.  
  257. module RPG
  258. class Weapon < BaseItem
  259. include Smithery::Pricing
  260.  
  261. attr_accessor :level
  262. attr_accessor :cost
  263. attr_accessor :upgrade_balance
  264. attr_accessor :next_weapon_id
  265. attr_accessor :socket
  266.  
  267. def add_levels
  268. @level = 1
  269. @cost = Base_Upgrade_Price
  270. @upgrade_balance = Inflation_Price
  271. @next_weapon_id = 0
  272. @socket = []
  273. end
  274.  
  275. def get_next_cost(weapon)
  276. if(weapon.level == nil)
  277. @level = 2
  278. end
  279. @cost = ((Base_Upgrade_Price+Inflation_Price)*@level)
  280. return @cost
  281. end
  282.  
  283. def get_next_weapon
  284. return $data_weapons[@next_weapon_id]
  285. end
  286.  
  287. def upgrade_cost
  288. return Base_Upgrade_Price if @cost.nil?
  289. return @cost + ((Base_Upgrade_Price+Inflation_Price)*@level)
  290. end
  291.  
  292. def clone_data
  293. originalData = self
  294. if(originalData.is_a?(RPG::Weapon))
  295. clonedData = RPG::Weapon.new
  296. clonedData.id = originalData.id
  297. clonedData.name = originalData.name
  298. clonedData.icon_index = originalData.icon_index
  299. clonedData.description = originalData.description
  300. clonedData.note = originalData.note
  301. clonedData.animation_id = originalData.animation_id
  302. clonedData.price = originalData.price
  303. clonedData.hit = originalData.hit
  304. clonedData.atk = originalData.atk
  305. clonedData.def = originalData.def
  306. clonedData.spi = originalData.spi
  307. clonedData.agi = originalData.agi
  308. clonedData.two_handed = originalData.two_handed
  309. clonedData.fast_attack = originalData.fast_attack
  310. clonedData.dual_attack = originalData.dual_attack
  311. clonedData.critical_bonus = originalData.critical_bonus
  312. clonedData.element_set = originalData.element_set.clone
  313. clonedData.state_set = originalData.state_set.clone
  314. clonedData.level = originalData.level
  315. clonedData.cost = originalData.cost
  316. clonedData.upgrade_balance = originalData.upgrade_balance
  317. clonedData.next_weapon_id = originalData.next_weapon_id
  318. clonedData.socket = originalData.socket
  319. return clonedData
  320. end
  321. return nil
  322. end
  323. end
  324. end
  325.  
  326. class Scene_Title < Scene_Base
  327. alias load_database_smithery load_database
  328. def load_database
  329. load_database_smithery
  330. Smithery::Weapon_Table.initialize_weapons
  331. end
  332. end
  333.  
  334. class Window_SmithList < Window_Selectable
  335. def initialize(x,y,w,h)
  336. super(x,y,w,h)
  337. @column_max = 1
  338. self.index = 0
  339. self.back_opacity = 192
  340. refresh
  341. end
  342.  
  343. def item
  344. return @data[self.index]
  345. end
  346.  
  347. def include?(item)
  348. return false if item == nil
  349. return true
  350. end
  351.  
  352. def enable?(item)
  353. if(item.next_weapon_id > 0 &&
  354. $game_party.gold >= item.upgrade_cost)
  355. return true
  356. end
  357. return false
  358. end
  359.  
  360. def refresh
  361. @data = []
  362. for member in $game_party.members
  363. @data.push(member)
  364. end
  365. @data.push(nil) if include?(nil)
  366. @item_max = @data.size
  367. create_contents
  368. for i in 0...@item_max
  369. draw_item(i)
  370. end
  371. end
  372.  
  373. def draw_item(index)
  374. rect = item_rect(index)
  375. self.contents.clear_rect(rect)
  376. item = @data[index]
  377. if item != nil
  378. enabled = enable?(item.equips[0])
  379. rect.width -= 4
  380. self.contents.font.color.alpha = enabled ? 255 : 128
  381. self.contents.draw_text(rect, item.name)
  382. end
  383. end
  384. end
  385.  
  386. class Window_SmithList_Detail < Window_Base
  387. def initialize(x,y,w,h,member)
  388. super(x,y,w,h)
  389. refresh(member)
  390. end
  391.  
  392. def refresh(actor)
  393. create_contents
  394. weapon = actor.equips[0]
  395. self.contents.font.color = normal_color
  396. self.contents.font.size = 22
  397. dY = 0
  398. dWidth = self.width - 20
  399. pad = 40
  400. draw_item_name(weapon, 0, 0, true)
  401. dY += 30
  402. self.contents.font.size = 18
  403. self.contents.font.bold = false
  404. self.contents.fill_rect(0, dY, dWidth, 2, normal_color)
  405. if(weapon.next_weapon_id > 0)
  406. dY += 4
  407. self.contents.draw_text(0, dY, dWidth-16, self.contents.font.size,
  408. "Cost: " + weapon.upgrade_cost.to_s, 0)
  409. self.contents.font.color = crisis_color
  410. self.contents.draw_text(0, dY, dWidth-16, self.contents.font.size,
  411. "Upgradeable", 2)
  412. self.contents.font.bold = true
  413. self.contents.draw_text(0, dY + self.contents.font.size + 4, dWidth-16, self.contents.font.size,
  414. "Lv." + weapon.level.to_s, 2)
  415. self.contents.font.bold = false
  416. self.contents.font.color = normal_color
  417. if weapon.get_next_weapon.atk - weapon.atk > 0 and (weapon.next_weapon_id > 0)
  418. dY += self.contents.font.size + 4
  419. self.contents.font.size = 20
  420. self.contents.font.color = system_color
  421. self.contents.draw_text(0, dY, pad, self.contents.font.size,
  422. Vocab.atk)
  423. self.contents.font.color = normal_color
  424. self.contents.draw_text(pad, dY, dWidth - pad, self.contents.font.size,
  425. ": " + weapon.atk.to_s + " > " + weapon.get_next_weapon.atk.to_s)
  426. end
  427. if weapon.get_next_weapon.agi - weapon.agi > 0 and (weapon.next_weapon_id > 0)
  428. dY += self.contents.font.size + 4
  429. self.contents.font.size = 20
  430. self.contents.font.color = system_color
  431. self.contents.draw_text(0, dY, pad, self.contents.font.size,
  432. Vocab.agi)
  433. self.contents.font.color = normal_color
  434. self.contents.draw_text(pad, dY, dWidth - pad, self.contents.font.size,
  435. ": " + weapon.agi.to_s + " > " + weapon.get_next_weapon.agi.to_s)
  436. end
  437. if weapon.get_next_weapon.spi - weapon.spi > 0 and (weapon.next_weapon_id > 0)
  438. dY += self.contents.font.size + 4
  439. self.contents.font.size = 20
  440. self.contents.font.color = system_color
  441. self.contents.draw_text(0, dY, pad, self.contents.font.size,
  442. Vocab.spi)
  443. self.contents.font.color = normal_color
  444. self.contents.draw_text(pad, dY, dWidth - pad, self.contents.font.size,
  445. ": " + weapon.spi.to_s + " > " + weapon.get_next_weapon.spi.to_s)
  446. end
  447. if weapon.get_next_weapon.def - weapon.def > 0 and (weapon.next_weapon_id > 0)
  448. dY += self.contents.font.size + 4
  449. self.contents.font.size = 20
  450. self.contents.font.color = system_color
  451. self.contents.draw_text(0, dY, pad, self.contents.font.size,
  452. Vocab.def)
  453. self.contents.font.color = normal_color
  454. self.contents.draw_text(pad, dY, dWidth - pad, self.contents.font.size,
  455. ": " + weapon.def.to_s + " > " + weapon.get_next_weapon.def.to_s)
  456. end
  457. else
  458. dY += 4
  459. self.contents.font.color = crisis_color
  460. self.contents.font.bold = true
  461. self.contents.draw_text(0, dY, dWidth-16, self.contents.font.size,
  462. "Lv." + weapon.level.to_s, 2)
  463. self.contents.font.color = normal_color
  464. self.contents.font.bold = false
  465. self.contents.draw_text(0, dY, dWidth-16, self.contents.font.size,
  466. "Maxed Out", 0)
  467. end
  468. end
  469. end
  470.  
  471. class Window_Notification < Window_Base
  472. def initialize
  473. super(0, 0, 400, WLH*2 + 32)
  474. self.back_opacity = 255
  475. end
  476. def set_text(text, weapon=nil, align = 0)
  477. text2 = ""
  478. if weapon != nil
  479. weapon2 = weapon.get_next_weapon
  480. text = "The weapon turned into " + weapon2.name if weapon.name != weapon2.name
  481. text2 += Vocab.atk + " +" + (weapon2.atk - weapon.atk).to_s + " " if weapon2.atk > weapon.atk
  482. text2 += Vocab.spi + " +" + (weapon2.spi - weapon.spi).to_s + " " if weapon2.spi > weapon.spi
  483. text2 += Vocab.agi + " +" + (weapon2.agi - weapon.agi).to_s + " " if weapon2.agi > weapon.agi
  484. text2 += Vocab.def + " +" + (weapon2.def - weapon.def).to_s + " " if weapon2.def > weapon.def
  485. end
  486. if text != @text or align != @align
  487. self.contents.clear
  488. self.contents.font.color = normal_color
  489. self.contents.draw_text(4, 0, self.width - 40, WLH, text, align)
  490. if text2 != ""
  491. self.contents.font.color = text_color(4)
  492. self.contents.draw_text(4, WLH, self.width - 40, WLH, text2, align)
  493. end
  494. @text = text
  495. @align = align
  496. end
  497. end
  498. end
  499.  
  500.  
  501. class Scene_Smith < Scene_Base
  502. #--------------------------------------------------------------------------
  503. # * Start processing
  504. #--------------------------------------------------------------------------
  505. def start
  506. super
  507. create_menu_background
  508. @viewport = Viewport.new(0, 0, 544, 416)
  509. @gold_window = Window_Gold.new(384, 56)
  510. @help_window = Window_Help.new
  511. @help_window.viewport = @viewport
  512. create_notification_window
  513. create_party_list_window
  514. create_detail_window
  515. create_choice_box
  516. create_confirmation_box
  517. @choice_box.active = true
  518. arrange_windows
  519. smith_quote_list("Decide service")
  520. end
  521.  
  522. def create_notification_window
  523. @notification_window = Window_Notification.new
  524. @notification_window.x = Graphics.width/2 - @notification_window.width/2
  525. @notification_window.y = Graphics.height/2 - @notification_window.height/2
  526. @notification_window.visible = false
  527. @notification_window.z = 200
  528. end
  529.  
  530. def create_choice_box
  531. #~ s1 = "Sharpen"
  532. #~ s2 = "Fragment Socket"
  533. #~ s3 = "Exit"
  534. #~ @choice_box = Window_Command.new(160, [s1, s2, s3])
  535. menu = []
  536. menu.push("Sharpen")
  537. menu.push("Socket")
  538. menu.push("Exit")
  539. @choice_box = Window_Command.new(384, menu, menu.length, 1)
  540. @choice_box.index = 0
  541. @choice_box.viewport = @viewport
  542. end
  543.  
  544. def create_party_list_window
  545. @list_window = Window_SmithList.new(0, 56, 128,
  546. ($game_party.members.size*24)+32)
  547. @list_window.viewport = @viewport
  548. @list_window.visible = false
  549. end
  550.  
  551. def create_detail_window
  552. @smith_detail_window = Window_SmithList_Detail.new(0,0,256,180,
  553. $game_party.members[@list_window.index])
  554. @smith_detail_window.viewport = @viewport
  555. @smith_detail_window.visible = false
  556. end
  557.  
  558. def create_confirmation_box
  559. s1 = "Yes"
  560. s2 = "No"
  561. @confirmation_box = Window_Command.new(80, [s1, s2])
  562. @confirmation_box.visible = false
  563. end
  564.  
  565. def arrange_windows
  566. @choice_box.y = @help_window.height
  567. @list_window.y = @choice_box.y + @choice_box.height
  568. @smith_detail_window.x = @list_window.width
  569. @smith_detail_window.y = @gold_window.y + @gold_window.height
  570. @confirmation_box.x = @smith_detail_window.x + @smith_detail_window.width - @confirmation_box.width
  571. @confirmation_box.y = @smith_detail_window.y + @smith_detail_window.height - @confirmation_box.height
  572. end
  573.  
  574. def terminate
  575. super
  576. dispose_menu_background
  577. @viewport.dispose
  578. @gold_window.dispose
  579. @help_window.dispose
  580. @list_window.dispose
  581. @smith_detail_window.dispose
  582. @choice_box.dispose
  583. @confirmation_box.dispose
  584. end
  585.  
  586. def refresh
  587. @choice_box.refresh
  588. @list_window.refresh
  589. if(@current_item != nil)
  590. @smith_detail_window.refresh(@current_item)
  591. end
  592. end
  593.  
  594. def return_scene
  595. $scene = Scene_Map.new
  596. end
  597.  
  598. def update
  599. super
  600. update_menu_background
  601. @gold_window.update
  602. @help_window.update
  603. if @choice_box.active
  604. update_choice_box
  605. elsif @list_window.active
  606. update_smithing_window
  607. elsif @confirmation_box.active
  608. @confirmation_box.update
  609. update_confirmation_box
  610. end
  611. end
  612.  
  613. def update_choice_box
  614. @choice_box.update
  615. if Input.trigger?(Input::C)
  616. case @choice_box.index
  617. when 0
  618. Sound.play_decision
  619. smith_quote_list("Choose weapon")
  620. select_party
  621. when 1
  622. Sound.play_buzzer
  623. @notification_window.visible = true
  624. @notification_window.set_text("Socketing isn't available for now.")
  625. smith_quote_list("Socketing weapon")
  626. for i in 0...150
  627. Graphics.update
  628. end
  629. @notification_window.visible = false
  630. smith_quote_list("Decide service")
  631. when 2
  632. Sound.play_cancel
  633. return_scene
  634. end
  635. elsif Input.trigger?(Input::B)
  636. Sound.play_cancel
  637. return_scene
  638. end
  639. end
  640.  
  641. def update_confirmation_box
  642. if Input.trigger?(Input::C)
  643. case @confirmation_box.index
  644. when 0
  645. Sound.play_decision
  646. itema = @list_window.item
  647. weapon = itema.equips[0]
  648. wait_for_smithing(weapon)
  649. $game_party.lose_gold(weapon.upgrade_cost)
  650. $game_party.gain_item(weapon.get_next_weapon.clone_data, 1)
  651. $game_party.members[@list_window.index].change_equip(0, weapon.get_next_weapon.clone_data)
  652. $game_party.lose_item(weapon, 1)
  653. @gold_window.refresh
  654. confirm
  655. when 1
  656. Sound.play_cancel
  657. confirm
  658. smith_quote_list("Choose weapon")
  659. end
  660. elsif Input.trigger?(Input::B)
  661. Sound.play_cancel
  662. confirm
  663. smith_quote_list("Choose weapon")
  664. end
  665. end
  666.  
  667. def update_smithing_window
  668. @list_window.update
  669. @smith_detail_window.update
  670. item = @list_window.item
  671. weapon = item.equips[0]
  672. if(@current_item != item)
  673. @current_item = item
  674. @smith_detail_window.refresh(@current_item)
  675. end
  676. if Input.trigger?(Input::B)
  677. Sound.play_cancel
  678. hide_party
  679. smith_quote_list("Decide service")
  680. elsif Input.trigger?(Input::C)
  681. if(weapon != nil &&
  682. weapon.next_weapon_id > 0 && weapon.get_next_weapon != nil &&
  683. $game_party.gold >= weapon.upgrade_cost)
  684. Sound.play_decision
  685. smith_quote_list("Decide weapon")
  686. confirmation
  687. end
  688. end
  689. end
  690.  
  691. def wait_for_smithing(weapon)
  692. for i in 0...300
  693. Graphics.update
  694. Smithery::SMITH_SE.play if i%60 == 0 and i < 150
  695. if i == 180
  696. Smithery::SMITH_DONE_SE.play
  697. @notification_window.visible = true
  698. @notification_window.set_text("Weapon improved.", weapon)
  699. smith_quote_list("Upgrade complete")
  700. end
  701. end
  702. @notification_window.visible = false
  703. smith_quote_list("Choose weapon")
  704. end
  705.  
  706. def confirmation
  707. @confirmation_box.active = true
  708. @confirmation_box.visible = true
  709. @list_window.active = false
  710. end
  711.  
  712. def confirm
  713. @confirmation_box.active = false
  714. @confirmation_box.visible = false
  715. @list_window.active = true
  716. refresh
  717. end
  718.  
  719. def select_party
  720. refresh
  721. @choice_box.active = false
  722. @list_window.active = true
  723. @list_window.visible = true
  724. @smith_detail_window.active = true
  725. @smith_detail_window.visible = true
  726. end
  727.  
  728. def hide_party
  729. @choice_box.active = true
  730. @list_window.active = false
  731. @list_window.visible = false
  732. @smith_detail_window.active = false
  733. @smith_detail_window.visible = false
  734. refresh
  735. end
  736.  
  737. def smith_quote_list(response = "")
  738. case response
  739. when "Decide service"
  740. @help_window.set_text(Smithery::Smith_Quote::Decide_service)
  741. when "Choose weapon"
  742. @help_window.set_text(Smithery::Smith_Quote::Select_weapon)
  743. when "Decide weapon"
  744. @help_window.set_text(Smithery::Smith_Quote::Decide_weapon)
  745. when "Upgrade complete"
  746. @help_window.set_text(Smithery::Smith_Quote::Upgrade_complete)
  747. when "Not enough money"
  748. @help_window.set_text(Smithery::Smith_Quote::Refuse_upgrade)
  749. when "Socketing weapon"
  750. @help_window.set_text("Maybe not now, mate.")
  751. end
  752. end
  753. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement