#define TS_MAP_DATA
_s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , Xu          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , Xu          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , Xu          , Xu          , Ss          , Xu          , Xu          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , Xu          , Xu          , Ww          , Xu          , Xu          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , Xu          , Xu          , Ss          , Ss          , Gs          , Ss          , Ww          , Xu          , Xu          , _s          , _s          , _s          , Xu          , Xu          , Ww          , Ww          , Dd          , Ww          , Ww          , Xu          , Xu          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , Xu          , Xu          , Ss          , Ss          , Ss^Vhs      , Gs^Ft       , Mm          , Gs          , Gs          , Ww          , Ww          , Xu          , Xu          , Xu          , Ww          , Ww          , Gs^Ft       , Dd          , Dd^Do       , Dd          , Gs          , Ww          , Ss          , Xu          , Xu          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , Xu          , Xu          , Ww          , Ss          , Ww          , Ss          , Gs          , Hh          , Re          , Gs          , Hh          , Gs^Ft       , Gs^Ft       , Ww          , Xu          , Ww          , Gs^Fp       , Gs          , Gs          , Hd          , Md          , Hd          , Gs^Ft       , Ww          , Ww          , Ss          , Ss          , Xu          , Xu          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , Xu          , Xu          , Ww          , Ww          , Gs          , Ww          , Ds          , Ww          , Ww^Bw/      , Re          , Gs^Ft       , Re          , Re          , Gs^Vht      , Gs          , Ww          , Xu          , Ww          , Gg^Ve       , Gg          , Gg          , Gs^Ft       , Re          , Re          , Re          , Ds          , Ww          , Ss          , Ss^Vhs      , Ss          , Ss          , Xu          , Xu          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , Xu          , Ww          , Dd          , Dd          , Hd          , Gs^Ft       , Re          , Re          , Ds          , Ww          , Ww          , Gs          , Re          , Gs          , Wwf         , Ww          , Xu          , Ww          , Gg          , Hh          , Gg          , Re          , Gg          , Gg          , Gg          , Re          , Ww^Bw\      , Gs          , Hh          , Gs^Ft       , Gs          , Ss          , Xu          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , Xu          , Ww          , Dd          , Dd^Do       , Md          , Re          , Gg          , Gg          , Ww          , Ww          , Ww          , Hh          , Re          , Ww          , Gs^Fp       , Ww          , Xu          , Ww          , Ww          , Gs^Fp       , Ww          , Re          , Ww          , Ww^Vm       , Ww          , Ds          , Ww          , Re          , Re          , Mm          , Gs          , Ss          , Xu          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , Xu          , Ww          , Gs^Ft       , Hd          , Gs^Ft       , Re          , Gg          , Ww^Vm       , Wo          , Wo          , Ww          , Gs^Ft       , Ww^Bw|      , Ww          , Gg          , Ww          , Xu          , Ww          , Gs^Fp       , Wwf         , Gg          , Ww^Bw|      , Ww          , Wo          , Wo          , Ww          , Ww          , Gs^Ft       , Re          , Gs          , Gs          , Ww          , Xu          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , Xu          , Ww          , Gs          , Gs          , Gg          , Re          , Re          , Ww          , Ww          , Ww          , Gs^Fp       , Ww          , Rr          , Ww          , Wwf         , Ww          , Xu          , Ww          , Gg          , Gg          , Rr          , Rr          , Hh          , Ww          , Ww          , Ww          , Hh          , Gs          , Re          , Hh          , Gs^Ft       , Ww          , Xu          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , Xu          , Ww          , Gs^Fp       , Gg          , Hh          , Gg          , Ww          , Ww^Bw\      , Rr          , Hh          , Mm^Vhh      , Hh          , Rr          , Gs^Fp       , Gg          , Ww          , Xu          , Ww          , Gg          , Hh          , Rr          , Gs^Fp       , Mm^Vhh      , Gs^Fp       , Ww          , Gs^Ft       , Re          , Re          , Gs          , Gs^Vht      , Gs^Ft       , Ww          , Xu          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , Xu          , Ww          , Ww          , Gg^Ve       , Gg          , Gs^Fp       , Wwf         , Gg          , Rr          , Gs^Fp       , Rr          , Rr          , Gg          , Gg          , Gg          , Ww          , Xu          , Ww          , Gg          , Gg          , Gg          , Rr          , Rr          , Hh          , Rr          , Ww^Bw/      , Ww          , Ww          , Wwf         , Gs          , Ww          , Ww          , Xu          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , Xu          , Xu          , Ww          , Xu          , Xu          , Ww          , Ww          , Ww          , Gs^Fp       , Gg          , Hh          , Rr          , Gg          , Rr          , Ch          , Hh          , Gg          , Ww          , Xu          , Ww          , Gg          , Gs^Fp       , Ch          , Rr          , Gg          , Rr          , Gs^Fp       , Ww          , Gg          , Gs^Fp       , Ww          , Ww          , Xu          , Xu          , Ww          , Xu          , Xu          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , Xu          , Xu          , Ww          , Ww          , Gs^Ft       , Ww          , Ww          , Xu          , Xu          , Ww          , Ww          , Gg          , Gg          , Gg          , Gs^Fp       , Ch          , 2 Kh        , Ch          , Gg          , Ww          , Xu          , Ww          , Gg          , Ch          , 3 Kh        , Ch          , Hh          , Gg          , Gg          , Wwf         , Ww          , Ww          , Xu          , Xu          , Ww          , Ww          , Gs^Fp       , Ww          , Ww          , Xu          , Xu          , _s          , _s          , _s          
_s          , Xu          , Xu          , Ss          , Ww          , Gs          , Gs^Ft       , Gs^Vht      , Gs          , Wwf         , Ww          , Ww          , Xu          , Xu          , Ww          , Ww          , Gg          , Gg          , Ch          , Ww          , Ww          , Ww          , Ww          , Xu          , Ww          , Ww          , Ww          , Ww          , Ch          , Gg          , Gg          , Ww          , Ww          , Xu          , Xu          , Ww          , Ww          , Gg          , Gg^Ve       , Gg          , Gs          , Gs^Ft       , Ww          , Ww          , Xu          , Xu          , _s          
_s          , Xu          , Ss          , Gs          , Gs          , Gs          , Hh          , Re          , Gs          , Ww          , Gs^Fp       , Gg          , Ww          , Ww          , Xu          , Xu          , Ww          , Ww          , Gg          , Ww          , Wo          , Xu          , Xu          , Ql          , Xu          , Xu          , Wo          , Ww          , Gg          , Ww          , Ww          , Xu          , Xu          , Ww          , Ww          , Gs^Fp       , Ww          , Gs^Fp       , Hh          , Gg          , Gs          , Hd          , Dd          , Dd          , Ww          , Xu          , _s          
_s          , Xu          , Ss          , Gs^Ft       , Mm          , Re          , Re          , Gs          , Re          , Re          , Ww          , Ww          , Wwf         , Gg          , Ww          , Ww          , Xu          , Xu          , Ww          , Xu          , Xu          , Xu          , Ql          , Xu          , Ql          , Xu          , Xu          , Xu          , Ww          , Xu          , Xu          , Ww          , Ww          , Gg          , Gg          , Gg          , Wwf         , Ww          , Gg          , Re          , Gs^Ft       , Md          , Dd^Do       , Dd          , Ww          , Xu          , _s          
_s          , Xu          , Ss          , Ss^Vhs      , Hh          , Re          , Gs^Ft       , Ww          , Hh          , Gs^Ft       , Ww^Bw\      , Rr          , Gs^Fp       , Gg          , Gg          , Gg          , Ww          , Ww          , Xu          , Ql          , Ql          , Ql          , Ql          , Xu          , Ql          , Ql          , Ql          , Ql          , Xu          , Ww          , Ww          , Gg          , Gg          , Gg          , Hh          , Rr          , Gg          , Ww^Bw/      , Re          , Gg          , Re          , Re          , Hd          , Gs          , Ww          , Xu          , _s          
_s          , Xu          , Ss          , Ss          , Gs          , Ww^Bw|      , Ww          , Ww          , Ww          , Ww          , Ww          , Hh          , Rr          , Gg          , Hh          , Ch          , Gg          , Ww          , Xu          , Ql          , Xu          , Xu          , Xu          , Uu^Ii       , Xu          , Xu          , Xu          , Ql          , Xu          , Ww          , Gg          , Ch          , Gs^Fp       , Gg          , Rr          , Gs^Fp       , Rr          , Ww          , Ww          , Ww^Vm       , Gg          , Re          , Gs^Ft       , Ww          , Ww          , Xu          , _s          
_s          , Xu          , Ss          , Ww          , Ww          , Re          , Ds          , Ww          , Wo          , Ww          , Gs^Fp       , Mm^Vhh      , Rr          , Rr          , Ch          , 7 Kh        , Ww          , Wo          , Xu          , Xu          , Ql          , Xu          , Uu^Ii       , 1 Kh        , Uu^Ii       , Xu          , Ql          , Xu          , Xu          , Wo          , Ww          , 4 Kh        , Ch          , Rr          , Rr          , Mm^Vhh      , Hh          , Ww          , Wo          , Ww          , Gg          , Re          , Ds          , Ww          , Ss          , Xu          , _s          
_s          , Xu          , Ss          , Ww          , Ds          , Re          , Gg          , Ww^Vm       , Wo          , Ww          , Hh          , Gs^Fp       , Rr          , Gg          , Ch          , Ch          , Ww          , Ww          , Xu          , Ql          , Ql          , Xu          , Uu^Ii       , Uu^Ii       , Uu^Ii       , Xu          , Ql          , Ql          , Xu          , Ww          , Ww          , Ch          , Ch          , Gg          , Rr          , Hh          , Gs^Fp       , Ww          , Wo          , Ww          , Ds          , Ww^Bw|      , Ww          , Ss          , Ss          , Xu          , _s          
_s          , Xu          , Ww          , Gs          , Gs^Ft       , Re          , Gg          , Gg          , Ww          , Ww^Bw/      , Rr          , Rr          , Rr          , Gg          , Gs^Fp       , Gg          , Gg          , Ww          , Xu          , Ql          , Xu          , Ql          , Xu          , Xu          , Xu          , Ql          , Xu          , Ql          , Xu          , Ww          , Gg          , Gg          , Hh          , Gg          , Rr          , Rr          , Ww          , Gs^Ft       , Ww          , Ww          , Ww          , Re          , Gs          , Ss^Vhs      , Ss          , Xu          , _s          
_s          , Xu          , Ww          , Dd          , Hd          , Md          , Re          , Re          , Re          , Ww          , Gg          , Gg          , Hh          , Gg          , Gg          , Ww          , Ww          , Xu          , Xu          , Xu          , Ql          , Xu          , Ql          , Xu          , Ql          , Xu          , Ql          , Xu          , Xu          , Xu          , Ww          , Ww          , Gg          , Gg          , Gs^Fp       , Ww          , Ww^Bw\      , Re          , Hh          , Gs          , Gs^Ft       , Re          , Hh          , Gs^Ft       , Ss          , Xu          , _s          
_s          , Xu          , Ww          , Dd          , Dd^Do       , Hd          , Gs^Ft       , Gg          , Gg          , Gs^Fp       , Wwf         , Gs^Fp       , Gg          , Ww          , Ww          , Xu          , Xu          , Ww          , Ww          , Ww          , Xu          , Xu          , Ql          , Ql          , Ql          , Xu          , Xu          , Ww          , Ww          , Ww          , Xu          , Xu          , Ww          , Ww          , Wwf         , Gg          , Ww          , Ww          , Re          , Re          , Re          , Gs          , Mm          , Gs          , Ss          , Xu          , _s          
_s          , Xu          , Ww          , Ww          , Dd          , Gs^Ft       , Gs          , Gg          , Hh          , Gg          , Ww          , Ww          , Ww          , Xu          , Xu          , Ww          , Ww          , Gg          , Gg          , Ww          , Wo          , Ww          , Xu          , Xu          , Xu          , Ww          , Wo          , Ww          , Gg          , Gg          , Ww          , Ww          , Xu          , Xu          , Ww          , Ww          , Gs^Fp       , Wwf         , Gs          , Gs^Vht      , Hh          , Gs          , Gs          , Ss          , Ss          , Xu          , _s          
_s          , _s          , Xu          , Xu          , Ww          , Ww          , Gs          , Gs^Fp       , Gg^Ve       , Ww          , Ww          , Xu          , Xu          , Ww          , Ww          , Gg          , Gg          , Hh          , Ch          , 6 Kh        , Ww          , Gg          , Ww          , Xu          , Ww          , Gg          , Ww          , 5 Kh        , Ch          , Gs^Fp       , Gg          , Gg          , Ww          , Ww          , Xu          , Xu          , Ww          , Ww          , Gs          , Gs^Ft       , Gs^Ft       , Ww          , Ww          , Xu          , Xu          , _s          , _s          
_s          , _s          , _s          , _s          , Xu          , Xu          , Ww          , Ww          , Ww          , Xu          , Xu          , Ww          , Ww          , Gg          , Wwf         , Gs^Fp       , Gg          , Gg          , Ch          , Ch          , Ch          , Gg          , Ww          , Xu          , Ww          , Gg          , Ch          , Ch          , Ch          , Gg          , Gg          , Hh          , Gg          , Gs^Fp       , Ww          , Ww          , Xu          , Xu          , Ww          , Ww          , Ww          , Xu          , Xu          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , Xu          , Xu          , Xu          , Ww          , Ww          , Wwf         , Gs^Fp       , Ww          , Ww          , Rr          , Rr          , Rr          , Rr          , Gg          , Gs^Fp       , Gg          , Ww          , Xu          , Ww          , Gg          , Hh          , Gg          , Rr          , Rr          , Rr          , Rr          , Gg          , Wwf         , Ww          , Gg          , Ww          , Ww          , Xu          , Xu          , Xu          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , Xu          , Ww          , Gs^Ft       , Gs          , Gs          , Ww          , Re          , Ww^Bw/      , Ww          , Hh          , Mm^Vhh      , Rr          , Rr          , Gg          , Gg          , Ww          , Xu          , Ww          , Gg          , Gg          , Rr          , Rr          , Mm^Vhh      , Gs^Fp       , Rr          , Gg          , Ww          , Gs^Fp       , Hh          , Gg^Ve       , Gs^Fp       , Ww          , Xu          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , Xu          , Ww          , Gs^Ft       , Gs^Vht      , Re          , Re          , Hh          , Gs^Ft       , Ww          , Gs^Fp       , Hh          , Gs^Fp       , Rr          , Hh          , Gg          , Ww          , Xu          , Ww          , Wwf         , Gs^Fp       , Rr          , Hh          , Gs^Fp       , Hh          , Ww          , Ww^Bw\      , Re          , Gg          , Gg          , Gg          , Gs          , Ww          , Xu          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , Xu          , Ww          , Gs          , Hh          , Re          , Gs          , Ww          , Ww          , Wo          , Ww          , Ww          , Rr          , Gg          , Gg          , Gs^Fp       , Ww          , Xu          , Ww          , Gg          , Ww          , Ww^Bw|      , Ww          , Ww          , Ww          , Wo          , Ww          , Gg          , Re          , Gs^Ft       , Gs          , Gs^Ft       , Ww          , Xu          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , Xu          , Ww          , Gs          , Gs          , Re          , Gs^Ft       , Ww          , Ww          , Ww          , Wo          , Ww          , Ww^Bw|      , Ww          , Wwf         , Ww          , Ww          , Xu          , Ww          , Gs^Fp       , Ww          , Re          , Gs^Ft       , Ww          , Wo          , Ww          , Ww^Vm       , Gg          , Re          , Md          , Hd          , Dd          , Ww          , Xu          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , Xu          , Ss          , Gs          , Mm          , Hh          , Re          , Ww^Bw\      , Ds          , Gg          , Ww^Vm       , Gg          , Re          , Gg          , Gs^Fp       , Gg          , Ww          , Xu          , Ww          , Wwf         , Ww          , Re          , Hh          , Ww          , Ww          , Ds          , Gg          , Re          , Re          , Hd          , Dd^Do       , Dd          , Ww          , Xu          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , Xu          , Ss          , Ss          , Gs^Ft       , Ss^Vhs      , Gs          , Ww          , Re          , Re          , Gg          , Re          , Re          , Gg          , Hh          , Gg^Ve       , Ww          , Xu          , Ww          , Gs          , Gs          , Re          , Gs          , Gs^Ft       , Ww          , Ww^Bw/      , Re          , Ds          , Gs^Ft       , Gs          , Dd          , Ww          , Ww          , Xu          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , Xu          , Xu          , Ss          , Ss          , Ss          , Ww          , Ds          , Gs^Ft       , Re          , Md          , Gs^Ft       , Gs          , Gg          , Gs^Fp       , Ww          , Xu          , Ww          , Gs^Ft       , Gs^Vht      , Hh          , Re          , Re          , Re          , Gs          , Ww          , Ww          , Ww          , Ww          , Ww          , Xu          , Xu          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , Xu          , Xu          , Ss          , Ss          , Ww          , Gs          , Hd          , Dd^Do       , Hd          , Gs^Ft       , Gs          , Ww          , Ww          , Xu          , Ww          , Ww          , Gs^Ft       , Gs          , Gs          , Mm          , Hh          , Ss^Vhs      , Ss          , Ss          , Ss          , Xu          , Xu          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , Xu          , Xu          , Ww          , Ww          , Dd          , Dd          , Dd          , Ww          , Ww          , Xu          , Xu          , _s          , Xu          , Xu          , Ww          , Ww          , Gs          , Gs          , Gs^Ft       , Ss          , Ss          , Xu          , Xu          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , Xu          , Xu          , Ww          , Ww          , Ww          , Xu          , Xu          , _s          , _s          , _s          , _s          , _s          , Xu          , Xu          , Ss          , Ss          , Ss          , Xu          , Xu          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , Xu          , Xu          , Xu          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , Xu          , Xu          , Xu          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
#enddef     
#define TS_WALL_MASK_NORTH
Ww          , Ww          , Ww          
Gs          , Ww          , Gg          
Ww          , Ww          , Gg          
Gg          , Gg          , Ww          
Mm          , Hh          , Gg          
Gs^Fp       , Gg          , Gg          
Ww          , Ww          , Gg          
Gg          , Wwf         , Gs^Fp       
Gg          , Wwf         , Gg          
Gs^Fp       , Ww          , Gg          
Ww          , Xu          , Ww          
#enddef     
#define TS_WALL_MASK_NORTH_EAST
_s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , Gs          , Ww          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , Gg          , Ww          , Ww          , Ww          , Ww          
_s          , _s          , _s          , _s          , _s          , Gs^Fp       , Mm          , Gg          , Ww          , Gg          , Gg          , _s          
_s          , _s          , _s          , Gg          , Ww          , Gg          , Hh          , Gg          , Ww          , _s          , _s          , _s          
_s          , Gs^Fp       , Gg          , Wwf         , Ww          , Gg          , Gg          , _s          , _s          , _s          , _s          , _s          
Ww          , Ww          , Wwf         , Gg          , Gs^Fp       , _s          , _s          , _s          , _s          , _s          , _s          , _s          
Xu          , Ww          , Gg          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
#enddef     
#define TS_WALL_MASK_NORTH_WEST
_s          , _s          , Ww          , Gg          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , Ww          , Ww          , Ww          , Gg          , Ww          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , Gs          , Ww          , Ww          , Gg          , Gg          , Gg          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , Gg          , Mm          , Hh          , Gg          , Gg          , Gs^Fp       , _s          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , Gs^Fp       , Ww          , Ww          , Wwf         , Gg          , Gg          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , Gg          , Gg          , Wwf         , Ww          , Ww          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , Gs^Fp       , Ww          , Xu          
#enddef     
#define TS_WALL_MASK_SOUTH
_s          , Xu          , _s          
Ww          , Ww          , Ww          
Gg          , Wwf         , Gs^Fp       
Gg          , Wwf         , Gg          
Gs^Fp       , Ww          , Gg          
Gg          , Gg          , Ww          
Gg          , Hh          , Gs^Fp       
Gg          , Gg          , Mm          
Ww          , Ww          , Gg          
Gg          , Ww          , Ww          
Gg          , Ww          , Gs          
Ww          , _s          , Ww          
#enddef     
#define TS_WALL_MASK_SOUTH_EAST
_s          , Ww          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
Xu          , Ww          , Gs^Fp       , Gg          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
Ww          , Gg          , Wwf         , Wwf         , Gg          , Ww          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , Gg          , Gs^Fp       , Ww          , Gg          , Gs^Fp       , Mm          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , _s          , Gg          , Gg          , Hh          , Gg          , Gg          , Ww          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , Gg          , Ww          , Ww          , Ww          , Gs          , Ww          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , Gg          , Gg          , Ww          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , Ww          , _s          
#enddef     
#define TS_WALL_MASK_SOUTH_WEST
_s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , Ww          , _s          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , Gg          , Gg          , Ww          , Xu          
_s          , _s          , _s          , _s          , _s          , _s          , _s          , Gg          , Gs^Fp       , Wwf         , Wwf         , Gs^Fp       , Ww          
_s          , _s          , _s          , _s          , _s          , Gg          , Gg          , Gg          , Ww          , Gg          , Gg          , _s          , _s          
_s          , _s          , _s          , Gg          , Ww          , Gg          , Hh          , Gs^Fp       , Ww          , _s          , _s          , _s          , _s          
_s          , Ww          , Gg          , Ww          , Ww          , Gg          , Mm          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , Ww          , Gs          , Ww          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , Ww          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          , _s          
#enddef     
#define TS_CASTLE_MASK
_s          , _s          , _s          , _s          , _s          , Gg          , _s          , _s          , _s          , Gg          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , Ch          , Ch          , Gs^Fp       , _s          , _s          , _s          , Gs^Fp       , Ch          , Ch          , _s          , _s          , _s          
_s          , _s          , Gg          , Gs^Fp       , Gg          , _s          , _s          , Ww          , _s          , _s          , Gg          , Gs^Fp       , Gg          , _s          , _s          
_s          , _s          , _s          , _s          , _s          , Gg          , Gs^Fp       , Hh          , Mm          , Gg          , _s          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , Ww          , Mm          , Gs^Fp       , Gg          , Ch          , Gs^Fp       , Gg          , Gs^Fp       , Ww          , _s          , _s          , _s          
Gg          , Gs^Fp       , _s          , Gs^Fp       , Hh          , Ch          , Ch          , Ch          , Ch          , Ch          , Hh          , Mm          , _s          , Gs^Fp       , Gg          
Ch          , Gg          , _s          , Gg          , Gg          , Ch          , Ch          , Kh          , Ch          , Ch          , Gs^Fp       , Gg          , _s          , Gg          , Ch          
Ch          , Gs^Fp       , _s          , Mm          , Gs^Fp       , Ch          , Ch          , Ch          , Ch          , Ch          , Gg          , Gs^Fp       , _s          , Gs^Fp       , Ch          
Gg          , _s          , _s          , Ww          , Hh          , Gg          , Ch          , Ch          , Ch          , Gs^Fp       , Hh          , Ww          , _s          , _s          , Gg          
_s          , _s          , _s          , _s          , Gs^Fp       , Gg          , Gs^Fp       , Hh          , Gg          , Gg          , Mm          , _s          , _s          , _s          , _s          
_s          , _s          , _s          , Gs^Fp       , _s          , _s          , Mm          , Ww          , Gs^Fp       , _s          , _s          , Gs^Fp       , _s          , _s          , _s          
_s          , _s          , Gg          , Ch          , Gg          , Gs^Fp       , _s          , _s          , _s          , Gs^Fp       , Gg          , Ch          , Gg          , _s          , _s          
_s          , _s          , _s          , _s          , Ch          , Gg          , _s          , _s          , _s          , Gg          , Ch          , _s          , _s          , _s          , _s          
#enddef     


