Skip to content

Commit 34865e0

Browse files
committed
'Lay Crabs Policy' parameter for info_bigmomma
1 parent 017c1a9 commit 34865e0

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

dlls/bigmomma.cpp

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@
3535
#define SF_BIGMOM_NOBABYCRABS SF_MONSTER_DONT_DROP_GUN
3636
#define SF_MONSTERCLIP_BABYCRABS SF_MONSTER_SPECIAL_FLAG
3737

38+
enum
39+
{
40+
LAYCRABS_NOCHANGE = 0,
41+
LAYCRABS_ON,
42+
LAYCRABS_OFF,
43+
LAYCRABS_TOGGLE,
44+
};
45+
3846
// AI Nodes for Big Momma
3947
class CInfoBM : public CPointEntity
4048
{
@@ -92,6 +100,11 @@ void CInfoBM::KeyValue( KeyValueData* pkvd )
92100
m_preSequence = ALLOC_STRING( pkvd->szValue );
93101
pkvd->fHandled = true;
94102
}
103+
else if( FStrEq( pkvd->szKeyName, "laycrabs" ) )
104+
{
105+
pev->weapons = atoi( pkvd->szValue );
106+
pkvd->fHandled = true;
107+
}
95108
else
96109
CPointEntity::KeyValue( pkvd );
97110
}
@@ -268,6 +281,16 @@ class CBigMomma : public CBaseMonster
268281
return pev->angles.y;
269282
}
270283

284+
int GetNodeLayCrabs( void )
285+
{
286+
CInfoBM *pTarget = GetTargetInfoBM();
287+
if( pTarget )
288+
{
289+
return pTarget->pev->weapons;
290+
}
291+
return 0;
292+
}
293+
271294
// Restart the crab count on each new level
272295
void OverrideReset( void )
273296
{
@@ -1052,6 +1075,32 @@ void CBigMomma::StartTask( Task_t *pTask )
10521075
SetState( MONSTERSTATE_ALERT );
10531076
}
10541077

1078+
{
1079+
const int layCrabs = GetNodeLayCrabs();
1080+
switch (layCrabs) {
1081+
case LAYCRABS_OFF:
1082+
SetBits(pev->spawnflags, SF_BIGMOM_NOBABYCRABS);
1083+
break;
1084+
case LAYCRABS_ON:
1085+
ClearBits(pev->spawnflags, SF_BIGMOM_NOBABYCRABS);
1086+
break;
1087+
case LAYCRABS_TOGGLE:
1088+
{
1089+
if (FBitSet(pev->spawnflags, SF_BIGMOM_NOBABYCRABS))
1090+
{
1091+
ClearBits(pev->spawnflags, SF_BIGMOM_NOBABYCRABS);
1092+
}
1093+
else
1094+
{
1095+
SetBits(pev->spawnflags, SF_BIGMOM_NOBABYCRABS);
1096+
}
1097+
}
1098+
break;
1099+
default:
1100+
break;
1101+
}
1102+
}
1103+
10551104
const float delay = GetNodeDelay();
10561105
if (g_modFeatures.bigmomma_wait_fix)
10571106
{

fgd/halflife.fgd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3580,6 +3580,13 @@
35803580
reachsequence(string) : "Sequence on approach" : ""
35813581
health(string) : "Health on approach" : ""
35823582
presequence(string) : "Sequence before approach" : ""
3583+
laycrabs(choices) : "Lay Crabs Policy" =
3584+
[
3585+
0 : "No Change"
3586+
1 : "Start Laying Crabs"
3587+
2 : "Stop Laying Crabs"
3588+
3 : "Toggle Laying Crabs"
3589+
]
35833590
]
35843591

35853592
// Displacer target placement represents the point where the player's feet shall be

0 commit comments

Comments
 (0)