Added Thing_Damage3 function

It acts as a simple wrapper around P_DamageMobj which can damage a
single actor, but can also set the actor inflicting the damage. It
returns the amount of damage actually done, or -1 if the damaging was
cancelled.
This commit is contained in:
arookas 2016-08-31 22:04:22 -04:00 committed by Christoph Oelckers
parent bf5f10a897
commit d14782fb37

View file

@ -4450,6 +4450,7 @@ enum EACSFunctions
*/ */
ACSF_CheckClass = 200, ACSF_CheckClass = 200,
ACSF_Thing_Damage3, // [arookas]
// ZDaemon // ZDaemon
ACSF_GetTeamScore = 19620, // (int team) ACSF_GetTeamScore = 19620, // (int team)
@ -6035,6 +6036,15 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
const char *clsname = FBehavior::StaticLookupString(args[0]); const char *clsname = FBehavior::StaticLookupString(args[0]);
return !!PClass::FindActor(clsname); return !!PClass::FindActor(clsname);
} }
case ACSF_Thing_Damage3: // [arookas] wrapper around P_DamageMobj
{
// (target, ptr_select1, inflictor, ptr_select2, amount, damagetype)
AActor* target = COPY_AAPTR(SingleActorFromTID(args[0], activator), args[1]);
AActor* inflictor = COPY_AAPTR(SingleActorFromTID(args[2], activator), args[3]);
FName damagetype(FBehavior::StaticLookupString(args[5]));
return P_DamageMobj(target, inflictor, inflictor, args[4], damagetype);
}
default: default:
break; break;