@verb #12:"add_feature" this none this rxdo #55 @program #12:"add_feature" this none this "Add a feature to this player's features list. Caller must be this or have suitable permissions (this or wizardly)." "If this is a nonprogrammer, then ask feature if it is feature_ok (that is, if it has a verb :feature_ok which returns a true value, or a property .feature_ok which is true)." "After adding feature, call feature:feature_add(this)." "Returns true if successful, E_INVARG if not a valid object, and E_PERM if !feature_ok or if caller doesn't have permission." if (caller == this || $perm_utils:controls(caller_perms(), this)) feature = args[1] if (typeof(feature) != OBJ || !$recycler:valid(feature)) return player:tell("That does not even appear to be a valid object.") endif if (`$code_utils:verb_or_property(feature, "feature_ok", this) ! $failed_match') "The object is willing to be a feature." if (typeof(this.features) == $LIST) "If list, we can simply setadd the feature." if (length(args) > 1 && args[2]) this.features = $list_utils:remove_duplicates({feature, @this.features}) else this.features = setadd(this.features, feature) endif else "If not, we erase the old value and create a new list." this.features = {feature} endif "Tell the feature it's just been added." `feature:feature_add(this) ! E_VERBNF => 0' return 1 "We're done." else return player:tell("You are not permitted to add that feature.") endif else raise(E_PERM) endif "Last modified by Dax (#789) on Tue May 3 13:45:01 2005 MDT." .