From 0d57b2b7aee5ef1142e970cf778259bdf12523f4 Mon Sep 17 00:00:00 2001 From: Corin Buchanan-Howland Date: Sat, 25 Apr 2015 11:41:37 -0400 Subject: [PATCH] Add two new Ru sacrifices: resistance and eye 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. --- crawl-ref/source/ability.cc | 10 ++++++++++ crawl-ref/source/actor.cc | 2 +- crawl-ref/source/actor.h | 2 +- crawl-ref/source/attack.cc | 4 +--- crawl-ref/source/beam.cc | 4 ++-- crawl-ref/source/dat/descript/ability.txt | 21 +++++++++++++++++++++ crawl-ref/source/enum.h | 6 +++++- crawl-ref/source/melee_attack.cc | 3 +-- crawl-ref/source/mon-project.cc | 5 +++-- crawl-ref/source/mutation-data.h | 20 ++++++++++++++++++++ crawl-ref/source/player.cc | 12 ++++++++++++ crawl-ref/source/player.h | 2 ++ crawl-ref/source/rltiles/dc-invocations.txt | 2 ++ .../rltiles/gui/invocations/ru_sacrifice_eye.png | Bin 0 -> 15660 bytes .../gui/invocations/ru_sacrifice_resistance.png | Bin 0 -> 15713 bytes crawl-ref/source/sacrifice-data.h | 20 ++++++++++++++++++++ 16 files changed, 101 insertions(+), 12 deletions(-) create mode 100644 crawl-ref/source/rltiles/gui/invocations/ru_sacrifice_eye.png create mode 100644 crawl-ref/source/rltiles/gui/invocations/ru_sacrifice_resistance.png diff --git a/crawl-ref/source/ability.cc b/crawl-ref/source/ability.cc index a841e62..6e0e9fd 100644 --- a/crawl-ref/source/ability.cc +++ b/crawl-ref/source/ability.cc @@ -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'); diff --git a/crawl-ref/source/actor.cc b/crawl-ref/source/actor.cc index f19ac02..326c538 100644 --- a/crawl-ref/source/actor.cc +++ b/crawl-ref/source/actor.cc @@ -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); } diff --git a/crawl-ref/source/actor.h b/crawl-ref/source/actor.h index e5f4c55..39711dc 100644 --- a/crawl-ref/source/actor.h +++ b/crawl-ref/source/actor.h @@ -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; diff --git a/crawl-ref/source/attack.cc b/crawl-ref/source/attack.cc index ee6211e..014dd7e 100644 --- a/crawl-ref/source/attack.cc +++ b/crawl-ref/source/attack.cc @@ -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)) diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index d17ae0e..5c061cb 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -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) diff --git a/crawl-ref/source/dat/descript/ability.txt b/crawl-ref/source/dat/descript/ability.txt index 99c014e..7f3aa5c 100644 --- a/crawl-ref/source/dat/descript/ability.txt +++ b/crawl-ref/source/dat/descript/ability.txt @@ -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 diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 0c428d0..95ad38c 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -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, diff --git a/crawl-ref/source/melee_attack.cc b/crawl-ref/source/melee_attack.cc index 79be087..be577bf 100644 --- a/crawl-ref/source/melee_attack.cc +++ b/crawl-ref/source/melee_attack.cc @@ -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; diff --git a/crawl-ref/source/mon-project.cc b/crawl-ref/source/mon-project.cc index 7ba2c6e..05b3733 100644 --- a/crawl-ref/source/mon-project.cc +++ b/crawl-ref/source/mon-project.cc @@ -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; diff --git a/crawl-ref/source/mutation-data.h b/crawl-ref/source/mutation-data.h index efc11bb..7aac307 100644 --- a/crawl-ref/source/mutation-data.h +++ b/crawl-ref/source/mutation-data.h @@ -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-)", +}, }; diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 76e8925..3022e6b 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -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; +} diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h index 1eaf226..f41bcde 100644 --- a/crawl-ref/source/player.h +++ b/crawl-ref/source/player.h @@ -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; diff --git a/crawl-ref/source/rltiles/dc-invocations.txt b/crawl-ref/source/rltiles/dc-invocations.txt index e0aa2c4..8f9adb4 100644 --- a/crawl-ref/source/rltiles/dc-invocations.txt +++ b/crawl-ref/source/rltiles/dc-invocations.txt @@ -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 index 0000000000000000000000000000000000000000..1d9d1f74dc82a0ab6678d32f350f1202256fbd8c GIT binary patch literal 15660 zcmeI3dt4J&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$wk}BTg8d@ip-D3#>W0i^y$_)+J&cH**slysJ~x- zL6Y7ll199``R$w*$@x3k$7dGw{GxMLURd(6>MfINXRNpsuKcyQ*OV)Tz4e71QPHP-8)`mY2b{o#?hoi)sgqfyUMj+ejR z&>DO1*$OsnTSDCI*|%3FTelzCzwF1P3tc}}-Y-ESFLiXMNf&?0zXY9~nX7L~U$f~y DB-@4k literal 0 HcmV?d00001 diff --git a/crawl-ref/source/sacrifice-data.h b/crawl-ref/source/sacrifice-data.h index 5007f18..48b8f26 100644 --- a/crawl-ref/source/sacrifice-data.h +++ b/crawl-ref/source/sacrifice-data.h @@ -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, +}, }; -- 1.8.5