1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
use crate::{
parse::Token,
utils::{map::*, DynString},
};
use super::{Condition, Effect};
pub struct Trigger {}
impl Trigger {
pub fn template() -> Token {
let mut root = LinkedHashMap::with_capacity(19);
root.push_back("enabled", 1_u32);
root.push_back("looping", 0_i8);
root.push_back("description_string_table_id", 0_i32);
root.push_back("display_as_objective", 0_u8);
root.push_back("objective_description_order", 0_u32);
root.push_back("make_header", 0_u8);
root.push_back("short_description_string_table_id", 0_i32);
root.push_back("display_on_screen", 0_u8);
root.push_back("unknown", vec![0_u8.into(); 5]);
root.push_back("mute_objectives", 0_u8);
root.push_back("trigger_description", DynString::with_capacity(0_u32, ""));
root.push_back("trigger_name", DynString::with_capacity(0_u32, ""));
root.push_back("short_description", DynString::with_capacity(0_u32, ""));
root.push_back("number_of_effects", 0_i32);
root.push_back("effect_data", vec![Effect::template(); 1]);
root.patches.insert(
"effect_data".to_string(),
NumericPatch {
source: vec!["number_of_effects".to_string()],
dep_type: DepType::Calculate,
manipulation: Manipulation::Equal,
},
);
root.push_back("effect_display_order_array", vec![0_i32.into()]);
root.patches.insert(
"effect_display_order_array".to_string(),
NumericPatch {
source: vec!["number_of_effects".to_string()],
dep_type: DepType::Calculate,
manipulation: Manipulation::Equal,
},
);
root.push_back("number_of_conditions", 0_i32);
root.push_back("condition_data", vec![Condition::template(); 1]);
root.patches.insert(
"condition_data".to_string(),
NumericPatch {
source: vec!["number_of_conditions".to_string()],
dep_type: DepType::Calculate,
manipulation: Manipulation::Equal,
},
);
root.push_back("condition_display_order_array", vec![0_i32.into()]);
root.patches.insert(
"condition_display_order_array".to_string(),
NumericPatch {
source: vec!["number_of_conditions".to_string()],
dep_type: DepType::Calculate,
manipulation: Manipulation::Equal,
},
);
root.into()
}
}