Ejemplo n.º 1
1
    // Use this for initialization
    void Start()
    {
        normalGacha = (Instantiate(normalGachaPrefab) as GameObject).GetComponent <Gacha>();
        rareGacha   = (Instantiate(rareGachaPrefab) as GameObject).GetComponent <Gacha>();

        guiState = StateRoot;
    }
Ejemplo n.º 2
0
    public void SpinGacha(Asset asset)
    {
        isSpinning = true;
        LoadingSpinner.Instance.EnableLoadingSpinner();
        string assetName = "fight " + ((string)asset.GetCustom("Class", "ENG"));

        // npnf feature: Grabbing gacha for this asset
        this.gacha = Gacha.GetCachedByName(assetName);

        if (this.gacha != null)
        {
            OnGachaLoaded();
        }
        else
        {
            NPNF.Gachas.Gacha.GetByName(assetName,
                                        (Gacha gacha, NPNFError error) => {
                if (gacha != null)
                {
                    this.gacha = gacha;
                    OnGachaLoaded();
                }
                else
                {
                    LoadingSpinner.Instance.DisableLoadingSpinner();
                    isSpinning = false;
                    Debug.LogError("Get Gacha Failed: " + error);
                    AppController.Instance.IsNetworkError(error);
                }
            });
        }
    }
Ejemplo n.º 3
0
 private Task DownloadGachaCard(Gacha gacha, string savePath)
 {
     return(new Task(() =>
     {
         foreach (var card in gacha.CardList)
         {
             GetCard.SaveFileAndDecrypt(card.Id, savePath);
         }
     }));
 }
Ejemplo n.º 4
0
        public async Task AzulotAsync()
        {
            var(x, y, z) = Gacha.Execute();

            await ReplyAsync("<:S_azumi2:667170520923635732>");
            await ReplyAsync("ドゥルルルル");
            await ReplyAsync($"{x} {y} {z}");

            if (x == y && y == z)
            {
                await ReplyAsync("<:S_harudai21:668615102341185537>");
            }
            else
            {
                await ReplyAsync("あぁ~");
            }
        }
Ejemplo n.º 5
0
 public void StartModule()
 {
     if (ModuleHelpers.IsThisModuleActive(this.gameObject))
     {
         // npnf feature: Getting all Energy Bars
         Gacha.GetAll((List <Gacha> gachaDict, NPNFError error) => {
             GachaInput.GetAll((List <GachaInput> gachaInputList, NPNFError inputError) => {
                 if (error == null && inputError == null)
                 {
                     SetReady();
                 }
                 else
                 {
                     AppController.Instance.IsNetworkError(inputError);
                 }
             });
         });
     }
 }
Ejemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        GameObject GameInstancer = GameObject.FindGameObjectWithTag("GameInstancer");

        gacha = GetComponent <Gacha>();

        if (GameInstancer != null)
        {
            instance = GameInstancer.GetComponent <scr_GameInstance> ();
        }
        Timer             = -999f;
        CrystalSpawnStart = CrystalSpawn.transform;
        CrystalSpawn.SetActive(false);
        btnGoBack.onClick.AddListener(GoBack);
        btnNext.onClick.AddListener(Next);
        btnSinglePull.onClick.AddListener(SingleRoll);
        btnTriplePull.onClick.AddListener(TripleRoll);
        btnAddCrystals.onClick.AddListener(AddCrystalsDebug);
    }
Ejemplo n.º 7
0
        public Gacha ParseGachaResult()
        {
            var gachaResult = _resultJsonObject["gachaResult"];
            var getCardList = gachaResult["getCardList"] as JArray;

            var Gacha = new Gacha
            {
                CardList = new List <Card>()
            };

            foreach (var card in getCardList)
            {
                Gacha.CardList.Add(new Card
                {
                    Id = (int)card["cardId"]
                });
            }

            return(Gacha);
        }
Ejemplo n.º 8
0
 // Update the text ----------------------------------------------------------------------------
 public void UpdateGachaText(string gachaCubeId)
 {
     GameObject[] gachaCubes = GameObject.FindGameObjectsWithTag("GachaCube");
     foreach (GameObject gachaCube in gachaCubes)
     {
         Gacha gacha = gachaCube.GetComponent <Gacha>();
         if (gacha.GachaObjectId == gachaCubeId)
         {
             // Update "Cost" text
             string costStr = string.Format("Cost: {0:#,0}", gacha.Cost);
             transform.Find("CostText").GetComponent <TextManager>().SetText(costStr);
             // Update the "Rewards" texts
             int NumOfReward = gacha.CountRewards();
             for (int i = 0; i < NumOfReward; i++)
             {
                 uint   reward    = gacha.GetReward(i);
                 string rewardStr = string.Format("{0:#,0} pt", reward);
                 transform.Find("Rewards/Reward" + (i + 1).ToString() + "Text")
                 .GetComponent <TextManager>().SetText(rewardStr);
             }
         }
     }
 }
