Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace DuckGame
- {
- // Token: 0x0200002E RID: 46
- public abstract class Gun : Holdable
- {
- // Token: 0x0600031D RID: 797 RVA: 0x00003411 File Offset: 0x00001611
- public bool CanSpawnInfinite()
- {
- return true;
- }
- // Token: 0x17000119 RID: 281
- // (get) Token: 0x0600031E RID: 798 RVA: 0x00005533 File Offset: 0x00003733
- public AmmoType ammoType
- {
- get
- {
- return this._ammoType;
- }
- }
- // Token: 0x1700011A RID: 282
- // (get) Token: 0x0600031F RID: 799 RVA: 0x0000553B File Offset: 0x0000373B
- // (set) Token: 0x06000320 RID: 800 RVA: 0x00005544 File Offset: 0x00003744
- public sbyte netAmmo
- {
- get
- {
- return (sbyte)this.ammo;
- }
- set
- {
- this.ammo = (int)value;
- }
- }
- // Token: 0x1700011B RID: 283
- // (get) Token: 0x06000321 RID: 801 RVA: 0x0000554D File Offset: 0x0000374D
- public bool lowerOnFire
- {
- get
- {
- return this._lowerOnFire;
- }
- }
- // Token: 0x1700011C RID: 284
- // (get) Token: 0x06000322 RID: 802 RVA: 0x00005555 File Offset: 0x00003755
- public string bio
- {
- get
- {
- return this._bio;
- }
- }
- // Token: 0x1700011D RID: 285
- // (get) Token: 0x06000323 RID: 803 RVA: 0x0000555D File Offset: 0x0000375D
- public Vec2 barrelPosition
- {
- get
- {
- return this.Offset(this.barrelOffset);
- }
- }
- // Token: 0x1700011E RID: 286
- // (get) Token: 0x06000324 RID: 804 RVA: 0x0000556B File Offset: 0x0000376B
- public Vec2 barrelOffset
- {
- get
- {
- return this._barrelOffsetTL - this.center + this._extraOffset;
- }
- }
- // Token: 0x1700011F RID: 287
- // (get) Token: 0x06000325 RID: 805 RVA: 0x00005589 File Offset: 0x00003789
- public Vec2 laserOffset
- {
- get
- {
- return this._laserOffsetTL - this.center;
- }
- }
- // Token: 0x17000120 RID: 288
- // (get) Token: 0x06000326 RID: 806 RVA: 0x0000559C File Offset: 0x0000379C
- public Vec2 barrelVector
- {
- get
- {
- return this.Offset(this.barrelOffset) - this.Offset(this.barrelOffset + new Vec2(-1f, 0f));
- }
- }
- // Token: 0x17000121 RID: 289
- // (get) Token: 0x06000327 RID: 807 RVA: 0x000055CF File Offset: 0x000037CF
- // (set) Token: 0x06000328 RID: 808 RVA: 0x00003255 File Offset: 0x00001455
- public override float angle
- {
- get
- {
- return this._angle + this._accuracyWave * (this._accuracyLost * 0.5f);
- }
- set
- {
- this._angle = value;
- }
- }
- // Token: 0x17000122 RID: 290
- // (get) Token: 0x06000329 RID: 809 RVA: 0x000055F0 File Offset: 0x000037F0
- public float barrelAngleOffset
- {
- get
- {
- return this._barrelAngleOffset;
- }
- }
- // Token: 0x17000123 RID: 291
- // (get) Token: 0x0600032A RID: 810 RVA: 0x000055F8 File Offset: 0x000037F8
- public float barrelAngle
- {
- get
- {
- return Maths.DegToRad(Maths.PointDirection(Vec2.Zero, this.barrelVector) + this._barrelAngleOffset * (float)this.offDir);
- }
- }
- // Token: 0x0600032B RID: 811 RVA: 0x0000561E File Offset: 0x0000381E
- public bool CanSpin()
- {
- return this.weight <= 5f;
- }
- // Token: 0x0600032C RID: 812 RVA: 0x00005630 File Offset: 0x00003830
- public override void EditorPropertyChanged(object property)
- {
- this.infiniteAmmoVal = this.infinite.value;
- this.UpdateMaterial();
- }
- // Token: 0x0600032D RID: 813 RVA: 0x00003424 File Offset: 0x00001624
- public virtual void OnNetworkBulletsFired(Vec2 pos)
- {
- }
- // Token: 0x0600032E RID: 814 RVA: 0x0002A134 File Offset: 0x00028334
- public void UpdateMaterial()
- {
- if (this.infinite.value)
- {
- this.infiniteAmmoVal = true;
- }
- if (this.infiniteAmmoVal)
- {
- if (base.material == null)
- {
- base.material = new MaterialGold(this);
- return;
- }
- }
- else
- {
- if (base.material == null && this.heat > 0.1f && this.physicsMaterial == PhysicsMaterial.Metal)
- {
- base.material = new MaterialRedHot(this);
- return;
- }
- if (base.material is MaterialRedHot)
- {
- if (this.heat < 0.1f)
- {
- base.material = null;
- return;
- }
- (base.material as MaterialRedHot).intensity = Math.Min(this.heat - 0.1f, 1f);
- }
- }
- }
- // Token: 0x17000124 RID: 292
- // (get) Token: 0x0600032F RID: 815 RVA: 0x00005649 File Offset: 0x00003849
- public bool fullAuto
- {
- get
- {
- return this._fullAuto;
- }
- }
- // Token: 0x06000330 RID: 816 RVA: 0x0002A1E8 File Offset: 0x000283E8
- public Gun(float xval, float yval) : base(xval, yval)
- {
- this._flare = new SpriteMap("smallFlare", 11, 10, false);
- this._flare.center = new Vec2(0f, 5f);
- this._barrelSmoke = new SpriteMap("barrelSmoke", 8, 8, false);
- this._barrelSmoke.center = new Vec2(1f, 8f);
- this._barrelSmoke.ClearAnimations();
- this._barrelSmoke.AddAnimation("puff", 1f, false, new int[]
- {
- 0,
- 1,
- 2
- });
- this._barrelSmoke.AddAnimation("loop", 1f, true, new int[]
- {
- 3,
- 4,
- 5,
- 6,
- 7,
- 8
- });
- this._barrelSmoke.AddAnimation("finish", 1f, false, new int[]
- {
- 9,
- 10,
- 11,
- 12
- });
- this._barrelSmoke.SetAnimation("puff");
- this._barrelSmoke.speed = 0f;
- this._translucent = true;
- this.physicsMaterial = PhysicsMaterial.Metal;
- this._dontCrush = true;
- this._clickPuff = new SpriteMap("clickPuff", 16, 16, false);
- this._clickPuff.AddAnimation("puff", 0.3f, false, new int[]
- {
- 0,
- 1,
- 2,
- 3
- });
- this._clickPuff.center = new Vec2(0f, 12f);
- this._sightHit = new Sprite("laserSightHit", 0f, 0f);
- this._sightHit.CenterOrigin();
- base.depth = -0.1f;
- this.infinite = new EditorProperty<bool>(false, this, 0f, 1f, 0.1f, null, false, false);
- base.collideSounds.Add("smallMetalCollide");
- base.impactVolume = 0.3f;
- }
- // Token: 0x06000331 RID: 817 RVA: 0x0002A4B4 File Offset: 0x000286B4
- public void DoAmmoClick()
- {
- this._doPuff = true;
- this._clickPuff.frame = 0;
- this._clickPuff.SetAnimation("puff");
- this._barrelHeat = 0f;
- this._barrelSmoke.SetAnimation("finish");
- SFX.Play(this._clickSound, 1f, 0f, 0f, false);
- for (int i = 0; i < 2; i++)
- {
- SmallSmoke smallSmoke = SmallSmoke.New(this.barrelPosition.x, this.barrelPosition.y);
- smallSmoke.scale = new Vec2(0.3f, 0.3f);
- smallSmoke.hSpeed = Rando.Float(-0.1f, 0.1f);
- smallSmoke.vSpeed = -Rando.Float(0.05f, 0.2f);
- smallSmoke.alpha = 0.6f;
- Level.Add(smallSmoke);
- }
- }
- // Token: 0x06000332 RID: 818 RVA: 0x0002A594 File Offset: 0x00028794
- public override void HeatUp(Vec2 location)
- {
- if (this._ammoType != null && this._ammoType.combustable && this.ammo > 0 && this.heat > 1f && Rando.Float(1f) > 0.8f)
- {
- this.heat -= 0.05f;
- this.PressAction();
- if (Rando.Float(1f) > 0.4f)
- {
- SFX.Play("bulletPop", Rando.Float(0.5f, 1f), Rando.Float(-1f, 1f), 0f, false);
- }
- }
- }
- // Token: 0x06000333 RID: 819 RVA: 0x00005651 File Offset: 0x00003851
- public override void DoUpdate()
- {
- if (this.laserSight && this._laserTex == null)
- {
- this._additiveMaterial = new Material("Shaders/basicAdd");
- this._laserTex = Content.Load<Tex2D>("pointerLaser");
- }
- base.DoUpdate();
- }
- // Token: 0x06000334 RID: 820 RVA: 0x0002A638 File Offset: 0x00028838
- public override void Update()
- {
- if (this.infiniteAmmoVal)
- {
- this.ammo = 99;
- }
- if (TeamSelect2.Enabled("INFAMMO", false))
- {
- this.infinite.value = true;
- this.infiniteAmmoVal = true;
- }
- this.UpdateMaterial();
- base.Update();
- if (this._clickPuff.finished)
- {
- this._doPuff = false;
- }
- this._accuracyLost = Maths.CountDown(this._accuracyLost, 0.015f, 0f);
- if (this._flareAlpha > 0f)
- {
- this._flareAlpha -= 0.5f;
- }
- else
- {
- this._flareAlpha = 0f;
- }
- if (this._barrelHeat > 0f)
- {
- this._barrelHeat -= 0.01f;
- }
- else
- {
- this._barrelHeat = 0f;
- }
- if (this._barrelHeat > 10f)
- {
- this._barrelHeat = 10f;
- }
- if (this._smokeWait > 0f)
- {
- this._smokeWait -= 0.1f;
- }
- else
- {
- if (this._barrelHeat > 0.1f && this._barrelSmoke.speed == 0f)
- {
- this._barrelSmoke.SetAnimation("puff");
- this._barrelSmoke.speed = 0.1f;
- }
- if (this._barrelSmoke.speed > 0f && this._barrelSmoke.currentAnimation == "puff" && this._barrelSmoke.finished)
- {
- this._barrelSmoke.SetAnimation("loop");
- }
- if (this._barrelSmoke.speed > 0f && this._barrelSmoke.currentAnimation == "loop" && this._barrelSmoke.frame == 5 && this._barrelHeat < 0.1f)
- {
- this._barrelSmoke.SetAnimation("finish");
- }
- }
- if (this._smokeWait > 0f && this._barrelSmoke.speed > 0f)
- {
- this._barrelSmoke.SetAnimation("finish");
- }
- if (this._barrelSmoke.currentAnimation == "finish" && this._barrelSmoke.finished)
- {
- this._barrelSmoke.speed = 0f;
- }
- if (this.owner != null)
- {
- if (this.owner.hSpeed > 0.1f)
- {
- this._smokeAngle -= 0.1f;
- }
- else if (this.owner.hSpeed < -0.1f)
- {
- this._smokeAngle += 0.1f;
- }
- if (this._smokeAngle > 0.4f)
- {
- this._smokeAngle = 0.4f;
- }
- if (this._smokeAngle < -0.4f)
- {
- this._smokeAngle = -0.4f;
- }
- if (this.owner.vSpeed > 0.1f)
- {
- this._smokeFlatten -= 0.1f;
- }
- else if (this.owner.vSpeed < -0.1f)
- {
- this._smokeFlatten += 0.1f;
- }
- if (this._smokeFlatten > 0.5f)
- {
- this._smokeFlatten = 0.5f;
- }
- if (this._smokeFlatten < -0.5f)
- {
- this._smokeFlatten = -0.5f;
- }
- this._framesSinceThrown = 0;
- }
- else
- {
- this._framesSinceThrown += 1;
- if (this._framesSinceThrown > 15)
- {
- this._framesSinceThrown = 15;
- }
- }
- if (!(this is Sword) && this.owner == null && this.CanSpin() && Level.current.simulatePhysics)
- {
- bool flag = false;
- bool flag2 = false;
- if ((Math.Abs(this.hSpeed) + Math.Abs(this.vSpeed) > 2f || !base.grounded) && this.gravMultiplier > 0f && !flag2 && !this._grounded)
- {
- if (this.offDir > 0)
- {
- base.angleDegrees += (Math.Abs(this.hSpeed * 2f) + Math.Abs(this.vSpeed)) * 1f + 5f;
- }
- else
- {
- base.angleDegrees -= (Math.Abs(this.hSpeed * 2f) + Math.Abs(this.vSpeed)) * 1f + 5f;
- }
- flag = true;
- }
- if (!flag || flag2)
- {
- base.angleDegrees %= 360f;
- if (base.angleDegrees < 0f)
- {
- base.angleDegrees += 360f;
- }
- if (flag2)
- {
- if (Math.Abs(base.angleDegrees - 90f) < Math.Abs(base.angleDegrees + 90f))
- {
- base.angleDegrees = Lerp.Float(base.angleDegrees, 90f, 16f);
- }
- else
- {
- base.angleDegrees = Lerp.Float(-90f, 0f, 16f);
- }
- }
- else if (base.angleDegrees > 90f && base.angleDegrees < 270f)
- {
- base.angleDegrees = Lerp.Float(base.angleDegrees, 180f, 14f);
- }
- else
- {
- if (base.angleDegrees > 180f)
- {
- base.angleDegrees -= 360f;
- }
- else if (base.angleDegrees < -180f)
- {
- base.angleDegrees += 360f;
- }
- base.angleDegrees = Lerp.Float(base.angleDegrees, 0f, 14f);
- }
- }
- }
- float num = 1f - ((float)Math.Sin((double)Maths.DegToRad(base.angleDegrees + 90f)) + 1f) / 2f;
- if (this._owner == null)
- {
- this._extraOffset.y = num * (this._collisionOffset.y + this._collisionSize.y + this._collisionOffset.y);
- }
- else
- {
- this._extraOffset.y = 0f;
- }
- if (this.owner == null || (this.owner.hSpeed > -0.1f && this.owner.hSpeed < 0.1f))
- {
- if (this._smokeAngle >= 0.1f)
- {
- this._smokeAngle -= 0.1f;
- }
- else if (this._smokeAngle <= -0.1f)
- {
- this._smokeAngle += 0.1f;
- }
- else
- {
- this._smokeAngle = 0f;
- }
- }
- if (this.owner == null || (this.owner.vSpeed > -0.1f && this.owner.vSpeed < 0.1f))
- {
- if (this._smokeFlatten >= 0.1f)
- {
- this._smokeFlatten -= 0.1f;
- }
- else if (this._smokeFlatten <= -0.1f)
- {
- this._smokeFlatten += 0.1f;
- }
- else
- {
- this._smokeFlatten = 0f;
- }
- }
- if (this.kick > 0f)
- {
- this.kick -= 0.2f;
- }
- else
- {
- this.kick = 0f;
- }
- if (this.owner == null)
- {
- if (this.ammo <= 0 && (base.alpha < 0.99f || (base.grounded && Math.Abs(this.hSpeed) + Math.Abs(this.vSpeed) < 0.3f)))
- {
- this.canPickUp = false;
- base.alpha -= 10.2f;
- this.weight = 0.01f;
- }
- if ((double)base.alpha < 0.0)
- {
- Level.Remove(this);
- }
- }
- if (this.owner != null)
- {
- this.graphic.flipH = this.owner.graphic.flipH;
- }
- if (this._wait > 0f)
- {
- this._wait -= 0.15f;
- }
- if (this._wait < 0f)
- {
- this._wait = 0f;
- }
- }
- // Token: 0x06000335 RID: 821 RVA: 0x0002AE40 File Offset: 0x00029040
- public override void Terminate()
- {
- if (!(Level.current is Editor))
- {
- Level.Add(SmallSmoke.New(base.x, base.y));
- Level.Add(SmallSmoke.New(base.x + 4f, base.y));
- Level.Add(SmallSmoke.New(base.x - 4f, base.y));
- Level.Add(SmallSmoke.New(base.x, base.y + 4f));
- Level.Add(SmallSmoke.New(base.x, base.y - 4f));
- }
- base.Terminate();
- }
- // Token: 0x06000336 RID: 822 RVA: 0x0002AEE8 File Offset: 0x000290E8
- public override void PressAction()
- {
- if (base.isServerForObject && TeamSelect2.Enabled("GUNEXPL", false) && this.ammo <= 0)
- {
- if (base.duck != null)
- {
- base.duck.ThrowItem(true);
- Level.Remove(this);
- for (int i = 0; i < 1; i++)
- {
- ExplosionPart explosionPart = new ExplosionPart(base.x - 8f + Rando.Float(16f), base.y - 8f + Rando.Float(16f), true);
- explosionPart.xscale *= 0.7f;
- explosionPart.yscale *= 0.7f;
- Level.Add(explosionPart);
- }
- SFX.Play("explode", 1f, 0f, 0f, false);
- List<Bullet> list = new List<Bullet>();
- for (int j = 0; j < 12; j++)
- {
- float num = (float)j * 30f - 10f + Rando.Float(20f);
- ATShrapnel atshrapnel = new ATShrapnel();
- atshrapnel.range = 25f + Rando.Float(10f);
- Bullet bullet = new Bullet(base.x + (float)(Math.Cos((double)Maths.DegToRad(num)) * 8.0), base.y - (float)(Math.Sin((double)Maths.DegToRad(num)) * 8.0), atshrapnel, num, null, false, -1f, false, true);
- bullet.firedFrom = this;
- list.Add(bullet);
- Level.Add(bullet);
- }
- if (Network.isActive)
- {
- Send.Message(new NMExplodingProp(list), NetMessagePriority.ReliableOrdered, null);
- list.Clear();
- return;
- }
- }
- }
- else
- {
- base.PressAction();
- }
- }
- // Token: 0x06000337 RID: 823 RVA: 0x00005689 File Offset: 0x00003889
- public override void OnPressAction()
- {
- if (!this._fullAuto)
- {
- this.Fire();
- }
- }
- // Token: 0x06000338 RID: 824 RVA: 0x00005699 File Offset: 0x00003899
- public override void OnHoldAction()
- {
- if (this._fullAuto)
- {
- this.Fire();
- }
- }
- // Token: 0x06000339 RID: 825 RVA: 0x0002B098 File Offset: 0x00029298
- public void ApplyKick()
- {
- if (this.owner != null)
- {
- if (this._kickForce > 0f)
- {
- if (this.owner is Duck && (this.owner as Duck).ragdoll != null && (this.owner as Duck).HasEquipment(typeof(FancyShoes)) && (this.owner as Duck).ragdoll.part2 != null)
- {
- Duck duck = this.owner as Duck;
- Vec2 vec = -this.barrelVector * this._kickForce;
- duck.ragdoll.part2.hSpeed += vec.x;
- duck.ragdoll.part2.vSpeed += vec.y;
- }
- else
- {
- Vec2 vec2 = -this.barrelVector * this._kickForce;
- if (Math.Sign(this.owner.hSpeed) != Math.Sign(vec2.x) || Math.Abs(vec2.x) > Math.Abs(this.owner.hSpeed))
- {
- this.owner.hSpeed = vec2.x;
- }
- Duck duck2 = this.owner as Duck;
- if (duck2 != null)
- {
- if (duck2.crouch)
- {
- duck2.sliding = true;
- }
- this.owner.vSpeed += vec2.y - this._kickForce * 0.333f;
- }
- else
- {
- this.owner.vSpeed += vec2.y - this._kickForce * 0.333f;
- }
- }
- }
- this.kick = 1f;
- }
- }
- // Token: 0x0600033A RID: 826 RVA: 0x0002B250 File Offset: 0x00029450
- public virtual void Fire()
- {
- if (!this.loaded)
- {
- return;
- }
- this.firedBullets.Clear();
- if (this.ammo > 0 && this._wait == 0f)
- {
- this.ApplyKick();
- for (int i = 0; i < this._numBulletsPerFire; i++)
- {
- float accuracy = this._ammoType.accuracy;
- this._ammoType.accuracy *= 1f - this._accuracyLost;
- this._ammoType.bulletColor = this._bulletColor;
- float num = base.angleDegrees;
- if (this.offDir < 0)
- {
- num += 180f;
- num -= this._ammoType.barrelAngleDegrees;
- }
- else
- {
- num += this._ammoType.barrelAngleDegrees;
- }
- if (!this.receivingPress)
- {
- if (this._ammoType is ATDart)
- {
- if (base.isServerForObject)
- {
- Vec2 vec = this.Offset(this.barrelOffset);
- Dart dart = new Dart(vec.x, vec.y, this.owner as Duck, -num);
- base.Fondle(dart);
- if (base.onFire || this._barrelHeat > 6f)
- {
- Level.Add(SmallFire.New(0f, 0f, 0f, 0f, false, dart, true, this, false));
- dart.burning = true;
- dart.onFire = true;
- base.Burn(this.position, this);
- }
- Vec2 vec2 = Maths.AngleToVec(Maths.DegToRad(-num));
- dart.hSpeed = vec2.x * 10f;
- dart.vSpeed = vec2.y * 10f;
- Level.Add(dart);
- }
- }
- else
- {
- Bullet bullet = this._ammoType.FireBullet(this.Offset(this.barrelOffset), this.owner, num, this);
- if (Network.isActive && base.isServerForObject)
- {
- this.firedBullets.Add(bullet);
- if (base.duck != null && base.duck.profile.connection != null)
- {
- bullet.connection = base.duck.profile.connection;
- }
- }
- if (base.isServerForObject && (this is LaserRifle || this is PewPewLaser || this is Phaser))
- {
- StatBinding laserBulletsFired = Global.data.laserBulletsFired;
- int valueInt = laserBulletsFired.valueInt;
- laserBulletsFired.valueInt = valueInt + 1;
- }
- }
- }
- this.bulletFireIndex += 1;
- this._ammoType.accuracy = accuracy;
- this._barrelHeat += 0.3f;
- }
- this._smokeWait = 3f;
- this.loaded = false;
- this._flareAlpha = 1.5f;
- if (!this._manualLoad)
- {
- this.Reload(true);
- }
- this.firing = true;
- this._wait = this._fireWait;
- this.PlayFireSound();
- if (this.owner == null)
- {
- Vec2 vec3 = this.barrelVector * Rando.Float(1f, 3f);
- vec3.y += Rando.Float(2f);
- this.hSpeed -= vec3.x;
- this.vSpeed -= vec3.y;
- }
- this._accuracyLost += this.loseAccuracy;
- if (this._accuracyLost > this.maxAccuracyLost)
- {
- this._accuracyLost = this.maxAccuracyLost;
- return;
- }
- }
- else if (this.ammo <= 0 && this._wait == 0f)
- {
- this.DoAmmoClick();
- this._wait = this._fireWait;
- }
- }
- // Token: 0x0600033B RID: 827 RVA: 0x000056A9 File Offset: 0x000038A9
- protected virtual void PlayFireSound()
- {
- SFX.Play(this._fireSound, 1f, -0.1f + Rando.Float(0.2f) + this._fireSoundPitch, 0f, false);
- }
- // Token: 0x0600033C RID: 828 RVA: 0x000056D9 File Offset: 0x000038D9
- public virtual void Reload(bool shell = true)
- {
- if (this.ammo != 0)
- {
- if (shell)
- {
- this._ammoType.PopShell(base.x, base.y, (int)(-(int)this.offDir));
- }
- this.ammo--;
- }
- this.loaded = true;
- }
- // Token: 0x0600033D RID: 829 RVA: 0x0002B5E0 File Offset: 0x000297E0
- public override void Draw()
- {
- if (this.laserSight && this.owner != null)
- {
- ATTracer attracer = new ATTracer();
- attracer.range = 2000f;
- float num = base.angleDegrees;
- num *= -1f;
- if (this.offDir < 0)
- {
- num += 180f;
- }
- Vec2 vec = this.Offset(this.laserOffset);
- attracer.penetration = 0.4f;
- Bullet bullet = new Bullet(vec.x, vec.y, attracer, num, this.owner, false, -1f, true, true);
- this._wallPoint = bullet.end;
- this._laserInit = true;
- }
- Graphics.material = null;
- if (this.owner != null)
- {
- this.graphic.flipH = this.owner.graphic.flipH;
- }
- else
- {
- this.graphic.flipH = (this.offDir <= 0);
- }
- if (this._doPuff)
- {
- this._clickPuff.alpha = 0.6f;
- this._clickPuff.angle = this.angle + this._smokeAngle;
- this._clickPuff.flipH = (this.offDir < 0);
- base.Draw(this._clickPuff, this.barrelOffset, 1);
- }
- if (!VirtualTransition.active)
- {
- Graphics.material = base.material;
- }
- base.Draw();
- Graphics.material = null;
- if (this._flareAlpha > 0f)
- {
- base.Draw(this._flare, this.barrelOffset, 1);
- }
- if (this._barrelSmoke.speed > 0f && !base.raised)
- {
- this._barrelSmoke.alpha = 0.7f;
- this._barrelSmoke.angle = this._smokeAngle;
- this._barrelSmoke.flipH = (this.offDir < 0);
- if (this.offDir > 0 && base.angleDegrees > 90f && base.angleDegrees < 270f)
- {
- this._barrelSmoke.flipH = true;
- }
- if (this.offDir < 0 && base.angleDegrees > 90f && base.angleDegrees < 270f)
- {
- this._barrelSmoke.flipH = false;
- }
- this._barrelSmoke.yscale = 1f - this._smokeFlatten;
- base.DrawIgnoreAngle(this._barrelSmoke, this.barrelOffset, 1);
- }
- if (!VirtualTransition.active)
- {
- Graphics.material = base.material;
- }
- }
- // Token: 0x0600033E RID: 830 RVA: 0x0002B844 File Offset: 0x00029A44
- public override void DrawGlow()
- {
- if (this.laserSight && this.owner != null && this._laserTex != null && this._laserInit)
- {
- Vec2 vec = this.Offset(this.laserOffset);
- float length = (vec - this._wallPoint).length;
- float num = 100f;
- if (this.ammoType != null)
- {
- num = this.ammoType.range;
- }
- Vec2 normalized = (this._wallPoint - vec).normalized;
- Vec2 vec2 = vec + normalized * Math.Min(num, length);
- Graphics.DrawTexturedLine(this._laserTex, vec, vec2, Color.Turquoise, 0.5f, base.depth - 1);
- if (length > num)
- {
- for (int i = 1; i < 4; i++)
- {
- Graphics.DrawTexturedLine(this._laserTex, vec2, vec2 + normalized * 2f, Color.Turquoise * (1f - (float)i * 0.2f), 0.5f, base.depth - 1);
- vec2 += normalized * 2f;
- }
- }
- if (this._sightHit != null && length < num)
- {
- this._sightHit.alpha = 1f;
- this._sightHit.color = Color.Turquoise;
- Graphics.Draw(this._sightHit, this._wallPoint.x, this._wallPoint.y);
- }
- }
- base.DrawGlow();
- }
- // Token: 0x04000211 RID: 529
- public AmmoType _ammoType;
- // Token: 0x04000212 RID: 530
- public StateBinding _ammoBinding = new StateBinding("netAmmo", -1, false, false);
- // Token: 0x04000213 RID: 531
- public StateBinding _waitBinding = new StateBinding("_wait", -1, false, false);
- // Token: 0x04000214 RID: 532
- public StateBinding _loadedBinding = new StateBinding("loaded", -1, false, false);
- // Token: 0x04000215 RID: 533
- public StateBinding _bulletFireIndexBinding = new StateBinding("bulletFireIndex", -1, false, false);
- // Token: 0x04000216 RID: 534
- public StateBinding _heatBinding = new StateBinding("heat", -1, false, false);
- // Token: 0x04000217 RID: 535
- public StateBinding _infiniteAmmoValBinding = new StateBinding("infiniteAmmoVal", -1, false, false);
- // Token: 0x04000218 RID: 536
- public byte bulletFireIndex;
- // Token: 0x04000219 RID: 537
- public bool held;
- // Token: 0x0400021A RID: 538
- public float kick;
- // Token: 0x0400021B RID: 539
- public float _kickForce = 3f;
- // Token: 0x0400021C RID: 540
- public int ammo;
- // Token: 0x0400021D RID: 541
- public bool firing;
- // Token: 0x0400021E RID: 542
- public bool tamping;
- // Token: 0x0400021F RID: 543
- public float tampPos;
- // Token: 0x04000220 RID: 544
- public float loseAccuracy;
- // Token: 0x04000221 RID: 545
- public float _accuracyLost;
- // Token: 0x04000222 RID: 546
- public float maxAccuracyLost;
- // Token: 0x04000223 RID: 547
- protected Color _bulletColor = Color.Gold;
- // Token: 0x04000224 RID: 548
- protected bool _lowerOnFire = true;
- // Token: 0x04000225 RID: 549
- public bool receivingPress;
- // Token: 0x04000226 RID: 550
- public bool hasFireEvents;
- // Token: 0x04000227 RID: 551
- public bool onlyFireAction;
- // Token: 0x04000228 RID: 552
- protected float _fireSoundPitch;
- // Token: 0x04000229 RID: 553
- public EditorProperty<bool> infinite;
- // Token: 0x0400022A RID: 554
- public bool infiniteAmmoVal;
- // Token: 0x0400022B RID: 555
- protected string _bio = "No Info.";
- // Token: 0x0400022C RID: 556
- protected Vec2 _barrelOffsetTL;
- // Token: 0x0400022D RID: 557
- protected Vec2 _laserOffsetTL;
- // Token: 0x0400022E RID: 558
- public float _barrelAngleOffset;
- // Token: 0x0400022F RID: 559
- protected string _fireSound = "pistol";
- // Token: 0x04000230 RID: 560
- protected string _clickSound = "click";
- // Token: 0x04000231 RID: 561
- public float _wait;
- // Token: 0x04000232 RID: 562
- public float _fireWait = 1f;
- // Token: 0x04000233 RID: 563
- public bool loaded = true;
- // Token: 0x04000234 RID: 564
- private bool _laserInit;
- // Token: 0x04000235 RID: 565
- public bool _fullAuto;
- // Token: 0x04000236 RID: 566
- public int _numBulletsPerFire = 1;
- // Token: 0x04000237 RID: 567
- protected bool _manualLoad;
- // Token: 0x04000238 RID: 568
- public bool laserSight;
- // Token: 0x04000239 RID: 569
- protected SpriteMap _flare;
- // Token: 0x0400023A RID: 570
- protected float _flareAlpha;
- // Token: 0x0400023B RID: 571
- private SpriteMap _barrelSmoke;
- // Token: 0x0400023C RID: 572
- public float _barrelHeat;
- // Token: 0x0400023D RID: 573
- protected float _smokeWait;
- // Token: 0x0400023E RID: 574
- protected float _smokeAngle;
- // Token: 0x0400023F RID: 575
- protected float _smokeFlatten;
- // Token: 0x04000240 RID: 576
- public SinWave _accuracyWave = 0.3f;
- // Token: 0x04000241 RID: 577
- private SpriteMap _clickPuff;
- // Token: 0x04000242 RID: 578
- private Tex2D _laserTex;
- // Token: 0x04000243 RID: 579
- protected Vec2 _wallPoint;
- // Token: 0x04000244 RID: 580
- protected Sprite _sightHit;
- // Token: 0x04000245 RID: 581
- public bool _doPuff;
- // Token: 0x04000246 RID: 582
- public byte _framesSinceThrown;
- // Token: 0x04000247 RID: 583
- public List<Bullet> firedBullets = new List<Bullet>();
- // Token: 0x04000248 RID: 584
- private Material _additiveMaterial;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement