Valve: Skill system now affects the weapons as it should. Didn't do it on

the ones that need a lot more work.
This commit is contained in:
Marco Cawthorne 2020-04-03 09:11:08 +02:00
parent e6ff9520a1
commit 45c18f6a7f
14 changed files with 36 additions and 20 deletions

View file

@ -19,7 +19,12 @@
HALF-LIFE (1998) ENTITY
HEV Suit energy battery.
Adds 15 of armor/battery-power to the HEV Suit.
It adds the following energy values to the HEV Suit by default:
Skill 1 (Easy): 15
Skill 2 (Medium): 15
Skill 3 (Hard): 10
The values can be tweaked in the skill.cfg file.
*/
class item_battery:CBaseEntity
@ -39,7 +44,7 @@ void item_battery::touch(void)
return;
}
/* Move this somewhere else? */
other.armor += 15;
other.armor += Skill_GetValue("battery");
if (other.armor > 100) {
other.armor = 100;
}

View file

@ -110,8 +110,9 @@ w_crossbow_holster(void)
void Crossbolt_Touch(void) {
/* explode mode, multiplayer */
if (self.weapon) {
float dmg = Skill_GetValue("plr_xbow_bolt_monster");
Effect_CreateExplosion(self.origin);
Damage_Radius(self.origin, self.owner, 50, 50 * 2.5f, TRUE, WEAPON_CROSSBOW);
Damage_Radius(self.origin, self.owner, dmg, dmg * 2.5f, TRUE, WEAPON_CROSSBOW);
if (random() < 0.5) {
sound(self, 1, "weapons/explode3.wav", 1.0f, ATTN_NORM);
} else {
@ -130,7 +131,7 @@ void Crossbolt_Touch(void) {
}
/* anything else that can take damage */
Damage_Apply(other, self.owner, 50, WEAPON_CROSSBOW, DMG_BLUNT);
Damage_Apply(other, self.owner, Skill_GetValue("plr_xbow_bolt_monster"), WEAPON_CROSSBOW, DMG_BLUNT);
if (random() < 0.5) {
sound(self, 1, "weapons/xbow_hitbod1.wav", 1.0f, ATTN_NORM);
} else {

View file

@ -135,7 +135,7 @@ w_crowbar_primary(void)
}
if (trace_ent.takedamage) {
Damage_Apply(trace_ent, pl, 10, WEAPON_CROWBAR, DMG_BLUNT);
Damage_Apply(trace_ent, pl, Skill_GetValue("plr_crowbar"), WEAPON_CROWBAR, DMG_BLUNT);
if (!trace_ent.iBleeds) {
return;

View file

@ -134,7 +134,7 @@ w_glock_primary(void)
}
#else
pl.glock_mag--;
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 8, [0.01,0,01], WEAPON_GLOCK);
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, Skill_GetValue("plr_9mm_bullet"), [0.01,0,01], WEAPON_GLOCK);
Sound_Play(pl, CHAN_WEAPON, "weapon_glock.fire");
if (self.flags & FL_CROUCHING)
@ -179,7 +179,7 @@ w_glock_secondary(void)
}
#else
pl.glock_mag--;
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 8, [0.1,0.1], WEAPON_GLOCK);
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, Skill_GetValue("plr_9mm_bullet"), [0.1,0.1], WEAPON_GLOCK);
Sound_Play(pl, CHAN_WEAPON, "weapon_glock.fire");
if (self.flags & FL_CROUCHING)

View file

