开源小 游戏
2025-09-06 10:53:06
发布于:浙江
import random
import time
import os
import json
from datetime import datetime
def clr():
print("\033[H\033[J")
def pause():
input("请按回车键继续...")
def intInput(mi, ma):
get = 0
def poem():
if random.randint(1, 6) == 3:
print("\033[36m", end='')
print(" 诗经·梅木 ")
print(" 唐·臧话家 ")
print("梅覆梅木,湘思晚意。")
print("飞舞洒碧,神金勾时。")
print("糙泥马壁,消愁东曦。")
print("泉佳乙肆,纱貂铷苟。")
print("\033[0m")
while True:
try:
get = int(input())
except ValueError:
print("\033[31m不要乱输!\033[0m")
poem()
continue
if get < mi or get > ma:
print("\033[31m不要乱输!\033[0m")
poem()
continue
else:
break
return get
class Thing:
name = 'thing'
def __init__(self, name):
self.name = name
class Item(Thing):
name = 'item'
money = 0
def __init__(self, name, money):
super().__init__(name)
self.money = money
def show(self):
return f"{self.name} ${self.money}"
class Food(Item):
name = 'food'
hp = 0
def __init__(self, name, money, hp):
super().__init__(name, money)
self.hp = hp
class Weapon(Item):
name = 'weapon'
attack = 0
crit = 0.0
def __init__(self, name, money, at, crit):
super().__init__(name, money)
self.attack = at
self.crit = crit
class Armor(Item):
name = 'armor'
defense = 0
heal = 0
def __init__(self, name, money, defense, heal):
super().__init__(name, money)
self.defense = defense
self.heal = heal
class Scene(Thing):
name = 'scene'
useName = 's'
attack = 0
def __init__(self, name, useName, at):
super().__init__(name)
self.useName = useName
self.attack = at
def use(self, this, other):
if self.attack == 0:
return
if self.attack > 0:
atTo = self.attack
print(f'\033[33m{self.useName}对{this.name}造成了{atTo}点伤害\033[0m')
print(f'\033[33m{self.useName}对{other.name}造成了{atTo * 0.75}点伤害\033[0m')
this.hp -= atTo
other.hp -= atTo * 0.75
elif self.attack < 0:
atTo = self.attack
print(f'\033[32m{self.useName}对{this.name}造成了{-1 * atTo}点治疗\033[0m')
print(f'\033[32m{self.useName}对{other.name}造成了{atTo * -1.5}点治疗\033[0m')
this.hp -= atTo
other.hp -= atTo * 1.5
class Skill(Thing):
name = 'skill'
attack = 0
def __init__(self, name, at):
super().__init__(name)
self.attack = at
class AnimateEntity(Thing):
name = 'animate'
hp = 100
attack = 3
defense = 0
crit = 0.0
healBack = 0
blue = 100
def attackTo(self, this, other):
at = this.attack
otherHp = other.hp
otherDe = other.defense
crit = this.crit
healBack = other.healBack
atTo = max(at * (1 - otherDe), 1)
isUseSkill = 'y'
if this != user:
skillCheck = random.randint(1, 6)
if skillCheck <= 2:
isUseSkill = 'n'
else:
isUseSkill = 'y'
skillFlag = random.randint(0, len(game.skill) - 1)
if this.blue >= 50:
if isUseSkill == 'y' and 0 <= skillFlag < len(game.skill):
atTo += max(game.skill[skillFlag].attack * (1 - otherDe), 1)
print(f"\033[36m{this.name}使用技能{game.skill[skillFlag].name} 造成伤害{round(atTo, 2)}"
f" {other.name}剩余血量{round(otherHp - atTo, 2)}\033[0m")
this.blue -= 50
print(f"{this.name}法力值:{this.blue}")
else:
if this == user:
print("\033[31m法力值不足...\033[0m")
critFlag = random.randint(1, 100)
if 81 >= critFlag >= 78:
print(f"\033[33m{other.name}闪避了{this.name}的攻击\033[0m")
return
elif critFlag <= crit * 100:
atTo *= 2
print(f"\033[31m{this.name}暴击 造成伤害{round(atTo, 2)}"
f" {other.name}剩余血量{round(otherHp - atTo, 2)}\033[0m")
else:
print(f"{this.name}攻击 造成伤害{round(atTo, 2)}"
f" {other.name}剩余血量{round(otherHp - atTo, 2)}")
if healBack > 0:
print(f"\033[32m{other.name}回复{healBack}点血量\033[0m")
this.hp += healBack
this.blue += 15
other.hp -= atTo
class Monster(AnimateEntity):
name = 'monster'
def __init__(self, name, hp, at, defense):
super().__init__(name)
self.name = name
self.hp = hp
self.attack = at
self.defense = defense
class Boss(Monster):
def __init__(self, name, hp, at, defense):
super().__init__(name, hp, at, defense)
boss = Boss('萨卡搬家鱼', 333, 33, 0.12)
class User(AnimateEntity):
name = 'user'
hardLevel = 1
minHp = 100
minAttack = 3
minDefense = 0
minCrit = 0.0
minHeal = 0
minBlue = 100
xp = 3
energy = 100
level = 0
money = 1000
hasWeapon = -1
hasArmor = -1
hasFood = [0] * 30
hasItem = [0] * 30
killedMonster = 0
killedBoss = 0
worked = 0
bought = 0
day = 0
def updateLevel(self):
self.level += self.xp // 12
def updateUserData(self):
self.hp = self.minHp
self.attack = self.minAttack
self.defense = self.minDefense
self.crit = self.minCrit
self.healBack = self.minHeal
if self.hasWeapon >= 0:
self.attack += game.weapon[self.hasWeapon].attack
self.crit = game.weapon[self.hasWeapon].crit
if self.hasArmor >= 0:
self.defense += game.armor[self.hasArmor].defense
self.healBack += game.armor[self.hasArmor].heal
def useItem(self):
useCheck = input("是否使用物品(y/n)")
if useCheck == 'y':
if not any(self.hasFood):
print("\033[31m你没有食物可使用...\033[0m")
return
for index, count in enumerate(self.hasFood):
if count > 0:
food_name = game.food[index].name
print(f"{index}. {food_name} x{count}")
print("请选择要使用食物的序号:")
get = intInput(0, len(game.food) - 1)
if user.hasFood[get] > 0:
user.hasFood[get] -= 1
print(f'\033[32m你使用了{game.food[get].name},恢复了{game.food[get].hp}点血量和15点法力值\033[0m')
user.blue += 15
user.hp += game.food[get].hp
return
else:
print("\033[31m该食物已用完...\033[0m")
return
else:
return
def setLevel(self, level):
setter = 1
if level == 1:
setter = 0.86
elif level == 3:
setter = 1.12
boss.hp *= setter
boss.attack *= setter
boss.defense *= setter
boss.crit *= setter
cnt = 0
for _ in game.monster:
game.monster[cnt].hp *= setter
game.monster[cnt].attack *= setter
game.monster[cnt].defense *= setter
cnt += 1
user = User("user")
def wrongAnswer():
clr()
print("\033[31m")
print("/------------\\")
print("|Wrong Answer|")
print("\\------------/")
pause()
exit(0)
def runtimeError():
clr()
print("\033[34m")
print("/-------------\\")
print("|Runtime Error|")
print("\\-------------/")
pause()
exit(0)
def accepted():
clr()
print("\033[32m")
print("/--------\\")
print("|Accepted|")
print("\\--------/")
print("\033[0m")
pause()
class Game:
food = []
weapon = []
armor = []
item = []
monster = []
skill = []
scene = []
foodName = ["苹果", "胡萝卜", "土豆", "面包", "牛排", "金胡萝卜", "金苹果"]
foodHp = [4, 8, 12, 16, 32, 36, 48]
weaponName = ["木剑", "石剑", "铜剑", "铁剑", "钢剑", "金剑", "钛合金剑", "无尽合金剑"]
weaponAt = [4, 5, 9, 12, 15, 18, 24, 36]
weaponCrit = [0.08, 0.1, 0.12, 0.16, 0.2, 0.2, 0.24, 0.36]
armorName = ["皮革盔甲", "铜盔甲", "铁盔甲", "钢盔甲", "金盔甲", "钛合金盔甲", "无尽合金盔甲"]
armorDefense = [0.1, 0.12, 0.15, 0.2, 0.25, 0.36, 0.5]
armorHeal = [1, 2, 3, 4, 6, 6, 8, 12]
itemName = ["木板", "石头", "皮革", "铜", "铁", "钢", "金", "钛合金"]
itemMoney = [4, 5, 6, 13, 17, 21, 29, 33]
monsterName = ["wangkl", "fanghn", "lish", "zhangcd", "wangt", "zhaohn", "liyy", "chenjh", "liuhz", "quhh", "root"]
skillName = ["背刺", "权威", "打压", "神金", "招笑", "忘本", "飞舞", "渣男", "沙雕", "乐子"]
sceneName = ["迷雾荒野", "熔火峡谷", "冰霜遗港", "暗影墓园", "机械矿坑", "星落废墟", "黄沙古城", "晶窟裂隙", "圣灵回廊", "镜中庭院"]
sceneUseName = ["迷雾", "熔岩", "冰霜", "黑暗", "机械", "星光", "黄沙", "水晶", "圣灵", "魔镜"]
taskName = ["怪物猎人", "怪物杀手", "搬砖", "经商", "铜光焕发", "来硬的", "金光闪闪", "永无止境", "解放★", "解放★再一次"]
def __init__(self):
for i in range(0, len(self.foodName)):
food_item = Food(self.foodName[i], int(self.foodHp[i] * 1.77 - i * 0.1), self.foodHp[i])
self.food.append(food_item)
for i in range(0, len(self.weaponName)):
weapon_item = Weapon(self.weaponName[i], int(self.weaponAt[i] * 3.33 - i * 0.1), self.weaponAt[i],
self.weaponCrit[i])
self.weapon.append(weapon_item)
for i in range(0, len(self.armorName)):
armor_item = Armor(self.armorName[i], int(self.armorDefense[i] * 298 - i * 0.1), self.armorDefense[i],
self.armorHeal[i])
self.armor.append(armor_item)
for i in range(0, len(self.itemName)):
item_item = Item(self.itemName[i], self.itemMoney[i])
self.item.append(item_item)
for i in range(0, len(self.monsterName)):
hp = random.randint(100,136)
at = random.randint(12,24)
de = random.randint(0,12)
monster_item = Monster(self.monsterName[i], hp, at, de / 100)
self.monster.append(monster_item)
for i in range(0, len(self.skillName)):
at = random.randint(2, 8)
skill_item = Skill(self.skillName[i], at)
self.skill.append(skill_item)
for i in range(0, len(self.sceneName)):
at = random.randint(-5, 5)
scene_item = Scene(self.sceneName[i], self.sceneUseName[i], at)
self.scene.append(scene_item)
def fight(self, isBoss):
clr()
what = random.randint(0, len(self.monsterName) - 1)
where = random.randint(0, len(self.sceneName) - 1)
if isBoss:
if user.level < 12:
print("\033[35m经验不足...\033[0m")
return
self.fight(False)
self.fight(False)
self.fight(False)
clr()
monster = boss
if user.energy >= 20:
user.energy -= 20
else:
print("\033[35m体力不足...\033[0m")
pause()
return
pause()
print("第10086关:凌霄空堡")
print(f"BOSS:{monster.name} 血量{round(monster.hp, 2)} 攻击{round(monster.attack, 2)}")
else:
monster = self.monster[what]
if user.energy >= 15:
user.energy -= 15
else:
print("\033[35m体力不足...\033[0m")
pause()
return
print(f"第{user.killedMonster + 1}关:{self.scene[where].name}")
print(f"敌人:{monster.name} 血量{round(monster.hp, 2)} 攻击{round(monster.attack, 2)}")
pause()
nowHp = user.hp
nowAt = user.attack
nowCrit = user.crit
nowDefense = user.defense
nowHeal = user.healBack
monsterHp = monster.hp
monsterAt = monster.attack
monsterDef = monster.defense
monsterHeal = monster.healBack
print("是否逃跑(y/n)")
runFlag = input()
if runFlag == "y" or runFlag == "Y":
print("你开溜了~")
pause()
return
count = 0
while monster.hp > 0:
count += 1
print()
print(f"第{count}回合:玩家血量{round(user.hp, 2)} {monster.name}血量{round(monster.hp, 2)}")
user.useItem()
user.attackTo(user, monster)
time.sleep(0.4)
monster.attackTo(monster, user)
time.sleep(0.4)
self.scene[where].use(user, monster)
time.sleep(0.4)
if user.hp <= 0:
print(f"你被{monster.name}杀死了...")
pause()
if isBoss:
runtimeError()
else:
wrongAnswer()
if isBoss:
getMoney = random.randint(72, 96)
user.xp += 48
else:
getMoney = random.randint(24, 32)
user.xp += 8
user.updateLevel()
print(f"\033[32m你击败了{monster.name} 你获得了${getMoney}...\033[0m")
user.hp = nowHp
user.attack = nowAt
user.crit = nowCrit
user.defense = nowDefense
user.healBack = nowHeal
user.blue = user.minBlue
monster.hp = monsterHp
monster.attack = monsterAt
monster.defense = monsterDef
monster.healBack = monsterHeal
monster.energy = 100
user.money += getMoney
user.updateUserData()
pause()
if isBoss:
user.killedBoss += 1
boss.hp *= 1.16
boss.attack *= 1.16
boss.defense *= 1.16
user.hasWeapon = 7
user.hasArmor = 6
accepted()
else:
user.killedMonster += 1
def work(self):
clr()
if user.energy >= 25:
user.energy -= 25
else:
print("\033[35m体力不足...\033[0m")
pause()
return
for _ in range(1, 8):
print("打工中...")
time.sleep(1)
end = random.randint(0, 100)
if 6 >= end >= 3:
print("老板看见弄坏的原材料,没给钱...")
user.xp += 3
user.updateLevel()
pause()
user.worked += 1
return
getMoney = random.randint(8, 12)
if end == 43:
getMoney *= 100
print(f"打工结束,你获得了${getMoney}...")
user.money += getMoney
user.xp += 2
user.updateLevel()
pause()
user.worked += 1
def shop(self):
clr()
cnt = 0
for i in range(0, len(self.food)):
print(f"{cnt}. {self.food[i].show()}")
cnt += 1
for i in range(0, len(self.item)):
print(f"{cnt}. {self.item[i].show()}")
cnt += 1
print(f"当前:${user.money}")
get = intInput(0, cnt - 1)
if 0 <= get <= 6:
if self.food[get].money > user.money:
print("\033[31m钱不够哦\033[0m")
pause()
return
user.hasFood[get] += 1
elif 7 <= get:
get -= 7
if self.item[get].money > user.money:
print("\033[31m钱不够哦\033[0m")
pause()
return
user.hasItem[get] += 1
if 0 <= get <= 6:
user.money -= self.food[get].money
else:
user.money -= self.item[get].money
print("购买成功!")
user.bought += 1
user.updateUserData()
pause()
def craft(self):
def check(x, num):
if user.hasItem[x] >= num:
return True
else:
print("\033[31m物品数量不足...\033[0m")
return False
clr()
if user.energy >= 3:
user.energy -= 3
else:
print("体力不足...")
pause()
return
print("1. 2*石 + 1*木板 -> 石剑")
print("2. 2*铜 + 1*木板 -> 铜剑")
print("3. 2*铁 + 1*木板 -> 铁剑")
print("4. 2*钢 + 1*木板 -> 钢剑")
print("5. 2*金 + 1*木板 -> 金剑")
print("6. 2*钛 + 1*木板 -> 钛合金剑")
print("7. 3*铜 + 1*皮革 -> 铜盔甲")
print("8. 3*铁 + 1*皮革 -> 铁盔甲")
print("9. 3*钢 + 1*皮革 -> 钢盔甲")
print("10.3*金 + 1*皮革 -> 金盔甲")
print("11.3*钛 + 1*皮革 -> 钛合金盔甲")
print("请输入序号:(0.退出)")
get = intInput(0, 11)
if get == 0:
pause()
return
elif 6 >= get >= 1:
if not check(0, 1):
pause()
return
if get == 1:
if not check(1, 2):
pause()
return
user.hasItem[1] -= 2
user.hasItem[0] -= 1
user.hasWeapon = 1
else:
if not check(get + 1, 2):
pause()
return
user.hasItem[get + 1] -= 2
user.hasItem[0] -= 1
user.hasWeapon = get
else:
if not check(2, 1):
pause()
return
if not check(get - 4, 3):
pause()
return
user.hasItem[get - 4] -= 3
user.hasItem[2] -= 1
user.hasArmor = get - 6
print("制作成功! ")
pause()
def find(self):
clr()
for _ in range(1, 5):
print("寻找中...")
time.sleep(1)
if user.energy >= 20:
user.energy -= 20
else:
print("\033[35m体力不足...\033[0m")
pause()
return
i = random.randint(1, 120)
if i <= 15:
print("你什么也没找到...")
elif i <= 36:
if i <= 28:
print("你找到了一个苹果...")
user.hasFood[0] += 1
elif i <= 32:
print("你找到了一个胡萝卜...")
user.hasFood[1] += 1
else:
print("你找到了一个土豆...")
user.hasFood[2] += 1
elif i <= 54:
if i <= 40:
print("你找到了一把木剑...")
if user.hasWeapon == -1:
user.hasWeapon = 0
else:
print("但你觉得他太飞舞了...")
elif i <= 44:
print("你找到了一把石剑...")
if user.hasWeapon >= 0:
user.hasWeapon = 1
else:
print("但你觉得他太飞舞了...")
else:
print("你找到了一套皮革盔甲...")
if user.hasArmor == -1:
user.hasArmor = 0
else:
print("但你觉得他太飞舞了...")
elif i <= 100:
if i <= 70:
print("你找到了一块木板...")
user.hasItem[0] += 1
elif i <= 75:
print("你找到了一块石头...")
user.hasItem[1] += 1
elif i <= 80:
print("你找到了一块皮革...")
user.hasItem[2] += 1
elif i <= 88:
print("你找到了一块铜...")
user.hasItem[3] += 1
else:
print("你找到了一块铁...")
user.hasItem[4] += 1
else:
print("你找到了$10...")
user.money += 10
user.updateUserData()
pause()
def sleep(self):
clr()
for _ in range(1, 10):
print("休息中...")
time.sleep(1)
print("你又打起了精神...体力+60")
user.energy += 60
user.day += 1
pause()
def personPanel(self):
clr()
print(f"用户名:{user.name}")
print(f"总血量:{user.hp}")
print(f"攻击力:{user.attack}")
print(f"防御力:{user.defense}")
print(f"等级值:{user.level}")
print(f"金钱数:${user.money}")
for index, count in enumerate(user.hasFood):
if count > 0:
food_name = self.food[index].name
print(f"食物:{food_name}")
if user.hasWeapon >= 0:
print(f"武器:{self.weaponName[user.hasWeapon]}")
if user.hasArmor >= 0:
print(f"盔甲:{self.armorName[user.hasArmor]}")
for index, count in enumerate(user.hasItem):
if count > 0:
item_name = self.item[index].name
print(f"物品:{item_name}")
def checkTask():
print("\033[36m")
if user.killedMonster >= 5:
print(f"恭喜达成:{self.taskName[0]}")
if user.killedMonster >= 20:
print(f"恭喜达成:{self.taskName[1]}")
if user.worked >= 8:
print(f"恭喜达成:{self.taskName[2]}")
if user.bought >= 8:
print(f"恭喜达成:{self.taskName[3]}")
if user.hasWeapon == 2 or user.hasArmor == 1:
print(f"恭喜达成:{self.taskName[4]}")
if user.hasWeapon == 3 or user.hasArmor == 2:
print(f"恭喜达成:{self.taskName[5]}")
if user.hasWeapon == 5 or user.hasArmor == 4:
print(f"恭喜达成:{self.taskName[6]}")
if user.hasWeapon == 7 or user.hasArmor == 6:
print(f"恭喜达成:{self.taskName[7]}")
if user.killedBoss >= 1:
print(f"恭喜达成:{self.taskName[8]}")
if user.killedBoss >= 2:
print(f"恭喜达成:{self.taskName[9]}")
print("\033[0m")
checkTask()
pause()
def saveAndLoad(self):
def saveGame():
clr()
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
filename = f"saves/{user.name}_{timestamp}.json"
save_data = {
"name": user.name,
"hardLevel": user.hardLevel,
"minHp": user.minHp,
"minAttack": user.minAttack,
"minDefense": user.minDefense,
"minCrit": user.minCrit,
"minHeal": user.minHeal,
"minBlue": user.minBlue,
"xp": user.xp,
"energy": user.energy,
"level": user.level,
"money": user.money,
"hasWeapon": user.hasWeapon,
"hasArmor": user.hasArmor,
"hasFood": user.hasFood.copy(),
"hasItem": user.hasItem.copy(),
"killedMonster": user.killedMonster,
"killedBoss": user.killedBoss,
"worked": user.worked,
"bought": user.bought,
"day": user.day,
"timestamp": timestamp
}
save_data["boss_hp"] = boss.hp
save_data["boss_attack"] = boss.attack
save_data["boss_defense"] = boss.defense
try:
with open(filename, 'w', encoding='utf-8') as f:
json.dump(save_data, f, ensure_ascii=False, indent=4)
print(f"\033[32m存档成功!文件保存至:{filename}\033[0m")
except Exception as e:
print(f"\033[31m存档失败:{str(e)}\033[0m")
pause()
def loadGame():
clr()
saves = [f for f in os.listdir("saves") if f.endswith(".json")]
if not saves:
print("\033[31m没有找到存档文件!\033[0m")
pause()
return
print("\033[36m可用存档:\033[0m")
for i, save in enumerate(saves):
name = save.split('_')[0]
timestamp = save.split('_')[1].split('.')[0]
time_str = datetime.strptime(timestamp, "%Y%m%d_%H%M%S").strftime("%Y-%m-%d %H:%M:%S")
print(f"{i}. {name} - {time_str}")
if len(saves) == 1:
choice = 0
else:
print("\033[36m请选择要加载的存档序号:\033[0m")
choice = intInput(0, len(saves) - 1)
filename = f"saves/{saves[choice]}"
try:
with open(filename, 'r', encoding='utf-8') as f:
save_data = json.load(f)
user.name = save_data["name"]
user.hardLevel = save_data["hardLevel"]
user.minHp = save_data["minHp"]
user.minAttack = save_data["minAttack"]
user.minDefense = save_data["minDefense"]
user.minCrit = save_data["minCrit"]
user.minHeal = save_data["minHeal"]
user.minBlue = save_data["minBlue"]
user.xp = save_data["xp"]
user.energy = save_data["energy"]
user.level = save_data["level"]
user.money = save_data["money"]
user.hasWeapon = save_data["hasWeapon"]
user.hasArmor = save_data["hasArmor"]
user.hasFood = save_data["hasFood"]
user.hasItem = save_data["hasItem"]
user.killedMonster = save_data["killedMonster"]
user.killedBoss = save_data["killedBoss"]
user.worked = save_data["worked"]
user.bought = save_data["bought"]
user.day = save_data["day"]
boss.hp = save_data["boss_hp"]
boss.attack = save_data["boss_attack"]
boss.defense = save_data["boss_defense"]
user.updateUserData()
print(f"\033[32m成功加载存档:{filename}\033[0m")
except Exception as e:
print(f"\033[31m读档失败:{str(e)}\033[0m")
pause()
print("请选择(0.存档 1.读档)")
get = intInput(0, 1)
if get == 0:
saveGame()
else:
loadGame()
def setting(self):
clr()
yunshi = ["大吉", "中吉", "小吉", "中平", "小凶", "凶", "大凶"]
yun = random.randint(0, 6)
yi_list = [
["诸事不宜", "诸事不宜", "诸事不宜", "诸事不宜"],
["宜:装弱", "宜:窝在家里", "宜:刷题", "宜:吃饭"],
["宜:刷题", "宜:开电脑", "宜:写作业", "宜:睡觉"],
["宜:发朋友圈", "宜:出去玩", "宜:打游戏", "宜:吃饭"],
["宜:学习", "宜:研究Ruby", "宜:研究c#", "宜:玩游戏"],
["宜:膜拜大神", "宜:扶老奶奶过马路", "宜:玩网游", "宜:喝可乐"],
["宜:吃东西", "宜:打sdvx", "宜:打开洛谷", "宜:出行"],
["宜:写程序", "宜:刷题", "宜:偷塔", "宜:**"],
["宜:扶老奶奶过马路", "宜:上课", "宜:写作业", "宜:写程序"],
]
yi_shi_list = [
["", "", "", ""],
["谦虚最好了", "不出门没有危险", "直接AC", "吃的饱饱的再学习"],
["一次AC", "发现电脑死机了", "全对", "睡足了再学习"],
["点赞量破百", "真开心", "十连胜", "吃饱了"],
["都会", "有了新发现", "发现新大陆", "直接胜利"],
["接受神之沐浴", "增加RP", "犹如神助", "真好喝"],
["吃饱了", "今天状态好", "发现AC的题变多了", "路途顺畅"],
["不会报错", "直接TLE", "胜利", "万人敬仰"],
["增加RP", "听懂了", "都会", "没有Bug"],
]
ji_list = [
["诸事皆宜", "诸事皆宜", "诸事皆宜", "诸事皆宜"],
["忌:打sdvx", "忌:出行", "忌:玩手机", "忌:吃方便面"],
["忌:关电脑", "忌:开挂", "忌:纳财", "忌:考试"],
["忌:膜拜大神", "忌:评论", "忌:研究Java", "忌:吃方便面"],
["忌:发朋友圈", "忌:打开洛谷", "忌:研究C++", "忌:出行"],
["忌:探险", "忌:发视频", "忌:发博客", "忌:给别人点赞"],
["忌:写程序", "忌:使用Unity打包exe", "忌:装弱", "忌:打开CSDN"],
["忌:点开wx", "忌:刷题", "忌:**", "忌:和别人分享你的程序"],
["忌:纳财", "忌:写程序超过500行", "忌:断网", "忌:检测Bug"],
]
ji_shi_list = [
["", "", "", ""],
["今天状态不好", "路途也许坎坷", "好家伙,直接死机", "没有调味料"],
["死机了", "被制裁", "你没有财运", "没及格"],
["被人嘲笑", "被喷", "心态崩溃", "只有一包调味料"],
["被人当成买面膜的", "大凶", "五行代码198个报错", "路途坎坷"],
["你失踪了", "被人喷", "阅读量1", "被人嘲笑"],
["报错19999+", "电脑卡死,发现刚才做的demo全没了", "被人看穿", "被人陷害"],
["被人陷害", "WA", "被识破", "别人发现了Bug"],
["没有财运", "99+报错", "连不上了", "503个Bug"],
]
print("作者:H2O2")
print("版本:V_1.2")
print("语言:python")
print("发布:25/8/3")
print()
if yun <= 1:
a = 50
b = 100
print("\033[31m", end='')
elif 2 <= yun <= 4:
a = 25
b = 75
print("\033[32m", end='')
else:
a = 0
b = 50
print(f"{user.name}今日运势")
print(f"§{yunshi[yun]}§")
print(f"{user.name}今日人品")
print(f"§{random.randint(a, b)}§")
print("\033[0m", end='')
print(f"你已经连续打卡了{user.day}天")
if 0 <= yun < len(yi_list):
yi_idx = random.randint(0, 3)
ji_idx = random.randint(0, 3)
print(f"{yi_list[yun][yi_idx]} {yi_shi_list[yun][yi_idx]}")
print(f"{ji_list[yun][ji_idx]} {ji_shi_list[yun][ji_idx]}")
print(f"本次运势超过全国{random.randint(a, b)}%的用户")
pause()
def start(self):
clr()
os.system("chcp 65001")
print("俗话说的好,明知山有虎,不去明知山。")
print("明知山上的育才小镇里,有一只萨卡搬家鱼,")
print("他和他的朋友们在此处作乱,害了不少人。")
print("你作为冒险者,就要完成任务,除了公害,")
print("加油吧,冒险者!")
user.name = input("贵姓?")
print("请输入难度(1, 2, 3)")
user.hardLevel = intInput(1, 3)
user.setLevel(user.hardLevel)
while True:
clr()
user.updateLevel()
print(f'Accepted {user.name} Lv.{user.level}')
print(f'{user.name} 体力{user.energy}')
print('1.战斗 2.打工')
print('3.商店 4.打BOSS')
print('5.合成 6.搜刮')
print('7.休息 8.面板')
print('9.设置 10.存档')
print('11.刷题 0.退出')
today = datetime.now()
if today.month == 10 and today.day == 24:
print("\033[36m")
print("今日是程序员节,系统为你加载[无限蓝量]buff!")
print("\033[0m")
user.blue = 99999999
get = intInput(0, 11)
if get == 1:
self.fight(False)
elif get == 2:
self.work()
elif get == 3:
self.shop()
elif get == 4:
self.fight(True)
elif get == 5:
self.craft()
elif get == 6:
self.find()
elif get == 7:
self.sleep()
elif get == 8:
self.personPanel()
elif get == 9:
self.setting()
elif get == 10:
self.saveAndLoad()
elif get == 11:
os.system("start https://www.jxycoi.cn/")
pause()
elif get == 0:
pause()
exit(0)
game = Game()
game.start()
# 正式版 V_1.2
全部评论 3
刚刚有个傻冒告诉我鲁迅姓周,真逗啊!周迅是个演员好吗?笑死我了!真想一板砖呼死他!
我记得鲁迅原名李大钊,浙江周树人,是著名的法西斯音乐家,一生有2000多项发明,被称为太空步的创始人。
他拥有一个好嗓子,小学时就凭借着90分钟跑100米的优异成绩考上了新东方烹饪学校!
毕业后成功进入富士康苦心练习勃鸡,他擅长110米栏,左手反打技术高超,拿手全垒打,大灌篮,
“后空翻180度右旋体360度后蹬地翻转720度”是他的经典动作,更难得可贵的是他落地没有水花。
他还是恶魔果实能力者,传说中的三忍之一,曾大闹天宫,后改邪归正,统一三国,传说他有107个弟兄,
个个铜头铁臂,面目狰狞,这便是羊村的起源,他生平淡泊名利,曾经锻造五色神石补天,因杀死西门庆等原因,上梁山当了土匪,
后遇到高人阿凡达的指点,收买阿童木**了白雪公主,与七个小矮人快乐的生活在一起。并写了名侦探柯南的故事。
名侦探柯南讲述的是要成为海贼王的八神太一收服了皮卡丘并登上创界山启动光能使者打败了鲨鱼辣椒,
然后跟多啦A梦一起通过黄金十二宫收集 七个葫芦娃召唤神龙复活二代火影,但最终为了保卫M78星云而成为了羊村村长,
同蓝精灵们一起抵抗光头强的入侵的故事。他还写了《时间简史》,后来因抽了龙王三太子的筋,以命偿命。后被太乙真人救活,又送了他不少法宝。
然后又创建了‘浴谷’,‘浴谷’是一个收集AC获得AK的网站。当时正值小黄人入侵时期,
于是,他批量生产大白,成功抵御入侵,再一次拯救了人类!当他晚年时,热衷于炼丹,炼时经常失败,一大堆毒丹,
这些毒丹在kkk的帮助成为毒瘤,在IMO经常被用来增加物理实验的难度,比如高锰酸钾与古洛糖酸内酯羟化酶发生反应,生成了奥黛丽赫苯,
并在其帮助下结实了NBA著名运动员兼全球Rap协会会长菜虚鲲,和他成为了好鸡友,并常常和他一起唱唱跳跳。
尽管鲁迅已经步入晚年,但他和菜虚鲲打篮球的时候依然会喊出“鸡你太美”,
并立下flag:要是kkk能17张牌秒了她,她!当!场!就把珂学13题AK了。昨天 来自 江苏
0s
昨天 来自 北京
0你猜为什么要开源?
·
·
·
·
·
·
·
·
·
·
··
·
·
·
·
·
·
·
·
·
··
·
·
·
·
·
·
·
·
·
·
·
·
·
·
·
··
·
·
·
··
··
·
·
·
·
·
·
·
·
·
代码bug多,太长了,难维护,停更了昨天 来自 浙江
0
有帮助,赞一个