From 49940fdba11146447bc420ba525f40437a035501 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Sun, 13 Aug 2023 22:32:04 -0500 Subject: [PATCH] Mobs can now have ifreames. Add in documentation for slime king encounter and prep a spritesheet for it. --- Crawler/Crawler.cpp | 16 +++----- Crawler/Crawler.vcxproj.filters | 4 +- Crawler/Crawler_Slime_King_Encounter.txt | 47 +++++++++++++++++++++++ Crawler/Monster.cpp | 38 ++++++++++-------- Crawler/Monster.h | 5 ++- Crawler/Player.cpp | 4 +- Crawler/Slime_King_Encounter.txt | 2 + Crawler/Version.h | 2 +- Crawler/assets/monsters/Slime King.png | Bin 0 -> 2749 bytes 9 files changed, 87 insertions(+), 31 deletions(-) create mode 100644 Crawler/Crawler_Slime_King_Encounter.txt create mode 100644 Crawler/assets/monsters/Slime King.png diff --git a/Crawler/Crawler.cpp b/Crawler/Crawler.cpp index a7e88175..a06eecf7 100644 --- a/Crawler/Crawler.cpp +++ b/Crawler/Crawler.cpp @@ -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; } diff --git a/Crawler/Crawler.vcxproj.filters b/Crawler/Crawler.vcxproj.filters index 7546d61c..901c4caf 100644 --- a/Crawler/Crawler.vcxproj.filters +++ b/Crawler/Crawler.vcxproj.filters @@ -244,7 +244,6 @@ Documentation - Configurations @@ -281,6 +280,9 @@ Configurations + + Documentation + diff --git a/Crawler/Crawler_Slime_King_Encounter.txt b/Crawler/Crawler_Slime_King_Encounter.txt new file mode 100644 index 00000000..9fcf4c10 --- /dev/null +++ b/Crawler/Crawler_Slime_King_Encounter.txt @@ -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. \ No newline at end of file diff --git a/Crawler/Monster.cpp b/Crawler/Monster.cpp index 56e907c9..20e6418f 100644 --- a/Crawler/Monster.cpp +++ b/Crawler/Monster.cpp @@ -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; } \ No newline at end of file diff --git a/Crawler/Monster.h b/Crawler/Monster.h index a5899388..9ad37c39 100644 --- a/Crawler/Monster.h +++ b/Crawler/Monster.h @@ -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); diff --git a/Crawler/Player.cpp b/Crawler/Player.cpp index 40fb62e3..47668964 100644 --- a/Crawler/Player.cpp +++ b/Crawler/Player.cpp @@ -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)){ diff --git a/Crawler/Slime_King_Encounter.txt b/Crawler/Slime_King_Encounter.txt index 9fcf4c10..9404bc20 100644 --- a/Crawler/Slime_King_Encounter.txt +++ b/Crawler/Slime_King_Encounter.txt @@ -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) diff --git a/Crawler/Version.h b/Crawler/Version.h index 34b88913..15a447f4 100644 --- a/Crawler/Version.h +++ b/Crawler/Version.h @@ -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 diff --git a/Crawler/assets/monsters/Slime King.png b/Crawler/assets/monsters/Slime King.png new file mode 100644 index 0000000000000000000000000000000000000000..81c735922e9af4b1923791f8e06ce62cd33ce531 GIT binary patch literal 2749 zcmY*b3p5k#8=pyT5h2%dmp{3re0(Y!Gc0pYBbP-!C`>_fNlZ0;Jp2Nuu3=5-65yNeB7!E zlD>G&>SC8`z2^b(>V|>(v`^K@fv)_j*XCl4Lc*Ym|Z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