|
This article or section is outdated and has not been fully updated to reflect the current version of SRB2.
Please help the Wiki by correcting or removing any misinformation, as well as adding any new information to the page.
|
|
To do Update for 2.2.0:
- If the actor has
MF2_AMBUSH , no sounds are played
|
A_SetSolidSteam is an action that is used to make the Gas Jet become solid so it collides with players to boost them upwards – it does this by modifying the actor's flags so that MF_NOCLIP
is removed from them and MF_SOLID
is added to them. A_SetSolidSteam
also plays the Gas Jet's "hiss" sound to signal when the player can be boosted upwards, the sound for which is a random choice between either the actor's PainSound
(1/8 chance of occurring) or DeathSound
(7/8 chance of occurring). Note that P_SetObjectMomZ
is also called by this action, to ensure other Objects can collide with the actor afterwards during the same tic.
The action A_UnsetSolidSteam
is used to undo the changes to the actor's flags made by this action, so that the actor becomes intangible again.
Code – A_SetSolidSteam
|
|
// Function: A_SetSolidSteam
//
// Description: Makes steam solid so it collides with the player to boost them.
//
// var1 = unused
// var2 = unused
//
void A_SetSolidSteam(mobj_t *actor)
{
#ifdef HAVE_BLUA
if (LUA_CallAction("A_SetSolidSteam", actor))
return;
#endif
actor->flags &= ~MF_NOCLIP;
actor->flags |= MF_SOLID;
if (!(actor->flags2 & MF2_AMBUSH))
{
if (P_RandomChance(FRACUNIT/8))
{
if (actor->info->deathsound)
S_StartSound(actor, actor->info->deathsound); // Hiss!
}
else
{
if (actor->info->painsound)
S_StartSound(actor, actor->info->painsound);
}
}
P_SetObjectMomZ (actor, 1, true);
}
|
|