public IEnumerator SpawnBlock(EntityAlive ctrl, Vector3 pos)
    {
        Printer.Log(30, "MinEventActionImpactSpawn", ctrl, pos, ctrl.GetPosition());
        yield return(new WaitForSeconds((float)this.dt / 1000f));

        BlockSetter.Options opt = new BlockSetter.Options();
        opt.avoidBlock  = false;
        opt.avoidEntity = false;
        opt.elastic     = 0;
        opt.SetBlocks(this.block);

        BlockSetter setter = new BlockSetter(opt);

        setter.OnCreation = BlockSetter.Rotate;
        Vector3i ipos = Vectors.ToInt(pos);
        Vector3i surf = Geo3D.Surface(ipos, ipos.y) + Vectors.Up;

        // setter.Apply(ipos); // is it pos +1 ? do we need surface ?
        setter.Apply(surf);
        setter.Push();
    }
Beispiel #2
0
 public static void Physics(string seed, BiomeDefinition biome, BlockSetter.Options OptionBlock)
 {
     OptionBlock.avoidEntity = Hashes.Rand(0.5f, seed, "avoidEntity") ? true : false;
     OptionBlock.avoidBlock  = Hashes.Rand(0.5f, seed, "avoidBlock") ? true : false;
     OptionBlock.elastic     = Hashes.Rand(0.5f, seed, "elastic") ? 10 : 0;
 }