adventure.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:Harmonbot 作者: Harmon758 项目源码 文件源码
def stop_woodcutting(self):
        if self.last_action and self.last_action[0] == "woodcutting":
            wood_type = self.last_action[1]
            time_spent = math.ceil(time.time() - self.last_action_time) / 60
            self.last_action = None
            self.last_action = None
            current_wood_lvl = wood_lvl(wood_type)
            wood_amount = math.floor(time_spent * self.wood_rate(wood_type) * self.woodcutting_rate)
            xp_amount = current_wood_lvl * wood_amount
            self.inventory[wood_type] = self.inventory.get(wood_type, 0) + wood_amount
            if self.inventory[wood_type] == 0:
                del self.inventory[wood_type]
            self.woodcutting_xp += xp_amount
            self.write_data()
            return wood_type, time_spent, wood_amount, xp_amount
        else:
            return False, self.last_action
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号