Debian Codegraph @

lib/robotfirestruct.h

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #ifndef ROBOTFIRESTRUCT_H_
20 #define ROBOTFIRESTRUCT_H_cxx . . $ `lib/robotfirestruct.h:20:9`!
21
22 #include <cstdint>
23
24 #include "robotfirestruct_external.h"cxx . . $ `<file>/lib/robotfirestruct_external.h`/
25 #include "vecmat.h"cxx . . $ `<file>/lib/vecmat.h`/
26
27 // NOTE: CHANGE gunbattery.h (IN POFGEN PROJECT) if constants are changed
28 // NOTE: Robots are limited to the number of wb configurations of the player. This seem like an
29 // adequit number (currently 21)
30 // (MAX_PRIMARY_WEAPONS + MAX_SECONDARY_WEAPONS + 1/*Flare*/)
31 // NOTE: Cannot include weapon.h because of circular dependances.
32 #define MAX_WBS_PER_OBJcxx . . $ `lib/robotfirestruct.h:32:9`! 21
33
34 // Attach to the polymodel
35 struct poly_wb_infocxx . . $ poly_wb_info# {
36 // Static Data (Add to robot generic page)
37 uint16_tcxx . . $ uint16_t# num_gpscxx . . $ poly_wb_info#num_gps.;
38 uint8_tcxx . . $ uint8_t# gp_indexcxx . . $ poly_wb_info#gp_index.[MAX_WB_GUNPOINTScxx . . $ `lib/robotfirestruct_external.h:22:9`!];
39
40 // Turrets are listed from most important (greatest mobility) to least important
41 uint8_tcxx . . $ uint8_t# num_turretscxx . . $ poly_wb_info#num_turrets.;
42 uint16_tcxx . . $ uint16_t# turret_indexcxx . . $ poly_wb_info#turret_index.[MAX_WB_TURRETScxx . . $ `lib/robotfirestruct_external.h:24:9`!];
43
44 };
45
46 // Next free WBF is 32
47
48 // Attach to a object type
49 struct otype_wb_infocxx . . $ otype_wb_info# {
50 uint16_tcxx . . $ uint16_t# gp_weapon_indexcxx . . $ otype_wb_info#gp_weapon_index.[MAX_WB_GUNPOINTScxx . . $ `lib/robotfirestruct_external.h:22:9`!];
51 uint16_tcxx . . $ uint16_t# fm_fire_sound_indexcxx . . $ otype_wb_info#fm_fire_sound_index.[MAX_WB_FIRING_MASKScxx . . $ `lib/robotfirestruct_external.h:23:9`!];
52 uint16_tcxx . . $ uint16_t# aiming_gp_indexcxx . . $ otype_wb_info#aiming_gp_index.;
53
54 uint8_tcxx . . $ uint8_t# num_maskscxx . . $ otype_wb_info#num_masks.;
55 uint8_tcxx . . $ uint8_t# gp_fire_maskscxx . . $ otype_wb_info#gp_fire_masks.[MAX_WB_FIRING_MASKScxx . . $ `lib/robotfirestruct_external.h:23:9`!];
56 float gp_fire_waitcxx . . $ otype_wb_info#gp_fire_wait.[MAX_WB_FIRING_MASKScxx . . $ `lib/robotfirestruct_external.h:23:9`!];
57
58 uint8_tcxx . . $ uint8_t# gp_quad_fire_maskcxx . . $ otype_wb_info#gp_quad_fire_mask.;
59
60 uint8_tcxx . . $ uint8_t# num_levelscxx . . $ otype_wb_info#num_levels.;
61 uint16_tcxx . . $ uint16_t# gp_level_weapon_indexcxx . . $ otype_wb_info#gp_level_weapon_index.[MAX_WB_UPGRADEScxx . . $ `lib/robotfirestruct_external.h:41:9`!];
62 uint16_tcxx . . $ uint16_t# gp_level_fire_sound_indexcxx . . $ otype_wb_info#gp_level_fire_sound_index.[MAX_WB_UPGRADEScxx . . $ `lib/robotfirestruct_external.h:41:9`!];
63
64 uint8_tcxx . . $ uint8_t# aiming_flagscxx . . $ otype_wb_info#aiming_flags.;
65 float aiming_3d_dotcxx . . $ otype_wb_info#aiming_3d_dot.; // These can be reused.
66 float aiming_3d_distcxx . . $ otype_wb_info#aiming_3d_dist.;
67 float aiming_XZ_dotcxx . . $ otype_wb_info#aiming_XZ_dot.;
68
69 float anim_start_framecxx . . $ otype_wb_info#anim_start_frame.[MAX_WB_FIRING_MASKScxx . . $ `lib/robotfirestruct_external.h:23:9`!];
70 float anim_fire_framecxx . . $ otype_wb_info#anim_fire_frame.[MAX_WB_FIRING_MASKScxx . . $ `lib/robotfirestruct_external.h:23:9`!];
71 float anim_end_framecxx . . $ otype_wb_info#anim_end_frame.[MAX_WB_FIRING_MASKScxx . . $ `lib/robotfirestruct_external.h:23:9`!];
72 float anim_timecxx . . $ otype_wb_info#anim_time.[MAX_WB_FIRING_MASKScxx . . $ `lib/robotfirestruct_external.h:23:9`!];
73
74 uint16_tcxx . . $ uint16_t# flagscxx . . $ otype_wb_info#flags.;
75
76 float energy_usagecxx . . $ otype_wb_info#energy_usage., ammo_usagecxx . . $ otype_wb_info#ammo_usage.;
77 };
78
79 #define WB_MOVE_STILLcxx . . $ `lib/robotfirestruct.h:79:9`! 0
80 #define WB_MOVE_RIGHTcxx . . $ `lib/robotfirestruct.h:80:9`! 1
81 #define WB_MOVE_LEFTcxx . . $ `lib/robotfirestruct.h:81:9`! 2
82
83 // Goes with an individual robot's instance
84 struct dynamic_wb_infocxx . . $ dynamic_wb_info# {
85 // Dynamic Data
86 float last_fire_timecxx . . $ dynamic_wb_info#last_fire_time.;
87 uint8_tcxx . . $ uint8_t# cur_firing_maskcxx . . $ dynamic_wb_info#cur_firing_mask.;
88
89 float norm_turret_anglecxx . . $ dynamic_wb_info#norm_turret_angle.[MAX_WB_TURRETScxx . . $ `lib/robotfirestruct_external.h:24:9`!];
90 float turret_next_think_timecxx . . $ dynamic_wb_info#turret_next_think_time.[MAX_WB_TURRETScxx . . $ `lib/robotfirestruct_external.h:24:9`!];
91 uint8_tcxx . . $ uint8_t# turret_directioncxx . . $ dynamic_wb_info#turret_direction.[MAX_WB_TURRETScxx . . $ `lib/robotfirestruct_external.h:24:9`!];
92
93 uint8_tcxx . . $ uint8_t# wb_anim_maskcxx . . $ dynamic_wb_info#wb_anim_mask.;
94 float wb_anim_framecxx . . $ dynamic_wb_info#wb_anim_frame.;
95
96 vectorcxx . . $ vector# cur_targetcxx . . $ dynamic_wb_info#cur_target.;
97
98 char upgrade_levelcxx . . $ dynamic_wb_info#upgrade_level.; // For multi-level weapons ( 0 to MAX_WB_UPGRADES-1)
99
100 int flagscxx . . $ dynamic_wb_info#flags.;
101 };
102
103 #endif