We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -3,11 +3,11 @@ |
||
3 | 3 | // Holds information linking the received message and the game data |
4 | 4 | class GameLink |
5 | 5 | { |
6 | - public $valid = false; // identifies if the message is linked to game data |
|
7 | - public $user; // Discord user associated with the message |
|
8 | - public $account; // SmrAccount instance |
|
9 | - public $alliance; // SmrAlliance instance |
|
10 | - public $player; // SmrPlayer instance |
|
6 | + public $valid = false; // identifies if the message is linked to game data |
|
7 | + public $user; // Discord user associated with the message |
|
8 | + public $account; // SmrAccount instance |
|
9 | + public $alliance; // SmrAlliance instance |
|
10 | + public $player; // SmrPlayer instance |
|
11 | 11 | |
12 | 12 | // Takes the following arguments: |
13 | 13 | // channel = Discord\Parts\Channel\Channel instance |
@@ -201,29 +201,29 @@ discard block |
||
201 | 201 | |
202 | 202 | public function getFENString() { |
203 | 203 | $fen = ''; |
204 | - $board =& $this->getBoard(); |
|
204 | + $board = & $this->getBoard(); |
|
205 | 205 | $blanks = 0; |
206 | - for($y=0; $y < 8; $y++) { |
|
207 | - if($y > 0) { |
|
206 | + for ($y = 0; $y < 8; $y++) { |
|
207 | + if ($y > 0) { |
|
208 | 208 | $fen .= '/'; |
209 | 209 | } |
210 | - for($x=0; $x < 8; $x++) { |
|
211 | - if($board[$y][$x] == null) { |
|
210 | + for ($x = 0; $x < 8; $x++) { |
|
211 | + if ($board[$y][$x] == null) { |
|
212 | 212 | $blanks++; |
213 | 213 | } else { |
214 | - if($blanks > 0) { |
|
214 | + if ($blanks > 0) { |
|
215 | 215 | $fen .= $blanks; |
216 | 216 | $blanks = 0; |
217 | 217 | } |
218 | 218 | $fen .= $board[$y][$x]->getPieceLetter(); |
219 | 219 | } |
220 | 220 | } |
221 | - if($blanks > 0) { |
|
221 | + if ($blanks > 0) { |
|
222 | 222 | $fen .= $blanks; |
223 | 223 | $blanks = 0; |
224 | 224 | } |
225 | 225 | } |
226 | - switch($this->getCurrentTurnColour()) { |
|
226 | + switch ($this->getCurrentTurnColour()) { |
|
227 | 227 | case self::PLAYER_WHITE: |
228 | 228 | $fen .= ' w '; |
229 | 229 | break; |
@@ -449,72 +449,72 @@ discard block |
||
449 | 449 | } |
450 | 450 | |
451 | 451 | public static function movePiece(array &$board, array &$hasMoved, $x, $y, $toX, $toY, $pawnPromotionPiece = ChessPiece::QUEEN) { |
452 | - if(!self::isValidCoord($x, $y, $board)) { |
|
452 | + if (!self::isValidCoord($x, $y, $board)) { |
|
453 | 453 | throw new Exception('Invalid from coordinates, x=' . $x . ', y=' . $y); |
454 | 454 | } |
455 | - if(!self::isValidCoord($toX, $toY, $board)) { |
|
455 | + if (!self::isValidCoord($toX, $toY, $board)) { |
|
456 | 456 | throw new Exception('Invalid to coordinates, x=' . $toX . ', y=' . $toY); |
457 | 457 | } |
458 | 458 | $pieceTaken = $board[$toY][$toX]; |
459 | 459 | $board[$toY][$toX] = $board[$y][$x]; |
460 | - $p =& $board[$toY][$toX]; |
|
460 | + $p = & $board[$toY][$toX]; |
|
461 | 461 | $board[$y][$x] = null; |
462 | - if($p == null) { |
|
462 | + if ($p == null) { |
|
463 | 463 | throw new Exception('Trying to move non-existent piece: ' . var_export($board, true)); |
464 | 464 | } |
465 | 465 | $p->setX($toX); |
466 | 466 | $p->setY($toY); |
467 | 467 | |
468 | 468 | $oldPawnMovement = $hasMoved[ChessPiece::PAWN]; |
469 | - $nextPawnMovement = array(-1,-1); |
|
469 | + $nextPawnMovement = array(-1, -1); |
|
470 | 470 | $castling = false; |
471 | 471 | $enPassant = false; |
472 | 472 | $rookMoved = false; |
473 | 473 | $rookTaken = false; |
474 | 474 | $pawnPromotion = false; |
475 | - if($p->pieceID == ChessPiece::KING) { |
|
475 | + if ($p->pieceID == ChessPiece::KING) { |
|
476 | 476 | //Castling? |
477 | 477 | $castling = self::isCastling($x, $toX); |
478 | - if($castling !== false) { |
|
478 | + if ($castling !== false) { |
|
479 | 479 | $hasMoved[$p->colour][ChessPiece::KING] = true; |
480 | 480 | $hasMoved[$p->colour][ChessPiece::ROOK][$castling['Type']] = true; |
481 | - if($board[$y][$castling['X']] == null) { |
|
481 | + if ($board[$y][$castling['X']] == null) { |
|
482 | 482 | throw new Exception('Cannot castle with non-existent castle.'); |
483 | 483 | } |
484 | 484 | $board[$toY][$castling['ToX']] = $board[$y][$castling['X']]; |
485 | 485 | $board[$toY][$castling['ToX']]->setX($castling['ToX']); |
486 | 486 | $board[$y][$castling['X']] = null; |
487 | 487 | } |
488 | - } elseif($p->pieceID == ChessPiece::PAWN) { |
|
489 | - if($toY == 0 || $toY == 7) { |
|
488 | + } elseif ($p->pieceID == ChessPiece::PAWN) { |
|
489 | + if ($toY == 0 || $toY == 7) { |
|
490 | 490 | $pawnPromotion = $p->promote($pawnPromotionPiece, $board); |
491 | 491 | } |
492 | 492 | //Double move to track? |
493 | - elseif(($y == 1 || $y == 6) && ($toY == 3 || $toY == 4)) { |
|
493 | + elseif (($y == 1 || $y == 6) && ($toY == 3 || $toY == 4)) { |
|
494 | 494 | $nextPawnMovement = array($toX, $toY); |
495 | 495 | } |
496 | 496 | //En passant? |
497 | - elseif($hasMoved[ChessPiece::PAWN][0] == $toX && |
|
497 | + elseif ($hasMoved[ChessPiece::PAWN][0] == $toX && |
|
498 | 498 | ($hasMoved[ChessPiece::PAWN][1] == 3 && $toY == 2 || $hasMoved[ChessPiece::PAWN][1] == 4 && $toY == 5)) { |
499 | 499 | $enPassant = true; |
500 | 500 | $pieceTaken = $board[$hasMoved[ChessPiece::PAWN][1]][$hasMoved[ChessPiece::PAWN][0]]; |
501 | - if($board[$hasMoved[ChessPiece::PAWN][1]][$hasMoved[ChessPiece::PAWN][0]] == null) { |
|
501 | + if ($board[$hasMoved[ChessPiece::PAWN][1]][$hasMoved[ChessPiece::PAWN][0]] == null) { |
|
502 | 502 | throw new Exception('Cannot en passant a non-existent pawn.'); |
503 | 503 | } |
504 | 504 | $board[$hasMoved[ChessPiece::PAWN][1]][$hasMoved[ChessPiece::PAWN][0]] = null; |
505 | 505 | } |
506 | - } elseif($p->pieceID == ChessPiece::ROOK && ($x == 0 || $x == 7) && $y == ($p->colour == self::PLAYER_WHITE ? 7 : 0)) { |
|
506 | + } elseif ($p->pieceID == ChessPiece::ROOK && ($x == 0 || $x == 7) && $y == ($p->colour == self::PLAYER_WHITE ? 7 : 0)) { |
|
507 | 507 | //Rook moved? |
508 | - if($hasMoved[$p->colour][ChessPiece::ROOK][$x==0?'Queen':'King'] === false) { |
|
508 | + if ($hasMoved[$p->colour][ChessPiece::ROOK][$x == 0 ? 'Queen' : 'King'] === false) { |
|
509 | 509 | // We set rook moved in here as it's used for move info. |
510 | - $rookMoved = $x==0?'Queen':'King'; |
|
510 | + $rookMoved = $x == 0 ? 'Queen' : 'King'; |
|
511 | 511 | $hasMoved[$p->colour][ChessPiece::ROOK][$rookMoved] = true; |
512 | 512 | } |
513 | 513 | } |
514 | 514 | // Check if we've taken a rook and marked them as moved, if they've already moved this does nothing, but if they were taken before moving this stops an issue with trying to castle with a non-existent castle. |
515 | - if($pieceTaken != null && $pieceTaken->pieceID == ChessPiece::ROOK && ($toX == 0 || $toX == 7) && $toY == ($pieceTaken->colour == self::PLAYER_WHITE ? 7 : 0)) { |
|
516 | - if($hasMoved[$pieceTaken->colour][ChessPiece::ROOK][$toX==0?'Queen':'King'] === false) { |
|
517 | - $rookTaken = $toX==0?'Queen':'King'; |
|
515 | + if ($pieceTaken != null && $pieceTaken->pieceID == ChessPiece::ROOK && ($toX == 0 || $toX == 7) && $toY == ($pieceTaken->colour == self::PLAYER_WHITE ? 7 : 0)) { |
|
516 | + if ($hasMoved[$pieceTaken->colour][ChessPiece::ROOK][$toX == 0 ? 'Queen' : 'King'] === false) { |
|
517 | + $rookTaken = $toX == 0 ? 'Queen' : 'King'; |
|
518 | 518 | $hasMoved[$pieceTaken->colour][ChessPiece::ROOK][$rookTaken] = true; |
519 | 519 | } |
520 | 520 | } |
@@ -531,18 +531,18 @@ discard block |
||
531 | 531 | } |
532 | 532 | |
533 | 533 | public static function undoMovePiece(array &$board, array &$hasMoved, $x, $y, $toX, $toY, $moveInfo) { |
534 | - if(!self::isValidCoord($x, $y, $board)) { |
|
534 | + if (!self::isValidCoord($x, $y, $board)) { |
|
535 | 535 | throw new Exception('Invalid from coordinates, x=' . $x . ', y=' . $y); |
536 | 536 | } |
537 | - if(!self::isValidCoord($toX, $toY, $board)) { |
|
537 | + if (!self::isValidCoord($toX, $toY, $board)) { |
|
538 | 538 | throw new Exception('Invalid to coordinates, x=' . $toX . ', y=' . $toY); |
539 | 539 | } |
540 | - if($board[$y][$x] != null) { |
|
540 | + if ($board[$y][$x] != null) { |
|
541 | 541 | throw new Exception('Undoing move onto another piece? x=' . $x . ', y=' . $y); |
542 | 542 | } |
543 | 543 | $board[$y][$x] = $board[$toY][$toX]; |
544 | - $p =& $board[$y][$x]; |
|
545 | - if($p == null) { |
|
544 | + $p = & $board[$y][$x]; |
|
545 | + if ($p == null) { |
|
546 | 546 | throw new Exception('Trying to undo move of a non-existent piece: ' . var_export($board, true)); |
547 | 547 | } |
548 | 548 | $board[$toY][$toX] = $moveInfo['PieceTaken']; |
@@ -591,73 +591,73 @@ discard block |
||
591 | 591 | $toX = ord($move[2]) - $aVal; |
592 | 592 | $toY = 8 - $move[3]; |
593 | 593 | $pawnPromotionPiece = null; |
594 | - if(isset($move[4])) { |
|
594 | + if (isset($move[4])) { |
|
595 | 595 | $pawnPromotionPiece = ChessPiece::getPieceForLetter($move[4]); |
596 | 596 | } |
597 | 597 | return $this->tryMove($x, $y, $toX, $toY, $this->getCurrentTurnAccountID(), $pawnPromotionPiece); |
598 | 598 | } |
599 | 599 | |
600 | 600 | public function tryMove($x, $y, $toX, $toY, $forAccountID, $pawnPromotionPiece) { |
601 | - if($this->hasEnded()) { |
|
601 | + if ($this->hasEnded()) { |
|
602 | 602 | return 5; |
603 | 603 | } |
604 | - if($this->getCurrentTurnAccountID() != $forAccountID) { |
|
604 | + if ($this->getCurrentTurnAccountID() != $forAccountID) { |
|
605 | 605 | return 4; |
606 | 606 | } |
607 | 607 | $lastTurnPlayer = $this->getCurrentTurnPlayer(); |
608 | 608 | $this->getBoard(); |
609 | 609 | $p = $this->board[$y][$x]; |
610 | - if($p == null || $p->colour != $this->getColourForAccountID($forAccountID)) { |
|
610 | + if ($p == null || $p->colour != $this->getColourForAccountID($forAccountID)) { |
|
611 | 611 | return 2; |
612 | 612 | } |
613 | 613 | |
614 | 614 | $moves = $p->getPossibleMoves($this->board, $this->getHasMoved(), $forAccountID); |
615 | - foreach($moves as $move) { |
|
616 | - if($move[0]==$toX && $move[1]==$toY) { |
|
615 | + foreach ($moves as $move) { |
|
616 | + if ($move[0] == $toX && $move[1] == $toY) { |
|
617 | 617 | $chessType = $this->isNPCGame() ? 'Chess (NPC)' : 'Chess'; |
618 | 618 | $currentPlayer = $this->getCurrentTurnPlayer(); |
619 | 619 | |
620 | 620 | $moveInfo = ChessGame::movePiece($this->board, $this->getHasMoved(), $x, $y, $toX, $toY, $pawnPromotionPiece); |
621 | 621 | |
622 | 622 | //We have taken the move, we should refresh $p |
623 | - $p =& $this->board[$toY][$toX]; |
|
623 | + $p = & $this->board[$toY][$toX]; |
|
624 | 624 | |
625 | 625 | $pieceTakenID = null; |
626 | - if($moveInfo['PieceTaken'] != null) { |
|
626 | + if ($moveInfo['PieceTaken'] != null) { |
|
627 | 627 | $pieceTakenID = $moveInfo['PieceTaken']->pieceID; |
628 | - if($moveInfo['PieceTaken']->pieceID == ChessPiece::KING) { |
|
628 | + if ($moveInfo['PieceTaken']->pieceID == ChessPiece::KING) { |
|
629 | 629 | throw new Exception('King was taken.'); |
630 | 630 | } |
631 | 631 | } |
632 | 632 | |
633 | 633 | $pieceID = $p->pieceID; |
634 | 634 | $pieceNo = $p->pieceNo; |
635 | - if($moveInfo['PawnPromotion'] !== false) { |
|
635 | + if ($moveInfo['PawnPromotion'] !== false) { |
|
636 | 636 | $p->pieceID = $moveInfo['PawnPromotion']['PieceID']; |
637 | 637 | $p->pieceNo = $moveInfo['PawnPromotion']['PieceNo']; |
638 | 638 | } |
639 | 639 | |
640 | 640 | $checking = null; |
641 | - if($p->isAttacking($this->board, $this->getHasMoved(), true)) { |
|
641 | + if ($p->isAttacking($this->board, $this->getHasMoved(), true)) { |
|
642 | 642 | $checking = 'CHECK'; |
643 | 643 | } |
644 | - if($this->isCheckmated(self::getOtherColour($p->colour))) { |
|
644 | + if ($this->isCheckmated(self::getOtherColour($p->colour))) { |
|
645 | 645 | $checking = 'MATE'; |
646 | 646 | } |
647 | - if($this->moves!=null) { |
|
647 | + if ($this->moves != null) { |
|
648 | 648 | $this->moves[] = $this->createMove($pieceID, $x, $y, $toX, $toY, $pieceTakenID, $checking, $this->getCurrentTurnColour(), $moveInfo['Castling']['Type'], $moveInfo['EnPassant'], $moveInfo['PawnPromotion'] === false ? null : $moveInfo['PawnPromotion']['PieceID']); |
649 | 649 | } |
650 | - if(self::isPlayerChecked($this->board, $this->getHasMoved(), $p->colour)) { |
|
650 | + if (self::isPlayerChecked($this->board, $this->getHasMoved(), $p->colour)) { |
|
651 | 651 | return 3; |
652 | 652 | } |
653 | 653 | |
654 | 654 | $otherPlayer = $this->getCurrentTurnPlayer(); |
655 | - if($moveInfo['PawnPromotion'] !== false) { |
|
655 | + if ($moveInfo['PawnPromotion'] !== false) { |
|
656 | 656 | $piecePromotedSymbol = $p->getPieceSymbol(); |
657 | - $currentPlayer->increaseHOF(1, array($chessType,'Moves','Own Pawns Promoted','Total'), HOF_PUBLIC); |
|
658 | - $otherPlayer->increaseHOF(1, array($chessType,'Moves','Opponent Pawns Promoted','Total'), HOF_PUBLIC); |
|
659 | - $currentPlayer->increaseHOF(1, array($chessType,'Moves','Own Pawns Promoted',$piecePromotedSymbol), HOF_PUBLIC); |
|
660 | - $otherPlayer->increaseHOF(1, array($chessType,'Moves','Opponent Pawns Promoted',$piecePromotedSymbol), HOF_PUBLIC); |
|
657 | + $currentPlayer->increaseHOF(1, array($chessType, 'Moves', 'Own Pawns Promoted', 'Total'), HOF_PUBLIC); |
|
658 | + $otherPlayer->increaseHOF(1, array($chessType, 'Moves', 'Opponent Pawns Promoted', 'Total'), HOF_PUBLIC); |
|
659 | + $currentPlayer->increaseHOF(1, array($chessType, 'Moves', 'Own Pawns Promoted', $piecePromotedSymbol), HOF_PUBLIC); |
|
660 | + $otherPlayer->increaseHOF(1, array($chessType, 'Moves', 'Opponent Pawns Promoted', $piecePromotedSymbol), HOF_PUBLIC); |
|
661 | 661 | } |
662 | 662 | |
663 | 663 | $castlingType = $moveInfo['Castling'] === false ? null : $moveInfo['Castling']['Type']; |
@@ -20,7 +20,9 @@ |
||
20 | 20 | } |
21 | 21 | |
22 | 22 | public static function cmpNum($a, $b) { |
23 | - if ($a == $b) return 0; |
|
23 | + if ($a == $b) { |
|
24 | + return 0; |
|
25 | + } |
|
24 | 26 | return (self::$reverseOrder ? -1 : 1) * ($a < $b ? -1 : 1); |
25 | 27 | } |
26 | 28 |
@@ -7,4 +7,4 @@ |
||
7 | 7 | $msg = '<span class="green">SUCCESS: </span>Enabled game ' . $game->getDisplayName(); |
8 | 8 | |
9 | 9 | forward(create_container('skeleton.php', 'enable_game.php', |
10 | - array('processing_msg' => $msg))); |
|
10 | + array('processing_msg' => $msg))); |
@@ -1,34 +1,34 @@ discard block |
||
1 | 1 | <?php |
2 | -if(isset($ForcesCombatResults['Results']) && is_array($ForcesCombatResults['Results'])) { |
|
3 | - foreach($ForcesCombatResults['Results'] as $ForceType => $ForceResults) { |
|
4 | - $ShootingWeapon =& $ForceResults['Weapon']; |
|
5 | - $ShotHit =& $ForceResults['Hit']; |
|
6 | - $ActualDamage =& $ForceResults['ActualDamage']; |
|
7 | - $WeaponDamage =& $ForceResults['WeaponDamage']; |
|
8 | - $TargetPlayer =& $ForceResults['TargetPlayer']; |
|
2 | +if (isset($ForcesCombatResults['Results']) && is_array($ForcesCombatResults['Results'])) { |
|
3 | + foreach ($ForcesCombatResults['Results'] as $ForceType => $ForceResults) { |
|
4 | + $ShootingWeapon = & $ForceResults['Weapon']; |
|
5 | + $ShotHit = & $ForceResults['Hit']; |
|
6 | + $ActualDamage = & $ForceResults['ActualDamage']; |
|
7 | + $WeaponDamage = & $ForceResults['WeaponDamage']; |
|
8 | + $TargetPlayer = & $ForceResults['TargetPlayer']; |
|
9 | 9 | ?> |
10 | 10 | <span class="cds"><?php echo $ActualDamage['Launched'] ?? $WeaponDamage['Launched']; ?></span><?php |
11 | - if($ForceType == 'Mines') { |
|
11 | + if ($ForceType == 'Mines') { |
|
12 | 12 | ?> mines kamikaze themselves against <?php |
13 | - } else if($ForceType == 'Drones') { |
|
13 | + } else if ($ForceType == 'Drones') { |
|
14 | 14 | ?> combat drones launch at <?php |
15 | - } else if($ForceType == 'Scouts') { |
|
15 | + } else if ($ForceType == 'Scouts') { |
|
16 | 16 | ?> scout drones kamikaze themselves against <?php |
17 | 17 | } |
18 | 18 | |
19 | - if($ShotHit && $ActualDamage['TargetAlreadyDead']){ ?> the debris that was once <?php } |
|
19 | + if ($ShotHit && $ActualDamage['TargetAlreadyDead']) { ?> the debris that was once <?php } |
|
20 | 20 | echo $TargetPlayer->getDisplayName(); |
21 | 21 | if (!$ShotHit || !$ActualDamage['TargetAlreadyDead']) { |
22 | - if(!$ShotHit) { |
|
22 | + if (!$ShotHit) { |
|
23 | 23 | ?> and misses<?php |
24 | - } else if($ActualDamage['TotalDamage'] == 0) { |
|
25 | - if($WeaponDamage['Shield'] > 0) { |
|
26 | - if($ActualDamage['HasCDs']) { |
|
24 | + } else if ($ActualDamage['TotalDamage'] == 0) { |
|
25 | + if ($WeaponDamage['Shield'] > 0) { |
|
26 | + if ($ActualDamage['HasCDs']) { |
|
27 | 27 | ?> which proves ineffective against their combat drones<?php |
28 | 28 | } else { |
29 | 29 | ?> which washes harmlessly over their hull<?php |
30 | 30 | } |
31 | - } else if($WeaponDamage['Armour'] > 0) { |
|
31 | + } else if ($WeaponDamage['Armour'] > 0) { |
|
32 | 32 | ?> which is deflected by their shields<?php |
33 | 33 | } else { |
34 | 34 | ?> but it cannot do any damage<?php |
@@ -37,31 +37,31 @@ discard block |
||
37 | 37 | ?> destroying <?php |
38 | 38 | } |
39 | 39 | $DamageTypes = 0; |
40 | - if($ActualDamage['Shield'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
41 | - if($ActualDamage['NumCDs'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
42 | - if($ActualDamage['Armour'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
40 | + if ($ActualDamage['Shield'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
41 | + if ($ActualDamage['NumCDs'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
42 | + if ($ActualDamage['Armour'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
43 | 43 | |
44 | - if($ActualDamage['Shield'] > 0) { |
|
44 | + if ($ActualDamage['Shield'] > 0) { |
|
45 | 45 | ?><span class="shields"><?php echo number_format($ActualDamage['Shield']) ?></span> shields<?php |
46 | 46 | $this->doDamageTypeReductionDisplay($DamageTypes); |
47 | 47 | } |
48 | - if($ActualDamage['NumCDs'] > 0) { |
|
48 | + if ($ActualDamage['NumCDs'] > 0) { |
|
49 | 49 | ?><span class="cds"><?php echo number_format($ActualDamage['NumCDs']) ?></span> drones<?php |
50 | 50 | $this->doDamageTypeReductionDisplay($DamageTypes); |
51 | 51 | } |
52 | - if($ActualDamage['Armour'] > 0) { |
|
52 | + if ($ActualDamage['Armour'] > 0) { |
|
53 | 53 | ?><span class="red"><?php echo number_format($ActualDamage['Armour']) ?></span> plates of armour<?php |
54 | 54 | } |
55 | 55 | } ?>. |
56 | 56 | <br /><?php |
57 | 57 | if ($ShotHit && $ActualDamage['KillingShot']) { |
58 | - $this->includeTemplate('includes/TraderCombatKillMessage.inc',array('KillResults'=>$ForceResults['KillResults'],'TargetPlayer'=>$TargetPlayer)); |
|
58 | + $this->includeTemplate('includes/TraderCombatKillMessage.inc', array('KillResults'=>$ForceResults['KillResults'], 'TargetPlayer'=>$TargetPlayer)); |
|
59 | 59 | } |
60 | 60 | } |
61 | 61 | } |
62 | -if(isset($ForcesCombatResults['ForcesDestroyed']) && $ForcesCombatResults['ForcesDestroyed']) { |
|
62 | +if (isset($ForcesCombatResults['ForcesDestroyed']) && $ForcesCombatResults['ForcesDestroyed']) { |
|
63 | 63 | ?>Forces are <span class="red">DESTROYED!</span><br /><?php |
64 | 64 | } |
65 | 65 | |
66 | -$TotalDamage =& $ForcesCombatResults['TotalDamage'] ?> |
|
67 | -The forces <?php if($TotalDamage > 0){ ?>hit for a total of <span class="red"><?php echo number_format($TotalDamage) ?></span> damage in this round of combat<?php } else{ ?>do no damage this round<?php } ?>. |
|
66 | +$TotalDamage = & $ForcesCombatResults['TotalDamage'] ?> |
|
67 | +The forces <?php if ($TotalDamage > 0) { ?>hit for a total of <span class="red"><?php echo number_format($TotalDamage) ?></span> damage in this round of combat<?php } else { ?>do no damage this round<?php } ?>. |
@@ -1,10 +1,10 @@ |
||
1 | -<?php if(isset($Preview)) { ?><table class="standard"><tr><td><?php echo bbifyMessage($Preview); ?></td></tr></table><?php } ?> |
|
1 | +<?php if (isset($Preview)) { ?><table class="standard"><tr><td><?php echo bbifyMessage($Preview); ?></td></tr></table><?php } ?> |
|
2 | 2 | <form name="MessageSendForm" method="POST" action="<?php echo $MessageSendFormHref; ?>"> |
3 | 3 | <p> |
4 | 4 | <b>From: </b><?php echo $ThisPlayer->getDisplayName(); ?><br /> |
5 | - <b>To: </b><?php if(isset($Receiver) && is_object($Receiver)) { echo $Receiver->getDisplayName(); } else { echo $Receiver; } ?> |
|
5 | + <b>To: </b><?php if (isset($Receiver) && is_object($Receiver)) { echo $Receiver->getDisplayName(); } else { echo $Receiver; } ?> |
|
6 | 6 | </p> |
7 | - <textarea spellcheck="true" name="message" required class="InputFields"><?php if(isset($Preview)) { echo $Preview; } ?></textarea><br /> |
|
7 | + <textarea spellcheck="true" name="message" required class="InputFields"><?php if (isset($Preview)) { echo $Preview; } ?></textarea><br /> |
|
8 | 8 | <br /> |
9 | 9 | <input type="submit" name="action" value="Send message" class="InputFields" /> <input type="submit" name="action" value="Preview message" class="InputFields" /> |
10 | 10 | </form> |
@@ -7,7 +7,7 @@ |
||
7 | 7 | $db->query('SELECT game_id, game_name FROM game WHERE game_type=' . $db->escapeNumber(SmrGame::GAME_TYPE_DRAFT) . ' AND join_time < ' . $db->escapeNumber(TIME) . ' AND end_time > ' . $db->escapeNumber(TIME) . ' ORDER BY start_time DESC'); |
8 | 8 | while ($db->nextRecord()) { |
9 | 9 | $activeGames[] = array('game_name' => $db->getField('game_name'), |
10 | - 'game_id' => $db->getInt('game_id')); |
|
10 | + 'game_id' => $db->getInt('game_id')); |
|
11 | 11 | } |
12 | 12 | $template->assign('ActiveGames', $activeGames); |
13 | 13 |
@@ -33,7 +33,7 @@ |
||
33 | 33 | } |
34 | 34 | |
35 | 35 | // If the Calculate Turn Cost button was pressed |
36 | -if (Request::get('action', '') == 'Calculate Turn Cost') { |
|
36 | +if (Request::get('action', '') == 'Calculate Turn Cost') { |
|
37 | 37 | $container = create_container('skeleton.php', 'sector_jump_calculate.php'); |
38 | 38 | $container['target'] = $target; |
39 | 39 | forward($container); |
@@ -3,7 +3,7 @@ |
||
3 | 3 | // Get the dates ("|" sets hr/min/sec to 0) |
4 | 4 | $join = DateTime::createFromFormat('d/m/Y|', Request::get('game_join')); |
5 | 5 | $start = empty(Request::get('game_start')) ? $join : |
6 | - DateTime::createFromFormat('d/m/Y|', Request::get('game_start')); |
|
6 | + DateTime::createFromFormat('d/m/Y|', Request::get('game_start')); |
|
7 | 7 | $end = DateTime::createFromFormat('d/m/Y|', Request::get('game_end')); |
8 | 8 | |
9 | 9 | $game = SmrGame::getGame($var['game_id']); |
@@ -2,8 +2,7 @@ |
||
2 | 2 | |
3 | 3 | // Get the dates ("|" sets hr/min/sec to 0) |
4 | 4 | $join = DateTime::createFromFormat('d/m/Y|', Request::get('game_join')); |
5 | -$start = empty(Request::get('game_start')) ? $join : |
|
6 | - DateTime::createFromFormat('d/m/Y|', Request::get('game_start')); |
|
5 | +$start = empty(Request::get('game_start')) ? $join : DateTime::createFromFormat('d/m/Y|', Request::get('game_start')); |
|
7 | 6 | $end = DateTime::createFromFormat('d/m/Y|', Request::get('game_end')); |
8 | 7 | |
9 | 8 | $game = SmrGame::getGame($var['game_id']); |