Beispiel #1
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 4:
            case 3:
            case 2:
            {
                m_Level = reader.ReadInt();
                goto case 1;
            }

            case 1:
            {
                m_TargetMap      = reader.ReadMap();
                m_TargetLocation = reader.ReadPoint3D();
                m_MessageIndex   = reader.ReadInt();

                break;
            }

            case 0:
            {
                m_TargetMap = this.Map;

                if (m_TargetMap == null || m_TargetMap == Map.Internal)
                {
                    m_TargetMap = Map.Trammel;
                }

                m_TargetLocation = FindLocation(m_TargetMap);
                m_MessageIndex   = Utility.Random(MessageEntry.Entries.Length);

                break;
            }
            }

            if (version < 2)
            {
                m_Level = MessageInABottle.GetRandomLevel();
            }

            if (version < 3)
            {
                UpdateHue();
            }

            if (version < 4 && m_TargetMap == Map.Tokuno)
            {
                m_TargetMap = Map.Trammel;
            }
        }
Beispiel #2
0
 public SOS(Map map) : this(map, MessageInABottle.GetRandomLevel())
 {
 }