1+ /** @tra door.msg */
12/*
23 Copyright 1998-2003 Interplay Entertainment Corp. All rights reserved.
34*/
2122
2223
2324/* Include Files */
24- #ifndef SCRIPT_REALNAME //kivicdoor includes this file, need to avoid warning
25- #define SCRIPT_REALNAME "ziwoddor"
25+ #ifndef SCRIPT_REALNAME // kivicdoor includes this file, need to avoid warning
26+ #define SCRIPT_REALNAME "ziwoddor"
2627#endif
2728#include "../headers/define.h"
29+ #include "../sfall/define_extra.h"
2830
2931#define NAME SCRIPT_DOOR
3032
8486#define MIN_DAMAGE (10)
8587#define MAX_DAMAGE (20)
8688
89+ // 3 and less is just not enough to work the crowbar
90+ #define MIN_STRENGTH 4
91+
8792/* Experience Points for Skills */
8893#define Lockpick_Exp EXP_LOCKPICK_NEG_20
8994#define Traps_Exp EXP_TRAPS_NORMAL
@@ -1427,28 +1432,30 @@ procedure Lock_Door begin
14271432 end
14281433end
14291434
1430-
1431- /***************************************************************************
1432- This procedure is used should the player try to pry the door open using a
1433- crowbar or some similar instrument.
1434- ***************************************************************************/
1435- // For wood doors, Crowbar_Bonus = 0, which means always success
1435+ /**
1436+ * This procedure is used should the player try to pry the door open using a crowbar or some similar instrument.
1437+ */
14361438procedure roll_pry_success begin
1437- variable rnd = random(1, 10);
1438- if rnd <= (get_critter_stat(source_obj,STAT_st) + Crowbar_Bonus) then return true;
1439+ variable rnd = random(MIN_STRENGTH, 10);
1440+ if (get_critter_stat(source_obj, STAT_st) + Crowbar_Bonus) > rnd then return true;
14391441 return false;
14401442end
14411443
1442- // Sturdier doors and high strength provide more chance to mangle the crowbar
1443- // Any STR char + wood door = 1% chance to destroy
1444- // 5 STR char + metal door = 10% chance to destroy
1445- // 10 STR char + metal door = 20% chance to destroy
1444+ // Sturdier doors and high strength provide higher chance to mangle the crowbar
1445+ // 4 STR char + wood door = 1% chance to destroy
1446+ // 5 STR char + metal container = 10% chance to destroy
1447+ // 10 STR char + metal container = 20% chance to destroy
14461448procedure roll_pry_destroy_crowbar begin
1447- variable rnd = random(1,100);
1448- variable str = get_critter_stat(source_obj,STAT_st);
1449+ variable rnd = random(1, 100);
1450+ variable str = get_critter_stat(source_obj, STAT_st);
1451+
1452+ // Too weak to bend it
1453+ if str < MIN_STRENGTH then return false;
1454+
14491455 // Base Crowbar_Bonus = 0 (wood door). For metal doors, default is -2
14501456 variable penalty = str * Crowbar_Bonus;
14511457 if rnd + penalty <= 1 then return true;
1458+
14521459 return false;
14531460end
14541461
@@ -1462,6 +1469,16 @@ procedure Pry_Door begin
14621469 return;
14631470 end
14641471
1472+ /** True if I am a container, False otherwise (door) */
1473+ variable is_container = false;
1474+ if (obj_type(self_obj) == OBJ_TYPE_ITEM) and (obj_item_subtype(self_obj) == item_type_container) then begin
1475+ is_container = true;
1476+ end
1477+ // No prying open metal doors
1478+ if (DOOR_STATUS == STATE_METAL) and (not is_container) then begin
1479+ display_msg(mstr(500));
1480+ end
1481+
14651482 // crowbar destroy runs always, discouraging high STR characters from spamming it
14661483 pry_destroy_crowbar = roll_pry_destroy_crowbar();
14671484 if pry_destroy_crowbar then begin
0 commit comments