示例#1
0
 public void AddActor(PoolObjHandle <ActorRoot> actor)
 {
     StringHelper.ClearFormater();
     StringHelper.Formater.Append(actor.handle.ActorControl.GetTypeName());
     StringHelper.Formater.Append(actor.handle.ObjID);
     StringHelper.Formater.Append("(");
     StringHelper.Formater.Append(actor.handle.TheStaticData.TheResInfo.Name);
     StringHelper.Formater.Append(")");
     actor.handle.name            = StringHelper.Formater.ToString();
     actor.handle.gameObject.name = actor.handle.name;
     this.GameActors.Add(actor);
     if (actor.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
     {
         this.HeroActors.Add(actor);
     }
     if (actor.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ)
     {
         this.OrganActors.Add(actor);
         if ((actor.handle.TheStaticData.TheOrganOnlyInfo.OrganType == 1) || (actor.handle.TheStaticData.TheOrganOnlyInfo.OrganType == 4))
         {
             this.TowerActors.Add(actor);
         }
     }
     if (actor.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
     {
         MonsterWrapper wrapper = actor.handle.AsMonster();
         if (((wrapper != null) && (wrapper.cfgInfo != null)) && (wrapper.cfgInfo.bMonsterType == 1))
         {
             this.SoldierActors.Add(actor);
         }
     }
     actor.handle.isRecycled = false;
     this.CampsActors[(int)actor.handle.TheActorMeta.ActorCamp].Add(actor);
 }
示例#2
0
 public static bool FitWithJungleMonsterNotInBattle(ActorRoot _actor, bool bWithMonsterNotInBattle)
 {
     if (_actor.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Monster)
     {
         return(false);
     }
     if (!bWithMonsterNotInBattle)
     {
         MonsterWrapper actorControl = _actor.ActorControl as MonsterWrapper;
         if (actorControl != null)
         {
             ResMonsterCfgInfo cfgInfo = actorControl.cfgInfo;
             if ((cfgInfo != null) && (cfgInfo.bMonsterType == 2))
             {
                 switch (actorControl.myBehavior)
                 {
                 case ObjBehaviMode.State_Idle:
                 case ObjBehaviMode.State_Dead:
                 case ObjBehaviMode.State_Null:
                     return(false);
                 }
             }
         }
     }
     return(true);
 }
示例#3
0
        private void SetSkillSpeed(PoolObjHandle <ActorRoot> _user)
        {
            int num = 0;

            if (this.curAction)
            {
                PoolObjHandle <ActorRoot> poolObjHandle  = _user;
                MonsterWrapper            monsterWrapper = _user.handle.ActorControl as MonsterWrapper;
                if (monsterWrapper != null && monsterWrapper.isCalledMonster && monsterWrapper.UseHostValueProperty)
                {
                    poolObjHandle = monsterWrapper.hostActor;
                }
                ValueDataInfo valueDataInfo = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_PROPERTY_ATTACKSPEED];
                int           totalValue    = valueDataInfo.totalValue;
                int           num2          = totalValue + poolObjHandle.handle.ValueComponent.mActorValue.actorLvl * (int)this.battleParam.dwM_AttackSpeed + (int)this.battleParam.dwN_AttackSpeed;
                if (num2 != 0)
                {
                    num = totalValue * 10000 / num2;
                }
                num += poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_ATKSPDADD].totalValue;
                if (this.cfgData != null && this.cfgData.bNoInfluenceAnim == 1)
                {
                    num = 0;
                }
                VFactor playSpeed = new VFactor((long)(10000 + num), 10000L);
                this.curAction.handle.SetPlaySpeed(playSpeed);
            }
        }
示例#4
0
        public static bool FitWithJungleMonsterNotInBattle(ActorRoot _actor, bool bWithMonsterNotInBattle)
        {
            if (_actor.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Monster)
            {
                return(false);
            }
            if (bWithMonsterNotInBattle)
            {
                return(true);
            }
            MonsterWrapper monsterWrapper = _actor.ActorControl as MonsterWrapper;

            if (monsterWrapper != null)
            {
                ResMonsterCfgInfo cfgInfo = monsterWrapper.cfgInfo;
                if (cfgInfo != null && cfgInfo.bMonsterType == 2)
                {
                    ObjBehaviMode myBehavior = monsterWrapper.myBehavior;
                    if (myBehavior == ObjBehaviMode.State_Idle || myBehavior == ObjBehaviMode.State_Dead || myBehavior == ObjBehaviMode.State_Null)
                    {
                        return(false);
                    }
                }
            }
            return(true);
        }
示例#5
0
 public void OnActorBattleCoinChanged(PoolObjHandle <ActorRoot> actor, int changeValue, bool isIncome, PoolObjHandle <ActorRoot> target)
 {
     if (isIncome && actor == this.actorHero)
     {
         uint num  = 0u;
         uint num2 = (uint)(Singleton <FrameSynchr> .get_instance().LogicFrameTick / 1000uL);
         if (num2 >= 60u)
         {
             num = (num2 - 60u) / 30u + 1u;
         }
         this._totalCoin += changeValue;
         this.SetCoinRecorderInfo(KDAStat.GET_COIN_CHANNEL_TYPE.GET_COIN_CHANNEL_TYPE_ALL, this._totalCoin, num);
         if (target)
         {
             ActorTypeDef actorType = target.get_handle().TheActorMeta.ActorType;
             if (actorType == ActorTypeDef.Actor_Type_Hero)
             {
                 this.m_iCoinFromKillHero += changeValue;
                 this.SetCoinRecorderInfo(KDAStat.GET_COIN_CHANNEL_TYPE.GET_COIN_CHANNEL_TYPE_KILLHERO, this.m_iCoinFromKillHero, num);
             }
             else if (actorType == ActorTypeDef.Actor_Type_Organ)
             {
                 this.m_iCoinFromKillTower += changeValue;
                 this.SetCoinRecorderInfo(KDAStat.GET_COIN_CHANNEL_TYPE.GET_COIN_CHANNEL_TYPE_KILLTOWER, this.m_iCoinFromKillTower, num);
             }
             else if (actorType == ActorTypeDef.Actor_Type_Monster)
             {
                 if (target.get_handle().ActorControl.GetActorSubType() == 1)
                 {
                     this.m_iCoinFromKillSolider += changeValue;
                     this.SetCoinRecorderInfo(KDAStat.GET_COIN_CHANNEL_TYPE.GET_COIN_CHANNEL_TYPE_KILLSOLIDER, this.m_iCoinFromKillSolider, num);
                 }
                 else
                 {
                     MonsterWrapper monsterWrapper = target.get_handle().AsMonster();
                     if (monsterWrapper != null && monsterWrapper.cfgInfo != null)
                     {
                         if (monsterWrapper.cfgInfo.bSoldierType == 7 || monsterWrapper.cfgInfo.bSoldierType == 9 || monsterWrapper.cfgInfo.bSoldierType == 8)
                         {
                             this.m_iCoinFromKillDragon += changeValue;
                             this.SetCoinRecorderInfo(KDAStat.GET_COIN_CHANNEL_TYPE.GET_COIN_CHANNEL_TYPE_KILLDRAGON, this.m_iCoinFromKillDragon, num);
                         }
                         else
                         {
                             this.m_iCoinFromKillMonster += changeValue;
                             this.SetCoinRecorderInfo(KDAStat.GET_COIN_CHANNEL_TYPE.GET_COIN_CHANNEL_TYPE_KILLMONSTER, this.m_iCoinFromKillMonster, num);
                         }
                     }
                 }
             }
         }
         else
         {
             this.m_iCoinFromSystem += changeValue;
         }
         this.uiLastRecordCoinIndex = num;
     }
 }
