错误版本

This commit is contained in:
panw
2025-08-14 15:47:47 +08:00
parent 3b4ce5b33e
commit 96ae0481d1
16 changed files with 17974 additions and 15860 deletions

View File

@@ -37,9 +37,9 @@ export class SingletonModuleComp extends ecs.Comp {
4:0,
}
heros:any = {
5001:{lv:1},
5005:{lv:1},
5007:{lv:1},
5001:{lv:1,slv:0},
5005:{lv:1,slv:0},
5007:{lv:1,slv:0},
};
monsters:any = [];

View File

@@ -5,6 +5,9 @@
* @LastEditTime: 2022-01-26 16:42:00
*/
import { Quality } from "./CardSet";
import { HQuality } from "./heroSet";
/** 碰撞分组 */
export enum BoxSet {
//物理碰撞tag
@@ -69,4 +72,20 @@ export const ColorSet: { [key: string]: string } = {
GREEN2: "00A373",
PURPLE1: "7251A6",
PURPLE2: "906CCE",
};
}
export const getColor=(quality:number)=>{
switch(quality){
case HQuality.GREEN:
return [ColorSet.GREEN1,ColorSet.GREEN2]
case HQuality.BLUE:
return [ColorSet.BLUE1,ColorSet.BLUE2]
case HQuality.PURPLE:
return [ColorSet.PURPLE1,ColorSet.PURPLE2]
case HQuality.RED:
return [ColorSet.RED1,ColorSet.RED2]
case HQuality.YELLOW:
return [ColorSet.YELLOW,ColorSet.YELLOW2]
default:
return [ColorSet.WHITE,ColorSet.WHITE]
}
}

View File

@@ -56,7 +56,8 @@ export const HQuality = {
GREEN:2,
BLUE:3,
PURPLE:4,
ORANGE:5,
RED:5,
YELLOW:6,
}
export const MonSet = {
0:{pos:v3(160,0,0)},

View File

@@ -1,9 +1,11 @@
import { _decorator, Color, Component, Label, Node, resources, Sprite, SpriteAtlas } from 'cc';
import { _decorator, Animation, AnimationClip, Color, Component, Label, Node, resources, Sprite, SpriteAtlas } from 'cc';
import { HeroInfo } from '../common/config/heroSet';
import { oops } from '../../../../extensions/oops-plugin-framework/assets/core/Oops';
import { UIID } from '../common/config/GameUIConfig';
import { Items } from '../common/config/Items';
import { ColorSet } from '../common/config/BoxSet';
import { ColorSet, getColor } from '../common/config/BoxSet';
import { smc } from '../common/SingletonModuleComp';
import { GameEvent } from '../common/config/GameEvent';
const { ccclass, property } = _decorator;
@ccclass('HChipComp')
@@ -12,32 +14,38 @@ export class HChipComp extends Component {
num:number=0
lv:number=0
start() {
oops.message.on(GameEvent.UpdateHero,this.update_hero,this)
}
update(deltaTime: number) {
}
show_info(){
if(this.node.parent.name=="item_info") return
oops.gui.open(UIID.ItemInfo, {uuid:this.h_uuid,type:2});
// oops.gui.open(UIID.ItemInfo, {uuid:this.h_uuid,type:2});
}
update_data(uuid:number,num:number=0){
this.h_uuid = uuid;
var icon_path = "game/heros/herois"
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
const sprite = this.node.getChildByName("hero").getChildByName("icon").getComponent(Sprite);
sprite.spriteFrame = atlas.getSpriteFrame(HeroInfo[uuid].path);
});
if(num > 1){
this.node.getChildByName("num").getComponent(Label).string = num.toString();
}else{
this.node.getChildByName("num").getComponent(Label).string = "";
update_hero(e:string,data:any){
if(this.h_uuid==data.uuid){
this.update_data(data.uuid)
}
this.node.getChildByName("g1").active=HeroInfo[uuid].quality==1
this.node.getChildByName("g2").active=HeroInfo[uuid].quality==2
this.node.getChildByName("g3").active=HeroInfo[uuid].quality==3
}
update_data(uuid:number){
this.h_uuid=uuid
let hero_data = HeroInfo[uuid]
let hero= this.node.getChildByName("hero")
let anm_path=hero_data.path
resources.load("game/heros/hero/"+anm_path+"/idle", AnimationClip, (err, clip) => {
hero.getComponent(Animation).addClip(clip);
hero.getComponent(Animation).play("idle");
});
this.node.getChildByName("name").getComponent(Label).string=hero_data.name
this.node.getChildByName("lv").getChildByName("num").getComponent(Label).string=smc.heros[uuid].lv.toString()
this.node.getChildByName("slv").getChildByName("lv1").active=smc.heros[uuid].slv>=1
this.node.getChildByName("slv").getChildByName("lv2").active=smc.heros[uuid].slv>=2
this.node.getChildByName("slv").getChildByName("lv3").active=smc.heros[uuid].slv>=3
this.node.getChildByName("slv").getChildByName("lv4").active=smc.heros[uuid].slv>=4
this.node.getChildByName("slv").getChildByName("lv5").active=smc.heros[uuid].slv>=5
this.node.getChildByName("bg").getComponent(Sprite).color=Color[getColor(hero_data.quality)[0]]
this.node.getChildByName("bgg").getComponent(Sprite).color=Color[getColor(hero_data.quality)[1]]
}
}

View File

@@ -48,7 +48,6 @@ export class CardControllerComp extends CCComp {
this.node.getChildByName("mission_home").active = true
let mission=this.node.getChildByName("mission")
mission.active = false
mission_home.load_ui_heros()
}
show_hero_home(){
let hero_home=this.node.getChildByName("hero_home")

View File

@@ -0,0 +1,14 @@
import { _decorator, Component, Node } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('HeroPageCom')
export class HeroPageCom extends Component {
start() {
}
update(deltaTime: number) {
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "dc69fd33-16d1-4c08-a2ce-1303c31abe3c",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -266,8 +266,8 @@ export function getMonsterUUIDsByType(monsterType: MonsterType): number[] {
case MonsterType.BOSS:
// 紫色及以上品质为Boss怪物
const purpleMonsters = getMonList(HQuality.PURPLE);
const orangeMonsters = getMonList(HQuality.ORANGE);
return [...purpleMonsters, ...orangeMonsters];
const redMonsters = getMonList(HQuality.RED);
return [...purpleMonsters, ...redMonsters];
default:
return [];
}