| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- // Code generated by excel export. DO NOT EDIT.
- package data
- import (
- "f1-game/internal/types"
- )
- var Monster = &monsterConfig{}
- func init() {
- _allList = append(_allList, Monster)
- }
- type (
- MonsterRow struct {
- ID int32 `json:"ID"` // ID
- Level int32 `json:"Level"` // 等级
- Job int32 `json:"Job"` // 职业
- SkillLevels types.PairList[int32, int32] `json:"SkillLevels"` // 技能等级
- MinAttack int64 `json:"MinAttack"` // 最小攻击
- MaxAttack int64 `json:"MaxAttack"` // 最大攻击
- AttackSpeed int64 `json:"AttackSpeed"` // 攻击速度
- Speed int64 `json:"Speed"` // 移动速度
- MinDefense int64 `json:"MinDefense"` // 最小防御
- MaxDefense int64 `json:"MaxDefense"` // 最大防御
- Hp int64 `json:"Hp"` // 血量
- CriticalHitChance int64 `json:"CriticalHitChance"` // 暴击率
- CriticalHitResistance int64 `json:"CriticalHitResistance"` // 暴击抵抗
- CriticalHitDamage int64 `json:"CriticalHitDamage"` // 暴击伤害
- CriticalHitDamageResistance int64 `json:"CriticalHitDamageResistance"` // 暴伤抵抗
- Luck int64 `json:"Luck"` // 幸运值
- DamageBonus int64 `json:"DamageBonus"` // 伤害加成
- DamageReduction int64 `json:"DamageReduction"` // 伤害减免
- SquadAttackBonus int64 `json:"SquadAttackBonus"` // 兵团攻击加成
- SquadHealthBonus int64 `json:"SquadHealthBonus"` // 兵团生命加成
- }
- monsterConfig struct {
- baseConfig
- list []*MonsterRow // all list
- idUniMaps map[int32]*MonsterRow // key:id
- }
- )
- func (p *monsterConfig) Name() string {
- return "monster"
- }
- func (p *monsterConfig) Init() {
- p.idUniMaps = map[int32]*MonsterRow{}
- }
- func (p *monsterConfig) OnLoad(maps interface{}, reload bool) (int, error) {
- if reload && p.denyLoad {
- return 0, nil
- }
- var list []*MonsterRow
- if err := DecodeData(maps, &list); err != nil {
- return 0, err
- }
- p.list = list
- idUniMaps := map[int32]*MonsterRow{}
- for _, row := range list {
- idUniMaps[row.ID] = row
- }
- p.idUniMaps = idUniMaps
- return len(list), nil
- }
- // func (p *monsterConfig) OnAfterLoad(_ bool) {
- // }
- func (p *monsterConfig) List() []*MonsterRow {
- return p.list
- }
- func (p *monsterConfig) GetByID(id int32) (*MonsterRow, bool) {
- value, found := p.idUniMaps[id]
- return value, found
- }
- func (p *monsterConfig) ContainID(id int32) bool {
- _, found := p.idUniMaps[id]
- return found
- }
|