Example #1
0
    public override void HitDamage(float dmg, bool onedead = false)
    {
        if (GetStillAlive())
        {
            HitEffect();
            //SoundMng.Data.PlayEffectSound(EffectSound.Boss_Hit, 0, transform);
            if (Random.Range(0, 100) < _AvoidPer)
            {
                dmg = 0;
            }
            _NowHP -= dmg;
            DamageFont obj = ObjectPoolingMng.Data._DamageFontObjList[ObjectPoolingMng.Data.UseDamageFont()];

            if (dmg < 1.0f && 0 < dmg)
            {
                obj.SetDamage(1, GetUnitHPPos() + new Vector2(0, 1), true);
            }
            else
            {
                obj.SetDamage((int)dmg, GetUnitHPPos() + new Vector2(0, 1), true);
            }
            if (_NowHP <= 0.0f)
            {
                DeadUnit();
                if (_IsBoss)
                {
                    StageMng.Data.LastBossDestroy();
                }
            }
        }
    }
Example #2
0
    public void SetHeartPercent(int perc)
    {
        float dmg = (perc / 100.0f) * _MaxHP;
        float max = _MaxHP - _NowHP;

        _NowHP += dmg;


        if (_NowHP >= _MaxHP)
        {
            _NowHP = _MaxHP;
        }
        if (dmg > max)
        {
            dmg = max;
        }

        DamageFont obj = ObjectPoolingMng.Data._DamageFontObjList[ObjectPoolingMng.Data.UseDamageFont()];

        if (dmg < 1.0f && 0 < dmg)
        {
            obj.SetDamage(1, GetUnitHPPos(), IsEnemy());
        }
        else
        {
            obj.SetDamage((int)dmg, GetUnitHPPos(), IsEnemy());
        }
        obj.IsHeal();
    }
Example #3
0
 public virtual void HitDamage(float dmg, bool onedead = false)
 {
     if (GetStillAlive())
     {
         HitEffect();
         if (onedead)
         {
             dmg = _MaxHP;
         }
         _NowHP -= dmg;
         DamageFont obj = ObjectPoolingMng.Data._DamageFontObjList[ObjectPoolingMng.Data.UseDamageFont()];
         if (dmg < 1.0f && 0 < dmg)
         {
             obj.SetDamage(1, GetUnitHPPos(), IsEnemy(), onedead);
         }
         else
         {
             obj.SetDamage((int)dmg, GetUnitHPPos(), IsEnemy(), onedead);
         }
         if (_NowHP <= 0.0f)
         {
             DeadUnit();
         }
     }
 }
Example #4
0
    private void CreateDamageFont()
    {
        DamageFont dmgFont = Instantiate(DamageFontPrefab, this.transform);

        dmgFont.SpriteLoad("UI/DMG_Font_");
        dmgFont.gameObject.SetActive(false);
        damageFontQueue.Enqueue(dmgFont);
    }
Example #5
0
    public void ShowDamage(int _damage, Vector3 _position, bool _bCritical)
    {
        GameObject damgeFontObj = ObjectPool.Inst.PopFromPool(damageFontName);

        damgeFontObj.SetActive(true);
        damgeFontObj.transform.position = _position;

        DamageFont damageFont = damgeFontObj.GetComponent <DamageFont>();

        damageFont.DamageFontInit(damageFontOption);
        damageFont.SetDamage(_damage, _bCritical);
    }
Example #6
0
 public override void HitDamage(float dmg, bool onedead = false)
 {
     if (GetStillAlive())
     {
         HitEffect();
         SoundMng.Data.PlayEffectSound(EffectSound.Castle_Hit, 0, transform);
         _NowHP -= dmg;
         DamageFont obj = ObjectPoolingMng.Data._DamageFontObjList[ObjectPoolingMng.Data.UseDamageFont()];
         obj.SetDamage((int)dmg, GetUnitHPPos() + new Vector2(0, 1), true);
         if (_NowHP <= 0.0f)
         {
             DeadUnit();
             StageMng.Data.LastBossDestroy();
         }
     }
 }
