This commit is contained in:
2024-12-21 11:03:54 +08:00
parent e34eb5452b
commit e6e3db0f80
30 changed files with 3206 additions and 1814 deletions

View File

@@ -50,10 +50,13 @@ export class SingletonModuleComp extends ecs.Comp {
9001:{uuid:9001,lv:1,exp:0,slv:0,stone:0,num:100,x1:1,x10:0},
9002:{uuid:9002,lv:2,exp:0,slv:1,stone:0,num:80,x1:2,x10:0},
9003:{uuid:9003,lv:3,exp:0,slv:2,stone:0,num:90,x1:3,x10:0},
9004:{uuid:9004,lv:1,exp:0,slv:0,stone:0,num:100,x1:1,x10:0},
9005:{uuid:9005,lv:2,exp:0,slv:1,stone:0,num:80,x1:2,x10:0},
9006:{uuid:9006,lv:3,exp:0,slv:2,stone:0,num:90,x1:3,x10:0},
};
goods:any={
free: [ {uuid:9001,num:100000}, {uuid:9002,num:10}, {uuid:9003,num:10}],
goods1:[ {uuid:1001,num:100}, {uuid:9002,num:1} ],
free: [ {uuid:9001,num:100000}, {uuid:9003,num:500}],
goods1:[ {uuid:9003,num:1} ],
herochips:[ {uuid:9001,num:2}, {uuid:9002,num:1} ],
skillchips:[ {uuid:1001,num:100}, {uuid:1002,num:1} ],
goods4:[ {uuid:9001,num:100}, {uuid:9002,num:1} ],
@@ -76,7 +79,7 @@ export class SingletonModuleComp extends ecs.Comp {
1015:{uuid:1015,num:1000,x1:0,x10:0},
1016:{uuid:1016,num:1000,x1:0,x10:0},
};
fight_heros=[9001,9002]
fight_heros=[9003,9002]
mheros:any = [];
monsters:any = [];
sk_info:any = []
@@ -112,15 +115,15 @@ export class SingletonModuleComp extends ecs.Comp {
reward_gold:0,
reward_exp:0,
},
gold:{num:9999999,x1:1,x10:0},
gold:{num:999999,x1:1,x10:0},
exp:{num:1000,x1:1,x10:0},
skp:{num:2000,x1:1,x10:0}, //技能升级点数
energy:{num:10,x1:1,x10:0},
free:{ cost:0,num:3,buy:3,},
goods1:{ cost:2000,num:3,buy:3,},
herochips:{ cost:3000,num:4,buy:3,},
skillchips:{ cost:4000,num:5,buy:3,},
goods1:{ cost:20000,num:3,buy:3,},
herochips:{ cost:30000,num:4,buy:3,},
skillchips:{ cost:500000,num:5,buy:3,},
};
vmAdd() {

View File

@@ -1,9 +1,8 @@
export const BoxDrop={
1:[
{uuid: 1001,dropRate: 10,num_max: 10,type:0},
{uuid: 1002,dropRate: 10,num_max: 10,type:0},
{uuid: 1003,dropRate: 10,num_max: 10,type:0},
{uuid: 9001,dropRate: 10,num_max: 100000,type:0},
{uuid: 9003,dropRate: 10,num_max: 500,type:0},
],
2:[
{uuid: 1001,dropRate: 10,num_max: 10,type:0},

View File

@@ -65,9 +65,30 @@ export const HeroInfo = {
abh:0,abc:0,uabh:0,uabc:0,cbh:0,cbc:0,aua:0,auc:0,uaua:0,uauc:0,cua:0,cuc:0,wp:1001,arm:2001,ring:3001,shoes:4001,
tals:["这是一级说明","这是二级说明","这是三级说明","这是四级说明","这是五级说明"]
},
9004: {
uuid:9003,name: "111",path:"a1",type:1,hp: 200, hp_up:10, shp_up:20,def:10,def_up:1,sdef_up:20,ap:20,ap_up:2,sap_up:20,atp:1,vun:0,crit:20,crit_add:0,ucr:0,dodge:0,dis:100,a_cd:1.5,
lvexp:0,slvexp:0, speed: 100,aexp:5,uaexp:1,cexp:10,doexp:10,dexp:20,sk1:[9001,9001,9001,9001,9001,9001],sk2:[2002,2002,2002,2002,2002,2002],sk3:[2002,2002,2002,2002,2002,2002],pw:0,pwm:150,pws:10,apw:0,uapw:0,cpw:0,dpw:0,dopw:0,
akr:[10,20,30,40,50,60],akc:[1,1,1,1,1,1],uar:[10,20,30,40,50,60],uac:[1,1,1,1,1,1],dgr:[10,20,30,40,50,60],dgc:[1,1,1,1,1,1],crr:[10,20,30,40,50,60],crc:[1,1,1,1,1,1],
abh:0,abc:0,uabh:0,uabc:0,cbh:0,cbc:0,aua:0,auc:0,uaua:0,uauc:0,cua:0,cuc:0,wp:1001,arm:2001,ring:3001,shoes:4001,
tals:["这是一级说明","这是二级说明","这是三级说明","这是四级说明","这是五级说明"]
},
9005: {
uuid:9003,name: "222",path:"a2",type:1,hp: 200, hp_up:10, shp_up:20,def:10,def_up:1,sdef_up:20,ap:20,ap_up:2,sap_up:20,atp:1,vun:0,crit:20,crit_add:0,ucr:0,dodge:0,dis:100,a_cd:1.5,
lvexp:0,slvexp:0, speed: 100,aexp:5,uaexp:1,cexp:10,doexp:10,dexp:20,sk1:[9001,9001,9001,9001,9001,9001],sk2:[2002,2002,2002,2002,2002,2002],sk3:[2002,2002,2002,2002,2002,2002],pw:0,pwm:150,pws:10,apw:0,uapw:0,cpw:0,dpw:0,dopw:0,
akr:[10,20,30,40,50,60],akc:[1,1,1,1,1,1],uar:[10,20,30,40,50,60],uac:[1,1,1,1,1,1],dgr:[10,20,30,40,50,60],dgc:[1,1,1,1,1,1],crr:[10,20,30,40,50,60],crc:[1,1,1,1,1,1],
abh:0,abc:0,uabh:0,uabc:0,cbh:0,cbc:0,aua:0,auc:0,uaua:0,uauc:0,cua:0,cuc:0,wp:1001,arm:2001,ring:3001,shoes:4001,
tals:["这是一级说明","这是二级说明","这是三级说明","这是四级说明","这是五级说明"]
},
9006: {
uuid:9003,name: "333",path:"a3",type:1,hp: 200, hp_up:10, shp_up:20,def:10,def_up:1,sdef_up:20,ap:20,ap_up:2,sap_up:20,atp:1,vun:0,crit:20,crit_add:0,ucr:0,dodge:0,dis:100,a_cd:1.5,
lvexp:0,slvexp:0, speed: 100,aexp:5,uaexp:1,cexp:10,doexp:10,dexp:20,sk1:[9001,9001,9001,9001,9001,9001],sk2:[2002,2002,2002,2002,2002,2002],sk3:[2002,2002,2002,2002,2002,2002],pw:0,pwm:150,pws:10,apw:0,uapw:0,cpw:0,dpw:0,dopw:0,
akr:[10,20,30,40,50,60],akc:[1,1,1,1,1,1],uar:[10,20,30,40,50,60],uac:[1,1,1,1,1,1],dgr:[10,20,30,40,50,60],dgc:[1,1,1,1,1,1],crr:[10,20,30,40,50,60],crc:[1,1,1,1,1,1],
abh:0,abc:0,uabh:0,uabc:0,cbh:0,cbc:0,aua:0,auc:0,uaua:0,uauc:0,cua:0,cuc:0,wp:1001,arm:2001,ring:3001,shoes:4001,
tals:["这是一级说明","这是二级说明","这是三级说明","这是四级说明","这是五级说明"]
},
}
export const HeroList = [9001,9002,9003]
export const HeroList = [9001,9002,9003,9004,9005,9006]
export const MonSet = {
5001: {
uuid: 5001, path: "boss1", type: 1, level: 1,cost:2, name: "骷髅王", atk: 30, hp: 150, atk_dis: 200, a_cd: 2, power: 0, power_max: 10, speed: 7,

View File

@@ -13,6 +13,7 @@ import { Talent } from "../Role/Talent";
import { Talents } from "../common/config/TalentSet";
import { HeroViewComp } from "../hero/HeroViewComp";
import { Position } from "../../../../extensions/oops-plugin-framework/assets/libs/gui/badge/Badge";
import { MissionHomeComp } from "./MissionHomeComp";
const { ccclass, property } = _decorator;
/** 视图层对象 */
@@ -81,6 +82,7 @@ export class CardControllerComp extends CCComp {
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).load_hero_card()
break;
}
}

View File

@@ -33,7 +33,8 @@ export class HeroHomeComp extends CCComp {
let heros:any=HeroList
let hc:number =HeroList.length
let parent= this.node.getChildByName("heros").getChildByName("view").getChildByName("content")
parent.getComponent(UITransform).width=hc*150
parent.getComponent(UITransform).setContentSize(hc*150,200)
console.log("parent",parent)
for (let i = 0; i < hc; i++) {
let hcc =ecs.getEntity<HeroCard>(HeroCard)
hcc.load(HeroList[i],parent)
@@ -104,7 +105,16 @@ export class HeroHomeComp extends CCComp {
}else{
slvup.getChildByName("btned").active=false
};
if( this.role.slv==0) {
this.node.getChildByName("call").getChildByName("cost").getChildByName("need").getComponent(Label).string = ((SlvUp[this.role.slv]-HeroInfo[this.h_uuid].slvexp)*(1+this.role.slv)).toString()
this.node.getChildByName("call").getChildByName("cost").getChildByName("num").getComponent(Label).string = smc.heros[this.h_uuid].num.toString()
this.node.getChildByName("call").getChildByName("cost").getChildByName("bar").getComponent(ProgressBar).progress = smc.heros[this.h_uuid].num/((SlvUp[this.role.slv]-HeroInfo[this.h_uuid].slvexp)*(1+this.role.slv))
let hchipcomp= this.node.getChildByName("call").getChildByName("cost").getChildByName("hchip").getComponent(HChipComp)
hchipcomp.update_data(this.h_uuid,0)
this.node.getChildByName("call").active=true
}else{
this.node.getChildByName("call").active=false
};
attr.getChildByName("ap").getChildByName("val").getComponent(Label).string = ((this.hero.ap+this.hero.ap_up* this.role.lv)*(1+this.hero.sap_up/100*this.role.slv)).toFixed(0).toString()
attr.getChildByName("hp").getChildByName("val").getComponent(Label).string = ((this.hero.hp+this.hero.hp_up* this.role.lv)*(1+this.hero.shp_up/100*this.role.slv)).toFixed(0).toString()
attr.getChildByName("def").getChildByName("val").getComponent(Label).string = ((this.hero.ap+this.hero.ap_up* this.role.lv)*(1+this.hero.sdef_up/100*this.role.slv)).toFixed(0).toString()

View File

@@ -138,7 +138,16 @@ export class LuckHomeCompComp extends CCComp {
break;
case 1:
this.show_item(uuid,num)
smc.items[uuid].num += num
if(uuid ==9001){
smc.vmdata.gold.num+=num
}
if(uuid ==9003){
smc.vmdata.exp.num+=num
}
if(uuid < 9000){
smc.items[uuid].num+=num
}
break;
}
}

View File

@@ -12,6 +12,7 @@ import { MSCard } from "./MSCard";
import { CardControllerComp } from "./CardController";
import { MissionComp } from "./MissionComp";
import { MSCardComp } from "./MSCardComp";
import { HeroSelectComp } from "../hero/HeroSelectComp";
const { ccclass, property } = _decorator;
@@ -63,20 +64,29 @@ export class MissionHomeComp extends CCComp {
this.node.active=false;
}
load_hero_card(){
let loaded:any = ecs.query(ecs.allOf(HeroSelectComp));
if(loaded.length>0){
for(let i=0;i<loaded.length;i++){
loaded[i].HeroSelectComp.reset()
loaded[i].HeroSelectComp.ent.destroy()
}
}
let hc:number =HeroList.length
let parent= this.node.getChildByName("heros").getChildByName("view").getChildByName("content")
let height=Math.ceil(hc / 4)*135
parent.getComponent(UITransform).width=height
parent.getComponent(UITransform).height=height
for (let i = 0; i < hc; i++) {
let hcc =ecs.getEntity<HeroSelect>(HeroSelect)
hcc.load(HeroList[i],parent)
if(smc.heros[HeroList[i]].slv > 0) {
let hcc =ecs.getEntity<HeroSelect>(HeroSelect)
hcc.load(HeroList[i],parent)
}
}
}
load_skill_card(){
let ms_num:number =MSklist.length
let parent= this.node.getChildByName("skills").getChildByName("view").getChildByName("content")
let height=ms_num*135
parent.getComponent(UITransform).width=height
parent.getComponent(UITransform).height=height
for (let i = 0; i < ms_num; i++) {
let msc =ecs.getEntity<MSCard>(MSCard)
msc.load(MSklist[i],parent,2)

View File

@@ -70,6 +70,17 @@ export class ShopHomeComp extends CCComp {
oops.gui.toast("今日领取次数已用完");
return
}
for (let x = 0; x < smc.goods.free.length; x++) {
if(smc.goods.free[x].uuid ==9001){
smc.vmdata.gold.num+=smc.goods.free[x].num
}
if(smc.goods.free[x].uuid ==9003){
smc.vmdata.exp.num+=smc.goods.free[x].num
}
if(smc.goods.free[x].uuid < 9000){
smc.items[smc.goods.free[x].uuid].num+=smc.goods.free[x].num
}
}
smc.vmdata.free.buy--
}
get_goods1(){
@@ -78,23 +89,57 @@ export class ShopHomeComp extends CCComp {
oops.gui.toast("今日购买次数已用完");
return
}
if(smc.vmdata.gold.num < smc.vmdata.goods1.cost){
oops.gui.toast("金币不足");
return
}
for (let x = 0; x < smc.goods.goods1.length; x++) {
if(smc.goods.goods1[x].uuid ==9001){
smc.vmdata.gold.num+=smc.goods.goods1[x].num
}
if(smc.goods.goods1[x].uuid ==9003){
smc.vmdata.exp.num+=smc.goods.goods1[x].num
}
if(smc.goods.goods1[x].uuid < 9000){
smc.items[smc.goods.goods1[x].uuid].num+=smc.goods.goods1[x].num
}
}
smc.vmdata.goods1.buy--
smc.vmdata.gold.num-=smc.vmdata.goods1.cost
}
get_goods2(){
console.log("购买商品2")
if(smc.vmdata.goods2.buy <= 0){
if(smc.vmdata.herochips.buy <= 0){
oops.gui.toast("今日购买次数已用完");
return
}
smc.vmdata.goods2.buy--
if(smc.vmdata.gold.num < smc.vmdata.herochips.cost){
oops.gui.toast("金币不足");
return
}
for (let x = 0; x < smc.goods.herochips.length; x++) {
smc.heros[smc.goods.herochips[x].uuid].num += smc.goods.herochips[x].num
}
smc.vmdata.herochips.buy--
smc.vmdata.gold.num-=smc.vmdata.herochips.cost
}
get_goods3(){
console.log("购买商品3")
if(smc.vmdata.goods3.buy <= 0){
if(smc.vmdata.skillchips.buy <= 0){
oops.gui.toast("今日购买次数已用完");
return
}
smc.vmdata.goods3.buy--
if(smc.vmdata.gold.num < smc.vmdata.skillchips.cost){
oops.gui.toast("金币不足");
return
}
for (let x = 0; x < smc.goods.skillchips.length; x++) {
smc.skills[smc.goods.skillchips[x].uuid].num += smc.goods.skillchips[x].num
}
smc.vmdata.skillchips.buy--
smc.vmdata.gold.num-=smc.vmdata.skillchips.cost
}
get_goods4(){
console.log("购买商品4")