Adjust fade effect so monsters are unaffected while on the title screen. Add in Stone Pillar graphic and setup stone pillar monster/sprite data. Release Build 9270.

pull/57/head
sigonasr2 9 months ago
parent 42b8cf5da7
commit 39303e2438
  1. 5
      Adventures in Lestoria/Bullet.cpp
  2. 18
      Adventures in Lestoria/Monster.cpp
  3. 6
      Adventures in Lestoria/Monster.h
  4. 17
      Adventures in Lestoria/MonsterData.cpp
  5. 10
      Adventures in Lestoria/MonsterData.h
  6. 2
      Adventures in Lestoria/Version.h
  7. 44
      Adventures in Lestoria/assets/config/Monsters.txt
  8. BIN
      Adventures in Lestoria/assets/stone_pillar.png
  9. BIN
      x64/Release/Adventures in Lestoria.exe

@ -151,7 +151,10 @@ void Bullet::Draw()const{
game->view.DrawDecal(pos-vf2d{3,3}*shadowScale/2+vf2d{0,12*scale.y},GFX["circle.png"].Decal(),shadowScale,BLACK);
}
if(game->GetPlayer()->HasIframes()||game->GetPlayer()->GetZ()>1){
const bool NotOnTitleScreen=GameState::STATE!=GameState::states[States::MAIN_MENU];
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.
}

@ -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){
@ -1000,3 +1003,16 @@ 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::optional<float>Monster::GetLifetime()const{
return MONSTER_DATA.at(GetName()).GetLifetime();
}
const std::optional<float>Monster::GetCollisionRadius()const{
return MONSTER_DATA.at(GetName()).GetCollisionRadius();
}

@ -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::optional<float>GetLifetime()const;
//If an object has a collision radius, returns it.
const std::optional<float>GetCollisionRadius()const;
private:
std::string name;
vf2d pos;

@ -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();
@ -404,3 +408,16 @@ 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::optional<float>MonsterData::GetLifetime()const{
return lifetime;
}
const std::optional<float>MonsterData::GetCollisionRadius()const{
return collisionRadius;
}

@ -95,6 +95,12 @@ public:
const std::optional<const std::string>GetMountedAnimation()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::optional<float>GetLifetime()const;
//If an object has a collision radius, returns it.
const std::optional<float>GetCollisionRadius()const;
private:
std::string name;
int hp;
@ -118,4 +124,8 @@ private:
std::optional<std::string>mountedAnimName;
vf2d mountedAnimationOffset{};
bool ignoresCollision{false}; //If set to true, this monster does not run into terrain.
bool immovable{false};
bool invulnerable{false};
std::optional<float>lifetime{};
std::optional<float>collisionRadius{};
};

@ -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

@ -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
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Loading…
Cancel
Save