public void UseDrill(Player mountedPlayer) { if (this._type != 8 || !this._abilityActive) { return; } Mount.DrillMountData drillMountData = (Mount.DrillMountData)this._mountSpecificData; if (drillMountData.beamCooldown == 0) { int i = 0; while (i < (int)drillMountData.beams.Length) { Mount.DrillBeam drillBeam = drillMountData.beams[i]; if (drillBeam.cooldown == 0) { Point16 point = this.DrillSmartCursor(mountedPlayer, drillMountData); if (point != Point16.NegativeOne) { drillBeam.curTileTarget = point; int pickPower = Mount.drillPickPower; bool flag = mountedPlayer.whoAmI == Main.myPlayer; if (flag) { mountedPlayer.PickTile((int)point.X, (int)point.Y, pickPower); } if (flag) { Tile.SmoothSlope((int)point.X, (int)point.Y, true); } drillBeam.cooldown = Mount.drillPickTime; break; } break; } else { i++; } } drillMountData.beamCooldown = Mount.drillBeamCooldownMax; } }
public void UseDrill(Player mountedPlayer) { if (this._type != 8 || !this._abilityActive) return; Mount.DrillMountData data = (Mount.DrillMountData)this._mountSpecificData; if (data.beamCooldown != 0) return; for (int index1 = 0; index1 < data.beams.Length; ++index1) { Mount.DrillBeam drillBeam = data.beams[index1]; if (drillBeam.cooldown == 0) { Point16 point16 = this.DrillSmartCursor(mountedPlayer, data); if (point16 != Point16.NegativeOne) { drillBeam.curTileTarget = point16; int pickPower = Mount.drillPickPower; mountedPlayer.PickTile((int)point16.X, (int)point16.Y, pickPower); Vector2 Position = new Vector2((float)((int)point16.X << 4) + 8f, (float)((int)point16.Y << 4) + 8f); float num1 = Utils.ToRotation(Position - mountedPlayer.Center); for (int index2 = 0; index2 < 2; ++index2) { float num2 = num1 + (float)((Main.rand.Next(2) == 1 ? -1.0 : 1.0) * 1.57079637050629); float num3 = (float)(Main.rand.NextDouble() * 2.0 + 2.0); Vector2 vector2 = new Vector2((float)Math.Cos((double)num2) * num3, (float)Math.Sin((double)num2) * num3); int index3 = Dust.NewDust(Position, 0, 0, 230, vector2.X, vector2.Y, 0, new Color(), 1f); Main.dust[index3].noGravity = true; Main.dust[index3].customData = (object)mountedPlayer; } Tile.SmoothSlope((int)point16.X, (int)point16.Y, true); drillBeam.cooldown = Mount.drillPickTime; break; } break; } } data.beamCooldown = Mount.drillBeamCooldownMax; }
public void UseDrill(Player mountedPlayer) { if (this._type != 8 || !this._abilityActive) { return; } Mount.DrillMountData drillMountData = (Mount.DrillMountData)this._mountSpecificData; if (drillMountData.beamCooldown == 0) { int i = 0; while (i < drillMountData.beams.Length) { Mount.DrillBeam drillBeam = drillMountData.beams[i]; if (drillBeam.cooldown == 0) { Point16 point = this.DrillSmartCursor(mountedPlayer, drillMountData); if (point != Point16.NegativeOne) { drillBeam.curTileTarget = point; int pickPower = Mount.drillPickPower; bool flag = mountedPlayer.whoAmI == Main.myPlayer; if (flag) { bool flag2 = true; if (WorldGen.InWorld((int)point.X, (int)point.Y, 0) && Main.tile[(int)point.X, (int)point.Y] != null && Main.tile[(int)point.X, (int)point.Y].type == 26 && !Main.hardMode) { flag2 = false; mountedPlayer.Hurt(mountedPlayer.statLife / 2, -mountedPlayer.direction, false, false, Lang.deathMsg(-1, -1, -1, 4), false, -1); } if (flag2) { mountedPlayer.PickTile((int)point.X, (int)point.Y, pickPower); } } Vector2 vector = new Vector2((float)(point.X << 4) + 8f, (float)(point.Y << 4) + 8f); Vector2 v = vector - mountedPlayer.Center; float num = v.ToRotation(); for (int j = 0; j < 2; j++) { float num2 = num + ((Main.rand.Next(2) == 1) ? -1f : 1f) * 1.57079637f; float num3 = (float)Main.rand.NextDouble() * 2f + 2f; Vector2 vector2 = new Vector2((float)Math.Cos((double)num2) * num3, (float)Math.Sin((double)num2) * num3); int num4 = Dust.NewDust(vector, 0, 0, 230, vector2.X, vector2.Y, 0, default(Color), 1f); Main.dust[num4].noGravity = true; Main.dust[num4].customData = mountedPlayer; } if (flag) { Tile.SmoothSlope((int)point.X, (int)point.Y, true); } drillBeam.cooldown = Mount.drillPickTime; break; } break; } else { i++; } } drillMountData.beamCooldown = Mount.drillBeamCooldownMax; } }
public void UseDrill(Player mountedPlayer) { if (this._type != 8 || !this._abilityActive) { return; } Mount.DrillMountData drillMountDatum = (Mount.DrillMountData)this._mountSpecificData; if (drillMountDatum.beamCooldown == 0) { int num = 0; while (num < (int)drillMountDatum.beams.Length) { Mount.DrillBeam drillBeam = drillMountDatum.beams[num]; if (drillBeam.cooldown != 0) { num++; } else { Point16 point16 = this.DrillSmartCursor(mountedPlayer, drillMountDatum); if (point16 == Point16.NegativeOne) { break; } drillBeam.curTileTarget = point16; int num1 = Mount.drillPickPower; mountedPlayer.PickTile(point16.X, point16.Y, num1); Vector2 vector2 = new Vector2((float)(point16.X << 4) + 8f, (float)(point16.Y << 4) + 8f); float rotation = (vector2 - mountedPlayer.Center).ToRotation(); Tile.SmoothSlope(point16.X, point16.Y, true); drillBeam.cooldown = Mount.drillPickTime; break; } } drillMountDatum.beamCooldown = Mount.drillBeamCooldownMax; } }