feat(fight): 重构技能和受击触发逻辑,统一命名规范

- 将 `OnHit`、`AfterHit` 等方法重命名为 `AfterSkill` 和 `Attacked`,统一触发时机命名
- 调整 `BeforeSkill` 与 `PreSkill` 的职责,明确技能前处理逻辑
- 修改 `UseSkill` 为 `CanSkill`,增强语义清晰度
- 补充精灵切换时的触发方法 `OnSwitchOut` 与 `OnOwnerSwitchIn`
- 修复战斗中属性拷贝逻辑及状态持续回合计算的安全检查
- 增加捕获精灵后的日志输出,便于调试追踪
- 完善默认伤害效果节点的初始化逻辑
This commit is contained in:
2025-09-25 13:07:56 +08:00
parent d9d47b8d21
commit 07c08b767b
18 changed files with 115 additions and 105 deletions

View File

@@ -58,7 +58,6 @@ type Pet struct {
type PetEX struct {
Pet
Data PetInfo `orm:"data" json:"data"`
}
type PetS struct {
@@ -96,8 +95,6 @@ func GenPetInfo(id int, dv, natureId, abilityTypeEnum, shinyid, level int) *PetI
if shinyid != -1 {
p.Shiny = uint32(shinyid)
} else {
}
if natureId != -1 {
p.Nature = uint32(natureId)

View File

@@ -13,6 +13,7 @@ func (s *UserService) Item(t func(map[uint32]model.SingleItemInfo) bool) {
err := m1.Scan(&player)
if err != nil {
player.PlayerID = uint64(s.userid)
player.Data = make(map[uint32]model.SingleItemInfo)
_, err := m1.Insert(player)
if err != nil {

View File

@@ -36,6 +36,7 @@ func (s *UserService) PetAdd(y model.PetInfo) {
m1 := cool.DBM(s.pet.Model).Where("player_id", s.userid)
var player model.PetEX
player.PlayerID = s.userid
player.Data = y
player.CatchTime = y.CatchTime
player.InBag = 0