diff --git a/logic/service/fight/boss/NewSeIdx_6.go b/logic/service/fight/boss/NewSeIdx_6.go index c345a5233..d7130a2e2 100644 --- a/logic/service/fight/boss/NewSeIdx_6.go +++ b/logic/service/fight/boss/NewSeIdx_6.go @@ -1,18 +1,17 @@ package effect import ( - element "blazing/common/data/Element" "blazing/logic/service/fight/info" "blazing/logic/service/fight/input" ) -// 6. 受到`普通属性'(128)伤害时以n%的概率使对方进入`异常状态'(仅一个异常状态)(a1: 异常状态类型, a2: 百分比) -// TODO: 实现受到`普通属性'(128)伤害时以n%的概率使对方进入`异常状态'(仅一个异常状态)(a1: 异常状态类型, a2: 百分比)的核心逻辑 +// 6. 受到`物理攻击'(128)伤害时以n%的概率使对方进入`异常状态'(仅一个异常状态)(a1: 异常状态类型, a2: 百分比) +// TODO: 实现受到`物理攻击'(128)伤害时以n%的概率使对方进入`异常状态'(仅一个异常状态)(a1: 异常状态类型, a2: 百分比)的核心逻辑 type NewSel6 struct { NewSel0 } -func (e *NewSel6) Damage_Lock_ex(t *info.DamageZone) bool { +func (e *NewSel6) Action_end_ex() bool { //魂印特性有不在场的情况,绑定时候将精灵和特性绑定 if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { return true @@ -20,7 +19,7 @@ func (e *NewSel6) Damage_Lock_ex(t *info.DamageZone) bool { if e.Ctx().SkillEntity == nil { return true } - if e.Ctx().SkillEntity.Type != int(element.ElementTypeNormal) { + if e.Ctx().SkillEntity.Category() != info.Category.PHYSICAL { return true } diff --git a/modules/blazing/model/PetFusion.go b/modules/blazing/model/PetFusion.go new file mode 100644 index 000000000..d74c1a03c --- /dev/null +++ b/modules/blazing/model/PetFusion.go @@ -0,0 +1,57 @@ +package model + +import ( + "blazing/cool" +) + +const ( + TableNamePetFusion = "pet_fusion" // 宠物融合配方表(主宠-副宠-材料-概率-融合结果) +) + +// PetFusion 宠物融合配方模型(对应尼尔+闪皮+材料1-4=卡鲁/闪尼等融合规则) +type PetFusion struct { + *cool.Model // 嵌入通用Model(包含ID/创建时间/更新时间等通用字段) + + MainPetID int32 `gorm:"not null;comment:'主宠物ID(如:尼尔)'" json:"main_pet_id"` + SubPetID int32 `gorm:"not null;comment:'副宠物ID(如:闪皮)'" json:"sub_pet_id"` + // Material1 int32 `gorm:"not null;default:0;comment:'融合材料1ID(无则填0)'" json:"material1"` + // Material2 int32 `gorm:"not null;default:0;comment:'融合材料2ID(无则填0)'" json:"material2"` + // Material3 int32 `gorm:"not null;default:0;comment:'融合材料3ID(无则填0)'" json:"material3"` + // Material4 int32 `gorm:"not null;default:0;comment:'融合材料4ID(无则填0)'" json:"material4"` + Probability float32 `gorm:"not null;comment:'融合成功率(百分比,如80代表80%)'" json:"probability"` + ResultPetID int32 `gorm:"not null;comment:'融合结果宠物ID(如:卡鲁、闪尼)'" json:"result_pet_id"` + Remark string `gorm:"type:varchar(255);default:'';comment:'融合配方备注(如:尼尔+闪皮=闪尼)'" json:"remark"` + IsEnable int32 `gorm:"not null;default:1;comment:'是否启用(1:启用,0:禁用)'" json:"is_enable"` + // 新增:是否默认配方(核心逻辑:所有匹配配方都不满足时,随机选择默认配方) + IsDefault int32 `gorm:"not null;default:0;comment:'是否默认配方(1:默认配方,0:非默认;所有配方不匹配时随机选默认配方)'" json:"is_default"` +} + +// PetFusionEX 宠物融合配方扩展模型(如需前端展示多维度数据时使用,如ID转名称等) +type PetFusionEX struct { + PetFusion + MainPetName string `json:"main_pet_name"` // 主宠名称(前端展示用) + SubPetName string `json:"sub_pet_name"` // 副宠名称(前端展示用) + ResultPetName string `json:"result_pet_name"` // 结果宠名称(前端展示用) +} + +// TableName 指定PetFusion对应的数据库表名 +func (*PetFusion) TableName() string { + return TableNamePetFusion +} + +// GroupName 指定表所属的分组(保持和MonsterRefresh一致) +func (*PetFusion) GroupName() string { + return "default" +} + +// NewPetFusion 创建一个新的PetFusion实例(初始化通用Model) +func NewPetFusion() *PetFusion { + return &PetFusion{ + Model: cool.NewModel(), + } +} + +// init 初始化表结构(程序启动时自动创建/同步表) +func init() { + cool.CreateTable(&PetFusion{}) +} diff --git a/public/binaryData/64_com.robot.core.config.xml.PetEffectXMLInfo_xmlClass_com.robot.core.config.xml.PetEffectXMLInfo_xmlClass.bin b/public/binaryData/64_com.robot.core.config.xml.PetEffectXMLInfo_xmlClass_com.robot.core.config.xml.PetEffectXMLInfo_xmlClass.bin index 6663d31ba..97d65e2d8 100644 --- a/public/binaryData/64_com.robot.core.config.xml.PetEffectXMLInfo_xmlClass_com.robot.core.config.xml.PetEffectXMLInfo_xmlClass.bin +++ b/public/binaryData/64_com.robot.core.config.xml.PetEffectXMLInfo_xmlClass_com.robot.core.config.xml.PetEffectXMLInfo_xmlClass.bin @@ -296,7 +296,8 @@ @@ -312,466 +313,946 @@ - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - + + + + - - - - - + + + + + - - - + + + - - + + - -    -    -    -    - - -    -    -    -    -    - +           +       +                     + - - - - - - - + + + + + + + - + \ No newline at end of file