15#define CALLTYPE __vectorcall
20template<
typename A,
typename B>
21[[nodiscard]]
auto compare_values(uint16_t trigger_code, A value_a,
B value_b) ->
decltype(value_a == value_b) {
24 return value_a == value_b;
26 return value_a > value_b;
28 return value_a < value_b;
30 return value_a <= value_b;
32 return value_a != value_b;
34 return value_a >= value_b;
36 return value_a >= value_b;
40template<
typename A,
typename B>
41[[nodiscard]]
auto compare_values_eq(uint16_t trigger_code, A value_a,
B value_b) ->
decltype(value_a == value_b) {
44 return value_a == value_b;
46 return value_a != value_b;
48 return value_a != value_b;
50 return value_a == value_b;
52 return value_a != value_b;
54 return value_a == value_b;
56 return value_a == value_b;
61[[nodiscard]]
auto compare_values_eq(uint16_t trigger_code, dcon::nation_fat_id value_a,
B value_b)
62 ->
decltype(value_a.id == value_b) {
65 return value_a.id == value_b;
67 return value_a.id != value_b;
69 return value_a.id != value_b;
71 return value_a.id == value_b;
73 return value_a.id != value_b;
75 return value_a.id == value_b;
77 return value_a.id == value_b;
82[[nodiscard]]
auto compare_to_true(uint16_t trigger_code, A value_a) ->
decltype(!value_a) {
101[[nodiscard]]
auto compare_to_false(uint16_t trigger_code, A value_a) ->
decltype(!value_a) {
128 pack_float.v.low = data[0];
129 pack_float.v.high = data[1];
142 pack_float.v.low = data[0];
143 pack_float.v.high = data[1];
155 using type = ve::tagged_vector<int32_t>;
160 using type = ve::tagged_vector<int32_t>;
165 using type = ve::tagged_vector<int32_t>;
171template<
typename return_type,
typename primary_type,
typename this_type,
typename from_type>
173 from_type from_slot);
175#define TRIGGER_FUNCTION(function_name) \
176 template<typename return_type, typename primary_type, typename this_type, typename from_type> \
177 return_type CALLTYPE function_name(uint16_t const* tval, sys::state& ws, primary_type primary_slot, this_type this_slot, \
185 static constexpr bool value =
true;
189 static constexpr ve::vbitfield_type value = ve::vbitfield_type{ve::vbitfield_type::storage(-1)};
197 static constexpr bool value =
false;
201 static constexpr ve::vbitfield_type value = ve::vbitfield_type{ve::vbitfield_type::storage(0)};
207bool compare(ve::vbitfield_type a, ve::vbitfield_type b) {
215 return_type result = return_type(
false);
216 while(sub_units_start < tval + source_size) {
217 result = result | test_trigger_generic<return_type, primary_type, this_type, from_type>(sub_units_start, ws, primary_slot, this_slot, from_slot);
230 return_type result = return_type(
true);
231 while(sub_units_start < tval + source_size) {
232 result = result & test_trigger_generic<return_type, primary_type, this_type, from_type>(sub_units_start, ws, primary_slot, this_slot, from_slot);
243 return apply_disjuctively<return_type, primary_type, this_type, from_type>(tval, ws, primary_slot, this_slot, from_slot);
245 return apply_conjuctively<return_type, primary_type, this_type, from_type>(tval, ws, primary_slot, this_slot, from_slot);
249 return return_type(
true);
252 return return_type(
true);
256 return apply_subtriggers<return_type, primary_type, this_type, from_type>(tval, ws, primary_slot, this_slot, from_slot);
262 ve::tagged_vector<int32_t> value;
264 int32_t accumulated_mask = 0;
273 accumulated_mask |= (int32_t(v != -1) << index);
274 value.set(index++, v);
276 if(index == ve::vector_size) {
278 value = ve::tagged_vector<int32_t>();
280 accumulated_mask = 0;
285 if(index != 0 && !
result) {
295 ve::tagged_vector<int32_t> value;
297 int32_t accumulated_mask = 0;
306 accumulated_mask |= (int32_t(v != -1) << index);
307 value.set(index++, v);
309 if(index == ve::vector_size) {
311 value = ve::tagged_vector<int32_t>();
313 accumulated_mask = 0;
318 if(index != 0 &&
result) {
325template<
typename TAG,
typename F>
329 ve::tagged_vector<TAG> store;
332 int32_t accumulated_mask = 0;
338 accumulated_mask |= (int32_t(is_valid_index(v)) << index);
339 store.set(index++, v);
341 if(index == ve::vector_size) {
342 value = value +
ve::select(accumulated_mask, F::operator()(store), 0.0f);
344 accumulated_mask = 0;
349 value = value +
ve::select(accumulated_mask, F::operator()(store), 0.0f);
353 return value.reduce();
367template<
typename TAG,
typename F>
374 return apply_subtriggers<ve::mask_vector, ve::tagged_vector<int32_t>, int32_t, int32_t>(tval, ws, v, this_slot, from_slot);
380 return apply_subtriggers<ve::mask_vector, ve::tagged_vector<int32_t>, int32_t, int32_t>(tval, ws, v, this_slot, from_slot);
386 [&ws, tval](int32_t prov_id, int32_t t_slot, int32_t f_slot) {
387 auto prov_tag =
to_prov(prov_id);
392 for(
auto adj : ws.world.province_get_province_adjacency(prov_tag)) {
394 auto other = adj.get_connected_provinces(prov_tag == adj.get_connected_provinces(0) ? 1 : 0).id;
400 return accumulator.result;
404 for(
auto adj : ws.world.province_get_province_adjacency(prov_tag)) {
406 auto other = adj.get_connected_provinces(prov_tag == adj.get_connected_provinces(0) ? 1 : 0).id;
412 return accumulator.result;
415 primary_slot, this_slot, from_slot);
419 [&ws, tval](int32_t s_id, int32_t t_slot, int32_t f_slot) {
422 std::vector<dcon::province_id> vadj;
425 for(
auto p : ws.world.state_definition_get_abstract_state_membership(ws.world.state_instance_get_definition(state_tag))) {
426 if(p.get_province().get_state_membership() == state_tag) {
427 for(
auto adj : p.get_province().get_province_adjacency()) {
429 auto other = (p.get_province() == adj.get_connected_provinces(0)) ? adj.get_connected_provinces(1).id : adj.get_connected_provinces(0).id;
430 if(std::find(vadj.begin(), vadj.end(), other) == vadj.end())
431 vadj.push_back(other);
444 return accumulator.result;
452 return accumulator.result;
455 primary_slot, this_slot, from_slot);
459 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
465 for(
auto adj : ws.world.nation_get_nation_adjacency(nid)) {
466 auto iid = (nid == adj.get_connected_nations(0)) ? adj.get_connected_nations(1).id : adj.get_connected_nations(0).id;
469 if(accumulator.result)
474 return accumulator.result;
477 for(
auto adj : ws.world.nation_get_nation_adjacency(nid)) {
478 auto iid = (nid == adj.get_connected_nations(0)) ? adj.get_connected_nations(1).id : adj.get_connected_nations(0).id;
481 if(!accumulator.result)
486 return accumulator.result;
489 primary_slot, this_slot, from_slot);
492 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
493 auto province_owner = ws.world.province_get_nation_from_province_ownership(location);
495 return tf_x_neighbor_country_scope_nation<return_type>(tval, ws,
to_generic(province_owner), this_slot, from_slot);
499 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
505 for(
auto wars_in : ws.world.nation_get_war_participant(nid)) {
506 auto is_attacker = wars_in.get_is_attacker();
507 for(
auto o : wars_in.get_war().get_war_participant()) {
508 if(o.get_is_attacker() != is_attacker && o.get_nation() != nid) {
509 accumulator.add_value(
to_generic(o.get_nation().id));
510 if(accumulator.result)
517 return accumulator.result;
521 for(
auto wars_in : ws.world.nation_get_war_participant(nid)) {
522 auto is_attacker = wars_in.get_is_attacker();
523 for(
auto o : wars_in.get_war().get_war_participant()) {
524 if(o.get_is_attacker() != is_attacker && o.get_nation() != nid) {
525 accumulator.add_value(
to_generic(o.get_nation().id));
526 if(!accumulator.result)
533 return accumulator.result;
536 primary_slot, this_slot, from_slot);
539 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
540 auto province_owner = ws.world.province_get_nation_from_province_ownership(location);
542 return tf_x_war_countries_scope_nation<return_type>(tval, ws,
to_generic(province_owner), this_slot, from_slot);
546 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
551 for(
auto n : ws.world.in_nation) {
552 if(n.get_owned_province_count() != 0) {
554 if(accumulator.result)
560 return accumulator.result;
564 for(
auto n : ws.world.in_nation) {
565 if(n.get_owned_province_count() != 0) {
567 if(!accumulator.result)
573 return accumulator.result;
576 primary_slot, this_slot, from_slot);
580 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
587 for(
uint32_t i = 0; i < ws.nations_by_rank.size() && added < great_nations_count; ++i) {
590 accumulator.add_value(
to_generic(ws.nations_by_rank[i]));
591 if(accumulator.result)
597 return accumulator.result;
602 for(
uint32_t i = 0; i < ws.nations_by_rank.size() && added < great_nations_count; ++i) {
605 accumulator.add_value(
to_generic(ws.nations_by_rank[i]));
606 if(!accumulator.result)
612 return accumulator.result;
615 primary_slot, this_slot, from_slot);
619 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
621 dcon::state_definition_fat_id state_def = fatten(ws.world, ws.world.state_instance_get_definition(sid));
622 auto owner = ws.world.state_instance_get_nation_from_state_ownership(sid);
627 for(
auto p : state_def.get_abstract_state_membership()) {
628 if(p.get_province().get_nation_from_province_ownership() == owner) {
629 accumulator.add_value(
to_generic(p.get_province().id));
630 if(accumulator.result)
636 return accumulator.result;
640 for(
auto p : state_def.get_abstract_state_membership()) {
641 if(p.get_province().get_nation_from_province_ownership() == owner) {
642 accumulator.add_value(
to_generic(p.get_province().id));
643 if(!accumulator.result)
649 return accumulator.result;
652 primary_slot, this_slot, from_slot);
656 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
657 auto nid = fatten(ws.world,
to_nation(p_slot));
662 for(
auto p : nid.get_province_ownership()) {
663 accumulator.add_value(
to_generic(p.get_province().id));
664 if(accumulator.result)
669 return accumulator.result;
673 for(
auto p : nid.get_province_ownership()) {
674 accumulator.add_value(
to_generic(p.get_province().id));
675 if(!accumulator.result)
680 return accumulator.result;
683 primary_slot, this_slot, from_slot);
687 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
688 dcon::province_fat_id pid = fatten(ws.world,
to_prov(p_slot));
693 for(
auto p : pid.get_core()) {
694 auto holder = p.get_identity().get_nation_from_identity_holder();
697 if(accumulator.result)
703 return accumulator.result;
707 for(
auto p : pid.get_core()) {
708 auto holder = p.get_identity().get_nation_from_identity_holder();
711 if(!accumulator.result)
717 return accumulator.result;
720 primary_slot, this_slot, from_slot);
724 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
725 auto nid = fatten(ws.world,
to_nation(p_slot));
726 auto ident = nid.get_identity_holder_as_nation().get_identity();
731 for(
auto p :
ident.get_core()) {
732 accumulator.add_value(
to_generic(p.get_province().id));
733 if(accumulator.result)
738 return accumulator.result;
742 for(
auto p :
ident.get_core()) {
743 accumulator.add_value(
to_generic(p.get_province().id));
744 if(!accumulator.result)
749 return accumulator.result;
752 primary_slot, this_slot, from_slot);
757 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
758 auto nid = fatten(ws.world,
to_nation(p_slot));
763 for(
auto s : nid.get_state_ownership()) {
764 accumulator.add_value(
to_generic(s.get_state().id));
765 if(accumulator.result)
770 return accumulator.result;
774 for(
auto s : nid.get_state_ownership()) {
775 accumulator.add_value(
to_generic(s.get_state().id));
776 if(!accumulator.result)
781 return accumulator.result;
784 primary_slot, this_slot, from_slot);
788 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
789 auto nid = fatten(ws.world,
to_nation(p_slot));
794 for(
auto v : nid.get_overlord_as_ruler()) {
795 if(v.get_subject().get_is_substate()) {
796 accumulator.add_value(
to_generic(v.get_subject().id));
797 if(accumulator.result)
803 return accumulator.result;
807 for(
auto v : nid.get_overlord_as_ruler()) {
808 if(v.get_subject().get_is_substate()) {
809 accumulator.add_value(
to_generic(v.get_subject().id));
810 if(!accumulator.result)
816 return accumulator.result;
819 primary_slot, this_slot, from_slot);
823 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
824 auto nid = fatten(ws.world,
to_nation(p_slot));
829 for(
auto gpr : nid.get_gp_relationship_as_great_power()) {
831 accumulator.add_value(
to_generic(gpr.get_influence_target().id));
832 if(accumulator.result)
838 return accumulator.result;
842 for(
auto gpr : nid.get_gp_relationship_as_great_power()) {
844 accumulator.add_value(
to_generic(gpr.get_influence_target().id));
845 if(!accumulator.result)
851 return accumulator.result;
854 primary_slot, this_slot, from_slot);
858 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
859 dcon::province_fat_id pid = fatten(ws.world,
to_prov(p_slot));
864 for(
auto i : pid.get_pop_location()) {
865 accumulator.add_value(
to_generic(i.get_pop().id));
866 if(accumulator.result)
871 return accumulator.result;
875 for(
auto i : pid.get_pop_location()) {
876 accumulator.add_value(
to_generic(i.get_pop().id));
877 if(!accumulator.result)
882 return accumulator.result;
885 primary_slot, this_slot, from_slot);
889 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
891 dcon::state_definition_fat_id state_def = fatten(ws.world, ws.world.state_instance_get_definition(sid));
892 auto owner = ws.world.state_instance_get_nation_from_state_ownership(sid);
897 for(
auto p : state_def.get_abstract_state_membership()) {
898 if(p.get_province().get_nation_from_province_ownership() == owner) {
899 for(
auto i : p.get_province().get_pop_location()) {
900 accumulator.add_value(
to_generic(i.get_pop().id));
901 if(accumulator.result)
908 return accumulator.result;
912 for(
auto p : state_def.get_abstract_state_membership()) {
913 if(p.get_province().get_nation_from_province_ownership() == owner) {
914 for(
auto i : p.get_province().get_pop_location()) {
915 accumulator.add_value(
to_generic(i.get_pop().id));
916 if(!accumulator.result)
923 return accumulator.result;
926 primary_slot, this_slot, from_slot);
930 [&ws, tval](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
931 auto nid = fatten(ws.world,
to_nation(p_slot));
936 for(
auto p : nid.get_province_ownership()) {
937 for(
auto i : p.get_province().get_pop_location()) {
938 accumulator.add_value(
to_generic(i.get_pop().id));
939 if(accumulator.result)
945 return accumulator.result;
949 for(
auto p : nid.get_province_ownership()) {
950 for(
auto i : p.get_province().get_pop_location()) {
951 accumulator.add_value(
to_generic(i.get_pop().id));
952 if(!accumulator.result)
958 return accumulator.result;
961 primary_slot, this_slot, from_slot);
967 [&ws, tval, state_def](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
971 for(
auto i : ws.world.state_definition_get_abstract_state_membership(state_def)) {
972 accumulator.add_value(
to_generic(i.get_province().id));
973 if(accumulator.result)
978 return accumulator.result;
982 for(
auto i : ws.world.state_definition_get_abstract_state_membership(state_def)) {
983 accumulator.add_value(
to_generic(i.get_province().id));
984 if(!accumulator.result)
989 return accumulator.result;
992 primary_slot, this_slot, from_slot);
998 [&ws, tval, state_def](int32_t p_slot, int32_t t_slot, int32_t f_slot) {
1002 for(
auto i : ws.world.region_get_region_membership(state_def)) {
1003 accumulator.add_value(
to_generic(i.get_province().id));
1004 if(accumulator.result)
1008 accumulator.flush();
1009 return accumulator.result;
1013 for(
auto i : ws.world.region_get_region_membership(state_def)) {
1014 accumulator.add_value(
to_generic(i.get_province().id));
1015 if(!accumulator.result)
1019 accumulator.flush();
1020 return accumulator.result;
1023 primary_slot, this_slot, from_slot);
1026 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
1027 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(owner), this_slot,
1031 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
1032 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(owner), this_slot,
1036 auto controller = ws.world.province_get_nation_from_province_control(
to_prov(primary_slot));
1037 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(controller),
1038 this_slot, from_slot);
1041 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
1042 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(location), this_slot,
1046 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
1047 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(owner), this_slot,
1051 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
1052 auto owner = ws.world.province_get_nation_from_province_ownership(location);
1053 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(owner), this_slot,
1057 auto cap = ws.world.nation_get_capital(
to_nation(primary_slot));
1058 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(cap), this_slot, from_slot);
1061 auto cap = ws.world.nation_get_capital(ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)));
1062 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(cap), this_slot, from_slot);
1066 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(cap), this_slot, from_slot);
1069 return apply_subtriggers<return_type, this_type, this_type, from_type>(tval, ws, this_slot, this_slot, from_slot);
1072 return apply_subtriggers<return_type, from_type, this_type, from_type>(tval, ws, from_slot, this_slot, from_slot);
1090 auto ports = ws.world.province_get_port_to(
to_prov(primary_slot));
1091 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(ports),
1092 this_slot, from_slot);
1095 auto cultures = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
1096 auto cg = ws.world.culture_get_group_from_culture_group_membership(cultures);
1097 auto union_tags = ws.world.culture_group_get_identity_from_cultural_union_of(cg);
1098 auto group_holders = ws.world.national_identity_get_nation_from_identity_holder(union_tags);
1099 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(group_holders),
1100 this_slot, from_slot);
1103 auto so = ws.world.nation_get_overlord_as_subject(
to_nation(primary_slot));
1104 auto nso = ws.world.overlord_get_ruler(so);
1105 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(nso), this_slot,
1109 auto nso = ws.world.nation_get_in_sphere_of(
to_nation(primary_slot));
1110 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(nso), this_slot,
1114 auto rtags = ws.world.rebel_faction_get_defection_target(
to_rebel(from_slot));
1115 auto r_holders = ws.world.national_identity_get_nation_from_identity_holder(rtags);
1117 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(r_holders),
1118 this_slot, from_slot);
1121 auto ctags = ws.world.state_instance_get_flashpoint_tag(
to_state(primary_slot));
1122 auto fp_nations = ws.world.national_identity_get_nation_from_identity_holder(ctags);
1123 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(fp_nations),
1124 this_slot, from_slot);
1127 return apply_subtriggers<return_type, int32_t, this_type, from_type>(tval, ws,
to_generic(ws.crisis_state), this_slot,
1131 auto state_instance = ws.world.province_get_state_membership(
to_prov(primary_slot));
1132 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(state_instance),
1133 this_slot, from_slot);
1136 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
1137 auto state_instance = ws.world.province_get_state_membership(location);
1138 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(state_instance),
1139 this_slot, from_slot);
1143 auto tag_holder = ws.world.national_identity_get_nation_from_identity_holder(tag);
1144 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(tag_holder),
1145 this_slot, from_slot);
1149 return apply_subtriggers<return_type, int32_t, this_type, from_type>(tval, ws,
to_generic(wprov), this_slot, from_slot);
1152 return apply_subtriggers<return_type, primary_type, this_type, from_type>(tval, ws, primary_slot, this_slot, from_slot);
1155 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
1156 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(owner), this_slot,
1160 auto cultures = ws.world.pop_get_culture(
to_pop(primary_slot));
1161 auto cg = ws.world.culture_get_group_from_culture_group_membership(cultures);
1162 auto union_tags = ws.world.culture_group_get_identity_from_cultural_union_of(cg);
1163 auto group_holders = ws.world.national_identity_get_nation_from_identity_holder(union_tags);
1165 return apply_subtriggers<return_type, gathered_t<primary_type>, this_type, from_type>(tval, ws,
to_generic(group_holders),
1166 this_slot, from_slot);
1174 return compare_values(tval[0], ws.current_date.to_ymd(ws.start_date).year, int32_t(tval[1]));
1177 return compare_values(tval[0], ws.current_date.to_ymd(ws.start_date).month, int32_t(tval[1]));
1192 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));
1199 auto type = ws.world.pop_get_poptype(
to_pop(primary_slot));
1200 auto strata = ws.world.pop_type_get_strata(type);
1204 auto type = ws.world.pop_get_poptype(
to_pop(primary_slot));
1205 auto strata = ws.world.pop_type_get_strata(type);
1209 auto type = ws.world.pop_get_poptype(
to_pop(primary_slot));
1210 auto strata = ws.world.pop_type_get_strata(type);
1218 auto state_caps = ws.world.state_instance_get_capital(
to_state(primary_slot));
1225 auto owners = ws.world.province_get_nation_from_province_ownership(to_prov(v));
1226 return (owners == ve::tagged_vector<dcon::nation_id>()) & (ve::int_vector(v) < sea_index);
1231 auto results = ve::apply(
1232 [&ws](int32_t p_slot, int32_t, int32_t) {
1236 for(
auto p : ws.world.province_get_province_adjacency(pid)) {
1237 auto other = p.get_connected_provinces(0) == pid ? p.get_connected_provinces(1) : p.get_connected_provinces(0);
1246 primary_slot, this_slot, from_slot);
1253 auto owners = ws.world.province_get_nation_from_province_ownership(to_prov(v));
1254 return (owners == ve::tagged_vector<dcon::nation_id>()) & (ve::int_vector(v) < sea_index) &
1255 (ws.world.province_get_state_membership(to_prov(v)) != vector_sid);
1260 auto results = ve::apply(
1261 [&ws](int32_t p_slot, int32_t, int32_t) {
1263 auto region_owner = ws.world.state_instance_get_nation_from_state_ownership(state_id);
1266 auto region_id = ws.world.state_instance_get_definition(state_id);
1268 for(
auto sp : ws.world.state_definition_get_abstract_state_membership(region_id)) {
1269 if(sp.get_province().get_nation_from_province_ownership() == region_owner) {
1270 for(
auto p : ws.world.province_get_province_adjacency(sp.get_province())) {
1272 p.get_connected_provinces(0) == sp.get_province() ? p.get_connected_provinces(1) : p.get_connected_provinces(0);
1283 primary_slot, this_slot, from_slot);
1290 ws.world.abstract_state_membership_get_state(ws.world.province_get_abstract_state_membership(
to_prov(primary_slot))),
1291 ws.world.abstract_state_membership_get_state(ws.world.province_get_abstract_state_membership(pid)));
1296 ws.world.abstract_state_membership_get_state(ws.world.province_get_abstract_state_membership(pid)));
1301 auto savings_qnty = ws.world.pop_get_savings(
to_pop(primary_slot));
1307 return compare_values(tval[0],
ve::select(total_employable > 0.0f, 1.0f - (total_employed / total_employable), 0.0f),
1313 return compare_values(tval[0],
ve::select(total_employable > 0.0f, 1.0f - (total_employed / total_employable), 0.0f),
1319 return compare_values(tval[0],
ve::select(total_employable > 0.0f, 1.0f - (total_employed / total_employable), 0.0f),
1324 auto ptype = ws.world.pop_get_poptype(
to_pop(primary_slot));
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));
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));
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));
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));
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));
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);
4671 read_float_from_payload(tval + 1));
4675 read_float_from_payload(tval + 1));
4679 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));
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));
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));
5153 return compare_values(tval[0], 1.0f - employment, read_float_from_payload(tval + 1));
5156 auto type = ws.world.pop_get_poptype(
to_pop(this_slot));
5158 auto pop_size = ve::apply(
5159 [&](dcon::nation_id loc, dcon::pop_type_id t) {
5167 auto employment = ve::apply(
5168 [&](dcon::nation_id loc, dcon::pop_type_id t) {
5176 return compare_values(tval[0],
ve::select(pop_size > 0.0f, 1.0f - (employment / pop_size), 0.0f),
5177 read_float_from_payload(tval + 1));
5180 auto type = ws.world.pop_get_poptype(
to_pop(this_slot));
5182 auto pop_size = ve::apply(
5183 [&](dcon::state_instance_id loc, dcon::pop_type_id t) {
5191 auto employment = ve::apply(
5192 [&](dcon::state_instance_id loc, dcon::pop_type_id t) {
5200 return compare_values(tval[0],
ve::select(pop_size > 0.0f, 1.0f - (employment / pop_size), 0.0f),
5201 read_float_from_payload(tval + 1));
5204 auto type = ws.world.pop_get_poptype(
to_pop(this_slot));
5206 auto pop_size = ve::apply(
5207 [&](dcon::province_id loc, dcon::pop_type_id t) {
5215 auto employment = ve::apply(
5216 [&](dcon::province_id loc, dcon::pop_type_id t) {
5224 return compare_values(tval[0],
ve::select(pop_size > 0.0f, 1.0f - (employment / pop_size), 0.0f),
5225 read_float_from_payload(tval + 1));
5228 auto holder = ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[2]).tag_id);
5229 auto relation = ve::apply(
5230 [&ws, holder](dcon::nation_id a) {
5231 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, holder);
5232 return ws.world.diplomatic_relation_get_value(rel);
5235 return compare_values(tval[0], relation,
float(
payload(tval[1]).signed_value));
5238 auto relation = ve::apply(
5239 [&ws](dcon::nation_id a, dcon::nation_id b) {
5240 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, b);
5241 return ws.world.diplomatic_relation_get_value(rel);
5244 return compare_values(tval[0], relation,
float(
payload(tval[1]).signed_value));
5247 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
5248 auto relation = ve::apply(
5249 [&ws](dcon::nation_id a, dcon::nation_id b) {
5250 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, b);
5251 return ws.world.diplomatic_relation_get_value(rel);
5254 return compare_values(tval[0], relation,
float(
payload(tval[1]).signed_value));
5258 auto relation = ve::apply(
5259 [&ws](dcon::nation_id a, dcon::nation_id b) {
5260 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, b);
5261 return ws.world.diplomatic_relation_get_value(rel);
5264 return compare_values(tval[0], relation,
float(
payload(tval[1]).signed_value));
5267 auto relation = ve::apply(
5268 [&ws](dcon::nation_id a, dcon::nation_id b) {
5269 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, b);
5270 return ws.world.diplomatic_relation_get_value(rel);
5273 return compare_values(tval[0], relation,
float(
payload(tval[1]).signed_value));
5276 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(from_slot));
5277 auto relation = ve::apply(
5278 [&ws](dcon::nation_id a, dcon::nation_id b) {
5279 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, b);
5280 return ws.world.diplomatic_relation_get_value(rel);
5283 return compare_values(tval[0], relation,
float(
payload(tval[1]).signed_value));
5287 return compare_values(tval[0], ws.world.nation_get_variables(
to_nation(primary_slot),
id), read_float_from_payload(tval + 1));
5291 return compare_values(tval[0], ws.world.nation_get_upper_house(
to_nation(primary_slot),
id), 100.0f * read_float_from_payload(tval + 1));
5294 return tf_pop_unemployment_nation<return_type>(tval, ws, primary_slot, int32_t(), int32_t());
5297 return tf_pop_unemployment_state<return_type>(tval, ws, primary_slot, int32_t(), int32_t());
5300 return tf_pop_unemployment_province<return_type>(tval, ws, primary_slot, int32_t(), int32_t());
5303 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
5304 auto si = ws.world.province_get_state_membership(location);
5305 return tf_unemployment_by_type_state<return_type>(tval, ws,
to_generic(si), int32_t(), int32_t());
5308 return compare_values(tval[0], ws.world.province_get_party_loyalty(
payload(tval[1]).prov_id,
payload(tval[3]).ideo_id),
5309 payload(tval[2]).signed_value);
5312 return compare_values(tval[0], ws.world.province_get_party_loyalty(
payload(tval[1]).prov_id,
payload(tval[3]).ideo_id),
5313 payload(tval[2]).signed_value);
5316 return compare_values(tval[0], ws.world.province_get_party_loyalty(
payload(tval[1]).prov_id,
payload(tval[3]).ideo_id),
5317 payload(tval[2]).signed_value);
5320 return compare_values(tval[0], ws.world.province_get_party_loyalty(
payload(tval[1]).prov_id,
payload(tval[3]).ideo_id),
5321 payload(tval[2]).signed_value);
5324 return compare_values(tval[0], ws.world.province_get_party_loyalty(
to_prov(from_slot),
payload(tval[2]).ideo_id),
5325 payload(tval[1]).signed_value);
5328 return compare_values(tval[0], ws.world.province_get_party_loyalty(
to_prov(primary_slot),
payload(tval[2]).ideo_id),
5329 payload(tval[1]).signed_value);
5332 return compare_values(tval[0], ws.world.province_get_party_loyalty(
to_prov(primary_slot),
payload(tval[2]).ideo_id),
5333 payload(tval[1]).signed_value);
5336 return compare_values(tval[0], ws.world.province_get_party_loyalty(
to_prov(primary_slot),
payload(tval[2]).ideo_id),
5337 payload(tval[1]).signed_value);
5342 ws.world.province_get_modifier_values(
to_prov(primary_slot), sys::provincial_mod_offsets::min_build_railroad) <
5348 ws.world.province_get_modifier_values(
to_prov(primary_slot), sys::provincial_mod_offsets::min_build_railroad) <
5354 ws.world.province_get_modifier_values(
to_prov(primary_slot), sys::provincial_mod_offsets::min_build_railroad) <
5360 ws.world.province_get_modifier_values(
to_prov(primary_slot), sys::provincial_mod_offsets::min_build_railroad) <
5380 auto result = ws.world.province_get_is_coast(
to_prov(primary_slot)) &&
5385 ws.world.province_get_state_membership(
to_prov(primary_slot))));
5389 auto result = ws.world.province_get_is_coast(
to_prov(primary_slot)) &&
5394 ws.world.province_get_state_membership(
to_prov(primary_slot))));
5398 auto result = ws.world.province_get_is_coast(
to_prov(primary_slot)) &&
5403 ws.world.province_get_state_membership(
to_prov(primary_slot))));
5407 auto result = ws.world.province_get_is_coast(
to_prov(primary_slot)) &&
5412 ws.world.province_get_state_membership(
to_prov(primary_slot))));
5469 return compare_values(tval[0],
ve::select(total_pop > 0.0f, support_pop / total_pop, 0.0f), read_float_from_payload(tval + 2));
5475 return compare_values(tval[0],
ve::select(total_pop > 0.0f, support_pop / total_pop, 0.0f), read_float_from_payload(tval + 2));
5481 return compare_values(tval[0],
ve::select(total_pop > 0.0f, support_pop / total_pop, 0.0f), read_float_from_payload(tval + 2));
5486 return compare_values(tval[0], support_pop, read_float_from_payload(tval + 2));
5492 return compare_values(tval[0],
ve::select(total_pop > 0.0f, support_pop / total_pop, 0.0f), read_float_from_payload(tval + 2));
5498 return compare_values(tval[0],
ve::select(total_pop > 0.0f, support_pop / total_pop, 0.0f), read_float_from_payload(tval + 2));
5504 return compare_values(tval[0],
ve::select(total_pop > 0.0f, support_pop / total_pop, 0.0f), read_float_from_payload(tval + 2));
5509 return compare_values(tval[0], support_pop, read_float_from_payload(tval + 2));
5515 return compare_values_eq(tval[0], ws.world.nation_get_issues(
to_nation(primary_slot), issue), option);
5518 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
5522 return compare_values_eq(tval[0], ws.world.nation_get_issues(owner, issue), option);
5525 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
5529 return compare_values_eq(tval[0], ws.world.nation_get_issues(owner, issue), option);
5536 return compare_values_eq(tval[0], ws.world.nation_get_issues(owner, issue), option);
5542 return compare_values_eq(tval[0], ws.world.nation_get_reforms(
to_nation(primary_slot), issue), option);
5545 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
5549 return compare_values_eq(tval[0], ws.world.nation_get_reforms(owner, issue), option);
5552 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
5556 return compare_values_eq(tval[0], ws.world.nation_get_reforms(owner, issue), option);
5563 return compare_values_eq(tval[0], ws.world.nation_get_reforms(owner, issue), option);
5568 auto size = ws.world.nation_get_demographics(
to_nation(primary_slot), type);
5569 return compare_values(tval[0],
ve::select(total_pop > 0.0f, size / total_pop, 0.0f), read_float_from_payload(tval + 2));
5574 auto size = ws.world.state_instance_get_demographics(
to_state(primary_slot), type);
5575 return compare_values(tval[0],
ve::select(total_pop > 0.0f, size / total_pop, 0.0f), read_float_from_payload(tval + 2));
5580 auto size = ws.world.province_get_demographics(
to_prov(primary_slot), type);
5581 return compare_values(tval[0],
ve::select(total_pop > 0.0f, size / total_pop, 0.0f), read_float_from_payload(tval + 2));
5584 auto pop_location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
5587 auto size = ws.world.province_get_demographics(pop_location, type);
5588 return compare_values(tval[0],
ve::select(total_pop > 0.0f, size / total_pop, 0.0f), read_float_from_payload(tval + 2));
5592 auto amount = ws.world.nation_get_stockpiles(
to_nation(primary_slot), good);
5593 return compare_values(tval[0], amount, read_float_from_payload(tval + 2));
5596 return compare_values_eq(tval[0], ws.world.nation_get_religion(
to_nation(primary_slot)),
payload(tval[1]).rel_id);
5599 auto r = ws.world.rebel_faction_get_religion(
to_rebel(from_slot));
5600 return compare_values_eq(tval[0], ws.world.nation_get_religion(
to_nation(primary_slot)), r);
5603 return compare_values_eq(tval[0], ws.world.nation_get_religion(
to_nation(primary_slot)),
5604 ws.world.nation_get_religion(
to_nation(from_slot)));
5607 return compare_values_eq(tval[0], ws.world.nation_get_religion(
to_nation(primary_slot)),
5608 ws.world.nation_get_religion(
to_nation(this_slot)));
5611 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
5612 return compare_values_eq(tval[0], ws.world.nation_get_religion(
to_nation(primary_slot)), ws.world.nation_get_religion(owner));
5615 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
5616 return compare_values_eq(tval[0], ws.world.nation_get_religion(
to_nation(primary_slot)), ws.world.nation_get_religion(owner));
5620 return compare_values_eq(tval[0], ws.world.nation_get_religion(
to_nation(primary_slot)), ws.world.nation_get_religion(owner));
5628 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));
5636 auto tid = ws.world.stored_trigger_get_function(sid);
5637 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);
5654 auto holder = ws.world.nation_get_identity_from_identity_holder(nat);
5656 return compare_to_true(tval[0], ve::apply([&ws, ideo, new_name](dcon::national_identity_id h, dcon::nation_id n) {
5657 auto start = ws.world.national_identity_get_political_party_first(h).
id.index();
5658 auto end = start + ws.world.national_identity_get_political_party_count(h);
5660 for(int32_t i = start; i < end; i++) {
5661 auto pid = dcon::political_party_id(dcon::political_party_id::value_base_t(i));
5663 return ws.world.political_party_get_name(pid) == new_name;
5672 auto rp = ws.world.nation_get_ruling_party(n);
5673 return compare_to_true(tval[0], ws.world.political_party_get_name(rp) == new_name);
5680 auto popt = ws.world.issue_option_get_parent_issue(new_opt);
5684 auto holder = ws.world.nation_get_identity_from_identity_holder(nat);
5686 return compare_to_true(tval[0], ve::apply([&ws, ideo, new_opt, popt](dcon::national_identity_id h, dcon::nation_id n) {
5687 auto start = ws.world.national_identity_get_political_party_first(h).
id.index();
5688 auto end = start + ws.world.national_identity_get_political_party_count(h);
5690 for(int32_t i = start; i < end; i++) {
5691 auto pid = dcon::political_party_id(dcon::political_party_id::value_base_t(i));
5693 return ws.world.political_party_get_party_issues(pid, popt) == new_opt;
5701 auto rp = ws.world.nation_get_ruling_party(n);
5702 return compare_to_true(tval[0], ws.world.political_party_get_party_issues(rp, popt) == new_opt);
5706template<
typename return_type,
typename primary_type,
typename this_type,
typename from_type>
5710 tf_none<return_type, primary_type, this_type, from_type>,
5711#define TRIGGER_BYTECODE_ELEMENT(code, name, arg) tf_##name <return_type, primary_type, this_type, from_type>,
5713#undef TRIGGER_BYTECODE_ELEMENT
5717 tf_generic_scope<return_type, primary_type, this_type, from_type>,
5718 tf_x_neighbor_province_scope<return_type, primary_type, this_type, from_type>,
5719 tf_x_neighbor_country_scope_nation<return_type, primary_type, this_type, from_type>,
5720 tf_x_neighbor_country_scope_pop<return_type, primary_type, this_type, from_type>,
5721 tf_x_war_countries_scope_nation<return_type, primary_type, this_type, from_type>,
5722 tf_x_war_countries_scope_pop<return_type, primary_type, this_type, from_type>,
5723 tf_x_greater_power_scope<return_type, primary_type, this_type, from_type>,
5724 tf_x_owned_province_scope_state<return_type, primary_type, this_type, from_type>,
5725 tf_x_owned_province_scope_nation<return_type, primary_type, this_type, from_type>,
5726 tf_x_core_scope_province<return_type, primary_type, this_type, from_type>,
5727 tf_x_core_scope_nation<return_type, primary_type, this_type, from_type>,
5728 tf_x_state_scope<return_type, primary_type, this_type, from_type>,
5729 tf_x_substate_scope<return_type, primary_type, this_type, from_type>,
5730 tf_x_sphere_member_scope<return_type, primary_type, this_type, from_type>,
5731 tf_x_pop_scope_province<return_type, primary_type, this_type, from_type>,
5732 tf_x_pop_scope_state<return_type, primary_type, this_type, from_type>,
5733 tf_x_pop_scope_nation<return_type, primary_type, this_type, from_type>,
5734 tf_x_provinces_in_variable_region<return_type, primary_type, this_type, from_type>,
5735 tf_owner_scope_state<return_type, primary_type, this_type, from_type>,
5736 tf_owner_scope_province<return_type, primary_type, this_type, from_type>,
5737 tf_controller_scope<return_type, primary_type, this_type, from_type>,
5738 tf_location_scope<return_type, primary_type, this_type, from_type>,
5739 tf_country_scope_state<return_type, primary_type, this_type, from_type>,
5740 tf_country_scope_pop<return_type, primary_type, this_type, from_type>,
5741 tf_capital_scope<return_type, primary_type, this_type, from_type>,
5742 tf_this_scope<return_type, primary_type, this_type, from_type>,
5743 tf_this_scope<return_type, primary_type, this_type, from_type>,
5744 tf_this_scope<return_type, primary_type, this_type, from_type>,
5745 tf_this_scope<return_type, primary_type, this_type, from_type>,
5746 tf_from_scope<return_type, primary_type, this_type, from_type>,
5747 tf_from_scope<return_type, primary_type, this_type, from_type>,
5748 tf_from_scope<return_type, primary_type, this_type, from_type>,
5749 tf_from_scope<return_type, primary_type, this_type, from_type>,
5750 tf_sea_zone_scope<return_type, primary_type, this_type, from_type>,
5751 tf_cultural_union_scope<return_type, primary_type, this_type, from_type>,
5752 tf_overlord_scope<return_type, primary_type, this_type, from_type>,
5753 tf_sphere_owner_scope<return_type, primary_type, this_type, from_type>,
5754 tf_independence_scope<return_type, primary_type, this_type, from_type>,
5755 tf_flashpoint_tag_scope<return_type, primary_type, this_type, from_type>,
5756 tf_crisis_state_scope<return_type, primary_type, this_type, from_type>,
5757 tf_state_scope_pop<return_type, primary_type, this_type, from_type>,
5758 tf_state_scope_province<return_type, primary_type, this_type, from_type>,
5759 tf_tag_scope<return_type, primary_type, this_type, from_type>,
5760 tf_integer_scope<return_type, primary_type, this_type, from_type>,
5761 tf_country_scope_nation<return_type, primary_type, this_type, from_type>,
5762 tf_country_scope_province<return_type, primary_type, this_type, from_type>,
5763 tf_cultural_union_scope_pop<return_type, primary_type, this_type, from_type>,
5764 tf_capital_scope_province<return_type, primary_type, this_type, from_type>,
5765 tf_capital_scope_pop,
5767 tf_x_neighbor_province_scope_state,
5768 tf_x_provinces_in_variable_region_proper,
5772template<
typename return_type,
typename primary_type,
typename this_type,
typename from_type>
5773return_type
CALLTYPE test_trigger_generic(uint16_t
const* tval,
sys::state& ws, primary_type primary_slot, this_type this_slot,
5774 from_type from_slot) {
5776 ws, primary_slot, this_slot, from_slot);
5780#undef TRIGGER_FUNCTION
5783 auto base = state.value_modifiers[modifier];
5784 float product = base.factor;
5785 for(
uint32_t i = 0; i < base.segments_count && product != 0; ++i) {
5786 auto seg = state.value_modifier_segments[base.first_segment_offset + i];
5788 if(test_trigger_generic<bool>(state.trigger_data.data() + state.trigger_data_indices[seg.condition.index() + 1], state, primary,
5789 this_slot, from_slot)) {
5790 product *= seg.factor;
5797 auto base = state.value_modifiers[modifier];
5798 float 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 if(test_trigger_generic<bool>(state.trigger_data.data() + state.trigger_data_indices[seg.condition.index() + 1], state, primary,
5803 this_slot, from_slot)) {
5808 return sum * base.factor;
5812 auto base = state.value_modifiers[modifier];
5813 ve::fp_vector product = base.factor;
5814 for(
uint32_t i = 0; i < base.segments_count; ++i) {
5815 auto seg = state.value_modifier_segments[base.first_segment_offset + i];
5817 auto res = test_trigger_generic<ve::mask_vector>(
5818 state.trigger_data.data() + state.trigger_data_indices[seg.condition.index() + 1], state, primary, this_slot, from_slot);
5819 product =
ve::select(res, product * seg.factor, product);
5825 auto base = state.value_modifiers[modifier];
5826 ve::fp_vector sum = base.base;
5827 for(
uint32_t i = 0; i < base.segments_count; ++i) {
5828 auto seg = state.value_modifier_segments[base.first_segment_offset + i];
5830 auto res = test_trigger_generic<ve::mask_vector>(
5831 state.trigger_data.data() + state.trigger_data_indices[seg.condition.index() + 1], state, primary, this_slot, from_slot);
5832 sum =
ve::select(res, sum + seg.factor, sum);
5835 return sum * base.factor;
5839 auto base = state.value_modifiers[modifier];
5840 ve::fp_vector product = base.factor;
5841 for(
uint32_t i = 0; i < base.segments_count; ++i) {
5842 auto seg = state.value_modifier_segments[base.first_segment_offset + i];
5844 auto res = test_trigger_generic<ve::mask_vector>(
5845 state.trigger_data.data() + state.trigger_data_indices[seg.condition.index() + 1], state, primary, this_slot, from_slot);
5846 product =
ve::select(res, product * seg.factor, product);
5852 auto base = state.value_modifiers[modifier];
5853 ve::fp_vector sum = base.base;
5854 for(
uint32_t i = 0; i < base.segments_count; ++i) {
5855 auto seg = state.value_modifier_segments[base.first_segment_offset + i];
5857 auto res = test_trigger_generic<ve::mask_vector>(
5858 state.trigger_data.data() + state.trigger_data_indices[seg.condition.index() + 1], state, primary, this_slot, from_slot);
5859 sum =
ve::select(res, sum + seg.factor, sum);
5862 return sum * base.factor;
5865bool evaluate(
sys::state& state, dcon::trigger_key key, int32_t primary, int32_t this_slot, int32_t from_slot) {
5866 return test_trigger_generic<bool>(state.trigger_data.data() + state.trigger_data_indices[key.index() + 1], state, primary,
5867 this_slot, from_slot);
5869bool evaluate(
sys::state& state, uint16_t
const* data, int32_t primary, int32_t this_slot, int32_t from_slot) {
5870 return test_trigger_generic<bool>(data, state, primary, this_slot, from_slot);
5873ve::mask_vector evaluate(
sys::state& state, dcon::trigger_key key, ve::contiguous_tags<int32_t> primary,
5874 ve::tagged_vector<int32_t> this_slot, int32_t from_slot) {
5875 return test_trigger_generic<ve::mask_vector>(state.trigger_data.data() + state.trigger_data_indices[key.index() + 1], state,
5876 primary, this_slot, from_slot);
5878ve::mask_vector evaluate(
sys::state& state, uint16_t
const* data, ve::contiguous_tags<int32_t> primary,
5879 ve::tagged_vector<int32_t> this_slot, int32_t from_slot) {
5880 return test_trigger_generic<ve::mask_vector>(data, state, primary, this_slot, from_slot);
5883ve::mask_vector evaluate(
sys::state& state, dcon::trigger_key key, ve::tagged_vector<int32_t> primary,
5884 ve::tagged_vector<int32_t> this_slot, int32_t from_slot) {
5885 return test_trigger_generic<ve::mask_vector>(state.trigger_data.data() + state.trigger_data_indices[key.index() + 1], state,
5886 primary, this_slot, from_slot);
5888ve::mask_vector evaluate(
sys::state& state, uint16_t
const* data, ve::tagged_vector<int32_t> primary,
5889 ve::tagged_vector<int32_t> this_slot, int32_t from_slot) {
5890 return test_trigger_generic<ve::mask_vector>(data, state, primary, this_slot, from_slot);
5893ve::mask_vector evaluate(
sys::state& state, dcon::trigger_key key, ve::contiguous_tags<int32_t> primary,
5894 ve::contiguous_tags<int32_t> this_slot, int32_t from_slot) {
5895 return test_trigger_generic<ve::mask_vector>(state.trigger_data.data() + state.trigger_data_indices[key.index() + 1], state,
5896 primary, this_slot, from_slot);
5898ve::mask_vector evaluate(
sys::state& state, uint16_t
const* data, ve::contiguous_tags<int32_t> primary,
5899 ve::contiguous_tags<int32_t> this_slot, int32_t from_slot) {
5900 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)
bool political_party_is_active(sys::state &state, dcon::nation_id n, dcon::political_party_id p)
float get_social_reform_desire(sys::state const &state, dcon::pop_id p)
float get_luxury_needs(sys::state const &state, dcon::pop_id p)
dcon::pop_demographics_key to_key(sys::state const &state, dcon::ideology_id v)
float get_literacy(sys::state const &state, dcon::pop_id p)
float get_consciousness(sys::state const &state, dcon::pop_id p)
float get_militancy(sys::state const &state, dcon::pop_id p)
float get_raw_employment(sys::state const &state, dcon::pop_id p)
float get_life_needs(sys::state const &state, dcon::pop_id p)
float get_political_reform_desire(sys::state const &state, dcon::pop_id p)
float get_everyday_needs(sys::state const &state, dcon::pop_id p)
float get_demo(sys::state const &state, dcon::pop_id p, dcon::pop_demographics_key k)
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