public override void turnTick(Unit unit) { if (unit.person == null) { unit.task = null; return; } if (unit.location.person() == null) { unit.task = null; return; } if (unit.location.person().getRelation(unit.person).getLiking() < unit.location.map.param.unit_spreadShadowMinLiking / 2) { unit.location.map.world.prefabStore.popMsg(unit.getName() + " can no longer spread shadow over " + unit.location.person().getFullName() + " as their liking is too low."); unit.task = null; return; } dur += 1; if (dur >= unit.location.map.param.unit_spreadShadowTime) { Evidence e = new Evidence(unit.location.map.turn); e.pointsTo = unit; e.weight = unit.location.map.param.unit_spreadShadowEvidence; unit.location.evidence.Add(e); unit.location.person().shadow = Math.Min(1, unit.location.person().shadow + unit.location.map.param.unit_spreadShadowAmount); unit.location.map.world.prefabStore.popImgMsg(unit.getName() + " enshadowing " + unit.location.person().getFullName() + ", they now are at " + ((int)(100 * unit.location.person().shadow)) + "% shadow", unit.location.map.world.wordStore.lookup("ABILITY_UNIT_SPREAD_SHADOW")); unit.task = null; } }
public override void castInner(Map map, Unit u) { Unit_Saviour saviour = (Unit_Saviour)u; saviour.linkedFates = true; u.location.map.world.prefabStore.popImgMsg(u.getName() + " publicly throws their support behind your enthralled noble, " + map.overmind.enthralled.getFullName() + ", granting them prestige " + "based on how adored The Saviour is." + map.overmind.enthralled.getFullName() + "'s prestige will be affected by how nobles in " + map.overmind.enthralled.society.getName() + " view " + u.getName() + ". The more they like them, the higher the prestige boost. However, if their suspicions grow, their prestige change may even become negative.", u.location.map.world.wordStore.lookup("ABILITY_SAVIOUR_LINKED_FATES"), 7); }
public override void turnTick(Unit unit) { //Enthralled can't just eat clues if (unit.isEnthralled()) { unit.task = null; return; } if (unit.location.evidence.Count > 0) { dur += 1; if (dur >= unit.location.map.param.unit_investigateTime) { Evidence ev = unit.location.evidence[0]; if (ev.pointsTo != null) { if (unit.person != null && ev.pointsTo.person != null) { unit.person.getRelation(ev.pointsTo.person).suspicion = System.Math.Min(1, unit.person.getRelation(ev.pointsTo.person).suspicion + ev.weight); } else { //Can't use suspicion system, go straight to murder //Makes sense since they're probably non-human terrors unit.hostility.Add(ev.pointsTo); } unit.location.map.addMessage(unit.getName() + " has found evidence from " + ev.pointsTo.getName(), MsgEvent.LEVEL_RED, false); } else if (ev.pointsToPerson != null) { if (unit.person != null && ev.pointsToPerson != null) { unit.person.getRelation(ev.pointsToPerson).suspicion = System.Math.Min(1, unit.person.getRelation(ev.pointsToPerson).suspicion + ev.weight); } unit.location.map.addMessage(unit.getName() + " has found evidence from " + ev.pointsToPerson.getFullName(), MsgEvent.LEVEL_RED, false); } unit.location.evidence.Remove(ev); unit.task = null; } } else { //Evidence gone. Probably eaten by someone else. Return to idle to retask next turn unit.task = null; } }
public override void turnTick(Unit unit) { if (unit is Unit_Merchant == false) { unit.task = null; return; } if (unit.society is Society == false) { unit.task = null; return; } if (unit.location.settlement == null) { unit.task = null; return; } float profit = getSaleValue(unit.society, unit.location); Unit_Merchant merchant = (Unit_Merchant)unit; int sold = Math.Min(merchant.cargo, 10); merchant.cargo -= sold; if (merchant.cargo <= 0) { merchant.cargo = 0; } int gain = (int)(0.5f + (profit * sold)); merchant.cash += gain; if (merchant.cash >= 100) { merchant.task = null; if (merchant.isEnthralled()) { merchant.location.map.world.prefabStore.popMsg(unit.getName() + " has generated as much wealth as they can transport, their strong-boxes brim with gold. They must spend before they can sell again."); } } if (merchant.cargo <= 0) { merchant.task = null; if (merchant.isEnthralled()) { merchant.location.map.world.prefabStore.popMsg(unit.getName() + " has sold all their cargo. They may now spend their profits or gather further cargo from home."); } } }
public override void castInner(Map map, Unit u) { u.die(map, "Was of no further use"); GraphicalMap.selectedSelectable = null; u.location.map.world.prefabStore.popImgMsg(u.getName() + " is no longer of use. The night swallows them up, allowing someone new to take their place.", u.location.map.world.wordStore.lookup("ABILITY_UNIT_APOPTOSIS")); }
public override void turnTick(Unit unit) { if (unit.location.person() == null) { unit.task = null; return; } dur += 1; if (dur >= unit.location.map.param.unit_pleadCaseTime) { int n = 0; string str = ""; foreach (RelObj rel in unit.location.person().relations.Values) { if (rel.suspicion > 0 && (rel.them.state == Person.personState.enthralled || rel.them.state == Person.personState.enthralledAgent || rel.them.state == Person.personState.broken)) { rel.suspicion /= 2; n += 1; str += rel.them.getFullName() + "; "; } } string add = ""; if (n == 0) { add = "No suspicion existed to remove."; } else { add = n + " suspicions reduced: " + str.Substring(0, str.Length - 2); } unit.location.map.world.prefabStore.popImgMsg(unit.getName() + " finishes pleading the case of those under your shadow to " + unit.location.person().getFullName() + ". " + add, unit.location.map.world.wordStore.lookup("ABILITY_UNIT_PLEAD_CASE")); unit.task = null; } }
public override void castInner(Map map, Unit u) { map.overmind.availableEnthrallments -= 1; u.automated = true; u.location.map.world.prefabStore.popImgMsg(u.getName() + " is set loose on the world, to act independently as they see fit. They will attempt to infiltrate and spread shadow, but will be weak without your direct influence.", u.location.map.world.wordStore.lookup("ABILITY_UNIT_SET_LOOSE")); }
public override void castInner(Map map, Unit u) { Unit_Investigator inv = (Unit_Investigator)u; inv.victim = null; foreach (Unit u2 in u.location.units) { if (u2 != u && u2.person != null) { inv.victim = u2; } } if (inv.victim != null) { inv.victimUses = map.param.ability_unit_falseAccusationCharges; u.location.map.world.prefabStore.popImgMsg(u.getName() + " gathers personal items of " + inv.victim.getName() + ", and can now falsely accuse them to nobles (" + inv.victimUses + " uses until they will need more fake evidence).", u.location.map.world.wordStore.lookup("ABILITY_UNIT_PRODUCE_FALSE_EVIDENCE")); } else { map.world.prefabStore.popMsg("No unit here has a unique character leading them"); } }
public override void castInner(Map map, Unit u) { Unit_NecroDoctor doc = (Unit_NecroDoctor)u; Property del = null; foreach (Property p in u.location.properties) { if (p.proto is Pr_RecentHumanBattle) { del = p; } } double amount = 0.5; Evidence e2 = new Evidence(map.turn); e2.pointsTo = u; e2.weight = amount; u.location.evidence.Add(e2); if (del == null) { map.world.prefabStore.popMsg("No battlefield to loot"); return; } doc.corpses = doc.maxCorpses; u.location.map.world.prefabStore.popImgMsg(u.getName() + " loots the bodies from the battlefield, piling high worthy corpses, their dead hands still gripping their weapons of war." + "\nThese should be carried to one or more corpseroot patches to preserve them until their next battle.", u.location.map.world.wordStore.lookup("ABILITY_DOCTOR_ROB_BATTLEFIELD")); }
public override void turnTick(Unit unit) { if (unit.location.soc == null || (unit.location.soc is Society == false)) { unit.task = null; return; } if (unit.location.settlement == null) { unit.task = null; return; } dur += 1; if (dur >= unit.location.map.param.unit_infiltrateTime) { double value = getEffectiveness(unit); unit.location.settlement.infiltration += value; if (unit.location.settlement.infiltration > 1) { unit.location.settlement.infiltration = 1; } unit.location.map.world.prefabStore.popImgMsg(unit.getName() + " finishes increasing your infiltration level in " + unit.location.getName() + ". Infiltration increased by " + (int)(100 * value) + "%, and is now at " + (int)(100 * unit.location.settlement.infiltration), unit.location.map.world.wordStore.lookup("ABILITY_UNIT_INFILTRATE")); unit.task = null; Evidence e = new Evidence(unit.location.map.turn); e.pointsTo = unit; e.weight = unit.location.map.param.unit_majorEvidence; unit.location.evidence.Add(e); } }
public override void castInner(Map map, Unit other) { map.overmind.availableEnthrallments -= 1; string addMsg = "\n\nYou have " + map.overmind.availableEnthrallments + " enthrallment uses remaining.You will regain one every " + map.param.overmind_enthrallmentUseRegainPeriod + " turns if you are below maximum."; map.world.prefabStore.popImgMsg( "You take " + other.getName() + " under your control. You may vote through them, convince others using their goodwill towards them, and use abilities relating to noble enthralled. " + addMsg, map.world.wordStore.lookup("ABILITY_ENTHRALL_AGENT")); other.person.state = Person.personState.enthralledAgent; Evidence ev = new Evidence(map.turn); ev.pointsTo = other; ev.weight = 0.66; other.location.evidence.Add(ev); other.automated = false; other.task = null; other.movesTaken += 1; map.overmind.computeEnthralled(); map.hasEnthralledAnAgent = true; if (other is Unit_Investigator) { Unit_Investigator inv = (Unit_Investigator)other; inv.state = Unit_Investigator.unitState.basic; } AchievementManager.unlockAchievement(SteamManager.achievement_key.FIRST_AGENT); }
public override void castInner(Map map, Unit u) { SocialGroup sg = null; foreach (SocialGroup soc in map.socialGroups) { if (soc is SG_Undead) { sg = soc; } } if (sg == null) { sg = new SG_Undead(map, u.location); map.socialGroups.Add(sg); } u.location.soc = sg; u.location.settlement = new Set_Corpseroot(u.location, u.location.soc); u.location.units.Remove(u.location.settlement.embeddedUnit); foreach (Hex hex in u.location.territory) { if (map.landmass[hex.x][hex.y] && Eleven.random.NextDouble() < 0.5) { hex.flora = new Flora_Corpseroot(hex); } } u.location.map.world.prefabStore.popImgMsg(u.getName() + " sows the ground with corpseroot, allowing the bodies they loot to be stored until they are raised back to life.", u.location.map.world.wordStore.lookup("ABILITY_DOCTOR_SOW_CORPSEROOT")); }
public override void castInner(Map map, Unit u) { u.task = new Task_SocialiseAtCourt(); u.location.map.world.prefabStore.popImgMsg(u.getName() + " begins socialising at court. This will take " + map.param.unit_socialiseAtCourtTime + " turns, after which their relationship" + " with the local noble will improve by up to " + map.param.unit_socialiseAtCourtGain + ", with lower gains the higher the noble's prestige.", u.location.map.world.wordStore.lookup("ABILITY_UNIT_SOCIALISE_AT_COURT")); }
public override void cast(Map map, Unit u) { SG_Undead theDead = (SG_Undead)u.location.soc; foreach (SocialGroup sg in map.socialGroups) { if (sg is Society) { if (theDead.getRel(sg).state != DipRel.dipState.war) { map.declareWar(theDead, sg); } } } double amount = 1; Evidence e2 = new Evidence(map.turn); e2.pointsTo = u; e2.weight = amount; u.location.evidence.Add(e2); u.location.map.world.prefabStore.popImgMsg(u.getName() + " calls upon the dead to rise up, and begin their war against life.", u.location.map.world.wordStore.lookup("ABILITY_DOCTOR_WAR_AGAINST_LIFE")); }
public override void castInner(Map map, Unit u) { if (map.overmind.enthralled != null) { map.world.prefabStore.popMsg("You already have an enthralled noble, and may only have one at a time. Use apoptosis to kill them if you need a new one."); return; } if (u.location.person() != null) { u.location.person().state = Person.personState.enthralled; map.overmind.enthralled = u.location.person(); AchievementManager.unlockAchievement(SteamManager.achievement_key.CULT_GROWS); } else { map.world.prefabStore.popMsg("No noble present in this location."); return; } u.location.map.world.prefabStore.popImgMsg(u.getName() + " brings " + u.location.person().getFullName() + " under your command, enthralling them to your will.", u.location.map.world.wordStore.lookup("ABILITY_UNIT_ENTHRALL_NOBLE"), 4); map.hintSystem.popHint(HintSystem.hintType.ENTHRALLED_NOBLES); }
public override void castInner(Map map, Unit u) { u.task = new Task_UncoverSecret(); u.location.map.world.prefabStore.popImgMsg(u.getName() + " beings uncovering the Forgotten Secret hidden at " + u.location.getName() + "," + " a task which will take " + u.location.map.param.unit_seeker_uncoverTime + " turns, after which they will gain 1 secret.", u.location.map.world.wordStore.lookup("ABILITY_SEEKER_UNCOVER_SECRET_START"), img: 2); }
public override void castInner(Map map, Unit u) { Unit_Seeker seeker = (Unit_Seeker)u; seeker.secrets -= 1; foreach (Location loc in map.locations) { List <Property> rems = new List <Property>(); foreach (Property pr in loc.properties) { if (pr.proto is Pr_ForgottenSecret) { rems.Add(pr); } } foreach (Property pr in rems) { loc.properties.Remove(pr); } } Unit_Seeker.addForgottenSecrets(map); u.location.map.world.prefabStore.popImgMsg(u.getName() + " changes their research direction, to a more promising path, allowing new secrets to be used.", u.location.map.world.wordStore.lookup("ABILITY_SEEKER_CHANGE_DIRECTION"), img: 2); }
public override void castInner(Map map, Unit u) { u.task = new Task_PleadCase(); u.location.map.world.prefabStore.popImgMsg(u.getName() + " begins presenting the case for your enthralled nobles and agents' innocent, or at least their lesser guilt." + " This will take " + map.param.unit_pleadCaseTime + " turns, after which " + u.location.person().getFullName() + "'s suspicion towards all enthralled or broken nobles and units will halve.", u.location.map.world.wordStore.lookup("ABILITY_UNIT_PLEAD_CASE")); }
public override string getLargeDesc() { string reply = "Vote to condemn " + target.getName() + " for their crimes against the nation, including association with dark forces." + "\n\nIf found guilty, this agent will be considered hostile by the nation of " + society.getName() + ", and be subject to attack by their agents and lose health while in their territory."; return(reply); }
public override void castInner(Map map, Unit u) { u.task = new Task_SpreadShadow(); u.location.map.world.prefabStore.popImgMsg(u.getName() + " beings darkening the soul of " + u.location.person().getFullName() + "." + " This will take " + map.param.unit_spreadShadowTime + " turns, after which " + u.location.person().getFullName() + "'s shadow will increase by " + (int)(100 * map.param.unit_spreadShadowAmount) + "%. This will leave " + ((int)(100 * World.staticMap.param.unit_spreadShadowEvidence)) + " evidence.", u.location.map.world.wordStore.lookup("ABILITY_UNIT_SPREAD_SHADOW")); }
public override void castInner(Map map, Unit u) { u.task = new Task_Infiltrate(); u.location.map.world.prefabStore.popImgMsg(u.getName() + " begins infiltrating " + u.location.person().getFullName() + ". If successful your infiltration level will increase by " + (int)(100 * Task_Infiltrate.getEffectiveness(u)) + "%." + " Security will reduce the amount of infiltration gained, and " + (int)(100 * World.staticMap.param.unit_majorEvidence) + "% evidence will be left behind." + " If the noble likes your agent this infiltration will be more effective, but will reduce if they dislike them.", u.location.map.world.wordStore.lookup("ABILITY_UNIT_INFILTRATE")); }
public override void castInner(Map map, Unit other) { map.world.prefabStore.popImgMsg( "You disrupt the work of " + other.getName() + ". They will require some time before they can act again.", map.world.wordStore.lookup("ABILITY_DISRUPT_AGENT")); other.task = new Task_Disrupted(); other.movesTaken += 1; }
public void bWatch() { if (GraphicalMap.selectedSelectable == null || GraphicalMap.selectedSelectable is Unit == false) { return; } Unit u = (Unit)GraphicalMap.selectedSelectable; if (u.person != null) { u.person.watched = true; world.prefabStore.popMsgAgent(u, u, u.getName() + " is now flagged as `watched'. You will receive updates on key events regarding them (such as promotions and death)."); } else { world.prefabStore.popMsg(u.getName() + " cannot be set to be watched as it is a generic unit, it is not an agent."); } GraphicalMap.checkData(); }
public override void castInner(Map map, Unit u) { u.hp += 1; if (u.hp > u.maxHp) { u.hp = u.maxHp; } u.location.map.world.prefabStore.popImgMsg(u.getName() + " recruits from " + u.location.getName() + ", replenishing their forces. They are now at " + u.hp + "/" + u.maxHp + ".", u.location.map.world.wordStore.lookup("ABILITY_RECRUIT")); }
public override void turnTick(Unit unit) { dur += 1; if (dur >= unit.location.map.param.unit_seeker_uncoverTime) { Unit_Seeker seeker = (Unit_Seeker)unit; seeker.secrets += nSecrets; List <Property> rems = new List <Property>(); foreach (Property pr in unit.location.properties) { if (pr.proto is Pr_ForgottenSecret) { rems.Add(pr); } } foreach (Property pr in rems) { seeker.location.properties.Remove(pr); } string msg = unit.getName() + " discovers a forgotten secret, they now have " + seeker.secrets + " and need " + seeker.reqSecrets + " to discover the truth."; if (seeker.secrets == seeker.reqSecrets) { msg = unit.getName() + " learns a forgotten secret, and now knows enough to piece together the truth they have been seeking. Use their ability to do so."; } if (leaveEvidence) { msg += "\nThey left evidence behind."; } unit.location.map.world.prefabStore.popImgMsg(msg, unit.location.map.world.wordStore.lookup("ABILITY_SEEKER_UNCOVER_SECRET"), img: 2); unit.task = null; if (leaveEvidence) { Evidence e = new Evidence(unit.location.map.turn); e.pointsTo = unit; e.weight = unit.location.map.param.unit_majorEvidence; unit.location.evidence.Add(e); } } }
public override void castInner(Map map, Unit u) { Task_UncoverSecret task = new Task_UncoverSecret(); task.leaveEvidence = false; task.nSecrets = 2; u.task = task; u.location.map.world.prefabStore.popImgMsg(u.getName() + " beings uncovering the Forgotten Secret hidden at " + u.location.getName() + "," + " a task which will take " + u.location.map.param.unit_seeker_uncoverTime + " turns, after which they will gain 2 secrets.", u.location.map.world.wordStore.lookup("ABILITY_SEEKER_ACCESS_LIBRARY"), img: 2); }
public override string specialInfo() { if (victim == null) { return("No False Accusation Target"); } else { return("Able to Accuse " + victim.getName() + "( " + victimUses + " uses)"); } }
public override void castInner(Map map, Unit u) { u.task = new Task_LoadCargo(); Unit_Merchant merchant = (Unit_Merchant)u; merchant.hasLoadedCargo = true; u.location.map.world.prefabStore.popImgMsg(u.getName() + " begins loading cargo, ready to be sold for profit in distant towns.", u.location.map.world.wordStore.lookup("ABILITY_UNIT_LOAD_CARGO"), 1); }
public override void turnTick(Unit unit) { if (unit is Unit_Merchant == false) { unit.task = null; return; } if (unit.society is Society == false) { unit.task = null; return; } if (unit.location.settlement == null) { unit.task = null; return; } if (unit.location.soc == null) { unit.task = null; return; } Unit_Merchant merchant = (Unit_Merchant)unit; if (merchant.cash <= 0) { unit.task = null; return; } merchant.cash -= 10; Person noble = merchant.location.person(); if (noble != null) { noble.getRelation(merchant.person).addLiking(10, "Spent Wealth", unit.location.map.turn, RelObj.STACK_ADD); noble.prestige += 1.5; } if (unit.location.soc.currentMilitary < unit.location.soc.maxMilitary) { unit.location.soc.currentMilitary += 1; if (unit.location.soc.currentMilitary > unit.location.soc.maxMilitary) { unit.location.soc.currentMilitary = unit.location.soc.maxMilitary; } } if (merchant.cash <= 0) { merchant.cash = 0; merchant.task = null; if (merchant.isEnthralled()) { merchant.location.map.world.prefabStore.popMsg(unit.getName() + " has spent their last wealth, and must now return home to collect more cargo to sell."); } } }
public override void castInner(Map map, Unit u) { u.task = new Task_Vamp_Insanity(); Unit_Vampire vamp = (Unit_Vampire)u; vamp.blood -= World.staticMap.param.ability_unit_bloodCostInsanity; u.location.map.world.prefabStore.popImgMsg(u.getName() + " beings imposing their dark will on the mind of " + u.location.person().getFullName() + ". Each turn, they will lose sanity" + " until their mind snaps.", u.location.map.world.wordStore.lookup("ABILITY_VAMP_INSANITY")); }