示例#6
0
        private void onActorDead(ref DefaultGameEventParam prm)
        {
            NONHERO_STATISTIC_INFO nonhero_statistic_info;
            DictionaryView <uint, NONHERO_STATISTIC_INFO> view;

            this.doDestroyStat(prm.src, prm.orignalAtker);
            if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
            {
                HeroWrapper actorControl = prm.src.handle.ActorControl as HeroWrapper;
                if (actorControl.IsKilledByHero())
                {
                    CampInfo campInfoByCamp           = null;
                    PoolObjHandle <ActorRoot> inAtker = new PoolObjHandle <ActorRoot>(null);
                    if (actorControl.LastHeroAtker != 0)
                    {
                        campInfoByCamp = this.GetCampInfoByCamp(actorControl.LastHeroAtker.handle.TheActorMeta.ActorCamp);
                        inAtker        = actorControl.LastHeroAtker;
                    }
                    else if ((prm.orignalAtker != 0) && (prm.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero))
                    {
                        campInfoByCamp = this.GetCampInfoByCamp(prm.orignalAtker.handle.TheActorMeta.ActorCamp);
                        inAtker        = prm.orignalAtker;
                    }
                    if ((campInfoByCamp != null) && (inAtker != 0))
                    {
                        campInfoByCamp.IncCampScore(prm.src, inAtker);
                        uint dwConfValue = GameDataMgr.globalInfoDatabin.GetDataByKey(0x6d).dwConfValue;
                        campInfoByCamp.IncHeadPoints((int)dwConfValue, prm.src, inAtker);
                    }
                }
            }
            else if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
            {
                MonsterWrapper wrapper2 = prm.src.handle.ActorControl as MonsterWrapper;
                if (wrapper2.IsKilledByHero())
                {
                    CampInfo info2 = this.GetCampInfoByCamp(wrapper2.LastHeroAtker.handle.TheActorMeta.ActorCamp);
                    DebugHelper.Assert(info2 != null);
                    if (info2 != null)
                    {
                        info2.IncHeadPoints(wrapper2.cfgInfo.iHeadPoints, prm.src, prm.orignalAtker);
                    }
                }
                else if ((prm.orignalAtker != 0) && (prm.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero))
                {
                    CampInfo info3 = this.GetCampInfoByCamp(prm.orignalAtker.handle.TheActorMeta.ActorCamp);
                    DebugHelper.Assert(info3 != null);
                    if (info3 != null)
                    {
                        info3.IncHeadPoints(wrapper2.cfgInfo.iHeadPoints, prm.src, prm.orignalAtker);
                    }
                }
            }
            if (((prm.src != 0) && (prm.src.handle.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero)) && (this.m_NonHeroInfo.TryGetValue((uint)prm.src.handle.TheActorMeta.ActorType, out view) && view.TryGetValue((uint)prm.src.handle.TheActorMeta.ActorCamp, out nonhero_statistic_info)))
            {
                nonhero_statistic_info.uiTotalDeadNum++;
            }
        }
示例#7
0
        public ActorRoot GetNearestEnemyWithoutNotInBattleJungleMonsterWithoutActor(ActorRoot InActor, int srchR, uint withOutActor)
        {
            if (InActor == null)
            {
                return(null);
            }
            ActorRoot root = null;
            ulong     num  = (ulong)(srchR * srchR);

            for (int i = 0; i < 3; i++)
            {
                if (i != InActor.TheActorMeta.ActorCamp)
                {
                    List <PoolObjHandle <ActorRoot> > campActors = Singleton <GameObjMgr> .GetInstance().GetCampActors((COM_PLAYERCAMP)i);

                    int count = campActors.Count;
                    for (int j = 0; j < count; j++)
                    {
                        PoolObjHandle <ActorRoot> handle = campActors[j];
                        ActorRoot target = handle.handle;
                        if (((target != null) && (target.ObjID != withOutActor)) && target.HorizonMarker.IsVisibleFor(InActor.TheActorMeta.ActorCamp))
                        {
                            MonsterWrapper wrapper = target.AsMonster();
                            if (wrapper != null)
                            {
                                ResMonsterCfgInfo cfgInfo = wrapper.cfgInfo;
                                if ((cfgInfo != null) && (cfgInfo.bMonsterType == 2))
                                {
                                    switch (target.ActorAgent.GetCurBehavior())
                                    {
                                    case ObjBehaviMode.State_Idle:
                                    case ObjBehaviMode.State_Dead:
                                    case ObjBehaviMode.State_Null:
                                    {
                                        continue;
                                    }
                                    }
                                }
                            }
                            VInt3 num6 = target.location - InActor.location;
                            ulong num5 = (ulong)num6.sqrMagnitudeLong2D;
                            if ((num5 < num) && InActor.CanAttack(target))
                            {
                                root = target;
                                num  = num5;
                            }
                        }
                    }
                }
            }
            return(root);
        }
示例#8
0
        public ActorRoot GetNearestEnemy(ActorRoot InActor, int srchR, uint filter, bool bWithMonsterNotInBattle = true)
        {
            ActorRoot root = null;
            ulong     num  = (ulong)(srchR * srchR);

            for (int i = 0; i < 3; i++)
            {
                if (i != InActor.TheActorMeta.ActorCamp)
                {
                    List <PoolObjHandle <ActorRoot> > campActors = Singleton <GameObjMgr> .GetInstance().GetCampActors((COM_PLAYERCAMP)i);

                    int count = campActors.Count;
                    for (int j = 0; j < count; j++)
                    {
                        PoolObjHandle <ActorRoot> handle = campActors[j];
                        ActorRoot target = handle.handle;
                        if (((filter & (((int)1) << target.TheActorMeta.ActorType)) <= 0L) && target.HorizonMarker.IsVisibleFor(InActor.TheActorMeta.ActorCamp))
                        {
                            if (!bWithMonsterNotInBattle)
                            {
                                MonsterWrapper actorControl = target.ActorControl as MonsterWrapper;
                                if (actorControl != null)
                                {
                                    ResMonsterCfgInfo cfgInfo = actorControl.cfgInfo;
                                    if ((cfgInfo != null) && (cfgInfo.bMonsterType == 2))
                                    {
                                        switch (target.ActorAgent.GetCurBehavior())
                                        {
                                        case ObjBehaviMode.State_Idle:
                                        case ObjBehaviMode.State_Dead:
                                        case ObjBehaviMode.State_Null:
                                        {
                                            continue;
                                        }
                                        }
                                    }
                                }
                            }
                            VInt3 num6 = target.location - InActor.location;
                            ulong num5 = (ulong)num6.sqrMagnitudeLong2D;
                            if ((num5 < num) && InActor.CanAttack(target))
                            {
                                root = target;
                                num  = num5;
                            }
                        }
                    }
                }
            }
            return(root);
        }
        public void MakeDropItemIfNeed(MonsterWrapper InMonster, ObjWrapper InTarget)
        {
            DebugHelper.Assert(InMonster != null);
            ResMonsterCfgInfo cfgInfo = InMonster.cfgInfo;

            if ((cfgInfo != null) && (cfgInfo.iBufDropID != 0))
            {
                this.MonsterRef = InMonster;
                if (FrameRandom.Random(0x2710) < cfgInfo.iBufDropRate)
                {
                    this.SpawnBuf(cfgInfo.iBufDropID);
                }
            }
        }