#define TS_OPEN_MASK_NORTH_WEST
    _s,    _s,    _s,    _s,    _s
    _s,    _s,    _s,    Gg,    Ww
    _s,    Ww,    Hh,    _s,    _s
#enddef

#define TS_OPEN_MASK_NORTH_EAST
    Ww,    Hh,    _s,    _s
    _s,    _s,    Gg,    Ww
#enddef

#define TS_OPEN_MASK_EAST
    Ww
    Hh
    Gg
    Ww
#enddef

#define TS_OPEN_MASK_SOUTH_WEST
    _s,    _s,    _s,    _s,    _s
    _s,    Ww,    _s,    _s,    _s
    _s,    _s,    Gg,    Hh,    _s
    _s,    _s,    _s,    _s,    Ww
#enddef

#define TS_OPEN_MASK_SOUTH_EAST
    _s,    _s,    _s,    _s
    _s,    _s,    _s,    Ww
    _s,    Gg,    Hh,    _s
    Ww,    _s,    _s,    _s
#enddef

#define TS_OPEN_MASK_WEST
    Ww
    Gg
    Hh
    Ww
#enddef

#define TS_SET_LABELS
	{SET_LABEL_PERSISTANT 24 18 (_ "Turn 2: Loyalists")}
	{SET_LABEL_PERSISTANT 27 20 (_ "Turn 5: Knalgans")}
	{SET_LABEL_PERSISTANT 27 23 (_ "Turn 8: Rebels")}
	{SET_LABEL_PERSISTANT 24 24 (_ "Turn 11: Northerners")}
	{SET_LABEL_PERSISTANT 21 23 (_ "Turn 14: Drakes")}
	{SET_LABEL_PERSISTANT 21 20 (_ "Turn 17: Undead")}
	{SET_LABEL_PERSISTANT 24 21 (_ "Tower of Doom")}
