示例#1
0
文件: Character.cs 项目: avidvid/OUP
 public Character(Character character, bool enable = true)
 {
     Id                   = character.Id;
     Name                 = character.Name;
     Description          = character.Description;
     IconPath             = character.IconPath;
     IconId               = character.IconId;
     IsAnimated           = character.IsAnimated;
     HasFightMode         = character.HasFightMode;
     Move                 = character.Move;
     AttackR              = character.AttackR;
     DefenseR             = character.DefenseR;
     AttackT              = character.AttackT;
     DefenseT             = character.DefenseT;
     BasicAttack          = character.BasicAttack;
     BasicDefense         = character.BasicDefense;
     Speed                = character.Speed;
     Body                 = character.Body;
     Carry                = character.Carry;
     View                 = character.View;
     Rarity               = character.Rarity;
     DropItems            = character.DropItems;
     DropChance           = character.DropChance;
     FavoriteTerrainTypes = character.FavoriteTerrainTypes;
     IsEnable             = enable;
 }
示例#2
0
    protected ItemContainer(
        int id, string name, string desc,
        string iconPath, int iconId, int cost,
        int weight, int maxStackCnt, bool unique, int expirationDays,
        ItemType type, DataTypes.Rarity rarity)
    {
        Id             = id;
        Name           = name;
        Description    = desc;
        IconPath       = iconPath;
        IconId         = iconId;
        Cost           = cost;
        Weight         = weight;
        Type           = type;
        MaxStackCnt    = maxStackCnt;
        Unique         = unique;
        ExpirationDays = expirationDays;
        Rarity         = rarity;
        IsEnable       = true;
        switch (Type)
        {
        case ItemType.Consumable:
            Health = Mana = Energy = Coin = Gem = Recipe = Egg = 0;
            break;

        case ItemType.Equipment:
            PlaceHolder = PlaceType.None;
            Carry       = CarryCnt = Speed =
                Agility = Bravery = Charming = Intellect = Crafting = Researching = Stamina = Strength = 0;
            break;

        case ItemType.Weapon:
            CarryType                = Hands.OneHand;
            SpeedAttack              = SpeedDefense =
                AbilityAttack        = AbilityDefense =
                    MagicAttack      = MagicDefense =
                        PoisonAttack = PoisonDefense = 0;
            break;

        case ItemType.Tool:
            CarryType       = Hands.OneHand;
            MaxTimeToUse    = 0;
            FavoriteElement = ElementIns.ElementType.Hole;
            break;
        }
    }