Beispiel #1
0
        private ProcessResult PreProcess(FullCombatCharacter source, List <FullCombatCharacter> target, CombatData combatData, List <IEffect> effects)
        {
            //Determine if it's a valid skill or on cooldown etc
            if (source.classLevel < requiredClassLevel || combatData.hasCooldown(source.name, cooldown) || target.Count > maxTargets)
            {
                return(ProcessResult.EndTurn);
            }

            if (BasicModificationsGeneration.hasMod(source, "Ranged"))
            {
                damageCoefficient = damageCoefficient * .75f;

                if (!ranged)
                {
                    effects.Add(new Effect(EffectTypes.Message, 0, "Using a melee attack has removed the ranged advantage!", 0));
                    CombatCalculator.removeRanged(source);
                }
            }


            if (oncePerRest != string.Empty && source.usedAbilities.Contains(oncePerRest))
            {
                return(ProcessResult.EndTurn);
            }

            return(ProcessResult.Normal);
        }
Beispiel #2
0
        private ProcessResult Process(FullCombatCharacter source, List <FullCombatCharacter> target, CombatData combatData, List <IEffect> effects)
        {
            //Deal damage etc.
            foreach (FullCombatCharacter t in target)
            {
                int dmg = 0;
                if (damageType == DamageType.Physical)
                {
                    dmg = (int)((CombatCalculator.getNormalAttackValue(source) * damageCoefficient * damageMultiplier / t.vitality));

                    for (int i = 0; i < hits; i++)
                    {
                        if (t.inflictDamage(ref dmg) == FullCombatCharacter.HitEffect.Unbalance)
                        {
                            attackTimeCoefficient = attackTimeCoefficient * 2;
                        }
                    }

                    effects.Add(new Effect(EffectTypes.DealDamage, t.combatUniq, string.Empty, dmg));
                    string newMessage = message.Replace("{Name}", source.name)
                                        .Replace("{Target}", t.name)
                                        .Replace("{Damage}", dmg.ToString())
                                        .Replace("{HitCount}", hits.ToString());
                    if (newMessage != string.Empty)
                    {
                        effects.Add(new Effect(EffectTypes.Message, 0, newMessage, 0));
                    }
                }
                else if (damageType == DamageType.Magical)
                {
                    dmg = (int)((CombatCalculator.getMagicAttackValue(source) * damageCoefficient * damageMultiplier / t.wisdom));

                    for (int i = 0; i < hits; i++)
                    {
                        t.inflictDamage(ref dmg);
                    }

                    effects.Add(new Effect(EffectTypes.DealDamage, t.combatUniq, string.Empty, dmg));
                    string newMessage = message.Replace("{Name}", source.name)
                                        .Replace("{Target}", t.name)
                                        .Replace("{Damage}", dmg.ToString())
                                        .Replace("{HitCount}", hits.ToString());
                    if (newMessage != string.Empty)
                    {
                        effects.Add(new Effect(EffectTypes.Message, 0, newMessage, 0));
                    }
                }
            }

            return(ProcessResult.Normal);
        }