Ejemplo n.º 1
0
void CloakGeneratorDied(Ship *ship)
{
    CloakGeneratorSpec *spec = (CloakGeneratorSpec *)ship->ShipSpecifics;
    Node *cloaknode;
    CloakStruct *cloakstruct;

    cloaknode = spec->CloakList.head;

    while(cloaknode != NULL)
    {
        cloakstruct = (CloakStruct *)listGetStructOfNode(cloaknode);
        if(bitTest(cloakstruct->spaceobj->flags,SOF_Cloaked))
        {
            bitClear(cloakstruct->spaceobj->flags,SOF_Cloaked);
                          //Force instant decloaking
            if(cloakstruct->spaceobj->objtype == OBJ_ShipType)
            {
                //if object was a ship set objects decloaking time for cloak advagtage effect
                SpawnCloakingEffect((Ship *)cloakstruct->spaceobj, etgSpecialPurposeEffectTable[EGT_CLOAK_OFF]);
                ((Ship *) (cloakstruct->spaceobj))->shipDeCloakTime = universe.totaltimeelapsed;
            }
        }

        bitClear(cloakstruct->spaceobj->flags,SOF_Cloaking);
        bitClear(cloakstruct->spaceobj->flags,SOF_DeCloaking);
        bitClear(cloakstruct->spaceobj->flags,SOF_CloakGenField);
        cloaknode = cloaknode->next;
    }
    listDeleteAll(&spec->CloakList);        //delete the list
}
Ejemplo n.º 2
0
void taskCallBackShutDown()
{
    if (babyTaskHandle != -1)
    {
        taskStop(babyTaskHandle);
    }

    listDeleteAll(&callbacks.babies);
}
Ejemplo n.º 3
0
/*-----------------------------------------------------------------------------
    Name        : gcShutdown
    Description : This shutsdown the game chatting system.
    Inputs      :
    Outputs     :
    Return      : void
----------------------------------------------------------------------------*/
void gcShutdown(void)
{
    CloseHandle((HANDLE)chatmutex);
    chatmutex = NULL;

    curPosition = NULL;

    if (chatdrawregion!=NULL)
    {
        regLinkRemove(chatdrawregion);
    }
    listDeleteAll(&chathistorylist);

    gcRunning=FALSE;
}
Ejemplo n.º 4
0
/*-----------------------------------------------------------------------------
    Name        : rmUpdateResearch
    Description : updates all research
    Inputs      : none
    Outputs     : none
    Return      : void
----------------------------------------------------------------------------*/
void rmUpdateResearch(void)
{
    sdword              index, labindex, i;
    ResearchLab        *lab;
    PlayerResearchInfo *research;
    ResearchTopic      *topic;
    Node               *walk;
    LinkedList          deletelist;
    bool                shipcanbuild[STD_LAST_SHIP];

    listInit(&deletelist);

    // search through list of players
    for (index=0; index<universe.numPlayers; index++)
    {
        research = &universe.players[index].researchinfo;

        if (research->CanDoResearch)
        {
            walk = research->listoftopics.head;

            // walk through list of topics being researched
            while (walk != NULL)
            {
                topic = (ResearchTopic *)listGetStructOfNode(walk);
                topic->timeleft -= labdec[topic->numlabsresearching];
                if (topic->timeleft < 0)
                {
                    for (i = 0; i < STD_LAST_SHIP; i++)
                    {
                        shipcanbuild[i] = rmCanBuildShip(&(universe.players[index]), i);
                    }

                    // Insert sound for technology completed
                    if (universe.players[index].race == R1)
                    {
                        speechEventFleet(STAT_F_Research_R1_Completed, topic->techresearch, index);
                    }
                    else if (universe.players[index].race == R2)
                    {
                        speechEventFleet(STAT_F_Research_R2_Completed, topic->techresearch, index);
                    }

                    topic->timeleft = 0;

                    research->HasTechnology |= TechToBit(topic->techresearch);



                    listRemoveNode(&topic->link);
                    listAddNode(&deletelist,&topic->link,topic);

                    for (labindex=0; labindex<NUM_RESEARCHLABS; labindex++)
                    {
                        lab = &research->researchlabs[labindex];
                        if (lab->topic==topic)
                        {
                            lab->labstatus = LS_NORESEARCHITEM;
                            lab->topic     = NULL;
                            if (rmGUIActive)
                                rmClearLab(labindex);
                        }
                    }

                    for (i = 0; i < STD_LAST_SHIP; i++)
                    {
                        if (shipcanbuild[i] != rmCanBuildShip(&(universe.players[index]), i))
                        {
                            speechEventFleet(STAT_F_Research_CompletedShip, i, index);
                            if (cmActive)
                            {
                                cmUpdateShipsAvailable();
                            }
                        }
                    }

                    if (singlePlayerGame && (index == 0))
                    {
                        tmTechForSale[topic->techresearch] = TM_TECH_IS_ALREADY_OWNED;
                    }

                    if (rmGUIActive)
                        rmUpdateTechList();
                }

                walk = walk->next;
            }

            listDeleteAll(&deletelist);
        }
    }
}
Ejemplo n.º 5
0
/*-----------------------------------------------------------------------------
    Name        : prim3dShutdown
    Description : Performs shutdown on 3d drawing structures
    Inputs      :
    Outputs     : Deallocates the circle vertice list
    Return      : void
----------------------------------------------------------------------------*/
void prim3dShutdown(void)
{
    listDeleteAll(&CircleList);
}
Ejemplo n.º 6
0
void CloakGeneratorClose(Ship *ship)
{
    CloakGeneratorSpec *spec = (CloakGeneratorSpec *)ship->ShipSpecifics;
    listDeleteAll(&spec->CloakList);        //delete the list
}
Ejemplo n.º 7
0
/*-----------------------------------------------------------------------------
    Name        : pingAllPingsDelete
    Description : Deletes all pings.
    Inputs      :
    Outputs     :
    Return      :
----------------------------------------------------------------------------*/
void pingAllPingsDelete(void)
{
    listDeleteAll(&pingList);
}