if (proj.cnt == PROJECTILE_NAPALM_FOUNTAIN)
{
- loopsound(proj, CH_SHOTS_SINGLE, SND(FIREBALL_FLY2), VOL_BASE, ATTEN_NORM);
+ loopsound(proj, CH_SHOTS_SINGLE, SND_FIREBALL_FLY2, VOL_BASE, ATTEN_NORM);
proj.mins = '-16 -16 -16';
proj.maxs = '16 16 16';
}
DrawNadeProgressBar(myPos, mySize, bonusProgress, nadeColor);
if(autocvar_hud_panel_ammo_text)
- drawstring_aspect(textPos, ftos(bonusNades), eX * (2/3) * mySize.x + eY * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(textPos, ftos(bonusNades), vec2((2/3) * mySize.x, mySize.y), '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
if(draw_expanding)
drawpic_aspect_skin_expanding(iconPos, nadeIcon, '1 1 0' * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, expand_time);
{
d = vlen(WarpZone_UnTransformOrigin(RandomSelection_chosen_ent, this.origin) - RandomSelection_chosen_ent.fireball_impactvec);
d = damage + (edgedamage - damage) * (d / dist);
- Fire_AddDamage(RandomSelection_chosen_ent, this.realowner, d * burntime, burntime, this.projectiledeathtype | HITTYPE_BOUNCE);
+ Fire_AddDamage(RandomSelection_chosen_ent, this.realowner, d * burntime, burntime, this.projectiledeathtype);
//trailparticles(this, particleeffectnum(EFFECT_FIREBALL_LASER), this.origin, RandomSelection_chosen_ent.fireball_impactvec);
Send_Effect(EFFECT_FIREBALL_LASER, this.origin, RandomSelection_chosen_ent.fireball_impactvec - this.origin, 1);
}
entity proj;
vector kick;
- spamsound(this, CH_SHOTS, SND(FIREBALL_FIRE), VOL_BASE, ATTEN_NORM);
+ spamsound(this, CH_SHOTS, SND_FIREBALL_FIRE, VOL_BASE, ATTEN_NORM);
proj = new(grenade);
proj.owner = this.owner;
if(!pushdeltatime) return;
// div0: ticrate independent, 1 = identity (not 20)
- toucher.velocity = toucher.velocity * pow(autocvar_g_nades_entrap_strength, pushdeltatime);
+ toucher.velocity = toucher.velocity * (autocvar_g_nades_entrap_strength ** pushdeltatime);
#ifdef SVQC
UpdateCSQCProjectile(toucher);
IL_EACH(g_projectiles, it.classname == "grapplinghook" && it.aiment == this,
{
- RemoveGrapplingHook(it.realowner);
+ RemoveHook(it);
});
delete(this);
if(autocvar_g_nades_pickup)
if(time >= this.spawnshieldtime)
if(!toucher.nade && this.health == this.max_health) // no boosted shot pickups, thank you very much
- if(!STAT(FROZEN, toucher))
if(CanThrowNade(toucher)) // prevent some obvious things, like dead players
if(IS_REAL_CLIENT(toucher)) // above checks for IS_PLAYER, don't need to do it here
{
{
IL_EACH(g_projectiles, it.classname == "grapplinghook" && it.aiment == this,
{
- RemoveGrapplingHook(it.realowner);
+ RemoveHook(it);
});
delete(this);
return;
//UpdateCSQCProjectile(this);
if(this.health == this.max_health)
{
- spamsound(this, CH_SHOTS, SND(GRENADE_BOUNCE_RANDOM()), VOL_BASE, ATTEN_NORM);
+ spamsound(this, CH_SHOTS, SND_GRENADE_BOUNCE_RANDOM(), VOL_BASE, ATTEN_NORM);
return;
}
makevectors(e.v_angle);
// NOTE: always throw from first weapon entity?
- W_SetupShot(e, weaponentities[0], false, false, SND_Null, CH_WEAPON_A, 0);
+ W_SetupShot(e, _nade.weaponentity_fld, false, false, SND_Null, CH_WEAPON_A, 0);
Kill_Notification(NOTIF_ONE_ONLY, e, MSG_CENTER, CPID_NADES);
if(Nades_from(n.nade_type) == NADE_TYPE_Null)
n.nade_type = NADE_TYPE_NORMAL.m_id;
+ .entity weaponentity = weaponentities[0]; // TODO: unhardcode
+
setmodel(n, MDL_PROJECTILE_NADE);
//setattachment(n, player, "bip01 l hand");
n.exteriormodeltoclient = player;
setthink(n, nade_beep);
n.nextthink = max(n.wait - 3, time);
n.projectiledeathtype = DEATH_NADE.m_id;
+ n.weaponentity_fld = weaponentity;
n.nade_lifetime = ntime;
setmodel(fn, MDL_NADE_VIEW);
- .entity weaponentity = weaponentities[0]; // TODO: unhardcode
setattachment(fn, player.(weaponentity), "");
fn.realowner = fn.owner = player;
fn.colormod = Nades_from(n.nade_type).m_color;
fn.glowmod = player.glowmod;
setthink(fn, SUB_Remove);
fn.nextthink = n.wait;
+ fn.weaponentity_fld = weaponentity;
player.nade = n;
player.fake_nade = fn;
if(this.vehicle)
return false;
- if(gameover)
- return false;
-
if(IS_DEAD(this))
return false;
if(!STAT(FROZEN, frag_target) || !autocvar_g_freezetag_revive_nade)
toss_nade(frag_target, true, '0 0 100', max(frag_target.nade.wait, time + 0.05));
- float killcount_bonus = ((frag_attacker.killcount >= 1) ? bound(0, autocvar_g_nades_bonus_score_minor * frag_attacker.killcount, autocvar_g_nades_bonus_score_medium) : autocvar_g_nades_bonus_score_minor);
-
if(IS_PLAYER(frag_attacker))
{
+ float killcount_bonus = ((CS(frag_attacker).killcount >= 1) ? bound(0, autocvar_g_nades_bonus_score_minor * CS(frag_attacker).killcount, autocvar_g_nades_bonus_score_medium) : autocvar_g_nades_bonus_score_minor);
+
if (SAME_TEAM(frag_attacker, frag_target) || frag_attacker == frag_target)
nades_RemoveBonus(frag_attacker);
else if(frag_target.flagcarried)
nades_GiveBonus(frag_attacker, autocvar_g_nades_bonus_score_medium);
- else if(autocvar_g_nades_bonus_score_spree && frag_attacker.killcount > 1)
+ else if(autocvar_g_nades_bonus_score_spree && CS(frag_attacker).killcount > 1)
{
#define SPREE_ITEM(counta,countb,center,normal,gentle) \
case counta: { nades_GiveBonus(frag_attacker, autocvar_g_nades_bonus_score_spree); break; }
- switch(frag_attacker.killcount)
+ switch(CS(frag_attacker).killcount)
{
KILL_SPREE_LIST
default: nades_GiveBonus(frag_attacker, autocvar_g_nades_bonus_score_minor); break;