Debian Codegraph @

prboom2/src/dsda/name.c

raw
1 //
2 // Copyright(C) 2023 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 Name
16 //
17
18 #include "string.h"
19
20 #include "dsda/mobjinfo.h"
21
22 #include "name.h"
23
24 static const char* const actor_names[] = {
25 "DoomPlayer",
26 "ZombieMan",
27 "ShotgunGuy",
28 "Archvile",
29 "ArchvileFire",
30 "Revenant",
31 "RevenantTracer",
32 "RevenantTracerSmoke",
33 "Fatso",
34 "FatShot",
35 "ChaingunGuy",
36 "DoomImp",
37 "Demon",
38 "Spectre",
39 "Cacodemon",
40 "BaronOfHell",
41 "BaronBall",
42 "HellKnight",
43 "LostSoul",
44 "SpiderMastermind",
45 "Arachnotron",
46 "Cyberdemon",
47 "PainElemental",
48 "WolfensteinSS",
49 "CommanderKeen",
50 "BossBrain",
51 "BossEye",
52 "BossTarget",
53 "SpawnShot",
54 "SpawnFire",
55 "ExplosiveBarrel",
56 "DoomImpBall",
57 "CacodemonBall",
58 "Rocket",
59 "PlasmaBall",
60 "BFGBall",
61 "ArachnotronPlasma",
62 "BulletPuff",
63 "Blood",
64 "TeleportFog",
65 "ItemFog",
66 "TeleportDest",
67 "BFGExtra",
68 "GreenArmor",
69 "BlueArmor",
70 "HealthBonus",
71 "ArmorBonus",
72 "BlueCard",
73 "RedCard",
74 "YellowCard",
75 "YellowSkull",
76 "RedSkull",
77 "BlueSkull",
78 "Stimpack",
79 "Medikit",
80 "Soulsphere",
81 "InvulnerabilitySphere",
82 "Berserk",
83 "BlurSphere",
84 "RadSuit",
85 "Allmap",
86 "Infrared",
87 "Megasphere",
88 "Clip",
89 "ClipBox",
90 "RocketAmmo",
91 "RocketBox",
92 "Cell",
93 "CellPack",
94 "Shell",
95 "ShellBox",
96 "Backpack",
97 "BFG9000",
98 "Chaingun",
99 "Chainsaw",
100 "RocketLauncher",
101 "PlasmaRifle",
102 "Shotgun",
103 "SuperShotgun",
104 "TechLamp",
105 "TechLamp2",
106 "Column",
107 "TallGreenColumn",
108 "ShortGreenColumn",
109 "TallRedColumn",
110 "ShortRedColumn",
111 "SkullColumn",
112 "HeartColumn",
113 "EvilEye",
114 "FloatingSkull",
115 "TorchTree",
116 "BlueTorch",
117 "GreenTorch",
118 "RedTorch",
119 "ShortBlueTorch",
120 "ShortGreenTorch",
121 "ShortRedTorch",
122 "Stalagtite",
123 "TechPillar",
124 "CandleStick",
125 "Candelabra",
126 "BloodyTwitch",
127 "Meat2",
128 "Meat3",
129 "Meat4",
130 "Meat5",
131 "NonsolidMeat2",
132 "NonsolidMeat4",
133 "NonsolidMeat3",
134 "NonsolidMeat5",
135 "NonsolidTwitch",
136 "DeadCacodemon",
137 "DeadMarine",
138 "DeadZombieMan",
139 "DeadDemon",
140 "DeadLostSoul",
141 "DeadDoomImp",
142 "DeadShotgunGuy",
143 "GibbedMarine",
144 "GibbedMarineExtra",
145 "HeadsOnAStick",
146 "Gibs",
147 "HeadOnAStick",
148 "HeadCandles",
149 "DeadStick",
150 "LiveStick",
151 "BigTree",
152 "BurningBarrel",
153 "HangNoGuts",
154 "HangBNoBrain",
155 "HangTLookingDown",
156 "HangTSkull",
157 "HangTLookingUp",
158 "HangTNoBrain",
159 "ColonGibs",
160 "SmallBloodPool",
161 "BrainStem",
162 "PointPusher",
163 "PointPuller",
164 "MBFHelperDog",
165 "PlasmaBall1",
166 "PlasmaBall2",
167 "EvilSceptre",
168 "UnholyBible",
169 "MusicChanger",
170 "Deh_Actor_145",
171 "Deh_Actor_146",
172 "Deh_Actor_147",
173 "Deh_Actor_148",
174 "Deh_Actor_149",
175 "Deh_Actor_150",
176 "Deh_Actor_151",
177 "Deh_Actor_152",
178 "Deh_Actor_153",
179 "Deh_Actor_154",
180 "Deh_Actor_155",
181 "Deh_Actor_156",
182 "Deh_Actor_157",
183 "Deh_Actor_158",
184 "Deh_Actor_159",
185 "Deh_Actor_160",
186 "Deh_Actor_161",
187 "Deh_Actor_162",
188 "Deh_Actor_163",
189 "Deh_Actor_164",
190 "Deh_Actor_165",
191 "Deh_Actor_166",
192 "Deh_Actor_167",
193 "Deh_Actor_168",
194 "Deh_Actor_169",
195 "Deh_Actor_170",
196 "Deh_Actor_171",
197 "Deh_Actor_172",
198 "Deh_Actor_173",
199 "Deh_Actor_174",
200 "Deh_Actor_175",
201 "Deh_Actor_176",
202 "Deh_Actor_177",
203 "Deh_Actor_178",
204 "Deh_Actor_179",
205 "Deh_Actor_180",
206 "Deh_Actor_181",
207 "Deh_Actor_182",
208 "Deh_Actor_183",
209 "Deh_Actor_184",
210 "Deh_Actor_185",
211 "Deh_Actor_186",
212 "Deh_Actor_187",
213 "Deh_Actor_188",
214 "Deh_Actor_189",
215 "Deh_Actor_190",
216 "Deh_Actor_191",
217 "Deh_Actor_192",
218 "Deh_Actor_193",
219 "Deh_Actor_194",
220 "Deh_Actor_195",
221 "Deh_Actor_196",
222 "Deh_Actor_197",
223 "Deh_Actor_198",
224 "Deh_Actor_199",
225 "Deh_Actor_200",
226 "Deh_Actor_201",
227 "Deh_Actor_202",
228 "Deh_Actor_203",
229 "Deh_Actor_204",
230 "Deh_Actor_205",
231 "Deh_Actor_206",
232 "Deh_Actor_207",
233 "Deh_Actor_208",
234 "Deh_Actor_209",
235 "Deh_Actor_210",
236 "Deh_Actor_211",
237 "Deh_Actor_212",
238 "Deh_Actor_213",
239 "Deh_Actor_214",
240 "Deh_Actor_215",
241 "Deh_Actor_216",
242 "Deh_Actor_217",
243 "Deh_Actor_218",
244 "Deh_Actor_219",
245 "Deh_Actor_220",
246 "Deh_Actor_221",
247 "Deh_Actor_222",
248 "Deh_Actor_223",
249 "Deh_Actor_224",
250 "Deh_Actor_225",
251 "Deh_Actor_226",
252 "Deh_Actor_227",
253 "Deh_Actor_228",
254 "Deh_Actor_229",
255 "Deh_Actor_230",
256 "Deh_Actor_231",
257 "Deh_Actor_232",
258 "Deh_Actor_233",
259 "Deh_Actor_234",
260 "Deh_Actor_235",
261 "Deh_Actor_236",
262 "Deh_Actor_237",
263 "Deh_Actor_238",
264 "Deh_Actor_239",
265 "Deh_Actor_240",
266 "Deh_Actor_241",
267 "Deh_Actor_242",
268 "Deh_Actor_243",
269 "Deh_Actor_244",
270 "Deh_Actor_245",
271 "Deh_Actor_246",
272 "Deh_Actor_247",
273 "Deh_Actor_248",
274 "Deh_Actor_249",
275 NULL
276 };
277
278 static const char* const action_names[] = {
279 /* 0 */ "",
280 /* 1 */ "Polyobj_StartLine",
281 /* 2 */ "Polyobj_RotateLeft",
282 /* 3 */ "Polyobj_RotateRight",
283 /* 4 */ "Polyobj_Move",
284 /* 5 */ "Polyobj_ExplicitLine",
285 /* 6 */ "Polyobj_MoveTimes8",
286 /* 7 */ "Polyobj_DoorSwing",
287 /* 8 */ "Polyobj_DoorSlide",
288 /* 9 */ "Line_Horizon",
289 /* 10 */ "Door_Close",
290 /* 11 */ "Door_Open",
291 /* 12 */ "Door_Raise",
292 /* 13 */ "Door_LockedRaise",
293 /* 14 */ "Door_Animated",
294 /* 15 */ "Autosave",
295 /* 16 */ "Transfer_WallLight",
296 /* 17 */ "Thing_Raise",
297 /* 18 */ "StartConversation",
298 /* 19 */ "Thing_Stop",
299 /* 20 */ "Floor_LowerByValue",
300 /* 21 */ "Floor_LowerToLowest",
301 /* 22 */ "Floor_LowerToNearest",
302 /* 23 */ "Floor_RaiseByValue",
303 /* 24 */ "Floor_RaiseToHighest",
304 /* 25 */ "Floor_RaiseToNearest",
305 /* 26 */ "Stairs_BuildDown",
306 /* 27 */ "Stairs_BuildUp",
307 /* 28 */ "Floor_RaiseAndCrush",
308 /* 29 */ "Pillar_Build",
309 /* 30 */ "Pillar_Open",
310 /* 31 */ "Stairs_BuildDownSync",
311 /* 32 */ "Stairs_BuildUpSync",
312 /* 33 */ "ForceField",
313 /* 34 */ "ClearForceField",
314 /* 35 */ "Floor_RaiseByValueTimes8",
315 /* 36 */ "Floor_LowerByValueTimes8",
316 /* 37 */ "Floor_MoveToValue",
317 /* 38 */ "Ceiling_Waggle",
318 /* 39 */ "Teleport_ZombieChanger",
319 /* 40 */ "Ceiling_LowerByValue",
320 /* 41 */ "Ceiling_RaiseByValue",
321 /* 42 */ "Ceiling_CrushAndRaise",
322 /* 43 */ "Ceiling_LowerAndCrush",
323 /* 44 */ "Ceiling_CrushStop",
324 /* 45 */ "Ceiling_CrushRaiseAndStay",
325 /* 46 */ "Floor_CrushStop",
326 /* 47 */ "Ceiling_MoveToValue",
327 /* 48 */ "Sector_Attach3dMidtex",
328 /* 49 */ "GlassBreak",
329 /* 50 */ "ExtraFloor_LightOnly",
330 /* 51 */ "Sector_SetLink",
331 /* 52 */ "Scroll_Wall",
332 /* 53 */ "Line_SetTextureOffset",
333 /* 54 */ "Sector_ChangeFlags",
334 /* 55 */ "Line_SetBlocking",
335 /* 56 */ "Line_SetTextureScale",
336 /* 57 */ "Sector_SetPortal",
337 /* 58 */ "Sector_CopyScroller",
338 /* 59 */ "Polyobj_OR_MoveToSpot",
339 /* 60 */ "Plat_PerpetualRaise",
340 /* 61 */ "Plat_Stop",
341 /* 62 */ "Plat_DownWaitUpStay",
342 /* 63 */ "Plat_DownByValue",
343 /* 64 */ "Plat_UpWaitDownStay",
344 /* 65 */ "Plat_UpByValue",
345 /* 66 */ "Floor_LowerInstant",
346 /* 67 */ "Floor_RaiseInstant",
347 /* 68 */ "Floor_MoveToValueTimes8",
348 /* 69 */ "Ceiling_MoveToValueTimes8",
349 /* 70 */ "Teleport",
350 /* 71 */ "Teleport_NoFog",
351 /* 72 */ "ThrustThing",
352 /* 73 */ "DamageThing",
353 /* 74 */ "Teleport_NewMap",
354 /* 75 */ "Teleport_EndGame",
355 /* 76 */ "TeleportOther",
356 /* 77 */ "TeleportGroup",
357 /* 78 */ "TeleportInSector",
358 /* 79 */ "Thing_SetConversation",
359 /* 80 */ "ACS_Execute",
360 /* 81 */ "ACS_Suspend",
361 /* 82 */ "ACS_Terminate",
362 /* 83 */ "ACS_LockedExecute",
363 /* 84 */ "ACS_ExecuteWithResult",
364 /* 85 */ "ACS_LockedExecuteDoor",
365 /* 86 */ "Polyobj_MoveToSpot",
366 /* 87 */ "Polyobj_Stop",
367 /* 88 */ "Polyobj_MoveTo",
368 /* 89 */ "Polyobj_OR_MoveTo",
369 /* 90 */ "Polyobj_OR_RotateLeft",
370 /* 91 */ "Polyobj_OR_RotateRight",
371 /* 92 */ "Polyobj_OR_Move",
372 /* 93 */ "Polyobj_OR_MoveTimes8",
373 /* 94 */ "Pillar_BuildAndCrush",
374 /* 95 */ "FloorAndCeiling_LowerByValue",
375 /* 96 */ "FloorAndCeiling_RaiseByValue",
376 /* 97 */ "Ceiling_LowerAndCrushDist",
377 /* 98 */ "Sector_SetTranslucent",
378 /* 99 */ "Floor_RaiseAndCrushDoom",
379 /* 100 */ "Scroll_Texture_Left",
380 /* 101 */ "Scroll_Texture_Right",
381 /* 102 */ "Scroll_Texture_Up",
382 /* 103 */ "Scroll_Texture_Down",
383 /* 104 */ "Ceiling_CrushAndRaiseSilentDist",
384 /* 105 */ "Door_WaitRaise",
385 /* 106 */ "Door_WaitClose",
386 /* 107 */ "Line_SetPortalTarget",
387 /* 108 */ "",
388 /* 109 */ "Light_ForceLightning",
389 /* 110 */ "Light_RaiseByValue",
390 /* 111 */ "Light_LowerByValue",
391 /* 112 */ "Light_ChangeToValue",
392 /* 113 */ "Light_Fade",
393 /* 114 */ "Light_Glow",
394 /* 115 */ "Light_Flicker",
395 /* 116 */ "Light_Strobe",
396 /* 117 */ "Light_Stop",
397 /* 118 */ "Plane_Copy",
398 /* 119 */ "Thing_Damage",
399 /* 120 */ "Radius_Quake",
400 /* 121 */ "Line_SetIdentification",
401 /* 122 */ "",
402 /* 123 */ "",
403 /* 124 */ "",
404 /* 125 */ "Thing_Move",
405 /* 126 */ "",
406 /* 127 */ "Thing_SetSpecial",
407 /* 128 */ "ThrustThingZ",
408 /* 129 */ "UsePuzzleItem",
409 /* 130 */ "Thing_Activate",
410 /* 131 */ "Thing_Deactivate",
411 /* 132 */ "Thing_Remove",
412 /* 133 */ "Thing_Destroy",
413 /* 134 */ "Thing_Projectile",
414 /* 135 */ "Thing_Spawn",
415 /* 136 */ "Thing_ProjectileGravity",
416 /* 137 */ "Thing_SpawnNoFog",
417 /* 138 */ "Floor_Waggle",
418 /* 139 */ "Thing_SpawnFacing",
419 /* 140 */ "Sector_ChangeSound",
420 /* 141 */ "",
421 /* 142 */ "",
422 /* 143 */ "",
423 /* 144 */ "",
424 /* 145 */ "",
425 /* 146 */ "",
426 /* 147 */ "",
427 /* 148 */ "",
428 /* 149 */ "",
429 /* 150 */ "",
430 /* 151 */ "",
431 /* 152 */ "",
432 /* 153 */ "",
433 /* 154 */ "Teleport_NoStop",
434 /* 155 */ "",
435 /* 156 */ "Line_SetPortal",
436 /* 157 */ "SetGlobalFogParameter",
437 /* 158 */ "FS_Execute",
438 /* 159 */ "Sector_SetPlaneReflection",
439 /* 160 */ "Sector_Set3DFloor",
440 /* 161 */ "Sector_SetContents",
441 /* 162 */ "",
442 /* 163 */ "",
443 /* 164 */ "",
444 /* 165 */ "",
445 /* 166 */ "",
446 /* 167 */ "",
447 /* 168 */ "Ceiling_CrushAndRaiseDist",
448 /* 169 */ "Generic_Crusher2",
449 /* 170 */ "Sector_SetCeilingScale2",
450 /* 171 */ "Sector_SetFloorScale2",
451 /* 172 */ "Plat_UpNearestWaitDownStay",
452 /* 173 */ "NoiseAlert",
453 /* 174 */ "SendToCommunicator",
454 /* 175 */ "Thing_ProjectileIntercept",
455 /* 176 */ "Thing_ChangeTID",
456 /* 177 */ "Thing_Hate",
457 /* 178 */ "Thing_ProjectileAimed",
458 /* 179 */ "ChangeSkill",
459 /* 180 */ "Thing_SetTranslation",
460 /* 181 */ "Plane_Align",
461 /* 182 */ "Line_Mirror",
462 /* 183 */ "Line_AlignCeiling",
463 /* 184 */ "Line_AlignFloor",
464 /* 185 */ "Sector_SetRotation",
465 /* 186 */ "Sector_SetCeilingPanning",
466 /* 187 */ "Sector_SetFloorPanning",
467 /* 188 */ "Sector_SetCeilingScale",
468 /* 189 */ "Sector_SetFloorScale",
469 /* 190 */ "Static_Init",
470 /* 191 */ "SetPlayerProperty",
471 /* 192 */ "Ceiling_LowerToHighestFloor",
472 /* 193 */ "Ceiling_LowerInstant",
473 /* 194 */ "Ceiling_RaiseInstant",
474 /* 195 */ "Ceiling_CrushRaiseAndStayA",
475 /* 196 */ "Ceiling_CrushAndRaiseA",
476 /* 197 */ "Ceiling_CrushAndRaiseSilentA",
477 /* 198 */ "Ceiling_RaiseByValueTimes8",
478 /* 199 */ "Ceiling_LowerByValueTimes8",
479 /* 200 */ "Generic_Floor",
480 /* 201 */ "Generic_Ceiling",
481 /* 202 */ "Generic_Door",
482 /* 203 */ "Generic_Lift",
483 /* 204 */ "Generic_Stairs",
484 /* 205 */ "Generic_Crusher",
485 /* 206 */ "Plat_DownWaitUpStayLip",
486 /* 207 */ "Plat_PerpetualRaiseLip",
487 /* 208 */ "TranslucentLine",
488 /* 209 */ "Transfer_Heights",
489 /* 210 */ "Transfer_FloorLight",
490 /* 211 */ "Transfer_CeilingLight",
491 /* 212 */ "Sector_SetColor",
492 /* 213 */ "Sector_SetFade",
493 /* 214 */ "Sector_SetDamage",
494 /* 215 */ "Teleport_Line",
495 /* 216 */ "Sector_SetGravity",
496 /* 217 */ "Stairs_BuildUpDoom",
497 /* 218 */ "Sector_SetWind",
498 /* 219 */ "Sector_SetFriction",
499 /* 220 */ "Sector_SetCurrent",
500 /* 221 */ "Scroll_Texture_Both",
501 /* 222 */ "Scroll_Texture_Model",
502 /* 223 */ "Scroll_Floor",
503 /* 224 */ "Scroll_Ceiling",
504 /* 225 */ "Scroll_Texture_Offsets",
505 /* 226 */ "ACS_ExecuteAlways",
506 /* 227 */ "PointPush_SetForce",
507 /* 228 */ "Plat_RaiseAndStayTx0",
508 /* 229 */ "Thing_SetGoal",
509 /* 230 */ "Plat_UpByValueStayTx",
510 /* 231 */ "Plat_ToggleCeiling",
511 /* 232 */ "Light_StrobeDoom",
512 /* 233 */ "Light_MinNeighbor",
513 /* 234 */ "Light_MaxNeighbor",
514 /* 235 */ "Floor_TransferTrigger",
515 /* 236 */ "Floor_TransferNumeric",
516 /* 237 */ "ChangeCamera",
517 /* 238 */ "Floor_RaiseToLowestCeiling",
518 /* 239 */ "Floor_RaiseByValueTxTy",
519 /* 240 */ "Floor_RaiseByTexture",
520 /* 241 */ "Floor_LowerToLowestTxTy",
521 /* 242 */ "Floor_LowerToHighest",
522 /* 243 */ "Exit_Normal",
523 /* 244 */ "Exit_Secret",
524 /* 245 */ "Elevator_RaiseToNearest",
525 /* 246 */ "Elevator_MoveToFloor",
526 /* 247 */ "Elevator_LowerToNearest",
527 /* 248 */ "HealThing",
528 /* 249 */ "Door_CloseWaitOpen",
529 /* 250 */ "Floor_Donut",
530 /* 251 */ "FloorAndCeiling_LowerRaise",
531 /* 252 */ "Ceiling_RaiseToNearest",
532 /* 253 */ "Ceiling_LowerToLowest",
533 /* 254 */ "Ceiling_LowerToFloor",
534 /* 255 */ "Ceiling_CrushRaiseAndStaySilA",
535
536 /* 256 */ "Floor_LowerToHighestEE",
537 /* 257 */ "Floor_RaiseToLowest",
538 /* 258 */ "Floor_LowerToLowestCeiling",
539 /* 259 */ "Floor_RaiseToCeiling",
540 /* 260 */ "Floor_ToCeilingInstant",
541 /* 261 */ "Floor_LowerByTexture",
542 /* 262 */ "Ceiling_RaiseToHighest",
543 /* 263 */ "Ceiling_ToHighestInstant",
544 /* 264 */ "Ceiling_LowerToNearest",
545 /* 265 */ "Ceiling_RaiseToLowest",
546 /* 266 */ "Ceiling_RaiseToHighestFloor",
547 /* 267 */ "Ceiling_ToFloorInstant",
548 /* 268 */ "Ceiling_RaiseByTexture",
549 /* 269 */ "Ceiling_LowerByTexture",
550 /* 270 */ "Stairs_BuildDownDoom",
551 /* 271 */ "Stairs_BuildUpDoomSync",
552 /* 272 */ "Stairs_BuildDownDoomSync",
553 /* 273 */ "Stairs_BuildUpDoomCrush",
554 /* 274 */ "Door_AnimatedClose",
555 /* 275 */ "Floor_Stop",
556 /* 276 */ "Ceiling_Stop",
557 /* 277 */ "Sector_SetFloorGlow",
558 /* 278 */ "Sector_SetCeilingGlow",
559 /* 279 */ "Floor_MoveToValueAndCrush",
560 /* 280 */ "Ceiling_MoveToValueAndCrush",
561 /* 281 */ "Line_SetAutomapFlags",
562 /* 282 */ "Line_SetAutomapStyle",
563 /* 283 */ "Polyobj_StopSound",
564
565 NULL
566 };
567
568 int dsda_ActorNameToType(const char* name) {
569 int i;
570
571 for (i = 0; actor_names[i]; ++i)
572 if (!stricmp(name, actor_names[i]))
573 return dsda_GetDehMobjIndex(i);
574
575 return NAME_NOT_FOUND;
576 }
577
578 int dsda_ActionNameToNumber(const char* name) {
579 int i;
580
581 for (i = 0; action_names[i]; ++i)
582 if (action_names[i][0] && !stricmp(name, action_names[i]))
583 return i;
584
585 if (!stricmp(name, "Map_SetColormap"))
586 return 2701;
587
588 if (!stricmp(name, "Sector_SetColormap"))
589 return 2702;
590
591 if (!stricmp(name, "Music_ChangeSong"))
592 return 2703;
593
594 if (!stricmp(name, "Music_Stop"))
595 return 2704;
596
597 return NAME_NOT_FOUND;
598 }