From 48c1a3af7a24e8d09058a08c515ecdfd45ebace4 Mon Sep 17 00:00:00 2001 From: the me Date: Mon, 15 Aug 2022 19:58:13 -0700 Subject: [PATCH] weapons probably work --- eastern flames/scripts/stat/stat.gml | 23 +++++++++++++++++++++++ eastern flames/scripts/weapon/weapon.gml | 22 +++++++++++++++++++--- 2 files changed, 42 insertions(+), 3 deletions(-) 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