Commit 65e9c092 authored by ceddral's avatar ceddral
Browse files

board: support inns, game: add ext1

parent e7d7abd0
......@@ -728,27 +728,38 @@ func readpieces(filename string) (pieces []Piece, err error) {
fields[x].t = curPiece.fieldIdToType[c]
} else if i < 10 {
fields[x].c = c
fg := typeFG[fields[x].t]
if c == '*' {
if '0' <= c && c <= '9' {
fields[x].fgOverride = tg.ColorBlue
fg = fields[x].fgOverride
}
fields[x].preRendered = tg.RenderBlock(fg, typeBG[fields[x].t], fields[x].c, ^tg.TermUnderline, ^tg.TermBold)
} else {
if c == '_' {
continue
}
id := fields[x].id
if c == id {
switch c {
case '_':
case id:
fields[x].placeable = true
continue
case byte(fInn), byte(fPennant):
// foreground contains id this special belongs to
// which is not trivial for inns
specialId := fields[x].c
fields[x].c = '*'
if rotation == 0 {
// only add the special once
sm := curPiece.fieldIdToSpecial
sm[specialId] = append(sm[specialId], FSpecial(c))
}
case byte(fCathedral):
if rotation == 0 {
// only add the special once
sm := curPiece.fieldIdToSpecial
sm[id] = append(sm[id], FSpecial(c))
}
default: panic("unexpected symbol in card definition")
}
if rotation != 0 {
// only add specials once, do not duplicate for each rotation
continue
fg := typeFG[fields[x].t]
if fields[x].fgOverride != 0 {
fg = fields[x].fgOverride
}
sm := curPiece.fieldIdToSpecial
sm[id] = append(sm[id], FSpecial(c))
fields[x].preRendered = tg.RenderBlock(fg, typeBG[fields[x].t], fields[x].c, ^tg.TermUnderline, ^tg.TermBold)
}
}
rotation++
......
......@@ -182,6 +182,10 @@ func tokensByExtension(ext string) map[Token]int {
return map[Token]int {
tFollower: 7,
}
case "ext1":
return map[Token]int {
tBigFollower: 1,
}
default:
panic(fmt.Sprintf("unknown extension <%s>", ext))
}
......
......@@ -100,7 +100,7 @@ func main() {
}
go fakeInputLoop(gs.players["since"].inputKill)
go fakeWindowSizeLoop(gs.players["since"].windowSizeLoopKill)
NewGame([]string{"since", "ceddral"}, []string{"base"})
NewGame([]string{"since", "ceddral"}, []string{"base", "ext1"})
if err != nil {
panic(err)
......
......@@ -11,17 +11,17 @@ bm 4
00100 + __1__00100 + __1__00100 + __1__00100 + __1__
00000 _____00000 _____00000 _0___00000 ___0_
r 1
00000* p____00000 _____00000 _____00000 *____p
000000 p____00000 _____00000 _____00000 0____p
00000 __0__00000 __0__00000 __0__00000 __0__
00000 _____00000* p____00000 *____p00000 _____
00000 _____000000 p____00000 0____p00000 _____
br 5
01110 __1__10000 _____00000 _____00001 _____
00000 ___0_11000 1_0__00000 _0___00011 __0_1
00000 _____10000 _____01110 __1__00001 _____
rbb 2
01110 __1__10002 * __p__02220 __2__20001 __0__
00000 *0___p11022 1___200000* p___022011 2___1
02220 __2__10002 __0__01110 __1__20001 * __p__
01110 __1__10002 0 __p__02220 __2__20001 __0__
00000 00___p11022 1___2000000 p___022011 2___1
02220 __2__10002 __0__01110 __1__20001 0 __p__
brb 1
01112 _____12221 __2__21110 __1__10001 __0__
00122 0___211111 1____22100 2___011111 ____1
......@@ -47,33 +47,33 @@ bwbrwbw 3
44X33--| _4__311X66--v--_1_6_33X44 |--3__4_66X11--^--_6_1_
55623 | 5_6__00455 | 0_4_532100 | _21_023332 __3_2
rb 2
00001* p____01111 _____11110 _____10000 *____p
000010 p____01111 _____11110 _____10000 0____p
00111 _0_1_00111 _0_1_11100 _1_0_11100 _1_0_
01111 _____00001* p____10000 *____p11110 _____
01111 _____000010 p____10000 0____p11110 _____
rb 3
00001 _____01111 _____11110 _____10000 _____
00111 _0_1_00111 _0_1_11100 _1_0_11100 _1_0_
01111 _____00001 _____10000 _____11110 _____
rbwb 2
00001* p___101233 | ____333210 | 3____10000 *1___p
000010 p___101233 | ____333210 | 3____10000 01___p
00222 .--_0_2_00222 '--_0_2_22200--' _2_0_22200--. _2_0_
01233 | ____300001* p___110000 *1___p33210 | 3____
01233 | ____3000010 p___110000 01___p33210 | 3____
rbwb 3
00001 ____101233 | ____333210 | 3____10000 1____
00222 .--_0_2_00222 '--_0_2_22200--' _2_0_22200--. _2_0_
01233 | ____300001 ____110000 1____33210 | 3____
rb 1
00000* p__0_00001 _0___01110 __1__10000 *____p
000000 p__0_00001 _0___01110 __1__10000 0____p
00000 _____00011 ____100000 _____11000 1____
01110 __1__00001* p____00000 *_0__p10000 ___0_
01110 __1__000010 p____00000 0_0__p10000 ___0_
rb 3
00000 ___0_00001 _0___01110 __1__10000 _____
00000 _____00011 ____100000 _____11000 1____
01110 __1__00001 _____00000 _0___10000 ___0_
rbwb 2
00000* p__0_00003 _0__303210 | _321_10000 *1___p
000000 p__0_00003 _0__303210 | _321_10000 01___p
00000 _____00022 --____200000 _____22000-- 2____
01230 | _123_00001* p___100000 *_0__p30000 3__0_
01230 | _123_000010 p___100000 0_0__p30000 3__0_
rbwb 1
00000 ___0_00003 _0__303210 | _321_10000 1____
00000 _____00022 --____200000 _____22000-- 2____
......
brrr 1
01112 / __1__12223 \ / __2__23330 \ __3__30001 __0__
00022 0___211033 1___322000 2___033011 3___1
03332 \ __3__10003 __0__21110 / __1__32221 / \ __2__
bbwwm 1
00000 _0___00311 | __3__11111 _1___11200 | __2__
22433--+--_243_00411 + 0_4_133422--+--_342_11400 + 1_4_0
11111 ___1_00211 | __2__00000 ___0_11300 | __3__
r 2
00000 _|_ _____00000 _|_ _____00000 _|_ _____00000 _|_ _____
00000 | __c__00000 | __c__00000 | __c__00000 | __c__
00000 | ____000000 | ____000000 | ____000000 | ____0
brrrr 1
41112 \ / __1__12223 \ / __2__23334 \ / __3__34441 \ / __4__
44022 4_0_211033 1_0_322044 2_0_433011 3_0_1
43332 / \ __3__14443 / \ __4__21114 / \ __1__32221 / \ __2__
bbrw 1
02221 __2__21111 __1__11300 | __3__00002 __0__
00311 | 0___122333 ---2__3_11300 | 1___033322--- _3__2
00311 | __3__20000 __0__12220 __2__11112 __1__
bbbwww 1
00000 4 __0i_00422 4| _i4_222511 | 2_5_111300 | 1_3__
33X44--v--_3_4_00X55 |--0__5_44X33--^--_4_3_55X00--| _5__0
11522 | 1_5_200311 | __3_100000 4 _i0__22400 |4 2_4i_
bbrw 1
12222 1____22220 _____20000 3 __0i_00312 3| _i_1_
33322--' _3_2_22300 | _230_22333 .--_2_3_00322 | _032_
00002 3 _i0__21300 |3 _1_i_22221 ____102222 _____
bbw 1
11111 __1__11200 | _____00000 __0__00211 | _____
22222-----__2__11200 | 1_2_022222-----__2__00211 | 0_2_1
00000 2 __0i_11200 2| _i___11111 2 __1i_00211 2| _i___
rbwb 1
000010 p___101233 |2 ___i333210 2| 3i___10000 01___p
00222 .--_0_2_00222 '--_0_2_22200--' _2_0_22200--. _2_0_
01233 |2 ___i3000010 p___110000 01___p33210 2| 3i___
bwb 1
00000 ___0_00000 _0___00122 1| _i__222100 |1 2__i_
11100--. _1___00111 .--___1_00111 '--___1_11100--' _1___
22100 |1 2__i_00122 1| _i__200000 _0___00000 ___0_
bwbr 1
00123 |1 0__i_23332 __3__32222 __2__22100 1| _i__0
11133--' _1__311122--. _1__233111 .--3__1_22111 '--2__1_
22223 __2__00122 |1 0__i_32100 1| _i__023332 __3__
rbbbbww 1
01530 | _153_30004 0 3_p_404620 | _462_20001 2_0_1
00000 00___p55066-- --_5_6_000000 p___066055-- --_6_5_
02640 | _264_10002 1_0_203510 | _351_40003 0 4_p_3
bbrw 1
02222 _____22221 ____121300 | _1___00002 __0__
00322 | _032_22333 '--_2_3_22300 | _230_33322--. _3_2_
00312 | ___1_20000 __0__22220 _____12222 1____
rbrbbbww 3
01732 | _173_32225 3_2_525640 | _564_40001 4_0_1
00X22 # 0___277X66--#--_7_6_22X00 # 2___066X77--#--_6_7_
04652 | _465_10004 1_0_423710 | _371_52223 5_2_3
bbbww 1
11300 | _13__00422 | __42_22400 | _24_000311 | 0_31_
33044-' .-_____33044-. '-_____44033-' .-_____44033-. '-_____
00422 | 0_42_11300 | _13_000311 | __31_22400 | _24__
rbr 1
000010 p____01112 __1__12220 / __2__20000 \ 0____p
00111 _0_1_00122 _0__211100 _1_0_22100 2__0_
02221 / __2__000020 \ p____10000 0____p21110 __1__
brb 1
00001 _____01112 __1__12220 / __2__20000 \ _____
00111 _0_1_00122 _0__211100 _1_0_22100 2__0_
02221 / __2__00002 \ _____10000 _____21110 __1__
Supports Markdown
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