#enddef

#define TS_OPEN_WALLS
	{EARTHQUAKE (
		{IF_ALLIED 7 2 ({MODIFY_TERRAIN_MASK 7 13 ("{TS_WALL_MASK_NORTH_WEST}") ()} )}
		{IF_ALLIED 2 3 ({MODIFY_TERRAIN_MASK 23 6 ("{TS_WALL_MASK_NORTH}") ()} )}
		{IF_ALLIED 3 4 ({MODIFY_TERRAIN_MASK 29 13 ("{TS_WALL_MASK_NORTH_EAST}") ()} )}
		{IF_ALLIED 4 5 ({MODIFY_TERRAIN_MASK 29 23 ("{TS_WALL_MASK_SOUTH_EAST}") ()} )}
		{IF_ALLIED 5 6 ({MODIFY_TERRAIN_MASK 23 26 ("{TS_WALL_MASK_SOUTH}") ()} )}
		{IF_ALLIED 6 7 ({MODIFY_TERRAIN_MASK 7 23 ("{TS_WALL_MASK_SOUTH_WEST}") ()} )}
	)}
#enddef

#define TS_BUILD_CASTLE
	{EARTHQUAKE ({MODIFY_TERRAIN_MASK 17 15 ("{TS_CASTLE_MASK}") ()})}
