Exemple #1
0
 public void Danger()
 {
     if (CurrentEntityType != SkillBehaviourType.FuriousAttack && CurrentEntityType < SkillBehaviourType.DefendAttack)
     {
         if (behaviour < GeneralSkillType.Defend)
         {
             behaviour = GeneralSkillType.Defend;
         }
         CurrentEntityType = SkillBehaviourType.DefendAttack;
     }
 }
Exemple #2
0
        public void AdjustBehaviourOnCurrentSkillType()
        {
            switch (skillType)
            {
            case SkillType.Buff:
                behaviourType = SkillBehaviourType.Stick;
                break;

            case SkillType.MeleeAttack:
            case SkillType.Projectile:
                break;
            }
        }
Exemple #3
0
 public void NoWay()
 {
     if (UnityEngine.Random.Range(0, 100) < 50)
     {
         if (behaviour >= GeneralSkillType.Control)
         {
             behaviour = GeneralSkillType.Buff;
         }
         SituationSkill = SkillBehaviourType.FuriousAttack;
     }
     else
     {
         SituationSkill = SkillBehaviourType.DeefDefend;
     }
 }
Exemple #4
0
 public void InitializeSkill(UnitBaseBehaviourComponent newOwner, SkillType type, TargetType target, SpawnSkillType newSpawnType, SkillBehaviourType newBehaviorType)
 {
     owner         = newOwner;
     skillType     = type;
     behaviourType = newBehaviorType;
     spawnType     = newSpawnType;
     skillEffect.SetNetAmount(owner);
     targetType = target;
     if (targetType == TargetType.Self)
     {
         ActivateSkill(owner);
     }
     if (skillType == SkillType.Projectile)
     {
         transform.rotation = owner.transform.rotation;
         activate           = true;
     }
     else if (skillType == SkillType.TargetProjectile)
     {
         startAiming = true;
     }
 }
Exemple #5
0
    // Start is called before the first frame update
    void Start()
    {
        slider                   = GetComponentInChildren <Slider>(true);
        behaviour                = GeneralSkillType.TargetAttack;
        StartEntityType          = SkillBehaviourType.Attack;
        CurrentEntityType        = StartEntityType;
        SituationSkill           = CurrentEntityType;
        MinBehaviour             = SkillBehaviourType.RunAway;
        slider.maxValue          = MaxHP;
        this.MaxHPChangeTrigger += (y) =>
        {
            float x = (float)y;
            slider.maxValue = x;
        };
        this.HPChangeTrigger += (y) =>
        {
            float x = (float)y;
            slider.value = x;
        };
        this.MPChangeTrigger += (y) => {
            float x = (float)y;
            if (x / this.MaxMP >= 0.8)
            {
                ManaSkillFilter = SkillParameterType.Large;
                return;
            }
            if (x / this.MaxMP >= 0.4)
            {
                ManaSkillFilter = SkillParameterType.Avarage;
                return;
            }
            if (x / this.MaxMP >= 0.1)
            {
                ManaSkillFilter = SkillParameterType.Litle;
                return;
            }
            ManaSkillFilter = SkillParameterType.None;
        };
        this.STChangeTrigger += (y) => {
            float x = (float)y;
            if (x / this.MaxST >= 0.8)
            {
                StaminaSkillFilter = SkillParameterType.Large;
                return;
            }
            if (x / this.MaxST >= 0.4)
            {
                StaminaSkillFilter = SkillParameterType.Avarage;
                return;
            }
            if (x / this.MaxST >= 0.1)
            {
                StaminaSkillFilter = SkillParameterType.Litle;
                return;
            }
            StaminaSkillFilter = SkillParameterType.None;
        };
        this.SPChangeTrigger += (y) => {
            float x = (float)y;
            if (x / this.MaxSP >= 0.8)
            {
                SoulSkillFilter = SkillParameterType.Large;
                return;
            }
            if (x / this.MaxSP >= 0.4)
            {
                SoulSkillFilter = SkillParameterType.Avarage;
                return;
            }
            if (x / this.MaxSP >= 0.1)
            {
                SoulSkillFilter = SkillParameterType.Litle;
                return;
            }
            SoulSkillFilter = SkillParameterType.None;
        };
        this.HPChangeTrigger += (y) =>
        {
            float x = (float)y;
            if (x / MaxHP <= 0.5)
            {
                if (behaviour < GeneralSkillType.Heal)
                {
                    behaviour = GeneralSkillType.Heal;
                }
            }
            if (x / MaxHP >= 0.9)
            {
                if (behaviour == GeneralSkillType.Heal)
                {
                    behaviour = GeneralSkillType.TargetAttack;
                }
                if (StartEntityType == SkillBehaviourType.FuriousAttack && SituationSkill == SkillBehaviourType.Attack)
                {
                    SituationSkill = SkillBehaviourType.FuriousAttack;
                    return;
                }
            }
            if (x / MaxHP >= 0.5)
            {
                if (StartEntityType > SkillBehaviourType.Attack)
                {
                    SituationSkill = SkillBehaviourType.Attack;
                    return;
                }
            }
            if (x / MaxHP >= 0.3)
            {
                if (StartEntityType > SkillBehaviourType.DefendAttack)
                {
                    SituationSkill = SkillBehaviourType.DefendAttack;
                    return;
                }
            }
            if (x / MaxHP >= 0.1)
            {
                if (StartEntityType > SkillBehaviourType.DefendAttack)
                {
                    SituationSkill = SkillBehaviourType.DeefDefend;
                    return;
                }
            }

            SituationSkill = SkillBehaviourType.RunAway;
        };
        this.MaxHP = 200;
        this.MaxMP = 200;
        this.MaxSP = 200;
        this.MaxST = 200;
        //StatsBar.SetMaxParams(this.MaxHP, 100, MaxST, 100, 100, MaxMP, MaxSP);
        this.HP            = MaxHP;
        this.MP            = MaxMP;
        this.ST            = MaxST;
        this.SP            = MaxSP;
        this.RegSpeedHP    = 3;
        this.RegSpeedMP    = 3;
        this.RegSpeedSP    = 3;
        this.RegSpeedST    = 3;
        this.SumBaseDamage = 5;
        this.MagResist     = 1;
        this.PhysResist    = 1;
        this.SoulResist    = 1;
        this.Speed         = 1;

        ChangeTargetTimeout = 10;
        loader.LoadSkills();
        Skills = new List <Skill>();
        Skills.Add(loader.Skills[0]);
        Skills.Add(loader.Skills[1]);
        Skills.Add(loader.Skills[2]);
        Skills.Add(loader.Skills[3]);


        StartCoroutine(Regeneration(1));
        StartCoroutine(TargetChanger());
        //Debug.LogWarning(loader.Skils.Count);
    }
