Skip to content

Commit f9ba45f

Browse files
committed
Fix: artifact rings have a fixed material, take two.
Better way to do this - make two new ring types that will never spawn randomly, make those the placeholders for the artifact rings. This way their appearance and material won't confict with other ring types. Had to add spawn probabilities to rings, all of the normal rings have a probability of one, just as before. There's a bit of an object lookup bit I'd like to tweak further, but I hate objnam.c, so it can wait.
1 parent 2ee37d3 commit f9ba45f

File tree

11 files changed

+409
-351
lines changed

11 files changed

+409
-351
lines changed

doc/evilhack-changelog.md

+3
Original file line numberDiff line numberDiff line change
@@ -3369,4 +3369,7 @@ The following changes to date are:
33693369
- Fix: unique monsters are not bound by maximum hit point value in grow_up()
33703370
- Fix: Infidels couldn't drop cursed loadstones
33713371
- Fix: misbehavior by #adjust
3372+
- Fix: artifact rings have a fixed material
3373+
- Revert: artifact rings have a fixed material
3374+
- Fix: artifact rings have a fixed material, take two
33723375

include/artilist.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ STATIC_OVL NEARDATA struct artifact artilist[] = {
301301
0, MH_DEMON, PHYS(8, 8), DFNS(AD_MAGM), NO_CARY, 0, A_LAWFUL,
302302
NON_PM, PM_DWARF, 9000L, CLR_RED, MITHRIL),
303303
/* The One Ring, from J.R.R Tolkien lore */
304-
A("The One Ring", RIN_INVISIBILITY,
304+
A("The One Ring", RIN_LUSTROUS,
305305
(SPFX_NOGEN | SPFX_NOWISH | SPFX_RESTR | SPFX_INTEL | SPFX_STLTH
306306
| SPFX_SEARCH | SPFX_WARN | SPFX_DFLAGH),
307307
0, MH_WRAITH, NO_ATTK, NO_DFNS, NO_CARY, 0, A_NONE, NON_PM,
@@ -571,7 +571,7 @@ STATIC_OVL NEARDATA struct artifact artilist[] = {
571571
* Barbarian artifact chaotic (why it was neutral before is a bit confusing
572572
* to me as most vanilla Barbarian race/role combinations are chaotic).
573573
*/
574-
A("The Ring of P\'hul", RIN_FREE_ACTION,
574+
A("The Ring of P\'hul", RIN_ANCIENT,
575575
(SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL | SPFX_DEFN), 0, 0,
576576
NO_ATTK, DFNS(AD_MAGM), CARY(AD_DISE), 0, A_CHAOTIC, PM_BARBARIAN,
577577
NON_PM, 5000L, NO_COLOR, GEMSTONE),

src/do.c

+2
Original file line numberDiff line numberDiff line change
@@ -671,9 +671,11 @@ register struct obj *obj;
671671
pline_The("sink looks as good as new.");
672672
break;
673673
case RIN_INVISIBILITY:
674+
case RIN_LUSTROUS:
674675
You("don't see anything happen to the sink.");
675676
break;
676677
case RIN_FREE_ACTION:
678+
case RIN_ANCIENT:
677679
You_see("the ring slide right down the drain!");
678680
break;
679681
case RIN_SEE_INVISIBLE:

src/do_wear.c

+4
Original file line numberDiff line numberDiff line change
@@ -1516,6 +1516,7 @@ register struct obj *obj;
15161516
case RIN_POLYMORPH:
15171517
case RIN_POLYMORPH_CONTROL:
15181518
case RIN_FREE_ACTION:
1519+
case RIN_ANCIENT:
15191520
case RIN_SLOW_DIGESTION:
15201521
case RIN_SUSTAIN_ABILITY:
15211522
case MEAT_RING:
@@ -1544,6 +1545,7 @@ register struct obj *obj;
15441545
}
15451546
break;
15461547
case RIN_INVISIBILITY:
1548+
case RIN_LUSTROUS:
15471549
if (!oldprop && !HInvis && !BInvis && !Blind) {
15481550
learnring(obj, TRUE);
15491551
newsym(u.ux, u.uy);
@@ -1632,6 +1634,7 @@ boolean gone;
16321634
case RIN_POLYMORPH:
16331635
case RIN_POLYMORPH_CONTROL:
16341636
case RIN_FREE_ACTION:
1637+
case RIN_ANCIENT:
16351638
case RIN_SLOW_DIGESTION:
16361639
case RIN_SUSTAIN_ABILITY:
16371640
case MEAT_RING:
@@ -1656,6 +1659,7 @@ boolean gone;
16561659
}
16571660
break;
16581661
case RIN_INVISIBILITY:
1662+
case RIN_LUSTROUS:
16591663
if (!Invis && !BInvis && !Blind) {
16601664
newsym(u.ux, u.uy);
16611665
Your("body seems to unfade%s.",

src/dogmove.c

+2
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ boolean check_if_better, stashing;
179179
|| otmp->otyp == RIN_PROTECTION
180180
|| otmp->otyp == RIN_LEVITATION
181181
|| otmp->otyp == RIN_FREE_ACTION
182+
|| otmp->otyp == RIN_ANCIENT
183+
|| otmp->otyp == RIN_LUSTROUS
182184
|| otmp->otyp == FROST_HORN
183185
|| otmp->otyp == FIRE_HORN
184186
|| otmp->otyp == MAGIC_HARP

src/eat.c

+2
Original file line numberDiff line numberDiff line change
@@ -2239,6 +2239,7 @@ struct obj *otmp;
22392239
}
22402240
break;
22412241
case RIN_INVISIBILITY:
2242+
case RIN_LUSTROUS:
22422243
if (!oldprop && !EInvis && !BInvis && !See_invisible
22432244
&& !Blind) {
22442245
newsym(u.ux, u.uy);
@@ -2298,6 +2299,7 @@ struct obj *otmp;
22982299
context.botl = 1;
22992300
break;
23002301
case RIN_FREE_ACTION:
2302+
case RIN_ANCIENT:
23012303
/* Give sleep resistance instead */
23022304
if (how_resistant(SLEEP_RES) < 100) {
23032305
accessory_has_effect(otmp);

src/muse.c

+5-9
Original file line numberDiff line numberDiff line change
@@ -3490,7 +3490,8 @@ struct obj *obj;
34903490
|| mon->data == &mons[PM_GHOST]) /* don't loot bones piles */
34913491
return FALSE;
34923492

3493-
if (typ == WAN_MAKE_INVISIBLE || typ == POT_INVISIBILITY || typ == RIN_INVISIBILITY)
3493+
if (typ == WAN_MAKE_INVISIBLE || typ == POT_INVISIBILITY
3494+
|| typ == RIN_INVISIBILITY || typ == RIN_LUSTROUS)
34943495
return (boolean) (!mon->minvis && !mon->invis_blkd
34953496
&& !attacktype(mon->data, AT_GAZE));
34963497
if (typ == WAN_SPEED_MONSTER || typ == POT_SPEED)
@@ -3576,9 +3577,7 @@ struct obj *obj;
35763577
return TRUE;
35773578
break;
35783579
case RING_CLASS:
3579-
/* Should match the list in m_dowear_type.
3580-
* Uniques don't go for invisibility or teleportation;
3581-
* it would probably be a waste of time. */
3580+
/* Should match the list in m_dowear_type */
35823581
if (typ == RIN_PROTECTION
35833582
|| typ == RIN_INCREASE_DAMAGE
35843583
|| typ == RIN_INCREASE_ACCURACY)
@@ -3599,12 +3598,9 @@ struct obj *obj;
35993598
return (!mon_prop(mon, REGENERATION));
36003599
if (typ == RIN_LEVITATION)
36013600
return (grounded(mon->data));
3602-
if (typ == RIN_FREE_ACTION)
3601+
if (typ == RIN_FREE_ACTION || typ == RIN_ANCIENT)
36033602
return TRUE;
3604-
/* Below this line are off-limits to uniques */
3605-
if (mon->data->geno & G_UNIQ)
3606-
return (FALSE);
3607-
if (typ == RIN_INVISIBILITY)
3603+
if (typ == RIN_INVISIBILITY || typ == RIN_LUSTROUS)
36083604
return !(mon->minvis);
36093605
if (typ == RIN_TELEPORTATION)
36103606
return (!mon_prop(mon, TELEPORT));

src/o_init.c

+3
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ int *lo_p, *hi_p; /* output: range that item belongs among */
211211
*hi_p = i - 1;
212212
break;
213213
case RING_CLASS:
214+
if (otyp >= RIN_ADORNMENT && otyp <= RIN_PROTECTION_FROM_SHAPE_CHAN)
215+
*lo_p = RIN_ADORNMENT, *hi_p = RIN_PROTECTION_FROM_SHAPE_CHAN;
216+
break;
214217
case WAND_CLASS:
215218
case VENOM_CLASS:
216219
/* entire class */

src/objects.c

+39-35
Original file line numberDiff line numberDiff line change
@@ -614,73 +614,77 @@ BOOTS("fumble boots", "riding boots",
614614
#undef ARMOR
615615

616616
/* rings ... */
617-
/* note that prob = 1 for all rings and currently can't be specified
618-
* per ring without changing the RING definition */
619-
#define RING(name,stone,power,cost,mgc,spec,mohs,metal,color) \
620-
OBJECT(OBJ(name, stone), \
621-
BITS(0, 0, spec, 0, mgc, spec, 0, 0, 0, \
622-
HARDGEM(mohs), 0, P_NONE, metal), \
623-
power, RING_CLASS, 1, 0, 3, cost, 0, 0, 0, 0, 15, color)
617+
/* note that prob = 1 for all normal rings */
618+
#define RING(name,stone,power,prob,cost,mgc,spec,mohs,metal,color) \
619+
OBJECT(OBJ(name, stone), \
620+
BITS(0, 0, spec, 0, mgc, spec, 0, 0, 0, \
621+
HARDGEM(mohs), 0, P_NONE, metal), \
622+
power, RING_CLASS, prob, 0, 3, cost, 0, 0, 0, 0, 15, color)
624623
RING("adornment", "wooden",
625-
ADORNED, 100, 1, 1, 2, WOOD, HI_WOOD),
624+
ADORNED, 1, 100, 1, 1, 2, WOOD, HI_WOOD),
626625
RING("gain strength", "granite",
627-
0, 150, 1, 1, 7, MINERAL, HI_MINERAL),
626+
0, 1, 150, 1, 1, 7, MINERAL, HI_MINERAL),
628627
RING("gain constitution", "opal",
629-
0, 150, 1, 1, 7, MINERAL, HI_MINERAL),
628+
0, 1, 150, 1, 1, 7, MINERAL, HI_MINERAL),
630629
RING("increase accuracy", "clay",
631-
0, 150, 1, 1, 4, MINERAL, CLR_RED),
630+
0, 1, 150, 1, 1, 4, MINERAL, CLR_RED),
632631
RING("increase damage", "coral",
633-
0, 150, 1, 1, 4, MINERAL, CLR_ORANGE),
632+
0, 1, 150, 1, 1, 4, MINERAL, CLR_ORANGE),
634633
RING("protection", "black onyx",
635-
PROTECTION, 100, 1, 1, 7, MINERAL, CLR_BLACK),
634+
PROTECTION, 1, 100, 1, 1, 7, MINERAL, CLR_BLACK),
636635
/* 'PROTECTION' intrinsic enhances MC from worn armor by +1,
637636
regardless of ring's enchantment; wearing a second ring of
638637
protection (or even one ring of protection combined with
639638
cloak of protection) doesn't give a second MC boost */
640639
RING("regeneration", "moonstone",
641-
REGENERATION, 200, 1, 0, 6, MINERAL, HI_MINERAL),
640+
REGENERATION, 1, 200, 1, 0, 6, MINERAL, HI_MINERAL),
642641
RING("searching", "tiger eye",
643-
SEARCHING, 200, 1, 0, 6, GEMSTONE, CLR_BROWN),
642+
SEARCHING, 1, 200, 1, 0, 6, GEMSTONE, CLR_BROWN),
644643
RING("stealth", "jade",
645-
STEALTH, 100, 1, 0, 6, GEMSTONE, CLR_GREEN),
644+
STEALTH, 1, 100, 1, 0, 6, GEMSTONE, CLR_GREEN),
646645
RING("sustain ability", "bronze",
647-
FIXED_ABIL, 100, 1, 0, 4, COPPER, HI_COPPER),
646+
FIXED_ABIL, 1, 100, 1, 0, 4, COPPER, HI_COPPER),
648647
RING("levitation", "agate",
649-
LEVITATION, 200, 1, 0, 7, GEMSTONE, CLR_RED),
648+
LEVITATION, 1, 200, 1, 0, 7, GEMSTONE, CLR_RED),
650649
RING("hunger", "topaz",
651-
HUNGER, 100, 1, 0, 8, GEMSTONE, CLR_CYAN),
650+
HUNGER, 1, 100, 1, 0, 8, GEMSTONE, CLR_CYAN),
652651
RING("aggravate monster", "sapphire",
653-
AGGRAVATE_MONSTER, 150, 1, 0, 9, GEMSTONE, CLR_BLUE),
652+
AGGRAVATE_MONSTER, 1, 150, 1, 0, 9, GEMSTONE, CLR_BLUE),
654653
RING("conflict", "ruby",
655-
CONFLICT, 300, 1, 0, 9, GEMSTONE, CLR_RED),
654+
CONFLICT, 1, 300, 1, 0, 9, GEMSTONE, CLR_RED),
656655
RING("warning", "diamond",
657-
WARNING, 100, 1, 0, 10, GEMSTONE, CLR_WHITE),
656+
WARNING, 1, 100, 1, 0, 10, GEMSTONE, CLR_WHITE),
658657
RING("poison resistance", "pearl",
659-
POISON_RES, 150, 1, 0, 4, BONE, CLR_WHITE),
658+
POISON_RES, 1, 150, 1, 0, 4, BONE, CLR_WHITE),
660659
RING("fire resistance", "iron",
661-
FIRE_RES, 200, 1, 0, 5, IRON, HI_METAL),
660+
FIRE_RES, 1, 200, 1, 0, 5, IRON, HI_METAL),
662661
RING("cold resistance", "brass",
663-
COLD_RES, 150, 1, 0, 4, COPPER, HI_COPPER),
662+
COLD_RES, 1, 150, 1, 0, 4, COPPER, HI_COPPER),
664663
RING("shock resistance", "copper",
665-
SHOCK_RES, 150, 1, 0, 3, COPPER, HI_COPPER),
664+
SHOCK_RES, 1, 150, 1, 0, 3, COPPER, HI_COPPER),
666665
RING("free action", "twisted",
667-
FREE_ACTION, 200, 1, 0, 6, METAL, HI_METAL),
666+
FREE_ACTION, 1, 200, 1, 0, 6, METAL, HI_METAL),
668667
RING("slow digestion", "steel",
669-
SLOW_DIGESTION, 200, 1, 0, 8, METAL, HI_METAL),
668+
SLOW_DIGESTION, 1, 200, 1, 0, 8, METAL, HI_METAL),
670669
RING("teleportation", "silver",
671-
TELEPORT, 200, 1, 0, 3, SILVER, HI_SILVER),
670+
TELEPORT, 1, 200, 1, 0, 3, SILVER, HI_SILVER),
672671
RING("teleport control", "gold",
673-
TELEPORT_CONTROL, 300, 1, 0, 3, GOLD, HI_GOLD),
672+
TELEPORT_CONTROL, 1, 300, 1, 0, 3, GOLD, HI_GOLD),
674673
RING("polymorph", "ivory",
675-
POLYMORPH, 300, 1, 0, 4, BONE, CLR_WHITE),
674+
POLYMORPH, 1, 300, 1, 0, 4, BONE, CLR_WHITE),
676675
RING("polymorph control", "emerald",
677-
POLYMORPH_CONTROL, 300, 1, 0, 8, GEMSTONE, CLR_BRIGHT_GREEN),
676+
POLYMORPH_CONTROL, 1, 300, 1, 0, 8, GEMSTONE, CLR_BRIGHT_GREEN),
678677
RING("invisibility", "wire",
679-
INVIS, 150, 1, 0, 5, METAL, HI_METAL),
678+
INVIS, 1, 150, 1, 0, 5, METAL, HI_METAL),
680679
RING("see invisible", "engagement",
681-
SEE_INVIS, 150, 1, 0, 5, GOLD, HI_METAL),
680+
SEE_INVIS, 1, 150, 1, 0, 5, GOLD, HI_METAL),
682681
RING("protection from shape changers", "shiny",
683-
PROT_FROM_SHAPE_CHANGERS, 100, 1, 0, 5, PLATINUM, CLR_BRIGHT_CYAN),
682+
PROT_FROM_SHAPE_CHANGERS, 1, 100, 1, 0, 5, PLATINUM, CLR_BRIGHT_CYAN),
683+
/* placeholders for artifact rings; will not spawn randomly */
684+
RING("ancient", None,
685+
FREE_ACTION, 0, 800, 1, 0, 8, GEMSTONE, CLR_BRIGHT_GREEN),
686+
RING("lustrous", None,
687+
INVIS, 0, 600, 1, 0, 3, GOLD, HI_GOLD),
684688
#undef RING
685689

