Add hack to allow attacktype changes for personalized god wepaons

master
kts of kettek 2017-03-22 13:52:17 -07:00
parent aa3be6d40b
commit 51aecfb4d9
1 changed files with 24 additions and 0 deletions

View File

@ -968,6 +968,30 @@ static int god_enchants_weapon(object *op, const object *god, object *tr, object
one time, but in that particular case we only give out additional plusses. one time, but in that particular case we only give out additional plusses.
No new slays or new attacktypes No new slays or new attacktypes
*/ */
/*
@@ Quick hack to allow already enchanted items of this god to add
slaying and attacktype. Presumably negating the above comment.
*/
/* Allow the weapon to slay enemies */
if (!weapon->slaying && god->slaying) {
weapon->slaying = add_string(god->slaying);
draw_ext_info_format(NDI_UNIQUE, 0, op, MSG_TYPE_ITEM, MSG_TYPE_ITEM_CHANGE,
"Your %s now hungers to slay enemies of your god!",
"Your %s now hungers to slay enemies of your god!",
weapon->name);
weapon->item_power++;
return 1;
}
/* Add the gods attacktype */
attacktype = (weapon->attacktype == 0) ? AT_PHYSICAL : weapon->attacktype;
if ((attacktype&god->attacktype) != god->attacktype) {
draw_ext_info(NDI_UNIQUE, 0, op, MSG_TYPE_ITEM, MSG_TYPE_ITEM_CHANGE,
"Your weapon suddenly glows!", NULL);
weapon->attacktype = attacktype|god->attacktype;
weapon->item_power++;
return 1;
}
return improve_weapon_magic(op, tr, weapon, skill); return improve_weapon_magic(op, tr, weapon, skill);
} }