diff --git a/modules/battle/fight/attribute/attributenumeric.go b/modules/battle/fight/attribute/attributenumeric.go new file mode 100644 index 000000000..5d6b66e71 --- /dev/null +++ b/modules/battle/fight/attribute/attributenumeric.go @@ -0,0 +1,4 @@ +package attribute + +type AttributeNumeric struct { +} diff --git a/modules/battle/fight/attribute/fixedpoint.go b/modules/battle/fight/attribute/fixedpoint.go new file mode 100644 index 000000000..0fc766fbd --- /dev/null +++ b/modules/battle/fight/attribute/fixedpoint.go @@ -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 +} diff --git a/modules/battle/fight/component/fightroledata.go b/modules/battle/fight/component/fightroledata.go index 3dc526e93..548df961a 100644 --- a/modules/battle/fight/component/fightroledata.go +++ b/modules/battle/fight/component/fightroledata.go @@ -1,6 +1,11 @@ package component +import ( + "go_dreamfactory/modules/battle/fight/attribute" +) + type FightRoleData struct { + //基础属性--------------------------------------------------------------------------------------------------------------------------- /// /// 角色名 /// @@ -37,4 +42,64 @@ type FightRoleData struct { /// 英雄ID /// HeroID string + + //战斗属性--------------------------------------------------------------------------------------------------------------------------- + /// + /// 行动值 + /// + Operate attribute.AttributeNumeric + /// + /// 最大生命 + /// + MaxHp attribute.AttributeNumeric + + /// + /// 当前生命 + /// + Hp attribute.AttributeNumeric + + /// + /// 攻击 + /// + Atk attribute.AttributeNumeric + + /// + /// 防御 + /// + Def attribute.AttributeNumeric + + /// + /// 速度 + /// + Speed attribute.AttributeNumeric + + /// + /// 暴击率 + /// + Critical attribute.AttributeNumeric + + /// + /// 暴击伤害 + /// + CriticalPower attribute.AttributeNumeric + + /// + /// 效果命中 + /// + EffectHit attribute.AttributeNumeric + + /// + /// 效果抵抗 + /// + EfectResist attribute.AttributeNumeric + + /// + /// 失手率 + /// + LostHold attribute.AttributeNumeric + + /// + /// 会心率 + /// + UnderStand attribute.AttributeNumeric } diff --git a/modules/battle/modelBattle.go b/modules/battle/modelBattle.go index 9f9ce696f..f18d9fe76 100644 --- a/modules/battle/modelBattle.go +++ b/modules/battle/modelBattle.go @@ -135,6 +135,8 @@ func (this *modelBattleComp) createpve(session comm.IUserSession, conn *db.DBCon } } } + //临时处理 单波怪物 + break } } }