Пример #1
0
 public DamageEffect(DamageEffectParameters damageParameters)
 {
     _damageParameters = damageParameters;
 }
Пример #2
0
        public void Initialize()
        {
            // Initialize properties that are normally only updated on property changed
            RefreshMovementTypes();
            RefreshMapPoint();


            if (this.UnitFaction == Faction.PlayerFaction)
            {
                var stompDamageEffectParameters = new DamageEffectParameters();
                stompDamageEffectParameters.SizeBiggerDamageMultiplier  = 1.5f;
                stompDamageEffectParameters.SizeSmallerDamageMultiplier = 0.8f;
                stompDamageEffectParameters.DamagePairs = new[] { new DamageEffectPairParameter {
                                                                      OffensiveAttribute = UnitAttribute.Physical, OffensiveAttributeMultiplier = 1, DefensiveAttribute = UnitAttribute.Defense, DefensiveAttributeMultiplier = 1
                                                                  } };
                stompDamageEffectParameters.TileDamage = 1;

                var abilityDataStomp = new AbilityData()
                {
                    IDName                   = "STOMP",
                    FriendlyName             = "Stomp",
                    FriendlyDescription      = "Deal extra damage to smaller units",
                    AbilityCategory          = AbilityCategory.Attack,
                    WeaponCategory           = WeaponAdvantageCategory.Physical,
                    RangeDistanceRule        = AbilityRangeDistanceRule.SizeRangeSmall,
                    RangeSpecialRule         = AbilityRangeSpecialRule.None,
                    MinRange                 = 1,
                    MaxRange                 = 1,
                    ActionConsumption        = AbilityActionConsumption.MajorAction,
                    MinorActionConsumptionID = String.Empty,
                    HPCost                   = 0,
                    SPCost                   = 0,
                    DurabilityCost           = 0,
                    Accuracy                 = 90,
                    RepeatCount              = 2,
                    TargetRule               = AbilityTargetRule.EnemiesOnly,
                    AreaPoints               = new[] { new MapPoint(0, 0, 1, 1) },
                    AbilityEffects           = new[] { new DamageEffect(stompDamageEffectParameters) },
                    CanBeCountered           = true,
                    CanCounterAttack         = true,
                };
                var abilityStomp = new Ability(this, abilityDataStomp);
                Abilities.Add(abilityStomp);


                var kickDamageEffectParameters = new DamageEffectParameters();
                kickDamageEffectParameters.SizeBiggerDamageMultiplier  = 0.8f;
                kickDamageEffectParameters.SizeSmallerDamageMultiplier = 1.5f;
                kickDamageEffectParameters.DamagePairs = new[] { new DamageEffectPairParameter {
                                                                     OffensiveAttribute = UnitAttribute.Physical, OffensiveAttributeMultiplier = 1, DefensiveAttribute = UnitAttribute.Defense, DefensiveAttributeMultiplier = 1
                                                                 } };
                kickDamageEffectParameters.TileDamage = 1;

                var abilityDataKick = new AbilityData()
                {
                    IDName                   = "KICK",
                    FriendlyName             = "Kick",
                    FriendlyDescription      = "Deal extra damage to larger units",
                    AbilityCategory          = AbilityCategory.Attack,
                    WeaponCategory           = WeaponAdvantageCategory.Physical,
                    RangeDistanceRule        = AbilityRangeDistanceRule.SizeRangeSmall,
                    RangeSpecialRule         = AbilityRangeSpecialRule.None,
                    MinRange                 = 1,
                    MaxRange                 = 1,
                    ActionConsumption        = AbilityActionConsumption.MajorAction,
                    MinorActionConsumptionID = String.Empty,
                    HPCost                   = 0,
                    SPCost                   = 0,
                    DurabilityCost           = 0,
                    Accuracy                 = 90,
                    RepeatCount              = 2,
                    TargetRule               = AbilityTargetRule.EnemiesOnly,
                    AreaPoints               = new[] { new MapPoint(0, 0, 1, 1) },
                    AbilityEffects           = new[] { new DamageEffect(kickDamageEffectParameters) },
                    CanBeCountered           = true,
                    CanCounterAttack         = true,
                };
                var abilityKick = new Ability(this, abilityDataKick);
                Abilities.Add(abilityKick);


                var rapidJabDamageEffectParameters = new DamageEffectParameters();
                rapidJabDamageEffectParameters.DamagePairs = new[] { new DamageEffectPairParameter {
                                                                         OffensiveAttribute = UnitAttribute.Physical, OffensiveAttributeMultiplier = 1.4f, DefensiveAttribute = UnitAttribute.Defense, DefensiveAttributeMultiplier = 1
                                                                     } };
                rapidJabDamageEffectParameters.TileDamage = 1;

                var abilityDataRapidJab = new AbilityData()
                {
                    IDName                   = "SCHOOL_RapidJab",
                    FriendlyName             = "Rapid Jab",
                    FriendlyDescription      = "Attack multiple times",
                    AbilityCategory          = AbilityCategory.Special,
                    WeaponCategory           = WeaponAdvantageCategory.Physical,
                    RangeDistanceRule        = AbilityRangeDistanceRule.SizeRangeSmall,
                    RangeSpecialRule         = AbilityRangeSpecialRule.None,
                    MinRange                 = 1,
                    MaxRange                 = 1,
                    ActionConsumption        = AbilityActionConsumption.MajorAction,
                    MinorActionConsumptionID = String.Empty,
                    HPCost                   = 0,
                    SPCost                   = 3,
                    DurabilityCost           = 0,
                    Accuracy                 = 80,
                    RepeatCount              = 4,
                    RepeatThreshold          = 3,
                    TargetRule               = AbilityTargetRule.EnemiesOnly,
                    AreaPoints               = new[] { new MapPoint(0, 0, 1, 1) },
                    AbilityEffects           = new[] { new DamageEffect(rapidJabDamageEffectParameters) },
                    CanBeCountered           = true,
                    CanCounterAttack         = false,
                };
                var abilityRapidJab = new Ability(this, abilityDataRapidJab);
                Abilities.Add(abilityRapidJab);



                var RoudnhouseDamageEffectParameters = new DamageEffectParameters();
                RoudnhouseDamageEffectParameters.DamagePairs = new[] { new DamageEffectPairParameter {
                                                                           OffensiveAttribute = UnitAttribute.Physical, OffensiveAttributeMultiplier = 1.5f, DefensiveAttribute = UnitAttribute.Defense, DefensiveAttributeMultiplier = 1
                                                                       } };
                RoudnhouseDamageEffectParameters.TileDamage = 1;

                var abilityDataRoundhouse = new AbilityData()
                {
                    IDName                   = "SCHOOL_Roundhouse",
                    FriendlyName             = "Roundhouse",
                    FriendlyDescription      = "Hit all enemies around user",
                    AbilityCategory          = AbilityCategory.Special,
                    WeaponCategory           = WeaponAdvantageCategory.Physical,
                    RangeDistanceRule        = AbilityRangeDistanceRule.SizeRangeSmall,
                    RangeSpecialRule         = AbilityRangeSpecialRule.Directional,
                    MinRange                 = 1,
                    MaxRange                 = 1,
                    ActionConsumption        = AbilityActionConsumption.MajorAction,
                    MinorActionConsumptionID = String.Empty,
                    HPCost                   = 0,
                    SPCost                   = 2,
                    DurabilityCost           = 0,
                    RepeatCount              = 1,
                    Accuracy                 = 95,
                    TargetRule               = AbilityTargetRule.EnemiesOnly,
                    AreaPoints               = new[] { new MapPoint(-1, 0, 3, 1), new MapPoint(0, -1, 1, 3) },
                    AbilityEffects           = new[] { new DamageEffect(RoudnhouseDamageEffectParameters) },
                    CanBeCountered           = true,
                    CanCounterAttack         = false,
                };
                var abilityRoundhouse = new Ability(this, abilityDataRoundhouse);
                Abilities.Add(abilityRoundhouse);



                var danceAbilityEffect = new RefreshActionEffect();

                var abilityDataDance = new AbilityData()
                {
                    IDName                   = "DANCER_Dance",
                    FriendlyName             = "Dance",
                    FriendlyDescription      = "Grant an ally another action",
                    AbilityCategory          = AbilityCategory.Special,
                    WeaponCategory           = WeaponAdvantageCategory.None,
                    RangeDistanceRule        = AbilityRangeDistanceRule.SizeRangeSmall,
                    RangeSpecialRule         = AbilityRangeSpecialRule.None,
                    MinRange                 = 1,
                    MaxRange                 = 3,
                    ActionConsumption        = AbilityActionConsumption.MajorAction,
                    MinorActionConsumptionID = String.Empty,
                    HPCost                   = 0,
                    SPCost                   = 2,
                    DurabilityCost           = 0,
                    Accuracy                 = 100,
                    SkipAccuracyCheck        = true,
                    TargetRule               = AbilityTargetRule.AlliesOnly,
                    AreaPoints               = new[] { new MapPoint(0, 0, 1, 1) },
                    AbilityEffects           = new[] { danceAbilityEffect },
                    CanBeCountered           = false,
                    CanCounterAttack         = false,
                };
                var abilityDance = new Ability(this, abilityDataDance);
                Abilities.Add(abilityDance);
            }
            else
            {
                var cannonFireDamageEffectParameters = new DamageEffectParameters();
                cannonFireDamageEffectParameters.DamagePairs = new[] { new DamageEffectPairParameter {
                                                                           OffensiveAttribute = UnitAttribute.Physical, OffensiveAttributeMultiplier = 1, DefensiveAttribute = UnitAttribute.Defense, DefensiveAttributeMultiplier = 1
                                                                       } };

                var abilityDataTankShot = new AbilityData()
                {
                    IDName                   = "TANK_SHOT",
                    FriendlyName             = "Cannon Fire",
                    FriendlyDescription      = "Not canon fire",
                    AbilityCategory          = AbilityCategory.Attack,
                    WeaponCategory           = WeaponAdvantageCategory.Weapon,
                    RangeDistanceRule        = AbilityRangeDistanceRule.Basic,
                    RangeSpecialRule         = AbilityRangeSpecialRule.None,
                    MinRange                 = 1,
                    MaxRange                 = 3,
                    ActionConsumption        = AbilityActionConsumption.MajorAction,
                    MinorActionConsumptionID = String.Empty,
                    HPCost                   = 0,
                    SPCost                   = 0,
                    DurabilityCost           = 0,
                    RepeatCount              = 2,
                    Accuracy                 = 90,
                    TargetRule               = AbilityTargetRule.EnemiesOnly,
                    AreaPoints               = new[] { new MapPoint(0, 0, 1, 1) },
                    AbilityEffects           = new[] { new DamageEffect(cannonFireDamageEffectParameters) },
                    CanBeCountered           = true,
                    CanCounterAttack         = true,
                };
                var abilityTankShot = new Ability(this, abilityDataTankShot);
                Abilities.Add(abilityTankShot);
            }
        }