Переглянути джерело

Merge branch 'master' of http://git.mokasz.com/zouyong/tower_sanguo

薛鸿潇 5 роки тому
батько
коміт
7ada841706

+ 0 - 2
tools/messages.md

@@ -109,10 +109,8 @@
             "name": "updateMission",
             "name": "updateMission",
             "method": "POST",
             "method": "POST",
             "data": {
             "data": {
-                mid:number,//关卡id
                 max:[gid],//最大战力武将id
                 max:[gid],//最大战力武将id
                 last:[gid]//通关时武将id
                 last:[gid]//通关时武将id
-                useskill:number, //是否使用技能 0未使用 1使用
             },
             },
             "response": {
             "response": {
                 "data": {
                 "data": {

+ 8 - 9
tower_sanguo/assets/MOKA/manager/SDKManager.ts

@@ -17,22 +17,21 @@ export default class SDKManager {
     //是否在登录之后上报邀请人id,用于上报裂变拉入的统计
     //是否在登录之后上报邀请人id,用于上报裂变拉入的统计
     static sendReport: boolean = false
     static sendReport: boolean = false
 
 
-    init() {        
-        if (cc.sys.os == cc.sys.OS_WINDOWS) {
+    init() {
+        console.log("sdkManager.init", cc.sys.os, cc.sys.platform, cc.sys.isNative);
+
+        if (cc.sys.isNative) {
+            this.sdk = new AndroidSDK();
+        }
+        else if (cc.sys.os == cc.sys.OS_WINDOWS) {
             this.sdk = new WindowTest();
             this.sdk = new WindowTest();
         }
         }
         else if (cc.sys.platform == cc.sys.WECHAT_GAME) {
         else if (cc.sys.platform == cc.sys.WECHAT_GAME) {
             this.sdk = new MokaWxSDK();
             this.sdk = new MokaWxSDK();
         }
         }
-        else if(cc.sys.isNative) {
-            this.sdk = new AndroidSDK();
-        }
-        if(this.sdk){
+        if (this.sdk) {
             this.sdk.init();
             this.sdk.init();
         }
         }
-        else{
-            console.log(cc.sys.os,cc.sys.platform);
-        }
     }
     }
 
 
     /**
     /**

+ 1 - 1
tower_sanguo/assets/MOKA/manager/UIManager.ts

@@ -73,7 +73,7 @@ export default class UIManager {
             ui.tag = uiClass;
             ui.tag = uiClass;
 
 
             callback && callback(ui);
             callback && callback(ui);
-            cc.log('-----openUI----[   ', uiClass.getName(), '   ]----------');
+            //cc.log('-----openUI----[   ', uiClass.getName(), '   ]----------');
         });
         });
     }
     }
 
 

+ 231 - 0
tower_sanguo/assets/MOKA/util/TimeUtil.ts

@@ -0,0 +1,231 @@
+class TimeUtil {
+	public constructor() {
+	}
+
+	/**
+	 * 真正的当前时间
+	 */
+	public static getCurrentTime():number
+	{
+		var time:Date = new Date();
+		return time.getTime();// + time.getTimezoneOffset() * 60 * 1000; 这个时间不对,直接getTime是对的,除非这取的不是本地时间@zhang
+	}
+
+	private static localTime:number;
+	private static offTime:number = 0;
+	/**获取当前的服务器时间 */
+	public static getCrtServerTime():number{
+		return Math.ceil(new Date().getTime() / 1000 + this.offTime);
+	}
+
+	/**
+	 * 获取服务器日期
+	 */
+	public static getServerDate(){
+		return new Date(TimeUtil.getCrtServerTime()*1000);
+	}
+
+	/**
+	 * 返回一年中的第N天
+	 * @param t 秒
+	 */
+
+
+	public static GetDayInYear(t:number):number{
+		var time:Date = new Date(t);
+		var month = time.getMonth()+1;
+		var year = time.getFullYear();
+		var days = time.getDate();
+		var sum = 0;
+
+		let a = [31,28,31,30,31,30,31,31,30,31,30,31];
+		let b = [31,29,31,30,31,30,31,31,30,31,30,31];
+		if(year%400==0 || (year%4==0 && year%100!=0)){
+			for(var i:number=0;i<month-1;i++){
+				sum += b[i];
+		    }
+			return sum + days;
+		}else{
+			for(var i:number=0;i<month-1;i++){
+				sum += a[i];
+		    }
+			return sum + days;
+		}
+		
+
+		// if(year%400==0 || (year%4==0 && year%100!=0)){
+		// 	return 1;
+		// }else{
+		// 	return 0;
+		// }
+
+		
+		
+		
+
+		// function get_month_days(m){
+		// 	var d = 0;
+		// 	if(m==1 || m==3 || m==5 || m==7 || m==8 || m==10 || m==12)
+		// 		d = 31;
+		// 	else if(m==4 || m==6 || m==9 || m==11)
+		// 		d = 30;
+		// 	else if(year%400==0 || (year%4==0 && year%100!=0))
+		// 		d = 29;
+		// 	else
+		// 		d = 28;
+		// 	return d;
+		// }
+		
+		// var all_days = 0
+		// for(var i = 1; i<=month; i++){
+		// 	if(i == month){
+		// 		all_days += days
+		// 	}else{
+		// 		all_days += get_month_days(i);
+		// 	}
+		// }
+		
+		// return all_days;
+	}
+
+	/**
+	 * 返回时间点在当天的秒数
+	 */
+	public static getSecondInDay(date:Date){
+		return date.getHours()*3600 + date.getMinutes()*60 + date.getSeconds();
+	}
+
+	/**
+	 * 倒计时转换为时间格式(h:m:s) ,可自定义
+	 * @param t 秒
+	 * @param f 格式
+	 */
+	public static ParseTime2Format(t:number, f:string = "h:m:s"):string{
+		var d:number=Math.floor(t/24/3600);
+		var h:number = Math.floor((t/3600)%24);
+		var m:number = Math.floor((t%3600)/60);
+		var s:number = (t%3600)%60;
+
+		function parse_format(t:number):string{
+			var s:string = t.toString();
+			if (t < 10){
+				s = "0" + t;
+			}
+			return s;
+		}
+		if(f.indexOf("d")!=-1){
+			f=f.replace(/d/g, parse_format(d));
+		}
+		else{
+			h+=d*24;
+		}
+		if (f.indexOf("h") != -1){
+			f = f.replace(/h/g, parse_format(h));
+		}else{
+			m += h*60;
+		}
+		if (f.indexOf("m") != -1){
+			f = f.replace(/m/g, parse_format(m));
+		}else{
+			if (f.indexOf("h") != -1){
+				s += m*60;
+			}else{
+				s = t;
+			}
+		}
+		if (f.indexOf("s") != -1){
+			f = f.replace(/s/g, parse_format(s));
+		}
+		return f;
+	}
+
+	/**
+	 * 转换为日期格式
+	 * @param t 毫秒
+	 * @param f 格式 Y/M/D h:m:s
+	 */
+	public static ParseTime2Date(t:number, f:string = "Y-M-D h:m:s"){
+		var d:Date = new Date(t);
+		var Y:number = d.getFullYear();
+		var M:number = d.getMonth()+1;
+		var D:number = d.getDate();
+		var h:number = d.getHours();
+		var m:number = d.getMinutes();
+		var s:number = d.getSeconds();
+
+		function parse_format(t:number):string{
+			var s:string = t.toString();
+			if (t < 10){
+				s = "0" + t;
+			}
+			return s;
+		}
+
+		if (f.indexOf("Y") != -1){
+			f = f.replace(/Y/g, parse_format(Y));
+		}
+		if (f.indexOf("M") != -1){
+			f = f.replace(/M/g, parse_format(M));
+		}
+		if (f.indexOf("D") != -1){
+			f = f.replace(/D/g, parse_format(D));
+		}
+		if (f.indexOf("h") != -1){
+			f = f.replace(/h/g, parse_format(h));
+		}
+		if (f.indexOf("m") != -1){
+			f = f.replace(/m/g, parse_format(m));
+		}
+		if (f.indexOf("s") != -1){
+			f = f.replace(/s/g, parse_format(s));
+		}
+		return f;
+	}
+
+	/**
+	 * 将时间转换为天/小时/分钟/秒
+	 * @param t 秒
+	 */
+	public static ParseTimeChangeToUtil(t:number){
+		var str:string = "";
+		
+		if(t >= 3600*24){
+			str = Math.floor(t/(3600*24)) + "天";
+		}else if(t >= 3600){
+			str = Math.floor(t/3600) + "小时";
+		}else if(t >= 60){
+			str = Math.floor(t/60) + "分钟";
+		}else if(t<60 && t > 0){
+			str = t + "秒";
+		}
+		return str;
+	}
+
+	/**
+	 * 获得带单位的时间字符串
+	 * * @param t 秒
+	 * @param f 格式 "d" "h" "m" "s"
+	 */
+	public static ParseTime2Units(t:number, f:string = "h"):string{
+		var str:string = "";
+		
+		if(f == "d"){
+			str = Math.ceil(t/(3600*24)) + "天";
+		}else if(f == "h"){
+			str = Math.ceil(t/3600) + "小时";
+		}else if(f == "m"){
+			str = Math.ceil(t/60) + "分钟";
+		}else if(f == "s"){
+			str = t + "秒";
+		}else{
+			var d = Math.floor(t/(3600*24));
+			var h = Math.floor(t/3600);
+			var m = Math.floor(t/60);
+			var s = t%60;
+			str = d + "天" + h + "时" + m + "分" + s + "秒";
+		}
+		
+		return str;
+	}
+
+}

+ 9 - 0
tower_sanguo/assets/MOKA/util/TimeUtil.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "5c35ab61-0e84-4dd1-a13d-eadc77180c6a",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 7 - 0
tower_sanguo/assets/MOKA/util/Utils.ts

@@ -327,6 +327,13 @@ export class Utils {
         return f;
         return f;
     }
     }
 
 
+    public static GetTimeLeft2BySecond(s: number): string {
+        let hours = Math.round((s - 30 * 60) / (60 * 60));
+        let minutes = Math.round((s - 30) / 60) % 60;
+        let seconds = s % 60;
+        return (hours > 0 ? (hours + "小时") : "") + (minutes > 0 ? (minutes + "分钟") : "") + (seconds > 0 ? (seconds + "秒") : "");
+    }
+
     // 随机生成32位字符串
     // 随机生成32位字符串
     static randomString(len = 32) {
     static randomString(len = 32) {
         let $chars =
         let $chars =

+ 3 - 3
tower_sanguo/assets/resources/data/skill_data.json

@@ -88,7 +88,7 @@
 		"name": "炎火星陨",
 		"name": "炎火星陨",
 		"res": "fight_skill_shitou",
 		"res": "fight_skill_shitou",
 		"icon": "skill01",
 		"icon": "skill01",
-		"des": "[bro1=对全体目标造成最大生命][red1={40={0}}][bro1=的伤害(小怪秒杀)]",
+		"des": "[bro1=对全体造成最大生命][red1={26=$0}][bro1=的伤害(小怪秒杀)]",
 		"attType": "3",
 		"attType": "3",
 		"skillValue": "550,700,850"
 		"skillValue": "550,700,850"
 	},
 	},
@@ -97,7 +97,7 @@
 		"name": "暴雪寒流",
 		"name": "暴雪寒流",
 		"res": "fight_skill_bing",
 		"res": "fight_skill_bing",
 		"icon": "skill02",
 		"icon": "skill02",
-		"des": "[bro1=对全体目标减速,并造成最大生命][red1={40={0}}][bro1=的伤害(小怪秒杀)]",
+		"des": "[bro1=对全体减速并造成最大生命][red1={26=$0}][bro1=的伤害(小怪秒杀)]",
 		"attType": "3",
 		"attType": "3",
 		"skillValue": "350,550,700",
 		"skillValue": "350,550,700",
 		"extra": "13"
 		"extra": "13"
@@ -106,7 +106,7 @@
 		"id": 110003,
 		"id": 110003,
 		"name": "铜墙铁壁",
 		"name": "铜墙铁壁",
 		"icon": "skill03",
 		"icon": "skill03",
-		"des": "[bro1=竖起兵墙,全体目标][red1={40={0}}][bro1=秒内不可通过]",
+		"des": "[bro1=竖起兵墙,全体目标][red1={26=$0}][bro1=秒内不可通过]",
 		"attType": "5",
 		"attType": "5",
 		"skillValue": "2.5,3,3.5"
 		"skillValue": "2.5,3,3.5"
 	},
 	},

+ 18 - 0
tower_sanguo/assets/resources/font/font3.fnt

@@ -0,0 +1,18 @@
+info size=51 unicode=1 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=1,1 outline=0
+common lineHeight=51 base=23 scaleW=512 scaleH=256 pages=1 packed=0
+page id=0 file="font3.png"
+chars count=15char id=51 x=2 y=2 width=18 height=22 xoffset=0 yoffset=0 xadvance=18 
+char id=52 x=22 y=2 width=18 height=22 xoffset=0 yoffset=0 xadvance=18 
+char id=53 x=42 y=2 width=18 height=22 xoffset=0 yoffset=0 xadvance=18 
+char id=54 x=62 y=2 width=18 height=22 xoffset=0 yoffset=0 xadvance=18 
+char id=55 x=82 y=2 width=19 height=22 xoffset=0 yoffset=0 xadvance=19 
+char id=56 x=103 y=2 width=18 height=22 xoffset=0 yoffset=0 xadvance=18 
+char id=57 x=123 y=2 width=18 height=22 xoffset=0 yoffset=0 xadvance=18 
+char id=110 x=143 y=2 width=22 height=26 xoffset=0 yoffset=0 xadvance=22 
+char id=107 x=167 y=2 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 
+char id=109 x=185 y=2 width=45 height=25 xoffset=0 yoffset=0 xadvance=45 
+char id=102 x=232 y=2 width=134 height=51 xoffset=0 yoffset=0 xadvance=134 
+char id=45 x=368 y=2 width=22 height=26 xoffset=0 yoffset=0 xadvance=22 
+char id=48 x=392 y=2 width=18 height=22 xoffset=0 yoffset=0 xadvance=18 
+char id=49 x=412 y=2 width=11 height=22 xoffset=0 yoffset=0 xadvance=11 
+char id=50 x=425 y=2 width=18 height=22 xoffset=0 yoffset=0 xadvance=18 

+ 7 - 0
tower_sanguo/assets/resources/font/font3.fnt.meta

@@ -0,0 +1,7 @@
+{
+  "ver": "2.1.0",
+  "uuid": "08f95e11-0fc9-4f8b-ac26-d112c3b1a438",
+  "textureUuid": "754c02ad-ff1e-414d-97cb-266e59b9f536",
+  "fontSize": 51,
+  "subMetas": {}
+}

BIN
tower_sanguo/assets/resources/font/font3.png


+ 36 - 0
tower_sanguo/assets/resources/font/font3.png.meta

@@ -0,0 +1,36 @@
+{
+  "ver": "2.3.4",
+  "uuid": "754c02ad-ff1e-414d-97cb-266e59b9f536",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 512,
+  "height": 256,
+  "platformSettings": {},
+  "subMetas": {
+    "font3": {
+      "ver": "1.0.4",
+      "uuid": "44ed2c58-da23-46fa-9d20-4e9cb0f333e1",
+      "rawTextureUuid": "754c02ad-ff1e-414d-97cb-266e59b9f536",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": -33.5,
+      "offsetY": 100.5,
+      "trimX": 2,
+      "trimY": 2,
+      "width": 441,
+      "height": 51,
+      "rawWidth": 512,
+      "rawHeight": 256,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

+ 422 - 50
tower_sanguo/assets/resources/module/marshalStage/marshalStage.prefab

@@ -39,20 +39,20 @@
         "__id__": 66
         "__id__": 66
       },
       },
       {
       {
-        "__id__": 211
+        "__id__": 221
       }
       }
     ],
     ],
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 213
+        "__id__": 223
       },
       },
       {
       {
-        "__id__": 214
+        "__id__": 224
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 215
+      "__id__": 225
     },
     },
     "_opacity": 255,
     "_opacity": 255,
     "_color": {
     "_color": {
@@ -2593,7 +2593,7 @@
     "_active": true,
     "_active": true,
     "_components": [],
     "_components": [],
     "_prefab": {
     "_prefab": {
-      "__id__": 210
+      "__id__": 220
     },
     },
     "_opacity": 255,
     "_opacity": 255,
     "_color": {
     "_color": {
@@ -5157,13 +5157,13 @@
         "__id__": 184
         "__id__": 184
       },
       },
       {
       {
-        "__id__": 206
+        "__id__": 216
       }
       }
     ],
     ],
     "_active": true,
     "_active": true,
     "_components": [],
     "_components": [],
     "_prefab": {
     "_prefab": {
-      "__id__": 209
+      "__id__": 219
     },
     },
     "_opacity": 255,
     "_opacity": 255,
     "_color": {
     "_color": {
@@ -6151,7 +6151,7 @@
     "asset": {
     "asset": {
       "__uuid__": "5fe81515-8b08-4fba-97c9-4cc75544bb88"
       "__uuid__": "5fe81515-8b08-4fba-97c9-4cc75544bb88"
     },
     },
-    "fileId": "bfrjvuYrBAJ4d4OA0n5Sp9",
+    "fileId": "ac4UrhvzVNGaddEcfvodUt",
     "sync": false
     "sync": false
   },
   },
   {
   {
@@ -6262,7 +6262,7 @@
     "asset": {
     "asset": {
       "__uuid__": "5fe81515-8b08-4fba-97c9-4cc75544bb88"
       "__uuid__": "5fe81515-8b08-4fba-97c9-4cc75544bb88"
     },
     },
-    "fileId": "ae1EWFkoNLTpT7GqJP6fr8",
+    "fileId": "3eZtfpvmJM0ogIycCFvQFH",
     "sync": false
     "sync": false
   },
   },
   {
   {
@@ -6336,7 +6336,7 @@
     },
     },
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
-      "width": 385,
+      "width": 410.89999999999964,
       "height": 79.1
       "height": 79.1
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
@@ -6400,7 +6400,7 @@
     },
     },
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
-      "width": 286,
+      "width": 234,
       "height": 44.1
       "height": 44.1
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
@@ -6453,8 +6453,8 @@
       }
       }
     ],
     ],
     "_useOriginalSize": true,
     "_useOriginalSize": true,
