m_boss3.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // Copyright (c) ZeniMax Media Inc.
  2. // Licensed under the GNU General Public License 2.0.
  3. /*
  4. ==============================================================================
  5. boss3
  6. ==============================================================================
  7. */
  8. #include "g_local.h"
  9. #include "m_boss32.h"
  10. USE(Use_Boss3) (edict_t *self, edict_t *other, edict_t *activator) -> void
  11. {
  12. gi.WriteByte(svc_temp_entity);
  13. gi.WriteByte(TE_BOSSTPORT);
  14. gi.WritePosition(self->s.origin);
  15. gi.multicast(self->s.origin, MULTICAST_PHS, false);
  16. // just hide, don't kill ent so we can trigger it again
  17. self->svflags |= SVF_NOCLIENT;
  18. self->solid = SOLID_NOT;
  19. }
  20. THINK(Think_Boss3Stand) (edict_t *self) -> void
  21. {
  22. if (self->s.frame == FRAME_stand260)
  23. self->s.frame = FRAME_stand201;
  24. else
  25. self->s.frame++;
  26. self->nextthink = level.time + 10_hz;
  27. }
  28. /*QUAKED monster_boss3_stand (1 .5 0) (-32 -32 0) (32 32 90)
  29. Just stands and cycles in one place until targeted, then teleports away.
  30. */
  31. void SP_monster_boss3_stand(edict_t *self)
  32. {
  33. if ( !M_AllowSpawn( self ) ) {
  34. G_FreeEdict( self );
  35. return;
  36. }
  37. self->movetype = MOVETYPE_STEP;
  38. self->solid = SOLID_BBOX;
  39. self->model = "models/monsters/boss3/rider/tris.md2";
  40. self->s.modelindex = gi.modelindex(self->model);
  41. self->s.frame = FRAME_stand201;
  42. gi.soundindex("misc/bigtele.wav");
  43. self->mins = { -32, -32, 0 };
  44. self->maxs = { 32, 32, 90 };
  45. self->use = Use_Boss3;
  46. self->think = Think_Boss3Stand;
  47. self->nextthink = level.time + FRAME_TIME_S;
  48. gi.linkentity(self);
  49. }