Browse Source

GameOverReward

0224995 1 week ago
parent
commit
71e0d296bb

+ 3 - 3
assets/Scene/GameScene.scene

@@ -178,7 +178,7 @@
     "_priority": 0,
     "_fov": 45,
     "_fovAxis": 0,
-    "_orthoHeight": 362.0609884332282,
+    "_orthoHeight": 365.52016985138005,
     "_near": 0,
     "_far": 1000,
     "_color": {
@@ -744,7 +744,7 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 250,
+      "width": 150,
       "height": 15
     },
     "_anchorPoint": {
@@ -1064,7 +1064,7 @@
     },
     "_mode": 0,
     "_totalLength": 250,
-    "_progress": 1,
+    "_progress": 0.6,
     "_reverse": false,
     "_id": "40seJaNAlFoYrNcIDkWJT0"
   },

+ 1 - 1
assets/Scene/StartScene.scene

@@ -181,7 +181,7 @@
     "_priority": 0,
     "_fov": 45,
     "_fovAxis": 0,
-    "_orthoHeight": 360,
+    "_orthoHeight": 365.52016985138005,
     "_near": 0,
     "_far": 1000,
     "_color": {

+ 0 - 9
assets/Script/Game/GameFrameWork/ModulerBase.ts

@@ -4,25 +4,19 @@ const { ccclass, property } = _decorator;
 
 @ccclass('ModulerBase')
 export class ModulerBase extends Component {
-    //
     protected _nodes: Map<string, Node> = new Map();
     protected _nodeName: string = "Node";
     get NodeName() { return this._nodeName };
     set NodeName(name: string) { this._nodeName = name }
-    //
 
     init() {
-        //
         this._visit(this.node);
         this.onStart();
-        //
     }
 
-    //
     protected onStart() {
 
     }
-    //
 
     //刷新
     refresh() {
@@ -44,8 +38,6 @@ export class ModulerBase extends Component {
 
     }
 
-
-    //
     private _visit(node: Node) {
         if (node.name.startsWith("_")) {
             this._nodes.set(node.name, node);
@@ -113,7 +105,6 @@ export class ModulerBase extends Component {
     protected unUse() {
 
     }
-    //
 }
 
 

+ 2 - 4
assets/Script/Game/MyApp.ts

@@ -1,4 +1,4 @@
-import { _decorator, Component, Node } from 'cc';
+import { _decorator, Component } from 'cc';
 import { UIMgr } from '../Frames/UIManager';
 import { resMgr } from '../Frames/ResourcesMgr';
 import { dataMgr } from '../Frames/DataManager';
@@ -28,6 +28,4 @@ export class MyApp extends Component {
         UIMgr.closeUI("LoadingUI");
         UIMgr.openUI("Start",UIType.PAGE);
     }
-}
-
-
+}

+ 23 - 4
assets/Script/Game/MyApp/CharacterSlotMgr.ts

@@ -1,7 +1,6 @@
-import { _decorator, Component, instantiate, Node, SpringJoint2D, Sprite, SpriteFrame, TypeScript, UITransform, Vec2 } from 'cc';
-import { resMgr } from '../../Frames/ResourcesMgr';
-import { RoleList } from './RoleList';
+import { _decorator, Component,  Node,  Sprite, UITransform, Vec2 } from 'cc';
 import { RoleCard } from './RoleCard';
+import { PopupUIDataConfig } from './GameScene/Data/PopupUIDataConfig';
 const { ccclass, property } = _decorator;
 
 @ccclass('CharacterSlotMgr')
@@ -11,7 +10,26 @@ export class CharacterSlotMgr extends Component {
         this._roleList = this.node.parent.parent.getChildByName("RoleList");
     }
     start() {
+        this.setCardSlots();
+    }
 
+    private setCardSlots(){
+        const ownCardSlot: number = PopupUIDataConfig.Instance.getAvailableCardSlot();
+        for (const element of this.node.children) {
+            if(element.getSiblingIndex() === (ownCardSlot - 1)){
+                if(element.getChildByName("Lock").active){
+                    element.getChildByName("Label").active = false;
+                    element.getChildByName("Lock").active = false;
+                    this.node.children[ownCardSlot].getChildByName("Label").active = true;
+                }
+            };
+            if(element.getChildByName("Lock").active){
+                if(element.getSiblingIndex() < ownCardSlot){
+                    element.getChildByName("Label").active = false;
+                    element.getChildByName("Lock").active = false;
+                }
+            }
+        }
     }
 
     removeCardImg(pos: Vec2) {
@@ -23,7 +41,8 @@ export class CharacterSlotMgr extends Component {
                     return;
                 }
                 for (const element2 of this._roleList.getChildByPath("view/content").children) {
-                    if (element2.getChildByName("Role_Img").getComponent(Sprite).spriteFrame.name === a.getComponent(Sprite).spriteFrame.name) {
+                    if (element2.getChildByName("Role_Img").getComponent(Sprite).spriteFrame.name 
+                    === a.getComponent(Sprite).spriteFrame.name) {
                         element2.getComponent(RoleCard).isOpenShadow(false);
                         a.getComponent(Sprite).spriteFrame = null;
                         return;

+ 15 - 1
assets/Script/Game/MyApp/GameScene/Bottom.ts

@@ -5,6 +5,7 @@ import { resMgr } from '../../../Frames/ResourcesMgr';
 import { messageMgr } from '../../../Frames/MessageMgr';
 import { RoleData } from '../../../DataItem/ItemData';
 import { dataMgr } from '../../../Frames/DataManager';
+import { PopupUIDataConfig } from './Data/PopupUIDataConfig';
 const { ccclass, property } = _decorator;
 
 @ccclass('Bottom')
@@ -34,6 +35,7 @@ export class Bottom extends ModulerBase {
         this._updateLabel();
         this._speed = GameInfo.Instance.getOreSpeed();
         this._setRoleImg();
+        this.closeLock();
         //注册消息
         messageMgr.addEvent("addOreCount", this.onEnemyDeath, this)
     }
@@ -78,7 +80,7 @@ export class Bottom extends ModulerBase {
     }
 
     onEnemyDeath() {
-        this.oreCount += 3;
+        this.oreCount += 30;
         this._updateLabel();
     }
     onReduce(count: number) {
@@ -89,6 +91,18 @@ export class Bottom extends ModulerBase {
         }
         this._updateLabel();
     }
+
+    private closeLock(){
+        const ownCardSlot: number = PopupUIDataConfig.Instance.getAvailableCardSlot();
+        for (const cardSlot of this._characterSlot.children) {
+            if(cardSlot.getChildByName("Lock").active){
+                if(cardSlot.getSiblingIndex() < ownCardSlot){
+                    cardSlot.getChildByName("Lock").active = false;
+                }
+            }
+        }
+    }
+
     private _updateLabel() {
         if (this._oreSpeed) {
             this.getLabel("_oreSpeed").string = String(this.oreCount);

+ 1 - 1
assets/Script/Game/MyApp/GameScene/Data/PopupUIDataConfig.ts

@@ -9,7 +9,7 @@ export class PopupUIDataConfig {
     private _funcYes: any = null;
 
     //可用军队卡槽数量
-    private _availableCardSlot: number = 3;
+    private _availableCardSlot: number = 4;
 
     private static _instance: PopupUIDataConfig = null;
     private constructor() { };

+ 0 - 148
assets/Script/Game/MyApp/GameScene/GameOver-001.ts

@@ -1,148 +0,0 @@
-import { _decorator, director, find, Label } from 'cc';
-import { UIBase } from '../../GameFrameWork/UIBase';
-import { resMgr } from '../../../Frames/ResourcesMgr';
-//import { GameOverData } from './Data/GameOverData';
-import { UIMgr } from '../../../Frames/UIManager';
-const { ccclass, property } = _decorator;
-
-@ccclass('GameOver')
-export class GameOver extends UIBase {
-    // //是否胜利
-    // win: boolean = null;
-
-    // killCount: number = null;
-    // killPercent: number = null;
-
-    // //金币奖励
-    // killAward: number = null;
-    // lifeAward: number = null;
-    // stageClearAward: number = null;
-    // totalAward: number = null;
-
-    // //经验奖励
-    // xp: number = null;
-    // //钻石奖励
-    // lifeDia: number = null;
-    // stageClearDia: number = null;
-    // totalDia: number = null;
-
-    //gameOverDt: GameOverData = null;
-    // protected onStart() {
-    //     //this.gameOverDt = GameOverData.Instance;
-    //     this.onBtnClick("_btnLeft", this._onBtnBack);
-    //     this._calculatedReward();
-    //     this._config();
-    // }
-
-    // config() {
-    //     this.getSprite("_gameOverUITitle").spriteFrame = this.win ?
-    //         resMgr.getSpriteFrame("GameWin") :
-    //         resMgr.getSpriteFrame("GameOver");
-    //     this.getLabel("_labelRight").string = this.win ? "下一关" : "重新开始";
-
-    //     const labelDate = {
-    //         "_killCount":this.killCount,
-    //         "_lifePercent":`${this.killPercent} %`,
-    //         "_kill":this.killAward,
-    //         "_life":this.lifeAward,
-    //         "_stageClear":this.stageClearAward,
-    //         "_total":this.totalAward,
-    //         "_xp":this.xp,
-    //         "_lifeDia":this.lifeDia,
-    //         "_stageClearDia":this.stageClearDia,
-    //         "_totalDia":this.totalDia,
-    //     }
-    //     this._setLabels(labelDate);
-    //     // this.getLabel("_killCount").string = String(this.killCount);
-    //     // this.getLabel("_lifePercent").string = `${String(this.killPercent)} %`;
-    //     // this.getLabel("_kill").string = String(this.killAward);
-    //     // this.getLabel("_life").string = String(this.lifeAward);
-    //     // this.getLabel("_stageClear").string = String(this.stageClearAward);
-    //     // this.getLabel("_total").string = String(this.totalAward);
-    //     // this.getLabel("_xp").string = String(this.xp);
-    //     // this.getLabel("_lifeDia").string = String(this.lifeDia);
-    //     // this.getLabel("_stageClearDia").string = String(this.stageClearDia);
-    //     // this.getLabel("_totalDia").string = String(this.totalDia);
-    // }
-
-    // private _setLabels(labelDate){
-    //     for(const [labelName, value] of labelDate){
-    //         this.getLabel(labelName).string = String(value);
-    //     }
-    // }
-
-    // private _calculatedReward() {
-    //     if (this.gameOverDt.KillCount >= 20) {
-    //         this.gameOverDt.KillAward = 100;
-    //         this.gameOverDt.Xp = 30;
-    //     } else if (this.gameOverDt.KillCount < 20) {
-    //         this.gameOverDt.KillAward = 50;
-    //         this.gameOverDt.Xp = 15;
-    //     }
-
-    //     if (this.gameOverDt.LifePercent === 100) {
-    //         this.gameOverDt.LifeAward = 40;
-    //         this.gameOverDt.LifeDia = 10;
-    //     } else if (this.gameOverDt.LifePercent >= 50 && this.gameOverDt.LifePercent < 100) {
-    //         this.gameOverDt.LifeAward = 30;
-    //         this.gameOverDt.LifeDia = 6;
-    //     } else if (this.gameOverDt.LifePercent >= 0 && this.gameOverDt.LifePercent < 50) {
-    //         this.gameOverDt.LifeAward = 20;
-    //         this.gameOverDt.LifeDia = 2;
-    //     }
-        
-    //     // if(this.gameOverDt.Win){
-    //     //     this.gameOverDt.StageClearDia = 10;
-    //     // } else {
-    //     //     this.gameOverDt.StageClearDia = 2;
-    //     // }
-
-    //     this.gameOverDt.StageClearDia = this.gameOverDt.Win ? 10 : 2;
-
-    //     this.gameOverDt.TotalAward = this.gameOverDt.KillAward + this.gameOverDt.LifeAward;
-    //     this.gameOverDt.TotalDia = this.gameOverDt.LifeDia + this.gameOverDt.StageClearDia;
-    // }
-
-    // private _config() {
-
-    //     this.getSprite("_gameOverUITitle").spriteFrame = this.gameOverDt.Win ?
-    //         resMgr.getSpriteFrame("GameWin") : resMgr.getSpriteFrame("GameOver");
-    //     this.getNode("_btnRight").getChildByName("Label").getComponent(Label).string =
-    //      this.gameOverDt.Win ? "下一关" : "重新开始";
-
-    //     const labelData = new Map<string, number | string>();
-    //     labelData.set("_killCount", this.gameOverDt.KillCount);
-    //     labelData.set("_lifePercent", `${this.gameOverDt.LifePercent} %`);
-    //     labelData.set("_kill", this.gameOverDt.KillAward);
-    //     labelData.set("_life", this.gameOverDt.LifeAward);
-    //     //通关奖励:StageClearAward
-    //     labelData.set("_stageClear", this.gameOverDt.StageClearAward);
-    //     labelData.set("_total", this.gameOverDt.TotalAward);
-    //     labelData.set("_xp", this.gameOverDt.Xp);
-    //     labelData.set("_lifeDia", this.gameOverDt.LifeDia);
-    //     labelData.set("_stageClearDia", this.gameOverDt.StageClearDia);
-    //     labelData.set("_totalDia", this.gameOverDt.TotalDia);
-
-    //     this._setLabels(labelData);
-    // }
-
-    private _setLabels(labelData: Map<string, number | string>) {
-        for (const [labelName, value] of labelData.entries()) {
-            this.getLabel(labelName).string = String(value);
-        }
-    }
-
-    private _onBtnBack() {
-        director.removeAll(find("Canvas/GameRoot/EnemyMgr"));
-        director.removeAll(find("Canvas/GameRoot/Skill_Range/Roles"));
-        find("Canvas/GameRoot/EnemyMgr").removeAllChildren();
-        find("Canvas/GameRoot/Skill_Range/Roles").removeAllChildren();
-        //销毁
-        //this.gameOverDt.clearData();
-        
-        UIMgr.closeUI("GameOver", true)
-        director.loadScene("StartScene");
-    }
-}
-
-

+ 0 - 1
assets/Script/Game/MyApp/GameScene/GameOver-001.ts.meta

@@ -1 +0,0 @@
-{"ver":"4.0.23","importer":"typescript","imported":true,"uuid":"2ef752dd-4b87-4a29-8b0c-f08419e578a5","files":[],"subMetas":{},"userData":{}}

+ 36 - 5
assets/Script/Game/MyApp/GameScene/GameOver.ts

@@ -2,6 +2,7 @@ import { _decorator, director, Label, } from 'cc';
 import { ModulerBase } from '../../GameFrameWork/ModulerBase';
 import { resMgr } from '../../../Frames/ResourcesMgr';
 import { GameInfo } from '../../../GameInfo';
+import { messageMgr } from '../../../Frames/MessageMgr';
 const { ccclass, property } = _decorator;
 
 @ccclass('GameOver')
@@ -34,6 +35,10 @@ export class GameOver extends ModulerBase {
         { min: 26, max: Infinity, reward: 350 },
     ]
 
+    private xp: number = null;
+    private totalGold: number = null;
+    private totalDia: number = null;
+
     protected onEnable(): void {
         this.config();
     }
@@ -52,23 +57,31 @@ export class GameOver extends ModulerBase {
 
         this.getLabel("_lifePercent").string = `${GameInfo.Instance.getLifePecent()}%`;
         this.getLabel("_killCount").string = `${GameInfo.Instance.getKillCount()}`;
+        
         const kill: number = this.calculateReward(GameInfo.Instance.getKillCount(), this.KillRewardConfig);
         const life: number = this.calculateReward(GameInfo.Instance.getLifePecent(), this.LifeRewardConfig);
         const stageClear: number = this.calculateReward(GameInfo.Instance.getCurlv(), this.newresultRewardConfig);
-        const xp: number = GameInfo.Instance.getCurlv() * 30;
+        
+        this.xp = GameInfo.Instance.getCurlv() * 30;
+        this.totalGold = kill + life + stageClear;
+        
         const lifeDia: number = Math.floor(life * 0.08);
-        const stageClearDia: number = Math.floor(stageClear * 0.07)
+        const stageClearDia: number = Math.floor(stageClear * 0.07);
+        
+        this.totalDia = lifeDia + stageClearDia;
+        
         this.getLabel("_kill").string = `${kill}`;
         this.getLabel("_life").string = `${life}`;
         this.getLabel("_stageClear").string = `${stageClear}`;
-        this.getLabel("_total").string = `${kill + life + stageClear}`;
-        this.getLabel("_xp").string = `${xp}`;
+        this.getLabel("_total").string = `${this.totalGold}`;
+        this.getLabel("_xp").string = `${this.xp}`;
         this.getLabel("_lifeDia").string = `${lifeDia}`;
         this.getLabel("_stageClearDia").string = `${stageClearDia}`;
-        this.getLabel("_totalDia").string = `${lifeDia + stageClearDia}`;
+        this.getLabel("_totalDia").string = `${this.totalDia}`;
     }
 
     private _onBtnBack() {
+        this.addReward();
         this.clearDt();
         this.hide(false);
         director.loadScene("StartScene");
@@ -76,11 +89,14 @@ export class GameOver extends ModulerBase {
 
     private _onBtnRight() {
         if(GameInfo.Instance.getOverWin()){
+            this.addReward();
             console.log("下一关")
         } else {
             console.log("重新开始")
         }
+        this.clearDt();
     }
+
     //计算奖励
     private calculateReward(lifeReward: number, rewardConfig: any) {
         const matchRule = rewardConfig.find(rule =>
@@ -89,11 +105,26 @@ export class GameOver extends ModulerBase {
         return matchRule ? matchRule.reward : 0;
     }
 
+    //清除数据
     private clearDt() {
         GameInfo.Instance.setKillCount(0);
         GameInfo.Instance.setLifePecent(0);
         GameInfo.Instance.setOverWin(false)
     }
+
+    private addReward(){
+        const map: Map<string, number> = new Map();
+        map.set("GameOverRewardGold",this.totalGold + GameInfo.Instance.getGold());
+        map.set("GameOverRewardDia", this.totalDia + GameInfo.Instance.getDiamond());
+        map.set("Xp", this.xp + GameInfo.Instance.getCurGradeExp());
+        if(GameInfo.Instance.getOverWin()){
+            GameInfo.Instance.setCurLv(GameInfo.Instance.getCurlv() + 1);
+            map.set("CurLv", GameInfo.Instance.getCurlv());
+        }
+        GameInfo.Instance.setGameOverReward(map);
+        GameInfo.Instance.setGold(this.totalGold + GameInfo.Instance.getGold());
+        GameInfo.Instance.setDiamond(this.totalDia + GameInfo.Instance.getDiamond());
+    }
 }
 
 

+ 1 - 1
assets/Script/Game/MyApp/Role.ts

@@ -104,7 +104,7 @@ export class Role extends Component {
     private _setRoleData(roleData: RoleData) {
         this.hp = roleData.hp;
         this.atk = roleData.atk;
-        this.atkLength = roleData.atkLength + 100;
+        this.atkLength = roleData.atkLength;
         this.moveSpeed = roleData.moveSpeed;
     }
 

+ 1 - 0
assets/Script/Game/MyApp/SelectTroopsBottom.ts

@@ -23,6 +23,7 @@ export class SelectTroopsBottom extends Component {
         this._names = this._getNames();
         if (this._names) {
             GameInfo.Instance.setRoleImgNames(this._names);
+            GameInfo.Instance.getGameOverReward().clear();
             director.loadScene("GameScene");
         }
     }

+ 1 - 2
assets/Script/Game/MyApp/TouchCharacterSlot.ts

@@ -1,8 +1,7 @@
-import { _decorator, find, Label, math, Node, Rect, UITransform } from 'cc';
+import { _decorator, math, Node, Rect, UITransform } from 'cc';
 import { TouchMgr } from './TouchMgr';
 import { CharacterSlotMgr } from './CharacterSlotMgr';
 import { UIMgr } from '../../Frames/UIManager';
-import { PopupUI } from '../UI/PopupUI';
 import { UIType } from '../GameFrameWork/UIBase';
 import { PopupUIDataConfig } from './GameScene/Data/PopupUIDataConfig';
 const { ccclass, property } = _decorator;

+ 5 - 5
assets/Script/Game/UI/BattleSceneLeft.ts

@@ -1,4 +1,4 @@
-import { _decorator, } from 'cc';
+import { _decorator, director, } from 'cc';
 import { GameInfo } from '../../GameInfo';
 import { resMgr } from '../../Frames/ResourcesMgr';
 import { ModulerBase } from '../GameFrameWork/ModulerBase';
@@ -9,20 +9,20 @@ const { ccclass, property } = _decorator;
 
 @ccclass('BattleSceneLeft')
 export class BattleSceneLeft extends ModulerBase {
-
     protected onStart() {
         this._curLv(GameInfo.Instance.getCurlv());
         this.onBtnClick("_btnLevel", this._btnLevel);
+        if(GameInfo.Instance.getOverWin() && GameInfo.Instance.getGameOverReward().size != 0){
+            this._curLv(GameInfo.Instance.getGameOverReward().get("CurLv"));
+        }
     }
 
     //当前关卡
     private _curLv(lv: number) {
-        this.getLabel("_curLv").string = String(GameInfo.Instance.getCurlv());
+        this.getLabel("_curLv").string = String(lv);
     }
 
     private _btnLevel() {
-        // UIMgr.sendMsg("_battleMode", "BattleScene_Top");
-        // UIMgr.sendMsg("_batlleRightHide", "BattleScene_Right");
         GameMgr.Instance.getModuler(SelectTroops).show();
         GameMgr.Instance.getModuler(BattleSceneTop).battleMode("选择部队")
     }

+ 28 - 13
assets/Script/Game/UI/BattleSceneRight.ts

@@ -6,37 +6,52 @@ const { ccclass, property } = _decorator;
 @ccclass('BattleSceneRight')
 export class BattleSceneRight extends ModulerBase {
     //当前等级拥有的经验
-    private _curGradeExp: number = 10;
+    //private _curGradeExp: number = 10;
     //当前等级升级所需经验
     private _curGradeNeedExp: number = 100;
     private _progressBar: ProgressBar = null;
     protected onStart() {
+        
         this._grade(GameInfo.Instance.getGrade());
         this._winNumber(GameInfo.Instance.getWin());
         this._failNumber(GameInfo.Instance.getFail());
         this._progressBar = this.getNode("_ProgressBar").getComponent(ProgressBar);
-        this._progressBar.progress = (this._curGradeExp / this._curGradeNeedExp);
+        this._progressBar.progress = (GameInfo.Instance.getCurGradeExp() / this._curGradeNeedExp);
         this.onBtnClick("_btnArena", this._onBtnArenaClick);
-        this._exp(this._curGradeExp, this._curGradeNeedExp)
+        this._exp(GameInfo.Instance.getCurGradeExp(), this._curGradeNeedExp);
+        if (GameInfo.Instance.getGameOverReward()?.size != 0) {
+            this._setProgress(GameInfo.Instance.getGameOverReward().get("Xp"));
+        }
     }
     private _setProgress(addExp: number) {
-        this._curGradeExp += addExp;
-        if(this._curGradeExp >= this._curGradeNeedExp){
-            this._curGradeExp -= this._curGradeNeedExp;
+        GameInfo.Instance.setCurGradeExp(addExp);
+        if (GameInfo.Instance.getCurGradeExp() >= this._curGradeNeedExp) {
+            GameInfo.Instance.setCurGradeExp(
+                GameInfo.Instance.getCurGradeExp() - this._curGradeNeedExp);
             this._curGradeNeedExp *= 2;
             this._grade((GameInfo.Instance.getGrade() + 1));
-            this._exp(this._curGradeExp, this._curGradeNeedExp);
-            this._progressBar.progress = (this._curGradeExp / this._curGradeNeedExp);
+            this._exp(GameInfo.Instance.getCurGradeExp(), this._curGradeNeedExp);
+            this._progressBar.progress = (GameInfo.Instance.getCurGradeExp() / this._curGradeNeedExp);
         }
-        this._exp(this._curGradeExp, this._curGradeNeedExp);
-        this._progressBar.progress = (this._curGradeExp / this._curGradeNeedExp);
+        this._exp(GameInfo.Instance.getCurGradeExp(), this._curGradeNeedExp);
+        this._progressBar.progress = (GameInfo.Instance.getCurGradeExp() / this._curGradeNeedExp);
+        // this._curGradeExp += addExp;
+        // if(this._curGradeExp >= this._curGradeNeedExp){
+        //     this._curGradeExp -= this._curGradeNeedExp;
+        //     this._curGradeNeedExp *= 2;
+        //     this._grade((GameInfo.Instance.getGrade() + 1));
+        //     this._exp(this._curGradeExp, this._curGradeNeedExp);
+        //     this._progressBar.progress = (this._curGradeExp / this._curGradeNeedExp);
+        // }
+        // this._exp(this._curGradeExp, this._curGradeNeedExp);
+        // this._progressBar.progress = (this._curGradeExp / this._curGradeNeedExp);
     }
 
-    private _onBtnArenaClick(){
-        this._setProgress(30);
+    private _onBtnArenaClick() {
+        //this._setProgress(30);
     }
 
-    private _exp(curExp: number, needExp: number){
+    private _exp(curExp: number, needExp: number) {
         this.getLabel("_exp").string = `${curExp}/${needExp}`;
     }
 

+ 4 - 0
assets/Script/Game/UI/BattleSceneTop.ts

@@ -17,6 +17,10 @@ export class BattleSceneTop extends ModulerBase {
         this.battleMode("战斗模式");
         messageMgr.addEvent("reduceGold", this._gold, this);
         messageMgr.addEvent("reduceDiamond", this._diamond, this);
+        if (GameInfo.Instance.getGameOverReward()?.size != 0) {
+            this._gold(GameInfo.Instance.getGameOverReward().get("GameOverRewardGold"));
+            this._diamond(GameInfo.Instance.getGameOverReward().get("GameOverRewardDia"));
+        }
     }
 
     //金币数量

+ 3 - 12
assets/Script/Game/UI/Start.ts

@@ -1,5 +1,5 @@
-import { _decorator, Component, Node } from 'cc';
-import { UIBase, UIType } from '../GameFrameWork/UIBase';
+import { _decorator } from 'cc';
+import { UIBase } from '../GameFrameWork/UIBase';
 import { UIMgr } from '../../Frames/UIManager';
 const { ccclass, property } = _decorator;
 
@@ -12,19 +12,10 @@ export class Start extends UIBase {
 
     private _btnStart() {
         UIMgr.closeUI("Start");
-        //UIMgr.openUI("BattleSceneSelect");
-
-        // UIMgr.openUI("BattleScene_Left", UIType.WIDGET);
-        // UIMgr.openUI("BattleScene_Right", UIType.WIDGET);
-        // UIMgr.openUI("BattleScene_Top", UIType.WIDGET);
     }
 
     private _btnMusic() {
-        // let _roleData: RoleData[] = null;
-        // _roleData = dataMgr.getAllDataByName("RoleCardData");
-        // _roleData.forEach((values,index)=>{
-        //     this.createRoleCard(index)
-        // })
+
     }
 }
 

+ 27 - 8
assets/Script/GameInfo.ts

@@ -24,6 +24,9 @@ export class GameInfo {
     //拥有钻石数量
     private _ownDiamondNum: number = 30;
 
+    //拥有卡槽数量
+    private _ownCardSlot: number = 3;
+
     //释放技能需要的钻石数量
     private _needDiamondNum: number = 3;
 
@@ -39,7 +42,13 @@ export class GameInfo {
     private _win: boolean = null;
     private _lifePercent: number = null;
     private _killCount: number = 0;
-    
+
+    //当前等级拥有经验
+    private _curGradeExp: number = 10;
+
+    //游戏结束奖励
+    private _gameOverReward: Map<string, number> = new Map();
+
     private constructor() { };
     static get Instance(): GameInfo {
         if (!this._instance) {
@@ -100,16 +109,26 @@ export class GameInfo {
     setSkill(name: string) { this._skill = name };
 
     //游戏是否结束
-    getIsGameOver(): boolean { return this._isGameOver};
+    getIsGameOver(): boolean { return this._isGameOver };
     setIsGameOver(gameOver: boolean) { this._isGameOver = gameOver };
 
     //游戏结束了胜利还是失败
-    getOverWin(): boolean { return this._win};
-    setOverWin(win: boolean) { this._win = win};
+    getOverWin(): boolean { return this._win };
+    setOverWin(win: boolean) { this._win = win };
+
+    getLifePecent(): number { return this._lifePercent };
+    setLifePecent(lifePercent: number) { this._lifePercent = lifePercent };
+
+    getKillCount(): number { return this._killCount };
+    setKillCount(KillCount: number) { this._killCount = KillCount };
+
+    //卡槽数量
+    getOwnCardSlot(): number { return this._ownCardSlot };
+    setOwnCardSlot(cardSlot: number) { this._ownCardSlot = cardSlot };
 
-    getLifePecent(): number { return this._lifePercent};
-    setLifePecent(lifePercent: number) { this._lifePercent = lifePercent};
+    getGameOverReward(): Map<string, number> { return this._gameOverReward };
+    setGameOverReward(map: Map<string, number>) { this._gameOverReward = map };
 
-    getKillCount(): number { return this._killCount};
-    setKillCount(KillCount: number) { this._killCount = KillCount};
+    getCurGradeExp(): number { return this._curGradeExp };
+    setCurGradeExp(curGradeExp: number) { this._curGradeExp = curGradeExp };
 }

+ 12 - 0
assets/resources/Data/LevelDt.csv

@@ -8,3 +8,15 @@ lv5,5,5,Role5;Role7;Role9;Role12;Role8;Role14,3500,Scene_5
 lv6,6,6,Role6;Role8;Role10;Role13;Role9;Role1,3700,Scene_6
 lv7,7,7,Role7;Role9;Role11;Role14;Role10,3700,Scene_7
 lv8,8,8,Role8;Role10;Role12;Role1;Role11,4000,Scene_3
+lv9,9,9,Role7;Role9;Role11;Role14;Role10,4000,Scene_4
+lv10,10,10,Role1;Role3;Role5;Role8;Role4;Role10,4500,Scene_2
+lv11,11,11,Role4;Role6;Role8;Role11;Role7;Role13,4500,Scene_3
+lv12,12,12,Role7;Role9;Role11;Role14;Role10,4500,Scene_5
+lv13,13,13,Role8;Role10;Role12;Role1;Role11,4800,Scene_4
+lv14,14,14,Role6;Role8;Role10;Role13;Role9;Role1,4800,Scene_1
+lv15,15,15,Role4;Role6;Role8;Role11;Role7;Role13,4800,Scene_3
+lv16,16,16,Role8;Role10;Role12;Role1;Role11,5000,Scene_5
+lv17,17,17,Role6;Role8;Role10;Role13;Role9;Role1,5000,Scene_2
+lv18,18,18,Role5;Role7;Role9;Role12;Role8;Role14,5000,Scene_5
+lv19,19,19,Role4;Role6;Role8;Role11;Role7;Role13,5500,Scene_7
+lv20,20,20,Role1;Role3;Role5;Role8;Role4;Role10,5500,Scene_1

+ 14 - 14
assets/resources/Data/RoleCardData.csv

@@ -1,16 +1,16 @@
 名称,id,imgName,atk,hp,atkLength,moveSpeed,typeRole,moveCount,moveImg,atkCount,atkImg,idleCount,idleImg,dieCount,dieImg,bulletCount,bulletImg,bulletExplodeCount,bulletExplodeImg,consume
 ,number,string,number,number,number,number,string,number,string,number,string,number,string,number,string,number,string,number,string,number
-Role1,1,Role1,35,400,140,40,water,8,Role1_move_,8,Role1_attack_,8,Role1_idle_,9,Die,4,bullet1_,5,burst3_,9
-Role2,2,Role2,40,520,135,35,fire,8,Role2_move_,8,Role2_attack_,8,Role2_idle_,9,Die,3,bullet2_,8,burst2_,10
-Role3,3,Role3,32,480,147,30,wind,8,Role3_move_,8,Role3_attack_,8,Role3_idle_,9,Die,3,bullet3_,5,burst7_,11
-Role4,4,Role4,25,500,150,38,fire,8,Role4_move_,8,Role4_attack_,8,Role4_idle_,9,Die,1,bullet4_,10,burst6_,9
-Role5,5,Role5,32,600,145,42,water,8,Role5_move_,8,Role5_attack_,8,Role5_idle_,9,Die,1,bullet5_,6,burst9_,10
-Role6,6,Role6,28,489,145,40,dark,8,Role6_move_,8,Role6_attack_,8,Role6_idle_,9,Die,4,bullet6_,5,burst7_,9
-Role7,7,Role7,41,512,157,37,light,8,Role7_move_,8,Role7_attack_,8,Role7_idle_,9,Die,3,bullet7_,11,burst10_,10
-Role8,8,Role8,100,500,140,41,dark,8,Role8_move_,8,Role8_attack_,8,Role8_idle_,9,Die,3,bullet8_,6,burst9_,11
-Role9,9,Role9,120,600,140,20,dark,8,Role9_move_,8,Role9_attack_,8,Role9_idle_,9,Die,11,bullet9_,17,burst1_,11
-Role10,10,Role10,70,700,130,30,dark,8,Role10_move_,8,Role10_attack_,8,Role10_idle_,9,Die,3,bullet8_,6,burst9_,10
-Role11,11,Role11,80,560,120,25,dark,8,Role11_move_,8,Role11_attack_,8,Role11_idle_,9,Die,3,bullet3_,5,burst7_,9
-Role12,12,Role12,90,645,160,20,dark,8,Role12_move_,8,Role12_attack_,8,Role12_idle_,9,Die,3,bullet8_,6,burst9_,11
-Role13,13,Role13,60,850,145,30,dark,8,Role13_move_,8,Role13_attack_,8,Role13_idle_,9,Die,3,bullet10_,6,burst8_,9
-Role14,14,Role14,75,750,140,50,dark,8,Role14_move_,8,Role14_attack_,8,Role14_idle_,9,Die,1,bullet5_,6,burst9_,9
+Role1,1,Role1,35,400,240,40,water,8,Role1_move_,8,Role1_attack_,8,Role1_idle_,9,Die,4,bullet1_,5,burst3_,9
+Role2,2,Role2,40,520,235,35,fire,8,Role2_move_,8,Role2_attack_,8,Role2_idle_,9,Die,3,bullet2_,8,burst2_,10
+Role3,3,Role3,32,480,247,30,wind,8,Role3_move_,8,Role3_attack_,8,Role3_idle_,9,Die,3,bullet3_,5,burst7_,11
+Role4,4,Role4,25,500,250,38,fire,8,Role4_move_,8,Role4_attack_,8,Role4_idle_,9,Die,1,bullet4_,10,burst6_,9
+Role5,5,Role5,32,600,245,42,water,8,Role5_move_,8,Role5_attack_,8,Role5_idle_,9,Die,1,bullet5_,6,burst9_,10
+Role6,6,Role6,28,489,245,40,dark,8,Role6_move_,8,Role6_attack_,8,Role6_idle_,9,Die,4,bullet6_,5,burst7_,9
+Role7,7,Role7,41,512,257,37,light,8,Role7_move_,8,Role7_attack_,8,Role7_idle_,9,Die,3,bullet7_,11,burst10_,10
+Role8,8,Role8,100,500,240,41,dark,8,Role8_move_,8,Role8_attack_,8,Role8_idle_,9,Die,3,bullet8_,6,burst9_,11
+Role9,9,Role9,120,600,240,20,dark,8,Role9_move_,8,Role9_attack_,8,Role9_idle_,9,Die,11,bullet9_,17,burst1_,11
+Role10,10,Role10,70,700,230,30,dark,8,Role10_move_,8,Role10_attack_,8,Role10_idle_,9,Die,3,bullet8_,6,burst9_,10
+Role11,11,Role11,80,560,220,25,dark,8,Role11_move_,8,Role11_attack_,8,Role11_idle_,9,Die,3,bullet3_,5,burst7_,9
+Role12,12,Role12,90,645,260,20,dark,8,Role12_move_,8,Role12_attack_,8,Role12_idle_,9,Die,3,bullet8_,6,burst9_,11
+Role13,13,Role13,60,850,245,30,dark,8,Role13_move_,8,Role13_attack_,8,Role13_idle_,9,Die,3,bullet10_,6,burst8_,9
+Role14,14,Role14,75,750,240,50,dark,8,Role14_move_,8,Role14_attack_,8,Role14_idle_,9,Die,1,bullet5_,6,burst9_,9