diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-10-01 17:44:09 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-10-01 17:44:09 +0000 |
commit | bb183e9257bd99caeab9776b3579acf68cb203b1 (patch) | |
tree | ca8904e3d8db4aa6db1991b0ffebdb5d932ea6fe /crawl-ref/source/acr.cc | |
parent | e32c3272ea58ddf7bf596bbf0ec5c62ec6c42018 (diff) | |
download | crawl-ref-bb183e9257bd99caeab9776b3579acf68cb203b1.tar.gz crawl-ref-bb183e9257bd99caeab9776b3579acf68cb203b1.zip |
Reworked traps: much much cleaner now. There might be bugs, though.
Traps now remember how much ammo they have. The ammo quantities
(from David) are rather tentative.
Breaks savefiles.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7076 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/acr.cc')
-rw-r--r-- | crawl-ref/source/acr.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index e3629e580a..2a4b67a373 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -1697,10 +1697,9 @@ static void _go_upstairs() static void _go_downstairs() { - bool shaft = (trap_type_at_xy(you.pos()) == TRAP_SHAFT + bool shaft = (get_trap_type(you.pos()) == TRAP_SHAFT && grd(you.pos()) != DNGN_UNDISCOVERED_TRAP); - if (_stairs_check_beheld()) return; @@ -3021,7 +3020,7 @@ static void _check_shafts() { for (int i = 0; i < MAX_TRAPS; i++) { - trap_struct &trap = env.trap[i]; + trap_def &trap = env.trap[i]; if (trap.type != TRAP_SHAFT) continue; @@ -3512,8 +3511,7 @@ static void _open_door(coord_def move, bool check_confused) return; } - if (grd(doorpos) >= DNGN_TRAP_MECHANICAL - && grd(doorpos) <= DNGN_TRAP_NATURAL) + if (find_trap(doorpos) && grd(doorpos) != DNGN_UNDISCOVERED_TRAP) { if (env.cgrid(doorpos) != EMPTY_CLOUD) { @@ -3521,7 +3519,7 @@ static void _open_door(coord_def move, bool check_confused) return; } - disarm_trap(door_move); + disarm_trap(doorpos); return; } } |