Advertisement
Guest User

patch_for_torpedo.cpp

a guest
Mar 10th, 2015
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.63 KB | None | 0 0
  1. diff --git a/BotE Game/trunk/Source/Gamedata/Ships/Torpedo.cpp b/BotE Game/trunk/Source/Gamedata/Ships/Torpedo.cpp
  2. index 25642c3..be52e8a 100644
  3. --- a/BotE Game/trunk/Source/Gamedata/Ships/Torpedo.cpp
  4. +++ b/BotE Game/trunk/Source/Gamedata/Ships/Torpedo.cpp
  5. @@ -170,7 +170,8 @@ void CTorpedo::MakeDamage(CCombatShip* CS)
  6.     if ((CTorpedoInfo::GetPenetrating(m_byType) == TRUE && CS->GetActRegShields() == FALSE)
  7.         || CTorpedoInfo::GetIgnoreAllShields(m_byType) == TRUE || CS->m_bCanUseShields == FALSE)
  8.         toHull = torpedoDamage;
  9. -   CS->m_pShip->GetHull()->SetCurrentHull(-toHull);
  10. +  int hullDmg = CTorpedoInfo::GetDoubleHullDmg(m_byType) ? : toHull * 2 : toHull;
  11. +   CS->m_pShip->GetHull()->SetCurrentHull(-hullDmg);
  12.     // den restlichen Torpedoschaden ermitteln, welcher nicht direkt auf die Hülle ging
  13.     torpedoDamage -= toHull;
  14.  
  15. @@ -191,24 +192,24 @@ void CTorpedo::MakeDamage(CCombatShip* CS)
  16.             perc = 1.0f;
  17.         torpedoDamage = (int)(torpedoDamage * perc);
  18.     }
  19. -   // Wenn die Torpedoart doppelten Schaden an den Schilden macht, dann einfach diesen hier *2 nehmen
  20. -   if (CTorpedoInfo::GetDoubleShieldDmg(m_byType))
  21. -       torpedoDamage *= 2;
  22.     // Wenn die Torpedoart die Schilde kollabieren lassen kann, dann dies hier möglicherweise tun
  23.     if (CTorpedoInfo::GetCollapseShields(m_byType))
  24.         if (rand()%100 < 5) // 5% Chance die Schilde zusammenbrechen zu lassen
  25.             CS->m_pShip->GetShield()->SetCurrentShield(0);
  26. +  int shieldDmg = CTorpedoInfo::GetDoubleShieldDmg() ? torpedoDamage * 2 : torpedoDamage;
  27.     // Der komplette Schaden geht auf die Schilde
  28. -   if ((int)CS->m_pShip->GetShield()->GetCurrentShield() - torpedoDamage >= 0)
  29. -       CS->m_pShip->GetShield()->SetCurrentShield((int)CS->m_pShip->GetShield()->GetCurrentShield() - torpedoDamage);
  30. +   if ((int)CS->m_pShip->GetShield()->GetCurrentShield() - shieldDmg >= 0)
  31. +       CS->m_pShip->GetShield()->SetCurrentShield((int)CS->m_pShip->GetShield()->GetCurrentShield() - shieldDmg);
  32.     // Der Schaden geht teilweise auf Schilde und Hülle oder nur auf die Hülle
  33.     else
  34.     {
  35. +    torpedoDamage = shieldDmg - CS->m_pShip->GetShield()->GetCurrentShield();
  36. +    torpedoDamage = CTorpedoInfo::GetDoubleShieldDmg() ? torpedoDamage/2 : torpedoDamage; //reverse doubling effect
  37.         // Wenn die Torpedoart doppelten Schaden an der Hülle macht, dann einfach diesen hier *2 nehmen
  38.         if (CTorpedoInfo::GetDoubleHullDmg(m_byType))
  39.             torpedoDamage *= 2;
  40.         // Schaden der noch auf die Hülle geht
  41. -       CS->m_pShip->GetHull()->SetCurrentHull((int)CS->m_pShip->GetShield()->GetCurrentShield() - torpedoDamage);
  42. +       CS->m_pShip->GetHull()->SetCurrentHull(-torpedoDamage);
  43.         CS->m_pShip->GetShield()->SetCurrentShield(0);
  44.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement