aboutsummaryrefslogtreecommitdiff
path: root/assets/json/enemies_gen.py
diff options
context:
space:
mode:
authorjacopograndi <jacopo.grandi@outlook.it>2022-02-08 14:14:42 +0100
committerjacopograndi <jacopo.grandi@outlook.it>2022-02-08 14:14:42 +0100
commite0a389ff5964c34022fb90d9c3fb29053567ec65 (patch)
tree8d6dd57951e7532f6864c90a46bd288371bcfd3d /assets/json/enemies_gen.py
parenteea642395bb0ef706c7241d4a749f3e0ac4cc460 (diff)
enemy colorsHEADmain
Diffstat (limited to 'assets/json/enemies_gen.py')
-rw-r--r--assets/json/enemies_gen.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/assets/json/enemies_gen.py b/assets/json/enemies_gen.py
index 695b264..8e1ba88 100644
--- a/assets/json/enemies_gen.py
+++ b/assets/json/enemies_gen.py
@@ -54,6 +54,14 @@ bonus = {
"s": { "speed": 0.8, "lives": 3 },
}
+colors = {
+ "T": [1, 1, 1, 1],
+ "k": [0.2, 0.7, 0, 1],
+ "a": [1, 0, 0, 1],
+ "d": [0, 0.4, 1, 1],
+ "s": [1, 1, 0, 1],
+}
+
def get_stats (node):
stats = base.copy()
bonuses = { k:1 for k in stats }
@@ -66,6 +74,13 @@ def get_stats (node):
stats[s] *= bonuses[s]
return stats
+def get_color (node):
+ color = [0,0,0,0]
+ for r in node:
+ for i in range(len(color)): color[i] += colors[r][i]
+ for i in range(len(color)): color[i] /= len(node)
+ return color
+
def get_enemy (node):
enemy = get_stats(node)
enemy['name'] = node
@@ -75,6 +90,7 @@ def get_enemy (node):
enemy["model_name"] = node + '.glb'
enemy["thumbnail_name"] = node + '.png'
enemy["resource"] = node[0]
+ enemy["color"] = get_color(node)
return enemy