示例#10
0
        private void OnActorDeadIncomeSoul(ref PoolObjHandle <ActorRoot> target, ref PoolObjHandle <ActorRoot> attacker)
        {
            if (!target || !attacker)
            {
                return;
            }
            ResIncomeAllocRule resIncomeAllocRule = null;

            switch (target.get_handle().TheActorMeta.ActorType)
            {
            case ActorTypeDef.Actor_Type_Hero:
                resIncomeAllocRule = this.m_incomeAllocRules[1][3];
                break;

            case ActorTypeDef.Actor_Type_Monster:
            {
                MonsterWrapper monsterWrapper = target.get_handle().AsMonster();
                if (monsterWrapper != null)
                {
                    RES_MONSTER_TYPE bMonsterType = monsterWrapper.cfgInfo.bMonsterType;
                    if (bMonsterType == 2)
                    {
                        resIncomeAllocRule = this.m_incomeAllocRules[1][4];
                    }
                    else if (bMonsterType == 1)
                    {
                        resIncomeAllocRule = this.m_incomeAllocRules[1][2];
                    }
                }
                break;
            }

            case ActorTypeDef.Actor_Type_Organ:
                resIncomeAllocRule = this.m_incomeAllocRules[1][1];
                break;

            case ActorTypeDef.Actor_Type_EYE:
                resIncomeAllocRule = this.m_incomeAllocRules[1][6];
                break;
            }
            if (resIncomeAllocRule != null)
            {
                ResDT_IncomeAttackRule incomeAllocRuleByAtker = this.GetIncomeAllocRuleByAtker(ref attacker, resIncomeAllocRule);
                if (incomeAllocRuleByAtker != null)
                {
                    this.AllocIncome(ref target, ref attacker, incomeAllocRuleByAtker, enIncomeType.Soul, resIncomeAllocRule.IncomeChangeRate, resIncomeAllocRule.iComputerChangeRate);
                }
            }
        }
 public static bool FitSoldier(ActorRoot _actor)
 {
     if (_actor.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
     {
         MonsterWrapper monsterWrapper = _actor.ActorControl as MonsterWrapper;
         if (monsterWrapper != null)
         {
             ResMonsterCfgInfo cfgInfo = monsterWrapper.cfgInfo;
             if (cfgInfo != null && cfgInfo.bMonsterType == 1)
             {
                 return(true);
             }
         }
     }
     return(false);
 }
 public void AddActor(PoolObjHandle <ActorRoot> actor)
 {
     StringHelper.ClearFormater();
     StringHelper.Formater.Append(actor.handle.ActorControl.GetTypeName());
     StringHelper.Formater.Append(actor.handle.ObjID);
     StringHelper.Formater.Append("(");
     StringHelper.Formater.Append(actor.handle.TheStaticData.TheResInfo.Name);
     StringHelper.Formater.Append(")");
     actor.handle.name            = StringHelper.Formater.ToString();
     actor.handle.gameObject.name = actor.handle.name;
     this.GameActors.Add(actor);
     if (actor.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
     {
         this.HeroActors.Add(actor);
     }
     else if (actor.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ)
     {
         this.OrganActors.Add(actor);
         if (actor.handle.TheStaticData.TheOrganOnlyInfo.OrganType == 1 || actor.handle.TheStaticData.TheOrganOnlyInfo.OrganType == 4)
         {
             this.TowerActors.Add(actor);
         }
     }
     else if (actor.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
     {
         this.MonsterActors.Add(actor);
         MonsterWrapper monsterWrapper = actor.handle.AsMonster();
         if (monsterWrapper != null && monsterWrapper.cfgInfo != null)
         {
             RES_MONSTER_TYPE bMonsterType = (RES_MONSTER_TYPE)monsterWrapper.cfgInfo.bMonsterType;
             if (bMonsterType == RES_MONSTER_TYPE.RES_MONSTER_TYPE_SOLDIERLINE)
             {
                 this.SoldierActors.Add(actor);
             }
         }
     }
     else if (actor.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_EYE)
     {
         this.FakeTrueEyes.Add(actor);
     }
     else if (actor.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Call)
     {
         this.CallActors.Add(actor);
     }
     actor.handle.isRecycled = false;
     this.CampsActors[(int)actor.handle.TheActorMeta.ActorCamp].Add(actor);
 }
        protected uint ExecuteSearchTarget(int srchR, ref bool bSearched)
        {
            PoolObjHandle <ActorRoot> poolObjHandle  = this.actorPtr;
            MonsterWrapper            monsterWrapper = poolObjHandle.handle.ActorControl as MonsterWrapper;

            if (monsterWrapper != null && monsterWrapper.isCalledMonster)
            {
                poolObjHandle = monsterWrapper.hostActor;
            }
            Player ownerPlayer = ActorHelper.GetOwnerPlayer(ref poolObjHandle);

            if (ownerPlayer == null)
            {
                return(0u);
            }
            SelectEnemyType attackTargetMode   = ownerPlayer.AttackTargetMode;
            LastHitMode     useLastHitMode     = ownerPlayer.useLastHitMode;
            AttackOrganMode curAttackOrganMode = ownerPlayer.curAttackOrganMode;
            OperateMode     operateMode        = ownerPlayer.GetOperateMode();
            uint            result;

            if (operateMode == OperateMode.LockMode)
            {
                result = this.NormalModeCommonAttackSearchTarget(srchR, attackTargetMode, ref bSearched);
            }
            else if (this.commonAttackButtonType == CommonAttackButtonType.CommonAttackButton)
            {
                if (useLastHitMode == LastHitMode.None && curAttackOrganMode == AttackOrganMode.None)
                {
                    result = this.NormalModeCommonAttackSearchTarget(srchR, attackTargetMode, ref bSearched);
                }
                else
                {
                    result = this.AdvancedModeCommonAttackSearchTarget(srchR, attackTargetMode, ref bSearched);
                }
            }
            else if (this.commonAttackButtonType == CommonAttackButtonType.LastHitButton)
            {
                result = this.LastHitModeSearchTarget(srchR, attackTargetMode, ref bSearched);
            }
            else
            {
                result = this.AttackOrganModeSearchTarget(srchR, attackTargetMode, ref bSearched);
            }
            return(result);
        }
        public void MakeDropItemIfNeed(MonsterWrapper InMonster, ObjWrapper InTarget)
        {
            DebugHelper.Assert(InMonster != null);
            ResMonsterCfgInfo cfgInfo = InMonster.cfgInfo;

            if (cfgInfo == null || cfgInfo.iBufDropID == 0)
            {
                return;
            }
            this.MonsterRef = InMonster;
            ushort num = FrameRandom.Random(10000u);

            if ((int)num < cfgInfo.iBufDropRate)
            {
                this.SpawnBuf(cfgInfo.iBufDropID);
            }
        }
示例#15
0
        private void AddDamageValue(ref PoolObjHandle <ActorRoot> actor, SkillSlotType slotType, int iValue, HurtTypeDef hurtType)
        {
            if (this.m_listDamageActorValue != null && slotType <= SkillSlotType.SLOT_SKILL_VALID && actor)
            {
                uint objID = actor.get_handle().ObjID;
                this.DeleteTimeoutDamageValue(objID, 0uL);
                DAMAGE_ACTOR_INFO dAMAGE_ACTOR_INFO;
                if (!this.m_listDamageActorValue.TryGetValue(objID, ref dAMAGE_ACTOR_INFO))
                {
                    dAMAGE_ACTOR_INFO           = default(DAMAGE_ACTOR_INFO);
                    dAMAGE_ACTOR_INFO.actorType = actor.get_handle().TheActorMeta.ActorType;
                    dAMAGE_ACTOR_INFO.actorName = actor.get_handle().name;
                    dAMAGE_ACTOR_INFO.ConfigId  = actor.get_handle().TheActorMeta.ConfigId;
                    if (dAMAGE_ACTOR_INFO.actorType == ActorTypeDef.Actor_Type_Monster)
                    {
                        MonsterWrapper monsterWrapper = actor.get_handle().AsMonster();
                        dAMAGE_ACTOR_INFO.bMonsterType = monsterWrapper.GetActorSubType();
                        dAMAGE_ACTOR_INFO.actorSubType = monsterWrapper.GetActorSubSoliderType();
                    }
                    Player player = Singleton <GamePlayerCenter> .get_instance().GetPlayer(actor.get_handle().TheActorMeta.PlayerId);

                    if (player != null)
                    {
                        dAMAGE_ACTOR_INFO.playerName = player.Name;
                    }
                    dAMAGE_ACTOR_INFO.listDamage = new SortedList <ulong, DOUBLE_INT_INFO[]>();
                    this.m_listDamageActorValue.Add(objID, dAMAGE_ACTOR_INFO);
                }
                ulong logicFrameTick = Singleton <FrameSynchr> .get_instance().LogicFrameTick;

                DOUBLE_INT_INFO[] array;
                if (!dAMAGE_ACTOR_INFO.listDamage.TryGetValue(logicFrameTick, ref array))
                {
                    array = new DOUBLE_INT_INFO[12];
                    dAMAGE_ACTOR_INFO.listDamage.Add(logicFrameTick, array);
                }
                if (array[(int)slotType].iValue == 0)
                {
                    array[(int)slotType].iKey = (int)hurtType;
                }
                DOUBLE_INT_INFO[] expr_170_cp_0 = array;
                expr_170_cp_0[(int)slotType].iValue = expr_170_cp_0[(int)slotType].iValue + iValue;
                dAMAGE_ACTOR_INFO.listDamage.set_Item(logicFrameTick, array);
                this.m_listDamageActorValue.set_Item(objID, dAMAGE_ACTOR_INFO);
            }
        }
        private ResDT_IncomeAttackRule GetIncomeAllocRuleByAtker(ref PoolObjHandle <ActorRoot> attacker, ResIncomeAllocRule incomeRule)
        {
            if (incomeRule == null || !attacker)
            {
                return(null);
            }
            RES_INCOME_ATTACKER_TYPE rES_INCOME_ATTACKER_TYPE = RES_INCOME_ATTACKER_TYPE.RES_INCOME_ATTACKER_ALL;

            switch (attacker.handle.TheActorMeta.ActorType)
            {
            case ActorTypeDef.Actor_Type_Hero:
                rES_INCOME_ATTACKER_TYPE = RES_INCOME_ATTACKER_TYPE.RES_INCOME_ATTACKER_HERO;
                break;

            case ActorTypeDef.Actor_Type_Monster:
            {
                MonsterWrapper monsterWrapper = attacker.handle.AsMonster();
                if (monsterWrapper != null)
                {
                    RES_MONSTER_TYPE bMonsterType = (RES_MONSTER_TYPE)monsterWrapper.cfgInfo.bMonsterType;
                    if (bMonsterType == RES_MONSTER_TYPE.RES_MONSTER_TYPE_JUNGLE)
                    {
                        rES_INCOME_ATTACKER_TYPE = RES_INCOME_ATTACKER_TYPE.RES_INCOME_ATTACKER_MONSTER;
                    }
                    else if (bMonsterType == RES_MONSTER_TYPE.RES_MONSTER_TYPE_SOLDIERLINE)
                    {
                        rES_INCOME_ATTACKER_TYPE = RES_INCOME_ATTACKER_TYPE.RES_INCOME_ATTACKER_SOLDIER;
                    }
                }
                break;
            }

            case ActorTypeDef.Actor_Type_Organ:
                rES_INCOME_ATTACKER_TYPE = RES_INCOME_ATTACKER_TYPE.RES_INCOME_ATTACKER_ORGAN;
                break;
            }
            for (int i = 0; i < 4; i++)
            {
                if (incomeRule.astIncomeRule[i].bAttakerType == 1 || rES_INCOME_ATTACKER_TYPE == (RES_INCOME_ATTACKER_TYPE)incomeRule.astIncomeRule[i].bAttakerType)
                {
                    return(incomeRule.astIncomeRule[i]);
                }
            }
            return(null);
        }
示例#17
0
        private ResDT_IncomeAttackRule GetIncomeAllocRuleByAtker(ref PoolObjHandle <ActorRoot> attacker, ResIncomeAllocRule incomeRule)
        {
            if (incomeRule == null || !attacker)
            {
                return(null);
            }
            RES_INCOME_ATTACKER_TYPE rES_INCOME_ATTACKER_TYPE = 1;

            switch (attacker.get_handle().TheActorMeta.ActorType)
            {
            case ActorTypeDef.Actor_Type_Hero:
                rES_INCOME_ATTACKER_TYPE = 4;
                break;

            case ActorTypeDef.Actor_Type_Monster:
            {
                MonsterWrapper monsterWrapper = attacker.get_handle().AsMonster();
                if (monsterWrapper != null)
                {
                    RES_MONSTER_TYPE bMonsterType = monsterWrapper.cfgInfo.bMonsterType;
                    if (bMonsterType == 2)
                    {
                        rES_INCOME_ATTACKER_TYPE = 5;
                    }
                    else if (bMonsterType == 1)
                    {
                        rES_INCOME_ATTACKER_TYPE = 3;
                    }
                }
                break;
            }

            case ActorTypeDef.Actor_Type_Organ:
                rES_INCOME_ATTACKER_TYPE = 2;
                break;
            }
            for (int i = 0; i < 4; i++)
            {
                if (incomeRule.astIncomeRule[i].bAttakerType == 1 || rES_INCOME_ATTACKER_TYPE == incomeRule.astIncomeRule[i].bAttakerType)
                {
                    return(incomeRule.astIncomeRule[i]);
                }
            }
            return(null);
        }
示例#18
0
        private ResDT_IncomeAttackRule GetIncomeAllocRuleByAtker(PoolObjHandle <ActorRoot> attacker, ResIncomeAllocRule incomeRule)
        {
            if ((incomeRule != null) && (attacker != 0))
            {
                RES_INCOME_ATTACKER_TYPE res_income_attacker_type = RES_INCOME_ATTACKER_TYPE.RES_INCOME_ATTACKER_ALL;
                switch (attacker.handle.TheActorMeta.ActorType)
                {
                case ActorTypeDef.Actor_Type_Hero:
                    res_income_attacker_type = RES_INCOME_ATTACKER_TYPE.RES_INCOME_ATTACKER_HERO;
                    break;

                case ActorTypeDef.Actor_Type_Monster:
                {
                    MonsterWrapper wrapper = attacker.handle.AsMonster();
                    if (wrapper != null)
                    {
                        RES_MONSTER_TYPE bMonsterType = (RES_MONSTER_TYPE)wrapper.cfgInfo.bMonsterType;
                        if (bMonsterType != RES_MONSTER_TYPE.RES_MONSTER_TYPE_JUNGLE)
                        {
                            if (bMonsterType == RES_MONSTER_TYPE.RES_MONSTER_TYPE_SOLDIERLINE)
                            {
                                res_income_attacker_type = RES_INCOME_ATTACKER_TYPE.RES_INCOME_ATTACKER_SOLDIER;
                            }
                            break;
                        }
                        res_income_attacker_type = RES_INCOME_ATTACKER_TYPE.RES_INCOME_ATTACKER_MONSTER;
                    }
                    break;
                }

                case ActorTypeDef.Actor_Type_Organ:
                    res_income_attacker_type = RES_INCOME_ATTACKER_TYPE.RES_INCOME_ATTACKER_ORGAN;
                    break;
                }
                for (int i = 0; i < 4; i++)
                {
                    if ((incomeRule.astIncomeRule[i].bAttakerType == 1) || (res_income_attacker_type == ((RES_INCOME_ATTACKER_TYPE)incomeRule.astIncomeRule[i].bAttakerType)))
                    {
                        return(incomeRule.astIncomeRule[i]);
                    }
                }
            }
            return(null);
        }
 private bool MonsterNotInBattle(ref PoolObjHandle <ActorRoot> monster)
 {
     if (monster)
     {
         MonsterWrapper monsterWrapper = monster.handle.ActorControl as MonsterWrapper;
         if (monsterWrapper != null)
         {
             ResMonsterCfgInfo cfgInfo = monsterWrapper.cfgInfo;
             if (cfgInfo != null && cfgInfo.bMonsterType == 2)
             {
                 ObjAgent      actorAgent  = monster.handle.ActorAgent;
                 ObjBehaviMode curBehavior = actorAgent.GetCurBehavior();
                 if (curBehavior == ObjBehaviMode.State_Idle || curBehavior == ObjBehaviMode.State_Dead || curBehavior == ObjBehaviMode.State_Null)
                 {
                     return(true);
                 }
             }
         }
     }
     return(false);
 }
        private void OnMonsterDeadGold(ref GameDeadEventParam prm)
        {
            MonsterWrapper            monsterWrapper = prm.src.handle.AsMonster();
            PoolObjHandle <ActorRoot> orignalAtker   = prm.orignalAtker;

            if (monsterWrapper == null || monsterWrapper.cfgInfo == null)
            {
                return;
            }
            RES_MONSTER_TYPE bMonsterType = (RES_MONSTER_TYPE)monsterWrapper.cfgInfo.bMonsterType;

            if (bMonsterType != RES_MONSTER_TYPE.RES_MONSTER_TYPE_JUNGLE)
            {
                return;
            }
            if (!orignalAtker || orignalAtker.handle.EffectControl == null)
            {
                return;
            }
            orignalAtker.handle.EffectControl.PlayDyingGoldEffect(prm.src);
            Singleton <CSoundManager> .instance.PlayBattleSound("Glod_Get", prm.src, prm.src.handle.gameObject);
        }
        public void Init(PoolObjHandle <ActorRoot> _atker, PoolObjHandle <ActorRoot> _target)
        {
            PoolObjHandle <ActorRoot> poolObjHandle = _atker;

            if (_atker)
            {
                MonsterWrapper monsterWrapper = _atker.handle.ActorControl as MonsterWrapper;
                if (monsterWrapper != null && monsterWrapper.isCalledMonster && monsterWrapper.UseHostValueProperty)
                {
                    poolObjHandle = monsterWrapper.hostActor;
                }
                this.iActorLvl              = poolObjHandle.handle.ValueComponent.mActorValue.actorLvl;
                this.iActorATT              = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_PHYATKPT].totalValue;
                this.iActorINT              = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_MGCATKPT].totalValue;
                this.iActorMaxHp            = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_MAXHP].totalValue;
                this.iDEFStrike             = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_PHYARMORHURT].totalValue;
                this.iRESStrike             = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_MGCARMORHURT].totalValue;
                this.iDEFStrikeRate         = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_PROPERTY_PHYARMORHURT_RATE].totalValue;
                this.iRESStrikeRate         = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_PROPERTY_MGCARMORHURT_RATE].totalValue;
                this.iFinalHurt             = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_REALHURT].totalValue;
                this.iCritStrikeRate        = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_CRITRATE].totalValue;
                this.iCritStrikeValue       = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_PROPERTY_CRITICAL].totalValue;
                this.iCritStrikeEff         = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_CRITEFT].totalValue;
                this.iMagicHemophagia       = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_PROPERTY_MAGICHEM].totalValue;
                this.iPhysicsHemophagia     = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_PROPERTY_PHYSICSHEM].totalValue;
                this.iMagicHemophagiaRate   = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_MGCVAMP].totalValue;
                this.iPhysicsHemophagiaRate = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_PHYVAMP].totalValue;
                this.iHurtOutputRate        = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_PROPERTY_HURTOUTPUTRATE].totalValue;
                this.actorType              = poolObjHandle.handle.TheActorMeta.ActorType;
            }
            else if (_target)
            {
                this.iReduceCritStrikeRate  = _target.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_ANTICRIT].totalValue;
                this.iReduceCritStrikeValue = _target.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_PROPERTY_REDUCECRITICAL].totalValue;
            }
        }
