Beispiel #1
0
 public void KillSoldiers()
 {
     List <PoolObjHandle <ActorRoot> > .Enumerator enumerator = this.SoldierActors.GetEnumerator();
     while (enumerator.MoveNext())
     {
         if (enumerator.get_Current())
         {
             PoolObjHandle <ActorRoot> current = enumerator.get_Current();
             current.get_handle().ValueComponent.actorHp = 0;
         }
     }
 }
Beispiel #2
0
 public override void OnActionStoped(ref PoolObjHandle <Action> action)
 {
     action.get_handle().onActionStop -= new ActionStopDelegate(this.OnActionStoped);
     if (!this.curAction)
     {
         return;
     }
     if (action == this.curAction)
     {
         this.curAction.Release();
     }
 }
        private bool OnChangeExtraEffectSkillSlot(PoolObjHandle <ActorRoot> _attack, SkillSlotType _slotType, out SkillSlotType _outSlotType)
        {
            ResDT_SkillFunc skillFunc = null;

            _outSlotType = _slotType;
            for (int i = 0; i < _attack.get_handle().BuffHolderComp.SpawnedBuffList.get_Count(); i++)
            {
                BuffSkill buffSkill = _attack.get_handle().BuffHolderComp.SpawnedBuffList.get_Item(i);
                if (buffSkill != null && buffSkill.FindSkillFunc(78, out skillFunc))
                {
                    int skillFuncParam  = buffSkill.GetSkillFuncParam(skillFunc, 0, false);
                    int skillFuncParam2 = buffSkill.GetSkillFuncParam(skillFunc, 1, false);
                    if (_slotType == (SkillSlotType)skillFuncParam)
                    {
                        _outSlotType = (SkillSlotType)skillFuncParam2;
                        return(true);
                    }
                }
            }
            return(false);
        }
 private bool MonsterNotInBattle(ref PoolObjHandle <ActorRoot> monster)
 {
     if (monster)
     {
         MonsterWrapper monsterWrapper = monster.get_handle().ActorControl as MonsterWrapper;
         if (monsterWrapper != null)
         {
             ResMonsterCfgInfo cfgInfo = monsterWrapper.cfgInfo;
             if (cfgInfo != null && cfgInfo.bMonsterType == 2)
             {
                 ObjAgent      actorAgent  = monster.get_handle().ActorAgent;
                 ObjBehaviMode curBehavior = actorAgent.GetCurBehavior();
                 if (curBehavior == ObjBehaviMode.State_Idle || curBehavior == ObjBehaviMode.State_Dead || curBehavior == ObjBehaviMode.State_Null)
                 {
                     return(true);
                 }
             }
         }
     }
     return(false);
 }
        protected bool TargetType(uint selectID, ActorTypeDef ActorType)
        {
            bool result = false;

            if (selectID > 0u)
            {
                PoolObjHandle <ActorRoot> actor = Singleton <GameObjMgr> .GetInstance().GetActor(selectID);

                result = (actor && actor.get_handle().TheActorMeta.ActorType == ActorType);
            }
            return(result);
        }
Beispiel #6
0
        private void RefreshHeroIconImageColor(CUIListElementScript elementScript, PoolObjHandle <ActorRoot> actor)
        {
            if (null == elementScript || !actor)
            {
                return;
            }
            GameObject widget = elementScript.GetWidget(0);

            if (widget != null)
            {
                Image component = widget.GetComponent <Image>();
                if (actor.get_handle().IsHostCamp())
                {
                    component.color = ((!actor.get_handle().ActorControl.IsDeadState) ? CUIUtility.s_Color_White : CUIUtility.s_Color_GrayShader);
                }
                else
                {
                    component.color = CUIUtility.s_Color_GrayShader;
                }
            }
        }
Beispiel #7
0
 public virtual void OnActionStoped(ref PoolObjHandle <Action> action)
 {
     action.get_handle().onActionStop -= this.OnActionStopDelegate;
     if (!this.curAction)
     {
         return;
     }
     if (action == this.curAction)
     {
         this.curAction.Release();
     }
 }
