From b61f9ddf96423bac7800fa3bc2e58eb819d5f7c4 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Tue, 21 Nov 2023 22:03:48 -0600 Subject: [PATCH] Setup monster drop config data and monster drop data structure. --- Crawler/Crawler.cpp | 2 -- Crawler/Monster.h | 11 ++++++++++ Crawler/assets/config/Monsters.txt | 21 +++++++++++++++++++ Crawler/assets/config/items/ItemDatabase.txt | 10 +++++++++ Crawler/assets/items/Green Gemstone.png | Bin 0 -> 878 bytes Crawler/assets/items/Logs.png | Bin 0 -> 859 bytes 6 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 Crawler/assets/items/Green Gemstone.png create mode 100644 Crawler/assets/items/Logs.png diff --git a/Crawler/Crawler.cpp b/Crawler/Crawler.cpp index bbbb9529..1d684dd1 100644 --- a/Crawler/Crawler.cpp +++ b/Crawler/Crawler.cpp @@ -1307,8 +1307,6 @@ void Crawler::LoadLevel(MapName map){ totalBossEncounterMobs=0; Inventory::Clear("Monster Loot"); Inventory::Clear("Stage Loot"); - Inventory::AddItem("Bandages",3); - Inventory::AddItem("Blue Slime Remains",10,true); #pragma region Monster Spawn Data Setup for(auto key:MAP_DATA[map].SpawnerData){ diff --git a/Crawler/Monster.h b/Crawler/Monster.h index fc65faee..e7cf2494 100644 --- a/Crawler/Monster.h +++ b/Crawler/Monster.h @@ -41,6 +41,8 @@ SUCH DAMAGE. #include "DEFINES.h" #include "Attributable.h" +INCLUDE_ITEM_DATA + struct Player; class Crawler; @@ -53,6 +55,15 @@ enum MonsterAnimation{ DEATH }; +struct MonsterDropData{ + ItemInfo*item; + float dropChance; + int minQty=1; + int maxQty=1; + MonsterDropData(std::string itemName,float dropChance,int minQty=1,int maxQty=1) + :item(ITEM_DATA.at(itemName)),dropChance(dropChance),minQty(minQty),maxQty(maxQty){} +}; + struct MonsterData{ private: int id; diff --git a/Crawler/assets/config/Monsters.txt b/Crawler/assets/config/Monsters.txt index fe5de6b1..bac39c9c 100644 --- a/Crawler/assets/config/Monsters.txt +++ b/Crawler/assets/config/Monsters.txt @@ -23,6 +23,10 @@ Monsters ShootAnimation = 10, 0.1, OneShot DeathAnimation = 10, 0.1, OneShot + # Drop Item Name, Drop Percentage(0-100%), Drop Min Quantity, Drop Max Quantity + DROP[0] = Green Slime Remains,65%,1,2 + DROP[1] = Small Health Potion,5%,1,1 + #Additional custom animations go down below. Start with ANIMATION[0]. Order is: # Frame Count, Frame Speed (s), Frame Cycling (Repeat,OneShot,PingPong,Reverse) #ANIMATION[0] = 6, 0.1, Repeat @@ -49,6 +53,10 @@ Monsters ShootAnimation = 10, 0.1, Repeat DeathAnimation = 10, 0.1, OneShot + # Drop Item Name, Drop Percentage(0-100%), Drop Min Quantity, Drop Max Quantity + DROP[0] = Green Slime Remains,65%,1,2 + DROP[1] = Small Health Potion,5%,1,1 + #Additional custom animations go down below. Start with ANIMATION[0] #ANIMATION[0] = MY_NEW_ANIMATION } @@ -74,6 +82,10 @@ Monsters ShootAnimation = 10, 0.1, OneShot DeathAnimation = 10, 0.1, OneShot + # Drop Item Name, Drop Percentage(0-100%), Drop Min Quantity, Drop Max Quantity + DROP[0] = Green Slime Remains,65%,1,2 + DROP[1] = Small Health Potion,5%,1,1 + #Additional custom animations go down below. Start with ANIMATION[0] #ANIMATION[0] = MY_NEW_ANIMATION } @@ -99,6 +111,9 @@ Monsters ShootAnimation = 10, 0.1, OneShot DeathAnimation = 10, 0.1, OneShot + # Drop Item Name, Drop Percentage(0-100%), Drop Min Quantity, Drop Max Quantity + #DROP[0] = Bandages,30%,1,1 + #Additional custom animations go down below. Start with ANIMATION[0] #ANIMATION[0] = MY_NEW_ANIMATION } @@ -124,6 +139,9 @@ Monsters ShootAnimation = 5, 0.1, OneShot DeathAnimation = 5, 0.2, OneShot + # Drop Item Name, Drop Percentage(0-100%), Drop Min Quantity, Drop Max Quantity + DROP[0] = Bandages,30%,1,1 + #Additional custom animations go down below. Start with ANIMATION[0] #ANIMATION[0] = MY_NEW_ANIMATION } @@ -150,6 +168,9 @@ Monsters ShootAnimation = 10, 0.1, OneShot DeathAnimation = 10, 0.1, OneShot + # Drop Item Name, Drop Percentage(0-100%), Drop Min Quantity, Drop Max Quantity + #DROP[0] = Bandages,30%,1,1 + #Additional custom animations go down below. Start with ANIMATION[0] ANIMATION[0] = monsters/Slime King - Cast.png } diff --git a/Crawler/assets/config/items/ItemDatabase.txt b/Crawler/assets/config/items/ItemDatabase.txt index 66786956..a3f551bf 100644 --- a/Crawler/assets/config/items/ItemDatabase.txt +++ b/Crawler/assets/config/items/ItemDatabase.txt @@ -164,4 +164,14 @@ ItemDatabase Description = The remains of a red slime. It stares at you intently. ItemCategory = Materials } + Logs + { + Description = A small unrefined pile of logs. + ItemCategory = Materials + } + Green Gemstone + { + Description = Radiating with energy from the forest, it is used to refine stronger equipment. + ItemCategory = Materials + } } \ No newline at end of file diff --git a/Crawler/assets/items/Green Gemstone.png b/Crawler/assets/items/Green Gemstone.png new file mode 100644 index 0000000000000000000000000000000000000000..15e649ec7a7260ccd44a423f2c61a803612aab13 GIT binary patch literal 878 zcmV-!1CjiRP)EX>4Tx04R}tkv&MmKpe$iQ>CI62aAX}WT-CMMMWG-6^me@v=v%)FuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|>f)s6A|?JWDYS_3;J6>}?mh0_0Yam~RI@7zsG4P@ z;xRFsTNMMZ=)(~Fm;fYZ>WTDX2A<>V9zMR_MR=C?xj#q0k~bOP6N#ftH!R`};@M40 z=e$oGVkJo-J|~_u=z_$LT$f#b<6LxD;F%#KlbRIIO4|M<{bJi6V?baRXx44}``EUdCxHJMxYFAGY6F=2B)#6& z!biZsHgIv>*5p0lat9cG(j`N3BtK1|PypV~=$mrD;4RR*=JwXw$LRx*p{|y1fP+I| zyhz#W9`Eky?Csw(t^R%hfd+D{zU}jr00006VoOIv01p5M00-bWuZREu010qNS#tmY zE+YT{E+YYWr9XB6000McNliru=L;4CIuCMZ#d!b#02y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{00BlxL_t(Y$E{U6Zo)tieYTJc6(FUfz#UsfqRa`P;RLw= z6>>*M;S+F)oPdU$AZ1$9IXx0k0TR-th-Mj__1a^0nz3hh-Ct7 zhxamY8;NZ{q@H)9NWU%zn!f9v4eF+4n7kO<&w394I9;!SC`H9kZQ%UB7>O-aL6zt6 zv;_drs&_w>9RUFO_Es55=mMW)sj;c~0zr0!nlFrv)?GCT%N98JXuZNE-#lpBJ`q6? zydBRTG$(nAV3(u@6o4VwC8-|*is0{hej5_65fJb&85<&R5pW?QiL@jsx<9lr+VRY9 zk$H+-MJ~Q((KRJ-SCQX3{g1}ilxwd=CK9fn8aM#(saF3;xGvk*xSLW(rB2$YoAMh# zhw|+WTJ=o3rf(a#Xdd{QXr;ovshY{Ip-Bz#{d8T literal 0 HcmV?d00001 diff --git a/Crawler/assets/items/Logs.png b/Crawler/assets/items/Logs.png new file mode 100644 index 0000000000000000000000000000000000000000..d358ffb822d1cf79ccb3c1676c67d06f7178796f GIT binary patch literal 859 zcmV-h1ElEX>4Tx04R}tkv&MmKpe$iQ>CI62aAX}WT-CMMMWG-6^me@v=v%)FuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|>f)s6A|?JWDYS_3;J6>}?mh0_0Yam~RI@7zsG4P@ z;xRFsTNMMZ=)(~Fm;fYZ>WTDX2A<>V9zMR_MR=C?xj#q0k~bOP6N#ftH!R`};@M40 z=e$oGVkJo-J|~_u=z_$LT$f#b<6LxD;F%#KlbRIIO4|M<{bJi6V?baRXx44}``EUdCxHJMxYFAGY6F=2B)#6& z!biZsHgIv>*5p0lat9cG(j`N3BtK1|PypV~=$mrD;4RR*=JwXw$LRx*p{|y1fP+I| zyhz#W9`Eky?Csw(t^R%hfd+D{zU}jr00006VoOIv01p5M00-bWuZREu010qNS#tmY zE+YT{E+YYWr9XB6000McNliru=L;4CFdvmaJ(mCg02y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{00A>eL_t(Y$L*CZa>FnXg`YZ|k(o3mHWYJM!&0alI7ji7 z$_iZ;m?M}aP|z$kij6iPBabWpRMoT-l4X*m@9kTyCEyv)cvuL|$!Fb5C|oP)CGr}Q zwN?^G)8J1XxNxl`3LXFGf`z~f9iyx+007h6`EB2`AOTx%07K??a67;^h;T+XE5dx> z7FOsO08myJn1--Hgj7Yt`lD$kBFq;K0Cn|+cfFs$-2)$sur;{dI4+SbNva~$ro$N> zlw?p+%(`G}aJSwTJa(m(#Ao?|beqo}He2hMwXE&feqZXM3H*9GP@W}pJsn7JPI;D4 zo+b2_L?k%>HfP7b`VYn%w30){ORkpM)7y>UoOWDHGIr;KZ%ixVLfldXU3P8Xvvix& lS_x{?{oi|F-97ZtxdEgQ*%$MYOD6yT002ovPDHLkV1ki@cBlXV literal 0 HcmV?d00001