示例#22
0
 public void OnActorDead(ref GameDeadEventParam prm)
 {
     if (prm.src == this.actorHero)
     {
         base.recordDead(prm.src, prm.orignalAtker);
     }
     else if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
     {
         HeroWrapper actorControl         = prm.src.handle.ActorControl as HeroWrapper;
         PoolObjHandle <ActorRoot> killer = new PoolObjHandle <ActorRoot>();
         bool flag = false;
         if ((prm.orignalAtker != 0) && (prm.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero))
         {
             flag   = true;
             killer = prm.orignalAtker;
         }
         else if (actorControl.IsKilledByHero())
         {
             flag   = true;
             killer = actorControl.LastHeroAtker;
         }
         if (flag)
         {
             if (killer == this.actorHero)
             {
                 base.m_numKill++;
             }
             else
             {
                 base.recordAssist(prm.src, prm.orignalAtker, this.actorHero, killer);
             }
         }
     }
     else if ((prm.orignalAtker != 0) && (prm.orignalAtker == this.actorHero))
     {
         if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
         {
             if (prm.src.handle.ActorControl.GetActorSubType() == 2)
             {
                 base.m_numKillMonster++;
                 MonsterWrapper wrapper2 = prm.src.handle.AsMonster();
                 if ((wrapper2 != null) && (wrapper2.cfgInfo != null))
                 {
                     if (wrapper2.cfgInfo.bSoldierType == 7)
                     {
                         base.m_numKillDragon++;
                         Singleton <EventRouter> .instance.BroadCastEvent(EventID.BATTLE_DRAGON_KILL_CHANGED);
                     }
                     else if (wrapper2.cfgInfo.bSoldierType == 9)
                     {
                         base.m_numKillDragon++;
                         Singleton <EventRouter> .instance.BroadCastEvent(EventID.BATTLE_DRAGON_KILL_CHANGED);
                     }
                     else if (wrapper2.cfgInfo.bSoldierType == 8)
                     {
                         base.m_numKillBaron++;
                         Singleton <EventRouter> .instance.BroadCastEvent(EventID.BATTLE_DRAGON_KILL_CHANGED);
                     }
                 }
             }
             else if (prm.src.handle.ActorControl.GetActorSubType() == 1)
             {
                 base.m_numKillSoldier++;
             }
             if (prm.src.handle.TheActorMeta.ConfigId != prm.src.handle.TheActorMeta.EnCId)
             {
                 base.m_numKillFakeMonster++;
             }
         }
         else if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ)
         {
             if ((prm.src.handle.TheStaticData.TheOrganOnlyInfo.OrganType == 1) || (prm.src.handle.TheStaticData.TheOrganOnlyInfo.OrganType == 4))
             {
                 base.m_numKillOrgan++;
             }
             else if (prm.src.handle.TheStaticData.TheOrganOnlyInfo.OrganType == 2)
             {
                 base.m_numDestroyBase++;
             }
         }
     }
 }
