- 1 #!usr/bin/env python
- 2 # -*- coding:utf-8 -*-
- 3 # auther:Mr.chen
- 4 # 描述:
- 5
- 6 import time,os,sys
- 7sys.path.append('..')
- 8 fromlibimport common
- 9 # from lib.Players_model import players_Model
- 10DIR = os.path.dirname(__file__)
- 11DIR = DIR.replace('src','db/')
- 12TAG = True
- 13
- 14
- 15 def Pre_chapter(user):
- 16time.sleep(2)
- 17title ="""
- 18 * * * * * * * * * * * * * * * * * * * * * * *预章:传说* * * * * * * * * * * * * * * * * * * * * * *
- 19 """
- 20 print (title)
- 21time.sleep(5)
- 22text ="""
- 23 相传很久以前,于古国疆域,有一奇人姓夸名父.
- 24 以大力闻于世间,以才智惊于圣贤,以风韵传于万载..
- 25 忽一日,慕之者至.询问之,其曰...
- 26 吾父乃真之才,生于凡中.无师而达天地...
- 27 终其一生教化万民,此乃吾真之所持..
- 28 父之事迹.且听我慢慢道来...
- 29
- 30 """
- 31 foriintext.decode('utf-8'):
- 32 ifi !=' ':
- 33time.sleep(0.5)
- 34 printi.encode('utf-8'),
- 35 else:
- 36 printi.encode('utf-8'),
- 37 The_first_chapter(user)
- 38
- 39
- 40 def The_first_chapter(user):
- 41
- 42 # dict = common.log_info_read(DIR + 'config_conf')
- 43 # for S in dict['students']:
- 44 # if S.Name == user.Name:
- 45time.sleep(2)
- 46introduce ="""
- 47 登场人物介绍
- 48
- 49 姓名:{0}
- 50 年龄:{1}
- 51 国籍:{2}
- 52 特长:{3}
- 53 体力:{4}
- 54 武力:{5}
- 55 智力:{6}
- 56 魅力:{7}
- 57 秘籍:无
- 58
- 59 点评:屌丝,唯撩妹甚
- 60
- 61 姓名:灵儿
- 62 年龄:22
- 63 国籍:china
- 64 特长:
- 65 体力:1000
- 66 武力:70
- 67 智力:70
- 68 魅力:100
- 69 秘籍:游戏保护,万法不侵
- 70
- 71 点评:白富美
- 72 """.format(user.Name,user.Age,user.Nationality,user.Specialty,user.Strength,user.Force,user.IQ,user.Charm)
- 73 foriinintroduce.decode('utf-8'):
- 74 ifi !=' ':
- 75time.sleep(0.2)
- 76 printi.encode('utf-8'),
- 77 else:
- 78 printi.encode('utf-8'),
- 79time.sleep(2)
- 80title ="""
- 81 * * * * * * * * * * * * * * * * * * * * * * *第一章:缘启* * * * * * * * * * * * * * * * * * * * * * *
- 82 """
- 83 print (title)
- 84time.sleep(5)
- 85text ="""
- 86 我的父亲叫做{0},本是一介草民,少时机缘之下,
- 87 救助了一个跳河自杀之人,本也并无所求,只因
- 88 我父那时在河中捕鱼,闲河中波澜太盛,吓跑鱼儿,
- 89 故,救之,以安抚鱼心。谁想此人竟是一小门派
- 90 掌教之子,因修炼走火,盲目间跌落河中。恰逢我父
- 91 出海,机缘所致,掌教有感我父恩德,故收其为徒,
- 92 传功授法,指引修行。说来也怪,我父不论武力{1},
- 93 智力{1}魅力{2}尽数低于常人,但唯独撩妹能力
- 94 极其出众,故派中最小师妹灵儿常伴左右,个中滋味
- 95 不足为外人道也。
- 96
- 97
- 98 """.format(user.Name,user.Force,user.IQ,user.Charm)
- 99 foriintext.decode('utf-8'):
- 100 ifi !=' ':
- 101time.sleep(0.5)
- 102 printi.encode('utf-8'),
- 103 else:
- 104 printi.encode('utf-8'),
- 105 The_second_chapter(user)
- 106
- 107
- 108 def The_second_chapter(user):
- 109time.sleep(2)
- 110introduce ="""
- 111 登场人物介绍
- 112
- 113 姓名:高富帅
- 114 年龄:34
- 115 国籍:china
- 116 特长:有钱有势
- 117 体力:1000
- 118 武力:70
- 119 智力:70
- 120 魅力:70
- 121 秘籍:无
- 122
- 123 点评:如其名
- 124
- 125
- 126 """
- 127 foriinintroduce.decode('utf-8'):
- 128 ifi !=' ':
- 129time.sleep(0.2)
- 130 printi.encode('utf-8'),
- 131 else:
- 132 printi.encode('utf-8'),
- 133time.sleep(2)
- 134title ="""
- 135 * * * * * * * * * * * * * * * * * * * * * * *第二章:幻灭* * * * * * * * * * * * * * * * * * * * * * *
- 136 """
- 137 print (title)
- 138time.sleep(5)
- 139text ="""
- 140 我父和灵儿就这样朝夕相处,日久生情,只待谈婚论嫁之时。
- 141 但,世事难料。一日,掌门大寿,宴请四方,祝寿者繁多。
- 142 有一人姓高名富帅,乃当朝一品大员之子,见灵儿貌美,
- 143 意欲图之。在其下手一刻,幸被我父所阻,于是心生恨意,
- 144 命其下人,禀报大员,以圣上赐婚为由,向掌门施压。怎料,
- 145 掌门欲息事宁人,遂命灵儿随高富帅回京,奉旨完婚。师命
- 146 难违,灵儿纵千般不愿,亦感无可奈何。临行前,挥泪别过,
- 147 劝我父放下仇恨,勿思勿念。我父伤心之余,亦感自身渺小。
- 148 暗发宏愿,以期报仇雪恨,救灵儿于水火之间。
- 149 """
- 150 foriintext.decode('utf-8'):
- 151 ifi !=' ':
- 152time.sleep(0.5)
- 153 printi.encode('utf-8'),
- 154 else:
- 155 printi.encode('utf-8'),
- 156 The_third_chapter(user)
- 157
- 158 def The_third_chapter(user):
- 159time.sleep(2)
- 160title ="""
- 161 * * * * * * * * * * * * * * * * * * * * * * *第三章:暗涛* * * * * * * * * * * * * * * * * * * * * * *
- 162 """
- 163 print (title)
- 164time.sleep(5)
- 165text ="""
- 166 灵儿事毕,我父再无心静修,辞别掌教,下山入世。
- 167 得一高人指点,拜于一隐门之中,勤学苦练,终得
- 168 真传。我父正欲出山报仇,被隐门上士所阻,言道
- 169 京城宦官家有一大内高手田伯光,武力高达90有余,
- 170 欲胜之需闯本门的锁妖塔拿一绝世宝物(双倍暴击率)
- 171 方可成行。
- 172 """
- 173 foriintext.decode('utf-8'):
- 174 ifi !=' ':
- 175time.sleep(0.5)
- 176 printi.encode('utf-8'),
- 177 else:
- 178 printi.encode('utf-8'),
- 179time.sleep(2)
- 180 while TAG:
- 181text ="""
- 182 剧情分支选择如下:
- 183 1,听劝
- 184 2,不听劝
- 185
- 186 """
- 187 print (text)
- 188choose = raw_input("请输入索引进行选择")
- 189 ifchoose =='1':
- 190 Lock_demon_tower(user)
- 191 elifchoose =='2':
- 192 Fail_ending_one()
- 193 else:
- 194 print("你的选择有误!")
- 195
- 196
- 197
- 198 def Lock_demon_tower(user):
- 199List = []
- 200dict = common.log_info_read(DIR +'config_conf')
- 201 forpobjindict['players']:
- 202 ifpobj.Name == user.Name:
- 203P = pobj
- 204
- 205time.sleep(2)
- 206title ="""
- 207 * * * * * * * * * * * * * * * * * * * * * * *第四章:勇闯锁妖塔* * * * * * * * * * * * * * * * * * * * * * *
- 208 """
- 209 print (title)
- 210time.sleep(5)
- 211text ="""
- 212 反复思量,我父还是决定暂缓报仇,遵从隐士的看法,
- 213 独自一人来到锁妖塔前,看者前方雄伟的高达{0}
- 214 层的锁妖塔,暗下决心,要尽快完成闯塔拿到宝物.
- 215 于是,我父来到了塔下的驿站里...
- 216 """.format(str(len(user.Tlist_obj)))
- 217 foriintext.decode('utf-8'):
- 218 ifi !=' ':
- 219time.sleep(0.5)
- 220 printi.encode('utf-8'),
- 221 else:
- 222 printi.encode('utf-8'),
- 223 while TAG:
- 224test ="""
- 225 请问现在你想去哪?
- 226 1,闯塔
- 227 2,打开背包(吃药) 你还有{0}体力
- 228 3,不闯了,直接去报仇
- 229 """.format(str(P.Strength))
- 230 print (test)
- 231choose = raw_input("请输入索引进行选择:")
- 232num = 0
- 233bum = 0
- 234 ifchoose =='1':
- 235 fortobjindict['towers']:
- 236 ifP.schedule[tobj] == 100:
- 237schedule ='已达成'
- 238bum += 1239 else:
- 240schedule = P.schedule[tobj]
- 241 print("{0},{1},难度系数:{2},进度率:{3}%,创塔次数:{4}次".format(str(num+1),tobj.Lname,tobj.Difficulty,str(schedule),str(P.num[tobj])))
- 242 ifbum == len(P.Tlist_obj):
- 243 print("{0},锁妖塔顶层,难度系统:0".format(str(num+2)))
- 244num += 1245 List.append(str(num))
- 246decide = raw_input("请输入索引进行选择:")
- 247 ifdecide == str(len(P.Tlist_obj)+1)andbum == len(P.Tlist_obj):
- 248 Lock_demon_tower_Top(user)
- 249 ifdecidein List:
- 250 ifP.schedule[dict['towers'][int(decide)-1]] < 100:
- 251 foriinrange(10):
- 252re = P.Begins(dict['towers'][int(decide)-1])
- 253 ifre == False:
- 254common.log_info_write(DIR +'config_conf', dict)
- 255 break
- 256 else:
- 257common.log_info_write(DIR +'config_conf', dict)
- 258 else:
- 259 print("本层已经闯过了!")
- 260 else:
- 261 print("你的输入有误!")
- 262
- 263
- 264 elifchoose =='2':
- 265 while TAG:
- 266text ="""
- 267 背囊物品如下: 你还有{0}体力
- 268 1,大还丹:{1}个
- 269 2,小还丹 {2}个
- 270 """.format(str(P.Strength),str(P.Item['大还丹']),str(P.Item['大还丹']))
- 271 print (text)
- 272choose = raw_input("请输入索引进行选择:")
- 273 ifchoose =='1':
- 274 ifP.Item['大还丹'] > 0 :
- 275P.Item['大还丹'] -= 1276P.Strength += 500277common.log_info_write(DIR +'config_conf', dict)
- 278 break
- 279 else:
- 280 print("大还丹个数为0")
- 281 break
- 282 elifchoose =='2':
- 283 ifP.Item['小还丹'] > 0:
- 284P.Item['小还丹'] -= 1285P.Strength += 200286common.log_info_write(DIR +'config_conf', dict)
- 287 break
- 288 else:
- 289 print("小还丹个数为0")
- 290 break
- 291 else:
- 292 print("你的输入有误!请重新输入!")
- 293
- 294 elifchoose =='3':
- 295 Fail_ending_one()
- 296 else:
- 297 print("你的输入有误!")
- 298
- 299
- 300 def Lock_demon_tower_Top(user):
- 301dict = common.log_info_read(DIR +'config_conf')
- 302 forpobjindict['players']:
- 303 ifpobj.Name == user.Name:
- 304P = pobj
- 305time.sleep(2)
- 306title ="""
- 307 * * * * * * * * * * * * * * * * * * * * * * *第五章:锁妖塔顶* * * * * * * * * * * * * * * * * * * * * * *
- 308 """
- 309 print (title)
- 310time.sleep(5)
- 311text ="""
- 312 克服磨难,吾父终至,锁妖塔顶。与前相比,此地奇静。
- 313 地方不大,有水缸一口,两人高有余。好奇之下,
- 314 侧身观之,怎料竟有活人居于缸内,遂上前,救出。
- 315 原来此人就是灵儿。询问下,方知,那日毕,其心已死,
- 316 趁高富帅不备,遂逃出,寻短见,幸被隐门上士所救,居
- 317 此疗伤,恰逢我父闯塔,喜得相逢。至此,我父恍然,直呼,
- 318 此宝胜万宝也(主角瞬间满怒体力翻倍)
- 319 """
- 320 foriintext.decode('utf-8'):
- 321 ifi !=' ':
- 322time.sleep(0.5)
- 323 printi.encode('utf-8'),
- 324 else:
- 325 printi.encode('utf-8'),
- 326P.Strength = P.Strength * 2327common.log_info_write(DIR +'config_conf', dict)
- 328 Wu_Duo(user)
- 329
- 330
- 331 def Wu_Duo(user):
- 332
- 333
- 334time.sleep(2)
- 335title ="""
- 336 * * * * * * * * * * * * * * * * * * * * * * *终章:武夺* * * * * * * * * * * * * * * * * * * * * * *
- 337 """
- 338 print (title)
- 339time.sleep(5)
- 340text ="""
- 341 经过不懈的努力,战胜了诸多困苦(实在懒得编了),
- 342 我们的主角终于和美女团结友爱的在一起生活,剧终
- 343
- 344 """
- 345 foriintext.decode('utf-8'):
- 346 ifi !=' ':
- 347time.sleep(0.5)
- 348 printi.encode('utf-8'),
- 349 else:
- 350 printi.encode('utf-8'),
- 351 exit()
- 352
- 353
- 354
- 355 def Fail_ending_one():
- 356
- 357
- 358
- 359time.sleep(2)
- 360title ="""
- 361 * * * * * * * * * * * * * * * * * * * * * * *终章:武夺* * * * * * * * * * * * * * * * * * * * * * *
- 362 """
- 363 print (title)
- 364time.sleep(5)
- 365text ="""
- 366 报仇心切,我父终是不肯听劝,遂一人趁夜逃出隐门,
- 367 数日后,进京踩点,待万事俱备只欠东风之时,奈何
- 368 大员祖宅大内高手,先知先觉,早已暗随我父三日有余,
- 369 眼见我父正待出手,遂突袭之,我父重伤,感叹报仇无望,
- 370 自此隐居山林,不问世事.....BAD END......
- 371
- 372 """
- 373 foriintext.decode('utf-8'):
- 374 ifi !=' ':
- 375time.sleep(0.5)
- 376 printi.encode('utf-8'),
- 377 else:
- 378 printi.encode('utf-8'),
- 379exit()
来源: http://www.bubuko.com/infodetail-1869267.html