protected override void Initialize() { NPC.clrNames(); NPC.setNames(); bgAlpha[0] = 1f; bgAlpha2[0] = 1f; for (int i = 0; i < 0x6f; i++) { projFrames[i] = 1; } projFrames[0x48] = 4; projFrames[0x56] = 4; projFrames[0x57] = 4; projFrames[0x66] = 2; debuff[20] = true; debuff[0x15] = true; debuff[0x16] = true; debuff[0x17] = true; debuff[0x18] = true; debuff[0x19] = true; debuff[0x1c] = true; debuff[30] = true; debuff[0x1f] = true; debuff[0x20] = true; debuff[0x21] = true; debuff[0x22] = true; debuff[0x23] = true; debuff[0x24] = true; debuff[0x25] = true; debuff[0x26] = true; debuff[0x27] = true; buffName[1] = "Obsidian Skin"; buffTip[1] = "Immune to lava"; buffName[2] = "Regeneration"; buffTip[2] = "Provides life regeneration"; buffName[3] = "Swiftness"; buffTip[3] = "25% increased movement speed"; buffName[4] = "Gills"; buffTip[4] = "Breathe water instead of air"; buffName[5] = "Ironskin"; buffTip[5] = "Increase defense by 8"; buffName[6] = "Mana Regeneration"; buffTip[6] = "Increased mana regeneration"; buffName[7] = "Magic Power"; buffTip[7] = "20% increased magic damage"; buffName[8] = "Featherfall"; buffTip[8] = "Press UP or DOWN to control speed of descent"; buffName[9] = "Spelunker"; buffTip[9] = "Shows the location of treasure and ore"; buffName[10] = "Invisibility"; buffTip[10] = "Grants invisibility"; buffName[11] = "Shine"; buffTip[11] = "Emitting light"; buffName[12] = "Night Owl"; buffTip[12] = "Increased night vision"; buffName[13] = "Battle"; buffTip[13] = "Increased enemy spawn rate"; buffName[14] = "Thorns"; buffTip[14] = "Attackers also take damage"; buffName[15] = "Water Walking"; buffTip[15] = "Press DOWN to enter water"; buffName[0x10] = "Archery"; buffTip[0x10] = "20% increased arrow damage and speed"; buffName[0x11] = "Hunter"; buffTip[0x11] = "Shows the location of enemies"; buffName[0x12] = "Gravitation"; buffTip[0x12] = "Press UP or DOWN to reverse gravity"; buffName[0x13] = "Orb of Light"; buffTip[0x13] = "A magical orb that provides light"; buffName[20] = "Poisoned"; buffTip[20] = "Slowly losing life"; buffName[0x15] = "Potion Sickness"; buffTip[0x15] = "Cannot consume anymore healing items"; buffName[0x16] = "Darkness"; buffTip[0x16] = "Decreased light vision"; buffName[0x17] = "Cursed"; buffTip[0x17] = "Cannot use any items"; buffName[0x18] = "On Fire!"; buffTip[0x18] = "Slowly losing life"; buffName[0x19] = "Tipsy"; buffTip[0x19] = "Increased melee abilities, lowered defense"; buffName[0x1a] = "Well Fed"; buffTip[0x1a] = "Minor improvements to all stats"; buffName[0x1b] = "Fairy"; buffTip[0x1b] = "A fairy is following you"; buffName[0x1c] = "Werewolf"; buffTip[0x1c] = "Physical abilities are increased"; buffName[0x1d] = "Clairvoyance"; buffTip[0x1d] = "Magic powers are increased"; buffName[30] = "Bleeding"; buffTip[30] = "Cannot regenerate life"; buffName[0x1f] = "Confused"; buffTip[0x1f] = "Movement is reversed"; buffName[0x20] = "Slow"; buffTip[0x20] = "Movement speed is reduced"; buffName[0x21] = "Weak"; buffTip[0x21] = "Physical abilities are decreased"; buffName[0x22] = "Merfolk"; buffTip[0x22] = "Can breathe and move easily underwater"; buffName[0x23] = "Silenced"; buffTip[0x23] = "Cannot use items that require mana"; buffName[0x24] = "Broken Armor"; buffTip[0x24] = "Defense is cut in half"; buffName[0x25] = "Horrified"; buffTip[0x25] = "You have seen something nasty, there is no escape."; buffName[0x26] = "The Tongue"; buffTip[0x26] = "You are being sucked into the mouth"; buffName[0x27] = "Cursed Inferno"; buffTip[0x27] = "Losing life"; for (int j = 0; j < 10; j++) { recentWorld[j] = ""; recentIP[j] = ""; recentPort[j] = 0; } if (rand == null) { rand = new Random((int)DateTime.Now.Ticks); } if (WorldGen.genRand == null) { WorldGen.genRand = new Random((int)DateTime.Now.Ticks); } switch (rand.Next(15)) { case 0: base.Window.Title = "Terraria: Dig Peon, Dig!"; break; case 1: base.Window.Title = "Terraria: Epic Dirt"; break; case 2: base.Window.Title = "Terraria: Hey Guys!"; break; case 3: base.Window.Title = "Terraria: Sand is Overpowered"; break; case 4: base.Window.Title = "Terraria Part 3: The Return of the Guide"; break; case 5: base.Window.Title = "Terraria: A Bunnies Tale"; break; case 6: base.Window.Title = "Terraria: Dr. Bones and The Temple of Blood Moon"; break; case 7: base.Window.Title = "Terraria: Slimeassic Park"; break; case 8: base.Window.Title = "Terraria: The Grass is Greener on This Side"; break; case 9: base.Window.Title = "Terraria: Small Blocks, Not for Children Under the Age of 5"; break; case 10: base.Window.Title = "Terraria: Digger T' Blocks"; break; case 11: base.Window.Title = "Terraria: There is No Cow Layer"; break; case 12: base.Window.Title = "Terraria: Suspicous Looking Eyeballs"; break; case 13: base.Window.Title = "Terraria: Purple Grass!"; break; case 14: base.Window.Title = "Terraria: Noone Dug Behind!"; break; default: base.Window.Title = "Terraria: Shut Up and Dig Gaiden!"; break; } lo = rand.Next(6); //ADDED TILEOPTIONS for flags: (tiki = 0x56) tileHammer[150] = true; tileLighted[150] = true; tileLavaDeath[150] = true; tileFrameImportant[150] = true; tileNoAttach[150] = true; tileName[150] = "Red Flag"; //CHANGED: ADDED tileHammer[151] = true; //tileLighted[151] = true; tileLavaDeath[151] = true; //tileFrameImportant[151] = true; tileNoAttach[151] = true; tileName[151] = "Blue Flag"; //CHANGED: ADDED //ORIG tileShine2[6] = true; tileShine2[7] = true; tileShine2[8] = true; tileShine2[9] = true; tileShine2[12] = true; tileShine2[0x15] = true; tileShine2[0x16] = true; tileShine2[0x19] = true; tileShine2[0x2d] = true; tileShine2[0x2e] = true; tileShine2[0x2f] = true; tileShine2[0x3f] = true; tileShine2[0x40] = true; tileShine2[0x41] = true; tileShine2[0x42] = true; tileShine2[0x43] = true; tileShine2[0x44] = true; tileShine2[0x6b] = true; tileShine2[0x6c] = true; tileShine2[0x6f] = true; tileShine2[0x79] = true; tileShine2[0x7a] = true; tileShine2[0x75] = true; tileShine[0x81] = 300; tileHammer[0x8d] = true; tileHammer[4] = true; tileHammer[10] = true; tileHammer[11] = true; tileHammer[12] = true; tileHammer[13] = true; tileHammer[14] = true; tileHammer[15] = true; tileHammer[0x10] = true; tileHammer[0x11] = true; tileHammer[0x12] = true; tileHammer[0x13] = true; tileHammer[0x15] = true; tileHammer[0x1a] = true; tileHammer[0x1c] = true; tileHammer[0x1d] = true; tileHammer[0x1f] = true; tileHammer[0x21] = true; tileHammer[0x22] = true; tileHammer[0x23] = true; tileHammer[0x24] = true; tileHammer[0x2a] = true; tileHammer[0x30] = true; tileHammer[0x31] = true; tileHammer[50] = true; tileHammer[0x36] = true; tileHammer[0x37] = true; tileHammer[0x4d] = true; tileHammer[0x4e] = true; tileHammer[0x4f] = true; tileHammer[0x51] = true; tileHammer[0x55] = true; tileHammer[0x56] = true; tileHammer[0x57] = true; tileHammer[0x58] = true; tileHammer[0x59] = true; tileHammer[90] = true; tileHammer[0x5b] = true; tileHammer[0x5c] = true; tileHammer[0x5d] = true; tileHammer[0x5e] = true; tileHammer[0x5f] = true; tileHammer[0x60] = true; tileHammer[0x61] = true; tileHammer[0x62] = true; tileHammer[0x63] = true; tileHammer[100] = true; tileHammer[0x65] = true; tileHammer[0x66] = true; tileHammer[0x67] = true; tileHammer[0x68] = true; tileHammer[0x69] = true; tileHammer[0x6a] = true; tileHammer[0x72] = true; tileHammer[0x7d] = true; tileHammer[0x7e] = true; tileHammer[0x80] = true; tileHammer[0x81] = true; tileHammer[0x84] = true; tileHammer[0x85] = true; tileHammer[0x86] = true; tileHammer[0x87] = true; tileHammer[0x88] = true; tileFrameImportant[0x8b] = true; tileHammer[0x8b] = true; tileLighted[0x95] = true; tileFrameImportant[0x95] = true; tileHammer[0x95] = true; tileFrameImportant[0x8e] = true; tileHammer[0x8e] = true; tileFrameImportant[0x8f] = true; tileHammer[0x8f] = true; tileFrameImportant[0x90] = true; tileHammer[0x90] = true; tileStone[0x83] = true; tileFrameImportant[0x88] = true; tileFrameImportant[0x89] = true; tileFrameImportant[0x8a] = true; tileBlockLight[0x89] = true; tileSolid[0x89] = true; tileBlockLight[0x91] = true; tileSolid[0x91] = true; tileMergeDirt[0x91] = true; tileBlockLight[0x92] = true; tileSolid[0x92] = true; tileMergeDirt[0x92] = true; tileBlockLight[0x93] = true; tileSolid[0x93] = true; tileMergeDirt[0x93] = true; tileBlockLight[0x94] = true; tileSolid[0x94] = true; tileMergeDirt[0x94] = true; tileBlockLight[0x8a] = true; tileSolid[0x8a] = true; tileBlockLight[140] = true; tileSolid[140] = true; tileAxe[5] = true; tileAxe[30] = true; tileAxe[0x48] = true; tileAxe[80] = true; tileAxe[0x7c] = true; tileShine[0x16] = 0x47e; tileShine[6] = 0x47e; tileShine[7] = 0x44c; tileShine[8] = 0x3e8; tileShine[9] = 0x41a; tileShine[12] = 0x3e8; tileShine[0x15] = 0x4b0; tileShine[0x3f] = 900; tileShine[0x40] = 900; tileShine[0x41] = 900; tileShine[0x42] = 900; tileShine[0x43] = 900; tileShine[0x44] = 900; tileShine[0x2d] = 0x76c; tileShine[0x2e] = 0x7d0; tileShine[0x2f] = 0x834; tileShine[0x7a] = 0x708; tileShine[0x79] = 0x73a; tileShine[0x7d] = 600; tileShine[0x6d] = 0x2328; tileShine[110] = 0x2328; tileShine[0x74] = 0x2328; tileShine[0x75] = 0x2328; tileShine[0x76] = 0x1f40; tileShine[0x6b] = 950; tileShine[0x6c] = 900; tileShine[0x6f] = 850; tileLighted[4] = true; tileLighted[0x11] = true; tileLighted[0x85] = true; tileLighted[0x1f] = true; tileLighted[0x21] = true; tileLighted[0x22] = true; tileLighted[0x23] = true; tileLighted[0x24] = true; tileLighted[0x25] = true; tileLighted[0x2a] = true; tileLighted[0x31] = true; tileLighted[0x3a] = true; tileLighted[0x3d] = true; tileLighted[70] = true; tileLighted[0x47] = true; tileLighted[0x48] = true; tileLighted[0x4c] = true; tileLighted[0x4d] = true; tileLighted[0x13] = true; tileLighted[0x16] = true; tileLighted[0x1a] = true; tileLighted[0x53] = true; tileLighted[0x54] = true; tileLighted[0x5c] = true; tileLighted[0x5d] = true; tileLighted[0x5f] = true; tileLighted[0x62] = true; tileLighted[100] = true; tileLighted[0x6d] = true; tileLighted[0x7d] = true; tileLighted[0x7e] = true; tileLighted[0x81] = true; tileLighted[140] = true; tileMergeDirt[1] = true; tileMergeDirt[6] = true; tileMergeDirt[7] = true; tileMergeDirt[8] = true; tileMergeDirt[9] = true; tileMergeDirt[0x16] = true; tileMergeDirt[0x19] = true; tileMergeDirt[30] = true; tileMergeDirt[0x25] = true; tileMergeDirt[0x26] = true; tileMergeDirt[40] = true; tileMergeDirt[0x35] = true; tileMergeDirt[0x38] = true; tileMergeDirt[0x6b] = true; tileMergeDirt[0x6c] = true; tileMergeDirt[0x6f] = true; tileMergeDirt[0x70] = true; tileMergeDirt[0x74] = true; tileMergeDirt[0x75] = true; tileMergeDirt[0x7b] = true; tileMergeDirt[140] = true; tileMergeDirt[0x27] = true; tileMergeDirt[0x7a] = true; tileMergeDirt[0x79] = true; tileMergeDirt[120] = true; tileMergeDirt[0x77] = true; tileMergeDirt[0x76] = true; tileMergeDirt[0x2f] = true; tileMergeDirt[0x2e] = true; tileMergeDirt[0x2d] = true; tileMergeDirt[0x2c] = true; tileMergeDirt[0x2b] = true; tileMergeDirt[0x29] = true; tileFrameImportant[3] = true; tileFrameImportant[4] = true; tileFrameImportant[5] = true; tileFrameImportant[10] = true; tileFrameImportant[11] = true; tileFrameImportant[12] = true; tileFrameImportant[13] = true; tileFrameImportant[14] = true; tileFrameImportant[15] = true; tileFrameImportant[0x10] = true; tileFrameImportant[0x11] = true; tileFrameImportant[0x12] = true; tileFrameImportant[20] = true; tileFrameImportant[0x15] = true; tileFrameImportant[0x18] = true; tileFrameImportant[0x1a] = true; tileFrameImportant[0x1b] = true; tileFrameImportant[0x1c] = true; tileFrameImportant[0x1d] = true; tileFrameImportant[0x1f] = true; tileFrameImportant[0x21] = true; tileFrameImportant[0x22] = true; tileFrameImportant[0x23] = true; tileFrameImportant[0x24] = true; tileFrameImportant[0x2a] = true; tileFrameImportant[50] = true; tileFrameImportant[0x37] = true; tileFrameImportant[0x3d] = true; tileFrameImportant[0x47] = true; tileFrameImportant[0x48] = true; tileFrameImportant[0x49] = true; tileFrameImportant[0x4a] = true; tileFrameImportant[0x4d] = true; tileFrameImportant[0x4e] = true; tileFrameImportant[0x4f] = true; tileFrameImportant[0x51] = true; tileFrameImportant[0x52] = true; tileFrameImportant[0x53] = true; tileFrameImportant[0x54] = true; tileFrameImportant[0x55] = true; tileFrameImportant[0x56] = true; tileFrameImportant[0x57] = true; tileFrameImportant[0x58] = true; tileFrameImportant[0x59] = true; tileFrameImportant[90] = true; tileFrameImportant[0x5b] = true; tileFrameImportant[0x5c] = true; tileFrameImportant[0x5d] = true; tileFrameImportant[0x5e] = true; tileFrameImportant[0x5f] = true; tileFrameImportant[0x60] = true; tileFrameImportant[0x61] = true; tileFrameImportant[0x62] = true; tileFrameImportant[0x63] = true; tileFrameImportant[0x65] = true; tileFrameImportant[0x66] = true; tileFrameImportant[0x67] = true; tileFrameImportant[0x68] = true; tileFrameImportant[0x69] = true; tileFrameImportant[100] = true; tileFrameImportant[0x6a] = true; tileFrameImportant[110] = true; tileFrameImportant[0x71] = true; tileFrameImportant[0x72] = true; tileFrameImportant[0x7d] = true; tileFrameImportant[0x7e] = true; tileFrameImportant[0x80] = true; tileFrameImportant[0x81] = true; tileFrameImportant[0x84] = true; tileFrameImportant[0x85] = true; tileFrameImportant[0x86] = true; tileFrameImportant[0x87] = true; tileFrameImportant[0x8d] = true; tileCut[3] = true; tileCut[0x18] = true; tileCut[0x1c] = true; tileCut[0x20] = true; tileCut[0x33] = true; tileCut[0x34] = true; tileCut[0x3d] = true; tileCut[0x3e] = true; tileCut[0x45] = true; tileCut[0x47] = true; tileCut[0x49] = true; tileCut[0x4a] = true; tileCut[0x52] = true; tileCut[0x53] = true; tileCut[0x54] = true; tileCut[110] = true; tileCut[0x71] = true; tileCut[0x73] = true; tileAlch[0x52] = true; tileAlch[0x53] = true; tileAlch[0x54] = true; tileLavaDeath[0x68] = true; tileLavaDeath[110] = true; tileLavaDeath[0x71] = true; tileLavaDeath[0x73] = true; tileSolid[0x7f] = true; tileSolid[130] = true; tileBlockLight[130] = true; tileBlockLight[0x83] = true; tileSolid[0x6b] = true; tileBlockLight[0x6b] = true; tileSolid[0x6c] = true; tileBlockLight[0x6c] = true; tileSolid[0x6f] = true; tileBlockLight[0x6f] = true; tileSolid[0x6d] = true; tileBlockLight[0x6d] = true; tileSolid[110] = false; tileNoAttach[110] = true; tileNoFail[110] = true; tileSolid[0x70] = true; tileBlockLight[0x70] = true; tileSolid[0x74] = true; tileBlockLight[0x74] = true; tileSolid[0x75] = true; tileBlockLight[0x75] = true; tileSolid[0x7b] = true; tileBlockLight[0x7b] = true; tileSolid[0x76] = true; tileBlockLight[0x76] = true; tileSolid[0x77] = true; tileBlockLight[0x77] = true; tileSolid[120] = true; tileBlockLight[120] = true; tileSolid[0x79] = true; tileBlockLight[0x79] = true; tileSolid[0x7a] = true; tileBlockLight[0x7a] = true; tileBlockLight[0x73] = true; tileSolid[0] = true; tileBlockLight[0] = true; tileSolid[1] = true; tileBlockLight[1] = true; tileSolid[2] = true; tileBlockLight[2] = true; tileSolid[3] = false; tileNoAttach[3] = true; tileNoFail[3] = true; tileSolid[4] = false; tileNoAttach[4] = true; tileNoFail[4] = true; tileNoFail[0x18] = true; tileSolid[5] = false; tileSolid[6] = true; tileBlockLight[6] = true; tileSolid[7] = true; tileBlockLight[7] = true; tileSolid[8] = true; tileBlockLight[8] = true; tileSolid[9] = true; tileBlockLight[9] = true; tileBlockLight[10] = true; tileSolid[10] = true; tileNoAttach[10] = true; tileBlockLight[10] = true; tileSolid[11] = false; tileSolidTop[0x13] = true; tileSolid[0x13] = true; tileSolid[0x16] = true; tileSolid[0x17] = true; tileSolid[0x19] = true; tileSolid[30] = true; tileNoFail[0x20] = true; tileBlockLight[0x20] = true; tileSolid[0x25] = true; tileBlockLight[0x25] = true; tileSolid[0x26] = true; tileBlockLight[0x26] = true; tileSolid[0x27] = true; tileBlockLight[0x27] = true; tileSolid[40] = true; tileBlockLight[40] = true; tileSolid[0x29] = true; tileBlockLight[0x29] = true; tileSolid[0x2b] = true; tileBlockLight[0x2b] = true; tileSolid[0x2c] = true; tileBlockLight[0x2c] = true; tileSolid[0x2d] = true; tileBlockLight[0x2d] = true; tileSolid[0x2e] = true; tileBlockLight[0x2e] = true; tileSolid[0x2f] = true; tileBlockLight[0x2f] = true; tileSolid[0x30] = true; tileBlockLight[0x30] = true; tileSolid[0x35] = true; tileBlockLight[0x35] = true; tileSolid[0x36] = true; tileBlockLight[0x34] = true; tileSolid[0x38] = true; tileBlockLight[0x38] = true; tileSolid[0x39] = true; tileBlockLight[0x39] = true; tileSolid[0x3a] = true; tileBlockLight[0x3a] = true; tileSolid[0x3b] = true; tileBlockLight[0x3b] = true; tileSolid[60] = true; tileBlockLight[60] = true; tileSolid[0x3f] = true; tileBlockLight[0x3f] = true; tileStone[0x3f] = true; tileStone[130] = true; tileSolid[0x40] = true; tileBlockLight[0x40] = true; tileStone[0x40] = true; tileSolid[0x41] = true; tileBlockLight[0x41] = true; tileStone[0x41] = true; tileSolid[0x42] = true; tileBlockLight[0x42] = true; tileStone[0x42] = true; tileSolid[0x43] = true; tileBlockLight[0x43] = true; tileStone[0x43] = true; tileSolid[0x44] = true; tileBlockLight[0x44] = true; tileStone[0x44] = true; tileSolid[0x4b] = true; tileBlockLight[0x4b] = true; tileSolid[0x4c] = true; tileBlockLight[0x4c] = true; tileSolid[70] = true; tileBlockLight[70] = true; tileNoFail[50] = true; tileNoAttach[50] = true; tileDungeon[0x29] = true; tileDungeon[0x2b] = true; tileDungeon[0x2c] = true; tileBlockLight[30] = true; tileBlockLight[0x19] = true; tileBlockLight[0x17] = true; tileBlockLight[0x16] = true; tileBlockLight[0x3e] = true; tileSolidTop[0x12] = true; tileSolidTop[14] = true; tileSolidTop[0x10] = true; tileSolidTop[0x72] = true; tileNoAttach[20] = true; tileNoAttach[0x13] = true; tileNoAttach[13] = true; tileNoAttach[14] = true; tileNoAttach[15] = true; tileNoAttach[0x10] = true; tileNoAttach[0x11] = true; tileNoAttach[0x12] = true; tileNoAttach[0x13] = true; tileNoAttach[0x15] = true; tileNoAttach[0x1b] = true; tileNoAttach[0x72] = true; tileTable[14] = true; tileTable[0x12] = true; tileTable[0x13] = true; tileTable[0x72] = true; tileNoAttach[0x56] = true; tileNoAttach[0x57] = true; tileNoAttach[0x58] = true; tileNoAttach[0x59] = true; tileNoAttach[90] = true; tileLavaDeath[0x56] = true; tileLavaDeath[0x57] = true; tileLavaDeath[0x58] = true; tileLavaDeath[0x59] = true; tileLavaDeath[0x7d] = true; tileLavaDeath[0x7e] = true; tileLavaDeath[0x65] = true; tileTable[0x65] = true; tileNoAttach[0x65] = true; tileLavaDeath[0x66] = true; tileNoAttach[0x66] = true; tileNoAttach[0x5e] = true; tileNoAttach[0x5f] = true; tileNoAttach[0x60] = true; tileNoAttach[0x61] = true; tileNoAttach[0x62] = true; tileNoAttach[0x63] = true; tileLavaDeath[0x5e] = true; tileLavaDeath[0x5f] = true; tileLavaDeath[0x60] = true; tileLavaDeath[0x61] = true; tileLavaDeath[0x62] = true; tileLavaDeath[0x63] = true; tileLavaDeath[100] = true; tileLavaDeath[0x67] = true; tileTable[0x57] = true; tileTable[0x58] = true; tileSolidTop[0x57] = true; tileSolidTop[0x58] = true; tileSolidTop[0x65] = true; tileNoAttach[0x5b] = true; tileLavaDeath[0x5b] = true; tileNoAttach[0x5c] = true; tileLavaDeath[0x5c] = true; tileNoAttach[0x5d] = true; tileLavaDeath[0x5d] = true; tileWaterDeath[4] = true; tileWaterDeath[0x33] = true; tileWaterDeath[0x5d] = true; tileWaterDeath[0x62] = true; tileLavaDeath[3] = true; tileLavaDeath[5] = true; tileLavaDeath[10] = true; tileLavaDeath[11] = true; tileLavaDeath[12] = true; tileLavaDeath[13] = true; tileLavaDeath[14] = true; tileLavaDeath[15] = true; tileLavaDeath[0x10] = true; tileLavaDeath[0x11] = true; tileLavaDeath[0x12] = true; tileLavaDeath[0x13] = true; tileLavaDeath[20] = true; tileLavaDeath[0x1b] = true; tileLavaDeath[0x1c] = true; tileLavaDeath[0x1d] = true; tileLavaDeath[0x20] = true; tileLavaDeath[0x21] = true; tileLavaDeath[0x22] = true; tileLavaDeath[0x23] = true; tileLavaDeath[0x24] = true; tileLavaDeath[0x2a] = true; tileLavaDeath[0x31] = true; tileLavaDeath[50] = true; tileLavaDeath[0x34] = true; tileLavaDeath[0x37] = true; tileLavaDeath[0x3d] = true; tileLavaDeath[0x3e] = true; tileLavaDeath[0x45] = true; tileLavaDeath[0x47] = true; tileLavaDeath[0x48] = true; tileLavaDeath[0x49] = true; tileLavaDeath[0x4a] = true; tileLavaDeath[0x4f] = true; tileLavaDeath[80] = true; tileLavaDeath[0x51] = true; tileLavaDeath[0x6a] = true; wallHouse[1] = true; wallHouse[4] = true; wallHouse[5] = true; wallHouse[6] = true; wallHouse[10] = true; wallHouse[11] = true; wallHouse[12] = true; wallHouse[0x10] = true; wallHouse[0x11] = true; wallHouse[0x12] = true; wallHouse[0x13] = true; wallHouse[20] = true; wallHouse[0x15] = true; wallHouse[0x16] = true; wallHouse[0x17] = true; wallHouse[0x18] = true; wallHouse[0x19] = true; wallHouse[0x1a] = true; wallHouse[0x1b] = true; wallHouse[0x1d] = true; wallHouse[30] = true; wallHouse[0x1f] = true; for (int k = 0; k < 0x20; k++) { switch (k) { case 20: wallBlend[k] = 14; break; case 0x13: wallBlend[k] = 9; break; case 0x12: wallBlend[k] = 8; break; case 0x11: wallBlend[k] = 7; break; case 0x10: wallBlend[k] = 2; break; default: wallBlend[k] = k; break; } } tileNoFail[0x20] = true; tileNoFail[0x3d] = true; tileNoFail[0x45] = true; tileNoFail[0x49] = true; tileNoFail[0x4a] = true; tileNoFail[0x52] = true; tileNoFail[0x53] = true; tileNoFail[0x54] = true; tileNoFail[110] = true; tileNoFail[0x71] = true; for (int m = 0; m < maxTileSets; m++) //CHANGED: orig 150 { tileName[m] = ""; if (tileSolid[m]) { tileNoSunLight[m] = true; } } tileNoSunLight[0x13] = false; tileNoSunLight[11] = true; tileName[13] = "Bottle"; tileName[14] = "Table"; tileName[15] = "Chair"; tileName[0x10] = "Anvil"; tileName[0x11] = "Furnace"; tileName[0x12] = "Workbench"; tileName[0x1a] = "Demon Altar"; tileName[0x4d] = "Hellforge"; tileName[0x56] = "Loom"; tileName[0x5e] = "Keg"; tileName[0x60] = "Cooking Pot"; tileName[0x65] = "Bookcase"; tileName[0x6a] = "Sawmill"; tileName[0x72] = "Tinkerer's Workshop"; tileName[0x85] = "Adamantite Forge"; tileName[0x86] = "Mythril Anvil"; for (int n = 0; n < maxMenuItems; n++) { this.menuItemScale[n] = 0.8f; } for (int num7 = 0; num7 < 0x7d1; num7++) { dust[num7] = new Dust(); } for (int num8 = 0; num8 < 0xc9; num8++) { Main.item[num8] = new Item(); } for (int num9 = 0; num9 < 0xc9; num9++) { npc[num9] = new NPC(); npc[num9].whoAmI = num9; } for (int num10 = 0; num10 < 0x100; num10++) { player[num10] = new Player(); } for (int num11 = 0; num11 < 0x3e9; num11++) { projectile[num11] = new Projectile(); } for (int num12 = 0; num12 < 0xc9; num12++) { gore[num12] = new Gore(); } for (int num13 = 0; num13 < 100; num13++) { cloud[num13] = new Cloud(); } for (int num14 = 0; num14 < 100; num14++) { combatText[num14] = new CombatText(); } for (int num15 = 0; num15 < 20; num15++) { itemText[num15] = new ItemText(); } for (int num16 = 0; num16 < maxItemTypes; num16++) //CHANGED, orig 0x25b { Item item = new Item(); item.SetDefaults(num16, false); itemName[num16] = item.name; if (item.headSlot > 0) { Item.headType[item.headSlot] = item.type; } if (item.bodySlot > 0) { Item.bodyType[item.bodySlot] = item.type; } if (item.legSlot > 0) { Item.legType[item.legSlot] = item.type; } } for (int num17 = 0; num17 < Recipe.maxRecipes; num17++) { recipe[num17] = new Recipe(); availableRecipeY[num17] = 0x41 * num17; } Recipe.SetupRecipes(); for (int num18 = 0; num18 < numChatLines; num18++) { chatLine[num18] = new ChatLine(); } for (int num19 = 0; num19 < Liquid.resLiquid; num19++) { liquid[num19] = new Liquid(); } for (int num20 = 0; num20 < 0x2710; num20++) { liquidBuffer[num20] = new LiquidBuffer(); } this.shop[0] = new Chest(); this.shop[1] = new Chest(); this.shop[1].SetupShop(1); this.shop[2] = new Chest(); this.shop[2].SetupShop(2); this.shop[3] = new Chest(); this.shop[3].SetupShop(3); this.shop[4] = new Chest(); this.shop[4].SetupShop(4); this.shop[5] = new Chest(); this.shop[5].SetupShop(5); this.shop[6] = new Chest(); this.shop[6].SetupShop(6); this.shop[7] = new Chest(); this.shop[7].SetupShop(7); this.shop[8] = new Chest(); this.shop[8].SetupShop(8); this.shop[9] = new Chest(); this.shop[9].SetupShop(9); teamColor[0] = Color.White; teamColor[1] = new Color(230, 40, 20); teamColor[2] = new Color(20, 200, 30); teamColor[3] = new Color(0x4b, 90, 0xff); teamColor[4] = new Color(200, 180, 0); if (menuMode == 1) { LoadPlayers(); } Netplay.Init(); /*if (skipMenu) // CHANGED: wasnt working so made new skipmenu (line 17280) { WorldGen.clearWorld(); gameMenu = false; LoadPlayers(); player[myPlayer] = (Player)loadPlayer[0].Clone(); PlayerPath = loadPlayerPath[0]; LoadWorlds(); WorldGen.generateWorld(-1); WorldGen.EveryTileFrame(); player[myPlayer].Spawn(); } else {*/ IntPtr systemMenu = GetSystemMenu(base.Window.Handle, false); int menuItemCount = GetMenuItemCount(systemMenu); RemoveMenu(systemMenu, menuItemCount - 1, 0x400); //} if (!dedServ) { this.graphics.PreferredBackBufferWidth = screenWidth; this.graphics.PreferredBackBufferHeight = screenHeight; this.graphics.ApplyChanges(); base.Initialize(); base.Window.AllowUserResizing = true; this.OpenSettings(); this.OpenRecent(); Star.SpawnStars(); foreach (DisplayMode mode in GraphicsAdapter.DefaultAdapter.SupportedDisplayModes) { if (((mode.Width < minScreenW) || (mode.Height < minScreenH)) || ((mode.Width > maxScreenW) || (mode.Height > maxScreenH))) { continue; } bool flag = true; for (int num22 = 0; num22 < this.numDisplayModes; num22++) { if ((mode.Width == this.displayWidth[num22]) && (mode.Height == this.displayHeight[num22])) { flag = false; break; } } if (flag) { this.displayHeight[this.numDisplayModes] = mode.Height; this.displayWidth[this.numDisplayModes] = mode.Width; this.numDisplayModes++; } } if (autoJoin) { LoadPlayers(); menuMode = 1; menuMultiplayer = true; } fpsTimer.Start(); updateTimer.Start(); } if(Mods.ModMain.skipMenu) { Mods.ModMain.skipMenus(); //CHANGED: Try to skip menus } }
private static void InnerClientLoop() { try { NetMessage.buffer[256].Reset(); int num1 = -1; while (!Netplay.disconnect) { if (Netplay.Connection.Socket.IsConnected()) { if (NetMessage.buffer[256].checkBytes) { NetMessage.CheckBytes(256); } Netplay.Connection.IsActive = true; if (Netplay.Connection.State == 0) { Main.statusText = Language.GetTextValue("Net.FoundServer"); Netplay.Connection.State = 1; NetMessage.SendData(1, -1, -1, (NetworkText)null, 0, 0.0f, 0.0f, 0.0f, 0, 0, 0); } if (Netplay.Connection.State == 2 && num1 != Netplay.Connection.State) { Main.statusText = Language.GetTextValue("Net.SendingPlayerData"); } if (Netplay.Connection.State == 3 && num1 != Netplay.Connection.State) { Main.statusText = Language.GetTextValue("Net.RequestingWorldInformation"); } if (Netplay.Connection.State == 4) { WorldGen.worldCleared = false; Netplay.Connection.State = 5; Main.cloudBGAlpha = (double)Main.cloudBGActive < 1.0 ? 0.0f : 1f; Main.windSpeed = Main.windSpeedSet; Cloud.resetClouds(); Main.cloudAlpha = Main.maxRaining; WorldGen.clearWorld(); if (Main.mapEnabled) { Main.Map.Load(); } } if (Netplay.Connection.State == 5 && Main.loadMapLock) { float num2 = (float)Main.loadMapLastX / (float)Main.maxTilesX; Main.statusText = Lang.gen[68].Value + " " + (object)(int)((double)num2 * 100.0 + 1.0) + "%"; } else if (Netplay.Connection.State == 5 && WorldGen.worldCleared) { Netplay.Connection.State = 6; Main.player[Main.myPlayer].FindSpawn(); NetMessage.SendData(8, -1, -1, (NetworkText)null, Main.player[Main.myPlayer].SpawnX, (float)Main.player[Main.myPlayer].SpawnY, 0.0f, 0.0f, 0, 0, 0); } if (Netplay.Connection.State == 6 && num1 != Netplay.Connection.State) { Main.statusText = Language.GetTextValue("Net.RequestingTileData"); } if (!Netplay.Connection.IsReading && !Netplay.disconnect && Netplay.Connection.Socket.IsDataAvailable()) { Netplay.Connection.IsReading = true; Netplay.Connection.Socket.AsyncReceive(Netplay.Connection.ReadBuffer, 0, Netplay.Connection.ReadBuffer.Length, new SocketReceiveCallback(Netplay.Connection.ClientReadCallBack), (object)null); } if (Netplay.Connection.StatusMax > 0 && Netplay.Connection.StatusText != "") { if (Netplay.Connection.StatusCount >= Netplay.Connection.StatusMax) { Main.statusText = Language.GetTextValue("Net.StatusComplete", (object)Netplay.Connection.StatusText); Netplay.Connection.StatusText = ""; Netplay.Connection.StatusMax = 0; Netplay.Connection.StatusCount = 0; } else { Main.statusText = Netplay.Connection.StatusText + ": " + (object)(int)((double)Netplay.Connection.StatusCount / (double)Netplay.Connection.StatusMax * 100.0) + "%"; } } Thread.Sleep(1); } else if (Netplay.Connection.IsActive) { Main.statusText = Language.GetTextValue("Net.LostConnection"); Netplay.disconnect = true; } num1 = Netplay.Connection.State; } try { Netplay.Connection.Socket.Close(); } catch { } if (!Main.gameMenu) { Main.SwitchNetMode(0); Player.SavePlayer(Main.ActivePlayerFileData, false); Main.ActivePlayerFileData.StopPlayTimer(); Main.gameMenu = true; Main.StopTrackedSounds(); Main.menuMode = 14; } NetMessage.buffer[256].Reset(); if (Main.menuMode == 15 && Main.statusText == Language.GetTextValue("Net.LostConnection")) { Main.menuMode = 14; } if (Netplay.Connection.StatusText != "" && Netplay.Connection.StatusText != null) { Main.statusText = Language.GetTextValue("Net.LostConnection"); } Netplay.Connection.StatusCount = 0; Netplay.Connection.StatusMax = 0; Netplay.Connection.StatusText = ""; Main.SwitchNetMode(0); } catch (Exception ex) { try { using (StreamWriter streamWriter = new StreamWriter("client-crashlog.txt", true)) { streamWriter.WriteLine((object)DateTime.Now); streamWriter.WriteLine((object)ex); streamWriter.WriteLine(""); } } catch { } Netplay.disconnect = true; } if (Netplay.OnDisconnect == null) { return; } Netplay.OnDisconnect(); }
private static void InnerClientLoop() { try { NetMessage.buffer[256].Reset(); int num = -1; while (!Disconnect) { if (Connection.Socket.IsConnected()) { Connection.IsActive = true; if (Connection.State == 0) { Main.statusText = Language.GetTextValue("Net.FoundServer"); Connection.State = 1; NetMessage.SendData(1); } if (Connection.State == 2 && num != Connection.State) { Main.statusText = Language.GetTextValue("Net.SendingPlayerData"); } if (Connection.State == 3 && num != Connection.State) { Main.statusText = Language.GetTextValue("Net.RequestingWorldInformation"); } if (Connection.State == 4) { WorldGen.worldCleared = false; Connection.State = 5; if (Main.cloudBGActive >= 1f) { Main.cloudBGAlpha = 1f; } else { Main.cloudBGAlpha = 0f; } Main.windSpeedCurrent = Main.windSpeedTarget; Cloud.resetClouds(); Main.cloudAlpha = Main.maxRaining; WorldGen.clearWorld(); if (Main.mapEnabled) { Main.Map.Load(); } } if (Connection.State == 5 && Main.loadMapLock) { float num2 = (float)Main.loadMapLastX / (float)Main.maxTilesX; Main.statusText = Lang.gen[68].Value + " " + (int)(num2 * 100f + 1f) + "%"; } else if (Connection.State == 5 && WorldGen.worldCleared) { Connection.State = 6; Main.player[Main.myPlayer].FindSpawn(); NetMessage.SendData(8, -1, -1, null, Main.player[Main.myPlayer].SpawnX, Main.player[Main.myPlayer].SpawnY); } if (Connection.State == 6 && num != Connection.State) { Main.statusText = Language.GetTextValue("Net.RequestingTileData"); } if (!Connection.IsReading && !Disconnect && Connection.Socket.IsDataAvailable()) { Connection.IsReading = true; Connection.Socket.AsyncReceive(Connection.ReadBuffer, 0, Connection.ReadBuffer.Length, Connection.ClientReadCallBack); } if (Connection.StatusMax > 0 && Connection.StatusText != "") { if (Connection.StatusCount >= Connection.StatusMax) { Main.statusText = Language.GetTextValue("Net.StatusComplete", Connection.StatusText); Connection.StatusText = ""; Connection.StatusMax = 0; Connection.StatusCount = 0; } else { Main.statusText = Connection.StatusText + ": " + (int)((float)Connection.StatusCount / (float)Connection.StatusMax * 100f) + "%"; } } Thread.Sleep(1); } else if (Connection.IsActive) { Main.statusText = Language.GetTextValue("Net.LostConnection"); Disconnect = true; } num = Connection.State; } try { Connection.Socket.Close(); } catch { } if (!Main.gameMenu) { Main.gameMenu = true; Main.SwitchNetMode(0); MapHelper.noStatusText = true; Player.SavePlayer(Main.ActivePlayerFileData); Player.ClearPlayerTempInfo(); Main.ActivePlayerFileData.StopPlayTimer(); SoundEngine.StopTrackedSounds(); MapHelper.noStatusText = false; Main.menuMode = 14; } NetMessage.buffer[256].Reset(); if (Main.menuMode == 15 && Main.statusText == Language.GetTextValue("Net.LostConnection")) { Main.menuMode = 14; } if (Connection.StatusText != "" && Connection.StatusText != null) { Main.statusText = Language.GetTextValue("Net.LostConnection"); } Connection.StatusCount = 0; Connection.StatusMax = 0; Connection.StatusText = ""; Main.SwitchNetMode(0); } catch (Exception value) { try { using (StreamWriter streamWriter = new StreamWriter("client-crashlog.txt", append: true)) { streamWriter.WriteLine(DateTime.Now); streamWriter.WriteLine(value); streamWriter.WriteLine(""); } } catch { } Disconnect = true; } if (Netplay.OnDisconnect != null) { Netplay.OnDisconnect(); } }
protected override void Initialize() { if (webProtect) { this.getAuth(); while (!webAuth) { base.Exit(); } } if (rand == null) { rand = new Random((int) DateTime.Now.Ticks); } if (WorldGen.genRand == null) { WorldGen.genRand = new Random((int) DateTime.Now.Ticks); } this.OpenSettings(); switch (rand.Next(5)) { case 0: base.Window.Title = "Terraria: Dig Peon, Dig!"; break; case 1: base.Window.Title = "Terraria: Epic Dirt"; break; case 2: base.Window.Title = "Terraria: Hey Guys!"; break; case 3: base.Window.Title = "Terraria: Sand is Overpowered"; goto Label_00CF; } base.Window.Title = "Terraria: Shut Up and Dig Gaiden!"; Label_00CF: tileSolid[0] = true; tileBlockLight[0] = true; tileSolid[1] = true; tileBlockLight[1] = true; tileSolid[2] = true; tileBlockLight[2] = true; tileSolid[3] = false; tileNoAttach[3] = true; tileNoFail[3] = true; tileSolid[4] = false; tileNoAttach[4] = true; tileNoFail[4] = true; tileNoFail[0x18] = true; tileSolid[5] = false; tileSolid[6] = true; tileBlockLight[6] = true; tileSolid[7] = true; tileBlockLight[7] = true; tileSolid[8] = true; tileBlockLight[8] = true; tileSolid[9] = true; tileBlockLight[9] = true; tileBlockLight[10] = true; tileSolid[10] = true; tileNoAttach[10] = true; tileBlockLight[10] = true; tileSolid[11] = false; tileSolidTop[0x13] = true; tileSolid[0x13] = true; tileSolid[0x16] = true; tileSolid[0x17] = true; tileSolid[0x19] = true; tileSolid[30] = true; tileNoFail[0x20] = true; tileBlockLight[0x20] = true; tileSolid[0x25] = true; tileBlockLight[0x25] = true; tileSolid[0x26] = true; tileBlockLight[0x26] = true; tileSolid[0x27] = true; tileBlockLight[0x27] = true; tileSolid[40] = true; tileBlockLight[40] = true; tileSolid[0x29] = true; tileBlockLight[0x29] = true; tileSolid[0x2b] = true; tileBlockLight[0x2b] = true; tileSolid[0x2c] = true; tileBlockLight[0x2c] = true; tileSolid[0x2d] = true; tileBlockLight[0x2d] = true; tileSolid[0x2e] = true; tileBlockLight[0x2e] = true; tileSolid[0x2f] = true; tileBlockLight[0x2f] = true; tileSolid[0x30] = true; tileBlockLight[0x30] = true; tileSolid[0x35] = true; tileBlockLight[0x35] = true; tileSolid[0x36] = true; tileBlockLight[0x34] = true; tileSolid[0x38] = true; tileBlockLight[0x38] = true; tileSolid[0x39] = true; tileBlockLight[0x39] = true; tileSolid[0x3a] = true; tileBlockLight[0x3a] = true; tileSolid[0x3b] = true; tileBlockLight[0x3b] = true; tileSolid[60] = true; tileBlockLight[60] = true; tileSolid[0x3f] = true; tileBlockLight[0x3f] = true; tileStone[0x3f] = true; tileSolid[0x40] = true; tileBlockLight[0x40] = true; tileStone[0x40] = true; tileSolid[0x41] = true; tileBlockLight[0x41] = true; tileStone[0x41] = true; tileSolid[0x42] = true; tileBlockLight[0x42] = true; tileStone[0x42] = true; tileSolid[0x43] = true; tileBlockLight[0x43] = true; tileStone[0x43] = true; tileSolid[0x44] = true; tileBlockLight[0x44] = true; tileStone[0x44] = true; tileSolid[0x4b] = true; tileBlockLight[0x4b] = true; tileSolid[0x4c] = true; tileBlockLight[0x4c] = true; tileSolid[70] = true; tileBlockLight[70] = true; tileBlockLight[0x33] = true; tileNoFail[50] = true; tileNoAttach[50] = true; tileDungeon[0x29] = true; tileDungeon[0x2b] = true; tileDungeon[0x2c] = true; tileBlockLight[30] = true; tileBlockLight[0x19] = true; tileBlockLight[0x17] = true; tileBlockLight[0x16] = true; tileBlockLight[0x3e] = true; tileSolidTop[0x12] = true; tileSolidTop[14] = true; tileSolidTop[0x10] = true; tileNoAttach[20] = true; tileNoAttach[0x13] = true; tileNoAttach[13] = true; tileNoAttach[14] = true; tileNoAttach[15] = true; tileNoAttach[0x10] = true; tileNoAttach[0x11] = true; tileNoAttach[0x12] = true; tileNoAttach[0x13] = true; tileNoAttach[0x15] = true; tileNoAttach[0x1b] = true; tileFrameImportant[3] = true; tileFrameImportant[5] = true; tileFrameImportant[10] = true; tileFrameImportant[11] = true; tileFrameImportant[12] = true; tileFrameImportant[13] = true; tileFrameImportant[14] = true; tileFrameImportant[15] = true; tileFrameImportant[0x10] = true; tileFrameImportant[0x11] = true; tileFrameImportant[0x12] = true; tileFrameImportant[20] = true; tileFrameImportant[0x15] = true; tileFrameImportant[0x18] = true; tileFrameImportant[0x1a] = true; tileFrameImportant[0x1b] = true; tileFrameImportant[0x1c] = true; tileFrameImportant[0x1d] = true; tileFrameImportant[0x1f] = true; tileFrameImportant[0x21] = true; tileFrameImportant[0x22] = true; tileFrameImportant[0x23] = true; tileFrameImportant[0x24] = true; tileFrameImportant[0x2a] = true; tileFrameImportant[50] = true; tileFrameImportant[0x37] = true; tileFrameImportant[0x3d] = true; tileFrameImportant[0x47] = true; tileFrameImportant[0x48] = true; tileFrameImportant[0x49] = true; tileFrameImportant[0x4a] = true; tileFrameImportant[0x4d] = true; tileFrameImportant[0x4e] = true; tileFrameImportant[0x4f] = true; tileTable[14] = true; tileTable[0x12] = true; tileTable[0x13] = true; tileWaterDeath[4] = true; tileWaterDeath[0x33] = true; tileLavaDeath[3] = true; tileLavaDeath[5] = true; tileLavaDeath[10] = true; tileLavaDeath[11] = true; tileLavaDeath[12] = true; tileLavaDeath[13] = true; tileLavaDeath[14] = true; tileLavaDeath[15] = true; tileLavaDeath[0x10] = true; tileLavaDeath[0x11] = true; tileLavaDeath[0x12] = true; tileLavaDeath[0x13] = true; tileLavaDeath[20] = true; tileLavaDeath[0x1b] = true; tileLavaDeath[0x1c] = true; tileLavaDeath[0x1d] = true; tileLavaDeath[0x20] = true; tileLavaDeath[0x21] = true; tileLavaDeath[0x22] = true; tileLavaDeath[0x23] = true; tileLavaDeath[0x24] = true; tileLavaDeath[0x2a] = true; tileLavaDeath[0x31] = true; tileLavaDeath[50] = true; tileLavaDeath[0x34] = true; tileLavaDeath[0x37] = true; tileLavaDeath[0x3d] = true; tileLavaDeath[0x3e] = true; tileLavaDeath[0x45] = true; tileLavaDeath[0x47] = true; tileLavaDeath[0x48] = true; tileLavaDeath[0x49] = true; tileLavaDeath[0x4a] = true; tileLavaDeath[0x4e] = true; tileLavaDeath[0x4f] = true; wallHouse[1] = true; wallHouse[4] = true; wallHouse[5] = true; wallHouse[6] = true; wallHouse[10] = true; wallHouse[11] = true; wallHouse[12] = true; for (int i = 0; i < maxMenuItems; i++) { this.menuItemScale[i] = 0.8f; } for (int j = 0; j < 0x7d0; j++) { dust[j] = new Dust(); } for (int k = 0; k < 0xc9; k++) { item[k] = new Item(); } for (int m = 0; m < 0x3e9; m++) { npc[m] = new NPC(); npc[m].whoAmI = m; } for (int n = 0; n < 9; n++) { player[n] = new Player(); } for (int num7 = 0; num7 < 0x3e9; num7++) { projectile[num7] = new Projectile(); } for (int num8 = 0; num8 < 0xc9; num8++) { gore[num8] = new Gore(); } for (int num9 = 0; num9 < 100; num9++) { cloud[num9] = new Cloud(); } for (int num10 = 0; num10 < 100; num10++) { combatText[num10] = new CombatText(); } for (int num11 = 0; num11 < Recipe.maxRecipes; num11++) { recipe[num11] = new Recipe(); availableRecipeY[num11] = 0x41 * num11; } Recipe.SetupRecipes(); for (int num12 = 0; num12 < numChatLines; num12++) { chatLine[num12] = new ChatLine(); } for (int num13 = 0; num13 < Liquid.resLiquid; num13++) { liquid[num13] = new Liquid(); } for (int num14 = 0; num14 < 0x2710; num14++) { liquidBuffer[num14] = new LiquidBuffer(); } this.graphics.PreferredBackBufferWidth = screenWidth; this.graphics.PreferredBackBufferHeight = screenHeight; this.graphics.ApplyChanges(); this.shop[0] = new Chest(); this.shop[1] = new Chest(); this.shop[1].SetupShop(1); this.shop[2] = new Chest(); this.shop[2].SetupShop(2); this.shop[3] = new Chest(); this.shop[3].SetupShop(3); this.shop[4] = new Chest(); this.shop[4].SetupShop(4); teamColor[0] = Color.White; teamColor[1] = new Color(230, 40, 20); teamColor[2] = new Color(20, 200, 30); teamColor[3] = new Color(0x4b, 90, 0xff); teamColor[4] = new Color(200, 180, 0); Netplay.Init(); if (skipMenu) { WorldGen.clearWorld(); gameMenu = false; LoadPlayers(); player[myPlayer] = (Player) loadPlayer[0].Clone(); PlayerPath = loadPlayerPath[0]; LoadWorlds(); WorldGen.generateWorld(-1); WorldGen.EveryTileFrame(); player[myPlayer].Spawn(); } else { IntPtr systemMenu = GetSystemMenu(base.Window.Handle, false); int menuItemCount = GetMenuItemCount(systemMenu); RemoveMenu(systemMenu, menuItemCount - 1, 0x400); } base.Initialize(); Star.SpawnStars(); }
public static void addCloud() { int num = -1; for (int i = 0; i < 100; i++) { if (!Main.cloud[i].active) { num = i; break; } } if (num >= 0) { Main.cloud[num].rSpeed = 0f; Main.cloud[num].sSpeed = 0f; Main.cloud[num].type = Cloud.rand.Next(4); Main.cloud[num].scale = (float)Cloud.rand.Next(70, 131) * 0.01f; Main.cloud[num].rotation = (float)Cloud.rand.Next(-10, 11) * 0.01f; Main.cloud[num].width = (int)((float)Main.cloudTexture[Main.cloud[num].type].Width * Main.cloud[num].scale); Main.cloud[num].height = (int)((float)Main.cloudTexture[Main.cloud[num].type].Height * Main.cloud[num].scale); float num2 = Main.windSpeed; if (!Main.gameMenu) { num2 = Main.windSpeed - Main.player[Main.myPlayer].velocity.X * 0.1f; } if (num2 > 0f) { Main.cloud[num].position.X = -(float)Main.cloud[num].width - (float)Main.cloudTexture[Main.cloud[num].type].Width - (float)Cloud.rand.Next(Main.screenWidth * 2); } else { Main.cloud[num].position.X = (float)(Main.screenWidth + Main.cloudTexture[Main.cloud[num].type].Width + Cloud.rand.Next(Main.screenWidth * 2)); } Main.cloud[num].position.Y = (float)Cloud.rand.Next((int)(-(float)Main.screenHeight * 0.25f), (int)((float)Main.screenHeight * 0.25f)); Cloud cloud = Main.cloud[num]; cloud.position.Y = cloud.position.Y - (float)Cloud.rand.Next((int)((float)Main.screenHeight * 0.15f)); Cloud cloud2 = Main.cloud[num]; cloud2.position.Y = cloud2.position.Y - (float)Cloud.rand.Next((int)((float)Main.screenHeight * 0.15f)); if ((double)Main.cloud[num].scale > 1.3) { Main.cloud[num].scale = 1.3f; } if ((double)Main.cloud[num].scale < 0.7) { Main.cloud[num].scale = 0.7f; } Main.cloud[num].active = true; Rectangle rectangle = new Rectangle((int)Main.cloud[num].position.X, (int)Main.cloud[num].position.Y, Main.cloud[num].width, Main.cloud[num].height); for (int j = 0; j < 100; j++) { if (num != j && Main.cloud[j].active) { Rectangle value = new Rectangle((int)Main.cloud[j].position.X, (int)Main.cloud[j].position.Y, Main.cloud[j].width, Main.cloud[j].height); if (rectangle.Intersects(value)) { Main.cloud[num].active = false; } } } } }
public static void addCloud() { if (Main.netMode == 2) { return; } int num = -1; for (int i = 0; i < 200; i++) { if (!Main.cloud[i].active) { num = i; break; } } if (num >= 0) { Main.cloud[num].kill = false; Main.cloud[num].rSpeed = 0f; Main.cloud[num].sSpeed = 0f; Main.cloud[num].scale = (float)Cloud.rand.Next(70, 131) * 0.01f; Main.cloud[num].rotation = (float)Cloud.rand.Next(-10, 11) * 0.01f; Main.cloud[num].width = (int)((float)Main.cloudTexture[Main.cloud[num].type].Width * Main.cloud[num].scale); Main.cloud[num].height = (int)((float)Main.cloudTexture[Main.cloud[num].type].Height * Main.cloud[num].scale); Main.cloud[num].Alpha = 0f; Main.cloud[num].spriteDir = SpriteEffects.None; if (Cloud.rand.Next(2) == 0) { Main.cloud[num].spriteDir = SpriteEffects.FlipHorizontally; } float num2 = Main.windSpeed; if (!Main.gameMenu) { num2 = Main.windSpeed - Main.player[Main.myPlayer].velocity.X * 0.1f; } int num3 = 0; int num4 = 0; if (num2 > 0f) { num3 -= 200; } if (num2 < 0f) { num4 += 200; } int num5 = 300; float x = (float)WorldGen.genRand.Next(num3 - num5, Main.screenWidth + num4 + num5); Main.cloud[num].Alpha = 0f; Main.cloud[num].position.Y = (float)Cloud.rand.Next((int)((float)(-(float)Main.screenHeight) * 0.25f), (int)((float)Main.screenHeight * 0.25f)); Cloud expr_211_cp_0 = Main.cloud[num]; expr_211_cp_0.position.Y = expr_211_cp_0.position.Y - (float)Cloud.rand.Next((int)((float)Main.screenHeight * 0.15f)); Cloud expr_241_cp_0 = Main.cloud[num]; expr_241_cp_0.position.Y = expr_241_cp_0.position.Y - (float)Cloud.rand.Next((int)((float)Main.screenHeight * 0.15f)); Main.cloud[num].type = Cloud.rand.Next(4); if (Main.rand == null) { Main.rand = new Random(); } if ((Main.cloudAlpha > 0f && Cloud.rand.Next(4) != 0) || (Main.cloudBGActive >= 1f && Main.rand.Next(2) == 0)) { Main.cloud[num].type = Cloud.rand.Next(18, 22); if ((double)Main.cloud[num].scale >= 1.15) { Cloud expr_303_cp_0 = Main.cloud[num]; expr_303_cp_0.position.Y = expr_303_cp_0.position.Y - 150f; } if (Main.cloud[num].scale >= 1f) { Cloud expr_336_cp_0 = Main.cloud[num]; expr_336_cp_0.position.Y = expr_336_cp_0.position.Y - 150f; } } else if (((Main.cloudBGActive <= 0f && Main.cloudAlpha == 0f && Main.cloud[num].scale < 1f && Main.cloud[num].position.Y < (float)(-(float)Main.screenHeight) * 0.2f) || Main.cloud[num].position.Y < (float)(-(float)Main.screenHeight) * 0.2f) && (double)Main.numClouds < 50.0) { Main.cloud[num].type = Cloud.rand.Next(9, 14); } else if ((((double)Main.cloud[num].scale < 1.15 && Main.cloud[num].position.Y < (float)(-(float)Main.screenHeight) * 0.3f) || ((double)Main.cloud[num].scale < 0.85 && Main.cloud[num].position.Y < (float)Main.screenHeight * 0.15f)) && ((double)Main.numClouds > 70.0 || Main.cloudBGActive >= 1f)) { Main.cloud[num].type = Cloud.rand.Next(4, 9); } else if (Main.cloud[num].position.Y > (float)(-(float)Main.screenHeight) * 0.15f && Cloud.rand.Next(2) == 0 && (double)Main.numClouds > 20.0) { Main.cloud[num].type = Cloud.rand.Next(14, 18); } if ((double)Main.cloud[num].scale > 1.2) { Cloud expr_50A_cp_0 = Main.cloud[num]; expr_50A_cp_0.position.Y = expr_50A_cp_0.position.Y + 100f; } if ((double)Main.cloud[num].scale > 1.3) { Main.cloud[num].scale = 1.3f; } if ((double)Main.cloud[num].scale < 0.7) { Main.cloud[num].scale = 0.7f; } Main.cloud[num].active = true; Main.cloud[num].position.X = x; if (Main.cloud[num].position.X > (float)(Main.screenWidth + 100)) { Main.cloud[num].Alpha = 1f; } if (Main.cloud[num].position.X + (float)Main.cloudTexture[Main.cloud[num].type].Width * Main.cloud[num].scale < -100f) { Main.cloud[num].Alpha = 1f; } Rectangle rectangle = new Rectangle((int)Main.cloud[num].position.X, (int)Main.cloud[num].position.Y, Main.cloud[num].width, Main.cloud[num].height); for (int j = 0; j < 200; j++) { if (num != j && Main.cloud[j].active) { Rectangle value = new Rectangle((int)Main.cloud[j].position.X, (int)Main.cloud[j].position.Y, Main.cloud[j].width, Main.cloud[j].height); if (rectangle.Intersects(value)) { Main.cloud[num].active = false; } } } } }
public static void addCloud() { if (Main.netMode == 2) { return; } int index1 = -1; for (int index2 = 0; index2 < 200; ++index2) { if (!Main.cloud[index2].active) { index1 = index2; break; } } if (index1 < 0) { return; } Main.cloud[index1].kill = false; Main.cloud[index1].rSpeed = 0.0f; Main.cloud[index1].sSpeed = 0.0f; Main.cloud[index1].scale = (float)Cloud.rand.Next(70, 131) * 0.01f; Main.cloud[index1].rotation = (float)Cloud.rand.Next(-10, 11) * 0.01f; Main.cloud[index1].width = (int)((double)TextureAssets.Cloud[Main.cloud[index1].type].Width() * (double)Main.cloud[index1].scale); Main.cloud[index1].height = (int)((double)TextureAssets.Cloud[Main.cloud[index1].type].Height() * (double)Main.cloud[index1].scale); Main.cloud[index1].Alpha = 0.0f; Main.cloud[index1].spriteDir = SpriteEffects.None; if (Cloud.rand.Next(2) == 0) { Main.cloud[index1].spriteDir = SpriteEffects.FlipHorizontally; } float num1 = Main.windSpeedCurrent; if (!Main.gameMenu) { num1 = Main.windSpeedCurrent - Main.player[Main.myPlayer].velocity.X * 0.1f; } int num2 = 0; int num3 = 0; if ((double)num1 > 0.0) { num2 -= 200; } if ((double)num1 < 0.0) { num3 += 200; } int num4 = 300; float num5 = (float)WorldGen.genRand.Next(num2 - num4, Main.screenWidth + num3 + num4); Main.cloud[index1].Alpha = 0.0f; Main.cloud[index1].position.Y = (float)Cloud.rand.Next((int)((double)-Main.screenHeight * 0.25), (int)((double)Main.screenHeight * 0.150000005960464)); if (Main.rand.Next(3) == 0) { Main.cloud[index1].position.Y -= (float)Cloud.rand.Next((int)((double)Main.screenHeight * 0.100000001490116)); } Main.cloud[index1].type = Cloud.rand.Next(4); if ((double)Main.cloudAlpha > 0.0 && Cloud.rand.Next(4) != 0 || (double)Main.cloudBGActive >= 1.0 && Cloud.rand.Next(2) == 0) { Main.cloud[index1].type = Cloud.rand.Next(18, 22); if ((double)Main.cloud[index1].scale >= 1.15) { Main.cloud[index1].position.Y -= 150f; } if ((double)Main.cloud[index1].scale >= 1.0) { Main.cloud[index1].position.Y -= 150f; } } else if ((double)Main.cloudBGActive <= 0.0 && (double)Main.cloudAlpha == 0.0 && ((double)Main.cloud[index1].scale < 1.0 && (double)Main.cloud[index1].position.Y < (double)-Main.screenHeight * 0.150000005960464) && (double)Main.numClouds <= 80.0) { Main.cloud[index1].type = Cloud.rand.Next(9, 14); } else if (((double)Main.cloud[index1].scale < 1.15 && (double)Main.cloud[index1].position.Y < (double)-Main.screenHeight * 0.300000011920929 || (double)Main.cloud[index1].scale < 0.85 && (double)Main.cloud[index1].position.Y < (double)Main.screenHeight * 0.150000005960464) && ((double)Main.numClouds > 70.0 || (double)Main.cloudBGActive >= 1.0)) { Main.cloud[index1].type = Cloud.rand.Next(4, 9); } else if ((double)Main.cloud[index1].position.Y > (double)-Main.screenHeight * 0.150000005960464 && Cloud.rand.Next(2) == 0 && (double)Main.numClouds > 20.0) { Main.cloud[index1].type = Cloud.rand.Next(14, 18); } if (Cloud.rand.Next(150) == 0) { Main.cloud[index1].type = Cloud.RollRareCloud(); } if ((double)Main.cloud[index1].scale > 1.2) { Main.cloud[index1].position.Y += 100f; } if ((double)Main.cloud[index1].scale > 1.3) { Main.cloud[index1].scale = 1.3f; } if ((double)Main.cloud[index1].scale < 0.7) { Main.cloud[index1].scale = 0.7f; } Main.cloud[index1].active = true; Main.cloud[index1].position.X = num5; if ((double)Main.cloud[index1].position.X > (double)(Main.screenWidth + 400)) { Main.cloud[index1].Alpha = 1f; } if ((double)Main.cloud[index1].position.X + (double)TextureAssets.Cloud[Main.cloud[index1].type].Width() * (double)Main.cloud[index1].scale < -400.0) { Main.cloud[index1].Alpha = 1f; } Rectangle rectangle1 = new Rectangle((int)Main.cloud[index1].position.X, (int)Main.cloud[index1].position.Y, Main.cloud[index1].width, Main.cloud[index1].height); for (int index2 = 0; index2 < 200; ++index2) { if (index1 != index2 && Main.cloud[index2].active) { Rectangle rectangle2 = new Rectangle((int)Main.cloud[index2].position.X, (int)Main.cloud[index2].position.Y, Main.cloud[index2].width, Main.cloud[index2].height); if (rectangle1.Intersects(rectangle2)) { Main.cloud[index1].active = false; } } } }
public static void ClientLoop(object threadContext) { Netplay.ResetNetDiag(); Main.ServerSideCharacter = false; if (Main.rand == null) { Main.rand = new Random((int)DateTime.Now.Ticks); } if (WorldGen.genRand == null) { WorldGen.genRand = new Random((int)DateTime.Now.Ticks); } Main.player[Main.myPlayer].hostile = false; Main.clientPlayer = (Player)Main.player[Main.myPlayer].clientClone(); for (int i = 0; i < 255; i++) { if (i != Main.myPlayer) { Main.player[i] = new Player(); } } Main.menuMode = 10; Main.menuMode = 14; if (!Main.autoPass) { Main.statusText = "Connecting to " + Netplay.serverIP; } Main.netMode = 1; Netplay.disconnect = false; Netplay.clientSock = new ClientSock(); Netplay.clientSock.tcpClient.NoDelay = true; Netplay.clientSock.readBuffer = new byte[1024]; Netplay.clientSock.writeBuffer = new byte[1024]; bool flag = true; while (flag) { flag = false; try { Netplay.clientSock.tcpClient.Connect(Netplay.serverIP, Netplay.serverPort); Netplay.clientSock.networkStream = Netplay.clientSock.tcpClient.GetStream(); flag = false; } catch { if (!Netplay.disconnect && Main.gameMenu) { flag = true; } } } NetMessage.buffer[256].Reset(); int num = -1; while (!Netplay.disconnect) { if (Netplay.clientSock.tcpClient.Connected) { if (NetMessage.buffer[256].checkBytes) { NetMessage.CheckBytes(256); } Netplay.clientSock.active = true; if (Netplay.clientSock.state == 0) { Main.statusText = "Found server"; Netplay.clientSock.state = 1; NetMessage.SendData(1, -1, -1, "", 0, 0f, 0f, 0f, 0); } if (Netplay.clientSock.state == 2 && num != Netplay.clientSock.state) { Main.statusText = "Sending player data..."; } if (Netplay.clientSock.state == 3 && num != Netplay.clientSock.state) { Main.statusText = "Requesting world information"; } if (Netplay.clientSock.state == 4) { WorldGen.worldCleared = false; Netplay.clientSock.state = 5; if (Main.cloudBGActive >= 1f) { Main.cloudBGAlpha = 1f; } else { Main.cloudBGAlpha = 0f; } Main.windSpeed = Main.windSpeedSet; Cloud.resetClouds(); Main.cloudAlpha = Main.maxRaining; WorldGen.clearWorld(); if (Main.mapEnabled) { Map.loadMap(); } } if (Netplay.clientSock.state == 5 && Main.loadMapLock) { float num2 = (float)Main.loadMapLastX / (float)Main.maxTilesX; Main.statusText = string.Concat(new object[] { Lang.gen[68], " ", (int)(num2 * 100f + 1f), "%" }); } else { if (Netplay.clientSock.state == 5 && WorldGen.worldCleared) { Netplay.clientSock.state = 6; Main.player[Main.myPlayer].FindSpawn(); NetMessage.SendData(8, -1, -1, "", Main.player[Main.myPlayer].SpawnX, (float)Main.player[Main.myPlayer].SpawnY, 0f, 0f, 0); } } if (Netplay.clientSock.state == 6 && num != Netplay.clientSock.state) { Main.statusText = "Requesting tile data"; } if (!Netplay.clientSock.locked && !Netplay.disconnect && Netplay.clientSock.networkStream.DataAvailable) { Netplay.clientSock.locked = true; Netplay.clientSock.networkStream.BeginRead(Netplay.clientSock.readBuffer, 0, Netplay.clientSock.readBuffer.Length, new AsyncCallback(Netplay.clientSock.ClientReadCallBack), Netplay.clientSock.networkStream); } if (Netplay.clientSock.statusMax > 0 && Netplay.clientSock.statusText != "") { if (Netplay.clientSock.statusCount >= Netplay.clientSock.statusMax) { Main.statusText = Netplay.clientSock.statusText + ": Complete!"; Netplay.clientSock.statusText = ""; Netplay.clientSock.statusMax = 0; Netplay.clientSock.statusCount = 0; } else { Main.statusText = string.Concat(new object[] { Netplay.clientSock.statusText, ": ", (int)((float)Netplay.clientSock.statusCount / (float)Netplay.clientSock.statusMax * 100f), "%" }); } } Thread.Sleep(1); } else { if (Netplay.clientSock.active) { Main.statusText = "Lost connection"; Netplay.disconnect = true; } } num = Netplay.clientSock.state; } try { Netplay.clientSock.networkStream.Close(); if (Netplay.clientSock.tcpClient.Connected) { Netplay.clientSock.networkStream = Netplay.clientSock.tcpClient.GetStream(); } } catch { } if (!Main.gameMenu) { Main.netMode = 0; Player.SavePlayer(Main.player[Main.myPlayer], Main.playerPathName, false, false); Main.gameMenu = true; Main.menuMode = 14; } NetMessage.buffer[256].Reset(); if (Main.menuMode == 15 && Main.statusText == "Lost connection") { Main.menuMode = 14; } if (Netplay.clientSock.statusText != "" && Netplay.clientSock.statusText != null) { Main.statusText = "Lost connection"; } Netplay.clientSock.statusCount = 0; Netplay.clientSock.statusMax = 0; Netplay.clientSock.statusText = ""; Main.netMode = 0; }
private static void InnerClientLoop() { NetMessage.buffer[256].Reset(); int num = -1; while (!Netplay.disconnect) { if (Netplay.Connection.Socket.IsConnected()) { if (NetMessage.buffer[256].checkBytes) { NetMessage.CheckBytes(256); } Netplay.Connection.IsActive = true; if (Netplay.Connection.State == 0) { Main.statusText = "Found server"; Netplay.Connection.State = 1; NetMessage.SendData(1, -1, -1, "", 0, 0f, 0f, 0f, 0, 0, 0); } if (Netplay.Connection.State == 2 && num != Netplay.Connection.State) { Main.statusText = "Sending player data..."; } if (Netplay.Connection.State == 3 && num != Netplay.Connection.State) { Main.statusText = "Requesting world information"; } if (Netplay.Connection.State == 4) { WorldGen.worldCleared = false; Netplay.Connection.State = 5; if (Main.cloudBGActive >= 1f) { Main.cloudBGAlpha = 1f; } else { Main.cloudBGAlpha = 0f; } Main.windSpeed = Main.windSpeedSet; Cloud.resetClouds(); Main.cloudAlpha = Main.maxRaining; WorldGen.clearWorld(); if (Main.mapEnabled) { Main.Map.Load(); } } if (Netplay.Connection.State == 5 && Main.loadMapLock) { float num2 = (float)Main.loadMapLastX / (float)Main.maxTilesX; Main.statusText = string.Concat(new object[] { Lang.gen[68], " ", (int)(num2 * 100f + 1f), "%" }); } else if (Netplay.Connection.State == 5 && WorldGen.worldCleared) { Netplay.Connection.State = 6; Main.player[Main.myPlayer].FindSpawn(); NetMessage.SendData(8, -1, -1, "", Main.player[Main.myPlayer].SpawnX, (float)Main.player[Main.myPlayer].SpawnY, 0f, 0f, 0, 0, 0); } if (Netplay.Connection.State == 6 && num != Netplay.Connection.State) { Main.statusText = "Requesting tile data"; } if (!Netplay.Connection.IsReading && !Netplay.disconnect && Netplay.Connection.Socket.IsDataAvailable()) { Netplay.Connection.IsReading = true; Netplay.Connection.Socket.AsyncReceive(Netplay.Connection.ReadBuffer, 0, Netplay.Connection.ReadBuffer.Length, new SocketReceiveCallback(Netplay.Connection.ClientReadCallBack), null); } if (Netplay.Connection.StatusMax > 0 && Netplay.Connection.StatusText != "") { if (Netplay.Connection.StatusCount >= Netplay.Connection.StatusMax) { Main.statusText = Netplay.Connection.StatusText + ": Complete!"; Netplay.Connection.StatusText = ""; Netplay.Connection.StatusMax = 0; Netplay.Connection.StatusCount = 0; } else { Main.statusText = string.Concat(new object[] { Netplay.Connection.StatusText, ": ", (int)((float)Netplay.Connection.StatusCount / (float)Netplay.Connection.StatusMax * 100f), "%" }); } } Thread.Sleep(1); } else if (Netplay.Connection.IsActive) { Main.statusText = "Lost connection"; Netplay.disconnect = true; } num = Netplay.Connection.State; } try { Netplay.Connection.Socket.Close(); } catch (Exception ex) { #if DEBUG Console.WriteLine(ex); System.Diagnostics.Debugger.Break(); System.Diagnostics.Debugger.Break(); #endif } if (!Main.gameMenu) { Main.SwitchNetMode(0); Player.SavePlayer(Main.ActivePlayerFileData, false); Main.ActivePlayerFileData.StopPlayTimer(); Main.gameMenu = true; Main.menuMode = 14; } NetMessage.buffer[256].Reset(); if (Main.menuMode == 15 && Main.statusText == "Lost connection") { Main.menuMode = 14; } if (Netplay.Connection.StatusText != "" && Netplay.Connection.StatusText != null) { Main.statusText = "Lost connection"; } Netplay.Connection.StatusCount = 0; Netplay.Connection.StatusMax = 0; Netplay.Connection.StatusText = ""; Main.SwitchNetMode(0); if (Netplay.OnDisconnect != null) { Netplay.OnDisconnect(); } }
protected override void Initialize() { if (rand == null) { rand = new Random((int) DateTime.Now.Ticks); } if (WorldGen.genRand == null) { WorldGen.genRand = new Random((int) DateTime.Now.Ticks); } switch (rand.Next(5)) { case 0: base.Window.Title = "Terraria: Dig Peon, Dig!"; break; case 1: base.Window.Title = "Terraria: Epic Dirt"; break; case 2: base.Window.Title = "Terraria: Hey Guys!"; break; case 3: base.Window.Title = "Terraria: Sand is Overpowered"; goto Label_00AD; } base.Window.Title = "Terraria: Shut Up and Dig Gaiden!"; Label_00AD: tileShine[0x16] = 0x47e; tileShine[6] = 0x47e; tileShine[7] = 0x44c; tileShine[8] = 0x3e8; tileShine[9] = 0x41a; tileShine[12] = 0x3e8; tileShine[0x15] = 0x3e8; tileShine[0x3f] = 900; tileShine[0x40] = 900; tileShine[0x41] = 900; tileShine[0x42] = 900; tileShine[0x43] = 900; tileShine[0x44] = 900; tileShine[0x2d] = 0x76c; tileShine[0x2e] = 0x7d0; tileShine[0x2f] = 0x834; tileCut[3] = true; tileCut[0x18] = true; tileCut[0x1c] = true; tileCut[0x20] = true; tileCut[0x33] = true; tileCut[0x34] = true; tileCut[0x3d] = true; tileCut[0x3e] = true; tileCut[0x45] = true; tileCut[0x47] = true; tileCut[0x49] = true; tileCut[0x4a] = true; tileCut[0x52] = true; tileCut[0x53] = true; tileCut[0x54] = true; tileAlch[0x52] = true; tileAlch[0x53] = true; tileAlch[0x54] = true; tileFrameImportant[0x52] = true; tileFrameImportant[0x53] = true; tileFrameImportant[0x54] = true; tileFrameImportant[0x55] = true; tileSolid[0] = true; tileBlockLight[0] = true; tileSolid[1] = true; tileBlockLight[1] = true; tileSolid[2] = true; tileBlockLight[2] = true; tileSolid[3] = false; tileNoAttach[3] = true; tileNoFail[3] = true; tileSolid[4] = false; tileNoAttach[4] = true; tileNoFail[4] = true; tileNoFail[0x18] = true; tileSolid[5] = false; tileSolid[6] = true; tileBlockLight[6] = true; tileSolid[7] = true; tileBlockLight[7] = true; tileSolid[8] = true; tileBlockLight[8] = true; tileSolid[9] = true; tileBlockLight[9] = true; tileBlockLight[10] = true; tileSolid[10] = true; tileNoAttach[10] = true; tileBlockLight[10] = true; tileSolid[11] = false; tileSolidTop[0x13] = true; tileSolid[0x13] = true; tileSolid[0x16] = true; tileSolid[0x17] = true; tileSolid[0x19] = true; tileSolid[30] = true; tileNoFail[0x20] = true; tileBlockLight[0x20] = true; tileSolid[0x25] = true; tileBlockLight[0x25] = true; tileSolid[0x26] = true; tileBlockLight[0x26] = true; tileSolid[0x27] = true; tileBlockLight[0x27] = true; tileSolid[40] = true; tileBlockLight[40] = true; tileSolid[0x29] = true; tileBlockLight[0x29] = true; tileSolid[0x2b] = true; tileBlockLight[0x2b] = true; tileSolid[0x2c] = true; tileBlockLight[0x2c] = true; tileSolid[0x2d] = true; tileBlockLight[0x2d] = true; tileSolid[0x2e] = true; tileBlockLight[0x2e] = true; tileSolid[0x2f] = true; tileBlockLight[0x2f] = true; tileSolid[0x30] = true; tileBlockLight[0x30] = true; tileSolid[0x35] = true; tileBlockLight[0x35] = true; tileSolid[0x36] = true; tileBlockLight[0x34] = true; tileSolid[0x38] = true; tileBlockLight[0x38] = true; tileSolid[0x39] = true; tileBlockLight[0x39] = true; tileSolid[0x3a] = true; tileBlockLight[0x3a] = true; tileSolid[0x3b] = true; tileBlockLight[0x3b] = true; tileSolid[60] = true; tileBlockLight[60] = true; tileSolid[0x3f] = true; tileBlockLight[0x3f] = true; tileStone[0x3f] = true; tileSolid[0x40] = true; tileBlockLight[0x40] = true; tileStone[0x40] = true; tileSolid[0x41] = true; tileBlockLight[0x41] = true; tileStone[0x41] = true; tileSolid[0x42] = true; tileBlockLight[0x42] = true; tileStone[0x42] = true; tileSolid[0x43] = true; tileBlockLight[0x43] = true; tileStone[0x43] = true; tileSolid[0x44] = true; tileBlockLight[0x44] = true; tileStone[0x44] = true; tileSolid[0x4b] = true; tileBlockLight[0x4b] = true; tileSolid[0x4c] = true; tileBlockLight[0x4c] = true; tileSolid[70] = true; tileBlockLight[70] = true; tileBlockLight[0x33] = true; tileNoFail[50] = true; tileNoAttach[50] = true; tileDungeon[0x29] = true; tileDungeon[0x2b] = true; tileDungeon[0x2c] = true; tileBlockLight[30] = true; tileBlockLight[0x19] = true; tileBlockLight[0x17] = true; tileBlockLight[0x16] = true; tileBlockLight[0x3e] = true; tileSolidTop[0x12] = true; tileSolidTop[14] = true; tileSolidTop[0x10] = true; tileNoAttach[20] = true; tileNoAttach[0x13] = true; tileNoAttach[13] = true; tileNoAttach[14] = true; tileNoAttach[15] = true; tileNoAttach[0x10] = true; tileNoAttach[0x11] = true; tileNoAttach[0x12] = true; tileNoAttach[0x13] = true; tileNoAttach[0x15] = true; tileNoAttach[0x1b] = true; tileFrameImportant[3] = true; tileFrameImportant[5] = true; tileFrameImportant[10] = true; tileFrameImportant[11] = true; tileFrameImportant[12] = true; tileFrameImportant[13] = true; tileFrameImportant[14] = true; tileFrameImportant[15] = true; tileFrameImportant[0x10] = true; tileFrameImportant[0x11] = true; tileFrameImportant[0x12] = true; tileFrameImportant[20] = true; tileFrameImportant[0x15] = true; tileFrameImportant[0x18] = true; tileFrameImportant[0x1a] = true; tileFrameImportant[0x1b] = true; tileFrameImportant[0x1c] = true; tileFrameImportant[0x1d] = true; tileFrameImportant[0x1f] = true; tileFrameImportant[0x21] = true; tileFrameImportant[0x22] = true; tileFrameImportant[0x23] = true; tileFrameImportant[0x24] = true; tileFrameImportant[0x2a] = true; tileFrameImportant[50] = true; tileFrameImportant[0x37] = true; tileFrameImportant[0x3d] = true; tileFrameImportant[0x47] = true; tileFrameImportant[0x48] = true; tileFrameImportant[0x49] = true; tileFrameImportant[0x4a] = true; tileFrameImportant[0x4d] = true; tileFrameImportant[0x4e] = true; tileFrameImportant[0x4f] = true; tileFrameImportant[0x51] = true; tileTable[14] = true; tileTable[0x12] = true; tileTable[0x13] = true; tileWaterDeath[4] = true; tileWaterDeath[0x33] = true; tileLavaDeath[3] = true; tileLavaDeath[5] = true; tileLavaDeath[10] = true; tileLavaDeath[11] = true; tileLavaDeath[12] = true; tileLavaDeath[13] = true; tileLavaDeath[14] = true; tileLavaDeath[15] = true; tileLavaDeath[0x10] = true; tileLavaDeath[0x11] = true; tileLavaDeath[0x12] = true; tileLavaDeath[0x13] = true; tileLavaDeath[20] = true; tileLavaDeath[0x1b] = true; tileLavaDeath[0x1c] = true; tileLavaDeath[0x1d] = true; tileLavaDeath[0x20] = true; tileLavaDeath[0x21] = true; tileLavaDeath[0x22] = true; tileLavaDeath[0x23] = true; tileLavaDeath[0x24] = true; tileLavaDeath[0x2a] = true; tileLavaDeath[0x31] = true; tileLavaDeath[50] = true; tileLavaDeath[0x34] = true; tileLavaDeath[0x37] = true; tileLavaDeath[0x3d] = true; tileLavaDeath[0x3e] = true; tileLavaDeath[0x45] = true; tileLavaDeath[0x47] = true; tileLavaDeath[0x48] = true; tileLavaDeath[0x49] = true; tileLavaDeath[0x4a] = true; tileLavaDeath[0x4f] = true; tileLavaDeath[80] = true; tileLavaDeath[0x51] = true; wallHouse[1] = true; wallHouse[4] = true; wallHouse[5] = true; wallHouse[6] = true; wallHouse[10] = true; wallHouse[11] = true; wallHouse[12] = true; tileNoFail[0x3d] = true; tileNoFail[0x49] = true; tileNoFail[0x4a] = true; tileNoFail[0x52] = true; tileNoFail[0x53] = true; tileNoFail[0x54] = true; for (int i = 0; i < 0x56; i++) { tileName[i] = ""; } tileName[13] = "Bottle"; tileName[14] = "Table"; tileName[15] = "Chair"; tileName[0x10] = "Anvil"; tileName[0x11] = "Furnace"; tileName[0x12] = "Workbench"; tileName[0x1a] = "Demon Altar"; tileName[0x4d] = "Hellforge"; tileName[254] = "Portal"; //Mod for (int j = 0; j < maxMenuItems; j++) { this.menuItemScale[j] = 0.8f; } for (int k = 0; k < 0x3e8; k++) { dust[k] = new Dust(); } for (int m = 0; m < 0xc9; m++) { Main.item[m] = new Item(); } for (int n = 0; n < 0x3e9; n++) { npc[n] = new NPC(); npc[n].whoAmI = n; } for (int num7 = 0; num7 < 0x100; num7++) { player[num7] = new Player(); } for (int num8 = 0; num8 < 0x3e9; num8++) { projectile[num8] = new Projectile(); } for (int num9 = 0; num9 < 0xc9; num9++) { gore[num9] = new Gore(); } for (int num10 = 0; num10 < 100; num10++) { cloud[num10] = new Cloud(); } for (int num11 = 0; num11 < 100; num11++) { combatText[num11] = new CombatText(); } for (int num12 = 0; num12 < 100; num12++) { itemText[num12] = new ItemText(); } for (int num13 = 0; num13 < 0x1000; num13++) //Mod: added more items { if (num13 < 0x147 || (num13 >= minAddedItems && num13 <= maxAddedItems)) //Mod { Item item = new Item(); item.SetDefaults(num13, false); itemName[num13] = item.name; } } for (int num14 = 0; num14 < Recipe.maxRecipes; num14++) { recipe[num14] = new Recipe(); availableRecipeY[num14] = 0x41 * num14; } Recipe.SetupRecipes(); for (int num15 = 0; num15 < numChatLines; num15++) { chatLine[num15] = new ChatLine(); } for (int num16 = 0; num16 < Liquid.resLiquid; num16++) { liquid[num16] = new Liquid(); } for (int num17 = 0; num17 < 0x2710; num17++) { liquidBuffer[num17] = new LiquidBuffer(); } this.shop[0] = new Chest(); this.shop[1] = new Chest(); this.shop[1].SetupShop(1); this.shop[2] = new Chest(); this.shop[2].SetupShop(2); this.shop[3] = new Chest(); this.shop[3].SetupShop(3); this.shop[4] = new Chest(); this.shop[4].SetupShop(4); this.shop[5] = new Chest(); this.shop[5].SetupShop(5); teamColor[0] = Color.White; teamColor[1] = new Color(230, 40, 20); teamColor[2] = new Color(20, 200, 30); teamColor[3] = new Color(0x4b, 90, 0xff); teamColor[4] = new Color(200, 180, 0); if (menuMode == 1) { LoadPlayers(); } Netplay.Init(); if (skipMenu) { WorldGen.clearWorld(); gameMenu = false; LoadPlayers(); player[myPlayer] = (Player) loadPlayer[0].Clone(); PlayerPath = loadPlayerPath[0]; LoadWorlds(); WorldGen.generateWorld(-1); WorldGen.EveryTileFrame(); player[myPlayer].Spawn(); } else { IntPtr systemMenu = GetSystemMenu(base.Window.Handle, false); int menuItemCount = GetMenuItemCount(systemMenu); RemoveMenu(systemMenu, menuItemCount - 1, 0x400); } if (!dedServ) { this.graphics.PreferredBackBufferWidth = screenWidth; this.graphics.PreferredBackBufferHeight = screenHeight; this.graphics.ApplyChanges(); base.Initialize(); base.Window.AllowUserResizing = true; this.OpenSettings(); Star.SpawnStars(); foreach (DisplayMode mode in GraphicsAdapter.DefaultAdapter.SupportedDisplayModes) { if (((mode.Width < minScreenW) || (mode.Height < minScreenH)) || ((mode.Width > maxScreenW) || (mode.Height > maxScreenH))) { continue; } bool flag = true; for (int num19 = 0; num19 < this.numDisplayModes; num19++) { if ((mode.Width == this.displayWidth[num19]) && (mode.Height == this.displayHeight[num19])) { flag = false; break; } } if (flag) { this.displayHeight[this.numDisplayModes] = mode.Height; this.displayWidth[this.numDisplayModes] = mode.Width; this.numDisplayModes++; } } if (autoJoin) { LoadPlayers(); menuMode = 1; menuMultiplayer = true; } } }