Beispiel #8
0
 public PoolObjHandle <ActorRoot> GetActor(uint ObjID)
 {
     for (int i = 0; i < this.GameActors.get_Count(); i++)
     {
         PoolObjHandle <ActorRoot> result = this.GameActors.get_Item(i);
         if (result.get_handle().ObjID == ObjID)
         {
             return(result);
         }
     }
     return(default(PoolObjHandle <ActorRoot>));
 }
        public static bool OnSkillFuncInvisible(ref SSkillFuncContext inContext)
        {
            PoolObjHandle <ActorRoot> inTargetObj = inContext.inTargetObj;

            if (inTargetObj)
            {
                if (inContext.inStage == ESkillFuncStage.Enter)
                {
                    inTargetObj.get_handle().HorizonMarker.AddHideMark(3, HorizonConfig.HideMark.Skill, 1, false);
                    inTargetObj.get_handle().HorizonMarker.SetTranslucentMark(HorizonConfig.HideMark.Skill, true, false);
                }
                else if (inContext.inStage == ESkillFuncStage.Leave)
                {
                    COM_PLAYERCAMP[] othersCmp = BattleLogic.GetOthersCmp(inTargetObj.get_handle().TheActorMeta.ActorCamp);
                    for (int i = 0; i < othersCmp.Length; i++)
                    {
                        if (inTargetObj.get_handle().HorizonMarker.HasHideMark(othersCmp[i], HorizonConfig.HideMark.Skill))
                        {
                            inTargetObj.get_handle().HorizonMarker.AddHideMark(othersCmp[i], HorizonConfig.HideMark.Skill, -1, false);
                        }
                    }
                    inTargetObj.get_handle().HorizonMarker.SetTranslucentMark(HorizonConfig.HideMark.Skill, false, false);
                }
            }
            return(true);
        }
    public static void ProcessCheat(byte InCheatType, ref PoolObjHandle <ActorRoot> Actor)
    {
        if (Actor)
        {
            switch (InCheatType)
            {
            case 0:
                if (Actor.get_handle().ValueComponent != null)
                {
                    Actor.get_handle().ValueComponent.ForceSoulLevelUp();
                }
                break;

            case 1:
                if (Actor.get_handle().ValueComponent != null)
                {
                    Actor.get_handle().ValueComponent.ForceSetSoulLevel(1);
                }
                break;

            case 2:
                if (Actor.get_handle().SkillControl != null)
                {
                    Actor.get_handle().SkillControl.ToggleZeroCd();
                }
                break;
            }
        }
    }
Beispiel #11
0
        protected bool IsValidTargetID(uint selectID)
        {
            bool flag = false;

            if (selectID <= 0u)
            {
                return(flag);
            }
            PoolObjHandle <ActorRoot> actor = Singleton <GameObjMgr> .GetInstance().GetActor(selectID);

            flag = (actor && !actor.get_handle().ObjLinker.Invincible&& !actor.get_handle().ActorControl.IsDeadState&& !this.actor.IsSelfCamp(actor) && actor.get_handle().HorizonMarker.IsVisibleFor(this.actor.TheActorMeta.ActorCamp) && actor.get_handle().AttackOrderReady);
            if (!flag)
            {
                return(flag);
            }
            Skill nextSkill = this.actor.ActorControl.GetNextSkill(SkillSlotType.SLOT_SKILL_0);

            if (nextSkill != null)
            {
                long num = (long)nextSkill.GetMaxSearchDistance(0);
                if (!actor || actor.get_handle().shape == null || actor.get_handle().ActorAgent == null || nextSkill.cfgData == null)
                {
                    return(false);
                }
                num += (long)actor.get_handle().shape.AvgCollisionRadius;
                num *= num;
                if ((this.actor.ActorControl.actorLocation - actor.get_handle().location).get_sqrMagnitudeLong2D() > num)
                {
                    return(false);
                }
            }
            return(flag);
        }
        public List <PoolObjHandle <ActorRoot> > GetCollidedActorList(Action _action, PoolObjHandle <ActorRoot> InActor, PoolObjHandle <ActorRoot> triggerActor)
        {
            VCollisionShape vCollisionShape = null;

            if (triggerActor)
            {
                vCollisionShape = triggerActor.get_handle().shape;
            }
            this.triggerHeroList.Clear();
            this.triggerMonsterList.Clear();
            this.triggerOrganList.Clear();
            this.triggerEyeList.Clear();
            this.triggerPriority.Clear();
            this.collidedActors.Clear();
            if (vCollisionShape == null && this.bUseTriggerObj)
            {
                return(null);
            }
            if (this.bUseTriggerObj)
            {
                this._coordInActor = InActor;
                this._coordShape   = vCollisionShape;
                SceneManagement instance = Singleton <SceneManagement> .GetInstance();

                SceneManagement.Coordinate coord = default(SceneManagement.Coordinate);
                instance.GetCoord(ref coord, vCollisionShape);
                instance.UpdateDirtyNodes();
                instance.ForeachActors(coord, this._coordHandler);
                this._coordInActor.Release();
                this._coordShape = null;
            }
            else
            {
                List <PoolObjHandle <ActorRoot> > gameActors = Singleton <GameObjMgr> .get_instance().GameActors;

                int count = gameActors.get_Count();
                for (int i = 0; i < count; i++)
                {
                    PoolObjHandle <ActorRoot> poolObjHandle = gameActors.get_Item(i);
                    if (poolObjHandle)
                    {
                        ActorRoot handle = poolObjHandle.get_handle();
                        if (!this.TargetObjTypeFilter(ref InActor, handle) && !this.TargetCollideTimeFiler(handle) && !this.TargetCollideCountFilter(handle) && !this.TargetMoveDirectionFilter(ref InActor, ref poolObjHandle))
                        {
                            this.collidedActors.Add(poolObjHandle);
                            this.type_actorList[(int)handle.TheActorMeta.ActorType].Add(poolObjHandle);
                        }
                    }
                }
            }
            return(this.collidedActors);
        }
