예제 #1
0
    public void Discount()
    {
        switch (tier)
        {
        case 1:
            Datamanager.i().curscore++;
            spawner.GetComponent <Enemyspawner>().goldmin += 10;
            break;

        case 2:
            Datamanager.i().curscore += 5;
            spawner.GetComponent <Enemyspawner>().goldmin += 50;
            break;

        case 3:
            Datamanager.i().curscore += 10;
            spawner.GetComponent <Enemyspawner>().goldmin += 90;
            break;
        }
        spawner.GetComponent <Enemyspawner>().e--;
        if (spawner.GetComponent <Enemyspawner>().e <= 0)
        {
            spawner.GetComponent <Enemyspawner>().rewards.SetActive(true);
            int rang = Random.Range(spawner.GetComponent <Enemyspawner>().goldmin, spawner.GetComponent <Enemyspawner>().goldmin + 20);
            spawner.GetComponent <Enemyspawner>().rewards.GetComponent <Rewards>().Addreward("gold", rang);
            Rewardcard();
            Rewardt();
        }
        gameObject.SetActive(false);
    }
예제 #2
0
    int Settextval(string eft, int val)
    {
        int v = 0;

        switch (eft)
        {
        case "atk":
            if (Datamanager.i().w == true)
            {
                v = (int)((val + Datamanager.i().str) * 0.75f);
            }
            else
            {
                v = (val + Datamanager.i().str);
            }
            break;

        case "def":
            v = val + Datamanager.i().agi;
            break;

        default:
            v = val;
            break;
        }
        return(v);
    }
예제 #3
0
 public void Gototitle()
 {
     PlayerPrefs.SetInt("character", 0);
     PlayerPrefs.SetInt("job", 0);
     Datamanager.i().stage   = 0;
     Datamanager.i().shd     = 0;
     Datamanager.i().str     = 0;
     Datamanager.i().agi     = 0;
     Datamanager.i().maxmana = 3;
     Datamanager.i().insnum  = 0;
     Datamanager.i().ins     = false;
     Datamanager.i().genamr  = false;
     Datamanager.i().gennum  = 0;
     Datamanager.i().r       = false;
     Datamanager.i().rnum    = 0;
     Datamanager.i().w       = false;
     Datamanager.i().wnum    = 0;
     Datamanager.i().l       = false;
     Datamanager.i().lnum    = 0;
     Datamanager.i().d       = false;
     Datamanager.i().dnum    = 0;
     Datamanager.i().b       = false;
     Datamanager.i().bnum    = 0;
     Deckmanager.instance().Removedeck();
     SceneManager.LoadScene("1_Title");
     Datamanager.i().curscore = 0;
 }
예제 #4
0
 private void Update()
 {
     hplabel.text = Datamanager.i().curhp + " / " + Datamanager.i().maxhp;
     hpbar.value  = ((float)Datamanager.i().curhp / (float)Datamanager.i().maxhp);
     gameover.GetComponentInChildren <UILabel>().text = "YOU DIED\nYOUR SCORE\n" + Datamanager.i().curscore;
     manalabel.text = Datamanager.i().curmana + "  /  " + Datamanager.i().inmaxmana;
 }
예제 #5
0
 public void Callmap()
 {
     if (Datamanager.i().stage % 10 == 0)
     {
         Admanager.instance().ShowRewardedAd();
     }
     SceneManager.LoadScene("2_Map");
 }
예제 #6
0
 void Update()
 {
     hp.text    = Datamanager.i().curhp + " / " + Datamanager.i().maxhp;
     floor.text = "" + Datamanager.i().stage;
     gold.text  = "" + Datamanager.i().gold;
     power.text = "" + Itemmanager.instance().Returnstack("Power ring");
     armor.text = "" + Itemmanager.instance().Returnstack("Orichalcon");
     mana.text  = "" + Itemmanager.instance().Returnstack("Mana ring");
 }
예제 #7
0
    void Deffence(int val)
    {
        int dam = val + Datamanager.i().agi;

        if (dam < 0)
        {
            dam = 0;
        }
        Datamanager.i().shd += dam;
    }
