예제 #1
0
        public override float StartCure(ICure icure, float healthValue)
        {
            if (Mathf.Abs(TotalHealth - VirusHealth.Value) > 0.1f)
            {
                _virusHealthAddEffect.StartHealthEffect(icure);
            }
            float vv         = base.StartCure(icure, healthValue);
            var   virusLevel = VirusTool.GetVirusColorLevel("VampireVirus", VirusGameDataAdapter.GetLevel(), VirusHealth.Value);

            if (virusLevel != CurColorLevel)
            {
                CurColorLevel = virusLevel;
                VirusSprite.Initi(CurColorLevel);
                transform.GetComponent <BubbleEffectMrg>().SetBubbleSprite(CurColorLevel);
            }
            return(vv);
        }
예제 #2
0
        public override float StartCure(ICure iCure, float healthValue)
        {
            float vv         = base.StartCure(iCure, healthValue);
            var   virusLevel = VirusTool.GetVirusColorLevel("RegenerativeVirus", VirusGameDataAdapter.GetLevel(), VirusHealth.Value);

            if (virusLevel != CurColorLevel)
            {
                CurColorLevel = virusLevel;
                VirusSprite.Initi(CurColorLevel);
                transform.GetComponent <BubbleEffectMrg>().SetBubbleSprite(CurColorLevel);
            }
            if (Mathf.Abs(VirusHealth.Value - TotalHealth) < 0.1f)
            {
                _virusHealthAddEffect.StopHealthEffect(this);
            }
            return(vv);
        }
예제 #3
0
    public virtual void Born(VirusData virusData)
    {
        VirusSprite = transform.GetComponent <BaseVirusSprite>();
        VirusSprite.Initi(virusData.VirusColorLevel);
        VirusHealth       = new RectiveProperty <float>();
        VirusHealth.Value = virusData.HealthValue;
        HealthBar.Initi(VirusTool.GetStrByIntger(virusData.HealthValue));
        VirusHealth.Subscibe(HealthBar.SetValue);

        SplitLevel       = virusData.SplitLevel;
        CurColorLevel    = virusData.VirusColorLevel;
        OriginColorLevel = virusData.VirusColorLevel;
        TotalHealth      = virusData.HealthValue;

        ScaleX = VirusTool.GetScaleByLevel(virusData.SplitLevel);
        transform.localScale = new Vector3(ScaleX, ScaleX, 1);
        VirusMove.Initi(virusData.MoveSpeed, virusData.MoveDirection);

        transform.GetComponent <VirusBuffMrg>().Initi();
        IsDeath = false;
    }
예제 #4
0
        public override void Injured(float damageValue, bool isEffect)
        {
            if (VirusHealth.Value - damageValue <= 0)
            {
                Death(true, true, true, true);
                return;
            }
            VirusHealth.Value -= damageValue;
            var virusLevel = VirusTool.GetVirusColorLevel("VampireVirus", VirusGameDataAdapter.GetLevel(), VirusHealth.Value);

            if (virusLevel != CurColorLevel)
            {
                CurColorLevel = virusLevel;
                VirusSprite.Initi(CurColorLevel);
                transform.GetComponent <BubbleEffectMrg>().SetBubbleSprite(CurColorLevel);
            }
            if (isEffect)
            {
                virusHurtEffect.StartHurtEffect();
            }
        }
예제 #5
0
        public override void Injured(float damageValue, bool isEffect)
        {
            if (VirusHealth.Value - damageValue <= 0)
            {
                Death(true, true, true, true);
                return;
            }
            VirusHealth.Value -= damageValue;
            var virusLevel = VirusTool.GetVirusColorLevel("RegenerativeVirus", VirusGameDataAdapter.GetLevel(), VirusHealth.Value);

            if (virusLevel != CurColorLevel)
            {
                CurColorLevel = virusLevel;
                VirusSprite.Initi(CurColorLevel);
                transform.GetComponent <BubbleEffectMrg>().SetBubbleSprite(CurColorLevel);
            }
            if (isEffect)
            {
                _virusHurtEffect.StartHurtEffect();
            }
            _virusHealthAddEffect.StopHealthEffect(this);
            _totalTime = 0.5f;
            _ishurt    = true;
        }