NumericAttributesCast.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. namespace App\Module\GameItems\Casts;
  3. use UCore\Model\CastsAttributes;
  4. /**
  5. * 物品数值属性类型转换器
  6. *
  7. * 用于将数据库中存储的JSON格式的物品数值属性转换为PHP对象,以及将PHP对象转换回JSON格式。
  8. * 物品数值属性包含用于游戏逻辑计算的属性,如宝箱掉落数量、宠物属性加成、奖励物品组等。
  9. * 这些属性直接影响游戏玩法和平衡性,是物品系统的核心数据。
  10. */
  11. class NumericAttributesCast extends CastsAttributes
  12. {
  13. /**
  14. * 宝箱最小数量
  15. *
  16. * @var int $min_drop_count
  17. */
  18. public int $min_drop_count = 0;
  19. /**
  20. * 宝箱最大数量
  21. *
  22. * @var int $max_drop_count
  23. */
  24. public int $max_drop_count = 0;
  25. /**
  26. * 减少作物生长时间
  27. *
  28. * @var int $intd
  29. */
  30. public int $crop_growth_time = 0;
  31. /**
  32. * 增加宠物体力
  33. *
  34. * @var int $pet_power
  35. */
  36. public int $pet_power = 0;
  37. /**
  38. * 使用后随即奖励物品组
  39. *
  40. * @var int $reward_group_id
  41. */
  42. public int $reward_group_id = 0;
  43. /**
  44. * 增加宠物经验
  45. *
  46. * @var int $pet_exp
  47. */
  48. public int $pet_exp = 0;
  49. /**
  50. * 除虫概率(百分比格式,100=100%)
  51. *
  52. * @var int $fram_pesticide_rate
  53. */
  54. public int $fram_pesticide_rate = 0;
  55. /**
  56. * 解决干旱概率(百分比格式,100=100%)
  57. *
  58. * @var int $fram_drought_rate
  59. */
  60. public int $fram_drought_rate = 0;
  61. /**
  62. * 除草概率(百分比格式,100=100%)
  63. *
  64. * @var int $fram_weedicide_rate
  65. */
  66. public int $fram_weedicide_rate = 0;
  67. }