Beispiel #1
0
    void SpawnNewTilesAndRelocate(List <DoubleInt> tilesCoords)
    {
        DoubleInt grid = bGenerator.Grid;

        for (int y = 0; y < grid.y; y++)
        {
            foreach (var coord in tilesCoords)
            {
                offsetX = currentMatchCountList[y];

                if (coord.y == y)
                {
                    GameObject tileGO;
                    if (cManager.IsTutorial)
                    {
                        tileGO = bGenerator.CreatePresetTile(grid.x + offsetX, coord.x, y);
                    }
                    else
                    {
                        tileGO = bGenerator.CreateTile(grid.x + offsetX, y);
                    }

                    Tile tile = tileGO.GetComponent <Tile>();
                    tile.Coord.x            = coord.x;
                    Board[coord.x, coord.y] = tileGO;

                    tilesToManualMove.Add(tile);

                    currentMatchCountList[y]++;
                }
            }
        }

        MoveAllTilesToItsDesiredLocation();
    }
Beispiel #2
0
    void OnMatchingDone(List <Tile> tiles)
    {
        int       count = tiles.Count;
        DoubleInt max   = bGenerator.Grid;

        currentMatchCountList = new List <int>();

        cManager.ChangeCombatState(CombatState.MatchClearing);

        //Won't Affect Tiles
        OnStartBoardEffect.Invoke(tiles);

        //Get How much tiles need to be fill for every row
        for (int y = 0; y < max.y; y++)
        {
            currentMatchCountList.Add(0);
        }

        foreach (var item in tiles)
        {
            ClearMatchedTiles(item.Coord.x, item.Coord.y);
        }

        OnDestroyTiles.Invoke();

        //Camera Shake
        camShake.CameraShakeByInput(ShakeStrength, ShakeTimer);
    }
Beispiel #3
0
 public StoreItem(int itemId, int productId, int count, int currency, string exchange, string requireMission, int storeId, float chance = 1f)
 {
     this.itemId    = itemId;
     this.productId = productId;
     this.count     = count;
     this.currency  = currency;
     this.exchange  = new DoubleInt(exchange, ':');
     string[] reqMissions = requireMission.Split(',');
     requireMissions = new int[reqMissions.Length];
     for (int i = 0; i < requireMissions.Length; i++)
     {
         requireMissions[i] = int.Parse(reqMissions[i]);
     }
     this.storeId = storeId;
     this.chance  = chance;
 }
Beispiel #4
0
        public WeaponItem(JSONNode node)
        {
            Main.Dbgl("1");
            this.name          = node["name"];
            this.description   = node["description"];
            this.effect        = node["effect"];
            this.buyPrice      = node["buyPrice"].AsInt;
            this.sellPrice     = new DoubleInt(node["sellPrice"], ':');
            this.iconPath      = node["iconPath"];
            this.modelPath     = node["modelPath"];
            this.dropModelPath = node["dropModelPath"];
            this.displayScale  = node["displayScale"].AsFloat;
            this.orderIndex    = node["orderIndex"].AsInt;

            this.source = node["source"];

            this.intendType = node["intendType"].AsInt;

            string temp = node["skillIds"];

            string[] skillTemp = temp.Split(',');
            if (skillTemp.Length > 0)
            {
                this.skillIds = new int[skillTemp.Length];
                for (int i = 0; i < skillTemp.Length; i++)
                {
                    this.skillIds[i] = int.Parse(skillTemp[i]);
                }
            }

            this.attack              = node["attack"].AsInt;
            this.defense             = node["defense"].AsInt;
            this.critical            = node["critical"].AsFloat;
            this.antiCritical        = node["antiCritical"].AsFloat;
            this.hpMax               = node["hpMax"].AsFloat;
            this.cpMax               = node["cpMax"].AsFloat;
            this.alwaysOnHand        = node["alwaysOnHand"].AsBool;
            this.holdInBothHands     = node["holdInBothHands"].AsBool;
            this.digGridCount        = node["digGridCount"].AsFloat;
            this.digIntensity        = node["digIntensity"].AsFloat;
            this.rate                = node["rate"].AsFloat;
            this.meleeCriticalAmount = node["meleeCriticalAmount"].AsFloat;

            this.storeId = node["storeId"].AsInt;
            this.chance  = node["chance"].AsInt;
        }
