Beispiel #1
0
    public override bool ApplyFused(FormationUnit performer, FormationUnit target, Effect effect, int fuseParameter)
    {
        if (target == null || fuseParameter <= 0)
        {
            return(false);
        }

        if (target.Character is Hero == false)
        {
            return(false);
        }

        target.Character.Stress.IncreaseValue(fuseParameter);
        if (target.Character.IsOverstressed)
        {
            if (target.Character.IsVirtued)
            {
                target.Character.Stress.CurrentValue = Mathf.Clamp(target.Character.Stress.CurrentValue, 0, 100);
            }
            else if (!target.Character.IsAfflicted && target.Character.IsOverstressed)
            {
                RaidSceneManager.Instanse.AddResolveCheck(target);
            }

            if (Mathf.Approximately(target.Character.Stress.CurrentValue, 200))
            {
                RaidSceneManager.Instanse.AddHeartAttackCheck(target);
            }
        }

        target.OverlaySlot.UpdateOverlay();
        RaidSceneManager.RaidEvents.ShowPopupMessage(target, PopupMessageType.Stress, fuseParameter.ToString());
        target.SetHalo("afflicted");
        return(true);
    }
Beispiel #2
0
    public override bool ApplyInstant(FormationUnit performer, FormationUnit target, Effect effect)
    {
        if (target == null)
        {
            return(false);
        }

        var stunStatus = (StunStatusEffect)target.Character.GetStatusEffect(StatusType.Stun);

        if (stunStatus.IsApplied)
        {
            return(true);
        }

        float stunChance = effect.IntegerParams[EffectIntParams.Chance].HasValue ?
                           (float)effect.IntegerParams[EffectIntParams.Chance].Value / 100 : 1;

        stunChance -= target.Character.GetSingleAttribute(AttributeType.Stun).ModifiedValue;
        if (performer != null && performer.Character is Hero)
        {
            stunChance += performer.Character.GetSingleAttribute(AttributeType.StunChance).ModifiedValue;
        }

        stunChance = Mathf.Clamp(stunChance, 0, 0.95f);
        if (RandomSolver.CheckSuccess(stunChance))
        {
            stunStatus.StunApplied = true;
            target.SetHalo("stunned");
            target.Character[StatusType.Guard].ResetStatus();
            return(true);
        }
        return(false);
    }
Beispiel #3
0
    public override bool ApplyQueued(FormationUnit performer, FormationUnit target, Effect effect)
    {
        if (target == null || target.Character is Hero == false)
        {
            return(false);
        }

        float diseaseTriggerChance = effect.IntegerParams[EffectIntParams.Chance].HasValue ?
                                     (float)effect.IntegerParams[EffectIntParams.Chance].Value / 100 : 1;

        if (!RandomSolver.CheckSuccess(diseaseTriggerChance))
        {
            return(false);
        }

        float diseaseChance = 1 - target.Character.GetSingleAttribute(AttributeType.Disease).ModifiedValue;

        if (RandomSolver.CheckSuccess(diseaseChance))
        {
            var hero = (Hero)target.Character;
            if (IsRandom == false && Disease != null)
            {
                if (hero.AddQuirk(Disease))
                {
                    target.SetHalo("disease");
                    RaidSceneManager.RaidEvents.ShowPopupMessage(target, PopupMessageType.Disease,
                                                                 LocalizationManager.GetString("str_quirk_name_" + Disease.Id));
                    return(true);
                }
                return(false);
            }
            else
            {
                var disease = hero.AddRandomDisease();
                RaidSceneManager.RaidEvents.ShowPopupMessage(target, PopupMessageType.Disease,
                                                             LocalizationManager.GetString("str_quirk_name_" + disease.Id));
                target.SetHalo("disease");
                return(true);
            }
        }
        else
        {
            RaidSceneManager.RaidEvents.ShowPopupMessage(target, PopupMessageType.DiseaseResist);
            return(false);
        }
    }
