Example #1
0
    public override void UseSkill(BJCreatureObject user, BJCreatureObject mainTarget)
    {
        base.UseSkill(user, mainTarget);
        CurrentUser       = user;
        CurrentMainTarget = mainTarget;

        List <BJCreatureObject> ourCreatureObjects = (CurrentUser.Creature.Allegiance == Allegiance.Player) ? BJGameController.Instance.PlayerCreatureObjects : BJGameController.Instance.EnemyCreatureObjects;
        List <BJCreatureObject> secondaryTargets   = new List <BJCreatureObject> ();

        foreach (var creatureObject in ourCreatureObjects)
        {
            if (creatureObject != user && TargetPriorities.ContainsKey(ourCreatureObjects.IndexOf(creatureObject)) && creatureObject.Creature.HP > 0)
            {
                secondaryTargets.Add(creatureObject);
            }
        }
        Effects [0].Applier = user;
        mainTarget.ApplyEffect(Effects [0], true);
        foreach (var secondaryTarget in secondaryTargets)
        {
            Effects [0].Applier = user;
            secondaryTarget.ApplyEffect(Effects [0], true);
        }
        StartCoroutine(FinishSkill(0.1f));
    }
Example #2
0
    // public BJEffect ArmorBuffEffect;

    public override void UseSkill(BJCreatureObject user, BJCreatureObject mainTarget)
    {
        base.UseSkill(user, mainTarget);
        CurrentUser       = user;
        CurrentMainTarget = mainTarget;

        List <BJCreatureObject> ourCreatureObjects = (CurrentUser.Creature.Allegiance == Allegiance.Player) ? BJGameController.Instance.PlayerCreatureObjects : BJGameController.Instance.EnemyCreatureObjects;
        List <BJCreatureObject> secondaryTargets   = new List <BJCreatureObject> ();

        foreach (var creatureObject in ourCreatureObjects)
        {
            if (creatureObject != user && TargetPriorities.ContainsKey(ourCreatureObjects.IndexOf(creatureObject)) && creatureObject.Creature.HP > 0)
            {
                secondaryTargets.Add(creatureObject);
            }
        }

        foreach (var secondaryTarget in secondaryTargets)
        {
            foreach (var skill in secondaryTarget.Skills)
            {
                if (!skill.IsPassive)
                {
                    skill.CurrentCooldown = Mathf.Max(0, skill.CurrentCooldown - 1);
                }
            }
        }
        StartCoroutine(FinishSkill(0.1f));
    }