eastern-flames/eastern flames/scripts/stat/stat.gml

24 lines
670 B
Plaintext
Raw Normal View History

2022-08-15 02:35:57 +00:00
//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
2022-08-15 17:51:51 +00:00
function unitstat(val_, name_, fullname_, desc_, replacements_) : stat(name_, fullname_, desc_, replacements_) constructor {
val = val_;
2022-08-16 01:01:09 +00:00
cap = val_;
2022-08-15 02:35:57 +00:00
modifier = 0;
}
nu stat("hp", "health", "vitality");
nu stat("str", "strength", "physical power");
2022-08-16 01:01:09 +00:00
nu stat("def", "defense", "physical defense");
nu stat("spd", "speed", "avoid and follow-up");