예제 #1
0
 public void OnCritDamage()
 {
     if (ETC.GetCoin(PlayerStats.instance.stats.critDamageLv) <= PlayerStats.instance.stats.playerCoin && PlayerStats.instance.stats.critDamageLv < 50)
     {
         PlayerStats.instance.stats.playerCoin -= (int)ETC.GetCoin(PlayerStats.instance.stats.critDamageLv);
         PlayerStats.instance.stats.critDamageLv++;
         PlayerStats.instance.stats.critDamage += ETC.GetCritHit(PlayerStats.instance.stats.critDamageLv);
         ResetStatsView();
     }
 }
예제 #2
0
        private async Task DownloadCartoon(string category, int itemIndex)
        {
            var ad = new AndroidX.AppCompat.App.AlertDialog.Builder(Activity, ETC.dialogBGDownload);

            ad.SetTitle(Resource.String.Cartoon_DownloadCartoonTitle);
            ad.SetMessage(Resource.String.Cartoon_DownloadCartoonMessage);
            ad.SetCancelable(false);
            ad.SetView(Resource.Layout.SpinnerProgressDialogLayout);

            var dialog = ad.Show();

            try
            {
                string serverItemPath = Path.Combine(ETC.server, "Data", "Images", "Cartoon", "ko", category, selectedItemList[itemIndex]);

                count = 1;

                while (true)
                {
                    string contentPath      = Path.Combine(serverItemPath, $"{count}.png");
                    string localContentPath = Path.Combine(cartoonTopPath, category, itemIndex.ToString(), $"{count}.gfdcache");

                    Uri.TryCreate(contentPath, UriKind.RelativeOrAbsolute, out Uri uri);
                    var request = WebRequest.Create(uri);

                    using (var response = await request.GetResponseAsync().ConfigureAwait(false))
                    {
                        if (response.ContentType != "image/png")
                        {
                            break;
                        }
                    }

                    using (var wc = new WebClient())
                    {
                        wc.DownloadProgressChanged += (sender, e) =>
                        {
                            string message = Resources.GetString(Resource.String.Cartoon_DownloadCartoonMessage);
                            Activity.RunOnUiThread(() => { ad.SetMessage($"{message}{count}({e.BytesReceived / 1024}KB)"); });
                        };
                        await wc.DownloadFileTaskAsync(contentPath, localContentPath);
                    }

                    count += 1;
                }
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, Activity);
            }
            finally
            {
                dialog.Dismiss();
            }
        }
예제 #3
0
    void ResetStatsView()
    {
        int price = 0;

        if (PlayerStats.instance.stats.critPercentLv < 50)
        {
            crit1Lv.text      = PlayerStats.instance.stats.critPercentLv.ToString();
            crit1NextLv.text  = (PlayerStats.instance.stats.critPercentLv + 1).ToString();
            crit1Percent.text = ETC.GetCritHit(PlayerStats.instance.stats.critPercentLv).ToString() + "%";
            price             = (int)ETC.GetCoin(PlayerStats.instance.stats.critPercentLv);
            crit1Price        = ETC.Calculation(crit1Price, price);
        }
        else
        {
            crit1Lv.text      = "MAX Level";
            crit1NextLv.text  = "MAX";
            crit1Percent.text = ETC.GetCritHit(PlayerStats.instance.stats.critPercentLv).ToString() + "%";
            crit1Price.text   = "NONE";
        }

        if (PlayerStats.instance.stats.critDamageLv < 50)
        {
            crit2Lv.text     = PlayerStats.instance.stats.critDamageLv.ToString();
            crit2NextLv.text = (PlayerStats.instance.stats.critDamageLv + 1).ToString();
            crit2Damage.text = ETC.GetCritDmg(PlayerStats.instance.stats.critDamageLv).ToString() + "%";
            price            = (int)ETC.GetCoin(PlayerStats.instance.stats.critDamageLv);
            crit2Price       = ETC.Calculation(crit2Price, price);
        }
        else
        {
            crit2Lv.text     = "MAX Level";
            crit2NextLv.text = "MAX";
            crit2Damage.text = ETC.GetCritHit(PlayerStats.instance.stats.critPercentLv).ToString() + "%";
            crit2Price.text  = "NONE";
        }

        if (PlayerStats.instance.stats.coinPercentLv < 100)
        {
            coinLv.text      = PlayerStats.instance.stats.coinPercentLv.ToString();
            coinNextLv.text  = (PlayerStats.instance.stats.coinPercentLv + 1).ToString();
            coinPercent.text = PlayerStats.instance.stats.coinPercentLv.ToString() + "%";
            price            = (int)ETC.GetCoin(PlayerStats.instance.stats.coinPercentLv);
            coinPrice        = ETC.Calculation(coinPrice, price);
        }
        else
        {
            coinLv.text      = "MAX Level";
            coinNextLv.text  = "MAX";
            coinPercent.text = ETC.GetCritHit(PlayerStats.instance.stats.critPercentLv).ToString() + "%";
            coinPrice.text   = "NONE";
        }

        GameLogic.instance.Save();
    }