#enddef

#define TS_OPEN_CASTLE
	{EARTHQUAKE (
		{IF_ALIVE 2 ({MODIFY_TERRAIN_MASK 19 16 ("{TS_OPEN_MASK_NORTH_WEST}") ()} )}
		{IF_ALIVE 3 ({MODIFY_TERRAIN_MASK 25 17 ("{TS_OPEN_MASK_NORTH_EAST}") ()} )}
		{IF_ALIVE 4 ({MODIFY_TERRAIN_MASK 29 20 ("{TS_OPEN_MASK_EAST}") ()} )}
		{IF_ALIVE 5 ({MODIFY_TERRAIN_MASK 25 23 ("{TS_OPEN_MASK_SOUTH_EAST}") ()} )}
		{IF_ALIVE 6 ({MODIFY_TERRAIN_MASK 19 23 ("{TS_OPEN_MASK_SOUTH_WEST}") ()} )}
		{IF_ALIVE 7 ({MODIFY_TERRAIN_MASK 19 20 ("{TS_OPEN_MASK_WEST}") ()} )}
	)}
#enddef

#define TS_SPAWN1 UNIT
	{IF_ALIVE 2 ({CREATE_UNIT 1 ({UNIT}) 12 10 () ()})}
	{IF_ALIVE 3 ({CREATE_UNIT 1 ({UNIT}) 29 7 () ()})}
	{IF_ALIVE 4 ({CREATE_UNIT 1 ({UNIT}) 41 18 () ()})}
	{IF_ALIVE 5 ({CREATE_UNIT 1 ({UNIT}) 36 32 () ()})}
	{IF_ALIVE 6 ({CREATE_UNIT 1 ({UNIT}) 19 36 () ()})}
	{IF_ALIVE 7 ({CREATE_UNIT 1 ({UNIT}) 7 25 () ()})}
