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

Function LaraClimbRope

TombEngine/Objects/Generic/Object/rope.cpp:683–730  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

681 }
682
683 void LaraClimbRope(ItemInfo* item, CollisionInfo* coll)
684 {
685 if (!IsHeld(In::Action))
686 FallFromRope(item);
687 else
688 {
689 Camera.targetAngle = ANGLE(30.0f);
690
691 if (Lara.Control.Rope.Count)
692 {
693 if (!Lara.Control.Rope.Flag)
694 {
695 --Lara.Control.Rope.Count;
696 Lara.Control.Rope.Offset += Lara.Control.Rope.DownVel;
697
698 if (!Lara.Control.Rope.Count)
699 Lara.Control.Rope.Flag = 1;
700
701 return;
702 }
703 }
704 else
705 {
706 if (!Lara.Control.Rope.Flag)
707 {
708 ROPE_STRUCT* rope = &Ropes[Lara.Control.Rope.Ptr];
709 Lara.Control.Rope.Offset = 0;
710 Lara.Control.Rope.DownVel = (unsigned int)(rope->meshSegment[Lara.Control.Rope.Segment + 1].y - rope->meshSegment[Lara.Control.Rope.Segment].y) >> 17;
711 Lara.Control.Rope.Count = 0;
712 Lara.Control.Rope.Offset += Lara.Control.Rope.DownVel;
713 Lara.Control.Rope.Flag = 1;
714 return;
715 }
716 }
717
718 if (item->Animation.AnimNumber == LA_ROPE_DOWN && TestLastFrame(*item))
719 {
720 SoundEffect(SFX_TR4_LARA_POLE_SLIDE_LOOP, &LaraItem->Pose);
721 item->Animation.FrameNumber = 0;
722 Lara.Control.Rope.Flag = 0;
723 ++Lara.Control.Rope.Segment;
724 Lara.Control.Rope.Offset = 0;
725 }
726
727 if (!IsHeld(In::Back) || Lara.Control.Rope.Segment >= 21)
728 item->Animation.TargetState = LS_ROPE_IDLE;
729 }
730 }
731
732 void DelAlignLaraToRope(ItemInfo* item)
733 {

Callers 1

lara_as_rope_downFunction · 0.85

Calls 5

IsHeldFunction · 0.85
FallFromRopeFunction · 0.85
ANGLEFunction · 0.85
TestLastFrameFunction · 0.85
SoundEffectFunction · 0.85

Tested by

no test coverage detected