GameStates.js 3.6 KB

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