void castSkybaserForGhost(Mission* mission, Airplane* airplane, CatToy* ghost) { assert( ghost ); // detect cattoy level float cattoyLevel = 0.25f * ( ghost->getVirtues()->getEnduranceSkill() + ghost->getVirtues()->getPerceptionSkill() + ghost->getVirtues()->getRiggingSkill() + ghost->getVirtues()->getTrackingSkill() ); // detect player is a LICENSED_CHAR bool playerIsLicensed = mission->getScene()->getCareer()->getLicensedFlag(); // build list of same level npc std::vector<unsigned int> npcs; database::NPCInfo::select( cattoyLevel, 0.126f, !playerIsLicensed, npcs ); // select NPC unsigned int index = getCore()->getRandToolkit()->getUniformInt() % npcs.size(); unsigned int npcId = npcs[index]; // create NPC NPC* npc = new NPC( mission, npcId, airplane, NULL, ghost ); // devote ghost npc->devoteCattoy(); // setup cameraman behaviour npc->setProgram( new NPCCameraman( npc ) ); // setup brief signature npc->getJumper()->setSignatureType( stBrief ); }
NPC* castGhostNPC(Mission* mission, Enclosure* enclosure, CatToy* ghost, unsigned int npcId) { // create NPC NPC* npc = new NPC( mission, npcId, NULL, enclosure, ghost ); // setup cameraman behaviour npc->setProgram( new NPCCameraman( npc ) ); // setup brief signature npc->getJumper()->setSignatureType( stBrief ); return npc; }
void castingCallback_BASEVFF_PCA(Actor* parent) { Mission* mission = dynamic_cast<Mission*>( parent ); assert( mission ); // build forced equipment Virtues::Equipment equipment = selectBASEEquipment( mission->getScene()->getCareer(), mission->getScene()->getLocation()->getWindAmbient(), mission->getScene()->getLocation()->getWindBlast() ); // exit point Enclosure* exitPoint = parent->getScene()->getExitPointEnclosure( mission->getMissionInfo()->exitPointId ); // cast player on exit point mission->setPlayer( new Jumper( mission, NULL, exitPoint, NULL, NULL, &equipment ) ); // setup brief signature for player mission->getPlayer()->setSignatureType( stBrief ); // cast LICENSED_CHAR as assist base jumper unsigned int npcId = database::NPCInfo::getLicensedCharacterId(); if( mission->getScene()->getCareer()->getLicensedFlag() ) { npcId = database::NPCInfo::getRandomNonLicensedCharacter( mission->getScene()->getCareer()->getVirtues()->getSkillLevel(), 0.25f ); } NPC* joeBlack = new NPC( mission, npcId, NULL, exitPoint, CatToy::wrap( mission->getPlayer() ) ); joeBlack->setProgram( new NPCAssist( joeBlack, mission->getPlayer() ) ); // setup brief signature for LICENSED_CHAR joeBlack->getJumper()->setSignatureType( stBrief ); // cast instructor new instructor::BASEInstructor01( mission->getPlayer() ); new GoalStateOfHealth( mission->getPlayer() ); new GoalStateOfGear( mission->getPlayer() ); // play original music for this mission Gameplay::iGameplay->playSoundtrack( "./res/sounds/music/dirty_moleculas_action.ogg" ); }
NPC* castCameramanNPC(Mission* mission, Enclosure* enclosure, Jumper* player, std::vector<unsigned int>& npcs) { assert( npcs.size() ); if( npcs.size() ) { // select NPC unsigned int index = getCore()->getRandToolkit()->getUniformInt() % npcs.size(); unsigned int npcId = npcs[index]; npcs.erase( npcs.begin() + index ); // create NPC NPC* npc = new NPC( mission, npcId, NULL, enclosure, CatToy::wrap( player ) ); // setup cameraman behaviour npc->setProgram( new NPCCameraman( npc ) ); // setup brief signature npc->getJumper()->setSignatureType( stBrief ); return npc; } return NULL; }