mirror of
https://github.com/unknownworlds/NS.git
synced 2025-01-31 13:00:47 +00:00
o Merge with ns/dev/tankefugl:
- Merged source dir git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@97 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
parent
be7f964667
commit
fae8e99a33
23 changed files with 676 additions and 88 deletions
|
@ -34,6 +34,10 @@
|
|||
#include "mod/AvHNetworkMessages.h"
|
||||
#include "ui/ChatPanel.h"
|
||||
|
||||
// tankefugl: duck toggle
|
||||
bool g_bDuckToggled;
|
||||
// :tankefugl
|
||||
|
||||
class CHLVoiceStatusHelper : public IVoiceStatusHelper
|
||||
{
|
||||
public:
|
||||
|
@ -192,6 +196,10 @@ void CHud :: Init( void )
|
|||
m_iLogo = 0;
|
||||
m_iFOV = 0;
|
||||
|
||||
// tankefugl: duck toggle
|
||||
g_bDuckToggled = false;
|
||||
// :tankefugl
|
||||
|
||||
CVAR_CREATE( "zoom_sensitivity_ratio", "1.2", 0 );
|
||||
default_fov = CVAR_CREATE( "default_fov", "90", 0 );
|
||||
m_pCvarStealMouse = CVAR_CREATE( "hud_capturemouse", "1", FCVAR_ARCHIVE );
|
||||
|
|
|
@ -21,6 +21,10 @@
|
|||
#include "common/r_efx.h"
|
||||
#include "mod/AvHNetworkMessages.h"
|
||||
|
||||
// tankefugl: duck toggle
|
||||
extern bool g_bDuckToggled;
|
||||
// :tankefugl
|
||||
|
||||
#define MAX_CLIENTS 32
|
||||
|
||||
#if !defined( _TFC )
|
||||
|
@ -46,6 +50,10 @@ int CHud :: MsgFunc_ResetHUD(const char *pszName, int iSize, void *pbuf )
|
|||
// reset sensitivity
|
||||
m_flMouseSensitivity = 0;
|
||||
|
||||
// tankefugl: duck toggle
|
||||
g_bDuckToggled = false;
|
||||
// :tankefugl
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -61,6 +61,10 @@ extern "C"
|
|||
#include "engine/APIProxy.h"
|
||||
#include "Exports.h"
|
||||
|
||||
// tankefugl: duck toggle
|
||||
extern bool g_bDuckToggled;
|
||||
// :tankefugl
|
||||
|
||||
extern int g_iAlive;
|
||||
|
||||
extern int g_weaponselect;
|
||||
|
@ -790,6 +794,12 @@ void IN_DuckDown(void)
|
|||
}
|
||||
|
||||
void IN_DuckUp(void) {KeyUp(&in_duck);}
|
||||
// tankefugl: duck toggle
|
||||
void IN_DuckToggle(void)
|
||||
{
|
||||
g_bDuckToggled = !g_bDuckToggled;
|
||||
}
|
||||
// :tankefugl
|
||||
void IN_ReloadDown(void) {KeyDown(&in_reload);}
|
||||
void IN_ReloadUp(void) {KeyUp(&in_reload);}
|
||||
void IN_Alt1Down(void) {KeyDown(&in_alt1);}
|
||||
|
@ -1318,10 +1328,19 @@ int CL_ButtonBits( int bResetState )
|
|||
bits |= IN_ATTACK;
|
||||
}
|
||||
|
||||
if (in_duck.state & 3)
|
||||
// tankefugl: duck toggle
|
||||
if ( g_bDuckToggled )
|
||||
{
|
||||
if (!(in_duck.state & 3))
|
||||
{
|
||||
bits |= IN_DUCK;
|
||||
}
|
||||
}
|
||||
else if (in_duck.state & 3)
|
||||
{
|
||||
bits |= IN_DUCK;
|
||||
}
|
||||
// :tankefugl
|
||||
|
||||
if (in_jump.state & 3)
|
||||
{
|
||||
|
@ -1489,6 +1508,9 @@ void InitInput (void)
|
|||
gEngfuncs.pfnAddCommand ("-jlook", IN_JLookUp);
|
||||
gEngfuncs.pfnAddCommand ("+duck", IN_DuckDown);
|
||||
gEngfuncs.pfnAddCommand ("-duck", IN_DuckUp);
|
||||
// tankefugl: duck toggle
|
||||
gEngfuncs.pfnAddCommand ("toggleduck", IN_DuckToggle);
|
||||
// :tankefugl
|
||||
gEngfuncs.pfnAddCommand ("+reload", IN_ReloadDown);
|
||||
gEngfuncs.pfnAddCommand ("-reload", IN_ReloadUp);
|
||||
gEngfuncs.pfnAddCommand ("+alt1", IN_Alt1Down);
|
||||
|
|
|
@ -707,7 +707,10 @@ TeamFortressViewport::TeamFortressViewport(int x,int y,int wide,int tall) : Pane
|
|||
|
||||
CreateServerBrowser();
|
||||
|
||||
m_chatPanel = new ChatPanel(10, (ScreenHeight() * 0.75 - 30) / 2, ScreenWidth() - 20, 30);
|
||||
// tankefugl: 0000989:
|
||||
// m_chatPanel = new ChatPanel(10, (ScreenHeight() * 0.75 - 30) / 2, ScreenWidth() - 20, 30);
|
||||
m_chatPanel = new ChatPanel(10, ScreenHeight() * 0.75f - 30, ScreenWidth() - 20, 30);
|
||||
// :tankefugl
|
||||
m_chatPanel->setParent(this);
|
||||
m_chatPanel->setVisible(false);
|
||||
|
||||
|
|
|
@ -1702,6 +1702,14 @@ Vector CBaseEntity::FireBulletsPlayer ( ULONG cShots, Vector vecSrc, Vector vecD
|
|||
// x * vecSpread.x * vecRight +
|
||||
// y * vecSpread.y * vecUp;
|
||||
|
||||
// tankefugl: 0000973
|
||||
// added inner cone for half of the shots
|
||||
if (isShotgun && (iShot > (cShots/2)))
|
||||
{
|
||||
vecSpread = kSGInnerSpread;
|
||||
}
|
||||
// :tankefugl
|
||||
|
||||
Vector vecDir = UTIL_GetRandomSpreadDir(shared_rand, iShot, vecDirShooting, vecRight, vecUp, vecSpread);
|
||||
Vector vecEnd;
|
||||
|
||||
|
@ -1730,16 +1738,19 @@ Vector CBaseEntity::FireBulletsPlayer ( ULONG cShots, Vector vecSrc, Vector vecD
|
|||
|
||||
if(theAdjustedDamage)
|
||||
{
|
||||
if ( isShotgun && !( theEntityHit->pev->iuser3 & AVH_USER3_BREAKABLE) )
|
||||
{
|
||||
float distance=fabs((vecSrc - theEntityHit->pev->origin).Length());
|
||||
if ( distance > BALANCE_VAR(kShotgunDamageRange) )
|
||||
{
|
||||
float fallOffDistance=distance-BALANCE_VAR(kShotgunDamageRange);
|
||||
float fallOff=max(0.0f, 1.0f-(fallOffDistance/(kSGRange/2)));
|
||||
theAdjustedDamage*=fallOff;
|
||||
}
|
||||
}
|
||||
// tankefugl: 0000973
|
||||
// removed shotgun fallof
|
||||
//if ( isShotgun && !( theEntityHit->pev->iuser3 & AVH_USER3_BREAKABLE) )
|
||||
//{
|
||||
// float distance=fabs((vecSrc - theEntityHit->pev->origin).Length());
|
||||
// if ( distance > BALANCE_VAR(kShotgunDamageRange) )
|
||||
// {
|
||||
// float fallOffDistance=distance-BALANCE_VAR(kShotgunDamageRange);
|
||||
// float fallOff=max(0.0, 1.0f-(fallOffDistance/(kSGRange/2)));
|
||||
// theAdjustedDamage*=fallOff;
|
||||
// }
|
||||
//}
|
||||
// :tankefugl
|
||||
if ( theAdjustedDamage ) {
|
||||
theEntityHit->TraceAttack(pevAttacker, theAdjustedDamage, vecDir, &tr, theDamageType | ((theAdjustedDamage > 16) ? DMG_ALWAYSGIB : DMG_NEVERGIB) );
|
||||
}
|
||||
|
|
|
@ -360,7 +360,13 @@ void CVoiceStatus::CreateEntities()
|
|||
pEnt->baseline.renderamt = 255;
|
||||
pEnt->curstate.renderfx = kRenderFxNoDissipation;
|
||||
pEnt->curstate.framerate = 1;
|
||||
// tankefugl: different sprite for each team
|
||||
if (pClient->curstate.team <= SPR_Frames(m_VoiceHeadModel))
|
||||
pEnt->curstate.frame = pClient->curstate.team;
|
||||
else
|
||||
pEnt->curstate.frame = 0;
|
||||
//pEnt->curstate.frame = 0;
|
||||
// :tankefugl
|
||||
pEnt->model = (struct model_s*)gEngfuncs.GetSpritePointer(m_VoiceHeadModel);
|
||||
pEnt->angles[0] = pEnt->angles[1] = pEnt->angles[2] = 0;
|
||||
pEnt->curstate.scale = 0.5f;
|
||||
|
|
|
@ -186,11 +186,14 @@ int AvHBasePlayerWeapon::AddToPlayer( CBasePlayer *pPlayer )
|
|||
|
||||
BOOL AvHBasePlayerWeapon::Deploy()
|
||||
{
|
||||
char* theDeploySound = this->GetDeploySound();
|
||||
if(theDeploySound)
|
||||
{
|
||||
EMIT_SOUND(ENT(this->pev), CHAN_WEAPON, this->GetDeploySound(), this->GetDeploySoundVolume(), ATTN_NORM);
|
||||
}
|
||||
// tankefugl: 0000938
|
||||
// removed deploy sounds for all weapons, leaving the sounds to the models
|
||||
// char* theDeploySound = this->GetDeploySound();
|
||||
// if(theDeploySound)
|
||||
// {
|
||||
// EMIT_SOUND(ENT(this->pev), CHAN_WEAPON, this->GetDeploySound(), this->GetDeploySoundVolume(), ATTN_NORM);
|
||||
//}
|
||||
// :tankefugl
|
||||
|
||||
char* theAnimExt = this->GetAnimationExtension();
|
||||
|
||||
|
|
|
@ -646,6 +646,13 @@ void AvHHud::ClearData()
|
|||
this->mCurrentGhostIsValid = false;
|
||||
|
||||
this->mAmbientSounds.clear();
|
||||
|
||||
// tankefugl: 0000971
|
||||
this->mTeammateOrder.clear();
|
||||
this->mDisplayOrderIndex = 0;
|
||||
this->mDisplayOrderTime = 0;
|
||||
this->mDisplayOrderType = 0;
|
||||
// :tankefugl
|
||||
}
|
||||
|
||||
|
||||
|
@ -2036,31 +2043,41 @@ void AvHHud::OrderNotification(const AvHOrder& inOrder)
|
|||
AvHOrderType theOrderType = inOrder.GetOrderType();
|
||||
AvHHUDSound theSound = HUD_SOUND_INVALID;
|
||||
|
||||
// tankefugl: 0000992
|
||||
// popup indicator for order
|
||||
bool thePopup = false;
|
||||
|
||||
// Play HUD sound depending on order
|
||||
switch(theOrderType)
|
||||
{
|
||||
case ORDERTYPEL_MOVE:
|
||||
theSound = HUD_SOUND_ORDER_MOVE;
|
||||
thePopup = true;
|
||||
break;
|
||||
|
||||
case ORDERTYPET_ATTACK:
|
||||
theSound = HUD_SOUND_ORDER_ATTACK;
|
||||
thePopup = true;
|
||||
break;
|
||||
|
||||
case ORDERTYPET_BUILD:
|
||||
theSound = HUD_SOUND_ORDER_BUILD;
|
||||
thePopup = true;
|
||||
break;
|
||||
|
||||
case ORDERTYPET_GUARD:
|
||||
theSound = HUD_SOUND_ORDER_GUARD;
|
||||
thePopup = true;
|
||||
break;
|
||||
|
||||
case ORDERTYPET_WELD:
|
||||
theSound = HUD_SOUND_ORDER_WELD;
|
||||
thePopup = true;
|
||||
break;
|
||||
|
||||
case ORDERTYPET_GET:
|
||||
theSound = HUD_SOUND_ORDER_GET;
|
||||
thePopup = true;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2070,6 +2087,13 @@ void AvHHud::OrderNotification(const AvHOrder& inOrder)
|
|||
}
|
||||
|
||||
this->PlayHUDSound(theSound);
|
||||
|
||||
// tankefugl: 0000992
|
||||
if (thePopup)
|
||||
{
|
||||
this->SetDisplayOrder(2, this->GetFrameForOrderType(theOrderType), "", "", "");
|
||||
}
|
||||
// :tankefugl
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
@ -2289,6 +2313,55 @@ int AvHHud::MiniMap(const char* pszName, int iSize, void* pbuf)
|
|||
return 1;
|
||||
}
|
||||
|
||||
// tankefugl: 0000971
|
||||
BIND_MESSAGE(IssueOrder);
|
||||
int AvHHud::IssueOrder(const char* pszName, int iSize, void* pbuf)
|
||||
{
|
||||
int ordertype, ordersource, ordertarget;
|
||||
NetMsg_IssueOrder( pbuf, iSize, ordertype, ordersource, ordertarget);
|
||||
|
||||
float now = this->GetTimeOfLastUpdate();
|
||||
TeammateOrderListType::iterator theIter = this->mTeammateOrder.find(ordersource);
|
||||
if (theIter == this->mTeammateOrder.end())
|
||||
{
|
||||
this->mTeammateOrder.insert(theIter, pair<int, TeammateOrderType>(ordersource, TeammateOrderType(ordertype, now)));
|
||||
}
|
||||
else
|
||||
{
|
||||
TeammateOrderType *theOrder = &((*theIter).second);
|
||||
(*theOrder).first = ordertype;
|
||||
(*theOrder).second = now;
|
||||
}
|
||||
|
||||
if (this->GetInTopDownMode() == false)
|
||||
{
|
||||
cl_entity_s* theLocalPlayer = gEngfuncs.GetLocalPlayer();
|
||||
if (theLocalPlayer->index == ordertarget)
|
||||
{
|
||||
hud_player_info_t info;
|
||||
memset(&info, 0, sizeof(info));
|
||||
GetPlayerInfo(ordersource, &info);
|
||||
|
||||
string temp;
|
||||
string nameFormat;
|
||||
// fetch from titles.txt
|
||||
sprintf(temp, "TeammateOrder%d", ordertype);
|
||||
LocalizeString(temp.c_str(), nameFormat);
|
||||
sprintf(temp, nameFormat.c_str(), info.name);
|
||||
|
||||
this->SetDisplayOrder(1, ordertype, temp, "", "");
|
||||
}
|
||||
if (theLocalPlayer->index == ordersource)
|
||||
{
|
||||
this->mCurrentOrderTarget = ordertarget;
|
||||
this->mCurrentOrderType = ordertype;
|
||||
this->mCurrentOrderTime = now;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
// :tankefugl
|
||||
|
||||
BIND_MESSAGE(ServerVar);
|
||||
int AvHHud::ServerVar(const char* pszName, int iSize, void* pbuf)
|
||||
|
@ -2461,6 +2534,20 @@ void AvHHud::ResetGame(bool inMapChanged)
|
|||
this->mTimeOfLastLevelUp = -1;
|
||||
|
||||
memset(this->mMenuImpulses, MESSAGE_NULL, sizeof(AvHMessageID)*kNumUpgradeLines);
|
||||
|
||||
// tankefugl: 0000992 & 0000971
|
||||
this->mTeammateOrder.clear();
|
||||
this->mCurrentOrderTarget = 0;
|
||||
this->mCurrentOrderType = 0;
|
||||
this->mCurrentOrderTime = 0.0f;
|
||||
|
||||
this->mDisplayOrderTime = 0.0f;
|
||||
this->mDisplayOrderType = 0;
|
||||
this->mDisplayOrderIndex = 0;
|
||||
this->mDisplayOrderText1 = "";
|
||||
this->mDisplayOrderText2 = "";
|
||||
this->mDisplayOrderText3 = "";
|
||||
// :tankefugl
|
||||
}
|
||||
|
||||
BIND_MESSAGE(SetGmma);
|
||||
|
@ -2818,7 +2905,7 @@ int AvHHud::PlayHUDNot(const char* pszName, int iSize, void* pbuf)
|
|||
{
|
||||
// Push back icon
|
||||
HUDNotificationType theNotification;
|
||||
theNotification.mStructureID = (AvHMessageID)sound;
|
||||
theNotification.mStructureID = (AvHMessageID)message_id;
|
||||
theNotification.mTime = this->mTimeOfCurrentUpdate;
|
||||
theNotification.mLocation = Vector(location_x, location_y, 0.0f);
|
||||
|
||||
|
@ -3475,6 +3562,9 @@ void AvHHud::Init(void)
|
|||
HOOK_MESSAGE(AlienInfo);
|
||||
HOOK_MESSAGE(DebugCSP);
|
||||
HOOK_MESSAGE(TechSlots);
|
||||
// tankefugl: 0000971
|
||||
HOOK_MESSAGE(IssueOrder);
|
||||
// :tankefugl
|
||||
|
||||
HOOK_MESSAGE(ServerVar);
|
||||
|
||||
|
@ -3702,7 +3792,7 @@ void AvHHud::SetHelpMessage(const string& inHelpText, bool inForce, float inNorm
|
|||
if(inForce || gEngfuncs.pfnGetCvarFloat(kvAutoHelp))
|
||||
{
|
||||
float theReticleX = kHelpMessageLeftEdgeInset;
|
||||
float theReticleY = kHelpMessageTopEdgeInset;
|
||||
float theReticleY = kHelpMessageTopEdgeInset - 0.15f;
|
||||
bool theCentered = false;
|
||||
|
||||
if(this->GetInTopDownMode())
|
||||
|
@ -3723,7 +3813,7 @@ void AvHHud::SetHelpMessage(const string& inHelpText, bool inForce, float inNorm
|
|||
if(this->GetIsAlien())
|
||||
{
|
||||
theReticleX = kHelpMessageAlienLeftedgeInset;
|
||||
theReticleY = kHelpMessageAlienTopEdgeInset;
|
||||
theReticleY = kHelpMessageAlienTopEdgeInset - 0.15f;
|
||||
}
|
||||
|
||||
if(inNormX != -1)
|
||||
|
|
|
@ -397,6 +397,9 @@ public:
|
|||
|
||||
int GameStatus(const char* pszName, int iSize, void* pbuf);
|
||||
int MiniMap(const char* pszName, int iSize, void* pbuf);
|
||||
// tankefugl: 0000971
|
||||
int IssueOrder(const char* pszName, int iSize, void* pbuf);
|
||||
// :tankefugl
|
||||
int Progress(const char* pszName, int iSize, void* pbuf);
|
||||
int SetGmma(const char* pszName, int iSize, void* pbuf);
|
||||
int SetSelect(const char* pszName, int iSize, void* pbuf);
|
||||
|
@ -440,12 +443,20 @@ private:
|
|||
void DrawMouseCursor(int inBaseX, int inBaseY);
|
||||
void DrawOrders();
|
||||
void DrawHelpIcons();
|
||||
// tankefugl: 0000971
|
||||
void DrawTeammateOrders();
|
||||
// tankefugl: 0000992
|
||||
void DrawDisplayOrder();
|
||||
void SetDisplayOrder(int inOrderType, int inOrderIndex, string inText1, string inText2, string inText3);
|
||||
// :tankefugl
|
||||
void DrawHUDStructureNotification();
|
||||
void DrawInfoLocationText();
|
||||
void DrawPlayerNames();
|
||||
void DrawReticleInfo();
|
||||
void DrawToolTips();
|
||||
void DrawWorldSprite(int inSpriteHandle, int inRenderMode, vec3_t inWorldPosition, int inFrame, float inWorldSize);
|
||||
// tankefugl: 0000971 -- added inAlpha
|
||||
void DrawWorldSprite(int inSpriteHandle, int inRenderMode, vec3_t inWorldPosition, int inFrame, float inWorldSize, float inAlpha = 1.0f);
|
||||
// :tankefugl
|
||||
void DrawOrderIcon(const AvHOrder& inOrder);
|
||||
void DrawOrderText(const AvHOrder& inOrder);
|
||||
int GetFrameForOrderType(AvHOrderType inOrderType) const;
|
||||
|
@ -584,6 +595,19 @@ private:
|
|||
OrderListType mOrders;
|
||||
//AvHOrderType mOrderMode;
|
||||
|
||||
// tankefugl: 0000971
|
||||
map< int, TeammateOrderType > mTeammateOrder;
|
||||
// tankefugl: 0000992
|
||||
float mDisplayOrderTime;
|
||||
int mDisplayOrderType;
|
||||
int mDisplayOrderIndex;
|
||||
string mDisplayOrderText1;
|
||||
string mDisplayOrderText2;
|
||||
string mDisplayOrderText3;
|
||||
int mCurrentOrderTarget;
|
||||
int mCurrentOrderType;
|
||||
float mCurrentOrderTime;
|
||||
// :tankefugl
|
||||
AvHMessageID mTechEvent;
|
||||
AvHMessageID mAlienAbility;
|
||||
AvHMessageID mGroupEvent;
|
||||
|
@ -671,6 +695,9 @@ private:
|
|||
HSPRITE mMarineOrderIndicator;
|
||||
HSPRITE mMarineUpgradesSprite;
|
||||
|
||||
// tankefugl: 0000971
|
||||
HSPRITE mTeammateOrderSprite;
|
||||
// :tankefugl
|
||||
typedef map<int, int> SpriteListType;
|
||||
SpriteListType mActionButtonSprites;
|
||||
//SpriteListType mHelpSprites;
|
||||
|
|
|
@ -139,6 +139,7 @@
|
|||
#include "mod/AvHSpriteAPI.h"
|
||||
#include "mod/AvHParticleEditorHandler.h"
|
||||
#include <list>
|
||||
#include "common/entity_types.h"
|
||||
|
||||
void IN_GetMousePos( int *mx, int *my );
|
||||
|
||||
|
@ -883,7 +884,8 @@ void AvHHud::DrawToolTips()
|
|||
}
|
||||
}
|
||||
|
||||
void AvHHud::DrawWorldSprite(int inSpriteHandle, int inRenderMode, vec3_t inWorldPosition, int inFrame, float inWorldSize)
|
||||
void AvHHud::DrawWorldSprite(int inSpriteHandle, int inRenderMode, vec3_t inWorldPosition, int inFrame, float inWorldSize, float inAlpha)
|
||||
// tankefugl: added inAlpha
|
||||
{
|
||||
vec3_t theUpperLeft;
|
||||
vec3_t theLowerRight;
|
||||
|
@ -968,7 +970,7 @@ void AvHHud::DrawWorldSprite(int inSpriteHandle, int inRenderMode, vec3_t inWorl
|
|||
|
||||
//DrawScaledHUDSprite(inSpriteHandle, inRenderMode, 1, theScreenX, theScreenY, theWidth, theHeight, inFrame);
|
||||
|
||||
AvHSpriteSetColor(1, 1, 1);
|
||||
AvHSpriteSetColor(1, 1, 1, inAlpha);
|
||||
AvHSpriteSetRenderMode(inRenderMode);
|
||||
AvHSpriteDraw(inSpriteHandle, inFrame, theScreenX, theScreenY, theScreenX + theWidth, theScreenY + theHeight, 0, 0, 1, 1);
|
||||
|
||||
|
@ -1060,6 +1062,14 @@ void AvHHud::DrawOrderText(const AvHOrder& inOrder)
|
|||
string theTranslatedLocation = theLocationOfOrder;
|
||||
LocalizeString(theLocationOfOrder.c_str(), theTranslatedLocation);
|
||||
|
||||
// tankefugl: 0000992
|
||||
string theFirstLine = theLocalizedTitle;
|
||||
if(theRangeDisplayString != "")
|
||||
{
|
||||
theFirstLine += string(" : ") + theRangeDisplayString;
|
||||
}
|
||||
// :tankefugl
|
||||
|
||||
Vector theScreenPos;
|
||||
if(AvHCUWorldToScreen((float*)theOrderLocation, (float*)&theScreenPos))
|
||||
{
|
||||
|
@ -1087,7 +1097,180 @@ void AvHHud::DrawOrderText(const AvHOrder& inOrder)
|
|||
this->DrawHudStringCentered(theBaseX, theBaseY + 2*theStringHeight, ScreenWidth(), theTranslatedLocation.c_str(), theR, theG, theB);
|
||||
}
|
||||
}
|
||||
// tankefugl: 0000992
|
||||
if (this->mDisplayOrderType == 2)
|
||||
{
|
||||
// this->mDisplayOrderText1 = "The commander issued an order:";
|
||||
this->mDisplayOrderText1 = theFirstLine.c_str();
|
||||
this->mDisplayOrderText2 = theTranslatedLocation.c_str();
|
||||
}
|
||||
// :tankefugl
|
||||
}
|
||||
|
||||
// tankefugl: 0000992
|
||||
void AvHHud::SetDisplayOrder(int inOrderType, int inOrderIndex, string inText1, string inText2, string inText3)
|
||||
{
|
||||
this->mDisplayOrderTime = this->mTimeOfLastUpdate;
|
||||
this->mDisplayOrderType = inOrderType;
|
||||
this->mDisplayOrderIndex = inOrderIndex;
|
||||
this->mDisplayOrderText1 = inText1;
|
||||
this->mDisplayOrderText2 = inText2;
|
||||
this->mDisplayOrderText3 = inText3;
|
||||
}
|
||||
|
||||
void AvHHud::DrawDisplayOrder()
|
||||
{
|
||||
const float flashLength = 1.0f;
|
||||
const float fadeLimit = 6.0f;
|
||||
const float fadeEnd = 2.0f;
|
||||
|
||||
if ((this->mDisplayOrderType > 0) && (this->mDisplayOrderTime + fadeLimit + fadeEnd) > this->mTimeOfLastUpdate && (this->GetInTopDownMode() == false))
|
||||
{
|
||||
float theFade = 1.0f;
|
||||
if ((this->mDisplayOrderTime + fadeLimit) < this->mTimeOfLastUpdate)
|
||||
{
|
||||
theFade = 1.0f - (this->mTimeOfLastUpdate - (this->mDisplayOrderTime + fadeLimit)) / fadeEnd;
|
||||
if(theFade < 0.0f)
|
||||
{
|
||||
this->mDisplayOrderType = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// flash the icon for the first second
|
||||
if ((this->mDisplayOrderTime + flashLength) > this->mTimeOfLastUpdate)
|
||||
{
|
||||
if (((int)((this->mTimeOfLastUpdate - this->mDisplayOrderTime) * 8)) % 2)
|
||||
{
|
||||
theFade = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
// draw the panel
|
||||
// int sprite = Safe_SPR_Load(kWhiteSprite);
|
||||
|
||||
int r, g, b;
|
||||
GetPrimaryHudColor(r, g, b, true, false);
|
||||
|
||||
int theStringHeight = this->GetHudStringHeight();
|
||||
|
||||
// float mSelectionBoxX1 = 0.25f * ScreenWidth();
|
||||
// float mSelectionBoxY1 = 0.08f * ScreenHeight();
|
||||
// float mSelectionBoxX2 = mSelectionBoxX1 + 0.50f * ScreenWidth();
|
||||
// float mSelectionBoxY2 = mSelectionBoxY1 + 0.08f * ScreenWidth();
|
||||
|
||||
// float mIconX1 = mSelectionBoxX1 + 0.01f * ScreenWidth();
|
||||
// float mIconY1 = mSelectionBoxY1 + 0.01f * ScreenWidth();
|
||||
// float mIconX2 = mIconX1 + 0.06f * ScreenWidth();
|
||||
// float mIconY2 = mIconY1 + 0.06f * ScreenWidth();
|
||||
|
||||
// AvHSpriteSetRenderMode(kRenderTransAdd);
|
||||
// AvHSpriteSetColor(r / 255.0, g / 255.0, b / 255.0, 0.3 * theFade);
|
||||
// AvHSpriteSetDrawMode(kSpriteDrawModeFilled);
|
||||
// AvHSpriteDraw(sprite, 0, mSelectionBoxX1 + 1, mSelectionBoxY1 + 1, mSelectionBoxX2 - 1, mSelectionBoxY2 - 1, 0, 0, 1, 1);
|
||||
|
||||
// AvHSpriteSetRenderMode(kRenderTransAdd);
|
||||
// AvHSpriteSetColor(r / 255.0, g / 255.0, b / 255.0, 0.7 * theFade);
|
||||
// AvHSpriteSetDrawMode(kSpriteDrawModeBorder);
|
||||
// AvHSpriteDraw(sprite, 0, mSelectionBoxX1, mSelectionBoxY1, mSelectionBoxX2, mSelectionBoxY2, 0, 0, 1, 1);
|
||||
|
||||
float mIconX1 = 0.45f * ScreenWidth();
|
||||
float mIconY1 = 0.10f * ScreenHeight();
|
||||
float mIconX2 = mIconX1 + 0.10f * ScreenWidth();
|
||||
float mIconY2 = mIconY1 + 0.10f * ScreenWidth();
|
||||
|
||||
float mTextX1 = 0.50f * ScreenWidth();
|
||||
|
||||
AvHSpriteSetRenderMode(kRenderTransAdd);
|
||||
AvHSpriteSetDrawMode(kSpriteDrawModeFilled);
|
||||
AvHSpriteSetColor(1, 1, 1, 1 * theFade);
|
||||
|
||||
if (this->mDisplayOrderType == 1)
|
||||
{
|
||||
AvHSpriteDraw(this->mTeammateOrderSprite, this->mDisplayOrderIndex + 8, mIconX1, mIconY1, mIconX2, mIconY2, 0, 0, 1, 1);
|
||||
this->DrawHudStringCentered(mTextX1, mIconY2, ScreenWidth(), this->mDisplayOrderText1.c_str(), r, g, b);
|
||||
}
|
||||
else if (this->mDisplayOrderType == 2)
|
||||
{
|
||||
AvHSpriteDraw(this->mOrderSprite, this->mDisplayOrderIndex, mIconX1, mIconY1, mIconX2, mIconY2, 0, 0, 1, 1);
|
||||
this->DrawHudStringCentered(mTextX1, mIconY2, ScreenWidth(), this->mDisplayOrderText1.c_str(), r, g, b);
|
||||
this->DrawHudStringCentered(mTextX1, mIconY2 + theStringHeight, ScreenWidth(), this->mDisplayOrderText2.c_str(), r, g, b);
|
||||
}
|
||||
|
||||
|
||||
// float mTextX1 = mIconX2 + 0.02 * ScreenWidth();
|
||||
// this->DrawHudString(mTextX1, mIconY1, ScreenWidth(), this->mDisplayOrderText1.c_str(), r, g, b);
|
||||
// this->DrawHudString(mTextX1, mIconY1 + theStringHeight, ScreenWidth(), this->mDisplayOrderText2.c_str(), r, g, b);
|
||||
// this->DrawHudString(mTextX1, mIconY1 + theStringHeight * 2, ScreenWidth(), this->mDisplayOrderText3.c_str(), r, g, b);
|
||||
}
|
||||
}
|
||||
// :tankefugl
|
||||
|
||||
// tankefugl: 0000971
|
||||
void AvHHud::DrawTeammateOrders()
|
||||
{
|
||||
TeammateOrderListType::iterator toErase = NULL;
|
||||
cl_entity_s* theLocalPlayer = gEngfuncs.GetLocalPlayer();
|
||||
|
||||
const float flashLength = 1.0f;
|
||||
const float fadeLimit = 6.0f;
|
||||
const float fadeEnd = 2.0f;
|
||||
|
||||
for(TeammateOrderListType::iterator theIter = this->mTeammateOrder.begin(); theIter != this->mTeammateOrder.end(); theIter++)
|
||||
{
|
||||
TeammateOrderType theOrder = (*theIter).second;
|
||||
int theEntIndex = (*theIter).first;
|
||||
float theFade = 1.0f;
|
||||
|
||||
// remove the order if it has expired
|
||||
if((theOrder.second + fadeEnd + fadeLimit) < this->mTimeOfLastUpdate)
|
||||
{
|
||||
toErase = theIter;
|
||||
continue;
|
||||
}
|
||||
// draw the order fading away
|
||||
else if((theOrder.second + fadeLimit) < this->mTimeOfLastUpdate)
|
||||
{
|
||||
theFade = 1.0f - (this->mTimeOfLastUpdate - (theOrder.second + fadeLimit)) / fadeEnd;
|
||||
if(theFade < 0.0f)
|
||||
theFade = 0.0f;
|
||||
}
|
||||
// else, draw the order normally
|
||||
|
||||
cl_entity_s* theEntity = gEngfuncs.GetEntityByIndex(theEntIndex);
|
||||
if (theEntity && (theEntIndex < MAX_PLAYERS && theEntIndex >= 0) && (theEntity->index != theLocalPlayer->index))
|
||||
{
|
||||
if (AvHTraceLineAgainstWorld(theLocalPlayer->origin, theEntity->origin) == 1.0f)
|
||||
{
|
||||
vec3_t theVec;
|
||||
VectorCopy(theEntity->origin, theVec);
|
||||
theVec[2] += AvHCUGetIconHeightForPlayer((AvHUser3)theEntity->curstate.iuser3);
|
||||
this->DrawWorldSprite(this->mTeammateOrderSprite, kRenderTransAdd, theVec, theOrder.first, kHelpIconDrawSize, theFade);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (toErase != NULL)
|
||||
this->mTeammateOrder.erase(toErase);
|
||||
|
||||
// flash target player
|
||||
if (((this->mCurrentOrderTime + flashLength) > this->mTimeOfLastUpdate) && (this->mCurrentOrderTarget > 0))
|
||||
{
|
||||
if (((int)((this->mTimeOfLastUpdate - (this->mCurrentOrderTime + flashLength)) * 8)) % 2)
|
||||
{
|
||||
cl_entity_s* theTargetEntity = gEngfuncs.GetEntityByIndex(this->mCurrentOrderTarget);
|
||||
|
||||
vec3_t theVec;
|
||||
VectorCopy(theTargetEntity->origin, theVec);
|
||||
theVec[2] += AvHCUGetIconHeightForPlayer((AvHUser3)theTargetEntity->curstate.iuser3);
|
||||
this->DrawWorldSprite(this->mTeammateOrderSprite, kRenderTransAdd, theVec, this->mCurrentOrderType, kHelpIconDrawSize, 1.0f);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// :tankefugl
|
||||
|
||||
void AvHHud::DrawOrders()
|
||||
{
|
||||
|
@ -2220,8 +2403,11 @@ void AvHHud::DrawBuildHealthEffectsForEntity(int inEntityIndex, float inAlpha)
|
|||
// It's an unfriendly building that's very close OR
|
||||
(!theEntityIsPlayer && (theDistanceToEntity < kDrawEnemyBuildingDistance)) ||
|
||||
|
||||
// It's a friendly entity and we're a builder
|
||||
(theIsOnOurTeam && (this->GetHUDUser3() == AVH_USER3_ALIEN_PLAYER2))
|
||||
// It's a friendly entity and we're a builder OR
|
||||
(theIsOnOurTeam && (this->GetHUDUser3() == AVH_USER3_ALIEN_PLAYER2)) ||
|
||||
|
||||
// welder/healing spray is selected
|
||||
(this->mCurrentWeaponID == 18 || this->mCurrentWeaponID == 27)
|
||||
|
||||
)
|
||||
{
|
||||
|
@ -2344,16 +2530,17 @@ void AvHHud::DrawSelectionAndBuildEffects()
|
|||
// :tankefugl
|
||||
}
|
||||
|
||||
// tankefugl: 0000988
|
||||
// tankefugl: 0000988 & 0000991
|
||||
bool maintanceWeaponSelected = (this->mCurrentWeaponID == 18 || this->mCurrentWeaponID == 27);
|
||||
bool isCommander = this->GetInTopDownMode();
|
||||
if (isCommander || maintanceWeaponSelected) {
|
||||
gEngfuncs.pEventAPI->EV_SetUpPlayerPrediction( false, true );
|
||||
gEngfuncs.pEventAPI->EV_PushPMStates();
|
||||
gEngfuncs.pEventAPI->EV_SetSolidPlayers(-1);
|
||||
|
||||
if (this->GetInTopDownMode()) {
|
||||
int localPlayerIndex = gEngfuncs.GetLocalPlayer()->index;
|
||||
physent_t *thePlayer = gEngfuncs.pEventAPI->EV_GetPhysent(localPlayerIndex);
|
||||
// gEngfuncs.Con_Printf("gEngfuncs.GetLocalPlayer()->index = %d, thePlayer->team = %d\n", gEngfuncs.GetLocalPlayer()->index, thePlayer->team);
|
||||
|
||||
physent_t *thePlayer = gEngfuncs.pEventAPI->EV_GetPhysent(localPlayerIndex);
|
||||
if (thePlayer)
|
||||
{
|
||||
physent_t* theEntity = NULL;
|
||||
|
@ -2372,7 +2559,13 @@ void AvHHud::DrawSelectionAndBuildEffects()
|
|||
bool theIsPlayer = ((theEntityIndex >= 1) && (theEntityIndex <= gEngfuncs.GetMaxClients()));
|
||||
bool theSameTeam = (theEntity->team == thePlayer->team );
|
||||
|
||||
if(theIsPlayer || theSameTeam)
|
||||
if (isCommander && (theIsPlayer || theSameTeam))
|
||||
{
|
||||
this->DrawBuildHealthEffectsForEntity(theEntityIndex, 0.2);
|
||||
}
|
||||
else if (maintanceWeaponSelected && theSameTeam && !theIsPlayer)
|
||||
{
|
||||
if (AvHTraceLineAgainstWorld(gEngfuncs.GetLocalPlayer()->origin, theEntity->origin) == 1.0f)
|
||||
{
|
||||
this->DrawBuildHealthEffectsForEntity(theEntityIndex, 0.3);
|
||||
}
|
||||
|
@ -2383,6 +2576,7 @@ void AvHHud::DrawSelectionAndBuildEffects()
|
|||
}
|
||||
}
|
||||
gEngfuncs.pEventAPI->EV_PopPMStates();
|
||||
}
|
||||
// :tankefugl
|
||||
}
|
||||
|
||||
|
@ -2534,6 +2728,11 @@ void AvHHud::RenderCommonUI()
|
|||
|
||||
this->DrawOrders();
|
||||
this->DrawHelpIcons();
|
||||
// tankefugl: 0000971
|
||||
this->DrawTeammateOrders();
|
||||
// tankefugl: 0000992
|
||||
this->DrawDisplayOrder();
|
||||
// :tankefugl
|
||||
|
||||
if (this->GetIsCombatMode())
|
||||
{
|
||||
|
@ -3373,8 +3572,13 @@ void AvHHud::RenderAlienUI()
|
|||
const float kTextInset = kResourceEnergyBarWidth*.5f;
|
||||
const int kNumericYOffset = 1.5*this->GetHudStringHeight();
|
||||
|
||||
int theResourceLabelX = mViewport[0] + kTextInset*ScreenWidth();
|
||||
int theResourceLabelY = theY - + .05f * ScreenHeight();
|
||||
// tankefugl: 0000989
|
||||
// moved resource label a bit down
|
||||
//int theResourceLabelX = mViewport[0] + kTextInset*ScreenWidth();
|
||||
//int theResourceLabelY = theY - + .05f * ScreenHeight();
|
||||
int theResourceLabelX = 10;
|
||||
int theResourceLabelY = .68f * ScreenHeight();
|
||||
// :tankefugl
|
||||
|
||||
if(this->mMapMode == MAP_MODE_NS)
|
||||
{
|
||||
|
@ -3991,6 +4195,10 @@ void AvHHud::VidInit(void)
|
|||
string theIconName = string(kHelpIconPrefix) + ".spr";
|
||||
this->mHelpSprite = Safe_SPR_Load(theIconName.c_str());
|
||||
|
||||
// tankefugl: 0000971
|
||||
this->mTeammateOrderSprite = Safe_SPR_Load(kTeammateOrderSprite);
|
||||
// :tankefugl
|
||||
|
||||
this->mEnemyBlips.VidInit();
|
||||
this->mFriendlyBlips.VidInit();
|
||||
}
|
||||
|
|
|
@ -1693,6 +1693,7 @@ char* AvHNuke::GetKilledSound() const
|
|||
|
||||
|
||||
const float kInfantryPortalThinkTime = 1.0f;
|
||||
#define kInfantryPortalLightEffect EF_LIGHT
|
||||
|
||||
AvHInfantryPortal::AvHInfantryPortal() : AvHMarineBaseBuildable(TECH_INFANTRYPORTAL, BUILD_INFANTRYPORTAL, kwsInfantryPortal, AVH_USER3_INFANTRYPORTAL)
|
||||
{
|
||||
|
@ -1741,6 +1742,7 @@ void AvHInfantryPortal::SetHasBeenBuilt()
|
|||
|
||||
SetThink(&AvHInfantryPortal::PortalThink);
|
||||
this->pev->nextthink = gpGlobals->time + kInfantryPortalThinkTime;
|
||||
this->pev->effects |= kInfantryPortalLightEffect;
|
||||
}
|
||||
|
||||
void AvHInfantryPortal::Precache()
|
||||
|
@ -1813,6 +1815,7 @@ void AvHInfantryPortal::ResetReinforcingPlayer(bool inSuccess)
|
|||
void AvHInfantryPortal::UpdateOnRecycle(void)
|
||||
{
|
||||
this->ResetReinforcingPlayer(false);
|
||||
this->pev->effects &= ~kInfantryPortalLightEffect;
|
||||
}
|
||||
|
||||
void AvHInfantryPortal::UpdateOnRemove(void)
|
||||
|
@ -1839,6 +1842,18 @@ int AvHInfantryPortal::GetIdle2Animation() const
|
|||
return 2;
|
||||
}
|
||||
|
||||
// tankefugl:
|
||||
int AvHInfantryPortal::GetDeployAnimation() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int AvHInfantryPortal::GetSpawnAnimation() const
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
// :tankefugl
|
||||
|
||||
const int kCommandStationExitAnimation = 12;
|
||||
|
||||
AvHCommandStation::AvHCommandStation() : AvHMarineBaseBuildable(TECH_COMMAND_CENTER, BUILD_COMMANDSTATION, kwsTeamCommand, AVH_USER3_COMMANDER_STATION)
|
||||
|
|
|
@ -309,6 +309,9 @@ public:
|
|||
virtual int GetIdle1Animation() const;
|
||||
virtual int GetIdle2Animation() const;
|
||||
|
||||
virtual int GetDeployAnimation() const;
|
||||
virtual int GetSpawnAnimation() const;
|
||||
|
||||
protected:
|
||||
|
||||
virtual void ResetReinforcingPlayer(bool inSuccess);
|
||||
|
|
|
@ -152,7 +152,7 @@ const int kHGBarrelLength = 10;
|
|||
#define kHGSpread VECTOR_CONE_1DEGREES
|
||||
|
||||
// Sonic/Shot gun constants.
|
||||
const int kSGRange = 700;
|
||||
const int kSGRange = 8192;
|
||||
const float kSGXPunch = .8f;
|
||||
#define kSGEjectModel "models/shotshell.mdl"
|
||||
#define kSGEventName "events/SonicGun.sc"
|
||||
|
@ -169,6 +169,7 @@ const float kSGXPunch = .8f;
|
|||
#define kSGDeploySound "weapons/sg-deploy.wav"
|
||||
const int kSGBarrelLength = 25;
|
||||
#define kSGSpread VECTOR_CONE_20DEGREES
|
||||
#define kSGInnerSpread VECTOR_CONE_7DEGREES
|
||||
|
||||
// Heavy machine gun
|
||||
const int kHMGRange = 6000;
|
||||
|
|
|
@ -22,7 +22,7 @@ int g_msgAmmoPickup = 0, g_msgAmmoX, g_msgBattery, g_msgCurWeapon, g_msgDamage,
|
|||
g_msgServerVar, g_msgSetGammaRamp, g_msgSetOrder, g_msgSetParticleTemplates,
|
||||
g_msgSetSelect, g_msgSetRequest, g_msgSetSoundNames, g_msgSetTechNodes, g_msgSetTechSlots,
|
||||
g_msgSetTopDown, g_msgSetupMap, g_msgUpdateCountdown, g_msgUpdateEntityHierarchy,
|
||||
g_msgProfileInfo, g_msgNexusBytes;
|
||||
g_msgProfileInfo, g_msgNexusBytes, g_msgIssueOrder;
|
||||
|
||||
void Net_InitializeMessages(void)
|
||||
{
|
||||
|
@ -87,6 +87,9 @@ void Net_InitializeMessages(void)
|
|||
g_msgUpdateEntityHierarchy = REG_USER_MSG( "EntHier", -1 );
|
||||
g_msgProfileInfo = REG_USER_MSG( "ProfileInfo", 8 );
|
||||
g_msgNexusBytes = REG_USER_MSG( "NexusBytes", -1 );
|
||||
// tankefugl: 0000971
|
||||
g_msgIssueOrder = REG_USER_MSG( "IssueOrder", 9);
|
||||
// :tankefugl
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -2101,3 +2104,27 @@ const int kEntHierFlagDeletion = 0x02;
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
// tankefugl: 0000971
|
||||
#ifndef AVH_SERVER
|
||||
void NetMsg_IssueOrder( void* const buffer, const int size, int& ordertype, int& ordersource, int& ordertarget )
|
||||
{
|
||||
BEGIN_READ( buffer, size );
|
||||
ordertype = READ_BYTE();
|
||||
ordersource = READ_LONG();
|
||||
ordertarget = READ_LONG();
|
||||
END_READ();
|
||||
}
|
||||
#else
|
||||
void NetMsg_IssueOrder( entvars_t* const pev, const int ordertype, const int ordersource, const int ordertarget)
|
||||
{
|
||||
MESSAGE_BEGIN( MSG_ONE, g_msgIssueOrder, NULL, pev );
|
||||
WRITE_BYTE( ordertype );
|
||||
WRITE_LONG( ordersource );
|
||||
WRITE_LONG( ordertarget );
|
||||
MESSAGE_END();
|
||||
}
|
||||
#endif
|
||||
// :tankefugl
|
|
@ -106,6 +106,7 @@
|
|||
void NetMsg_SetupMap_Extents( entvars_t* const pev, const string& name, const float* const min_extents, const float* const max_extents, const bool draw_background );
|
||||
void NetMsg_SetupMap_Location( entvars_t* const pev, const string& name, const float* const min_extents, const float* const max_extents );
|
||||
void NetMsg_UpdateEntityHierarchy( entvars_t* const pev, const MapEntityMap& NewItems, const EntityListType& OldItems );
|
||||
void NetMsg_IssueOrder(entvars_t* const pev, const int ordertype, const int ordersource, const int ordertarget);
|
||||
|
||||
//BROADCAST MESSAGE TRANSMISSION
|
||||
void NetMsg_DeathMsg( const int killer_index, const int victim_index, string& weapon_name );
|
||||
|
@ -195,6 +196,7 @@
|
|||
void NetMsg_SetupMap( void* const buffer, const int size, bool& is_location, string& name, float* min_extents, float* max_extents, bool& draw_background );
|
||||
void NetMsg_UpdateCountdown( void* const buffer, const int size, int& countdown );
|
||||
void NetMsg_UpdateEntityHierarchy( void* const buffer, const int size, MapEntityMap& NewItems, EntityListType& OldItems );
|
||||
void NetMsg_IssueOrder( void* const buffer, const int size, int& ordertype, int& ordersource, int& ordertarget );
|
||||
|
||||
#endif //AVH_SERVER
|
||||
|
||||
|
|
|
@ -82,6 +82,20 @@ private:
|
|||
};
|
||||
|
||||
typedef vector<AvHOrder> OrderListType;
|
||||
// tankefugl: 0000971
|
||||
typedef enum {
|
||||
TEAMMATE_MARINE_ORDER_WELD = 0,
|
||||
TEAMMATE_MARINE_ORDER_FOLLOW,
|
||||
TEAMMATE_MARINE_ORDER_COVER,
|
||||
TEAMMATE_MARINE_ORDER_UNKNOWN,
|
||||
TEAMMATE_ALIEN_ORDER_HEAL,
|
||||
TEAMMATE_ALIEN_ORDER_FOLLOW,
|
||||
TEAMMATE_ALIEN_ORDER_COVER,
|
||||
TEAMMATE_ALIEN_ORDER_UNKNOWN
|
||||
} TeammateOrderEnum;
|
||||
typedef pair<int, float> TeammateOrderType;
|
||||
typedef map<int, TeammateOrderType> TeammateOrderListType;
|
||||
// :tankefugl
|
||||
|
||||
void AvHChangeOrder(OrderListType& inList, const AvHOrder& inOrder);
|
||||
//void AvHRemovePlayerFromOrders(OrderListType& inList, int inPlayerIndex);
|
||||
|
|
|
@ -1208,6 +1208,10 @@ bool AvHPlayer::ExecuteMessage(AvHMessageID inMessageID, bool inInstantaneous, b
|
|||
this->PayPurchaseCost(theCost);
|
||||
}
|
||||
|
||||
// tankefugl: 0000971
|
||||
int theIssuedOrderIcon = -1;
|
||||
// :tankefugl
|
||||
|
||||
if(theIsMarine
|
||||
&& !theIsInTopDownMode
|
||||
&& !theIsBeingDigested)
|
||||
|
@ -1250,6 +1254,21 @@ bool AvHPlayer::ExecuteMessage(AvHMessageID inMessageID, bool inInstantaneous, b
|
|||
{
|
||||
switch(inMessageID)
|
||||
{
|
||||
// tankefugl: 0000971
|
||||
// decides whether icon updates should be sent
|
||||
case SAYING_1:
|
||||
theIssuedOrderIcon = TEAMMATE_MARINE_ORDER_FOLLOW;
|
||||
break;
|
||||
|
||||
case SAYING_2:
|
||||
theIssuedOrderIcon = TEAMMATE_MARINE_ORDER_COVER;
|
||||
break;
|
||||
|
||||
case SAYING_8:
|
||||
theIssuedOrderIcon = TEAMMATE_MARINE_ORDER_WELD;
|
||||
break;
|
||||
// :tankefugl
|
||||
|
||||
case SAYING_5:
|
||||
theAlertType = ALERT_SOLDIER_NEEDS_AMMO;
|
||||
theMessageID = COMMANDER_NEXTAMMO;
|
||||
|
@ -1309,6 +1328,83 @@ bool AvHPlayer::ExecuteMessage(AvHMessageID inMessageID, bool inInstantaneous, b
|
|||
theMessageExecuted = true;
|
||||
break;
|
||||
}
|
||||
// tankefugl: 0000971
|
||||
// decides whether icon updates should be sent
|
||||
switch (inMessageID)
|
||||
{
|
||||
case SAYING_1:
|
||||
theIssuedOrderIcon = TEAMMATE_ALIEN_ORDER_FOLLOW;
|
||||
break;
|
||||
case SAYING_2:
|
||||
theIssuedOrderIcon = TEAMMATE_ALIEN_ORDER_COVER;
|
||||
break;
|
||||
case SAYING_4:
|
||||
case SAYING_8:
|
||||
theIssuedOrderIcon = TEAMMATE_ALIEN_ORDER_HEAL;
|
||||
break;
|
||||
}
|
||||
// :tankefugl
|
||||
}
|
||||
|
||||
// tankefugl: 0000971 and 0000992
|
||||
if (theIssuedOrderIcon > -1)
|
||||
{
|
||||
int theOrderTarget = 0;
|
||||
|
||||
vec3_t vecDir;
|
||||
VectorCopy(this->GetAutoaimVector(0.0f), vecDir);
|
||||
VectorNormalize(vecDir);
|
||||
|
||||
float currentResult = 0.0f;
|
||||
|
||||
FOR_ALL_ENTITIES(kAvHPlayerClassName, AvHPlayer*);
|
||||
float dotResult = 0.0f;
|
||||
float theDistance = 0.0f;
|
||||
vec3_t vecDistance;
|
||||
int theTraced = 0;
|
||||
vec3_t vecFrom, vecTo;
|
||||
|
||||
if ((theEntity->entindex() != this->entindex()) && (theEntity->GetTeam() == this->GetTeam()))
|
||||
{
|
||||
VectorSubtract(theEntity->pev->origin, this->pev->origin, vecDistance);
|
||||
// theDistance = Length(vecDistance);
|
||||
|
||||
VectorNormalize(vecDistance);
|
||||
dotResult = DotProduct(vecDistance, vecDir);
|
||||
if ((dotResult > 0.9f) && (dotResult > currentResult))
|
||||
{
|
||||
TraceResult theTrace;
|
||||
vecFrom = AvHSHUGetRealLocation(this->pev->origin, this->pev->mins, this->pev->maxs);
|
||||
vecTo = AvHSHUGetRealLocation(theEntity->pev->origin, theEntity->pev->mins, theEntity->pev->maxs);
|
||||
UTIL_TraceLine(vecFrom, vecTo, ignore_monsters, this->edict(), &theTrace);
|
||||
if (theTrace.flFraction == 1.0f)
|
||||
{
|
||||
theTraced = 1;
|
||||
currentResult = dotResult;
|
||||
theOrderTarget = theEntity->entindex();
|
||||
}
|
||||
}
|
||||
}
|
||||
//ALERT(at_console, "-------------------\n");
|
||||
//ALERT(at_console, UTIL_VarArgs("vecDir %f %f %f\n", vecDir[0], vecDir[1], vecDir[2]));
|
||||
//ALERT(at_console, UTIL_VarArgs("vecDistance %f %f %f\n", vecDistance[0], vecDistance[1], vecDistance[2]));
|
||||
//ALERT(at_console, UTIL_VarArgs("vecFrom %f %f %f\n", vecFrom[0], vecFrom[1], vecFrom[2]));
|
||||
//ALERT(at_console, UTIL_VarArgs("vecTo %f %f %f\n", vecTo[0], vecTo[1], vecTo[2]));
|
||||
//ALERT(at_console, UTIL_VarArgs("dotResult %f\n", dotResult));
|
||||
//ALERT(at_console, UTIL_VarArgs("currentResult %f\n", currentResult));
|
||||
//ALERT(at_console, UTIL_VarArgs("theTraced %d\n", theTraced));
|
||||
//ALERT(at_console, UTIL_VarArgs("theOrderTarget %d\n", theOrderTarget));
|
||||
END_FOR_ALL_ENTITIES(kAvHPlayerClassName);
|
||||
|
||||
// ALERT(at_console, UTIL_VarArgs("theIssuedOrderIcon %d source %d target %d\n", theIssuedOrderIcon, this->entindex(), theOrderTarget));
|
||||
|
||||
FOR_ALL_ENTITIES(kAvHPlayerClassName, AvHPlayer*);
|
||||
if(theEntity->GetTeam() == this->GetTeam())
|
||||
{
|
||||
NetMsg_IssueOrder(theEntity->pev, theIssuedOrderIcon, this->entindex(), theOrderTarget);
|
||||
}
|
||||
END_FOR_ALL_ENTITIES(kAvHPlayerClassName);
|
||||
|
||||
}
|
||||
|
||||
// Common messages here
|
||||
|
@ -3058,6 +3154,24 @@ bool AvHPlayer::GiveOrderToSelection(AvHOrderType inOrder, Vector inNormRay)
|
|||
|
||||
Vector theOrigin = this->GetVisualOrigin();
|
||||
|
||||
// #ifdef DEBUG
|
||||
// vec3_t theStartPoint;
|
||||
// VectorMA(theOrigin, kSelectionStartRange, inNormRay, theStartPoint);
|
||||
//
|
||||
// vec3_t theEndPoint;
|
||||
// VectorMA(theOrigin, kSelectionEndRange, inNormRay, theEndPoint);
|
||||
//
|
||||
// vec3_t theValidOrigin;
|
||||
// AvHSHUServerGetFirstNonSolidPoint(theStartPoint, theEndPoint, theValidOrigin);
|
||||
//
|
||||
// theValidOrigin.z -= BALANCE_VAR(kBiteDamage);
|
||||
//
|
||||
// CBaseEntity* pEnt = CBaseEntity::Create(kwsDebugEntity, theValidOrigin, Vector(0, 0, 0));
|
||||
// ASSERT(pEnt);
|
||||
// pEnt->pev->movetype = MOVETYPE_FLY;
|
||||
// pEnt->pev->solid = SOLID_NOT;
|
||||
// #endif
|
||||
|
||||
if(AvHCreateSpecificOrder((AvHTeamNumber)(this->pev->team), theOrigin, inOrder, inNormRay, theNewOrder))
|
||||
{
|
||||
this->GiveOrderToSelection(theNewOrder);
|
||||
|
@ -3601,6 +3715,11 @@ void AvHPlayer::ValidateClientMoveEvents()
|
|||
case SAYING_7:
|
||||
case SAYING_8:
|
||||
case SAYING_9:
|
||||
// tankefugl: 0000008
|
||||
// preventing spamming of request and ack
|
||||
case ORDER_REQUEST:
|
||||
case ORDER_ACK:
|
||||
// :tankefugl
|
||||
if(GetGameRules()->GetCheatsEnabled() || (gpGlobals->time > (this->mTimeOfLastSaying + kMinSayingInterval)))
|
||||
{
|
||||
theIsValid = true;
|
||||
|
@ -3634,8 +3753,11 @@ void AvHPlayer::ValidateClientMoveEvents()
|
|||
switch(theMessageID)
|
||||
{
|
||||
// Validate orders
|
||||
case ORDER_REQUEST:
|
||||
case ORDER_ACK:
|
||||
// tankefugl: 0000008
|
||||
// preventing spamming of request and ack
|
||||
//case ORDER_REQUEST:
|
||||
//case ORDER_ACK:
|
||||
// :tankefugl
|
||||
|
||||
// Validate weapon switches
|
||||
case WEAPON_NEXT:
|
||||
|
@ -4096,21 +4218,23 @@ void AvHPlayer::HandleTopDownInput()
|
|||
this->BuildTech(theMessageID, this->mAttackOnePressedWorldPos);
|
||||
this->mTimeOfLastSignificantCommanderAction = gpGlobals->time;
|
||||
|
||||
// If player(s) selected when something built, give default order to it (assumes that players can't be selected along with other non-players)
|
||||
if(AvHSHUGetIsBuilding(theMessageID))
|
||||
{
|
||||
if(this->mSelected.size() > 0)
|
||||
{
|
||||
int theFirstEntitySelected = *this->mSelected.begin();
|
||||
if((theFirstEntitySelected >= 1) && (theFirstEntitySelected <= gpGlobals->maxClients))
|
||||
{
|
||||
if(!this->GiveOrderToSelection(ORDERTYPEL_DEFAULT, this->mAttackOnePressedWorldPos))
|
||||
{
|
||||
this->SendMessage(kInvalidOrderGiven, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// tankefugl: 0001014
|
||||
// // If player(s) selected when something built, give default order to it (assumes that players can't be selected along with other non-players)
|
||||
// if(AvHSHUGetIsBuilding(theMessageID))
|
||||
// {
|
||||
// if(this->mSelected.size() > 0)
|
||||
// {
|
||||
// int theFirstEntitySelected = *this->mSelected.begin();
|
||||
// if((theFirstEntitySelected >= 1) && (theFirstEntitySelected <= gpGlobals->maxClients))
|
||||
// {
|
||||
// if(!this->GiveOrderToSelection(ORDERTYPEL_DEFAULT, this->mAttackOnePressedWorldPos))
|
||||
// {
|
||||
// this->SendMessage(kInvalidOrderGiven, true);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// :tankefugl
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1224,14 +1224,14 @@ void AvHSUServerTraceBullets(const Vector& inStart, const Vector& inEnd, IGNORE_
|
|||
outProtected = false;
|
||||
|
||||
// This is the old way that doesn't take into account skulk rotation.
|
||||
UTIL_TraceLine(inStart, inEnd, inIgnoreMonsters, /*dont_ignore_glass,*/ inIgnoreEdict, &outTraceResult);
|
||||
// UTIL_TraceLine(inStart, inEnd, inIgnoreMonsters, /*dont_ignore_glass,*/ inIgnoreEdict, &outTraceResult);
|
||||
|
||||
// TEMP removed the skulk hitboxes since it's too risky for the LAN.
|
||||
// joev: 0000573
|
||||
// this was commented out meaning that it was just stock tracelines, not using Max M's superb hitbox collision code.
|
||||
// Now *all* hitboxes perform as expected and the crouched fade can be shot pretty much anywhere on the model
|
||||
// (allowing for about a 5% visual disparity)
|
||||
//AvHTraceLine(inStart, inEnd, inIgnoreMonsters, /*dont_ignore_glass,*/ inIgnoreEdict, &outTraceResult);
|
||||
AvHTraceLine(inStart, inEnd, inIgnoreMonsters, /*dont_ignore_glass,*/ inIgnoreEdict, &outTraceResult);
|
||||
// :joev
|
||||
CBaseEntity* theEntityHit = CBaseEntity::Instance(outTraceResult.pHit);
|
||||
|
||||
|
|
|
@ -560,7 +560,7 @@ bool AvHSHUGetDrawRingsForUser3(AvHUser3 inUser3, float& outScalar)
|
|||
break;
|
||||
|
||||
case AVH_USER3_INFANTRYPORTAL:
|
||||
theScalar = 1.3f;
|
||||
theScalar = 1.35f;
|
||||
theDrawRings = true;
|
||||
break;
|
||||
|
||||
|
|
|
@ -210,7 +210,7 @@ void AvHSonicGun::FireProjectiles(void)
|
|||
|
||||
// Fire the bullets and apply damage
|
||||
//this->m_pPlayer->FireBullets(kSGBulletsPerShot, vecSrc, vecAiming, this->GetProjectileSpread(), this->mRange, 0, 0, theDamage);
|
||||
this->m_pPlayer->FireBulletsPlayer(BALANCE_VAR(kSGBulletsPerShot), vecSrc, vecAiming, this->GetProjectileSpread(), this->mRange, BULLET_PLAYER_BUCKSHOT, 0, theDamage);
|
||||
this->m_pPlayer->FireBulletsPlayer(BALANCE_VAR(kSGBulletsPerShot), vecSrc, vecAiming, this->GetProjectileSpread(), this->mRange, BULLET_PLAYER_BUCKSHOT, 0, theDamage, 0, this->m_pPlayer->random_seed);
|
||||
}
|
||||
|
||||
bool AvHSonicGun::GetHasMuzzleFlash() const
|
||||
|
|
|
@ -90,6 +90,8 @@
|
|||
#define kBuildCircleSprite "sprites/buildcircle.spr"
|
||||
//#define kSiegeTurretSprite "sprites/siegeturret.spr"
|
||||
|
||||
#define kTeammateOrderSprite "sprites/query.spr"
|
||||
|
||||
//#define kOverwatchAimSprite "sprites/overwatch-aim.spr"
|
||||
|
||||
#define kMembraneSprite "sprites/membrane.spr"
|
||||
|
|
|
@ -1438,6 +1438,13 @@ void NS_UpdateWallsticking()
|
|||
|
||||
bool wallsticking = false;
|
||||
|
||||
// tankefugl: fix to allow skulks to climb walls oriented 45 degrees in the x-y plane
|
||||
// it also allows for easier climbing around courners
|
||||
wallsticking |= NS_CheckOffsetFromOrigin(pmove->forward[0], pmove->forward[1], pmove->forward[2], theSurfaceNormal);
|
||||
if (wallsticking)
|
||||
VectorScale(theSurfaceNormal, 5, theSurfaceNormal);
|
||||
// :tankefugl
|
||||
|
||||
wallsticking |= NS_CheckOffsetFromOrigin(theMinPoint[0], theMinPoint[1], theMinPoint[2], theSurfaceNormal);
|
||||
wallsticking |= NS_CheckOffsetFromOrigin(theMinPoint[0], theMaxPoint[1], theMinPoint[2], theSurfaceNormal);
|
||||
wallsticking |= NS_CheckOffsetFromOrigin(theMaxPoint[0], theMinPoint[1], theMinPoint[2], theSurfaceNormal);
|
||||
|
@ -4075,7 +4082,8 @@ void PM_UnDuck( void )
|
|||
|
||||
VectorCopy( pmove->origin, newOrigin );
|
||||
|
||||
if ( pmove->onground != -1 )
|
||||
// tankefugl: remove the jump when pressing and releasing duck quickly
|
||||
if ( pmove->onground != -1 && pmove->flags & FL_DUCKING && pmove->bInDuck == false)
|
||||
{
|
||||
int theStandingHull = AvHMUGetHull(false, pmove->iuser3);
|
||||
int theCrouchingHull = AvHMUGetHull(true, pmove->iuser3);
|
||||
|
@ -4923,7 +4931,10 @@ void PM_Jump (void)
|
|||
}
|
||||
|
||||
// See if we are waterjumping. If so, decrement count and return.
|
||||
if ( pmove->waterjumptime )
|
||||
// tankefugl: 0000972
|
||||
if (pmove->waterjumptime && !(pmove->waterlevel == 0 && pmove->iuser3 == AVH_USER3_ALIEN_PLAYER1))
|
||||
// :tankefugl
|
||||
// if ( pmove->waterjumptime )
|
||||
{
|
||||
pmove->waterjumptime -= pmove->cmd.msec;
|
||||
if (pmove->waterjumptime < 0)
|
||||
|
@ -6354,7 +6365,10 @@ void PM_PlayerMove ( qboolean server )
|
|||
}
|
||||
|
||||
// If we are leaping out of the water, just update the counters.
|
||||
if ( pmove->waterjumptime )
|
||||
// tankefugl: 0000972
|
||||
if (pmove->waterjumptime && !(pmove->waterlevel == 0 && pmove->iuser3 == AVH_USER3_ALIEN_PLAYER1))
|
||||
// :tankefugl
|
||||
// if ( pmove->waterjumptime )
|
||||
{
|
||||
PM_WaterJump();
|
||||
PM_FlyMove();
|
||||
|
|
Loading…
Reference in a new issue