diff --git a/typeclasses/characters.py b/typeclasses/characters.py index 7629889..476b01e 100644 --- a/typeclasses/characters.py +++ b/typeclasses/characters.py @@ -70,11 +70,17 @@ class Character(Object, GenderCharacter, ContribRPCharacter): self.create_letter() self.create_ticket() + def delete_inv(self, typeclass): + for obj in self.contents: + if obj.is_typeclass(typeclass): + obj.delete() + def at_post_puppet(self, **kwargs): if self.db.visited: self.msg(f"""\n“Welcome back, {self.key.capitalize()}.”\n""") if self.location.key == "Wyldwood Bar": self.msg("You wake up in a meadow with a strange dream of a bar...") + self.delete_inv("typeclasses.drinkables.Cocktail") self.location = self.global_search("Frog Meadow") self.execute_cmd("look") else: diff --git a/typeclasses/drinkables.py b/typeclasses/drinkables.py index 1f085ba..4345bb0 100755 --- a/typeclasses/drinkables.py +++ b/typeclasses/drinkables.py @@ -335,8 +335,16 @@ class Cocktail(Object): drink.db.effects = details.get("effects") drink.db.amount = Cocktail.fill_amount drink.location = owner + drink.location.msg(f"You now have a {drink.name}.") + theroom = drink.location.location + char = owner.db._sdesc or owner.get_display_name(theroom) + logger.info(drink.db.cocktail_type) + msg = routput("The << bartender ^ barkeep ^ elf >> << passes ^ slides ^ gives ^ hands >> a {0} to {1}.", + drink.db.cocktail_type, char) + theroom.msg_contents(msg, exclude=owner) + def at_object_creation(self): """ Add the 'drink' command.