Source for file alley.php
Documentation is available at alley.php
* DutchPIPE version 0.4; PHP version 5
* LICENSE: This source file is subject to version 1.0 of the DutchPIPE license.
* If you did not receive a copy of the DutchPIPE license, you can obtain one at
* http://dutchpipe.org/license/1_0.txt or by sending a note to
* license@dutchpipe.org, in which case you will be mailed a copy immediately.
* @subpackage dpuniverse_page
* @author Lennert Stock <ls@dutchpipe.org>
* @copyright 2006, 2007 Lennert Stock
* @license http://dutchpipe.org/license/1_0.txt DutchPIPE License
* @version Subversion: $Id: alley.php 278 2007-08-19 22:52:25Z ls $
* @link http://dutchpipe.org/manual/package/DutchPIPE
* Builts upon the standard DpPage class
* @subpackage dpuniverse_page
* @author Lennert Stock <ls@dutchpipe.org>
* @copyright 2006, 2007 Lennert Stock
* @license http://dutchpipe.org/license/1_0.txt DutchPIPE License
* @version Release: 0.2.1
* @link http://dutchpipe.org/manual/package/DutchPIPE
* Sets up the page at object creation time
$this->title = dp_text('In Front Of A House');
dp_text('A simple door. It is %s.'), 'getDoorStatusStr',
$this->setMapArea('alley_map', 'door_area', 'rect', '142,223,196,274');
array('alley_map', 'square_area', 'rect', '25,311,400,336'));
$this->isDoorUnlocked = FALSE;
* Called at regular intervals
if ($this->isDoorUnlocked) {
$this->isDoorUnlocked = FALSE;
if (!$this->isDoorUnlocked) {
$user->tell(dp_text("The door of the house is locked.<br />"));
$this->houseObj->setIsDoorUnlocked($isDoorUnlocked, FALSE);
. 'alley.jpg" width="450" height="336" border="0"
usemap="#alley_map" style="border: solid 1px black; margin-right: 10px""
title="" alt="" align="left" /><div style="width: 220px; float: left"><br /><b>'
. dp_text('In Front Of A House') . '</b><br /><p align="justify">'
? sprintf(dp_text('The stone paved alley ends here in front of a large brick
house.</p><p align="justify">To the <a href="%s">southwest</a> you see a
: sprintf(dp_text('The stone paved alley ends here in front of a large brick
house.</p><p align="justify">A door leads <a href="%s">inside</a>. To the
<a href="%s">southwest</a> you see a square.'),
. '</p></div><br clear="all" />';
'door_area', dp_text('unlock door'));
dp_text('n#house#enter house#inside#door#enter door')),
'door_area', dp_text('lock door'));
dp_text('n#house#enter house#inside#door#enter door')),
'isExitOpened', 'door_area', dp_text('enter house'));
$this->tell('<changeDpElement id="dppage_body">' . $this->getBody()
&& dp_text('door with silver key') != $noun) {
$this->setActionFailure(dp_text('Unlock what?'));
if (!($key = $user->isPresent(dp_text('silver key')))) {
$user->tell(dp_text("You don't have the right key to unlock the door.<br />"));
if ($this->isDoorUnlocked) {
$user->tell(dp_text('The door is already unlocked.<br />'));
dp_text('You unlock the door with %s. You can now enter the building.<br />'),
dp_text('%s unlocks the door.<br />'),
$this->isDoorUnlocked = TRUE;
&& dp_text('door with silver key') != $noun) {
$this->setActionFailure(dp_text('Lock what?'));
if (!($key = $user->isPresent(dp_text('silver key')))) {
$user->tell(dp_text("You don't have the right key to lock the door.<br />"));
if (!$this->isDoorUnlocked) {
$user->tell(dp_text('The door is already locked.<br />'));
dp_text('%s locks the door.<br />'),
$this->isDoorUnlocked = FALSE;
return $this->isDoorUnlocked ? dp_text('unlocked') : dp_text('locked');
|