private void ValueToName() { int num1 = 0; int num2 = 0; int num3 = 0; int num4 = 0; int num5 = this.coinValue; while (num5 > 0) { if (num5 >= 1000000) { num5 -= 1000000; ++num1; } else if (num5 >= 10000) { num5 -= 10000; ++num2; } else if (num5 >= 100) { num5 -= 100; ++num3; } else if (num5 >= 1) { --num5; ++num4; } } this.name = ""; if (num1 > 0) { ItemText itemText = this; string str = itemText.name + (object)num1 + " Platinum "; itemText.name = str; } if (num2 > 0) { ItemText itemText = this; string str = itemText.name + (object)num2 + " Gold "; itemText.name = str; } if (num3 > 0) { ItemText itemText = this; string str = itemText.name + (object)num3 + " Silver "; itemText.name = str; } if (num4 > 0) { ItemText itemText = this; string str = itemText.name + (object)num4 + " Copper "; itemText.name = str; } if (this.name.Length <= 1) { return; } this.name = this.name.Substring(0, this.name.Length - 1); }
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 } }
// Token: 0x06000170 RID: 368 RVA: 0x0002BA7C File Offset: 0x00029C7C public static void NewText(Item newItem, int stack, bool noStack = false, bool longText = false) { bool flag = newItem.type >= 71 && newItem.type <= 74; if (!Main.showItemText) { return; } if (newItem.Name == null || !newItem.active) { return; } if (Main.netMode == 2) { return; } for (int i = 0; i < 20; i++) { if (Main.itemText[i].active && (Main.itemText[i].name == newItem.AffixName() || (flag && Main.itemText[i].coinText)) && !Main.itemText[i].NoStack && !noStack) { string text = string.Concat(new object[] { newItem.Name, " (", Main.itemText[i].stack + stack, ")" }); string text2 = newItem.Name; if (Main.itemText[i].stack > 1) { text2 = string.Concat(new object[] { text2, " (", Main.itemText[i].stack, ")" }); } Vector2 vector = Main.fontMouseText.MeasureString(text2); vector = Main.fontMouseText.MeasureString(text); if (Main.itemText[i].lifeTime < 0) { Main.itemText[i].scale = 1f; } if (Main.itemText[i].lifeTime < 60) { Main.itemText[i].lifeTime = 60; } if (flag && Main.itemText[i].coinText) { int num = 0; if (newItem.type == 71) { num += newItem.stack; } else if (newItem.type == 72) { num += 100 * newItem.stack; } else if (newItem.type == 73) { num += 10000 * newItem.stack; } else if (newItem.type == 74) { num += 1000000 * newItem.stack; } Main.itemText[i].coinValue += num; text = ItemText.ValueToName(Main.itemText[i].coinValue); vector = Main.fontMouseText.MeasureString(text); Main.itemText[i].name = text; if (Main.itemText[i].coinValue >= 1000000) { if (Main.itemText[i].lifeTime < 300) { Main.itemText[i].lifeTime = 300; } Main.itemText[i].color = new Color(220, 220, 198); } else if (Main.itemText[i].coinValue >= 10000) { if (Main.itemText[i].lifeTime < 240) { Main.itemText[i].lifeTime = 240; } Main.itemText[i].color = new Color(224, 201, 92); } else if (Main.itemText[i].coinValue >= 100) { if (Main.itemText[i].lifeTime < 180) { Main.itemText[i].lifeTime = 180; } Main.itemText[i].color = new Color(181, 192, 193); } else if (Main.itemText[i].coinValue >= 1) { if (Main.itemText[i].lifeTime < 120) { Main.itemText[i].lifeTime = 120; } Main.itemText[i].color = new Color(246, 138, 96); } } Main.itemText[i].stack += stack; Main.itemText[i].scale = 0f; Main.itemText[i].rotation = 0f; Main.itemText[i].position.X = newItem.position.X + (float)newItem.width * 0.5f - vector.X * 0.5f; Main.itemText[i].position.Y = newItem.position.Y + (float)newItem.height * 0.25f - vector.Y * 0.5f; Main.itemText[i].velocity.Y = -7f; if (Main.itemText[i].coinText) { Main.itemText[i].stack = 1; } return; } } int num2 = -1; for (int j = 0; j < 20; j++) { if (!Main.itemText[j].active) { num2 = j; break; } } if (num2 == -1) { double num3 = (double)Main.bottomWorld; for (int k = 0; k < 20; k++) { if (num3 > (double)Main.itemText[k].position.Y) { num2 = k; num3 = (double)Main.itemText[k].position.Y; } } } if (num2 >= 0) { string text3 = newItem.AffixName(); if (stack > 1) { text3 = string.Concat(new object[] { text3, " (", stack, ")" }); } Vector2 vector2 = Main.fontMouseText.MeasureString(text3); Main.itemText[num2].alpha = 1f; Main.itemText[num2].alphaDir = -1; Main.itemText[num2].active = true; Main.itemText[num2].scale = 0f; Main.itemText[num2].NoStack = noStack; Main.itemText[num2].rotation = 0f; Main.itemText[num2].position.X = newItem.position.X + (float)newItem.width * 0.5f - vector2.X * 0.5f; Main.itemText[num2].position.Y = newItem.position.Y + (float)newItem.height * 0.25f - vector2.Y * 0.5f; Main.itemText[num2].color = Color.White; if (newItem.rare == 1) { Main.itemText[num2].color = new Color(150, 150, 255); } else if (newItem.rare == 2) { Main.itemText[num2].color = new Color(150, 255, 150); } else if (newItem.rare == 3) { Main.itemText[num2].color = new Color(255, 200, 150); } else if (newItem.rare == 4) { Main.itemText[num2].color = new Color(255, 150, 150); } else if (newItem.rare == 5) { Main.itemText[num2].color = new Color(255, 150, 255); } else if (newItem.rare == -11) { Main.itemText[num2].color = new Color(255, 175, 0); } else if (newItem.rare == -1) { Main.itemText[num2].color = new Color(130, 130, 130); } else if (newItem.rare == 6) { Main.itemText[num2].color = new Color(210, 160, 255); } else if (newItem.rare == 7) { Main.itemText[num2].color = new Color(150, 255, 10); } else if (newItem.rare == 8) { Main.itemText[num2].color = new Color(255, 255, 10); } else if (newItem.rare == 9) { Main.itemText[num2].color = new Color(5, 200, 255); } else if (newItem.rare == 10) { Main.itemText[num2].color = new Color(255, 40, 100); } else if (newItem.rare >= 11) { Main.itemText[num2].color = new Color(180, 40, 255); } Main.itemText[num2].expert = newItem.expert; Main.itemText[num2].name = newItem.AffixName(); Main.itemText[num2].stack = stack; Main.itemText[num2].velocity.Y = -7f; Main.itemText[num2].lifeTime = 60; if (longText) { Main.itemText[num2].lifeTime *= 5; } Main.itemText[num2].coinValue = 0; Main.itemText[num2].coinText = (newItem.type >= 71 && newItem.type <= 74); if (Main.itemText[num2].coinText) { if (newItem.type == 71) { Main.itemText[num2].coinValue += Main.itemText[num2].stack; } else if (newItem.type == 72) { Main.itemText[num2].coinValue += 100 * Main.itemText[num2].stack; } else if (newItem.type == 73) { Main.itemText[num2].coinValue += 10000 * Main.itemText[num2].stack; } else if (newItem.type == 74) { Main.itemText[num2].coinValue += 1000000 * Main.itemText[num2].stack; } Main.itemText[num2].ValueToName(); Main.itemText[num2].stack = 1; int num4 = num2; if (Main.itemText[num4].coinValue >= 1000000) { if (Main.itemText[num4].lifeTime < 300) { Main.itemText[num4].lifeTime = 300; } Main.itemText[num4].color = new Color(220, 220, 198); return; } if (Main.itemText[num4].coinValue >= 10000) { if (Main.itemText[num4].lifeTime < 240) { Main.itemText[num4].lifeTime = 240; } Main.itemText[num4].color = new Color(224, 201, 92); return; } if (Main.itemText[num4].coinValue >= 100) { if (Main.itemText[num4].lifeTime < 180) { Main.itemText[num4].lifeTime = 180; } Main.itemText[num4].color = new Color(181, 192, 193); return; } if (Main.itemText[num4].coinValue >= 1) { if (Main.itemText[num4].lifeTime < 120) { Main.itemText[num4].lifeTime = 120; } Main.itemText[num4].color = new Color(246, 138, 96); } } return; } }
public static void NewText(Item newItem, int stack, bool noStack = false, bool longText = false) { bool flag = newItem.itemId >= 71 && newItem.itemId <= 74; if (!Main.showItemText || newItem.name == null || (!newItem.active || Main.netMode == 2)) { return; } for (int index = 0; index < 20; ++index) { if (Main.itemText[index].active && (Main.itemText[index].name == newItem.AffixName() || flag && Main.itemText[index].coinText) && (!Main.itemText[index].NoStack && !noStack)) { string text1 = string.Concat(new object[4] { (object)newItem.name, (object)" (", (object)(Main.itemText[index].stack + stack), (object)")" }); string text2 = newItem.name; if (Main.itemText[index].stack > 1) { text2 = string.Concat(new object[4] { (object)text2, (object)" (", (object)Main.itemText[index].stack, (object)")" }); } Main.fontMouseText.MeasureString(text2); Vector2 vector2 = Main.fontMouseText.MeasureString(text1); if (Main.itemText[index].lifeTime < 0) { Main.itemText[index].scale = 1f; } if (Main.itemText[index].lifeTime < 60) { Main.itemText[index].lifeTime = 60; } if (flag && Main.itemText[index].coinText) { int num = 0; if (newItem.itemId == 71) { num += newItem.stack; } else if (newItem.itemId == 72) { num += 100 * newItem.stack; } else if (newItem.itemId == 73) { num += 10000 * newItem.stack; } else if (newItem.itemId == 74) { num += 1000000 * newItem.stack; } Main.itemText[index].coinValue += num; string text3 = ItemText.ValueToName(Main.itemText[index].coinValue); vector2 = Main.fontMouseText.MeasureString(text3); Main.itemText[index].name = text3; if (Main.itemText[index].coinValue >= 1000000) { if (Main.itemText[index].lifeTime < 300) { Main.itemText[index].lifeTime = 300; } Main.itemText[index].color = new Color(220, 220, 198); } else if (Main.itemText[index].coinValue >= 10000) { if (Main.itemText[index].lifeTime < 240) { Main.itemText[index].lifeTime = 240; } Main.itemText[index].color = new Color(224, 201, 92); } else if (Main.itemText[index].coinValue >= 100) { if (Main.itemText[index].lifeTime < 180) { Main.itemText[index].lifeTime = 180; } Main.itemText[index].color = new Color(181, 192, 193); } else if (Main.itemText[index].coinValue >= 1) { if (Main.itemText[index].lifeTime < 120) { Main.itemText[index].lifeTime = 120; } Main.itemText[index].color = new Color(246, 138, 96); } } Main.itemText[index].stack += stack; Main.itemText[index].scale = 0.0f; Main.itemText[index].rotation = 0.0f; Main.itemText[index].position.X = (float)((double)newItem.position.X + (double)newItem.width * 0.5 - (double)vector2.X * 0.5); Main.itemText[index].position.Y = (float)((double)newItem.position.Y + (double)newItem.height * 0.25 - (double)vector2.Y * 0.5); Main.itemText[index].velocity.Y = -7f; if (!Main.itemText[index].coinText) { return; } Main.itemText[index].stack = 1; return; } } int index1 = -1; for (int index2 = 0; index2 < 20; ++index2) { if (!Main.itemText[index2].active) { index1 = index2; break; } } if (index1 == -1) { double num = (double)Main.bottomWorld; for (int index2 = 0; index2 < 20; ++index2) { if (num > (double)Main.itemText[index2].position.Y) { index1 = index2; num = (double)Main.itemText[index2].position.Y; } } } if (index1 < 0) { return; } string text = newItem.AffixName(); if (stack > 1) { text = string.Concat(new object[4] { (object)text, (object)" (", (object)stack, (object)")" }); } Vector2 vector2_1 = Main.fontMouseText.MeasureString(text); Main.itemText[index1].alpha = 1f; Main.itemText[index1].alphaDir = -1; Main.itemText[index1].active = true; Main.itemText[index1].scale = 0.0f; Main.itemText[index1].NoStack = noStack; Main.itemText[index1].rotation = 0.0f; Main.itemText[index1].position.X = (float)((double)newItem.position.X + (double)newItem.width * 0.5 - (double)vector2_1.X * 0.5); Main.itemText[index1].position.Y = (float)((double)newItem.position.Y + (double)newItem.height * 0.25 - (double)vector2_1.Y * 0.5); Main.itemText[index1].color = Color.White; if (newItem.rare == 1) { Main.itemText[index1].color = new Color(150, 150, (int)byte.MaxValue); } else if (newItem.rare == 2) { Main.itemText[index1].color = new Color(150, (int)byte.MaxValue, 150); } else if (newItem.rare == 3) { Main.itemText[index1].color = new Color((int)byte.MaxValue, 200, 150); } else if (newItem.rare == 4) { Main.itemText[index1].color = new Color((int)byte.MaxValue, 150, 150); } else if (newItem.rare == 5) { Main.itemText[index1].color = new Color((int)byte.MaxValue, 150, (int)byte.MaxValue); } else if (newItem.rare == -11) { Main.itemText[index1].color = new Color((int)byte.MaxValue, 175, 0); } else if (newItem.rare == -1) { Main.itemText[index1].color = new Color(130, 130, 130); } else if (newItem.rare == 6) { Main.itemText[index1].color = new Color(210, 160, (int)byte.MaxValue); } else if (newItem.rare == 7) { Main.itemText[index1].color = new Color(150, (int)byte.MaxValue, 10); } else if (newItem.rare == 8) { Main.itemText[index1].color = new Color((int)byte.MaxValue, (int)byte.MaxValue, 10); } else if (newItem.rare == 9) { Main.itemText[index1].color = new Color(5, 200, (int)byte.MaxValue); } else if (newItem.rare == 10) { Main.itemText[index1].color = new Color((int)byte.MaxValue, 40, 100); } else if (newItem.rare >= 11) { Main.itemText[index1].color = new Color(180, 40, (int)byte.MaxValue); } Main.itemText[index1].expert = newItem.expert; Main.itemText[index1].name = newItem.AffixName(); Main.itemText[index1].stack = stack; Main.itemText[index1].velocity.Y = -7f; Main.itemText[index1].lifeTime = 60; if (longText) { Main.itemText[index1].lifeTime *= 5; } Main.itemText[index1].coinValue = 0; Main.itemText[index1].coinText = newItem.itemId >= 71 && newItem.itemId <= 74; if (!Main.itemText[index1].coinText) { return; } if (newItem.itemId == 71) { Main.itemText[index1].coinValue += Main.itemText[index1].stack; } else if (newItem.itemId == 72) { Main.itemText[index1].coinValue += 100 * Main.itemText[index1].stack; } else if (newItem.itemId == 73) { Main.itemText[index1].coinValue += 10000 * Main.itemText[index1].stack; } else if (newItem.itemId == 74) { Main.itemText[index1].coinValue += 1000000 * Main.itemText[index1].stack; } Main.itemText[index1].ValueToName(); Main.itemText[index1].stack = 1; int index3 = index1; if (Main.itemText[index3].coinValue >= 1000000) { if (Main.itemText[index3].lifeTime < 300) { Main.itemText[index3].lifeTime = 300; } Main.itemText[index3].color = new Color(220, 220, 198); } else if (Main.itemText[index3].coinValue >= 10000) { if (Main.itemText[index3].lifeTime < 240) { Main.itemText[index3].lifeTime = 240; } Main.itemText[index3].color = new Color(224, 201, 92); } else if (Main.itemText[index3].coinValue >= 100) { if (Main.itemText[index3].lifeTime < 180) { Main.itemText[index3].lifeTime = 180; } Main.itemText[index3].color = new Color(181, 192, 193); } else { if (Main.itemText[index3].coinValue < 1) { return; } if (Main.itemText[index3].lifeTime < 120) { Main.itemText[index3].lifeTime = 120; } Main.itemText[index3].color = new Color(246, 138, 96); } }
public static void NewText(Item newItem, int stack) { if ((Main.showItemText && ((newItem.name != null) && newItem.active)) && (Main.netMode != 2)) { for (int i = 0; i < 20; i++) { if (Main.itemText[i].active && (Main.itemText[i].name == newItem.name)) { string text = string.Concat(new object[] { newItem.name, " (", Main.itemText[i].stack + stack, ")" }); string name = newItem.name; if (Main.itemText[i].stack > 1) { object obj2 = name; name = string.Concat(new object[] { obj2, " (", Main.itemText[i].stack, ")" }); } Vector2 vector = Main.fontMouseText.MeasureString(name); vector = Main.fontMouseText.MeasureString(text); if (Main.itemText[i].lifeTime < 0) { Main.itemText[i].scale = 1f; } Main.itemText[i].lifeTime = 60; ItemText text1 = Main.itemText[i]; text1.stack += stack; Main.itemText[i].scale = 0f; Main.itemText[i].rotation = 0f; Main.itemText[i].position.X = (newItem.position.X + (newItem.width * 0.5f)) - (vector.X * 0.5f); Main.itemText[i].position.Y = (newItem.position.Y + (newItem.height * 0.25f)) - (vector.Y * 0.5f); Main.itemText[i].velocity.Y = -7f; return; } } int index = -1; for (int j = 0; j < 20; j++) { if (!Main.itemText[j].active) { index = j; break; } } if (index == -1) { double bottomWorld = Main.bottomWorld; for (int k = 0; k < 20; k++) { if (bottomWorld > Main.itemText[k].position.Y) { index = k; bottomWorld = Main.itemText[k].position.Y; } } } if (index >= 0) { string str3 = newItem.AffixName(); if (stack > 1) { object obj3 = str3; str3 = string.Concat(new object[] { obj3, " (", stack, ")" }); } Vector2 vector2 = Main.fontMouseText.MeasureString(str3); Main.itemText[index].alpha = 1f; Main.itemText[index].alphaDir = -1; Main.itemText[index].active = true; Main.itemText[index].scale = 0f; Main.itemText[index].rotation = 0f; Main.itemText[index].position.X = (newItem.position.X + (newItem.width * 0.5f)) - (vector2.X * 0.5f); Main.itemText[index].position.Y = (newItem.position.Y + (newItem.height * 0.25f)) - (vector2.Y * 0.5f); Main.itemText[index].color = Color.White; if (newItem.rare == 1) { Main.itemText[index].color = new Color(150, 150, 0xff); } else if (newItem.rare == 2) { Main.itemText[index].color = new Color(150, 0xff, 150); } else if (newItem.rare == 3) { Main.itemText[index].color = new Color(0xff, 200, 150); } else if (newItem.rare == 4) { Main.itemText[index].color = new Color(0xff, 150, 150); } else if (newItem.rare == 5) { Main.itemText[index].color = new Color(0xff, 150, 0xff); } else if (newItem.rare == -1) { Main.itemText[index].color = new Color(130, 130, 130); } else if (newItem.rare == 6) { Main.itemText[index].color = new Color(210, 160, 0xff); } Main.itemText[index].name = newItem.AffixName(); Main.itemText[index].stack = stack; Main.itemText[index].velocity.Y = -7f; Main.itemText[index].lifeTime = 60; } } }
private void ValueToName() { int num1 = 0; int num2 = 0; int num3 = 0; int num4 = 0; int coinValue = this.coinValue; while (coinValue > 0) { if (coinValue >= 1000000) { coinValue -= 1000000; ++num1; } else if (coinValue >= 10000) { coinValue -= 10000; ++num2; } else if (coinValue >= 100) { coinValue -= 100; ++num3; } else if (coinValue >= 1) { --coinValue; ++num4; } } this.name = ""; if (num1 > 0) { ItemText itemText = this; string str = itemText.name + (object)num1 + string.Format(" {0} ", (object)Language.GetTextValue("Currency.Platinum")); itemText.name = str; } if (num2 > 0) { ItemText itemText = this; string str = itemText.name + (object)num2 + string.Format(" {0} ", (object)Language.GetTextValue("Currency.Gold")); itemText.name = str; } if (num3 > 0) { ItemText itemText = this; string str = itemText.name + (object)num3 + string.Format(" {0} ", (object)Language.GetTextValue("Currency.Silver")); itemText.name = str; } if (num4 > 0) { ItemText itemText = this; string str = itemText.name + (object)num4 + string.Format(" {0} ", (object)Language.GetTextValue("Currency.Copper")); itemText.name = str; } if (this.name.Length <= 1) { return; } this.name = this.name.Substring(0, this.name.Length - 1); }
private void ValueToName() { int num = 0; int num1 = 0; int num2 = 0; int num3 = 0; int num4 = this.coinValue; while (num4 > 0) { if (num4 >= 1000000) { num4 = num4 - 1000000; num++; } else if (num4 >= 10000) { num4 = num4 - 10000; num1++; } else if (num4 < 100) { if (num4 < 1) { continue; } num4--; num3++; } else { num4 = num4 - 100; num2++; } } this.name = ""; if (num > 0) { ItemText itemText = this; itemText.name = string.Concat(itemText.name, num, " Platinum "); } if (num1 > 0) { ItemText itemText1 = this; itemText1.name = string.Concat(itemText1.name, num1, " Gold "); } if (num2 > 0) { ItemText itemText2 = this; itemText2.name = string.Concat(itemText2.name, num2, " Silver "); } if (num3 > 0) { ItemText itemText3 = this; itemText3.name = string.Concat(itemText3.name, num3, " Copper "); } if (this.name.Length > 1) { this.name = this.name.Substring(0, this.name.Length - 1); } }
public void Update(int whoAmI) { if (!this.active) { return; } float targetScale = ItemText.TargetScale; this.alpha += (float)this.alphaDir * 0.01f; if ((double)this.alpha <= 0.7) { this.alpha = 0.7f; this.alphaDir = 1; } if ((double)this.alpha >= 1.0) { this.alpha = 1f; this.alphaDir = -1; } if (this.expert && this.expert) { this.color = new Color((int)(byte)Main.DiscoR, (int)(byte)Main.DiscoG, (int)(byte)Main.DiscoB, (int)Main.mouseTextColor); } bool flag = false; string str1 = this.name; if (this.stack > 1) { str1 = str1 + " (" + (object)this.stack + ")"; } Vector2 vector2_1 = Vector2.op_Multiply(Main.fontMouseText.MeasureString(str1), this.scale); // ISSUE: explicit reference operation // ISSUE: variable of a reference type Vector2& local1 = @vector2_1; // ISSUE: explicit reference operation double num1 = (^ local1).Y * 0.800000011920929; // ISSUE: explicit reference operation (^ local1).Y = (__Null)num1; Rectangle rectangle1; // ISSUE: explicit reference operation ((Rectangle)@rectangle1).\u002Ector((int)(this.position.X - vector2_1.X / 2.0), (int)(this.position.Y - vector2_1.Y / 2.0), (int)vector2_1.X, (int)vector2_1.Y); for (int index = 0; index < 20; ++index) { if (Main.itemText[index].active && index != whoAmI) { string str2 = Main.itemText[index].name; if (Main.itemText[index].stack > 1) { str2 = str2 + " (" + (object)Main.itemText[index].stack + ")"; } Vector2 vector2_2 = Main.fontMouseText.MeasureString(str2); vector2_2 = Vector2.op_Multiply(vector2_2, Main.itemText[index].scale); // ISSUE: explicit reference operation // ISSUE: variable of a reference type Vector2& local2 = @vector2_2; // ISSUE: explicit reference operation double num2 = (^ local2).Y * 0.800000011920929; // ISSUE: explicit reference operation (^ local2).Y = (__Null)num2; Rectangle rectangle2; // ISSUE: explicit reference operation ((Rectangle)@rectangle2).\u002Ector((int)(Main.itemText[index].position.X - vector2_2.X / 2.0), (int)(Main.itemText[index].position.Y - vector2_2.Y / 2.0), (int)vector2_2.X, (int)vector2_2.Y); // ISSUE: explicit reference operation if (((Rectangle)@rectangle1).Intersects(rectangle2) && (this.position.Y < Main.itemText[index].position.Y || this.position.Y == Main.itemText[index].position.Y && whoAmI < index)) { flag = true; int num3 = ItemText.numActive; if (num3 > 3) { num3 = 3; } Main.itemText[index].lifeTime = ItemText.activeTime + 15 * num3; this.lifeTime = ItemText.activeTime + 15 * num3; } } } if (!flag) { // ISSUE: explicit reference operation // ISSUE: variable of a reference type Vector2& local2 = @this.velocity; // ISSUE: explicit reference operation double num2 = (^ local2).Y * 0.860000014305115; // ISSUE: explicit reference operation (^ local2).Y = (__Null)num2; if ((double)this.scale == (double)targetScale) { // ISSUE: explicit reference operation // ISSUE: variable of a reference type Vector2& local3 = @this.velocity; // ISSUE: explicit reference operation double num3 = (^ local3).Y * 0.400000005960464; // ISSUE: explicit reference operation (^ local3).Y = (__Null)num3; } } else if (this.velocity.Y > -6.0) { // ISSUE: explicit reference operation // ISSUE: variable of a reference type Vector2& local2 = @this.velocity; // ISSUE: explicit reference operation double num2 = (^ local2).Y - 0.200000002980232; // ISSUE: explicit reference operation (^ local2).Y = (__Null)num2; } else { // ISSUE: explicit reference operation // ISSUE: variable of a reference type Vector2& local2 = @this.velocity; // ISSUE: explicit reference operation double num2 = (^ local2).Y * 0.860000014305115; // ISSUE: explicit reference operation (^ local2).Y = (__Null)num2; } // ISSUE: explicit reference operation // ISSUE: variable of a reference type Vector2& local4 = @this.velocity; // ISSUE: explicit reference operation double num4 = (^ local4).X * 0.930000007152557; // ISSUE: explicit reference operation (^ local4).X = (__Null)num4; ItemText itemText = this; Vector2 vector2_3 = Vector2.op_Addition(itemText.position, this.velocity); itemText.position = vector2_3; --this.lifeTime; if (this.lifeTime <= 0) { this.scale -= 0.03f * targetScale; if ((double)this.scale < 0.1 * (double)targetScale) { this.active = false; } this.lifeTime = 0; } else { if ((double)this.scale < (double)targetScale) { this.scale += 0.1f * targetScale; } if ((double)this.scale <= (double)targetScale) { return; } this.scale = targetScale; } }
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; } } }