示例#1
0
    public override bool Act()
    {
        FinnalDamage finnalDamage = Self.CorrectDamage(originDamage);

        foreach (var target in UnitManager.Instance.GetUnits(Self, Targets))
        {
            target.TakeDamage(finnalDamage);
        }
        return(true);
    }
示例#2
0
    public float DamageCheck(FinnalDamage finnalDamage)
    {
        float resistanceRate = ResistanceRate.FixedValue - finnalDamage.penetrate.PenetrateRate;

        resistanceRate  = Math.Max(0, resistanceRate);
        resistanceRate /= 100f;
        float resistanceStatic = ResistanceStatic.FixedValue - finnalDamage.penetrate.PenetrateStatic;

        resistanceStatic = Math.Max(0, resistanceStatic);
        return(finnalDamage.damage * (1 - resistanceRate) - resistanceStatic);
    }
示例#3
0
    //单位受到伤害
    public void TakeDamage(FinnalDamage finnalDamage)
    {
        float TakedNumber = resistanceGroup.GetResistance(finnalDamage.damageType).DamageCheck(finnalDamage);

        LoseLife(TakedNumber);
    }