MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / Phase_Goals_Check

Method Phase_Goals_Check

Source/Fodder.cpp:2557–2636  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2555}
2556
2557void cFodder::Phase_Goals_Check() {
2558
2559 int16 Enemys = 0;
2560 int16 Buildings = 0;
2561
2562 for (auto& Sprite : mSprites) {
2563 sSprite* Data20 = &Sprite;
2564
2565 if (Data20->field_0 == -32768)
2566 continue;
2567
2568 int16 Data10 = Data20->field_18;
2569 if (Data10 == eSprite_Computer_1 || Data10 == eSprite_Computer_2 || Data10 == eSprite_Computer_3 || Data10 == eSprite_BuildingDoor3 || Data10 == eSprite_BuildingDoor_Reinforced)
2570 goto loc_12620;
2571
2572 if (Data10 == eSprite_BuildingDoor2 || Data10 == eSprite_BuildingDoor) {
2573 if (Data20->field_38 == eSprite_Anim_Die1)
2574 continue;
2575
2576 loc_12620:;
2577 if (Data20->field_38 == eSprite_Anim_Die3)
2578 continue;
2579
2580 ++Buildings;
2581 continue;
2582 }
2583
2584 const int16* Data24 = mEnemy_Unit_Types;
2585 for (; *Data24 >= 0; ++Data24) {
2586 if (Data10 != *Data24)
2587 continue;
2588
2589 ++Enemys;
2590 }
2591 }
2592
2593 // The one demo just has two objectives for each map
2594 if (mVersionCurrent->isAmigaTheOne()) {
2595
2596 if (Buildings || Enemys)
2597 return;
2598
2599 mPhase_Complete = true;
2600 return;
2601 }
2602
2603 mEnemy_BuildingCount = Buildings;
2604 if (mGame_Data.mGamePhase_Data.mGoals_Remaining[eObjective_Destroy_Enemy_Buildings - 1]) {
2605 if (Buildings)
2606 return;
2607 }
2608
2609 if (mGame_Data.mGamePhase_Data.mGoals_Remaining[eObjective_Kill_All_Enemy - 1]) {
2610 if (Enemys)
2611 return;
2612 }
2613
2614 if (!mGame_Data.mGamePhase_Data.mGoals_Remaining[eObjective_Kidnap_Leader - 1]) {

Callers

nothing calls this directly

Calls 1

isAmigaTheOneMethod · 0.80

Tested by

no test coverage detected