-    "_string": "对全体目标造成最大生命",
-    "_N$string": "对全体目标造成最大生命",
+    "_string": "对全体造成最大生命",
+    "_N$string": "对全体造成最大生命",
     "_fontSize": 26,
     "_fontSize": 26,
     "_lineHeight": 35,
     "_lineHeight": 35,
     "_enableWrapText": true,
     "_enableWrapText": true,
@@ -6481,7 +6481,7 @@
     "asset": {
     "asset": {
       "__uuid__": "5fe81515-8b08-4fba-97c9-4cc75544bb88"
       "__uuid__": "5fe81515-8b08-4fba-97c9-4cc75544bb88"
     },
     },
-    "fileId": "d72JS1MtRC5rjbfer2ocYz",
+    "fileId": "3dXk+Oie9KeYUoJTrkLG6s",
     "sync": false
     "sync": false
   },
   },
   {
   {
@@ -6511,7 +6511,7 @@
     },
     },
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
-      "width": 87.45,
+      "width": 167.17,
       "height": 44.1
       "height": 44.1
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
@@ -6523,7 +6523,7 @@
       "__type__": "TypedArray",
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "ctor": "Float64Array",
       "array": [
       "array": [
-        286,
+        234,
         -44.099999999999994,
         -44.099999999999994,
         0,
         0,
         0,
         0,
@@ -6564,8 +6564,8 @@
       }
       }
     ],
     ],
     "_useOriginalSize": true,
     "_useOriginalSize": true,
