|
|
|
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
|
|
|
|
use Doctrine\ORM\Mapping\Column;
|
|
|
|
use Doctrine\ORM\Mapping\Entity;
|
|
|
|
use Doctrine\ORM\Mapping\JoinColumn;
|
|
|
|
use Doctrine\ORM\Mapping\OneToOne;
|
|
|
|
|
|
|
|
#[Entity(repositoryClass: 'App\Repository\TechniqueRepository')]
|
|
|
|
class Technique extends Thing
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* For now we calculate costs for mastering a technique.
|
|
|
|
*/
|
|
|
|
#[Column]
|
|
|
|
public int $costs;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Formula to calculate the damage based on the stats.
|
|
|
|
*/
|
|
|
|
#[Column]
|
|
|
|
public string $damage;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Formula to calculate the consumed energy on use based on the stats.
|
|
|
|
*/
|
|
|
|
#[Column]
|
|
|
|
public string $energy;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Formula to calculate the hit chance accuracy based on the stats.
|
|
|
|
*/
|
|
|
|
#[Column]
|
|
|
|
public string $accuracy;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Technique that is required to be learned before this Technique.
|
|
|
|
*/
|
|
|
|
#[OneToOne()]
|
|
|
|
#[JoinColumn(onDelete: 'SET NULL', nullable: true)]
|
|
|
|
public ?Technique $prerequisite;
|
|
|
|
|
|
|
|
public function getCosts(): ?int
|
|
|
|
{
|
|
|
|
return $this->costs;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setCosts(int $costs): static
|
|
|
|
{
|
|
|
|
$this->costs = $costs;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getDamage(): ?string
|
|
|
|
{
|
|
|
|
return $this->damage;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setDamage(string $damage): static
|
|
|
|
{
|
|
|
|
$this->damage = $damage;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getEnergy(): ?string
|
|
|
|
{
|
|
|
|
return $this->energy;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setEnergy(string $energy): static
|
|
|
|
{
|
|
|
|
$this->energy = $energy;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getAccuracy(): ?string
|
|
|
|
{
|
|
|
|
return $this->accuracy;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setAccuracy(string $accuracy): static
|
|
|
|
{
|
|
|
|
$this->accuracy = $accuracy;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getPrerequisite(): ?self
|
|
|
|
{
|
|
|
|
return $this->prerequisite;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setPrerequisite(?self $prerequisite): static
|
|
|
|
{
|
|
|
|
$this->prerequisite = $prerequisite;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|