DEFINE_ACTION_FUNCTION(AActor, A_CPosRefire) { // keep firing unless target got out of sight A_FaceTarget (self); // [BC] Client chaingunners continue to fire until told by the server to stop. if (( NETWORK_GetState( ) == NETSTATE_CLIENT ) || ( CLIENTDEMO_IsPlaying( ))) { return; } if (pr_cposrefire() < 40) return; if (!self->target || P_HitFriend (self) || self->target->health <= 0 || !P_CheckSight (self, self->target, SF_SEEPASTBLOCKEVERYTHING|SF_SEEPASTSHOOTABLELINES)) { // [BC] If we're the server, tell clients to update this thing's state. if ( NETWORK_GetState( ) == NETSTATE_SERVER ) SERVERCOMMANDS_SetThingState( self, STATE_SEE ); self->SetState (self->SeeState); } }
// // A_SpidRefire // // Spider Mastermind line-of-sight checking. // void A_SpidRefire(actionargs_t *actionargs) { Mobj *actor = actionargs->actor; // keep firing unless target got out of sight A_FaceTarget(actionargs); // killough 12/98: Stop firing if a friend has gotten in the way if(actor->flags & MF_FRIEND && P_HitFriend(actor)) { P_SetMobjState(actor, actor->info->seestate); return; } if(P_Random(pr_spidrefire) < 10) return; // killough 11/98: prevent refiring on friends continuously if(!actor->target || actor->target->health <= 0 || actor->flags & actor->target->flags & MF_FRIEND || !P_CheckSight(actor, actor->target)) { P_SetMobjState(actor, actor->info->seestate); } }
DEFINE_ACTION_FUNCTION(AActor, A_CPosRefire) { // keep firing unless target got out of sight A_FaceTarget (self); if (pr_cposrefire() < 40) return; if (!self->target || P_HitFriend (self) || self->target->health <= 0 || !P_CheckSight (self, self->target, SF_SEEPASTBLOCKEVERYTHING|SF_SEEPASTSHOOTABLELINES)) { self->SetState (self->SeeState); } }
DEFINE_ACTION_FUNCTION(AActor, A_SentinelRefire) { PARAM_ACTION_PROLOGUE; A_FaceTarget (self); if (pr_sentinelrefire() >= 30) { if (self->target == NULL || self->target->health <= 0 || !P_CheckSight (self, self->target, SF_SEEPASTBLOCKEVERYTHING|SF_SEEPASTSHOOTABLELINES) || P_HitFriend(self) || (self->MissileState == NULL && !self->CheckMeleeRange()) || pr_sentinelrefire() < 40) { self->SetState (self->SeeState); } } return 0; }