예제 #8
0
 public void Camp()
 {
     Datamanager.i().curhp += (int)(Datamanager.i().maxhp * 0.3f);
     if (Datamanager.i().curhp >= Datamanager.i().maxhp)
     {
         Datamanager.i().curhp = Datamanager.i().maxhp;
     }
     gotomap.SetActive(true);
     gameObject.SetActive(false);
 }
예제 #9
0
 public void Save()
 {
     PlayerPrefs.SetInt("stage", Datamanager.i().stage);
     PlayerPrefs.SetInt("gold", Datamanager.i().gold);
     PlayerPrefs.SetInt("hp", Datamanager.i().curhp);
     PlayerPrefs.SetInt("score", Datamanager.i().curscore);
     PlayerPrefs.SetInt("job", PlayerPrefs.GetInt("character"));
     Datamanager.i().next = GameObject.Find("Nextstair").GetComponent <Nextstair>().j;
     PlayerPrefs.SetString("deck", GameObject.Find("Nextstair").GetComponent <Nextstair>().Convertcard());
     PlayerPrefs.SetString("item", Itemmanager.instance().Convertitem());
     Application.Quit();
 }
예제 #10
0
    void Start()
    {
        Effectsound.instance().bgm.clip = Effectsound.instance().bgmlist[2];
        Effectsound.instance().bgm.Play();
        cha = GameObject.Find("Character");
        switch (PlayerPrefs.GetInt("character"))
        {
        case 1:
            cha.GetComponent <UISprite>().spriteName = "warbattle";
            break;

        case 2:
            cha.GetComponent <UISprite>().spriteName = "wizbattle";
            break;
        }
        ori = cha.transform.localPosition;
        te  = false;
        uc  = false;
        if (Itemmanager.instance().inven.Count != 0)
        {
            for (int i = 0; i < Itemmanager.instance().inven.Count; i++)
            {
                string e = Itemmanager.instance().inven[i].GetComponent <Iteminfo>().eft;
                switch (e)
                {
                case "str":
                    Datamanager.i().str++;
                    break;

                case "agi":
                    Datamanager.i().agi++;
                    break;

                case "maxmana":
                    Datamanager.i().maxmana++;
                    break;

                case "maxhp":
                    break;
                }
            }
        }
        gameover.SetActive(false);
        h       = GameObject.Find("Hand");
        gy      = GameObject.Find("Graveyard");
        spawner = GameObject.Find("Enemyspawner");
        elist.Add(spawner.GetComponent <Enemyspawner>().slot1.gameObject);
        elist.Add(spawner.GetComponent <Enemyspawner>().slot2.gameObject);
        elist.Add(spawner.GetComponent <Enemyspawner>().slot3.gameObject);
        turn = true;
        Datamanager.i().inmaxmana = Datamanager.i().maxmana;
    }
예제 #11
0
    void Attack(int val)
    {
        Atkmove();
        float weakf = 1.0f;

        if (w == true)
        {
            weakf = .75f;
        }
        else
        {
            weakf = 1;
        }
        float lockonf = 1;

        if (Datamanager.i().l == true)
        {
            lockonf = 1.5f;
        }
        else
        {
            lockonf = 1;
        }
        int dam = (int)((val + str) * weakf * lockonf);

        Datamanager.i().shd -= dam;
        player.Hitmove();
        if (Datamanager.i().shd < 0)
        {
            Datamanager.i().curhp += Datamanager.i().shd;
            Datamanager.i().shd    = 0;
        }
        if (Datamanager.i().curhp <= 0)
        {
            player.gameover.SetActive(true);
        }
        if (Datamanager.i().r == true)
        {
            shd -= Datamanager.i().rnum;
            if (shd < 0)
            {
                ehp += shd;
                shd  = 0;
            }
            if (ehp < 0)
            {
                Discount();
            }
        }
    }
예제 #12
0
 public void Selwarrior()
 {
     waron = true;
     if (waron == true)
     {
         wizon   = false;
         selchar = 1;
         Datamanager.i().curhp   = 120;
         Datamanager.i().maxhp   = 120;
         Datamanager.i().gold    = 90;
         Datamanager.i().maxmana = 3;
         character.spriteName = "warsel";
     }
 }
