Exemplo n.º 1
0
    // [start,end)
    randi(start,end) {
        const range = end - start
        // sample must be divisible by range
        const maxint = 2147483647
        const max = maxint - (maxint%range)
        let r = this.mt.int()
        while (r>max) {
            r = this.mt.int()
        }

        return r%range + start
    }
function GameConstructor() {
    var core = new ocgcore(scripts);
    var pduel = core.ocgapi.create_duel(mt.int());
    var model = {
        gamestate: 'off',
        gametype: 'single',
        lobby: {
            player1_username: '',
            player2_username: '',
            player3_username: '',
            player4_username: '',
            player1_loaded: false,
            player2_loaded: false,
            player3_loaded: false,
            player4_loaded: false,
            spectators: 0
        },
        player1_rps_choice: undefined,
        player2_rps_choice: undefined,
        activePlayer: 0,
        phase: 0,
        player1_lifepoints: 8000,
        player2_lifepoints: 8000,
        player1_cards: {
            deck: [],
            extra: [],
            side: [],
            hand: [],
            monsters: [null, null, null, null, null],
            spells: [null, null, null, null, null, null, null, null]
        },
        player2_cards: {
            deck: [],
            extra: [],
            side: [],
            hand: [],
            monsters: [null, null, null, null, null],
            spells: [null, null, null, null, null, null, null, null]
        },
        wincondition: 'none',
        replaysave: false,
        replayfile: '',
        gamelog: [],
        cardunderexamine: 0,
    };
    return this;
}
Exemplo n.º 3
0
 int() {return this.mt.int()}