diff --git a/DataTables/Datas/__tables__.xlsx b/DataTables/Datas/__tables__.xlsx index cfa5ff01..2187ed7c 100644 Binary files a/DataTables/Datas/__tables__.xlsx and b/DataTables/Datas/__tables__.xlsx differ diff --git a/DataTables/Datas/战斗/角色/属性/属性.xlsx b/DataTables/Datas/战斗/角色/属性/属性.xlsx index 6473cb89..d665fd2d 100644 Binary files a/DataTables/Datas/战斗/角色/属性/属性.xlsx and b/DataTables/Datas/战斗/角色/属性/属性.xlsx differ diff --git a/DataTables/Datas/战斗/角色/属性/角色初始属性.xlsx b/DataTables/Datas/战斗/角色/属性/角色初始属性.xlsx index e7456072..e8e07cea 100644 Binary files a/DataTables/Datas/战斗/角色/属性/角色初始属性.xlsx and b/DataTables/Datas/战斗/角色/属性/角色初始属性.xlsx differ diff --git a/DataTables/Datas/战斗/角色/角色技能.xlsx b/DataTables/Datas/战斗/角色/角色技能.xlsx index 99910c39..fc524782 100644 Binary files a/DataTables/Datas/战斗/角色/角色技能.xlsx and b/DataTables/Datas/战斗/角色/角色技能.xlsx differ diff --git a/JisolGameCocos/assets/resources/UICanvas.prefab b/JisolGameCocos/assets/resources/UICanvas.prefab index b432c53d..9cc79b76 100644 --- a/JisolGameCocos/assets/resources/UICanvas.prefab +++ b/JisolGameCocos/assets/resources/UICanvas.prefab @@ -81,7 +81,7 @@ "__id__": 1 }, "_children": [], - "_active": false, + "_active": true, "_components": [ { "__id__": 3 diff --git a/JisolGameCocos/assets/resources/WorldCanvas.prefab b/JisolGameCocos/assets/resources/WorldCanvas.prefab index 09549974..1ed2a865 100644 --- a/JisolGameCocos/assets/resources/WorldCanvas.prefab +++ b/JisolGameCocos/assets/resources/WorldCanvas.prefab @@ -157,7 +157,10 @@ "_iso": 0, "_screenScale": 1, "_visibility": 1073741825, - "_targetTexture": null, + "_targetTexture": { + "__uuid__": "a0d1e275-5512-493e-8e15-7d2db8beb48e", + "__expectedType__": "cc.RenderTexture" + }, "_postProcess": null, "_usePostProcess": false, "_cameraType": -1, diff --git a/JisolGameCocos/assets/resources/config/json/tbgrolebaseattribute.json b/JisolGameCocos/assets/resources/config/json/tbgrolebaseattribute.json index 7e3570d2..3b666ffe 100644 --- a/JisolGameCocos/assets/resources/config/json/tbgrolebaseattribute.json +++ b/JisolGameCocos/assets/resources/config/json/tbgrolebaseattribute.json @@ -1,8 +1,8 @@ [ { "id": 0, - "Blood": 100, - "Attack": 10, + "Blood": 200, + "Attack": 20, "Defend": 5 } ] \ No newline at end of file diff --git a/JisolGameCocos/assets/script/App.ts b/JisolGameCocos/assets/script/App.ts index 5f7ad4ac..a49ed0b3 100644 --- a/JisolGameCocos/assets/script/App.ts +++ b/JisolGameCocos/assets/script/App.ts @@ -26,12 +26,12 @@ import { JAPI, JAPIConfig } from "../../extensions/ngame/assets/ngame/util/JAPI" import { AppData } from "./AppData"; import AppAction from "./AppAction"; -// let APIPath = `http://localhost:8080` -// let WsPath = `ws://localhost:8080/websocket` +let APIPath = `http://localhost:8080` +let WsPath = `ws://localhost:8080/websocket` // let APIPath = `http://192.168.1.23:8080` // let WsPath = `ws://192.168.1.23:8080/websocket` -let APIPath = `http://192.168.0.113:8080` -let WsPath = `ws://192.168.0.113:8080/websocket` +// let APIPath = `http://192.168.0.113:8080` +// let WsPath = `ws://192.168.0.113:8080/websocket` // let APIPath = `https://api.pet.jisol.cn` // let WsPath = `wss://api.pet.jisol.cn/websocket` diff --git a/JisolGameCocos/assets/script/battle/base/GObject.ts b/JisolGameCocos/assets/script/battle/base/GObject.ts index aae2c9ab..907a09f5 100644 --- a/JisolGameCocos/assets/script/battle/base/GObject.ts +++ b/JisolGameCocos/assets/script/battle/base/GObject.ts @@ -10,7 +10,7 @@ export enum GTowards{ export default class GObject extends JNGSyncProtoBase{ //当前模式 - _mode:GBaseMode<{}>; + _mode:GBaseMode<{},{}>; //是否镜像 _isMirror:boolean = false; @@ -26,10 +26,10 @@ export default class GObject extends JNGSyncProtoBase{ this._isMirror = value; } - get mode():GBaseMode<{}>{ + get mode():GBaseMode<{},{}>{ return this._mode; } - set mode(value:GBaseMode<{}>){ + set mode(value:GBaseMode<{},{}>){ this._mode = value; } diff --git a/JisolGameCocos/assets/script/battle/base/attack/GAttackNormal.ts b/JisolGameCocos/assets/script/battle/base/attack/GAttackNormal.ts index d3367a80..9b9abd7c 100644 --- a/JisolGameCocos/assets/script/battle/base/attack/GAttackNormal.ts +++ b/JisolGameCocos/assets/script/battle/base/attack/GAttackNormal.ts @@ -1,5 +1,7 @@ import { TB } from "../../../../resources/config/data/schema"; +import GRoleAttack from "../common/GRoleAttack"; import GRoleDefault from "../role/GRoleDefault"; +import { GRoleAttackType } from "../values/GRoleValues"; import { GAttackBase } from "./GAttack"; @@ -7,7 +9,7 @@ import { GAttackBase } from "./GAttack"; export default class GAttackNormal implements GAttackBase{ attack(role: GRoleDefault, info: TB.TbGRoleAttack) { - role.fsm.enemy.onHit(); + GRoleAttack.onNormalAttack(role,role.fsm.enemy); //普通攻击 } } diff --git a/JisolGameCocos/assets/script/battle/base/attack/GAttackParabolicBangRemote.ts b/JisolGameCocos/assets/script/battle/base/attack/GAttackParabolicBangRemote.ts index cc298fd9..0b3be07e 100644 --- a/JisolGameCocos/assets/script/battle/base/attack/GAttackParabolicBangRemote.ts +++ b/JisolGameCocos/assets/script/battle/base/attack/GAttackParabolicBangRemote.ts @@ -12,6 +12,7 @@ import GDetection from "../common/GDetection"; import { rect } from "cc"; import GRoleDefault from "../role/GRoleDefault"; import { TB } from "../../../../resources/config/data/schema"; +import GRoleAttack from "../common/GRoleAttack"; /** * 抛物线 爆炸普攻 @@ -76,12 +77,10 @@ export default class GAttackParabolicRemote implements GAttackBase{ //销毁 bullet.node.destroy(); - // enemy.getComponent(BoxCollider2D).apply(); - - // console.log(enemy.v2World,enemy.getComponent(BoxCollider2D).worldPoints,enemy.getComponent(UITransform).getBoundingBoxToWorld()); - GDetection.testAABBRole(rect(effect.node.worldPosition.x,effect.node.worldPosition.y,aw,ah)).forEach(role =>{ - role.onHit(); + GDetection.testAABBCenterRole(rect(effect.node.worldPosition.x,effect.node.worldPosition.y,aw,ah)).forEach(enemy =>{ + GRoleAttack.onNormalAttack(role,enemy); //普通攻击 }); + }) .start(); diff --git a/JisolGameCocos/assets/script/battle/base/common/GDetection.ts b/JisolGameCocos/assets/script/battle/base/common/GDetection.ts index 2d4ea938..97776d7d 100644 --- a/JisolGameCocos/assets/script/battle/base/common/GDetection.ts +++ b/JisolGameCocos/assets/script/battle/base/common/GDetection.ts @@ -8,7 +8,9 @@ import { Vec2 } from "cc"; export default class GDetection{ //检测角色 - static testAABBRole(rect:math.Rect):GRoleBase<{}>[]{ + static testAABBCenterRole(rect:math.Rect):GRoleBase<{}>[]{ + rect.x -= rect.width / 2; + rect.y -= rect.height / 2; //@ts-ignore return PhysicsSystem2D.instance.testAABB(rect).map(item => item.getComponent(GRoleBase)); } diff --git a/JisolGameCocos/assets/script/battle/base/common/GRoleAttack.ts b/JisolGameCocos/assets/script/battle/base/common/GRoleAttack.ts new file mode 100644 index 00000000..2776c8f1 --- /dev/null +++ b/JisolGameCocos/assets/script/battle/base/common/GRoleAttack.ts @@ -0,0 +1,13 @@ +import GRoleBase from "../role/GRoleBase"; +import GRoleDefault from "../role/GRoleDefault"; +import { GRoleAttackType } from "../values/GRoleValues"; + +//宠物攻击 工具类 +export default class GRoleAttack{ + + //普通攻击 + static onNormalAttack(attack:GRoleBase<{}>,hit:GRoleBase<{}>){ + hit.onHit(GRoleAttackType.NormalAttack,attack.values.onAttack(GRoleAttackType.NormalAttack),attack); + } + +} \ No newline at end of file diff --git a/JisolGameCocos/assets/script/battle/base/common/GRoleAttack.ts.meta b/JisolGameCocos/assets/script/battle/base/common/GRoleAttack.ts.meta new file mode 100644 index 00000000..4fdfc2c5 --- /dev/null +++ b/JisolGameCocos/assets/script/battle/base/common/GRoleAttack.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.23", + "importer": "typescript", + "imported": true, + "uuid": "d4ea04bc-bcfc-45ce-9753-126ac88604d1", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/JisolGameCocos/assets/script/battle/base/common/GSpine.ts b/JisolGameCocos/assets/script/battle/base/common/GSpine.ts index c3c02ff6..d563a4d8 100644 --- a/JisolGameCocos/assets/script/battle/base/common/GSpine.ts +++ b/JisolGameCocos/assets/script/battle/base/common/GSpine.ts @@ -48,7 +48,7 @@ export default class GSpine{ } // 创建一个 Spine 并且 播放 销毁 - static onPlaySceneSpine(scene:GBaseMode<{}>,pos:Vec2,spine:sp.SkeletonData,play:string):JNSkeleton{ + static onPlaySceneSpine(scene:GBaseMode<{},{}>,pos:Vec2,spine:sp.SkeletonData,play:string):JNSkeleton{ let create = this.onCreateSpine(spine); scene.addGNode(create.node,pos); diff --git a/JisolGameCocos/assets/script/battle/base/role/GRoleBase.ts b/JisolGameCocos/assets/script/battle/base/role/GRoleBase.ts index d731e1ab..ed00d31e 100644 --- a/JisolGameCocos/assets/script/battle/base/role/GRoleBase.ts +++ b/JisolGameCocos/assets/script/battle/base/role/GRoleBase.ts @@ -8,6 +8,8 @@ import { GFSMAnimBase } from "../fsm/GFSMAnimBase"; import GFSMBase from "../fsm/GFSMBase"; import { app } from "../../../App"; import { TB } from "../../../../resources/config/data/schema"; +import GRoleValues, { GRoleAttackType } from "../values/GRoleValues"; +import GAttributeBase from "../values/attribute/GAttributeBase"; const { ccclass, property } = _decorator; export enum GRoleAnimEvent{ @@ -19,8 +21,6 @@ export default abstract class GRoleBase extends GObject{ @property(JNSkeleton) spine:JNSkeleton; - // @property(sp.Skeleton) - // spine:sp.Skeleton; //角色 role:TB.TbGRole; @@ -63,6 +63,9 @@ export default abstract class GRoleBase extends GObject{ //添加攻击回调 addAttackCallback(fun:Function){this.attackCallbacks.push(fun)}; + //角色数值类 + values:GRoleValues; + get():this{ if(this.isDie) return null; return this; @@ -82,6 +85,9 @@ export default abstract class GRoleBase extends GObject{ //创建角色动画状态机 this.fsmAnim = this.fsmAnimCreate(); + //创建数值类 + this.values = new GRoleValues(); + } //初始化 @@ -145,11 +151,12 @@ export default abstract class GRoleBase extends GObject{ } } - //受击 - onHit(){ + //受击 伤害类型 伤害 + onHit(type:GRoleAttackType,harm:number,enemy:GRoleBase<{}>){ // return; - this.blood -= 10; - this.hitCallbacks.forEach(fun => fun(this,10)); + harm = this.values.onUnderAttack(type,harm) + this.blood -= harm; + this.hitCallbacks.forEach(fun => fun(this,harm)); //检测是否死亡 if(this.blood <= 0){ //关闭状态机 @@ -170,6 +177,20 @@ export default abstract class GRoleBase extends GObject{ } } + //生效数值 + onEffectiveValue(...values:GAttributeBase[]){ + + this.values.reset(); + values.forEach(value => { + this.values.add(value); + }) + this.values.update(); + + //赋值血量 + this.blood = this.fullBlood = this.values.onBlood(); + + } + } diff --git a/JisolGameCocos/assets/script/battle/base/role/GRoleDefault.ts b/JisolGameCocos/assets/script/battle/base/role/GRoleDefault.ts index a784df85..17db823e 100644 --- a/JisolGameCocos/assets/script/battle/base/role/GRoleDefault.ts +++ b/JisolGameCocos/assets/script/battle/base/role/GRoleDefault.ts @@ -9,9 +9,7 @@ import { JEasing } from "../../../../../extensions/ngame/assets/ngame/sync/frame import { GAttack } from "../attack/GAttack"; import { v2 } from "cc"; import { GTactical } from "../../entity/GTactical"; -import { Vec2 } from "cc"; import { GSkill, GSkillBase, GSkillState } from "../../skill/GSkill"; -import JNFrameTime from "../../../../../extensions/ngame/assets/ngame/sync/frame/game/time/JNFrameTime"; import { TB } from "../../../../resources/config/data/schema"; import { TD } from "../../../App"; const { property,ccclass } = _decorator; diff --git a/JisolGameCocos/assets/script/battle/base/values.meta b/JisolGameCocos/assets/script/battle/base/values.meta new file mode 100644 index 00000000..27bf9517 --- /dev/null +++ b/JisolGameCocos/assets/script/battle/base/values.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.2.0", + "importer": "directory", + "imported": true, + "uuid": "84ccbb8f-b24a-4d98-91c1-dcd3f0201edb", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/JisolGameCocos/assets/script/battle/base/values/GRoleValues.ts b/JisolGameCocos/assets/script/battle/base/values/GRoleValues.ts new file mode 100644 index 00000000..af8912dc --- /dev/null +++ b/JisolGameCocos/assets/script/battle/base/values/GRoleValues.ts @@ -0,0 +1,94 @@ +import GAttribute, { GAttributeType } from "./attribute/GAttribute"; +import GAttributeBase from "./attribute/GAttributeBase"; + +//宠物攻击类 +export enum GRoleAttackType{ + NormalAttack, +} + +//宠物数值 核心类 +export default class GRoleValues { + + //宠物属性 + attribute:GAttribute; + + get attributes(){ + return this.attribute.info; + } + + constructor(){ + + //初始化属性 + this.attribute = new GAttribute(); + this.update(); + + } + + //重置 + reset(){ + //初始化属性 + this.attribute = new GAttribute(); + this.update(); + } + + //添加属性类 + add(info:GAttributeBase){ + this.attribute.add(info); + } + + //刷新属性 + update(){ + //刷新属性 + this.attribute.update(); + } + + //普通攻击 + onNormalAttack(){ + + //普通攻击伤害 = 攻击 + return this.attributes[GAttributeType.Attack]; + + } + + //受到普通攻击 + onUnderNormalAttack(under:number){ + + //受到普通攻击伤害 = 受到伤害 - 防御 + return Math.max(0,under - this.attributes[GAttributeType.Defend]); + + } + + //受到攻击 统一方法 + onUnderAttack(type:GRoleAttackType,under:number){ + if(type == GRoleAttackType.NormalAttack){ + //受到普通攻击 + return this.onUnderNormalAttack(under); + } + return under; + } + + //攻击 统一方法 + onAttack(type:GRoleAttackType){ + if(type == GRoleAttackType.NormalAttack){ + //普通攻击 + return this.onNormalAttack(); + } + return 0; + } + + //普通攻击某个目标 + onNormalAttackTarget(values:GRoleValues){ + return values.onUnderNormalAttack(this.onNormalAttack()); + } + + //血量 + onBlood(){ + + //总血量 = 血量 + return this.attributes[GAttributeType.Blood]; + + } + + +} + diff --git a/JisolGameCocos/assets/script/battle/base/values/GRoleValues.ts.meta b/JisolGameCocos/assets/script/battle/base/values/GRoleValues.ts.meta new file mode 100644 index 00000000..b547782e --- /dev/null +++ b/JisolGameCocos/assets/script/battle/base/values/GRoleValues.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.23", + "importer": "typescript", + "imported": true, + "uuid": "52b4e441-2a5c-4d33-8d4e-2b96df25afc2", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/JisolGameCocos/assets/script/battle/base/values/attribute.meta b/JisolGameCocos/assets/script/battle/base/values/attribute.meta new file mode 100644 index 00000000..f30cff70 --- /dev/null +++ b/JisolGameCocos/assets/script/battle/base/values/attribute.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.2.0", + "importer": "directory", + "imported": true, + "uuid": "e3df25b3-9781-42c1-9b3d-a74be923c931", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/JisolGameCocos/assets/script/battle/base/values/attribute/GAttribute.ts b/JisolGameCocos/assets/script/battle/base/values/attribute/GAttribute.ts new file mode 100644 index 00000000..56759ce9 --- /dev/null +++ b/JisolGameCocos/assets/script/battle/base/values/attribute/GAttribute.ts @@ -0,0 +1,55 @@ +import { TD } from "../../../../App"; +import GAttributeBase from "./GAttributeBase"; + +//属性类型 +export enum GAttributeType{ + Attack = 110001, //攻击 + Defend = 110002, //防御 + Blood = 110003, //血量 +} + +//属性类 +export default class GAttribute { + + attributes:GAttributeBase[] = []; + + //属性最终信息 {属性Id:属性值} + info:{[key:number]:number} = {}; + + //添加一个属性类 + add(info:GAttributeBase){ + this.attributes.push(info); + } + + //重置 + reset(){ + this.attributes = []; + this.update(); + } + + //刷新属性 + update(){ + + this.info = {}; + + TD.TbGAttribute.getDataList().forEach(attr => { + //初始化属性 + this.info[attr.id] = 0; + }); + + //累加全部属性 + this.attributes.forEach((attribute) => { + attribute.update(); + for (const key in attribute.attributes) { + if(this.info[key]){ + this.info[key] = this.info[key] + attribute.attributes[key]; + }else{ + this.info[key] = attribute.attributes[key]; + } + } + }) + + } + +} + diff --git a/JisolGameCocos/assets/script/battle/base/values/attribute/GAttribute.ts.meta b/JisolGameCocos/assets/script/battle/base/values/attribute/GAttribute.ts.meta new file mode 100644 index 00000000..eb88b24c --- /dev/null +++ b/JisolGameCocos/assets/script/battle/base/values/attribute/GAttribute.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.23", + "importer": "typescript", + "imported": true, + "uuid": "72467729-defa-485b-bd75-3bbe791ebea3", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/JisolGameCocos/assets/script/battle/base/values/attribute/GAttributeBase.ts b/JisolGameCocos/assets/script/battle/base/values/attribute/GAttributeBase.ts new file mode 100644 index 00000000..2faca5ad --- /dev/null +++ b/JisolGameCocos/assets/script/battle/base/values/attribute/GAttributeBase.ts @@ -0,0 +1,13 @@ + +//属性 基类 +export default abstract class GAttributeBase{ + + //属性 {属性Id:属性值} + attributes:{[key:number]:number} = {}; + + //刷新属性 + abstract update(); + +} + + diff --git a/JisolGameCocos/assets/script/battle/base/values/attribute/GAttributeBase.ts.meta b/JisolGameCocos/assets/script/battle/base/values/attribute/GAttributeBase.ts.meta new file mode 100644 index 00000000..595d29da --- /dev/null +++ b/JisolGameCocos/assets/script/battle/base/values/attribute/GAttributeBase.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.23", + "importer": "typescript", + "imported": true, + "uuid": "a0ef91dd-110a-4622-8a6d-4c16a6255d5f", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/JisolGameCocos/assets/script/battle/base/values/attribute/role.meta b/JisolGameCocos/assets/script/battle/base/values/attribute/role.meta new file mode 100644 index 00000000..dce5533b --- /dev/null +++ b/JisolGameCocos/assets/script/battle/base/values/attribute/role.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.2.0", + "importer": "directory", + "imported": true, + "uuid": "54170ba9-5142-4612-9335-28436a7ddc08", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/JisolGameCocos/assets/script/battle/base/values/attribute/role/GPetAttribute.ts b/JisolGameCocos/assets/script/battle/base/values/attribute/role/GPetAttribute.ts new file mode 100644 index 00000000..388b39e2 --- /dev/null +++ b/JisolGameCocos/assets/script/battle/base/values/attribute/role/GPetAttribute.ts @@ -0,0 +1,41 @@ +import { TD } from "../../../../../App"; +import { PlayerPetOV } from "../../../../../consts/API"; +import GAttributeBase from "../GAttributeBase"; + +//宠物属性 +export default class GPetAttribute extends GAttributeBase{ + + //宠物信息 + pet:PlayerPetOV; + + constructor(pet:PlayerPetOV){ + + super(); + this.pet = pet; + + //固定属性直接计算 + this.compute(); + + } + + //计算属性 + compute(){ + + this.attributes = {}; + //*************** 宠物初始属性 ************************** + let baseAttribute = TD.TbGRoleBaseAttribute.get(this.pet.petTbId) || TD.TbGRoleBaseAttribute.get(0); + + //获取全部属性信息 + TD.TbGAttribute.getDataList().forEach(attr => { + //保存初始属性 如果没有默认 0 + this.attributes[attr.id] = baseAttribute[attr.sign] || 0; + }); + + } + + //刷新属性 + update(): void { } + +} + + diff --git a/JisolGameCocos/assets/script/battle/base/values/attribute/role/GPetAttribute.ts.meta b/JisolGameCocos/assets/script/battle/base/values/attribute/role/GPetAttribute.ts.meta new file mode 100644 index 00000000..31140d53 --- /dev/null +++ b/JisolGameCocos/assets/script/battle/base/values/attribute/role/GPetAttribute.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.23", + "importer": "typescript", + "imported": true, + "uuid": "a66f3d1e-b975-4cf3-a666-54194eeda220", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/JisolGameCocos/assets/script/battle/modes/GOnHookMode.ts b/JisolGameCocos/assets/script/battle/modes/GOnHookMode.ts index d3ed2430..29bcb84e 100644 --- a/JisolGameCocos/assets/script/battle/modes/GOnHookMode.ts +++ b/JisolGameCocos/assets/script/battle/modes/GOnHookMode.ts @@ -24,6 +24,7 @@ import { GOnHookPet, GOnHookPets } from "../../../../extensions/ngame/assets/nga import GOnHookManager from "../../manager/battle/mode/GOnHookManager"; import GRoleOnHookCreepsExpand from "../base/role/expand/OnHook/GRoleOnHookCreepsExpand"; import { ModeRenderEvent } from "../../ui/Consts/Game/ModeRender"; +import GPetAttribute from "../base/values/attribute/role/GPetAttribute"; const { ccclass, property } = _decorator; //挂机模式状态 @@ -251,6 +252,10 @@ export default class GOnHookMode extends GBaseMode<{},{}>{ //向宠物添加 OnHook 扩展 let expand = role.node.addComponent(GRoleOnHookPlayerExpand); expand.petId = petId; + + //添加宠物属性 + role.onEffectiveValue(new GPetAttribute(info)); + } //生成野怪 @@ -262,6 +267,16 @@ export default class GOnHookMode extends GBaseMode<{},{}>{ let expand = role.node.addComponent(GRoleOnHookCreepsExpand); expand.creeps = creeps; + //添加野怪属性 + role.onEffectiveValue(new GPetAttribute({ + petId:0, + petPlayerId:0, + petTbId:creeps.petTbId, + petLevel:0, + petStar:0, + petStarExp:0, + })); + } //生成宠物 diff --git a/JisolGameCocos/assets/script/battle/skill/GSkillCDBase.ts b/JisolGameCocos/assets/script/battle/skill/GSkillCDBase.ts index 43095266..95f3f24c 100644 --- a/JisolGameCocos/assets/script/battle/skill/GSkillCDBase.ts +++ b/JisolGameCocos/assets/script/battle/skill/GSkillCDBase.ts @@ -1,5 +1,4 @@ import { TB } from "../../../resources/config/data/schema"; -import GRoleBase from "../base/role/GRoleBase"; import GRoleDefault from "../base/role/GRoleDefault"; import { GSkillBase, GSkillState } from "./GSkill"; diff --git a/JisolGameCocos/assets/script/battle/skill/RoleSkill/妙蛙种子/GSkillBulbasaurDoubleHit.ts b/JisolGameCocos/assets/script/battle/skill/RoleSkill/妙蛙种子/GSkillBulbasaurDoubleHit.ts index d413ed7b..089fd517 100644 --- a/JisolGameCocos/assets/script/battle/skill/RoleSkill/妙蛙种子/GSkillBulbasaurDoubleHit.ts +++ b/JisolGameCocos/assets/script/battle/skill/RoleSkill/妙蛙种子/GSkillBulbasaurDoubleHit.ts @@ -1,4 +1,5 @@ import { TB } from "../../../../../resources/config/data/schema"; +import GRoleAttack from "../../../base/common/GRoleAttack"; import GRoleBase from "../../../base/role/GRoleBase"; import GRoleDefault from "../../../base/role/GRoleDefault"; import GSkillAngerBase from "../../GSkillAngerBase"; @@ -26,7 +27,7 @@ export default class GSkillBulbasaurDoubleHit extends GSkillAngerBase{ let skill1Attack = () => { if(!enemy.isDie){ - enemy.onHit(); + GRoleAttack.onNormalAttack(this.role,enemy); } }; let end = () => { diff --git a/JisolGameCocos/assets/script/battle/skill/RoleSkill/疯狂松鼠/GSkillCrazySquirrel.ts b/JisolGameCocos/assets/script/battle/skill/RoleSkill/疯狂松鼠/GSkillCrazySquirrel.ts index d1d096fb..4698b6a9 100644 --- a/JisolGameCocos/assets/script/battle/skill/RoleSkill/疯狂松鼠/GSkillCrazySquirrel.ts +++ b/JisolGameCocos/assets/script/battle/skill/RoleSkill/疯狂松鼠/GSkillCrazySquirrel.ts @@ -2,7 +2,6 @@ import { v2 } from "cc"; import { JTween } from "../../../../../../extensions/ngame/assets/ngame/sync/frame/game/tween/JNFrameTween"; import { app } from "../../../../App"; import GSpine from "../../../base/common/GSpine"; -import GRoleBase from "../../../base/role/GRoleBase"; import GSkillCDBase from "../../GSkillCDBase"; import { v3 } from "cc"; import GBaseMode from "../../../GBaseMode"; @@ -10,6 +9,7 @@ import GDetection from "../../../base/common/GDetection"; import { rect } from "cc"; import GRoleDefault from "../../../base/role/GRoleDefault"; import { TB } from "../../../../../resources/config/data/schema"; +import GRoleAttack from "../../../base/common/GRoleAttack"; /** * 疯狂松鼠技能 @@ -33,7 +33,7 @@ export default class GSkillCrazySquirrel extends GSkillCDBase{ //获取敌人位置 let enemy = this.role.fsm.enemy; - let scene:GBaseMode<{}> = this.role.mode; + let scene:GBaseMode<{},{}> = this.role.mode; if(!enemy) return false; let aw = parseInt(this.info.skillArgs[1]); @@ -60,9 +60,8 @@ export default class GSkillCrazySquirrel extends GSkillCDBase{ let world = spine.node.worldPosition; spine.node.destroy(); GSpine.onPlaySceneSpine(scene,v2(world.x,world.y),app.battleRes.roleResSpine[30005],"animation"); - console.log(GDetection.testAABBRole(rect(world.x,world.y,aw,ah)).length) - GDetection.testAABBRole(rect(world.x,world.y,aw,ah)).forEach(role =>{ - role.onHit(); + GDetection.testAABBCenterRole(rect(world.x,world.y,aw,ah)).forEach(enemy =>{ + GRoleAttack.onNormalAttack(this.role,enemy); }); }) .start(); diff --git a/JisolGameServer/Main/src/main/resources/json/tbgrolebaseattribute.json b/JisolGameServer/Main/src/main/resources/json/tbgrolebaseattribute.json index 7e3570d2..3b666ffe 100644 --- a/JisolGameServer/Main/src/main/resources/json/tbgrolebaseattribute.json +++ b/JisolGameServer/Main/src/main/resources/json/tbgrolebaseattribute.json @@ -1,8 +1,8 @@ [ { "id": 0, - "Blood": 100, - "Attack": 10, + "Blood": 200, + "Attack": 20, "Defend": 5 } ] \ No newline at end of file