Find
You are looking at a card slot next to the door
Created by
Chaotic Bob
, last updated 01 Jul 2009
Code
if target of use then bywho;
##bywho:
find $loc, level 2 security clearance keycard;
if $init_obj = $found_id's host then checkstatus else nexty;
##nexty:
find $loc, level 3 security clearance keycard;
if $init_obj = $found_id's host then checkstatus2 else nexty2;
##nexty2:
find $loc, level 4 security clearance keycard;
if $init_obj = $found_id's host then checkstatus3 else end;
##checkstatus:
$keyish = $found_id;
if $keyish's slot3 = "level 2" then doorstatus else end;
##checkstatus2:
$keyish = $found_id;
if $keyish's slot3 = "level 3" then doorstatus else end;
##checkstatus3:
$keyish = $found_id;
if $keyish's slot3 = "level 4" then doorstatus else end;
##doorstatus:
find $loc, thick metal door;
$doory = $found_id;
if $doory's slot3 = "locked" then undoit else doit;
##doit:
$linkedobj = $doory's link;
set $doory's link to "";
set $doory's extra = "which is locked";
set $doory's slot3 = "locked";
relook $loc;
print "[$doory] locks itself securely!";
runsub locktight;
##locktight:
set $linkedobj's link to $linkedobj;
set $linkedobj's extra = "which is locked";
set $linkedobj's slot3 = "locked";
$loc = $linkedobj's loc;
say 'locks',"Someone has locked [$linkedobj]";
relook $loc;
print "[$linkedobj] locks itself securely!";
##undoit:
set $doory's link to 62412;
$linkeddoor = 62412;
set $doory's extra = "";
set $doory's slot3 = "";
print "The heavy locks on [$doory] disengage!";
relook $loc;
runsub unlockall;
##unlockall:
set $linkeddoor's link to $doory;
set $linkeddoor's extra = "";
set $linkeddoor's slot3 = "";
$loc = $found_id's loc;
say 'locks',"Someone has unlocked [$linkeddoor]";
relook $loc;
print "The heavy locks on [$linkeddoor] disengage!";