#enddef

#define TS_SPAWN2 UNIT
	{IF_ALIVE 2 ({CREATE_UNIT 1 ({UNIT}) 19 7 () ()})}
	{IF_ALIVE 3 ({CREATE_UNIT 1 ({UNIT}) 36 10 () ()})}
	{IF_ALIVE 4 ({CREATE_UNIT 1 ({UNIT}) 41 25 () ()})}
	{IF_ALIVE 5 ({CREATE_UNIT 1 ({UNIT}) 29 36 () ()})}
	{IF_ALIVE 6 ({CREATE_UNIT 1 ({UNIT}) 12 32 () ()})}
	{IF_ALIVE 7 ({CREATE_UNIT 1 ({UNIT}) 7 18 () ()})}
#enddef

#define TS_SWAMP_SPAWN UNIT
	{IF_ALIVE 2 ({CREATE_UNIT 1 ({UNIT}) 15 6 () ()})}
	{IF_ALIVE 3 ({CREATE_UNIT 1 ({UNIT}) 35 7 () ()})}
	{IF_ALIVE 4 ({CREATE_UNIT 1 ({UNIT}) 44 22 () ()})}
	{IF_ALIVE 5 ({CREATE_UNIT 1 ({UNIT}) 33 37 () ()})}
	{IF_ALIVE 6 ({CREATE_UNIT 1 ({UNIT}) 13 36 () ()})}
	{IF_ALIVE 7 ({CREATE_UNIT 1 ({UNIT}) 4 20 () ()})}
