Start of turn events for KTM point runs

Start of turn events (SOTE) play a big role in obtaining the largest amount of points in Sengoku Rance. After all, if you were able to freely decide which SOTE will play, this would functionally give you another action fan.

Unfortunately, freely deciding which SOTE will play is not in the realm of possibilities. What we can do, however, is limit the amount of unnecessary SOTE that will play.

How does this work? The game has a function called  織田ＴＯＰ強制 which is essentially just a long list of if statements. The event that shows up first in that list while you fulfill the if condition will play as the next SOTE.

A (mostly machine-)translated version of this function can be found here: https://pastebin.com/7KHFWbr7

We don't want to go through 2000 lines of code, so we will split this function into 13 parts in descending order of priority. Since we are only interested in KTM point runs, events in (2), (3) and (10) will not happen. Also we are going to be too quick to trigger (5) and don't care about (14) at all. Curiously, Nanjou Ran won't run away in the KTM route and since we aren't interested in Senhime, who can't have End Game Points, (8) is irrelevant as well.
 * 1) Initial events
 * 2) Nobunaga at Honnouji events
 * 3) Non-KTM route events
 * 4) KTM route events
 * 5) War preparations events (second game)
 * 6) Character join events
 * 7) Ashikaga war events
 * 8) Runaway events (Najou Ran, Senhime)
 * 9) Full House events (good medicine)
 * 10) Route heroine events
 * 11) Special commander events
 * 12) Miscellaneous events
 * 13) Generic commander affection up events
 * 14) More miscellaneous events.

"Turn 1 event"

 * prerequisites: # turns = 1
 * preventable: no

"Battle for the first time"

 * prerequisites: none
 * preventable: no

"Sill H event"

 * prerequisites: none
 * preventable: yes, manually activate it before it triggers.

"Suzume introduction"

 * prerequisites: # turns > 5 OR Ashikaga conquered/vassalled
 * preventable: no

"Declaration of war explanation"

 * prerequisites: # turns = 7 AND haven't declared any wars yet
 * preventable: yes, declare wars beforehand

"Suzume joins"

 * prerequisites: "Suzume introduction" seen
 * preventable: no

