Added Training Dummies to camp. Release Build 11085.

This commit is contained in:
sigonasr2 2024-08-28 17:38:43 -05:00
parent 719ed53923
commit 182e492991
13 changed files with 137 additions and 5 deletions

View File

@ -272,7 +272,7 @@ bool Monster::Update(float fElapsedTime){
lastFacingDirectionChange+=fElapsedTime;
timeSpentAlive+=fElapsedTime;
if(IsSolid()){
if(IsSolid()&&FadeoutWhenStandingBehind()){
if(GetPos().y>=game->GetPlayer()->GetPos().y)solidFadeTimer=std::min(TileGroup::FADE_TIME,solidFadeTimer+game->GetElapsedTime());
else solidFadeTimer=std::max(0.f,solidFadeTimer-game->GetElapsedTime());
}
@ -371,7 +371,7 @@ bool Monster::Update(float fElapsedTime){
}
}
}
if(GetState()==State::NORMAL){
if(GetState()==State::NORMAL&&FaceTarget()){
UpdateFacingDirection(game->GetPlayer()->GetPos());
}
if(!game->TestingModeEnabled()&&CanMove())Monster::STRATEGY::RUN_STRATEGY(*this,fElapsedTime);
@ -1529,4 +1529,11 @@ void Monster::Stun(const float stunDuration){
}
const float&Monster::GetRemainingStunDuration()const{
return stunTimer;
}
const bool Monster::FadeoutWhenStandingBehind()const{
return MONSTER_DATA.at(name).FadeoutWhenStandingBehind();
}
const bool Monster::FaceTarget()const{
return MONSTER_DATA.at(name).FaceTarget();
}

View File

@ -220,6 +220,8 @@ public:
const bool IsBackstabAttack()const;
void Stun(const float stunDuration);
const float&GetRemainingStunDuration()const;
const bool FadeoutWhenStandingBehind()const;
const bool FaceTarget()const;
private:
//NOTE: Marking a monster for deletion does not trigger any death events. It just simply removes the monster from the field!!
// The way this works is that monsters marked for deletion will cause the monster update loop to detect there's at least one or more monsters that must be deleted and will call erase_if on the list at the end of the iteration loop.

View File

@ -178,6 +178,8 @@ void MonsterData::InitializeMonsterData(){
DATA["Monsters"][MonsterName]["CollisionDmg"].GetInt()
);
if(DATA["Monsters"][MonsterName].HasProperty("Fadeout"))monster.fadeout=DATA["Monsters"][MonsterName]["Fadeout"].GetBool();
if(DATA["Monsters"][MonsterName].HasProperty("No Facing"))monster.noFacing=DATA["Monsters"][MonsterName]["No Facing"].GetBool();
if(DATA["Monsters"][MonsterName].HasProperty("Ignore Collisions"))monster.ignoresCollision=DATA["Monsters"][MonsterName]["Ignore Collisions"].GetBool();
if(DATA["Monsters"][MonsterName].HasProperty("Mounted Animation"))monster.mountedAnimName=DATA["Monsters"][MonsterName]["Mounted Animation"].GetString();
if(DATA["Monsters"][MonsterName].HasProperty("Mounted Animation Offset")){
@ -459,4 +461,12 @@ const bool MonsterData::HasArrowIndicator()const{
const std::optional<geom2d::rect<float>>&MonsterData::GetRectangleCollision()const{
return rectCollision;
}
const bool MonsterData::FadeoutWhenStandingBehind()const{
return fadeout;
}
const bool MonsterData::FaceTarget()const{
return !noFacing;
}

View File

@ -106,6 +106,8 @@ public:
const float GetCollisionRadius()const;
const bool HasArrowIndicator()const;
const std::optional<geom2d::rect<float>>&GetRectangleCollision()const;
const bool FadeoutWhenStandingBehind()const;
const bool FaceTarget()const;
private:
std::string name;
int hp;
@ -132,6 +134,8 @@ private:
bool ignoresCollision{false}; //If set to true, this monster does not run into terrain.
bool immovable{false};
bool invulnerable{false};
bool fadeout{false};
bool noFacing{false};
std::optional<float>lifetime{};
float collisionRadius{};
bool hasArrowIndicator{false};

View File

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1
#define VERSION_MINOR 2
#define VERSION_PATCH 3
#define VERSION_BUILD 11084
#define VERSION_BUILD 11085
#define stringify(a) stringify_(a)
#define stringify_(a) #a

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.10.2" class="Map" orientation="orthogonal" renderorder="right-down" width="70" height="60" tilewidth="12" tileheight="12" infinite="0" nextlayerid="9" nextobjectid="4">
<map version="1.10" tiledversion="1.10.2" class="Map" orientation="orthogonal" renderorder="right-down" width="70" height="60" tilewidth="12" tileheight="12" infinite="0" nextlayerid="9" nextobjectid="8">
<properties>
<property name="Backdrop" propertytype="Backdrop" value="forest"/>
<property name="Background Music" propertytype="BGM" value="base_camp"/>
@ -453,5 +453,18 @@
</properties>
<point/>
</object>
<object id="4" template="../maps/Monsters/Training Dummy.tx" x="126" y="375">
<properties>
<property name="spawner" type="object" value="6"/>
</properties>
</object>
<object id="5" template="../maps/Monsters/Large Training Dummy.tx" type="Monster" x="84" y="405">
<properties>
<property name="spawner" type="object" value="6"/>
</properties>
</object>
<object id="6" name="Dummy Spawner" type="SpawnGroup" x="363" y="372" width="45" height="48">
<ellipse/>
</object>
</objectgroup>
</map>

View File

@ -1150,6 +1150,90 @@ 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
}
Training Dummy
{
Health = 999999999
Attack = 0
CollisionDmg = 0
Fadeout = False
No Facing = True
MoveSpd = 0%
Size = 100%
Collision Radius = 9
XP = 0
Strategy = Do Nothing
#Size of each animation frame
SheetFrameSize = 24,24
# 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,ReverseOneShot)
# 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.4, OneShot
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
}
Large Training Dummy
{
Health = 999999999
Attack = 0
CollisionDmg = 0
Fadeout = False
No Facing = True
MoveSpd = 0%
Size = 200%
Collision Radius = 9
XP = 0
Strategy = Do Nothing
#Size of each animation frame
SheetFrameSize = 24,24
# 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,ReverseOneShot)
# 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.4, OneShot
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
}

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.10.2" orientation="orthogonal" renderorder="right-down" width="30" height="20" tilewidth="24" tileheight="24" infinite="1" nextlayerid="3" nextobjectid="30">
<map version="1.10" tiledversion="1.10.2" orientation="orthogonal" renderorder="right-down" width="30" height="20" tilewidth="24" tileheight="24" infinite="1" nextlayerid="3" nextobjectid="33">
<tileset firstgid="1" source="Monsters.tsx"/>
<layer id="1" name="Tile Layer 1" width="30" height="20">
<data encoding="csv"/>
@ -27,5 +27,7 @@
<object id="27" template="Monsters/Major Hawk.tx" type="Monster" x="180" y="96"/>
<object id="28" template="Monsters/Zephy, King of Birds.tx" type="Monster" x="-42" y="348"/>
<object id="29" template="Monsters/Stone Golem.tx" type="Monster" x="174" y="444"/>
<object id="30" name="Training Dummy" type="Monster" gid="22" x="180" y="-42" width="24" height="24"/>
<object id="32" name="Large Training Dummy" type="Monster" gid="22" x="138" y="-78" width="48" height="48"/>
</objectgroup>
</map>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<template>
<tileset firstgid="1" source="../Monsters.tsx"/>
<object name="Large Training Dummy" type="Monster" gid="22" width="48" height="48"/>
</template>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<template>
<tileset firstgid="1" source="../Monsters.tsx"/>
<object name="Training Dummy" type="Monster" gid="22" width="24" height="24"/>
</template>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 13 KiB