diff --git a/scripts_src/arroyo/ailkbox.ssl b/scripts_src/arroyo/ailkbox.ssl index 5e03a3d75..648066294 100644 --- a/scripts_src/arroyo/ailkbox.ssl +++ b/scripts_src/arroyo/ailkbox.ssl @@ -1444,4 +1444,4 @@ end -#include "../headers/doors2.h" +#include "../headers/containers.h" diff --git a/scripts_src/headers/containers.h b/scripts_src/headers/containers.h new file mode 100644 index 000000000..9f4c67b9b --- /dev/null +++ b/scripts_src/headers/containers.h @@ -0,0 +1,26 @@ +/************************************************************************************** + Should the trap go off for any reason by critter influence, then this procedure will + be called to deal damage to the critter, display a message stating how much damage + was taken, and remove the trap. +**************************************************************************************/ + +procedure Damage_Critter begin + variable Trap_Damage; + + Trap_Damage:=random(MIN_DAMAGE,MAX_DAMAGE); + + if (source_obj == dude_obj) then begin + critter_dmg(dude_obj,Trap_Damage,(DMG_explosion BWOR DMG_BYPASS_ARMOR)); +/* display_msg("You set off the trap and were hit for "+Trap_Damage+" points of damage.); */ + display_msg(mstr(166)+Trap_Damage+mstr(167)); + end + + else begin + critter_dmg(source_obj,Trap_Damage,(DMG_explosion BWOR DMG_BYPASS_ARMOR)); +/* display_msg(Critter_Name+" set off the trap was hit for "+Trap_Damage+" points of damage"); */ + display_msg(obj_name(source_obj)+mstr(168)+Trap_Damage+mstr(169)); + end + +/* The trap is now disarmed and should never go off again. */ + set_local_var(LVAR_Trapped, STATE_INACTIVE); +end diff --git a/scripts_src/ncr/sidtbl.ssl b/scripts_src/ncr/sidtbl.ssl index 9917ebd11..a8efecd6e 100644 --- a/scripts_src/ncr/sidtbl.ssl +++ b/scripts_src/ncr/sidtbl.ssl @@ -1466,4 +1466,4 @@ end -#include "../headers/doors2.h" +#include "../headers/containers.h" diff --git a/scripts_src/ncr/silocker.ssl b/scripts_src/ncr/silocker.ssl index 02f4762ff..dfbf4e33e 100644 --- a/scripts_src/ncr/silocker.ssl +++ b/scripts_src/ncr/silocker.ssl @@ -1434,4 +1434,4 @@ end -#include "../headers/doors2.h" +#include "../headers/containers.h" diff --git a/scripts_src/ncr/simbox.ssl b/scripts_src/ncr/simbox.ssl index 3d218cac6..68b9a6fea 100644 --- a/scripts_src/ncr/simbox.ssl +++ b/scripts_src/ncr/simbox.ssl @@ -1426,4 +1426,4 @@ end -#include "../headers/doors2.h" +#include "../headers/containers.h" diff --git a/scripts_src/ncr/siptbox.ssl b/scripts_src/ncr/siptbox.ssl index 0219d2544..d65997c41 100644 --- a/scripts_src/ncr/siptbox.ssl +++ b/scripts_src/ncr/siptbox.ssl @@ -1418,4 +1418,4 @@ end -#include "../headers/doors2.h" +#include "../headers/containers.h" diff --git a/scripts_src/ncr/siptbox2.ssl b/scripts_src/ncr/siptbox2.ssl index 19b237cd7..c958d2c14 100644 --- a/scripts_src/ncr/siptbox2.ssl +++ b/scripts_src/ncr/siptbox2.ssl @@ -1380,4 +1380,4 @@ end -#include "../headers/doors2.h" +#include "../headers/containers.h" diff --git a/scripts_src/ncr/sishelf1.ssl b/scripts_src/ncr/sishelf1.ssl index ed9d50bb4..1b5c8f8a2 100644 --- a/scripts_src/ncr/sishelf1.ssl +++ b/scripts_src/ncr/sishelf1.ssl @@ -1292,4 +1292,4 @@ end -#include "../headers/doors2.h" +#include "../headers/containers.h" diff --git a/scripts_src/ncr/sishelf2.ssl b/scripts_src/ncr/sishelf2.ssl index c494a2dcc..3d075c125 100644 --- a/scripts_src/ncr/sishelf2.ssl +++ b/scripts_src/ncr/sishelf2.ssl @@ -1294,4 +1294,4 @@ end -#include "../headers/doors2.h" +#include "../headers/containers.h" diff --git a/scripts_src/ncr/sishelf3.ssl b/scripts_src/ncr/sishelf3.ssl index ca925c30f..7c25744c7 100644 --- a/scripts_src/ncr/sishelf3.ssl +++ b/scripts_src/ncr/sishelf3.ssl @@ -1282,4 +1282,4 @@ end -#include "../headers/doors2.h" +#include "../headers/containers.h" diff --git a/scripts_src/rndenctr/ecbox.ssl b/scripts_src/rndenctr/ecbox.ssl index c67f3a1cc..acc11a264 100644 --- a/scripts_src/rndenctr/ecbox.ssl +++ b/scripts_src/rndenctr/ecbox.ssl @@ -1509,4 +1509,4 @@ procedure CreateContents begin call CreateZone4; end end -#include "../headers/doors2.h" +#include "../headers/containers.h" diff --git a/scripts_src/sierra/witrpbx1.ssl b/scripts_src/sierra/witrpbx1.ssl index 972f32c08..7f9dc39eb 100644 --- a/scripts_src/sierra/witrpbx1.ssl +++ b/scripts_src/sierra/witrpbx1.ssl @@ -1424,4 +1424,4 @@ procedure Super_Set_Lockpick_Lock begin call Lock_Door; end -#include "../headers/doors2.h" +#include "../headers/containers.h" diff --git a/scripts_src/template/containr.ssl b/scripts_src/template/containr.ssl index bf13adc0d..13850c838 100644 --- a/scripts_src/template/containr.ssl +++ b/scripts_src/template/containr.ssl @@ -1424,4 +1424,4 @@ end -#include "../headers/doors2.h" +#include "../headers/containers.h" diff --git a/scripts_src/vault13/oiftlkr.ssl b/scripts_src/vault13/oiftlkr.ssl index 5f59bcd1d..e112c62f8 100644 --- a/scripts_src/vault13/oiftlkr.ssl +++ b/scripts_src/vault13/oiftlkr.ssl @@ -1424,4 +1424,4 @@ end -#include "../headers/doors2.h" +#include "../headers/containers.h" diff --git a/scripts_src/vault13/oilocker.ssl b/scripts_src/vault13/oilocker.ssl index c86939264..f1ccc00fd 100644 --- a/scripts_src/vault13/oilocker.ssl +++ b/scripts_src/vault13/oilocker.ssl @@ -1426,4 +1426,4 @@ end -#include "../headers/doors2.h" +#include "../headers/containers.h"