@gamepark/mythologies 0.9.3 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CustomMoveType.d.ts +14 -14
- package/dist/CustomMoveType.js +11 -14
- package/dist/Memory.d.ts +14 -14
- package/dist/Memory.js +15 -18
- package/dist/MythologiesOptions.d.ts +12 -12
- package/dist/MythologiesOptions.js +22 -25
- package/dist/MythologiesRules.d.ts +158 -158
- package/dist/MythologiesRules.js +216 -244
- package/dist/MythologiesSetup.d.ts +17 -17
- package/dist/MythologiesSetup.js +84 -161
- package/dist/PlayerColor.d.ts +10 -10
- package/dist/PlayerColor.js +7 -10
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -9
- package/dist/material/Destiny.d.ts +15 -15
- package/dist/material/Destiny.js +91 -130
- package/dist/material/Entity.d.ts +102 -102
- package/dist/material/Entity.js +92 -99
- package/dist/material/LocationType.d.ts +28 -28
- package/dist/material/LocationType.js +29 -33
- package/dist/material/MaterialType.d.ts +13 -13
- package/dist/material/MaterialType.js +14 -17
- package/dist/material/Mythology.d.ts +18 -18
- package/dist/material/Mythology.js +16 -19
- package/dist/material/Pantheon.d.ts +50 -51
- package/dist/material/Pantheon.js +294 -486
- package/dist/material/Trial.d.ts +22 -22
- package/dist/material/Trial.js +139 -183
- package/dist/material/entity/AutoEffectRule.d.ts +11 -11
- package/dist/material/entity/AutoEffectRule.js +16 -49
- package/dist/material/entity/Effect.d.ts +106 -104
- package/dist/material/entity/Effect.js +26 -44
- package/dist/material/entity/EntityDescription.d.ts +13 -13
- package/dist/material/entity/EntityDescription.js +165 -170
- package/dist/material/entity/MoveEffectRule.d.ts +18 -18
- package/dist/material/entity/MoveEffectRule.js +73 -129
- package/dist/material/entity/PlaceCardEffectRule.d.ts +15 -15
- package/dist/material/entity/PlaceCardEffectRule.js +43 -78
- package/dist/material/entity/PlayerEffectRule.d.ts +14 -14
- package/dist/material/entity/PlayerEffectRule.js +36 -63
- package/dist/material/entity/SacrificeEffectRule.d.ts +11 -11
- package/dist/material/entity/SacrificeEffectRule.js +40 -64
- package/dist/material/entity/SimultaneousEffectRule.d.ts +18 -18
- package/dist/material/entity/SimultaneousEffectRule.js +64 -149
- package/dist/material/entity/SimultaneousMoveEffectRule.d.ts +17 -17
- package/dist/material/entity/SimultaneousMoveEffectRule.js +65 -141
- package/dist/material/entity/SimultaneousSacrificeEffectRule.d.ts +10 -10
- package/dist/material/entity/SimultaneousSacrificeEffectRule.js +31 -55
- package/dist/material/entity/celtic/Banshee.d.ts +2 -2
- package/dist/material/entity/celtic/Banshee.js +23 -46
- package/dist/material/entity/celtic/Brigid.d.ts +2 -2
- package/dist/material/entity/celtic/Brigid.js +17 -40
- package/dist/material/entity/celtic/Cernunnos.d.ts +2 -2
- package/dist/material/entity/celtic/Cernunnos.js +19 -43
- package/dist/material/entity/celtic/Dagda.d.ts +2 -2
- package/dist/material/entity/celtic/Dagda.js +26 -50
- package/dist/material/entity/celtic/Dullahan.d.ts +2 -2
- package/dist/material/entity/celtic/Dullahan.js +9 -12
- package/dist/material/entity/celtic/Fairy.d.ts +2 -2
- package/dist/material/entity/celtic/Fairy.js +9 -12
- package/dist/material/entity/celtic/Kelpie.d.ts +2 -2
- package/dist/material/entity/celtic/Kelpie.js +16 -39
- package/dist/material/entity/celtic/Leprechaun.d.ts +2 -2
- package/dist/material/entity/celtic/Leprechaun.js +9 -12
- package/dist/material/entity/celtic/Morrigan.d.ts +2 -2
- package/dist/material/entity/celtic/Morrigan.js +8 -11
- package/dist/material/entity/celtic/Selkie.d.ts +2 -2
- package/dist/material/entity/celtic/Selkie.js +14 -17
- package/dist/material/entity/chinese/ChangE.d.ts +2 -2
- package/dist/material/entity/chinese/ChangE.js +6 -9
- package/dist/material/entity/chinese/Fenghuang.d.ts +2 -2
- package/dist/material/entity/chinese/Fenghuang.js +10 -15
- package/dist/material/entity/chinese/Jiangshi.d.ts +2 -2
- package/dist/material/entity/chinese/Jiangshi.js +9 -12
- package/dist/material/entity/chinese/Mogwai.d.ts +2 -2
- package/dist/material/entity/chinese/Mogwai.js +18 -44
- package/dist/material/entity/chinese/Nian.d.ts +2 -2
- package/dist/material/entity/chinese/Nian.js +19 -42
- package/dist/material/entity/chinese/Nuwa.d.ts +2 -2
- package/dist/material/entity/chinese/Nuwa.js +9 -12
- package/dist/material/entity/chinese/Qilin.d.ts +2 -2
- package/dist/material/entity/chinese/Qilin.js +9 -12
- package/dist/material/entity/chinese/SunWukong.d.ts +2 -2
- package/dist/material/entity/chinese/SunWukong.js +17 -43
- package/dist/material/entity/chinese/Tianlong.d.ts +2 -2
- package/dist/material/entity/chinese/Tianlong.js +9 -12
- package/dist/material/entity/chinese/YanluoWang.d.ts +2 -2
- package/dist/material/entity/chinese/YanluoWang.js +9 -12
- package/dist/material/entity/egyptian/Ammit.d.ts +2 -2
- package/dist/material/entity/egyptian/Ammit.js +9 -12
- package/dist/material/entity/egyptian/Anubis.d.ts +2 -2
- package/dist/material/entity/egyptian/Anubis.js +9 -12
- package/dist/material/entity/egyptian/Beetle.d.ts +2 -2
- package/dist/material/entity/egyptian/Beetle.js +20 -43
- package/dist/material/entity/egyptian/Bennu.d.ts +2 -2
- package/dist/material/entity/egyptian/Bennu.js +9 -12
- package/dist/material/entity/egyptian/Cobra.d.ts +2 -2
- package/dist/material/entity/egyptian/Cobra.js +9 -12
- package/dist/material/entity/egyptian/Isis.d.ts +2 -2
- package/dist/material/entity/egyptian/Isis.js +15 -41
- package/dist/material/entity/egyptian/Mummy.d.ts +2 -2
- package/dist/material/entity/egyptian/Mummy.js +17 -40
- package/dist/material/entity/egyptian/Osiris.d.ts +2 -2
- package/dist/material/entity/egyptian/Osiris.js +24 -72
- package/dist/material/entity/egyptian/Ra.d.ts +2 -2
- package/dist/material/entity/egyptian/Ra.js +9 -12
- package/dist/material/entity/egyptian/Sphinx.d.ts +2 -2
- package/dist/material/entity/egyptian/Sphinx.js +9 -12
- package/dist/material/entity/greek/Athena.d.ts +2 -2
- package/dist/material/entity/greek/Athena.js +9 -12
- package/dist/material/entity/greek/Centaur.d.ts +2 -2
- package/dist/material/entity/greek/Centaur.js +9 -12
- package/dist/material/entity/greek/Chimera.d.ts +2 -2
- package/dist/material/entity/greek/Chimera.js +9 -12
- package/dist/material/entity/greek/Cyclops.d.ts +2 -2
- package/dist/material/entity/greek/Cyclops.js +15 -19
- package/dist/material/entity/greek/Gorgon.d.ts +2 -2
- package/dist/material/entity/greek/Gorgon.js +9 -12
- package/dist/material/entity/greek/Griffin.d.ts +2 -2
- package/dist/material/entity/greek/Griffin.js +9 -12
- package/dist/material/entity/greek/Hades.d.ts +2 -2
- package/dist/material/entity/greek/Hades.js +9 -12
- package/dist/material/entity/greek/Minotaur.d.ts +2 -2
- package/dist/material/entity/greek/Minotaur.js +9 -12
- package/dist/material/entity/greek/Poseidon.d.ts +2 -2
- package/dist/material/entity/greek/Poseidon.js +20 -46
- package/dist/material/entity/greek/Zeus.d.ts +2 -2
- package/dist/material/entity/greek/Zeus.js +17 -40
- package/dist/material/entity/hindu/Asura.d.ts +2 -2
- package/dist/material/entity/hindu/Asura.js +19 -67
- package/dist/material/entity/hindu/Brahma.d.ts +2 -2
- package/dist/material/entity/hindu/Brahma.js +14 -37
- package/dist/material/entity/hindu/Ganesh.d.ts +2 -2
- package/dist/material/entity/hindu/Ganesh.js +18 -41
- package/dist/material/entity/hindu/Garuda.d.ts +2 -2
- package/dist/material/entity/hindu/Garuda.js +9 -12
- package/dist/material/entity/hindu/Kinnara.d.ts +2 -2
- package/dist/material/entity/hindu/Kinnara.js +9 -12
- package/dist/material/entity/hindu/Naga.d.ts +2 -2
- package/dist/material/entity/hindu/Naga.js +29 -75
- package/dist/material/entity/hindu/Rakshasa.d.ts +2 -2
- package/dist/material/entity/hindu/Rakshasa.js +9 -12
- package/dist/material/entity/hindu/Shiva.d.ts +2 -2
- package/dist/material/entity/hindu/Shiva.js +9 -12
- package/dist/material/entity/hindu/Vetala.d.ts +2 -2
- package/dist/material/entity/hindu/Vetala.js +9 -12
- package/dist/material/entity/hindu/Vishnu.d.ts +2 -2
- package/dist/material/entity/hindu/Vishnu.js +20 -68
- package/dist/material/entity/inca/Amaru.d.ts +2 -2
- package/dist/material/entity/inca/Amaru.js +15 -38
- package/dist/material/entity/inca/Caiman.d.ts +2 -2
- package/dist/material/entity/inca/Caiman.js +9 -12
- package/dist/material/entity/inca/Condor.d.ts +2 -2
- package/dist/material/entity/inca/Condor.js +9 -12
- package/dist/material/entity/inca/Illapa.d.ts +2 -2
- package/dist/material/entity/inca/Illapa.js +9 -12
- package/dist/material/entity/inca/Inti.d.ts +2 -2
- package/dist/material/entity/inca/Inti.js +16 -39
- package/dist/material/entity/inca/MamaQucha.d.ts +2 -2
- package/dist/material/entity/inca/MamaQucha.js +20 -43
- package/dist/material/entity/inca/Puma.d.ts +2 -2
- package/dist/material/entity/inca/Puma.js +14 -40
- package/dist/material/entity/inca/Supay.d.ts +2 -2
- package/dist/material/entity/inca/Supay.js +9 -12
- package/dist/material/entity/inca/Ukuku.d.ts +2 -2
- package/dist/material/entity/inca/Ukuku.js +14 -18
- package/dist/material/entity/inca/Viracocha.d.ts +2 -2
- package/dist/material/entity/inca/Viracocha.js +9 -12
- package/dist/material/entity/norse/Alf.d.ts +2 -2
- package/dist/material/entity/norse/Alf.js +9 -12
- package/dist/material/entity/norse/Draugr.d.ts +2 -2
- package/dist/material/entity/norse/Draugr.js +9 -12
- package/dist/material/entity/norse/Fenrir.d.ts +2 -2
- package/dist/material/entity/norse/Fenrir.js +9 -12
- package/dist/material/entity/norse/Freya.d.ts +2 -2
- package/dist/material/entity/norse/Freya.js +17 -40
- package/dist/material/entity/norse/Jotunn.d.ts +2 -2
- package/dist/material/entity/norse/Jotunn.js +15 -38
- package/dist/material/entity/norse/Loki.d.ts +2 -2
- package/dist/material/entity/norse/Loki.js +14 -37
- package/dist/material/entity/norse/Odin.d.ts +2 -2
- package/dist/material/entity/norse/Odin.js +3 -6
- package/dist/material/entity/norse/Thor.d.ts +2 -2
- package/dist/material/entity/norse/Thor.js +9 -12
- package/dist/material/entity/norse/Troll.d.ts +2 -2
- package/dist/material/entity/norse/Troll.js +6 -9
- package/dist/material/entity/norse/Valkyrie.d.ts +2 -2
- package/dist/material/entity/norse/Valkyrie.js +27 -73
- package/dist/material/entity/zulu/Idlozi.d.ts +2 -2
- package/dist/material/entity/zulu/Idlozi.js +9 -12
- package/dist/material/entity/zulu/Impundulu.d.ts +2 -2
- package/dist/material/entity/zulu/Impundulu.js +9 -12
- package/dist/material/entity/zulu/Inkanyamba.d.ts +2 -2
- package/dist/material/entity/zulu/Inkanyamba.js +16 -42
- package/dist/material/entity/zulu/Inkosazana.d.ts +2 -2
- package/dist/material/entity/zulu/Inkosazana.js +9 -12
- package/dist/material/entity/zulu/Shembe.d.ts +2 -2
- package/dist/material/entity/zulu/Shembe.js +19 -44
- package/dist/material/entity/zulu/Tokoloshe.d.ts +2 -2
- package/dist/material/entity/zulu/Tokoloshe.js +24 -47
- package/dist/material/entity/zulu/Umvelinqangi.d.ts +2 -2
- package/dist/material/entity/zulu/Umvelinqangi.js +22 -45
- package/dist/material/entity/zulu/Unkulunkulu.d.ts +2 -2
- package/dist/material/entity/zulu/Unkulunkulu.js +20 -43
- package/dist/material/entity/zulu/Unwabu.d.ts +2 -2
- package/dist/material/entity/zulu/Unwabu.js +25 -49
- package/dist/material/entity/zulu/Werehyena.d.ts +2 -2
- package/dist/material/entity/zulu/Werehyena.js +9 -12
- package/dist/rules/ChooseDraftTokenRule.d.ts +15 -15
- package/dist/rules/ChooseDraftTokenRule.js +54 -103
- package/dist/rules/DrawDestinyCardRule.d.ts +7 -7
- package/dist/rules/DrawDestinyCardRule.js +44 -115
- package/dist/rules/EndGameRule.d.ts +5 -5
- package/dist/rules/EndGameRule.js +34 -105
- package/dist/rules/PlaceCardsRule.d.ts +14 -14
- package/dist/rules/PlaceCardsRule.js +107 -206
- package/dist/rules/PlaceTokenRule.d.ts +12 -12
- package/dist/rules/PlaceTokenRule.js +75 -151
- package/dist/rules/RuleId.d.ts +65 -65
- package/dist/rules/RuleId.js +66 -69
- package/dist/rules/UpkeepRule.d.ts +9 -9
- package/dist/rules/UpkeepRule.js +56 -154
- package/dist/rules/effects/AlfEffectRule.d.ts +10 -10
- package/dist/rules/effects/AlfEffectRule.js +33 -59
- package/dist/rules/effects/AmmitEffectRule.d.ts +6 -6
- package/dist/rules/effects/AmmitEffectRule.js +15 -40
- package/dist/rules/effects/AnubisEffectRule.d.ts +9 -9
- package/dist/rules/effects/AnubisEffectRule.js +24 -49
- package/dist/rules/effects/AthenaEffectRule.d.ts +10 -10
- package/dist/rules/effects/AthenaEffectRule.js +48 -150
- package/dist/rules/effects/BennuEffectRule.d.ts +6 -6
- package/dist/rules/effects/BennuEffectRule.js +10 -35
- package/dist/rules/effects/CaimanEffectRule.d.ts +7 -7
- package/dist/rules/effects/CaimanEffectRule.js +23 -72
- package/dist/rules/effects/CentaurEffectRule.d.ts +15 -15
- package/dist/rules/effects/CentaurEffectRule.js +36 -95
- package/dist/rules/effects/ChimeraEffectRule.d.ts +8 -9
- package/dist/rules/effects/ChimeraEffectRule.js +15 -44
- package/dist/rules/effects/CobraEffectRule.d.ts +13 -13
- package/dist/rules/effects/CobraEffectRule.js +30 -61
- package/dist/rules/effects/CondorEffectRule.d.ts +8 -8
- package/dist/rules/effects/CondorEffectRule.js +20 -45
- package/dist/rules/effects/CyclopsEffectRule.d.ts +11 -11
- package/dist/rules/effects/CyclopsEffectRule.js +50 -106
- package/dist/rules/effects/DraugrEffectRule.d.ts +11 -12
- package/dist/rules/effects/DraugrEffectRule.js +32 -63
- package/dist/rules/effects/DullahanEffectRule.d.ts +11 -11
- package/dist/rules/effects/DullahanEffectRule.js +48 -73
- package/dist/rules/effects/FairyEffectRule.d.ts +10 -10
- package/dist/rules/effects/FairyEffectRule.js +33 -55
- package/dist/rules/effects/FenghuangEffectRule.d.ts +8 -8
- package/dist/rules/effects/FenghuangEffectRule.js +18 -48
- package/dist/rules/effects/FenrirEffectRule.d.ts +16 -16
- package/dist/rules/effects/FenrirEffectRule.js +85 -139
- package/dist/rules/effects/GarudaEffectRule.d.ts +16 -16
- package/dist/rules/effects/GarudaEffectRule.js +55 -113
- package/dist/rules/effects/GorgonEffectRule.d.ts +7 -7
- package/dist/rules/effects/GorgonEffectRule.js +15 -40
- package/dist/rules/effects/GriffinEffectRule.d.ts +9 -9
- package/dist/rules/effects/GriffinEffectRule.js +16 -41
- package/dist/rules/effects/HadesEffectRule.d.ts +9 -9
- package/dist/rules/effects/HadesEffectRule.js +14 -39
- package/dist/rules/effects/IdloziEffectRule.d.ts +9 -9
- package/dist/rules/effects/IdloziEffectRule.js +21 -46
- package/dist/rules/effects/IllapaEffectRule.d.ts +16 -16
- package/dist/rules/effects/IllapaEffectRule.js +43 -76
- package/dist/rules/effects/ImpunduluEffectRule.d.ts +10 -11
- package/dist/rules/effects/ImpunduluEffectRule.js +39 -81
- package/dist/rules/effects/InkosazanaEffectRule.d.ts +7 -7
- package/dist/rules/effects/InkosazanaEffectRule.js +21 -46
- package/dist/rules/effects/JiangshiEffectRule.d.ts +8 -8
- package/dist/rules/effects/JiangshiEffectRule.js +25 -51
- package/dist/rules/effects/KinnaraEffectRule.d.ts +13 -13
- package/dist/rules/effects/KinnaraEffectRule.js +42 -95
- package/dist/rules/effects/LeprechaunEffectRule.d.ts +9 -9
- package/dist/rules/effects/LeprechaunEffectRule.js +23 -49
- package/dist/rules/effects/MinotaurEffectRule.d.ts +11 -11
- package/dist/rules/effects/MinotaurEffectRule.js +23 -49
- package/dist/rules/effects/MultipleSimultaneousMoveEffectRule.d.ts +14 -13
- package/dist/rules/effects/MultipleSimultaneousMoveEffectRule.js +71 -125
- package/dist/rules/effects/NuwaEffectRule.d.ts +14 -14
- package/dist/rules/effects/NuwaEffectRule.js +57 -106
- package/dist/rules/effects/OdinEffectRule.d.ts +11 -11
- package/dist/rules/effects/OdinEffectRule.js +27 -52
- package/dist/rules/effects/PermanentEffectsRule.d.ts +7 -7
- package/dist/rules/effects/PermanentEffectsRule.js +21 -54
- package/dist/rules/effects/QilinEffectRule.d.ts +8 -8
- package/dist/rules/effects/QilinEffectRule.js +40 -115
- package/dist/rules/effects/RaEffectRule.d.ts +9 -9
- package/dist/rules/effects/RaEffectRule.js +14 -39
- package/dist/rules/effects/RakshasaEffectRule.d.ts +13 -13
- package/dist/rules/effects/RakshasaEffectRule.js +23 -48
- package/dist/rules/effects/ResolveEffectsRule.d.ts +12 -12
- package/dist/rules/effects/ResolveEffectsRule.js +87 -141
- package/dist/rules/effects/SelkieEffectRule.d.ts +8 -8
- package/dist/rules/effects/SelkieEffectRule.js +19 -44
- package/dist/rules/effects/ShivaEffectRule.d.ts +10 -10
- package/dist/rules/effects/ShivaEffectRule.js +35 -61
- package/dist/rules/effects/SphinxEffectRule.d.ts +10 -10
- package/dist/rules/effects/SphinxEffectRule.js +33 -58
- package/dist/rules/effects/SupayEffectRule.d.ts +20 -20
- package/dist/rules/effects/SupayEffectRule.js +44 -81
- package/dist/rules/effects/ThorEffectRule.d.ts +11 -11
- package/dist/rules/effects/ThorEffectRule.js +32 -58
- package/dist/rules/effects/TianlongEffectRule.d.ts +17 -17
- package/dist/rules/effects/TianlongEffectRule.js +47 -105
- package/dist/rules/effects/TriggerEffectsRule.d.ts +11 -11
- package/dist/rules/effects/TriggerEffectsRule.js +65 -183
- package/dist/rules/effects/UkukuEffectRule.d.ts +14 -14
- package/dist/rules/effects/UkukuEffectRule.js +35 -66
- package/dist/rules/effects/VetalaEffectRule.d.ts +12 -12
- package/dist/rules/effects/VetalaEffectRule.js +37 -62
- package/dist/rules/effects/ViracochaEffectRule.d.ts +7 -7
- package/dist/rules/effects/ViracochaEffectRule.js +15 -40
- package/dist/rules/effects/WerehyenaEffectRule.d.ts +8 -8
- package/dist/rules/effects/WerehyenaEffectRule.js +37 -98
- package/dist/rules/effects/YanluoWangEffectRule.d.ts +9 -9
- package/dist/rules/effects/YanluoWangEffectRule.js +46 -104
- package/package.json +7 -8
|
@@ -1,486 +1,294 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
var allCardsIndexes = this.allCards.getIndexes();
|
|
296
|
-
for (var y = 0; y < 3; y++) {
|
|
297
|
-
var _loop_3 = function (x) {
|
|
298
|
-
var cardIndex = before[y][x];
|
|
299
|
-
if (cardIndex !== null && !after.some(function (line) { return line.includes(cardIndex); }) && allCardsIndexes.includes(cardIndex)) {
|
|
300
|
-
entities.push(cardIndex);
|
|
301
|
-
}
|
|
302
|
-
};
|
|
303
|
-
for (var x = 0; x < 3; x++) {
|
|
304
|
-
_loop_3(x);
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
return entities;
|
|
308
|
-
};
|
|
309
|
-
Pantheon.prototype.gainBonus = function (grid) {
|
|
310
|
-
var e_2, _a, e_3, _b;
|
|
311
|
-
if (grid === void 0) { grid = this.indexGrid; }
|
|
312
|
-
var moves = [];
|
|
313
|
-
var fullLines = (0, lodash_1.range)(0, 3).filter(function (y) { return !grid[y].includes(null); });
|
|
314
|
-
try {
|
|
315
|
-
for (var fullLines_1 = __values(fullLines), fullLines_1_1 = fullLines_1.next(); !fullLines_1_1.done; fullLines_1_1 = fullLines_1.next()) {
|
|
316
|
-
var y = fullLines_1_1.value;
|
|
317
|
-
moves.push.apply(moves, __spreadArray([], __read(this.gainLineBonus(y)), false));
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
321
|
-
finally {
|
|
322
|
-
try {
|
|
323
|
-
if (fullLines_1_1 && !fullLines_1_1.done && (_a = fullLines_1.return)) _a.call(fullLines_1);
|
|
324
|
-
}
|
|
325
|
-
finally { if (e_2) throw e_2.error; }
|
|
326
|
-
}
|
|
327
|
-
var fullColumns = (0, lodash_1.range)(0, 3).filter(function (x) { return grid.every(function (line) { return line[x] !== null; }); });
|
|
328
|
-
try {
|
|
329
|
-
for (var fullColumns_1 = __values(fullColumns), fullColumns_1_1 = fullColumns_1.next(); !fullColumns_1_1.done; fullColumns_1_1 = fullColumns_1.next()) {
|
|
330
|
-
var x = fullColumns_1_1.value;
|
|
331
|
-
moves.push.apply(moves, __spreadArray([], __read(this.gainColumnBonus(x)), false));
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
335
|
-
finally {
|
|
336
|
-
try {
|
|
337
|
-
if (fullColumns_1_1 && !fullColumns_1_1.done && (_b = fullColumns_1.return)) _b.call(fullColumns_1);
|
|
338
|
-
}
|
|
339
|
-
finally { if (e_3) throw e_3.error; }
|
|
340
|
-
}
|
|
341
|
-
return moves;
|
|
342
|
-
};
|
|
343
|
-
Pantheon.prototype.gainLineBonus = function (y) {
|
|
344
|
-
var bonusGem = this.getBonusGem(y);
|
|
345
|
-
return bonusGem.length ? [bonusGem.moveItem({ type: LocationType_1.LocationType.PlayerGems, player: this.player })] : [];
|
|
346
|
-
};
|
|
347
|
-
Pantheon.prototype.gainColumnBonus = function (x) {
|
|
348
|
-
var bonusFavor = this.getBonusFavor(x);
|
|
349
|
-
return bonusFavor.length ? [bonusFavor.moveItem({ type: LocationType_1.LocationType.PlayerFavor, player: this.player })] : [];
|
|
350
|
-
};
|
|
351
|
-
Pantheon.prototype.getBonusGem = function (y) {
|
|
352
|
-
return this.material(MaterialType_1.MaterialType.GemToken)
|
|
353
|
-
.location(LocationType_1.LocationType.PantheonLineBonus)
|
|
354
|
-
.player(this.player)
|
|
355
|
-
.location(function (l) { return l.y === y; });
|
|
356
|
-
};
|
|
357
|
-
Pantheon.prototype.getBonusFavor = function (x) {
|
|
358
|
-
return this.material(MaterialType_1.MaterialType.FavorToken)
|
|
359
|
-
.location(LocationType_1.LocationType.PantheonColumnBonus)
|
|
360
|
-
.player(this.player)
|
|
361
|
-
.location(function (l) { return l.x === x; });
|
|
362
|
-
};
|
|
363
|
-
Pantheon.prototype.onInvoke = function (move) {
|
|
364
|
-
var e_4, _a;
|
|
365
|
-
var moves = [];
|
|
366
|
-
var card = this.material(MaterialType_1.MaterialType.EntityCard).index(move.itemIndex).getItem();
|
|
367
|
-
var entity = card.id.front;
|
|
368
|
-
if (!entity)
|
|
369
|
-
return [];
|
|
370
|
-
try {
|
|
371
|
-
for (var _b = __values(this.game.players), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
372
|
-
var player = _c.value;
|
|
373
|
-
if (player !== this.player) {
|
|
374
|
-
var favorTax = new Pantheon(this.game, player).getFavorTax(move.location);
|
|
375
|
-
if (favorTax > 0) {
|
|
376
|
-
var favor = this.material(MaterialType_1.MaterialType.FavorToken).location(LocationType_1.LocationType.PlayerFavor).player(this.player);
|
|
377
|
-
moves.push(favor.moveItem({ type: LocationType_1.LocationType.PlayerFavor, player: player }, favorTax));
|
|
378
|
-
}
|
|
379
|
-
var gemTax = new Pantheon(this.game, player).getGemTax(move.location);
|
|
380
|
-
if (gemTax > 0) {
|
|
381
|
-
var gems = this.material(MaterialType_1.MaterialType.GemToken).location(LocationType_1.LocationType.PlayerGems).player(this.player);
|
|
382
|
-
moves.push(gems.moveItem({ type: LocationType_1.LocationType.PlayerFavor, player: player }, gemTax));
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
388
|
-
finally {
|
|
389
|
-
try {
|
|
390
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
391
|
-
}
|
|
392
|
-
finally { if (e_4) throw e_4.error; }
|
|
393
|
-
}
|
|
394
|
-
moves.push.apply(moves, __spreadArray([], __read(this.getInvokeGains(entity, move.location.y)), false));
|
|
395
|
-
return moves;
|
|
396
|
-
};
|
|
397
|
-
Pantheon.prototype.getInvokeGains = function (entity, line) {
|
|
398
|
-
var moves = [];
|
|
399
|
-
var invokeGain = EntityDescription_1.entities[entity].invoke[line];
|
|
400
|
-
if (invokeGain.gem) {
|
|
401
|
-
moves.push(this.gainGems(invokeGain.gem));
|
|
402
|
-
}
|
|
403
|
-
if (invokeGain.favor) {
|
|
404
|
-
moves.push(this.gainFavor(invokeGain.favor));
|
|
405
|
-
}
|
|
406
|
-
return moves;
|
|
407
|
-
};
|
|
408
|
-
Pantheon.prototype.hasEntity = function (entity) {
|
|
409
|
-
return this.visibleEntities.getItems().some(function (card) { return card.id.front === entity; });
|
|
410
|
-
};
|
|
411
|
-
Pantheon.prototype.getPiles = function (predicate) {
|
|
412
|
-
if (predicate === void 0) { predicate = function () { return true; }; }
|
|
413
|
-
var piles = [];
|
|
414
|
-
var myEntities = this.material(MaterialType_1.MaterialType.EntityCard).player(this.player);
|
|
415
|
-
var fullPantheon = myEntities.location(LocationType_1.LocationType.Pantheon);
|
|
416
|
-
for (var x = 0; x < 3; x++) {
|
|
417
|
-
for (var y = 0; y < 3; y++) {
|
|
418
|
-
if (predicate({ x: x, y: y })) {
|
|
419
|
-
var pile = this.getPile({ x: x, y: y }, fullPantheon);
|
|
420
|
-
if (pile.length > 0) {
|
|
421
|
-
piles.push(pile);
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
return piles;
|
|
427
|
-
};
|
|
428
|
-
Pantheon.prototype.getPile = function (_a, fullPantheon) {
|
|
429
|
-
var x = _a.x, y = _a.y;
|
|
430
|
-
if (fullPantheon === void 0) { fullPantheon = this.material(MaterialType_1.MaterialType.EntityCard).location(LocationType_1.LocationType.Pantheon).player(this.player); }
|
|
431
|
-
return fullPantheon.location(function (l) { return l.x === x && l.y === y; }).sort(function (item) { return item.location.z; });
|
|
432
|
-
};
|
|
433
|
-
Pantheon.prototype.isAbleToMove = function (entity) {
|
|
434
|
-
return !this.isVisible(entity) || new PermanentEffectsRule_1.PermanentEffectsRule(this.game).canMove(entity);
|
|
435
|
-
};
|
|
436
|
-
Pantheon.prototype.isVisible = function (entity) {
|
|
437
|
-
return this.getPile(entity.location).length - 1 === entity.location.z;
|
|
438
|
-
};
|
|
439
|
-
Object.defineProperty(Pantheon.prototype, "mythologies", {
|
|
440
|
-
get: function () {
|
|
441
|
-
return (0, lodash_1.uniq)(new Pantheon(this.game, this.player).visibleEntities.getItems().map(function (item) { return (0, Entity_1.entityMythology)(item.id.front); }));
|
|
442
|
-
},
|
|
443
|
-
enumerable: false,
|
|
444
|
-
configurable: true
|
|
445
|
-
});
|
|
446
|
-
Object.defineProperty(Pantheon.prototype, "missingMythologies", {
|
|
447
|
-
get: function () {
|
|
448
|
-
return (0, lodash_1.difference)(new Destiny_1.Destiny(this.game).mythologies, this.mythologies);
|
|
449
|
-
},
|
|
450
|
-
enumerable: false,
|
|
451
|
-
configurable: true
|
|
452
|
-
});
|
|
453
|
-
Pantheon.prototype.onEntitySacrificed = function (cardIndex) {
|
|
454
|
-
var card = this.material(MaterialType_1.MaterialType.EntityCard).getItem(cardIndex);
|
|
455
|
-
var _a = card.location, x = _a.x, y = _a.y, z = _a.z;
|
|
456
|
-
var grid = this.indexGrid;
|
|
457
|
-
if (grid[y][x] === cardIndex) {
|
|
458
|
-
var cardUnder = this.allCards.location(function (l) { return l.x === x && l.y === y && l.z !== z; }).maxBy(function (item) { return item.location.z; });
|
|
459
|
-
grid[y][x] = cardUnder.length ? cardUnder.getIndex() : null;
|
|
460
|
-
this.memorize(Memory_1.Memory.PlayerGrid, grid, this.player);
|
|
461
|
-
new TriggerEffectsRule_1.TriggerEffectsRule(this.game).triggerEffects({ type: Effect_1.TriggerEventType.EntitySacrificed, card: card, cardIndex: cardIndex });
|
|
462
|
-
}
|
|
463
|
-
};
|
|
464
|
-
Pantheon.prototype.hasCrushed = function (card) {
|
|
465
|
-
return this.allCards.location(function (l) { return l.x === card.location.x && l.y === card.location.y && l.z < card.location.z; }).length > 0;
|
|
466
|
-
};
|
|
467
|
-
Pantheon.prototype.isOpponentOngoingEffect = function () {
|
|
468
|
-
var ongoingEffect = this.remind(Memory_1.Memory.OngoingEffect);
|
|
469
|
-
if (!ongoingEffect)
|
|
470
|
-
return false;
|
|
471
|
-
var effectOwner = this.material(MaterialType_1.MaterialType.EntityCard).getItem(ongoingEffect.cardIndex).location.player;
|
|
472
|
-
return this.player !== effectOwner;
|
|
473
|
-
};
|
|
474
|
-
Pantheon.prototype.replaceSacrifice = function (cards) {
|
|
475
|
-
return this.visibleEntities.filter(function (item) {
|
|
476
|
-
return (0, EntityDescription_1.getEffects)(item.id.front).some(function (effect) { return !(0, Effect_1.isTriggeredEffect)(effect) && cards.some(function (card) { var _a; return (_a = effect.replaceSacrifice) === null || _a === void 0 ? void 0 : _a.call(effect, card, item); }); });
|
|
477
|
-
});
|
|
478
|
-
};
|
|
479
|
-
Pantheon.prototype.sacrificeToPreventMove = function () {
|
|
480
|
-
return this.visibleEntities
|
|
481
|
-
.filter(function (item) { return (0, EntityDescription_1.getEffects)(item.id.front).some(function (effect) { return !(0, Effect_1.isTriggeredEffect)(effect) && effect.sacrificeInsteadOfMove; }); })
|
|
482
|
-
.moveItems({ type: LocationType_1.LocationType.PlayerDiscard, player: this.player });
|
|
483
|
-
};
|
|
484
|
-
return Pantheon;
|
|
485
|
-
}(rules_api_1.MaterialRulesPart));
|
|
486
|
-
exports.Pantheon = Pantheon;
|
|
1
|
+
import { MaterialRulesPart } from '@gamepark/rules-api';
|
|
2
|
+
import { difference, range, sumBy, uniq } from 'es-toolkit';
|
|
3
|
+
import { Memory } from '../Memory';
|
|
4
|
+
import { MythologiesRules } from '../MythologiesRules';
|
|
5
|
+
import { PermanentEffectsRule } from '../rules/effects/PermanentEffectsRule';
|
|
6
|
+
import { TriggerEffectsRule } from '../rules/effects/TriggerEffectsRule';
|
|
7
|
+
import { Destiny } from './Destiny';
|
|
8
|
+
import { entityMythology, isGod } from './Entity';
|
|
9
|
+
import { isTriggeredEffect, LineEventType, TriggerEventType } from './entity/Effect';
|
|
10
|
+
import { entities, getEffects } from './entity/EntityDescription';
|
|
11
|
+
import { LocationType } from './LocationType';
|
|
12
|
+
import { MaterialType } from './MaterialType';
|
|
13
|
+
export class Pantheon extends MaterialRulesPart {
|
|
14
|
+
player;
|
|
15
|
+
constructor(game, player) {
|
|
16
|
+
super(game);
|
|
17
|
+
this.player = player;
|
|
18
|
+
}
|
|
19
|
+
get allCards() {
|
|
20
|
+
return this.material(MaterialType.EntityCard).location(LocationType.Pantheon).player(this.player);
|
|
21
|
+
}
|
|
22
|
+
get visibleEntities() {
|
|
23
|
+
const allCards = this.allCards;
|
|
24
|
+
return allCards.location(({ x, y, z }) => z === allCards.location((l) => l.x === x && l.y === y).length - 1);
|
|
25
|
+
}
|
|
26
|
+
get coveredEntities() {
|
|
27
|
+
const allCards = this.material(MaterialType.EntityCard).location(LocationType.Pantheon).player(this.player);
|
|
28
|
+
return allCards.location(({ x, y, z }) => z < allCards.location((l) => l.x === x && l.y === y).length - 1);
|
|
29
|
+
}
|
|
30
|
+
get grid() {
|
|
31
|
+
const visibleEntities = this.visibleEntities;
|
|
32
|
+
return range(0, 3).map((y) => range(0, 3).map((x) => visibleEntities.location((l) => l.x === x && l.y === y).getItem()?.id.front));
|
|
33
|
+
}
|
|
34
|
+
get indexGrid() {
|
|
35
|
+
const visibleEntities = this.visibleEntities;
|
|
36
|
+
return range(0, 3).map((y) => range(0, 3).map((x) => {
|
|
37
|
+
const entity = visibleEntities.location((l) => l.x === x && l.y === y);
|
|
38
|
+
return entity.length > 0 ? entity.getIndex() : null;
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
get legalSpacesToInvoke() {
|
|
42
|
+
return this.legalSpaces.filter((space) => this.isLegalSpaceToInvoke(space));
|
|
43
|
+
}
|
|
44
|
+
isLegalSpaceToInvoke(space) {
|
|
45
|
+
const opponents = this.game.players.filter((player) => player !== this.player);
|
|
46
|
+
const favorTax = sumBy(opponents, (opponent) => new Pantheon(this.game, opponent).getFavorTax(space));
|
|
47
|
+
const gemTax = sumBy(opponents, (opponent) => new Pantheon(this.game, opponent).getGemTax(space));
|
|
48
|
+
return (!favorTax || this.favor >= favorTax) && (!gemTax || this.gems >= gemTax);
|
|
49
|
+
}
|
|
50
|
+
getFavorTax(space) {
|
|
51
|
+
return sumBy(this.visibleEntities.getItems(), (card) => sumBy(getEffects(card.id.front), (effect) => effect.favorTax?.(space, card) ?? 0));
|
|
52
|
+
}
|
|
53
|
+
getGemTax(space) {
|
|
54
|
+
return sumBy(this.visibleEntities.getItems(), (card) => sumBy(getEffects(card.id.front), (effect) => effect.gemTax?.(space, card) ?? 0));
|
|
55
|
+
}
|
|
56
|
+
get legalSpaces() {
|
|
57
|
+
const grid = this.grid;
|
|
58
|
+
return range(0, 3)
|
|
59
|
+
.flatMap((y) => range(0, 3).map((x) => ({ x, y })))
|
|
60
|
+
.filter((space) => this.isLegalSpace(space, grid));
|
|
61
|
+
}
|
|
62
|
+
isLegalSpace({ x, y }, grid = this.grid) {
|
|
63
|
+
const card = this.visibleEntities.location((l) => l.x === x && l.y === y).getItem();
|
|
64
|
+
return !card || (!isGod(grid[y][x]) && new PermanentEffectsRule(this.game).canCrush(card));
|
|
65
|
+
}
|
|
66
|
+
isFreeSpace({ x, y }) {
|
|
67
|
+
return this.allCards.location((l) => l.x === x && l.y === y).length === 0;
|
|
68
|
+
}
|
|
69
|
+
gainGems(quantity) {
|
|
70
|
+
return this.material(MaterialType.GemToken).createItem({ location: { type: LocationType.PlayerGems, player: this.player }, quantity });
|
|
71
|
+
}
|
|
72
|
+
get gemMaterial() {
|
|
73
|
+
return this.material(MaterialType.GemToken).location(LocationType.PlayerGems).player(this.player);
|
|
74
|
+
}
|
|
75
|
+
get gems() {
|
|
76
|
+
return this.gemMaterial.getQuantity();
|
|
77
|
+
}
|
|
78
|
+
spendGems(quantity) {
|
|
79
|
+
return this.gemMaterial.deleteItem(quantity);
|
|
80
|
+
}
|
|
81
|
+
gainFavor(quantity) {
|
|
82
|
+
return this.material(MaterialType.FavorToken).createItem({ location: { type: LocationType.PlayerFavor, player: this.player }, quantity });
|
|
83
|
+
}
|
|
84
|
+
get favor() {
|
|
85
|
+
return this.material(MaterialType.FavorToken).location(LocationType.PlayerFavor).player(this.player).getQuantity();
|
|
86
|
+
}
|
|
87
|
+
loseFavor(quantity = 1) {
|
|
88
|
+
return this.material(MaterialType.FavorToken).location(LocationType.PlayerFavor).player(this.player).deleteItem(quantity);
|
|
89
|
+
}
|
|
90
|
+
onCardPlaced(move) {
|
|
91
|
+
const moves = [];
|
|
92
|
+
const location = move.location;
|
|
93
|
+
const card = this.material(MaterialType.EntityCard).index(move.itemIndex);
|
|
94
|
+
const cardItem = card.getItem();
|
|
95
|
+
const entity = cardItem.id.front ?? (move.reveal?.id).front;
|
|
96
|
+
if (isGod(entity)) {
|
|
97
|
+
moves.push(this.spendGems(4));
|
|
98
|
+
}
|
|
99
|
+
const grid = this.indexGrid;
|
|
100
|
+
const crush = grid[move.location.y][move.location.x] !== null;
|
|
101
|
+
grid[move.location.y][move.location.x] = move.itemIndex;
|
|
102
|
+
moves.push(...this.gainBonus(grid));
|
|
103
|
+
const triggerEffectsRule = new TriggerEffectsRule(this.game);
|
|
104
|
+
triggerEffectsRule.triggerCardEffect(move.itemIndex, location, { type: TriggerEventType.SelfPlaced, crush });
|
|
105
|
+
const triggerEvents = this.updateGrid(grid);
|
|
106
|
+
const invoked = this.isInvoke;
|
|
107
|
+
if (invoked) {
|
|
108
|
+
moves.push(...this.onInvoke(move));
|
|
109
|
+
}
|
|
110
|
+
triggerEvents.push({ type: TriggerEventType.EntityPlaced, cardIndex: move.itemIndex, entity, location, invoked });
|
|
111
|
+
if (triggerEvents.length) {
|
|
112
|
+
triggerEffectsRule.triggerEffects(...triggerEvents);
|
|
113
|
+
}
|
|
114
|
+
return moves;
|
|
115
|
+
}
|
|
116
|
+
get isInvoke() {
|
|
117
|
+
return new MythologiesRules(this.game).delegate().isInvoke;
|
|
118
|
+
}
|
|
119
|
+
updateGrid(gridAfter = this.indexGrid) {
|
|
120
|
+
const gridBefore = this.remind(Memory.PlayerGrid, this.player) ?? this.indexGrid;
|
|
121
|
+
this.memorize(Memory.PlayerGrid, gridAfter, this.player);
|
|
122
|
+
const triggerEvents = [];
|
|
123
|
+
const entitiesMoved = this.getEntitiesMoved(gridBefore, gridAfter);
|
|
124
|
+
if (entitiesMoved.length) {
|
|
125
|
+
triggerEvents.push({ type: TriggerEventType.EntitiesMoved, player: this.player, entities: entitiesMoved });
|
|
126
|
+
}
|
|
127
|
+
const entitiesCrushed = this.getEntitiesCrushed(gridBefore, gridAfter);
|
|
128
|
+
for (const cardIndex of entitiesCrushed) {
|
|
129
|
+
triggerEvents.push({ type: TriggerEventType.EntityCrushed, card: this.material(MaterialType.EntityCard).getItem(cardIndex), cardIndex });
|
|
130
|
+
}
|
|
131
|
+
for (let y = 0; y < 3; y++) {
|
|
132
|
+
if (gridBefore[y].some((item) => item === null) && gridAfter[y].every((item) => item !== null)) {
|
|
133
|
+
triggerEvents.push({ type: TriggerEventType.LineEvent, eventType: LineEventType.Completed, player: this.player, y });
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
for (let x = 0; x < 3; x++) {
|
|
137
|
+
if (gridBefore.some((line) => line[x] === null) && gridAfter.every((line) => line[x] !== null)) {
|
|
138
|
+
triggerEvents.push({ type: TriggerEventType.ColumnEvent, eventType: LineEventType.Completed, player: this.player, x });
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return triggerEvents;
|
|
142
|
+
}
|
|
143
|
+
getEntitiesMoved(before, after) {
|
|
144
|
+
const entities = [];
|
|
145
|
+
for (let y = 0; y < 3; y++) {
|
|
146
|
+
for (let x = 0; x < 3; x++) {
|
|
147
|
+
const cardIndex = before[y][x];
|
|
148
|
+
if (cardIndex !== null && cardIndex !== after[y][x] && after.some((line) => line.includes(cardIndex))) {
|
|
149
|
+
entities.push(cardIndex);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return entities;
|
|
154
|
+
}
|
|
155
|
+
getEntitiesCrushed(before, after) {
|
|
156
|
+
const entities = [];
|
|
157
|
+
const allCardsIndexes = this.allCards.getIndexes();
|
|
158
|
+
for (let y = 0; y < 3; y++) {
|
|
159
|
+
for (let x = 0; x < 3; x++) {
|
|
160
|
+
const cardIndex = before[y][x];
|
|
161
|
+
if (cardIndex !== null && !after.some((line) => line.includes(cardIndex)) && allCardsIndexes.includes(cardIndex)) {
|
|
162
|
+
entities.push(cardIndex);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return entities;
|
|
167
|
+
}
|
|
168
|
+
gainBonus(grid = this.indexGrid) {
|
|
169
|
+
const moves = [];
|
|
170
|
+
const fullLines = range(0, 3).filter((y) => !grid[y].includes(null));
|
|
171
|
+
for (const y of fullLines) {
|
|
172
|
+
moves.push(...this.gainLineBonus(y));
|
|
173
|
+
}
|
|
174
|
+
const fullColumns = range(0, 3).filter((x) => grid.every((line) => line[x] !== null));
|
|
175
|
+
for (const x of fullColumns) {
|
|
176
|
+
moves.push(...this.gainColumnBonus(x));
|
|
177
|
+
}
|
|
178
|
+
return moves;
|
|
179
|
+
}
|
|
180
|
+
gainLineBonus(y) {
|
|
181
|
+
const bonusGem = this.getBonusGem(y);
|
|
182
|
+
return bonusGem.length ? [bonusGem.moveItem({ type: LocationType.PlayerGems, player: this.player })] : [];
|
|
183
|
+
}
|
|
184
|
+
gainColumnBonus(x) {
|
|
185
|
+
const bonusFavor = this.getBonusFavor(x);
|
|
186
|
+
return bonusFavor.length ? [bonusFavor.moveItem({ type: LocationType.PlayerFavor, player: this.player })] : [];
|
|
187
|
+
}
|
|
188
|
+
getBonusGem(y) {
|
|
189
|
+
return this.material(MaterialType.GemToken)
|
|
190
|
+
.location(LocationType.PantheonLineBonus)
|
|
191
|
+
.player(this.player)
|
|
192
|
+
.location((l) => l.y === y);
|
|
193
|
+
}
|
|
194
|
+
getBonusFavor(x) {
|
|
195
|
+
return this.material(MaterialType.FavorToken)
|
|
196
|
+
.location(LocationType.PantheonColumnBonus)
|
|
197
|
+
.player(this.player)
|
|
198
|
+
.location((l) => l.x === x);
|
|
199
|
+
}
|
|
200
|
+
onInvoke(move) {
|
|
201
|
+
const moves = [];
|
|
202
|
+
const card = this.material(MaterialType.EntityCard).index(move.itemIndex).getItem();
|
|
203
|
+
const entity = card.id.front;
|
|
204
|
+
if (!entity)
|
|
205
|
+
return [];
|
|
206
|
+
for (const player of this.game.players) {
|
|
207
|
+
if (player !== this.player) {
|
|
208
|
+
const favorTax = new Pantheon(this.game, player).getFavorTax(move.location);
|
|
209
|
+
if (favorTax > 0) {
|
|
210
|
+
const favor = this.material(MaterialType.FavorToken).location(LocationType.PlayerFavor).player(this.player);
|
|
211
|
+
moves.push(favor.moveItem({ type: LocationType.PlayerFavor, player }, favorTax));
|
|
212
|
+
}
|
|
213
|
+
const gemTax = new Pantheon(this.game, player).getGemTax(move.location);
|
|
214
|
+
if (gemTax > 0) {
|
|
215
|
+
const gems = this.material(MaterialType.GemToken).location(LocationType.PlayerGems).player(this.player);
|
|
216
|
+
moves.push(gems.moveItem({ type: LocationType.PlayerFavor, player }, gemTax));
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
moves.push(...this.getInvokeGains(entity, move.location.y));
|
|
221
|
+
return moves;
|
|
222
|
+
}
|
|
223
|
+
getInvokeGains(entity, line) {
|
|
224
|
+
const moves = [];
|
|
225
|
+
const invokeGain = entities[entity].invoke[line];
|
|
226
|
+
if (invokeGain.gem) {
|
|
227
|
+
moves.push(this.gainGems(invokeGain.gem));
|
|
228
|
+
}
|
|
229
|
+
if (invokeGain.favor) {
|
|
230
|
+
moves.push(this.gainFavor(invokeGain.favor));
|
|
231
|
+
}
|
|
232
|
+
return moves;
|
|
233
|
+
}
|
|
234
|
+
hasEntity(entity) {
|
|
235
|
+
return this.visibleEntities.getItems().some((card) => card.id.front === entity);
|
|
236
|
+
}
|
|
237
|
+
getPiles(predicate = () => true) {
|
|
238
|
+
const piles = [];
|
|
239
|
+
const myEntities = this.material(MaterialType.EntityCard).player(this.player);
|
|
240
|
+
const fullPantheon = myEntities.location(LocationType.Pantheon);
|
|
241
|
+
for (let x = 0; x < 3; x++) {
|
|
242
|
+
for (let y = 0; y < 3; y++) {
|
|
243
|
+
if (predicate({ x, y })) {
|
|
244
|
+
const pile = this.getPile({ x, y }, fullPantheon);
|
|
245
|
+
if (pile.length > 0) {
|
|
246
|
+
piles.push(pile);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
return piles;
|
|
252
|
+
}
|
|
253
|
+
getPile({ x, y }, fullPantheon = this.material(MaterialType.EntityCard).location(LocationType.Pantheon).player(this.player)) {
|
|
254
|
+
return fullPantheon.location((l) => l.x === x && l.y === y).sort((item) => item.location.z);
|
|
255
|
+
}
|
|
256
|
+
isAbleToMove(entity) {
|
|
257
|
+
return !this.isVisible(entity) || new PermanentEffectsRule(this.game).canMove(entity);
|
|
258
|
+
}
|
|
259
|
+
isVisible(entity) {
|
|
260
|
+
return this.getPile(entity.location).length - 1 === entity.location.z;
|
|
261
|
+
}
|
|
262
|
+
get mythologies() {
|
|
263
|
+
return uniq(new Pantheon(this.game, this.player).visibleEntities.getItems().map((item) => entityMythology(item.id.front)));
|
|
264
|
+
}
|
|
265
|
+
get missingMythologies() {
|
|
266
|
+
return difference(new Destiny(this.game).mythologies, this.mythologies);
|
|
267
|
+
}
|
|
268
|
+
onEntitySacrificed(cardIndex) {
|
|
269
|
+
const card = this.material(MaterialType.EntityCard).getItem(cardIndex);
|
|
270
|
+
const { x, y, z } = card.location;
|
|
271
|
+
const grid = this.indexGrid;
|
|
272
|
+
if (grid[y][x] === cardIndex) {
|
|
273
|
+
const cardUnder = this.allCards.location((l) => l.x === x && l.y === y && l.z !== z).maxBy((item) => item.location.z);
|
|
274
|
+
grid[y][x] = cardUnder.length ? cardUnder.getIndex() : null;
|
|
275
|
+
this.memorize(Memory.PlayerGrid, grid, this.player);
|
|
276
|
+
new TriggerEffectsRule(this.game).triggerEffects({ type: TriggerEventType.EntitySacrificed, card: card, cardIndex });
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
isOpponentOngoingEffect() {
|
|
280
|
+
const ongoingEffect = this.remind(Memory.OngoingEffect);
|
|
281
|
+
if (!ongoingEffect)
|
|
282
|
+
return false;
|
|
283
|
+
const effectOwner = this.material(MaterialType.EntityCard).getItem(ongoingEffect.cardIndex).location.player;
|
|
284
|
+
return this.player !== effectOwner;
|
|
285
|
+
}
|
|
286
|
+
replaceSacrifice(cards) {
|
|
287
|
+
return this.visibleEntities.filter((item) => getEffects(item.id.front).some((effect) => !isTriggeredEffect(effect) && cards.some((card) => effect.replaceSacrifice?.(card, item))));
|
|
288
|
+
}
|
|
289
|
+
sacrificeToPreventMove() {
|
|
290
|
+
return this.visibleEntities
|
|
291
|
+
.filter((item) => getEffects(item.id.front).some((effect) => !isTriggeredEffect(effect) && effect.sacrificeInsteadOfMove))
|
|
292
|
+
.moveItems({ type: LocationType.PlayerDiscard, player: this.player });
|
|
293
|
+
}
|
|
294
|
+
}
|