diff --git a/Adventures in Lestoria/Bullet.cpp b/Adventures in Lestoria/Bullet.cpp index 51532510..55a380ee 100644 --- a/Adventures in Lestoria/Bullet.cpp +++ b/Adventures in Lestoria/Bullet.cpp @@ -150,8 +150,11 @@ void Bullet::Draw()const{ vf2d shadowScale=vf2d{8*scale.x/3.f,1}/std::max(1.f,GetZ()/8); game->view.DrawDecal(pos-vf2d{3,3}*shadowScale/2+vf2d{0,12*scale.y},GFX["circle.png"].Decal(),shadowScale,BLACK); } + + const bool NotOnTitleScreen=GameState::STATE!=GameState::states[States::MAIN_MENU]; - if(game->GetPlayer()->HasIframes()||game->GetPlayer()->GetZ()>1){ + if(NotOnTitleScreen + &&(game->GetPlayer()->HasIframes()||game->GetPlayer()->GetZ()>1)){ blendCol.a/=1.59f; //Comes from 255 divided by 160 which is roughly what we want the alpha to be when the bullet has full transparency. } diff --git a/Adventures in Lestoria/Monster.cpp b/Adventures in Lestoria/Monster.cpp index 9fc1578f..1dbb03ea 100644 --- a/Adventures in Lestoria/Monster.cpp +++ b/Adventures in Lestoria/Monster.cpp @@ -399,7 +399,10 @@ void Monster::Draw()const{ game->view.DrawDecal(GetPos()-vf2d{3,3}*shadowScale/2+vf2d{0,6*GetSizeMult()},GFX["circle.png"].Decal(),shadowScale,BLACK); } - if(game->GetPlayer()->HasIframes()||OnUpperLevel()!=game->GetPlayer()->OnUpperLevel()||abs(GetZ()-game->GetPlayer()->GetZ())>1)blendCol.a=160; + const bool NotOnTitleScreen=GameState::STATE!=GameState::states[States::MAIN_MENU]; + + if(NotOnTitleScreen + &&(game->GetPlayer()->HasIframes()||OnUpperLevel()!=game->GetPlayer()->OnUpperLevel()||abs(GetZ()-game->GetPlayer()->GetZ())>1))blendCol.a=160; game->view.DrawPartialRotatedDecal(GetPos()-vf2d{0,GetZ()},GetFrame().GetSourceImage()->Decal(),spriteRot,GetFrame().GetSourceRect().size/2,GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,vf2d(GetSizeMult()*(!HasFourWaySprites()&&GetFacingDirection()==Direction::EAST?-1:1),GetSizeMult()),blendCol); if(overlaySprite.length()!=0){ @@ -999,4 +1002,17 @@ const bool Monster::IgnoresTerrainCollision()const{ const float Monster::TimeSpentAlive()const{ return timeSpentAlive; +} + +const bool Monster::Immovable()const{ + return MONSTER_DATA.at(GetName()).Immovable(); +} +const bool Monster::Invulnerable()const{ + return MONSTER_DATA.at(GetName()).Invulnerable(); +} +const std::optionalMonster::GetLifetime()const{ + return MONSTER_DATA.at(GetName()).GetLifetime(); +} +const std::optionalMonster::GetCollisionRadius()const{ + return MONSTER_DATA.at(GetName()).GetCollisionRadius(); } \ No newline at end of file diff --git a/Adventures in Lestoria/Monster.h b/Adventures in Lestoria/Monster.h index dae2f368..11f7872d 100644 --- a/Adventures in Lestoria/Monster.h +++ b/Adventures in Lestoria/Monster.h @@ -164,6 +164,12 @@ public: const bool HasMountedMonster()const; const bool IgnoresTerrainCollision()const; const float TimeSpentAlive()const; + const bool Immovable()const; + const bool Invulnerable()const; + //If an object has a lifetime set, returns it. + const std::optionalGetLifetime()const; + //If an object has a collision radius, returns it. + const std::optionalGetCollisionRadius()const; private: std::string name; vf2d pos; diff --git a/Adventures in Lestoria/MonsterData.cpp b/Adventures in Lestoria/MonsterData.cpp index acd098ea..45429fa8 100644 --- a/Adventures in Lestoria/MonsterData.cpp +++ b/Adventures in Lestoria/MonsterData.cpp @@ -166,6 +166,10 @@ void MonsterData::InitializeMonsterData(){ if(DATA["Monsters"][MonsterName]["Mounted Animation Offset"].GetValueCount()==2)monster.mountedAnimationOffset={DATA["Monsters"][MonsterName]["Mounted Animation Offset"].GetReal(0),DATA["Monsters"][MonsterName]["Mounted Animation Offset"].GetReal(1)}; else ERR(std::format("WARNING! Monster {} containing a mounted animation offset has {} for reading in a vector, when vectors are supposed to only have two values! Please check the \"Mounted Animation Offset\" configuration value for {}",MonsterName,DATA["Monsters"][MonsterName]["Mounted Animation Offset"].GetValueCount(),MonsterName)); } + if(DATA["Monsters"][MonsterName].HasProperty("Immovable"))monster.immovable=DATA["Monsters"][MonsterName]["Immovable"].GetBool(); + if(DATA["Monsters"][MonsterName].HasProperty("Invulnerable"))monster.invulnerable=DATA["Monsters"][MonsterName]["Invulnerable"].GetBool(); + if(DATA["Monsters"][MonsterName].HasProperty("Lifetime"))monster.lifetime=DATA["Monsters"][MonsterName]["Lifetime"].GetReal(); + if(DATA["Monsters"][MonsterName].HasProperty("Collision Radius"))monster.collisionRadius=DATA["Monsters"][MonsterName]["Collision Radius"].GetBool(); if(hasFourWaySpriteSheet)monster.SetUsesFourWaySprites(); @@ -403,4 +407,17 @@ const vf2d&MonsterData::GetMountedAnimationOffset()const{ const bool MonsterData::IgnoresTerrainCollision()const{ return ignoresCollision; +} + +const bool MonsterData::Immovable()const{ + return immovable; +} +const bool MonsterData::Invulnerable()const{ + return invulnerable; +} +const std::optionalMonsterData::GetLifetime()const{ + return lifetime; +} +const std::optionalMonsterData::GetCollisionRadius()const{ + return collisionRadius; } \ No newline at end of file diff --git a/Adventures in Lestoria/MonsterData.h b/Adventures in Lestoria/MonsterData.h index 1f69e2fb..618da328 100644 --- a/Adventures in Lestoria/MonsterData.h +++ b/Adventures in Lestoria/MonsterData.h @@ -95,6 +95,12 @@ public: const std::optionalGetMountedAnimation()const; const vf2d&GetMountedAnimationOffset()const; const bool IgnoresTerrainCollision()const; + const bool Immovable()const; + const bool Invulnerable()const; + //If an object has a lifetime set, returns it. + const std::optionalGetLifetime()const; + //If an object has a collision radius, returns it. + const std::optionalGetCollisionRadius()const; private: std::string name; int hp; @@ -118,4 +124,8 @@ private: std::optionalmountedAnimName; vf2d mountedAnimationOffset{}; bool ignoresCollision{false}; //If set to true, this monster does not run into terrain. + bool immovable{false}; + bool invulnerable{false}; + std::optionallifetime{}; + std::optionalcollisionRadius{}; }; \ No newline at end of file diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index ddfc6fd4..9a3f737d 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 2 #define VERSION_PATCH 0 -#define VERSION_BUILD 9268 +#define VERSION_BUILD 9270 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/config/Monsters.txt b/Adventures in Lestoria/assets/config/Monsters.txt index 293207d6..1eb1a805 100644 --- a/Adventures in Lestoria/assets/config/Monsters.txt +++ b/Adventures in Lestoria/assets/config/Monsters.txt @@ -772,6 +772,50 @@ Monsters Death Sound = Slime Dead Walk Sound = Slime Walk + # Drop Item Name, Drop Percentage(0-100%), Drop Min Quantity, Drop Max Quantity + # DROP[0] = Ring of the Bear,100%,1,1 + } + Stone Pillar + { + Health = 1 + Attack = 52 + + CollisionDmg = 0 + + Immovable = True + Invulnerable = True + + MoveSpd = 0% + # Due to the Stone Elemental's base sprite size being 36x36, 220% is actually 146.666666667% size when factoring in a 50% larger sprite. + Size = 100% + Collision Radius = 59 + Lifetime = 5s + + XP = 0 + + Strategy = Run Towards + + #Size of each animation frame + SheetFrameSize = 168,528 + + # Setting this to true means every four rows indicates one animation, the ordering of the directions is: NORTH, EAST, SOUTH, WEST + 4-Way Spritesheet = False + + Animations + { + # Frame Count, Frame Speed (s), Frame Cycling (Repeat,OneShot,PingPong,Reverse) + # Animations must be defined in the same order as they are in their sprite sheets + # The First Four animations must represent a standing, walking, attack, and death animation. Their names are up to the creator. + IDLE = 1, 0.6, Repeat + WALK = 1, 0.2, Repeat + STAND BEHIND ME = 1, 0.2, OneShot + DEATH = 1, 0.15, OneShot + } + + Hurt Sound = Monster Hurt + Death Sound = Slime Dead + Walk Sound = Slime Walk + # Drop Item Name, Drop Percentage(0-100%), Drop Min Quantity, Drop Max Quantity # DROP[0] = Ring of the Bear,100%,1,1 } diff --git a/Adventures in Lestoria/assets/stone_pillar.png b/Adventures in Lestoria/assets/stone_pillar.png new file mode 100644 index 00000000..01a4eeef Binary files /dev/null and b/Adventures in Lestoria/assets/stone_pillar.png differ diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index ead22aaf..8fa8466f 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