Broaden whole-game packed event coverage
This commit is contained in:
parent
991725dba8
commit
b89463d227
19 changed files with 1874 additions and 27 deletions
|
|
@ -710,6 +710,12 @@ fn evaluate_record_conditions(
|
|||
return Ok(None);
|
||||
}
|
||||
}
|
||||
RuntimeCondition::WorldFlagEquals { key, value } => {
|
||||
let actual = state.world_flags.get(key).copied().unwrap_or(false);
|
||||
if actual != *value {
|
||||
return Ok(None);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1889,6 +1895,10 @@ mod tests {
|
|||
economic_status_code: Some(3),
|
||||
..RuntimeWorldRestoreState::default()
|
||||
},
|
||||
world_flags: BTreeMap::from([(
|
||||
String::from("world.disable_stock_buying_and_selling"),
|
||||
true,
|
||||
)]),
|
||||
candidate_availability: BTreeMap::from([(String::from("Mogul"), 2)]),
|
||||
special_conditions: BTreeMap::from([(String::from("Use Wartime Cargos"), 1)]),
|
||||
event_runtime_records: vec![
|
||||
|
|
@ -1915,6 +1925,10 @@ mod tests {
|
|||
comparator: RuntimeConditionComparator::Eq,
|
||||
value: 3,
|
||||
},
|
||||
RuntimeCondition::WorldFlagEquals {
|
||||
key: "world.disable_stock_buying_and_selling".to_string(),
|
||||
value: true,
|
||||
},
|
||||
],
|
||||
effects: vec![RuntimeEffect::SetWorldFlag {
|
||||
key: "world_condition_passed".to_string(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue