Exemplo n.º 1
0
 public static Party getParty(AbilityTargetType type)
 {
     if (type.Equals(AbilityTargetType.ENEMY))
     {
         return(enemies);
     }
     return(heroes);
 }
Exemplo n.º 2
0
        protected InvokableAbility(string unlocalizedName, string displayName,
                                   AbilityType abilityType, AbilityTargetType abilityTargetType, AbilityTargetFaction abilityTargetUnitFaction, AbilityTargetUnitType abilityTargetUnitType,
                                   DamageType damageType, float baseCastRange = -1) :

            base(UNLOCALIZED_NAME_PREFIX + unlocalizedName, displayName,
                 abilityType, abilityTargetType, abilityTargetUnitFaction, abilityTargetUnitType,
                 damageType, AbilitySlot.Optional,
                 0, 1, false, baseCastRange, false)
        {
        }
Exemplo n.º 3
0
 public void ActivatePanel(ActorAbility ability)
 {
     if (ability != null && ability.abilityBase.isSoulAbility)
     {
         currentSoulAbility = ability;
         currentTarget      = null;
         targetType         = ability.abilityBase.targetType;
         this.gameObject.SetActive(true);
         nameText.text = "Target an " + LocalizationManager.Instance.GetLocalizationText(targetType) + " for " + currentSoulAbility.abilityBase.LocalizedName;
         useButton.GetComponentInChildren <TextMeshProUGUI>().text = "No Target";
         useButton.interactable = false;
     }
     else
     {
         this.gameObject.SetActive(false);
     }
 }
Exemplo n.º 4
0
    public string GetLocalizationText(AbilityTargetType targetType)
    {
        string stringId = "targetType." + targetType.ToString();

        if (commonLocalizationData.TryGetValue(stringId, out string value))
        {
            if (value == "")
            {
                return(stringId);
            }
            return(value);
        }
        else
        {
            return(stringId);
        }
    }
Exemplo n.º 5
0
        protected override void copyExtendedProperties(ItemModel sourceItemModel)
        {
            AbilityItemModel abilityItemModel = sourceItemModel as AbilityItemModel;

            if (abilityItemModel == null)
            {
                throw new InvalidCastException("Invalid type.");
            }
            AbilityEffectType    = abilityItemModel.AbilityEffectType;
            AbilityTargetType    = abilityItemModel.AbilityTargetType;
            AbilityDurationType  = abilityItemModel.AbilityDurationType;
            CastTurns            = abilityItemModel.CastTurns;
            CoolDownTurns        = abilityItemModel.CoolDownTurns;
            CoolDownTurnsElapsed = abilityItemModel.CoolDownTurnsElapsed;
            ImmediateAmout       = abilityItemModel.ImmediateAmout;
            IsSpellBased         = abilityItemModel.IsSpellBased;

            if (AbilityDurationType == AbilityDurationType.MultiTurn)
            {
                AbilityDurationData = abilityItemModel.AbilityDurationData.Clone(false);
            }
        }
Exemplo n.º 6
0
        public AbilityItemModel(int ID, string name, string description, RarityType rarityType, int stackedCount, int level,
                                AbilityEffectType abilityEffectType, AbilityTargetType abilityTargetType, AbilityDurationType abilityDurationType,
                                int castTurns, int coolDownTurns, int immediateAmount, bool isSpellBased, int perTickAmount, int turnsPerTick, int maxTicks) : base(ID, name, description, level, rarityType, stackedCount)
        {
            this.AbilityEffectType   = abilityEffectType;
            this.AbilityTargetType   = abilityTargetType;
            this.AbilityDurationType = abilityDurationType;
            this.CastTurns           = castTurns;
            this.CoolDownTurns       = coolDownTurns;
            this.ImmediateAmout      = immediateAmount;
            this.IsSpellBased        = isSpellBased;

            if (abilityDurationType == AbilityDurationType.MultiTurn)
            {
                this.AbilityDurationData = new AbilityDurationData();
                this.AbilityDurationData.OriginAbilityID   = ID;
                this.AbilityDurationData.PerTickAmount     = perTickAmount;
                this.AbilityDurationData.TurnsPerTick      = turnsPerTick;
                this.AbilityDurationData.MaxTicks          = maxTicks;
                this.AbilityDurationData.AbilityEffectType = abilityEffectType;
                this.AbilityDurationData.AbilityTargetType = abilityTargetType;
            }
        }
Exemplo n.º 7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="unlocalizedName"></param>
        /// <param name="displayName"></param>
        /// <param name="abilityType"></param>
        /// <param name="abilityTargetType"></param>
        /// <param name="abilityTargetUnitFaction"></param>
        /// <param name="damageType"></param>
        /// <param name="abilitySlot"></param>
        /// <param name="unlockableAtLevel">At what level can the player start leveling this ability. A level of 0 means the player starts with the ability.</param>
        /// <param name="maxLevel">The maximum level that this ability can be leveled up to.</param>
        /// <param name="alwaysShowInAbilitesBar"></param>
        /// <param name="baseCastRange">The maximum distance between the target point and the player.</param>
        /// <param name="affectsTotalAbilityLevelCount">Should this ability contribute towards the total levels spent on abilities count.</param>
        protected AbilityDefinition(string unlocalizedName, string displayName, AbilityType abilityType, AbilityTargetType abilityTargetType, AbilityTargetFaction abilityTargetUnitFaction, AbilityTargetUnitType abilityTargetUnitType, DamageType damageType, AbilitySlot abilitySlot, int unlockableAtLevel, int maxLevel, bool alwaysShowInAbilitesBar = true, float baseCastRange = -1, bool affectsTotalAbilityLevelCount = true, DispelType baseDispelType = DispelType.None)
        {
            UnlocalizedName = unlocalizedName;
            DisplayName     = displayName;

            AbilityType              = abilityType;
            AbilityTargetType        = abilityTargetType;
            AbilityTargetUnitFaction = abilityTargetUnitFaction;
            AbilityTargetUnitType    = abilityTargetUnitType;

            DamageType = damageType;

            AbilitySlot = abilitySlot;

            UnlockableAtLevel = unlockableAtLevel;
            MaxLevel          = maxLevel;

            AlwaysShowInAbilitiesBar = alwaysShowInAbilitesBar;

            BaseCastRange = baseCastRange;
            AffectsTotalAbilityLevelCount = affectsTotalAbilityLevelCount;

            BaseDispelType = baseDispelType;
        }
Exemplo n.º 8
0
 public CastedAbility(string name, string description, int cost, int coolDown, int duration, int castRange, AbilityTargetType type)
     : base(name, description, cost, coolDown, duration)
 {
     CastRange  = castRange;
     TargetType = type;
 }
Exemplo n.º 9
0
 public Party(AbilityTargetType ally, AbilityTargetType enemy)
 {
     this.ally  = ally;
     this.enemy = enemy;
 }
Exemplo n.º 10
0
 public void setAlly(AbilityTargetType ally)
 {
     partyList.ForEach(person => person.GetComponent <PersonController>().person.ally = ally);
 }
Exemplo n.º 11
0
 public void setEnemy(AbilityTargetType enemy)
 {
     partyList.ForEach(person => person.GetComponent <PersonController>().person.enemy = enemy);
 }