From 2191b4bfa6c9ac10e540f0b308565a527f11de4e Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sat, 1 Jun 2013 02:19:18 +0000 Subject: [PATCH] - Added ACS function LineAttack via Ryan Cordell. SVN r4304 (trunk) --- src/p_acs.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 71c0f53f3e..57bcc07c27 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -4112,6 +4112,7 @@ enum EACSFunctions ACSF_SetCVarString, ACSF_GetUserCVarString, ACSF_SetUserCVarString, + ACSF_LineAttack, // ZDaemon ACSF_GetTeamScore = 19620, // (int team) @@ -4853,6 +4854,33 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args) } break; + //[RC] A bullet firing function for ACS. Thanks to DavidPH. + case ACSF_LineAttack: + { + fixed_t angle = args[1] << FRACBITS; + fixed_t pitch = args[2] << FRACBITS; + int damage = args[3]; + FName pufftype = argCount > 4 && args[4]? FName(FBehavior::StaticLookupString(args[4])) : NAME_BulletPuff; + FName damagetype = argCount > 5 && args[5]? FName(FBehavior::StaticLookupString(args[5])) : NAME_None; + fixed_t range = argCount > 6 && args[6]? args[6] : 0x7FFFFFFF; + + if (args[0] == 0) + { + P_LineAttack(activator, angle, range, pitch, damage, damagetype, pufftype); + } + else + { + AActor *source; + FActorIterator it(args[0]); + + while ((source = it.Next()) != NULL) + { + P_LineAttack(activator, angle, range, pitch, damage, damagetype, pufftype); + } + } + } + break; + default: break; }