| 1854 | extern bool Pilot_MasterUpdate(); |
| 1855 | |
| 1856 | void NPC_RunBehavior( int team, int bState ) |
| 1857 | { |
| 1858 | // |
| 1859 | if ( bState == BS_CINEMATIC ) |
| 1860 | { |
| 1861 | NPC_BSCinematic(); |
| 1862 | } |
| 1863 | else if ( (NPCInfo->scriptFlags&SCF_PILOT) && Pilot_MasterUpdate()) |
| 1864 | { |
| 1865 | return; |
| 1866 | } |
| 1867 | else if ( NPC_JumpBackingUp() ) |
| 1868 | { |
| 1869 | return; |
| 1870 | } |
| 1871 | else if ( !TIMER_Done(NPC, "DEMP2_StunTime")) |
| 1872 | { |
| 1873 | NPC_UpdateAngles(qtrue, qtrue); |
| 1874 | return; |
| 1875 | } |
| 1876 | else if ( NPC->client->ps.weapon == WP_EMPLACED_GUN ) |
| 1877 | { |
| 1878 | NPC_BSEmplaced(); |
| 1879 | G_CheckCharmed( NPC ); |
| 1880 | return; |
| 1881 | } |
| 1882 | else if ( NPC->client->NPC_class == CLASS_HOWLER ) |
| 1883 | { |
| 1884 | NPC_BehaviorSet_Howler( bState ); |
| 1885 | return; |
| 1886 | } |
| 1887 | else if ( Jedi_CultistDestroyer( NPC ) ) |
| 1888 | { |
| 1889 | NPC_BSJedi_Default(); |
| 1890 | } |
| 1891 | else if ( NPC->client->NPC_class == CLASS_SABER_DROID ) |
| 1892 | {//saber droid |
| 1893 | NPC_BSSD_Default(); |
| 1894 | } |
| 1895 | else if ( NPC->client->ps.weapon == WP_SABER ) |
| 1896 | {//jedi |
| 1897 | NPC_BehaviorSet_Jedi( bState ); |
| 1898 | } |
| 1899 | else if ( NPC->client->NPC_class == CLASS_REBORN && NPC->client->ps.weapon == WP_MELEE ) |
| 1900 | {//force-only reborn |
| 1901 | NPC_BehaviorSet_Jedi( bState ); |
| 1902 | } |
| 1903 | else if ( NPC->client->NPC_class == CLASS_BOBAFETT ) |
| 1904 | { |
| 1905 | Boba_Update(); |
| 1906 | if (NPCInfo->surrenderTime) |
| 1907 | { |
| 1908 | Boba_Flee(); |
| 1909 | } |
| 1910 | else |
| 1911 | { |
| 1912 | if (!Boba_Tactics()) |
| 1913 | { |
no test coverage detected