Mercurial > pyntnclick
comparison gamelib/scenes/cryo.py @ 94:ce23fad8ecb3
More complex shaped interactables
author | Neil Muller <neil@dip.sun.ac.za> |
---|---|
date | Tue, 24 Aug 2010 00:56:31 +0200 |
parents | 542ede2896bb |
children | 7590586180f5 |
comparison
equal
deleted
inserted
replaced
93:350ce4ebe122 | 94:ce23fad8ecb3 |
---|---|
1 """Cryo room where the prisoner starts out.""" | 1 """Cryo room where the prisoner starts out.""" |
2 | 2 |
3 import random | 3 import random |
4 | 4 |
5 from gamelib.state import Scene, Item, Thing, Result, \ | 5 from gamelib.state import Scene, Item, Thing, Result, \ |
6 InteractImage, InteractNoImage | 6 InteractImage, InteractNoImage, InteractRectUnion |
7 | 7 |
8 | 8 |
9 class Cryo(Scene): | 9 class Cryo(Scene): |
10 | 10 |
11 FOLDER = "cryo" | 11 FOLDER = "cryo" |
40 "Cryo unit containing titanium leg." | 40 "Cryo unit containing titanium leg." |
41 | 41 |
42 NAME = "cryo.unit.1" | 42 NAME = "cryo.unit.1" |
43 | 43 |
44 INTERACTS = { | 44 INTERACTS = { |
45 "unit": InteractNoImage(520, 430, 80, 50), | 45 "unit": InteractRectUnion(((520, 430, 80, 50), (550, 470, 90, 60), |
46 (600, 510, 60, 40))) | |
46 } | 47 } |
47 | 48 |
48 INITIAL = "unit" | 49 INITIAL = "unit" |
49 | 50 |
50 INITIAL_DATA = { | 51 INITIAL_DATA = { |
56 self.set_data('contains_titanium_leg', False) | 57 self.set_data('contains_titanium_leg', False) |
57 return Result("The corpse in this cryo unit has a prosthetic leg made out of titanium. You take it.") | 58 return Result("The corpse in this cryo unit has a prosthetic leg made out of titanium. You take it.") |
58 | 59 |
59 def is_interactive(self): | 60 def is_interactive(self): |
60 return self.get_data('contains_titanium_leg') | 61 return self.get_data('contains_titanium_leg') |
62 | |
63 def get_description(self): | |
64 if self.get_data('contains_titanium_leg'): | |
65 return "A broken cryo chamber, with an poor unfortunate corpse inside" | |
66 return "A broken cryo chamber. The corpse inside is missing a leg" | |
61 | 67 |
62 | 68 |
63 class CryoRoomDoor(Thing): | 69 class CryoRoomDoor(Thing): |
64 "Door to the cryo room." | 70 "Door to the cryo room." |
65 | 71 |