MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / WaspMutantControl

Function WaspMutantControl

TombEngine/Objects/TR3/Entity/WaspMutant.cpp:138–293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136 }
137
138 void WaspMutantControl(short itemNumber)
139 {
140 if (!CreatureActive(itemNumber))
141 return;
142
143 auto& item = g_Level.Items[itemNumber];
144 auto& creature = *GetCreatureInfo(&item);
145
146 short headingAngle = 0;
147
148 if (item.HitPoints <= 0)
149 {
150 switch (item.Animation.ActiveState)
151 {
152 case WASP_STATE_DEATH_START:
153 if (item.Pose.Position.y >= item.Floor)
154 {
155 item.Animation.TargetState = WASP_STATE_DEATH_END;
156 item.Animation.IsAirborne = false;
157 item.Animation.Velocity.y = 0.0f;
158 item.Pose.Position.y = item.Floor;
159 }
160
161 break;
162
163 case WASP_STATE_DEATH_END:
164 if (item.ItemFlags[0] > 0 && item.ItemFlags[1] == 0)
165 {
166 item.ItemFlags[0]--;
167 item.ItemFlags[1] = 6;
168 }
169 else
170 {
171 item.ItemFlags[1]--;
172 }
173
174 item.Pose.Position.y = item.Floor;
175 break;
176
177 default:
178 SetAnimation(item, WASP_STATE_DEATH_START);
179 item.Animation.IsAirborne = true;
180 item.Animation.Velocity = Vector3::Zero;
181 break;
182 }
183
184 item.Pose.Orientation.x = 0;
185 }
186 else
187 {
188 if (item.AIBits)
189 GetAITarget(&creature);
190
191 AI_INFO ai;
192 CreatureAIInfo(&item, &ai);
193
194 GetCreatureMood(&item, &ai, true);
195 CreatureMood(&item, &ai, true);

Callers

nothing calls this directly

Calls 14

CreatureActiveFunction · 0.85
GetCreatureInfoFunction · 0.85
SetAnimationFunction · 0.85
GetAITargetFunction · 0.85
CreatureAIInfoFunction · 0.85
GetCreatureMoodFunction · 0.85
CreatureMoodFunction · 0.85
CreatureTurnFunction · 0.85
GetRandomControlFunction · 0.85
DoDamageFunction · 0.85
CreatureEffect2Function · 0.85

Tested by

no test coverage detected