GameStates.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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. DressUp:-1
  56. });
  57. /**
  58. * 神龙小镇的种子类型
  59. * todo 后续可能根据DragonTownFarmland 需要种子的类型来确定播种
  60. */
  61. var SeedType = cc.Enum({
  62. //Normal -- 默认对应 DragonTownFarmland
  63. Normal:0,
  64. Cabbage:1,
  65. Potato:2,
  66. Carrot:3,
  67. Broccoli:4,
  68. Tomato:5,
  69. Squash:6,
  70. Eggplant:7,
  71. Pepper:8
  72. });
  73. var goodsMaterialClass = cc.Class({
  74. name: "goodsMaterialClass",
  75. properties: {
  76. //商品需要的材料
  77. crops: {
  78. default: 0,
  79. type: cc.Integer,
  80. tooltip: '农作物',
  81. },
  82. //商品需要的材料
  83. wood: {
  84. default: 0,
  85. type: cc.Integer,
  86. tooltip: '木材',
  87. },
  88. //商品需要的材料
  89. mineral: {
  90. default: 0,
  91. type: cc.Integer,
  92. tooltip: '矿石',
  93. },
  94. }
  95. });
  96. //商品信息
  97. var goods = cc.Class({
  98. name: "goodsInfo",
  99. properties: {
  100. //是否在销售此商品
  101. isItSale: {
  102. default: false,
  103. tooltip: '是否正在在销售这个商品',
  104. },
  105. //商品id
  106. goodsId: {
  107. default: 0,
  108. type: cc.Integer,
  109. tooltip: '商品id',
  110. },
  111. //商品名称
  112. goodsName: {
  113. default: '',
  114. },
  115. //商品价格
  116. goodsPrice: {
  117. default: 0,
  118. type: cc.Integer,
  119. tooltip: '商品对应的价格',
  120. },
  121. //商品销售效率
  122. goodsSalesRate: {
  123. default: 0,
  124. type: cc.Integer,
  125. tooltip: '商品销售效率',
  126. },
  127. //商品需要的材料
  128. goodsMaterial: {
  129. default: null,
  130. type: goodsMaterialClass,
  131. tooltip: '商品需要的材料',
  132. },
  133. }
  134. });
  135. cc.Class({
  136. extends: cc.Component,
  137. //Enum
  138. statics: {
  139. moveType,
  140. AI_Worker_Type,
  141. BuildType,
  142. goods,
  143. goodsMaterialClass,
  144. AI_Animation_Type,
  145. HighwayType,
  146. SeedType
  147. },
  148. });