class Game_person:
def __init__(self,name,sex,age,fighting):
self.G_name = name
self.G_sex = sex
self.G_age = age
self.G_fighting = fighting
def Game_scene1(self):
self.G_fighting = self.G_fighting - 200
return self.G_fighting
def Game_scene2(self):
self.G_fighting = self.G_fighting + 100
return self.G_fighting
def Game_scene3(self):
self.G_fighting = self.G_fighting -500
return self.G_fighting
player1 = Game_person('小A','女',18,1000)
player2 = Game_person('小B','男',20,1800)
player3 = Game_person('小C','女',19,2500)
print("-"*10 + "游戏开始" +"-"*10)
print("请选择游戏人物:")
print("1."+"小A,女,18,初始战斗力1000")
print("2."+"小B,男,20,初始战斗力1800")
print("3."+"小C,女,19,初始战斗力2500")
figure = int(input())
if figure == 1:
print("请选择游戏场景:(1.草丛战斗 2.自我修炼 3. 多人游戏)")
scene1 = int(input())
while scene1 == 1:
player1.Game_scene1()
print("战斗结束"+"\n",player1.G_name,player1.G_sex,player1.G_age,"剩余战斗力:",player1.G_fighting)
if player1.G_fighting <=0 :
print("战斗力小于0,游戏结束")
break
print("是否继续:1.继续 2.退出")
continue1 = int(input())
if continue1 == 1:
print("请选择游戏场景:(1.草丛战斗 2.自我修炼 3. 多人游戏)")
scene1 = int(input())
if scene1 == 2:
player1.Game_scene2()
print("修炼结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
print("是否继续:1.继续 2.退出")
continue2 = int(input())
if continue2 == 1:
print("请选择游戏场景:(1.草丛战斗 2.自我修炼 3. 多人游戏)")
scene1 = int(input())
else : break
if scene1 == 3:
player1.Game_scene3()
print("游戏结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
if scene1 == 2:
player1.Game_scene2()
print("修炼结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
if scene1 == 1:
player1.Game_scene1()
print("游戏结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
print("是否继续:1.继续 2.退出")
continue2 = int(input())
if continue2 == 1:
print("请选择游戏场景:(1.草丛战斗 2.自我修炼 3. 多人游戏)")
scene1 = int(input())
else:
break
else : break
while scene1 == 2:
player1.Game_scene2()
print("修炼结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
print("是否继续:1.继续 2.退出")
continue2 = int(input())
if continue2 == 1:
print("请选择游戏场景:(1.草丛战斗 2.自我修炼 3. 多人游戏)")
scene1 = int(input())
else:
break
if scene1 == 3:
player1.Game_scene3()
print("游戏结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
if scene1 == 2:
player1.Game_scene2()
print("游戏结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
if scene1 == 1:
player1.Game_scene1()
print("游戏结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
print("是否继续:1.继续 2.退出")
continue2 = int(input())
if continue2 == 1:
print("请选择游戏场景:(1.草丛战斗 2.自我修炼 3. 多人游戏)")
scene1 = int(input())
else:
break
while scene1 == 3:
player1.Game_scene3()
print("游戏结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
print("是否继续:1.继续 2.退出")
continue2 = int(input())
if continue2 == 1:
print("请选择游戏场景:(1.草丛战斗 2.自我修炼 3. 多人游戏)")
scene1 = int(input())
else:
break
if scene1 == 3:
player1.Game_scene3()
print("游戏结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
if scene1 == 2:
player1.Game_scene2()
print("游戏结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
if scene1 == 3:
player1.Game_scene3()
print("游戏结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
print("是否继续:1.继续 2.退出")
continue2 = int(input())
if continue2 == 1:
print("请选择游戏场景:(1.草丛战斗 2.自我修炼 3. 多人游戏)")
scene1 = int(input())
else:
break
if figure == 2:
print("请选择游戏场景:(1.草丛战斗 2.自我修炼 3. 多人游戏)")
scene1 = int(input())
while scene1 == 1:
player1.Game_scene1()
print("战斗结束"+"\n",player1.G_name,player1.G_sex,player1.G_age,"剩余战斗力:",player1.G_fighting)
if player1.G_fighting <=0 :
print("战斗力小于0,游戏结束")
break
print("是否继续:1.继续 2.退出")
continue1 = int(input())
if continue1 == 1:
print("请选择游戏场景:(1.草丛战斗 2.自我修炼 3. 多人游戏)")
scene1 = int(input())
if scene1 == 2:
player1.Game_scene2()
print("修炼结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
print("是否继续:1.继续 2.退出")
continue2 = int(input())
if continue2 == 1:
print("请选择游戏场景:(1.草丛战斗 2.自我修炼 3. 多人游戏)")
scene1 = int(input())
else : break
if scene1 == 3:
player1.Game_scene3()
print("游戏结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
if scene1 == 2:
player1.Game_scene2()
print("修炼结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
if scene1 == 1:
player1.Game_scene1()
print("游戏结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
print("是否继续:1.继续 2.退出")
continue2 = int(input())
if continue2 == 1:
print("请选择游戏场景:(1.草丛战斗 2.自我修炼 3. 多人游戏)")
scene1 = int(input())
else:
break
else : break
while scene1 == 2:
player1.Game_scene2()
print("修炼结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
print("是否继续:1.继续 2.退出")
continue2 = int(input())
if continue2 == 1:
print("请选择游戏场景:(1.草丛战斗 2.自我修炼 3. 多人游戏)")
scene1 = int(input())
else:
break
if scene1 == 3:
player1.Game_scene3()
print("游戏结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
if scene1 == 2:
player1.Game_scene2()
print("游戏结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
if scene1 == 1:
player1.Game_scene1()
print("游戏结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
print("是否继续:1.继续 2.退出")
continue2 = int(input())
if continue2 == 1:
print("请选择游戏场景:(1.草丛战斗 2.自我修炼 3. 多人游戏)")
scene1 = int(input())
else:
break
while scene1 == 3:
player1.Game_scene3()
print("游戏结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
print("是否继续:1.继续 2.退出")
continue2 = int(input())
if continue2 == 1:
print("请选择游戏场景:(1.草丛战斗 2.自我修炼 3. 多人游戏)")
scene1 = int(input())
else:
break
if scene1 == 3:
player1.Game_scene3()
print("游戏结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
if scene1 == 2:
player1.Game_scene2()
print("游戏结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
if scene1 == 3:
player1.Game_scene3()
print("游戏结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
print("是否继续:1.继续 2.退出")
continue2 = int(input())
if continue2 == 1:
print("请选择游戏场景:(1.草丛战斗 2.自我修炼 3. 多人游戏)")
scene1 = int(input())
else:
break
if figure == 3:
print("请选择游戏场景:(1.草丛战斗 2.自我修炼 3. 多人游戏)")
scene1 = int(input())
while scene1 == 1:
player1.Game_scene1()
print("战斗结束"+"\n",player1.G_name,player1.G_sex,player1.G_age,"剩余战斗力:",player1.G_fighting)
if player1.G_fighting <=0 :
print("战斗力小于0,游戏结束")
break
print("是否继续:1.继续 2.退出")
continue1 = int(input())
if continue1 == 1:
print("请选择游戏场景:(1.草丛战斗 2.自我修炼 3. 多人游戏)")
scene1 = int(input())
if scene1 == 2:
player1.Game_scene2()
print("修炼结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
print("是否继续:1.继续 2.退出")
continue2 = int(input())
if continue2 == 1:
print("请选择游戏场景:(1.草丛战斗 2.自我修炼 3. 多人游戏)")
scene1 = int(input())
else : break
if scene1 == 3:
player1.Game_scene3()
print("游戏结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
if scene1 == 2:
player1.Game_scene2()
print("修炼结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
if scene1 == 1:
player1.Game_scene1()
print("游戏结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
print("是否继续:1.继续 2.退出")
continue2 = int(input())
if continue2 == 1:
print("请选择游戏场景:(1.草丛战斗 2.自我修炼 3. 多人游戏)")
scene1 = int(input())
else:
break
else : break
while scene1 == 2:
player1.Game_scene2()
print("修炼结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
print("是否继续:1.继续 2.退出")
continue2 = int(input())
if continue2 == 1:
print("请选择游戏场景:(1.草丛战斗 2.自我修炼 3. 多人游戏)")
scene1 = int(input())
else:
break
if scene1 == 3:
player1.Game_scene3()
print("游戏结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
if scene1 == 2:
player1.Game_scene2()
print("游戏结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
if scene1 == 1:
player1.Game_scene1()
print("游戏结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
print("是否继续:1.继续 2.退出")
continue2 = int(input())
if continue2 == 1:
print("请选择游戏场景:(1.草丛战斗 2.自我修炼 3. 多人游戏)")
scene1 = int(input())
else:
break
while scene1 == 3:
player1.Game_scene3()
print("游戏结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
print("是否继续:1.继续 2.退出")
continue2 = int(input())
if continue2 == 1:
print("请选择游戏场景:(1.草丛战斗 2.自我修炼 3. 多人游戏)")
scene1 = int(input())
else:
break
if scene1 == 3:
player1.Game_scene3()
print("游戏结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
if scene1 == 2:
player1.Game_scene2()
print("游戏结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
if scene1 == 3:
player1.Game_scene3()
print("游戏结束" + "\n", player1.G_name, player1.G_sex, player1.G_age, "剩余战斗力:", player1.G_fighting)
print("是否继续:1.继续 2.退出")
continue2 = int(input())
if continue2 == 1:
print("请选择游戏场景:(1.草丛战斗 2.自我修炼 3. 多人游戏)")
scene1 = int(input())
else:
break
创建3个游戏人物,以及三个游戏场景,模拟游戏场景
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
1条回答 默认 最新
- Ju_guan 2022-04-26 15:52关注
有以下三个游戏人物有如下属性:
姓名,性别,年龄,战斗力
小A,女,18,1000
小B,男,20,1800
小C,女,19,2500
选择游戏人物在以下三个游戏场景中模拟游戏:
1.草丛战斗(-200战斗力)
2.自我修炼(+100战斗力)
3.多人游戏(-500战斗)解决 无用评论 打赏 举报
悬赏问题
- ¥15 交替优化波束形成和ris反射角使保密速率最大化
- ¥15 树莓派与pix飞控通信
- ¥15 自动转发微信群信息到另外一个微信群
- ¥15 outlook无法配置成功
- ¥30 这是哪个作者做的宝宝起名网站
- ¥60 版本过低apk如何修改可以兼容新的安卓系统
- ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
- ¥50 有数据,怎么建立模型求影响全要素生产率的因素
- ¥50 有数据,怎么用matlab求全要素生产率
- ¥15 TI的insta-spin例程