|
|
@@ -44,11 +44,23 @@ func newRoleCard(r *Role) *RoleCard {
|
|
|
func (this *RoleCard) Load(msg interface{}) bool {
|
|
|
proRole := msg.(*serverproto.Role)
|
|
|
if proRole.RoleCard != nil {
|
|
|
+ m := map[int32]int{
|
|
|
+ 22100: 1, 22101: 1, 22102: 1, 22103: 1, 22104: 1, 22105: 1, 22106: 1, 22107: 1, 22108: 1, 22109: 1, 22110: 1, 22111: 1,
|
|
|
+ 22200: 1, 22201: 1, 22202: 1, 22203: 1, 22204: 1, 22205: 1, 22206: 1, 22207: 1, 22208: 1, 22209: 1, 22210: 1, 22211: 1,
|
|
|
+ 22300: 1, 22301: 1, 22302: 1, 22303: 1, 22304: 1, 22305: 1, 22306: 1, 22307: 1, 22308: 1, 22309: 1, 22310: 1, 22311: 1,
|
|
|
+ 22400: 1, 22401: 1, 22402: 1, 22403: 1, 22404: 1, 22405: 1, 22406: 1, 22407: 1, 22408: 1, 22409: 1, 22410: 1, 22411: 1,
|
|
|
+ 22500: 1, 22501: 1, 22502: 1, 22503: 1, 22504: 1, 22505: 1, 22506: 1, 22507: 1, 22508: 1, 22509: 1, 22510: 1, 22511: 1,
|
|
|
+ }
|
|
|
for _, data := range proRole.RoleCard.CardList {
|
|
|
_, ok := serverproto.CardCfgLoader[data.ConfigId]
|
|
|
if !ok || data.Num <= 0 {
|
|
|
continue
|
|
|
}
|
|
|
+ //噩梦bug删除红卡
|
|
|
+ if _, ok2 := m[data.ConfigId]; ok2 {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+
|
|
|
this.cardList[data.ConfigId] = data
|
|
|
}
|
|
|
|
|
|
@@ -64,6 +76,7 @@ func (this *RoleCard) Load(msg interface{}) bool {
|
|
|
}
|
|
|
|
|
|
this.totalCardNumList = proRole.RoleCard.TotalCardNumList
|
|
|
+ this.SetDirty(true)
|
|
|
}
|
|
|
return true
|
|
|
}
|
|
|
@@ -140,7 +153,7 @@ func (this *RoleCard) cardChangNtf(cardList set.Interface, ignore bool) {
|
|
|
this.role.ReplayGate(ntfMsg, true)
|
|
|
}
|
|
|
|
|
|
-//判断对应卡槽是否解锁
|
|
|
+// 判断对应卡槽是否解锁
|
|
|
func (this *RoleCard) isCardSlotUnlock(slotIndex, cardSlotIndex int32) bool {
|
|
|
if slotIndex <= int32(len(this.cardSlotList)) && cardSlotIndex > 0 {
|
|
|
return this.cardSlotList[slotIndex-1]&(1<<uint32(cardSlotIndex-1)) > 0
|
|
|
@@ -221,7 +234,7 @@ func (this *RoleCard) ReduceCard(cardCfgId, reduceNum int32, notify bool) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-//装备对应槽位镶嵌卡片
|
|
|
+// 装备对应槽位镶嵌卡片
|
|
|
func (this *RoleCard) Mount(slotData *serverproto.SlotData, heroId, subSlotIndex, cardSlotIndex, cardCfgId int32, fightChange bool) serverproto.ErrorCode {
|
|
|
if subSlotIndex <= 0 || cardSlotIndex <= 0 {
|
|
|
return serverproto.ErrorCode_ERROR_CARD_SLOT_LOCK
|
|
|
@@ -684,7 +697,7 @@ func (this *RoleCard) GetCardNum(cardCfgId int32) int32 {
|
|
|
return card.Num
|
|
|
}
|
|
|
|
|
|
-//对槽位中的装备升级
|
|
|
+// 对槽位中的装备升级
|
|
|
func (this *RoleCard) SlotCardLevelUp(cardCfgId int32, changeList set.Interface) (bool, int32) {
|
|
|
// globalData, ok1 := serverproto.GlobalCfgLoader[int32(serverproto.GlobalType_Global_Card_Up_Grade_Resource)]
|
|
|
cfgData, ok2 := serverproto.CardCfgLoader[cardCfgId]
|
|
|
@@ -945,7 +958,7 @@ func (this *RoleCard) AddCardCollect(cardCfgId int32) serverproto.ErrorCode {
|
|
|
return serverproto.ErrorCode_ERROR_FAIL
|
|
|
}
|
|
|
|
|
|
-//key 卡片类型ID, value
|
|
|
+// key 卡片类型ID, value
|
|
|
func (this *RoleCard) CardCollectChangeNtf(cardData []*serverproto.KeyValueType) {
|
|
|
ntfMsg := &serverproto.SCCardCollectChangeNtf{}
|
|
|
for _, changedCard := range cardData {
|
|
|
@@ -973,7 +986,7 @@ func (this *RoleCard) CardCollectChangeNtf(cardData []*serverproto.KeyValueType)
|
|
|
this.role.ReplayGate(ntfMsg, true)
|
|
|
}
|
|
|
|
|
|
-///Task
|
|
|
+// /Task
|
|
|
func (this *RoleCard) GetQualityCardNum(quality int32) int32 {
|
|
|
var retNum int32 = 0
|
|
|
if quality <= 0 {
|
|
|
@@ -990,7 +1003,7 @@ func (this *RoleCard) GetQualityCardNum(quality int32) int32 {
|
|
|
return retNum
|
|
|
}
|
|
|
|
|
|
-//检查是否有过此类型卡片
|
|
|
+// 检查是否有过此类型卡片
|
|
|
func (this *RoleCard) CheckNewCard(cardId int32) bool {
|
|
|
cardCfg, ok := serverproto.CardCfgLoader[cardId]
|
|
|
if !ok {
|
|
|
@@ -1014,7 +1027,7 @@ func (this *RoleCard) CheckNewCard(cardId int32) bool {
|
|
|
return true
|
|
|
}
|
|
|
|
|
|
-//卡片祝福属性
|
|
|
+// 卡片祝福属性
|
|
|
func (this *RoleCard) GetCardSuitAttr(heroData *serverproto.HeroData, attrList map[serverproto.Attr]float32) {
|
|
|
type tmpLevelNumSt struct {
|
|
|
CardLevel int32
|
|
|
@@ -1129,7 +1142,6 @@ func (this *RoleCard) GetCardSuitAttr(heroData *serverproto.HeroData, attrList m
|
|
|
//}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
func (this *RoleCard) CardExchange(sourceCardId, targetCardId int32, ackMsg *serverproto.SCCardLevelExchangeAck) serverproto.ErrorCode {
|
|
|
if ackMsg == nil {
|
|
|
return serverproto.ErrorCode_ERROR_FAIL
|
|
|
@@ -1188,7 +1200,7 @@ func (this *RoleCard) CardExchange(sourceCardId, targetCardId int32, ackMsg *ser
|
|
|
}
|
|
|
|
|
|
//查看资源是否够
|
|
|
- var costItemList= map[int32]int32{}
|
|
|
+ var costItemList = map[int32]int32{}
|
|
|
if targetCfgData.CardLevel > sourceCfgData.CardLevel {
|
|
|
this.GetCardExchangeCost(sourceCfgData.CardLevel, targetCfgData.CardLevel, costItemList)
|
|
|
} else {
|
|
|
@@ -1222,12 +1234,12 @@ func (this *RoleCard) GetCardExchangeCost(smallLevel, bigLevel int32, costItemLi
|
|
|
}
|
|
|
|
|
|
for key, data := range model.GlobalCardLevelExchange {
|
|
|
- if key - 1 <= 0 {
|
|
|
+ if key-1 <= 0 {
|
|
|
//打个Error日志
|
|
|
continue
|
|
|
}
|
|
|
- if smallLevel <= key - 1 && bigLevel >= key {
|
|
|
+ if smallLevel <= key-1 && bigLevel >= key {
|
|
|
costItemList[data.Key] += data.Value
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
+}
|