Add two new Ru sacrifices: resistance and eye
authorCorin Buchanan-Howland <corin@buchananhowland.net>
Sat, 25 Apr 2015 15:41:37 +0000 (11:41 -0400)
committerCorin Buchanan-Howland <corin@buchananhowland.net>
Sat, 25 Apr 2015 15:46:09 +0000 (11:46 -0400)
Sacrifice Resistance is {rF- rC-} and worth as much piety as sac hand.
Sacrifice an Eye gives you 2x inaccuracy, like the amulet*2. It stacks with
the amulet. It's worth 35 piety, like Sacrifice Skill.

16 files changed:
crawl-ref/source/ability.cc
crawl-ref/source/actor.cc
crawl-ref/source/actor.h
crawl-ref/source/attack.cc
crawl-ref/source/beam.cc
crawl-ref/source/dat/descript/ability.txt
crawl-ref/source/enum.h
crawl-ref/source/melee_attack.cc
crawl-ref/source/mon-project.cc
crawl-ref/source/mutation-data.h
crawl-ref/source/player.cc
crawl-ref/source/player.h
crawl-ref/source/rltiles/dc-invocations.txt
crawl-ref/source/rltiles/gui/invocations/ru_sacrifice_eye.png [new file with mode: 0644]
crawl-ref/source/rltiles/gui/invocations/ru_sacrifice_resistance.png [new file with mode: 0644]
crawl-ref/source/sacrifice-data.h

index a841e62..6e0e9fd 100644 (file)
@@ -440,6 +440,10 @@ static const ability_def Ability_List[] =
       0, 0, 0, 0, 0, ABFLAG_SACRIFICE },
     { ABIL_RU_SACRIFICE_SKILL, "Sacrifice Skill",
       0, 0, 0, 0, 0, ABFLAG_SACRIFICE },
+    { ABIL_RU_SACRIFICE_EYE, "Sacrifice an Eye",
+      0, 0, 0, 0, 0, ABFLAG_SACRIFICE },
+    { ABIL_RU_SACRIFICE_RESISTANCE, "Sacrifice Resistance",
+      0, 0, 0, 0, 0, ABFLAG_SACRIFICE },
     { ABIL_RU_REJECT_SACRIFICES, "Reject Sacrifices",
       0, 0, 0, 0, 0, ABFLAG_NONE },
 
@@ -1170,6 +1174,8 @@ talent get_talent(ability_type ability, bool check_confused)
     case ABIL_RU_SACRIFICE_HAND:
     case ABIL_RU_SACRIFICE_EXPERIENCE:
     case ABIL_RU_SACRIFICE_SKILL:
+    case ABIL_RU_SACRIFICE_EYE:
+    case ABIL_RU_SACRIFICE_RESISTANCE:
     case ABIL_RU_REJECT_SACRIFICES:
     case ABIL_STOP_RECALL:
         invoc = true;
@@ -3142,6 +3148,8 @@ static spret_type _do_ability(const ability_def& abil, bool fail)
     case ABIL_RU_SACRIFICE_HAND:
     case ABIL_RU_SACRIFICE_EXPERIENCE:
     case ABIL_RU_SACRIFICE_SKILL:
+    case ABIL_RU_SACRIFICE_EYE:
+    case ABIL_RU_SACRIFICE_RESISTANCE:
         fail_check();
         if (!ru_do_sacrifice(abil.ability))
             return SPRET_ABORT;
@@ -3904,6 +3912,8 @@ static int _find_ability_slot(const ability_def &abil)
       || abil.ability == ABIL_RU_SACRIFICE_HAND
       || abil.ability == ABIL_RU_SACRIFICE_EXPERIENCE
       || abil.ability == ABIL_RU_SACRIFICE_SKILL
+      || abil.ability == ABIL_RU_SACRIFICE_EYE
+      || abil.ability == ABIL_RU_SACRIFICE_RESISTANCE
       || abil.ability == ABIL_RU_REJECT_SACRIFICES)
     {
         first_slot = letter_to_index('P');
index f19ac02..326c538 100644 (file)
@@ -212,7 +212,7 @@ void actor::shield_block_succeeded(actor *foe)
     }
 }
 
-bool actor::inaccuracy() const
+int actor::inaccuracy() const
 {
     return wearing(EQ_AMULET, AMU_INACCURACY);
 }
index e5f4c55..39711dc 100644 (file)
@@ -303,7 +303,7 @@ public:
     virtual int check_res_magic(int power);
     virtual bool no_tele(bool calc_unid = true, bool permit_id = true,
                          bool blink = false) const = 0;
-    virtual bool inaccuracy() const;
+    virtual int inaccuracy() const;
     virtual bool antimagic_susceptible() const = 0;
 
     virtual bool gourmand(bool calc_unid = true, bool items = true) const;
