ui调整,背景地图调整

This commit is contained in:
2025-10-26 23:56:37 +08:00
parent ef4099b873
commit c05e26b101
13 changed files with 12680 additions and 1268 deletions

View File

@@ -1,9 +0,0 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "900676d0-c788-4ab0-8741-c7fd8ac75169",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -1,8 +1,7 @@
import { v3 } from "cc"
import { FacSet } from "./BoxSet"
import { smc } from "../SingletonModuleComp"
import { BuffConf, DbuffConf, Attrs } from "./SkillSet"
import { debuff } from "../../skills/debuff"
import { BuffConf } from "./SkillSet"
export enum AttrSet {
ATTR_MAX = 85,
@@ -66,20 +65,35 @@ export const MonSet = {
export enum HeroConf{
COST=1500,
MAX_HP=200,
MAX_MP=200,
MAX_AP=20,
MAX_MAP=20,
MAX_DEF=20,
MAX_MDEF=20,
}
export const getPreAttr = (uuid:number)=>{
let hp=HeroInfo[uuid].hp/HeroConf.MAX_HP
let mp=HeroInfo[uuid].mp/HeroConf.MAX_MP
let ap=HeroInfo[uuid].ap/HeroConf.MAX_AP
let map=HeroInfo[uuid].map/HeroConf.MAX_MAP
let def=HeroInfo[uuid].def/HeroConf.MAX_DEF
let mdef=HeroInfo[uuid].mdef/HeroConf.MAX_MDEF
return {hp:hp,mp:mp,ap:ap,map:map,def:def,mdef:mdef}
}
export enum HeroUpSet {
MP=5,
HP=10,
LVMP=100,
LVHP=100,
LVATK=10,
LVDEF=5,
MP=5,
HP=10,
LVMP=100,
LVHP=100,
LVATK=10,
LVDEF=5,
}
export interface heroInfo{
uuid:number, name:string, path:string,fac:FacSet,kind:number,type:HType,
hp:number,mp:number,map:number, def:number, ap:number,dis:number, speed:number,lv:number,skills:number[],
buff:BuffConf[], debuff:DbuffConf[], info:string
hp:number,mp:number, ap:number,map:number, def:number,mdef:number,dis:number, speed:number,lv:number,skills:number[],
buff:BuffConf[], info:string
}
export const HeroInfo: Record<number, heroInfo> = {
@@ -87,52 +101,52 @@ export const HeroInfo: Record<number, heroInfo> = {
// 刘邦 - 领导型战士(善于用人,知人善任)
5001:{uuid:5001,name:"刘邦",path:"hk1", fac:FacSet.HERO, kind:1,
type:HType.warrior,lv:1,hp:120,mp:80,map:10,def:8,ap:15,dis:100,speed:120,skills:[6001,6005],
buff:[],debuff:[],info:"汉朝开国皇帝,善于用人,领导型战士"},
type:HType.warrior,lv:1,hp:120,mp:80,map:10,def:8,mdef:0,ap:15,dis:100,speed:120,skills:[6001,6005],
buff:[],info:"汉朝开国皇帝,善于用人,领导型战士"},
// 荆轲 - 刺客(敏捷型,高速度和暴击率)
5002:{uuid:5002,name:"荆轲",path:"hc1", fac:FacSet.HERO, kind:1,
type:HType.assassin,lv:1,hp:80,mp:60,map:5,def:3,ap:20,dis:120,speed:180,skills:[6001,6005],
buff:[],debuff:[],info:"战国刺客,高速度高暴击的敏捷型刺客"},
type:HType.assassin,lv:1,hp:80,mp:60,map:5,def:3,mdef:0,ap:20,dis:120,speed:180,skills:[6001,6005],
buff:[],info:"战国刺客,高速度高暴击的敏捷型刺客"},
// 绿箭 - 远程射手(机动型,高移动速度和远程攻击)
5005:{uuid:5005,name:"绿箭",path:"ha1", fac:FacSet.HERO, kind:2,
type:HType.remote,lv:1,hp:90,mp:70,map:8,def:4,ap:18,dis:450,speed:140,skills:[6001,6005],
buff:[],debuff:[],info:"远程射手,机动型高远程输出"},
type:HType.remote,lv:1,hp:90,mp:70,map:8,def:4,mdef:0,ap:18,dis:450,speed:140,skills:[6001,6005],
buff:[],info:"远程射手,机动型高远程输出"},
// 牧师 - 辅助治疗(辅助型,擅长治疗和支援)
5007:{uuid:5007,name:"牧师",path:"hh1", fac:FacSet.HERO, kind:2,
type:HType.support,lv:1,hp:100,mp:120,map:12,def:5,ap:8,dis:350,speed:100,skills:[6001,6005],
buff:[],debuff:[],info:"辅助治疗者,擅长治疗和支援队友"},
type:HType.support,lv:1,hp:100,mp:120,map:12,def:5,mdef:0,ap:8,dis:350,speed:100,skills:[6001,6005],
buff:[],info:"辅助治疗者,擅长治疗和支援队友"},
// 火女 - 元素法师(元素型,操控火焰元素)
5008:{uuid:5008,name:"火女",path:"hm1", fac:FacSet.HERO, kind:2,
type:HType.mage,lv:1,hp:85,mp:150,map:25,def:3,ap:6,dis:400,speed:90,skills:[6001,6005],
buff:[],debuff:[],info:"元素法师,操控火焰元素进行高魔法输出"},
type:HType.mage,lv:1,hp:85,mp:150,map:25,def:3,mdef:0,ap:6,dis:400,speed:90,skills:[6001,6005],
buff:[],info:"元素法师,操控火焰元素进行高魔法输出"},
// 魔法精灵 - 奥术法师(博学型,掌握多种魔法)
5009:{uuid:5009,name:"魔法精灵",path:"hm2", fac:FacSet.HERO, kind:2,
type:HType.mage,lv:1,hp:80,mp:160,map:28,def:2,ap:5,dis:420,speed:95,skills:[6001,6005],
buff:[],debuff:[],info:"奥术法师,博学多才掌握多种魔法"},
type:HType.mage,lv:1,hp:80,mp:160,map:28,def:2,mdef:0,ap:5,dis:420,speed:95,skills:[6001,6005],
buff:[],info:"奥术法师,博学多才掌握多种魔法"},
// 德鲁伊 - 自然辅助(辅助型,自然魔法和召唤)
5010:{uuid:5010,name:"德鲁伊",path:"hz1", fac:FacSet.HERO, kind:2,
type:HType.support,lv:1,hp:95,mp:130,map:18,def:6,ap:10,dis:380,speed:105,skills:[6001,6005],
buff:[],debuff:[],info:"自然德鲁伊,精通自然魔法和生命治愈"},
type:HType.support,lv:1,hp:95,mp:130,map:18,def:6,mdef:0,ap:10,dis:380,speed:105,skills:[6001,6005],
buff:[],info:"自然德鲁伊,精通自然魔法和生命治愈"},
//怪物
5201:{uuid:5201,name:"兽人战士",path:"mo1", fac:FacSet.MON, kind:1,
type:HType.warrior,lv:1,hp:25,mp:100,map:10,def:5,ap:5,dis:90,speed:100,skills:[6005],
buff:[],debuff:[],info:"普通怪物-战士型"},
type:HType.warrior,lv:1,hp:25,mp:100,map:10,def:5,mdef:0,ap:5,dis:90,speed:100,skills:[6005],
buff:[],info:"普通怪物-战士型"},
5202:{uuid:5202,name:"兽人刺客",path:"mo1", fac:FacSet.MON, kind:1,
type:HType.remote,lv:1,hp:20,mp:100,map:10,def:5,ap:5,dis:350,speed:100,skills:[6005],
buff:[],debuff:[],info:"普通怪物-战士型"},
type:HType.remote,lv:1,hp:20,mp:100,map:10,def:5,mdef:0,ap:5,dis:350,speed:100,skills:[6005],
buff:[],info:"普通怪物-战士型"},
5203:{uuid:5203,name:"兽人护卫",path:"mo1", fac:FacSet.MON, kind:1,
type:HType.warrior,lv:1,hp:25,mp:100,map:10,def:5,ap:5,dis:90,speed:100,skills:[6005],
buff:[],debuff:[],info:"普通怪物-战士型"},
type:HType.warrior,lv:1,hp:25,mp:100,map:10,def:5,mdef:0,ap:5,dis:90,speed:100,skills:[6005],
buff:[],info:"普通怪物-战士型"},
};

