Ejemplo n.º 1
0
            public void AddDamageInstance(PSO2DamageInstance instance)
            {
                //this sends the damage instance to the correct split player, or the combined player if this instance isnt split
                //dispatchInstance returns true when damagetype matches split player, once true, wereAnyDispatched will be set to true.
                //we dont deal with ZV separation, since all players are accumulated for that, it is handled in DamageParser class itself
                bool wereAnyDispatched = dispatchInstance(instance.IsAISDamage, PSO2DamageTrackers.AIS, instance, "AIS");

                wereAnyDispatched |= dispatchInstance(instance.IsDarkBlastDamage, PSO2DamageTrackers.DarkBlast, instance, "DB");
                wereAnyDispatched |= dispatchInstance(instance.IsHeroFinishDamage, PSO2DamageTrackers.HTF, instance, "HTF");
                wereAnyDispatched |= dispatchInstance(instance.IsLaconiumDamage, PSO2DamageTrackers.LSW, instance, "LSW");
                wereAnyDispatched |= dispatchInstance(instance.IsPhotonDamage, PSO2DamageTrackers.PWP, instance, "PWP");
                wereAnyDispatched |= dispatchInstance(instance.IsRideroidDamage, PSO2DamageTrackers.Ride, instance, "Ride");
                wereAnyDispatched |= dispatchInstance(instance.IsElementalDamage && !PSO2Player.IsAllyId(instance.TargetId), PSO2DamageTrackers.Elem, instance, "Elem"); //don't split incoming elemental dmg
                if (!wereAnyDispatched)
                {
                    CombinedPlayer.AddDamageInstance(instance);
                }
            }
Ejemplo n.º 2
0
 private void EnsurePlayerExists(PSO2DamageInstance instance)
 {
     if (PSO2Player.IsAllyId(instance.SourceId))
     {
         if (!_players.ContainsKey(instance.SourceId))
         {
             var controller = new PlayerDamageSeparationController(instance.SourceName, instance.SourceId, updateClock, InstanceUpdateHistoryDuration, this, trackersToSum);
             _players.Add(instance.SourceId, controller);
             Console.WriteLine($"Creating PSO2Player for source id {instance.SourceId}, name {instance.SourceName}");
         }
     }
     if (PSO2Player.IsAllyId(instance.TargetId))
     {
         if (!_players.ContainsKey(instance.TargetId))
         {
             var controller = new PlayerDamageSeparationController(instance.TargetName, instance.TargetId, updateClock, InstanceUpdateHistoryDuration, this, trackersToSum);
             _players.Add(instance.TargetId, controller);
             Console.WriteLine($"Creating PSO2Player for target id {instance.TargetId}, name {instance.TargetName}");
         }
     }
 }
Ejemplo n.º 3
0
 bool dispatchInstance(bool isCorrectType, PSO2DamageTrackers tracker, PSO2DamageInstance instance, string nameSuffix)
 {
     if (!isCorrectType)
     {
         return(false);
     }
     if (parser.trackersToSuppress.HasFlag(tracker) && (tracker == PSO2DamageTrackers.Elem ? !PSO2Player.IsAllyId(instance.TargetId) : true))
     {
         return(true);                                                                                                                                      //swallow this damage instance if it's suppressed. If element is hidden, only hide if its outgoing elemental dmg
     }
     else if (IsSplit(tracker))
     {
         if (!playerTrackerDict.ContainsKey(tracker))
         {
             buildSplitPlayer(tracker, nameSuffix);
         }
         playerTrackerDict[tracker].AddDamageInstance(instance);
         return(true);
     }
     return(false);
 }