public override void Initialize() { base.Initialize(); this._bullets = new ChaingunBullet(this.x, this.y); this._bullets.parentThing = (Thing)this; this._topBullet = this._bullets; float num = 0.1f; ChaingunBullet chaingunBullet1 = (ChaingunBullet)null; for (int index = 0; index < 9; ++index) { ChaingunBullet chaingunBullet2 = new ChaingunBullet(this.x, this.y); chaingunBullet2.parentThing = (Thing)this._bullets; this._bullets = chaingunBullet2; chaingunBullet2.waveAdd = num; num += 0.4f; if (index == 0) { this._topBullet.childThing = (Thing)chaingunBullet2; } else { chaingunBullet1.childThing = (Thing)chaingunBullet2; } chaingunBullet1 = chaingunBullet2; } }
public override void Update() { if (this._topBullet != null) { this._topBullet.DoUpdate(); int num = (int)((double)this.ammo / (double)this.bulletsTillRemove); if (num < this.numHanging) { this._topBullet = this._topBullet.childThing as ChaingunBullet; if (this._topBullet != null) { this._topBullet.parentThing = (Thing)this; } } this.numHanging = num; } this._fireWait = (float)(0.699999988079071 + (double)Maths.NormalizeSection(this._barrelHeat, 5f, 9f) * 5.0); if ((double)this._barrelHeat > 11.0) { this._barrelHeat = 11f; } this._barrelHeat -= 0.005f; if ((double)this._barrelHeat < 0.0) { this._barrelHeat = 0.0f; } this._sprite.speed = this._spin; this._tip.speed = this._spin; if ((double)this._spin > 0.0) { this._spin -= 0.01f; } else { this._spin = 0.0f; } base.Update(); if (this._topBullet == null) { return; } if (!this.graphic.flipH) { this._topBullet.chainOffset = new Vec2(1f, 5f); } else { this._topBullet.chainOffset = new Vec2(-1f, 5f); } }
public override void Update() { if (!this.burntOut && (double)this.burnt >= 1.0) { Vec2 vec2 = this.Offset(new Vec2(10f, 0.0f)); Level.Add((Thing)SmallSmoke.New(vec2.x, vec2.y)); this._onFire = false; this.flammable = 0.0f; this.burntOut = true; } if (this._topBullet != null) { this._topBullet.DoUpdate(); int num = (int)((double)this.ammo / (double)this.bulletsTillRemove); if (num < this.numHanging) { this._topBullet = this._topBullet.childThing as ChaingunBullet; if (this._topBullet != null) { this._topBullet.parentThing = (Thing)this; } } this.numHanging = num; } this._fireWait = (float)(0.649999976158142 + (double)Maths.NormalizeSection(this._barrelHeat, 5f, 9f) * 3.0) + Rando.Float(0.25f); if ((double)this._barrelHeat > 10.0) { this._barrelHeat = 10f; } this._barrelHeat -= 0.005f; if ((double)this._barrelHeat < 0.0) { this._barrelHeat = 0.0f; } if (!this.burntOut) { this._sprite.speed = this._spin; this._tip.speed = this._spin; if ((double)this._spin > 0.0) { this._spin -= 0.01f; } else { this._spin = 0.0f; } } base.Update(); if (this._topBullet == null) { return; } if (!this.graphic.flipH) { this._topBullet.chainOffset = new Vec2(1f, 5f); } else { this._topBullet.chainOffset = new Vec2(-1f, 5f); } }