#include <spell_defs.h>
inherit OBJECT_OBJ;
int type;
void setup() {
type = random(sizeof(ELEMENTAL_CRYSTAL_TYPES));
set_name("crystal");
set_short(ELEMENTAL_CRYSTAL_COLOURS[type]+" crystal");
set_adjectives(({ELEMENTAL_CRYSTAL_COLOURS[type]}));
set_long("This fine, intricate crystal is coloured throughout with "+
ELEMENTAL_CRYSTAL_COLOURS[type]+", and twinkles softly in "
"any available light.\n");
set_weight(1+random(2));
set_value(2000+query_weight()*50);
}
int query_type() {
return type;
}
mixed *stats() {
return ::stats()+({
({ "type", query_type() }),
({ "elemental_type", ELEMENTAL_CRYSTAL_TYPES[type] }),
});
}
void init_dynamic_arg(mapping map) {
if(map["::"])
::init_dynamic_arg(map["::"]);
if(!undefinedp(map["type"]))
type = map["type"];
}
mapping query_dynamic_auto_load() {
return ([
"::" : ::query_dynamic_auto_load(),
"type" : type,
]);
}