本文整理汇总了C++中CP_MissionRemove函数的典型用法代码示例。如果您正苦于以下问题:C++ CP_MissionRemove函数的具体用法?C++ CP_MissionRemove怎么用?C++ CP_MissionRemove使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CP_MissionRemove函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: CP_BaseAttackGoToBase
/**
* @brief Set base attack mission, and go to base position.
* @note Base attack mission -- Stage 1
*/
static void CP_BaseAttackGoToBase (mission_t *mission)
{
base_t *base;
mission->stage = STAGE_MISSION_GOTO;
base = CP_BaseAttackChooseBase();
if (!base) {
Com_Printf("CP_BaseAttackGoToBase: no base found\n");
CP_MissionRemove(mission);
return;
}
mission->data.base = base;
mission->mapDef = Com_GetMapDefinitionByID("baseattack");
if (!mission->mapDef) {
CP_MissionRemove(mission);
Com_Error(ERR_DROP, "Could not find mapdef baseattack");
return;
}
Vector2Copy(base->pos, mission->pos);
mission->posAssigned = qtrue;
Com_sprintf(mission->location, sizeof(mission->location), "%s", base->name);
if (mission->ufo) {
CP_MissionDisableTimeLimit(mission);
UFO_SendToDestination(mission->ufo, mission->pos);
} else {
/* Go to next stage on next frame */
mission->finalDate = ccs.date;
}
}
开发者ID:chrisglass,项目名称:ufoai,代码行数:38,代码来源:cp_mission_baseattack.c
示例2: CP_SupplyMissionCreate
/**
* @brief Supply mission begins: UFO arrive on earth.
* @note Supply mission -- Stage 0
*/
static void CP_SupplyMissionCreate (mission_t *mission)
{
ufoType_t ufoType;
mission->stage = STAGE_COME_FROM_ORBIT;
/* Maybe base has been destroyed since mission creation ? */
if (!AB_CheckSupplyMissionPossible()) {
Com_DPrintf(DEBUG_CLIENT, "No base in game: removing supply mission.\n");
CP_MissionRemove(mission);
return;
}
ufoType = CP_MissionChooseUFO(mission);
if (ufoType == UFO_MAX) {
Com_DPrintf(DEBUG_CLIENT, "Supply mission can't be spawned without UFO: removing supply mission.\n");
CP_MissionRemove(mission);
} else {
CP_MissionDisableTimeLimit(mission);
mission->ufo = UFO_AddToGeoscape(ufoType, NULL, mission);
if (!mission->ufo) {
Com_Printf("CP_SupplyMissionCreate: Could not add UFO '%s', remove mission\n", Com_UFOTypeToShortName(ufoType));
CP_MissionRemove(mission);
}
}
}
开发者ID:MyWifeRules,项目名称:ufoai-1,代码行数:30,代码来源:cp_mission_supply.cpp
示例3: CP_ReconMissionGroundGo
/**
* @brief Set ground mission, and go to ground mission pos.
* @note Recon mission -- Stage 1
* @note ground mission can be spawned without UFO
* @sa CP_ReconMissionSelect
*/
void CP_ReconMissionGroundGo (mission_t *mission)
{
const nation_t *nation;
mission->stage = STAGE_MISSION_GOTO;
/* maybe the UFO just finished a ground mission and starts a new one? */
if (mission->ufo) {
CP_MissionRemoveFromGeoscape(mission);
mission->ufo->landed = false;
}
/* Choose a map */
if (CP_ChooseMap(mission, NULL)) {
int counter;
for (counter = 0; counter < MAX_POS_LOOP; counter++) {
if (!CP_GetRandomPosOnGeoscapeWithParameters(mission->pos, mission->mapDef->terrains, mission->mapDef->cultures, mission->mapDef->populations, NULL))
continue;
if (MAP_PositionCloseToBase(mission->pos))
continue;
mission->posAssigned = true;
break;
}
if (counter >= MAX_POS_LOOP) {
Com_Printf("CP_ReconMissionGroundGo: Error, could not set position.\n");
CP_MissionRemove(mission);
return;
}
} else {
Com_Printf("CP_ReconMissionGroundGo: No map found, remove mission.\n");
CP_MissionRemove(mission);
return;
}
nation = MAP_GetNation(mission->pos);
if (nation) {
Com_sprintf(mission->location, sizeof(mission->location), "%s", _(nation->name));
} else {
Com_sprintf(mission->location, sizeof(mission->location), "%s", _("No nation"));
}
if (mission->ufo) {
CP_MissionDisableTimeLimit(mission);
UFO_SendToDestination(mission->ufo, mission->pos);
} else {
/* Go to next stage on next frame */
mission->finalDate = ccs.date;
}
}
开发者ID:jklemmack,项目名称:ufoai,代码行数:55,代码来源:cp_mission_recon.cpp
示例4: CP_BaseAttackMissionNextStage
/**
* @brief Determine what action should be performed when a Base Attack mission stage ends.
* @param[in] mission Pointer to the mission which stage ended.
*/
void CP_BaseAttackMissionNextStage (mission_t *mission)
{
switch (mission->stage) {
case STAGE_NOT_ACTIVE:
/* Create mission */
CP_MissionBegin(mission);
break;
case STAGE_COME_FROM_ORBIT:
/* Choose a base to attack and go to this base */
CP_BaseAttackGoToBase(mission);
break;
case STAGE_MISSION_GOTO:
/* just arrived on base location: attack it */
CP_BaseAttackStartMission(mission);
break;
case STAGE_BASE_ATTACK:
/* Leave earth */
CP_BaseAttackMissionDestroyBase(mission);
break;
case STAGE_RETURN_TO_ORBIT:
/* mission is over, remove mission */
CP_BaseAttackMissionIsSuccess(mission);
break;
default:
Com_Printf("CP_BaseAttackMissionNextStage: Unknown stage: %i, removing mission.\n", mission->stage);
CP_MissionRemove(mission);
break;
}
}
开发者ID:chrisglass,项目名称:ufoai,代码行数:33,代码来源:cp_mission_baseattack.c
示例5: CP_TerrorMissionIsSuccess
/**
* @brief Terror attack mission is over and is a success: change interest values.
* @note Terror attack mission
*/
void CP_TerrorMissionIsSuccess (mission_t *mission)
{
INT_ChangeIndividualInterest(-0.2f, INTERESTCATEGORY_BASE_ATTACK);
INT_ChangeIndividualInterest(0.03f, INTERESTCATEGORY_HARVEST);
CP_MissionRemove(mission);
}
开发者ID:ibrahimmusba,项目名称:ufoai,代码行数:11,代码来源:cp_mission_terror.cpp
示例6: CP_HarvestMissionNextStage
/**
* @brief Determine what action should be performed when a Harvesting mission stage ends.
* @param[in] mission Pointer to the mission which stage ended.
*/
void CP_HarvestMissionNextStage (mission_t* mission)
{
switch (mission->stage) {
case STAGE_NOT_ACTIVE:
/* Create Harvesting mission */
CP_MissionBegin(mission);
break;
case STAGE_COME_FROM_ORBIT:
/* Go to mission */
CP_HarvestMissionGo(mission);
break;
case STAGE_MISSION_GOTO:
/* just arrived on a new Harvesting mission: start it */
CP_HarvestMissionStart(mission);
break;
case STAGE_HARVEST:
/* Leave earth */
CP_ReconMissionLeave(mission);
break;
case STAGE_RETURN_TO_ORBIT:
/* mission is over, remove mission */
CP_HarvestMissionIsSuccess(mission);
break;
default:
Com_Printf("CP_HarvestMissionNextStage: Unknown stage: %i, removing mission.\n", mission->stage);
CP_MissionRemove(mission);
break;
}
}
开发者ID:cigo,项目名称:ufoai,代码行数:33,代码来源:cp_mission_harvest.cpp
示例7: CP_InterceptNextStage
/**
* @brief Determine what action should be performed when a Intercept mission stage ends.
* @param[in] mission Pointer to the mission which stage ended.
*/
void CP_InterceptNextStage (mission_t* mission)
{
switch (mission->stage) {
case STAGE_NOT_ACTIVE:
/* Create Intercept mission */
CP_MissionBegin(mission);
break;
case STAGE_COME_FROM_ORBIT:
/* UFO start looking for target */
CP_InterceptMissionSet(mission);
break;
case STAGE_MISSION_GOTO:
CP_InterceptAttackInstallation(mission);
break;
case STAGE_INTERCEPT:
assert(mission->ufo);
/* Leave earth */
if (AIRFIGHT_ChooseWeapon(mission->ufo->weapons, mission->ufo->maxWeapons, mission->ufo->pos, mission->ufo->pos) !=
AIRFIGHT_WEAPON_CAN_NEVER_SHOOT && mission->ufo->status == AIR_UFO && !mission->data.installation) {
/* UFO is fighting and has still ammo, wait a little bit before leaving (UFO is not attacking an installation) */
const date_t AdditionalDelay = {0, 3600}; /* check every hour if there is still ammos */
mission->finalDate = Date_Add(ccs.date, AdditionalDelay);
} else
CP_InterceptMissionLeave(mission, true);
break;
case STAGE_RETURN_TO_ORBIT:
/* mission is over, remove mission */
CP_InterceptMissionIsSuccess(mission);
break;
default:
Com_Printf("CP_InterceptNextStage: Unknown stage: %i, removing mission.\n", mission->stage);
CP_MissionRemove(mission);
break;
}
}
开发者ID:AresAndy,项目名称:ufoai,代码行数:39,代码来源:cp_mission_intercept.cpp
示例8: CP_SupplySetStayAtBase
/**
* @brief UFO arrived on new base destination: Supply base.
* @param[in,out] mission Pointer to the mission
* @note Supply mission -- Stage 2
*/
static void CP_SupplySetStayAtBase (mission_t *mission)
{
const date_t minSupplyTime = {3, 0};
const date_t supplyTime = {10, 0}; /**< Max time needed to supply base */
assert(mission->ufo);
/* there must be an alien base set */
assert(mission->data.alienBase);
mission->stage = STAGE_SUPPLY;
/* Maybe base has been destroyed since mission creation ? */
if (!AB_CheckSupplyMissionPossible()) {
Com_DPrintf(DEBUG_CLIENT, "No base in game: removing supply mission.\n");
CP_MissionRemove(mission);
return;
}
mission->finalDate = Date_Add(ccs.date, Date_Random(minSupplyTime, supplyTime));
AB_SupplyBase(mission->data.alienBase, mission->ufo->detected);
/* ufo becomes invisible on geoscape */
CP_UFORemoveFromGeoscape(mission, false);
}
开发者ID:MyWifeRules,项目名称:ufoai-1,代码行数:30,代码来源:cp_mission_supply.cpp
示例9: CP_ReconMissionNextStage
/**
* @brief Determine what action should be performed when a Recon mission stage ends.
* @param[in] mission Pointer to the mission which stage ended.
*/
void CP_ReconMissionNextStage (mission_t *mission)
{
switch (mission->stage) {
case STAGE_NOT_ACTIVE:
/* Create Recon mission */
CP_MissionBegin(mission);
break;
case STAGE_COME_FROM_ORBIT:
case STAGE_RECON_GROUND:
/* Choose if a new ground mission should be started */
CP_ReconMissionSelect(mission);
break;
case STAGE_MISSION_GOTO:
/* just arrived on a new ground mission: start it */
CP_ReconMissionGround(mission);
break;
case STAGE_RECON_AIR:
/* Leave earth */
CP_ReconMissionLeave(mission);
break;
case STAGE_RETURN_TO_ORBIT:
/* mission is over, remove mission */
CP_ReconMissionIsSuccess(mission);
break;
default:
Com_Printf("CP_ReconMissionNextStage: Unknown stage: %i, removing mission.\n", mission->stage);
CP_MissionRemove(mission);
break;
}
}
开发者ID:ibrahimmusba,项目名称:ufoai,代码行数:34,代码来源:cp_mission_recon.cpp
示例10: CP_SupplyMissionNextStage
/**
* @brief Determine what action should be performed when a Supply mission stage ends.
* @param[in] mission Pointer to the mission which stage ended.
*/
void CP_SupplyMissionNextStage (mission_t *mission)
{
switch (mission->stage) {
case STAGE_NOT_ACTIVE:
/* Create mission */
CP_SupplyMissionCreate(mission);
break;
case STAGE_COME_FROM_ORBIT:
/* Go to base position */
CP_SupplyGoToBase(mission);
break;
case STAGE_MISSION_GOTO:
/* just arrived on base location: Supply base */
CP_SupplySetStayAtBase(mission);
break;
case STAGE_SUPPLY:
/* Leave earth */
CP_SupplyMissionLeave(mission);
break;
case STAGE_RETURN_TO_ORBIT:
/* mission is over, remove mission */
CP_SupplyMissionIsSuccess(mission);
break;
default:
Com_Printf("CP_SupplyMissionNextStage: Unknown stage: %i, removing mission.\n", mission->stage);
CP_MissionRemove(mission);
break;
}
}
开发者ID:MyWifeRules,项目名称:ufoai-1,代码行数:33,代码来源:cp_mission_supply.cpp
示例11: CP_SupplyMissionIsFailure
/**
* @brief Supply mission is over and is a failure (from an alien point of view): change interest values.
* @note Supply mission
*/
void CP_SupplyMissionIsFailure (mission_t *mission)
{
INT_ChangeIndividualInterest(0.1f, INTERESTCATEGORY_SUPPLY);
INT_ChangeIndividualInterest(0.1f, INTERESTCATEGORY_INTERCEPT);
INT_ChangeIndividualInterest(0.05f, INTERESTCATEGORY_BASE_ATTACK);
CP_MissionRemove(mission);
}
开发者ID:MyWifeRules,项目名称:ufoai-1,代码行数:12,代码来源:cp_mission_supply.cpp
示例12: CP_ReconMissionIsFailure
/**
* @brief Recon mission is over and is a failure: change interest values.
* @note Recon mission
*/
void CP_ReconMissionIsFailure (mission_t *mission)
{
INT_ChangeIndividualInterest(0.05f, INTERESTCATEGORY_RECON);
INT_ChangeIndividualInterest(0.1f, INTERESTCATEGORY_INTERCEPT);
INT_ChangeIndividualInterest(0.05f, INTERESTCATEGORY_TERROR_ATTACK);
CP_MissionRemove(mission);
}
开发者ID:ibrahimmusba,项目名称:ufoai,代码行数:12,代码来源:cp_mission_recon.cpp
示例13: CP_BuildBaseMissionIsFailure
/**
* @brief Build Base mission is over and is a failure (from an alien point of view): change interest values.
* @note Build Base mission
*/
void CP_BuildBaseMissionIsFailure (mission_t* mission)
{
/* Restore some alien interest for build base that has been removed when mission has been created */
INT_ChangeIndividualInterest(0.5f, INTERESTCATEGORY_BUILDING);
INT_ChangeIndividualInterest(0.05f, INTERESTCATEGORY_BASE_ATTACK);
CP_MissionRemove(mission);
}
开发者ID:AresAndy,项目名称:ufoai,代码行数:12,代码来源:cp_mission_buildbase.cpp
示例14: CP_HarvestMissionIsFailure
/**
* @brief Harvesting mission is over and is a failure: change interest values.
* @note Harvesting mission
*/
void CP_HarvestMissionIsFailure (mission_t* mission)
{
INT_ChangeIndividualInterest(0.1f, INTERESTCATEGORY_INTERCEPT);
INT_ChangeIndividualInterest(0.03f, INTERESTCATEGORY_BASE_ATTACK);
INT_ChangeIndividualInterest(0.03f, INTERESTCATEGORY_TERROR_ATTACK);
CP_MissionRemove(mission);
}
开发者ID:cigo,项目名称:ufoai,代码行数:12,代码来源:cp_mission_harvest.cpp
示例15: CP_HarvestMissionGo
/**
* @brief Set Harvest mission, and go to mission pos.
* @note Harvesting attack mission -- Stage 1
* @todo Remove me when CP_XVIMissionGo will be implemented
* This function should take a location close to an XVI infection point
* see gameplay proposal on wiki
*/
void CP_HarvestMissionGo (mission_t *mission)
{
const nation_t *nation;
mission->stage = STAGE_MISSION_GOTO;
/* Choose a map */
if (CP_ChooseMap(mission, NULL)) {
int counter;
linkedList_t *nationList = NULL;
const qboolean nationTest = CP_ChooseNation(mission, &nationList);
for (counter = 0; counter < MAX_POS_LOOP; counter++) {
if (!CP_GetRandomPosOnGeoscapeWithParameters(mission->pos, mission->mapDef->terrains, mission->mapDef->cultures, mission->mapDef->populations, nationTest ? nationList : NULL))
continue;
if (MAP_PositionCloseToBase(mission->pos))
continue;
mission->posAssigned = qtrue;
break;
}
if (counter >= MAX_POS_LOOP) {
Com_Printf("CP_HarvestMissionGo: Error, could not set position.\n");
CP_MissionRemove(mission);
return;
}
LIST_Delete(&nationList);
} else {
Com_Printf("CP_HarvestMissionGo: No map found, remove mission.\n");
CP_MissionRemove(mission);
return;
}
nation = MAP_GetNation(mission->pos);
if (nation) {
Com_sprintf(mission->location, sizeof(mission->location), "%s", _(nation->name));
} else {
Com_sprintf(mission->location, sizeof(mission->location), "%s", _("No nation"));
}
if (mission->ufo) {
CP_MissionDisableTimeLimit(mission);
UFO_SendToDestination(mission->ufo, mission->pos);
} else {
/* Go to next stage on next frame */
mission->finalDate = ccs.date;
}
}
开发者ID:chrisglass,项目名称:ufoai,代码行数:53,代码来源:cp_mission_harvest.c
示例16: CP_XVIMissionIsSuccess
/**
* @brief XVI Spreading mission is over and is a success: change interest values.
* @note XVI Spreading mission
*/
void CP_XVIMissionIsSuccess (mission_t *mission)
{
INT_ChangeIndividualInterest(-0.3f, INTERESTCATEGORY_XVI);
INT_ChangeIndividualInterest(0.1f, INTERESTCATEGORY_HARVEST);
INT_ChangeIndividualInterest(0.05f, INTERESTCATEGORY_BUILDING);
CP_MissionRemove(mission);
}
开发者ID:ptitSeb,项目名称:UFO--AI-OpenPandora,代码行数:12,代码来源:cp_mission_xvi.c
示例17: CP_BaseAttackMissionIsSuccess
/**
* @brief Base attack mission is over and is a success (from an alien point of view): change interest values.
* @note Base attack mission
* @sa CP_BaseAttackMissionStart
*/
void CP_BaseAttackMissionIsSuccess (mission_t* mission)
{
INT_ChangeIndividualInterest(0.3f, INTERESTCATEGORY_RECON);
INT_ChangeIndividualInterest(0.1f, INTERESTCATEGORY_HARVEST);
INT_ChangeIndividualInterest(-0.5f, INTERESTCATEGORY_TERROR_ATTACK);
INT_ChangeIndividualInterest(-0.5f, INTERESTCATEGORY_INTERCEPT);
CP_MissionRemove(mission);
}
开发者ID:ufoai,项目名称:ufoai,代码行数:14,代码来源:cp_mission_baseattack.cpp
示例18: CP_TerrorMissionIsFailure
/**
* @brief Terror attack mission is over and is a failure: change interest values.
* @note Terror attack mission
*/
void CP_TerrorMissionIsFailure (mission_t *mission)
{
INT_ChangeIndividualInterest(0.05f, INTERESTCATEGORY_TERROR_ATTACK);
INT_ChangeIndividualInterest(0.1f, INTERESTCATEGORY_INTERCEPT);
INT_ChangeIndividualInterest(0.05f, INTERESTCATEGORY_BUILDING);
INT_ChangeIndividualInterest(0.02f, INTERESTCATEGORY_BASE_ATTACK);
CP_MissionRemove(mission);
}
开发者ID:ibrahimmusba,项目名称:ufoai,代码行数:13,代码来源:cp_mission_terror.cpp
示例19: SCP_CampaignAddMission
static void SCP_CampaignAddMission (setState_t *set)
{
actMis_t *mis;
mission_t * mission;
const nation_t *nation;
/* add mission */
if (scd->numActiveMissions >= MAX_ACTMISSIONS) {
return;
}
mis = &scd->activeMissions[scd->numActiveMissions];
OBJZERO(*mis);
/* set relevant info */
mis->def = SCP_GetMission(set);
if (mis->def == NULL) {
return;
}
mis->cause = set;
if (set->def->expire.day)
mis->expire = Date_Add(ccs.date, set->def->expire);
/* prepare next event (if any) */
set->num++;
if (set->def->number && set->num >= set->def->number) {
set->active = false;
} else {
const date_t minTime = {0, 0};
set->event = Date_Add(ccs.date, Date_Random(minTime, set->def->frame));
}
mission = CP_CreateNewMission(INTERESTCATEGORY_TERROR_ATTACK, true);
mission->mapDef = cgi->Com_GetMapDefinitionByID(mis->def->id);
if (!mission->mapDef) {
Com_Printf("SCP_CampaignAddMission: Could not get the mapdef '%s'\n", mis->def->id);
CP_MissionRemove(mission);
return;
}
Vector2Copy(mis->def->pos, mission->pos);
mission->posAssigned = true;
nation = MAP_GetNation(mission->pos);
if (nation) {
Com_sprintf(mission->location, sizeof(mission->location), "%s", _(nation->name));
} else {
Com_sprintf(mission->location, sizeof(mission->location), "%s", _("No nation"));
}
CP_TerrorMissionStart(mission);
mission->finalDate = mis->expire;
mis->mission = mission;
Com_Printf("spawned map '%s'\n", mis->def->id);
scd->numActiveMissions++;
}
开发者ID:Qazzian,项目名称:ufoai_suspend,代码行数:56,代码来源:scp_missions.cpp
示例20: CP_HarvestMissionIsSuccess
/**
* @brief Harvesting mission is over and is a success: change interest values.
* @note Harvesting mission
*/
static void CP_HarvestMissionIsSuccess (mission_t* mission)
{
INT_ChangeIndividualInterest(-0.3f, INTERESTCATEGORY_HARVEST);
INT_ChangeIndividualInterest(0.2f, INTERESTCATEGORY_RECON);
INT_ChangeIndividualInterest(0.05f, INTERESTCATEGORY_BUILDING);
if (CP_IsXVIStarted())
INT_ChangeIndividualInterest(0.1f, INTERESTCATEGORY_XVI);
CP_MissionRemove(mission);
}
开发者ID:cigo,项目名称:ufoai,代码行数:14,代码来源:cp_mission_harvest.cpp
注:本文中的CP_MissionRemove函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论