Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Game_Battler < Game_BattlerBase
- MAX_YCTB_VALUE = 100000.0
- def lunatic_yctb_strike_formula
- formulas = []
- formulas = self.current_action.item.yctb_strike
- value = 0
- for formula in formulas
- case formula.upcase
- when /STRIKE VALUE[ ](\d+)/i
- value = -$1.to_i
- when /COMMON RESET/i
- value = 0
- end
- end
- return value
- end
- alias yctbstrike_item_apply item_apply
- def item_apply(user, item)
- yctbstrike_item_apply(user, item)
- @yctb_value+=lunatic_yctb_strike_formula
- end
- end
- module DataManager
- class <<self; alias load_database_yctbstrike load_database; end
- def self.load_database
- load_database_yctbstrike
- load_notetags_yctbstrike
- end
- def self.load_notetags_yctbstrike
- groups = [$data_skills, $data_items]
- for group in groups
- for obj in group
- next if obj.nil?
- obj.load_notetags_yctbstrike
- end
- end
- end
- end
- class RPG::UsableItem < RPG::BaseItem
- attr_accessor :yctb_strike
- def load_notetags_yctbstrike
- @yctb_strike = []
- @yctb_strike_on = false
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when /<(?:CUSTOM_YCTB_STRIKE|custom yctb strike):[ ](.*)>/i
- @yctb_strike.push($1.to_s)
- when /<(?:CUSTOM_YCTB_STRIKE|custom yctb strike)>/i
- @yctb_strike_on = true
- when /<\/(?:CUSTOM_YCTB_STRIKE|custom yctb strike)>/i
- @yctb_strike_on = false
- else
- @yctb_strike.push(line.to_s) if @yctb_strike_on
- end
- }
- @yctb_strike.push("COMMON RESET") if @yctb_strike == []
- end
- end
Add Comment
Please, Sign In to add comment