Exemple #1
0
    public override IS Habilidade1()
    {
        string text       = "O monstro " + nome + " usou Buff Montruoso e ganhou +3 em um status aleatório.";
        int    habilidade = UnityEngine.Random.Range(1, 5);

        switch (habilidade)
        {
        case 1:
            statInt += 3;
            break;

        case 2:
            statFor += 3;
            break;

        case 3:
            statDes += 3;
            break;

        case 4:
            statVel += 3;
            break;
        }
        IS retorno = new IS(3, text);

        boolADB = new BBB(false, false, true);
        turno++;
        return(retorno);
    }
    // Update is called once per frame
    void Update()
    {
        if (Time.time > nextTime)
        {
            //Time > 점점 빨라짐....
            nextTime = Time.time + Mathf.Lerp(TIME_BETWEEN.x, TIME_BETWEEN.y, BBB.GetTimeInterpolate(TIME_MAX));
            pos.Set(Random.Range(-screenInfo.x, screenInfo.y), screenInfo.y);
            quat = Quaternion.Euler(Vector3.forward * Random.Range(angleMinMax.x, angleMinMax.y));

            Transform _trans = Instantiate(block, pos, quat) as Transform;
            _trans.localScale *= Random.Range(sizeMinMax.x, sizeMinMax.y);

            //Score call back Register.
            BlockMove _scp = _trans.GetComponent <BlockMove> ();
            if (_scp != null)
            {
                _scp.onDeath += delegate() {
                    if (player != null)
                    {
                        score++;
                        scoreText.text = score.ToString();
                    }
                };
            }
            //_go.transform.position = new Vector2(
            //	_go.transform.position.x,
            //	_go.transform.position.y + _go.GetComponent<Renderer> ().bounds.extents.y*2
            //);
        }
    }
Exemple #3
0
    private void Awake()
    {
        DebugSystem.Log("Sdk Init");
        try
        {
            //AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
            // AndroidJavaObject activity = jc.GetStatic<AndroidJavaObject>("currentActivity");

            mObj = new AndroidJavaObject("com.xk.sharesdk.ShareSDK");

            if (mObj == null)
            {
                errorStr += "mObj is null\n";
                DebugSystem.LogError("mObj is null");
            }
            else
            {
                errorStr += "mObj is no null\n";
                DebugSystem.Log("mObj is no null");
            }

            int sum = mObj.Call <int>("AAA", 10, 15);
            errorStr += "sum1: " + sum + "\n";

            try
            {
                AndroidJavaObject mObj1 = new AndroidJavaObject("com.xk.sharesdk.BBB");

                if (mObj1 == null)
                {
                    errorStr += "mObj1 is null\n";
                    DebugSystem.LogError("mObj1 is null");
                }
                else
                {
                    errorStr += "mObj1 is no null\n";
                    DebugSystem.Log("mObj1 is no null");
                    mObj1.Set <int>("aaa", 200);
                    mObj1.Set <int>("bbb", 300);
                }
                sum       = mObj.Call <int>("AAA1", mObj1);
                errorStr += "sum2: " + sum + "\n";
            }catch (Exception e)
            {
                errorStr += "xk_Exception111: " + e.Message + "\n";
                DebugSystem.LogError("xk_Exception: " + e.Message);
            }

            BBB mBBB = new BBB();
            mBBB.aaa  = 100;
            mBBB.bbb  = 200;
            sum       = mObj.Call <int>("AAA1", mBBB);
            errorStr += "sum3: " + sum + "\n";
        }
        catch (Exception e)
        {
            errorStr += "xk_Exception: " + e.Message + "\n";
            DebugSystem.LogError("xk_Exception: " + e.Message);
        }
    }
        static void Main(string[] args)
        {
            AAA   Obj  = new AAA(5, 6);
            BBB   Obj2 = new BBB(1, 2, 4, 5);
            int   R1   = Obj2.F(2, 5);
            float R2   = Obj2.F(2, 5.0f);

            Console.Write(R2);
        }
        static void Main(string[] args)
        {
            AAA Obj1 = new AAA();
            BBB Obj2 = new BBB();
            int R1   = Obj1.F(2, 5);
            int R2   = Obj2.F(2, 5);

            Console.WriteLine(R2);
        }
