Exemplo n.º 1
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);
                }
            }
        }
        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 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);
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
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);
        }