Mobs can now have ifreames. Add in documentation for slime king encounter and prep a spritesheet for it.

pull/28/head
sigonasr2 2 years ago
parent b1885a1c1e
commit 49940fdba1
  1. 4
      Crawler/Crawler.cpp
  2. 4
      Crawler/Crawler.vcxproj.filters
  3. 47
      Crawler/Crawler_Slime_King_Encounter.txt
  4. 10
      Crawler/Monster.cpp
  5. 5
      Crawler/Monster.h
  6. 4
      Crawler/Player.cpp
  7. 2
      Crawler/Slime_King_Encounter.txt
  8. 2
      Crawler/Version.h
  9. BIN
      Crawler/assets/monsters/Slime King.png

@ -448,12 +448,10 @@ void Crawler::UpdateBullets(float fElapsedTime){
if(geom2d::overlaps(geom2d::circle(m.GetPos(),12*m.GetSizeMult()),geom2d::circle(b->pos,b->radius))){ if(geom2d::overlaps(geom2d::circle(m.GetPos(),12*m.GetSizeMult()),geom2d::circle(b->pos,b->radius))){
if(b->hitList.find(&m)==b->hitList.end()&&m.Hurt(b->damage,b->OnUpperLevel())){ if(b->hitList.find(&m)==b->hitList.end()&&m.Hurt(b->damage,b->OnUpperLevel())){
if(!b->hitsMultiple){ if(!b->hitsMultiple){
if(b->MonsterHit(m)){
it=BULLET_LIST.erase(it); it=BULLET_LIST.erase(it);
if(it==BULLET_LIST.end()){ if(it==BULLET_LIST.end()){
goto outsideBulletLoop; goto outsideBulletLoop;
} }
}
goto continueBulletLoop; goto continueBulletLoop;
} }
b->hitList[&m]=true; b->hitList[&m]=true;
@ -463,12 +461,10 @@ void Crawler::UpdateBullets(float fElapsedTime){
} else { } else {
if(geom2d::overlaps(geom2d::circle(player->GetPos(),12*player->GetSizeMult()/2),geom2d::circle(b->pos,b->radius))){ if(geom2d::overlaps(geom2d::circle(player->GetPos(),12*player->GetSizeMult()/2),geom2d::circle(b->pos,b->radius))){
if(player->Hurt(b->damage,b->OnUpperLevel())){ if(player->Hurt(b->damage,b->OnUpperLevel())){
if(b->PlayerHit(GetPlayer())){
it=BULLET_LIST.erase(it); it=BULLET_LIST.erase(it);
if(it==BULLET_LIST.end()){ if(it==BULLET_LIST.end()){
goto outsideBulletLoop; goto outsideBulletLoop;
} }
}
goto continueBulletLoop; goto continueBulletLoop;
} }
} }

@ -244,7 +244,6 @@
<Text Include="NewClasses.txt"> <Text Include="NewClasses.txt">
<Filter>Documentation</Filter> <Filter>Documentation</Filter>
</Text> </Text>
<Text Include="Slime_King_Encounter.txt" />
<Text Include="assets\config\configuration.txt"> <Text Include="assets\config\configuration.txt">
<Filter>Configurations</Filter> <Filter>Configurations</Filter>
</Text> </Text>
@ -281,6 +280,9 @@
<Text Include="assets\config\MonsterStrategies.txt"> <Text Include="assets\config\MonsterStrategies.txt">
<Filter>Configurations</Filter> <Filter>Configurations</Filter>
</Text> </Text>
<Text Include="Slime_King_Encounter.txt">
<Filter>Documentation</Filter>
</Text>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Image Include="assets\heart.ico"> <Image Include="assets\heart.ico">

@ -0,0 +1,47 @@
Test Attributes, to be able to try encounter with the concept Warrior:
HP: 1200
Projectile Attack dmg: 10
Jump Attack dmg: 20
- Jumps need a telegraph on the ground.
Slime King
Base Size 800%
100%
Every 4 Seconds Shoots a ring of projectiles and another 2 rings with each 0.2 seconds delayed and slightly shifted.
after 4 repeats of this pattern, jump in the air and target location player currently at. Lands after 3 seconds.
After landing creats 1 ring of projectiles and takes 2 extra seconds to recover.
repeats behaviour until 75% is reached.
75%:
Size changes to 600%
Spawns 2 Slime adds (Monster C from Concept for now)
shoots every second with 3 projectiles (shoots out the projectiles in same moment with 45 degree shiftet flight location) in players direction.
after 5 shoots it charges for 5 seconds after that the king does 3 rapid jumps aiming for the player.
first should be dodgeable. quite easily.
second needs to be blocked with movement skill or iframe (unless high movespeed, 110% shall not be enough to dodge this, 110% can be achived without any special gear as bard permanently)
third jump is a little slower that should allow a player with 100% movespeed to barely run out of it.
50%:
Size changes to 400%
Spawns 2 Slime adds (Monster C from Concept for now)
1 fast Jump towards player. 3 projectiles attacks with 0.5 seconds between attack.
2 seconds recover.
repeat.
25%:
Size changes to 200%
Spawns 2 Slime adds (Monster B from Concept for now)
Movespeed 50%
King Shoots 5 projectiles, 0.1 sec delay Boss doesnt aim for the player directly instead shoots randomly in the general direction. runs away for 2.5 seconds. stands still for 1 second and shoot again.
Repeat 5 times then instead of running jump up to 1000 Range away from player and repeat.
0%:
instead of dying Slime king Looses 50% size on every hit taken (1 sec iframe after taking dmg) until reaching 0% size and dies.
Slime King only runs away with 50% move speed.

@ -117,9 +117,10 @@ bool Monster::Update(float fElapsedTime){
if(it==buffList.end())break; if(it==buffList.end())break;
} }
} }
if(!HasIframes()){
for(Monster&m:MONSTER_LIST){ for(Monster&m:MONSTER_LIST){
if(&m==this)continue; if(&m==this)continue;
if(OnUpperLevel()==m.OnUpperLevel()&&geom2d::overlaps(geom2d::circle(pos,12*size/2),geom2d::circle(m.GetPos(),12*m.GetSizeMult()/2))){ if(!m.HasIframes()&&OnUpperLevel()==m.OnUpperLevel()&&geom2d::overlaps(geom2d::circle(pos,12*size/2),geom2d::circle(m.GetPos(),12*m.GetSizeMult()/2))){
m.Collision(*this); m.Collision(*this);
geom2d::line line(pos,m.GetPos()); geom2d::line line(pos,m.GetPos());
float dist = line.length(); float dist = line.length();
@ -135,6 +136,7 @@ bool Monster::Update(float fElapsedTime){
SetPosition(line.rpoint(-0.1)); SetPosition(line.rpoint(-0.1));
vel=line.vector().norm()*-128; vel=line.vector().norm()*-128;
} }
}
if(GetState()==State::NORMAL){ if(GetState()==State::NORMAL){
if(game->GetPlayer()->GetX()>pos.x){ if(game->GetPlayer()->GetX()>pos.x){
facingDirection=RIGHT; facingDirection=RIGHT;
@ -221,7 +223,7 @@ std::string Monster::GetDeathAnimationName(){
return MONSTER_DATA[id].GetDeathAnimation(); return MONSTER_DATA[id].GetDeathAnimation();
} }
bool Monster::Hurt(int damage,bool onUpperLevel){ bool Monster::Hurt(int damage,bool onUpperLevel){
if(hp<=0||onUpperLevel!=OnUpperLevel()) return false; if(hp<=0||onUpperLevel!=OnUpperLevel()||HasIframes()) return false;
float mod_dmg=damage; float mod_dmg=damage;
for(Buff&b:GetBuffs(BuffType::DAMAGE_REDUCTION)){ for(Buff&b:GetBuffs(BuffType::DAMAGE_REDUCTION)){
mod_dmg-=damage*b.intensity; mod_dmg-=damage*b.intensity;
@ -340,3 +342,7 @@ void Monster::InitializeStrategies(){
} }
STRATEGY_DATA.SetInitialized(); STRATEGY_DATA.SetInitialized();
} }
bool Monster::HasIframes(){
return iframe_timer>0;
}

@ -52,7 +52,7 @@ struct MonsterData{
struct Monster{ struct Monster{
friend struct STRATEGY; friend struct STRATEGY;
private: private:
int id=0; int id=0;
vf2d pos; vf2d pos;
vf2d vel={0,0}; vf2d vel={0,0};
@ -65,6 +65,8 @@ struct Monster{
float size; float size;
float attackCooldownTimer=0; float attackCooldownTimer=0;
float queueShotTimer=0; float queueShotTimer=0;
float z=0;
float iframe_timer=0;
Key facingDirection; Key facingDirection;
int strategy; int strategy;
State state=State::NORMAL; State state=State::NORMAL;
@ -123,6 +125,7 @@ public:
State GetState(); State GetState();
void SetState(State newState); void SetState(State newState);
static void InitializeStrategies(); static void InitializeStrategies();
bool HasIframes();
private: private:
struct STRATEGY{ struct STRATEGY{
static int _GetInt(Monster&m,std::string param,int strategyNumber,int index=0); static int _GetInt(Monster&m,std::string param,int strategyNumber,int index=0);

@ -304,7 +304,7 @@ void Player::Update(float fElapsedTime){
ability4.cooldown=0; ability4.cooldown=0;
} }
for(Monster&m:MONSTER_LIST){ for(Monster&m:MONSTER_LIST){
if(iframe_time==0&&OnUpperLevel()==m.OnUpperLevel()&&geom2d::overlaps(geom2d::circle(pos,12*size/2),geom2d::circle(m.GetPos(),12*m.GetSizeMult()/2))){ if(!HasIframes()&&OnUpperLevel()==m.OnUpperLevel()&&geom2d::overlaps(geom2d::circle(pos,12*size/2),geom2d::circle(m.GetPos(),12*m.GetSizeMult()/2))){
if(m.IsAlive()){ if(m.IsAlive()){
m.Collision(this); m.Collision(this);
} }
@ -485,7 +485,7 @@ bool Player::HasIframes(){
} }
bool Player::Hurt(int damage,bool onUpperLevel){ bool Player::Hurt(int damage,bool onUpperLevel){
if(hp<=0||iframe_time!=0||OnUpperLevel()!=onUpperLevel) return false; if(hp<=0||HasIframes()||OnUpperLevel()!=onUpperLevel) return false;
if(GetState()==State::BLOCK)damage*=1-"Warrior.Right Click Ability.DamageReduction"_F; if(GetState()==State::BLOCK)damage*=1-"Warrior.Right Click Ability.DamageReduction"_F;
float mod_dmg=damage; float mod_dmg=damage;
for(Buff&b:GetBuffs(BuffType::DAMAGE_REDUCTION)){ for(Buff&b:GetBuffs(BuffType::DAMAGE_REDUCTION)){

@ -25,6 +25,8 @@ first should be dodgeable. quite easily.
second needs to be blocked with movement skill or iframe (unless high movespeed, 110% shall not be enough to dodge this, 110% can be achived without any special gear as bard permanently) second needs to be blocked with movement skill or iframe (unless high movespeed, 110% shall not be enough to dodge this, 110% can be achived without any special gear as bard permanently)
third jump is a little slower that should allow a player with 100% movespeed to barely run out of it. third jump is a little slower that should allow a player with 100% movespeed to barely run out of it.
(Long delay -> Jump (Immediate Second Jump) -> (Slight Delay) Third Jump)
50%: 50%:
Size changes to 400% Size changes to 400%
Spawns 2 Slime adds (Monster C from Concept for now) Spawns 2 Slime adds (Monster C from Concept for now)

@ -2,7 +2,7 @@
#define VERSION_MAJOR 0 #define VERSION_MAJOR 0
#define VERSION_MINOR 2 #define VERSION_MINOR 2
#define VERSION_PATCH 0 #define VERSION_PATCH 0
#define VERSION_BUILD 1009 #define VERSION_BUILD 1011
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Loading…
Cancel
Save