Phase 3 patterns implemented.

pull/28/head
sigonasr2 1 year ago
parent cf782c29bb
commit 76d45f2563
  1. 21
      Crawler/SlimeKing.cpp
  2. 2
      Crawler/Version.h
  3. 6
      Crawler/assets/config/MonsterStrategies.txt
  4. 2
      Crawler/assets/config/Monsters.txt

@ -108,7 +108,7 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,int strategyNumbe
if(m.GetState()==State::RECOVERY){
m.F(A::RECOVERY_TIME)=std::max(0.f,m.F(A::RECOVERY_TIME)-fElapsedTime);
if(m.F(A::RECOVERY_TIME)==0){
m.GetState()==State::NORMAL;
m.SetState(State::NORMAL);
Recovered();
}
return;
@ -253,6 +253,25 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,int strategyNumbe
TransitionPhase(m.phase);
return;
}
if(m.I(A::PATTERN_REPEAT_COUNT)==0){
StartJump(ConfigFloat("Phase3.JumpDelayTime"),game->GetPlayer()->GetPos(),ConfigFloat("Phase3.JumpRecoveryTime"),ConfigFloat("Phase3.JumpMoveSpd"));
m.I(A::PATTERN_REPEAT_COUNT)++;
}else
if(m.I(A::PATTERN_REPEAT_COUNT)<4&&m.F(A::SHOOT_TIMER)==0){
m.F(A::SHOOT_TIMER)=ConfigFloat("Phase3.ShootRate");
m.I(A::PATTERN_REPEAT_COUNT)++;
int bulletCount=ConfigInt("Phase3.ShootProjectileCount");
for(int i=0;i<bulletCount;i++){
float initialAngle=util::angleTo(m.GetPos(),game->GetPlayer()->GetPos());
float angle=(i-(bulletCount/2))*util::degToRad(ConfigFloat("Phase3.ShootAngleSpread"))+initialAngle;
BULLET_LIST.emplace_back(std::make_unique<Bullet>(m.GetPos(),vf2d{cos(angle),sin(angle)}*bulletSpd,6,ConfigInt("ProjectileDamage"),m.OnUpperLevel(),false,YELLOW,vf2d{6,6}));
}
}else
if(m.I(A::PATTERN_REPEAT_COUNT)>=4){
m.F(A::RECOVERY_TIME)=ConfigFloat("Phase3.PhaseRecoveryTime");
m.SetState(State::RECOVERY);
m.I(A::PATTERN_REPEAT_COUNT)=0;
}
}break;
case 4:{
if(m.hp<=0){

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

@ -86,7 +86,7 @@ MonsterStrategy
# How far the player gets knocked back if hit.
JumpKnockbackFactor = 250
BulletSpd = 250
BulletSpd = 350
Phase1
{
@ -129,9 +129,13 @@ MonsterStrategy
# Percentage of health to transition to Phase 3
Change = 50%
MonsterSpawnOnChange = Red Slime, 2
PhaseRecoveryTime = 2.0
ShootRate = 0.5
ShootProjectileCount = 3
ShootAngleSpread = 45
JumpMoveSpd = 170
JumpDelayTime = 0.5
JumpRecoveryTime = 2.0
}

@ -139,7 +139,7 @@ Monsters
Size = 800
Strategy = Slime King
StartPhase = 2
StartPhase = 3
#Size of each animation frame
SheetFrameSize = 24,24

Loading…
Cancel
Save