Skip to content

Commit

Permalink
Add some logic for articles
Browse files Browse the repository at this point in the history
  • Loading branch information
Not-A-Normal-Robot committed May 13, 2024
1 parent e483b19 commit 5fbed37
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
45 changes: 45 additions & 0 deletions data/lang/articles/en/modes.master_ph.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Master PHANTASM is a unique mode of the Master modes,
featuring several unique challenges other than plain 20G and invisible.

<h1>Sections</h1>

Master PHANTASM consists of 9 sections.

<h3>Section 1 - 0 ~ 11 points</h3>
In this section, you are forced to clear 3 Techrashes in a row. <br>
If you fail to meet this requirement, the game ends prematurely.

<h3>Section 2 - 12 ~ 25 points</h3>
In this section, the Z/S and J/L pieces' colors are swapped. <br>
This makes it easier to mistake those pieces with its mirror.

<h3>Section 3 - 26 ~ 42 points</h3>
In this section, 10 lines of garbage appear. <br>
This isn't your usual multiplayer cheese garbage; it's closer to the "Type B" kind of garbage. <br>
Significantly less garbage blocks appear the lower your stack is when you enter this section. <br>
If you enter this section without using hold up to this point, you get an extra life as a reward. <br>
You are required to clear all 10 rows of garbage to continue.

<h3>Section 4 - 42 ~ 62 points</h3>
This section is a regular 20G + bone blocks section. The Hold mechanic is also disabled. Not much to say here.

<h3>Section 5 - 62 ~ ?? points</h3>
This section disables move-reset, making it harder to survive. The speed here is comparable to the middle stages of Master FINAL.

<h3>Section 6 - ?? ~ ?? points</h3>
The game speeds up significantly in this section. Not much else changes.

<h3>Section 7 - ?? ~ ?? points</h3>
The game speeds up even more in this section. <br>
The Hold mechanic is re-enabled. <br>
Placed blocks fade away slowly.

<h3>Section 8 - ?? ~ ?? points</h3>
The bone block mechanic is disabled in this section. <br>
Placed blocks fade away faster.

<h3>Section 9 - ?? ~ ?? points</h3>
The pieces' colors are randomized upon entering this section. <br>
Placed blocks fade away nearly instantly. <br>
You have to clear 8 more Techrashes to finally finish the mode. <br>
You don't have to clear the Techrashes in a row; unlike the first section, getting any other kind of line clear doesn't end the game prematurely.
17 changes: 17 additions & 0 deletions js/lang.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
let langEntries = {};
let showdown;

export function getCurrentLang() {
return localStorage.getItem('lang') || 'en';
Expand Down Expand Up @@ -30,6 +31,22 @@ export function getModeFullName(mode) {
export function getLanguageEntries() {
return langEntries;
};

export async function getArticle(key, fallback) {
if(typeof key !== 'string') throw new Error("Key must be a string!");

const result = await fetch(`/data/lang/articles/${getCurrentLang()}/${key}.html`);

if(!result.ok) {
if(fallback === undefined) {
throw new Error(`Failed to fetch article ${key}`);
}
return fallback;
}

return await result.text();
}

export async function setLanguage(lang){
if(lang === localStorage.getItem('lang')) return;
if(typeof lang !== 'string') throw new Error("Language must be a string!");
Expand Down

0 comments on commit 5fbed37

Please sign in to comment.