Пример #1
0
void Enemy::Reset(int index, BulletManager * bulletManager)
{
	//1 = enemy, 2 = boss
	if (index == 1)
	{
		position.y = -32;
		position.x = (rand()%150)+1;
	}
	
	if (index == 2)
	{
		position.x = (rand()%150)+1;
		position.y = -64;
		SetHull(GetMaxHull());
		SetShields(GetMaxShields());
		SetArmor(GetMaxArmor());
	}
}
Пример #2
0
void CObject::Initialize (ubyte nType, ubyte nId, short nCreator, short nSegment, const CFixVector& vPos,
								  const CFixMatrix& mOrient, fix xSize, ubyte cType, ubyte mType, ubyte rType)
{
SetSignature (gameData.objs.nNextSignature++);
SetType (nType);
SetId (nId);
SetLastPos (vPos);
SetSize (xSize);
SetCreator ((sbyte) nCreator);
SetOrient (&mOrient);
SetControlType (cType);
SetMovementType (mType);
SetRenderType (rType);
SetContainsType (-1);
SetLifeLeft (
	 ((gameData.app.nGameMode & GM_ENTROPY) &&  (nType == OBJ_POWERUP) &&  (nId == POW_HOARD_ORB) &&  (extraGameInfo [1].entropy.nVirusLifespan > 0)) ?
		I2X (extraGameInfo [1].entropy.nVirusLifespan) : IMMORTAL_TIME);
SetAttachedObj (-1);
SetShields (I2X (20));
SetSegment (-1);					//set to zero by memset, above
LinkToSeg (nSegment);
}