Beispiel #5
0
 bool CheckIsSurround(DoubleInt passiveCoord, DoubleInt coord)
 {
     if (passiveCoord.x - 1 == coord.x && passiveCoord.y == coord.y ||
         passiveCoord.x + 1 == coord.x && passiveCoord.y == coord.y ||
         passiveCoord.y + 1 == coord.y && passiveCoord.x == coord.x ||
         passiveCoord.y - 1 == coord.y && passiveCoord.x == coord.x ||
         passiveCoord.x - 1 == coord.x && passiveCoord.y - 1 == coord.y ||
         passiveCoord.x + 1 == coord.x && passiveCoord.y - 1 == coord.y ||
         passiveCoord.x - 1 == coord.x && passiveCoord.y + 1 == coord.y ||
         passiveCoord.x + 1 == coord.x && passiveCoord.y + 1 == coord.y)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Beispiel #6
0
    void DoConnectable(Tile tile)
    {
        DoubleInt coord        = tile.Coord;
        DoubleInt passiveCoord = Tiles.Last().Coord;

        if (CheckIsSurround(passiveCoord, coord) == false || SelectedTileType.Count == 0)
        {
            return;
        }

        if (tile.Type != SelectedTileType[SelectedTileType.IndexOf(CurrentSelectedTileType)] &&
            Tiles.Count >= IntervalCount * SelectedTileType.Count &&
            CheckValidToNextTileType())
        {
            CurrentSelectedTileType = tile.Type;
            SelectedTileType.Add(CurrentSelectedTileType);
        }

        if (tile.Type == CurrentSelectedTileType)
        {
            tile.GroupIndex = SelectedTileType.Count;
            AddTile(tile);
        }
    }
        private static void Junk()
        {
            SqliteDataReader sqliteDataReader = LocalDb.cur.ReadFullTable("Item_equipment");

            while (sqliteDataReader.Read())
            {
                int      @int    = sqliteDataReader.GetInt32(sqliteDataReader.GetOrdinal("orderId"));
                string   @string = sqliteDataReader.GetString(sqliteDataReader.GetOrdinal("itemReq"));
                string   string2 = sqliteDataReader.GetString(sqliteDataReader.GetOrdinal("gold"));
                string   string3 = sqliteDataReader.GetString(sqliteDataReader.GetOrdinal("exp"));
                string   string4 = sqliteDataReader.GetString(sqliteDataReader.GetOrdinal("relationship"));
                string   string5 = sqliteDataReader.GetString(sqliteDataReader.GetOrdinal("workshoppt"));
                string   string6 = sqliteDataReader.GetString(sqliteDataReader.GetOrdinal("level"));
                string[] array   = string6.Split(new char[]
                {
                    '_'
                });
                int num  = int.Parse(array[0]);
                int num2 = -1;
                if (array.Length > 1)
                {
                    num2 = int.Parse(array[1]);
                }
                int      int2   = sqliteDataReader.GetInt32(sqliteDataReader.GetOrdinal("weight"));
                int      int3   = sqliteDataReader.GetInt32(sqliteDataReader.GetOrdinal("deadline"));
                string[] array2 = @string.Split(new char[]
                {
                    '_'
                });
                int        num3      = int.Parse(array2[0]);
                DoubleInt  doubleInt = DoubleInt.ParseDoubleId(array2[1], '-');
                List <int> list      = new List <int>();
                List <int> list2     = new List <int>();
                string     string7   = sqliteDataReader.GetString(sqliteDataReader.GetOrdinal("season"));
                string     string8   = sqliteDataReader.GetString(sqliteDataReader.GetOrdinal("weather"));
                if (!string.IsNullOrEmpty(string7) && string7 != "-1")
                {
                    string[] array3 = string7.Split(new char[]
                    {
                        ','
                    });
                    foreach (string s in array3)
                    {
                        list.Add(int.Parse(s));
                    }
                }
                if (!string.IsNullOrEmpty(string8) && string8 != "-1")
                {
                    string[] array5 = string8.Split(new char[]
                    {
                        ','
                    });
                    foreach (string s2 in array5)
                    {
                        list2.Add(int.Parse(s2));
                    }
                }
                DoubleInt di2 = DoubleInt.ParseDoubleId(string2, '-');
                DoubleInt di3 = DoubleInt.ParseDoubleId(string3, '-');
                DoubleInt di4 = DoubleInt.ParseDoubleId(string4, '-');
                DoubleInt di5 = DoubleInt.ParseDoubleId(string5, '-');
                Dbgl(@int + " " + ItemDataMgr.Self.GetItemName(num3) + ": RequirementData.refDataDic.Add(index, reqDatas[index] = new RequirementData(index++," + num3 + ", new DoubleInt(" + doubleInt.id0 + "," + doubleInt.id1 + "), new DoubleInt(" + di2.id0 + "," + di2.id1 + "), new DoubleInt(" + di3.id0 + "," + di3.id1 + "), new DoubleInt(" + di4.id0 + "," + di4.id1 + "), new DoubleInt(" + di5.id0 + "," + di5.id1 + ")," + num + "," + num2 + "," + int2 + "," + int3 + ", new int[]{" + string.Join(",", list.Select(x => x.ToString()).ToArray()) + "},new int[]{" + string.Join(",", list2.Select(x => x.ToString()).ToArray()) + "}));", false);
            }
        }
Beispiel #8
0
    public bool WriteAsm(string asm)
    {
        MethodDefTable m = this.pedata.idxm.GetTable(this.pedata.cli.EntryPointToken) as MethodDefTable;

        if (m == null)
        {
            System.Console.WriteLine("Can not find entry point!");
            return(false);
        }
        this.entryPoint = m.Tag as MethodData;
        System.Console.WriteLine("Entry Point: {0}", this.entryPoint.FullName);

        bool         ok = true;
        FileStream   fs = new FileStream(asm, FileMode.Create);
        StreamWriter sw = new StreamWriter(fs);

        this.hashUS = new Hashtable();
        this.listUS = new ArrayList();
        if (this.pedata.usrstr != null)
        {
            int ad = this.pedata.usrstr.GetDataOffset(), ptr = 1;
            while (this.data[ad + ptr] != 0 && ptr < this.pedata.usrstr.Size)
            {
                DoubleInt dataSize = this.pedata.usrstr.GetDataSize(ad + ptr);
                byte[]    bytes    = Girl.PEAnalyzer.Util.GetBytes(this.data, ad + ptr + dataSize.A, dataSize.B);
                this.hashUS[ptr] = Encoding.Unicode.GetString(bytes, 0, dataSize.B - 1);
                ptr += dataSize.A + dataSize.B;
            }
        }

        this.number = 0;
        sw.WriteLine("; This file was automatically generated by IL2Asm16.");
        if (this.pre != null)
        {
            this.InsertFile(sw, this.pre);
        }
        sw.WriteLine();
        sw.WriteLine("[bits 16]");
        if (!this.noMain)
        {
            sw.WriteLine("jmp {0}", this.jumpTo);
            sw.WriteLine();

            sw.WriteLine("ILMain:");
            foreach (object obj in this.pedata.idxm.Tables[(int)MetadataTables.TypeDef])
            {
                TypeDefTable t = obj as TypeDefTable;
                foreach (object obj2 in t.Children[(int)Children.DefMethod])
                {
                    MethodDefTable mdt = obj2 as MethodDefTable;
                    MethodData     md  = mdt.Tag as MethodData;
                    if (!md.Name.EndsWith("::.cctor"))
                    {
                        continue;
                    }

                    sw.WriteLine("\tcall\t{0}", Util.MangleFunction(md));
                }
            }
            sw.WriteLine("\tcall\t{0}", Util.MangleFunction(this.entryPoint));
            sw.WriteLine("\tret");
        }

        foreach (object obj in this.pedata.idxm.Tables[(int)MetadataTables.TypeDef])
        {
            TypeDefTable t = obj as TypeDefTable;
            sw.WriteLine();
            if (!this.WriteAsm(sw, t))
            {
                ok = false;
            }
        }

        if (this.listUS.Count > 0)
        {
            sw.WriteLine();
            this.listUS.Sort();
            foreach (object obj in this.listUS)
            {
                int           ptr   = (int)obj;
                string        str   = this.hashUS[ptr] as string;
                bool          instr = false;
                StringBuilder sb    = new StringBuilder();
                foreach (char ch in str)
                {
                    if (ch < ' ')
                    {
                        if (instr)
                        {
                            sb.Append('\"');
                            instr = false;
                        }
                        if (sb.Length > 0)
                        {
                            sb.Append(", ");
                        }
                        sb.AppendFormat("0x{0:x2}", (int)ch);
                    }
                    else
                    {
                        if (!instr)
                        {
                            sb.Append('\"');
                            instr = true;
                        }
                        sb.Append(ch);
                    }
                }
                if (instr)
                {
                    sb.Append('\"');
                }
                sw.WriteLine("US_{0:X8} db {1}, {2}, 0x00", ptr, str.Length, sb);
            }
        }

        if (this.post != null)
        {
            this.InsertFile(sw, this.post);
        }
        sw.Close();
        fs.Close();
        return(ok);
    }