This commit is contained in:
parent
78683c9539
commit
9a2314b3ad
5 changed files with 15 additions and 1 deletions
|
@ -1284,6 +1284,7 @@ void CNpcEnemy::processCollision()
|
||||||
CPlayer *player = GameScene.getPlayer();
|
CPlayer *player = GameScene.getPlayer();
|
||||||
|
|
||||||
player->takeDamage( m_data[m_type].damageToUserType );
|
player->takeDamage( m_data[m_type].damageToUserType );
|
||||||
|
processUserCollision( (CThing *) player );
|
||||||
|
|
||||||
m_controlFunc = m_oldControlFunc;
|
m_controlFunc = m_oldControlFunc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1045,7 +1045,7 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||||
2,
|
2,
|
||||||
128,
|
128,
|
||||||
DETECT_ALL_COLLISION,
|
DETECT_ALL_COLLISION,
|
||||||
DAMAGE__SHOCK_ENEMY,
|
DAMAGE__NONE,
|
||||||
16,
|
16,
|
||||||
FRM_JELLYFISH1_SWIM1,
|
FRM_JELLYFISH1_SWIM1,
|
||||||
NPC_SHOT_GENERIC,
|
NPC_SHOT_GENERIC,
|
||||||
|
|
|
@ -193,6 +193,12 @@ void CNpcSmallJellyfishBackgroundEnemy::processUserCollision( CThing *thisThing
|
||||||
otherDelta.vy = -otherDelta.vy;
|
otherDelta.vy = -otherDelta.vy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !otherDelta.vx && !otherDelta.vy )
|
||||||
|
{
|
||||||
|
otherDelta.vx = ( 1 * xDist ) / abs( xDist );
|
||||||
|
otherDelta.vy = ( 1 * yDist ) / abs( yDist );
|
||||||
|
}
|
||||||
|
|
||||||
Pos.vx += otherDelta.vx;
|
Pos.vx += otherDelta.vx;
|
||||||
Pos.vy += otherDelta.vy;
|
Pos.vy += otherDelta.vy;
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,11 @@
|
||||||
#include "system\vid.h"
|
#include "system\vid.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __PLAYER_PLAYER_H__
|
||||||
|
#include "player\player.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void CNpcBoatHazard::init()
|
void CNpcBoatHazard::init()
|
||||||
|
@ -179,6 +184,7 @@ void CNpcBoatHazard::collidedWith( CThing *_thisThing )
|
||||||
{
|
{
|
||||||
CPlayer *player = (CPlayer *) _thisThing;
|
CPlayer *player = (CPlayer *) _thisThing;
|
||||||
|
|
||||||
|
player->takeDamage( DAMAGE__KILL_OUTRIGHT );
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1493,6 +1493,7 @@ void CPlayer::takeDamage(DAMAGE_TYPE _damage)
|
||||||
switch(_damage)
|
switch(_damage)
|
||||||
{
|
{
|
||||||
case DAMAGE__NONE:
|
case DAMAGE__NONE:
|
||||||
|
ouchThatHurt=false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DAMAGE__ELECTROCUTION:
|
case DAMAGE__ELECTROCUTION:
|
||||||
|
|
Loading…
Add table
Reference in a new issue