/* ------------------------- Sentry_RangedAttack ------------------------- */ void Sentry_RangedAttack( qboolean visible, qboolean advance ) { if ( TIMER_Done( NPC, "attackDelay" ) && NPC->attackDebounceTime < level.time && visible ) // Attack? { if ( NPCInfo->burstCount > 6 ) { if ( !NPC->fly_sound_debounce_time ) {//delay closing down to give the player an opening NPC->fly_sound_debounce_time = level.time + Q_irand( 500, 2000 ); } else if ( NPC->fly_sound_debounce_time < level.time ) { NPCInfo->localState = LSTATE_ACTIVE; NPC->fly_sound_debounce_time = NPCInfo->burstCount = 0; TIMER_Set( NPC, "attackDelay", Q_irand( 2000, 3500 ) ); NPC->flags |= FL_SHIELDED; NPC_SetAnim( NPC, SETANIM_BOTH, BOTH_FLY_SHIELDED, SETANIM_FLAG_OVERRIDE | SETANIM_FLAG_HOLD ); G_SoundOnEnt( NPC, CHAN_AUTO, "sound/chars/sentry/misc/sentry_shield_close" ); } } else { Sentry_Fire(); } } if ( NPCInfo->scriptFlags & SCF_CHASE_ENEMIES ) { Sentry_Hunt( visible, advance ); } }
void lvl1_sentry_atk2( ) { self->s.v.frame = 2; self->s.v.think = ( func_t ) lvl1_sentry_atk3; self->s.v.nextthink = g_globalvars.time + 0.1; ai_face( ); Sentry_Fire( ); }
void lvl1_sentry_atk1( ) { gedict_t *enemy = PROG_TO_EDICT( self->s.v.enemy ); self->s.v.frame = 1; self->s.v.think = ( func_t ) lvl1_sentry_atk3; self->s.v.nextthink = g_globalvars.time + 0.1; ai_face( ); if ( enemy == world || enemy->is_feigning || enemy->s.v.health <= 0 || !visible( enemy ) || enemy->has_disconnected == 1 ) lvl1_sentry_stand( ); else { if ( self->s.v.ammo_shells <= 0 && !tg_data.sg_unlimit_ammo ) lvl1_sentry_stand( ); else { if ( !Sentry_Fire( ) ) lvl1_sentry_atk3( ); } } }