if(b == 0)
weapon_accuracy[w] = -1;
else
- weapon_accuracy[w] = (b - 1.0) / 254.0;
+ weapon_accuracy[w] = (b - 1.0) / 100.0;
}
}
}
acc_levels = MAX_ACCURACY_LEVELS;
for (i = 0; i < acc_levels; ++i)
- acc_lev[i] = stof(argv(i));
+ acc_lev[i] = stof(argv(i)) / 100.0;
}
// let know that acc_col[] needs to be loaded
acc_col_x[0] = -1;
average_accuracy += weapon_stats; // store sum of all accuracies in average_accuracy
string s;
- s = strcat(ftos(weapon_stats),"%");
+ s = sprintf("%d%%", weapon_stats*100);
float padding;
padding = (weapon_width - stringwidth(s, FALSE, '1 0 0' * fontsize)) / 2; // center the accuracy value
float accuracy_byte(float n, float d)
{
+ print(sprintf("accuracy: %d / %d\n", n, d));
if(d == 0)
return 0;
- return 1.0 + rint(n * 254.0 / d);
+ return 1 + rint(n * 100.0 / d);
}
float accuracy_send(entity to, float sf)
}
// update accuracy stats
-void accuracy_set(entity e, float w, float hit, float fired)
+void accuracy_set(entity e, float w, float fired, float hit)
{
entity a;
float b;
a.SendFlags |= w;
}
-void accuracy_add(entity e, float w, float hit, float fired)
+void accuracy_add(entity e, float w, float fired, float hit)
{
entity a;
float b;
void accuracy_resend(entity e);
// update accuracy stats
-void accuracy_set(entity e, float w, float hit, float fired);
-void accuracy_add(entity e, float w, float hit, float fired);
+void accuracy_set(entity e, float w, float fired, float hit);
+void accuracy_add(entity e, float w, float fired, float hit);
// helper
float accuracy_isgooddamage(entity attacker, entity targ);
self.ammo_nails -= pAmmo;
if(deathtype & HITTYPE_SECONDARY)
- W_SetupShot (self, cvar("g_antilag_bullets") && pSpeed >= cvar("g_antilag_bullets"), 2, "weapons/campingrifle_fire2.wav", cvar("g_balance_campingrifle_secondary_damage"));
+ W_SetupShot (self, cvar("g_antilag_bullets") && pSpeed >= cvar("g_antilag_bullets"), 2, "weapons/campingrifle_fire2.wav", cvar("g_balance_campingrifle_secondary_damage") + cvar("g_balance_campingrifle_secondary_headshotaddeddamage"));
else
- W_SetupShot (self, cvar("g_antilag_bullets") && pSpeed >= cvar("g_antilag_bullets"), 2, "weapons/campingrifle_fire.wav", cvar("g_balance_campingrifle_primary_damage"));
+ W_SetupShot (self, cvar("g_antilag_bullets") && pSpeed >= cvar("g_antilag_bullets"), 2, "weapons/campingrifle_fire.wav", cvar("g_balance_campingrifle_primary_damage") + cvar("g_balance_campingrifle_primary_headshotaddeddamage"));
pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg, w_shotdir * 2000, 1);
.float dmg_total;
void W_BallisticBullet_Hit (void)
{
- float f, q;
+ float f, q, g;
f = pow(bound(0, vlen(self.velocity) / vlen(self.oldvelocity), 1), 2); // energy multiplier
q = 1 + self.dmg_edge / self.dmg;
headshot = 0;
yoda = 0;
- damage_headshotbonus = self.dmg_edge;
+ damage_headshotbonus = self.dmg_edge * f;
railgun_start = self.origin - 2 * frametime * self.velocity;
railgun_end = self.origin + 2 * frametime * self.velocity;
-
+ g = accuracy_isgooddamage(self.owner, other);
Damage(other, self, self.owner, self.dmg * f, self.projectiledeathtype, self.origin, self.dmg_force * normalize(self.velocity) * f);
damage_headshotbonus = 0;
AnnounceTo(self.owner, "awesome");
// calculate hits for ballistic weapons
- if(accuracy_isgooddamage(self.owner, other))
+ if(g)
{
// do not exceed 100%
q = min(self.dmg * q, self.dmg_total + f * self.dmg) - self.dmg_total;
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
self.ammo_cells = self.ammo_cells - cvar("g_balance_crylink_primary_ammo");
- W_SetupShot (self, FALSE, 2, "weapons/crylink_fire.wav", (cvar("g_balance_crylink_primary_damage")*cvar("g_balance_crylink_primary_shots")));
+ W_SetupShot (self, FALSE, 2, "weapons/crylink_fire.wav", (cvar("g_balance_crylink_primary_damage")*cvar("g_balance_crylink_primary_shots"))); // FIXME this is wrong, crylink can do more (linkjoin, bounce damage)
forward = v_forward;
right = v_right;
up = v_up;
if (self.BUTTON_ATCK)
if (weapon_prepareattack(0, cvar("g_balance_laser_primary_refire")))
{
- W_Laser_Attack(1);
+ W_Laser_Attack(0);
weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_laser_primary_animtime"), w_ready);
}
if (self.BUTTON_ATCK2)
self.ammo_rockets = self.ammo_rockets - cvar("g_balance_seeker_missile_ammo");
makevectors(self.v_angle);
- W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/seeker_fire.wav", cvar("g_balance_seeker_missile_damage"));
+ W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/seeker_fire.wav", 0);
w_shotorg += f_diff;
pointparticles(particleeffectnum("seeker_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
self.ammo_rockets = self.ammo_rockets - cvar("g_balance_seeker_tag_ammo");
- W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/tag_fire.wav", 0);
+ W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/tag_fire.wav", cvar("g_balance_seeker_missile_damage") * cvar("g_balance_seeker_missile_count"));
missile = spawn();
missile.owner = self;
bulletspeed = cvar("g_balance_shotgun_primary_speed");
bulletconstant = cvar("g_balance_shotgun_primary_bulletconstant");
- W_SetupShot (self, cvar("g_antilag_bullets") && bulletspeed >= cvar("g_antilag_bullets"), 5, "weapons/shotgun_fire.wav", cvar("g_balance_shotgun_primary_damage"));
+ W_SetupShot (self, cvar("g_antilag_bullets") && bulletspeed >= cvar("g_antilag_bullets"), 5, "weapons/shotgun_fire.wav", d * bullets);
for (sc = 0;sc < bullets;sc = sc + 1)
fireBallisticBullet(w_shotorg, w_shotdir, spread, bulletspeed, 5, d, 0, f, WEP_SHOTGUN, 0, 1, bulletconstant);
endFireBallisticBullet();
else
self.ammo_nails = self.ammo_nails - cvar("g_balance_uzi_sustained_ammo");
}
- W_SetupShot (self, cvar("g_antilag_bullets") && cvar("g_balance_uzi_speed") >= cvar("g_antilag_bullets"), 0, "weapons/uzi_fire.wav", cvar("g_balance_uzi_first_damage"));
+ W_SetupShot (self, cvar("g_antilag_bullets") && cvar("g_balance_uzi_speed") >= cvar("g_antilag_bullets"), 0, "weapons/uzi_fire.wav", ((self.uzi_bulletcounter == 1) ? cvar("g_balance_uzi_first_damage") : cvar("g_balance_uzi_sustained_damage")));
if (!g_norecoil)
{
self.punchangle_x = random () - 0.5;
return;
}
- W_SetupShot (self, cvar("g_antilag_bullets") && cvar("g_balance_uzi_speed") >= cvar("g_antilag_bullets"), 0, "weapons/uzi_fire.wav", cvar("g_balance_uzi_first_damage"));
+ W_SetupShot (self, cvar("g_antilag_bullets") && cvar("g_balance_uzi_speed") >= cvar("g_antilag_bullets"), 0, "weapons/uzi_fire.wav", cvar("g_balance_uzi_sustained_damage"));
if (!g_norecoil)
{
self.punchangle_x = random () - 0.5;
void uzi_mode1_fire_burst()
{
- W_SetupShot (self, cvar("g_antilag_bullets") && cvar("g_balance_uzi_speed") >= cvar("g_antilag_bullets"), 0, "weapons/uzi_fire.wav", cvar("g_balance_uzi_first_damage"));
+ W_SetupShot (self, cvar("g_antilag_bullets") && cvar("g_balance_uzi_speed") >= cvar("g_antilag_bullets"), 0, "weapons/uzi_fire.wav", cvar("g_balance_uzi_sustained_damage"));
if (!g_norecoil)
{
self.punchangle_x = random () - 0.5;