Browse Source

move actions to ability

main
openlegends 9 months ago
parent
commit
0da9f94beb
  1. 46
      src/Test/Card/Ability/Attack.php
  2. 8
      src/Test/Card/Goblin.php
  3. 8
      src/Test/Card/Mouse.php
  4. 8
      src/Test/Card/Rat.php

46
src/Test/Card/Ability/Attack.php

@ -0,0 +1,46 @@ @@ -0,0 +1,46 @@
<?php
declare(strict_types=1);
namespace OpenLegends\Asset\Test\Card\Ability;
class Attack extends \OpenLegends\Engine\Abstract\Card\Ability
{
public function player()
{}
public function opponent()
{}
public function card(
\OpenLegends\Engine\Abstract\Card $source,
\OpenLegends\Engine\Abstract\Card $target
) {
$target->setHealth(
$target->getHealth() - $source->getPower()
);
$source->setHealth(
$source->getHealth() - $target->getPower()
);
}
public function silentize(
\OpenLegends\Engine\Abstract\Card $target,
\OpenLegends\Engine\Abstract\Card $origin
) {
$target->setCost(
$origin->getCost()
);
$target->setPower(
$origin->getPower()
);
$target->setHealth(
$origin->getHealth()
);
// @TODO remove abilities
}
}

8
src/Test/Card/Goblin.php

@ -62,12 +62,4 @@ class Goblin extends \OpenLegends\Engine\Abstract\Card @@ -62,12 +62,4 @@ class Goblin extends \OpenLegends\Engine\Abstract\Card
3
);
}
public function act(
\OpenLegends\Engine\Abstract\Card $target
) {
$this->attack(
$target
);
}
}

8
src/Test/Card/Mouse.php

@ -48,12 +48,4 @@ class Mouse extends \OpenLegends\Engine\Abstract\Card @@ -48,12 +48,4 @@ class Mouse extends \OpenLegends\Engine\Abstract\Card
1
);
}
public function act(
\OpenLegends\Engine\Abstract\Card $target
) {
$this->attack(
$target
);
}
}

8
src/Test/Card/Rat.php

@ -48,12 +48,4 @@ class Rat extends \OpenLegends\Engine\Abstract\Card @@ -48,12 +48,4 @@ class Rat extends \OpenLegends\Engine\Abstract\Card
2
);
}
public function act(
\OpenLegends\Engine\Abstract\Card $target
) {
$this->attack(
$target
);
}
}
Loading…
Cancel
Save