开箱 随机buff 初步完成
This commit is contained in:
@@ -12,6 +12,8 @@ import { defaultEnhancements, EnhancementOptions } from "../common/config/LevelU
|
||||
import { MonModelComp } from "../hero/MonModelComp";
|
||||
import { TalentSlot } from "../common/config/TalentSet";
|
||||
import { RogueTalWave } from "./RogueConfig";
|
||||
import { cardType, getRandomCardsByType, SuperCards, SuperCardsList, SuperCardsType } from "../common/config/CardSet";
|
||||
import { LuckCardComp } from "./LuckCardComp";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
|
||||
@@ -293,17 +295,30 @@ export class MissionComp extends CCComp {
|
||||
}
|
||||
|
||||
call_func_card(){
|
||||
this.show_lucky_gold()
|
||||
if(smc.vmdata.mission_data.gold < smc.vmdata.mission_data.lucky_gold){
|
||||
oops.gui.toast("金币不足", false);
|
||||
return
|
||||
}
|
||||
this.do_lucky_card()
|
||||
|
||||
}
|
||||
show_lucky_gold(){
|
||||
do_lucky_card(){
|
||||
smc.vmdata.mission_data.gold-=smc.vmdata.mission_data.lucky_gold
|
||||
let list=getRandomCardsByType(cardType.SPECIAL,1)
|
||||
let card=SuperCards[list[0].uuid]
|
||||
console.log("[MissionComp] do_lucky_card",card)
|
||||
this.show_lucky_gold(card)
|
||||
oops.message.dispatchEvent(GameEvent.LuckCardUsed,card)
|
||||
}
|
||||
show_lucky_gold(card:any){
|
||||
var path = "game/gui/lcard";
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
node.setScale(0,0,0)
|
||||
node.getComponent(LuckCardComp).show_card(card)
|
||||
node.parent = this.node
|
||||
node.setPosition(v3(this.node.getChildByName("luckybox").position.x,this.node.getChildByName("luckybox").position.y));
|
||||
let height=this.node.getComponent(UITransform).height
|
||||
let height=this.node.getComponent(UITransform).height
|
||||
tween(node) .to(0.5, {
|
||||
scale: v3(1,1,1),
|
||||
position: v3(0, height-300),
|
||||
|
||||
Reference in New Issue
Block a user