index ee6211e..014dd7e 100644 (file)
@@ -258,9 +258,7 @@ int attack::calc_to_hit(bool random)
     }
 
     // Penalties for both players and monsters:
-
-    if (attacker->inaccuracy())
-        mhit -= 5;
+    mhit -= 5 * attacker->inaccuracy();
 
     // If you can't see yourself, you're a little less accurate.
     if (!attacker->visible_to(attacker))
index d17ae0e..5c061cb 100644 (file)
@@ -447,8 +447,8 @@ void zappy(zap_type z_type, int power, bolt &pbolt)
     else
     {
         pbolt.hit = (*zinfo->tohit)(power);
-        if (you.inaccuracy() && pbolt.hit != AUTOMATIC_HIT)
-            pbolt.hit = max(0, pbolt.hit - 5);
+        if (pbolt.hit != AUTOMATIC_HIT)
+            pbolt.hit = max(0, pbolt.hit - 5 * you.inaccuracy());
     }
 
     if (zinfo->damage)
index 99c014e..7f3aa5c 100644 (file)
@@ -807,6 +807,27 @@ proportion to the value of the sacrifice, and you may gain new powers as well.
 
 Sacrifices cannot be taken back.
 %%%%
+Sacrifice an Eye ability
+
+Adherents who choose to sacrifice their eye will have a much harder time hitting
+their targets, to the same degree as if they were wearing two amulets of
+inaccuracy at once.
+
+If you make this sacrifice, your powers granted by Ru will become stronger in
+proportion to the value of the sacrifice, and you may gain new powers as well.
+
+Sacrifices cannot be taken back.
+%%%%
+Sacrifice Resistance ability
+
+Adherents who choose to sacrifice their resistance will become vulnerable to
+extreme heat and cold.
+
+If you make this sacrifice, your powers granted by Ru will become stronger in
+proportion to the value of the sacrifice, and you may gain new powers as well.
+
+Sacrifices cannot be taken back.
+%%%%
 Reject Sacrifices ability
 
 Adherents who cannot bring themselves to make any offered sacrifice may reject
index 0c428d0..95ad38c 100644 (file)
@@ -326,7 +326,9 @@ enum ability_type
     ABIL_RU_SACRIFICE_HAND,
     ABIL_RU_SACRIFICE_EXPERIENCE,
     ABIL_RU_SACRIFICE_SKILL,
-        ABIL_FINAL_SACRIFICE = ABIL_RU_SACRIFICE_SKILL,
+    ABIL_RU_SACRIFICE_EYE,
+    ABIL_RU_SACRIFICE_RESISTANCE,
+        ABIL_FINAL_SACRIFICE = ABIL_RU_SACRIFICE_RESISTANCE,
     ABIL_RU_REJECT_SACRIFICES,
 
     // For both Yred and Beogh
@@ -3660,6 +3662,8 @@ enum mutation_type
     MUT_MUMMY_RESTORATION,
     MUT_CONSTRICTING_TAIL,
     MUT_TENGU_FLIGHT,
+    MUT_MISSING_EYE,
+    MUT_TEMPERATURE_SENSITIVITY,
     NUM_MUTATIONS,
 
     RANDOM_MUTATION,
index 79be087..be577bf 100644 (file)
@@ -3614,8 +3614,7 @@ int melee_attack::calc_your_to_hit_unarmed(int uattack, bool vampiric)
                 + you.skill(SK_FIGHTING, 30);
     your_to_hit /= 100;
 
-    if (you.inaccuracy())
-        your_to_hit -= 5;
+    your_to_hit -= 5 * you.inaccuracy();
 
     if (player_mutation_level(MUT_EYEBALLS))
         your_to_hit += 2 * player_mutation_level(MUT_EYEBALLS) + 1;
index 7ba2c6e..05b3733 100644 (file)
@@ -264,8 +264,9 @@ static void _fuzz_direction(const actor *caster, monster& mon, int pow)
     const float off = (coinflip() ? -1 : 1) * 0.25;
     float tan = (random2(31) - 15) * 0.019; // approx from degrees
     tan *= 75.0 / pow;
-    if (caster && caster->inaccuracy())
-        tan *= 2;
+    int inaccuracy = caster->inaccuracy();
+    if (caster && inaccuracy > 0)
+        tan *= 2 * inaccuracy;
 
     // Cast either from left or right hand.
     mon.props[IOOD_X] = x + vy*off;
index efc11bb..7aac307 100644 (file)
@@ -2142,4 +2142,24 @@ static const mutation_def mut_data[] =
 
    "claws that catch",
 },
