Example #1
0
        public static BigAbility SetupBigAbility(Table AbilityTable,
                                                 string abilityName,
                                                 string texturePath,
                                                 List <string> researchRequirements,
                                                 int maxLevel,
                                                 int abilityCastRange,
                                                 float abilityCooldown,
                                                 int abilityManaCost,
                                                 AbilityProperties.AbilityBehaviorEnum abilityBehavior,
                                                 AbilityProperties.AbilityTypeEnum abilityType,
                                                 AbilityProperties.AbilityUnitTargetTeamEnum abilityUnitTargetTeam,
                                                 AbilityProperties.AbilityUnitTargetTypeEnum abilityUnitTargetType,
                                                 AbilityProperties.AbilityUnitDamageTypeEnum abilityUnitDamageType)
        {
            if (bigAbilities.ContainsKey(abilityName))
            {
                return(bigAbilities[abilityName]);
            }

            var bigAbil = new BigAbility(AbilityTable,
                                         texturePath,
                                         researchRequirements,
                                         maxLevel,
                                         abilityCastRange,
                                         abilityCooldown,
                                         abilityManaCost,
                                         abilityBehavior,
                                         abilityType,
                                         abilityUnitTargetTeam,
                                         abilityUnitTargetType,
                                         abilityUnitDamageType);

            return(bigAbil);
        }
Example #2
0
        public BigAbility(
            Table AbilityTable,
            string texturePath,
            List <string> researchRequirements,
            int maxLevel,
            int abilityCastRange,
            float abilityCooldown,
            int abilityManaCost,
            AbilityProperties.AbilityBehaviorEnum abilityBehavior,
            AbilityProperties.AbilityTypeEnum abilityType,
            AbilityProperties.AbilityUnitTargetTeamEnum abilityUnitTargetTeam,
            AbilityProperties.AbilityUnitTargetTypeEnum abilityUnitTargetType,
            AbilityProperties.AbilityUnitDamageTypeEnum abilityUnitDamageType)
        {
            this.texturePath     = texturePath;
            ResearchRequirements = researchRequirements;
            MaxLevel             = maxLevel;

            AbilityCastRange      = abilityCastRange;
            AbilityCooldown       = abilityCooldown;
            AbilityManaCost       = abilityManaCost;
            AbilityBehavior       = abilityBehavior;
            AbilityType           = abilityType;
            AbilityUnitTargetTeam = abilityUnitTargetTeam;
            AbilityUnitTargetType = abilityUnitTargetType;
            AbilityUnitDamageType = abilityUnitDamageType;

            eventsPreset  = LuaAbilitiesGetter.GetEventsPreset(AbilityTable);
            modifierTable = LuaAbilitiesGetter.GetAbilityModifiersTable(AbilityTable);
        }
Example #3
0
        public Ability(Table AbilityTable,
                       string abilityName,
                       string texturePath,
                       List <string> researchRequirements,
                       int maxLevel,
                       int abilityCastRange,
                       float abilityCooldown,
                       int abilityManaCost,
                       AbilityProperties.AbilityBehaviorEnum abilityBehavior,
                       AbilityProperties.AbilityTypeEnum abilityType,
                       AbilityProperties.AbilityUnitTargetTeamEnum abilityUnitTargetTeam,
                       AbilityProperties.AbilityUnitTargetTypeEnum abilityUnitTargetType,
                       AbilityProperties.AbilityUnitDamageTypeEnum abilityUnitDamageType)
        {
            abilityID = lastID;
            lastID++;
            this.abilityName = abilityName;
            CurrentCooldown  = 0f;
            PostCurrent      = -1f;

            onOwnerSpawnedEventName = abilityName + "_OnOwnerSpawned";
            onSpellStartEventName   = abilityName + "_OnSpellStart";

            eventTable = DynValue.NewTable(LuaManager.ScriptObj).Table;
            var specials = LuaAbilitiesGetter.GetSpecials(AbilityTable);


            abilitySpecial = specials
                             .Select(c => new { c.Key, value = c.Value + " " })
                             .ToDictionary(x => x.Key, x => x.value);

            upgradedAbilitySpecial = abilitySpecial.ToDictionary(x => x.Key, x => x.Value);

            vars = DynValue.NewTable(LuaManager.ScriptObj).Table;

            parentBigAbility = BigAbilityManager.SetupBigAbility(AbilityTable,
                                                                 abilityName,
                                                                 texturePath,
                                                                 researchRequirements,
                                                                 maxLevel,
                                                                 abilityCastRange,
                                                                 abilityCooldown,
                                                                 abilityManaCost,
                                                                 abilityBehavior,
                                                                 abilityType,
                                                                 abilityUnitTargetTeam,
                                                                 abilityUnitTargetType,
                                                                 abilityUnitDamageType);
        }