View File

@@ -1,9 +0,0 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "61005978-72d1-4d6b-9779-38495b2cb356",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -1,9 +0,0 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "855727c2-30f9-4725-a913-0be50b80ddbd",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -1,6 +1,6 @@
import { _decorator, Animation, AnimationClip, Component, instantiate, Label, Node, Prefab, resources, Sprite, SpriteFrame, v3, tween, Vec3 } from 'cc';
import { _decorator, Animation, AnimationClip, Component, instantiate, Label, Node, Prefab, resources, Sprite, SpriteFrame, v3, tween, Vec3, ProgressBar } from 'cc';
import { oops } from 'db://oops-framework/core/Oops';
import { getHeroList, HeroConf, HeroInfo, HType, HTypeName } from '../common/config/heroSet';
import { getHeroList, getPreAttr, HeroConf, HeroInfo, HType, HTypeName } from '../common/config/heroSet';
import { smc } from '../common/SingletonModuleComp';
import { GameEvent } from '../common/config/GameEvent';
import { CCComp } from 'db://oops-framework/module/common/CCComp';
@@ -16,6 +16,9 @@ export class HInfoComp extends CCComp {
ap_node:any=null
hp_node:any=null
def_node:any=null
mp_node:any=null
map_node:any=null
mdef_node:any=null
// 重新定义节点映射,使名称更清晰
// 当前显示的英雄节点数组7个位置
heroNodes: (Node | null)[] = [null, null, null, null, null, null, null];
@@ -24,9 +27,9 @@ export class HInfoComp extends CCComp {
hero_pos:any={
0:v3(420,-57,0), // 不在屏幕内
1:v3(280,-57,0),
2:v3(140,-57,0),
2:v3(160,-57,0),
3:v3(0,-67,0),
4:v3(-140,-57,0),
4:v3(-160,-57,0),
5:v3(-280,-57,0),
6:v3(-420,-57,0), // 不在屏幕内
}
@@ -44,9 +47,12 @@ export class HInfoComp extends CCComp {
start() {
this.name_node=this.node.getChildByName("hero").getChildByName("hname").getChildByName("name")
this.type_node=this.node.getChildByName("hero").getChildByName("hname").getChildByName("type")
this.ap_node=this.node.getChildByName("info").getChildByName("base").getChildByName("ap").getChildByName("num")
this.hp_node=this.node.getChildByName("info").getChildByName("base").getChildByName("hp").getChildByName("num")
this.def_node=this.node.getChildByName("info").getChildByName("base").getChildByName("def").getChildByName("num")
this.ap_node=this.node.getChildByName("info").getChildByName("base").getChildByName("ap")
this.hp_node=this.node.getChildByName("info").getChildByName("base").getChildByName("hp")
this.def_node=this.node.getChildByName("info").getChildByName("base").getChildByName("def")
this.mdef_node=this.node.getChildByName("info").getChildByName("base").getChildByName("mdef")
this.map_node=this.node.getChildByName("info").getChildByName("base").getChildByName("map")
this.mp_node=this.node.getChildByName("info").getChildByName("base").getChildByName("mp")
this.h_uuid=smc.fight_hero
this.update_data(this.h_uuid)
this.load_all_hero(this.h_uuid)
@@ -56,11 +62,21 @@ export class HInfoComp extends CCComp {
}
update_data(uuid:number){
this.h_uuid=uuid
this.name_node.getComponent(Label).string=HeroInfo[uuid].name
this.name_node.getComponent(Label).string=HeroInfo[uuid].name
this.type_node.getComponent(Label).string=HTypeName[HeroInfo[uuid].type]
this.ap_node.getComponent(Label).string=HeroInfo[uuid].ap.toString()
this.hp_node.getComponent(Label).string=HeroInfo[uuid].hp.toString()
this.def_node.getComponent(Label).string=HeroInfo[uuid].def.toString()
this.ap_node.getChildByName("num").getComponent(Label).string=HeroInfo[uuid].ap.toString()
this.hp_node.getChildByName("num").getComponent(Label).string=HeroInfo[uuid].hp.toString()
this.def_node.getChildByName("num").getComponent(Label).string=HeroInfo[uuid].def.toString()
this.mdef_node.getChildByName("num").getComponent(Label).string=HeroInfo[uuid].mdef.toString()
this.map_node.getChildByName("num").getComponent(Label).string=HeroInfo[uuid].map.toString()
this.mp_node.getChildByName("num").getComponent(Label).string=HeroInfo[uuid].mp.toString()
let bar_num=getPreAttr(uuid)
this.ap_node.getChildByName("bar").getComponent(ProgressBar).progress=bar_num.ap
this.hp_node.getChildByName("bar").getComponent(ProgressBar).progress=bar_num.hp
this.def_node.getChildByName("bar").getComponent(ProgressBar).progress=bar_num.def
this.mdef_node.getChildByName("bar").getComponent(ProgressBar).progress=bar_num.mdef
this.map_node.getChildByName("bar").getComponent(ProgressBar).progress=bar_num.map
this.mp_node.getChildByName("bar").getComponent(ProgressBar).progress=bar_num.mp
}
load_all_hero(uuid:number){
// 清除之前的英雄节点