14#define CALLTYPE __vectorcall
19template<
typename A,
typename B>
20[[nodiscard]]
auto compare_values(uint16_t trigger_code, A value_a,
B value_b) ->
decltype(value_a == value_b) {
23 return value_a == value_b;
25 return value_a > value_b;
27 return value_a < value_b;
29 return value_a <= value_b;
31 return value_a != value_b;
33 return value_a >= value_b;
35 return value_a >= value_b;
39template<
typename A,
typename B>
40[[nodiscard]]
auto compare_values_eq(uint16_t trigger_code, A value_a,
B value_b) ->
decltype(value_a == value_b) {
43 return value_a == value_b;
45 return value_a != value_b;
47 return value_a != value_b;
49 return value_a == value_b;
51 return value_a != value_b;
53 return value_a == value_b;
55 return value_a == value_b;
60[[nodiscard]]
auto compare_values_eq(uint16_t trigger_code, dcon::nation_fat_id value_a,
B value_b)
61 ->
decltype(value_a.id == value_b) {
64 return value_a.id == value_b;
66 return value_a.id != value_b;
68 return value_a.id != value_b;
70 return value_a.id == value_b;
72 return value_a.id != value_b;
74 return value_a.id == value_b;
76 return value_a.id == value_b;
81[[nodiscard]]
auto compare_to_true(uint16_t trigger_code, A value_a) ->
decltype(!value_a) {
100[[nodiscard]]
auto compare_to_false(uint16_t trigger_code, A value_a) ->
decltype(!value_a) {
127 pack_float.v.low = data[0];
128 pack_float.v.high = data[1];
141 pack_float.v.low = data[0];
142 pack_float.v.high = data[1];
154 using type = ve::tagged_vector<int32_t>;
159 using type = ve::tagged_vector<int32_t>;
164 using type = ve::tagged_vector<int32_t>;
170template<
typename return_type,
typename primary_type,
typename this_type,
typename from_type>
172 from_type from_slot);
174#define TRIGGER_FUNCTION(function_name) \
175 template<typename return_type, typename primary_type, typename this_type, typename from_type> \
176 return_type CALLTYPE function_name(uint16_t const* tval, sys::state& ws, primary_type primary_slot, this_type this_slot, \
184 static constexpr bool value =
true;
188 static constexpr ve::vbitfield_type value = ve::vbitfield_type{ve::vbitfield_type::storage(-1)};
196 static constexpr bool value =
false;
200 static constexpr ve::vbitfield_type value = ve::vbitfield_type{ve::vbitfield_type::storage(0)};
206bool compare(ve::vbitfield_type a, ve::vbitfield_type b) {
214 return_type result = return_type(
false);
215 while(sub_units_start < tval + source_size) {
216 result = result | test_trigger_generic<return_type, primary_type, this_type, from_type>(sub_units_start, ws, primary_slot, this_slot, from_slot);
229 return_type result = return_type(
true);
230 while(sub_units_start < tval + source_size) {
231 result = result & test_trigger_generic<return_type, primary_type, this_type, from_type>(sub_units_start, ws, primary_slot, this_slot, from_slot);
242 return apply_disjuctively<return_type, primary_type, this_type, from_type>(tval, ws, primary_slot, this_slot, from_slot);
244 return apply_conjuctively<return_type, primary_type, this_type, from_type>(tval, ws, primary_slot, this_slot, from_slot);
248 return return_type(
true);
251 return return_type(
true);
255 return apply_subtriggers<return_type, primary_type, this_type, from_type>(tval, ws, primary_slot, this_slot, from_slot);
261 ve::tagged_vector<int32_t> value;
263 int32_t accumulated_mask = 0;
272 accumulated_mask |= (int32_t(v != -1) << index);
273 value.set(index++, v);
275 if(index == ve::vector_size) {
277 value = ve::tagged_vector<int32_t>();
279 accumulated_mask = 0;
284 if(index != 0 && !
result) {
294 ve::tagged_vector<int32_t> value;
296 int32_t accumulated_mask = 0;
305 accumulated_mask |= (int32_t(v != -1) << index);
306 value.set(index++, v);
308 if(index == ve::vector_size) {
310 value = ve::tagged_vector<int32_t>();
312 accumulated_mask = 0;
317 if(index != 0 &&
result) {
324template<
typename TAG,
typename F>
328 ve::tagged_vector<TAG> store;
331 int32_t accumulated_mask = 0;
337 accumulated_mask |= (int32_t(is_valid_index(v)) << index);
338 store.set(index++, v);
340 if(index == ve::vector_size) {
341 value = value +
ve::select(accumulated_mask, F::operator()(store), 0.0f);
343 accumulated_mask = 0;
348 value = value +
ve::select(accumulated_mask, F::operator()(store), 0.0f);
352 return value.reduce();
366template<
typename TAG,
typename F>
373 return apply_subtriggers<ve::mask_vector, ve::tagged_vector<int32_t>, int32_t, int32_t>(tval, ws, v, this_slot, from_slot);
379 return apply_subtriggers<ve::mask_vector, ve::tagged_vector<int32_t>, int32_t, int32_t>(tval, ws, v, this_slot, from_slot);
385 [&ws, tval](int32_t prov_id, int32_t t_slot, int32_t f_slot) {
386 auto prov_tag =
to_prov(prov_id);
391 for(
auto adj : ws.world.province_get_province_adjacency(prov_tag)) {
393 auto other = adj.get_connected_provinces(prov_tag == adj.get_connected_provinces(0) ? 1 : 0).id;
399 return accumulator.result;
403 for(
auto adj : ws.world.province_get_province_adjacency(prov_tag)) {
405 auto other = adj.get_connected_provinces(prov_tag == adj.get_connected_provinces(0) ? 1 : 0).id;
411 return accumulator.result;
414 primary_slot, this_slot, from_slot);
418 [&ws, tval](int32_t s_id, int32_t t_slot, int32_t f_slot) {
421 std::vector<dcon::province_id> vadj;
424 for(
auto p : ws.world.state_definition_get_abstract_state_membership(ws.world.state_instance_get_definition(state_tag))) {
425 if(p.get_province().get_state_membership() == state_tag) {
426 for(
auto adj : p.get_province().get_province_adjacency()) {
428 auto other = (p.get_province() == adj.get_connected_provinces(0)) ? adj.get_connected_provinces(1).id : adj.get_connected_provinces(0).id;
429 if(std::find(vadj.begin(), vadj.end(), other) == vadj.end())
430 vadj.push_back(other);
443 return accumulator.result;
451 return accumulator.result;
454 primary_slot, this_slot, from_slot);
458 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
464 for(
auto adj : ws.world.nation_get_nation_adjacency(nid)) {
465 auto iid = (nid == adj.get_connected_nations(0)) ? adj.get_connected_nations(1).id : adj.get_connected_nations(0).id;
468 if(accumulator.result)
473 return accumulator.result;
476 for(
auto adj : ws.world.nation_get_nation_adjacency(nid)) {
477 auto iid = (nid == adj.get_connected_nations(0)) ? adj.get_connected_nations(1).id : adj.get_connected_nations(0).id;
480 if(!accumulator.result)
485 return accumulator.result;
488 primary_slot, this_slot, from_slot);
491 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
492 auto province_owner = ws.world.province_get_nation_from_province_ownership(location);
494 return tf_x_neighbor_country_scope_nation<return_type>(tval, ws,
to_generic(province_owner), this_slot, from_slot);
498 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
504 for(
auto wars_in : ws.world.nation_get_war_participant(nid)) {
505 auto is_attacker = wars_in.get_is_attacker();
506 for(
auto o : wars_in.get_war().get_war_participant()) {
507 if(o.get_is_attacker() != is_attacker && o.get_nation() != nid) {
508 accumulator.add_value(
to_generic(o.get_nation().id));
509 if(accumulator.result)
516 return accumulator.result;
520 for(
auto wars_in : ws.world.nation_get_war_participant(nid)) {
521 auto is_attacker = wars_in.get_is_attacker();
522 for(
auto o : wars_in.get_war().get_war_participant()) {
523 if(o.get_is_attacker() != is_attacker && o.get_nation() != nid) {
524 accumulator.add_value(
to_generic(o.get_nation().id));
525 if(!accumulator.result)
532 return accumulator.result;
535 primary_slot, this_slot, from_slot);
538 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
539 auto province_owner = ws.world.province_get_nation_from_province_ownership(location);
541 return tf_x_war_countries_scope_nation<return_type>(tval, ws,
to_generic(province_owner), this_slot, from_slot);
545 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
550 for(
auto n : ws.world.in_nation) {
551 if(n.get_owned_province_count() != 0) {
553 if(accumulator.result)
559 return accumulator.result;
563 for(
auto n : ws.world.in_nation) {
564 if(n.get_owned_province_count() != 0) {
566 if(!accumulator.result)
572 return accumulator.result;
575 primary_slot, this_slot, from_slot);
579 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
586 for(
uint32_t i = 0; i < ws.nations_by_rank.size() && added < great_nations_count; ++i) {
589 accumulator.add_value(
to_generic(ws.nations_by_rank[i]));
590 if(accumulator.result)
596 return accumulator.result;
601 for(
uint32_t i = 0; i < ws.nations_by_rank.size() && added < great_nations_count; ++i) {
604 accumulator.add_value(
to_generic(ws.nations_by_rank[i]));
605 if(!accumulator.result)
611 return accumulator.result;
614 primary_slot, this_slot, from_slot);
618 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
620 dcon::state_definition_fat_id state_def = fatten(ws.world, ws.world.state_instance_get_definition(sid));
621 auto owner = ws.world.state_instance_get_nation_from_state_ownership(sid);
626 for(
auto p : state_def.get_abstract_state_membership()) {
627 if(p.get_province().get_nation_from_province_ownership() == owner) {
628 accumulator.add_value(
to_generic(p.get_province().id));
629 if(accumulator.result)
635 return accumulator.result;
639 for(
auto p : state_def.get_abstract_state_membership()) {
640 if(p.get_province().get_nation_from_province_ownership() == owner) {
641 accumulator.add_value(
to_generic(p.get_province().id));
642 if(!accumulator.result)
648 return accumulator.result;
651 primary_slot, this_slot, from_slot);
655 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
656 auto nid = fatten(ws.world,
to_nation(p_slot));
661 for(
auto p : nid.get_province_ownership()) {
662 accumulator.add_value(
to_generic(p.get_province().id));
663 if(accumulator.result)
668 return accumulator.result;
672 for(
auto p : nid.get_province_ownership()) {
673 accumulator.add_value(
to_generic(p.get_province().id));
674 if(!accumulator.result)
679 return accumulator.result;
682 primary_slot, this_slot, from_slot);
686 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
687 dcon::province_fat_id pid = fatten(ws.world,
to_prov(p_slot));
692 for(
auto p : pid.get_core()) {
693 auto holder = p.get_identity().get_nation_from_identity_holder();
696 if(accumulator.result)
702 return accumulator.result;
706 for(
auto p : pid.get_core()) {
707 auto holder = p.get_identity().get_nation_from_identity_holder();
710 if(!accumulator.result)
716 return accumulator.result;
719 primary_slot, this_slot, from_slot);
723 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
724 auto nid = fatten(ws.world,
to_nation(p_slot));
725 auto ident = nid.get_identity_holder_as_nation().get_identity();
730 for(
auto p :
ident.get_core()) {
731 accumulator.add_value(
to_generic(p.get_province().id));
732 if(accumulator.result)
737 return accumulator.result;
741 for(
auto p :
ident.get_core()) {
742 accumulator.add_value(
to_generic(p.get_province().id));
743 if(!accumulator.result)
748 return accumulator.result;
751 primary_slot, this_slot, from_slot);
756 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
757 auto nid = fatten(ws.world,
to_nation(p_slot));
762 for(
auto s : nid.get_state_ownership()) {
763 accumulator.add_value(
to_generic(s.get_state().id));
764 if(accumulator.result)
769 return accumulator.result;
773 for(
auto s : nid.get_state_ownership()) {
774 accumulator.add_value(
to_generic(s.get_state().id));
775 if(!accumulator.result)
780 return accumulator.result;
783 primary_slot, this_slot, from_slot);
787 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
788 auto nid = fatten(ws.world,
to_nation(p_slot));
793 for(
auto v : nid.get_overlord_as_ruler()) {
794 if(v.get_subject().get_is_substate()) {
795 accumulator.add_value(
to_generic(v.get_subject().id));
796 if(accumulator.result)
802 return accumulator.result;
806 for(
auto v : nid.get_overlord_as_ruler()) {
807 if(v.get_subject().get_is_substate()) {
808 accumulator.add_value(
to_generic(v.get_subject().id));
809 if(!accumulator.result)
815 return accumulator.result;
818 primary_slot, this_slot, from_slot);
822 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
823 auto nid = fatten(ws.world,
to_nation(p_slot));
828 for(
auto gpr : nid.get_gp_relationship_as_great_power()) {
830 accumulator.add_value(
to_generic(gpr.get_influence_target().id));
831 if(accumulator.result)
837 return accumulator.result;
841 for(
auto gpr : nid.get_gp_relationship_as_great_power()) {
843 accumulator.add_value(
to_generic(gpr.get_influence_target().id));
844 if(!accumulator.result)
850 return accumulator.result;
853 primary_slot, this_slot, from_slot);
857 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
858 dcon::province_fat_id pid = fatten(ws.world,
to_prov(p_slot));
863 for(
auto i : pid.get_pop_location()) {
864 accumulator.add_value(
to_generic(i.get_pop().id));
865 if(accumulator.result)
870 return accumulator.result;
874 for(
auto i : pid.get_pop_location()) {
875 accumulator.add_value(
to_generic(i.get_pop().id));
876 if(!accumulator.result)
881 return accumulator.result;
884 primary_slot, this_slot, from_slot);
888 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
890 dcon::state_definition_fat_id state_def = fatten(ws.world, ws.world.state_instance_get_definition(sid));
891 auto owner = ws.world.state_instance_get_nation_from_state_ownership(sid);
896 for(
auto p : state_def.get_abstract_state_membership()) {
897 if(p.get_province().get_nation_from_province_ownership() == owner) {
898 for(
auto i : p.get_province().get_pop_location()) {
899 accumulator.add_value(
to_generic(i.get_pop().id));
900 if(accumulator.result)
907 return accumulator.result;
911 for(
auto p : state_def.get_abstract_state_membership()) {
912 if(p.get_province().get_nation_from_province_ownership() == owner) {
913 for(
auto i : p.get_province().get_pop_location()) {
914 accumulator.add_value(
to_generic(i.get_pop().id));
915 if(!accumulator.result)
922 return accumulator.result;
925 primary_slot, this_slot, from_slot);
929 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
930 auto nid = fatten(ws.world,
to_nation(p_slot));
935 for(
auto p : nid.get_province_ownership()) {
936 for(
auto i : p.get_province().get_pop_location()) {
937 accumulator.add_value(
to_generic(i.get_pop().id));
938 if(accumulator.result)
944 return accumulator.result;
948 for(
auto p : nid.get_province_ownership()) {
949 for(
auto i : p.get_province().get_pop_location()) {
950 accumulator.add_value(
to_generic(i.get_pop().id));
951 if(!accumulator.result)
957 return accumulator.result;
960 primary_slot, this_slot, from_slot);
966 [&ws, tval, state_def](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
970 for(
auto i : ws.world.state_definition_get_abstract_state_membership(state_def)) {
971 accumulator.add_value(
to_generic(i.get_province().id));
972 if(accumulator.result)
977 return accumulator.result;
981 for(
auto i : ws.world.state_definition_get_abstract_state_membership(state_def)) {
982 accumulator.add_value(
to_generic(i.get_province().id));
983 if(!accumulator.result)
988 return accumulator.result;
991 primary_slot, this_slot, from_slot);
997 [&ws, tval, state_def](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
1001 for(
auto i : ws.world.region_get_region_membership(state_def)) {
1002 accumulator.add_value(
to_generic(i.get_province().id));
1003 if(accumulator.result)
1007 accumulator.flush();
1008 return accumulator.result;
1012 for(
auto i : ws.world.region_get_region_membership(state_def)) {
1013 accumulator.add_value(
to_generic(i.get_province().id));
1014 if(!accumulator.result)
1018 accumulator.flush();
1019 return accumulator.result;
1022 primary_slot, this_slot, from_slot);
1025 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
1026 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(owner), this_slot,
1030 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
1031 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(owner), this_slot,
1035 auto controller = ws.world.province_get_nation_from_province_control(
to_prov(primary_slot));
1036 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(controller),
1037 this_slot, from_slot);
1040 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
1041 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(location), this_slot,
1045 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
1046 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(owner), this_slot,
1050 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
1051 auto owner = ws.world.province_get_nation_from_province_ownership(location);
1052 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(owner), this_slot,
1056 auto cap = ws.world.nation_get_capital(
to_nation(primary_slot));
1057 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(cap), this_slot, from_slot);
1060 auto cap = ws.world.nation_get_capital(ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)));
1061 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(cap), this_slot, from_slot);
1065 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(cap), this_slot, from_slot);
1068 return apply_subtriggers<return_type, this_type, this_type, from_type>(tval, ws, this_slot, this_slot, from_slot);
1071 return apply_subtriggers<return_type, from_type, this_type, from_type>(tval, ws, from_slot, this_slot, from_slot);
1089 auto ports = ws.world.province_get_port_to(
to_prov(primary_slot));
1090 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(ports),
1091 this_slot, from_slot);
1094 auto cultures = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
1095 auto cg = ws.world.culture_get_group_from_culture_group_membership(cultures);
1096 auto union_tags = ws.world.culture_group_get_identity_from_cultural_union_of(cg);
1097 auto group_holders = ws.world.national_identity_get_nation_from_identity_holder(union_tags);
1098 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(group_holders),
1099 this_slot, from_slot);
1102 auto so = ws.world.nation_get_overlord_as_subject(
to_nation(primary_slot));
1103 auto nso = ws.world.overlord_get_ruler(so);
1104 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(nso), this_slot,
1108 auto nso = ws.world.nation_get_in_sphere_of(
to_nation(primary_slot));
1109 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(nso), this_slot,
1113 auto rtags = ws.world.rebel_faction_get_defection_target(
to_rebel(from_slot));
1114 auto r_holders = ws.world.national_identity_get_nation_from_identity_holder(rtags);
1116 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(r_holders),
1117 this_slot, from_slot);
1120 auto ctags = ws.world.state_instance_get_flashpoint_tag(
to_state(primary_slot));
1121 auto fp_nations = ws.world.national_identity_get_nation_from_identity_holder(ctags);
1122 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(fp_nations),
1123 this_slot, from_slot);
1126 return apply_subtriggers<return_type, int32_t, this_type, from_type>(tval, ws,
to_generic(ws.crisis_state), this_slot,
1130 auto state_instance = ws.world.province_get_state_membership(
to_prov(primary_slot));
1131 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(state_instance),
1132 this_slot, from_slot);
1135 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
1136 auto state_instance = ws.world.province_get_state_membership(location);
1137 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(state_instance),
1138 this_slot, from_slot);
1142 auto tag_holder = ws.world.national_identity_get_nation_from_identity_holder(tag);
1143 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(tag_holder),
1144 this_slot, from_slot);
1148 return apply_subtriggers<return_type, int32_t, this_type, from_type>(tval, ws,
to_generic(wprov), this_slot, from_slot);
1151 return apply_subtriggers<return_type, primary_type, this_type, from_type>(tval, ws, primary_slot, this_slot, from_slot);
1154 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
1155 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(owner), this_slot,
1159 auto cultures = ws.world.pop_get_culture(
to_pop(primary_slot));
1160 auto cg = ws.world.culture_get_group_from_culture_group_membership(cultures);
1161 auto union_tags = ws.world.culture_group_get_identity_from_cultural_union_of(cg);
1162 auto group_holders = ws.world.national_identity_get_nation_from_identity_holder(union_tags);
1164 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(group_holders),
1165 this_slot, from_slot);
1173 return compare_values(tval[0], ws.current_date.to_ymd(ws.start_date).year, int32_t(tval[1]));
1176 return compare_values(tval[0], ws.current_date.to_ymd(ws.start_date).month, int32_t(tval[1]));
1191 return compare_to_true(tval[0], ws.world.nation_get_active_technologies(ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)), tid));
1198 auto type = ws.world.pop_get_poptype(
to_pop(primary_slot));
1199 auto strata = ws.world.pop_type_get_strata(type);
1203 auto type = ws.world.pop_get_poptype(
to_pop(primary_slot));
1204 auto strata = ws.world.pop_type_get_strata(type);
1208 auto type = ws.world.pop_get_poptype(
to_pop(primary_slot));
1209 auto strata = ws.world.pop_type_get_strata(type);
1217 auto state_caps = ws.world.state_instance_get_capital(
to_state(primary_slot));
1224 auto owners = ws.world.province_get_nation_from_province_ownership(to_prov(v));
1225 return (owners == ve::tagged_vector<dcon::nation_id>()) & (ve::int_vector(v) < sea_index);
1230 auto results = ve::apply(
1231 [&ws](int32_t p_slot, int32_t, int32_t) {
1235 for(
auto p : ws.world.province_get_province_adjacency(pid)) {
1236 auto other = p.get_connected_provinces(0) == pid ? p.get_connected_provinces(1) : p.get_connected_provinces(0);
1245 primary_slot, this_slot, from_slot);
1252 auto owners = ws.world.province_get_nation_from_province_ownership(to_prov(v));
1253 return (owners == ve::tagged_vector<dcon::nation_id>()) & (ve::int_vector(v) < sea_index) &
1254 (ws.world.province_get_state_membership(to_prov(v)) != vector_sid);
1259 auto results = ve::apply(
1260 [&ws](int32_t p_slot, int32_t, int32_t) {
1262 auto region_owner = ws.world.state_instance_get_nation_from_state_ownership(state_id);
1265 auto region_id = ws.world.state_instance_get_definition(state_id);
1267 for(
auto sp : ws.world.state_definition_get_abstract_state_membership(region_id)) {
1268 if(sp.get_province().get_nation_from_province_ownership() == region_owner) {
1269 for(
auto p : ws.world.province_get_province_adjacency(sp.get_province())) {
1271 p.get_connected_provinces(0) == sp.get_province() ? p.get_connected_provinces(1) : p.get_connected_provinces(0);
1282 primary_slot, this_slot, from_slot);
1289 ws.world.abstract_state_membership_get_state(ws.world.province_get_abstract_state_membership(
to_prov(primary_slot))),
1290 ws.world.abstract_state_membership_get_state(ws.world.province_get_abstract_state_membership(pid)));
1295 ws.world.abstract_state_membership_get_state(ws.world.province_get_abstract_state_membership(pid)));
1300 auto savings_qnty = ws.world.pop_get_savings(
to_pop(primary_slot));
1306 return compare_values(tval[0],
ve::select(total_employable > 0.0f, 1.0f - (total_employed / total_employable), 0.0f),
1312 return compare_values(tval[0],
ve::select(total_employable > 0.0f, 1.0f - (total_employed / total_employable), 0.0f),
1318 return compare_values(tval[0],
ve::select(total_employable > 0.0f, 1.0f - (total_employed / total_employable), 0.0f),
1322 auto employed = ws.world.pop_get_employment(
to_pop(primary_slot));
1323 auto total_pop = ws.world.pop_get_size(
to_pop(primary_slot));
1324 auto ptype = ws.world.pop_get_poptype(
to_pop(primary_slot));
1325 return compare_values(tval[0],
ve::select(ws.world.pop_type_get_has_unemployment(ptype), 1.0f - (employed / total_pop), 0.0f),
1333 return compare_to_true(tval[0], ws.world.province_get_is_slave(ws.world.state_instance_get_capital(
to_state(primary_slot))));
1339 return compare_values_eq(tval[0], ws.world.pop_get_poptype(
to_pop(primary_slot)), ws.culture_definitions.slaves);
1342 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(primary_slot))),
1346 auto owners = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
1347 auto pcultures = ws.world.nation_get_primary_culture(owners);
1350 auto majority_pop = ve::apply(
1351 [&ws](int32_t p_slot, dcon::culture_id c) {
1357 primary_slot, pcultures);
1362 auto owners = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
1363 auto pcultures = ws.world.nation_get_primary_culture(owners);
1366 auto majority_pop = ve::apply(
1367 [&ws](int32_t p_slot, dcon::culture_id c) {
1373 primary_slot, pcultures);
1378 auto pcultures = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
1381 auto majority_pop = ve::apply(
1382 [&ws](int32_t p_slot, dcon::culture_id c) {
1388 primary_slot, pcultures);
1393 auto gov_type = ws.world.nation_get_government_type(
to_nation(primary_slot));
1397 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
1398 auto owners = ws.world.province_get_nation_from_province_ownership(location);
1400 return tf_government_nation<return_type>(tval, ws,
to_generic(owners), int32_t(), int32_t());
1437 ws.world.rebel_faction_get_primary_culture(
to_rebel(from_slot)));
1441 ws.world.rebel_faction_get_primary_culture(
to_rebel(from_slot)));
1445 ws.world.rebel_faction_get_primary_culture(
to_rebel(from_slot)));
1449 ws.world.rebel_faction_get_primary_culture(
to_rebel(from_slot))));
1452 auto pc = ws.world.pop_get_culture(
to_pop(primary_slot));
1456 auto pc = ws.world.pop_get_culture(
to_pop(primary_slot));
1460 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
1461 return tf_culture_this_nation<return_type>(tval, ws, primary_slot,
to_generic(owner), int32_t());
1464 auto loc = ws.world.pop_get_province_from_pop_location(
to_pop(this_slot));
1465 auto owner = ws.world.province_get_nation_from_province_ownership(loc);
1466 return tf_culture_this_nation<return_type>(tval, ws, primary_slot,
to_generic(owner), int32_t());
1469 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
1470 return tf_culture_this_nation<return_type>(tval, ws, primary_slot,
to_generic(owner), int32_t());
1477 auto pculture = ws.world.pop_get_culture(
to_pop(primary_slot));
1478 auto cgroups = ws.world.culture_get_group_from_culture_group_membership(pculture);
1482 auto pculture = ws.world.province_get_dominant_culture(
to_prov(primary_slot));
1483 auto cgroups = ws.world.culture_get_group_from_culture_group_membership(pculture);
1487 auto pculture = ws.world.state_instance_get_dominant_culture(
to_state(primary_slot));
1488 auto cgroups = ws.world.culture_get_group_from_culture_group_membership(pculture);
1492 auto c = ws.world.rebel_faction_get_primary_culture(
to_rebel(from_slot));
1493 auto rcg = ws.world.culture_get_group_from_culture_group_membership(c);
1498 auto c = ws.world.rebel_faction_get_primary_culture(
to_rebel(from_slot));
1499 auto rcg = ws.world.culture_get_group_from_culture_group_membership(c);
1501 auto pculture = ws.world.pop_get_culture(
to_pop(primary_slot));
1502 auto cgroups = ws.world.culture_get_group_from_culture_group_membership(pculture);
1511 auto pculture = ws.world.pop_get_culture(
to_pop(primary_slot));
1512 auto cgroups = ws.world.culture_get_group_from_culture_group_membership(pculture);
1520 auto pculture = ws.world.pop_get_culture(
to_pop(primary_slot));
1521 auto cgroups = ws.world.culture_get_group_from_culture_group_membership(pculture);
1525 auto owners = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
1530 auto owners = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
1531 auto pculture = ws.world.pop_get_culture(
to_pop(primary_slot));
1532 auto cgroups = ws.world.culture_get_group_from_culture_group_membership(pculture);
1536 auto owners = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
1541 auto owners = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
1542 auto pculture = ws.world.pop_get_culture(
to_pop(primary_slot));
1543 auto cgroups = ws.world.culture_get_group_from_culture_group_membership(pculture);
1553 auto pculture = ws.world.pop_get_culture(
to_pop(primary_slot));
1554 auto cgroups = ws.world.culture_get_group_from_culture_group_membership(pculture);
1562 ws.world.rebel_faction_get_religion(
to_rebel(from_slot)));
1566 ws.world.nation_get_religion(
to_nation(from_slot)));
1570 ws.world.nation_get_religion(
to_nation(this_slot)));
1573 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
1574 return compare_values_eq(tval[0], ws.world.pop_get_religion(
to_pop(primary_slot)), ws.world.nation_get_religion(owner));
1577 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
1578 return compare_values_eq(tval[0], ws.world.pop_get_religion(
to_pop(primary_slot)), ws.world.nation_get_religion(owner));
1582 return compare_values_eq(tval[0], ws.world.pop_get_religion(
to_pop(primary_slot)), ws.world.nation_get_religion(owner));
1588 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
1604 auto result = ve::apply(
1605 [&ws, rebel_type](dcon::nation_id n) {
1606 for(
auto factions : ws.world.nation_get_rebellion_within(n)) {
1607 if(factions.get_rebels().get_type() == rebel_type)
1616 auto rf = ws.world.pop_get_rebel_faction_from_pop_rebellion_membership(
to_pop(primary_slot));
1621 auto owners = ws.
world.province_get_nation_from_province_ownership(
to_prov(v));
1627 auto nation_tag = ws.world.nation_get_identity_from_identity_holder(
to_nation(primary_slot));
1628 auto result = ve::apply(
1629 [&ws](dcon::nation_id n, dcon::national_identity_id t) {
1632 for(
auto p : ws.world.national_identity_get_core(t)) {
1633 acc.add_value(
to_generic(p.get_province().id));
1646 auto h = ws.world.national_identity_get_nation_from_identity_holder(
trigger::payload(tval[1]).tag_id);
1647 return compare_to_true(tval[0], ve::apply([&](dcon::national_identity_id n) {
1648 for(
auto p : ws.world.nation_get_province_ownership(h)) {
1649 if(ws.world.get_core_by_prov_tag_key(p.get_province(), n))
1653 }, ws.world.nation_get_identity_from_identity_holder(
trigger::to_nation(primary_slot))));
1656 return compare_to_true(tval[0], ve::apply([&](dcon::national_identity_id n, dcon::nation_id h) {
1657 for(
auto p : ws.world.nation_get_province_ownership(h)) {
1658 if(ws.world.get_core_by_prov_tag_key(p.get_province(), n))
1665 return compare_to_true(tval[0], ve::apply([&](dcon::national_identity_id n, dcon::nation_id h) {
1666 for(
auto p : ws.world.nation_get_province_ownership(h)) {
1667 if(ws.world.get_core_by_prov_tag_key(p.get_province(), n))
1675 auto ident = ws.world.nation_get_identity_from_identity_holder(
to_nation(primary_slot));
1676 auto union_group = ws.world.national_identity_get_culture_group_from_cultural_union_of(
ident);
1680 auto pculture = ws.world.pop_get_culture(
to_pop(primary_slot));
1681 auto pgroup = ws.world.culture_get_group_from_culture_group_membership(pculture);
1683 auto ident = ws.world.nation_get_identity_from_identity_holder(
to_nation(this_slot));
1684 auto union_group = ws.world.national_identity_get_culture_group_from_cultural_union_of(
ident);
1689 auto pculture = ws.world.pop_get_culture(
to_pop(primary_slot));
1690 auto pgroup = ws.world.culture_get_group_from_culture_group_membership(pculture);
1693 auto union_group = ws.world.national_identity_get_culture_group_from_cultural_union_of(
ident);
1698 auto ident = ws.world.nation_get_identity_from_identity_holder(
to_nation(primary_slot));
1699 auto union_group = ws.world.national_identity_get_culture_group_from_cultural_union_of(
ident);
1700 auto c = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
1701 auto cg = ws.world.culture_get_group_from_culture_group_membership(c);
1703 auto tident = ws.world.nation_get_identity_from_identity_holder(
to_nation(this_slot));
1704 auto tunion_group = ws.world.national_identity_get_culture_group_from_cultural_union_of(tident);
1705 auto tculture = ws.world.nation_get_primary_culture(
to_nation(this_slot));
1706 auto tcg = ws.world.culture_get_group_from_culture_group_membership(tculture);
1708 return compare_to_true(tval[0], (union_group == tcg) || (tunion_group == cg));
1711 auto ident = ws.world.nation_get_identity_from_identity_holder(
to_nation(primary_slot));
1712 auto union_group = ws.world.national_identity_get_culture_group_from_cultural_union_of(
ident);
1714 auto pculture = ws.world.pop_get_culture(
to_pop(this_slot));
1715 auto pgroup = ws.world.culture_get_group_from_culture_group_membership(pculture);
1720 auto ident = ws.world.nation_get_identity_from_identity_holder(
to_nation(primary_slot));
1721 auto union_group = ws.world.national_identity_get_culture_group_from_cultural_union_of(
ident);
1722 auto c = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
1723 auto cg = ws.world.culture_get_group_from_culture_group_membership(c);
1725 auto tnation = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
1726 auto tident = ws.world.nation_get_identity_from_identity_holder(tnation);
1727 auto tunion_group = ws.world.national_identity_get_culture_group_from_cultural_union_of(tident);
1728 auto tculture = ws.world.nation_get_primary_culture(tnation);
1729 auto tcg = ws.world.culture_get_group_from_culture_group_membership(tculture);
1731 return compare_to_true(tval[0], (union_group == tcg) || (tunion_group == cg));
1734 auto ident = ws.world.nation_get_identity_from_identity_holder(
to_nation(primary_slot));
1735 auto union_group = ws.world.national_identity_get_culture_group_from_cultural_union_of(
ident);
1736 auto c = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
1737 auto cg = ws.world.culture_get_group_from_culture_group_membership(c);
1739 auto tnation = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
1740 auto tident = ws.world.nation_get_identity_from_identity_holder(tnation);
1741 auto tunion_group = ws.world.national_identity_get_culture_group_from_cultural_union_of(tident);
1742 auto tculture = ws.world.nation_get_primary_culture(tnation);
1743 auto tcg = ws.world.culture_get_group_from_culture_group_membership(tculture);
1745 return compare_to_true(tval[0], (union_group == tcg) || (tunion_group == cg));
1748 auto ident = ws.world.nation_get_identity_from_identity_holder(
to_nation(primary_slot));
1749 auto union_group = ws.world.national_identity_get_culture_group_from_cultural_union_of(
ident);
1751 auto rculture = ws.world.rebel_faction_get_primary_culture(
to_rebel(from_slot));
1752 auto rgroup = ws.world.culture_get_group_from_culture_group_membership(rculture);
1757 auto pculture = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
1758 auto cgroup = ws.world.culture_get_group_from_culture_group_membership(pculture);
1759 auto utag = ws.world.culture_group_get_identity_from_cultural_union_of(cgroup);
1761 auto ident = ws.world.nation_get_identity_from_identity_holder(
to_nation(primary_slot));
1762 auto union_group = ws.world.national_identity_get_culture_group_from_cultural_union_of(
ident);
1763 auto tag_group = ws.world.national_identity_get_culture_group_from_cultural_union_of(
trigger::payload(tval[1]).tag_id);
1768 auto pculture = ws.world.pop_get_culture(
to_pop(this_slot));
1769 auto cgroup = ws.world.culture_get_group_from_culture_group_membership(pculture);
1770 auto utag = ws.world.culture_group_get_identity_from_cultural_union_of(cgroup);
1775 auto state_owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
1776 auto pculture = ws.world.nation_get_primary_culture(state_owner);
1777 auto cgroup = ws.world.culture_get_group_from_culture_group_membership(pculture);
1778 auto utag = ws.world.culture_group_get_identity_from_cultural_union_of(cgroup);
1780 auto ident = ws.world.nation_get_identity_from_identity_holder(state_owner);
1781 auto union_group = ws.world.national_identity_get_culture_group_from_cultural_union_of(
ident);
1782 auto tag_group = ws.world.national_identity_get_culture_group_from_cultural_union_of(
trigger::payload(tval[1]).tag_id);
1787 auto prov_owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
1788 auto pculture = ws.world.nation_get_primary_culture(prov_owner);
1789 auto cgroup = ws.world.culture_get_group_from_culture_group_membership(pculture);
1790 auto utag = ws.world.culture_group_get_identity_from_cultural_union_of(cgroup);
1792 auto ident = ws.world.nation_get_identity_from_identity_holder(prov_owner);
1793 auto union_group = ws.world.national_identity_get_culture_group_from_cultural_union_of(
ident);
1794 auto tag_group = ws.world.national_identity_get_culture_group_from_cultural_union_of(
trigger::payload(tval[1]).tag_id);
1799 auto pculture = ws.world.nation_get_primary_culture(
to_nation(this_slot));
1800 auto cgroup = ws.world.culture_get_group_from_culture_group_membership(pculture);
1801 auto utag = ws.world.culture_group_get_identity_from_cultural_union_of(cgroup);
1803 auto ident = ws.world.nation_get_identity_from_identity_holder(
to_nation(this_slot));
1804 auto union_group = ws.world.national_identity_get_culture_group_from_cultural_union_of(
ident);
1805 auto tag_group = ws.world.national_identity_get_culture_group_from_cultural_union_of(
trigger::payload(tval[1]).tag_id);
1815 auto p_owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
1829 return compare_to_true(tval[0], ws.world.nation_get_is_at_war(owner));
1835 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
1852 return compare_values_eq(tval[0], ws.world.province_get_nation_from_province_ownership(pid), ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)));
1860 auto tag = ws.world.nation_get_identity_from_identity_holder(
to_nation(primary_slot));
1861 auto result = ve::apply(
1862 [&ws, pid](dcon::national_identity_id t) {
1863 for(
auto c : ws.world.province_get_core(pid)) {
1864 if(c.get_identity() == t)
1873 auto tag = ws.world.nation_get_identity_from_identity_holder(
to_nation(this_slot));
1874 auto result = ve::apply(
1875 [&ws](dcon::province_id pid, dcon::national_identity_id t) {
1876 for(
auto c : ws.world.province_get_core(pid)) {
1877 if(c.get_identity() == t)
1886 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
1887 auto tag = ws.world.nation_get_identity_from_identity_holder(owner);
1888 auto result = ve::apply(
1889 [&ws](dcon::province_id pid, dcon::national_identity_id t) {
1890 for(
auto c : ws.world.province_get_core(pid)) {
1891 if(c.get_identity() == t)
1900 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
1901 auto tag = ws.world.nation_get_identity_from_identity_holder(owner);
1902 auto result = ve::apply(
1903 [&ws](dcon::province_id pid, dcon::national_identity_id t) {
1904 for(
auto c : ws.world.province_get_core(pid)) {
1905 if(c.get_identity() == t)
1915 auto tag = ws.world.nation_get_identity_from_identity_holder(owner);
1916 auto result = ve::apply(
1917 [&ws](dcon::province_id pid, dcon::national_identity_id t) {
1918 for(
auto c : ws.world.province_get_core(pid)) {
1919 if(c.get_identity() == t)
1928 auto tag = ws.world.nation_get_identity_from_identity_holder(
to_nation(from_slot));
1929 auto result = ve::apply(
1930 [&ws](dcon::province_id pid, dcon::national_identity_id t) {
1931 for(
auto c : ws.world.province_get_core(pid)) {
1932 if(c.get_identity() == t)
1941 auto rtags = ws.world.rebel_faction_get_defection_target(
to_rebel(from_slot));
1942 auto result = ve::apply(
1943 [&ws](dcon::province_id pid, dcon::national_identity_id t) {
1944 for(
auto c : ws.world.province_get_core(pid)) {
1945 if(c.get_identity() == t)
1950 to_prov(primary_slot), rtags);
1954 auto tag = ws.world.nation_get_identity_from_identity_holder(
to_nation(from_slot));
1955 auto result = ve::apply(
1956 [&ws](dcon::state_instance_id sid, dcon::national_identity_id t) {
1957 for(
auto p : ws.world.state_definition_get_abstract_state_membership(ws.world.state_instance_get_definition(sid))) {
1958 if(!(ws.world.get_core_by_prov_tag_key(p.get_province(), t)))
1967 auto tag = ws.world.nation_get_identity_from_identity_holder(
to_nation(this_slot));
1968 auto result = ve::apply(
1969 [&ws](dcon::state_instance_id sid, dcon::national_identity_id t) {
1970 for(
auto p : ws.world.state_definition_get_abstract_state_membership(ws.world.state_instance_get_definition(sid))) {
1971 if(!(ws.world.get_core_by_prov_tag_key(p.get_province(), t)))
1980 auto tag = ws.world.nation_get_identity_from_identity_holder(ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot)));
1981 auto result = ve::apply(
1982 [&ws](dcon::state_instance_id sid, dcon::national_identity_id t) {
1983 for(
auto p : ws.world.state_definition_get_abstract_state_membership(ws.world.state_instance_get_definition(sid))) {
1984 if(!(ws.world.get_core_by_prov_tag_key(p.get_province(), t)))
1994 auto result = ve::apply(
1995 [&ws](dcon::state_instance_id sid, dcon::national_identity_id t) {
1996 for(
auto p : ws.world.state_definition_get_abstract_state_membership(ws.world.state_instance_get_definition(sid))) {
1997 if(!(ws.world.get_core_by_prov_tag_key(p.get_province(), t)))
2009 auto result = ve::apply(
2011 return bool(ws.world.get_core_by_prov_tag_key(pid, t));
2017 auto result = ve::apply(
2019 return bool(ws.world.get_core_by_prov_tag_key(pid, t));
2021 ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot)));
2025 auto result = ve::apply(
2027 for(
auto p : ws.world.state_definition_get_abstract_state_membership(ws.world.state_instance_get_definition(sid))) {
2028 if(!(ws.world.get_core_by_prov_tag_key(p.get_province(), t)))
2048 ws.world.nation_get_owned_province_count(
to_nation(from_slot)));
2052 ws.world.nation_get_owned_province_count(
to_nation(this_slot)));
2055 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
2057 ws.world.nation_get_owned_province_count(owner));
2060 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
2062 ws.world.nation_get_owned_province_count(owner));
2067 ws.world.nation_get_owned_province_count(owner));
2079 auto holders = ws.world.national_identity_get_nation_from_identity_holder(
trigger::payload(tval[1]).tag_id);
2080 return compare_values_eq(tval[0], holders, ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)));
2084 ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)));
2088 ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)));
2092 ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)));
2095 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
2096 return compare_values_eq(tval[0], owner, ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)));
2100 return compare_values_eq(tval[0], owner, ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)));
2103 auto holders = ws.world.national_identity_get_nation_from_identity_holder(
trigger::payload(tval[1]).tag_id);
2104 return compare_values_eq(tval[0], holders, ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot)));
2108 ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot)));
2112 ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot)));
2116 ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot)));
2119 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
2120 return compare_values_eq(tval[0], owner, ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot)));
2124 return compare_values_eq(tval[0], owner, ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot)));
2130 auto holders = ws.world.national_identity_get_nation_from_identity_holder(
trigger::payload(tval[1]).tag_id);
2131 return compare_to_true(tval[0], ws.world.nation_get_owned_province_count(holders) != 0);
2141 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
2145 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
2152 auto state_caps = ws.world.state_instance_get_capital(
to_state(primary_slot));
2156 auto nat_caps = ws.world.nation_get_capital(
to_nation(primary_slot));
2160 auto prov_id = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
2165 ws.world.province_get_continent(ws.world.nation_get_capital(
to_nation(this_slot))));
2168 return compare_values_eq(tval[0], ws.world.province_get_continent(ws.world.state_instance_get_capital(
to_state(primary_slot))),
2169 ws.world.province_get_continent(ws.world.nation_get_capital(
to_nation(this_slot))));
2173 ws.world.province_get_continent(ws.world.nation_get_capital(
to_nation(this_slot))));
2177 ws.world.province_get_continent(ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot))),
2178 ws.world.province_get_continent(ws.world.nation_get_capital(
to_nation(this_slot))));
2182 ws.world.province_get_continent(ws.world.nation_get_capital(
to_nation(from_slot))));
2185 return compare_values_eq(tval[0], ws.world.province_get_continent(ws.world.state_instance_get_capital(
to_state(primary_slot))),
2186 ws.world.province_get_continent(ws.world.nation_get_capital(
to_nation(from_slot))));
2190 ws.world.province_get_continent(ws.world.nation_get_capital(
to_nation(from_slot))));
2194 ws.world.province_get_continent(ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot))),
2195 ws.world.province_get_continent(ws.world.nation_get_capital(
to_nation(from_slot))));
2198 auto tag_holder = ws.world.national_identity_get_nation_from_identity_holder(
trigger::payload(tval[1]).tag_id);
2216 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
2223 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
2237 auto holder = ws.world.national_identity_get_nation_from_identity_holder(
trigger::payload(tval[1]).tag_id);
2238 auto result = ve::apply(
2239 [&ws, holder](dcon::nation_id n) {
2240 return ws.world.unilateral_relationship_get_military_access(
2241 ws.world.get_unilateral_relationship_by_unilateral_pair(holder, n));
2247 auto result = ve::apply(
2248 [&ws](dcon::nation_id n, dcon::nation_id t) {
2249 return ws.world.unilateral_relationship_get_military_access(
2250 ws.world.get_unilateral_relationship_by_unilateral_pair(t, n));
2256 auto result = ve::apply(
2257 [&ws](dcon::nation_id n, dcon::nation_id t) {
2258 return ws.world.unilateral_relationship_get_military_access(
2259 ws.world.get_unilateral_relationship_by_unilateral_pair(t, n));
2265 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
2266 auto result = ve::apply(
2267 [&ws](dcon::nation_id n, dcon::nation_id t) {
2268 return ws.world.unilateral_relationship_get_military_access(
2269 ws.world.get_unilateral_relationship_by_unilateral_pair(t, n));
2275 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
2276 auto result = ve::apply(
2277 [&ws](dcon::nation_id n, dcon::nation_id t) {
2278 return ws.world.unilateral_relationship_get_military_access(
2279 ws.world.get_unilateral_relationship_by_unilateral_pair(t, n));
2286 auto result = ve::apply(
2287 [&ws](dcon::nation_id n, dcon::nation_id t) {
2288 return ws.world.unilateral_relationship_get_military_access(
2289 ws.world.get_unilateral_relationship_by_unilateral_pair(t, n));
2299 ws.world.nation_get_prestige(
to_nation(from_slot)));
2303 ws.world.nation_get_prestige(
to_nation(this_slot)));
2306 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
2307 return compare_values(tval[0], ws.world.nation_get_prestige(
to_nation(primary_slot)), ws.world.nation_get_prestige(owner));
2310 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
2311 return compare_values(tval[0], ws.world.nation_get_prestige(
to_nation(primary_slot)), ws.world.nation_get_prestige(owner));
2315 return compare_values(tval[0], ws.world.nation_get_prestige(
to_nation(primary_slot)), ws.world.nation_get_prestige(owner));
2341 auto state = ws.world.province_get_state_membership(
to_prov(primary_slot));
2347 auto state = ws.world.province_get_state_membership(
to_prov(primary_slot));
2353 ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)) == dcon::nation_id());
2363 auto result = ve::apply(
2364 [&ws, mod](dcon::nation_id n) {
2365 for(
auto m : ws.world.nation_get_current_modifiers(n)) {
2375 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
2377 auto result = ve::apply(
2378 [&ws, mod](dcon::nation_id n) {
2379 for(
auto m : ws.world.nation_get_current_modifiers(n)) {
2390 auto result = ve::apply(
2391 [&ws, mod](dcon::province_id n) {
2392 for(
auto m : ws.world.province_get_current_modifiers(n)) {
2402 return compare_values_eq(tval[0], ws.world.province_get_state_from_abstract_state_membership(
to_prov(primary_slot)),
2410 return compare_values_eq(tval[0], ws.world.province_get_state_from_abstract_state_membership(ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot))),
trigger::payload(tval[1]).state_id);
2416 auto result = ve::apply([&ws, r](dcon::province_id p) {
2417 for(
auto m : ws.world.province_get_region_membership(p)) {
2418 if(m.get_region() == r)
2427 auto result = ve::apply([&ws, r](dcon::province_id p) {
2428 for(
auto m : ws.world.province_get_region_membership(p)) {
2429 if(m.get_region() == r)
2433 }, ws.world.state_instance_get_capital(
to_state(primary_slot)));
2438 auto result = ve::apply([&ws, r](dcon::province_id p) {
2439 for(
auto m : ws.world.province_get_region_membership(p)) {
2440 if(m.get_region() == r)
2444 }, ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot)));
2448 auto result = ve::apply([&](dcon::region_id sd, dcon::nation_id n) {
2449 for(
auto p : ws.world.region_get_region_membership(sd)) {
2450 if(p.get_province().get_nation_from_province_ownership() != n)
2458 auto result = ve::apply([&](dcon::state_definition_id sd, dcon::nation_id n) {
2459 for(
auto p : ws.world.state_definition_get_abstract_state_membership(sd)) {
2460 if(p.get_province().get_nation_from_province_ownership() != n)
2476 ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot)));
2483 ws.world.province_get_nation_from_province_ownership(
to_prov(from_slot)));
2490 auto tag_holder = ws.world.national_identity_get_nation_from_identity_holder(
trigger::payload(tval[1]).tag_id);
2492 auto main_brigades = ws.world.nation_get_active_regiments(
to_nation(primary_slot));
2493 auto this_brigades = ws.world.nation_get_active_regiments(tag_holder);
2497 auto main_brigades = ws.world.nation_get_active_regiments(
to_nation(primary_slot));
2498 auto this_brigades = ws.world.nation_get_active_regiments(
trigger::to_nation(this_slot));
2502 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
trigger::to_state(this_slot));
2503 return tf_stronger_army_than_this_nation<return_type>(tval, ws, primary_slot,
to_generic(owner), int32_t());
2506 auto owner = ws.world.province_get_nation_from_province_ownership(
trigger::to_prov(this_slot));
2507 return tf_stronger_army_than_this_nation<return_type>(tval, ws, primary_slot,
to_generic(owner), int32_t());
2511 return tf_stronger_army_than_this_nation<return_type>(tval, ws, primary_slot,
to_generic(owner), int32_t());
2514 return tf_stronger_army_than_this_nation<return_type>(tval, ws, primary_slot, from_slot, int32_t());
2517 return tf_stronger_army_than_this_province<return_type>(tval, ws, primary_slot, from_slot, int32_t());
2520 auto tag_holder = ws.world.national_identity_get_nation_from_identity_holder(
trigger::payload(tval[1]).tag_id);
2522 ve::apply([&ws, tag_holder](
2523 dcon::nation_id n) {
return bool(ws.world.get_nation_adjacency_by_nation_adjacency_pair(n, tag_holder)); },
2528 auto result = ve::apply(
2529 [&ws](dcon::nation_id n, dcon::nation_id o) {
return bool(ws.world.get_nation_adjacency_by_nation_adjacency_pair(n, o)); },
2534 auto result = ve::apply(
2535 [&ws](dcon::nation_id n, dcon::nation_id o) {
return bool(ws.world.get_nation_adjacency_by_nation_adjacency_pair(n, o)); },
2540 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
2541 auto result = ve::apply(
2542 [&ws](dcon::nation_id n, dcon::nation_id o) {
return bool(ws.world.get_nation_adjacency_by_nation_adjacency_pair(n, o)); },
2547 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(from_slot));
2548 auto result = ve::apply(
2549 [&ws](dcon::nation_id n, dcon::nation_id o) {
return bool(ws.world.get_nation_adjacency_by_nation_adjacency_pair(n, o)); },
2554 auto result = ve::apply(
2555 [&ws](dcon::state_instance_id s, dcon::nation_id tag) {
2556 for(
auto p : ws.world.state_definition_get_abstract_state_membership(ws.world.state_instance_get_definition(s))) {
2557 if(p.get_province().get_state_membership() == s) {
2558 for(auto a : ws.world.province_get_army_location(p.get_province())) {
2559 if(a.get_army().get_controller_from_army_control() == tag)
2570 auto result = ve::apply(
2571 [&ws](dcon::state_instance_id s, dcon::nation_id tag) {
2572 for(
auto p : ws.world.state_definition_get_abstract_state_membership(ws.world.state_instance_get_definition(s))) {
2573 if(p.get_province().get_state_membership() == s) {
2574 for(auto a : ws.world.province_get_army_location(p.get_province())) {
2575 if(a.get_army().get_controller_from_army_control() == tag)
2582 to_state(primary_slot), to_nation(this_slot));
2583 return compare_to_true(tval[0], result);
2586 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
2587 auto result = ve::apply(
2588 [&ws](dcon::state_instance_id s, dcon::nation_id tag) {
2589 for(
auto p : ws.world.state_definition_get_abstract_state_membership(ws.world.state_instance_get_definition(s))) {
2590 if(p.get_province().get_state_membership() == s) {
2591 for(auto a : ws.world.province_get_army_location(p.get_province())) {
2592 if(a.get_army().get_controller_from_army_control() == tag)
2599 to_state(primary_slot), owner);
2600 return compare_to_true(tval[0], result);
2603 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
2604 auto result = ve::apply(
2605 [&ws](dcon::state_instance_id s, dcon::nation_id tag) {
2606 for(
auto p : ws.world.state_definition_get_abstract_state_membership(ws.world.state_instance_get_definition(s))) {
2607 if(p.get_province().get_state_membership() == s) {
2608 for(auto a : ws.world.province_get_army_location(p.get_province())) {
2609 if(a.get_army().get_controller_from_army_control() == tag)
2616 to_state(primary_slot), owner);
2617 return compare_to_true(tval[0], result);
2621 auto result = ve::apply(
2622 [&ws](dcon::state_instance_id s, dcon::nation_id tag) {
2623 for(
auto p : ws.world.state_definition_get_abstract_state_membership(ws.world.state_instance_get_definition(s))) {
2624 if(p.get_province().get_state_membership() == s) {
2625 for(auto a : ws.world.province_get_army_location(p.get_province())) {
2626 if(a.get_army().get_controller_from_army_control() == tag)
2633 to_state(primary_slot), owner);
2634 return compare_to_true(tval[0], result);
2637 auto tag = ws.world.national_identity_get_nation_from_identity_holder(
trigger::payload(tval[1]).tag_id);
2638 auto result = ve::apply(
2639 [&ws, tag](dcon::state_instance_id s) {
2642 for(
auto p : ws.world.state_definition_get_abstract_state_membership(ws.world.state_instance_get_definition(s))) {
2643 if(p.get_province().get_state_membership() == s) {
2644 for(auto a : ws.world.province_get_army_location(p.get_province())) {
2645 if(a.get_army().get_controller_from_army_control() == tag)
2652 to_state(primary_slot));
2653 return compare_to_true(tval[0], result);
2656 auto result = ve::apply(
2657 [&ws](dcon::province_id p) {
2659 for(
auto a : ws.world.province_get_army_location(p)) {
2660 for(auto u : a.get_army().get_army_membership()) {
2666 to_prov(primary_slot));
2667 return compare_values(tval[0], result, int32_t(tval[1]));
2670 auto tag = ws.world.national_identity_get_nation_from_identity_holder(
trigger::payload(tval[1]).tag_id);
2671 auto result = ve::apply(
2672 [&ws, tag](dcon::province_id p) {
2675 for(
auto a : ws.world.province_get_army_location(p)) {
2676 if(a.get_army().get_controller_from_army_control() == tag)
2686 auto result = ve::apply(
2687 [&ws](dcon::province_id p, dcon::nation_id n) {
2688 for(
auto a : ws.world.province_get_army_location(p)) {
2689 if(a.get_army().get_controller_from_army_control() == n)
2698 auto result = ve::apply(
2699 [&ws](dcon::province_id p, dcon::nation_id n) {
2700 for(
auto a : ws.world.province_get_army_location(p)) {
2701 if(a.get_army().get_controller_from_army_control() == n)
2710 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
2711 auto result = ve::apply(
2712 [&ws](dcon::province_id p, dcon::nation_id n) {
2713 for(
auto a : ws.world.province_get_army_location(p)) {
2714 if(a.get_army().get_controller_from_army_control() == n)
2719 to_prov(primary_slot), owner);
2723 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
2724 auto result = ve::apply(
2725 [&ws](dcon::province_id p, dcon::nation_id n) {
2726 for(
auto a : ws.world.province_get_army_location(p)) {
2727 if(a.get_army().get_controller_from_army_control() == n)
2732 to_prov(primary_slot), owner);
2737 auto result = ve::apply(
2738 [&ws](dcon::province_id p, dcon::nation_id n) {
2739 for(
auto a : ws.world.province_get_army_location(p)) {
2740 if(a.get_army().get_controller_from_army_control() == n)
2745 to_prov(primary_slot), owner);
2749 auto holder = ws.world.national_identity_get_nation_from_identity_holder(
trigger::payload(tval[1]).tag_id);
2755 auto result = ve::apply([&ws](dcon::nation_id a, dcon::nation_id b) {
return military::are_at_war(ws, a, b); },
2760 auto result = ve::apply([&ws](dcon::nation_id a, dcon::nation_id b) {
return military::are_at_war(ws, a, b); },
2765 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
2766 auto result = ve::apply([&ws](dcon::nation_id a, dcon::nation_id b) {
return military::are_at_war(ws, a, b); },
2771 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
2772 auto result = ve::apply([&ws](dcon::nation_id a, dcon::nation_id b) {
return military::are_at_war(ws, a, b); },
2778 auto result = ve::apply([&ws](dcon::nation_id a, dcon::nation_id b) {
return military::are_at_war(ws, a, b); },
2786 auto result = ve::apply([&ws](dcon::province_id p) {
2787 for(
const auto ar : ws.world.province_get_army_location(p)) {
2788 if(ws.world.army_leadership_get_general(ws.world.army_get_army_leadership(ws.world.army_location_get_army(ar)))) {
2793 }, to_prov(primary_slot));
2794 return compare_to_true(tval[0], result);
2797 auto result = ve::apply([&ws, tval](dcon::state_instance_id p) {
2798 return ws.world.state_instance_get_owner_focus(p) ==
trigger::payload(tval[1]).nf_id;
2803 auto result = ve::apply([&ws, tval](dcon::province_id p) {
2804 return ws.world.state_instance_get_owner_focus(ws.world.province_get_state_membership(p)) ==
trigger::payload(tval[1]).
nf_id;
2809 return compare_values(tval[0], ws.world.nation_get_active_regiments(
to_nation(primary_slot)), int32_t(tval[1]));
2813 read_float_from_payload(tval + 1));
2816 return compare_values(tval[0], ws.world.nation_get_stockpiles(ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)),
economy::money),
2817 read_float_from_payload(tval + 1));
2820 return compare_values(tval[0], 1.0f - ws.world.nation_get_revanchism(
to_nation(primary_slot)),
2821 read_float_from_payload(tval + 1));
2824 return compare_to_true(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(primary_slot))) != dcon::nation_id());
2827 auto rp = ws.world.nation_get_ruling_party(
to_nation(primary_slot));
2828 return compare_values_eq(tval[0], ws.world.political_party_get_ideology(rp),
trigger::payload(tval[1]).
ideo_id);
2832 auto rp = ws.world.nation_get_ruling_party(owner);
2833 return compare_values_eq(tval[0], ws.world.political_party_get_ideology(rp),
trigger::payload(tval[1]).
ideo_id);
2836 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
2837 auto rp = ws.world.nation_get_ruling_party(owner);
2838 return compare_values_eq(tval[0], ws.world.political_party_get_ideology(rp),
trigger::payload(tval[1]).
ideo_id);
2841 auto rp = ws.world.nation_get_ruling_party(
to_nation(primary_slot));
2842 dcon::text_key name{dcon::text_key::value_base_t(read_int32_t_from_payload(tval + 1)) };
2843 return compare_values_eq(tval[0], ws.world.political_party_get_name(rp), name);
2849 return compare_values(tval[0],
2851 ws.defines.movement_support_uh_factor / ws.world.nation_get_non_colonial_population(
to_nation(primary_slot)),
2852 read_float_from_payload(tval + 1));
2855 return compare_values(tval[0], ws.world.pop_get_political_reform_desire(
to_pop(primary_slot)),
2856 read_float_from_payload(tval + 1));
2859 return compare_values(tval[0],
2861 ws.defines.movement_support_uh_factor / ws.world.nation_get_non_colonial_population(
to_nation(primary_slot)),
2862 read_float_from_payload(tval + 1));
2865 return compare_values(tval[0], ws.world.pop_get_social_reform_desire(
to_pop(primary_slot)), read_float_from_payload(tval + 1));
2868 auto result = ve::apply(
2869 [&ws](dcon::nation_id n) {
2871 for(
auto a : ws.world.nation_get_navy_control(n)) {
2872 auto memb = a.get_navy().get_navy_membership();
2873 total += int32_t(memb.end() - memb.begin());
2878 return compare_values(tval[0], result, int32_t(tval[1]));
2881 return compare_values(tval[0], ws.world.nation_get_plurality(
to_nation(primary_slot)), read_float_from_payload(tval + 1) / 100.0f);
2884 return compare_values(tval[0], ws.world.nation_get_plurality(
nations::owner_of_pop(ws,
to_pop(primary_slot))), read_float_from_payload(tval + 1) / 100.0f);
2888 read_float_from_payload(tval + 1));
2892 return compare_values_eq(tval[0], ws.world.nation_get_religion(owner), ws.world.pop_get_religion(
to_pop(primary_slot)));
2895 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
2896 return compare_values_eq(tval[0], ws.world.nation_get_religion(owner),
2897 ws.world.province_get_dominant_religion(
to_prov(primary_slot)));
2900 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
2901 return compare_values_eq(tval[0], ws.world.nation_get_religion(owner),
2902 ws.world.state_instance_get_dominant_religion(
to_state(primary_slot)));
2906 return compare_values_eq(tval[0], ws.world.nation_get_primary_culture(owner), ws.world.pop_get_culture(
to_pop(primary_slot)));
2909 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
2910 return compare_values_eq(tval[0], ws.world.nation_get_primary_culture(owner),
2911 ws.world.province_get_dominant_culture(
to_prov(primary_slot)));
2914 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
2915 return compare_values_eq(tval[0], ws.world.nation_get_primary_culture(owner),
2916 ws.world.state_instance_get_dominant_culture(
to_state(primary_slot)));
2919 return compare_values_eq(tval[0], ws.world.nation_get_primary_culture(
to_nation(primary_slot)),
2920 ws.world.nation_get_primary_culture(
to_nation(from_slot)));
2923 auto this_owner = ws.world.province_get_nation_from_province_ownership(
to_prov(from_slot));
2924 return compare_values_eq(tval[0], ws.world.nation_get_primary_culture(
to_nation(primary_slot)),
2925 ws.world.nation_get_primary_culture(this_owner));
2928 return compare_values_eq(tval[0], ws.world.nation_get_primary_culture(
to_nation(primary_slot)),
2929 ws.world.nation_get_primary_culture(
to_nation(this_slot)));
2932 return compare_values_eq(tval[0], ws.world.nation_get_primary_culture(
to_nation(primary_slot)),
2933 ws.world.pop_get_culture(
to_pop(this_slot)));
2936 auto this_owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
2937 return compare_values_eq(tval[0], ws.world.nation_get_primary_culture(
to_nation(primary_slot)),
2938 ws.world.nation_get_primary_culture(this_owner));
2941 auto this_owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
2942 return compare_values_eq(tval[0], ws.world.nation_get_primary_culture(
to_nation(primary_slot)),
2943 ws.world.nation_get_primary_culture(this_owner));
2946 return compare_values_eq(tval[0], ws.world.state_instance_get_dominant_culture(
to_state(primary_slot)),
2947 ws.world.nation_get_primary_culture(
to_nation(this_slot)));
2951 return compare_values_eq(tval[0], ws.world.state_instance_get_dominant_culture(
to_state(primary_slot)),
2952 ws.world.nation_get_primary_culture(this_owner));
2955 auto this_owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
2956 return compare_values_eq(tval[0], ws.world.state_instance_get_dominant_culture(
to_state(primary_slot)),
2957 ws.world.nation_get_primary_culture(this_owner));
2960 auto this_owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
2961 return compare_values_eq(tval[0], ws.world.state_instance_get_dominant_culture(
to_state(primary_slot)),
2962 ws.world.nation_get_primary_culture(this_owner));
2965 return compare_values_eq(tval[0], ws.world.province_get_dominant_culture(
to_prov(primary_slot)),
2966 ws.world.nation_get_primary_culture(
to_nation(this_slot)));
2970 return compare_values_eq(tval[0], ws.world.province_get_dominant_culture(
to_prov(primary_slot)),
2971 ws.world.nation_get_primary_culture(this_owner));
2974 auto this_owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
2975 return compare_values_eq(tval[0], ws.world.province_get_dominant_culture(
to_prov(primary_slot)),
2976 ws.world.nation_get_primary_culture(this_owner));
2979 auto this_owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
2980 return compare_values_eq(tval[0], ws.world.province_get_dominant_culture(
to_prov(primary_slot)),
2981 ws.world.nation_get_primary_culture(this_owner));
2984 return compare_values_eq(tval[0], ws.world.pop_get_culture(
to_pop(primary_slot)),
2985 ws.world.nation_get_primary_culture(
to_nation(this_slot)));
2989 return compare_values_eq(tval[0], ws.world.pop_get_culture(
to_pop(primary_slot)),
2990 ws.world.nation_get_primary_culture(this_owner));
2993 auto this_owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
2994 return compare_values_eq(tval[0], ws.world.pop_get_culture(
to_pop(primary_slot)),
2995 ws.world.nation_get_primary_culture(this_owner));
2998 auto this_owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
2999 return compare_values_eq(tval[0], ws.world.pop_get_culture(
to_pop(primary_slot)),
3000 ws.world.nation_get_primary_culture(this_owner));
3003template<
typename N,
typename C>
3006 [&ws](dcon::nation_id n, dcon::culture_id c) {
3007 return ws.
world.nation_get_accepted_cultures(n, c);
3018 auto this_owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
3022 auto this_owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
3027 ws.world.nation_get_primary_culture(
to_nation(this_slot))));
3032 ws.world.nation_get_primary_culture(this_owner)));
3035 auto this_owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
3037 ws.world.nation_get_primary_culture(this_owner)));
3040 auto this_owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
3042 ws.world.nation_get_primary_culture(this_owner)));
3046 ws.world.nation_get_primary_culture(
to_nation(this_slot))));
3051 ws.world.nation_get_primary_culture(this_owner)));
3054 auto this_owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
3056 ws.world.nation_get_primary_culture(this_owner)));
3059 auto this_owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
3061 ws.world.nation_get_primary_culture(this_owner)));
3071 auto this_owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
3075 auto this_owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
3081 auto is_accepted = ve::apply(
3082 [&ws](dcon::nation_id n, dcon::culture_id c) {
3084 return ws.world.nation_get_accepted_cultures(n, c);
3088 owner, ws.world.pop_get_culture(
to_pop(primary_slot)));
3092 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
3093 auto is_accepted = ve::apply(
3094 [&ws](dcon::nation_id n, dcon::culture_id c) {
3096 return ws.world.nation_get_accepted_cultures(n, c);
3100 owner, ws.world.province_get_dominant_culture(
to_prov(primary_slot)));
3104 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
3105 auto is_accepted = ve::apply(
3106 [&ws](dcon::nation_id n, dcon::culture_id c) {
3108 return ws.world.nation_get_accepted_cultures(n, c);
3112 owner, ws.world.state_instance_get_dominant_culture(
to_state(primary_slot)));
3119 auto result = ve::apply(
3120 [&ws](dcon::state_instance_id s) {
3127 return compare_values_eq(tval[0], ws.world.nation_get_in_sphere_of(
to_nation(primary_slot)),
3128 ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id));
3131 return compare_values_eq(tval[0], ws.world.nation_get_in_sphere_of(
to_nation(primary_slot)),
to_nation(from_slot));
3134 return compare_values_eq(tval[0], ws.world.nation_get_in_sphere_of(
to_nation(primary_slot)),
to_nation(this_slot));
3137 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
3138 return compare_values_eq(tval[0], ws.world.nation_get_in_sphere_of(
to_nation(primary_slot)), owner);
3141 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
3142 return compare_values_eq(tval[0], ws.world.nation_get_in_sphere_of(
to_nation(primary_slot)), owner);
3146 return compare_values_eq(tval[0], ws.world.nation_get_in_sphere_of(
to_nation(primary_slot)), owner);
3162 [&](dcon::state_instance_id si, dcon::nation_id o) {
3163 auto d = ws.world.state_instance_get_definition(si);
3164 for(
auto p : ws.world.state_definition_get_abstract_state_membership(d)) {
3165 if(p.get_province().get_nation_from_province_ownership() == o) {
3166 if(p.get_province().get_rgo() == good)
3171 for(auto f : p.get_province().get_factory_location()) {
3172 if(f.get_factory().get_building_type().get_output() == good)
3179 to_state(primary_slot), ws.world.state_instance_get_nation_from_state_ownership(to_state(primary_slot))));
3182 auto pop_location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
3194 return compare_values(tval[0],
ve::select(total_pop > 0, mil_amount / total_pop, 0.0f), read_float_from_payload(tval + 1));
3199 return compare_values(tval[0],
ve::select(total_pop > 0, mil_amount / total_pop, 0.0f), read_float_from_payload(tval + 1));
3204 return compare_values(tval[0],
ve::select(total_pop > 0, mil_amount / total_pop, 0.0f), read_float_from_payload(tval + 1));
3209 return compare_values(tval[0],
ve::select(total_pop > 0, mil_amount / total_pop, 0.0f), read_float_from_payload(tval + 1));
3214 return compare_values(tval[0],
ve::select(total_pop > 0, mil_amount / total_pop, 0.0f), read_float_from_payload(tval + 1));
3219 return compare_values(tval[0],
ve::select(total_pop > 0, mil_amount / total_pop, 0.0f), read_float_from_payload(tval + 1));
3223 auto prior_opt = dcon::issue_option_id(dcon::issue_option_id::value_base_t(ref_id.index() - 1));
3224 auto reform_parent = ws.world.issue_option_get_parent_issue(ref_id);
3225 auto active_option = ws.world.nation_get_issues(
to_nation(primary_slot), reform_parent);
3227 return compare_values_eq(tval[0], active_option, prior_opt);
3233 auto prior_opt = dcon::issue_option_id(dcon::issue_option_id::value_base_t(ref_id.index() - 1));
3234 auto reform_parent = ws.world.issue_option_get_parent_issue(ref_id);
3235 auto active_option = ws.world.nation_get_issues(owner, reform_parent);
3237 return compare_values_eq(tval[0], active_option, prior_opt);
3241 auto prior_opt = dcon::reform_option_id(dcon::reform_option_id::value_base_t(ref_id.index() - 1));
3242 auto reform_parent = ws.world.reform_option_get_parent_reform(ref_id);
3243 auto active_option = ws.world.nation_get_reforms(
to_nation(primary_slot), reform_parent);
3245 return compare_values_eq(tval[0], active_option, prior_opt);
3251 auto prior_opt = dcon::reform_option_id(dcon::reform_option_id::value_base_t(ref_id.index() - 1));
3252 auto reform_parent = ws.world.reform_option_get_parent_reform(ref_id);
3253 auto active_option = ws.world.nation_get_reforms(owner, reform_parent);
3255 return compare_values_eq(tval[0], active_option, prior_opt);
3263 return compare_values(tval[0], value, read_float_from_payload(tval + 1));
3268 return compare_values(tval[0], value, read_float_from_payload(tval + 1));
3271 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
3272 auto culture = ws.world.pop_get_culture(
to_pop(primary_slot));
3274 auto result = ve::apply(
3275 [&ws](dcon::province_id p, dcon::culture_id c) {
3276 for(
auto co : ws.world.province_get_core(p)) {
3277 if(co.get_identity().get_primary_culture() == c)
3288 auto result = ve::apply(
3289 [&ws](dcon::province_id p, dcon::culture_id c) {
3290 for(
auto co : ws.world.province_get_core(p)) {
3291 if(co.get_identity().get_primary_culture() == c)
3300 return compare_values(tval[0], ws.world.province_get_nationalism(
to_prov(primary_slot)),
float(tval[1]));
3313 ws.world.province_get_rebel_faction_from_province_rebel_control(
to_prov(primary_slot)) != dcon::rebel_faction_id());
3316 return compare_values_eq(tval[0], ws.world.province_get_nation_from_province_control(
to_prov(primary_slot)),
3317 ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id));
3320 return compare_values_eq(tval[0], ws.world.province_get_nation_from_province_control(
to_prov(primary_slot)),
3324 return compare_values_eq(tval[0], ws.world.province_get_nation_from_province_control(
to_prov(primary_slot)),
3328 return compare_values_eq(tval[0], ws.world.province_get_nation_from_province_control(
to_prov(primary_slot)),
3329 ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot)));
3332 return compare_values_eq(tval[0], ws.world.province_get_nation_from_province_control(
to_prov(primary_slot)),
3333 ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot)));
3336 return compare_values_eq(tval[0], ws.world.province_get_nation_from_province_control(
to_prov(primary_slot)),
3340 return compare_values_eq(tval[0], ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)),
3341 ws.world.province_get_nation_from_province_control(
to_prov(primary_slot)));
3344 return compare_values_eq(tval[0], ws.world.province_get_rebel_faction_from_province_rebel_control(
to_prov(primary_slot)),
3348 return compare_to_true(tval[0], (ws.world.province_adjacency_get_type(ws.province_definitions.canals[tval[1] - 1]) &
3352 auto sid = ws.world.province_get_state_membership(
to_prov(primary_slot));
3353 return compare_values_eq(tval[0], ws.world.state_instance_get_capital(sid),
to_prov(primary_slot));
3356 auto id = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
3357 auto sid = ws.world.province_get_state_membership(
id);
3358 return compare_values_eq(tval[0], ws.world.state_instance_get_capital(sid),
id);
3361 auto holder = ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id);
3362 auto result = ve::apply(
3363 [&ws, holder](dcon::nation_id a) {
3364 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, holder);
3365 auto date = ws.world.diplomatic_relation_get_truce_until(rel);
3366 return bool(date) && date > ws.current_date;
3372 auto result = ve::apply(
3373 [&ws](dcon::nation_id a, dcon::nation_id b) {
3374 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, b);
3375 auto date = ws.world.diplomatic_relation_get_truce_until(rel);
3376 return bool(date) && date > ws.current_date;
3382 auto result = ve::apply(
3383 [&ws](dcon::nation_id a, dcon::nation_id b) {
3384 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, b);
3385 auto date = ws.world.diplomatic_relation_get_truce_until(rel);
3386 return bool(date) && date > ws.current_date;
3392 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
3393 auto result = ve::apply(
3394 [&ws](dcon::nation_id a, dcon::nation_id b) {
3395 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, b);
3396 auto date = ws.world.diplomatic_relation_get_truce_until(rel);
3397 return bool(date) && date > ws.current_date;
3403 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
3404 auto result = ve::apply(
3405 [&ws](dcon::nation_id a, dcon::nation_id b) {
3406 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, b);
3407 auto date = ws.world.diplomatic_relation_get_truce_until(rel);
3408 return bool(date) && date > ws.current_date;
3415 auto result = ve::apply(
3416 [&ws](dcon::nation_id a, dcon::nation_id b) {
3417 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, b);
3418 auto date = ws.world.diplomatic_relation_get_truce_until(rel);
3419 return bool(date) && date > ws.current_date;
3426 read_float_from_payload(tval + 1));
3430 read_float_from_payload(tval + 1));
3434 read_float_from_payload(tval + 1));
3437 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
3438 return compare_values(tval[0], ws.world.province_get_demographics(location,
demographics::total),
3439 read_float_from_payload(tval + 1));
3458 return compare_values_eq(tval[0], ws.world.pop_get_poptype(
to_pop(primary_slot)), type);
3461 auto result = ve::apply(
3462 [&ws](dcon::province_id p) {
3464 for(
auto a : ws.world.province_get_province_adjacency(p)) {
3465 auto other = a.get_connected_provinces(0) != p ? a.get_connected_provinces(0) : a.get_connected_provinces(1);
3477 dcon::unit_name_id name{ dcon::unit_name_id::value_base_t(read_int32_t_from_payload(tval + 1)) };
3478 auto result = ve::apply(
3479 [&ws, name](dcon::nation_id n) {
3480 for(
auto l : ws.world.nation_get_leader_loyalty(n)) {
3481 auto lname = l.get_leader().get_name();
3482 if(ws.to_string_view(lname) == ws.to_string_view(name))
3494 auto result = ve::apply(
3495 [&ws](dcon::nation_id n) {
3496 for(
uint32_t i = 0; i < ws.world.national_identity_size(); ++i) {
3497 dcon::national_identity_id tag{dcon::national_identity_id::value_base_t(i)};
3513 return compare_values_eq(tval[0],
to_prov(primary_slot),
payload(tval[1]).prov_id);
3516 auto tag_holder = ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id);
3517 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(primary_slot))),
3521 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(primary_slot))),
3525 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(primary_slot))),
3529 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
3530 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(primary_slot))),
3534 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
3535 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(primary_slot))),
3540 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(primary_slot))),
3544 auto tag_holder = ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id);
3545 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)))),
3549 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)))),
3553 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)))),
3557 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
3558 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)))),
3562 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
3563 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)))),
3568 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)))),
3574 auto tag_holder = ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id);
3576 ws.world.nation_get_is_substate(
to_nation(primary_slot)) &&
3577 (ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(primary_slot))) == tag_holder));
3581 (ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
3586 (ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
3590 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
3592 ws.world.nation_get_is_substate(
to_nation(primary_slot)) &&
3593 (ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(primary_slot))) == owner));
3596 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
3598 ws.world.nation_get_is_substate(
to_nation(primary_slot)) &&
3599 (ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(primary_slot))) == owner));
3604 ws.world.nation_get_is_substate(
to_nation(primary_slot)) &&
3605 (ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(primary_slot))) == owner));
3608 auto tag_holder = ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id);
3609 auto result = ve::apply(
3610 [&ws, tag_holder](dcon::nation_id n) {
3611 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(n, tag_holder);
3612 return bool(rel) && ws.world.diplomatic_relation_get_are_allied(rel);
3618 auto result = ve::apply(
3619 [&ws](dcon::nation_id n, dcon::nation_id m) {
3620 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(n, m);
3621 return bool(rel) && ws.world.diplomatic_relation_get_are_allied(rel);
3627 auto result = ve::apply(
3628 [&ws](dcon::nation_id n, dcon::nation_id m) {
3629 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(n, m);
3630 return bool(rel) && ws.world.diplomatic_relation_get_are_allied(rel);
3636 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
3637 auto result = ve::apply(
3638 [&ws](dcon::nation_id n, dcon::nation_id m) {
3639 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(n, m);
3640 return bool(rel) && ws.world.diplomatic_relation_get_are_allied(rel);
3646 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
3647 auto result = ve::apply(
3648 [&ws](dcon::nation_id n, dcon::nation_id m) {
3649 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(n, m);
3650 return bool(rel) && ws.world.diplomatic_relation_get_are_allied(rel);
3657 auto result = ve::apply(
3658 [&ws](dcon::nation_id n, dcon::nation_id m) {
3659 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(n, m);
3660 return bool(rel) && ws.world.diplomatic_relation_get_are_allied(rel);
3667 [&](dcon::nation_id n) {
3668 auto d = ws.world.nation_get_last_war_loss(n);
3669 return bool(d) && ws.current_date <= (d + 365 * 5);
3674 [&](dcon::nation_id n) {
3675 auto d = ws.world.nation_get_last_war_loss(n);
3676 return bool(d) && ws.current_date <= (d + 365 * 5);
3683 return compare_values(tval[0],
3684 ws.world.nation_get_modifier_values(
to_nation(primary_slot), sys::national_mod_offsets::mobilization_size),
3685 read_float_from_payload(tval + 1));
3689 ws.world.nation_get_education_spending(
to_nation(primary_slot)));
3692 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
3693 return compare_to_true(tval[0], ws.world.nation_get_administrative_spending(owner) >= ws.world.nation_get_education_spending(owner));
3696 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
3697 return compare_to_true(tval[0], ws.world.nation_get_administrative_spending(owner) >= ws.world.nation_get_education_spending(owner));
3701 return compare_to_true(tval[0], ws.world.nation_get_administrative_spending(owner) >= ws.world.nation_get_education_spending(owner));
3705 auto ruling_ideology = ws.world.political_party_get_ideology(ws.world.nation_get_ruling_party(owner));
3706 auto population_size = ws.world.pop_get_size(
to_pop(primary_slot));
3707 auto ruling_support = ve::apply(
3708 [&](dcon::pop_id p, dcon::ideology_id i) {
3714 to_pop(primary_slot), ruling_ideology);
3715 return compare_values(tval[0],
ve::select(population_size > 0.0f, ruling_support / population_size, 0.0f),
3716 read_float_from_payload(tval + 1));
3719 auto cap_p = ws.world.state_instance_get_capital(
to_state(primary_slot));
3720 return compare_to_true(tval[0], ws.world.province_get_is_colonial(cap_p));
3726 return compare_to_true(tval[0], ws.world.province_get_is_colonial(ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot))));
3729 auto result = ve::apply(
3735 auto result = ve::apply(
3736 [&ws](dcon::nation_id n) {
3737 for(
auto p : ws.world.nation_get_province_ownership(n)) {
3738 auto rng = p.get_province().get_factory_location();
3739 if(rng.begin() != rng.end())
3751 auto holder = ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id);
3767 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
3773 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
3785 return compare_values(tval[0], ws.world.nation_get_total_ports(
to_nation(primary_slot)), tval[1]);
3792 [&ws](dcon::nation_id n) {
3793 auto d = ws.world.nation_get_election_ends(n);
3794 return bool(d) && d > ws.current_date;
3798 return compare_to_true(tval[0], ws.national_definitions.is_global_flag_variable_set(
payload(tval[1]).glob_id));
3801 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
3802 return compare_values_eq(tval[0], ws.world.nation_get_capital(owner),
to_prov(primary_slot));
3805 return compare_values_eq(tval[0], ws.world.nation_get_national_value(
to_nation(primary_slot)),
payload(tval[1]).mod_id);
3809 return compare_values_eq(tval[0], ws.world.nation_get_national_value(owner),
payload(tval[1]).mod_id);
3812 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
3813 return compare_values_eq(tval[0], ws.world.nation_get_national_value(owner),
payload(tval[1]).mod_id);
3816 return compare_values(tval[0], ws.world.nation_get_industrial_score(
to_nation(primary_slot)), tval[1]);
3819 return compare_values(tval[0], ws.world.nation_get_industrial_score(
to_nation(primary_slot)),
3820 ws.world.nation_get_industrial_score(ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id)));
3823 return compare_values(tval[0], ws.world.nation_get_industrial_score(
to_nation(primary_slot)),
3824 ws.world.nation_get_industrial_score(
to_nation(from_slot)));
3827 return compare_values(tval[0], ws.world.nation_get_industrial_score(
to_nation(primary_slot)),
3828 ws.world.nation_get_industrial_score(
to_nation(this_slot)));
3832 return compare_values(tval[0], ws.world.nation_get_industrial_score(
to_nation(primary_slot)),
3833 ws.world.nation_get_industrial_score(owner));
3836 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
3837 return compare_values(tval[0], ws.world.nation_get_industrial_score(
to_nation(primary_slot)),
3838 ws.world.nation_get_industrial_score(owner));
3841 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
3842 return compare_values(tval[0], ws.world.nation_get_industrial_score(
to_nation(primary_slot)),
3843 ws.world.nation_get_industrial_score(owner));
3846 return compare_values(tval[0], ws.world.nation_get_military_score(
to_nation(primary_slot)), tval[1]);
3849 return compare_values(tval[0], ws.world.nation_get_military_score(
to_nation(primary_slot)),
3850 ws.world.nation_get_military_score(ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id)));
3853 return compare_values(tval[0], ws.world.nation_get_military_score(
to_nation(primary_slot)),
3854 ws.world.nation_get_military_score(
to_nation(from_slot)));
3857 return compare_values(tval[0], ws.world.nation_get_military_score(
to_nation(primary_slot)),
3858 ws.world.nation_get_military_score(
to_nation(this_slot)));
3862 return compare_values(tval[0], ws.world.nation_get_military_score(
to_nation(primary_slot)),
3863 ws.world.nation_get_military_score(owner));
3866 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
3867 return compare_values(tval[0], ws.world.nation_get_military_score(
to_nation(primary_slot)),
3868 ws.world.nation_get_military_score(owner));
3871 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
3872 return compare_values(tval[0], ws.world.nation_get_military_score(
to_nation(primary_slot)),
3873 ws.world.nation_get_military_score(owner));
3880 return compare_to_true(tval[0], ws.world.nation_get_is_civilized(owner));
3883 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
3884 return compare_to_true(tval[0], ws.world.nation_get_is_civilized(owner));
3888 read_float_from_payload(tval + 1));
3895 return compare_to_true(tval[0], ws.world.nation_get_is_great_power(owner));
3898 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
3899 return compare_to_true(tval[0], ws.world.nation_get_is_great_power(owner));
3902 return compare_values(tval[0], ws.world.nation_get_rich_tax(
to_nation(primary_slot)),
payload(tval[1]).signed_value);
3905 return compare_values(tval[0], ws.world.nation_get_middle_tax(
to_nation(primary_slot)),
payload(tval[1]).signed_value);
3908 return compare_values(tval[0], ws.world.nation_get_poor_tax(
to_nation(primary_slot)),
payload(tval[1]).signed_value);
3920 return compare_values(tval[0],
ve::to_float(ws.world.nation_get_social_spending(
to_nation(primary_slot))) * ws.world.nation_get_spending_level(
to_nation(primary_slot)),
float(
payload(tval[1]).signed_value));
3924 return compare_values(tval[0],
ve::to_float(ws.world.nation_get_social_spending(owner)) * ws.world.nation_get_spending_level(owner),
float(
payload(tval[1]).signed_value));
3927 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
3928 return compare_values(tval[0],
ve::to_float(ws.world.nation_get_social_spending(owner)) * ws.world.nation_get_spending_level(owner),
float(
payload(tval[1]).signed_value));
3931 return compare_values(tval[0],
ve::to_float(ws.world.nation_get_military_spending(
to_nation(primary_slot))) * ws.world.nation_get_spending_level(
to_nation(primary_slot)),
float(
payload(tval[1]).signed_value));
3935 return compare_values(tval[0],
ve::to_float(ws.world.nation_get_military_spending(owner)) * ws.world.nation_get_spending_level(owner),
float(
payload(tval[1]).signed_value));
3938 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
3939 return compare_values(tval[0],
ve::to_float(ws.world.nation_get_military_spending(owner)) * ws.world.nation_get_spending_level(owner),
float(
payload(tval[1]).signed_value));
3942 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
3943 return compare_values(tval[0],
ve::to_float(ws.world.nation_get_military_spending(owner)) * ws.world.nation_get_spending_level(owner),
float(
payload(tval[1]).signed_value));
3946 return compare_values(tval[0],
ve::to_float(ws.world.nation_get_administrative_spending(
to_nation(primary_slot))) * ws.world.nation_get_spending_level(
to_nation(primary_slot)),
float(
payload(tval[1]).signed_value));
3950 return compare_values(tval[0],
ve::to_float(ws.world.nation_get_administrative_spending(owner)) * ws.world.nation_get_spending_level(owner),
float(
payload(tval[1]).signed_value));
3953 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
3954 return compare_values(tval[0],
ve::to_float(ws.world.nation_get_administrative_spending(owner)) * ws.world.nation_get_spending_level(owner),
float(
payload(tval[1]).signed_value));
3957 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
3958 return compare_values(tval[0],
ve::to_float(ws.world.nation_get_administrative_spending(owner)) * ws.world.nation_get_spending_level(owner),
float(
payload(tval[1]).signed_value));
3961 return compare_values(tval[0],
ve::to_float(ws.world.nation_get_education_spending(
to_nation(primary_slot))) * ws.world.nation_get_spending_level(
to_nation(primary_slot)),
float(
payload(tval[1]).signed_value));
3965 return compare_values(tval[0],
ve::to_float(ws.world.nation_get_education_spending(owner)) * ws.world.nation_get_spending_level(owner),
float(
payload(tval[1]).signed_value));
3968 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
3969 return compare_values(tval[0],
ve::to_float(ws.world.nation_get_education_spending(owner)) * ws.world.nation_get_spending_level(owner),
float(
payload(tval[1]).signed_value));
3972 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
3973 return compare_values(tval[0],
ve::to_float(ws.world.nation_get_education_spending(owner)) * ws.world.nation_get_spending_level(owner),
float(
payload(tval[1]).signed_value));
3979 return compare_values_eq(tval[0], ws.world.nation_get_dominant_religion(
to_nation(primary_slot)),
payload(tval[1]).rel_id);
3982 return compare_values_eq(tval[0], ws.world.nation_get_dominant_religion(
to_nation(primary_slot)), ws.world.nation_get_religion(
to_nation(this_slot)));
3985 return compare_values_eq(tval[0], ws.world.state_instance_get_dominant_religion(
to_state(primary_slot)),
3989 return compare_values_eq(tval[0], ws.world.province_get_dominant_religion(
to_prov(primary_slot)),
payload(tval[1]).rel_id);
3992 return compare_values_eq(tval[0], ws.world.nation_get_dominant_culture(
to_nation(primary_slot)),
payload(tval[1]).cul_id);
3995 return compare_values_eq(tval[0], ws.world.state_instance_get_dominant_culture(
to_state(primary_slot)),
3999 return compare_values_eq(tval[0], ws.world.province_get_dominant_culture(
to_prov(primary_slot)),
payload(tval[1]).cul_id);
4002 return compare_values_eq(tval[0], ws.world.nation_get_dominant_issue_option(
to_nation(primary_slot)),
payload(tval[1]).opt_id);
4005 return compare_values_eq(tval[0], ws.world.state_instance_get_dominant_issue_option(
to_state(primary_slot)),
4009 return compare_values_eq(tval[0], ws.world.province_get_dominant_issue_option(
to_prov(primary_slot)),
payload(tval[1]).opt_id);
4012 return compare_values_eq(tval[0], ws.world.pop_get_dominant_issue_option(
to_pop(primary_slot)),
payload(tval[1]).opt_id);
4015 return compare_values_eq(tval[0], ws.world.nation_get_dominant_ideology(
to_nation(primary_slot)),
payload(tval[1]).ideo_id);
4018 return compare_values_eq(tval[0], ws.world.state_instance_get_dominant_ideology(
to_state(primary_slot)),
4022 return compare_values_eq(tval[0], ws.world.province_get_dominant_ideology(
to_prov(primary_slot)),
payload(tval[1]).ideo_id);
4025 return compare_values_eq(tval[0], ws.world.pop_get_dominant_ideology(
to_pop(primary_slot)),
payload(tval[1]).ideo_id);
4029 return compare_values(tval[0],
4032 read_float_from_payload(tval + 1));
4036 return compare_values(tval[0],
4039 read_float_from_payload(tval + 1));
4043 return compare_values(tval[0],
4046 read_float_from_payload(tval + 1));
4049 auto type = ws.world.pop_get_poptype(
to_pop(primary_slot));
4051 return compare_values(tval[0],
ve::select(is_poor, ws.world.pop_get_militancy(
to_pop(primary_slot)), 0.0f),
4052 read_float_from_payload(tval + 1));
4056 return compare_values(tval[0],
4059 read_float_from_payload(tval + 1));
4063 return compare_values(tval[0],
4066 read_float_from_payload(tval + 1));
4070 return compare_values(tval[0],
4073 read_float_from_payload(tval + 1));
4076 auto type = ws.world.pop_get_poptype(
to_pop(primary_slot));
4078 return compare_values(tval[0],
ve::select(is_middle, ws.world.pop_get_militancy(
to_pop(primary_slot)), 0.0f),
4079 read_float_from_payload(tval + 1));
4083 return compare_values(tval[0],
4086 read_float_from_payload(tval + 1));
4090 return compare_values(tval[0],
4093 read_float_from_payload(tval + 1));
4097 return compare_values(tval[0],
4100 read_float_from_payload(tval + 1));
4103 auto type = ws.world.pop_get_poptype(
to_pop(primary_slot));
4105 return compare_values(tval[0],
ve::select(is_rich, ws.world.pop_get_militancy(
to_pop(primary_slot)), 0.0f),
4106 read_float_from_payload(tval + 1));
4110 ws.world.nation_get_rich_tax(
to_nation(primary_slot)) > ws.world.nation_get_poor_tax(
to_nation(primary_slot)));
4113 auto pop_culture = ws.world.pop_get_culture(
to_pop(primary_slot));
4114 auto cg = ws.world.culture_get_group_from_culture_group_membership(pop_culture);
4115 auto utag = ws.world.culture_group_get_identity_from_cultural_union_of(cg);
4116 return compare_to_true(tval[0], utag != dcon::national_identity_id());
4119 auto pc = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
4120 auto cg = ws.world.culture_get_group_from_culture_group_membership(pc);
4121 auto utag = ws.world.culture_group_get_identity_from_cultural_union_of(cg);
4122 return compare_to_true(tval[0], utag != dcon::national_identity_id());
4125 auto pc = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
4126 auto cg = ws.world.culture_get_group_from_culture_group_membership(pc);
4127 auto utag = ws.world.culture_group_get_identity_from_cultural_union_of(cg);
4128 return compare_values_eq(tval[0], utag,
payload(tval[1]).tag_id);
4131 auto pc = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
4132 auto cg = ws.world.culture_get_group_from_culture_group_membership(pc);
4133 auto utag = ws.world.culture_group_get_identity_from_cultural_union_of(cg);
4134 return compare_values_eq(tval[0], utag, ws.world.nation_get_identity_from_identity_holder(
to_nation(from_slot)));
4137 auto pc = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
4138 auto cg = ws.world.culture_get_group_from_culture_group_membership(pc);
4139 auto utag = ws.world.culture_group_get_identity_from_cultural_union_of(cg);
4140 return compare_values_eq(tval[0], utag, ws.world.nation_get_identity_from_identity_holder(
to_nation(this_slot)));
4143 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
4144 auto pc = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
4145 auto cg = ws.world.culture_get_group_from_culture_group_membership(pc);
4146 auto utag = ws.world.culture_group_get_identity_from_cultural_union_of(cg);
4147 return compare_values_eq(tval[0], utag, ws.world.nation_get_identity_from_identity_holder(owner));
4150 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
4151 auto pc = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
4152 auto cg = ws.world.culture_get_group_from_culture_group_membership(pc);
4153 auto utag = ws.world.culture_group_get_identity_from_cultural_union_of(cg);
4154 return compare_values_eq(tval[0], utag, ws.world.nation_get_identity_from_identity_holder(owner));
4158 auto pc = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
4159 auto cg = ws.world.culture_get_group_from_culture_group_membership(pc);
4160 auto utag = ws.world.culture_group_get_identity_from_cultural_union_of(cg);
4161 return compare_values_eq(tval[0], utag, ws.world.nation_get_identity_from_identity_holder(owner));
4164 auto prim_culture = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
4165 auto this_culture = ws.world.nation_get_primary_culture(
to_nation(this_slot));
4166 auto pcg = ws.world.culture_get_group_from_culture_group_membership(prim_culture);
4167 auto tcg = ws.world.culture_get_group_from_culture_group_membership(this_culture);
4168 return compare_values_eq(tval[0], pcg, tcg);
4171 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
4172 auto prim_culture = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
4173 auto this_culture = ws.world.nation_get_primary_culture(owner);
4174 auto pcg = ws.world.culture_get_group_from_culture_group_membership(prim_culture);
4175 auto tcg = ws.world.culture_get_group_from_culture_group_membership(this_culture);
4176 return compare_values_eq(tval[0], pcg, tcg);
4179 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
4180 auto prim_culture = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
4181 auto this_culture = ws.world.nation_get_primary_culture(owner);
4182 auto pcg = ws.world.culture_get_group_from_culture_group_membership(prim_culture);
4183 auto tcg = ws.world.culture_get_group_from_culture_group_membership(this_culture);
4184 return compare_values_eq(tval[0], pcg, tcg);
4188 auto prim_culture = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
4189 auto this_culture = ws.world.nation_get_primary_culture(owner);
4190 auto pcg = ws.world.culture_get_group_from_culture_group_membership(prim_culture);
4191 auto tcg = ws.world.culture_get_group_from_culture_group_membership(this_culture);
4192 return compare_values_eq(tval[0], pcg, tcg);
4196 auto pculture = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
4198 auto accepted_pop = ve::apply(
4199 [&ws](dcon::nation_id n, dcon::culture_id pc) {
4203 for(
auto ac : ws.world.in_culture) {
4204 if(ws.world.nation_get_accepted_cultures(n, ac)) {
4205 accumulated += ws.world.nation_get_demographics(n, demographics::to_key(ws, ac));
4210 to_nation(primary_slot), pculture);
4212 return compare_to_true(tval[0], total_pop != accepted_pop);
4216 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
4217 auto pculture = ws.world.nation_get_primary_culture(owner);
4219 auto accepted_pop = ve::apply(
4220 [&ws](dcon::state_instance_id i, dcon::nation_id n, dcon::culture_id pc) {
4224 for(
auto ac : ws.world.in_culture) {
4225 if(ws.world.nation_get_accepted_cultures(n, ac)) {
4226 accumulated += ws.world.state_instance_get_demographics(i, demographics::to_key(ws, ac));
4231 to_state(primary_slot), owner, pculture);
4233 return compare_to_true(tval[0], total_pop != accepted_pop);
4237 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
4238 auto pculture = ws.world.nation_get_primary_culture(owner);
4240 auto accepted_pop = ve::apply(
4241 [&ws](dcon::province_id i, dcon::nation_id n, dcon::culture_id pc) {
4245 for(
auto ac : ws.world.in_culture) {
4246 if(ws.world.nation_get_accepted_cultures(n, ac)) {
4247 accumulated += ws.world.province_get_demographics(i, demographics::to_key(ws, ac));
4252 to_prov(primary_slot), owner, pculture);
4254 return compare_to_true(tval[0], total_pop != accepted_pop);
4257 return compare_values(tval[0], ws.world.nation_get_revanchism(
to_nation(primary_slot)), read_float_from_payload(tval + 1));
4261 return compare_values(tval[0], ws.world.nation_get_revanchism(owner), read_float_from_payload(tval + 1));
4267 return compare_values(tval[0], ws.world.nation_get_substates_count(
to_nation(primary_slot)), tval[1]);
4270 return compare_values(tval[0],
4271 ws.world.nation_get_vassals_count(
to_nation(primary_slot)) - ws.world.nation_get_substates_count(
to_nation(primary_slot)),
4275 return compare_values(tval[0],
ve::select(ws.world.nation_get_active_regiments(
to_nation(this_slot)) != 0,
ve::to_float(ws.world.nation_get_active_regiments(
to_nation(primary_slot))) /
ve::to_float(ws.world.nation_get_active_regiments(
to_nation(this_slot))), 1'000'000.0f), read_float_from_payload(tval + 1));
4278 return compare_values(tval[0],
ve::select(ws.world.nation_get_active_regiments(
to_nation(from_slot)) != 0,
ve::to_float(ws.world.nation_get_active_regiments(
to_nation(primary_slot))) /
ve::to_float(ws.world.nation_get_active_regiments(
to_nation(from_slot))), 1'000'000.0f), read_float_from_payload(tval + 1));
4281 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
4282 return compare_values(tval[0],
ve::select(ws.world.nation_get_active_regiments(
to_nation(this_slot)) != 0,
ve::to_float(ws.world.nation_get_active_regiments(owner)) /
ve::to_float(ws.world.nation_get_active_regiments(
to_nation(this_slot))), 1'000'000.0f), read_float_from_payload(tval + 1));
4285 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
4286 return compare_values(tval[0],
ve::select(ws.world.nation_get_active_regiments(
to_nation(from_slot)) != 0,
ve::to_float(ws.world.nation_get_active_regiments(owner)) /
ve::to_float(ws.world.nation_get_active_regiments(
to_nation(from_slot))), 1'000'000.0f), read_float_from_payload(tval + 1));
4289 auto tag_holder = ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id);
4290 return compare_to_true(tval[0], ws.world.nation_get_constructing_cb_target(
to_nation(primary_slot)) == tag_holder);
4293 return compare_values_eq(tval[0], ws.world.nation_get_constructing_cb_target(
to_nation(primary_slot)),
to_nation(from_slot));
4296 return compare_values_eq(tval[0], ws.world.nation_get_constructing_cb_target(
to_nation(primary_slot)),
to_nation(this_slot));
4299 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
4300 return compare_values_eq(tval[0], ws.world.nation_get_constructing_cb_target(
to_nation(primary_slot)), owner);
4303 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
4304 return compare_values_eq(tval[0], ws.world.nation_get_constructing_cb_target(
to_nation(primary_slot)), owner);
4308 return compare_values_eq(tval[0], ws.world.nation_get_constructing_cb_target(
to_nation(primary_slot)), owner);
4314 return compare_values(tval[0], ws.world.nation_get_constructing_cb_progress(
to_nation(primary_slot)),
4315 read_float_from_payload(tval + 1));
4318 return compare_values(tval[0],
4319 ws.world.nation_get_modifier_values(
to_nation(primary_slot), sys::national_mod_offsets::civilization_progress_modifier),
4320 read_float_from_payload(tval + 1));
4323 return compare_values_eq(tval[0], ws.world.nation_get_constructing_cb_type(
to_nation(primary_slot)),
payload(tval[1]).cb_id);
4326 auto tag_holder = ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id);
4327 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(tag_holder)),
4331 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(from_slot))),
4335 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(this_slot))),
4339 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
4340 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(owner)),
4344 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
4345 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(owner)),
4350 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(owner)),
4355 auto tag_holder = ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id);
4356 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(tag_holder)),
4357 ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)));
4360 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(from_slot))),
4361 ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)));
4364 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(this_slot))),
4365 ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)));
4368 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
4369 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(owner)),
4370 ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)));
4373 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
4374 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(owner)),
4375 ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)));
4379 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(owner)),
4380 ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)));
4388 return compare_to_true(tval[0], ws.military_definitions.great_wars_enabled);
4391 auto result = ve::apply(
4392 [&ws](dcon::nation_id n) {
4393 for(
auto c : ws.world.nation_get_unilateral_relationship_as_target(n)) {
4394 if(c.get_foreign_investment() > 0.0f)
4406 auto holder = ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id);
4407 return compare_values_eq(tval[0], ws.world.nation_get_in_sphere_of(holder),
to_nation(primary_slot));
4410 return compare_values_eq(tval[0], ws.world.nation_get_in_sphere_of(
to_nation(from_slot)),
to_nation(primary_slot));
4413 return compare_values_eq(tval[0], ws.world.nation_get_in_sphere_of(
to_nation(this_slot)),
to_nation(primary_slot));
4416 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
4417 return compare_values_eq(tval[0], ws.world.nation_get_in_sphere_of(owner),
to_nation(primary_slot));
4420 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
4421 return compare_values_eq(tval[0], ws.world.nation_get_in_sphere_of(owner),
to_nation(primary_slot));
4425 return compare_values_eq(tval[0], ws.world.nation_get_in_sphere_of(owner),
to_nation(primary_slot));
4428 return compare_values(tval[0], ws.world.nation_get_owned_state_count(
to_nation(primary_slot)), tval[1]);
4435 auto tag = ws.world.nation_get_identity_from_identity_holder(
to_nation(from_slot));
4436 return compare_to_true(tval[0], !ws.world.national_identity_get_is_not_releasable(tag));
4439 auto tag = ws.world.nation_get_identity_from_identity_holder(
to_nation(from_slot));
4440 return compare_to_true(tval[0], !ws.world.national_identity_get_is_not_releasable(tag));
4443 return compare_values(tval[0],
4445 ve::apply([&ws](dcon::province_id p) {
return ws.world.province_get_last_immigration(p).to_raw_value(); },
4447 ws.current_date.to_raw_value());
4450 return compare_values(tval[0],
4451 ws.current_date.to_raw_value() -
4452 ve::apply([&ws](dcon::province_id p) { return ws.world.province_get_last_control_change(p).to_raw_value(); },
4458 auto d = ws.world.nation_get_disarmed_until(n);
4459 return bool(d) && ws.current_date < d;
4464 auto d = ws.world.nation_get_disarmed_until(n);
4465 return bool(d) && ws.current_date < d;
4481 return compare_values(tval[0],
4483 [&ws](dcon::nation_id n) {
4484 float max_str = 0.0f;
4485 for(
auto m : ws.world.nation_get_movement_within(n)) {
4486 auto issue = m.get_movement().get_associated_issue_option();
4488 if(culture::issue_type(issue.get_parent_issue().get_issue_type()) == culture::issue_type::social &&
4489 m.get_movement().get_pop_support() > max_str) {
4490 max_str = m.get_movement().get_pop_support();
4496 to_nation(primary_slot)) *
4497 ws.defines.movement_support_uh_factor / ws.world.nation_get_non_colonial_population(to_nation(primary_slot)),
4498 read_float_from_payload(tval + 1));
4501 return compare_values(tval[0],
4503 [&ws](dcon::nation_id n) {
4504 float max_str = 0.0f;
4505 for(
auto m : ws.world.nation_get_movement_within(n)) {
4506 auto issue = m.get_movement().get_associated_issue_option();
4508 if(culture::issue_type(issue.get_parent_issue().get_issue_type()) == culture::issue_type::political &&
4509 m.get_movement().get_pop_support() > max_str) {
4510 max_str = m.get_movement().get_pop_support();
4516 to_nation(primary_slot)) *
4517 ws.defines.movement_support_uh_factor / ws.world.nation_get_non_colonial_population(to_nation(primary_slot)),
4518 read_float_from_payload(tval + 1));
4526 [&ws](dcon::pop_id p) {
4527 auto m = fatten(ws.world, ws.world.pop_get_movement_from_pop_movement_membership(p));
4528 return m && m.get_associated_issue_option() &&
4530 m.get_associated_issue_option().get_parent_issue().get_issue_type()) ==
4537 [&ws](dcon::pop_id p) {
4538 auto m = fatten(ws.world, ws.world.pop_get_movement_from_pop_movement_membership(p));
4539 return m && m.get_associated_issue_option() &&
4541 m.get_associated_issue_option().get_parent_issue().get_issue_type()) ==
4558 auto prim_culture = ws.world.nation_get_primary_culture(
to_nation(this_slot));
4559 auto culture_group = ws.world.culture_get_group_from_culture_group_membership(prim_culture);
4561 auto result = ve::apply(
4562 [&ws](dcon::nation_id n, dcon::culture_group_id g) {
4563 for(
auto s : ws.world.nation_get_gp_relationship_as_great_power(n)) {
4564 if((s.get_status() & nations::influence::level_mask) == nations::influence::level_in_sphere &&
4565 s.get_influence_target().get_primary_culture().get_group_from_culture_group_membership() == g) {
4571 to_nation(primary_slot), culture_group);
4573 return compare_to_true(tval[0], result);
4576 return compare_to_true(tval[0], ws.military_definitions.world_wars_enabled);
4579 return compare_values_eq(tval[0], ws.world.pop_get_culture(
to_pop(primary_slot)), ws.world.pop_get_culture(
to_pop(this_slot)));
4583 auto result = ve::apply(
4584 [&ws](dcon::state_instance_id s, dcon::culture_id c) {
4585 return bool(c) ? ws.world.state_instance_get_demographics(s,
demographics::to_key(ws, c)) > 0.0f :
false;
4592 auto result = ve::apply(
4593 [&ws](dcon::province_id s, dcon::culture_id c) {
4594 return bool(c) ? ws.world.province_get_demographics(s,
demographics::to_key(ws, c)) > 0.0f :
false;
4601 auto result = ve::apply(
4602 [&ws](dcon::nation_id s, dcon::culture_id c) {
4603 return bool(c) ? ws.world.nation_get_demographics(s,
demographics::to_key(ws, c)) > 0.0f :
false;
4609 return compare_values_eq(tval[0], ws.world.pop_get_culture(
to_pop(primary_slot)),
payload(tval[1]).cul_id);
4624 return compare_values_eq(tval[0], ws.world.pop_get_religion(
to_pop(primary_slot)),
4625 ws.world.pop_get_religion(
to_pop(this_slot)));
4628 auto rel = ws.world.pop_get_religion(
to_pop(this_slot));
4629 auto result = ve::apply(
4630 [&ws](dcon::state_instance_id s, dcon::religion_id r) {
4631 return bool(r) ? ws.world.state_instance_get_demographics(s,
demographics::to_key(ws, r)) > 0.0f :
false;
4637 auto rel = ws.world.pop_get_religion(
to_pop(this_slot));
4638 auto result = ve::apply(
4639 [&ws](dcon::province_id s, dcon::religion_id r) {
4640 return bool(r) ? ws.world.province_get_demographics(s,
demographics::to_key(ws, r)) > 0.0f :
false;
4646 auto rel = ws.world.pop_get_religion(
to_pop(this_slot));
4647 auto result = ve::apply(
4648 [&ws](dcon::nation_id s, dcon::religion_id r) {
4649 return bool(r) ? ws.world.nation_get_demographics(s,
demographics::to_key(ws, r)) > 0.0f :
false;
4655 return compare_values_eq(tval[0], ws.world.pop_get_religion(
to_pop(primary_slot)),
payload(tval[1]).rel_id);
4670 return compare_values(tval[0], ws.world.pop_get_life_needs_satisfaction(
to_pop(primary_slot)),
4671 read_float_from_payload(tval + 1));
4674 return compare_values(tval[0], ws.world.pop_get_everyday_needs_satisfaction(
to_pop(primary_slot)),
4675 read_float_from_payload(tval + 1));
4678 return compare_values(tval[0], ws.world.pop_get_luxury_needs_satisfaction(
to_pop(primary_slot)),
4679 read_float_from_payload(tval + 1));
4682 return compare_values(tval[0], ws.world.pop_get_consciousness(
to_pop(primary_slot)), read_float_from_payload(tval + 1));
4686 return compare_values(tval[0],
4689 read_float_from_payload(tval + 1));
4693 return compare_values(tval[0],
4696 read_float_from_payload(tval + 1));
4700 return compare_values(tval[0],
4703 read_float_from_payload(tval + 1));
4706 return compare_values(tval[0], ws.world.pop_get_literacy(
to_pop(primary_slot)), read_float_from_payload(tval + 1));
4710 return compare_values(tval[0],
4713 read_float_from_payload(tval + 1));
4717 return compare_values(tval[0],
4720 read_float_from_payload(tval + 1));
4724 return compare_values(tval[0],
4727 read_float_from_payload(tval + 1));
4730 return compare_values(tval[0], ws.world.pop_get_militancy(
to_pop(primary_slot)), read_float_from_payload(tval + 1));
4734 return compare_values(tval[0],
4737 read_float_from_payload(tval + 1));
4741 return compare_values(tval[0],
4744 read_float_from_payload(tval + 1));
4748 return compare_values(tval[0],
4751 read_float_from_payload(tval + 1));
4755 auto sdef = ws.world.state_instance_get_definition(
to_state(primary_slot));
4756 auto sowner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
4757 auto result = ve::apply(
4758 [&ws, g](dcon::state_definition_id sd, dcon::nation_id o) {
4759 for(
auto p : ws.world.state_definition_get_abstract_state_membership(sd)) {
4760 if(p.get_province().get_nation_from_province_ownership() == o) {
4761 if(p.get_province().get_rgo() == g)
4768 return compare_to_true(tval[0], result);
4772 auto si = ws.world.province_get_state_membership(
to_prov(primary_slot));
4773 auto sdef = ws.world.state_instance_get_definition(si);
4774 auto sowner = ws.world.state_instance_get_nation_from_state_ownership(si);
4775 auto result = ve::apply(
4776 [&ws, g](dcon::state_definition_id sd, dcon::nation_id o) {
4777 for(
auto p : ws.world.state_definition_get_abstract_state_membership(sd)) {
4778 if(p.get_province().get_nation_from_province_ownership() == o) {
4779 if(p.get_province().get_rgo() == g)
4786 return compare_to_true(tval[0], result);
4790 ws.world.state_instance_get_flashpoint_tag(
to_state(primary_slot)) != dcon::national_identity_id());
4793 return compare_values(tval[0], ws.world.state_instance_get_flashpoint_tension(
to_state(primary_slot)),
4794 read_float_from_payload(tval + 1));
4797 return compare_values(tval[0], ws.world.state_instance_get_flashpoint_tension(ws.world.province_get_state_membership(
to_prov(primary_slot))),
4798 read_float_from_payload(tval + 1));
4810 return compare_values(tval[0], ws.crisis_temperature, read_float_from_payload(tval + 1));
4813 auto result = ve::apply(
4814 [&ws](dcon::nation_id n) {
4815 auto sz = ws.crisis_participants.size();
4817 if(!ws.crisis_participants[i].id)
4819 if(ws.crisis_participants[i].id == n)
4829 auto result = ve::apply(
4830 [&ws](dcon::nation_id n) {
4831 auto sz = ws.crisis_participants.size();
4833 if(!ws.crisis_participants[i].id)
4835 if(ws.crisis_participants[i].id == n)
4845 return compare_values(tval[0],
4848 read_float_from_payload(tval + 1));
4852 return compare_values(tval[0],
4855 read_float_from_payload(tval + 1));
4859 return compare_values(tval[0],
4862 read_float_from_payload(tval + 1));
4865 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
4866 auto si = ws.world.province_get_state_membership(location);
4867 return tf_rich_strata_life_needs_state<return_type>(tval, ws,
to_generic(si), int32_t(), int32_t());
4871 return compare_values(tval[0],
4874 read_float_from_payload(tval + 1));
4878 return compare_values(tval[0],
4882 read_float_from_payload(tval + 1));
4886 return compare_values(tval[0],
4889 read_float_from_payload(tval + 1));
4892 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
4893 auto si = ws.world.province_get_state_membership(location);
4894 return tf_rich_strata_everyday_needs_state<return_type>(tval, ws,
to_generic(si), int32_t(), int32_t());
4898 return compare_values(tval[0],
4901 read_float_from_payload(tval + 1));
4905 return compare_values(tval[0],
4908 read_float_from_payload(tval + 1));
4912 return compare_values(tval[0],
4915 read_float_from_payload(tval + 1));
4918 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
4919 auto si = ws.world.province_get_state_membership(location);
4920 return tf_rich_strata_luxury_needs_state<return_type>(tval, ws,
to_generic(si), int32_t(), int32_t());
4924 return compare_values(tval[0],
4927 read_float_from_payload(tval + 1));
4931 return compare_values(tval[0],
4934 read_float_from_payload(tval + 1));
4938 return compare_values(tval[0],
4941 read_float_from_payload(tval + 1));
4944 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
4945 auto si = ws.world.province_get_state_membership(location);
4946 return tf_middle_strata_life_needs_state<return_type>(tval, ws,
to_generic(si), int32_t(), int32_t());
4950 return compare_values(tval[0],
4953 read_float_from_payload(tval + 1));
4957 return compare_values(tval[0],
4961 read_float_from_payload(tval + 1));
4965 return compare_values(tval[0],
4968 read_float_from_payload(tval + 1));
4971 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
4972 auto si = ws.world.province_get_state_membership(location);
4973 return tf_middle_strata_everyday_needs_state<return_type>(tval, ws,
to_generic(si), int32_t(), int32_t());
4977 return compare_values(tval[0],
4980 read_float_from_payload(tval + 1));
4984 return compare_values(tval[0],
4988 read_float_from_payload(tval + 1));
4992 return compare_values(tval[0],
4995 read_float_from_payload(tval + 1));
4998 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
4999 auto si = ws.world.province_get_state_membership(location);
5000 return tf_middle_strata_luxury_needs_state<return_type>(tval, ws,
to_generic(si), int32_t(), int32_t());
5004 return compare_values(tval[0],
5007 read_float_from_payload(tval + 1));
5011 return compare_values(tval[0],
5014 read_float_from_payload(tval + 1));
5018 return compare_values(tval[0],
5021 read_float_from_payload(tval + 1));
5024 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
5025 auto si = ws.world.province_get_state_membership(location);
5026 return tf_poor_strata_life_needs_state<return_type>(tval, ws,
to_generic(si), int32_t(), int32_t());
5030 return compare_values(tval[0],
5033 read_float_from_payload(tval + 1));
5037 return compare_values(tval[0],
5041 read_float_from_payload(tval + 1));
5045 return compare_values(tval[0],
5048 read_float_from_payload(tval + 1));
5051 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
5052 auto si = ws.world.province_get_state_membership(location);
5053 return tf_poor_strata_everyday_needs_state<return_type>(tval, ws,
to_generic(si), int32_t(), int32_t());
5057 return compare_values(tval[0],
5060 read_float_from_payload(tval + 1));
5064 return compare_values(tval[0],
5067 read_float_from_payload(tval + 1));
5071 return compare_values(tval[0],
5074 read_float_from_payload(tval + 1));
5077 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
5078 auto si = ws.world.province_get_state_membership(location);
5079 return tf_poor_strata_luxury_needs_state<return_type>(tval, ws,
to_generic(si), int32_t(), int32_t());
5082 auto holder = ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[2]).tag_id);
5083 auto result = ve::apply(
5084 [&ws, holder](dcon::nation_id a) {
5085 auto gpr = ws.world.get_gp_relationship_by_gp_influence_pair(holder, a);
5086 return ws.world.gp_relationship_get_influence(gpr);
5089 return compare_values(tval[0], result,
float(tval[1]));
5092 auto result = ve::apply(
5093 [&ws](dcon::nation_id a, dcon::nation_id b) {
5094 auto gpr = ws.world.get_gp_relationship_by_gp_influence_pair(b, a);
5095 return ws.world.gp_relationship_get_influence(gpr);
5098 return compare_values(tval[0], result,
float(tval[1]));
5101 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
5102 auto result = ve::apply(
5103 [&ws](dcon::nation_id a, dcon::nation_id b) {
5104 auto gpr = ws.world.get_gp_relationship_by_gp_influence_pair(b, a);
5105 return ws.world.gp_relationship_get_influence(gpr);
5108 return compare_values(tval[0], result,
float(tval[1]));
5111 auto result = ve::apply(
5112 [&ws](dcon::nation_id a, dcon::nation_id b) {
5113 auto gpr = ws.world.get_gp_relationship_by_gp_influence_pair(b, a);
5114 return ws.world.gp_relationship_get_influence(gpr);
5117 return compare_values(tval[0], result,
float(tval[1]));
5120 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(from_slot));
5121 auto result = ve::apply(
5122 [&ws](dcon::nation_id a, dcon::nation_id b) {
5123 auto gpr = ws.world.get_gp_relationship_by_gp_influence_pair(b, a);
5124 return ws.world.gp_relationship_get_influence(gpr);
5127 return compare_values(tval[0], result,
float(tval[1]));
5133 return compare_values(tval[0],
ve::select(pop_size > 0.0f, 1.0f - (employment / pop_size), 0.0f),
5134 read_float_from_payload(tval + 1));
5140 return compare_values(tval[0],
ve::select(pop_size > 0.0f, 1.0f - (employment / pop_size), 0.0f),
5141 read_float_from_payload(tval + 1));
5147 return compare_values(tval[0],
ve::select(pop_size > 0.0f, 1.0f - (employment / pop_size), 0.0f),
5148 read_float_from_payload(tval + 1));
5151 auto pop_size = ws.world.pop_get_size(
to_pop(primary_slot));
5152 auto employment = ws.world.pop_get_employment(
to_pop(primary_slot));
5153 return compare_values(tval[0],
ve::select(pop_size > 0.0f, 1.0f - (employment / pop_size), 0.0f),
5154 read_float_from_payload(tval + 1));
5157 auto type = ws.world.pop_get_poptype(
to_pop(this_slot));
5159 auto pop_size = ve::apply(
5160 [&](dcon::nation_id loc, dcon::pop_type_id t) {
5168 auto employment = ve::apply(
5169 [&](dcon::nation_id loc, dcon::pop_type_id t) {
5177 return compare_values(tval[0],
ve::select(pop_size > 0.0f, 1.0f - (employment / pop_size), 0.0f),
5178 read_float_from_payload(tval + 1));
5181 auto type = ws.world.pop_get_poptype(
to_pop(this_slot));
5183 auto pop_size = ve::apply(
5184 [&](dcon::state_instance_id loc, dcon::pop_type_id t) {
5192 auto employment = ve::apply(
5193 [&](dcon::state_instance_id loc, dcon::pop_type_id t) {
5201 return compare_values(tval[0],
ve::select(pop_size > 0.0f, 1.0f - (employment / pop_size), 0.0f),
5202 read_float_from_payload(tval + 1));
5205 auto type = ws.world.pop_get_poptype(
to_pop(this_slot));
5207 auto pop_size = ve::apply(
5208 [&](dcon::province_id loc, dcon::pop_type_id t) {
5216 auto employment = ve::apply(
5217 [&](dcon::province_id loc, dcon::pop_type_id t) {
5225 return compare_values(tval[0],
ve::select(pop_size > 0.0f, 1.0f - (employment / pop_size), 0.0f),
5226 read_float_from_payload(tval + 1));
5229 auto holder = ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[2]).tag_id);
5230 auto relation = ve::apply(
5231 [&ws, holder](dcon::nation_id a) {
5232 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, holder);
5233 return ws.world.diplomatic_relation_get_value(rel);
5236 return compare_values(tval[0], relation,
float(
payload(tval[1]).signed_value));
5239 auto relation = ve::apply(
5240 [&ws](dcon::nation_id a, dcon::nation_id b) {
5241 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, b);
5242 return ws.world.diplomatic_relation_get_value(rel);
5245 return compare_values(tval[0], relation,
float(
payload(tval[1]).signed_value));
5248 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
5249 auto relation = ve::apply(
5250 [&ws](dcon::nation_id a, dcon::nation_id b) {
5251 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, b);
5252 return ws.world.diplomatic_relation_get_value(rel);
5255 return compare_values(tval[0], relation,
float(
payload(tval[1]).signed_value));
5259 auto relation = ve::apply(
5260 [&ws](dcon::nation_id a, dcon::nation_id b) {
5261 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, b);
5262 return ws.world.diplomatic_relation_get_value(rel);
5265 return compare_values(tval[0], relation,
float(
payload(tval[1]).signed_value));
5268 auto relation = ve::apply(
5269 [&ws](dcon::nation_id a, dcon::nation_id b) {
5270 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, b);
5271 return ws.world.diplomatic_relation_get_value(rel);
5274 return compare_values(tval[0], relation,
float(
payload(tval[1]).signed_value));
5277 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(from_slot));
5278 auto relation = ve::apply(
5279 [&ws](dcon::nation_id a, dcon::nation_id b) {
5280 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, b);
5281 return ws.world.diplomatic_relation_get_value(rel);
5284 return compare_values(tval[0], relation,
float(
payload(tval[1]).signed_value));
5288 return compare_values(tval[0], ws.world.nation_get_variables(
to_nation(primary_slot),
id), read_float_from_payload(tval + 1));
5292 return compare_values(tval[0], ws.world.nation_get_upper_house(
to_nation(primary_slot),
id), 100.0f * read_float_from_payload(tval + 1));
5295 return tf_pop_unemployment_nation<return_type>(tval, ws, primary_slot, int32_t(), int32_t());
5298 return tf_pop_unemployment_state<return_type>(tval, ws, primary_slot, int32_t(), int32_t());
5301 return tf_pop_unemployment_province<return_type>(tval, ws, primary_slot, int32_t(), int32_t());
5304 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
5305 auto si = ws.world.province_get_state_membership(location);
5306 return tf_unemployment_by_type_state<return_type>(tval, ws,
to_generic(si), int32_t(), int32_t());
5309 return compare_values(tval[0], ws.world.province_get_party_loyalty(
payload(tval[1]).prov_id,
payload(tval[3]).ideo_id),
5310 payload(tval[2]).signed_value);
5313 return compare_values(tval[0], ws.world.province_get_party_loyalty(
payload(tval[1]).prov_id,
payload(tval[3]).ideo_id),
5314 payload(tval[2]).signed_value);
5317 return compare_values(tval[0], ws.world.province_get_party_loyalty(
payload(tval[1]).prov_id,
payload(tval[3]).ideo_id),
5318 payload(tval[2]).signed_value);
5321 return compare_values(tval[0], ws.world.province_get_party_loyalty(
payload(tval[1]).prov_id,
payload(tval[3]).ideo_id),
5322 payload(tval[2]).signed_value);
5325 return compare_values(tval[0], ws.world.province_get_party_loyalty(
to_prov(from_slot),
payload(tval[2]).ideo_id),
5326 payload(tval[1]).signed_value);
5329 return compare_values(tval[0], ws.world.province_get_party_loyalty(
to_prov(primary_slot),
payload(tval[2]).ideo_id),
5330 payload(tval[1]).signed_value);
5333 return compare_values(tval[0], ws.world.province_get_party_loyalty(
to_prov(primary_slot),
payload(tval[2]).ideo_id),
5334 payload(tval[1]).signed_value);
5337 return compare_values(tval[0], ws.world.province_get_party_loyalty(
to_prov(primary_slot),
payload(tval[2]).ideo_id),
5338 payload(tval[1]).signed_value);
5343 ws.world.province_get_modifier_values(
to_prov(primary_slot), sys::provincial_mod_offsets::min_build_railroad) <
5349 ws.world.province_get_modifier_values(
to_prov(primary_slot), sys::provincial_mod_offsets::min_build_railroad) <
5355 ws.world.province_get_modifier_values(
to_prov(primary_slot), sys::provincial_mod_offsets::min_build_railroad) <
5361 ws.world.province_get_modifier_values(
to_prov(primary_slot), sys::provincial_mod_offsets::min_build_railroad) <
5381 auto result = ws.world.province_get_is_coast(
to_prov(primary_slot)) &&
5386 ws.world.province_get_state_membership(
to_prov(primary_slot))));
5390 auto result = ws.world.province_get_is_coast(
to_prov(primary_slot)) &&
5395 ws.world.province_get_state_membership(
to_prov(primary_slot))));
5399 auto result = ws.world.province_get_is_coast(
to_prov(primary_slot)) &&
5404 ws.world.province_get_state_membership(
to_prov(primary_slot))));
5408 auto result = ws.world.province_get_is_coast(
to_prov(primary_slot)) &&
5413 ws.world.province_get_state_membership(
to_prov(primary_slot))));
5470 return compare_values(tval[0],
ve::select(total_pop > 0.0f, support_pop / total_pop, 0.0f), read_float_from_payload(tval + 2));
5476 return compare_values(tval[0],
ve::select(total_pop > 0.0f, support_pop / total_pop, 0.0f), read_float_from_payload(tval + 2));
5482 return compare_values(tval[0],
ve::select(total_pop > 0.0f, support_pop / total_pop, 0.0f), read_float_from_payload(tval + 2));
5486 auto total_pop = ws.world.pop_get_size(
to_pop(primary_slot));
5488 return compare_values(tval[0],
ve::select(total_pop > 0.0f, support_pop / total_pop, 0.0f), read_float_from_payload(tval + 2));
5494 return compare_values(tval[0],
ve::select(total_pop > 0.0f, support_pop / total_pop, 0.0f), read_float_from_payload(tval + 2));
5500 return compare_values(tval[0],
ve::select(total_pop > 0.0f, support_pop / total_pop, 0.0f), read_float_from_payload(tval + 2));
5506 return compare_values(tval[0],
ve::select(total_pop > 0.0f, support_pop / total_pop, 0.0f), read_float_from_payload(tval + 2));
5510 auto total_pop = ws.world.pop_get_size(
to_pop(primary_slot));
5512 return compare_values(tval[0],
ve::select(total_pop > 0.0f, support_pop / total_pop, 0.0f), read_float_from_payload(tval + 2));
5518 return compare_values_eq(tval[0], ws.world.nation_get_issues(
to_nation(primary_slot), issue), option);
5521 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
5525 return compare_values_eq(tval[0], ws.world.nation_get_issues(owner, issue), option);
5528 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
5532 return compare_values_eq(tval[0], ws.world.nation_get_issues(owner, issue), option);
5539 return compare_values_eq(tval[0], ws.world.nation_get_issues(owner, issue), option);
5545 return compare_values_eq(tval[0], ws.world.nation_get_reforms(
to_nation(primary_slot), issue), option);
5548 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
5552 return compare_values_eq(tval[0], ws.world.nation_get_reforms(owner, issue), option);
5555 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
5559 return compare_values_eq(tval[0], ws.world.nation_get_reforms(owner, issue), option);
5566 return compare_values_eq(tval[0], ws.world.nation_get_reforms(owner, issue), option);
5571 auto size = ws.world.nation_get_demographics(
to_nation(primary_slot), type);
5572 return compare_values(tval[0],
ve::select(total_pop > 0.0f, size / total_pop, 0.0f), read_float_from_payload(tval + 2));
5577 auto size = ws.world.state_instance_get_demographics(
to_state(primary_slot), type);
5578 return compare_values(tval[0],
ve::select(total_pop > 0.0f, size / total_pop, 0.0f), read_float_from_payload(tval + 2));
5583 auto size = ws.world.province_get_demographics(
to_prov(primary_slot), type);
5584 return compare_values(tval[0],
ve::select(total_pop > 0.0f, size / total_pop, 0.0f), read_float_from_payload(tval + 2));
5587 auto pop_location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
5590 auto size = ws.world.province_get_demographics(pop_location, type);
5591 return compare_values(tval[0],
ve::select(total_pop > 0.0f, size / total_pop, 0.0f), read_float_from_payload(tval + 2));
5595 auto amount = ws.world.nation_get_stockpiles(
to_nation(primary_slot), good);
5596 return compare_values(tval[0], amount, read_float_from_payload(tval + 2));
5599 return compare_values_eq(tval[0], ws.world.nation_get_religion(
to_nation(primary_slot)),
payload(tval[1]).rel_id);
5602 auto r = ws.world.rebel_faction_get_religion(
to_rebel(from_slot));
5603 return compare_values_eq(tval[0], ws.world.nation_get_religion(
to_nation(primary_slot)), r);
5606 return compare_values_eq(tval[0], ws.world.nation_get_religion(
to_nation(primary_slot)),
5607 ws.world.nation_get_religion(
to_nation(from_slot)));
5610 return compare_values_eq(tval[0], ws.world.nation_get_religion(
to_nation(primary_slot)),
5611 ws.world.nation_get_religion(
to_nation(this_slot)));
5614 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
5615 return compare_values_eq(tval[0], ws.world.nation_get_religion(
to_nation(primary_slot)), ws.world.nation_get_religion(owner));
5618 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
5619 return compare_values_eq(tval[0], ws.world.nation_get_religion(
to_nation(primary_slot)), ws.world.nation_get_religion(owner));
5623 return compare_values_eq(tval[0], ws.world.nation_get_religion(
to_nation(primary_slot)), ws.world.nation_get_religion(owner));
5631 return compare_to_true(tval[0], ws.world.nation_get_active_inventions(ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)), tid));
5639 auto tid = ws.world.stored_trigger_get_function(sid);
5640 auto test_result = test_trigger_generic<return_type>(ws.trigger_data.data() + ws.trigger_data_indices[tid.index() + 1], ws, primary_slot, this_slot, from_slot);
5651template<
typename return_type,
typename primary_type,
typename this_type,
typename from_type>
5655 tf_none<return_type, primary_type, this_type, from_type>,
5656#define TRIGGER_BYTECODE_ELEMENT(code, name, arg) tf_##name <return_type, primary_type, this_type, from_type>,
5658#undef TRIGGER_BYTECODE_ELEMENT
5662 tf_generic_scope<return_type, primary_type, this_type, from_type>,
5663 tf_x_neighbor_province_scope<return_type, primary_type, this_type, from_type>,
5664 tf_x_neighbor_country_scope_nation<return_type, primary_type, this_type, from_type>,
5665 tf_x_neighbor_country_scope_pop<return_type, primary_type, this_type, from_type>,
5666 tf_x_war_countries_scope_nation<return_type, primary_type, this_type, from_type>,
5667 tf_x_war_countries_scope_pop<return_type, primary_type, this_type, from_type>,
5668 tf_x_greater_power_scope<return_type, primary_type, this_type, from_type>,
5669 tf_x_owned_province_scope_state<return_type, primary_type, this_type, from_type>,
5670 tf_x_owned_province_scope_nation<return_type, primary_type, this_type, from_type>,
5671 tf_x_core_scope_province<return_type, primary_type, this_type, from_type>,
5672 tf_x_core_scope_nation<return_type, primary_type, this_type, from_type>,
5673 tf_x_state_scope<return_type, primary_type, this_type, from_type>,
5674 tf_x_substate_scope<return_type, primary_type, this_type, from_type>,
5675 tf_x_sphere_member_scope<return_type, primary_type, this_type, from_type>,
5676 tf_x_pop_scope_province<return_type, primary_type, this_type, from_type>,
5677 tf_x_pop_scope_state<return_type, primary_type, this_type, from_type>,
5678 tf_x_pop_scope_nation<return_type, primary_type, this_type, from_type>,
5679 tf_x_provinces_in_variable_region<return_type, primary_type, this_type, from_type>,
5680 tf_owner_scope_state<return_type, primary_type, this_type, from_type>,
5681 tf_owner_scope_province<return_type, primary_type, this_type, from_type>,
5682 tf_controller_scope<return_type, primary_type, this_type, from_type>,
5683 tf_location_scope<return_type, primary_type, this_type, from_type>,
5684 tf_country_scope_state<return_type, primary_type, this_type, from_type>,
5685 tf_country_scope_pop<return_type, primary_type, this_type, from_type>,
5686 tf_capital_scope<return_type, primary_type, this_type, from_type>,
5687 tf_this_scope<return_type, primary_type, this_type, from_type>,
5688 tf_this_scope<return_type, primary_type, this_type, from_type>,
5689 tf_this_scope<return_type, primary_type, this_type, from_type>,
5690 tf_this_scope<return_type, primary_type, this_type, from_type>,
5691 tf_from_scope<return_type, primary_type, this_type, from_type>,
5692 tf_from_scope<return_type, primary_type, this_type, from_type>,
5693 tf_from_scope<return_type, primary_type, this_type, from_type>,
5694 tf_from_scope<return_type, primary_type, this_type, from_type>,
5695 tf_sea_zone_scope<return_type, primary_type, this_type, from_type>,
5696 tf_cultural_union_scope<return_type, primary_type, this_type, from_type>,
5697 tf_overlord_scope<return_type, primary_type, this_type, from_type>,
5698 tf_sphere_owner_scope<return_type, primary_type, this_type, from_type>,
5699 tf_independence_scope<return_type, primary_type, this_type, from_type>,
5700 tf_flashpoint_tag_scope<return_type, primary_type, this_type, from_type>,
5701 tf_crisis_state_scope<return_type, primary_type, this_type, from_type>,
5702 tf_state_scope_pop<return_type, primary_type, this_type, from_type>,
5703 tf_state_scope_province<return_type, primary_type, this_type, from_type>,
5704 tf_tag_scope<return_type, primary_type, this_type, from_type>,
5705 tf_integer_scope<return_type, primary_type, this_type, from_type>,
5706 tf_country_scope_nation<return_type, primary_type, this_type, from_type>,
5707 tf_country_scope_province<return_type, primary_type, this_type, from_type>,
5708 tf_cultural_union_scope_pop<return_type, primary_type, this_type, from_type>,
5709 tf_capital_scope_province<return_type, primary_type, this_type, from_type>,
5710 tf_capital_scope_pop,
5712 tf_x_neighbor_province_scope_state,
5713 tf_x_provinces_in_variable_region_proper,
5717template<
typename return_type,
typename primary_type,
typename this_type,
typename from_type>
5718return_type
CALLTYPE test_trigger_generic(uint16_t
const* tval,
sys::state& ws, primary_type primary_slot, this_type this_slot,
5719 from_type from_slot) {
5721 ws, primary_slot, this_slot, from_slot);
5725#undef TRIGGER_FUNCTION
5728 auto base = state.value_modifiers[modifier];
5729 float product = base.factor;
5730 for(
uint32_t i = 0; i < base.segments_count && product != 0; ++i) {
5731 auto seg = state.value_modifier_segments[base.first_segment_offset + i];
5733 if(test_trigger_generic<bool>(state.trigger_data.data() + state.trigger_data_indices[seg.condition.index() + 1], state, primary,
5734 this_slot, from_slot)) {
5735 product *= seg.factor;
5742 auto base = state.value_modifiers[modifier];
5743 float sum = base.base;
5744 for(
uint32_t i = 0; i < base.segments_count; ++i) {
5745 auto seg = state.value_modifier_segments[base.first_segment_offset + i];
5747 if(test_trigger_generic<bool>(state.trigger_data.data() + state.trigger_data_indices[seg.condition.index() + 1], state, primary,
5748 this_slot, from_slot)) {
5753 return sum * base.factor;
5757 auto base = state.value_modifiers[modifier];
5758 ve::fp_vector product = base.factor;
5759 for(
uint32_t i = 0; i < base.segments_count; ++i) {
5760 auto seg = state.value_modifier_segments[base.first_segment_offset + i];
5762 auto res = test_trigger_generic<ve::mask_vector>(
5763 state.trigger_data.data() + state.trigger_data_indices[seg.condition.index() + 1], state, primary, this_slot, from_slot);
5764 product =
ve::select(res, product * seg.factor, product);
5770 auto base = state.value_modifiers[modifier];
5771 ve::fp_vector sum = base.base;
5772 for(
uint32_t i = 0; i < base.segments_count; ++i) {
5773 auto seg = state.value_modifier_segments[base.first_segment_offset + i];
5775 auto res = test_trigger_generic<ve::mask_vector>(
5776 state.trigger_data.data() + state.trigger_data_indices[seg.condition.index() + 1], state, primary, this_slot, from_slot);
5777 sum =
ve::select(res, sum + seg.factor, sum);
5780 return sum * base.factor;
5784 auto base = state.value_modifiers[modifier];
5785 ve::fp_vector product = base.factor;
5786 for(
uint32_t i = 0; i < base.segments_count; ++i) {
5787 auto seg = state.value_modifier_segments[base.first_segment_offset + i];
5789 auto res = test_trigger_generic<ve::mask_vector>(
5790 state.trigger_data.data() + state.trigger_data_indices[seg.condition.index() + 1], state, primary, this_slot, from_slot);
5791 product =
ve::select(res, product * seg.factor, product);
5797 auto base = state.value_modifiers[modifier];
5798 ve::fp_vector sum = base.base;
5799 for(
uint32_t i = 0; i < base.segments_count; ++i) {
5800 auto seg = state.value_modifier_segments[base.first_segment_offset + i];
5802 auto res = test_trigger_generic<ve::mask_vector>(
5803 state.trigger_data.data() + state.trigger_data_indices[seg.condition.index() + 1], state, primary, this_slot, from_slot);
5804 sum =
ve::select(res, sum + seg.factor, sum);
5807 return sum * base.factor;
5810bool evaluate(
sys::state& state, dcon::trigger_key key, int32_t primary, int32_t this_slot, int32_t from_slot) {
5811 return test_trigger_generic<bool>(state.trigger_data.data() + state.trigger_data_indices[key.index() + 1], state, primary,
5812 this_slot, from_slot);
5814bool evaluate(
sys::state& state, uint16_t
const* data, int32_t primary, int32_t this_slot, int32_t from_slot) {
5815 return test_trigger_generic<bool>(data, state, primary, this_slot, from_slot);
5818ve::mask_vector evaluate(
sys::state& state, dcon::trigger_key key, ve::contiguous_tags<int32_t> primary,
5819 ve::tagged_vector<int32_t> this_slot, int32_t from_slot) {
5820 return test_trigger_generic<ve::mask_vector>(state.trigger_data.data() + state.trigger_data_indices[key.index() + 1], state,
5821 primary, this_slot, from_slot);
5823ve::mask_vector evaluate(
sys::state& state, uint16_t
const* data, ve::contiguous_tags<int32_t> primary,
5824 ve::tagged_vector<int32_t> this_slot, int32_t from_slot) {
5825 return test_trigger_generic<ve::mask_vector>(data, state, primary, this_slot, from_slot);
5828ve::mask_vector evaluate(
sys::state& state, dcon::trigger_key key, ve::tagged_vector<int32_t> primary,
5829 ve::tagged_vector<int32_t> this_slot, int32_t from_slot) {
5830 return test_trigger_generic<ve::mask_vector>(state.trigger_data.data() + state.trigger_data_indices[key.index() + 1], state,
5831 primary, this_slot, from_slot);
5833ve::mask_vector evaluate(
sys::state& state, uint16_t
const* data, ve::tagged_vector<int32_t> primary,
5834 ve::tagged_vector<int32_t> this_slot, int32_t from_slot) {
5835 return test_trigger_generic<ve::mask_vector>(data, state, primary, this_slot, from_slot);
5838ve::mask_vector evaluate(
sys::state& state, dcon::trigger_key key, ve::contiguous_tags<int32_t> primary,
5839 ve::contiguous_tags<int32_t> this_slot, int32_t from_slot) {
5840 return test_trigger_generic<ve::mask_vector>(state.trigger_data.data() + state.trigger_data_indices[key.index() + 1], state,
5841 primary, this_slot, from_slot);
5843ve::mask_vector evaluate(
sys::state& state, uint16_t
const* data, ve::contiguous_tags<int32_t> primary,
5844 ve::contiguous_tags<int32_t> this_slot, int32_t from_slot) {
5845 return test_trigger_generic<ve::mask_vector>(data, state, primary, this_slot, from_slot);
void add_value(int32_t v)
void add_value(int32_t v)
#define TRIGGER_FUNCTION(function_name)
constexpr dcon::demographics_key rich_life_needs(13)
constexpr dcon::demographics_key poor_luxury_needs(17)
constexpr dcon::demographics_key middle_life_needs(12)
constexpr dcon::demographics_key rich_militancy(10)
constexpr dcon::demographics_key middle_total(21)
constexpr dcon::demographics_key middle_luxury_needs(18)
constexpr dcon::demographics_key political_reform_desire(6)
constexpr dcon::demographics_key total(0)
constexpr dcon::demographics_key rich_everyday_needs(16)
constexpr dcon::demographics_key poor_militancy(8)
constexpr dcon::demographics_key rich_luxury_needs(19)
constexpr dcon::demographics_key poor_everyday_needs(14)
constexpr dcon::demographics_key middle_militancy(9)
dcon::demographics_key to_key(sys::state const &state, dcon::pop_type_id v)
constexpr dcon::demographics_key employable(1)
constexpr dcon::demographics_key consciousness(3)
constexpr dcon::demographics_key rich_total(22)
constexpr dcon::demographics_key poor_total(20)
constexpr dcon::demographics_key poor_life_needs(11)
constexpr dcon::demographics_key employed(2)
dcon::demographics_key to_employment_key(sys::state const &state, dcon::pop_type_id v)
constexpr dcon::demographics_key social_reform_desire(7)
constexpr dcon::demographics_key literacy(5)
constexpr dcon::demographics_key middle_everyday_needs(15)
constexpr dcon::demographics_key militancy(4)
bool has_building(sys::state const &state, dcon::state_instance_id si, dcon::factory_type_id fac)
bool is_bankrupt_debtor_to(sys::state &state, dcon::nation_id debt_holder, dcon::nation_id debtor)
bool has_factory(sys::state const &state, dcon::state_instance_id si)
constexpr dcon::commodity_id money(0)
auto desired_needs_spending(sys::state const &state, T pop_indices)
constexpr uint32_t slavery_allowed
constexpr uint32_t pop_build_factory
float recruited_pop_fraction(sys::state const &state, dcon::nation_id n)
bool can_use_cb_against(sys::state &state, dcon::nation_id from, dcon::nation_id target)
bool state_has_naval_base(sys::state const &state, dcon::state_instance_id si)
bool are_at_war(sys::state const &state, dcon::nation_id a, dcon::nation_id b)
bool province_is_blockaded(sys::state const &state, dcon::province_id ids)
auto battle_is_ongoing_in_province(sys::state const &state, T ids)
constexpr uint8_t level_in_sphere
constexpr uint8_t level_mask
auto central_reb_controlled_fraction(sys::state const &state, T ids)
bool is_great_power(sys::state const &state, dcon::nation_id id)
bool can_release_as_vassal(sys::state const &state, dcon::nation_id n, dcon::national_identity_id releasable)
auto occupied_provinces_fraction(sys::state const &state, T ids)
auto primary_culture_group(sys::state const &state, T ids)
dcon::nation_id owner_of_pop(sys::state const &state, dcon::pop_id pop_ids)
auto central_blockaded_fraction(sys::state const &state, T ids)
auto central_has_crime_fraction(sys::state const &state, T ids)
auto nation_accepts_culture(sys::state const &state, T ids, U cul_ids)
dcon::pop_demographics_key to_key(sys::state const &state, dcon::ideology_id v)
constexpr uint8_t impassible_bit
bool is_overseas(sys::state const &state, dcon::province_id ids)
bool state_is_coastal(sys::state &state, dcon::state_instance_id s)
int32_t to_generic(dcon::province_id v)
dcon::state_instance_id to_state(int32_t v)
auto unowned_core_accumulator(sys::state const &ws, dcon::nation_id n)
constexpr uint16_t code_mask
int32_t get_trigger_scope_payload_size(uint16_t const *data)
return_type CALLTYPE test_trigger_generic(uint16_t const *tval, sys::state &ws, primary_type primary_slot, this_type this_slot, from_type from_slot)
constexpr uint16_t is_disjunctive_scope
dcon::pop_id to_pop(int32_t v)
dcon::province_id to_prov(int32_t v)
auto compare_to_true(uint16_t trigger_code, A value_a) -> decltype(!value_a)
int32_t read_int32_t_from_payload(uint16_t const *data)
auto internal_tf_culture_accepted(sys::state &ws, N nids, C cids)
typename gathered_s< T >::type gathered_t
auto make_value_accumulator(F &&f) -> value_accumulator< TAG, F >
auto compare_to_false(uint16_t trigger_code, A value_a) -> decltype(!value_a)
auto compare_values_eq(uint16_t trigger_code, A value_a, B value_b) -> decltype(value_a==value_b)
auto make_true_accumulator(F &&f) -> true_accumulator< F >
dcon::rebel_faction_id to_rebel(int32_t v)
bool compare(bool a, bool b)
auto compare_values(uint16_t trigger_code, A value_a, B value_b) -> decltype(value_a==value_b)
constexpr uint16_t association_gt
constexpr uint16_t association_le
auto existence_accumulator(sys::state &ws, uint16_t const *tval, int32_t this_slot, int32_t from_slot)
float read_float_from_payload(uint16_t const *data)
constexpr uint16_t association_ge
constexpr uint16_t association_mask
auto universal_accumulator(sys::state &ws, uint16_t const *tval, int32_t this_slot, int32_t from_slot)
float evaluate_additive_modifier(sys::state &state, dcon::value_modifier_key modifier, int32_t primary, int32_t this_slot, int32_t from_slot)
auto empty_province_from_state_accumulator(sys::state const &ws, dcon::state_instance_id sid)
dcon::nation_id to_nation(int32_t v)
constexpr uint16_t association_lt
constexpr uint16_t is_existence_scope
int32_t trigger_scope_data_payload(uint16_t code)
int32_t get_trigger_payload_size(uint16_t const *data)
auto make_false_accumulator(F &&f) -> false_accumulator< F >
float evaluate_multiplicative_modifier(sys::state &state, dcon::value_modifier_key modifier, int32_t primary, int32_t this_slot, int32_t from_slot)
constexpr uint16_t association_ne
auto empty_province_accumulator(sys::state const &ws)
constexpr uint16_t association_eq
T select(bool v, T a, T b)
bool compress_mask(bool v)
float to_float(int32_t a)
#define TRIGGER_BYTECODE_LIST
dcon::province_id first_sea_province
dcon::data_container world
province::global_provincial_state province_definitions
static constexpr return_type(CALLTYPE *trigger_functions[])(uint16_t const *
static constexpr sys::state from_type
#define TRIGGER_FUNCTION(function_name)
dcon::national_identity_id tag_id
dcon::stored_trigger_id str_id
dcon::national_variable_id natv_id
dcon::invention_id invt_id
dcon::national_focus_id nf_id
dcon::province_id prov_id
dcon::ideology_id ideo_id
dcon::technology_id tech_id
dcon::reform_option_id ropt_id
dcon::state_definition_id state_id
dcon::pop_type_id popt_id
dcon::issue_option_id opt_id
dcon::commodity_id com_id
dcon::rebel_type_id reb_id