예제 #1
0
void WeaponManager::Init(int numOfBullets)
{
	const char * weaponName = mWeaponsName[mCurrentWeaponIndex].GetPtr();
	SoldierWeapon * pSoldierWeapon = (SoldierWeapon*)mWeaponsMap.GetByKey(weaponName);
	
	mCurrentWeapon = pSoldierWeapon;
	mCurrentWeapon->GetModelData()->GetRoot()->SetVisible(true);

	InitBullets(numOfBullets);
}
예제 #2
0
byte InitLevel(byte map)
{
	JamulSoundPurge(); // each level, that should be good

	if (curWorld.numMaps <= map)
		return 0; // can't go to illegal map

	// make a copy of the map to be played
	curMap = new Map(curWorld.map[map]);

	curMapFlags = curMap->flags;

	switch (PlayerGetMusicSettings()) {
		case MUSIC_OFF:
			CDStop(); // in case it's playing for some reason
			break;
		case MUSIC_ON:
			CDPlay(curMap->song);
			break;
		case MUSIC_RAND:
			break; // do nothing- if there is a song currently playing, let it finish, else a new
			// one will automatically start at the next call to CDPlayerUpdate
	}

	gameStartTime = timeGetTime();
	tickerTime = timeGetTime();
	updFrameCount = 0;
	visFrameCount = 0;
	numRunsToMakeUp = 0;
	frmRate = 30.0f;
	visFrms = 0;
	if (msgFromOtherModules != MSG_NEWFEATURE)
		msgFromOtherModules = 0;

	InitGuys(256);
	InitBullets();
	InitPlayer(INIT_LEVEL, 0, map);
	InitMessage();
	NewBigMessage(curMap->name, 100);
	InitParticles(512);
	lastKey = 0;
	curMap->Init(&curWorld);

	windingDown = 0;
	windingUp = 30;
	ResetInterface();
	InitCheater();

	SetGiveUpText((byte) (map != 0));

	return 1;
}