Debian Codegraph @

prboom2/src/dsda/pclass.c

raw
1 //
2 // Copyright(C) 2021 by Ryan Krafnick
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // DESCRIPTION:
15 // DSDA Player Class
16 //
17
18 #include "info.h"
19
20 #include "pclass.h"
21
22 dsda_pclass_t pclass[NUMCLASSES] = {
23 [PCLASS_NULL] = {
24 .armor_increment = { 0 },
25 .auto_armor_save = 0,
26 .armor_max = 0,
27
28 .forwardmove = { 0x19, 0x32 },
29 .sidemove = { 0x18, 0x28 },
30 .stroller_threshold = 0x19,
31 .turbo_threshold = 0x32,
32 },
33
34 [PCLASS_FIGHTER] = {
35 .armor_increment = { 25 * FRACUNIT, 20 * FRACUNIT, 15 * FRACUNIT, 5 * FRACUNIT },
36 .auto_armor_save = 15 * FRACUNIT,
37 .armor_max = 100 * FRACUNIT,
38
39 .forwardmove = { 0x1D, 0x3C },
40 .sidemove = { 0x1B, 0x3B },
41 .stroller_threshold = 0x1D,
42 .turbo_threshold = 0x3C,
43
44 .normal_state = HEXEN_S_FPLAY,
45 .run_state = HEXEN_S_FPLAY_RUN1,
46 .fire_weapon_state = HEXEN_S_FPLAY_ATK1,
47 .attack_state = HEXEN_S_FPLAY_ATK1,
48 .attack_end_state = HEXEN_S_FPLAY_ATK2,
49 },
50
51 [PCLASS_CLERIC] = {
52 .armor_increment = { 10 * FRACUNIT, 25 * FRACUNIT, 5 * FRACUNIT, 20 * FRACUNIT },
53 .auto_armor_save = 10 * FRACUNIT,
54 .armor_max = 90 * FRACUNIT,
55
56 .forwardmove = { 0x19, 0x32 },
57 .sidemove = { 0x18, 0x28 },
58 .stroller_threshold = 0x19,
59 .turbo_threshold = 0x32,
60
61 .normal_state = HEXEN_S_CPLAY,
62 .run_state = HEXEN_S_CPLAY_RUN1,
63 .fire_weapon_state = HEXEN_S_CPLAY_ATK1,
64 .attack_state = HEXEN_S_CPLAY_ATK1,
65 .attack_end_state = HEXEN_S_CPLAY_ATK3,
66 },
67
68 [PCLASS_MAGE] = {
69 .armor_increment = { 5 * FRACUNIT, 15 * FRACUNIT, 10 * FRACUNIT, 25 * FRACUNIT },
70 .auto_armor_save = 5 * FRACUNIT,
71 .armor_max = 80 * FRACUNIT,
72
73 .forwardmove = { 0x16, 0x2E },
74 .sidemove = { 0x15, 0x25 },
75 .stroller_threshold = 0x16,
76 .turbo_threshold = 0x2D,
77
78 .normal_state = HEXEN_S_MPLAY,
79 .run_state = HEXEN_S_MPLAY_RUN1,
80 .fire_weapon_state = HEXEN_S_MPLAY_ATK1,
81 .attack_state = HEXEN_S_MPLAY_ATK1,
82 .attack_end_state = HEXEN_S_MPLAY_ATK2,
83 },
84
85 [PCLASS_PIG] = {
86 .armor_increment = { 0 },
87 .auto_armor_save = 0,
88 .armor_max = 5 * FRACUNIT,
89
90 .forwardmove = { 0x18, 0x31 },
91 .sidemove = { 0x17, 0x27 },
92 .stroller_threshold = 0x18,
93 .turbo_threshold = 0x31,
94
95 .normal_state = HEXEN_S_PIGPLAY,
96 .run_state = HEXEN_S_PIGPLAY_RUN1,
97 .fire_weapon_state = HEXEN_S_PIGPLAY_ATK1,
98 .attack_state = HEXEN_S_PIGPLAY_ATK1,
99 .attack_end_state = HEXEN_S_PIGPLAY_ATK1,
100 },
101 };
102
103 void dsda_ResetNullPClass(void) {
104 if (heretic)
105 {
106 pclass[PCLASS_NULL].normal_state = HERETIC_S_PLAY;
107 pclass[PCLASS_NULL].run_state = HERETIC_S_PLAY_RUN1;
108 pclass[PCLASS_NULL].fire_weapon_state = HERETIC_S_PLAY_ATK2;
109 pclass[PCLASS_NULL].attack_state = HERETIC_S_PLAY_ATK1;
110 pclass[PCLASS_NULL].attack_end_state = HERETIC_S_PLAY_ATK2;
111 }
112 else
113 {
114 pclass[PCLASS_NULL].normal_state = S_PLAY;
115 pclass[PCLASS_NULL].run_state = S_PLAY_RUN1;
116 pclass[PCLASS_NULL].fire_weapon_state = S_PLAY_ATK1;
117 pclass[PCLASS_NULL].attack_state = S_PLAY_ATK1;
118 pclass[PCLASS_NULL].attack_end_state = S_PLAY_ATK2;
119 }
120 }