接下来测试强化
This commit is contained in:
@@ -12,6 +12,7 @@ import { HeroSkillList, SkillSet } from "../common/config/SkillSet";
|
||||
import { cardType, getRandomCardUUID, Quality, SuperCards } from "../common/config/CardSet";
|
||||
import { EquipInfo, EquipType } from "../common/config/Equips";
|
||||
import { FightSet } from "../common/config/Mission";
|
||||
import { EnhancementOptions } from "../common/config/LevelUp";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -26,6 +27,7 @@ export class CardComp extends CCComp {
|
||||
skill_slot:string="skill1"
|
||||
equip_slot:string="weapon"
|
||||
is_master:boolean=false;
|
||||
enhancement_data:any=null;
|
||||
onLoad(){
|
||||
// this.on(GameEvent.HeroSelect,this.hero_select,this)
|
||||
}
|
||||
@@ -88,6 +90,13 @@ export class CardComp extends CCComp {
|
||||
this.node.getChildByName("Button").active=true
|
||||
}, 0.1);
|
||||
}
|
||||
enhancement_select(args: any){
|
||||
this.c_type=cardType.ENHANCEMENT
|
||||
this.enhancement_data=args
|
||||
this.node.getChildByName("show").active=false
|
||||
this.node.getChildByName("anim").getChildByName("up").getComponent(Animation).play('carsup')
|
||||
this.show_enhancement(args)
|
||||
}
|
||||
|
||||
random_select(){
|
||||
let card =getRandomCardUUID() //随机获取卡牌类型
|
||||
@@ -163,6 +172,12 @@ export class CardComp extends CCComp {
|
||||
show.getChildByName("info").getComponent(Label).string=SuperCards[uuid].info
|
||||
}
|
||||
|
||||
show_enhancement(data:any){
|
||||
let show=this.node.getChildByName("show")
|
||||
show.getChildByName("name").getChildByName("name").getComponent(Label).string=data.name
|
||||
this.do_card_bg_show(data.rarity)
|
||||
}
|
||||
|
||||
do_card_bg_show(q:number=Quality.WHITE){
|
||||
this.node.getChildByName("Button").getChildByName("Label").getComponent(Label).string=this.check_heros()
|
||||
let show=this.node.getChildByName("show")
|
||||
@@ -298,6 +313,11 @@ export class CardComp extends CCComp {
|
||||
oops.message.dispatchEvent(GameEvent.UseSpecialCard,{uuid:this.c_uuid})
|
||||
oops.message.dispatchEvent(GameEvent.CardsClose)
|
||||
break
|
||||
case cardType.ENHANCEMENT:
|
||||
console.log("[cardcomp]:use_card 强化卡")
|
||||
oops.message.dispatchEvent(GameEvent.UseEnhancement,this.enhancement_data)
|
||||
oops.message.dispatchEvent(GameEvent.CardsClose)
|
||||
break
|
||||
}
|
||||
this.reset_card()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user