- added DavidPH's LifeSteal patch for A_CustomPunch/A_Saw.

SVN r2317 (trunk)
This commit is contained in:
Christoph Oelckers 2010-05-12 07:08:39 +00:00
parent 942108f7ea
commit 6a57a43277
3 changed files with 16 additions and 4 deletions

View file

@ -110,6 +110,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Saw)
ACTION_PARAM_SOUND(hitsound, 1); ACTION_PARAM_SOUND(hitsound, 1);
ACTION_PARAM_INT(damage, 2); ACTION_PARAM_INT(damage, 2);
ACTION_PARAM_CLASS(pufftype, 3); ACTION_PARAM_CLASS(pufftype, 3);
ACTION_PARAM_FIXED(Range, 4)
ACTION_PARAM_FIXED(LifeSteal, 5);
if (NULL == (player = self->player)) if (NULL == (player = self->player))
{ {
@ -131,8 +133,10 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Saw)
angle += pr_saw.Random2() << 18; angle += pr_saw.Random2() << 18;
// use meleerange + 1 so the puff doesn't skip the flash (i.e. plays all states) // use meleerange + 1 so the puff doesn't skip the flash (i.e. plays all states)
P_LineAttack (self, angle, MELEERANGE+1, if (Range == 0) Range = MELEERANGE+1;
P_AimLineAttack (self, angle, MELEERANGE+1, &linetarget), damage,
P_LineAttack (self, angle, Range,
P_AimLineAttack (self, angle, Range, &linetarget), damage,
NAME_None, pufftype); NAME_None, pufftype);
if (!linetarget) if (!linetarget)
@ -140,6 +144,10 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Saw)
S_Sound (self, CHAN_WEAPON, fullsound, 1, ATTN_NORM); S_Sound (self, CHAN_WEAPON, fullsound, 1, ATTN_NORM);
return; return;
} }
if (LifeSteal)
P_GiveBody (self, (damage * LifeSteal) >> FRACBITS);
S_Sound (self, CHAN_WEAPON, hitsound, 1, ATTN_NORM); S_Sound (self, CHAN_WEAPON, hitsound, 1, ATTN_NORM);
// turn to face target // turn to face target

View file

@ -1080,6 +1080,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch)
ACTION_PARAM_BOOL(UseAmmo, 2); ACTION_PARAM_BOOL(UseAmmo, 2);
ACTION_PARAM_CLASS(PuffType, 3); ACTION_PARAM_CLASS(PuffType, 3);
ACTION_PARAM_FIXED(Range, 4); ACTION_PARAM_FIXED(Range, 4);
ACTION_PARAM_FIXED(LifeSteal, 5);
if (!self->player) return; if (!self->player) return;
@ -1110,6 +1111,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch)
// turn to face target // turn to face target
if (linetarget) if (linetarget)
{ {
if (LifeSteal)
P_GiveBody (self, (Damage * LifeSteal) >> FRACBITS);
S_Sound (self, CHAN_WEAPON, weapon->AttackSound, 1, ATTN_NORM); S_Sound (self, CHAN_WEAPON, weapon->AttackSound, 1, ATTN_NORM);
self->angle = R_PointToAngle2 (self->x, self->angle = R_PointToAngle2 (self->x,

View file

@ -7,7 +7,7 @@ ACTOR Inventory native
Inventory.PickupSound "misc/i_pkup" Inventory.PickupSound "misc/i_pkup"
action native A_JumpIfNoAmmo(state label); action native A_JumpIfNoAmmo(state label);
action native A_CustomPunch(int damage, bool norandom = false, bool useammo = true, class<Actor> pufftype = "BulletPuff", float range = 0); action native A_CustomPunch(int damage, bool norandom = false, bool useammo = true, class<Actor> pufftype = "BulletPuff", float range = 0, float lifesteal = 0);
action native A_FireBullets(float spread_xy, float spread_z, int numbullets, int damageperbullet, class<Actor> pufftype = "BulletPuff", bool useammo = true, float range = 0); action native A_FireBullets(float spread_xy, float spread_z, int numbullets, int damageperbullet, class<Actor> pufftype = "BulletPuff", bool useammo = true, float range = 0);
action native A_FireCustomMissile(class<Actor> missiletype, float angle = 0, bool useammo = true, int spawnofs_xy = 0, float spawnheight = 0, bool aimatangle = false, float pitch = 0); action native A_FireCustomMissile(class<Actor> missiletype, float angle = 0, bool useammo = true, int spawnofs_xy = 0, float spawnheight = 0, bool aimatangle = false, float pitch = 0);
action native A_RailAttack(int damage, int spawnofs_xy = 0, int useammo = true, color color1 = "", color color2 = "", int flags = 0, float maxdiff = 0, class<Actor> pufftype = "BulletPuff"); action native A_RailAttack(int damage, int spawnofs_xy = 0, int useammo = true, color color1 = "", color color2 = "", int flags = 0, float maxdiff = 0, class<Actor> pufftype = "BulletPuff");
@ -40,7 +40,7 @@ ACTOR Inventory native
action native A_ClearReFire(); action native A_ClearReFire();
action native A_CheckReload(); action native A_CheckReload();
action native A_GunFlash(state flash = ""); action native A_GunFlash(state flash = "");
action native A_Saw(sound fullsound = "weapons/sawfull", sound hitsound = "weapons/sawhit", int damage = 2, class<Actor> pufftype = "BulletPuff"); action native A_Saw(sound fullsound = "weapons/sawfull", sound hitsound = "weapons/sawhit", int damage = 2, class<Actor> pufftype = "BulletPuff", float range = 0, float lifesteal = 0);
action native A_CheckForReload(int counter, state label, bool dontincrement = false); action native A_CheckForReload(int counter, state label, bool dontincrement = false);
action native A_ResetReloadCounter(); action native A_ResetReloadCounter();
action native A_RestoreSpecialPosition(); action native A_RestoreSpecialPosition();