Esempio n. 1
0
            internal override Event ReadEntry(BinaryReaderEx br)
            {
                EventType type = br.GetEnum16 <EventType>(br.Position + 0xC);

                switch (type)
                {
                case EventType.Light:
                    var light = new Event.Light(br);
                    Lights.Add(light);
                    return(light);

                case EventType.Shadow:
                    var shadow = new Event.Shadow(br);
                    Shadows.Add(shadow);
                    return(shadow);

                case EventType.Fog:
                    var fog = new Event.Fog(br);
                    Fogs.Add(fog);
                    return(fog);

                case EventType.BGColor:
                    var bgColor = new Event.BGColor(br);
                    BGColors.Add(bgColor);
                    return(bgColor);

                case EventType.MapOffset:
                    var mapOffset = new Event.MapOffset(br);
                    MapOffsets.Add(mapOffset);
                    return(mapOffset);

                case EventType.Warp:
                    var warp = new Event.Warp(br);
                    Warps.Add(warp);
                    return(warp);

                case EventType.CheapMode:
                    var cheapMode = new Event.CheapMode(br);
                    CheapModes.Add(cheapMode);
                    return(cheapMode);

                default:
                    throw new NotImplementedException($"Unimplemented event type: {type}");
                }
            }
Esempio n. 2
0
        public override void Unpack(BinaryReader reader)
        {
            Id = reader.ReadUInt32();

            Bitfield = reader.ReadUInt32();

            reader.BaseStream.Position += 4; // Skip ahead 4 bytes, because this is the CellId. Again. Twice.

            byte   numSurfaces = reader.ReadByte();
            byte   numPortals  = reader.ReadByte();     // Note that "portal" in this context does not refer to the swirly pink/purple thing, its basically connecting cells
            ushort numStabs    = reader.ReadUInt16();   // I believe this is what cells can be seen from this one. So the engine knows what else it needs to load/draw.

            // Read what surfaces are used in this cell
            for (uint i = 0; i < numSurfaces; i++)
            {
                Shadows.Add(0x08000000u | reader.ReadUInt16()); // these are stored in the dat as short values, so we'll make them a full dword
            }
            EnvironmentId = (0x0D000000u | reader.ReadUInt16());

            CellStructure = reader.ReadUInt16();

            Position.Unpack(reader);

            CellPortals.Unpack(reader, numPortals);

            for (uint i = 0; i < numStabs; i++)
            {
                VisibleCells.Add(reader.ReadUInt16());
            }

            if ((Bitfield & 2) != 0)
            {
                StaticObjects.Unpack(reader);
            }

            if ((Bitfield & 8) != 0)
            {
                RestrictionObj = reader.ReadUInt32();
            }
        }
            public void Add(IMsbEvent item)
            {
                switch (item)
                {
                case Event.Light e:
                    Lights.Add(e);
                    break;

                case Event.Shadow e:
                    Shadows.Add(e);
                    break;

                case Event.Fog e:
                    Fogs.Add(e);
                    break;

                case Event.BGColor e:
                    BGColors.Add(e);
                    break;

                case Event.MapOffset e:
                    MapOffsets.Add(e);
                    break;

                case Event.Warp e:
                    Warps.Add(e);
                    break;

                case Event.CheapMode e:
                    CheapModes.Add(e);
                    break;

                default:
                    throw new ArgumentException(
                              message: "Item is not recognized",
                              paramName: nameof(item));
                }
            }
Esempio n. 4
0
            /// <summary>
            /// Adds an event to the appropriate list for its type; returns the event.
            /// </summary>
            public Event Add(Event evnt)
            {
                switch (evnt)
                {
                case Event.Light e: Lights.Add(e); break;

                case Event.Shadow e: Shadows.Add(e); break;

                case Event.Fog e: Fogs.Add(e); break;

                case Event.BGColor e: BGColors.Add(e); break;

                case Event.MapOffset e: MapOffsets.Add(e); break;

                case Event.Warp e: Warps.Add(e); break;

                case Event.CheapMode e: CheapModes.Add(e); break;

                default:
                    throw new ArgumentException($"Unrecognized type {evnt.GetType()}.", nameof(evnt));
                }
                return(evnt);
            }
Esempio n. 5
0
 public void AddShadow(int packageSize, byte[] itemString, byte itemVersion)
 {
     Shadows.Add(new ItemPackageShadow(packageSize, itemString, itemVersion, TransactionId));
 }
Esempio n. 6
0
 /// <summary>
 /// Teammember
 /// </summary>
 /// <param name="teammemberId"></param>
 /// <param name="playerId"></param>
 /// <param name="operationType"></param>
 public void AddShadow(Guid teammemberId, int playerId, EnumOperationType operationType)
 {
     Shadows.Add(new TeammemberShadow(teammemberId, playerId, operationType, TransactionId));
 }
Esempio n. 7
0
 /// <summary>
 /// Teammember
 /// </summary>
 /// <param name="entity"></param>
 /// <param name="operationType"></param>
 public void AddShadow(TeammemberEntity entity, EnumOperationType operationType)
 {
     Shadows.Add(new TeammemberShadow(entity, operationType, TransactionId));
 }
