summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-08-02 18:45:25 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-08-02 18:45:25 +0000
commit606e14406ef0ae5f12dccad44b6f0f0b3433f013 (patch)
treed6be863eabf8d180145dafcc439f1753222966b0 /crawl-ref/source
parent84a922b5d5d8ca1d70f1ecc74d489e34b7ef4b80 (diff)
downloadcrawl-ref-606e14406ef0ae5f12dccad44b6f0f0b3433f013.tar.gz
crawl-ref-606e14406ef0ae5f12dccad44b6f0f0b3433f013.zip
Restrictions during bat form. Disallowed a number of actions.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1958 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/acr.cc41
-rw-r--r--crawl-ref/source/enum.h1
-rw-r--r--crawl-ref/source/food.cc4
-rw-r--r--crawl-ref/source/item_use.cc6
-rw-r--r--crawl-ref/source/mutation.cc8
-rw-r--r--crawl-ref/source/stuff.cc3
6 files changed, 39 insertions, 24 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index d36672a62a..7d4c2f91b3 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -1241,8 +1241,7 @@ void process_command( command_type cmd )
case CMD_THROW:
if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
{
- mpr("You can't throw anything in your present form!");
- flush_input_buffer( FLUSH_ON_FAILURE );
+ canned_msg(MSG_PRESENT_FORM);
break;
}
if (Options.tutorial_left)
@@ -1253,8 +1252,7 @@ void process_command( command_type cmd )
case CMD_FIRE:
if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
{
- mpr("You can't fire anything in your present form!");
- flush_input_buffer( FLUSH_ON_FAILURE );
+ canned_msg(MSG_PRESENT_FORM);
break;
}
if (Options.tutorial_left)
@@ -1278,8 +1276,7 @@ void process_command( command_type cmd )
case CMD_REMOVE_JEWELLERY:
if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
{
- mpr("You can't do that in your present form!");
- flush_input_buffer( FLUSH_ON_FAILURE );
+ canned_msg(MSG_PRESENT_FORM);
break;
}
remove_ring();
@@ -1288,8 +1285,7 @@ void process_command( command_type cmd )
case CMD_WEAR_JEWELLERY:
if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
{
- mpr("You can't do that in your present form!");
- flush_input_buffer( FLUSH_ON_FAILURE );
+ canned_msg(MSG_PRESENT_FORM);
break;
}
puton_ring(-1, false);
@@ -1300,11 +1296,21 @@ void process_command( command_type cmd )
break;
case CMD_MEMORISE_SPELL:
+ if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
+ {
+ canned_msg(MSG_PRESENT_FORM);
+ break;
+ }
if (!learn_spell())
flush_input_buffer( FLUSH_ON_FAILURE );
break;
case CMD_ZAP_WAND:
+ if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
+ {
+ canned_msg(MSG_PRESENT_FORM);
+ break;
+ }
zap_wand();
break;
@@ -1346,6 +1352,11 @@ void process_command( command_type cmd )
break;
case CMD_READ:
+ if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
+ {
+ canned_msg(MSG_PRESENT_FORM);
+ break;
+ }
read_scroll();
break;
@@ -1361,21 +1372,19 @@ void process_command( command_type cmd )
break;
case CMD_CAST_SPELL:
- /* randart wpns */
- if (scan_randarts(RAP_PREVENT_SPELLCASTING))
+ if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
{
- mpr("Something interferes with your magic!");
- flush_input_buffer( FLUSH_ON_FAILURE );
+ canned_msg(MSG_PRESENT_FORM);
break;
}
-/*
- if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
+ /* randart wpns */
+ if (scan_randarts(RAP_PREVENT_SPELLCASTING))
{
- mpr("You can't cast spells in your present form!");
+ mpr("Something interferes with your magic!");
flush_input_buffer( FLUSH_ON_FAILURE );
break;
}
-*/
+
if (Options.tutorial_left)
Options.tut_spell_counter++;
if (!cast_a_spell())
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index b910b82f95..d9ed05cb3c 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -469,6 +469,7 @@ enum canned_message_type
MSG_NOTHING_HAPPENS,
MSG_YOU_RESIST,
MSG_TOO_BERSERK,
+ MSG_PRESENT_FORM,
MSG_NOTHING_CARRIED,
MSG_CANNOT_DO_YET,
MSG_OK,
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc
index d2d5e1750a..3287040fec 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -617,7 +617,7 @@ void eat_from_inventory(int which_inventory_slot)
if (!vampire_consume_corpse(mons_type, mass, chunk_type, rotten))
return;
- if (!mons_skeleton( mons_type ))
+ if (!mons_skeleton( mons_type ) || one_chance_in(4))
{
dec_inv_item_quantity( which_inventory_slot, 1 );
}
@@ -662,7 +662,7 @@ void eat_floor_item(int item_link)
if (!vampire_consume_corpse(mons_type, mass, chunk_type, rotten))
return;
- if (!mons_skeleton( mons_type ))
+ if (!mons_skeleton( mons_type ) || one_chance_in(4))
{
dec_mitm_item_quantity( item_link, 1 );
}
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 980723139a..75e6ec034e 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -2919,6 +2919,12 @@ void drink(void)
return;
}
+ if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
+ {
+ canned_msg(MSG_PRESENT_FORM);
+ return;
+ }
+
item_slot = prompt_invent_item( "Drink which item?",
MT_INVLIST, OBJ_POTIONS,
true, true, true, 0, NULL,
diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc
index e1f65a78e6..747d97007e 100644
--- a/crawl-ref/source/mutation.cc
+++ b/crawl-ref/source/mutation.cc
@@ -1424,11 +1424,7 @@ bool mutate(mutation_type which_mutation, bool failMsg, bool force_mutation,
return false;
}
- if (mutat == MUT_HERBIVOROUS && you.species == SP_VAMPIRE)
- return false;
-
- if (mutat == MUT_FANGS
- && (you.species == SP_VAMPIRE || you.species == SP_KENKU))
+ if (mutat == MUT_FANGS && you.species == SP_KENKU)
{
return false;
}
@@ -2370,7 +2366,7 @@ bool give_cosmetic_mutation()
how_much = 1;
}
- if (you.species != SP_VAMPIRE && one_chance_in(5))
+ if (one_chance_in(5))
{
mutation = MUT_FANGS;
how_much = 1 + random2(3);
diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc
index ce8f822ef6..19ab9ebfd1 100644
--- a/crawl-ref/source/stuff.cc
+++ b/crawl-ref/source/stuff.cc
@@ -617,6 +617,9 @@ void canned_msg(canned_message_type which_message)
case MSG_TOO_BERSERK:
mpr("You are too berserk!");
break;
+ case MSG_PRESENT_FORM:
+ mpr("You can't do that in your present form.");
+ break;
case MSG_NOTHING_CARRIED:
mpr("You aren't carrying anything.");
break;