forked from Talishar/Talishar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLandmarkAbilities.php
More file actions
92 lines (87 loc) · 2.8 KB
/
LandmarkAbilities.php
File metadata and controls
92 lines (87 loc) · 2.8 KB
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
<?php
function PlayLandmark($cardID, $player, $from="-")
{
global $landmarks;
if (count($landmarks) > 0) DestroyLandmark(0); //Right now, playing a new landmark destroys the old landmark
if (!SubtypeContains($cardID, "Landmark")) {
WriteLog($cardID . " was tried to play as a landmark, but is not a landmark.", highlight: true);
return;
}
array_push($landmarks, $cardID);
array_push($landmarks, $player); //The player that originally played the landmark
array_push($landmarks, $from);
array_push($landmarks, 0); // counters
switch ($cardID) {
case "treasure_island":
AddCurrentTurnEffect($cardID, $player);
break;
case "omens_of_arcana":
PlayAura("lightning_flow", 1);
PlayAura("lightning_flow", 2);
break;
default:
break;
}
}
function DestroyLandmark($index, $skipDestroy=false)
{
global $landmarks;
$cardID = $landmarks[$index];
$ownerID = $landmarks[$index + 1];
$landmarkPieces = LandmarkPieces();
for($j = $index + $landmarkPieces - 1; $j >= $index; --$j) {
unset($landmarks[$j]);
}
$landmarks = array_values($landmarks);
if(!$skipDestroy) AddGraveyard($cardID, $ownerID, "PLAY");
return $cardID;
}
function LandmarkBeginEndPhaseAbilities()
{
global $landmarks, $mainPlayer, $CS_NumBluePlayed, $CS_NumBlueDefended;
for ($i = 0; $i < count($landmarks); ++$i) {
switch ($landmarks[$i]) {
case "great_library_of_solana":
if (SearchPitchForColor($mainPlayer, 2) >= 2) {
AddCurrentTurnEffect("great_library_of_solana", $mainPlayer);
}
break;
case "mistcloak_gully":
if(GetClassState($landmarks[$i+1], $CS_NumBluePlayed) > 0 && SearchPitchForColor($landmarks[$i+1], 3) > 0 && GetClassState($landmarks[$i+1], $CS_NumBlueDefended) > 0) {
Transcend($landmarks[$i+1], "MST000_inner_chi_blue", $landmarks[$i+2]);
DestroyLandmark($i, true);
}
elseif(GetClassState($landmarks[$i+1], $CS_NumBluePlayed) <= 0 && SearchPitchForColor($landmarks[$i+1], 3) <= 0 && GetClassState($landmarks[$i+1], $CS_NumBlueDefended) <= 0) {
DestroyLandmark($i);
}
break;
default:
break;
}
}
}
function LandmarkStartTurnAbilities()
{
global $landmarks, $mainPlayer;
for ($i = 0; $i < count($landmarks); ++$i) {
switch ($landmarks[$i]) {
case "mistcloak_gully":
if($landmarks[$i+1] != $mainPlayer) {
AddCurrentTurnEffect($landmarks[$i], $mainPlayer);
}
break;
case "treasure_island":
AddCurrentTurnEffect($landmarks[$i], $mainPlayer);
break;
default:
break;
}
}
}
function SearchLandmarksForID($cardID)
{
global $landmarks;
//there should only ever be one landmark
if (!isset($landmarks[0])) return -1;
return $landmarks[0] == $cardID ? 0 : -1;
}