forked from SWU-Petranaki/SWUOnline
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLeaderAbilities.php
More file actions
57 lines (52 loc) · 1.94 KB
/
LeaderAbilities.php
File metadata and controls
57 lines (52 loc) · 1.94 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
<?php
function LeaderPilotDeploy($player, $leader, $target) {
global $CS_CachedLeader1EpicAction;
$targetUnit = new Ally($target, $player);
$cardID = LeaderUnit($leader);
$epicAction = $leader != "8520821318" ? 1 : 0;//Poe Dameron JTL leader
if($epicAction == 1) SetClassState($player, $CS_CachedLeader1EpicAction, $epicAction);
$targetUnit->Attach($cardID, $player, epicAction:$epicAction);
switch($cardID) {
//Jump to Lightspeed
case "f6eb711cf3"://Boba Fett
AddDecisionQueue("MULTIZONEINDICES", $player, "MYALLY&THEIRALLY");
AddDecisionQueue("PREPENDLASTRESULT", $player, "4-", 1);
AddDecisionQueue("SETDQCONTEXT", $player, "Deal 4 damage divided as you choose", 1);
AddDecisionQueue("PARTIALMULTIDAMAGEMULTIZONE", $player, "<-", 1);
AddDecisionQueue("MZOP", $player, DealMultiDamageBuilder($player), 1);
break;
case "a015eb5c5e"://Han Solo
HanSoloPilotLeaderJTL($player);
break;
case "3064aff14f"://Lando Calrissian
$otherArena = $targetUnit->CurrentArena() == "Ground" ? "Space" : "Ground";
AddDecisionQueue("MULTIZONEINDICES", $player, "MYALLY:arena=$otherArena");
AddDecisionQueue("SETDQCONTEXT", $player, "Choose a unit to give a Shield token");
AddDecisionQueue("MAYCHOOSEMULTIZONE", $player, "<-", 1);
AddDecisionQueue("MZOP", $player, "ADDSHIELD", 1);
break;
case "fb0da8985e"://Darth Vader
CreateTieFighter($player);
CreateTieFighter($player);
break;
default: break;
}
}
function HanSoloPilotLeaderJTL($player) {
$odds = 0;
$allies = GetAllies($player);
for($i=0; $i<count($allies); $i+=AllyPieces()) {
$ally = new Ally($allies[$i+5], $player);
if(CardCostIsOdd($ally->CardID())) {
$odds++;
}
$upgrades = $ally->GetUpgrades(withMetadata:false);
for($j=0; $j<count($upgrades); ++$j) {
if(CardCostIsOdd($upgrades[$j])) {
$odds++;
}
}
}
ReadyResource($player, $odds);
}
?>