Ejemplo n.º 9
0
    void NormalGacha()
    {
        var topleft = Camera.main.ViewportToScreenPoint(
            new Vector3(0.3f, 0.5f, 0.0f));

        var size = Camera.main.ViewportToScreenPoint(
            new Vector3(0.4f, 0.2f, 0.0f));

        var area = new Rect(
            topleft.x, topleft.y,
            size.x, size.y);

        GUILayout.BeginArea(area);

        GUILayout.FlexibleSpace();

        var guiStyle = new GUIStyle(GUI.skin.GetStyle("label"));

        guiStyle.alignment = TextAnchor.MiddleCenter;
        guiStyle.fontSize  = 20;

        GUILayout.Label(
            "ノーマルガチャ",
            guiStyle);

        GUILayout.FlexibleSpace();

        GUILayout.BeginHorizontal();

        GUILayout.FlexibleSpace();

        if (GUILayout.Button("ノーマル1回\n(HP 10)", GUILayout.MinWidth(120), GUILayout.MinHeight(40)))
        {
            if (PlayerHealth.health > 10)
            {
                PlayerHealth.AddHealth(-10);
                normalGacha.Draw(1);
                gacha    = normalGacha;
                guiState = StateGacha;
            }
            else
            {
                guiState = StateLack;
            }
        }

        GUILayout.FlexibleSpace();

        if (GUILayout.Button("ノーマル11連\n(HP 100)", GUILayout.MinWidth(120), GUILayout.MinHeight(40)))
        {
            if (PlayerHealth.health > 100)
            {
                PlayerHealth.AddHealth(-100);
                normalGacha.Draw(11);
                gacha    = normalGacha;
                guiState = StateGacha11;
            }
            else
            {
                guiState = StateLack;
            }
        }

        GUILayout.FlexibleSpace();

        GUILayout.EndHorizontal();

        GUILayout.FlexibleSpace();

        GUILayout.EndArea();
    }
Ejemplo n.º 10
0
    void RareGacha()
    {
        var backupColor = GUI.color;

        GUI.color = Color.yellow;

        var topleft = Camera.main.ViewportToScreenPoint(
            new Vector3(0.3f, 0.1f, 0.0f));

        var size = Camera.main.ViewportToScreenPoint(
            new Vector3(0.4f, 0.35f, 0.0f));

        var area = new Rect(
            topleft.x, topleft.y,
            size.x, size.y);

        GUILayout.BeginArea(area);

        GUILayout.FlexibleSpace();

        var guiStyle = new GUIStyle(GUI.skin.GetStyle("label"));

        guiStyle.alignment = TextAnchor.MiddleCenter;
        guiStyle.fontSize  = 30;

        GUILayout.Label(
            "☆☆☆レアガチャ☆☆☆",
            guiStyle,
            GUILayout.MinHeight(60));

        //GUILayout.FlexibleSpace();

//		GUI.color = Color.red;
//		guiStyle.fontSize = 20;
//
//		GUILayout.Label(
//			"11連でSR1枚確定キャンペーン中!!!",
//			guiStyle);

        GUI.color = Color.yellow;

        //GUILayout.FlexibleSpace();

        GUILayout.BeginHorizontal();

        GUILayout.FlexibleSpace();

        if (GUILayout.Button("レア1回\n(最大HP 10)", GUILayout.MinWidth(120), GUILayout.MinHeight(60)))
        {
            if (PlayerHealth.maxHealth >= 10)
            {
                PlayerHealth.AddMaxHealth(-10);
                rareGacha.Draw(1);
                gacha    = rareGacha;
                guiState = StateGacha;
            }
            else
            {
                guiState = StateLack;
            }
        }

        GUILayout.FlexibleSpace();

        if (GUILayout.Button("レア11連\n(最大HP 100)", GUILayout.MinWidth(120), GUILayout.MinHeight(60)))
        {
            if (PlayerHealth.maxHealth >= 100)
            {
                PlayerHealth.AddMaxHealth(-100);
                rareGacha.Draw(11);
                gacha    = rareGacha;
                guiState = StateGacha11;
            }
            else
            {
                guiState = StateLack;
            }
        }

        GUILayout.FlexibleSpace();

        GUILayout.EndHorizontal();

        GUILayout.FlexibleSpace();

        GUILayout.EndArea();

        GUI.color = backupColor;
    }
Ejemplo n.º 11
0
    // Use this for initialization
    void Start()
    {
        normalGacha = (Instantiate(normalGachaPrefab) as GameObject).GetComponent<Gacha>();
        rareGacha = (Instantiate(rareGachaPrefab) as GameObject).GetComponent<Gacha>();

        guiState = StateRoot;
    }