"Cherry Blossom viewing"

 * prerequisites: Suzume AND ( # turns > 11 OR Ashikaga or Iga conquered/vassalled )
 * preventable: no

"Nobunaga's daily life 1"

 * prerequisites: none
 * preventable: no

"Nobunaga's daily life 2"

 * prerequisites: none
 * preventable: no

"Nobunaga's daily life 2"

 * prerequisites: none
 * preventable: no

"Shimazu brothers at Kouhime's teahouse"

 * prerequisites: "Toshihisa has sex with Agireda" (This is the third of the events that play after a battle was fought against Shimazu, it doesn't matter if it was a permit or manually fought)
 * preventable: no. Due to its high priority, this event will play before you can even conquer Shimazu's second province.

"Rance hears report about defection"

 * prerequisites: "Suzume warns about Shimazu brothers" has been seen AND Shimazu brothers haven't surrendered AND defection attempt was successful
 * preventable: yes. The way a defection is attempted is that a random commander is selected from your roster. If the commander is either male, important or at [Love], the event fails and a lower priority SOTE is selected.
 * this event is repeatable. This means unless there's a higher priority SOTE coming in, it will happen every turn.

The random commander selection function is not really random in the sense that reloading won't change the outcome. So how do we change it? Random commander selection is dependent on a global variable, that is also used to determine the success of assassination attempts. This means that whenever you try to assassinate a unit in battle, this variable will be changed.

tl;dr: If you get this event, try reloading to the last save and use / (don't use if you already did) assassinate in your next battle or fight less battles at the end of your turn and you might get a different event.

"Rance is mad about Shimazu"

 * prerequisites: "Rance hears report about defection"
 * preventable: yes, don't let a female commander defect, see above.

"Shimazu brothers surrender"

 * prerequisites: Kurohime has been kidnapped
 * preventable: yes, don't kidnap Kurohime.

"Ashikaga conquers smaller countries"

 * prerequisites: at war with Ashikaga
 * preventable: yes, defeat Ashikaga before this event is triggered 

"Gossip about Ashikaga Choushin"
Note: Due to the amount of unskippable initial SOTE, these can only trigger at turn 9 (10 if you haven't H'd Sill manually), so you have to defeat Ashikaga before turn 8 is over.
 * prerequisites: at war with Ashikaga
 * preventable: yes, defeat Ashikaga before this event is triggered

Full House events
These events always happen, when you've hired all important commanders of a certain house and you will get a "good medicine" item.

The following events exist:
 * Takuga (Sakamoto Ryouma, Gon, Kawanoe Mine, Kawanoe Yuzuru)

They are preventable by not having certain characters.
 * Uesugi (Uesugi Kenshin, Naoe Ai)
 * Ashikaga (Ashikaga Choushin, Ikkyu)
 * Asai-Asakura (Asakura Yoshikage, Yukihime)
 * Tanegashima (Yuzuhara Yuzumi, Tanegashima Shigehiko)
 * Tenshiism (Seigan, Genri)
 * One eyed House (Dokuganryu Masamune, Omachi, Nogiku, Orime, Noir)
 * Tokugawa (Tokugawa Ieyasu, Sill, Sakai Tadatsugu, Honda Tadakatsu, Sakakibara Yasumasa, Ii Naomasa, Hattori Hanzou)
 * Shimazu (Shimazu Yoshihisa, Shimazu Kazuhisa, Shimazu Iehisa, Shimazu Toshihisa)
 * Zeth (Rizna, Magic, Uruza)
 * Leazas (Leila, Maria, Kentou Kanami)
 * It is very convenient that both Mouri and Takeda don't have these events, since they are always chosen as 2nd game house bonuses and we don't want to kick their commanders early in the game.
 * If we decide to get Zeth reinforcements, we need to kick Rizna immediately after getting Magic to prevent Zeth's Full House event from happening on the next turn.
 * The Leazas event is not a problem either, since we don't want to get Leila. Her arrival comes way too late and you have to keep Kenshin around until you clear her.
 * Preventing the Uesugi Full House event is more tricky. It is highly likely that it will trigger immediately after the turn in which Naoe Ai joins. Since she just joined, we can't kick her though, because her unit is exhausted. The Chinese players have found a workaround in the 323 point run. They reactivate Naoe Ai with a motivational paper, go on a quick botan hunt in Sado and kick her and Kenshin before the turn ends.

"Fans of Daidouji Komatsu demand her release"

 * prerequisites: Daidouji Komatsu is in your prison
 * preventable: yes, release her. Alternatively you can keep her for the SAT, but this SOTE will usually trigger after you've already gotten four fans and then it's useless.

"Yuzuhara talks about the Akashita Dog"
THIS NEEDS MORE RESEARCH. I see many generic commander affection up SOTE between her joining and the end of the game, which should have lower priority. Just keeping her affection points at 0 also isn't a possibility since we are going to use +3 SAT affection bonuses. This sentence in the 323 point run is key and I can't make sense of it: 挤掉了柚圆柚美丹下犬事件1扇【通过退2回合sl达成】
 * prerequisites: Yuzuhara Yuzumi in your roster, Akashita Dog hasn't been found (even if you have the item, the search event will still be untriggered), her number of affection points > 0
 * preventable: Technically yes. Not recruiting Yuzuhara would be a start. The problem is that she's fantastic for the 160 SAT grind, so we don't really want to go without her. Chinese players managed to push this SOTE out

"Sill turn 11 event"

 * prerequisites: # turns > 10
 * preventable: no

"Sill turn 21 event"

 * prerequisites: # turns > 20
 * preventable: no

"Sill turn 31 event"

 * prerequisites: # turns > 30
 * preventable: no

"Sill turn 41 event"
''Note: These Sill events don't have to be a complete waste! Bring Rance up to 7 Affection before they trigger and you will get two levels for free.''
 * prerequisites: # turns > 40
 * preventable: Technically, yes. The 323 point run finished on turn 43, and this event was prevented from happening by a commander joining and the 6 treasure event playing.

"Kouhime event #1"

 * prerequisites: none
 * preventable: yes, activate manually

"Kouhime event #2"

 * prerequisites: none
 * preventable: yes, activate manually

"Kouhime event #3"

 * prerequisites: Shibata Katsui
 * preventable: yes, kick Shibata Katsui before it triggers

"Kouhime event #4"

 * prerequisites: none
 * preventable: yes, activate manually

"Inukai trains Suzume"

 * prerequisites: Inukai in roster
 * preventable: Technically yes. Just get Inukai very late in the game just before you finish and there won't be time for the event to trigger. This is done in the 323 point run.

"Inukai trains Kanami"

 * prerequisites: Inukai & Kanami in roster
 * preventable: yes, don't get Kanami. If you do want to get her, the above applies as well.

"Yuzuhara plays with Inukai's dogs"

 * prerequisites: Inukai & Kanami in roster
 * preventable: yes. Same way you remove "Inukai trains Suzume"

"[Commander] first purple events"

 * prerequisites: These will happen with all commanders that have purple events. In the following cases we don't want these to happen: the Takeda generals, Motonari, Kenshin and Rizna.
 * preventable: yes. Fire them before these get triggered. The 323 point run has higher priority SOTE till turn 29.

"[Commander] affection up"

 * prerequisites: These will happen with all commanders that don't have initial purple events, but gathered 7 affection point . In the following cases we don't want these to happen: Naoe Ai and Mouri Teru (if you don't want her for SAT)
 * preventable: yes. Fire them before they get to 7 affection.

"[Generic Commander] affection up"

 * prerequisites: A generic commander has 7 affection points.
 * preventable: yes. First of all, why would we want this to NOT happen? Unlike other commanders, non-generic commanders don't have a function that checks if a certain event has already been. This means an already cleared commander can still trigger this SOTE when at 7 affection. Notorious offenders for this are generic commanders that have been given Rance's Love early in the game.

Conclusion
If you want to use start of turn events effectively here are some guidelines:
 * Always have SOTEs that are desirable to you queued up - Have 7 affection on a commander you would like to clear.
 * Manually activate Sill and Kouhime events at the start if you have idle time
 * Fire commanders which are unclearable or can't be given end game points before they can trigger their SOTE
 * Don't let Shimazu steal your women (you shouldn't let this happen regardless)

Next we will give lists of commanders sorted by the priority of their commander events and their joining events.

Commander event priorities

 * 1) Sill
 * 2) Suzume
 * 3) Kouhime
 * 4) Genri
 * 5) Seigan
 * 6) Yuzuhara Yuzumi
 * 7) Tanegashima Shigehiko
 * 8) Senhime
 * 9) Hara Shouji
 * 10) Akihime
 * 11) Ashikaga Choushin
 * 12) Ikkyu
 * 13) Mouri Teru
 * 14) Kikkawa Kiku
 * 15) Kobayakawa Chinu
 * 16) Shibata Katsuie
 * 17) Ranmaru
 * 18) Akashi Kazemaru
 * 19) Natori
 * 20) Tamagushi Fuuka
 * 21) Naoe Ai
 * 22) Okita Nozomi
 * 23) Sakamoto Ryouma
 * 24) Gon
 * 25) Kawanoe Yuzuru
 * 26) Kawanoe Mine
 * 27) Houjou Souun
 * 28) Daidouji Komatsu
 * 29) Kentou Kanami
 * 30) Maria
 * 31) Leila
 * 32) Rizna
 * 33) Uruza
 * 34) Magic
 * 35) Dokuganryu Masamune
 * 36) Agireda
 * 37) Shimazu Yoshihisa
 * 38) Shimazu Kazuhisa
 * 39) Shimazu Toshihisa
 * 40) Shimazu Iehisa
 * 41) Asakura Yoshikage
 * 42) Yukihime
 * 43) Inukai
 * 44) TokugawaIeyasu
 * 45) Mouri Motonari
 * 46) Sanada Tourin
 * 47) Yamagata Masakage
 * 48) Baba Shouen
 * 49) Kousaka Yoshikage
 * 50) Gekkou
 * 51) Masou Shizuka
 * 52) Yamamoto Isoroku
 * 53) Uesugi Kenshin
 * 54) Nanjou Ran

Note 1: Non-generic commanders not listed here don't have start of turn events.

''Note 2: Start of turn events don't have some of the restrictions that manually activated events have. For example manually activating Kikkawa Kikku's events requires the player to occupy at least some of the Mouri House's properties, while her start of turn events can play without this being the case.''

"Commander joins" event priorities

 * 1) Uesugi Kenshin
 * 2) Naoe Ai
 * 3) Okita Nozomi
 * 4) Houjou Souun
 * 5) Dokuganryu Masamune
 * 6) Seigan
 * 7) Genri
 * 8) Tokugawa Ieyasu
 * 9) Kentou Kanami
 * 10) Maria
 * 11) Leila
 * 12) Rizna
 * 13) Uruza
 * 14) Magic
 * 15) Masou Shizuka

Note: Other joining events like Suzume, Kouhime or Kentaro joining have higher priorities and aren't listed here.