手机测试卡,需要解决

This commit is contained in:
2025-01-22 16:59:23 +08:00
parent 2893050463
commit 43fbf30e46
38 changed files with 8865 additions and 47840 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1635,7 +1635,7 @@
"__id__": 68 "__id__": 68
}, },
"_children": [], "_children": [],
"_active": false, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 70 "__id__": 70
@@ -1650,7 +1650,7 @@
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 3, "x": 3,
"y": -88.258, "y": -5.758,
"z": 0 "z": 0
}, },
"_lrot": { "_lrot": {
@@ -1662,8 +1662,8 @@
}, },
"_lscale": { "_lscale": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0.5, "x": 0.4,
"y": 0.5, "y": 0.4,
"z": 1 "z": 1
}, },
"_mobility": 0, "_mobility": 0,

View File

@@ -117,8 +117,8 @@
"defaultAnimation": "show", "defaultAnimation": "show",
"_premultipliedAlpha": true, "_premultipliedAlpha": true,
"_timeScale": 1, "_timeScale": 1,
"_preCacheMode": 0, "_preCacheMode": 1,
"_cacheMode": 0, "_cacheMode": 1,
"_sockets": [], "_sockets": [],
"_useTint": false, "_useTint": false,
"_debugMesh": false, "_debugMesh": false,

View File

@@ -254,8 +254,8 @@
"defaultAnimation": "show", "defaultAnimation": "show",
"_premultipliedAlpha": true, "_premultipliedAlpha": true,
"_timeScale": 1, "_timeScale": 1,
"_preCacheMode": 0, "_preCacheMode": 1,
"_cacheMode": 0, "_cacheMode": 1,
"_sockets": [], "_sockets": [],
"_useTint": false, "_useTint": false,
"_debugMesh": false, "_debugMesh": false,

View File

@@ -183,8 +183,8 @@
"defaultAnimation": "show", "defaultAnimation": "show",
"_premultipliedAlpha": true, "_premultipliedAlpha": true,
"_timeScale": 1, "_timeScale": 1,
"_preCacheMode": 0, "_preCacheMode": 1,
"_cacheMode": 0, "_cacheMode": 1,
"_sockets": [], "_sockets": [],
"_useTint": false, "_useTint": false,
"_debugMesh": false, "_debugMesh": false,

View File

@@ -186,8 +186,8 @@
"defaultAnimation": "show", "defaultAnimation": "show",
"_premultipliedAlpha": true, "_premultipliedAlpha": true,
"_timeScale": 0.5, "_timeScale": 0.5,
"_preCacheMode": 0, "_preCacheMode": 1,
"_cacheMode": 0, "_cacheMode": 1,
"_sockets": [], "_sockets": [],
"_useTint": false, "_useTint": false,
"_debugMesh": false, "_debugMesh": false,

View File

@@ -186,8 +186,8 @@
"defaultAnimation": "show", "defaultAnimation": "show",
"_premultipliedAlpha": true, "_premultipliedAlpha": true,
"_timeScale": 1, "_timeScale": 1,
"_preCacheMode": 0, "_preCacheMode": 1,
"_cacheMode": 0, "_cacheMode": 1,
"_sockets": [], "_sockets": [],
"_useTint": false, "_useTint": false,
"_debugMesh": false, "_debugMesh": false,

View File

@@ -186,8 +186,8 @@
"defaultAnimation": "show", "defaultAnimation": "show",
"_premultipliedAlpha": true, "_premultipliedAlpha": true,
"_timeScale": 1, "_timeScale": 1,
"_preCacheMode": 0, "_preCacheMode": 1,
"_cacheMode": 0, "_cacheMode": 1,
"_sockets": [], "_sockets": [],
"_useTint": false, "_useTint": false,
"_debugMesh": false, "_debugMesh": false,

View File

@@ -186,8 +186,8 @@
"defaultAnimation": "show", "defaultAnimation": "show",
"_premultipliedAlpha": true, "_premultipliedAlpha": true,
"_timeScale": 1, "_timeScale": 1,
"_preCacheMode": 0, "_preCacheMode": 1,
"_cacheMode": 0, "_cacheMode": 1,
"_sockets": [], "_sockets": [],
"_useTint": false, "_useTint": false,
"_debugMesh": false, "_debugMesh": false,

View File

@@ -186,8 +186,8 @@
"defaultAnimation": "show", "defaultAnimation": "show",
"_premultipliedAlpha": true, "_premultipliedAlpha": true,
"_timeScale": 1, "_timeScale": 1,
"_preCacheMode": 0, "_preCacheMode": 1,
"_cacheMode": 0, "_cacheMode": 1,
"_sockets": [], "_sockets": [],
"_useTint": false, "_useTint": false,
"_debugMesh": false, "_debugMesh": false,

View File

