Skip to content

Commit

Permalink
Wondermail -> Wonder Mail
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthik99999 committed Feb 23, 2024
1 parent b104699 commit fa0c64d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/lib/generators/rt/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { generateWondermail } from './wm/generate';
export { generateWonderMail } from './wm/generate';
export { default as data } from './data';
8 changes: 4 additions & 4 deletions src/lib/generators/rt/wm/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function bitunpack(bits: number[]): number[] {
return unpacked;
}

interface WondermailData {
interface WonderMailData {
missionType: number;
clientPokemon: number;
targetPokemon: number;
Expand All @@ -36,7 +36,7 @@ interface WondermailData {
floor: number;
}

export function serialize(data: WondermailData) {
export function serialize(data: WonderMailData) {
const writer = new BitstreamWriter(8);
writer.write(5, 4); // Mail type
writer.write(data.missionType, 3);
Expand All @@ -60,7 +60,7 @@ export function serialize(data: WondermailData) {
return shuffled.join('');
}

export function generateWondermail(
export function generateWonderMail(
missionType: number,
clientPokemon: number,
targetPokemon: number,
Expand Down Expand Up @@ -110,7 +110,7 @@ export function generateWondermail(
friendAreaReward = 0;
}

const data: WondermailData = {
const data: WonderMailData = {
missionType,
clientPokemon,
targetPokemon,
Expand Down
8 changes: 4 additions & 4 deletions src/lib/generators/rt/wm/read.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ function bitpack(bits: number[]): number[] {
}

/**
* Data structure of a wondermail
* Data structure of a wonder mail
*/
interface WondermailData {
interface WonderMailData {
inclChecksum: number;
calcChecksum: number;
mailType: number;
Expand All @@ -75,7 +75,7 @@ interface WondermailData {
floor: number;
}

function deserialize(password: string): WondermailData {
function deserialize(password: string): WonderMailData {
const sanitized = sanitizePassword(password);
const unshuffled = unshuffle(sanitized);
const bits = charsToBits(unshuffled);
Expand All @@ -100,7 +100,7 @@ function deserialize(password: string): WondermailData {
const dungeon = reader.read(7);
const floor = reader.read(7);

const data: WondermailData = {
const data: WonderMailData = {
inclChecksum,
calcChecksum,
mailType,
Expand Down
4 changes: 2 additions & 2 deletions src/routes/(rt)/rt-wondermail/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
const moneyReward = (document.getElementById('moneyReward') as HTMLInputElement).checked;
const friendAreaReward = parseInt((document.getElementById('friendAreaReward') as HTMLSelectElement).value);
try {
password = RT.generateWondermail(missionType, client, target, dungeon, floor, itemToFindOrDeliver, itemReward, moneyReward, friendAreaReward);
password = RT.generateWonderMail(missionType, client, target, dungeon, floor, itemToFindOrDeliver, itemReward, moneyReward, friendAreaReward);
} catch (e) {
alert(e);
}
Expand Down Expand Up @@ -96,7 +96,7 @@
<a class="btn btn-link" href={base}>Go back</a>
</center>

<h4>Rescue Team Wondermail Generator</h4>
<h4>Rescue Team Wonder Mail Generator</h4>

<form on:submit={generate}>
<div class="form-group">
Expand Down

0 comments on commit fa0c64d

Please sign in to comment.