in jsuarez/extra/embyr_deprecated/embyr2d/modules.py [0:0]
def updateMaps(self, ents):
for ent in ents:
attack = ent.attack.action
#targ = ent.attack.args
targ = ent.targ
if targ is None or targ.damage is None:
continue
idx = ent.colorInd
if idx >= 16:
continue
entr, entc = ent.attkPos
targr, targc = ent.targPos
r = self.MAPCENT + targr - entr
c = self.MAPCENT + targc - entc
if issubclass(attack, action.Melee):
self.counts[idx][r, c, 0] += 1
elif issubclass(attack, action.Range):
self.counts[idx][r, c, 1] += 1
elif issubclass(attack, action.Mage):
self.counts[idx][r, c, 2] += 1
rgb = self.counts[idx][r, c]
normSum = np.sum(rgb)
redVal = self.RED * rgb[0] / normSum
greenVal = self.GREEN * rgb[1] / normSum
blueVal = self.BLUE * rgb[2] / normSum
color = (redVal + greenVal + blueVal).astype(np.uint8)
self.maps[idx][r, c] = color