Beispiel #1
0
void aioCreateTakeoutMothershipBig(struct AITeam *team,Ship *mothership, bool ForceBig)
{
    AlternativeShips alternatives1,alternatives2;
//    SelectCommand *selectone;
    AITeamMove *attackmove;

    if (!aiCurrentAIPlayer->player->PlayerMothership)
    {
        return;
    }

    aiplayerLog((aiIndex, "%x Issuing Takeout Mothership Big Order", team));

    if ((aiCurrentAIPlayer->player->PlayerMothership->shiptype == Mothership) || ForceBig)
    {
        SetNumAlternativesFlags(alternatives1,1,ALTERNATIVE_RANDOM);
        SetAlternative(alternatives1,0,StandardDestroyer,30);

        SetNumAlternativesFlags(alternatives2,2,ALTERNATIVE_RANDOM);
        SetAlternative(alternatives2,0,MissileDestroyer,30);
        SetAlternative(alternatives2,1,MissileDestroyer,30);
    }
    else if (aiCurrentAIPlayer->player->PlayerMothership->shiptype == Carrier)
    {
        SetNumAlternativesFlags(alternatives1,0,ALTERNATIVE_RANDOM);

        SetNumAlternativesFlags(alternatives2,0,ALTERNATIVE_RANDOM);
//        SetAlternative(alternatives2,0,DDDFrigate,10);
    }
    else
    {
        aiplayerLog((aiIndex, "Unknown Mothership Type"));
        return;
    }

    aimCreateFancyGetShips(team, IonCannonFrigate, 2, &alternatives1, 0, TRUE, FALSE);
    aimCreateFancyGetShips(team, StandardFrigate,  2, &alternatives2, REQUESTSHIPS_HIPRI, TRUE, FALSE);

    aimCreateVarDec(team, aiCurrentAIPlayer->attackVarLabel, TRUE, FALSE);
//    aimCreateVarWait(team, aiCurrentAIPlayer->attackVarLabel, -1, TRUE, FALSE);
    aimCreateTempGuard(team, AIO_TOUT_MSHIP_BIG_TGRD_FORMATION, AIO_TOUT_MSHIP_BIG_TGRD_TACTICS, TRUE, FALSE);

//    selectone = memAlloc(sizeofSelectCommand(1),"takeoutsel",0);
//    selectone->numShips = 1;
//    selectone->ShipPtr[0] = mothership;
//    attackmove = aimCreateAttack(team, selectone, WALL_FORMATION, TRUE, FALSE);
    attackmove = aimCreateArmada(team, WALL_FORMATION, Aggressive, TRUE, FALSE);
    aieHandlerSetGettingRocked(attackmove, TRUE, aihGenericGettingRockedHandler);
    aieHandlerSetFuelLow(attackmove, 15, TRUE, TRUE, aihGenericFuelLowHandler);

    aimCreateMoveDone(team, FALSE, FALSE);

    //this team can hyperspace attack
    bitSet(team->teamFlags, TEAM_Hyperspaceable);
}
Beispiel #2
0
/*-----------------------------------------------------------------------------
    Name        : aioCreateFrigateStrike
    Description : Creates the moves to create and do stuff with a fighter
                  strike force
    Inputs      : team
    Outputs     : Creates a bunch'a moves
    Return      : void
----------------------------------------------------------------------------*/
void aioCreateFrigateStrike(AITeam *team)
{
    AlternativeShips alternatives;
    AITeamMove *newmove;

    aiplayerLog((aiIndex, "%x Issuing Frigate Strike Order", team));

    SetNumAlternativesFlags(alternatives,1,ALTERNATIVE_RANDOM);
    SetAlternative(alternatives,0,IonCannonFrigate,10);
//    SetAlternative(alternatives,1,DDDFrigate,10);

    aimCreateFancyGetShips(team, StandardFrigate, 5, &alternatives, 0, TRUE, FALSE);

    aimCreateVarDec(team, aiCurrentAIPlayer->attackVarLabel, TRUE, FALSE);
//later put formation in aiscript
    newmove = aimCreateTempGuard(team, WALL_FORMATION, Aggressive, TRUE, FALSE);
    aieHandlerSetGettingRocked(newmove, TRUE, aihGenericGettingRockedHandler);
    aieHandlerSetNumbersLow(newmove, 20, 0, TRUE, aihHarassNumbersLowHandler);

    newmove = aimCreateArmada(team, CLAW_FORMATION, Aggressive, TRUE, FALSE);
    aieHandlerSetGettingRocked(newmove, TRUE, aihGenericGettingRockedHandler);
    aieHandlerSetNumbersLow(newmove, 20, 0, TRUE, aihHarassNumbersLowHandler);

    aimCreateMoveDone(team, FALSE, FALSE);

    //this team can hyperspace attack
    bitSet(team->teamFlags, TEAM_Hyperspaceable);

}
Beispiel #3
0
/*-----------------------------------------------------------------------------
    Name        : aioCreateFighterStrike
    Description : Creates the moves to create and do stuff with a fighter
                  strike force
    Inputs      : team
    Outputs     : Creates a bunch'a moves
    Return      : void
----------------------------------------------------------------------------*/
void aioCreateFighterStrike(AITeam *team)
{
    AlternativeShips alternatives;
    AITeamMove *newmove;

    aiplayerLog((aiIndex, "%x Issuing Fighter Strike Order", team));

    SetNumAlternativesFlags(alternatives,9,ALTERNATIVE_RANDOM);
    SetAlternative(alternatives,0,LightInterceptor,12);
    SetAlternative(alternatives,1,HeavyInterceptor,7);
    SetAlternative(alternatives,2,HeavyInterceptor,7);
    SetAlternative(alternatives,3,HeavyInterceptor,7);
    SetAlternative(alternatives,4,AttackBomber,10);
    SetAlternative(alternatives,5,AttackBomber,10);
    SetAlternative(alternatives,6,AttackBomber,10);
    SetAlternative(alternatives,7,HeavyDefender,8);
    SetAlternative(alternatives,8,CloakedFighter,10);

    aimCreateFancyGetShips(team, AttackBomber, 15, &alternatives, 0, TRUE, FALSE);

    aimCreateVarDec(team, aiCurrentAIPlayer->attackVarLabel, TRUE, FALSE);
//later put formation in aiscript
    newmove = aimCreateTempGuard(team, DELTA_FORMATION, Aggressive, TRUE, FALSE);
    aieHandlerSetGettingRocked(newmove, TRUE, aihGenericGettingRockedHandler);
    aieHandlerSetFuelLow(newmove, 15, TRUE, TRUE, aihGenericFuelLowHandler);
    aieHandlerSetNumbersLow(newmove, 20, 0, TRUE, aihHarassNumbersLowHandler);

    newmove = aimCreateArmada(team, CLAW_FORMATION, Aggressive, TRUE, FALSE);
    aieHandlerSetGettingRocked(newmove, TRUE, aihGenericGettingRockedHandler);
    aieHandlerSetFuelLow(newmove, 15, TRUE, TRUE, aihGenericFuelLowHandler);
    aieHandlerSetNumbersLow(newmove, 20, 0, TRUE, aihHarassNumbersLowHandler);

    aimCreateMoveDone(team, FALSE, FALSE);
}
Beispiel #4
0
/*-----------------------------------------------------------------------------
    Name        : aioCreateCorvetteStrike
    Description : Creates the moves to create and do stuff with a fighter
                  strike force
    Inputs      : team
    Outputs     : Creates a bunch'a moves
    Return      : void
----------------------------------------------------------------------------*/
void aioCreateCorvetteStrike(AITeam *team)
{
    AlternativeShips alternatives;
    AITeamMove *newmove;

    aiplayerLog((aiIndex, "%x Issuing Corvette Strike Order", team));

    SetNumAlternativesFlags(alternatives,7,ALTERNATIVE_RANDOM);
    SetAlternative(alternatives,0,LightCorvette,13);
    SetAlternative(alternatives,1,HeavyCorvette,10);
    SetAlternative(alternatives,2,HeavyCorvette,10);
    SetAlternative(alternatives,3,HeavyCorvette,10);
    SetAlternative(alternatives,4,HeavyCorvette,10);
    SetAlternative(alternatives,5,MultiGunCorvette,7);
    SetAlternative(alternatives,6,MinelayerCorvette,7);

    aimCreateFancyGetShips(team, HeavyCorvette, 9, &alternatives, 0, TRUE, FALSE);

    aimCreateVarDec(team, aiCurrentAIPlayer->attackVarLabel, TRUE, FALSE);
//later put formation in aiscript
    newmove = aimCreateTempGuard(team, DELTA3D_FORMATION, Aggressive, TRUE, FALSE);
    aieHandlerSetGettingRocked(newmove, TRUE, aihGenericGettingRockedHandler);
    aieHandlerSetFuelLow(newmove, 15, TRUE, TRUE, aihGenericFuelLowHandler);
    aieHandlerSetNumbersLow(newmove, 20, 0, TRUE, aihHarassNumbersLowHandler);

    newmove = aimCreateArmada(team, WALL_FORMATION, Aggressive, TRUE, FALSE);
    aieHandlerSetGettingRocked(newmove, TRUE, aihGenericGettingRockedHandler);
    aieHandlerSetFuelLow(newmove, 15, TRUE, TRUE, aihGenericFuelLowHandler);
    aieHandlerSetNumbersLow(newmove, 20, 0, TRUE, aihHarassNumbersLowHandler);

    aimCreateMoveDone(team, FALSE, FALSE);
}
Beispiel #5
0
/*-----------------------------------------------------------------------------
    Name        : aioCreateSlowRovingDefense
    Description : Creates a team of slowly roving ships that guard against baddies
    Inputs      : team - the team to the roving
    Outputs     : Creates a bunch of moves
    Return      : void
----------------------------------------------------------------------------*/
void aioCreateSlowRovingDefense(AITeam *team)
{
    AlternativeShips alternatives;
    AITeamMove *move;

    aiplayerLog((aiIndex, "%x Issuing Slow Roving Defense Order", team));

    SetNumAlternativesFlags(alternatives,7,ALTERNATIVE_RANDOM);
    SetAlternative(alternatives,0,HeavyCorvette,10);
    SetAlternative(alternatives,1,HeavyCorvette,10);
    SetAlternative(alternatives,2,HeavyCorvette,10);
    SetAlternative(alternatives,3,MultiGunCorvette,10);
    SetAlternative(alternatives,4,LightCorvette,7);
    SetAlternative(alternatives,5,StandardFrigate,30);
    SetAlternative(alternatives,6,DDDFrigate,30);

    aimCreateFancyGetShips(team, MultiGunCorvette, 3, &alternatives, 0, TRUE, FALSE);
//    aimCreateFormation(team, DELTA_FORMATION, FALSE, FALSE);
    move = aimCreateActivePatrol(team, AIT_SLOW_PATROL, TRUE, FALSE);
    aieHandlerSetFuelLow(move, AIO_SLOWROVING_FUEL_LOW, TRUE, TRUE, aihGenericFuelLowHandler);
    aieHandlerSetTeamDied(move, aihSlowDefenseTeamDiedHandler);
    aieHandlerSetNumbersLow(move, AIO_SLOWROVING_NUMBERS_LOW, 0, FALSE, aihSlowDefenseNumbersLowHandler);
    aieHandlerSetGettingRocked(move, FALSE, aihGenericGettingRockedHandler);
    aieHandlerSetInterrupt(move, (udword *)&(aiCurrentAIPlayer->aidDefenseTargets), 3, FALSE, aihSlowDefenseDistressHandler);

    aimCreateMoveDone(team, FALSE, FALSE);
}
Beispiel #6
0
/*-----------------------------------------------------------------------------
    Name        : aioCreateFastRovingDefense
    Description : Creates a team of roving ships that guard against baddies
    Inputs      : team - the team to do the roving
    Outputs     : Creates a bunch of moves
    Return      : void
----------------------------------------------------------------------------*/
void aioCreateFastRovingDefense(AITeam *team)
{
    AlternativeShips alternatives;
    AITeamMove *move;

    aiplayerLog((aiIndex, "%x Issuing Fast Roving Defense Order", team));

    SetNumAlternativesFlags(alternatives,6, ALTERNATIVE_RANDOM)
    SetAlternative(alternatives,0,HeavyDefender,14);
    SetAlternative(alternatives,1,HeavyDefender,14);
    SetAlternative(alternatives,2,HeavyDefender,14);
    SetAlternative(alternatives,3,HeavyInterceptor,14);
    SetAlternative(alternatives,4,AttackBomber,15);
    SetAlternative(alternatives,5,AttackBomber,15);

    aimCreateFancyGetShips(team, LightInterceptor, 15, &alternatives, 0, TRUE, FALSE);
//    aimCreateFormation(team, WALL_FORMATION, FALSE, FALSE);
    move = aimCreateActivePatrol(team, AIT_FAST_PATROL, TRUE, FALSE);
    aieHandlerSetFuelLow(move, AIO_FASTROVING_FUEL_LOW, TRUE, TRUE, aihGenericFuelLowHandler);
    aieHandlerSetTeamDied(move, aihFastDefenseTeamDiedHandler);
    aieHandlerSetNumbersLow(move, AIO_FASTROVING_NUMBERS_LOW, 0, FALSE, aihFastDefenseNumbersLowHandler);
    aieHandlerSetGettingRocked(move, FALSE, aihGenericGettingRockedHandler);
    aieHandlerSetInterrupt(move, (udword *)&(aiCurrentAIPlayer->aidDefenseTargets), 0, FALSE, aihFastDefenseDistressHandler);

//    aieHandlerSetEnemyNearby(move, 2000, FALSE, aihPatrolEnemyNearbyHandler);
    aimCreateMoveDone(team, FALSE, FALSE);
}
Beispiel #7
0
/*-----------------------------------------------------------------------------
    Name        : aihFastDefenseNumbersLowHandler
    Description : Handles the fast roving defense team being decimated
    Inputs      : team - the team being decimated
    Outputs     :
    Return      : void
----------------------------------------------------------------------------*/
void aihFastDefenseNumbersLowHandler(AITeam *team)
{
    AITeamMove *thisMove = team->curMove, *newMove;
    AlternativeShips alternatives;
    vector gathering_point;
    vector origin = ORIGIN_VECTOR;
    SelectCommand *teamsel = team->shipList.selection;
    sdword original_number = thisMove->events.numbersLow.watchBaseCount;

    //later maybe change to "reinforce" move, maybe along with harass team getting out
    //of there to attack someone else.
    if (aiCurrentAIPlayer->player->PlayerMothership)
    {
        gathering_point = aiCurrentAIPlayer->player->PlayerMothership->posinfo.position;
    }
    else
    {
        vecZeroVector(gathering_point);
    }

    gathering_point = aiuFindRangeStandoffPoint(gathering_point,origin, AIH_FASTDEF_NUMLOW_STANDOFF_DIST);

    thisMove->processing = FALSE;
    thisMove->events.numbersLow.triggered = FALSE;

    //add a move, getships, formation
    newMove = aimCreateMoveTeamNoAdd(team, gathering_point, AIH_FASTDEF_NUMLOW_FORMATION, FALSE, TRUE);
    aitAddmoveBeforeAndMakeCurrent(team, newMove, thisMove);

    if (teamsel->numShips)
    {
        if (teamsel->numShips < original_number)
        {
            newMove = aimCreateGetShipsNoAdd(team, teamsel->ShipPtr[0]->shiptype, (sbyte)(original_number - teamsel->numShips), 0, TRUE, TRUE);
        }
        else
        {
            //just add one ship (to prevent infinite loops)
            newMove = aimCreateGetShipsNoAdd(team, teamsel->ShipPtr[0]->shiptype, 1, 0, TRUE, TRUE);
        }

    }
    else
    {
        SetNumAlternativesFlags(alternatives,3, ALTERNATIVE_RANDOM)
        SetAlternative(alternatives,0,HeavyDefender,14);
        SetAlternative(alternatives,1,HeavyInterceptor,14);
        SetAlternative(alternatives,2,AttackBomber,15);

        newMove = aimCreateFancyGetShipsNoAdd(team, LightInterceptor, 12, &alternatives, 0, TRUE, FALSE);
    }

    thisMove->events.numbersLow.watchBaseCount = 0;
    thisMove->processing = FALSE;

    listAddNodeBefore(&(thisMove->listNode), &(newMove->listNode), newMove);

//    newMove = aimCreateFormationNoAdd(team, WALL_FORMATION, FALSE, TRUE);
//    listAddNodeBefore(&(thisMove->listNode), &(newMove->listNode), newMove);
}
Beispiel #8
0
/*-----------------------------------------------------------------------------
    Name        : aioCreateGuardShips
    Description : Creates an order to get a team to guard ships
    Inputs      : team - the team that will execute the order, ships - the ships to guard
    Outputs     : Creates a whole bunch of orders
    Return      : void
----------------------------------------------------------------------------*/
void aioCreateGuardShips(AITeam *team, SelectCommand *ships)
{
    AlternativeShips alternatives;
    sbyte numShipsToUse;
    AITeamMove *move;

    aiplayerLog((aiIndex, "%x Issuing Guard Ships Order", team));

    SetNumAlternativesFlags(alternatives,5, ALTERNATIVE_RANDOM)
//    SetAlternative(alternatives,0,DefenseFighter,10);
    SetAlternative(alternatives,0,HeavyInterceptor,15);
    SetAlternative(alternatives,1,LightInterceptor,10);
    SetAlternative(alternatives,2,LightCorvette,18);
    SetAlternative(alternatives,3,HeavyCorvette,24);
    SetAlternative(alternatives,4,MultiGunCorvette,24);

    if (aiuAnyShipsAreCapitalShips(ships))
    {
        numShipsToUse = AIO_GUARD_SHIPS_NUM_CAPITAL;
    }
    else
    {
        numShipsToUse = AIO_GUARD_SHIPS_NUM_NONCAPITAL;
    }

    aimCreateFancyGetShips(team, HeavyDefender, numShipsToUse, &alternatives, 0, TRUE, FALSE);

#if 0
    if (ships->numShips > 2)
    {
        numShipsToUse = ships->numShips * 3;
    }
    else
    {
        numShipsToUse = ships->numShips * 4;
    }
#endif
#if 0
    if (ships->numShips > 2)
    {
        aimCreateGetShips(team, HeavyDefender, 6, 0, TRUE, FALSE);
        aimCreateGetShips(team, MultiGunCorvette, (sbyte)(ships->numShips-2), 0, TRUE, FALSE);
    }
    else
        aimCreateGetShips(team, HeavyDefender, (sbyte)(ships->numShips*3), 0, TRUE, FALSE);
#endif

    aimCreateFormation(team, SPHERE_FORMATION, FALSE, FALSE);  // vary the formation?
    move = aimCreateGuardShips(team, ships, FALSE, FALSE);
    aieHandlerSetFuelLow(move, AIO_GUARD_SHIPS_FUEL_LOW, TRUE, TRUE, aihGenericFuelLowHandler);
    aieHandlerSetTeamDied(move, aihGuardShipsTeamDiedHandler);
    aimCreateMoveDone(team, FALSE, FALSE);
}
Beispiel #9
0
void aioCreateTakeoutMothershipFast(struct AITeam *team,Ship *mothership)
{
    AlternativeShips alternatives;
//    SelectCommand *selectone;
    AITeamMove *attackmove;

    aiplayerLog((aiIndex, "%x Issuing Takeout Mothership Fast Order", team));

    SetNumAlternativesFlags(alternatives,11,ALTERNATIVE_RANDOM);
    SetAlternative(alternatives,0,IonCannonFrigate,10);
    SetAlternative(alternatives,1,IonCannonFrigate,10);
    SetAlternative(alternatives,2,IonCannonFrigate,10);
    SetAlternative(alternatives,3,IonCannonFrigate,30);
    SetAlternative(alternatives,4,MissileDestroyer,30);
    SetAlternative(alternatives,5,StandardDestroyer,30);
    SetAlternative(alternatives,6,StandardFrigate,10);
    SetAlternative(alternatives,7,StandardFrigate,10);
    SetAlternative(alternatives,8,MinelayerCorvette,7);
    SetAlternative(alternatives,9,HeavyCorvette,3);
    SetAlternative(alternatives,10,MultiGunCorvette,3);

    aimCreateFancyGetShips(team, IonCannonFrigate, 3, &alternatives, 0, TRUE, FALSE);

    aimCreateVarDec(team, aiCurrentAIPlayer->attackVarLabel, TRUE, FALSE);
//    aimCreateVarWait(team, aiCurrentAIPlayer->attackVarLabel, -1, TRUE, FALSE);
    aimCreateTempGuard(team, AIO_TOUT_MSHIP_FAST_TGRD_FORMATION, AIO_TOUT_MSHIP_FAST_TGRD_TACTICS, TRUE, FALSE);

    // aimCreateRequestGuardTeam();

//    selectone = memAlloc(sizeofSelectCommand(1),"takeoutsel",0);
//    selectone->numShips = 1;
//    selectone->ShipPtr[0] = mothership;
//    attackmove = aimCreateFlankAttack(team, selectone, FALSE, TRUE, FALSE);
    attackmove = aimCreateArmada(team, BROAD_FORMATION, Aggressive, TRUE, FALSE);
    aieHandlerSetGettingRocked(attackmove, TRUE, aihGenericGettingRockedHandler);
    aieHandlerSetFuelLow(attackmove, 15, TRUE, TRUE, aihGenericFuelLowHandler);

    aimCreateMoveDone(team, FALSE, FALSE);

    //this team can hyperspace attack
    bitSet(team->teamFlags, TEAM_Hyperspaceable);
}
Beispiel #10
0
/*-----------------------------------------------------------------------------
    Name        : aioCreateHarass
    Description : Creates the moves for a team to perform the harass order
    Inputs      : team - the team to do the harassing
    Outputs     : Creates a whole bunch of moves for the team
    Return      : void
----------------------------------------------------------------------------*/
void aioCreateHarass(AITeam *team)
{
    vector destination, origin = ORIGIN_VECTOR;
    AlternativeShips alternatives;
    AITeamMove *move;

    aiplayerLog((aiIndex, "%x Issuing Harass Order", team));

    bitSet(team->teamFlags, HARASS_TEAM);

    destination = aiuFindEnemyMothershipCoords(aiCurrentAIPlayer->player);
    destination = aiuFindRangeStandoffPoint(destination, origin, HARASS_STANDOFF_DISTANCE);

    SetNumAlternativesFlags(alternatives,6,ALTERNATIVE_RANDOM);
    SetAlternative(alternatives,0,HeavyInterceptor,HARASS_HEAVYINT_EQUIVNUM);
    SetAlternative(alternatives,1,HeavyInterceptor,HARASS_HEAVYINT_EQUIVNUM);
    SetAlternative(alternatives,2,AttackBomber,HARASS_BOMBER_EQUIVNUM);
    SetAlternative(alternatives,3,AttackBomber,HARASS_BOMBER_EQUIVNUM);
    SetAlternative(alternatives,4,CloakedFighter,10);
    SetAlternative(alternatives,5,CloakedFighter,10);

    aimCreateFancyGetShips(team, LightInterceptor, HARASS_LIGHTINT_INITNUM, &alternatives, REQUESTSHIPS_HIPRI, TRUE, FALSE);

    move = aimCreateMoveTeam(team, destination, AIO_HARASS_INITIAL_MOVE_FORMATION, TRUE, FALSE);
    aieHandlerSetFuelLow(move, AIO_HARASS_FUEL_LOW, TRUE, TRUE, aihGenericFuelLowHandler);
    aieHandlerSetNumbersLow(move, AIO_HARASS_NUMBERS_LOW, 0, TRUE, aihHarassNumbersLowHandler);
    aieHandlerSetGettingRocked(move, FALSE, aihGenericGettingRockedHandler);
    aieHandlerSetTeamDied(move, aihHarassTeamDiedHandler);

//    aimCreateFormation(team, CLAW_FORMATION, FALSE, FALSE);

    move = aimCreateHarassAttack(team, TRUE, FALSE);
    aieHandlerSetFuelLow(move, AIO_HARASS_FUEL_LOW, TRUE, TRUE, aihGenericFuelLowHandler);
    aieHandlerSetNumbersLow(move, AIO_HARASS_NUMBERS_LOW, 0, TRUE, aihHarassNumbersLowHandler);
    aieHandlerSetGettingRocked(move, FALSE, aihGenericGettingRockedHandler);
    aieHandlerSetTeamDied(move, aihHarassTeamDiedHandler);

    aimCreateMoveDone(team, FALSE, FALSE);
}
Beispiel #11
0
void aioCreateTakeoutMothershipGuard(struct AITeam *team,Ship *mothership)
{
    AlternativeShips alternatives;
    AlternativeShips guardalternatives;
    AITeam *secondaryteam;
//    SelectCommand *selectone;
    AIVar *Var0;
    AIVar *Var1;
    char label[AIVAR_LABEL_MAX_LENGTH+1];
    AITeamMove *move;

    if (!aiCurrentAIPlayer->player->PlayerMothership)
    {
        return;
    }

    aiplayerLog((aiIndex, "%x Issuing Takeout Mothership Guard Order", team));

    secondaryteam = aitCreate(team->teamType);
    secondaryteam->cooperatingTeam = team;

    Var0 = aivarCreate(aivarLabelGenerate(label));
    aivarValueSet(Var0, 0);

    Var1 = aivarCreate(aivarLabelGenerate(label));
    aivarValueSet(Var1, 0);

    SetNumAlternativesFlags(guardalternatives,6,ALTERNATIVE_RANDOM);
    SetAlternative(guardalternatives,0,HeavyInterceptor,10);
    SetAlternative(guardalternatives,1,LightInterceptor,5);
    SetAlternative(guardalternatives,2,DefenseFighter,10);
    SetAlternative(guardalternatives,3,LightCorvette,15);
    SetAlternative(guardalternatives,4,HeavyCorvette,20);
    SetAlternative(guardalternatives,5,MultiGunCorvette,25);
//    SetAlternative(guardalternatives,6,DFGFrigate,100);
//    SetAlternative(guardalternatives,7,DDDFrigate,100);

    aimCreateFancyGetShips(secondaryteam, HeavyDefender, (sbyte)10, &guardalternatives, 0, TRUE, FALSE);

    aimCreateVarSet(secondaryteam, aivarLabelGet(Var1), TRUE, FALSE, FALSE);

    move = aimCreateVarWait(secondaryteam, aivarLabelGet(Var0), TRUE, TRUE, FALSE);
    aieHandlerSetTeamDied(move, aihRemoveTeamDiedHandler);

    aimCreateVarDestroy(secondaryteam, aivarLabelGet(Var0), FALSE, FALSE);

    aimCreateFormation(secondaryteam, SPHERE_FORMATION, FALSE, FALSE);

    aimCreateGuardCooperatingTeam(secondaryteam, FALSE, FALSE);

    aimCreateMoveDone(secondaryteam, FALSE, FALSE);

    if (aiCurrentAIPlayer->player->PlayerMothership->shiptype == Mothership)
    {
        SetNumAlternativesFlags(alternatives,5,ALTERNATIVE_RANDOM);
        SetAlternative(alternatives,0,MissileDestroyer,30);
        SetAlternative(alternatives,1,StandardDestroyer,30);
        SetAlternative(alternatives,2,StandardFrigate,10);
        SetAlternative(alternatives,3,MinelayerCorvette,7);
        SetAlternative(alternatives,4,HeavyCorvette,7);
    }
    else if (aiCurrentAIPlayer->player->PlayerMothership->shiptype == Carrier)
    {
        SetNumAlternativesFlags(alternatives,3,ALTERNATIVE_RANDOM);
        SetAlternative(alternatives,0,StandardFrigate,10);
        SetAlternative(alternatives,1,MinelayerCorvette,7);
        SetAlternative(alternatives,2,HeavyCorvette,7);
    }
    else
    {
        aiplayerLog((aiIndex, "Unknown Mothership Type"));
        return;
    }

    aimCreateFancyGetShips(team, IonCannonFrigate, 3, &alternatives, 0, TRUE, FALSE);

//    aimCreateFormation(team, WALL_FORMATION, FALSE, FALSE);

    aimCreateVarSet(team, aivarLabelGet(Var0), TRUE, FALSE, FALSE);

    move = aimCreateVarWait(team, aivarLabelGet(Var1), TRUE, TRUE, FALSE);
    aieHandlerSetTeamDied(move, aihRemoveTeamDiedHandler);

    aimCreateVarDestroy(team, aivarLabelGet(Var1), FALSE, FALSE);

    aimCreateVarDec(team, aiCurrentAIPlayer->attackVarLabel, TRUE, FALSE);
//    aimCreateVarWait(team, aiCurrentAIPlayer->attackVarLabel, -1, TRUE, FALSE);
    aimCreateTempGuard(team, AIO_TOUT_MSHIP_GUARD_TGRD_FORMATION, AIO_TOUT_MSHIP_GUARD_TGRD_TACTICS, TRUE, FALSE);

//    aimCreateFormation(team, WALL_FORMATION, FALSE, FALSE);

//    selectone = memAlloc(sizeofSelectCommand(1),"takeoutsel",0);
//    selectone->numShips = 1;
//    selectone->ShipPtr[0] = mothership;
    move = aimCreateArmada(team, WALL_FORMATION, Aggressive, TRUE, FALSE);
//    move = aimCreateAttack(team, selectone, WALL_FORMATION, TRUE, FALSE);
    aieHandlerSetFuelLow(move, 15, TRUE, TRUE, aihGenericFuelLowHandler);

    aimCreateMoveDone(team, FALSE, FALSE);
}
Beispiel #12
0
void aioCreateTakeoutMothershipHuge(struct AITeam *team,Ship *mothership)
{
    AlternativeShips guardalternatives;
    AlternativeShips alternatives;
    AITeam *secondaryteam;
//    SelectCommand *selectone;
    AIVar *Var0;
    AIVar *Var1;
    char label[AIVAR_LABEL_MAX_LENGTH+1];
    AITeamMove *move;

    aiplayerLog((aiIndex, "%x Issuing Takeout Mothership Huge Order", team));

    secondaryteam = aitCreate(team->teamType);
    secondaryteam->cooperatingTeam = team;

    Var0 = aivarCreate(aivarLabelGenerate(label));
    aivarValueSet(Var0, 0);

    Var1 = aivarCreate(aivarLabelGenerate(label));
    aivarValueSet(Var1, 0);

    SetNumAlternativesFlags(guardalternatives,6,ALTERNATIVE_RANDOM);
    SetAlternative(guardalternatives,0,HeavyInterceptor,10);
    SetAlternative(guardalternatives,1,DefenseFighter,10);
    SetAlternative(guardalternatives,2,LightCorvette,15);
    SetAlternative(guardalternatives,3,HeavyCorvette,20);
    SetAlternative(guardalternatives,4,MultiGunCorvette,25);
//    SetAlternative(guardalternatives,5,DFGFrigate,50);
//    SetAlternative(guardalternatives,6,DDDFrigate,50);
    SetAlternative(guardalternatives,5,MissileDestroyer,100);

    aimCreateFancyGetShips(secondaryteam, HeavyDefender, (sbyte)10, &guardalternatives, 0, TRUE, FALSE);

    aimCreateVarSet(secondaryteam, aivarLabelGet(Var1), TRUE, FALSE, FALSE);

    move = aimCreateVarWait(secondaryteam, aivarLabelGet(Var0), TRUE, TRUE, FALSE);
    aieHandlerSetTeamDied(move, aihRemoveTeamDiedHandler);

    aimCreateVarDestroy(secondaryteam, aivarLabelGet(Var0), FALSE, FALSE);

    aimCreateFormation(secondaryteam, SPHERE_FORMATION, FALSE, FALSE);

    move = aimCreateGuardCooperatingTeam(secondaryteam, FALSE, FALSE);
    aieHandlerSetFuelLow(move, 15, TRUE, TRUE, aihGenericFuelLowHandler);

    aimCreateMoveDone(secondaryteam, FALSE, FALSE);

    SetNumAlternatives(alternatives,0);
    aimCreateFancyGetShips(team, HeavyCruiser, 1, &alternatives, 0, TRUE, FALSE);

    aimCreateVarSet(team, aivarLabelGet(Var0), TRUE, FALSE, FALSE);

    move = aimCreateVarWait(team, aivarLabelGet(Var1), TRUE, TRUE, FALSE);
    aieHandlerSetTeamDied(move, aihRemoveTeamDiedHandler);

    aimCreateVarDestroy(team, aivarLabelGet(Var1), FALSE, FALSE);

    aimCreateVarDec(team, aiCurrentAIPlayer->attackVarLabel, TRUE, FALSE);
//    aimCreateVarWait(team, aiCurrentAIPlayer->attackVarLabel, -1, TRUE, FALSE);
    aimCreateTempGuard(team, NO_FORMATION, AIO_TOUT_MSHIP_GUARD_TGRD_TACTICS, TRUE, FALSE);

    aimCreateArmada(team, NO_FORMATION, Aggressive, TRUE, FALSE);

    aimCreateMoveDone(team, FALSE, FALSE);

    //this team can hyperspace attack
    bitSet(team->teamFlags, TEAM_Hyperspaceable);
}