Ejemplo n.º 1
0
 def get_description(self):
     if self.get_data('door') == "open":
         return _('An open doorway leads to the rest of the ship.')
     elif self.get_data('door') == "ajar":
         return _("A rusty door. It can't open all the way because of a "
                  "chain on the other side.")
     return _('A rusty door. It is currently closed.')
Ejemplo n.º 2
0
 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))
Ejemplo n.º 3
0
 def get_description(self):
     if self.get_data('has_bowl'):
         return _("This fishbowl looks exactly like an old science fiction"
                  " space helmet.")
     else:
         return _("An evicted dead fish and some sand lie forlornly on the"
                  " table")
Ejemplo n.º 4
0
 def setup(self):
     self.add_thing(CansOnShelf())
     self.add_thing(Tubes())
     self.add_thing(ToMap())
     self.add_thing(DetergentThing())
     self.add_thing(Boomslang())
     self.add_item_factory(DetergentBottle)
     self.add_item_factory(EmptyCan)
     self.add_item_factory(FullCan)
     self.add_item_factory(DentedCan)
     # Flavour items
     # extra cans on shelf
     self.add_thing(
         GenericDescThing('mess.cans', 1,
                          _("A large collection of rusted, useless cans."),
                          (
                              (154, 335, 89, 106),
                              (152, 435, 63, 66),
                          )))
     self.add_thing(
         GenericDescThing('mess.broccoli', 2,
                          _("An impressively overgrown broccoli."), (
                              (503, 89, 245, 282),
                              (320, 324, 229, 142),
                          )))
Ejemplo n.º 5
0
 def get_description(self):
     if self.get_data('present') and not self.get_data('working'):
         return _("That superconductor looks burned out. It's wedged"
                  " in there pretty firmly.")
     elif not self.get_data('present'):
         return _("An empty superconductor socket")
     else:
         return _("A working superconductor.")
Ejemplo n.º 6
0
 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."))
Ejemplo n.º 7
0
 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")
Ejemplo n.º 8
0
 def get_description(self):
     status = self.state.get_jim_state()
     if status == 'online':
         return _("A security camera watches over the room")
     elif status == 'looping':
         return _("The security camera is currently offline but should be"
                  " working soon")
     else:
         return _("The security camera is powered down")
Ejemplo n.º 9
0
 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."))
Ejemplo n.º 10
0
 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."))
Ejemplo n.º 11
0
 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))
Ejemplo n.º 12
0
 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."))
Ejemplo n.º 13
0
 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."))
Ejemplo n.º 14
0
 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."))
Ejemplo n.º 15
0
 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."))
Ejemplo n.º 16
0
 def get_description(self):
     if self.get_data('status') == "blocked":
         return _("The broccoli seems to have become"
                  " entangled with something.")
     elif self.get_data("status") == "broken":
         return _("These broken pipes look important.")
     elif self.get_data("status") == "replaced":
         return _("The pipes have been repaired but are the repairs"
                  " aren't airtight, yet")
     else:
         return _("Your fix looks like it's holding up well.")
Ejemplo n.º 17
0
 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."))
