Пример #1
0
 void DoArtisticStuff()
 {
     GetComponent <AnimController>().Cast();
     PlayAbilitySound();
     CreateVFXOn(transform, transform.rotation);
     PassiveAbility_Buff.AddBuff(gameObject, 2, 0, 0, 0, 0, true, "WarriorWallBuff", vfx, 3f, false, false, false);
 }
Пример #2
0
    IEnumerator WideSwing()
    {
        CreateVFXOn(transform, BasicVFX.transform.rotation);
        myUnit.GetComponent <UnitMovement>().LookAtTheTarget(Target.transform.position, 0 /*myUnit.GetComponentInChildren<BodyTrigger>().RotationInAttack*/);
        GetComponent <AnimController>().SpecialAttack();
        Log.SpawnLog("Fencer uses Wide Swing, swinging his blade recklessly around him");
        //LOGIC
        UnitScript Enemy = Target.myUnit;

        // Hit for Target
        HitForSwing(Enemy);
        foreach (Tile neighbour in myUnit.myTile.GetNeighbours())
        {
            if (neighbour.myUnit != null && Enemy.myTile.GetNeighbours().Contains(neighbour))
            {
                HitForSwing(neighbour.myUnit);
            }
        }
        // for mutual neighbours.
        // add debuff
        PassiveAbility_Buff.AddBuff(gameObject, 2, 0, -myUnit.CurrentDefence, 0, 0, true, "FencerDebuff", null, 0, false, true, false);
        myUnit.hasAttacked = true;
        yield return(null);

        FinishUsing();
    }
Пример #3
0
    IEnumerator Root()
    {
        Log.SpawnLog("Raven empowers his shot with 'Frost' spell, disabling all the " + Target.myUnit.name + "'s actions for next turn");
        yield return(null);

        FinishUsing();
        PassiveAbility_Buff.AddBuff(Target.myUnit.gameObject, 2, 0, 0, 0, 0, true, "FrozenDebuff", DebuffVfx, 3f, true, true, false);
    }
Пример #4
0
 void CheckForBonus(int tileCount)
 {
     if (tileCount == myUnit.GetComponent <UnitMovement>().GetCurrentMoveSpeed(true) && myUnit.CheckIfIsInCombat())
     {
         PassiveAbility_Buff.AddBuff(myUnit.gameObject, 1, AttackBuff, 0, 0, 0, true, "BKBuff", null, 0, false, false, false);
         Log.SpawnLog(myUnit.name + " gets charging bonus!");
     }
 }
Пример #5
0
    IEnumerator DoBuffVFX(PassiveAbility_Buff theBuff, float delay, GameObject target, GameObject vfx)
    {
        yield return(new WaitForSeconds(delay));

        if (vfx != null)
        {
            theBuff.vfx = Instantiate(vfx, target.transform.position, vfx.transform.rotation, target.transform);
        }
    }
Пример #6
0
    IEnumerator DefensiveStance()
    {
        yield return(null);

        FinishUsing();
        myMovement.CanMove = false;
        myUnit.hasAttacked = true;
        PlayAbilitySound();
        CreateVFXOn(transform, BasicVFX.transform.rotation);
        GetComponent <AnimController>().Cast();
        PassiveAbility_Buff.AddBuff(gameObject, 2, 0, 2, 0, 0, true, "SwordmanBuff", vfx, 3f, false, false, true);
    }
Пример #7
0
    IEnumerator DoOtherWolfStuff(UnitScript wolf)
    {
        Log.SpawnLog("Nearby wolf gets affected by a powerfull Howl!");
        wolf.GetComponent <AnimController>().Cast();
        PassiveAbility_Buff.AddBuff(wolf.gameObject, Duration, AttackBuff, DefenceBuff, 0, wolf.baseQuitCombatPercent, true, "WolfBuff", BuffVFX, 0, false, false, false);
        GameObject vfx1 = CreateVFXOn(wolf.transform, BasicVFX.transform.rotation);

        yield return(new WaitForSeconds(6));

        if (Application.isEditor)
        {
            DestroyImmediate(vfx1);
        }
        else
        {
            Destroy(vfx1);
        }
    }
