64cad9e4-be22-4be3-88c6-11e330b63b60.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. "use strict";
  2. cc._RF.push(module, '64cadnkviJL44jGEeMwtjtg', 'Constant');
  3. // scripts/Framework/Constant.ts
  4. "use strict";
  5. Object.defineProperty(exports, "__esModule", { value: true });
  6. exports.SkillInfo = exports.GunInfo = exports.SkinInfo = exports.Levelitem = exports.PanelName = exports.PageName = exports.ZindexLayer = exports.Starstate = exports.GameState = void 0;
  7. var Constant = /** @class */ (function () {
  8. function Constant() {
  9. }
  10. /**
  11. * 总关卡数量
  12. */
  13. Constant.CT_TotalLevelCount = 20;
  14. /**
  15. * 每过一关奖励
  16. */
  17. Constant.CT_RewardCoinCount = 100;
  18. /**
  19. * 闯关失败奖励
  20. */
  21. Constant.CT_FailRewardCoinCount = 50;
  22. Constant.commonCJTimes = 1;
  23. Constant.weaponLevelPriceArr = [100, 300, 600];
  24. Constant.skinLevelPriceArr = [100, 200, 300, 400, 500, 600];
  25. Constant.ST_GameData = "GameData_dxcyxtgd";
  26. Constant.ST_BuildDate = "ST_BuildDate";
  27. Constant.ST_TotoalCount = "ST_TotoalCount";
  28. Constant.ST_CurModel1MapId = "ST_CurModel1MapId";
  29. Constant.ST_CurModel2MapId = "ST_CurModel2MapId";
  30. Constant.ST_CurLevelId = "ST_CurLevelId";
  31. /////////////////////////// 当前用到
  32. Constant.ST_AudioOn = "ST_AudioOn"; //音频开关
  33. Constant.ST_ShakeOn = "ST_ShakeOn"; //震动开关
  34. Constant.ST_CoinCount = "ST_CoinCount"; //金币数量
  35. Constant.ST_DiamondCount = "ST_DiamondCount";
  36. Constant.ST_OnlineToday = "ST_OnlineToday";
  37. Constant.ST_ReceiveToday = "ST_ReceiveToday";
  38. Constant.ST_LastLoadDate = "ST_LastLoadDate";
  39. Constant.ST_LastDailyBonusTime = "ST_LastDailyBonusTime";
  40. Constant.ST_LastDailyBonusIndex = "ST_LastDailyBonusIndex";
  41. Constant.ST_SkinInfo = "ST_SkinInfo";
  42. Constant.ST_CurSkinId = "ST_CurSkinId";
  43. Constant.ST_SkillInfo = "ST_SkillInfo";
  44. Constant.ST_CurSkillId = "ST_CurSkillId";
  45. Constant.ST_GunInfo = "ST_GunInfo";
  46. Constant.ST_CurMeleeId = "ST_CurMeleeId";
  47. Constant.ST_CurRangeId = "ST_CurRangeId";
  48. Constant.ST_LevelItem = "LevelItem";
  49. Constant.ST_ShareNum = "ST_ShareNum";
  50. /** 游戏逻辑事件 */
  51. Constant.E_GAME_LOGIC = "E_GAME_LOGIC";
  52. /** 更新进度条事件 */
  53. Constant.E_UPDATE_PROGRESS = "E_UPDATE_PROGRESS";
  54. /** 事件: Fly_Coin */
  55. Constant.E_Fly_Coin = "E_Fly_Coin";
  56. /** 事件:金币数量改变 */
  57. Constant.E_COIN_CHANGE = "E_COIN_CHANGE";
  58. /** 事件:钻石数量改变 */
  59. Constant.E_Diamond_CHANGE = "E_Diamond_CHANGE";
  60. /** 事件:经验值改变 */
  61. Constant.E_EXP_CHANGE = "E_EXP_CHANGE";
  62. /** 事件:抽奖得皮肤 */
  63. Constant.E_CJ_SKIN = "E_CJ_SKIN";
  64. /** 事件:抽奖得武器 */
  65. Constant.E_CJ_Weapon = "E_CJ_Weapon";
  66. /** 事件:显示分享或视频 */
  67. Constant.E_ShareOrVideo = "E_ShareOrVideo";
  68. /** 事件:地下城 */
  69. Constant.E_Player_Death = "E_Player_Death";
  70. Constant.E_Player_Hart = "E_Player_Hart";
  71. Constant.E_Bullet_Last = "E_Bullet_Last";
  72. Constant.E_Bullet_Reload = "E_Bullet_Reload";
  73. Constant.E_Zombie_Hart = "E_Zombie_Hart";
  74. Constant.E_Zombie_Death = "E_Zombie_Death";
  75. Constant.E_Jingyan_Finish = "E_Jingyan_Finish";
  76. Constant.E_Commonzombie_Destory = "E_Commonzombie_Destory";
  77. Constant.E_Allzombie_Destory = "E_Allzombie_Destory";
  78. /** 事件_磁铁 */
  79. Constant.E_Skill_Citie = "E_Skill_Citie";
  80. /** 指引_全屏爆炸 */
  81. Constant.ST_Guide_Skill = "ST_Guide_Skill";
  82. return Constant;
  83. }());
  84. exports.default = Constant;
  85. var GameState;
  86. (function (GameState) {
  87. GameState[GameState["None"] = -1] = "None";
  88. GameState[GameState["Prepare"] = 0] = "Prepare";
  89. GameState[GameState["Start"] = 1] = "Start";
  90. GameState[GameState["Success"] = 2] = "Success";
  91. GameState[GameState["Failed"] = 3] = "Failed";
  92. GameState[GameState["Pause"] = 4] = "Pause";
  93. GameState[GameState["Relive"] = 5] = "Relive";
  94. })(GameState = exports.GameState || (exports.GameState = {}));
  95. var Starstate;
  96. (function (Starstate) {
  97. Starstate[Starstate["default"] = 0] = "default";
  98. Starstate[Starstate["bright"] = 1] = "bright";
  99. Starstate[Starstate["drown"] = 2] = "drown";
  100. })(Starstate = exports.Starstate || (exports.Starstate = {}));
  101. var ZindexLayer;
  102. (function (ZindexLayer) {
  103. ZindexLayer[ZindexLayer["zindex_min"] = cc.macro.MIN_ZINDEX] = "zindex_min";
  104. ZindexLayer[ZindexLayer["zinedx_floorTip"] = cc.macro.MIN_ZINDEX + 1] = "zinedx_floorTip";
  105. ZindexLayer[ZindexLayer["zinedx_floorLiewen"] = cc.macro.MIN_ZINDEX + 2] = "zinedx_floorLiewen";
  106. ZindexLayer[ZindexLayer["zinedx_floorSkill"] = cc.macro.MIN_ZINDEX + 3] = "zinedx_floorSkill";
  107. ZindexLayer[ZindexLayer["zinedx_footPrint"] = cc.macro.MIN_ZINDEX + 4] = "zinedx_footPrint";
  108. ZindexLayer[ZindexLayer["zinedx_gh"] = cc.macro.MIN_ZINDEX + 5] = "zinedx_gh";
  109. ZindexLayer[ZindexLayer["zinedx_footYc"] = cc.macro.MIN_ZINDEX + 6] = "zinedx_footYc";
  110. ZindexLayer[ZindexLayer["zinedx_jingyan"] = cc.macro.MIN_ZINDEX + 7] = "zinedx_jingyan";
  111. ZindexLayer[ZindexLayer["zindex_shellcase"] = cc.macro.MIN_ZINDEX + 8] = "zindex_shellcase";
  112. ZindexLayer[ZindexLayer["default"] = 0] = "default";
  113. ZindexLayer[ZindexLayer["zindex_mb"] = 1] = "zindex_mb";
  114. ZindexLayer[ZindexLayer["zinedx_item"] = 100] = "zinedx_item";
  115. ZindexLayer[ZindexLayer["zinedx_dropbox"] = 200] = "zinedx_dropbox";
  116. ZindexLayer[ZindexLayer["zindex_zombie"] = 300] = "zindex_zombie";
  117. ZindexLayer[ZindexLayer["zindex_monster"] = 400] = "zindex_monster";
  118. ZindexLayer[ZindexLayer["zindex_enemy"] = 500] = "zindex_enemy";
  119. ZindexLayer[ZindexLayer["zindex_soldier"] = 600] = "zindex_soldier";
  120. ZindexLayer[ZindexLayer["zindex_ai"] = 700] = "zindex_ai";
  121. ZindexLayer[ZindexLayer["zindex_player"] = 800] = "zindex_player";
  122. ZindexLayer[ZindexLayer["zindex_tower"] = 900] = "zindex_tower";
  123. ZindexLayer[ZindexLayer["zindex_bullet"] = 1000] = "zindex_bullet";
  124. ZindexLayer[ZindexLayer["zindex_hp"] = 1100] = "zindex_hp";
  125. ZindexLayer[ZindexLayer["zindex_bomb"] = 1200] = "zindex_bomb";
  126. ZindexLayer[ZindexLayer["zindex_blood"] = 1300] = "zindex_blood";
  127. ZindexLayer[ZindexLayer["zindex_effect"] = 1400] = "zindex_effect";
  128. ZindexLayer[ZindexLayer["zindex_effect_fire"] = 1500] = "zindex_effect_fire";
  129. ZindexLayer[ZindexLayer["zindex_effect_spark"] = 1600] = "zindex_effect_spark";
  130. ZindexLayer[ZindexLayer["zindex_effect_hit"] = 1800] = "zindex_effect_hit";
  131. ZindexLayer[ZindexLayer["zindex_bullet_sky"] = 1900] = "zindex_bullet_sky";
  132. ZindexLayer[ZindexLayer["zindex_skill"] = cc.macro.MAX_ZINDEX - 6] = "zindex_skill";
  133. ZindexLayer[ZindexLayer["zindex_roleLabel"] = cc.macro.MAX_ZINDEX - 2] = "zindex_roleLabel";
  134. ZindexLayer[ZindexLayer["zindex_max"] = cc.macro.MAX_ZINDEX] = "zindex_max";
  135. })(ZindexLayer = exports.ZindexLayer || (exports.ZindexLayer = {}));
  136. ///////////////////////////////////////////// 界面 /////////////////////////////////////////////
  137. var PageName = /** @class */ (function () {
  138. function PageName() {
  139. }
  140. PageName.UILoadingPage = "UILoadingPage";
  141. PageName.UIHomePage = "UIHomePage";
  142. PageName.UIGamePage = "UIGamePage";
  143. PageName.UIOverPage = "UIOverPage";
  144. PageName.UIGameLoadingPage = "UIGameLoadingPage";
  145. return PageName;
  146. }());
  147. exports.PageName = PageName;
  148. var PanelName = /** @class */ (function () {
  149. function PanelName() {
  150. }
  151. PanelName.UISignPanel = "UISignPanel";
  152. PanelName.UITurntablePanel = "UITurntablePanel";
  153. PanelName.UIRevivePanel = "UIRevivePanel";
  154. PanelName.UIUpgradePanel = "UIUpgradePanel";
  155. PanelName.UIPausePanel = "UIPausePanel";
  156. PanelName.UITrySkinPanel = "UITrySkinPanel";
  157. PanelName.UIWeaponLevelPanel = "UIWeaponLevelPanel";
  158. PanelName.UITimePanel = "UITimePanel";
  159. return PanelName;
  160. }());
  161. exports.PanelName = PanelName;
  162. ///////////////////////////////////////////////////
  163. var Levelitem = /** @class */ (function () {
  164. function Levelitem(str) {
  165. var info = JSON.parse(str);
  166. if (info) {
  167. if (info.Id) {
  168. this.Id = parseInt(info.Id);
  169. }
  170. else {
  171. cc.log("Id 字段不存在!");
  172. }
  173. if (info.State) {
  174. this.State = parseInt(info.State);
  175. }
  176. else {
  177. cc.log("State 字段不存在!");
  178. }
  179. if (info.Grade) {
  180. this.Grade = parseInt(info.Grade);
  181. }
  182. else {
  183. cc.log("Grade 字段不存在!");
  184. }
  185. }
  186. else {
  187. cc.log("构建 Levelitem 的字符串不合法!");
  188. }
  189. }
  190. Levelitem.prototype.ToString = function () {
  191. return "{\"Id\":\"" + this.Id + "\",\"State\":\"" + this.State + "\",\"Grade\":\"" + this.Grade + "\"}";
  192. };
  193. return Levelitem;
  194. }());
  195. exports.Levelitem = Levelitem;
  196. var SkinInfo = /** @class */ (function () {
  197. function SkinInfo(str) {
  198. var info = JSON.parse(str);
  199. if (info) {
  200. if (info.Id) {
  201. this.Id = parseInt(info.Id);
  202. }
  203. else {
  204. cc.log("Id 字段不存在!");
  205. }
  206. if (info.State) {
  207. this.State = parseInt(info.State);
  208. }
  209. else {
  210. cc.log("State 字段不存在!");
  211. }
  212. if (info.Price) {
  213. this.Price = parseInt(info.Price);
  214. }
  215. else {
  216. cc.log("Price 字段不存在!");
  217. }
  218. if (info.Level) {
  219. this.Level = parseInt(info.Level);
  220. }
  221. else {
  222. cc.log("Level 字段不存在!");
  223. }
  224. if (info.VideoCount) {
  225. this.VideoCount = parseInt(info.VideoCount);
  226. }
  227. else {
  228. cc.log("VideoCount 字段不存在!");
  229. }
  230. }
  231. else {
  232. cc.log("构建 SkinInfo 的字符串不合法!");
  233. }
  234. }
  235. SkinInfo.prototype.ToString = function () {
  236. return "{\"Id\":\"" + this.Id + "\",\"State\":" + this.State + "\",\"Price\":\"" + this.Price + "\",\"VideoCount\":\"" + this.VideoCount + "\"}";
  237. };
  238. return SkinInfo;
  239. }());
  240. exports.SkinInfo = SkinInfo;
  241. var GunInfo = /** @class */ (function () {
  242. function GunInfo(str) {
  243. var info = JSON.parse(str);
  244. if (info) {
  245. if (info.Id) {
  246. this.Id = parseInt(info.Id);
  247. }
  248. else {
  249. cc.log("Id 字段不存在!");
  250. }
  251. if (info.State) {
  252. this.State = parseInt(info.State);
  253. }
  254. else {
  255. cc.log("State 字段不存在!");
  256. }
  257. if (info.Price) {
  258. this.Price = parseInt(info.Price);
  259. }
  260. else {
  261. cc.log("Price 字段不存在!");
  262. }
  263. if (info.Level) {
  264. this.Level = parseInt(info.Level);
  265. }
  266. else {
  267. cc.log("Level 字段不存在!");
  268. }
  269. if (info.VideoCount) {
  270. this.VideoCount = parseInt(info.VideoCount);
  271. }
  272. else {
  273. cc.log("VideoCount 字段不存在!");
  274. }
  275. }
  276. else {
  277. cc.log("构建 GunInfo 的字符串不合法!");
  278. }
  279. }
  280. GunInfo.prototype.ToString = function () {
  281. return "{\"Id\":\"" + this.Id + "\",\"State\":\"" + this.State + "\",\"Price\":\"" + this.Price + "\",\"Level\":\"" + this.Level + "\",\"VideoCount\":\"" + this.VideoCount + "\"}";
  282. };
  283. return GunInfo;
  284. }());
  285. exports.GunInfo = GunInfo;
  286. var SkillInfo = /** @class */ (function () {
  287. function SkillInfo(str) {
  288. // cc.log("构建 SkinInfo :", str);
  289. var info = JSON.parse(str);
  290. if (info) {
  291. if (info.Id) {
  292. this.Id = parseInt(info.Id);
  293. }
  294. else {
  295. cc.log("Id 字段不存在!");
  296. }
  297. if (info.State) {
  298. this.State = parseInt(info.State);
  299. }
  300. else {
  301. cc.log("State 字段不存在!");
  302. }
  303. if (info.Price) {
  304. this.Price = parseInt(info.Price);
  305. }
  306. else {
  307. cc.log("Price 字段不存在!");
  308. }
  309. }
  310. else {
  311. cc.log("构建 SkillInfo 的字符串不合法!");
  312. }
  313. }
  314. SkillInfo.prototype.ToString = function () {
  315. return "{\"Id\":\"" + this.Id + "\",\"State\":\"" + this.State + "\",\"Price\":\"" + this.Price + "\"}";
  316. };
  317. return SkillInfo;
  318. }());
  319. exports.SkillInfo = SkillInfo;
  320. cc._RF.pop();