@ -74,8 +74,9 @@ void w_handgrenade_throw(void)
{
static void WeaponFrag_Throw_Explode( void )
{
float dmg = Skill_GetValue("plr_hand_grenade");
Effect_CreateExplosion(self.origin);
Damage_Radius(self.origin, self.owner, 150, 150 * 2.5f, TRUE, WEAPON_HANDGRENADE);
Damage_Radius(self.origin, self.owner, dmg, dmg * 2.5f, TRUE, WEAPON_HANDGRENADE);
sound(self, CHAN_WEAPON, sprintf( "weapons/explode%d.wav", floor( random() * 2 ) + 3 ), 1, ATTN_NORM);
remove(self);
}

View file

@ -97,7 +97,7 @@ w_hornetgun_shoothornet(void)
{
static void Hornet_Touch(void) {
if (other.takedamage == DAMAGE_YES) {
Damage_Apply(other, self.owner, 10, WEAPON_HORNETGUN, DMG_GENERIC);
Damage_Apply(other, self.owner, Skill_GetValue("plr_hornet"), WEAPON_HORNETGUN, DMG_GENERIC);
Sound_Play(other, CHAN_VOICE, "weapon_hornetgun.hit");
} else {
Sound_Play(self, CHAN_VOICE, "weapon_hornetgun.buzz");

View file

@ -138,9 +138,9 @@ w_mp5_primary(void)
#else
/* singleplayer is more accurate */
if (cvar("sv_playerslots") == 1) {
TraceAttack_FireBullets(1, Weapons_GetCameraPos(), 8, [0.025,0.025], WEAPON_MP5);
TraceAttack_FireBullets(1, Weapons_GetCameraPos(), Skill_GetValue("plr_9mmAR_bullet"), [0.025,0.025], WEAPON_MP5);
} else {
TraceAttack_FireBullets(1, Weapons_GetCameraPos(), 8, [0.05,0.05], WEAPON_MP5);
TraceAttack_FireBullets(1, Weapons_GetCameraPos(), Skill_GetValue("plr_9mmAR_bullet"), [0.05,0.05], WEAPON_MP5);
}
Sound_Play(pl, CHAN_WEAPON, "weapon_mp5.shoot");
@ -171,8 +171,9 @@ w_mp5_secondary(void)
Weapons_ViewAnimation(MP5_GRENADE);
#else
static void Grenade_ExplodeTouch(void) {
float dmg = Skill_GetValue("plr_9mmAR_grenade");
Effect_CreateExplosion(self.origin);
Damage_Radius(self.origin, self.owner, 100, 100 * 2.5f, TRUE, WEAPON_MP5);
Damage_Radius(self.origin, self.owner, dmg, dmg * 2.5f, TRUE, WEAPON_MP5);
if (random() < 0.5) {
sound(self, 1, "weapons/explode3.wav", 1, ATTN_NORM);

View file

@ -136,7 +136,7 @@ w_python_primary(void)
Weapons_ViewAnimation(PYTHON_FIRE1);
#else
pl.python_mag--;
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 40, [0.008, 0.008], WEAPON_PYTHON);
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, Skill_GetValue("plr_357_bullet"), [0.008, 0.008], WEAPON_PYTHON);
Sound_Play(pl, CHAN_WEAPON, "weapon_357.shoot");
#endif

View file

@ -115,8 +115,9 @@ void w_rpg_primary(void)
Weapons_ViewPunchAngle([-10,0,0]);
#else
static void Rocket_Touch(void) {
float dmg = Skill_GetValue("plr_rpg");
Effect_CreateExplosion(self.origin);
Damage_Radius(self.origin, self.owner, 150, 150 * 2.5f, TRUE, WEAPON_RPG);
Damage_Radius(self.origin, self.owner, dmg, dmg * 2.5f, TRUE, WEAPON_RPG);
sound(self, CHAN_WEAPON, sprintf( "weapons/explode%d.wav", floor( random() * 2 ) + 3 ), 1, ATTN_NORM);
remove(self);
}

View file

@ -117,8 +117,9 @@ void s_satchel_detonate(entity master)
{
for (entity b = world; (b = find(b, ::classname, "satchel"));) {
if (b.owner == master) {
float dmg = Skill_GetValue("plr_satchel");
Effect_CreateExplosion(b.origin);
Damage_Radius(b.origin, master, 150, 150 * 2.5f, TRUE, WEAPON_SATCHEL);
Damage_Radius(b.origin, master, dmg, dmg * 2.5f, TRUE, WEAPON_SATCHEL);
sound(b, CHAN_WEAPON, sprintf( "weapons/explode%d.wav", floor( random() * 2 ) + 3 ), 1, ATTN_NORM);
remove(b);
}

View file

@ -121,9 +121,9 @@ void w_shotgun_primary(void)
#ifdef SSQC
/* Singleplayer is more accurate */
if (cvar("sv_playerslots") == 1) {
TraceAttack_FireBullets(6, pl.origin + pl.view_ofs, 5, [0.08716,0.08716], WEAPON_SHOTGUN);
TraceAttack_FireBullets(6, pl.origin + pl.view_ofs, Skill_GetValue("plr_buckshot"), [0.08716,0.08716], WEAPON_SHOTGUN);
} else {
TraceAttack_FireBullets(4, pl.origin + pl.view_ofs, 5, [0.08716,0.04362], WEAPON_SHOTGUN);
TraceAttack_FireBullets(4, pl.origin + pl.view_ofs, Skill_GetValue("plr_buckshot"), [0.08716,0.04362], WEAPON_SHOTGUN);
}
Sound_Play(pl, CHAN_WEAPON, "weapon_shotgun.single");
pl.shotgun_mag--;

View file

@ -75,7 +75,7 @@ monster_snark::customphysics(void)
if (trace_ent.takedamage == DAMAGE_YES) {
Sound_Play(self, CHAN_BODY, "weapon_snark.deploy");
Damage_Apply(trace_ent, self.goalentity, 10, WEAPON_SNARK, DMG_GENERIC);
Damage_Apply(trace_ent, self.goalentity, Skill_GetValue("snark_dmg_bite"), WEAPON_SNARK, DMG_GENERIC);
Effect_CreateBlood(self.origin + [0,0,16], [1,0,0]);
}
@ -90,6 +90,8 @@ monster_snark::customphysics(void)
void
monster_snark::Death(int i)
{
float dmg = Skill_GetValue("snark_dmg_pop");
Damage_Radius(origin, goalentity, dmg, dmg * 2.5f, TRUE, WEAPON_SNARK);
Effect_CreateBlood(self.origin + [0,0,16], [203,183,15] / 255);
Sound_Play(self, CHAN_VOICE, "weapon_snark.die");
Sound_Play(self, CHAN_BODY, "weapon_snark.blast");

View file

@ -49,6 +49,7 @@ monster_tripmine::SendEntity(entity pvsent, float flags)
void
monster_tripmine::Trip(int walkthrough)
{
float dmg
if (!walkthrough) {
real_owner = g_eAttacker;
}
@ -57,9 +58,9 @@ monster_tripmine::Trip(int walkthrough)
Death =
Pain = __NULL__;
takedamage = DAMAGE_NO;
dmg = Skill_GetValue("plr_tripmine");
Effect_CreateExplosion(origin);
Damage_Radius(origin, real_owner, 150, 150 * 2.5f, TRUE, WEAPON_TRIPMINE);
Damage_Radius(origin, real_owner, dmg, dmg * 2.5f, TRUE, WEAPON_TRIPMINE);
sound(this, CHAN_WEAPON, sprintf( "weapons/explode%d.wav", floor( random() * 2 ) + 3 ), 1, ATTN_NORM);
remove(this);
}

View file

@ -202,6 +202,9 @@ set sk_plr_gauss3 "20"
set sk_plr_hand_grenade1 "100"
set sk_plr_hand_grenade2 "100"
set sk_plr_hand_grenade3 "100"
set sk_plr_hornet1 "10"
set sk_plr_hornet2 "10"
set sk_plr_hornet3 "10"
set sk_plr_rpg1 "100"
set sk_plr_rpg2 "100"
set sk_plr_rpg3 "100"