This commit is contained in:
meixiongfeng 2022-09-08 11:48:24 +08:00
commit 2c8958d667
4 changed files with 95 additions and 0 deletions

View File

@ -0,0 +1,4 @@
package attribute
type AttributeNumeric struct {
}

View File

@ -0,0 +1,24 @@
package attribute
import (
"math"
)
//基准倍数
const CARDINAL_NUMBER int = 10000
func NewFixedPoint(value float32) *FixedPoint {
return &FixedPoint{
rawValue: int(math.Round(float64(value * float32(CARDINAL_NUMBER)))),
}
}
type FixedPoint struct {
rawValue int
scalar float32
}
func (this *FixedPoint) Scalar() float32 {
return this.scalar * 0.0001
}

View File

@ -1,6 +1,11 @@
package component
import (
"go_dreamfactory/modules/battle/fight/attribute"
)
type FightRoleData struct {
//基础属性---------------------------------------------------------------------------------------------------------------------------
/// <summary>
/// 角色名
/// </summary>
@ -37,4 +42,64 @@ type FightRoleData struct {
/// 英雄ID
/// </summary>
HeroID string
//战斗属性---------------------------------------------------------------------------------------------------------------------------
/// <summary>
/// 行动值
/// </summary>
Operate attribute.AttributeNumeric
/// <summary>
/// 最大生命
/// </summary>
MaxHp attribute.AttributeNumeric
/// <summary>
/// 当前生命
/// </summary>
Hp attribute.AttributeNumeric
/// <summary>
/// 攻击
/// </summary>
Atk attribute.AttributeNumeric
/// <summary>
/// 防御
/// </summary>
Def attribute.AttributeNumeric
/// <summary>
/// 速度
/// </summary>
Speed attribute.AttributeNumeric
/// <summary>
/// 暴击率
/// </summary>
Critical attribute.AttributeNumeric
/// <summary>
/// 暴击伤害
/// </summary>
CriticalPower attribute.AttributeNumeric
/// <summary>
/// 效果命中
/// </summary>
EffectHit attribute.AttributeNumeric
/// <summary>
/// 效果抵抗
/// </summary>
EfectResist attribute.AttributeNumeric
/// <summary>
/// 失手率
/// </summary>
LostHold attribute.AttributeNumeric
/// <summary>
/// 会心率
/// </summary>
UnderStand attribute.AttributeNumeric
}

View File

@ -135,6 +135,8 @@ func (this *modelBattleComp) createpve(session comm.IUserSession, conn *db.DBCon
}
}
}
//临时处理 单波怪物
break
}
}
}