示例#23
0
 public void OnActorDamage(ref HurtEventResultInfo prm)
 {
     if (prm.src == this.actorHero)
     {
         if (prm.hurtInfo.hurtType != HurtTypeDef.Therapic)
         {
             base.m_uiBeAttackedNum++;
             base.m_hurtTakenByEnemy += prm.hurtTotal;
             if ((prm.atker != 0) && (prm.atker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero))
             {
                 base.m_hurtTakenByHero += prm.hurtTotal;
             }
             base.m_BeHurtMax = (base.m_BeHurtMax >= prm.hurtTotal) ? base.m_BeHurtMax : prm.hurtTotal;
             if (base.m_BeHurtMin == -1)
             {
                 base.m_BeHurtMin = prm.hurtTotal;
             }
             else
             {
                 base.m_BeHurtMin = (base.m_BeHurtMin <= prm.hurtTotal) ? base.m_BeHurtMin : prm.hurtTotal;
             }
         }
         else
         {
             if ((prm.atker != 0) && (prm.atker.handle.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Organ))
             {
                 base.m_uiHealNum++;
                 base.m_iBeHeal  += prm.hurtTotal;
                 base.m_BeHealMax = (base.m_BeHealMax >= prm.hurtTotal) ? base.m_BeHealMax : prm.hurtTotal;
                 if (base.m_BeHealMin == -1)
                 {
                     base.m_BeHealMin = prm.hurtTotal;
                 }
                 else
                 {
                     base.m_BeHealMin = (base.m_BeHealMin <= prm.hurtTotal) ? base.m_BeHealMin : prm.hurtTotal;
                 }
             }
             if ((prm.atker != 0) && (prm.atker == this.actorHero))
             {
                 base.m_iSelfHealNum++;
                 base.m_iSelfHealCount += prm.hurtTotal;
                 base.m_iSelfHealMax    = (base.m_iSelfHealMax >= prm.hurtTotal) ? base.m_iSelfHealMax : prm.hurtTotal;
                 if (base.m_iSelfHealMin == -1)
                 {
                     base.m_iSelfHealMin = prm.hurtTotal;
                 }
                 else
                 {
                     base.m_iSelfHealMin = (base.m_iSelfHealMin <= prm.hurtTotal) ? base.m_iSelfHealMin : prm.hurtTotal;
                 }
             }
         }
     }
     if ((prm.atker != 0) && (prm.atker == this.actorHero))
     {
         if (prm.hurtInfo.hurtType != HurtTypeDef.Therapic)
         {
             if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
             {
                 base.m_hurtToHero += prm.hurtTotal;
                 base.m_uiHurtToHeroNum++;
                 if (prm.hurtInfo.hurtType == HurtTypeDef.PhysHurt)
                 {
                     base.m_iPhysHurtToHero += prm.hurtTotal;
                 }
                 else if (prm.hurtInfo.hurtType == HurtTypeDef.MagicHurt)
                 {
                     base.m_iMagicHurtToHero += prm.hurtTotal;
                 }
                 else if (prm.hurtInfo.hurtType == HurtTypeDef.RealHurt)
                 {
                     base.m_iRealHurtToHero += prm.hurtTotal;
                 }
             }
             else if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ)
             {
                 base.m_iHurtToOrgan += prm.hurtTotal;
             }
             base.m_hurtToEnemy += prm.hurtTotal;
             base.m_uiHurtToEnemyNum++;
             if ((prm.atker.handle.SkillControl.CurUseSkill != null) && (prm.atker.handle.SkillControl.CurUseSkill.SlotType == SkillSlotType.SLOT_SKILL_0))
             {
                 base.m_Skill0HurtToEnemy += prm.hurtTotal;
             }
         }
         else
         {
             base.m_heal += prm.hurtTotal;
         }
         this.StatisticSkillInfo(prm);
         this.StatisticActorInfo(prm);
     }
     else if ((prm.atker != 0) && (prm.atker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster))
     {
         MonsterWrapper actorControl = prm.atker.handle.ActorControl as MonsterWrapper;
         if ((((actorControl != null) && (actorControl.hostActor != 0)) && ((actorControl.hostActor.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) && (actorControl.spawnSkillSlot < SkillSlotType.SLOT_SKILL_COUNT))) && (((actorControl.hostActor.handle.SkillControl != null) && (actorControl.hostActor.handle.SkillControl.stSkillStat != null)) && (actorControl.hostActor.handle.SkillControl.stSkillStat.SkillStatistictInfo != null)))
         {
             SKILLSTATISTICTINFO skillstatistictinfo1 = actorControl.hostActor.handle.SkillControl.stSkillStat.SkillStatistictInfo[(int)actorControl.spawnSkillSlot];
             skillstatistictinfo1.iHurtTotal += prm.hurtTotal;
         }
     }
 }