Exemple #6
0
    public void NewTarget(MyObject trgt)
    {
        Creature target = trgt.GetComponent <Creature>();

        if (target == null)
        {
            return;
        }
        float Chance = UnityEngine.Random.Range(0, 100);

        Chance += (int)StartEntityType * 3;
        Debug.Log("My chance  " + Chance);
        if (Targets.Count == 3)
        {
            Debug.Log("HHHEEEEYYY_______12345678");
            if (Chance == 115)
            {
                CurrentEntityType = SkillBehaviourType.FuriousAttack;
            }
            else if (Chance >= 110)
            {
                CurrentEntityType = SkillBehaviourType.RunAway;
            }
            else
            {
                CurrentEntityType--;
            }
        }
        if (Targets.Count == 5)
        {
            if (Chance >= 110)
            {
                CurrentEntityType = SkillBehaviourType.FuriousAttack;
            }
            else if (Chance >= 90)
            {
                CurrentEntityType = SkillBehaviourType.RunAway;
            }
            else
            {
                CurrentEntityType--;
            }
        }
        if (Targets.Count == 10)
        {
            if (Chance >= 50)
            {
                CurrentEntityType = SkillBehaviourType.RunAway;
            }
            else if (Chance >= 25)
            {
                CurrentEntityType = SkillBehaviourType.FuriousAttack;
            }
            else
            {
                CurrentEntityType = SkillBehaviourType.DeefDefend;
            }
        }
        if (CurrentEntityType == SkillBehaviourType.FuriousAttack)
        {
            Debug.Log("Heyy");
            return;
        }
        float Power = CheckEnemy(target);

        Debug.Log("Enemy power:  " + Power);
        if (Power > 500)
        {
            if (Chance > 110)
            {
                CurrentEntityType = SkillBehaviourType.DeefDefend;
            }
            else
            {
                CurrentEntityType = SkillBehaviourType.RunAway;
            }
            return;
        }
        if (Power > 250)
        {
            if (Chance > 80)
            {
                CurrentEntityType = SkillBehaviourType.DeefDefend;
            }
            else if (Chance > 10)
            {
                CurrentEntityType = SkillBehaviourType.RunAway;
            }
            else
            {
                CurrentEntityType--;
            }
            return;
        }
        if (Power > 100)
        {
            return;
        }
        if (Power < 100)
        {
            SituationSkill++;
            CurrentEntityType++;
            return;
        }
    }