MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / SpawnCreatureGunEffect

Function SpawnCreatureGunEffect

TombEngine/Game/effects/effects.cpp:1983–2002  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1981}
1982
1983void SpawnCreatureGunEffect(const ItemInfo& item, const CreatureMuzzleFlashInfo& muzzleFlash)
1984{
1985 constexpr auto CREATURE_GUN_EFFECT_VERTICAL_OFFSET = 75;
1986 constexpr auto CREATURE_GUN_EFFECT_LIGHT_FALLOFF = 15.0f * (float)UCHAR_MAX;
1987
1988 if (muzzleFlash.Delay == 0)
1989 return;
1990
1991 auto intensity = Random::GenerateFloat(0.75f, 1.0f);
1992 auto muzzlePos = muzzleFlash.Bite;
1993 auto pos = GetJointPosition(item, muzzlePos);
1994 SpawnDynamicPointLight(pos.ToVector3(), CREATURE_GUNFLASH_COLOR * intensity, CREATURE_GUN_EFFECT_LIGHT_FALLOFF * intensity);
1995
1996 if (muzzleFlash.UseSmoke)
1997 {
1998 muzzlePos.Position.y -= CREATURE_GUN_EFFECT_VERTICAL_OFFSET;
1999 auto smokePos = GetJointPosition(item, muzzlePos);
2000 SpawnGunSmokeParticles(smokePos.ToVector3(), Vector3::Zero, item.RoomNumber, 1, LaraWeaponType::Pistol, 12);
2001 }
2002}
2003
2004void SpawnPlayerWaterSurfaceEffects(const ItemInfo& item, int waterHeight, int waterDepth)
2005{

Callers 1

CreatureAnimationFunction · 0.85

Calls 5

GenerateFloatFunction · 0.85
GetJointPositionFunction · 0.85
SpawnDynamicPointLightFunction · 0.85
SpawnGunSmokeParticlesFunction · 0.85
ToVector3Method · 0.45

Tested by

no test coverage detected