34 lines
981 B
Plaintext
34 lines
981 B
Plaintext
void main()
|
|
{
|
|
object oPC=GetEnteringObject();
|
|
object oNear=GetNearestObjectByTag("TEMPLE_GUARDIAN",oPC,1);
|
|
int nN;
|
|
if (GetIsPC(oPC))
|
|
{ // is PC
|
|
if (oNear==OBJECT_INVALID)
|
|
{ // doors open
|
|
nN=1;
|
|
oNear=GetNearestObjectByTag("TEGODS_PUZ1_DOOR",oPC,nN);
|
|
while(oNear!=OBJECT_INVALID)
|
|
{ // open doors
|
|
AssignCommand(oNear,SetLocked(oNear,FALSE));
|
|
AssignCommand(oNear,ActionOpenDoor(oNear));
|
|
nN++;
|
|
oNear=GetNearestObjectByTag("TEGODS_PUZ1_DOOR",oPC,nN);
|
|
} // open doors
|
|
} // doors open
|
|
else
|
|
{ // doors close
|
|
nN=1;
|
|
oNear=GetNearestObjectByTag("TEGODS_PUZ1_DOOR",oPC,nN);
|
|
while(oNear!=OBJECT_INVALID)
|
|
{ // open doors
|
|
AssignCommand(oNear,ActionCloseDoor(oNear));
|
|
DelayCommand(2.0,AssignCommand(oNear,SetLocked(oNear,TRUE)));
|
|
nN++;
|
|
oNear=GetNearestObjectByTag("TEGODS_PUZ1_DOOR",oPC,nN);
|
|
} // open doors
|
|
} // doors close
|
|
} // is PC
|
|
}
|