move actions to ability

This commit is contained in:
openlegends 2024-03-17 00:21:00 +02:00
parent f154dbd08b
commit 0da9f94beb
4 changed files with 46 additions and 24 deletions

View File

@ -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
}
}

View File

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

View File

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

View File

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