示例#1
0
 def __init__(self, yaw = 0, attackerID = 0, attackerVehName = '', attackerVehClassTag = None, playerVehMaxHP = 0, damage = 0, critFlags = 0, isAlly = False, isBlocked = False, isHighExplosive = False):
     """
     Constructor.
     
     :param yaw: YAW.
     :param attackerID: Attacker ID.
     :param attackerVehName: Attacker vehicle name with IGR prefix.
     :param attackerVehClassTag: Attacker vehicle class tag.
     :param attackerVehMaxHP: Attacker vehicle max health points.
     :param isEnemy: Indicates whether the attacker is enemy.
     :param damage: Damage value (received or blocked).
     :param isBlocked: Indicates whether the damage is blocked.
     :param critFlags: Bit mask of critical damages (modules and crew).
     :param isHighExplosive: Indicates whether the hit is caused by high explosive shell.
     """
     super(HitData, self).__init__()
     self.__yaw = yaw
     self.__attackerID = attackerID
     self.__damage = damage
     self.__attackerVehName = attackerVehName
     self.__attackerVehClassTag = attackerVehClassTag or ''
     self.__playerVehMaxHP = playerVehMaxHP
     self.__critFlags = critFlags
     self.__critsCount = BitmaskHelper.getSetBitsCount(self.__critFlags)
     self.__hitFlags = self.__buildFlags(attackerID=attackerID, damage=damage, isAlly=isAlly, isBlocked=isBlocked, critFlags=critFlags, isHighExplosive=isHighExplosive)
示例#2
0
 def __init__(self,
              yaw=0,
              attackerID=0,
              attackerVehName='',
              attackerVehClassTag=None,
              playerVehMaxHP=0,
              damage=0,
              critFlags=0,
              isAlly=False,
              isBlocked=False,
              isHighExplosive=False,
              attackReasonID=0):
     super(HitData, self).__init__()
     self.__yaw = yaw
     self.__attackerID = attackerID
     self.__damage = damage
     self.__attackerVehName = attackerVehName
     self.__attackerVehClassTag = attackerVehClassTag or ''
     self.__playerVehMaxHP = playerVehMaxHP
     self.__attackReasonID = attackReasonID
     self.__critFlags = critFlags
     self.__critsCount = BitmaskHelper.getSetBitsCount(self.__critFlags)
     self.__hitFlags = self.__buildFlags(attackerID=attackerID,
                                         damage=damage,
                                         isAlly=isAlly,
                                         isBlocked=isBlocked,
                                         critFlags=critFlags,
                                         isHighExplosive=isHighExplosive,
                                         attackReasonID=attackReasonID)
     if self.isNonPlayerAttackReason():
         attackReasonSettings = _NONE_PLAYER_ATTACK_REASON_TAG[
             attackReasonID]
         self.__attackerVehName = i18n.makeString(attackReasonSettings[0])
         self.__attackerVehClassTag = attackReasonSettings[1]
示例#3
0
 def __init__(self,
              yaw=0,
              attackerID=0,
              attackerVehName='',
              attackerVehClassTag=None,
              playerVehMaxHP=0,
              damage=0,
              critFlags=0,
              isAlly=False,
              isBlocked=False,
              isHighExplosive=False):
     """
     Constructor.
     
     :param yaw: YAW.
     :param attackerID: Attacker ID.
     :param attackerVehName: Attacker vehicle name with IGR prefix.
     :param attackerVehClassTag: Attacker vehicle class tag.
     :param attackerVehMaxHP: Attacker vehicle max health points.
     :param isEnemy: Indicates whether the attacker is enemy.
     :param damage: Damage value (received or blocked).
     :param isBlocked: Indicates whether the damage is blocked.
     :param critFlags: Bit mask of critical damages (modules and crew).
     :param isHighExplosive: Indicates whether the hit is caused by high explosive shell.
     """
     super(HitData, self).__init__()
     self.__yaw = yaw
     self.__attackerID = attackerID
     self.__damage = damage
     self.__attackerVehName = attackerVehName
     self.__attackerVehClassTag = attackerVehClassTag or ''
     self.__playerVehMaxHP = playerVehMaxHP
     self.__critFlags = critFlags
     self.__critsCount = BitmaskHelper.getSetBitsCount(self.__critFlags)
     self.__hitFlags = self.__buildFlags(attackerID=attackerID,
                                         damage=damage,
                                         isAlly=isAlly,
                                         isBlocked=isBlocked,
                                         critFlags=critFlags,
                                         isHighExplosive=isHighExplosive)
示例#4
0
 def extend(self, hitData):
     self.__yaw = hitData.getYaw()
     self.__hitFlags |= hitData.getHitFlags()
     self.__critFlags |= hitData.getCriticalFlags()
     self.__critsCount = BitmaskHelper.getSetBitsCount(self.__critFlags)
     self.__damage += hitData.getDamage()
示例#5
0
 def extend(self, hitData):
     self.__yaw = hitData.getYaw()
     self.__hitFlags |= hitData.getHitFlags()
     self.__critFlags |= hitData.getCriticalFlags()
     self.__critsCount = BitmaskHelper.getSetBitsCount(self.__critFlags)
     self.__damage += hitData.getDamage()
示例#6
0
 def extend(self, hitData):
     super(HitData, self).extend(hitData)
     self.__hitFlags |= hitData.getHitFlags()
     self.__critFlags |= hitData.getCriticalFlags()
     self.__critsCount = BitmaskHelper.getSetBitsCount(self.__critFlags)
     self.__damage += hitData.getDamage()