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); }
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); }
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); }