コード例 #1
0
        public Ultima3CharacterData()
        {
            Name           = "";
            m_torches      = new BoundedInt(0, 99);
            Sex            = U3Sex.Male;
            Class          = U3Class.Fighter;
            Health         = U3Health.Good;
            Race           = U3Race.Human;
            m_hitPoints    = new BoundedInt(0, 9999);
            HitPoints      = 150;
            m_maxHitPoints = new BoundedInt(0, 9999);
            MaxHitPoints   = 150;
            m_magicPoints  = new BoundedInt(0, 99);
            m_experience   = new BoundedInt(0, 9999);
            m_strength     = new BoundedInt(0, 99);
            m_agility      = new BoundedInt(0, 99);
            m_intelligence = new BoundedInt(0, 99);
            m_wisdom       = new BoundedInt(0, 99);
            m_food         = new BoundedInt(0, 9999);
            m_gems         = new BoundedInt(0, 99);
            m_powder       = new BoundedInt(0, 99);
            m_keys         = new BoundedInt(0, 99);
            m_torches      = new BoundedInt(0, 99);
            m_gold         = new BoundedInt(0, 9999);

            EquippedArmor  = U3Armor.Skin;
            EquippedWeapon = U3Weapons.Hands;

            Weapons = new BoundedIntArray(15, 0, 99);
            Armor   = new BoundedIntArray(7, 0, 99);
        }
コード例 #2
0
        private void LoadCharacter(int index, int offset)
        {
            string name = ProcessName(offset);

            if (name == "")
            {
                return;
            }

            // ToDo: Cards and Marks go here

            int      torches      = ConvertBCDToInt(RawFile[offset + 0x0F]);
            U3Health health       = (U3Health)RawFile[offset + 0x11];
            int      strength     = ConvertBCDToInt(RawFile[offset + 0x12]);
            int      agility      = ConvertBCDToInt(RawFile[offset + 0x13]);
            int      intelligence = ConvertBCDToInt(RawFile[offset + 0x14]);
            int      wisdom       = ConvertBCDToInt(RawFile[offset + 0x15]);

            U3Race  race        = (U3Race)RawFile[offset + 0x16];
            U3Class u3class     = (U3Class)RawFile[offset + 0x17];
            U3Sex   sex         = (U3Sex)RawFile[offset + 0x18];
            int     magicPoints = ConvertBCDToInt(RawFile[offset + 0x19]);

            int maxHitPoints = ConvertBCDToInt(RawFile[offset + 0x1a]) * 100 + ConvertBCDToInt(RawFile[offset + 0x1b]);
            int hitPoints    = ConvertBCDToInt(RawFile[offset + 0x1c]) * 100 + ConvertBCDToInt(RawFile[offset + 0x1d]);

            int experience = ConvertBCDToInt(RawFile[offset + 0x1e]) * 100 + ConvertBCDToInt(RawFile[offset + 0x1f]);

            int food = ConvertBCDToInt(RawFile[offset + 0x20]) * 100 + ConvertBCDToInt(RawFile[offset + 0x21]);

            int gold = ConvertBCDToInt(RawFile[offset + 0x23]) * 100 + ConvertBCDToInt(RawFile[offset + 0x24]);

            int gems   = ConvertBCDToInt(RawFile[offset + 0x25]);
            int keys   = ConvertBCDToInt(RawFile[offset + 0x26]);
            int powder = ConvertBCDToInt(RawFile[offset + 0x27]);

            U3Armor   equippedArmor  = (U3Armor)RawFile[offset + 0x28];
            U3Weapons equippedWeapon = (U3Weapons)RawFile[offset + 0x30];

            int[] armor = new int[7];
            for (int i = 0; i < 7; ++i)
            {
                armor[i] = ConvertBCDToInt(RawFile[offset + 0x29 + i]);
            }

            int[] weapons = new int[15];
            for (int i = 0; i < 15; ++i)
            {
                weapons[i] = ConvertBCDToInt(RawFile[offset + 0x31 + i]);
            }

            Characters[index] = new Ultima3CharacterData(offset, name, torches, health, strength, agility, intelligence, wisdom, race, u3class, hitPoints, maxHitPoints, magicPoints, experience, food, gems, powder, keys, equippedArmor, equippedWeapon, armor, weapons, gold);
            m_numberOfCharactersInRoster++;
        }