X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/copy_free?a=blobdiff_plain;f=plomrogue%2Fthings.py;h=32d7854732029bd0fc2ef2946dae9ecaebf006d7;hb=4d2cf315344ec4a376ffb3f49f02674e4b5facb6;hp=31820541a7ad46a51a76b8a07bf2f412d3b39267;hpb=d13e2f639316c1dba7a62d84f3c850bc937c2b1e;p=plomrogue2 diff --git a/plomrogue/things.py b/plomrogue/things.py index 3182054..32d7854 100644 --- a/plomrogue/things.py +++ b/plomrogue/things.py @@ -1,5 +1,6 @@ from plomrogue.errors import GameError, PlayError from plomrogue.mapping import YX +import random @@ -163,6 +164,27 @@ class Thing_BottleSpawner(ThingSpawner): +class Thing_Hat(Thing): + symbol_hint = 'H' + portable = True + design = ' X X ===' + + + +class Thing_HatRemixer(Thing): + symbol_hint = 'H' + + def accept(self, hat): + import string + new_design = '' + legal_chars = string.ascii_letters + string.digits + string.punctuation + ' ' + for i in range(9): + new_design += random.choice(list(legal_chars)) + hat.design = new_design + self.sound('HAT REMIXER', 'remixing a hat …') + + + import datetime class Thing_MusicPlayer(Thing): symbol_hint = 'R' @@ -276,12 +298,15 @@ class Thing_BottleDeposit(Thing): def proceed(self): if self.bottle_counter >= 3: self.bottle_counter = 0 - t = self.game.thing_types['MusicPlayer'](self.game, - position=self.position) + choice = random.choice(['MusicPlayer', 'Hat']) + t = self.game.thing_types[choice](self.game, position=self.position) self.game.things += [t] - self.sound('BOTTLE DEPOSITOR', - 'here is a gift as a reward for ecological consciousness –' - 'use "command thing" on it to learn more!') + msg = 'here is a gift as a reward for ecological consciousness –' + if choice == 'MusicPlayer': + msg += 'pick it up and then use "command thing" on it!' + elif choice == 'Hat': + msg += 'pick it up and then use "(un-)wear" on it!' + self.sound('BOTTLE DEPOSITOR', msg) self.game.changed = True def accept(self):