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

class BuildRoad extends DungeonAbstractChangeZoneTypeAction {
    function __construct() {
        parent::__construct(DungeonConstante::$ACTION_BUILD_ROAD, 
        	DungeonConstante::$ZONE_TYPE_ROAD, 
        	DungeonConstante::$ACTION_BUILD_ROAD_COST);
    }
    
    public function getCost() {
        if($this->zone->zoneType == Constante::$ZONE_TYPE_PLAIN) {
        	return parent::getCost();
        } else {
    		return parent::getCost() + DungeonConstante::$ACTION_DIG_COST;
        }
    }
    
    public function isOkToChange($locBlock, $locZone) {
        $locManageAction = ManageAction::getInstance();
        $locPlayer = $locManageAction->getPlayer();

        if($locZone->zoneType == Constante::$ZONE_TYPE_PLAIN
        	|| $locZone->zoneType == DungeonConstante::$ZONE_TYPE_ROCK) {
        	return parent::isOkToChange($locBlock, $locZone);
        } else {
            $locManageAction->addPlayerInfo("Target zone is not plain or rock");
        }
        return false;
    }
}
?>
Return current item: PhpBlock