예제 #1
0
        public override void DrawAt(Vector3 drawLoc, bool flip = false)
        {
            Skyfaller.DrawDropSpotShadow(drawLoc, base.Rotation, this.ShadowMaterial, this.def.skyfaller.shadowSize, this.ticksToImpact);
            drawLoc.z += (Mathf.Pow(2f * this.TimeInAnimation - 1f, 2f) * -1f + 1f) * (float)(this.ticksToImpactMax / 30);
            bool flag = this.skyfallerPawn != null;

            if (flag)
            {
                this.skyfallerPawn.RenderPawnAt(drawLoc);
            }
        }
예제 #2
0
        // Token: 0x06000028 RID: 40 RVA: 0x00002CB8 File Offset: 0x00000EB8
        public void DoJumpJet(Pawn Pilot, IntVec3 targCell)
        {
            this.JPRotatePilot(Pilot, targCell, out float angle);
            if (this.JPSkyFallType == null)
            {
                this.JPSkyFallType = "SFJetPack";
            }
            ThingDef JPSF = DefDatabase <ThingDef> .GetNamed(this.JPSkyFallType, false);

            if (JPSF == null)
            {
                JPSF = DefDatabase <ThingDef> .GetNamed("SFJetPack", true);

                this.JPSkyFallType = "SFJetPack";
            }
            float SFspeed = JPSF.skyfaller.speed;

            if (SFspeed <= 0f)
            {
                SFspeed = 1f;
            }
            float distance   = IntVec3Utility.DistanceTo(Pilot.Position, targCell);
            int   timeToLand = (int)(distance / SFspeed);

            angle += 270f;
            if (angle >= 360f)
            {
                angle -= 360f;
            }
            int fuelUsed;

            if (Settings.UseCarry)
            {
                fuelUsed = (int)Math.Floor((double)(distance * this.JPFuelRate / JPWeightUtility.JPCarryFactor(Pilot, this.def, this.JPFuelItem)));
            }
            else
            {
                fuelUsed = (int)Math.Floor((double)(distance * this.JPFuelRate));
            }
            this.JPFuelAmount -= fuelUsed;
            Skyfaller skyfaller = SkyfallerMaker.SpawnSkyfaller(JPSF, targCell, Pilot.Map);

            skyfaller.ticksToImpact = timeToLand;
            skyfaller.angle         = angle;
            this.JPPilotIsDrafted   = Pilot.Drafted;
            Pilot.DeSpawn(0);
            skyfaller.innerContainer.TryAdd(Pilot, false);
        }
예제 #3
0
        // Token: 0x06000EA8 RID: 3752 RVA: 0x0006C2D0 File Offset: 0x0006A6D0
        protected override bool TryExecuteWorker(IncidentParms parms)
        {
            Map map                = (Map)parms.target;
            int num                = 0;
            int countToSpawn       = this.CountToSpawn;
            List <TargetInfo> list = new List <TargetInfo>();
            float             shrapnelDirection = Rand.Range(0f, 360f);
            Faction           faction           = null;
            Building_HiveLike_CrashedShipPart building_CrashedShipPart = null;

            building_CrashedShipPart = (Building_HiveLike_CrashedShipPart)ThingMaker.MakeThing(this.def.shipPart, null);
            if (faction == null)
            {
                faction = building_CrashedShipPart.GetComp <CompPawnSpawnerOnDamaged>().OfFaction;
            }
            for (int i = 0; i < countToSpawn; i++)
            {
                IntVec3 intVec;
                if (!CellFinderLoose.TryFindSkyfallerCell(ThingDefOf.CrashedShipPartIncoming, map, out intVec, 14, default(IntVec3), -1, false, true, true, true, true, false, null))
                {
                    break;
                }
                building_CrashedShipPart.SetFaction(faction, null);
                building_CrashedShipPart.GetComp <CompPawnSpawnerOnDamaged>().pointsLeft = Mathf.Max(parms.points * 0.9f, 300f);

                ThingDef faller = building_CrashedShipPart.GetComp <CompPawnSpawnerOnDamaged>().Props.skyFaller != null?building_CrashedShipPart.GetComp <CompPawnSpawnerOnDamaged>().Props.skyFaller : ThingDefOf.CrashedShipPartIncoming;

                Skyfaller skyfaller = SkyfallerMaker.MakeSkyfaller(faller, building_CrashedShipPart);
                skyfaller.shrapnelDirection = shrapnelDirection;
                GenSpawn.Spawn(skyfaller, intVec, map, WipeMode.Vanish);
                num++;
                list.Add(new TargetInfo(intVec, map, false));
            }
            if (num > 0)
            {
                base.SendStandardLetter(list, null, new string[0]);
            }
            return(num > 0);
        }