Browse Source

Merge branch 'master' of http://118.178.135.110:3000/fish/tower_client

txq 6 months ago
parent
commit
26df088646

+ 2 - 0
assets/script/framework/config/LayerConf.ts

@@ -47,6 +47,7 @@ export enum ViewID {
     EquipStrong,                  //装备强化
     EquipUpdate,                   //装备升星
     EquipOperate,                 //装备操作
+    HeroFate,                 //英雄羁绊
     
 }
 
@@ -74,4 +75,5 @@ export let Layer_Conf: { [key: number]: LayerConf } = {
     [ViewID.EquipStrong]: { bundle: "hero", url: "prefab/EquipStrong", type: LayerType.Game, anim: 2 },
     [ViewID.EquipUpdate]: { bundle: "hero", url: "prefab/EquipUpdate", type: LayerType.Game, anim: 2 },
     [ViewID.EquipOperate]: { bundle: "hero", url: "prefab/EquipOperate", type: LayerType.Game, anim: 2 },
+    [ViewID.HeroFate]: { bundle: "hero", url: "prefab/HeroFate", type: LayerType.Game, anim: 2 },
 };

+ 14 - 4
assets/script/game/config/FateConf.ts

@@ -12,7 +12,9 @@ export namespace FateConf {
                 "LevelCost2": 30,
                 "LevelCost3": 40,
                 "LevelCost4": 50,
-                "AttrId": 101
+                "AttrIdArray": [
+                        101
+                ]
         },
         "2": {
                 "Id": 2,
@@ -26,7 +28,9 @@ export namespace FateConf {
                 "LevelCost2": 30,
                 "LevelCost3": 40,
                 "LevelCost4": 50,
-                "AttrId": 201
+                "AttrIdArray": [
+                        201
+                ]
         },
         "3": {
                 "Id": 3,
@@ -40,7 +44,9 @@ export namespace FateConf {
                 "LevelCost2": 30,
                 "LevelCost3": 40,
                 "LevelCost4": 50,
-                "AttrId": 301
+                "AttrIdArray": [
+                        301
+                ]
         },
         "4": {
                 "Id": 4,
@@ -56,7 +62,11 @@ export namespace FateConf {
                 "LevelCost2": 30,
                 "LevelCost3": 40,
                 "LevelCost4": 50,
-                "AttrId": "401#402#403"
+                "AttrIdArray": [
+                        401,
+                        402,
+                        403
+                ]
         }
     };
 }

+ 24 - 24
assets/script/game/config/FateattridConf.ts

@@ -4,55 +4,55 @@ export namespace FateattridConf {
                 "Id": 101,
                 "Name": "羁绊1",
                 "Num": 2,
-                "AttrLevel1": "attck_p:10",
-                "AttrLevel2": "attck_p:10",
-                "AttrLevel3": "attck_p:10",
-                "AttrLevel4": "attck_p:10"
+                "AttrLevel1": "attack_p:1",
+                "AttrLevel2": "attack_p:1.2",
+                "AttrLevel3": "attack_p:1.3",
+                "AttrLevel4": "attack_p:1.4"
         },
         "201": {
                 "Id": 201,
                 "Name": "羁绊2",
                 "Num": 2,
-                "AttrLevel1": "attck_p:11",
-                "AttrLevel2": "attck_p:11",
-                "AttrLevel3": "attck_p:11",
-                "AttrLevel4": "attck_p:11"
+                "AttrLevel1": "attack_p:1",
+                "AttrLevel2": "attack_p:1.3",
+                "AttrLevel3": "attack_p:1.4",
+                "AttrLevel4": "attack_p:1.5"
         },
         "301": {
                 "Id": 301,
                 "Name": "羁绊3",
                 "Num": 2,
-                "AttrLevel1": "attck_p:12",
-                "AttrLevel2": "attck_p:12",
-                "AttrLevel3": "attck_p:12",
-                "AttrLevel4": "attck_p:12"
+                "AttrLevel1": "attack_p:1",
+                "AttrLevel2": "attack_p:1.4",
+                "AttrLevel3": "attack_p:1.5",
+                "AttrLevel4": "attack_p:1.6"
         },
         "401": {
                 "Id": 401,
                 "Name": "羁绊4-2人",
                 "Num": 2,
-                "AttrLevel1": "attck_p:13",
-                "AttrLevel2": "attck_p:13",
-                "AttrLevel3": "attck_p:13",
-                "AttrLevel4": "attck_p:13"
+                "AttrLevel1": "attack_p:1.1",
+                "AttrLevel2": "attack_p:1.2",
+                "AttrLevel3": "attack_p:1.3",
+                "AttrLevel4": "attack_p:1.4"
         },
         "402": {
                 "Id": 402,
                 "Name": "羁绊4-3人",
                 "Num": 3,
-                "AttrLevel1": "attck_p:14",
-                "AttrLevel2": "attck_p:14",
-                "AttrLevel3": "attck_p:14",
-                "AttrLevel4": "attck_p:14"
+                "AttrLevel1": "attack_p:1.2",
+                "AttrLevel2": "attack_p:1.3",
+                "AttrLevel3": "attack_p:1.4",
+                "AttrLevel4": "attack_p:1.5"
         },
         "403": {
                 "Id": 403,
                 "Name": "羁绊4-4人",
                 "Num": 4,
-                "AttrLevel1": "attck_p:15",
-                "AttrLevel2": "attck_p:15",
-                "AttrLevel3": "attck_p:15",
-                "AttrLevel4": "attck_p:15"
+                "AttrLevel1": "attack_p:1.4",
+                "AttrLevel2": "attack_p:1.5",
+                "AttrLevel3": "attack_p:1.6",
+                "AttrLevel4": "attack_p:1.7"
         }
     };
 }

+ 556 - 0
assets/script/game/config/GlobalConf.ts

@@ -4,9 +4,565 @@ export namespace GlobalConf {
                 "Key": "ResetHour",
                 "Value": 5
         },
