Skip to content

Commit 79b07e1

Browse files
committed
New conduct: never acquired reflection.
Yet another conduct - never acquired reflection. Not quite as difficult as the 'never acquired magic resistance' conduct, but not exactly easy either.
1 parent 8f0680a commit 79b07e1

File tree

9 files changed

+36
-10
lines changed

9 files changed

+36
-10
lines changed

doc/evilhack-changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -3421,4 +3421,5 @@ The following changes to date are:
34213421
- Fix: repair armor spell will not randomly target the Hand of Vecna
34223422
- Suppress livelogging whilst in explore mode
34233423
- New conduct: never acquired magic resistance
3424+
- New conduct: never acquired reflection
34243425

include/you.h

+1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ struct u_conduct { /* number of times... */
131131
long pets; /* obtained a pet */
132132
long forgedarti; /* forged an artifact */
133133
long antimagic; /* acquired magic resistance */
134+
long reflection; /* acquired reflection */
134135
/* genocides already listed at end of game */
135136
};
136137

src/artifact.c

+12-8
Original file line numberDiff line numberDiff line change
@@ -1022,29 +1022,33 @@ long wp_mask;
10221022
}
10231023
if (spfx & SPFX_REFLECT) {
10241024
if (otmp->oartifact == ART_MAGIC_MIRROR_OF_MERLIN) {
1025-
if (on)
1025+
if (on) {
10261026
EReflecting |= wp_mask;
1027-
else
1027+
u.uconduct.reflection++;
1028+
} else
10281029
EReflecting &= ~wp_mask;
10291030
} else if (otmp
10301031
&& (otmp->oartifact == ART_LONGBOW_OF_DIANA
10311032
|| otmp->oartifact == ART_CROSSBOW_OF_CARL)
10321033
&& (wp_mask & W_WEP)) { /* wielding various reflecting artifacts */
1033-
if (on)
1034+
if (on) {
10341035
EReflecting |= wp_mask;
1035-
else
1036+
u.uconduct.reflection++;
1037+
} else
10361038
EReflecting &= ~wp_mask;
10371039
} else if (otmp && otmp->oartifact == ART_DRAGONBANE
10381040
&& (wp_mask & W_ARMG)) { /* or in Dragonbane's case, wear them */
1039-
if (on)
1041+
if (on) {
10401042
EReflecting |= wp_mask;
1041-
else
1043+
u.uconduct.reflection++;
1044+
} else
10421045
EReflecting &= ~wp_mask;
10431046
} else if (otmp && otmp->oartifact == ART_GAUNTLETS_OF_PURITY
10441047
&& (wp_mask & W_ARMG)) { /* same */
1045-
if (on)
1048+
if (on) {
10461049
EReflecting |= wp_mask;
1047-
else
1050+
u.uconduct.reflection++;
1051+
} else
10481052
EReflecting &= ~wp_mask;
10491053
}
10501054
}

src/cmd.c

+5
Original file line numberDiff line numberDiff line change
@@ -3150,6 +3150,7 @@ int final;
31503150
you_are("invulnerable", from_what(INVULNERABLE));
31513151
if (Antimagic)
31523152
you_are("magic-protected", from_what(ANTIMAGIC));
3153+
31533154
/* Partial intrinsic resistances */
31543155
Sprintf(buf, "%d%% fire resistant", how_resistant(FIRE_RES));
31553156
if (Fire_resistance)
@@ -3874,6 +3875,10 @@ int final;
38743875
you_have_never("acquired magic resistance");
38753876
}
38763877

3878+
if (!u.uconduct.reflection) {
3879+
you_have_never("acquired reflection");
3880+
}
3881+
38773882
show_achievements(final);
38783883

38793884
/* Pop up the window and wait for a key */

src/do_wear.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ Shield_on(VOID_ARGS)
848848
{
849849
/* no shield currently requires special handling when put on, but we
850850
keep this uncommented in case somebody adds a new one which does
851-
[reflection is handled by setting u.uprops[REFLECTION].extrinsic
851+
[reflection is handled by setting u.uprops[REFLECTING].extrinsic
852852
in setworn() called by armor_or_accessory_on() before Shield_on()] */
853853
switch (uarms->otyp) {
854854
case SMALL_SHIELD:

src/polyself.c

+7
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,13 @@ int mntmp;
800800
if (resists_mgc(youmonst.data))
801801
u.uconduct.antimagic++;
802802

803+
/* no reflection conduct. currently, the only monster
804+
that has reflection that a player can polymorph
805+
into is an adult silver dragon. should that ever
806+
change, we'll need to revisit this bit of code */
807+
if (youmonst.data == &mons[PM_SILVER_DRAGON])
808+
u.uconduct.reflection++;
809+
803810
/*
804811
mlvl = adj_lev(&mons[mntmp]);
805812
* We can't do the above, since there's no such thing as an

src/spell.c

+1
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,7 @@ register struct monst *mdef;
869869
? 250 : 100);
870870

871871
if (youdefend) {
872+
u.uconduct.reflection++;
872873
if (HReflecting) {
873874
if (!Blind)
874875
pline("The shimmering globe around you becomes slightly brighter.");

src/topten.c

+3
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@ encode_extended_conducts()
522522
add_achieveX(buf, "never_abused_alignment", u.ualign.abuse == 0);
523523
add_achieveX(buf, "never_forged_an_artifact", !u.uconduct.forgedarti);
524524
add_achieveX(buf, "never_acquired_magic_resistance", !u.uconduct.antimagic);
525+
add_achieveX(buf, "never_acquired_reflection", !u.uconduct.reflection);
525526

526527
return buf;
527528
}
@@ -597,6 +598,8 @@ encodeconduct()
597598
e |= 1L << 21;
598599
if (!u.uconduct.antimagic)
599600
e |= 1L << 22;
601+
if (!u.uconduct.reflection)
602+
e |= 1L << 23;
600603

601604
return e;
602605
}

src/worn.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -1646,9 +1646,13 @@ struct obj *armor;
16461646
return objects[Dragon_armor_to_scales(armor)].oc_oprop;
16471647

16481648
/* no magic resistance conduct */
1649-
if (prop == ANTIMAGIC)
1649+
if (obj_has_prop(armor, ANTIMAGIC))
16501650
u.uconduct.antimagic++;
16511651

1652+
/* no reflection conduct */
1653+
if (obj_has_prop(armor, REFLECTING))
1654+
u.uconduct.reflection++;
1655+
16521656
return prop;
16531657
}
16541658

0 commit comments

Comments
 (0)