‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
destructible_character.gsh
Go to the documentation of this file.
1 #define DESTRUCT_CLIENTFIELD "destructible_character_state"
2 #define DESTRUCT_CLIENTFIELD_TYPE "int"
3 
4 // 20 possible states and 1 toggle bit to determine if spawning gib models should happen on the client.
5 // The toggle bit is used to predamage characters when they are spawned in, without creating gib models.
6 // (20 + 1) states
7 #define DESTRUCT_CLIENTFIELD_BITS 21
8 
9 #define DESTRUCT_UNDAMAGED_FLAG 0
10 #define DESTRUCT_TOGGLE_GIB_MODEL_FLAG 1
11 
12 #define DESTRUCT_MAX_PIECES 20
13 
14 #define GET_DESTRUCT_FLAG(destruct_piece_number) (1 << destruct_piece_number)
15 #define GET_DESTRUCT_FLAGS(old_destruct_state,current_destruct_state) (old_destruct_state ^ current_destruct_state)
16 #define GET_DESTRUCT_BUNDLE(entity) struct::get_script_bundle( "destructiblecharacterdef", entity.destructibledef )
17 #define GET_DESTRUCT_BUNDLES struct::get_script_bundles( "destructiblecharacterdef" )
18 #define HAS_DESTRUCT_DEF(entity) IsDefined(entity.destructibledef)
19 #define IS_DESTRUCTED(destruct_state,destruct_flag) (destruct_state & destruct_flag)
20 // Pieces numbers start at 1, and stop at DESTRUCT_MAX_PIECES
21 #define IS_VALID_PIECE_NUMBER(piece_number) (1 <= piece_number && piece_number <= 20)
22 #define SET_DESTRUCTED(destruct_state,destruct_flag) (destruct_state | destruct_flag)
23 #define SHOULD_SPAWN_DESTRUCT_GIBS(destruct_state) (destruct_state & 1)
24