/// <summary> /// Default constructor. /// </summary> public ObjTemplate() { ++_numObjIndex; _name = "no name"; _shortDescription = "(no short description)"; _fullDescription = "(no description)"; _indexNumber = 0; _count = 0; _weight = 1; _cost = 0; _material = 0; _size = Race.Size.medium; _volume = 1; _craftsmanshipLevel = Craftsmanship.average; _level = 1; _condition = 100; _scarcity = 10000; _maxNumber = 0; _itemType = ObjectType.trash; int count; for (count = 0; count < Limits.NUM_ITEM_EXTRA_VECTORS; ++count) { _extraFlags[count] = 0; } for (count = 0; count < Limits.NUM_USE_FLAGS_VECTORS; ++count) { _antiFlags[count] = 0; } _antiFlags[0] = 1; // Usable by all by default. for (count = 0; count < Limits.NUM_WEAR_FLAGS_VECTORS; ++count) { _wearFlags[count] = 0; } _wearFlags[0] = 1; // Carryable by default. for (count = 0; count < Limits.NUM_AFFECT_VECTORS; ++count) { _affectedBy[count] = 0; } for (count = 0; count < 8; ++count) { _values[count] = 0; } }
/// <summary> /// Copy constructor. /// </summary> /// <param name="obj"></param> public ObjTemplate(ObjTemplate obj) { this._affected = new List <Affect>(obj._affected); this._affectedBy = new int[obj._affectedBy.Length]; obj._affectedBy.CopyTo(_affectedBy, 0); this._antiFlags = new int[obj._antiFlags.Length]; obj._antiFlags.CopyTo(_antiFlags, 0); this._area = obj._area; this._condition = obj._condition; this._cost = obj._cost; this._count = 0; this._craftsmanshipLevel = obj._craftsmanshipLevel; this._customActions = new List <CustomAction>(obj._customActions); this._extraDescriptions = new List <ExtendedDescription>(obj._extraDescriptions); this._extraFlags = new int[obj._extraFlags.Length]; obj._extraFlags.CopyTo(_extraFlags, 0); this._fullDescription = obj._fullDescription; this._indexNumber = obj._area.HighObjIndexNumber + 1; this._itemType = obj._itemType; this._level = obj._level; this._material = obj._material; this._maxNumber = obj._maxNumber; this._name = obj._name; this._scarcity = obj._scarcity; this._shortDescription = obj._shortDescription; this._size = obj._size; this._specFun = new List <ObjSpecial>(obj._specFun); this._specFunName = obj._specFunName; this._spellEffects = new List <SpellEntry>(obj._spellEffects); this._trap = obj._trap; this._values = new int[obj._values.Length]; obj._values.CopyTo(_values, 0); this._volume = obj._volume; this._wearFlags = new int[obj._wearFlags.Length]; obj._wearFlags.CopyTo(_wearFlags, 0); this._weight = obj._weight; ++_numObjIndex; }
/// <summary> /// Essentially a ToString for craftsmanship. /// </summary> /// <param name="craft"></param> /// <returns></returns> public static string CraftsmanshipString(Craftsmanship craft) { if (craft == Craftsmanship.one_of_a_kind) return "one of a kind"; if (craft == Craftsmanship.master_artisan) return "master artisan"; if (craft == Craftsmanship.gifted_artisan) return "gifted artisan"; if (craft == Craftsmanship.skilled_artisan) return "skilled artisan"; if (craft == Craftsmanship.excellent) return "excellent"; if (craft == Craftsmanship.well_above_average) return "well above average"; if (craft == Craftsmanship.above_average) return "above average"; if (craft == Craftsmanship.slightly_above_average) return "slightly above average"; if (craft == Craftsmanship.average) return "average"; if (craft == Craftsmanship.slightly_below_average) return "slightly below average"; if (craft == Craftsmanship.below_average) return "below average"; if (craft == Craftsmanship.well_below_average) return "well below average"; if (craft == Craftsmanship.fairly_poor) return "fairly poor"; if (craft == Craftsmanship.very_poor) return "very poor"; if (craft == Craftsmanship.extremely_poor) return "extremely poor"; return "terrible"; }
/// <summary> /// Copy constructor. /// </summary> /// <param name="obj"></param> public ObjTemplate(ObjTemplate obj) { this._affected = new List<Affect>(obj._affected); this._affectedBy = new int[obj._affectedBy.Length]; obj._affectedBy.CopyTo(_affectedBy, 0); this._antiFlags = new int[obj._antiFlags.Length]; obj._antiFlags.CopyTo(_antiFlags, 0); this._area = obj._area; this._condition = obj._condition; this._cost = obj._cost; this._count = 0; this._craftsmanshipLevel = obj._craftsmanshipLevel; this._customActions = new List<CustomAction>(obj._customActions); this._extraDescriptions = new List<ExtendedDescription>(obj._extraDescriptions); this._extraFlags = new int[obj._extraFlags.Length]; obj._extraFlags.CopyTo(_extraFlags, 0); this._fullDescription = obj._fullDescription; this._indexNumber = obj._area.HighObjIndexNumber + 1; this._itemType = obj._itemType; this._level = obj._level; this._material = obj._material; this._maxNumber = obj._maxNumber; this._name = obj._name; this._scarcity = obj._scarcity; this._shortDescription = obj._shortDescription; this._size = obj._size; this._specFun = new List<ObjSpecial>(obj._specFun); this._specFunName = obj._specFunName; this._spellEffects = new List<SpellEntry>(obj._spellEffects); this._trap = obj._trap; this._values = new int[obj._values.Length]; obj._values.CopyTo(_values, 0); this._volume = obj._volume; this._wearFlags = new int[obj._wearFlags.Length]; obj._wearFlags.CopyTo(_wearFlags, 0); this._weight = obj._weight; ++_numObjIndex; }
/// <summary> /// Essentially a ToString for craftsmanship. /// </summary> /// <param name="craft"></param> /// <returns></returns> public static string CraftsmanshipString(Craftsmanship craft) { if (craft == Craftsmanship.one_of_a_kind) { return("one of a kind"); } if (craft == Craftsmanship.master_artisan) { return("master artisan"); } if (craft == Craftsmanship.gifted_artisan) { return("gifted artisan"); } if (craft == Craftsmanship.skilled_artisan) { return("skilled artisan"); } if (craft == Craftsmanship.excellent) { return("excellent"); } if (craft == Craftsmanship.well_above_average) { return("well above average"); } if (craft == Craftsmanship.above_average) { return("above average"); } if (craft == Craftsmanship.slightly_above_average) { return("slightly above average"); } if (craft == Craftsmanship.average) { return("average"); } if (craft == Craftsmanship.slightly_below_average) { return("slightly below average"); } if (craft == Craftsmanship.below_average) { return("below average"); } if (craft == Craftsmanship.well_below_average) { return("well below average"); } if (craft == Craftsmanship.fairly_poor) { return("fairly poor"); } if (craft == Craftsmanship.very_poor) { return("very poor"); } if (craft == Craftsmanship.extremely_poor) { return("extremely poor"); } return("terrible"); }