MCPcopy Create free account
hub / github.com/JACoders/OpenJK / NPC_WeaponsForTeam

Function NPC_WeaponsForTeam

code/game/NPC_spawn.cpp:696–912  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

694*/
695
696int NPC_WeaponsForTeam( team_t team, int spawnflags, const char *NPC_type )
697{
698 //*** not sure how to handle this, should I pass in class instead of team and go from there? - dmv
699 switch(team)
700 {
701 // no longer exists
702
703// case TEAM_IMPERIAL:
704 case TEAM_ENEMY:
705 if ( Q_stricmp( "tavion", NPC_type ) == 0 ||
706 Q_stricmpn( "reborn", NPC_type, 6 ) == 0 ||
707 Q_stricmp( "desann", NPC_type ) == 0 ||
708 Q_stricmpn( "shadowtrooper", NPC_type, 13 ) == 0 )
709 return ( 1 << WP_SABER);
710// return ( 1 << WP_IMPERIAL_BLADE);
711 //NOTENOTE: Falls through if not a knife user
712
713 //FIXME: default weapon in npc config?
714 if ( Q_stricmpn( "stofficer", NPC_type, 9 ) == 0 )
715 {
716 return ( 1 << WP_FLECHETTE);
717 }
718 if ( Q_stricmp( "stcommander", NPC_type ) == 0 )
719 {
720 return ( 1 << WP_REPEATER);
721 }
722 if ( Q_stricmp( "swamptrooper", NPC_type ) == 0 )
723 {
724 return ( 1 << WP_FLECHETTE);
725 }
726 if ( Q_stricmp( "swamptrooper2", NPC_type ) == 0 )
727 {
728 return ( 1 << WP_REPEATER);
729 }
730 if ( Q_stricmp( "rockettrooper", NPC_type ) == 0 )
731 {
732 return ( 1 << WP_ROCKET_LAUNCHER);
733 }
734 if ( Q_stricmpn( "shadowtrooper", NPC_type, 13 ) == 0 )
735 {
736 return ( 1 << WP_SABER);//|( 1 << WP_RAPID_CONCUSSION)?
737 }
738 if ( Q_stricmp( "imperial", NPC_type ) == 0 )
739 {
740 return ( 1 << WP_BLASTER_PISTOL);
741 }
742 if ( Q_stricmpn( "impworker", NPC_type, 9 ) == 0 )
743 {
744 return ( 1 << WP_BLASTER_PISTOL);
745 }
746 if ( Q_stricmp( "stormpilot", NPC_type ) == 0 )
747 {
748 return ( 1 << WP_BLASTER_PISTOL);
749 }
750 if ( Q_stricmp( "galak", NPC_type ) == 0 )
751 {
752 return ( 1 << WP_BLASTER);
753 }

Callers 2

NPC_SetWeaponsFunction · 0.70
NPC_PrecacheWeaponsFunction · 0.70

Calls 2

Q_stricmpFunction · 0.85
Q_stricmpnFunction · 0.85

Tested by

no test coverage detected