1 /*
2 ===========================================================================
3 
4 Return to Castle Wolfenstein single player GPL Source Code
5 Copyright (C) 1999-2010 id Software LLC, a ZeniMax Media company.
6 
7 This file is part of the Return to Castle Wolfenstein single player GPL Source Code (“RTCW SP Source Code”).
8 
9 RTCW SP Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 RTCW SP Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with RTCW SP Source Code.  If not, see <http://www.gnu.org/licenses/>.
21 
22 In addition, the RTCW SP Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the RTCW SP Source Code.  If not, please request a copy in writing from id Software at the address below.
23 
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
25 
26 ===========================================================================
27 */
28 
29 //===========================================================================
30 //
31 // Name:			ai_cast_global.h
32 // Function:		Global AI Cast defines
33 // Programmer:		Ridah
34 // Tab Size:		4 (real tabs)
35 //===========================================================================
36 
37 // TTimo no typedef, "warning: useless keyword or type name in empty declaration"
38 struct cast_state_s;
39 
40 #define AICAST_AIM_SPREAD   2048.0  // a really bad shooter will offset a maximum of this per shot, from the end point of the 8192 trace length
41 
42 #define DANGER_MISSILE      ( 1 << 0 )
43 #define DANGER_CLIENTAIM    ( 1 << 1 )
44 #define DANGER_FLAMES       ( 1 << 2 )
45 
46 extern qboolean saveGamePending;
47 
48 qboolean AICast_SameTeam( struct cast_state_s *cs, int enemynum );
49 struct cast_state_s *AICast_GetCastState( int entitynum );
50 void AICast_ScriptLoad( void );
51 void AICast_ScriptEvent( struct cast_state_s *cs, char *eventStr, char *params );
52 void AICast_ForceScriptEvent( struct cast_state_s *cs, char *eventStr, char *params );
53 qboolean AICast_AIDamageOK( struct cast_state_s *cs, struct cast_state_s *ocs );
54 gentity_t *AICast_FindEntityForName( char *name );
55 gentity_t *AICast_TravEntityForName( gentity_t *startent, char *name );
56 void AICast_ScriptParse( struct cast_state_s *cs );
57 void AICast_StartFrame( int time );
58 void AICast_StartServerFrame( int time );
59 void AICast_RecordWeaponFire( gentity_t *ent );
60 void AICast_AIDoor_Touch( gentity_t *ent, gentity_t *aidoor_trigger, gentity_t *door );
61 float AICast_GetAccuracy( int entnum );
62 void AICast_Activate( int activatorNum, int entNum );
63 void AICast_CheckDangerousEntity( gentity_t *ent, int dangerFlags, float dangerDist, float tacticalLevel, float aggressionLevel, qboolean hurtFriendly );
64 qboolean AICast_NoFlameDamage( int entNum );
65 void AICast_SetFlameDamage( int entNum, qboolean status );
66 qboolean AICast_HasFiredWeapon( int entNum, int weapon );
67 void G_SetAASBlockingEntity( gentity_t *ent, qboolean blocking );
68 qboolean AICast_InFieldOfVision( vec3_t viewangles, float fov, vec3_t angles );
69 qboolean AICast_VisibleFromPos( vec3_t srcpos, int srcnum,
70 								vec3_t destpos, int destnum, qboolean updateVisPos );
71 qboolean AICast_AllowFlameDamage( int entNum );
72 void AICast_AdjustIdealYawForMover( int entnum, float yaw );
73 void AICast_AgePlayTime( int entnum );
74 int AICast_NoReload( int entnum );
75 void AICast_RecordScriptSound( int client );
76 void AICast_UpdateVisibility( gentity_t *srcent, gentity_t *destent, qboolean shareVis, qboolean directview );
77 void AICast_ProcessBullet( gentity_t *attacker, vec3_t start, vec3_t end );
78 void AICast_AudibleEvent( int srcnum, vec3_t pos, float range );
79 
80 //----(SA)	added
81 int AICast_PlayTime( int entnum );
82 int AICast_NumAttempts( int entnum );
83 //----(SA)	end
84 
85 void AICast_RegisterPain( int entnum );
86