686690
/* amulets ... - THE Amulet comes last because it is special */

src/worn.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,9 @@ boolean racialexception;
919919
&& obj->otyp != RIN_INCREASE_ACCURACY
920920
&& obj->otyp != RIN_PROTECTION
921921
&& obj->otyp != RIN_LEVITATION
922-
&& obj->otyp != RIN_FREE_ACTION))
922+
&& obj->otyp != RIN_FREE_ACTION
923+
&& obj->otyp != RIN_ANCIENT
924+
&& obj->otyp != RIN_LUSTROUS))
923925
continue;
924926
if (mon->data == &mons[PM_NAZGUL]
925927
&& obj->otyp == RIN_INVISIBILITY)
@@ -1470,6 +1472,7 @@ struct obj *obj;
14701472
rc = !mon_prop(mon, REGENERATION) ? 25 : 5;
14711473
break;
14721474
case RIN_INVISIBILITY:
1475+
case RIN_LUSTROUS:
14731476
if (mon->mtame || mon->mpeaceful)
14741477
/* Monsters actually don't know if you can
14751478
* see invisible, but for tame or peaceful monsters
@@ -1501,6 +1504,7 @@ struct obj *obj;
15011504
rc = grounded(mon->data) ? 20 : 0;
15021505
break;
15031506
case RIN_FREE_ACTION:
1507+
case RIN_ANCIENT:
15041508
rc = 30;
15051509
break;
15061510
}

0 commit comments

Comments
 (0)