Ejemplo n.º 1
0
 public void Acceptbtn()
 {
     Effectmanager.i().Startsfx(36);
     Deckmanager.instance().Plus(target);
     for (int i = reinlist.Count - 1; i > -1; i--)
     {
         Deckmanager.instance().orideck.Add(reinlist[i]);
         reinlist[i].transform.parent        = Deckmanager.instance().gameObject.transform;
         reinlist[i].transform.localScale    = new Vector3(1, 1, 1);
         reinlist[i].transform.localPosition = Vector3.zero;
         reinlist[i].SetActive(false);
         reinlist.Remove(reinlist[i]);
     }
     yesno.SetActive(false);
     cardlist.SetActive(false);
     gameObject.SetActive(false);
 }
Ejemplo n.º 2
0
    void Randomtarget(int num)
    {
        int k = Random.Range(0, elist.Count);

        if (elist[k].activeSelf == false)
        {
            Randomtarget(num);
            return;
        }
        else
        {
            spawner.GetComponent <Enemyspawner>().target = elist[k];
        }
        Attack(num);
        Effectmanager.i().eftpos = spawner.GetComponent <Enemyspawner>().target;
        Effectmanager.i().Starteft(8);
        Effectmanager.i().Startsfx(9);
        spawner.GetComponent <Enemyspawner>().target = null;
    }
Ejemplo n.º 3
0
    public void Onclick()
    {
        switch (gameObject.name)
        {
        case "gold":
            Datamanager.i().gold += val;
            Effectmanager.i().Startsfx(35);
            break;

        case "card":
            Deckmanager.instance().Createcard(val);
            break;

        case "treasure":
            Itemmanager.instance().Itemcreate(val);
            break;
        }
        gameObject.SetActive(false);
    }
