Esempio n. 1
0
int CreateMonsterball (void)
{
	short			nDropSeg, nObject;
	vmsVector	vSegCenter;

RemoveMonsterball ();
#ifdef _DEBUG
nDropSeg = gameData.hoard.nMonsterballSeg;
#else
nDropSeg = (gameData.hoard.nMonsterballSeg >= 0) ? 
			  gameData.hoard.nMonsterballSeg : ChooseDropSegment (NULL, NULL, EXEC_DROP);
#endif
if (nDropSeg >= 0) {
	COMPUTE_SEGMENT_CENTER_I (&vSegCenter, nDropSeg);
	nObject = DropPowerup (OBJ_POWERUP, POW_MONSTERBALL, -1, 1, &vZero, &vSegCenter, nDropSeg);
	if (nObject >= 0) {
		gameData.hoard.monsterballP = gameData.objs.objects + nObject;
		gameData.hoard.monsterballP->nType = OBJ_MONSTERBALL;
		gameData.hoard.monsterballP->mType.physInfo.mass = F1_0 * 10;
		gameData.hoard.nLastHitter = -1;
		CreatePlayerAppearanceEffect (gameData.hoard.monsterballP);
		return 1;
		}
	}
#ifndef _DEBUG
Warning (TXT_NO_MONSTERBALL);
#endif
gameData.app.nGameMode &= ~GM_MONSTERBALL;
return 0;
}
Esempio n. 2
0
void ThinkNoSlow( gentity_t *self )
{
    gitem_t *item = NULL;
    gentity_t *dropped = NULL;
    
    item = BG_FindItemForPowerup( self->powerupModelType );
    if(!item)
    {
        G_Printf("Error: couldn't find powerup.\n");
        return;
    }

    self->child = DropPowerup(self, item, TouchPowerupNoSlow, qfalse);
}
Esempio n. 3
0
void ThinkSlick( gentity_t *self )
{
    gitem_t *item = NULL;
    gentity_t *dropped = NULL;

    // FIXME: wrong PW_
    item = BG_FindItemForPowerup( self->powerupModelType );
    if(!item)
    {
        G_Printf("Error: couldn't find powerup.\n");
        return;
    }

    self->child = DropPowerup(self, item, TouchPowerupSlick, qfalse);
}
Esempio n. 4
0
void think_random( gentity_t *self )
{
    gitem_t *item = NULL;
    gentity_t *dropped = NULL;
    int i = rand() % numPowerups;

    // FIXME: wrong PW_
    item = BG_FindItemForPowerup( PW_RANDOM );
    if(!item)
    {
        G_Printf("Error: couldn't find powerup model.\n");
        return;
    }

    self->child = DropPowerup(self, item, powerups[i].touch, qfalse);
}