Beispiel #1
0
    public void DisplayDefeatMessage(bool playerDetected, MessageSource source)
    {
        Outcome outcome = Outcome.Defeat;

        if (source == MessageSource.Guard)
        {
            if (playerDetected)
            {
                DisplayMessage("You there, the one with the thief outfit! Stop or I'll shoot!", source, 3);
            }
            else
            {
                outcome = Outcome.CreatureCaptured;
                DisplayMessage("Runaway creature detected, moving it to maximum security!", source, 3);
            }
        }
        else if (source == MessageSource.Camera)
        {
            if (playerDetected)
            {
                DisplayMessage("Stop or I'll shoot... My camera rays! Yeah, you don't want to test me!", source, 3);
            }
            else
            {
                outcome = Outcome.CreatureCaptured;
                DisplayMessage("Can one of you lazy bastards come and pick this creature up?", source, 3);
            }
        }
        else
        {
            throw new UnityException($"Player can't be defeated by {source.ToString()}");
        }

        StartCoroutine(DefeatCoroutine(outcome));
    }
Beispiel #2
0
    public Sprite GetSourceSprite(MessageSource source)
    {
        switch (source)
        {
        case MessageSource.Camera:
            return(CameraSprite);

        case MessageSource.Driver:
            return(DriverSprite);

        case MessageSource.Guard:
            return(GuardSprite);

        case MessageSource.Player:
            return(PlayerSprite);
        }
        throw new UnityException($"Unknown source {source.ToString()}");
    }
Beispiel #3
0
 /// <inheritdoc />
 public override void Log(MessageType type, MessageSource source, string message)
 {
     Send(type, source.ToString(), $"[{Thread.CurrentThread.Name}/{Thread.CurrentThread.ManagedThreadId}] {message}");
 }