GameStates.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. //移动方向的枚举
  2. var moveType = cc.Enum({
  3. none: 0,
  4. moveUp: 1,
  5. moveRight: 2,
  6. moveDown: 3,
  7. moveLeft: 4,
  8. });
  9. //公路方向的枚举
  10. var HighwayType = cc.Enum({
  11. none: 0,//空的,
  12. moveX: 1,//移动X方向时候的道路
  13. moveY: 2,//移动Y方向时候的道路
  14. ZebraCrossingX: 3,//斑马线
  15. ZebraCrossingY: 4,
  16. });
  17. //工人AI类型枚举
  18. var AI_Worker_Type = cc.Enum({
  19. Rube: -1,//农夫
  20. Lumberjack: -1,//伐木工
  21. Miner: -1,//矿工
  22. CarryGay: -1,//搬运工
  23. Nothing: -1,//无状态时候
  24. });
  25. //工人当前的状态
  26. var AI_Animation_Type = cc.Enum({
  27. None: -1,//没有状态
  28. Walk: -1,//目前Run
  29. Idle: -1,//站立
  30. Hatchet: -1,//砍树
  31. Pickaxe: -1,//挖矿
  32. Poke: -1,//摘果实
  33. CargoCarryBox: -1,//货物运输,有车
  34. CargoCarryRaw: -1,//载货原料
  35. });
  36. //建筑的类型
  37. var BuildType = cc.Enum({
  38. //住房
  39. Housing: -1,
  40. //农田
  41. Farmland: -1,
  42. //采木场
  43. TimberYard: -1,
  44. //矿坑
  45. MiningPit: -1,
  46. //工厂
  47. Factory: -1,
  48. //商店
  49. Shop: -1,
  50. //特殊建筑
  51. Special: -1,
  52. //神农小镇 种子土地
  53. HolyFarmland:-1
  54. });
  55. /**
  56. * 神龙小镇的种子类型
  57. * todo 后续可能根据DragonTownFarmland 需要种子的类型来确定播种
  58. */
  59. var SeedType = cc.Enum({
  60. //Normal -- 默认对应 DragonTownFarmland
  61. Normal:0,
  62. Cabbage:1,
  63. Potato:2,
  64. Carrot:3,
  65. Broccoli:4,
  66. Tomato:5,
  67. Squash:6,
  68. Eggplant:7,
  69. Pepper:8
  70. });
  71. var goodsMaterialClass = cc.Class({
  72. name: "goodsMaterialClass",
  73. properties: {
  74. //商品需要的材料
  75. crops: {
  76. default: 0,
  77. type: cc.Integer,
  78. tooltip: '农作物',
  79. },
  80. //商品需要的材料
  81. wood: {
  82. default: 0,
  83. type: cc.Integer,
  84. tooltip: '木材',
  85. },
  86. //商品需要的材料
  87. mineral: {
  88. default: 0,
  89. type: cc.Integer,
  90. tooltip: '矿石',
  91. },
  92. }
  93. });
  94. //商品信息
  95. var goods = cc.Class({
  96. name: "goodsInfo",
  97. properties: {
  98. //是否在销售此商品
  99. isItSale: {
  100. default: false,
  101. tooltip: '是否正在在销售这个商品',
  102. },
  103. //商品id
  104. goodsId: {
  105. default: 0,
  106. type: cc.Integer,
  107. tooltip: '商品id',
  108. },
  109. //商品名称
  110. goodsName: {
  111. default: '',
  112. },
  113. //商品价格
  114. goodsPrice: {
  115. default: 0,
  116. type: cc.Integer,
  117. tooltip: '商品对应的价格',
  118. },
  119. //商品销售效率
  120. goodsSalesRate: {
  121. default: 0,
  122. type: cc.Integer,
  123. tooltip: '商品销售效率',
  124. },
  125. //商品需要的材料
  126. goodsMaterial: {
  127. default: null,
  128. type: goodsMaterialClass,
  129. tooltip: '商品需要的材料',
  130. },
  131. }
  132. });
  133. cc.Class({
  134. extends: cc.Component,
  135. //Enum
  136. statics: {
  137. moveType,
  138. AI_Worker_Type,
  139. BuildType,
  140. goods,
  141. goodsMaterialClass,
  142. AI_Animation_Type,
  143. HighwayType,
  144. SeedType
  145. },
  146. });