public override StateGraph CreateGraph() { StateGraph stateGraph = new StateGraph(); LordToil startingToil = stateGraph.AttachSubgraph(new LordJob_Travel(this.siegeSpot).CreateGraph()).StartingToil; LordToil_Siege lordToil_Siege = new LordToil_Siege(this.siegeSpot, this.blueprintPoints); stateGraph.AddToil(lordToil_Siege); LordToil startingToil2 = stateGraph.AttachSubgraph(new LordJob_AssaultColony(this.faction, true, true, false, false, true).CreateGraph()).StartingToil; Transition transition = new Transition(startingToil, lordToil_Siege, false, true); transition.AddTrigger(new Trigger_Memo("TravelArrived")); transition.AddTrigger(new Trigger_TicksPassed(5000)); stateGraph.AddTransition(transition); Transition transition2 = new Transition(lordToil_Siege, startingToil2, false, true); transition2.AddTrigger(new Trigger_Memo("NoBuilders")); transition2.AddTrigger(new Trigger_Memo("NoArtillery")); transition2.AddTrigger(new Trigger_PawnHarmed(0.08f, false, null)); transition2.AddTrigger(new Trigger_FractionPawnsLost(0.3f)); transition2.AddTrigger(new Trigger_TicksPassed((int)(60000f * Rand.Range(1.5f, 3f)))); transition2.AddPreAction(new TransitionAction_Message("MessageSiegersAssaulting".Translate(new object[] { this.faction.def.pawnsPlural, this.faction }), MessageTypeDefOf.ThreatBig, null, 1f)); transition2.AddPostAction(new TransitionAction_WakeAll()); stateGraph.AddTransition(transition2); return(stateGraph); }
public override StateGraph CreateGraph() { StateGraph stateGraph = new StateGraph(); LordToil startingToil = stateGraph.AttachSubgraph(new LordJob_Travel(siegeSpot).CreateGraph()).StartingToil; LordToil_Siege lordToil_Siege = new LordToil_Siege(siegeSpot, blueprintPoints); stateGraph.AddToil(lordToil_Siege); LordToil_ExitMap lordToil_ExitMap = new LordToil_ExitMap(LocomotionUrgency.Jog, canDig: false, interruptCurrentJob: true) { useAvoidGrid = true }; stateGraph.AddToil(lordToil_ExitMap); LordToil startingToil2 = stateGraph.AttachSubgraph(new LordJob_AssaultColony(faction).CreateGraph()).StartingToil; Transition transition = new Transition(startingToil, lordToil_Siege); transition.AddTrigger(new Trigger_Memo("TravelArrived")); transition.AddTrigger(new Trigger_TicksPassed(5000)); stateGraph.AddTransition(transition); Transition transition2 = new Transition(lordToil_Siege, startingToil2); transition2.AddTrigger(new Trigger_Memo("NoBuilders")); transition2.AddTrigger(new Trigger_Memo("NoArtillery")); transition2.AddTrigger(new Trigger_PawnHarmed(0.08f)); transition2.AddTrigger(new Trigger_FractionPawnsLost(0.3f)); transition2.AddTrigger(new Trigger_TicksPassed((int)(60000f * Rand.Range(1.5f, 3f)))); transition2.AddPreAction(new TransitionAction_Message("MessageSiegersAssaulting".Translate(faction.def.pawnsPlural, faction), MessageTypeDefOf.ThreatBig)); transition2.AddPostAction(new TransitionAction_WakeAll()); stateGraph.AddTransition(transition2); Transition transition3 = new Transition(lordToil_Siege, lordToil_ExitMap); transition3.AddSource(startingToil2); transition3.AddSource(startingToil); transition3.AddTrigger(new Trigger_BecameNonHostileToPlayer()); transition3.AddPreAction(new TransitionAction_Message("MessageRaidersLeaving".Translate(faction.def.pawnsPlural.CapitalizeFirst(), faction.Name))); stateGraph.AddTransition(transition3); return(stateGraph); }