예제 #13
0
    public void Itemcreate(int num)
    {
        GameObject i = Instantiate(item);

        i.transform.parent        = transform;
        i.transform.localPosition = Vector3.zero;
        i.transform.localScale    = new Vector3(1, 1, 1);
        inven.Add(i);
        Itemstat(num, i);
        if (i.GetComponent <Iteminfo>().eft == "maxhp")
        {
            Datamanager.i().maxhp += 7;
        }
    }
예제 #14
0
 public void Selwizard()
 {
     wizon = true;
     if (wizon == true)
     {
         waron   = false;
         selchar = 2;
         Datamanager.i().curhp   = 100;
         Datamanager.i().maxhp   = 100;
         Datamanager.i().gold    = 120;
         Datamanager.i().maxmana = 3;
         character.spriteName = "wizsel";
     }
 }
예제 #15
0
 void Ccdown()
 {
     if (Datamanager.i().genamr == true)
     {
         Datamanager.i().shd += Datamanager.i().gennum;
     }
     if (Datamanager.i().r == true)
     {
         Datamanager.i().r = false;
     }
     if (Datamanager.i().w == true)
     {
         Datamanager.i().wnum--;
         if (Datamanager.i().wnum == 0)
         {
             Datamanager.i().w = false;
         }
     }
     if (Datamanager.i().l == true)
     {
         Datamanager.i().lnum--;
         if (Datamanager.i().lnum == 0)
         {
             Datamanager.i().l = false;
         }
     }
     if (Datamanager.i().d == true)
     {
         Datamanager.i().dnum--;
         Datamanager.i().curhp -= 2;
         if (Datamanager.i().curhp <= 0)
         {
             Datamanager.i().curhp = 1;
         }
         if (Datamanager.i().dnum == 0)
         {
             Datamanager.i().w = false;
         }
     }
     if (Datamanager.i().ins == true)
     {
         Datamanager.i().ins  = false;
         Datamanager.i().str -= Datamanager.i().insnum;
     }
 }
예제 #16
0
    public int Returnval(string p, int num)
    {
        float weakf = 1.0f;

        if (w == true)
        {
            weakf = .75f;
        }
        else
        {
            weakf = 1;
        }
        float lockonf = 1;

        if (Datamanager.i().l == true)
        {
            lockonf = 1.5f;
        }
        else
        {
            lockonf = 1;
        }
        int dam = (int)((num + str) * weakf * lockonf);

        switch (p)
        {
        default:
            return(0);

        case "atk":
            return(dam);

        case "carboom":
            return(dam);

        case "lifedrain":
            return(dam);

        case "deathblade":
            return(dam);

        case "def":
            return(num);
        }
    }
예제 #17
0
 public void Buycard(GameObject card)
 {
     if (Application.loadedLevelName != "Store")
     {
         return;
     }
     if (card.GetComponent <Cardstat>().gold > Datamanager.i().gold)
     {
         return;
     }
     card.transform.parent = Deckmanager.instance().gameObject.transform;
     Deckmanager.instance().orideck.Add(card);
     card.transform.localScale    = new Vector3(1, 1, 1);
     card.transform.localPosition = Vector3.zero;
     Datamanager.i().gold -= card.GetComponent <Cardstat>().gold;
     goldlabel.enabled = false;
     card.SetActive(false);
 }
예제 #18
0
 public void Buyitem()
 {
     if (gold > Datamanager.i().gold)
     {
         return;
     }
     transform.parent = Itemmanager.instance().gameObject.transform;
     Itemmanager.instance().inven.Add(gameObject);
     if (eft == "maxhp")
     {
         Datamanager.i().maxhp += 7;
     }
     transform.localScale    = new Vector3(1, 1, 1);
     transform.localPosition = Vector3.zero;
     Datamanager.i().gold -= gold;
     GetComponent <BoxCollider>().enabled       = false;
     GetComponentInChildren <UILabel>().enabled = false;
 }
예제 #19
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);
    }