示例#24
0
 public void OnActorDead(ref DefaultGameEventParam prm)
 {
     if (object.ReferenceEquals(prm.src.handle, this.actorHero.handle))
     {
         base.recordDead(prm.src, prm.orignalAtker);
     }
     else if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
     {
         HeroWrapper actorControl         = prm.src.handle.ActorControl as HeroWrapper;
         PoolObjHandle <ActorRoot> killer = new PoolObjHandle <ActorRoot>();
         bool flag = false;
         if ((prm.orignalAtker != 0) && (prm.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero))
         {
             flag   = true;
             killer = prm.orignalAtker;
         }
         else if (actorControl.IsKilledByHero())
         {
             flag   = true;
             killer = actorControl.LastHeroAtker;
         }
         if (flag)
         {
             if (object.ReferenceEquals(killer.handle, this.actorHero.handle))
             {
                 base.m_numKill++;
             }
             base.recordAssist(prm.src, prm.orignalAtker, this.actorHero, killer);
         }
     }
     else if ((prm.orignalAtker != 0) && object.ReferenceEquals(prm.orignalAtker.handle, this.actorHero.handle))
     {
         if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
         {
             if (prm.src.handle.ActorControl.GetActorSubType() == 2)
             {
                 base.m_numKillMonster++;
                 MonsterWrapper wrapper2 = prm.src.handle.AsMonster();
                 if ((wrapper2 != null) && (wrapper2.cfgInfo != null))
                 {
                     if (wrapper2.cfgInfo.bSoldierType == 7)
                     {
                         base.m_numKillDragon++;
                     }
                     else if (wrapper2.cfgInfo.bSoldierType == 9)
                     {
                         base.m_numKillDragon++;
                     }
                     else if (wrapper2.cfgInfo.bSoldierType == 8)
                     {
                         base.m_numKillBaron++;
                     }
                 }
             }
             else if (prm.src.handle.ActorControl.GetActorSubType() == 1)
             {
                 base.m_numKillSoldier++;
             }
             if (prm.src.handle.TheActorMeta.ConfigId != prm.src.handle.TheActorMeta.EnCId)
             {
                 base.m_numKillFakeMonster++;
             }
         }
         else if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ)
         {
             if ((prm.src.handle.TheStaticData.TheOrganOnlyInfo.OrganType == 1) || (prm.src.handle.TheStaticData.TheOrganOnlyInfo.OrganType == 4))
             {
                 base.m_numKillOrgan++;
             }
             else if (prm.src.handle.TheStaticData.TheOrganOnlyInfo.OrganType == 2)
             {
                 base.m_numDestroyBase++;
             }
         }
     }
 }
