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
68 lines (64 loc) · 2.1 KB
/
LandmarkAbilities.php
File metadata and controls
68 lines (64 loc) · 2.1 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
<?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 (CardSubtype($cardID) != "Landmark") {
WriteError($cardID . " was tried to play as a landmark, but is not a landmark.");
return;
}
array_push($landmarks, $cardID);
array_push($landmarks, $player); //The player that originally played the landmark
array_push($landmarks, $from);
}
function DestroyLandmark($index, $skipDestroy=false)
{
global $landmarks;
$cardID = $landmarks[$index];
$ownerID = $landmarks[$index + 1];
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 "MON000":
if (SearchPitchForColor($mainPlayer, 2) >= 2) {
AddCurrentTurnEffect("MON000", $mainPlayer);
}
break;
case "MST000":
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], "MST400", $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 "MST000":
if($landmarks[$i+1] != $mainPlayer) {
AddCurrentTurnEffect($landmarks[$i], $mainPlayer);
}
break;
default:
break;
}
}
}