/* static */ bool AIGroup::StopAutoReplace(GroupID group_id, EngineID engine_id) { EnforcePrecondition(false, IsValidGroup(group_id) || group_id == GROUP_ALL); return AIObject::DoCommand(0, group_id << 16, (::INVALID_ENGINE << 16) | engine_id, CMD_SET_AUTOREPLACE); }
/* static */ bool ScriptGoal::CloseQuestion(uint16 uniqueid) { EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY); return ScriptObject::DoCommand(0, uniqueid, 0, CMD_GOAL_QUESTION_ANSWER); }
/* static */ bool AITunnel::RemoveTunnel(TileIndex tile) { EnforcePrecondition(false, IsTunnelTile(tile)); return AIObject::DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR); }
/* static */ bool ScriptCompany::SetAutoRenewMoney(Money money) { EnforcePrecondition(false, money >= 0); EnforcePrecondition(false, (int64)money <= UINT32_MAX); return ScriptObject::DoCommand(0, ::GetCompanySettingIndex("company.engine_renew_money"), money, CMD_CHANGE_COMPANY_SETTING); }
/* static */ bool AIMarine::BuildLock(TileIndex tile) { EnforcePrecondition(false, ::IsValidTile(tile)); return AIObject::DoCommand(tile, 0, 0, CMD_BUILD_LOCK); }
/* static */ bool ScriptRoad::BuildOneWayRoadFull(TileIndex start, TileIndex end) { EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); return _BuildRoadInternal(start, end, true, true); }
/* static */ bool ScriptBase::Chance(uint out, uint max) { EnforcePrecondition(false, out <= max); return (uint16)Rand() <= (uint16)((65535 * out) / max); }
/* static */ bool AIVehicle::SendVehicleToDepotForServicing(VehicleID vehicle_id) { EnforcePrecondition(false, IsValidVehicle(vehicle_id)); return AIObject::DoCommand(0, vehicle_id, DEPOT_SERVICE, GetCmdSendToDepot(::Vehicle::Get(vehicle_id))); }
/* static */ bool AIVehicle::StartStopVehicle(VehicleID vehicle_id) { EnforcePrecondition(false, IsValidVehicle(vehicle_id)); return AIObject::DoCommand(0, vehicle_id, 0, CMD_START_STOP_VEHICLE); }
/* static */ bool AITile::PlantTree(TileIndex tile) { EnforcePrecondition(false, ::IsValidTile(tile)); return AIObject::DoCommand(tile, TREE_INVALID, tile, CMD_PLANT_TREE); }
/* static */ bool AIVehicle::RefitVehicle(VehicleID vehicle_id, CargoID cargo) { EnforcePrecondition(false, IsValidVehicle(vehicle_id) && AICargo::IsValidCargo(cargo)); return AIObject::DoCommand(0, vehicle_id, cargo, GetCmdRefitVeh(::Vehicle::Get(vehicle_id))); }
/* static */ bool AITile::DemolishTile(TileIndex tile) { EnforcePrecondition(false, ::IsValidTile(tile)); return AIObject::DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR); }
/* static */ bool AITile::LowerTile(TileIndex tile, int32 slope) { EnforcePrecondition(false, tile < ::MapSize()); return AIObject::DoCommand(tile, slope, 0, CMD_TERRAFORM_LAND); }
/* static */ bool AIMarine::BuildCanal(TileIndex tile) { EnforcePrecondition(false, ::IsValidTile(tile)); return AIObject::DoCommand(tile, tile, WATER_CLASS_CANAL, CMD_BUILD_CANAL); }
/* static */ bool AIGroup::DeleteGroup(GroupID group_id) { EnforcePrecondition(false, IsValidGroup(group_id)); return AIObject::DoCommand(0, group_id, 0, CMD_DELETE_GROUP); }
/* static */ uint32 ScriptStoryPage::GetPageElementSortValue(StoryPageElementID story_page_element_id) { EnforcePrecondition(false, IsValidStoryPageElement(story_page_element_id)); return StoryPageElement::Get(story_page_element_id)->sort_value; }
/* static */ bool AIGroup::EnableAutoReplaceProtection(GroupID group_id, bool enable) { EnforcePrecondition(false, IsValidGroup(group_id)); return AIObject::DoCommand(0, group_id, enable ? 1 : 0, CMD_SET_GROUP_REPLACE_PROTECTION); }
/* static */ bool ScriptBase::Chance(uint out, uint max) { EnforcePrecondition(false, out <= max); return ScriptBase::RandRange(max) < out; }