+        "InitGold": {
+                "Key": "InitGold",
+                "Value": 0
+        },
+        "InitDiamond": {
+                "Key": "InitDiamond",
+                "Value": 0
+        },
+        "InitCash": {
+                "Key": "InitCash",
+                "Value": 0
+        },
+        "InitFood": {
+                "Key": "InitFood",
+                "Value": 180
+        },
+        "FoodRestoreTimeUnit": {
+                "Key": "FoodRestoreTimeUnit",
+                "Value": 60
+        },
+        "FoodRestoreLimit": {
+                "Key": "FoodRestoreLimit",
+                "Value": 180
+        },
+        "GenRoleXp": {
+                "Key": "GenRoleXp",
+                "Value": 10
+        },
         "MailMaxCount": {
                 "Key": "MailMaxCount",
                 "Value": 100
+        },
+        "AwardMailExpireDay": {
+                "Key": "AwardMailExpireDay",
+                "Value": 7
+        },
+        "MailTitleMaxLength": {
+                "Key": "MailTitleMaxLength",
+                "Value": 100
+        },
+        "MailContentMaxLength": {
+                "Key": "MailContentMaxLength",
+                "Value": 200
+        },
+        "FateMatId": {
+                "Key": "FateMatId",
+                "Value": 2
+        },
+        "FateResetCash": {
+                "Key": "FateResetCash",
+                "Value": 10
+        },
+        "EquipOverflowExpCoef": {
+                "Key": "EquipOverflowExpCoef",
+                "Value": 2
+        },
+        "EquipOverflowMaterialId": {
+                "Key": "EquipOverflowMaterialId",
+                "Value": 2
+        },
+        "A11111111111111111111111111": {
+                "Key": "A11111111111111111111111111",
+                "Value": "A1111111111111111111111111"
+        },
+        "CashTenCallCost": {
+                "Key": "CashTenCallCost",
+                "Value": 2520
+        },
+        "CashOneCallCost": {
+                "Key": "CashOneCallCost",
+                "Value": 280
+        },
+        "FriendTenCallCost": {
+                "Key": "FriendTenCallCost",
+                "Value": 20
+        },
+        "FriendOneCallCost": {
+                "Key": "FriendOneCallCost",
+                "Value": 2
+        },
+        "FriendRoleRate": {
+                "Key": "FriendRoleRate",
+                "Value": 30
+        },
+        "RaceTenCallCost": {
+                "Key": "RaceTenCallCost",
+                "Value": 10
+        },
+        "RaceOneCallCost": {
+                "Key": "RaceOneCallCost",
+                "Value": 1
+        },
+        "FirstCashTenHero": {
+                "Key": "FirstCashTenHero",
+                "Value": 520
+        },
+        "TavernEliteMinTime": {
+                "Key": "TavernEliteMinTime",
+                "Value": 9
+        },
+        "TavernRaceMinTime": {
+                "Key": "TavernRaceMinTime",
+                "Value": 9
+        },
+        "TavernFreeTime": {
+                "Key": "TavernFreeTime",
+                "Value": 82800
+        },
+        "RaceChangeCold": {
+                "Key": "RaceChangeCold",
+                "Value": 24
+        },
+        "TavernBoxFreshTime": {
+                "Key": "TavernBoxFreshTime",
+                "Value": 0.1
+        },
+        "ActiveRaceCashCost": {
+                "Key": "ActiveRaceCashCost",
+                "Value": 10
+        },
+        "ArenaReportLimit": {
+                "Key": "ArenaReportLimit",
+                "Value": 20
+        },
+        "ArenaDailyTickets": {
+                "Key": "ArenaDailyTickets",
+                "Value": 5
+        },
+        "ArenaInitUserScore": {
+                "Key": "ArenaInitUserScore",
+                "Value": 1000
+        },
+        "ArenaRankShowCount": {
+                "Key": "ArenaRankShowCount",
+                "Value": 20
+        },
+        "ArenaProtectRange": {
+                "Key": "ArenaProtectRange",
+                "Value": 50
+        },
+        "ArenaMatchPhase1": {
+                "Key": "ArenaMatchPhase1",
+                "Value": 200
+        },
+        "ArenaMatchPhase2": {
+                "Key": "ArenaMatchPhase2",
+                "Value": 150
+        },
+        "ArenaMatchPhase3": {
+                "Key": "ArenaMatchPhase3",
+                "Value": 500
+        },
+        "ArenaExtraScoreCondition": {
+                "Key": "ArenaExtraScoreCondition",
+                "Value": 10000
+        },
+        "ArenaExtraScoreSection": {
+                "Key": "ArenaExtraScoreSection",
+                "Value": 50
+        },
+        "ArenaExtraScorePerSection": {
+                "Key": "ArenaExtraScorePerSection",
+                "Value": 5
+        },
+        "ArenaExtraScoreTopRank": {
+                "Key": "ArenaExtraScoreTopRank",
+                "Value": 100
+        },
+        "ArenaRefreshCD": {
+                "Key": "ArenaRefreshCD",
+                "Value": 1
+        },
+        "ArenaOpenProgress": {
+                "Key": "ArenaOpenProgress",
+                "Value": 1
+        },
+        "ArenaBuyFightCash": {
+                "Key": "ArenaBuyFightCash",
+                "Value": 20
+        },
+        "ArenaExtraScoreMax": {
+                "Key": "ArenaExtraScoreMax",
+                "Value": 25
+        },
+        "ArenaStandRank": {
+                "Key": "ArenaStandRank",
+                "Value": 10
+        },
+        "ArenaStandTime": {
+                "Key": "ArenaStandTime",
+                "Value": 86400
+        },
+        "ArenaMatchNum": {
+                "Key": "ArenaMatchNum",
+                "Value": 3
+        },
+        "RaceCallActivateCost": {
+                "Key": "RaceCallActivateCost",
+                "Value": 300
+        },
+        "HungTaskFreshTime": {
+                "Key": "HungTaskFreshTime",
+                "Value": 3600
+        },
+        "HungTaskRefreshCostCash": {
+                "Key": "HungTaskRefreshCostCash",
+                "Value": 30
+        },
+        "HungTaskRefreshCostMatId": {
+                "Key": "HungTaskRefreshCostMatId",
+                "Value": 18
+        },
+        "HungTaskRefreshNum": {
+                "Key": "HungTaskRefreshNum",
+                "Value": 5
+        },
+        "HungTaskDailyFreeRefreshCount": {
+                "Key": "HungTaskDailyFreeRefreshCount",
+                "Value": 3
+        },
+        "HungTaskCostCashRate": {
+                "Key": "HungTaskCostCashRate",
+                "Value": 10
+        },
+        "DuplicateHungStartProcess": {
+                "Key": "DuplicateHungStartProcess",
+                "Value": 1
+        },
+        "DuplicateHungTimeUnit": {
+                "Key": "DuplicateHungTimeUnit",
+                "Value": 60
+        },
+        "DuplicateHungMaxCount": {
+                "Key": "DuplicateHungMaxCount",
+                "Value": 720
+        },
+        "DuplicateHungSpeedCount": {
+                "Key": "DuplicateHungSpeedCount",
+                "Value": 120
+        },
+        "DuplicateHungMaxEquipCount": {
+                "Key": "DuplicateHungMaxEquipCount",
+                "Value": 50
+        },
+        "ArenaReportExpireDay": {
+                "Key": "ArenaReportExpireDay",
+                "Value": 3
+        },
+        "ResDuplicateFree": {
+                "Key": "ResDuplicateFree",
+                "Value": 2
+        },
+        "FriendApplyNumLimit": {
+                "Key": "FriendApplyNumLimit",
+                "Value": 20
+        },
+        "FriendNumLimit": {
+                "Key": "FriendNumLimit",
+                "Value": 40
+        },
+        "FriendDailyGiftGetLimit": {
+                "Key": "FriendDailyGiftGetLimit",
+                "Value": 10
+        },
+        "FriendDailyGiftSendLimit": {
+                "Key": "FriendDailyGiftSendLimit",
+                "Value": 20
+        },
+        "FriendOpenLevel": {
+                "Key": "FriendOpenLevel",
+                "Value": 21
+        },
+        "FriendOverTime": {
+                "Key": "FriendOverTime",
+                "Value": 48
+        },
+        "FriendRecommendCount": {
+                "Key": "FriendRecommendCount",
+                "Value": 10
+        },
+        "FriendMessageMax": {
+                "Key": "FriendMessageMax",
+                "Value": 3000
+        },
+        "FriendGiftId": {
+                "Key": "FriendGiftId",
+                "Value": 10034
+        },
+        "FriendRecommendFilterDay": {
+                "Key": "FriendRecommendFilterDay",
+                "Value": 2
+        },
+        "FriendSearchNameShowCount": {
+                "Key": "FriendSearchNameShowCount",
+                "Value": 7
+        },
+        "ChatMaxLen": {
+                "Key": "ChatMaxLen",
+                "Value": 100
+        },
+        "ChatMaxLenCn": {
+                "Key": "ChatMaxLenCn",
+                "Value": 150
+        },
+        "ChatMaxLenEn": {
+                "Key": "ChatMaxLenEn",
+                "Value": 100
+        },
+        "ChatBlackTime": {
+                "Key": "ChatBlackTime",
+                "Value": 1
+        },
+        "ChatMaxCount": {
+                "Key": "ChatMaxCount",
+                "Value": 30
+        },
+        "PersonalInfoChangeCost": {
+                "Key": "PersonalInfoChangeCost",
+                "Value": 200
+        },
+        "FirstAccPayLimitTime": {
+                "Key": "FirstAccPayLimitTime",
+                "Value": 7
+        },
+        "FirstAccPayCash": {
+                "Key": "FirstAccPayCash",
+                "Value": 1000
+        },
+        "MonthCardDays": {
+                "Key": "MonthCardDays",
+                "Value": 30
+        },
+        "MonthCardSuperCash": {
+                "Key": "MonthCardSuperCash",
+                "Value": 880
+        },
+        "MonthCardNormalCash": {
+                "Key": "MonthCardNormalCash",
+                "Value": 300
+        },
+        "MonthCardSuperReward": {
+                "Key": "MonthCardSuperReward",
+                "Value": "user.cash:200"
+        },
+        "MonthCardNormalReward": {
+                "Key": "MonthCardNormalReward",
+                "Value": "user.cash:100"
+        },
+        "LegionTechLimitShowLv": {
+                "Key": "LegionTechLimitShowLv",
+                "Value": 5
+        },
+        "LegionTechResetCash": {
+                "Key": "LegionTechResetCash",
+                "Value": 300
+        },
+        "AcmPayExtraCash": {
+                "Key": "AcmPayExtraCash",
+                "Value": 100
+        },
+        "ArenaResetHour": {
+                "Key": "ArenaResetHour",
+                "Value": 21
+        },
+        "MaxNameLength": {
+                "Key": "MaxNameLength",
+                "Value": 20
+        },
+        "MaxNameLengthCn": {
+                "Key": "MaxNameLengthCn",
+                "Value": 30
+        },
+        "MaxNameLengthEn": {
+                "Key": "MaxNameLengthEn",
+                "Value": 20
+        },
+        "MaxNameLengthKr": {
+                "Key": "MaxNameLengthKr",
+                "Value": 30
+        },
+        "TimeUpDrawMatId": {
+                "Key": "TimeUpDrawMatId",
+                "Value": 16
+        },
+        "SingleWarMaxTeamNum": {
+                "Key": "SingleWarMaxTeamNum",
+                "Value": 5
+        },
+        "SingleWarTeamMinRoleNum": {
+                "Key": "SingleWarTeamMinRoleNum",
+                "Value": 3
+        },
+        "SingleWarBuyFightCash": {
+                "Key": "SingleWarBuyFightCash",
+                "Value": 50
+        },
+        "SingleWarDailyTickets": {
+                "Key": "SingleWarDailyTickets",
+                "Value": 5
+        },
+        "SingleWarMatchPhase2Num": {
+                "Key": "SingleWarMatchPhase2Num",
+                "Value": 3
+        },
+        "SingleWarMatchPhase3Num": {
+                "Key": "SingleWarMatchPhase3Num",
+                "Value": 2
+        },
+        "SingleWarMatchNum": {
+                "Key": "SingleWarMatchNum",
+                "Value": 5
+        },
+        "SingleWarRankShowCount": {
+                "Key": "SingleWarRankShowCount",
+                "Value": 20
+        },
+        "SingleWarReportLimit": {
+                "Key": "SingleWarReportLimit",
+                "Value": 20
+        },
+        "SingelWarDefaultChangeScore": {
+                "Key": "SingelWarDefaultChangeScore",
+                "Value": 20
+        },
+        "SinglewarRobotScoreReset": {
+                "Key": "SinglewarRobotScoreReset",
+                "Value": 1
+        },
+        "SinglewarProtectStageScore": {
+                "Key": "SinglewarProtectStageScore",
+                "Value": 1000
+        },
+        "SingleWarDefendWinScore": {
+                "Key": "SingleWarDefendWinScore",
+                "Value": 60
+        },
+        "SingleWarDefendLoseScore": {
+                "Key": "SingleWarDefendLoseScore",
+                "Value": 60
+        },
+        "SingleWarDefaultStageCoef": {
+                "Key": "SingleWarDefaultStageCoef",
+                "Value": 0
+        },
+        "GameCurrency": {
+                "Key": "GameCurrency",
+                "Value": "Rmb"
+        },
+        "VoucherExchangeRate": {
+                "Key": "VoucherExchangeRate",
+                "Value": 10
+        },
+        "CashTenCallRoleProcectCount": {
+                "Key": "CashTenCallRoleProcectCount",
+                "Value": 5
+        },
+        "CallRoleProtectCheckSsrNum": {
+                "Key": "CallRoleProtectCheckSsrNum",
+                "Value": 2
+        },
+        "FirstPayLimitTime": {
+                "Key": "FirstPayLimitTime",
+                "Value": 7
+        },
+        "ChatOpenLevel": {
+                "Key": "ChatOpenLevel",
+                "Value": 35
+        },
+        "HeroCraftDailyCount": {
+                "Key": "HeroCraftDailyCount",
+                "Value": 3
+        },
+        "CashTenPurpleMax": {
+                "Key": "CashTenPurpleMax",
+                "Value": 2
+        },
+        "FirstCashTenPurpleMax": {
+                "Key": "FirstCashTenPurpleMax",
+                "Value": 1
+        },
+        "FirstCashTenHeroSecond": {
+                "Key": "FirstCashTenHeroSecond",
+                "Value": 110
+        },
+        "DefaultHeadPic": {
+                "Key": "DefaultHeadPic",
+                "Value": 110
+        },
+        "BuyGoldCash": {
+                "Key": "BuyGoldCash",
+                "Value": 50
+        },
+        "BuyGoldDailyTime": {
+                "Key": "BuyGoldDailyTime",
+                "Value": 5
+        },
+        "SevenDayExtraDuration": {
+                "Key": "SevenDayExtraDuration",
+                "Value": 3
+        },
+        "TavernCashPoint": {
+                "Key": "TavernCashPoint",
+                "Value": 1
+        },
+        "TavernRacePoint": {
+                "Key": "TavernRacePoint",
+                "Value": 2
+        },
+        "TavernWishAddWeightCoef": {
+                "Key": "TavernWishAddWeightCoef",
+                "Value": 1.5
+        },
+        "TavernWishAccountRewardDay": {
+                "Key": "TavernWishAccountRewardDay",
+                "Value": 7
+        },
+        "TavernWishAccountRewardCoef": {
+                "Key": "TavernWishAccountRewardCoef",
+                "Value": 0.5
+        },
+        "AutoBanChat": {
+                "Key": "AutoBanChat",
+                "Value": 10080
+        },
+        "AutoBanChatJudgeTime": {
+                "Key": "AutoBanChatJudgeTime",
+                "Value": 7200
+        },
+        "AutoBanChatJudgeNum": {
+                "Key": "AutoBanChatJudgeNum",
+                "Value": 5
+        },
+        "ChatAccuse": {
+                "Key": "ChatAccuse",
+                "Value": 1
+        },
+        "WishHeroSsrCount": {
+                "Key": "WishHeroSsrCount",
+                "Value": 8
+        },
+        "NoClearUpDrawMat": {
+                "Key": "NoClearUpDrawMat",
+                "Value": 0
+        },
+        "ChatOpenPaid": {
+                "Key": "ChatOpenPaid",
+                "Value": 328
+        },
+        "DiscountCoef": {
+                "Key": "DiscountCoef",
+                "Value": 1
+        },
+        "ChatFriendOpenHour": {
+                "Key": "ChatFriendOpenHour",
+                "Value": 48
+        },
+        "ChatOpenHour": {
+                "Key": "ChatOpenHour",
+                "Value": 24
         }
     };
 }

