Ejemplo n.º 1
0
        // Token: 0x06000549 RID: 1353 RVA: 0x00017B58 File Offset: 0x00015D58
        public override void FixedUpdate()
        {
            base.FixedUpdate();
            this.stopwatch += Time.fixedDeltaTime;
            if (this.animator.GetFloat("FireGauntlet.fire") > 0f && !this.hasFiredGauntlet)
            {
                this.FireGauntlet();
            }
            if (this.stopwatch < this.duration || !base.isAuthority)
            {
                return;
            }
            GenericSkill primary = base.skillLocator.primary;

            if (base.inputBank.skill1.down && primary.CanExecute())
            {
                primary.DeductStock(1);
                FireBolt fireBolt = new FireBolt();
                fireBolt.gauntlet = ((this.gauntlet == FireBolt.Gauntlet.Left) ? FireBolt.Gauntlet.Right : FireBolt.Gauntlet.Left);
                this.outer.SetNextState(fireBolt);
                return;
            }
            this.outer.SetNextStateToMain();
        }
Ejemplo n.º 2
0
        // Token: 0x0600204E RID: 8270 RVA: 0x00098060 File Offset: 0x00096260
        public BaseAI.SkillDriverEvaluation EvaluateSkillDrivers()
        {
            this.UpdateTargets();
            BaseAI.SkillDriverEvaluation result = default(BaseAI.SkillDriverEvaluation);
            float num = 1f;

            if (this.bodyHealthComponent)
            {
                num = this.bodyHealthComponent.combinedHealthFraction;
            }
            float positiveInfinity = float.PositiveInfinity;

            if (this.bodySkillLocator)
            {
                for (int i = 0; i < this.skillDrivers.Length; i++)
                {
                    AISkillDriver aiskillDriver = this.skillDrivers[i];
                    if (!aiskillDriver.noRepeat || !(this.skillDriverEvaluation.dominantSkillDriver == aiskillDriver))
                    {
                        BaseAI.Target target = null;
                        if (aiskillDriver.skillSlot != SkillSlot.None && aiskillDriver.requireSkillReady)
                        {
                            GenericSkill skill = this.bodySkillLocator.GetSkill(aiskillDriver.skillSlot);
                            if (!skill || !skill.CanExecute())
                            {
                                goto IL_293;
                            }
                        }
                        if (aiskillDriver.minUserHealthFraction <= num && aiskillDriver.maxUserHealthFraction >= num)
                        {
                            switch (aiskillDriver.moveTargetType)
                            {
                            case AISkillDriver.TargetType.CurrentEnemy:
                                if (this.GameObjectPassesSkillDriverFilters(this.currentEnemy, aiskillDriver, out positiveInfinity))
                                {
                                    target = this.currentEnemy;
                                }
                                break;

                            case AISkillDriver.TargetType.NearestFriendlyInSkillRange:
                                if (this.bodyInputBank)
                                {
                                    this.buddySearch.teamMaskFilter = TeamMask.none;
                                    this.buddySearch.teamMaskFilter.AddTeam(this.master.teamIndex);
                                    this.buddySearch.sortMode          = BullseyeSearch.SortMode.Distance;
                                    this.buddySearch.minDistanceFilter = aiskillDriver.minDistanceSqr;
                                    this.buddySearch.maxDistanceFilter = aiskillDriver.maxDistance;
                                    this.buddySearch.searchOrigin      = this.bodyInputBank.aimOrigin;
                                    this.buddySearch.searchDirection   = this.bodyInputBank.aimDirection;
                                    this.buddySearch.maxAngleFilter    = 180f;
                                    this.buddySearch.filterByLoS       = aiskillDriver.activationRequiresTargetLoS;
                                    this.buddySearch.RefreshCandidates();
                                    this.buddySearch.FilterCandidatesByHealthFraction(aiskillDriver.minTargetHealthFraction, aiskillDriver.maxTargetHealthFraction);
                                    HurtBox hurtBox = this.buddySearch.GetResults().FirstOrDefault <HurtBox>();
                                    if (hurtBox && hurtBox.healthComponent)
                                    {
                                        this.buddy.gameObject  = hurtBox.healthComponent.gameObject;
                                        this.buddy.bestHurtBox = hurtBox;
                                    }
                                    if (this.GameObjectPassesSkillDriverFilters(this.buddy, aiskillDriver, out positiveInfinity))
                                    {
                                        target = this.buddy;
                                    }
                                }
                                break;

                            case AISkillDriver.TargetType.CurrentLeader:
                                if (this.GameObjectPassesSkillDriverFilters(this.leader, aiskillDriver, out positiveInfinity))
                                {
                                    target = this.leader;
                                }
                                break;
                            }
                            if (target != null)
                            {
                                result.dominantSkillDriver = aiskillDriver;
                                result.target = target;
                                result.separationSqrMagnitude = positiveInfinity;
                                break;
                            }
                        }
                    }
                    IL_293 :;
                }
            }
            return(result);
        }