Esempio n. 1
0
        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");
                }
            }
        }
Esempio n. 2
0
 public static void OnChangeCurHp(CCreature obj, int newV, int oldV)
 {
     if (oldV == 0 && newV == 0)
     {
         return;
     }
     // 逻辑层
     if (newV <= 0)
     {
         obj.OnDie();
     }
     // 表现层
     obj.UpdateVO_ShowHeadHp();
     // UI
     obj.UpdateUI_Hp();
 }
Esempio n. 3
0
 public static void OnChangeMaxHp(CCreature obj, int newV, int oldV)
 {
     // 表现层
     obj.UpdateVO_ShowHeadHp();
     obj.UpdateUI_Hp();
 }