コード例 #1
0
    public override void ExecuteUncatch(MinEventParams _params)
    {
        // Printer.Print("MinEventActionEject", _params.Self, _params.Other);
        if (CheckOthers && null == _params.Other)
        {
            return;                                       // bleeding would cause jumping infinitely
        }
        EntityMover mover;
        Vector3     dir;

        if (null != this.targets)
        {
            // Printer.Print("MinEventActionEject has targets", targets.Count);
            mover = new EntityMover((int)dsi[0], dsi[1], (int)dsi[2]);
            foreach (EntityAlive ent in this.targets)
            {
                dir = strength * Vectors.Float.Randomize(Zombiome.rand, dirrandom, Vectors.Float.UnitY);
                if (ent != null)
                {
                    mover.Apply(ent, dir);
                }
            }
            return;
        }
        mover = new EntityMover((int)dsi[0], dsi[1], (int)dsi[2]);
        dir   = strength * Vectors.Float.Randomize(Zombiome.rand, dirrandom, Vectors.Float.UnitY);
        if (_params.Self != null)
        {
            mover.Apply(_params.Self, dir);
        }
    }
コード例 #2
0
        public override IEnumerator Apply(EntityPlayer player, EntityAlive target, OptionEffect opt)
        {
            Zombiome.Routines.Start(Particles._Next(player), "Jumping-Particles");
            // EntityMover mover = new EntityMover(2, 0.2f, 1); // randomize
            SdtdUtils.EffectsItem.SpawnParticle(target.GetPosition(), "treeGib_birch_small", biome.groundColor);
            int         len   = 5 + (int)(this.rand.RandomFloat * 5);
            EntityMover mover = new EntityMover(len, 0.5f, 1); // tres bien : petit saut

            mover.Apply(target, Vectors.Float.UnitY);
            yield break;
        }
コード例 #3
0
    public override void Execute(List <string> _params, CommandSenderInfo _senderInfo)
    {
        /*
         * Direction not perfect, always moving up, jumping diagonally (issue of not waiting callback ?)
         *
         */
        Entity target = GameManager.Instance.World.GetLocalPlayers()[0];

        if (_params.Count > 0 && _params[0] == "sg")
        {
            Vector3  pos  = target.GetPosition();
            Vector3i ipos = Vectors.ToInt(pos);
            Printer.Print("pos: ", pos, "=>", ipos, "=>", Vectors.ToFloat(ipos));
            Printer.Print("pos: ", ipos, "=>", Vectors.ToFloat(ipos), "=>", Vectors.ToInt(Vectors.ToFloat(ipos)));
            target.SetPosition(pos); // _MoveSetPos only
            return;
            // also check conversion in Emplacement
        }


        int     check = 0;
        int     eid   = -1;
        Vector3 dir   = Vectors.Float.UnitY;

        if (_params.Count > 0)
        {
            eid = int.Parse(_params[0]);
        }
        if (_params.Count > 1)
        {
            check = int.Parse(_params[1]);
        }
        if (_params.Count > 2)
        {
            dir = StringParsers.ParseVector3(_params[2]);
        }

        if (eid > 0)
        {
            target = GameManager.Instance.World.GetEntity(eid);
        }
        if (target == null)
        {
            Printer.Print("Entity not there ", eid); return;
        }

        Printer.Print("ConsoleCmdEMover", eid, check, dir);
        EntityMover mover = new EntityMover(3, 0.2f); // .Config(1);

        mover.checkCollision = check == 1;
        mover.Apply(target, dir); // This is a routine... so check not executed ...
    }