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_instance), 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));
1856 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)));
1864 auto tag = ws.world.nation_get_identity_from_identity_holder(
to_nation(primary_slot));
1865 auto result = ve::apply(
1866 [&ws, pid](dcon::national_identity_id t) {
1867 for(
auto c : ws.world.province_get_core(pid)) {
1868 if(c.get_identity() == t)
1877 auto tag = ws.world.nation_get_identity_from_identity_holder(
to_nation(this_slot));
1878 auto result = ve::apply(
1879 [&ws](dcon::province_id pid, dcon::national_identity_id t) {
1880 for(
auto c : ws.world.province_get_core(pid)) {
1881 if(c.get_identity() == t)
1890 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
1891 auto tag = ws.world.nation_get_identity_from_identity_holder(owner);
1892 auto result = ve::apply(
1893 [&ws](dcon::province_id pid, dcon::national_identity_id t) {
1894 for(
auto c : ws.world.province_get_core(pid)) {
1895 if(c.get_identity() == t)
1904 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
1905 auto tag = ws.world.nation_get_identity_from_identity_holder(owner);
1906 auto result = ve::apply(
1907 [&ws](dcon::province_id pid, dcon::national_identity_id t) {
1908 for(
auto c : ws.world.province_get_core(pid)) {
1909 if(c.get_identity() == t)
1919 auto tag = ws.world.nation_get_identity_from_identity_holder(owner);
1920 auto result = ve::apply(
1921 [&ws](dcon::province_id pid, dcon::national_identity_id t) {
1922 for(
auto c : ws.world.province_get_core(pid)) {
1923 if(c.get_identity() == t)
1932 auto tag = ws.world.nation_get_identity_from_identity_holder(
to_nation(from_slot));
1933 auto result = ve::apply(
1934 [&ws](dcon::province_id pid, dcon::national_identity_id t) {
1935 for(
auto c : ws.world.province_get_core(pid)) {
1936 if(c.get_identity() == t)
1945 auto rtags = ws.world.rebel_faction_get_defection_target(
to_rebel(from_slot));
1946 auto result = ve::apply(
1947 [&ws](dcon::province_id pid, dcon::national_identity_id t) {
1948 for(
auto c : ws.world.province_get_core(pid)) {
1949 if(c.get_identity() == t)
1954 to_prov(primary_slot), rtags);
1958 auto tag = ws.world.nation_get_identity_from_identity_holder(
to_nation(from_slot));
1959 auto result = ve::apply(
1960 [&ws](dcon::state_instance_id sid, dcon::national_identity_id t) {
1961 for(
auto p : ws.world.state_definition_get_abstract_state_membership(ws.world.state_instance_get_definition(sid))) {
1962 if(!(ws.world.get_core_by_prov_tag_key(p.get_province(), t)))
1971 auto tag = ws.world.nation_get_identity_from_identity_holder(
to_nation(this_slot));
1972 auto result = ve::apply(
1973 [&ws](dcon::state_instance_id sid, dcon::national_identity_id t) {
1974 for(
auto p : ws.world.state_definition_get_abstract_state_membership(ws.world.state_instance_get_definition(sid))) {
1975 if(!(ws.world.get_core_by_prov_tag_key(p.get_province(), t)))
1984 auto tag = ws.world.nation_get_identity_from_identity_holder(ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot)));
1985 auto result = ve::apply(
1986 [&ws](dcon::state_instance_id sid, dcon::national_identity_id t) {
1987 for(
auto p : ws.world.state_definition_get_abstract_state_membership(ws.world.state_instance_get_definition(sid))) {
1988 if(!(ws.world.get_core_by_prov_tag_key(p.get_province(), t)))
1998 auto result = ve::apply(
1999 [&ws](dcon::state_instance_id sid, dcon::national_identity_id t) {
2000 for(
auto p : ws.world.state_definition_get_abstract_state_membership(ws.world.state_instance_get_definition(sid))) {
2001 if(!(ws.world.get_core_by_prov_tag_key(p.get_province(), t)))
2013 auto result = ve::apply(
2015 return bool(ws.world.get_core_by_prov_tag_key(pid, t));
2021 auto result = ve::apply(
2023 return bool(ws.world.get_core_by_prov_tag_key(pid, t));
2025 ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot)));
2029 auto result = ve::apply(
2031 for(
auto p : ws.world.state_definition_get_abstract_state_membership(ws.world.state_instance_get_definition(sid))) {
2032 if(!(ws.world.get_core_by_prov_tag_key(p.get_province(), t)))
2052 ws.world.nation_get_owned_province_count(
to_nation(from_slot)));
2056 ws.world.nation_get_owned_province_count(
to_nation(this_slot)));
2059 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
2061 ws.world.nation_get_owned_province_count(owner));
2064 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
2066 ws.world.nation_get_owned_province_count(owner));
2071 ws.world.nation_get_owned_province_count(owner));
2083 auto holders = ws.world.national_identity_get_nation_from_identity_holder(
trigger::payload(tval[1]).tag_id);
2084 return compare_values_eq(tval[0], holders, 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)));
2096 ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)));
2099 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
2100 return compare_values_eq(tval[0], owner, ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)));
2104 return compare_values_eq(tval[0], owner, ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)));
2107 auto holders = ws.world.national_identity_get_nation_from_identity_holder(
trigger::payload(tval[1]).tag_id);
2108 return compare_values_eq(tval[0], holders, 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)));
2120 ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot)));
2123 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
2124 return compare_values_eq(tval[0], owner, ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot)));
2128 return compare_values_eq(tval[0], owner, ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot)));
2134 auto holders = ws.world.national_identity_get_nation_from_identity_holder(
trigger::payload(tval[1]).tag_id);
2135 return compare_to_true(tval[0], ws.world.nation_get_owned_province_count(holders) != 0);
2145 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
2149 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
2156 auto state_caps = ws.world.state_instance_get_capital(
to_state(primary_slot));
2160 auto nat_caps = ws.world.nation_get_capital(
to_nation(primary_slot));
2164 auto prov_id = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
2169 ws.world.province_get_continent(ws.world.nation_get_capital(
to_nation(this_slot))));
2172 return compare_values_eq(tval[0], ws.world.province_get_continent(ws.world.state_instance_get_capital(
to_state(primary_slot))),
2173 ws.world.province_get_continent(ws.world.nation_get_capital(
to_nation(this_slot))));
2177 ws.world.province_get_continent(ws.world.nation_get_capital(
to_nation(this_slot))));
2181 ws.world.province_get_continent(ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot))),
2182 ws.world.province_get_continent(ws.world.nation_get_capital(
to_nation(this_slot))));
2186 ws.world.province_get_continent(ws.world.nation_get_capital(
to_nation(from_slot))));
2189 return compare_values_eq(tval[0], ws.world.province_get_continent(ws.world.state_instance_get_capital(
to_state(primary_slot))),
2190 ws.world.province_get_continent(ws.world.nation_get_capital(
to_nation(from_slot))));
2194 ws.world.province_get_continent(ws.world.nation_get_capital(
to_nation(from_slot))));
2198 ws.world.province_get_continent(ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot))),
2199 ws.world.province_get_continent(ws.world.nation_get_capital(
to_nation(from_slot))));
2202 auto tag_holder = ws.world.national_identity_get_nation_from_identity_holder(
trigger::payload(tval[1]).tag_id);
2220 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
2227 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
2241 auto holder = ws.world.national_identity_get_nation_from_identity_holder(
trigger::payload(tval[1]).tag_id);
2242 auto result = ve::apply(
2243 [&ws, holder](dcon::nation_id n) {
2244 return ws.world.unilateral_relationship_get_military_access(
2245 ws.world.get_unilateral_relationship_by_unilateral_pair(holder, n));
2251 auto result = ve::apply(
2252 [&ws](dcon::nation_id n, dcon::nation_id t) {
2253 return ws.world.unilateral_relationship_get_military_access(
2254 ws.world.get_unilateral_relationship_by_unilateral_pair(t, n));
2260 auto result = ve::apply(
2261 [&ws](dcon::nation_id n, dcon::nation_id t) {
2262 return ws.world.unilateral_relationship_get_military_access(
2263 ws.world.get_unilateral_relationship_by_unilateral_pair(t, n));
2269 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
2270 auto result = ve::apply(
2271 [&ws](dcon::nation_id n, dcon::nation_id t) {
2272 return ws.world.unilateral_relationship_get_military_access(
2273 ws.world.get_unilateral_relationship_by_unilateral_pair(t, n));
2279 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
2280 auto result = ve::apply(
2281 [&ws](dcon::nation_id n, dcon::nation_id t) {
2282 return ws.world.unilateral_relationship_get_military_access(
2283 ws.world.get_unilateral_relationship_by_unilateral_pair(t, n));
2290 auto result = ve::apply(
2291 [&ws](dcon::nation_id n, dcon::nation_id t) {
2292 return ws.world.unilateral_relationship_get_military_access(
2293 ws.world.get_unilateral_relationship_by_unilateral_pair(t, n));
2303 ws.world.nation_get_prestige(
to_nation(from_slot)));
2307 ws.world.nation_get_prestige(
to_nation(this_slot)));
2310 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
2311 return compare_values(tval[0], ws.world.nation_get_prestige(
to_nation(primary_slot)), ws.world.nation_get_prestige(owner));
2314 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
2315 return compare_values(tval[0], ws.world.nation_get_prestige(
to_nation(primary_slot)), ws.world.nation_get_prestige(owner));
2319 return compare_values(tval[0], ws.world.nation_get_prestige(
to_nation(primary_slot)), ws.world.nation_get_prestige(owner));
2345 auto state = ws.world.province_get_state_membership(
to_prov(primary_slot));
2351 auto state = ws.world.province_get_state_membership(
to_prov(primary_slot));
2357 ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)) == dcon::nation_id());
2367 auto result = ve::apply(
2368 [&ws, mod](dcon::nation_id n) {
2369 for(
auto m : ws.world.nation_get_current_modifiers(n)) {
2379 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
2381 auto result = ve::apply(
2382 [&ws, mod](dcon::nation_id n) {
2383 for(
auto m : ws.world.nation_get_current_modifiers(n)) {
2394 auto result = ve::apply(
2395 [&ws, mod](dcon::province_id n) {
2396 for(
auto m : ws.world.province_get_current_modifiers(n)) {
2406 return compare_values_eq(tval[0], ws.world.province_get_state_from_abstract_state_membership(
to_prov(primary_slot)),
2414 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);
2420 auto result = ve::apply([&ws, r](dcon::province_id p) {
2421 for(
auto m : ws.world.province_get_region_membership(p)) {
2422 if(m.get_region() == r)
2431 auto result = ve::apply([&ws, r](dcon::province_id p) {
2432 for(
auto m : ws.world.province_get_region_membership(p)) {
2433 if(m.get_region() == r)
2437 }, ws.world.state_instance_get_capital(
to_state(primary_slot)));
2442 auto result = ve::apply([&ws, r](dcon::province_id p) {
2443 for(
auto m : ws.world.province_get_region_membership(p)) {
2444 if(m.get_region() == r)
2448 }, ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot)));
2452 auto result = ve::apply([&](dcon::region_id sd, dcon::nation_id n) {
2453 for(
auto p : ws.world.region_get_region_membership(sd)) {
2454 if(p.get_province().get_nation_from_province_ownership() != n)
2462 auto result = ve::apply([&](dcon::state_definition_id sd, dcon::nation_id n) {
2463 for(
auto p : ws.world.state_definition_get_abstract_state_membership(sd)) {
2464 if(p.get_province().get_nation_from_province_ownership() != n)
2480 ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot)));
2487 ws.world.province_get_nation_from_province_ownership(
to_prov(from_slot)));
2494 auto tag_holder = ws.world.national_identity_get_nation_from_identity_holder(
trigger::payload(tval[1]).tag_id);
2496 auto main_brigades = ws.world.nation_get_active_regiments(
to_nation(primary_slot));
2497 auto this_brigades = ws.world.nation_get_active_regiments(tag_holder);
2501 auto main_brigades = ws.world.nation_get_active_regiments(
to_nation(primary_slot));
2502 auto this_brigades = ws.world.nation_get_active_regiments(
trigger::to_nation(this_slot));
2506 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
trigger::to_state(this_slot));
2507 return tf_stronger_army_than_this_nation<return_type>(tval, ws, primary_slot,
to_generic(owner), int32_t());
2510 auto owner = ws.world.province_get_nation_from_province_ownership(
trigger::to_prov(this_slot));
2511 return tf_stronger_army_than_this_nation<return_type>(tval, ws, primary_slot,
to_generic(owner), int32_t());
2515 return tf_stronger_army_than_this_nation<return_type>(tval, ws, primary_slot,
to_generic(owner), int32_t());
2518 return tf_stronger_army_than_this_nation<return_type>(tval, ws, primary_slot, from_slot, int32_t());
2521 return tf_stronger_army_than_this_province<return_type>(tval, ws, primary_slot, from_slot, int32_t());
2524 auto tag_holder = ws.world.national_identity_get_nation_from_identity_holder(
trigger::payload(tval[1]).tag_id);
2526 ve::apply([&ws, tag_holder](
2527 dcon::nation_id n) {
return bool(ws.world.get_nation_adjacency_by_nation_adjacency_pair(n, tag_holder)); },
2532 auto result = ve::apply(
2533 [&ws](dcon::nation_id n, dcon::nation_id o) {
return bool(ws.world.get_nation_adjacency_by_nation_adjacency_pair(n, o)); },
2538 auto result = ve::apply(
2539 [&ws](dcon::nation_id n, dcon::nation_id o) {
return bool(ws.world.get_nation_adjacency_by_nation_adjacency_pair(n, o)); },
2544 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
2545 auto result = ve::apply(
2546 [&ws](dcon::nation_id n, dcon::nation_id o) {
return bool(ws.world.get_nation_adjacency_by_nation_adjacency_pair(n, o)); },
2551 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(from_slot));
2552 auto result = ve::apply(
2553 [&ws](dcon::nation_id n, dcon::nation_id o) {
return bool(ws.world.get_nation_adjacency_by_nation_adjacency_pair(n, o)); },
2558 auto result = ve::apply(
2559 [&ws](dcon::state_instance_id s, dcon::nation_id tag) {
2560 for(
auto p : ws.world.state_definition_get_abstract_state_membership(ws.world.state_instance_get_definition(s))) {
2561 if(p.get_province().get_state_membership() == s) {
2562 for(auto a : ws.world.province_get_army_location(p.get_province())) {
2563 if(a.get_army().get_controller_from_army_control() == tag)
2574 auto result = ve::apply(
2575 [&ws](dcon::state_instance_id s, dcon::nation_id tag) {
2576 for(
auto p : ws.world.state_definition_get_abstract_state_membership(ws.world.state_instance_get_definition(s))) {
2577 if(p.get_province().get_state_membership() == s) {
2578 for(auto a : ws.world.province_get_army_location(p.get_province())) {
2579 if(a.get_army().get_controller_from_army_control() == tag)
2586 to_state(primary_slot), to_nation(this_slot));
2587 return compare_to_true(tval[0], result);
2590 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
2591 auto result = ve::apply(
2592 [&ws](dcon::state_instance_id s, dcon::nation_id tag) {
2593 for(
auto p : ws.world.state_definition_get_abstract_state_membership(ws.world.state_instance_get_definition(s))) {
2594 if(p.get_province().get_state_membership() == s) {
2595 for(auto a : ws.world.province_get_army_location(p.get_province())) {
2596 if(a.get_army().get_controller_from_army_control() == tag)
2603 to_state(primary_slot), owner);
2604 return compare_to_true(tval[0], result);
2607 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
2608 auto result = ve::apply(
2609 [&ws](dcon::state_instance_id s, dcon::nation_id tag) {
2610 for(
auto p : ws.world.state_definition_get_abstract_state_membership(ws.world.state_instance_get_definition(s))) {
2611 if(p.get_province().get_state_membership() == s) {
2612 for(auto a : ws.world.province_get_army_location(p.get_province())) {
2613 if(a.get_army().get_controller_from_army_control() == tag)
2620 to_state(primary_slot), owner);
2621 return compare_to_true(tval[0], result);
2625 auto result = ve::apply(
2626 [&ws](dcon::state_instance_id s, dcon::nation_id tag) {
2627 for(
auto p : ws.world.state_definition_get_abstract_state_membership(ws.world.state_instance_get_definition(s))) {
2628 if(p.get_province().get_state_membership() == s) {
2629 for(auto a : ws.world.province_get_army_location(p.get_province())) {
2630 if(a.get_army().get_controller_from_army_control() == tag)
2637 to_state(primary_slot), owner);
2638 return compare_to_true(tval[0], result);
2641 auto tag = ws.world.national_identity_get_nation_from_identity_holder(
trigger::payload(tval[1]).tag_id);
2642 auto result = ve::apply(
2643 [&ws, tag](dcon::state_instance_id s) {
2646 for(
auto p : ws.world.state_definition_get_abstract_state_membership(ws.world.state_instance_get_definition(s))) {
2647 if(p.get_province().get_state_membership() == s) {
2648 for(auto a : ws.world.province_get_army_location(p.get_province())) {
2649 if(a.get_army().get_controller_from_army_control() == tag)
2656 to_state(primary_slot));
2657 return compare_to_true(tval[0], result);
2660 auto result = ve::apply(
2661 [&ws](dcon::province_id p) {
2663 for(
auto a : ws.world.province_get_army_location(p)) {
2664 for(auto u : a.get_army().get_army_membership()) {
2670 to_prov(primary_slot));
2671 return compare_values(tval[0], result, int32_t(tval[1]));
2674 auto tag = ws.world.national_identity_get_nation_from_identity_holder(
trigger::payload(tval[1]).tag_id);
2675 auto result = ve::apply(
2676 [&ws, tag](dcon::province_id p) {
2679 for(
auto a : ws.world.province_get_army_location(p)) {
2680 if(a.get_army().get_controller_from_army_control() == tag)
2690 auto result = ve::apply(
2691 [&ws](dcon::province_id p, dcon::nation_id n) {
2692 for(
auto a : ws.world.province_get_army_location(p)) {
2693 if(a.get_army().get_controller_from_army_control() == n)
2702 auto result = ve::apply(
2703 [&ws](dcon::province_id p, dcon::nation_id n) {
2704 for(
auto a : ws.world.province_get_army_location(p)) {
2705 if(a.get_army().get_controller_from_army_control() == n)
2714 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
2715 auto result = ve::apply(
2716 [&ws](dcon::province_id p, dcon::nation_id n) {
2717 for(
auto a : ws.world.province_get_army_location(p)) {
2718 if(a.get_army().get_controller_from_army_control() == n)
2723 to_prov(primary_slot), owner);
2727 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
2728 auto result = ve::apply(
2729 [&ws](dcon::province_id p, dcon::nation_id n) {
2730 for(
auto a : ws.world.province_get_army_location(p)) {
2731 if(a.get_army().get_controller_from_army_control() == n)
2736 to_prov(primary_slot), owner);
2741 auto result = ve::apply(
2742 [&ws](dcon::province_id p, dcon::nation_id n) {
2743 for(
auto a : ws.world.province_get_army_location(p)) {
2744 if(a.get_army().get_controller_from_army_control() == n)
2749 to_prov(primary_slot), owner);
2753 auto holder = ws.world.national_identity_get_nation_from_identity_holder(
trigger::payload(tval[1]).tag_id);
2759 auto result = ve::apply([&ws](dcon::nation_id a, dcon::nation_id b) {
return military::are_at_war(ws, a, b); },
2764 auto result = ve::apply([&ws](dcon::nation_id a, dcon::nation_id b) {
return military::are_at_war(ws, a, b); },
2769 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
2770 auto result = ve::apply([&ws](dcon::nation_id a, dcon::nation_id b) {
return military::are_at_war(ws, a, b); },
2775 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
2776 auto result = ve::apply([&ws](dcon::nation_id a, dcon::nation_id b) {
return military::are_at_war(ws, a, b); },
2782 auto result = ve::apply([&ws](dcon::nation_id a, dcon::nation_id b) {
return military::are_at_war(ws, a, b); },
2790 auto result = ve::apply([&ws](dcon::province_id p) {
2791 for(
const auto ar : ws.world.province_get_army_location(p)) {
2792 if(ws.world.army_leadership_get_general(ws.world.army_get_army_leadership(ws.world.army_location_get_army(ar)))) {
2797 }, to_prov(primary_slot));
2798 return compare_to_true(tval[0], result);
2801 auto result = ve::apply([&ws, tval](dcon::state_instance_id p) {
2802 return ws.world.state_instance_get_owner_focus(p) ==
trigger::payload(tval[1]).nf_id;
2807 auto result = ve::apply([&ws, tval](dcon::province_id p) {
2808 return ws.world.state_instance_get_owner_focus(ws.world.province_get_state_membership(p)) ==
trigger::payload(tval[1]).
nf_id;
2813 return compare_values(tval[0], ws.world.nation_get_active_regiments(
to_nation(primary_slot)), int32_t(tval[1]));
2817 read_float_from_payload(tval + 1));
2820 return compare_values(tval[0], ws.world.nation_get_stockpiles(ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)),
economy::money),
2821 read_float_from_payload(tval + 1));
2824 return compare_values(tval[0], 1.0f - ws.world.nation_get_revanchism(
to_nation(primary_slot)),
2825 read_float_from_payload(tval + 1));
2828 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());
2831 auto rp = ws.world.nation_get_ruling_party(
to_nation(primary_slot));
2832 return compare_values_eq(tval[0], ws.world.political_party_get_ideology(rp),
trigger::payload(tval[1]).
ideo_id);
2836 auto rp = ws.world.nation_get_ruling_party(owner);
2837 return compare_values_eq(tval[0], ws.world.political_party_get_ideology(rp),
trigger::payload(tval[1]).
ideo_id);
2840 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
2841 auto rp = ws.world.nation_get_ruling_party(owner);
2842 return compare_values_eq(tval[0], ws.world.political_party_get_ideology(rp),
trigger::payload(tval[1]).
ideo_id);
2845 auto rp = ws.world.nation_get_ruling_party(
to_nation(primary_slot));
2846 dcon::text_key name{dcon::text_key::value_base_t(read_int32_t_from_payload(tval + 1)) };
2847 return compare_values_eq(tval[0], ws.world.political_party_get_name(rp), name);
2853 return compare_values(tval[0],
2855 ws.defines.movement_support_uh_factor / ws.world.nation_get_non_colonial_population(
to_nation(primary_slot)),
2856 read_float_from_payload(tval + 1));
2860 read_float_from_payload(tval + 1));
2863 return compare_values(tval[0],
2865 ws.defines.movement_support_uh_factor / ws.world.nation_get_non_colonial_population(
to_nation(primary_slot)),
2866 read_float_from_payload(tval + 1));
2872 auto result = ve::apply(
2873 [&ws](dcon::nation_id n) {
2875 for(
auto a : ws.world.nation_get_navy_control(n)) {
2876 auto memb = a.get_navy().get_navy_membership();
2877 total += int32_t(memb.end() - memb.begin());
2882 return compare_values(tval[0], result, int32_t(tval[1]));
2885 return compare_values(tval[0], ws.world.nation_get_plurality(
to_nation(primary_slot)), read_float_from_payload(tval + 1) / 100.0f);
2888 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);
2892 read_float_from_payload(tval + 1));
2896 return compare_values_eq(tval[0], ws.world.nation_get_religion(owner), ws.world.pop_get_religion(
to_pop(primary_slot)));
2899 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
2900 return compare_values_eq(tval[0], ws.world.nation_get_religion(owner),
2901 ws.world.province_get_dominant_religion(
to_prov(primary_slot)));
2904 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
2905 return compare_values_eq(tval[0], ws.world.nation_get_religion(owner),
2906 ws.world.state_instance_get_dominant_religion(
to_state(primary_slot)));
2910 return compare_values_eq(tval[0], ws.world.nation_get_primary_culture(owner), ws.world.pop_get_culture(
to_pop(primary_slot)));
2913 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
2914 return compare_values_eq(tval[0], ws.world.nation_get_primary_culture(owner),
2915 ws.world.province_get_dominant_culture(
to_prov(primary_slot)));
2918 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
2919 return compare_values_eq(tval[0], ws.world.nation_get_primary_culture(owner),
2920 ws.world.state_instance_get_dominant_culture(
to_state(primary_slot)));
2923 return compare_values_eq(tval[0], ws.world.nation_get_primary_culture(
to_nation(primary_slot)),
2924 ws.world.nation_get_primary_culture(
to_nation(from_slot)));
2927 auto this_owner = ws.world.province_get_nation_from_province_ownership(
to_prov(from_slot));
2928 return compare_values_eq(tval[0], ws.world.nation_get_primary_culture(
to_nation(primary_slot)),
2929 ws.world.nation_get_primary_culture(this_owner));
2932 return compare_values_eq(tval[0], ws.world.nation_get_primary_culture(
to_nation(primary_slot)),
2933 ws.world.nation_get_primary_culture(
to_nation(this_slot)));
2936 return compare_values_eq(tval[0], ws.world.nation_get_primary_culture(
to_nation(primary_slot)),
2937 ws.world.pop_get_culture(
to_pop(this_slot)));
2940 auto this_owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
2941 return compare_values_eq(tval[0], ws.world.nation_get_primary_culture(
to_nation(primary_slot)),
2942 ws.world.nation_get_primary_culture(this_owner));
2945 auto this_owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
2946 return compare_values_eq(tval[0], ws.world.nation_get_primary_culture(
to_nation(primary_slot)),
2947 ws.world.nation_get_primary_culture(this_owner));
2950 return compare_values_eq(tval[0], ws.world.state_instance_get_dominant_culture(
to_state(primary_slot)),
2951 ws.world.nation_get_primary_culture(
to_nation(this_slot)));
2955 return compare_values_eq(tval[0], ws.world.state_instance_get_dominant_culture(
to_state(primary_slot)),
2956 ws.world.nation_get_primary_culture(this_owner));
2959 auto this_owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
2960 return compare_values_eq(tval[0], ws.world.state_instance_get_dominant_culture(
to_state(primary_slot)),
2961 ws.world.nation_get_primary_culture(this_owner));
2964 auto this_owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
2965 return compare_values_eq(tval[0], ws.world.state_instance_get_dominant_culture(
to_state(primary_slot)),
2966 ws.world.nation_get_primary_culture(this_owner));
2969 return compare_values_eq(tval[0], ws.world.province_get_dominant_culture(
to_prov(primary_slot)),
2970 ws.world.nation_get_primary_culture(
to_nation(this_slot)));
2974 return compare_values_eq(tval[0], ws.world.province_get_dominant_culture(
to_prov(primary_slot)),
2975 ws.world.nation_get_primary_culture(this_owner));
2978 auto this_owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
2979 return compare_values_eq(tval[0], ws.world.province_get_dominant_culture(
to_prov(primary_slot)),
2980 ws.world.nation_get_primary_culture(this_owner));
2983 auto this_owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
2984 return compare_values_eq(tval[0], ws.world.province_get_dominant_culture(
to_prov(primary_slot)),
2985 ws.world.nation_get_primary_culture(this_owner));
2988 return compare_values_eq(tval[0], ws.world.pop_get_culture(
to_pop(primary_slot)),
2989 ws.world.nation_get_primary_culture(
to_nation(this_slot)));
2993 return compare_values_eq(tval[0], ws.world.pop_get_culture(
to_pop(primary_slot)),
2994 ws.world.nation_get_primary_culture(this_owner));
2997 auto this_owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
2998 return compare_values_eq(tval[0], ws.world.pop_get_culture(
to_pop(primary_slot)),
2999 ws.world.nation_get_primary_culture(this_owner));
3002 auto this_owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
3003 return compare_values_eq(tval[0], ws.world.pop_get_culture(
to_pop(primary_slot)),
3004 ws.world.nation_get_primary_culture(this_owner));
3007template<
typename N,
typename C>
3010 [&ws](dcon::nation_id n, dcon::culture_id c) {
3011 return ws.
world.nation_get_accepted_cultures(n, c);
3022 auto this_owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
3026 auto this_owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
3031 ws.world.nation_get_primary_culture(
to_nation(this_slot))));
3036 ws.world.nation_get_primary_culture(this_owner)));
3039 auto this_owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
3041 ws.world.nation_get_primary_culture(this_owner)));
3044 auto this_owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
3046 ws.world.nation_get_primary_culture(this_owner)));
3050 ws.world.nation_get_primary_culture(
to_nation(this_slot))));
3055 ws.world.nation_get_primary_culture(this_owner)));
3058 auto this_owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
3060 ws.world.nation_get_primary_culture(this_owner)));
3063 auto this_owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
3065 ws.world.nation_get_primary_culture(this_owner)));
3075 auto this_owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
3079 auto this_owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
3085 auto is_accepted = ve::apply(
3086 [&ws](dcon::nation_id n, dcon::culture_id c) {
3088 return ws.world.nation_get_accepted_cultures(n, c);
3092 owner, ws.world.pop_get_culture(
to_pop(primary_slot)));
3096 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
3097 auto is_accepted = ve::apply(
3098 [&ws](dcon::nation_id n, dcon::culture_id c) {
3100 return ws.world.nation_get_accepted_cultures(n, c);
3104 owner, ws.world.province_get_dominant_culture(
to_prov(primary_slot)));
3108 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
3109 auto is_accepted = ve::apply(
3110 [&ws](dcon::nation_id n, dcon::culture_id c) {
3112 return ws.world.nation_get_accepted_cultures(n, c);
3116 owner, ws.world.state_instance_get_dominant_culture(
to_state(primary_slot)));
3123 auto result = ve::apply(
3124 [&ws](dcon::state_instance_id s) {
3131 return compare_values_eq(tval[0], ws.world.nation_get_in_sphere_of(
to_nation(primary_slot)),
3132 ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id));
3135 return compare_values_eq(tval[0], ws.world.nation_get_in_sphere_of(
to_nation(primary_slot)),
to_nation(from_slot));
3138 return compare_values_eq(tval[0], ws.world.nation_get_in_sphere_of(
to_nation(primary_slot)),
to_nation(this_slot));
3141 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
3142 return compare_values_eq(tval[0], ws.world.nation_get_in_sphere_of(
to_nation(primary_slot)), owner);
3145 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
3146 return compare_values_eq(tval[0], ws.world.nation_get_in_sphere_of(
to_nation(primary_slot)), owner);
3150 return compare_values_eq(tval[0], ws.world.nation_get_in_sphere_of(
to_nation(primary_slot)), owner);
3158 [&ws, good](dcon::nation_id n) {
3175 [&](dcon::state_instance_id si, dcon::nation_id o) {
3176 auto d = ws.world.state_instance_get_definition(si);
3177 for(
auto p : ws.world.state_definition_get_abstract_state_membership(d)) {
3178 if(p.get_province().get_nation_from_province_ownership() == o) {
3179 if(p.get_province().get_rgo() == good)
3184 for(auto f : p.get_province().get_factory_location()) {
3185 if(f.get_factory().get_building_type().get_output() == good)
3192 to_state(primary_slot), ws.world.state_instance_get_nation_from_state_ownership(to_state(primary_slot))));
3195 auto pop_location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
3207 return compare_values(tval[0],
ve::select(total_pop > 0, mil_amount / total_pop, 0.0f), read_float_from_payload(tval + 1));
3212 return compare_values(tval[0],
ve::select(total_pop > 0, mil_amount / total_pop, 0.0f), read_float_from_payload(tval + 1));
3217 return compare_values(tval[0],
ve::select(total_pop > 0, mil_amount / total_pop, 0.0f), read_float_from_payload(tval + 1));
3222 return compare_values(tval[0],
ve::select(total_pop > 0, mil_amount / total_pop, 0.0f), read_float_from_payload(tval + 1));
3227 return compare_values(tval[0],
ve::select(total_pop > 0, mil_amount / total_pop, 0.0f), read_float_from_payload(tval + 1));
3232 return compare_values(tval[0],
ve::select(total_pop > 0, mil_amount / total_pop, 0.0f), read_float_from_payload(tval + 1));
3236 auto prior_opt = dcon::issue_option_id(dcon::issue_option_id::value_base_t(ref_id.index() - 1));
3237 auto reform_parent = ws.world.issue_option_get_parent_issue(ref_id);
3238 auto active_option = ws.world.nation_get_issues(
to_nation(primary_slot), reform_parent);
3240 return compare_values_eq(tval[0], active_option, prior_opt);
3246 auto prior_opt = dcon::issue_option_id(dcon::issue_option_id::value_base_t(ref_id.index() - 1));
3247 auto reform_parent = ws.world.issue_option_get_parent_issue(ref_id);
3248 auto active_option = ws.world.nation_get_issues(owner, reform_parent);
3250 return compare_values_eq(tval[0], active_option, prior_opt);
3254 auto prior_opt = dcon::reform_option_id(dcon::reform_option_id::value_base_t(ref_id.index() - 1));
3255 auto reform_parent = ws.world.reform_option_get_parent_reform(ref_id);
3256 auto active_option = ws.world.nation_get_reforms(
to_nation(primary_slot), reform_parent);
3258 return compare_values_eq(tval[0], active_option, prior_opt);
3264 auto prior_opt = dcon::reform_option_id(dcon::reform_option_id::value_base_t(ref_id.index() - 1));
3265 auto reform_parent = ws.world.reform_option_get_parent_reform(ref_id);
3266 auto active_option = ws.world.nation_get_reforms(owner, reform_parent);
3268 return compare_values_eq(tval[0], active_option, prior_opt);
3276 return compare_values(tval[0], value, read_float_from_payload(tval + 1));
3281 return compare_values(tval[0], value, read_float_from_payload(tval + 1));
3284 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
3285 auto culture = ws.world.pop_get_culture(
to_pop(primary_slot));
3287 auto result = ve::apply(
3288 [&ws](dcon::province_id p, dcon::culture_id c) {
3289 for(
auto co : ws.world.province_get_core(p)) {
3290 if(co.get_identity().get_primary_culture() == c)
3301 auto result = ve::apply(
3302 [&ws](dcon::province_id p, dcon::culture_id c) {
3303 for(
auto co : ws.world.province_get_core(p)) {
3304 if(co.get_identity().get_primary_culture() == c)
3313 return compare_values(tval[0], ws.world.province_get_nationalism(
to_prov(primary_slot)),
float(tval[1]));
3326 ws.world.province_get_rebel_faction_from_province_rebel_control(
to_prov(primary_slot)) != dcon::rebel_faction_id());
3329 return compare_values_eq(tval[0], ws.world.province_get_nation_from_province_control(
to_prov(primary_slot)),
3330 ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id));
3333 return compare_values_eq(tval[0], ws.world.province_get_nation_from_province_control(
to_prov(primary_slot)),
3337 return compare_values_eq(tval[0], ws.world.province_get_nation_from_province_control(
to_prov(primary_slot)),
3341 return compare_values_eq(tval[0], ws.world.province_get_nation_from_province_control(
to_prov(primary_slot)),
3342 ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot)));
3345 return compare_values_eq(tval[0], ws.world.province_get_nation_from_province_control(
to_prov(primary_slot)),
3346 ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot)));
3349 return compare_values_eq(tval[0], ws.world.province_get_nation_from_province_control(
to_prov(primary_slot)),
3353 return compare_values_eq(tval[0], ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)),
3354 ws.world.province_get_nation_from_province_control(
to_prov(primary_slot)));
3357 return compare_values_eq(tval[0], ws.world.province_get_rebel_faction_from_province_rebel_control(
to_prov(primary_slot)),
3361 return compare_to_true(tval[0], (ws.world.province_adjacency_get_type(ws.province_definitions.canals[tval[1] - 1]) &
3365 auto sid = ws.world.province_get_state_membership(
to_prov(primary_slot));
3366 return compare_values_eq(tval[0], ws.world.state_instance_get_capital(sid),
to_prov(primary_slot));
3369 auto id = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
3370 auto sid = ws.world.province_get_state_membership(
id);
3371 return compare_values_eq(tval[0], ws.world.state_instance_get_capital(sid),
id);
3374 auto holder = ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id);
3375 auto result = ve::apply(
3376 [&ws, holder](dcon::nation_id a) {
3377 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, holder);
3378 auto date = ws.world.diplomatic_relation_get_truce_until(rel);
3379 return bool(date) && date > ws.current_date;
3385 auto result = ve::apply(
3386 [&ws](dcon::nation_id a, dcon::nation_id b) {
3387 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, b);
3388 auto date = ws.world.diplomatic_relation_get_truce_until(rel);
3389 return bool(date) && date > ws.current_date;
3395 auto result = ve::apply(
3396 [&ws](dcon::nation_id a, dcon::nation_id b) {
3397 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, b);
3398 auto date = ws.world.diplomatic_relation_get_truce_until(rel);
3399 return bool(date) && date > ws.current_date;
3405 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
3406 auto result = ve::apply(
3407 [&ws](dcon::nation_id a, dcon::nation_id b) {
3408 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, b);
3409 auto date = ws.world.diplomatic_relation_get_truce_until(rel);
3410 return bool(date) && date > ws.current_date;
3416 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
3417 auto result = ve::apply(
3418 [&ws](dcon::nation_id a, dcon::nation_id b) {
3419 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, b);
3420 auto date = ws.world.diplomatic_relation_get_truce_until(rel);
3421 return bool(date) && date > ws.current_date;
3428 auto result = ve::apply(
3429 [&ws](dcon::nation_id a, dcon::nation_id b) {
3430 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, b);
3431 auto date = ws.world.diplomatic_relation_get_truce_until(rel);
3432 return bool(date) && date > ws.current_date;
3439 read_float_from_payload(tval + 1));
3443 read_float_from_payload(tval + 1));
3447 read_float_from_payload(tval + 1));
3450 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
3451 return compare_values(tval[0], ws.world.province_get_demographics(location,
demographics::total),
3452 read_float_from_payload(tval + 1));
3471 return compare_values_eq(tval[0], ws.world.pop_get_poptype(
to_pop(primary_slot)), type);
3474 auto result = ve::apply(
3475 [&ws](dcon::province_id p) {
3477 for(
auto a : ws.world.province_get_province_adjacency(p)) {
3478 auto other = a.get_connected_provinces(0) != p ? a.get_connected_provinces(0) : a.get_connected_provinces(1);
3490 dcon::unit_name_id name{ dcon::unit_name_id::value_base_t(read_int32_t_from_payload(tval + 1)) };
3491 auto result = ve::apply(
3492 [&ws, name](dcon::nation_id n) {
3493 for(
auto l : ws.world.nation_get_leader_loyalty(n)) {
3494 auto lname = l.get_leader().get_name();
3495 if(ws.to_string_view(lname) == ws.to_string_view(name))
3507 auto result = ve::apply(
3508 [&ws](dcon::nation_id n) {
3509 for(
uint32_t i = 0; i < ws.world.national_identity_size(); ++i) {
3510 dcon::national_identity_id tag{dcon::national_identity_id::value_base_t(i)};
3526 return compare_values_eq(tval[0],
to_prov(primary_slot),
payload(tval[1]).prov_id);
3529 auto tag_holder = ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id);
3530 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(primary_slot))),
3534 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(primary_slot))),
3538 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(primary_slot))),
3542 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
3543 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(primary_slot))),
3547 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
3548 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(primary_slot))),
3553 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(primary_slot))),
3557 auto tag_holder = ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id);
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 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)))),
3566 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)))),
3570 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
3571 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)))),
3575 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
3576 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)))),
3581 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)))),
3587 auto tag_holder = ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id);
3589 ws.world.nation_get_is_substate(
to_nation(primary_slot)) &&
3590 (ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(primary_slot))) == tag_holder));
3594 (ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
3599 (ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
3603 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
3605 ws.world.nation_get_is_substate(
to_nation(primary_slot)) &&
3606 (ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(primary_slot))) == owner));
3609 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
3611 ws.world.nation_get_is_substate(
to_nation(primary_slot)) &&
3612 (ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(primary_slot))) == owner));
3617 ws.world.nation_get_is_substate(
to_nation(primary_slot)) &&
3618 (ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(primary_slot))) == owner));
3621 auto tag_holder = ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id);
3622 auto result = ve::apply(
3623 [&ws, tag_holder](dcon::nation_id n) {
3624 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(n, tag_holder);
3625 return bool(rel) && ws.world.diplomatic_relation_get_are_allied(rel);
3631 auto result = ve::apply(
3632 [&ws](dcon::nation_id n, dcon::nation_id m) {
3633 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(n, m);
3634 return bool(rel) && ws.world.diplomatic_relation_get_are_allied(rel);
3640 auto result = ve::apply(
3641 [&ws](dcon::nation_id n, dcon::nation_id m) {
3642 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(n, m);
3643 return bool(rel) && ws.world.diplomatic_relation_get_are_allied(rel);
3649 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
3650 auto result = ve::apply(
3651 [&ws](dcon::nation_id n, dcon::nation_id m) {
3652 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(n, m);
3653 return bool(rel) && ws.world.diplomatic_relation_get_are_allied(rel);
3659 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
3660 auto result = ve::apply(
3661 [&ws](dcon::nation_id n, dcon::nation_id m) {
3662 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(n, m);
3663 return bool(rel) && ws.world.diplomatic_relation_get_are_allied(rel);
3670 auto result = ve::apply(
3671 [&ws](dcon::nation_id n, dcon::nation_id m) {
3672 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(n, m);
3673 return bool(rel) && ws.world.diplomatic_relation_get_are_allied(rel);
3680 [&](dcon::nation_id n) {
3681 auto d = ws.world.nation_get_last_war_loss(n);
3682 return bool(d) && ws.current_date <= (d + 365 * 5);
3687 [&](dcon::nation_id n) {
3688 auto d = ws.world.nation_get_last_war_loss(n);
3689 return bool(d) && ws.current_date <= (d + 365 * 5);
3696 return compare_values(tval[0],
3697 ws.world.nation_get_modifier_values(
to_nation(primary_slot), sys::national_mod_offsets::mobilization_size),
3698 read_float_from_payload(tval + 1));
3702 ws.world.nation_get_education_spending(
to_nation(primary_slot)));
3705 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
3706 return compare_to_true(tval[0], ws.world.nation_get_administrative_spending(owner) >= ws.world.nation_get_education_spending(owner));
3709 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
3710 return compare_to_true(tval[0], ws.world.nation_get_administrative_spending(owner) >= ws.world.nation_get_education_spending(owner));
3714 return compare_to_true(tval[0], ws.world.nation_get_administrative_spending(owner) >= ws.world.nation_get_education_spending(owner));
3718 auto ruling_ideology = ws.world.political_party_get_ideology(ws.world.nation_get_ruling_party(owner));
3719 auto population_size = ws.world.pop_get_size(
to_pop(primary_slot));
3720 auto ruling_support = ve::apply(
3721 [&](dcon::pop_id p, dcon::ideology_id i) {
3727 to_pop(primary_slot), ruling_ideology);
3728 return compare_values(tval[0],
ve::select(population_size > 0.0f, ruling_support / population_size, 0.0f),
3729 read_float_from_payload(tval + 1));
3732 auto cap_p = ws.world.state_instance_get_capital(
to_state(primary_slot));
3733 return compare_to_true(tval[0], ws.world.province_get_is_colonial(cap_p));
3739 return compare_to_true(tval[0], ws.world.province_get_is_colonial(ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot))));
3742 auto result = ve::apply(
3748 auto result = ve::apply(
3749 [&ws](dcon::nation_id n) {
3750 for(
auto p : ws.world.nation_get_province_ownership(n)) {
3751 auto rng = p.get_province().get_factory_location();
3752 if(rng.begin() != rng.end())
3764 auto holder = ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id);
3780 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
3786 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
3798 return compare_values(tval[0], ws.world.nation_get_total_ports(
to_nation(primary_slot)), tval[1]);
3805 [&ws](dcon::nation_id n) {
3806 auto d = ws.world.nation_get_election_ends(n);
3807 return bool(d) && d > ws.current_date;
3811 return compare_to_true(tval[0], ws.national_definitions.is_global_flag_variable_set(
payload(tval[1]).glob_id));
3814 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
3815 return compare_values_eq(tval[0], ws.world.nation_get_capital(owner),
to_prov(primary_slot));
3818 return compare_values_eq(tval[0], ws.world.nation_get_national_value(
to_nation(primary_slot)),
payload(tval[1]).mod_id);
3822 return compare_values_eq(tval[0], ws.world.nation_get_national_value(owner),
payload(tval[1]).mod_id);
3825 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
3826 return compare_values_eq(tval[0], ws.world.nation_get_national_value(owner),
payload(tval[1]).mod_id);
3829 return compare_values(tval[0], ws.world.nation_get_industrial_score(
to_nation(primary_slot)), tval[1]);
3832 return compare_values(tval[0], ws.world.nation_get_industrial_score(
to_nation(primary_slot)),
3833 ws.world.nation_get_industrial_score(ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id)));
3836 return compare_values(tval[0], ws.world.nation_get_industrial_score(
to_nation(primary_slot)),
3837 ws.world.nation_get_industrial_score(
to_nation(from_slot)));
3840 return compare_values(tval[0], ws.world.nation_get_industrial_score(
to_nation(primary_slot)),
3841 ws.world.nation_get_industrial_score(
to_nation(this_slot)));
3845 return compare_values(tval[0], ws.world.nation_get_industrial_score(
to_nation(primary_slot)),
3846 ws.world.nation_get_industrial_score(owner));
3849 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
3850 return compare_values(tval[0], ws.world.nation_get_industrial_score(
to_nation(primary_slot)),
3851 ws.world.nation_get_industrial_score(owner));
3854 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
3855 return compare_values(tval[0], ws.world.nation_get_industrial_score(
to_nation(primary_slot)),
3856 ws.world.nation_get_industrial_score(owner));
3859 return compare_values(tval[0], ws.world.nation_get_military_score(
to_nation(primary_slot)), tval[1]);
3862 return compare_values(tval[0], ws.world.nation_get_military_score(
to_nation(primary_slot)),
3863 ws.world.nation_get_military_score(ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id)));
3866 return compare_values(tval[0], ws.world.nation_get_military_score(
to_nation(primary_slot)),
3867 ws.world.nation_get_military_score(
to_nation(from_slot)));
3870 return compare_values(tval[0], ws.world.nation_get_military_score(
to_nation(primary_slot)),
3871 ws.world.nation_get_military_score(
to_nation(this_slot)));
3875 return compare_values(tval[0], ws.world.nation_get_military_score(
to_nation(primary_slot)),
3876 ws.world.nation_get_military_score(owner));
3879 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
3880 return compare_values(tval[0], ws.world.nation_get_military_score(
to_nation(primary_slot)),
3881 ws.world.nation_get_military_score(owner));
3884 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
3885 return compare_values(tval[0], ws.world.nation_get_military_score(
to_nation(primary_slot)),
3886 ws.world.nation_get_military_score(owner));
3893 return compare_to_true(tval[0], ws.world.nation_get_is_civilized(owner));
3896 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
3897 return compare_to_true(tval[0], ws.world.nation_get_is_civilized(owner));
3901 read_float_from_payload(tval + 1));
3908 return compare_to_true(tval[0], ws.world.nation_get_is_great_power(owner));
3911 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
3912 return compare_to_true(tval[0], ws.world.nation_get_is_great_power(owner));
3915 return compare_values(tval[0], ws.world.nation_get_rich_tax(
to_nation(primary_slot)),
payload(tval[1]).signed_value);
3918 return compare_values(tval[0], ws.world.nation_get_middle_tax(
to_nation(primary_slot)),
payload(tval[1]).signed_value);
3921 return compare_values(tval[0], ws.world.nation_get_poor_tax(
to_nation(primary_slot)),
payload(tval[1]).signed_value);
3933 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));
3937 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));
3940 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
3941 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));
3944 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));
3948 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));
3951 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
3952 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));
3955 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
3956 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));
3959 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));
3963 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));
3966 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
3967 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));
3970 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
3971 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));
3974 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));
3978 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));
3981 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
3982 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));
3985 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
3986 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));
3992 return compare_values_eq(tval[0], ws.world.nation_get_dominant_religion(
to_nation(primary_slot)),
payload(tval[1]).rel_id);
3995 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)));
3998 return compare_values_eq(tval[0], ws.world.state_instance_get_dominant_religion(
to_state(primary_slot)),
4002 return compare_values_eq(tval[0], ws.world.province_get_dominant_religion(
to_prov(primary_slot)),
payload(tval[1]).rel_id);
4005 return compare_values_eq(tval[0], ws.world.nation_get_dominant_culture(
to_nation(primary_slot)),
payload(tval[1]).cul_id);
4008 return compare_values_eq(tval[0], ws.world.state_instance_get_dominant_culture(
to_state(primary_slot)),
4012 return compare_values_eq(tval[0], ws.world.province_get_dominant_culture(
to_prov(primary_slot)),
payload(tval[1]).cul_id);
4015 return compare_values_eq(tval[0], ws.world.nation_get_dominant_issue_option(
to_nation(primary_slot)),
payload(tval[1]).opt_id);
4018 return compare_values_eq(tval[0], ws.world.state_instance_get_dominant_issue_option(
to_state(primary_slot)),
4022 return compare_values_eq(tval[0], ws.world.province_get_dominant_issue_option(
to_prov(primary_slot)),
payload(tval[1]).opt_id);
4025 return compare_values_eq(tval[0], ws.world.pop_get_dominant_issue_option(
to_pop(primary_slot)),
payload(tval[1]).opt_id);
4028 return compare_values_eq(tval[0], ws.world.nation_get_dominant_ideology(
to_nation(primary_slot)),
payload(tval[1]).ideo_id);
4031 return compare_values_eq(tval[0], ws.world.state_instance_get_dominant_ideology(
to_state(primary_slot)),
4035 return compare_values_eq(tval[0], ws.world.province_get_dominant_ideology(
to_prov(primary_slot)),
payload(tval[1]).ideo_id);
4038 return compare_values_eq(tval[0], ws.world.pop_get_dominant_ideology(
to_pop(primary_slot)),
payload(tval[1]).ideo_id);
4042 return compare_values(tval[0],
4045 read_float_from_payload(tval + 1));
4049 return compare_values(tval[0],
4052 read_float_from_payload(tval + 1));
4056 return compare_values(tval[0],
4059 read_float_from_payload(tval + 1));
4062 auto type = ws.world.pop_get_poptype(
to_pop(primary_slot));
4065 read_float_from_payload(tval + 1));
4069 return compare_values(tval[0],
4072 read_float_from_payload(tval + 1));
4076 return compare_values(tval[0],
4079 read_float_from_payload(tval + 1));
4083 return compare_values(tval[0],
4086 read_float_from_payload(tval + 1));
4089 auto type = ws.world.pop_get_poptype(
to_pop(primary_slot));
4092 read_float_from_payload(tval + 1));
4096 return compare_values(tval[0],
4099 read_float_from_payload(tval + 1));
4103 return compare_values(tval[0],
4106 read_float_from_payload(tval + 1));
4110 return compare_values(tval[0],
4113 read_float_from_payload(tval + 1));
4116 auto type = ws.world.pop_get_poptype(
to_pop(primary_slot));
4119 read_float_from_payload(tval + 1));
4123 ws.world.nation_get_rich_tax(
to_nation(primary_slot)) > ws.world.nation_get_poor_tax(
to_nation(primary_slot)));
4126 auto pop_culture = ws.world.pop_get_culture(
to_pop(primary_slot));
4127 auto cg = ws.world.culture_get_group_from_culture_group_membership(pop_culture);
4128 auto utag = ws.world.culture_group_get_identity_from_cultural_union_of(cg);
4129 return compare_to_true(tval[0], utag != dcon::national_identity_id());
4132 auto pc = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
4133 auto cg = ws.world.culture_get_group_from_culture_group_membership(pc);
4134 auto utag = ws.world.culture_group_get_identity_from_cultural_union_of(cg);
4135 return compare_to_true(tval[0], utag != dcon::national_identity_id());
4138 auto pc = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
4139 auto cg = ws.world.culture_get_group_from_culture_group_membership(pc);
4140 auto utag = ws.world.culture_group_get_identity_from_cultural_union_of(cg);
4141 return compare_values_eq(tval[0], utag,
payload(tval[1]).tag_id);
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(
to_nation(from_slot)));
4150 auto pc = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
4151 auto cg = ws.world.culture_get_group_from_culture_group_membership(pc);
4152 auto utag = ws.world.culture_group_get_identity_from_cultural_union_of(cg);
4153 return compare_values_eq(tval[0], utag, ws.world.nation_get_identity_from_identity_holder(
to_nation(this_slot)));
4156 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
4157 auto pc = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
4158 auto cg = ws.world.culture_get_group_from_culture_group_membership(pc);
4159 auto utag = ws.world.culture_group_get_identity_from_cultural_union_of(cg);
4160 return compare_values_eq(tval[0], utag, ws.world.nation_get_identity_from_identity_holder(owner));
4163 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
4164 auto pc = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
4165 auto cg = ws.world.culture_get_group_from_culture_group_membership(pc);
4166 auto utag = ws.world.culture_group_get_identity_from_cultural_union_of(cg);
4167 return compare_values_eq(tval[0], utag, ws.world.nation_get_identity_from_identity_holder(owner));
4171 auto pc = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
4172 auto cg = ws.world.culture_get_group_from_culture_group_membership(pc);
4173 auto utag = ws.world.culture_group_get_identity_from_cultural_union_of(cg);
4174 return compare_values_eq(tval[0], utag, ws.world.nation_get_identity_from_identity_holder(owner));
4177 auto prim_culture = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
4178 auto this_culture = ws.world.nation_get_primary_culture(
to_nation(this_slot));
4179 auto pcg = ws.world.culture_get_group_from_culture_group_membership(prim_culture);
4180 auto tcg = ws.world.culture_get_group_from_culture_group_membership(this_culture);
4181 return compare_values_eq(tval[0], pcg, tcg);
4184 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
4185 auto prim_culture = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
4186 auto this_culture = ws.world.nation_get_primary_culture(owner);
4187 auto pcg = ws.world.culture_get_group_from_culture_group_membership(prim_culture);
4188 auto tcg = ws.world.culture_get_group_from_culture_group_membership(this_culture);
4189 return compare_values_eq(tval[0], pcg, tcg);
4192 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
4193 auto prim_culture = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
4194 auto this_culture = ws.world.nation_get_primary_culture(owner);
4195 auto pcg = ws.world.culture_get_group_from_culture_group_membership(prim_culture);
4196 auto tcg = ws.world.culture_get_group_from_culture_group_membership(this_culture);
4197 return compare_values_eq(tval[0], pcg, tcg);
4201 auto prim_culture = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
4202 auto this_culture = ws.world.nation_get_primary_culture(owner);
4203 auto pcg = ws.world.culture_get_group_from_culture_group_membership(prim_culture);
4204 auto tcg = ws.world.culture_get_group_from_culture_group_membership(this_culture);
4205 return compare_values_eq(tval[0], pcg, tcg);
4209 auto pculture = ws.world.nation_get_primary_culture(
to_nation(primary_slot));
4211 auto accepted_pop = ve::apply(
4212 [&ws](dcon::nation_id n, dcon::culture_id pc) {
4216 for(
auto ac : ws.world.in_culture) {
4217 if(ws.world.nation_get_accepted_cultures(n, ac)) {
4218 accumulated += ws.world.nation_get_demographics(n, demographics::to_key(ws, ac));
4223 to_nation(primary_slot), pculture);
4225 return compare_to_true(tval[0], total_pop != accepted_pop);
4229 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
4230 auto pculture = ws.world.nation_get_primary_culture(owner);
4232 auto accepted_pop = ve::apply(
4233 [&ws](dcon::state_instance_id i, dcon::nation_id n, dcon::culture_id pc) {
4237 for(
auto ac : ws.world.in_culture) {
4238 if(ws.world.nation_get_accepted_cultures(n, ac)) {
4239 accumulated += ws.world.state_instance_get_demographics(i, demographics::to_key(ws, ac));
4244 to_state(primary_slot), owner, pculture);
4246 return compare_to_true(tval[0], total_pop != accepted_pop);
4250 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
4251 auto pculture = ws.world.nation_get_primary_culture(owner);
4253 auto accepted_pop = ve::apply(
4254 [&ws](dcon::province_id i, dcon::nation_id n, dcon::culture_id pc) {
4258 for(
auto ac : ws.world.in_culture) {
4259 if(ws.world.nation_get_accepted_cultures(n, ac)) {
4260 accumulated += ws.world.province_get_demographics(i, demographics::to_key(ws, ac));
4265 to_prov(primary_slot), owner, pculture);
4267 return compare_to_true(tval[0], total_pop != accepted_pop);
4270 return compare_values(tval[0], ws.world.nation_get_revanchism(
to_nation(primary_slot)), read_float_from_payload(tval + 1));
4274 return compare_values(tval[0], ws.world.nation_get_revanchism(owner), read_float_from_payload(tval + 1));
4280 return compare_values(tval[0], ws.world.nation_get_substates_count(
to_nation(primary_slot)), tval[1]);
4283 return compare_values(tval[0],
4284 ws.world.nation_get_vassals_count(
to_nation(primary_slot)) - ws.world.nation_get_substates_count(
to_nation(primary_slot)),
4288 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));
4291 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));
4294 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
4295 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));
4298 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
4299 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));
4302 auto tag_holder = ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id);
4303 return compare_to_true(tval[0], ws.world.nation_get_constructing_cb_target(
to_nation(primary_slot)) == tag_holder);
4306 return compare_values_eq(tval[0], ws.world.nation_get_constructing_cb_target(
to_nation(primary_slot)),
to_nation(from_slot));
4309 return compare_values_eq(tval[0], ws.world.nation_get_constructing_cb_target(
to_nation(primary_slot)),
to_nation(this_slot));
4312 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
4313 return compare_values_eq(tval[0], ws.world.nation_get_constructing_cb_target(
to_nation(primary_slot)), owner);
4316 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
4317 return compare_values_eq(tval[0], ws.world.nation_get_constructing_cb_target(
to_nation(primary_slot)), owner);
4321 return compare_values_eq(tval[0], ws.world.nation_get_constructing_cb_target(
to_nation(primary_slot)), owner);
4327 return compare_values(tval[0], ws.world.nation_get_constructing_cb_progress(
to_nation(primary_slot)),
4328 read_float_from_payload(tval + 1));
4331 return compare_values(tval[0],
4332 ws.world.nation_get_modifier_values(
to_nation(primary_slot), sys::national_mod_offsets::civilization_progress_modifier),
4333 read_float_from_payload(tval + 1));
4336 return compare_values_eq(tval[0], ws.world.nation_get_constructing_cb_type(
to_nation(primary_slot)),
payload(tval[1]).cb_id);
4339 auto tag_holder = ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id);
4340 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(tag_holder)),
4344 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(from_slot))),
4348 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(this_slot))),
4352 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
4353 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(owner)),
4357 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
4358 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(owner)),
4363 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(owner)),
4368 auto tag_holder = ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id);
4369 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(tag_holder)),
4370 ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)));
4373 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(from_slot))),
4374 ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)));
4377 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(
to_nation(this_slot))),
4378 ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)));
4381 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
4382 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(owner)),
4383 ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)));
4386 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
4387 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(owner)),
4388 ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)));
4392 return compare_values_eq(tval[0], ws.world.overlord_get_ruler(ws.world.nation_get_overlord_as_subject(owner)),
4393 ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot)));
4401 return compare_to_true(tval[0], ws.military_definitions.great_wars_enabled);
4404 auto result = ve::apply(
4405 [&ws](dcon::nation_id n) {
4406 for(
auto c : ws.world.nation_get_unilateral_relationship_as_target(n)) {
4407 if(c.get_foreign_investment() > 0.0f)
4419 auto holder = ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[1]).tag_id);
4420 return compare_values_eq(tval[0], ws.world.nation_get_in_sphere_of(holder),
to_nation(primary_slot));
4423 return compare_values_eq(tval[0], ws.world.nation_get_in_sphere_of(
to_nation(from_slot)),
to_nation(primary_slot));
4426 return compare_values_eq(tval[0], ws.world.nation_get_in_sphere_of(
to_nation(this_slot)),
to_nation(primary_slot));
4429 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
4430 return compare_values_eq(tval[0], ws.world.nation_get_in_sphere_of(owner),
to_nation(primary_slot));
4433 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
4434 return compare_values_eq(tval[0], ws.world.nation_get_in_sphere_of(owner),
to_nation(primary_slot));
4438 return compare_values_eq(tval[0], ws.world.nation_get_in_sphere_of(owner),
to_nation(primary_slot));
4441 return compare_values(tval[0], ws.world.nation_get_owned_state_count(
to_nation(primary_slot)), tval[1]);
4444 auto result = ve::apply([&](dcon::nation_id n) {
4446 auto wp = ws.world.nation_get_war_participant(n);
4447 if(wp.begin() == wp.end()) {
4451 if(w.get_is_attacker()) {
4452 score += military::primary_warscore(ws, w.get_war());
4454 score -= military::primary_warscore(ws, w.get_war());
4457 return score / float(wp.end() - wp.begin());
4458 }, to_nation(primary_slot));
4459 return compare_values(tval[0], result, read_float_from_payload(tval + 1));
4462 auto tag = ws.world.nation_get_identity_from_identity_holder(
to_nation(from_slot));
4463 return compare_to_true(tval[0], !ws.world.national_identity_get_is_not_releasable(tag));
4466 auto tag = ws.world.nation_get_identity_from_identity_holder(
to_nation(from_slot));
4467 return compare_to_true(tval[0], !ws.world.national_identity_get_is_not_releasable(tag));
4470 return compare_values(tval[0],
4472 ve::apply([&ws](dcon::province_id p) {
return ws.world.province_get_last_immigration(p).to_raw_value(); },
4474 ws.current_date.to_raw_value());
4477 return compare_values(tval[0],
4478 ws.current_date.to_raw_value() -
4479 ve::apply([&ws](dcon::province_id p) { return ws.world.province_get_last_control_change(p).to_raw_value(); },
4485 auto d = ws.world.nation_get_disarmed_until(n);
4486 return bool(d) && ws.current_date < d;
4491 auto d = ws.world.nation_get_disarmed_until(n);
4492 return bool(d) && ws.current_date < d;
4508 return compare_values(tval[0],
4510 [&ws](dcon::nation_id n) {
4511 float max_str = 0.0f;
4512 for(
auto m : ws.world.nation_get_movement_within(n)) {
4513 auto issue = m.get_movement().get_associated_issue_option();
4515 if(culture::issue_type(issue.get_parent_issue().get_issue_type()) == culture::issue_type::social &&
4516 m.get_movement().get_pop_support() > max_str) {
4517 max_str = m.get_movement().get_pop_support();
4523 to_nation(primary_slot)) *
4524 ws.defines.movement_support_uh_factor / ws.world.nation_get_non_colonial_population(to_nation(primary_slot)),
4525 read_float_from_payload(tval + 1));
4528 return compare_values(tval[0],
4530 [&ws](dcon::nation_id n) {
4531 float max_str = 0.0f;
4532 for(
auto m : ws.world.nation_get_movement_within(n)) {
4533 auto issue = m.get_movement().get_associated_issue_option();
4535 if(culture::issue_type(issue.get_parent_issue().get_issue_type()) == culture::issue_type::political &&
4536 m.get_movement().get_pop_support() > max_str) {
4537 max_str = m.get_movement().get_pop_support();
4543 to_nation(primary_slot)) *
4544 ws.defines.movement_support_uh_factor / ws.world.nation_get_non_colonial_population(to_nation(primary_slot)),
4545 read_float_from_payload(tval + 1));
4553 [&ws](dcon::pop_id p) {
4554 auto m = fatten(ws.world, ws.world.pop_get_movement_from_pop_movement_membership(p));
4555 return m && m.get_associated_issue_option() &&
4557 m.get_associated_issue_option().get_parent_issue().get_issue_type()) ==
4564 [&ws](dcon::pop_id p) {
4565 auto m = fatten(ws.world, ws.world.pop_get_movement_from_pop_movement_membership(p));
4566 return m && m.get_associated_issue_option() &&
4568 m.get_associated_issue_option().get_parent_issue().get_issue_type()) ==
4585 auto prim_culture = ws.world.nation_get_primary_culture(
to_nation(this_slot));
4586 auto culture_group = ws.world.culture_get_group_from_culture_group_membership(prim_culture);
4588 auto result = ve::apply(
4589 [&ws](dcon::nation_id n, dcon::culture_group_id g) {
4590 for(
auto s : ws.world.nation_get_gp_relationship_as_great_power(n)) {
4591 if((s.get_status() & nations::influence::level_mask) == nations::influence::level_in_sphere &&
4592 s.get_influence_target().get_primary_culture().get_group_from_culture_group_membership() == g) {
4598 to_nation(primary_slot), culture_group);
4600 return compare_to_true(tval[0], result);
4603 return compare_to_true(tval[0], ws.military_definitions.world_wars_enabled);
4606 return compare_values_eq(tval[0], ws.world.pop_get_culture(
to_pop(primary_slot)), ws.world.pop_get_culture(
to_pop(this_slot)));
4610 auto result = ve::apply(
4611 [&ws](dcon::state_instance_id s, dcon::culture_id c) {
4612 return bool(c) ? ws.world.state_instance_get_demographics(s,
demographics::to_key(ws, c)) > 0.0f :
false;
4619 auto result = ve::apply(
4620 [&ws](dcon::province_id s, dcon::culture_id c) {
4621 return bool(c) ? ws.world.province_get_demographics(s,
demographics::to_key(ws, c)) > 0.0f :
false;
4628 auto result = ve::apply(
4629 [&ws](dcon::nation_id s, dcon::culture_id c) {
4630 return bool(c) ? ws.world.nation_get_demographics(s,
demographics::to_key(ws, c)) > 0.0f :
false;
4636 return compare_values_eq(tval[0], ws.world.pop_get_culture(
to_pop(primary_slot)),
payload(tval[1]).cul_id);
4651 return compare_values_eq(tval[0], ws.world.pop_get_religion(
to_pop(primary_slot)),
4652 ws.world.pop_get_religion(
to_pop(this_slot)));
4655 auto rel = ws.world.pop_get_religion(
to_pop(this_slot));
4656 auto result = ve::apply(
4657 [&ws](dcon::state_instance_id s, dcon::religion_id r) {
4658 return bool(r) ? ws.world.state_instance_get_demographics(s,
demographics::to_key(ws, r)) > 0.0f :
false;
4664 auto rel = ws.world.pop_get_religion(
to_pop(this_slot));
4665 auto result = ve::apply(
4666 [&ws](dcon::province_id s, dcon::religion_id r) {
4667 return bool(r) ? ws.world.province_get_demographics(s,
demographics::to_key(ws, r)) > 0.0f :
false;
4673 auto rel = ws.world.pop_get_religion(
to_pop(this_slot));
4674 auto result = ve::apply(
4675 [&ws](dcon::nation_id s, dcon::religion_id r) {
4676 return bool(r) ? ws.world.nation_get_demographics(s,
demographics::to_key(ws, r)) > 0.0f :
false;
4682 return compare_values_eq(tval[0], ws.world.pop_get_religion(
to_pop(primary_slot)),
payload(tval[1]).rel_id);
4698 read_float_from_payload(tval + 1));
4702 read_float_from_payload(tval + 1));
4706 read_float_from_payload(tval + 1));
4713 return compare_values(tval[0],
4716 read_float_from_payload(tval + 1));
4720 return compare_values(tval[0],
4723 read_float_from_payload(tval + 1));
4727 return compare_values(tval[0],
4730 read_float_from_payload(tval + 1));
4737 return compare_values(tval[0],
4740 read_float_from_payload(tval + 1));
4744 return compare_values(tval[0],
4747 read_float_from_payload(tval + 1));
4751 return compare_values(tval[0],
4754 read_float_from_payload(tval + 1));
4761 return compare_values(tval[0],
4764 read_float_from_payload(tval + 1));
4768 return compare_values(tval[0],
4771 read_float_from_payload(tval + 1));
4775 return compare_values(tval[0],
4778 read_float_from_payload(tval + 1));
4782 auto sdef = ws.world.state_instance_get_definition(
to_state(primary_slot));
4783 auto sowner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
4784 auto result = ve::apply(
4785 [&ws, g](dcon::state_definition_id sd, dcon::nation_id o) {
4786 for(
auto p : ws.world.state_definition_get_abstract_state_membership(sd)) {
4787 if(p.get_province().get_nation_from_province_ownership() == o) {
4788 if(p.get_province().get_rgo() == g)
4795 return compare_to_true(tval[0], result);
4799 auto si = ws.world.province_get_state_membership(
to_prov(primary_slot));
4800 auto sdef = ws.world.state_instance_get_definition(si);
4801 auto sowner = ws.world.state_instance_get_nation_from_state_ownership(si);
4802 auto result = ve::apply(
4803 [&ws, g](dcon::state_definition_id sd, dcon::nation_id o) {
4804 for(
auto p : ws.world.state_definition_get_abstract_state_membership(sd)) {
4805 if(p.get_province().get_nation_from_province_ownership() == o) {
4806 if(p.get_province().get_rgo() == g)
4813 return compare_to_true(tval[0], result);
4817 ws.world.state_instance_get_flashpoint_tag(
to_state(primary_slot)) != dcon::national_identity_id());
4820 return compare_values(tval[0], ws.world.state_instance_get_flashpoint_tension(
to_state(primary_slot)),
4821 read_float_from_payload(tval + 1));
4824 return compare_values(tval[0], ws.world.state_instance_get_flashpoint_tension(ws.world.province_get_state_membership(
to_prov(primary_slot))),
4825 read_float_from_payload(tval + 1));
4832 auto first_wg = ws.crisis_attacker_wargoals.at(0);
4833 return compare_to_true(tval[0], first_wg.cb == ws.military_definitions.crisis_liberate);
4836 assert(
false &&
"Claim crisis is not part of PA");
4840 return compare_values(tval[0], ws.crisis_temperature, read_float_from_payload(tval + 1));
4843 auto result = ve::apply(
4844 [&ws](dcon::nation_id n) {
4845 auto sz = ws.crisis_participants.size();
4847 if(!ws.crisis_participants[i].id)
4849 if(ws.crisis_participants[i].id == n)
4859 auto result = ve::apply(
4860 [&ws](dcon::nation_id n) {
4861 auto sz = ws.crisis_participants.size();
4863 if(!ws.crisis_participants[i].id)
4865 if(ws.crisis_participants[i].id == n)
4875 return compare_values(tval[0],
4878 read_float_from_payload(tval + 1));
4882 return compare_values(tval[0],
4885 read_float_from_payload(tval + 1));
4889 return compare_values(tval[0],
4892 read_float_from_payload(tval + 1));
4895 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
4896 auto si = ws.world.province_get_state_membership(location);
4897 return tf_rich_strata_life_needs_state<return_type>(tval, ws,
to_generic(si), int32_t(), int32_t());
4901 return compare_values(tval[0],
4904 read_float_from_payload(tval + 1));
4908 return compare_values(tval[0],
4912 read_float_from_payload(tval + 1));
4916 return compare_values(tval[0],
4919 read_float_from_payload(tval + 1));
4922 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
4923 auto si = ws.world.province_get_state_membership(location);
4924 return tf_rich_strata_everyday_needs_state<return_type>(tval, ws,
to_generic(si), int32_t(), int32_t());
4928 return compare_values(tval[0],
4931 read_float_from_payload(tval + 1));
4935 return compare_values(tval[0],
4938 read_float_from_payload(tval + 1));
4942 return compare_values(tval[0],
4945 read_float_from_payload(tval + 1));
4948 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
4949 auto si = ws.world.province_get_state_membership(location);
4950 return tf_rich_strata_luxury_needs_state<return_type>(tval, ws,
to_generic(si), int32_t(), int32_t());
4954 return compare_values(tval[0],
4957 read_float_from_payload(tval + 1));
4961 return compare_values(tval[0],
4964 read_float_from_payload(tval + 1));
4968 return compare_values(tval[0],
4971 read_float_from_payload(tval + 1));
4974 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
4975 auto si = ws.world.province_get_state_membership(location);
4976 return tf_middle_strata_life_needs_state<return_type>(tval, ws,
to_generic(si), int32_t(), int32_t());
4980 return compare_values(tval[0],
4983 read_float_from_payload(tval + 1));
4987 return compare_values(tval[0],
4991 read_float_from_payload(tval + 1));
4995 return compare_values(tval[0],
4998 read_float_from_payload(tval + 1));
5001 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
5002 auto si = ws.world.province_get_state_membership(location);
5003 return tf_middle_strata_everyday_needs_state<return_type>(tval, ws,
to_generic(si), int32_t(), int32_t());
5007 return compare_values(tval[0],
5010 read_float_from_payload(tval + 1));
5014 return compare_values(tval[0],
5018 read_float_from_payload(tval + 1));
5022 return compare_values(tval[0],
5025 read_float_from_payload(tval + 1));
5028 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
5029 auto si = ws.world.province_get_state_membership(location);
5030 return tf_middle_strata_luxury_needs_state<return_type>(tval, ws,
to_generic(si), int32_t(), int32_t());
5034 return compare_values(tval[0],
5037 read_float_from_payload(tval + 1));
5041 return compare_values(tval[0],
5044 read_float_from_payload(tval + 1));
5048 return compare_values(tval[0],
5051 read_float_from_payload(tval + 1));
5054 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
5055 auto si = ws.world.province_get_state_membership(location);
5056 return tf_poor_strata_life_needs_state<return_type>(tval, ws,
to_generic(si), int32_t(), int32_t());
5060 return compare_values(tval[0],
5063 read_float_from_payload(tval + 1));
5067 return compare_values(tval[0],
5071 read_float_from_payload(tval + 1));
5075 return compare_values(tval[0],
5078 read_float_from_payload(tval + 1));
5081 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
5082 auto si = ws.world.province_get_state_membership(location);
5083 return tf_poor_strata_everyday_needs_state<return_type>(tval, ws,
to_generic(si), int32_t(), int32_t());
5087 return compare_values(tval[0],
5090 read_float_from_payload(tval + 1));
5094 return compare_values(tval[0],
5097 read_float_from_payload(tval + 1));
5101 return compare_values(tval[0],
5104 read_float_from_payload(tval + 1));
5107 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
5108 auto si = ws.world.province_get_state_membership(location);
5109 return tf_poor_strata_luxury_needs_state<return_type>(tval, ws,
to_generic(si), int32_t(), int32_t());
5112 auto holder = ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[2]).tag_id);
5113 auto result = ve::apply(
5114 [&ws, holder](dcon::nation_id a) {
5115 auto gpr = ws.world.get_gp_relationship_by_gp_influence_pair(holder, a);
5116 return ws.world.gp_relationship_get_influence(gpr);
5119 return compare_values(tval[0], result,
float(tval[1]));
5122 auto result = ve::apply(
5123 [&ws](dcon::nation_id a, dcon::nation_id b) {
5124 auto gpr = ws.world.get_gp_relationship_by_gp_influence_pair(b, a);
5125 return ws.world.gp_relationship_get_influence(gpr);
5128 return compare_values(tval[0], result,
float(tval[1]));
5131 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
5132 auto result = ve::apply(
5133 [&ws](dcon::nation_id a, dcon::nation_id b) {
5134 auto gpr = ws.world.get_gp_relationship_by_gp_influence_pair(b, a);
5135 return ws.world.gp_relationship_get_influence(gpr);
5138 return compare_values(tval[0], result,
float(tval[1]));
5141 auto result = ve::apply(
5142 [&ws](dcon::nation_id a, dcon::nation_id b) {
5143 auto gpr = ws.world.get_gp_relationship_by_gp_influence_pair(b, a);
5144 return ws.world.gp_relationship_get_influence(gpr);
5147 return compare_values(tval[0], result,
float(tval[1]));
5150 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(from_slot));
5151 auto result = ve::apply(
5152 [&ws](dcon::nation_id a, dcon::nation_id b) {
5153 auto gpr = ws.world.get_gp_relationship_by_gp_influence_pair(b, a);
5154 return ws.world.gp_relationship_get_influence(gpr);
5157 return compare_values(tval[0], result,
float(tval[1]));
5163 return compare_values(tval[0],
ve::select(pop_size > 0.0f, 1.0f - (employment / pop_size), 0.0f),
5164 read_float_from_payload(tval + 1));
5170 return compare_values(tval[0],
ve::select(pop_size > 0.0f, 1.0f - (employment / pop_size), 0.0f),
5171 read_float_from_payload(tval + 1));
5177 return compare_values(tval[0],
ve::select(pop_size > 0.0f, 1.0f - (employment / pop_size), 0.0f),
5178 read_float_from_payload(tval + 1));
5181 auto pop_size = ws.world.pop_get_size(
to_pop(primary_slot));
5183 return compare_values(tval[0], 1.0f - employment, read_float_from_payload(tval + 1));
5186 auto type = ws.world.pop_get_poptype(
to_pop(this_slot));
5188 auto pop_size = ve::apply(
5189 [&](dcon::nation_id loc, dcon::pop_type_id t) {
5197 auto employment = ve::apply(
5198 [&](dcon::nation_id loc, dcon::pop_type_id t) {
5206 return compare_values(tval[0],
ve::select(pop_size > 0.0f, 1.0f - (employment / pop_size), 0.0f),
5207 read_float_from_payload(tval + 1));
5210 auto type = ws.world.pop_get_poptype(
to_pop(this_slot));
5212 auto pop_size = ve::apply(
5213 [&](dcon::state_instance_id loc, dcon::pop_type_id t) {
5221 auto employment = ve::apply(
5222 [&](dcon::state_instance_id loc, dcon::pop_type_id t) {
5230 return compare_values(tval[0],
ve::select(pop_size > 0.0f, 1.0f - (employment / pop_size), 0.0f),
5231 read_float_from_payload(tval + 1));
5234 auto type = ws.world.pop_get_poptype(
to_pop(this_slot));
5236 auto pop_size = ve::apply(
5237 [&](dcon::province_id loc, dcon::pop_type_id t) {
5245 auto employment = ve::apply(
5246 [&](dcon::province_id loc, dcon::pop_type_id t) {
5254 return compare_values(tval[0],
ve::select(pop_size > 0.0f, 1.0f - (employment / pop_size), 0.0f),
5255 read_float_from_payload(tval + 1));
5258 auto holder = ws.world.national_identity_get_nation_from_identity_holder(
payload(tval[2]).tag_id);
5259 auto relation = ve::apply(
5260 [&ws, holder](dcon::nation_id a) {
5261 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, holder);
5262 return ws.world.diplomatic_relation_get_value(rel);
5265 return compare_values(tval[0], relation,
float(
payload(tval[1]).signed_value));
5268 auto relation = ve::apply(
5269 [&ws](dcon::nation_id a, dcon::nation_id b) {
5270 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, b);
5271 return ws.world.diplomatic_relation_get_value(rel);
5274 return compare_values(tval[0], relation,
float(
payload(tval[1]).signed_value));
5277 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
5278 auto relation = ve::apply(
5279 [&ws](dcon::nation_id a, dcon::nation_id b) {
5280 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, b);
5281 return ws.world.diplomatic_relation_get_value(rel);
5284 return compare_values(tval[0], relation,
float(
payload(tval[1]).signed_value));
5288 auto relation = ve::apply(
5289 [&ws](dcon::nation_id a, dcon::nation_id b) {
5290 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, b);
5291 return ws.world.diplomatic_relation_get_value(rel);
5294 return compare_values(tval[0], relation,
float(
payload(tval[1]).signed_value));
5297 auto relation = ve::apply(
5298 [&ws](dcon::nation_id a, dcon::nation_id b) {
5299 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, b);
5300 return ws.world.diplomatic_relation_get_value(rel);
5303 return compare_values(tval[0], relation,
float(
payload(tval[1]).signed_value));
5306 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(from_slot));
5307 auto relation = ve::apply(
5308 [&ws](dcon::nation_id a, dcon::nation_id b) {
5309 auto rel = ws.world.get_diplomatic_relation_by_diplomatic_pair(a, b);
5310 return ws.world.diplomatic_relation_get_value(rel);
5313 return compare_values(tval[0], relation,
float(
payload(tval[1]).signed_value));
5317 return compare_values(tval[0], ws.world.nation_get_variables(
to_nation(primary_slot),
id), read_float_from_payload(tval + 1));
5321 return compare_values(tval[0], ws.world.nation_get_upper_house(
to_nation(primary_slot),
id), 100.0f * read_float_from_payload(tval + 1));
5324 return tf_pop_unemployment_nation<return_type>(tval, ws, primary_slot, int32_t(), int32_t());
5327 return tf_pop_unemployment_state<return_type>(tval, ws, primary_slot, int32_t(), int32_t());
5330 return tf_pop_unemployment_province<return_type>(tval, ws, primary_slot, int32_t(), int32_t());
5333 auto location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
5334 auto si = ws.world.province_get_state_membership(location);
5335 return tf_unemployment_by_type_state<return_type>(tval, ws,
to_generic(si), int32_t(), int32_t());
5338 return compare_values(tval[0], ws.world.province_get_party_loyalty(
payload(tval[1]).prov_id,
payload(tval[3]).ideo_id),
5339 payload(tval[2]).signed_value);
5342 return compare_values(tval[0], ws.world.province_get_party_loyalty(
payload(tval[1]).prov_id,
payload(tval[3]).ideo_id),
5343 payload(tval[2]).signed_value);
5346 return compare_values(tval[0], ws.world.province_get_party_loyalty(
payload(tval[1]).prov_id,
payload(tval[3]).ideo_id),
5347 payload(tval[2]).signed_value);
5350 return compare_values(tval[0], ws.world.province_get_party_loyalty(
payload(tval[1]).prov_id,
payload(tval[3]).ideo_id),
5351 payload(tval[2]).signed_value);
5354 return compare_values(tval[0], ws.world.province_get_party_loyalty(
to_prov(from_slot),
payload(tval[2]).ideo_id),
5355 payload(tval[1]).signed_value);
5358 return compare_values(tval[0], ws.world.province_get_party_loyalty(
to_prov(primary_slot),
payload(tval[2]).ideo_id),
5359 payload(tval[1]).signed_value);
5362 return compare_values(tval[0], ws.world.province_get_party_loyalty(
to_prov(primary_slot),
payload(tval[2]).ideo_id),
5363 payload(tval[1]).signed_value);
5366 return compare_values(tval[0], ws.world.province_get_party_loyalty(
to_prov(primary_slot),
payload(tval[2]).ideo_id),
5367 payload(tval[1]).signed_value);
5372 ws.world.province_get_modifier_values(
to_prov(primary_slot), sys::provincial_mod_offsets::min_build_railroad) <
5378 ws.world.province_get_modifier_values(
to_prov(primary_slot), sys::provincial_mod_offsets::min_build_railroad) <
5384 ws.world.province_get_modifier_values(
to_prov(primary_slot), sys::provincial_mod_offsets::min_build_railroad) <
5390 ws.world.province_get_modifier_values(
to_prov(primary_slot), sys::provincial_mod_offsets::min_build_railroad) <
5410 auto result = ws.world.province_get_is_coast(
to_prov(primary_slot)) &&
5415 ws.world.province_get_state_membership(
to_prov(primary_slot))));
5419 auto result = ws.world.province_get_is_coast(
to_prov(primary_slot)) &&
5424 ws.world.province_get_state_membership(
to_prov(primary_slot))));
5428 auto result = ws.world.province_get_is_coast(
to_prov(primary_slot)) &&
5433 ws.world.province_get_state_membership(
to_prov(primary_slot))));
5437 auto result = ws.world.province_get_is_coast(
to_prov(primary_slot)) &&
5442 ws.world.province_get_state_membership(
to_prov(primary_slot))));
5499 return compare_values(tval[0],
ve::select(total_pop > 0.0f, support_pop / total_pop, 0.0f), read_float_from_payload(tval + 2));
5505 return compare_values(tval[0],
ve::select(total_pop > 0.0f, support_pop / total_pop, 0.0f), read_float_from_payload(tval + 2));
5511 return compare_values(tval[0],
ve::select(total_pop > 0.0f, support_pop / total_pop, 0.0f), read_float_from_payload(tval + 2));
5516 return compare_values(tval[0], support_pop, read_float_from_payload(tval + 2));
5522 return compare_values(tval[0],
ve::select(total_pop > 0.0f, support_pop / total_pop, 0.0f), read_float_from_payload(tval + 2));
5528 return compare_values(tval[0],
ve::select(total_pop > 0.0f, support_pop / total_pop, 0.0f), read_float_from_payload(tval + 2));
5534 return compare_values(tval[0],
ve::select(total_pop > 0.0f, support_pop / total_pop, 0.0f), read_float_from_payload(tval + 2));
5539 return compare_values(tval[0], support_pop, read_float_from_payload(tval + 2));
5545 return compare_values_eq(tval[0], ws.world.nation_get_issues(
to_nation(primary_slot), issue), option);
5548 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
5552 return compare_values_eq(tval[0], ws.world.nation_get_issues(owner, issue), option);
5555 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
5559 return compare_values_eq(tval[0], ws.world.nation_get_issues(owner, issue), option);
5566 return compare_values_eq(tval[0], ws.world.nation_get_issues(owner, issue), option);
5572 return compare_values_eq(tval[0], ws.world.nation_get_reforms(
to_nation(primary_slot), issue), option);
5575 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(primary_slot));
5579 return compare_values_eq(tval[0], ws.world.nation_get_reforms(owner, issue), option);
5582 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(primary_slot));
5586 return compare_values_eq(tval[0], ws.world.nation_get_reforms(owner, issue), option);
5593 return compare_values_eq(tval[0], ws.world.nation_get_reforms(owner, issue), option);
5598 auto size = ws.world.nation_get_demographics(
to_nation(primary_slot), type);
5599 return compare_values(tval[0],
ve::select(total_pop > 0.0f, size / total_pop, 0.0f), read_float_from_payload(tval + 2));
5604 auto size = ws.world.state_instance_get_demographics(
to_state(primary_slot), type);
5605 return compare_values(tval[0],
ve::select(total_pop > 0.0f, size / total_pop, 0.0f), read_float_from_payload(tval + 2));
5610 auto size = ws.world.province_get_demographics(
to_prov(primary_slot), type);
5611 return compare_values(tval[0],
ve::select(total_pop > 0.0f, size / total_pop, 0.0f), read_float_from_payload(tval + 2));
5614 auto pop_location = ws.world.pop_get_province_from_pop_location(
to_pop(primary_slot));
5617 auto size = ws.world.province_get_demographics(pop_location, type);
5618 return compare_values(tval[0],
ve::select(total_pop > 0.0f, size / total_pop, 0.0f), read_float_from_payload(tval + 2));
5622 auto amount = ws.world.nation_get_stockpiles(
to_nation(primary_slot), good);
5623 return compare_values(tval[0], amount, read_float_from_payload(tval + 2));
5626 return compare_values_eq(tval[0], ws.world.nation_get_religion(
to_nation(primary_slot)),
payload(tval[1]).rel_id);
5629 auto r = ws.world.rebel_faction_get_religion(
to_rebel(from_slot));
5630 return compare_values_eq(tval[0], ws.world.nation_get_religion(
to_nation(primary_slot)), r);
5633 return compare_values_eq(tval[0], ws.world.nation_get_religion(
to_nation(primary_slot)),
5634 ws.world.nation_get_religion(
to_nation(from_slot)));
5637 return compare_values_eq(tval[0], ws.world.nation_get_religion(
to_nation(primary_slot)),
5638 ws.world.nation_get_religion(
to_nation(this_slot)));
5641 auto owner = ws.world.state_instance_get_nation_from_state_ownership(
to_state(this_slot));
5642 return compare_values_eq(tval[0], ws.world.nation_get_religion(
to_nation(primary_slot)), ws.world.nation_get_religion(owner));
5645 auto owner = ws.world.province_get_nation_from_province_ownership(
to_prov(this_slot));
5646 return compare_values_eq(tval[0], ws.world.nation_get_religion(
to_nation(primary_slot)), ws.world.nation_get_religion(owner));
5650 return compare_values_eq(tval[0], ws.world.nation_get_religion(
to_nation(primary_slot)), ws.world.nation_get_religion(owner));
5658 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));
5666 auto tid = ws.world.stored_trigger_get_function(sid);
5667 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);
5684 auto holder = ws.world.nation_get_identity_from_identity_holder(nat);
5686 return compare_to_true(tval[0], ve::apply([&ws, ideo, new_name](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_name(pid) == new_name;
5702 auto rp = ws.world.nation_get_ruling_party(n);
5703 return compare_to_true(tval[0], ws.world.political_party_get_name(rp) == new_name);
5710 auto popt = ws.world.issue_option_get_parent_issue(new_opt);
5714 auto holder = ws.world.nation_get_identity_from_identity_holder(nat);
5716 return compare_to_true(tval[0], ve::apply([&ws, ideo, new_opt, popt](dcon::national_identity_id h, dcon::nation_id n) {
5717 auto start = ws.world.national_identity_get_political_party_first(h).
id.index();
5718 auto end = start + ws.world.national_identity_get_political_party_count(h);
5720 for(int32_t i = start; i < end; i++) {
5721 auto pid = dcon::political_party_id(dcon::political_party_id::value_base_t(i));
5723 return ws.world.political_party_get_party_issues(pid, popt) == new_opt;
5731 auto rp = ws.world.nation_get_ruling_party(n);
5732 return compare_to_true(tval[0], ws.world.political_party_get_party_issues(rp, popt) == new_opt);
5736template<
typename return_type,
typename primary_type,
typename this_type,
typename from_type>
5740 tf_none<return_type, primary_type, this_type, from_type>,
5741#define TRIGGER_BYTECODE_ELEMENT(code, name, arg) tf_##name <return_type, primary_type, this_type, from_type>,
5743#undef TRIGGER_BYTECODE_ELEMENT
5747 tf_generic_scope<return_type, primary_type, this_type, from_type>,
5748 tf_x_neighbor_province_scope<return_type, primary_type, this_type, from_type>,
5749 tf_x_neighbor_country_scope_nation<return_type, primary_type, this_type, from_type>,
5750 tf_x_neighbor_country_scope_pop<return_type, primary_type, this_type, from_type>,
5751 tf_x_war_countries_scope_nation<return_type, primary_type, this_type, from_type>,
5752 tf_x_war_countries_scope_pop<return_type, primary_type, this_type, from_type>,
5753 tf_x_greater_power_scope<return_type, primary_type, this_type, from_type>,
5754 tf_x_owned_province_scope_state<return_type, primary_type, this_type, from_type>,
5755 tf_x_owned_province_scope_nation<return_type, primary_type, this_type, from_type>,
5756 tf_x_core_scope_province<return_type, primary_type, this_type, from_type>,
5757 tf_x_core_scope_nation<return_type, primary_type, this_type, from_type>,
5758 tf_x_state_scope<return_type, primary_type, this_type, from_type>,
5759 tf_x_substate_scope<return_type, primary_type, this_type, from_type>,
5760 tf_x_sphere_member_scope<return_type, primary_type, this_type, from_type>,
5761 tf_x_pop_scope_province<return_type, primary_type, this_type, from_type>,
5762 tf_x_pop_scope_state<return_type, primary_type, this_type, from_type>,
5763 tf_x_pop_scope_nation<return_type, primary_type, this_type, from_type>,
5764 tf_x_provinces_in_variable_region<return_type, primary_type, this_type, from_type>,
5765 tf_owner_scope_state<return_type, primary_type, this_type, from_type>,
5766 tf_owner_scope_province<return_type, primary_type, this_type, from_type>,
5767 tf_controller_scope<return_type, primary_type, this_type, from_type>,
5768 tf_location_scope<return_type, primary_type, this_type, from_type>,
5769 tf_country_scope_state<return_type, primary_type, this_type, from_type>,
5770 tf_country_scope_pop<return_type, primary_type, this_type, from_type>,
5771 tf_capital_scope<return_type, primary_type, this_type, from_type>,
5772 tf_this_scope<return_type, primary_type, this_type, from_type>,
5773 tf_this_scope<return_type, primary_type, this_type, from_type>,
5774 tf_this_scope<return_type, primary_type, this_type, from_type>,
5775 tf_this_scope<return_type, primary_type, this_type, from_type>,
5776 tf_from_scope<return_type, primary_type, this_type, from_type>,
5777 tf_from_scope<return_type, primary_type, this_type, from_type>,
5778 tf_from_scope<return_type, primary_type, this_type, from_type>,
5779 tf_from_scope<return_type, primary_type, this_type, from_type>,
5780 tf_sea_zone_scope<return_type, primary_type, this_type, from_type>,
5781 tf_cultural_union_scope<return_type, primary_type, this_type, from_type>,
5782 tf_overlord_scope<return_type, primary_type, this_type, from_type>,
5783 tf_sphere_owner_scope<return_type, primary_type, this_type, from_type>,
5784 tf_independence_scope<return_type, primary_type, this_type, from_type>,
5785 tf_flashpoint_tag_scope<return_type, primary_type, this_type, from_type>,
5786 tf_crisis_state_scope<return_type, primary_type, this_type, from_type>,
5787 tf_state_scope_pop<return_type, primary_type, this_type, from_type>,
5788 tf_state_scope_province<return_type, primary_type, this_type, from_type>,
5789 tf_tag_scope<return_type, primary_type, this_type, from_type>,
5790 tf_integer_scope<return_type, primary_type, this_type, from_type>,
5791 tf_country_scope_nation<return_type, primary_type, this_type, from_type>,
5792 tf_country_scope_province<return_type, primary_type, this_type, from_type>,
5793 tf_cultural_union_scope_pop<return_type, primary_type, this_type, from_type>,
5794 tf_capital_scope_province<return_type, primary_type, this_type, from_type>,
5795 tf_capital_scope_pop,
5797 tf_x_neighbor_province_scope_state,
5798 tf_x_provinces_in_variable_region_proper,
5802template<
typename return_type,
typename primary_type,
typename this_type,
typename from_type>
5803return_type
CALLTYPE test_trigger_generic(uint16_t
const* tval,
sys::state& ws, primary_type primary_slot, this_type this_slot,
5804 from_type from_slot) {
5806 ws, primary_slot, this_slot, from_slot);
5810#undef TRIGGER_FUNCTION
5813 auto base = state.value_modifiers[modifier];
5814 float product = base.factor;
5815 for(
uint32_t i = 0; i < base.segments_count && product != 0; ++i) {
5816 auto seg = state.value_modifier_segments[base.first_segment_offset + i];
5818 if(test_trigger_generic<bool>(state.trigger_data.data() + state.trigger_data_indices[seg.condition.index() + 1], state, primary,
5819 this_slot, from_slot)) {
5820 product *= seg.factor;
5827 auto base = state.value_modifiers[modifier];
5828 float sum = base.base;
5829 for(
uint32_t i = 0; i < base.segments_count; ++i) {
5830 auto seg = state.value_modifier_segments[base.first_segment_offset + i];
5832 if(test_trigger_generic<bool>(state.trigger_data.data() + state.trigger_data_indices[seg.condition.index() + 1], state, primary,
5833 this_slot, from_slot)) {
5838 return sum * base.factor;
5842 auto base = state.value_modifiers[modifier];
5843 ve::fp_vector product = base.factor;
5844 for(
uint32_t i = 0; i < base.segments_count; ++i) {
5845 auto seg = state.value_modifier_segments[base.first_segment_offset + i];
5847 auto res = test_trigger_generic<ve::mask_vector>(
5848 state.trigger_data.data() + state.trigger_data_indices[seg.condition.index() + 1], state, primary, this_slot, from_slot);
5849 product =
ve::select(res, product * seg.factor, product);
5855 auto base = state.value_modifiers[modifier];
5856 ve::fp_vector sum = base.base;
5857 for(
uint32_t i = 0; i < base.segments_count; ++i) {
5858 auto seg = state.value_modifier_segments[base.first_segment_offset + i];
5860 auto res = test_trigger_generic<ve::mask_vector>(
5861 state.trigger_data.data() + state.trigger_data_indices[seg.condition.index() + 1], state, primary, this_slot, from_slot);
5862 sum =
ve::select(res, sum + seg.factor, sum);
5865 return sum * base.factor;
5869 auto base = state.value_modifiers[modifier];
5870 ve::fp_vector product = base.factor;
5871 for(
uint32_t i = 0; i < base.segments_count; ++i) {
5872 auto seg = state.value_modifier_segments[base.first_segment_offset + i];
5874 auto res = test_trigger_generic<ve::mask_vector>(
5875 state.trigger_data.data() + state.trigger_data_indices[seg.condition.index() + 1], state, primary, this_slot, from_slot);
5876 product =
ve::select(res, product * seg.factor, product);
5882 auto base = state.value_modifiers[modifier];
5883 ve::fp_vector sum = base.base;
5884 for(
uint32_t i = 0; i < base.segments_count; ++i) {
5885 auto seg = state.value_modifier_segments[base.first_segment_offset + i];
5887 auto res = test_trigger_generic<ve::mask_vector>(
5888 state.trigger_data.data() + state.trigger_data_indices[seg.condition.index() + 1], state, primary, this_slot, from_slot);
5889 sum =
ve::select(res, sum + seg.factor, sum);
5892 return sum * base.factor;
5895bool evaluate(
sys::state& state, dcon::trigger_key key, int32_t primary, int32_t this_slot, int32_t from_slot) {
5896 return test_trigger_generic<bool>(state.trigger_data.data() + state.trigger_data_indices[key.index() + 1], state, primary,
5897 this_slot, from_slot);
5899bool evaluate(
sys::state& state, uint16_t
const* data, int32_t primary, int32_t this_slot, int32_t from_slot) {
5900 return test_trigger_generic<bool>(data, state, primary, this_slot, from_slot);
5903ve::mask_vector evaluate(
sys::state& state, dcon::trigger_key key, ve::contiguous_tags<int32_t> primary,
5904 ve::tagged_vector<int32_t> this_slot, int32_t from_slot) {
5905 return test_trigger_generic<ve::mask_vector>(state.trigger_data.data() + state.trigger_data_indices[key.index() + 1], state,
5906 primary, this_slot, from_slot);
5908ve::mask_vector evaluate(
sys::state& state, uint16_t
const* data, ve::contiguous_tags<int32_t> primary,
5909 ve::tagged_vector<int32_t> this_slot, int32_t from_slot) {
5910 return test_trigger_generic<ve::mask_vector>(data, state, primary, this_slot, from_slot);
5913ve::mask_vector evaluate(
sys::state& state, dcon::trigger_key key, ve::tagged_vector<int32_t> primary,
5914 ve::tagged_vector<int32_t> this_slot, int32_t from_slot) {
5915 return test_trigger_generic<ve::mask_vector>(state.trigger_data.data() + state.trigger_data_indices[key.index() + 1], state,
5916 primary, this_slot, from_slot);
5918ve::mask_vector evaluate(
sys::state& state, uint16_t
const* data, ve::tagged_vector<int32_t> primary,
5919 ve::tagged_vector<int32_t> this_slot, int32_t from_slot) {
5920 return test_trigger_generic<ve::mask_vector>(data, state, primary, this_slot, from_slot);
5923ve::mask_vector evaluate(
sys::state& state, dcon::trigger_key key, ve::contiguous_tags<int32_t> primary,
5924 ve::contiguous_tags<int32_t> this_slot, int32_t from_slot) {
5925 return test_trigger_generic<ve::mask_vector>(state.trigger_data.data() + state.trigger_data_indices[key.index() + 1], state,
5926 primary, this_slot, from_slot);
5928ve::mask_vector evaluate(
sys::state& state, uint16_t
const* data, ve::contiguous_tags<int32_t> primary,
5929 ve::contiguous_tags<int32_t> this_slot, int32_t from_slot) {
5930 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 assert(condition)
#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)
float supply(sys::state &state, dcon::market_id s, dcon::commodity_id c)
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
Holds important data about the game world, state, and other data regarding windowing,...
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