Beispiel #1
0
        /// <summary>
        /// Switches the Negotiators mood based on the parameter
        /// </summary>
        /// <param name="value">Used in changing the Negotiators mood. Range from (-1 to 1)</param>
        public void SwitchMood(int value)
        {
            //Adds to the mood value only if possible
            if (Convert.ToInt32(mood) == 1)
            {
                mood += value;
            }
            else if (Convert.ToInt32(mood) == 0 && value >= 0)
            {
                mood += value;
            }
            else if (Convert.ToInt32(mood) == 2 && value <= 0)
            {
                mood += value;
            }

            //Changes the color for the mood text, according to the mood
            switch (mood)
            {
            case NegotiatorMood.Dissatisfied:
                textColor = Color.Red;
                break;

            case NegotiatorMood.Neutral:
                textColor = Color.Black;
                break;

            case NegotiatorMood.Satisfied:
                textColor = Color.Green;
                break;

            default:
                break;
            }
        }
Beispiel #2
0
        /// <summary>
        /// Changes the texture based on the context and the mood value from moodChanger
        /// </summary>
        /// <param name="context">The context for the texture switch (Idle, Resp, End and Fyret)</param>
        /// <param name="moodChanger">The value for the mood change</param>
        public void SwitchTexture(string context, int moodChanger)
        {
            NegotiatorMood statementMood = NegotiatorMood.Neutral;

            if (moodChanger == 1)
            {
                statementMood = NegotiatorMood.Satisfied;
            }
            else if (moodChanger == 0)
            {
                statementMood = NegotiatorMood.Neutral;
            }
            else if (moodChanger == -1)
            {
                statementMood = NegotiatorMood.Dissatisfied;
            }


            if (mood == NegotiatorMood.Satisfied && context == "Idle")
            {
                texture = textures[0];
            }
            else if (mood == NegotiatorMood.Neutral && context == "Idle")
            {
                texture = textures[1];
            }
            else if (mood == NegotiatorMood.Dissatisfied && context == "Idle")
            {
                texture = textures[2];
            }

            if (statementMood == NegotiatorMood.Satisfied && context == "Resp")
            {
                texture   = textures[3];
                idleTimer = DateTime.Now.AddSeconds(2);
            }
            else if (statementMood == NegotiatorMood.Neutral && context == "Resp")
            {
                texture   = textures[4];
                idleTimer = DateTime.Now.AddSeconds(2);
            }
            else if (statementMood == NegotiatorMood.Dissatisfied && context == "Resp")
            {
                texture   = textures[5];
                idleTimer = DateTime.Now.AddSeconds(2);
            }

            if (mood == NegotiatorMood.Satisfied && context == "End")
            {
                texture = textures[6];
            }
            else if (mood == NegotiatorMood.Neutral && context == "End")
            {
                texture = textures[7];
            }
            else if (mood == NegotiatorMood.Dissatisfied && context == "End")
            {
                texture = textures[8];
            }

            if (context == "Fired")
            {
                curText = "UD! Du er fyret!!!";
                Player.Instance.Salary = 0;
                texture = textures[10];
            }
        }