Compare commits
2 Commits
2413e4d1cc
...
5220f5e075
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5220f5e075 | ||
|
|
750e86e858 |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 842 KiB After Width: | Height: | Size: 2.0 MiB |
@@ -44,27 +44,27 @@ export const TalentConfig = {
|
|||||||
|
|
||||||
// 所有天赋定义(使用数组维护)
|
// 所有天赋定义(使用数组维护)
|
||||||
talents: [
|
talents: [
|
||||||
{ id: TalentType.Attack, name: "攻击", icon: "1006", desc: "+{value}%",
|
{ id: TalentType.Attack, name: "攻击", icon: "3109", desc: "+{value}%",
|
||||||
maxLevel: 5, values: [3, 6, 9, 12, 15], costs: [1, 1, 2, 2, 3] },
|
maxLevel: 5, values: [3, 6, 9, 12, 15], costs: [1, 1, 2, 2, 3] },
|
||||||
{ id: TalentType.Hp, name: "生命", icon: "1006", desc: "+{value}%",
|
{ id: TalentType.Hp, name: "生命", icon: "3056", desc: "+{value}%",
|
||||||
maxLevel: 5, values: [5, 10, 15, 20, 25], costs: [1, 1, 2, 2, 3] },
|
maxLevel: 5, values: [5, 10, 15, 20, 25], costs: [1, 1, 2, 2, 3] },
|
||||||
{ id: TalentType.Critical, name: "暴击率", icon: "1006", desc: "+{value}%",
|
{ id: TalentType.Critical, name: "暴击率", icon: "3063", desc: "+{value}%",
|
||||||
maxLevel: 5, values: [2, 4, 6, 8, 10], costs: [1, 1, 2, 2, 3] },
|
maxLevel: 5, values: [2, 4, 6, 8, 10], costs: [1, 1, 2, 2, 3] },
|
||||||
{ id: TalentType.WindFury, name: "风怒率", icon: "1006", desc: "+{value}%",
|
{ id: TalentType.WindFury, name: "风怒率", icon: "3138", desc: "+{value}%",
|
||||||
maxLevel: 5, values: [2, 4, 6, 8, 10], costs: [1, 1, 2, 2, 3] },
|
maxLevel: 5, values: [2, 4, 6, 8, 10], costs: [1, 1, 2, 2, 3] },
|
||||||
{ id: TalentType.Freeze, name: "冰冻率", icon: "1006", desc: "+{value}%",
|
{ id: TalentType.Freeze, name: "冰冻率", icon: "3136", desc: "+{value}%",
|
||||||
maxLevel: 5, values: [2, 4, 6, 8, 10], costs: [1, 1, 2, 2, 3] },
|
maxLevel: 5, values: [2, 4, 6, 8, 10], costs: [1, 1, 2, 2, 3] },
|
||||||
{ id: TalentType.Puncture, name: "穿刺", icon: "1006", desc: "+{value}",
|
{ id: TalentType.Puncture, name: "穿刺", icon: "3105", desc: "+{value}",
|
||||||
maxLevel: 5, values: [0.2, 0.4, 0.6, 0.8, 1.0], costs: [1, 1, 2, 2, 3] },
|
maxLevel: 5, values: [0.2, 0.4, 0.6, 0.8, 1.0], costs: [1, 1, 2, 2, 3] },
|
||||||
{ id: TalentType.DeadTrigger, name: "亡语额外触发", icon: "1006", desc: "+{value}次",
|
{ id: TalentType.DeadTrigger, name: "亡语触发", icon: "3062", desc: "+{value}次",
|
||||||
maxLevel: 1, values: [1], costs: [25] },
|
maxLevel: 1, values: [1], costs: [25] },
|
||||||
{ id: TalentType.Summon, name: "召唤额外触发", icon: "1006", desc: "+{value}次",
|
{ id: TalentType.Summon, name: "召唤触发", icon: "3054", desc: "+{value}次",
|
||||||
maxLevel: 1, values: [1], costs: [25] },
|
maxLevel: 1, values: [1], costs: [25] },
|
||||||
{ id: TalentType.BuyDiscount, name: "购买优惠", icon: "1006", desc: "-{value}金币",
|
{ id: TalentType.BuyDiscount, name: "购买优惠", icon: "3020", desc: "-{value}金币",
|
||||||
maxLevel: 1, values: [1], costs: [10] },
|
maxLevel: 1, values: [1], costs: [10] },
|
||||||
{ id: TalentType.RefreshDiscount, name: "刷新优惠", icon: "1006", desc: "-{value}金币",
|
{ id: TalentType.RefreshDiscount, name: "刷新优惠", icon: "3019", desc: "-{value}金币",
|
||||||
maxLevel: 1, values: [1], costs: [10] },
|
maxLevel: 1, values: [1], costs: [10] },
|
||||||
{ id: TalentType.SellBonus, name: "出售返还", icon: "1006", desc: "+{value}金币",
|
{ id: TalentType.SellBonus, name: "出售返还", icon: "3151", desc: "+{value}金币",
|
||||||
maxLevel: 1, values: [1], costs: [10] }
|
maxLevel: 1, values: [1], costs: [10] }
|
||||||
] as TalentInfo[]
|
] as TalentInfo[]
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import { SkillSet } from "../common/config/SkillSet";
|
|||||||
import { GameEvent } from "../common/config/GameEvent";
|
import { GameEvent } from "../common/config/GameEvent";
|
||||||
import { oops } from "db://oops-framework/core/Oops";
|
import { oops } from "db://oops-framework/core/Oops";
|
||||||
import { smc } from "../common/SingletonModuleComp";
|
import { smc } from "../common/SingletonModuleComp";
|
||||||
|
|
||||||
import { UIID } from "../common/config/GameUIConfig";
|
import { UIID } from "../common/config/GameUIConfig";
|
||||||
import { HeroAttrsComp } from "../hero/HeroAttrsComp";
|
import { HeroAttrsComp } from "../hero/HeroAttrsComp";
|
||||||
import { TalentType } from "../common/config/TalentSet";
|
import { TalentType } from "../common/config/TalentSet";
|
||||||
@@ -102,8 +103,6 @@ export class CardComp extends CCComp {
|
|||||||
card_uuid:number=0
|
card_uuid:number=0
|
||||||
/** 是否处于锁定状态(锁定且有卡时,抽卡分发会被跳过) */
|
/** 是否处于锁定状态(锁定且有卡时,抽卡分发会被跳过) */
|
||||||
private isLocked: boolean = false;
|
private isLocked: boolean = false;
|
||||||
/** 图标图集缓存(首次加载后复用,避免重复 IO) */
|
|
||||||
private uiconsAtlas: SpriteAtlas | null = null;
|
|
||||||
/** 当前槽位承载的卡牌数据,null 表示空槽 */
|
/** 当前槽位承载的卡牌数据,null 表示空槽 */
|
||||||
private cardData: CardConfig | null = null;
|
private cardData: CardConfig | null = null;
|
||||||
/** 上划使用阈值(像素):拖拽距离 >= 此值视为"使用卡牌" */
|
/** 上划使用阈值(像素):拖拽距离 >= 此值视为"使用卡牌" */
|
||||||
@@ -194,7 +193,7 @@ export class CardComp extends CCComp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新卡牌图标:先尝试从缓存图集获取,未缓存则异步加载图集后获取。
|
* 更新卡牌图标:从全局缓存图集中获取对应帧
|
||||||
* @param node 图标所在节点
|
* @param node 图标所在节点
|
||||||
* @param iconId 图标在 SpriteAtlas 中的帧名称
|
* @param iconId 图标在 SpriteAtlas 中的帧名称
|
||||||
*/
|
*/
|
||||||
@@ -202,30 +201,11 @@ export class CardComp extends CCComp {
|
|||||||
if (!node || !iconId) return;
|
if (!node || !iconId) return;
|
||||||
const sprite = node.getComponent(Sprite) || node.getComponentInChildren(Sprite);
|
const sprite = node.getComponent(Sprite) || node.getComponentInChildren(Sprite);
|
||||||
if (!sprite) return;
|
if (!sprite) return;
|
||||||
// 已缓存图集 → 直接获取帧
|
// 已全局缓存图集 → 直接获取帧
|
||||||
if (this.uiconsAtlas) {
|
if (smc.uiconsAtlas) {
|
||||||
const frame = this.uiconsAtlas.getSpriteFrame(iconId);
|
const frame = smc.uiconsAtlas.getSpriteFrame(iconId);
|
||||||
if (frame) {
|
sprite.spriteFrame = frame || null;
|
||||||
sprite.spriteFrame = frame;
|
|
||||||
} else {
|
|
||||||
sprite.spriteFrame = null;
|
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 首次加载图集
|
|
||||||
resources.load("gui/uicons", SpriteAtlas, (err, atlas) => {
|
|
||||||
if (err || !atlas) {
|
|
||||||
mLogger.log(this.debugMode, "CardComp", "load uicons atlas failed", err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.uiconsAtlas = atlas;
|
|
||||||
const frame = atlas.getSpriteFrame(iconId);
|
|
||||||
if (frame) {
|
|
||||||
sprite.spriteFrame = frame;
|
|
||||||
} else {
|
|
||||||
sprite.spriteFrame = null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -121,8 +121,6 @@ export class MissionCardComp extends CCComp {
|
|||||||
/** 当前是否为战斗阶段 */
|
/** 当前是否为战斗阶段 */
|
||||||
private isBattlePhase: boolean = false;
|
private isBattlePhase: boolean = false;
|
||||||
|
|
||||||
/** 预留图集缓存(后续接入按钮/卡面图标时复用) */
|
|
||||||
private uiconsAtlas: SpriteAtlas | null = null;
|
|
||||||
/** 四个槽位对应的 CardComp 控制器缓存(有序数组) */
|
/** 四个槽位对应的 CardComp 控制器缓存(有序数组) */
|
||||||
private cardComps: CardComp[] = [];
|
private cardComps: CardComp[] = [];
|
||||||
/** 当前卡池等级(仅影响抽卡来源,不直接改卡槽现有内容) */
|
/** 当前卡池等级(仅影响抽卡来源,不直接改卡槽现有内容) */
|
||||||
|
|||||||
@@ -151,14 +151,13 @@ export class SkillBoxComp extends CCComp {
|
|||||||
// 加载技能图标
|
// 加载技能图标
|
||||||
if (this.icon_node) {
|
if (this.icon_node) {
|
||||||
const iconId = SkillSet[this.s_uuid]?.icon || `${this.s_uuid}`;
|
const iconId = SkillSet[this.s_uuid]?.icon || `${this.s_uuid}`;
|
||||||
resources.load("gui/uicons", SpriteAtlas, (err, atlas) => {
|
if (smc.uiconsAtlas) {
|
||||||
if (err || !atlas) return;
|
const frame = smc.uiconsAtlas.getSpriteFrame(iconId);
|
||||||
const frame = atlas.getSpriteFrame(iconId);
|
|
||||||
if (frame && this.icon_node && this.icon_node.isValid) {
|
if (frame && this.icon_node && this.icon_node.isValid) {
|
||||||
const sprite = this.icon_node.getComponent(Sprite) || this.icon_node.addComponent(Sprite);
|
let sprite = this.icon_node.getComponent(Sprite) || this.icon_node.addComponent(Sprite);
|
||||||
sprite.spriteFrame = frame;
|
sprite.spriteFrame = frame;
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新剩余次数标签
|
// 更新剩余次数标签
|
||||||
|
|||||||
Reference in New Issue
Block a user