use crate::types::*;
use crate::scene::types::StateEffect;
use crate::state::store::StateStore;
use crate::state::types::GameState;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum JumpPoint {
PrologueStart,
PrologueArroyo,
PrologueCampfire,
CedarWakeStart,
CedarWakeShootingPost,
CedarWakeBanditCamp,
BitterCutDispatch,
BitterCutFight,
ConvoyStart,
RedSwitchWash,
HollowPump,
ConvoyNight2,
RelayArrival,
RelayTriage,
}
impl JumpPoint {
pub fn create_state(&self) -> GameState {
match self {
JumpPoint::PrologueStart => GameState::new_game(),
JumpPoint::PrologueArroyo => {
let mut state = GameState::new_game();
state.beat = BeatId::new("p7");
state.apply_effect(&StateEffect::AddMemoryObject(MemoryObjectId::new("wanted_poster")));
state.apply_effect(&StateEffect::SetFlag {
id: FlagId::new("tore_poster"), value: FlagValue::Bool(true),
});
state.apply_effect(&StateEffect::AdjustReputation {
axis: ReputationAxis::TownLaw, delta: 5,
});
state
}
JumpPoint::PrologueCampfire => {
let mut state = Self::PrologueArroyo.create_state();
state.beat = BeatId::new("p8");
state.apply_effect(&StateEffect::SetFlag {
id: FlagId::new("arroyo_survived"), value: FlagValue::Bool(true),
});
state
}
JumpPoint::CedarWakeStart => {
let mut state = GameState::new_game();
state.chapter = ChapterId::new("ch1");
state.beat = BeatId::new("1a1");
state.age_phase = AgePhase::Youth;
state.party.members.retain(|m| m.id.0 == "galen");
if let Some(galen) = state.party.members.iter_mut().find(|m| m.id.0 == "galen") {
galen.unlocked_skills = vec![
SkillId::new("quick_draw"),
SkillId::new("snap_shot"),
SkillId::new("duck"),
SkillId::new("sprint"),
];
}
state
}
JumpPoint::CedarWakeShootingPost => {
let mut state = Self::CedarWakeStart.create_state();
state.beat = BeatId::new("1b1");
state.apply_effect(&StateEffect::SetFlag {
id: FlagId::new("met_molly"), value: FlagValue::Bool(true),
});
state.apply_effect(&StateEffect::SetFlag {
id: FlagId::new("met_declan"), value: FlagValue::Bool(true),
});
state.apply_effect(&StateEffect::UnlockSkill {
character: CharacterId::new("galen"),
skill: SkillId::new("trail_eye"),
});
state
}
JumpPoint::CedarWakeBanditCamp => {
let mut state = Self::CedarWakeShootingPost.create_state();
state.beat = BeatId::new("1b7");
state.apply_effect(&StateEffect::UnlockSkill {
character: CharacterId::new("galen"),
skill: SkillId::new("steady_aim"),
});
state.apply_effect(&StateEffect::SetFlag {
id: FlagId::new("voss_taught_steady_aim"), value: FlagValue::Bool(true),
});
state.apply_effect(&StateEffect::SetFlag {
id: FlagId::new("horse_thief_done"), value: FlagValue::Bool(true),
});
state
}
JumpPoint::BitterCutDispatch => {
let mut state = Self::CedarWakeBanditCamp.create_state();
state.beat = BeatId::new("1c1");
state.apply_effect(&StateEffect::SetFlag {
id: FlagId::new("bandit_camp_done"), value: FlagValue::Bool(true),
});
state.apply_effect(&StateEffect::SetFlag {
id: FlagId::new("clean_work"), value: FlagValue::Bool(true),
});
state
}
JumpPoint::BitterCutFight => {
let mut state = Self::BitterCutDispatch.create_state();
state.beat = BeatId::new("1c4");
state.apply_effect(&StateEffect::SetFlag {
id: FlagId::new("carrying_dispatch"), value: FlagValue::Bool(true),
});
state
}
JumpPoint::ConvoyStart => {
let mut state = Self::BitterCutFight.create_state();
state.chapter = ChapterId::new("ch2");
state.beat = BeatId::new("2d1");
state.age_phase = AgePhase::YoungMan;
state.party.members.retain(|m| m.id.0 == "galen");
if let Some(galen) = state.party.members.iter_mut().find(|m| m.id.0 == "galen") {
galen.unlocked_skills = vec![
SkillId::new("quick_draw"),
SkillId::new("snap_shot"),
SkillId::new("duck"),
SkillId::new("steady_aim"),
SkillId::new("trail_eye"),
SkillId::new("called_shot_basic"),
SkillId::new("cold_read"),
SkillId::new("grit"),
];
}
state.flags.insert("chapter1_complete".to_string(), FlagValue::Bool(true));
state.flags.insert("bitter_cut_done".to_string(), FlagValue::Bool(true));
state
}
JumpPoint::RedSwitchWash => {
let mut state = Self::ConvoyStart.create_state();
state.beat = BeatId::new("2d1_wash");
state.flags.insert("formation".to_string(), FlagValue::Text("scout".to_string()));
state
}
JumpPoint::HollowPump => {
let mut state = Self::RedSwitchWash.create_state();
state.beat = BeatId::new("2d2");
state.flags.insert("wash_survived".to_string(), FlagValue::Bool(true));
state
}
JumpPoint::ConvoyNight2 => {
let mut state = Self::HollowPump.create_state();
state.beat = BeatId::new("2n2");
state.flags.insert("pump_resolved".to_string(), FlagValue::Bool(true));
state.flags.insert("took_flask".to_string(), FlagValue::Bool(true));
state.memory_objects.push(crate::state::types::MemoryObject {
id: MemoryObjectId::new("nella_coffee"),
state: "active".to_string(),
});
state.memory_objects.push(crate::state::types::MemoryObject {
id: MemoryObjectId::new("eli_flask"),
state: "active".to_string(),
});
state
}
JumpPoint::RelayArrival => {
let mut state = Self::ConvoyNight2.create_state();
state.beat = BeatId::new("2d3");
state.memory_objects.push(crate::state::types::MemoryObject {
id: MemoryObjectId::new("nella_bath_bread_roof"),
state: "active".to_string(),
});
state.memory_objects.push(crate::state::types::MemoryObject {
id: MemoryObjectId::new("nella_biscuit_cloth"),
state: "active".to_string(),
});
state
}
JumpPoint::RelayTriage => {
let mut state = Self::RelayArrival.create_state();
state.flags.insert("relay_survived".to_string(), FlagValue::Bool(true));
state.flags.insert("bale_dead".to_string(), FlagValue::Bool(true));
state
}
}
}
pub fn all() -> &'static [JumpPoint] {
&[
JumpPoint::PrologueStart,
JumpPoint::PrologueArroyo,
JumpPoint::PrologueCampfire,
JumpPoint::CedarWakeStart,
JumpPoint::CedarWakeShootingPost,
JumpPoint::CedarWakeBanditCamp,
JumpPoint::BitterCutDispatch,
JumpPoint::BitterCutFight,
JumpPoint::ConvoyStart,
JumpPoint::RedSwitchWash,
JumpPoint::HollowPump,
JumpPoint::ConvoyNight2,
JumpPoint::RelayArrival,
JumpPoint::RelayTriage,
]
}
pub fn label(&self) -> &'static str {
match self {
Self::PrologueStart => "Prologue — Start",
Self::PrologueArroyo => "Prologue — Glass Arroyo",
Self::PrologueCampfire => "Prologue — Campfire Choice",
Self::CedarWakeStart => "Ch1 — Cedar Wake Arrival",
Self::CedarWakeShootingPost => "Ch1 — Shooting Post",
Self::CedarWakeBanditCamp => "Ch1 — Bandit Camp",
Self::BitterCutDispatch => "Ch1 — Bitter Cut Dispatch",
Self::BitterCutFight => "Ch1 — Bitter Cut Fight",
Self::ConvoyStart => "Ch2 — Convoy Join",
Self::RedSwitchWash => "Ch2 — Red Switch Wash",
Self::HollowPump => "Ch2 — Hollow Pump",
Self::ConvoyNight2 => "Ch2 — Night 2 Camp",
Self::RelayArrival => "Ch2 — Relay Arrival",
Self::RelayTriage => "Ch2 — Relay Triage",
}
}
}