#endif
}
- if ( IS_REAL_CLIENT(toucher) || IS_VEHICLE(toucher) || IS_MONSTER(toucher) )
+ if ( IS_REAL_CLIENT(toucher) && !IS_VEHICLE(toucher) )
{
entity show_tint = (IS_VEHICLE(toucher)) ? toucher.owner : toucher;
STAT(ENTRAP_ORB, show_tint) = time + 0.1;
}
- if ( IS_REAL_CLIENT(toucher) || IS_VEHICLE(toucher) )
+ if ( IS_REAL_CLIENT(toucher) && !IS_VEHICLE(toucher) )
{
entity show_red = (IS_VEHICLE(toucher)) ? toucher.owner : toucher;
- STAT(HEALING_ORB, show_red) = time+0.1;
+ STAT(HEALING_ORB, show_red) = time + 0.1;
STAT(HEALING_ORB_ALPHA, show_red) = 0.75 * (this.ltime - time) / this.orb_lifetime;
}
}
void nade_veil_touch(entity this, entity toucher)
{
- if ( IS_REAL_CLIENT(toucher) || IS_VEHICLE(toucher) || IS_MONSTER(toucher) )
+ if ( IS_REAL_CLIENT(toucher) && !IS_VEHICLE(toucher) )
{
entity show_tint = (IS_VEHICLE(toucher)) ? toucher.owner : toucher;
//LegendGuard adds turret spawn option for emerald nade 22-06-2021
//EXPERIMENTAL
//TODO: turrets must be spawned by owner team, cannot be spawned to attack owner team or both
+/*
void nade_emerald_SpawnTurret(entity ent, vector org, entity tur)
{
//FOREACH_CLIENT(IS_PLAYER(it),
//{
- if (ent.turspawncount < autocvar_g_nades_emerald_turretspawnlimit)
+ if (turspawncount < autocvar_g_nades_emerald_turretspawnlimit)
{
//ent = spawn();
//ent.owner = it.owner;
//bool turret_initialize(entity this, Turret tur)
//turret_validate_target(ent.realowner, ent.enemy, ent.target_validate_flags);
turret_initialize(ent, tur);
- //it.turspawncount++;
- //PrintToChatAll(sprintf("^1AFTER^7 it.turspawncount: ^3%f", it.turspawncount));
+ //turspawncount++;
+ //PrintToChatAll(sprintf("^1AFTER^7 turspawncount: ^3%f", turspawncount));
//if (!IS_ONGROUND(ent))
// ent.gravity = 1; setorigin(ent, org);
}
//EXPERIMENTAL
void nade_emerald_randomturrets(entity e, vector org)
{
- /*//taken from: qcsrc/common/turrets/turret.qh
- const int TSF_SUSPENDED = 1;
- const int TSF_TERRAINBASE = 2; // currently unused
- const int TSF_NO_AMMO_REGEN = 4; // disable builtin ammo regeneration
- const int TSF_NO_PATHBREAK = 8; // don't break path to chase enemies, will still fire at them if possible
- const int TSL_NO_RESPAWN = 16; // don't re-spawn
- const int TSL_ROAM = 32; // roam while idle*/
+ //in: qcsrc/common/turrets/turret.qh , look constants
+
RandomSelection_Init();
FOREACH(Turrets, it != TUR_Null && (!((it.spawnflags & TSF_SUSPENDED))),
{
RandomSelection_AddEnt(it, chancetur, 1);
});
nade_emerald_SpawnTurret(e, org, RandomSelection_chosen_ent);
-}
+}*/
void nade_emerald_randomitem(entity e, vector org)
{
{
FOREACH_CLIENT(IS_PLAYER(it),
{
- if (it.vehspawncount < autocvar_g_nades_emerald_vehiclespawnlimit)
+ if (vehspawncount < autocvar_g_nades_emerald_vehiclespawnlimit)
{
spawnlimited = false;
- //PrintToChatAll(sprintf("^2BEFORE^7 it.vehspawncount: ^3%f", it.vehspawncount));
- it.vehspawncount++;
- //PrintToChatAll(sprintf("^1AFTER^7 it.vehspawncount: ^3%f", it.vehspawncount));
+ //PrintToChatAll(sprintf("^2BEFORE^7 vehspawncount: ^3%f", vehspawncount));
+ vehspawncount++;
+ //PrintToChatAll(sprintf("^1AFTER^7 vehspawncount: ^3%f", vehspawncount));
}
else
spawnlimited = true;
return;
}
- case 2: nade_emerald_randomturrets(e, this.origin); return; //EXPERIMENTAL
+ /*case 2:
+ {
+ nade_emerald_randomturrets(e, this.origin);
+ return; //EXPERIMENTAL
+ }*/
default:
{
for (int c = 0; c < autocvar_g_nades_emerald_ball_count; c++)
}
}
- if ( IS_REAL_CLIENT(toucher) || IS_VEHICLE(toucher) )
+ if ( IS_REAL_CLIENT(toucher) && !IS_VEHICLE(toucher) )
{
entity show_brown = (IS_VEHICLE(toucher)) ? toucher.owner : toucher;
STAT(AMMUNITIONING_ORB, show_brown) = time+0.1;
//copy of the special.qc function contents for DarkBlinking
void nade_dark_touch(entity this, entity toucher)
{
- if ( IS_REAL_CLIENT(toucher) || IS_VEHICLE(toucher) || IS_MONSTER(toucher) )
+ if ( IS_REAL_CLIENT(toucher) && !IS_VEHICLE(toucher) )
{
entity show_tint = (IS_VEHICLE(toucher)) ? toucher.owner : toucher;
bool autocvar_g_nades_emerald_powerupjetpack_randomdrop = 0;
int autocvar_g_nades_emerald_dropitemselect = 0; //admin/user selects which item wants to drop in-game, if not will be random
int autocvar_g_nades_emerald_vehiclespawnlimit = 6; //LegendGuard adds new nade cvar of vehicle spawn count limit for the server 26-06-2021
-int autocvar_g_nades_emerald_turretspawnlimit = 4; // EXPERIMENTAL 26-06-2021
+//int autocvar_g_nades_emerald_turretspawnlimit = 4; // EXPERIMENTAL 26-06-2021
float autocvar_g_nades_ammo_time = 5; //LegendGuard adds new nade cvars 13-02-2021
float autocvar_g_nades_ammo_rate = 30;
float autocvar_g_nades_ammo_friend = 1;
.float nade_show_particles;
.float nade_veil_prevalpha;
.float nade_dark_prevalpha; //LegendGuard adds new nade .variable 08-02-2021
-.int vehspawncount; //LegendGuard adds new .variable 22-06-2021
-.int turspawncount; //EXPERIMENTAL 26-06-2021
+int vehspawncount; //LegendGuard adds new .variable 22-06-2021
+//int turspawncount; //EXPERIMENTAL 26-06-2021
bool orb_send(entity this, entity to, int sf);
string cvar_cl_pokenade_type;
float cvar_cl_tandemnade_type; //LegendGuard adds new cl variable for emerald nade 01-07-2021
//LegendGuard sets variables for dark nade 09-02-2021
-float autocvar_hud_panel_darkradar_maximised_zoom_scale = 1;
float dark_appeartime;
float dark_fadetime;
/***************************************************************/
#endif
#ifdef CSQC
-const int MAX_QUADRATIC2 = 25;
-vector quadratic2_slots[MAX_QUADRATIC2];
-vector quadratic2_dirs[MAX_QUADRATIC2];
-const float QUADRATIC2_SPEED = 150;
-const float QUADRATIC2_TURNSPEED = 0.35;
-const float QUADRATIC2_SIZE = 24;
-const float QUADRATIC2_CHANCE = 0.35;
-float quadratic2_spawntime, quadratic2_fadetime;
-bool quadratic2;
-void HUD_Quadratic2()
-{
- for(int j = MAX_QUADRATIC2 - 1; j >= 0; --j)
- {
- vector slot = quadratic2_slots[j];
- vector dirs = quadratic2_dirs[j];
- float oldz = slot.z;
- if(slot)
- slot += quadratic2_dirs[j] * QUADRATIC2_SPEED * frametime;
- slot.z = oldz;
- //if(slot.z)
- //slot.z = sin(QUADRATIC2_TURNSPEED * M_PI * time);
- if(slot.y > vid_conheight || slot.x > vid_conwidth)
- slot = '0 0 0';
-
- if(slot == '0 0 0')
- {
- if(time > quadratic2_spawntime && random() <= QUADRATIC2_CHANCE) // low chance to spawn!
- {
- slot.x = bound(0, (random() * vid_conwidth + 1), vid_conwidth);
- slot.y = bound(0, (random() * vid_conheight + 1), vid_conheight);
- slot.z = 0;
- dirs = vec2(randomvec());
- quadratic2_spawntime = time + bound(0.05, random() * 0.5, 0.4); // prevent spawning another one for this amount of time!
- }
- }
- else
- {
- vector splash_size = vec2(QUADRATIC2_SIZE, QUADRATIC2_SIZE);
- if(time > dirs.z)
- {
- if(random() <= 0.05)
- slot.z = -1;
- else
- slot.z = floor(random() * 9) + 1;
- dirs.z = time + QUADRATIC2_TURNSPEED;
- }
- string chosen_number = ((slot.z == -1) ? "NOOB" : ftos(rint(slot.z)));
- draw_beginBoldFont();
- drawcolorcodedstring(vec2(slot), chosen_number, splash_size, 0.95, DRAWFLAG_NORMAL);
- draw_endBoldFont();
- }
-
- quadratic2_slots[j] = slot;
- quadratic2_dirs[j] = dirs;
- }
-}
bool darkblink;
-STATIC_INIT_LATE(cl_darkblink_override)
-{
- localcmd("\nalias solve_quadratic2 \"cl_cmd solve_quadratic2 ${* ?}\"\n");
-}
-
REGISTER_MUTATOR(cl_darkblink, true);
MUTATOR_HOOKFUNCTION(cl_darkblink, DrawScoreboard)
MUTATOR_HOOKFUNCTION(cl_darkblink, HUD_Draw_overlay)
{
- if(!darkblink && !quadratic2)
+ if(!darkblink)
return false;
+
+ if (g_stat_HEALTH < 0)
+ darkblink = false;
+
+ if(!STAT(GAME_STOPPED) && !warmup_stage)
+ darkblink = false;
- if(time <= dark_fadetime && autocvar_hud_panel_darkradar_maximised_zoom_scale == 1)
+ if(time <= dark_fadetime)
{
HUD_DarkBlinking();
return false;
else
darkblink = false;
- if(time <= quadratic2_fadetime)
- {
- HUD_Quadratic2();
- // don't return true, we want regular HUD effects!
- }
- else
- quadratic2 = false;
-
return false;
}
-MUTATOR_HOOKFUNCTION(cl_darkblink, CSQC_ConsoleCommand)
-{
- if(MUTATOR_RETURNVALUE) // command was already handled?
- return;
-
- string cmd_name = M_ARGV(0, string);
- //int cmd_argc = M_ARGV(2, int);
-
- if(cmd_name == "solve_quadratic2")
- {
- quadratic2 = true;
- quadratic2_fadetime = time + 5;
- return true;
- }
-}
-
NET_HANDLE(TE_CSQC_DARKBLINKING, bool isNew)
{
return = true;
localcmd("play2 sound/misc/blind\n");
darkblink = true;
dark_appeartime = time;
- dark_fadetime = time + 9;
+ dark_fadetime = time + 7;
}
#endif
/***************************************************************/