projects
/
koperkapel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a sensible license
[koperkapel.git]
/
koperkapel
/
serums.py
diff --git
a/koperkapel/serums.py
b/koperkapel/serums.py
index 22391145f2b23843f75bccad381cae6f33fc4d7f..f80163932538b22e83db90ac3875eedd0aed760f 100644
(file)
--- a/
koperkapel/serums.py
+++ b/
koperkapel/serums.py
@@
-19,6
+19,7
@@
SERUM_OVERLAY_COLORS = {
"smart": (0, 0, 255, 255), # blue
"fast": (0, 255, 0, 255), # green
"strong": (255, 0, 255, 255), # purple
"smart": (0, 0, 255, 255), # blue
"fast": (0, 255, 0, 255), # green
"strong": (255, 0, 255, 255), # purple
+ "health": (255, 0, 0, 255), # red
"none": (170, 68, 0, 255), # brown
}
"none": (170, 68, 0, 255), # brown
}
@@
-41,6
+42,15
@@
class SerumFactory:
def __init__(self, suffix):
self.suffix = suffix
def __init__(self, suffix):
self.suffix = suffix
+ def assemble_icon(self, name, color=None):
+ assert name in SERUMS
+ color = color or name
+ serum_icon = images.load(safepath("serum%s/%s") % (
+ self.suffix, SERUM_TILENAME_MAP[name],))
+ frame = serum_icon.copy()
+ frame.fill(SERUM_OVERLAY_COLORS[color], None, BLEND_RGBA_MULT)
+ return frame
+
def assemble(self, name):
assert name in SERUMS
puddle = images.load(safepath("serum%s/serum") % (self.suffix,))
def assemble(self, name):
assert name in SERUMS
puddle = images.load(safepath("serum%s/serum") % (self.suffix,))