Skip to content

Commit

Permalink
Add medals (#1255)
Browse files Browse the repository at this point in the history
  • Loading branch information
fetus-hina committed Nov 30, 2023
1 parent a784a64 commit 01faff0
Show file tree
Hide file tree
Showing 14 changed files with 175 additions and 0 deletions.
2 changes: 2 additions & 0 deletions messages/de/medal3.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'#1 Reefslider User' => '1. Platz: Haihammer',
'#1 Score Booster' => '1. Platz: Zähler-Fortschritt',
'#1 Splat Assister' => '1. Platz: Abschuss-Assistenz',
'#1 Splattercolor Screen User' => '1. Platz: Unsichtbarriere',
'#1 Splat Zone Guard' => '1. Platz: Splatterzonen gehalten',
'#1 Splat Zone Hero' => '1. Platz: Splatterzonen-Held',
'#1 Splat Zone Inker' => '1. Platz: Splatterzonen gefärbt',
Expand All @@ -43,6 +44,7 @@
'#1 Tenta Missiles User' => '1. Platz: Schwarmraketen',
'#1 Tower Stopper' => '1. Platz: Turm angehalten',
'#1 Triple Inkstrike User' => '1. Platz: Tri-Tintferno',
'#1 Triple Splashdown User' => '1. Platz: Tri-Tintenschock',
'#1 Trizooka User' => '1. Platz: Trizooka',
'#1 Turf Inker' => '1. Platz: Revier gefärbt',
'#1 Ultra Stamp User' => '1. Platz: Ultra-Stempel',
Expand Down
2 changes: 2 additions & 0 deletions messages/en-GB/medal3.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'#1 Reefslider User' => '#1 Reefslider User',
'#1 Score Booster' => '#1 Score Booster',
'#1 Splat Assister' => '#1 Splat Assister',
'#1 Splattercolor Screen User' => '#1 Splattercolor Screen User',
'#1 Splat Zone Guard' => '#1 Splat Zone Guard',
'#1 Splat Zone Hero' => '#1 Splat Zone Hero',
'#1 Splat Zone Inker' => '#1 Splat Zone Inker',
Expand All @@ -43,6 +44,7 @@
'#1 Tenta Missiles User' => '#1 Tenta Missiles User',
'#1 Tower Stopper' => '#1 Tower Stopper',
'#1 Triple Inkstrike User' => '#1 Triple Inkstrike User',
'#1 Triple Splashdown User' => '#1 Triple Splashdown User',
'#1 Trizooka User' => '#1 Trizooka User',
'#1 Turf Inker' => '#1 Turf Inker',
'#1 Ultra Stamp User' => '#1 Ultra Stamp User',
Expand Down
2 changes: 2 additions & 0 deletions messages/es-MX/medal3.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'#1 Reefslider User' => 'N.º 1 en flotiburón',
'#1 Score Booster' => 'N.º 1 en avanzar el contador',
'#1 Splat Assister' => 'N.º 1 en apoyo en combate',
'#1 Splattercolor Screen User' => 'N.º 1 en muro marmoleado',
'#1 Splat Zone Guard' => 'N.º 1 en defender la zona',
'#1 Splat Zone Hero' => 'N.º 1 en dominar la zona',
'#1 Splat Zone Inker' => 'N.º 1 en entintar la zona',
Expand All @@ -43,6 +44,7 @@
'#1 Tenta Missiles User' => 'N.º 1 en lanzamisiles',
'#1 Tower Stopper' => 'N.º 1 en frenar la torre',
'#1 Triple Inkstrike User' => 'N.º 1 en tornado triple',
'#1 Triple Splashdown User' => 'N.º 1 en clavado triple',
'#1 Trizooka User' => 'N.º 1 en cañón triple',
'#1 Turf Inker' => 'N.º 1 en entintar territorio',
'#1 Ultra Stamp User' => 'N.º 1 en ultraselladora',
Expand Down
2 changes: 2 additions & 0 deletions messages/es/medal3.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'#1 Reefslider User' => 'N.º 1 en flotiburón',
'#1 Score Booster' => 'N.º 1 en aumento de contador',
'#1 Splat Assister' => 'N.º 1 en ayuda',
'#1 Splattercolor Screen User' => 'N.º 1 en pantintalla',
'#1 Splat Zone Guard' => 'N.º 1 en defender territorio',
'#1 Splat Zone Hero' => 'N.º 1 en pintazonas',
'#1 Splat Zone Inker' => 'N.º 1 en ganar territorio',
Expand All @@ -43,6 +44,7 @@
'#1 Tenta Missiles User' => 'N.º 1 en lanzamisiles',
'#1 Tower Stopper' => 'N.º 1 en parar la torre',
'#1 Triple Inkstrike User' => 'N.º 1 en tornado triple',
'#1 Triple Splashdown User' => 'N.º 1 en puñetazos explosivos',
'#1 Trizooka User' => 'N.º 1 en tintazuca triple',
'#1 Turf Inker' => 'N.º 1 en entintar',
'#1 Ultra Stamp User' => 'N.º 1 en ultraselladora',
Expand Down
2 changes: 2 additions & 0 deletions messages/fr-CA/medal3.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'#1 Reefslider User' => '№ 1 du Cavalsquale',
'#1 Score Booster' => '№ 1 en progression',
'#1 Splat Assister' => '№ 1 du coup de main',
'#1 Splattercolor Screen User' => '№ 1 de la barrière barbouillée',
'#1 Splat Zone Guard' => '№ 1 en défense de zone',
'#1 Splat Zone Hero' => '№ 1 en héroïsme de zone',
'#1 Splat Zone Inker' => '№ 1 en encrage de zone',
Expand All @@ -43,6 +44,7 @@
'#1 Tenta Missiles User' => '№ 1 du Multi-missile',
'#1 Tower Stopper' => '№ 1 en arrêt de la plateforme',
'#1 Triple Inkstrike User' => '№ 1 du Trimissile tornade',
'#1 Triple Splashdown User' => '№ 1 du triple choc chromatique',
'#1 Trizooka User' => '№ 1 du Lance-tornades',
'#1 Turf Inker' => '№ 1 en encrage de territoire',
'#1 Ultra Stamp User' => '№ 1 de l\'Ultra-étampeur',
Expand Down
2 changes: 2 additions & 0 deletions messages/fr/medal3.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'#1 Reefslider User' => '№ 1 du cavalsquale',
'#1 Score Booster' => '№ 1 en progression',
'#1 Splat Assister' => '№ 1 du coup de main',
'#1 Splattercolor Screen User' => '№ 1 de la barrière barbouillée',
'#1 Splat Zone Guard' => '№ 1 en Défense de zone',
'#1 Splat Zone Hero' => '№ 1 en héroïsme de zone',
'#1 Splat Zone Inker' => '№ 1 en encrage de zone',
Expand All @@ -43,6 +44,7 @@
'#1 Tenta Missiles User' => '№ 1 du multi-missile',
'#1 Tower Stopper' => '№ 1 en arrêt du stand',
'#1 Triple Inkstrike User' => '№ 1 du trimissile tornade',
'#1 Triple Splashdown User' => '№ 1 du triple choc chromatique',
'#1 Trizooka User' => '№ 1 du lance-rafales',
'#1 Turf Inker' => '№ 1 en encrage de territoire',
'#1 Ultra Stamp User' => '№ 1 de l\'ultra-tamponneur',
Expand Down
2 changes: 2 additions & 0 deletions messages/it/medal3.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'#1 Reefslider User' => 'Motosqualo: asso nº 1',
'#1 Score Booster' => 'Asso della distanza nº 1',
'#1 Splat Assister' => 'Splattassistente nº 1',
'#1 Splattercolor Screen User' => 'Cortina ingannevole: asso nº 1',
'#1 Splat Zone Guard' => 'Guardia zona splat nº 1',
'#1 Splat Zone Hero' => 'Idolo della zona splat nº 1',
'#1 Splat Zone Inker' => 'Attaccante zona splat nº 1',
Expand All @@ -43,6 +44,7 @@
'#1 Tenta Missiles User' => 'Lanciarazzi: asso nº 1',
'#1 Tower Stopper' => 'Fermatorre nº 1',
'#1 Triple Inkstrike User' => 'Triplo tornado: asso nº 1',
'#1 Triple Splashdown User' => 'Triplo vernischianto: asso nº 1',
'#1 Trizooka User' => 'Ultraturbinator: asso nº 1',
'#1 Turf Inker' => 'Inchiostratutto nº 1',
'#1 Ultra Stamp User' => 'Mega timbro: asso nº 1',
Expand Down
2 changes: 2 additions & 0 deletions messages/ja/medal3.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@
'#1 Splat Zone Guard' => 'ガチエリア前線キープ No.1',
'#1 Splat Zone Hero' => 'ガチエリア関与 No.1',
'#1 Splat Zone Inker' => 'ガチエリア塗り No.1',
'#1 Splattercolor Screen User' => 'スミナガシート No.1',
'#1 Super Chump User' => 'デコイチラシ No.1',
'#1 Super Jump Spot' => '味方のジャンプ先 No.1',
'#1 Tacticooler User' => 'エナジースタンド No.1',
'#1 Tenta Missiles User' => 'マルチミサイル No.1',
'#1 Tower Stopper' => 'ガチヤグラブロック No.1',
'#1 Triple Inkstrike User' => 'トリプルトルネード No.1',
'#1 Triple Splashdown User' => 'ウルトラチャクチ No.1',
'#1 Trizooka User' => 'ウルトラショット No.1',
'#1 Turf Inker' => '塗りポイント No.1',
'#1 Ultra Stamp User' => 'ウルトラハンコ No.1',
Expand Down
2 changes: 2 additions & 0 deletions messages/ko/medal3.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'#1 Reefslider User' => '샤크 라이드 No.1',
'#1 Score Booster' => '카운트 진행 No.1',
'#1 Splat Assister' => '어시스트 횟수 No.1',
'#1 Splattercolor Screen User' => '스플래터컬러 스크린 No.1',
'#1 Splat Zone Guard' => '랭크 에어리어 전선 유지 No.1',
'#1 Splat Zone Hero' => '랭크 에어리어 관여 No.1',
'#1 Splat Zone Inker' => '랭크 에어리어 색칠 No.1',
Expand All @@ -43,6 +44,7 @@
'#1 Tenta Missiles User' => '멀티 미사일 No.1',
'#1 Tower Stopper' => '랭크 타워 저지 No.1',
'#1 Triple Inkstrike User' => '트리플 토네이도 No.1',
'#1 Triple Splashdown User' => '울트라 착지 No.1',
'#1 Trizooka User' => '울트라 샷 No.1',
'#1 Turf Inker' => '색칠 포인트 No.1',
'#1 Ultra Stamp User' => '울트라 스탬프 No.1',
Expand Down
2 changes: 2 additions & 0 deletions messages/nl/medal3.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'#1 Reefslider User' => 'Opblaashaai gebruikt: nr. 1',
'#1 Score Booster' => 'Scorebijdrage: nr. 1',
'#1 Splat Assister' => 'Geholpen bij uitschakeling: nr. 1',
'#1 Splattercolor Screen User' => 'PLED-scherm gebruikt: nr. 1',
'#1 Splat Zone Guard' => 'Spetterzone verdedigd: nr. 1',
'#1 Splat Zone Hero' => 'Spetterzonekanjer: nr. 1',
'#1 Splat Zone Inker' => 'Spetterzone geverfd: nr. 1',
Expand All @@ -43,6 +44,7 @@
'#1 Tenta Missiles User' => 'Spetterraketten gebruikt: nr. 1',
'#1 Tower Stopper' => 'Toren verdedigd: nr. 1',
'#1 Triple Inkstrike User' => 'Tri-tornado gebruikt: nr. 1',
'#1 Triple Splashdown User' => 'Ultralanding gebruikt: nr. 1',
'#1 Trizooka User' => 'Trizooka gebruikt: nr. 1',
'#1 Turf Inker' => 'Grond geverfd: nr. 1',
'#1 Ultra Stamp User' => 'Ultrastempel gebruikt: nr. 1',
Expand Down
2 changes: 2 additions & 0 deletions messages/ru/medal3.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'#1 Reefslider User' => 'Мастер мотокулы',
'#1 Score Booster' => 'Башневоз № 1',
'#1 Splat Assister' => 'Плюх-соратник № 1',
'#1 Splattercolor Screen User' => 'Мастер заливного барьера',
'#1 Splat Zone Guard' => 'Защитник зоны контроля № 1',
'#1 Splat Zone Hero' => 'Звезда зоны контроля № 1',
'#1 Splat Zone Inker' => 'Хозяин зоны контроля № 1',
Expand All @@ -43,6 +44,7 @@
'#1 Tenta Missiles User' => 'Мастер каракатницы',
'#1 Tower Stopper' => 'Блокировщик башни № 1',
'#1 Triple Inkstrike User' => 'Мастер тройного торнадо',
'#1 Triple Splashdown User' => 'Мастер тройного мегаплюха',
'#1 Trizooka User' => 'Мастер «Трезубца»',
'#1 Turf Inker' => 'Заливщик № 1',
'#1 Ultra Stamp User' => 'Мастер припечати',
Expand Down
2 changes: 2 additions & 0 deletions messages/zh-CN/medal3.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'#1 Reefslider User' => '鲨鱼坐骑 No.1',
'#1 Score Booster' => '计数推进 No.1',
'#1 Splat Assister' => '助攻数 No.1',
'#1 Splattercolor Screen User' => '浮墨幕墙 No.1',
'#1 Splat Zone Guard' => '真格区域前线把控 No.1',
'#1 Splat Zone Hero' => '真格区域干涉 No.1',
'#1 Splat Zone Inker' => '真格区域涂墨 No.1',
Expand All @@ -43,6 +44,7 @@
'#1 Tenta Missiles User' => '多重导弹 No.1',
'#1 Tower Stopper' => '真格塔楼拦截 No.1',
'#1 Triple Inkstrike User' => '三重龙卷风 No.1',
'#1 Triple Splashdown User' => '终极着陆 No.1',
'#1 Trizooka User' => '终极发射 No.1',
'#1 Turf Inker' => '涂墨点数 No.1',
'#1 Ultra Stamp User' => '终极印章 No.1',
Expand Down
2 changes: 2 additions & 0 deletions messages/zh-TW/medal3.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'#1 Reefslider User' => '鯊魚坐騎 No.1',
'#1 Score Booster' => '計數推進 No.1',
'#1 Splat Assister' => '助攻數 No.1',
'#1 Splattercolor Screen User' => '浮墨幕牆 No.1',
'#1 Splat Zone Guard' => '真格區域前線把控 No.1',
'#1 Splat Zone Hero' => '真格區域干涉 No.1',
'#1 Splat Zone Inker' => '真格區域塗墨 No.1',
Expand All @@ -43,6 +44,7 @@
'#1 Tenta Missiles User' => '多重導彈 No.1',
'#1 Tower Stopper' => '真格塔樓攔截 No.1',
'#1 Triple Inkstrike User' => '三重龍捲風 No.1',
'#1 Triple Splashdown User' => '終極著陸 No.1',
'#1 Trizooka User' => '終極發射 No.1',
'#1 Turf Inker' => '塗墨點數 No.1',
'#1 Ultra Stamp User' => '終極印章 No.1',
Expand Down
149 changes: 149 additions & 0 deletions migrations/m231130_052651_season6_medals.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
<?php

/**
* @copyright Copyright (C) 2015-2023 AIZAWA Hina
* @license https://github.com/fetus-hina/stat.ink/blob/master/LICENSE MIT
* @author AIZAWA Hina <hina@fetus.jp>
*/

declare(strict_types=1);

use app\components\db\AutoKey;
use app\components\db\Migration;
use app\components\helpers\TypeHelper;
use yii\db\Connection;

final class m231130_052651_season6_medals extends Migration
{
use AutoKey;

/**
* @inheritdoc
*/
public function safeUp()
{
$db = TypeHelper::instanceOf($this->db, Connection::class);

foreach ($this->getData() as $canonicalName => $names) {
$key = self::canonicalName2Key($canonicalName);
$this->insert('{{%medal_canonical3}}', [
'key' => $key,
'gold' => false,
'name' => $canonicalName,
]);

$id = $this->key2id('{{%medal_canonical3}}', $key);
$this->execute(
vsprintf(
'INSERT INTO %s ( %s ) VALUES %s ON CONFLICT ON CONSTRAINT medal3_name_key DO UPDATE SET %s',
[
$db->quoteTableName('{{%medal3}}'),
implode(
', ',
array_map(
fn (string $c): string => $db->quoteColumnName($c),
['name', 'canonical_id'],
),
),
implode(
', ',
array_map(
fn (string $name): string => vsprintf('(%s, %d)', [
$db->quoteValue($name),
$id,
]),
$names,
),
),
vsprintf('%2$s = %1$s.%2$s', [
$db->quoteTableName('excluded'),
$db->quoteColumnName('canonical_id'),
]),
],
),
);
}

return true;
}

/**
* @inheritdoc
*/
public function safeDown()
{
foreach (array_keys($this->getData()) as $canonicalName) {
$id = $this->key2id('{{%medal_canonical3}}', self::canonicalName2Key($canonicalName));

// should not delete from "medal3"
$this->update(
'{{%medal3}}',
['canonical_id' => null],
['canonical_id' => $id],
);

$this->delete('{{%medal_canonical3}}', ['id' => $id]);
}

return true;
}

/**
* @inheritdoc
*/
protected function vacuumTables(): array
{
return [
'{{%medal_canonical3}}',
'{{%medal3}}',
];
}

private static function canonicalName2Key(string $name): string
{
return self::name2key3(
preg_replace(
'/^#(\d) (.+)$/',
'$2 No.$1',
$name,
),
);
}

/**
* @return array<string, string[]>
*/
private function getData(): array
{
return [
'#1 Splattercolor Screen User' => [
'#1 Splattercolor Screen User',
'1. Platz: Unsichtbarriere',
'Cortina ingannevole: asso nº 1',
'N.º 1 en muro marmoleado',
'N.º 1 en pantintalla',
'PLED-scherm gebruikt: nr. 1',
'Мастер заливного барьера',
'№ 1 de la barrière barbouillée',
'スミナガシート No.1',
'浮墨幕墙 No.1',
'浮墨幕牆 No.1',
'스플래터컬러 스크린 No.1',
],
'#1 Triple Splashdown User' => [
'#1 Triple Splashdown User',
'1. Platz: Tri-Tintenschock',
'N.º 1 en clavado triple',
'N.º 1 en puñetazos explosivos',
'Triplo vernischianto: asso nº 1',
'Ultralanding gebruikt: nr. 1',
'Мастер тройного мегаплюха',
'№ 1 du triple choc chromatique',
'ウルトラチャクチ No.1',
'終極著陸 No.1',
'终极着陆 No.1',
'울트라 착지 No.1',
],
];
}
}

0 comments on commit 01faff0

Please sign in to comment.