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

Function InitializePuna

TombEngine/Objects/TR3/Entity/PunaBoss.cpp:278–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276 }
277
278 void InitializePuna(short itemNumber)
279 {
280 auto& item = g_Level.Items[itemNumber];
281
282 InitializeCreature(itemNumber);
283 SetAnimation(item, PUNA_ANIM_IDLE);
284 CheckForRequiredObjects(item);
285
286 // Save Puna's default angle. It will be used while waiting (i.e. an active lizard is nearby).
287 // NOTE: Since Puna is oriented to face away from the player, add 180 degrees.
288 item.SetFlagField((int)BossItemFlags::Rotation, item.Pose.Orientation.y + ANGLE(180.0f));
289 item.SetFlagField((int)BossItemFlags::AttackType, (int)PunaAttackType::AwaitPlayer); // Normal behaviour at start.
290 item.SetFlagField((int)BossItemFlags::ShieldIsEnabled, 1); // Activated at start.
291 item.SetFlagField((int)BossItemFlags::AttackCount, 0);
292 item.SetFlagField((int)BossItemFlags::DeathCount, 0);
293 item.SetFlagField((int)BossItemFlags::ItemNumber, NO_VALUE);
294 item.SetFlagField((int)BossItemFlags::ExplodeCount, 0);
295
296 // If there is no lizard nearby, remove the lizard flag.
297 if (!IsLizardActiveNearby(item, true))
298 item.ClearFlags((int)BossItemFlags::Object, (short)BossFlagValue::Lizard);
299 }
300
301 void PunaControl(short itemNumber)
302 {

Callers

nothing calls this directly

Calls 7

InitializeCreatureFunction · 0.85
SetAnimationFunction · 0.85
CheckForRequiredObjectsFunction · 0.85
ANGLEFunction · 0.85
IsLizardActiveNearbyFunction · 0.85
SetFlagFieldMethod · 0.80
ClearFlagsMethod · 0.80

Tested by

no test coverage detected