Exemple #6
0
 public void DrawOnLaptop(SpriteBatch sb)
 {
     Eyesaur.DrawOnLaptop(sb);
     Flumpty.DrawOnLaptop(sb);
     BBB.DrawOnLaptop(sb);
     Clown.DrawOnLaptop(sb);
     Owl.DrawOnLaptop(sb);
     Redman.DrawOnLaptop(sb);
     GoldenFlumpty.DrawOnLaptop(sb);
 }
Exemple #7
0
    public override IS Defender()
    {
        int    defesa  = statDes * 2;
        string text    = "O monstro " + nome + " usou Defesa Monstruosa e defendeu " + defesa + " de dano";
        IS     retorno = new IS(defesa, text);

        boolADB = new BBB(false, true, false);
        turno++;
        return(retorno);
    }
Exemple #8
0
            public BBB Get(string symbol)
            {
                BBB list;

                if (!dict.TryGetValue(symbol, out list))
                {
                    list = new BBB();
                    dict.Add(symbol, list);
                }
                return(list);
            }
Exemple #9
0
        public void DrawOnCamera(SpriteBatch sb, Vector2 offset, CameraIndex cam)
        {
            Owl.DrawOnCamera(sb, offset, cam);

            if (cam != CameraIndex.Cam6)
            {
                Eyesaur.DrawOnCamera(sb, offset, cam);
            }

            Clown.DrawOnCamera(sb, offset, cam);
            Flumpty.DrawOnCamera(sb, offset, cam);
            BBB.DrawOnCamera(sb, offset, cam);

            if (cam == CameraIndex.Cam6)
            {
                Eyesaur.DrawOnCamera(sb, offset, cam);
            }
        }
Exemple #10
0
    public override IS Atacar()
    {
        int dano = 0;

        if (tipo == "FOR")
        {
            dano = statFor * 2;
        }
        else if (tipo == "INT")
        {
            dano = statInt * 2;
        }

        string text = "O monstro " + nome + " usou Ataque Monstruoso e deu " + dano + " de dano";

        IS retorno = new IS(dano, text);

        boolADB = new BBB(true, false, false);
        turno++;
        return(retorno);
    }
        public aaa(int num, double itemwidth)
        {
            Name2 = new BBB();

            for (int i = 0; i < num; i++)
            {
                String ccc = "bbb";
                if (i == 4)
                {
                    ccc = "njlkdsf\nv;fdsn\nkm;sdfnb\nvjdsfk;\nvjfdsk;\nvsuitrthhrthrhrhtrhhbhndfbndklj@@@";
                }

                if (i == 1)
                {
                    ccc = "nnnnnnn";
                }

                Name2.Add(new bbb()
                {
                    Name = ccc + num.ToString() + " " + i.ToString() + " ", ItemWidth = itemwidth
                });
            }
        }
