Add shrapnel shot attack. Fix random dispersion of cannon shots (incorrect math that overcorrected for random angle + random distance vector). Release Build 11980.
This commit is contained in:
parent
c3261bb301
commit
27bfd8e1d4
@ -69,6 +69,18 @@ void Monster::STRATEGY::GHOST_OF_PIRATE_CAPTAIN(Monster&m,float fElapsedTime,std
|
||||
m.GetInt(A::CANNON_PHASE)=(m.GetInt(A::CANNON_PHASE)+1)%PHASE_COUNT;
|
||||
}};
|
||||
|
||||
if(m.F(A::SHRAPNEL_SHOT_FALL_TIMER)>0.f){
|
||||
m.F(A::SHRAPNEL_SHOT_FALL_TIMER)-=fElapsedTime;
|
||||
while(m.I(A::SHRAPNEL_SHOT_COUNT)&&m.F(A::SHRAPNEL_SHOT_FALL_TIMER)<=0.f){
|
||||
const float randomAng{util::random_range(0,2*PI)};
|
||||
const float range{util::random_range(0,ConfigPixels("Bombardment Max Distance"))};
|
||||
const vf2d targetPos{game->GetPlayer()->GetPos()+vf2d{range,randomAng}.cart()};
|
||||
m.F(A::SHRAPNEL_SHOT_FALL_TIMER)+=ConfigFloat("Shrapnel Shot Bullet Separation");
|
||||
CreateBullet(FallingBullet)("cannonball.png",targetPos,ConfigVec("Cannon Vel"),ConfigFloatArr("Cannon Vel",2),ConfigFloat("Indicator Time"),ConfigPixels("Shrapnel Shot Bullet Radius"),ConfigInt("Shrapnel Shot Damage"),m.OnUpperLevel(),false,ConfigFloat("Shrapnel Knockback Amt"),ConfigFloat("Shrapnel Shot Impact Time"),false,ConfigPixel("Cannon Spell Circle Color"),vf2d{ConfigFloat("Shrapnel Shot Bullet Radius")/100.f*1.75f,ConfigFloat("Shrapnel Shot Bullet Radius")/100.f*1.75f},util::random(2*PI),util::random(2*PI),util::degToRad(ConfigFloat("Cannon Spell Circle Rotation Spd")),ConfigPixel("Cannon Spell Insignia Color"),util::random(2*PI),util::degToRad(ConfigFloat("Cannon Spell Insignia Rotation Spd")))EndBullet;
|
||||
m.I(A::SHRAPNEL_SHOT_COUNT)--;
|
||||
}
|
||||
}
|
||||
|
||||
switch(PHASE()){
|
||||
case INIT:{
|
||||
for(int i:std::ranges::iota_view(0U,PHASE_COUNT)){
|
||||
@ -92,7 +104,7 @@ void Monster::STRATEGY::GHOST_OF_PIRATE_CAPTAIN(Monster&m,float fElapsedTime,std
|
||||
case BOMBARDMENT:{
|
||||
const float randomAng{util::random_range(0,2*PI)};
|
||||
const float range{util::random_range(0,ConfigPixels("Bombardment Max Distance"))};
|
||||
const vf2d targetPos{game->camera.GetTarget()-ConfigPixels("Bombardment Max Distance")/2.f+vf2d{range,randomAng}.cart()};
|
||||
const vf2d targetPos{game->GetPlayer()->GetPos()+vf2d{range,randomAng}.cart()};
|
||||
CreateBullet(FallingBullet)("cannonball.png",targetPos,ConfigVec("Cannon Vel"),ConfigFloatArr("Cannon Vel",2),ConfigFloat("Indicator Time"),ConfigPixels("Cannon Radius"),ConfigInt("Cannon Damage"),m.OnUpperLevel(),false,ConfigFloat("Cannon Knockback Amt"),ConfigFloat("Cannon Shot Impact Time"),false,ConfigPixel("Cannon Spell Circle Color"),vf2d{ConfigFloat("Cannon Radius")/100.f*1.75f,ConfigFloat("Cannon Radius")/100.f*1.75f},util::random(2*PI),util::random(2*PI),util::degToRad(ConfigFloat("Cannon Spell Circle Rotation Spd")),ConfigPixel("Cannon Spell Insignia Color"),util::random(2*PI),util::degToRad(ConfigFloat("Cannon Spell Insignia Rotation Spd")))EndBullet;
|
||||
}break;
|
||||
case PRECISE_BOMBARDMENT:{
|
||||
@ -115,7 +127,11 @@ void Monster::STRATEGY::GHOST_OF_PIRATE_CAPTAIN(Monster&m,float fElapsedTime,std
|
||||
if(m.F(A::CANNON_TIMER)>=ConfigFloat("Silence Time"))AdvanceCannonPhase();
|
||||
}break;
|
||||
case SHRAPNEL_SHOT:{
|
||||
if(m.F(A::CANNON_TIMER)>=ConfigFloat("Shrapnel Shot Delay"))AdvanceCannonPhase();
|
||||
if(m.F(A::CANNON_TIMER)>=ConfigFloat("Shrapnel Shot Delay")){
|
||||
m.I(A::SHRAPNEL_SHOT_COUNT)=ConfigInt("Shrapnel Shot Bullet Count");
|
||||
m.F(A::SHRAPNEL_SHOT_FALL_TIMER)=ConfigFloat("Shrapnel Shot Bullet Separation");
|
||||
AdvanceCannonPhase();
|
||||
}
|
||||
}break;
|
||||
}
|
||||
}break;
|
||||
|
||||
@ -167,4 +167,7 @@ enum class Attribute{
|
||||
CANNON_PHASE,
|
||||
CANNON_SHOT_TYPE,
|
||||
CANNON_PHASES,
|
||||
SHRAPNEL_SHOT_COUNT,
|
||||
SHRAPNEL_SHOT_FALL_TIMER,
|
||||
|
||||
};
|
||||
@ -39,7 +39,7 @@ All rights reserved.
|
||||
#define VERSION_MAJOR 1
|
||||
#define VERSION_MINOR 3
|
||||
#define VERSION_PATCH 0
|
||||
#define VERSION_BUILD 11972
|
||||
#define VERSION_BUILD 11980
|
||||
|
||||
#define stringify(a) stringify_(a)
|
||||
#define stringify_(a) #a
|
||||
|
||||
@ -1308,7 +1308,13 @@ MonsterStrategy
|
||||
Cannon Shot Impact Time = 2.5s
|
||||
Silence Time = 2s
|
||||
Shrapnel Shot Delay = 0.4s
|
||||
Sharpnel Shot Impact Time = 2.5s
|
||||
Shrapnel Shot Impact Time = 2.5s
|
||||
Shrapnel Shot Bullet Count = 25
|
||||
Shrapnel Shot Bullet Radius = 50
|
||||
Shrapnel Shot Damage = 35
|
||||
Shrapnel Knockback Amt = 100
|
||||
# Amount of time between each shrapnel shot appearing.
|
||||
Shrapnel Shot Bullet Separation = 0.015s
|
||||
|
||||
Bombardment Max Distance = 900
|
||||
Precise Bombardment Max Distance = 700
|
||||
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user