#enddef

#define TS_LAKE_SPAWN UNIT
	{IF_ALIVE 2 ({CREATE_UNIT 1 ({UNIT}) 17 10 () ()})}
	{IF_ALIVE 3 ({CREATE_UNIT 1 ({UNIT}) 32 10 () ()})}
	{IF_ALIVE 4 ({CREATE_UNIT 1 ({UNIT}) 39 22 () ()})}
	{IF_ALIVE 5 ({CREATE_UNIT 1 ({UNIT}) 31 33 () ()})}
	{IF_ALIVE 6 ({CREATE_UNIT 1 ({UNIT}) 16 32 () ()})}
	{IF_ALIVE 7 ({CREATE_UNIT 1 ({UNIT}) 9 21 () ()})}
#enddef

#define TS_HOME_SPAWN UNIT
	{IF_ALIVE 2 ({CREATE_UNIT 1 ({UNIT}) 18 12 () ()})}
	{IF_ALIVE 3 ({CREATE_UNIT 1 ({UNIT}) 30 12 () ()})}
	{IF_ALIVE 4 ({CREATE_UNIT 1 ({UNIT}) 36 21 () ()})}
	{IF_ALIVE 5 ({CREATE_UNIT 1 ({UNIT}) 30 30 () ()})}
	{IF_ALIVE 6 ({CREATE_UNIT 1 ({UNIT}) 18 13 () ()})}
	{IF_ALIVE 7 ({CREATE_UNIT 1 ({UNIT}) 12 21 () ()})}
