コード例 #1
0
    public void ProcessCleanAction(ActionContainer action)
    {
        var character = action.GetExecutingCharacter();

        CharacterActions.RaiseCharacterDeterminationBy(2, character);
        Moral.RaiseMoral();
    }
コード例 #2
0
    private void TaskOnClick()
    {
        if (Moral.GetCurrentMoralState() == MoralState.Best && !wantsHeal && !wantsDetermination)
        {
            return;
        }

        var character = PartyActions.GetActiveCharacter();

        if (wantsHeal)
        {
            CharacterActions.HealCharacterBy(1, character);
        }
        else
        {
            int moralevalue = Moral.GetMoraleInt();
            if (moralevalue < 0)
            {
                CharacterActions.LowerCharacterDeterminationBy(moralevalue, character);
            }
            else
            {
                CharacterActions.RaiseCharacterDeterminationBy(moralevalue, character);
            }
        }
        Destroy(popUp);
        var phaseView = FindObjectOfType <PhaseView>();

        phaseView.NextPhase();
    }
コード例 #3
0
 public static void DamageCharacterBy(int amount, Character character)
 {
     if (amount < 0)
     {
         amount = 0;
     }
     while (amount > 0)
     {
         if (character.CurrentHealth > 0)
         {
             character.CurrentHealth -= 1;
         }
         if (character.CurrentHealth <= 0)
         {
             character.CurrentDetermination = 0;
             //Character Death
             if (character is ISideCharacter)
             {
                 character.IsDead        = true;
                 character.CurrentHealth = 0;
             }
             else
             {
                 EndGame_Object.TriggerDefeat("OH NEIN!\r\n" + character.CharacterName + " hat seinen letzten Atemzug getan!\r\n" +
                                              "Ohne seine Unterstützung wird der Rest der Gruppe auch nicht mehr lange überleben!");
             }
         }
         if (!(character is ISideCharacter) &&
             CheckForMoralLoss(character))
         {
             Moral.LowerMoral();
         }
         amount--;
     }
 }
コード例 #4
0
        private void Update()
        {
            if (Customer.Mood == LastMood)
            {
                return;
            }
            LastMood = Customer.Mood;

            switch (Customer.Mood)
            {
            case Moral.Happy:
                MoralImage.Source = new BitmapImage(new Uri(@"/KBS2;component/Images/Happy.png", UriKind.Relative));
                return;

            case Moral.Neutral:
                MoralImage.Source = new BitmapImage(new Uri(@"/KBS2;component/Images/Neutral.png", UriKind.Relative));
                return;

            case Moral.Annoyed:
                MoralImage.Source = new BitmapImage(new Uri(@"/KBS2;component/Images/Annoyed.png", UriKind.Relative));
                return;

            case Moral.Sad:
                MoralImage.Source = new BitmapImage(new Uri(@"/KBS2;component/Images/Sad.png", UriKind.Relative));
                return;

            case Moral.Mad:
                MoralImage.Source = new BitmapImage(new Uri(@"/KBS2;component/Images/Mad.png", UriKind.Relative));
                return;
            }
        }
コード例 #5
0
ファイル: Review.cs プロジェクト: TheKoen/SE1d3-KBS2
        public string CreateContent(Moral moral)
        {
            var content = "";

            //Open XML File
            XDocument file = XDocument.Load(@"CustomerSystem/Reviews.xml");


            //Make a list of all reviews belonging to the current mood.
            List <string> reviewlist = new List <string>();

            //Query to fetch and fill the reviewlist above.
            try
            {
                reviewlist = (from r in file.Descendants("ReviewList").Elements($"{moral.ToString()}").Elements("review")
                              select r.Value).ToList();
            }
            catch (System.NullReferenceException)
            {
                return(content = "Failed to load review content.");
            }

            //Random number for index will be generated and given as content
            Random random = new Random();



            return(content = reviewlist[random.Next(0, reviewlist.Count)]);
            //Random description in section of depending moral
        }
コード例 #6
0
        public void ExecuteSuccessEvent()
        {
            Moral.RaiseMoral();

            var active = Player.PartyActions.ExecutingCharacter;

            Characters.CharacterActions.RaiseCharacterDeterminationBy(2, active);
        }
コード例 #7
0
 public override void UseAbility()
 {
     if (CurrentDetermination >= GetAbilityCosts())
     {
         //Motivational Speech
         CharacterActions.LowerCharacterDeterminationBy(GetAbilityCosts(), this);
         Moral.RaiseMoral();
     }
 }
コード例 #8
0
ファイル: CustomerTest.cs プロジェクト: TheKoen/SE1d3-KBS2
        public void TestMoral(int time, Moral expected)
        {
            var customer = new Customer(new Vector(0, 0), 6, null, null);

            for (var i = 0; i < time * 100; i++)
            {
                customer.Controller.Update();
            }

            Assert.AreEqual(expected, customer.Mood);
        }
コード例 #9
0
 // Start is called before the first frame update
 void Start()
 {
     //TODO: Initialize all the other stuff
     Roof.SetStartValue(0);
     Wall.SetStartState(0);
     WeaponPower.SetStartValue(0);
     Fur.SetStartValue(0);
     Wood.SetStartValue(0);
     FoodStorage.SetStartValue(0, 0);
     Moral.SetStartValue();
     TerrainStorage.CreateStorageSpace();
     InventionStorage.CreateStorageSpace();
 }
コード例 #10
0
    // Start is called before the first frame update
    void Start()
    {
        confirm.onClick.AddListener(TaskOnClick);
        chooseHeart.onClick.AddListener(ChooseHearts);
        chooseMorale.onClick.AddListener(ChooseMorale);

        if (PartyHandler.PartySize == 1)
        {
            Moral.RaiseMoral();
        }

        ShowInfoText();
        if (Moral.GetCurrentMoralState() == MoralState.Best)
        {
            chooseHeartObject.SetActive(true);
            chooseMoraleObject.SetActive(true);
        }
    }
コード例 #11
0
ファイル: Review.cs プロジェクト: TheKoen/SE1d3-KBS2
        /// <summary>
        /// Give a rating depending on the <paramref name="moral"/> of the customer.
        /// </summary>
        /// <param name="moral"></param>
        /// <returns>a rating of type int</returns>
        public int GiveRating(Moral moral)
        {
            switch (moral)
            {
            case Moral.Happy:
                return(5);

            case Moral.Neutral:
                return(4);

            case Moral.Annoyed:
                return(3);

            case Moral.Sad:
                return(2);

            case Moral.Mad:
                return(1);

            default:
                return(0);
            }
        }
コード例 #12
0
 private void ExecuteFutureThreat()
 {
     Moral.LowerMoral();
     Moral.LowerMoral();
 }
コード例 #13
0
 private void ExecuteActiveThreat()
 {
     Moral.LowerMoral();
 }
コード例 #14
0
    private void ShowInfoText()
    {
        var    character = PartyActions.GetActiveCharacter();
        string info      = "Der " + character.CharacterName + " erhält diese Runde " + Moral.GetMoraleString();

        informationText.text = info;
    }