接下来测试强化

This commit is contained in:
2025-07-15 23:22:52 +08:00
parent 1780509509
commit 6f2af2f395
5 changed files with 44 additions and 3 deletions

View File

@@ -5,6 +5,7 @@
import { getHeroList, HeroList } from "./heroSet" import { getHeroList, HeroList } from "./heroSet"
import { getSkills, HeroSkillList, SkillSet } from "./SkillSet" import { getSkills, HeroSkillList, SkillSet } from "./SkillSet"
import { equip_list, weapons, armors, accessorys, getEquipUUIDsByTypeAndLevel } from "./Equips" import { equip_list, weapons, armors, accessorys, getEquipUUIDsByTypeAndLevel } from "./Equips"
import { getEnhancement } from "./LevelUp"
//1:伙伴 2:技能 3:装备的出现概率配置 //1:伙伴 2:技能 3:装备的出现概率配置
export const CardProbability={ export const CardProbability={
@@ -17,6 +18,7 @@ export const cardType={
SKILL:2, SKILL:2,
EQUIP:3, EQUIP:3,
SPECIAL:4, SPECIAL:4,
ENHANCEMENT:5,
} }
// 获取随机卡牌UUID // 获取随机卡牌UUID
export function getRandomCardUUID( export function getRandomCardUUID(
@@ -65,6 +67,7 @@ export function getRandomCardUUID(
case cardType.SPECIAL: // 功能卡牌 case cardType.SPECIAL: // 功能卡牌
cardList = SuperCardsList; cardList = SuperCardsList;
break; break;
} }
// 从对应类型的卡牌列表中随机选择一个 // 从对应类型的卡牌列表中随机选择一个

View File

@@ -30,7 +30,8 @@ export enum GameEvent {
HeroSkillSelect = "HeroSkillSelect", HeroSkillSelect = "HeroSkillSelect",
HeroSkillSelectEnd = "HeroSkillSelectEnd", HeroSkillSelectEnd = "HeroSkillSelectEnd",
HeroSelect = "HeroSelect", HeroSelect = "HeroSelect",
EnhancementSelect = "EnhancementSelect",
UseEnhancement = "UseEnhancement",
MasterCalled = "MasterCalled", MasterCalled = "MasterCalled",
FightStart = "FightStart", FightStart = "FightStart",
FightPause = "FightPause", FightPause = "FightPause",

View File

@@ -119,6 +119,7 @@ export class HeroViewComp extends CCComp {
this.on(GameEvent.ChangeATK_EQUIP_SPECIAL_ATTR,this.change_atk,this) this.on(GameEvent.ChangeATK_EQUIP_SPECIAL_ATTR,this.change_atk,this)
this.on(GameEvent.UpdateHP,this.update_hp,this) this.on(GameEvent.UpdateHP,this.update_hp,this)
this.on(GameEvent.EXPUP,this.exp_up,this) this.on(GameEvent.EXPUP,this.exp_up,this)
this.on(GameEvent.UseEnhancement,this.use_enhancement,this)
// let anm = this.node.getChildByName("anm") // let anm = this.node.getChildByName("anm")
// anm.setScale(anm.scale.x*0.8,anm.scale.y*0.8); // anm.setScale(anm.scale.x*0.8,anm.scale.y*0.8);
} }
@@ -156,7 +157,10 @@ export class HeroViewComp extends CCComp {
// 处理伤害队列 // 处理伤害队列
this.processDamageQueue(); this.processDamageQueue();
} }
use_enhancement(e:GameEvent,data:any){
console.log("[HeroViewComp]:use_enhancement",data)
}
change_atk(e:GameEvent,data:any){ change_atk(e:GameEvent,data:any){
if(!this.is_master) return if(!this.is_master) return

View File

@@ -12,6 +12,7 @@ import { HeroSkillList, SkillSet } from "../common/config/SkillSet";
import { cardType, getRandomCardUUID, Quality, SuperCards } from "../common/config/CardSet"; import { cardType, getRandomCardUUID, Quality, SuperCards } from "../common/config/CardSet";
import { EquipInfo, EquipType } from "../common/config/Equips"; import { EquipInfo, EquipType } from "../common/config/Equips";
import { FightSet } from "../common/config/Mission"; import { FightSet } from "../common/config/Mission";
import { EnhancementOptions } from "../common/config/LevelUp";
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
@@ -26,6 +27,7 @@ export class CardComp extends CCComp {
skill_slot:string="skill1" skill_slot:string="skill1"
equip_slot:string="weapon" equip_slot:string="weapon"
is_master:boolean=false; is_master:boolean=false;
enhancement_data:any=null;
onLoad(){ onLoad(){
// this.on(GameEvent.HeroSelect,this.hero_select,this) // this.on(GameEvent.HeroSelect,this.hero_select,this)
} }
@@ -88,6 +90,13 @@ export class CardComp extends CCComp {
this.node.getChildByName("Button").active=true this.node.getChildByName("Button").active=true
}, 0.1); }, 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(){ random_select(){
let card =getRandomCardUUID() //随机获取卡牌类型 let card =getRandomCardUUID() //随机获取卡牌类型
@@ -163,6 +172,12 @@ export class CardComp extends CCComp {
show.getChildByName("info").getComponent(Label).string=SuperCards[uuid].info 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){ do_card_bg_show(q:number=Quality.WHITE){
this.node.getChildByName("Button").getChildByName("Label").getComponent(Label).string=this.check_heros() this.node.getChildByName("Button").getChildByName("Label").getComponent(Label).string=this.check_heros()
let show=this.node.getChildByName("show") 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.UseSpecialCard,{uuid:this.c_uuid})
oops.message.dispatchEvent(GameEvent.CardsClose) oops.message.dispatchEvent(GameEvent.CardsClose)
break 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() this.reset_card()
} }

View File

@@ -8,6 +8,7 @@ import { smc } from "../common/SingletonModuleComp";
import { RandomManager } from "db://oops-framework/core/common/random/RandomManager"; import { RandomManager } from "db://oops-framework/core/common/random/RandomManager";
import { EquipType } from "../common/config/Equips"; import { EquipType } from "../common/config/Equips";
import { getSkills, Quality } from "../common/config/SkillSet"; import { getSkills, Quality } from "../common/config/SkillSet";
import { getEnhancement } from "../common/config/LevelUp";
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
@@ -84,12 +85,24 @@ export class CardsCompComp extends CCComp {
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string="选择装备" this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string="选择装备"
this.equip_select(data) this.equip_select(data)
break break
case GameEvent.EnhancementSelect:
console.log("[CardsComp]:显示强化选择卡牌")
this.node.getChildByName("btns").getChildByName("cancel").active=true
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string="选择强化"
this.enhancement_select(data)
break
} }
if(!is_refresh) this.show() if(!is_refresh) this.show()
} }
enhancement_select(data:any){
let list=getEnhancement([0,0,0,0],3)
console.log("[CardsComp]:强化选择卡牌列表",list)
this.card1c.enhancement_select(data[0])
this.card2c.enhancement_select(data[1])
this.card3c.enhancement_select(data[2])
}
hero_select(data:any){ hero_select(data:any){
let list=[] let list=[]
if(data.is_master){ //1是主将,0 是伙伴 if(data.is_master){ //1是主将,0 是伙伴