def allowSkills(status: Status): remainCp = status.currentCp - cpReq ans = list() if remainCp < 0: return ans if remainCp >= SkillManager.getCp( '精修', status ) and status.target.maxDurability - status.currentDurability >= 30: ans.append(['精修']) #if remainCp >= SkillManager.getCp('掌握', status): # ans.append(['掌握']) if status.ball == BallManager.RedBall: ans.append(['秘诀']) for buff in AllowBuffs: if not status.has_buff(buff) and remainCp >= SkillManager.getCp( buff, status): ans.append([buff]) if ['改革'] not in ans: for skill in AllowSkillSet: if status.currentDurability > SkillManager.getDurability( skill, status) and remainCp >= SkillManager.getCp( skill, status) and SkillManager[skill].can_use(status): ans.append([skill]) if remainCp >= 25 and status.currentDurability >= 10: ans.append(['观察', '注视加工']) return ans
def allowSkills(self, status: Status): remainCp = status.currentCp - cpReq ans = list() if remainCp < 0: return ans if remainCp >= SkillManager.getCp( _('精修'), status ) and status.target.maxDurability - status.currentDurability >= 30: ans.append([_('精修')]) if status.currentCp > 200 and \ not status.has_buff(_('掌握')) and \ not status.has_buff(_('改革')) and \ not status.has_buff(_('阔步')): ans.append([_('掌握')]) if status.ball == BallManager.RedBall: ans.append([_('秘诀')]) if not status.has_buff(_('观察')) or status.ball in [ BallManager.PurpleBall ]: for buff in AllowBuffs: if not status.has_buff( buff) and remainCp >= SkillManager.getCp(buff, status): ans.append([buff]) if status.has_buff(_('改革')) or remainCp < 50 or status.ball in [ BallManager.RedBall, BallManager.BlueBall ]: for skill in AllowSkillSetObserve if status.has_buff( _('观察')) else AllowSkillSet: if status.currentDurability > SkillManager.getDurability(skill, status) and remainCp >= SkillManager.getCp(skill, status) and \ SkillManager[skill].can_use(status): ans.append([skill]) return ans
def is_finished(self, status: Status, prev_skill=None): return not (status.has_buff('内静') and status.get_buff('内静').data["lv"] < 8)
def InnerQuietLv(status: Status): return 0 if not status.has_buff(_('内静')) else status.get_buff( _('内静')).data["lv"]
status.target.maxProgress)) print("quality:\t{}/{}".format(status.currentQuality, status.target.maxQuality)) if status.buffs: print("buffs:", " ".join([str(buff) for buff in status.buffs.values()])) print("CP:\t{}/{}".format(status.currentCp, status.player.maxCp)) #创建角色,对象实体 player = Crafter(80, 2758, 2917, 657) target = Target(511, 50, 11126, 82400) #创建status开局 status = Status(player, target, BallManager.defaultBall) #一些直接修改局面属性的api #注意:为了避免循环加载,或缺漏注入等情况,请不要直接import skills.py ball.py 等文件 #请使用manager相关 status.ball = BallManager.PurpleBall status.get_buff(BuffManager.InnerQuiet) status.execute_buff_change() if status.has_buff('內静'): status.get_buff('內静').data['lv'] = 11 #使用use skill 创建下一回合的局面 next_status = status.use_skill(SkillManager['俭约']) #格式化输出 print_status(next_status)