根据提供的code differences信息,由于没有具体的代码变更内容,我将生成一个通用的commit message模板:
``` docs(changelog): 更新版本更新日志 - 添加新功能说明 - 修复已知问题记录 - 更新相关文档内容 ```
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -21,7 +21,7 @@ func (h Controller) EggGamePlay(data1 *egg.C2S_EGG_GAME_PLAY, c *player.Player)
|
||||
data1.EggNum = 10
|
||||
}
|
||||
r := c.Service.Item.CheakItem(400501)
|
||||
if r < data1.EggNum {
|
||||
if r < uint32(data1.EggNum) {
|
||||
return nil, errorcode.ErrorCode(errorcode.ErrorCodes.ErrSystemError)
|
||||
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ func processMonID(bm string) string {
|
||||
// 返回: 战斗结果和错误码
|
||||
func (h Controller) PlayerFightBoss(data *fight.ChallengeBossInboundInfo, p *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
|
||||
if !p.CanFight() {
|
||||
return nil, errorcode.ErrorCodes.ErrSystemError
|
||||
return nil, errorcode.ErrorCodes.ErrPokemonNoStamina
|
||||
}
|
||||
var monster *model.PetInfo
|
||||
monsterInfo := &model.PlayerInfo{}
|
||||
@@ -137,7 +137,7 @@ func (h Controller) PlayerFightBoss(data *fight.ChallengeBossInboundInfo, p *pla
|
||||
fight.NewFight(p, ai, func(foi info.FightOverInfo) {
|
||||
if taskID != 0 {
|
||||
if foi.Reason == 0 && foi.WinnerId == p.Info.UserID {
|
||||
p.BossCompletedTask(taskID, 100)
|
||||
p.BossCompletedTask(taskID, 1)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ func (h Controller) PetTawor(data *fight.StartTwarInboundInfo, c *player.Player)
|
||||
if foi.Reason == 0 && foi.WinnerId == c.Info.UserID { //我放获胜
|
||||
switch data.Head.CMD {
|
||||
case 2429: //试炼之塔
|
||||
c.BossCompletedTask(600, int(c.Info.CurrentStage))
|
||||
c.BossCompletedTask(600, int(c.Info.CurrentFreshStage))
|
||||
c.Info.CurrentFreshStage++
|
||||
if c.Info.CurrentFreshStage >= c.Info.MaxFreshStage {
|
||||
c.Info.MaxFreshStage = c.Info.CurrentFreshStage
|
||||
@@ -201,7 +201,7 @@ func (h Controller) PetTawor(data *fight.StartTwarInboundInfo, c *player.Player)
|
||||
c.Info.MaxStage = c.Info.CurrentStage
|
||||
}
|
||||
case 2425:
|
||||
c.BossCompletedTask(110, int(c.Info.CurrentStage))
|
||||
c.BossCompletedTask(110, int(c.CurDark))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ func (h Controller) UsePetItemOutOfFight(data *item.C2S_USE_PET_ITEM_OUT_OF_FIGH
|
||||
return nil, errorcode.ErrorCodes.Err10401
|
||||
}
|
||||
|
||||
if c.Service.Item.CheakItem(data.ItemID) == 0 {
|
||||
if c.Service.Item.CheakItem(uint32(data.ItemID)) == 0 {
|
||||
return nil, errorcode.ErrorCodes.ErrSystemError
|
||||
}
|
||||
|
||||
@@ -57,13 +57,13 @@ func (h Controller) UsePetItemOutOfFight(data *item.C2S_USE_PET_ITEM_OUT_OF_FIGH
|
||||
if data.ItemID == ItemNeuronID {
|
||||
errcode = h.handleNeuronItem(currentPet, c)
|
||||
} else {
|
||||
errcode = h.handleRegularPetItem(data.ItemID, currentPet)
|
||||
errcode = h.handleRegularPetItem(uint32(data.ItemID), currentPet)
|
||||
}
|
||||
if errcode != 0 {
|
||||
return nil, errcode
|
||||
}
|
||||
|
||||
c.Service.Item.UPDATE(data.ItemID, -1)
|
||||
c.Service.Item.UPDATE(uint32(data.ItemID), -1)
|
||||
result = &item.S2C_USE_PET_ITEM_OUT_OF_FIGHT{}
|
||||
currentPet.CalculatePetPane(false)
|
||||
copier.Copy(&result, currentPet)
|
||||
|
||||
@@ -2,6 +2,7 @@ package controller
|
||||
|
||||
import (
|
||||
"blazing/common/socket/errorcode"
|
||||
"blazing/cool"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
@@ -19,7 +20,10 @@ func (h Controller) EnterMap(data *space.InInfo, c *player.Player) (result *info
|
||||
|
||||
c.Info.MapID = data.MapId //登录地图
|
||||
c.GetSpace().User.Store(c.Info.UserID, c) //添加玩家
|
||||
|
||||
if cool.Config.ServerInfo.IsDebug != 0 {
|
||||
println("进入地图", c.Info.UserID, c.Info.MapID)
|
||||
}
|
||||
result = info.NewOutInfo()
|
||||
c.Info.Pos = data.Point
|
||||
copier.CopyWithOption(result, c.Info, copier.Option{DeepCopy: true})
|
||||
|
||||
@@ -109,10 +109,10 @@ func (h Controller) PetFusion(data *pet.C2S_PetFusion, c *player.Player) (result
|
||||
|
||||
c.PetDel(data.Mcatchtime)
|
||||
_, ok2 := lo.Find(data.GoldItem1[:], func(item uint32) bool {
|
||||
return item == 300043
|
||||
return item == 300044
|
||||
})
|
||||
|
||||
if c.Service.Item.CheakItem(300043) > 0 && ok2 {
|
||||
if c.Service.Item.CheakItem(300044) > 0 && ok2 {
|
||||
c.Service.Item.UPDATE(300044, -1)
|
||||
} else {
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
// 对应原 C# 的 C2S_EGG_GAME_PLAY
|
||||
type C2S_EGG_GAME_PLAY struct {
|
||||
Head common.TomeeHeader `cmd:"3201" struc:"skip"`
|
||||
EggNum uint32 `json:"eggNum"` // 抽蛋次数标识:1 = 1次 2 = 5次 3 = 10次
|
||||
EggNum int32 `struc:"uint32"` // 抽蛋次数标识:1 = 1次 2 = 5次 3 = 10次
|
||||
// 注:Go 中 uint 是平台相关类型(32/64位),游戏开发中推荐用 uint32 明确匹配 C# 的 uint
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ func (f *FightC) UseSkill(c common.PlayerI, id uint32) {
|
||||
ret := &action.SelectSkillAction{
|
||||
BaseAction: action.NewBaseAction(c.GetInfo().UserID),
|
||||
}
|
||||
println("使用技能", c.GetInfo().UserID, id)
|
||||
|
||||
if f.GetInputByPlayer(c, false).CurrentPet == nil {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -22,12 +22,13 @@ type Effect6 struct {
|
||||
|
||||
// 我方使用效果
|
||||
func (e *Effect6) Skill_Useed() bool {
|
||||
|
||||
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
t := &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
//这个对面计算前是在他的回合,所以后手也能拿到伤害
|
||||
Damage: e.Ctx().Our.SumDamage.Div(alpacadecimal.NewFromInt(int64(e.SideEffectArgs[0]))),
|
||||
})
|
||||
}
|
||||
t.Damage = alpacadecimal.Min(t.Damage, e.Ctx().Our.CurrentPet.GetHP().Sub(alpacadecimal.NewFromInt(1)))
|
||||
e.Ctx().Our.Damage(e.Ctx().Our, t)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ type ContinuousDamage struct {
|
||||
// 技能命中前触发伤害(1/8最大生命值真实伤害)
|
||||
func (e *ContinuousDamage) ActionStart(attacker, defender *action.SelectSkillAction) bool {
|
||||
damage := e.calculateDamage()
|
||||
println(damage.IntPart(), "烧伤")
|
||||
|
||||
e.Ctx().Our.Damage(e.Input, &info.DamageZone{
|
||||
Type: info.DamageType.True,
|
||||
Damage: damage,
|
||||
|
||||
@@ -7,7 +7,6 @@ import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/modules/player/model"
|
||||
"fmt"
|
||||
"reflect"
|
||||
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
@@ -268,12 +267,12 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction)
|
||||
})
|
||||
}
|
||||
|
||||
fmt.Println(i,
|
||||
"技能名称:", attacker.CurrentPet.Info.Name,
|
||||
"玩家技能伤害:", attacker.SumDamage,
|
||||
"自身剩余血量:", attacker.CurrentPet.Info.Hp,
|
||||
"对手剩余血量:", defender.CurrentPet.Info.Hp,
|
||||
)
|
||||
// fmt.Println(i,
|
||||
// "技能名称:", attacker.CurrentPet.Info.Name,
|
||||
// "玩家技能伤害:", attacker.SumDamage,
|
||||
// "自身剩余血量:", attacker.CurrentPet.Info.Hp,
|
||||
// "对手剩余血量:", defender.CurrentPet.Info.Hp,
|
||||
// )
|
||||
if attacker.CurrentPet.Info.Hp <= 0 {
|
||||
attacker.CurrentPet.NotAlive = true
|
||||
f.Broadcast(func(ff *input.Input) {
|
||||
|
||||
@@ -192,7 +192,7 @@ func (our *Input) Damage(in *Input, sub *info.DamageZone) {
|
||||
}
|
||||
|
||||
func (our *Input) GetAction() {
|
||||
println("开始执行NPC动作")
|
||||
|
||||
next := our.Exec(func(t Effect) bool {
|
||||
|
||||
return t.HookAction()
|
||||
|
||||
@@ -2,6 +2,7 @@ package input
|
||||
|
||||
import (
|
||||
"blazing/common/data/xmlres"
|
||||
"blazing/cool"
|
||||
"fmt"
|
||||
|
||||
"blazing/logic/service/common"
|
||||
@@ -71,7 +72,9 @@ func (our *Input) SortPet() {
|
||||
t := Geteffect(EffectType.NewSel, e1.EID)
|
||||
if t != nil {
|
||||
ef := t.ID()
|
||||
if cool.Config.ServerInfo.IsDebug != 0 {
|
||||
fmt.Println("初始化特性", ef.Suffix())
|
||||
}
|
||||
|
||||
ef.SetCatchTime(s.Info.CatchTime)
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@ package input
|
||||
import (
|
||||
"blazing/common/utils"
|
||||
"blazing/logic/service/fight/info"
|
||||
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// 攻击,防御,特攻,特防,速度,命中
|
||||
@@ -27,20 +25,20 @@ func (target *Input) SetProp(source *Input, prop, level int8, opType info.EnumAb
|
||||
// 属性提升,上限为6
|
||||
newValue = utils.Min(target.AttackValue.Prop[p]+l, 6)
|
||||
if newValue > target.AttackValue.Prop[p] {
|
||||
fmt.Println("属性值会增加")
|
||||
//fmt.Println("属性值会增加")
|
||||
return true
|
||||
}
|
||||
fmt.Println("属性值不会增加")
|
||||
//fmt.Println("属性值不会增加")
|
||||
return false
|
||||
|
||||
case info.AbilityOpType.SUB:
|
||||
// 属性降低,下限为-6
|
||||
newValue = utils.Max(target.AttackValue.Prop[p]+l, -6)
|
||||
if newValue < target.AttackValue.Prop[p] {
|
||||
fmt.Println("属性值会减少")
|
||||
//fmt.Println("属性值会减少")
|
||||
return true
|
||||
}
|
||||
fmt.Println("属性值不会减少")
|
||||
//fmt.Println("属性值不会减少")
|
||||
return false
|
||||
|
||||
case info.AbilityOpType.RESET:
|
||||
|
||||
@@ -31,15 +31,13 @@ func (f *FightC) battleLoop() {
|
||||
for !f.closefight {
|
||||
|
||||
f.Round++
|
||||
//fmt.Printf("—— 第 %d 回合开始 ——\n", f.Round)
|
||||
// AI自动技能
|
||||
|
||||
actions := f.collectPlayerActions(ourID, oppID)
|
||||
if f.closefight {
|
||||
|
||||
break
|
||||
}
|
||||
println("进入回合", f.Round)
|
||||
|
||||
f.resolveRound(actions[ourID], actions[oppID])
|
||||
|
||||
}
|
||||
@@ -89,6 +87,7 @@ func (f *FightC) battleLoop() {
|
||||
defer f.Our.Player.(*player.Player).Service.Barge.Update(f.Opp.Player.GetInfo().PetList[0].ID, true)
|
||||
|
||||
}
|
||||
f.Our.Player.(*player.Player).GenMonster()
|
||||
}
|
||||
|
||||
//大乱斗,给个延迟
|
||||
@@ -109,8 +108,7 @@ func (f *FightC) battleLoop() {
|
||||
f.callback(f.FightOverInfo) //先执行回调,再执行返回信息,在回调内修改战斗判断
|
||||
|
||||
}
|
||||
// close(f.actionChan)
|
||||
fmt.Println(f.ownerID, "战斗循环结束")
|
||||
|
||||
close(f.over)
|
||||
|
||||
}
|
||||
@@ -191,8 +189,7 @@ func (f *FightC) collectPlayerActions(ourID, oppID uint32) map[uint32]action.Bat
|
||||
if f.Info.Status == info.BattleMode.FIGHT_WITH_NPC && pid == 0 {
|
||||
f.Switch = make(map[uint32]*action.ActiveSwitchAction)
|
||||
f.Our.Player.SendPackCmd(2407, &ret.Reason)
|
||||
// f.Opp.GetAction()
|
||||
println("开始执行NPC死切动作")
|
||||
|
||||
}
|
||||
continue
|
||||
}
|
||||
@@ -310,7 +307,7 @@ func (f *FightC) handleItemAction(a *action.UseItemAction) {
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
r := f.GetInputByAction(a, false).Player.(*player.Player).Service.Item.CheakItem(a.ItemID)
|
||||
r := f.GetInputByAction(a, false).Player.(*player.Player).Service.Item.CheakItem(uint32(a.ItemID))
|
||||
if r < 1 {
|
||||
return
|
||||
}
|
||||
@@ -400,7 +397,7 @@ func (f *FightC) handleSkillActions(a1, a2 action.BattleActionI) {
|
||||
}
|
||||
|
||||
f.enterturn(s1, s2)
|
||||
fmt.Println("玩家执行技能:", s1.PlayerID, s1.Info.ID, s2.PlayerID, s2.Info.ID)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
type C2S_USE_PET_ITEM_OUT_OF_FIGHT struct {
|
||||
Head common.TomeeHeader `cmd:"2326" struc:"skip"`
|
||||
CatchTime uint32 `json:"catch_time"` // 使用物品的精灵的捕获时间
|
||||
ItemID uint32 `json:"item_id"` // 使用的物品ID
|
||||
ItemID int32 `struc:"uint32"` // 使用的物品ID
|
||||
}
|
||||
|
||||
// S2C_USE_PET_ITEM_OUT_OF_FIGHT 服务端→客户端:非战斗场景使用宠物道具回包
|
||||
|
||||
@@ -31,7 +31,7 @@ func (p *Player) Next(time.Time) time.Time {
|
||||
}
|
||||
|
||||
// 应该根据怪物信息决定后端生成
|
||||
func (p *Player) genMonster() {
|
||||
func (p *Player) GenMonster() {
|
||||
if atomic.LoadUint32(&p.Canmon) == 0 { //已经进入地图或者没在战斗中,就可以刷新怪
|
||||
return
|
||||
}
|
||||
|
||||
@@ -18,18 +18,19 @@ func (p *Player) BossCompletedTask(taskID int, ot int) {
|
||||
}
|
||||
|
||||
p.Service.Task.Exec(uint32(taskID), func(te *model.TaskEX) bool {
|
||||
if te != nil {
|
||||
if te.Data == nil {
|
||||
te.Data = []uint32{}
|
||||
}
|
||||
|
||||
r := bitset32.From(te.Data)
|
||||
|
||||
if !r.Test(uint(ot)) {
|
||||
r.Set(uint(ot))
|
||||
p.bossgive(taskID, ot)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
te.Data = r.Bytes()
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ func NewPlayer(opts ...PlayerOption) *Player {
|
||||
|
||||
// 获取当前地图的怪物配置
|
||||
|
||||
p.genMonster() //生成野怪
|
||||
p.GenMonster() //生成野怪
|
||||
|
||||
})
|
||||
|
||||
|
||||
@@ -218,8 +218,10 @@ func (h *ClientData) OnEvent(v []byte) {
|
||||
return
|
||||
}
|
||||
}
|
||||
if cool.Config.ServerInfo.IsDebug != 0 {
|
||||
fmt.Println("接收数据", header.UserID, header.CMD)
|
||||
// cool.Loger.Debug(context.TODO(), "接收数据", header.UserID, header.CMD)
|
||||
}
|
||||
|
||||
h.Recv(header)
|
||||
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ func (o *OgrePetInfo) RandSHiny() {
|
||||
var co *data.GlowFilter
|
||||
if o.Ext == 0 {
|
||||
|
||||
co = config.NewShinyService().RandShiny(o.Id)
|
||||
co = config.NewShinyService().FixShiny(o.Id)
|
||||
}
|
||||
|
||||
if co != nil && len(o.ShinyInfo) == 0 {
|
||||
|
||||
@@ -29,6 +29,7 @@ type PetBaseConfig struct {
|
||||
Effect []uint32 `gorm:"type:jsonb;not null;default:'[]';comment:'BOSS特性'" json:"effect"`
|
||||
Lv int32 `gorm:"not null;comment:'BOSS等级(LvHpMatchUser非0时此配置无效)'" json:"lv"`
|
||||
Color string `gorm:"comment:'BOSS颜色'" json:"color"`
|
||||
Skin int32 `gorm:"not null;default:0;comment:'BOSS皮肤ID'" json:"skin"`
|
||||
Hp int32 `gorm:"not null;comment:'BOSS血量值(LvHpMatchUser非0时此配置无效)'" json:"hp"`
|
||||
|
||||
// ===================== BOSS属性(Boss_prop) =====================
|
||||
|
||||
@@ -23,6 +23,7 @@ type BaseTowerConfig struct {
|
||||
// 通用辅助字段(所有塔类型通用)
|
||||
IsEnabled uint32 `gorm:"not null;default:1;comment:'是否启用该层配置(0-禁用 1-启用)'" json:"is_enabled" description:"是否启用"`
|
||||
Remark string `gorm:"size:512;default:'';comment:'塔层备注'" json:"remark" description:"备注信息"`
|
||||
Name string `gorm:"size:32;default:'';comment:'塔层名称'" json:"name" description:"塔层名称"`
|
||||
// ItemGift []ItemGift `orm:"with:item_id=id"`
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ func (s *ItemService) GetItemCount(id uint32) data.ItemInfo {
|
||||
}
|
||||
return res
|
||||
}
|
||||
func (s *ItemService) GetEgg(count uint32) []data.ItemInfo {
|
||||
func (s *ItemService) GetEgg(count int32) []data.ItemInfo {
|
||||
var item []model.ItemGift
|
||||
cool.DBM(s.Model).Where("is_egg", 1).Where("is_enabled", 1).Cache(gdb.CacheOption{
|
||||
// Duration: time.Hour,
|
||||
|
||||
@@ -12,6 +12,7 @@ type Item struct {
|
||||
PlayerID uint64 `gorm:"not null;index:idx_player_bag_item_by_player_id;comment:'所属玩家ID'" json:"player_id"`
|
||||
// 物品Id,
|
||||
ItemId uint32 `json:"item_id"`
|
||||
BindPet uint32 `json:"bind_pet"` //绑定的精灵
|
||||
|
||||
// 物品数量,
|
||||
ItemCnt uint32 `json:"item_cnt"`
|
||||
|
||||
@@ -24,7 +24,7 @@ type Pet struct {
|
||||
Base
|
||||
PlayerID uint32 `gorm:"not null;index:idx_pet_by_player_id;comment:'所属玩家ID'" json:"player_id"`
|
||||
Free int `gorm:"not null;default:0;comment:'是否放生'" json:"free"` //"0为放入仓库,1为放入背包
|
||||
CatchTime uint32 `gorm:"not null;unique;comment:'捕捉时间'" json:"catch_time"` //唯一键
|
||||
CatchTime uint32 `gorm:"not null;comment:'捕捉时间'" json:"catch_time"` //唯一键
|
||||
// Owner uint32 `struc:"skip"` //仅作为存储
|
||||
// FreedTime uint32 `struc:"skip"` //放生时间
|
||||
//是否可交易,这里应该定义在精灵ID里
|
||||
|
||||
@@ -410,7 +410,7 @@ eg:
|
||||
</Boss>
|
||||
<!--bosses
|
||||
for task 98-->
|
||||
<Boss AppearTime="0 23" BossVisible="0">
|
||||
<Boss Id="1" AppearTime="0 23" BossVisible="0">
|
||||
<BossMon MonID="58" Hp="250" Lv="50" />
|
||||
</Boss>
|
||||
<Boss AppearTime="0 23" BossVisible="0" Name="">
|
||||
@@ -3781,6 +3781,9 @@ eg:
|
||||
</Map>
|
||||
|
||||
<Map ID="320" Name="千年前赫尔卡星" InitX="600" InitY="390">
|
||||
<Boss Id="0" TaskID="400" AppearTime="0 23" BossVisible="0" Name="古代巨型机器人">
|
||||
<BossMon MonID="5714" Hp="65000" Lv="115" NewSeIdxs="1 2 58 85 87 88 331 1882" />
|
||||
</Boss>
|
||||
</Map>
|
||||
|
||||
<Map ID="321" Name="宇宙遭遇战" InitX="320" InitY="395">
|
||||
|
||||
Reference in New Issue
Block a user