pub struct BackgroundScheme {
pub initiator: String,
pub target: String,
pub scheme_type: String,
pub progress: f64,
pub threshold: f64,
pub phase: SchemePhase,
pub advantages: Vec<String>,
}Expand description
State of an ongoing background scheme.
Created with BackgroundScheme::new, advanced over time via
BackgroundScheme::advance, and converted to a final
EncounterResult via BackgroundScheme::to_result once the phase
reaches SchemePhase::Resolved.
Fields§
§initiator: StringThe character running the scheme.
target: StringThe character the scheme is directed against.
scheme_type: StringIdentifier for the type of scheme (e.g. "assassination").
progress: f64Accumulated progress toward the threshold.
threshold: f64Progress value at which the scheme resolves.
phase: SchemePhaseCurrent phase of the scheme lifecycle.
advantages: Vec<String>Labels describing situational advantages held by the initiator.
Implementations§
Source§impl BackgroundScheme
impl BackgroundScheme
Sourcepub fn new(
initiator: String,
target: String,
scheme_type: String,
threshold: f64,
) -> Self
pub fn new( initiator: String, target: String, scheme_type: String, threshold: f64, ) -> Self
Create a new scheme in the SchemePhase::Preparation phase with zero progress.
Sourcepub fn advance(&mut self, delta: f64) -> bool
pub fn advance(&mut self, delta: f64) -> bool
Advance progress. Returns true if scheme resolved this tick.
Calling advance on an already-resolved scheme is a no-op (returns
false and does not change progress or phase). Phase transitions are
one-way: Preparation → Execution → Resolved.
Sourcepub fn add_advantage(&mut self, label: String)
pub fn add_advantage(&mut self, label: String)
Record an advantage label for the initiator.
Sourcepub fn to_result(
&self,
success_effects: Vec<Effect>,
failure_effects: Vec<Effect>,
) -> EncounterResult
pub fn to_result( &self, success_effects: Vec<Effect>, failure_effects: Vec<Effect>, ) -> EncounterResult
Convert resolved scheme to an EncounterResult with one beat.
The resulting beat carries either the success or failure effects
depending on whether the scheme reached SchemePhase::Resolved.
The same escalation check used by crate::resolution::MultiBeat
runs on the resolution beat — high-magnitude relationship deltas or
emotion intensities populate result.escalation_requests, since the
resolution beat of a scheme is often the most consequential moment in
the encounter.
Trait Implementations§
Source§impl Clone for BackgroundScheme
impl Clone for BackgroundScheme
Source§fn clone(&self) -> BackgroundScheme
fn clone(&self) -> BackgroundScheme
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more