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

Method DoInterval

scripts/AIGame.cpp:2106–2256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2104}
2105
2106void SuperThief::DoInterval(int me) {
2107 bool f_force_ranged = false;
2108 int target_handle;
2109 float anim_frame;
2110 float shields;
2111 int flags;
2112 msafe_struct m;
2113 int room;
2114 vector pos;
2115
2116 Obj_Value(me, VF_GET, OBJV_I_ROOMNUM, &room);
2117 Obj_Value(me, VF_GET, OBJV_V_POS, &pos);
2118 Obj_Value(me, VF_GET, OBJV_F_ANIM_FRAME, &anim_frame);
2119 Obj_Value(me, VF_GET, OBJV_F_SHIELDS, &shields);
2120 Obj_Value(me, VF_GET, OBJV_I_FLAGS, &flags);
2121
2122 if (memory->laser_on) {
2123 ray_info ray;
2124
2125 matrix orient;
2126 Obj_Value(me, VF_GET, OBJV_M_ORIENT, &orient);
2127
2128 // Determine real start pos - room
2129 vector end_pos = pos;
2130 end_pos += orient.fvec * 2000.0f;
2131
2132 int fvi_flags = FQ_CHECK_OBJS | FQ_IGNORE_POWERUPS | FQ_IGNORE_WEAPONS;
2133 int fate = FVI_RayCast(me, &pos, &end_pos, room, 0.0f, fvi_flags, &ray);
2134
2135 Obj_Value(memory->camera_obj, VF_SET, OBJV_I_ROOMNUM, &ray.hit_room);
2136 Obj_Value(memory->camera_obj, VF_SET, OBJV_V_POS, &ray.hit_point);
2137 }
2138
2139 memory->f_very_hurt = f_force_ranged = (shields < memory->force_ranged_shields) != 0;
2140
2141 if ((memory->mode != SUPERTHIEF_DEATH) && (flags & OF_AI_DEATH) && anim_frame >= 0.0f && anim_frame <= 6.0f) {
2142 mprintf(0, "ST: Dying\n");
2143 SetMode(me, SUPERTHIEF_DEATH);
2144 }
2145
2146 if (memory->mode == SUPERTHIEF_DEATH) {
2147 // Do dynamic death
2148 if ((memory->mode_time < 4.0f && memory->mode_time + Game_GetFrameTime() >= 4.0f) ||
2149 (memory->mode_time < 6.0f && memory->mode_time + Game_GetFrameTime() >= 6.0f)) {
2150 int weapon_id;
2151
2152 weapon_id = Wpn_FindID("TubbsHitBlast");
2153 Obj_Create(OBJ_WEAPON, weapon_id, room, &pos, NULL, me);
2154 }
2155
2156 if (memory->mode_time < 3.0f && memory->mode_time + Game_GetFrameTime() >= 3.0f) {
2157 Obj_Burning(me, 1000000.0f, 1.0f);
2158 }
2159
2160 if (memory->mode_time > 6.2f) {
2161 mprintf(0, "ST: Died\n");
2162 Obj_Kill(me, OBJECT_HANDLE_NONE, 1000.0f,
2163 DF_BLAST_RING | DF_LOSES_ANTIGRAV | DF_EXPL_LARGE | DF_FIREBALL | DF_BREAKS_APART | DF_DEBRIS_SMOKES,

Callers

nothing calls this directly

Calls 8

Obj_ValueFunction · 0.85
Obj_CreateFunction · 0.85
Obj_BurningFunction · 0.85
AI_GoalValueFunction · 0.85
Obj_SetCustomAnimFunction · 0.85
ObjectRemoveFunction · 0.85
GetObjectParentFunction · 0.85
vm_VectorNormalizeFunction · 0.70

Tested by

no test coverage detected