from basic_f import *
def calculate_hp(bag,basic):
xp=[]
for i in range(5):
xp.append(basic[i])
for i in range(len(bag[0])):
xp[0]+=bag[0][i][3][0]+bag[0][i][4][0]+bag[1][i]*2
xp[1]+=bag[0][i][3][1]+bag[0][i][4][1]+bag[1][i]*6
xp[2]+=bag[0][i][3][2]+bag[0][i][4][2]
xp[3]+=bag[0][i][3][3]+bag[0][i][4][3]
xp[4]+=bag[0][i][3][4]+bag[0][i][4][4]
for i in range(6):
xp=arrayadd(xp,bag[i+2][2])
z=bag[9][3]
xp[0]+=z[0]*(z[0]+1)*50
xp[1]+=z[0]*(z[0]+1)*150
return xp
def desteny(bag):
while 1>0 and bag[9][3][0]!=50:
x=int(bag[9][3][0]/5)+1
clear_history()
print("转生<<< (0)退出")
print(str(bag[9][3][0])+"⇒"*(10-bag[9][3][1])+str(bag[9][3][0]+1)+"转")
print("进度:"+str(bag[9][3][1])+"/10")
print("转生石"+str((x-1)*5)+"-"+str(x*5)+":",str(bag[9][4][x-1])+"/"+str(bag[9][3][0]%5+1) )
print("(1)转生")
a=int(input())
if a==0:
return bag
elif a==1 and bag[9][4][x-1]>=(bag[9][3][0]%5+1):
bag[9][4][x-1]-=(bag[9][3][0]%5+1)
bag[9][3][1]+=1
if bag[9][3][1]==10:
bag[9][3][1]=0
bag[9][3][0]+=1
if bag[9][3][0]>=50:
print("恭喜你已达到颠峰50转")
back=input()
return bag
def shop_main(bag):
page=1
while 1>0:
clear_history()
print("商店<<< (0)退出")
print("金币:"+str(bag[9][0]),"钻石:"+str(bag[9][1]))
print("(1)金币商城 (2)钻石商城")
a=int(input())
if a==0:
return bag
elif a==1:
bag=shop_coin(bag)
def shop_coin(bag):
while 1>0:
clear_history()
print("金币:"+str(bag[9][0]),"钻石:"+str(bag[9][1]))
shop_showpage(1)
a=int(input())
if a==0:
return bag
elif 1<=a<=6 and bag[9][0]>=300:
bag[9][0]-=300
bag[a+1][0][0]+=30
back=input("购买成功")
elif a==7 and bag[9][0]>=500:
bag[9][0]-=500
bag[9][2]+=30
back=input("购买成功")
elif a==8 and bag[9][0]>=3000:
bag[9][0]-=3000
print("选择对象")
print("(1)伙伴(2)异兽(3)羽翼(4)时装(5)幻武(6)阵图")
b=int(input())
if 1<=b<=6:
bag[b+1][3][randint(0,3)]+=1
back=input("购买成功")
else:
back=input("选择异常金币退回")
bag[9][0]+=3000
def shop_showpage(page):
if page==1:
print("金币商城<<< (0)退出")
print("(1)口粮*30 300金币(2)兽丹*30 300金币")
print("(2)羽毛*30 300金币(4)帆布*30 300金币")
print("(3)武石*30 300金币(6)阵图领悟*30 300金币")
print("(7)武期锻造石*30 500金币")
print("(8)充能/增益/技能礼包 3000金币")
elif page==2:
print("(1)1000金币10钻石(2)神话皮肤宝箱 300钻石")
print("(3)转生石(x-x+5转)*1 x*10钻,(x=5k,k∈N)")
def compose_main(bag):
while 1>0:
clear_history()
print("合成<<< (0)退出")
print("(1)宝箱合成")
a=int(input())
if a==0:
return bag
elif a==1:
bag=compose_chest(bag)
def compose_chest(bag):
while 1>0:
clear_history()
print("宝箱合成<<< (0)退出")
print("(1)伙伴皮肤宝箱",str(bag[9][15][0])+"/10")
print("(2)异兽皮肤宝箱",str(bag[9][16][0])+"/10")
print("(3)羽翼皮肤宝箱",str(bag[9][17][0])+"/10")
print("(4)时装皮肤宝箱",str(bag[9][18][0])+"/10")
print("(5)幻武皮肤宝箱",str(bag[9][19][0])+"/10")
print("(6)阵图皮肤宝箱",str(bag[9][20][0])+"/10")
a=int(input())
if a==0:
break
else:
if bag[9][a+14][0]>=10:
bag[9][a+14][0]-=10
bag[9][a+14][1]+=1
back=input("合成成功")
return bag
def showwp_e(wp):
print(wp[2]+str(arrayadd(wp[3],wp[4])))
def showwp(wp,ct):
print(wp[2]+":",end="")
for i in range(2):
print(ct[i]+":"+str(wp[3][i]),"+"+str(wp[4][i]),end="")
print("")
for i in range(2,5):
if wp[4][i]!=0:
print(ct[i]+"+"+str(wp[3][i]+wp[4][i])+"%",end="")
def showbag_main(rbag,bag,tz,ct):
page = 0
while 1>0:
clear_history()
print("背包<<<")
print("(0)退出")
print("(1)材料")
print("(2)装备")
a=int(input())
if a==0:
return rbag,bag
elif a==1:
bag=showbag_materical(bag)
elif a==2:
rbag[1]=sorted(rbag[1])
k=showbag_b(rbag[1],bag,ct)
rbag[1]=k[0]
bag=k[1]
def showbag_materical(bag):
while 1>0:
clear_history()
print("材料背包<<< (0)退出")
print("金币:"+str(bag[9][0]),"钻石:"+str(bag[9][1]))
print("武器锻造石:"+str(bag[9][2]))
print("(1)伙伴皮肤宝箱",str(bag[9][15][1]))
print("(2)异兽皮肤宝箱",str(bag[9][16][1]))
print("(3)羽翼皮肤宝箱",str(bag[9][17][1]))
print("(4)时装皮肤宝箱",str(bag[9][18][1]))
print("(5)幻武皮肤宝箱",str(bag[9][19][1]))
print("(6)阵图皮肤宝箱",str(bag[9][20][1]))
a=int(input())
if a==0:
return bag
elif bag[9][a+14][1]>0:
for i in range(bag[9][a+14][1]):
x=randint(0,7)
bag[a+1][1][x][1]+=1
bag[9][a+14][1]=0
def showbag_page(rbag,page):
print("bag<<< (0) exit ")
print("(1)"+rbag[page*10+0][2]+str(rbag[page*10+0][4]),"(6)"+rbag[page*10+5][2]+str(rbag[page*10+5][4]))
print("(2)"+rbag[page*10+1][2]+str(rbag[page*10+1][4]),"(7)"+rbag[page*10+6][2]+str(rbag[page*10+6][4]))
print("(3)"+rbag[page*10+2][2]+str(rbag[page*10+2][4]),"(8)"+rbag[page*10+7][2]+str(rbag[page*10+7][4]))
print("(4)"+rbag[page*10+3][2]+str(rbag[page*10+3][4]),"(9)"+rbag[page*10+8][2]+str(rbag[page*10+8][4]))
print("(5)"+rbag[page*10+4][2]+str(rbag[page*10+4][4]),"(10)"+rbag[page*10+9][2]+str(rbag[page*10+9][4]))
print("(11)⇐≃≃≃≃≃≃≃≃≃≃≃≃≃≃⇒(12)")
def showbag_b(rbag,bag,ct):
page=0
x=len(rbag)
if x%10!=0:
m=x%10
for i in range(10-m):
rbag.append([0,0,"空缺",[0,0,0,0,0],[0,0,0,0,0]])
elif x==0:
for i in range(10):
rbag.append([0,0,"空缺",[0,0,0,0,0],[0,0,0,0,0]])
while 1>0:
clear_history()
showbag_page(rbag,page)
a=int(input())
if a==0:
rbag=remove(rbag,[0,0,"空缺",[0,0,0,0,0],[0,0,0,0,0]])
return sorted(rbag),bag
elif 1<=a<=10:
showwp(rbag[page*10-1+a],ct)
showwp_e(bag[0][rbag[page*10-1+a][1]-1])
b=int(input("(1)穿戴(2)回收(3)退出"))
if b==1:
change=rbag[page*10-1+a]
rbag[page*10-1+a]=bag[0][rbag[page*10-1+a][1]-1]
bag[0][rbag[page*10-1+a][1]-1]=change
if rbag[page*10-1+a][2]=="空缺":
rbag.remove([0,rbag[page*10-1+a][1],"空缺",[0,0,0,0,0],[0,0,0,0,0]])
rbag.append([0,0,"空缺",[0,0,0,0,0],[0,0,0,0,0]])
elif b==2 and rbag[page*10-1+a][2]!="空缺":
bag[9][0]+=(100+50*rbag[page*10-1+a][0])
if rbag[page*10-1+a][0]>3:
bag[9][1]+=5*(3-rbag[page*10-1+a][0])
bag[9][2]+=rbag[page*10-1+a][0]
rbag.remove(rbag[page*10-1+a])
rbag.append([0,0,"空缺",[0,0,0,0,0],[0,0,0,0,0]])
back=input("回收成功")
elif b==2 and rbag[page*10-1+a][2]=="空缺":
back=input("此格背包为空")
elif a==11 and page!=0:
page-=1
elif a==12 and page+1<len(rbag)/10:
page+=1
elif a==13:
for i in range(len(rbag)):
print(rbag[i][2],end=" ")
if rbag[i][2]!="空缺":
bag[9][0]+=(100+50*rbag[i][0])
if rbag[i][0]>3:
bag[9][1]+=5*(3-i)
bag[9][2]+=rbag[i][0]
rbag.remove(rbag[i])
rbag.append([0,0,"空缺",[0,0,0,0,0],[0,0,0,0,0]])
print(i,end=",")
back=input("回收成功")
def people(user,name,bag,ct,basic):
hp=calculate_hp(bag,basic)
clear_history()
while 1>0:
print(user,"<<<")
print("(0)退出","攻击:"+show_num(hp[0])+"hp:"+show_num(hp[1]),bag[5][4])
print("(1)+"+str(bag[1][0])+name[1]+" (5)+"+str(bag[1][4])+name[5],bag[6][4])
print("(2)+"+str(bag[1][1])+name[2]+" (6)+"+str(bag[1][5])+name[6],bag[4][4])
print("(3)+"+str(bag[1][2])+name[3]+" (7)+"+str(bag[1][6]
没有合适的资源?快使用搜索试试~ 我知道了~
自己用python制作的文字版控制台传奇,功能比较丰富(原创,仅供学习,请勿抄袭和传播)
![preview](https://csdnimg.cn/release/downloadcmsfe/public/img/white-bg.ca8570fa.png)
共7个文件
py:7个
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
需积分: 0 1 下载量 36 浏览量
2024-07-14
16:54:10
上传
评论
收藏 12KB ZIP 举报
温馨提示
简要总结和内容描述: main.py: 这个游戏的主控脚本,负责游戏循环和用户界面显示。它提供了一个菜单系统,允许玩家选择不同的游戏功能,如背包、地图、锻造、商店等。 duplicate.py: 包含有关游戏内“副本”或“挑战”的逻辑。玩家可以挑战不同难度的副本,并根据挑战结果获得奖励或遭受失败。 mob.py: 定义了一个Mob类,可能用于处理游戏中的怪物或其他角色。此类包含有关角色生命值计算、经验处理和皮肤系统的方法。 fight.py: 包含战斗系统的代码,允许玩家与怪物战斗,并根据战斗结果获得奖励。 unfight.py: 包含非战斗相关的功能,如计算角色的生命值、转生系统、商店界面和合成系统。 data.py: 包含游戏的初始数据和一些全局变量,如角色基本属性、背包内容、用户名称、怪物类型和地图数据。 basic_f.py: 提供了一些基础函数,如数组求和、数组相加、数组相乘、移除数组中的元素、展示装备属性和数值显示等。 脚本共同构成了一个具有角色扮演元素的游戏,包括战斗、装备、升级、转生和资源管理等系统。代码中使用了大量的列表和数组来存储游戏状态和玩家数据,并
资源推荐
资源详情
资源评论
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083646.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![zip](https://img-home.csdnimg.cn/images/20210720083646.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![exe](https://img-home.csdnimg.cn/images/20210720083343.png)
![zip](https://img-home.csdnimg.cn/images/20210720083646.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083646.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 7 条
- 1
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/1861bdcdff1a441992a1dfa7f89a72ce_lusen_j.jpg!1)
lusen_lzn
- 粉丝: 84
- 资源: 3
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)