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

Function SpawnShield

TombEngine/Objects/Effects/Boss.cpp:21–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19namespace TEN::Effects::Boss
20{
21 void SpawnShield(const ItemInfo& item, const Vector4& color)
22 {
23 if (!item.TestFlags((int)BossItemFlags::Object, (short)BossFlagValue::Shield))
24 return;
25
26 int itemNumber = CreateItem();
27 if (itemNumber == NO_VALUE)
28 return;
29
30 auto& shieldItem = g_Level.Items[itemNumber];
31
32 shieldItem.ObjectNumber = ID_BOSS_SHIELD;
33 shieldItem.RoomNumber = item.RoomNumber;
34 shieldItem.Pose.Position = item.Pose.Position;
35 shieldItem.Pose.Position.y -= CLICK(3);
36 shieldItem.Pose.Orientation = item.Pose.Orientation;
37 shieldItem.Flags |= IFLAG_ACTIVATION_MASK;
38
39 InitializeItem(itemNumber);
40
41 shieldItem.Model.Color = color;
42 shieldItem.Collidable = true;
43 shieldItem.ItemFlags[0] = 2;
44 shieldItem.Model.Mutators[0].Scale = Vector3(2.0f); // Scale model by factor of 2.
45 shieldItem.Status = ITEM_ACTIVE;
46
47 AddActiveItem(itemNumber);
48 }
49
50 void SpawnShockwaveExplosion(const ItemInfo& item, const Vector4& color)
51 {

Callers 2

PunaHitFunction · 0.85

Calls 5

InitializeItemFunction · 0.85
AddActiveItemFunction · 0.85
TestFlagsMethod · 0.80
CreateItemFunction · 0.50
Vector3Function · 0.50

Tested by

no test coverage detected