diff --git a/assets/resources/game/skills/icez.prefab b/assets/resources/game/skills/icez.prefab index 5dff30ec..54c8d23b 100644 --- a/assets/resources/game/skills/icez.prefab +++ b/assets/resources/game/skills/icez.prefab @@ -182,7 +182,7 @@ "defaultSkin": "default", "defaultAnimation": "show", "_premultipliedAlpha": true, - "_timeScale": 1, + "_timeScale": 0.9, "_preCacheMode": 0, "_cacheMode": 0, "_sockets": [], diff --git a/assets/resources/game/skills/zhaohuan.prefab b/assets/resources/game/skills/zhaohuan.prefab new file mode 100644 index 00000000..b7ff3522 --- /dev/null +++ b/assets/resources/game/skills/zhaohuan.prefab @@ -0,0 +1,339 @@ +[ + { + "__type__": "cc.Prefab", + "_name": "zhaohuan", + "_objFlags": 0, + "__editorExtras__": {}, + "_native": "", + "data": { + "__id__": 1 + }, + "optimizationPolicy": 0, + "persistent": false + }, + { + "__type__": "cc.Node", + "_name": "zhaohuan", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": null, + "_children": [ + { + "__id__": 2 + } + ], + "_active": true, + "_components": [ + { + "__id__": 6 + }, + { + "__id__": 8 + }, + { + "__id__": 10 + }, + { + "__id__": 12 + }, + { + "__id__": 14 + }, + { + "__id__": 16 + } + ], + "_prefab": { + "__id__": 18 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 1073741824, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "skill", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 1 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 3 + } + ], + "_prefab": { + "__id__": 5 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 1073741824, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 2 + }, + "_enabled": true, + "__prefab": { + "__id__": 4 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 48, + "height": 48 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "b4sNQPJWFKha7x75SWXmRj" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "7a5LvbdlxEc6FKa7cun2oB", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 7 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 120, + "height": 80 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.49664333316829656, + "y": 0.5156666649712457 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "63NP9yq3hEUKD/OZZZ5t7x" + }, + { + "__type__": "cc.RigidBody2D", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 9 + }, + "enabledContactListener": true, + "bullet": true, + "awakeOnLoad": true, + "_group": 4, + "_type": 2, + "_allowSleep": false, + "_gravityScale": 0, + "_linearDamping": 0, + "_angularDamping": 0, + "_linearVelocity": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_angularVelocity": 0, + "_fixedRotation": false, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "f1VxV09PdOkofzgGv1tsZE" + }, + { + "__type__": "cc.BoxCollider2D", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 11 + }, + "tag": 8, + "_group": 4, + "_density": 1, + "_sensor": true, + "_friction": 0.2, + "_restitution": 0, + "_offset": { + "__type__": "cc.Vec2", + "x": 0.4, + "y": -0.7 + }, + "_size": { + "__type__": "cc.Size", + "width": 11.6, + "height": 12.3 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "23eik112JPZYGiI8mJalTK" + }, + { + "__type__": "45646oIyIdA24W+0c5rdELD", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 13 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "8ahZv91itPcYJm8S0veHYl" + }, + { + "__type__": "cc.Animation", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 15 + }, + "playOnLoad": true, + "_clips": [ + { + "__uuid__": "2202bddf-38fc-4b0e-a004-ef962f61f49d", + "__expectedType__": "cc.AnimationClip" + } + ], + "_defaultClip": { + "__uuid__": "2202bddf-38fc-4b0e-a004-ef962f61f49d", + "__expectedType__": "cc.AnimationClip" + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "7cJdSTCj5Eu4vDiD6FPj8P" + }, + { + "__type__": "9e0d3yayihFMKm6st+kCG3D", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 17 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "d9m8Z9r0FAn79RIXwYOlkG" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "c46/YsCPVOJYA4mWEpNYRx", + "instance": null, + "targetOverrides": null + } +] \ No newline at end of file diff --git a/assets/resources/game/skills/zhaohuan.prefab.meta b/assets/resources/game/skills/zhaohuan.prefab.meta new file mode 100644 index 00000000..ddfb6b2d --- /dev/null +++ b/assets/resources/game/skills/zhaohuan.prefab.meta @@ -0,0 +1,13 @@ +{ + "ver": "1.1.50", + "importer": "prefab", + "imported": true, + "uuid": "b211fa96-126c-442c-9a8d-0b9c5a8efec4", + "files": [ + ".json" + ], + "subMetas": {}, + "userData": { + "syncNodeName": "zhaohuan" + } +} diff --git a/assets/script/game/hero/Hero.ts b/assets/script/game/hero/Hero.ts index 444ebf3c..60bd13ee 100644 --- a/assets/script/game/hero/Hero.ts +++ b/assets/script/game/hero/Hero.ts @@ -36,18 +36,9 @@ export class Hero extends ecs.Entity { /** 加载角色 */ load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=1001,is_hero:boolean=true) { - let box_group= 0 - - if (is_hero) { - scale = 1 - box_group=BoxSet.HERO - this.addComponents( HeroModelComp); - }else{ - scale=-1 - box_group=BoxSet.MONSTER - this.addComponents( MonModelComp); - } - + scale = 1 + let box_group=BoxSet.HERO + this.addComponents( HeroModelComp); var path = "game/heros/"+HeroInfo[uuid].path; var prefab: Prefab = oops.res.get(path, Prefab)!; var node = instantiate(prefab); diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index 84459fcb..0d2a03e5 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -170,6 +170,7 @@ export class HeroViewComp extends CCComp { let skill = oCol.node.getComponent(SkillCom)!; // console.log(Date.now()+this.hero_name+":"+this.uuid+' onBeginContact: '+skill.s_name+skill.uuid); if(this.hp <= 0 ) return + if(skill.tg< 3) return this.check_uatk(skill); } } diff --git a/assets/script/game/skills/Skill.ts b/assets/script/game/skills/Skill.ts index 0290cbff..eb01e718 100644 --- a/assets/script/game/skills/Skill.ts +++ b/assets/script/game/skills/Skill.ts @@ -47,8 +47,10 @@ export class Skill extends ecs.Entity { // sv.angle = angle; // console.log(group+" "+SkillSet[uuid].name+"angle:"+angle) sv.s_uuid = uuid; - sv.s_name = SkillSet[uuid].name; + sv.s_name = SkillSet[uuid].name; + sv.hero = SkillSet[uuid].hero; sv.ap = ap*SkillSet[uuid].ap/100; // 技能伤害 + sv.def = ap*SkillSet[uuid].def/100; // 技能伤害 sv.apup = ap*SkillSet[uuid].apup/100; // 伤害增量 sv.hp = hp*SkillSet[uuid].hp/100; // 回复hp增量 sv.mhp = SkillSet[uuid].mhp/100; // hpmax增量 % diff --git a/assets/script/game/skills/SkillCom.ts b/assets/script/game/skills/SkillCom.ts index 2b43ee2a..6248ce6e 100644 --- a/assets/script/game/skills/SkillCom.ts +++ b/assets/script/game/skills/SkillCom.ts @@ -18,9 +18,11 @@ const { ccclass, property } = _decorator; export class SkillCom extends CCComp { s_uuid:number = 0; s_name:string = ""; + hero:number = 0; speed:number = 200; scale:number = 1; ap:number = 10; + def:number = 10; apup:number = 0;// mhp:number = 0; hp:number = 0; //治疗总量 diff --git a/assets/script/game/skills/ZhanCom.ts b/assets/script/game/skills/ZhanCom.ts new file mode 100644 index 00000000..450f221c --- /dev/null +++ b/assets/script/game/skills/ZhanCom.ts @@ -0,0 +1,86 @@ +import { _decorator, Component, instantiate, Node, Prefab } from 'cc'; +import { SkillCom } from './SkillCom'; +import { ecs } from 'db://oops-framework/libs/ecs/ECS'; +import { Hero } from '../hero/Hero'; +import { BoxSet } from '../common/config/BoxSet'; +import { Monster } from '../hero/Mon'; +import { HeroViewComp } from '../hero/HeroViewComp'; +import { smc } from '../common/SingletonModuleComp'; +import { HeroInfo } from '../common/config/heroSet'; +import { oops } from 'db://oops-framework/core/Oops'; +const { ccclass, property } = _decorator; + +@ccclass('ZhanCom') +export class ZhanCom extends Component { + base:SkillCom = null + start() { + this.base =this.node.getComponent(SkillCom) + let pos = this.node.position + let hero:any=null + if(this.base.box_group==BoxSet.HERO) { + hero = ecs.getEntity(Hero); + let scale = 1 + hero.load(pos,scale,this.base.hero); + } + if(this.base.box_group==BoxSet.MONSTER) hero = ecs.getEntity(Monster); + } + + update(deltaTime: number) { + + } + call_hero() { + let scale = 1 + let box_group=BoxSet.HERO + var path = "game/heros/"+HeroInfo[this.base.hero].path; + var prefab: Prefab = oops.res.get(path, Prefab)!; + var node = instantiate(prefab); + var scene = smc.map.MapView.scene; + node.parent = scene.entityLayer!.node! + node.setPosition(this.node.position) + oops.message.dispatchEvent("hero_load",this) + var hv = node.getComponent(HeroViewComp)!; + // console.log("hero_init",buff) + let hero= HeroInfo[this.base.hero] // 共用英雄数据数据 + hv.scale = scale; + hv.box_group = box_group; + hv.hero_uuid= this.base.hero; + hv.hero_name= hero.name; + hv.speed =hv.ospeed = hero.speed; + hv.dis = hero.dis; + hv.pw = hero.pw; + hv.pwm= hero.pwm; + hv.pws= hero.pws + hv.apw=hero.apw; + hv.uapw=hero.uapw; + hv.cpw=hero.cpw; + hv.dpw=hero.dpw; + hv.dopw=hero.dopw; + hv.type = hero.type; + let slv = hv.slv = 1; + hv.sk1 = hero.sk1[slv]; + hv.sk2 = hero.sk2[slv]; + hv.sk3 = hero.sk3[slv]; + hv.akc = hero.akc[slv]; + hv.uac = hero.uac[slv]; + hv.crc = hero.crc[slv]; + hv.dgc = hero.dgc[slv]; + hv.akr = hero.akr[slv]; + hv.uar = hero.uar[slv]; + hv.crr = hero.crr[slv]; + hv.dgr = hero.dgr[slv]; + hv.rhp_max=this.base.hp + hv.ap = this.base.ap + hv.def=this.base.def + hv.cd = hero.a_cd + hv.crit = hero.crit; //暴击率 + hv.crit_add = hero.crit_add;//暴击伤害加成 + hv.dodge = hero.dodge; //闪避率 + hv.aexp=hero.aexp; + hv.uaexp=hero.uaexp; + hv.cexp=hero.cexp + hv.doexp=hero.doexp + hv.dexp=hero.dexp; + } +} + + diff --git a/assets/script/game/skills/ZhanCom.ts.meta b/assets/script/game/skills/ZhanCom.ts.meta new file mode 100644 index 00000000..c1902124 --- /dev/null +++ b/assets/script/game/skills/ZhanCom.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.23", + "importer": "typescript", + "imported": true, + "uuid": "eb0df9e9-d129-4d4b-b5ef-e63d068942e6", + "files": [], + "subMetas": {}, + "userData": {} +}