Ejemplo n.º 4
0
    IEnumerator Cardeffect(string eft, int val)
    {
        switch (eft)
        {
        case "atk":
            StartCoroutine(Attackmove());
            switch (GetComponent <Cardstat>().cname)
            {
            case "hit":
                Effectmanager.i().eftpos = p;
                Effectmanager.i().Starteft(23);
                Effectmanager.i().Startsfx(2);
                break;

            case "staff swing":
                Effectmanager.i().eftpos = p;
                Effectmanager.i().Starteft(23);
                Effectmanager.i().Startsfx(2);
                break;

            case "smash":
                Effectmanager.i().eftpos = spawner.GetComponent <Enemyspawner>().target;
                Effectmanager.i().Starteft(18);
                Effectmanager.i().Startsfx(2);
                break;

            case "stab":
                Effectmanager.i().eftpos = spawner.GetComponent <Enemyspawner>().target;
                Effectmanager.i().Starteft(2);
                Effectmanager.i().Startsfx(1);
                break;

            case "bash":
                Effectmanager.i().eftpos = spawner.GetComponent <Enemyspawner>().target;
                Effectmanager.i().Starteft(27);
                Effectmanager.i().Startsfx(0);
                break;

            case "headbutt":
                Effectmanager.i().eftpos = spawner.GetComponent <Enemyspawner>().target;
                Effectmanager.i().Starteft(30);
                Effectmanager.i().Startsfx(2);
                break;

            case "weapon breaker":
                Effectmanager.i().eftpos = spawner.GetComponent <Enemyspawner>().target;
                Effectmanager.i().Starteft(29);
                Effectmanager.i().Startsfx(4);
                break;

            case "armor breaker":
                Effectmanager.i().eftpos = spawner.GetComponent <Enemyspawner>().target;
                Effectmanager.i().Starteft(28);
                Effectmanager.i().Startsfx(4);
                break;

            case "wind cutter":
                Effectmanager.i().eftpos = spawner.GetComponent <Enemyspawner>().target;
                Effectmanager.i().Starteft(24);
                Effectmanager.i().Startsfx(13);
                break;

            case "ice bolt":
                Effectmanager.i().eftpos = p;
                GameObject ice           = Effectmanager.i().Starteft(6);
                ice.GetComponentInChildren <TweenPosition>().to = spawner.GetComponent <Enemyspawner>().target.transform.localPosition + new Vector3(100, 50, 0);
                ice.GetComponentInChildren <UITweener>().PlayForward();
                yield return(new WaitForSeconds(1));

                Effectmanager.i().Startsfx(10);
                break;

            case "lightning shock":
                Effectmanager.i().eftpos = p;
                GameObject shock         = Effectmanager.i().Starteft(7);
                shock.GetComponentInChildren <TweenPosition>().to = spawner.GetComponent <Enemyspawner>().target.transform.localPosition + new Vector3(100, 50, 0);
                shock.GetComponentInChildren <UITweener>().PlayForward();
                yield return(new WaitForSeconds(1));

                Effectmanager.i().Startsfx(18);
                break;

            case "magic arrow":
                Effectmanager.i().eftpos = p;
                GameObject arrow         = Effectmanager.i().Starteft(26);
                arrow.GetComponentInChildren <TweenPosition>().to = spawner.GetComponent <Enemyspawner>().target.transform.localPosition + new Vector3(100, 50, 0);
                arrow.GetComponentInChildren <UITweener>().PlayForward();
                yield return(new WaitForSeconds(1));

                Effectmanager.i().Startsfx(11);
                break;

            case "lightnova":
                Effectmanager.i().eftpos = elist[1];
                Effectmanager.i().Starteft(15);
                Effectmanager.i().Startsfx(20);
                break;

            case "meteor fall":
                Effectmanager.i().eftpos = spawner.GetComponent <Enemyspawner>().target;
                Effectmanager.i().Starteft(3);
                yield return(new WaitForSeconds(0.5f));

                Effectmanager.i().eftpos = spawner.GetComponent <Enemyspawner>().target;
                Effectmanager.i().Starteft(16);
                Effectmanager.i().Startsfx(19);
                break;
            }
            Attack(val);
            break;

        case "def":
            Deffence(val);
            Effectmanager.i().eftpos = p;
            Effectmanager.i().Starteft(19);
            Effectmanager.i().Startsfx(22);
            break;

        case "bringarmor":
            Attack(Datamanager.i().shd);
            Effectmanager.i().eftpos = spawner.GetComponent <Enemyspawner>().target;
            Effectmanager.i().Starteft(1);
            Effectmanager.i().Startsfx(2);
            break;

        case "allin":
            for (int i = 0; i < Datamanager.i().curmana; i++)
            {
                Attack(val);
                Effectmanager.i().eftpos = p;
                Effectmanager.i().Starteft(23);
                Effectmanager.i().Startsfx(0);
            }
            Datamanager.i().curmana = 0;
            break;

        case "genamr":
            Datamanager.i().genamr   = true;
            Datamanager.i().gennum   = val;
            Effectmanager.i().eftpos = p;
            Effectmanager.i().Starteft(17);
            Effectmanager.i().Startsfx(3);
            break;

        case "str":
            Datamanager.i().str     += val;
            Effectmanager.i().eftpos = p;
            switch (PlayerPrefs.GetInt("character"))
            {
            case 1:
                Effectmanager.i().Starteft(10);
                Effectmanager.i().Startsfx(6);
                break;

            case 2:
                Effectmanager.i().Starteft(9);
                Effectmanager.i().Startsfx(21);
                break;
            }
            break;

        case "mana":
            Datamanager.i().curmana += val;
            Effectmanager.i().eftpos = p;
            Effectmanager.i().Starteft(9);
            Effectmanager.i().Startsfx(5);
            break;

        case "heal":
            Datamanager.i().curhp   += val;
            Effectmanager.i().eftpos = p;
            Effectmanager.i().Starteft(14);
            Effectmanager.i().Startsfx(25);
            break;

        case "lockon":
            if (spawner.GetComponent <Enemyspawner>().target == null)
            {
                for (int i = 0; i < 3; i++)
                {
                    if (elist[i].activeSelf == true)
                    {
                        elist[i].GetComponent <Enemy>().l     = true;
                        elist[i].GetComponent <Enemy>().lnum += val;
                    }
                }
            }
            else
            {
                spawner.GetComponent <Enemyspawner>().target.GetComponent <Enemy>().l     = true;
                spawner.GetComponent <Enemyspawner>().target.GetComponent <Enemy>().lnum += val;
            }
            break;

        case "stun":
            if (GetComponent <Cardstat>().val1 == 0)
            {
                break;
            }
            else
            {
                int j = Random.Range(0, 100);
                if (j >= 20 && j < 40)
                {
                    spawner.GetComponent <Enemyspawner>().target.GetComponent <Enemy>().s            = true;
                    spawner.GetComponent <Enemyspawner>().target.GetComponent <Enemy>().patstat.text = "stun";
                    spawner.GetComponent <Enemyspawner>().target.GetComponent <Enemy>().p            = 3;
                    Effectmanager.i().eftpos = spawner.GetComponent <Enemyspawner>().target;
                    GameObject stunstar      = Effectmanager.i().Starteft(21);
                    stunstar.transform.parent = spawner.GetComponent <Enemyspawner>().target.transform;
                    print("stun sucsses");
                }
                else
                {
                    print("stun fail");
                }
                break;
            }

        case "draw":
            deck.Drawing(val);
            if (GetComponent <Cardstat>().cname == "use scroll")
            {
                Effectmanager.i().Startsfx(14);
            }
            break;

        case "weak":
            if (spawner.GetComponent <Enemyspawner>().target == null)
            {
                for (int i = 0; i < 3; i++)
                {
                    if (elist[i].activeSelf == true)
                    {
                        elist[i].GetComponent <Enemy>().w     = true;
                        elist[i].GetComponent <Enemy>().wnum += val;
                    }
                }
            }
            else
            {
                spawner.GetComponent <Enemyspawner>().target.GetComponent <Enemy>().w     = true;
                spawner.GetComponent <Enemyspawner>().target.GetComponent <Enemy>().wnum += val;
            }
            break;

        case "rebound":
            Datamanager.i().curhp   -= val;
            Effectmanager.i().eftpos = p;
            Effectmanager.i().Starteft(0);
            break;

        case "bringstr":
            Effectmanager.i().eftpos = spawner.GetComponent <Enemyspawner>().target;
            switch (GetComponent <Cardstat>().cname)
            {
            case "aura blade":
                Effectmanager.i().Starteft(12);
                for (int i = 0; i < val; i++)
                {
                    Attack((Datamanager.i().str + 1) * 5);
                    Effectmanager.i().Startsfx(7);
                }
                break;

            case "powerword kill":
                Effectmanager.i().Starteft(11);
                for (int i = 0; i < val; i++)
                {
                    Attack((Datamanager.i().str + 1) * 5);
                    Effectmanager.i().Startsfx(12);
                }
                break;
            }
            break;

        case "random":
            for (int i = 0; i < Datamanager.i().curmana; i++)
            {
                Randomtarget(val);
            }
            Datamanager.i().curmana = 0;
            break;

        case "manaup":
            Datamanager.i().inmaxmana += val;
            Effectmanager.i().eftpos   = p;
            Effectmanager.i().Starteft(13);
            Effectmanager.i().Startsfx(15);
            break;

        case "dot":
            spawner.GetComponent <Enemyspawner>().target.GetComponent <Enemy>().d     = true;
            spawner.GetComponent <Enemyspawner>().target.GetComponent <Enemy>().dnum += val;
            break;

        case "reflect":
            Datamanager.i().r        = true;
            Datamanager.i().rnum     = val;
            Effectmanager.i().eftpos = p;
            Effectmanager.i().Starteft(5);
            Effectmanager.i().Startsfx(16);
            break;

        case "instant":
            Datamanager.i().ins      = true;
            Datamanager.i().insnum   = val;
            Datamanager.i().str     += Datamanager.i().insnum;
            Effectmanager.i().eftpos = p;
            Effectmanager.i().Starteft(22);
            Effectmanager.i().Startsfx(17);
            break;

        case null:
            break;
        }
        yield return(new WaitForEndOfFrame());
    }
