if(fh >= 0)
{
fputs(fh, strcat("seta hud_skin \"", cvar_string("hud_skin"), "\"", "\n"));
- fputs(fh, strcat("seta hud_bg \"", cvar_string("hud_bg"), "\"", "\n"));
- fputs(fh, strcat("seta hud_bg_color \"", cvar_string("hud_bg_color"), "\"", "\n"));
- fputs(fh, strcat("seta hud_bg_color_team \"", cvar_string("hud_bg_color_team"), "\"", "\n"));
- fputs(fh, strcat("seta hud_bg_alpha \"", cvar_string("hud_bg_alpha"), "\"", "\n"));
- fputs(fh, strcat("seta hud_bg_border \"", cvar_string("hud_bg_border"), "\"", "\n"));
- fputs(fh, strcat("seta hud_bg_padding \"", cvar_string("hud_bg_padding"), "\"", "\n"));
- fputs(fh, strcat("seta hud_fg_alpha \"", cvar_string("hud_fg_alpha"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_panel_bg \"", cvar_string("hud_panel_bg"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_panel_bg_color \"", cvar_string("hud_panel_bg_color"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_panel_bg_color_team \"", cvar_string("hud_panel_bg_color_team"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_panel_bg_alpha \"", cvar_string("hud_panel_bg_alpha"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_panel_bg_border \"", cvar_string("hud_panel_bg_border"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_panel_bg_padding \"", cvar_string("hud_panel_bg_padding"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_panel_fg_alpha \"", cvar_string("hud_panel_fg_alpha"), "\"", "\n"));
fputs(fh, "\n");
fputs(fh, strcat("seta hud_dock \"", cvar_string("hud_dock"), "\"", "\n"));
fputs(fh, strcat("seta hud_panel_", panel_name, "_complainbubble_color_unavailable \"", cvar_string(strcat("hud_panel_", panel_name, "_complainbubble_color_unavailable")), "\"", "\n"));
fputs(fh, strcat("seta hud_panel_", panel_name, "_ammo_color \"", cvar_string(strcat("hud_panel_", panel_name, "_ammo_color")), "\"", "\n"));
fputs(fh, strcat("seta hud_panel_", panel_name, "_ammo_alpha \"", cvar_string(strcat("hud_panel_", panel_name, "_ammo_alpha")), "\"", "\n"));
- fputs(fh, strcat("seta hud_panel_", panel_name, "_aspect \"", cvar_string(strcat("hud_panel_", panel_name, "_ammo_alpha")), "\"", "\n"));
+ fputs(fh, strcat("seta hud_panel_", panel_name, "_aspect \"", cvar_string(strcat("hud_panel_", panel_name, "_aspect")), "\"", "\n"));
break;
case HUD_PANEL_AMMO:
fputs(fh, strcat("seta hud_panel_", panel_name, "_onlycurrent \"", cvar_string(strcat("hud_panel_", panel_name, "_onlycurrent")), "\"", "\n"));
}
}
-#define acc_color(i) stov(cvar_string(strcat("hud_panel_weapons_accuracy_color", ftos(i))))
-#define MAX_ACCURACY_LEVELS 10
-float acc_lev[MAX_ACCURACY_LEVELS];
-
void HUD_Weapons(void)
{
if(!autocvar_hud_panel_weapons && !autocvar__hud_configure)
vector wpnpos;
vector wpnsize;
- float acc_levels;
- if(autocvar_hud_panel_weapons_accuracy && !(gametype == GAME_RACE || gametype == GAME_CTS))
- {
- acc_levels = tokenize(cvar_string("hud_panel_weapons_accuracy_color_levels"));
- if (acc_levels > MAX_ACCURACY_LEVELS)
- acc_levels = MAX_ACCURACY_LEVELS;
-
- for (i = 0; i < acc_levels; ++i)
- acc_lev[i] = stof(argv(i));
- }
-
for(i = 0; i < weapon_cnt; ++i)
{
wpnpos = pos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows);
if(WEP_VALID(w)) {
HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
if (alsoprint)
- print("^1", s1, "^1 ", Weapon_SuicideMessage(type), "\n");
+ print("^1", sprintf(Weapon_SuicideMessage(type), strcat(s1, "^1")), "\n");
} else if (type == DEATH_KILL) {
HUD_KillNotify_Push(s1, "", 0, DEATH_KILL);
if (alsoprint)
if (stof(s2) > 2) // killcount > 2
print ("^1",s1,"^1 ended it all after a ",s2," kill spree\n");
+ } else if(msg == MSG_KILL_MELEE) { // handle melee types separately
+ if(type == KILL_FRAG_GAUNTLET) {
+ if(alsoprint)
+ {
+ if(gentle) {
+ print ("^1", s1, "^1 got too close to", s2, "^1's gauntlet\n");
+ } else {
+ print ("^1", s1, "^1 was cut in half by", s2, "^1's gauntlet\n");
+ }
+ }
+ }
+ else if(type == KILL_FRAG_SHOTGUN_MELEE)
+ {
+ if(alsoprint)
+ {
+ print ("^7", s2, "^7 slapped ", s1, "^7 around a bit with a large ^2shotgun\n");
+ }
+ }
+ HUD_KillNotify_Push(s1, s2, 1, type);
} else if(msg == MSG_KILL) {
w = DEATH_WEAPONOF(type);
if(WEP_VALID(w)) {
HUD_KillNotify_Push(s2, s1, 1, w);
if (alsoprint)
- print("^1", s1, "^1 ", Weapon_KillMessage(type), "\n");
+ print("^1", sprintf(Weapon_KillMessage(type), strcat(s2, "^1"), strcat(s1, "^1")), "\n"); // default order: victim, killer
}
else if(type == KILL_TEAM_RED || type == KILL_TEAM_BLUE || type == KILL_TEAM_SPREE) {
HUD_KillNotify_Push(s1, s2, 1, type);
self = get_weaponinfo(killnotify_deathtype[j]);
s = strcat("weapon", self.netname);
}
+ else if(killnotify_deathtype[j] == KILL_FRAG_GAUNTLET)
+ {
+ s = "notify_melee";
+ }
+ else if(killnotify_deathtype[j] == KILL_FRAG_SHOTGUN_MELEE)
+ {
+ s = "notify_melee";
+ }
else if(killnotify_deathtype[j] == KILL_TEAM_RED)
{
s = "notify_teamkill_red";
vector force;
force = w_shotdir * cvar("g_balance_electro_primary_force") + '0 0 1' * cvar("g_balance_electro_primary_force_up");
Damage (trace_ent, self.owner, self.owner, cvar("g_balance_electro_primary_damage") * dt, WEP_ELECTRO, trace_endpos, force * dt);
- W_Plasma_TriggerCombo(trace_endpos, cvar("g_balance_electro_primary_comboradius"), self.owner);
}
+ W_Plasma_TriggerCombo(trace_endpos, cvar("g_balance_electro_primary_comboradius"), self.owner);
// draw effect
if(w_shotorg != self.hook_start)
else if (req == WR_SUICIDEMESSAGE)
{
if(w_deathtype & HITTYPE_SECONDARY)
- w_deathtypestring = "could not remember where they put plasma";
+ w_deathtypestring = "%s could not remember where they put plasma";
else
- w_deathtypestring = "played with plasma";
+ w_deathtypestring = "%s played with plasma";
}
else if (req == WR_KILLMESSAGE)
{
if(w_deathtype & HITTYPE_SECONDARY)
{
if(w_deathtype & HITTYPE_SPLASH) // unchecked: BOUNCE
- w_deathtypestring = "just noticed #'s blue ball";
+ w_deathtypestring = "%s just noticed %s's blue ball";
else // unchecked: BOUNCE
- w_deathtypestring = "got in touch with #'s blue ball";
+ w_deathtypestring = "%s got in touch with %s's blue ball";
}
else
{
if(w_deathtype & HITTYPE_BOUNCE) // combo
- w_deathtypestring = "felt the electrifying air of #'s combo";
+ w_deathtypestring = "%s felt the electrifying air of %s's combo";
else if(w_deathtype & HITTYPE_SPLASH)
- w_deathtypestring = "got too close to #'s blue beam";
+ w_deathtypestring = "%s got too close to %s's blue beam";
else
- w_deathtypestring = "was blasted by #'s blue beam";
+ w_deathtypestring = "%s was blasted by %s's blue beam";
}
}
return TRUE;
void W_Grenade_Touch2 (void)
{
PROJECTILE_TOUCH;
- if (other.takedamage == DAMAGE_AIM)
+ if(cvar("g_balance_grenadelauncher_secondary_sticky") && other.takedamage != DAMAGE_AIM)
{
- self.use ();
+ spamsound (self, CHAN_PROJECTILE, "weapons/grenade_stick.wav", VOL_BASE, ATTN_NORM);
+
+ // let it stick whereever it is
+ self.oldvelocity = self.velocity;
+ self.velocity = '0 0 0';
+ self.movetype = MOVETYPE_NONE; // also disables gravity
+ self.gravity = 0; // nope, it does NOT! maybe a bug in CSQC code? TODO
+ UpdateCSQCProjectile(self);
+
+ // do not respond to any more touches
+ self.solid = SOLID_NOT;
+
+ self.nextthink = min(self.nextthink, time + cvar("g_balance_grenadelauncher_secondary_lifetime2"));
}
else
{
- float r;
- r = random() * 6;
- if(r < 1)
- spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce1.wav", VOL_BASE, ATTN_NORM);
- else if(r < 2)
- spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce2.wav", VOL_BASE, ATTN_NORM);
- else if(r < 3)
- spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce3.wav", VOL_BASE, ATTN_NORM);
- else if(r < 4)
- spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce4.wav", VOL_BASE, ATTN_NORM);
- else if(r < 5)
- spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce5.wav", VOL_BASE, ATTN_NORM);
+ if (other.takedamage == DAMAGE_AIM)
+ {
+ self.use ();
+ }
else
- spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce6.wav", VOL_BASE, ATTN_NORM);
- self.projectiledeathtype |= HITTYPE_BOUNCE;
+ {
+ float r;
+ r = random() * 6;
+ if(r < 1)
+ spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce1.wav", VOL_BASE, ATTN_NORM);
+ else if(r < 2)
+ spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce2.wav", VOL_BASE, ATTN_NORM);
+ else if(r < 3)
+ spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce3.wav", VOL_BASE, ATTN_NORM);
+ else if(r < 4)
+ spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce4.wav", VOL_BASE, ATTN_NORM);
+ else if(r < 5)
+ spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce5.wav", VOL_BASE, ATTN_NORM);
+ else
+ spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce6.wav", VOL_BASE, ATTN_NORM);
+ self.projectiledeathtype |= HITTYPE_BOUNCE;
+ }
}
}
gren.angles = vectoangles (gren.velocity);
gren.flags = FL_PROJECTILE;
- CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE_BOUNCING, TRUE);
+ if(cvar("g_balance_grenadelauncher_secondary_sticky"))
+ CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE, TRUE);
+ else
+ CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE_BOUNCING, TRUE);
}
void spawnfunc_weapon_grenadelauncher (void)
else if (req == WR_SUICIDEMESSAGE)
{
if(w_deathtype & HITTYPE_SECONDARY)
- w_deathtypestring = "tried out his own grenade";
+ w_deathtypestring = "%s tried out his own grenade";
else
- w_deathtypestring = "detonated";
+ w_deathtypestring = "%s detonated";
}
else if (req == WR_KILLMESSAGE)
{
if(w_deathtype & HITTYPE_SPLASH)
if(w_deathtype & HITTYPE_BOUNCE) // (must be secondary then)
- w_deathtypestring = "didn't see #'s grenade";
+ w_deathtypestring = "%s didn't see %s's grenade";
else // unchecked: SECONDARY
- w_deathtypestring = "almost dodged #'s grenade";
+ w_deathtypestring = "%s almost dodged %s's grenade";
else // unchecked: SECONDARY, BOUNCE
- w_deathtypestring = "ate #'s grenade";
+ w_deathtypestring = "%s ate %s's grenade";
}
return TRUE;
}