combatmaterialeffectmanager.cpp 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Combat *
  23. * *
  24. * $Archive:: /Commando/Code/Combat/combatmaterialeffectmanager.cpp $*
  25. * *
  26. * Original Author:: Greg Hjelstrom *
  27. * *
  28. * $Author:: Greg_h $*
  29. * *
  30. * $Modtime:: 10/19/01 10:16a $*
  31. * *
  32. * $Revision:: 3 $*
  33. * *
  34. *---------------------------------------------------------------------------------------------*
  35. * Functions: *
  36. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  37. #include "combatmaterialeffectmanager.h"
  38. #include "materialeffect.h"
  39. #include "transitioneffect.h"
  40. #include "assetmgr.h"
  41. #include "texture.h"
  42. #include "humanstate.h"
  43. const char * DEATH_TRANSITION_TEXTURE = "REN_death.tga";
  44. const char * SPAWN_TRANSITION_TEXTURE = "REN_spawn.tga";
  45. const char * HEALTH_TEXTURE = "REN_repair.tga";
  46. const char * ELECTROCUTION_TEXTURE = "REN_shock.tga";
  47. const float SPAWN_TRANSITION_TIME = 2.0f;
  48. TransitionEffectClass *
  49. CombatMaterialEffectManager::Get_Spawn_Effect(void)
  50. {
  51. TransitionEffectClass * effect = NEW_REF(TransitionEffectClass,());
  52. effect->Set_Parameter(1.0f);
  53. effect->Set_Target_Parameter(0.0f);
  54. effect->Set_Transition_Time(SPAWN_TRANSITION_TIME);
  55. effect->Enable_Remove_On_Complete(true);
  56. effect->Set_Max_Intensity(0.25f);
  57. TextureClass * tex = WW3DAssetManager::Get_Instance()->Get_Texture(SPAWN_TRANSITION_TEXTURE);
  58. effect->Set_Texture(tex);
  59. REF_PTR_RELEASE(tex);
  60. return effect;
  61. }
  62. TransitionEffectClass *
  63. CombatMaterialEffectManager::Get_Death_Effect(void)
  64. {
  65. TransitionEffectClass * effect = NEW_REF(TransitionEffectClass,());
  66. effect->Set_Parameter(0.0f);
  67. effect->Set_Target_Parameter(1.0f);
  68. effect->Set_Start_Delay(0.75f * CORPSE_PERSIST_TIME);
  69. effect->Set_Transition_Time(0.25f * CORPSE_PERSIST_TIME);
  70. effect->Set_Max_Intensity(0.5f);
  71. effect->Set_Max_UV_Velocity(Vector2(3.75f,-6.0f));
  72. TextureClass * tex = WW3DAssetManager::Get_Instance()->Get_Texture(DEATH_TRANSITION_TEXTURE);
  73. effect->Set_Texture(tex);
  74. REF_PTR_RELEASE(tex);
  75. return effect;
  76. }
  77. TransitionEffectClass *
  78. CombatMaterialEffectManager::Get_Health_Effect(void)
  79. {
  80. TransitionEffectClass * effect = NEW_REF(TransitionEffectClass,());
  81. effect->Set_Parameter(0.0f);
  82. effect->Set_Target_Parameter(0.49f);
  83. effect->Set_Transition_Time(1.0f);
  84. effect->Set_Max_Intensity(0.5f);
  85. effect->Set_Min_UV_Velocity(Vector2(0.0f,-3.0f));
  86. effect->Set_Max_UV_Velocity(Vector2(0.0f,-3.0f));
  87. TextureClass * tex = WW3DAssetManager::Get_Instance()->Get_Texture(HEALTH_TEXTURE);
  88. effect->Set_Texture(tex);
  89. REF_PTR_RELEASE(tex);
  90. return effect;
  91. }
  92. TransitionEffectClass *
  93. CombatMaterialEffectManager::Get_Electrocution_Effect(void)
  94. {
  95. TransitionEffectClass * effect = NEW_REF(TransitionEffectClass,());
  96. effect->Set_Parameter(0.0f);
  97. effect->Set_Target_Parameter(0.49f);
  98. effect->Set_Transition_Time(1.0f);
  99. effect->Set_Max_Intensity(0.5f);
  100. effect->Set_Min_UV_Velocity(Vector2(0.0f,-3.0f));
  101. effect->Set_Max_UV_Velocity(Vector2(0.0f,-3.0f));
  102. TextureClass * tex = WW3DAssetManager::Get_Instance()->Get_Texture(ELECTROCUTION_TEXTURE);
  103. effect->Set_Texture(tex);
  104. REF_PTR_RELEASE(tex);
  105. return effect;
  106. }