@@ -20,13 +20,19 @@
"_children": [ "_children": [
{ {
"__id__": 2 "__id__": 2
},
{
"__id__": 13
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{
"__id__": 13
},
{
"__id__": 15
},
{
"__id__": 17
},
{ {
"__id__": 19 "__id__": 19
}, },
@@ -41,19 +47,10 @@
}, },
{ {
"__id__": 27 "__id__": 27
},
{
"__id__": 29
},
{
"__id__": 31
},
{
"__id__": 33
} }
], ],
"_prefab": { "_prefab": {
"__id__": 35 "__id__": 29
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -236,142 +233,6 @@
"85FjuP7AFBvr2ZutPHmCqx" "85FjuP7AFBvr2ZutPHmCqx"
] ]
}, },
{
"__type__": "cc.Node",
"_name": "Node",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 14
},
{
"__id__": 16
}
],
"_prefab": {
"__id__": 18
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 171.25,
"y": -15,
"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": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 13
},
"_enabled": true,
"__prefab": {
"__id__": 15
},
"_contentSize": {
"__type__": "cc.Size",
"width": 606.8800048828125,
"height": 158.0500030517578
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.49995056884547934,
"y": 0.231698818252427
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "a20gdPTTBHq4UBWdhvq1Ey"
},
{
"__type__": "sp.Skeleton",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 13
},
"_enabled": true,
"__prefab": {
"__id__": 17
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_skeletonData": {
"__uuid__": "36543599-d11a-48e3-b9bd-3eca62e3ef62",
"__expectedType__": "sp.SkeletonData"
},
"defaultSkin": "default",
"defaultAnimation": "",
"_premultipliedAlpha": true,
"_timeScale": 1,
"_preCacheMode": 0,
"_cacheMode": 0,
"_sockets": [],
"_useTint": false,
"_debugMesh": false,
"_debugBones": false,
"_debugSlots": false,
"_enableBatch": false,
"loop": true,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "5abLvmZJpDOKHToEfr25bJ"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "45DBRQl1FG+KeoA4R9kNp9",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{ {
"__type__": "cc.UITransform", "__type__": "cc.UITransform",
"_name": "", "_name": "",
@@ -382,7 +243,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 20 "__id__": 14
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
@@ -410,7 +271,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 22 "__id__": 16
}, },
"enabledContactListener": true, "enabledContactListener": true,
"bullet": true, "bullet": true,
@@ -444,7 +305,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 24 "__id__": 18
}, },
"tag": 8, "tag": 8,
"_group": 4, "_group": 4,
@@ -478,7 +339,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 26 "__id__": 20
}, },
"_id": "" "_id": ""
}, },
@@ -496,7 +357,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 28 "__id__": 22
}, },
"playOnLoad": true, "playOnLoad": true,
"_clips": [ "_clips": [
@@ -525,7 +386,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 30 "__id__": 24
}, },
"_id": "" "_id": ""
}, },
@@ -543,7 +404,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 32 "__id__": 26
}, },
"_id": "" "_id": ""
}, },
@@ -561,7 +422,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 34 "__id__": 28
}, },
"_id": "" "_id": ""
}, },

View File

@@ -20,13 +20,19 @@
"_children": [ "_children": [
{ {
"__id__": 2 "__id__": 2
},
{
"__id__": 14
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{
"__id__": 14
},
{
"__id__": 16
},
{
"__id__": 18
},
{ {
"__id__": 20 "__id__": 20
}, },
@@ -38,19 +44,10 @@
}, },
{ {
"__id__": 26 "__id__": 26
},
{
"__id__": 28
},
{
"__id__": 30
},
{
"__id__": 32
} }
], ],
"_prefab": { "_prefab": {
"__id__": 34 "__id__": 28
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -246,142 +243,6 @@
], ],
"value": true "value": true
}, },
{
"__type__": "cc.Node",
"_name": "Node",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 15
},
{
"__id__": 17
}
],
"_prefab": {
"__id__": 19
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 171.25,
"y": -15,
"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": 1073741824,
"_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": 606.8800048828125,
"height": 158.0500030517578
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.49995056884547934,
"y": 0.231698818252427
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "a20gdPTTBHq4UBWdhvq1Ey"
},
{
"__type__": "sp.Skeleton",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 14
},
"_enabled": true,
"__prefab": {
"__id__": 18
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_skeletonData": {
"__uuid__": "36543599-d11a-48e3-b9bd-3eca62e3ef62",
"__expectedType__": "sp.SkeletonData"
},
"defaultSkin": "default",
"defaultAnimation": "",
"_premultipliedAlpha": true,
"_timeScale": 1,
"_preCacheMode": 0,
"_cacheMode": 0,
"_sockets": [],
"_useTint": false,
"_debugMesh": false,
"_debugBones": false,
"_debugSlots": false,
"_enableBatch": false,
"loop": true,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "5abLvmZJpDOKHToEfr25bJ"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "45DBRQl1FG+KeoA4R9kNp9",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{ {
"__type__": "cc.UITransform", "__type__": "cc.UITransform",
"_name": "", "_name": "",
@@ -392,7 +253,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 21 "__id__": 15
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
@@ -420,7 +281,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 23 "__id__": 17
}, },
"enabledContactListener": true, "enabledContactListener": true,
"bullet": true, "bullet": true,
@@ -454,7 +315,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 25 "__id__": 19
}, },
"tag": 8, "tag": 8,
"_group": 4, "_group": 4,
@@ -488,7 +349,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 27 "__id__": 21
}, },
"_id": "" "_id": ""
}, },
@@ -506,7 +367,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 29 "__id__": 23
}, },
"playOnLoad": true, "playOnLoad": true,
"_clips": [ "_clips": [
@@ -535,7 +396,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 31 "__id__": 25
}, },
"_id": "" "_id": ""
}, },
@@ -553,7 +414,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 33 "__id__": 27
}, },
"_id": "" "_id": ""
}, },

