- Joined
- Dec 28, 2012
- Messages
- 299
- Reaction score
- 81
- First Language
- English
- Primarily Uses
Turns out it was as simple as I initially thought, I just didn't take everything into consideration. The following will allow both the skill durability cost mod and the actual skill costs to be decimals. I haven't had any issues so far. If you need anything else changed to floats let me know, the only thing left I can think of atm would be max durability.
Code:
class RPG::Weapon def skill_durability_mod(skill_id) if @skill_durability_mod.nil? @skill_durability_mod = [] $data_skills.each do |i| next unless i if @note =~ /<skill[-_ ]?durability[-_ ]?mod[-_ ]?#{i.id.to_s}:\s*(.*)\s*>/i @skill_durability_mod[i.id] = $1.to_f else @skill_durability_mod[i.id] = 0.0 end end end @skill_durability_mod[skill_id] endendclass RPG::Skill def weapon_durability_cost @note =~ /<durability[-_ ]?cost:\s*(.*)\s*>/i ? @durability_cost = $1.to_f : @durability_cost = TH_Instance::Weapon::Default_Durability_Cost.to_f if @durability_cost.nil? @durability_cost endend


