Advertisement
GraionDilach

Ares AttachEffect

Nov 4th, 2011
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 18.69 KB | None | 0 0
  1. Index: Ext/AnimType/Body.cpp
  2. ===================================================================
  3. --- Ext/AnimType/Body.cpp   (revision 1169)
  4. +++ Ext/AnimType/Body.cpp   (working copy)
  5. @@ -80,7 +80,7 @@
  6.     return 0;
  7.  }
  8.  
  9. -DEFINE_HOOK(427888, AnimTypeClass_DTOR, 5)
  10. +DEFINE_HOOK(428EA8, AnimTypeClass_SDDTOR, 5)
  11.  {
  12.     GET(AnimTypeClass*, pItem, ECX);
  13.  
  14.  
  15. Property changes on: Ext\Building\Hooks.Foundation.cpp
  16. ___________________________________________________________________
  17. Modified: svn:mergeinfo
  18.    Merged /trunk/src/Ext/Building/Hooks.Foundation.cpp:r1168-1169
  19.  
  20. Index: Ext/Techno/Body.cpp
  21. ===================================================================
  22. --- Ext/Techno/Body.cpp (revision 1169)
  23. +++ Ext/Techno/Body.cpp (working copy)
  24. @@ -435,6 +435,81 @@
  25.     }
  26.  }
  27.  
  28. +void TechnoExt::TransferAttachedEffects(TechnoClass *From, TechnoClass *To) {
  29. +       auto FromExt = TechnoExt::ExtMap.Find(From);
  30. +       auto ToExt = TechnoExt::ExtMap.Find(To);
  31. +       ToExt->AttachedEffects.Clear();
  32. +       if (FromExt->AttachedEffects.Count != 0) {
  33. +          
  34. +           // while recreation itself isn't the best idea, less hassle and more reliable
  35. +           // list gets intact in the end
  36. +           for (int i=0; i<FromExt->AttachedEffects.Count; i++){
  37. +               FromExt->AttachedEffects.GetItem(i)->Type->Attach(To, FromExt->AttachedEffects.GetItem(i)->ActualDuration);
  38. +               FromExt->AttachedEffects.GetItem(i)->Destroy();
  39. +               delete FromExt->AttachedEffects.GetItem(i);
  40. +          
  41. +           }
  42. +           FromExt->AttachedEffects.Clear();
  43. +           FromExt->AttachedTechnoEffect_isset=false;
  44. +           TechnoExt::RecalculateStats(To);
  45. +       }
  46. +  
  47. +}
  48. +
  49. +/*! This function recalculates the stats modifiable by crates and update them (aimed for request #255)
  50. +   \todo code that crate effects not get ignored
  51. +   \author Graion Dilach
  52. +   \date 2011-10-12
  53. +*/
  54. +
  55. +void TechnoExt::RecalculateStats(TechnoClass *pTechno){
  56. +   auto pTechnoExt = TechnoExt::ExtMap.Find(pTechno);
  57. +   double Firepower = 1, Armor = 1, Speed = 1; //if there's hooks for crate-stuff, they could be the base for this
  58. +   bool Cloak = TechnoExt::CanICloakByDefault(pTechno);
  59. +
  60. +   if (pTechnoExt->AttachedEffects.Count != -1 && pTechnoExt->AttachedEffects.Count != 0){     //QDB #666... -_-
  61. +       for (int i=0; i < pTechnoExt->AttachedEffects.Count; i++){
  62. +
  63. +           Firepower *= pTechnoExt->AttachedEffects.GetItem(i)->Type->FirepowerMultiplier;
  64. +           Speed *= pTechnoExt->AttachedEffects.GetItem(i)->Type->SpeedMultiplier;
  65. +           Armor *= pTechnoExt->AttachedEffects.GetItem(i)->Type->ArmorMultiplier;
  66. +           Cloak = Cloak || pTechnoExt->AttachedEffects.GetItem(i)->Type->Cloakable;
  67. +      
  68. +       }
  69. +   }
  70. +
  71. +   pTechno->FirepowerMultiplier = Firepower;
  72. +   pTechno->ArmorMultiplier = Armor;
  73. +   pTechno->Cloakable = Cloak;
  74. +
  75. +   if(FootClass *Foot = generic_cast<FootClass *>(pTechno)) {
  76. +       Foot->SpeedMultiplier = Speed;
  77. +   }
  78. +}
  79. +
  80. +/*! This function calculates that the unit wold be cloaked by default
  81. +   \author Graion Dilach
  82. +   \date 2011-10-16
  83. +*/
  84. +
  85. +
  86. +bool TechnoExt::CanICloakByDefault(TechnoClass *pTechno){
  87. +   if (pTechno->GetTechnoType()->Cloakable){
  88. +       return true;
  89. +   }
  90. +
  91. +   if (pTechno->Veterancy.IsVeteran() && pTechno->GetTechnoType()->VeteranAbilities.CLOAK){
  92. +       return true;
  93. +   }
  94. +
  95. +   if (pTechno->Veterancy.IsElite() && (pTechno->GetTechnoType()->VeteranAbilities.CLOAK || pTechno->GetTechnoType()->EliteAbilities.CLOAK)){
  96. +       return true;
  97. +   }
  98. +
  99. +   return false;
  100. +}
  101. +
  102. +
  103.  bool TechnoExt::ExtData::IsDeactivated() const {
  104.     return this->AttachedToObject->Deactivated;
  105.  }
  106. Index: Ext/Techno/Body.h
  107. ===================================================================
  108. --- Ext/Techno/Body.h   (revision 1169)
  109. +++ Ext/Techno/Body.h   (working copy)
  110. @@ -58,6 +58,12 @@
  111.         // issue #617 powered units
  112.         PoweredUnitClass* PoweredUnit;
  113.  
  114. +       //#1573, #1623, #255 Stat-modifiers/ongoing animations
  115. +       DynamicVectorClass <AttachEffectClass *> AttachedEffects;
  116. +
  117. +       //boolean for #1623
  118. +       bool AttachedTechnoEffect_isset;
  119. +
  120.         ExtData(const DWORD Canary, TT* const OwnerObject) : Extension<TT>(Canary, OwnerObject),
  121.             idxSlot_Wave (0),
  122.             idxSlot_Beam (0),
  123. @@ -70,7 +76,8 @@
  124.             EMPLastMission (mission_None),
  125.             ShadowDrawnManually (false),
  126.             RadarJam(NULL),
  127. -           PoweredUnit(NULL)
  128. +           PoweredUnit(NULL),
  129. +           AttachedTechnoEffect_isset (false)
  130.             {
  131.                 this->CloakSkipTimer.Stop();
  132.                 // hope this works with the timing - I assume it does, since Types should be created before derivates thereof
  133. @@ -102,6 +109,7 @@
  134.         bool IsDeactivated() const;
  135.  
  136.         eAction GetDeactivatedAction(ObjectClass *Hovered = NULL) const;
  137. +
  138.     };
  139.  
  140.     static Container<TechnoExt> ExtMap;
  141. @@ -125,7 +133,11 @@
  142.  
  143.     static void TransferMindControl(TechnoClass *From, TechnoClass *To);
  144.     static void TransferIvanBomb(TechnoClass *From, TechnoClass *To);
  145. +   static void TransferAttachedEffects(TechnoClass *From, TechnoClass *To);
  146.    
  147. +   static void RecalculateStats(TechnoClass *pTechno);
  148. +   static bool CanICloakByDefault(TechnoClass *pTechno);
  149. +
  150.     static void Destroy(TechnoClass* pTechno, TechnoClass* pKiller = NULL, HouseClass* pKillerHouse = NULL, WarheadTypeClass* pWarhead = NULL);
  151.  /*
  152.     static int SelectWeaponAgainst(TechnoClass *pThis, TechnoClass *pTarget);
  153. Index: Ext/Techno/Hooks.cpp
  154. ===================================================================
  155. --- Ext/Techno/Hooks.cpp    (revision 1169)
  156. +++ Ext/Techno/Hooks.cpp    (working copy)
  157. @@ -64,6 +64,33 @@
  158.         pData->PoweredUnit->Update();
  159.     }
  160.  
  161. +
  162. +   //#1573, #1623, #255 - updating attached effects
  163. +   if (pData->AttachedEffects.Count) {
  164. +       int j = pData->AttachedEffects.Count;
  165. +       for (int i=pData->AttachedEffects.Count; i>0; --i) {
  166. +           auto Effect = pData->AttachedEffects.GetItem(i-1);
  167. +           --Effect->ActualDuration;
  168. +           if(!Effect->ActualDuration) {           //Bloody crashes - apparently if cloaked and attached, during delete it might crash.
  169. +               Effect->Destroy();
  170. +               if (Effect->Type->ID == Source->GetTechnoType()->ID) {      //#1623, hardcodes Cumulative to false
  171. +                   pData->AttachedTechnoEffect_isset=false;
  172. +               }
  173. +               delete Effect;
  174. +               pData->AttachedEffects.RemoveItem(i-1);
  175. +               TechnoExt::RecalculateStats(Source);    //and update the unit's properties
  176. +               }
  177. +
  178. +       }
  179. +
  180. +   }
  181. +  
  182. +   //#1623 - generating AttachedEffect from Type
  183. +   if (!!pTypeData->AttachedTechnoEffect.Duration && !pData->AttachedTechnoEffect_isset){
  184. +       pTypeData->AttachedTechnoEffect.Attach(Source, pTypeData->AttachedTechnoEffect.Duration);
  185. +       pData->AttachedTechnoEffect_isset=true;
  186. +   }
  187. +
  188.     return 0;
  189.  }
  190.  
  191. @@ -135,6 +162,7 @@
  192.         }
  193.     }
  194.  
  195. +
  196.     /*  using 0x6F9E7C instead makes this function override the original game one's entirely -
  197.         don't activate that unless you handle _everything_ originally handled by the game */
  198.     return 0;
  199. @@ -739,5 +767,18 @@
  200.         TechnoExt->PoweredUnit = NULL;
  201.     }
  202.  
  203. +   //#1573, #1623, #255 attached effects
  204. +   if (TechnoExt->AttachedEffects.Count){
  205. +       for (int i=TechnoExt->AttachedEffects.Count; i>0; --i) {
  206. +           //Debug::Log("[AttachEffect] Removing %d. item from %s\n", i-1, pThis->GetTechnoType()->ID);
  207. +           TechnoExt->AttachedEffects.GetItem(i-1)->Destroy();
  208. +           delete TechnoExt->AttachedEffects.GetItem(i-1);
  209. +       }
  210. +       //Debug::Log("[AttachEffect] Deleting array of %s\n", pThis->GetTechnoType()->ID);
  211. +       TechnoExt->AttachedEffects.Clear();
  212. +       TechnoExt->AttachedTechnoEffect_isset = false;
  213. +       TechnoExt::RecalculateStats(pThis);
  214. +   }
  215. +
  216.     return 0;
  217.  }
  218. Index: Ext/TechnoType/Body.cpp
  219. ===================================================================
  220. --- Ext/TechnoType/Body.cpp (revision 1169)
  221. +++ Ext/TechnoType/Body.cpp (working copy)
  222. @@ -304,6 +304,9 @@
  223.         }
  224.     }
  225.  
  226. +   //#1623 - AttachEffect on unit-creation
  227. +   this->AttachedTechnoEffect.Read(&exINI, section);
  228. +
  229.     // quick fix - remove after the rest of weapon selector code is done
  230.     return;
  231.  }
  232. Index: Ext/TechnoType/Body.h
  233. ===================================================================
  234. --- Ext/TechnoType/Body.h   (revision 1169)
  235. +++ Ext/TechnoType/Body.h   (working copy)
  236. @@ -9,7 +9,9 @@
  237.  #include "../_Container.hpp"
  238.  #include "../../Utilities/Template.h"
  239.  #include "../../Utilities/Constructs.h"
  240. +#include "../../Misc/AttachEffect.h"
  241.  
  242. +
  243.  #include <bitset>
  244.  
  245.  class TechnoTypeExt
  246. @@ -116,6 +118,9 @@
  247.         // issue #617
  248.         DynamicVectorClass<BuildingTypeClass*> PoweredBy;  //!< The buildingtype this unit is powered by or NULL.
  249.  
  250. +       //issue #1623
  251. +       AttachEffectTypeClass AttachedTechnoEffect; //The AttachedEffect which should been on the Techno from the start.
  252. +
  253.         ExtData(const DWORD Canary, TT* const OwnerObject) : Extension<TT>(Canary, OwnerObject),
  254.             Survivors_PilotChance (NULL),
  255.             Survivors_PassengerChance (NULL),
  256. @@ -162,7 +167,8 @@
  257.             WaterImage (NULL),
  258.             CanBeReversed (true),
  259.             RadarJamRadius (0),
  260. -           PassengerTurret (false)
  261. +           PassengerTurret (false),
  262. +           AttachedTechnoEffect()
  263.             {
  264.                 this->Insignia.SetAll(NULL);
  265.                 *this->CameoPCX = *this->AltCameoPCX = 0;
  266. Index: Ext/WarheadType/Body.cpp
  267. ===================================================================
  268. --- Ext/WarheadType/Body.cpp    (revision 1169)
  269. +++ Ext/WarheadType/Body.cpp    (working copy)
  270. @@ -93,6 +93,8 @@
  271.     this->KillDriver = pINI->ReadBool(section, "KillDriver", this->KillDriver);
  272.  
  273.     this->Malicious.Read(&exINI, section, "Malicious");
  274. +
  275. +   this->AttachedEffect.Read(&exINI, section);
  276.  };
  277.  
  278.  void Container<WarheadTypeExt>::InvalidatePointer(void *ptr) {
  279. @@ -445,6 +447,47 @@
  280.     return false;
  281.  }
  282.  
  283. +//AttachedEffects, request #1573, #255
  284. +//copy-pasted from AlexB's applyIC
  285. +//since CellSpread effect is needed due to MO's proposed cloak SW (which is the reason why I was bugged with this), it has it.
  286. +//Graion Dilach, ~2011-10-14... I forgot the exact date :S
  287. +
  288. +void WarheadTypeExt::ExtData::applyAttachedEffect(CoordStruct *coords, HouseClass* Owner) {
  289. +       if (!!this->AttachedEffect.Duration){
  290. +           CellStruct cellCoords = MapClass::Instance->GetCellAt(coords)->MapCoords;
  291. +           // set of affected objects. every object can be here only once.
  292. +           DynamicVectorClass<TechnoClass*> *items = Helpers::Alex::getCellSpreadItems(coords,
  293. +           this->AttachedToObject->CellSpread, true);
  294. +
  295. +
  296. +
  297. +           // affect each object
  298. +           for(int i=0; i<items->Count; ++i) {
  299. +               if(TechnoClass *curTechno = items->GetItem(i)) {
  300. +                   // don't attach to dead
  301. +                   if(curTechno->InLimbo || !curTechno->IsAlive || !curTechno->Health) {
  302. +                       continue;
  303. +                   }
  304. +
  305. +                  
  306. +                   if(WarheadTypeExt::canWarheadAffectTarget(curTechno, Owner, this->AttachedToObject)) {
  307. +                       if(abs(this->Verses[curTechno->GetTechnoType()->Armor].Verses) < 0.001) {
  308. +                           continue;
  309. +                       }
  310. +                       this->AttachedEffect.Attach(curTechno, this->AttachedEffect.Duration);
  311. +                      
  312. +                   }
  313. +                  
  314. +      
  315. +           }
  316. +       }
  317. +       items->Clear();
  318. +       delete items;
  319. +
  320. +   }
  321. +
  322. +}
  323. +
  324.  // =============================
  325.  // container hooks
  326.  
  327. Index: Ext/WarheadType/Body.h
  328. ===================================================================
  329. --- Ext/WarheadType/Body.h  (revision 1169)
  330. +++ Ext/WarheadType/Body.h  (working copy)
  331. @@ -19,6 +19,8 @@
  332.  
  333.  #include <Conversions.h>
  334.  
  335. +#include "../../Misc/AttachEffect.h"
  336. +
  337.  #include "../_Container.hpp"
  338.  
  339.  #include "../../Utilities/Template.h"
  340. @@ -75,6 +77,8 @@
  341.  
  342.         Valueable<bool> Malicious;
  343.  
  344. +       AttachEffectTypeClass AttachedEffect;
  345. +
  346.         ExtData(const DWORD Canary, TT* const OwnerObject) : Extension<TT>(Canary, OwnerObject),
  347.             MindControl_Permanent (false),
  348.             Ripple_Radius (0),
  349. @@ -88,7 +92,8 @@
  350.             InfDeathAnim (NULL),
  351.             PreImpactAnim (-1),
  352.             KillDriver (false),
  353. -           Malicious (true)
  354. +           Malicious (true),
  355. +           AttachedEffect()
  356.             {
  357.                 for(int i = 0; i < 11; ++i) {
  358.                     VersesData vs;
  359. @@ -112,6 +117,8 @@
  360.         void applyEMP(CoordStruct *, TechnoClass *);
  361.         bool applyPermaMC(CoordStruct *, HouseClass *, ObjectClass *);
  362.  
  363. +       void applyAttachedEffect(CoordStruct *, HouseClass *);
  364. +
  365.         bool applyKillDriver(BulletClass *); // #733
  366.     };
  367.  
  368. @@ -146,6 +153,14 @@
  369.     static void applyOccupantDamage(BulletClass *);
  370.  
  371.      static bool canWarheadAffectTarget(TechnoClass *, HouseClass *, WarheadTypeClass *);
  372. +
  373. +   //static void applyAttachedEffect(WarheadTypeClass * pWH, CoordStruct* coords, TechnoClass * Source) {
  374. +   static void applyAttachedEffect(WarheadTypeClass * pWH, CoordStruct* coords, HouseClass* Owner) {
  375. +       if(auto pWHExt = WarheadTypeExt::ExtMap.Find(pWH)) {
  376. +       //  pWHExt->applyAttachedEffect(coords, Source);
  377. +           pWHExt->applyAttachedEffect(coords, Owner);
  378. +       }
  379. +   }
  380.  };
  381.  
  382.  typedef hash_map<IonBlastClass *, WarheadTypeExt::ExtData *> hash_ionExt;
  383. Index: Ext/WarheadType/Hooks.cpp
  384. ===================================================================
  385. --- Ext/WarheadType/Hooks.cpp   (revision 1169)
  386. +++ Ext/WarheadType/Hooks.cpp   (working copy)
  387. @@ -56,6 +56,8 @@
  388.         pWHExt->applyEMP(&coords, Bullet->Owner);
  389.         WarheadTypeExt::applyOccupantDamage(Bullet);
  390.         pWHExt->applyKillDriver(Bullet);
  391. +       pWHExt->applyAttachedEffect(&coords, OwnerHouse);
  392. +      
  393.     }
  394.  
  395.  /*
  396. Index: Misc/AttachEffect.cpp
  397. ===================================================================
  398. --- Misc/AttachEffect.cpp   (revision 0)
  399. +++ Misc/AttachEffect.cpp   (revision 0)
  400. @@ -0,0 +1,70 @@
  401. +#include "AttachEffect.h"
  402. +#include "../Ext/Techno/Body.h"
  403. +#include "../Ext/TechnoType/Body.h"
  404. +#include "../Ext/WarheadType/Body.h"
  405. +
  406. +/*
  407. +Attached Effects system
  408. +covering feature requests
  409. +#1573, #1623 and #255
  410. +
  411. +Graion Dilach, 2011-09-24+
  412. +Proper documentation gets done if proper code there is.
  413. +
  414. +In a nutshell:
  415. +   relatively flexible way to interact with the unit's properties (as many as possible)
  416. +   to create as many as possible interesting effects
  417. +
  418. +Todo: something with that crash in cloak contra animation - crap, Documentation and crates
  419. +To-to-to-todo: Get a disassembler to update the hook (44A03C, BuildingClass_Mi_Selling_ReestablishMindControl, 6)
  420. +within Bugfixes.cpp to be set before TechnoClass::Remove, killing all effects on the way
  421. +*/
  422. +
  423. +void AttachEffectTypeClass::Attach(TechnoClass* Target, int Duration) {
  424. +   if (!Target) {return;}
  425. +
  426. +   TechnoExt::ExtData *TargetExt = TechnoExt::ExtMap.Find(Target);
  427. +
  428. +
  429. +   if (!this->Cumulative && TargetExt->AttachedEffects.Count > 0) {
  430. +       for (int i=0; i < TargetExt->AttachedEffects.Count; i++) {
  431. +           if (this->ID == TargetExt->AttachedEffects.GetItem(i)->Type->ID){
  432. +               TargetExt->AttachedEffects.GetItem(i)->ActualDuration = TargetExt->AttachedEffects.GetItem(i)->Type->Duration;
  433. +               return;
  434. +           }
  435. +       }
  436. +   }
  437. +
  438. +   // there goes the actual attaching
  439. +   auto Attaching = new AttachEffectClass(this, Duration);
  440. +   TargetExt->AttachedEffects.AddItem(Attaching);
  441. +
  442. +
  443. +   // animation
  444. +   if (!!this->AnimType) {
  445. +       GAME_ALLOC(AnimClass, Attaching->Animation, this->AnimType, &Target->Location);
  446. +       Attaching->Animation->SetOwnerObject(Target);
  447. +       // inbefore void pointers, hardcode the iteration to infinitely looped
  448. +       Attaching->Animation->RemainingIterations=-1;
  449. +
  450. +   }
  451. +  
  452. +   // update the unit with the attached effect
  453. +   TechnoExt::RecalculateStats(Target);
  454. +}
  455. +
  456. +//remove the effects from the unit
  457. +void AttachEffectClass::Destroy(){
  458. +   if (this->Animation){
  459. +           this->Animation->OwnerObject = NULL;
  460. +           this->Animation->Invisible = true;
  461. +           this->Animation->RemainingIterations = 0;
  462. +           //TimeToDie deletes the animation in the following frame... combining it with Remove() crashes, UnInit() crashes, GAME_DEALLOC crashes. Niiice.
  463. +           //While the above does the same and being the most elegant resolve.
  464. +           this->Animation->Audio1.ShutUp(); //Report
  465. +           this->Animation->Audio2.ShutUp();
  466. +           this->Animation->Audio3.ShutUp();
  467. +           this->Animation->Audio4.ShutUp();
  468. +           this->Animation = NULL;
  469. +   }
  470. +}
  471. \ No newline at end of file
  472. Index: Misc/AttachEffect.h
  473. ===================================================================
  474. --- Misc/AttachEffect.h (revision 0)
  475. +++ Misc/AttachEffect.h (revision 0)
  476. @@ -0,0 +1,72 @@
  477. +#ifndef ATTACHEFFECT_H_
  478. +#define ATTACHEFFECT_H_
  479. +
  480. +#include <vector>
  481. +#include <TechnoClass.h>
  482. +
  483. +#include "../Utilities/Template.h"
  484. +
  485. +
  486. +class AttachEffectTypeClass {
  487. +public:
  488. +
  489. +   const char* ID;
  490. +   Valueable<int> Duration;
  491. +   Valueable<bool> Cumulative;
  492. +  
  493. +   //#1573, #1623 animations on units
  494. +   Valueable<AnimTypeClass *> AnimType;
  495. +
  496. +   //#255, crate stat modifiers on weapons
  497. +   Valueable<double> FirepowerMultiplier;
  498. +   Valueable<double> ArmorMultiplier;
  499. +   Valueable<double> SpeedMultiplier;
  500. +   Valueable<bool> Cloakable;
  501. +
  502. +
  503. +   virtual void Attach(TechnoClass* Target, int Duration);
  504. +
  505. +   AttachEffectTypeClass(){
  506. +       this->Cumulative = false;
  507. +       this->Duration = 0;
  508. +       this->AnimType = NULL;
  509. +       this->FirepowerMultiplier = 1;
  510. +       this->ArmorMultiplier = 1;
  511. +       this->SpeedMultiplier = 1;
  512. +       this->Cloakable = false;
  513. +
  514. +
  515. +   };
  516. +
  517. +   void Read(INI_EX *exINI, const char * section) {
  518. +      
  519. +       this->ID = section;
  520. +       this->Duration.Read(exINI, section, "AttachEffect.Duration");
  521. +       this->Cumulative.Read(exINI, section, "AttachEffect.Cumulative");
  522. +       this->AnimType.Parse(exINI, section, "AttachEffect.Animation");
  523. +       this->FirepowerMultiplier.Read(exINI, section, "AttachEffect.FirepowerMultiplier");
  524. +       this->ArmorMultiplier.Read(exINI, section, "AttachEffect.ArmorMultiplier");
  525. +       this->SpeedMultiplier.Read(exINI, section, "AttachEffect.SpeedMultiplier");
  526. +       this->Cloakable.Read(exINI, section, "AttachEffect.Cloakable");
  527. +
  528. +
  529. +   }
  530. +};
  531. +
  532. +class AttachEffectClass {
  533. +public:
  534. +   AttachEffectClass(AttachEffectTypeClass* AEType, int Timer){
  535. +   this->Type = AEType;
  536. +   this->ActualDuration = Timer;
  537. +   this->Animation = NULL;
  538. +   }
  539. +
  540. +   AttachEffectTypeClass * Type;
  541. +   AnimClass * Animation;
  542. +   int ActualDuration;
  543. +
  544. +   void Destroy();
  545. +};
  546. +
  547. +
  548. +#endif
  549. \ No newline at end of file
  550. Index: Misc/Bugfixes.cpp
  551. ===================================================================
  552. --- Misc/Bugfixes.cpp   (revision 1169)
  553. +++ Misc/Bugfixes.cpp   (working copy)
  554. @@ -913,6 +913,7 @@
  555.  
  556.     TechnoExt::TransferMindControl(pUnit, pStructure);
  557.     TechnoExt::TransferIvanBomb(pUnit, pStructure);
  558. +   TechnoExt::TransferAttachedEffects(pUnit, pStructure);
  559.  
  560.     pStructure->QueueMission(mission_Construction, 0);
  561.  
  562. @@ -933,6 +934,7 @@
  563.  
  564.     TechnoExt::TransferMindControl(pStructure, pUnit);
  565.     TechnoExt::TransferIvanBomb(pStructure, pUnit);
  566. +   TechnoExt::TransferAttachedEffects(pStructure, pUnit);
  567.  
  568.     return 0;
  569.  }
  570.  
  571. Property changes on: Misc\Bugfixes.cpp
  572. ___________________________________________________________________
  573. Modified: svn:mergeinfo
  574.    Merged /trunk/src/Misc/Bugfixes.cpp:r1168-1169
  575.  
  576. Index: Misc/SWTypes/GenericWarhead.cpp
  577. ===================================================================
  578. --- Misc/SWTypes/GenericWarhead.cpp (revision 1169)
  579. +++ Misc/SWTypes/GenericWarhead.cpp (working copy)
  580. @@ -38,6 +38,7 @@
  581.     }
  582.  
  583.     pWHExt->applyEMP(&coords, Firer);
  584. +   pWHExt->applyAttachedEffect(&coords, pThis->Owner);
  585.  
  586.     if(!pWHExt->applyPermaMC(&coords, pThis->Owner, Cell->GetContent())) {
  587.         MapClass::DamageArea(&coords, pData->SW_Damage, Firer, pData->SW_Warhead, 1, pThis->Owner);
  588.  
  589.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement