From f5a8cb20de5a2442c0dd58c6999f45655b25d70f Mon Sep 17 00:00:00 2001 From: "pan@work" Date: Wed, 11 Sep 2024 10:19:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=BB=E5=87=BB=E8=B7=9D=E7=A6=BB=E8=AE=BE?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/resources/game/hero/arc1.prefab | 4 +- assets/resources/game/hero/arc2.prefab | 4 +- assets/resources/game/hero/arc3.prefab | 4 +- assets/resources/game/hero/m1.prefab | 4 +- assets/resources/game/hero/m2.prefab | 4 +- assets/resources/game/hero/m3.prefab | 4 +- assets/resources/game/monster/ys1.prefab | 4 +- assets/resources/game/monster/ys2.prefab | 4 +- assets/resources/game/monster/ys3.prefab | 4 +- assets/resources/gui/role_controller.prefab | 4 +- assets/script/Main.ts | 5 +- assets/script/game/Role/RoleViewComp.ts | 1 + .../script/game/common/SingletonModuleComp.ts | 1 - assets/script/game/common/config/CardSet.ts | 9 ++- assets/script/game/common/config/MonSet.ts | 30 ++++---- assets/script/game/common/config/heroSet.ts | 30 ++++---- assets/script/game/gui/ShowInfoCom.ts | 70 ------------------- assets/script/game/gui/ShowInfoCom.ts.meta | 9 --- assets/script/game/hero/BoxRangComp.ts | 4 +- assets/script/game/hero/Hero.ts | 2 +- assets/script/game/hero/HeroViewComp.ts | 47 +++++++------ assets/script/game/map/MapSkillComp.ts | 2 +- assets/script/game/mon/BoxRangComp.ts | 4 +- assets/script/game/mon/Mon.ts | 1 + assets/script/game/mon/MonViewComp.ts | 45 ++++++------ .../script/game/{monster => skills}/CSkill.ts | 0 .../game/{monster => skills}/CSkill.ts.meta | 0 .../game/{monster => skills}/CSkillComp.ts | 5 +- .../{monster => skills}/CSkillComp.ts.meta | 0 .../game/{monster => skills}/CSkillModel.ts | 0 .../{monster => skills}/CSkillModel.ts.meta | 0 31 files changed, 114 insertions(+), 191 deletions(-) delete mode 100644 assets/script/game/gui/ShowInfoCom.ts delete mode 100644 assets/script/game/gui/ShowInfoCom.ts.meta rename assets/script/game/{monster => skills}/CSkill.ts (100%) rename assets/script/game/{monster => skills}/CSkill.ts.meta (100%) rename assets/script/game/{monster => skills}/CSkillComp.ts (97%) rename assets/script/game/{monster => skills}/CSkillComp.ts.meta (100%) rename assets/script/game/{monster => skills}/CSkillModel.ts (100%) rename assets/script/game/{monster => skills}/CSkillModel.ts.meta (100%) diff --git a/assets/resources/game/hero/arc1.prefab b/assets/resources/game/hero/arc1.prefab index f1d845e6..996e980e 100644 --- a/assets/resources/game/hero/arc1.prefab +++ b/assets/resources/game/hero/arc1.prefab @@ -225,12 +225,12 @@ "_restitution": 0, "_offset": { "__type__": "cc.Vec2", - "x": 0, + "x": 250, "y": 0 }, "_size": { "__type__": "cc.Size", - "width": 200, + "width": 500, "height": 150 }, "_id": "" diff --git a/assets/resources/game/hero/arc2.prefab b/assets/resources/game/hero/arc2.prefab index 5cc2ced1..02888e62 100644 --- a/assets/resources/game/hero/arc2.prefab +++ b/assets/resources/game/hero/arc2.prefab @@ -225,12 +225,12 @@ "_restitution": 0, "_offset": { "__type__": "cc.Vec2", - "x": 0, + "x": 250, "y": 0 }, "_size": { "__type__": "cc.Size", - "width": 200, + "width": 500, "height": 150 }, "_id": "" diff --git a/assets/resources/game/hero/arc3.prefab b/assets/resources/game/hero/arc3.prefab index 08d89054..b1148e2b 100644 --- a/assets/resources/game/hero/arc3.prefab +++ b/assets/resources/game/hero/arc3.prefab @@ -225,12 +225,12 @@ "_restitution": 0, "_offset": { "__type__": "cc.Vec2", - "x": 0, + "x": 250, "y": 0 }, "_size": { "__type__": "cc.Size", - "width": 200, + "width": 500, "height": 150 }, "_id": "" diff --git a/assets/resources/game/hero/m1.prefab b/assets/resources/game/hero/m1.prefab index 06e46a1b..0bef6e37 100644 --- a/assets/resources/game/hero/m1.prefab +++ b/assets/resources/game/hero/m1.prefab @@ -225,12 +225,12 @@ "_restitution": 0, "_offset": { "__type__": "cc.Vec2", - "x": 0, + "x": 250, "y": 0 }, "_size": { "__type__": "cc.Size", - "width": 200, + "width": 500, "height": 150 }, "_id": "" diff --git a/assets/resources/game/hero/m2.prefab b/assets/resources/game/hero/m2.prefab index 69834f48..4e933d4f 100644 --- a/assets/resources/game/hero/m2.prefab +++ b/assets/resources/game/hero/m2.prefab @@ -225,12 +225,12 @@ "_restitution": 0, "_offset": { "__type__": "cc.Vec2", - "x": 0, + "x": 250, "y": 0 }, "_size": { "__type__": "cc.Size", - "width": 200, + "width": 500, "height": 150 }, "_id": "" diff --git a/assets/resources/game/hero/m3.prefab b/assets/resources/game/hero/m3.prefab index a8a23d47..97c9bb0c 100644 --- a/assets/resources/game/hero/m3.prefab +++ b/assets/resources/game/hero/m3.prefab @@ -225,12 +225,12 @@ "_restitution": 0, "_offset": { "__type__": "cc.Vec2", - "x": 0, + "x": 250, "y": 0 }, "_size": { "__type__": "cc.Size", - "width": 200, + "width": 500, "height": 150 }, "_id": "" diff --git a/assets/resources/game/monster/ys1.prefab b/assets/resources/game/monster/ys1.prefab index 8c1ef4bc..86ce5db0 100644 --- a/assets/resources/game/monster/ys1.prefab +++ b/assets/resources/game/monster/ys1.prefab @@ -225,12 +225,12 @@ "_restitution": 0, "_offset": { "__type__": "cc.Vec2", - "x": 0, + "x": -250, "y": 0 }, "_size": { "__type__": "cc.Size", - "width": 200, + "width": 500, "height": 150 }, "_id": "" diff --git a/assets/resources/game/monster/ys2.prefab b/assets/resources/game/monster/ys2.prefab index 1d52bfa2..b5c90fd1 100644 --- a/assets/resources/game/monster/ys2.prefab +++ b/assets/resources/game/monster/ys2.prefab @@ -225,12 +225,12 @@ "_restitution": 0, "_offset": { "__type__": "cc.Vec2", - "x": 0, + "x": -250, "y": 0 }, "_size": { "__type__": "cc.Size", - "width": 200, + "width": 500, "height": 150 }, "_id": "" diff --git a/assets/resources/game/monster/ys3.prefab b/assets/resources/game/monster/ys3.prefab index cd6d9ab1..fd03f73d 100644 --- a/assets/resources/game/monster/ys3.prefab +++ b/assets/resources/game/monster/ys3.prefab @@ -225,12 +225,12 @@ "_restitution": 0, "_offset": { "__type__": "cc.Vec2", - "x": 0, + "x": -250, "y": 0 }, "_size": { "__type__": "cc.Size", - "width": 200, + "width": 500, "height": 150 }, "_id": "" diff --git a/assets/resources/gui/role_controller.prefab b/assets/resources/gui/role_controller.prefab index 947c33a2..0ed4734e 100644 --- a/assets/resources/gui/role_controller.prefab +++ b/assets/resources/gui/role_controller.prefab @@ -15480,7 +15480,7 @@ "__id__": 692 } ], - "_active": true, + "_active": false, "_components": [ { "__id__": 701 @@ -16495,7 +16495,7 @@ "value": { "__type__": "cc.Vec3", "x": 181.9, - "y": 303.257, + "y": 167.711, "z": 0 } }, diff --git a/assets/script/Main.ts b/assets/script/Main.ts index 34682c30..699d810a 100644 --- a/assets/script/Main.ts +++ b/assets/script/Main.ts @@ -19,8 +19,8 @@ const { ccclass, property } = _decorator; @ccclass('Main') export class Main extends Root { start() { - // if (DEBUG) profiler.showStats(); - // PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb + if (DEBUG) profiler.showStats(); + PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb // // | EPhysics2DDrawFlags.Pair // |EPhysics2DDrawFlags.CenterOfMass // |EPhysics2DDrawFlags.Joint @@ -28,7 +28,6 @@ export class Main extends Root { // console.log("PhysicsSystem2D",PhysicsSystem2D.instance.gravity) } protected async run() { - console.log("Game start",this); smc.initialize = ecs.getEntity(Initialize); smc.vmAdd() } diff --git a/assets/script/game/Role/RoleViewComp.ts b/assets/script/game/Role/RoleViewComp.ts index 2f2cd80b..1cc20f72 100644 --- a/assets/script/game/Role/RoleViewComp.ts +++ b/assets/script/game/Role/RoleViewComp.ts @@ -63,6 +63,7 @@ export class RoleViewComp extends CCComp { atk: number = 10; /**攻击力 */ // atk_speed: number = 1; atk_cd: number = 1.3; /**攻击速度 攻击间隔 */ + atk_dis: number = 800; atk_time: number = 0; /** 冷却时间 */ speed: number = 100; /** 角色移动速度 */ diff --git a/assets/script/game/common/SingletonModuleComp.ts b/assets/script/game/common/SingletonModuleComp.ts index 6f17808b..eed49e22 100644 --- a/assets/script/game/common/SingletonModuleComp.ts +++ b/assets/script/game/common/SingletonModuleComp.ts @@ -112,7 +112,6 @@ export class SingletonModuleComp extends ecs.Comp { }; vmAdd() { - console.log("smc vm_data vmAdd"); VM.add(this.vm_data, "data"); } diff --git a/assets/script/game/common/config/CardSet.ts b/assets/script/game/common/config/CardSet.ts index c0564809..12f68464 100644 --- a/assets/script/game/common/config/CardSet.ts +++ b/assets/script/game/common/config/CardSet.ts @@ -16,13 +16,13 @@ export const CardList={ // {uuid:9007,type:1},{uuid:9008,type:1},{uuid:9009,type:1},{uuid:9010,type:1},{uuid:9011,type:1},{uuid:9012,type:1}, ], 4:[ + {uuid:9001,type:1},{uuid:9002,type:1},{uuid:9003,type:1},{uuid:9004,type:1},{uuid:9005,type:1},{uuid:9006,type:1}, + ], + 5:[ {uuid:1001,type:2},{uuid:1002,type:2},{uuid:4011,type:2},{uuid:4012,type:2}, {uuid:6001,type:3},{uuid:6004,type:3},{uuid:6101,type:3},{uuid:6002,type:3},{uuid:6003,type:3},{uuid:6005,type:3},{uuid:6006,type:3}, {uuid:6102,type:3},{uuid:6103,type:3}, {uuid:6210,type:3},{uuid:6213,type:3},{uuid:6216,type:3},{uuid:6211,type:3},{uuid:6212,type:3}, {uuid:6214,type:3},{uuid:6215,type:3},{uuid:6217,type:3},{uuid:6218,type:3}, - ], - 5:[ - {uuid:9001,type:1},{uuid:9002,type:1},{uuid:9003,type:1},{uuid:9004,type:1},{uuid:9005,type:1},{uuid:9006,type:1}, // {uuid:9007,type:1},{uuid:9008,type:1},{uuid:9009,type:1},{uuid:9010,type:1},{uuid:9011,type:1},{uuid:9012,type:1}, ], 6:[ @@ -31,5 +31,8 @@ export const CardList={ {uuid:6102,type:3},{uuid:6103,type:3}, {uuid:6210,type:3},{uuid:6213,type:3},{uuid:6216,type:3},{uuid:6211,type:3},{uuid:6212,type:3}, {uuid:6214,type:3},{uuid:6215,type:3},{uuid:6217,type:3},{uuid:6218,type:3}, ], + 7:[ + + ], } diff --git a/assets/script/game/common/config/MonSet.ts b/assets/script/game/common/config/MonSet.ts index 757072d6..b571b638 100644 --- a/assets/script/game/common/config/MonSet.ts +++ b/assets/script/game/common/config/MonSet.ts @@ -1,33 +1,33 @@ export const MonSet={ - 1001:{uuid: 1001,path: "ge1",type: 1,level: 1,name: "战斗哥",atk: 4,hp: 24,atk_cd: 2,power: 50,speed: 30, + 1001:{uuid: 1001,path: "ge1",type: 1,level: 1,name: "战斗哥",atk: 4,hp: 24,atk_dis:40,atk_cd: 2,power: 50,speed: 30, skill: "base",max_skill: "base",skill_uuid: 9001,max_skill_uuid: 1001,word: "守护",info: "自身护盾", atktype: "攻击型",mon: "orc"}, - 1002:{uuid: 1002,path: "ge2",type: 1,level: 1,name: "墨西哥",atk: 4,hp: 24,atk_cd: 2,power: 50,speed: 30, + 1002:{uuid: 1002,path: "ge2",type: 1,level: 1,name: "墨西哥",atk: 4,hp: 24,atk_dis:40,atk_cd: 2,power: 50,speed: 30, skill: "base",max_skill: "base",skill_uuid: 9001,max_skill_uuid: 1001,word: "守护",info: "自身护盾", atktype: "攻击型",mon: "orc"}, - 1003:{uuid: 1003,path: "ge3",type: 1,level: 1,name: "铁头哥",atk: 4,hp: 24,atk_cd: 2,power: 50,speed: 30, + 1003:{uuid: 1003,path: "ge3",type: 1,level: 1,name: "铁头哥",atk: 4,hp: 24,atk_dis:40,atk_cd: 2,power: 50,speed: 30, skill: "base",max_skill: "base",skill_uuid: 9001,max_skill_uuid: 1001,word: "守护",info: "自身护盾", atktype: "攻击型",mon: "orc"}, - 1011:{uuid: 1011,path: "orc1",type: 1,level: 1,name: "森林兽人",atk: 4,hp: 24,atk_cd: 2,power: 50,speed: 30, + 1011:{uuid: 1011,path: "orc1",type: 1,level: 1,name: "森林兽人",atk: 4,hp: 24,atk_dis:40,atk_cd: 2,power: 50,speed: 30, skill: "base",max_skill: "base",skill_uuid: 9001,max_skill_uuid: 1001,word: "守护",info: "自身护盾", atktype: "攻击型",mon: "orc"}, - 1012:{uuid: 1012,path: "orc2",type: 1,level: 1,name: "荒野兽人",atk: 4,hp: 24,atk_cd: 2,power: 50,speed: 30, + 1012:{uuid: 1012,path: "orc2",type: 1,level: 1,name: "荒野兽人",atk: 4,hp: 24,atk_dis:40,atk_cd: 2,power: 50,speed: 30, skill: "base",max_skill: "base",skill_uuid: 9001,max_skill_uuid: 1001,word: "守护",info: "自身护盾", atktype: "攻击型",mon: "orc"}, - 1013:{uuid: 1013,path: "orc3",type: 1,level: 1,name: "兽人战士",atk: 4,hp: 24,atk_cd: 2,power: 50,speed: 30, + 1013:{uuid: 1013,path: "orc3",type: 1,level: 1,name: "兽人战士",atk: 4,hp: 24,atk_dis:40,atk_cd: 2,power: 50,speed: 30, skill: "base",max_skill: "base",skill_uuid: 9001,max_skill_uuid: 1001,word: "守护",info: "自身护盾", atktype: "攻击型",mon: "orc"}, - 1021:{uuid: 1021,path: "gou1",type: 1,level: 1,name: "黄皮豺狼",atk: 4,hp: 24,atk_cd: 2,power: 50,speed: 30, + 1021:{uuid: 1021,path: "gou1",type: 1,level: 1,name: "黄皮豺狼",atk: 4,hp: 24,atk_dis:40,atk_cd: 2,power: 50,speed: 30, skill: "base",max_skill: "base",skill_uuid: 9001,max_skill_uuid: 1001,word: "守护",info: "自身护盾", atktype: "攻击型",mon: "gou"}, - 1022:{uuid: 1022,path: "gou2",type: 1,level: 1,name: "白皮豺狼",atk: 4,hp: 24,atk_cd: 2,power: 50,speed: 30, + 1022:{uuid: 1022,path: "gou2",type: 1,level: 1,name: "白皮豺狼",atk: 4,hp: 24,atk_dis:40,atk_cd: 2,power: 50,speed: 30, skill: "base",max_skill: "base",skill_uuid: 9001,max_skill_uuid: 1001,word: "守护",info: "自身护盾", atktype: "攻击型",mon: "gou"}, - 1023:{uuid: 1023,path: "gou3",type: 1,level: 1,name: "灰皮豺狼",atk: 4,hp: 24,atk_cd: 2,power: 50,speed: 30, + 1023:{uuid: 1023,path: "gou3",type: 1,level: 1,name: "灰皮豺狼",atk: 4,hp: 24,atk_dis:40,atk_cd: 2,power: 50,speed: 30, skill: "base",max_skill: "base",skill_uuid: 9001,max_skill_uuid: 1001,word: "守护",info: "自身护盾", atktype: "攻击型",mon: "gou"}, - 1031:{uuid: 1031,path: "gou1",type: 1,level: 1,name: "独眼巨人",atk: 4,hp: 24,atk_cd: 2,power: 50,speed: 30, + 1031:{uuid: 1031,path: "gou1",type: 1,level: 1,name: "独眼巨人",atk: 4,hp: 24,atk_dis:40,atk_cd: 2,power: 50,speed: 30, skill: "base",max_skill: "base",skill_uuid: 9001,max_skill_uuid: 1001,word: "守护",info: "自身护盾", atktype: "攻击型",mon: "gou"}, - 1032:{uuid: 1032,path: "gou2",type: 1,level: 1,name: "狂暴独眼",atk: 4,hp: 24,atk_cd: 2,power: 50,speed: 30, + 1032:{uuid: 1032,path: "gou2",type: 1,level: 1,name: "狂暴独眼",atk: 4,hp: 24,atk_dis:40,atk_cd: 2,power: 50,speed: 30, skill: "base",max_skill: "base",skill_uuid: 9001,max_skill_uuid: 1001,word: "守护",info: "自身护盾", atktype: "攻击型",mon: "gou"}, - 1033:{uuid: 1033,path: "gou3",type: 1,level: 1,name: "独眼首领",atk: 4,hp: 24,atk_cd: 2,power: 50,speed: 30, + 1033:{uuid: 1033,path: "gou3",type: 1,level: 1,name: "独眼首领",atk: 4,hp: 24,atk_dis:40,atk_cd: 2,power: 50,speed: 30, skill: "base",max_skill: "base",skill_uuid: 9001,max_skill_uuid: 1001,word: "守护",info: "自身护盾", atktype: "攻击型",mon: "gou"}, - 1041:{uuid: 1041,path: "ys1",type: 1,level: 1,name: "火元素",atk: 4,hp: 24,atk_cd: 2,power: 50,speed: 30, + 1041:{uuid: 1041,path: "ys1",type: 1,level: 1,name: "火元素",atk: 4,hp: 24,atk_dis:400,atk_cd: 2,power: 50,speed: 30, skill: "base",max_skill: "base",skill_uuid: 9001,max_skill_uuid: 1001,word: "守护",info: "自身护盾", atktype: "攻击型",mon: "gou"}, - 1042:{uuid: 1042,path: "ys2",type: 1,level: 1,name: "冰元素",atk: 4,hp: 24,atk_cd: 2,power: 50,speed: 30, + 1042:{uuid: 1042,path: "ys2",type: 1,level: 1,name: "冰元素",atk: 4,hp: 24,atk_dis:400,atk_cd: 2,power: 50,speed: 30, skill: "base",max_skill: "base",skill_uuid: 9001,max_skill_uuid: 1001,word: "守护",info: "自身护盾", atktype: "攻击型",mon: "ys"}, - 1043:{uuid: 1043,path: "ys3",type: 1,level: 1,name: "气元素",atk: 4,hp: 24,atk_cd: 2,power: 50,speed: 30, + 1043:{uuid: 1043,path: "ys3",type: 1,level: 1,name: "气元素",atk: 4,hp: 24,atk_dis:400,atk_cd: 2,power: 50,speed: 30, skill: "base",max_skill: "base",skill_uuid: 9001,max_skill_uuid: 1001,word: "守护",info: "自身护盾", atktype: "攻击型",mon: "ys"}, } \ No newline at end of file diff --git a/assets/script/game/common/config/heroSet.ts b/assets/script/game/common/config/heroSet.ts index 8408f669..a1b053b9 100644 --- a/assets/script/game/common/config/heroSet.ts +++ b/assets/script/game/common/config/heroSet.ts @@ -1,22 +1,22 @@ export const HeroSet={ - 9001:{uuid: 9001,path: "k1",type: 1,level: 1,name: "战士1",atk: 4,hp: 24,atk_cd: 2,power: 50,speed: 30, + 9001:{uuid: 9001,path: "k1",type: 1,level: 1,name: "战士1",atk: 4,hp: 24,atk_dis:40,atk_cd: 2,power: 50,speed: 30, skill: "base",max_skill: "base",skill_uuid: 9001,max_skill_uuid: 1001,word: "守护",info: "自身护盾", atktype: "攻击型",mon: "狗"}, - 9002:{uuid: 9002,path: "k2",type: 2,level: 1,name: "战士2",atk: 2,hp: 48,atk_cd: 2,power: 50,speed: 30, + 9002:{uuid: 9002,path: "k2",type: 2,level: 1,name: "战士2",atk: 2,hp: 48,atk_dis:40,atk_cd: 2,power: 50,speed: 30, skill: "base",max_skill: "base",skill_uuid: 9001,max_skill_uuid: 1001,word: "守护",info: "自身护盾", atktype: "血量型",mon: "绵羊"}, - 9003:{uuid: 9003,path: "k3",type: 1,level: 1,name: "战士3",atk: 4,hp: 24,atk_cd: 2,power: 50,speed: 30, + 9003:{uuid: 9003,path: "k3",type: 1,level: 1,name: "战士3",atk: 4,hp: 24,atk_dis:40,atk_cd: 2,power: 50,speed: 30, skill: "base",max_skill: "base",skill_uuid: 9001,max_skill_uuid: 1001, atktype: "攻击型",mon: "蚂蚁"}, - 9004:{uuid: 9004,path: "m1",type: 1,level: 1,name: "魔法师1",atk: 4,hp: 24,atk_cd: 2,power: 50,speed: 30, - skill: "base",max_skill: "base",skill_uuid: 9001,max_skill_uuid: 1001, atktype: "攻击型",mon: "蚂蚁"}, - 9005:{uuid: 9005,path: "m2",type: 3,level: 1,name: "魔法师2",atk: 3,hp: 18,atk_cd: 1,power: 50,speed: 30, - skill: "base",max_skill: "base",skill_uuid: 9001,max_skill_uuid: 1001, atktype: "攻速型",mon: "鼠"}, - 9006:{uuid: 9006,path: "m3",type: 3,level: 1,name: "魔法师3",atk: 3,hp: 18,atk_cd: 2,power: 50,speed: 30, - skill: "base",max_skill: "base",skill_uuid: 9001,max_skill_uuid: 1001,word: "守护",info: "自身护盾", atktype: "攻速型",mon: "猫"}, - 9007:{uuid: 9007,path: "arc1",type: 3,level: 1,name: "弓箭手1",atk: 3,hp: 18,atk_cd: 1,power: 50,speed: 30, - skill: "base",max_skill: "base",skill_uuid: 9001,max_skill_uuid: 1001,word: "狂暴",info: "全体攻击", atktype: "攻速型",mon: "松鼠"}, - 9008:{uuid: 9008,path: "arc2",type: 3,level: 2,name: "弓箭手2",atk: 4,hp: 27,atk_cd: 1,power: 50,speed: 30, - skill: "base",max_skill: "base",skill_uuid: 9001,max_skill_uuid: 1001, atktype: "攻速型",mon: "机械蜜蜂"}, - 9009:{uuid: 9009,path: "arc3",type: 1,level: 2,name: "弓箭手3",atk: 6,hp: 36,atk_cd: 2,power: 50,speed: 30, - skill: "base",max_skill: "base",skill_uuid: 9001,max_skill_uuid: 1001, atktype: "攻击型",mon: "鹰"}, + 9004:{uuid: 9004,path: "m1",type: 1,level: 1,name: "魔法师1",atk: 4,hp: 24,atk_dis:400,atk_cd: 2,power: 50,speed: 30, + skill: "base",max_skill: "base2",skill_uuid: 9001,max_skill_uuid: 1001, atktype: "攻击型",mon: "蚂蚁"}, + 9005:{uuid: 9005,path: "m2",type: 3,level: 1,name: "魔法师2",atk: 3,hp: 18,atk_dis:400,atk_cd: 1,power: 50,speed: 30, + skill: "base",max_skill: "base2",skill_uuid: 9001,max_skill_uuid: 1001, atktype: "攻速型",mon: "鼠"}, + 9006:{uuid: 9006,path: "m3",type: 3,level: 1,name: "魔法师3",atk: 3,hp: 18,atk_dis:400,atk_cd: 2,power: 50,speed: 30, + skill: "base",max_skill: "base2",skill_uuid: 9001,max_skill_uuid: 1001,word: "守护",info: "自身护盾", atktype: "攻速型",mon: "猫"}, + 9007:{uuid: 9007,path: "arc1",type: 3,level: 1,name: "弓箭手1",atk: 3,hp: 18,atk_dis:500,atk_cd: 1,power: 50,speed: 30, + skill: "base",max_skill: "base3",skill_uuid: 9001,max_skill_uuid: 1001,word: "狂暴",info: "全体攻击", atktype: "攻速型",mon: "松鼠"}, + 9008:{uuid: 9008,path: "arc2",type: 3,level: 2,name: "弓箭手2",atk: 4,hp: 27,atk_dis:500,atk_cd: 1,power: 50,speed: 30, + skill: "base",max_skill: "base3",skill_uuid: 9001,max_skill_uuid: 1001, atktype: "攻速型",mon: "机械蜜蜂"}, + 9009:{uuid: 9009,path: "arc3",type: 1,level: 2,name: "弓箭手3",atk: 6,hp: 36,atk_dis:500,atk_cd: 2,power: 50,speed: 30, + skill: "base",max_skill: "base3",skill_uuid: 9001,max_skill_uuid: 1001, atktype: "攻击型",mon: "鹰"}, } \ No newline at end of file diff --git a/assets/script/game/gui/ShowInfoCom.ts b/assets/script/game/gui/ShowInfoCom.ts deleted file mode 100644 index 531f5c20..00000000 --- a/assets/script/game/gui/ShowInfoCom.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { _decorator, Component, EventTouch, Node, NodeEventType } from 'cc'; -const { ccclass, property } = _decorator; - -@ccclass('ShowInfoCom') -export class ShowInfoCom extends Component { - protected onLoad(): void { - this.node.on(NodeEventType.TOUCH_START, this.onTouchMove, this); - this.node.on(NodeEventType.TOUCH_MOVE, this.onTouchMove, this); - this.node.on(NodeEventType.TOUCH_END, this.onTouchEnd, this); - this.node.on(NodeEventType.TOUCH_CANCEL, this.onTouchEnd, this); - // oops.message.on("active_card_eid", this.do_active_card_eid, this); - } - start() { - - } - onTouchMove(event: EventTouch) { - let delta = event.getDelta(); - this.node.setPosition(this.node.position.x+delta.x,this.node.position.y+delta.y); - this.show_info() - } - show_info(uuid:number,card_type:number){ - console.log("show_info",this.card_uid) - let parent = this.node.parent.parent - let node =parent.getChildByName("item_box") - if(this.card_type == 2){ - smc.vm_data.item_box.info = SkillSet[this.card_uid].info - smc.vm_data.item_box.name = SkillSet[this.card_uid].name - smc.vm_data.item_box.skillcd = SkillSet[this.card_uid].cd - smc.vm_data.item_box.skillsd = SkillSet[this.card_uid].sd - smc.vm_data.item_box.atk = SkillSet[this.card_uid].atk - smc.vm_data.item_box.hp = SkillSet[this.card_uid].hp - node.active=true - } - if(this.card_type == 3){ - console.log(SkillSet[this.card_uid]) - smc.vm_data.item_box.info = SkillSet[this.card_uid].info - smc.vm_data.item_box.name = SkillSet[this.card_uid].name - smc.vm_data.item_box.skillcd = SkillSet[this.card_uid].cd - smc.vm_data.item_box.skillsd = SkillSet[this.card_uid].sd - smc.vm_data.item_box.atk = SkillSet[this.card_uid].atk - smc.vm_data.item_box.hp = SkillSet[this.card_uid].hp - smc.vm_data.item_box.shield = SkillSet[this.card_uid].shield - node.active=true - if(SkillSet[this.card_uid].shield > 0){ - node.getChildByName("data").getChildByName("shield").active=true - } - if(SkillSet[this.card_uid].hp > 0){ - node.getChildByName("data").getChildByName("hp").active=true - } - } - } - onTouchEnd(){ - if(this.node.position.y-this.pos_y > 150){ - this.use_card() - }else{ - this.node.setPosition(this.pos_x,this.pos_y); - } - let parent = this.node.parent.parent - let node = parent.getChildByName("item_box") - node.active=false - node.getChildByName("data").getChildByName("shield").active=false - node.getChildByName("data").getChildByName("hp").active=false - - } - update(deltaTime: number) { - - } -} - - diff --git a/assets/script/game/gui/ShowInfoCom.ts.meta b/assets/script/game/gui/ShowInfoCom.ts.meta deleted file mode 100644 index 84fc7c65..00000000 --- a/assets/script/game/gui/ShowInfoCom.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "d612b0f7-dcf2-499a-993f-8b42291faa18", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/hero/BoxRangComp.ts b/assets/script/game/hero/BoxRangComp.ts index d211d227..d5bcc77e 100644 --- a/assets/script/game/hero/BoxRangComp.ts +++ b/assets/script/game/hero/BoxRangComp.ts @@ -63,9 +63,9 @@ export class BoxRangComp extends CCComp { this.HeroViewComp.enemy = otherCollider.node; } } - if(Math.abs(other_pos.x-self_pos.x) < this.atk_range){ + if(Math.abs(other_pos.x-self_pos.x) < this.HeroViewComp.atk_dis){ this.HeroViewComp.is_atking = true; - // this.HeroViewComp.stop_cd = 0.1 + this.HeroViewComp.stop_cd = 0.1 } } diff --git a/assets/script/game/hero/Hero.ts b/assets/script/game/hero/Hero.ts index 2769e8b8..715aff3d 100644 --- a/assets/script/game/hero/Hero.ts +++ b/assets/script/game/hero/Hero.ts @@ -41,7 +41,6 @@ export class Hero extends ecs.Entity { /** 加载角色 */ load(pos: Vec3 = Vec3.ZERO,scale:number = -1,uuid:number=1001,layer:Node=smc.map.MapView.scene.entityLayer!.node!) { - console.log("加载角色",uuid,smc.heros[uuid]); var path = "game/hero/"+smc.heros[uuid].path; var prefab: Prefab = oops.res.get(path, Prefab)!; @@ -85,6 +84,7 @@ export class Hero extends ecs.Entity { mv.level = smc.heros[uuid].level; mv.atk = smc.heros[uuid].atk; mv.atk_cd = smc.heros[uuid].atk_cd; + mv.atk_dis = smc.heros[uuid].atk_dis; mv.power = smc.heros[uuid].power; mv.type = smc.heros[uuid].type; mv.skill_uuid = 9001; diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index 6a9229a6..1b448e4a 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -64,6 +64,7 @@ export class HeroViewComp extends CCComp { atk: number = 10; /**攻击力 */ // atk_speed: number = 1; atk_cd: number = 1.3; /**攻击速度 攻击间隔 */ + atk_dis: number = 80; atk_time: number = 0; /** 冷却时间 */ speed: number = 100; /** 角色移动速度 */ @@ -138,29 +139,29 @@ export class HeroViewComp extends CCComp { onEndContact (selfCollider: Collider2D, otherCollider: Collider2D) { } onPreSolve (selfCollider: Collider2D, otherCollider: Collider2D) { - if(selfCollider.group != otherCollider.group&&otherCollider.tag == 0){ - this.is_atking = true; - this.stop_cd = 0.1; - } + // if(selfCollider.group != otherCollider.group&&otherCollider.tag == 0){ + // this.is_atking = true; + // this.stop_cd = 0.1; + // } } onPostSolve (selfCollider: Collider2D, otherCollider: Collider2D) { - if(selfCollider.group == otherCollider.group&&otherCollider.tag == 0&&selfCollider.tag == 0){ - let self_pos=selfCollider.node.getPosition(); - let other_pos=otherCollider.node.getPosition(); - // console.log('mon view group 相同'); - switch (selfCollider.group) { - case BoxSet.HERO: - if(self_pos.x < other_pos.x){ - // this.stop_cd=0.1 - } - break; - case BoxSet.MONSTER: - if(self_pos.x > other_pos.x){ - // this.stop_cd=0.1 - } - break - } - } + // if(selfCollider.group == otherCollider.group&&otherCollider.tag == 0&&selfCollider.tag == 0){ + // let self_pos=selfCollider.node.getPosition(); + // let other_pos=otherCollider.node.getPosition(); + // // console.log('mon view group 相同'); + // switch (selfCollider.group) { + // case BoxSet.HERO: + // if(self_pos.x < other_pos.x){ + // // this.stop_cd=0.1 + // } + // break; + // case BoxSet.MONSTER: + // if(self_pos.x > other_pos.x){ + // // this.stop_cd=0.1 + // } + // break + // } + // } } @@ -182,11 +183,11 @@ export class HeroViewComp extends CCComp { if(this.stop_cd > 0){ return } - if (this.scale === 1 && this.node.position.x >= 120) { + if (this.scale === 1 && this.node.position.x >= BoxSet.MONSTER_START) { return; } - if(this.scale===-1&&this.node.position.x <= BoxSet.HERO_START){ + if(this.scale===-1&&this.node.position.x <= BoxSet.HERO_START-this.atk_cd){ return; } if(this.enemy){ diff --git a/assets/script/game/map/MapSkillComp.ts b/assets/script/game/map/MapSkillComp.ts index efba94b2..e80777b0 100644 --- a/assets/script/game/map/MapSkillComp.ts +++ b/assets/script/game/map/MapSkillComp.ts @@ -4,7 +4,7 @@ import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/modu import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops"; import { BoxSet } from "../common/config/BoxSet"; import { MapViewScene } from "./view/MapViewScene"; -import { CSkill } from "../monster/CSkill"; +import { CSkill } from "../skills/CSkill"; const { ccclass, property } = _decorator; /** 视图层对象 */ diff --git a/assets/script/game/mon/BoxRangComp.ts b/assets/script/game/mon/BoxRangComp.ts index c02c3b54..8ece71db 100644 --- a/assets/script/game/mon/BoxRangComp.ts +++ b/assets/script/game/mon/BoxRangComp.ts @@ -63,9 +63,9 @@ export class BoxRangComp extends CCComp { this.MonViewComp.enemy = otherCollider.node; } } - if(Math.abs(other_pos.x-self_pos.x) < this.atk_range){ + if(Math.abs(other_pos.x-self_pos.x) < this.MonViewComp.atk_dis){ this.MonViewComp.is_atking = true; - // this.MonViewComp.stop_cd = 0.1 + this.MonViewComp.stop_cd = 0.1 } } diff --git a/assets/script/game/mon/Mon.ts b/assets/script/game/mon/Mon.ts index 132d1b62..c5716e08 100644 --- a/assets/script/game/mon/Mon.ts +++ b/assets/script/game/mon/Mon.ts @@ -83,6 +83,7 @@ export class Mon extends ecs.Entity { mv.level = smc.monsters[uuid].level; mv.atk = smc.monsters[uuid].atk; mv.atk_cd = smc.monsters[uuid].atk_cd; + mv.atk_dis = smc.monsters[uuid].atk_dis; mv.power = smc.monsters[uuid].power; mv.type = smc.monsters[uuid].type; mv.skill_uuid = 9001; diff --git a/assets/script/game/mon/MonViewComp.ts b/assets/script/game/mon/MonViewComp.ts index 05136258..d5713da9 100644 --- a/assets/script/game/mon/MonViewComp.ts +++ b/assets/script/game/mon/MonViewComp.ts @@ -64,6 +64,7 @@ export class MonViewComp extends CCComp { atk: number = 10; /**攻击力 */ // atk_speed: number = 1; atk_cd: number = 1.3; /**攻击速度 攻击间隔 */ + atk_dis: number = 80; atk_time: number = 0; /** 冷却时间 */ speed: number = 100; /** 角色移动速度 */ @@ -138,29 +139,29 @@ export class MonViewComp extends CCComp { onEndContact (selfCollider: Collider2D, otherCollider: Collider2D) { } onPreSolve (selfCollider: Collider2D, otherCollider: Collider2D) { - if(selfCollider.group != otherCollider.group&&otherCollider.tag == 0){ - this.is_atking = true; - this.stop_cd = 0.1; - } + // if(selfCollider.group != otherCollider.group&&otherCollider.tag == 0){ + // this.is_atking = true; + // this.stop_cd = 0.1; + // } } onPostSolve (selfCollider: Collider2D, otherCollider: Collider2D) { - if(selfCollider.group == otherCollider.group&&otherCollider.tag == 0&&selfCollider.tag == 0){ - let self_pos=selfCollider.node.getPosition(); - let other_pos=otherCollider.node.getPosition(); - // console.log('mon view group 相同'); - switch (selfCollider.group) { - case BoxSet.HERO: - if(self_pos.x < other_pos.x){ - // this.stop_cd=0.1 - } - break; - case BoxSet.MONSTER: - if(self_pos.x > other_pos.x){ - // this.stop_cd=0.1 - } - break - } - } + // if(selfCollider.group == otherCollider.group&&otherCollider.tag == 0&&selfCollider.tag == 0){ + // let self_pos=selfCollider.node.getPosition(); + // let other_pos=otherCollider.node.getPosition(); + // // console.log('mon view group 相同'); + // switch (selfCollider.group) { + // case BoxSet.HERO: + // if(self_pos.x < other_pos.x){ + // // this.stop_cd=0.1 + // } + // break; + // case BoxSet.MONSTER: + // if(self_pos.x > other_pos.x){ + // // this.stop_cd=0.1 + // } + // break + // } + // } } @@ -186,7 +187,7 @@ export class MonViewComp extends CCComp { return; } - if(this.scale===-1&&this.node.position.x <= BoxSet.HERO_START){ + if(this.scale===-1&&this.node.position.x <= BoxSet.HERO_START+this.atk_cd){ return; } // if(this.enemy){ diff --git a/assets/script/game/monster/CSkill.ts b/assets/script/game/skills/CSkill.ts similarity index 100% rename from assets/script/game/monster/CSkill.ts rename to assets/script/game/skills/CSkill.ts diff --git a/assets/script/game/monster/CSkill.ts.meta b/assets/script/game/skills/CSkill.ts.meta similarity index 100% rename from assets/script/game/monster/CSkill.ts.meta rename to assets/script/game/skills/CSkill.ts.meta diff --git a/assets/script/game/monster/CSkillComp.ts b/assets/script/game/skills/CSkillComp.ts similarity index 97% rename from assets/script/game/monster/CSkillComp.ts rename to assets/script/game/skills/CSkillComp.ts index af03aa49..491fa892 100644 --- a/assets/script/game/monster/CSkillComp.ts +++ b/assets/script/game/skills/CSkillComp.ts @@ -4,15 +4,12 @@ import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/modu import { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer"; import { Skill } from "../skills/Skill"; import { SkillSet } from "../common/config/SkillSet"; -import { Monster } from "./Monster"; -import { MonsterModelComp } from "./MonsterModelComp"; -import { MonsterViewComp } from "./MonsterViewComp"; import { BoxSet, GameSet } from "../common/config/BoxSet"; import { smc } from "../common/SingletonModuleComp"; import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops"; -import { HeroModelComp } from "./HeroModelComp"; import { RandomManager } from "../../../../extensions/oops-plugin-framework/assets/core/common/random/RandomManager"; import { MonModelComp } from "../mon/MonModelComp"; +import { HeroModelComp } from "../hero/HeroModelComp"; const { ccclass, property } = _decorator; /** 视图层对象 */ diff --git a/assets/script/game/monster/CSkillComp.ts.meta b/assets/script/game/skills/CSkillComp.ts.meta similarity index 100% rename from assets/script/game/monster/CSkillComp.ts.meta rename to assets/script/game/skills/CSkillComp.ts.meta diff --git a/assets/script/game/monster/CSkillModel.ts b/assets/script/game/skills/CSkillModel.ts similarity index 100% rename from assets/script/game/monster/CSkillModel.ts rename to assets/script/game/skills/CSkillModel.ts diff --git a/assets/script/game/monster/CSkillModel.ts.meta b/assets/script/game/skills/CSkillModel.ts.meta similarity index 100% rename from assets/script/game/monster/CSkillModel.ts.meta rename to assets/script/game/skills/CSkillModel.ts.meta