예제 #20
0
    IEnumerator Startturn()
    {
        for (int i = 0; i < 5; i++)
        {
            yield return(StartCoroutine(Drawmotion()));
        }
        Datamanager.i().curmana = Datamanager.i().inmaxmana;
        if (Datamanager.i().b == true)
        {
            Datamanager.i().curmana--;
            Datamanager.i().bnum--;
            if (Datamanager.i().bnum == 0)
            {
                Datamanager.i().b = false;
            }
        }
        Player p = GameObject.Find("Player").GetComponent <Player>();

        p.te = false;
    }
예제 #21
0
 public void Takedone()
 {
     Datamanager.i().shd     = 0;
     Datamanager.i().str     = 0;
     Datamanager.i().agi     = 0;
     Datamanager.i().maxmana = 3;
     Datamanager.i().insnum  = 0;
     Datamanager.i().ins     = false;
     Datamanager.i().genamr  = false;
     Datamanager.i().gennum  = 0;
     Datamanager.i().r       = false;
     Datamanager.i().rnum    = 0;
     Datamanager.i().w       = false;
     Datamanager.i().wnum    = 0;
     Datamanager.i().l       = false;
     Datamanager.i().lnum    = 0;
     Datamanager.i().d       = false;
     Datamanager.i().dnum    = 0;
     Datamanager.i().b       = false;
     Datamanager.i().bnum    = 0;
     GameObject.Find("Gotomap").GetComponent <Backtomap>().Callmap();
 }
예제 #22
0
    void Start()
    {
        switch (PlayerPrefs.GetInt("character"))
        {
        case 1:
            back.GetComponent <UISprite>().spriteName = "warback";
            break;

        case 2:
            back.GetComponent <UISprite>().spriteName = "wizback";
            break;
        }
        i = Random.Range(0, 100);
        if (i >= 0 && i < 70)
        {
            j = 0;
        }
        if (i >= 70 && i < 80)
        {
            j = 1;
        }
        if (i >= 80 && i < 95)
        {
            j = 2;
        }
        if (i >= 95 && i < 100)
        {
            j = 3;
        }
        if (Datamanager.i().save == true)
        {
            j = Datamanager.i().next;
            Datamanager.i().save = false;
        }
        Effectsound.instance().bgm.clip = Effectsound.instance().bgmlist[1];
        Effectsound.instance().bgm.Play();
        Copydeck();
        Closelist();
    }
예제 #23
0
    public void Next()
    {
        Returndeck();
        Datamanager.i().curscore++;
        Datamanager.i().stage++;
        if (Datamanager.i().stage % 10 == 1)
        {
            SceneManager.LoadScene("Battle");
            return;
        }
        if (Datamanager.i().stage % 10 == 5)
        {
            SceneManager.LoadScene("Treasure");
            return;
        }
        if (Datamanager.i().stage % 10 == 0)
        {
            SceneManager.LoadScene("Rest");
            return;
        }
        switch (j)
        {
        case 0:
            SceneManager.LoadScene("Battle");
            break;

        case 1:
            SceneManager.LoadScene("Rest");
            break;

        case 2:
            SceneManager.LoadScene("Store");
            break;

        case 3:
            SceneManager.LoadScene("Treasure");
            break;
        }
    }
예제 #24
0
    IEnumerator Reading()
    {
        if (p.GetComponent <Player>().turn == false)
        {
            yield break;
        }
        if (Datamanager.i().curmana < GetComponent <Cardstat>().mana)
        {
            yield break;
        }
        if (GetComponent <Cardstat>().target == true)
        {
            while (spawner.GetComponent <Enemyspawner>().target == null)
            {
                yield return(null);
            }
        }
        Datamanager.i().curmana -= GetComponent <Cardstat>().mana;
        yield return(StartCoroutine(Cardeffect(GetComponent <Cardstat>().eft1, GetComponent <Cardstat>().val1)));

        yield return(StartCoroutine(Cardeffect(GetComponent <Cardstat>().eft2, GetComponent <Cardstat>().val2)));

        spawner.GetComponent <Enemyspawner>().Targetunlock();
        gy.GetComponent <Gyard>().gylist.Add(gameObject);
        transform.parent = gy.GetComponentInChildren <UIGrid>().transform;
        if (GetComponent <Cardstat>().ex == false)
        {
            StartCoroutine(Gogy());
        }
        else
        {
            StartCoroutine(Extinc());
        }
        h.GetComponentInChildren <UIGrid>().enabled = true;
        h.GetComponent <Hand>().handlist.Remove(gameObject);
        p.GetComponent <Player>().uc = false;
    }
