parameter. If not -1 then it will be used to set the acquirement agent of the item. This is done in items() so that make_item_randart() can use it if it's called from items(). Before this _god_fits_artefact() in randart.cc was only being called for choosing an appropriate god for random artifact names, and not to check the appropriateness of the randart proeprties chosen for randart god gifts.
Changed _god_fits_artefact() so that if a bug leads a god to gifting an item with an inapropriate base_type or sub_type that it will give an assertion or error message instead of causing make_item_randart() to go into an infinite loop.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7726 c06c8d41-db1a-0410-9941-cceddc491573
JJVROJMJVKS7VN5HJNB4ZNCG7Y6EMHJQZR3MDN2VZCFTZC73HOZQC QXJTVJVVAONW3ALIARJSNPIAN3VJBQ64CQ73FTAB4WLVW6DSNLYAC DUOVSVYLZG2W4KHAPD57Z2OTWZUYHY46TLGJLI5R7YALOKZCTGFAC JYEEOUYQ7ZPKOGWUV7VCORBVSOLF2UCBFBH3TR75RGOSS6PNKYUAC KFULGQQOHWUTXOM3BXCCYPGGVGGY4Z6265XUFRCBPNLTZAEHJZSQC 5MGUZD2UACJCSG74TEZHI3Z4YL5KL6ZVUCQ3XVZKDOLKM7EMGWJAC B3HWU2BEQQ4E6WKVTW3JQQJFMWTVW3XWKY6BHFNBRHSZPRCF2OTQC IQGGFC563RBS7GDOACKCLXK752EE5RC3T6G5L6H446SXTMSA7T2AC F7Q7QRZACTDPP6KH3AB5J6B6B5PRVV4FURTOIGXHRHWNVSQT3TVAC L4DV5O3UTY456Y6YFXELHEWEFLB6ZUCENZ3AKYJZLGRRGUVHT5QAC HW7XKO7HRAUQVDVVKG5GA7PYAEL5J5GKVDPT2CKAD3FLERAY5HLAC K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC TGJZXTUIAKCFZQJ54ZQEBGFBVZSJCAX6AWDRSH3TP7UJRLGUM5SAC RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC PA2AUORPJHOD7XBRM34UMBZRJVTKUFD3PINRMSEE4GKM7AH2KDVAC ECDSNMLO7QJQLWI2FBT4R27HRDW7GRG2YEHN6AR2DCP2D2TPOYFQC EJKHYV2Z6UPRVYUAL4WRW33GBNHYBFPMPA57HMBX2LQKXHIUO5VQC SRQJVKQVUY7QGCEBA2VQTWEJ7ADIUSY7L46HJQSQNM5DXYRRH5KAC S2FTVAH7NLTLI5CEINIAMJIW3PTZUE22APSK633Y4PLDZ4L6UK4QC LDBTCT5WIPLJPZWXS2RUQ26QKISCUUTLO77M464WOE6VSYSNPKYAC YXWZYOBUFR4EHBSKXCFGZNK7NIM7IPE2GMZYIXEJTUPDDC3BIEDAC HMC247EGUJ3Q25DQ3VKUCIGLIO4SZORFQQWAPAF6S2WLQY3WU5TQC DTO3EUKWHZ5RJNGNCFYXSOVTIPVXPP637F2W7WFGYKJ7JK7VNKNQC EH4VJW3I5Y4V6DT3YMLNDA3NW2DEAV4LRE4T5IEXAVB4WB3JJMGAC Q3DNEB5OOJ34P5ML4CMK3L6SCP7RLW7DDOZEG24KZBX3C7BJRQDAC RNJX2RDBDA62DSAUIWVVPFS7YNIU3GEOXDWJUABDS5DS5QGS3LAQC B7DNCNY7SXL5WAW5B3XZP5KIQSBWOJ3N2YW46WOUQKTRBRRZ7YOQC 2O3C3MTT2ZBYIFGPJ4MF5R4AXBYUHOEN62KAUWFWF6JWHIIVLRNQC KQNIGKATHT4YSPJFPJGIGPD6VNR5B753SE2JN2LCXZZJNHCGY3DQC SWT4O2TCOAQOVFA6WRA7MCU3KMTMJWFEMIHO64N4PWL5FNHDPADAC 74LQ7JXVLAFSHLI7LCBKFX47CNTYSKGUQSXNX5FCIUIGCC2JTR3QC 2DORUQ4B574MDOOMRYWGU5I72AKHMCSTZ6B3VSHQBUQOZYHRC7FAC SDLKLUNFGVKDS55DDJZCBAVIB7NL3RRYPTACAY65SCUQKV6APFSAC return (false);// First check the item's base_type and sub_type, then check the// item's brand and other randart properties.bool type_bad = false;switch (which_god){case GOD_ELYVILON: // peaceful healer god, no weapons, no berserkingif (item.base_type == OBJ_WEAPONS)type_bad = true;if (item.base_type == OBJ_JEWELLERY && item.sub_type == AMU_RAGE)type_bad = true;break;case GOD_OKAWARU: // precision fighterif (item.base_type == OBJ_JEWELLERY && item.sub_type == AMU_INACCURACY)type_bad = true;break;case GOD_ZIN:if (item.base_type == OBJ_JEWELLERY && item.sub_type == RING_HUNGER)type_bad = true;break;case GOD_SIF_MUNA:case GOD_KIKUBAAQUDGHA:case GOD_VEHUMET:// The magic gods: no weapons, no preventing spellcasting.if (item.base_type == OBJ_WEAPONS)type_bad = true;break;case GOD_TROG: // hates anything enhancing magicif (item.base_type == OBJ_JEWELLERY && (item.sub_type == RING_WIZARDRY|| item.sub_type == RING_FIRE || item.sub_type == RING_ICE|| item.sub_type == RING_MAGICAL_POWER)){type_bad = true;}break;default:break;}if (type_bad && !name_check_only){ASSERT(!"God attempting to gift invalid type of item.");mprf(MSGCH_ERROR, "%s attempting to gift invalid type of item.");// Prevent infinite loop in make_item_randart()return (true);}if (type_bad)
if (item.base_type == OBJ_WEAPONS)return (false);if (item.base_type == OBJ_JEWELLERY && item.sub_type == AMU_RAGE)return (false);
item_was_destroyed(mitm[igrd(you.pos())], NON_MONSTER);
if (agent > GOD_NO_GOD && agent < NUM_GODS){if (agent == GOD_XOM)simple_god_message(" snickers.", GOD_XOM);else{ASSERT(!"God gave gift item while player was on grid which ""destroys items.");mprf(MSGCH_ERROR, "%s gave a god gift while you were on ""terrain which destroys items.",god_name((god_type) agent).c_str());}}