本文整理汇总了C++中Datapad::removeMission方法的典型用法代码示例。如果您正苦于以下问题:C++ Datapad::removeMission方法的具体用法?C++ Datapad::removeMission怎么用?C++ Datapad::removeMission使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Datapad
的用法示例。
在下文中一共展示了Datapad::removeMission方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: missionFailedEntertainer
void MissionManager::missionFailedEntertainer(PlayerObject* player)
{
Datapad* datapad = dynamic_cast<Datapad*>(player->getEquipManager()->getEquippedObject(CreatureEquipSlot_Datapad));
if(datapad->hasMission()) //player has a mission
{
MissionList::iterator it = datapad->getMissions()->begin();
while(it != datapad->getMissions()->end())
{
MissionObject* mission = dynamic_cast<MissionObject*>(*it);
if(mission->getMissionType() == dancer || mission->getMissionType() == musician)
{
if(!mission->getInProgress()) { ++it; continue; }
if(glm::distance(player->mPosition, mission->getDestination().Coordinates) < 20)
{
missionFailed(player,mission);
it = datapad->removeMission(it);
delete mission;
return;
}
}
++it;
}
}
}
示例2: checkCraftingMission
bool MissionManager::checkCraftingMission(PlayerObject* player,NPCObject* npc)
{
Datapad* datapad = dynamic_cast<Datapad*>(player->getEquipManager()->getEquippedObject(CreatureEquipSlot_Datapad));
if(datapad->hasMission()) //player has a mission
{
MissionList::iterator it = datapad->getMissions()->begin();
while(it != datapad->getMissions()->end())
{
MissionObject* mission = dynamic_cast<MissionObject*>(*it);
if(mission->getMissionType() == crafting)
{
if(mission->getStartNPC() == npc)
{
//This is the start npc for the deliver mission
char mp[10];
sprintf(mp,"m%dp",mission->getNum());
gMessageLib->sendSpatialChat(npc,player,L"",mission->getTitleFile(),mp);
mission->setStartNPC(NULL);
gMessageLib->sendSystemMessage(player,L"","mission/mission_generic","deliver_received_data");
MissionObject* updater = new MissionObject();
updater->clear();
updater->setId(mission->getId());
updater->getWaypoint()->setId(mission->getId()+1);
updater->getWaypoint()->setCoords(mission->getDestination().Coordinates);
updater->getWaypoint()->setPlanetCRC(mission->getDestination().PlanetCRC);
char name[150];
sprintf(name, "@%s:%s",mission->getTitleFile().getRawData(),mission->getTitle().getRawData());
updater->getWaypoint()->setName(name);
updater->getWaypoint()->setActive(true);
gMessageLib->sendMISO_Delta(updater,player);
delete updater;
return true;
}
else if(mission->getDestinationNPC() == npc && mission->getStartNPC() == NULL)
{
//This is the end npc for the deliver mission.
char mr[10];
sprintf(mr,"m%dr",mission->getNum());
gMessageLib->sendSpatialChat(npc,player,L"",mission->getTitleFile(),mr);
missionComplete(player,mission);
mission->setDestinationNPC(NULL);
it = datapad->removeMission(it);
delete mission;
return true;
}
}
++it;
}
}
return false;
}
示例3: checkReconMission
bool MissionManager::checkReconMission(MissionObject* mission)
{
if (mission->getMissionType() != recon) return false;
if(glm::distance(mission->getOwner()->mPosition, mission->getDestination().Coordinates) < 20)
{
Datapad* datapad = dynamic_cast<Datapad*>(mission->getOwner()->getEquipManager()->getEquippedObject(CreatureEquipSlot_Datapad));
missionComplete(mission->getOwner(),mission);
gWorldManager->removeMissionFromProcess(mission->getTaskId());
datapad->removeMission(mission);
delete mission;
}
return true;
}
示例4: checkSurveyMission
void MissionManager::checkSurveyMission(PlayerObject* player,CurrentResource* resource,ResourceLocation highestDist)
{
Datapad* datapad = dynamic_cast<Datapad*>(player->getEquipManager()->getEquippedObject(CreatureEquipSlot_Datapad));
if(datapad->hasMission()) //player has a mission
{
MissionList::iterator it = datapad->getMissions()->begin();
while(it != datapad->getMissions()->end())
{
MissionObject* mission = dynamic_cast<MissionObject*>(*it);
if(mission->getMissionType() == survey)
{
if(mission->getTargetResource() == resource->getType())
{
if(mission->getDifficulty() <= (highestDist.ratio*100))
{
if(glm::distance(mission->getIssuingTerminal()->mPosition, highestDist.position) > 1024)
{
gLogger->logMsg("PE > 500: ready to apply new BF/wound dmg");
missionComplete(player,mission);
it = datapad->removeMission(it);
delete mission;
return;
}
else
{
int8 sm[500];
sprintf(sm,"That resource pocket is too close (%"PRIu32" meters) to the mission giver to be useful to them. Go find one at least %"PRIu32" meters away to complete your survey mission. ",
static_cast<uint32>(glm::distance(mission->getIssuingTerminal()->mPosition, highestDist.position)),
(1024 - (int)glm::distance(mission->getIssuingTerminal()->mPosition, highestDist.position)));
string s = BString(sm);
s.convert(BSTRType_Unicode16);
gMessageLib->sendSystemMessage(player,s);
}
}
}
}
++it;
}
}
}
示例5: missionAbort
/*
* Player aborted the mission
*/
void MissionManager::missionAbort(PlayerObject* player, uint64 mission_id)
{
gLogger->logMsg("ABORT MISSION");
Datapad* datapad = dynamic_cast<Datapad*>(player->getEquipManager()->getEquippedObject(CreatureEquipSlot_Datapad));
MissionObject* mission = datapad->getMissionById(mission_id);
if(mission)
{
datapad->removeMission(mission);
gMessageLib->sendSystemMessage(player,L"","mission/mission_generic","incomplete");
gMessageLib->sendSetWaypointActiveStatus(mission->getWaypoint(),false,player);
gMessageLib->sendMissionAbort(mission,player);
gMessageLib->sendContainmentMessage(mission->getId(), datapad->getId(), 4, player);
gMessageLib->sendDestroyObject(mission_id,player);
delete mission;
}
else
{
gLogger->logMsg("ERROR: Attempt to abort an invalid mission, with id %.8X, from the datapad.", static_cast<int>(mission_id));
}
return;
}