summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-11 20:36:46 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-11 20:36:46 +0000
commitf5ce15870a0d4ae042a704065df4d0cdbbda0506 (patch)
tree3b8b31a38729b64be106930df581aef7197c6202
parent50a255f8eaad1124e731f6fb1de417baaa133a80 (diff)
downloadcrawl-ref-f5ce15870a0d4ae042a704065df4d0cdbbda0506.tar.gz
crawl-ref-f5ce15870a0d4ae042a704065df4d0cdbbda0506.zip
Fix [2586695]: you can no longer throw items (including via Portal
Projectile) if you can't wield weapons. Don't allow base-shape breath attacks when shapechanged, except for Nagas in spider form. Fix [2589913]: melded shields counted for heavy armour penalties. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9026 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/abl-show.cc47
-rw-r--r--crawl-ref/source/describe.cc2
-rw-r--r--crawl-ref/source/item_use.cc11
-rw-r--r--crawl-ref/source/religion.cc28
-rw-r--r--crawl-ref/source/transfor.cc44
5 files changed, 66 insertions, 66 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc
index 9924f8b957..927eb987ed 100644
--- a/crawl-ref/source/abl-show.cc
+++ b/crawl-ref/source/abl-show.cc
@@ -2089,31 +2089,37 @@ std::vector<talent> your_talents( bool check_confused )
if (you.species == SP_MUMMY && you.experience_level >= 13)
_add_talent(talents, ABIL_MUMMY_RESTORATION, check_confused);
- if (you.species == SP_NAGA)
+ // Spit Poison. Nontransformed nagas can upgrade to Breathe Poison.
+ // Transformed nagas, or non-nagas, can only get Spit Poison.
+ if (you.species == SP_NAGA
+ && (!transform_changed_physiology()
+ || you.attribute[ATTR_TRANSFORMATION] == TRAN_SPIDER))
{
_add_talent(talents, player_mutation_level(MUT_BREATHE_POISON) ?
ABIL_BREATHE_POISON : ABIL_SPIT_POISON, check_confused);
}
- else if (player_mutation_level(MUT_SPIT_POISON))
- _add_talent(talents, ABIL_SPIT_POISON, check_confused );
+ else if (player_mutation_level(MUT_SPIT_POISON)
+ || player_mutation_level(MUT_BREATHE_POISON))
+ {
+ _add_talent(talents, ABIL_SPIT_POISON, check_confused);
+ }
- if (player_genus(GENPC_DRACONIAN))
+ if (player_genus(GENPC_DRACONIAN)
+ && you.experience_level >= 7
+ && !transform_changed_physiology())
{
- if (you.experience_level >= 7)
- {
- const ability_type ability = (
- (you.species == SP_GREEN_DRACONIAN) ? ABIL_BREATHE_POISON :
- (you.species == SP_RED_DRACONIAN) ? ABIL_BREATHE_FIRE :
- (you.species == SP_WHITE_DRACONIAN) ? ABIL_BREATHE_FROST :
- (you.species == SP_YELLOW_DRACONIAN) ? ABIL_SPIT_ACID :
- (you.species == SP_BLACK_DRACONIAN) ? ABIL_BREATHE_LIGHTNING :
- (you.species == SP_PURPLE_DRACONIAN) ? ABIL_BREATHE_POWER :
- (you.species == SP_PALE_DRACONIAN) ? ABIL_BREATHE_STEAM :
- (you.species == SP_MOTTLED_DRACONIAN)? ABIL_BREATHE_STICKY_FLAME
- : ABIL_NON_ABILITY);
- if (ability != ABIL_NON_ABILITY)
- _add_talent(talents, ability, check_confused );
- }
+ const ability_type ability = (
+ (you.species == SP_GREEN_DRACONIAN) ? ABIL_BREATHE_POISON :
+ (you.species == SP_RED_DRACONIAN) ? ABIL_BREATHE_FIRE :
+ (you.species == SP_WHITE_DRACONIAN) ? ABIL_BREATHE_FROST :
+ (you.species == SP_YELLOW_DRACONIAN) ? ABIL_SPIT_ACID :
+ (you.species == SP_BLACK_DRACONIAN) ? ABIL_BREATHE_LIGHTNING :
+ (you.species == SP_PURPLE_DRACONIAN) ? ABIL_BREATHE_POWER :
+ (you.species == SP_PALE_DRACONIAN) ? ABIL_BREATHE_STEAM :
+ (you.species == SP_MOTTLED_DRACONIAN)? ABIL_BREATHE_STICKY_FLAME
+ : ABIL_NON_ABILITY);
+ if (ability != ABIL_NON_ABILITY)
+ _add_talent(talents, ability, check_confused );
}
if (you.species == SP_VAMPIRE && you.experience_level >= 3
@@ -2123,7 +2129,7 @@ std::vector<talent> your_talents( bool check_confused )
_add_talent(talents, ABIL_TRAN_BAT, check_confused );
}
- if (!player_is_airborne())
+ if (!player_is_airborne() && !transform_changed_physiology())
{
// Kenku can fly, but only from the ground
// (until level 15, when it becomes permanent until revoked).
@@ -2247,7 +2253,6 @@ std::vector<talent> your_talents( bool check_confused )
_add_talent(talents, ABIL_EVOKE_TURN_INVISIBLE, check_confused );
}
- // jmf: "upgrade" for draconians -- expensive flight
// Note: This ability only applies to this counter.
if (player_equip( EQ_RINGS, RING_LEVITATION )
|| player_equip_ego_type( EQ_BOOTS, SPARM_LEVITATION )
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index 8b99c28409..ba24dcbc12 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -595,7 +595,7 @@ const char *trap_name(trap_type trap)
ASSERT(NUM_TRAPS == sizeof(trap_names) / sizeof(*trap_names));
if (trap >= TRAP_DART && trap < NUM_TRAPS)
- return trap_names[ static_cast<int>( trap ) ];
+ return trap_names[trap];
return (NULL);
}
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index f6bbc3fe26..f813fc121d 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -1475,7 +1475,16 @@ static bool _fire_validate_item(int slot, std::string &err)
// Returns true if warning is given.
static bool _fire_warn_if_impossible()
{
- if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
+ // FIXME: merge this into transform_can_equip_slot()
+ const int trans = you.attribute[ATTR_TRANSFORMATION];
+ // If you can't wield it, you can't throw it.
+ if (trans == TRAN_SPIDER
+ || trans == TRAN_BLADE_HANDS
+ || trans == TRAN_ICE_BEAST
+ || trans == TRAN_DRAGON
+ || trans == TRAN_SERPENT_OF_HELL
+ || trans == TRAN_AIR
+ || trans == TRAN_BAT)
{
canned_msg(MSG_PRESENT_FORM);
return (true);
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 6340d9f08e..d5c00d9f68 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -6635,8 +6635,7 @@ void god_pitch(god_type which_god)
learned_something_new(TUT_CONVERT);
}
-bool god_hates_your_god(god_type god,
- god_type your_god)
+bool god_hates_your_god(god_type god, god_type your_god)
{
ASSERT(god != your_god);
@@ -6651,8 +6650,7 @@ bool god_hates_your_god(god_type god,
return (is_evil_god(your_god));
}
-std::string god_hates_your_god_reaction(god_type god,
- god_type your_god)
+std::string god_hates_your_god_reaction(god_type god, god_type your_god)
{
if (god_hates_your_god(god, your_god))
{
@@ -6767,26 +6765,21 @@ static void _god_smites_you(god_type god, const char *message,
else
{
if (death_type == NUM_KILLBY)
+ {
switch (god)
{
- case GOD_BEOGH:
- death_type = KILLED_BY_BEOGH_SMITING;
- break;
- case GOD_SHINING_ONE:
- death_type = KILLED_BY_TSO_SMITING;
- break;
- default:
- death_type = KILLED_BY_DIVINE_WRATH;
- break;
+ case GOD_BEOGH: death_type = KILLED_BY_BEOGH_SMITING; break;
+ case GOD_SHINING_ONE: death_type = KILLED_BY_TSO_SMITING; break;
+ default: death_type = KILLED_BY_DIVINE_WRATH; break;
}
+ }
std::string aux;
if (death_type != KILLED_BY_BEOGH_SMITING
&& death_type != KILLED_BY_TSO_SMITING)
{
- aux = "smote by ";
- aux += god_name(god);
+ aux = "smote by " + god_name(god);
}
// If there's a message, display it before smiting.
@@ -6814,7 +6807,7 @@ void offer_corpse(int corpse)
// ritual sacrifice can also bloodify the ground
const int mons_class = mitm[corpse].plus;
- const int max_chunks = mons_weight( mons_class ) / 150;
+ const int max_chunks = mons_weight(mons_class) / 150;
bleed_onto_floor(you.pos(), mons_class, max_chunks, true);
destroy_item(corpse);
}
@@ -6957,8 +6950,7 @@ void handle_god_time()
// yet another wrapper for mpr() {dlb}:
void simple_god_message(const char *event, god_type which_deity)
{
- std::string msg = god_name(which_deity);
- msg += event;
+ std::string msg = god_name(which_deity) + event;
msg = apostrophise_fixup(msg);
god_speaks(which_deity, msg.c_str());
}
diff --git a/crawl-ref/source/transfor.cc b/crawl-ref/source/transfor.cc
index dda95d8e45..331d11c0b9 100644
--- a/crawl-ref/source/transfor.cc
+++ b/crawl-ref/source/transfor.cc
@@ -294,7 +294,8 @@ bool check_transformation_stat_loss(const std::set<equipment_type> &remove,
if (you.duration[DUR_MIGHT])
prop_str += 5;
- if (prop_str >= you.strength || prop_int >= you.intel
+ if (prop_str >= you.strength
+ || prop_int >= you.intel
|| prop_dex >= you.dex)
{
if (!quiet)
@@ -313,41 +314,33 @@ bool check_transformation_stat_loss(const std::set<equipment_type> &remove,
if (you.equip[e] == -1)
continue;
+ const item_def& item = you.inv[you.equip[e]];
+
// Wielding a stat-boosting non-weapon/non-staff won't hinder
// transformations.
- if (e == EQ_WEAPON)
+ if (e == EQ_WEAPON
+ && item.base_type != OBJ_WEAPONS && item.base_type != OBJ_STAVES)
{
- const item_def item = you.inv[ you.equip[e] ];
- if (item.base_type != OBJ_WEAPONS && item.base_type != OBJ_STAVES)
- continue;
+ continue;
}
- item_def item = you.inv[you.equip[e]];
+ // Currently, the only nonartefacts which have stat-changing
+ // effects are rings.
if (item.base_type == OBJ_JEWELLERY)
{
- if (!item_ident( item, ISFLAG_KNOW_PLUSES ))
+ if (!item_ident(item, ISFLAG_KNOW_PLUSES))
continue;
switch (item.sub_type)
{
- case RING_STRENGTH:
- if (item.plus != 0)
- prop_str += item.plus;
- break;
- case RING_DEXTERITY:
- if (item.plus != 0)
- prop_dex += item.plus;
- break;
- case RING_INTELLIGENCE:
- if (item.plus != 0)
- prop_int += item.plus;
- break;
- default:
- break;
+ case RING_STRENGTH: prop_str += item.plus; break;
+ case RING_DEXTERITY: prop_dex += item.plus; break;
+ case RING_INTELLIGENCE: prop_int += item.plus; break;
+ default: break;
}
}
- if (is_random_artefact( item ))
+ if (is_random_artefact(item))
{
prop_str += randart_known_wpn_property(item, RAP_STRENGTH);
prop_int += randart_known_wpn_property(item, RAP_INTELLIGENCE);
@@ -358,7 +351,8 @@ bool check_transformation_stat_loss(const std::set<equipment_type> &remove,
// out while worn, if at any point in the order of checking this list
// (which is the same order as when removing items) one of your stats
// would reach 0, return true.
- if (prop_str >= you.strength || prop_int >= you.intel
+ if (prop_str >= you.strength
+ || prop_int >= you.intel
|| prop_dex >= you.dex)
{
if (!quiet)
@@ -838,8 +832,8 @@ void untransform(void)
default_rem + ARRAYSZ(default_rem));
_init_equipment_removal(melded, old_form);
- you.attribute[ ATTR_TRANSFORMATION ] = TRAN_NONE;
- you.duration[ DUR_TRANSFORMATION ] = 0;
+ you.attribute[ATTR_TRANSFORMATION] = TRAN_NONE;
+ you.duration[DUR_TRANSFORMATION] = 0;
int hp_downscale = 10;