吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 1082|回复: 4
收起左侧

[Python 原创] 暗黑4 S4赛季 终局BOSS材料 py计算器源码 自用分享

[复制链接]
kakarrot 发表于 2024-6-12 09:59
本帖最后由 kakarrot 于 2024-6-12 15:14 编辑

几个赛季还是记不住,抄了个作业,简化一些,方便“刷刷刷”,知道在哪用什么材料,材料怎么获取。

[Python] 纯文本查看 复制代码
# !/usr/bin/python3
# encoding=utf-8

def calculate_summons_and_rewards(resource_quantity, resource_per_summon):
    summons = resource_quantity // resource_per_summon
    rewards = summons
    return summons, rewards

def main():
    bosses = {
        1: {"name": "齐尔领主暗黑boss", "resource": "精纯鲜血", "amount": 9, "reward": "炙沙枷锁", "location": "破碎群峰的晦暗之路"},
        2: {"name": "冰中巨兽", "resource": "提纯的恐惧", "amount": 27, "reward": "针垫玩偶", "location": "梦魇冰川"},
        3: {"name": "格里高列", "resource": "活体钢铁", "amount": 5, "reward": "苦痛碎片", "location": "干燥平原的悔罪者大厅"},
        4: {"name": "瓦尔申", "resource": ["颤栗之手", "咕噜头颅", "恶念之心", "发黑的股骨"], "amount": 1, "reward": "粘液覆盖的蛋", "location": "谜语古树"},
        5: {"name": "普通督瑞尔", "resource": ["苦痛碎片", "粘液覆盖的蛋"], "amount": 2, "reward": "大概率稀有暗金!!!", "location": "凯基斯坦的巨口深坑"},
        6: {"name": "普通安达莉尔", "resource": ["针垫玩偶", "炙沙枷锁"], "amount": 2, "reward": "大概率稀有暗金!!!", "location": "凯基斯坦的绞首者大厅"}
    }
    
    while True:
        print("请选择你要召唤的BOSS:")
        for key, boss in bosses.items():
            if isinstance(boss["resource"], list):
                resources = "和".join(boss["resource"])
                print(f"{key}. {boss['name']}(需要每种各{boss['amount']}个:{resources}) - 召唤地点: {boss['location']}")
            else:
                print(f"{key}. {boss['name']}(需要 {boss['amount']} 个 {boss['resource']}) - 召唤地点: {boss['location']}")

        choice = int(input("请输入选择的数字 (1-6): "))
        
        if choice in bosses:
            boss = bosses[choice]
            if isinstance(boss["resource"], list):
                quantities = []
                for resource in boss["resource"]:
                    quantity = int(input(f"请输入你拥有的 {resource} 数量: "))
                    quantities.append(quantity)
                summons = min(quantities) // boss["amount"]
                rewards = summons
            else:
                resource_quantity = int(input(f"请输入你拥有的 {boss['resource']} 数量: "))
                summons, rewards = calculate_summons_and_rewards(resource_quantity, boss["amount"])
            
            print(f"你可以召唤 {summons} 次 {boss['name']}。")
            print(f"你将得到 {rewards} 个 {boss['reward']}。")
        else:
            print("无效的选择,请重新选择。")
            continue
        
        if input("是否继续召唤其他BOSS?(输入 y 继续,输入其他任意键退出): ") != 'y':
            break

if __name__ == "__main__":
    main()

免费评分

参与人数 1热心值 +1 收起 理由
landon-zeng + 1 谢谢@Thanks!

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

landon-zeng 发表于 2024-6-12 14:22
牛啊大佬,这是d4的还是哪个的脚本?
ZhjhJZ 发表于 2024-6-12 14:41
雾都孤尔 发表于 2024-6-12 17:26
果然,有了工具可以无脑刷材料了。感谢分享。
TabKey9 发表于 2024-6-12 17:51
哪个D4,暴雪不是退出中国市场了嘛!
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-24 16:59

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表