diff -Naur 340_WIN/include/artilist.h 340_WIN-arti/include/artilist.h --- 340_WIN/include/artilist.h 2002-03-20 15:42:42.000000000 +0000 +++ 340_WIN-arti/include/artilist.h 2003-01-21 14:43:14.000000000 +0000 @@ -89,6 +89,20 @@ (SPFX_RESTR|SPFX_ATTK|SPFX_DEFN), 0, 0, STUN(3,4), DFNS(AD_MAGM), NO_CARY, 0, A_NEUTRAL, PM_WIZARD, NON_PM, 3500L ), +#ifdef ALIGNED_ARTI +A("Judgment", ATHAME, + (SPFX_NOGEN|SPFX_RESTR|SPFX_INTEL|SPFX_ATTK|SPFX_DEFN), 0, 0, + NO_ATTK, NO_DFNS, NO_CARY, 0, A_LAWFUL, NON_PM, NON_PM, 4000L ), + +A("Balance", ATHAME, + (SPFX_NOGEN|SPFX_RESTR|SPFX_INTEL|SPFX_ATTK|SPFX_DEFN), 0, 0, + NO_ATTK, NO_DFNS, NO_CARY, 0, A_NEUTRAL, NON_PM, NON_PM, 4000L ), + +A("Vengeance", ATHAME, + (SPFX_NOGEN|SPFX_RESTR|SPFX_INTEL|SPFX_ATTK|SPFX_DEFN), 0, 0, + NO_ATTK, NO_DFNS, NO_CARY, 0, A_CHAOTIC, NON_PM, NON_PM, 4000L ), +#endif + A("Frost Brand", LONG_SWORD, (SPFX_RESTR|SPFX_ATTK|SPFX_DEFN), 0, 0, COLD(5,0), COLD(0,0), NO_CARY, 0, A_NONE, NON_PM, NON_PM, 3000L ), diff -Naur 340_WIN/include/config.h 340_WIN-arti/include/config.h --- 340_WIN/include/config.h 2002-03-20 15:42:44.000000000 +0000 +++ 340_WIN-arti/include/config.h 2003-01-21 13:47:42.000000000 +0000 @@ -348,6 +348,8 @@ /*#define GOLDOBJ */ /* Gold is kept on obj chains - Helge Hafting */ +#define ALIGNED_ARTI /* New aligned artifact athames */ + /* End of Section 5 */ #include "global.h" /* Define everything else according to choices above */ diff -Naur 340_WIN/include/extern.h 340_WIN-arti/include/extern.h --- 340_WIN/include/extern.h 2002-03-20 15:42:46.000000000 +0000 +++ 340_WIN-arti/include/extern.h 2003-01-21 14:59:58.000000000 +0000 @@ -1522,6 +1522,9 @@ E const char *FDECL(halu_gname, (ALIGNTYP_P)); E const char *FDECL(align_gtitle, (ALIGNTYP_P)); E void FDECL(altar_wrath, (int,int)); +#ifdef ALIGNED_ARTI +E void NDECL(anger_god); +#endif /* ### priest.c ### */ diff -Naur 340_WIN/include/you.h 340_WIN-arti/include/you.h --- 340_WIN/include/you.h 2002-03-20 15:43:00.000000000 +0000 +++ 340_WIN-arti/include/you.h 2003-01-22 16:27:52.000000000 +0000 @@ -14,6 +14,15 @@ /*** Substructures ***/ +#ifdef ALIGNED_ARTI +struct AlignedArtiData { + struct attack attktype; + struct attack defntype; + int spfxprop; + int role; +}; +#endif + struct RoleName { const char *m; /* name when character is male */ const char *f; /* when female; null if same as male */ @@ -361,6 +370,9 @@ struct skills weapon_skills[P_NUM_SKILLS]; boolean twoweap; /* KMH -- Using two-weapon combat */ +#ifdef ALIGNED_ARTI + struct AlignedArtiData artidata[3]; /* to persist aligned athame artifact properties */ +#endif }; /* end of `struct you' */ #define Upolyd (u.umonnum != u.umonster) diff -Naur 340_WIN/src/artifact.c 340_WIN-arti/src/artifact.c --- 340_WIN/src/artifact.c 2002-03-20 15:43:00.000000000 +0000 +++ 340_WIN-arti/src/artifact.c 2003-01-26 08:32:38.000000000 +0000 @@ -47,6 +47,9 @@ STATIC_DCL void NDECL(hack_artifacts); STATIC_DCL boolean FDECL(attacks, (int,struct obj *)); +#ifdef ALIGNED_ARTI +STATIC_DCL void NDECL(hack_rndartifacts); +#endif /* handle some special cases; must be called after u_init() */ STATIC_OVL void @@ -69,6 +72,20 @@ artilist[urole.questarti].alignment = alignmnt; artilist[urole.questarti].role = Role_switch; } + +#ifdef ALIGNED_ARTI + int i; + + for (i=0; i<3; i++) { + artilist[ART_JUDGMENT+i].attk.adtyp = u.artidata[i].attktype.adtyp; + artilist[ART_JUDGMENT+i].attk.damn = u.artidata[i].attktype.damn; + artilist[ART_JUDGMENT+i].attk.damd = u.artidata[i].attktype.damd; + artilist[ART_JUDGMENT+i].defn.adtyp = u.artidata[i].defntype.adtyp; + artilist[ART_JUDGMENT+i].spfx = u.artidata[i].spfxprop; + artilist[ART_JUDGMENT+i].role = u.artidata[i].role; + } +#endif + return; } @@ -78,6 +95,9 @@ { (void) memset((genericptr_t) artiexist, 0, sizeof artiexist); (void) memset((genericptr_t) artidisco, 0, sizeof artidisco); +#ifdef ALIGNED_ARTI + hack_rndartifacts(); +#endif hack_artifacts(); } @@ -518,6 +538,19 @@ if (yours) pline("%s your grasp!", Tobjnam(obj, "evade")); return 0; } +#ifdef ALIGNED_ARTI + /* Can only pick up the aligned athames if you are aligned with them */ + if (badalign && obj->oartifact >= ART_JUDGMENT && obj->oartifact <= ART_VENGEANCE) { + if (yours) pline("%s your grasp!", Tobjnam(obj, "evade")); + + /* You just tried to obtain a very sacred artifact of another alignment */ + exercise(A_WIS, FALSE); + change_luck(-3); + anger_god(); + + return 0; + } +#endif return 1; } @@ -1372,4 +1405,66 @@ #endif /* OVLB */ +#ifdef ALIGNED_ARTI +/* Initialize artifact athames */ +void +hack_rndartifacts() +{ + int i; + struct attack attktype, defntype; + int spfxprop, inchit, incdmg; + + /* Random attack types */ + int attk_typ[5] = { AD_PHYS, + AD_FIRE, + AD_COLD, + AD_ELEC, + AD_MAGM }; + + /* Random resistance conferred */ + int defn_typ[5] = { AD_FIRE, + AD_COLD, + AD_ELEC, + AD_DRLI, + AD_BLND }; + + /* Random miscellaneous properties */ + int miscprop[5] = { SPFX_SEEK | SPFX_SEARCH, + SPFX_STLTH, + SPFX_WARN, + SPFX_TCTRL, + SPFX_SPEAK, }; + + for (i = 0; i < 3; i++) { + /* Assign attack and resistance types */ + attktype.adtyp = attk_typ[rn2(5)]; + defntype.adtyp = defn_typ[rn2(5)]; + + /* Assign 1-2 random miscellaneous properties */ + spfxprop = artilist[ART_JUDGMENT+i].spfx; + spfxprop = spfxprop | miscprop[rn2(5)] | miscprop[rn2(5)]; + + /* Assign bonuses to hit and to damage. Range is 3-5 */ + inchit = rn2(3) + 3; + incdmg = rn2(3) + 3; + + /* Clear SPFX_ATTK if the attack type is AD_PHYS, and give a dmg bonus too */ + if (attktype.adtyp == AD_PHYS) { + spfxprop = spfxprop& ~SPFX_ATTK; + incdmg += rn2(5); + } + + /* Update the artidata array for persistence between saved game sessions */ + u.artidata[i].attktype.adtyp = attktype.adtyp; + u.artidata[i].attktype.damn = inchit; + u.artidata[i].attktype.damd = incdmg; + u.artidata[i].defntype.adtyp = defntype.adtyp; + u.artidata[i].spfxprop = spfxprop; + u.artidata[i].role = Role_switch; + } + return; +} +#endif + + /*artifact.c*/ diff -Naur 340_WIN/src/pray.c 340_WIN-arti/src/pray.c --- 340_WIN/src/pray.c 2002-03-20 15:43:14.000000000 +0000 +++ 340_WIN-arti/src/pray.c 2003-01-21 15:02:36.000000000 +0000 @@ -1790,4 +1790,13 @@ return FALSE; } +#ifdef ALIGNED_ARTI +/* External function for general-purpose blasphemy */ +void +anger_god() +{ + gods_upset(u.ualign.type); +} +#endif + /*pray.c*/