+
+{ MUT_MISSING_EYE,                    0,  1, MUTFLAG_RU, false,
+  "missing an eye",
+
+  {"You are missing an eye, making it more difficult to aim.", "", ""},
+  {"Your right eye vanishes! The world loses its depth.", "", ""},
+  {"Your right eye suddenly reappears! The world regains its depth.", "", ""},
+
+   "a missing eye",
+},
+
+{ MUT_TEMPERATURE_SENSITIVITY,        0,  1, MUTFLAG_RU, false,
+  "temperature sensitive",
+
+  {"You are sensitive to extremes of temperature (rF-, rC-).", "", ""},
+  {"You feel sensitive to extremes of temperature.", "", ""},
+  {"You no longer feel sensitive to extremes of temperature", "", ""},
+
+   "temperature sensitivity (rF-, rC-)",
+},
 };
index 76e8925..3022e6b 100644 (file)
@@ -1396,6 +1396,7 @@ int player_res_fire(bool calc_unid, bool temp, bool items)
     // mutations:
     rf += player_mutation_level(MUT_HEAT_RESISTANCE, temp);
     rf -= player_mutation_level(MUT_HEAT_VULNERABILITY, temp);
+    rf -= player_mutation_level(MUT_TEMPERATURE_SENSITIVITY, temp);
     rf += player_mutation_level(MUT_MOLTEN_SCALES, temp) == 3 ? 1 : 0;
 
     // spells:
@@ -1512,6 +1513,7 @@ int player_res_cold(bool calc_unid, bool temp, bool items)
     // mutations:
     rc += player_mutation_level(MUT_COLD_RESISTANCE, temp);
     rc -= player_mutation_level(MUT_COLD_VULNERABILITY, temp);
+    rc -= player_mutation_level(MUT_TEMPERATURE_SENSITIVITY, temp);
     rc += player_mutation_level(MUT_ICY_BLUE_SCALES, temp) == 3 ? 1 : 0;
     rc += player_mutation_level(MUT_SHAGGY_FUR, temp) == 3 ? 1 : 0;
 
@@ -8589,3 +8591,13 @@ void player::maybe_degrade_bone_armour(int mult)
 
     redraw_armour_class = true;
 }
+
+int player::inaccuracy() const
+{
+    int degree = 0;
+    if (wearing(EQ_AMULET, AMU_INACCURACY))
+        degree++;
+    if (player_mutation_level(MUT_MISSING_EYE))
+        degree += 2;
+    return degree;
+}
index 1eaf226..f41bcde 100644 (file)
@@ -521,6 +521,8 @@ public:
     int base_ac_from(const item_def &armour, int scale = 1) const;
     void maybe_degrade_bone_armour(int mult);
 
+    int inaccuracy() const;
+
     // actor
     int mindex() const;
     int get_hit_dice() const;
index e0aa2c4..8f9adb4 100644 (file)
@@ -67,6 +67,8 @@ ru_sacrifice_durability ABILITY_RU_SACRIFICE_DURABILITY
 ru_sacrifice_hand ABILITY_RU_SACRIFICE_HAND
 ru_sacrifice_experience ABILITY_RU_SACRIFICE_EXPERIENCE
 ru_sacrifice_skill ABILITY_RU_SACRIFICE_SKILL
+ru_sacrifice_eye ABILITY_RU_SACRIFICE_EYE
+ru_sacrifice_resistance ABILITY_RU_SACRIFICE_RESISTANCE
 ru_reject_sacrifices ABILITY_RU_REJECT_SACRIFICES
 sif_muna_amnesia ABILITY_SIF_MUNA_AMNESIA
 sif_muna_channel ABILITY_SIF_MUNA_CHANNEL
diff --git a/crawl-ref/source/rltiles/gui/invocations/ru_sacrifice_eye.png b/crawl-ref/source/rltiles/gui/invocations/ru_sacrifice_eye.png
new file mode 100644 (file)
index 0000000..1d9d1f7
Binary files /dev/null and b/crawl-ref/source/rltiles/gui/invocations/ru_sacrifice_eye.png differ
diff --git a/crawl-ref/source/rltiles/gui/invocations/ru_sacrifice_resistance.png b/crawl-ref/source/rltiles/gui/invocations/ru_sacrifice_resistance.png
new file mode 100644 (file)
index 0000000..2945c3a
Binary files /dev/null and b/crawl-ref/source/rltiles/gui/invocations/ru_sacrifice_resistance.png differ
index 5007f18..48b8f26 100644 (file)
@@ -173,4 +173,24 @@ static const sacrifice_def sac_data[] =
   nullptr,
   nullptr,
 },
+
+{ ABIL_RU_SACRIFICE_EYE, MUT_MISSING_EYE,
+  "sacrifice an eye",
+  "sacrificed an eye",
+
+  45,
+  SK_NONE,
+  nullptr,
+  nullptr,
+},
+
+{ ABIL_RU_SACRIFICE_RESISTANCE, MUT_TEMPERATURE_SENSITIVITY,
+  "sacrifice your resistance to extreme temperatures",
+  "sacrificed resistance",
+
+  70,
+  SK_NONE,
+  nullptr,
+  nullptr,
+},
 };