예제 #25
0
 public void SendBoardScore()
 {
     Social.Active.ReportScore(Datamanager.i().curscore, "CgkIqdPV8NIREAIQAg", (bool success) =>
     {
         if (success == true)
         {
             Datamanager.i().stage   = 0;
             Datamanager.i().shd     = 0;
             Datamanager.i().str     = 0;
             Datamanager.i().agi     = 0;
             Datamanager.i().maxmana = 3;
             Datamanager.i().insnum  = 0;
             Datamanager.i().ins     = false;
             Datamanager.i().genamr  = false;
             Datamanager.i().gennum  = 0;
             Datamanager.i().r       = false;
             Datamanager.i().rnum    = 0;
             Datamanager.i().w       = false;
             Datamanager.i().wnum    = 0;
             Datamanager.i().l       = false;
             Datamanager.i().lnum    = 0;
             Datamanager.i().d       = false;
             Datamanager.i().dnum    = 0;
             Datamanager.i().b       = false;
             Datamanager.i().bnum    = 0;
             Deckmanager.instance().Removedeck();
             Datamanager.i().curscore = 0;
             ShowLeaderBoard();
             Itemmanager.instance().Removeinven();
             SceneManager.LoadScene("1_Title");
         }
         else
         {
         }
     });
 }
예제 #26
0
    public void Loadgame()
    {
        PlayerPrefs.SetInt("character", PlayerPrefs.GetInt("job"));
        switch (PlayerPrefs.GetInt("character"))
        {
        case 1:
            Datamanager.i().maxhp = 120;
            break;

        case 2:
            Datamanager.i().maxhp = 100;
            break;
        }
        Datamanager.i().stage    = PlayerPrefs.GetInt("stage");
        Datamanager.i().gold     = PlayerPrefs.GetInt("gold");
        Datamanager.i().curhp    = PlayerPrefs.GetInt("hp");
        Datamanager.i().curscore = PlayerPrefs.GetInt("score");
        Datamanager.i().maxmana  = 3;
        Datamanager.i().save     = true;
        Deckmanager.instance().Loaddeck();
        Itemmanager.instance().Loaditem();
        PlayerPrefs.SetInt("job", 0);
        SceneManager.LoadScene(2);
    }
예제 #27
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());
    }
예제 #28
0
 public void Showcc()
 {
     if (Datamanager.i().str != 0)
     {
         strl.gameObject.SetActive(true);
         strl.text = "Your character power is " + Datamanager.i().str;
     }
     else
     {
         strl.gameObject.SetActive(false);
     }
     if (Datamanager.i().genamr == true)
     {
         genl.gameObject.SetActive(true);
         genl.text = "Gain " + Datamanager.i().gennum + "armor for each turn";
     }
     else
     {
         genl.gameObject.SetActive(false);
     }
     if (Datamanager.i().w == true)
     {
         weakl.gameObject.SetActive(true);
         weakl.text = "Deal 75% damage during " + Datamanager.i().wnum + "turn";
     }
     else
     {
         weakl.gameObject.SetActive(false);
     }
     if (Datamanager.i().l == true)
     {
         lockonl.gameObject.SetActive(true);
         lockonl.text = "Receives 150% damage during " + Datamanager.i().lnum + "turn";
     }
     else
     {
         lockonl.gameObject.SetActive(false);
     }
     if (Datamanager.i().d == true)
     {
         dotl.gameObject.SetActive(true);
         dotl.text = "Receive 2 damage at the end of turn during " + Datamanager.i().dnum + "turn";
     }
     else
     {
         dotl.gameObject.SetActive(false);
     }
     if (Datamanager.i().r == true)
     {
         refl.gameObject.SetActive(true);
         refl.text = "Reflect damage of " + Datamanager.i().rnum + "during this turn";
     }
     else
     {
         refl.gameObject.SetActive(false);
     }
     if (Datamanager.i().ins == true)
     {
         insl.gameObject.SetActive(true);
         insl.text = "Get " + Datamanager.i().insnum + "power during this turn";
     }
     else
     {
         insl.gameObject.SetActive(false);
     }
     pgrid.gameObject.SetActive(true);
     printer.SetActive(true);
 }
