So, say that I would want create a new stat called "Dark" for the character, which governs their affinity towards dark magic. (As opposed to using their INT score)
Here's what I ended up with
CODE
module Dark
Start = {1=>400}
Start.default = 100
def self.get(actor)
n = Start[actor.id]
return n
end
end
I then declare the variable
CODE
attr_reader :dark #darkness stat
then, in the setup area, I plug in this code
CODE
@dark = dark
def dark
return Dark.get(self)
end
now, this works all fine and dandy if I'm just making one new stat and that's it, but I'm making easily over two dozen new stats for the characters, not to mention the number of new stats I'm going to have to make for the monsters. I'm wondering if maybe there's a more efficient way to go about this.
i.e. there is a "get" method in every new stat module. Can I simply define this once elsewhere, and let that be it?