def react(self, world, basis): actions = [] if basis.verb in ['strike', 'punch', 'hit'] and basis.direct == str(self): self.treeSmacked = self.treeSmacked + 1 print self.children if self.treeSmacked < 17 and self.treeSmacked % 4 == 0: actions.append(Modify('open', str(self), direct=str(self), feature='open', new=True)) actions.append(Configure('drop','@tree', direct='@log' + str((self.treeSmacked/4)-1), template=['[direct/o] [fall/v] off [agent/s]'], new=('in', '@beach') )) actions.append(Modify('close', str(self), direct=str(self), feature='open', new=False)) #FIND A WAY TO MAKE IT SO THE TREE'S GONE AFTER BEING HIT 16 times! return actions + Thing.react(self, world, basis)
Waver('@mime in @foyer', article='a', called='(dazed) mime', referring='oblivious strange | greeter character', allowed=can.possess_things_and_wear_cloak, qualities=['person', 'man'], gender='male', sight=""" [here] [is/1/v] a strange character who [seem/1/v] almost completely oblivious to everything""", start=50), Thing('@bottle in @foyer', article='a', called='(clear) (glass) bottle', open=False, transparent=True, vessel='@water', sight='a clear glass bottle, currently [open/@bottle/a]', touch="smooth glass"), Thing('@ticket of @person', article='a', called='ticket', referring='opera |', sight=""" [@ticket/ordinary/s] [read/v] "VALID FOR A NIGHT AT THE OPERA UNLESS IT RAINS" """), Thing('@massive_sack in @foyer', article='a',
items = fiction.plaza.items + [ Wanderer('@visitor in @plaza_center', article='the', called='visitor', referring='|', allowed=can.possess_any_thing, qualities=['person', 'woman'], gender='female', sight='[*/s] [see/v] someone who is out of place', walk_probability=0.7, start=25), Thing( '@tortilla of @visitor', article='a', called='(tasty) (corn) tortilla', referring='tasty typical circular thin white corn | circle disc disk', sight='a thin white circle, a corn tortilla', taste='bland but wholesome nutriment', consumable=True, prominence=0.2), Actor('@flaneur in @plaza_center', article='a', called='flaneur', referring='distracted foppish | flaneur', allowed=can.possess_any_thing, sight='a foppish man who [seem/1/v] dedicated to strolling about', qualities=['person', 'man'], gender='male', script=[ 'leave north', 'wait', 'wait', 'wander', 'wait', 'leave east', 'wait', 'wait', 'wander', 'wait', 'leave south', 'wait',
def __init__(self, tag, **keywords): self.intact = True Thing.__init__(self, tag, **keywords)
"""[*/s] [have/v] only just arrived, and besides, the weather outside [seem/1/v] to be getting worse"""), ('configure direct=@cloak new_parent=@foyer', when.always, """the floor [is/not/1/v] the best place to leave a smart cloak lying around""") ], sight=""" [*/s] [see/v] a typically nondescript character"""), Thing('@cloak on @person', article='a', called='(handsome) cloak (of darkness)', referring='black damp trimmed with satin smart soft sumptuous ' + 'velvet | cape', qualities=['clothing'], glow=-0.5, sight=""" [@cloak/s] [is/v] of velvet trimmed with satin and [is/v] slightly spattered with raindrops [@cloak's] blackness [is/1/v] so deep that it [seem/1/v] to suck light from the room""", touch=""" a material that [is/1/v] soft and sumptuous, despite being damp"""), Room('@foyer', article='the', called='(splendid) foyer (of the opera house)', referring='splendidly decorated red gold spacious | hall', exits={ 'south': '@bar', 'west': '@cloakroom' },
allowed=can.have_any_item), Actor('@robber in @street', article='the', called='twitchy man', gender='male', allowed=can.have_any_item), Actor('@guard in @guard_post', article='the', called='burly guard', gender='male', allowed=can.have_any_item), Thing('@slips in @vestibule', article='some', called='deposit slips'), Thing('@fake_money in @vestibule', article='some', prominence=0.3, called='fake money'), Thing('@bag in @vestibule', article='a', called='black bag', allowed=can.have_any_item), Thing('@mask of @robber', article='a', called='Dora the Explorer mask'),
def __init__(self, tag, **keywords): self.alive = False #check_attributes(tag, [], ['exits', 'shared', 'refuses'], keywords) #new #tag_and_parent = tag + ' of @cosmos' #new #keywords['allowed'] = can.have_any_item #new Thing.__init__(self, tag, **keywords) #removing this temporarily
def __init__(self, tag_and_parent, **keywords): check_attributes(tag_and_parent, [], ['allowed', 'parent'], keywords) tag_and_parent = tag_and_parent + ' of @cosmos' keywords['allowed'] = can.have_any_item self.sharedthing = True Thing.__init__(self, tag_and_parent, **keywords)
'west': '@plaza_nw', 'southwest': '@plaza_w', }, view={ '@plaza_ne': (.5, 'to the east'), '@plaza_e': (.5, 'to the southeast'), '@plaza_center': (.5, 'to the south'), '@plaza_nw': (.5, 'to the west'), '@plaza_w': (.5, 'to the southwest'), '@plaza_se': (.25, 'off toward the southeast'), '@plaza_s': (.25, 'across the plaza'), '@plaza_sw': (.25, 'off toward the southwest') }), Thing('@rock in @plaza_n', article='a', called=' rock', referring='fist-sized fist sized | rock stone', sight='a fist-sized rock', prominence=0.3), Thing('@statue part_of @plaza_n', article='a', called='statue', referring='marble | likeness Einstein', sight=""" [*/s] [see/v] a marble likeness of Einstein there [is/1/v] almost no hint [here] of the playful, disheveled scientist so often seen in the photographs that were popular in the early twenty-first century""", qualities=['stone'], prominence=0.8),