[Hide Content]From 19716af35849720e59908568b4e2ad0e7c2294c7 Mon Sep 17 00:00:00 2001
From: Shayne Halvorson <N78291@gmail.com>
Date: Sun, 1 Jan 2012 10:24:31 -0600
Subject: [PATCH] New Ds mutation: Augmentation
---
crawl-ref/source/enum.h | 1 +
crawl-ref/source/hiscores.cc | 2 +-
crawl-ref/source/mutation-data.h | 16 ++++++++++++++++
crawl-ref/source/mutation.cc | 16 ++++++++++++++++
crawl-ref/source/mutation.h | 1 +
crawl-ref/source/output.cc | 2 ++
crawl-ref/source/player.cc | 2 ++
crawl-ref/source/spl-cast.cc | 2 ++
crawl-ref/source/status.cc | 14 ++++++++++++++
crawl-ref/source/status.h | 1 +
10 files changed, 56 insertions(+), 1 deletions(-)
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index 80cee1b..cd6e7c5 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -2703,6 +2703,7 @@ enum mutation_type
MUT_FOUL_STENCH,
#endif
MUT_EVOLUTION,
+ MUT_AUGMENTATION,
NUM_MUTATIONS,
RANDOM_MUTATION,
diff --git a/crawl-ref/source/hiscores.cc b/crawl-ref/source/hiscores.cc
index ac48405..1b19179 100644
--- a/crawl-ref/source/hiscores.cc
+++ b/crawl-ref/source/hiscores.cc
@@ -1235,7 +1235,7 @@ void scorefile_entry::init(time_t dt)
DUR_DIVINE_VIGOUR, DUR_DIVINE_STAMINA, DUR_BERSERK, STATUS_AIRBORNE,
DUR_POISONING, STATUS_NET, STATUS_SPEED, DUR_AFRAID, DUR_MIRROR_DAMAGE,
DUR_SCRYING, STATUS_FIREBALL, DUR_SHROUD_OF_GOLUBRIA,
- STATUS_CONSTRICTED,
+ STATUS_CONSTRICTED, STATUS_AUGMENTED,
};
status_info inf;
diff --git a/crawl-ref/source/mutation-data.h b/crawl-ref/source/mutation-data.h
index aa9c435..da2a78d 100644
--- a/crawl-ref/source/mutation-data.h
+++ b/crawl-ref/source/mutation-data.h
@@ -1153,6 +1153,22 @@
"powered by pain"
},
+{ MUT_AUGMENTATION, 0, 3, false, false, false,
+ "augmentation",
+
+ {"Your magical and physical power is slightly enhanced as your life falls.",
+ "Your magical and physical power is enhanced as your life falls.",
+ "Your magical and physical power is greatly enhanced as your life falls."},
+
+ {"You feel power flowing into your body.",
+ "You feel power rushing into your body.",
+ "You feel saturated with power."},
+
+ {"", "", ""},
+
+ "augmentation"
+},
+
// Jiyva only mutations
{ MUT_GELATINOUS_BODY, 0, 3, false, true, true,
NULL,
diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc
index 9616ce4..7c4520d 100644
--- a/crawl-ref/source/mutation.cc
+++ b/crawl-ref/source/mutation.cc
@@ -1780,6 +1780,8 @@ static const facet_def _demon_facets[] =
{ 3, { MUT_STOCHASTIC_TORMENT_RESISTANCE, MUT_STOCHASTIC_TORMENT_RESISTANCE,
MUT_STOCHASTIC_TORMENT_RESISTANCE },
{ 3, 3, 3 } },
+ { 3, { MUT_AUGMENTATION, MUT_AUGMENTATION, MUT_AUGMENTATION },
+ { 3, 3, 3 } },
// Tier 2 facets
{ 2, { MUT_CONSERVE_SCROLLS, MUT_HEAT_RESISTANCE, MUT_IGNITE_BLOOD },
{ 2, 2, 2 } },
@@ -2291,3 +2293,17 @@ int handle_pbd_corpses(bool do_rot)
return (corpse_count);
}
+
+int augmentation_amount()
+{
+ int amount = 0;
+ const int level = player_mutation_level(MUT_AUGMENTATION) + 1;
+
+ for (int i = 1; i < level; ++i)
+ {
+ if (you.hp <= (i * you.hp_max) / level)
+ amount++;
+ }
+
+ return amount;
+}
diff --git a/crawl-ref/source/mutation.h b/crawl-ref/source/mutation.h
index 55c3395..28f12c9 100644
--- a/crawl-ref/source/mutation.h
+++ b/crawl-ref/source/mutation.h
@@ -104,5 +104,6 @@ void check_antennae_detect();
int handle_pbd_corpses(bool do_rot);
equipment_type beastly_slot(int mut);
bool physiology_mutation_conflict(mutation_type mutat);
+int augmentation_amount();
#endif
diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc
index 2fad6a8..2698d18 100644
--- a/crawl-ref/source/output.cc
+++ b/crawl-ref/source/output.cc
@@ -628,6 +628,7 @@ static void _get_status_lights(std::vector<status_light>& out)
STATUS_UMBRA,
STATUS_CONSTRICTED,
DUR_DIVINE_STAMINA,
+ STATUS_AUGMENTED,
};
status_info inf;
@@ -2072,6 +2073,7 @@ static std::string _status_mut_abilities(int sw)
STATUS_BACKLIT,
STATUS_UMBRA,
STATUS_CONSTRICTED,
+ STATUS_AUGMENTED,
};
status_info inf;
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index a45fd38..6202e8e 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -4058,6 +4058,7 @@ void display_char_status()
STATUS_BACKLIT,
STATUS_UMBRA,
STATUS_CONSTRICTED,
+ STATUS_AUGMENTED,
};
status_info inf;
@@ -4253,6 +4254,7 @@ int slaying_bonus(weapon_property_type which_affected, bool ranged)
}
ret += std::min(you.duration[DUR_SLAYING] / (13 * BASELINE_DELAY), 6);
+ ret += 3 * augmentation_amount();
return (ret);
}
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index f14d35a..f93886b 100644
--- a/crawl-ref/source/spl-cast.cc
+++ b/crawl-ref/source/spl-cast.cc
@@ -493,6 +493,8 @@ int spell_enhancement(unsigned int typeflags)
if (player_equip_ego_type(EQ_BODY_ARMOUR, SPARM_ARCHMAGI))
enhanced++;
+
+ enhanced += augmentation_amount();
// These are used in an exponential way, so we'll limit them a bit. -- bwr
if (enhanced > 3)
diff --git a/crawl-ref/source/status.cc b/crawl-ref/source/status.cc
index 96e9bed..c6a9778 100644
--- a/crawl-ref/source/status.cc
+++ b/crawl-ref/source/status.cc
@@ -352,6 +352,20 @@ void fill_status_info(int status, status_info* inf)
case STATUS_SPEED:
_describe_speed(inf);
break;
+
+ case STATUS_AUGMENTED:
+ {
+ int level = augmentation_amount();
+
+ if (level > 0)
+ {
+ inf->light_colour = (level == 3) ? WHITE :
+ (level == 2) ? LIGHTBLUE : BLUE;
+
+ inf->light_text = "Aug";
+ }
+ break;
+ }
case DUR_CONFUSING_TOUCH:
{
diff --git a/crawl-ref/source/status.h b/crawl-ref/source/status.h
index 977e93e..8fc8edc 100644
--- a/crawl-ref/source/status.h
+++ b/crawl-ref/source/status.h
@@ -26,6 +26,7 @@ enum status_type
STATUS_BACKLIT,
STATUS_UMBRA,
STATUS_CONSTRICTED,
+ STATUS_AUGMENTED,
};
struct status_info
--
1.6.5.1