View File

@@ -171,8 +171,8 @@
"defaultAnimation": "show", "defaultAnimation": "show",
"_premultipliedAlpha": true, "_premultipliedAlpha": true,
"_timeScale": 1, "_timeScale": 1,
"_preCacheMode": 0, "_preCacheMode": 1,
"_cacheMode": 0, "_cacheMode": 1,
"_sockets": [], "_sockets": [],
"_useTint": false, "_useTint": false,
"_debugMesh": false, "_debugMesh": false,

View File

@@ -183,8 +183,8 @@
"defaultAnimation": "show", "defaultAnimation": "show",
"_premultipliedAlpha": true, "_premultipliedAlpha": true,
"_timeScale": 0.9, "_timeScale": 0.9,
"_preCacheMode": 0, "_preCacheMode": 1,
"_cacheMode": 0, "_cacheMode": 1,
"_sockets": [], "_sockets": [],
"_useTint": false, "_useTint": false,
"_debugMesh": false, "_debugMesh": false,

View File

@@ -180,8 +180,8 @@
"defaultAnimation": "show", "defaultAnimation": "show",
"_premultipliedAlpha": true, "_premultipliedAlpha": true,
"_timeScale": 1, "_timeScale": 1,
"_preCacheMode": 0, "_preCacheMode": 1,
"_cacheMode": 0, "_cacheMode": 1,
"_sockets": [], "_sockets": [],
"_useTint": false, "_useTint": false,
"_debugMesh": false, "_debugMesh": false,

View File

@@ -138,8 +138,8 @@
"defaultAnimation": "animation", "defaultAnimation": "animation",
"_premultipliedAlpha": true, "_premultipliedAlpha": true,
"_timeScale": 1, "_timeScale": 1,
"_preCacheMode": 0, "_preCacheMode": 1,
"_cacheMode": 0, "_cacheMode": 1,
"_sockets": [], "_sockets": [],
"_useTint": false, "_useTint": false,
"_debugMesh": false, "_debugMesh": false,

View File

@@ -168,8 +168,8 @@
"defaultAnimation": "loop", "defaultAnimation": "loop",
"_premultipliedAlpha": true, "_premultipliedAlpha": true,
"_timeScale": 1, "_timeScale": 1,
"_preCacheMode": 0, "_preCacheMode": 1,
"_cacheMode": 0, "_cacheMode": 1,
"_sockets": [], "_sockets": [],
"_useTint": false, "_useTint": false,
"_debugMesh": false, "_debugMesh": false,

View File

@@ -186,8 +186,8 @@
"defaultAnimation": "show", "defaultAnimation": "show",
"_premultipliedAlpha": true, "_premultipliedAlpha": true,
"_timeScale": 1, "_timeScale": 1,
"_preCacheMode": 0, "_preCacheMode": 1,
"_cacheMode": 0, "_cacheMode": 1,
"_sockets": [], "_sockets": [],
"_useTint": false, "_useTint": false,
"_debugMesh": false, "_debugMesh": false,

File diff suppressed because it is too large Load Diff

View File

