6 Commits
skill ... one

Author SHA1 Message Date
f1c7a284f6 Merge branch 'one' of https://e.coding.net/walker_pan/heros/heros into one 2025-03-16 22:45:27 +08:00
ca2a0f79d1 ui重做 2025-03-16 22:43:43 +08:00
82805b0fa0 dd 2025-03-07 16:44:08 +08:00
a065b32856 ui调整 2025-02-26 17:00:24 +08:00
5279a65284 初步 修改英雄信息 2025-02-26 16:18:40 +08:00
94b8c992da 强化单局 弱化成长 2025-02-25 12:58:08 +08:00
17 changed files with 12261 additions and 23807 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "2849e90f-15b2-4082-a7b6-1ff1362f537b",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "card"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -50,8 +50,8 @@
"height": 250,
"rawWidth": 1775,
"rawHeight": 250,
"borderTop": 227,
"borderBottom": 0,
"borderTop": 57,
"borderBottom": 181,
"borderLeft": 0,
"borderRight": 0,
"packable": true,

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,405 @@
[
{
"__type__": "cc.AnimationClip",
"_name": "carsup",
"_objFlags": 0,
"__editorExtras__": {
"embeddedPlayerGroups": []
},
"_native": "",
"sample": 60,
"speed": 1,
"wrapMode": 2,
"enableTrsBlending": false,
"_duration": 0.18333333333333332,
"_hash": 500763545,
"_tracks": [
{
"__id__": 1
},
{
"__id__": 11
}
],
"_exoticAnimation": null,
"_events": [],
"_embeddedPlayers": [],
"_additiveSettings": {
"__id__": 22
},
"_auxiliaryCurveEntries": []
},
{
"__type__": "cc.animation.VectorTrack",
"_binding": {
"__type__": "cc.animation.TrackBinding",
"path": {
"__id__": 2
},
"proxy": null
},
"_channels": [
{
"__id__": 3
},
{
"__id__": 5
},
{
"__id__": 7
},
{
"__id__": 9
}
],
"_nComponents": 3
},
{
"__type__": "cc.animation.TrackPath",
"_paths": [
"scale"
]
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 4
}
},
{
"__type__": "cc.RealCurve",
"_times": [
0,
0.1666666716337204
],
"_values": [
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 10,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": null
}
],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 6
}
},
{
"__type__": "cc.RealCurve",
"_times": [
0,
0.1666666716337204
],
"_values": [
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 10,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": null
}
],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 8
}
},
{
"__type__": "cc.RealCurve",
"_times": [
0,
0.1666666716337204
],
"_values": [
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 1,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 1,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": null
}
],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 10
}
},
{
"__type__": "cc.RealCurve",
"_times": [],
"_values": [],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.animation.ColorTrack",
"_binding": {
"__type__": "cc.animation.TrackBinding",
"path": {
"__id__": 12
},
"proxy": null
},
"_channels": [
{
"__id__": 14
},
{
"__id__": 16
},
{
"__id__": 18
},
{
"__id__": 20
}
]
},
{
"__type__": "cc.animation.TrackPath",
"_paths": [
{
"__id__": 13
},
"color"
]
},
{
"__type__": "cc.animation.ComponentPath",
"component": "cc.Sprite"
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 15
}
},
{
"__type__": "cc.RealCurve",
"_times": [
0.1666666716337204,
0.18333333730697632
],
"_values": [
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 255,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 255,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": null
}
],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 17
}
},
{
"__type__": "cc.RealCurve",
"_times": [
0.1666666716337204,
0.18333333730697632
],
"_values": [
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 255,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 255,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": null
}
],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 19
}
},
{
"__type__": "cc.RealCurve",
"_times": [
0.1666666716337204,
0.18333333730697632
],
"_values": [
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 255,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 255,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": null
}
],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 21
}
},
{
"__type__": "cc.RealCurve",
"_times": [
0.1666666716337204,
0.18333333730697632
],
"_values": [
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 255,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": null
}
],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.AnimationClipAdditiveSettings",
"enabled": false,
"refClip": null
}
]

View File

