Przeglądaj źródła

Prop修改,value改为any,
支持字符串存储(主要用于propNoCheck),
但是需要在GameData中的initPlayerPropsNoCheck中特殊处理

修复统帅技能等级问题

zouyong 5 lat temu
rodzic
commit
50904c4b18

+ 1 - 1
tower_sanguo/assets/MOKA/net/HttpManager.ts

@@ -79,7 +79,7 @@ export default class HttpManager {
                     }
                 }
                 else {
-                    GameController.errorM.dealError("httpStatusError:" + url, ERROR_DEAL.REQUEST);
+                    LogUtil.logAndroid("收到请求..." + httpRequest.status)
                 }
             }
         }

+ 0 - 1
tower_sanguo/assets/scripts/data/GameData.ts

@@ -894,7 +894,6 @@ export default class GameData {
     updatePropNoCheck(type: PLAYERPROP, value, callback = null) {
         let self = this;
         GameController.http.savePlayerProp(() => {
-            self.player.setProp(type, value);
             if (callback) {
                 callback();
             }

+ 9 - 4
tower_sanguo/assets/scripts/module/fight/FightUI.ts

@@ -315,10 +315,15 @@ export default class FightUI extends BaseUI {
             this.createAttackSkillWall(vo);
         }
         else {//其他统帅技能
-            let rate = vo.skillValue[0] / 10000;
-            for (let i = 0; i < this.monster_arr.length; i++) {
-                let m: Monster = this.monster_arr[i];
-                this.createAttackSkill(vo, m.vo.type == 2 ? m.vo.maxhp * rate : 99999999, this.monster_arr[i]);
+            if (GameController.gameData.player.skill_default_id != -1) {
+                let lv = GameController.gameData.player.skill_lv_data.get(GameController.gameData.player.skill_default_id);
+                if (lv > 0) {
+                    let rate = vo.skillValue[lv - 1] / 10000;
+                    for (let i = 0; i < this.monster_arr.length; i++) {
+                        let m: Monster = this.monster_arr[i];
+                        this.createAttackSkill(vo, m.vo.type == 2 ? m.vo.maxhp * rate : 99999999, this.monster_arr[i]);
+                    }
+                }
             }
         }
         this.resumeGame();

+ 2 - 1
tower_sanguo/assets/scripts/module/fight/model/attack/AttackWall.ts

@@ -28,7 +28,8 @@ export default class AttackWall extends FightModel implements IPool {
     }
 
     init(vo: SkillVO, target: Monster) {
-        this.cd = vo.skillValue[0];
+        let lv = GameController.gameData.player.skill_lv_data.get(GameController.gameData.player.skill_default_id);
+        this.cd = vo.skillValue[lv - 1];
         let [x, y, x1, y1, src, type] = [0, 0, 0, 0, '', 1];
         if (target.moveStep < 3) {//左侧
             x = target.node.x;

+ 2 - 2
tower_sanguo/assets/scripts/net/HttpCommand.ts

@@ -24,7 +24,7 @@ export default class HttpCommand {
             this.serverUrl = 'https://xiyou-test.duiweize.com/';
         }
         this.serverUrl = 'http://172.16.15.97:9092/';//李扬
-        //this.serverUrl = 'http://172.16.15.91:9092/';//悍国
+        this.serverUrl = 'http://172.16.15.91:9092/';//悍国
     }
 
     httpM: any;
@@ -48,7 +48,7 @@ export default class HttpCommand {
     connectTest(callback) {
         GameController.commonData.ranKey = Utils.randomString()
         let data = {
-            "mac": "a5:65:e2:1c:b0:26,f6:60:e4:1a:b7:27",            
+            "mac": "c1:65:e2:1c:b0:26,f6:60:e4:1a:b7:27",            
             "psk": GameController.commonData.ranKey,
             "appId": GameController.commonData.appid
         }

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

@@ -47,7 +47,13 @@ export default class PlayerVO {
         return this.props.get(cointype).value;
     }
 
-    setProp(cointype: PLAYERPROP, value: number, add: boolean = false) {
+    /**
+     * 
+     * @param cointype 
+     * @param value prop--number   propNoCheck--string
+     * @param add 
+     */
+    setProp(cointype: PLAYERPROP, value: any, add: boolean = false) {
         let prop = this.props.get(cointype);
         if (!prop) {
             prop = new Prop(cointype);

+ 10 - 5
tower_sanguo/assets/scripts/vo/Prop.ts

@@ -6,18 +6,23 @@ import { PLAYERPROP } from "../data/GameDefinition";
 
 
 export default class Prop {
-    constructor(type: PLAYERPROP, value: number = null) {
+    constructor(type: PLAYERPROP, value: any = null) {
         this.type = type;
-        this.value = value | 0;
+        if(typeof value == 'number'){
+            this.value = value | 0;
+        }
+        else{
+            this.value = value ? value : 0;
+        }
     }
 
     type: PLAYERPROP;
-    _value: number;
-    set value(v: number) {
+    _value: any;
+    set value(v: any) {
         this._value = v;
         this.update();
     }
-    get value(): number {
+    get value(): any {
         return this._value;
     }