Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
2c8958d667
4
modules/battle/fight/attribute/attributenumeric.go
Normal file
4
modules/battle/fight/attribute/attributenumeric.go
Normal file
@ -0,0 +1,4 @@
|
||||
package attribute
|
||||
|
||||
type AttributeNumeric struct {
|
||||
}
|
24
modules/battle/fight/attribute/fixedpoint.go
Normal file
24
modules/battle/fight/attribute/fixedpoint.go
Normal 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
|
||||
}
|
@ -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
|
||||
}
|
||||
|
@ -135,6 +135,8 @@ func (this *modelBattleComp) createpve(session comm.IUserSession, conn *db.DBCon
|
||||
}
|
||||
}
|
||||
}
|
||||
//临时处理 单波怪物
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user