DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DualPainAttack) { if (!self->target) return; const PClass *spawntype = GetSpawnType(PUSH_PARAMINFO); A_FaceTarget (self); A_PainShootSkull (self, self->angle + ANG45, spawntype); A_PainShootSkull (self, self->angle - ANG45, spawntype); }
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PainDie) { if (self->target != NULL && self->IsFriend (self->target)) { // And I thought you were my friend! self->flags &= ~MF_FRIENDLY; } const PClass *spawntype = GetSpawnType(PUSH_PARAMINFO); A_Unblock(self, true); A_PainShootSkull (self, self->angle + ANG90, spawntype); A_PainShootSkull (self, self->angle + ANG180, spawntype); A_PainShootSkull (self, self->angle + ANG270, spawntype); }
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DualPainAttack) { PARAM_ACTION_PROLOGUE; if (!self->target) return 0; PClassActor *spawntype = GetSpawnType(numparam > NAP ? ¶m[NAP] : NULL); A_FaceTarget (self); A_PainShootSkull (self, self->angle + ANG45, spawntype); A_PainShootSkull (self, self->angle - ANG45, spawntype); return 0; }
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PainDie) { PARAM_ACTION_PROLOGUE; if (self->target != NULL && self->IsFriend(self->target)) { // And I thought you were my friend! self->flags &= ~MF_FRIENDLY; } PClassActor *spawntype = GetSpawnType(numparam > NAP ? ¶m[NAP] : NULL); A_Unblock(self, true); A_PainShootSkull (self, self->angle + ANG90, spawntype); A_PainShootSkull (self, self->angle + ANG180, spawntype); A_PainShootSkull (self, self->angle + ANG270, spawntype); return 0; }
/* ============== idSpawner::SpawnEnt ============== */ bool idSpawner::SpawnEnt( void ){ idDict args; idEntity* spawnPoint; idEntity* spawnedEnt; const char* temp; // Find a spawn point to spawn the entity spawnPoint = GetSpawnPoint(); if ( spawnPoint == NULL ){ return false; } // No valid spawn types for this point temp = GetSpawnType( spawnPoint ); if ( !temp || !*temp ) { gameLocal.Warning ( "Spawner '%s' could not find any valid spawn types for spawn point '%s'", GetName(), spawnPoint->GetName() ); return false; } // Build the spawn parameters for the entity about to be spawned args.Set( "origin", spawnPoint->GetPhysics()->GetOrigin().ToString() ); if ( spawnArgs.GetBool( "face_enemy", "0" ) ) { idVec3 dir = gameLocal.GetLocalPlayer()->GetPhysics()->GetOrigin() - spawnPoint->GetPhysics()->GetOrigin(); dir.Normalize(); args.SetFloat( "angle", dir.ToYaw() ); } else { args.SetFloat( "angle", spawnPoint->GetPhysics()->GetAxis().ToAngles()[ YAW ] ); } args.Set( "classname", temp ); args.SetBool( "forceEnemy", spawnArgs.GetBool( "auto_target", "0" ) ); args.SetInt( "teleport", spawnArgs.GetInt( "teleport", "0" ) ); // Copy all keywords prefixed with "spawn_" to the entity being spawned. CopyPrefixedSpawnArgs( this, "spawn_", args ); if ( spawnPoint != this ) { CopyPrefixedSpawnArgs( spawnPoint, "spawn_", args ); } // Spawn the entity if ( !gameLocal.SpawnEntityDef( args, &spawnedEnt ) ) { return false; } // Activate the spawned entity spawnedEnt->ProcessEvent( &EV_Activate, this ); // script function for spawning guys //if ( spawnArgs.GetString( "call", "", &temp ) && *temp ) { // gameLocal.CallFrameCommand( this, temp ); //} // script function for the guy being spawned //if ( spawnArgs.GetString( "call_spawned", "", &temp ) && *temp ) { // gameLocal.CallFrameCommand( spawnedEnt, temp ); //} // Call all of our callbacks //int c; //for ( c = callbacks.Num() - 1; c >= 0; c-- ) { // if ( callbacks[ c ].ent ) { // callbacks[ c ].ent->ProcessEvent( idEventDef::FindEvent( callbacks[ c ].event ), this, spawnedEnt ); // } //} // Activate the spawn point entity when an enemy is spawned there and all of its targets if ( spawnPoint != this ) { spawnPoint->ProcessEvent( &EV_Activate, spawnPoint ); spawnPoint->ActivateTargets( spawnedEnt ); // One time use on this target? if ( spawnPoint->spawnArgs.GetBool( "remove" ) ) { spawnPoint->PostEventMS( &EV_Remove, 0 ); } } // Increment the total number spawned numSpawned++; return true; }