Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Name: Gold Boost from Equipment
- # Author: Kio Kurashi
- # Usage: Credits required. Free for Commercial and non-Commerial.
- # Dependancies: Restricted to RPG Maker VX Ace
- # Instructions: In the note box of the equipment use the tag:
- # <GoldBoost n>
- # Where n is a number between 0 and 100, and is equal to n% more gold.
- ####### DO NOT EDIT BEYOND THIS POINT #######
- module BattleManager
- def self.collectGoldBoost
- multi = 1 + ($game_party.totalgoldboost/100)
- @total = ($game_troop.gold_total*multi).to_i
- end
- def self.gain_gold
- collectGoldBoost
- if $game_troop.gold_total > 0
- text = sprintf(Vocab::ObtainGold, @total)
- $game_message.add('\.' + text)
- $game_party.gain_gold(@total)
- end
- wait_for_message
- end
- end
- class Game_Party
- def totalgoldboost
- @boosttotal = 0.0 #Must be 0.0 for Float.
- $game_party.members.each do |member|
- member.equips.each do |item|
- next unless item.is_a?(RPG::EquipItem)
- @boosttotal += item.goldboost
- end#Slot
- end#Actor
- return @boosttotal
- end#Method
- end
- class RPG::EquipItem
- def goldboost
- return @goldboost unless @goldboost.nil?
- regex = /<goldboost (.*)/i
- @goldboost = self.note =~ regex ? $1.to_i : 0
- return @goldboost
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement