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

pull/28/head
sigonasr2 1 year ago
parent b1885a1c1e
commit 49940fdba1
  1. 16
      Crawler/Crawler.cpp
  2. 4
      Crawler/Crawler.vcxproj.filters
  3. 47
      Crawler/Crawler_Slime_King_Encounter.txt
  4. 38
      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,11 +448,9 @@ void Crawler::UpdateBullets(float fElapsedTime){
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->hitsMultiple){
if(b->MonsterHit(m)){
it=BULLET_LIST.erase(it);
if(it==BULLET_LIST.end()){
goto outsideBulletLoop;
}
it=BULLET_LIST.erase(it);
if(it==BULLET_LIST.end()){
goto outsideBulletLoop;
}
goto continueBulletLoop;
}
@ -463,11 +461,9 @@ void Crawler::UpdateBullets(float fElapsedTime){
} else {
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(b->PlayerHit(GetPlayer())){
it=BULLET_LIST.erase(it);
if(it==BULLET_LIST.end()){
goto outsideBulletLoop;
}
it=BULLET_LIST.erase(it);
if(it==BULLET_LIST.end()){
goto outsideBulletLoop;
}
goto continueBulletLoop;
}

@ -244,7 +244,6 @@
<Text Include="NewClasses.txt">
<Filter>Documentation</Filter>
</Text>
<Text Include="Slime_King_Encounter.txt" />
<Text Include="assets\config\configuration.txt">
<Filter>Configurations</Filter>
</Text>
@ -281,6 +280,9 @@
<Text Include="assets\config\MonsterStrategies.txt">
<Filter>Configurations</Filter>
</Text>
<Text Include="Slime_King_Encounter.txt">
<Filter>Documentation</Filter>
</Text>
</ItemGroup>
<ItemGroup>
<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,23 +117,25 @@ bool Monster::Update(float fElapsedTime){
if(it==buffList.end())break;
}
}
for(Monster&m:MONSTER_LIST){
if(&m==this)continue;
if(OnUpperLevel()==m.OnUpperLevel()&&geom2d::overlaps(geom2d::circle(pos,12*size/2),geom2d::circle(m.GetPos(),12*m.GetSizeMult()/2))){
m.Collision(*this);
geom2d::line line(pos,m.GetPos());
float dist = line.length();
m.SetPosition(line.rpoint(dist*1.1));
if(m.IsAlive()){
vel=line.vector().norm()*-128;
if(!HasIframes()){
for(Monster&m:MONSTER_LIST){
if(&m==this)continue;
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);
geom2d::line line(pos,m.GetPos());
float dist = line.length();
m.SetPosition(line.rpoint(dist*1.1));
if(m.IsAlive()){
vel=line.vector().norm()*-128;
}
}
}
}
if(!game->GetPlayer()->HasIframes()&&game->GetPlayer()->OnUpperLevel()==OnUpperLevel()&&geom2d::overlaps(geom2d::circle(pos,12*size/2),geom2d::circle(game->GetPlayer()->GetPos(),12*game->GetPlayer()->GetSizeMult()/2))){
geom2d::line line(pos,game->GetPlayer()->GetPos());
float dist = line.length();
SetPosition(line.rpoint(-0.1));
vel=line.vector().norm()*-128;
if(!game->GetPlayer()->HasIframes()&&game->GetPlayer()->OnUpperLevel()==OnUpperLevel()&&geom2d::overlaps(geom2d::circle(pos,12*size/2),geom2d::circle(game->GetPlayer()->GetPos(),12*game->GetPlayer()->GetSizeMult()/2))){
geom2d::line line(pos,game->GetPlayer()->GetPos());
float dist = line.length();
SetPosition(line.rpoint(-0.1));
vel=line.vector().norm()*-128;
}
}
if(GetState()==State::NORMAL){
if(game->GetPlayer()->GetX()>pos.x){
@ -221,7 +223,7 @@ std::string Monster::GetDeathAnimationName(){
return MONSTER_DATA[id].GetDeathAnimation();
}
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;
for(Buff&b:GetBuffs(BuffType::DAMAGE_REDUCTION)){
mod_dmg-=damage*b.intensity;
@ -339,4 +341,8 @@ void Monster::InitializeStrategies(){
readCounter++;
}
STRATEGY_DATA.SetInitialized();
}
bool Monster::HasIframes(){
return iframe_timer>0;
}

@ -52,7 +52,7 @@ struct MonsterData{
struct Monster{
friend struct STRATEGY;
private:
private:
int id=0;
vf2d pos;
vf2d vel={0,0};
@ -65,6 +65,8 @@ struct Monster{
float size;
float attackCooldownTimer=0;
float queueShotTimer=0;
float z=0;
float iframe_timer=0;
Key facingDirection;
int strategy;
State state=State::NORMAL;
@ -123,6 +125,7 @@ public:
State GetState();
void SetState(State newState);
static void InitializeStrategies();
bool HasIframes();
private:
struct STRATEGY{
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;
}
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()){
m.Collision(this);
}
@ -485,7 +485,7 @@ bool Player::HasIframes(){
}
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;
float mod_dmg=damage;
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)
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%:
Size changes to 400%
Spawns 2 Slime adds (Monster C from Concept for now)

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Loading…
Cancel
Save