Wrench now detects sentries, has commented code in place for other buildings.

Also fixed up the damage code/squibs code, left in a duplicate function when updating, my bad.
This commit is contained in:
Xylemon 2022-07-14 22:56:58 -07:00
parent 7512619a06
commit 25a70fb2d2
1 changed files with 27 additions and 19 deletions

View File

@ -119,29 +119,37 @@ w_wrench_primary(player pl)
return;
}
/* don't bother with decals, we got squibs */
if (trace_ent.iBleeds) {
FX_Blood(trace_endpos, [1,0,0]);
if (trace_ent.classname == "TFCSentry") {
TFCSentry sentry = (TFCSentry)trace_ent;
/* todo
} else if (trace_ent.classname == "TFCDispenser") {
TFCDispenser dispenser = (TFCDispenser)trace_ent;
todo
} else if (trace_ent.classname == "TFCTeleporter") {
TFCTeleporter teleporter = (TFCTeleporter)trace_ent;
todo
} else if (trace_ent.classname == "TFCTeleporterExit") {
TFCTeleporterExit teleporterexit = (TFCTeleporterExit)trace_ent;
todo */
} else {
FX_Impact(IMPACT_MELEE, trace_endpos, trace_plane_normal);
}
/* don't bother with decals, we got squibs */
if (trace_ent.iBleeds) {
FX_Blood(trace_endpos, [1,0,0]);
} else {
FX_Impact(IMPACT_MELEE, trace_endpos, trace_plane_normal);
}
/* Damage is between 12 - 20, so let's just do 15 for now */
if (trace_ent.takedamage) {
Damage_Apply(trace_ent, pl, Skill_GetValue("plr_crowbar", 15), WEAPON_WRENCH, DMG_BLUNT);
/* don't bother with decals, we got squibs */
if (trace_ent.iBleeds) {
Sound_Play(self, CHAN_WEAPON, "weapon_crowbar.hitbody");
FX_Blood(trace_endpos, [1,0,0]);
} else {
FX_Impact(IMPACT_MELEE, trace_endpos, trace_plane_normal);
}
/* Damage without armor is between 12 - 20, so let's just do 15 for now */
if (trace_ent.takedamage) {
Damage_Apply(trace_ent, pl, Skill_GetValue("plr_wrench", 15), WEAPON_WRENCH, DMG_BLUNT);
if (trace_ent.iBleeds) {
Sound_Play(self, CHAN_WEAPON, "weapon_crowbar.hitbody");
}
} else {
Sound_Play(self, CHAN_WEAPON, "weapon_crowbar.hit");
}
} else {
Sound_Play(self, CHAN_WEAPON, "weapon_crowbar.hit");
}
#endif
}