Esempio n. 8
0
 /// <summary>
 /// PandoraEquipmentwash
 /// </summary>
 /// <param name="managerId"></param>
 /// <param name="itemId"></param>
 /// <param name="itemCode"></param>
 /// <param name="lockPropertyId"></param>
 /// <param name="buyStone"></param>
 /// <param name="buyFusogen"></param>
 /// <param name="costPoint"></param>
 public void AddShadow(Guid itemId, int itemCode, int lockPropertyId, bool buyStone, bool buyFusogen, int costPoint)
 {
     Shadows.Add(new PandoraEquipmentwashShadow(itemId, itemCode, lockPropertyId, buyStone, buyFusogen, costPoint, TransactionId));
 }
Esempio n. 9
0
 /// <summary>
 /// PandoraStrength
 /// </summary>
 /// <param name="managerId"></param>
 /// <param name="itemId1"></param>
 /// <param name="itemCode1"></param>
 /// <param name="strength1"></param>
 /// <param name="itemId2"></param>
 /// <param name="itemCode2"></param>
 /// <param name="strength2"></param>
 /// <param name="isProtect"></param>
 /// <param name="costCoin"></param>
 /// <param name="costPoint"></param>
 /// <param name="resultType"></param>
 /// <param name="resultItemId"></param>
 /// <param name="resultItemCode"></param>
 /// <param name="resultStrength"></param>
 public void AddShadow(Guid itemId1, int itemCode1, int strength1, bool isProtect, int costCoin, int costPoint, int resultType, Guid resultItemId, int resultItemCode, int resultStrength
                       , Guid luckyItemId, int luckyItemCode, double rate)
 {
     Shadows.Add(new PandoraStrengthShadow(itemId1, itemCode1, strength1, isProtect, costCoin, costPoint, resultType, resultItemId, resultItemCode, resultStrength, TransactionId, luckyItemId, luckyItemCode, rate));
 }
Esempio n. 10
0
 /// <summary>
 /// PandoraMosaic
 /// </summary>
 /// <param name="managerId"></param>
 /// <param name="itemId"></param>
 /// <param name="itemCode"></param>
 /// <param name="slotId"></param>
 /// <param name="ballsoulId"></param>
 /// <param name="ballsoulItemCode"></param>
 public void AddShadow(Guid itemId, int itemCode, int slotId, Guid ballsoulId, int ballsoulItemCode)
 {
     Shadows.Add(new PandoraMosaicShadow(itemId, itemCode, slotId, ballsoulId, ballsoulItemCode, TransactionId));
 }
Esempio n. 11
0
 /// <summary>
 /// 勋章兑换
 /// </summary>
 /// <param name="managerId"></param>
 /// <param name="itemIds"></param>
 /// <param name="itemCodes"></param>
 /// <param name="medalCount"></param>
 public void AddShadow(Guid managerId, int type, string itemIds, string itemCodes, int medalCount)
 {
     Shadows.Add(new PandoraMedalShadow(managerId, type, itemIds, itemCodes, medalCount, TransactionId));
 }
Esempio n. 12
0
 /// <summary>
 /// PandoraArousal
 /// </summary>
 /// <param name="managerId"></param>
 /// <param name="sourceCard"></param>
 /// <param name="sourceCardLv"></param>
 /// <param name="curArousalLv"></param>
 /// <param name="tarArousalLv"></param>
 /// <param name="useCard"></param>
 /// <param name="useCardLevel"></param>
 /// <param name="isBingding"></param>
 public void AddShadow(Guid managerId, Guid sourceCard, int sourceCardLv, int curArousalLv, int tarArousalLv, Guid useCard,
                       int useCardStrenth, bool isBingding)
 {
     Shadows.Add(new PandoraArousalShadow(managerId, sourceCard, sourceCardLv, curArousalLv, tarArousalLv, useCard, useCardStrenth,
                                          isBingding, TransactionId));
 }
Esempio n. 13
0
 /// <summary>
 /// PandoraEquipmentPrecisionCasting
 /// </summary>
 public void AddShadow(Guid managerId, Guid itemId, string lockCondition, string exProperties, string curProperties, int coin, int point)
 {
     Shadows.Add(new PandoraEquipmentPrecisionCastingShadow(managerId, itemId, lockCondition, exProperties,
                                                            curProperties, coin, point, TransactionId));
 }
Esempio n. 14
0
 /// <summary>
 /// PandoraEquipmentUpgradeShadow
 /// </summary>
 /// <param name="itemId"></param>
 /// <param name="curLevel"></param>
 /// <param name="resultLevel"></param>
 /// <param name="costCoin"></param>
 public void AddShadow(Guid managerId, Guid itemId, int curLevel, int resultLevel, string properties, int costCoin)
 {
     Shadows.Add(new PandoraEquipmentUpgradeShadow(managerId, itemId, curLevel, resultLevel, properties, costCoin, TransactionId));
 }
