Attached Files |
0001-etheric-cage.patch [^] (2,321 bytes) 2015-01-12 19:42 [Show Content] [Hide Content]diff --git a/crawl-ref/source/art-data.txt b/crawl-ref/source/art-data.txt
index 74965b7..1295081 100644
--- a/crawl-ref/source/art-data.txt
+++ b/crawl-ref/source/art-data.txt
@@ -1179,6 +1179,14 @@ PLUS: 5
BRAND: SPWPN_VORPAL
DEX: -3
+ENUM: ETHERIC_CAGE
+NAME: Maxwell's etheric cage
+OBJ: OBJ_ARMOUR/ARM_HELMET
+COLOUR: ETC_ELECTRICITY
+PLUS: +0
+MP: +4
+BOOL: mutate, elec
+
# This entry must always be last.
ENUM: DUMMY2
NAME: DUMMY UNRANDART 2
diff --git a/crawl-ref/source/art-func.h b/crawl-ref/source/art-func.h
index b5868d8..83d96d8 100644
--- a/crawl-ref/source/art-func.h
+++ b/crawl-ref/source/art-func.h
@@ -1268,3 +1268,33 @@ static void _CAPTAIN_melee_effects(item_def* weapon, actor* attacker,
}
}
+
+////////////////////////////////////////////////////
+
+static void _ETHERIC_CAGE_equip(item_def *item, bool *show_msgs, bool unmeld)
+{
+ _equip_mpr(show_msgs, "Magical energy is drawn to you!");
+}
+
+static void _ETHERIC_CAGE_world_reacts(item_def *item)
+{
+ int added_contamination = 0;
+
+ if (you.magic_points < you.max_magic_points
+ && one_chance_in(2)
+ && !(you.spirit_shield() && you.species == SP_DEEP_DWARF))
+ {
+ inc_mp(1);
+ // recovering 40 MP will give 600 contam on average
+ if (one_chance_in(20))
+ contaminate_player(200 + random2(200));
+ }
+ /* on avg the player recovers 25 contam per turn, this should keep them in
+ the gray a fair amount of time; be a little nicer if they're already
+ in the yellow */
+ if (one_chance_in(100))
+ {
+ added_contamination = get_contamination_level() > 1 ? 500 : 1000;
+ contaminate_player(added_contamination + random2(added_contamination));
+ }
+}
diff --git a/crawl-ref/source/dat/descript/unrand.txt b/crawl-ref/source/dat/descript/unrand.txt
index efcc3e9..84594de 100644
--- a/crawl-ref/source/dat/descript/unrand.txt
+++ b/crawl-ref/source/dat/descript/unrand.txt
@@ -585,3 +585,8 @@ quick blades "Gyre" and "Gimble"
Two quick blades joined by a chain. Swinging one compels the wielder to swing
the other, as if they have minds of their own.
%%%%
+Maxwell's etheric cage
+
+A spherical cage designed to capture ambient magical energy. Perhaps you could
+wear it on your head?
+%%%%
0002-etheric-cage.patch [^] (2,411 bytes) 2015-01-15 20:04 [Show Content] [Hide Content]diff --git a/crawl-ref/source/art-data.txt b/crawl-ref/source/art-data.txt
index 74965b7..1295081 100644
--- a/crawl-ref/source/art-data.txt
+++ b/crawl-ref/source/art-data.txt
@@ -1179,6 +1179,14 @@ PLUS: 5
BRAND: SPWPN_VORPAL
DEX: -3
+ENUM: ETHERIC_CAGE
+NAME: Maxwell's etheric cage
+OBJ: OBJ_ARMOUR/ARM_HELMET
+COLOUR: ETC_ELECTRICITY
+PLUS: +0
+MP: +4
+BOOL: mutate, elec
+
# This entry must always be last.
ENUM: DUMMY2
NAME: DUMMY UNRANDART 2
diff --git a/crawl-ref/source/art-func.h b/crawl-ref/source/art-func.h
index b5868d8..7a5045b 100644
--- a/crawl-ref/source/art-func.h
+++ b/crawl-ref/source/art-func.h
@@ -1268,3 +1268,33 @@ static void _CAPTAIN_melee_effects(item_def* weapon, actor* attacker,
}
}
+
+////////////////////////////////////////////////////
+
+static void _ETHERIC_CAGE_equip(item_def *item, bool *show_msgs, bool unmeld)
+{
+ _equip_mpr(show_msgs, "Magical energy is drawn to you!");
+}
+
+static void _ETHERIC_CAGE_world_reacts(item_def *item)
+{
+ int added_contamination = 0;
+
+ if (you.magic_points < you.max_magic_points
+ && one_chance_in(2)
+ && !(you.spirit_shield() && you.species == SP_DEEP_DWARF))
+ {
+ inc_mp(1);
+ }
+ /* On average the player recovers 25 contam per turn, this should keep them
+ in the gray a fair amount of time; be nicer if they're already in the
+ yellow.
+ It's more interesting to get a lump of contamination then to just add a
+ small amount every turn, plus there's a small chance of rapid buildup.
+ */
+ if (one_chance_in(100))
+ {
+ added_contamination = get_contamination_level() > 1 ? 300 : 1000;
+ contaminate_player(added_contamination + random2(added_contamination));
+ }
+}
diff --git a/crawl-ref/source/dat/descript/unrand.txt b/crawl-ref/source/dat/descript/unrand.txt
index efcc3e9..166cec8 100644
--- a/crawl-ref/source/dat/descript/unrand.txt
+++ b/crawl-ref/source/dat/descript/unrand.txt
@@ -585,3 +585,9 @@ quick blades "Gyre" and "Gimble"
Two quick blades joined by a chain. Swinging one compels the wielder to swing
the other, as if they have minds of their own.
%%%%
+Maxwell's etheric cage
+
+A spherical cage designed to capture ambient magical energy. Perhaps you could
+wear it on your head? Be warned, experimental notes mention a potential buildup
+of contaminants.
+%%%%
|