blueversusraid 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +19 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +77 -0
- package/lib/index.js.map +1 -0
- package/lib/types/players.d.ts +11 -0
- package/lib/types/players.d.ts.map +1 -0
- package/lib/types/players.js +19 -0
- package/lib/types/players.js.map +1 -0
- package/lib/types/roles.d.ts +26 -0
- package/lib/types/roles.d.ts.map +1 -0
- package/lib/types/roles.js +45 -0
- package/lib/types/roles.js.map +1 -0
- package/lib/types/rules.d.ts +14 -0
- package/lib/types/rules.d.ts.map +1 -0
- package/lib/types/rules.js +2 -0
- package/lib/types/rules.js.map +1 -0
- package/package.json +20 -0
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Cycle, Phase } from "./types/rules.js";
|
|
2
|
+
import { Role, Team } from "./types/roles.js";
|
|
3
|
+
import { Player } from "./types/players.js";
|
|
4
|
+
export declare class Game {
|
|
5
|
+
id: number;
|
|
6
|
+
roles: Role[];
|
|
7
|
+
teams: Team[];
|
|
8
|
+
cycle: number;
|
|
9
|
+
private iteration;
|
|
10
|
+
phases: Phase[][];
|
|
11
|
+
current_phases: Phase[];
|
|
12
|
+
players: Player[];
|
|
13
|
+
constructor(id?: number);
|
|
14
|
+
iterate(): Promise<void>;
|
|
15
|
+
startLoop(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export { Role, Player };
|
|
18
|
+
export type { Team, Phase, Cycle };
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAE3C,qBAAa,IAAI;IACN,EAAE,EAAE,MAAM,CAAA;IAEV,KAAK,EAAE,IAAI,EAAE,CAAK;IAClB,KAAK,EAAE,IAAI,EAAE,CAgBnB;IAEM,KAAK,EAAE,MAAM,CAAI;IACxB,OAAO,CAAC,SAAS,CAAY;IAEtB,MAAM,EAAE,KAAK,EAAE,EAAE,CAAK;IACtB,cAAc,EAAE,KAAK,EAAE,CAAK;IAE5B,OAAO,EAAE,MAAM,EAAE,CAAK;gBAEjB,EAAE,CAAC,EAAE,MAAM;IAIV,OAAO;IAgDP,SAAS;CAQzB;AAED,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;AACvB,YAAY,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Role } from "./types/roles.js";
|
|
2
|
+
import { Player } from "./types/players.js";
|
|
3
|
+
export class Game {
|
|
4
|
+
id;
|
|
5
|
+
roles = [];
|
|
6
|
+
teams = [
|
|
7
|
+
{
|
|
8
|
+
name: 'Rouges',
|
|
9
|
+
description: 'Vous êtes les méchants.',
|
|
10
|
+
solo: false
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: 'Bleus',
|
|
14
|
+
description: 'Vous êtes les gentils.',
|
|
15
|
+
solo: false
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'Solitaires',
|
|
19
|
+
description: 'Vous jouez seul contre tous.',
|
|
20
|
+
solo: true
|
|
21
|
+
}
|
|
22
|
+
];
|
|
23
|
+
cycle = 0;
|
|
24
|
+
iteration = 0;
|
|
25
|
+
phases = [];
|
|
26
|
+
current_phases = [];
|
|
27
|
+
players = [];
|
|
28
|
+
constructor(id) {
|
|
29
|
+
this.id = id || Math.random();
|
|
30
|
+
}
|
|
31
|
+
async iterate() {
|
|
32
|
+
if (this.iteration > this.phases.length - 1) {
|
|
33
|
+
this.cycle += 1;
|
|
34
|
+
this.iteration = 0;
|
|
35
|
+
}
|
|
36
|
+
this.current_phases = this.phases[this.iteration];
|
|
37
|
+
const executed = [];
|
|
38
|
+
for (const turn of this.phases[this.iteration]) {
|
|
39
|
+
if (turn.cycle instanceof Array) {
|
|
40
|
+
if (!turn.cycle.includes(this.cycle))
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
const { start, end, step } = turn.cycle;
|
|
45
|
+
const notAligned = this.cycle % step !== start;
|
|
46
|
+
const beforeStart = this.cycle < start;
|
|
47
|
+
const afterEnd = end !== -1 && this.cycle > end;
|
|
48
|
+
if (notAligned || beforeStart || afterEnd) {
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
executed.push(turn.name);
|
|
53
|
+
await Promise.all(turn.roles.map(async (role) => {
|
|
54
|
+
let callback = await role.call(turn.name);
|
|
55
|
+
let isOnTime = true;
|
|
56
|
+
setTimeout(() => {
|
|
57
|
+
role.endCall();
|
|
58
|
+
isOnTime = false;
|
|
59
|
+
}, turn.duration * 1000);
|
|
60
|
+
if (isOnTime) {
|
|
61
|
+
callback();
|
|
62
|
+
}
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
console.log('Jour', this.cycle, '| Phase', this.iteration + ':', executed);
|
|
66
|
+
this.iteration += 1;
|
|
67
|
+
}
|
|
68
|
+
async startLoop() {
|
|
69
|
+
let sleeps = this.phases.map(phase => Math.max(...phase.map(turn => turn.duration)));
|
|
70
|
+
while (this.cycle < 7) {
|
|
71
|
+
await this.iterate();
|
|
72
|
+
await new Promise(_ => { setTimeout(_, sleeps[this.iteration]); });
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
export { Role, Player };
|
|
77
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1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,CAAA;QAC1E,IAAI,CAAC,SAAS,IAAI,CAAC,CAAA;IACvB,CAAC;IAEM,KAAK,CAAC,SAAS;QAClB,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;QAEpF,OAAO,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC;YACpB,MAAM,IAAI,CAAC,OAAO,EAAE,CAAA;YACpB,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,GAAE,UAAU,CAAC,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAA,CAAA,CAAC,CAAC,CAAA;QACnE,CAAC;IACL,CAAC;CACJ;AAED,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Role } from "./roles.js";
|
|
2
|
+
import { Phase } from "./rules.js";
|
|
3
|
+
export declare class Player {
|
|
4
|
+
id: number;
|
|
5
|
+
role: Role | null;
|
|
6
|
+
dead: boolean;
|
|
7
|
+
state: Record<string, boolean>;
|
|
8
|
+
constructor(id?: number, role?: Role);
|
|
9
|
+
trigger_death(author: (Player | null) | undefined, phase: Phase): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=players.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"players.d.ts","sourceRoot":"","sources":["../../src/types/players.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,qBAAa,MAAM;IACR,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,IAAI,GAAG,IAAI,CAAA;IAEjB,IAAI,EAAE,OAAO,CAAQ;IACrB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEpC;gBAEW,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,IAAI;IAKvB,aAAa,CAAC,MAAM,GAAE,MAAM,GAAG,IAAI,aAAO,EAAE,KAAK,EAAE,KAAK;CAMxE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export class Player {
|
|
2
|
+
id;
|
|
3
|
+
role;
|
|
4
|
+
dead = false;
|
|
5
|
+
state = {
|
|
6
|
+
couple: false
|
|
7
|
+
};
|
|
8
|
+
constructor(id, role) {
|
|
9
|
+
this.id = id || Math.random();
|
|
10
|
+
this.role = role || null;
|
|
11
|
+
}
|
|
12
|
+
async trigger_death(author = null, phase) {
|
|
13
|
+
if (this.dead)
|
|
14
|
+
return;
|
|
15
|
+
this.dead = true;
|
|
16
|
+
await this.role?.trigger_death(author instanceof Player ? author.role : author, phase);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=players.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"players.js","sourceRoot":"","sources":["../../src/types/players.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,MAAM;IACR,EAAE,CAAQ;IACV,IAAI,CAAa;IAEjB,IAAI,GAAY,KAAK,CAAA;IACrB,KAAK,GAA4B;QACpC,MAAM,EAAE,KAAK;KAChB,CAAA;IAED,YAAY,EAAW,EAAE,IAAW;QAChC,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAA;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,IAAI,CAAA;IAC5B,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,SAAwB,IAAI,EAAE,KAAY;QACjE,IAAI,IAAI,CAAC,IAAI;YAAE,OAAO;QAEtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,MAAM,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,YAAY,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;IAC1F,CAAC;CACJ"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Phase } from "./rules.js";
|
|
2
|
+
export type Team = {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
solo: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare class Role {
|
|
8
|
+
name: string;
|
|
9
|
+
team: Team;
|
|
10
|
+
description: string;
|
|
11
|
+
system: boolean;
|
|
12
|
+
private exec_death;
|
|
13
|
+
private exec_kill;
|
|
14
|
+
private exec_logic;
|
|
15
|
+
private end_logic;
|
|
16
|
+
constructor(name: string, team: Team, description: string, system?: boolean, exec_death?: (author: Role | null, phase: Phase) => void, exec_kill?: (victim: Role) => void, exec_logic?: (phase: string) => Promise<() => void>, end_logic?: () => void);
|
|
17
|
+
onDeath(callback: (author: Role | null, phase: Phase) => void): void;
|
|
18
|
+
onKill(callback: (victim: Role) => void): void;
|
|
19
|
+
onCall(callback: (phase: string) => Promise<() => void>): void;
|
|
20
|
+
onEndCall(callback: () => void): void;
|
|
21
|
+
call(phase: string): Promise<() => void>;
|
|
22
|
+
endCall(): Promise<void>;
|
|
23
|
+
trigger_death(author: Role | null, phase: Phase): Promise<void>;
|
|
24
|
+
do_kill(victim: Role): Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=roles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../src/types/roles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,MAAM,MAAM,IAAI,GAAG;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,I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
|
3
|
+
team;
|
|
4
|
+
description;
|
|
5
|
+
system = false;
|
|
6
|
+
exec_death = async () => { };
|
|
7
|
+
exec_kill = async () => { };
|
|
8
|
+
exec_logic = async () => () => { };
|
|
9
|
+
end_logic = async () => { };
|
|
10
|
+
constructor(name, team, description, system = false, exec_death = () => { }, exec_kill = () => { }, exec_logic = async (phase) => () => { }, end_logic = () => { }) {
|
|
11
|
+
this.name = name;
|
|
12
|
+
this.team = team;
|
|
13
|
+
this.description = description;
|
|
14
|
+
this.system = system;
|
|
15
|
+
this.exec_death = exec_death;
|
|
16
|
+
this.exec_kill = exec_kill;
|
|
17
|
+
this.exec_logic = exec_logic;
|
|
18
|
+
this.end_logic = end_logic;
|
|
19
|
+
}
|
|
20
|
+
onDeath(callback) {
|
|
21
|
+
this.exec_death = callback;
|
|
22
|
+
}
|
|
23
|
+
onKill(callback) {
|
|
24
|
+
this.exec_kill = callback;
|
|
25
|
+
}
|
|
26
|
+
onCall(callback) {
|
|
27
|
+
this.exec_logic = callback;
|
|
28
|
+
}
|
|
29
|
+
onEndCall(callback) {
|
|
30
|
+
this.end_logic = callback;
|
|
31
|
+
}
|
|
32
|
+
async call(phase) {
|
|
33
|
+
return await this.exec_logic(phase);
|
|
34
|
+
}
|
|
35
|
+
async endCall() {
|
|
36
|
+
await this.end_logic();
|
|
37
|
+
}
|
|
38
|
+
async trigger_death(author, phase) {
|
|
39
|
+
await this.exec_death(author, phase);
|
|
40
|
+
}
|
|
41
|
+
async do_kill(victim) {
|
|
42
|
+
await this.exec_kill(victim);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=roles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roles.js","sourceRoot":"","sources":["../../src/types/roles.ts"],"names":[],"mappings":"AAQA,MAAM,OAAO,IAAI;IACb,IAAI,CAAQ;IACZ,IAAI,CAAM;IACV,WAAW,CAAQ;IACnB,MAAM,GAAY,KAAK,CAAA;IAE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AAC,UAAU,CAAC,KAAK,CAAC,CAAA;IACvC,CAAC;IAEM,KAAK,CAAC,OAAO;QAChB,MAAM,IAAI,CAAC,SAAS,EAAE,CAAA;IAC1B,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,MAAmB,EAAE,KAAY;QACxD,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;IACxC,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,MAAY;QAC7B,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;IAChC,CAAC;CACJ"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Role } from "./roles.js";
|
|
2
|
+
export type Cycle = {
|
|
3
|
+
start: number;
|
|
4
|
+
end: number;
|
|
5
|
+
step: number;
|
|
6
|
+
};
|
|
7
|
+
export type Phase = {
|
|
8
|
+
name: string;
|
|
9
|
+
roles: Role[];
|
|
10
|
+
duration: number;
|
|
11
|
+
cycle: Cycle | number[];
|
|
12
|
+
steps: Record<number, string>;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/types/rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEjC,MAAM,MAAM,KAAK,GAAG;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,KAAK,GAAG;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,KAAK,GAAG,MAAM,EAAE,CAAA;IACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAChC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../src/types/rules.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "blueversusraid",
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"description": "Moteur pour des jeux en 2 équipes du style loup-garou",
|
|
5
|
+
"license": "GPL-3.0",
|
|
6
|
+
"author": "EjNalo",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "lib/index.js",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"lib"
|
|
14
|
+
],
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@types/node": "^25.3.0",
|
|
17
|
+
"tsx": "^4.21.0",
|
|
18
|
+
"typescript": "^5.9.3"
|
|
19
|
+
}
|
|
20
|
+
}
|