Esempio n. 15
0
 /// <summary>
 /// PandoraEquipmentSellShadow
 /// </summary>
 /// <param name="managerId"></param>
 /// <param name="itemId"></param>
 /// <param name="itemCode"></param>
 /// <param name="coin"></param>
 public void AddShadow(Guid managerId, Guid itemId, int itemCode, int coin)
 {
     Shadows.Add(new PandoraEquipmentSellShadow(managerId, itemId, itemCode, coin, TransactionId));
 }
Esempio n. 16
0
 public void AddShadow(Shadow shadow)
 {
     Shadows.Add(shadow);
 }
Esempio n. 17
0
        /// <summary>
        /// PandoraSynthesis
        /// </summary>
        /// <param name="managerId"></param>
        /// <param name="itemId1"></param>
        /// <param name="itemCode1"></param>
        /// <param name="itemId2"></param>
        /// <param name="itemCode2"></param>
        /// <param name="itemId3"></param>
        /// <param name="itemCode3"></param>
        /// <param name="itemId4"></param>
        /// <param name="itemCode4"></param>
        /// <param name="itemId5"></param>
        /// <param name="itemCode5"></param>
        /// <param name="suitdrawingId"></param>
        /// <param name="suitdrawingItemCode"></param>
        /// <param name="isProtect"></param>
        /// <param name="costCoin"></param>
        /// <param name="costPoint"></param>
        /// <param name="resultType"></param>
        /// <param name="resultItemId"></param>
        /// <param name="resultItemCode"></param>
        public void AddShadow(int synthesisType, List <ItemInfoEntity> itemList, Dictionary <Guid, ItemInfoEntity> mallList, Dictionary <Guid, int> mallCountDic, Guid suitdrawingId, int suitdrawingItemCode,
                              bool isProtect, int costCoin, int costPoint, int resultType, Guid resultItemId, int resultItemCode
                              , Guid luckyItemId, int luckyItemCode, Guid goldformulaItemId, int goldformulaItemCode, double rate)
        {
            Guid itemId1 = Guid.Empty; int itemCode1 = 0; Guid itemId2 = Guid.Empty; int itemCode2 = 0;
            Guid itemId3 = Guid.Empty; int itemCode3 = 0; Guid itemId4 = Guid.Empty; int itemCode4 = 0; Guid itemId5 = Guid.Empty; int itemCode5 = 0;

            if (itemList.Count > 0)
            {
                itemId1   = itemList[0].ItemId;
                itemCode1 = itemList[0].ItemCode;
            }
            if (itemList.Count > 1)
            {
                itemId2   = itemList[1].ItemId;
                itemCode2 = itemList[1].ItemCode;
            }
            if (itemList.Count > 2)
            {
                itemId3   = itemList[2].ItemId;
                itemCode3 = itemList[2].ItemCode;
            }
            if (itemList.Count > 3)
            {
                itemId4   = itemList[3].ItemId;
                itemCode4 = itemList[3].ItemCode;
            }
            if (itemList.Count > 4)
            {
                itemId5   = itemList[4].ItemId;
                itemCode5 = itemList[4].ItemCode;
            }
            int mallCount = 0;

            if (mallList != null)
            {
                foreach (var entity in mallList.Values)
                {
                    int count = mallCountDic[entity.ItemId];
                    for (int i = 0; i < count; i++)
                    {
                        mallCount++;
                        switch (mallCount)
                        {
                        case 1:
                            itemId5   = entity.ItemId;
                            itemCode5 = entity.ItemCode;
                            break;

                        case 2:
                            itemId4   = entity.ItemId;
                            itemCode4 = entity.ItemCode;
                            break;

                        case 3:
                            itemId3   = entity.ItemId;
                            itemCode3 = entity.ItemCode;
                            break;

                        case 4:
                            itemId2   = entity.ItemId;
                            itemCode2 = entity.ItemCode;
                            break;

                        case 5:
                            itemId1   = entity.ItemId;
                            itemCode1 = entity.ItemCode;
                            break;
                        }
                    }
                }
            }


            Shadows.Add(new PandoraSynthesisShadow(synthesisType, itemId1, itemCode1, itemId2, itemCode2, itemId3,
                                                   itemCode3, itemId4, itemCode4, itemId5, itemCode5, suitdrawingId,
                                                   suitdrawingItemCode, isProtect, costCoin, costPoint, resultType,
                                                   resultItemId, resultItemCode, TransactionId, luckyItemId,
                                                   luckyItemCode, goldformulaItemId, goldformulaItemCode, rate));
        }
Esempio n. 18
0
 /// <summary>
 /// PandoraDecompose
 /// </summary>
 /// <param name="managerId"></param>
 /// <param name="itemIds"></param>
 /// <param name="itemCodes"></param>
 /// <param name="critRate"></param>
 /// <param name="isCrit"></param>
 /// <param name="coin"></param>
 /// <param name="equipmentList"></param>
 public void AddShadow(string itemIds, string itemCodes, int critRate, bool isCrit, int coin, string equipmentList)
 {
     Shadows.Add(new PandoraDecomposeShadow(itemIds, itemCodes, critRate, isCrit, coin, equipmentList, TransactionId));
 }