public GameSkillBase(long skillId) { m_confSkill = ConfSkill.Get(skillId); if (m_confSkill == null) { Debug.LogError("skill is not Exist : " + skillId); } }
private void OnSkillFinish(long carryId) { ConfProp confprop = ConfProp.Get(carryId); if (confprop == null) { return; } ConfSkill releaseSkill = ConfSkill.Get(confprop.skillId); if (releaseSkill == null) { return; } if (carryId == this.m_propId) { m_fillImage.FillTime = this.m_confSKill.cd; if (GuidNewNodeManager.Instance.GetCommonParams(GuidNewNodeManager.PropFree) == this.m_propId.ToString()) { ResetSkill(); return; } GlobalInfo.MY_PLAYER_INFO.ReducePropForBag(this.m_propId); PlayerPropMsg propMsg = GlobalInfo.MY_PLAYER_INFO.GetBagInfosByID(this.m_propId); if (propMsg == null) { this.m_lbRemain.Text = "0"; } else { this.m_lbRemain.Text = propMsg.Count.ToString(); } ResetSkill(); Dictionary <UBSParamKeyName, object> internalBuyItemKeypoint = new Dictionary <UBSParamKeyName, object>(); internalBuyItemKeypoint.Add(UBSParamKeyName.Description, UBSDescription.PROPUSE); internalBuyItemKeypoint.Add(UBSParamKeyName.PropItem_ID, carryId); internalBuyItemKeypoint.Add(UBSParamKeyName.PropItem_Num, 1); UserBehaviorStatisticsModules.Instance.LogEvent(UBSEventKeyName.game_propuse, 1, internalBuyItemKeypoint); //this.CanClick = false; //this.m_btnItem.Enable = false; } else if (IsFunctionProp(releaseSkill)) { if (IsFunctionProp(this.m_confSKill) || this.m_lbRemain.Text.Equals("+")) { m_fillImage.FillTime = releaseSkill.cd; this.m_isCD = true; } } }
public GameSkillBase CreateSkill(long skillId, Action func) { GameSkillBase skillBase = null; ConfSkill confSkill = ConfSkill.Get(skillId); if (confSkill == null) { Debug.LogError("skill is not exist: " + skillId); return(null); } if (types.ContainsKey(confSkill.type)) { skillBase = Activator.CreateInstance(types[confSkill.type], skillId) as GameSkillBase; skillBase.SetOnEnd(func); } return(skillBase); }
private void OnSkillReset(long carryId) { ConfProp confprop = ConfProp.Get(carryId); if (confprop == null) { return; } ConfSkill releaseSkill = ConfSkill.Get(confprop.skillId); if (releaseSkill == null) { return; } if (carryId == this.m_propId) { if (GuidNewNodeManager.Instance.GetCommonParams(GuidNewNodeManager.PropFree) == this.m_propId.ToString()) { this.m_isCD = false; return; } PlayerPropMsg propMsg = GlobalInfo.MY_PLAYER_INFO.GetBagInfosByID(this.m_propId); if (propMsg != null) { //this.m_canClick = true; //this.m_btnItem.Enable = true; this.m_imgItem.SetGray(false); } else { //this.CanClick = false; this.m_lbRemain.Text = "+"; this.m_imgItem.SetGray(true); //this.m_btnItem.Enable = false; } this.m_isCD = false; } else if (IsFunctionProp(releaseSkill)) { if (IsFunctionProp(this.m_confSKill) || this.m_lbRemain.Text.Equals("+")) { this.m_isCD = false; } } }
public static int GetOfficerSkillTimeAddPercent(long officer_id_, int lvl_) { long skill_id = GetCurLevelSkillID(officer_id_, lvl_); if (skill_id < 0) { return(0); } var skill = ConfSkill.Get(skill_id); if (2 == skill.type) { return(skill.gain); } return(0); }
/// <summary> /// 警员节能减少体力万分比 /// </summary> /// <param name="officer_id_"></param> /// <param name="lvl_"></param> /// <returns></returns> public static int GetOfficerSkillVitReducePercent(long officer_id_, int lvl_) { long skill_id = GetCurLevelSkillID(officer_id_, lvl_); if (skill_id < 0) { return(0); } var skill = ConfSkill.Get(skill_id); if (4 == skill.type) { return(Math.Abs(skill.gain)); } return(0); }
private void OnSkillFinish(long propId) { if (propId == m_bagData.prop.prop.id) { if (m_bagData.prop.prop.type == 0) { WaveTipHelper.LoadWaveContent("bag_energy_use", ConfSkill.Get(m_bagData.prop.prop.skillId).gain); } else { WaveTipHelper.LoadWaveContent("bag_prop_use"); } //PopUpManager.OpenNormalOnePop("afewfewfe"); GlobalInfo.MY_PLAYER_INFO.ReducePropForBag(propId, m_curNum); GameEvents.UIEvents.UI_Bag_Event.OnPropCost.SafeInvoke(m_bagData.prop.prop.id); EngineCoreEvents.UIEvent.HideUIEvent.SafeInvoke(UIDefine.UI_BAGUSE); } }
public void SetData(long id, GameMainArrowTipData arrowData) { if (arrowData != null) { this.m_isArrowTips = (arrowData.propId == id); } this.m_propId = id; ConfProp confProp = ConfProp.Get(id); if (confProp == null) { Visible = false; } this.m_skillId = confProp.skillId; this.m_confSKill = ConfSkill.Get(this.m_skillId); this.m_imgItem.Sprite = confProp.icon; PlayerPropMsg propMsg = GlobalInfo.MY_PLAYER_INFO.GetBagInfosByID(id); this.m_keepPropNum = propMsg == null ? 0 : propMsg.Count; if (GuidNewNodeManager.Instance.GetCommonParams(GuidNewNodeManager.PropFree).Equals(this.m_propId.ToString())) { this.m_lbRemain.Text = "free"; return; } if (propMsg == null || propMsg.Count <= 0) { this.m_lbRemain.Text = "+"; this.m_imgItem.SetGray(true); //this.CanClick = false; //this.m_btnItem.Enable = false; } else { this.m_lbRemain.Text = propMsg.Count.ToString(); this.m_propId = id; //this.CanClick = true; //this.m_btnItem.Enable = true; this.m_imgItem.SetGray(false); } //ReflashBtnEnable(); }
protected override void InitCarryBase() { OfficerInfo officerInfo = GlobalInfo.MY_PLAYER_INFO.GetOfficerInfoByPlayId(m_carryID); ConfOfficer confOffice = ConfOfficer.Get(officerInfo.OfficerId); if (confOffice != null) { m_skillID = SkillTools.GetSkillIdByLevel(confOffice, officerInfo.Level); ConfSkill confSkill = ConfSkill.Get(m_skillID); if (confSkill != null) { if (confSkill.phase == 3) { GameSkillManager.Instance.m_hasPoliceAddition = true; } } MessageHandler.RegisterMessageHandler(MessageDefine.SCSkillTimerEmitResp, OnRes); base.InitCarryBase(); } }
protected virtual void OneUseReqCallback(long id) { if (m_itemdata == null || null == m_itemdata.m_prop) { return; } if (id == m_itemdata.m_prop.id && 1 == m_itemdata.m_number) { ConfProp confProp = ConfProp.Get(m_itemdata.m_prop.id); if (confProp != null && (confProp.type == 0 || confProp.type == 8)) { ConfSkill confSkill = ConfSkill.Get(confProp.skillId); if (confSkill != null) { WaveTipHelper.LoadWaveContent("food_add_1", confSkill.gain); } } GlobalInfo.MY_PLAYER_INFO.ReducePropForBag(id); GameEvents.UIEvents.UI_Bag_Event.OnPropCost.SafeInvoke(m_itemdata.m_prop.id); this.SwitchButton(); } }
private void StartReleaseSkill() { if (m_skillId < 0) { EngineCoreEvents.AudioEvents.PlayAudio.SafeInvoke(Audio.AudioType.UISound, EngineCommonAudioKey.Button_Click_Common.ToString()); return; } ConfSkill confSkill = ConfSkill.Get(m_skillId); if (confSkill == null) { EngineCoreEvents.AudioEvents.PlayAudio.SafeInvoke(Audio.AudioType.UISound, EngineCommonAudioKey.Button_Click_Common.ToString()); return; } GameSkillManager.Instance.OnStartSkill(m_propId); //Dictionary<UBSParamKeyName, object> internalBuyItemKeypoint = new Dictionary<UBSParamKeyName, object>(); //internalBuyItemKeypoint.Add(UBSParamKeyName.PropItem_ID, m_propId); //internalBuyItemKeypoint.Add(UBSParamKeyName.PropItem_Num, 1); //UserBehaviorStatisticsModules.Instance.LogEvent(UBSEventKeyName.game_use_propitem, 1, internalBuyItemKeypoint); }
private void OnBuyCallback(MarkeBuyResponse res) { if (m_itemdata == null || m_requestType != m_curShopType) { return; } if (res.ResponseStatus != null) ////////////////TTTTT { PopUpManager.OpenNormalOnePop("shop_rmb_no"); } else { if (m_itemdata.marketID == m_requestID) { m_requestType = ShopType.None; int cost = 0; if (m_itemdata.m_hasDis) { cost = m_itemdata.m_disPrice * m_requestCount; } else { cost = m_itemdata.m_oriPrice * m_requestCount; } if (m_itemdata.m_costType == CostType.CostCash) { GlobalInfo.MY_PLAYER_INFO.ChangeCash(-cost); } else if (m_itemdata.m_costType == CostType.CostCoin) { GlobalInfo.MY_PLAYER_INFO.ChangeCoin(-cost); } PopUpManager.OpenNormalOnePop("shop_rmb_ok"); //CommonHelper.OpenGift(m_itemdata.m_prop.id, m_requestCount); if (m_is_fast_buy) { if (12 != res.Props.PropId) //火锅 { GlobalInfo.MY_PLAYER_INFO.AddSingleBagInfo(res.Props.PropId, res.Props.Count); GameEvents.UIEvents.UI_GameEntry_Event.Listen_OnCombinePropCollected.SafeInvoke(); } GameSkillManager.Instance.OnStartSkill(m_itemdata.m_prop.id, 1); } else { if (ShopType.Vit == m_curShopType) { ConfProp confProp = ConfProp.Get(m_itemdata.m_prop.id); if (confProp != null && confProp.skillId != 26) { long itemID = res.Props.PropId; int itemNum = res.Props.Count; GlobalInfo.MY_PLAYER_INFO.AddSingleBagInfo(res.Props.PropId, res.Props.Count); GameEvents.UIEvents.UI_Bag_Event.OnPropCost.SafeInvoke(m_itemdata.m_prop.id); GameEvents.UIEvents.UI_GameEntry_Event.Listen_OnCombinePropCollected.SafeInvoke(); } else if (confProp != null) { ConfSkill confskill = ConfSkill.Get(confProp.skillId); VitManager.Instance.ReflashInfiniteVitTime(confskill.duration * 1000); } } } if (m_itemdata.m_limitNumber > 0) { --m_itemdata.m_limitNumber; m_limited_buy_num_txt.Text = string.Format("({0}/{1})", m_itemdata.m_limitNumber, m_limited_max_num); if (0 == m_itemdata.m_limitNumber) { m_limited_buy_btn.Enable = false; m_limited_buy_btn.SetGray(true); } else { m_limited_buy_btn.Enable = true; m_limited_buy_btn.SetGray(false); } this.SwitchButton(); return; } if (1 == m_itemdata.m_number && false == m_itemdata.m_hasDis) { this.SwitchButton(); } } } }
public void setInfoData(PropData propData) { m_curPropData = propData; if (propData != null) { m_Icon_img.Sprite = propData.prop.icon; m_Title_lab.Text = LocalizeModule.Instance.GetString(propData.prop.name); m_Sum_lab.Text = string.Format("x{0}", propData.num); m_Content_lab.Text = LocalizeModule.Instance.GetString(propData.prop.description); m_Money_lab.Text = propData.prop.price.ToString(); long skillId = propData.prop.skillId; int tradeLimit = propData.prop.tradeLimit; if (skillId > 0) { ConfSkill skill = ConfSkill.Get(skillId); if (skill != null && skill.phase <= 3) { if (tradeLimit == 0) { tradeLimit = 1; } else if (tradeLimit == 2) { tradeLimit = 3; } } } SetPropInfoVisible(true); if (tradeLimit == 0) { m_MsgNode_obj.SetActive(true); m_SaleUseNode_obj.SetActive(true); m_Sale_btn.SetActive(true); m_Use_btn.SetActive(true); m_NoSaleTip_lab.SetActive(false); m_MultiFunc_btn.SetActive(false); m_ShopTips_lab.SetActive(false); m_currentInfo_enum = PropInfoTypeEnum.None; } else if (tradeLimit == 1) { m_MsgNode_obj.SetActive(true); m_MultiFunc_btn.SetActive(true); m_SaleUseNode_obj.SetActive(true); m_Sale_btn.SetActive(false); m_Use_btn.SetActive(false); m_NoSaleTip_lab.SetActive(false); m_ShopTips_lab.SetActive(false); m_MultiFunc_lab.Text = "Sale"; m_currentInfo_enum = PropInfoTypeEnum.Sale; } else if (tradeLimit == 2) { m_MultiFunc_btn.SetActive(true); m_MsgNode_obj.SetActive(true); m_SaleUseNode_obj.SetActive(false); m_Sale_btn.SetActive(false); m_Use_btn.SetActive(false); m_NoSaleTip_lab.SetActive(true); m_ShopTips_lab.SetActive(false); m_MultiFunc_lab.Text = "Use"; m_currentInfo_enum = PropInfoTypeEnum.Use; } else if (tradeLimit == 3) { m_MsgNode_obj.SetActive(true); m_SaleUseNode_obj.SetActive(false); m_Sale_btn.SetActive(false); m_Use_btn.SetActive(false); m_NoSaleTip_lab.SetActive(false); m_MultiFunc_btn.SetActive(false); m_ShopTips_lab.SetActive(false); m_currentInfo_enum = PropInfoTypeEnum.None; } } }
public static bool GetCurLevelSkillIconAndDesc(long officer_id_, int lvl_, out string icon_, out string desc_) { icon_ = string.Empty; desc_ = string.Empty; lvl_ = 0 == lvl_ ? 1 : lvl_; int cur_level = lvl_; ConfOfficer exl_data = ConfOfficer.Get(officer_id_); long skill_id = -1; switch (cur_level) { case 1: skill_id = exl_data.skillId; break; case 2: skill_id = exl_data.level2SkillId; break; case 3: skill_id = exl_data.level3SkillId; break; case 4: skill_id = exl_data.level4SkillId; break; case 5: skill_id = exl_data.level5SkillId; break; case 6: skill_id = exl_data.level6SkillId; break; case 7: skill_id = exl_data.level7SkillId; break; case 8: skill_id = exl_data.level8SkillId; break; case 9: skill_id = exl_data.level9SkillId; break; case 10: skill_id = exl_data.level10SkillId; break; } if (skill_id > 0) { ConfSkill skill = ConfSkill.Get(skill_id); icon_ = skill.icon; desc_ = LocalizeModule.Instance.GetString(skill.descs); return(true); } return(false); }