+ 1 - 0
assets/script/game/data/GameEvent.ts

@@ -30,6 +30,7 @@ let event = {
 	
 
 	EquipWearChange: "EquipWearChange",									//穿戴装备变化
+	FateChange: "FateChange",											//羁绊变化
 
 }
 

+ 7 - 5
assets/script/game/data/RoleData.ts

@@ -1,3 +1,4 @@
+import { ItemEnum } from "../common/InterfaceAddEnum";
 import { RoleConf } from "../ui/tower/conf/RoleConf";
 
 //服务器端返回的英雄数据
@@ -9,7 +10,8 @@ interface RoleServer {
     equip: [];//读取状态
     skin: [];//皮肤
     fight_force: number;//战力
-    conf: {}//配置
+    conf: {};//配置
+    type:ItemEnum
 }
 //出战英雄数据[种族1 typeID,种族2 typeID,种族3 typeID,种族4 typeID]
 export type FightRole = [number, number, number, number]
@@ -20,7 +22,7 @@ class Data {
     //上阵英雄
     private _fightRole: FightRole = [0, 0, 0, 0];
     //羁绊
-    private _fate: { [id: string]: number } = {};
+    private _fate: { [id: string]: {} } = {};
     setData(data: { [id: string]: RoleServer }): void {
         let rConf = RoleConf.data;
         if (data) {
@@ -30,6 +32,7 @@ class Data {
                         const role = data[id];
                         role.conf = rConf[id];
                         this._roles[id] = role;
+                        role.type = ItemEnum.role;
                         // console.log(`ID: ${id}, Name: ${role.name}, Level: ${role.level}`);
                     }
                 }
@@ -77,15 +80,14 @@ class Data {
 
     }
 
-    set fate(data: { [key: string]: number }) {
-
+    set fate(data: { [key: string]: {} }) {
+        this._fate = data;
     }
 
     get fate() {
         return this._fate;
     }
 
-
 }
 
 export let RoleData = new Data;

+ 48 - 0
assets/script/game/manager/RoleManager.ts

@@ -1,5 +1,8 @@
 import { Framework } from "../../framework/Framework";
+import { ItemEnum } from "../common/InterfaceAddEnum";
 import { LoginMgr } from "../common/LoginManager";
+import { FateattridConf } from "../config/FateattridConf";
+import { FateConf } from "../config/FateConf";
 import { RoleData } from "../data/RoleData";
 import { RoleConf } from "../ui/tower/conf/RoleConf";
 import { GoodsManager } from "./GoodsManager";
@@ -29,6 +32,17 @@ export class RoleManager {
         }, args)
     }
 
