FarmShrineNumericAttributesCast.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace App\Module\Farm\Casts;
  3. use UCore\Model\CastsAttributes;
  4. /**
  5. * 神像数值属性类型转换器
  6. *
  7. * 用于将数据库中存储的JSON格式的神像数值属性转换为PHP对象,以及将PHP对象转换回JSON格式。
  8. * 数值属性包含用于游戏逻辑计算的属性,如效果加成、持续时间加成等。
  9. */
  10. class FarmShrineNumericAttributesCast extends CastsAttributes
  11. {
  12. /**
  13. * 效果强度加成(百分比)
  14. *
  15. * @var float $effect_bonus
  16. */
  17. public float $effect_bonus = 0.0;
  18. /**
  19. * 持续时间加成(小时)
  20. *
  21. * @var int $duration_bonus
  22. */
  23. public int $duration_bonus = 0;
  24. /**
  25. * 冷却时间减少(百分比)
  26. *
  27. * @var float $cooldown_reduction
  28. */
  29. public float $cooldown_reduction = 0.0;
  30. /**
  31. * 激活消耗减少(百分比)
  32. *
  33. * @var float $cost_reduction
  34. */
  35. public float $cost_reduction = 0.0;
  36. /**
  37. * 额外效果ID
  38. *
  39. * @var int $extra_effect_id
  40. */
  41. public int $extra_effect_id = 0;
  42. }