def check(self):
if self.thing.carrying is None:
raise PlayError('carrying nothing to consume')
- if self.thing.carrying.type_ not in {'Bottle', 'Cookie', 'Psychedelic'}:
+ if not self.thing.carrying.consumable:
raise PlayError('cannot consume this kind of thing')
if self.thing.carrying.type_ == 'Bottle' and\
not self.thing.carrying.full:
self.thing.carrying.empty()
self.thing.send_msg('CHAT "You are drunk now."')
self.thing.need_for_toilet += 1
- self.thing.drunk = 10000
+ self.thing.drunk += 10000
self.thing.invalidate('fov')
self.thing.game.record_change(self.thing.position, 'other')
elif self.thing.carrying.type_ == 'Psychedelic':
- self.thing.tripping = 10000
+ self.thing.tripping += 10000
self.thing.send_msg('CHAT "You start tripping."')
self.thing.send_msg('RANDOM_COLORS')
eaten = self.thing.uncarry()
self.thing.add_cookie_char(self.thing.carrying.thing_char)
eaten = self.thing.uncarry()
self.thing.game.remove_thing(eaten)
+ elif self.thing.carrying.type_ == 'Stimulant':
+ self.thing.send_msg('CHAT "You feel a flash of energy."')
+ self.thing.energy += 100
+ eaten = self.thing.uncarry()
+ self.thing.game.remove_thing(eaten)
commandable = False
cookable = False
carried = False
+ consumable = False
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
symbol_hint = 'P'
portable = True
cookable = True
+ consumable = True
thing_char = '~'
spinnable = True
cookable = True
+ consumable = True
def empty(self):
self.thing_char = '_'
+class Thing_Stimulant(Thing):
+ symbol_hint = 'e'
+ cookable = True
+ portable = True
+ consumable = True
+
+
+
+class Thing_StimulantSpawner(ThingSpawner):
+ symbol_hint = 'e'
+ child_type = 'Stimulant'
+
+
+
class Thing_Cookie(Thing):
symbol_hint = 'c'
portable = True
+ consumable = True
def __init__(self, *args, **kwargs):
import string
Thing_MusicPlayer, Thing_Hat, Thing_HatRemixer,
Thing_Cookie, Thing_CookieSpawner, Thing_Psychedelic,
Thing_PsychedelicSpawner, Thing_DoorKey,
- Thing_Crate, Thing_CrateSpawner)
+ Thing_Crate, Thing_CrateSpawner, Thing_Stimulant,
+ Thing_StimulantSpawner)
from plomrogue.config import config
game = Game(config['savefile'])
game.register_thing_type(Thing_PsychedelicSpawner)
game.register_thing_type(Thing_Crate)
game.register_thing_type(Thing_CrateSpawner)
+game.register_thing_type(Thing_Stimulant)
+game.register_thing_type(Thing_StimulantSpawner)
game.read_savefile()
game.io.start_loop()
for port in config['servers']: