去掉大部分 调试信息
This commit is contained in:
@@ -18,8 +18,8 @@ export class Main extends Root {
|
|||||||
// if(this.isWxClient()){
|
// if(this.isWxClient()){
|
||||||
// WxCloudApi.init("cloud1-6gknw0qk911036d8")
|
// WxCloudApi.init("cloud1-6gknw0qk911036d8")
|
||||||
// }
|
// }
|
||||||
PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb |
|
// PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb |
|
||||||
EPhysics2DDrawFlags.Pair
|
// EPhysics2DDrawFlags.Pair
|
||||||
// EPhysics2DDrawFlags.CenterOfMass |
|
// EPhysics2DDrawFlags.CenterOfMass |
|
||||||
// EPhysics2DDrawFlags.Joint |
|
// EPhysics2DDrawFlags.Joint |
|
||||||
// EPhysics2DDrawFlags.Shape;
|
// EPhysics2DDrawFlags.Shape;
|
||||||
|
|||||||
@@ -27,48 +27,48 @@ export class GameDataSyncManager {
|
|||||||
*/
|
*/
|
||||||
async overrideLocalDataWithRemote(remoteData: UserGameData, dataSource: string) {
|
async overrideLocalDataWithRemote(remoteData: UserGameData, dataSource: string) {
|
||||||
try {
|
try {
|
||||||
console.log(`[Initialize]: 开始用${dataSource}数据覆盖客户端数据...`);
|
// console.log(`[Initialize]: 开始用${dataSource}数据覆盖客户端数据...`);
|
||||||
|
|
||||||
// 直接覆盖基础游戏数据
|
// 直接覆盖基础游戏数据
|
||||||
if (remoteData.data) {
|
if (remoteData.data) {
|
||||||
Object.assign(smc.data, remoteData.data);
|
Object.assign(smc.data, remoteData.data);
|
||||||
console.log(`[Initialize]: 基础游戏数据已从${dataSource}覆盖`);
|
// console.log(`[Initialize]: 基础游戏数据已从${dataSource}覆盖`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 直接覆盖出战英雄配置
|
// 直接覆盖出战英雄配置
|
||||||
if (remoteData.fight_heros) {
|
if (remoteData.fight_heros) {
|
||||||
Object.assign(smc.fight_heros, remoteData.fight_heros);
|
Object.assign(smc.fight_heros, remoteData.fight_heros);
|
||||||
console.log(`[Initialize]: 出战英雄配置已从${dataSource}覆盖`);
|
// console.log(`[Initialize]: 出战英雄配置已从${dataSource}覆盖`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 直接覆盖英雄数据
|
// 直接覆盖英雄数据
|
||||||
if (remoteData.heros) {
|
if (remoteData.heros) {
|
||||||
smc.heros = { ...remoteData.heros };
|
smc.heros = { ...remoteData.heros };
|
||||||
console.log(`[Initialize]: 英雄数据已从${dataSource}覆盖`);
|
// console.log(`[Initialize]: 英雄数据已从${dataSource}覆盖`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 直接覆盖道具数据
|
// 直接覆盖道具数据
|
||||||
if (remoteData.items) {
|
if (remoteData.items) {
|
||||||
Object.assign(smc.items, remoteData.items);
|
Object.assign(smc.items, remoteData.items);
|
||||||
console.log(`[Initialize]: 道具数据已从${dataSource}覆盖`);
|
// console.log(`[Initialize]: 道具数据已从${dataSource}覆盖`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 直接覆盖天赋数据
|
// 直接覆盖天赋数据
|
||||||
if (remoteData.tals) {
|
if (remoteData.tals) {
|
||||||
Object.assign(smc.tals, remoteData.tals);
|
Object.assign(smc.tals, remoteData.tals);
|
||||||
console.log(`[Initialize]: 天赋数据已从${dataSource}覆盖`);
|
// console.log(`[Initialize]: 天赋数据已从${dataSource}覆盖`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 直接覆盖装备数据
|
// 直接覆盖装备数据
|
||||||
if (remoteData.equips) {
|
if (remoteData.equips) {
|
||||||
Object.assign(smc.equips, remoteData.equips);
|
Object.assign(smc.equips, remoteData.equips);
|
||||||
console.log(`[Initialize]: 装备数据已从${dataSource}覆盖`);
|
// console.log(`[Initialize]: 装备数据已从${dataSource}覆盖`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 保存到本地存储(确保数据持久化)
|
// 保存到本地存储(确保数据持久化)
|
||||||
// smc.saveGameData();
|
// smc.saveGameData();
|
||||||
|
|
||||||
console.log(`[Initialize]: ${dataSource}数据覆盖完成,已保存到本地`);
|
// console.log(`[Initialize]: ${dataSource}数据覆盖完成,已保存到本地`);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`[Initialize]: ${dataSource}数据覆盖失败:`, error);
|
console.error(`[Initialize]: ${dataSource}数据覆盖失败:`, error);
|
||||||
@@ -81,14 +81,14 @@ export class GameDataSyncManager {
|
|||||||
*/
|
*/
|
||||||
async updateFightHeros(fightHeros: any): Promise<boolean> {
|
async updateFightHeros(fightHeros: any): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
console.log(`[GameDataSyncManager]: 批量更新出战英雄配置:`, fightHeros);
|
// console.log(`[GameDataSyncManager]: 批量更新出战英雄配置:`, fightHeros);
|
||||||
|
|
||||||
const result = await WxCloudApi.updateFightHeros(fightHeros);
|
const result = await WxCloudApi.updateFightHeros(fightHeros);
|
||||||
|
|
||||||
if (result.result.code === 200) {
|
if (result.result.code === 200) {
|
||||||
// 远程修改成功,同步本地数据
|
// 远程修改成功,同步本地数据
|
||||||
Object.assign(smc.fight_heros, fightHeros);
|
Object.assign(smc.fight_heros, fightHeros);
|
||||||
console.log(`[GameDataSyncManager]: 出战英雄配置更新成功,本地数据已同步`);
|
// console.log(`[GameDataSyncManager]: 出战英雄配置更新成功,本地数据已同步`);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
console.warn(`[GameDataSyncManager]: 出战英雄配置更新失败: ${result.result.msg}`);
|
console.warn(`[GameDataSyncManager]: 出战英雄配置更新失败: ${result.result.msg}`);
|
||||||
@@ -108,14 +108,14 @@ export class GameDataSyncManager {
|
|||||||
*/
|
*/
|
||||||
async resetFightHeros(): Promise<boolean> {
|
async resetFightHeros(): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
console.log(`[GameDataSyncManager]: 重置出战英雄配置`);
|
// console.log(`[GameDataSyncManager]: 重置出战英雄配置`);
|
||||||
|
|
||||||
const result = await WxCloudApi.resetFightHeros();
|
const result = await WxCloudApi.resetFightHeros();
|
||||||
|
|
||||||
if (result.result.code === 200) {
|
if (result.result.code === 200) {
|
||||||
// 远程修改成功,同步本地数据
|
// 远程修改成功,同步本地数据
|
||||||
smc.fight_heros = result.result.data;
|
smc.fight_heros = result.result.data;
|
||||||
console.log(`[GameDataSyncManager]: 出战英雄配置重置成功,本地数据已同步`);
|
// console.log(`[GameDataSyncManager]: 出战英雄配置重置成功,本地数据已同步`);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
console.warn(`[GameDataSyncManager]: 出战英雄配置重置失败: ${result.result.msg}`);
|
console.warn(`[GameDataSyncManager]: 出战英雄配置重置失败: ${result.result.msg}`);
|
||||||
@@ -138,14 +138,14 @@ export class GameDataSyncManager {
|
|||||||
*/
|
*/
|
||||||
async addHero(heroId: number, heroData?: any): Promise<boolean> {
|
async addHero(heroId: number, heroData?: any): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
console.log(`[GameDataSyncManager]: 添加英雄 ID:${heroId}, 数据:`, heroData);
|
// console.log(`[GameDataSyncManager]: 添加英雄 ID:${heroId}, 数据:`, heroData);
|
||||||
|
|
||||||
const result = await WxCloudApi.addHero(heroId, heroData);
|
const result = await WxCloudApi.addHero(heroId, heroData);
|
||||||
|
|
||||||
if (result.result.code === 200) {
|
if (result.result.code === 200) {
|
||||||
// 远程修改成功,同步本地数据
|
// 远程修改成功,同步本地数据
|
||||||
smc.heros[heroId] = result.result.data;
|
smc.heros[heroId] = result.result.data;
|
||||||
console.log(`[GameDataSyncManager]: 英雄添加成功,本地数据已同步`);
|
// console.log(`[GameDataSyncManager]: 英雄添加成功,本地数据已同步`);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
console.warn(`[GameDataSyncManager]: 英雄添加失败: ${result.result.msg}`);
|
console.warn(`[GameDataSyncManager]: 英雄添加失败: ${result.result.msg}`);
|
||||||
@@ -166,14 +166,14 @@ export class GameDataSyncManager {
|
|||||||
*/
|
*/
|
||||||
async updateHero(heroId: number, updateData: any): Promise<boolean> {
|
async updateHero(heroId: number, updateData: any): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
console.log(`[GameDataSyncManager]: 更新英雄 ID:${heroId}, 更新数据:`, updateData);
|
// console.log(`[GameDataSyncManager]: 更新英雄 ID:${heroId}, 更新数据:`, updateData);
|
||||||
|
|
||||||
const result = await WxCloudApi.updateHero(heroId, updateData);
|
const result = await WxCloudApi.updateHero(heroId, updateData);
|
||||||
|
|
||||||
if (result.result.code === 200) {
|
if (result.result.code === 200) {
|
||||||
// 远程修改成功,同步本地数据
|
// 远程修改成功,同步本地数据
|
||||||
Object.assign(smc.heros[heroId], result.result.data.new_data);
|
Object.assign(smc.heros[heroId], result.result.data.new_data);
|
||||||
console.log(`[GameDataSyncManager]: 英雄更新成功,本地数据已同步`);
|
// console.log(`[GameDataSyncManager]: 英雄更新成功,本地数据已同步`);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
console.warn(`[GameDataSyncManager]: 英雄更新失败: ${result.result.msg}`);
|
console.warn(`[GameDataSyncManager]: 英雄更新失败: ${result.result.msg}`);
|
||||||
@@ -195,14 +195,14 @@ export class GameDataSyncManager {
|
|||||||
*/
|
*/
|
||||||
async setHeroProperty(heroId: number, property: any, value: any): Promise<boolean> {
|
async setHeroProperty(heroId: number, property: any, value: any): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
console.log(`[GameDataSyncManager]: 设置英雄属性 ID:${heroId}, 属性:${property}, 值:${value}`);
|
// console.log(`[GameDataSyncManager]: 设置英雄属性 ID:${heroId}, 属性:${property}, 值:${value}`);
|
||||||
|
|
||||||
const result = await WxCloudApi.setHeroProperty(heroId, property, value);
|
const result = await WxCloudApi.setHeroProperty(heroId, property, value);
|
||||||
|
|
||||||
if (result.result.code === 200) {
|
if (result.result.code === 200) {
|
||||||
// 远程修改成功,同步本地数据
|
// 远程修改成功,同步本地数据
|
||||||
smc.heros[heroId][property] = value;
|
smc.heros[heroId][property] = value;
|
||||||
console.log(`[GameDataSyncManager]: 英雄属性设置成功,本地数据已同步`);
|
// console.log(`[GameDataSyncManager]: 英雄属性设置成功,本地数据已同步`);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
console.warn(`[GameDataSyncManager]: 英雄属性设置失败: ${result.result.msg}`);
|
console.warn(`[GameDataSyncManager]: 英雄属性设置失败: ${result.result.msg}`);
|
||||||
@@ -223,14 +223,14 @@ export class GameDataSyncManager {
|
|||||||
*/
|
*/
|
||||||
async levelUpHero(heroId: number,levels: number = 1,): Promise<boolean> {
|
async levelUpHero(heroId: number,levels: number = 1,): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
console.log(`[GameDataSyncManager]: 英雄升级 ID:${heroId}, 级数:${levels}`);
|
// console.log(`[GameDataSyncManager]: 英雄升级 ID:${heroId}, 级数:${levels}`);
|
||||||
|
|
||||||
const result = await WxCloudApi.levelUpHero(heroId,levels);
|
const result = await WxCloudApi.levelUpHero(heroId,levels);
|
||||||
|
|
||||||
if (result.result.code === 200) {
|
if (result.result.code === 200) {
|
||||||
// 远程修改成功,同步本地数据
|
// 远程修改成功,同步本地数据
|
||||||
smc.heros[heroId].lv = result.result.data.new_value;
|
smc.heros[heroId].lv = result.result.data.new_value;
|
||||||
console.log(`[GameDataSyncManager]: 英雄升级成功,本地数据已同步`);
|
// console.log(`[GameDataSyncManager]: 英雄升级成功,本地数据已同步`);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
console.warn(`[GameDataSyncManager]: 英雄升级失败: ${result.result.msg}`);
|
console.warn(`[GameDataSyncManager]: 英雄升级失败: ${result.result.msg}`);
|
||||||
@@ -254,11 +254,11 @@ export class GameDataSyncManager {
|
|||||||
async addItem(itemId: number, count: number): Promise<boolean> {
|
async addItem(itemId: number, count: number): Promise<boolean> {
|
||||||
smc.items[itemId] = (smc.items[itemId] || 0) + count;
|
smc.items[itemId] = (smc.items[itemId] || 0) + count;
|
||||||
try {
|
try {
|
||||||
console.log(`[GameDataSyncManager]: 增加道具 ID:${itemId}, 数量:${count}`);
|
// console.log(`[GameDataSyncManager]: 增加道具 ID:${itemId}, 数量:${count}`);
|
||||||
const result = await WxCloudApi.addInventoryItem('items', itemId, count);
|
const result = await WxCloudApi.addInventoryItem('items', itemId, count);
|
||||||
if (result.result.code === 200) {
|
if (result.result.code === 200) {
|
||||||
// 远程修改成功,同步本地数据
|
// 远程修改成功,同步本地数据
|
||||||
console.log(`[GameDataSyncManager]: 道具增加成功`);
|
// console.log(`[GameDataSyncManager]: 道具增加成功`);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
console.warn(`[GameDataSyncManager]: 道具增加失败: ${result.result.msg}`);
|
console.warn(`[GameDataSyncManager]: 道具增加失败: ${result.result.msg}`);
|
||||||
@@ -283,12 +283,12 @@ export class GameDataSyncManager {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
console.log(`[GameDataSyncManager]: 消耗道具 ID:${itemId}, 数量:${count}`);
|
// console.log(`[GameDataSyncManager]: 消耗道具 ID:${itemId}, 数量:${count}`);
|
||||||
const result = await WxCloudApi.consumeInventoryItem('items', itemId, count);
|
const result = await WxCloudApi.consumeInventoryItem('items', itemId, count);
|
||||||
if (result.result.code === 200) {
|
if (result.result.code === 200) {
|
||||||
// 远程修改成功,同步本地数据
|
// 远程修改成功,同步本地数据
|
||||||
smc.items[itemId] = Math.max(0, (smc.items[itemId] || 0) - count);
|
smc.items[itemId] = Math.max(0, (smc.items[itemId] || 0) - count);
|
||||||
console.log(`[GameDataSyncManager]: 道具消耗成功,本地数据已同步`);
|
// console.log(`[GameDataSyncManager]: 道具消耗成功,本地数据已同步`);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
console.warn(`[GameDataSyncManager]: 道具消耗失败: ${result.result.msg}`);
|
console.warn(`[GameDataSyncManager]: 道具消耗失败: ${result.result.msg}`);
|
||||||
@@ -311,14 +311,14 @@ export class GameDataSyncManager {
|
|||||||
*/
|
*/
|
||||||
async addTalent(talId: number, count: number): Promise<boolean> {
|
async addTalent(talId: number, count: number): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
console.log(`[GameDataSyncManager]: 增加天赋点 ID:${talId}, 数量:${count}`);
|
// console.log(`[GameDataSyncManager]: 增加天赋点 ID:${talId}, 数量:${count}`);
|
||||||
|
|
||||||
const result = await WxCloudApi.addInventoryItem('tals', talId, count);
|
const result = await WxCloudApi.addInventoryItem('tals', talId, count);
|
||||||
|
|
||||||
if (result.result.code === 200) {
|
if (result.result.code === 200) {
|
||||||
// 远程修改成功,同步本地数据
|
// 远程修改成功,同步本地数据
|
||||||
smc.tals[talId] = (smc.tals[talId] || 0) + count;
|
smc.tals[talId] = (smc.tals[talId] || 0) + count;
|
||||||
console.log(`[GameDataSyncManager]: 天赋点增加成功,本地数据已同步`);
|
// console.log(`[GameDataSyncManager]: 天赋点增加成功,本地数据已同步`);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
console.warn(`[GameDataSyncManager]: 天赋点增加失败: ${result.result.msg}`);
|
console.warn(`[GameDataSyncManager]: 天赋点增加失败: ${result.result.msg}`);
|
||||||
@@ -339,14 +339,14 @@ export class GameDataSyncManager {
|
|||||||
*/
|
*/
|
||||||
async consumeTalent(talId: number, count: number): Promise<boolean> {
|
async consumeTalent(talId: number, count: number): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
console.log(`[GameDataSyncManager]: 消耗天赋点 ID:${talId}, 数量:${count}`);
|
// console.log(`[GameDataSyncManager]: 消耗天赋点 ID:${talId}, 数量:${count}`);
|
||||||
|
|
||||||
const result = await WxCloudApi.consumeInventoryItem('tals', talId, count);
|
const result = await WxCloudApi.consumeInventoryItem('tals', talId, count);
|
||||||
|
|
||||||
if (result.result.code === 200) {
|
if (result.result.code === 200) {
|
||||||
// 远程修改成功,同步本地数据
|
// 远程修改成功,同步本地数据
|
||||||
smc.tals[talId] = Math.max(0, (smc.tals[talId] || 0) - count);
|
smc.tals[talId] = Math.max(0, (smc.tals[talId] || 0) - count);
|
||||||
console.log(`[GameDataSyncManager]: 天赋点消耗成功,本地数据已同步`);
|
// console.log(`[GameDataSyncManager]: 天赋点消耗成功,本地数据已同步`);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
console.warn(`[GameDataSyncManager]: 天赋点消耗失败: ${result.result.msg}`);
|
console.warn(`[GameDataSyncManager]: 天赋点消耗失败: ${result.result.msg}`);
|
||||||
@@ -367,14 +367,14 @@ export class GameDataSyncManager {
|
|||||||
*/
|
*/
|
||||||
async addEquipment(equipId: number, count: number): Promise<boolean> {
|
async addEquipment(equipId: number, count: number): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
console.log(`[GameDataSyncManager]: 增加装备 ID:${equipId}, 数量:${count}`);
|
// console.log(`[GameDataSyncManager]: 增加装备 ID:${equipId}, 数量:${count}`);
|
||||||
|
|
||||||
const result = await WxCloudApi.addInventoryItem('equips', equipId, count);
|
const result = await WxCloudApi.addInventoryItem('equips', equipId, count);
|
||||||
|
|
||||||
if (result.result.code === 200) {
|
if (result.result.code === 200) {
|
||||||
// 远程修改成功,同步本地数据
|
// 远程修改成功,同步本地数据
|
||||||
smc.equips[equipId] = (smc.equips[equipId] || 0) + count;
|
smc.equips[equipId] = (smc.equips[equipId] || 0) + count;
|
||||||
console.log(`[GameDataSyncManager]: 装备增加成功,本地数据已同步`);
|
// console.log(`[GameDataSyncManager]: 装备增加成功,本地数据已同步`);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
console.warn(`[GameDataSyncManager]: 装备增加失败: ${result.result.msg}`);
|
console.warn(`[GameDataSyncManager]: 装备增加失败: ${result.result.msg}`);
|
||||||
@@ -395,14 +395,14 @@ export class GameDataSyncManager {
|
|||||||
*/
|
*/
|
||||||
async consumeEquipment(equipId: number, count: number): Promise<boolean> {
|
async consumeEquipment(equipId: number, count: number): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
console.log(`[GameDataSyncManager]: 消耗装备 ID:${equipId}, 数量:${count}`);
|
// console.log(`[GameDataSyncManager]: 消耗装备 ID:${equipId}, 数量:${count}`);
|
||||||
|
|
||||||
const result = await WxCloudApi.consumeInventoryItem('equips', equipId, count);
|
const result = await WxCloudApi.consumeInventoryItem('equips', equipId, count);
|
||||||
|
|
||||||
if (result.result.code === 200) {
|
if (result.result.code === 200) {
|
||||||
// 远程修改成功,同步本地数据
|
// 远程修改成功,同步本地数据
|
||||||
smc.equips[equipId] = Math.max(0, (smc.equips[equipId] || 0) - count);
|
smc.equips[equipId] = Math.max(0, (smc.equips[equipId] || 0) - count);
|
||||||
console.log(`[GameDataSyncManager]: 装备消耗成功,本地数据已同步`);
|
// console.log(`[GameDataSyncManager]: 装备消耗成功,本地数据已同步`);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
console.warn(`[GameDataSyncManager]: 装备消耗失败: ${result.result.msg}`);
|
console.warn(`[GameDataSyncManager]: 装备消耗失败: ${result.result.msg}`);
|
||||||
@@ -419,10 +419,10 @@ export class GameDataSyncManager {
|
|||||||
|
|
||||||
async addGameProperty(property: string, value: any): Promise<boolean> {
|
async addGameProperty(property: string, value: any): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
console.log(`[GameDataSyncManager]: 增加游戏数据 ${property} = ${value}`);
|
// console.log(`[GameDataSyncManager]: 增加游戏数据 ${property} = ${value}`);
|
||||||
const result = await WxCloudApi.addGameDataField(property, value);
|
const result = await WxCloudApi.addGameDataField(property, value);
|
||||||
if (result.result.code === 200) {
|
if (result.result.code === 200) {
|
||||||
console.log(`[GameDataSyncManager]: 游戏数据增加成功`);
|
// console.log(`[GameDataSyncManager]: 游戏数据增加成功`);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
console.warn(`[GameDataSyncManager]: 游戏数据增加失败: ${result.result.msg}`);
|
console.warn(`[GameDataSyncManager]: 游戏数据增加失败: ${result.result.msg}`);
|
||||||
@@ -437,10 +437,10 @@ export class GameDataSyncManager {
|
|||||||
|
|
||||||
async spendGameProperty(property: string|Record<string, number>, value: any = undefined ): Promise<boolean> {
|
async spendGameProperty(property: string|Record<string, number>, value: any = undefined ): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
console.log(`[GameDataSyncManager]: 消耗游戏数据 ${property} = ${value}`);
|
// console.log(`[GameDataSyncManager]: 消耗游戏数据 ${property} = ${value}`);
|
||||||
const result = await WxCloudApi.spendGameDataField(property, value);
|
const result = await WxCloudApi.spendGameDataField(property, value);
|
||||||
if (result.result.code === 200) {
|
if (result.result.code === 200) {
|
||||||
console.log(`[GameDataSyncManager]: 游戏数据消耗成功`);
|
// console.log(`[GameDataSyncManager]: 游戏数据消耗成功`);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -456,7 +456,7 @@ export class GameDataSyncManager {
|
|||||||
*/
|
*/
|
||||||
async loadAllGameData(): Promise<boolean> {
|
async loadAllGameData(): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
console.log(`[GameDataSyncManager]: 从云端加载所有游戏数据`);
|
// console.log(`[GameDataSyncManager]: 从云端加载所有游戏数据`);
|
||||||
|
|
||||||
const result = await WxCloudApi.getAllGameData();
|
const result = await WxCloudApi.getAllGameData();
|
||||||
|
|
||||||
@@ -470,7 +470,7 @@ export class GameDataSyncManager {
|
|||||||
smc.tals = cloudData.tals;
|
smc.tals = cloudData.tals;
|
||||||
smc.equips = cloudData.equips;
|
smc.equips = cloudData.equips;
|
||||||
|
|
||||||
console.log(`[GameDataSyncManager]: 云端数据加载成功,本地数据已同步`);
|
// console.log(`[GameDataSyncManager]: 云端数据加载成功,本地数据已同步`);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
console.warn(`[GameDataSyncManager]: 云端数据加载失败: ${result.result.msg}`);
|
console.warn(`[GameDataSyncManager]: 云端数据加载失败: ${result.result.msg}`);
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ export class SingletonModuleComp extends ecs.Comp {
|
|||||||
const current = this.data[key] || 0;
|
const current = this.data[key] || 0;
|
||||||
const next = current - need;
|
const next = current - need;
|
||||||
this.data[key] = next;
|
this.data[key] = next;
|
||||||
console.log(`[SMC]: 消耗游戏数据 ${key} = ${need}, 当前值: ${next}`);
|
// console.log(`[SMC]: 消耗游戏数据 ${key} = ${need}, 当前值: ${next}`);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export default class HeroAnmComp extends Component{
|
|||||||
this._hasStop = true;
|
this._hasStop = true;
|
||||||
}
|
}
|
||||||
onAnimationFinished(type:Animation.EventType, state:AnimationState){
|
onAnimationFinished(type:Animation.EventType, state:AnimationState){
|
||||||
console.log("[HeroAnmComp]: 动画播放完毕",state.name)
|
// console.log("[HeroAnmComp]: 动画播放完毕",state.name)
|
||||||
if(state.name!="idle"&&state.name!="move"){
|
if(state.name!="idle"&&state.name!="move"){
|
||||||
this.anmcon.play(this.default_anim)
|
this.anmcon.play(this.default_anim)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ export class HeroViewComp extends CCComp {
|
|||||||
start () {
|
start () {
|
||||||
this.as.idle()
|
this.as.idle()
|
||||||
this.BUFFCOMP=this.node.getComponent(BuffComp);
|
this.BUFFCOMP=this.node.getComponent(BuffComp);
|
||||||
console.log("[HeroViewComp]:heroview"+this.hero_name,this.Attrs)
|
// console.log("[HeroViewComp]:heroview"+this.hero_name,this.Attrs)
|
||||||
/** 方向 */
|
/** 方向 */
|
||||||
this.node.setScale(this.scale,1);
|
this.node.setScale(this.scale,1);
|
||||||
this.node.getChildByName("top").setScale(this.scale,1);
|
this.node.getChildByName("top").setScale(this.scale,1);
|
||||||
@@ -291,7 +291,7 @@ export class HeroViewComp extends CCComp {
|
|||||||
if(diamond>0){
|
if(diamond>0){
|
||||||
smc.addDiamond(diamond)
|
smc.addDiamond(diamond)
|
||||||
}
|
}
|
||||||
console.log("[HeroViewComp]:do_drop",this.hero_uuid,drop_item,exp,gold,diamond)
|
// console.log("[HeroViewComp]:do_drop",this.hero_uuid,drop_item,exp,gold,diamond)
|
||||||
}
|
}
|
||||||
add_debuff(type:number,deV:number,deC:number,deR:number){
|
add_debuff(type:number,deV:number,deC:number,deR:number){
|
||||||
let n_deR=deR-this.Attrs[BuffAttr.DEBUFF_DOWN]
|
let n_deR=deR-this.Attrs[BuffAttr.DEBUFF_DOWN]
|
||||||
@@ -438,7 +438,7 @@ export class HeroViewComp extends CCComp {
|
|||||||
if(is_crit) {
|
if(is_crit) {
|
||||||
damage = Math.floor(damage * (1 + (FightSet.CRIT_DAMAGE+crit_d)/100))
|
damage = Math.floor(damage * (1 + (FightSet.CRIT_DAMAGE+crit_d)/100))
|
||||||
}
|
}
|
||||||
console.log(this.hero_name+"[HeroViewComp]:heroview :damage|hp|hp_max",damage,this.hp,this.Attrs[BuffAttr.HP_MAX])
|
// console.log(this.hero_name+"[HeroViewComp]:heroview :damage|hp|hp_max",damage,this.hp,this.Attrs[BuffAttr.HP_MAX])
|
||||||
damage=this.check_shield(damage)
|
damage=this.check_shield(damage)
|
||||||
if(damage <= 0) return
|
if(damage <= 0) return
|
||||||
this.hp -= damage;
|
this.hp -= damage;
|
||||||
@@ -586,7 +586,7 @@ export class HeroViewComp extends CCComp {
|
|||||||
|
|
||||||
to_update_lv(event:string,data:any){
|
to_update_lv(event:string,data:any){
|
||||||
if(this.fac==FacSet.MON) return
|
if(this.fac==FacSet.MON) return
|
||||||
console.log("[HeroViewComp]:升级",this.BUFFCOMP)
|
// console.log("[HeroViewComp]:升级",this.BUFFCOMP)
|
||||||
if(this.hero_uuid!=data.uuid) return
|
if(this.hero_uuid!=data.uuid) return
|
||||||
this.apply_buff(BuffAttr.HP_MAX,data.hp)
|
this.apply_buff(BuffAttr.HP_MAX,data.hp)
|
||||||
this.apply_buff(BuffAttr.AP,data.ap)
|
this.apply_buff(BuffAttr.AP,data.ap)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export class Monster extends ecs.Entity {
|
|||||||
load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=1001,is_boss:boolean=false,is_call:boolean=false,enhancement?: any, stageMultipliers?: any) {
|
load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=1001,is_boss:boolean=false,is_call:boolean=false,enhancement?: any, stageMultipliers?: any) {
|
||||||
scale=-1
|
scale=-1
|
||||||
let box_group=BoxSet.MONSTER
|
let box_group=BoxSet.MONSTER
|
||||||
console.log("mon load",uuid)
|
// console.log("mon load",uuid)
|
||||||
// this.addComponents<ecs.Comp>( MonModelComp, BattleMoveComp);
|
// this.addComponents<ecs.Comp>( MonModelComp, BattleMoveComp);
|
||||||
var scene = smc.map.MapView.scene;
|
var scene = smc.map.MapView.scene;
|
||||||
this.brith_light(pos,scene)
|
this.brith_light(pos,scene)
|
||||||
@@ -53,7 +53,7 @@ export class Monster extends ecs.Entity {
|
|||||||
move.direction = -1; // 向左移动
|
move.direction = -1; // 向左移动
|
||||||
move.targetX = -800; // 左边界
|
move.targetX = -800; // 左边界
|
||||||
smc.vmdata.mission_data.mon_num++
|
smc.vmdata.mission_data.mon_num++
|
||||||
console.log("[Mon] mission_data.mon_num:",smc.vmdata.mission_data.mon_num)
|
// console.log("[Mon] mission_data.mon_num:",smc.vmdata.mission_data.mon_num)
|
||||||
}
|
}
|
||||||
brith_light(pos:Vec3,scene:any){
|
brith_light(pos:Vec3,scene:any){
|
||||||
var path = "game/skills/map_birth";
|
var path = "game/skills/map_birth";
|
||||||
@@ -92,9 +92,9 @@ export class Monster extends ecs.Entity {
|
|||||||
if (stageMultipliers) {
|
if (stageMultipliers) {
|
||||||
finalHp = Math.floor(baseHp * stageMultipliers.hp);
|
finalHp = Math.floor(baseHp * stageMultipliers.hp);
|
||||||
finalAp = Math.floor(baseAp * stageMultipliers.attack);
|
finalAp = Math.floor(baseAp * stageMultipliers.attack);
|
||||||
console.log(`[Monster]: 怪物${hero.name} 关卡倍数 - HP: ${baseHp} x ${stageMultipliers.hp.toFixed(2)} = ${finalHp}, AP: ${baseAp} x ${stageMultipliers.attack.toFixed(2)} = ${finalAp}`);
|
// console.log(`[Monster]: 怪物${hero.name} 关卡倍数 - HP: ${baseHp} x ${stageMultipliers.hp.toFixed(2)} = ${finalHp}, AP: ${baseAp} x ${stageMultipliers.attack.toFixed(2)} = ${finalAp}`);
|
||||||
} else {
|
} else {
|
||||||
console.log(`[Monster]: 怪物${hero.name} 使用基础属性 - HP: ${finalHp}, AP: ${finalAp}`);
|
// console.log(`[Monster]: 怪物${hero.name} 使用基础属性 - HP: ${finalHp}, AP: ${finalAp}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
hv.hp = hv.hp_max = finalHp;
|
hv.hp = hv.hp_max = finalHp;
|
||||||
@@ -116,7 +116,7 @@ export class Monster extends ecs.Entity {
|
|||||||
|
|
||||||
// 处理肉鸽模式的增强属性
|
// 处理肉鸽模式的增强属性
|
||||||
if (enhancement && enhancement.buffList && enhancement.buffList.length > 0) {
|
if (enhancement && enhancement.buffList && enhancement.buffList.length > 0) {
|
||||||
console.log(`[Monster]: 怪物${hero.name}应用增强属性:`, enhancement.buffList.map((buff: any) => `${buff.name}:+${buff.value}`));
|
// console.log(`[Monster]: 怪物${hero.name}应用增强属性:`, enhancement.buffList.map((buff: any) => `${buff.name}:+${buff.value}`));
|
||||||
enhancement.buffList.forEach((buff:any)=>{
|
enhancement.buffList.forEach((buff:any)=>{
|
||||||
hv.apply_buff(buff.buffType, buff.value);
|
hv.apply_buff(buff.buffType, buff.value);
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ export class CardComp extends CCComp {
|
|||||||
}, 0.1);
|
}, 0.1);
|
||||||
}
|
}
|
||||||
func_select(args: any){
|
func_select(args: any){
|
||||||
console.log("[cardcomp]:card func_select",args)
|
// console.log("[cardcomp]:card func_select",args)
|
||||||
this.c_type=cardType.SPECIAL
|
this.c_type=cardType.SPECIAL
|
||||||
this.c_uuid=args.uuid
|
this.c_uuid=args.uuid
|
||||||
this.node.getChildByName("show").active=false
|
this.node.getChildByName("show").active=false
|
||||||
@@ -116,7 +116,7 @@ export class CardComp extends CCComp {
|
|||||||
|
|
||||||
random_select(){
|
random_select(){
|
||||||
let card =getRandomCardUUID() //随机获取卡牌类型
|
let card =getRandomCardUUID() //随机获取卡牌类型
|
||||||
console.log("[cardcomp]:rad 开始请求卡牌",card)
|
// console.log("[cardcomp]:rad 开始请求卡牌",card)
|
||||||
switch(card.type){
|
switch(card.type){
|
||||||
case cardType.EQUIP:
|
case cardType.EQUIP:
|
||||||
this.equip_select(card)
|
this.equip_select(card)
|
||||||
@@ -137,7 +137,7 @@ export class CardComp extends CCComp {
|
|||||||
sprite.spriteFrame = atlas.getSpriteFrame(TalentList[uuid].path);
|
sprite.spriteFrame = atlas.getSpriteFrame(TalentList[uuid].path);
|
||||||
});
|
});
|
||||||
show.getChildByName("info").getComponent(Label).string=TalentList[uuid].info
|
show.getChildByName("info").getComponent(Label).string=TalentList[uuid].info
|
||||||
console.log("[cardcomp]:show_talent",TalentList[uuid],show)
|
// console.log("[cardcomp]:show_talent",TalentList[uuid],show)
|
||||||
}
|
}
|
||||||
show_skill(uuid:number){
|
show_skill(uuid:number){
|
||||||
let show=this.node.getChildByName("show")
|
let show=this.node.getChildByName("show")
|
||||||
@@ -163,7 +163,7 @@ export class CardComp extends CCComp {
|
|||||||
// console.error("[CardComp]: 加载骨骼数据失败:", err);
|
// console.error("[CardComp]: 加载骨骼数据失败:", err);
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
// console.log("[CardComp]: 加载骨骼数据成功:", skeleton)
|
// // console.log("[CardComp]: 加载骨骼数据成功:", skeleton)
|
||||||
// // 检查节点是否仍然存在
|
// // 检查节点是否仍然存在
|
||||||
// const maskNode = show.getChildByName("mask");
|
// const maskNode = show.getChildByName("mask");
|
||||||
// if (!maskNode) {
|
// if (!maskNode) {
|
||||||
@@ -267,7 +267,7 @@ export class CardComp extends CCComp {
|
|||||||
show.getChildByName("mask").getChildByName("wbg").active=true
|
show.getChildByName("mask").getChildByName("wbg").active=true
|
||||||
break
|
break
|
||||||
case EquipType.ACCESSORY:
|
case EquipType.ACCESSORY:
|
||||||
console.log("[cardcomp]:装备卡 饰品")
|
// console.log("[cardcomp]:装备卡 饰品")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -330,32 +330,32 @@ export class CardComp extends CCComp {
|
|||||||
oops.message.dispatchEvent(GameEvent.CardsClose)
|
oops.message.dispatchEvent(GameEvent.CardsClose)
|
||||||
break
|
break
|
||||||
case cardType.SKILL:
|
case cardType.SKILL:
|
||||||
console.log("[cardcomp]:use_card 技能卡")
|
// console.log("[cardcomp]:use_card 技能卡")
|
||||||
oops.message.dispatchEvent(GameEvent.UseSkillCard,{uuid:this.c_uuid,slot:this.skill_slot})
|
oops.message.dispatchEvent(GameEvent.UseSkillCard,{uuid:this.c_uuid,slot:this.skill_slot})
|
||||||
oops.message.dispatchEvent(GameEvent.CardsClose)
|
oops.message.dispatchEvent(GameEvent.CardsClose)
|
||||||
this.skill_slot="skill1"
|
this.skill_slot="skill1"
|
||||||
break
|
break
|
||||||
case cardType.EQUIP:
|
case cardType.EQUIP:
|
||||||
console.log("[cardcomp]:use_card 装备卡")
|
// console.log("[cardcomp]:use_card 装备卡")
|
||||||
// if(!this.cost_gold_check()) return
|
// if(!this.cost_gold_check()) return
|
||||||
oops.message.dispatchEvent(GameEvent.EquipAdd,{uuid:this.c_uuid,type:EquipInfo[this.c_uuid].type,slot:this.equip_slot})
|
oops.message.dispatchEvent(GameEvent.EquipAdd,{uuid:this.c_uuid,type:EquipInfo[this.c_uuid].type,slot:this.equip_slot})
|
||||||
oops.message.dispatchEvent(GameEvent.CardsClose)
|
oops.message.dispatchEvent(GameEvent.CardsClose)
|
||||||
break
|
break
|
||||||
case cardType.SPECIAL:
|
case cardType.SPECIAL:
|
||||||
console.log("[cardcomp]:use_card 功能卡")
|
// console.log("[cardcomp]:use_card 功能卡")
|
||||||
// if(!this.cost_gold_check()) return
|
// if(!this.cost_gold_check()) return
|
||||||
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:
|
case cardType.ENHANCEMENT:
|
||||||
console.log("[cardcomp]:use_card 强化卡",this.enhancement_data,smc.enhancements)
|
// console.log("[cardcomp]:use_card 强化卡",this.enhancement_data,smc.enhancements)
|
||||||
oops.message.dispatchEvent(GameEvent.UseEnhancement,this.enhancement_data)
|
oops.message.dispatchEvent(GameEvent.UseEnhancement,this.enhancement_data)
|
||||||
smc.enhancements[this.enhancement_data.type]=this.enhancement_data.lv
|
smc.enhancements[this.enhancement_data.type]=this.enhancement_data.lv
|
||||||
console.log("[cardcomp]:use_card 强化卡",this.enhancement_data,smc.enhancements)
|
// console.log("[cardcomp]:use_card 强化卡",this.enhancement_data,smc.enhancements)
|
||||||
oops.message.dispatchEvent(GameEvent.CardsClose)
|
oops.message.dispatchEvent(GameEvent.CardsClose)
|
||||||
break
|
break
|
||||||
case cardType.TALENT:
|
case cardType.TALENT:
|
||||||
console.log("[cardcomp]:use_card 天赋卡",this.c_uuid)
|
// console.log("[cardcomp]:use_card 天赋卡",this.c_uuid)
|
||||||
oops.message.dispatchEvent(GameEvent.UseTalentCard,{uuid:this.c_uuid,slot:this.talent_slot})
|
oops.message.dispatchEvent(GameEvent.UseTalentCard,{uuid:this.c_uuid,slot:this.talent_slot})
|
||||||
oops.message.dispatchEvent(GameEvent.CardsClose)
|
oops.message.dispatchEvent(GameEvent.CardsClose)
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export class CardControllerComp extends CCComp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
show_info(uuid:number,type:number){
|
show_info(uuid:number,type:number){
|
||||||
console.log("show_info",uuid)
|
// console.log("show_info",uuid)
|
||||||
}
|
}
|
||||||
|
|
||||||
protected update(dt: number): void {
|
protected update(dt: number): void {
|
||||||
|
|||||||
@@ -73,36 +73,36 @@ export class CardsCompComp extends CCComp {
|
|||||||
this.cancel_btn.active=false
|
this.cancel_btn.active=false
|
||||||
switch(e){
|
switch(e){
|
||||||
case GameEvent.HeroSelect:
|
case GameEvent.HeroSelect:
|
||||||
console.log("[CardsComp]:显示英雄选择卡牌",data)
|
// console.log("[CardsComp]:显示英雄选择卡牌",data)
|
||||||
let title="选择英雄"
|
let title="选择英雄"
|
||||||
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string=title
|
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string=title
|
||||||
this.hero_select(data)
|
this.hero_select(data)
|
||||||
break
|
break
|
||||||
case GameEvent.HeroSkillSelect:
|
case GameEvent.HeroSkillSelect:
|
||||||
console.log("[CardsComp]:显示技能选择卡牌")
|
// console.log("[CardsComp]:显示技能选择卡牌")
|
||||||
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string="选择技能"
|
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string="选择技能"
|
||||||
this.hero_skill_select(data)
|
this.hero_skill_select(data)
|
||||||
break
|
break
|
||||||
case GameEvent.FuncSelect:
|
case GameEvent.FuncSelect:
|
||||||
console.log("[CardsComp]:显示功能卡牌")
|
// console.log("[CardsComp]:显示功能卡牌")
|
||||||
this.cancel_btn.active=true
|
this.cancel_btn.active=true
|
||||||
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string="选择卡牌"
|
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string="选择卡牌"
|
||||||
this.func_select()
|
this.func_select()
|
||||||
break
|
break
|
||||||
case GameEvent.EquipSelect:
|
case GameEvent.EquipSelect:
|
||||||
console.log("[CardsComp]:显示装备选择卡牌")
|
// console.log("[CardsComp]:显示装备选择卡牌")
|
||||||
this.cancel_btn.active=true
|
this.cancel_btn.active=true
|
||||||
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:
|
case GameEvent.EnhancementSelect:
|
||||||
console.log("[CardsComp]:显示强化选择卡牌")
|
// console.log("[CardsComp]:显示强化选择卡牌")
|
||||||
this.cancel_btn.active=true
|
this.cancel_btn.active=true
|
||||||
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string="选择强化"
|
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string="选择强化"
|
||||||
this.enhancement_select()
|
this.enhancement_select()
|
||||||
break
|
break
|
||||||
case GameEvent.TalentSelect:
|
case GameEvent.TalentSelect:
|
||||||
console.log("[CardsComp]:显示天赋选择卡牌")
|
// console.log("[CardsComp]:显示天赋选择卡牌")
|
||||||
this.cancel_btn.active=true
|
this.cancel_btn.active=true
|
||||||
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string="选择天赋"
|
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string="选择天赋"
|
||||||
this.talent_select(data)
|
this.talent_select(data)
|
||||||
@@ -114,14 +114,14 @@ export class CardsCompComp extends CCComp {
|
|||||||
}
|
}
|
||||||
talent_select(data:any){
|
talent_select(data:any){
|
||||||
let list=getRandomCardsByType(cardType.TALENT,3,QualitySet.GREEN)
|
let list=getRandomCardsByType(cardType.TALENT,3,QualitySet.GREEN)
|
||||||
console.log("[CardsComp]:天赋选择卡牌列表",list)
|
// console.log("[CardsComp]:天赋选择卡牌列表",list)
|
||||||
this.card1c.talent_select(list[0],data)
|
this.card1c.talent_select(list[0],data)
|
||||||
this.card2c.talent_select(list[1],data)
|
this.card2c.talent_select(list[1],data)
|
||||||
this.card3c.talent_select(list[2],data)
|
this.card3c.talent_select(list[2],data)
|
||||||
}
|
}
|
||||||
enhancement_select(){
|
enhancement_select(){
|
||||||
let list=getEnhancement(smc.enhancements,3)
|
let list=getEnhancement(smc.enhancements,3)
|
||||||
console.log("[CardsComp]:强化选择卡牌列表",smc.enhancements,list)
|
// console.log("[CardsComp]:强化选择卡牌列表",smc.enhancements,list)
|
||||||
this.card1c.enhancement_select(list[0])
|
this.card1c.enhancement_select(list[0])
|
||||||
this.card2c.enhancement_select(list[1])
|
this.card2c.enhancement_select(list[1])
|
||||||
this.card3c.enhancement_select(list[2])
|
this.card3c.enhancement_select(list[2])
|
||||||
@@ -129,7 +129,7 @@ export class CardsCompComp extends CCComp {
|
|||||||
hero_select(data:any){
|
hero_select(data:any){
|
||||||
|
|
||||||
let list=getHeroList(data.called)
|
let list=getHeroList(data.called)
|
||||||
console.log("[CardsComp]:英雄选择卡牌列表",list)
|
// console.log("[CardsComp]:英雄选择卡牌列表",list)
|
||||||
this.card1c.hero_select(list[0])
|
this.card1c.hero_select(list[0])
|
||||||
this.card2c.hero_select(list[1])
|
this.card2c.hero_select(list[1])
|
||||||
this.card3c.hero_select(list[2])
|
this.card3c.hero_select(list[2])
|
||||||
@@ -145,7 +145,7 @@ export class CardsCompComp extends CCComp {
|
|||||||
}else if(data.slot=="skill3"){
|
}else if(data.slot=="skill3"){
|
||||||
list=getRandomCardsByType(cardType.SKILL,3,QualitySet.PURPLE)
|
list=getRandomCardsByType(cardType.SKILL,3,QualitySet.PURPLE)
|
||||||
}
|
}
|
||||||
console.log("[CardsComp]:技能选择卡牌列表",list)
|
// console.log("[CardsComp]:技能选择卡牌列表",list)
|
||||||
this.card1c.hero_skill_select(list[0],data)
|
this.card1c.hero_skill_select(list[0],data)
|
||||||
this.card2c.hero_skill_select(list[1],data)
|
this.card2c.hero_skill_select(list[1],data)
|
||||||
this.card3c.hero_skill_select(list[2],data)
|
this.card3c.hero_skill_select(list[2],data)
|
||||||
@@ -164,7 +164,7 @@ export class CardsCompComp extends CCComp {
|
|||||||
list=getRandomCardsByType(cardType.EQUIP,3,EquipType.ACCESSORY,data.lv)
|
list=getRandomCardsByType(cardType.EQUIP,3,EquipType.ACCESSORY,data.lv)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
console.log("[CardsComp]:装备选择卡牌列表",list)
|
// console.log("[CardsComp]:装备选择卡牌列表",list)
|
||||||
this.card1c.equip_select(list[0],data)
|
this.card1c.equip_select(list[0],data)
|
||||||
this.card2c.equip_select(list[1],data)
|
this.card2c.equip_select(list[1],data)
|
||||||
this.card3c.equip_select(list[2],data)
|
this.card3c.equip_select(list[2],data)
|
||||||
@@ -172,7 +172,7 @@ export class CardsCompComp extends CCComp {
|
|||||||
}
|
}
|
||||||
func_select(){
|
func_select(){
|
||||||
let list=getRandomCardsByType(cardType.SPECIAL,3)
|
let list=getRandomCardsByType(cardType.SPECIAL,3)
|
||||||
console.log("[CardsComp]:功能选择卡牌列表",list)
|
// console.log("[CardsComp]:功能选择卡牌列表",list)
|
||||||
this.card1c.func_select(list[0])
|
this.card1c.func_select(list[0])
|
||||||
this.card2c.func_select(list[1])
|
this.card2c.func_select(list[1])
|
||||||
this.card3c.func_select(list[2])
|
this.card3c.func_select(list[2])
|
||||||
@@ -187,7 +187,7 @@ export class CardsCompComp extends CCComp {
|
|||||||
|
|
||||||
/** 添加卡牌展示到队列 */
|
/** 添加卡牌展示到队列 */
|
||||||
private addToQueue(e: GameEvent, data?: any) {
|
private addToQueue(e: GameEvent, data?: any) {
|
||||||
console.log("[CardsComp]:添加卡牌到队列", e,data);
|
// console.log("[CardsComp]:添加卡牌到队列", e,data);
|
||||||
this.cardQueue.push({type: e, data: data});
|
this.cardQueue.push({type: e, data: data});
|
||||||
this.processQueue();
|
this.processQueue();
|
||||||
}
|
}
|
||||||
@@ -208,16 +208,16 @@ export class CardsCompComp extends CCComp {
|
|||||||
close_cards(e:GameEvent,data:any){
|
close_cards(e:GameEvent,data:any){
|
||||||
switch(e){
|
switch(e){
|
||||||
case GameEvent.HeroSelect:
|
case GameEvent.HeroSelect:
|
||||||
console.log("[CardsComp]:关闭英雄选择卡牌")
|
// console.log("[CardsComp]:关闭英雄选择卡牌")
|
||||||
break
|
break
|
||||||
case GameEvent.HeroSkillSelect:
|
case GameEvent.HeroSkillSelect:
|
||||||
console.log("[CardsComp]:关闭技能选择卡牌")
|
// console.log("[CardsComp]:关闭技能选择卡牌")
|
||||||
break
|
break
|
||||||
case GameEvent.CardRefresh:
|
case GameEvent.CardRefresh:
|
||||||
console.log("[CardsComp]:关闭随机刷新卡牌")
|
// console.log("[CardsComp]:关闭随机刷新卡牌")
|
||||||
break
|
break
|
||||||
case GameEvent.CardsClose:
|
case GameEvent.CardsClose:
|
||||||
console.log("[CardsComp]:关闭所有卡牌")
|
// console.log("[CardsComp]:关闭所有卡牌")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
this.hide()
|
this.hide()
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ export class GoodsComp extends Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
do_buy(){
|
do_buy(){
|
||||||
console.log("[GoodsComp]do_buy",this.goodsData,this.itemData)
|
// console.log("[GoodsComp]do_buy",this.goodsData,this.itemData)
|
||||||
switch(this.goodsData.type){
|
switch(this.goodsData.type){
|
||||||
case GType.ITEM:
|
case GType.ITEM:
|
||||||
smc.addItem(this.itemData.uuid,this.goodsData.num) //添加物品
|
smc.addItem(this.itemData.uuid,this.goodsData.num) //添加物品
|
||||||
@@ -140,7 +140,7 @@ export class GoodsComp extends Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ad_back_false(){
|
ad_back_false(){
|
||||||
console.log("ad_back_false")
|
// console.log("ad_back_false")
|
||||||
}
|
}
|
||||||
do_ad_back(success:Function,fail:Function){
|
do_ad_back(success:Function,fail:Function){
|
||||||
success.call(this)
|
success.call(this)
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export class HCardUICom extends Component {
|
|||||||
slot:number=0
|
slot:number=0
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
console.log("[HCardUICom]:start")
|
// console.log("[HCardUICom]:start")
|
||||||
}
|
}
|
||||||
protected onLoad(): void {
|
protected onLoad(): void {
|
||||||
oops.message.on(GameEvent.UpdateHero,this.to_update_hero,this)
|
oops.message.on(GameEvent.UpdateHero,this.to_update_hero,this)
|
||||||
@@ -25,14 +25,14 @@ export class HCardUICom extends Component {
|
|||||||
}
|
}
|
||||||
to_update_hero(event:any,args:any){
|
to_update_hero(event:any,args:any){
|
||||||
if(args.uuid==this.h_uuid){
|
if(args.uuid==this.h_uuid){
|
||||||
console.log("[HCardUICom]:是我诶:",HeroInfo[args.uuid].name+args.uuid)
|
// console.log("[HCardUICom]:是我诶:",HeroInfo[args.uuid].name+args.uuid)
|
||||||
this.update_data(args.uuid,{type:this.type})
|
this.update_data(args.uuid,{type:this.type})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
update_data(uuid:number,args:any){
|
update_data(uuid:number,args:any){
|
||||||
this.type=args.type
|
this.type=args.type
|
||||||
if(args.slot) this.slot=args.slot
|
if(args.slot) this.slot=args.slot
|
||||||
console.log("[HCardUICom]:update_data",uuid,this.type,this.slot,args)
|
// console.log("[HCardUICom]:update_data",uuid,this.type,this.slot,args)
|
||||||
this.h_uuid=uuid
|
this.h_uuid=uuid
|
||||||
this.node.getChildByName("in_fight").active=this.check_in_fight()
|
this.node.getChildByName("in_fight").active=this.check_in_fight()
|
||||||
let hero_data = HeroInfo[uuid]
|
let hero_data = HeroInfo[uuid]
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export class HInfoComp extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onAdded(args: any) {
|
onAdded(args: any) {
|
||||||
console.log("[HInfoComp]:onAdded",args)
|
// console.log("[HInfoComp]:onAdded",args)
|
||||||
this.update_data(args)
|
this.update_data(args)
|
||||||
}
|
}
|
||||||
update(deltaTime: number) {
|
update(deltaTime: number) {
|
||||||
@@ -26,7 +26,7 @@ export class HInfoComp extends Component {
|
|||||||
|
|
||||||
this.h_uuid=uuid
|
this.h_uuid=uuid
|
||||||
let hero_data = HeroInfo[uuid]
|
let hero_data = HeroInfo[uuid]
|
||||||
console.log("[HInfoComp]:update_data",uuid,hero_data,this.node)
|
// console.log("[HInfoComp]:update_data",uuid,hero_data,this.node)
|
||||||
let lv=smc.heros[uuid]?.lv??1
|
let lv=smc.heros[uuid]?.lv??1
|
||||||
let anm_path=hero_data.path
|
let anm_path=hero_data.path
|
||||||
resources.load("game/heros/hero/"+anm_path+"/idle", AnimationClip, (err, clip) => {
|
resources.load("game/heros/hero/"+anm_path+"/idle", AnimationClip, (err, clip) => {
|
||||||
@@ -63,7 +63,7 @@ export class HInfoComp extends Component {
|
|||||||
this.node.getChildByName("lock").active=lv == 0
|
this.node.getChildByName("lock").active=lv == 0
|
||||||
this.node.getChildByName("unLock").active=lv == 0
|
this.node.getChildByName("unLock").active=lv == 0
|
||||||
let need_item=unlockHeroCost[HeroInfo[this.h_uuid].quality]
|
let need_item=unlockHeroCost[HeroInfo[this.h_uuid].quality]
|
||||||
console.log("[HInfoComp]:show_lock item:item_uuid:hero_uuid:hero_data",Items[need_item.i_uuid],need_item.i_uuid,this.h_uuid,HeroInfo[this.h_uuid])
|
// console.log("[HInfoComp]:show_lock item:item_uuid:hero_uuid:hero_data",Items[need_item.i_uuid],need_item.i_uuid,this.h_uuid,HeroInfo[this.h_uuid])
|
||||||
|
|
||||||
this.node.getChildByName("unLockNeed").getChildByName("need").getChildByName("has").getComponent(Label).string=smc.items[need_item.i_uuid]??0
|
this.node.getChildByName("unLockNeed").getChildByName("need").getChildByName("has").getComponent(Label).string=smc.items[need_item.i_uuid]??0
|
||||||
this.node.getChildByName("unLockNeed").getChildByName("need").getChildByName("need").getComponent(Label).string=NumberFormatter.formatNumber(need_item.num)
|
this.node.getChildByName("unLockNeed").getChildByName("need").getChildByName("need").getComponent(Label).string=NumberFormatter.formatNumber(need_item.num)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const { ccclass, property } = _decorator;
|
|||||||
@ccclass('HeroPageComp')
|
@ccclass('HeroPageComp')
|
||||||
export class HeroPageComp extends Component {
|
export class HeroPageComp extends Component {
|
||||||
start() {
|
start() {
|
||||||
console.log("[HeroPageComp]:start")
|
// console.log("[HeroPageComp]:start")
|
||||||
}
|
}
|
||||||
|
|
||||||
update(deltaTime: number) {
|
update(deltaTime: number) {
|
||||||
@@ -17,10 +17,10 @@ export class HeroPageComp extends Component {
|
|||||||
}
|
}
|
||||||
update_heros(){
|
update_heros(){
|
||||||
let heros=getHeroList()
|
let heros=getHeroList()
|
||||||
console.log("[HeroPageComp]:update_heros",heros)
|
// console.log("[HeroPageComp]:update_heros",heros)
|
||||||
let height= Math.ceil(heros.length/3)*315+30
|
let height= Math.ceil(heros.length/3)*315+30
|
||||||
this.node.getChildByName("main").getChildByName("view").getChildByName("heros").getComponent(UITransform).setContentSize(720,height)
|
this.node.getChildByName("main").getChildByName("view").getChildByName("heros").getComponent(UITransform).setContentSize(720,height)
|
||||||
console.log("[HeroPageComp]:UITransform height",this.node.getChildByName("main").getChildByName("view").getChildByName("heros").getComponent(UITransform))
|
// console.log("[HeroPageComp]:UITransform height",this.node.getChildByName("main").getChildByName("view").getChildByName("heros").getComponent(UITransform))
|
||||||
this.clear_heros()
|
this.clear_heros()
|
||||||
for(let i=0;i<heros.length;i++){
|
for(let i=0;i<heros.length;i++){
|
||||||
let hero=heros[i]
|
let hero=heros[i]
|
||||||
@@ -30,7 +30,7 @@ export class HeroPageComp extends Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
load_hero(uuid:number){
|
load_hero(uuid:number){
|
||||||
console.log("[HeroPageComp]:load_hero",uuid)
|
// console.log("[HeroPageComp]:load_hero",uuid)
|
||||||
let parent=this.node.getChildByName("main").getChildByName("view").getChildByName("heros")
|
let parent=this.node.getChildByName("main").getChildByName("view").getChildByName("heros")
|
||||||
let path = "game/gui/hcard"
|
let path = "game/gui/hcard"
|
||||||
const prefab = oops.res.get(path, Prefab);
|
const prefab = oops.res.get(path, Prefab);
|
||||||
@@ -46,7 +46,7 @@ export class HeroPageComp extends Component {
|
|||||||
clear_heros(){
|
clear_heros(){
|
||||||
let parent=this.node.getChildByName("main").getChildByName("view").getChildByName("heros")
|
let parent=this.node.getChildByName("main").getChildByName("view").getChildByName("heros")
|
||||||
let children=parent.children
|
let children=parent.children
|
||||||
console.log("[HeroPageComp]:clear_heros",children)
|
// console.log("[HeroPageComp]:clear_heros",children)
|
||||||
for(let i=0;i<children.length;i++){
|
for(let i=0;i<children.length;i++){
|
||||||
children[i].destroy()
|
children[i].destroy()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export class HeroReadyCom extends Component {
|
|||||||
}
|
}
|
||||||
update_hero(){
|
update_hero(){
|
||||||
let hero = smc.fight_heros[this.slot]
|
let hero = smc.fight_heros[this.slot]
|
||||||
console.log("[HeroReadyCom]hero",hero,smc.fight_heros,this.slot)
|
// console.log("[HeroReadyCom]hero",hero,smc.fight_heros,this.slot)
|
||||||
if(hero==0){
|
if(hero==0){
|
||||||
this.no_hero()
|
this.no_hero()
|
||||||
return
|
return
|
||||||
@@ -33,7 +33,7 @@ export class HeroReadyCom extends Component {
|
|||||||
this.node.getChildByName("icon").active=true
|
this.node.getChildByName("icon").active=true
|
||||||
this.node.getChildByName("add").active=false
|
this.node.getChildByName("add").active=false
|
||||||
let hero_data = HeroInfo[hero]
|
let hero_data = HeroInfo[hero]
|
||||||
console.log("[HeroReadyCom]hero_data",smc.fight_heros,hero,smc.fight_heros[this.slot],this.slot,hero_data)
|
// console.log("[HeroReadyCom]hero_data",smc.fight_heros,hero,smc.fight_heros[this.slot],this.slot,hero_data)
|
||||||
let anm_path=hero_data.path
|
let anm_path=hero_data.path
|
||||||
resources.load("game/heros/hero/"+anm_path+"/idle", AnimationClip, (err, clip) => {
|
resources.load("game/heros/hero/"+anm_path+"/idle", AnimationClip, (err, clip) => {
|
||||||
this.node.getChildByName("icon").getComponent(Animation).addClip(clip);
|
this.node.getChildByName("icon").getComponent(Animation).addClip(clip);
|
||||||
|
|||||||
@@ -12,22 +12,22 @@ export class HeroSelectCom extends Component {
|
|||||||
|
|
||||||
}
|
}
|
||||||
onAdded(args: any) {
|
onAdded(args: any) {
|
||||||
console.log("[HeroSelectCom]:onAdded",args)
|
// console.log("[HeroSelectCom]:onAdded",args)
|
||||||
this.slot=args.slot
|
this.slot=args.slot
|
||||||
this.update_heros()
|
this.update_heros()
|
||||||
}
|
}
|
||||||
protected onDisable(): void {
|
protected onDisable(): void {
|
||||||
console.log("[HeroSelectCom]:onDisable")
|
// console.log("[HeroSelectCom]:onDisable")
|
||||||
this.clear_heros()
|
this.clear_heros()
|
||||||
}
|
}
|
||||||
update_heros(){
|
update_heros(){
|
||||||
let heros=smc.getHasHeroUUID()
|
let heros=smc.getHasHeroUUID()
|
||||||
let width= heros.length*230+20
|
let width= heros.length*230+20
|
||||||
this.node.getChildByName("main").getChildByName("view").getChildByName("heros").getComponent(UITransform).setContentSize(width,320)
|
this.node.getChildByName("main").getChildByName("view").getChildByName("heros").getComponent(UITransform).setContentSize(width,320)
|
||||||
console.log("[HeroPageComp]:UITransform width",this.node.getChildByName("main").getChildByName("view").getChildByName("heros").getComponent(UITransform))
|
// console.log("[HeroPageComp]:UITransform width",this.node.getChildByName("main").getChildByName("view").getChildByName("heros").getComponent(UITransform))
|
||||||
for(let i=0;i<heros.length;i++){
|
for(let i=0;i<heros.length;i++){
|
||||||
let hero=heros[i]
|
let hero=heros[i]
|
||||||
console.log("[HeroPageComp]:hero",hero)
|
// console.log("[HeroPageComp]:hero",hero)
|
||||||
if(hero){
|
if(hero){
|
||||||
this.load_hero(hero)
|
this.load_hero(hero)
|
||||||
}
|
}
|
||||||
@@ -37,13 +37,13 @@ export class HeroSelectCom extends Component {
|
|||||||
clear_heros(){
|
clear_heros(){
|
||||||
let parent=this.node.getChildByName("main").getChildByName("view").getChildByName("heros")
|
let parent=this.node.getChildByName("main").getChildByName("view").getChildByName("heros")
|
||||||
let children=parent.children
|
let children=parent.children
|
||||||
console.log("[HeroPageComp]:clear_heros",children)
|
// console.log("[HeroPageComp]:clear_heros",children)
|
||||||
for(let i=0;i<children.length;i++){
|
for(let i=0;i<children.length;i++){
|
||||||
children[i].destroy()
|
children[i].destroy()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
load_hero(uuid:number){
|
load_hero(uuid:number){
|
||||||
console.log("[HeroPageComp]:load_hero",uuid)
|
// console.log("[HeroPageComp]:load_hero",uuid)
|
||||||
let parent=this.node.getChildByName("main").getChildByName("view").getChildByName("heros")
|
let parent=this.node.getChildByName("main").getChildByName("view").getChildByName("heros")
|
||||||
let path = "game/gui/hcard"
|
let path = "game/gui/hcard"
|
||||||
const prefab = oops.res.get(path, Prefab);
|
const prefab = oops.res.get(path, Prefab);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export class ItemComp extends Component {
|
|||||||
|
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
console.log("[ItemComp]:start");
|
// console.log("[ItemComp]:start");
|
||||||
}
|
}
|
||||||
|
|
||||||
update(deltaTime: number) {
|
update(deltaTime: number) {
|
||||||
@@ -35,7 +35,7 @@ export class ItemComp extends Component {
|
|||||||
this.type = args.type || 0;
|
this.type = args.type || 0;
|
||||||
this.slot = args.slot || 0;
|
this.slot = args.slot || 0;
|
||||||
this.no_show = args.no_show || false;
|
this.no_show = args.no_show || false;
|
||||||
console.log("[ItemComp]:update_data", hero_uuid, count, this.type, this.slot, args);
|
// console.log("[ItemComp]:update_data", hero_uuid, count, this.type, this.slot, args);
|
||||||
|
|
||||||
// 获取物品配置
|
// 获取物品配置
|
||||||
const itemData = Items[hero_uuid];
|
const itemData = Items[hero_uuid];
|
||||||
@@ -67,13 +67,13 @@ export class ItemComp extends Component {
|
|||||||
*/
|
*/
|
||||||
private setItemIcon(iconPath: string) {
|
private setItemIcon(iconPath: string) {
|
||||||
let path=`gui/items/${iconPath}`
|
let path=`gui/items/${iconPath}`
|
||||||
console.log("[ItemComp]: setItemIcon", path);
|
// console.log("[ItemComp]: setItemIcon", path);
|
||||||
resources.load(path, SpriteFrame, (err, spriteFrame) => {
|
resources.load(path, SpriteFrame, (err, spriteFrame) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error("[ItemComp]: Failed to load item icon", iconPath, err);
|
console.error("[ItemComp]: Failed to load item icon", iconPath, err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log("[ItemComp]: setItemIcon", iconPath, spriteFrame);
|
// console.log("[ItemComp]: setItemIcon", iconPath, spriteFrame);
|
||||||
this.node.getChildByName("icon").getComponent(Sprite)!.spriteFrame = spriteFrame;
|
this.node.getChildByName("icon").getComponent(Sprite)!.spriteFrame = spriteFrame;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -139,7 +139,7 @@ export class ItemComp extends Component {
|
|||||||
* 物品点击事件
|
* 物品点击事件
|
||||||
*/
|
*/
|
||||||
do_click() {
|
do_click() {
|
||||||
console.log("[ItemComp]: Item clicked", this.item_uuid, this.item_count);
|
// console.log("[ItemComp]: Item clicked", this.item_uuid, this.item_count);
|
||||||
|
|
||||||
// 根据类型处理不同逻辑
|
// 根据类型处理不同逻辑
|
||||||
switch (this.type) {
|
switch (this.type) {
|
||||||
@@ -163,7 +163,7 @@ export class ItemComp extends Component {
|
|||||||
*/
|
*/
|
||||||
private onItemClick() {
|
private onItemClick() {
|
||||||
// 显示物品信息或执行其他逻辑
|
// 显示物品信息或执行其他逻辑
|
||||||
console.log("[ItemComp]: Show item info", this.item_uuid);
|
// console.log("[ItemComp]: Show item info", this.item_uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -171,7 +171,7 @@ export class ItemComp extends Component {
|
|||||||
*/
|
*/
|
||||||
private onItemSelect() {
|
private onItemSelect() {
|
||||||
// 处理物品选择逻辑
|
// 处理物品选择逻辑
|
||||||
console.log("[ItemComp]: Item selected", this.item_uuid);
|
// console.log("[ItemComp]: Item selected", this.item_uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -179,7 +179,7 @@ export class ItemComp extends Component {
|
|||||||
*/
|
*/
|
||||||
private onItemUse() {
|
private onItemUse() {
|
||||||
// 处理物品使用逻辑
|
// 处理物品使用逻辑
|
||||||
console.log("[ItemComp]: Use item", this.item_uuid);
|
// console.log("[ItemComp]: Use item", this.item_uuid);
|
||||||
}
|
}
|
||||||
show_item_info(){
|
show_item_info(){
|
||||||
if(this.no_show){
|
if(this.no_show){
|
||||||
|
|||||||
@@ -14,11 +14,11 @@ export class ItemInfoComp extends Component {
|
|||||||
private isListening: boolean = false;
|
private isListening: boolean = false;
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
console.log("[ItemInfoComp]:start");
|
// console.log("[ItemInfoComp]:start");
|
||||||
}
|
}
|
||||||
|
|
||||||
onAdded(args: any) {
|
onAdded(args: any) {
|
||||||
console.log("[ItemInfoComp]:onAdded", args);
|
// console.log("[ItemInfoComp]:onAdded", args);
|
||||||
this.setupTouchListener();
|
this.setupTouchListener();
|
||||||
this.update_data(args);
|
this.update_data(args);
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@ export class ItemInfoComp extends Component {
|
|||||||
this.touchListener = input.on(Input.EventType.TOUCH_START, this.onTouchStart, this);
|
this.touchListener = input.on(Input.EventType.TOUCH_START, this.onTouchStart, this);
|
||||||
this.isListening = true;
|
this.isListening = true;
|
||||||
|
|
||||||
console.log("[ItemInfoComp]: Touch listener setup");
|
// console.log("[ItemInfoComp]: Touch listener setup");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -52,7 +52,7 @@ export class ItemInfoComp extends Component {
|
|||||||
this.isListening = false;
|
this.isListening = false;
|
||||||
this.touchListener = null;
|
this.touchListener = null;
|
||||||
|
|
||||||
console.log("[ItemInfoComp]: Touch listener removed");
|
// console.log("[ItemInfoComp]: Touch listener removed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ export class ItemInfoComp extends Component {
|
|||||||
|
|
||||||
// 检查触摸点是否在弹窗范围内
|
// 检查触摸点是否在弹窗范围内
|
||||||
if (!this.isTouchInNodeBounds(touchPos, nodePos)) {
|
if (!this.isTouchInNodeBounds(touchPos, nodePos)) {
|
||||||
console.log("[ItemInfoComp]: Touch outside bounds, closing popup");
|
// console.log("[ItemInfoComp]: Touch outside bounds, closing popup");
|
||||||
this.closeItemInfo();
|
this.closeItemInfo();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -97,7 +97,7 @@ export class ItemInfoComp extends Component {
|
|||||||
* @param args 物品参数 {item_uuid: number, count?: number}
|
* @param args 物品参数 {item_uuid: number, count?: number}
|
||||||
*/
|
*/
|
||||||
update_data(args: any) {
|
update_data(args: any) {
|
||||||
console.log("[ItemInfoComp]:update_data", args);
|
// console.log("[ItemInfoComp]:update_data", args);
|
||||||
|
|
||||||
if (!args || !args.item_uuid) {
|
if (!args || !args.item_uuid) {
|
||||||
console.error("[ItemInfoComp]: Invalid args", args);
|
console.error("[ItemInfoComp]: Invalid args", args);
|
||||||
@@ -139,13 +139,13 @@ export class ItemInfoComp extends Component {
|
|||||||
*/
|
*/
|
||||||
private setItemIcon(iconPath: string) {
|
private setItemIcon(iconPath: string) {
|
||||||
let path=`gui/items/${iconPath}`
|
let path=`gui/items/${iconPath}`
|
||||||
console.log("[ItemComp]: setItemIcon", path);
|
// console.log("[ItemComp]: setItemIcon", path);
|
||||||
resources.load(path, SpriteFrame, (err, spriteFrame) => {
|
resources.load(path, SpriteFrame, (err, spriteFrame) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error("[ItemComp]: Failed to load item icon", iconPath, err);
|
console.error("[ItemComp]: Failed to load item icon", iconPath, err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log("[ItemComp]: setItemIcon", iconPath, spriteFrame);
|
// console.log("[ItemComp]: setItemIcon", iconPath, spriteFrame);
|
||||||
this.node.getChildByName("item").getChildByName("icon").getComponent(Sprite)!.spriteFrame = spriteFrame;
|
this.node.getChildByName("item").getChildByName("icon").getComponent(Sprite)!.spriteFrame = spriteFrame;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -268,7 +268,7 @@ export class ItemInfoComp extends Component {
|
|||||||
* 关闭物品信息弹窗
|
* 关闭物品信息弹窗
|
||||||
*/
|
*/
|
||||||
closeItemInfo() {
|
closeItemInfo() {
|
||||||
console.log("[ItemInfoComp]: Close item info");
|
// console.log("[ItemInfoComp]: Close item info");
|
||||||
this.removeTouchListener();
|
this.removeTouchListener();
|
||||||
oops.gui.removeByNode(this.node)
|
oops.gui.removeByNode(this.node)
|
||||||
}
|
}
|
||||||
@@ -277,7 +277,7 @@ export class ItemInfoComp extends Component {
|
|||||||
* 使用物品
|
* 使用物品
|
||||||
*/
|
*/
|
||||||
useItem() {
|
useItem() {
|
||||||
console.log("[ItemInfoComp]: Use item", this.item_uuid);
|
// console.log("[ItemInfoComp]: Use item", this.item_uuid);
|
||||||
// 这里可以添加使用物品的逻辑
|
// 这里可以添加使用物品的逻辑
|
||||||
// 比如消耗物品、触发效果等
|
// 比如消耗物品、触发效果等
|
||||||
}
|
}
|
||||||
@@ -286,7 +286,7 @@ export class ItemInfoComp extends Component {
|
|||||||
* 丢弃物品
|
* 丢弃物品
|
||||||
*/
|
*/
|
||||||
dropItem() {
|
dropItem() {
|
||||||
console.log("[ItemInfoComp]: Drop item", this.item_uuid);
|
// console.log("[ItemInfoComp]: Drop item", this.item_uuid);
|
||||||
// 这里可以添加丢弃物品的逻辑
|
// 这里可以添加丢弃物品的逻辑
|
||||||
// 比如从背包中移除、显示确认对话框等
|
// 比如从背包中移除、显示确认对话框等
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export class LuckCardComp extends Component {
|
|||||||
timer:number=3;
|
timer:number=3;
|
||||||
start() {
|
start() {
|
||||||
this.timer=2
|
this.timer=2
|
||||||
console.log("[LuckCardComp]:start")
|
// console.log("[LuckCardComp]:start")
|
||||||
}
|
}
|
||||||
|
|
||||||
update(deltaTime: number) {
|
update(deltaTime: number) {
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export class MSkillComp extends CCComp {
|
|||||||
this.fight_ready()
|
this.fight_ready()
|
||||||
}
|
}
|
||||||
private master_called(e:any,data:any){
|
private master_called(e:any,data:any){
|
||||||
console.log("[EquipSkillComp]: master_called",data)
|
// console.log("[EquipSkillComp]: master_called",data)
|
||||||
let hero=HeroInfo[data.uuid]
|
let hero=HeroInfo[data.uuid]
|
||||||
if(hero.skills.length>0){
|
if(hero.skills.length>0){
|
||||||
this.get_skill(null,{slot:this.skill_slot,uuid:hero.skills[this.skill_slot_index]})
|
this.get_skill(null,{slot:this.skill_slot,uuid:hero.skills[this.skill_slot_index]})
|
||||||
@@ -40,7 +40,7 @@ export class MSkillComp extends CCComp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fight_ready(){
|
fight_ready(){
|
||||||
console.log("[MSkillComp]: fight_ready",this.node)
|
// console.log("[MSkillComp]: fight_ready",this.node)
|
||||||
this.node.getChildByName("icon").active=false
|
this.node.getChildByName("icon").active=false
|
||||||
this.hide_skill_get(null,"skill1")
|
this.hide_skill_get(null,"skill1")
|
||||||
this.skill={
|
this.skill={
|
||||||
@@ -70,7 +70,7 @@ export class MSkillComp extends CCComp {
|
|||||||
this.node.getComponent(Animation).stop()
|
this.node.getComponent(Animation).stop()
|
||||||
}
|
}
|
||||||
spell_skill(){
|
spell_skill(){
|
||||||
console.log("spell_skill")
|
// console.log("spell_skill")
|
||||||
this.skill.cd_time=0
|
this.skill.cd_time=0
|
||||||
tween(this.node).to(0.1, {scale:v3(1.2,1.2,1)},{onComplete:()=>{
|
tween(this.node).to(0.1, {scale:v3(1.2,1.2,1)},{onComplete:()=>{
|
||||||
tween(this.node).to(0.2, {scale:v3(1,1,1)}).start()
|
tween(this.node).to(0.2, {scale:v3(1,1,1)}).start()
|
||||||
@@ -84,7 +84,7 @@ export class MSkillComp extends CCComp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get_skill(e:GameEvent,data:any){
|
get_skill(e:GameEvent,data:any){
|
||||||
console.log("[MSkillComp]: get_skill",data)
|
// console.log("[MSkillComp]: get_skill",data)
|
||||||
if(data.slot==this.skill_slot||this.skill_slot_index==data.slot){
|
if(data.slot==this.skill_slot||this.skill_slot_index==data.slot){
|
||||||
this.skill.uuid=data.uuid
|
this.skill.uuid=data.uuid
|
||||||
this.skill.skill_name=SkillSet[data.uuid].name
|
this.skill.skill_name=SkillSet[data.uuid].name
|
||||||
@@ -110,7 +110,7 @@ export class MSkillComp extends CCComp {
|
|||||||
|
|
||||||
|
|
||||||
show_info(e:any,data:any){
|
show_info(e:any,data:any){
|
||||||
console.log("[MSkillComp]: show_info",this.skill)
|
// console.log("[MSkillComp]: show_info",this.skill)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export class MissionComp extends CCComp {
|
|||||||
// 奖励发放
|
// 奖励发放
|
||||||
}
|
}
|
||||||
do_drop(drop_item:any[],game_data:any={exp:0,gold:0,diamond:0}){
|
do_drop(drop_item:any[],game_data:any={exp:0,gold:0,diamond:0}){
|
||||||
console.log("[MissionComp] do_drop",drop_item,game_data)
|
// console.log("[MissionComp] do_drop",drop_item,game_data)
|
||||||
this.game_data["exp"]+=game_data.exp
|
this.game_data["exp"]+=game_data.exp
|
||||||
this.game_data["gold"]+=game_data.gold
|
this.game_data["gold"]+=game_data.gold
|
||||||
this.game_data["diamond"]+=game_data.diamond
|
this.game_data["diamond"]+=game_data.diamond
|
||||||
@@ -83,7 +83,7 @@ export class MissionComp extends CCComp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(drop_item.length>0){
|
if(drop_item.length>0){
|
||||||
console.log("[MissionComp] do_drop 剩余物品",drop_item)
|
// console.log("[MissionComp] do_drop 剩余物品",drop_item)
|
||||||
for(let i=0;i<drop_item.length;i++){
|
for(let i=0;i<drop_item.length;i++){
|
||||||
let d_item=drop_item[i]
|
let d_item=drop_item[i]
|
||||||
let path="game/gui/item"
|
let path="game/gui/item"
|
||||||
@@ -99,7 +99,7 @@ export class MissionComp extends CCComp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
do_mon_dead(event:any,data:any){
|
do_mon_dead(event:any,data:any){
|
||||||
console.log("[MissionComp] do_mon_dead",event,data)
|
// console.log("[MissionComp] do_mon_dead",event,data)
|
||||||
smc.vmdata.mission_data.mon_num--
|
smc.vmdata.mission_data.mon_num--
|
||||||
if(data.drops){
|
if(data.drops){
|
||||||
if(data.drops.length>0){
|
if(data.drops.length>0){
|
||||||
@@ -119,7 +119,7 @@ export class MissionComp extends CCComp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
do_hero_dead(event:any,data:any){
|
do_hero_dead(event:any,data:any){
|
||||||
console.log("[MissionComp] do_hero_dead",event,data)
|
// console.log("[MissionComp] do_hero_dead",event,data)
|
||||||
smc.vmdata.mission_data.hero_num--
|
smc.vmdata.mission_data.hero_num--
|
||||||
if(smc.vmdata.mission_data.hero_num<=0) {
|
if(smc.vmdata.mission_data.hero_num<=0) {
|
||||||
oops.message.dispatchEvent(GameEvent.FightEnd,{victory:false})
|
oops.message.dispatchEvent(GameEvent.FightEnd,{victory:false})
|
||||||
@@ -143,7 +143,7 @@ export class MissionComp extends CCComp {
|
|||||||
|
|
||||||
|
|
||||||
async mission_start(){
|
async mission_start(){
|
||||||
console.log("[MissionComp] ** 1 ** mission_start")
|
// console.log("[MissionComp] ** 1 ** mission_start")
|
||||||
this.node.getChildByName("ending").getComponent(Animation).play("startFight")
|
this.node.getChildByName("ending").getComponent(Animation).play("startFight")
|
||||||
oops.message.dispatchEvent(GameEvent.FightReady)
|
oops.message.dispatchEvent(GameEvent.FightReady)
|
||||||
this.node.active=true
|
this.node.active=true
|
||||||
@@ -172,7 +172,7 @@ export class MissionComp extends CCComp {
|
|||||||
|
|
||||||
|
|
||||||
fight_end(){
|
fight_end(){
|
||||||
console.log("任务结束")
|
// console.log("任务结束")
|
||||||
// 延迟0.5秒后执行任务结束逻辑
|
// 延迟0.5秒后执行任务结束逻辑
|
||||||
this.scheduleOnce(() => {
|
this.scheduleOnce(() => {
|
||||||
smc.mission.play=false
|
smc.mission.play=false
|
||||||
@@ -182,7 +182,7 @@ export class MissionComp extends CCComp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mission_end(){
|
mission_end(){
|
||||||
console.log("[MissionComp] mission_end")
|
// console.log("[MissionComp] mission_end")
|
||||||
this.node.getChildByName("ending").active=false
|
this.node.getChildByName("ending").active=false
|
||||||
this.node.active=false
|
this.node.active=false
|
||||||
}
|
}
|
||||||
@@ -195,7 +195,7 @@ export class MissionComp extends CCComp {
|
|||||||
smc.vmdata.mission_data.level=0
|
smc.vmdata.mission_data.level=0
|
||||||
this.rewards=[] // 改为数组,用于存储掉落物品列表
|
this.rewards=[] // 改为数组,用于存储掉落物品列表
|
||||||
this.node.getChildByName("reward").getChildByName("items").removeAllChildren()
|
this.node.getChildByName("reward").getChildByName("items").removeAllChildren()
|
||||||
console.log("[MissionComp]局内数据初始化",smc.vmdata.mission_data)
|
// console.log("[MissionComp]局内数据初始化",smc.vmdata.mission_data)
|
||||||
}
|
}
|
||||||
|
|
||||||
private cleanComponents() {
|
private cleanComponents() {
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export class MissionHeroCompComp extends CCComp {
|
|||||||
// this.test_call()
|
// this.test_call()
|
||||||
}
|
}
|
||||||
clear_heros(){
|
clear_heros(){
|
||||||
console.log("[MissionHeroComp]: FightEnd clear heros")
|
// console.log("[MissionHeroComp]: FightEnd clear heros")
|
||||||
|
|
||||||
}
|
}
|
||||||
fight_ready(){
|
fight_ready(){
|
||||||
@@ -47,11 +47,11 @@ export class MissionHeroCompComp extends CCComp {
|
|||||||
// this.current_hero_num=-1
|
// this.current_hero_num=-1
|
||||||
// this.current_hero_uuid=0
|
// this.current_hero_uuid=0
|
||||||
smc.vmdata.mission_data.hero_num=0
|
smc.vmdata.mission_data.hero_num=0
|
||||||
console.log("[MissionHeroComp]:fight_ready",smc.fight_heros,Object.keys(smc.fight_heros).length)
|
// console.log("[MissionHeroComp]:fight_ready",smc.fight_heros,Object.keys(smc.fight_heros).length)
|
||||||
let heros:any = smc.fight_heros
|
let heros:any = smc.fight_heros
|
||||||
for(let i=0;i<Object.keys(heros).length;i++){
|
for(let i=0;i<Object.keys(heros).length;i++){
|
||||||
if(heros[i]!=0){
|
if(heros[i]!=0){
|
||||||
console.log("[MissionHeroComp]:fight_ready",heros[i])
|
// console.log("[MissionHeroComp]:fight_ready",heros[i])
|
||||||
this.addHero(heros[i],false)
|
this.addHero(heros[i],false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -65,7 +65,7 @@ export class MissionHeroCompComp extends CCComp {
|
|||||||
|
|
||||||
|
|
||||||
private zhao_huan(event: string, args: any){
|
private zhao_huan(event: string, args: any){
|
||||||
console.log("[MissionHeroComp]:zhaohuan",args)
|
// console.log("[MissionHeroComp]:zhaohuan",args)
|
||||||
this.addHero(args.uuid,false)
|
this.addHero(args.uuid,false)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ export class MissionHeroCompComp extends CCComp {
|
|||||||
|
|
||||||
|
|
||||||
call_hero(event: string, args: any){
|
call_hero(event: string, args: any){
|
||||||
console.log("[MissionHeroComp]:call_hero",this.heros,this.current_hero_num,args)
|
// console.log("[MissionHeroComp]:call_hero",this.heros,this.current_hero_num,args)
|
||||||
|
|
||||||
// 尝试升级现有英雄
|
// 尝试升级现有英雄
|
||||||
if (this.tryUpgradeExistingHero(args.uuid)) {
|
if (this.tryUpgradeExistingHero(args.uuid)) {
|
||||||
@@ -92,7 +92,7 @@ export class MissionHeroCompComp extends CCComp {
|
|||||||
*/
|
*/
|
||||||
private tryUpgradeExistingHero(uuid: number): boolean {
|
private tryUpgradeExistingHero(uuid: number): boolean {
|
||||||
for (let i = 0; i < this.heros.length; i++) {
|
for (let i = 0; i < this.heros.length; i++) {
|
||||||
console.log("[MissionHeroComp]:tryUpgradeExistingHero",this.heros,i,uuid)
|
// console.log("[MissionHeroComp]:tryUpgradeExistingHero",this.heros,i,uuid)
|
||||||
if (this.heros[i].uuid === uuid) {
|
if (this.heros[i].uuid === uuid) {
|
||||||
this.heros[i].count++
|
this.heros[i].count++
|
||||||
smc.vmdata[`hero${i+1}`].count=this.heros[i].count
|
smc.vmdata[`hero${i+1}`].count=this.heros[i].count
|
||||||
@@ -119,7 +119,7 @@ export class MissionHeroCompComp extends CCComp {
|
|||||||
|
|
||||||
/** 添加英雄 */
|
/** 添加英雄 */
|
||||||
private addHero(uuid:number=1001,is_zhaohuan:boolean=false) {
|
private addHero(uuid:number=1001,is_zhaohuan:boolean=false) {
|
||||||
console.log("[MissionHeroComp]:addHero",uuid,is_zhaohuan)
|
// console.log("[MissionHeroComp]:addHero",uuid,is_zhaohuan)
|
||||||
let hero_pos=0
|
let hero_pos=0
|
||||||
let hero = ecs.getEntity<Hero>(Hero);
|
let hero = ecs.getEntity<Hero>(Hero);
|
||||||
let scale = 1
|
let scale = 1
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 使
|
|||||||
let level=smc.vmdata.mission_data.level
|
let level=smc.vmdata.mission_data.level
|
||||||
const stageType = getStageType(currentStage,level);
|
const stageType = getStageType(currentStage,level);
|
||||||
const monsterConfigs = getStageMonsterConfigs(currentStage,level);
|
const monsterConfigs = getStageMonsterConfigs(currentStage,level);
|
||||||
console.log(`[MissionMonComp]:第${currentStage}关 - ${stageType}类型,怪物数量: ${monsterConfigs.length}`);
|
// console.log(`[MissionMonComp]:第${currentStage}关 - ${stageType}类型,怪物数量: ${monsterConfigs.length}`);
|
||||||
this.generateMonstersFromStageConfig(monsterConfigs);
|
this.generateMonstersFromStageConfig(monsterConfigs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@ export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 使
|
|||||||
const currentStage = smc.data.mission;
|
const currentStage = smc.data.mission;
|
||||||
|
|
||||||
// 设置怪物总数
|
// 设置怪物总数
|
||||||
console.log("[MissionMonComp] generateMonstersFromStageConfig",monsterConfigs)
|
// console.log("[MissionMonComp] generateMonstersFromStageConfig",monsterConfigs)
|
||||||
if (!monsterConfigs || monsterConfigs.length === 0) {
|
if (!monsterConfigs || monsterConfigs.length === 0) {
|
||||||
console.warn(`[MissionMonComp]:关卡${currentStage}配置中没有怪物信息`);
|
console.warn(`[MissionMonComp]:关卡${currentStage}配置中没有怪物信息`);
|
||||||
return;
|
return;
|
||||||
@@ -139,13 +139,13 @@ export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 使
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(`[MissionMonComp]:关卡${currentStage}将生成 ${monsterConfigs.length} 只怪物`);
|
// console.log(`[MissionMonComp]:关卡${currentStage}将生成 ${monsterConfigs.length} 只怪物`);
|
||||||
|
|
||||||
// 输出增强属性信息
|
// 输出增强属性信息
|
||||||
monsterConfigs.forEach((monsterConfig: any) => {
|
monsterConfigs.forEach((monsterConfig: any) => {
|
||||||
if (monsterConfig.enhancement && monsterConfig.enhancement.buffList.length > 0) {
|
if (monsterConfig.enhancement && monsterConfig.enhancement.buffList.length > 0) {
|
||||||
console.log(`[MissionMonComp]:怪物 ${monsterConfig.uuid} (${monsterConfig.type}) 拥有增强属性:`,
|
// console.log(`[MissionMonComp]:怪物 ${monsterConfig.uuid} (${monsterConfig.type}) 拥有增强属性:`,
|
||||||
monsterConfig.enhancement.buffList.map((buff: any) => `${buff.name}:+${buff.value}`));
|
// monsterConfig.enhancement.buffList.map((buff: any) => `${buff.name}:+${buff.value}`));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -189,7 +189,7 @@ export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 使
|
|||||||
|
|
||||||
// 增加召唤计数
|
// 增加召唤计数
|
||||||
this.spawnCount++;
|
this.spawnCount++;
|
||||||
console.log(`[MissionMonComp]: 召唤第${this.spawnCount}只${monsterData.type}怪物,剩余队列: ${this.monsterQueue.length}`);
|
// console.log(`[MissionMonComp]: 召唤第${this.spawnCount}只${monsterData.type}怪物,剩余队列: ${this.monsterQueue.length}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,13 +211,13 @@ export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 使
|
|||||||
|
|
||||||
// 如果有增强属性,记录到控制台
|
// 如果有增强属性,记录到控制台
|
||||||
if (enhancement && enhancement.buffList && enhancement.buffList.length > 0) {
|
if (enhancement && enhancement.buffList && enhancement.buffList.length > 0) {
|
||||||
console.log(`[MissionMonComp]: 怪物 ${uuid} 获得增强属性:`,
|
// console.log(`[MissionMonComp]: 怪物 ${uuid} 获得增强属性:`,
|
||||||
enhancement.buffList.map((buff: any) => `${buff.name}:+${buff.value}`));
|
// enhancement.buffList.map((buff: any) => `${buff.name}:+${buff.value}`));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果有关卡倍数,记录到控制台
|
// 如果有关卡倍数,记录到控制台
|
||||||
if (stageMultipliers) {
|
if (stageMultipliers) {
|
||||||
console.log(`[MissionMonComp]: 怪物 ${uuid} 关卡倍数 - HP: x${stageMultipliers.hp.toFixed(2)}, 攻击: x${stageMultipliers.attack.toFixed(2)}`);
|
// console.log(`[MissionMonComp]: 怪物 ${uuid} 关卡倍数 - HP: x${stageMultipliers.hp.toFixed(2)}, 攻击: x${stageMultipliers.attack.toFixed(2)}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export class VictoryComp extends CCComp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onAdded(args: any) {
|
onAdded(args: any) {
|
||||||
console.log("[VictoryComp] onAdded",args,smc.items)
|
// console.log("[VictoryComp] onAdded",args,smc.items)
|
||||||
if(args.game_data){
|
if(args.game_data){
|
||||||
this.game_data=args.game_data
|
this.game_data=args.game_data
|
||||||
}
|
}
|
||||||
@@ -90,7 +90,7 @@ export class VictoryComp extends CCComp {
|
|||||||
})
|
})
|
||||||
this.node.getChildByName("btns").getChildByName("double").active=false
|
this.node.getChildByName("btns").getChildByName("double").active=false
|
||||||
}
|
}
|
||||||
console.log("[VictoryComp]double_reward",smc.items,this.rewards)
|
// console.log("[VictoryComp]double_reward",smc.items,this.rewards)
|
||||||
}
|
}
|
||||||
restart(){
|
restart(){
|
||||||
this.clear_data()
|
this.clear_data()
|
||||||
@@ -99,11 +99,11 @@ export class VictoryComp extends CCComp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
item_show(e:any,val:any){
|
item_show(e:any,val:any){
|
||||||
console.log("item_show",val)
|
// console.log("item_show",val)
|
||||||
}
|
}
|
||||||
|
|
||||||
protected onDestroy(): void {
|
protected onDestroy(): void {
|
||||||
console.log("释放胜利界面");
|
// console.log("释放胜利界面");
|
||||||
}
|
}
|
||||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||||
reset() {
|
reset() {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
// /** 施放技能 */
|
// /** 施放技能 */
|
||||||
// private castSkill(caster: ecs.Entity, skillId: number, config: typeof SkillSet[keyof typeof SkillSet]) {
|
// private castSkill(caster: ecs.Entity, skillId: number, config: typeof SkillSet[keyof typeof SkillSet]) {
|
||||||
// const view = caster.get(HeroViewComp);
|
// const view = caster.get(HeroViewComp);
|
||||||
// console.log(view.uuid+"=>"+view.hero_name+"施放技能:"+config.uuid);
|
// // console.log(view.uuid+"=>"+view.hero_name+"施放技能:"+config.uuid);
|
||||||
// if (config.TGroup === TGroup.Enemy) {
|
// if (config.TGroup === TGroup.Enemy) {
|
||||||
// caster.get(HeroViewComp).playSkillEffect(config.uuid);
|
// caster.get(HeroViewComp).playSkillEffect(config.uuid);
|
||||||
// this.doSkill(caster,config);
|
// this.doSkill(caster,config);
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
// new Vec3(targets[0]?.get(HeroViewComp).node.position.x, targets[0]?.get(HeroViewComp).node.position.y, 0), // 目标位置
|
// new Vec3(targets[0]?.get(HeroViewComp).node.position.x, targets[0]?.get(HeroViewComp).node.position.y, 0), // 目标位置
|
||||||
// view
|
// view
|
||||||
// );
|
// );
|
||||||
// console.log("技能:"+config.uuid+"=>"+targets[0]?.get(HeroViewComp).hero_name);
|
// // console.log("技能:"+config.uuid+"=>"+targets[0]?.get(HeroViewComp).hero_name);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// private selectEnemyTargets(caster: ecs.Entity, config: typeof SkillSet[keyof typeof SkillSet]): ecs.Entity[] {
|
// private selectEnemyTargets(caster: ecs.Entity, config: typeof SkillSet[keyof typeof SkillSet]): ecs.Entity[] {
|
||||||
@@ -120,7 +120,7 @@
|
|||||||
|
|
||||||
|
|
||||||
// public clear_timer() {
|
// public clear_timer() {
|
||||||
// console.log("clear_timer");
|
// // console.log("clear_timer");
|
||||||
// Object.values(this._timers).forEach(clearTimeout);
|
// Object.values(this._timers).forEach(clearTimeout);
|
||||||
// }
|
// }
|
||||||
// onDestroy() {
|
// onDestroy() {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export class AnmEndCom extends Component {
|
|||||||
|
|
||||||
if(this.node.getComponent(Animation)){
|
if(this.node.getComponent(Animation)){
|
||||||
let anim = this.node.getComponent(Animation);
|
let anim = this.node.getComponent(Animation);
|
||||||
console.log("has anim",anim)
|
// console.log("has anim",anim)
|
||||||
anim.on(Animation.EventType.FINISHED, this.onAnimationFinished, this);
|
anim.on(Animation.EventType.FINISHED, this.onAnimationFinished, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ export class debuff extends Component {
|
|||||||
if(this.deff_cd >=1){
|
if(this.deff_cd >=1){
|
||||||
// this.node.setPosition(v3(-1000,0,0))
|
// this.node.setPosition(v3(-1000,0,0))
|
||||||
if(this.hero){
|
if(this.hero){
|
||||||
this.hero.in_atked()
|
// this.hero.in_atked()
|
||||||
this.hero.hp_less(Math.ceil(this.base.ap/this.base.time))
|
// this.hero.hp_less(Math.ceil(this.base.ap/this.base.time))
|
||||||
console.log("debuff 总扣血:"+this.base.ap+" 每秒: "+Math.ceil(this.base.ap/this.base.time))
|
// console.log("debuff 总扣血:"+this.base.ap+" 每秒: "+Math.ceil(this.base.ap/this.base.time))
|
||||||
}
|
}
|
||||||
this.deff_cd=0
|
this.deff_cd=0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,13 +81,13 @@ async function getOrCreaterUser(db, openid) {
|
|||||||
});
|
});
|
||||||
userData._id = addResult._id;
|
userData._id = addResult._id;
|
||||||
|
|
||||||
console.log(`新用户已创建: ${openid}, 版本: ${initData.data_version}`);
|
// console.log(`新用户已创建: ${openid}, 版本: ${initData.data_version}`);
|
||||||
} else {
|
} else {
|
||||||
userData = res.data[0];
|
userData = res.data[0];
|
||||||
|
|
||||||
// 检查数据版本兼容性
|
// 检查数据版本兼容性
|
||||||
const versionCheck = checkDataVersionCompatibility(userData.data_version);
|
const versionCheck = checkDataVersionCompatibility(userData.data_version);
|
||||||
console.log(`用户 ${openid} 数据版本检查:`, versionCheck);
|
// console.log(`用户 ${openid} 数据版本检查:`, versionCheck);
|
||||||
|
|
||||||
if (versionCheck.needsUpgrade) {
|
if (versionCheck.needsUpgrade) {
|
||||||
// 使用新的数据管理系统合并和升级数据
|
// 使用新的数据管理系统合并和升级数据
|
||||||
@@ -110,7 +110,7 @@ async function getOrCreaterUser(db, openid) {
|
|||||||
userData.equips = upgradedData.equips;
|
userData.equips = upgradedData.equips;
|
||||||
userData.data_version = upgradedData.data_version;
|
userData.data_version = upgradedData.data_version;
|
||||||
|
|
||||||
console.log(`用户 ${openid} 数据已升级到版本: ${upgradedData.data_version}`);
|
// console.log(`用户 ${openid} 数据已升级到版本: ${upgradedData.data_version}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user