version 1.52 | | version 1.53 |
---|
| | |
| | |
/* | | /* |
* static char *rcs_treasure_c = | | * static char *rcs_treasure_c = |
* "$Id: treasure.c,v 1.52 2005/04/16 22:05:09 ryo_saeba Exp $"; | | * "$Id: treasure.c,v 1.53 2005/04/27 06:25:15 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
| | |
| | |
static void change_treasure(treasure *t, object *op); /* overrule default values */ | | static void change_treasure(treasure *t, object *op); /* overrule default values */ |
| | extern char *spell_mapping[]; |
| | |
/* | | /* |
* Initialize global archtype pointers: | | * Initialize global archtype pointers: |
| | |
* ! (flags & GT_ENVIRONMENT): | | * ! (flags & GT_ENVIRONMENT): |
* Automatically calls fix_flesh_item(). | | * Automatically calls fix_flesh_item(). |
* | | * |
* flags & FLAG_STARTEQUIP: | | * flags: |
* Sets FLAG_STARTEQIUP on item if appropriate, or clears the item's | | * GT_STARTEQUIP: Sets FLAG_STARTEQIUP on item if appropriate, or clears the item's |
* value. | | * value. |
| | * GT_MINIMAL: Does minimal processing on the object - just enough to make it |
| | * a working object - don't change magic, value, etc, but set it material |
| | * type as appropriate, for objects that need spell objects, set those, etc |
*/ | | */ |
void fix_generated_item (object *op, object *creator, int difficulty, | | void fix_generated_item (object *op, object *creator, int difficulty, |
int max_magic, int flags) | | int max_magic, int flags) |
| | |
} | | } |
| | |
if (difficulty<1) difficulty=1; | | if (difficulty<1) difficulty=1; |
| | if (!(flags & GT_MINIMAL)) { |
if (op->arch == crown_arch) { | | if (op->arch == crown_arch) { |
set_magic(difficulty>25?30:difficulty+5, op, max_magic, flags); | | set_magic(difficulty>25?30:difficulty+5, op, max_magic, flags); |
num_enchantments = calc_item_power(op, 1); | | num_enchantments = calc_item_power(op, 1); |
| | |
difficulty >= 999 ) | | difficulty >= 999 ) |
generate_artifact(op, difficulty); | | generate_artifact(op, difficulty); |
} | | } |
| | |
/* Object was made an artifact. Calculate its item_power rating. | | /* Object was made an artifact. Calculate its item_power rating. |
* the item_power in the object is what the artfiact adds. | | * the item_power in the object is what the artfiact adds. |
*/ | | */ |
| | |
*/ | | */ |
op->item_power = save_item_power; | | op->item_power = save_item_power; |
} | | } |
| | } |
| | |
/* materialtype modifications. Note we allow this on artifacts. */ | | /* materialtype modifications. Note we allow this on artifacts. */ |
| | |
set_materialname(op, difficulty, NULL); | | set_materialname(op, difficulty, NULL); |
| | |
if (!op->title) /* Only modify object if not special */ | | if (flags & GT_MINIMAL) { |
| | if (op->type == POTION) |
| | /* Handle healing and magic power potions */ |
| | if (op->stats.sp && !op->randomitems) { |
| | object *tmp; |
| | |
| | tmp = get_archetype(spell_mapping[op->stats.sp]); |
| | insert_ob_in_ob(tmp, op); |
| | op->stats.sp=0; |
| | } |
| | } |
| | else if (!op->title) /* Only modify object if not special */ |
switch(op->type) { | | switch(op->type) { |
case WEAPON: | | case WEAPON: |
case ARMOUR: | | case ARMOUR: |
| | |
| | |
case POTION: { | | case POTION: { |
int too_many_tries=0,is_special=0; | | int too_many_tries=0,is_special=0; |
extern char *spell_mapping[]; | | |
| | |
/* Handle healing and magic power potions */ | | /* Handle healing and magic power potions */ |
if (op->stats.sp && !op->randomitems) { | | if (op->stats.sp && !op->randomitems) { |