奖励页面ui 修改完成
This commit is contained in:
@@ -28,24 +28,24 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
mmskill:6002,
|
||||
};
|
||||
skills: any = {
|
||||
6001:{uuid:6001,slv:0,num:4,x1:1,x10:0},
|
||||
6002:{uuid:6002,slv:0,num:3,x1:2,x10:0},
|
||||
6003:{uuid:6003,slv:0,num:0,x1:0,x10:0},
|
||||
6004:{uuid:6004,slv:0,num:0,x1:0,x10:0},
|
||||
6005:{uuid:6005,slv:0,num:0,x1:0,x10:0},
|
||||
6006:{uuid:6006,slv:0,num:0,x1:0,x10:0},
|
||||
6007:{uuid:6007,slv:0,num:0,x1:0,x10:0},
|
||||
6008:{uuid:6008,slv:0,num:0,x1:0,x10:0},
|
||||
6012:{uuid:6012,slv:0,num:0,x1:0,x10:0},
|
||||
6001:{uuid:6001,slv:0,num:4,x1:1},
|
||||
6002:{uuid:6002,slv:0,num:3,x1:2},
|
||||
6003:{uuid:6003,slv:0,num:0,x1:0},
|
||||
6004:{uuid:6004,slv:0,num:0,x1:0},
|
||||
6005:{uuid:6005,slv:0,num:0,x1:0},
|
||||
6006:{uuid:6006,slv:0,num:0,x1:0},
|
||||
6007:{uuid:6007,slv:0,num:0,x1:0},
|
||||
6008:{uuid:6008,slv:0,num:0,x1:0},
|
||||
6012:{uuid:6012,slv:0,num:0,x1:0},
|
||||
};
|
||||
/** 游戏主角 */
|
||||
heros:any={
|
||||
5001:{uuid:5001,lv:1,exp:0,slv:1,stone:0,num:100,x1:1,x10:0},
|
||||
5002:{uuid:5002,lv:2,exp:0,slv:1,stone:0,num:80,x1:2,x10:0},
|
||||
5003:{uuid:5003,lv:3,exp:0,slv:1,stone:0,num:90,x1:3,x10:0},
|
||||
5004:{uuid:5004,lv:1,exp:0,slv:0,stone:0,num:100,x1:1,x10:0},
|
||||
5005:{uuid:5005,lv:2,exp:0,slv:0,stone:0,num:80,x1:2,x10:0},
|
||||
5006:{uuid:5006,lv:3,exp:0,slv:0,stone:0,num:90,x1:3,x10:0},
|
||||
5001:{uuid:5001,lv:1,exp:0,slv:1,num:100,x1:10},
|
||||
5002:{uuid:5002,lv:2,exp:0,slv:1,num:80,x1:0},
|
||||
5003:{uuid:5003,lv:3,exp:0,slv:1,num:90,x1:0},
|
||||
5004:{uuid:5004,lv:1,exp:0,slv:0,num:100,x1:0},
|
||||
5005:{uuid:5005,lv:2,exp:0,slv:0,num:80,x1:0},
|
||||
5006:{uuid:5006,lv:3,exp:0,slv:0,num:90,x1:0},
|
||||
};
|
||||
goods:any=[
|
||||
{uuid:9001,num:100000,type:0,cost:0,inventory:5},
|
||||
@@ -54,22 +54,22 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
{uuid:5001,num:10,type:3,cost:10000,inventory:99},
|
||||
];
|
||||
items:any={
|
||||
1001:{uuid:1001,num:10,x1:1,x10:0},
|
||||
1002:{uuid:1002,num:10,x1:0,x10:0},
|
||||
1003:{uuid:1003,num:10,x1:0,x10:0},
|
||||
1004:{uuid:1004,num:1000,x1:0,x10:0},
|
||||
1005:{uuid:1005,num:1000,x1:0,x10:0},
|
||||
1006:{uuid:1006,num:1000,x1:0,x10:0},
|
||||
1007:{uuid:1007,num:1000,x1:0,x10:0},
|
||||
1008:{uuid:1008,num:1000,x1:0,x10:0},
|
||||
1009:{uuid:1009,num:1000,x1:0,x10:0},
|
||||
1010:{uuid:1010,num:1000,x1:0,x10:0},
|
||||
1011:{uuid:1011,num:1000,x1:0,x10:0},
|
||||
1012:{uuid:1012,num:1000,x1:0,x10:0},
|
||||
1013:{uuid:1013,num:1000,x1:0,x10:0},
|
||||
1014:{uuid:1014,num:1000,x1:0,x10:0},
|
||||
1015:{uuid:1015,num:1000,x1:0,x10:0},
|
||||
1016:{uuid:1016,num:1000,x1:0,x10:0},
|
||||
1001:{uuid:1001,num:10,x1:1},
|
||||
1002:{uuid:1002,num:10,x1:0},
|
||||
1003:{uuid:1003,num:10,x1:0},
|
||||
1004:{uuid:1004,num:1000,x1:0},
|
||||
1005:{uuid:1005,num:1000,x1:0},
|
||||
1006:{uuid:1006,num:1000,x1:0},
|
||||
1007:{uuid:1007,num:1000,x1:0},
|
||||
1008:{uuid:1008,num:1000,x1:0},
|
||||
1009:{uuid:1009,num:1000,x1:0},
|
||||
1010:{uuid:1010,num:1000,x1:0},
|
||||
1011:{uuid:1011,num:1000,x1:0},
|
||||
1012:{uuid:1012,num:1000,x1:0},
|
||||
1013:{uuid:1013,num:1000,x1:0},
|
||||
1014:{uuid:1014,num:1000,x1:0},
|
||||
1015:{uuid:1015,num:1000,x1:0},
|
||||
1016:{uuid:1016,num:1000,x1:0},
|
||||
};
|
||||
fight_heros=[5001,5002]
|
||||
mheros:any = [];
|
||||
@@ -124,10 +124,10 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
reward_gold:0,
|
||||
reward_exp: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},
|
||||
gold:{num:999999,x1:1},
|
||||
exp:{num:1000,x1:1},
|
||||
skp:{num:2000,x1:1}, //技能升级点数
|
||||
energy:{num:10,x1:1},
|
||||
|
||||
free:{ cost:0,num:3,buy:3,},
|
||||
goods1:{ cost:20000,num:3,buy:3,},
|
||||
|
||||
@@ -25,7 +25,6 @@ export class HChipComp extends Component {
|
||||
update_data(uuid:number,num:number=0){
|
||||
this.h_uuid = uuid;
|
||||
var icon_path = "game/heros/herois"
|
||||
console.log("HeroInfo[uuid]",HeroInfo[uuid],uuid)
|
||||
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);
|
||||
|
||||
@@ -33,7 +33,7 @@ export class CardControllerComp extends CCComp {
|
||||
this.bbg.setPosition(v3(this.bbg_x[2],this.bbg_y))
|
||||
this.page_init()
|
||||
}
|
||||
|
||||
|
||||
show_info(uuid:number,type:number){
|
||||
console.log("show_info",uuid)
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ const { ccclass, property } = _decorator;
|
||||
@ecs.register('ItemInfo', false)
|
||||
export class ItemInfoComp extends CCComp {
|
||||
onAdded(args: any) {
|
||||
this.node.setSiblingIndex(100);
|
||||
this.node.getChildByName("item").active = false;
|
||||
this.node.getChildByName("skill").active = false;
|
||||
this.node.getChildByName("hero").active = false;
|
||||
|
||||
@@ -78,6 +78,7 @@ export class MissionComp extends CCComp {
|
||||
let mon_set=RandomManager.instance.getRandomByObjectList(MissionSet,1)
|
||||
this.mon_list=mon_set[0]
|
||||
console.log("mission_start:",this.mon_list)
|
||||
this.colose_victory()
|
||||
this.mission_init()
|
||||
// this.mskill_init()
|
||||
this.mon_refresh()
|
||||
@@ -107,14 +108,19 @@ export class MissionComp extends CCComp {
|
||||
monsters[i].HeroView.reset()
|
||||
monsters[i].HeroView.ent.destroy()
|
||||
}
|
||||
for(let i=0;i<rewards.length;i++){
|
||||
rewards[i].ItemComp.reset()
|
||||
rewards[i].ItemComp.ent.destroy()
|
||||
}
|
||||
this.to_mission_home()
|
||||
oops.gui.open(UIID.Victory)
|
||||
|
||||
// this.to_mission_home()
|
||||
this.open_victory()
|
||||
}
|
||||
open_victory(){
|
||||
this.node.getChildByName("victory").active=true
|
||||
this.node.getChildByName("victory").getComponent(VictoryComp).open()
|
||||
}
|
||||
colose_victory(){
|
||||
this.node.getChildByName("victory").active=false
|
||||
}
|
||||
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")
|
||||
@@ -155,15 +161,15 @@ export class MissionComp extends CCComp {
|
||||
}
|
||||
clear_x1(){
|
||||
for (let i in smc.items) {
|
||||
smc.items[i].x1=smc.items[i].x10=0
|
||||
}
|
||||
for (let i in smc.skills) {
|
||||
smc.skills[i].x1=smc.skills[i].x10=0
|
||||
smc.items[i].x1=0
|
||||
}
|
||||
// for (let i in smc.skills) {
|
||||
// smc.skills[i].x1=0
|
||||
// }
|
||||
for (let i in smc.heros) {
|
||||
smc.heros[i].x1=smc.heros[i].x10=0
|
||||
smc.heros[i].x1=0
|
||||
}
|
||||
console.log("clear_x1",smc.items,smc.skills,smc.heros)
|
||||
// console.log("clear_x1",smc.items,smc.heros)
|
||||
}
|
||||
mskill_init(){
|
||||
this.MSComp.group=BoxSet.HERO
|
||||
|
||||
@@ -48,11 +48,11 @@ export class MissionHomeComp extends CCComp {
|
||||
}
|
||||
this.heros=[]
|
||||
this.heros_pos=[
|
||||
{uuid:0,px:-300},
|
||||
{uuid:0,px:-200},
|
||||
{uuid:0,px:-100},
|
||||
{uuid:0,px:0},
|
||||
{uuid:0,px:100},
|
||||
{uuid:0,px:0},
|
||||
{uuid:0,px:-100},
|
||||
{uuid:0,px:-200},
|
||||
{uuid:0,px:-300},
|
||||
]
|
||||
|
||||
let home =this.node.parent.getComponent(CardControllerComp);
|
||||
|
||||
@@ -11,6 +11,8 @@ import { Item } from "./Item";
|
||||
import { UIID } from "../common/config/GameUIConfig";
|
||||
import { PopViewParams, UICallbacks } from "../../../../extensions/oops-plugin-framework/assets/core/gui/layer/Defines";
|
||||
import { RewardComp} from "./RewardComp";
|
||||
import { HChipComp } from "../hero/HChipComp";
|
||||
import { MissionComp } from "./MissionComp";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -27,80 +29,84 @@ export class VictoryComp extends CCComp {
|
||||
}
|
||||
onAdded(args: any) {
|
||||
|
||||
if(smc.vmdata.gold.x1 > 0) {
|
||||
this.node.getChildByName("items").getChildByName("gold").active=true
|
||||
smc.vmdata.gold.x10=smc.vmdata.gold.x1*9
|
||||
}
|
||||
if(smc.vmdata.skp.x1 > 0) {
|
||||
this.node.getChildByName("items").getChildByName("skp").active=true
|
||||
smc.vmdata.skp.x10=smc.vmdata.skp.x1*9
|
||||
}
|
||||
if(smc.vmdata.exp.x1 > 0) {
|
||||
this.node.getChildByName("items").getChildByName("exp").active=true
|
||||
smc.vmdata.exp.x10=smc.vmdata.exp.x1*9
|
||||
}
|
||||
}
|
||||
open(){
|
||||
console.log("Victory open",smc.items,smc.heros)
|
||||
var parent = this.node.getChildByName("items")
|
||||
var path = "game/gui/reward";
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
for (let i in smc.items) {
|
||||
if(smc.items[i].x1 > 0){
|
||||
smc.items[i].x10 =smc.items[i].x1*9
|
||||
var node = instantiate(prefab);
|
||||
let rc:any= node.getComponent(RewardComp)!;
|
||||
rc.init(smc.items[i].uuid,smc.items[i].x1,smc.items[i].x10,parent,0)
|
||||
}
|
||||
}
|
||||
for (let i in smc.skills) {
|
||||
if(smc.skills[i].x1 > 0){
|
||||
smc.skills[i].x10 =smc.skills[i].x1*9
|
||||
var node = instantiate(prefab);
|
||||
let rc:any= node.getComponent(RewardComp)!;
|
||||
rc.init(smc.skills[i].uuid,smc.skills[i].x1,smc.skills[i].x10,parent,2)
|
||||
let item=ecs.getEntity<Item>(Item)
|
||||
item.load(smc.items[i].uuid,smc.items[i].x1,parent)
|
||||
}
|
||||
}
|
||||
for (let i in smc.heros) {
|
||||
if(smc.heros[i].x1 > 0){
|
||||
smc.heros[i].x10 =smc.heros[i].x1*9
|
||||
var node = instantiate(prefab);
|
||||
let rc:any= node.getComponent(RewardComp)!;
|
||||
rc.init(smc.heros[i].uuid,smc.heros[i].x1,smc.heros[i].x10,parent,1)
|
||||
let path = "game/gui/hchip";
|
||||
let prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
let node = instantiate(prefab);
|
||||
node.parent=parent
|
||||
let hc= node.getComponent(HChipComp)
|
||||
hc.update_data(smc.heros[i].uuid,smc.heros[i].x1)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
do_x10(){
|
||||
for (let i in smc.items) {
|
||||
smc.items[i].num+=smc.items[i].x10
|
||||
if(smc.items[i].uuid == 9001){
|
||||
smc.vmdata.gold.num+=smc.items[i].x1*10
|
||||
}
|
||||
if(smc.items[i].uuid == 9003){
|
||||
smc.vmdata.exp.num+=smc.items[i].x1*10
|
||||
}
|
||||
if(smc.items[i].uuid < 9000){
|
||||
smc.items[i].num+=smc.items[i].x1*10
|
||||
|
||||
}
|
||||
}
|
||||
for (let i in smc.heros) {
|
||||
smc.heros[i].num+=smc.heros[i].x10
|
||||
smc.heros[i].num+=smc.heros[i].x1*10
|
||||
}
|
||||
this.clear_x1()
|
||||
this.reset();
|
||||
|
||||
}
|
||||
do_x1(){
|
||||
this.clear_x1()
|
||||
this.reset();
|
||||
}
|
||||
|
||||
clear_x1(){
|
||||
for (let i in smc.items) {
|
||||
smc.items[i].x1=smc.items[i].x10=0
|
||||
}
|
||||
for (let i in smc.skills) {
|
||||
smc.skills[i].x1=smc.skills[i].x10=0
|
||||
if(smc.items[i].uuid == 9001){
|
||||
smc.vmdata.gold.num+=smc.items[i].x1
|
||||
}
|
||||
|
||||
if(smc.items[i].uuid == 9003){
|
||||
smc.vmdata.exp.num+=smc.items[i].x1
|
||||
}
|
||||
if(smc.items[i].uuid < 9000){
|
||||
smc.items[i].num+=smc.items[i].x1
|
||||
|
||||
}
|
||||
}
|
||||
for (let i in smc.heros) {
|
||||
smc.heros[i].x1=smc.heros[i].x10=0
|
||||
smc.heros[i].num+=smc.heros[i].x1
|
||||
}
|
||||
console.log("clear_x1",smc.items,smc.skills,smc.heros)
|
||||
this.clear_x1()
|
||||
}
|
||||
end_mission(){
|
||||
|
||||
clear_x1(){
|
||||
for (let i in smc.items) {
|
||||
smc.items[i].x1=0
|
||||
}
|
||||
// for (let i in smc.skills) {
|
||||
// smc.skills[i].x1=0
|
||||
// }
|
||||
for (let i in smc.heros) {
|
||||
smc.heros[i].x1=0
|
||||
console.log("clear_x1",smc.heros[i].num)
|
||||
}
|
||||
let children = this.node.getChildByName("items").children
|
||||
for (let i in children) {
|
||||
children[i].destroy()
|
||||
}
|
||||
console.log("clear_x1",smc.items,smc.heros)
|
||||
this.node.parent.getComponent(MissionComp).to_mission_home()
|
||||
}
|
||||
|
||||
|
||||
item_show(e:any,val:any){
|
||||
console.log("item_show",val)
|
||||
}
|
||||
@@ -109,6 +115,6 @@ export class VictoryComp extends CCComp {
|
||||
}
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
oops.gui.remove(UIID.Victory, false);
|
||||
this.node.destroy()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user