This commit is contained in:
Paul 2001-07-26 20:00:55 +00:00
parent f1fe0ed2da
commit cf9a66a91e
11 changed files with 55 additions and 24 deletions

View File

@ -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_ledgeLookTimer<ledgeTimer)
{
@ -1134,8 +1133,6 @@ if(PadGetDown(0)&PAD_TRIANGLE)
{
int limit;
limit=(m_ledgeLookAhead*MAP2D_BLOCKSTEPSIZE)<<ledgeShift;
if(m_ledgeLookAhead>0)
{
if(m_ledgeLookOffset<limit)
{
// Look down
@ -1156,7 +1153,6 @@ if(PadGetDown(0)&PAD_TRIANGLE)
}
}
}
}
else
{
if(m_ledgeLookOffset>0)
@ -1180,8 +1176,6 @@ if(PadGetDown(0)&PAD_TRIANGLE)
}
}
}
m_lastLedgeLookAhead=m_ledgeLookAhead;
m_ledgeLookAhead=0;
// Camera focus point stuff
calcCameraFocusPointTarget();
@ -1600,6 +1594,21 @@ int CPlayer::getHeightFromGroundNoPlatform(int _x,int _y,int _maxHeight=32)
return( CGameScene::getCollision()->getHeightFromGround(_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;

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
};