game/_incl_data/class/DTO/BattleSpell.php

27 lines
617 B
PHP

<?php
namespace DTO;
class BattleSpell
{
public string $name;
public string $elemental;
public int $damage;
public string $color;
public string $colorCrit;
public string $colorMiss;
public function __construct(string $elemental)
{
if (!in_array($elemental, ['fire', 'water', 'air', 'earth', 'light', 'dark'])) {
$this->elemental = 'raw';
}
if ($elemental === 'fire') {
$this->elemental = $elemental;
$this->color = '#a00';
$this->colorCrit = '#f00';
$this->colorMiss = '#909090';
}
}
}