From 96700c59e1d02beb4ebdc68bf6908f2b88a1463f Mon Sep 17 00:00:00 2001 From: Joe R Date: Sat, 16 Mar 2024 20:38:47 -0400 Subject: [PATCH] Cleanup of Mahjongg. Fixed the old layout import scripts. --- pysollib/gamedb.py | 8 +-- pysollib/games/mahjongg/mahjongg1.py | 6 +-- pysollib/games/mahjongg/mahjongg2.py | 4 +- pysollib/games/mahjongg/mahjongg3.py | 73 ++++++++++++++++++++++++++++ pysollib/games/mahjongg/mahjonggL.py | 44 +++++++++-------- scripts/mahjongg_utils.py | 2 +- 6 files changed, 106 insertions(+), 31 deletions(-) diff --git a/pysollib/gamedb.py b/pysollib/gamedb.py index 1f699356..42de65be 100644 --- a/pysollib/gamedb.py +++ b/pysollib/gamedb.py @@ -598,10 +598,10 @@ class GI: ('fc-2.20', tuple(range(855, 897))), ('fc-2.21', tuple(range(897, 900)) + tuple(range(11014, 11017)) + tuple(range(13160, 13163)) + (16682,)), - ('dev', tuple(range(906, 959)) + tuple(range(11017, 11020)) + - tuple(range(5600, 5624)) + tuple(range(18000, 18005)) + - tuple(range(19000, 19012)) + tuple(range(22303, 22311)) + - tuple(range(22353, 22361))), + ('dev', tuple(range(906, 959)) + tuple(range(5415, 5419)) + + tuple(range(5600, 5624)) + tuple(range(11017, 11020)) + + tuple(range(18000, 18005)) + tuple(range(19000, 19012)) + + tuple(range(22303, 22311)) + tuple(range(22353, 22361))), ) # deprecated - the correct way is to or a GI.GT_XXX flag diff --git a/pysollib/games/mahjongg/mahjongg1.py b/pysollib/games/mahjongg/mahjongg1.py index bd2ee70c..de3efd28 100644 --- a/pysollib/games/mahjongg/mahjongg1.py +++ b/pysollib/games/mahjongg/mahjongg1.py @@ -160,7 +160,7 @@ r(5007, "Bat", layout="0ecaeAaaabalbanb" + "hobhodhofhaghCgh" + "aihCi") # -r(5008, "Beatle", layout="0aeaagaauaawaaic" + +r(5008, "Beetle", layout="0aeaagaauaawaaic" + "akcamcaocaqcasca" + "eeageaieakeameao" + "eaqeaseaueadgafg" + @@ -1027,7 +1027,7 @@ r(5060, "N for Namida", layout="0caaccaceacgacqa" + "comcqmcsmcum") # -r(5063, "New Layout 1", layout="0aeaagaaiaakabpa" + +r(5063, "Temple 1", layout="0aeaagaaiaakabpa" + "auaawaayaaAaacca" + "Ccahdajdavdaxdaa" + "eacealeateaCeaEe" + @@ -1406,7 +1406,7 @@ r(5083, "Sun and Moon", layout="0dgaciabkaamabya" + "enbBndgociobkoam" + "obuovaevagvaivak" + "Ckh") -r(5084, "Temple 1", layout="0baaacaaeaalaana" + +r(5084, "Temple 2", layout="0baaacaaeaalaana" + "apaaraataaAaaCab" + "Eaaacaccalcbncbp" + "cbrcatcaCcaEcajd" + diff --git a/pysollib/games/mahjongg/mahjongg2.py b/pysollib/games/mahjongg/mahjongg2.py index 063117ec..1476bcb3 100644 --- a/pysollib/games/mahjongg/mahjongg2.py +++ b/pysollib/games/mahjongg/mahjongg2.py @@ -1245,7 +1245,7 @@ r(5267, "Sukis", layout="0aaaaacaaeaagaai" + "GgaGiaGkaGmaGoaG" + "q") # -r(5268, "Temple 2", layout="0aaaaaeaaiabchbd" + +r(5268, "Temple 3", layout="0aaaaaeaaiabchbd" + "abghbhacahcbocca" + "cehcfocgaciadchd" + "dodeadghdhaeaheb" + @@ -1273,7 +1273,7 @@ r(5268, "Temple 2", layout="0aaaaaeaaiabchbd" + "ougauiavchvdavgh" + "vhawaaweawi") # -r(5269, "Temple 3", layout="0aacaagaakabahbb" + +r(5269, "Temple 4", layout="0aacaagaakabahbb" + "abehbfabihbjacco" + "cchcdacgocghchac" + "kadahdbadeodehdf" + diff --git a/pysollib/games/mahjongg/mahjongg3.py b/pysollib/games/mahjongg/mahjongg3.py index 29dfdd25..82e2de29 100644 --- a/pysollib/games/mahjongg/mahjongg3.py +++ b/pysollib/games/mahjongg/mahjongg3.py @@ -284,7 +284,80 @@ r(5414, "Bridge 2", layout="0daadacdaedagdai" + "cyicykcymdAadAcd" + "AedAgdAidAkdAmdA" + "o") +r(5415, "Spider", layout="0aaebcfaclacqbea" + + "begbelbeqbgabghb" + + "glbgqbibbidbihbi" + + "lbipbkdbkhbklbko" + + "alfaljhmgamhhmih" + + "mkamlbmnampbnban" + + "fanjonjonlaodhog" + + "aohoohhoihokaolh" + + "omaonoonhooaopao" + + "rhpeapfapjopjvpk" + + "oplhpqaptaqdhqga" + + "qhoqhhqihqkaqlhq" + + "maqnoqnhqoaqpaqr" + + "brbarfarjorjorlh" + + "sgashhsihskaslbs" + + "naspatfatjbudbuh" + + "bulbuobwbbwdbwhb" + + "wlbwpbyabyhbylby" + + "qbAabAgbAlbAqbCf" + + "aClaCqaEe") +r(5416, "Waves", layout="0eafeahabmacadcf" + + "dchadmaeacefcehh" + + "emhfaafmagacgfcg" + + "higmihaahmaiabif" + + "bihiimijaajmakab" + + "kfbkhikmilaalmam" + + "aamfamhhmmhnaanm" + + "aoaaofaohapmaqab" + + "qfbqharmasabsfbs" + + "hatmauacufcuhhum" + + "hvaavmawacwfcwhi" + + "wmixaaxmayadyfdy" + + "hiymizaazmaAaeAf" + + "eAhiAmiBaaBmaCah" + + "CmhDaaDmaEaaFmaG" + + "a") +r(5417, "Hot Coffee", layout="0aarbcradfadhadj" + + "adlaeaaencerbffb" + + "fhbfjbflafpagbbg" + + "ndgrchfchhchjchl" + + "bhpcindircjfcjhc" + + "jjcjlcjpCjrckndk" + + "ralaclfclhcljcll" + + "clpClrcmndmranbc" + + "nfcnhcnjcnlbnpbo" + + "ndorbpfbphbpjbpl" + + "appaqncqrarfarha" + + "rjarlbsratgatlau" + + "ravgavlaxhaxjaxl") +r(5418, "Zigzag", layout="0aabaajaaracahcb" + + "accacihcjackacqh" + + "cracsaebiecaedae" + + "hieiaejvejiekael" + + "aepieqaeragcigda" + + "gehgfaggighagihg" + + "jagkiglagmhgnago" + + "igpagqaidiieaifv" + + "ifiigaihailiimai" + + "nviniioaipakehkf" + + "akgakmhknakoamfa" + + "mnaqbaqjaqrasahs" + + "bascasihsjaskasq" + + "hsrassaubiucauda" + + "uhiuiaujvujiukau" + + "laupiuqaurawciwd" + + "awehwfawgiwhawih" + + "wjawkiwlawmhwnaw" + + "oiwpawqaydiyeayf" + + "vyfiygayhayliyma" + + "ynvyniyoaypaAehA" + + "faAgaAmhAnaAoaCa" + + "aCfaCnaCs") +# ---------------------------------------------------------------------- r(5801, "Faro", name="Double Mahjongg Faro", ncards=288, layout="0aaaha" + "baachadaae" + diff --git a/pysollib/games/mahjongg/mahjonggL.py b/pysollib/games/mahjongg/mahjonggL.py index 7afbad57..d9740438 100644 --- a/pysollib/games/mahjongg/mahjonggL.py +++ b/pysollib/games/mahjongg/mahjonggL.py @@ -325,27 +325,29 @@ r(5613, "Lion 2", layout="0aapabiablhbphcf" + "hDeaDgaDohEgaEia" + "EmhEohFiaFkhFmhG" + "k") -r(5614, "New Layout 2", layout="0CabCadCafacapca" + - "hccvccacepcehcgv" + - "cgheaveaaecpeche" + - "eveeaegpegCfaCfc" + - "CfeCfgagapgahgcv" + - "gcagepgehggvggCh" + - "aChcCheChghiavia" + - "aicpichievieaigp" + - "igakaqkahkcwkcak" + - "eqkehkgwkghmawma" + - "amcqmchmewmeamgq" + - "mgaoaqoahocwocao" + - "eqoehogwoghqavqa" + - "aqcpqchqevqeaqgp" + - "qgCraCrcCreCrgas" + - "apsahscvscasepse" + - "hsgvsgCtaCtcCteC" + - "tghuavuaaucpuchu" + - "evueaugpugawapwa" + - "hwcvwcawepwehwgv" + - "wgCybCydCyf") +# Contains floating tiles, so a usable tile may not be visible. +# Unplayable without serious work. +# r(5614, "New Layout 2", layout="0CabCadCafacapca" + +# "hccvccacepcehcgv" + +# "cgheaveaaecpeche" + +# "eveeaegpegCfaCfc" + +# "CfeCfgagapgahgcv" + +# "gcagepgehggvggCh" + +# "aChcCheChghiavia" + +# "aicpichievieaigp" + +# "igakaqkahkcwkcak" + +# "eqkehkgwkghmawma" + +# "amcqmchmewmeamgq" + +# "mgaoaqoahocwocao" + +# "eqoehogwoghqavqa" + +# "aqcpqchqevqeaqgp" + +# "qgCraCrcCreCrgas" + +# "apsahscvscasepse" + +# "hsgvsgCtaCtcCteC" + +# "tghuavuaaucpuchu" + +# "evueaugpugawapwa" + +# "hwcvwcawepwehwgv" + +# "wgCybCydCyf") r(5615, "Big X", layout="0aacaamhbchbmacb" + "occacdaclocmacnh" + "dbhddhdlhdnaeaae" + diff --git a/scripts/mahjongg_utils.py b/scripts/mahjongg_utils.py index d291ae3f..18dc38f7 100755 --- a/scripts/mahjongg_utils.py +++ b/scripts/mahjongg_utils.py @@ -18,7 +18,7 @@ def decode_layout(layout): tx = alpha.find(layout[i+1]) ty = alpha.find(layout[i+2]) assert n >= 0 and tx >= 0 and ty >= 0 - for tl in range(level, level + height): + for tl in range(int(level), int(level) + int(height)): tiles.append((tl, tx, ty)) tiles.sort() return tiles