Owl_attributeClass

by Tafe
Be gone old stat structures! This is something i think people should look into!
ID:2366870
 
New functions for the new beta build 512+

There are functions that needs to be added to support the new functionality of DM from the latest beta updates. The main functions added is local methods within the class "attribute", which you can call by calling attrubute/proc().

list of added functions
attribute/proc
//get
name()
value()
limit()
level()
xp()
xp_next()
limit_gain_rate()
xp_gain_rate()

//set
setName(text)
setValue(number)
setLimit(number)
setLevel(number)
setXp(number)
setXp_next(number)
setLimit_gain_rate(number)
setXp_gain_rate(number)


The update enable you to skip overhead procedures from within the scope of "mob", that calls from a specific list, but now you can access the memory within a list itself and call the proc from that.

before:
mob
proc
get_attribute_value(attr)
var/attribute/A = stats && stats[attr]
// print(world.log, "[src].get_attribute_value([attr])")
return A ? A.value : 0


now:
mob
proc
get_attribute_value(attr)
listcontainingtheattribute[attr].value()
//or
//skip the whole proc and access the value where you need
var/value = listcontainingtheattribute[attribute].value()