예제 #4
0
파일: Program.cs 프로젝트: radtek/autoxx
        public static void Run()
        {
            while (true)
            {
                try
                {
                    //BTC.Do();
                    BCH.Do();
                    ETH.Do();
                    ETC.Do();
                    LTC.Do();

                    EOS.Do();
                    XRP.Do();
                    OMG.Do();
                    DASH.Do();
                    ZEC.Do();
                    Thread.Sleep(1000 * 5);

                    // 创新
                    ITC.Do();
                    NAS.Do();
                    RUFF.Do();
                    ZIL.Do();
                    DTA.Do();
                    Thread.Sleep(1000 * 5);

                    LET.Do();
                    HT.Do();
                    THETA.Do();
                    HSR.Do();
                    QTUM.Do();
                    Thread.Sleep(1000 * 5);

                    SNT.Do();
                    IOST.Do();
                    NEO.Do();
                    STORJ.Do();
                    GNT.Do();
                    Thread.Sleep(1000 * 5);

                    CVC.Do();
                    SMT.Do();
                    VEN.Do();
                    ELF.Do();
                    XEM.Do();
                    Thread.Sleep(1000 * 5);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
        }
예제 #5
0
        internal async Task LoadProcessWeb(string category, int categoryIndex, int itemIndex, bool IsRefresh = false)
        {
            cartoonType      = CartoonType.Web;
            nowItemIndex     = itemIndex;
            nowCategoryIndex = categoryIndex;
            nowCategory      = category;

            try
            {
                loadProgress.Visibility = ViewStates.Visible;
                (Activity as CartoonActivity).mainDrawerLayout.Enabled = false;
                selectedItemList.Clear();
                selectedItemURLList.Clear();

                webViewLayout.RemoveAllViews();
                copyrightLayout.RemoveAllViews();

                await Task.Delay(100);

                (Activity as CartoonActivity).ListItems(categoryIndex, selectedItemList);
                ListItemURLs(categoryIndex, ref selectedItemURLList);
                selectedItemList.TrimExcess();
                selectedItemURLList.TrimExcess();

                var webview = new WebView(Activity);
                webview.SetWebViewClient(new WebBrowserWebClient());
                webview.Settings.BuiltInZoomControls      = true;
                webview.Settings.AllowContentAccess       = true;
                webview.Settings.BlockNetworkImage        = false;
                webview.Settings.BlockNetworkLoads        = false;
                webview.Settings.LoadsImagesAutomatically = true;
                webview.Settings.DomStorageEnabled        = true;
                webview.Settings.MixedContentMode         = MixedContentHandling.AlwaysAllow;
                webview.Settings.SetAppCacheEnabled(true);
                webview.Settings.JavaScriptEnabled = true;

                webViewLayout.AddView(webview);
                webview.LoadUrl(selectedItemURLList[nowItemIndex]);

                loadProgress.Visibility = ViewStates.Invisible;
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, Activity);
            }
            finally
            {
                (Activity as CartoonActivity).mainDrawerLayout.Enabled = false;
                toolbarTitle.Text           = selectedItemList[itemIndex];
                mainRecyclerView.Visibility = ViewStates.Gone;
                webViewLayout.Visibility    = ViewStates.Visible;
            }
        }
예제 #6
0
        static void Main(string[] args)
        {
            int x = 1;

            while (x++ < 1500)
            {
                GameTools.WriteColoredParagraph(" ", ConsoleColor.White, ConsoleColor.White);
                GameTools.WriteColoredParagraph(" ", ConsoleColor.Blue, ConsoleColor.Blue);
                while (x++ > 1100 && x++ < 1500)
                {
                    GameTools.WriteColoredParagraph(" ", ConsoleColor.Black, ConsoleColor.Black);
                }
            }

            ETC s = new ETC();

            GameTools.WriteColoredParagraph("", ConsoleColor.Cyan, ConsoleColor.DarkBlue);
            s.sp();
            GameTools.WriteColoredParagraph("", ConsoleColor.Cyan, ConsoleColor.DarkBlue);
            s.sp();
            GameTools.WriteColoredParagraph("", ConsoleColor.Cyan, ConsoleColor.DarkBlue);
            s.sp();
            GameTools.WriteColoredParagraph("_________________________TELEMARKETER SIMULATOR______________________________", ConsoleColor.Cyan, ConsoleColor.DarkBlue);
            s.sp();
            GameTools.WriteColoredParagraph("_________________________Made by: Aaron Prather_________________________", ConsoleColor.Cyan, ConsoleColor.DarkBlue);
            s.sp();
            GameTools.WriteColoredParagraph(@"_________________________A C# Production!_________________________", ConsoleColor.Cyan, ConsoleColor.DarkBlue);
            s.sp();
            GameTools.WriteColoredParagraph(@"___Think you have what it takes to make it in the telemarketing business?___", ConsoleColor.Cyan, ConsoleColor.DarkBlue);
            s.sp();
            GameTools.WriteColoredParagraph(@"_________________________Are you Ready to begin?_________________________", ConsoleColor.Cyan, ConsoleColor.DarkBlue);
            s.sp();
            GameTools.WriteColoredParagraph("", ConsoleColor.Cyan, ConsoleColor.DarkBlue);
            s.sp();
            GameTools.WriteColoredParagraph("", ConsoleColor.Cyan, ConsoleColor.DarkBlue);
            s.sp();
            GameTools.WriteColoredParagraph("", ConsoleColor.Cyan, ConsoleColor.DarkBlue);
            s.sp();

            string c = GameTools.GetChoice("y", "n");


            while (c == "y")
            {
                Phone p = new Phone();
                s.s();
                p.Play();
                s.sp();
            }
        }
예제 #7
0
 void FixedUpdate()
 {
     transform.position += Vector3.up * Time.deltaTime;
     damageText.color   -= new Color(0, 0, 0, Time.deltaTime);
     damageText          = ETC.Calculation(damageText, getDamage);
     if (!isCrit)
     {
         damageText.fontSize = 45;
     }
     else
     {
         damageText.fontSize = 90;
     }
 }
예제 #8
0
 public void ExportEtcFile(string name, int w, int h, bool hasAlpha)
 {
     if (Settings.s.platform == Settings.Platform._3DS)
     {
         using (Reader reader = new Reader(FileSystem.GetFileReadStream(gameDataBinFolder + name))) {
             byte[] textureBytes = reader.ReadBytes((int)reader.BaseStream.Length);
             if (!File.Exists(gameDataBinFolder + "/textures/" + Path.GetDirectoryName(name) + "/" + Path.GetFileNameWithoutExtension(name) + ".png"))
             {
                 Texture2D tex = new ETC(textureBytes, w, h, hasAlpha).texture;
                 Util.ByteArrayToFile(gameDataBinFolder + "/textures/" + Path.GetDirectoryName(name) + "/" + Path.GetFileNameWithoutExtension(name) + ".png", tex.EncodeToPNG());
             }
         }
     }
 }
    IEnumerator SendScore() //점수 정보 전송 - SimonOrder code 주석 참고
    {
        ScoreStatisticsDbData data = new ScoreStatisticsDbData();

        data.UserID = SceneChangeManager.Patient.UserID;
        data.Date   = System.DateTime.Now.ToString("yy/MM/dd");
        data.Game   = "도형기억력";
        data.Type   = "점수";
        data.Score  = (GameManager.Game.stage - 1) * 10;
        data.Level  = SceneChangeManager.SCENE.Level;
        ETC etc = new ETC();

        if (SceneChangeManager.SCENE.Level == 0)
        {
            etc.GameType = "색+모양-" + SceneChangeManager.SCENE.NBack;
        }
        else
        {
            etc.GameType = "모양조합-" + SceneChangeManager.SCENE.NBack;
        }
        etc.PlayTime = _timerText.text;

        string jsonETC = JsonConvert.SerializeObject(etc);

        data.etc = jsonETC;
        string json_key = JsonConvert.SerializeObject(data);

        byte[] bytes = System.Text.Encoding.UTF8.GetBytes(json_key);
        using (UnityWebRequest www = new UnityWebRequest(SaveScoreURL, UnityWebRequest.kHttpVerbPOST))
        {
            UploadHandlerRaw      uH = new UploadHandlerRaw(bytes);
            DownloadHandlerBuffer dH = new DownloadHandlerBuffer();

            www.uploadHandler   = uH;
            www.downloadHandler = dH;
            www.SetRequestHeader("Content-Type", "application/json");
            yield return(www.SendWebRequest());

            if (www.isHttpError || www.isNetworkError)
            {
                Debug.Log(www.error);
            }
            else
            {
                Debug.Log("결과 데이터 전송 완료");
            }
        }
    }
예제 #10
0
    IEnumerator SendScore() //점수 정보 전송
    {
        //data 값
        ScoreStatisticsDbData data = new ScoreStatisticsDbData();

        data.UserID = SceneChangeManager.Patient.UserID;
        data.Date   = DateTime.Now.ToString("yy/MM/dd");
        data.Game   = "SimonColor";
        data.Type   = "Score";
        data.Score  = int.Parse(ResultScore.text);
        data.Level  = GameManager.Game.stage - 1;

        ETC etc = new ETC
        {
            RestTime = ResultTime.text,
            Wrong    = 2 - GameManager.Game.life
        };

        //Object를 Json String으로 변환
        string jsonETC = JsonConvert.SerializeObject(etc);

        data.etc = jsonETC;
        string json_key = JsonConvert.SerializeObject(data);

        //string을 byte[] 배열로 변환
        byte[] bytes = System.Text.Encoding.UTF8.GetBytes(json_key);

        using (UnityWebRequest www = new UnityWebRequest(SaveScoreURL, UnityWebRequest.kHttpVerbPOST)) //HTTP POST 요청
        {
            UploadHandlerRaw      uH = new UploadHandlerRaw(bytes);                                    //HTTP 요청 중 본문 데이터의 버퍼링 및 전송 관리
            DownloadHandlerBuffer dH = new DownloadHandlerBuffer();                                    //원격 서버로부터 수신 된 바디 데이터를 관리

            www.uploadHandler   = uH;
            www.downloadHandler = dH;
            www.SetRequestHeader("Content-Type", "application/json"); //HTTP 요청 헤더 값 설정
            yield return(www.SendWebRequest());

            if (www.isHttpError || www.isNetworkError) //에러 발생 시
            {
                Debug.Log(www.error);
            }
            else
            {
                Debug.Log("결과 데이터 전송 완료");
            }
        }
    }
예제 #11
0
    void Update()
    {
        if (PlayerStats.instance.stats.playerCoin >= 0)
        {
            MyCoin = ETC.Calculation(MyCoin, PlayerStats.instance.stats.playerCoin);
        }
        else if (PlayerStats.instance.stats.playerCoin < 0)
        {
            MyCoin.text = "0";
        }

        if (PlayerStats.instance.stats.playerSpecialCoin >= 0)
        {
            MySpecialCoin = ETC.Calculation(MySpecialCoin, PlayerStats.instance.stats.playerSpecialCoin);
        }
        else if (PlayerStats.instance.stats.playerSpecialCoin < 0)
        {
            MySpecialCoin.text = "0";
        }
    }
예제 #12
0
        protected override void ReadInternal(Reader reader)
        {
            R2ROMLoader l = MapLoader.Loader as R2ROMLoader;

            if (Settings.s.platform == Settings.Platform._3DS)
            {
                wExponent    = reader.ReadByte();
                hExponent    = reader.ReadByte();
                flags        = reader.ReadUInt16();
                flags2       = reader.ReadUInt16();
                color_size   = reader.ReadUInt16();
                bpp          = reader.ReadUInt16();
                name         = reader.ReadString(200);
                off_texture  = Pointer.Current(reader);
                textureBytes = reader.ReadBytes(color_size);                 // max size: 0x10000
                Texture2D rawTex = new ETC(textureBytes, 1 << wExponent, 1 << hExponent, bpp == 32).texture;
                if (l.exportTextures)
                {
                    if (!File.Exists(l.gameDataBinFolder + "/textures/" + Path.GetDirectoryName(name) + "/" + Path.GetFileNameWithoutExtension(name) + ".png"))
                    {
                        Util.ByteArrayToFile(l.gameDataBinFolder + "/textures/" + Path.GetDirectoryName(name) + "/" + Path.GetFileNameWithoutExtension(name) + ".png", rawTex.EncodeToPNG());
                    }
                }
                Texture = rawTex;
            }
            else if (Settings.s.platform == Settings.Platform.DS || Settings.s.platform == Settings.Platform.N64)
            {
                texture_index = reader.ReadUInt16();
                palette_index = reader.ReadUInt16();
                alpha_index   = reader.ReadUInt16();
                wExponent     = reader.ReadByte();
                hExponent     = reader.ReadByte();
                flags         = reader.ReadUInt16();
                color_size    = reader.ReadUInt16();
                if (Settings.s.platform == Settings.Platform.DS)
                {
                    palette_num_colors = reader.ReadUInt16();
                }
                else
                {
                    palette_num_colors = 16;
                }
                ushort      ind_texture = 0xFFFF;
                bool        rgba16      = alpha_index != 0xFFFF && texture_index != 0xFFFF;
                GF64.Format format      = GF64.Format.I4;
                if ((flags & 1) != 0)
                {
                    ind_texture = (ushort)((texture_index + l.ind_textureTable_i4) & 0xFFFF);
                }
                else if ((flags & 2) != 0)
                {
                    format      = GF64.Format.I8;
                    ind_texture = (ushort)((texture_index + l.ind_textureTable_i8) & 0xFFFF);
                    if (Settings.s.platform == Settings.Platform.N64)
                    {
                        palette_num_colors = 256;
                    }
                }
                else if ((flags & 4) != 0)
                {
                    format      = GF64.Format.RGBA;
                    ind_texture = (ushort)((texture_index + l.ind_textureTable_rgba) & 0xFFFF);
                }
                if (ind_texture != 0xFFFF)
                {
                    off_texture = l.texturesTable[ind_texture];
                    if (l.texturesTableSeen != null)
                    {
                        l.texturesTableSeen[ind_texture] = true;
                    }
                }
                if (alpha_index != 0xFFFF)
                {
                    off_alpha = l.texturesTable[alpha_index];
                    if (l.texturesTableSeen != null)
                    {
                        l.texturesTableSeen[alpha_index] = true;
                    }
                }
                off_palette = null;

                /*if (Settings.s.platform == Settings.Platform.DS) {
                 *      format = rgba16 ? GF64.Format.RGBA : (palette_num_colors == 16 ? GF64.Format.I4 : GF64.Format.I8);
                 * }*/
                if (palette_index != 0xFFFF)
                {
                    if (Settings.s.platform == Settings.Platform.DS)
                    {
                        off_palette = l.palettesTable[palette_index & 0x7FFF];
                        if (l.palettesTableSeen != null)
                        {
                            l.palettesTableSeen[palette_index & 0x7FFF] = true;
                        }
                    }
                    else
                    {
                        off_palette = l.GetStructPtr(FATEntry.Type.Palette, palette_index, global: true);
                    }
                }

                /*l.print(((1 << hExponent) * (1 << wExponent)) + "\t"
                 + (1 << wExponent) + "\t" + (1 << hExponent) + "\t"
                 + (texture_index == 0xFFFF ? "-" : texture_index.ToString()) + "\t"
                 + (alpha_index == 0xFFFF ? "-" : alpha_index.ToString()) + "\t"
                 + (palette_index == 0xFFFF ? "-" : (palette_index & 0x7FFF).ToString()) + "\t"
                 + String.Format("{0:X4}", flags) + "\t"
                 + color_size + "\t"
                 + palette_num_colors + "\t"
                 + off_texture + "\t"
                 + off_alpha + "\t"
                 + off_palette + "\t");*/
                if (off_texture != null)
                {
                    mainTex = new GF64(reader,
                                       off_texture,
                                       (1 << wExponent),
                                       (1 << hExponent),
                                       format,
                                       off_palette,
                                       palette_num_colors);
                }
                if (off_alpha != null)
                {
                    alphaTex = new GF64(reader,
                                        off_alpha,
                                        (1 << wExponent),
                                        (1 << hExponent),
                                        GF64.Format.I4Alpha,
                                        null,
                                        palette_num_colors);
                    if (mainTex != null)
                    {
                        mainTex.LoadAlphaTexture(alphaTex);
                    }
                }
                Texture2D rawTex = mainTex != null ? mainTex.texture : alphaTex?.texture;
                if (l.exportTextures)
                {
                    if (rawTex != null)
                    {
                        string palette = (palette_index != 0xFFFF ? "_P" + (palette_index & 0x7FFF) : "");
                        string alpha   = (alpha_index != 0xFFFF ? "_A" + (alpha_index & 0x7FFF) : "");
                        string main    = (texture_index != 0xFFFF ? "_T" + (texture_index & 0x7FFF) : "");
                        if (!File.Exists(l.gameDataBinFolder + "/textures/" + format + main + alpha + palette + ".png"))
                        {
                            Util.ByteArrayToFile(l.gameDataBinFolder + "/textures/" + format + main + alpha + palette + ".png", rawTex.EncodeToPNG());
                        }
                    }
                    else
                    {
                        Debug.LogWarning("No mainTex or alphaTex for tex " + Offset);
                    }
                }
                Texture = rawTex;
            }
        }
예제 #13
0
    void OnCollisionEnter2D(Collision2D other)
    {
        if (other.transform.tag == "Knife")
        {
            SoundManager.instance.PlaySound("몬스터 타격음");

            double       damage = 0f;
            DamageEffect obj    = Ingame.instance.poolDamageEffect.Spawn(transform.position);
            // 검 능력
            if (PlayerStats.instance.stats.knifeLv / 10 == 1 && Random.Range(1, 100) <= 30f)
            {
                Debug.Log("검 능력 발동");
                obj.GetComponent <DamageEffect>().isCrit = true;
                damage = (PlayerStats.instance.stats.knifeDamage + (PlayerStats.instance.stats.knifeDamage * 2f) * PlayerStats.instance.stats.moreDamage / PlayerStats.instance.stats.knifeDamage) + (PlayerStats.instance.stats.knifeDamage * PlayerStats.instance.stats.critDamageLv / PlayerStats.instance.stats.knifeDamage);
            }
            // 검 능력
            // 암살자의 검 능력
            else if (PlayerStats.instance.stats.knifeLv / 10 == 2 && Random.Range(1, 100) <= 30f)
            {
                Debug.Log("암살자 능력 발동");
                obj.GetComponent <DamageEffect>().isCrit = false;
                damage = (PlayerStats.instance.stats.knifeDamage + (PlayerStats.instance.stats.knifeDamage * PlayerStats.instance.stats.moreDamage / PlayerStats.instance.stats.knifeDamage)) * 2;
                Ingame.instance.poolHitEffect.Spawn(transform.position, new Quaternion(0, 0, 0.25f, 0.25f));
            }
            // 암살자의 검 능력
            // 기사의 검
            else if (PlayerStats.instance.stats.knifeLv / 10 == 3 && Random.Range(1, 100) <= 50f)
            {
                Debug.Log("기사 능력 발동");
                obj.GetComponent <DamageEffect>().isCrit = true;
                damage = (PlayerStats.instance.stats.knifeDamage + (PlayerStats.instance.stats.knifeDamage * 2f) * PlayerStats.instance.stats.moreDamage / PlayerStats.instance.stats.knifeDamage) + (PlayerStats.instance.stats.knifeDamage * PlayerStats.instance.stats.critDamageLv / PlayerStats.instance.stats.knifeDamage);
                Ingame.instance.poolHitEffect.Spawn(transform.position, new Quaternion(0, 0, 0.25f, 0.25f));
                Ingame.instance.poolHitEffect.Spawn(transform.position, new Quaternion(0, 0, 0.25f, 0.25f));
            }
            // 기사의 검
            // 블래스트 능력
            else if (PlayerStats.instance.stats.knifeLv / 10 == 5 && Random.Range(1, 100) <= 10f)
            {
                // 폭발 이펙트
                obj.GetComponent <DamageEffect>().isCrit = true;
                damage = (PlayerStats.instance.stats.knifeDamage + (PlayerStats.instance.stats.knifeDamage * PlayerStats.instance.stats.moreDamage / PlayerStats.instance.stats.knifeDamage)) * 3;
                Instantiate(explosionEffect, transform.position, transform.rotation);
            }
            else if (Random.Range(1, 100) <= PlayerStats.instance.stats.critPercent)
            {
                print("Crit");
                obj.GetComponent <DamageEffect>().isCrit = true;
                damage = (PlayerStats.instance.stats.knifeDamage + (PlayerStats.instance.stats.knifeDamage * PlayerStats.instance.stats.moreDamage / PlayerStats.instance.stats.knifeDamage) * 2) + (PlayerStats.instance.stats.knifeDamage * ETC.GetCritDmg(PlayerStats.instance.stats.critDamageLv) / PlayerStats.instance.stats.knifeDamage);
            }
            else
            {
                obj.GetComponent <DamageEffect>().isCrit = false;
                damage = PlayerStats.instance.stats.knifeDamage + (PlayerStats.instance.stats.knifeDamage * PlayerStats.instance.stats.moreDamage / PlayerStats.instance.stats.knifeDamage);
            }

            // 화염장미 검 능력
            if (PlayerStats.instance.stats.knifeLv / 10 == 4)
            {
                if (!isFire)
                {
                    StartCoroutine(Fire());
                }
            }
            // 화염장미 검 능력
            // 메카기어드 능력
            else if (PlayerStats.instance.stats.knifeLv / 10 == 7 && Random.Range(1, 100) <= 30f)
            {
                int n = Random.Range(1, 3);
                for (int i = 0; i <= n; i++)
                {
                    Ingame.instance.poolMekaGearEffect.Spawn(transform.position);
                }
            }
            // 메카기어드 능력
            // 인도자 능력
            else if (PlayerStats.instance.stats.knifeLv / 10 == 8)
            {
                Ingame.instance.poolSwordOraEffect.Spawn(transform.position);
            }
            // 인도자 능력

            obj.GetComponent <DamageEffect>().getDamage = (float)damage;
            enemyHP -= (float)damage;

            Ingame.instance.poolHitEffect.Spawn(transform.position);
        }

        // 블래스트 능력
        if (other.transform.tag == "Explosion")
        {
            if (!isFire)
            {
                StartCoroutine(Fire());
            }
        }
        // 블래스트 능력
        // 은하계 능력
        if (other.transform.tag == "BlackHole")
        {
            enemyHP = 0f;
            Ingame.instance.poolHitEffect.Spawn(transform.position);
        }
        // 은하계 능력
        // 메카기어드 능력
        if (other.transform.tag == "MekaGear")
        {
            DamageEffect obj = Ingame.instance.poolDamageEffect.Spawn(transform.position);
            obj.GetComponent <DamageEffect>().isCrit = true;
            // 폭발 이펙트
            double damage = (PlayerStats.instance.stats.knifeDamage + (PlayerStats.instance.stats.knifeDamage * PlayerStats.instance.stats.moreDamage / PlayerStats.instance.stats.knifeDamage)) * 3;
            Instantiate(explosionEffect, transform.position, transform.rotation);

            obj.GetComponent <DamageEffect>().getDamage = (float)damage;
            enemyHP -= (float)damage;

            Ingame.instance.poolHitEffect.Spawn(transform.position);
        }
        // 메카기어드 능력
        // 인도자 능력
        if (other.transform.tag == "SwordOra")
        {
            DamageEffect obj = Ingame.instance.poolDamageEffect.Spawn(transform.position);
            obj.GetComponent <DamageEffect>().isCrit = true;
            double damage = (PlayerStats.instance.stats.knifeDamage + PlayerStats.instance.stats.knifeDamage * PlayerStats.instance.stats.moreDamage / PlayerStats.instance.stats.knifeDamage) + (PlayerStats.instance.stats.knifeDamage * PlayerStats.instance.stats.critDamageLv / PlayerStats.instance.stats.knifeDamage);
            obj.GetComponent <DamageEffect>().getDamage = (float)damage;
            enemyHP -= (float)damage;

            Ingame.instance.poolHitEffect.Spawn(transform.position);
        }
        // 인도자 능력
    }
예제 #14
0
        internal async Task LoadProcess(string category, int categoryIndex, int itemIndex, bool isRefresh)
        {
            cartoonType      = CartoonType.Image;
            nowItemIndex     = itemIndex;
            nowCategoryIndex = categoryIndex;
            nowCategory      = category;

            await Task.Delay(100);

            try
            {
                loadProgress.Visibility = ViewStates.Visible;
                (Activity as CartoonActivity).mainDrawerLayout.Enabled = false;
                selectedItemList.Clear();

                copyrightLayout.RemoveAllViews();

                await Task.Delay(100);

                (Activity as CartoonActivity).ListItems(categoryIndex, selectedItemList);
                selectedItemList.TrimExcess();

                string categoryPath = Path.Combine(cartoonTopPath, category);
                string itemPath     = Path.Combine(categoryPath, itemIndex.ToString());

                if (isRefresh)
                {
                    Directory.Delete(itemPath, true);
                }

                if (!Directory.Exists(categoryPath))
                {
                    Directory.CreateDirectory(categoryPath);
                }

                if (!Directory.Exists(itemPath))
                {
                    Directory.CreateDirectory(itemPath);
                    await DownloadCartoon(category, itemIndex);
                }
                else
                {
                    if (Directory.GetFiles(itemPath).Length == 0)
                    {
                        await DownloadCartoon(category, itemIndex);
                    }
                }

                var layout = new LinearLayout(Activity);
                var tv1    = new TextView(Activity);
                var tv2    = new TextView(Activity)
                {
                    AutoLinkMask = Android.Text.Util.MatchOptions.WebUrls
                };

                switch (categoryIndex)
                {
                case 0:
                    tv1.Text = "Creator : 츠보우";
                    tv2.Text = "http://kazensky.blog.me/221115059226";
                    break;

                case 1:
                case 2:
                case 3:
                case 4:
                    tv1.Text = "Creator : 잉여군";
                    tv2.Text = "https://twitter.com/INGUKOON";
                    break;

                case 5:
                case 6:
                    tv1.Text = "Creator : MADCORE";
                    tv2.Text = "https://www.pixiv.net/member.php?id=455690";
                    break;

                case 9:
                    tv1.Text = "Creator : MMM";
                    tv2.Text = "https://www.pixiv.net/member.php?id=25683341";
                    break;

                case 11:
                    tv1.Text = "Creator : 센롱";
                    tv2.Text = "https://www.pixiv.net/users/21946119";
                    break;
                }

                layout.Orientation = Orientation.Vertical;
                tv1.Gravity        = GravityFlags.Center;
                tv2.Gravity        = GravityFlags.Center;

                layout.AddView(tv1);
                layout.AddView(tv2);

                copyrightLayout.AddView(layout);

                var Files = Directory.GetFiles(itemPath).ToList();
                Files.TrimExcess();
                Files.Sort(SortCartoonList);
                bitmapList.Clear();

                const int imageSize = 500;

                foreach (string file in Files)
                {
                    var drawable = Drawable.CreateFromPath(file);
                    var bitmap   = (drawable as BitmapDrawable).Bitmap;

                    int height = 0;

                    while (height < bitmap.Height)
                    {
                        int remainHeight = bitmap.Height - height;
                        var bitmapFix    = (remainHeight >= imageSize) ? Android.Graphics.Bitmap.CreateBitmap(bitmap, 0, height, bitmap.Width, imageSize) :
                                           Android.Graphics.Bitmap.CreateBitmap(bitmap, 0, height, bitmap.Width, remainHeight);

                        height += (remainHeight >= imageSize) ? imageSize : remainHeight;

                        bitmapList.Add(bitmapFix);
                    }

                    await Task.Delay(10);
                }

                bitmapList.TrimExcess();

                mainRecyclerView.SetAdapter(new CartoonScreenAdapter(bitmapList.ToArray()));

                GC.Collect();

                loadProgress.Visibility = ViewStates.Invisible;
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, Activity);
            }
            finally
            {
                (Activity as CartoonActivity).mainDrawerLayout.Enabled = false;
                toolbarTitle.Text           = selectedItemList[itemIndex];
                webViewLayout.Visibility    = ViewStates.Gone;
                mainRecyclerView.Visibility = ViewStates.Visible;
            }
        }