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

class BuildWall extends DungeonAbstractChangeZoneTypeAction {
    function __construct() {
        parent::__construct(DungeonConstante::$ACTION_BUILD_STONE, DungeonConstante::$ZONE_TYPE_STONE, DungeonConstante::$ACTION_BUY_STONE_COST, true);
    }

    public function isOkToChange($locBlock, $locZone) {
        $locManageAction = ManageAction::getInstance();
        $locPlayer = $locManageAction->getPlayer();
    
        if(!(((
        		$locZone->zoneType == Constante::$ZONE_TYPE_PLAIN
        	)
                && !$locZone->isOccuped())
                || ($locZone->zoneType == DungeonConstante::$ZONE_TYPE_STONE)
                || ($locZone->zoneType == DungeonConstante::$ZONE_TYPE_ROCK))) {
            $locManageAction->addPlayerInfo("Target zone is not plain or rock");
            return false;
        }
        
        if($locZone->zoneType == DungeonConstante::$ZONE_TYPE_STONE
        	&& $locZone->getDig() == 0) {
        	$locManageAction->addPlayerInfo("Target zone is already a stone");
        	return false;
        }
        
        return parent::isOkToChange($locBlock, $locZone);
    }
}
?>
Return current item: PhpBlock