public Set_University(Location loc) : base(loc) { int q = Eleven.random.Next(3); if (q == 0) { title = new TitleLanded("Professor", "Professor", this); name = loc.shortName + " University"; } else if (q == 1) { title = new TitleLanded("Archivist", "Archivist", this); name = loc.shortName + " Archive"; } else { title = new TitleLanded("Librarian", "Librarian", this); name = loc.shortName + " Library"; } militaryCapAdd += 10 * location.map.param.unit_armyHPMult; militaryRegenAdd = 2; isHuman = true; }
public Set_City(Location loc) : base(loc) { title = new TitleLanded("Count", "Countess", this); name = "City of " + loc.shortName; basePrestige = 25; militaryCapAdd += 10; defensiveStrengthMax = 5; militaryRegenAdd = 0.15; isHuman = true; }
public override void implement(VoteOption option) { if (society.people.Contains(option.person) == false) //World.log("Invalid option. Person cannot hold title."); { return; } if (title.settlement == null) { return; } if (title.settlement.location.settlement != title.settlement) { return; } //It was removed before we arrived base.implement(option); if (title.heldBy == option.person) { //World.log("Title: " + title.getName() + " remains held by " + option.person.getFullName()); } //Person already has a title if (option.person.title_land != null) { TitleLanded prev = option.person.title_land; prev.heldBy = null; option.person.title_land = null; //World.log(prev.getName() + " has lost its lord as they have been reassigned"); } //Title already has a person if (title.heldBy != null) { //World.log(title.heldBy.getFullName() + " is losing title " + title.getName()); title.heldBy.title_land = null; title.heldBy = null; } //World.log(option.person.getFullName() + " has been granted the title of " + title.getName()); title.heldBy = option.person; title.settlement.infiltration = 0; option.person.title_land = title; if (title.settlement != null) { title.settlement.lastAssigned = title.settlement.location.map.turn; } }
public Set_Fort(Location loc) : base(loc) { title = new TitleLanded("Baron", "Baroness", this); int q = Eleven.random.Next(2); if (q == 0) { name = loc.shortName + " Castle"; } else if (q == 1) { name = "Fort " + loc.shortName; } militaryCapAdd += 5; militaryRegenAdd = 0.07; this.defensiveStrengthMax = 7; isHuman = true; }
public Set_Abbey(Location loc) : base(loc) { title = new TitleLanded("Abbot", "Abbess", this); int q = Eleven.random.Next(3); if (q == 0) { name = loc.shortName + " Abbey"; } else if (q == 1) { name = loc.shortName + " Cathedral"; } else if (q == 2) { name = "Church of " + loc.shortName; } militaryCapAdd += 5; militaryRegenAdd = 0.1; isHuman = true; }
public VoteIssue_AssignLandedTitle(Society soc, Person proposer, TitleLanded title) : base(soc, proposer) { this.title = title; }
public void setTo(Person p) { if (p == null) { setToNull(); return; } profileBack.enabled = true; profileMid.enabled = true; profileFore.enabled = true; profileBorder.enabled = true; profileAdvEyes.enabled = true; profileAdvMouth.enabled = true; profileAdvHair.enabled = true; profileAdvJewel.enabled = true; profileBorder.sprite = null; if (p.society.getSovereign() == p) { profileBorder.sprite = p.map.world.textureStore.slotKing; } else if (p.titles.Count > 0) { profileBorder.sprite = p.map.world.textureStore.slotDuke; } else { profileBorder.sprite = p.map.world.textureStore.slotCount; } if (World.staticMap.param.option_useAdvancedGraphics == 1) { //Null setting done to unfuck the distortion of images which periodically occurs profileBack.sprite = null; profileMid.sprite = null; profileAdvEyes.sprite = null; profileAdvMouth.sprite = null; profileAdvHair.sprite = null; profileAdvJewel.sprite = null; profileFore.sprite = null; profileBack.sprite = p.getImageBack(); if (p.isMale) { profileMid.sprite = p.map.world.textureStore.cultures[p.culture.graphicsIndex].m_faces[p.imgAdvFace]; profileAdvEyes.sprite = p.map.world.textureStore.cultures[p.culture.graphicsIndex].m_eyes[p.imgAdvEyes]; profileAdvMouth.sprite = p.map.world.textureStore.cultures[p.culture.graphicsIndex].m_mouths[p.imgAdvMouth]; profileAdvHair.sprite = p.map.world.textureStore.cultures[p.culture.graphicsIndex].m_hair[p.imgAdvHair]; profileAdvJewel.sprite = p.map.world.textureStore.cultures[p.culture.graphicsIndex].m_jewels[p.imgAdvJewel]; } else { profileMid.sprite = p.map.world.textureStore.cultures[p.culture.graphicsIndex].f_faces[p.imgAdvFace]; profileAdvEyes.sprite = p.map.world.textureStore.cultures[p.culture.graphicsIndex].f_eyes[p.imgAdvEyes]; profileAdvMouth.sprite = p.map.world.textureStore.cultures[p.culture.graphicsIndex].f_mouths[p.imgAdvMouth]; profileAdvHair.sprite = p.map.world.textureStore.cultures[p.culture.graphicsIndex].f_hair[p.imgAdvHair]; profileAdvJewel.sprite = p.map.world.textureStore.cultures[p.culture.graphicsIndex].f_jewels[p.imgAdvJewel]; } profileFore.sprite = p.getImageFore(); } else { profileAdvEyes.enabled = false; profileAdvMouth.enabled = false; profileAdvJewel.enabled = false; profileAdvHair.enabled = false; //Null setting done to unfuck the distortion of images which periodically occurs profileBack.sprite = null; profileMid.sprite = null; profileFore.sprite = null; profileBack.sprite = p.getImageBack(); profileMid.sprite = p.getImageMid(); profileFore.sprite = p.getImageFore(); } personTitle.text = p.getFullName(); TitleLanded title = p.title_land; if (title == null) { locText.text = "No Landed Title"; } else { locText.text = "of " + title.settlement.name; } Society soc = p.society; VoteSession vote = (soc != null) ? soc.voteSession : null; if (vote != null) { personVoting.text = "Voting: " + p.getVote(vote).info(vote.issue); } else { personVoting.text = "Not voting"; } voteSharePrediction.text = ""; if (p.society.socType.periodicElection()) { Title possibleOpt = null; foreach (Title t in soc.titles) { if (t is Title_Sovereign) { if (t.getEligibleHolders(p.society).Contains(p)) { possibleOpt = t; } } else if (t is Title_ProvinceRuler && possibleOpt == null) { if (t.getEligibleHolders(p.society).Contains(p)) { possibleOpt = t; } } } if (possibleOpt != null) { VoteIssue_AssignTitle hypothetical = new VoteIssue_AssignTitle(p.society, p, possibleOpt); foreach (Person p2 in possibleOpt.getEligibleHolders(p.society)) { VoteOption opt = new VoteOption(); opt.person = p2; hypothetical.options.Add(opt); } VoteSession sess = new VoteSession(); sess.issue = hypothetical; sess.assignVoters(); double total = 0; double mine = 0; double highest = 0; foreach (VoteOption opt in hypothetical.options) { total += opt.votingWeight; if (opt.person == p) { mine = opt.votingWeight; } if (opt.votingWeight > highest) { highest = opt.votingWeight; } } if (total > 0) { if (mine == highest) { voteSharePrediction.color = new Color(0, 0.75f, 0); } else { voteSharePrediction.color = new Color(1, 0.5f, 0.5f); } voteSharePrediction.text = possibleOpt.getName() + "\nPredicted Vote Share: " + (int)(100 * mine / total) + "%"; } } } }
public void showPersonInfo(Person p) { profileBack.enabled = true; profileMid.enabled = true; profileFore.enabled = true; profileBorder.enabled = true; //Done to unfuck the distortion of images which periodically occurs profileBack.sprite = null; profileMid.sprite = null; profileFore.sprite = null; profileBorder.sprite = null; profileBack.sprite = p.getImageBack(); profileMid.sprite = p.getImageMid(); profileFore.sprite = p.getImageFore(); if (p.society.getSovreign() == p) { profileBorder.sprite = p.map.world.textureStore.slotKing; } else if (p.titles.Count > 0) { profileBorder.sprite = p.map.world.textureStore.slotDuke; } else { profileBorder.sprite = p.map.world.textureStore.slotCount; } personTitle.text = p.getFullName(); TitleLanded title = p.title_land; if (title == null) { locText.text = "No Landed Title"; } else { locText.text = "of " + title.settlement.name; } string bodyText = ""; if (p.getDirectSuperiorIfAny() != null) { bodyText += "\nDirect Superior: " + p.getDirectSuperiorIfAny().getFullName(); } else { bodyText += "\nDirect Superior: None"; } prestigeText.text = "Prestige: " + (int)(p.prestige) + "\nPrestige Moving towards: " + (int)(p.getTargetPrestige(null)); bodyText += "\nShadow: " + (int)(p.shadow * 100) + "%"; bodyText += "\nEvidence: " + (int)(p.evidence * 100) + "%"; bodyText += "\nMilitarism: " + (int)(p.politics_militarism * 100) + "%"; bodyText += " (" + p.getMilitarismInfo() + ")"; bodyText += "\n"; personAwarenss.text = (int)(p.awareness * 100) + "%"; if (p.action == null) { actionText.text = "Not Taking Action"; actionDesc.text = "Characters can take actions if they become aware and world panic is sufficiently high."; actionDesc.text = "\n\nThis character is not taking an action."; } else { actionText.text = p.action.getShort(); actionDesc.text = "Characters can take actions if they become aware and world panic is sufficiently high."; actionDesc.text = "\n\n" + p.action.getLong(); } Society soc = getSociety(GraphicalMap.selectedHex); VoteSession vote = (soc != null) ? soc.voteSession : null; if (vote != null) { bodyText += "\nVoting on: " + vote.issue.ToString(); VoteOption vo = p.getVote(vote); bodyText += "\n\tto " + vo.info(vote.issue); } else { bodyText += "\nNot voting."; } bodyText += "\n"; ThreatItem threat = p.getGreatestThreat(); if (threat != null) { bodyText += "\nBelieved Greatest Threat: " + threat.getTitle(); bodyText += "\nFear of threat: " + (int)threat.threat; if (threat.threat > World.staticMap.param.person_fearLevel_terrified) { bodyText += "\n[Terrified]"; } else if (threat.threat > World.staticMap.param.person_fearLevel_afraid) { bodyText += "\n[Afraid]"; } else { bodyText += "\n[Moderate Concern]"; } } else { bodyText += "\nNot feeling threatened."; } personBody.text = bodyText; insanityText.text = "Sanity state: " + p.madness.name; insanityText.text += "\nSanity: " + ((int)p.sanity) + " Maximum: " + p.maxSanity; insanityDescText.text = p.madness.desc + "\n\n" + "Characters have a sanity score. If this value drops to zero, they become insane, and begin to act in an erratic and dangerous manner. " + "Characters will dislike insane characters to a moderate degree, and insane characters will occasionally lash out, further reducing their relationships." + "\nYou can cause reduce sanity using certain abilities."; personAwarenssDesc.text = "A person's awareness is how much they have realised about the threat their world faces.\nIt allows them to take actions against the darkenss directly." + "\nSome nobles gain awareness each time you expend power, they can also gain awareness by gaining suspicion as they seen evidence, and can be warned by their fellow nobles, especially neighbours." + "\nAwareness gain can be increased by being in a place of learning, or increased or decreased by traits." + "\n\nThis noble has an awareness rate of " + (int)(100 * p.getAwarenessMult()) + "%"; prestigeDescText.text = ""; List <string> prestigeReasons = new List <string>(); p.getTargetPrestige(prestigeReasons); foreach (string s in prestigeReasons) { prestigeDescText.text += "*" + s + "\n"; } for (int i = 0; i < traits.Length; i++) { traits[i].SetActive(false); traitDescBoxes[i].SetActive(false); } for (int i = 0; i < p.traits.Count; i++) { traits[i].SetActive(true); traitNames[i].text = p.traits[i].name; traitDescs[i].text = p.traits[i].desc; } }
public void showPersonInfo(Person p) { profileBack.enabled = true; profileMid.enabled = true; profileFore.enabled = true; //Done to unfuck the distortion of images which periodically occurs profileBack.sprite = null; profileMid.sprite = null; profileFore.sprite = null; profileBack.sprite = p.getImageBack(); profileMid.sprite = p.getImageMid(); profileFore.sprite = p.getImageFore(); personTitle.text = p.getFullName(); TitleLanded title = p.title_land; if (title == null) { locText.text = "No Landed Title"; } else { locText.text = "of " + title.settlement.name; } string bodyText = "Prestige: " + (int)(p.prestige); bodyText += "\nPrestige Moving towards: " + (int)(p.targetPrestige); bodyText += "\nShadow: " + (int)(p.shadow * 100) + "%"; bodyText += "\nEvidence: " + (int)(p.evidence * 100) + "%"; bodyText += "\nMilitarism: " + (int)(p.politics_militarism * 100) + "%"; bodyText += " (" + p.getMilitarismInfo() + ")"; bodyText += "\n"; Society soc = getSociety(GraphicalMap.selectedHex); VoteSession vote = (soc != null) ? soc.voteSession : null; if (vote != null) { bodyText += "\nVoting on: " + vote.issue.ToString(); VoteOption vo = p.getVote(vote); bodyText += "\n\tto " + vo.info(vote.issue); } else { bodyText += "\nNot voting."; } bodyText += "\n"; ThreatItem threat = p.getGreatestThreat(); if (threat != null) { bodyText += "\nBelieved Greatest Threat: " + threat.getTitle(); } else { bodyText += "\nNot feeling threatened."; } personBody.text = bodyText; }