public override void OnEndReceiver(RealmData realmData)
        {
            // Nothing
            if (state == TransactionResponse.ACCEPTED)
            {
                Pawn pawn = realmPawn.FromRealmPawn(realmData);

                // We drop it
                IntVec3 position = DropCellFinder.RandomDropSpot();
                DropPodUtility.MakeDropPodAt(position, new DropPodInfo
                {
                    SingleContainedThing = pawn,
                    openDelay            = 110,
                    leaveSlag            = false
                });

                Find.LetterStack.ReceiveLetter(
                    "Colonist pod",
                    "A colonist was sent to you by " + sender.name,
                    LetterType.Good,
                    position
                    );
            }
            else if (state == TransactionResponse.INTERRUPTED)
            {
                Messages.Message("Unexpected interruption during item transaction with " + sender.name, MessageSound.RejectInput);
            }
        }
Example #2
0
        public override void OnEndReceiver(RealmData realmData)
        {
            // Nothing
            if (state == TransactionResponse.ACCEPTED)
            {
                Pawn pawn = realmPawn.FromRealmPawn(realmData);

                // We drop it
                IntVec3 position = DropCellFinder.RandomDropSpot(Find.VisibleMap);
                DropPodUtility.MakeDropPodAt(position, Find.VisibleMap, new ActiveDropPodInfo
                {
                    SingleContainedThing = pawn,
                    openDelay            = 110,
                    leaveSlag            = false
                });

                Find.LetterStack.ReceiveLetter(
                    "Colonist pod",
                    "A colonist was sent to you by " + sender.name,
                    LetterDefOf.PositiveEvent,
                    new RimWorld.Planet.GlobalTargetInfo(position, Find.VisibleMap)
                    );
            }
            else if (state == TransactionResponse.INTERRUPTED)
            {
                Messages.Message("Unexpected interruption during item transaction with " + sender.name, MessageTypeDefOf.RejectInput);
            }
        }
Example #3
0
        // Token: 0x0600005C RID: 92 RVA: 0x00003CE8 File Offset: 0x00001EE8
        public override void OnEndReceiver(RealmData realmData)
        {
            if (!receiver.preferences.receiveItems)
            {
                state = TransactionResponse.DECLINED;
            }

            if (state == TransactionResponse.ACCEPTED)
            {
                var singleContainedThing = realmPawn.FromRealmPawn(realmData);
                var intVec = DropCellFinder.RandomDropSpot(Find.CurrentMap);
                DropPodUtility.MakeDropPodAt(intVec, Find.CurrentMap, new ActiveDropPodInfo
                {
                    SingleContainedThing = singleContainedThing,
                    openDelay            = 110,
                    leaveSlag            = false
                });
                Find.LetterStack.ReceiveLetter(
                    $"{Enum.GetName(typeof(TransactionType), transaction)} pod",
                    $"A {Enum.GetName(typeof(TransactionType), transaction)?.ToLower()} was sent to you by {sender.name}",
                    LetterDefOf.PositiveEvent, new GlobalTargetInfo(intVec, Find.CurrentMap));
                return;
            }

            if (state == TransactionResponse.INTERRUPTED)
            {
                Messages.Message("Unexpected interruption during item transaction with " + sender.name,
                                 MessageTypeDefOf.RejectInput);
                return;
            }

            var unused = state;
        }
Example #4
0
        public override void OnEndReceiver(RealmData realmData)
        {
            // Double check to ensure it wasn't bypassed by the sender
            if (!receiver.preferences.receiveItems)
            {
                state = TransactionResponse.DECLINED;
            }

            // Nothing
            if (state == TransactionResponse.ACCEPTED)
            {
                Pawn pawn = realmPawn.FromRealmPawn(realmData);

                // We drop it
                IntVec3 position = DropCellFinder.RandomDropSpot(Find.VisibleMap);
                DropPodUtility.MakeDropPodAt(position, Find.VisibleMap, new ActiveDropPodInfo
                {
                    SingleContainedThing = pawn,
                    openDelay            = 110,
                    leaveSlag            = false
                });

                Find.LetterStack.ReceiveLetter(
                    "Colonist pod",
                    "A colonist was sent to you by " + sender.name,
                    LetterDefOf.PositiveEvent,
                    new RimWorld.Planet.GlobalTargetInfo(position, Find.VisibleMap)
                    );
            }
            else if (state == TransactionResponse.INTERRUPTED)
            {
                Messages.Message("Unexpected interruption during item transaction with " + sender.name, MessageTypeDefOf.RejectInput);
            }
            else if (state == TransactionResponse.TOOFAST)
            {
                // This should never happen as the server rejects intercepted packets.
            }
        }