Пример #8
0
    public static void AddBuff(GameObject target, int Time, int Attack, int Defence, int MS, int QCP, bool canRetal, string buffIconName, GameObject vfx, float delayForVFX, bool _IsFrozen, bool _IsNegative, bool doesGettingHitRemove)
    {
        PassiveAbility_Buff theBuff = target.AddComponent <PassiveAbility_Buff>();

        if (buffIconName != string.Empty)
        {
            theBuff.HasIcon = true;
        }
        theBuff.AbilityIconName           = buffIconName;
        theBuff.AttackBuffValue           = Attack;
        theBuff.DefenceBuffValue          = Defence;
        theBuff.MovementBuffValue         = MS;
        theBuff.QuitCombatChanceBuffValue = QCP;
        theBuff.BuffDuration          = Time;
        theBuff.IsFrozen              = _IsFrozen;
        theBuff.isNegative            = _IsNegative;
        theBuff.CanRetal              = canRetal;
        theBuff.IsRemovedByGettingHit = doesGettingHitRemove;
        theBuff.DoBuff();
        theBuff.StartCoroutine(theBuff.DoBuffVFX(theBuff, delayForVFX, target, vfx));
    }
Пример #9
0
    IEnumerator BuffAlly(UnitScript ally)
    {
        Log.SpawnLog(myUnit.name + " empowers " + ally.name + ", giving a +2 bonus to Attack and Defence till next turn");
        PlayAbilitySound();
        GameObject vfx1 = CreateVFXOn(ally.transform, BasicVFX.transform.rotation);

        GetComponent <AnimController>().Cast();
        PassiveAbility_Buff.AddBuff(ally.gameObject, 2, 2, 2, 0, 100, true, "IGBuff", BuffVFX, 0, false, false, false);
        yield return(null);

        FinishUsing();
        yield return(new WaitForSeconds(15));

        if (Application.isEditor)
        {
            DestroyImmediate(vfx1);
        }
        else
        {
            Destroy(vfx1);
        }
    }
Пример #10
0
    IEnumerator Throw()
    {
        myUnit.GetComponent <UnitMovement>().LookAtTheTarget(Target.transform.position, 60);
        GetComponent <AnimController>().Cast();

        /* var temp = Instantiate(Dagger, daggerSpawn.position, Dagger.transform.rotation);
         * temp.GetComponent<ProjectileScript>().Target = Target.transform.position;*/
        //LaunchDagger(Target.transform.position, speed);
        Target.myUnit.DealDamage(Damage + myUnit.CurrentAttack - Target.myUnit.CurrentDefence, true, false, false);
        PassiveAbility_Buff.AddBuff(Target.myUnit.gameObject, 2, 0, -2, -2, -100, false, "AssassinDebuff", vfx, 0, false, true, false);
        PopupTextController.AddParalelPopupText("-" + (Damage - Target.myUnit.CurrentDefence), PopupTypes.Damage);
        Log.SpawnLog("Assassin throws a deadly dagger at " + Target.myUnit.name + ", dealing " + (Damage - Target.myUnit.CurrentDefence) + " damage.");


        //Animate the shit
        // do actual logic
        yield return(null);

        FinishUsing();
        yield return(new WaitForSeconds(1.0f));

        CreateVFXOn(Target.transform, BasicVFX.transform.rotation);
    }
Пример #11
0
 void Debuff(UnitScript target)
 {
     Log.SpawnLog(target.name + " gets hit by arrows, receiving a -1 Defence penalty");
     PassiveAbility_Buff.AddBuff(target.gameObject, 2, 0, -1, 0, 100, true, "HailOfArrowsDebuff", BasicVFX, 0, false, true, false);
 }