-    "_string": "1%(+0.1)",
-    "_N$string": "1%(+0.1)",
+    "_string": "95.5%(+94.7%)",
+    "_N$string": "95.5%(+94.7%)",
     "_fontSize": 26,
     "_fontSize": 26,
     "_lineHeight": 35,
     "_lineHeight": 35,
     "_enableWrapText": true,
     "_enableWrapText": true,
@@ -6592,7 +6592,7 @@
     "asset": {
     "asset": {
       "__uuid__": "5fe81515-8b08-4fba-97c9-4cc75544bb88"
       "__uuid__": "5fe81515-8b08-4fba-97c9-4cc75544bb88"
     },
     },
-    "fileId": "32gYQUJ/JHeIdlTl+tldY3",
+    "fileId": "4dfpxSGM5CMJvKKlk6Csta",
     "sync": false
     "sync": false
   },
   },
   {
   {
@@ -6703,7 +6703,7 @@
     "asset": {
     "asset": {
       "__uuid__": "5fe81515-8b08-4fba-97c9-4cc75544bb88"
       "__uuid__": "5fe81515-8b08-4fba-97c9-4cc75544bb88"
     },
     },
-    "fileId": "fenIrm5CNDf5jjruU8o3wC",
+    "fileId": "95YoutYeJG04U9Ktf9zkHO",
     "sync": false
     "sync": false
   },
   },
   {
   {
@@ -6716,14 +6716,14 @@
     "_enabled": true,
     "_enabled": true,
     "_fontFamily": "Arial",
     "_fontFamily": "Arial",
     "_isSystemFontUsed": false,
     "_isSystemFontUsed": false,
-    "_N$string": "<color=#4E301B>对全体目标造成最大生命<color=#E6181A>1%(+0.1)</color>的伤害,秒杀普通怪物</color>",
+    "_N$string": "<color=#4E301B>对全体造成最大生命<color=#E6181A>95.5%(+94.7%)</color>的伤害,秒杀普通怪物</color>",
     "_N$horizontalAlign": 0,
     "_N$horizontalAlign": 0,
     "_N$fontSize": 26,
     "_N$fontSize": 26,
     "_N$font": {
     "_N$font": {
       "__uuid__": "2bec5164-bd32-4719-bbbf-97e2c8b3ab1a"
       "__uuid__": "2bec5164-bd32-4719-bbbf-97e2c8b3ab1a"
     },
     },
     "_N$cacheMode": 0,
     "_N$cacheMode": 0,
-    "_N$maxWidth": 385,
+    "_N$maxWidth": 410.89999999999964,
     "_N$lineHeight": 35,
     "_N$lineHeight": 35,
     "_N$imageAtlas": null,
     "_N$imageAtlas": null,
     "_N$handleTouchEvent": true,
     "_N$handleTouchEvent": true,
@@ -6865,12 +6865,24 @@
       "__id__": 143
       "__id__": 143
     },
     },
     "_enabled": true,
     "_enabled": true,
