diff --git a/README.md b/README.md index 4da8ea5..0be1cbb 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # Game Assets for Open Legends -Game schemes, items and behavior implementation based on the [engine-php](https://github.com/openlegends/engine-php) interface. \ No newline at end of file +Game schemes, items and behavior implementation based on the [core-php](https://github.com/openlegends/core-php) interface. \ No newline at end of file diff --git a/src/Test/Card/Ability/Breakthrough.php b/src/Test/Card/Ability/Breakthrough.php index 308d23e..d6141c7 100644 --- a/src/Test/Card/Ability/Breakthrough.php +++ b/src/Test/Card/Ability/Breakthrough.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace OpenLegends\Asset\Test\Card\Ability; -class Breakthrough extends \OpenLegends\Engine\Abstract\Card\Ability +class Breakthrough extends \OpenLegends\Core\Abstract\Card\Ability { public function __construct() { diff --git a/src/Test/Card/Ability/Damage.php b/src/Test/Card/Ability/Damage.php index 6bb52fa..08d47cb 100644 --- a/src/Test/Card/Ability/Damage.php +++ b/src/Test/Card/Ability/Damage.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace OpenLegends\Asset\Test\Card\Ability; -class Damage extends \OpenLegends\Engine\Abstract\Card\Ability +class Damage extends \OpenLegends\Core\Abstract\Card\Ability { public function __construct() { diff --git a/src/Test/Card/Ability/Drain.php b/src/Test/Card/Ability/Drain.php index e74c8bf..70c4de5 100644 --- a/src/Test/Card/Ability/Drain.php +++ b/src/Test/Card/Ability/Drain.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace OpenLegends\Asset\Test\Card\Ability; -class Drain extends \OpenLegends\Engine\Abstract\Card\Ability +class Drain extends \OpenLegends\Core\Abstract\Card\Ability { public function __construct() { diff --git a/src/Test/Card/Ability/Multiple.php b/src/Test/Card/Ability/Multiple.php index 6780aaf..b72d01b 100644 --- a/src/Test/Card/Ability/Multiple.php +++ b/src/Test/Card/Ability/Multiple.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace OpenLegends\Asset\Test\Card\Ability; -class Multiple extends \OpenLegends\Engine\Abstract\Card\Ability +class Multiple extends \OpenLegends\Core\Abstract\Card\Ability { private array $_abilities = []; @@ -20,7 +20,7 @@ class Multiple extends \OpenLegends\Engine\Abstract\Card\Ability } public function add( - \OpenLegends\Engine\Abstract\Card\Ability $ability + \OpenLegends\Core\Abstract\Card\Ability $ability ): void { $this->_abilities[] = $ability; diff --git a/src/Test/Card/Action/Damage.php b/src/Test/Card/Action/Damage.php index 9bf9620..bcec7a4 100644 --- a/src/Test/Card/Action/Damage.php +++ b/src/Test/Card/Action/Damage.php @@ -4,22 +4,22 @@ declare(strict_types=1); namespace OpenLegends\Asset\Test\Card\Action; -class Damage extends \OpenLegends\Engine\Abstract\Card\Action +class Damage extends \OpenLegends\Core\Abstract\Card\Action { - private \OpenLegends\Engine\Abstract\Card $_card; + private \OpenLegends\Core\Abstract\Card $_card; private int $_power = 0; private int $_breakthrough = 0; public function __construct( - \OpenLegends\Engine\Abstract\Card $card + \OpenLegends\Core\Abstract\Card $card ) { $this->_card = $card; } public function card( - \OpenLegends\Engine\Abstract\Card &$card, + \OpenLegends\Core\Abstract\Card &$card, ): void { $damage = $this->getPower() ? $this->getPower() : $this->_card->getPower(); @@ -64,7 +64,7 @@ class Damage extends \OpenLegends\Engine\Abstract\Card\Action } public function player( - \OpenLegends\Engine\Abstract\Player &$player, + \OpenLegends\Core\Abstract\Player &$player, ): void { $damage = $this->getPower() ? $this->getPower() : $this->_card->getPower(); diff --git a/src/Test/Card/Action/Heal.php b/src/Test/Card/Action/Heal.php index 1279edb..788f569 100644 --- a/src/Test/Card/Action/Heal.php +++ b/src/Test/Card/Action/Heal.php @@ -4,20 +4,20 @@ declare(strict_types=1); namespace OpenLegends\Asset\Test\Card\Action; -class Heal extends \OpenLegends\Engine\Abstract\Card\Action +class Heal extends \OpenLegends\Core\Abstract\Card\Action { - private \OpenLegends\Engine\Abstract\Card $_card; + private \OpenLegends\Core\Abstract\Card $_card; private int $_power = 0; public function __construct( - \OpenLegends\Engine\Abstract\Card $card + \OpenLegends\Core\Abstract\Card $card ) { $this->_card = $card; } public function card( - \OpenLegends\Engine\Abstract\Card &$card + \OpenLegends\Core\Abstract\Card &$card ): void { $card->setHealth( @@ -26,7 +26,7 @@ class Heal extends \OpenLegends\Engine\Abstract\Card\Action } public function player( - \OpenLegends\Engine\Abstract\Player &$player + \OpenLegends\Core\Abstract\Player &$player ): void { $player->setHealth( diff --git a/src/Test/Card/Attribute/Goblin.php b/src/Test/Card/Attribute/Goblin.php index 1294330..7ff10d3 100644 --- a/src/Test/Card/Attribute/Goblin.php +++ b/src/Test/Card/Attribute/Goblin.php @@ -4,5 +4,5 @@ declare(strict_types=1); namespace OpenLegends\Asset\Test\Card\Attribute; -class Goblin extends \OpenLegends\Engine\Abstract\Card\Attribute +class Goblin extends \OpenLegends\Core\Abstract\Card\Attribute {} \ No newline at end of file diff --git a/src/Test/Card/Attribute/Multiple.php b/src/Test/Card/Attribute/Multiple.php index ae3ced9..45e3a8e 100644 --- a/src/Test/Card/Attribute/Multiple.php +++ b/src/Test/Card/Attribute/Multiple.php @@ -4,5 +4,5 @@ declare(strict_types=1); namespace OpenLegends\Asset\Test\Card\Attribute; -class Multiple extends \OpenLegends\Engine\Abstract\Card\Attribute +class Multiple extends \OpenLegends\Core\Abstract\Card\Attribute {} \ No newline at end of file diff --git a/src/Test/Card/Attribute/Neutral.php b/src/Test/Card/Attribute/Neutral.php index 740c678..f98327e 100644 --- a/src/Test/Card/Attribute/Neutral.php +++ b/src/Test/Card/Attribute/Neutral.php @@ -4,5 +4,5 @@ declare(strict_types=1); namespace OpenLegends\Asset\Test\Card\Attribute; -class Neutral extends \OpenLegends\Engine\Abstract\Card\Attribute +class Neutral extends \OpenLegends\Core\Abstract\Card\Attribute {} \ No newline at end of file diff --git a/src/Test/Card/Goblin.php b/src/Test/Card/Goblin.php index 2eaf010..d83c7aa 100644 --- a/src/Test/Card/Goblin.php +++ b/src/Test/Card/Goblin.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace OpenLegends\Asset\Test\Card; -class Goblin extends \OpenLegends\Engine\Abstract\Card +class Goblin extends \OpenLegends\Core\Abstract\Card { public function __construct() { diff --git a/src/Test/Card/Mouse.php b/src/Test/Card/Mouse.php index b95b5fd..b989852 100644 --- a/src/Test/Card/Mouse.php +++ b/src/Test/Card/Mouse.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace OpenLegends\Asset\Test\Card; -class Mouse extends \OpenLegends\Engine\Abstract\Card +class Mouse extends \OpenLegends\Core\Abstract\Card { public function __construct() { @@ -84,4 +84,50 @@ class Mouse extends \OpenLegends\Engine\Abstract\Card new \OpenLegends\Asset\Test\Card\Ability\Damage() ); } + + public function onCard( + \OpenLegends\Core\Abstract\Card $card + ) + { + $damage = new \OpenLegends\Asset\Test\Card\Action\Damage( + $mouse + ); + + $damage->card( + $card + ); + + if ($damage->getBreakthrough()) + { + $damage = new \OpenLegends\Asset\Test\Card\Action\Damage( + $mouse + ); + + $damage->setPower( + $damage->getBreakthrough() + ); + + $damage->player( + $player + ); + } + } + + public function onPlayer( + \OpenLegends\Core\Abstract\Player $player + ) + { + $damage = new \OpenLegends\Asset\Test\Card\Action\Damage( + $mouse + ); + + $damage->player( + $player + ); + } + + public function onDiscard( + $card + ) + {} } \ No newline at end of file diff --git a/src/Test/Card/Rarity/Common.php b/src/Test/Card/Rarity/Common.php index 99da7f5..a8a0e45 100644 --- a/src/Test/Card/Rarity/Common.php +++ b/src/Test/Card/Rarity/Common.php @@ -4,5 +4,5 @@ declare(strict_types=1); namespace OpenLegends\Asset\Test\Card\Rarity; -class Common extends \OpenLegends\Engine\Abstract\Card\Rarity +class Common extends \OpenLegends\Core\Abstract\Card\Rarity {} \ No newline at end of file diff --git a/src/Test/Card/Rarity/Rare.php b/src/Test/Card/Rarity/Rare.php index 282e823..2eb109e 100644 --- a/src/Test/Card/Rarity/Rare.php +++ b/src/Test/Card/Rarity/Rare.php @@ -4,5 +4,5 @@ declare(strict_types=1); namespace OpenLegends\Asset\Test\Card\Rarity; -class Rare extends \OpenLegends\Engine\Abstract\Card\Rarity +class Rare extends \OpenLegends\Core\Abstract\Card\Rarity {} \ No newline at end of file diff --git a/src/Test/Card/Rat.php b/src/Test/Card/Rat.php index 14e3e67..6776dd3 100644 --- a/src/Test/Card/Rat.php +++ b/src/Test/Card/Rat.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace OpenLegends\Asset\Test\Card; -class Rat extends \OpenLegends\Engine\Abstract\Card +class Rat extends \OpenLegends\Core\Abstract\Card { public function __construct() { diff --git a/src/Test/Card/Type/Animal.php b/src/Test/Card/Type/Animal.php index 4248d17..1c2ba2b 100644 --- a/src/Test/Card/Type/Animal.php +++ b/src/Test/Card/Type/Animal.php @@ -4,5 +4,5 @@ declare(strict_types=1); namespace OpenLegends\Asset\Test\Card\Type; -class Animal extends \OpenLegends\Engine\Abstract\Card\Type +class Animal extends \OpenLegends\Core\Abstract\Card\Type {} \ No newline at end of file diff --git a/src/Test/Card/Type/Goblin.php b/src/Test/Card/Type/Goblin.php index 607a0cc..d1deb0a 100644 --- a/src/Test/Card/Type/Goblin.php +++ b/src/Test/Card/Type/Goblin.php @@ -4,5 +4,5 @@ declare(strict_types=1); namespace OpenLegends\Asset\Test\Card\Type; -class Goblin extends \OpenLegends\Engine\Abstract\Card\Type +class Goblin extends \OpenLegends\Core\Abstract\Card\Type {} \ No newline at end of file diff --git a/src/Test/Game/Arena.php b/src/Test/Game/Arena.php index 6de3982..d033746 100644 --- a/src/Test/Game/Arena.php +++ b/src/Test/Game/Arena.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace OpenLegends\Asset\Test\Game; -class Arena extends \OpenLegends\Engine\Abstract\Game +class Arena extends \OpenLegends\Core\Abstract\Game { public function __construct() { diff --git a/src/Test/Game/Player/Player1.php b/src/Test/Game/Player/Player1.php index 3ee554e..ba9c5b3 100644 --- a/src/Test/Game/Player/Player1.php +++ b/src/Test/Game/Player/Player1.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace OpenLegends\Asset\Test\Game\Player; -class Player1 extends \OpenLegends\Engine\Abstract\Game\Player +class Player1 extends \OpenLegends\Core\Abstract\Game\Player { public function __construct() { diff --git a/src/Test/Game/Player/Player2.php b/src/Test/Game/Player/Player2.php index 1b3c0fe..3f8c53c 100644 --- a/src/Test/Game/Player/Player2.php +++ b/src/Test/Game/Player/Player2.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace OpenLegends\Asset\Test\Game\Player; -class Player2 extends \OpenLegends\Engine\Abstract\Game\Player +class Player2 extends \OpenLegends\Core\Abstract\Game\Player { public function __construct() { diff --git a/src/Test/Pool/Card.php b/src/Test/Pool/Card.php index c944256..898ad3c 100644 --- a/src/Test/Pool/Card.php +++ b/src/Test/Pool/Card.php @@ -4,5 +4,5 @@ declare(strict_types=1); namespace OpenLegends\Asset\Test\Pool; -class Card extends \OpenLegends\Engine\Abstract\Pool\Card +class Card extends \OpenLegends\Core\Abstract\Pool\Card {} \ No newline at end of file diff --git a/src/Test/User/Type/Elf.php b/src/Test/User/Type/Elf.php index d5bb1a9..37ab8c3 100644 --- a/src/Test/User/Type/Elf.php +++ b/src/Test/User/Type/Elf.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace OpenLegends\Asset\Test\User\Type; -class Elf extends \OpenLegends\Engine\Abstract\User\Type +class Elf extends \OpenLegends\Core\Abstract\User\Type { public function __construct() {