本文整理汇总了C++中NPC::setProgram方法的典型用法代码示例。如果您正苦于以下问题:C++ NPC::setProgram方法的具体用法?C++ NPC::setProgram怎么用?C++ NPC::setProgram使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NPC
的用法示例。
在下文中一共展示了NPC::setProgram方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: castSkybaserForGhost
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 );
}
示例2: castGhostNPC
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;
}
示例3: castingCallback_BASEVFF_PCA
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" );
}
示例4: castCameramanNPC
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;
}