Exemple #1
0
        // Token: 0x060023CE RID: 9166 RVA: 0x000A8464 File Offset: 0x000A6664
        private void FixedUpdate()
        {
            float fillAmount = 0f;

            if (this.hudElement.targetCharacterBody)
            {
                SkillLocator component = this.hudElement.targetCharacterBody.GetComponent <SkillLocator>();
                if (component && component.secondary)
                {
                    EntityStateMachine stateMachine = component.secondary.stateMachine;
                    if (stateMachine)
                    {
                        ScopeSniper scopeSniper = stateMachine.state as ScopeSniper;
                        if (scopeSniper != null)
                        {
                            fillAmount = scopeSniper.charge;
                        }
                    }
                }
            }
            if (this.image)
            {
                this.image.fillAmount = fillAmount;
            }
        }
Exemple #2
0
        // Token: 0x060004AF RID: 1199 RVA: 0x000137A4 File Offset: 0x000119A4
        public override void OnEnter()
        {
            base.OnEnter();
            float num = 0f;

            if (base.skillLocator)
            {
                GenericSkill secondary = base.skillLocator.secondary;
                if (secondary)
                {
                    EntityStateMachine stateMachine = secondary.stateMachine;
                    if (stateMachine)
                    {
                        ScopeSniper scopeSniper = stateMachine.state as ScopeSniper;
                        if (scopeSniper != null)
                        {
                            num = scopeSniper.charge;
                            scopeSniper.charge = 0f;
                        }
                    }
                }
            }
            base.AddRecoil(-1f * FireRifle.recoilAmplitude, -2f * FireRifle.recoilAmplitude, -0.5f * FireRifle.recoilAmplitude, 0.5f * FireRifle.recoilAmplitude);
            this.duration = FireRifle.baseDuration / this.attackSpeedStat;
            Ray aimRay = base.GetAimRay();

            base.StartAimMode(aimRay, 2f, false);
            Util.PlaySound(FireRifle.attackSoundString, base.gameObject);
            base.PlayAnimation("Gesture", "FireShotgun", "FireShotgun.playbackRate", this.duration * 1.1f);
            string muzzleName = "MuzzleShotgun";

            if (FireRifle.effectPrefab)
            {
                EffectManager.instance.SimpleMuzzleFlash(FireRifle.effectPrefab, base.gameObject, muzzleName, false);
            }
            if (base.isAuthority)
            {
                BulletAttack bulletAttack = new BulletAttack();
                bulletAttack.owner              = base.gameObject;
                bulletAttack.weapon             = base.gameObject;
                bulletAttack.origin             = aimRay.origin;
                bulletAttack.aimVector          = aimRay.direction;
                bulletAttack.minSpread          = 0f;
                bulletAttack.maxSpread          = base.characterBody.spreadBloomAngle;
                bulletAttack.bulletCount        = (uint)((FireRifle.bulletCount > 0) ? FireRifle.bulletCount : 0);
                bulletAttack.procCoefficient    = 1f / (float)FireRifle.bulletCount;
                bulletAttack.damage             = Mathf.LerpUnclamped(FireRifle.minChargeDamageCoefficient, FireRifle.maxChargeDamageCoefficient, num) * this.damageStat / (float)FireRifle.bulletCount;
                bulletAttack.force              = Mathf.LerpUnclamped(FireRifle.minChargeForce, FireRifle.maxChargeForce, num);
                bulletAttack.falloffModel       = BulletAttack.FalloffModel.None;
                bulletAttack.tracerEffectPrefab = FireRifle.tracerEffectPrefab;
                bulletAttack.muzzleName         = muzzleName;
                bulletAttack.hitEffectPrefab    = FireRifle.hitEffectPrefab;
                bulletAttack.isCrit             = Util.CheckRoll(this.critStat, base.characterBody.master);
                if (num == 1f)
                {
                    bulletAttack.stopperMask = LayerIndex.world.mask;
                }
                bulletAttack.HitEffectNormal = false;
                bulletAttack.radius          = 0f;
                bulletAttack.sniper          = true;
                bulletAttack.Fire();
            }
            base.characterBody.AddSpreadBloom(FireRifle.spreadBloomValue);
        }