Mobs can now have ifreames. Add in documentation for slime king encounter and prep a spritesheet for it.
This commit is contained in:
parent
b7402b2bfa
commit
3a4f6c8b18
@ -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(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;
|
||||||
}
|
}
|
||||||
@ -463,11 +461,9 @@ 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">
|
||||||
|
47
Crawler/Crawler_Slime_King_Encounter.txt
Normal file
47
Crawler/Crawler_Slime_King_Encounter.txt
Normal file
@ -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;
|
if(it==buffList.end())break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(Monster&m:MONSTER_LIST){
|
if(!HasIframes()){
|
||||||
if(&m==this)continue;
|
for(Monster&m:MONSTER_LIST){
|
||||||
if(OnUpperLevel()==m.OnUpperLevel()&&geom2d::overlaps(geom2d::circle(pos,12*size/2),geom2d::circle(m.GetPos(),12*m.GetSizeMult()/2))){
|
if(&m==this)continue;
|
||||||
m.Collision(*this);
|
if(!m.HasIframes()&&OnUpperLevel()==m.OnUpperLevel()&&geom2d::overlaps(geom2d::circle(pos,12*size/2),geom2d::circle(m.GetPos(),12*m.GetSizeMult()/2))){
|
||||||
geom2d::line line(pos,m.GetPos());
|
m.Collision(*this);
|
||||||
float dist = line.length();
|
geom2d::line line(pos,m.GetPos());
|
||||||
m.SetPosition(line.rpoint(dist*1.1));
|
float dist = line.length();
|
||||||
if(m.IsAlive()){
|
m.SetPosition(line.rpoint(dist*1.1));
|
||||||
vel=line.vector().norm()*-128;
|
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))){
|
||||||
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());
|
||||||
geom2d::line line(pos,game->GetPlayer()->GetPos());
|
float dist = line.length();
|
||||||
float dist = line.length();
|
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){
|
||||||
@ -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
|
||||||
|
BIN
Crawler/assets/monsters/Slime King.png
Normal file
BIN
Crawler/assets/monsters/Slime King.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.7 KiB |
Loading…
x
Reference in New Issue
Block a user