misc_corpses.qc 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /* Copyright (C) 1996-2022 id Software LLC
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation; either version 2 of the License, or
  5. (at your option) any later version.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License
  11. along with this program; if not, write to the Free Software
  12. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  13. See file, 'COPYING', for details.
  14. */
  15. //============================================================================
  16. typedef struct
  17. {
  18. string mdl;
  19. float frame;
  20. }poseInfo;
  21. #pragma warning disable F317 //Use of stale framemacros
  22. poseInfo poses[] =
  23. {
  24. { "progs/demon.mdl", $CORPSEFRAME_DEMON_1 },
  25. { "progs/dog.mdl", $CORPSEFRAME_DOG_1 },
  26. { "progs/dog.mdl", $CORPSEFRAME_DOG_2 },
  27. { "progs/enforcer.mdl", $CORPSEFRAME_ENFORCER_1 },
  28. { "progs/enforcer.mdl", $CORPSEFRAME_ENFORCER_2 },
  29. { "progs/fish.mdl", $CORPSEFRAME_FISH_1 },
  30. { "progs/hknight.mdl", $CORPSEFRAME_HKNIGHT_1 },
  31. { "progs/hknight.mdl", $CORPSEFRAME_HKNIGHT_2 },
  32. { "progs/knight.mdl", $CORPSEFRAME_KNIGHT_1 },
  33. { "progs/knight.mdl", $CORPSEFRAME_KNIGHT_2 },
  34. { "progs/ogre.mdl", $CORPSEFRAME_OGRE_1 },
  35. { "progs/ogre.mdl", $CORPSEFRAME_OGRE_2 },
  36. { "progs/shalrath.mdl", $CORPSEFRAME_SHALRATH_1 },
  37. { "progs/shambler.mdl", $CORPSEFRAME_SHAMBLER_1 },
  38. { "progs/soldier.mdl", $CORPSEFRAME_SOLDIER_1 },
  39. { "progs/soldier.mdl", $CORPSEFRAME_SOLDIER_2 },
  40. { "progs/wizard.mdl", $CORPSEFRAME_WIZARD_1 },
  41. { "progs/player.mdl", $CORPSEFRAME_PLAYER_1 },
  42. { "progs/player.mdl", $CORPSEFRAME_PLAYER_2 },
  43. { "progs/player.mdl", $CORPSEFRAME_PLAYER_3 },
  44. { "progs/player.mdl", $CORPSEFRAME_PLAYER_4 },
  45. { "progs/player.mdl", $CORPSEFRAME_PLAYER_5 },
  46. { "progs/player.mdl", $CORPSEFRAME_PLAYER_6 },
  47. // Heads
  48. { "progs/h_demon.mdl", 0 },
  49. { "progs/h_dog.mdl", 0 },
  50. { "progs/h_guard.mdl", 0 },
  51. { "progs/h_hellkn.mdl", 0 },
  52. { "progs/h_knight.mdl", 0 },
  53. { "progs/h_mega.mdl", 0 },
  54. { "progs/h_ogre.mdl", 0 },
  55. { "progs/h_player.mdl", 0 },
  56. { "progs/h_shal.mdl", 0 },
  57. { "progs/h_shams.mdl", 0 },
  58. { "progs/h_wizard.mdl", 0 },
  59. { "progs/h_zombie.mdl", 0 },
  60. // Gibs
  61. { "progs/gib1.mdl", 0 },
  62. { "progs/gib2.mdl", 0 },
  63. { "progs/gib3.mdl", 0 },
  64. };
  65. #pragma warning enable F317
  66. void misc_corpse()
  67. {
  68. if(self.style < 0 || self.style >= poses.length)
  69. {
  70. objerror("misc_corpse with invalid style.");
  71. return;
  72. }
  73. poseInfo pose = poses[self.style];
  74. precache_model(pose.mdl);
  75. self.frame = pose.frame;
  76. self.solid = SOLID_NOT;
  77. self.movetype = MOVETYPE_NONE;
  78. setmodel (self, pose.mdl);
  79. }
  80. void printCorpseFGDStuff()
  81. {
  82. dprint("Corpseframes:\n");
  83. for(float i = 0; i < poses.length; i++)
  84. {
  85. //style == 0 -> { path: "progs/demon.mdl" , frame: 53 },
  86. dprint("style == ");
  87. dprint(ftos(i));
  88. dprint(" -> { path: \"");
  89. dprint(poses[i].mdl);
  90. dprint("\"\t, frame: ");
  91. dprint(ftos(poses[i].frame));
  92. dprint("\t},\n");
  93. }
  94. }
  95. //============================================================================