dotAppInfo.py (1800B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\packages\dotWeapons\common\dotAppInfo.py 2 from carbon.common.script.util.mathCommon import FloatCloseEnough 3 from dotWeapons.common.dotUtil import GetEffectiveDamage 4 5 class DotApplicationInfo(object): 6 7 def __init__(self, *args, **kwargs): 8 self._attackerID = kwargs.get('attackerID', None) 9 self._weaponTypeID = kwargs.get('weaponTypeID', None) 10 self._expiryTime = kwargs.get('expiryTime', None) 11 self._maxDamage = kwargs.get('maxDamage', None) 12 self._maxHPNormalizedRatio = kwargs.get('maxHPNormalizedRatio', None) 13 self._activityState = kwargs.get('activityState', None) 14 self._targetID = kwargs.get('targetID', None) 15 16 @property 17 def attackerID(self): 18 return self._attackerID 19 20 @property 21 def targetID(self): 22 return self._targetID 23 24 @property 25 def weaponTypeID(self): 26 return self._weaponTypeID 27 28 @property 29 def expiryTime(self): 30 return self._expiryTime 31 32 @property 33 def maxDamage(self): 34 return self._maxDamage 35 36 @property 37 def maxHPNormalizedRatio(self): 38 return self._maxHPNormalizedRatio 39 40 @property 41 def activityState(self): 42 return self._activityState 43 44 def GetEffectiveDamage(self, totalHP): 45 return GetEffectiveDamage(self.maxDamage, self.maxHPNormalizedRatio, totalHP) 46 47 def IsMaskedBy(self, otherDotAppInfo, totalHp): 48 myDmg = self.GetEffectiveDamage(totalHp) 49 otherDmg = otherDotAppInfo.GetEffectiveDamage(totalHp) 50 if otherDmg >= myDmg and otherDotAppInfo.expiryTime >= self.expiryTime: 51 return True 52 return False 53 54 def __repr__(self): 55 return '<DotApplicationInfo %s>, %s' % (self.__dict__, id(self))