DrMobius.cpp 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  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. *
  20. * FILE
  21. *
  22. * DESCRIPTION
  23. *
  24. * PROGRAMMER
  25. * Patrick Smith
  26. *
  27. * VERSION INFO
  28. * $Author: Patrick $
  29. * $Revision: 6 $
  30. * $Modtime: 10/30/00 6:53p $
  31. * $Archive: /Commando/Code/Scripts/DrMobius.cpp $
  32. *
  33. ******************************************************************************/
  34. #include "scripts.h"
  35. #include "dprint.h"
  36. DECLARE_SCRIPT(Dr_Mobius_Script, "")
  37. {
  38. GameObject *CurrentLeader;
  39. ////////////////////////////////////////////////////////////////////
  40. // Created
  41. ////////////////////////////////////////////////////////////////////
  42. void Created (GameObject *game_obj)
  43. {
  44. CurrentLeader = NULL;
  45. Commands->Start_Timer (game_obj, this, 0.5F, 777);
  46. return ;
  47. }
  48. ////////////////////////////////////////////////////////////////////
  49. // Timer_Expired
  50. ////////////////////////////////////////////////////////////////////
  51. void Timer_Expired (GameObject *game_obj, int timer_id)
  52. {
  53. if (timer_id == 777) {
  54. Commands->Innate_Disable (game_obj);
  55. Vector3 pos = Commands->Get_Position(game_obj);
  56. GameObject * p_leader = Commands->Find_Closest_Soldier(pos, 0.1f, 2.0f, true);
  57. if (p_leader != NULL && p_leader != CurrentLeader) {
  58. ActionParamsStruct params;
  59. params.Set_Basic(this, 100, 100);
  60. params.Set_Movement(p_leader, 1.0f, 1.0f);
  61. params.MoveFollow = true;
  62. Commands->Action_Goto(game_obj, params);
  63. CurrentLeader = p_leader;
  64. }
  65. Commands->Start_Timer (game_obj, this, 0.5F, 777);
  66. }
  67. return ;
  68. }
  69. };