```
feat(boss): 更新NewSeIdx_6.go中技能触发条件判断逻辑 将原本基于元素类型的判断改为基于技能分类的判断, 并修改了函数名Damage_Lock_ex为Action_end_ex以更准确反映其用途。 注释中也将“普通属性”修正为“物理攻击”,使描述更加清晰明确。 ```
This commit is contained in:
@@ -1,18 +1,17 @@
|
|||||||
package effect
|
package effect
|
||||||
|
|
||||||
import (
|
import (
|
||||||
element "blazing/common/data/Element"
|
|
||||||
"blazing/logic/service/fight/info"
|
"blazing/logic/service/fight/info"
|
||||||
"blazing/logic/service/fight/input"
|
"blazing/logic/service/fight/input"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 6. 受到`普通属性'(128)伤害时以n%的概率使对方进入`异常状态'(仅一个异常状态)(a1: 异常状态类型, a2: 百分比)
|
// 6. 受到`物理攻击'(128)伤害时以n%的概率使对方进入`异常状态'(仅一个异常状态)(a1: 异常状态类型, a2: 百分比)
|
||||||
// TODO: 实现受到`普通属性'(128)伤害时以n%的概率使对方进入`异常状态'(仅一个异常状态)(a1: 异常状态类型, a2: 百分比)的核心逻辑
|
// TODO: 实现受到`物理攻击'(128)伤害时以n%的概率使对方进入`异常状态'(仅一个异常状态)(a1: 异常状态类型, a2: 百分比)的核心逻辑
|
||||||
type NewSel6 struct {
|
type NewSel6 struct {
|
||||||
NewSel0
|
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 {
|
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
|
||||||
return true
|
return true
|
||||||
@@ -20,7 +19,7 @@ func (e *NewSel6) Damage_Lock_ex(t *info.DamageZone) bool {
|
|||||||
if e.Ctx().SkillEntity == nil {
|
if e.Ctx().SkillEntity == nil {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if e.Ctx().SkillEntity.Type != int(element.ElementTypeNormal) {
|
if e.Ctx().SkillEntity.Category() != info.Category.PHYSICAL {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
57
modules/blazing/model/PetFusion.go
Normal file
57
modules/blazing/model/PetFusion.go
Normal file
@@ -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{})
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user