召唤师技能完成
This commit is contained in:
@@ -41,10 +41,13 @@
|
||||
},
|
||||
{
|
||||
"__id__": 16
|
||||
},
|
||||
{
|
||||
"__id__": 18
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 18
|
||||
"__id__": 20
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
@@ -324,6 +327,24 @@
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "d9m8Z9r0FAn79RIXwYOlkG"
|
||||
},
|
||||
{
|
||||
"__type__": "eb0dfnp0SlNS7Xv5j0GiULm",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 19
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "1c21gJ3aJD87IqfuwedMbd"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -35,7 +35,7 @@ export class Hero extends ecs.Entity {
|
||||
}
|
||||
|
||||
/** 加载角色 */
|
||||
load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=1001,is_hero:boolean=true) {
|
||||
load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=1001,is_call:boolean=false,lv:number=1) {
|
||||
scale = 1
|
||||
let box_group=BoxSet.HERO
|
||||
this.addComponents<ecs.Comp>( HeroModelComp);
|
||||
@@ -47,16 +47,18 @@ export class Hero extends ecs.Entity {
|
||||
node.parent = scene.entityLayer!.node!
|
||||
|
||||
node.setPosition(pos)
|
||||
this.hero_init(uuid,node,scale,box_group)
|
||||
this.hero_init(uuid,node,scale,box_group,is_call,lv)
|
||||
oops.message.dispatchEvent("hero_load",this)
|
||||
}
|
||||
|
||||
hero_init(uuid:number=1001,node:Node,scale:number=1,box_group=BoxSet.HERO){
|
||||
hero_init(uuid:number=1001,node:Node,scale:number=1,box_group=BoxSet.HERO,is_call:boolean=false,lv:number=1){
|
||||
var hv = node.getComponent(HeroViewComp)!;
|
||||
// console.log("hero_init",buff)
|
||||
let hero= HeroInfo[uuid] // 共用英雄数据
|
||||
let talent= smc.vmdata.talent //角色英雄数据
|
||||
let role =smc.heros[uuid]
|
||||
if(is_call){
|
||||
role={slv:0,lv:lv}
|
||||
}
|
||||
let talents=Talents;
|
||||
hv.scale = scale;
|
||||
hv.box_group = box_group;
|
||||
|
||||
@@ -22,7 +22,7 @@ export class Skill extends ecs.Entity {
|
||||
super.destroy();
|
||||
}
|
||||
load(pos: Vec3 = Vec3.ZERO,group:number,parent:Node,uuid:number=1001,
|
||||
ap:number =10,t_pos:Vec3 = null,is_crit:boolean=false,crit_add:number=0,hp:number=0)
|
||||
ap:number =10,t_pos:Vec3 = null,is_crit:boolean=false,crit_add:number=0,hp:number=0,lv:number=1)
|
||||
{
|
||||
var path = "game/skills/"+SkillSet[uuid].sp_name;
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
@@ -49,6 +49,7 @@ export class Skill extends ecs.Entity {
|
||||
sv.s_uuid = uuid;
|
||||
sv.s_name = SkillSet[uuid].name;
|
||||
sv.hero = SkillSet[uuid].hero;
|
||||
sv.lv=lv
|
||||
sv.ap = ap*SkillSet[uuid].ap/100; // 技能伤害
|
||||
sv.def = ap*SkillSet[uuid].def/100; // 技能伤害
|
||||
sv.apup = ap*SkillSet[uuid].apup/100; // 伤害增量
|
||||
|
||||
@@ -21,6 +21,7 @@ export class SkillCom extends CCComp {
|
||||
hero:number = 0;
|
||||
speed:number = 200;
|
||||
scale:number = 1;
|
||||
lv:number = 1;
|
||||
ap:number = 10;
|
||||
def:number = 10;
|
||||
apup:number = 0;//
|
||||
|
||||
@@ -14,73 +14,29 @@ const { ccclass, property } = _decorator;
|
||||
export class ZhanCom extends Component {
|
||||
base:SkillCom = null
|
||||
start() {
|
||||
console.log("ZhanCom:",this.base)
|
||||
this.base =this.node.getComponent(SkillCom)
|
||||
let pos = this.node.position
|
||||
let hero:any=null
|
||||
var path = "game/skills/dead";
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
node.parent = this.node.parent;
|
||||
node.setPosition(pos);
|
||||
if(this.base.box_group==BoxSet.HERO) {
|
||||
hero = ecs.getEntity<Hero>(Hero);
|
||||
let scale = 1
|
||||
hero.load(pos,scale,this.base.hero);
|
||||
hero.load(pos,scale,this.base.hero,true,this.base.lv);
|
||||
}
|
||||
if(this.base.box_group==BoxSet.MONSTER) {
|
||||
hero = ecs.getEntity<Monster>(Monster);
|
||||
}
|
||||
if(this.base.box_group==BoxSet.MONSTER) hero = ecs.getEntity<Monster>(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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user