From eb9e0ff1d813d1469bb6ca0645302b761378af1f Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 8 Apr 2001 19:03:08 +0000 Subject: [PATCH] --- source/player/pmnet.cpp | 42 +++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/source/player/pmnet.cpp b/source/player/pmnet.cpp index 7ca02f4da..53158cfab 100644 --- a/source/player/pmnet.cpp +++ b/source/player/pmnet.cpp @@ -21,6 +21,19 @@ #include "gfx\sprbank.h" #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 ------- */ @@ -36,18 +49,6 @@ #include #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 @@ -84,6 +85,7 @@ void CPlayerModeNet::enter() Returns: ---------------------------------------------------------------------- */ int netstate; +DVECTOR netLaunchPos={-10,-70}; void CPlayerModeNet::think() { // If we're netting then restore the 'real' anim number/frame before @@ -128,7 +130,6 @@ void CPlayerModeNet::think() { if(((CNpcEnemy*)thing)->canBeCaughtByNet()) { -PAUL_DBGMSG("Caught!"); ((CNpcEnemy*)thing)->caughtWithNet(); m_netState=NET_STATE__JUST_CAUGHT_SOMETHING; thing=NULL; @@ -148,20 +149,25 @@ PAUL_DBGMSG("Caught!"); if(m_netFrame==0) { // Launch projectile at halfway through the swing.. -PAUL_DBGMSG("Released!"); 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->init( m_player->getPos(), + projectile->init( launchPos, fireHeading, CPlayerProjectile::PLAYER_PROJECTILE_DUMBFIRE, CPlayerProjectile::PLAYER_PROJECTILE_FINITE_LIFE, - 5 * GameState::getOneSecondInFrames() ); + 5*60); m_netState=NET_STATE__JUST_LAUNCHED_SOMETHING; }