Exemple #12
0
 void MethodAAA(AAA aaa, BBB bbb)
 {
     aaa.a = 100;
     bbb.a = 200;
 }
    private string VerificadorAcao(int inimigoInfos)
    {
        string resultadoTexto   = null;
        BBB    acaoJogador      = Jogador.Singleton.classeJogador.boolADB;
        int    valorAcaoJogador = gerenciadorInterface.infoBotaoAtual.valUm;
        int    dano             = 0;

        if (acaoJogador.atacou && inimigoAtual.boolADB.atacou)
        {
            inimigoAtual.Vida -= valorAcaoJogador;
            Jogador.Singleton.classeJogador.Vida -= inimigoInfos;

            resultadoTexto = "Você e o Monstro se atacam, levando consecutivamente " + valorAcaoJogador + " e " + inimigoInfos + " de dano";
        }
        else if (acaoJogador.atacou && inimigoAtual.boolADB.defendeu)
        {
            dano = inimigoInfos - valorAcaoJogador;

            if (dano >= 0)
            {
                resultadoTexto = "A defesa do Monstro prevaleceu ao seu ataque e ele saiu ileso";
            }
            else if (dano < 0)
            {
                inimigoAtual.Vida += dano;
                resultadoTexto     = "O Monstro levou " + dano + " de dano";
            }
        }
        else if (acaoJogador.atacou && inimigoAtual.boolADB.buffou)
        {
            resultadoTexto = "Você ataca o Monstro enquanto ele aumenta seu poder e da " + valorAcaoJogador + " de dano";
        }
        else if (acaoJogador.defendeu && inimigoAtual.boolADB.atacou)
        {
            dano = valorAcaoJogador - inimigoInfos;

            if (dano >= 0)
            {
                resultadoTexto = "A sua defesa prevaleceu ao ataque do Monstro e você saiu ileso";
            }
            else if (dano < 0)
            {
                Jogador.Singleton.classeJogador.Vida += dano;
                resultadoTexto = "Você levou " + dano + " de dano";
            }
        }
        else if (acaoJogador.defendeu && inimigoAtual.boolADB.defendeu)
        {
            resultadoTexto = "Nada aconteceu";
        }
        else if (acaoJogador.defendeu && inimigoAtual.boolADB.buffou)
        {
            resultadoTexto = "Nada Aconteceu";
        }
        else if (acaoJogador.buffou && inimigoAtual.boolADB.atacou)
        {
            resultadoTexto = "O Monstro lhe ataca enquanto voce aumentava suas forças e da " + inimigoInfos + " de dano";
            Jogador.Singleton.classeJogador.Vida -= inimigoInfos;
        }

        return(resultadoTexto);
    }
 public BBB Get(string symbol)
 {
     BBB list;
     if (!dict.TryGetValue(symbol, out list))
     {
         list = new BBB();
         dict.Add(symbol, list);
     }
     return list;
 }
Exemple #15
0
 void MethodBBB(AAA aaa, BBB bbb)
 {
     //aaa.a = 100; Доступа нет
     bbb.a = 200;
 }
Exemple #16
0
        public void TestReadCsvLeve3()
        {
            FileInfo fi = new FileInfo(@"d:\wukan\Desktop\DepthDataShow\20150120.txt");
            //FileInfo fo = new FileInfo(@"F:\BaiduYunDownload\DepthDataShow\20150120.pd0");

            PbTickSerializer pts = new PbTickSerializer();

            CCC ccc      = new CCC();
            CCC last_ccc = new CCC();

            AAA last = new AAA();

            last.buy = false;

            string last_symbol = "XXX";

            List <AAA> list = new List <AAA>();

            //using (Stream stream = File.Open(@"F:\BaiduYunDownload\DepthDataShow\20150120.pd0", FileMode.Create))
            {
                using (StreamReader file = new StreamReader(fi.OpenRead()))
                {
                    int    i = 0;
                    string str;
                    do
                    {
                        ++i;
                        str = file.ReadLine();
                        if (str == null)
                        {
                            break;
                        }

                        string[] arr = str.Split(',');

                        AAA a = new AAA();
                        a.symbol = arr[1];
                        a.buy    = arr[2] == "0";
                        a.price  = double.Parse(arr[3]);
                        a.size   = int.Parse(arr[4]);


                        if (last.buy == false && a.buy == true)
                        {
                            // 快照的切换点,把上次的存储都取出来,进行保存
                            // sell里先存的数字大的,后存的数字小的,最后的是卖一
                            // buy里也是先存数字大的,后存数字小的,最前的买一
                            //
                            foreach (var kv in ccc.dict)
                            {
                                kv.Value.MakeTick();

                                ccc.GetSerializer(kv.Key).Write(kv.Value.tick,
                                                                new Stream[] { ccc.GetStream(kv.Key) });
                            }

                            ccc.dict.Clear();
                        }

                        BBB bbb = ccc.Get(a.symbol);
                        bbb.symbol = a.symbol;
                        bbb.time   = arr[0];

                        if (bbb.symbol == "cu1502")
                        {
                            int nTest = 1;
                        }

                        if (a.buy)
                        {
                            bbb.AddBid(a);
                        }
                        else
                        {
                            bbb.AddAsk(a);
                        }


                        last        = a;
                        last_symbol = a.symbol;

                        //if (i < 4000)
                        //    Console.WriteLine(str);
                        //if (i > 4000)
                        //    break;
                    } while (str != null);
                    file.Close();
                }
            }
        }
Exemple #17
0
 void MethodBBB(AAA aaa, BBB bbb)
 {
     //  aaa.a = 100;
     bbb.a = 200;
 }