def hit_operation(self, op): res = Oplist() arg = op[0] if arg: # Create a poisoning instance new_entity = Entity(parent="poisoning", loc=op["from"]) print(new_entity.loc) damage_prop = self.props.damage_poison if damage_prop is not None: new_entity.damage = damage_prop res.append(Operation("create", new_entity, to=arg.id)) res.append(Operation("delete", Entity(self.id), to=self.id)) return server.OPERATION_HANDLED, res
def hit_operation(self, op): res = Oplist() arg = op[0] if arg: # Create a poisoning instance new_entity = Entity(parent="poisoning", loc=op["from"]) new_entity["entity_ref"] = { "$eid": get_actor_id_from_mode_data(self) } damage_prop = self.props.damage_poison if damage_prop is not None: new_entity.damage = damage_prop res.append(Operation("create", new_entity, to=arg.id)) res.append(Operation("delete", Entity(self.id), to=self.id)) return server.OPERATION_HANDLED, res