Exemplo n.º 1
0
 /// <summary>
 /// 對角色造成物理傷害,傳入[造成的傷害][是否在ICON顯示效果動畫]
 /// </summary>
 public virtual void ReceivePhysicalDamge(int _damage, bool _showIconAni, HitTextType _hitTextType, float _showDelay)
 {
     //不可對死者進行攻擊
     if (!IsAlive)
     {
         return;
     }
     //傷害不小於等於0
     if (_damage <= 0)
     {
         return;
     }
     //傷害最大等於剩餘血量
     if (CurHP - _damage < 0)
     {
         _damage = CurHP;
     }
     CurHP -= _damage;
     HitTextController.ShowHitText(this, _damage, _hitTextType, _showDelay);
     UpdateHealthRatio();
     //更新腳色介面
     CharaDataUI.UpdateHealth(Index);
     //檢查是否存活
     AliveCheck();
 }
Exemplo n.º 2
0
 /// <summary>
 /// 對角色造成治癒,傳入[造成的治癒][是否在ICON顯示效果動畫]
 /// </summary>
 public virtual void ReceiveCure(int _cure, bool _showIconAni, HitTextType _hitTextType, float _showDelay)
 {
     //不可對死者進行治癒
     if (!IsAlive)
     {
         return;
     }
     //治癒量不可小於等於0
     if (_cure <= 0)
     {
         return;
     }
     //治癒量大於損失的血量
     if (CurHP + _cure > MaxHP)
     {
         _cure = MaxHP - CurHP;
     }
     CurHP += _cure;
     UpdateHealthRatio();
     HitTextController.ShowHitText(this, _cure, _hitTextType, _showDelay);
     //更新腳色介面
     CharaDataUI.UpdateHealth(Index);
 }