mirror of
https://github.com/openlegends/asset-php.git
synced 2025-02-08 13:04:22 +00:00
move actions to ability
This commit is contained in:
parent
f154dbd08b
commit
0da9f94beb
46
src/Test/Card/Ability/Attack.php
Normal file
46
src/Test/Card/Ability/Attack.php
Normal 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
|
||||
}
|
||||
}
|
@ -62,12 +62,4 @@ class Goblin extends \OpenLegends\Engine\Abstract\Card
|
||||
3
|
||||
);
|
||||
}
|
||||
|
||||
public function act(
|
||||
\OpenLegends\Engine\Abstract\Card $target
|
||||
) {
|
||||
$this->attack(
|
||||
$target
|
||||
);
|
||||
}
|
||||
}
|
@ -48,12 +48,4 @@ class Mouse extends \OpenLegends\Engine\Abstract\Card
|
||||
1
|
||||
);
|
||||
}
|
||||
|
||||
public function act(
|
||||
\OpenLegends\Engine\Abstract\Card $target
|
||||
) {
|
||||
$this->attack(
|
||||
$target
|
||||
);
|
||||
}
|
||||
}
|
@ -48,12 +48,4 @@ class Rat extends \OpenLegends\Engine\Abstract\Card
|
||||
2
|
||||
);
|
||||
}
|
||||
|
||||
public function act(
|
||||
\OpenLegends\Engine\Abstract\Card $target
|
||||
) {
|
||||
$this->attack(
|
||||
$target
|
||||
);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user