+    static sendFateLevelUp(args: { id: number }, callback){
+        LoginMgr.sendPost('role', 'fate_level_up', (data) => {
+            console.log(data);
+            this.setFateData(data.fate);
+            if(data.awards){
+                Framework.unionManager.parseServerAwards(data.awards);
+            }
+            callback();
+        }, args)
+    }
+
     static getRolesRaceGroup() {
         let roles = {};
         let roleConf = RoleConf.data
@@ -62,4 +76,38 @@ export class RoleManager {
         }
         return roles;
     }
+
+    static getRoleById(rId: number) {
+        let roleConf = RoleConf.data[rId]
+        if (roleConf){
+           let rData = RoleData.getRoleDataByID(rId);
+            if (rData) {
+                return rData;
+            } else {
+                return { conf: roleConf, type: ItemEnum.role};
+            }
+        }
+        return null;
+    }
+    
+
+    static setFateData(data: { [key: string]: number }) {
+        let fateData = {};
+        let conf = FateConf.data;
+        let atteConf = FateattridConf.data;
+        for (const key in conf) {
+            if (Object.prototype.hasOwnProperty.call(conf, key)) {
+                const element = conf[key];
+                fateData[key] = {
+                    id:key,
+                    conf:element,
+                    level:0
+                };
+                if (data[key]) {
+                    fateData[key].level = data[key];
+                }
+            }
+        }
+        RoleData.fate = fateData;
+    }
 }