Example #7
0
        public static void Unload()
        {
            Subtitle.Dispose();
            Title.Dispose();
            Splash.Dispose();
            MapSheet.Dispose();
            MiniHP.Dispose();
            HPMenu.Dispose();
            Buttons.Dispose();
            Shadows.Dispose();
            Darkness.Dispose();
            BattleFactors.Dispose();
            Strip.Dispose();
            Cursor.Dispose();
            Arrows.Dispose();
            PicBorder.Dispose();
            MenuBorder.Dispose();
            MenuBG.Dispose();

            tileCache.Clear();
            objectCache.Clear();
            bgCache.Clear();
            itemCache.Clear();
            iconCache.Clear();
            vfxCache.Clear();
            portraitCache.Clear();
            spriteCache.Clear();

            DivTex.Dispose();

            EXPFont.Dispose();
            HealFont.Dispose();
            DamageFont.Dispose();
            DungeonFont.Dispose();
            TextFont.Dispose();

            SysFont.Dispose();

            Pixel.Dispose();
            defaultTex.Dispose();

            Loaded = false;
            //Notify script engine
            LuaEngine.Instance.OnGraphicsUnload();
        }
Example #8
0
    protected void TakeDamage(int _value)
    {
        Vector3    pos  = Camera.main.WorldToScreenPoint(transform.position);
        DamageFont font = EffectManager.instance.MakeUIEffect("DamageFont").GetComponent <DamageFont>();

        font.transform.position = pos;
        font.SetText(_value.ToString());
        EffectManager.instance.MakeEffect("CFX4 Hit B (Orange)", transform.position, Quaternion.identity);
        state.recentHp -= _value;
        if (uiHpbar)
        {
            uiHpbar.RecentValue = state.recentHp;
        }
        if (state.recentHp <= 0)
        {
            state.recentHp = 0;
            DeadEvent();
        }
    }
Example #9
0
    protected void TakeDamage(int _value)
    {
        Vector3    pos  = Camera.main.WorldToScreenPoint(transform.position);
        DamageFont font = EffectManager.instance.MakeUIEffect("DamageFont").GetComponent <DamageFont>();

        font.transform.position = pos;
        font.SetText(_value.ToString());
        EffectManager.instance.MakeEffect("CFX_Hit_C White", transform.position);
        recentHP -= _value;
        if (uiHpbar)
        {
            uiHpbar.RecentValue = recentHP;
        }
        if (recentHP <= 0)
        {
            recentHP = 0;
            DeadEvent();
        }
    }
Example #10
0
    protected void RestoreDamage(int _value)
    {
        if (died)//죽엇을경우 힐을 받을수없음
        {
            return;
        }
        Vector3    pos  = Camera.main.WorldToScreenPoint(transform.position);
        DamageFont font = EffectManager.instance.MakeUIEffect("HealFont").GetComponent <DamageFont>();

        font.transform.position = pos;
        font.SetText(_value.ToString());
        recentHP += _value;
        if (recentHP > MaxHP)
        {
            recentHP = MaxHP;
        }
        if (uiHpbar)
        {
            uiHpbar.RecentValue = recentHP;
        }
    }
Example #11
0
 public override void HitDamage(float dmg, bool onedead = false)
 {
     if (GetStillAlive())
     {
         //SoundMng.Data.PlayEffectSound(EffectSound.MySoldier_Hit, 0, transform);
         HitEffect();
         if (_ShapeType == 3 || SoldierShapeBuffMng.Data.GetShapeOn_Seven_Club())
         {
             if (Random.Range(0, 100) < SoldierShapeBuffMng.Data._ClubData[UpgradeMng.Data._Level_Shape_Club - 1])
             {
                 dmg = 0;
             }
         }
         _NowHP -= dmg;
         DamageFont obj = ObjectPoolingMng.Data._DamageFontObjList[ObjectPoolingMng.Data.UseDamageFont()];
         obj.SetDamage((int)dmg, GetUnitHPPos(), false);
         if (_NowHP <= 0.0f && !_Bursucker)
         {
             Bursucker();
         }
     }
 }
Example #12
0
 public void ReturnDamageFont(DamageFont obj)
 {
     damageFontQueue.Enqueue(obj);
 }
Example #13
0
 private void GenerateDamageFont()
 {
     DamageFontPrefab = Resources.Load <DamageFont>("_Prefabs/UI/DamageFont");
     SetDamageFont();
 }