|
|
@ -2035,14 +2035,14 @@ Schedule_t *CHGrunt :: GetSchedule( void ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
case MONSTERSTATE_COMBAT: |
|
|
|
case MONSTERSTATE_COMBAT: |
|
|
|
{ |
|
|
|
{ |
|
|
|
// dead enemy
|
|
|
|
// dead enemy
|
|
|
|
if ( HasConditions( bits_COND_ENEMY_DEAD ) ) |
|
|
|
if ( HasConditions( bits_COND_ENEMY_DEAD ) ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// call base class, all code to handle dead enemies is centralized there.
|
|
|
|
// call base class, all code to handle dead enemies is centralized there.
|
|
|
|
return CBaseMonster :: GetSchedule(); |
|
|
|
return CBaseMonster :: GetSchedule(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// new enemy
|
|
|
|
// new enemy
|
|
|
|
if ( HasConditions(bits_COND_NEW_ENEMY) ) |
|
|
|
if ( HasConditions(bits_COND_NEW_ENEMY) ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if ( InSquad() ) |
|
|
|
if ( InSquad() ) |
|
|
@ -2089,7 +2089,7 @@ Schedule_t *CHGrunt :: GetSchedule( void ) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// no ammo
|
|
|
|
// no ammo
|
|
|
|
else if ( HasConditions ( bits_COND_NO_AMMO_LOADED ) ) |
|
|
|
else if ( HasConditions ( bits_COND_NO_AMMO_LOADED ) ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
//!!!KELLY - this individual just realized he's out of bullet ammo.
|
|
|
|
//!!!KELLY - this individual just realized he's out of bullet ammo.
|
|
|
@ -2098,7 +2098,7 @@ Schedule_t *CHGrunt :: GetSchedule( void ) |
|
|
|
return GetScheduleOfType ( SCHED_GRUNT_COVER_AND_RELOAD ); |
|
|
|
return GetScheduleOfType ( SCHED_GRUNT_COVER_AND_RELOAD ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// damaged just a little
|
|
|
|
// damaged just a little
|
|
|
|
else if ( HasConditions( bits_COND_LIGHT_DAMAGE ) ) |
|
|
|
else if ( HasConditions( bits_COND_LIGHT_DAMAGE ) ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// if hurt:
|
|
|
|
// if hurt:
|
|
|
@ -2124,19 +2124,19 @@ Schedule_t *CHGrunt :: GetSchedule( void ) |
|
|
|
return GetScheduleOfType( SCHED_SMALL_FLINCH ); |
|
|
|
return GetScheduleOfType( SCHED_SMALL_FLINCH ); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// can kick
|
|
|
|
// can kick
|
|
|
|
else if ( HasConditions ( bits_COND_CAN_MELEE_ATTACK1 ) ) |
|
|
|
else if ( HasConditions ( bits_COND_CAN_MELEE_ATTACK1 ) ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return GetScheduleOfType ( SCHED_MELEE_ATTACK1 ); |
|
|
|
return GetScheduleOfType ( SCHED_MELEE_ATTACK1 ); |
|
|
|
} |
|
|
|
} |
|
|
|
// can grenade launch
|
|
|
|
// can grenade launch
|
|
|
|
|
|
|
|
|
|
|
|
else if ( FBitSet( pev->weapons, HGRUNT_GRENADELAUNCHER) && HasConditions ( bits_COND_CAN_RANGE_ATTACK2 ) && OccupySlot( bits_SLOTS_HGRUNT_GRENADE ) ) |
|
|
|
else if ( FBitSet( pev->weapons, HGRUNT_GRENADELAUNCHER) && HasConditions ( bits_COND_CAN_RANGE_ATTACK2 ) && OccupySlot( bits_SLOTS_HGRUNT_GRENADE ) ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// shoot a grenade if you can
|
|
|
|
// shoot a grenade if you can
|
|
|
|
return GetScheduleOfType( SCHED_RANGE_ATTACK2 ); |
|
|
|
return GetScheduleOfType( SCHED_RANGE_ATTACK2 ); |
|
|
|
} |
|
|
|
} |
|
|
|
// can shoot
|
|
|
|
// can shoot
|
|
|
|
else if ( HasConditions ( bits_COND_CAN_RANGE_ATTACK1 ) ) |
|
|
|
else if ( HasConditions ( bits_COND_CAN_RANGE_ATTACK1 ) ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if ( InSquad() ) |
|
|
|
if ( InSquad() ) |
|
|
@ -2167,7 +2167,7 @@ Schedule_t *CHGrunt :: GetSchedule( void ) |
|
|
|
return GetScheduleOfType( SCHED_TAKE_COVER_FROM_ENEMY ); |
|
|
|
return GetScheduleOfType( SCHED_TAKE_COVER_FROM_ENEMY ); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// can't see enemy
|
|
|
|
// can't see enemy
|
|
|
|
else if ( HasConditions( bits_COND_ENEMY_OCCLUDED ) ) |
|
|
|
else if ( HasConditions( bits_COND_ENEMY_OCCLUDED ) ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if ( HasConditions( bits_COND_CAN_RANGE_ATTACK2 ) && OccupySlot( bits_SLOTS_HGRUNT_GRENADE ) ) |
|
|
|
if ( HasConditions( bits_COND_CAN_RANGE_ATTACK2 ) && OccupySlot( bits_SLOTS_HGRUNT_GRENADE ) ) |
|
|
@ -2212,6 +2212,9 @@ Schedule_t *CHGrunt :: GetSchedule( void ) |
|
|
|
return GetScheduleOfType ( SCHED_GRUNT_ESTABLISH_LINE_OF_FIRE ); |
|
|
|
return GetScheduleOfType ( SCHED_GRUNT_ESTABLISH_LINE_OF_FIRE ); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// no special cases here, call the base class
|
|
|
|
// no special cases here, call the base class
|
|
|
|