def interact_with_empty_can(self, item): contents = self.get_data('contents') if "can" in contents: return Result(_("There is already a can in the welder.")) self.game.remove_inventory_item(item.name) contents.append("can") self.set_interact() return Result(_("You carefully place the can in the laser welder."))
def interact_without(self): if self.get_data('taken'): return Result(_("The remaining bottles leak.")) self.set_data('taken', True) self.set_interact() self.game.add_inventory_item('detergent_bottle') return Result( _("You pick up an empty dishwashing liquid bottle. You" " can't find any sponges."))
def interact_without(self): if not self.get_data('has_bowl'): return Result( _("What's the point of lugging around a very dead" " fish and a kilogram or so of sand?")) self.set_data('has_bowl', False) self.set_interact() self.game.add_inventory_item('fishbowl') return Result(_("The fishbowl is useful, but its contents aren't."))
def interact_with_tube_fragment(self, item): contents = self.get_data('contents') if "tube" in contents: return Result(_("There is already a tube fragment in the welder.")) self.game.remove_inventory_item(item.name) contents.append("tube") self.set_interact() return Result(_("You carefully place the tube fragments in the" " laser welder."))
def interact_without(self): if self.get_data('present') and not self.get_data('working'): return Result( _("It's wedged in there pretty firmly, it won't" " come out.")) elif self.get_data('working'): return Result( _("You decide that working engines are more" " important than having a shiny superconductor."))
def interact_with_superconductor(self, item): if self.get_data('present'): return Result( _("It might help to remove the broken" " superconductor first")) else: return Result( _("You plug in the superconductor, and feel a hum " "as things kick into life. Unfortunately, it's " "the wrong size for the socket and just falls " "out again when you let go."))
def interact_with_duct_tape(self, item): if self.get_data('fixed'): return Result( _("The duct tape already there appears to be " "sufficient.")) else: self.set_data('fixed', True) self.set_interact() return Result( _("You apply your trusty duct tape to the " "creak, sealing it."))
def interact_with_cryo_pipes_three(self, item): if self.get_data("status") == "blocked": return Result(_("It would get lost in the fronds.")) else: self.game.remove_inventory_item(item.name) self.set_data('status', 'replaced') self.set_interact() self.scene.set_data('life support status', 'replaced') return Result( _("The pipes slot neatly into place, but don't make" " an airtight seal. One of the pipes has cracked" " slightly as well."))
def interact_without(self): ai_status = self.state.get_jim_state() if ai_status == 'online': return self.interact_default(None) elif self.scene.get_data('ai panel') == 'closed': return Result( _("You are unable to open the panel with your" " bare hands.")) elif self.scene.get_data('ai panel') == 'open': self.scene.set_data('ai panel', 'broken') self.state.break_ai() self.set_interact() return Result(_("You unplug various important-looking wires."))
def interact_without(self): if self.get_data('is_cracked'): if self.get_data('has_tape'): self.set_data('has_tape', False) self.game.add_inventory_item('duct_tape') self.set_interact() return Result( _("Duct tape. It'll stick to everything except " "ducts, apparently.")) return Result( _("The perfectly balanced door swings " "frictionlessly to and fro. What craftsmanship!")) return Result( _("The safe is locked. This might be an interesting " "challenge, if suitable equipment can be found."))
def interact_with_machete(self, item): ai_status = self.state.get_jim_state() if ai_status == 'online': return self.interact_default(item) elif self.scene.get_data('ai panel') == 'closed': self.scene.set_data('ai panel', 'open') self.set_interact() return Result(_("Using the machete, you lever the panel off.")) elif self.scene.get_data('ai panel') == 'open': self.scene.set_data('ai panel', 'broken') self.state.break_ai() self.set_interact() return Result( _("You smash various delicate components with" " the machete."))
def interact_without(self): if self.get_data("status") == "blocked": return Result(_("The mutant broccoli resists your best efforts.")) elif self.get_data("status") == "broken": return Result( _("Shoving the broken pipes around doesn't help " "much.")) elif self.get_data("status") == "replaced": return Result( _("Do you really want to hold it together for the " "rest of the voyage?")) else: return Result( _("You don't find any leaks. Good job, Prisoner %s.") % PLAYER_ID)
def interact_with_titanium_leg(self, item): if self.get_data('door') == "ajar": self.open_door() return Result(_("You wedge the titanium femur into the chain and" " twist. With a satisfying *snap*, the chain" " breaks and the door opens."), soundfile='break.ogg') elif self.get_data('door') == "shut": text = _("You bang on the door with the titanium femur. It makes a" " clanging sound.") return Result(text, soundfile='clang.ogg') else: return Result( _("You wave the femur in the doorway. Nothing" " happens."))
def enter(self): if self.get_data('greet'): self.set_data('greet', False) return Result( _("With your improvised helmet, the automatic airlock" " allows you into the engine room. Even if there wasn't" " a vacuum it would be eerily quiet."))
def interact_with_duct_tape(self, item): if self.get_data("status") == "broken": return Result(_("It would get lost in the fronds.")) elif self.get_data("status") == 'fixed': return Result( _("There's quite enough tape on the ducting already.")) else: self.set_data("fixed", True) self.set_data("status", "fixed") self.set_interact() self.scene.set_data('life support status', 'fixed') return Result( _("It takes quite a lot of tape, but eventually " "everything is airtight and ready to hold " "pressure. Who'd've thought duct tape could " "actually be used to tape ducts?"))
def interact_default(self, item): if self.state.get_jim_state() == 'online': return (Result(_('You feel a shock from the panel.')), make_jim_dialog( _("Prisoner %s. Please step away from the" " panel. You are not an authorized" " technician.") % PLAYER_ID, self.game))
def interact_without(self): self.take() # Fill in the doctor's rect self.scene.doctor.rect.append(self.rect) return Result( _("You pick up the stethoscope and verify that the" " doctor's heart has stopped. Probably a while ago."))
def interact_without(self): self.game.scenes['cryo'].things['cryo.unit.1'].set_data( 'contains_titanium_leg', False) self.take() return Result( _("The skeletal occupant of this cryo unit has an" " artificial femur made of titanium. You take it."))
def interact_with_machete(self, item): if self.get_data('present') and not self.get_data('working'): self.set_data('present', False) self.set_interact() return Result( _("With leverage, the burned-out superconductor" " snaps out. You discard it."))
def interact_without(self): if self.game.scenes['bridge'].get_data('ai status') == 'online': return make_jim_dialog( _("You are not authorized to change the" " destination."), self.game) if not self.ai_blocked: return Result( _("There's no good reason to choose to go to the" " penal colony.")) if self.game.scenes['bridge'].get_data('ai status') == 'looping': return Result( _("You could change the destination, but when JIM" " recovers, it'll just get reset.")) if self.game.scenes['bridge'].get_data('ai status') == 'dead': return Result(_("You change the destination."), soundfile="beep550.ogg", end_game=True)
def interact_with_taped_superconductor(self, item): if not self.get_data('present'): self.set_data('present', True) self.set_data('working', True) self.set_interact() self.game.remove_inventory_item(item.name) results = [ Result( _("The chair's superconductor looks over-specced" " for this job, but it should work.")) ] results.append(self.scene.engine_online_check()) return results else: return Result( _("It might help to remove the broken superconductor" " first."))
def interact_with_full_detergent_bottle(self, item): if not self.scene.things['engine.cracked_pipe'].get_data('fixed'): return Result( _("Pouring the precious cryo fluid into a" " container connected to a cracked pipe would be a" " waste.")) self.game.remove_inventory_item(item.name) self.scene.things['engine.cryo_containers'].set_data('filled', True) self.scene.things['engine.cryo_containers'].set_interact() results = [ Result( _("You fill the reservoirs. " "The detergent bottle was just big enough, which " "is handy, because it's sprung a leak.")) ] results.append(self.scene.engine_online_check()) return results
def interact(self, item): if not self.game.is_in_inventory('helmet:'): return Result( _('The airlock refuses to open. The automated' ' voice says: "Hull breach beyond this door. Personnel' ' must be equipped for vacuum before entry."')) else: return super(ToEngine, self).interact(item)
def interact_with_machete(self, item): if self.get_data("status") == "blocked": self.set_data("status", "broken") self.set_interact() return Result(_("With a flurry of disgusting mutant vegetable " "chunks, you clear the overgrown broccoli away " "from the access panel and reveal some broken " "tubes. They look important."), soundfile='chopping.ogg') elif self.get_data("status") == "broken": return Result(_("It looks broken enough already.")) elif self.get_data("status") == "replaced": return Result(_("Cutting holes won't repair the leaks.")) else: return Result( _("After all that effort fixing it, chopping it to " "bits doesn't seem very smart."))
def interact_without(self): self.game.scenes['bridge'].things['bridge.massagechair_base'] \ .set_data('contains_superconductor', False) self.take() return (Result(_("The superconductor module unclips easily.")), make_jim_dialog( _("Prisoner %s. That chair you've destroyed" " was property of the ship's captain. " "You will surely be punished.") % PLAYER_ID, self.game))
def interact_with_titanium_leg(self, item): return Result(random.choice([ _("You bang on the chamber with the titanium femur. Nothing" " much happens."), _("Hitting the cryo unit with the femur doesn't achieve" " anything."), _("You hit the chamber with the femur. Nothing happens."), ]), soundfile="clang2.ogg")
def interact_without(self): if self.get_data('door') == "shut": self.half_open_door() if self.get_data('door') != "open": return Result(_("It moves slightly and then stops. A chain on the" " other side is preventing it from opening" " completely."), soundfile='chain.ogg') else: self.game.change_scene('map') return None
def interact_with_stethoscope(self, item): if self.get_data('is_cracked'): return Result( _("It's already unlocked. " "There's no more challenge.")) # TODO: Wax lyrical some more about safecracking. self.set_data('is_cracked', True) self.set_interact() self.state.increase_sentence(20) return (Result( _("Even after centuries of neglect, the tumblers slide" " almost silently into place. Turns out the" " combination was '1 2 3 4 5'. An idiot must keep his" " luggage in here.")), make_jim_dialog( _("Prisoner %s, you have been observed" " committing a felony violation. This will" " go onto your permanent record, and your" " sentence will be extended by twenty" " years.") % PLAYER_ID, self.game), make_sentence_dialog(PLAYER_ID, self.game))
def interact_without(self): starting_cans = self.get_data('cans_available') if starting_cans > 0: self.game.add_inventory_item('full_can') self.set_data('cans_available', starting_cans - 1) self.set_interact() if starting_cans == 1: self.scene.remove_thing(self) return Result({ 3: _("Best before a long time in the past." " Better not eat these."), 2: _("Mmmm. Nutritious bacteria stew."), 1: _("Candied silkworms. Who stocked this place?!"), }[starting_cans]) else: return Result( _("The rest of the cans are rusted beyond " "usefulness."))
def interact_with_machete(self, item): if self.get_data('fixed'): self.set_data('fixed', False) self.game.add_inventory_item('tube_fragment') self.set_interact() responses = [ Result(_("It takes more effort than one would expect," " but eventually the pipe is separated from" " the wall."), soundfile="chop-chop.ogg") ] if self.game.get_current_scene().get_data('vandalism_warn'): self.game.get_current_scene().set_data('vandalism_warn', False) responses.append( make_jim_dialog( _("Prisoner %s. Vandalism is an offence punishable by a " "minimum of an additional 6 months to your sentence." ) % PLAYER_ID, self.game)) return responses