diff --git a/.gitignore b/.gitignore index 74227d477..47c945834 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,4 @@ logic/logic1 public/logic-linux-amd64 public/login-linux-amd64 +public/login-login-linux-amd64 diff --git a/common/cool/coolconfig/config.go b/common/cool/coolconfig/config.go index 6a9fff820..ff37c43e3 100644 --- a/common/cool/coolconfig/config.go +++ b/common/cool/coolconfig/config.go @@ -31,8 +31,9 @@ type ServerList struct { //密码 Password string `gorm:"type:string;comment:'密码'" json:"password"` CanPort []uint32 `gorm:"type:jsonb;comment:'可连接端口'" json:"can_port"` - IsVip uint32 `gorm:"default:0;not null;comment:'是否为VIP服务器'" json:"is_vip"` - //isdebug + //是否测试服 + IsVip uint32 `gorm:"default:0;not null;comment:'是否为VIP服务器'" json:"is_vip"` + //isdebug 是否本地服 IsDebug uint8 `gorm:"default:0;comment:'是否为调试模式'" json:"is_debug"` //服务器异色概率设定ServerList ShinyRate uint8 `gorm:"default:0;comment:'异色概率'" json:"shiny_rate"` diff --git a/common/cool/gdb.go b/common/cool/gdb.go deleted file mode 100644 index 62ad38043..000000000 --- a/common/cool/gdb.go +++ /dev/null @@ -1,12 +0,0 @@ -package cool - -import ( - "github.com/gogf/gf/v2/frame/g" -) - -func SetTest(m g.Map) g.Map { - if Config.ServerInfo.IsVip != 0 { - m["is_vip"] = Config.ServerInfo.IsVip - } - return m -} diff --git a/logic/controller/item_buy.go b/logic/controller/item_buy.go index 75101471d..0be54ea45 100644 --- a/logic/controller/item_buy.go +++ b/logic/controller/item_buy.go @@ -6,8 +6,6 @@ import ( "blazing/logic/service/item" "blazing/logic/service/player" - - "github.com/gogf/gf/v2/util/gconv" ) // 防止封包通过领取来获取道具 @@ -92,34 +90,34 @@ func (h Controller) BuyMultipleItems(data *item.BuyMultiInboundInfo, player *pla // data: 包含金豆购买商品信息的输入数据 // player: 当前玩家对象 // 返回: 金豆购买结果和错误码 -func (h Controller) BuyGoldItem(data *item.C2S_GOLD_BUY_PRODUCT, player *player.Player) (result *item.S2C_GoldBuyProductInfo, err errorcode.ErrorCode) { - product, exists := xmlres.GoldProductMap[int(data.ProductID)] - if !exists { - return nil, errorcode.ErrorCodes.ErrSystemError - } +// func (h Controller) BuyGoldItem(data *item.C2S_GOLD_BUY_PRODUCT, player *player.Player) (result *item.S2C_GoldBuyProductInfo, err errorcode.ErrorCode) { +// product, exists := xmlres.GoldProductMap[int(data.ProductID)] +// if !exists { +// return nil, errorcode.ErrorCodes.ErrSystemError +// } - useGold := uint32(data.Count) * uint32(gconv.Float64(product.Price)*100) - if !player.UseGold(useGold) { - return &item.S2C_GoldBuyProductInfo{ - Gold: player.User.GetGold(uint(player.Info.UserID)), - PayGold: 0, - Reserved: 0, - }, errorcode.ErrorCodes.ErrXinDouInsufficient - } +// useGold := uint32(data.Count) * uint32(gconv.Float64(product.Price)*100) +// if !player.UseGold(useGold) { +// return &item.S2C_GoldBuyProductInfo{ +// Gold: player.User.GetGold(uint(player.Info.UserID)), +// PayGold: 0, +// Reserved: 0, +// }, errorcode.ErrorCodes.ErrXinDouInsufficient +// } - addSuccess := player.ItemAdd(uint32(gconv.Uint32(product.ItemID)), uint32(data.Count)) - if addSuccess { - player.User.UpdateGold(player.Info.UserID, -int64(useGold)) - return &item.S2C_GoldBuyProductInfo{ - Gold: player.User.GetGold(uint(player.Info.UserID)), - PayGold: useGold, - Reserved: 0, - }, 0 - } +// addSuccess := player.ItemAdd(uint32(gconv.Uint32(product.ItemID)), uint32(data.Count)) +// if addSuccess { +// player.User.UpdateGold(player.Info.UserID, -int64(useGold)) +// return &item.S2C_GoldBuyProductInfo{ +// Gold: player.User.GetGold(uint(player.Info.UserID)), +// PayGold: useGold, +// Reserved: 0, +// }, 0 +// } - return &item.S2C_GoldBuyProductInfo{ - Gold: player.User.GetGold(uint(player.Info.UserID)), - PayGold: 0, - Reserved: 0, - }, errorcode.ErrorCodes.ErrSystemError -} +// return &item.S2C_GoldBuyProductInfo{ +// Gold: player.User.GetGold(uint(player.Info.UserID)), +// PayGold: 0, +// Reserved: 0, +// }, errorcode.ErrorCodes.ErrSystemError +// } diff --git a/logic/server.go b/logic/server.go index 88a8a43ab..dd6b7989b 100644 --- a/logic/server.go +++ b/logic/server.go @@ -58,7 +58,7 @@ func Start() { serverID := cool.Config.GameOnlineID cool.Config.ServerInfo = config.NewServerService().GetServerID(serverID).ServerList - if cool.Config.ServerInfo.IsVip == 1 { + if cool.Config.ServerInfo.IsDebug == 1 { g.DB().SetDebug(true) } diff --git a/logic/service/fight/boss/NewSeIdx_112.go b/logic/service/fight/boss/NewSeIdx_112.go new file mode 100644 index 000000000..fa3d064a2 --- /dev/null +++ b/logic/service/fight/boss/NewSeIdx_112.go @@ -0,0 +1,39 @@ +package effect + +import ( + "blazing/logic/service/fight/info" + "blazing/logic/service/fight/input" +) + +// NewSel112 受到物理时使自身的一种 battle_lv 提升1个等级,可提升n次;(a1: which blv, a2: max_blv_up_times) +// TODO: 实现受到物理时使自身的一种 battle_lv 提升1个等级,可提升n次;(a1: which blv, a2: max_blv_up_times)的核心逻辑 +type NewSel112 struct { + NewSel0 + count int +} + +func (e *NewSel112) DamageDivEx(t *info.DamageZone) bool { + + // fmt.Println(e.ID().GetCatchTime(), e.Ctx().Our.CurrentPet.Info.CatchTime) + if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { + return true + } + // 2. 技能为空或非物理攻击,不触发 + skill := e.Ctx().SkillEntity + if skill == nil { + return true + } + if skill.Category() != info.Category.PHYSICAL { + return true + } + if e.count >= int(e.Args()[1].IntPart()) { + return true + } + + e.Ctx().Our.SetProp(e.Ctx().Our, int8(e.Args()[0].IntPart()), 1, info.AbilityOpType.ADD) + e.count++ + return true +} +func init() { + input.InitEffect(input.EffectType.NewSel, 112, &NewSel112{}) +} diff --git a/logic/service/fight/boss/NewSeIdx_113.go b/logic/service/fight/boss/NewSeIdx_113.go new file mode 100644 index 000000000..7c4186431 --- /dev/null +++ b/logic/service/fight/boss/NewSeIdx_113.go @@ -0,0 +1,15 @@ +package effect + +import ( + "blazing/logic/service/fight/input" +) + +// todo "只有当自己处于异常状态时才会受到伤害" +type NewSel113 struct { + NewSel0 + count int +} + +func init() { + input.InitEffect(input.EffectType.NewSel, 113, &NewSel113{}) +} diff --git a/modules/blazing/service/item.go b/modules/blazing/service/item.go index af2ff5b2b..02b53c1be 100644 --- a/modules/blazing/service/item.go +++ b/modules/blazing/service/item.go @@ -28,7 +28,7 @@ func (s *ItemService) UPDATE(id uint32, count int) { m := s.TestModel(s.Model) if t, _ := m.Where("item_id", id).Exist(); t { - _, err := m.Where("item_id", id).Increment("item_cnt", count) + _, err := s.TestModel(s.Model).Where("item_id", id).Increment("item_cnt", count) if err != nil { panic(err) } @@ -38,8 +38,8 @@ func (s *ItemService) UPDATE(id uint32, count int) { "player_id": s.userid, "item_id": id, "item_cnt": count, + "is_vip": cool.Config.ServerInfo.IsVip, } - data = cool.SetTest(data) m.Data(data).Insert() } diff --git a/modules/blazing/service/pet.go b/modules/blazing/service/pet.go index 6bd1fa285..5355d3bce 100644 --- a/modules/blazing/service/pet.go +++ b/modules/blazing/service/pet.go @@ -117,6 +117,7 @@ RETURNING max_ts; player.Data = *y player.CatchTime = y.CatchTime player.Free = 0 + player.IsVip = cool.Config.ServerInfo.IsVip _, err = m1.Insert(player) if err != nil { diff --git a/public/login-login-linux-amd64 b/public/login-login-linux-amd64 index 6d521297a..2dbedee43 100644 Binary files a/public/login-login-linux-amd64 and b/public/login-login-linux-amd64 differ