Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

有时候被调虎离山封了出牌依旧可以读条很久 #316

Open
CuteReimu opened this issue Dec 20, 2024 · 0 comments
Open

有时候被调虎离山封了出牌依旧可以读条很久 #316

CuteReimu opened this issue Dec 20, 2024 · 0 comments
Assignees
Labels
bug 出BUG啦! need help 难搞,需要帮助

Comments

@CuteReimu
Copy link
Owner

CuteReimu commented Dec 20, 2024

SP白菲菲先被调虎离山禁出牌然后被平衡,之后争夺阶段直接询问到并不会直接跳过,而是等了5秒才跳过,暂时未发现原因。

if (isSkill) InvalidSkill.deal(target)
else target.skills += CannotPlayCard(forbidAllCard = true)

val (skip, skipTime) =
if (cannotPlayCardAndSkillForFightPhase(fsm)) true to 1
else if (hasNothingToDoForFightPhase(fsm)) true to 3 + Random.nextInt(5)
else false to waitSecond + 2

fun Player.hasNoSkillForFightPhase(fightPhase: FightPhaseIdle) =
!skills.any { it.isInitialSkill || it is ActiveSkill } || // 没有初始技能,说明被禁技能了(考虑到可能新获得主动技能,需要排除一下主动技能)
hasEverFaceUp && !skills.any {
it is ActiveSkill && it.canUse(fightPhase, this)
} // 曾经面朝上过并且没有争夺阶段可以用的主动技能
fun Player.cannotPlayCardAndSkillForFightPhase(fightPhase: FightPhaseIdle) =
(skills.any { it is CannotPlayCard && it.forbidAllCard } || cards.isEmpty()) && // 不能出牌或者没有手牌
hasNoSkillForFightPhase(fightPhase) // 没有争夺阶段可以用的主动技能

private val fightPhaseCards = listOf(Jie_Huo, Wu_Dao, Diao_Bao)
fun Player.hasNothingToDoForFightPhase(fightPhase: FightPhaseIdle) =
fightPhaseCards.all { cannotPlayCard(it) || cards.all { card -> !(canUseCardTypes(it, card).first) } } && // 没有能用的牌
!skills.any { it is ActiveSkill && it.canUse(fightPhase, this) } // 没有争夺阶段可以用的主动技能

@CuteReimu CuteReimu self-assigned this Dec 20, 2024
@CuteReimu CuteReimu added bug 出BUG啦! need help 难搞,需要帮助 labels Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 出BUG啦! need help 难搞,需要帮助
Projects
None yet
Development

No branches or pull requests

2 participants