#include "wall.qh"
+ #include "_all.qh"
+
+ #include "bgmscript.qh"
+
+ #include "../common/util.qh"
+
+ #include "../csqcmodellib/interpolate.qh"
+
+ .float alpha;
+ .float scale;
+ .vector movedir;
+void Ent_Wall_PreDraw()
+{
+ if (self.inactive)
+ {
+ self.alpha = 0;
+ }
+ else
+ {
+ vector org;
+ org = getpropertyvec(VF_ORIGIN);
+ if(!checkpvs(org, self))
+ self.alpha = 0;
+ else if(self.fade_start || self.fade_end) {
+ vector offset = '0 0 0';
+ offset_z = self.fade_vertical_offset;
+ float player_dist = vlen(org - self.origin - 0.5 * (self.mins + self.maxs) + offset);
+ if (self.fade_end == self.fade_start)
+ {
+ if (player_dist >= self.fade_start)
+ self.alpha = 0;
+ else
+ self.alpha = 1;
+ }
+ else
+ {
+ self.alpha = (self.alpha_min + self.alpha_max * bound(0,
+ (self.fade_end - player_dist)
+ / (self.fade_end - self.fade_start), 1)) / 100.0;
+ }
+ }
+ else
+ {
+ self.alpha = 1;
+ }
+ }
+ if(self.alpha <= 0)
+ self.drawmask = 0;
+ else
+ self.drawmask = MASK_NORMAL;
+}
+
void Ent_Wall_Draw()
{
float f;
fld = angles;
else
fld = origin;
- self.fld = self.saved;
+ self.(fld) = self.saved;
if(self.lodmodelindex1)
{
InterpolateOrigin_Do();
- self.saved = self.fld;
+ self.saved = self.(fld);
- f = BGMScript(self);
+ f = doBGMScript(self);
if(f >= 0)
{
if(self.lip < 0) // < 0: alpha goes from 1 to 1-|lip| when toggled (toggling subtracts lip)
self.alpha = 1 + self.lip * f;
else // > 0: alpha goes from 1-|lip| to 1 when toggled (toggling adds lip)
self.alpha = 1 - self.lip * (1 - f);
- self.fld = self.fld + self.movedir * f;
+ self.(fld) = self.(fld) + self.movedir * f;
}
else
self.alpha = 1;
fld = angles;
else
fld = origin;
- self.fld = self.saved;
+ self.(fld) = self.saved;
f = ReadByte();
self.movedir_z = ReadCoord();
self.lip = ReadByte() / 255.0;
}
+ self.fade_start = ReadShort();
+ self.fade_end = ReadShort();
+ self.alpha_max = ReadShort();
+ self.alpha_min = ReadShort();
+ self.inactive = ReadShort();
+ self.fade_vertical_offset = ReadShort();
BGMScript_InitEntity(self);
}
InterpolateOrigin_Note();
- self.saved = self.fld;
+ self.saved = self.(fld);
self.entremove = Ent_Wall_Remove;
self.draw = Ent_Wall_Draw;
+ self.predraw = Ent_Wall_PreDraw;
}
#ifndef WALL_H
#define WALL_H
- .float lip;
- .float bgmscriptangular;
- .int lodmodelindex0, lodmodelindex1, lodmodelindex2;
- .float loddistance1, loddistance2;
- .vector saved;
+ entityclass(Wall);
+ class(Wall) .float lip;
+ class(Wall) .float bgmscriptangular;
+ class(Wall) .int lodmodelindex0, lodmodelindex1, lodmodelindex2;
+ class(Wall) .float loddistance1, loddistance2;
+ class(Wall) .vector saved;
+// Needed for interactive clientwalls
+.float inactive; // Clientwall disappears when inactive
+.float alpha_max, alpha_min;
+// If fade_start > fade_end, fadeout will be inverted
+// fade_vertical_offset is a vertival offset for player position
+.float fade_start, fade_end, fade_vertical_offset;
+.float default_solid;
+// This variable will be set by trigger
+.float antiwall_flag;
+
void Ent_Wall_Draw();
void Ent_Wall_Remove();
#ifndef SERVER_DEFS_H
#define SERVER_DEFS_H
- #include "../common/weapons/weapons.qh"
+ #include "../common/weapons/all.qh"
#define INDEPENDENT_ATTACK_FINISHED
.string platmovetype;
.float platmovetype_start, platmovetype_end;
+
+// Needed for dynamic clientwalls
+.float inactive; // Clientwall disappears when inactive
+.float alpha_max, alpha_min;
+.float fade_start, fade_end, fade_vertical_offset;
+.float default_solid; // Variable to store default self.solid for clientwalls
+
.string killtarget;
.vector pos1, pos2;
.entity flagcarried;
- .float playerid;
+ .int playerid;
float playerid_last;
.float noalign; // if set to 1, the item or spawnpoint won't be dropped to the floor
.float version_nagtime;
const int NUM_JUMPPADSUSED = 3;
- .float jumppadcount;
+ .int jumppadcount;
.entity jumppadsused[NUM_JUMPPADSUSED];
string gamemode_name;
.float Version;
.int SendFlags;
- .float(entity to, float sendflags) SendEntity;
+ .bool(entity to, int sendflags) SendEntity;
// player sounds, voice messages
// TODO implemented fall and falling
.float stat_sv_airspeedlimit_nonqw;
.float stat_sv_maxspeed;
+ // new properties
+ .float stat_sv_jumpvelocity;
+ .float stat_sv_airaccel_qw_stretchfactor;
+ .float stat_sv_maxairstrafespeed;
+ .float stat_sv_maxairspeed;
+ .float stat_sv_airstrafeaccelerate;
+ .float stat_sv_warsowbunny_turnaccel;
+ .float stat_sv_airaccel_sideways_friction;
+ .float stat_sv_aircontrol;
+ .float stat_sv_aircontrol_power;
+ .float stat_sv_aircontrol_penalty;
+ .float stat_sv_warsowbunny_airforwardaccel;
+ .float stat_sv_warsowbunny_topspeed;
+ .float stat_sv_warsowbunny_accel;
+ .float stat_sv_warsowbunny_backtosideratio;
+ .float stat_sv_friction;
+ .float stat_sv_accelerate;
+ .float stat_sv_stopspeed;
+ .float stat_sv_airaccelerate;
+ .float stat_sv_airstopaccelerate;
+
+ .string cvar_cl_physics;
+
void W_Porto_Remove (entity p);
.int projectiledeathtype;
.float stat_leadlimit;
- float radar_showennemies;
+ bool radar_showennemies;
#ifdef PROFILING
float client_cefc_accumulator;
#endif
.float weapon_load[WEP_MAXCOUNT];
- .float ammo_none; // used by the reloading system, must always be 0
+ .int ammo_none; // used by the reloading system, must always be 0
.float clip_load;
.float old_clip_load;
.float clip_size;
.float vortex_chargepool_ammo;
.float hagar_load;
- .float grab; // 0 = can't grab, 1 = owner can grab, 2 = owner and team mates can grab, 3 = anyone can grab
+ .int grab; // 0 = can't grab, 1 = owner can grab, 2 = owner and team mates can grab, 3 = anyone can grab
#define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_CORPSE; (e).dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE
// when doing this, hagar can go through clones
- #if defined(CSQC)
- #elif defined(MENUQC)
- #elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
- #include "../common/constants.qh"
- #include "autocvars.qh"
- #include "constants.qh"
- #include "defs.qh"
- #include "../csqcmodellib/sv_model.qh"
- #endif
+ #include "_all.qh"
+
+ #include "g_subs.qh"
+ #include "g_triggers.qh"
+
+ #include "../common/constants.qh"
+ #include "../csqcmodellib/sv_model.qh"
.float modelscale;
void g_clientmodel_setcolormaptoactivator (void)
{
g_model_setcolormaptoactivator();
- self.SendFlags |= 1;
+ self.SendFlags |= 9;
+}
+
+void g_clientmodel_use(void)
+{
+ if (self.antiwall_flag == 1)
+ {
+ self.inactive = 1;
+ self.solid = SOLID_NOT;
+ }
+ else if (self.antiwall_flag == 2)
+ {
+ self.inactive = 0;
+ self.solid = self.default_solid;
+ }
+ g_clientmodel_setcolormaptoactivator();
}
void g_model_dropbyspawnflags()
self.SendFlags |= 2;
}
- float g_clientmodel_genericsendentity (entity to, float sf)
+ float g_clientmodel_genericsendentity (entity to, int sf)
{
sf = sf & 0x0F;
if(self.angles != '0 0 0')
sf |= 0x10;
- if(self.solid && (self.mins != '0 0 0' || self.maxs != '0 0 0'))
+ if(self.mins != '0 0 0' || self.maxs != '0 0 0')
sf |= 0x20;
if(self.colormap != 0)
sf |= 0x40;
WriteCoord(MSG_ENTITY, self.movedir.z);
WriteByte(MSG_ENTITY, floor(self.lip * 255));
}
+ WriteShort(MSG_ENTITY, self.fade_start);
+ WriteShort(MSG_ENTITY, self.fade_end);
+ WriteShort(MSG_ENTITY, self.alpha_max);
+ WriteShort(MSG_ENTITY, self.alpha_min);
+ WriteShort(MSG_ENTITY, self.inactive);
+ WriteShort(MSG_ENTITY, self.fade_vertical_offset);
}
return true;
if(self.geomtype) if(autocvar_physics_ode && checkextension("DP_PHYSICS_ODE")) self.movetype = MOVETYPE_PHYSICS; \
if(!self.scale) self.scale = self.modelscale; \
SetBrushEntityModel(); \
- self.use = g_clientmodel_setcolormaptoactivator; \
+ self.use = g_clientmodel_use; \
InitializeEntity(self, g_clientmodel_dropbyspawnflags, INITPRIO_DROPTOFLOOR); \
if(!self.solid) self.solid = (sol); else if(self.solid < 0) self.solid = SOLID_NOT; \
if(!self.bgmscriptsustain) self.bgmscriptsustain = 1; else if(self.bgmscriptsustain < 0) self.bgmscriptsustain = 0; \
- Net_LinkEntity(self, true, 0, g_clientmodel_genericsendentity);
+ Net_LinkEntity(self, true, 0, g_clientmodel_genericsendentity); \
+ self.default_solid = sol;
// non-solid model entities:
void spawnfunc_misc_gamemodel() { self.angles_x = -self.angles.x; G_MODEL_INIT (SOLID_NOT) } // model entity
#include "g_triggers.qh"
+ #include "_all.qh"
+
+ #include "weapons/csqcprojectile.qh"
+ #include "../common/deathtypes.qh"
+ #include "../warpzonelib/util_server.qh"
+ #include "g_subs.qh"
#include "t_jumppads.qh"
void SUB_DontUseTargets()
}
if (s != "")
{
+ // Flag to set func_clientwall state
+ // 1 == deactivate, 2 == activate, 0 == do nothing
+ float aw_flag = self.antiwall_flag;
for(t = world; (t = find(t, targetname, s)); )
if(t.use)
{
}
else
{
+ if (t.classname == "func_clientwall" || t.classname == "func_clientillusionary")
+ t.antiwall_flag = aw_flag;
self = t;
other = stemp;
activator = act;
sample = GetVoiceMessageSampleField(substring(self.noise, 1, -1));
if(GetPlayerSoundSampleField_notFound)
snd = "misc/null.wav";
- else if(activator.sample == "")
+ else if (activator.(sample) == "")
snd = "misc/null.wav";
else
{
- tokenize_console(activator.sample);
+ tokenize_console(activator.(sample));
float n;
n = stof(argv(1));
if(n > 0)
sample = GetVoiceMessageSampleField(substring(self.noise, 1, -1));
if(GetPlayerSoundSampleField_notFound)
snd = "misc/null.wav";
- else if(activator.sample == "")
+ else if (activator.(sample) == "")
snd = "misc/null.wav";
else
{
- tokenize_console(activator.sample);
+ tokenize_console(activator.(sample));
float n;
n = stof(argv(1));
if(n > 0)
spawnfunc_func_pointparticles();
}
- float rainsnow_SendEntity(entity to, float sf)
+ float rainsnow_SendEntity(entity to, int sf)
{
WriteByte(MSG_ENTITY, ENT_CLIENT_RAINSNOW);
WriteByte(MSG_ENTITY, self.state);
void spawnfunc_func_sparks();
- float rainsnow_SendEntity(entity to, float sf);
+ float rainsnow_SendEntity(entity to, int sf);
/*QUAKED spawnfunc_func_rain (0 .5 .8) ?
This is an invisible area like a trigger, which rain falls inside of.
void spawnfunc_target_changelevel_use();
void spawnfunc_target_changelevel();
+
+.float antiwall_flag; // Variable to define what to do with func_clientwall
+// 0 == do nothing, 1 == deactivate, 2 == activate
+
#endif