Location: PHPKode > projects > PhpBlock > A9.8/modules/dungeon/action/buildtreasure.class.php
<?php
include_once $PATH_TO_CODE."/modules/dungeon/action/abstractchangezonetype.class.php";

class BuildTreasure extends DungeonAbstractChangeZoneTypeAction {
    function __construct() {
        parent::__construct(DungeonConstante::$ACTION_BUILD_TREASURE, 
        	DungeonConstante::$ZONE_TYPE_TREASURE, DungeonConstante::$ACTION_BUY_TREASURE_COST, false, false);
    }

    public function isOkToChange($locBlock, $locZone) {
        $locManageAction = ManageAction::getInstance();
        $locPlayer = $locManageAction->getPlayer();

        if($locZone->isSurface()) {
            $locManageAction->addPlayerInfo("Treasure room must begin underground");
        } else {
            return parent::isOkToChange($locBlock, $locZone);
        }
        return false;
    }
}













?>
Return current item: PhpBlock