Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ KillTile_PlaySounds()

static void Terraria.WorldGen.KillTile_PlaySounds ( int i,
int j,
bool fail,
Tile tileCache )
inlinestatic

Definition at line 57120 of file WorldGen.cs.

57121 {
57122 if (gen)
57123 {
57124 return;
57125 }
57126 int type = tileCache.type;
57127 if (type == 127 || type == 623)
57128 {
57129 SoundEngine.PlaySound(SoundID.Item27, i * 16, j * 16);
57130 }
57131 else if (type == 147 || type == 224)
57132 {
57133 if (genRand.Next(2) == 0)
57134 {
57135 SoundEngine.PlaySound(SoundID.Item48, i * 16, j * 16);
57136 }
57137 else
57138 {
57139 SoundEngine.PlaySound(SoundID.Item49, i * 16, j * 16);
57140 }
57141 }
57142 else if (type == 161 || type == 163 || type == 164 || type == 200 || type == 541)
57143 {
57144 SoundEngine.PlaySound(SoundID.Item50, i * 16, j * 16);
57145 }
57146 else if (type == 518 || type == 519 || type == 528 || type == 529 || type == 549 || type == 637 || type == 638 || type == 636)
57147 {
57148 SoundEngine.PlaySound(6, i * 16, j * 16);
57149 }
57150 else if (type == 530 && tileCache.frameX < 270)
57151 {
57152 SoundEngine.PlaySound(6, i * 16, j * 16);
57153 }
57154 else
57155 {
57156 switch (type)
57157 {
57158 case 3:
57159 case 110:
57160 SoundEngine.PlaySound(6, i * 16, j * 16);
57161 break;
57162 case 254:
57163 SoundEngine.PlaySound(6, i * 16, j * 16);
57164 break;
57165 case 24:
57166 SoundEngine.PlaySound(6, i * 16, j * 16);
57167 break;
57168 default:
57169 if (Main.tileAlch[type] || type == 384 || type == 227 || type == 32 || type == 51 || type == 52 || type == 61 || type == 62 || type == 69 || type == 655 || type == 71 || type == 73 || type == 74 || type == 113 || type == 115 || type == 184 || type == 192 || type == 205 || type == 233 || type == 352 || type == 382 || type == 624 || type == 656)
57170 {
57171 SoundEngine.PlaySound(6, i * 16, j * 16);
57172 break;
57173 }
57174 if (type == 485)
57175 {
57176 SoundEngine.PlaySound(4, i * 16, j * 16, 11);
57177 break;
57178 }
57179 if (type == 201)
57180 {
57181 SoundEngine.PlaySound(6, i * 16, j * 16);
57182 break;
57183 }
57184 if (type == 481 || type == 482 || type == 483)
57185 {
57186 SoundEngine.PlaySound(SoundID.Item127, i * 16, j * 16);
57187 break;
57188 }
57189 if (type == 1 || type == 6 || type == 7 || type == 8 || type == 9 || type == 22 || type == 140 || type == 25 || type == 37 || type == 38 || type == 39 || type == 41 || type == 43 || type == 44 || type == 45 || type == 46 || type == 47 || type == 48 || type == 56 || type == 58 || type == 63 || type == 64 || type == 65 || type == 66 || type == 67 || type == 68 || type == 75 || type == 76 || type == 107 || type == 108 || type == 111 || type == 117 || type == 118 || type == 119 || type == 120 || type == 121 || type == 122 || type == 150 || type == 151 || type == 152 || type == 153 || type == 154 || type == 155 || type == 156 || type == 160 || type == 161 || type == 166 || type == 167 || type == 168 || type == 169 || type == 175 || type == 176 || type == 177 || type == 203 || type == 202 || type == 204 || type == 206 || type == 211 || type == 221 || type == 222 || type == 223 || type == 226 || type == 248 || type == 249 || type == 250 || type == 272 || type == 273 || type == 274 || type == 478 || type == 284 || type == 325 || type == 346 || type == 347 || type == 348 || type == 350 || type == 367 || type == 357 || type == 368 || type == 369 || type == 370 || type == 407 || type == 472 || type == 473 || type == 500 || type == 501 || type == 502 || type == 503 || type == 546 || type == 557 || type == 566 || type == 618 || type == 408 || type == 409 || type == 669 || type == 670 || type == 671 || type == 672 || type == 673 || type == 674 || type == 675 || type == 676 || type == 677 || type == 678 || type == 679 || type == 680 || type == 681 || type == 682 || type == 683 || type == 684 || type == 685 || type == 686 || type == 687 || type == 689 || type == 688 || type == 690 || type == 691 || type == 692)
57190 {
57191 SoundEngine.PlaySound(21, i * 16, j * 16);
57192 break;
57193 }
57194 if (type == 666)
57195 {
57196 SoundEngine.PlaySound(SoundID.Item177, i * 16, j * 16);
57197 break;
57198 }
57199 if (type == 231 || type == 195 || type == 474)
57200 {
57201 SoundEngine.PlaySound(4, i * 16, j * 16);
57202 if (type == 231)
57203 {
57204 SoundEngine.PlaySound(SoundID.Item173, i * 16, j * 16);
57205 }
57206 break;
57207 }
57208 if (type == 26 && tileCache.frameX >= 54)
57209 {
57210 SoundEngine.PlaySound(4, i * 16, j * 16);
57211 break;
57212 }
57213 switch (type)
57214 {
57215 case 314:
57216 SoundEngine.PlaySound(SoundID.Item52, i * 16, j * 16);
57217 break;
57218 case 330:
57219 case 331:
57220 case 332:
57221 case 333:
57222 SoundEngine.PlaySound(18, i * 16, j * 16);
57223 break;
57224 default:
57225 if ((type == 162 || type == 385 || type == 129 || (type == 165 && tileCache.frameX < 54)) && !fail)
57226 {
57227 SoundEngine.PlaySound(SoundID.Item27, i * 16, j * 16);
57228 }
57229 else if (type != 138)
57230 {
57231 SoundEngine.PlaySound(0, i * 16, j * 16);
57232 }
57233 break;
57234 }
57235 break;
57236 }
57237 }
57238 if (!fail)
57239 {
57240 if (tileCache.type == 13)
57241 {
57242 SoundEngine.PlaySound(13, i * 16, j * 16);
57243 }
57244 else if (tileCache.type == 54)
57245 {
57246 SoundEngine.PlaySound(13, i * 16, j * 16);
57247 }
57248 else if (tileCache.type == 326)
57249 {
57250 SoundEngine.PlaySound(13, i * 16, j * 16);
57251 }
57252 else if (tileCache.type == 327)
57253 {
57254 SoundEngine.PlaySound(13, i * 16, j * 16);
57255 }
57256 else if (tileCache.type == 458)
57257 {
57258 SoundEngine.PlaySound(13, i * 16, j * 16);
57259 }
57260 else if (tileCache.type == 459)
57261 {
57262 SoundEngine.PlaySound(13, i * 16, j * 16);
57263 }
57264 else if (tileCache.type == 345)
57265 {
57266 SoundEngine.PlaySound(13, i * 16, j * 16);
57267 }
57268 else if (tileCache.type == 328)
57269 {
57270 SoundEngine.PlaySound(13, i * 16, j * 16);
57271 }
57272 else if (tileCache.type == 329)
57273 {
57274 SoundEngine.PlaySound(13, i * 16, j * 16);
57275 }
57276 else if (tileCache.type == 507)
57277 {
57278 SoundEngine.PlaySound(13, i * 16, j * 16);
57279 }
57280 else if (tileCache.type == 508)
57281 {
57282 SoundEngine.PlaySound(13, i * 16, j * 16);
57283 }
57284 }
57285 }
static void PlaySound(int type, Vector2 position, int style=1)
static readonly LegacySoundStyle Item50
Definition SoundID.cs:514
static readonly LegacySoundStyle Item127
Definition SoundID.cs:668
static readonly LegacySoundStyle Item173
Definition SoundID.cs:760
static readonly LegacySoundStyle Item27
Definition SoundID.cs:468
static readonly LegacySoundStyle Item49
Definition SoundID.cs:512
static readonly LegacySoundStyle Item48
Definition SoundID.cs:510
static readonly LegacySoundStyle Item177
Definition SoundID.cs:768
static readonly LegacySoundStyle Item52
Definition SoundID.cs:518
static volatile bool gen
Definition WorldGen.cs:972
static UnifiedRandom genRand
Definition WorldGen.cs:1215

References Terraria.Tile.frameX, Terraria.ID.SoundID.Item127, Terraria.ID.SoundID.Item173, Terraria.ID.SoundID.Item177, Terraria.ID.SoundID.Item27, Terraria.ID.SoundID.Item48, Terraria.ID.SoundID.Item49, Terraria.ID.SoundID.Item50, Terraria.ID.SoundID.Item52, Terraria.Audio.SoundEngine.PlaySound(), Terraria.Main.tileAlch, System.type, and Terraria.Tile.type.

Referenced by Terraria.Player.PlaceThing_TryReplacingTiles().