public void ProcessCleanAction(ActionContainer action) { var character = action.GetExecutingCharacter(); CharacterActions.RaiseCharacterDeterminationBy(2, character); Moral.RaiseMoral(); }
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(); }
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--; } }
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; } }
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 }
public void ExecuteSuccessEvent() { Moral.RaiseMoral(); var active = Player.PartyActions.ExecutingCharacter; Characters.CharacterActions.RaiseCharacterDeterminationBy(2, active); }
public override void UseAbility() { if (CurrentDetermination >= GetAbilityCosts()) { //Motivational Speech CharacterActions.LowerCharacterDeterminationBy(GetAbilityCosts(), this); Moral.RaiseMoral(); } }
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); }
// 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(); }
// 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); } }
/// <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); } }
private void ExecuteFutureThreat() { Moral.LowerMoral(); Moral.LowerMoral(); }
private void ExecuteActiveThreat() { Moral.LowerMoral(); }
private void ShowInfoText() { var character = PartyActions.GetActiveCharacter(); string info = "Der " + character.CharacterName + " erhält diese Runde " + Moral.GetMoraleString(); informationText.text = info; }