Example #1
0
        private void doDestroyStat(PoolObjHandle <ActorRoot> src, PoolObjHandle <ActorRoot> atker)
        {
            DestroyStat stat;
            Dictionary <int, DestroyStat> dictionary;

            if (!this.destroyStats.TryGetValue((uint)src.handle.TheActorMeta.ActorType, out dictionary))
            {
                dictionary = new Dictionary <int, DestroyStat>();
                this.destroyStats.Add((uint)src.handle.TheActorMeta.ActorType, dictionary);
            }
            if (!dictionary.TryGetValue(src.handle.TheActorMeta.ConfigId, out stat))
            {
                stat = new DestroyStat();
                dictionary.Add(src.handle.TheActorMeta.ConfigId, stat);
            }
            COM_PLAYERCAMP playerCamp = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().PlayerCamp;

            COM_PLAYERCAMP actorCamp = src.handle.TheActorMeta.ActorCamp;
            int            num       = (playerCamp == actorCamp) ? 0 : 1;

            if (num == 1)
            {
                if (actorCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_MID)
                {
                    if ((atker != 0) && (atker.handle.TheActorMeta.ActorCamp == playerCamp))
                    {
                        stat.CampEnemyNum++;
                    }
                }
                else
                {
                    stat.CampEnemyNum++;
                }
            }
            else if (actorCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_MID)
            {
                if ((atker != 0) && (atker.handle.TheActorMeta.ActorCamp != playerCamp))
                {
                    stat.CampSelfNum++;
                }
            }
            else
            {
                stat.CampSelfNum++;
            }
            this.destroyStats[(uint)src.handle.TheActorMeta.ActorType][src.handle.TheActorMeta.ConfigId] = stat;
        }
Example #2
0
 private void CondfoToDestroyStat(ResDT_ConditionInfo[] astCond)
 {
     for (int i = 0; i < astCond.Length; i++)
     {
         if ((astCond[i].dwType == 1) && (astCond[i].KeyDetail[1] != 0))
         {
             DestroyStat stat;
             Dictionary <int, DestroyStat> dictionary;
             if (!this.destroyStats.TryGetValue((uint)astCond[i].KeyDetail[0], out dictionary))
             {
                 dictionary = new Dictionary <int, DestroyStat>();
                 this.destroyStats.Add((uint)astCond[i].KeyDetail[0], dictionary);
             }
             if (!dictionary.TryGetValue(astCond[i].KeyDetail[1], out stat))
             {
                 stat = new DestroyStat();
                 dictionary.Add(astCond[i].KeyDetail[1], stat);
             }
         }
     }
 }