/// <summary> /// 弹夹信息,只有主角才有 /// </summary> /// <param name="result"></param> private static void DisposeSyncClipInfo(SyncClipInfo result) { //Leyoutech.Utility.DebugUtility.LogWarning("广播", string.Format("弹夹信息, 武器ID = {0}", result.CurWeaponUid)); GameplayProxy m_GameplayProxy = GameFacade.Instance.RetrieveProxy(ProxyName.GameplayProxy) as GameplayProxy; SpacecraftEntity entity = m_GameplayProxy.GetEntityById <SpacecraftEntity>(m_GameplayProxy.GetMainPlayerUID()); if (entity == null) { return; } PlayerSkillProxy m_PlayerSkillProxy = GameFacade.Instance.RetrieveProxy(ProxyName.PlayerSkillProxy) as PlayerSkillProxy; m_PlayerSkillProxy.ChangeCurrentWeaponByServer(result.CurWeaponUid); foreach (WeaponValue info in result.Infos) { ulong weaponUID = info.WeaponUid; WeaponPowerVO power = entity.GetWeaponPower(weaponUID); if (power == null) { entity.SetWeaponPower(weaponUID, new WeaponPowerVO()); power = entity.GetWeaponPower(weaponUID); } power.WeaponUID = info.WeaponUid; power.CurrentValue = info.CurValue; power.MaxValue = info.MaxValue; power.SafeValue = info.SaftyValue; IWeapon weapon = m_PlayerSkillProxy.GetWeaponByUID(power.WeaponUID); if (weapon != null && weapon.GetConfig().ClipType != (int)WeaponL1.Treasure) { if (power.CurrentValue <= 0) { power.ForceCooldown = true; } else if (power.CurrentValue >= power.SafeValue) { power.ForceCooldown = false; } } else { if (power.CurrentValue >= power.MaxValue) { power.ForceCooldown = true; } else if (power.CurrentValue <= power.SafeValue) { power.ForceCooldown = false; } } } GameFacade.Instance.SendNotification(NotificationName.MSG_CHARACTER_WEAPON_POWER_CHANGED); entity.SendEvent(ComponentEventName.WeaponPowerChanged, null); }
private static void Run(GameSession.BroadSkillInfoResponse message) { GameSession.BroadSkillInfoResponse.Types.Success success = message.Success; if (success != null) { SkillSelectTargetInfoBroadcast target_info = success.Success_.TargetInfo; //吟唱和引导技能开始 SkillEmitNodeBroadcast node_info = success.Success_.NodeInfo; //随机挂点同步 StopSkill stop_skill = success.Success_.StopSkill; //技能break GuideSkillEnd guide_end = success.Success_.GuideEnd; //引导技能正常结束 SkillChangeTargetBroadcast change_result = success.Success_.ChangeResult; //引导技能切换目标 AccumulationSkillEndBroadcast accumalation_end = success.Success_.AccumalationEnd; //蓄力技能蓄力结束(抬起按键) AccumulationSkillBegin accumulation_skill_begin = success.Success_.AccumulationSkillBegin; //蓄力技能蓄力开始(按下按键) AddBuf add_buf = success.Success_.AddBuf; //添加buf DeleteBuf delete_buf = success.Success_.DeleteBuf; //删除buf SyncClipInfo clip_info = success.Success_.ClipInfo; // 弹夹信息 // 处理吟唱和引导技能开始 if (target_info != null) { DisposeSkillSelectTargetInfoBroadcast(target_info); } // 随机挂点同步 if (node_info != null) { DisposeSkillEmitNodeBroadcast(node_info); } // 技能break if (stop_skill != null) { DisposeStopSkill(stop_skill); } // 引导技能正常结束 if (guide_end != null) { DisposeGuideSkillEnd(guide_end); } // 引导技能切换目标 if (change_result != null) { DisposeSkillChangeTargetBroadcast(change_result); } // 蓄力技能蓄力结束(抬起按键) if (accumalation_end != null) { DisposeAccumulationSkillEndBroadcast(accumalation_end); } // 蓄力技能蓄力开始(按下按键) if (accumulation_skill_begin != null) { DisposeAccumulationSkillBegin(accumulation_skill_begin); } //添加buf if (add_buf != null) { DisposeAddBuf(add_buf); } //删除buf if (delete_buf != null) { DisposeDeleteBuf(delete_buf); } //弹夹信息 if (clip_info != null) { DisposeSyncClipInfo(clip_info); } } }