示例#1
0
        public override void OnUpdate()
        {
            Pointer <BulletClass> pBullet = Owner.OwnerObject;
            BulletTypeExt         extType = Owner.Type;

            CoordStruct nextLocation = pBullet.Ref.Base.Base.GetCoords();

            nextLocation.Z += 0;
            if (lastLocation == default(CoordStruct))
            {
                lastLocation = nextLocation;
            }
            if (lastLocation.DistanceFrom(nextLocation) > 50)
            {
                Pointer <LaserDrawClass> pLaser = YRMemory.Create <LaserDrawClass>(lastLocation, nextLocation, innerColor, outerColor, outerSpread, 50);
                pLaser.Ref.Thickness    = 6;
                pLaser.Ref.IsHouseColor = true;
                //Logger.Log("laser [({0}, {1}, {2}) -> ({3}, {4}, {5})]", lastLocation.X, lastLocation.Y, lastLocation.Z, nextLocation.X, nextLocation.Y, nextLocation.Z);

                lastLocation = nextLocation;
            }

            const int radius = 100;

            pBullet.Ref.Base.Location +=
                new CoordStruct((int)(Math.Cos(angle * Math.PI / 180) * radius), (int)(Math.Sin(angle * Math.PI / 180) * radius), 100)
                * (pBullet.Ref.Velocity.Z > -20 ? 1 : -1);
            angle = (angle + 25) % 360;
        }
        public override void OnUpdate()
        {
            Pointer <BulletClass> pBullet = Owner.OwnerObject;
            BulletTypeExt         extType = Owner.Type;

            CoordStruct location = pBullet.Ref.Base.Base.GetCoords();

            location += new CoordStruct(random.Next(100, 500), random.Next(100, 500), random.Next(100, 500));

            Pointer <AnimClass> pLaser = YRMemory.Create <AnimClass>(pAnimType, location);

            pBullet.Ref.Velocity.Z = 70 * factor;
            factor = factor - 0.02;
        }
示例#3
0
        private void KillUpdate()
        {
            if (Target.TryGet(out TechnoExt ext))
            {
                Pointer <TechnoClass> pTechno = ext.OwnerObject;
                TechnoTypeExt         extType = ext.Type;

                CoordStruct curLocation = pTechno.Ref.Base.Base.GetCoords();

                int height = pTechno.Ref.Base.GetHeight();

                Action <int, int> Attack = (int start, int count) => {
                    int         increasement = 360 / count;
                    CoordStruct from         = curLocation;
                    from.Z += 5000;
                    for (int i = 0; i < count; i++)
                    {
                        double      x  = radius * Math.Cos((start + i * increasement) * Math.PI / 180);
                        double      y  = radius * Math.Sin((start + i * increasement) * Math.PI / 180);
                        CoordStruct to = curLocation + new CoordStruct((int)x, (int)y, -height);
                        Pointer <LaserDrawClass> pLaser = YRMemory.Create <LaserDrawClass>(from, to, innerColor, outerColor, outerSpread, 8);
                        pLaser.Ref.Thickness    = 10;
                        pLaser.Ref.IsHouseColor = true;

                        if (frames > 300)
                        {
                            int damage = 11;
                            // MapClass.DamageArea(to, damage, Owner.OwnerObject, pWH, false, Owner.OwnerObject.Ref.Owner);
                            // MapClass.FlashbangWarheadAt(damage, pWH, to);
                            Pointer <BulletClass> pBullet = pBulletType.Ref.CreateBullet(pTechno.Convert <AbstractClass>(), Owner.OwnerObject, damage, pWH, 100, true);
                            pBullet.Ref.Detonate(to);
                        }
                        else
                        {
                            frames++;
                        }
                    }
                };

                Attack(angle, 5);
                angle   = (angle + 4) % 360;
                radius -= 11;
                if (radius < 0)
                {
                    KillStart(ext);
                }
            }
        }
示例#4
0
        public override void OnUpdate()
        {
            Pointer <TechnoClass> pTechno = Owner.OwnerObject;
            TechnoTypeExt         extType = Owner.Type;

            CoordStruct nextLocation = pTechno.Ref.Base.Base.GetCoords();

            nextLocation.Z += 50;
            if (lastLocation.DistanceFrom(nextLocation) > 100)
            {
                Pointer <LaserDrawClass> pLaser = YRMemory.Create <LaserDrawClass>(lastLocation, nextLocation, innerColor, outerColor, outerSpread, 30);
                pLaser.Ref.Thickness    = 10;
                pLaser.Ref.IsHouseColor = true;
                //Logger.Log("laser [({0}, {1}, {2}) -> ({3}, {4}, {5})]", lastLocation.X, lastLocation.Y, lastLocation.Z, nextLocation.X, nextLocation.Y, nextLocation.Z);

                lastLocation = nextLocation;
            }
        }