Beispiel #13
0
        private COM_PLAYERCAMP SelectCamp(ref PoolObjHandle <ActorRoot> InActor)
        {
            if (this.CampType == ECampType.ECampType_Self)
            {
                return(InActor.get_handle().TheActorMeta.ActorCamp);
            }
            if (this.CampType != ECampType.ECampType_Hostility)
            {
                return(0);
            }
            COM_PLAYERCAMP actorCamp = InActor.get_handle().TheActorMeta.ActorCamp;

            if (actorCamp == 1)
            {
                return(2);
            }
            if (actorCamp == 2)
            {
                return(1);
            }
            return(0);
        }
        private void OnActorVisibleToHostPlayerChance(uint uiObjId, bool bVisible)
        {
            if (!GameSettings.ShowEnemyHeroHeadBtnMode)
            {
                return;
            }
            PoolObjHandle <ActorRoot> actor = Singleton <GameObjMgr> .get_instance().GetActor(uiObjId);

            if (actor && actor.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero && this.m_hostActor && this.m_hostActor.get_handle().TheActorMeta.ActorCamp != actor.get_handle().TheActorMeta.ActorCamp)
            {
                this.UpdateHeroAtkBtnWithVisible(actor, bVisible);
            }
        }
Beispiel #15
0
        private void SetSkillSpeed(PoolObjHandle <ActorRoot> user)
        {
            int num = 0;

            if (this.curAction)
            {
                ValueDataInfo valueDataInfo = user.get_handle().ValueComponent.mActorValue[28];
                int           totalValue    = valueDataInfo.totalValue;
                int           num2          = totalValue + user.get_handle().ValueComponent.mActorValue.actorLvl *(int)this.battleParam.dwM_AttackSpeed + (int)this.battleParam.dwN_AttackSpeed;
                if (num2 != 0)
                {
                    num = totalValue * 10000 / num2;
                }
                num += user.get_handle().ValueComponent.mActorValue[18].totalValue;
                if (this.cfgData != null && this.cfgData.bNoInfluenceAnim == 1)
                {
                    num = 0;
                }
                VFactor playSpeed = new VFactor((long)(10000 + num), 10000L);
                this.curAction.get_handle().SetPlaySpeed(playSpeed);
            }
        }
Beispiel #16
0
        private void RefreshHeroReviveCntDown(CUIListElementScript elementScript, PoolObjHandle <ActorRoot> actor)
        {
            if (null == elementScript || !actor)
            {
                return;
            }
            GameObject widget = elementScript.GetWidget(5);

            if (widget != null && actor.get_handle().ActorControl.IsDeadState)
            {
                widget.GetComponent <Text>().text = SimpleNumericString.GetNumeric(Mathf.RoundToInt((float)actor.get_handle().ActorControl.ReviveCooldown * 0.001f));
            }
        }
