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

class DigAction extends DungeonAbstractChangeZoneTypeAction {
    function __construct() {
        parent::__construct(DungeonConstante::$ACTION_BLOCK_DIG, Constante::$ZONE_TYPE_PLAIN, DungeonConstante::$ACTION_DIG_COST, true);
    }

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

       	$locDigable = (in_array($locZone->zoneType,
               array(
               		DungeonConstante::$ZONE_TYPE_TREASURE, 
               		DungeonConstante::$ZONE_TYPE_NECROPOLIS,
                       DungeonConstante::$ZONE_TYPE_CITY))
                       && $locZone->gold == 0);
        $locDigable|=in_array($locZone->zoneType,
               array(DungeonConstante::$ZONE_TYPE_ROCK, 
                		DungeonConstante::$ZONE_TYPE_STONE,
                		DungeonConstante::$ZONE_TYPE_DOOR, 
                		DungeonConstante::$ZONE_TYPE_STAIR,
                        DungeonConstante::$ZONE_TYPE_BARRACK,
                        DungeonConstante::$ZONE_TYPE_ROAD));
		if(!$locDigable) {
        	$locManageAction->addPlayerInfo("target zone ".Zone::staticGetTextZoneCoord($locZone->zoneId)." is not digable");
            return false;
        }
        return parent::isOkToChange($locBlock, $locZone);
    }
}
?>
Return current item: PhpBlock