当前位置: 首页>>代码示例>>C++>>正文


C++ NPC::setProgram方法代码示例

本文整理汇总了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 );
}
开发者ID:AndreMeijer86,项目名称:base-pro-edition,代码行数:35,代码来源:dropzone_skybase.cpp

示例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;
}
开发者ID:AndreMeijer86,项目名称:base-pro-edition,代码行数:10,代码来源:ostankino_openair.cpp

示例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" );
}
开发者ID:cheinkn,项目名称:basextreme,代码行数:43,代码来源:dropzone_basevff.cpp

示例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;
}
开发者ID:AndreMeijer86,项目名称:base-pro-edition,代码行数:21,代码来源:ostankino_openair.cpp


注:本文中的NPC::setProgram方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。