Beispiel #17
0
        private void OnActorDead(ref GameDeadEventParam prm)
        {
            PoolObjHandle <ActorRoot> src          = prm.src;
            PoolObjHandle <ActorRoot> orignalAtker = prm.orignalAtker;

            if (src && orignalAtker && src.get_handle().TheActorMeta.ConfigId == Singleton <BattleLogic> .get_instance().DragonId&& src.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
            {
                if (orignalAtker.get_handle().TheActorMeta.ActorCamp == 1)
                {
                    byte[] expr_7E_cp_0 = this.m_dragonBuffCount;
                    int    expr_7E_cp_1 = 0;
                    expr_7E_cp_0[expr_7E_cp_1] += 1;
                }
                else if (orignalAtker.get_handle().TheActorMeta.ActorCamp == 2)
                {
                    byte[] expr_AC_cp_0 = this.m_dragonBuffCount;
                    int    expr_AC_cp_1 = 1;
                    expr_AC_cp_0[expr_AC_cp_1] += 1;
                }
            }
            this.Draw();
        }
        public uint AdvanceCommonAttackSearchEnemy(PoolObjHandle <ActorRoot> InActor, int srchR)
        {
            uint      result      = 0u;
            SkillSlot skillSlot   = null;
            bool      flag        = false;
            Player    ownerPlayer = ActorHelper.GetOwnerPlayer(ref InActor);

            if (InActor.get_handle().SkillControl.TryGetSkillSlot(SkillSlotType.SLOT_SKILL_0, out skillSlot) && skillSlot.skillIndicator != null)
            {
                flag = skillSlot.skillIndicator.GetUseAdvanceMode();
            }
            if (flag)
            {
                if (skillSlot != null || skillSlot.skillIndicator != null)
                {
                    ActorRoot useSkillTargetDefaultAttackMode = skillSlot.skillIndicator.GetUseSkillTargetDefaultAttackMode();
                    if (useSkillTargetDefaultAttackMode != null)
                    {
                        result = useSkillTargetDefaultAttackMode.ObjID;
                    }
                }
                return(result);
            }
            SelectEnemyType selectEnemyType;

            if (ownerPlayer == null)
            {
                selectEnemyType = SelectEnemyType.SelectLowHp;
            }
            else
            {
                selectEnemyType = ownerPlayer.AttackTargetMode;
            }
            if (selectEnemyType == SelectEnemyType.SelectLowHp)
            {
                return(this.CommonAttackSearchLowestHpTarget(InActor.get_handle().ActorControl, srchR));
            }
            return(this.CommonAttackSearchNearestTarget(InActor.get_handle().ActorControl, srchR));
        }
 public static bool OnSkillFuncClearSkillEffect(ref SSkillFuncContext inContext)
 {
     if (inContext.inStage == ESkillFuncStage.Enter)
     {
         PoolObjHandle <ActorRoot> inTargetObj = inContext.inTargetObj;
         if (inTargetObj)
         {
             int skillFuncParam = inContext.GetSkillFuncParam(0, false);
             inTargetObj.get_handle().BuffHolderComp.ClearEffectTypeBuff(skillFuncParam);
         }
     }
     return(true);
 }
 public static bool OnSkillFuncAddExp(ref SSkillFuncContext inContext)
 {
     if (inContext.inStage != ESkillFuncStage.Leave)
     {
         PoolObjHandle <ActorRoot> inTargetObj = inContext.inTargetObj;
         if (inTargetObj)
         {
             int skillFuncParam = inContext.GetSkillFuncParam(0, false);
             inTargetObj.get_handle().ValueComponent.AddSoulExp(skillFuncParam, true, AddSoulType.SkillFunc);
         }
     }
     return(true);
 }
Beispiel #21
0
        private void OnMonsterDeadGold(ref GameDeadEventParam prm)
        {
            MonsterWrapper            monsterWrapper = prm.src.get_handle().AsMonster();
            PoolObjHandle <ActorRoot> orignalAtker   = prm.orignalAtker;

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

            if (bMonsterType != 2)
            {
                return;
            }
            if (!orignalAtker || orignalAtker.get_handle().EffectControl == null)
            {
                return;
            }
            orignalAtker.get_handle().EffectControl.PlayDyingGoldEffect(prm.src);
            Singleton <CSoundManager> .get_instance().PlayBattleSound("Glod_Get", prm.src, prm.src.get_handle().gameObject);
        }
        public bool CalcAttackerDir(out VInt3 dir, PoolObjHandle <ActorRoot> attacker)
        {
            if (!attacker)
            {
                dir = VInt3.forward;
                return(false);
            }
            dir = attacker.get_handle().forward;
            switch (this.AppointType)
            {
            case 0:
            case 1:
                if (!this.TargetActor)
                {
                    return(false);
                }
                dir   = this.TargetActor.get_handle().location;
                dir  -= attacker.get_handle().location;
                dir.y = 0;
                break;

            case 2:
                dir   = this.UseVector;
                dir  -= attacker.get_handle().location;
                dir.y = 0;
                break;

            case 3:
                dir   = this.UseVector;
                dir.y = 0;
                break;

            case 4:
                dir   = (this.EndVector + this.UseVector).DivBy2() - attacker.get_handle().location;
                dir.y = 0;
                break;
            }
            return(true);
        }
Beispiel #23
0
        private void InitHeroItemData(CUIListElementScript elementScript, PoolObjHandle <ActorRoot> actor)
        {
            if (null == elementScript || !actor || actor.get_handle().ValueComponent == null)
            {
                return;
            }
            bool flag = actor.get_handle().IsHostCamp();

            elementScript.gameObject.CustomSetActive(flag || actor.get_handle().ActorControl.IsDeadState);
            this.RefreshHeroIconImage(elementScript, actor);
            this.RefreshHeroIconImageColor(elementScript, actor);
            GameObject widget  = elementScript.GetWidget(3);
            GameObject widget2 = elementScript.GetWidget(4);

            if (widget != null && widget2 != null)
            {
                widget.CustomSetActive(flag);
                widget2.CustomSetActive(flag);
                if (flag)
                {
                    widget.GetComponent <Image>().fillAmount = actor.get_handle().ValueComponent.GetHpRate().get_single();
                }
            }
            GameObject widget3 = elementScript.GetWidget(5);

            if (widget3 != null)
            {
                if (actor.get_handle().ActorControl.IsDeadState)
                {
                    widget3.CustomSetActive(true);
                    widget3.GetComponent <Text>().text = string.Format("{0}", Mathf.RoundToInt((float)actor.get_handle().ActorControl.ReviveCooldown * 0.001f));
                }
                else
                {
                    widget3.CustomSetActive(false);
                }
            }
        }
        public static bool OnSkillFuncSkillChangeParam(ref SSkillFuncContext inContext)
        {
            PoolObjHandle <ActorRoot> inTargetObj = inContext.inTargetObj;

            if (inTargetObj)
            {
                if (inContext.inStage == ESkillFuncStage.Enter)
                {
                    int skillFuncParam  = inContext.GetSkillFuncParam(0, false);
                    int skillFuncParam2 = inContext.GetSkillFuncParam(1, false);
                    int skillFuncParam3 = inContext.GetSkillFuncParam(2, false);
                    inTargetObj.get_handle().SkillControl.ChangePassiveParam(skillFuncParam, skillFuncParam2, skillFuncParam3);
                }
                else if (inContext.inStage == ESkillFuncStage.Leave)
                {
                    int skillFuncParam4 = inContext.GetSkillFuncParam(0, false);
                    int skillFuncParam5 = inContext.GetSkillFuncParam(1, false);
                    int skillFuncParam6 = inContext.GetSkillFuncParam(3, false);
                    inTargetObj.get_handle().SkillControl.ChangePassiveParam(skillFuncParam4, skillFuncParam5, skillFuncParam6);
                }
            }
            return(true);
        }
        private bool FilterCoordActor(ref PoolObjHandle <ActorRoot> actorPtr)
        {
            ActorRoot handle = actorPtr.get_handle();

            if (this.ActorFilter(ref actorPtr) && handle.shape != null && handle.shape.Intersects(this.m_shape))
            {
                this._actorTestCache[this.m_collidedCnt++] = actorPtr;
                if (this.m_collidedCnt >= this.Capacity)
                {
                    return(false);
                }
            }
            return(true);
        }
        private static void OnSKillFuncChangeEpValue(ref SSkillFuncContext inContext, bool _bAddValue)
        {
            PoolObjHandle <ActorRoot> inTargetObj = inContext.inTargetObj;

            if (!inTargetObj)
            {
                return;
            }
            int changeValueProperty = SkillFuncPropertyDelegator.GetChangeValueProperty(inTargetObj, ref inContext);
            int skillFuncParam      = inContext.GetSkillFuncParam(0, false);

            if (inContext.inStage != ESkillFuncStage.Leave)
            {
                if (_bAddValue)
                {
                    inTargetObj.get_handle().ValueComponent.ChangeActorEp(changeValueProperty, skillFuncParam);
                }
                else
                {
                    inTargetObj.get_handle().ValueComponent.ChangeActorEp(-changeValueProperty, skillFuncParam);
                }
            }
        }
        public void PlaySuckSoulEft(PoolObjHandle <ActorRoot> src)
        {
            if (!src)
            {
                return;
            }
            if (!ActorHelper.IsCaptainActor(ref this.actorPtr) || !this.actor.Visible || !this.actor.InCamera)
            {
                return;
            }
            float      z   = (float)src.get_handle().CharInfo.iBulletHeight * 0.001f;
            Vector3    pos = src.get_handle().myTransform.localToWorldMatrix.MultiplyPoint(new Vector3(0f, 0f, z));
            Quaternion rot = Quaternion.Euler(-90f, 0f, 0f);
            GameObject pooledGameObjLOD = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(EffectPlayComponent.s_heroSuckEftPath, true, SceneObjType.ActionRes, pos, rot);

            if (pooledGameObjLOD != null)
            {
                DuraEftPlayParam duraEftPlayParam = default(DuraEftPlayParam);
                duraEftPlayParam.EftObj     = pooledGameObjLOD;
                duraEftPlayParam.RemainMSec = EffectPlayComponent.s_suckSoulMSec;
                this.soulSuckObjList.Add(duraEftPlayParam);
            }
        }
Beispiel #28
0
        public void ExecCommand(IFrameCommand cmd)
        {
            Player player = Singleton <GamePlayerCenter> .GetInstance().GetPlayer(cmd.playerID);

            if (player != null)
            {
                PoolObjHandle <ActorRoot> actor = Singleton <GameObjMgr> .get_instance().GetActor(this.ObjectID);

                if (actor && actor.get_handle().TheActorMeta.PlayerId == cmd.playerID)
                {
                    player.Captain.get_handle().HudControl.SetSelected(false);
                    player.Captain.get_handle().ActorControl.SetSelected(false);
                    bool isAutoAI = player.Captain.get_handle().ActorControl.m_isAutoAI;
                    player.Captain.get_handle().ActorControl.SetAutoAI(true);
                    player.SetCaptain((uint)actor.get_handle().TheActorMeta.ConfigId);
                    player.Captain.get_handle().HudControl.SetSelected(true);
                    player.Captain.get_handle().ActorControl.SetSelected(true);
                    player.Captain.get_handle().ActorControl.SetAutoAI(isAutoAI);
                    DefaultGameEventParam defaultGameEventParam = new DefaultGameEventParam(actor, actor);
                    Singleton <GameEventSys> .get_instance().SendEvent <DefaultGameEventParam>(GameEventDef.Event_CaptainSwitch, ref defaultGameEventParam);
                }
            }
        }
Beispiel #29
0
 public void ConnectHeroActorRoot(ref PoolObjHandle <ActorRoot> hero)
 {
     if (!hero)
     {
         DebugHelper.Assert(false, "Failed ConnectHeroActorRoot, hero is null");
         return;
     }
     if (!this._heroIds.Contains((uint)hero.get_handle().TheActorMeta.ConfigId))
     {
         DebugHelper.Assert(false, "Failed ConnectHeroActorRoot, id is not valid = {0} Camp={1} playerid={2}", new object[]
         {
             hero.get_handle().TheActorMeta.ConfigId,
             this.PlayerCamp,
             this.PlayerId
         });
         return;
     }
     this._heroes.Add(hero);
     if ((long)hero.get_handle().TheActorMeta.ConfigId == (long)((ulong)this.CaptainId))
     {
         this.Captain = hero;
     }
 }
Beispiel #30
0
        private void OnActorDead(ref GameDeadEventParam prm)
        {
            PoolObjHandle <ActorRoot> src           = prm.src;
            PoolObjHandle <ActorRoot> poolObjHandle = prm.orignalAtker;

            if (!src || !poolObjHandle || prm.bImmediateRevive)
            {
                return;
            }
            if (this.bSoulGrow)
            {
                if (src.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_EYE)
                {
                    EyeWrapper eyeWrapper = src.get_handle().ActorControl as EyeWrapper;
                    if (eyeWrapper == null || eyeWrapper.bLifeTimeOver)
                    {
                        return;
                    }
                }
                if (src.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero && poolObjHandle.get_handle().TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero && src.get_handle().ActorControl.IsKilledByHero())
                {
                    poolObjHandle = src.get_handle().ActorControl.LastHeroAtker;
                }
                if (poolObjHandle)
                {
                    this.OnActorDeadIncomeSoul(ref src, ref poolObjHandle);
                    if (poolObjHandle.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero || src.get_handle().TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero)
                    {
                        this.OnActorDeadIncomeGoldCoinInBattle(ref src, ref poolObjHandle);
                    }
                }
            }
            if (!this.bPvpMode)
            {
                this.OnMonsterDeadGold(ref prm);
            }
        }