Old tap detect restore, misc cleanup

This commit is contained in:
Christopher Dawalt 2021-08-03 06:37:40 -04:00
parent d4279ed983
commit 45b8c241b3
45 changed files with 835 additions and 921 deletions

View File

@ -89,17 +89,15 @@ ClientGame_ConsoleCommand(void)
}
break;
case "buy":
//if(getstatf(STAT_BUYZONE) == TRUE) {
// VGUI_BuyMenu();
//}
//If we're in spectator mode we can do this
// no-screen check, not necessary probably: pSeatLocal->fVGUI_Display == VGUI_SCREEN::NONE &&
pl = (player)pSeat->m_ePlayer;
printfline("CMD: BUY COMMAND RECEIVED! Should I react? %s (1=yes) : %d", getplayerkeyvalue( player_localnum, "*spec" ), pl.iState);
if(getplayerkeyvalue( player_localnum, "*spec" ) != "0"){
// Should this use a "pl.iState != PLAYER_STATE::SPAWNED" check instead?
//if(getplayerkeyvalue( player_localnum, "*spec" ) != "0"){
if(pl.iState != PLAYER_STATE::SPAWNED){
//we can show it!
VGUI_ChangeScreen(VGUI_SCREEN::BUYSIDEMENU);
}
@ -112,7 +110,6 @@ ClientGame_ConsoleCommand(void)
//TAGGG - CRITICAL
// See CSEv_DropWeapon of src/server/weapons.qc, tie into that better
// somehow, may need to rely on Nuclide's own pickup type instead of our own.
case "drop":
//sendevent("WeaponDrop", "");
TS_playerDropWeapon(); //I do it fine.

View File

@ -18,17 +18,18 @@ void
ClientGame_EventParse(float fHeader)
{
player pl = (player)pSeat->m_ePlayer;
vector vecOrigin;
int iSequence;
float fDuration;
float fIdleEndOffset;
int iType;
switch (fHeader) {
// !
// Any need for a m_ePlayer classname check here?
// I think none apply for being an authentic "spectator", most don't for being a buymenu spectator
// (player with that is not PLAYER_STATE::SPAWNED)
switch(fHeader){
case EV_OBITUARY:
Obituary_Parse();
break;
@ -102,8 +103,6 @@ ClientGame_EventParse(float fHeader)
FX_Impact(iType, vOrigin, vNormal);
break;
//TAGGG - NEW
case EVENT_TS::EV_IMPACT_MELEE:
int iType3;
vector vOrigin3;
@ -143,7 +142,7 @@ ClientGame_EventParse(float fHeader)
case EV_WEAPON_PICKUP:
int w = readbyte();
//TAGGG - NOTE!
// NOTE!
// Phase me out, or use me instead. Whichever.
// Redundant with... oh? Nothing here clearly by name.
// Ah well, somewhere there's completly TS independent pickup logic
@ -162,6 +161,9 @@ ClientGame_EventParse(float fHeader)
// time to read the config to send in the weapons one-by-one.
deployConfig();
// Just in case.
VGUI_ChangeScreen(VGUI_SCREEN::NONE);
// so that any choice of weapon, same as before or even nothing, will still
// let client/view.qc do the whole viewmodel routine again
pSeat->m_iLastWeapon = -2;
@ -205,7 +207,5 @@ ClientGame_EventParse(float fHeader)
break;
*/
}
}

View File

@ -67,32 +67,32 @@ HUD_Draw(void)
Obituary_Draw();
Textmenu_Draw();
//TAGGG - NEw
//////////////////////////////////////////////////////////////
//TAGGG - NEw
//////////////////////////////////////////////////////////////
//View_HandleZoom();
//printfline("SCOPE LEVEL %.2f", pl.flZoomLevel);
if(pl.flZoomLevel < 0.5){ //is this < 40? yes.
HUD_DrawScope();
}else{
// We'll leave details like extra details for the lasersight and the weight bars at a bare minimum
// (should be drawn at all times, oversight in TS 2.1 that they're missing from melee views
// like with knives, katana, corrected in 3.0 of all things)
// We'll leave details like extra details for the lasersight and the weight bars at a
// bare minimum (should be drawn at all times, oversight in TS 2.1 that they're missing
// from melee views like with knives, katana, corrected in 3.0 of all things)
HUD_DrawCrosshair();
}
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
GameClient_PlayerInputRaw();
//TAGGG - NEw
//////////////////////////////////////////////////////////////
//TAGGG - NEw
//////////////////////////////////////////////////////////////
drawTimer();
drawPlayerStats();
//TAGGG - CRITICAL. Nope, Weapons_DrawCrosshair actually calls a weapon's custom HUD drawing method.
// Odd name, but yes, it's not actually focused on just crosshairs. TS uses the more generic
// "HUD_DrawCrosshair" call above.
//TAGGG - CRITICAL. Nope, Weapons_DrawCrosshair actually calls a weapon's custom HUD drawing
// method. Odd name, but yes, it's not actually focused on just crosshairs. TS uses the more
// generic "HUD_DrawCrosshair" call above.
//drawPlayerCurrentWeaponStats();
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
// TEST! Just for nuclide, doesn't matter what m_iHUDWeaponSelected is exactly,
@ -110,8 +110,6 @@ HUD_Draw(void)
//Damage_Draw();
//ClientGame_DamageDraw();
}else{
// Fake spectator, or the temporary forced third-person on death (not yet implemented).
@ -121,9 +119,15 @@ HUD_Draw(void)
// Changing the FOV isn't necessary, that already comes with the spec/player change, some
// things are nicely defaulted for us in FTE.
setsensitivityscaler(1.0f);
GameClient_SpectatorInputRaw();
pSeat->m_iHUDWeaponSelected = 0;
// is this necessary? With or without the if-then too.
/*
if(g_vguiWidgetCount > 0){
GameClient_SpectatorInputRaw();
}
*/
drawTimer();

View File

@ -29,9 +29,8 @@ HUD_DrawCrosshair
Draws the cursor every frame, unless spectator
=================
*/
void HUD_DrawCrosshair(void) {
void
HUD_DrawCrosshair(void){
player pl = (player)pSeat->m_ePlayer;
@ -146,9 +145,9 @@ void HUD_DrawCrosshair(void) {
thirdBelongingTo = 2;
}
// we COULD make this a property (ts/main.c) to be set by the client and read by the server,
// but this might be really inefficient. May as well use the v_angle already available serverside to determine
// what third we're looking at.
// we could make this a property (ts/src/server/init.qc) to be set by the client and read
// by the server, but this might be really inefficient. May as well use the v_angle
// already available serverside to determine what third we're looking at.
// top = 90 degrees for safePlayerViewPitch of -31.
// bottom = 270 degrees for safePlayerViewPitch of 30.
@ -213,7 +212,7 @@ void HUD_DrawCrosshair(void) {
drawfill( [vCenter[0] - 1, vCenter[1] + (crosshairDist - 5)], [2, 5], clrPaleBlue, 0.70f, DRAWFLAG_NORMAL );
}//END OF ranged weapon check
}// ranged weapon check
if(hasLasersight){
@ -266,9 +265,9 @@ void HUD_DrawCrosshair(void) {
drawSpriteNumber(ary_LCD_numberSet, vDistNumberLoc.x, vDistNumberLoc.y, pl.recentLaserDistanceDisplay, 3, BITS_DIGITOPT_NONE, clrPaleBlue, 0.91f);
}
}
}//END OF flat drawLaserDots check
}// flat drawLaserDots check
}//END OF lasersight check
}// lasersight check
}//END OF HUD_DrawCrosshair
}// HUD_DrawCrosshair

View File

@ -109,7 +109,7 @@ HUD_DrawWeaponSelect_Trigger(void)
return;
}
player pl = (player)pSeat->m_ePlayer;
//TAGGG - TODO - was commented out in old FreeTS, doing so here too.
// TODO - was commented out in old FreeTS, doing so here too.
// But figure out what it needs to do, this likely wasn't pointless
/*
player pl = (player)pSeat->m_ePlayer;
@ -131,7 +131,7 @@ HUD_DrawWeaponSelect_Trigger(void)
player pl = (player)pSeat->m_ePlayer;
if(pSeat->m_flInputBlockTime > time){
return;
}
}
*/
TS_HUD_DrawWeaponSelect_CheckClick();
@ -148,7 +148,7 @@ HUD_DrawWeaponSelect_Last(void)
player pl = (player)pSeat->m_ePlayer;
//TAGGG - TODO. Support this.
// TODO. Support this.
/*
player pl = (player)pSeat->m_ePlayer;
if (pl.g_items & g_weapons[pSeat->m_iOldWeapon].id) {
@ -262,7 +262,7 @@ TS_HUD_DrawWeaponSelect_PreviousItem(
//printfline("TS_HUD_DrawWeaponSelect_PreviousItem: weaponID_toStartFrom:%i pl.ary_myWeapons_softMax:%i", weaponID_toStartFrom, pl.ary_myWeapons_softMax);
//TAGGG CRITICAL - why wasn't this ">=" and just ">" ???
// CRITICAL - why wasn't this ">=" and just ">" ???
if(weaponID_toStartFrom >= pl.ary_myWeapons_softMax){
//shouldn't be possible but just in case.
canAcceptSame = TRUE;
@ -689,7 +689,6 @@ TS_HUD_CloseWeaponSelect(BOOL playOffSound)
}
//pSeat->fHUDWeaponSelected = 0; //no harm but no need now
//TAGGG - only makes sense.
pl.weaponSelectHighlightID = -1;
pl.weaponSelectHighlightAkimbo = FALSE;

View File

@ -1,6 +1,20 @@
// NEW FILE.
// RECENT: This file is pending deletion, if the "GamePlayerSpawn" message call in
// ts/src/shared/input.qc is good enough.
// That would mean GameClient_SpectatorInputRaw, nor any pSeatLocal vars only it uses,
// would no longer be necessary.
// Just want to be sure first with some more tests, no getting locked out of spawning.
// GameClient_PlayerInputRaw is tiny and hud.qc can do what it does instead.
// The "DISABLED" area further down is worth seeing if supporting right click to close
// an open weapon select immediately without applying any selection is a good idea though.
// -----------------------------
// WARNING: Do not get this file mixed up with <game>/src/shared/input.qc, that one is
// only called when the player is spawned (collision, seen by others, etc.).
// This is for checking to see if the user performed some action that does not need
@ -101,12 +115,15 @@ GameClient_SpectatorInputRaw(void)
}
///////////////////////////////////////////////////////
player pl = (player)pSeat->m_ePlayer;
// primary fire?
if(!pSeatLocal->m_bNeedPrimaryRelease && (input_buttons & INPUT_BUTTON0) ){
if(
pSeatLocal->fVGUI_Display == VGUI_SCREEN::NONE &&
getplayerkeyvalue(player_localnum, "*spec") != "0"
//getplayerkeyvalue(player_localnum, "*spec") != "0"
pl.iState != PLAYER_STATE::SPAWNED
){
// && getstati(STAT_RULE_ALLOW_SPAWN))
// just send the intention we want to spawn, the server will see if a delay is needed.
@ -142,13 +159,12 @@ GameClient_PlayerInputRaw(void)
player pl = (player)pSeat->m_ePlayer;
// weapon select extra.
if(pl == NULL){
// ???
return;
}
// This was removed? Legacy VGUI
// If we are inside a VGUI, don't let the client do stuff outside
if ((pSeatLocal->fVGUI_Display != VGUI_SCREEN::NONE)) {
if (pl.iState != PLAYER_STATE::SPAWNED && pSeatLocal->fVGUI_Display != VGUI_SCREEN::NONE){
pSeat->m_flInputBlockTime = time + 0.2;
}

View File

@ -270,7 +270,7 @@ Player_PreDraw(base_player pp, int thirdperson)
posView = pSeat->m_vecPredictedOrigin + [0,0,-8];
angView = view_angles;
// CHECK: is "getproperty(VF_CL_VIEWANGLES)" always the same as "viewangles"?
// CHECK: is "getproperty(VF_CL_VIEWANGLES)" always the same as "view_angles"?
if(!pl.weaponEquippedAkimbo){
// first-person and this is the local player?

View File

@ -40,11 +40,6 @@ struct
float m_inputKeyDown;
float m_inputMouseClicked;
// like pSeat->ePlayer, but already casted to the gamemod's custom "player" class.
// WARNING: Not yet set, find some place around the start of each frame where it
// makes sense to set this.
// Nevermind, do-able but likely won't be used much. Do m_clientinfo instead
//player m_ePlayerRef;
ClientInfo_t m_clientinfo;
} g_seatslocal[4], *pSeatLocal;

View File

@ -50,6 +50,7 @@ VGUI_ChangeScreen(VGUI_SCREEN arg_NewScreenID)
// And turn the cursor lock off.
setcursormode(FALSE, "gfx/cursor", [0,0,0], 1.0f);
// And don't let Nuclide's src/client/entry.qc try to re-lock the mouse!
printfline("TURN SCREEN OFF.");
gFun_UI_EventGrabber_Hide();
return;
}
@ -65,6 +66,7 @@ VGUI_ChangeScreen(VGUI_SCREEN arg_NewScreenID)
// And let the event grabber be shown so that entry.qc doesn't try to undo the mouse lock.
gFun_UI_EventGrabber_Show();
printfline("TURN SCREEN ON?? WHy. %d", arg_NewScreenID);
if(vguiMenus[arg_NewScreenID - 1].vOnInit != NULL){
vguiMenus[arg_NewScreenID - 1].vOnInit();
}

View File

@ -58,7 +58,7 @@ class CBuySideMenu_WeaponButton;
class CBuySideMenu_WeaponButton;
class CBuySideMenu_RemoveWeaponButton;
void buysidemenu_closeBuyMenu(void);
void buysidemenu_cancelConfigAndClose(void);
void refreshButtons(void);
void setupRemoveButtonList(void);
void buysidemenu_btn_removeButton_clicked(CBuySideMenu_BasicButton* arg_this);
@ -808,7 +808,7 @@ buysidemenu_btn_Back_clicked(CBuySideMenu_BasicButton* arg_this)
if(iActiveLayer == 0i){
// This is a request to close the buy menu.
// TODO. Support that.
buysidemenu_closeBuyMenu();
buysidemenu_cancelConfigAndClose();
}else{
buysidemenu_backOneLayer();
}
@ -982,7 +982,7 @@ refreshButtons(void)
// NOTICE - assumes "Cancel" was clicked. Reverts "temp" config to the "current"
// config (one last saved / applied).
void
buysidemenu_closeBuyMenu(void)
buysidemenu_cancelConfigAndClose(void)
{
//other way around. Copy what's at the current to the temp (forgetting any purchase changes).
@ -997,9 +997,8 @@ buysidemenu_closeBuyMenu(void)
CSQC_Parse_CenterPrint("Buy Order Canceled.\n");
}
//that should close the buy menu. Proceed.
pSeatLocal->fVGUI_Display = VGUI_SCREEN::NONE;
}//buysidemenu_closeBuyMenu
VGUI_ChangeScreen(VGUI_SCREEN::NONE);
}//buysidemenu_cancelConfigAndClose
// This is the "1 Use New Config" choice in the 1st layer. Applies the config (copies weaponconfig_temp to weapconfig_current).
// the "_current" one is read at spawn to give the player their loadout.
@ -1017,10 +1016,7 @@ buysidemenu_btn_UseNewConfig_clicked(CBuySideMenu_BasicButton* arg_this)
// TODO - check to see whether the config we just used was empty or not, to affect this message...
CSQC_Parse_CenterPrint("Using new config.\n");
//we will close the buy menu.
//TODO - do a centerprint saying, "using new config" or whatever the specialists did.
pSeatLocal->fVGUI_Display = VGUI_SCREEN::NONE;
VGUI_ChangeScreen(VGUI_SCREEN::NONE);
}//buysidemenu_btn_UseNewConfig_clicked

View File

@ -62,9 +62,7 @@ Colors_RGB8_to_HEX(vector color)
void VGUI_MessageOfTheDay(player arg_player, vector vPos, vector vWindowSiz, float fFontSizeMulti ) {
static void MessageOfTheDay_ButtonOK( void ) {
//pSeatLocal->fVGUI_Display = VGUI_SCREEN::BUYSIDEMENU;
static void MessageOfTheDay_ButtonOK( void ) {
printfline("HEY ButtonOK got CLICKED!!!");
VGUI_ChangeScreen(VGUI_SCREEN::BUYSIDEMENU);
}

View File

@ -172,8 +172,11 @@ View_UpdateWeapon(entity vm, entity mflash)
// Call this to do a few other things for any weapon change
TS_Weapon_Draw_extra();
/* hack, we changed the wep, move this into Game_Input/PMove */
Weapons_Draw();
// hack, we changed the wep, move this into Game_Input/PMove
//... And yes, it seems this bound check is indeed needed, zany sync issues.
if(pl.inventoryEquippedIndex != -1){
Weapons_Draw();
}
//No longer a var! Oops
//pSeat->m_iVMEjectBone = pSeat->m_iVMBones + 1;
@ -217,10 +220,6 @@ resetViewModel(void)
printfline("resetViewModel: early end #1, client ent NULL");
return;
}
if(pSeat->m_ePlayer.classname != "player"){
printfline("resetViewModel: early end #2, client ent not player");
return;
}
//was m_eViewModel and m_eMuzzleflash

