MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / SetMode

Method SetMode

scripts/aigame4.cpp:577–691  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

575}
576
577void MercEndBoss::SetMode(int me, char mode) {
578 AI_SetType(me, AIT_EVADER1);
579 memory->mode_time = 0.0f;
580
581 if (memory->mode == MERCENDBOSS_INTRO) {
582 mprintf(0, "Here end of intro\n");
583 int flags = DWBF_ENABLED;
584 Obj_WBValue(me, 0, VF_SET_FLAGS, WBV_I_DYNAMIC_FLAGS, &flags);
585 Obj_WBValue(me, 4, VF_SET_FLAGS, WBV_I_DYNAMIC_FLAGS, &flags);
586
587 // The (AIF_DETERMINE_TARGET | AIF_AIM) flags get set here to make absolute sure that no timing issues mess things
588 // up
589 flags = AIF_FIRE | AIF_DODGE | AIF_DETERMINE_TARGET | AIF_AIM;
590 AI_Value(me, VF_SET_FLAGS, AIV_I_FLAGS, &flags);
591
592 int i;
593
594 for (i = 0; i < 16; i++) {
595 PortalBreakGlass(i, 167);
596 }
597 }
598
599 switch (mode) {
600 case MERCENDBOSS_INTRO: {
601 mprintf(0, "Here intro begin\n");
602
603 // Make him fire during the cinematics :)
604 int flags = AISR_OK_TO_FIRE_DURING_CINEMATICS;
605 AI_Value(me, VF_SET_FLAGS, AIV_I_STATUS_REG, &flags);
606
607 // Make sure he doesn't sleep
608 flags = AIF_FORCE_AWARENESS;
609 AI_Value(me, VF_SET_FLAGS, AIV_I_FLAGS, &flags);
610
611 float awareness = AWARE_FULLY;
612 AI_Value(me, VF_SET, AIV_F_AWARENESS, &awareness);
613
614 // Destroy all non-boss robots
615 aDestroyAllRobotsInit();
616 aDestroyAllRobotsSpareHandle(me);
617 aDestroyAllRobotsSpareHandle(memory->turret_object);
618 aDestroyAllRobotsSpareHandle(memory->emitter[0]);
619 aDestroyAllRobotsSpareHandle(memory->emitter[1]);
620 aDestroyAllRobotsSpareHandle(memory->combine_object);
621 aDestroyAllRobotsEnd();
622
623 // flags = AIF_FIRE;
624 // AI_Value(me, VF_SET_FLAGS, AIV_I_FLAGS, &flags);
625 // AI_Value(memory->turret_object, VF_CLEAR_FLAGS, AIV_I_FLAGS, &flags);
626
627 flags = DWBF_ENABLED;
628 Obj_WBValue(me, 0, VF_SET_FLAGS, WBV_I_DYNAMIC_FLAGS, &flags);
629 Obj_WBValue(me, 4, VF_SET_FLAGS, WBV_I_DYNAMIC_FLAGS, &flags);
630 } break;
631 case MERCENDBOSS_MATTER: {
632 aShowHUDMessage("GUIDEBOT: We should stay as far away from him as we can.");
633
634 int flags = AIF_DETERMINE_TARGET | AIF_AIM;

Callers

nothing calls this directly

Calls 11

Obj_WBValueFunction · 0.85
PortalBreakGlassFunction · 0.85
aDestroyAllRobotsInitFunction · 0.85
aDestroyAllRobotsEndFunction · 0.85
aShowHUDMessageFunction · 0.85
Obj_SetCustomAnimFunction · 0.85
aObjSparkFunction · 0.85
aTurnOnSpewFunction · 0.85
Obj_ValueFunction · 0.85
CreateAndAttachFunction · 0.70

Tested by

no test coverage detected