Added impulse 100, also known as the flashlight

This commit is contained in:
Marco Cawthorne 2019-03-01 23:24:46 +01:00
parent 29ebe5775e
commit 0fd206bc2f
11 changed files with 84 additions and 34 deletions

View file

@ -177,6 +177,12 @@ void CSQC_UpdateView(float w, float h, float focus)
View_DrawViewModel();
}
// TODO: Move this someplace less... entry-ish. like into a pre-draw.
if (pl.flags & FL_FLASHLIGHT) {
traceline(getproperty(VF_ORIGIN), getproperty(VF_ORIGIN) + (v_forward * 9000), FALSE, self);
dynamiclight_add(trace_endpos, 128, [1,1,1]);
}
addentities(MASK_ENGINE);
setproperty(VF_MIN, video_mins);
setproperty(VF_SIZE, video_res);
@ -196,6 +202,7 @@ void CSQC_UpdateView(float w, float h, float focus)
View_DropPunchAngle();
Fade_Update((int)video_mins[0],(int)video_mins[1], (int)w, (int)h);
#ifdef CSTRIKE
Cstrike_PostDraw((int)video_mins[0],(int)video_mins[1], (int)w, (int)h);
#endif

View file

@ -34,10 +34,29 @@ const vector VEC_PLAYER_CVIEWPOS = [0,0,12];
#define INPUT_BUTTON7 0x00000040
#define INPUT_BUTTON8 0x00000080
#define FL_USERELEASED (1<<13)
#define FL_CROUCHING (1<<19)
#define FL_SEMI_TOGGLED (1<<15)
#define FL_FROZEN (1<<17)
// engine reserved flags
#define FL_FLY (1<<0)
#define FL_SWIM (1<<1)
#define FL_GLIMPSE (1<<2)
#define FL_CLIENT (1<<3)
#define FL_INWATER (1<<4)
#define FL_MONSTER (1<<5)
#define FL_GODMODE (1<<6)
#define FL_NOTARGET (1<<7)
#define FL_ITEM (1<<8)
#define FL_ONGROUND (1<<9)
#define FL_PARTIALGROUND (1<<10)
#define FL_WATERJUMP (1<<11)
#define FL_JUMPRELEASED (1<<12)
#define FL_FINDABLE_NONSOLID (1<<14)
#define FLQW_LAGGEDMOVE (1<<16)
// FreeCS flags
#define FL_USERELEASED (1<<17)
#define FL_REMOVEME (1<<18)
#define FL_CROUCHING (1<<19)
#define FL_SEMI_TOGGLED (1<<20)
#define FL_FROZEN (1<<21)
#define FL_FLASHLIGHT (1<<21)
#define clamp(d,min,max) bound(min,d,max)

View file

@ -33,9 +33,5 @@ string Util_FixModel(string mdl)
// Kill the first /
newpath = substring(newpath, 1, strlen(newpath)-1);
#if 1
return newpath;
#else
return mdl;
#endif
}

View file

@ -6,7 +6,6 @@
*
****/
void Empty(void) {}
void Game_ClientConnect(void)

View file

@ -31,6 +31,15 @@ void Game_Input(void)
Player_UseUp();
}
if (self.impulse == 100) {
if (self.flags & FL_FLASHLIGHT) {
self.flags &= ~FL_FLASHLIGHT;
} else {
self.flags |= FL_FLASHLIGHT;
}
sound (self, CHAN_ITEM, "items/flashlight1.wav", 1, ATTN_IDLE);
}
if (cvar("sv_cheats") == 1) {
player pl = (player)self;
if (self.impulse == 101) {

View file

@ -1,23 +1,43 @@
/***
*
* Copyright (c) 2016-2019 Marco 'eukara' Hladik. All rights reserved.
*
* See the file LICENSE attached with the sources for usage details.
*
****/
/* These are stored in the bitflag field */
enumflags
{
ITEM_CROWBAR,
ITEM_GLOCK,
ITEM_PYTHON,
ITEM_MP5,
ITEM_CROSSBOW,
ITEM_SHOTGUN,
ITEM_RPG,
ITEM_GAUSS,
ITEM_EGON,
ITEM_HORNETGUN,
ITEM_HANDGRENADE,
ITEM_TRIPMINE,
ITEM_SATCHEL,
ITEM_SNARK,
ITEM_SUIT,
ITEM_LONGJUMP,
ITEM_HEALTHKIT,
ITEM_BATTERY
};
#define ITEM_CROWBAR 0x00000001
#define ITEM_GLOCK 0x00000002
#define ITEM_PYTHON 0x00000004
#define ITEM_MP5 0x00000008
#define ITEM_CROSSBOW 0x00000010
#define ITEM_SHOTGUN 0x00000020
#define ITEM_RPG 0x00000040
#define ITEM_GAUSS 0x00000080
#define ITEM_EGON 0x00000100
#define ITEM_HORNETGUN 0x00000200
#define ITEM_HANDGRENADE 0x00000400
#define ITEM_TRIPMINE 0x00000800
#define ITEM_SATCHEL 0x00001000
#define ITEM_SNARK 0x00002000
#define ITEM_SUIT 0x00004000
#define ITEM_LONGJUMP 0x00008000
#define ITEM_HEALTHKIT 0x00010000
#define ITEM_BATTERY 0x00020000
#define ITEM_UNUSED19 0x00040000
#define ITEM_UNUSED20 0x00080000
#define ITEM_UNUSED21 0x00100000
#define ITEM_UNUSED22 0x00200000
#define ITEM_UNUSED23 0x00400000
#define ITEM_UNUSED24 0x00800000
#define ITEM_UNUSED25 0x01000000
#define ITEM_UNUSED26 0x02000000
#define ITEM_UNUSED27 0x04000000
#define ITEM_UNUSED28 0x08000000
#define ITEM_UNUSED29 0x10000000
#define ITEM_UNUSED30 0x20000000
#define ITEM_UNUSED31 0x40000000
#define ITEM_UNUSED32 0x80000000

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.