public static void OnChangeLv(CCreature obj, int newV, int oldV) { if (newV == oldV) { return; } // 逻辑层 obj.UpdateProp(); int maxHp = obj.GetPropNum(eCreatureProp.Hp); // 主角升级才回满血 //if (obj.IsMaster()) //{ // obj.SetPropNum(eCreatureProp.CurHp, maxHp); //} // 表现层 obj.UpdateVO_ShowHeadLv(); obj.UpdateVO_ShowHeadHp(); obj.UpdateUI_Lv(); if (oldV != 0 && obj.IsMaster()) { if (obj.m_vCreature != null) { CEffectMgr.Create(21160, obj.m_vCreature.GetEnt(), "origin"); } } }
public void UpdateUI_ShowHpHUD(CCreature target, int hitVal, bool bCrit = false) { eHUDType type = eHUDType.NONE; if (hitVal < 0) { if (bCrit) { type = eHUDType.FIGHT_CRIT; } else { if (target.IsMaster()) { type = eHUDType.FIGHT_SELFHARM; } else { type = eHUDType.FIGHT_HARM; } } } else { type = eHUDType.FIGHT_ADDBLOOD; } HudModule hud = (HudModule)LayoutMgr.Inst.GetLogicModule(LogicModuleIndex.eLM_PanelHud); hud.SetVisible(true); hud.SetHUD(type, hitVal.ToString(), target); return; if (target.m_vCreature == null) { return; } CmdUIHead cmd = new CmdUIHead(); cmd.type = 4; cmd.hudType = type; cmd.hudText = hitVal.ToString(); target.m_vCreature.PushCommand(cmd); }
public void EnterFrame() { if (m_player.IsDie()) { return; } m_curTime += FSPParam.clientFrameMsTime; if (m_curTime >= 40 * FSPParam.clientFrameMsTime) { if (m_tree != null) { m_tree.OnUpdate(); } // AI技能外部CD int curSkillInterval = m_tree.m_dataBase.GetData <int>((int)eAIParam.INT_SKILL_INTERVAL); if (curSkillInterval >= 0) { curSkillInterval -= FSPParam.clientFrameMsTime; m_tree.m_dataBase.SetData <int>((int)eAIParam.INT_SKILL_INTERVAL, curSkillInterval); } if (Client.Inst().m_bDebug) { string state = GetCurState(); if (!string.IsNullOrEmpty(state))// 如果卡主,可以知道最后一个状态 { // 状态显示 VObject mt = m_player.GetVObject(); if (mt == null) { return; } CmdUIHead cmd = new CmdUIHead(); cmd.type = 1; cmd.name = m_player.GetUid() + ":" + state; mt.PushCommand(cmd); } } // 仇恨值 m_curHatredTime += FSPParam.clientFrameMsTime; if (m_curHatredTime >= 30 * FSPParam.clientFrameMsTime) { _UpdateHatredList(); //主角显示测试界面 if (m_player.IsMaster()) { m_hatredList.Sort((x, y) => { if (x.val == y.val) { return(0); } else if (x.val > y.val) { return(-1); } else { return(1); } }); //m_list.Init(m_hatredList.Count, (item, index) => //{ // UIItem.SetText(item, "txt", m_hatredList[index].uid + " 仇恨值:" + m_hatredList[index].val); // UIItem.SetProgress(item, "pct", m_hatredList[index].val, 100); //}); } m_curHatredTime = 0; } } }