| 70 | } |
| 71 | |
| 72 | void TroopsControl(short itemNumber) |
| 73 | { |
| 74 | if (!CreatureActive(itemNumber)) |
| 75 | return; |
| 76 | |
| 77 | auto* item = &g_Level.Items[itemNumber]; |
| 78 | auto* object = &Objects[item->ObjectNumber]; |
| 79 | auto* creature = GetCreatureInfo(item); |
| 80 | |
| 81 | short angle = 0; |
| 82 | short tilt = 0; |
| 83 | short rot = 0; |
| 84 | short joint0 = 0; |
| 85 | short joint1 = 0; |
| 86 | short joint2 = 0; |
| 87 | |
| 88 | int dx = 0; |
| 89 | int dy = 0; |
| 90 | int dz = 0; |
| 91 | |
| 92 | if (creature->MuzzleFlash[0].Delay != 0) |
| 93 | creature->MuzzleFlash[0].Delay--; |
| 94 | |
| 95 | if (item->HitPoints <= 0) |
| 96 | { |
| 97 | if (item->Animation.ActiveState != TROOP_STATE_DEATH && |
| 98 | item->Animation.ActiveState != TROOP_STATE_KILLED_BY_SCORPION) |
| 99 | { |
| 100 | if (creature->Enemy && |
| 101 | creature->Enemy->ObjectNumber == ID_BIG_SCORPION && |
| 102 | item->ItemFlags[0] < 80) |
| 103 | { |
| 104 | if (creature->Enemy->Animation.AnimNumber == 6) |
| 105 | { |
| 106 | item->Animation.AnimNumber = 23; |
| 107 | |
| 108 | if (item->Animation.ActiveState == TROOP_STATE_ATTACKED_BY_SCORPION) |
| 109 | item->Animation.FrameNumber = 37; |
| 110 | else |
| 111 | item->Animation.FrameNumber = 0; |
| 112 | |
| 113 | item->Animation.ActiveState = TROOP_STATE_KILLED_BY_SCORPION; |
| 114 | item->Animation.TargetState = TROOP_STATE_KILLED_BY_SCORPION; |
| 115 | |
| 116 | angle = 0; |
| 117 | |
| 118 | item->Pose.Position = creature->Enemy->Pose.Position; |
| 119 | item->Pose.Orientation = creature->Enemy->Pose.Orientation; |
| 120 | |
| 121 | creature->Enemy->TriggerFlags = 99; |
| 122 | } |
| 123 | else |
| 124 | { |
| 125 | item->ItemFlags[0]++; |
| 126 | angle = 0; |
| 127 | } |
| 128 | } |
| 129 | else |
nothing calls this directly
no test coverage detected