@@ -0,0 +1,13 @@
{
"ver": "2.0.3",
"importer": "animation-clip",
"imported": true,
"uuid": "322cf75e-d992-47d7-9886-ae644b65de10",
"files": [
".cconb"
],
"subMetas": {},
"userData": {
"name": "carsup"
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1021 KiB

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@@ -1129,10 +1129,10 @@
"height": 110,
"rawWidth": 110,
"rawHeight": 110,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"borderTop": 55,
"borderBottom": 55,
"borderLeft": 55,
"borderRight": 55,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "f6f84e06-578b-446b-b5d7-595b686efbe0",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -28,13 +28,10 @@ export class CardControllerComp extends CCComp {
bbg_y:number=40
bbg_x:any=[-300,-150,0,150,300]
protected onLoad(): void {
this.bbg=this.node.getChildByName("bar").getChildByName("bbg")
oops.message.on(GameEvent.MissionStart,this.mission_home_to_mission,this)
// oops.message.on(GameEvent.MissionEnd,this.mission_home_to_mission,this)
}
start() {
this.bbg=this.node.getChildByName("bar").getChildByName("bbg")
this.bbg.setPosition(v3(this.bbg_x[2],this.bbg_y))
this.page_init()
}
@@ -50,15 +47,9 @@ export class CardControllerComp extends CCComp {
}
page_init(){
this.node.getChildByName("mission_home").active=true;
this.node.getChildByName("hero_home").active = false;
this.node.getChildByName("shop_home").active = false;
this.node.getChildByName("battle_home").active = false;
this.node.getChildByName("luck_home").active = false;
this.node.getChildByName("mission").active = false;
}
mission_home_to_mission(){
this.node.getChildByName("bar").active=false;
let mission=this.node.getChildByName("mission").getComponent(MissionComp)
mission.node.active = true;
mission.mission_start()
@@ -66,42 +57,14 @@ export class CardControllerComp extends CCComp {
}
mission_to_mission_home(){
let mission_home=this.node.getChildByName("mission_home").getComponent(MissionHomeComp)
this.bar_change(null,"home")
this.node.getChildByName("bar").active=true;
this.node.getChildByName("mission_home").active = true
let mission=this.node.getChildByName("mission")
mission.active = false
mission_home.load_ui_heros()
}
bar_change(e:any,args:any){
console.log("bar_change",args)
this.node.getChildByName("bar").active=true;
this.node.getChildByName("mission").active = false;
this.node.getChildByName("hero_home").active = false
this.node.getChildByName("mission_home").active = false
this.node.getChildByName("shop_home").active = false
this.node.getChildByName("battle_home").active = false
this.node.getChildByName("luck_home").active = false
switch(args){
case "hero":
this.node.getChildByName("hero_home").active = true
this.bbg.setPosition(v3(this.bbg_x[1],this.bbg_y))
break;
case "shop":
this.node.getChildByName("shop_home").active = true
this.bbg.setPosition(v3(this.bbg_x[0],this.bbg_y))
break;
// case "battle":
// this.node.getChildByName("battle_home").active = true
// this.bbg.setPosition(v3(this.bbg_x[4],this.bbg_y))
break;
case "luck":
this.node.getChildByName("luck_home").active = true
this.bbg.setPosition(v3(this.bbg_x[3],this.bbg_y))
break;
case "home":
this.node.getChildByName("mission_home").active = true
this.bbg.setPosition(v3(this.bbg_x[2],this.bbg_y))
this.node.getChildByName("mission_home").getComponent(MissionHomeComp).update_hero_cards()
break;
}
show_hero_home(){
let hero_home=this.node.getChildByName("hero_home")
hero_home.active = true
}
/** 视图对象通过 ecs.Entity.remove(ControllerComp) 删除组件是触发组件处理自定义释放逻辑 */

View File

@@ -34,7 +34,9 @@ export class HeroHomeComp extends CCComp {
loads(){
let hc:number =HeroList.length
let parent= this.node.getChildByName("heros").getChildByName("view").getChildByName("content")
parent.getComponent(UITransform).setContentSize(720,Math.ceil(HeroList.length/4)*230)
parent.getComponent(UITransform).setContentSize(hc*185,230)
// console.log("hc",hc,parent.getComponent(UITransform))
console.log("parent",parent)
for (let i = 0; i < hc; i++) {
let hcc =ecs.getEntity<HeroCard>(HeroCard)
@@ -248,6 +250,9 @@ export class HeroHomeComp extends CCComp {
close_show(){
this.node.getChildByName("show").active=false
}
close(){
this.node.active=false
}
reset() {
this.node.destroy();
}

View File

@@ -108,10 +108,7 @@ export class MissionComp extends CCComp {
to_mission_home(){
this.colose_victory()
let home =this.node.parent.getComponent(CardControllerComp);
let mission_home=home.node.getChildByName("mission_home").getComponent(MissionHomeComp)
home.bar_change(null,"home")
home.node.getChildByName("bar").active=true;
mission_home.load_ui_heros()
home.mission_to_mission_home()
}
mission_init(){
//局内数据初始化

View File

@@ -25,24 +25,18 @@ export class MissionHomeComp extends CCComp {
{uuid:0,px:-300},
]
protected onLoad(): void {
oops.message.on("hero_card_select", this.select_hero, this);
oops.message.on("hero_card_cancel_select", this.cancel_hero, this);
}
/** 视图层逻辑代码分离演示 */
start() {
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
// this.on(ModuleEvent.Cmd, this.onHandler, this);
this.load_hero_card()
this.load_ui_heros()
// this.load_skill_card()
// this.select_skill()
this.init_buff()
}
to_start(){
}
start_mission() {
if (this.heros.length <=0 ) {
oops.gui.toast("请先选择英雄")
return
}
for(let i=0;i<this.heros.length;i++){
this.heros[i].to_destroy()
}
@@ -54,109 +48,16 @@ export class MissionHomeComp extends CCComp {
]
oops.message.dispatchEvent(GameEvent.MissionStart, {})
this.node.active=false;
}
init_buff(){
smc.vmdata.mission.ap_up=MBSet.ap_add*smc.vmdata.buff_num[0]/MBSet.ap_cost
smc.vmdata.mission.def_up=MBSet.def_add*smc.vmdata.buff_num[1]/MBSet.def_cost
smc.vmdata.mission.hp_up=MBSet.hp_add*smc.vmdata.buff_num[2]/MBSet.hp_cost
smc.vmdata.mission.crit_up=MBSet.crit_add*smc.vmdata.buff_num[3]/MBSet.crit_cost
smc.vmdata.mission.dodge_up=MBSet.dodge_add*smc.vmdata.buff_num[4]/MBSet.dodge_cost
smc.vmdata.buff_num_less=smc.vmdata.buff_num_max-smc.vmdata.buff_num[0]-smc.vmdata.buff_num[1]-smc.vmdata.buff_num[2]-smc.vmdata.buff_num[3]-smc.vmdata.buff_num[4]
}
load_hero_card(){
let hc:number =HeroList.length
let parent= this.node.getChildByName("heros").getChildByName("view").getChildByName("content")
let height=Math.ceil(hc / 4)*160 +100
parent.getComponent(UITransform).height=height
for (let i = 0; i < hc; i++) {
// if (HeroInfo[HeroList[i]].quality==3) {
let hcc =ecs.getEntity<HeroSelect>(HeroSelect)
hcc.load(HeroList[i],parent)
// }
}
// for (let i = 0; i < hc; i++) {
// if (HeroInfo[HeroList[i]].quality==2) {
// let hcc =ecs.getEntity<HeroSelect>(HeroSelect)
// hcc.load(HeroList[i],parent)
// }
// }
// for (let i = 0; i < hc; i++) {
// if (HeroInfo[HeroList[i]].quality==1) {
// let hcc =ecs.getEntity<HeroSelect>(HeroSelect)
// hcc.load(HeroList[i],parent)
// }
// }
this.update_hero_cards()
}
update_hero_cards(){
let loaded:any = ecs.query(ecs.allOf(HeroSelectComp));
for(let i=0;i<loaded.length;i++){
if(smc.heros[loaded[i].HeroSelectComp.h_uuid].slv ==0 ) {
loaded[i].HeroSelectComp.node.active=false
}else{
loaded[i].HeroSelectComp.node.active=true
}
}
}
load_skill_card(){
}
load_ui_heros(){
for(let i=0;i<smc.fight_heros.length;i++){
this.select_hero("local",{uuid:smc.fight_heros[i]})
}
}
select_hero(event:any,args:any){
console.log("select_hero",args.uuid)
for(let i=0;i<GameSet.HERO_NUM;i++){
if(this.heros_pos[i].uuid==0){
this.heros_pos[i].uuid=args.uuid
this.call_hero(args.uuid,i)
break
}
}
}
cancel_hero(event:any,args:any){
for(let i=0;i<GameSet.HERO_NUM;i++){
if(this.heros_pos[i].uuid==args.uuid){
this.heros_pos[i].uuid=0
this.destory_hero(args.uuid)
}
}
}
call_hero(h_uuid:number,index:number){
var path = "game/heros/uiheros/"+HeroInfo[h_uuid].path;
var prefab: Prefab = oops.res.get(path, Prefab)!;
var node = instantiate(prefab);
var scene = smc.map.MapView.scene;
node.parent = scene.entityLayer!.node!
node.setPosition(this.heros_pos[index].px,BoxSet.GAME_LINE,0);
let comp = node.getComponent(UiHeroComp)
comp.h_uuid = h_uuid
this.heros.push(comp)
}
destory_hero(h_uuid:number){
for(let i=0;i<this.heros.length;i++){
if(this.heros[i].h_uuid==h_uuid){
this.heros[i].to_destroy()
this.heros.splice(i,1)
return
}
}
}
show_heros(){
this.node.getChildByName("heros").setPosition(0,290)
}
hide_heros(){
this.node.getChildByName("heros").setPosition(0,-800)
}
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
reset() {
this.node.destroy();