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