| 95 | } |
| 96 | |
| 97 | void ScalesCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo* coll) |
| 98 | { |
| 99 | ItemInfo* item = &g_Level.Items[itemNumber]; |
| 100 | |
| 101 | g_Hud.InteractionHighlighter.Test(*laraItem, *item); |
| 102 | |
| 103 | if (TestBoundsCollide(item, laraItem, LARA_RADIUS)) |
| 104 | { |
| 105 | if (laraItem->Animation.AnimNumber != LA_WATERSKIN_POUR_LOW && laraItem->Animation.AnimNumber != LA_WATERSKIN_POUR_HIGH || item->Animation.ActiveState != 1) |
| 106 | { |
| 107 | GlobalCollisionBounds.X1 = 640; |
| 108 | GlobalCollisionBounds.X2 = 1280; |
| 109 | GlobalCollisionBounds.Y1 = -1280; |
| 110 | GlobalCollisionBounds.Y2 = 0; |
| 111 | GlobalCollisionBounds.Z1 = -256; |
| 112 | GlobalCollisionBounds.Z2 = 384; |
| 113 | |
| 114 | ItemPushItem(item, laraItem, coll, false, 2); |
| 115 | |
| 116 | GlobalCollisionBounds.X1 = -256; |
| 117 | GlobalCollisionBounds.X2 = 256; |
| 118 | |
| 119 | ItemPushItem(item, laraItem, coll, false, 2); |
| 120 | |
| 121 | GlobalCollisionBounds.X1 = -1280; |
| 122 | GlobalCollisionBounds.X2 = -640; |
| 123 | |
| 124 | ItemPushItem(item, laraItem, coll, false, 2); |
| 125 | } |
| 126 | else |
| 127 | { |
| 128 | short rotY = item->Pose.Orientation.y; |
| 129 | item->Pose.Orientation.y = (short)(laraItem->Pose.Orientation.y + ANGLE(45.0f)) & 0xC000; |
| 130 | |
| 131 | ScalesBounds.BoundingBox.X1 = -1408; |
| 132 | ScalesBounds.BoundingBox.X2 = -640; |
| 133 | ScalesBounds.BoundingBox.Z1 = -512; |
| 134 | ScalesBounds.BoundingBox.Z2 = 0; |
| 135 | |
| 136 | if (TestLaraPosition(ScalesBounds, item, laraItem)) |
| 137 | { |
| 138 | laraItem->Animation.AnimNumber = LA_WATERSKIN_POUR_HIGH; |
| 139 | laraItem->Animation.FrameNumber = 0; |
| 140 | item->Pose.Orientation.y = rotY; |
| 141 | } |
| 142 | else if (laraItem->Animation.FrameNumber == 51) |
| 143 | { |
| 144 | SoundEffect(SFX_TR4_POUR_WATER, &laraItem->Pose); |
| 145 | item->Pose.Orientation.y = rotY; |
| 146 | } |
| 147 | else if (laraItem->Animation.FrameNumber == 74) |
| 148 | { |
| 149 | AddActiveItem(itemNumber); |
| 150 | item->Status = ITEM_ACTIVE; |
| 151 | |
| 152 | if (laraItem->ItemFlags[3] < item->TriggerFlags) |
| 153 | { |
| 154 | item->Animation.TargetState = 4; |
nothing calls this directly
no test coverage detected