@@ -1,13 +0,0 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "5423b9f8-8a8a-49a0-8ecb-0489dfcaba92",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "hero_home"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,13 +0,0 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "da5ad538-4f6e-4a4c-92a5-8cc86ca29cd4",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "skill_home"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,13 +0,0 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "e81a11af-406f-400c-a51e-55af32e17181",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "victory"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -13,11 +13,11 @@ const { ccclass, property } = _decorator;
@ccclass('Main') @ccclass('Main')
export class Main extends Root { export class Main extends Root {
start() { start() {
if (DEBUG) profiler.showStats(); // if (DEBUG) profiler.showStats();
PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb // PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb
// | EPhysics2DDrawFlags.Pair // // | EPhysics2DDrawFlags.Pair
|EPhysics2DDrawFlags.CenterOfMass // |EPhysics2DDrawFlags.CenterOfMass
|EPhysics2DDrawFlags.Joint // |EPhysics2DDrawFlags.Joint
// |EPhysics2DDrawFlags.Shape; // |EPhysics2DDrawFlags.Shape;
// console.log("PhysicsSystem2D",PhysicsSystem2D.instance.gravity) // console.log("PhysicsSystem2D",PhysicsSystem2D.instance.gravity)
} }

View File

@@ -1,5 +1,4 @@
import { _decorator, Component, instantiate, Label, Node, Prefab, ProgressBar, tween, v3, Vec3 } from 'cc'; import { _decorator, Component, instantiate, Label, Node, Prefab, ProgressBar, tween, v3, Vec3 } from 'cc';
import { HeroViewComp } from './HeroViewComp';
import { oops } from 'db://oops-framework/core/Oops'; import { oops } from 'db://oops-framework/core/Oops';
import { ecs } from 'db://oops-framework/libs/ecs/ECS'; import { ecs } from 'db://oops-framework/libs/ecs/ECS';
import { Tooltip } from '../skills/Tooltip'; import { Tooltip } from '../skills/Tooltip';
@@ -10,7 +9,6 @@ const { ccclass, property } = _decorator;
@ccclass('BuffComp') @ccclass('BuffComp')
export class BuffComp extends Component { export class BuffComp extends Component {
heroView: any=null;
ap_node:any=null; ap_node:any=null;
cd_node:any=null; cd_node:any=null;
def_node:any=null; def_node:any=null;
@@ -33,7 +31,6 @@ export class BuffComp extends Component {
speek_time:number=0; speek_time:number=0;
start() { start() {
this.heroView = this.node.getComponent(HeroViewComp);
// this.buff_get("dodge") // this.buff_get("dodge")
// this.node.getChildByName("top").getChildByName("buff").getChildByName("ap").active = false; // this.node.getChildByName("top").getChildByName("buff").getChildByName("ap").active = false;
// this.node.getChildByName("top").getChildByName("buff").getChildByName("cd").active = false; // this.node.getChildByName("top").getChildByName("buff").getChildByName("cd").active = false;
@@ -56,16 +53,12 @@ export class BuffComp extends Component {
this.node.getChildByName("buff").active = false; this.node.getChildByName("buff").active = false;
} }
this.hp_show()
this.in_speek(deltaTime) this.in_speek(deltaTime)
if(this.heroView.shield > 0){
this.node.getChildByName("shielded").active=true
}else{
this.node.getChildByName("shielded").active=false
}
} }
show_shield(val:boolean){
this.node.getChildByName("shielded").active=val
}
buff_get(name:string){ buff_get(name:string){
var path = "game/skills/buffget/buffget"; var path = "game/skills/buffget/buffget";
var prefab: Prefab = oops.res.get(path, Prefab)!; var prefab: Prefab = oops.res.get(path, Prefab)!;
@@ -86,16 +79,7 @@ export class BuffComp extends Component {
this.node.getChildByName("buff").active = true; this.node.getChildByName("buff").active = true;
} }
hp_show(){
let hp_progress= this.heroView.hp/this.heroView.rhp_max;
this.node.getChildByName("top").getChildByName("hp").getComponent(ProgressBar)!.progress = hp_progress;
if(this.heroView.is_boss) return
if(this.heroView.hp == this.heroView.rhp_max){
this.node.getChildByName("top").getChildByName("hp").active = false;
} else{
this.node.getChildByName("top").getChildByName("hp").active = true;
}
}
max_show(){ max_show(){
this.node.getChildByName("max").active=true this.node.getChildByName("max").active=true
this.scheduleOnce(()=>{ this.scheduleOnce(()=>{

View File

@@ -15,20 +15,21 @@ export class HeroCard extends ecs.Entity {
load(uuid:number=101,parent:any) { load(uuid:number=101,parent:any) {
// var path = "game/monster/"+prefab_path; // var path = "game/monster/"+prefab_path;
var path = "game/gui/hero_card"; var path = "game/gui/hero_card";
// var icon_path = "game/heros/herois"
var prefab: Prefab = oops.res.get(path, Prefab)!; var prefab: Prefab = oops.res.get(path, Prefab)!;
var node = instantiate(prefab); var node = instantiate(prefab);
let slv = node.getChildByName("slv"); // let slv = node.getChildByName("slv");
node.parent = parent; node.parent = parent;
var icon_path = "game/heros/herois"
node.getChildByName("name").getComponent(Label).string = HeroInfo[uuid].name node.getChildByName("name").getComponent(Label).string = HeroInfo[uuid].name
// resources.load(icon_path, SpriteAtlas, (err: any, atlas) => { resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
// const sprite = node.getChildByName("Mask").getChildByName("hero").getComponent(Sprite); const sprite = node.getChildByName("Mask").getChildByName("hero").getComponent(Sprite);
// sprite.spriteFrame = atlas.getSpriteFrame(HeroInfo[uuid].path); sprite.spriteFrame = atlas.getSpriteFrame(HeroInfo[uuid].path);
// }); });
var path = "game/heros/uiheros/"+HeroInfo[uuid].path; // var path = "game/heros/uiheros/"+HeroInfo[uuid].path;
var prefab: Prefab = oops.res.get(path, Prefab)!; // var prefab: Prefab = oops.res.get(path, Prefab)!;
var snode = instantiate(prefab); // var snode = instantiate(prefab);
snode.parent = node.getChildByName("Mask") // snode.parent = node.getChildByName("Mask")
let hcc = node.getComponent(HeroCardComp)!; let hcc = node.getComponent(HeroCardComp)!;
hcc.h_uuid = uuid; hcc.h_uuid = uuid;
hcc.update_data(); hcc.update_data();

View File

@@ -15,20 +15,21 @@ export class HeroSelect extends ecs.Entity {
load(uuid:number=101,parent:any) { load(uuid:number=101,parent:any) {
// var path = "game/monster/"+prefab_path; // var path = "game/monster/"+prefab_path;
var path = "game/gui/hero_set"; var path = "game/gui/hero_set";
// var icon_path = "game/heros/herois"
var prefab: Prefab = oops.res.get(path, Prefab)!; var prefab: Prefab = oops.res.get(path, Prefab)!;
var node = instantiate(prefab); var node = instantiate(prefab);
let slv = node.getChildByName("slv"); // let slv = node.getChildByName("slv");
node.parent = parent; node.parent = parent;
var icon_path = "game/heros/herois"
node.getChildByName("name").getComponent(Label).string = HeroInfo[uuid].name node.getChildByName("name").getComponent(Label).string = HeroInfo[uuid].name
// resources.load(icon_path, SpriteAtlas, (err: any, atlas) => { resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
// const sprite = node.getChildByName("Mask").getChildByName("hero").getComponent(Sprite); const sprite = node.getChildByName("Mask").getChildByName("hero").getComponent(Sprite);
// sprite.spriteFrame = atlas.getSpriteFrame(HeroInfo[uuid].path); sprite.spriteFrame = atlas.getSpriteFrame(HeroInfo[uuid].path);
// }); });
var path = "game/heros/uiheros/"+HeroInfo[uuid].path; // var path = "game/heros/uiheros/"+HeroInfo[uuid].path;
var prefab: Prefab = oops.res.get(path, Prefab)!; // var prefab: Prefab = oops.res.get(path, Prefab)!;
var snode = instantiate(prefab); // var snode = instantiate(prefab);
snode.parent = node.getChildByName("Mask") // snode.parent = node.getChildByName("Mask")
let hcc = node.getComponent(HeroSelectComp)!; let hcc = node.getComponent(HeroSelectComp)!;
hcc.h_uuid = uuid; hcc.h_uuid = uuid;
hcc.update_data(); hcc.update_data();

View File

@@ -1,7 +1,6 @@
import { _decorator, Color, Label, Sprite } from "cc"; import { _decorator, Color, Label, Sprite } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp"; import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
import { MissionHomeComp } from "../map/MissionHomeComp";
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops"; import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
import { smc } from "../common/SingletonModuleComp"; import { smc } from "../common/SingletonModuleComp";
import { ColorSet, GameSet } from "../common/config/BoxSet"; import { ColorSet, GameSet } from "../common/config/BoxSet";
@@ -13,7 +12,6 @@ const { ccclass, property } = _decorator;
@ccclass('HeroSelectComp') @ccclass('HeroSelectComp')
@ecs.register('HeroSelectComp', false) @ecs.register('HeroSelectComp', false)
export class HeroSelectComp extends CCComp { export class HeroSelectComp extends CCComp {
mhc_home: MissionHomeComp = null!;
h_uuid: number = 0; h_uuid: number = 0;
onLoad() { onLoad() {
oops.message.on("hero_set_select", this.check_show, this); oops.message.on("hero_set_select", this.check_show, this);
@@ -21,8 +19,6 @@ export class HeroSelectComp extends CCComp {
} }
/** 视图层逻辑代码分离演示 */ /** 视图层逻辑代码分离演示 */
start() { start() {
this.mhc_home=this.node.parent.parent.parent.parent.getComponent(MissionHomeComp);
if(smc.fight_heros.indexOf(this.h_uuid)>=0){ if(smc.fight_heros.indexOf(this.h_uuid)>=0){
this.show_bg(true) this.show_bg(true)
}else{ }else{
@@ -33,7 +29,7 @@ export class HeroSelectComp extends CCComp {
if(smc.fight_heros.indexOf(this.h_uuid)>=0){ if(smc.fight_heros.indexOf(this.h_uuid)>=0){
smc.fight_heros.splice(smc.fight_heros.indexOf(this.h_uuid),1) smc.fight_heros.splice(smc.fight_heros.indexOf(this.h_uuid),1)
this.show_bg(false) this.show_bg(false)
this.mhc_home.cancel_hero(this.h_uuid) oops.message.dispatchEvent("hero_card_cancel_select",{uuid:this.h_uuid})
return return
} }
if(smc.fight_heros.length>= GameSet.HERO_NUM){ if(smc.fight_heros.length>= GameSet.HERO_NUM){
@@ -41,7 +37,7 @@ export class HeroSelectComp extends CCComp {
return return
} }
smc.fight_heros.push(this.h_uuid) smc.fight_heros.push(this.h_uuid)
this.mhc_home.select_hero(this.h_uuid) oops.message.dispatchEvent("hero_card_select",{uuid:this.h_uuid})
this.show_bg(true) this.show_bg(true)
} }
check_show(event: string, args: any){ check_show(event: string, args: any){

View File

@@ -173,8 +173,37 @@ export class HeroViewComp extends CCComp {
if(this.hp <= 0 ) return if(this.hp <= 0 ) return
if(skill.tg< 3) return if(skill.tg< 3) return
this.check_uatk(skill); this.check_uatk(skill);
}
if(oCol.group == seCol.group&&oCol.tag==BoxSet.SKILL_TAG){
let skill = oCol.node.getComponent(SkillCom)!;
if(skill.tg==2||skill.tg==0){
this.do_buff(skill)
}
} }
}
do_buff(skill:any){
if(SkillSet[skill.s_uuid].hp > 0){ //buff加血
// let increase_hp=Math.floor(skill.hp/(skill.in_time/skill.cd))
let increase_hp=Math.floor(skill.hp)
this.add_hp(increase_hp)
}
if(SkillSet[skill.s_uuid].apup > 0){ //buff加攻击
// let increase_atk=Math.floor(skill.apup/(skill.in_time/skill.cd))
let increase_atk=Math.floor(skill.apup)
this.add_ap(increase_atk)
}
if(SkillSet[skill.s_uuid].shield > 0){ //buff护盾
this.add_shield(skill.shield)
}
if(SkillSet[skill.s_uuid].mhp > 0){ //hp最大值
// console.log("do_buff mhp: ",skill.mhp/(skill.in_time/skill.cd))
this.add_hp_max(skill.mhp/(skill.in_time/skill.cd))
}
} }
onEndContact (seCol: Collider2D, oCol: Collider2D) { onEndContact (seCol: Collider2D, oCol: Collider2D) {
@@ -222,7 +251,7 @@ export class HeroViewComp extends CCComp {
this.check_atk_counts() this.check_atk_counts()
this.check_enemy_alive() this.check_enemy_alive()
this.check_mission_buff() this.check_mission_buff()
this.hp_show()
if(this.ice_cd > 0){ if(this.ice_cd > 0){
this.ice_cd -=dt; this.ice_cd -=dt;
return return
@@ -236,7 +265,16 @@ export class HeroViewComp extends CCComp {
this.in_atk(dt); this.in_atk(dt);
this.move(dt); this.move(dt);
} }
hp_show(){
let hp_progress= this.hp/this.rhp_max;
this.node.getChildByName("top").getChildByName("hp").getComponent(ProgressBar)!.progress = hp_progress;
if(this.is_boss) return
if(this.hp == this.rhp_max){
this.node.getChildByName("top").getChildByName("hp").active = false;
} else{
this.node.getChildByName("top").getChildByName("hp").active = true;
}
}
//移动 //移动
move(dt: number){ move(dt: number){
if(this.stop_cd > 0||smc.mission.is_victory||smc.mission.is_defeat){ if(this.stop_cd > 0||smc.mission.is_victory||smc.mission.is_defeat){
@@ -322,6 +360,7 @@ export class HeroViewComp extends CCComp {
this.check_debuff(skill,l_hp) this.check_debuff(skill,l_hp)
if(this.shield > 0){ if(this.shield > 0){
this.shield -=1 this.shield -=1
if(this.shield == 0) this.BUFFCOMP.show_shield(false)
l_hp = 0 l_hp = 0
} }
this.hp_less(l_hp,skill.is_crit); this.hp_less(l_hp,skill.is_crit);
@@ -737,7 +776,7 @@ export class HeroViewComp extends CCComp {
} }
add_shield(shield:number){ add_shield(shield:number){
this.shield =shield this.shield =shield
console.log("shield:",shield); if(this.shield>0) this.BUFFCOMP.show_shield(true)
} }
// add_cd(cd: number){ // add_cd(cd: number){
// this.cd += this.cd*((100-cd)/100); // this.cd += this.cd*((100-cd)/100);

View File

@@ -14,6 +14,8 @@ import { Talents } from "../common/config/TalentSet";
import { HeroViewComp } from "../hero/HeroViewComp"; import { HeroViewComp } from "../hero/HeroViewComp";
import { Position } from "../../../../extensions/oops-plugin-framework/assets/libs/gui/badge/Badge"; import { Position } from "../../../../extensions/oops-plugin-framework/assets/libs/gui/badge/Badge";
import { MissionHomeComp } from "./MissionHomeComp"; import { MissionHomeComp } from "./MissionHomeComp";
import { GameEvent } from "../common/config/GameEvent";
import { MissionComp } from "./MissionComp";
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
/** 视图层对象 */ /** 视图层对象 */
@@ -27,6 +29,7 @@ export class CardControllerComp extends CCComp {
bbg_x:any=[-300,-150,0,150,300] bbg_x:any=[-300,-150,0,150,300]
protected onLoad(): void { protected onLoad(): void {
this.bbg=this.node.getChildByName("bar").getChildByName("bbg") this.bbg=this.node.getChildByName("bar").getChildByName("bbg")
oops.message.on(GameEvent.MissionStart,this.mission_start,this)
} }
start() { start() {
this.bbg=this.node.getChildByName("bar").getChildByName("bbg") this.bbg=this.node.getChildByName("bar").getChildByName("bbg")
@@ -53,6 +56,13 @@ export class CardControllerComp extends CCComp {
this.node.getChildByName("mission").active = false; this.node.getChildByName("mission").active = false;
} }
mission_start(){
this.node.getChildByName("bar").active=false;
let mission=this.node.getChildByName("mission").getComponent(MissionComp)
mission.node.active = true;
mission.mission_start()
smc.mission.play = true;
}
bar_change(e:any,args:any){ bar_change(e:any,args:any){
console.log("bar_change",args) console.log("bar_change",args)
this.node.getChildByName("bar").active=true; this.node.getChildByName("bar").active=true;

View File

@@ -15,19 +15,19 @@ export class HCard extends ecs.Entity {
} }
load(uuid:number=1001,index:number=-1,parent:any) { load(uuid:number=1001,index:number=-1,parent:any) {
var path = "game/gui/hcard"; var path = "game/gui/hcard";
// var icon_path = "game/heros/herois" var icon_path = "game/heros/herois"
// resources.load(icon_path, SpriteAtlas, (err: any, atlas) => { resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
// const sprite = node.getChildByName("Mask").getChildByName("icon").getComponent(Sprite); const sprite = node.getChildByName("Mask").getChildByName("icon").getComponent(Sprite);
// sprite.spriteFrame = atlas.getSpriteFrame(HeroInfo[uuid].path); sprite.spriteFrame = atlas.getSpriteFrame(HeroInfo[uuid].path);
// }); });
var prefab: Prefab = oops.res.get(path, Prefab)!; var prefab: Prefab = oops.res.get(path, Prefab)!;
console.log("load_hcard",prefab) console.log("load_hcard",prefab)
var node = instantiate(prefab); var node = instantiate(prefab);
node.parent = parent node.parent = parent
var path = "game/heros/uiheros/"+HeroInfo[uuid].path; // var path = "game/heros/uiheros/"+HeroInfo[uuid].path;
var prefab: Prefab = oops.res.get(path, Prefab)!; // var prefab: Prefab = oops.res.get(path, Prefab)!;
var snode = instantiate(prefab); // var snode = instantiate(prefab);
snode.parent = node.getChildByName("Mask") // snode.parent = node.getChildByName("Mask")
var hcc = node.getComponent(HCardComp)!; var hcc = node.getComponent(HCardComp)!;
hcc.hi= index hcc.hi= index
this.add(hcc) this.add(hcc)

View File

@@ -7,13 +7,9 @@ import { UiHeroComp } from "../hero/UiHeroComp";
import { BoxSet, GameSet } from "../common/config/BoxSet"; import { BoxSet, GameSet } from "../common/config/BoxSet";
import { smc } from "../common/SingletonModuleComp"; import { smc } from "../common/SingletonModuleComp";
import { HeroSelect } from "../hero/HeroSelect"; import { HeroSelect } from "../hero/HeroSelect";
import { MSklist, SkillSet } from "../common/config/SkillSet";
import { MSCard } from "./MSCard";
import { CardControllerComp } from "./CardController";
import { MissionComp } from "./MissionComp";
import { MSCardComp } from "./MSCardComp";
import { HeroSelectComp } from "../hero/HeroSelectComp"; import { HeroSelectComp } from "../hero/HeroSelectComp";
import { MBSet } from "../common/config/MissionSet"; import { MBSet } from "../common/config/MissionSet";
import { GameEvent } from "../common/config/GameEvent";
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
@@ -28,7 +24,10 @@ export class MissionHomeComp extends CCComp {
{uuid:0,px:-200}, {uuid:0,px:-200},
{uuid:0,px:-300}, {uuid:0,px:-300},
] ]
protected onLoad(): void {
oops.message.on("hero_card_select", this.select_hero, this);
oops.message.on("hero_card_cancel_select", this.cancel_hero, this);
}
/** 视图层逻辑代码分离演示 */ /** 视图层逻辑代码分离演示 */
start() { start() {
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象 // var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
@@ -40,7 +39,6 @@ export class MissionHomeComp extends CCComp {
this.init_buff() this.init_buff()
} }
start_mission() { start_mission() {
console.log("mission_home : start_mission")
if (this.heros.length <=0 ) { if (this.heros.length <=0 ) {
oops.gui.toast("请先选择英雄") oops.gui.toast("请先选择英雄")
return return
@@ -54,16 +52,9 @@ export class MissionHomeComp extends CCComp {
{uuid:0,px:-200}, {uuid:0,px:-200},
{uuid:0,px:-300}, {uuid:0,px:-300},
] ]
oops.message.dispatchEvent(GameEvent.MissionStart, {})
let home =this.node.parent.getComponent(CardControllerComp);
home.node.getChildByName("bar").active=false;
let mission=home.node.getChildByName("mission").getComponent(MissionComp)
mission.node.active = true;
mission.mission_start()
smc.mission.play = true;
this.node.active=false; this.node.active=false;
} }
init_buff(){ init_buff(){
smc.vmdata.mission.ap_up=MBSet.ap_add*smc.vmdata.buff_num[0]/MBSet.ap_cost smc.vmdata.mission.ap_up=MBSet.ap_add*smc.vmdata.buff_num[0]/MBSet.ap_cost
@@ -112,42 +103,29 @@ export class MissionHomeComp extends CCComp {
} }
} }
load_skill_card(){ load_skill_card(){
let ms_num:number =MSklist.length
let parent= this.node.getChildByName("skills").getChildByName("view").getChildByName("content")
let height=ms_num*135
parent.getComponent(UITransform).height=height
for (let i = 0; i < ms_num; i++) {
let msc =ecs.getEntity<MSCard>(MSCard)
msc.load(MSklist[i],parent,2)
}
} }
load_ui_heros(){ load_ui_heros(){
for(let i=0;i<smc.fight_heros.length;i++){ for(let i=0;i<smc.fight_heros.length;i++){
this.select_hero(smc.fight_heros[i]) this.select_hero("local",{uuid:smc.fight_heros[i]})
} }
} }
select_skill(){
if(SkillSet[smc.mission.mskill]==undefined) return select_hero(event:any,args:any){
var icon_path = "game/skills/skill_icon" console.log("select_hero",args.uuid)
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
const sprite = this.node.getChildByName("msk").getChildByName("icon").getComponent(Sprite);
sprite.spriteFrame = atlas.getSpriteFrame(SkillSet[smc.mission.mskill].path);
});
}
select_hero(h_uuid:number){
for(let i=0;i<GameSet.HERO_NUM;i++){ for(let i=0;i<GameSet.HERO_NUM;i++){
if(this.heros_pos[i].uuid==0){ if(this.heros_pos[i].uuid==0){
this.heros_pos[i].uuid=h_uuid this.heros_pos[i].uuid=args.uuid
this.call_hero(h_uuid,i) this.call_hero(args.uuid,i)
break break
} }
} }
} }
cancel_hero(h_uuid:number){ cancel_hero(event:any,args:any){
for(let i=0;i<GameSet.HERO_NUM;i++){ for(let i=0;i<GameSet.HERO_NUM;i++){
if(this.heros_pos[i].uuid==h_uuid){ if(this.heros_pos[i].uuid==args.uuid){
this.heros_pos[i].uuid=0 this.heros_pos[i].uuid=0
this.destory_hero(h_uuid) this.destory_hero(args.uuid)
} }
} }
} }
@@ -270,28 +248,7 @@ export class MissionHomeComp extends CCComp {
smc.vmdata.buff_num[4] -= MBSet.dodge_cost smc.vmdata.buff_num[4] -= MBSet.dodge_cost
smc.vmdata.mission.dodge_up=MBSet.dodge_add*smc.vmdata.buff_num[4]/MBSet.dodge_cost smc.vmdata.mission.dodge_up=MBSet.dodge_add*smc.vmdata.buff_num[4]/MBSet.dodge_cost
} }
show_skills(){
this.node.getChildByName("skills").setPosition(0,400)
}
hide_skills(){
this.node.getChildByName("skills").setPosition(0,-800)
let mscards:any= ecs.query(ecs.allOf(MSCardComp));
for(let i=0;i<mscards.length;i++){
mscards[i].MSCardComp.is_select=true
mscards[i].MSCardComp.is_update=false
mscards[i].MSCardComp.change()
}
this.node.getChildByName("skills").getChildByName("noset").active=false
this.node.getChildByName("skills").getChildByName("set").active=true
}
set_skills(){
let mscards:any= ecs.query(ecs.allOf(MSCardComp));
for(let i=0;i<mscards.length;i++){
mscards[i].MSCardComp.change_set()
}
this.node.getChildByName("skills").getChildByName("set").active=!this.node.getChildByName("skills").getChildByName("set").active
this.node.getChildByName("skills").getChildByName("noset").active=!this.node.getChildByName("skills").getChildByName("noset").active
}
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */ /** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
reset() { reset() {
this.node.destroy(); this.node.destroy();

View File

@@ -4,7 +4,6 @@ import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/modu
import { BoxSet } from "../common/config/BoxSet"; import { BoxSet } from "../common/config/BoxSet";
import { smc } from "../common/SingletonModuleComp"; import { smc } from "../common/SingletonModuleComp";
import { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer"; import { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer";
import { HeroViewComp } from "../hero/HeroViewComp";
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops"; import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
import { GameEvent } from "../common/config/GameEvent"; import { GameEvent } from "../common/config/GameEvent";
import { SkillSet } from "../common/config/SkillSet"; import { SkillSet } from "../common/config/SkillSet";
@@ -64,10 +63,10 @@ export class SkillCom extends CCComp {
if(otCol.group != seCol.group&&otCol.tag ==0){ if(otCol.group != seCol.group&&otCol.tag ==0){
this.atk_count+=1 this.atk_count+=1
} }
if(otCol.group == seCol.group&&otCol.tag ==0&&(this.tg==2||this.tg==0)){ // if(otCol.group == seCol.group&&otCol.tag ==0&&(this.tg==2||this.tg==0)){
this.to_console("skill onBeginContact 是对自己人的buff",seCol,otCol) // this.to_console("skill onBeginContact 是对自己人的buff",seCol,otCol)
this.do_buff(otCol.node.getComponent(HeroViewComp)) // this.do_buff(otCol.node.getComponent(HeroViewComp))
} // }
} }
to_console(value:any,value2:any=null,value3:any=null){ to_console(value:any,value2:any=null,value3:any=null){
console.log("["+this.s_name+this.s_uuid+"]:",value,value2,value3) console.log("["+this.s_name+this.s_uuid+"]:",value,value2,value3)

View File

@@ -30,7 +30,7 @@
"isRemote": false "isRemote": false
}, },
"bytedance-mini-game": { "bytedance-mini-game": {
"compressionType": "merge_dep", "compressionType": "subpackage",
"isRemote": false "isRemote": false
}, },
"oppo-mini-game": { "oppo-mini-game": {
@@ -106,11 +106,19 @@
"overwriteSettings": { "overwriteSettings": {
"wechatgame": { "wechatgame": {
"compressionType": "subpackage" "compressionType": "subpackage"
},
"bytedance-mini-game": {
"compressionType": "subpackage"
} }
} }
} }
} }
} }
} }
},
"splash-setting": {
"background": {
"type": "color"
}
} }
} }

View File

@@ -6,7 +6,7 @@
"label": "customSplash", "label": "customSplash",
"enable": true, "enable": true,
"customSplash": { "customSplash": {
"complete": false, "complete": true,
"form": "https://creator-api.cocos.com/api/form/show?sid=5867a11f63bd65515866589488c9bca0" "form": "https://creator-api.cocos.com/api/form/show?sid=5867a11f63bd65515866589488c9bca0"
} }
}, },