public override void Update() { if (GameMode.started) { Level.Remove((Thing)this); } this.distOut = Lerp.FloatSmooth(this.distOut, 16f, 0.08f, 1.2f); this.distLen = Lerp.FloatSmooth(this.distLen, 10f, 0.08f, 1.2f); this.rot = Lerp.FloatSmooth(this.rot, 45f, 0.08f, 1.1f); if ((double)Math.Abs(this.rot - 45f) < 20.0) { this.streamAlpha -= 0.03f; if ((double)this.streamAlpha < 0.0) { this.streamAlpha = 0.0f; } } Vec2 to = Vec2.Transform(this.targetPos, Level.current.camera.getMatrix()); to.x *= this.layer.camera.width / (float)Graphics.width; to.y *= this.layer.camera.height / (float)Graphics.height; this.position = Lerp.Vec2Smooth(this.position, to, 0.2f); if ((double)(this.position - to).length > 16.0) { this.prevPos.Add(this.position); } this.sizeWaver += 0.2f; }
public override void UpdateParts() { if (!this.doubleUpdating && Input.Down("JUMP")) { this.doubleUpdating = true; this.UpdateParts(); this.doubleUpdating = false; } if (!this.down && (double)this.yOffset > -1.0) { if ((double)this._initialWait < 1.0) { this._initialWait += 0.06f; } else if ((double)this._insertCoin < 1.0) { if (!this._chinged) { SFX.Play("ching", pitch: Rando.Float(0.4f, 0.6f)); this._chinged = true; } this._insertCoinInc += 0.008f; this._insertCoin += this._insertCoinInc; } else { this._insertCoin = 1f; if ((double)this._afterInsertWait < 1.0) { this._afterInsertWait += 0.2f; } else { if ((double)this._gachaWait >= 0.200000002980232 && !this.played) { this.played = true; SFX.Play("gachaSound", pitch: Rando.Float(-0.1f, 0.1f)); } if (!this._coined && (double)this._gachaWait > 0.200000002980232) { SFX.Play("gachaCoin", pitch: Rando.Float(0.4f, 0.6f)); this._coined = true; } this._gachaWait += 0.04f; if ((double)this._gachaWait >= 1.0) { this._gachaWait = 1f; this.gachaSpeed += 0.25f; if ((double)this.gachaSpeed > 6.0) { this.gachaSpeed = 6f; } this.gachaY += this.gachaSpeed; if ((double)this.gachaY > 50.0 && (double)this.gachaSpeed > 0.0) { if ((double)this.gachaSpeed > 0.800000011920929) { SFX.Play("gachaBounce", pitch: 0.2f); } this.gachaY = 50f; this.gachaSpeed = (float)(-(double)this.gachaSpeed * 0.400000005960464); } float num = 8f; this._toyVelocity.y += 0.2f; Vec2 toyPosition1 = this._toyPosition; if ((double)toyPosition1.length > (double)num) { Vec2 toyPosition2 = this._toyPosition; this._toyPosition = toyPosition1.normalized * num; Vec2 vec2 = this._toyPosition - toyPosition2; this._toyVelocity += vec2; if ((double)vec2.length > 1.0) { SFX.Play("gachaBounce", pitch: (0.7f + Rando.Float(0.2f))); } this._toyAngleLerp = Maths.PointDirection(Vec2.Zero, this._toyPosition); } Vec2 leftStick = InputProfile.active.leftStick; if (InputProfile.active.lastActiveDevice is Keyboard) { if (InputProfile.active.Down("LEFT")) { leftStick.x = -1f; } if (InputProfile.active.Down("RIGHT")) { leftStick.x = 1f; } if (InputProfile.active.Down("UP")) { leftStick.y = 1f; } if (InputProfile.active.Down("DOWN")) { leftStick.y = -1f; } } this._toyVelocity += (this._lastStick - leftStick) * new Vec2(2f, -2f); this._lastStick = leftStick; this._toyVelocity.x = Math.Max(Math.Min(this._toyVelocity.x, 3f), -3f); this._toyVelocity.y = Math.Max(Math.Min(this._toyVelocity.y, 3f), -3f); this._toyPosition += this._toyVelocity; if (!this.opened) { this._toyAngle = Lerp.FloatSmooth(this._toyAngle, this._toyAngleLerp, 0.1f); this._eggOffset = Lerp.Vec2Smooth(this._eggOffset, leftStick * 8f, 0.3f); } else { this._toyAngle = Lerp.FloatSmooth(this._toyAngle, -90f, 0.1f); this._eggOffset = Lerp.Vec2Smooth(this._eggOffset, Vec2.Zero, 0.3f); this._toyPosition = Lerp.Vec2Smooth(this._toyPosition, Vec2.Zero, 0.3f); } this._openWait += 0.029f; if ((double)this._openWait >= 1.0) { if (!this.didOpenToyCorner) { HUD.AddCornerControl(HUDCorner.BottomRight, "@SELECT@OPEN TOY"); this.didOpenToyCorner = true; } if (Input.Pressed("SELECT") && !this.opened) { this.opened = true; SFX.Play("gachaOpen", pitch: Rando.Float(0.1f, 0.3f)); this._gachaEgg.frame += 2; } if (this.opened) { this._swapWait += 0.06f; if ((double)this._swapWait >= 1.0) { if (!this._swapped) { SFX.Play("harp"); HUD.CloseAllCorners(); HUD.AddCornerControl(HUDCorner.BottomRight, "@SELECT@CONTINUE"); Profiles.experienceProfile.SetNumFurnitures((int)this._contains.index, Profiles.experienceProfile.GetNumFurnitures((int)this._contains.index) + 1); } this._starGrow += 0.05f; this._swapped = true; } } } } } } } this.yOffset = Lerp.FloatSmooth(this.yOffset, this.down ? -250f : 0.0f, 0.4f); if (this.down) { if (this._swapped) { this.finished = true; this.Close(); } else { this._downWait -= 0.06f; if ((double)this._downWait <= 0.0) { this._downWait = 1f; this.down = false; SFX.Play("gachaGet", pitch: -0.4f); } } } if (!this.down && this._swapped && Input.Pressed("SELECT")) { this.played = false; this._gachaWait = 0.0f; this._openWait = 0.0f; this.finished = false; this.opened = false; this._swapWait = 0.0f; this._swapped = false; this._starGrow = 0.0f; this._insertCoin = 0.0f; this._insertCoinInc = 0.0f; this._afterInsertWait = 0.0f; this._chinged = false; this.gachaY = 0.0f; this.gachaSpeed = 0.0f; this.doubleUpdating = false; ++this._prizesGiven; this._eggOffset = Vec2.Zero; this._toyPosition = Vec2.Zero; this._toyVelocity = Vec2.Zero; this._lastStick = Vec2.Zero; this._toyAngle = 0.0f; this._toyAngleLerp = 0.0f; this._coined = false; this._initialWait = 0.0f; this.didOpenToyCorner = false; HUD.CloseAllCorners(); SFX.Play("resume", 0.6f); if (this.prizes.Count > 4) { this.prizes.RemoveAt(0); this.LoadNextPrize(); } else { this.down = true; this._swapped = true; } } base.UpdateParts(); }
public override void Update() { if ((double)this.hitWait > 0.0) { this.hitWait -= 0.1f; } else { this.hitWait = 0.0f; } this._alternate = !this._alternate; this._scanner.alpha = (float)(0.400000005960464 + (double)this._wave.normalized * 0.600000023841858); this._projector.alpha = (float)(0.400000005960464 + (double)this._wave.normalized * 0.600000023841858) * this._projectorAlpha; this._currentProjection.alpha = (float)(0.400000005960464 + (double)this._projectionFlashWave.normalized * 0.600000023841858); this._currentProjection.alpha -= this._glitch * 3f; this._currentProjection.alpha *= this._projectorAlpha; this._double = Maths.CountDown(this._double, 0.15f); this._glitch = Maths.CountDown(this._glitch, 0.1f); if ((double)Rando.Float(1f) < 0.00999999977648258) { this._glitch = 0.3f; this._projectorGlitch.xscale = 0.8f + Rando.Float(0.7f); this._projectorGlitch.yscale = 0.6f + Rando.Float(0.5f); this._projectorGlitch.flipH = (double)Rando.Float(1f) > 0.5; } if ((double)Rando.Float(1f) < 0.00499999988824129) { this._glitch = 0.3f; this._projectorGlitch.xscale = 0.8f + Rando.Float(0.7f); this._projectorGlitch.yscale = 0.6f + Rando.Float(0.5f); this._projectorGlitch.flipH = (double)Rando.Float(1f) > 0.5; this._useWave = !this._useWave; } if ((double)Rando.Float(1f) < 0.00800000037997961) { this._glitch = 0.3f; this._projectorGlitch.xscale = 0.8f + Rando.Float(0.7f); this._projectorGlitch.yscale = 0.6f + Rando.Float(0.5f); this._projectorGlitch.flipH = (double)Rando.Float(1f) > 0.5; this._useWave = !this._useWave; this._double = 0.6f + Rando.Float(0.6f); } this._close.Clear(); if (this._hoverItem != null && this._hoverItem.owner != null) { this.BreakHoverBond(); } if (this._hoverItem == null) { Holdable holdable = Level.Nearest <Holdable>(this.x, this.y); if (holdable != null && holdable.owner == null && (holdable != null && holdable.canPickUp) && ((double)holdable.bottom <= (double)this.top && (double)Math.Abs(holdable.hSpeed) + (double)Math.Abs(holdable.vSpeed) < 2.0)) { float num = 999f; if (holdable != null) { num = (this.position - holdable.position).length; } if ((double)num < 24.0) { this._hoverItem = holdable; } } } else if ((double)Math.Abs(this._hoverItem.hSpeed) + (double)Math.Abs(this._hoverItem.vSpeed) > 2.0 || (double)(this._hoverItem.position - this.position).length > 25.0) { this.BreakHoverBond(); } else { this._hoverItem.position = Lerp.Vec2Smooth(this._hoverItem.position, this.position + new Vec2(0.0f, (float)(-12.0 - (double)this._hoverItem.collisionSize.y / 2.0 + (double)(float)this._projectionWave * 2.0)), 0.2f); this._hoverItem.vSpeed = 0.0f; this._hoverItem.gravMultiplier = 0.0f; } foreach (Duck duck in this._level.things[typeof(Duck)]) { if (!duck.dead && (double)(duck.position - this.position).length < 64.0) { this._close.Add(duck.profile); this._closeGlitch = false; } } this._closeWait = Maths.CountDown(this._closeWait, 0.05f); for (int index = 0; index < this._close.Count; ++index) { if (this._close.Count == 1) { this._closeIndex = 0; } else if (this._close.Count > 1 && index == this._closeIndex && (double)this._closeWait <= 0.0) { this._closeIndex = (this._closeIndex + 1) % this._close.Count; this._closeWait = 1f; this._glitch = 0.3f; this._projectorGlitch.xscale = 0.8f + Rando.Float(0.7f); this._projectorGlitch.yscale = 0.6f + Rando.Float(0.5f); this._projectorGlitch.flipH = (double)Rando.Float(1f) > 0.5; this._useWave = !this._useWave; this._double = 0.6f + Rando.Float(0.6f); break; } } if (this._closeIndex >= this._close.Count) { this._closeIndex = 0; } if (this._close.Count == 0) { if (!this._closeGlitch) { this._closeWait = 1f; this._glitch = 0.3f; this._projectorGlitch.xscale = 0.8f + Rando.Float(0.7f); this._projectorGlitch.yscale = 0.6f + Rando.Float(0.5f); this._projectorGlitch.flipH = (double)Rando.Float(1f) > 0.5; this._useWave = !this._useWave; this._double = 0.6f + Rando.Float(0.6f); this._closeGlitch = true; } this._projectorAlpha = Maths.CountDown(this._projectorAlpha, 0.1f); this._currentProjection = this._none; } else { StoredItem storedItem = PurpleBlock.GetStoredItem(this._close[this._closeIndex]); this._currentProjection = storedItem.sprite != null ? (!this._served.Contains(this._close[this._closeIndex]) ? storedItem.sprite : (this._alternate ? storedItem.sprite : this._none)) : this._none; this._projectorAlpha = Maths.CountUp(this._projectorAlpha, 0.1f); } this._projectorGlitch.alpha = this._glitch * this._projectorAlpha; base.Update(); }
// Token: 0x0600230C RID: 8972 public override void Update() { base.Update(); float num = 1f; if (this.souped) { num = 1.3f; } if (this._swordSwing.finished) { this._swordSwing.speed = 0f; } if (this._hitWait > 0) { this._hitWait--; } if (this._gas < 0.01f) { this.ammo = 0; } this._framesExisting++; if (this._framesExisting > 100) { this._framesExisting = 100; } float pitch = this.souped ? 0.3f : 0f; this._sound.lerpVolume = ((this._started && !this._throttle) ? 0.6f : 0f); this._sound.pitch = pitch; if (this._started) { this._warmUp += 0.001f; if (this._warmUp > 1f) { this._warmUp = 1f; } if (!this._puffClick && this._idleWave > 0.9f) { this._skipSmoke = !this._skipSmoke; if (this._throttle || !this._skipSmoke) { Level.Add(SmallSmoke.New(base.x + (float)(this.offDir * 4), base.y + 5f, this._smokeFlipper ? -0.1f : 0.8f, 0.7f)); this._smokeFlipper = !this._smokeFlipper; this._puffClick = true; } } else if (this._puffClick && this._idleWave < 0f) { this._puffClick = false; } if (this._pullState < 0) { float num2 = 1f + Maths.NormalizeSection(this._engineSpin, 1f, 2f) * 2f; float num3 = this._idleWave; if (num2 > 1f) { num3 = this._spinWave; } this.handOffset = Lerp.Vec2Smooth(this.handOffset, new Vec2(0f, 2f + num3 * num2), 0.23f); this._holdOffset = Lerp.Vec2Smooth(this._holdOffset, new Vec2(1f, 2f + num3 * num2), 0.23f); float num4 = Maths.NormalizeSection(this._engineSpin, 1f, 2f) * 3f; this._rotSway = this._idleWave.normalized * num4 * 0.03f; } else { this._rotSway = 0f; } this._gas -= 3E-05f; if (this._throttle) { this._gas -= 0.0002f; } if (this._gas < 0f) { this._gas = 0f; this._started = false; this._throttle = false; } if (this._triggerHeld) { if (this._releasedSincePull) { if (!this._throttle) { this._throttle = true; SFX.Play("chainsawBladeRevUp", 0.5f, pitch, 0f, false); } this._engineSpin = Lerp.FloatSmooth(this._engineSpin, 4f, 0.1f, 1f); } } else { if (this._throttle) { this._throttle = false; if (this._engineSpin > 1.7f) { SFX.Play("chainsawBladeRevDown", 0.5f, pitch, 0f, false); } } this._engineSpin = Lerp.FloatSmooth(this._engineSpin, 0f, 0.1f, 1f); this._releasedSincePull = true; } } else { this._warmUp -= 0.001f; if (this._warmUp < 0f) { this._warmUp = 0f; } this._releasedSincePull = false; this._throttle = false; } this._bladeSound.lerpSpeed = 0.1f; this._throttleWait = Lerp.Float(this._throttleWait, this._throttle ? 1f : 0f, 0.07f); this._bladeSound.lerpVolume = ((this._throttleWait > 0.96f) ? 0.6f : 0f); if (this._struggling) { this._bladeSound.lerpVolume = 0f; } this._bladeSoundLow.lerpVolume = ((this._throttleWait > 0.96f && this._struggling) ? 0.6f : 0f); this._bladeSound.pitch = pitch; this._bladeSoundLow.pitch = pitch; if (this.owner == null) { this.collisionOffset = new Vec2(-8f, -6f); this.collisionSize = new Vec2(13f, 11f); } else if (base.duck != null && (base.duck.sliding || base.duck.crouch)) { this.collisionOffset = new Vec2(-8f, -6f); this.collisionSize = new Vec2(6f, 11f); } else { this.collisionOffset = new Vec2(-8f, -6f); this.collisionSize = new Vec2(10f, 11f); } if (this.owner != null) { this._resetDuck = false; if (this._pullState == -1) { if (!this._started) { this.handOffset = Lerp.Vec2Smooth(this.handOffset, new Vec2(0f, 2f), 0.25f); this._holdOffset = Lerp.Vec2Smooth(this._holdOffset, new Vec2(1f, 2f), 0.23f); } this._upWait = 0f; } else if (this._pullState == 0) { this._animRot = Lerp.FloatSmooth(this._animRot, -0.4f, 0.15f, 1f); this.handOffset = Lerp.Vec2Smooth(this.handOffset, new Vec2(-2f, -2f), 0.25f); this._holdOffset = Lerp.Vec2Smooth(this._holdOffset, new Vec2(-4f, 4f), 0.23f); if (this._animRot <= -0.35f) { this._animRot = -0.4f; this._pullState = 1; this.PullEngine(); } this._upWait = 0f; } else if (this._pullState == 1) { this._releasePull = false; this._holdOffset = Lerp.Vec2Smooth(this._holdOffset, new Vec2(2f, 3f), 0.23f); this.handOffset = Lerp.Vec2Smooth(this.handOffset, new Vec2(-4f, -2f), 0.23f); this._animRot = Lerp.FloatSmooth(this._animRot, -0.5f, 0.07f, 1f); if (this._animRot < -0.45f) { this._animRot = -0.5f; this._pullState = 2; } this._upWait = 0f; } else if (this._pullState == 2) { if (this._releasePull || !this._triggerHeld) { this._releasePull = true; if (this._started) { this.handOffset = Lerp.Vec2Smooth(this.handOffset, new Vec2(0f, 2f + this._idleWave.normalized), 0.23f); this._holdOffset = Lerp.Vec2Smooth(this._holdOffset, new Vec2(1f, 2f + this._idleWave.normalized), 0.23f); this._animRot = Lerp.FloatSmooth(this._animRot, 0f, 0.1f, 1f); if (this._animRot > -0.07f) { this._animRot = 0f; this._pullState = -1; } } else { this._holdOffset = Lerp.Vec2Smooth(this._holdOffset, new Vec2(-4f, 4f), 0.24f); this.handOffset = Lerp.Vec2Smooth(this.handOffset, new Vec2(-2f, -2f), 0.24f); this._animRot = Lerp.FloatSmooth(this._animRot, -0.4f, 0.12f, 1f); if (this._animRot > -0.44f) { this._releasePull = false; this._animRot = -0.4f; this._pullState = 3; this._holdOffset = new Vec2(-4f, 4f); this.handOffset = new Vec2(-2f, -2f); } } } this._upWait = 0f; } else if (this._pullState == 3) { this._releasePull = false; this._upWait += 0.1f; if (this._upWait > 6f) { this._pullState = -1; } } this._bladeSpin += this._engineSpin; while (this._bladeSpin >= 1f) { this._bladeSpin -= 1f; int num5 = this._sprite.frame + 1; if (num5 > 15) { num5 = 0; } this._sprite.frame = num5; } this._engineSpin = Lerp.FloatSmooth(this._engineSpin, 0f, 0.1f, 1f); this._engineResistance = Lerp.FloatSmooth(this._engineResistance, 1f, 0.01f, 1f); this._hold = -0.4f; this.center = new Vec2(8f, 7f); this._framesSinceThrown = 0; } else { this._rotSway = 0f; this._shing = false; this._animRot = Lerp.FloatSmooth(this._animRot, 0f, 0.18f, 1f); if (this._framesSinceThrown == 1) { this._throwSpin = base.angleDegrees; } this._hold = 0f; base.angleDegrees = this._throwSpin; this.center = new Vec2(8f, 7f); bool flag = false; bool flag2 = false; if ((Math.Abs(this.hSpeed) + Math.Abs(this.vSpeed) > 2f || !base.grounded) && this.gravMultiplier > 0f) { if (!base.grounded && Level.CheckRect <Block>(this.position + new Vec2(-8f, -6f), this.position + new Vec2(8f, -2f), null) != null) { flag2 = true; } if (!flag2 && !this._grounded && Level.CheckPoint <IPlatform>(this.position + new Vec2(0f, 8f), null, null) == null) { if (this.offDir > 0) { this._throwSpin += (Math.Abs(this.hSpeed) + Math.Abs(this.vSpeed)) * 1f + 5f; } else { this._throwSpin -= (Math.Abs(this.hSpeed) + Math.Abs(this.vSpeed)) * 1f + 5f; } flag = true; } } if (!flag || flag2) { this._throwSpin %= 360f; if (this._throwSpin < 0f) { this._throwSpin += 360f; } if (flag2) { if (Math.Abs(this._throwSpin - 90f) < Math.Abs(this._throwSpin + 90f)) { this._throwSpin = Lerp.Float(this._throwSpin, 90f, 16f); } else { this._throwSpin = Lerp.Float(-90f, 0f, 16f); } } else if (this._throwSpin > 90f && this._throwSpin < 270f) { this._throwSpin = Lerp.Float(this._throwSpin, 180f, 14f); } else { if (this._throwSpin > 180f) { this._throwSpin -= 360f; } else if (this._throwSpin < -180f) { this._throwSpin += 360f; } this._throwSpin = Lerp.Float(this._throwSpin, 0f, 14f); } } } if (Math.Abs(this._angle) > 1f) { this._flood += 0.005f; if (this._flood > 1f) { this._flooded = true; this._started = false; } this._gasDripFrames++; if (this._gas > 0f && this._flooded && this._gasDripFrames > 2) { FluidData gas = Fluid.Gas; gas.amount = 0.003f; this._gas -= 0.005f; if (this._gas < 0f) { this._gas = 0f; } Level.Add(new Fluid(base.x, base.y, Vec2.Zero, gas, null, 1f)); this._gasDripFrames = 0; } if (this._gas <= 0f) { this._started = false; } } else { this._flood -= 0.008f; if (this._flood < 0f) { this._flood = 0f; } } if (base.duck != null) { base.duck.frictionMult = 1f; if (this._skipSpark > 0) { this._skipSpark++; if (this._skipSpark > 2) { this._skipSpark = 0; } } if (base.duck.sliding && this._throttle && this._skipSpark == 0) { if (Level.CheckLine <Block>(this.barrelStartPos + new Vec2(0f, 8f), base.barrelPosition + new Vec2(0f, 8f), null) != null) { this._skipSpark = 1; Vec2 value = this.position + base.barrelVector * 5f; for (int i = 0; i < 2; i++) { Level.Add(Spark.New(value.x, value.y, new Vec2((float)this.offDir * Rando.Float(0f, 2f), Rando.Float(0.5f, 1.5f)), 0.02f)); value += base.barrelVector * 2f; this._fireTrailWait -= 0.5f; if (this.souped && this._fireTrailWait <= 0f) { this._fireTrailWait = 1f; SmallFire smallFire = SmallFire.New(value.x, value.y, (float)this.offDir * Rando.Float(0f, 2f), Rando.Float(0.5f, 1.5f), false, null, true, null, false); smallFire.waitToHurt = Rando.Float(1f, 2f); smallFire.whoWait = (this.owner as Duck); Level.Add(smallFire); } } if (this.offDir > 0 && this.owner.hSpeed < (float)(this.offDir * 6) * num) { this.owner.hSpeed = (float)(this.offDir * 6) * num; } else if (this.offDir < 0 && this.owner.hSpeed > (float)(this.offDir * 6) * num) { this.owner.hSpeed = (float)(this.offDir * 6) * num; } } else if (this.offDir > 0 && this.owner.hSpeed < (float)(this.offDir * 3) * num) { this.owner.hSpeed = (float)(this.offDir * 3) * num; } else if (this.offDir < 0 && this.owner.hSpeed > (float)(this.offDir * 3) * num) { this.owner.hSpeed = (float)(this.offDir * 3) * num; } } if (this._pullState == -1) { if (!this._throttle) { this._animRot = MathHelper.Lerp(this._animRot, 0.3f, 0.2f); this.handOffset = Lerp.Vec2Smooth(this.handOffset, new Vec2(-2f, 2f), 0.25f); this._holdOffset = Lerp.Vec2Smooth(this._holdOffset, new Vec2(-3f, 4f), 0.23f); } else if (this._shing) { this._animRot = MathHelper.Lerp(this._animRot, -1.8f, 0.4f); this.handOffset = Lerp.Vec2Smooth(this.handOffset, new Vec2(1f, 0f), 0.25f); this._holdOffset = Lerp.Vec2Smooth(this._holdOffset, new Vec2(1f, 2f), 0.23f); if (this._animRot < -1.5f) { this._shing = false; } } else if (base.duck.crouch) { this._animRot = MathHelper.Lerp(this._animRot, 0.4f, 0.2f); this.handOffset = Lerp.Vec2Smooth(this.handOffset, new Vec2(1f, 0f), 0.25f); this._holdOffset = Lerp.Vec2Smooth(this._holdOffset, new Vec2(1f, 2f), 0.23f); } else if (base.duck.inputProfile.Down("UP")) { this._animRot = MathHelper.Lerp(this._animRot, -0.9f, 0.2f); this.handOffset = Lerp.Vec2Smooth(this.handOffset, new Vec2(1f, 0f), 0.25f); this._holdOffset = Lerp.Vec2Smooth(this._holdOffset, new Vec2(1f, 2f), 0.23f); } else { this._animRot = MathHelper.Lerp(this._animRot, 0f, 0.2f); this.handOffset = Lerp.Vec2Smooth(this.handOffset, new Vec2(1f, 0f), 0.25f); this._holdOffset = Lerp.Vec2Smooth(this._holdOffset, new Vec2(1f, 2f), 0.23f); } } } else if (!this._resetDuck && base.prevOwner != null) { PhysicsObject physicsObject = base.prevOwner as PhysicsObject; if (physicsObject != null) { physicsObject.frictionMult = 1f; } this._resetDuck = true; } if (this._skipDebris > 0) { this._skipDebris++; } if (this._skipDebris > 3) { this._skipDebris = 0; } this._struggling = false; if (this.owner != null && this._started && this._throttle && !this._shing) { (this.Offset(base.barrelOffset) - this.position).Normalize(); this.Offset(base.barrelOffset); IEnumerable <IAmADuck> enumerable = Level.CheckLineAll <IAmADuck>(this.barrelStartPos, base.barrelPosition); Block block3 = Level.CheckLine <Block>(this.barrelStartPos, base.barrelPosition, null); if (this.owner != null) { foreach (MaterialThing materialThing in Level.CheckLineAll <MaterialThing>(this.barrelStartPos, base.barrelPosition)) { if (materialThing.Hurt((materialThing is Door) ? 1.8f : 0.5f)) { if (base.duck != null && base.duck.sliding && materialThing is Door && (materialThing as Door)._jammed) { materialThing.Destroy(new DTImpale(this)); } else { this._struggling = true; if (base.duck != null) { base.duck.frictionMult = 4f; } if (this._skipDebris == 0) { this._skipDebris = 1; Vec2 value2 = Collision.LinePoint(this.barrelStartPos, base.barrelPosition, materialThing.rectangle); if (value2 != Vec2.Zero) { value2 += base.barrelVector * Rando.Float(0f, 3f); Vec2 vec = -base.barrelVector.Rotate(Rando.Float(-0.2f, 0.2f), Vec2.Zero); if (materialThing.physicsMaterial == PhysicsMaterial.Wood) { WoodDebris woodDebris = WoodDebris.New(value2.x, value2.y); woodDebris.hSpeed = vec.x * 3f; woodDebris.vSpeed = vec.y * 3f; Level.Add(woodDebris); } else if (materialThing.physicsMaterial == PhysicsMaterial.Metal) { Spark spark = Spark.New(value2.x, value2.y, Vec2.Zero, 0.02f); spark.hSpeed = vec.x * 3f; spark.vSpeed = vec.y * 3f; Level.Add(spark); } } } } } } } bool flag3 = false; if (block3 != null && !(block3 is Door)) { this.Shing(block3); if (block3 is Window) { block3.Destroy(new DTImpact(this)); } } else { foreach (Thing thing in Level.current.things[typeof(Sword)]) { Sword sword = (Sword)thing; if (sword.owner != null && sword.crouchStance && !sword.jabStance && Collision.LineIntersect(this.barrelStartPos, base.barrelPosition, sword.barrelStartPos, sword.barrelPosition)) { this.Shing(sword); sword.Shing(); sword.owner.hSpeed += (float)this.offDir * 3f; sword.owner.vSpeed -= 2f; base.duck.hSpeed += -(float)this.offDir * 3f; base.duck.vSpeed -= 2f; sword.duck.crippleTimer = 1f; base.duck.crippleTimer = 1f; flag3 = true; } } if (!flag3) { Thing ignore = null; if (base.duck != null) { ignore = base.duck.GetEquipment(typeof(Helmet)); } QuadLaserBullet quadLaserBullet = Level.CheckLine <QuadLaserBullet>(this.position, base.barrelPosition, null); if (quadLaserBullet != null) { this.Shing(quadLaserBullet); Vec2 travel = quadLaserBullet.travel; float length = travel.length; float num6 = 1f; if (this.offDir > 0 && travel.x < 0f) { num6 = 1.5f; } else if (this.offDir < 0 && travel.x > 0f) { num6 = 1.5f; } if (this.offDir > 0) { travel = new Vec2(length * num6, 0f); } else { travel = new Vec2(-length * num6, 0f); } quadLaserBullet.travel = travel; } else { Helmet helmet = Level.CheckLine <Helmet>(this.barrelStartPos, base.barrelPosition, ignore); if (helmet != null && helmet.equippedDuck != null) { this.Shing(helmet); helmet.owner.hSpeed += (float)this.offDir * 3f; helmet.owner.vSpeed -= 2f; helmet.duck.crippleTimer = 1f; helmet.Hurt(0.53f); flag3 = true; } else { if (base.duck != null) { ignore = base.duck.GetEquipment(typeof(ChestPlate)); } ChestPlate chestPlate = Level.CheckLine <ChestPlate>(this.barrelStartPos, base.barrelPosition, ignore); if (chestPlate != null && chestPlate.equippedDuck != null) { this.Shing(chestPlate); chestPlate.owner.hSpeed += (float)this.offDir * 3f; chestPlate.owner.vSpeed -= 2f; chestPlate.duck.crippleTimer = 1f; chestPlate.Hurt(0.53f); flag3 = true; } } } } } if (!flag3) { foreach (Thing thing2 in Level.current.things[typeof(Chainsaw)]) { Chainsaw chainsaw = (Chainsaw)thing2; if (chainsaw != this && chainsaw.owner != null && Collision.LineIntersect(this.barrelStartPos, base.barrelPosition, chainsaw.barrelStartPos, chainsaw.barrelPosition)) { this.Shing(chainsaw); chainsaw.Shing(this); chainsaw.owner.hSpeed += (float)this.offDir * 2f; chainsaw.owner.vSpeed -= 1.5f; base.duck.hSpeed += -(float)this.offDir * 2f; base.duck.vSpeed -= 1.5f; chainsaw.duck.crippleTimer = 1f; base.duck.crippleTimer = 1f; flag3 = true; if (Recorder.currentRecording != null) { Recorder.currentRecording.LogBonus(); } } } } if (!flag3) { foreach (IAmADuck amADuck in enumerable) { if (amADuck != base.duck) { MaterialThing materialThing2 = amADuck as MaterialThing; if (materialThing2 != null) { materialThing2.velocity += new Vec2((float)this.offDir * 0.8f, -0.8f); materialThing2.Destroy(new DTImpale(this)); if (base.duck != null) { base.duck._timeSinceChainKill = 0; } } } } } } }