Ejemplo n.º 18
0
 def setup(self):
     self.add_thing(LogTab())
     self.add_thing(AlertTab())
     self.add_thing(NavTab())
     #  Navigation buttons were implemented but then later abandoned
     #  because we couldn't think of funny enough logs. :)
     #  self.add_thing(CompUpButton())
     #  self.add_thing(CompDownButton())
     self._scene_playlist = None
     self._alert = self.get_image(self.FOLDER, self.ALERT_BASE)
     self._alert_messages = {}
     self._nav_messages = {}
     for key, text in self.ALERTS.items():
         self._alert_messages[key] = render_text(text,
                                                 'DejaVuSans-Bold.ttf', 18,
                                                 'orange', (0, 0, 0, 0),
                                                 self.resource, (600, 25),
                                                 False)
     self._nav_background = self.get_image(self.FOLDER, self.NAVIGATION)
     #  See note above about funny navigation logs
     #  for key, name in self.NAVIGATION.items():
     #      self._nav_messages[key] = self.get_image(self.FOLDER, name)
     self._nav_lines = []
     self._nav_lines.append(
         DestNavPageLine(
             1, (12, 99, 610, 25), False,
             _("1. Bounty Penal Colony Space Port, New South Australia"
               " (397 days)")))
     self._nav_lines.append(
         DestNavPageLine(2, (12, 135, 610, 25), True,
                         _("2. Hedonia Space Station (782 days)")))
     self._nav_lines.append(
         DestNavPageLine(
             3, (12, 167, 610, 25), True,
             _("3. Spinosa Health Resort, Prunus Secundus (1231 days)")))
     self._nav_lines.append(
         DestNavPageLine(
             4, (12, 203, 610, 25), True,
             _("4. Achene Space Port, Indica Prspinosame (1621 days)")))
     self._nav_lines.append(
         DestNavPageLine(
             5, (12, 239, 610, 25), True,
             _("5. Opioid Space Port, Gelatinosa Prime (1963 days)")))
     self._log_background = self.get_image(self.FOLDER, self.LOG_BACKGROUND)
     self._logs = []
     for text in self.LOGS:
         log_page = self._log_background.copy()
         log_page.blit(
             render_text(text, 'DejaVuSans-Bold.ttf', 18, 'lightgreen',
                         (0, 0, 0, 0), self.resource, (600, 25), False),
             self.ALERT_OFFSET)
         self._logs.append(log_page)
Ejemplo n.º 19
0
 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."))
Ejemplo n.º 20
0
 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)
Ejemplo n.º 21
0
 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."))
Ejemplo n.º 22
0
 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."))
Ejemplo n.º 23
0
 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."))
Ejemplo n.º 24
0
class EngineCompDetail(Scene):

    FOLDER = "engine"
    BACKGROUND = "engine_comp_detail.png"
    NAME = "engine_comp_detail"

    ALERTS = {
        'cryo leaking': _("Cryo system leaking!"),
        'cryo empty': _("Cryo reservoir empty!"),
        'super malfunction': _("Superconductor malfunction!"),
    }

    # Point to start drawing changeable alerts
    ALERT_OFFSET = (16, 100)
    ALERT_SPACING = 4

    def setup(self):
        self._alert_messages = {}
        self._alert_header = render_text(_("Alerts"), 'DejaVuSans.ttf', 27,
                                         'darkred', (0, 0, 0, 0),
                                         self.resource, (120, 33), False)
        for key, msg in self.ALERTS.items():
            self._alert_messages[key] = render_text(msg, 'DejaVuSans-Bold.ttf',
                                                    30, 'darkred',
                                                    (0, 0, 0, 0),
                                                    self.resource, (480, 33),
                                                    False)

    def _draw_alerts(self, surface):
        xpos, ypos = self.ALERT_OFFSET
        engine = self.game.scenes['engine']
        surface.blit(self._alert_header, (15, 55))
        if not engine.things['engine.cracked_pipe'].get_data('fixed'):
            image = self._alert_messages['cryo leaking']
            surface.blit(image, (xpos, ypos))
            ypos += image.get_size()[1] + self.ALERT_SPACING
        if not engine.things['engine.cryo_containers'].get_data('filled'):
            image = self._alert_messages['cryo empty']
            surface.blit(image, (xpos, ypos))
            ypos += image.get_size()[1] + self.ALERT_SPACING
        if not engine.things['engine.superconductor'].get_data('working'):
            image = self._alert_messages['super malfunction']
            surface.blit(image, (xpos, ypos))
            ypos += image.get_size()[1] + self.ALERT_SPACING

    def draw_things(self, surface):
        self._draw_alerts(surface)
        super(EngineCompDetail, self).draw_things(surface)
Ejemplo n.º 25
0
class ToEngine(DoorThing):
    "Way to engine room."

    NAME = "map.toengine"
    DEST = "engine"

    INTERACTS = {
        'door':
        InteractUnion((
            InteractNoImage(691, 279, 76, 54),
            InteractText(662, 496, 128, 33, _("Engine room"), 'white', 20,
                         'Monospace.ttf'),
        ))
    }

    INITIAL = 'door'

    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)
Ejemplo n.º 26
0
 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?"))
Ejemplo n.º 27
0
 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."))
Ejemplo n.º 28
0
 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."))
Ejemplo n.º 29
0
 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."))
Ejemplo n.º 30
0
 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."))