FX_Impact: Spawn water splash sprite when shooting at water volumes.

This commit is contained in:
Marco Cawthorne 2022-03-10 18:58:40 -08:00
parent 31e6ff118a
commit 150d5a2541
Signed by: eukara
GPG Key ID: C196CD8BA993248A
1 changed files with 17 additions and 0 deletions

View File

@ -79,6 +79,8 @@ FX_Impact_Init(void)
DECAL_IMPACT_TILE = particleeffectnum("decal_impact.tile");
DECAL_IMPACT_WOOD = particleeffectnum("decal_impact.wood");
DECAL_IMPACT_CONCRETE = particleeffectnum("decal_impact.concrete");
precache_model("sprites/wsplash3.spr");
}
#endif
@ -152,6 +154,21 @@ FX_Impact(impactType_t iType, vector vecPos, vector vNormal)
case IMPACT_METAL:
pointparticles(FX_IMPACT_SPARK, vecPos, vNormal, 1);
pointparticles(FX_IMPACT_BLACKBITS, vecPos, vNormal, 1);
break;
case IMPACT_SLOSH:
env_sprite splash = spawn(env_sprite);
setorigin(splash, vecPos + [0,0,24]);
setmodel(splash, "sprites/wsplash3.spr");
splash.SetRenderMode(RM_ADDITIVE);
splash.SetRenderAmt(1.0f);
splash.SetRenderColor([1,1,1]);
splash.drawmask = MASK_ENGINE;
splash.maxframe = modelframecount(splash.modelindex);
splash.loops = 0;
splash.framerate = 20;
splash.nextthink = time + 0.05f;
break;
case IMPACT_FLESH:
FX_Blood(vecPos, vNormal);