+ 2 - 1
assets/script/game/manager/UnionManager.ts

@@ -9,6 +9,7 @@ import { RoleData } from "../data/RoleData";
 import { UserData } from "../data/UserData";
 import { EquipManager } from "./EquipManager";
 import { GoodsManager } from "./GoodsManager";
+import { RoleManager } from "./RoleManager";
 
 
 //所有manager的连接器
@@ -98,7 +99,7 @@ export class UnionManager {
         }
 
         if (data.fate) {
-            RoleData.fate = data.fate;
+            RoleManager.setFateData(data.fate);
         }
         
         BattleData.setLoginData(data)

+ 11 - 2
assets/script/game/ui/common/CommonItem.ts

@@ -78,8 +78,7 @@ export class CommonItem extends ResKeeper {
 			this.setEquip();
 		} else if (this.data.type == ItemEnum.role) {
 			this.setRole();
-		}
-		else if (this.data.type == ItemEnum.user) {
+		}else if (this.data.type == ItemEnum.user) {
 			this.setUser();
 		}
 		this.numTx.node.active = this.isNumShow;
@@ -107,6 +106,10 @@ export class CommonItem extends ResKeeper {
 			this.icoImg.spriteFrame = res;
 		})
 		this.numTx.string = this.data.count;
+		this.raceIco.active = true;
+		this.load('common', `texture/image/race_ball_${this.data.conf.Race}/spriteFrame`, SpriteFrame, (res: SpriteFrame) => {
+			this.raceIco.getComponent(Sprite).spriteFrame = res;
+		})
 	}
 
 	setUser() {
@@ -129,6 +132,12 @@ export class CommonItem extends ResKeeper {
 		this.isNumShow = state;
 	}
 
+	setGray(state: boolean) {
+		this.farmeBg.grayscale = state;
+		this.icoImg.grayscale = state;
+		this.raceIco.getComponent(Sprite).grayscale = state;
+	}
+
 	setClick(callFunc) {
 		this.clickFunc = callFunc;
 	}

+ 0 - 58
assets/script/game/ui/hero/HeroFataItem.ts

@@ -1,58 +0,0 @@
-import { _decorator, Label, Node, Sprite } from 'cc';
-import { ResKeeper } from '../../../framework/res/ResKeeper';
-import { StringUtil } from '../../../framework/util/StringUtil';
-import List from '../../../framework/list/List';
-const { ccclass, property } = _decorator;
-
-@ccclass('HeroFataItem')
-export class HeroFataItem extends ResKeeper {
-	@property({ type: Sprite, tooltip: "名称背景" })
-	titleBg: Sprite = null;
-
-	@property({ type: Label, tooltip: "名称文字" })
-	titleTx: Label = null;
-
-	@property({ type: Node, tooltip: "英雄节点" })
-	itemNode: Node = null;
-
-	@property({ type: Node, tooltip: "升级按钮" })
-	updateBtn: Node = null;
-
-	@property({ type: Label, tooltip: "升级按钮文字" })
-	updateBtnTx: Label = null;
-
-	@property({ type: Node, tooltip: "激活按钮" })
-	activeBtn: Node = null;
-
-	@property({ type: Label, tooltip: "激活按钮文字" })
-	activeBtnTx: Label = null;
-
-	@property({ type: List, tooltip: "描述列表" })
-	svDesc: List = null;
-
-	protected onLoad() {
-		this.updateBtnTx.string = StringUtil.getLanguageData('升级');
-		this.activeBtnTx.string = StringUtil.getLanguageData('激活');
-	}
-
-	protected onDestroy() {
-		//如果该组件有事件自行取消注释
-		//Framework.event.removeEvent(this);
-		super.onDestroy();
-	}
-	
-	//如果使用了池中的节点,在该函数内归还,该函数会在onDestroy前调用
-	onClose() {
-		
-	}
-
-	//UI事件处理
-	private onTouchButton(event: Event) {
-		//Framework.audio.playEffect(AudioID.Click);
-		let target: any = event.target;
-	}
-
-	onEventList(item, idx) {
-		// item.getComponent(HeroFateItem).refreshItem(this._equipsData[idx], this._curEquip);
-	}
-}

+ 26 - 5
assets/script/game/ui/hero/HeroFate.ts

@@ -4,6 +4,9 @@ import { StringUtil } from '../../../framework/util/StringUtil';
 import List from '../../../framework/list/List';
 import { Framework } from '../../../framework/Framework';
 import { Equip } from '../../data/EquipData';
+import { RoleData } from '../../data/RoleData';
+import { HeroFateItem } from './HeroFateItem';
+import { GameEvent } from '../../data/GameEvent';
 
 const { ccclass, property } = _decorator;
 
@@ -26,13 +29,13 @@ export class HeroFate extends BaseView {
 	protected onLoad() {
 		super.onLoad();
 		this.closeTips.string = StringUtil.getLanguageData('点击空白关闭');
-		this.titieTx.string = StringUtil.getLanguageData('装备选择');
+		this.titieTx.string = StringUtil.getLanguageData('英雄羁绊');
 
 		this.closeTips.node.getComponent(UIOpacity).opacity = 0;
 
-		// Framework.event.addEvent(GameEvent.EquipWearChange, () => {
-		// 	Framework.layer.close(this);
-		// }, this);
+		Framework.event.addEvent(GameEvent.FateChange, () => {
+			this.updateUI();
+		}, this);
 	}
 
 	protected onDestroy() {
@@ -47,6 +50,8 @@ export class HeroFate extends BaseView {
 			.union()
 			.repeatForever()
 			.start()
+
+			this.updateUI();
 			
 	}
 
@@ -74,7 +79,23 @@ export class HeroFate extends BaseView {
 		}
 	}
 
+	updateUI() {
+		this._fettersList = [];
+		let data = RoleData.fate;
+		for (const key in data) {
+			if (Object.prototype.hasOwnProperty.call(data, key)) {
+				const element = data[key];
+				this._fettersList.push(element);
+			}
+		}
+		this._fettersList.sort((a, b) => {
+            return Number(a.id) > Number(b.id) ? -1 : 1;
+        });
+
+		this.itemList.numItems = this._fettersList.length;
+	}
+
 	onEventList(item, idx) {
-		// item.getComponent(HeroFateItem).refreshItem(this._equipsData[idx], this._curEquip);
+		item.getComponent(HeroFateItem).refreshItem(this._fettersList[idx]);
 	}
 }

+ 199 - 0
assets/script/game/ui/hero/HeroFateItem.ts

@@ -0,0 +1,199 @@
+import { _decorator, Color, instantiate, Label, Layout, Node, Prefab, ScrollView, Sprite } from 'cc';
+import { ResKeeper } from '../../../framework/res/ResKeeper';
+import { StringUtil } from '../../../framework/util/StringUtil';
+import List from '../../../framework/list/List';
+import { FateattridConf } from '../../config/FateattridConf';
+import { AttrAddTypeEnum, AttrEnum, ItemEnum } from '../../common/InterfaceAddEnum';
+import { RoleManager } from '../../manager/RoleManager';
+import { CommonItem } from '../common/CommonItem';
+import { Framework } from '../../../framework/Framework';
+import { GameEvent } from '../../data/GameEvent';
+import { GoodsData } from '../../data/GoodsData';
+import { GoodsManager } from '../../manager/GoodsManager';
+import { GlobalConf } from '../../config/GlobalConf';
+const { ccclass, property } = _decorator;
+
+@ccclass('HeroFateItem')
+export class HeroFateItem extends ResKeeper {
+	@property({ type: Sprite, tooltip: "名称背景" })
+	titleBg: Sprite = null;
+
+	@property({ type: Label, tooltip: "名称文字" })
+	titleTx: Label = null;
+
+	@property({ type: Node, tooltip: "英雄节点" })
+	itemNode: Node = null;
+
+	@property({ type: Node, tooltip: "升级按钮" })
+	updateBtn: Node = null;
+
+	@property({ type: Label, tooltip: "升级按钮文字" })
+	updateBtnTx: Label = null;
+
+	@property({ type: Node, tooltip: "激活按钮" })
+	activeBtn: Node = null;
+
+	@property({ type: Label, tooltip: "激活按钮文字" })
+	activeBtnTx: Label = null;
+
+	@property({ type: List, tooltip: "描述列表" })
+	svDesc: List = null;
+
+	private _data = {};
+	private canActive = false;
+	private _descData = [];
+	private _costNum = 0;
+
+	protected onLoad() {
+		this.updateBtnTx.string = StringUtil.getLanguageData('升级');
+		this.activeBtnTx.string = StringUtil.getLanguageData('激活');
+	}
+
+	protected onDestroy() {
+		//如果该组件有事件自行取消注释
+		//Framework.event.removeEvent(this);
+		super.onDestroy();
+	}
+
+	//如果使用了池中的节点,在该函数内归还,该函数会在onDestroy前调用
+	onClose() {
+
+	}
+
+	//UI事件处理
+	private onTouchButton(event: Event) {
+		//Framework.audio.playEffect(AudioID.Click);
+		let target: any = event.target;
+		if (target.name == 'update_btn') {
+			let cost = GoodsManager.getGoodsById(String(GlobalConf.data.FateMatId.Value));
+			if (cost.count < this._costNum) {
+				Framework.tips.setTips(StringUtil.getLanguageData('升级所需材料不足'));
+				return;
+			}
+			let args = {
+				id: this._data['conf']['Id']
+			}
+			RoleManager.sendFateLevelUp(args, () => {
+				Framework.event.fireEvent(GameEvent.FateChange);
+			})
+		} else if (target.name == 'active_btn') {
+			let cost = GoodsManager.getGoodsById(String(GlobalConf.data.FateMatId.Value));
+			if (cost.count < this._costNum) {
+				Framework.tips.setTips(StringUtil.getLanguageData('激活所需材料不足'));
+				return;
+			}
+			if (!this.canActive) {
+				Framework.tips.setTips(StringUtil.getLanguageData('至少需要获得两个英雄!'));
+				return;
+			}
+			let args = {
+				id: this._data['conf']['Id']
+			}
+			RoleManager.sendFateLevelUp(args, () => {
+				Framework.event.fireEvent(GameEvent.FateChange);
+			})
+		}
+	}
+
+	refreshItem(data) {
+		this._data = data;
+		let color = '#ffffff'
+		if (data.conf.Grade == 1) {
+			color = '#7CE680'
+		} else if (data.conf.Grade == 2) {
+			color = '#306AFF'
+		} else if (data.conf.Grade == 3) {
+			color = '#A46DEB'
+		} else if (data.conf.Grade == 4) {
+			color = '#EB9A6D'
+		} else if (data.conf.Grade == 5) {
+			color = '#EB6D6D'
+		}
+		this.titleBg.color = new Color(color);
+
+		this.canActive = false;
+		let activeRole = 0
+		for (const element of data.conf.FateRidArray) {
+			let role = RoleManager.getRoleById(element);
+			if (role) {
+				if (role['id']) {
+					activeRole = activeRole + 1
+				}
+				this.load('common', `prefab/CommonItem`, Prefab, (pre: Prefab) => {
+					let item = instantiate(pre);
+					this.itemNode.addChild(item);
+					item.getComponent(CommonItem).setClickEnable(false);
+					item.getComponent(CommonItem).setNumShow(false);
+					item.getComponent(CommonItem).setGray(role['id'] ? false : true);
+					item.getComponent(CommonItem).refreshItem(role);
+				})
+			}
+		}
+		
+		this.canActive = (activeRole >= 2);
+
+		this._descData = [];
+		this.itemNode.removeAllChildren();
+		let atteConf = FateattridConf.data;
+		for (let lv = 1; lv <= 4; lv++) {
+			let arr = ['', '', ''];
+			for (let index = 0; index < data.conf.AttrIdArray.length; index++) {
+				const element = atteConf[data.conf.AttrIdArray[index]];
+				let attr = element['AttrLevel' + lv].split(':');
+				let attrConf = AttrEnum[attr[0]]
+				let value = attrConf.type == AttrAddTypeEnum.reality ? attr[1] + '' :
+					parseFloat((100 * Number(attr[1])).toFixed(2)) + '%'
+				arr[1] = StringUtil.getLanguageData(attrConf.name);
+				if (arr[0] == '') {
+					arr[0] = arr[0] + element.Num
+				} else {
+					arr[0] = arr[0] + '/' + element.Num
+				}
+				if (arr[2] == '') {
+					arr[2] = arr[2] + value
+				} else {
+					arr[2] = arr[2] + '/' + value
+				}
+			}
+			if (this._costNum <= 0) {
+				if (lv > data.level) {
+					this._costNum = data.conf['LevelCost' + lv]
+				}
+			}
+
+			let t = {
+				str: 'Lv.' + lv + ' ' + StringUtil.getLanguageData(`{0}人同时上阵,羁绊中英雄{1}提升{2}`, arr),
+				state: lv <= data.level
+			}
+			this._descData.push(t);
+		}
+
+
+		this.svDesc.numItems = this._descData.length;
+
+		let name = StringUtil.getLanguageData(data.conf.Name);
+		if (data.level > 0) {
+			this.titleTx.string = name + ' Lv.' + data.level;
+			this.updateBtn.active = true;
+			this.activeBtn.active = false;
+		} else {
+			this.titleTx.string = name + ` (${StringUtil.getLanguageData('未激活')})`;
+			this.updateBtn.active = false;
+			this.activeBtn.active = true;
+		}
+	}
+
+	onEventList(item, idx) {
+		item.getComponent(Label).string = this._descData[idx].str;
+		if (this._descData[idx].state) {
+			item.getComponent(Label).color = new Color('#8A6230');
+		} else {
+			item.getComponent(Label).color = new Color('#C5B29A');
+		}
+		if (idx == this._descData.length - 1) {
+			this.scheduleOnce(() => {
+				this.svDesc.getComponent(ScrollView).content.getComponent(Layout).updateLayout(true);
+			}, 0.1);
+		}
+	}
+}

+ 0 - 0
assets/script/game/ui/hero/HeroFataItem.ts.meta → assets/script/game/ui/hero/HeroFateItem.ts.meta


+ 1 - 3
assets/script/game/ui/tower/TowerUI.ts

@@ -1353,9 +1353,7 @@ export class TowerUI extends BaseView {
 		} else if (target.name == 'hero_btn') {
 			Framework.layer.open(ViewID.HeroList);
 		} else if (target.name == 'material_btn') {
-			LoginMgr.sendPost('tavern', 'get', (data) => {
-				console.log(data);
-			}, {})
+			Framework.layer.open(ViewID.HeroFate);
 		} else if (target.name == 'mail_btn') {
 			MailManager.sendGetMailMsg({ ids: [MailData.getMaxMailId(0), MailData.getMaxMailId(1)] }, () => {
 				Framework.layer.open(ViewID.MailMain);

+ 24 - 24
assets/script/game/ui/tower/conf/RoleConf.ts

@@ -3,7 +3,7 @@ export namespace RoleConf {
         "101": {
                 "Id": 101,
                 "Race": 1,
-                "Quantity": 1,
+                "Quality": 1,
                 "Speed": 30,
                 "Damage": 1,
                 "Critical": 0.1,
@@ -21,7 +21,7 @@ export namespace RoleConf {
         "102": {
                 "Id": 102,
                 "Race": 1,
-                "Quantity": 2,
+                "Quality": 2,
                 "Speed": 30,
                 "Damage": 1,
                 "Critical": 0.1,
@@ -36,7 +36,7 @@ export namespace RoleConf {
         "103": {
                 "Id": 103,
                 "Race": 1,
-                "Quantity": 3,
+                "Quality": 3,
                 "Speed": 30,
                 "Damage": 2,
                 "Critical": 0.1,
@@ -53,7 +53,7 @@ export namespace RoleConf {
         "104": {
                 "Id": 104,
                 "Race": 1,
-                "Quantity": 4,
+                "Quality": 4,
                 "Speed": 30,
                 "Damage": 2,
                 "Critical": 0.1,
@@ -70,7 +70,7 @@ export namespace RoleConf {
         "105": {
                 "Id": 105,
                 "Race": 1,
-                "Quantity": 5,
+                "Quality": 5,
                 "Speed": 30,
                 "Damage": 2,
                 "Critical": 0.1,
@@ -87,7 +87,7 @@ export namespace RoleConf {
         "106": {
                 "Id": 106,
                 "Race": 1,
-                "Quantity": 6,
+                "Quality": 6,
                 "Speed": 30,
                 "Damage": 2,
                 "Critical": 0.1,
@@ -104,7 +104,7 @@ export namespace RoleConf {
         "201": {
                 "Id": 201,
                 "Race": 2,
-                "Quantity": 1,
+                "Quality": 1,
                 "Speed": 30,
                 "Damage": 1,
                 "Critical": 0.1,
@@ -122,7 +122,7 @@ export namespace RoleConf {
         "202": {
                 "Id": 202,
                 "Race": 2,
-                "Quantity": 2,
+                "Quality": 2,
                 "Speed": 30,
                 "Damage": 1,
                 "Critical": 0.1,
@@ -137,7 +137,7 @@ export namespace RoleConf {
         "203": {
                 "Id": 203,
                 "Race": 2,
-                "Quantity": 3,
+                "Quality": 3,
                 "Speed": 30,
                 "Damage": 2,
                 "Critical": 0.1,
@@ -154,7 +154,7 @@ export namespace RoleConf {
         "204": {
                 "Id": 204,
                 "Race": 2,
-                "Quantity": 4,
+                "Quality": 4,
                 "Speed": 30,
                 "Damage": 2,
                 "Critical": 0.1,
@@ -171,7 +171,7 @@ export namespace RoleConf {
         "205": {
                 "Id": 205,
                 "Race": 2,
-                "Quantity": 5,
+                "Quality": 5,
                 "Speed": 30,
                 "Damage": 2,
                 "Critical": 0.1,
@@ -188,7 +188,7 @@ export namespace RoleConf {
         "206": {
                 "Id": 206,
                 "Race": 2,
-                "Quantity": 6,
+                "Quality": 6,
                 "Speed": 30,
                 "Damage": 2,
                 "Critical": 0.1,
@@ -205,7 +205,7 @@ export namespace RoleConf {
         "301": {
                 "Id": 301,
                 "Race": 3,
-                "Quantity": 1,
+                "Quality": 1,
                 "Speed": 30,
                 "Damage": 1,
                 "Critical": 0.1,
@@ -223,7 +223,7 @@ export namespace RoleConf {
         "302": {
                 "Id": 302,
                 "Race": 3,
-                "Quantity": 2,
+                "Quality": 2,
                 "Speed": 30,
                 "Damage": 1,
                 "Critical": 0.1,
@@ -238,7 +238,7 @@ export namespace RoleConf {
         "303": {
                 "Id": 303,
                 "Race": 3,
-                "Quantity": 3,
+                "Quality": 3,
                 "Speed": 30,
                 "Damage": 2,
                 "Critical": 0.1,
@@ -255,7 +255,7 @@ export namespace RoleConf {
         "304": {
                 "Id": 304,
                 "Race": 3,
-                "Quantity": 4,
+                "Quality": 4,
                 "Speed": 30,
                 "Damage": 2,
                 "Critical": 0.1,
@@ -272,7 +272,7 @@ export namespace RoleConf {
         "305": {
                 "Id": 305,
                 "Race": 3,
-                "Quantity": 5,
+                "Quality": 5,
                 "Speed": 30,
                 "Damage": 2,
                 "Critical": 0.1,
@@ -289,7 +289,7 @@ export namespace RoleConf {
         "306": {
                 "Id": 306,
                 "Race": 3,
-                "Quantity": 6,
+                "Quality": 6,
                 "Speed": 30,
                 "Damage": 2,
                 "Critical": 0.1,
@@ -306,7 +306,7 @@ export namespace RoleConf {
         "401": {
                 "Id": 401,
                 "Race": 4,
-                "Quantity": 1,
+                "Quality": 1,
                 "Speed": 30,
                 "Damage": 1,
                 "Critical": 0.1,
@@ -324,7 +324,7 @@ export namespace RoleConf {
         "402": {
                 "Id": 402,
                 "Race": 4,
-                "Quantity": 2,
+                "Quality": 2,
                 "Speed": 30,
                 "Damage": 1,
                 "Critical": 0.1,
@@ -339,7 +339,7 @@ export namespace RoleConf {
         "403": {
                 "Id": 403,
                 "Race": 4,
-                "Quantity": 3,
+                "Quality": 3,
                 "Speed": 30,
                 "Damage": 2,
                 "Critical": 0.1,
@@ -356,7 +356,7 @@ export namespace RoleConf {
         "404": {
                 "Id": 404,
                 "Race": 4,
-                "Quantity": 4,
+                "Quality": 4,
                 "Speed": 30,
                 "Damage": 2,
                 "Critical": 0.1,
@@ -373,7 +373,7 @@ export namespace RoleConf {
         "405": {
                 "Id": 405,
                 "Race": 4,
-                "Quantity": 5,
+                "Quality": 5,
                 "Speed": 30,
                 "Damage": 2,
                 "Critical": 0.1,
@@ -390,7 +390,7 @@ export namespace RoleConf {
         "406": {
                 "Id": 406,
                 "Race": 4,
-                "Quantity": 6,
+                "Quality": 6,
                 "Speed": 30,
                 "Damage": 2,
                 "Critical": 0.1,

File diff suppressed because it is too large
+ 179 - 165
assets/sub_bundle/hero/prefab/HeroFate.prefab


Some files were not shown because too many files changed in this diff