diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index c758b010..09793e20 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -83,6 +83,7 @@ All rights reserved. #include "SteamStatsReceivedHandler.h" #include "StageMaskPolygon.h" #include +#include INCLUDE_EMITTER_LIST INCLUDE_ITEM_CATEGORIES @@ -3086,7 +3087,7 @@ int main(const int argn,char**args) size_t requiredSize=0; #ifdef WIN32 - getenv_s( &requiredSize, NULL, 0, "SteamTenfoot"); + getenv_s(&requiredSize,NULL,0,"SteamTenfoot"); #else const char*bigPicture=getenv("SteamTenfoot"); if(bigPicture){ diff --git a/Adventures in Lestoria/GhostOfPirateCaptain.cpp b/Adventures in Lestoria/GhostOfPirateCaptain.cpp index 7fef7daf..9c9712b4 100644 --- a/Adventures in Lestoria/GhostOfPirateCaptain.cpp +++ b/Adventures in Lestoria/GhostOfPirateCaptain.cpp @@ -41,6 +41,7 @@ All rights reserved. #include "AdventuresInLestoria.h" #include "SoundEffect.h" #include "BulletTypes.h" +#include using A=Attribute; @@ -71,6 +72,10 @@ void Monster::STRATEGY::GHOST_OF_PIRATE_CAPTAIN(Monster&m,float fElapsedTime,std m.I(A::CANNON_PHASE)=(m.I(A::CANNON_PHASE)+1)%PHASE_COUNT; if(prevCannonPhase>m.I(A::CANNON_PHASE)){//Phase has wrapped around, reset cannon shot count. m.I(A::CANNON_SHOT_COUNT)=0; + if(!m.B(A::FIRST_WAVE_COMPLETE)){ + m.B(A::FIRST_WAVE_COMPLETE)=true; + m.ForceSetPos(m.spawnPos); + } } }}; @@ -98,7 +103,9 @@ void Monster::STRATEGY::GHOST_OF_PIRATE_CAPTAIN(Monster&m,float fElapsedTime,std m.VEC(A::CANNON_PHASES).emplace_back(cannonCycle); if(cannonCycle==CANNON_SHOT)TOTAL_CANNON_SHOTS++; } + m.B(A::FIRST_WAVE_COMPLETE)=false; m.I(A::CANNON_SHOT_TYPE)=PREDICTION; + m.ForceSetPos({-400.f,-400.f}); SETPHASE(NORMAL); }break; case NORMAL:{ diff --git a/Adventures in Lestoria/ItemDrop.cpp b/Adventures in Lestoria/ItemDrop.cpp index a280d7a9..1c943d4d 100644 --- a/Adventures in Lestoria/ItemDrop.cpp +++ b/Adventures in Lestoria/ItemDrop.cpp @@ -99,8 +99,7 @@ void ItemDrop::UpdateDrops(float fElapsedTime){ if(drop.z<=0){ drop.zSpeed=0; drop.z=0; - } - else{ + }else{ drop.zSpeed+=gravity*fElapsedTime; drop.pos+=drop.speed*fElapsedTime; } diff --git a/Adventures in Lestoria/Monster.cpp b/Adventures in Lestoria/Monster.cpp index 885b033f..18227a07 100644 --- a/Adventures in Lestoria/Monster.cpp +++ b/Adventures in Lestoria/Monster.cpp @@ -692,11 +692,11 @@ void Monster::Moved(){ } if(!std::isfinite(pos.x)){ - ERR(std::format("WARNING! Player X position is {}...Trying to recover. THIS SHOULD NOT BE HAPPENING!",pos.x)); + ERR(std::format("WARNING! Monster X position is {}...Trying to recover. THIS SHOULD NOT BE HAPPENING!",pos.x)); pos.x=spawnPos.x; } if(!std::isfinite(pos.y)){ - ERR(std::format("WARNING! Player Y position is {}...Trying to recover. THIS SHOULD NOT BE HAPPENING!",pos.y)); + ERR(std::format("WARNING! Monster Y position is {}...Trying to recover. THIS SHOULD NOT BE HAPPENING!",pos.y)); pos.y=spawnPos.y; } } @@ -1672,4 +1672,8 @@ void Monster::SetCollisionRadius(const float collisionRadius){ } void Monster::SetLifetime(const float lifetime){ this->lifetime=lifetime; +} +void Monster::ForceSetPos(vf2d pos){ + this->pos=pos; + Moved(); } \ No newline at end of file diff --git a/Adventures in Lestoria/Monster.h b/Adventures in Lestoria/Monster.h index cebe3fb8..a7f6bb0c 100644 --- a/Adventures in Lestoria/Monster.h +++ b/Adventures in Lestoria/Monster.h @@ -290,8 +290,8 @@ private: NPCData npcData; float lastPathfindingCooldown=0.f; std::functionstrategyDeathFunc{}; -//Sets the strategy death function that runs when a monster dies. -// The function should return false to indicate the event is over. If the event should keep running, return true. + //Sets the strategy death function that runs when a monster dies. + // The function should return false to indicate the event is over. If the event should keep running, return true. void SetStrategyDeathFunction(std::functionfunc); //If you are trying to change a Get() stat, use the STAT_UP buff (and the optional argument) to supply an attribute you want to apply. const ItemAttribute&GetBonusStat(std::string_view attr)const; @@ -336,6 +336,8 @@ private: const float UnconsciousTime()const; bool manualIgnoreTerrain{false}; //A manual flag that can be toggled on to dynamically make this monster ignore terrain collision. float collisionRadius{}; //The collision radius can be modified, it's just set initially to the monster database entry. + //Ignores collision checking and sets the monster at the given position. + void ForceSetPos(vf2d pos); struct STRATEGY{ static std::string ERR; diff --git a/Adventures in Lestoria/MonsterAttribute.h b/Adventures in Lestoria/MonsterAttribute.h index ad6ed16d..f25fe2ec 100644 --- a/Adventures in Lestoria/MonsterAttribute.h +++ b/Adventures in Lestoria/MonsterAttribute.h @@ -172,4 +172,5 @@ enum class Attribute{ CANNON_SHOT_COUNT, LINE_SHOT_ANG, LAST_PLAYER_POS, + FIRST_WAVE_COMPLETE, }; \ No newline at end of file diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 70274499..39d1a412 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_PATCH 0 -#define VERSION_BUILD 11997 +#define VERSION_BUILD 12001 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/Campaigns/4_1.tmx b/Adventures in Lestoria/assets/Campaigns/4_1.tmx index 9c05cd1b..947a4f57 100644 --- a/Adventures in Lestoria/assets/Campaigns/4_1.tmx +++ b/Adventures in Lestoria/assets/Campaigns/4_1.tmx @@ -1,5 +1,8 @@ - + + + + diff --git a/Adventures in Lestoria/assets/Campaigns/4_2.tmx b/Adventures in Lestoria/assets/Campaigns/4_2.tmx index 8ccdd190..f7758c61 100644 --- a/Adventures in Lestoria/assets/Campaigns/4_2.tmx +++ b/Adventures in Lestoria/assets/Campaigns/4_2.tmx @@ -1,5 +1,8 @@ - + + + + diff --git a/Adventures in Lestoria/assets/Campaigns/4_3.tmx b/Adventures in Lestoria/assets/Campaigns/4_3.tmx index d4fe6791..8f0c4c4b 100644 --- a/Adventures in Lestoria/assets/Campaigns/4_3.tmx +++ b/Adventures in Lestoria/assets/Campaigns/4_3.tmx @@ -1,5 +1,8 @@ - + + + + diff --git a/Adventures in Lestoria/assets/Campaigns/4_4.tmx b/Adventures in Lestoria/assets/Campaigns/4_4.tmx index 3462942d..dfa629fb 100644 --- a/Adventures in Lestoria/assets/Campaigns/4_4.tmx +++ b/Adventures in Lestoria/assets/Campaigns/4_4.tmx @@ -1,5 +1,8 @@ - + + + + diff --git a/Adventures in Lestoria/assets/Campaigns/4_5.tmx b/Adventures in Lestoria/assets/Campaigns/4_5.tmx index 6317f2d7..6d70e3b9 100644 --- a/Adventures in Lestoria/assets/Campaigns/4_5.tmx +++ b/Adventures in Lestoria/assets/Campaigns/4_5.tmx @@ -1,5 +1,8 @@ - + + + + diff --git a/Adventures in Lestoria/assets/Campaigns/4_6.tmx b/Adventures in Lestoria/assets/Campaigns/4_6.tmx index 2509b0cb..e43e51d7 100644 --- a/Adventures in Lestoria/assets/Campaigns/4_6.tmx +++ b/Adventures in Lestoria/assets/Campaigns/4_6.tmx @@ -1,5 +1,8 @@ - + + + + diff --git a/Adventures in Lestoria/assets/Campaigns/4_7.tmx b/Adventures in Lestoria/assets/Campaigns/4_7.tmx index 8290d9f6..64eac1b8 100644 --- a/Adventures in Lestoria/assets/Campaigns/4_7.tmx +++ b/Adventures in Lestoria/assets/Campaigns/4_7.tmx @@ -1,5 +1,8 @@ - + + + + diff --git a/Adventures in Lestoria/assets/Campaigns/4_8.tmx b/Adventures in Lestoria/assets/Campaigns/4_8.tmx index 1a322c09..630776e2 100644 --- a/Adventures in Lestoria/assets/Campaigns/4_8.tmx +++ b/Adventures in Lestoria/assets/Campaigns/4_8.tmx @@ -1,5 +1,8 @@ - + + + + diff --git a/Adventures in Lestoria/assets/Campaigns/4_B1.tmx b/Adventures in Lestoria/assets/Campaigns/4_B1.tmx index e392fb81..b3afbed1 100644 --- a/Adventures in Lestoria/assets/Campaigns/4_B1.tmx +++ b/Adventures in Lestoria/assets/Campaigns/4_B1.tmx @@ -1,5 +1,8 @@ - + + + + diff --git a/Adventures in Lestoria/assets/gamepack.pak b/Adventures in Lestoria/assets/gamepack.pak index 9498415f..51632fc6 100644 Binary files a/Adventures in Lestoria/assets/gamepack.pak and b/Adventures in Lestoria/assets/gamepack.pak differ diff --git a/Adventures in Lestoria/assets/items/Broken Bone Axe.png b/Adventures in Lestoria/assets/items/Broken Bone Axe.png new file mode 100644 index 00000000..cbe5a165 Binary files /dev/null and b/Adventures in Lestoria/assets/items/Broken Bone Axe.png differ diff --git a/Adventures in Lestoria/assets/items/Broken Bone Bow.png b/Adventures in Lestoria/assets/items/Broken Bone Bow.png new file mode 100644 index 00000000..40609430 Binary files /dev/null and b/Adventures in Lestoria/assets/items/Broken Bone Bow.png differ diff --git a/Adventures in Lestoria/assets/items/Damaged Animal Bones.png b/Adventures in Lestoria/assets/items/Damaged Animal Bones.png new file mode 100644 index 00000000..59da7e66 Binary files /dev/null and b/Adventures in Lestoria/assets/items/Damaged Animal Bones.png differ diff --git a/Adventures in Lestoria/assets/items/Giant Purple Slime Remains.png b/Adventures in Lestoria/assets/items/Giant Purple Slime Remains.png new file mode 100644 index 00000000..65c0a948 Binary files /dev/null and b/Adventures in Lestoria/assets/items/Giant Purple Slime Remains.png differ diff --git a/Adventures in Lestoria/assets/items/Glowing Bones.png b/Adventures in Lestoria/assets/items/Glowing Bones.png new file mode 100644 index 00000000..dd5b2e5c Binary files /dev/null and b/Adventures in Lestoria/assets/items/Glowing Bones.png differ diff --git a/Adventures in Lestoria/assets/items/Pieces of Horse Armor.png b/Adventures in Lestoria/assets/items/Pieces of Horse Armor.png new file mode 100644 index 00000000..8a36e290 Binary files /dev/null and b/Adventures in Lestoria/assets/items/Pieces of Horse Armor.png differ diff --git a/Adventures in Lestoria/assets/items/Preserved Animal Bones.png b/Adventures in Lestoria/assets/items/Preserved Animal Bones.png new file mode 100644 index 00000000..db027f2f Binary files /dev/null and b/Adventures in Lestoria/assets/items/Preserved Animal Bones.png differ diff --git a/Adventures in Lestoria/assets/items/Purple Gemstone.png b/Adventures in Lestoria/assets/items/Purple Gemstone.png new file mode 100644 index 00000000..2a6bc0b7 Binary files /dev/null and b/Adventures in Lestoria/assets/items/Purple Gemstone.png differ diff --git a/Adventures in Lestoria/assets/items/Purple Slime Remains.png b/Adventures in Lestoria/assets/items/Purple Slime Remains.png new file mode 100644 index 00000000..213225e4 Binary files /dev/null and b/Adventures in Lestoria/assets/items/Purple Slime Remains.png differ diff --git a/Adventures in Lestoria/assets/items/Skeleton Bone.png b/Adventures in Lestoria/assets/items/Skeleton Bone.png new file mode 100644 index 00000000..aadcffd5 Binary files /dev/null and b/Adventures in Lestoria/assets/items/Skeleton Bone.png differ diff --git a/Adventures in Lestoria/assets/items/Snake Skin.png b/Adventures in Lestoria/assets/items/Snake Skin.png new file mode 100644 index 00000000..3a9a8ccb Binary files /dev/null and b/Adventures in Lestoria/assets/items/Snake Skin.png differ diff --git a/Adventures in Lestoria/assets/items/Spider Legs.png b/Adventures in Lestoria/assets/items/Spider Legs.png new file mode 100644 index 00000000..bd791007 Binary files /dev/null and b/Adventures in Lestoria/assets/items/Spider Legs.png differ diff --git a/Adventures in Lestoria/assets/items/Swamp Frog Skin.png b/Adventures in Lestoria/assets/items/Swamp Frog Skin.png new file mode 100644 index 00000000..8c72f5f3 Binary files /dev/null and b/Adventures in Lestoria/assets/items/Swamp Frog Skin.png differ diff --git a/Adventures in Lestoria/assets/maps/Chapter_4_Details.tsx b/Adventures in Lestoria/assets/maps/Chapter_4_Details.tsx index 16bc9e3d..029cfa41 100644 --- a/Adventures in Lestoria/assets/maps/Chapter_4_Details.tsx +++ b/Adventures in Lestoria/assets/maps/Chapter_4_Details.tsx @@ -1,5 +1,5 @@ - + diff --git a/Adventures in Lestoria/assets/maps/Chapter_4_Ground.tsx b/Adventures in Lestoria/assets/maps/Chapter_4_Ground.tsx index 884e2293..45e6845f 100644 --- a/Adventures in Lestoria/assets/maps/Chapter_4_Ground.tsx +++ b/Adventures in Lestoria/assets/maps/Chapter_4_Ground.tsx @@ -1,5 +1,5 @@ - + diff --git a/Adventures in Lestoria/assets/maps/Chapter_4_Objects_24x24.tsx b/Adventures in Lestoria/assets/maps/Chapter_4_Objects_24x24.tsx index 05cd0316..b1baff47 100644 --- a/Adventures in Lestoria/assets/maps/Chapter_4_Objects_24x24.tsx +++ b/Adventures in Lestoria/assets/maps/Chapter_4_Objects_24x24.tsx @@ -1,4 +1,4 @@ - + diff --git a/Adventures in Lestoria/assets/maps/Chapter_4_water_detilazation_24x24.tsx b/Adventures in Lestoria/assets/maps/Chapter_4_water_detilazation_24x24.tsx index 9a2a9a6f..5dc3928d 100644 --- a/Adventures in Lestoria/assets/maps/Chapter_4_water_detilazation_24x24.tsx +++ b/Adventures in Lestoria/assets/maps/Chapter_4_water_detilazation_24x24.tsx @@ -1,4 +1,4 @@ - + diff --git a/Adventures in Lestoria/olcPixelGameEngine.h b/Adventures in Lestoria/olcPixelGameEngine.h index b3753ec1..09c56fcb 100644 --- a/Adventures in Lestoria/olcPixelGameEngine.h +++ b/Adventures in Lestoria/olcPixelGameEngine.h @@ -6948,6 +6948,8 @@ namespace olc // Windows Event Handler - this is statically connected to the windows event system static LRESULT CALLBACK olc_WindowEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { + double aspectRatio = (24*15.) / (24*10.); + WPARAM sideBeingDragged = 0; switch (uMsg) { case WM_MOUSEMOVE: @@ -6972,6 +6974,7 @@ namespace olc return 0; } case WM_SIZE: ptrPGE->olc_UpdateWindowSize(lParam & 0xFFFF, (lParam >> 16) & 0xFFFF); return 0; + case WM_SIZING: sideBeingDragged = wParam; return 0; case WM_MOUSEWHEEL: ptrPGE->olc_UpdateMouseWheel(GET_WHEEL_DELTA_WPARAM(wParam)); return 0; case WM_MOUSELEAVE: ptrPGE->olc_UpdateMouseFocus(false); return 0; case WM_SETFOCUS: ptrPGE->olc_UpdateKeyFocus(true); return 0; @@ -7023,6 +7026,52 @@ namespace olc } break; + case WM_WINDOWPOSCHANGING: + { + WINDOWPOS * winPos = (WINDOWPOS*)lParam; + + // Adjust window dimensions to maintain aspect ratio + switch( sideBeingDragged ) + { + case WMSZ_BOTTOM: + case WMSZ_TOPRIGHT: + winPos->cx = (int)( (double)winPos->cy * aspectRatio ); + break; + + case WMSZ_RIGHT: + case WMSZ_BOTTOMLEFT: + case WMSZ_BOTTOMRIGHT: + winPos->cy = (int)( (double)winPos->cx / aspectRatio ); + break; + + case WMSZ_TOP: + { + // Adjust the x position of the window to make it appear + // that the bottom right side is anchored + WINDOWPOS old = *winPos; + + winPos->cx = (int)( (double)winPos->cy * aspectRatio ); + + winPos->x += old.cx - winPos->cx;; + } + break; + + case WMSZ_LEFT: + case WMSZ_TOPLEFT: + { + // Adjust the y position of the window to make it appear + // the bottom right side is anchored. TOPLEFT resizing + // will move the window around if you don't do this + WINDOWPOS old = *winPos; + winPos->cy = (int)( (double)winPos->cx / aspectRatio ); + + winPos->y += old.cy - winPos->cy; + } + break; + } + } + break; + case WM_CLOSE: ptrPGE->olc_Terminate(); return 0; case WM_DESTROY: PostQuitMessage(0); DestroyWindow(hWnd); return 0; diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index e796bc14..0404f1da 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