-    "graySrc": null,
-    "img_skill": null,
-    "txt_Time": null,
-    "txtRich_Name": null,
-    "txtRich_Des": null,
-    "lock": null,
+    "graySrc": {
+      "__id__": 181
+    },
+    "img_skill": {
+      "__id__": 145
+    },
+    "txt_Time": {
+      "__id__": 151
+    },
+    "txtRich_Name": {
+      "__id__": 164
+    },
+    "txtRich_Des": {
+      "__id__": 176
+    },
+    "lock": {
+      "__id__": 178
+    },
     "_id": ""
     "_id": ""
   },
   },
   {
   {
@@ -6896,13 +6908,16 @@
         "__id__": 185
         "__id__": 185
       },
       },
       {
       {
-        "__id__": 196
+        "__id__": 197
+      },
+      {
+        "__id__": 206
       }
       }
     ],
     ],
     "_active": true,
     "_active": true,
     "_components": [],
     "_components": [],
     "_prefab": {
     "_prefab": {
-      "__id__": 205
+      "__id__": 215
     },
     },
     "_opacity": 255,
     "_opacity": 255,
     "_color": {
     "_color": {
@@ -6976,7 +6991,7 @@
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 195
+      "__id__": 196
     },
     },
     "_opacity": 255,
     "_opacity": 255,
     "_color": {
     "_color": {
@@ -7308,7 +7323,11 @@
     "_grayMaterial": null,
     "_grayMaterial": null,
     "duration": 0.1,
     "duration": 0.1,
     "zoomScale": 1.2,
     "zoomScale": 1.2,
-    "clickEvents": [],
+    "clickEvents": [
+      {
+        "__id__": 195
+      }
+    ],
     "_N$interactable": true,
     "_N$interactable": true,
     "_N$enableAutoGrayEffect": false,
     "_N$enableAutoGrayEffect": false,
     "_N$transition": 3,
     "_N$transition": 3,
@@ -7365,6 +7384,16 @@
     "_id": ""
     "_id": ""
   },
   },
   {
   {
+    "__type__": "cc.ClickEvent",
+    "target": {
+      "__id__": 1
+    },
+    "component": "",
+    "_componentId": "b8effqNDadMir3VrWurZSXv",
+    "handler": "click_AdBtn",
+    "customEventData": ""
+  },
+  {
     "__type__": "cc.PrefabInfo",
     "__type__": "cc.PrefabInfo",
     "root": {
     "root": {
       "__id__": 1
       "__id__": 1
@@ -7377,27 +7406,355 @@
   },
   },
   {
   {
     "__type__": "cc.Node",
     "__type__": "cc.Node",
-    "_name": "layout",
+    "_name": "btn_ad_no",
     "_objFlags": 0,
     "_objFlags": 0,
     "_parent": {
     "_parent": {
       "__id__": 184
       "__id__": 184
     },
     },
     "_children": [
     "_children": [
       {
       {
-        "__id__": 197
+        "__id__": 198
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 202
+      },
+      {
+        "__id__": 203
+      }
+    ],
+    "_prefab": {
+      "__id__": 205
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 214,
+      "height": 86
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        0,
+        -381.583,
+        0,
+        0,
+        0,
+        0,
+        1,
+        1,
+        1,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "txt",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 197
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 199
       },
       },
       {
       {
         "__id__": 200
         "__id__": 200
       }
       }
     ],
     ],
+    "_prefab": {
+      "__id__": 201
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 122,
+      "height": 39.8
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        0,
+        3.495,
+        0,
+        0,
+        0,
+        0,
+        1,
+        1,
+        1,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Label",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 198
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
+    "_useOriginalSize": false,
+    "_string": "清除冷却",
+    "_N$string": "清除冷却",
+    "_fontSize": 30,
+    "_lineHeight": 30,
+    "_enableWrapText": true,
+    "_N$file": {
+      "__uuid__": "2bec5164-bd32-4719-bbbf-97e2c8b3ab1a"
+    },
+    "_isSystemFontUsed": false,
+    "_spacingX": 0,
+    "_batchAsBitmap": false,
+    "_styleFlags": 0,
+    "_underlineHeight": 0,
+    "_N$horizontalAlign": 1,
+    "_N$verticalAlign": 1,
+    "_N$fontFamily": "Arial",
+    "_N$overflow": 0,
+    "_N$cacheMode": 1,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.LabelOutline",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 198
+    },
+    "_enabled": true,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 99,
+      "g": 98,
+      "b": 98,
+      "a": 255
+    },
+    "_width": 1,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "5fe81515-8b08-4fba-97c9-4cc75544bb88"
+    },
+    "fileId": "f2e8NDTaFIB6sky1hhdtgc",
+    "sync": false
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 197
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_spriteFrame": {
+      "__uuid__": "0d53c864-ccea-4dc3-a907-e1f6d1c2dd2c"
+    },
+    "_type": 0,
+    "_sizeMode": 1,
+    "_fillType": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Button",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 197
+    },
+    "_enabled": true,
+    "_normalMaterial": {
+      "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+    },
+    "_grayMaterial": null,
+    "duration": 0.1,
+    "zoomScale": 1.2,
+    "clickEvents": [
+      {
+        "__id__": 204
+      }
+    ],
+    "_N$interactable": true,
+    "_N$enableAutoGrayEffect": false,
+    "_N$transition": 3,
+    "transition": 3,
+    "_N$normalColor": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_N$pressedColor": {
+      "__type__": "cc.Color",
+      "r": 211,
+      "g": 211,
+      "b": 211,
+      "a": 255
+    },
+    "pressedColor": {
+      "__type__": "cc.Color",
+      "r": 211,
+      "g": 211,
+      "b": 211,
+      "a": 255
+    },
+    "_N$hoverColor": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "hoverColor": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_N$disabledColor": {
+      "__type__": "cc.Color",
+      "r": 124,
+      "g": 124,
+      "b": 124,
+      "a": 255
+    },
+    "_N$normalSprite": null,
+    "_N$pressedSprite": null,
+    "pressedSprite": null,
+    "_N$hoverSprite": null,
+    "hoverSprite": null,
+    "_N$disabledSprite": null,
+    "_N$target": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.ClickEvent",
+    "target": {
+      "__id__": 1
+    },
+    "component": "",
+    "_componentId": "b8effqNDadMir3VrWurZSXv",
+    "handler": "click_AdNoBtn",
+    "customEventData": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "5fe81515-8b08-4fba-97c9-4cc75544bb88"
+    },
+    "fileId": "bbz5uzsexAdKtrpZSd8rij",
+    "sync": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "layout",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 184
+    },
+    "_children": [
+      {
+        "__id__": 207
+      },
+      {
+        "__id__": 210
+      }
+    ],
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 203
+        "__id__": 213
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 204
+      "__id__": 214
     },
     },
     "_opacity": 255,
     "_opacity": 255,
     "_color": {
     "_color": {
@@ -7451,17 +7808,17 @@
     "_name": "tip",
     "_name": "tip",
     "_objFlags": 0,
     "_objFlags": 0,
     "_parent": {
     "_parent": {
-      "__id__": 196
+      "__id__": 206
     },
     },
     "_children": [],
     "_children": [],
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 198
+        "__id__": 208
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 199
+      "__id__": 209
     },
     },
     "_opacity": 255,
     "_opacity": 255,
     "_color": {
     "_color": {
@@ -7515,7 +7872,7 @@
     "_name": "",
     "_name": "",
     "_objFlags": 0,
     "_objFlags": 0,
     "node": {
     "node": {
-      "__id__": 197
+      "__id__": 207
     },
     },
     "_enabled": true,
     "_enabled": true,
     "_materials": [
     "_materials": [
@@ -7560,17 +7917,17 @@
     "_name": "txt_num",
     "_name": "txt_num",
     "_objFlags": 0,
     "_objFlags": 0,
     "_parent": {
     "_parent": {
-      "__id__": 196
+      "__id__": 206
     },
     },
     "_children": [],
     "_children": [],
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 201
+        "__id__": 211
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 202
+      "__id__": 212
     },
     },
     "_opacity": 255,
     "_opacity": 255,
     "_color": {
     "_color": {
@@ -7624,7 +7981,7 @@
     "_name": "",
     "_name": "",
     "_objFlags": 0,
     "_objFlags": 0,
     "node": {
     "node": {
-      "__id__": 200
+      "__id__": 210
     },
     },
     "_enabled": true,
     "_enabled": true,
     "_materials": [
     "_materials": [
@@ -7669,7 +8026,7 @@
     "_name": "",
     "_name": "",
     "_objFlags": 0,
     "_objFlags": 0,
     "node": {
     "node": {
-      "__id__": 196
+      "__id__": 206
     },
     },
     "_enabled": true,
     "_enabled": true,
     "_layoutSize": {
     "_layoutSize": {
@@ -7729,11 +8086,11 @@
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 207
+        "__id__": 217
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 208
+      "__id__": 218
     },
     },
     "_opacity": 255,
     "_opacity": 255,
     "_color": {
     "_color": {
@@ -7787,7 +8144,7 @@
     "_name": "",
     "_name": "",
     "_objFlags": 0,
     "_objFlags": 0,
     "node": {
     "node": {
-      "__id__": 206
+      "__id__": 216
     },
     },
     "_enabled": true,
     "_enabled": true,
     "_materials": [
     "_materials": [
@@ -7860,7 +8217,7 @@
     "_active": true,
     "_active": true,
     "_components": [],
     "_components": [],
     "_prefab": {
     "_prefab": {
-      "__id__": 212
+      "__id__": 222
     },
     },
     "_opacity": 255,
     "_opacity": 255,
     "_color": {
     "_color": {
@@ -8001,8 +8358,23 @@
     "node_ad": {
     "node_ad": {
       "__id__": 184
       "__id__": 184
     },
     },
+    "btn_ad": {
+      "__id__": 185
+    },
+    "btn_ad_no": {
+      "__id__": 197
+    },
     "txt_remaind_adtimes": {
     "txt_remaind_adtimes": {
-      "__id__": 201
+      "__id__": 211
+    },
+    "node_skill": {
+      "__id__": 136
+    },
+    "window_marshal": {
+      "__id__": 66
+    },
+    "window_skill": {
+      "__id__": 221
     },
     },
     "_id": ""
     "_id": ""
   },
   },

BIN
tower_sanguo/assets/resources/module/marshalStage/texture/button.png


+ 36 - 0
tower_sanguo/assets/resources/module/marshalStage/texture/button.png.meta

@@ -0,0 +1,36 @@
+{
+  "ver": "2.3.4",
+  "uuid": "4084b091-4185-453d-98c7-fa17cecd7cb0",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 214,
+  "height": 86,
+  "platformSettings": {},
+  "subMetas": {
+    "button": {
+      "ver": "1.0.4",
+      "uuid": "0d53c864-ccea-4dc3-a907-e1f6d1c2dd2c",
+      "rawTextureUuid": "4084b091-4185-453d-98c7-fa17cecd7cb0",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 214,
+      "height": 86,
+      "rawWidth": 214,
+      "rawHeight": 86,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

Різницю між файлами не показано, бо вона завелика
+ 443 - 86
tower_sanguo/assets/scenes/Test_Znh.fire


+ 145 - 15
tower_sanguo/assets/scripts/data/GameData.ts

@@ -10,6 +10,7 @@ import PlayerUpdateResponse from "../net/msg/PlayerUpdateResponse";
 import { Dictionary } from "../utils/Dictionary";
 import { Dictionary } from "../utils/Dictionary";
 import BarrackVO from "../vo/BarrackVO";
 import BarrackVO from "../vo/BarrackVO";
 import BuffVO from "../vo/BuffVO";
 import BuffVO from "../vo/BuffVO";
+import CommanderSkillVO from "../vo/CommanderSkillVO";
 import FetterVO from "../vo/FetterVO";
 import FetterVO from "../vo/FetterVO";
 import GeneralVO from "../vo/GeneralVO";
 import GeneralVO from "../vo/GeneralVO";
 import MissionVO from "../vo/MissionVO";
 import MissionVO from "../vo/MissionVO";
@@ -83,21 +84,21 @@ export default class GameData {
             this.task_data = await GameController.resM.loadRemoteJson('https://xcx-box.oss-cn-hangzhou.aliyuncs.com/hotgame/h5game/tower_sanguo/data/task_data.json?v=' + new Date().getTime());
             this.task_data = await GameController.resM.loadRemoteJson('https://xcx-box.oss-cn-hangzhou.aliyuncs.com/hotgame/h5game/tower_sanguo/data/task_data.json?v=' + new Date().getTime());
             this.turntable_data = await GameController.resM.loadRemoteJson('https://xcx-box.oss-cn-hangzhou.aliyuncs.com/hotgame/h5game/tower_sanguo/data/turntable_data.json?v=' + new Date().getTime());
             this.turntable_data = await GameController.resM.loadRemoteJson('https://xcx-box.oss-cn-hangzhou.aliyuncs.com/hotgame/h5game/tower_sanguo/data/turntable_data.json?v=' + new Date().getTime());
 
 
-            // this.db_data = cc.loader.getRes("data/db_data", cc.JsonAsset).json;
-            // this.serverConfig_data = cc.loader.getRes("data/serverConfig_data", cc.JsonAsset).json;
-            // this.fetter_data = cc.loader.getRes("data/fetter_data", cc.JsonAsset).json;
-            // this.buff_data = cc.loader.getRes("data/buff_data", cc.JsonAsset).json;
-            // this.skill_data = cc.loader.getRes("data/skill_data", cc.JsonAsset).json;
-            // this.general_data = cc.loader.getRes("data/general_data", cc.JsonAsset).json;
-            // this.monster_data = cc.loader.getRes("data/monster_data", cc.JsonAsset).json;
-            // this.mission_data = cc.loader.getRes("data/mission_data", cc.JsonAsset).json;
-            // this.item_data = cc.loader.getRes("data/item_data", cc.JsonAsset).json;
-            // this.barrack_data = cc.loader.getRes("data/barrack_data", cc.JsonAsset).json;
-            // this.star_data = cc.loader.getRes("data/star_data", cc.JsonAsset).json;
-            // this.help_data = cc.loader.getRes("data/help_data", cc.JsonAsset).json;
-            // this.turntable_data = cc.loader.getRes("data/turntable_data", cc.JsonAsset).json;
-            // this.task_data = cc.loader.getRes("data/task_data", cc.JsonAsset).json;
-            // this.commanderskill_data = cc.loader.getRes("data/commanderskill_data", cc.JsonAsset).json;
+             this.db_data = cc.loader.getRes("data/db_data", cc.JsonAsset).json;
+             this.serverConfig_data = cc.loader.getRes("data/serverConfig_data", cc.JsonAsset).json;
+             this.fetter_data = cc.loader.getRes("data/fetter_data", cc.JsonAsset).json;
+             this.buff_data = cc.loader.getRes("data/buff_data", cc.JsonAsset).json;
+             this.skill_data = cc.loader.getRes("data/skill_data", cc.JsonAsset).json;
+             this.general_data = cc.loader.getRes("data/general_data", cc.JsonAsset).json;
+             this.monster_data = cc.loader.getRes("data/monster_data", cc.JsonAsset).json;
+             this.mission_data = cc.loader.getRes("data/mission_data", cc.JsonAsset).json;
+             this.item_data = cc.loader.getRes("data/item_data", cc.JsonAsset).json;
+             this.barrack_data = cc.loader.getRes("data/barrack_data", cc.JsonAsset).json;
+             this.star_data = cc.loader.getRes("data/star_data", cc.JsonAsset).json;
+             this.help_data = cc.loader.getRes("data/help_data", cc.JsonAsset).json;
+             this.turntable_data = cc.loader.getRes("data/turntable_data", cc.JsonAsset).json;
+             this.task_data = cc.loader.getRes("data/task_data", cc.JsonAsset).json;
+             this.commanderskill_data = cc.loader.getRes("data/commanderskill_data", cc.JsonAsset).json;
 
 
             this.initJsonData();
             this.initJsonData();
         }
         }
@@ -292,6 +293,22 @@ export default class GameData {
             this.barrack_data.setValue(vo.campLv, vo);
             this.barrack_data.setValue(vo.campLv, vo);
         }
         }
 
 
+        for (let i in this.commanderskill_data) {
+            let o = this.commanderskill_data[i];
+            let csvo = new CommanderSkillVO();
+            csvo.id = o.id;
+            let tempstars = o.starcount.split(":");
+            for (let i = 0; i < tempstars.length; i++) {
+                csvo.unlockstarcount.push(parseInt(tempstars[i]));
+            }
+            this.commanderskill_data[i] = csvo;
+            console.log("index: " + i + " d: ", o);
+        }
+
+        //console.log("commanderskill_data: ", this.commanderskill_data);
+        //console.log("skill_data: ", this.skill_data);
+
+
         turntableModel.Instance.turntable_data = this.turntable_data;
         turntableModel.Instance.turntable_data = this.turntable_data;
         // 任务
         // 任务
         this.initTaskData();
         this.initTaskData();
@@ -374,6 +391,76 @@ export default class GameData {
         return vo;
         return vo;
     }
     }
 
 
+    /**
+     * 获取技能效果值字符串
+     * @param skill 技能
+     * @param lv 等级
+     * @param add 加成值
+    */
+    getSkillValueStr(skill: SkillVO, lv: number,add:number=0) {
+        switch (skill.attackType) {
+            case 1:
+                return;
+            case 2:
+                return;
+            case 3:
+                return ((skill.skillValue[lv - 1] +add)/ 10000 * 100).toFixed(1)+"%";
+            case 4:
+                return;
+            case 5:
+                return skill.skillValue[lv - 1]+add;
+        }
+    }
+
+    /**
+     * 获取技能效果值
+     * @param skill 技能
+     * @param lv 等级
+    */
+     getSkillValue(skill: SkillVO, lv: number) {
+        switch (skill.attackType) {
+            case 1:
+                return;
+            case 2:
+                return;
+            case 3:
+                return (skill.skillValue[lv - 1])/ 10000;
+            case 4:
+                return;
+            case 5:
+                return skill.skillValue[lv - 1];
+        }
+    }
+
+    /** 
+     * 获取技能统帅加成值
+     * @param general 统帅
+    */
+    getSkillAddValue(general:GeneralVO){
+        return Math.pow(general.commander/100,1.9);
+    }
+
+    /** 
+     * 获取技能统帅加成值字符串
+     * @param skill 技能
+     * @param general 统帅
+    */
+     getSkillAddValueStr(skill: SkillVO,general:GeneralVO,skillvalue:number){
+         let addcommander=Math.pow(general.commander/100,1.9);
+        switch (skill.attackType) {
+            case 1:
+                return;
+            case 2:
+                return;
+            case 3:
+                return (addcommander*skillvalue * 100).toFixed(1)+"%";
+            case 4:
+                return;
+            case 5:
+                return (addcommander*skillvalue)+"";
+        }
+    }
+
 
 
     /** --------------------------------------------   serverData ---------------------------------------------- */
     /** --------------------------------------------   serverData ---------------------------------------------- */
 
 
@@ -393,6 +480,7 @@ export default class GameData {
             return;
             return;
         }
         }
 
 
+        //console.log("------->ServerConfig: ", response);
 
 
         let open_arr = response.data.embattle_open.split(',');
         let open_arr = response.data.embattle_open.split(',');
         let arr = [];
         let arr = [];
@@ -414,6 +502,8 @@ export default class GameData {
         }
         }
         let data = response.data as PlayerProp;
         let data = response.data as PlayerProp;
 
 
+        console.log("PlayerInfo: ", response);
+
 
 
         this.player.coins.set(PLAYERPROP.FOOD, new Prop(PLAYERPROP.FOOD, data.food));
         this.player.coins.set(PLAYERPROP.FOOD, new Prop(PLAYERPROP.FOOD, data.food));
         this.player.coins.set(PLAYERPROP.YB, new Prop(PLAYERPROP.YB, data.yb));
         this.player.coins.set(PLAYERPROP.YB, new Prop(PLAYERPROP.YB, data.yb));
@@ -452,9 +542,36 @@ export default class GameData {
             }
             }
         }
         }
 
 
+        this.initScheduler();
+        this.updateSkillData();
+
         GameController.loadMain();
         GameController.loadMain();
+        console.log("____________loadMain");    }
+
+    private updateSkillData() {
+        let stars = this.player.getAllStars();
+        let judge = false;
+        for (let i in this.commanderskill_data) {
+            let tempSkillCfg = this.commanderskill_data[i];
+            let tempSkillLv = -1;
+            for (let j = 0; j < tempSkillCfg.unlockstarcount.length; j++) {
+                if (tempSkillCfg.unlockstarcount[j] <= stars) {
+                    tempSkillLv = j + 1;
+                }
+                this.player.skill_lv_data.set(tempSkillCfg.id, tempSkillLv);
+            }
+            if (!judge && tempSkillLv != -1) {
+                judge = true;
+                this.player.skill_default_id = tempSkillCfg.id;
+            }
+        }
+        //console.log("------>update Skill default skill id: ", this.player.skill_default_id);
+        //console.log("------>update Skill All Stars: ", stars);
+        //console.log("------>update Skill SkillData: ", this.player.skill_lv_data);
     }
     }
 
 
+
+
     /**
     /**
      * 
      * 
      * @param id 
      * @param id 
@@ -535,6 +652,19 @@ export default class GameData {
         }
         }
     }
     }
 
 
+    private initScheduler() {
+        let self = this;
+        let count = 0;
+        let a = cc.director.getScheduler().schedule(() => {
+            count++;
+            if (count % 5 == 0) {
+                count = 1;
+                let vo: MissionVO = self.getMissionByID(self.player.current_mission);
+                self.updateProp(PLAYERPROP.FOOD, Math.floor(vo.foodRecover * 5), true);
+            }
+        }, this, 1);
+    }
+
     /**
     /**
      * 兵营等级更新后,更新开放武将及下个开放武将
      * 兵营等级更新后,更新开放武将及下个开放武将
      * @param barrackLv 
      * @param barrackLv 

+ 53 - 3
tower_sanguo/assets/scripts/module/marshalStage/DefaultSkill.ts

@@ -5,7 +5,11 @@
 // Learn life-cycle callbacks:
 // Learn life-cycle callbacks:
 //  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
 //  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
 
 
+import { Utils } from "../../../MOKA/util/Utils";
 import GrayEffectNode from "../../effects/GrayEffectNode";
 import GrayEffectNode from "../../effects/GrayEffectNode";
+import GameController from "../../GameController";
+import StringUtil from "../../utils/StringUtil";
+import GeneralVO from "../../vo/GeneralVO";
 
 
 const { ccclass, property } = cc._decorator;
 const { ccclass, property } = cc._decorator;
 
 
@@ -26,17 +30,63 @@ export default class DefaultSkill extends cc.Component {
     @property(cc.Node)
     @property(cc.Node)
     lock: cc.Node = null;
     lock: cc.Node = null;
 
 
-    Init(){
+    id: number;
+    lv: number
 
 
+    private updateDelta=0;
 
 
+    Init(id: number, lv: number, genenral: GeneralVO) {
+        this.id = id;
+        this.lv = lv;
+        this.txt_Time.string = Utils.ParseTime2Format(GameController.gameData.player.skill_cooling_time);
+        let skill_vo = GameController.gameData.getSkillByID(id);
+        cc.loader.loadRes("module/fight/texture/skill/" + skill_vo.icon, cc.SpriteFrame, (err, asset) => {
+            if (err) {
+                console.log("err:" + JSON.stringify(err));
+                return;
+            }
+            this.img_skill = asset;
+        });
+        this.txtRich_Name.string = "<color=#4E301B>" + skill_vo.name + "</c><color=#E6181A>Lv." + lv + "</color>";
+        let des = StringUtil.getTextByStringInData2(skill_vo.des);
+        let skillvalue=GameController.gameData.getSkillValue(skill_vo,lv);
+        let add = GameController.gameData.getSkillAddValueStr(skill_vo,genenral,skillvalue);
+        let totalskillvaluestr = GameController.gameData.getSkillValueStr(skill_vo, lv) + "(+" + add + ")";
+        des = des.replace("$0", totalskillvaluestr);
+        this.txtRich_Des.string = des;//StringUtil.getTextByStringInData2(skill_vo.des);
+
+
+        //console.log("-->Default Skill:" + id + " lv:" + lv + "\n"
+        //    + skill_vo.extra + "\n"
+        //    + " Add: " + add + "\n"
+        //    + " AddValue: " + add + "\n"
+        //    + des);
+//
+        //console.log("Time: "+Utils.GetTimeLeft2BySecond(80));
+
+        if (lv < 0) {
+            this.lockSkill();
+        }
+    }
+
+    update(dt){
+        if(GameController.gameData.player.skill_cooling_time!=0){
+            this.updateDelta+=dt;
+            if(this.updateDelta>=1){
+                this.updateDelta=0;
+                this.txt_Time.string=Utils.ParseTime2Format(GameController.gameData.player.skill_cooling_time);
+            }
+        }else{
+            this.txt_Time.string="";
+        }
     }
     }
 
 
-    unLockSkill(){
+    unLockSkill() {
         this.graySrc.Revert();
         this.graySrc.Revert();
 
 
     }
     }
 
 
-    lockSkill(){
+    lockSkill() {
         this.graySrc.SetGray();
         this.graySrc.SetGray();
     }
     }
 }
 }

+ 57 - 10
tower_sanguo/assets/scripts/module/marshalStage/marshalStageUI.ts

@@ -1,4 +1,5 @@
 import BaseUI from "../../../MOKA/component/BaseUI";
 import BaseUI from "../../../MOKA/component/BaseUI";
+import UIManager from "../../../MOKA/manager/UIManager";
 import GameController from "../../GameController";
 import GameController from "../../GameController";
 import DefaultSkill from "./DefaultSkill";
 import DefaultSkill from "./DefaultSkill";
 
 
@@ -34,12 +35,16 @@ export default class marshalStageUI extends BaseUI {
 
 
     @property({ type: cc.Node, displayName: "广告节点" })
     @property({ type: cc.Node, displayName: "广告节点" })
     node_ad: cc.Node = null;
     node_ad: cc.Node = null;
+    @property({ type: cc.Node, displayName: "广告按钮" })
+    btn_ad: cc.Node = null;
+    @property({ type: cc.Node, displayName: "广告按钮灰色" })
+    btn_ad_no: cc.Node = null;
     @property({ type: cc.Label, displayName: "剩余广告次数" })
     @property({ type: cc.Label, displayName: "剩余广告次数" })
     txt_remaind_adtimes: cc.Label = null;
     txt_remaind_adtimes: cc.Label = null;
 
 
     @property({ type: cc.Node, displayName: "统帅台技能节点" })
     @property({ type: cc.Node, displayName: "统帅台技能节点" })
     node_skill: cc.Node = null;
     node_skill: cc.Node = null;
-    
+
     @property({ type: cc.Node, displayName: "窗口_统帅台" })
     @property({ type: cc.Node, displayName: "窗口_统帅台" })
     window_marshal: cc.Node = null;
     window_marshal: cc.Node = null;
     @property({ type: cc.Node, displayName: "窗口_技能" })
     @property({ type: cc.Node, displayName: "窗口_技能" })
@@ -47,22 +52,64 @@ export default class marshalStageUI extends BaseUI {
 
 
     onLoad() {
     onLoad() {
 
 
-        let data = GameController.gameData.player.generals_bag;
+        //let data = GameController.gameData.player.generals_bag;
+
+        //console.log("PlayData:", data);
+        //console.log("data1:", data["113013"]);
+        //console.log("Generals:", GameController.gameData.player.generals);
+
+        let isExistMarshal = GameController.gameData.player.isExistMarshalGeneral();
+        this.node_add.active = !isExistMarshal;
+        this.node_stage.active = isExistMarshal;
+        this.node_skill.active = isExistMarshal;
+
+        if (isExistMarshal) {
+            let general = GameController.gameData.player.getMarshalGeneral();
+            this.txt_commander.string = general.commander + "";
+            this.txt_name.string = general.name + "";
+            this.txt_commander_detiale.string = general.commander + "";
+
+
+            let skillid = GameController.gameData.player.skill_default_id;
+            let skilllv = GameController.gameData.player.skill_lv_data.get(skillid);  //-1表示未解锁
+            this.txt_eft.string = (GameController.gameData.getSkillAddValue(general) * 100).toFixed(1) + "%";
+            this.default_skill.Init(skillid, skilllv, general);
 
 
-        console.log("PlayData:", data);
-        console.log("data1:", data["113013"]);
-        console.log("Generals:", GameController.gameData.player.generals);
 
 
-        let isExistMarshal=GameController.gameData.player.isExistMarshalGeneral();
-        this.node_add.active=isExistMarshal;
-        this.node_stage.active=!isExistMarshal;
+            let spinePath = "spine/person/" + general.resource;
+            XXLoader.loadAssetByType(spinePath, sp.SkeletonData, (asset) => {
+                this.spine.skeletonData = asset;
+                this.spine.animation = "idle";
+            });
 
 
+            this.updateAdInfo();
+        }
 
 
+
+    }
+
+    stageSkillInit() {
+        let skillid = GameController.gameData.player.skill_default_id;
+        let skilllv = GameController.gameData.player.skill_lv_data.get(skillid);  //-1表示未解锁
+        this.default_skill.Init(skillid, skilllv, null);
+    }
+
+    updateAdInfo() {
+        this.node_ad.active = GameController.gameData.player.skill_cooling_time > 0;
+        this.btn_ad.active = GameController.gameData.player.remaind_times > 0;
+        this.btn_ad_no.active = GameController.gameData.player.remaind_times == 0;
+        this.txt_remaind_adtimes.string = GameController.gameData.player.remaind_times > 0 ? GameController.gameData.player.remaind_times + "次" : "今日次数已用完";
     }
     }
 
 
-    stageSkillInit(){
-        
 
 
+    click_AdBtn() {
+        //看广告
+        GameController.gameData.player.remaind_times--;
+        GameController.gameData.player.skill_cooling_time = 0;
+        this.updateAdInfo();
     }
     }
 
 
+    click_AdNoBtn() {
+        GameController.uiM.showToast("今日次数已用完");
+    }
 }
 }

+ 5 - 0
tower_sanguo/assets/scripts/net/servertest/ServerManager.ts

@@ -48,6 +48,7 @@ export default class ServerManager {
     sendRequest(url: HTTPTYPE, method: string = 'POST', data: string = null, callback: any = null, isRsa: boolean = true, errorPop = true, async = true, params = null) {
     sendRequest(url: HTTPTYPE, method: string = 'POST', data: string = null, callback: any = null, isRsa: boolean = true, errorPop = true, async = true, params = null) {
         switch (url) {
         switch (url) {
             case HTTPTYPE.getServerConfig:
             case HTTPTYPE.getServerConfig:
+                console.log("------ServerMng: ",data);
                 this.getServerConfig(url, data, callback);
                 this.getServerConfig(url, data, callback);
                 break;
                 break;
             case HTTPTYPE.player:
             case HTTPTYPE.player:
@@ -478,4 +479,8 @@ export default class ServerManager {
         msg.errmsg = errmsg;
         msg.errmsg = errmsg;
         callback && callback(msg);
         callback && callback(msg);
     }
     }
+
+
+    //---------ZNH----------
+    
 }
 }

+ 22 - 1
tower_sanguo/assets/scripts/vo/PlayerVO.ts

@@ -62,7 +62,12 @@ export default class PlayerVO {
     /**默认技能id -1统帅位无武将*/
     /**默认技能id -1统帅位无武将*/
     skill_default_id: number = -1;
     skill_default_id: number = -1;
     /**技能等级数据  key 技能id value 等级 -1表示未解锁*/
     /**技能等级数据  key 技能id value 等级 -1表示未解锁*/
-    skill_lv_data: Map<number,number>=new Map<number,number>();
+    skill_lv_data: Map<number, number> = new Map<number, number>();
+    /**技能冷却时间(剩余时间 秒)*/
+    skill_cooling_time:number=0;
+    /**剩余清除冷却次数*/
+    remaind_times:number=3;
+
 
 
     /** 到达的最大关卡,如果=current_mission+1,表示打前面一关没有通过 */
     /** 到达的最大关卡,如果=current_mission+1,表示打前面一关没有通过 */
     set max_mission(v: number) {
     set max_mission(v: number) {
@@ -84,4 +89,20 @@ export default class PlayerVO {
     isExistMarshalGeneral() {
     isExistMarshalGeneral() {
         return this.generals[4].id > 0;
         return this.generals[4].id > 0;
     }
     }
+
+    getMarshalGeneral(){
+        return this.generals[4];
+    }
+
+    /** 获取status=3(可以使用的武将)总星数*/
+    getAllStars() {
+        let star=0;
+        for (let i in this.generals_bag) {
+            let o = this.generals_bag[i];
+            if(o.status==3){
+                star+=o.star;
+            }
+        }
+        return star;
+    }
 }
 }

+ 1 - 1
tower_sanguo/assets/scripts/vo/SkillVO.ts

@@ -19,6 +19,6 @@ export default class SkillVO {
     attackRange: number;
     attackRange: number;
     /** 技能攻击的个数 */
     /** 技能攻击的个数 */
     attackNum: number;
     attackNum: number;
-    /** [最小攻击系数,最大攻击系数] */
+    /** [最小攻击系数,最大攻击系数] attType=3 万分比 attType=5 秒 */
     skillValue: number[] = [];
     skillValue: number[] = [];
 }
 }

Деякі файли не було показано, через те що забагато файлів було змінено