#enddef

#define TS_SPAWNS
	{ON_TURN 2 (
		{TS_SPAWN1 "Footpad"}{TS_SPAWN1 "Peasant"}
		{TS_SPAWN2 "Bowman"}{TS_SPAWN2 "Cavalryman"}
	)}
	{ON_TURN 5 (
		{TS_SPAWN1 "Thief"}{TS_SPAWN1 "Poacher"}
		{TS_SPAWN2 "Dwarvish Guardsman"}{TS_SPAWN2 "Dwarvish Fighter"}
	)}
	{ON_TURN 8 (
		{TS_SPAWN1 "Elvish Archer"}{TS_SPAWN1 "Elvish Shaman"}
		{TS_LAKE_SPAWN "Merman Hunter"}
		{TS_SPAWN2 "Elvish Archer"}
	)}
	{ON_TURN 11 (
		{TS_SPAWN1 "Orcish Slayer"}
		{TS_LAKE_SPAWN "Naga Fighter"}
		{TS_SPAWN2 "Troll Hero"}{TS_SPAWN2 "Troll Whelp"}
	)}
	{ON_TURN 14 (
		{TS_SPAWN1 "Drake Warrior"}{TS_SPAWN1 "Drake Glider"}
		{TS_SPAWN2 "Fire Drake"}{TS_SPAWN2 "Drake Fighter"}
	)}
	{ON_TURN 17 (
		{TS_SPAWN1 "Death Knight"}{TS_SPAWN1 "Walking Corpse"}{TS_SPAWN1 "Walking Corpse"}{TS_SPAWN1 "Walking Corpse"}{TS_SPAWN1 "Vampire Bat"}
		{TS_SWAMP_SPAWN "Tentacle of the Deep"}
		{TS_SPAWN2 "Lich"}{TS_SPAWN2 "Walking Corpse"}{TS_SPAWN2 "Walking Corpse"}{TS_SPAWN2 "Walking Corpse"}{TS_SPAWN2 "Vampire Bat"}
	)}
	{ON_TURN 20 (
		{TS_SPAWN1 "Drake Enforcer"}
		{TS_LAKE_SPAWN "Mermaid Diviner"}{TS_LAKE_SPAWN "Merman Entangler"}
		{TS_SPAWN2 "Drake Enforcer"}
	)}
	{ON_TURN 23 (
		{TS_SPAWN1 "Dark Sorcerer"}
		{TS_LAKE_SPAWN "Shadow"}{TS_LAKE_SPAWN "Shadow"}{TS_LAKE_SPAWN "Shadow"}
		{TS_SPAWN2 "Dark Sorcerer"}
	)}
	{ON_TURN 26 (
		{TS_SPAWN1 "Goblin Rouser"}{TS_SPAWN1 "Goblin Spearman"}{TS_SPAWN1 "Goblin Spearman"}{TS_SPAWN1 "Goblin Spearman"}{TS_SPAWN1 "Goblin Spearman"}{TS_SPAWN1 "Goblin Spearman"}{TS_SPAWN1 "Goblin Spearman"}
		{TS_SWAMP_SPAWN "Cuttle Fish"}
		{TS_SPAWN2 "Goblin Rouser"}{TS_SPAWN2 "Goblin Spearman"}{TS_SPAWN2 "Goblin Spearman"}{TS_SPAWN2 "Goblin Spearman"}{TS_SPAWN2 "Goblin Spearman"}{TS_SPAWN2 "Goblin Spearman"}{TS_SPAWN2 "Goblin Spearman"}
	)}
