merchant_commodity 
This holds information about a particular thing a merchant wants to buy or sell.
Generally these will be created in bulk by one or more /decl/merchant_potential_commoditiess held by a merchant instance's potential_[supply|demand] lists,
and then placed inside that merchant's active_[supply|demand] lists.
Vars | |
| name | Shown to players when they ask what the merchant wants. Filled in automatically based on what's contained inside. |
|---|---|
| price_variance | A modifier that merchants use to slightly tweak prices on a per-item basis, to introduce a bit of randomness. |
| quantity | Limits how many things a merchant can sell this commodity, or how many they want to buy. |
| quantity_method | Determines how merchants should count things players are trying to sell to them. More esoteric commodities like reagents or gases need their own method. |
| requirements | A list of requirements which must all pass for merchants to agree to buy or sell a particular item from players. |
| spawn_path | The type to instantiate when a merchant sells the commodity to a player. |
Procs | |
| New | Instantiates a new commodity datum, which can have various criteria that will determine if any given item instance will count towards the instance itself. These conditions can be simple type checks or complex requirements, such as requiring that items be made of a specific material, or have a certain gas or reagent composition. |
| check_requirements | Determines if a given input should pass this commodity instance. All requirements must return TRUE for this to return TRUE. |
Var Details
name 
Shown to players when they ask what the merchant wants. Filled in automatically based on what's contained inside.
price_variance 
A modifier that merchants use to slightly tweak prices on a per-item basis, to introduce a bit of randomness.
quantity 
Limits how many things a merchant can sell this commodity, or how many they want to buy.
quantity_method 
Determines how merchants should count things players are trying to sell to them. More esoteric commodities like reagents or gases need their own method.
requirements 
A list of requirements which must all pass for merchants to agree to buy or sell a particular item from players.
spawn_path 
The type to instantiate when a merchant sells the commodity to a player.
Proc Details
New
Instantiates a new commodity datum, which can have various criteria that will determine if any given item instance will count towards the instance itself. These conditions can be simple type checks or complex requirements, such as requiring that items be made of a specific material, or have a certain gas or reagent composition.
_requirements: An assoc list containing/decl/merchant_commodity_requirements and their parameters. See each/decl/merchant_commodity_requirementfor what parameters they expect._item_quantity_method: A/decl/merchant_quantity_methodtype path which determines how to count qualifying items being sold. The default method counts item instances (and stack sizes). Different methods can be used if the merchant is intended to purchase reagents or gas instead, as otherwise they would count the containers instead of the contents of the containers. Has no purpose if demand is infinite, which it is by default._item_manual_name: This exists to allow for more flavorful merchants that might want to use more colloquial terms, or as a last resort if the automatic system just isn't cutting it.
check_requirements
Determines if a given input should pass this commodity instance. All requirements must return TRUE for this to return TRUE.
atom/movable/thing: An object instance, or a type path, that someone is trying to buy or sell to a merchant.