示例#25
0
 public void OnActorDamage(ref HurtEventResultInfo prm)
 {
     if (prm.src == this.actorHero)
     {
         if (prm.hurtInfo.hurtType != HurtTypeDef.Therapic)
         {
             this.m_uiBeAttackedNum  += 1u;
             this.m_hurtTakenByEnemy += prm.hurtTotal;
             if (prm.atker && prm.atker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
             {
                 this.m_hurtTakenByHero += prm.hurtTotal;
                 if (!this.actorHero.handle.ActorAgent.IsAutoAI() && prm.hurtTotal > 0)
                 {
                     this.m_stJudgeStat.SufferHero = this.m_stJudgeStat.SufferHero + (uint)prm.hurtTotal;
                 }
             }
             this.m_BeHurtMax = ((this.m_BeHurtMax < prm.hurtTotal) ? prm.hurtTotal : this.m_BeHurtMax);
             if (this.m_BeHurtMin == -1)
             {
                 this.m_BeHurtMin = prm.hurtTotal;
             }
             else
             {
                 this.m_BeHurtMin = ((this.m_BeHurtMin > prm.hurtTotal) ? prm.hurtTotal : this.m_BeHurtMin);
             }
         }
         else
         {
             if (prm.atker && prm.atker.handle.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Organ)
             {
                 this.m_uiHealNum += 1u;
                 this.m_iBeHeal   += prm.hurtTotal;
                 this.m_BeHealMax  = ((this.m_BeHealMax < prm.hurtTotal) ? prm.hurtTotal : this.m_BeHealMax);
                 if (this.m_BeHealMin == -1)
                 {
                     this.m_BeHealMin = prm.hurtTotal;
                 }
                 else
                 {
                     this.m_BeHealMin = ((this.m_BeHealMin > prm.hurtTotal) ? prm.hurtTotal : this.m_BeHealMin);
                 }
             }
             if (prm.atker && prm.atker == this.actorHero)
             {
                 this.m_iSelfHealNum++;
                 this.m_iSelfHealCount += prm.hurtTotal;
                 this.m_iSelfHealMax    = ((this.m_iSelfHealMax < prm.hurtTotal) ? prm.hurtTotal : this.m_iSelfHealMax);
                 if (this.m_iSelfHealMin == -1)
                 {
                     this.m_iSelfHealMin = prm.hurtTotal;
                 }
                 else
                 {
                     this.m_iSelfHealMin = ((this.m_iSelfHealMin > prm.hurtTotal) ? prm.hurtTotal : this.m_iSelfHealMin);
                 }
             }
         }
     }
     if (prm.atker && prm.atker == this.actorHero)
     {
         if (prm.hurtInfo.hurtType != HurtTypeDef.Therapic)
         {
             int num = -prm.hpChanged;
             if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
             {
                 this.m_hurtToHero      += num;
                 this.m_uiHurtToHeroNum += 1u;
                 if (!this.actorHero.handle.ActorAgent.IsAutoAI() && num > 0)
                 {
                     this.m_stJudgeStat.HurtToHero = this.m_stJudgeStat.HurtToHero + (uint)num;
                 }
                 if (prm.hurtInfo.hurtType == HurtTypeDef.PhysHurt)
                 {
                     this.m_iPhysHurtToHero += num;
                 }
                 else if (prm.hurtInfo.hurtType == HurtTypeDef.MagicHurt)
                 {
                     this.m_iMagicHurtToHero += num;
                 }
                 else if (prm.hurtInfo.hurtType == HurtTypeDef.RealHurt)
                 {
                     this.m_iRealHurtToHero += num;
                 }
             }
             else if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ)
             {
                 this.m_iHurtToOrgan += num;
             }
             this.m_hurtToEnemy      += num;
             this.m_uiHurtToEnemyNum += 1u;
             if (!this.actorHero.handle.ActorAgent.IsAutoAI() && num > 0)
             {
                 this.m_stJudgeStat.HurtToAll = this.m_stJudgeStat.HurtToAll + (uint)num;
             }
             if (prm.atker.handle.SkillControl.CurUseSkill != null && prm.atker.handle.SkillControl.CurUseSkill.SlotType == SkillSlotType.SLOT_SKILL_0)
             {
                 this.m_Skill0HurtToEnemy += num;
             }
             if (prm.hurtInfo.atkSlot == SkillSlotType.SLOT_SKILL_COUNT)
             {
                 this.m_iEquipeHurtValue += (uint)num;
             }
         }
         else
         {
             this.m_heal += prm.hurtTotal;
         }
         this.StatisticSkillInfo(prm);
         this.StatisticActorInfo(prm);
     }
     else if (prm.atker && prm.atker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
     {
         MonsterWrapper monsterWrapper = prm.atker.handle.ActorControl as MonsterWrapper;
         if (monsterWrapper != null && monsterWrapper.hostActor && monsterWrapper.hostActor.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero && monsterWrapper.spawnSkillSlot < SkillSlotType.SLOT_SKILL_COUNT && monsterWrapper.hostActor.handle.SkillControl != null && monsterWrapper.hostActor.handle.SkillControl.stSkillStat != null && monsterWrapper.hostActor.handle.SkillControl.stSkillStat.SkillStatistictInfo != null)
         {
             monsterWrapper.hostActor.handle.SkillControl.stSkillStat.SkillStatistictInfo[(int)monsterWrapper.spawnSkillSlot].iHurtTotal += prm.hurtTotal;
         }
     }
 }
示例#26
0
        public static void DoSpawn(GameObject inGameObj, VInt3 bornPos, VInt3 bornDir, bool bInSeqMeta, ActorMeta[] inActorMetaList, GeoPolygon inPolygon, GameObject inDeadPoint, PursuitInfo pursuitInfo, int[] inBuffDemand, int inRandPassSkillRule, ref List <PoolObjHandle <ActorRoot> > inSpawnedList)
        {
            if (inGameObj == null || inActorMetaList == null || inActorMetaList.Length == 0 || inSpawnedList == null)
            {
                return;
            }
            List <ActorMeta> list = new List <ActorMeta>();

            if (bInSeqMeta)
            {
                list.AddRange(inActorMetaList);
            }
            else if (inActorMetaList.Length > 0)
            {
                int nMax = inActorMetaList.Length;
                int num  = (int)FrameRandom.Random((uint)nMax);
                list.Add(inActorMetaList[num]);
            }
            List <ActorMeta> .Enumerator enumerator = list.GetEnumerator();
            while (enumerator.MoveNext())
            {
                ActorMeta current = enumerator.get_Current();
                if (current.ConfigId > 0 && current.ActorType != ActorTypeDef.Invalid)
                {
                    PoolObjHandle <ActorRoot> poolObjHandle = default(PoolObjHandle <ActorRoot>);
                    if (!Singleton <GameObjMgr> .GetInstance().TryGetFromCache(ref poolObjHandle, ref current))
                    {
                        poolObjHandle = Singleton <GameObjMgr> .GetInstance().SpawnActorEx(null, ref current, bornPos, bornDir, false, true);

                        if (poolObjHandle)
                        {
                            poolObjHandle.get_handle().InitActor();
                            poolObjHandle.get_handle().PrepareFight();
                            Singleton <GameObjMgr> .get_instance().AddActor(poolObjHandle);

                            poolObjHandle.get_handle().StartFight();
                        }
                    }
                    else
                    {
                        poolObjHandle.get_handle().ReactiveActor(bornPos, bornDir);
                    }
                    if (poolObjHandle)
                    {
                        poolObjHandle.get_handle().ObjLinker.Invincible = current.Invincible;
                        poolObjHandle.get_handle().ObjLinker.CanMovable = !current.NotMovable;
                        poolObjHandle.get_handle().BornPos = bornPos;
                        if (inPolygon != null && inDeadPoint != null)
                        {
                            poolObjHandle.get_handle().ActorControl.m_rangePolygon = inPolygon;
                            poolObjHandle.get_handle().ActorControl.m_deadPointGo = inDeadPoint;
                        }
                        if (pursuitInfo != null && pursuitInfo.IsVaild())
                        {
                            MonsterWrapper monsterWrapper = poolObjHandle.get_handle().ActorControl as MonsterWrapper;
                            if (monsterWrapper != null)
                            {
                                monsterWrapper.Pursuit = pursuitInfo;
                            }
                        }
                        inSpawnedList.Add(poolObjHandle);
                        if (inBuffDemand != null)
                        {
                            for (int i = 0; i < inBuffDemand.Length; i++)
                            {
                                int         inBuffID    = inBuffDemand[i];
                                BufConsumer bufConsumer = new BufConsumer(inBuffID, poolObjHandle, poolObjHandle);
                                bufConsumer.Use();
                            }
                        }
                        if (inRandPassSkillRule > 0 && poolObjHandle.get_handle().SkillControl != null)
                        {
                            poolObjHandle.get_handle().SkillControl.InitRandomSkill(inRandPassSkillRule);
                        }
                    }
                }
            }
        }
        private void OnActorDeadIncomeGoldCoinInBattle(ref PoolObjHandle <ActorRoot> target, ref PoolObjHandle <ActorRoot> attacker)
        {
            if (!target || !attacker)
            {
                return;
            }
            if (ActorHelper.IsHostCtrlActor(ref attacker) && (target.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster || target.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero))
            {
                if (attacker.handle.EffectControl != null)
                {
                    attacker.handle.EffectControl.PlayDyingGoldEffect(target);
                }
                Singleton <CSoundManager> .GetInstance().PlayBattleSound("Glod_Get", target, target.handle.gameObject);
            }
            ResIncomeAllocRule resIncomeAllocRule = null;

            switch (target.handle.TheActorMeta.ActorType)
            {
            case ActorTypeDef.Actor_Type_Hero:
                resIncomeAllocRule = this.m_incomeAllocRules[2][3];
                break;

            case ActorTypeDef.Actor_Type_Monster:
            {
                MonsterWrapper monsterWrapper = target.handle.AsMonster();
                if (monsterWrapper != null)
                {
                    RES_MONSTER_TYPE bMonsterType = (RES_MONSTER_TYPE)monsterWrapper.cfgInfo.bMonsterType;
                    if (bMonsterType == RES_MONSTER_TYPE.RES_MONSTER_TYPE_JUNGLE)
                    {
                        byte actorSubSoliderType = monsterWrapper.GetActorSubSoliderType();
                        if (actorSubSoliderType == 7 || actorSubSoliderType == 8 || actorSubSoliderType == 9)
                        {
                            resIncomeAllocRule = this.m_incomeAllocRules[2][5];
                        }
                        else if (actorSubSoliderType == 15)
                        {
                            resIncomeAllocRule = this.m_incomeAllocRules[2][7];
                        }
                        else
                        {
                            resIncomeAllocRule = this.m_incomeAllocRules[2][4];
                        }
                    }
                    else if (bMonsterType == RES_MONSTER_TYPE.RES_MONSTER_TYPE_SOLDIERLINE)
                    {
                        resIncomeAllocRule = this.m_incomeAllocRules[2][2];
                    }
                }
                break;
            }

            case ActorTypeDef.Actor_Type_Organ:
                resIncomeAllocRule = this.m_incomeAllocRules[2][1];
                break;

            case ActorTypeDef.Actor_Type_EYE:
                resIncomeAllocRule = this.m_incomeAllocRules[2][6];
                break;
            }
            if (resIncomeAllocRule != null)
            {
                ResDT_IncomeAttackRule incomeAllocRuleByAtker = this.GetIncomeAllocRuleByAtker(ref attacker, resIncomeAllocRule);
                if (incomeAllocRuleByAtker != null)
                {
                    this.AllocIncome(ref target, ref attacker, incomeAllocRuleByAtker, enIncomeType.GoldCoinInBattle, resIncomeAllocRule.IncomeChangeRate, resIncomeAllocRule.iComputerChangeRate);
                }
            }
        }
        private bool CheckTargetFromEnemy(PoolObjHandle <ActorRoot> src, PoolObjHandle <ActorRoot> target)
        {
            bool result = false;

            if (!src || !target)
            {
                return(result);
            }
            if (src.get_handle().TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero)
            {
                return(result);
            }
            if (target.get_handle().TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Monster)
            {
                return(src.get_handle().TheActorMeta.ActorCamp != target.get_handle().TheActorMeta.ActorCamp);
            }
            MonsterWrapper monsterWrapper = target.get_handle().AsMonster();

            if (monsterWrapper != null)
            {
                RES_MONSTER_TYPE bMonsterType = monsterWrapper.cfgInfo.bMonsterType;
                if (bMonsterType == 1)
                {
                    if (src.get_handle().TheActorMeta.ActorCamp != target.get_handle().TheActorMeta.ActorCamp)
                    {
                        result = true;
                    }
                }
                else if (bMonsterType == 2)
                {
                    byte actorSubSoliderType = monsterWrapper.GetActorSubSoliderType();
                    if (actorSubSoliderType != 8 && actorSubSoliderType != 9 && actorSubSoliderType != 7 && actorSubSoliderType != 14)
                    {
                        long  num     = 0L;
                        long  num2    = 0L;
                        VInt3 bornPos = target.get_handle().BornPos;
                        List <PoolObjHandle <ActorRoot> > organActors = Singleton <GameObjMgr> .get_instance().OrganActors;

                        int num3 = 0;
                        for (int i = 0; i < organActors.get_Count(); i++)
                        {
                            PoolObjHandle <ActorRoot> poolObjHandle = organActors.get_Item(i);
                            if (poolObjHandle.get_handle().TheStaticData.TheOrganOnlyInfo.OrganType == 2)
                            {
                                VInt3 location = poolObjHandle.get_handle().location;
                                if (poolObjHandle.get_handle().TheActorMeta.ActorCamp == src.get_handle().TheActorMeta.ActorCamp)
                                {
                                    num = (bornPos - location).get_sqrMagnitudeLong2D();
                                }
                                else
                                {
                                    num2 = (bornPos - location).get_sqrMagnitudeLong2D();
                                }
                                num3++;
                                if (num3 >= 2)
                                {
                                    break;
                                }
                            }
                        }
                        if (num > num2)
                        {
                            result = true;
                        }
                    }
                }
            }
            return(result);
        }
        private void AddDamageValue(ref HurtEventResultInfo prm)
        {
            PoolObjHandle <ActorRoot> atker   = prm.atker;
            SkillSlotType             atkSlot = prm.hurtInfo.atkSlot;
            int                 hurtTotal     = prm.hurtTotal;
            HurtTypeDef         hurtType      = prm.hurtInfo.hurtType;
            SKILL_USE_FROM_TYPE skillUseFrom  = prm.hurtInfo.SkillUseFrom;

            if (this.m_listDamageActorValue != null && atkSlot <= SkillSlotType.SLOT_SKILL_VALID && atker)
            {
                uint objID = atker.handle.ObjID;
                this.DeleteTimeoutDamageValue(objID, 0uL);
                DAMAGE_ACTOR_INFO dAMAGE_ACTOR_INFO;
                if (!this.m_listDamageActorValue.TryGetValue(objID, ref dAMAGE_ACTOR_INFO))
                {
                    dAMAGE_ACTOR_INFO           = default(DAMAGE_ACTOR_INFO);
                    dAMAGE_ACTOR_INFO.actorType = atker.handle.TheActorMeta.ActorType;
                    dAMAGE_ACTOR_INFO.actorName = atker.handle.name;
                    dAMAGE_ACTOR_INFO.ConfigId  = atker.handle.TheActorMeta.ConfigId;
                    if (dAMAGE_ACTOR_INFO.actorType == ActorTypeDef.Actor_Type_Monster)
                    {
                        MonsterWrapper monsterWrapper = atker.handle.AsMonster();
                        dAMAGE_ACTOR_INFO.bMonsterType = monsterWrapper.GetActorSubType();
                        dAMAGE_ACTOR_INFO.actorSubType = monsterWrapper.GetActorSubSoliderType();
                    }
                    Player player = Singleton <GamePlayerCenter> .instance.GetPlayer(atker.handle.TheActorMeta.PlayerId);

                    if (player != null)
                    {
                        dAMAGE_ACTOR_INFO.playerName = player.Name;
                    }
                    dAMAGE_ACTOR_INFO.listDamage = new SortedList <ulong, SKILL_SLOT_HURT_INFO[]>();
                    this.m_listDamageActorValue.Add(objID, dAMAGE_ACTOR_INFO);
                }
                ulong logicFrameTick = Singleton <FrameSynchr> .instance.LogicFrameTick;
                SKILL_SLOT_HURT_INFO[] array;
                if (!dAMAGE_ACTOR_INFO.listDamage.TryGetValue(logicFrameTick, ref array))
                {
                    array = new SKILL_SLOT_HURT_INFO[12];
                    dAMAGE_ACTOR_INFO.listDamage.Add(logicFrameTick, array);
                }
                if (array[(int)atkSlot].listHurtInfo == null)
                {
                    array[(int)atkSlot].listHurtInfo = new List <HURT_INFO>();
                }
                if (array[(int)atkSlot].listHurtInfo != null)
                {
                    string text    = null;
                    string strName = null;
                    if (skillUseFrom == SKILL_USE_FROM_TYPE.SKILL_USE_FROM_TYPE_SKILL)
                    {
                        SkillSlot skillSlot;
                        if (atkSlot < SkillSlotType.SLOT_SKILL_COUNT && atker.handle.SkillControl != null && (atker.handle.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero || atkSlot != SkillSlotType.SLOT_SKILL_0) && atker.handle.SkillControl.TryGetSkillSlot(atkSlot, out skillSlot) && skillSlot.SkillObj != null && skillSlot.SkillObj.cfgData != null)
                        {
                            if (!string.IsNullOrEmpty(skillSlot.SkillObj.IconName))
                            {
                                text = skillSlot.SkillObj.IconName;
                            }
                            if (!string.IsNullOrEmpty(skillSlot.SkillObj.cfgData.szSkillName))
                            {
                                strName = skillSlot.SkillObj.cfgData.szSkillName;
                            }
                        }
                    }
                    else if (skillUseFrom == SKILL_USE_FROM_TYPE.SKILL_USE_FROM_TYPE_EQUIP)
                    {
                        uint             uiFromId  = prm.hurtInfo.uiFromId;
                        ResEquipInBattle dataByKey = GameDataMgr.m_equipInBattleDatabin.GetDataByKey(uiFromId);
                        if (dataByKey != null)
                        {
                            text    = dataByKey.szIcon;
                            strName = dataByKey.szName;
                        }
                    }
                    else if (skillUseFrom == SKILL_USE_FROM_TYPE.SKILL_USE_FROM_TYPE_AREATRIGGER)
                    {
                        uint uiFromId2 = prm.hurtInfo.uiFromId;
                        ResSkillCombineCfgInfo dataByKey2 = GameDataMgr.skillCombineDatabin.GetDataByKey(uiFromId2);
                        if (dataByKey2 != null)
                        {
                            text    = dataByKey2.szIconPath;
                            strName = dataByKey2.szSkillCombineName;
                        }
                    }
                    int count = array[(int)atkSlot].listHurtInfo.get_Count();
                    int i;
                    for (i = 0; i < count; i++)
                    {
                        if (array[(int)atkSlot].listHurtInfo.get_Item(i).strIconName == text)
                        {
                            HURT_INFO hURT_INFO;
                            array[(int)atkSlot].listHurtInfo.get_Item(i).iValue = hURT_INFO.iValue + hurtTotal;
                            break;
                        }
                    }
                    if (i >= count)
                    {
                        HURT_INFO hURT_INFO2 = new HURT_INFO(hurtType, text, strName, hurtTotal, skillUseFrom);
                        array[(int)atkSlot].listHurtInfo.Add(hURT_INFO2);
                    }
                }
                dAMAGE_ACTOR_INFO.listDamage.set_Item(logicFrameTick, array);
                this.m_listDamageActorValue.set_Item(objID, dAMAGE_ACTOR_INFO);
            }
        }
示例#30
0
 public void OnActorDead(ref GameDeadEventParam prm)
 {
     if (prm.src == this.actorHero)
     {
         base.recordDead(prm.src, prm.orignalAtker);
     }
     else if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
     {
         HeroWrapper heroWrapper = prm.src.handle.ActorControl as HeroWrapper;
         PoolObjHandle <ActorRoot> poolObjHandle = default(PoolObjHandle <ActorRoot>);
         bool flag = false;
         if (prm.orignalAtker && prm.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
         {
             flag          = true;
             poolObjHandle = prm.orignalAtker;
         }
         else if (heroWrapper.IsKilledByHero())
         {
             flag          = true;
             poolObjHandle = heroWrapper.LastHeroAtker;
         }
         if (flag)
         {
             if (poolObjHandle == this.actorHero)
             {
                 this.m_numKill++;
                 if (!this.actorHero.handle.ActorAgent.IsAutoAI())
                 {
                     this.m_stJudgeStat.KillNum = this.m_stJudgeStat.KillNum + 1;
                 }
                 if (this.actorHero.handle.ValueComponent.actorHp * 100 / this.actorHero.handle.ValueComponent.actorHpTotal <= 10)
                 {
                     this.m_iKillHeroUnderTenPercent += 1u;
                 }
             }
             else
             {
                 base.recordAssist(prm.src, prm.orignalAtker, this.actorHero, poolObjHandle);
             }
         }
     }
     else if (prm.orignalAtker && prm.orignalAtker == this.actorHero)
     {
         if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
         {
             if (prm.src.handle.ActorControl.GetActorSubType() == 2)
             {
                 this.m_numKillMonster++;
                 MonsterWrapper monsterWrapper = prm.src.handle.AsMonster();
                 if (monsterWrapper != null && monsterWrapper.cfgInfo != null)
                 {
                     if (monsterWrapper.cfgInfo.bSoldierType == 7)
                     {
                         this.m_numKillDragon++;
                         Singleton <EventRouter> .instance.BroadCastEvent(EventID.BATTLE_DRAGON_KILL_CHANGED);
                     }
                     else if (monsterWrapper.cfgInfo.bSoldierType == 9)
                     {
                         this.m_numKillDragon++;
                         Singleton <EventRouter> .instance.BroadCastEvent(EventID.BATTLE_DRAGON_KILL_CHANGED);
                     }
                     else if (monsterWrapper.cfgInfo.bSoldierType == 8)
                     {
                         this.m_numKillBaron++;
                         Singleton <EventRouter> .instance.BroadCastEvent(EventID.BATTLE_DRAGON_KILL_CHANGED);
                     }
                     else if (monsterWrapper.cfgInfo.bSoldierType == 10)
                     {
                         this.m_numKillBlueBa++;
                     }
                     else if (monsterWrapper.cfgInfo.bSoldierType == 11)
                     {
                         this.m_numKillRedBa++;
                     }
                 }
             }
             else if (prm.src.handle.ActorControl.GetActorSubType() == 1)
             {
                 this.m_numKillSoldier++;
             }
             if (prm.src.handle.TheActorMeta.ConfigId != prm.src.handle.TheActorMeta.EnCId)
             {
                 this.m_numKillFakeMonster++;
             }
         }
         else if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ)
         {
             if (prm.src.handle.TheStaticData.TheOrganOnlyInfo.OrganType == 1 || prm.src.handle.TheStaticData.TheOrganOnlyInfo.OrganType == 4)
             {
                 this.m_numKillOrgan++;
             }
             else if (prm.src.handle.TheStaticData.TheOrganOnlyInfo.OrganType == 2)
             {
                 this.m_numDestroyBase++;
             }
         }
         else if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_EYE)
         {
             EyeWrapper eyeWrapper = prm.src.handle.ActorControl as EyeWrapper;
             if (eyeWrapper != null && !eyeWrapper.bLifeTimeOver)
             {
                 this.scanEyeCnt += 1u;
             }
         }
     }
 }