mirror of https://github.com/FWGS/hlsdk-xash3d
CRLF to LF, nothing to see here
This commit is contained in:
parent
b44b52a093
commit
2e3a0c6ba2
|
@ -1,141 +1,141 @@
|
||||||
/***
|
/***
|
||||||
*
|
*
|
||||||
* (C) 2008 Vyacheslav Dzhura
|
* (C) 2008 Vyacheslav Dzhura
|
||||||
*
|
*
|
||||||
****/
|
****/
|
||||||
//
|
//
|
||||||
// mode.cpp
|
// mode.cpp
|
||||||
//
|
//
|
||||||
// implementation of CHudModeIcon class
|
// implementation of CHudModeIcon class
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "hud.h"
|
#include "hud.h"
|
||||||
#include "cl_util.h"
|
#include "cl_util.h"
|
||||||
#include "parsemsg.h"
|
#include "parsemsg.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
DECLARE_MESSAGE(m_AlienCrosshair, AlienState)
|
DECLARE_MESSAGE(m_AlienCrosshair, AlienState)
|
||||||
|
|
||||||
// gHUD.m_AlienCrosshair.m_iState
|
// gHUD.m_AlienCrosshair.m_iState
|
||||||
|
|
||||||
/*
|
/*
|
||||||
class CHudAlienCrosshair: public CHudBase
|
class CHudAlienCrosshair: public CHudBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
int Init( void );
|
int Init( void );
|
||||||
int VidInit( void );
|
int VidInit( void );
|
||||||
int Draw(float flTime);
|
int Draw(float flTime);
|
||||||
void Reset( void );
|
void Reset( void );
|
||||||
int MsgFunc_AlienState(const char *pszName, int iSize, void *pbuf );
|
int MsgFunc_AlienState(const char *pszName, int iSize, void *pbuf );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
HSPRITE m_hCrosshair[4];
|
HSPRITE m_hCrosshair[4];
|
||||||
wrect_t *m_prcCrosshair[4];
|
wrect_t *m_prcCrosshair[4];
|
||||||
int m_iState;
|
int m_iState;
|
||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int CHudAlienCrosshair::Init(void)
|
int CHudAlienCrosshair::Init(void)
|
||||||
{
|
{
|
||||||
m_iState = 0;
|
m_iState = 0;
|
||||||
|
|
||||||
HOOK_MESSAGE(AlienState);
|
HOOK_MESSAGE(AlienState);
|
||||||
|
|
||||||
m_iFlags |= HUD_ACTIVE;
|
m_iFlags |= HUD_ACTIVE;
|
||||||
m_iFlags |= HUD_ALIEN;
|
m_iFlags |= HUD_ALIEN;
|
||||||
|
|
||||||
gHUD.AddHudElem(this);
|
gHUD.AddHudElem(this);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
void CHudAlienCrosshair::Reset(void)
|
void CHudAlienCrosshair::Reset(void)
|
||||||
{
|
{
|
||||||
m_iState = 0;
|
m_iState = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CHudAlienCrosshair::VidInit(void)
|
int CHudAlienCrosshair::VidInit(void)
|
||||||
{
|
{
|
||||||
int sCenter = gHUD.GetSpriteIndex( "islave_center" );
|
int sCenter = gHUD.GetSpriteIndex( "islave_center" );
|
||||||
int sCharged = gHUD.GetSpriteIndex( "islave_charged" );
|
int sCharged = gHUD.GetSpriteIndex( "islave_charged" );
|
||||||
int sInner = gHUD.GetSpriteIndex( "islave_inner" );
|
int sInner = gHUD.GetSpriteIndex( "islave_inner" );
|
||||||
int sOuter = gHUD.GetSpriteIndex( "islave_outer" );
|
int sOuter = gHUD.GetSpriteIndex( "islave_outer" );
|
||||||
|
|
||||||
if ( (sCenter == -1) || (sCharged == -1) || (sInner == -1) || (sOuter == -1) )
|
if ( (sCenter == -1) || (sCharged == -1) || (sInner == -1) || (sOuter == -1) )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
m_hCrosshair[0] = gHUD.GetSprite(sOuter);
|
m_hCrosshair[0] = gHUD.GetSprite(sOuter);
|
||||||
m_hCrosshair[1] = gHUD.GetSprite(sInner);
|
m_hCrosshair[1] = gHUD.GetSprite(sInner);
|
||||||
m_hCrosshair[2] = gHUD.GetSprite(sCenter);
|
m_hCrosshair[2] = gHUD.GetSprite(sCenter);
|
||||||
m_hCrosshair[3] = gHUD.GetSprite(sCharged);
|
m_hCrosshair[3] = gHUD.GetSprite(sCharged);
|
||||||
|
|
||||||
m_prcCrosshair[0] = &gHUD.GetSpriteRect( sOuter );
|
m_prcCrosshair[0] = &gHUD.GetSpriteRect( sOuter );
|
||||||
m_prcCrosshair[1] = &gHUD.GetSpriteRect( sInner );
|
m_prcCrosshair[1] = &gHUD.GetSpriteRect( sInner );
|
||||||
m_prcCrosshair[2] = &gHUD.GetSpriteRect( sCenter );
|
m_prcCrosshair[2] = &gHUD.GetSpriteRect( sCenter );
|
||||||
m_prcCrosshair[3] = &gHUD.GetSpriteRect( sCharged );
|
m_prcCrosshair[3] = &gHUD.GetSpriteRect( sCharged );
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
int CHudAlienCrosshair:: MsgFunc_AlienState(const char *pszName, int iSize, void *pbuf )
|
int CHudAlienCrosshair:: MsgFunc_AlienState(const char *pszName, int iSize, void *pbuf )
|
||||||
{
|
{
|
||||||
BEGIN_READ( pbuf, iSize );
|
BEGIN_READ( pbuf, iSize );
|
||||||
m_iState = READ_BYTE();
|
m_iState = READ_BYTE();
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CHudAlienCrosshair::Draw(float flTime)
|
int CHudAlienCrosshair::Draw(float flTime)
|
||||||
{
|
{
|
||||||
if ( gHUD.m_iHideHUDDisplay & ( HIDEHUD_ALL ) )
|
if ( gHUD.m_iHideHUDDisplay & ( HIDEHUD_ALL ) )
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if ( !gHUD.m_bAlienMode )
|
if ( !gHUD.m_bAlienMode )
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (m_iState > 3)
|
if (m_iState > 3)
|
||||||
m_iState = 3;
|
m_iState = 3;
|
||||||
|
|
||||||
int chR, chG, chB;
|
int chR, chG, chB;
|
||||||
chR = chG = chB = 0;
|
chR = chG = chB = 0;
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++ )
|
for (int i = 0; i < 4; i++ )
|
||||||
{
|
{
|
||||||
if ( i > m_iState )
|
if ( i > m_iState )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
m_hActiveSprite = m_hCrosshair[i];
|
m_hActiveSprite = m_hCrosshair[i];
|
||||||
m_prcActiveRect = m_prcCrosshair[i];
|
m_prcActiveRect = m_prcCrosshair[i];
|
||||||
|
|
||||||
if ( i < 3 )
|
if ( i < 3 )
|
||||||
{ // 180, 255, 96
|
{ // 180, 255, 96
|
||||||
chR = 180;
|
chR = 180;
|
||||||
chG = 255;
|
chG = 255;
|
||||||
chB = 96;
|
chB = 96;
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
chR = 255;
|
chR = 255;
|
||||||
chG = 0;
|
chG = 0;
|
||||||
chB = 0;
|
chB = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (( i == 2 ) && ( m_iState == 3 ))
|
if (( i == 2 ) && ( m_iState == 3 ))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
int x,y, SWidth, SHeight;
|
int x,y, SWidth, SHeight;
|
||||||
SWidth = m_prcActiveRect->right - m_prcActiveRect->left;
|
SWidth = m_prcActiveRect->right - m_prcActiveRect->left;
|
||||||
SHeight = m_prcActiveRect->bottom - m_prcActiveRect->top; // SPR_Height(m_hActiveSprite,0);
|
SHeight = m_prcActiveRect->bottom - m_prcActiveRect->top; // SPR_Height(m_hActiveSprite,0);
|
||||||
x = ScreenWidth / 2 - ( SWidth / 2 );
|
x = ScreenWidth / 2 - ( SWidth / 2 );
|
||||||
y = ScreenHeight / 2 - ( SHeight / 2 );
|
y = ScreenHeight / 2 - ( SHeight / 2 );
|
||||||
|
|
||||||
SPR_Set(m_hActiveSprite, chR, chG, chB );
|
SPR_Set(m_hActiveSprite, chR, chG, chB );
|
||||||
SPR_DrawAdditive(0, x, y, m_prcActiveRect);
|
SPR_DrawAdditive(0, x, y, m_prcActiveRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
//char szMes[20];
|
//char szMes[20];
|
||||||
//sprintf(szMes,"%d %d/%d", m_fMode, SWidth, SHeight);
|
//sprintf(szMes,"%d %d/%d", m_fMode, SWidth, SHeight);
|
||||||
//gHUD.DrawHudString( 5, 5, ScreenWidth, szMes, r, g, b);
|
//gHUD.DrawHudString( 5, 5, ScreenWidth, szMes, r, g, b);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
232
cl_dll/mode.cpp
232
cl_dll/mode.cpp
|
@ -1,117 +1,117 @@
|
||||||
/***
|
/***
|
||||||
*
|
*
|
||||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||||
*
|
*
|
||||||
* This product contains software technology licensed from Id
|
* This product contains software technology licensed from Id
|
||||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||||
* All Rights Reserved.
|
* All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Use, distribution, and modification of this source code and/or resulting
|
* Use, distribution, and modification of this source code and/or resulting
|
||||||
* object code is restricted to non-commercial enhancements to products from
|
* object code is restricted to non-commercial enhancements to products from
|
||||||
* Valve LLC. All other use, distribution, or modification is prohibited
|
* Valve LLC. All other use, distribution, or modification is prohibited
|
||||||
* without written permission from Valve LLC.
|
* without written permission from Valve LLC.
|
||||||
*
|
*
|
||||||
****/
|
****/
|
||||||
//
|
//
|
||||||
// mode.cpp
|
// mode.cpp
|
||||||
//
|
//
|
||||||
// implementation of CHudModeIcon class
|
// implementation of CHudModeIcon class
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "hud.h"
|
#include "hud.h"
|
||||||
#include "cl_util.h"
|
#include "cl_util.h"
|
||||||
#include "parsemsg.h"
|
#include "parsemsg.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
DECLARE_MESSAGE(m_ModeIcon, ChangeMode)
|
DECLARE_MESSAGE(m_ModeIcon, ChangeMode)
|
||||||
|
|
||||||
int CHudModeIcon::Init(void)
|
int CHudModeIcon::Init(void)
|
||||||
{
|
{
|
||||||
m_fMode = 0;
|
m_fMode = 0;
|
||||||
|
|
||||||
HOOK_MESSAGE(ChangeMode);
|
HOOK_MESSAGE(ChangeMode);
|
||||||
|
|
||||||
m_iFlags |= HUD_ACTIVE;
|
m_iFlags |= HUD_ACTIVE;
|
||||||
|
|
||||||
gHUD.AddHudElem(this);
|
gHUD.AddHudElem(this);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
void CHudModeIcon::Reset(void)
|
void CHudModeIcon::Reset(void)
|
||||||
{
|
{
|
||||||
m_fMode = 0;
|
m_fMode = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CHudModeIcon::VidInit(void)
|
int CHudModeIcon::VidInit(void)
|
||||||
{
|
{
|
||||||
int HUD_mode_stand = gHUD.GetSpriteIndex( "mode_stand" );
|
int HUD_mode_stand = gHUD.GetSpriteIndex( "mode_stand" );
|
||||||
int HUD_mode_run = gHUD.GetSpriteIndex( "mode_run" );
|
int HUD_mode_run = gHUD.GetSpriteIndex( "mode_run" );
|
||||||
int HUD_mode_crouch = gHUD.GetSpriteIndex( "mode_crouch" );
|
int HUD_mode_crouch = gHUD.GetSpriteIndex( "mode_crouch" );
|
||||||
int HUD_mode_jump = gHUD.GetSpriteIndex( "mode_jump" );
|
int HUD_mode_jump = gHUD.GetSpriteIndex( "mode_jump" );
|
||||||
|
|
||||||
m_hSpriteStand = m_hSpriteRun = m_hSpriteCrouch = m_hSpriteJump = 0;
|
m_hSpriteStand = m_hSpriteRun = m_hSpriteCrouch = m_hSpriteJump = 0;
|
||||||
|
|
||||||
m_hSpriteStand = gHUD.GetSprite(HUD_mode_stand);
|
m_hSpriteStand = gHUD.GetSprite(HUD_mode_stand);
|
||||||
m_hSpriteRun = gHUD.GetSprite(HUD_mode_run);
|
m_hSpriteRun = gHUD.GetSprite(HUD_mode_run);
|
||||||
m_hSpriteCrouch = gHUD.GetSprite(HUD_mode_crouch);
|
m_hSpriteCrouch = gHUD.GetSprite(HUD_mode_crouch);
|
||||||
m_hSpriteJump = gHUD.GetSprite(HUD_mode_jump);
|
m_hSpriteJump = gHUD.GetSprite(HUD_mode_jump);
|
||||||
|
|
||||||
m_prcStand = &gHUD.GetSpriteRect( HUD_mode_stand );
|
m_prcStand = &gHUD.GetSpriteRect( HUD_mode_stand );
|
||||||
m_prcRun = &gHUD.GetSpriteRect( HUD_mode_run );
|
m_prcRun = &gHUD.GetSpriteRect( HUD_mode_run );
|
||||||
m_prcCrouch = &gHUD.GetSpriteRect( HUD_mode_crouch );
|
m_prcCrouch = &gHUD.GetSpriteRect( HUD_mode_crouch );
|
||||||
m_prcJump = &gHUD.GetSpriteRect( HUD_mode_jump );
|
m_prcJump = &gHUD.GetSpriteRect( HUD_mode_jump );
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
int CHudModeIcon:: MsgFunc_ChangeMode(const char *pszName, int iSize, void *pbuf )
|
int CHudModeIcon:: MsgFunc_ChangeMode(const char *pszName, int iSize, void *pbuf )
|
||||||
{
|
{
|
||||||
|
|
||||||
BEGIN_READ( pbuf, iSize );
|
BEGIN_READ( pbuf, iSize );
|
||||||
m_fMode = READ_BYTE();
|
m_fMode = READ_BYTE();
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CHudModeIcon::Draw(float flTime)
|
int CHudModeIcon::Draw(float flTime)
|
||||||
{
|
{
|
||||||
if ( gHUD.m_iHideHUDDisplay & ( HIDEHUD_ALL ) )
|
if ( gHUD.m_iHideHUDDisplay & ( HIDEHUD_ALL ) )
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (!(gHUD.m_iWeaponBits & (1<<(WEAPON_SUIT)) ))
|
if (!(gHUD.m_iWeaponBits & (1<<(WEAPON_SUIT)) ))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
switch(m_fMode){
|
switch(m_fMode){
|
||||||
case 0: m_hActiveSprite = m_hSpriteStand;
|
case 0: m_hActiveSprite = m_hSpriteStand;
|
||||||
m_prcActiveRect = m_prcStand;
|
m_prcActiveRect = m_prcStand;
|
||||||
break;
|
break;
|
||||||
case 1: m_hActiveSprite = m_hSpriteRun;
|
case 1: m_hActiveSprite = m_hSpriteRun;
|
||||||
m_prcActiveRect = m_prcRun;
|
m_prcActiveRect = m_prcRun;
|
||||||
break;
|
break;
|
||||||
case 2: m_hActiveSprite = m_hSpriteCrouch;
|
case 2: m_hActiveSprite = m_hSpriteCrouch;
|
||||||
m_prcActiveRect = m_prcCrouch;
|
m_prcActiveRect = m_prcCrouch;
|
||||||
break;
|
break;
|
||||||
case 3: m_hActiveSprite = m_hSpriteJump;
|
case 3: m_hActiveSprite = m_hSpriteJump;
|
||||||
m_prcActiveRect = m_prcJump;
|
m_prcActiveRect = m_prcJump;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
int r,g,b, x,y, SWidth, SHeight;
|
int r,g,b, x,y, SWidth, SHeight;
|
||||||
|
|
||||||
SWidth = m_prcActiveRect->right - m_prcActiveRect->left;// SPR_Width(m_hActiveSprite,0);
|
SWidth = m_prcActiveRect->right - m_prcActiveRect->left;// SPR_Width(m_hActiveSprite,0);
|
||||||
SHeight = SPR_Height(m_hActiveSprite,0);
|
SHeight = SPR_Height(m_hActiveSprite,0);
|
||||||
x = ScreenWidth - SWidth - SWidth/2;
|
x = ScreenWidth - SWidth - SWidth/2;
|
||||||
y = 64;
|
y = 64;
|
||||||
|
|
||||||
UnpackRGB(r,g,b, gHUD.uColor);
|
UnpackRGB(r,g,b, gHUD.uColor);
|
||||||
SPR_Set(m_hActiveSprite, r, g, b );
|
SPR_Set(m_hActiveSprite, r, g, b );
|
||||||
SPR_DrawAdditive(0, x, y, m_prcActiveRect);
|
SPR_DrawAdditive(0, x, y, m_prcActiveRect);
|
||||||
|
|
||||||
//char szMes[20];
|
//char szMes[20];
|
||||||
//sprintf(szMes,"%d %d/%d", m_fMode, SWidth, SHeight);
|
//sprintf(szMes,"%d %d/%d", m_fMode, SWidth, SHeight);
|
||||||
//gHUD.DrawHudString( 5, 5, ScreenWidth, szMes, r, g, b);
|
//gHUD.DrawHudString( 5, 5, ScreenWidth, szMes, r, g, b);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
|
@ -1,144 +1,144 @@
|
||||||
//=========== (C) Copyright 2008 Vyacheslav Dzhura. All rights reserved. ===========
|
//=========== (C) Copyright 2008 Vyacheslav Dzhura. All rights reserved. ===========
|
||||||
//
|
//
|
||||||
// Purpose: Notification which is displayed for players which have connected
|
// Purpose: Notification which is displayed for players which have connected
|
||||||
// to Decay game server, after there are two human players, also
|
// to Decay game server, after there are two human players, also
|
||||||
// displays count down before disconnecting player
|
// displays count down before disconnecting player
|
||||||
//
|
//
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// $Log: $
|
// $Log: $
|
||||||
//
|
//
|
||||||
// $NoKeywords: $
|
// $NoKeywords: $
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
#include "vgui_int.h"
|
#include "vgui_int.h"
|
||||||
#include "VGUI_Font.h"
|
#include "VGUI_Font.h"
|
||||||
#include "VGUI_ScrollPanel.h"
|
#include "VGUI_ScrollPanel.h"
|
||||||
#include "VGUI_TextImage.h"
|
#include "VGUI_TextImage.h"
|
||||||
#include "VGUI_loadtga.h"
|
#include "VGUI_loadtga.h"
|
||||||
|
|
||||||
#include "hud.h"
|
#include "hud.h"
|
||||||
#include "cl_util.h"
|
#include "cl_util.h"
|
||||||
#include "vgui_TeamFortressViewport.h"
|
#include "vgui_TeamFortressViewport.h"
|
||||||
|
|
||||||
// Windows' Dimensions
|
// Windows' Dimensions
|
||||||
#define SNW_TITLE_X XRES(40)
|
#define SNW_TITLE_X XRES(40)
|
||||||
#define SNW_TITLE_Y YRES(32)
|
#define SNW_TITLE_Y YRES(32)
|
||||||
#define SNW_TOPLEFT_BUTTON_X XRES(251)//was 245
|
#define SNW_TOPLEFT_BUTTON_X XRES(251)//was 245
|
||||||
#define SNW_TOPLEFT_BUTTON_Y YRES(400)
|
#define SNW_TOPLEFT_BUTTON_Y YRES(400)
|
||||||
#define SNW_BUTTON_SIZE_X XRES(100)
|
#define SNW_BUTTON_SIZE_X XRES(100)
|
||||||
#define SNW_BUTTON_SIZE_Y YRES(24)
|
#define SNW_BUTTON_SIZE_Y YRES(24)
|
||||||
#define SNW_BUTTON_SPACER_Y YRES(8)
|
#define SNW_BUTTON_SPACER_Y YRES(8)
|
||||||
#define SNW_WINDOW_X XRES(150)
|
#define SNW_WINDOW_X XRES(150)
|
||||||
#define SNW_WINDOW_Y YRES(150)
|
#define SNW_WINDOW_Y YRES(150)
|
||||||
#define SNW_WINDOW_SIZE_X XRES(350)
|
#define SNW_WINDOW_SIZE_X XRES(350)
|
||||||
#define SNW_WINDOW_SIZE_Y YRES(220)
|
#define SNW_WINDOW_SIZE_Y YRES(220)
|
||||||
#define SNW_WINDOW_TITLE_X XRES(16)
|
#define SNW_WINDOW_TITLE_X XRES(16)
|
||||||
#define SNW_WINDOW_TITLE_Y YRES(16)
|
#define SNW_WINDOW_TITLE_Y YRES(16)
|
||||||
#define SNW_WINDOW_TEXT_X XRES(80) // was 16
|
#define SNW_WINDOW_TEXT_X XRES(80) // was 16
|
||||||
#define SNW_WINDOW_TEXT_Y YRES(32)
|
#define SNW_WINDOW_TEXT_Y YRES(32)
|
||||||
#define SNW_WINDOW_TEXT_SIZE_Y YRES(168)
|
#define SNW_WINDOW_TEXT_SIZE_Y YRES(168)
|
||||||
#define SNW_WINDOW_INFO_X XRES(16)
|
#define SNW_WINDOW_INFO_X XRES(16)
|
||||||
#define SNW_WINDOW_INFO_Y YRES(234)
|
#define SNW_WINDOW_INFO_Y YRES(234)
|
||||||
|
|
||||||
// Creation
|
// Creation
|
||||||
CSparePlayerWindow::CSparePlayerWindow(int iTrans, int iRemoveMe, int x,int y,int wide,int tall) : CMenuPanel(iTrans, iRemoveMe, x,y,wide,tall)
|
CSparePlayerWindow::CSparePlayerWindow(int iTrans, int iRemoveMe, int x,int y,int wide,int tall) : CMenuPanel(iTrans, iRemoveMe, x,y,wide,tall)
|
||||||
{
|
{
|
||||||
// Get the scheme used for the Titles
|
// Get the scheme used for the Titles
|
||||||
CSchemeManager *pSchemes = gViewPort->GetSchemeManager();
|
CSchemeManager *pSchemes = gViewPort->GetSchemeManager();
|
||||||
|
|
||||||
// schemes
|
// schemes
|
||||||
SchemeHandle_t hTitleScheme = pSchemes->getSchemeHandle( "Title Font" );
|
SchemeHandle_t hTitleScheme = pSchemes->getSchemeHandle( "Title Font" );
|
||||||
SchemeHandle_t hDecayFont = pSchemes->getSchemeHandle( "Briefing Text" ); //Decay
|
SchemeHandle_t hDecayFont = pSchemes->getSchemeHandle( "Briefing Text" ); //Decay
|
||||||
|
|
||||||
// get the Font used for the Titles
|
// get the Font used for the Titles
|
||||||
Font *pTitleFont = pSchemes->getFont( hTitleScheme );
|
Font *pTitleFont = pSchemes->getFont( hTitleScheme );
|
||||||
int r, g, b, a;
|
int r, g, b, a;
|
||||||
|
|
||||||
// Create the Info Window itself
|
// Create the Info Window itself
|
||||||
m_pWindow = new CTransparentPanel( 255, SNW_WINDOW_X, SNW_WINDOW_Y, SNW_WINDOW_SIZE_X, SNW_WINDOW_SIZE_Y );
|
m_pWindow = new CTransparentPanel( 255, SNW_WINDOW_X, SNW_WINDOW_Y, SNW_WINDOW_SIZE_X, SNW_WINDOW_SIZE_Y );
|
||||||
m_pWindow->setParent( this );
|
m_pWindow->setParent( this );
|
||||||
m_pWindow->setBorder( new LineBorder( Color(255*0.7,170*0.7,0,0 )) );
|
m_pWindow->setBorder( new LineBorder( Color(255*0.7,170*0.7,0,0 )) );
|
||||||
|
|
||||||
// Create the Title label
|
// Create the Title label
|
||||||
m_pTitle = new Label( "", SNW_WINDOW_TEXT_X, YRES(5) );
|
m_pTitle = new Label( "", SNW_WINDOW_TEXT_X, YRES(5) );
|
||||||
m_pTitle->setParent( m_pWindow );
|
m_pTitle->setParent( m_pWindow );
|
||||||
m_pTitle->setFont( pTitleFont );
|
m_pTitle->setFont( pTitleFont );
|
||||||
pSchemes->getFgColor( hTitleScheme, r, g, b, a );
|
pSchemes->getFgColor( hTitleScheme, r, g, b, a );
|
||||||
m_pTitle->setFgColor( r, g, b, a );
|
m_pTitle->setFgColor( r, g, b, a );
|
||||||
pSchemes->getBgColor( hTitleScheme, r, g, b, a );
|
pSchemes->getBgColor( hTitleScheme, r, g, b, a );
|
||||||
m_pTitle->setBgColor( r, g, b, a );
|
m_pTitle->setBgColor( r, g, b, a );
|
||||||
m_pTitle->setContentAlignment( vgui::Label::a_west );
|
m_pTitle->setContentAlignment( vgui::Label::a_west );
|
||||||
m_pTitle->setText(gHUD.m_TextMessage.BufferedLocaliseTextString("#Decay_SparePlayerTitle"));
|
m_pTitle->setText(gHUD.m_TextMessage.BufferedLocaliseTextString("#Decay_SparePlayerTitle"));
|
||||||
|
|
||||||
|
|
||||||
// Create the Briefing panel
|
// Create the Briefing panel
|
||||||
m_pMemo = new TextPanel("", SNW_WINDOW_TEXT_X, SNW_WINDOW_TEXT_Y, YRES(230), SNW_WINDOW_TEXT_SIZE_Y );
|
m_pMemo = new TextPanel("", SNW_WINDOW_TEXT_X, SNW_WINDOW_TEXT_Y, YRES(230), SNW_WINDOW_TEXT_SIZE_Y );
|
||||||
m_pMemo->setParent( m_pWindow );
|
m_pMemo->setParent( m_pWindow );
|
||||||
m_pMemo->setFont( pSchemes->getFont(hDecayFont) );
|
m_pMemo->setFont( pSchemes->getFont(hDecayFont) );
|
||||||
pSchemes->getFgColor( hDecayFont, r, g, b, a );
|
pSchemes->getFgColor( hDecayFont, r, g, b, a );
|
||||||
m_pMemo->setFgColor( r, g, b, a );
|
m_pMemo->setFgColor( r, g, b, a );
|
||||||
pSchemes->getBgColor( hDecayFont, r, g, b, a );
|
pSchemes->getBgColor( hDecayFont, r, g, b, a );
|
||||||
m_pMemo->setBgColor( r, g, b, a );
|
m_pMemo->setBgColor( r, g, b, a );
|
||||||
m_pMemo->setText(gHUD.m_TextMessage.BufferedLocaliseTextString("#Decay_SparePlayerMessage"));
|
m_pMemo->setText(gHUD.m_TextMessage.BufferedLocaliseTextString("#Decay_SparePlayerMessage"));
|
||||||
|
|
||||||
// Create the Cancel button
|
// Create the Cancel button
|
||||||
//m_pCancelButton = new CommandButton( "", SNW_TOPLEFT_BUTTON_X, SNW_TOPLEFT_BUTTON_Y, SNW_BUTTON_SIZE_X, SNW_BUTTON_SIZE_Y, true);
|
//m_pCancelButton = new CommandButton( "", SNW_TOPLEFT_BUTTON_X, SNW_TOPLEFT_BUTTON_Y, SNW_BUTTON_SIZE_X, SNW_BUTTON_SIZE_Y, true);
|
||||||
//m_pCancelButton->setParent( this );
|
//m_pCancelButton->setParent( this );
|
||||||
//m_pCancelButton->setText( gHUD.m_TextMessage.BufferedLocaliseTextString(" CLOSE") );
|
//m_pCancelButton->setText( gHUD.m_TextMessage.BufferedLocaliseTextString(" CLOSE") );
|
||||||
//m_pCancelButton->setVisible( true );
|
//m_pCancelButton->setVisible( true );
|
||||||
//m_pCancelButton->addActionSignal(new CMenuHandler_TextWindow(HIDE_TEXTWINDOW));
|
//m_pCancelButton->addActionSignal(new CMenuHandler_TextWindow(HIDE_TEXTWINDOW));
|
||||||
|
|
||||||
m_pImage = new CImageLabel( "gina", 0, 0, 128, 256 ); // gfx/vgui/640_gina.tga
|
m_pImage = new CImageLabel( "gina", 0, 0, 128, 256 ); // gfx/vgui/640_gina.tga
|
||||||
//m_pImage->setText(25, "this is a test!!!");
|
//m_pImage->setText(25, "this is a test!!!");
|
||||||
m_pImage->setParent( m_pWindow );
|
m_pImage->setParent( m_pWindow );
|
||||||
m_pImage->setVisible( true );
|
m_pImage->setVisible( true );
|
||||||
|
|
||||||
Initialize();
|
Initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose: Called each time a new level is started.
|
// Purpose: Called each time a new level is started.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void CSparePlayerWindow::Initialize( void )
|
void CSparePlayerWindow::Initialize( void )
|
||||||
{
|
{
|
||||||
//m_pScrollPanel->setScrollValue( 0, 0 );
|
//m_pScrollPanel->setScrollValue( 0, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose: Called everytime the Team Menu is displayed
|
// Purpose: Called everytime the Team Menu is displayed
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void CSparePlayerWindow::Update( void )
|
void CSparePlayerWindow::Update( void )
|
||||||
{
|
{
|
||||||
// TODO: maybe update "Disconnect in ..." label here?
|
// TODO: maybe update "Disconnect in ..." label here?
|
||||||
|
|
||||||
//m_pMemo->setText(gHUD.m_TextMessage.BufferedLocaliseTextString(szText));
|
//m_pMemo->setText(gHUD.m_TextMessage.BufferedLocaliseTextString(szText));
|
||||||
//m_pTitle->setText(gHUD.m_TextMessage.BufferedLocaliseTextString(szTitle));
|
//m_pTitle->setText(gHUD.m_TextMessage.BufferedLocaliseTextString(szTitle));
|
||||||
|
|
||||||
int iYPos = SNW_TOPLEFT_BUTTON_Y;
|
int iYPos = SNW_TOPLEFT_BUTTON_Y;
|
||||||
|
|
||||||
// Move the AutoAssign button into place
|
// Move the AutoAssign button into place
|
||||||
//m_pCancelButton->setPos( SNW_TOPLEFT_BUTTON_X, iYPos );
|
//m_pCancelButton->setPos( SNW_TOPLEFT_BUTTON_X, iYPos );
|
||||||
|
|
||||||
//m_pScrollPanel->validate();
|
//m_pScrollPanel->validate();
|
||||||
m_pImage->setBounds( XRES(8), YRES(16), 128, 256 );
|
m_pImage->setBounds( XRES(8), YRES(16), 128, 256 );
|
||||||
}
|
}
|
||||||
|
|
||||||
//=====================================
|
//=====================================
|
||||||
// Key inputs
|
// Key inputs
|
||||||
bool CSparePlayerWindow::SlotInput( int iSlot )
|
bool CSparePlayerWindow::SlotInput( int iSlot )
|
||||||
{
|
{
|
||||||
if ( iSlot == 1)
|
if ( iSlot == 1)
|
||||||
{
|
{
|
||||||
//m_pCancelButton->fireActionSignal();
|
//m_pCancelButton->fireActionSignal();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//======================================
|
//======================================
|
||||||
// Update the Team menu before opening it
|
// Update the Team menu before opening it
|
||||||
void CSparePlayerWindow::Open( void )
|
void CSparePlayerWindow::Open( void )
|
||||||
{
|
{
|
||||||
Update();
|
Update();
|
||||||
CMenuPanel::Open();
|
CMenuPanel::Open();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,154 +1,154 @@
|
||||||
//=========== (C) Copyright 1999 Valve, L.L.C. All rights reserved. ===========
|
//=========== (C) Copyright 1999 Valve, L.L.C. All rights reserved. ===========
|
||||||
//
|
//
|
||||||
// The copyright to the contents herein is the property of Valve, L.L.C.
|
// The copyright to the contents herein is the property of Valve, L.L.C.
|
||||||
// The contents may be used and/or copied only with the written permission of
|
// The contents may be used and/or copied only with the written permission of
|
||||||
// Valve, L.L.C., or in accordance with the terms and conditions stipulated in
|
// Valve, L.L.C., or in accordance with the terms and conditions stipulated in
|
||||||
// the agreement/contract under which the contents have been supplied.
|
// the agreement/contract under which the contents have been supplied.
|
||||||
//
|
//
|
||||||
// Purpose: Notepad
|
// Purpose: Notepad
|
||||||
//
|
//
|
||||||
// $Workfile: $
|
// $Workfile: $
|
||||||
// $Date: $
|
// $Date: $
|
||||||
//
|
//
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// $Log: $
|
// $Log: $
|
||||||
//
|
//
|
||||||
// $NoKeywords: $
|
// $NoKeywords: $
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
#include "vgui_int.h"
|
#include "vgui_int.h"
|
||||||
#include "VGUI_Font.h"
|
#include "VGUI_Font.h"
|
||||||
#include "VGUI_ScrollPanel.h"
|
#include "VGUI_ScrollPanel.h"
|
||||||
#include "VGUI_TextImage.h"
|
#include "VGUI_TextImage.h"
|
||||||
#include "VGUI_loadtga.h"
|
#include "VGUI_loadtga.h"
|
||||||
|
|
||||||
#include "hud.h"
|
#include "hud.h"
|
||||||
#include "cl_util.h"
|
#include "cl_util.h"
|
||||||
#include "vgui_TeamFortressViewport.h"
|
#include "vgui_TeamFortressViewport.h"
|
||||||
|
|
||||||
// Notepad Dimensions
|
// Notepad Dimensions
|
||||||
#define NOTEPAD_TITLE_X XRES(40)
|
#define NOTEPAD_TITLE_X XRES(40)
|
||||||
#define NOTEPAD_TITLE_Y YRES(32)
|
#define NOTEPAD_TITLE_Y YRES(32)
|
||||||
#define NOTEPAD_TOPLEFT_BUTTON_X XRES(251)//was 245
|
#define NOTEPAD_TOPLEFT_BUTTON_X XRES(251)//was 245
|
||||||
#define NOTEPAD_TOPLEFT_BUTTON_Y YRES(400)
|
#define NOTEPAD_TOPLEFT_BUTTON_Y YRES(400)
|
||||||
#define NOTEPAD_BUTTON_SIZE_X XRES(100)
|
#define NOTEPAD_BUTTON_SIZE_X XRES(100)
|
||||||
#define NOTEPAD_BUTTON_SIZE_Y YRES(24)
|
#define NOTEPAD_BUTTON_SIZE_Y YRES(24)
|
||||||
#define NOTEPAD_BUTTON_SPACER_Y YRES(8)
|
#define NOTEPAD_BUTTON_SPACER_Y YRES(8)
|
||||||
#define NOTEPAD_WINDOW_X XRES(150)
|
#define NOTEPAD_WINDOW_X XRES(150)
|
||||||
#define NOTEPAD_WINDOW_Y YRES(150)
|
#define NOTEPAD_WINDOW_Y YRES(150)
|
||||||
#define NOTEPAD_WINDOW_SIZE_X XRES(300)
|
#define NOTEPAD_WINDOW_SIZE_X XRES(300)
|
||||||
#define NOTEPAD_WINDOW_SIZE_Y YRES(220)
|
#define NOTEPAD_WINDOW_SIZE_Y YRES(220)
|
||||||
#define NOTEPAD_WINDOW_TITLE_X XRES(16)
|
#define NOTEPAD_WINDOW_TITLE_X XRES(16)
|
||||||
#define NOTEPAD_WINDOW_TITLE_Y YRES(16)
|
#define NOTEPAD_WINDOW_TITLE_Y YRES(16)
|
||||||
#define NOTEPAD_WINDOW_TEXT_X XRES(16)
|
#define NOTEPAD_WINDOW_TEXT_X XRES(16)
|
||||||
#define NOTEPAD_WINDOW_TEXT_Y YRES(32)
|
#define NOTEPAD_WINDOW_TEXT_Y YRES(32)
|
||||||
#define NOTEPAD_WINDOW_TEXT_SIZE_Y YRES(168)
|
#define NOTEPAD_WINDOW_TEXT_SIZE_Y YRES(168)
|
||||||
#define NOTEPAD_WINDOW_INFO_X XRES(16)
|
#define NOTEPAD_WINDOW_INFO_X XRES(16)
|
||||||
#define NOTEPAD_WINDOW_INFO_Y YRES(234)
|
#define NOTEPAD_WINDOW_INFO_Y YRES(234)
|
||||||
|
|
||||||
// Creation
|
// Creation
|
||||||
CNotepad::CNotepad(int iTrans, int iRemoveMe, int x,int y,int wide,int tall) : CMenuPanel(iTrans, iRemoveMe, x,y,wide,tall)
|
CNotepad::CNotepad(int iTrans, int iRemoveMe, int x,int y,int wide,int tall) : CMenuPanel(iTrans, iRemoveMe, x,y,wide,tall)
|
||||||
{
|
{
|
||||||
// Get the scheme used for the Titles
|
// Get the scheme used for the Titles
|
||||||
CSchemeManager *pSchemes = gViewPort->GetSchemeManager();
|
CSchemeManager *pSchemes = gViewPort->GetSchemeManager();
|
||||||
|
|
||||||
// schemes
|
// schemes
|
||||||
SchemeHandle_t hTitleScheme = pSchemes->getSchemeHandle( "Title Font" );
|
SchemeHandle_t hTitleScheme = pSchemes->getSchemeHandle( "Title Font" );
|
||||||
SchemeHandle_t hDecayFont = pSchemes->getSchemeHandle( "Briefing Text" ); //Decay
|
SchemeHandle_t hDecayFont = pSchemes->getSchemeHandle( "Briefing Text" ); //Decay
|
||||||
|
|
||||||
// get the Font used for the Titles
|
// get the Font used for the Titles
|
||||||
Font *pTitleFont = pSchemes->getFont( hTitleScheme );
|
Font *pTitleFont = pSchemes->getFont( hTitleScheme );
|
||||||
int r, g, b, a;
|
int r, g, b, a;
|
||||||
|
|
||||||
// Create the title
|
// Create the title
|
||||||
m_pTitle = new Label( "", NOTEPAD_WINDOW_X+10, NOTEPAD_WINDOW_Y+5 );
|
m_pTitle = new Label( "", NOTEPAD_WINDOW_X+10, NOTEPAD_WINDOW_Y+5 );
|
||||||
m_pTitle->setParent( this );
|
m_pTitle->setParent( this );
|
||||||
m_pTitle->setFont( pTitleFont );
|
m_pTitle->setFont( pTitleFont );
|
||||||
pSchemes->getFgColor( hTitleScheme, r, g, b, a );
|
pSchemes->getFgColor( hTitleScheme, r, g, b, a );
|
||||||
m_pTitle->setFgColor( r, g, b, a );
|
m_pTitle->setFgColor( r, g, b, a );
|
||||||
pSchemes->getBgColor( hTitleScheme, r, g, b, a );
|
pSchemes->getBgColor( hTitleScheme, r, g, b, a );
|
||||||
m_pTitle->setBgColor( r, g, b, a );
|
m_pTitle->setBgColor( r, g, b, a );
|
||||||
m_pTitle->setContentAlignment( vgui::Label::a_west );
|
m_pTitle->setContentAlignment( vgui::Label::a_west );
|
||||||
m_pTitle->setText(gHUD.m_TextMessage.BufferedLocaliseTextString(szTitle));
|
m_pTitle->setText(gHUD.m_TextMessage.BufferedLocaliseTextString(szTitle));
|
||||||
|
|
||||||
// Create the Info Window
|
// Create the Info Window
|
||||||
m_pNotepadWindow = new CTransparentPanel( 255, NOTEPAD_WINDOW_X, NOTEPAD_WINDOW_Y, NOTEPAD_WINDOW_SIZE_X, NOTEPAD_WINDOW_SIZE_Y );
|
m_pNotepadWindow = new CTransparentPanel( 255, NOTEPAD_WINDOW_X, NOTEPAD_WINDOW_Y, NOTEPAD_WINDOW_SIZE_X, NOTEPAD_WINDOW_SIZE_Y );
|
||||||
m_pNotepadWindow->setParent( this );
|
m_pNotepadWindow->setParent( this );
|
||||||
m_pNotepadWindow->setBorder( new LineBorder( Color(255*0.7,170*0.7,0,0 )) );
|
m_pNotepadWindow->setBorder( new LineBorder( Color(255*0.7,170*0.7,0,0 )) );
|
||||||
|
|
||||||
// Create the Scroll panel
|
// Create the Scroll panel
|
||||||
m_pScrollPanel = new CTFScrollPanel( NOTEPAD_WINDOW_TEXT_X, NOTEPAD_WINDOW_TEXT_Y, NOTEPAD_WINDOW_SIZE_X - (NOTEPAD_WINDOW_TEXT_X * 2), NOTEPAD_WINDOW_TEXT_SIZE_Y );
|
m_pScrollPanel = new CTFScrollPanel( NOTEPAD_WINDOW_TEXT_X, NOTEPAD_WINDOW_TEXT_Y, NOTEPAD_WINDOW_SIZE_X - (NOTEPAD_WINDOW_TEXT_X * 2), NOTEPAD_WINDOW_TEXT_SIZE_Y );
|
||||||
m_pScrollPanel->setParent(m_pNotepadWindow);
|
m_pScrollPanel->setParent(m_pNotepadWindow);
|
||||||
m_pScrollPanel->setScrollBarVisible(false, false);
|
m_pScrollPanel->setScrollBarVisible(false, false);
|
||||||
|
|
||||||
// Create the Map Briefing panel
|
// Create the Map Briefing panel
|
||||||
m_pBriefing = new TextPanel("", 0,0, NOTEPAD_WINDOW_SIZE_X - NOTEPAD_WINDOW_TEXT_X, NOTEPAD_WINDOW_TEXT_SIZE_Y );
|
m_pBriefing = new TextPanel("", 0,0, NOTEPAD_WINDOW_SIZE_X - NOTEPAD_WINDOW_TEXT_X, NOTEPAD_WINDOW_TEXT_SIZE_Y );
|
||||||
m_pBriefing->setParent( m_pScrollPanel->getClient() );
|
m_pBriefing->setParent( m_pScrollPanel->getClient() );
|
||||||
m_pBriefing->setFont( pSchemes->getFont(hDecayFont) );
|
m_pBriefing->setFont( pSchemes->getFont(hDecayFont) );
|
||||||
pSchemes->getFgColor( hDecayFont, r, g, b, a );
|
pSchemes->getFgColor( hDecayFont, r, g, b, a );
|
||||||
m_pBriefing->setFgColor( r, g, b, a );
|
m_pBriefing->setFgColor( r, g, b, a );
|
||||||
pSchemes->getBgColor( hDecayFont, r, g, b, a );
|
pSchemes->getBgColor( hDecayFont, r, g, b, a );
|
||||||
m_pBriefing->setBgColor( r, g, b, a );
|
m_pBriefing->setBgColor( r, g, b, a );
|
||||||
m_pBriefing->setText(gHUD.m_TextMessage.BufferedLocaliseTextString(szText));
|
m_pBriefing->setText(gHUD.m_TextMessage.BufferedLocaliseTextString(szText));
|
||||||
|
|
||||||
// Create the Cancel button
|
// Create the Cancel button
|
||||||
m_pCancelButton = new CommandButton( "", NOTEPAD_TOPLEFT_BUTTON_X, NOTEPAD_TOPLEFT_BUTTON_Y, NOTEPAD_BUTTON_SIZE_X, NOTEPAD_BUTTON_SIZE_Y, true);
|
m_pCancelButton = new CommandButton( "", NOTEPAD_TOPLEFT_BUTTON_X, NOTEPAD_TOPLEFT_BUTTON_Y, NOTEPAD_BUTTON_SIZE_X, NOTEPAD_BUTTON_SIZE_Y, true);
|
||||||
m_pCancelButton->setParent( this );
|
m_pCancelButton->setParent( this );
|
||||||
m_pCancelButton->setText( gHUD.m_TextMessage.BufferedLocaliseTextString(" CLOSE") );
|
m_pCancelButton->setText( gHUD.m_TextMessage.BufferedLocaliseTextString(" CLOSE") );
|
||||||
m_pCancelButton->setVisible( true );
|
m_pCancelButton->setVisible( true );
|
||||||
m_pCancelButton->addActionSignal(new CMenuHandler_TextWindow(HIDE_TEXTWINDOW));
|
m_pCancelButton->addActionSignal(new CMenuHandler_TextWindow(HIDE_TEXTWINDOW));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
m_pImage = new CImageLabel( "gina", 0, 0, 128, 256 ); // gfx/vgui/640_gina.tga
|
m_pImage = new CImageLabel( "gina", 0, 0, 128, 256 ); // gfx/vgui/640_gina.tga
|
||||||
//m_pImage->setText(25, "this is a test!!!");
|
//m_pImage->setText(25, "this is a test!!!");
|
||||||
m_pImage->setParent( this );
|
m_pImage->setParent( this );
|
||||||
m_pImage->setVisible( true );
|
m_pImage->setVisible( true );
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Initialize();
|
Initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose: Called each time a new level is started.
|
// Purpose: Called each time a new level is started.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void CNotepad::Initialize( void )
|
void CNotepad::Initialize( void )
|
||||||
{
|
{
|
||||||
m_pScrollPanel->setScrollValue( 0, 0 );
|
m_pScrollPanel->setScrollValue( 0, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose: Called everytime the Team Menu is displayed
|
// Purpose: Called everytime the Team Menu is displayed
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void CNotepad::Update( void )
|
void CNotepad::Update( void )
|
||||||
{
|
{
|
||||||
m_pBriefing->setText(gHUD.m_TextMessage.BufferedLocaliseTextString(szText));
|
m_pBriefing->setText(gHUD.m_TextMessage.BufferedLocaliseTextString(szText));
|
||||||
m_pTitle->setText(gHUD.m_TextMessage.BufferedLocaliseTextString(szTitle));
|
m_pTitle->setText(gHUD.m_TextMessage.BufferedLocaliseTextString(szTitle));
|
||||||
|
|
||||||
int iYPos = NOTEPAD_TOPLEFT_BUTTON_Y;
|
int iYPos = NOTEPAD_TOPLEFT_BUTTON_Y;
|
||||||
|
|
||||||
// Move the AutoAssign button into place
|
// Move the AutoAssign button into place
|
||||||
m_pCancelButton->setPos( NOTEPAD_TOPLEFT_BUTTON_X, iYPos );
|
m_pCancelButton->setPos( NOTEPAD_TOPLEFT_BUTTON_X, iYPos );
|
||||||
|
|
||||||
m_pScrollPanel->validate();
|
m_pScrollPanel->validate();
|
||||||
//m_pImage->setBounds( NOTEPAD_TOPLEFT_BUTTON_X, NOTEPAD_TOPLEFT_BUTTON_Y-256-32, 128, 256 );
|
//m_pImage->setBounds( NOTEPAD_TOPLEFT_BUTTON_X, NOTEPAD_TOPLEFT_BUTTON_Y-256-32, 128, 256 );
|
||||||
}
|
}
|
||||||
|
|
||||||
//=====================================
|
//=====================================
|
||||||
// Key inputs
|
// Key inputs
|
||||||
bool CNotepad::SlotInput( int iSlot )
|
bool CNotepad::SlotInput( int iSlot )
|
||||||
{
|
{
|
||||||
if ( iSlot == 1)
|
if ( iSlot == 1)
|
||||||
{
|
{
|
||||||
m_pCancelButton->fireActionSignal();
|
m_pCancelButton->fireActionSignal();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//======================================
|
//======================================
|
||||||
// Update the Team menu before opening it
|
// Update the Team menu before opening it
|
||||||
void CNotepad::Open( void )
|
void CNotepad::Open( void )
|
||||||
{
|
{
|
||||||
Update();
|
Update();
|
||||||
CMenuPanel::Open();
|
CMenuPanel::Open();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,36 +1,36 @@
|
||||||
#include "extdll.h"
|
#include "extdll.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "cbase.h"
|
#include "cbase.h"
|
||||||
#include "animation.h"
|
#include "animation.h"
|
||||||
#include "effects.h"
|
#include "effects.h"
|
||||||
#include "actanimating.h"
|
#include "actanimating.h"
|
||||||
|
|
||||||
TYPEDESCRIPTION CActAnimating::m_SaveData[] =
|
TYPEDESCRIPTION CActAnimating::m_SaveData[] =
|
||||||
{
|
{
|
||||||
DEFINE_FIELD( CActAnimating, m_Activity, FIELD_INTEGER ),
|
DEFINE_FIELD( CActAnimating, m_Activity, FIELD_INTEGER ),
|
||||||
DEFINE_FIELD( CActAnimating, m_iSequence, FIELD_INTEGER ),
|
DEFINE_FIELD( CActAnimating, m_iSequence, FIELD_INTEGER ),
|
||||||
};
|
};
|
||||||
|
|
||||||
IMPLEMENT_SAVERESTORE( CActAnimating, CBaseAnimating );
|
IMPLEMENT_SAVERESTORE( CActAnimating, CBaseAnimating );
|
||||||
|
|
||||||
void CActAnimating :: SetActivity( Activity act )
|
void CActAnimating :: SetActivity( Activity act )
|
||||||
{
|
{
|
||||||
int sequence = LookupActivity( act );
|
int sequence = LookupActivity( act );
|
||||||
if ( sequence != ACTIVITY_NOT_AVAILABLE )
|
if ( sequence != ACTIVITY_NOT_AVAILABLE )
|
||||||
{
|
{
|
||||||
m_iSequence = sequence;
|
m_iSequence = sequence;
|
||||||
pev->sequence = sequence;
|
pev->sequence = sequence;
|
||||||
m_Activity = act;
|
m_Activity = act;
|
||||||
pev->frame = 0;
|
pev->frame = 0;
|
||||||
ResetSequenceInfo( );
|
ResetSequenceInfo( );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CActAnimating :: SetSequence( int sequence )
|
void CActAnimating :: SetSequence( int sequence )
|
||||||
{
|
{
|
||||||
//m_Activity = ACTIVITY_NOT_AVAILABLE;
|
//m_Activity = ACTIVITY_NOT_AVAILABLE;
|
||||||
pev->sequence = sequence;
|
pev->sequence = sequence;
|
||||||
m_iSequence = sequence;
|
m_iSequence = sequence;
|
||||||
pev->frame = 0;
|
pev->frame = 0;
|
||||||
ResetSequenceInfo( );
|
ResetSequenceInfo( );
|
||||||
}
|
}
|
|
@ -1,19 +1,19 @@
|
||||||
|
|
||||||
class CActAnimating : public CBaseAnimating
|
class CActAnimating : public CBaseAnimating
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void SetActivity( Activity act );
|
void SetActivity( Activity act );
|
||||||
inline Activity GetActivity( void ) { return m_Activity; }
|
inline Activity GetActivity( void ) { return m_Activity; }
|
||||||
void SetSequence( int sequence );
|
void SetSequence( int sequence );
|
||||||
inline int GetSequence( void ) { return m_iSequence; }
|
inline int GetSequence( void ) { return m_iSequence; }
|
||||||
|
|
||||||
virtual int ObjectCaps( void ) { return CBaseAnimating :: ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
|
virtual int ObjectCaps( void ) { return CBaseAnimating :: ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
|
||||||
|
|
||||||
virtual int Save( CSave &save );
|
virtual int Save( CSave &save );
|
||||||
virtual int Restore( CRestore &restore );
|
virtual int Restore( CRestore &restore );
|
||||||
static TYPEDESCRIPTION m_SaveData[];
|
static TYPEDESCRIPTION m_SaveData[];
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Activity m_Activity;
|
Activity m_Activity;
|
||||||
int m_iSequence;
|
int m_iSequence;
|
||||||
};
|
};
|
||||||
|
|
1618
dlls/alienflyer.cpp
1618
dlls/alienflyer.cpp
File diff suppressed because it is too large
Load Diff
4296
dlls/bot.cpp
4296
dlls/bot.cpp
File diff suppressed because it is too large
Load Diff
354
dlls/bot.h
354
dlls/bot.h
|
@ -1,177 +1,177 @@
|
||||||
// botman's Half-Life bot example
|
// botman's Half-Life bot example
|
||||||
//
|
//
|
||||||
// http://planethalflife.com/botman/
|
// http://planethalflife.com/botman/
|
||||||
//
|
//
|
||||||
// bot.h
|
// bot.h
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef BOT_H
|
#ifndef BOT_H
|
||||||
#define BOT_H
|
#define BOT_H
|
||||||
|
|
||||||
#define LADDER_UP 1
|
#define LADDER_UP 1
|
||||||
#define LADDER_DOWN 2
|
#define LADDER_DOWN 2
|
||||||
|
|
||||||
#define WANDER_LEFT 1
|
#define WANDER_LEFT 1
|
||||||
#define WANDER_RIGHT 2
|
#define WANDER_RIGHT 2
|
||||||
|
|
||||||
#define MODEL_GINA 1
|
#define MODEL_GINA 1
|
||||||
#define MODEL_COLETTE 2
|
#define MODEL_COLETTE 2
|
||||||
|
|
||||||
#define BOT_YAW_SPEED 20 // degrees per 10th of second turning speed
|
#define BOT_YAW_SPEED 20 // degrees per 10th of second turning speed
|
||||||
|
|
||||||
#define BOT_SKIN_LEN 128
|
#define BOT_SKIN_LEN 128
|
||||||
#define BOT_NAME_LEN 31
|
#define BOT_NAME_LEN 31
|
||||||
|
|
||||||
#define ENEMY_HEADCRAB 0
|
#define ENEMY_HEADCRAB 0
|
||||||
#define ENEMY_ZOMBIE 1
|
#define ENEMY_ZOMBIE 1
|
||||||
#define ENEMY_BULLSQUID 2
|
#define ENEMY_BULLSQUID 2
|
||||||
#define ENEMY_ASLAVE 3
|
#define ENEMY_ASLAVE 3
|
||||||
#define ENEMY_HOUNDEYE 4
|
#define ENEMY_HOUNDEYE 4
|
||||||
#define ENEMY_AGRUNT 5
|
#define ENEMY_AGRUNT 5
|
||||||
#define ENEMY_HGRUNT 6
|
#define ENEMY_HGRUNT 6
|
||||||
#define ENEMY_CONTROLLER 7
|
#define ENEMY_CONTROLLER 7
|
||||||
#define ENEMY_FLYER 8
|
#define ENEMY_FLYER 8
|
||||||
#define ENEMY_UNKNOWN 254
|
#define ENEMY_UNKNOWN 254
|
||||||
#define ENEMY_NONE 255
|
#define ENEMY_NONE 255
|
||||||
|
|
||||||
typedef struct // used in checking if bot can pick up ammo
|
typedef struct // used in checking if bot can pick up ammo
|
||||||
{
|
{
|
||||||
const char *ammo_name;
|
const char *ammo_name;
|
||||||
const char *weapon_name;
|
const char *weapon_name;
|
||||||
int max_carry;
|
int max_carry;
|
||||||
} ammo_check_t;
|
} ammo_check_t;
|
||||||
|
|
||||||
#define BOT_IDLE 0
|
#define BOT_IDLE 0
|
||||||
#define BOT_NEED_TO_KICK 1
|
#define BOT_NEED_TO_KICK 1
|
||||||
#define BOT_NEED_TO_RESPAWN 2
|
#define BOT_NEED_TO_RESPAWN 2
|
||||||
#define BOT_IS_RESPAWNING 3
|
#define BOT_IS_RESPAWNING 3
|
||||||
|
|
||||||
typedef struct // used to respawn bot at end of round (time/frag limit)
|
typedef struct // used to respawn bot at end of round (time/frag limit)
|
||||||
{
|
{
|
||||||
BOOL is_used; // is this slot in use?
|
BOOL is_used; // is this slot in use?
|
||||||
int state; // current state of the bot
|
int state; // current state of the bot
|
||||||
char skin[BOT_SKIN_LEN+1];
|
char skin[BOT_SKIN_LEN+1];
|
||||||
char name[BOT_NAME_LEN+1];
|
char name[BOT_NAME_LEN+1];
|
||||||
char skill[2];
|
char skill[2];
|
||||||
CBasePlayer *pBot;
|
CBasePlayer *pBot;
|
||||||
} respawn_t;
|
} respawn_t;
|
||||||
|
|
||||||
#define GI_SND1 "gina/gina_attacked0.wav"
|
#define GI_SND1 "gina/gina_attacked0.wav"
|
||||||
#define GI_SND2 "gina/gina_attacked1.wav "
|
#define GI_SND2 "gina/gina_attacked1.wav "
|
||||||
#define GI_SND3 "gina/gina_pain1.wav "
|
#define GI_SND3 "gina/gina_pain1.wav "
|
||||||
#define GI_SND4 "gina/gina_pain2.wav "
|
#define GI_SND4 "gina/gina_pain2.wav "
|
||||||
#define GI_SND5 "gina/gina_pain3.wav "
|
#define GI_SND5 "gina/gina_pain3.wav "
|
||||||
|
|
||||||
#define CO_SND1 "colette/colette_attacked0.wav"
|
#define CO_SND1 "colette/colette_attacked0.wav"
|
||||||
#define CO_SND2 "colette/colette_attacked1.wav"
|
#define CO_SND2 "colette/colette_attacked1.wav"
|
||||||
#define CO_SND3 "colette/colette_pain0.wav"
|
#define CO_SND3 "colette/colette_pain0.wav"
|
||||||
#define CO_SND4 "colette/colette_pain2.wav"
|
#define CO_SND4 "colette/colette_pain2.wav"
|
||||||
#define CO_SND5 "colette/colette_pain3.wav"
|
#define CO_SND5 "colette/colette_pain3.wav"
|
||||||
|
|
||||||
//
|
//
|
||||||
// joy after successful enemy kill
|
// joy after successful enemy kill
|
||||||
//
|
//
|
||||||
|
|
||||||
#define CO_TNT1 "colette/colette_kill0.wav"
|
#define CO_TNT1 "colette/colette_kill0.wav"
|
||||||
#define CO_TNT2 "colette/colette_kill1.wav"
|
#define CO_TNT2 "colette/colette_kill1.wav"
|
||||||
#define CO_TNT3 "colette/colette_kill2.wav"
|
#define CO_TNT3 "colette/colette_kill2.wav"
|
||||||
#define CO_TNT4 "colette/colette_kill3.wav"
|
#define CO_TNT4 "colette/colette_kill3.wav"
|
||||||
#define CO_TNT5 "colette/colette_kill4.wav"
|
#define CO_TNT5 "colette/colette_kill4.wav"
|
||||||
|
|
||||||
#define GI_TNT1 "gina/gina_kill0.wav"
|
#define GI_TNT1 "gina/gina_kill0.wav"
|
||||||
#define GI_TNT2 "gina/gina_kill1.wav"
|
#define GI_TNT2 "gina/gina_kill1.wav"
|
||||||
#define GI_TNT3 "gina/gina_kill2.wav"
|
#define GI_TNT3 "gina/gina_kill2.wav"
|
||||||
#define GI_TNT4 "gina/gina_kill3.wav"
|
#define GI_TNT4 "gina/gina_kill3.wav"
|
||||||
#define GI_TNT5 "gina/gina_kill4.wav"
|
#define GI_TNT5 "gina/gina_kill4.wav"
|
||||||
|
|
||||||
#define USE_TEAMPLAY_SND "barney/teamup2.wav"
|
#define USE_TEAMPLAY_SND "barney/teamup2.wav"
|
||||||
#define USE_TEAMPLAY_LATER_SND "barney/seeya.wav"
|
#define USE_TEAMPLAY_LATER_SND "barney/seeya.wav"
|
||||||
#define USE_TEAMPLAY_ENEMY_SND "barney/ba_raincheck.wav"
|
#define USE_TEAMPLAY_ENEMY_SND "barney/ba_raincheck.wav"
|
||||||
|
|
||||||
void BotDebug( char *buffer ); // print out message to HUD for debugging
|
void BotDebug( char *buffer ); // print out message to HUD for debugging
|
||||||
|
|
||||||
|
|
||||||
class CBot : public CBasePlayer //Derive a bot class from CBasePlayer
|
class CBot : public CBasePlayer //Derive a bot class from CBasePlayer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Vector v_prev_origin; // previous origin (i.e. location)
|
Vector v_prev_origin; // previous origin (i.e. location)
|
||||||
float f_shoot_time; // next time to shoot weapon at
|
float f_shoot_time; // next time to shoot weapon at
|
||||||
float f_max_speed; // last sv_maxspeed setting
|
float f_max_speed; // last sv_maxspeed setting
|
||||||
float f_speed_check_time; // check sv_maxspeed every so often
|
float f_speed_check_time; // check sv_maxspeed every so often
|
||||||
float f_move_speed; // speed at which the bot will move
|
float f_move_speed; // speed at which the bot will move
|
||||||
int ladder_dir; // direction traveling on ladder (UP or DOWN)
|
int ladder_dir; // direction traveling on ladder (UP or DOWN)
|
||||||
int wander_dir; // randomly wander left or right
|
int wander_dir; // randomly wander left or right
|
||||||
float f_pause_time; // timeout for periods when the bot pauses
|
float f_pause_time; // timeout for periods when the bot pauses
|
||||||
float f_find_item; // timeout for not looking for items
|
float f_find_item; // timeout for not looking for items
|
||||||
char model_name[64];
|
char model_name[64];
|
||||||
int bot_model;
|
int bot_model;
|
||||||
int bot_skill; // bot skill level (0=very good, 4=very bad)
|
int bot_skill; // bot skill level (0=very good, 4=very bad)
|
||||||
float f_pain_time; // time when pain sound can be spoken
|
float f_pain_time; // time when pain sound can be spoken
|
||||||
BOOL b_use_health_station; // set if bot should "use" health station
|
BOOL b_use_health_station; // set if bot should "use" health station
|
||||||
float f_use_health_time; // time when b_use_health_station is set
|
float f_use_health_time; // time when b_use_health_station is set
|
||||||
BOOL b_use_HEV_station; // set if bot should "use" HEV station
|
BOOL b_use_HEV_station; // set if bot should "use" HEV station
|
||||||
float f_use_HEV_time; // time when b_use_HEV_station is set
|
float f_use_HEV_time; // time when b_use_HEV_station is set
|
||||||
BOOL b_use_button; // set if bot should "use" button
|
BOOL b_use_button; // set if bot should "use" button
|
||||||
float f_use_button_time; // time when b_use_button is set
|
float f_use_button_time; // time when b_use_button is set
|
||||||
BOOL b_lift_moving; // flag set when lift (elevator) is moving
|
BOOL b_lift_moving; // flag set when lift (elevator) is moving
|
||||||
float f_use_ladder_time; // time when bot sees a ladder
|
float f_use_ladder_time; // time when bot sees a ladder
|
||||||
BOOL b_see_tripmine; // set if bot "sees" a tripmine
|
BOOL b_see_tripmine; // set if bot "sees" a tripmine
|
||||||
BOOL b_shoot_tripmine; // set if bot should shoot a tripmine
|
BOOL b_shoot_tripmine; // set if bot should shoot a tripmine
|
||||||
Vector v_tripmine_origin; // origin of tripmine
|
Vector v_tripmine_origin; // origin of tripmine
|
||||||
float f_fire_gauss; // time to release secondary fire on gauss gun
|
float f_fire_gauss; // time to release secondary fire on gauss gun
|
||||||
BOOL bot_was_paused; // TRUE if bot was previously "paused"
|
BOOL bot_was_paused; // TRUE if bot was previously "paused"
|
||||||
float f_weapon_inventory_time; // time to check weapon inventory
|
float f_weapon_inventory_time; // time to check weapon inventory
|
||||||
int respawn_index; // index in respawn structure for this bot
|
int respawn_index; // index in respawn structure for this bot
|
||||||
float f_dont_avoid_wall_time; // time when avoiding walls is OK
|
float f_dont_avoid_wall_time; // time when avoiding walls is OK
|
||||||
float f_bot_use_time; // time the bot was "used" by player
|
float f_bot_use_time; // time the bot was "used" by player
|
||||||
float f_wall_on_left; // time since bot has had a wall on the left
|
float f_wall_on_left; // time since bot has had a wall on the left
|
||||||
float f_wall_on_right; // time since bot has had a wall on the right
|
float f_wall_on_right; // time since bot has had a wall on the right
|
||||||
|
|
||||||
CBaseEntity *pBotEnemy; // pointer to bot's enemy
|
CBaseEntity *pBotEnemy; // pointer to bot's enemy
|
||||||
EOFFSET pBotEnemyOffset;
|
EOFFSET pBotEnemyOffset;
|
||||||
byte pBotEnemyClass;
|
byte pBotEnemyClass;
|
||||||
CBaseEntity *pBotUser; // pointer to player using bot
|
CBaseEntity *pBotUser; // pointer to player using bot
|
||||||
CBaseEntity *pBotPickupItem; // pointer to item we are trying to get
|
CBaseEntity *pBotPickupItem; // pointer to item we are trying to get
|
||||||
CBasePlayerItem *weapon_ptr[MAX_WEAPONS]; // pointer array to weapons
|
CBasePlayerItem *weapon_ptr[MAX_WEAPONS]; // pointer array to weapons
|
||||||
int primary_ammo[MAX_WEAPONS]; // amount of primary ammo available
|
int primary_ammo[MAX_WEAPONS]; // amount of primary ammo available
|
||||||
int secondary_ammo[MAX_WEAPONS]; // amount of secondary ammo available
|
int secondary_ammo[MAX_WEAPONS]; // amount of secondary ammo available
|
||||||
|
|
||||||
char message[256]; // buffer for debug messages
|
char message[256]; // buffer for debug messages
|
||||||
|
|
||||||
void Spawn( void );
|
void Spawn( void );
|
||||||
void BotThink( void ); // think function for the bot
|
void BotThink( void ); // think function for the bot
|
||||||
|
|
||||||
// Bots should return FALSE for this, they can't receive NET messages
|
// Bots should return FALSE for this, they can't receive NET messages
|
||||||
virtual BOOL IsNetClient( void ) { return FALSE; }
|
virtual BOOL IsNetClient( void ) { return FALSE; }
|
||||||
|
|
||||||
int BloodColor() { return BLOOD_COLOR_RED; }
|
int BloodColor() { return BLOOD_COLOR_RED; }
|
||||||
int TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker,
|
int TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker,
|
||||||
float flDamage, int bitsDamageType );
|
float flDamage, int bitsDamageType );
|
||||||
int ObjectCaps() { return FCAP_IMPULSE_USE; };
|
int ObjectCaps() { return FCAP_IMPULSE_USE; };
|
||||||
void Use( CBaseEntity *pActivator, CBaseEntity *pCaller,
|
void Use( CBaseEntity *pActivator, CBaseEntity *pCaller,
|
||||||
USE_TYPE useType, float value );
|
USE_TYPE useType, float value );
|
||||||
|
|
||||||
int BotInFieldOfView( Vector dest );
|
int BotInFieldOfView( Vector dest );
|
||||||
BOOL BotEntityIsVisible( Vector dest );
|
BOOL BotEntityIsVisible( Vector dest );
|
||||||
float BotChangeYaw( float speed );
|
float BotChangeYaw( float speed );
|
||||||
void BotOnLadder( float moved_distance );
|
void BotOnLadder( float moved_distance );
|
||||||
void BotUnderWater( void );
|
void BotUnderWater( void );
|
||||||
CBaseEntity * BotFindEnemy( void );
|
CBaseEntity * BotFindEnemy( void );
|
||||||
Vector BotBodyTarget( CBaseEntity *pBotEnemy );
|
Vector BotBodyTarget( CBaseEntity *pBotEnemy );
|
||||||
void BotWeaponInventory( void );
|
void BotWeaponInventory( void );
|
||||||
BOOL BotFireWeapon( Vector enemy, int weapon_choice = 0, BOOL primary = TRUE );
|
BOOL BotFireWeapon( Vector enemy, int weapon_choice = 0, BOOL primary = TRUE );
|
||||||
void BotShootAtEnemy( void );
|
void BotShootAtEnemy( void );
|
||||||
void BotFindItem( void );
|
void BotFindItem( void );
|
||||||
void BotUseLift( float moved_distance );
|
void BotUseLift( float moved_distance );
|
||||||
void BotTurnAtWall( TraceResult *tr );
|
void BotTurnAtWall( TraceResult *tr );
|
||||||
BOOL BotCantMoveForward( TraceResult *tr );
|
BOOL BotCantMoveForward( TraceResult *tr );
|
||||||
BOOL BotCanJumpUp( void );
|
BOOL BotCanJumpUp( void );
|
||||||
BOOL BotCanDuckUnder( void );
|
BOOL BotCanDuckUnder( void );
|
||||||
BOOL BotShootTripmine( void );
|
BOOL BotShootTripmine( void );
|
||||||
BOOL BotFollowUser( void ); // returns FALSE if can find "user"
|
BOOL BotFollowUser( void ); // returns FALSE if can find "user"
|
||||||
BOOL BotCheckWallOnLeft( void );
|
BOOL BotCheckWallOnLeft( void );
|
||||||
BOOL BotCheckWallOnRight( void );
|
BOOL BotCheckWallOnRight( void );
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // BOT_H
|
#endif // BOT_H
|
||||||
|
|
||||||
|
|
2182
dlls/bot_combat.cpp
2182
dlls/bot_combat.cpp
File diff suppressed because it is too large
Load Diff
|
@ -1,236 +1,236 @@
|
||||||
//
|
//
|
||||||
// Decay entities (chargers: health and hev; retinal scanner)
|
// Decay entities (chargers: health and hev; retinal scanner)
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "extdll.h"
|
#include "extdll.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "cbase.h"
|
#include "cbase.h"
|
||||||
#include "monsters.h"
|
#include "monsters.h"
|
||||||
#include "schedule.h"
|
#include "schedule.h"
|
||||||
#include "defaultai.h"
|
#include "defaultai.h"
|
||||||
#include "scripted.h"
|
#include "scripted.h"
|
||||||
#include "animation.h"
|
#include "animation.h"
|
||||||
#include "soundent.h"
|
#include "soundent.h"
|
||||||
#include "actanimating.h"
|
#include "actanimating.h"
|
||||||
|
|
||||||
//
|
//
|
||||||
// EYE RETINAL SCANNER
|
// EYE RETINAL SCANNER
|
||||||
//
|
//
|
||||||
|
|
||||||
#define EYESCANNER_HIDE_TIME 3
|
#define EYESCANNER_HIDE_TIME 3
|
||||||
#define EYESCANNER_SCAN_LOOPS 3
|
#define EYESCANNER_SCAN_LOOPS 3
|
||||||
|
|
||||||
class CEyeScanner : public CActAnimating
|
class CEyeScanner : public CActAnimating
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void Precache( void );
|
void Precache( void );
|
||||||
void Spawn( void );
|
void Spawn( void );
|
||||||
void Touch( CBaseEntity *pOther );
|
void Touch( CBaseEntity *pOther );
|
||||||
void EXPORT ScannerThink( void );
|
void EXPORT ScannerThink( void );
|
||||||
void EXPORT UseThink( void );
|
void EXPORT UseThink( void );
|
||||||
void Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
|
void Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
|
||||||
void KeyValue( KeyValueData *pkvd );
|
void KeyValue( KeyValueData *pkvd );
|
||||||
|
|
||||||
virtual int ObjectCaps( void ) { return CActAnimating :: ObjectCaps() | /*FCAP_CONTINUOUS_USE | */FCAP_IMPULSE_USE; }
|
virtual int ObjectCaps( void ) { return CActAnimating :: ObjectCaps() | /*FCAP_CONTINUOUS_USE | */FCAP_IMPULSE_USE; }
|
||||||
|
|
||||||
virtual int Save( CSave &save );
|
virtual int Save( CSave &save );
|
||||||
virtual int Restore( CRestore &restore );
|
virtual int Restore( CRestore &restore );
|
||||||
static TYPEDESCRIPTION m_SaveData[];
|
static TYPEDESCRIPTION m_SaveData[];
|
||||||
|
|
||||||
BOOL m_bState;
|
BOOL m_bState;
|
||||||
BOOL m_bIsKeymaker;
|
BOOL m_bIsKeymaker;
|
||||||
int m_iCheckFrame;
|
int m_iCheckFrame;
|
||||||
int m_iCheckLoop;
|
int m_iCheckLoop;
|
||||||
int m_iszTargetUnlocked;
|
int m_iszTargetUnlocked;
|
||||||
int m_iszTargetLocked;
|
int m_iszTargetLocked;
|
||||||
int m_iszKeymaker; // The One's who unlocks name :)
|
int m_iszKeymaker; // The One's who unlocks name :)
|
||||||
};
|
};
|
||||||
|
|
||||||
LINK_ENTITY_TO_CLASS(item_eyescanner, CEyeScanner);
|
LINK_ENTITY_TO_CLASS(item_eyescanner, CEyeScanner);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Implementing save/restore
|
// Implementing save/restore
|
||||||
//
|
//
|
||||||
|
|
||||||
TYPEDESCRIPTION CEyeScanner::m_SaveData[] =
|
TYPEDESCRIPTION CEyeScanner::m_SaveData[] =
|
||||||
{
|
{
|
||||||
DEFINE_FIELD( CEyeScanner, m_bState, FIELD_BOOLEAN ),
|
DEFINE_FIELD( CEyeScanner, m_bState, FIELD_BOOLEAN ),
|
||||||
DEFINE_FIELD( CEyeScanner, m_bIsKeymaker, FIELD_BOOLEAN ),
|
DEFINE_FIELD( CEyeScanner, m_bIsKeymaker, FIELD_BOOLEAN ),
|
||||||
DEFINE_FIELD( CEyeScanner, m_iCheckLoop, FIELD_INTEGER ),
|
DEFINE_FIELD( CEyeScanner, m_iCheckLoop, FIELD_INTEGER ),
|
||||||
DEFINE_FIELD( CEyeScanner, m_iCheckFrame, FIELD_INTEGER ),
|
DEFINE_FIELD( CEyeScanner, m_iCheckFrame, FIELD_INTEGER ),
|
||||||
DEFINE_FIELD( CEyeScanner, m_iszTargetUnlocked, FIELD_STRING ),
|
DEFINE_FIELD( CEyeScanner, m_iszTargetUnlocked, FIELD_STRING ),
|
||||||
DEFINE_FIELD( CEyeScanner, m_iszTargetLocked, FIELD_STRING ),
|
DEFINE_FIELD( CEyeScanner, m_iszTargetLocked, FIELD_STRING ),
|
||||||
DEFINE_FIELD( CEyeScanner, m_iszKeymaker, FIELD_STRING ),
|
DEFINE_FIELD( CEyeScanner, m_iszKeymaker, FIELD_STRING ),
|
||||||
};
|
};
|
||||||
IMPLEMENT_SAVERESTORE( CEyeScanner, CActAnimating );
|
IMPLEMENT_SAVERESTORE( CEyeScanner, CActAnimating );
|
||||||
|
|
||||||
//
|
//
|
||||||
// common functions
|
// common functions
|
||||||
//
|
//
|
||||||
|
|
||||||
#define mdlScanner "models/eye_scanner.mdl"
|
#define mdlScanner "models/eye_scanner.mdl"
|
||||||
#define sndScannerBeep "buttons/blip1.wav"
|
#define sndScannerBeep "buttons/blip1.wav"
|
||||||
#define sndScannerOpen "buttons/blip2.wav"
|
#define sndScannerOpen "buttons/blip2.wav"
|
||||||
#define sndScannerDeny "buttons/button11.wav"
|
#define sndScannerDeny "buttons/button11.wav"
|
||||||
|
|
||||||
void CEyeScanner::Precache( void )
|
void CEyeScanner::Precache( void )
|
||||||
{
|
{
|
||||||
PRECACHE_MODEL( mdlScanner );
|
PRECACHE_MODEL( mdlScanner );
|
||||||
PRECACHE_SOUND( sndScannerBeep );
|
PRECACHE_SOUND( sndScannerBeep );
|
||||||
PRECACHE_SOUND( sndScannerOpen );
|
PRECACHE_SOUND( sndScannerOpen );
|
||||||
PRECACHE_SOUND( sndScannerDeny );
|
PRECACHE_SOUND( sndScannerDeny );
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEyeScanner::Spawn( void )
|
void CEyeScanner::Spawn( void )
|
||||||
{
|
{
|
||||||
Precache( );
|
Precache( );
|
||||||
|
|
||||||
SET_MODEL(ENT(pev), mdlScanner );
|
SET_MODEL(ENT(pev), mdlScanner );
|
||||||
|
|
||||||
pev->movetype = MOVETYPE_NONE;
|
pev->movetype = MOVETYPE_NONE;
|
||||||
pev->solid = SOLID_TRIGGER;
|
pev->solid = SOLID_TRIGGER;
|
||||||
|
|
||||||
UTIL_SetSize( pev, Vector(-8,-8,0), Vector(8,8,32));
|
UTIL_SetSize( pev, Vector(-8,-8,0), Vector(8,8,32));
|
||||||
SetActivity( ACT_CROUCHIDLE );
|
SetActivity( ACT_CROUCHIDLE );
|
||||||
|
|
||||||
SetThink ( &CEyeScanner::ScannerThink );
|
SetThink ( &CEyeScanner::ScannerThink );
|
||||||
pev->nextthink = gpGlobals->time + 0.1;
|
pev->nextthink = gpGlobals->time + 0.1;
|
||||||
//pev->frame = RANDOM_FLOAT(0,255);
|
//pev->frame = RANDOM_FLOAT(0,255);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEyeScanner::KeyValue( KeyValueData *pkvd )
|
void CEyeScanner::KeyValue( KeyValueData *pkvd )
|
||||||
{
|
{
|
||||||
if (FStrEq(pkvd->szKeyName, "unlocked_target"))
|
if (FStrEq(pkvd->szKeyName, "unlocked_target"))
|
||||||
{
|
{
|
||||||
m_iszTargetUnlocked = ALLOC_STRING(pkvd->szValue);
|
m_iszTargetUnlocked = ALLOC_STRING(pkvd->szValue);
|
||||||
pkvd->fHandled = TRUE;
|
pkvd->fHandled = TRUE;
|
||||||
}
|
}
|
||||||
else if (FStrEq(pkvd->szKeyName, "locked_target"))
|
else if (FStrEq(pkvd->szKeyName, "locked_target"))
|
||||||
{
|
{
|
||||||
m_iszTargetLocked = ALLOC_STRING(pkvd->szValue);
|
m_iszTargetLocked = ALLOC_STRING(pkvd->szValue);
|
||||||
pkvd->fHandled = TRUE;
|
pkvd->fHandled = TRUE;
|
||||||
}
|
}
|
||||||
else if (FStrEq(pkvd->szKeyName, "unlockersname"))
|
else if (FStrEq(pkvd->szKeyName, "unlockersname"))
|
||||||
{
|
{
|
||||||
m_iszKeymaker = ALLOC_STRING(pkvd->szValue);
|
m_iszKeymaker = ALLOC_STRING(pkvd->szValue);
|
||||||
pkvd->fHandled = TRUE;
|
pkvd->fHandled = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
CActAnimating::KeyValue( pkvd );
|
CActAnimating::KeyValue( pkvd );
|
||||||
//m_iReactivate = atoi(pkvd->szValue);
|
//m_iReactivate = atoi(pkvd->szValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEyeScanner::ScannerThink( void )
|
void CEyeScanner::ScannerThink( void )
|
||||||
{
|
{
|
||||||
StudioFrameAdvance();
|
StudioFrameAdvance();
|
||||||
pev->nextthink = gpGlobals->time + 0.1;
|
pev->nextthink = gpGlobals->time + 0.1;
|
||||||
|
|
||||||
switch( GetActivity() )
|
switch( GetActivity() )
|
||||||
{
|
{
|
||||||
case ACT_CROUCH: // deactivate in progress
|
case ACT_CROUCH: // deactivate in progress
|
||||||
if ( m_fSequenceFinished )
|
if ( m_fSequenceFinished )
|
||||||
SetActivity( ACT_CROUCHIDLE );
|
SetActivity( ACT_CROUCHIDLE );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ACT_CROUCHIDLE: // deactivated
|
case ACT_CROUCHIDLE: // deactivated
|
||||||
pev->skin = 0;
|
pev->skin = 0;
|
||||||
m_bState = FALSE;
|
m_bState = FALSE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ACT_STAND: // activate in progress
|
case ACT_STAND: // activate in progress
|
||||||
m_bState = TRUE;
|
m_bState = TRUE;
|
||||||
if ( m_fSequenceFinished )
|
if ( m_fSequenceFinished )
|
||||||
SetActivity( ACT_IDLE );
|
SetActivity( ACT_IDLE );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ACT_IDLE: // activated
|
case ACT_IDLE: // activated
|
||||||
if ( gpGlobals->time > pev->dmgtime )
|
if ( gpGlobals->time > pev->dmgtime )
|
||||||
SetActivity( ACT_CROUCH );
|
SetActivity( ACT_CROUCH );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEyeScanner :: Touch( CBaseEntity *pOther )
|
void CEyeScanner :: Touch( CBaseEntity *pOther )
|
||||||
{/*
|
{/*
|
||||||
int iClass = pOther->Classify();
|
int iClass = pOther->Classify();
|
||||||
//if ( pOther->IsPlayer() )
|
//if ( pOther->IsPlayer() )
|
||||||
if (iClass == CLASS_PLAYER || iClass == CLASS_PLAYER_ALLY)
|
if (iClass == CLASS_PLAYER || iClass == CLASS_PLAYER_ALLY)
|
||||||
{
|
{
|
||||||
pev->dmgtime = gpGlobals->time + EYESCANNER_HIDE_TIME;
|
pev->dmgtime = gpGlobals->time + EYESCANNER_HIDE_TIME;
|
||||||
if ( GetActivity() == ACT_CROUCH || GetActivity() == ACT_CROUCHIDLE )
|
if ( GetActivity() == ACT_CROUCH || GetActivity() == ACT_CROUCHIDLE )
|
||||||
{
|
{
|
||||||
SetActivity( ACT_STAND );
|
SetActivity( ACT_STAND );
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEyeScanner :: Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
|
void CEyeScanner :: Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
|
||||||
{
|
{
|
||||||
if (GetActivity() == ACT_CROUCHIDLE)
|
if (GetActivity() == ACT_CROUCHIDLE)
|
||||||
{
|
{
|
||||||
pev->dmgtime = gpGlobals->time + EYESCANNER_HIDE_TIME;
|
pev->dmgtime = gpGlobals->time + EYESCANNER_HIDE_TIME;
|
||||||
//if ( GetActivity() == ACT_CROUCH || GetActivity() == ACT_CROUCHIDLE )
|
//if ( GetActivity() == ACT_CROUCH || GetActivity() == ACT_CROUCHIDLE )
|
||||||
//{
|
//{
|
||||||
SetActivity( ACT_STAND );
|
SetActivity( ACT_STAND );
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (m_bState == FALSE)
|
//if (m_bState == FALSE)
|
||||||
// return;
|
// return;
|
||||||
|
|
||||||
int m_iszCallerName;
|
int m_iszCallerName;
|
||||||
if (pActivator)
|
if (pActivator)
|
||||||
m_iszCallerName = pActivator->pev->targetname;
|
m_iszCallerName = pActivator->pev->targetname;
|
||||||
else
|
else
|
||||||
m_iszCallerName = pCaller->pev->targetname;
|
m_iszCallerName = pCaller->pev->targetname;
|
||||||
|
|
||||||
//ALERT( at_console, "caller name is %s\n", STRING(m_iszCallerName) );
|
//ALERT( at_console, "caller name is %s\n", STRING(m_iszCallerName) );
|
||||||
|
|
||||||
if (m_iszKeymaker) // if unlocker's name is specified then do check activator's name
|
if (m_iszKeymaker) // if unlocker's name is specified then do check activator's name
|
||||||
m_bIsKeymaker = !strcmp(STRING(m_iszCallerName), STRING(m_iszKeymaker));
|
m_bIsKeymaker = !strcmp(STRING(m_iszCallerName), STRING(m_iszKeymaker));
|
||||||
else // otherwise open for everyone
|
else // otherwise open for everyone
|
||||||
m_bIsKeymaker = true;
|
m_bIsKeymaker = true;
|
||||||
|
|
||||||
m_iCheckLoop = 0;
|
m_iCheckLoop = 0;
|
||||||
m_iCheckFrame = 1;
|
m_iCheckFrame = 1;
|
||||||
m_bState = FALSE;
|
m_bState = FALSE;
|
||||||
SetThink( &CEyeScanner::UseThink );
|
SetThink( &CEyeScanner::UseThink );
|
||||||
pev->nextthink = gpGlobals->time + 1.5;
|
pev->nextthink = gpGlobals->time + 1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEyeScanner :: UseThink( void )
|
void CEyeScanner :: UseThink( void )
|
||||||
{
|
{
|
||||||
pev->nextthink = gpGlobals->time + 0.15;
|
pev->nextthink = gpGlobals->time + 0.15;
|
||||||
// buttons/blip1.wav
|
// buttons/blip1.wav
|
||||||
EMIT_SOUND( ENT(pev), CHAN_ITEM, sndScannerBeep, 0.85, ATTN_NORM );
|
EMIT_SOUND( ENT(pev), CHAN_ITEM, sndScannerBeep, 0.85, ATTN_NORM );
|
||||||
|
|
||||||
if (m_iCheckLoop == EYESCANNER_SCAN_LOOPS)
|
if (m_iCheckLoop == EYESCANNER_SCAN_LOOPS)
|
||||||
{
|
{
|
||||||
// scan process finished - do something!
|
// scan process finished - do something!
|
||||||
if (m_bIsKeymaker)
|
if (m_bIsKeymaker)
|
||||||
{
|
{
|
||||||
FireTargets( STRING(m_iszTargetUnlocked), this, this, USE_TOGGLE, 0 );
|
FireTargets( STRING(m_iszTargetUnlocked), this, this, USE_TOGGLE, 0 );
|
||||||
EMIT_SOUND( ENT(pev), CHAN_ITEM, sndScannerOpen, 0.85, ATTN_NORM );
|
EMIT_SOUND( ENT(pev), CHAN_ITEM, sndScannerOpen, 0.85, ATTN_NORM );
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
FireTargets( STRING(m_iszTargetLocked), this, this, USE_TOGGLE, 0 );
|
FireTargets( STRING(m_iszTargetLocked), this, this, USE_TOGGLE, 0 );
|
||||||
EMIT_SOUND( ENT(pev), CHAN_ITEM, sndScannerDeny, 0.85, ATTN_NORM );
|
EMIT_SOUND( ENT(pev), CHAN_ITEM, sndScannerDeny, 0.85, ATTN_NORM );
|
||||||
}
|
}
|
||||||
|
|
||||||
SetThink( &CEyeScanner::ScannerThink );
|
SetThink( &CEyeScanner::ScannerThink );
|
||||||
pev->skin = 0;
|
pev->skin = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we are in last animation frame, skip to first one
|
// if we are in last animation frame, skip to first one
|
||||||
if (m_iCheckFrame == 4)
|
if (m_iCheckFrame == 4)
|
||||||
{
|
{
|
||||||
m_iCheckFrame = 1;
|
m_iCheckFrame = 1;
|
||||||
m_iCheckLoop++;
|
m_iCheckLoop++;
|
||||||
}
|
}
|
||||||
|
|
||||||
pev->skin = m_iCheckFrame;
|
pev->skin = m_iCheckFrame;
|
||||||
m_iCheckFrame++;
|
m_iCheckFrame++;
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
1156
dlls/displacer.cpp
1156
dlls/displacer.cpp
File diff suppressed because it is too large
Load Diff
1056
dlls/modeltrain.cpp
1056
dlls/modeltrain.cpp
File diff suppressed because it is too large
Load Diff
|
@ -1,66 +1,66 @@
|
||||||
/***
|
/***
|
||||||
*
|
*
|
||||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||||
*
|
*
|
||||||
* This product contains software technology licensed from Id
|
* This product contains software technology licensed from Id
|
||||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||||
* All Rights Reserved.
|
* All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Use, distribution, and modification of this source code and/or resulting
|
* Use, distribution, and modification of this source code and/or resulting
|
||||||
* object code is restricted to non-commercial enhancements to products from
|
* object code is restricted to non-commercial enhancements to products from
|
||||||
* Valve LLC. All other use, distribution, or modification is prohibited
|
* Valve LLC. All other use, distribution, or modification is prohibited
|
||||||
* without written permission from Valve LLC.
|
* without written permission from Valve LLC.
|
||||||
*
|
*
|
||||||
****/
|
****/
|
||||||
//=========================================================
|
//=========================================================
|
||||||
// Monster Maker - this is an entity that creates monsters
|
// Monster Maker - this is an entity that creates monsters
|
||||||
// in the game.
|
// in the game.
|
||||||
//=========================================================
|
//=========================================================
|
||||||
|
|
||||||
// Monstermaker spawnflags
|
// Monstermaker spawnflags
|
||||||
#define SF_MONSTERMAKER_START_ON 1 // start active ( if has targetname )
|
#define SF_MONSTERMAKER_START_ON 1 // start active ( if has targetname )
|
||||||
#define SF_MONSTERMAKER_CYCLIC 4 // drop one monster every time fired.
|
#define SF_MONSTERMAKER_CYCLIC 4 // drop one monster every time fired.
|
||||||
#define SF_MONSTERMAKER_MONSTERCLIP 8 // Children are blocked by monsterclip
|
#define SF_MONSTERMAKER_MONSTERCLIP 8 // Children are blocked by monsterclip
|
||||||
#define SF_MONSTERMAKER_FIREONCE 16 // kill after all children spawned if not cyclic
|
#define SF_MONSTERMAKER_FIREONCE 16 // kill after all children spawned if not cyclic
|
||||||
|
|
||||||
#define SF_WARPBALL_ONCE 1 // spawn monster only once, ignore "maxlivechildren"
|
#define SF_WARPBALL_ONCE 1 // spawn monster only once, ignore "maxlivechildren"
|
||||||
|
|
||||||
//=========================================================
|
//=========================================================
|
||||||
// MonsterMaker - this ent creates monsters during the game.
|
// MonsterMaker - this ent creates monsters during the game.
|
||||||
//=========================================================
|
//=========================================================
|
||||||
class CMonsterMaker : public CBaseMonster
|
class CMonsterMaker : public CBaseMonster
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void Spawn( void );
|
void Spawn( void );
|
||||||
void Precache( void );
|
void Precache( void );
|
||||||
void KeyValue( KeyValueData* pkvd);
|
void KeyValue( KeyValueData* pkvd);
|
||||||
void EXPORT ToggleUse ( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
|
void EXPORT ToggleUse ( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
|
||||||
void EXPORT CyclicUse ( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
|
void EXPORT CyclicUse ( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
|
||||||
void EXPORT MakerThink ( void );
|
void EXPORT MakerThink ( void );
|
||||||
void DeathNotice ( entvars_t *pevChild );// monster maker children use this to tell the monster maker that they have died.
|
void DeathNotice ( entvars_t *pevChild );// monster maker children use this to tell the monster maker that they have died.
|
||||||
void MakeMonster( void );
|
void MakeMonster( void );
|
||||||
void MonsterMakerInit( const char* ChildName, int MaxLiveChildren, int NumMonsters );
|
void MonsterMakerInit( const char* ChildName, int MaxLiveChildren, int NumMonsters );
|
||||||
static CMonsterMaker *MonsterMakerCreate( const char* ChildName, int MaxLiveChildren, int NumMonsters );
|
static CMonsterMaker *MonsterMakerCreate( const char* ChildName, int MaxLiveChildren, int NumMonsters );
|
||||||
|
|
||||||
virtual int Save( CSave &save );
|
virtual int Save( CSave &save );
|
||||||
virtual int Restore( CRestore &restore );
|
virtual int Restore( CRestore &restore );
|
||||||
|
|
||||||
static TYPEDESCRIPTION m_SaveData[];
|
static TYPEDESCRIPTION m_SaveData[];
|
||||||
|
|
||||||
string_t m_iszMonsterClassname; // classname of the monster(s) that will be created.
|
string_t m_iszMonsterClassname; // classname of the monster(s) that will be created.
|
||||||
string_t m_iszWarpTarget; // name of the entity which's origin will be used to spawn monsters at.
|
string_t m_iszWarpTarget; // name of the entity which's origin will be used to spawn monsters at.
|
||||||
|
|
||||||
int m_cNumMonsters;// counter number of monsters this ent should create
|
int m_cNumMonsters;// counter number of monsters this ent should create
|
||||||
int m_cTotalMonstersCount; // number of monsters to create
|
int m_cTotalMonstersCount; // number of monsters to create
|
||||||
|
|
||||||
int m_iChildrenSpawnflags;
|
int m_iChildrenSpawnflags;
|
||||||
int m_cLiveChildren;// how many monsters made by this monster maker that are currently alive
|
int m_cLiveChildren;// how many monsters made by this monster maker that are currently alive
|
||||||
int m_iMaxLiveChildren;// max number of monsters that this maker may have out at one time.
|
int m_iMaxLiveChildren;// max number of monsters that this maker may have out at one time.
|
||||||
|
|
||||||
float m_flGround; // z coord of the ground under me, used to make sure no monsters are under the maker when it drops a new child
|
float m_flGround; // z coord of the ground under me, used to make sure no monsters are under the maker when it drops a new child
|
||||||
|
|
||||||
BOOL m_fActive;
|
BOOL m_fActive;
|
||||||
BOOL m_fFadeChildren;// should we make the children fadeout?
|
BOOL m_fFadeChildren;// should we make the children fadeout?
|
||||||
BOOL m_fIsWarpBall;
|
BOOL m_fIsWarpBall;
|
||||||
|
|
||||||
};
|
};
|
272
dlls/notepad.cpp
272
dlls/notepad.cpp
|
@ -1,136 +1,136 @@
|
||||||
#include "extdll.h"
|
#include "extdll.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "cbase.h"
|
#include "cbase.h"
|
||||||
#include "monsters.h"
|
#include "monsters.h"
|
||||||
#include "weapons.h"
|
#include "weapons.h"
|
||||||
#include "nodes.h"
|
#include "nodes.h"
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "items.h"
|
#include "items.h"
|
||||||
#include "gamerules.h"
|
#include "gamerules.h"
|
||||||
|
|
||||||
|
|
||||||
class CNotepad : public CBaseToggle
|
class CNotepad : public CBaseToggle
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void Spawn( );
|
void Spawn( );
|
||||||
void Precache( void );
|
void Precache( void );
|
||||||
void EXPORT Off(void);
|
void EXPORT Off(void);
|
||||||
void EXPORT Recharge(void);
|
void EXPORT Recharge(void);
|
||||||
void KeyValue( KeyValueData *pkvd );
|
void KeyValue( KeyValueData *pkvd );
|
||||||
void Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
|
void Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
|
||||||
virtual int ObjectCaps( void ) { return (CBaseToggle :: ObjectCaps() | FCAP_CONTINUOUS_USE) & ~FCAP_ACROSS_TRANSITION; }
|
virtual int ObjectCaps( void ) { return (CBaseToggle :: ObjectCaps() | FCAP_CONTINUOUS_USE) & ~FCAP_ACROSS_TRANSITION; }
|
||||||
virtual int Save( CSave &save );
|
virtual int Save( CSave &save );
|
||||||
virtual int Restore( CRestore &restore );
|
virtual int Restore( CRestore &restore );
|
||||||
|
|
||||||
char m_iszText[256];
|
char m_iszText[256];
|
||||||
int m_iTitle;
|
int m_iTitle;
|
||||||
|
|
||||||
static TYPEDESCRIPTION m_SaveData[];
|
static TYPEDESCRIPTION m_SaveData[];
|
||||||
|
|
||||||
float m_flNextCharge;
|
float m_flNextCharge;
|
||||||
int m_iReactivate ; // DeathMatch Delay until reactvated
|
int m_iReactivate ; // DeathMatch Delay until reactvated
|
||||||
int m_iJuice;
|
int m_iJuice;
|
||||||
int m_iOn; // 0 = off, 1 = startup, 2 = going
|
int m_iOn; // 0 = off, 1 = startup, 2 = going
|
||||||
float m_flSoundTime;
|
float m_flSoundTime;
|
||||||
};
|
};
|
||||||
|
|
||||||
TYPEDESCRIPTION CNotepad::m_SaveData[] =
|
TYPEDESCRIPTION CNotepad::m_SaveData[] =
|
||||||
{
|
{
|
||||||
DEFINE_FIELD( CNotepad, m_flNextCharge, FIELD_TIME),
|
DEFINE_FIELD( CNotepad, m_flNextCharge, FIELD_TIME),
|
||||||
DEFINE_FIELD( CNotepad, m_iReactivate, FIELD_INTEGER),
|
DEFINE_FIELD( CNotepad, m_iReactivate, FIELD_INTEGER),
|
||||||
DEFINE_FIELD( CNotepad, m_iJuice, FIELD_INTEGER),
|
DEFINE_FIELD( CNotepad, m_iJuice, FIELD_INTEGER),
|
||||||
DEFINE_FIELD( CNotepad, m_iOn, FIELD_INTEGER),
|
DEFINE_FIELD( CNotepad, m_iOn, FIELD_INTEGER),
|
||||||
DEFINE_FIELD( CNotepad, m_flSoundTime, FIELD_TIME),
|
DEFINE_FIELD( CNotepad, m_flSoundTime, FIELD_TIME),
|
||||||
};
|
};
|
||||||
|
|
||||||
IMPLEMENT_SAVERESTORE( CNotepad, CBaseEntity );
|
IMPLEMENT_SAVERESTORE( CNotepad, CBaseEntity );
|
||||||
|
|
||||||
LINK_ENTITY_TO_CLASS(func_notepad, CNotepad);
|
LINK_ENTITY_TO_CLASS(func_notepad, CNotepad);
|
||||||
|
|
||||||
extern int gmsgNotepad;
|
extern int gmsgNotepad;
|
||||||
extern int gmsgSparePlayer;
|
extern int gmsgSparePlayer;
|
||||||
|
|
||||||
void CNotepad::KeyValue( KeyValueData *pkvd )
|
void CNotepad::KeyValue( KeyValueData *pkvd )
|
||||||
{
|
{
|
||||||
if (FStrEq(pkvd->szKeyName, "dmdelay"))
|
if (FStrEq(pkvd->szKeyName, "dmdelay"))
|
||||||
{
|
{
|
||||||
m_iReactivate = atoi(pkvd->szValue);
|
m_iReactivate = atoi(pkvd->szValue);
|
||||||
pkvd->fHandled = TRUE;
|
pkvd->fHandled = TRUE;
|
||||||
}
|
}
|
||||||
else if (FStrEq(pkvd->szKeyName, "title"))
|
else if (FStrEq(pkvd->szKeyName, "title"))
|
||||||
{
|
{
|
||||||
m_iTitle = atoi(pkvd->szValue);
|
m_iTitle = atoi(pkvd->szValue);
|
||||||
pkvd->fHandled = TRUE;
|
pkvd->fHandled = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
CBaseToggle::KeyValue( pkvd );
|
CBaseToggle::KeyValue( pkvd );
|
||||||
|
|
||||||
FStrEq(pkvd->szKeyName, "text");
|
FStrEq(pkvd->szKeyName, "text");
|
||||||
sprintf(m_iszText, "%s", pkvd->szValue);
|
sprintf(m_iszText, "%s", pkvd->szValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CNotepad::Spawn()
|
void CNotepad::Spawn()
|
||||||
{
|
{
|
||||||
Precache( );
|
Precache( );
|
||||||
|
|
||||||
pev->solid = SOLID_BSP;
|
pev->solid = SOLID_BSP;
|
||||||
pev->movetype = MOVETYPE_PUSH;
|
pev->movetype = MOVETYPE_PUSH;
|
||||||
|
|
||||||
UTIL_SetOrigin(pev, pev->origin); // set size and link into world
|
UTIL_SetOrigin(pev, pev->origin); // set size and link into world
|
||||||
UTIL_SetSize(pev, pev->mins, pev->maxs);
|
UTIL_SetSize(pev, pev->mins, pev->maxs);
|
||||||
SET_MODEL(ENT(pev), STRING(pev->model) );
|
SET_MODEL(ENT(pev), STRING(pev->model) );
|
||||||
m_iJuice = gSkillData.healthchargerCapacity;
|
m_iJuice = gSkillData.healthchargerCapacity;
|
||||||
pev->frame = 0;
|
pev->frame = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CNotepad::Precache()
|
void CNotepad::Precache()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CNotepad::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
|
void CNotepad::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
|
||||||
{
|
{
|
||||||
// Make sure that we have a caller
|
// Make sure that we have a caller
|
||||||
if (!pActivator)
|
if (!pActivator)
|
||||||
return;
|
return;
|
||||||
// if it's not a player, ignore
|
// if it's not a player, ignore
|
||||||
if ( !pActivator->IsPlayer() )
|
if ( !pActivator->IsPlayer() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
pev->nextthink = pev->ltime + 0.25;
|
pev->nextthink = pev->ltime + 0.25;
|
||||||
SetThink(&CNotepad::Off);
|
SetThink(&CNotepad::Off);
|
||||||
|
|
||||||
// Time to recharge yet?
|
// Time to recharge yet?
|
||||||
|
|
||||||
if (m_flNextCharge >= gpGlobals->time)
|
if (m_flNextCharge >= gpGlobals->time)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MESSAGE_BEGIN( MSG_ONE, gmsgNotepad, NULL, GetClassPtr((CBasePlayer *)pActivator->pev)->pev );
|
MESSAGE_BEGIN( MSG_ONE, gmsgNotepad, NULL, GetClassPtr((CBasePlayer *)pActivator->pev)->pev );
|
||||||
WRITE_STRING( m_iszText );
|
WRITE_STRING( m_iszText );
|
||||||
WRITE_BYTE( m_iTitle );
|
WRITE_BYTE( m_iTitle );
|
||||||
MESSAGE_END();
|
MESSAGE_END();
|
||||||
|
|
||||||
// govern the rate of charge
|
// govern the rate of charge
|
||||||
m_flNextCharge = gpGlobals->time + 0.1;
|
m_flNextCharge = gpGlobals->time + 0.1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CNotepad::Recharge(void)
|
void CNotepad::Recharge(void)
|
||||||
{
|
{
|
||||||
pev->frame = 0;
|
pev->frame = 0;
|
||||||
SetThink( &CNotepad::SUB_DoNothing );
|
SetThink( &CNotepad::SUB_DoNothing );
|
||||||
}
|
}
|
||||||
|
|
||||||
void CNotepad::Off(void)
|
void CNotepad::Off(void)
|
||||||
{
|
{
|
||||||
m_iOn = 0;
|
m_iOn = 0;
|
||||||
|
|
||||||
if ((!m_iJuice) && ( ( m_iReactivate = g_pGameRules->FlHealthChargerRechargeTime() ) > 0) )
|
if ((!m_iJuice) && ( ( m_iReactivate = g_pGameRules->FlHealthChargerRechargeTime() ) > 0) )
|
||||||
{
|
{
|
||||||
pev->nextthink = pev->ltime + m_iReactivate;
|
pev->nextthink = pev->ltime + m_iReactivate;
|
||||||
SetThink(&CNotepad::Recharge);
|
SetThink(&CNotepad::Recharge);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
SetThink( &CNotepad::SUB_DoNothing );
|
SetThink( &CNotepad::SUB_DoNothing );
|
||||||
}
|
}
|
||||||
|
|
2816
dlls/priest.cpp
2816
dlls/priest.cpp
File diff suppressed because it is too large
Load Diff
1054
dlls/spritetrain.cpp
1054
dlls/spritetrain.cpp
File diff suppressed because it is too large
Load Diff
|
@ -1,21 +1,21 @@
|
||||||
class CTriggerKicker : public CBaseDelay
|
class CTriggerKicker : public CBaseDelay
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void Spawn( void );
|
void Spawn( void );
|
||||||
void Think( void );
|
void Think( void );
|
||||||
void KickPlayer( CBasePlayer *pKickMe );
|
void KickPlayer( CBasePlayer *pKickMe );
|
||||||
|
|
||||||
int ObjectCaps( void ) { return CBaseDelay::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
|
int ObjectCaps( void ) { return CBaseDelay::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
|
||||||
private:
|
private:
|
||||||
CBasePlayer *pPlayerToKick;
|
CBasePlayer *pPlayerToKick;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CTriggerLockedMission : public CBaseDelay
|
class CTriggerLockedMission : public CBaseDelay
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void Spawn( void );
|
void Spawn( void );
|
||||||
void Think( void );
|
void Think( void );
|
||||||
void Lock( void );
|
void Lock( void );
|
||||||
|
|
||||||
int ObjectCaps( void ) { return CBaseDelay::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
|
int ObjectCaps( void ) { return CBaseDelay::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
|
||||||
};
|
};
|
1538
dlls/vorti.cpp
1538
dlls/vorti.cpp
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue