Skip to content

Commit a2c9b19

Browse files
committed
1 parent 2e51884 commit a2c9b19

6 files changed

Lines changed: 84 additions & 57 deletions

File tree

data/text/english/dialog/containr.msg

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -254,40 +254,37 @@
254254

255255
# Player uses an item on the door
256256
{176}{}{You bust the lock off the container.}
257-
{177}{}{You strain your back while trying to bust the lock and
258-
take a point of damage.}
257+
{177}{}{You strain your back while trying to bust the lock off and take a point of damage.}
259258

260259
# The following set of lines is to be translated as:
261-
# You strain your back while trying to bust the lock and
260+
# You strain your back while trying to bust the lock off and
262261
# take [x] points of damage.
263262

264-
{178}{}{You strain your back while trying to bust the lock and
263+
{178}{}{You strain your back while trying to bust the lock off and
265264
take }
266265
{179}{}{ points of damage.}
267-
{180}{}{You are too weak to bust the lock.}
266+
{180}{}{You are too weak to bust the lock off.}
268267

269268
# NPC uses an item on the door
270269
# The following lines are prepended by the NPC's name
271270
{181}{}{ busts the lock off the container.}
272-
{182}{}{ strains his back while trying to bust the lock and takes
273-
a point of damage.}
271+
{182}{}{ strains his back while trying to bust the lock off and takes a point of damage.}
274272

275273
# The following line set of lines is to be translated as:
276-
# NPC strains his back while trying to bust the lock and
274+
# NPC strains his back while trying to bust the lock off and
277275
# takes [x] points of damage
278276

279-
{183}{}{ strains his back while trying to bust the lock and takes }
277+
{183}{}{ strains his back while trying to bust the lock off and takes }
280278
{184}{}{ points of damage.}
281279

282280
{185}{}{ is too weak to bust the lock.}
283-
{186}{}{ strains her back while trying to bust the lock and takes
284-
a point of damage.}
281+
{186}{}{ strains her back while trying to bust the lock off and takes a point of damage.}
285282

286283
# The following line set of lines is to be translated as:
287-
# NPC strains her back while trying to bust the lock and
284+
# NPC strains her back while trying to bust the lock off and
288285
# takes [x] points of damage
289286

290-
{187}{}{ strains her back while trying to bust the lock and takes }
287+
{187}{}{ strains her back while trying to bust the lock off and takes }
291288
{188}{}{ points of damage.}
292289

293290
{601}{}{It is open, dummy.}

data/text/english/dialog/door.msg

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -252,40 +252,36 @@
252252

253253
# Player uses an item on the door
254254
{176}{}{You bust the lock off the door.}
255-
{177}{}{You strain your back while trying to bust the lock and
256-
take a point of damage.}
255+
{177}{}{You strain your back while trying to bust the lock off and take a point of damage.}
257256

258257
# The following set of lines is to be translated as:
259-
# You strain your back while trying to bust the lock and
258+
# You strain your back while trying to bust the lock off and
260259
# take [x] points of damage.
261260

262-
{178}{}{You strain your back while trying to bust the lock and
263-
take }
261+
{178}{}{You strain your back while trying to bust the lock off and take }
264262
{179}{}{ points of damage.}
265-
{180}{}{You are too weak to bust the lock.}
263+
{180}{}{You are too weak to bust the lock off.}
266264

267265
# NPC uses an item on the door
268266
# The following lines are prepended by the NPC's name
269267
{181}{}{ busts the lock off the door.}
270-
{182}{}{ strains his back while trying to bust the lock and takes
271-
a point of damage.}
268+
{182}{}{ strains his back while trying to bust the lock off and takes a point of damage.}
272269

273270
# The following line set of lines is to be translated as:
274-
# NPC strains his back while trying to bust the lock and
271+
# NPC strains his back while trying to bust the lock off and
275272
# takes [x] points of damage
276273

277-
{183}{}{ strains his back while trying to bust the lock and takes }
274+
{183}{}{ strains his back while trying to bust the lock off and takes }
278275
{184}{}{ points of damage.}
279276

280277
{185}{}{ is too weak to bust the lock.}
281-
{186}{}{ strains her back while trying to bust the lock and takes
282-
a point of damage.}
278+
{186}{}{ strains her back while trying to bust the lock off and takes a point of damage.}
283279

284280
# The following line set of lines is to be translated as:
285-
# NPC strains her back while trying to bust the lock and
281+
# NPC strains her back while trying to bust the lock off and
286282
# takes [x] points of damage
287283

288-
{187}{}{ strains her back while trying to bust the lock and takes }
284+
{187}{}{ strains her back while trying to bust the lock off and takes }
289285
{188}{}{ points of damage.}
290286

291287
{601}{}{It is open, dummy.}

scripts_src/generic/ziwoddor.ssl

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @tra door.msg */
12
/*
23
Copyright 1998-2003 Interplay Entertainment Corp. All rights reserved.
34
*/
@@ -21,10 +22,11 @@
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

@@ -84,6 +86,9 @@
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
14281433
end
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+
*/
14361438
procedure 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;
14401442
end
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
14461448
procedure 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;
14531460
end
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

scripts_src/headers/containers.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "scripts.h"
55
#include "define.h"
6+
#include "../sfall/define_extra.h"
67
#ifndef NAME
78
#define NAME SCRIPT_CONTAINR
89
#endif

scripts_src/headers/doors.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include "scripts.h"
77
#include "define.h"
8+
#include "../sfall/define_extra.h"
89
#ifndef NAME
910
#define NAME SCRIPT_DOOR
1011
#endif

scripts_src/headers/doors_containers.h

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @tra door.msg */
2-
// Also used in contaners: containr.msg
2+
// Also used in containers: containr.msg
33

44
#ifndef DOORS_CONTAINERS_H
55
#define DOORS_CONTAINERS_H
@@ -80,6 +80,8 @@
8080
#define MAX_DAMAGE (20)
8181
#endif
8282

83+
// 3 and less is just not enough to work the crowbar
84+
#define MIN_STRENGTH 4
8385

8486
/* Standard Script Procedures */
8587
procedure look_at_p_proc;
@@ -235,27 +237,30 @@ was taken, and remove the trap.
235237
end
236238
#endif
237239

238-
/***************************************************************************
239-
This procedure is used should the player try to pry the door open using a
240-
crowbar or some similar instrument.
241-
***************************************************************************/
242-
// For wood doors, Crowbar_Bonus = 0, which means always success
240+
/**
241+
* This procedure is used should the player try to pry the door open using a crowbar or some similar instrument.
242+
*/
243243
procedure roll_pry_success begin
244-
variable rnd = random(1,10);
245-
if rnd <= (get_critter_stat(source_obj,STAT_st) + Crowbar_Bonus) then return true;
244+
variable rnd = random(MIN_STRENGTH, 10);
245+
if (get_critter_stat(source_obj, STAT_st) + Crowbar_Bonus) > rnd then return true;
246246
return false;
247247
end
248248

249-
// Sturdier doors and high strength provide more chance to mangle the crowbar
250-
// Any STR char + wood door = 1% chance to destroy
251-
// 5 STR char + metal door = 10% chance to destroy
252-
// 10 STR char + metal door = 20% chance to destroy
249+
// Sturdier doors and high strength provide higher chance to mangle the crowbar
250+
// 4 STR char + wood door = 1% chance to destroy
251+
// 5 STR char + metal container = 10% chance to destroy
252+
// 10 STR char + metal container = 20% chance to destroy
253253
procedure roll_pry_destroy_crowbar begin
254-
variable rnd = random(1,100);
255-
variable str = get_critter_stat(source_obj,STAT_st);
254+
variable rnd = random(1, 100);
255+
variable str = get_critter_stat(source_obj, STAT_st);
256+
257+
// Too weak to bend it
258+
if str < MIN_STRENGTH then return false;
259+
256260
// Base Crowbar_Bonus = 0 (wood door). For metal doors, default is -2
257261
variable penalty = str * Crowbar_Bonus;
258262
if rnd + penalty <= 1 then return true;
263+
259264
return false;
260265
end
261266

@@ -270,6 +275,16 @@ end
270275
return;
271276
end
272277

278+
/** True if I am a container, False otherwise (door) */
279+
variable is_container = false;
280+
if (obj_type(self_obj) == OBJ_TYPE_ITEM) and (obj_item_subtype(self_obj) == item_type_container) then begin
281+
is_container = true;
282+
end
283+
// No prying open metal doors
284+
if (DOOR_STATUS == STATE_METAL) and (not is_container) then begin
285+
display_msg(my_mstr(500));
286+
end
287+
273288
// crowbar destroy runs always, discouraging high STR characters from spamming it
274289
pry_destroy_crowbar = roll_pry_destroy_crowbar();
275290
if pry_destroy_crowbar then begin

0 commit comments

Comments
 (0)