public Patron(PatronID id, string name, int rank, HouseID house, bool female, int portrait) : base(name, rank, house) { this.id = id; Directory.Add(id, this); NobleHouse.Definitions[house].members.Add(this); this.female = female; this.sprite = female ? LayoutManager.Main.FemalePortraits[portrait] : LayoutManager.Main.MalePortraits[portrait]; }
public Job(PatronID patronid, int Tier, string title, string description, int AurumReward, SpellEffect[] requiredEffects) { //if (patron == null) //{ // NobleHouse randomHouse = Util.RandomElement(NobleHouse.Definitions.Values.ToArray()); //patron = Util.RandomElement(randomHouse.members).id; //} this.patron = Patron.Directory[patronid]; Mandatory = Random.Range(0, 1f) < 0.2f; //this.patron = patron; this.Tier = Tier; this.title = title; this.description = description; EffectsRequired = new List <SpellEffect>(requiredEffects); EffectsProvided = new List <SpellEffect>(); totalTimeToComplete = 3 + Random.Range(0, 2) + Random.Range(0, 2) + Random.Range(0, 2); remainingTimeToComplete = totalTimeToComplete; //Calculating rewards int bigRepReward = Tier * 2; int smallRepReward = Tier; Reward successRewards = new Reward() .AddAurum(AurumReward) .AddXP(Tier); Reward failureRewards = new Reward() .AddReputation(patron.house, -bigRepReward); if (Random.Range(0, 1f) < 0.75f) //usually jobs hurt your rep with someone else { successRewards.AddReputation(patron.house, bigRepReward); int enemyHousePenalty = Random.Range(bigRepReward - 1, bigRepReward + 1); if (enemyHousePenalty > 0) { successRewards.AddReputation(NobleHouse.OpposedHouse[patron.house], -enemyHousePenalty); } } else { successRewards.AddReputation(patron.house, smallRepReward); } //Creating resulting events successEvent = new StoryEvent(title + " Complete!", "Nicely done. Here's your payment. \n\n" + successRewards.GetTextDescription() , patron.sprite, successRewards); failureEvent = new StoryEvent(title + " Failed", "You've failed me and disgraced yourself. \n\n" + failureRewards.GetTextDescription(), patron.sprite, failureRewards); AllRandomJobs.Add(this); }