예제 #29
0
 private void Update()
 {
     if (Datamanager.i().shd > 0)
     {
         shd.SetActive(true);
         shdl.text = Datamanager.i().shd + "";
     }
     else
     {
         shd.SetActive(false);
         shdl.text = "";
     }
     if (Datamanager.i().str != 0)
     {
         str.SetActive(true);
     }
     else
     {
         str.SetActive(false);
     }
     if (Datamanager.i().genamr == true)
     {
         gen.SetActive(true);
     }
     else
     {
         gen.SetActive(false);
     }
     if (Datamanager.i().w == true)
     {
         weak.SetActive(true);
     }
     else
     {
         weak.SetActive(false);
     }
     if (Datamanager.i().l == true)
     {
         lockon.SetActive(true);
     }
     else
     {
         lockon.SetActive(false);
     }
     if (Datamanager.i().d == true)
     {
         dot.SetActive(true);
     }
     else
     {
         dot.SetActive(false);
     }
     if (Datamanager.i().r == true)
     {
         reflect.SetActive(true);
     }
     else
     {
         reflect.SetActive(false);
     }
     if (Datamanager.i().ins == true)
     {
         ins.SetActive(true);
     }
     else
     {
         ins.SetActive(false);
     }
     icon.enabled = true;
 }
예제 #30
0
    void Attack(int val)
    {
        float weakf = 1.0f;

        if (Datamanager.i().w == true)
        {
            weakf = .75f;
        }
        else
        {
            weakf = 1;
        }
        float lockonf = 1;

        int dam = (val + Datamanager.i().str);

        if (dam < 0)
        {
            dam = 0;
        }
        if (spawner.GetComponent <Enemyspawner>().target == null)
        {
            for (int i = 0; i < 3; i++)
            {
                if (elist[i].activeSelf == true)
                {
                    if (elist[i].GetComponent <Enemy>().l == true)
                    {
                        lockonf = 1.5f;
                    }
                    else
                    {
                        lockonf = 1;
                    }
                    dam = (int)(dam * weakf * lockonf);
                    print(dam);
                    elist[i].GetComponent <Enemy>().shd -= dam;
                    if (elist[i].GetComponent <Enemy>().shd < 0)
                    {
                        elist[i].GetComponent <Enemy>().ehp += elist[i].GetComponent <Enemy>().shd;
                        elist[i].GetComponent <Enemy>().shd  = 0;
                    }
                    elist[i].GetComponent <Enemy>().Hitmove();
                    if (elist[i].GetComponent <Enemy>().ehp <= 0)
                    {
                        elist[i].GetComponent <Enemy>().Discount();
                    }
                }
            }
        }
        else
        {
            if (spawner.GetComponent <Enemyspawner>().target.activeSelf == true)
            {
                if (spawner.GetComponent <Enemyspawner>().target.GetComponent <Enemy>().l == true)
                {
                    lockonf = 1.5f;
                }
                else
                {
                    lockonf = 1;
                }
                dam = (int)(dam * weakf * lockonf);
                spawner.GetComponent <Enemyspawner>().target.GetComponent <Enemy>().shd -= dam;
                if (spawner.GetComponent <Enemyspawner>().target.GetComponent <Enemy>().shd < 0)
                {
                    spawner.GetComponent <Enemyspawner>().target.GetComponent <Enemy>().ehp += spawner.GetComponent <Enemyspawner>().target.GetComponent <Enemy>().shd;
                    spawner.GetComponent <Enemyspawner>().target.GetComponent <Enemy>().shd  = 0;
                }
                spawner.GetComponent <Enemyspawner>().target.GetComponent <Enemy>().Hitmove();
                if (spawner.GetComponent <Enemyspawner>().target.GetComponent <Enemy>().ehp <= 0)
                {
                    spawner.GetComponent <Enemyspawner>().target.GetComponent <Enemy>().Discount();
                }
            }
        }
    }