22 lines
609 B
Plaintext
22 lines
609 B
Plaintext
|
//exit;
|
||
|
global.stats = {}
|
||
|
function stat(name_, fullname_, desc_, replacements_=[]) constructor {
|
||
|
name = name_
|
||
|
fullname = fullname_;
|
||
|
desc = desc_;
|
||
|
replacements = replacements_;
|
||
|
global.stats[$name] = self;
|
||
|
add = function(val) {
|
||
|
return new unitstat(val, name, fullname, desc, replacements)
|
||
|
}
|
||
|
}
|
||
|
#macro st global.stats
|
||
|
|
||
|
function unitstat(val, name_, fullname_, desc_, replacements_) : stat(name_, fullname_, desc_, replacements_) constructor {
|
||
|
value = val;
|
||
|
modifier = 0;
|
||
|
}
|
||
|
|
||
|
nu stat("hp", "health", "vitality");
|
||
|
nu stat("str", "strength", "physical power");
|
||
|
nu stat("def", "defense", "physical defense");
|