Punchangle for sshogun hits
Posted: Sat Mar 21, 2015 6:47 pm
Im experimenting with punchangle in regard to close attacks with the ssg, and in traceattack () at the veery bottom I have:
Code: Select all
if (trace_ent.invincible_finished < time) // target has No pent
if (vlen (org - self.origin) < 200 && trace_ent.ishuman && self.weapon == 2) // range is under 200, for humans only attacker has ssg
{
if (trace_ent.origin_y + 5 < org_y) // +/- 5 unit buffer from targets center
trace_ent.punchangle_y = vlen(org - self.origin) /5; // a value of about 40 just for tests
if (trace_ent.origin_y - 5 > org_y)
trace_ent.punchangle_y = vlen(org - self.origin) / -5;
}
Is there a better way to do this and also include the _x and _z factors as well? Has any other mod tried this? Feel free to add code and colaborate.