public void UsePartyDie(CompanionType companion) { // TODO: Consider using this method everywhere Dice need to be moved from party to graveyard // first check if we have a companion that was transformed from a monster bool companionFromEnemyRemoved = PartyDice.RemoveFirst(d => d.IsFromMonster && d.Companion == companion); if (companionFromEnemyRemoved) { return; } // now let's check if we have a companion that was from hero ability or treasure bool companionFromTreasureRemoved = PartyDice.RemoveFirst(d => d.IsFromTreasureOrHeroAbility && d.Companion == companion); if (companionFromTreasureRemoved) { return; } // player didnt have a companion of this type that came from treasure, let's remove a normal die var partyDie = PartyDice.First(d => d.Companion == companion); PartyDice.Remove(partyDie); Graveyard++; }
public override bool CanKillAdditionalMonster(CompanionType companion) { if (IsLeveledUp && companion == CompanionThatKillsAdditionalMonster.Value) { return(true); } return(false); }
public string DrinkPotions(int numberOfPotions, CompanionType companion) { // puts the companion in the graveyard and saves the number of potions quaffed to track the revivals RevivalsRemaining = numberOfPotions; UsePartyDie(companion); return($"You used a {companion} to quaff potions. The number of remaining companion revivals is {RevivalsRemaining}. Say revive followed by the companion name to begin reviving. "); }
public GameObject GetCompanionByType(CompanionType type) { if (dict.ContainsKey(type)) { return(dict[type]); } return(null); }
public CompanionTypeModel AddCompanionType(CompanionTypeModel companionType) { var companionTypeToAdd = new CompanionType() { CompanionType1 = companionType.CompanionType }; _domainObjectRepository.Create <CompanionType>(companionTypeToAdd); return(companionType); }
public override string TransformCompanion(CompanionType companion) { if (companion == CompanionType.Scroll) { return($"You don't need to transform a scroll into a scroll. Try saying transform scroll to champion instead. "); } PartyDice.First(d => d.Companion == CompanionType.Scroll).Companion = companion; return($"You transformed a scroll into a {companion}. "); }
public void UpdateCompanionType(CompanionTypeModel companionType) { ICompanionTypeRepository ct = new CompanionTypeRepository(); var oldcompanionType = ct.GetCompanionType(companionType.Id); var companionTypeToUpdate = new CompanionType(); if (oldcompanionType == null) { return; } companionTypeToUpdate.CompanionType1 = companionType.CompanionType; _domainObjectRepository.Update <CompanionType>(companionTypeToUpdate); }
public override string TransformCompanion(CompanionType companion) { if (companion != CompanionType.Cleric && companion != CompanionType.Mage) { return($"You cannot transform a {companion}. Try saying transform cleric or transform mage instead. "); } if (companion == CompanionType.Cleric) { PartyDice.First(d => d.Companion == companion).Companion = CompanionType.Mage; return("You transformed a cleric into a mage. "); } PartyDice.First(d => d.Companion == companion).Companion = CompanionType.Cleric; return("You transformed a mage into a cleric. "); }
public override string TransformCompanion(CompanionType companion) { if (companion != CompanionType.Thief && companion != CompanionType.Mage) { return($"You cannot transform a {companion}. Try saying transform thief or transform mage instead. "); } if (companion == CompanionType.Thief) { PartyDice.First(d => d.Companion == companion).Companion = CompanionType.Mage; return("You transformed a thief into a mage. "); } PartyDice.First(d => d.Companion == companion).Companion = CompanionType.Thief; return("You transformed a mage into a thief. "); }
public string AcquireSingleTreasureItem(CompanionType companion, TreasureItem item) { // acquire a single treasure item // first remove companion from party and add to graveyard var companionDie = PartyDice.First(d => d.Companion == companion); UsePartyDie(companion); // now add treasure Inventory.Add(item); string message = $"You used a {companionDie.Name} to open a chest and received {item.TreasureType.GetDescription()}. "; return(message); }
/// <summary> /// Rolls one die that currently has the specified companion. /// </summary> /// <param name="companion"></param> /// <returns></returns> public string RollPartyDie(CompanionType companion) { string message = ""; var die = PartyDice.FirstOrDefault(d => d.Companion == companion); if (die == null) { message = $"You do not have a {companion} in your party.Choose another companion to roll. "; } else { die.Roll(); message = $"You rolled your {companion} and now got a {die.Companion} in your party. "; } return(message); }
public string ReviveCompanion(CompanionType companion) { // move a party die from graveyard to party dice then set the companion value Graveyard--; var partyDie = new PartyDie(); partyDie.Companion = companion; PartyDice.Add(partyDie); RevivalsRemaining--; if (RevivalsRemaining > 0) { return($"You added a {companion} to your party. Say revive to revive another companion. "); } // no more revivals return($"You added a {companion} to your party. "); }
public CompanionData() { myType = CompanionType.SPREADINGSHOOT; mySkills = new List <string>(); mySkillLevels = new List <int>(); }
/// <summary> /// Returns true if the selected companion can kill an additional monster. /// </summary> /// <param name="companion"></param> /// <returns></returns> public virtual bool CanKillAdditionalMonster(CompanionType companion) { return(false); }
public virtual string TransformCompanion(CompanionType companion) { return("This hero does not have the transform ability. "); }