コード例 #1
0
        private void PrepareTimeout(IUIManager?ui, IReadOnlyList <Enemy> subbosses, SMHandoff smh, Cancellable toCancel)
        {
            smh.Exec.PhaseShifter = toCancel;
            var timeout = Timeout;

            //Note that the <!> HP(hp) sets invulnTime=0.
            if (props.invulnTime != null && props.phaseType != PhaseType.TIMEOUT)
            {
                WaitingUtils.WaitThenCB(smh.Exec, smh.cT, props.invulnTime.Value, false,
                                        () => smh.Exec.Enemy.SetVulnerable(Vulnerability.VULNERABLE));
            }
            WaitingUtils.WaitThenCancel(smh.Exec, smh.cT, timeout, true, toCancel);
            if (props.phaseType?.IsSpell() ?? false)
            {
                smh.Exec.Enemy.RequestSpellCircle(timeout, smh.cT);
                foreach (var subboss in subbosses)
                {
                    subboss.RequestSpellCircle(timeout, smh.cT);
                }
            }
            //else smh.exec.Enemy.DestroySpellCircle();
            if (!props.HideTimeout && smh.Exec.TriggersUITimeout)
            {
                ui?.DoTimeout(props.phaseType?.IsCard() ?? false, timeout, smh.cT);
            }
        }