mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-04 15:52:27 +08:00
溺水传送至安全位置初步
This commit is contained in:
@@ -81,7 +81,7 @@ func (p *Player) InitAll() {
|
||||
p.GameObjectGuidMap = make(map[uint64]GameObject)
|
||||
p.CoopApplyMap = make(map[uint32]int64)
|
||||
p.StaminaInfo = new(StaminaInfo)
|
||||
p.StaminaInfo.DrownBackPos = new(Vector)
|
||||
p.StaminaInfo.ActiveAvatarPos = new(Vector)
|
||||
p.VehicleInfo = new(VehicleInfo)
|
||||
p.VehicleInfo.LastCreateEntityIdMap = make(map[uint32]uint32)
|
||||
p.InitAllAvatar()
|
||||
|
||||
@@ -14,8 +14,8 @@ type StaminaInfo struct {
|
||||
LastSkillId uint32 // 最后释放的技能Id
|
||||
LastSkillTime int64 // 最后释放技能的时间
|
||||
LastSkillStartTime int64 // 最后执行开始技能耐力消耗的时间
|
||||
DrownBackTime int64 // 溺水返回安全点的时间
|
||||
DrownBackPos *Vector // 溺水返回的安全点坐标
|
||||
DrownBackDelay int64 // 溺水返回安全点延时
|
||||
ActiveAvatarPos *Vector // 当前角色位置
|
||||
}
|
||||
|
||||
// SetStaminaCost 设置动作需要消耗的耐力
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
package model
|
||||
|
||||
import "math"
|
||||
|
||||
type Vector struct {
|
||||
X float64 `bson:"x"`
|
||||
Y float64 `bson:"y"`
|
||||
Z float64 `bson:"z"`
|
||||
}
|
||||
|
||||
// Distance 两坐标之间的距离
|
||||
func (v *Vector) Distance(vector *Vector) float64 {
|
||||
return math.Sqrt(math.Pow(v.X-vector.X, 2) + math.Pow(v.Y-vector.Y, 2) + math.Pow(v.Z-vector.Z, 2))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user