コード例 #1
0
    public void setDupeMessage(DogStatsConfig dogToShow)
    {
        int    refund;
        Rarity dogRarity = dogToShow.dogRarity;

        switch (dogRarity)
        {
        case Rarity.rare:
            refund = 10;
            break;

        case Rarity.superRare:
            refund = 25;
            break;

        case Rarity.superDuperRare:
            refund = 50;
            break;

        case Rarity ultraRare:
            refund = 75;
            break;
        }
        myPlayer.changeBones(refund);
        dupeMessage.text = "Duplicate Dog Summoned\n (+ " + refund.ToString() + " bones)";
    }
コード例 #2
0
 public void onTeamPanel(DogStatsConfig dogToShow)
 {
     removeGameObject.SetActive(true);
     addGameObject.SetActive(false);
     dupeGameObject.SetActive(false);
     showPanel(dogToShow);
 }
コード例 #3
0
 public void dupePanel(DogStatsConfig dogToShow)
 {
     Debug.Log("dupliate panel being built");
     setDupeMessage(dogToShow);
     removeGameObject.SetActive(false);
     addGameObject.SetActive(false);
     dupeGameObject.SetActive(true);
     showPanel(dogToShow);
 }
コード例 #4
0
 public void summonTime()
 {
     myPlayer.changeBones(-100);
     int i = dogs.generateRandom();
     int j = dogs.generateRandom();
     DogStatsConfig toSummon = returnDog(i, j);
     summon.Raise(toSummon);
     Debug.Log("summon event sent: " + toSummon);
 }
コード例 #5
0
 public void setStatBars(DogStatsConfig dogToShow)
 {
     float[] myNewArray = { dogToShow.MaxHealth, dogToShow.BaseAttack, dogToShow.BaseDefense, dogToShow.BaseSpeed };
     sliders[0].value = myNewArray[0] / 200;
     for (int i = 1; i < sliders.Length - 1; i++)
     {
         sliders[i].value = myNewArray[i] / 50;
     }
     sliders[3].value = myNewArray[3] / 35;
 }
コード例 #6
0
 public void removeFromTeam(DogStatsConfig toRemove)
 {
     for (int i = 0; i < yourTeam.Length; i++)
     {
         if (yourTeam[i] == toRemove)
         {
             yourTeam[i] = null;
         }
     }
 }
コード例 #7
0
    //TODO: null values when unit dies

    public void initializeDog(DogStatsConfig newDog)
    {
        dogName.text       = newDog.dogName;
        dogPortrait.sprite = newDog.head;
        dogPortrait.color  = new Color(1, 1, 1, 1);
        dogChargeCount     = 0;
        for (int i = 0; i < 3; i++)
        {
            dogSpecialCharge[i].color = new Color(0, 0, 0, 0);
        }
    }
コード例 #8
0
    //dog functions

    /*  public void dogsInit()
     * {
     *   yourDogs = new List<DogStatsConfig>(ownedDogs);
     * } */

    public bool hasDog(DogStatsConfig toCheck)
    {
        if (yourDogs.Contains(toCheck))
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }
コード例 #9
0
 public void addToTeam(DogStatsConfig toAdd)
 {
     for (int i = 0; i < yourTeam.Length; i++)
     {
         if (yourTeam[i] == null)
         {
             yourTeam[i] = toAdd;
             i           = 4;
         }
     }
 }
コード例 #10
0
 public void showPanel(DogStatsConfig dogToShow)
 {
     if (myPlayer.hasDog(dogToShow))
     {
         displayDog = dogToShow;
         stringGen(dogToShow);
         setName(dogToShow);
         setStatBars(dogToShow);
         setPortrait(dogToShow);
         thisPanel.SetActive(true);
     }
 }
コード例 #11
0
    public bool isOnTeam(DogStatsConfig check)
    {
        bool toReturn = false;

        for (int i = 0; i < yourTeam.Length; i++)
        {
            if (yourTeam[i] == check)
            {
                toReturn = true;
            }
        }
        return(toReturn);
    }
コード例 #12
0
 public void addDog(DogStatsConfig newDog)
 {
     //DogStatsConfig newDog = dogsInTheGame.dogsInTheGame[i];
     if (myPlayer.isOnTeam(newDog))
     {
         Debug.Log("is on team");
         onTeamPanel(newDog);
     }
     else
     {
         addPanel(newDog);
     }
 }
