private static bool IsKeyDown(BaseSkillState skillState)
        {
            if (!instances.TryGetValue(skillState, out var extraBaseSkillState))
            {
                instances.Add(skillState, extraBaseSkillState = new ExtraBaseSkillState
                {
                    ExtraSkillLocator  = skillState.outer.GetComponent <ExtraSkillLocator>(),
                    ExtraInputBankTest = skillState.outer.GetComponent <ExtraInputBankTest>()
                });
            }

            var extraSkillLocator = extraBaseSkillState.ExtraSkillLocator;
            var extraInputBank    = extraBaseSkillState.ExtraInputBankTest;

            if (!extraSkillLocator || !extraInputBank)
            {
                return(false);
            }

            return((ExtraSkillSlot)skillState.skillLocator.FindSkillSlot(skillState.activatorSkillSlot) switch
            {
                ExtraSkillSlot.ExtraFirst => extraInputBank.extraSkill1.down,
                ExtraSkillSlot.ExtraSecond => extraInputBank.extraSkill2.down,
                ExtraSkillSlot.ExtraThird => extraInputBank.extraSkill3.down,
                ExtraSkillSlot.ExtraFourth => extraInputBank.extraSkill4.down,
                _ => throw new ArgumentOutOfRangeException()
            });
Пример #2
0
 public override void Release(DefAction OnSuccess = null, DefAction OnFinish = null)
 {
     targettState = curState = BaseSkillState.Attack01;
     //播放角色动作
     base.Release(OnSuccess, () => {
         OnReleaseFinish(OnFinish);
     });
     //控制猪脚瞬间移动
     WaitForSec(delayTime, () => {
         FastMove();
     });
     AudioManager.Instance.PlayAudio(AudioManager.Man_Comm_Attack01);
     //控制特效显示
     PlayEffect(effectGOFirst);
     //计算伤害值
     WaitForSec(DelayCalAttack01DamageTime, () =>
     {
         AttackItem attack = new AttackItem();
         attack.Damage     = Damage;
         attack.Type       = AttackType.Normal;
         attack.Stage      = AttackStage.First;
         attack.AttackDir  = AttackDir.Forward;
         PlayerFightCtrl.Instance.CalculateDamage(attack);
     });
 }
 // Token: 0x06001EAB RID: 7851 RVA: 0x000846D0 File Offset: 0x000828D0
 protected override void FixedUpdateBehavior()
 {
     base.FixedUpdateBehavior();
     this.currentDistance = Vector3.Distance(this.aimOrigin, this.position);
     if (base.isAuthority)
     {
         bool flag  = !this.grappleController.projectileStickOnImpactController.stuck;
         bool flag2 = this.currentDistance < this.grappleController.nearBreakDistance;
         bool flag3 = !this.grappleController.OwnerIsInFiringState();
         bool flag4;
         if (base.owner.stateMachine)
         {
             BaseSkillState baseSkillState = base.owner.stateMachine.state as BaseSkillState;
             flag4 = (baseSkillState == null || !baseSkillState.IsKeyDownAuthority());
         }
         else
         {
             flag4 = true;
         }
         if (flag4 || flag3 || flag2 || flag)
         {
             this.outer.SetNextState(new ProjectileGrappleController.ReturnState());
             return;
         }
     }
 }
Пример #4
0
    public override void ReleaseComboSkill()
    {
        GameTools.LogError("ReleaseComboSkill");
        switch (targettState)
        {
        case BaseSkillState.Idle:
            targettState = BaseSkillState.Idle;
            break;

        case BaseSkillState.Attack01:
            WaitForSec(SecondTime, () => { PlayEffect(effectGOSecond); });
            targettState = BaseSkillState.Attack02;
            break;

        case BaseSkillState.Attack02:
            WaitForSec(ThirdTime, () => { PlayEffect(effectGOThird); });
            targettState = BaseSkillState.Attack03;
            break;

        default:
            targettState = BaseSkillState.Attack03;
            break;
        }
    }
Пример #5
0
    public void OnReleaseFinish(DefAction OnFinish)
    {
        if (targettState == curState)
        {
            ResetState();
            OnFinish();
            return;
        }
        switch (curState)
        {
        case BaseSkillState.Idle:
            ResetState();
            break;

        case BaseSkillState.Attack01:
            if (targettState > curState)
            {
                ReleaseAttack02(OnFinish);
                curState = BaseSkillState.Attack02;
            }
            break;

        case BaseSkillState.Attack02:
            if (targettState > curState)
            {
                ReleaseAttack03(OnFinish);
                curState = BaseSkillState.Attack03;
            }
            break;

        default:
            ResetState();
            OnFinish();
            break;
        }
    }
Пример #6
0
 private void ResetState()
 {
     curState = targettState = BaseSkillState.Idle;
 }