fCraft.DevCommands.SpellHandler C# (CSharp) Method

SpellHandler() static private method

static private SpellHandler ( Player player, Command cmd ) : void
player Player
cmd Command
return void
        internal static void SpellHandler( Player player, Command cmd )
        {
            World world = player.World;
            Vector3I pos1 = player.Position.ToBlockCoords();
            Random _r = new Random();
            int n = _r.Next( 8, 12 );
            for ( int i = 0; i < n; ++i ) {
                double phi = -_r.NextDouble() + -player.Position.L * 2 * Math.PI;
                double ksi = -_r.NextDouble() + player.Position.R * Math.PI - Math.PI / 2.0;

                Vector3F direction = ( new Vector3F( ( float )( Math.Cos( phi ) * Math.Cos( ksi ) ), ( float )( Math.Sin( phi ) * Math.Cos( ksi ) ), ( float )Math.Sin( ksi ) ) ).Normalize();
                world.AddPhysicsTask( new Particle( world, ( pos1 + 2 * direction ).Round(), direction, player, Block.Obsidian, particleBehavior ), 0 );
            }
        }