Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
engine_weap.h
1/* Renegade Scripts.dll
2 Copyright 2013 Tiberian Technologies
3
4 This file is part of the Renegade scripts.dll
5 The Renegade scripts.dll is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free
7 Software Foundation; either version 2, or (at your option) any later
8 version. See the file COPYING for more details.
9 In addition, an exemption is given to allow Run Time Dynamic Linking of this code with any closed source module that does not contain code covered by this licence.
10 Only the source code to the module(s) containing the licenced code has to be released.
11*/
12#ifndef SCRIPTS_INCLUDE__ENGINE_WEAP_H
13#define SCRIPTS_INCLUDE__ENGINE_WEAP_H
14
15class AmmoDefinitionClass;
16class WeaponDefinitionClass;
17class ExplosionDefinitionClass;
18class BeaconGameObj;
19
20// -------------------------------------------------------------------------------------------------
21
34SCRIPTS_API int Get_Bullets(GameObject *obj,const char *weapon);
35
47SCRIPTS_API int Get_Max_Bullets(GameObject *obj,const char *weapon);
48
61SCRIPTS_API int Get_Clip_Bullets(GameObject *obj,const char *weapon);
62
74SCRIPTS_API int Get_Max_Clip_Bullets(GameObject *obj,const char *weapon);
75
88SCRIPTS_API int Get_Total_Bullets(GameObject *obj,const char *weapon);
89
101SCRIPTS_API int Get_Max_Total_Bullets(GameObject *obj,const char *weapon);
102
103// -------------------------------------------------------------------------------------------------
104
113SCRIPTS_API int Get_Current_Bullets(GameObject *obj);
114
123SCRIPTS_API int Get_Current_Max_Bullets(GameObject *obj);
124
133SCRIPTS_API int Get_Current_Clip_Bullets(GameObject *obj);
134
143SCRIPTS_API int Get_Current_Clip_Max_Bullets(GameObject *obj);
144
153SCRIPTS_API int Get_Current_Total_Bullets(GameObject *obj);
154
163SCRIPTS_API int Get_Current_Total_Max_Bullets(GameObject *obj);
164
165// -------------------------------------------------------------------------------------------------
166
177SCRIPTS_API int Get_Position_Bullets(GameObject *obj, int position);
178
189SCRIPTS_API int Get_Position_Max_Bullets(GameObject *obj, int position);
190
201SCRIPTS_API int Get_Position_Clip_Bullets(GameObject *obj, int position);
202
213SCRIPTS_API int Get_Position_Clip_Max_Bullets(GameObject *obj, int position);
214
225SCRIPTS_API int Get_Position_Total_Bullets(GameObject *obj, int position);
226
237SCRIPTS_API int Get_Position_Total_Max_Bullets(GameObject *obj, int position);
238
239// -------------------------------------------------------------------------------------------------
240
241SCRIPTS_API const char *Get_Powerup_Weapon(const char *Powerup); //Get the weapon name that a powerup will grant if collected
242SCRIPTS_API const AmmoDefinitionClass *Get_Weapon_Ammo_Definition(const char *weapon,bool PrimaryFire); //Get the AmmoDefinitionClass of a weapon given its preset name
243SCRIPTS_API const WeaponDefinitionClass *Get_Weapon_Definition(const char *weapon); //Get the WeaponDefinitionClass of a weapon given its preset name
244SCRIPTS_API const WeaponDefinitionClass *Get_Current_Weapon_Definition(GameObject *obj); //Get the WeaponDefinitionClass of an objects current weapon
245SCRIPTS_API const WeaponDefinitionClass *Get_Position_Weapon_Definition(GameObject *obj,int position); //Get the WeaponDefinitionClass of an objects weapon at the specified position
246SCRIPTS_API const ExplosionDefinitionClass *Get_Explosion(const char *explosion); //Get the ExplosionDefinitionClass of an explosion given its preset name
247SCRIPTS_API const char *Get_Powerup_Weapon_By_Obj(GameObject *Powerup); //Get the name of a powerup weapon given a PowerUpGameObj
248SCRIPTS_API int Get_Current_Weapon_Style(GameObject *obj); //Get weapon style for an objects current gun
249SCRIPTS_API int Get_Position_Weapon_Style(GameObject *obj,int position); //Get weapon style for an objects gun at a specific position
250SCRIPTS_API int Get_Weapon_Style(GameObject *obj,const char *weapon); //Get weapon style for a specific gun (if the object doesnt have the gun, return is zero)
251SCRIPTS_API void Disarm_Beacon(GameObject *obj); //Disarm a beacon
252SCRIPTS_API void Disarm_Beacons(int PlayerID); //Disarm all beacons for a player
253SCRIPTS_API void Disarm_C4(GameObject *obj); //Disarm a C4 object
254SCRIPTS_API void Disarm_All_C4_Beacons(int PlayerID); //Disarm all C4 and beacons owned by a player
255SCRIPTS_API const char *Get_Current_Weapon(GameObject *obj); //gets the current weapon of an object
256SCRIPTS_API int Get_Weapon_Count(GameObject *obj); //gets the weapon count for an object
257SCRIPTS_API const char *Get_Weapon(GameObject *obj,int position); //get the specified position in the weapon bag
258SCRIPTS_API bool Has_Weapon(GameObject *obj,const char *weapon); //does the object have the weapon
259SCRIPTS_API GameObject *Find_Beacon(int Number,int Team); //find a beacon
260
261enum C4Type
262{
263 C4_REMOTE = 1,
264 C4_TIMED = 2,
265 C4_PROXY = 3
266};
267
268SCRIPTS_API int Get_C4_Count(int team, int type = 0); // get C4 count by type
269SCRIPTS_API void Defuse_Owned_C4(int player_id, int type = 0); // defuse all C4 owned by a player of a certain type (or 0 for all types)
270SCRIPTS_API void Defuse_Attached_C4(GameObject* attached_object); // defuse all C4 attached to an object or (use nullptr for all unattached C4)
271
272
273SCRIPTS_API int Get_Beacon_Count(int Team); //get the beacon count
274SCRIPTS_API int Get_C4_Mode(GameObject *obj); //get the C4 mode for a C4GameObj
275SCRIPTS_API GameObject *Get_C4_Planter(GameObject *obj); //Gets the planter of a C4GameObj
276SCRIPTS_API GameObject *Get_C4_Attached(GameObject *obj); //Gets the object a C4GameObj is attached to (if any)
277SCRIPTS_API GameObject *Get_Beacon_Planter(GameObject *obj); //Gets the planter of a BeaconGameObj
278SCRIPTS_API BeaconGameObj* Find_Nearest_Beacon(const Vector3& position, int team); //Find the nearest beacon to a position
279#endif