QingMuCat / nonebot_plugin_xiuxian_2

基于Nonebot2的修仙文字游戏插件
77 stars 17 forks source link

世界boss器师bug #28

Open zpwc opened 8 months ago

zpwc commented 8 months ago

代码实现当中,由于user_rank是递减的,高境界器师挑战低境界boss世界积分为负,同时机器人输出低境界-x层。考虑到器师是弱鸡灵根,这部分应该是对于器师打boss的特殊照顾。通过检查代码发现user_rank - boss_rank 写反了,实际应该为boss_rank - user_rank.

zpwc commented 8 months ago

修改方式为在xiuxian_boss文件中的init.py对进行修改,在以下两处,将user_rank - boss_rank修改为boss_rank - user_rank: 1:

elif victor == "群友赢了":
    # 新增boss战斗积分点数
    boss_all_hp = bossinfo['总血量']  # 总血量
    boss_integral = int((boss_old_hp / boss_all_hp) * 30)
    if boss_integral < 5:  # 摸一下不给
        boss_integral = 0
    if user_info.root == "器师":
        boss_integral = int(boss_integral * (1 + (user_rank - boss_rank)))
        more_msg = f"道友低boss境界{user_rank - boss_rank}层,获得{int(50 * (user_rank - boss_rank))}%积分加成!"

2:

if victor == "Boss赢了":
    group_boss[group_id][boss_num - 1] = bossinfo_new
    XiuxianDateManage().update_ls(user_id, get_stone, 1)
    # 新增boss战斗积分点数
    boss_now_hp = bossinfo_new['气血']  # 打之后的血量
    boss_all_hp = bossinfo['总血量']  # 总血量
    boss_integral = int(((boss_old_hp - boss_now_hp) / boss_all_hp) * 30)
    if boss_integral < 5:  # 摸一下不给
        boss_integral = 0
    if user_info.root == "器师":
        boss_integral = int(boss_integral * (1 + (user_rank - boss_rank)))
        more_msg = f"道友低boss境界{user_rank - boss_rank}层,获得{int(50 * (user_rank - boss_rank))}%积分加成!"
PackageInstaller commented 6 months ago

我觉得设计器师的想法就是依靠宗门养一个江湖好手,但是属性巨高的来打boss,高境界反而不合理?感觉顶多加个检测,如果负积分调0然后嘲讽一下(