Ejemplo n.º 12
0
    void RareGacha()
    {
        var backupColor = GUI.color;

        GUI.color = Color.yellow;

        var topleft = Camera.main.ViewportToScreenPoint(
            new Vector3(0.3f, 0.1f, 0.0f));

        var size = Camera.main.ViewportToScreenPoint(
            new Vector3(0.4f, 0.35f, 0.0f));

        var area = new Rect(
            topleft.x, topleft.y,
            size.x, size.y);

        GUILayout.BeginArea(area);

        GUILayout.FlexibleSpace();

        var guiStyle = new GUIStyle(GUI.skin.GetStyle("label"));
        guiStyle.alignment = TextAnchor.MiddleCenter;
        guiStyle.fontSize = 30;

        GUILayout.Label(
            "☆☆☆レアガチャ☆☆☆",
            guiStyle,
            GUILayout.MinHeight(60));

        //GUILayout.FlexibleSpace();

        //		GUI.color = Color.red;
        //		guiStyle.fontSize = 20;
        //
        //		GUILayout.Label(
        //			"11連でSR1枚確定キャンペーン中!!!",
        //			guiStyle);

        GUI.color = Color.yellow;

        //GUILayout.FlexibleSpace();

        GUILayout.BeginHorizontal();

        GUILayout.FlexibleSpace();

        if(GUILayout.Button("レア1回\n(最大HP 10)", GUILayout.MinWidth(120), GUILayout.MinHeight(60)))
        {
            if(PlayerHealth.maxHealth >= 10)
            {
                PlayerHealth.AddMaxHealth(-10);
                rareGacha.Draw(1);
                gacha = rareGacha;
                guiState = StateGacha;
            }
            else
            {
                guiState = StateLack;
            }
        }

        GUILayout.FlexibleSpace();

        if(GUILayout.Button("レア11連\n(最大HP 100)", GUILayout.MinWidth(120), GUILayout.MinHeight(60)))
        {
            if(PlayerHealth.maxHealth >= 100)
            {
                PlayerHealth.AddMaxHealth(-100);
                rareGacha.Draw(11);
                gacha = rareGacha;
                guiState = StateGacha11;
            }
            else
            {
                guiState = StateLack;
            }
        }

        GUILayout.FlexibleSpace();

        GUILayout.EndHorizontal();

        GUILayout.FlexibleSpace();

        GUILayout.EndArea();

        GUI.color = backupColor;
    }
Ejemplo n.º 13
0
    void NormalGacha()
    {
        var topleft = Camera.main.ViewportToScreenPoint(
            new Vector3(0.3f, 0.5f, 0.0f));

        var size = Camera.main.ViewportToScreenPoint(
            new Vector3(0.4f, 0.2f, 0.0f));

        var area = new Rect(
            topleft.x, topleft.y,
            size.x, size.y);

        GUILayout.BeginArea(area);

        GUILayout.FlexibleSpace();

        var guiStyle = new GUIStyle(GUI.skin.GetStyle("label"));
        guiStyle.alignment = TextAnchor.MiddleCenter;
        guiStyle.fontSize = 20;

        GUILayout.Label(
            "ノーマルガチャ",
            guiStyle);

        GUILayout.FlexibleSpace();

        GUILayout.BeginHorizontal();

        GUILayout.FlexibleSpace();

        if(GUILayout.Button("ノーマル1回\n(HP 10)", GUILayout.MinWidth(120), GUILayout.MinHeight(40)))
        {
            if(PlayerHealth.health > 10)
            {
                PlayerHealth.AddHealth(-10);
                normalGacha.Draw(1);
                gacha = normalGacha;
                guiState = StateGacha;
            }
            else
            {
                guiState = StateLack;
            }
        }

        GUILayout.FlexibleSpace();

        if(GUILayout.Button("ノーマル11連\n(HP 100)", GUILayout.MinWidth(120), GUILayout.MinHeight(40)))
        {
            if(PlayerHealth.health > 100)
            {
                PlayerHealth.AddHealth(-100);
                normalGacha.Draw(11);
                gacha = normalGacha;
                guiState = StateGacha11;
            }
            else
            {
                guiState = StateLack;
            }
        }

        GUILayout.FlexibleSpace();

        GUILayout.EndHorizontal();

        GUILayout.FlexibleSpace();

        GUILayout.EndArea();
    }
Ejemplo n.º 14
0
 protected abstract void PlayErrorHandler(Gacha gacha, GachaTrigger trigger, NPNFError error);
Ejemplo n.º 15
0
 protected abstract void PlayDoneHandler(Gacha gacha, GachaTrigger trigger, List<Entitlement> results);
Ejemplo n.º 16
0
 void Start()
 {
     gachaMachine = GetComponent <Gacha>();
     StartTussle();
 }