diff --git a/JisolGameCocos/assets/resources/prefab/battle/mode/CampGuardianMode.prefab b/JisolGameCocos/assets/resources/prefab/battle/mode/CampGuardianMode.prefab index b30e49ed..2a89b979 100644 --- a/JisolGameCocos/assets/resources/prefab/battle/mode/CampGuardianMode.prefab +++ b/JisolGameCocos/assets/resources/prefab/battle/mode/CampGuardianMode.prefab @@ -346,7 +346,7 @@ }, { "__type__": "cc.Node", - "_name": "GObject", + "_name": "Camera", "_objFlags": 0, "__editorExtras__": {}, "_parent": { @@ -362,94 +362,6 @@ "_prefab": { "__id__": 17 }, - "_lpos": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_lrot": { - "__type__": "cc.Quat", - "x": 0, - "y": 0, - "z": 0, - "w": 1 - }, - "_lscale": { - "__type__": "cc.Vec3", - "x": 1, - "y": 1, - "z": 1 - }, - "_mobility": 0, - "_layer": 1, - "_euler": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_id": "" - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 14 - }, - "_enabled": true, - "__prefab": { - "__id__": 16 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 100, - "height": 100 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "51F2pLtaRAvIrZ6+pAQ7gN" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "afU00zeEBCvYG08IYSwZ58", - "instance": null, - "targetOverrides": null, - "nestedPrefabInstanceRoots": null - }, - { - "__type__": "cc.Node", - "_name": "Camera", - "_objFlags": 0, - "__editorExtras__": {}, - "_parent": { - "__id__": 1 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 19 - } - ], - "_prefab": { - "__id__": 21 - }, "_lpos": { "__type__": "cc.Vec3", "x": 0, @@ -485,11 +397,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 18 + "__id__": 14 }, "_enabled": true, "__prefab": { - "__id__": 20 + "__id__": 16 }, "_projection": 0, "_priority": 0, @@ -547,6 +459,94 @@ "targetOverrides": null, "nestedPrefabInstanceRoots": null }, + { + "__type__": "cc.Node", + "_name": "GObject", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 1 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 19 + } + ], + "_prefab": { + "__id__": 21 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 1, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 18 + }, + "_enabled": true, + "__prefab": { + "__id__": 20 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "51F2pLtaRAvIrZ6+pAQ7gN" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "afU00zeEBCvYG08IYSwZ58", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, { "__type__": "cc.UITransform", "_name": "", diff --git a/JisolGameCocos/assets/script/battle/base/fsm/CampGuardian/GFSMCampGuardianAnim.ts b/JisolGameCocos/assets/script/battle/base/fsm/CampGuardian/GFSMCampGuardianAnim.ts new file mode 100644 index 00000000..a0805e1c --- /dev/null +++ b/JisolGameCocos/assets/script/battle/base/fsm/CampGuardian/GFSMCampGuardianAnim.ts @@ -0,0 +1,18 @@ +import { GPetAminEnum } from "../../anim/GPetAnim"; +import { GFSMDefaultAnim } from "../Default/GFSMDefaultAnim"; +import { GFSMAnimBase, GFSMProcessAnimInfo } from "../GFSMAnimBase"; + + +export default class GFSMCampGuardianAnim extends GFSMAnimBase{ + + // 流程图 + process: { [key: number]: GFSMProcessAnimInfo; } = { + [0]:{ + title:"等待", + isLoop:true, + animName:GPetAminEnum.Fly, + }, + } + +} + diff --git a/JisolGameCocos/assets/script/battle/base/fsm/CampGuardian/GFSMCampGuardianAnim.ts.meta b/JisolGameCocos/assets/script/battle/base/fsm/CampGuardian/GFSMCampGuardianAnim.ts.meta new file mode 100644 index 00000000..98a01912 --- /dev/null +++ b/JisolGameCocos/assets/script/battle/base/fsm/CampGuardian/GFSMCampGuardianAnim.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.23", + "importer": "typescript", + "imported": true, + "uuid": "34be6f53-5c77-4e9b-b66e-16080f2f548e", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/JisolGameCocos/assets/script/battle/base/role/CampGuardian/GRoleCGCrystal.ts b/JisolGameCocos/assets/script/battle/base/role/CampGuardian/GRoleCGCrystal.ts index 150c8fe6..d1595147 100644 --- a/JisolGameCocos/assets/script/battle/base/role/CampGuardian/GRoleCGCrystal.ts +++ b/JisolGameCocos/assets/script/battle/base/role/CampGuardian/GRoleCGCrystal.ts @@ -5,6 +5,10 @@ import { GFSMAnimBase } from "../../fsm/GFSMAnimBase"; import GFSMBase from "../../fsm/GFSMBase"; import GRoleBase from "../GRoleBase"; import { ProgressBar } from "cc"; +import { TB } from "../../../../config/data/schema"; +import { GPetAminEnum } from "../../anim/GPetAnim"; +import { v3 } from "cc"; +import GFSMCampGuardianAnim from "../../fsm/CampGuardian/GFSMCampGuardianAnim"; const { property,ccclass } = _decorator; //阵营守护 水晶 @@ -13,12 +17,17 @@ export default class GRoleCGCrystal extends GRoleBase<{}>{ @property(ProgressBar) bloodVolume:ProgressBar; + + init(role:TB.TbGRole){ + super.init(role) + this.node.scale = v3(2,2,2); + } protected fsmCreate(): GFSMBase { return new GFSMBase(); } - protected fsmAnimCreate(): GFSMDefaultAnim { - return new GFSMDefaultAnim(this.spine); + protected fsmAnimCreate(): GFSMAnimBase { + return new GFSMCampGuardianAnim(this.spine); } } diff --git a/JisolGameCocos/assets/script/battle/base/role/GRoleDefault.ts b/JisolGameCocos/assets/script/battle/base/role/GRoleDefault.ts index d1c92927..51dcd080 100644 --- a/JisolGameCocos/assets/script/battle/base/role/GRoleDefault.ts +++ b/JisolGameCocos/assets/script/battle/base/role/GRoleDefault.ts @@ -122,7 +122,7 @@ export default class GRoleDefault extends GRoleBase<{}>{ protected fsmCreate(): GFSMDefault { return new GFSMDefault(this); } - protected fsmAnimCreate(): GFSMDefaultAnim { + protected fsmAnimCreate(): GFSMAnimBase { return new GFSMDefaultAnim(this.spine); } diff --git a/JisolGameCocos/assets/script/battle/modes/GCampGuardianMode.ts b/JisolGameCocos/assets/script/battle/modes/GCampGuardianMode.ts index d8876ce7..5a14fd26 100644 --- a/JisolGameCocos/assets/script/battle/modes/GCampGuardianMode.ts +++ b/JisolGameCocos/assets/script/battle/modes/GCampGuardianMode.ts @@ -30,9 +30,9 @@ export enum GCampGuardianEnum{ export default class GCampGuardianMode extends GBaseMode<{},{}>{ //玩家水晶位置 - playerPos: Vec2 = new Vec2(-800,-100); + playerPos: Vec2 = new Vec2(-800,-50); //敌方水晶位置 - enemyPos: Vec2 = new Vec2(800,-100); + enemyPos: Vec2 = new Vec2(800,-50); //我方水晶 @@ -62,7 +62,7 @@ export default class GCampGuardianMode extends GBaseMode<{},{}>{ let max = TD.TbGRole.getDataList().length; this.onGenRole(GCampGuardianEnum.PLAYER,TD.TbGRole.getDataList()[Math.floor(this.getSync().SyncRandomInt(0,max - 1))]); this.onGenRole(GCampGuardianEnum.ENEMY,TD.TbGRole.getDataList()[Math.floor(this.getSync().SyncRandomInt(0,max - 1))]); - },1000) + },2000) } @@ -114,7 +114,7 @@ export default class GCampGuardianMode extends GBaseMode<{},{}>{ } //绑定死亡回调 - // entity.addKillBackEvent(this.onRoleKillBack.bind(this)) + entity.addKillBackEvent(this.onRoleKillBack.bind(this)) //添加宠物属性 entity.onEffectiveValue(new GPetAttribute({ diff --git a/JisolGameCocos/assets/script/tools/NumberTools.ts b/JisolGameCocos/assets/script/tools/NumberTools.ts new file mode 100644 index 00000000..34e88831 --- /dev/null +++ b/JisolGameCocos/assets/script/tools/NumberTools.ts @@ -0,0 +1,10 @@ + +export default class NumberTools { + + //随机 + public GetRank(min, max) { + return Math.round(Math.random() * (max - min)) + min; + } + +} + diff --git a/JisolGameCocos/assets/script/tools/NumberTools.ts.meta b/JisolGameCocos/assets/script/tools/NumberTools.ts.meta new file mode 100644 index 00000000..0e4b919b --- /dev/null +++ b/JisolGameCocos/assets/script/tools/NumberTools.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.23", + "importer": "typescript", + "imported": true, + "uuid": "ad1090ba-256d-4f25-bd82-8979cb540c1e", + "files": [], + "subMetas": {}, + "userData": {} +}