Exemple #1
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);
                }
            }
        }
Exemple #2
0
        public override void OnFire(Pointer <AbstractClass> pTarget, int weaponIndex)
        {
            TechnoTypeExt extType = Owner.Type;
            Pointer <SuperWeaponTypeClass> pSWType = extType.FireSuperWeapon;

            if (pSWType.IsNull == false)
            {
                Pointer <TechnoClass> pTechno = Owner.OwnerObject;
                Pointer <HouseClass>  pOwner  = pTechno.Ref.Owner;
                Pointer <SuperClass>  pSuper  = pOwner.Ref.FindSuperWeapon(pSWType);

                CellStruct targetCell = MapClass.Coord2Cell(pTarget.Ref.GetCoords());
                //Logger.Log("FireSuperWeapon({2}):0x({3:X}) -> ({0}, {1})", targetCell.X, targetCell.Y, pSWType.Ref.Base.GetID(), (int)pSuper);
                pSuper.Ref.IsCharged = 1;
                pSuper.Ref.Launch(targetCell, true);
                pSuper.Ref.IsCharged = 0;
            }
        }
Exemple #3
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;
            }
        }
 static public unsafe UInt32 TechnoTypeClass_Save_Suffix(REGISTERS *R)
 {
     return(TechnoTypeExt.TechnoTypeClass_Save_Suffix(R));
 }
 static public unsafe UInt32 TechnoTypeClass_LoadFromINI(REGISTERS *R)
 {
     return(TechnoTypeExt.TechnoTypeClass_LoadFromINI(R));
 }
 static public unsafe UInt32 TechnoTypeClass_DTOR(REGISTERS *R)
 {
     return(TechnoTypeExt.TechnoTypeClass_DTOR(R));
 }