NumericAttributesCast.php 1.6 KB

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