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

◆ Unlock()

static bool Terraria.Chest.Unlock ( int X,
int Y )
inlinestatic

Definition at line 379 of file Chest.cs.

380 {
381 if (Main.tile[X, Y] == null || Main.tile[X + 1, Y] == null || Main.tile[X, Y + 1] == null || Main.tile[X + 1, Y + 1] == null)
382 {
383 return false;
384 }
385 short num = 0;
386 int type = 0;
387 Tile tileSafely = Framing.GetTileSafely(X, Y);
388 int type2 = tileSafely.type;
389 int num2 = tileSafely.frameX / 36;
390 switch (type2)
391 {
392 case 21:
393 switch (num2)
394 {
395 case 2:
396 num = 36;
397 type = 11;
399 break;
400 case 4:
401 num = 36;
402 type = 11;
403 break;
404 case 23:
405 case 24:
406 case 25:
407 case 26:
408 case 27:
409 if (!NPC.downedPlantBoss)
410 {
411 return false;
412 }
413 num = 180;
414 type = 11;
416 break;
417 case 36:
418 case 38:
419 case 40:
420 num = 36;
421 type = 11;
422 break;
423 default:
424 return false;
425 }
426 break;
427 case 467:
428 if (num2 == 13)
429 {
430 if (!NPC.downedPlantBoss)
431 {
432 return false;
433 }
434 num = 36;
435 type = 11;
437 break;
438 }
439 return false;
440 }
441 SoundEngine.PlaySound(22, X * 16, Y * 16);
442 for (int i = X; i <= X + 1; i++)
443 {
444 for (int j = Y; j <= Y + 1; j++)
445 {
446 Tile tileSafely2 = Framing.GetTileSafely(i, j);
447 if (tileSafely2.type == type2)
448 {
449 tileSafely2.frameX -= num;
450 Main.tile[i, j] = tileSafely2;
451 for (int k = 0; k < 4; k++)
452 {
453 Dust.NewDust(new Vector2(i * 16, j * 16), 16, 16, type);
454 }
455 }
456 }
457 }
458 return true;
459 }
static void PlaySound(int type, Vector2 position, int style=1)

References Terraria.NPC.downedPlantBoss, Terraria.Framing.GetTileSafely(), Terraria.Dust.NewDust(), Terraria.GameContent.Achievements.AchievementsHelper.NotifyProgressionEvent(), Terraria.Audio.SoundEngine.PlaySound(), and Terraria.Main.tile.

Referenced by Terraria.MessageBuffer.GetData(), and Terraria.Player.TileInteractionsUse().