コード例 #13
0
    public DogStatsConfig returnDog(int i, int j)
    {
        int pool;
        if (i < 4)
        {
            pool = 0;
        }
        else if (i < 7)
        {
            pool = 1;
        }
        else if (i < 9)
        {
            pool = 2;
        }
        else if (i == 9)
        {
            pool = 3;
        }
        else
        {
            pool = 0;
        }
        Debug.Log("pool is " + pool);

        switch (pool)
        {
            case 0:
                j = j % dogs.RareDogs.Count;
                Debug.Log("rare count is " + dogs.RareDogs.Count);
                Debug.Log("j is " + j);
                break;
            case 1:
                j = j % dogs.SuperRareDogs.Count;
                Debug.Log("sr count is " + dogs.SuperRareDogs.Count);
                Debug.Log("j is " + j);
                break;
            case 2:
                j = j % dogs.SuperDuperRareDogs.Count;
                Debug.Log("sdr count is " + dogs.SuperDuperRareDogs.Count);
                Debug.Log("j is " + j);
                break;
            case 3:
                j = j % dogs.UltraRareDogs.Count;
                Debug.Log("ur count is " + dogs.UltraRareDogs.Count);
                Debug.Log("j is " + j);
                break;
        }
        DogStatsConfig toReturn = dogs.summoningPools[pool][j];
        return toReturn;
    }
コード例 #14
0
 public void summonedDog(DogStatsConfig newDog)
 {
     Debug.Log("summoned dog recieved");
     if (myPlayer.hasDog(newDog))
     {
         Debug.Log("recognized as duplicate");
         duplicateDog(newDog);
     }
     else
     {
         myPlayer.yourDogs.Add(newDog);
         addDog(newDog);
     }
 }
コード例 #15
0
    public void addPanel(DogStatsConfig dogToShow)
    {
        removeGameObject.SetActive(false);
        dupeGameObject.SetActive(false);
        int numDogsInTeam = 0;

        for (int i = 0; i < myPlayer.yourTeam.Length; i++)
        {
            if (myPlayer.yourTeam[i] != null)
            {
                numDogsInTeam++;
            }
        }
        if (numDogsInTeam < 3)
        {
            addGameObject.SetActive(true);
        }
        else
        {
            addGameObject.SetActive(false);
        }
        showPanel(dogToShow);
    }
コード例 #16
0
 public void setName(DogStatsConfig dogToShow)
 {
     dogName.text = dogToShow.dogName;
 }
コード例 #17
0
 public void setPortrait(DogStatsConfig dogToShow)
 {
     portrait.sprite = dogToShow.head;
 }
コード例 #18
0
 //this function sets your current dog as active and calls the previous spawndog function
 public void loadDog(DogStatsConfig newdoggo)
 {
     activeDog = newdoggo;
     spawnDog();
 }
コード例 #19
0
    public string generateSpecialDescription(DogStatsConfig dogToShow)
    {
        StringBuilder sb = new StringBuilder("", 100);

        foreach (special effect in dogToShow.specialEffects)
        {
            types typeToCheck = effect.type;
            switch (typeToCheck)
            {
            case types.changeHealth:
                if (effect.value > 0)
                {
                    sb.Append("Heals ");
                }
                else if (effect.value < 0)
                {
                    sb.Append("Damages ");
                }
                break;

            case types.changeAttack:
                if (effect.value > 0)
                {
                    sb.Append("Raises ");
                }
                else if (effect.value < 0)
                {
                    sb.Append("Lowers ");
                }
                sb.Append("attack of ");
                break;

            case types.changeDefense:
                if (effect.value > 0)
                {
                    sb.Append("Raises ");
                }
                else if (effect.value < 0)
                {
                    sb.Append("Lowers ");
                }
                sb.Append("defense of ");
                break;

            case types.changeSpeed:
                if (effect.value > 0)
                {
                    sb.Append("Raises ");
                }
                else if (effect.value < 0)
                {
                    sb.Append("Lowers ");
                }
                sb.Append("speed of ");
                break;
            }
            float absValueEffect = Math.Abs(effect.value);
            if (effect.targets == target.self)
            {
                sb.Append("self ");
            }
            if (effect.targets == target.enemy)
            {
                sb.Append("enemy ");
            }
            if (absValueEffect < 15)
            {
                sb.Append("a little bit\n");
            }
            else if (absValueEffect < 35)
            {
                sb.Append("moderately\n");
            }
            else if (absValueEffect <= 50)
            {
                sb.Append("massively\n");
            }
        }
        return(sb.ToString());
    }
コード例 #20
0
    public void removeDogFromFrame(int i)
    {
        DogStatsConfig myCoolDog = myPlayer.yourTeam[i];

        addDog(myCoolDog);
    }
コード例 #21
0
    public void addDogFromDoghouse(int i)
    {
        DogStatsConfig myCoolDog = doggies.dogsInTheGame[i];

        addDog(myCoolDog);
    }
コード例 #22
0
 public void stringGen(DogStatsConfig dogToShow)
 {
     specialTextMeshPro.text = generateSpecialDescription(dogToShow);
 }
コード例 #23
0
 public void duplicateDog(DogStatsConfig dupeDog)
 {
     dupePanel(dupeDog);
 }
コード例 #24
0
 public void setActive(DogStatsConfig currentDog)
 {
     //TODO: sets to active
     //TODO: checks dogs for active ones
     //TODO: loads in current team
 }