|
| 1 | +#coding:utf-8 |
| 2 | +class Room(object): |
| 3 | + |
| 4 | + def __init__(self, name, description): |
| 5 | + self.name = name |
| 6 | + self.description = description |
| 7 | + self.paths = {} |
| 8 | + |
| 9 | + # 返回依据direction在paths中的到的值 |
| 10 | + def go(self, direction): |
| 11 | + return self.paths.get(direction, None) |
| 12 | + |
| 13 | + # 给paths赋值 |
| 14 | + def add_paths(self, paths): |
| 15 | + self.paths.update(paths) |
| 16 | + |
| 17 | + |
| 18 | +central_corridor = Room("Central Corridor", |
| 19 | +""" |
| 20 | +行星Percal#25 Gothons已经侵入你的飞船,销毁 |
| 21 | +了你的所有船员。你是最后生存者,你的最后 |
| 22 | +任务是从武器军械库获得中子毁灭炸弹, |
| 23 | +把它放在桥梁,引爆它并成功进入 |
| 24 | +逃生舱逃生。 |
| 25 | +
|
| 26 | +当你通过中央走廊向武器仓库跑去的时候, |
| 27 | +一个Gothon跳出,鳞状皮肤红,黑肮脏的牙齿,和邪恶的小丑服装 |
| 28 | +流动围绕着他充满仇恨的身体。他堵大门 |
| 29 | +(The Gothons of Planet Percal #25 have invaded your ship and destroyed |
| 30 | +your entire crew. You are the last surviving member and your last |
| 31 | +mission is to get the neutron destruct bomb from the Weapons Armory, |
| 32 | +put it in the bridge,and blow the ship up after getting into an |
| 33 | +escape pod. |
| 34 | +
|
| 35 | +You're running down the central corridor to the Weapons Armory when |
| 36 | +a Gothon jumps out, red scaly skin, dark grimy teeth, and evil clown costume |
| 37 | +flowing around his hate filled body. He's blocking the door to the) |
| 38 | +""") |
| 39 | + |
| 40 | +laser_weapon_armory = Room("Laser Weapon Armory", |
| 41 | +""" |
| 42 | +你是幸运的,他们让你学会Gothon侮辱的学院。 |
| 43 | +你讲一个你知道的笑话给Gothon: |
| 44 | +Lbhe zbgure vf fb sng, jura fur fvgf nebhaq gur ubhfr, fur fvgf nebhag gur ubhfr。 |
| 45 | +Gothon停止,尽量不笑,然后爆发出大笑,无法动弹。 |
| 46 | +在他的笑的时候你跑起来拍他的头部 |
| 47 | +把他打倒,然后跳进武器军械库的门。 |
| 48 | +
|
| 49 | +你你翻身滚进武器兵工厂,蹲下以及扫描这个房间 |
| 50 | +寻找可能隐藏着的Gothons。这里死一般的安静,太安静了。 |
| 51 | +你站起来,跑到房间的另一边,并找到 |
| 52 | +获得炸弹需要的代码。如果你得到的代码 |
| 53 | +错10次那么锁将永远关闭,你就不能 |
| 54 | +拿到炸弹。代码是3位数的。 |
| 55 | +(Lucky for you they made you learn Gothon insults in the academy. |
| 56 | +You tell the one Gothon joke you know: |
| 57 | +Lbhe zbgure vf fb sng, jura fur fvgf nebhaq gur ubhfr, fur fvgf nebhag gur ubhfr. |
| 58 | +The Gothon stops, tries not to laugh, then busts out laughing and can't move. |
| 59 | +While he's laughing you run up and shoot him square in the head |
| 60 | +putting him down, then jump through the Weapon Armory door. |
| 61 | +
|
| 62 | +You do a dive roll into the Weapon Armory, crouch and scan the room |
| 63 | +for more Gothons that might be hiding. It's dead quiet, too quiet. |
| 64 | +You stand up and run to the far side of the room and find the |
| 65 | +and you need the code to get the bomb out. If you get the code |
| 66 | +wrong 10 times then the lock closes forever and you can't |
| 67 | +get the bomb. The code is 3 digits.) |
| 68 | +""") |
| 69 | + |
| 70 | + |
| 71 | +the_bridge = Room("The Bridge", |
| 72 | +""" |
| 73 | +该容器点击打开,密封断开,让气体出来。 |
| 74 | +你拿起中子弹和拼锦全力的跑,你可以到 |
| 75 | +桥,你必须将其放置在正确的位置。 |
| 76 | +
|
| 77 | +你用胳膊夹着炸弹,5个试图占领 |
| 78 | +飞船的控制权的Gothons。他们每个人都有一个更丑陋 |
| 79 | +小丑服装对比之前。他们没有拿出自己 |
| 80 | +武器出来呢,因为他们看到在活动的炸弹 |
| 81 | +手臂,不希望被炸死。 |
| 82 | +(The container clicks open and the seal breaks, letting gas out. |
| 83 | +You grab the neutron bomb and run as fast as you can to the |
| 84 | +bridge where you must place it in the right spot. |
| 85 | +
|
| 86 | +You burst onto the Bridge with the netron destruct bomb |
| 87 | +under your arm and surprise 5 Gothons who are trying to |
| 88 | +take control of the ship. Each of them has an even uglier |
| 89 | +clown costume than the last. They haven't pulled their |
| 90 | +weapons out yet,as they see the active bomb under your |
| 91 | +arm and don't want to set it off.) |
| 92 | +""") |
| 93 | +escape_pod = Room("Escape Pod", |
| 94 | +""" |
| 95 | +你全部寄托在你的胳膊夹着的原子弹 |
| 96 | +Gothons举起他们的手,开始流口水。 |
| 97 | +你快速到达门口,打开它,然后仔细地 |
| 98 | +把炸弹放置在地板上,就指着你的炸弹了。 |
| 99 | +之后你跳回到门外,按下了关闭按钮 |
| 100 | +和摧毁了锁使Gothons无法通过。 |
| 101 | +现在,炸弹被放置好了,你逃到了逃生舱,以 |
| 102 | +逃离,这个铁罐(飞船)。 |
| 103 | +
|
| 104 | +你急于飞船,拼命取保飞船爆炸前 |
| 105 | +到达逃生舱。好像 |
| 106 | +几乎没有任何Gothons在船上,所以你逃跑时没有任何 |
| 107 | +干扰。你到达了逃生舱的房间,现在 |
| 108 | +需要选择一个上去。他们中的一些可能是损坏的 |
| 109 | +但你没有时间去仔细看。有艘逃生艇,你打算上 |
| 110 | +那个? |
| 111 | +(You point your blaster at the bomb under your arm |
| 112 | +and the Gothons put their hands up and start to sweat. |
| 113 | +You inch backward to the door, open it, and then carefully |
| 114 | +place the bomb on the floor, pointing your blaster at it. |
| 115 | +You then jump back through the door, punch the close button |
| 116 | +and blast the lock so the Gothons can't get out. |
| 117 | +Now that the bomb is placed you run to the escape pod to |
| 118 | +get off this tin can. |
| 119 | +
|
| 120 | +You rush through the ship desperately trying to make it to |
| 121 | +the escape pod before the whole ship explodes. It seems like |
| 122 | +hardly any Gothons are on the ship, so your run is clear of |
| 123 | +interference. You get to the chamber with the escape pods, and |
| 124 | +now need to pick one to take. Some of them could be damaged |
| 125 | +but you don't have time to look. There's 5 pods, which on |
| 126 | +do you take?) |
| 127 | +""") |
| 128 | + |
| 129 | + |
| 130 | +the_end_winner = Room("The End", |
| 131 | +""" |
| 132 | +你跳进2号逃生舱,按下弹出按钮。 |
| 133 | +该逃生舱很容易滑出到太空 |
| 134 | +前往下面的星球。当它飞向地球时,你回头 |
| 135 | +看,会发现你的船爆炸时像 |
| 136 | +一颗明亮的星星,于此同时逃出了Gothon的飞船。你赢了! |
| 137 | +(You jump into pod 2 and hit the ejext button. |
| 138 | +The pod easily slides out into space heading to |
| 139 | +the planet below. As it flies to the planet, you look |
| 140 | +back and see your ship implode then explode like a |
| 141 | +bright star, taking out the Gothon ship at the same |
| 142 | +time. You won!) |
| 143 | +""") |
| 144 | + |
| 145 | + |
| 146 | +the_end_loser = Room("The End", |
| 147 | +""" |
| 148 | +你随机跳进一个逃生舱按下弹出按钮。 |
| 149 | +该逃生舱掉进了空间空隙,然后 |
| 150 | +船体破裂爆炸了,你的身体粉碎成了 |
| 151 | +果酱果冻。 |
| 152 | +(You jump into a random pod and hit the eject button. |
| 153 | +The pod escapes out into the void of space, then |
| 154 | +impolodes as the hull ruptures, crushing your body |
| 155 | +into jam jelly.) |
| 156 | +""") |
| 157 | + |
| 158 | +escape_pod.add_paths({ |
| 159 | + '2': the_end_winner, |
| 160 | + '*': the_end_loser |
| 161 | +}) |
| 162 | + |
| 163 | +generic_death = Room("death", "You died.") |
| 164 | + |
| 165 | +the_bridge.add_paths({ |
| 166 | + 'throw the bomb': generic_death, |
| 167 | + 'slowly place the bomb': escape_pod |
| 168 | +}) |
| 169 | + |
| 170 | +laser_weapon_armory.add_paths({ |
| 171 | + '0132': the_bridge, |
| 172 | + '*': generic_death |
| 173 | +}) |
| 174 | + |
| 175 | +central_corridor.add_paths({ |
| 176 | + 'shoot!': generic_death, |
| 177 | + 'dodge!': generic_death, |
| 178 | + 'tell a joke': laser_weapon_armory |
| 179 | +}) |
| 180 | + |
| 181 | +START = central_corridor |
0 commit comments