private bool IsBetterAttack(AttackAction newAction, AttackAction prevAction, Kernel kernel) { var newContext = (AttackActionContext)newAction.getContext(); var prevContext = (AttackActionContext)prevAction.getContext(); Fruiton newTarget = KernelUtils.GetFruitonAt(kernel, newContext.target); Fruiton prevTarget = KernelUtils.GetFruitonAt(kernel, prevContext.target); bool isNewKill = newTarget.currentAttributes.hp <= newContext.damage; bool isPrevKill = prevTarget.currentAttributes.hp <= prevContext.damage; if (prevTarget.get_isKing()) { return(false); } return(newTarget.get_isKing() || isNewKill && !isPrevKill || newContext.damage > prevContext.damage || newTarget.type == Fruiton.MAJOR_TYPE && prevTarget.type == Fruiton.MINOR_TYPE); }