View File

@ -163,9 +163,9 @@ BOOLEAN TSAmmoPack::copyTo(player arg_player){
if(anyAmmoTaken){
sound(arg_player, CHAN_ITEM, "items/9mmclip1.wav", 1, ATTN_NORM, 100, SOUNDFLAG_CUSTOMCLIENT );
sound(arg_player, CHAN_ITEM, "items/9mmclip1.wav", 1, ATTN_NORM, 100, SOUNDFLAG_PLAYER_COMMON );
}else{
//sound( arg_player, CHAN_ITEM, "common/wpn_select.wav", 1, ATTN_NORM, 100, SOUNDFLAG_CUSTOMCLIENT );
//sound( arg_player, CHAN_ITEM, "common/wpn_select.wav", 1, ATTN_NORM, 100, SOUNDFLAG_PLAYER_COMMON );
}
return anyAmmoTaken;
@ -180,7 +180,7 @@ void TSAmmoPack::Touch( void ) {
//printfline("the thing I touched is %s", other.classname);
// TODO - any others we need to keep track of for making the drop?
if(other.classname == "worldspawn" || other.classname == "func_breakable"){
sound( this, CHAN_ITEM, "items/weapondrop1.wav", 1, ATTN_NORM, 100, SOUNDFLAG_CUSTOMCLIENT );
sound( this, CHAN_ITEM, "items/weapondrop1.wav", 1, ATTN_NORM, 100, SOUNDFLAG_PLAYER_COMMON );
}
return;

View File

@ -188,7 +188,7 @@ void TSWorldGun::Touch( void ) {
//printfline("the thing I touched is %s", other.classname);
// TODO - any others we need to keep track of for making the drop?
if(other.classname == "worldspawn" || other.classname == "func_breakable"){
sound( this, CHAN_ITEM, "items/weapondrop1.wav", 1, ATTN_NORM, 100, SOUNDFLAG_CUSTOMCLIENT );
sound( this, CHAN_ITEM, "items/weapondrop1.wav", 1, ATTN_NORM, 100, SOUNDFLAG_FOLLOW );
}
return;

View File

@ -4,7 +4,7 @@
class ts_powerup;
#ifdef CSQC
#ifdef CLIENT
// static method... essentially at least.
void Powerup_Parse(void);
#endif

View File

@ -21,7 +21,7 @@ enum pwuptype_choice{
#ifdef SSQC
#ifdef SERVER
class ts_powerup:CBaseEntity{
@ -272,7 +272,7 @@ void ts_powerup::Touch(void){
// adding to the player if they already have a usable powerup equipped (stored for use).
// Any other time, this powerup always gets deleted & makes the gunpickup noise in original TS behavior.
// Deviate however, or not.
sound( other, CHAN_ITEM, "items/gunpickup2.wav", 1, ATTN_NORM, 100, SOUNDFLAG_CUSTOMCLIENT );
sound( other, CHAN_ITEM, "items/gunpickup2.wav", 1, ATTN_NORM, 100, SOUNDFLAG_PLAYER_COMMON );
//remove(self);
@ -445,7 +445,7 @@ void ts_powerup::declareDisposable(void){
#endif
#ifdef CSQC
#ifdef CLIENT
class ts_powerup:CBaseEntity{

View File

@ -1018,9 +1018,7 @@ TSMultiplayerRules::PlayerMakeSpectator(base_player pp)
// Already in fake spectator! Stop.
return;
}
//if(pl.classname != "spectator" && pl.modelindex != 0){
if(pl.modelindex != 0){
// assume this is necessary
MakePlayerInvisible(pl);
@ -1060,13 +1058,11 @@ TSMultiplayerRules::PlayerMakeSpectatorDelayed(base_player pp)
{
// Nevermind, this has no significance anymore with the client entity change no longer
// happening. Redirect to the normal version
player pl = (player)pp;
PlayerMakeSpectator(pp);
/*
player pl = (player)pp;
if(pl.classname != "spectator" && pl.modelindex != 0){
// assume this is necessary
MakePlayerInvisible(pl);
@ -1121,7 +1117,6 @@ TSMultiplayerRules::PlayerSpawn(base_player pp)
//pl.team = TEAM_SPECTATOR;
// immediately put us into spectating mode
// (iState forced to a wrong value to stop MakeSpectator from being skipped)
pl.iState = PLAYER_STATE::SPAWNED;
@ -1162,6 +1157,11 @@ CSEv_GamePlayerSpawn(void)
TSMultiplayerRules rules = (TSMultiplayerRules)g_grMode;
player pl = (player)self;
if(pl.iState == PLAYER_STATE::SPAWNED){
// what.
return;
}
//self.dmg_take = 0;
//self.dmg_inflictor = NULL; //good idea?
@ -1177,4 +1177,3 @@ CSEv_GamePlayerSpawn(void)
rules.setPlayerMoneyDefault(pl);
}

View File

@ -15,16 +15,16 @@
*/
/* PICKUP ITEMS */
// Bare minimum to compile with what Nuclide's src/server/weapons.qc expects.
// TS already has its own weapons-pickup class: TSWorldGun.
// Although that could fill in Nuclide's expected item_pickup and let anything in-map
// redirect to this if that were preferred.
class item_pickup:CBaseTrigger
{
int m_bFloating;
int m_iClip;
int m_iWasDropped;
int id;
void(void) item_pickup;
virtual void(void) touch;
virtual void(int i) SetItem;
virtual void(void) Respawn;
virtual void(int) SetFloating;
};

View File

@ -13,76 +13,8 @@
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
void item_pickup::touch(void)
{
if (other.classname != "player") {
return;
}
/* don't remove if AddItem fails */
if (Weapons_AddItem((player)other, id, m_iClip) == FALSE) {
return;
}
Logging_Pickup(other, this, __NULL__);
Sound_Play(other, CHAN_ITEM, "weapon.pickup");
UseTargets(other, TRIG_TOGGLE, m_flDelay);
if (real_owner || m_iWasDropped == 1 || cvar("sv_playerslots") == 1) {
remove(self);
} else {
Hide();
think = Respawn;
nextthink = time + 30.0f;
}
}
void item_pickup::SetItem(int i)
{
id = i;
m_oldModel = Weapons_GetWorldmodel(id);
SetModel(m_oldModel);
SetSize([-16,-16,0], [16,16,16]);
}
void item_pickup::SetFloating(int i)
{
m_bFloating = rint(bound(0, m_bFloating, 1));
}
void item_pickup::Respawn(void)
{
SetSolid(SOLID_TRIGGER);
SetOrigin(m_oldOrigin);
/* At some points, the item id might not yet be set */
if (m_oldModel) {
SetModel(m_oldModel);
}
SetSize([-16,-16,0], [16,16,16]);
think = __NULL__;
nextthink = -1;
if (!m_iWasDropped && cvar("sv_playerslots") > 1) {
if (!real_owner && time > 30.0f)
Sound_Play(this, CHAN_ITEM, "item.respawn");
m_iClip = -1;
}
if (!m_bFloating) {
droptofloor();
SetMovetype(MOVETYPE_TOSS);
}
}
void item_pickup::item_pickup(void)
{
Sound_Precache("item.respawn");
Sound_Precache("weapon.pickup");
CBaseTrigger::CBaseTrigger();
}
// DUMMIED
}

View File

@ -15,7 +15,7 @@ enum TS_Team{
TEAM_4 = 3
};
#ifdef SSQC
#ifdef SERVER
//server CVar
var float autocvar_weaponstay = 60; //default originally 15
#endif
@ -37,20 +37,6 @@ enum TS_Team{
#endif
// OLD WAY! Blah, forgot about this, just use the new names above.
// Pretty simple way to handle the server not having the "NOSPACIALISE" flag.
// Sounds that depend on being played very neatly clientside really just need to...
// be played clientside though (send an event from the server to play it there).
// Really SOUNDFLAG_CUSTOMCLIENT -> SOUNDFLAG_PLAYER_COMMON .
#ifdef CSQC
#define SOUNDFLAG_CUSTOMCLIENT SOUNDFLAG_FOLLOW | SOUNDFLAG_NOSPACIALISE
#else
#define SOUNDFLAG_CUSTOMCLIENT SOUNDFLAG_FOLLOW
#endif
// ???
//#pragma target FTE
//#pragma flag enable lo //enable short-circuiting

View File

@ -1,6 +1,6 @@
#ifdef SSQC
#ifdef SERVER
void Effect_Explosion(vector vecOrigin );
#else
void EV_Effect_Explosion(vector vecOrigin );
@ -8,7 +8,7 @@ void EV_Effect_Explosion(vector vecOrigin );
#ifdef SSQC
#ifdef SERVER
//TAGGG - Thank you The Wastes!
void Effect_ScreenShake(vector vecOrigin, float fRadius, float fStrength );
#else

View File

@ -7,7 +7,7 @@
// No clue, these effects are due for a complete overhaul to better resemble
// TS sometime anyway.
#ifdef SSQC
#ifdef SERVER
void Effect_Explosion(vector vecOrigin )
{
//the specialists explosion does not do this, strangely enough.
@ -31,7 +31,7 @@ void EV_Effect_Explosion(vector vecOrigin ){
#ifdef SSQC
#ifdef SERVER
//TAGGG - Thank you The Wastes!
void Effect_ScreenShake(vector vecOrigin, float fRadius, float fStrength )
{
@ -75,7 +75,7 @@ Effect_CreateExplosion(vector vPos)
#ifdef TS
#ifdef SSQC
#ifdef SERVER
Effect_ScreenShake( vPos, 2048, 255 );
Effect_Explosion( vPos + [0,0,16] );
#else

View File

@ -1,51 +1,48 @@
BOOL TS_Weapon_PrimaryAttackRelease(player localPlayer, BOOL hasAmmo);
BOOL TS_Weapon_SecondaryAttackRelease(player localPlayer, BOOL hasAmmo);
BOOL TS_Weapon_PrimaryAttackRelease(player pl, BOOL hasAmmo);
BOOL TS_Weapon_SecondaryAttackRelease(player pl, BOOL hasAmmo);
void TS_Weapon_Draw_extra(void);
void TS_playerEquippedWeapon_Shared(player pl, int newWeaponEquipped, BOOL useAkimbo);
#ifdef CLIENT
void _TS_playerEquippedWeapon(player pl, int newWeaponEquipped, BOOL useAkimbo);
void TS_playerEquippedWeapon_Shared(player localPlayer, int newWeaponEquipped, BOOL useAkimbo);
#ifdef CSQC
void _TS_playerEquippedWeapon(player localPlayer, int newWeaponEquipped, BOOL useAkimbo);
void TS_playerEquippedWeapon(player localPlayer, int newWeaponEquipped, BOOL useAkimbo);
void TS_playerEquippedWeapon(player pl, int newWeaponEquipped, BOOL useAkimbo);
#endif
#ifdef SSQC
void _TS_playerEquippedWeapon(player localPlayer, int newWeaponEquipped, BOOL useAkimbo);
#ifdef SERVER
void _TS_playerEquippedWeapon(player pl, int newWeaponEquipped, BOOL useAkimbo);
void TS_playerEquippedWeapon(player localPlayer, int newWeaponEquipped, BOOL useAkimbo);
void TS_playerEquippedWeapon(player pl, int newWeaponEquipped, BOOL useAkimbo);
void CSEv_TS_playerEquippedWeapon_ii(int newWeaponEquipped, BOOL useAkimbo);
#endif
#ifdef SSQC
void TS_PlayInsertShellSound(player localPlayer);
#ifdef SERVER
void TS_PlayInsertShellSound(player pl);
#else
void TS_PlayInsertShellSound(player localPlayer);
void EV_TS_PlayInsertShellSound(player localPlayer);
void TS_PlayInsertShellSound(player pl);
void EV_TS_PlayInsertShellSound(player pl);
#endif
#ifdef SSQC
void TS_resetViewModel(player localPlayer);
#ifdef SERVER
void TS_resetViewModel(player pl);
#else
void TS_resetViewModel(player localPlayer);
void TS_resetViewModel(player pl);
void EV_TS_resetViewModel(void);
#endif
#ifdef SSQC
void TS_resetPlayer(player localPlayer, BOOL resetInventory)
#ifdef SERVER
void TS_resetPlayer(player pl, BOOL resetInventory)
#else
void EV_TS_resetPlayer(player localPlayer, BOOL resetInventory)
void EV_TS_resetPlayer(player pl, BOOL resetInventory)
#endif
#ifdef CLIENT
@ -53,19 +50,19 @@ void EV_PlayerDeath(void)
#endif
#ifdef CSQC
#ifdef CLIENT
//NOTICE - clientside components removed, except for clientside being able
// to signal that the server should remove a weapon.
// This needs no clientside logic equivalent to be mirrored.
/*
void _TS_playerDropWeapon(player localPlayer);
void _TS_playerDropWeapon(player pl);
*/
void TS_playerDropWeapon(void);
/*
void EV_TS_playerDropWeapon(player localPlayer);
void EV_TS_playerDropWeapon(player pl);
*/
#endif
#ifdef SSQC
#ifdef SERVER
//that's it really serverside.
void _TS_playerDropWeapon(void);
void TS_playerDropWeapon(void);
@ -107,6 +104,6 @@ void TS_playerCallAlt2(void);
void _TS_playerCallAlt2(void);
void playerEquipIdeal(player localPlayer);
void playerEquipIdealSafe(player localPlayer);
void playerEquipIdeal(player pl);
void playerEquipIdealSafe(player pl);

View File

@ -1,16 +1,13 @@
BOOL
TS_Weapon_PrimaryAttackRelease(player localPlayer, BOOL hasAmmo){
TS_Weapon_PrimaryAttackRelease(player pl, BOOL hasAmmo){
// WARNING! This comment is really out of date, fWeaponEventPlayer is no longer a thing
// ------------------------------
// what are "fWeaponEventPlayer" and "player_localentnum"?
// we need to figure this shizz out
// "fWeaponEventPlayer" is in "ts/client/defs.h". its assigned a lot in "ts/client/event.c".
// at least "player_localentnum" is part of the builtins.
player pl = localPlayer;
if(pl.inventoryEquippedIndex == -1){
return FALSE;
}
@ -23,9 +20,7 @@ TS_Weapon_PrimaryAttackRelease(player localPlayer, BOOL hasAmmo){
BOOL
TS_Weapon_SecondaryAttackRelease(player localPlayer, BOOL hasAmmo){
player pl = localPlayer;
TS_Weapon_SecondaryAttackRelease(player pl, BOOL hasAmmo){
if(pl.inventoryEquippedIndex == -1){
return FALSE;
}
@ -45,10 +40,8 @@ TS_Weapon_SecondaryAttackRelease(player localPlayer, BOOL hasAmmo){
void
TS_Weapon_Draw_extra(void){
player pl = (player)self;
weapondynamic_t dynaRef;
printfline("PLAYER DREW WEAPON: invID:%i (g_weapons ID:%d)", pl.inventoryEquippedIndex, pl.activeweapon);
dynaRef = pl.ary_myWeapons[pl.inventoryEquippedIndex];
pl.currentZoomChoice = -1;
pl.aryNextBurstShotTime_softLength = 0;
@ -61,8 +54,7 @@ TS_Weapon_Draw_extra(void){
void
TS_Weapon_Draw(player localPlayer, int weaponEquipped, BOOL useAkimbo ) {
player pl = localPlayer;
TS_Weapon_Draw(player pl, int weaponEquipped, BOOL useAkimbo ) {
//weapondynamic_t dynaRef;
//weapondynamic_t dynaRefPRE;
@ -86,9 +78,9 @@ TS_Weapon_Draw(player localPlayer, int weaponEquipped, BOOL useAkimbo ) {
// MMMMMmmmmmm sounds odd if Draw containts non-rendering-related startup script,
// rather this happen as son as possible for now.
#ifdef CSQC
#ifdef CLIENT
printfline("TS_Weapon_Draw (client direct call): prev:%i curr:%d", pSeat->m_iLastWeapon, pl.activeweapon);
#endif
#endif
// This Weapons_Draw call is only for serverside, at clientside, we trust
@ -102,7 +94,7 @@ TS_Weapon_Draw(player localPlayer, int weaponEquipped, BOOL useAkimbo ) {
// TEST! Force the call now anyway clientside too.
//#ifdef SSQC
//#ifdef SERVER
TS_Weapon_Draw_extra();
Weapons_Draw();
//#else
@ -126,7 +118,7 @@ TS_Weapon_Draw(player localPlayer, int weaponEquipped, BOOL useAkimbo ) {
// TODO. Would making this shared be OK? Seems to have worked for grenades and throwing knives
// on removing themselves on running out of ammo.
// Just remember that spawning the actual entitiy won't be happening clientside in any form.
#ifdef SSQC
#ifdef SERVER
void
TS_Weapon_Drop() {
player pl = (player)self;
@ -155,29 +147,27 @@ TS_Weapon_Drop() {
// CRITICAL! TS_playerEquippedWeapon methods dummied out to stop conflicts with
// the new Nuclide way
void
TS_playerEquippedWeapon_Shared(player localPlayer, int newWeaponEquipped, BOOL useAkimbo){
TS_playerEquippedWeapon_Shared(player pl, int newWeaponEquipped, BOOL useAkimbo){
/*
if(localPlayer.inventoryEquippedIndex == newWeaponEquipped && useAkimbo == localPlayer.weaponEquippedAkimbo ){
if(pl.inventoryEquippedIndex == newWeaponEquipped && useAkimbo == pl.weaponEquippedAkimbo ){
// equipping the same weapon? Ignore this call then!
return;
}
*/
_TS_playerEquippedWeapon(localPlayer, newWeaponEquipped, useAkimbo);
_TS_playerEquippedWeapon(pl, newWeaponEquipped, useAkimbo);
}
#ifdef CSQC
#ifdef CLIENT
// Actual clientside logic related to this action. Need to change the viewmodel
// on a change like this.
// Note that viewmodels check for "pl.inventoryEquippedIndex" being changed in ts/client/view.c.
// This is OK. pl.inventoryEquippedIndex is updated from server to client in client & server/player.c, read/sendEntity methods. So everything works out.
void
_TS_playerEquippedWeapon(player localPlayer, int newWeaponEquipped, BOOL useAkimbo){
//return;
player pl = localPlayer;
_TS_playerEquippedWeapon(player pl, int newWeaponEquipped, BOOL useAkimbo){
TS_Weapon_Draw(pl, newWeaponEquipped, useAkimbo);
}
@ -192,10 +182,10 @@ _TS_playerEquippedWeapon(player localPlayer, int newWeaponEquipped, BOOL useAkim
// The client will tell the server to do something, and THEN the server relays that to
// the client. Whatever just go with it.
void
TS_playerEquippedWeapon(player localPlayer, int newWeaponEquipped, BOOL useAkimbo){
TS_playerEquippedWeapon(player pl, int newWeaponEquipped, BOOL useAkimbo){
//pSeat->ePlayer = self = findfloat(world, entnum, player_localentnum);
//printfline("WELL??! %i %i %d %d", localPlayer.inventoryEquippedIndex, newWeaponEquipped, useAkimbo, localPlayer.weaponEquippedAkimbo);
//printfline("WELL??! %i %i %d %d", pl.inventoryEquippedIndex, newWeaponEquipped, useAkimbo, pl.weaponEquippedAkimbo);
//TODO - CRITICAL! Although - might not be that bad.
// Note that any weapon removal (only removing the currently equipped weapon is possible) also
// sets the current equipped weapon to -1. So any other choice of weapon after this has to work.
@ -205,34 +195,32 @@ TS_playerEquippedWeapon(player localPlayer, int newWeaponEquipped, BOOL useAkimb
// Say there are 3 weapons, #0, #1, #2, and #3. Say #2 is equipped now.
// If #2 is deleted (shifts #3 to be the new #2), and #2 is picked to be the new weapon,
// that would cause this check to deny picking the 'new' weapon taking up slot #2.
if(localPlayer.inventoryEquippedIndex == newWeaponEquipped && useAkimbo == localPlayer.weaponEquippedAkimbo ){
if(pl.inventoryEquippedIndex == newWeaponEquipped && useAkimbo == pl.weaponEquippedAkimbo ){
// equipping the same weapon? Ignore this call then!
return;
}
_TS_playerEquippedWeapon(localPlayer, newWeaponEquipped, useAkimbo);
_TS_playerEquippedWeapon(pl, newWeaponEquipped, useAkimbo);
sendevent("TS_playerEquippedWeapon", "ii", newWeaponEquipped, (int)useAkimbo);
}
#endif
#ifdef SSQC
#ifdef SERVER
// that's it really serverside.
void
_TS_playerEquippedWeapon(player localPlayer, int newWeaponEquipped, BOOL useAkimbo){
player pl = localPlayer;
_TS_playerEquippedWeapon(player pl, int newWeaponEquipped, BOOL useAkimbo){
TS_Weapon_Draw(pl, newWeaponEquipped, useAkimbo);
}
//The server set the equippedWeapon, and needs to tell the client to keep it in synch
void
TS_playerEquippedWeapon(player localPlayer, int newWeaponEquipped, BOOL useAkimbo){
_TS_playerEquippedWeapon(localPlayer, newWeaponEquipped, useAkimbo);
TS_playerEquippedWeapon(player pl, int newWeaponEquipped, BOOL useAkimbo){
_TS_playerEquippedWeapon(pl, newWeaponEquipped, useAkimbo);
// force a sendoff soon!
localPlayer.activeweapon_net = 255;
localPlayer.inventoryEquippedIndex_net = 255;
pl.activeweapon_net = 255;
pl.inventoryEquippedIndex_net = 255;
}
@ -253,26 +241,26 @@ CSEv_TS_playerEquippedWeapon_ii(int newWeaponEquipped, BOOL useAkimbo){
#ifdef SSQC
#ifdef SERVER
// Send a request to change the animation of the viewmodel directly.
void
TS_PlayInsertShellSound(player localPlayer){
TS_PlayInsertShellSound(player pl){
/*
WriteByte( MSG_MULTICAST, SVC_CGAMEPACKET );
WriteByte( MSG_MULTICAST, EVENT_TS::PLAY_INSERT_SHELL_SND );
msg_entity = localPlayer;
msg_entity = pl;
multicast( [0,0,0], MULTICAST_ONE );
*/
}
#else
void
TS_PlayInsertShellSound(player localPlayer){
EV_TS_PlayInsertShellSound(localPlayer);
TS_PlayInsertShellSound(player pl){
EV_TS_PlayInsertShellSound(pl);
}
//CLIENTSIDE. now what do I do over here?
void
EV_TS_PlayInsertShellSound(player localPlayer){
EV_TS_PlayInsertShellSound(player pl){
//TODO - lower attenuation maybe?
// Nevermind, this is a client-only sound for now anyway.
localsound("weapons/insert-shell.wav", CHAN_AUTO, 1.0f);
@ -285,15 +273,15 @@ EV_TS_PlayInsertShellSound(player localPlayer){
// The server may want to tell the client to reset its viewmodel.
// DUMMIED - nevermind that for now, assuming the logic is called from server/client
// individually like a lot of weapon's logic.
#ifdef SSQC
#ifdef SERVER
void
TS_resetViewModel(player localPlayer){
TS_resetViewModel(player pl){
/*
//localPlayer.lasersightUnlockTime = FALSE; //reset
//pl.lasersightUnlockTime = FALSE; //reset
WriteByte( MSG_MULTICAST, SVC_CGAMEPACKET );
WriteByte( MSG_MULTICAST, EVENT_TS::RESET_VIEW_MODEL );
msg_entity = localPlayer;
msg_entity = pl;
multicast( [0,0,0], MULTICAST_ONE );
*/
@ -304,7 +292,7 @@ TS_resetViewModel(player localPlayer){
#else
//CLIENT
void
TS_resetViewModel(player localPlayer){
TS_resetViewModel(player pl){
EV_TS_resetViewModel();
}
void
@ -319,40 +307,32 @@ EV_TS_resetViewModel(void){
// Want to reset the player between spawns?
#ifdef SSQC
#ifdef SERVER
void
TS_resetPlayer(player localPlayer, BOOL resetInventory){
if(localPlayer == NULL){
return;
}
if(localPlayer.classname != "player"){
TS_resetPlayer(player pl, BOOL resetInventory){
if(pl == NULL){
return;
}
//reset our inventory, serverside.
localPlayer.reset(resetInventory);
pl.reset(resetInventory);
//And tell the client to do the same.
WriteByte( MSG_MULTICAST, SVC_CGAMEPACKET );
WriteByte( MSG_MULTICAST, EVENT_TS::RESET_PLAYER );
WriteByte( MSG_MULTICAST, resetInventory );
msg_entity = localPlayer;
msg_entity = pl;
multicast( [0,0,0], MULTICAST_ONE );
}
#else
//CLIENT
void
EV_TS_resetPlayer(player localPlayer, BOOL resetInventory){
if(localPlayer == NULL){
EV_TS_resetPlayer(player pl, BOOL resetInventory){
if(pl == NULL){
return;
}
// TODO: just have this check in receiving events to begin with?
if(localPlayer.classname == "player"){
localPlayer.reset(resetInventory);
}else{
// ????????????
}
pl.reset(resetInventory);
}
#endif
@ -378,13 +358,12 @@ EV_PlayerDeath(void){
#ifdef CSQC
#ifdef CLIENT
//NOTICE - clientside components removed, except for clientside being able
// to signal that the server should remove a weapon.
// This needs no clientside logic equivalent to be mirrored.
/*
void _TS_playerDropWeapon(player localPlayer){
player pl = localPlayer;
void _TS_playerDropWeapon(player pl){
TS_Weapon_Drop();
@ -398,15 +377,14 @@ TS_playerDropWeapon(void){
/*
//This is a received call from the server - no need to update it back
//NOTICE - this is the callback telling us to do something. Yes do something.
void EV_TS_playerDropWeapon(player localPlayer){
player pl = localPlayer;
void EV_TS_playerDropWeapon(player pl){
//pSeat->ePlayer = self = findfloat(world, entnum, player_localentnum);
_TS_playerDropWeapon(localPlayer);
_TS_playerDropWeapon(pl);
}
*/
#endif
#ifdef SSQC
#ifdef SERVER
//that's it really serverside.
void
_TS_playerDropWeapon(void){
@ -460,17 +438,16 @@ CSEv_TS_playerChangeFiremode_(void){
void
TS_playerChangeFiremode(void){
player pl = (player)self;
if(pl.classname == "spectator" || pl.inventoryEquippedIndex == -1){
//well gee that is no good
if(pl.inventoryEquippedIndex == -1){
return;
}
#ifdef CLIENT
#ifdef CLIENT
sendevent("TS_playerChangeFiremode", "");
// and do it my side too?
_TS_playerChangeFiremode();
#else
#else
// SHOULD NOT HAPPEN, should call the CSEv_ version instead
#endif
#endif
}
@ -553,17 +530,16 @@ CSEv_TS_playerUseItems_(void){
void
TS_playerUseItems(void){
player pl = (player)self;
if(pl.classname == "spectator" || pl.inventoryEquippedIndex == -1){
//well gee that is no good
if(pl.inventoryEquippedIndex == -1){
return;
}
#ifdef CLIENT
#ifdef CLIENT
sendevent("TS_playerUseItems", "");
// and do it my side too?
_TS_playerUseItems();
#else
#else
// SHOULD NOT HAPPEN, should call the CSEv_ version instead
#endif
#endif
}
@ -631,9 +607,9 @@ _TS_playerUseItems(void){
// Let's be a clientside sound only.
#ifdef CLIENT
#ifdef CLIENT
localsound("weapons/switch.wav", CHAN_AUTO, 1.0f);
#endif
#endif
// (METHOD MADE SINCE: TS_Weapons_PlaySoundChannelDirect)
@ -644,11 +620,11 @@ _TS_playerUseItems(void){
/*
// unicast demo . Why does the sound play clientside the first few times anyway?
// It shouldn't ever, with the clientside-call here disabled.
#ifdef CLIENT
#ifdef CLIENT
//sound(pl, CHAN_ITEM, "weapons/switch.wav", 1, ATTN_NONE, 100.0f, SOUNDFLAG_NONE, 0);
#else
#else
sound(pl, CHAN_ITEM, "weapons/switch.wav", 1, ATTN_NONE, 100.0f, SOUNDFLAG_UNICAST, 0);
#endif
#endif
*/
}// bitcount checks
@ -677,17 +653,16 @@ CSEv_TS_playerUsePowerup_(void){
void
TS_playerUsePowerup(void){
player pl = (player)self;
if(pl.classname == "spectator" || pl.inventoryEquippedIndex == -1){
//well gee that is no good
if(pl.inventoryEquippedIndex == -1){
return;
}
#ifdef CLIENT
#ifdef CLIENT
sendevent("TS_playerUsePowerup", "");
// and do it my side too?
_TS_playerUsePowerup();
#else
#else
// SHOULD NOT HAPPEN, should call the CSEv_ version instead
#endif
#endif
}
@ -718,17 +693,16 @@ CSEv_TS_playerCallAlt1_(void){
void
TS_playerCallAlt1(void){
player pl = (player)self;
if(pl.classname == "spectator" || pl.inventoryEquippedIndex == -1){
//well gee that is no good
if(pl.inventoryEquippedIndex == -1){
return;
}
#ifdef CLIENT
#ifdef CLIENT
sendevent("TS_playerCallAlt1", "");
// and do it my side too?
_TS_playerCallAlt1();
#else
#else
// SHOULD NOT HAPPEN, should call the CSEv_ version instead
#endif
#endif
}
@ -759,17 +733,16 @@ CSEv_TS_playerCallAlt2_(void){
void
TS_playerCallAlt2(void){
player pl = (player)self;
if(pl.classname == "spectator" || pl.inventoryEquippedIndex == -1){
//well gee that is no good
if(pl.inventoryEquippedIndex == -1){
return;
}
#ifdef CLIENT
#ifdef CLIENT
sendevent("TS_playerCallAlt2", "");
// and do it my side too?
_TS_playerCallAlt2();
#else
#else
// SHOULD NOT HAPPEN, should call the CSEv_ version instead
#endif
#endif
}
@ -795,7 +768,7 @@ _TS_playerCallAlt2(void){
///////////////////////////////////////////////////////////////////////////////////////
//!!!! SERVER EVENTS ONLY BELOW HERE
#ifdef SSQC
#ifdef SERVER
///////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////
@ -945,7 +918,6 @@ CSEv_PlayerBuyWeaponThw_TS_iii( int iWeaponTypeID, int iBuyOpts, int iCount ) {
//attemptAddWeaponToConfig(pl, iWeaponTypeID, iBuyOpts);
attemptBuyWeapon(pl, iWeaponTypeID, iBuyOpts, iCount);
}
#endif// SERVER
@ -961,26 +933,17 @@ CSEv_PlayerBuyWeaponThw_TS_iii( int iWeaponTypeID, int iBuyOpts, int iCount ) {
// I think that's it actually.
// nah, just check for that special case when dropping a weapon
void
playerEquipIdeal(player localPlayer){
//go through all the players weapons. whichever has the highest slot number, except for 5, gets picked
player pl = localPlayer;
playerEquipIdeal(player pl){
// go through all the players weapons. whichever has the highest slot number, except for 5, gets picked
int bestSlotYet = 0;
weapondynamic_t weapon_DynaRef = NULL;
int weaponDynamicID_toEquip = -1;
int i;
//printfline("playerEquipIdeal: invcount: %i", pl.ary_myWeapons_softMax);
//work backwards, so the last item in a slot satisfies us
for(int i = pl.ary_myWeapons_softMax-1; i >= 0; i--){
//weapon_configRef = (weaponconfig_weapon_t) pl.weaponconfig_temp.ary_myWeapons[i];
// work backwards, so the last item in a slot satisfies us
for(i = pl.ary_myWeapons_softMax-1; i >= 0; i--){
weapon_DynaRef = (weapondynamic_t) pl.ary_myWeapons[i];
weapondata_basic_t* basicPointer = (weapondata_basic_t*) ary_weaponData[weapon_DynaRef.weaponID];
weapondata_basic_t basicRef = *(basicPointer);
@ -1010,10 +973,11 @@ playerEquipIdeal(player localPlayer){
// Also, the shared version does not send a message to clientside to update the viewmodel,
// this causes issues with the grenade removing itself on running out of ammo.
// Throwing knives can use either version here though, but everything works with _shared.
// Plus changes to what's serverside are sent to the client soon enough anyway, doing so here
// seems unnecessary.
// Plus changes to what's serverside are sent to the client soon enough anyway, doing so
// here seems unnecessary.
// TODO, CRITICAL. Check other places.
// Could anywhere else benefit from TS_playerEquippedWeapon being changed to TS_playerEquippedWeapon_Shared ?
// Could anywhere else benefit from TS_playerEquippedWeapon being changed to
// TS_playerEquippedWeapon_Shared ?
TS_playerEquippedWeapon_Shared(pl, weaponDynamicID_toEquip, TRUE);
@ -1022,11 +986,11 @@ playerEquipIdeal(player localPlayer){
// Call to above with a few extra lines included, commonly used so bundled into a method
void
playerEquipIdealSafe(player localPlayer){
TS_resetViewModel(localPlayer);
localPlayer.setInventoryEquippedIndex(-1);
playerEquipIdeal(localPlayer);
playerEquipIdealSafe(player pl){
TS_resetViewModel(pl);
pl.setInventoryEquippedIndex(-1);
playerEquipIdeal(pl);
printfline("playerEquipIdealSafe: stats, activeWeap:%d invEqIndex:%i", localPlayer.activeweapon, localPlayer.inventoryEquippedIndex);
printfline("playerEquipIdealSafe: stats, activeWeap:%d invEqIndex:%i", pl.activeweapon, pl.inventoryEquippedIndex);
}

View File

@ -36,6 +36,30 @@ Game_Input(void)
// If not, grab pSeat->m_ePlayer instead!
player pl = (player)self;
if(pl.iState != PLAYER_STATE::SPAWNED){
// not ingame (fake spectator)? Do another check instead: spawning.
#ifdef CLIENT
if((input_buttons & INPUT_BUTTON0) && !(pl.gflags & GF_SEMI_TOGGLED) ){
if(pSeatLocal->fVGUI_Display == VGUI_SCREEN::NONE && pl.iState != PLAYER_STATE::SPAWNED){
sendevent( "GamePlayerSpawn", "");
}
}
// since the rest of this method is about to be skipped.
if(input_buttons & INPUT_BUTTON0){
pl.gflags |= GF_SEMI_TOGGLED;
}else{
pl.gflags &= ~GF_SEMI_TOGGLED;
}
#endif
return;
}
// Must be ingame to reach beyond here
//TAGGG - good place for this? Cloned from w_attack_next as a separate counter
// for akimbo firing to use.
// This method, Game_Input, is called by Nuclide's pmove.qc in the same place
@ -59,7 +83,6 @@ Game_Input(void)
Player_UseUp();
self.impulse = 0;
#endif
// better TS way, weapon thinks happen alongside checking inputs
@ -81,6 +104,35 @@ Game_Input(void)
#if INPUT_TAP_DETECT_CHOICE == 1
processInputs();
if(input_buttons & INPUT_BUTTON0){
pl.gflags |= GF_SEMI_TOGGLED;
}else{
// held down the previous frame, but not now? That's a release.
if(pl.gflags & GF_SEMI_TOGGLED){
TS_Weapon_PrimaryAttackRelease(pl, TRUE);
pl.gflags &= ~GF_SEMI_TOGGLED;
}
}
if(input_buttons & INPUT_BUTTON3){
pl.gflags |= GF_SEMI_SECONDARY_TOGGLED;
}else{
if(pl.gflags & GF_SEMI_SECONDARY_TOGGLED){
TS_Weapon_SecondaryAttackRelease(pl, TRUE);
pl.gflags &= ~GF_SEMI_SECONDARY_TOGGLED;
}
}
#else
//////////////////////////////////////////////
//INPUT_TAP_DETECT_CHOICE == 2
if (input_buttons & INPUT_BUTTON0){
// Fresh touch? Set inputPrimaryTapFrameCount.
// The client gets an extra frame to count. This makes an issue where giving a semi input
@ -110,13 +162,14 @@ Game_Input(void)
// differences, even on the same machine, are enough to make one ready in the same perceived frame
// but the other not. Server or client-exclusive lag may also make the issue more likely even in
// clean delays for FreeHL, particularly spamming printouts.
if(!(pl.gflags & GF_SEMI_TOGGLED)){
#ifdef CLIENT
#ifdef CLIENT
pl.inputPrimaryTapFrameCount = 2;
//pl.inputPrimaryTapFrameCount = 1;
#else
#else
pl.inputPrimaryTapFrameCount = 1;
#endif
#endif
}
pl.gflags |= GF_SEMI_TOGGLED;
pl.gflags_net |= GF_SEMI_TOGGLED;
@ -134,11 +187,11 @@ Game_Input(void)
// Same for secondary.
if (input_buttons & INPUT_BUTTON3){
if(!(pl.gflags & GF_SEMI_SECONDARY_TOGGLED)){
#ifdef CLIENT
#ifdef CLIENT
pl.inputSecondaryTapFrameCount = 2;
#else
#else
pl.inputSecondaryTapFrameCount = 1;
#endif
#endif
}
pl.gflags |= GF_SEMI_SECONDARY_TOGGLED;
pl.gflags_net |= GF_SEMI_SECONDARY_TOGGLED;
@ -156,6 +209,7 @@ Game_Input(void)
// This way, what's below the script in this method returning early doesn't skip what comes after.
processInputs();
if(wasPassingFrame){
pl.inputPrimaryTapFrameCount = 0;
pl.inputSecondaryTapFrameCount = 0;
@ -180,6 +234,8 @@ Game_Input(void)
TS_Weapon_SecondaryAttackRelease(pl, TRUE);
}
#endif INPUT_TAP_DETECT_CHOICE
//pl.callWeaponThink();
/*
@ -256,7 +312,7 @@ void processInputs(void){
// Nuclide's src/client/entry.qc. Can we get that CSQC_Input_Frame event to pipe
// a call over to gamemod script for custom behavior like this, perhaps?
/*
#if CLIENT
#if CLIENT
if ((pSeat->m_iHUDWeaponSelected) ) {
HUD_DrawWeaponSelect_Trigger();
input_buttons = 0;
@ -269,7 +325,7 @@ void processInputs(void){
input_buttons = 0;
return;
}
#endif
#endif
*/
Weapons_Secondary();
@ -305,11 +361,15 @@ void processInputs(void){
// reached here?
Weapons_Release();
// No need for this now
/*
// These SEMI flag removals only happen if this area is reached
// (note the 'return' statements above with button presses)
// Nuclide already does that first one
//pl.gflags &= ~GF_SEMI_TOGGLED;
pl.gflags &= ~GF_SEMI_SECONDARY_TOGGLED;
*/
}//processInputs

View File

@ -8,7 +8,6 @@
#define WEAPONOPT_SCOPE_COST 1500i
//SSQC
#define PLAYER_INVENTORY_GENERIC pl.ary_myWeapons
#define PLAYER_INVENTORY_GENERIC_MAX pl.ary_myWeapons_softMax
//The server has the player's physical money for use anytime.
@ -35,7 +34,7 @@
#ifdef CSQC
#ifdef CLIENT
// has the player purchased anything? Used to tell whether to print "order canceled" on exiting.
var BOOL boughtAnything;

View File

@ -222,7 +222,7 @@ BOOL INV_anyWeaponUsingAmmoType(player pl, int arg_ammoType, int arg_excludedWea
#ifdef CSQC
#ifdef CLIENT
void swapConfigElements(int arg_index1, int arg_index2){
@ -331,12 +331,12 @@ void swapInventoryElements(player pl, int arg_index1, int arg_index2){
#ifdef CSQC
#ifdef CLIENT
//TAGGG - TODO, CRITICAL!!!
// Have another version, removeWeaponFromInventory, for ingame clientside usage too.
// This is for spectator managing the config when called clientside, but a lot of script is now
// more shared.
// Also, see what can be taken out of #ifdef SSQC/SERVER places to be shared.
// Also, see what can be taken out of #ifdef SERVER/SERVER places to be shared.
// So much as the swapConfigElements may need a shared-version that's identical between client/server too!
// As of now, removeWeaponFromConfig does not have an effect for ingame clientside. See weapon_combatknife,
// on throwing the last knife, look at printouts REMOVED, PRE / REMOVED, POST.
@ -358,7 +358,7 @@ void removeWeaponFromConfig(int arg_removeIndex){
//NOTICE - only the config does refunding.
//#ifdef CSQC
//#ifdef CLIENT
if(myWeaponTypeID == WEAPONDATA_TYPEID_GUN || myWeaponTypeID == WEAPONDATA_TYPEID_IRONSIGHT){
//this weapon has ammo.
//before we remove this, refund its cost. And see if any other weapons refer to the same ammo pool anymore
@ -561,11 +561,11 @@ BOOL attemptAddWeaponToConfig(player pl, int arg_weaponID, int arg_iBitsUpgrade,
//remember, this is as though the weapon has never been purchased before yet, so this is maxCount times base price.
//(not that throwables really have upgrades anyways).
//And "iMaxCount - 1" because we already spent the buy price once. For a max of 5 knives, actually add 4 times the cost.
#ifdef CSQC
#ifdef CLIENT
//This is only necessary clientside (config), because serverside
//we received the count already from having picked FULLLOAD.
newCount = throwableRef.iMaxCount;
#endif
#endif
}else if(existingMatchingIndex != -1){
//could also be buying another to stack on top of the existing by 1. See if we can.
int newCountTest = PLAYER_INVENTORY_GENERIC[existingMatchingIndex].iCount + 1;
@ -621,7 +621,7 @@ BOOL attemptAddWeaponToConfig(player pl, int arg_weaponID, int arg_iBitsUpgrade,
// !!! Different between versions
#ifdef CSQC
#ifdef CLIENT
//client needs to consider the total left
int remainingPlayerMoney = PLAYER_MONEY - (PLAYER_TOTALCOST + finalPrice) + existingAmmoCost;
#else
@ -650,7 +650,7 @@ BOOL attemptAddWeaponToConfig(player pl, int arg_weaponID, int arg_iBitsUpgrade,
}//END OF gun OR ironsight weapon type checks
#ifdef CSQC
#ifdef CLIENT
//totalCost only for client - for the server, we're only concerned with how much the player physically has left
if( !RULE_MONEY_ALLOWED || (PLAYER_TOTALCOST + finalPrice - existingAmmoCost <= PLAYER_MONEY) ){
#else
@ -691,7 +691,7 @@ BOOL attemptAddWeaponToConfig(player pl, int arg_weaponID, int arg_iBitsUpgrade,
}//END OF existingMatchingIndex check
#ifdef CSQC
#ifdef CLIENT
//finalWeaponIndex ?
PLAYER_INVENTORY_GENERIC[matchStart].weaponID = arg_weaponID;
PLAYER_INVENTORY_GENERIC[matchStart].weaponTypeID = basicRef.typeID;
@ -932,11 +932,11 @@ BOOL attemptAddWeaponToConfig(int arg_weaponID, int arg_iBitsUpgrade, int iCount
//remember, this is as though the weapon has never been purchased before yet, so this is maxCount times base price.
//(not that throwables really have upgrades anyways).
//And "iMaxCount - 1" because we already spent the buy price once. For a max of 5 knives, actually add 4 times the cost.
#ifdef CSQC
#ifdef CLIENT
//This is only necessary clientside (config), because serverside
//we received the count already from having picked FULLLOAD.
newCount = throwableRef.iMaxCount;
#endif
#endif
}else if(existingMatchingIndex != -1){
//could also be buying another to stack on top of the existing by 1. See if we can.
int newCountTest = CONFIG_PLAYER_INVENTORY_GENERIC[existingMatchingIndex].iCount + 1;
@ -1203,11 +1203,11 @@ BOOL attemptBuyWeapon(player pl, int arg_weaponID, int arg_iBitsUpgrade, int iCo
//remember, this is as though the weapon has never been purchased before yet, so this is maxCount times base price.
//(not that throwables really have upgrades anyways).
//And "iMaxCount - 1" because we already spent the buy price once. For a max of 5 knives, actually add 4 times the cost.
#ifdef CSQC
#ifdef CLIENT
//This is only necessary clientside (config), because serverside
//we received the count already from having picked FULLLOAD.
newCount = throwableRef.iMaxCount;
#endif
#endif
}else if(existingMatchingIndex != -1){
//could also be buying another to stack on top of the existing by 1. See if we can.
int newCountTest = PLAYER_INVENTORY_GENERIC[existingMatchingIndex].iCount + 1;

View File

@ -61,7 +61,7 @@ class player:base_player
PREDICTED_CUSTOM(PLAYER_STATE, iState);
#ifdef SSQC
#ifdef SERVER
int money;
//int voted;
@ -74,7 +74,7 @@ class player:base_player
// UNUSED FOR NOW, just an idea.
int flViewModelFrame;
#endif
#endif
// who's team am I on? may not matter depending on gamemode.
@ -86,7 +86,7 @@ class player:base_player
#ifdef CSQC
#ifdef CLIENT
//TAGGG - related to how to handle FOV changes.
float flCurrentZoom;
float flOldZoom;
@ -182,7 +182,7 @@ class player:base_player
//TODO - see how to handle saving / loadig these on the client's end.
//Server probably dosen't need to store config stuff at all.
#ifdef CSQC
#ifdef CLIENT
// record the time of the previous frame.
// TODO - could this be done once globally clientside for all players?
@ -202,10 +202,10 @@ class player:base_player
int weaponSelectHighlightID;
//This var gets a chance to turn on after the player goes through all weapons in slots 1-4 to see if any weapons have akimbo. If so, weaponSelectHighlightID goes to that weapon (the first with akimbo) and this variable turns on. Going to the next/previous weapon goes through all weapons to see the next akimbo one until there are no other choices in that direction (like last akimb weapon --> next goes back to akimbo-less slot 1's first weapon... and so on if empty). Note that slot 5 is imaginary; it is only made of weapons from slots 1-4 with akimbo choices.
//Then, selecting a next weapon looks for the next
BOOLEAN weaponSelectHighlightAkimbo;
BOOL weaponSelectHighlightAkimbo;
//used for telling what the most recently equipped weapon's akimbo status was - no or yes.
BOOLEAN flag_lastWeaponAkimbo;
BOOL flag_lastWeaponAkimbo;
float flViewShake;
@ -216,7 +216,7 @@ class player:base_player
#endif
// Should this even be networked? Seems to work on a very short timeframe
BOOLEAN switchToRecentlyAddedWeapon;
BOOL switchToRecentlyAddedWeapon;
// TODO - reset in server and client respawn calls/notices.
@ -283,7 +283,7 @@ class player:base_player
float shotgunAddAmmoSoundTime;
#ifdef CSQC
#ifdef CLIENT
#else
@ -361,7 +361,7 @@ class player:base_player
//The client needs to know whether our recent attack had ammo while firing.
//In case the client needs to play a click sound clientside in response to a failed fire attempt
//TAGGG - TODO. Remove this I think? AKimbo still uses it a tiny bit though, maybe not.
BOOLEAN recentAttackHadAmmo;
BOOL recentAttackHadAmmo;
//What particular choice of "ary_myWeapons" is equipped?
@ -434,7 +434,7 @@ class player:base_player
////////////////////////////////////////////////////////////
virtual void(BOOLEAN resetInventory) reset;
virtual void(BOOL resetInventory) reset;
virtual vector(vector vecInputAngles)View_approachAngleOffsetTarget;
virtual void (void)handleAccuracyKickback;
@ -442,7 +442,7 @@ class player:base_player
virtual void(float arg_theZoom) setZoom;
virtual void(int arg_newIndex) setInventoryEquippedIndex;
virtual void(int arg_newIndex, BOOLEAN useAkimbo) setInventoryEquippedIndex_Akimbo;
virtual void(int arg_newIndex, BOOL useAkimbo) setInventoryEquippedIndex_Akimbo;
virtual weapondata_basic_t*(void) getEquippedWeaponData;
virtual weapondata_basic_t*(void) getEquippedWeaponData_Singular;
@ -472,7 +472,7 @@ class player:base_player
#ifdef SSQC
#ifdef SERVER
// !!! SPECIAL CASE? not built-in but is what the "think" method is set to early on.
// (REMOVED: the ".think" pointer will likely be set by other stuff like so much as a reload delay,
// let's not expect this to stay as it's set)s
@ -480,11 +480,11 @@ class player:base_player
//TAGGG - QUESTION. Does this need to be separate from postThink at all? Same for above, forget what these are for
virtual void () frameThink_fromServer;
virtual BOOLEAN(TSWorldGun arg_pickup) attemptAddWeaponFromPickup;
virtual void(int arg_weaponID, BOOLEAN completeDrop) dropWeapon;
virtual BOOLEAN() anyAmmoPoolNonEmpty;
virtual BOOL(TSWorldGun arg_pickup) attemptAddWeaponFromPickup;
virtual void(int arg_weaponID, BOOL completeDrop) dropWeapon;
virtual BOOL() anyAmmoPoolNonEmpty;
virtual void() dropAmmo;
#endif
#endif

View File

@ -668,9 +668,8 @@ player::SendEntity(entity ePEnt, float fChanged)
void player::player(void){
void
player::player(void){
printfline("CONSTRUCTOR: player, called");
// just in case?
@ -679,22 +678,19 @@ void player::player(void){
// reasonable default?
iState = PLAYER_STATE::NOCLIP;
#ifdef SSQC
#ifdef SERVER
money = 0; //safety?
//this.think = player_frameThink;
//this.nextthink = time + 0.0;
#endif
//only the server actually uses these. ah well, whatever.
//(consider making serverside-only? "ifdef SSQC" ?
ary_myWeapons_softMax = 0;
for(int i = 0; i < ary_myWeapons_length; i++){
ary_myWeapons[i] = spawn(weapondynamic_t);
}
#ifdef CSQC
#ifdef CLIENT
weaponSelectHighlightID = -1;
weaponSelectHighlightAkimbo = FALSE;
@ -704,7 +700,6 @@ void player::player(void){
flOldZoom = 1;
flZoomLerp = 0;
flZoomLevel = 0;
//queuedDeploySequence = 0;
#endif
flKarateBlockCooldown = 0;
@ -723,7 +718,7 @@ void player::player(void){
reset(TRUE); //cover anything specified in here too
/*
#ifdef SSQC
#ifdef SERVER
player someThingy = this;
printfline("***CHECKPOINT player2***");
@ -764,7 +759,7 @@ void player::player(void){
printfline("dropAmmo: %i", someThingy.dropAmmo);
printfline("***END***");
#endif
#endif
*/
@ -774,7 +769,7 @@ void player::player(void){
// use TRUE for clean respawns,
// FALSE for only resetting some weapons-related vars between weapon changes, nothing too significant
void
player::reset(BOOLEAN resetInventory){
player::reset(BOOL resetInventory){
INPUT_TAP_RESET(this)
@ -782,8 +777,7 @@ player::reset(BOOLEAN resetInventory){
//iState = ?;
#ifdef CSQC
#ifdef CLIENT
// For safety, doing this.
// If anywhere that ever calls for this method clientside has this set
// properly before the call to here, (whatever event-method in base files leads
@ -828,12 +822,12 @@ player::reset(BOOLEAN resetInventory){
forceViewModelUpdate = FALSE;
prev_forceBodygroup1Submodel = 0;
#endif
#endif
#ifdef SSQC
#ifdef SERVER
switchToRecentlyAddedWeapon = FALSE;
nextUseCooldown = 0;
#endif
#endif
currentZoomChoice = -1;
setZoom(1.0f);
@ -895,12 +889,12 @@ player::reset(BOOLEAN resetInventory){
// maybe not necessary, but I don't think
// the client gets any benefit from this.
#ifdef SSQC
#ifdef SERVER
//the first time you fire will be the first frame of firing.
//flags = flags | FL_PRIMARY_FIRE_FIRST_FRAME;
//flags = flags | FL_SECONDARY_FIRE_FIRST_FRAME;
#endif
#endif
recentAkimboAttackChoice = BITS_AKIMBOCHOICE_NONE;
nextAkimboAttackPreference = BITS_AKIMBOCHOICE_LEFT;
@ -912,7 +906,7 @@ player::reset(BOOLEAN resetInventory){
// do a check. If we didn't die last time, we don't need to delete this stuff.
// is this good? See that this reliable to check at the time "reset" is called in the spawning method!
// or just send a parameter here (preserve weapons: yes/no boolean) to determine that instead.
// or just send a parameter here (preserve weapons: yes/no BOOL) to determine that instead.
if(resetInventory){
@ -925,14 +919,14 @@ player::reset(BOOLEAN resetInventory){
setInventoryEquippedIndex(-1);
#ifdef SSQC
#ifdef SERVER
// other projects do that so sure?
weapon = 0;
// TODO - is doing this in here a good idea? decide.
WriteByte( MSG_MULTICAST, SVC_CGAMEPACKET );
WriteByte( MSG_MULTICAST, EVENT_TS::RESET_VIEW_MODEL );
msg_entity = this; //localPlayer;
msg_entity = this;
multicast( [0,0,0], MULTICAST_ONE );
#endif
@ -957,7 +951,7 @@ vector
player::View_approachAngleOffsetTarget(vector vecInputAngles)
{
float frametimeUse;
#ifdef CSQC
#ifdef CLIENT
frametimeUse = clframetime;
#else
frametimeUse = frametime;
@ -1028,7 +1022,7 @@ player::setInventoryEquippedIndex(int arg_newIndex)
// Extra version supplied 'useAkimbo'.
// Also, setting to hte
void
player::setInventoryEquippedIndex_Akimbo(int arg_newIndex, BOOLEAN useAkimbo)
player::setInventoryEquippedIndex_Akimbo(int arg_newIndex, BOOL useAkimbo)
{
printfline("setInventoryEquippedIndex_Akimbo: %i, %d", arg_newIndex, useAkimbo);
inventoryEquippedIndex = arg_newIndex;
@ -1085,30 +1079,33 @@ player::setInventoryEquippedIndex_Akimbo(int arg_newIndex, BOOLEAN useAkimbo)
// If this is the wrong way to go thinking about this, I need to know more.
// ALSO - see other uses of SAVE_STATE, most are for both client & server,
// especially the w_attack_next, or w_next_attack, in ts/shared/weapons.qc.
#ifdef CLIENT
#ifdef CLIENT
SAVE_STATE(activeweapon);
SAVE_STATE(inventoryEquippedIndex);
#endif
#endif
}
// get old FreeTS weapon info.
weapondata_basic_t* player::getEquippedWeaponData(void){
weapondata_basic_t*
player::getEquippedWeaponData(void){
//weapondynamic_t dynaRef;
//dynaRef = ary_myWeapons[inventoryEquippedIndex];
//dynaRef.weaponID
return getWeaponData((int)activeweapon, weaponEquippedAkimbo);
}
weapondata_basic_t* player::getEquippedWeaponData_Singular(void){
weapondata_basic_t*
player::getEquippedWeaponData_Singular(void){
//return getWeaponData_Singular(activeweapon_singular);
// no do this.
return ary_weaponData[activeweapon_singular];
}
// For choices other than the equipped weapon ID
weapondata_basic_t* player::getInventoryWeaponData(int arg_invID, BOOL arg_preferAkimbo){
weapondata_basic_t*
player::getInventoryWeaponData(int arg_invID, BOOL arg_preferAkimbo){
weapondynamic_t dynaRef;
dynaRef = ary_myWeapons[arg_invID];
return getWeaponData(dynaRef.weaponID, arg_preferAkimbo);
@ -1116,7 +1113,8 @@ weapondata_basic_t* player::getInventoryWeaponData(int arg_invID, BOOL arg_prefe
// As the akimbo versions of weapons are saved to g_weapons,
// the singular version may be desired sometimes.
weapondata_basic_t* player::getInventoryWeaponData_Singular(int arg_invID){
weapondata_basic_t*
player::getInventoryWeaponData_Singular(int arg_invID){
weapondynamic_t dynaRef;
dynaRef = ary_myWeapons[arg_invID];
return getWeaponData_Singular(dynaRef.weaponID);
@ -1127,7 +1125,8 @@ weapondata_basic_t* player::getInventoryWeaponData_Singular(int arg_invID){
// or handle this on their own already.
// Should this be done for price too? I doubt there would be any benefit to preserving
// the value stored in weapons ingame.
void player::updateSlotCountsForEquippedWeapon(void){
void
player::updateSlotCountsForEquippedWeapon(void){
//weapondynamic_t arg_thisWeapon = ary_myWeapons[inventoryEquippedIndex];
weapondata_basic_t* basicP = getEquippedWeaponData();
// Record the old number of slots saved to the weapon at its iCount earlier
@ -1142,7 +1141,8 @@ void player::updateSlotCountsForEquippedWeapon(void){
// Returns whether the current weapon was removed.
// Mainly this exists to check if a weapon intended to be removed instead of dropped
// (count set to 0), but this handles deleting it from the player's inventory anyway.
BOOL player::equippedWeaponDeleteCheck(void){
BOOL
player::equippedWeaponDeleteCheck(void){
weapondynamic_t arg_thisWeapon = this.ary_myWeapons[this.inventoryEquippedIndex];
if(arg_thisWeapon.iCount == 0){
// remove this weapon, pick another one.
@ -1153,7 +1153,8 @@ BOOL player::equippedWeaponDeleteCheck(void){
return FALSE;
}
BOOL player::inventoryWeaponDeleteCheck(int arg_invID){
BOOL
player::inventoryWeaponDeleteCheck(int arg_invID){
weapondynamic_t arg_thisWeapon = this.ary_myWeapons[arg_invID];
if(arg_thisWeapon.iCount == 0){
// remove this weapon, pick another one.
@ -1183,7 +1184,7 @@ player::callWeaponThink(void){
#ifdef SSQC
#ifdef SERVER
// runs every frame server-side. postthink, oddly enough, does not.
// Even cumulative 'frametime' readings do not at all add up to the real passage of time.
// Looks like we have to do this with server calling our think instead... it's own frame logic
@ -1215,7 +1216,7 @@ player::frameThink_fromServer(void){
#ifdef CSQC
#ifdef CLIENT
// Note that these pre/postThink's aren't game events, they're just called by _base/entry.c before/after
// prediction accordingly, and every single rendered frame.
@ -1331,13 +1332,15 @@ player::postThink(void){
// Now supported clientside as separate implementations (see above)
// we have other ways for handling logic clientside.
#ifdef SSQC
#ifdef SERVER
void
player::preThink(void){
//self.angles += '0 0.3 0';
//self.v_angle = self.angles;
// TODO - for clientside, this would need to involve the "view_angles" global
// instead! Unsure if the macro GET_VIEW_ANGLES is good enough
v_angle = View_approachAngleOffsetTarget(v_angle);
}// preThink
@ -1349,9 +1352,9 @@ player::postThink(void){
#endif
#ifdef SSQC
#ifdef SERVER
BOOLEAN
BOOL
player::attemptAddWeaponFromPickup(TSWorldGun arg_pickup){
//int existingMatchingIndex = findWeaponInConfig((player)other, (int)arg_pickup.myInfo.weaponID);
@ -1384,7 +1387,7 @@ player::attemptAddWeaponFromPickup(TSWorldGun arg_pickup){
if(switchToRecentlyAddedWeapon){
// We assume this is a new weapon or one that upgraded into akimbo.
// Play this sound too.
sound(this, CHAN_ITEM, "items/gunpickup2.wav", 1, ATTN_NORM, 100, SOUNDFLAG_CUSTOMCLIENT );
sound(this, CHAN_ITEM, "items/gunpickup2.wav", 1, ATTN_NORM, 100, SOUNDFLAG_PLAYER_COMMON );
TS_playerEquippedWeapon(this, slotPlacedIn, TRUE);
}
@ -1416,7 +1419,7 @@ player::attemptAddWeaponFromPickup(TSWorldGun arg_pickup){
// the "completeDrop" parameter means auto-dropping akimbo. Player death does this
// for convenience.
void
player::dropWeapon(int arg_weaponID, BOOLEAN completeDrop){
player::dropWeapon(int arg_weaponID, BOOL completeDrop){
if(arg_weaponID == -1){
// ???
@ -1627,7 +1630,7 @@ player::dropWeapon(int arg_weaponID, BOOLEAN completeDrop){
BOOLEAN
BOOL
player::anyAmmoPoolNonEmpty(void){
//BOOL anyNonEmpty = FALSE;
for(int i = 0; i < AMMO_ID::LAST_ID; i++){

View File

@ -50,13 +50,6 @@ const vector VEC_CHULL_MAX = [16,16,18];
*/
// helper macro for here.
#ifdef CSQC
#define GET_VIEW_ANGLES view_angles
#else
#define GET_VIEW_ANGLES target.v_angle
#endif
.float waterlevel;
@ -198,17 +191,17 @@ player::Physics_Jump(void)
// as a "ledge". At least I think that's what the original TS was going for.
// This may even be a little more likely to work than in the original, I don't
// think that's too bad.
void LedgeCheck(player target){
void LedgeCheck(player pl){
//if(target.velocity.z != 0 && !(target.velocity.z >= -45 && target.velocity.z <= 50)){
// printfline("that VELOCITY is bad %.2f", target.velocity.z);
//if(pl.velocity.z != 0 && !(pl.velocity.z >= -45 && pl.velocity.z <= 50)){
// printfline("that VELOCITY is bad %.2f", pl.velocity.z);
//}
//&& target.velocity.z >= -45 && target.velocity.z <= 50
//&& pl.velocity.z >= -45 && pl.velocity.z <= 50
if(
!(target.flags & FL_ONGROUND) &&
!(pl.flags & FL_ONGROUND) &&
GET_VIEW_ANGLES.x >= -70 && GET_VIEW_ANGLES.x <= 80
&& (target.velocity.z >= -90 && target.velocity.z <= 160)
&& (pl.velocity.z >= -90 && pl.velocity.z <= 160)
){
makevectors(GET_VIEW_ANGLES);
@ -216,28 +209,28 @@ void LedgeCheck(player target){
// Does a line from the bottom of the player model to a little further below
// find anything?
vector vBottomStart = target.origin + [0,0,target.mins.z + 2];
vector vBottomDown = target.origin + [0,0,target.mins.z - 2];
traceline(vBottomStart, vBottomDown, FALSE, target);
vector vBottomStart = pl.origin + [0,0,pl.mins.z + 2];
vector vBottomDown = pl.origin + [0,0,pl.mins.z - 2];
traceline(vBottomStart, vBottomDown, FALSE, pl);
if(trace_fraction == 1.0){
//printfline("tracetest A");
// If not, proceed. Does a line from a little below the player outward
// find something?
vector vBottomDownForward = vBottomDown + v_forward_proj * (target.maxs.x * 1.7);
vector vBottomDownForward = vBottomDown + v_forward_proj * (pl.maxs.x * 1.7);
traceline(vBottomDown, vBottomDownForward, FALSE, target);
traceline(vBottomDown, vBottomDownForward, FALSE, pl);
if(trace_fraction < 1.0){
//ok. And does a line from the top of the model going forwards work?
vector vTopStart = target.origin + [0,0,target.maxs.z + 1];
vector vTopForward = vTopStart + v_forward_proj * (target.maxs.x * 1.7);
vector vTopStart = pl.origin + [0,0,pl.maxs.z + 1];
vector vTopForward = vTopStart + v_forward_proj * (pl.maxs.x * 1.7);
traceline(vTopStart, vTopForward, FALSE, target);
traceline(vTopStart, vTopForward, FALSE, pl);
//printfline("tracetest B trace: %.2f", trace_fraction);
if(trace_fraction == 1.0){
//printfline("tracetest C");
//ok! do it
target.velocity.z += 10;
pl.velocity.z += 10;
}
}
}

View File

@ -76,10 +76,10 @@ typedef struct{
float fActiveDuration;
// What do I do when used? Generally set some stat(s)/flag(s) to get the effect,
// like telling bullets, player movement, etc. how much to be slowed down by for instance.
void(player localPlayer) vOnUse;
void(player pl) vOnUse;
// At the end of my duration, how do I reset the things I set to act as though nothing happened?
// Should run on player death or disconnect (if necessary) too as to not leave lingering effects.
void(player localPlayer) vOnEnd;
void(player pl) vOnEnd;
// Note that we have no think effect. Nothing could be done frame-by-frame that would help
// any of the powerups do what it needs to. Speed modifiers of any sort (slow-mo) can't force
// nearby stuff to move slower directly, it sets a flag on use that tells physics to move that stuff
@ -92,7 +92,7 @@ typedef struct{
powerupdata_basic_t* ary_powerupData[POWERUP_ID::LAST_ID];
#ifdef SSQC
#ifdef SERVER
class ts_powerup;
extern void powerup_linkToStruct(ts_powerup arg_entity, POWERUP_ID arg_id);
#endif

View File

@ -18,10 +18,10 @@ void powerup_Usable_onTouch(int powerupDataID){
void powerup_SlowMotion_onTouch(void){
powerup_Usable_onTouch(POWERUP_ID::SlowMotion);
}
void powerup_SlowMotion_onUse(player localPlayer){
void powerup_SlowMotion_onUse(player pl){
}
void powerup_SlowMotion_onEnd(player localPlayer){
void powerup_SlowMotion_onEnd(player pl){
}
@ -44,10 +44,10 @@ powerupdata_usable_t powerup_SlowMotion =
void powerup_InfiniteClip_onTouch(void){
powerup_Usable_onTouch(POWERUP_ID::InfiniteClip);
}
void powerup_InfiniteClip_onUse(player localPlayer){
void powerup_InfiniteClip_onUse(player pl){
}
void powerup_InfiniteClip_onEnd(player localPlayer){
void powerup_InfiniteClip_onEnd(player pl){
}
@ -72,10 +72,10 @@ powerupdata_usable_t powerup_InfiniteClip =
void powerup_DoubleClip_onTouch(void){
powerup_Usable_onTouch(POWERUP_ID::DoubleClip);
}
void powerup_DoubleClip_onUse(player localPlayer){
void powerup_DoubleClip_onUse(player pl){
}
void powerup_DoubleClip_onEnd(player localPlayer){
void powerup_DoubleClip_onEnd(player pl){
}
// Stats unknown! Just guessing the time it lasts too.
@ -108,10 +108,10 @@ powerupdata_instant_t powerup_KungFu =
void powerup_SlowPause_onTouch(void){
powerup_Usable_onTouch(POWERUP_ID::SlowPause);
}
void powerup_SlowPause_onUse(player localPlayer){
void powerup_SlowPause_onUse(player pl){
}
void powerup_SlowPause_onEnd(player localPlayer){
void powerup_SlowPause_onEnd(player pl){
}
powerupdata_usable_t powerup_SlowPause =
@ -140,10 +140,10 @@ powerupdata_usable_t powerup_SlowPause =
void powerup_SlowPauseOld_onTouch(void){
powerup_Usable_onTouch(POWERUP_ID::SlowPauseOld);
}
void powerup_SlowPauseOld_onUse(player localPlayer){
void powerup_SlowPauseOld_onUse(player pl){
}
void powerup_SlowPauseOld_onEnd(player localPlayer){
void powerup_SlowPauseOld_onEnd(player pl){
}
// Stats unknown! Just guessing the time it lasts too.
@ -167,10 +167,10 @@ powerupdata_usable_t powerup_SlowPauseOld =
void powerup_DoubleFirerate_onTouch(void){
powerup_Usable_onTouch(POWERUP_ID::DoubleFirerate);
}
void powerup_DoubleFirerate_onUse(player localPlayer){
void powerup_DoubleFirerate_onUse(player pl){
}
void powerup_DoubleFirerate_onEnd(player localPlayer){
void powerup_DoubleFirerate_onEnd(player pl){
}
powerupdata_usable_t powerup_DoubleFirerate =
@ -245,7 +245,7 @@ powerupdata_instant_t powerup_SuperJump =
#ifdef SSQC
#ifdef SERVER
// Given a powerup entity
void powerup_linkToStruct(ts_powerup arg_entity, POWERUP_ID arg_id){

View File

@ -24,7 +24,7 @@
#undef printf
#endif
#ifdef CSQC
#ifdef CLIENT
#define printf_starter print("CL")
#define printf(s1, ...) print(sprintf(s1, ##__VA_ARGS__))
#define printfline(s1, ...) print(sprintf("CL: "s1"\n", ##__VA_ARGS__))
@ -79,7 +79,15 @@
// OLD INPUT WAY
// is setting gflags_net too a good idea? That applies to a whole host of other
// things too.
/*
// use 1 for the closest to Nuclide defaults, 2 for a little extra frame tolerance for
// clientside.
#define INPUT_TAP_DETECT_CHOICE 1
#if INPUT_TAP_DETECT_CHOICE == 1
// Standard way.
#define INPUT_PRIMARY_TAP_GATE \
if (pl.gflags & GF_SEMI_TOGGLED)\
return;
@ -91,10 +99,10 @@
#define INPUT_PRIMARY_TAP_CHECK_NOT(arg_pl) (pl.gflags & GF_SEMI_TOGGLED)
#define INPUT_SECONDARY_TAP_CHECK_NOT(arg_pl) (pl.gflags & GF_SEMI_SECONDARY_TOGGLED)
#define INPUT_TAP_RESET(arg_pl) \
arg_pl.gflags |= GF_SEMI_TOGGLED;
arg_pl.gflags |= GF_SEMI_TOGGLED; \
arg_pl.gflags |= GF_SEMI_SECONDARY_TOGGLED;
*/
#else
// ALTERNATE WAY: check pl.inputTapFrameCount for primary/secondary.
// Lets setting an extra frame for a little more tolerance work, these are
// set to 1 on a fresh key press to work exactly like above or over 1 for
@ -119,6 +127,8 @@ if (pl.inputSecondaryTapFrameCount == 0)\
arg_pl.inputPrimaryReleasedQueue = FALSE;\
arg_pl.inputSecondaryReleasedQueue = FALSE;
#endif// INPUT_TAP_DETECT_CHOICE
// FTE needs a space after a preprocessor macro name for a slash to drop-down to the
// rest of the definition, like "#define thing \".
@ -171,6 +181,16 @@ if (pl.inputSecondaryTapFrameCount == 0)\
weapon_base_setRightAttackDelay(pl, 0.22);
// For serverside, assumes the local player is a var named "pl"!
#ifdef CLIENT
#define GET_VIEW_ANGLES view_angles
#else
#define GET_VIEW_ANGLES pl.v_angle
#endif
// OLD UNDERWATER CHECK. Using a new var for more accuracy.
//#define WEAPON_UNDERWATER_CHECK pl.waterlevel >= 3
//#define WEAPON_UNDERWATER_CHECK_NOT pl.waterlevel < 3
@ -187,7 +207,7 @@ extern const vector g_vZero;
#ifdef SSQC
#ifdef SERVER
void centerprintToAll(string strSend);
#endif
@ -201,7 +221,7 @@ int randomInRange_i(int min, int max);
float safeRandom(void);
#ifdef SSQC
#ifdef SERVER
void removeSelfDelayed(entity entTarget);
#endif
@ -227,7 +247,7 @@ float getViewPitchRelativeRatio(float playerPitch);
float getViewModelAnimExtraDuration(void);
#ifdef SSQC
#ifdef SERVER
class CBaseEntity;
void entityRemoveRespawnFlag(CBaseEntity arg_this);
#endif

View File

@ -6,7 +6,7 @@ const vector g_vZero = [0,0,0];
#ifdef SSQC
#ifdef SERVER
void
centerprintToAll(string strSend){
for (entity eFind = world; (eFind = find(eFind, classname, "player"));) {
@ -151,7 +151,7 @@ static void entity_removeSelf(void);
// server's end, no idea.
// Only lets you specify the entity to GET a location from, and if the
// entity disappears to soon, no location gets sent.
#ifdef SSQC
#ifdef SERVER
void removeSelfDelayed(entity entTarget){
setmodel( entTarget, NULL );
@ -265,9 +265,9 @@ void stopSound(entity e, float chan){
/*
// This doesn't do anything... ? unlike what the 'built-in's file says about it ?
#ifdef CSQC
#ifdef CLIENT
soundupdate(pl, CHAN_VOICE, "", -1, ATTN_NORM, 100, 0, 0);
#endif
#endif
*/
}//END OF stopSound
@ -323,7 +323,7 @@ float getViewModelAnimExtraDuration(void){
}
#ifdef SSQC
#ifdef SERVER
void entityRemoveRespawnFlag(CBaseEntity arg_this){
// old way
//arg_this.gflags &= ~GF_CANRESPAWN;
@ -483,20 +483,20 @@ TS_View_PlayAnimation_EndIdle_custom(int iSequence, float fDuration, float fIdle
void TS_Weapons_PlaySoundDirect(player pl, string samp){
// OLD WAY:
#ifdef SERVER
sound( pl, CHAN_WEAPON, samp, 1, ATTN_NORM );
#endif
#ifdef SERVER
sound(pl, CHAN_WEAPON, samp, 1, ATTN_NORM);
#endif
// for now, only server too. Don't really understand how unicast works.
// Nope, not even that works consistently. Serverside only, sometimes it just skips
// playing completely.
/*
#ifdef SSQC
#ifdef SERVER
float flVol = 1.0f;
float flSpeed = 100.0f;
sound( pl, CHAN_WEAPON, samp, flVol, ATTN_NORM, flSpeed, SOUNDFLAG_PLAYER_SHARED, 0 );
#endif
sound(pl, CHAN_WEAPON, samp, flVol, ATTN_NORM, flSpeed, SOUNDFLAG_PLAYER_SHARED, 0);
#endif
*/
}
@ -505,16 +505,16 @@ void TS_Weapons_PlaySoundDirect(player pl, string samp){
void TS_Weapons_PlaySoundChannelDirect(player pl, string samp, int chann){
// OLD WAY:
#ifdef SERVER
sound( pl, chann, samp, 1, ATTN_NORM );
#endif
#ifdef SERVER
sound(pl, chann, samp, 1, ATTN_NORM);
#endif
/*
#ifdef SSQC
#ifdef SERVER
float flVol = 1.0f;
float flSpeed = 100.0f;
sound( pl, chann, samp, flVol, ATTN_NORM, flSpeed, SOUNDFLAG_PLAYER_SHARED, 0 );
#endif
sound(pl, chann, samp, flVol, ATTN_NORM, flSpeed, SOUNDFLAG_PLAYER_SHARED, 0);
#endif
*/
}

View File

@ -436,22 +436,22 @@ typedef struct{
string sIconFilePath; //icon for the inventory and buy menu.
//!!!!!!!!!
BOOLEAN(player localPlayer, weapondynamic_t arg_thisWeapon, BOOLEAN hasAmmo) vOnPrimaryAttack; //Pressed the primary fire button. Typically fires a gun or uses melee.
BOOLEAN(player localPlayer, weapondynamic_t arg_thisWeapon, BOOLEAN hasAmmo) vOnPrimaryAttackRelease;
BOOLEAN(player localPlayer, weapondynamic_t arg_thisWeapon, BOOLEAN hasAmmo) vOnSecondaryAttack; //Pressed the secondary fire button. Typically uses ironsight/scope if available.
BOOLEAN(player localPlayer, weapondynamic_t arg_thisWeapon, BOOLEAN hasAmmo) vOnSecondaryAttackRelease;
BOOL(player pl, weapondynamic_t arg_thisWeapon, BOOL hasAmmo) vOnPrimaryAttack; //Pressed the primary fire button. Typically fires a gun or uses melee.
BOOL(player pl, weapondynamic_t arg_thisWeapon, BOOL hasAmmo) vOnPrimaryAttackRelease;
BOOL(player pl, weapondynamic_t arg_thisWeapon, BOOL hasAmmo) vOnSecondaryAttack; //Pressed the secondary fire button. Typically uses ironsight/scope if available.
BOOL(player pl, weapondynamic_t arg_thisWeapon, BOOL hasAmmo) vOnSecondaryAttackRelease;
void(player localPlayer, weapondynamic_t arg_thisWeapon) vOnEquip; //picked from inventory; now active weapon
BOOLEAN(player localPlayer, weapondynamic_t arg_thisWeapon) vOnUnEquip; //selected a different weapon, use for quick cleanup/resetting. Cleanup. Holster anims themselves not supported or present.
void(player pl, weapondynamic_t arg_thisWeapon) vOnEquip; //picked from inventory; now active weapon
BOOL(player pl, weapondynamic_t arg_thisWeapon) vOnUnEquip; //selected a different weapon, use for quick cleanup/resetting. Cleanup. Holster anims themselves not supported or present.
//Returns whether the current weapon got deleted, which could otherwise be hard to determine.
void(player localPlayer, weapondynamic_t arg_thisWeapon) vOnThink; //Run every frame this weapon is equipped.
void(player pl, weapondynamic_t arg_thisWeapon) vOnThink; //Run every frame this weapon is equipped.
//See if two think methods, for earlier or later (preframe / postframe) are needed.
void(player localPlayer, weapondynamic_t arg_thisWeapon) vOnDrawHUD; //any special behavior for rendering 2D graphics on the player's screen while equipped?
void(player localPlayer, weapondynamic_t arg_thisWeapon) vOnReload; //Called on starting a reload. Sounds to play after a delay?
void(player pl, weapondynamic_t arg_thisWeapon) vOnDrawHUD; //any special behavior for rendering 2D graphics on the player's screen while equipped?
void(player pl, weapondynamic_t arg_thisWeapon) vOnReload; //Called on starting a reload. Sounds to play after a delay?
//This event is for a gun's melee attack, if supported. Actual melee weapons still use PrimaryAttack.
//To see it in The Specialists (original beta 2), use this in console to bind cold cocking to the "c" key:
// bind "c" "+alt2"
void(player localPlayer, weapondynamic_t arg_thisWeapon) vOnColdCock;
void(player pl, weapondynamic_t arg_thisWeapon) vOnColdCock;
//We'll handle firing animations (weapon recoil mainly) in their own methods.
//Little too much going on. Number of animations to cylce through (shoot1, shoot2)?
@ -474,7 +474,7 @@ typedef struct{
//Can crosshairs be custom per weapon? unsure yet.
//I think all weapon lasersights at the same behavor though. Measure distance and change the crosshair a little.
BOOLEAN fDrawCrosshair;
BOOL fDrawCrosshair;
int iBitsUpgrade;
@ -522,18 +522,18 @@ typedef struct{
string sIconFilePath; //icon for the inventory and buy menu.
//!!!!!!!!!
BOOLEAN(player localPlayer, weapondynamic_t arg_thisWeapon, BOOLEAN hasAmmo) vOnPrimaryAttack; //Pressed the primary fire button. Typically fires a gun or uses melee.
BOOLEAN(player localPlayer, weapondynamic_t arg_thisWeapon, BOOLEAN hasAmmo) vOnPrimaryAttackRelease;
BOOLEAN(player localPlayer, weapondynamic_t arg_thisWeapon, BOOLEAN hasAmmo) vOnSecondaryAttack; //Pressed the secondary fire button. Typically uses ironsight/scope if available.
BOOLEAN(player localPlayer, weapondynamic_t arg_thisWeapon, BOOLEAN hasAmmo) vOnSecondaryAttackRelease;
BOOL(player pl, weapondynamic_t arg_thisWeapon, BOOL hasAmmo) vOnPrimaryAttack; //Pressed the primary fire button. Typically fires a gun or uses melee.
BOOL(player pl, weapondynamic_t arg_thisWeapon, BOOL hasAmmo) vOnPrimaryAttackRelease;
BOOL(player pl, weapondynamic_t arg_thisWeapon, BOOL hasAmmo) vOnSecondaryAttack; //Pressed the secondary fire button. Typically uses ironsight/scope if available.
BOOL(player pl, weapondynamic_t arg_thisWeapon, BOOL hasAmmo) vOnSecondaryAttackRelease;
void(player localPlayer, weapondynamic_t arg_thisWeapon) vOnEquip; //picked from inventory; now active weapon
BOOLEAN(player localPlayer, weapondynamic_t arg_thisWeapon) vOnUnEquip; //selected a different weapon, use for quick cleanup/resetting. Cleanup. Holster anims themselves not supported or present.
void(player localPlayer, weapondynamic_t arg_thisWeapon) vOnThink; //Run every frame this weapon is equipped.
void(player pl, weapondynamic_t arg_thisWeapon) vOnEquip; //picked from inventory; now active weapon
BOOL(player pl, weapondynamic_t arg_thisWeapon) vOnUnEquip; //selected a different weapon, use for quick cleanup/resetting. Cleanup. Holster anims themselves not supported or present.
void(player pl, weapondynamic_t arg_thisWeapon) vOnThink; //Run every frame this weapon is equipped.
//See if two think methods, for earlier or later (preframe / postframe) are needed.
void(player localPlayer, weapondynamic_t arg_thisWeapon) vOnDrawHUD; //any special behavior for rendering 2D graphics on the player's screen while equipped?
void(player localPlayer, weapondynamic_t arg_thisWeapon) vOnReload; //Called on starting a reload. Sounds to play after a delay?
void(player localPlayer, weapondynamic_t arg_thisWeapon) vOnColdCock;
void(player pl, weapondynamic_t arg_thisWeapon) vOnDrawHUD; //any special behavior for rendering 2D graphics on the player's screen while equipped?
void(player pl, weapondynamic_t arg_thisWeapon) vOnReload; //Called on starting a reload. Sounds to play after a delay?
void(player pl, weapondynamic_t arg_thisWeapon) vOnColdCock;
//We'll handle firing animations (weapon recoil mainly) in their own methods.
@ -559,7 +559,7 @@ typedef struct{
//Can crosshairs be custom per weapon? unsure yet.
//I think all weapon lasersights at the same behavor though. Measure distance and change the crosshair a little.
BOOLEAN fDrawCrosshair;
BOOL fDrawCrosshair;
int iBitsUpgrade;
@ -630,18 +630,18 @@ typedef struct{
string sIconFilePath; //icon for the inventory and buy menu.
//!!!!!!!!!
BOOLEAN(player localPlayer, weapondynamic_t arg_thisWeapon, BOOLEAN hasAmmo) vOnPrimaryAttack; //Pressed the primary fire button. Typically fires a gun or uses melee.
BOOLEAN(player localPlayer, weapondynamic_t arg_thisWeapon, BOOLEAN hasAmmo) vOnPrimaryAttackRelease;
BOOLEAN(player localPlayer, weapondynamic_t arg_thisWeapon, BOOLEAN hasAmmo) vOnSecondaryAttack; //Pressed the secondary fire button. Typically uses ironsight/scope if available.
BOOLEAN(player localPlayer, weapondynamic_t arg_thisWeapon, BOOLEAN hasAmmo) vOnSecondaryAttackRelease;
BOOL(player pl, weapondynamic_t arg_thisWeapon, BOOL hasAmmo) vOnPrimaryAttack; //Pressed the primary fire button. Typically fires a gun or uses melee.
BOOL(player pl, weapondynamic_t arg_thisWeapon, BOOL hasAmmo) vOnPrimaryAttackRelease;
BOOL(player pl, weapondynamic_t arg_thisWeapon, BOOL hasAmmo) vOnSecondaryAttack; //Pressed the secondary fire button. Typically uses ironsight/scope if available.
BOOL(player pl, weapondynamic_t arg_thisWeapon, BOOL hasAmmo) vOnSecondaryAttackRelease;
void(player localPlayer, weapondynamic_t arg_thisWeapon) vOnEquip; //picked from inventory; now active weapon
BOOLEAN(player localPlayer, weapondynamic_t arg_thisWeapon) vOnUnEquip; //selected a different weapon, use for quick cleanup/resetting. Cleanup. Holster anims themselves not supported or present.
void(player localPlayer, weapondynamic_t arg_thisWeapon) vOnThink; //Run every frame this weapon is equipped.
void(player pl, weapondynamic_t arg_thisWeapon) vOnEquip; //picked from inventory; now active weapon
BOOL(player pl, weapondynamic_t arg_thisWeapon) vOnUnEquip; //selected a different weapon, use for quick cleanup/resetting. Cleanup. Holster anims themselves not supported or present.
void(player pl, weapondynamic_t arg_thisWeapon) vOnThink; //Run every frame this weapon is equipped.
//See if two think methods, for earlier or later (preframe / postframe) are needed.
void(player localPlayer, weapondynamic_t arg_thisWeapon) vOnDrawHUD; //any special behavior for rendering 2D graphics on the player's screen while equipped?
void(player localPlayer, weapondynamic_t arg_thisWeapon) vOnReload; //Called on starting a reload. Sounds to play after a delay?
void(player localPlayer, weapondynamic_t arg_thisWeapon) vOnColdCock;
void(player pl, weapondynamic_t arg_thisWeapon) vOnDrawHUD; //any special behavior for rendering 2D graphics on the player's screen while equipped?
void(player pl, weapondynamic_t arg_thisWeapon) vOnReload; //Called on starting a reload. Sounds to play after a delay?
void(player pl, weapondynamic_t arg_thisWeapon) vOnColdCock;
//We'll handle firing animations (weapon recoil mainly) in our own event methods (vOnWhatever above)
@ -672,7 +672,7 @@ typedef struct{
//Can crosshairs be custom per weapon? unsure yet.
//I think all weapon lasersights at the same behavor though. Measure distance and change the crosshair a little.
BOOLEAN fDrawCrosshair;
BOOL fDrawCrosshair;
int iBitsUpgrade;
@ -730,18 +730,18 @@ typedef struct{
string sIconFilePath; //icon for the inventory and buy menu.
//!!!!!!!!!
BOOLEAN(player localPlayer, weapondynamic_t arg_thisWeapon, BOOLEAN hasAmmo) vOnPrimaryAttack; //Pressed the primary fire button. Typically fires a gun or uses melee.
BOOLEAN(player localPlayer, weapondynamic_t arg_thisWeapon, BOOLEAN hasAmmo) vOnPrimaryAttackRelease;
BOOLEAN(player localPlayer, weapondynamic_t arg_thisWeapon, BOOLEAN hasAmmo) vOnSecondaryAttack; //Pressed the secondary fire button. Typically uses ironsight/scope if available.
BOOLEAN(player localPlayer, weapondynamic_t arg_thisWeapon, BOOLEAN hasAmmo) vOnSecondaryAttackRelease;
BOOL(player pl, weapondynamic_t arg_thisWeapon, BOOL hasAmmo) vOnPrimaryAttack; //Pressed the primary fire button. Typically fires a gun or uses melee.
BOOL(player pl, weapondynamic_t arg_thisWeapon, BOOL hasAmmo) vOnPrimaryAttackRelease;
BOOL(player pl, weapondynamic_t arg_thisWeapon, BOOL hasAmmo) vOnSecondaryAttack; //Pressed the secondary fire button. Typically uses ironsight/scope if available.
BOOL(player pl, weapondynamic_t arg_thisWeapon, BOOL hasAmmo) vOnSecondaryAttackRelease;
void(player localPlayer, weapondynamic_t arg_thisWeapon) vOnEquip; //picked from inventory; now active weapon
BOOLEAN(player localPlayer, weapondynamic_t arg_thisWeapon) vOnUnEquip; //selected a different weapon, use for quick cleanup/resetting. Cleanup. Holster anims themselves not supported or present.
void(player localPlayer, weapondynamic_t arg_thisWeapon) vOnThink; //Run every frame this weapon is equipped.
void(player pl, weapondynamic_t arg_thisWeapon) vOnEquip; //picked from inventory; now active weapon
BOOL(player pl, weapondynamic_t arg_thisWeapon) vOnUnEquip; //selected a different weapon, use for quick cleanup/resetting. Cleanup. Holster anims themselves not supported or present.
void(player pl, weapondynamic_t arg_thisWeapon) vOnThink; //Run every frame this weapon is equipped.
//See if two think methods, for earlier or later (preframe / postframe) are needed.
void(player localPlayer, weapondynamic_t arg_thisWeapon) vOnDrawHUD; //any special behavior for rendering 2D graphics on the player's screen while equipped?
void(player localPlayer, weapondynamic_t arg_thisWeapon) vOnReload; //Called on starting a reload. Sounds to play after a delay?
void(player localPlayer, weapondynamic_t arg_thisWeapon) vOnColdCock;
void(player pl, weapondynamic_t arg_thisWeapon) vOnDrawHUD; //any special behavior for rendering 2D graphics on the player's screen while equipped?
void(player pl, weapondynamic_t arg_thisWeapon) vOnReload; //Called on starting a reload. Sounds to play after a delay?
void(player pl, weapondynamic_t arg_thisWeapon) vOnColdCock;
//We'll handle firing animations (weapon recoil mainly) in their own methods.
//Little too much going on. Number of animations to cylce through (shoot1, shoot2)?
@ -764,7 +764,7 @@ typedef struct{
//Can crosshairs be custom per weapon? unsure yet.
//I think all weapon lasersights at the same behavor though. Measure distance and change the crosshair a little.
BOOLEAN fDrawCrosshair;
BOOL fDrawCrosshair;
int iBitsUpgrade;
@ -804,18 +804,18 @@ typedef struct{
string sIconFilePath; //icon for the inventory and buy menu.
//!!!!!!!!!
BOOLEAN(player localPlayer, weapondynamic_t arg_thisWeapon, BOOLEAN hasAmmo) vOnPrimaryAttack; //Pressed the primary fire button. Typically fires a gun or uses melee.
BOOLEAN(player localPlayer, weapondynamic_t arg_thisWeapon, BOOLEAN hasAmmo) vOnPrimaryAttackRelease;
BOOLEAN(player localPlayer, weapondynamic_t arg_thisWeapon, BOOLEAN hasAmmo) vOnSecondaryAttack; //Pressed the secondary fire button. Typically uses ironsight/scope if available.
BOOLEAN(player localPlayer, weapondynamic_t arg_thisWeapon, BOOLEAN hasAmmo) vOnSecondaryAttackRelease;
BOOL(player pl, weapondynamic_t arg_thisWeapon, BOOL hasAmmo) vOnPrimaryAttack; //Pressed the primary fire button. Typically fires a gun or uses melee.
BOOL(player pl, weapondynamic_t arg_thisWeapon, BOOL hasAmmo) vOnPrimaryAttackRelease;
BOOL(player pl, weapondynamic_t arg_thisWeapon, BOOL hasAmmo) vOnSecondaryAttack; //Pressed the secondary fire button. Typically uses ironsight/scope if available.
BOOL(player pl, weapondynamic_t arg_thisWeapon, BOOL hasAmmo) vOnSecondaryAttackRelease;
void(player localPlayer, weapondynamic_t arg_thisWeapon) vOnEquip; //picked from inventory; now active weapon
BOOLEAN(player localPlayer, weapondynamic_t arg_thisWeapon) vOnUnEquip; //selected a different weapon, use for quick cleanup/resetting. Cleanup. Holster anims themselves not supported or present.
void(player localPlayer, weapondynamic_t arg_thisWeapon) vOnThink; //Run every frame this weapon is equipped.
void(player pl, weapondynamic_t arg_thisWeapon) vOnEquip; //picked from inventory; now active weapon
BOOL(player pl, weapondynamic_t arg_thisWeapon) vOnUnEquip; //selected a different weapon, use for quick cleanup/resetting. Cleanup. Holster anims themselves not supported or present.
void(player pl, weapondynamic_t arg_thisWeapon) vOnThink; //Run every frame this weapon is equipped.
//See if two think methods, for earlier or later (preframe / postframe) are needed.
void(player localPlayer, weapondynamic_t arg_thisWeapon) vOnDrawHUD; //any special behavior for rendering 2D graphics on the player's screen while equipped?
void(player localPlayer, weapondynamic_t arg_thisWeapon) vOnReload; //Called on starting a reload. Sounds to play after a delay?
void(player localPlayer, weapondynamic_t arg_thisWeapon) vOnColdCock;
void(player pl, weapondynamic_t arg_thisWeapon) vOnDrawHUD; //any special behavior for rendering 2D graphics on the player's screen while equipped?
void(player pl, weapondynamic_t arg_thisWeapon) vOnReload; //Called on starting a reload. Sounds to play after a delay?
void(player pl, weapondynamic_t arg_thisWeapon) vOnColdCock;
//We'll handle firing animations (weapon recoil mainly) in their own methods.
@ -839,7 +839,7 @@ typedef struct{
//Can crosshairs be custom per weapon? unsure yet.
//I think all weapon lasersights at the same behavor though. Measure distance and change the crosshair a little.
BOOLEAN fDrawCrosshair;
BOOL fDrawCrosshair;
int iBitsUpgrade;
@ -894,31 +894,31 @@ weapondata_basic_t* ary_akimboUpgradeData[WEAPON_AKIMBO_UPGRADE_ID::LAST_ID];
extern void weapon_base_setWholeAttackDelay(player localPlayer, float amount);
extern void weapon_base_setLeftAttackDelay(player localPlayer, float amount);
extern void weapon_base_setRightAttackDelay(player localPlayer, float amount);
extern void weapon_base_setLeftAttackDelay_AtLeast(player localPlayer, float amount);
extern void weapon_base_setRightAttackDelay_AtLeast(player localPlayer, float amount);
extern void weapon_base_setWholeAttackDelay(player pl, float amount);
extern void weapon_base_setLeftAttackDelay(player pl, float amount);
extern void weapon_base_setRightAttackDelay(player pl, float amount);
extern void weapon_base_setLeftAttackDelay_AtLeast(player pl, float amount);
extern void weapon_base_setRightAttackDelay_AtLeast(player pl, float amount);
extern MELEE_HIT_RESPONSE weapon_base_coldcock(player localPlayer, weapondata_basic_t* basePRef, weapondynamic_t arg_thisWeapon, float damageToDeal, float range );
extern MELEE_HIT_RESPONSE weapon_base_coldcock(player pl, weapondata_basic_t* basePRef, weapondynamic_t arg_thisWeapon, float damageToDeal, float range );
extern void weapon_base_onEquip(player localPlayer, weapondata_basic_t* basePRef, weapondynamic_t arg_thisWeapon);
extern void weapon_base_onEquip(player pl, weapondata_basic_t* basePRef, weapondynamic_t arg_thisWeapon);
extern MELEE_HIT_RESPONSE weapon_base_onPrimaryAttack_melee(player localPlayer, weapondata_basic_t* basePRef, weapondynamic_t arg_thisWeapon, float damageToDeal, float range);
extern MELEE_HIT_RESPONSE weapon_base_onPrimaryAttack_melee_fromCustomDirection(player localPlayer, weapondata_basic_t* basePRef, weapondynamic_t arg_thisWeapon, float damageToDeal, float range, vector customAngle );
extern MELEE_HIT_RESPONSE weapon_base_onPrimaryAttack_melee(player pl, weapondata_basic_t* basePRef, weapondynamic_t arg_thisWeapon, float damageToDeal, float range);
extern MELEE_HIT_RESPONSE weapon_base_onPrimaryAttack_melee_fromCustomDirection(player pl, weapondata_basic_t* basePRef, weapondynamic_t arg_thisWeapon, float damageToDeal, float range, vector customAngle );
extern void weapon_base_onAttack(player localPlayer, weapondata_basic_t* basePRef, weapondynamic_t arg_thisWeapon, int attackTypeUsed);
extern void weapon_base_onAttack_multi(player localPlayer, weapondata_basic_t* basePRef, weapondynamic_t arg_thisWeapon, int shellCount, int attackTypeUsed);
extern void weapon_base_onAttack(player pl, weapondata_basic_t* basePRef, weapondynamic_t arg_thisWeapon, int attackTypeUsed);
extern void weapon_base_onAttack_multi(player pl, weapondata_basic_t* basePRef, weapondynamic_t arg_thisWeapon, int shellCount, int attackTypeUsed);
extern void weapon_base_burstFire(player localPlayer, weapondata_basic_t* basePRef, weapondynamic_t arg_thisWeapon, int attackTypeUsed, int shotCount, float shotDelay);
extern void weapon_base_burstFire(player pl, weapondata_basic_t* basePRef, weapondynamic_t arg_thisWeapon, int attackTypeUsed, int shotCount, float shotDelay);
BOOL weapon_shotgun_onInterrupt(player localPlayer, weapondata_basic_t* basePRef, weapondynamic_t arg_thisWeapon);
void weapon_shotgun_reload(player localPlayer, weapondata_basic_t* basePRef, weapondynamic_t arg_thisWeapon);
void weapon_shotgun_onThink_reloadLogic(player localPlayer, weapondata_gun_t* basePRef, weapondynamic_t arg_thisWeapon);
BOOL weapon_shotgun_onInterrupt(player pl, weapondata_basic_t* basePRef, weapondynamic_t arg_thisWeapon);
void weapon_shotgun_reload(player pl, weapondata_basic_t* basePRef, weapondynamic_t arg_thisWeapon);
void weapon_shotgun_onThink_reloadLogic(player pl, weapondata_gun_t* basePRef, weapondynamic_t arg_thisWeapon);
@ -926,32 +926,32 @@ extern BOOL weapon_akimbo_semiAttackDualHack(player pl, weapondynamic_t arg_this
extern BOOL weapon_akimbo_fullAttackDualHack(player pl, weapondynamic_t arg_thisWeapon, int arg_flagger, int* arg_akimboFireCallback);
extern BOOL weapon_akimbo_AttackDualHack(player pl, weapondynamic_t arg_thisWeapon, int arg_flagger, int* arg_akimboFireCallback);
extern int weapon_akimbo_semiAttackChoice(player localPlayer, weapondata_basic_t* basePRef, weapondynamic_t arg_thisWeapon, int attackTypeUsed);
extern int weapon_akimbo_fullAttackChoice(player localPlayer, weapondata_basic_t* basePRef, weapondynamic_t arg_thisWeapon, int attackTypeUsed);
extern int weapon_akimbo_semiAttackChoice(player pl, weapondata_basic_t* basePRef, weapondynamic_t arg_thisWeapon, int attackTypeUsed);
extern int weapon_akimbo_fullAttackChoice(player pl, weapondata_basic_t* basePRef, weapondynamic_t arg_thisWeapon, int attackTypeUsed);
extern BOOLEAN weapon_ironsight_ToggleIronsight(player localPlayer, weapondata_ironsight_t* basePRef, weapondynamic_t arg_thisWeapon);
extern BOOL weapon_ironsight_ToggleIronsight(player pl, weapondata_ironsight_t* basePRef, weapondynamic_t arg_thisWeapon);
extern void weapon_gun_Reload(player localPlayer, weapondata_gun_t* basePRef, weapondynamic_t arg_thisWeapon );
extern void weapon_gun_Reload_CustomSequence(player localPlayer, weapondata_gun_t* basePRef, weapondynamic_t arg_thisWeapon, int arg_iReloadSeq, float arg_flReloadSeqTime);
extern void weapon_ironsight_Reload(player localPlayer, weapondata_ironsight_t* basePRef, weapondynamic_t arg_thisWeapon );
extern void weapon_gun_Reload(player pl, weapondata_gun_t* basePRef, weapondynamic_t arg_thisWeapon );
extern void weapon_gun_Reload_CustomSequence(player pl, weapondata_gun_t* basePRef, weapondynamic_t arg_thisWeapon, int arg_iReloadSeq, float arg_flReloadSeqTime);
extern void weapon_ironsight_Reload(player pl, weapondata_ironsight_t* basePRef, weapondynamic_t arg_thisWeapon );
extern void weapon_gun_endOfReload(player localPlayer, weapondata_gun_t* basePRef, weapondynamic_t arg_thisWeapon );
extern void weapon_gun_endOfReload(player pl, weapondata_gun_t* basePRef, weapondynamic_t arg_thisWeapon );
extern void weapon_gun_endOfIronSight(player pl, weapondata_gun_t* basePRef, weapondynamic_t arg_thisWeapon);
extern void weapon_gun_onThink(player localPlayer, weapondata_gun_t* basePRef, weapondynamic_t arg_thisWeapon );
extern void weapon_gun_onThink(player pl, weapondata_gun_t* basePRef, weapondynamic_t arg_thisWeapon );
extern void weapon_gun_fireBurstBullet(player localPlayer, weapondata_gun_t* basePRef, weapondynamic_t arg_thisWeapon);
extern void weapon_gun_fireBurstBullet(player pl, weapondata_gun_t* basePRef, weapondynamic_t arg_thisWeapon);
extern void weapon_gun_onThink_burstFireLogic(player localPlayer, weapondata_gun_t* basePRef, weapondynamic_t arg_thisWeapon );
extern void weapon_gun_onThink_burstFireLogic(player pl, weapondata_gun_t* basePRef, weapondynamic_t arg_thisWeapon );
extern void weapon_gun_onDrawHUD(player localPlayer, weapondata_gun_t* basePRef, weapondynamic_t arg_thisWeapon);
extern void weapon_throwable_onDrawHUD(player localPlayer, weapondata_throwable_t* basePRef, weapondynamic_t arg_thisWeapon);
extern void weapon_melee_onDrawHUD(player localPlayer, weapondata_melee_t* basePRef, weapondynamic_t arg_thisWeapon);
extern void weapon_gun_onDrawHUD(player pl, weapondata_gun_t* basePRef, weapondynamic_t arg_thisWeapon);
extern void weapon_throwable_onDrawHUD(player pl, weapondata_throwable_t* basePRef, weapondynamic_t arg_thisWeapon);
extern void weapon_melee_onDrawHUD(player pl, weapondata_melee_t* basePRef, weapondynamic_t arg_thisWeapon);
extern void setupWeaponData(void);

File diff suppressed because it is too large Load Diff

View File

@ -196,9 +196,9 @@ w_benellim3_primary(void)
TS_Weapons_PlaySoundChannelDirect(pl, "weapons/m3/m3-pump.wav", CHAN_AUTO);
// these pumps eject shells
#ifdef CLIENT
#ifdef CLIENT
View_AddEvent(w_ejectshell_pistol, 0.0f);
#endif
#endif
randomChoice = random();
if(randomChoice > 0.5){
@ -227,16 +227,16 @@ w_benellim3_primary(void)
TS_Weapons_ViewAnimation(weaponseq_benellim3::shootpump, (31.0f/35.0f) );
// no shell! Pumping does that here.
pl.shotgunWaitingForPump = TRUE;
#ifdef CLIENT
#ifdef CLIENT
View_ShowMuzzleflash(MUZZLE_SMALL);
// no shell, that comes in the pump soon after.
#endif
#endif
}else{
TS_Weapons_ViewAnimation(weaponseq_benellim3::shootsemi, (31.0f/35.0f) );
#ifdef CLIENT
#ifdef CLIENT
View_ShowMuzzleflash(MUZZLE_SMALL);
View_AddEvent(w_ejectshell_pistol, 0.0f);
#endif
#endif
}
weapon_base_onAttack_multi(pl, ary_weaponData[WEAPON_ID::BenelliM3], arg_thisWeapon, 8, BITS_AKIMBOCHOICE_LEFT);

View File

@ -177,7 +177,7 @@ w_combatknife_primary(void)
MELEE_HIT_RESPONSE theReaper = weapon_base_onPrimaryAttack_melee(pl, ary_weaponData[WEAPON_ID::CombatKnife], arg_thisWeapon, baseRef.fAttackDamage, 58);
// Only the server is doing traces so far to get results for this to be worth checking.
#ifdef SSQC
#ifdef SERVER
//printfline("melee hit reponse: %d soft? %d", theReaper, (theReaper==MELEE_HIT_RESPONSE::SOFT));
if (theReaper == MELEE_HIT_RESPONSE::NONE ) {
TS_Weapons_PlaySoundDirect(pl, "weapons/knife/knife_miss.wav");
@ -230,7 +230,7 @@ w_combatknife_secondary(void)
pl.updateSlotCountsForEquippedWeapon();
arg_thisWeapon.forceBodygroup1Submodel = 1; //reset, new knife is not bloody.
TS_Weapons_PlaySoundDirect(pl, "weapons/knife/knife_miss.wav");
#ifdef SSQC
#ifdef SERVER
TSThrownProjectile::generate2(pl, arg_thisWeapon);
#endif
}

View File

@ -169,7 +169,7 @@ w_karate_primary(void)
//pl.fUncrouchBlockDelay = time + 1.0f;
#ifdef SERVER
#ifdef SERVER
// need the fleshhit sound
if (theReaper == MELEE_HIT_RESPONSE::NONE ) {
TS_Weapons_PlaySoundDirect(pl, "player/closecombat.wav");
@ -180,7 +180,7 @@ w_karate_primary(void)
}else if(theReaper == MELEE_HIT_RESPONSE::FLESH){
TS_Weapons_PlaySoundDirect(pl, "player/kungfuhit.wav");
}
#endif
#endif
//Animation_ShootWeapon( self );
pl.fKarateStamina = bound(0, pl.fKarateStamina - 0.085, 1);
@ -209,6 +209,7 @@ w_karate_primary(void)
// moved to a method so that early termination does not stop too much.
void w_karate_determineSecondaryAttack(MELEE_HIT_RESPONSE* theReaper, int* meleeAnimToPlay){
player pl = (player)self;
@ -235,11 +236,11 @@ void w_karate_determineSecondaryAttack(MELEE_HIT_RESPONSE* theReaper, int* melee
if( !(input_buttons&INPUT_BUTTON7) && curSpeed > myMaxSpeed * 0.92 ) {
makevectors(pl.v_angle);
makevectors(GET_VIEW_ANGLES);
vector _2d_dir = normalize([v_forward.x, v_forward.y, 0]);
vector velocity_dir = normalize(pl.velocity);
if(dotproduct(_2d_dir, velocity_dir) <= -0.7 && pl.v_angle.x >= -55 && pl.v_angle.x <= 55){
if(dotproduct(_2d_dir, velocity_dir) <= -0.7 && GET_VIEW_ANGLES.x >= -55 && GET_VIEW_ANGLES.x <= 55){
// moving back-kick
(*meleeAnimToPlay) = 2;
(*theReaper) = weapon_base_onPrimaryAttack_melee_fromCustomDirection(pl, ary_weaponData[WEAPON_ID::Katana], arg_thisWeapon, 30 * pl.fKarateStamina, 76, -v_forward);
@ -262,9 +263,9 @@ void w_karate_determineSecondaryAttack(MELEE_HIT_RESPONSE* theReaper, int* melee
return;
}
if(input_movevalues.x < -40 && pl.v_angle.x >= -55 && pl.v_angle.x <= 55){
if(input_movevalues.x < -40 && GET_VIEW_ANGLES.x >= -55 && GET_VIEW_ANGLES.x <= 55){
//standing back-kick.
makevectors(pl.v_angle);
makevectors(GET_VIEW_ANGLES);
(*meleeAnimToPlay) = 2;
(*theReaper) = weapon_base_onPrimaryAttack_melee_fromCustomDirection(pl, ary_weaponData[WEAPON_ID::Katana], arg_thisWeapon, 30 * pl.fKarateStamina, 74, -v_forward);
weapon_base_setWholeAttackDelay(pl, 1);
@ -316,7 +317,7 @@ w_karate_secondary(void)
//pl.fUncrouchBlockDelay = time + 1.0f;
//Animation_ShootWeapon( self );
#ifdef SERVER
#ifdef SERVER
// need the fleshhit sound
if (theReaper == MELEE_HIT_RESPONSE::NONE ) {
TS_Weapons_PlaySoundDirect(pl, "player/closecombat.wav");
@ -327,7 +328,7 @@ w_karate_secondary(void)
}else if(theReaper == MELEE_HIT_RESPONSE::FLESH){
TS_Weapons_PlaySoundDirect(pl, "player/kungfuhit.wav");
}
#endif
#endif
if(meleeAnimToPlay == 0){
@ -393,7 +394,7 @@ w_karate_aimanim(void)
void
w_karate_hud(void)
{
#ifdef CSQC
#ifdef CLIENT
vector clrDraw;
player pl = (player)self;
weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex];

View File

@ -167,9 +167,9 @@ w_katana_primary(void)
/*
// ??? Why was this here, did original TS do this noise on crouch-attacks in particular?
#ifdef CLIENT
#ifdef CLIENT
TS_Weapons_PlaySoundDirect(pl, "player/closecombat.wav");
#endif
#endif
*/
weapon_base_setWholeAttackDelay(pl, 0.70);
@ -177,12 +177,12 @@ w_katana_primary(void)
pl.fUncrouchBlockDelay = time + 1.0f;
}else{
//Check. Are we moving backwards, enough?? And not looking up/down too far?
if(input_movevalues.x < -40 && pl.v_angle.x >= -55 && pl.v_angle.x <= 55){
if(input_movevalues.x < -40 && GET_VIEW_ANGLES.x >= -55 && GET_VIEW_ANGLES.x <= 55){
//okay!
pl.iMeleeCycler = 0;
meleeAnimToPlay = 2;
makevectors( pl.v_angle );
makevectors( GET_VIEW_ANGLES );
theReaper = weapon_base_onPrimaryAttack_melee_fromCustomDirection(pl, ary_weaponData[WEAPON_ID::Katana], arg_thisWeapon, 80, 74, -v_forward);
weapon_base_setWholeAttackDelay(pl, 0.75);
@ -202,7 +202,7 @@ w_katana_primary(void)
// Don't check 'theReaper' client side, ray-checks to see what was hit are
// ineffective there
#ifdef SERVER
#ifdef SERVER
if (theReaper == MELEE_HIT_RESPONSE::NONE ) {
randomChoice = randomInRange_i(0, 1);
if(randomChoice == 0){
@ -224,7 +224,7 @@ w_katana_primary(void)
TS_Weapons_PlaySoundDirect(pl, "weapons/katana/hit-body.wav");
}
#endif
#endif
if(meleeAnimToPlay == 0){

View File

@ -227,13 +227,13 @@ w_m16a4_primary(void)
if(arg_thisWeapon.iFireMode == BITS_FIREMODE_BURST)
{
/*
#ifdef SSQC
#ifdef SERVER
weapon_base_burstFire(pl, ary_weaponData[WEAPON_ID::M16A4], arg_thisWeapon, BITS_AKIMBOCHOICE_LEFT, 3, 0.11);
// signal for server logic... for now.
return FALSE;
#else
#else
weapon_base_onAttack(pl, ary_weaponData[WEAPON_ID::M16A4], arg_thisWeapon, BITS_AKIMBOCHOICE_LEFT);
#endif
#endif
*/
weapon_base_burstFire(pl, ary_weaponData[WEAPON_ID::M16A4], arg_thisWeapon, BITS_AKIMBOCHOICE_LEFT, 3, 0.02);

View File

@ -36,24 +36,23 @@ BOOLEAN weapon_M61Grenade_onUnEquip(player localPlayer, weapondynamic_t arg_this
//Serverside only method, generates an entity
#ifdef SSQC
#ifdef SERVER
static void weapon_M61Grenade_Touch( void );
static void weapon_M61Grenade_Explode( void );
void weapon_M61Grenade_spawnProjectile(player localPlayer, weapondynamic_t arg_thisWeapon, BOOL wasToss, float heldDuration){
player pl = localPlayer;
void weapon_M61Grenade_spawnProjectile(player pl, weapondynamic_t arg_thisWeapon, BOOL wasToss, float heldDuration){
weapondata_throwable_t basicRef = *((weapondata_throwable_t*)ary_weaponData[WEAPON_ID::M61Grenade]);
makevectors( localPlayer.v_angle );
makevectors( GET_VIEW_ANGLES );
entity eNade = spawn();
setorigin( eNade, ( localPlayer.origin + localPlayer.view_ofs ) + ( v_forward * 16 ) );
setorigin( eNade, ( pl.origin + pl.view_ofs ) + ( v_forward * 16 ) );
setmodel( eNade, basicRef.sWorldModelPath );
setsize( eNade, '-1 -1 -1', '1 1 1' );
vector vDir = aim ( localPlayer, 100000 );
eNade.owner = localPlayer;
vector vDir = aim ( pl, 100000 );
eNade.owner = pl;
eNade.classname = "remove_me";
eNade.solid = SOLID_TRIGGER; // This is so grenades will not get slowed down by windows they touch
eNade.angles = vectoangles( vDir );
@ -171,9 +170,9 @@ void weapon_M61Grenade_onThink(player localPlayer, weapondynamic_t arg_thisWeapo
pl.updateSlotCountsForEquippedWeapon();
pl.grenadeSpawnTime = -1;
#ifdef SERVER
#ifdef SERVER
weapon_M61Grenade_spawnProjectile(localPlayer, arg_thisWeapon, pl.grenadeToss, pl.grenadeHeldDuration);
#endif
#endif
}
}

View File

@ -212,9 +212,9 @@ w_mossberg500_primary(void)
TS_Weapons_PlaySoundChannelDirect(pl, "weapons/m3/m3-pump.wav", CHAN_AUTO);
// these pumps eject shells
#ifdef CLIENT
#ifdef CLIENT
View_AddEvent(w_ejectshell_pistol, 0.0f);
#endif
#endif
if(!arg_thisWeapon.iIronSight){
TS_Weapons_ViewAnimation(weaponseq_mossberg500::pump, 31.0f/35.0f);
@ -252,10 +252,10 @@ w_mossberg500_primary(void)
// no shell! Pumping does that here.
pl.shotgunWaitingForPump = TRUE;
#ifdef CLIENT
#ifdef CLIENT
View_ShowMuzzleflash(MUZZLE_SMALL);
// no shell, that comes in the pump soon after.
#endif
#endif
//}
weapon_base_onAttack_multi(pl, ary_weaponData[WEAPON_ID::Mossberg500], arg_thisWeapon, 8, BITS_AKIMBOCHOICE_LEFT);

View File

@ -149,7 +149,7 @@ w_sealknife_primary(void)
MELEE_HIT_RESPONSE theReaper = weapon_base_onPrimaryAttack_melee(pl, ary_weaponData[WEAPON_ID::SealKnife], arg_thisWeapon, baseRef.fAttackDamage, 55);
// Only the server is doing traces so far to get results for this to be worth checking.
#ifdef SSQC
#ifdef SERVER
//printfline("melee hit reponse: %d soft? %d", theReaper, (theReaper==MELEE_HIT_RESPONSE::SOFT));
if (theReaper == MELEE_HIT_RESPONSE::NONE ) {
TS_Weapons_PlaySoundDirect(pl, "weapons/knife/knife_miss.wav");
@ -203,7 +203,7 @@ w_sealknife_secondary(void)
pl.updateSlotCountsForEquippedWeapon();
arg_thisWeapon.forceBodygroup1Submodel = 1; //reset, new knife is not bloody.
TS_Weapons_PlaySoundDirect(pl, "weapons/knife/knife_miss.wav", 1);
#ifdef SSQC
#ifdef SERVER
TSThrownProjectile::generate2(pl, arg_thisWeapon);
#endif
}

View File

@ -199,9 +199,9 @@ w_spas12_primary(void)
TS_Weapons_PlaySoundChannelDirect(pl, "weapons/spas12/spas12-pump.wav", CHAN_AUTO);
// these pumps eject shells
#ifdef CLIENT
#ifdef CLIENT
View_AddEvent(w_ejectshell_pistol, 0.0f);
#endif
#endif
randomChoice = random();
if(randomChoice > 0.5){
@ -229,16 +229,16 @@ w_spas12_primary(void)
TS_Weapons_ViewAnimation(weaponseq_spas12::shootpump, (31.0f/35.0f) );
// no shell! Pumping does that here.
pl.shotgunWaitingForPump = TRUE;
#ifdef CLIENT
#ifdef CLIENT
View_ShowMuzzleflash(MUZZLE_SMALL);
// no shell, that comes in the pump soon after.
#endif
#endif
}else{
TS_Weapons_ViewAnimation(weaponseq_spas12::shootsemi, (31.0f/35.0f) );
#ifdef CLIENT
#ifdef CLIENT
View_ShowMuzzleflash(MUZZLE_SMALL);
View_AddEvent(w_ejectshell_pistol, 0.0f);
#endif
#endif
}
weapon_base_onAttack_multi(pl, ary_weaponData[WEAPON_ID::SPAS12], arg_thisWeapon, 8, BITS_AKIMBOCHOICE_LEFT);