Added particle effects for slime king jump and landing.

pull/28/head
sigonasr2 1 year ago
parent 14564d814d
commit 43b5503661
  1. 1
      Crawler/Crawler.vcxproj
  2. 3
      Crawler/Crawler.vcxproj.filters
  3. 19
      Crawler/FallingDebris.h
  4. 3
      Crawler/SlimeKing.cpp
  5. 2
      Crawler/Version.h
  6. 1
      Crawler/assets/config/MonsterStrategies.txt

@ -302,6 +302,7 @@
<ClCompile Include="Effect.cpp" /> <ClCompile Include="Effect.cpp" />
<ClCompile Include="Emitter.cpp" /> <ClCompile Include="Emitter.cpp" />
<ClCompile Include="EnergyBolt.cpp" /> <ClCompile Include="EnergyBolt.cpp" />
<ClCompile Include="FallingDebris.h" />
<ClCompile Include="FireBolt.cpp" /> <ClCompile Include="FireBolt.cpp" />
<ClCompile Include="LightningBolt.cpp" /> <ClCompile Include="LightningBolt.cpp" />
<ClCompile Include="LightningBoltEmitter.cpp" /> <ClCompile Include="LightningBoltEmitter.cpp" />

@ -239,6 +239,9 @@
<ClCompile Include="SlimeKing.cpp"> <ClCompile Include="SlimeKing.cpp">
<Filter>Source Files\Monster Strategies</Filter> <Filter>Source Files\Monster Strategies</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="FallingDebris.h">
<Filter>Source Files\Effects</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="cpp.hint" /> <None Include="cpp.hint" />

@ -0,0 +1,19 @@
#include "Effect.h"
#include "DEFINES.h"
#include "safemap.h"
INCLUDE_GFX
class FallingDebris:public Effect{
const float GRAVITY=20;
public:
inline FallingDebris(vf2d pos, float lifetime, std::string imgFile, bool upperLevel,vf2d size={1,1},float fadeout=0.0f,vf2d spd={},Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false)
:Effect(pos,lifetime,imgFile,upperLevel,size,fadeout,spd,col,rotation,rotationSpd,additiveBlending){
}
inline bool Update(float fElapsedTime)override{
spd.y+=GRAVITY*fElapsedTime;
return Effect::Update(fElapsedTime);
}
};

@ -5,6 +5,7 @@
#include "utils.h" #include "utils.h"
#include "safemap.h" #include "safemap.h"
#include "Effect.h" #include "Effect.h"
#include "FallingDebris.h"
INCLUDE_game INCLUDE_game
INCLUDE_BULLET_LIST INCLUDE_BULLET_LIST
@ -69,7 +70,7 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,int strategyNumbe
float dist=lineToPlayer.length(); float dist=lineToPlayer.length();
for(int i=0;i<200;i++){ for(int i=0;i<200;i++){
float randomDir=util::random(2*PI); float randomDir=util::random(2*PI);
//game->AddEffect(Effect{vf2d{cos(randomDir),sin(randomDir)}*m.GetSizeMult()*8,util::random(1),}) game->AddEffect(std::make_unique<FallingDebris>(m.GetPos()+vf2d{cos(randomDir),sin(randomDir)}*m.GetSizeMult()*8,util::random(1),"circle.png",m.OnUpperLevel(),vf2d{1,1},0.5,vf2d{cos(randomDir)*util::random(5),sin(randomDir)*-util::random(15)-5}*30,BLACK),true);
} }
if(dist<12*m.GetSizeMult()){ if(dist<12*m.GetSizeMult()){
game->GetPlayer()->Hurt(ConfigInt("JumpAttackDamage"),m.OnUpperLevel(),m.GetZ()); game->GetPlayer()->Hurt(ConfigInt("JumpAttackDamage"),m.OnUpperLevel(),m.GetZ());

@ -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 1324 #define VERSION_BUILD 1330
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a

@ -79,6 +79,7 @@ MonsterStrategy
ProjectileDamage = 10 ProjectileDamage = 10
JumpAttackDamage = 20 JumpAttackDamage = 20
JumpMoveSpd = 75 JumpMoveSpd = 75
# How far the player gets knocked back if hit.
JumpKnockbackFactor = 250 JumpKnockbackFactor = 250
BulletSpd = 250 BulletSpd = 250

Loading…
Cancel
Save