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

Method SetMode

scripts/AIGame.cpp:1773–1806  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1771#define SUPERTHIEF_MELEE_DIST 50.0f
1772
1773void SuperThief::SetMode(int me, char mode) {
1774 AI_SetType(me, AIT_AIS);
1775
1776 switch (mode) {
1777 case SUPERTHIEF_WAIT: {
1778 } break;
1779
1780 case SUPERTHIEF_INTRO: {
1781 } break;
1782 case SUPERTHIEF_RANGED:
1783 AI_SetType(me, AIT_EVADER1);
1784 break;
1785 case SUPERTHIEF_MELEE:
1786 AI_SetType(me, AIT_MELEE1);
1787 break;
1788 case SUPERTHIEF_DEATH: {
1789 int flags = AIF_DODGE;
1790 AI_Value(me, VF_CLEAR_FLAGS, AIV_I_FLAGS, &flags);
1791
1792 flags = AIF_DISABLE_FIRING | AIF_DISABLE_MELEE;
1793 AI_Value(me, VF_SET_FLAGS, AIV_I_FLAGS, &flags);
1794
1795 AI_AddGoal(me, AIG_GET_TO_OBJ, 1, 1.0f, -1, GF_ORIENT_TARGET | GF_KEEP_AT_COMPLETION, me);
1796
1797 float temp = 0.0f;
1798 AI_Value(me, VF_SET, AIV_F_MAX_TURN_RATE, &temp);
1799 Obj_SetCustomAnim(me, 246.0f, 292.0f, 6.0f, 0, Sound_FindId("RbtThiefDeath"), -1);
1800 } break;
1801 }
1802
1803 memory->time_till_fire_secondary = 1.0f + (float)rand() / (float)RAND_MAX;
1804 memory->mode = mode;
1805 memory->mode_time = 0.0f;
1806}
1807
1808void SuperThief::SpewEverything(int me) {
1809 int i;

Callers

nothing calls this directly

Calls 10

Obj_SetCustomAnimFunction · 0.85
Obj_ValueFunction · 0.85
AI_GoalValueFunction · 0.85
Obj_WBValueFunction · 0.85
Obj_BurningFunction · 0.85
Sound_StopFunction · 0.85
Sound_Play3dFunction · 0.85
Obj_CreateFunction · 0.85
SendCommandFunction · 0.85
vm_VectorNormalizeFunction · 0.70

Tested by

no test coverage detected