Пример #1
0
 public Ability(EAbilityType type, float cooldownDuration = 30f, float abilityEffectMultiplier = 1.5f, float abilityDuration = 5f)
 {
     AbilityEffect           = type;
     CooldownDuration        = cooldownDuration;
     AbilityEffectMultiplier = abilityEffectMultiplier;
     AbilityDuration         = abilityDuration;
 }
Пример #2
0
 // Start is called before the first frame update
 void Start()
 {
     targetSpot         = ability.targetSpot;
     abilityName        = ability.abilityName;
     abilityType        = ability.abilityType;
     abilityActions     = ability.abilityActions;
     areaOfEffect       = ability.areaOfEffect;
     icon               = ability.icon;
     particleEffect     = ability.particleEffect;
     description        = ability.description;
     damage             = ability.damage;
     heal               = ability.heal;
     buff               = ability.buff;
     debuff             = ability.debuff;
     creatureAttributes = ability.creatureAttributes;
     targetCreatures    = ability.targetCreatures;
     damageType         = ability.damageType;
 }
Пример #3
0
        public bool Deserialize(JSON_AbilityParam json)
        {
            if (json == null)
            {
                return(false);
            }
            this.iname    = json.iname;
            this.name     = json.name;
            this.expr     = json.expr;
            this.icon     = json.icon;
            this.type     = (EAbilityType)json.type;
            this.slot     = (EAbilitySlot)json.slot;
            this.lvcap    = (OInt)Math.Max(json.cap, 1);
            this.is_fixed = json.fix != 0;
            int length = 0;

            string[] strArray = new string[10]
            {
                json.skl1,
                json.skl2,
                json.skl3,
                json.skl4,
                json.skl5,
                json.skl6,
                json.skl7,
                json.skl8,
                json.skl9,
                json.skl10
            };
            for (int index = 0; index < strArray.Length && !string.IsNullOrEmpty(strArray[index]); ++index)
            {
                ++length;
            }
            if (length > 0)
            {
                int[] numArray = new int[10]
                {
                    json.lv1,
                    json.lv2,
                    json.lv3,
                    json.lv4,
                    json.lv5,
                    json.lv6,
                    json.lv7,
                    json.lv8,
                    json.lv9,
                    json.lv10
                };
                this.skills = new LearningSkill[length];
                for (int index = 0; index < length; ++index)
                {
                    this.skills[index]        = new LearningSkill();
                    this.skills[index].iname  = strArray[index];
                    this.skills[index].locklv = numArray[index];
                }
            }
            this.condition_units = (string[])null;
            if (json.units != null && json.units.Length > 0)
            {
                this.condition_units = new string[json.units.Length];
                for (int index = 0; index < json.units.Length; ++index)
                {
                    this.condition_units[index] = json.units[index];
                }
            }
            this.condition_jobs = (string[])null;
            if (json.jobs != null && json.jobs.Length > 0)
            {
                this.condition_jobs = new string[json.jobs.Length];
                for (int index = 0; index < json.jobs.Length; ++index)
                {
                    this.condition_jobs[index] = json.jobs[index];
                }
            }
            this.condition_birth   = json.birth;
            this.condition_sex     = (ESex)json.sex;
            this.condition_element = (EElement)json.elem;
            this.condition_raremin = (OInt)json.rmin;
            this.condition_raremax = (OInt)json.rmax;
            return(true);
        }
Пример #4
0
 public bool AbilityIsActive(EAbilityType type) =>
 Abilities.ContainsKey(type) && Abilities[type].IsActive();
Пример #5
0
 public bool UseAbility(EAbilityType type) =>
 Abilities.ContainsKey(type) && Abilities[type].Activate();
Пример #6
0
 public bool CanUseAbility(EAbilityType type) =>
 Abilities.ContainsKey(type) && Abilities[type].IsReady();