|
From: <gi...@cr...> - 2012-02-27 02:15:17
|
via 910341321a0fd25aa2defdd70884b56bd7f988cb (commit)
via 0ffc5744a94c7022dafef5fb67f02a1ef0bee3e3 (commit)
via 9e00649ab4f40cb963a21fbead2dda9789bb1bfa (commit)
from 3546c0aef71de92b5a4bd843d7f95a84302c9878 (commit)
-----------------------------------------------------------------------
commit 910341321a0fd25aa2defdd70884b56bd7f988cb
Author: Adam Borowski <kil...@an...>
Date: Mon Feb 27 03:07:53 2012 +0100
Properly mark magic shield (Helm card) as temporary on SH display.
commit 0ffc5744a94c7022dafef5fb67f02a1ef0bee3e3
Author: Adam Borowski <kil...@an...>
Date: Mon Feb 27 03:01:48 2012 +0100
Combine effects of the potion of resistance into one.
Only Insulation remains a spell, and four status lights take too much space
on the HUD, interrupting travel/exploration four times rather than once.
commit 9e00649ab4f40cb963a21fbead2dda9789bb1bfa
Author: Adam Borowski <kil...@an...>
Date: Mon Feb 27 02:44:21 2012 +0100
Simplify.
Other parts could be changed into boolean logic a well, but I'm leaving
them for now in case the cap of 1 ever changes.
-----------------------------------------------------------------------
Summary of changes:
crawl-ref/source/decks.cc | 30 +++++-------------------------
crawl-ref/source/enum.h | 8 +++++---
crawl-ref/source/main.cc | 13 +++----------
crawl-ref/source/output.cc | 5 ++---
crawl-ref/source/player.cc | 27 +++++++++++----------------
crawl-ref/source/potion.cc | 5 +----
crawl-ref/source/spl-goditem.cc | 4 ++--
crawl-ref/source/status.cc | 8 ++------
crawl-ref/source/transform.cc | 3 ---
9 files changed, 31 insertions(+), 72 deletions(-)
diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc
index 3145b0c..89e03e5 100644
--- a/crawl-ref/source/decks.cc
+++ b/crawl-ref/source/decks.cc
@@ -1814,7 +1814,7 @@ static void _helm_card(int power, deck_rarity_type rarity)
bool do_phaseshift = false;
bool do_stoneskin = false;
bool do_shield = false;
- int num_resists = 0;
+ bool do_resistance = false;
// Chances are cumulative.
if (power_level >= 2)
@@ -1822,7 +1822,7 @@ static void _helm_card(int power, deck_rarity_type rarity)
if (coinflip()) do_phaseshift = true;
if (coinflip()) do_stoneskin = true;
if (coinflip()) do_shield = true;
- num_resists = random2(4);
+ do_resistance = true;
}
if (power_level >= 1)
{
@@ -1842,31 +1842,11 @@ static void _helm_card(int power, deck_rarity_type rarity)
cast_phase_shift(random2(power/4));
if (do_stoneskin)
cast_stoneskin(random2(power/4));
- if (num_resists)
+ if (do_resistance)
{
- const duration_type possible_resists[4] = {
- DUR_RESIST_POISON, DUR_INSULATION,
- DUR_RESIST_FIRE, DUR_RESIST_COLD
- };
- const char* resist_names[4] = {
- "poison", "electricity", "fire", "cold"
- };
-
- for (int i = 0; i < 4 && num_resists; ++i)
- {
- // If there are n left, of which we need to choose
- // k, we have chance k/n of selecting the next item.
- if (x_chance_in_y(num_resists, 4-i))
- {
- // Add a temporary resistance.
- you.increase_duration(possible_resists[i], random2(power/7) +1);
- msg::stream << "You feel resistant to " << resist_names[i]
- << '.' << std::endl;
- --num_resists;
- }
- }
+ mpr("You feel resistant.");
+ you.increase_duration(DUR_RESISTANCE, random2(power/7) + 1);
}
-
if (do_shield)
{
if (you.duration[DUR_MAGIC_SHIELD] == 0)
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index 7cc0a29..0e021b8 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -1382,9 +1382,11 @@ enum duration_type
DUR_GOURMAND,
DUR_BARGAIN,
DUR_INSULATION,
- DUR_RESIST_POISON,
- DUR_RESIST_FIRE,
- DUR_RESIST_COLD,
+ DUR_RESISTANCE,
+#if TAG_MAJOR_VERSION == 32
+ DUR_UNUSED_RESIST_FIRE,
+ DUR_UNUSED_RESIST_COLD,
+#endif
DUR_SLAYING,
DUR_STEALTH,
DUR_MAGIC_SHIELD,
diff --git a/crawl-ref/source/main.cc b/crawl-ref/source/main.cc
index 95eece6..99ab1eb 100644
--- a/crawl-ref/source/main.cc
+++ b/crawl-ref/source/main.cc
@@ -2483,16 +2483,9 @@ static void _decrement_durations()
_decrement_a_duration(DUR_INSULATION, delay,
"You feel conductive.", coinflip(),
"You start to feel a little less insulated.");
-
- _decrement_a_duration(DUR_RESIST_FIRE, delay,
- "Your fire resistance expires.", coinflip(),
- "You start to feel less resistant to fire.");
- _decrement_a_duration(DUR_RESIST_COLD, delay,
- "Your cold resistance expires.", coinflip(),
- "You start to feel less resistant to cold.");
- _decrement_a_duration(DUR_RESIST_POISON, delay,
- "Your poison resistance expires.", coinflip(),
- "You start to feel less resistant to poison.");
+ _decrement_a_duration(DUR_RESISTANCE, delay,
+ "Your resistance to elements expires.", coinflip(),
+ "You start to feel less resistant.");
if (_decrement_a_duration(DUR_PHASE_SHIFT, delay,
"You are firmly grounded in the material plane once more.",
diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc
index a655c43..76ee18f 100644
--- a/crawl-ref/source/output.cc
+++ b/crawl-ref/source/output.cc
@@ -372,6 +372,7 @@ static void _print_stats_ac(int x, int y)
if (you.incapacitated() && player_wearing_slot(EQ_SHIELD))
textcolor(RED);
else if (you.duration[DUR_CONDENSATION_SHIELD]
+ || you.duration[DUR_MAGIC_SHIELD]
|| you.duration[DUR_DIVINE_SHIELD])
{
textcolor(LIGHTBLUE);
@@ -576,9 +577,7 @@ static void _get_status_lights(std::vector<status_light>& out)
DUR_REPEL_MISSILES,
STATUS_REGENERATION,
DUR_BERSERK,
- DUR_RESIST_POISON,
- DUR_RESIST_COLD,
- DUR_RESIST_FIRE,
+ DUR_RESISTANCE,
DUR_INSULATION,
DUR_SEE_INVISIBLE,
STATUS_AIRBORNE,
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index f5d3058..5832847 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -1496,7 +1496,7 @@ int player_res_fire(bool calc_unid, bool temp, bool items)
// spells:
if (temp)
{
- if (you.duration[DUR_RESIST_FIRE] > 0)
+ if (you.duration[DUR_RESISTANCE])
rf++;
if (you.duration[DUR_FIRE_SHIELD])
@@ -1561,8 +1561,7 @@ int player_res_cold(bool calc_unid, bool temp, bool items)
if (temp)
{
- // spells:
- if (you.duration[DUR_RESIST_COLD] > 0)
+ if (you.duration[DUR_RESISTANCE])
rc++;
if (you.duration[DUR_FIRE_SHIELD])
@@ -1720,7 +1719,6 @@ int player_res_electricity(bool calc_unid, bool temp, bool items)
// dragonskin cloak: 0.5 to draconic resistances
if (player_equip_unrand(UNRAND_DRAGONSKIN) && coinflip())
re++;
-
}
// mutations:
@@ -1729,16 +1727,17 @@ int player_res_electricity(bool calc_unid, bool temp, bool items)
if (temp)
{
- if (you.duration[DUR_INSULATION])
+ if (you.attribute[ATTR_DIVINE_LIGHTNING_PROTECTION])
+ return 3;
+
+ if (you.duration[DUR_INSULATION] || you.duration[DUR_RESISTANCE])
re++;
// transformations:
if (you.form == TRAN_STATUE)
re += 1;
- if (you.attribute[ATTR_DIVINE_LIGHTNING_PROTECTION])
- re = 3;
- else if (re > 1)
+ if (re > 1)
re = 1;
}
@@ -1811,8 +1810,8 @@ int player_res_poison(bool calc_unid, bool temp, bool items)
if (temp)
{
- // spells:
- if (you.duration[DUR_RESIST_POISON] > 0)
+ // potions/cards:
+ if (you.duration[DUR_RESISTANCE])
rp++;
// transformations:
@@ -3766,9 +3765,7 @@ int get_expiration_threshold(duration_type dur)
case DUR_REPEL_MISSILES:
case DUR_REGENERATION:
case DUR_INSULATION:
- case DUR_RESIST_POISON:
- case DUR_RESIST_FIRE:
- case DUR_RESIST_COLD:
+ case DUR_RESISTANCE:
case DUR_SWIFTNESS:
case DUR_INVIS:
case DUR_HASTE:
@@ -4028,9 +4025,7 @@ void display_char_status()
DUR_JELLY_PRAYER,
STATUS_REGENERATION,
DUR_SWIFTNESS,
- DUR_RESIST_POISON,
- DUR_RESIST_COLD,
- DUR_RESIST_FIRE,
+ DUR_RESISTANCE,
DUR_INSULATION,
DUR_TELEPORT,
DUR_CONTROL_TELEPORT,
diff --git a/crawl-ref/source/potion.cc b/crawl-ref/source/potion.cc
index e275e47..57d9e6d 100644
--- a/crawl-ref/source/potion.cc
+++ b/crawl-ref/source/potion.cc
@@ -433,10 +433,7 @@ bool potion_effect(potion_type pot_eff, int pow, bool drank_it, bool was_known,
case POT_RESISTANCE:
mpr("You feel protected.", MSGCH_DURATION);
- you.increase_duration(DUR_RESIST_FIRE, (random2(pow) + 35) / factor);
- you.increase_duration(DUR_RESIST_COLD, (random2(pow) + 35) / factor);
- you.increase_duration(DUR_RESIST_POISON, (random2(pow) + 35) / factor);
- you.increase_duration(DUR_INSULATION, (random2(pow) + 35) / factor);
+ you.increase_duration(DUR_RESISTANCE, (random2(pow) + 35) / factor);
// Just one point of contamination. These potions are really rare,
// and contamination is nastier.
diff --git a/crawl-ref/source/spl-goditem.cc b/crawl-ref/source/spl-goditem.cc
index 41a5a31..c60d5d4 100644
--- a/crawl-ref/source/spl-goditem.cc
+++ b/crawl-ref/source/spl-goditem.cc
@@ -368,8 +368,8 @@ void antimagic()
DUR_REGENERATION, DUR_SWIFTNESS, DUR_CONTROL_TELEPORT,
DUR_TRANSFORMATION, DUR_DEATH_CHANNEL, DUR_DEFLECT_MISSILES,
DUR_PHASE_SHIFT, DUR_SEE_INVISIBLE, DUR_WEAPON_BRAND, DUR_SILENCE,
- DUR_CONDENSATION_SHIELD, DUR_STONESKIN, DUR_INSULATION, DUR_RESIST_POISON,
- DUR_RESIST_FIRE, DUR_RESIST_COLD, DUR_SLAYING, DUR_STEALTH,
+ DUR_CONDENSATION_SHIELD, DUR_STONESKIN, DUR_INSULATION, DUR_RESISTANCE,
+ DUR_SLAYING, DUR_STEALTH,
DUR_MAGIC_SHIELD, DUR_PETRIFIED, DUR_LIQUEFYING, DUR_DARKNESS,
DUR_PETRIFYING, DUR_SHROUD_OF_GOLUBRIA
};
diff --git a/crawl-ref/source/status.cc b/crawl-ref/source/status.cc
index af9a30c..ec3ffd3 100644
--- a/crawl-ref/source/status.cc
+++ b/crawl-ref/source/status.cc
@@ -76,12 +76,8 @@ static duration_def duration_data[] =
WHITE, "Pray", "praying", "You are praying." },
{ DUR_REPEL_MISSILES, true,
BLUE, "RMsl", "repel missiles", "You are protected from missiles." },
- { DUR_RESIST_POISON, true,
- LIGHTBLUE, "rPois", "", "You resist poison." },
- { DUR_RESIST_COLD, true,
- LIGHTBLUE, "rCold", "", "You resist cold." },
- { DUR_RESIST_FIRE, true,
- LIGHTBLUE, "rFire", "", "You resist fire." },
+ { DUR_RESISTANCE, true,
+ LIGHTBLUE, "Resist", "", "You resist elements." },
{ DUR_SAGE, true,
BLUE, "Sage", "", "" },
{ DUR_SEE_INVISIBLE, true,
diff --git a/crawl-ref/source/transform.cc b/crawl-ref/source/transform.cc
index 6a49776..0562cea 100644
--- a/crawl-ref/source/transform.cc
+++ b/crawl-ref/source/transform.cc
@@ -865,9 +865,6 @@ bool transform(int pow, transformation_type which_trans, bool force,
you.duration[DUR_REGENERATION] = 0;
}
- // silently removed since undead automatically resist poison -- bwr
- you.duration[DUR_RESIST_POISON] = 0;
-
you.is_undead = US_UNDEAD;
you.hunger_state = HS_SATIATED; // no hunger effects while transformed
set_redraw_status(REDRAW_HUNGER);
--
Dungeon Crawl Stone Soup
|