diff --git a/Graphics/levels/Chapter01/Level02/Level02.MEX b/Graphics/levels/Chapter01/Level02/Level02.MEX index 57574ab44..69589f256 100644 Binary files a/Graphics/levels/Chapter01/Level02/Level02.MEX and b/Graphics/levels/Chapter01/Level02/Level02.MEX differ diff --git a/Graphics/levels/Chapter01/Level02/level02.Mep b/Graphics/levels/Chapter01/Level02/level02.Mep index 7797872b5..5786de1ac 100644 Binary files a/Graphics/levels/Chapter01/Level02/level02.Mep and b/Graphics/levels/Chapter01/Level02/level02.Mep differ diff --git a/Graphics/levels/Chapter02/Level03/Level03.MEX b/Graphics/levels/Chapter02/Level03/Level03.MEX index b526d89f1..f77cabb2c 100644 Binary files a/Graphics/levels/Chapter02/Level03/Level03.MEX and b/Graphics/levels/Chapter02/Level03/Level03.MEX differ diff --git a/Graphics/levels/Chapter02/Level03/level03.Mep b/Graphics/levels/Chapter02/Level03/level03.Mep index 827c392ff..10be1ffa5 100644 Binary files a/Graphics/levels/Chapter02/Level03/level03.Mep and b/Graphics/levels/Chapter02/Level03/level03.Mep differ diff --git a/Graphics/levels/Chapter03/Level03/Level03.MEX b/Graphics/levels/Chapter03/Level03/Level03.MEX index fa1e6f2b5..329c4b6e4 100644 Binary files a/Graphics/levels/Chapter03/Level03/Level03.MEX and b/Graphics/levels/Chapter03/Level03/Level03.MEX differ diff --git a/Graphics/levels/Chapter03/Level03/Level03.Mep b/Graphics/levels/Chapter03/Level03/Level03.Mep index 741ef1544..53d073535 100644 Binary files a/Graphics/levels/Chapter03/Level03/Level03.Mep and b/Graphics/levels/Chapter03/Level03/Level03.Mep differ diff --git a/source/player/player.cpp b/source/player/player.cpp index e01aab168..399b11739 100644 --- a/source/player/player.cpp +++ b/source/player/player.cpp @@ -701,7 +701,6 @@ void CPlayer::shutdown() ---------------------------------------------------------------------- */ static int oldmode=-1; int newmode=-1; - void CPlayer::think(int _frames) { int i; @@ -1124,7 +1123,7 @@ if(PadGetDown(0)&PAD_TRIANGLE) } // Ledge look-ahead stuff - if(m_ledgeLookAhead&&m_ledgeLookAhead==m_lastLedgeLookAhead) + if(m_ledgeLookAhead) { if(m_ledgeLookTimer0) + if(m_ledgeLookOffsetlimit) + { + m_ledgeLookOffset=limit; + } + } + else if(m_ledgeLookOffset>limit) + { + // Look up + m_ledgeLookOffset-=ledgeSpeedIn*_frames; if(m_ledgeLookOffsetlimit) - { - m_ledgeLookOffset=limit; - } - } - else if(m_ledgeLookOffset>limit) - { - // Look up - m_ledgeLookOffset-=ledgeSpeedIn*_frames; - if(m_ledgeLookOffsetgetHeightFromGround(_x,_y,_maxHeight) ); } +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void CPlayer::setLedgeLookAhead(int _lookAhead) +{ + if(m_ledgeLookAhead!=_lookAhead) + { + m_ledgeLookAhead=_lookAhead; + m_ledgeLookTimer=0; + } +} + /*---------------------------------------------------------------------- Function: Purpose: @@ -1898,7 +1907,7 @@ void CPlayer::respawn() m_cameraPos.vy=m_currentCamFocusPoint.vy; m_padLookAroundTimer=0; - m_ledgeLookAhead=m_lastLedgeLookAhead=0; + m_ledgeLookAhead=0; m_ledgeLookOffset=0; m_ledgeLookTimer=0; m_tryingToManuallyPickupWeapon=false; diff --git a/source/player/player.h b/source/player/player.h index 14b1809cc..ae2e90fcc 100644 --- a/source/player/player.h +++ b/source/player/player.h @@ -248,7 +248,7 @@ public: int getHeightFromPlatformNoGround(int _x,int _y,int _maxHeight=32); int getHeightFromGroundNoPlatform(int _x,int _y,int _maxHeight=32); - void setLedgeLookAhead(int _lookAhead) {m_ledgeLookAhead=_lookAhead;} + void setLedgeLookAhead(int _lookAhead); void addLife(); void addSpatula(int Count=1) {m_numSpatulasHeld+=Count;} @@ -337,7 +337,7 @@ private: DVECTOR m_currentCamFocusPoint; int m_facing; int m_padLookAroundTimer; - int m_ledgeLookAhead,m_lastLedgeLookAhead; + int m_ledgeLookAhead; int m_ledgeLookOffset; int m_ledgeLookTimer; diff --git a/source/triggers/tlook.cpp b/source/triggers/tlook.cpp index 3de6a7b6f..a9966aa44 100644 --- a/source/triggers/tlook.cpp +++ b/source/triggers/tlook.cpp @@ -68,7 +68,7 @@ void CLookTrigger::collidedWith(CThing *_thisThing) collArea.y2=collArea.y1+10; if(checkCollisionAgainstArea(&collArea)) { - ((CPlayer*)_thisThing)->setLedgeLookAhead(+4); + ((CPlayer*)_thisThing)->setLedgeLookAhead(m_val0); } break; diff --git a/source/triggers/trigger.cpp b/source/triggers/trigger.cpp index 6e591460c..163d247dc 100644 --- a/source/triggers/trigger.cpp +++ b/source/triggers/trigger.cpp @@ -163,6 +163,10 @@ #include "triggers\tspeech.h" #endif +#ifndef __TRIGGERS_TLOOK_H__ +#include "triggers\tlook.h" +#endif + #ifndef __GAME_GAME_H__ #include "game\game.h" #endif @@ -427,6 +431,10 @@ CTrigger *trigger; break; } + case TRIGGER_CAMERAYPOSITIONTRIGGER: + trigger = (CLookTrigger*)new("LookTrigger") CLookTrigger(); + break; + default: trigger=NULL; } @@ -445,6 +453,7 @@ CTrigger *trigger=Create(ThisTrigger->Type); trigger->setPositionAndSize(ThisTrigger->Pos.X<<4,ThisTrigger->Pos.Y<<4,ThisTrigger->Width<<4,ThisTrigger->Height<<4); trigger->setTargetBox(ThisTrigger->TargetPos.X<<4,ThisTrigger->TargetPos.Y<<4,ThisTrigger->TargetSize.X<<4,ThisTrigger->TargetSize.Y<<4); + trigger->setVal(ThisTrigger->Val0); switch( ThisTrigger->Type ) { @@ -520,4 +529,14 @@ void CTrigger::setTargetBox(int _x,int _y,int _w,int _h) m_boxY2=_y+_h; } +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void CTrigger::setVal(int _val) +{ + m_val0=_val; +} diff --git a/source/triggers/trigger.h b/source/triggers/trigger.h index e5491060d..bdd26c723 100644 --- a/source/triggers/trigger.h +++ b/source/triggers/trigger.h @@ -67,6 +67,7 @@ enum TRIGGER_TYPE TRIGGER_SPEECH_FIRST_BUBBLE, TRIGGER_SPEECH_USE_BUBBLE, TRIGGER_SPEECH_WEIGHT, + TRIGGER_CAMERAYPOSITIONTRIGGER, // Code based triggers TRIGGER_PLATFORM, @@ -90,11 +91,13 @@ static CTrigger *Create(int Type); static CTrigger *Create(sThingTrigger *ThisTrigger); virtual void setPositionAndSize(int _x,int _y,int _w,int _h); virtual void setTargetBox(int _x,int _y,int _w,int _h); + void setVal(int _val); protected: virtual void collidedWith(CThing *_thisThing){}; int m_boxX1,m_boxY1,m_boxX2,m_boxY2; + int m_val0; };