This commit is contained in:
parent
bef68f6b0e
commit
eb9e0ff1d8
1 changed files with 24 additions and 18 deletions
|
@ -21,6 +21,19 @@
|
||||||
#include "gfx\sprbank.h"
|
#include "gfx\sprbank.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __ENEMY_NPC_H__
|
||||||
|
#include "enemy\npc.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __PROJECTL_PROJECTL_H__
|
||||||
|
#include "projectl\projectl.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __GAME_GAME_H__
|
||||||
|
#include "game\game.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Std Lib
|
/* Std Lib
|
||||||
------- */
|
------- */
|
||||||
|
@ -36,18 +49,6 @@
|
||||||
#include <ingamefx.h>
|
#include <ingamefx.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __ENEMY_NPC_H__
|
|
||||||
#include "enemy\npc.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __PROJECTL_PROJECTL_H__
|
|
||||||
#include "projectl\projectl.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __GAME_GAME_H__
|
|
||||||
#include "game\game.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Tyepdefs && Defines
|
Tyepdefs && Defines
|
||||||
|
@ -84,6 +85,7 @@ void CPlayerModeNet::enter()
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
int netstate;
|
int netstate;
|
||||||
|
DVECTOR netLaunchPos={-10,-70};
|
||||||
void CPlayerModeNet::think()
|
void CPlayerModeNet::think()
|
||||||
{
|
{
|
||||||
// If we're netting then restore the 'real' anim number/frame before
|
// If we're netting then restore the 'real' anim number/frame before
|
||||||
|
@ -128,7 +130,6 @@ void CPlayerModeNet::think()
|
||||||
{
|
{
|
||||||
if(((CNpcEnemy*)thing)->canBeCaughtByNet())
|
if(((CNpcEnemy*)thing)->canBeCaughtByNet())
|
||||||
{
|
{
|
||||||
PAUL_DBGMSG("Caught!");
|
|
||||||
((CNpcEnemy*)thing)->caughtWithNet();
|
((CNpcEnemy*)thing)->caughtWithNet();
|
||||||
m_netState=NET_STATE__JUST_CAUGHT_SOMETHING;
|
m_netState=NET_STATE__JUST_CAUGHT_SOMETHING;
|
||||||
thing=NULL;
|
thing=NULL;
|
||||||
|
@ -148,20 +149,25 @@ PAUL_DBGMSG("Caught!");
|
||||||
if(m_netFrame==0)
|
if(m_netFrame==0)
|
||||||
{
|
{
|
||||||
// Launch projectile at halfway through the swing..
|
// Launch projectile at halfway through the swing..
|
||||||
PAUL_DBGMSG("Released!");
|
|
||||||
CPlayerProjectile *projectile;
|
CPlayerProjectile *projectile;
|
||||||
|
|
||||||
int playerFacing=m_player->getFacing();
|
int playerFacing;
|
||||||
|
int fireHeading;
|
||||||
|
DVECTOR launchPos;
|
||||||
|
|
||||||
int fireHeading = 1024 + ( 1024 * playerFacing );
|
playerFacing=m_player->getFacing();
|
||||||
|
fireHeading=1024+(1024*playerFacing);
|
||||||
|
launchPos=m_player->getPos();
|
||||||
|
launchPos.vx+=netLaunchPos.vx*playerFacing;
|
||||||
|
launchPos.vy+=netLaunchPos.vy;
|
||||||
|
|
||||||
|
|
||||||
projectile = new( "user projectile" ) CPlayerProjectile;
|
projectile = new( "user projectile" ) CPlayerProjectile;
|
||||||
projectile->init( m_player->getPos(),
|
projectile->init( launchPos,
|
||||||
fireHeading,
|
fireHeading,
|
||||||
CPlayerProjectile::PLAYER_PROJECTILE_DUMBFIRE,
|
CPlayerProjectile::PLAYER_PROJECTILE_DUMBFIRE,
|
||||||
CPlayerProjectile::PLAYER_PROJECTILE_FINITE_LIFE,
|
CPlayerProjectile::PLAYER_PROJECTILE_FINITE_LIFE,
|
||||||
5 * GameState::getOneSecondInFrames() );
|
5*60);
|
||||||
|
|
||||||
m_netState=NET_STATE__JUST_LAUNCHED_SOMETHING;
|
m_netState=NET_STATE__JUST_LAUNCHED_SOMETHING;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue