summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/traps.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-09 15:04:14 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-09 15:04:14 +0000
commit47fdcd399772f8805e93b76885499b11da454443 (patch)
tree2a6cdc960eb8ff572b50873087eeee8f84a5d258 /crawl-ref/source/traps.cc
parentd9cb0f334db46b516dd51e18ff1615601243452c (diff)
downloadcrawl-ref-47fdcd399772f8805e93b76885499b11da454443.tar.gz
crawl-ref-47fdcd399772f8805e93b76885499b11da454443.zip
Make mechanical traps in Orcish Mines and Elven Halls of
appropriate racial type. I'd prefer it if there was a chance involved but IMHO a given trap should shoot the same (racial) type of ammo, so this is now always the case in these two branches, for all of needle, arrow, bolt, spear and axe traps. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2395 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/traps.cc')
-rw-r--r--crawl-ref/source/traps.cc45
1 files changed, 36 insertions, 9 deletions
diff --git a/crawl-ref/source/traps.cc b/crawl-ref/source/traps.cc
index d0e4d629a4..4de5def889 100644
--- a/crawl-ref/source/traps.cc
+++ b/crawl-ref/source/traps.cc
@@ -285,44 +285,64 @@ void itrap( struct bolt &pbolt, int trapped )
return;
} // end itrap()
-void handle_traps(char trt, int i, bool trap_known)
+void handle_traps(trap_type trt, int i, bool trap_known)
{
struct bolt beam;
+
+ bool branchtype = false;
+ if (trap_category(trt) == DNGN_TRAP_MECHANICAL && trt != TRAP_NET
+ && trt != TRAP_BLADE)
+ {
+ if (you.where_are_you == BRANCH_ORCISH_MINES)
+ {
+ beam.name = "n orcish";
+ branchtype = true;
+ }
+ else if (you.where_are_you == BRANCH_ELVEN_HALLS)
+ {
+ beam.name = "n elven";
+ branchtype = true;
+ }
+ else
+ beam.name = "";
+ }
switch (trt)
{
case TRAP_DART:
- beam.name = " dart";
+ beam.name += " dart";
beam.damage = dice_def( 1, 4 + (you.your_level / 2) );
dart_trap(trap_known, i, beam, false);
break;
case TRAP_NEEDLE:
- beam.name = " needle";
+ beam.name += " needle";
beam.damage = dice_def( 1, 0 );
dart_trap(trap_known, i, beam, true);
break;
case TRAP_ARROW:
- beam.name = "n arrow";
+ beam.name += (branchtype? "" : "n");
+ beam.name += " arrow";
beam.damage = dice_def( 1, 7 + you.your_level );
dart_trap(trap_known, i, beam, false);
break;
case TRAP_BOLT:
- beam.name = " bolt";
+ beam.name += " bolt";
beam.damage = dice_def( 1, 13 + you.your_level );
dart_trap(trap_known, i, beam, false);
break;
case TRAP_SPEAR:
- beam.name = " spear";
+ beam.name += " spear";
beam.damage = dice_def( 1, 10 + you.your_level );
dart_trap(trap_known, i, beam, false);
break;
case TRAP_AXE:
- beam.name = "n axe";
+ beam.name += (branchtype? "" : "n");
+ beam.name += " axe";
beam.damage = dice_def( 1, 15 + you.your_level );
dart_trap(trap_known, i, beam, false);
break;
@@ -359,7 +379,6 @@ void handle_traps(char trt, int i, bool trap_known)
break;
case TRAP_NET:
-
if (trap_known && one_chance_in(3))
mpr("A net swings high above you.");
else
@@ -757,7 +776,6 @@ bool trap_item(object_class_type base_type, char sub_type,
char beam_x, char beam_y)
{
item_def item;
-
item.base_type = base_type;
item.sub_type = sub_type;
item.plus = 0;
@@ -798,6 +816,15 @@ bool trap_item(object_class_type base_type, char sub_type,
}
} // end of if igrd != NON_ITEM
+ // give appropriate racial flag for Orcish Mines and Elven Halls
+ // should we ever allow properties of dungeon features, we could use that
+ if ( item.sub_type != MI_THROWING_NET )
+ {
+ if (you.where_are_you == BRANCH_ORCISH_MINES)
+ set_equip_race( item, ISFLAG_ORCISH );
+ else if (you.where_are_you == BRANCH_ELVEN_HALLS)
+ set_equip_race( item, ISFLAG_ELVEN );
+ }
return (!copy_item_to_grid( item, beam_x, beam_y, 1 ));
} // end trap_item()