Модуль:Песочница/Facenapalm
Перейти к навигации
Перейти к поиску
Элемент | Результат | Прежний вид |
---|---|---|
Песочница Викиданных d:Q4115189 |
|
25 марта 2021[1] и 28 апреля 2022[1] |
StarCraft II: Heart of the Swarm d:Q1207938 |
|
12 марта 2013 |
Starfield d:Q55286432 |
|
1 сентября 2023[2] и 6 сентября 2023[3][4] |
Dorfromantik d:Q106235199 |
|
25 марта 2021, 28 апреля 2022[5] и 29 сентября 2022 |
Horizon Zero Dawn d:Q20155528 |
|
28 февраля 2017, 1 марта 2017 и 7 августа 2020 |
Among Us d:Q96417649 |
|
15 июня 2018[6][7][…], 18 июня 2018, 17 августа 2018[8], 16 ноября 2018[9][10][…], 15 декабря 2020[11][12][…], 14 декабря 2021[13][14][…], 14 декабря 2021[15][16][…] и 18 декабря 2020[6] |
Baldur’s Gate II: Shadows of Amn d:Q804859 |
|
24 сентября 2000, 29 сентября 2000, 22 сентября 2000[17], 1 декабря 2000, сентябрь 2001, 15 октября 2001[18] и 24 сентября 2001[19] |
Примечания
[править код]- ↑ 1 2 Steam — 2003.
- ↑ https://www.pcgamer.com/starfield-early-access/
- ↑ https://www.gematsu.com/2023/03/starfield-delayed-to-september-6-starfield-direct-set-for-june-11
- ↑ Yang G. Starfield Delayed Again, Launches in September (англ.): The game is officially coming out this year // (unknown type) — San Francisco: 2023.
- ↑ Steam — 2003.
- ↑ 1 2 https://www.epicgames.com/store/en-US/p/among-us
- ↑ https://innersloth.itch.io/among-us
- ↑ https://tcrf.net/Among_Us (англ.) // The Cutting Room Floor — 2020.
- ↑ https://store.steampowered.com/app/945360/Among_Us/
- ↑ https://www.commonsensemedia.org/game-reviews/among-us
- ↑ http://web.archive.org/web/20210405232356/https://twitter.com/nintendoamerica/status/1338896136669700096 (англ.) — Nintendo of America, 2020.
- ↑ http://web.archive.org/web/20210410165742/https://www.nintendo.com/games/detail/among-us-switch/ (англ.)
- ↑ Tran V. Grab your crew – Among Us drops on PS4 and PS5 this year (англ.) — 2021.
- ↑ https://www.theverge.com/2021/10/21/22738583/among-us-xbox-playstation-game-pass-release-date
- ↑ Franzese T. EVERYTHING YOU NEED TO KNOW ABOUT AMONG US FOR XBOX SERIES X (англ.) — 2020.
- ↑ Good O. Among Us comes to Xbox in 2021 (англ.) — 2020.
- ↑ IGN (мн.) — Сан-Франциско: 1996.
- ↑ Inside Mac Games
- ↑ AllGame (англ.) — 1998.
local arguments = require( 'Module:Arguments' )
local mwlang = mw.getLanguage( 'ru' )
local p = {}
local platform_aliases = {
Q1406 = 'Windows',
Q172742 = 'NES',
Q183259 = 'SNES',
Q13522376 = 'Mac OS',
Q174666 = ''
}
local function format_date( value )
local precision = tonumber( value.precision )
if value.precision >= 11 then
return mwlang:formatDate( 'j xg Y', value.time )
end
if value.precision == 10 then
return mwlang:formatDate( 'F Y', value.time )
end
if value.precision == 9 then
return mwlang:formatDate( 'Y', value.time )
end
return nil
end
local function get_platforms( statement )
if not statement.qualifiers or not statement.qualifiers.P400 then
-- no 'platform' qualifiers
return ''
end
local platforms = {}
for _, qualifier in ipairs( statement.qualifiers.P400 ) do
if qualifier.datavalue then
local label
if platform_aliases[qualifier.datavalue.value.id] then
label = platform_aliases[qualifier.datavalue.value.id]
else
label = mw.wikibase.getLabel( qualifier.datavalue.value.id )
end
if label ~= '' then
table.insert( platforms, label )
end
end
end
table.sort( platforms )
return table.concat( platforms, ', ' )
end
local function is_early_access( statement )
if not statement.qualifiers or not statement.qualifiers.P3831 then
-- no 'object has role' qualifiers
return false
end
for _, qualifier in ipairs( statement.qualifiers.P3831 ) do
if qualifier.datavalue and qualifier.datavalue.value.id == 'Q17042291' then
-- object has role == early access
return true
end
end
return false
end
local function render_block( header, rows )
local result
local listtype
if header == '' then
result = ''
listtype = '* '
else
result = '; ' .. header .. '\n'
listtype = ': '
end
for _, data in ipairs(rows) do
result = result .. listtype .. data[2] .. '\n'
end
return result
end
-- Used for sorting array of subarrays using first subarray element as a key.
local function comparer( a, b )
return a[1] < b[1]
end
function p.test( frame )
local args = arguments.getArgs(frame)
local site = mw.wikibase.getEntity( args[1] )
if not site or not site.claims.P577 then
return ''
end
-- Step 1: gather data as a table:
-- 'platform' → { { 'sortkey1', 'datarow1' }, { 'sortkey2', 'datarow2' }, ... }
local data = {}
local data_length = 0
local release_year = nil
for _, statement in ipairs( site.claims.P577 ) do
if statement.rank ~= 'deprecated' then
local value = statement.mainsnak.datavalue.value
local date = format_date( value )
if date then
local sortkey = value.time
local platforms = get_platforms( statement )
local early_access = is_early_access( statement )
local datarow = date
if early_access then
datarow = datarow .. ' <small>(ранний доступ)</small>'
else
local current_year = tonumber( mwlang:formatDate( 'Y', value.time ) )
if not release_year or current_year < release_year then
release_year = current_year
end
end
if data[platforms] then
table.insert( data[platforms], { sortkey, datarow } )
else
data[platforms] = { { sortkey, datarow } }
data_length = data_length + 1
end
end
end
end
-- Step 2: sort data
local data_indices = {}
for platform, datarows in pairs(data) do
table.sort( datarows, comparer )
local sortkey = datarows[1][1] -- earliest release date
if platform == '' then
-- dates with no platform specified should be rendered first tho
sortkey = ''
end
table.insert( data_indices, { sortkey, platform } )
end
table.sort( data_indices, comparer )
-- Step 3: render data
local result = ''
for _, index in pairs(data_indices) do
platform = index[2]
if data_length == 1 then
-- If there's only one block, no need to render the header
result = result .. render_block( '', data[platform] )
else
result = result .. render_block( platform, data[platform] )
end
end
if release_year and (not args.nocat or args.nocat == '') then
result = result .. '[[:Категория:Компьютерные игры ' .. release_year .. ' года]]'
end
return result
end
return p