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);
        }
        public Ultima3CharacterData(int offset, string name, int torches, U3Health health, int strength, int agility, int intelligence, int wisdom,
                                    U3Race race, U3Class u3class, int hitPoints, int maxHitPoints, int magicPoints, int experience,
                                    int food, int gems, int powder, int keys, U3Armor equippedArmor, U3Weapons equippedWeapon,
                                    int[] armor, int[] weapons, int gold)
        {
            Offset         = offset;
            Name           = name;
            Sex            = U3Sex.Male;
            Class          = u3class;
            Race           = race;
            Health         = health;
            m_hitPoints    = new BoundedInt(0, 9999);
            HitPoints      = hitPoints;
            m_maxHitPoints = new BoundedInt(0, 9999);
            MaxHitPoints   = maxHitPoints;
            m_magicPoints  = new BoundedInt(0, 99);
            MagicPoints    = magicPoints;
            m_experience   = new BoundedInt(0, 9999);
            Experience     = experience;
            m_strength     = new BoundedInt(0, 99);
            Strength       = strength;
            m_agility      = new BoundedInt(0, 99);
            Agility        = agility;
            m_intelligence = new BoundedInt(0, 99);
            Intelligence   = intelligence;
            m_wisdom       = new BoundedInt(0, 99);
            Wisdom         = wisdom;
            m_food         = new BoundedInt(0, 9999);
            Food           = food;
            m_gems         = new BoundedInt(0, 99);
            Gems           = gems;
            m_powder       = new BoundedInt(0, 99);
            Powder         = powder;
            m_keys         = new BoundedInt(0, 99);
            Keys           = keys;
            m_torches      = new BoundedInt(0, 99);
            Torches        = torches;
            m_gold         = new BoundedInt(0, 9999);
            Gold           = gold;

            EquippedArmor  = equippedArmor;
            EquippedWeapon = equippedWeapon;

            Weapons = new BoundedIntArray(15, 0, 99);
            for (int i = 0; i < weapons.Length; ++i)
            {
                Weapons[i] = weapons[i];
            }

            Armor = new BoundedIntArray(7, 0, 99);
            for (int i = 0; i < armor.Length; ++i)
            {
                Armor[i] = armor[i];
            }
        }
Example #3
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++;
        }