be201d8f-27ec-4bd9-8e14-cd5074a1b278.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. "use strict";
  2. cc._RF.push(module, 'be2012PJ+xL2Y4UzVB0obJ4', 'player');
  3. // scripts/Game/player.ts
  4. "use strict";
  5. var __extends = (this && this.__extends) || (function () {
  6. var extendStatics = function (d, b) {
  7. extendStatics = Object.setPrototypeOf ||
  8. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  9. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  10. return extendStatics(d, b);
  11. };
  12. return function (d, b) {
  13. extendStatics(d, b);
  14. function __() { this.constructor = d; }
  15. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16. };
  17. })();
  18. var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  19. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  20. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  21. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  22. return c > 3 && r && Object.defineProperty(target, key, r), r;
  23. };
  24. Object.defineProperty(exports, "__esModule", { value: true });
  25. var CocosZ_1 = require("../Framework/CocosZ");
  26. var Constant_1 = require("../Framework/Constant");
  27. var bullet_1 = require("./bullet");
  28. var gameDate_1 = require("./gameDate");
  29. var gameMgr_1 = require("./gameMgr");
  30. var person_1 = require("./person");
  31. var UpgradeMgr_1 = require("./UpgradeMgr");
  32. var weapon_1 = require("./weapon");
  33. // @ts-ignore
  34. var i18n = require('LanguageData');
  35. var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
  36. var Player = /** @class */ (function (_super) {
  37. __extends(Player, _super);
  38. function Player() {
  39. var _this = _super !== null && _super.apply(this, arguments) || this;
  40. _this.lastTime = 0;
  41. _this.lastAtkTime = 0;
  42. _this.atkBulletNum = 1;
  43. return _this;
  44. }
  45. Player.prototype.onLoad = function () {
  46. this.isPlayer = true;
  47. this.id = 1;
  48. gameMgr_1.gameMgr.playerTs = this;
  49. if (this.hpSpr) {
  50. this.hpSpr.color = cc.Color.GREEN;
  51. }
  52. if (this.atkBar) {
  53. this.atkBar.node.children[1].color = cc.Color.YELLOW;
  54. }
  55. this.rig = this.node.getComponent(cc.RigidBody);
  56. if (this.rig) {
  57. this.rig.linearDamping = 0.2;
  58. }
  59. this.playerMess = this.node.getChildByName("playerMess");
  60. this.hpNumNode = this.playerMess.getChildByName("hpNum");
  61. // 光环
  62. this.ghAniNode = this.node.getChildByName("gh");
  63. // 烟尘
  64. this.ycAniNode = this.node.getChildByName("yc");
  65. // 相机跟随
  66. gameMgr_1.gameMgr.followNode = this.node;
  67. // 防止玩家和僵尸碰撞
  68. if (CocosZ_1.cocosz.gameMode == 6) {
  69. if (this.rig && this.rig.isValid) {
  70. this.rig.enabledContactListener = true;
  71. }
  72. }
  73. };
  74. Player.prototype.start = function () {
  75. _super.prototype.start.call(this);
  76. this.setProperty();
  77. this.node.zIndex = Constant_1.ZindexLayer.zindex_player;
  78. if (this.ghAniNode && this.ghAniNode.isValid) {
  79. this.ghAniNode.setParent(this.node.parent);
  80. this.ghAniNode.zIndex = Constant_1.ZindexLayer.zinedx_gh;
  81. this.updateGhAni();
  82. }
  83. if (this.ycAniNode && this.ycAniNode.isValid) {
  84. this.ycAniNode.setParent(this.node.parent);
  85. this.ycAniNode.zIndex = Constant_1.ZindexLayer.zinedx_footYc;
  86. this.updateYcAni();
  87. }
  88. // 血条
  89. if (this.hpSpr) {
  90. this.hpSpr.color = cc.Color.GREEN;
  91. }
  92. };
  93. Player.prototype.lateUpdate = function (dt) {
  94. this.curTime++;
  95. if (CocosZ_1.cocosz.isPause || this.isDeath || gameMgr_1.gameMgr.isWin || gameMgr_1.gameMgr.isFail) {
  96. this.rig.linearVelocity = cc.v2(0, 0);
  97. return;
  98. }
  99. ;
  100. if (this.curTime % 15 == 0) {
  101. this.updateAni();
  102. this.creatFootPrint();
  103. }
  104. this.updateAtk();
  105. this.updatePerson();
  106. this.udpateRBody(this.moveDir);
  107. this.updateMess();
  108. this.updateGhAni();
  109. this.updateYcAni();
  110. if (this.atkTarget && this.atkTarget.isValid) {
  111. this.atkEnemy();
  112. }
  113. };
  114. Player.prototype.recoverEffect = function () {
  115. var node = cc.instantiate(gameMgr_1.gameMgr.itemEffect[0]);
  116. node.parent = this.node;
  117. };
  118. Player.prototype.checkTarget = function () {
  119. if (Number(new Date()) - this.lastTime < 500)
  120. return;
  121. this.lastTime = Number(new Date());
  122. var num = this.atkList.indexOf(this.atkTarget);
  123. if (num >= 0) {
  124. if (num == this.atkList.length - 1) {
  125. num = 0;
  126. }
  127. else {
  128. num += 1;
  129. }
  130. this.atkTarget = this.atkList[num];
  131. }
  132. else {
  133. this.atkTarget = this.atkList[0];
  134. }
  135. };
  136. Player.prototype.atkEnemy = function () {
  137. var _this = this;
  138. if (!this.curWeapon || !this.curWeapon.isValid || this.isAtk)
  139. return;
  140. if (this.curWeapon && this.curWeapon.isRangeWeapon) {
  141. // 是否有子弹
  142. if (this.curWeapon._isReload || this.curWeapon.curBullet <= 0) {
  143. return;
  144. }
  145. else {
  146. if (CocosZ_1.cocosz.gameMode == 6 && this.curWeapon.curBullet == 1) {
  147. cc.game.emit(Constant_1.default.E_GAME_LOGIC, { type: Constant_1.default.E_Bullet_Last, node: this.node });
  148. }
  149. this.curWeapon.curBullet--;
  150. }
  151. // 抖动效果
  152. var t_1 = (this.atkSpeed > 0.1 ? 0.1 : this.atkSpeed) / 3;
  153. cc.tween(this.rangedWeapon.children[0])
  154. .by(t_1, { x: -20, angle: 20 })
  155. .by(t_1, { x: 20, angle: -20 })
  156. .start();
  157. // 攻击效果
  158. var pos = this.startPosNode.getPosition();
  159. if (this.curWeapon.atkEffect) {
  160. var effect = cc.instantiate(this.curWeapon.atkEffect);
  161. if (this.curWeapon.weaponNum == 9 || this.curWeapon.weaponNum == 15) {
  162. this.node.parent.addChild(effect, Constant_1.ZindexLayer.zindex_effect_fire, "effect");
  163. effect.setPosition(this.startPosNode.parent.convertToWorldSpaceAR(pos).sub(cc.v2(cc.winSize.width / 2, cc.winSize.height / 2)));
  164. if (this.body.scaleX > 0) {
  165. effect.angle = this.rangedWeapon.angle;
  166. }
  167. else {
  168. effect.angle = 180 - this.rangedWeapon.angle;
  169. }
  170. }
  171. else {
  172. this.curWeapon.node.addChild(effect, 1, "effect");
  173. effect.setPosition(pos);
  174. }
  175. // 升级开火特效
  176. // if (this.curWeapon.can_effect_hit && this.curWeapon && this.curWeapon.weaponLevel > 0) {
  177. // let effect_fire = cc.instantiate(gameMgr.effect_fire);
  178. // effect_fire.parent = effect.parent;
  179. // effect_fire.setPosition(effect.position);
  180. // effect_fire.angle = effect.angle;
  181. // // 颜色
  182. // let arr = ["", "y", "p", "r"];
  183. // let spAni = effect_fire.children[0].getComponent(sp.Skeleton);
  184. // spAni && spAni.setSkin(arr[this.curWeapon.weaponLevel]);
  185. // }
  186. }
  187. }
  188. else {
  189. gameMgr_1.gameMgr.shakeEffect(2, 1, false); //屏幕晃动
  190. var ani_1 = this.meleeWeapon.getComponent(cc.Animation);
  191. ani_1 && ani_1.isValid && ani_1.play("atk_dao");
  192. this.scheduleOnce(function () {
  193. ani_1 && ani_1.isValid && ani_1.play("daiji_dao");
  194. }, 0.18);
  195. }
  196. // 生成子弹
  197. var dir;
  198. if (this.atkDir && !this.atkDir.equals(cc.Vec2.ZERO)) {
  199. dir = this.atkDir;
  200. }
  201. else if (this.moveDir && !this.moveDir.equals(cc.Vec2.ZERO)) {
  202. dir = this.moveDir;
  203. }
  204. else {
  205. dir = this.body.scaleX > 0 ? cc.Vec2.RIGHT : cc.Vec2.RIGHT.negSelf();
  206. }
  207. if (this.atkBulletNum > 1) {
  208. for (var i = 0; i < this.atkBulletNum; i++) {
  209. var angle = ((this.atkBulletNum - 1) / 2 - i) * 15;
  210. var new_dir = dir.rotate(cc.misc.degreesToRadians(angle));
  211. this.createBullet(new_dir);
  212. }
  213. }
  214. else {
  215. this.createBullet(dir);
  216. }
  217. // 攻击表情
  218. var t = this.atkSpeed > 0.1 ? 0.1 : this.atkSpeed;
  219. cc.tween(this.head_atk)
  220. .set({ opacity: 255 })
  221. .delay(t)
  222. .set({ opacity: 0 })
  223. .start();
  224. this.isAtk = true;
  225. if (this.curWeapon.isRangeWeapon && this.curWeapon.curBullet <= 0) {
  226. cc.tween(this.node)
  227. .delay(this.curWeapon.reload)
  228. .call(function () {
  229. _this.isAtk = false;
  230. })
  231. .start();
  232. }
  233. else {
  234. cc.tween(this.node)
  235. .delay(this.atkSpeed)
  236. .call(function () {
  237. _this.isAtk = false;
  238. })
  239. .start();
  240. }
  241. // 攻击音效
  242. var name = weapon_1.default.WeaponName[this.curWeapon.weaponNum - 1];
  243. if (gameDate_1.default.Weapon[name] && gameDate_1.default.Weapon[name].music) {
  244. gameMgr_1.gameMgr.playEffect("shot_" + gameDate_1.default.Weapon[name].music, this.node);
  245. }
  246. else {
  247. gameMgr_1.gameMgr.playEffect("shot_" + weapon_1.default.WeaponName[this.curWeapon.weaponNum - 1], this.node);
  248. }
  249. };
  250. Player.prototype.createBullet = function (dir) {
  251. var bullet = cc.instantiate(this.curWeapon.bullet);
  252. if (this.curWeapon.isRangeWeapon) {
  253. bullet.parent = this.node.parent;
  254. var fromPos = bullet.parent.convertToNodeSpaceAR(this.startPosNode.convertToWorldSpaceAR(cc.Vec2.ZERO));
  255. bullet.setPosition(fromPos);
  256. bullet.angle = -cc.v2(dir).signAngle(cc.v2(1, 0)) / Math.PI * 180;
  257. if (this.curWeapon.weaponNum == 2) {
  258. bullet.angle += (5 - Math.random() * 10);
  259. }
  260. if (this.curWeapon.flySpeed > 0) {
  261. var pos1 = bullet.getPosition();
  262. var pos2 = pos1.add(dir.mul(this.curWeapon.atkRangeNum));
  263. cc.tween(bullet)
  264. .to(pos2.sub(pos1).mag() / this.curWeapon.flySpeed, { position: cc.v3(pos2) })
  265. .call(function () {
  266. var ts = bullet.getComponent(bullet_1.default);
  267. if (ts.boomEffect) {
  268. var boom = cc.instantiate(ts.boomEffect);
  269. boom.parent = ts.node.parent;
  270. boom.setPosition(ts.node.getPosition());
  271. var curBullet = boom.getComponent(bullet_1.default);
  272. curBullet.atk = ts.atk;
  273. curBullet.atker = ts.atker;
  274. curBullet.id = ts.id;
  275. gameMgr_1.gameMgr.playEffect("explo", boom);
  276. if (ts.hitEffect) {
  277. var pos = bullet.getPosition();
  278. var node = cc.instantiate(ts.hitEffect);
  279. node.parent = bullet.parent;
  280. node.setPosition(pos);
  281. node.zIndex = Constant_1.ZindexLayer.zindex_effect_hit;
  282. }
  283. }
  284. bullet.destroy();
  285. })
  286. .start();
  287. // 弹壳
  288. if (this.curWeapon.shellCall) {
  289. var shellCase = cc.instantiate(this.curWeapon.shellCall);
  290. shellCase.setParent(gameMgr_1.gameMgr.map);
  291. shellCase.setPosition(this.node.position);
  292. shellCase.scaleX = this.body.scale;
  293. }
  294. }
  295. else {
  296. cc.tween(bullet).delay(0.4).call(function () {
  297. bullet.destroy();
  298. }).start();
  299. }
  300. var ts = bullet.getComponent(bullet_1.default);
  301. ts.id = this.id;
  302. ts.atker = this.node;
  303. ts.atk = (this.atkNum + this.personAtk) * this.atkRate;
  304. ts.dir = dir;
  305. }
  306. else {
  307. this.node.addChild(bullet, -1);
  308. bullet.color = this.curWeapon.bulletCollor;
  309. if (this.atkDir.x < 0) {
  310. bullet.scaleX *= -1 / this.node.scaleX;
  311. }
  312. else {
  313. bullet.scaleX /= this.node.scaleX;
  314. }
  315. bullet.scaleY /= this.node.scaleY;
  316. cc.tween(bullet).delay(0.2).call(function () { bullet.destroy(); }).start();
  317. var ts = bullet.getComponent(bullet_1.default);
  318. ts.id = this.id;
  319. ts.atker = this.node;
  320. ts.atk = (this.atkNum + this.personAtk) * this.atkRate;
  321. ts.dir = dir;
  322. }
  323. };
  324. Player.prototype.hart = function (atkNum, from, dir, isAudio) {
  325. var _this = this;
  326. if (dir === void 0) { dir = null; }
  327. if (isAudio === void 0) { isAudio = true; }
  328. if (CocosZ_1.cocosz.isPause || this.isDeath || this.isAvoidInjury)
  329. return;
  330. if (CocosZ_1.cocosz.gameMode == 6 && UpgradeMgr_1.upgradeMgr) {
  331. // 移动过程中15%的概率免伤
  332. if (UpgradeMgr_1.upgradeMgr.isHaveSkill(UpgradeMgr_1.SkillType.护甲靴子) && this.moveDir.mag() > 0 && Math.random() < 0.4) {
  333. // gameMgr.showRoleTip(this.node, "闪避", cc.Color.YELLOW);
  334. return;
  335. }
  336. else if (UpgradeMgr_1.upgradeMgr.isHaveSkill(UpgradeMgr_1.SkillType.神圣守护) && UpgradeMgr_1.upgradeMgr.hudun && UpgradeMgr_1.upgradeMgr.hudun.active) {
  337. UpgradeMgr_1.upgradeMgr.updateHudun();
  338. // gameMgr.showRoleTip(this.node, "免伤", cc.Color.YELLOW);
  339. return;
  340. }
  341. }
  342. // 防止dir过大
  343. if (dir && dir.mag() > 3)
  344. dir.normalizeSelf().mulSelf(3);
  345. // 减伤
  346. atkNum = (1 - this.damageReduction) * atkNum;
  347. // 护盾
  348. if (this.Shiled > 0) {
  349. this.Shiled -= atkNum;
  350. if (this.Shiled < 0) {
  351. atkNum = -this.Shiled;
  352. this.Shiled = 0;
  353. }
  354. else {
  355. return;
  356. }
  357. }
  358. // 数字
  359. if (CocosZ_1.cocosz.gameMode != 6) {
  360. gameMgr_1.gameMgr.showRoleTip(this.node, Math.min(this.HP, atkNum).toFixed(0));
  361. }
  362. this.HP -= atkNum;
  363. // 受伤音效
  364. if (isAudio) {
  365. if (from) {
  366. var ts = from.getComponent(person_1.default);
  367. if (ts && ts.curWeapon && ts.curWeapon.isRangeWeapon) {
  368. gameMgr_1.gameMgr.playEffect("hurt_range", this.node);
  369. }
  370. else {
  371. gameMgr_1.gameMgr.playEffect("hurt_melee", this.node);
  372. }
  373. }
  374. else {
  375. gameMgr_1.gameMgr.playEffect("hurt", this.node);
  376. }
  377. }
  378. // 屏幕闪红
  379. if (CocosZ_1.cocosz.gameMode == 6) {
  380. cc.tween(gameMgr_1.gameMgr.red)
  381. .to(0.5, { opacity: 255 }, { easing: "sineOut" })
  382. .to(0.5, { opacity: 0 }, { easing: "sineIn" })
  383. .start();
  384. }
  385. // 震动
  386. CocosZ_1.cocosz.vibrate("long");
  387. if (this.HP <= 0) {
  388. if (CocosZ_1.cocosz.gameMode == 6)
  389. CocosZ_1.cocosz.audioMgr.playEffect("GameOver");
  390. this.death();
  391. if (from) {
  392. var ts = from.getComponent(person_1.default);
  393. ts.killNum++;
  394. ts.curKillNum++;
  395. // 更新最佳成绩
  396. if (ts.curKillNum > ts.maxNum) {
  397. ts.maxNum = ts.curKillNum;
  398. }
  399. this.killer = ts;
  400. this.curKillNum = 0;
  401. }
  402. // 倒飞
  403. if (dir) {
  404. var p1 = this.node.getPosition();
  405. var pTo = p1.add(dir.normalizeSelf().mulSelf(200));
  406. var p2 = cc.v2((p1.x + pTo.x) / 2, p1.y + 200);
  407. cc.tween(this.node)
  408. .bezierTo(0.3, p1, p2, pTo)
  409. .start();
  410. }
  411. // 死亡事件
  412. if (CocosZ_1.cocosz.gameMode == 6) {
  413. cc.game.emit(Constant_1.default.E_GAME_LOGIC, { type: Constant_1.default.E_Player_Death });
  414. }
  415. }
  416. else {
  417. // 受伤事件
  418. if (CocosZ_1.cocosz.gameMode == 6) {
  419. this.avoidInjury(2);
  420. cc.game.emit(Constant_1.default.E_GAME_LOGIC, { type: Constant_1.default.E_Player_Hart });
  421. }
  422. // 效果
  423. if (!this.isAttackedEffect) {
  424. this.isAttackedEffect = true;
  425. // 后退
  426. if (this.rig.type == cc.RigidBodyType.Dynamic && dir) {
  427. // 控制
  428. this.canMove = false;
  429. this.scheduleOnce(function () { _this.canMove = true; }, 0.1);
  430. // 后退
  431. var div = dir.mulSelf(400 * dir.mag()).addSelf(this.rig.linearVelocity);
  432. if (div.mag() > 500) {
  433. div.normalizeSelf().mulSelf(500);
  434. }
  435. this.rig.linearVelocity = div;
  436. }
  437. // 晃头
  438. cc.tween(this.head)
  439. .call(function () { _this.head_hart.opacity = 255; })
  440. .to(0.05, { angle: 15 })
  441. .to(0.05, { angle: -15 })
  442. .to(0.05, { angle: 15 })
  443. .to(0.05, { angle: 0 })
  444. .call(function () { _this.head_hart.opacity = 0; })
  445. .start();
  446. // 人物变色
  447. var spArr_1 = this.body.getComponentsInChildren(cc.Sprite);
  448. cc.tween(this.body)
  449. .call(function () { spArr_1.forEach(function (v, i) { v.isValid && v.setMaterial(0, _this.mat_attacked); }); })
  450. .delay(0.1)
  451. .call(function () { spArr_1.forEach(function (v, i) { v.isValid && v.setMaterial(0, _this.mat_common); }); })
  452. .delay(0.1)
  453. .union()
  454. .repeat(CocosZ_1.cocosz.gameMode == 6 ? 5 : 2)
  455. .call(function () { _this.isAttackedEffect = false; })
  456. .start();
  457. }
  458. }
  459. };
  460. Player.prototype.creatFootPrint = function () {
  461. if (this.node.opacity == 0)
  462. return;
  463. var pos = this.node.getPosition();
  464. if (pos.sub(this.lastPos).mag() < 5)
  465. return;
  466. this.lastPos = cc.v2(pos);
  467. this.footNum++;
  468. // 脚步音效
  469. if (this.isPlayer && this.footNum % 3 == 0) {
  470. gameMgr_1.gameMgr.playEffect("footsteps", this.node);
  471. }
  472. // 脚印(雪地)
  473. if (gameMgr_1.gameMgr.map.name == "map2") {
  474. var node_1 = new cc.Node();
  475. node_1.addComponent(cc.Sprite).spriteFrame = gameMgr_1.gameMgr.jiaoyin;
  476. cc.tween(node_1).delay(0.5).to(0.5, { opacity: 0 }).call(function () { node_1.destroy(); }).start();
  477. node_1.parent = this.node.parent;
  478. node_1.zIndex = Constant_1.ZindexLayer.zinedx_footPrint;
  479. if (this.moveDir.mag() > 0)
  480. node_1.angle = 360 - cc.v2(this.moveDir).signAngle(cc.v2(1, 0)) / Math.PI * 180;
  481. pos.y -= 100 * this.node.scale;
  482. var pos2 = cc.v2(20, 0).rotate(node_1.angle / 180 * Math.PI).rotate(this.footNum % 2 == 0 ? Math.PI / 2 : -Math.PI / 2);
  483. pos.addSelf(pos2);
  484. node_1.setPosition(pos);
  485. }
  486. };
  487. // 0:检测碰撞;1:检测子弹;2:检测在层级下,3:检测在层级上
  488. Player.prototype.onCollisionEnter = function (other, self) {
  489. if (self.tag == 0) {
  490. // 敌人
  491. if (other.tag == 1) {
  492. var ts = other.node.getComponent(person_1.default);
  493. if (ts && ts.id != this.id) {
  494. this.atkList.push(other.node);
  495. if (!cc.isValid(this.atkTarget) && other.node.isValid) {
  496. this.atkTarget = other.node;
  497. }
  498. }
  499. }
  500. }
  501. };
  502. Player.prototype.onCollisionExit = function (other, self) {
  503. if (self.tag == 0) {
  504. var num = this.atkList.indexOf(other.node);
  505. if (other.tag == 1 && num >= 0) {
  506. this.atkList.splice(num, 1);
  507. if (this.atkList.length == 0) {
  508. this.atkTarget = null;
  509. }
  510. else {
  511. if (!cc.isValid(this.atkTarget) || other.node.uuid == this.atkTarget.uuid) {
  512. this.atkTarget = this.atkList[0];
  513. }
  514. }
  515. }
  516. }
  517. };
  518. // 每次将要处理碰撞体接触逻辑时被调用
  519. Player.prototype.onPreSolve = function (contact, selfCollider, otherCollider) {
  520. if (otherCollider.node.group == "zombie") {
  521. contact.disabled = true;
  522. }
  523. };
  524. Player = __decorate([
  525. ccclass
  526. ], Player);
  527. return Player;
  528. }(person_1.default));
  529. exports.default = Player;
  530. cc._RF.pop();