From 143644cb1fd99ea5c4dbb611668cb019db735e9d Mon Sep 17 00:00:00 2001 From: Nekololizu Date: Fri, 12 Jun 2020 00:39:55 +0200 Subject: [PATCH] Added Jungle mimic & fixed pre/hardmode crate --- .vs/NekoTweakMod/DesignTimeBuild/.dtbcache.v2 | Bin 28542 -> 28621 bytes .vs/NekoTweakMod/v16/.suo | Bin 90112 -> 95744 bytes Fishing/AddModdedCrateToForest.cs | 39 +++++-- Fishing/CrateSpriteExamples.png | Bin 0 -> 3652 bytes Fishing/Items/AddItemToCrate.cs | 20 ++-- Fishing/Tiles/ForestCratePlaced.png | Bin 353 -> 3652 bytes Items/ModifyEquipment.cs | 12 +- NPCs/AddLootToNPC.cs | 33 ++++++ NPCs/JungleMimicChestSummon.cs | 106 ++++++++++++++++++ build.txt | 4 +- ...NekoTweakMod.csprojAssemblyReference.cache | Bin 424 -> 424 bytes 11 files changed, 192 insertions(+), 22 deletions(-) create mode 100644 Fishing/CrateSpriteExamples.png create mode 100644 NPCs/AddLootToNPC.cs create mode 100644 NPCs/JungleMimicChestSummon.cs diff --git a/.vs/NekoTweakMod/DesignTimeBuild/.dtbcache.v2 b/.vs/NekoTweakMod/DesignTimeBuild/.dtbcache.v2 index 1d4965b29e61565f8f3223c8e1bb32fe12bff8d0..2089688de62f03731fc42f20d1568131ad36d027 100644 GIT binary patch delta 506 zcmZwAO-jQ+90l+h6%iLM#f2h@J3*Rh(j*(H2vwn?NWiZ`n{*~M+BVvW-wAA1r}w}6-2 csSlpVX3PH^rPbzJ>4lDW)@ZV`PLuWe7X+4kkN^Mx delta 410 zcmX?mpYh*4M#k!ijQ$QONhV3j=H|&3MwW&tDan>bX-0;I7AYx)DF$XqW+^FVrfJ5O zX_hHQiI&Ex1{Ox9=9Z?WW=ZD8$%e)Ti7Cb#C)|%$7WOPj%`J{`Oi2mJ&(A5zEYM3X zW{`&nx@8t;Wagz$UXUPSjv^8Rl?lpEDF&&RL6!B*Pf1BlaV|i+ooxA1_4>=K%6nTFip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v5a}B-~WK l<$UGe(()qQbb=CIOK-erp#AbfYC5uP1-(gJJ-FTE{{hgAyw3mt diff --git a/Fishing/AddModdedCrateToForest.cs b/Fishing/AddModdedCrateToForest.cs index 870ca63..3c5b74b 100644 --- a/Fishing/AddModdedCrateToForest.cs +++ b/Fishing/AddModdedCrateToForest.cs @@ -23,15 +23,19 @@ public class AddModdedCrateToForest : ModPlayer } public override void CatchFish(Item fishingRod, Item bait, int power, int liquidType, int poolSize, int worldLayer, int questFish, ref int caughtType, ref bool junk) { - if (liquidType == 2 && Main.rand.Next(1) == 0) // if hardmode + // if hardmode + if (Main.hardMode && liquidType == 2 && Main.rand.Next(100) == 100) // Liquid types, 0 is water, 1 is lava, 2 is honey - // Main.rand.Next(1) == 0) is the catch % chance to catch the Crate - // n/100 chance or 1 = 100% + // Main.rand.Next(1, 100) == 0) is the catch % chance to catch the Crate & the chance required to get it + // n/100 chance or 1 = 1% + // Main.rand.Next(100), Would generates a number between 0 & 99 instead if there is no specified chance + { caughtType = ItemType(); } { - if (liquidType == 2 && Main.rand.Next(1) == 0) // if prehardmode + // if prehardmode + if (!Main.hardMode && liquidType == 2 && Main.rand.Next(100) == 100) { caughtType = ItemType(); } @@ -39,8 +43,29 @@ public override void CatchFish(Item fishingRod, Item bait, int power, int liquid } } } + +// how to check "if" hardmode examples~ +//Main.hardMode +//NPC.downedSlimeKing + /* + Main.rand explanations + +Main.rand.Next(100) +^this picks a number between 0 and 99 +Main.rand.Next(100) generates a number between 0 and 99 + +Next(5, 10) will get you the values 5, 6, 7, 8, 9 +Just like how Next(5) will only get you 0, 1, 2, 3, 4 and not 5 + Main.rand.Next(1) == 0) -Main.rand.NextBool(97) -^^how do these even work~ -*/ \ No newline at end of file +Main.rand.Next(100) == 0) == 0 is the same as 1/100 or 1% + +Main.rand.NextBool(97, 100) // 97% chance +Next(min, max) will get you a value from min to (max - 1) + +Main.rand.NextBool(100) is the same as Main.rand.Next(100) == 0 +also Next(100) can't return 100 + +Lyker,Teok,iScalieable & absoluteAquarian, trying to explain this to me^ +*/ diff --git a/Fishing/CrateSpriteExamples.png b/Fishing/CrateSpriteExamples.png new file mode 100644 index 0000000000000000000000000000000000000000..436fc0eef6e7b77a59c7d18fe5c6e8f4c7ad5526 GIT binary patch literal 3652 zcmXY!4LpZ5T|09!eTN>6c&XoZC*-syeu!xJPxN8$!n?OH6&`0 zIi0_^v{TYVMu_#IlVPKh*JR%Q&;IBCxjxVH-1qajKhJaB_kG>p-*sK}IO43n7PA%r z0Cg7%`4|Ae$WYr@MH#v`-5J^fJz$Z?oE?CwPV5-eQ3^ibb^ris($$tut%3Tgzfyc7 z0RZ(}alu|*s9-=}61$KOc*O*KD{$xedv9!=7aY*CY!w!pv~=mLg;TdvYSK>Rz%(j0 zhI|2W4qi)+MkLphH8(=8sdC?B7#o+gCjX(60XHTYeIx1VT+@6}9FB7g4?5f<6r2@t zK3#Zv>1pKK_w&tmyS}|QT~Iz-{kVD0;#Sk(Pmw(%(&p1qyAP$@d1sd8c6C01E(zK3 z=BJCux#q(AJm*@vO85cN!~nF$8nY{djPwS*FGu%H{NvI>y{S=K}NhQ{_&qmC>A$`mhv@ zX^u8a&a7qQbnm~$i*s~->$7|lg9ro&X?t-P83wK0pMn^g$g|6ulYHFE)LUuYsWtTB z3*Y7FN0Fu|5(h88SC|m)k!~MvY5Izpy|jOQyvF|N7^>1il9hbEHFjBgS9N*$b}hfj zUDEc&oilgNH(#4J){shNhBhhD8)9D$@|^YMgUPL*`^Ks)upJFQo=cf+#E{Qc0_oHE7ZGc>^QOn3)%IAzuJ^xf> zng?&ul@b`RD%ges8<=|e(DfW7?r zBNhAAACX$mG*(S?MEhWsTJI)rl=?;ne=X`-*1aB-xo<#N%1O2t^~9(m2hJgnyK!es zzx&)6k@8(M5(3{>Xh|jd1-I^T=10?+R=7W8XG!__&(q@&L+nmAVki_vM)pNt_+)c~ zk$w4$W5g;3y}C4R&;M(1vXU1+Z=kb*lK0J|%<)VIxAdN~<6tR&U&|l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(ME3!!hm4-ai=JAdR8aO$ijpuREH1%uJlA^Ko(QJn*JGf2rwpjgDL}Ib35@dF3*Vdqf@CQ*-^xu>K4@Q z=?Vj)j#a?3M3o9OhyWp#DG`0Kvcf5!Az=$66!seE>1_tRSxvu{tI{Q#q$6F literal 0 HcmV?d00001 diff --git a/Fishing/Items/AddItemToCrate.cs b/Fishing/Items/AddItemToCrate.cs index 0feb47f..5dba89e 100644 --- a/Fishing/Items/AddItemToCrate.cs +++ b/Fishing/Items/AddItemToCrate.cs @@ -13,44 +13,44 @@ public override void OpenVanillaBag(string context, Player player, int arg) // Context in this case specifies what type of thing we are opening, has to be one of these: "present", "bossBag", "crate", "lockBox", "herbBag", or "goodieBag" // arg specifies the itemid of the present/bag/crate we are trying to open { - // "number/100" or "1 = 100%" chance/rng & Itemid Specifies the item to give to the player + // "number/100" or 1 = 1% chance & Itemid Specifies the item to give to the player // Each item here will roll individually, so its possible for several of them to drop together with each other // They will also not share any specific present/bag/crate loot pool with any other items // This means they will always get a chance to roll 100% of the time when a present/bag/crate is used - // if (Main.rand.NextBool(33)) player.QuickSpawnItem(ItemID.sandstorm in a bottle); - // if (Main.rand.NextBool(25)) player.QuickSpawnItem(ItemID.Meowmere); - // if (Main.rand.NextBool(50)) player.QuickSpawnItem(ItemID.PlanteraBossBag); - // if (Main.rand.NextBool(75)) player.QuickSpawnItem(ItemID.HotlineFishingHook); + // if (Main.rand.NextBool(33, 100)) player.QuickSpawnItem(ItemID.sandstorm in a bottle); + // if (Main.rand.NextBool(25, 100)) player.QuickSpawnItem(ItemID.Meowmere); + // if (Main.rand.NextBool(50, 100)) player.QuickSpawnItem(ItemID.PlanteraBossBag); + // if (Main.rand.NextBool(75, 100)) player.QuickSpawnItem(ItemID.HotlineFishingHook); } { if (context == "crate" && arg == ItemID.oasiscratehardmode) // hardmode oasis crate { - if (Main.rand.NextBool(33)) player.QuickSpawnItem(ItemID.WoodenSword); + if (Main.rand.NextBool(33, 100)) player.QuickSpawnItem(ItemID.WoodenSword); } } { if (context == "crate" && arg == ItemID.oceancrate) { - if (Main.rand.NextBool(95)) player.QuickSpawnItem(ItemID.WaterWalkingBoots); // 5% chance for each ocean biome crate + if (Main.rand.NextBool(5, 100)) player.QuickSpawnItem(ItemID.WaterWalkingBoots); // 5% chance for each ocean biome crate } } { if (context == "crate" && arg == ItemID.oceancratehardmode) // hard mode version of ocean crate { - if (Main.rand.NextBool(95)) player.QuickSpawnItem(ItemID.WaterWalkingBoots); + if (Main.rand.NextBool(5, 100)) player.QuickSpawnItem(ItemID.WaterWalkingBoots); } } { if (context == "crate" && arg == ItemID.lavacrate) { - if (Main.rand.NextBool(97)) player.QuickSpawnItem(ItemID.LavaCharm); // 3% chance for each lava crate + if (Main.rand.NextBool(3, 100)) player.QuickSpawnItem(ItemID.LavaCharm); // 3% chance for each lava crate } } { if (context == "crate" && arg == ItemID.lavacrate) // hardmode version of lava crate { - if (Main.rand.NextBool(97)) player.QuickSpawnItem(ItemID.LavaCharm); + if (Main.rand.NextBool(3, 100)) player.QuickSpawnItem(ItemID.LavaCharm); } } } diff --git a/Fishing/Tiles/ForestCratePlaced.png b/Fishing/Tiles/ForestCratePlaced.png index 23e3b8df9671676e33bb393664df5ced25c6027f..436fc0eef6e7b77a59c7d18fe5c6e8f4c7ad5526 100644 GIT binary patch literal 3652 zcmXY!4LpZ5T|09!eTN>6c&XoZC*-syeu!xJPxN8$!n?OH6&`0 zIi0_^v{TYVMu_#IlVPKh*JR%Q&;IBCxjxVH-1qajKhJaB_kG>p-*sK}IO43n7PA%r z0Cg7%`4|Ae$WYr@MH#v`-5J^fJz$Z?oE?CwPV5-eQ3^ibb^ris($$tut%3Tgzfyc7 z0RZ(}alu|*s9-=}61$KOc*O*KD{$xedv9!=7aY*CY!w!pv~=mLg;TdvYSK>Rz%(j0 zhI|2W4qi)+MkLphH8(=8sdC?B7#o+gCjX(60XHTYeIx1VT+@6}9FB7g4?5f<6r2@t zK3#Zv>1pKK_w&tmyS}|QT~Iz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ipment.cs @@ -4,14 +4,20 @@ namespace NekoTweakMod.Items { - public class ModifyEquipment : GlobalItem // class name & vanilla hook + public class ModifyEquipment : GlobalItem + // class name & GlobalItem hook(this allows us to change vanilla items) + // The GlobalItem hooks have an "item" parameter + // so we have to check if that "item" type is what we are looking for when trying to specify an itemid + // this is why we have to do for example (item.type == itemid.slimestaff) and not + // only itemid.slimestaff like we would in the ModItem hooks when we try to specify a specific vanilla item { public override void SetDefaults(Item item) // SetDefaults allows you to set/change properties of items { - // if (item.type == ItemID.BabyBirdStaff) // disabled until tmod v1.4 + // disabled until tmod v1.4 + // if (item.type == ItemID.BabyBirdStaff) // Checks the item type & the items itemid // specifies what item to change { - // item.damage = 9; // changes the items damage + // item.damage = 9; // changes the specified items damage //item.knockBack = 0; } if (item.type == ItemID.WormScarf) item.defense = 2; // Single line if statement as we are only changing 1 property diff --git a/NPCs/AddLootToNPC.cs b/NPCs/AddLootToNPC.cs new file mode 100644 index 0000000..26f286d --- /dev/null +++ b/NPCs/AddLootToNPC.cs @@ -0,0 +1,33 @@ +using Terraria.ID; +using Terraria; +using Terraria.ModLoader; + +namespace NekoTweakMod.Items +{ + public class AddLootToNPC : GlobalNPC // class name & global npc hook, allows us to change properties of NPCs/Mobs + { + public override void NPCLoot(NPC npc) // allows you to change what happens when an npc dies, in this case we are adding loot + { + if (npc.type == NPCID.BigMimicJungle)// && NPC.downedGolemBoss) // if the npc type is this specific npc & golem has been defated + { + // "number/100" or 1 = 1% chance & Itemid Specifies the item to give to the player + if (Main.rand.NextBool(33, 100)) // 33% or 33/100 chance to drop + { + Item.NewItem(npc.getRect(), ItemID.SpikyBallTrap, 15); // adds the specified itemid as a new loot/drop for the npc and makes 15 of the item drop at once + } + if (Main.rand.NextBool(33, 100)) + { + Item.NewItem(npc.getRect(), ItemID.FlameTrap, 15); + } + if (Main.rand.NextBool(33, 100)) + { + Item.NewItem(npc.getRect(), ItemID.SpearTrap, 15); + } + if (Main.rand.NextBool(33, 100)) + { + Item.NewItem(npc.getRect(), ItemID.SuperDartTrap, 15); + } + } + } + } +} \ No newline at end of file diff --git a/NPCs/JungleMimicChestSummon.cs b/NPCs/JungleMimicChestSummon.cs new file mode 100644 index 0000000..25ebd33 --- /dev/null +++ b/NPCs/JungleMimicChestSummon.cs @@ -0,0 +1,106 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace NekoTweakMod.NPCs +// need to add few more explanations for stuffs, don't understand everything in here~ +{ + // Code for Spawning/summoning a Jungle Mimic when a Temple Key is placed in a chest + public class JungleMimicChestSummon : ModPlayer + { + public int LastChest; // sets up a integer named "LastChest" + + public override void PreUpdateBuffs() // This is called before buff updates to the player happens + { // chest check + if (Main.netMode != NetmodeID.MultiplayerClient) + { + if (player.chest == -1 && LastChest >= 0 && Main.chest[LastChest] != null) // checks if the last chest used was empty when closed + { + int x2 = Main.chest[LastChest].x; + int y2 = Main.chest[LastChest].y; + ChestItemSummonCheck(x2, y2, mod); + } + LastChest = player.chest; + } + } + + public override void UpdateAutopause() + // Allows the mimic to spawn in single player while autopause is on + { + LastChest = player.chest; + } + // The actuall code for summoning/spawning a npc when an item is left in a chest + public static bool ChestItemSummonCheck(int x, int y, Mod mod) + { + if (Main.netMode == NetmodeID.MultiplayerClient || !Main.hardMode) // if its not hardmode the code will return false and wont spawn the mimic + { + return false; // stops the code if the world is not in the hardmode state + } + int num = Chest.FindChest(x, y); + if (num < 0) // checks the number of keys in the chest + { + return false; // stops the code if there are no temple keys in the chest + } + int numberofKeys = 0; // integer value for checking amount of keys + int numberOtherItems = 0; // integer value for checking if there are any other items in the chest + ushort tileType = Main.tile[Main.chest[num].x, Main.chest[num].y].type; + int tileStyle = (int)(Main.tile[Main.chest[num].x, Main.chest[num].y].frameX / 36); + if (TileID.Sets.BasicChest[tileType] && (tileStyle < 5 || tileStyle > 6)) + { + for (int i = 0; i < 40; i++) + { + if (Main.chest[num].item[i] != null && Main.chest[num].item[i].type > ItemID.None) // if the chest don't have any items in it, there are no temple keys in it + { + if (Main.chest[num].item[i].type == ItemID.TempleKey) // What item that should be used for this npc spawning/summoning + { + numberofKeys += Main.chest[num].item[i].stack; + } + else + { + numberOtherItems++; + } + } + } + } + if (numberOtherItems == 0 && numberofKeys == 1) // If there are no other items the chest & and there is 1 temple key in it + { + + if (TileID.Sets.BasicChest[Main.tile[x, y].type]) // checks if the tile is a chest + { + if (Main.tile[x, y].frameX % 36 != 0) + { + x--; + } + if (Main.tile[x, y].frameY % 36 != 0) + { + y--; + } + int number = Chest.FindChest(x, y); + for (int j = x; j <= x + 1; j++) + { + for (int k = y; k <= y + 1; k++) + { + if (TileID.Sets.BasicChest[Main.tile[j, k].type]) // Checks if the tile exist ???? + { + Main.tile[j, k].active(false); + } + } + } + for (int l = 0; l < 40; l++) + { + Main.chest[num].item[l] = new Item(); + } + Chest.DestroyChest(x, y); // removes the chest tile without dropping a chest item + NetMessage.SendData(MessageID.ChestUpdates, -1, -1, null, 1, (float)x, (float)y, 0f, number, 0, 0); + NetMessage.SendTileSquare(-1, x, y, 3); + } + int npcToSpawn = NPCID.BigMimicJungle; // What npc to spawn, in this case a Jungle Mimic + int npcIndex = NPC.NewNPC(x * 16 + 16, y * 16 + 32, npcToSpawn, 0, 0f, 0f, 0f, 0f, 255); // Determine where the npc will spawn + Main.npc[npcIndex].whoAmI = npcIndex; + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npcIndex, 0f, 0f, 0f, 0, 0, 0); + Main.npc[npcIndex].BigMimicSpawnSmoke(); // Does the mimic smoke summoning animation + } + return false; // stops the code + } + } +} \ No newline at end of file diff --git a/build.txt b/build.txt index 9c1fe34..c822e6a 100644 --- a/build.txt +++ b/build.txt @@ -1,5 +1,5 @@ displayName = Neko's Tweak Mod author = Neko -version = 0.1.2.2 +version = 0.1.2.3 homepage = https://forums.terraria.org/index.php?threads/nekos-tweak-mod.93711/ -buildIgnore = obj\*, bin\*, IconBannerArt\*, *.csproj, .git\*, .gitattributes, .gitignore, .sln, ..vs\*, LICENSE \ No newline at end of file +buildIgnore = obj\*, bin\*, IconBannerArt\*, *.csproj, .git\*, .gitattributes, .gitignore, .sln, ..vs\*, LICENSE, Items.vs\* , .vs\* \ No newline at end of file diff --git a/obj/Debug/net45/NekoTweakMod.csprojAssemblyReference.cache b/obj/Debug/net45/NekoTweakMod.csprojAssemblyReference.cache index c15212c63a2a04202ad75990e0e10c4285b487fd..819450529f349ae6b17f38250299774218448674 100644 GIT binary patch delta 14 VcmZ3%yn=ayKO>V1`{Y2zZ~!271Kr