Ejemplo n.º 5
0
    IEnumerator Pateffect(string pat, int val)
    {
        switch (pat)
        {
        case "atk":
            Effectmanager.i().eeftpos = gameObject;
            Effectmanager.i().Starteeft(0);
            Effectmanager.i().Startsfx(2);
            Attack(val);
            break;

        case "def":
            Effectmanager.i().eeftpos = gameObject;
            Effectmanager.i().Starteeft(1);
            Effectmanager.i().Startsfx(22);
            shd += val;
            break;

        case "weak":
            Effectmanager.i().eeftpos = player.gameObject;
            Effectmanager.i().Starteeft(14);
            Effectmanager.i().Startsfx(23);
            Datamanager.i().w     = true;
            Datamanager.i().wnum += val;
            break;

        case "lockon":
            Effectmanager.i().eeftpos = player.gameObject;
            Effectmanager.i().Starteeft(15);
            Effectmanager.i().Startsfx(24);
            Datamanager.i().l     = true;
            Datamanager.i().lnum += val;
            break;

        case "burnmana":
            Effectmanager.i().eeftpos = player.gameObject;
            Effectmanager.i().Starteeft(2);
            Effectmanager.i().Startsfx(27);
            Datamanager.i().b     = true;
            Datamanager.i().bnum += val;
            break;

        case "str":
            Effectmanager.i().eeftpos = gameObject;
            Effectmanager.i().Starteeft(3);
            Effectmanager.i().Startsfx(21);
            str += val;
            break;

        case "carboom":
            Effectmanager.i().eeftpos = player.gameObject;
            Effectmanager.i().Starteeft(4);
            Effectmanager.i().Startsfx(28);
            Attack(val);
            ehp = 0;
            Discount();
            break;

        case "bind":
            Effectmanager.i().eeftpos = player.gameObject;
            Effectmanager.i().Starteeft(5);
            Effectmanager.i().Startsfx(26);
            Datamanager.i().str--;
            break;

        case "devour":
            Effectmanager.i().eeftpos = gameObject;
            Effectmanager.i().Starteeft(6);
            Effectmanager.i().Startsfx(30);
            Effectmanager.i().Startsfx(35);
            Datamanager.i().gold -= Random.Range(8, 13);
            if (Datamanager.i().gold < 0)
            {
                Datamanager.i().gold = 0;
            }
            break;

        case "dot":
            Effectmanager.i().eeftpos = player.gameObject;
            Effectmanager.i().Starteeft(13);
            Effectmanager.i().Startsfx(31);
            Datamanager.i().d     = true;
            Datamanager.i().dnum += val;
            break;

        case "heal":
            Effectmanager.i().eeftpos = gameObject;
            Effectmanager.i().Starteeft(7);
            Effectmanager.i().Startsfx(25);
            ehp += val;
            if (ehp > maxhp)
            {
                ehp = maxhp;
            }
            break;

        case "charm":
            Effectmanager.i().eeftpos = player.gameObject;
            Effectmanager.i().Starteeft(8);
            Effectmanager.i().Startsfx(29);
            Datamanager.i().str--;
            Datamanager.i().agi--;
            break;

        case "lifedrain":
            Effectmanager.i().eeftpos = gameObject;
            Effectmanager.i().Starteeft(9);
            Effectmanager.i().Startsfx(32);
            Attack(val);
            ehp += 3;
            if (ehp > maxhp)
            {
                ehp = maxhp;
            }
            break;

        case "summon":
            List <UISprite> elist = new List <UISprite>();
            elist.Add(spawner.GetComponent <Enemyspawner>().slot1);
            elist.Add(spawner.GetComponent <Enemyspawner>().slot2);
            elist.Add(spawner.GetComponent <Enemyspawner>().slot3);
            for (int i = 0; i < 3; i++)
            {
                if (elist[i].gameObject.activeSelf == false)
                {
                    Effectmanager.i().eeftpos = elist[i].gameObject;
                    Effectmanager.i().Starteeft(10);
                    Effectmanager.i().Startsfx(33);
                    spawner.GetComponent <Enemyspawner>().Givemstat(elist[i].gameObject, 4);
                    elist[i].GetComponent <TweenPosition>().to = elist[i].gameObject.transform.localPosition;
                    elist[i].GetComponent <Enemy>().p          = 4;
                    elist[i].gameObject.SetActive(true);
                    spawner.GetComponent <Enemyspawner>().e++;
                    break;
                }
            }
            break;

        case "deathblade":
            Effectmanager.i().eeftpos = player.gameObject;
            Effectmanager.i().Starteeft(11);
            Effectmanager.i().Startsfx(34);
            Attack(val);
            Datamanager.i().d     = true;
            Datamanager.i().dnum += 2;
            Datamanager.i().w     = true;
            Datamanager.i().wnum += 2;
            Datamanager.i().l     = true;
            Datamanager.i().lnum += 2;
            break;

        case "stay":
            Effectmanager.i().eeftpos = gameObject;
            Effectmanager.i().Starteeft(12);
            print("stay");
            break;

        case "stun":
            s = false;
            Destroy(GetComponentInChildren <ParticleSystem>().gameObject);
            break;
        }
        yield return(new WaitForEndOfFrame());
    }