Commit 2e21fd92 authored by nanahira's avatar nanahira

add new flags

parent c88caba1
Pipeline #33338 passed with stages
in 10 minutes and 49 seconds
...@@ -16,7 +16,9 @@ ...@@ -16,7 +16,9 @@
"draw_count": 1, "draw_count": 1,
"time_limit": 180, "time_limit": 180,
"no_watch": false, "no_watch": false,
"auto_death": false "auto_death": false,
"bo5": false,
"sideins": false,
}, },
"modules": { "modules": {
"welcome": "MyCard YGOPro Server", "welcome": "MyCard YGOPro Server",
......
...@@ -1497,6 +1497,13 @@ class Room ...@@ -1497,6 +1497,13 @@ class Room
else else
@hostinfo.auto_death = 40 @hostinfo.auto_death = 40
if (rule.match /(^|,|,)(30EX|SIDEINS)(,|,|$)/)
@hostinfo.sideins = true
if (rule.match /(^|,|,)(BO5|BESTOF5)(,|,|$)/)
@hostinfo.mode = 1
@hostinfo.bo5 = true
if settings.modules.tournament_mode.enable_recover and (param = rule.match /(^|,|,)(RC|RECOVER)(\d*)T(\d*)(,|,|$)/) if settings.modules.tournament_mode.enable_recover and (param = rule.match /(^|,|,)(RC|RECOVER)(\d*)T(\d*)(,|,|$)/)
@recovered = true @recovered = true
@recovering = true @recovering = true
...@@ -1518,7 +1525,12 @@ class Room ...@@ -1518,7 +1525,12 @@ class Room
@spawn() @spawn()
spawn: (firstSeed) -> spawn: (firstSeed) ->
param = [0, @hostinfo.lflist, @hostinfo.rule, @hostinfo.mode, @hostinfo.duel_rule, duel_rule_flags = (@hostinfo.duel_rule & 0xf)
if @hostinfo.sideins
duel_rule_flags |= 0x10
if @hostinfo.bo5
duel_rule_flags |= 0x20
param = [0, @hostinfo.lflist, @hostinfo.rule, @hostinfo.mode, duel_rule_flags,
(if @hostinfo.no_check_deck then 'T' else 'F'), (if @hostinfo.no_shuffle_deck then 'T' else 'F'), (if @hostinfo.no_check_deck then 'T' else 'F'), (if @hostinfo.no_shuffle_deck then 'T' else 'F'),
@hostinfo.start_lp, @hostinfo.start_hand, @hostinfo.draw_count, @hostinfo.time_limit, @hostinfo.replay_mode] @hostinfo.start_lp, @hostinfo.start_hand, @hostinfo.draw_count, @hostinfo.time_limit, @hostinfo.replay_mode]
......
...@@ -1941,6 +1941,13 @@ ...@@ -1941,6 +1941,13 @@
this.hostinfo.auto_death = 40; this.hostinfo.auto_death = 40;
} }
} }
if (rule.match(/(^|,|,)(30EX|SIDEINS)(,|,|$)/)) {
this.hostinfo.sideins = true;
}
if (rule.match(/(^|,|,)(BO5|BESTOF5)(,|,|$)/)) {
this.hostinfo.mode = 1;
this.hostinfo.bo5 = true;
}
if (settings.modules.tournament_mode.enable_recover && (param = rule.match(/(^|,|,)(RC|RECOVER)(\d*)T(\d*)(,|,|$)/))) { if (settings.modules.tournament_mode.enable_recover && (param = rule.match(/(^|,|,)(RC|RECOVER)(\d*)T(\d*)(,|,|$)/))) {
this.recovered = true; this.recovered = true;
this.recovering = true; this.recovering = true;
...@@ -1966,8 +1973,15 @@ ...@@ -1966,8 +1973,15 @@
} }
spawn(firstSeed) { spawn(firstSeed) {
var e, i, j, l, param, seeds; var duel_rule_flags, e, i, j, l, param, seeds;
param = [0, this.hostinfo.lflist, this.hostinfo.rule, this.hostinfo.mode, this.hostinfo.duel_rule, (this.hostinfo.no_check_deck ? 'T' : 'F'), (this.hostinfo.no_shuffle_deck ? 'T' : 'F'), this.hostinfo.start_lp, this.hostinfo.start_hand, this.hostinfo.draw_count, this.hostinfo.time_limit, this.hostinfo.replay_mode]; duel_rule_flags = this.hostinfo.duel_rule & 0xf;
if (this.hostinfo.sideins) {
duel_rule_flags |= 0x10;
}
if (this.hostinfo.bo5) {
duel_rule_flags |= 0x20;
}
param = [0, this.hostinfo.lflist, this.hostinfo.rule, this.hostinfo.mode, duel_rule_flags, (this.hostinfo.no_check_deck ? 'T' : 'F'), (this.hostinfo.no_shuffle_deck ? 'T' : 'F'), this.hostinfo.start_lp, this.hostinfo.start_hand, this.hostinfo.draw_count, this.hostinfo.time_limit, this.hostinfo.replay_mode];
if (firstSeed) { if (firstSeed) {
param.push(firstSeed); param.push(firstSeed);
seeds = getSeedTimet(2); seeds = getSeedTimet(2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment