コード例 #1
0
ファイル: Item.cs プロジェクト: stavrossk/coab
        public Item(Affects _affect_3, Affects _affect_2, Affects _affect_1, short __value, byte _count,
                    short _weight, bool _cursed, byte _name_flags, bool _readied, byte _plus_save, sbyte _plus, byte _namenum3,
                    byte _namenum2, byte _namenum1, ItemType _type, bool AddToLibrary)
        {
            name              = string.Empty;
            type              = _type;
            namenum1          = _namenum1;
            namenum2          = _namenum2;
            namenum3          = _namenum3;
            plus              = _plus;
            plus_save         = _plus_save;
            readied           = _readied;
            hidden_names_flag = _name_flags;
            cursed            = _cursed;
            weight            = _weight;
            count             = _count;
            _value            = __value;
            affect_1          = _affect_1;
            affect_2          = _affect_2;
            affect_3          = _affect_3;

            if (AddToLibrary)
            {
                ItemLibrary.Add(this);
            }
        }
コード例 #2
0
ファイル: Item.cs プロジェクト: stavrossk/coab
        public Item(byte[] data, int offset)
        {
            name = Sys.ArrayToString(data, offset, 0x2a);

            type              = (ItemType)data[offset + 0x2e];
            namenum1          = data[offset + 0x2f];
            namenum2          = data[offset + 0x30];
            namenum3          = data[offset + 0x31];
            plus              = (sbyte)data[offset + 0x32];
            plus_save         = data[offset + 0x33];
            readied           = (data[offset + 0x34] != 0);
            hidden_names_flag = data[offset + 0x35];
            cursed            = (data[offset + 0x36] != 0);

            weight   = Sys.ArrayToShort(data, offset + 0x37);
            count    = data[offset + 0x39];
            _value   = Sys.ArrayToShort(data, offset + 0x3a);
            affect_1 = (Affects)data[offset + 0x3C];
            affect_2 = (Affects)data[offset + 0x3D];
            affect_3 = (Affects)data[offset + 0x3E];

            ItemLibrary.Add(this);
            //AddItemsText(string.Format("{0},{1},{2},{3},{4}", type, namenum1, namenum2, namenum3, GenerateName(0)));
        }