Beispiel #4
0
    public override bool ApplyQueued(FormationUnit performer, FormationUnit target, Effect effect)
    {
        if (target == null)
        {
            return(false);
        }

        if (target.Character is Hero == false)
        {
            return(false);
        }

        if (effect.IntegerParams[EffectIntParams.Chance].HasValue)
        {
            if (!RandomSolver.CheckSuccess((float)effect.IntegerParams[EffectIntParams.Chance].Value / 100))
            {
                return(false);
            }
        }

        float initialDamage = StressAmount;

        if (performer != null)
        {
            initialDamage *= (1 + performer.Character.GetSingleAttribute(AttributeType.StressDmgPercent).ModifiedValue);
        }

        int damage = Mathf.RoundToInt(initialDamage * (1 +
                                                       target.Character.GetSingleAttribute(AttributeType.StressDmgReceivedPercent).ModifiedValue));

        if (damage < 1)
        {
            damage = 1;
        }

        target.Character.Stress.IncreaseValue(damage);
        if (target.Character.IsOverstressed)
        {
            if (target.Character.IsVirtued)
            {
                target.Character.Stress.CurrentValue = Mathf.Clamp(target.Character.Stress.CurrentValue, 0, 100);
            }
            else if (!target.Character.IsAfflicted && target.Character.IsOverstressed)
            {
                RaidSceneManager.Instanse.AddResolveCheck(target);
            }

            if (Mathf.Approximately(target.Character.Stress.CurrentValue, 200))
            {
                RaidSceneManager.Instanse.AddHeartAttackCheck(target);
            }
        }

        target.OverlaySlot.UpdateOverlay();
        RaidSceneManager.RaidEvents.ShowPopupMessage(target, PopupMessageType.Stress, damage.ToString());
        target.SetHalo("afflicted");
        return(true);
    }
    public override bool ApplyQueued(FormationUnit performer, FormationUnit target, Effect effect)
    {
        if (target == null)
        {
            return(false);
        }

        var hero = target.Character as Hero;

        if (hero == null)
        {
            return(false);
        }

        if (effect.IntegerParams[EffectIntParams.Chance].HasValue)
        {
            if (!RandomSolver.CheckSuccess((float)effect.IntegerParams[EffectIntParams.Chance].Value / 100))
            {
                return(false);
            }
        }

        float initialHeal = StressHealAmount;

        if (performer != null)
        {
            initialHeal *= (1 + performer.Character.GetSingleAttribute(AttributeType.StressHealPercent).ModifiedValue);
        }

        int heal = Mathf.RoundToInt(initialHeal * (1 +
                                                   target.Character.GetSingleAttribute(AttributeType.StressHealReceivedPercent).ModifiedValue));

        if (heal < 1)
        {
            heal = 1;
        }

        target.Character.Stress.DecreaseValue(heal);
        if (Mathf.RoundToInt(hero.Stress.CurrentValue) == 0 && hero.IsAfflicted)
        {
            hero.RevertTrait();
        }
        target.OverlaySlot.stressBar.UpdateStress(target.Character.Stress.ValueRatio);
        RaidSceneManager.RaidEvents.ShowPopupMessage(target, PopupMessageType.StressHeal, heal.ToString());
        target.SetHalo("heroic");
        return(true);
    }
    public override bool ApplyFused(FormationUnit performer, FormationUnit target, Effect effect, int fuseParameter)
    {
        if (target == null || fuseParameter <= 0)
        {
            return(false);
        }

        var hero = target.Character as Hero;

        if (hero == null)
        {
            return(false);
        }

        target.Character.Stress.DecreaseValue(fuseParameter);
        if (Mathf.RoundToInt(hero.Stress.CurrentValue) == 0 && hero.IsAfflicted)
        {
            hero.RevertTrait();
        }
        target.OverlaySlot.stressBar.UpdateStress(target.Character.Stress.ValueRatio);
        RaidSceneManager.RaidEvents.ShowPopupMessage(target, PopupMessageType.StressHeal, fuseParameter.ToString());
        target.SetHalo("heroic");
        return(true);
    }