X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=new%2Fplomrogue%2Fthings.py;fp=new%2Fplomrogue%2Fthings.py;h=4f35880b7689644a1e3f1c941f02a93898130077;hb=2634704d62ea6ef488f4eb42d266e147c8e9facd;hp=c47e55384c72732469929e0a054468301ad93e79;hpb=97049163acc0844e1656df3f761c9ca612afdeb0;p=plomrogue2-experiments diff --git a/new/plomrogue/things.py b/new/plomrogue/things.py index c47e553..4f35880 100644 --- a/new/plomrogue/things.py +++ b/new/plomrogue/things.py @@ -237,24 +237,20 @@ class ThingAnimate(Thing): self._surrounding_map = None self._surroundings_offset = None - def must_fix_indentation(self): - return self._radius % 2 != self.position[1].y % 2 - def get_surroundings_offset(self): if self._surroundings_offset is not None: return self._surroundings_offset - add_line = self.must_fix_indentation() - offset = YX(self.position[0].y * self.world.game.map_size.y + self.position[1].y - self._radius - int(add_line), - self.position[0].x * self.world.game.map_size.x + self.position[1].x - self._radius) + offset = YX(self.position[0].y * self.world.game.map_size.y + + self.position[1].y - self._radius, + self.position[0].x * self.world.game.map_size.x + + self.position[1].x - self._radius) self._surroundings_offset = offset return self._surroundings_offset def get_surrounding_map(self): if self._surrounding_map is not None: return self._surrounding_map - add_line = self.must_fix_indentation() - self._surrounding_map = Map(size=YX(self._radius*2+1+int(add_line), - self._radius*2+1)) + self._surrounding_map = Map(size=YX(self._radius*2+1, self._radius*2+1)) offset = self.get_surroundings_offset() for pos in self._surrounding_map: offset_pos = pos + offset @@ -273,8 +269,7 @@ class ThingAnimate(Thing): for pos in surrounding_map: if surrounding_map[pos] in {'.', '~'}: m[pos] = '.' - add_line = self.must_fix_indentation() - fov_center = YX((add_line + m.size.y) // 2, m.size.x // 2) + fov_center = YX((m.size.y) // 2, m.size.x // 2) self._stencil = FovMapHex(m, fov_center) return self._stencil