def click(self): if self.onclick: call_trigger(self.onclick, self.obstaclemap, self.identifier, self) if self.dialog: self.dialogmanager.start_dialog(self.dialog) if self.action == "chest": for item in self.items: self.obstaclemap.add_item({ "x": self.grid_pos[0] + self.rect.width / WIDTH / 2 + 0.1, "y": self.grid_pos[1], "type": item }) self.items = [] if self.after_looting: self.obstaclemap.replace_obs(obstacle=self, new=self.after_looting) if self.action == "barrel": for item in self.items: self.obstaclemap.add_item({ "x": self.grid_pos[0], "y": self.grid_pos[1], "type": item }) self.obstaclemap.delete_obs(obstacle=self)
def click(self): if self.onclick: call_trigger(self.onclick, self.obstaclemap, self.identifier, self) if self.dialog: self.dialogmap.start_dialog(self.dialog) if self.action == "chest": for item in self.items: self.obstaclemap.add_item({"x": self.grid_pos[0] + 0.5, "y": self.grid_pos[1], "type": item}) self.obstaclemap.replace_obs(obstacle=self, new=self.after_looting) if self.action == "barrel": for item in self.items: self.obstaclemap.add_item({"x": self.grid_pos[0], "y": self.grid_pos[1], "type": item}) self.obstaclemap.delete_obs(obstacle=self)
def trigger(self): if self.active and self.onwalk: call_trigger(self.onwalk, self.obstaclemap, self.identifier, self) if self.deactivate_after_use: self.active = False
def die(self): self.state = "death" self.frame = 0 self.selectable = False if self.ondeath: call_trigger(self.ondeath, self.obstaclemap, self.identifier, self)