@gamepark/mythologies 0.10.0 → 0.12.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 +160 -158
- package/dist/MythologiesRules.js +220 -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 -50
- package/dist/material/Pantheon.js +303 -484
- 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 +130 -106
- package/dist/material/entity/Effect.js +32 -46
- 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 +17 -15
- package/dist/material/entity/PlaceCardEffectRule.js +58 -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 +64 -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 +9 -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 +66 -65
- package/dist/rules/RuleId.js +67 -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 +14 -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 +33 -95
- package/dist/rules/effects/ChimeraEffectRule.d.ts +8 -8
- package/dist/rules/effects/ChimeraEffectRule.js +15 -40
- 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 -11
- package/dist/rules/effects/DraugrEffectRule.js +32 -58
- 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 -10
- package/dist/rules/effects/ImpunduluEffectRule.js +39 -77
- package/dist/rules/effects/InkosazanaEffectRule.d.ts +7 -7
- package/dist/rules/effects/InkosazanaEffectRule.js +11 -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 +15 -14
- package/dist/rules/effects/MultipleSimultaneousMoveEffectRule.js +96 -144
- 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 +15 -12
- package/dist/rules/effects/ResolveEffectsRule.js +154 -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 +12 -11
- package/dist/rules/effects/TriggerEffectsRule.js +67 -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/VishnuEffectRule.d.ts +10 -0
- package/dist/rules/effects/VishnuEffectRule.js +44 -0
- 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,149 +1,64 @@
|
|
|
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
|
-
SimultaneousEffectRule.prototype.canPlayEffect = function (_cardIndex) {
|
|
66
|
-
return true;
|
|
67
|
-
};
|
|
68
|
-
SimultaneousEffectRule.prototype.playEffect = function () {
|
|
69
|
-
var e_1, _a;
|
|
70
|
-
var moves = [];
|
|
71
|
-
var playersToActivate = [];
|
|
72
|
-
try {
|
|
73
|
-
for (var _b = __values(this.getAffectedPlayers()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
74
|
-
var player = _c.value;
|
|
75
|
-
var legalMoves = this.getActivePlayerLegalMoves(player);
|
|
76
|
-
if (legalMoves.length === 1) {
|
|
77
|
-
moves.push(legalMoves[0]);
|
|
78
|
-
}
|
|
79
|
-
else if (legalMoves.length > 1) {
|
|
80
|
-
playersToActivate.push(player);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
85
|
-
finally {
|
|
86
|
-
try {
|
|
87
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
88
|
-
}
|
|
89
|
-
finally { if (e_1) throw e_1.error; }
|
|
90
|
-
}
|
|
91
|
-
moves.push(this.startSimultaneousRule(this.ruleId, playersToActivate));
|
|
92
|
-
return moves;
|
|
93
|
-
};
|
|
94
|
-
SimultaneousEffectRule.prototype.onRuleStart = function () {
|
|
95
|
-
var e_2, _a;
|
|
96
|
-
var moves = [];
|
|
97
|
-
if (this.game.rule.players.length === 0) {
|
|
98
|
-
moves.push.apply(moves, __spreadArray([], __read(this.getMovesAfterPlayersDone()), false));
|
|
99
|
-
}
|
|
100
|
-
try {
|
|
101
|
-
for (var _b = __values(this.game.rule.players), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
102
|
-
var player = _c.value;
|
|
103
|
-
var legalMoves = this.getActivePlayerLegalMoves(player);
|
|
104
|
-
if (legalMoves.length === 1) {
|
|
105
|
-
moves.push(legalMoves[0]);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
110
|
-
finally {
|
|
111
|
-
try {
|
|
112
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
113
|
-
}
|
|
114
|
-
finally { if (e_2) throw e_2.error; }
|
|
115
|
-
}
|
|
116
|
-
return moves;
|
|
117
|
-
};
|
|
118
|
-
SimultaneousEffectRule.prototype.getAffectedPlayers = function () {
|
|
119
|
-
return this.game.players;
|
|
120
|
-
};
|
|
121
|
-
SimultaneousEffectRule.prototype.isOpponent = function (player) {
|
|
122
|
-
return player !== this.card.location.player;
|
|
123
|
-
};
|
|
124
|
-
Object.defineProperty(SimultaneousEffectRule.prototype, "card", {
|
|
125
|
-
get: function () {
|
|
126
|
-
var index = this.getEffect().cardIndex;
|
|
127
|
-
return this.material(MaterialType_1.MaterialType.EntityCard).getItem(index);
|
|
128
|
-
},
|
|
129
|
-
enumerable: false,
|
|
130
|
-
configurable: true
|
|
131
|
-
});
|
|
132
|
-
SimultaneousEffectRule.prototype.getEffect = function () {
|
|
133
|
-
return this.remind(Memory_1.Memory.OngoingEffect);
|
|
134
|
-
};
|
|
135
|
-
SimultaneousEffectRule.prototype.getMovesAfterPlayersDone = function () {
|
|
136
|
-
return [this.customMove(CustomMoveType_1.CustomMoveType.EndEffect)];
|
|
137
|
-
};
|
|
138
|
-
SimultaneousEffectRule.prototype.onCustomMove = function (move) {
|
|
139
|
-
if (move.type === CustomMoveType_1.CustomMoveType.EndEffect) {
|
|
140
|
-
return this.onEndEffect();
|
|
141
|
-
}
|
|
142
|
-
return [];
|
|
143
|
-
};
|
|
144
|
-
SimultaneousEffectRule.prototype.onEndEffect = function () {
|
|
145
|
-
return new ResolveEffectsRule_1.ResolveEffectsRule(this.game).onEndEffect();
|
|
146
|
-
};
|
|
147
|
-
return SimultaneousEffectRule;
|
|
148
|
-
}(rules_api_1.SimultaneousRule));
|
|
149
|
-
exports.SimultaneousEffectRule = SimultaneousEffectRule;
|
|
1
|
+
import { SimultaneousRule } from '@gamepark/rules-api';
|
|
2
|
+
import { CustomMoveType } from '../../CustomMoveType';
|
|
3
|
+
import { Memory } from '../../Memory';
|
|
4
|
+
import { ResolveEffectsRule } from '../../rules/effects/ResolveEffectsRule';
|
|
5
|
+
import { MaterialType } from '../MaterialType';
|
|
6
|
+
export class SimultaneousEffectRule extends SimultaneousRule {
|
|
7
|
+
canPlayEffect(_cardIndex) {
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
ruleId;
|
|
11
|
+
playEffect() {
|
|
12
|
+
const moves = [];
|
|
13
|
+
const playersToActivate = [];
|
|
14
|
+
for (const player of this.getAffectedPlayers()) {
|
|
15
|
+
const legalMoves = this.getActivePlayerLegalMoves(player);
|
|
16
|
+
if (legalMoves.length === 1) {
|
|
17
|
+
moves.push(legalMoves[0]);
|
|
18
|
+
}
|
|
19
|
+
else if (legalMoves.length > 1) {
|
|
20
|
+
playersToActivate.push(player);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
moves.push(this.startSimultaneousRule(this.ruleId, playersToActivate));
|
|
24
|
+
return moves;
|
|
25
|
+
}
|
|
26
|
+
onRuleStart() {
|
|
27
|
+
const moves = [];
|
|
28
|
+
if (this.game.rule.players.length === 0) {
|
|
29
|
+
moves.push(...this.getMovesAfterPlayersDone());
|
|
30
|
+
}
|
|
31
|
+
for (const player of this.game.rule.players) {
|
|
32
|
+
const legalMoves = this.getActivePlayerLegalMoves(player);
|
|
33
|
+
if (legalMoves.length === 1) {
|
|
34
|
+
moves.push(legalMoves[0]);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return moves;
|
|
38
|
+
}
|
|
39
|
+
getAffectedPlayers() {
|
|
40
|
+
return this.game.players;
|
|
41
|
+
}
|
|
42
|
+
isOpponent(player) {
|
|
43
|
+
return player !== this.card.location.player;
|
|
44
|
+
}
|
|
45
|
+
get card() {
|
|
46
|
+
const index = this.getEffect().cardIndex;
|
|
47
|
+
return this.material(MaterialType.EntityCard).getItem(index);
|
|
48
|
+
}
|
|
49
|
+
getEffect() {
|
|
50
|
+
return this.remind(Memory.OngoingEffect);
|
|
51
|
+
}
|
|
52
|
+
getMovesAfterPlayersDone() {
|
|
53
|
+
return [this.customMove(CustomMoveType.EndEffect)];
|
|
54
|
+
}
|
|
55
|
+
onCustomMove(move) {
|
|
56
|
+
if (move.type === CustomMoveType.EndEffect) {
|
|
57
|
+
return this.onEndEffect();
|
|
58
|
+
}
|
|
59
|
+
return [];
|
|
60
|
+
}
|
|
61
|
+
onEndEffect() {
|
|
62
|
+
return new ResolveEffectsRule(this.game).onEndEffect();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ItemMove, Location, Material, MaterialItem, MaterialMove, MoveItem, XYCoordinates } from '@gamepark/rules-api';
|
|
2
|
-
import { PlayerColor } from '../../PlayerColor';
|
|
3
|
-
import { SimultaneousEffectRule } from './SimultaneousEffectRule';
|
|
4
|
-
export declare abstract class SimultaneousMoveEffectRule extends SimultaneousEffectRule {
|
|
5
|
-
getActivePlayerLegalMoves(player: PlayerColor): MoveItem<number, number, number>[];
|
|
6
|
-
getSacrificeToPreventMove(player: PlayerColor): MoveItem<number, number, number>[];
|
|
7
|
-
getMovementMoves(player: PlayerColor): MoveItem<number, number, number>[];
|
|
8
|
-
private getCardsAbleToMove;
|
|
9
|
-
getMovingCards(player: PlayerColor): Material;
|
|
10
|
-
getAvailableDestinations(player: PlayerColor, card: MaterialItem): XYCoordinates[];
|
|
11
|
-
isLegalDestination(_space: XYCoordinates, _cardLocation: Location): boolean;
|
|
12
|
-
beforeItemMove(move: ItemMove): MaterialMove
|
|
13
|
-
onCardMoved(move: MoveItem): MaterialMove[];
|
|
14
|
-
onCardSacrificed(move: MoveItem): MaterialMove[];
|
|
15
|
-
getMovesAfterPlayersDone(): MaterialMove[];
|
|
16
|
-
updatePlayersGrids():
|
|
17
|
-
}
|
|
1
|
+
import { ItemMove, Location, Material, MaterialItem, MaterialMove, MoveItem, XYCoordinates } from '@gamepark/rules-api';
|
|
2
|
+
import { PlayerColor } from '../../PlayerColor';
|
|
3
|
+
import { SimultaneousEffectRule } from './SimultaneousEffectRule';
|
|
4
|
+
export declare abstract class SimultaneousMoveEffectRule extends SimultaneousEffectRule {
|
|
5
|
+
getActivePlayerLegalMoves(player: PlayerColor): MoveItem<number, number, number>[];
|
|
6
|
+
getSacrificeToPreventMove(player: PlayerColor): MoveItem<number, number, number>[];
|
|
7
|
+
getMovementMoves(player: PlayerColor): MoveItem<number, number, number>[];
|
|
8
|
+
private getCardsAbleToMove;
|
|
9
|
+
getMovingCards(player: PlayerColor): Material;
|
|
10
|
+
getAvailableDestinations(player: PlayerColor, card: MaterialItem): XYCoordinates[];
|
|
11
|
+
isLegalDestination(_space: XYCoordinates, _cardLocation: Location): boolean;
|
|
12
|
+
beforeItemMove(move: ItemMove): MaterialMove[];
|
|
13
|
+
onCardMoved(move: MoveItem): MaterialMove[];
|
|
14
|
+
onCardSacrificed(move: MoveItem): MaterialMove[];
|
|
15
|
+
getMovesAfterPlayersDone(): MaterialMove[];
|
|
16
|
+
updatePlayersGrids(): void;
|
|
17
|
+
}
|
|
@@ -1,141 +1,64 @@
|
|
|
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
|
-
if (
|
|
36
|
-
if (
|
|
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
|
-
SimultaneousMoveEffectRule.prototype.getActivePlayerLegalMoves = function (player) {
|
|
67
|
-
return this.getMovementMoves(player).concat(this.getSacrificeToPreventMove(player));
|
|
68
|
-
};
|
|
69
|
-
SimultaneousMoveEffectRule.prototype.getSacrificeToPreventMove = function (player) {
|
|
70
|
-
return new Pantheon_1.Pantheon(this.game, player).sacrificeToPreventMove();
|
|
71
|
-
};
|
|
72
|
-
SimultaneousMoveEffectRule.prototype.getMovementMoves = function (player) {
|
|
73
|
-
var _this = this;
|
|
74
|
-
var cards = this.getCardsAbleToMove(player);
|
|
75
|
-
return cards.getIndexes().flatMap(function (cardIndex) {
|
|
76
|
-
var card = cards.index(cardIndex);
|
|
77
|
-
return _this.getAvailableDestinations(player, card.getItem()).map(function (_a) {
|
|
78
|
-
var x = _a.x, y = _a.y;
|
|
79
|
-
return card.moveItem({ type: LocationType_1.LocationType.Pantheon, player: player, x: x, y: y });
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
};
|
|
83
|
-
SimultaneousMoveEffectRule.prototype.getCardsAbleToMove = function (player) {
|
|
84
|
-
var pantheon = new Pantheon_1.Pantheon(this.game, player);
|
|
85
|
-
return this.getMovingCards(player).filter(function (item) { return pantheon.isAbleToMove(item); });
|
|
86
|
-
};
|
|
87
|
-
SimultaneousMoveEffectRule.prototype.getMovingCards = function (player) {
|
|
88
|
-
return new Pantheon_1.Pantheon(this.game, player).visibleEntities;
|
|
89
|
-
};
|
|
90
|
-
SimultaneousMoveEffectRule.prototype.getAvailableDestinations = function (player, card) {
|
|
91
|
-
var _this = this;
|
|
92
|
-
return new Pantheon_1.Pantheon(this.game, player).legalSpaces.filter(function (space) { return (space.y !== card.location.y || space.x !== card.location.x) && _this.isLegalDestination(space, card.location); });
|
|
93
|
-
};
|
|
94
|
-
SimultaneousMoveEffectRule.prototype.isLegalDestination = function (_space, _cardLocation) {
|
|
95
|
-
return true;
|
|
96
|
-
};
|
|
97
|
-
SimultaneousMoveEffectRule.prototype.beforeItemMove = function (move) {
|
|
98
|
-
if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.EntityCard)(move)) {
|
|
99
|
-
if (move.location.type === LocationType_1.LocationType.Pantheon) {
|
|
100
|
-
return this.onCardMoved(move);
|
|
101
|
-
}
|
|
102
|
-
else if (move.location.type === LocationType_1.LocationType.PlayerDiscard) {
|
|
103
|
-
return this.onCardSacrificed(move);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
return [];
|
|
107
|
-
};
|
|
108
|
-
SimultaneousMoveEffectRule.prototype.onCardMoved = function (move) {
|
|
109
|
-
return [this.endPlayerTurn(move.location.player)];
|
|
110
|
-
};
|
|
111
|
-
SimultaneousMoveEffectRule.prototype.onCardSacrificed = function (move) {
|
|
112
|
-
return [this.endPlayerTurn(move.location.player)];
|
|
113
|
-
};
|
|
114
|
-
SimultaneousMoveEffectRule.prototype.getMovesAfterPlayersDone = function () {
|
|
115
|
-
return __spreadArray(__spreadArray([], __read(this.updatePlayersGrids()), false), __read(_super.prototype.getMovesAfterPlayersDone.call(this)), false);
|
|
116
|
-
};
|
|
117
|
-
SimultaneousMoveEffectRule.prototype.updatePlayersGrids = function () {
|
|
118
|
-
var e_1, _a, _b;
|
|
119
|
-
var moves = [];
|
|
120
|
-
var events = [];
|
|
121
|
-
try {
|
|
122
|
-
for (var _c = __values(this.game.players), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
123
|
-
var player = _d.value;
|
|
124
|
-
var pantheon = new Pantheon_1.Pantheon(this.game, player);
|
|
125
|
-
events.push.apply(events, __spreadArray([], __read(pantheon.updateGrid()), false));
|
|
126
|
-
moves.push.apply(moves, __spreadArray([], __read(pantheon.gainBonus()), false));
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
130
|
-
finally {
|
|
131
|
-
try {
|
|
132
|
-
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
133
|
-
}
|
|
134
|
-
finally { if (e_1) throw e_1.error; }
|
|
135
|
-
}
|
|
136
|
-
(_b = new TriggerEffectsRule_1.TriggerEffectsRule(this.game)).triggerEffects.apply(_b, __spreadArray([], __read(events), false));
|
|
137
|
-
return moves;
|
|
138
|
-
};
|
|
139
|
-
return SimultaneousMoveEffectRule;
|
|
140
|
-
}(SimultaneousEffectRule_1.SimultaneousEffectRule));
|
|
141
|
-
exports.SimultaneousMoveEffectRule = SimultaneousMoveEffectRule;
|
|
1
|
+
import { isMoveItemType } from '@gamepark/rules-api';
|
|
2
|
+
import { TriggerEffectsRule } from '../../rules/effects/TriggerEffectsRule';
|
|
3
|
+
import { LocationType } from '../LocationType';
|
|
4
|
+
import { MaterialType } from '../MaterialType';
|
|
5
|
+
import { Pantheon } from '../Pantheon';
|
|
6
|
+
import { SimultaneousEffectRule } from './SimultaneousEffectRule';
|
|
7
|
+
export class SimultaneousMoveEffectRule extends SimultaneousEffectRule {
|
|
8
|
+
getActivePlayerLegalMoves(player) {
|
|
9
|
+
return this.getMovementMoves(player).concat(this.getSacrificeToPreventMove(player));
|
|
10
|
+
}
|
|
11
|
+
getSacrificeToPreventMove(player) {
|
|
12
|
+
return new Pantheon(this.game, player).sacrificeToPreventMove();
|
|
13
|
+
}
|
|
14
|
+
getMovementMoves(player) {
|
|
15
|
+
const cards = this.getCardsAbleToMove(player);
|
|
16
|
+
return cards.getIndexes().flatMap((cardIndex) => {
|
|
17
|
+
const card = cards.index(cardIndex);
|
|
18
|
+
return this.getAvailableDestinations(player, card.getItem()).map(({ x, y }) => card.moveItem({ type: LocationType.Pantheon, player, x, y }));
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
getCardsAbleToMove(player) {
|
|
22
|
+
const pantheon = new Pantheon(this.game, player);
|
|
23
|
+
return this.getMovingCards(player).filter((item) => pantheon.isAbleToMove(item));
|
|
24
|
+
}
|
|
25
|
+
getMovingCards(player) {
|
|
26
|
+
return new Pantheon(this.game, player).visibleEntities;
|
|
27
|
+
}
|
|
28
|
+
getAvailableDestinations(player, card) {
|
|
29
|
+
return new Pantheon(this.game, player).legalSpaces.filter((space) => (space.y !== card.location.y || space.x !== card.location.x) && this.isLegalDestination(space, card.location));
|
|
30
|
+
}
|
|
31
|
+
isLegalDestination(_space, _cardLocation) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
beforeItemMove(move) {
|
|
35
|
+
if (isMoveItemType(MaterialType.EntityCard)(move)) {
|
|
36
|
+
if (move.location.type === LocationType.Pantheon) {
|
|
37
|
+
return this.onCardMoved(move);
|
|
38
|
+
}
|
|
39
|
+
else if (move.location.type === LocationType.PlayerDiscard) {
|
|
40
|
+
return this.onCardSacrificed(move);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return [];
|
|
44
|
+
}
|
|
45
|
+
onCardMoved(move) {
|
|
46
|
+
return [this.endPlayerTurn(move.location.player)];
|
|
47
|
+
}
|
|
48
|
+
onCardSacrificed(move) {
|
|
49
|
+
return [this.endPlayerTurn(move.location.player)];
|
|
50
|
+
}
|
|
51
|
+
getMovesAfterPlayersDone() {
|
|
52
|
+
this.updatePlayersGrids();
|
|
53
|
+
return super.getMovesAfterPlayersDone();
|
|
54
|
+
}
|
|
55
|
+
updatePlayersGrids() {
|
|
56
|
+
const events = [];
|
|
57
|
+
const triggerEffectsRule = new TriggerEffectsRule(this.game);
|
|
58
|
+
for (const player of triggerEffectsRule.getPlayersByEffectPriorityOrder()) {
|
|
59
|
+
const pantheon = new Pantheon(this.game, player);
|
|
60
|
+
events.push(...pantheon.updateGrid());
|
|
61
|
+
}
|
|
62
|
+
triggerEffectsRule.triggerEffects(...events);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ItemMove, Material, MaterialMove, MoveItem } from '@gamepark/rules-api';
|
|
2
|
-
import { PlayerColor } from '../../PlayerColor';
|
|
3
|
-
import { SimultaneousEffectRule } from './SimultaneousEffectRule';
|
|
4
|
-
export declare abstract class SimultaneousSacrificeEffectRule extends SimultaneousEffectRule {
|
|
5
|
-
getActivePlayerLegalMoves(player: PlayerColor): MaterialMove[];
|
|
6
|
-
private getCardsAbleToSacrifice;
|
|
7
|
-
getCardsToSacrifice(player: PlayerColor): Material;
|
|
8
|
-
beforeItemMove(move: ItemMove): MaterialMove[];
|
|
9
|
-
onSacrifice(move: MoveItem): import("@gamepark/rules-api").EndPlayerTurn<number>[];
|
|
10
|
-
}
|
|
1
|
+
import { ItemMove, Material, MaterialMove, MoveItem } from '@gamepark/rules-api';
|
|
2
|
+
import { PlayerColor } from '../../PlayerColor';
|
|
3
|
+
import { SimultaneousEffectRule } from './SimultaneousEffectRule';
|
|
4
|
+
export declare abstract class SimultaneousSacrificeEffectRule extends SimultaneousEffectRule {
|
|
5
|
+
getActivePlayerLegalMoves(player: PlayerColor): MaterialMove[];
|
|
6
|
+
private getCardsAbleToSacrifice;
|
|
7
|
+
getCardsToSacrifice(player: PlayerColor): Material;
|
|
8
|
+
beforeItemMove(move: ItemMove): MaterialMove[];
|
|
9
|
+
onSacrifice(move: MoveItem): import("@gamepark/rules-api").EndPlayerTurn<number>[];
|
|
10
|
+
}
|
|
@@ -1,55 +1,31 @@
|
|
|
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
|
-
var moves = cards.moveItems({ type: LocationType_1.LocationType.PlayerDiscard, player: player });
|
|
33
|
-
var indexes = cards.getIndexes();
|
|
34
|
-
var replaceSacrifice = new Pantheon_1.Pantheon(this.game, player).replaceSacrifice(cards.getItems()).index(function (index) { return !indexes.includes(index); });
|
|
35
|
-
return moves.concat(replaceSacrifice.moveItems({ type: LocationType_1.LocationType.PlayerDiscard, player: player }));
|
|
36
|
-
};
|
|
37
|
-
SimultaneousSacrificeEffectRule.prototype.getCardsAbleToSacrifice = function (player) {
|
|
38
|
-
var rule = new PermanentEffectsRule_1.PermanentEffectsRule(this.game);
|
|
39
|
-
return this.getCardsToSacrifice(player).filter(function (card) { return rule.canSacrifice(card); });
|
|
40
|
-
};
|
|
41
|
-
SimultaneousSacrificeEffectRule.prototype.getCardsToSacrifice = function (player) {
|
|
42
|
-
return new Pantheon_1.Pantheon(this.game, player).visibleEntities;
|
|
43
|
-
};
|
|
44
|
-
SimultaneousSacrificeEffectRule.prototype.beforeItemMove = function (move) {
|
|
45
|
-
if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.EntityCard)(move) && move.location.type === LocationType_1.LocationType.PlayerDiscard) {
|
|
46
|
-
return this.onSacrifice(move);
|
|
47
|
-
}
|
|
48
|
-
return [];
|
|
49
|
-
};
|
|
50
|
-
SimultaneousSacrificeEffectRule.prototype.onSacrifice = function (move) {
|
|
51
|
-
return [this.endPlayerTurn(move.location.player)];
|
|
52
|
-
};
|
|
53
|
-
return SimultaneousSacrificeEffectRule;
|
|
54
|
-
}(SimultaneousEffectRule_1.SimultaneousEffectRule));
|
|
55
|
-
exports.SimultaneousSacrificeEffectRule = SimultaneousSacrificeEffectRule;
|
|
1
|
+
import { isMoveItemType } from '@gamepark/rules-api';
|
|
2
|
+
import { PermanentEffectsRule } from '../../rules/effects/PermanentEffectsRule';
|
|
3
|
+
import { LocationType } from '../LocationType';
|
|
4
|
+
import { MaterialType } from '../MaterialType';
|
|
5
|
+
import { Pantheon } from '../Pantheon';
|
|
6
|
+
import { SimultaneousEffectRule } from './SimultaneousEffectRule';
|
|
7
|
+
export class SimultaneousSacrificeEffectRule extends SimultaneousEffectRule {
|
|
8
|
+
getActivePlayerLegalMoves(player) {
|
|
9
|
+
const cards = this.getCardsAbleToSacrifice(player);
|
|
10
|
+
const moves = cards.moveItems({ type: LocationType.PlayerDiscard, player });
|
|
11
|
+
const indexes = cards.getIndexes();
|
|
12
|
+
const replaceSacrifice = new Pantheon(this.game, player).replaceSacrifice(cards.getItems()).index((index) => !indexes.includes(index));
|
|
13
|
+
return moves.concat(replaceSacrifice.moveItems({ type: LocationType.PlayerDiscard, player }));
|
|
14
|
+
}
|
|
15
|
+
getCardsAbleToSacrifice(player) {
|
|
16
|
+
const rule = new PermanentEffectsRule(this.game);
|
|
17
|
+
return this.getCardsToSacrifice(player).filter((card) => rule.canSacrifice(card));
|
|
18
|
+
}
|
|
19
|
+
getCardsToSacrifice(player) {
|
|
20
|
+
return new Pantheon(this.game, player).visibleEntities;
|
|
21
|
+
}
|
|
22
|
+
beforeItemMove(move) {
|
|
23
|
+
if (isMoveItemType(MaterialType.EntityCard)(move) && move.location.type === LocationType.PlayerDiscard) {
|
|
24
|
+
return this.onSacrifice(move);
|
|
25
|
+
}
|
|
26
|
+
return [];
|
|
27
|
+
}
|
|
28
|
+
onSacrifice(move) {
|
|
29
|
+
return [this.endPlayerTurn(move.location.player)];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { EntityDescription } from '../EntityDescription';
|
|
2
|
-
export declare const Banshee: EntityDescription;
|
|
1
|
+
import { EntityDescription } from '../EntityDescription';
|
|
2
|
+
export declare const Banshee: EntityDescription;
|