protected virtual void OnUpdatePiranhas(float dtime) { piranhas.Translation = new Vector3(Translation.X, Translation.Y, 0); drowningAcc -= dtime; if (drowningAcc <= 0) { drowningAcc = 0.4f; Effects.WaterSplash ws = new Client.Game.Map.Effects.WaterSplash { Translation = piranhas.Translation }; Scene.Add(ws); Hit(null, 160, AttackType.Ethereal, new PirahnaHit()); } }
protected virtual void OnTakesFootstep() { if (IsInWater) { var pos = new Vector3(Translation.X, Translation.Y, Game.Instance.Map.Settings.WaterHeight); Vector3 off; rippleI++; var rotMat = Matrix.RotationQuaternion(Quaternion.RotationAxis(Vector3.UnitZ, Orientation)); #if DEBUG if (rotMat.M11 == float.NaN || rotMat.M21 == float.NaN || rotMat.M22 == float.NaN) { throw new Exception("Matrix values must not be NaN"); } #endif if (rippleI % 2 == 0) { off = Vector3.TransformNormal(Vector3.UnitY * FeetWidth, rotMat); } else { off = Vector3.TransformNormal(-Vector3.UnitY * FeetWidth, rotMat); } #if DEBUG if (rotMat.M11 == float.NaN || rotMat.M21 == float.NaN || off.X == float.NaN || rotMat.M22 == float.NaN) { throw new Exception("Matrix or off values must not be NaN"); } #endif Scene.Add(new Effects.WaterRipplesEffect { Translation = pos + off }); float o = 0.5f; if (RunningBackwards) { o = -o; } off = Vector3.TransformNormal(Vector3.UnitX * o, Matrix.RotationZ(Orientation)); Effects.WaterSplash ws = new Client.Game.Map.Effects.WaterSplash { Translation = pos + off }; Scene.Add(ws); } }
protected virtual void OnTakesFootstep() { if (IsInWater) { var pos = new Vector3(Translation.X, Translation.Y, Game.Instance.Map.Settings.WaterHeight); Vector3 off; rippleI++; var rotMat = Matrix.RotationQuaternion(Quaternion.RotationAxis(Vector3.UnitZ, Orientation)); #if DEBUG if (rotMat.M11 == float.NaN || rotMat.M21 == float.NaN || rotMat.M22 == float.NaN) throw new Exception("Matrix values must not be NaN"); #endif if (rippleI % 2 == 0) off = Vector3.TransformNormal(Vector3.UnitY * FeetWidth, rotMat); else off = Vector3.TransformNormal(-Vector3.UnitY * FeetWidth, rotMat); #if DEBUG if (rotMat.M11 == float.NaN || rotMat.M21 == float.NaN || off.X == float.NaN || rotMat.M22 == float.NaN) throw new Exception("Matrix or off values must not be NaN"); #endif Scene.Add(new Effects.WaterRipplesEffect { Translation = pos + off }); float o = 0.5f; if (RunningBackwards) o = -o; off = Vector3.TransformNormal(Vector3.UnitX * o, Matrix.RotationZ(Orientation)); Effects.WaterSplash ws = new Client.Game.Map.Effects.WaterSplash { Translation = pos + off }; Scene.Add(ws); } }
protected virtual void OnUpdatePiranhas(float dtime) { piranhas.Translation = new Vector3(Translation.X, Translation.Y, 0); drowningAcc -= dtime; if (drowningAcc <= 0) { drowningAcc = 0.4f; Effects.WaterSplash ws = new Client.Game.Map.Effects.WaterSplash { Translation = piranhas.Translation }; Scene.Add(ws); Hit(null, 160, AttackType.Ethereal, new PirahnaHit()); } }