diff --git a/eastern flames/scripts/stat/stat.gml b/eastern flames/scripts/stat/stat.gml index 5adb287..9167ef3 100644 --- a/eastern flames/scripts/stat/stat.gml +++ b/eastern flames/scripts/stat/stat.gml @@ -18,6 +18,29 @@ function unitstat(val_, name_, fullname_, desc_, replacements_) : stat(name_, fu modifier = 0; } +function statmod(stat__, amount_, operation_=add) { + name = stat__.name; + stat_ = stat__; + amount = amount_; + operation = operation_; +} + +function add(val1, val2) { + return val1*val2; +} +function sub(val1, val2) { + return val1*val2; +} +function mult(val1, val2) { + return val1*val2; +} +function divide(val1, val2) { + return val1*val2; +} +function modulo(val1, val2) { + return val1*val2; +} + nu stat("hp", "health", "vitality"); nu stat("str", "strength", "physical power"); nu stat("def", "defense", "physical defense"); diff --git a/eastern flames/scripts/weapon/weapon.gml b/eastern flames/scripts/weapon/weapon.gml index edbd3dc..4183512 100644 --- a/eastern flames/scripts/weapon/weapon.gml +++ b/eastern flames/scripts/weapon/weapon.gml @@ -1,9 +1,13 @@ global.weapons = {}; #macro wp global.weapons -function weapon(name_, description_, statmod_) constructor { +function weapon(name_, description_, statmods) constructor { name = name_; description = description_; - statmod = statmod_; + modifiers = {}; + var i; + for (i=0; i