天赋替换完成
This commit is contained in:
@@ -89820,8 +89820,8 @@
|
|||||||
},
|
},
|
||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": -0.635,
|
"x": -935.629,
|
||||||
"y": 286.977,
|
"y": 311.495,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"_lrot": {
|
"_lrot": {
|
||||||
@@ -90566,8 +90566,6 @@
|
|||||||
"__id__": 0
|
"__id__": 0
|
||||||
},
|
},
|
||||||
"fileId": "76F7i9gP5GG63KTqOpSJQ6",
|
"fileId": "76F7i9gP5GG63KTqOpSJQ6",
|
||||||
"instance": null,
|
|
||||||
"targetOverrides": null,
|
|
||||||
"nestedPrefabInstanceRoots": null
|
"nestedPrefabInstanceRoots": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -48,6 +48,8 @@ export enum GameEvent {
|
|||||||
FuncSelect = "FuncSelect",
|
FuncSelect = "FuncSelect",
|
||||||
TalentSelect = "TalentSelect",
|
TalentSelect = "TalentSelect",
|
||||||
UseTalentCard = "UseTalentCard",
|
UseTalentCard = "UseTalentCard",
|
||||||
|
RemoveTalent = "RemoveTalent",
|
||||||
|
ChangeTalent = "ChangeTalent",
|
||||||
RefreshCard = "RefreshCard",
|
RefreshCard = "RefreshCard",
|
||||||
NewWave = "NewWave",
|
NewWave = "NewWave",
|
||||||
ChangeATK = "ChangeATK",
|
ChangeATK = "ChangeATK",
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ export class HeroConComp extends CCComp {
|
|||||||
this.on(GameEvent.UseSpecialCard,this.use_special_card,this)
|
this.on(GameEvent.UseSpecialCard,this.use_special_card,this)
|
||||||
this.on(GameEvent.UseEnhancement,this.use_enhancement,this)
|
this.on(GameEvent.UseEnhancement,this.use_enhancement,this)
|
||||||
this.on(GameEvent.UseTalentCard,this.use_talent_card,this)
|
this.on(GameEvent.UseTalentCard,this.use_talent_card,this)
|
||||||
|
this.on(GameEvent.RemoveTalent,this.remove_talent_card,this)
|
||||||
|
|
||||||
this.heroView=this.node.getComponent(HeroViewComp)
|
this.heroView=this.node.getComponent(HeroViewComp)
|
||||||
console.log("[HeroConCompComp]:onLoad",this.heroView)
|
console.log("[HeroConCompComp]:onLoad",this.heroView)
|
||||||
@@ -155,12 +156,15 @@ export class HeroConComp extends CCComp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
remove_talent_card(e:GameEvent,data:any){
|
remove_talent_card(e:GameEvent,data:any){
|
||||||
console.log("[HeroConCompComp]:remove_talent_card",data)
|
|
||||||
let tal=TalentList[data.uuid]
|
let tal=TalentList[data.uuid]
|
||||||
|
console.log("[HeroConCompComp]:remove_talent_card",data,tal)
|
||||||
switch(tal.buffType){
|
switch(tal.buffType){
|
||||||
case BuffAttr.ATK:
|
case BuffAttr.ATK:
|
||||||
|
console.log("[HeroConCompComp]:atk",this.heroView.TALENT[BuffAttr.ATK],tal.value)
|
||||||
this.heroView.TALENT[BuffAttr.ATK]-=tal.value
|
this.heroView.TALENT[BuffAttr.ATK]-=tal.value
|
||||||
this.heroView.count_atrr(BuffAttr.ATK)
|
this.heroView.count_atrr(BuffAttr.ATK)
|
||||||
|
console.log("[HeroConCompComp]ed:atk",this.heroView.TALENT[BuffAttr.ATK],tal.value)
|
||||||
break
|
break
|
||||||
case BuffAttr.ATK_CD:
|
case BuffAttr.ATK_CD:
|
||||||
this.heroView.TALENT[BuffAttr.ATK_CD]-=tal.value
|
this.heroView.TALENT[BuffAttr.ATK_CD]-=tal.value
|
||||||
|
|||||||
@@ -305,7 +305,7 @@ export class HeroViewComp extends CCComp {
|
|||||||
check_atrr(buff:BuffAttr){
|
check_atrr(buff:BuffAttr){
|
||||||
switch(buff){
|
switch(buff){
|
||||||
case BuffAttr.ATK:
|
case BuffAttr.ATK:
|
||||||
return Math.floor(this.ap*(100+this.ap+this.TALENT[BuffAttr.ATK])/100)
|
return Math.floor(this.ap_base*(100+this.ap_buff+this.TALENT[BuffAttr.ATK])/100)
|
||||||
case BuffAttr.ATK_CD:
|
case BuffAttr.ATK_CD:
|
||||||
return this.cd_base/((this.cd_buff+this.TALENT[BuffAttr.ATK_CD])/100+1)
|
return this.cd_base/((this.cd_buff+this.TALENT[BuffAttr.ATK_CD])/100+1)
|
||||||
case BuffAttr.HP:
|
case BuffAttr.HP:
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ export class TalsComp extends Component {
|
|||||||
tal5:any=null
|
tal5:any=null
|
||||||
tal6:any=null
|
tal6:any=null
|
||||||
boxs:Node=null
|
boxs:Node=null
|
||||||
|
cur_tal:string=""
|
||||||
// attrs:any={
|
// attrs:any={
|
||||||
// hero_buff:getBuffNum(),
|
// hero_buff:getBuffNum(),
|
||||||
// enemy_buff:getBuffNum(),
|
// enemy_buff:getBuffNum(),
|
||||||
@@ -52,31 +53,49 @@ export class TalsComp extends Component {
|
|||||||
console.log("[TalsComp]:tal_add",data)
|
console.log("[TalsComp]:tal_add",data)
|
||||||
switch(data.slot){
|
switch(data.slot){
|
||||||
case TalentSlot[0]:
|
case TalentSlot[0]:
|
||||||
|
if(this.tal1.uuid!=0) {
|
||||||
|
oops.message.dispatchEvent(GameEvent.RemoveTalent,{uuid:this.tal1.uuid})
|
||||||
|
}
|
||||||
this.tal1.uuid=data.uuid
|
this.tal1.uuid=data.uuid
|
||||||
this.tal1.name=data.name
|
this.tal1.name=data.name
|
||||||
this.show_tal(data.uuid,TalentSlot[0])
|
this.show_tal(data.uuid,TalentSlot[0])
|
||||||
break
|
break
|
||||||
case TalentSlot[1]:
|
case TalentSlot[1]:
|
||||||
|
if(this.tal2.uuid!=0) {
|
||||||
|
oops.message.dispatchEvent(GameEvent.RemoveTalent,{uuid:this.tal2.uuid})
|
||||||
|
}
|
||||||
this.tal2.uuid=data.uuid
|
this.tal2.uuid=data.uuid
|
||||||
this.tal2.name=data.name
|
this.tal2.name=data.name
|
||||||
this.show_tal(data.uuid,TalentSlot[1])
|
this.show_tal(data.uuid,TalentSlot[1])
|
||||||
break
|
break
|
||||||
case TalentSlot[2]:
|
case TalentSlot[2]:
|
||||||
|
if(this.tal3.uuid!=0) {
|
||||||
|
oops.message.dispatchEvent(GameEvent.RemoveTalent,{uuid:this.tal3.uuid})
|
||||||
|
}
|
||||||
this.tal3.uuid=data.uuid
|
this.tal3.uuid=data.uuid
|
||||||
this.tal3.name=data.name
|
this.tal3.name=data.name
|
||||||
this.show_tal(data.uuid,TalentSlot[2])
|
this.show_tal(data.uuid,TalentSlot[2])
|
||||||
break
|
break
|
||||||
case TalentSlot[3]:
|
case TalentSlot[3]:
|
||||||
|
if(this.tal4.uuid!=0) {
|
||||||
|
oops.message.dispatchEvent(GameEvent.RemoveTalent,{uuid:this.tal4.uuid})
|
||||||
|
}
|
||||||
this.tal4.uuid=data.uuid
|
this.tal4.uuid=data.uuid
|
||||||
this.tal4.name=data.name
|
this.tal4.name=data.name
|
||||||
this.show_tal(data.uuid,TalentSlot[3])
|
this.show_tal(data.uuid,TalentSlot[3])
|
||||||
break
|
break
|
||||||
case TalentSlot[4]:
|
case TalentSlot[4]:
|
||||||
|
if(this.tal5.uuid!=0) {
|
||||||
|
oops.message.dispatchEvent(GameEvent.RemoveTalent,{uuid:this.tal5.uuid})
|
||||||
|
}
|
||||||
this.tal5.uuid=data.uuid
|
this.tal5.uuid=data.uuid
|
||||||
this.tal5.name=data.name
|
this.tal5.name=data.name
|
||||||
this.show_tal(data.uuid,TalentSlot[4])
|
this.show_tal(data.uuid,TalentSlot[4])
|
||||||
break
|
break
|
||||||
case TalentSlot[5]:
|
case TalentSlot[5]:
|
||||||
|
if(this.tal6.uuid!=0) {
|
||||||
|
oops.message.dispatchEvent(GameEvent.RemoveTalent,{uuid:this.tal6.uuid})
|
||||||
|
}
|
||||||
this.tal6.uuid=data.uuid
|
this.tal6.uuid=data.uuid
|
||||||
this.tal6.name=data.name
|
this.tal6.name=data.name
|
||||||
this.show_tal(data.uuid,TalentSlot[5])
|
this.show_tal(data.uuid,TalentSlot[5])
|
||||||
@@ -100,11 +119,15 @@ export class TalsComp extends Component {
|
|||||||
}
|
}
|
||||||
to_change_tal(){
|
to_change_tal(){
|
||||||
console.log("[TalsComp]:to_change_tal")
|
console.log("[TalsComp]:to_change_tal")
|
||||||
|
if(this.cur_tal=="") return
|
||||||
|
oops.message.dispatchEvent(GameEvent.TalentSelect,{slot:this.cur_tal})
|
||||||
|
this.close_tal_info()
|
||||||
}
|
}
|
||||||
close_tal_info(){
|
close_tal_info(){
|
||||||
console.log("[TalsComp]:close_tal_info")
|
console.log("[TalsComp]:close_tal_info")
|
||||||
let node= this.node.getChildByName("info")
|
let node= this.node.getChildByName("info")
|
||||||
tween(node).to(0.1,{position:v3(-1000,node.position.y,0)}).start()
|
tween(node).to(0.1,{position:v3(-1000,node.position.y,0)}).start()
|
||||||
|
this.cur_tal=""
|
||||||
}
|
}
|
||||||
show_tal_info(e:any,data:any){
|
show_tal_info(e:any,data:any){
|
||||||
console.log("[TalsComp]:show_tal_info",e,data)
|
console.log("[TalsComp]:show_tal_info",e,data)
|
||||||
@@ -113,26 +136,32 @@ export class TalsComp extends Component {
|
|||||||
case TalentSlot[0]:
|
case TalentSlot[0]:
|
||||||
if(this.tal1.uuid==0) return
|
if(this.tal1.uuid==0) return
|
||||||
uuid=this.tal1.uuid
|
uuid=this.tal1.uuid
|
||||||
|
this.cur_tal=TalentSlot[0]
|
||||||
break
|
break
|
||||||
case TalentSlot[1]:
|
case TalentSlot[1]:
|
||||||
if(this.tal2.uuid==0) return
|
if(this.tal2.uuid==0) return
|
||||||
uuid=this.tal2.uuid
|
uuid=this.tal2.uuid
|
||||||
|
this.cur_tal=TalentSlot[1]
|
||||||
break
|
break
|
||||||
case TalentSlot[2]:
|
case TalentSlot[2]:
|
||||||
if(this.tal3.uuid==0) return
|
if(this.tal3.uuid==0) return
|
||||||
uuid=this.tal3.uuid
|
uuid=this.tal3.uuid
|
||||||
|
this.cur_tal=TalentSlot[2]
|
||||||
break
|
break
|
||||||
case TalentSlot[3]:
|
case TalentSlot[3]:
|
||||||
if(this.tal4.uuid==0) return
|
if(this.tal4.uuid==0) return
|
||||||
uuid=this.tal4.uuid
|
uuid=this.tal4.uuid
|
||||||
|
this.cur_tal=TalentSlot[3]
|
||||||
break
|
break
|
||||||
case TalentSlot[4]:
|
case TalentSlot[4]:
|
||||||
if(this.tal5.uuid==0) return
|
if(this.tal5.uuid==0) return
|
||||||
uuid=this.tal5.uuid
|
uuid=this.tal5.uuid
|
||||||
|
this.cur_tal=TalentSlot[4]
|
||||||
break
|
break
|
||||||
case TalentSlot[5]:
|
case TalentSlot[5]:
|
||||||
if(this.tal6.uuid==0) return
|
if(this.tal6.uuid==0) return
|
||||||
uuid=this.tal6.uuid
|
uuid=this.tal6.uuid
|
||||||
|
this.cur_tal=TalentSlot[5]
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
let node= this.node.getChildByName("info")
|
let node= this.node.getChildByName("info")
|
||||||
|
|||||||
Reference in New Issue
Block a user