#enddef

# Ends the game with the result RESULT (can be either victory or defeat)
# For example, we could win:
# {ENDGAME victory}
#
#define ENDGAME RESULT
	[endlevel]
		result={RESULT}
	[/endlevel]
#enddef

[multiplayer]
	id=multiplayer_6p_Team_Survival
	name= _ "6p - Team Survival"
	map_data="{TS_MAP_DATA}"

	description= _ "Scenario where the objective is to survive for as long as possible."
	experience_modifier=70
	turns=32
	turn_at=1
	victory_when_enemies_defeated=yes

	{ON_PRESTART (
		{SET_OBJECTIVES 0 (_ "Survive for 32 turns.") (_ "Hint: Learning the enemy spawnpoints and types helps alot.") (
			{VICTORY_CONDITION (_ "Survive all enemy attacks.")}
			{DEFEAT_CONDITION (_ "Death of your team leaders.")}
		)}
	)}
	{ON_START (
		{TS_SET_LABELS}
		{TS_OPEN_WALLS}
	)}

	{TS_SPAWNS}

	{ON_TURN 25 {TS_BUILD_CASTLE}}
	{ON_TURN 26 {TS_OPEN_CASTLE}}
	{ON_TURN 32 (
		{IF_ALIVE 2 ({ENDGAME victory})}
		{IF_ALIVE 3 ({ENDGAME victory})}
		{IF_ALIVE 4 ({ENDGAME victory})}
		{IF_ALIVE 5 ({ENDGAME victory})}
		{IF_ALIVE 6 ({ENDGAME victory})}
		{IF_ALIVE 7 ({ENDGAME victory})}
	)}

	{ON_VICTORY (
		{MESSAGE narrator (units/elves-wood/shyde.png) (Faery) (_ "Congratulations for surviving the map that so many people claim is impossible. Frankly, I haven't got a clue as to how you did it, so send me the replay by mail to: roze@roze.mine.nu. Thank You!")}
	)}
	{ON_DEFEAT (
		{MESSAGE narrator (units/undead/wraith.png) (Death) (_ "You have lost this game, but fear not. You can always try again. And again. And again. *Muahahaha*")}
	)}

	{DEFAULT_MUSIC_PLAYLIST}

	{DAWN}
	{MORNING}
	{AFTERNOON}
	{DUSK}
	{FIRST_WATCH}
	{SECOND_WATCH}

	{SIDE_COMPUTER 1 Attacker (_ "Attacker") 1000 47 () (
		leader_value=7.0
		aggression=0.95
	)}
	{SIDE_PLAYER 2 Defenders (_ "Defender") 125 -2 ()}
	{SIDE_PLAYER 3 Defenders (_ "Defender") 125 -2 ()}
	{SIDE_PLAYER 4 Defenders (_ "Defender") 125 -2 ()}
	{SIDE_PLAYER 5 Defenders (_ "Defender") 125 -2 ()}
	{SIDE_PLAYER 6 Defenders (_ "Defender") 125 -2 ()}
	{SIDE_PLAYER 7 Defenders (_ "Defender") 125 -2 ()}

[/multiplayer]

#undef TS_MAP_DATA
#undef TS_WALL_MASK_NORTH
#undef TS_WALL_MASK_NORTH_EAST
#undef TS_WALL_MASK_NORTH_WEST
#undef TS_WALL_MASK_SOUTH
#undef TS_WALL_MASK_SOUTH_EAST
#undef TS_WALL_MASK_SOUTH_WEST
#undef TS_CASTLE_MASK
#undef TS_OPEN_MASK_NORTH_WEST
#undef TS_OPEN_MASK_NORTH_EAST
#undef TS_OPEN_MASK_EAST
#undef TS_OPEN_MASK_SOUTH_WEST
#undef TS_OPEN_MASK_SOUTH_EAST
#undef TS_OPEN_MASK_WEST
#undef TS_SET_LABELS
#undef TS_OPEN_WALLS
#undef TS_BUILD_CASTLE
#undef TS_OPEN_CASTLE
#undef TS_SPAWN1
#undef TS_SPAWN2
#undef TS_SWAMP_SPAWN
#undef TS_LAKE_SPAWN
#undef TS_HOME_SPAWN
#undef TS_SPAWNS
