10 const int32_t era = int32_t((z >= 0 ? z : z - 146096) / 146097);
11 unsigned const doe =
static_cast<unsigned>(z - era * 146097);
12 unsigned const yoe = (doe - doe / 1460 + doe / 36524 - doe / 146096) / 365;
13 const int32_t y =
static_cast<int32_t
>(yoe) + era * 400;
14 unsigned const doy = doe - (365 * yoe + yoe / 4 - yoe / 100);
15 unsigned const mp = (5 * doy + 2) / 153;
16 unsigned const d = doy - (153 * mp + 2) / 5 + 1;
17 unsigned const m = mp < 10 ? mp + 3 : mp - 9;
59 dcon::province_id p{ dcon::province_id::value_base_t(p_index) };
60 for(
auto a : state->world.province_get_province_adjacency(p)) {
61 auto other = a.get_connected_provinces(0) == p ? a.get_connected_provinces(1) : a.get_connected_provinces(0);
62 if(other.get_nation_from_province_ownership() == dcon::nation_id() && other.id.index() < state->province_definitions.first_sea_province.index())
87 dcon::state_instance_id s{ dcon::state_instance_id::value_base_t(p_index) };
88 auto owner = state->world.state_instance_get_nation_from_state_ownership(s);
89 for(
auto p : state->world.state_instance_get_definition(s).get_abstract_state_membership()) {
90 if(p.get_province().get_nation_from_province_ownership() == owner) {
91 for(
auto a : p.get_province().get_province_adjacency()) {
92 auto other = a.get_connected_provinces(0) == p.get_province() ? a.get_connected_provinces(1) : a.get_connected_provinces(0);
93 if(other.get_nation_from_province_ownership() == dcon::nation_id() && other.id.index() < state->province_definitions.first_sea_province.index())
124 ve::tagged_vector<int32_t> value;
126 int32_t accumulated_mask = 0;
135 accumulated_mask |= (int32_t(v != -1) << index);
136 value.set(index++, v);
138 if(index == ve::vector_size) {
140 value = ve::tagged_vector<int32_t>();
142 accumulated_mask = 0;
147 if(index != 0 && !
result) {
161 dcon::nation_id n{ dcon::nation_id::value_base_t(n_index) };
162 auto nation_tag = state->world.nation_get_identity_from_identity_holder(n);
165 auto owners = state->world.province_get_nation_from_province_ownership(
trigger::to_prov(v));
169 for(
auto p : state->world.national_identity_get_core(nation_tag)) {
198 dcon::nation_id n{ dcon::nation_id::value_base_t(n_index) };
199 dcon::national_identity_id t{ dcon::national_identity_id::value_base_t(t_index) };
201 for(
auto p : state->world.nation_get_province_ownership(n)) {
202 if(state->world.get_core_by_prov_tag_key(p.get_province(), t))
230 dcon::province_id p{ dcon::province_id::value_base_t(p_index) };
231 dcon::national_identity_id t{ dcon::national_identity_id::value_base_t(t_index) };
233 auto core = state->world.get_core_by_prov_tag_key(p, t);
259 dcon::state_instance_id s{ dcon::state_instance_id::value_base_t(s_index) };
260 dcon::national_identity_id t{ dcon::national_identity_id::value_base_t(t_index) };
262 auto ab = state->world.state_instance_get_definition(s);
263 for(
auto p : state->world.state_definition_get_abstract_state_membership(ab)) {
264 if(state->world.get_core_by_prov_tag_key(p.get_province(), t))
292 dcon::state_instance_id s{ dcon::state_instance_id::value_base_t(s_index) };
293 dcon::national_identity_id t{ dcon::national_identity_id::value_base_t(t_index) };
295 auto ab = state->world.state_instance_get_definition(s);
296 for(
auto p : state->world.state_definition_get_abstract_state_membership(ab)) {
297 if(!
bool(state->world.get_core_by_prov_tag_key(p.get_province(), t)))
325 dcon::nation_id s{ dcon::nation_id::value_base_t(source_index) };
326 dcon::nation_id t{ dcon::nation_id::value_base_t(targ_index) };
352 dcon::nation_id s{ dcon::nation_id::value_base_t(source_index) };
353 dcon::nation_id t{ dcon::nation_id::value_base_t(targ_index) };
354 if(
auto p = state->world.get_unilateral_relationship_by_unilateral_pair(t, s); p) {
355 return state->world.unilateral_relationship_get_military_access(p);
377 dcon::state_instance_id s{ dcon::state_instance_id::value_base_t(s_index) };
397 dcon::factory_type_id f{ dcon::factory_type_id::value_base_t(findex) };
398 dcon::state_instance_id s{ dcon::state_instance_id::value_base_t(s_index) };
419 dcon::modifier_id f{ dcon::modifier_id::value_base_t(m_index) };
420 dcon::nation_id s{ dcon::nation_id::value_base_t(n_index) };
421 for(
auto m : state->world.nation_get_current_modifiers(s)) {
445 dcon::modifier_id f{ dcon::modifier_id::value_base_t(m_index) };
446 dcon::province_id s{ dcon::province_id::value_base_t(p_index) };
447 for(
auto m : state->world.province_get_current_modifiers(s)) {
471 dcon::region_id f{ dcon::region_id::value_base_t(rindex) };
472 dcon::province_id s{ dcon::province_id::value_base_t(p_index) };
473 for(
auto m : state->world.province_get_region_membership(s)) {
474 if(m.get_region() == f)
497 dcon::region_id f{ dcon::region_id::value_base_t(rindex) };
498 dcon::nation_id s{ dcon::nation_id::value_base_t(n_index) };
499 for(
auto m : state->world.region_get_region_membership(f)) {
500 if(m.get_province().get_nation_from_province_ownership() != s)
523 dcon::state_definition_id f{ dcon::state_definition_id::value_base_t(rindex) };
524 dcon::nation_id s{ dcon::nation_id::value_base_t(n_index) };
525 for(
auto m : state->world.state_definition_get_abstract_state_membership(f)) {
526 if(m.get_province().get_nation_from_province_ownership() != s)
549 dcon::nation_id a{ dcon::nation_id::value_base_t(aindex) };
550 dcon::nation_id b{ dcon::nation_id::value_base_t(bindex) };
551 return bool(state->world.get_nation_adjacency_by_nation_adjacency_pair(a, b));
571 dcon::state_instance_id s{ dcon::state_instance_id::value_base_t(sindex) };
572 dcon::nation_id n{ dcon::nation_id::value_base_t(nindex) };
574 for(
auto p : state->world.state_definition_get_abstract_state_membership(state->world.state_instance_get_definition(s))) {
575 if(p.get_province().get_state_membership() == s) {
576 for(
auto a : state->world.province_get_army_location(p.get_province())) {
577 if(a.get_army().get_controller_from_army_control() == n)
602 dcon::province_id s{ dcon::province_id::value_base_t(sindex) };
603 dcon::nation_id n{ dcon::nation_id::value_base_t(nindex) };
605 for(
auto a : state->world.province_get_army_location(s)) {
606 if(a.get_army().get_controller_from_army_control() == n)
629 dcon::province_id s{ dcon::province_id::value_base_t(sindex) };
632 for(
auto a : state->world.province_get_army_location(s)) {
633 auto mrange = a.get_army().get_army_membership();
634 total += int32_t(mrange.end() - mrange.begin());
655 dcon::nation_id s{ dcon::nation_id::value_base_t(sindex) };
656 dcon::nation_id n{ dcon::nation_id::value_base_t(nindex) };
677 dcon::province_id s{ dcon::province_id::value_base_t(sindex) };
678 for(
const auto ar : state->world.province_get_army_location(s)) {
679 if(state->world.army_leadership_get_general(state->world.army_get_army_leadership(state->world.army_location_get_army(ar)))) {
702 dcon::nation_id s{ dcon::nation_id::value_base_t(sindex) };
705 for(
auto a : state->world.nation_get_navy_control(s)) {
706 auto mrange = a.get_navy().get_navy_membership();
707 total += int32_t(mrange.end() - mrange.begin());
728 dcon::state_instance_id s{ dcon::state_instance_id::value_base_t(sindex) };
748 dcon::commodity_id c{ dcon::commodity_id::value_base_t(cindex) };
749 dcon::state_instance_id si{ dcon::state_instance_id::value_base_t(sindex) };
751 auto o = state->world.state_instance_get_nation_from_state_ownership(si);
752 auto d = state->world.state_instance_get_definition(si);
753 for(
auto p : state->world.state_definition_get_abstract_state_membership(d)) {
754 if(p.get_province().get_nation_from_province_ownership() == o) {
755 if(p.get_province().get_rgo() == c)
757 for(
auto f : p.get_province().get_factory_location()) {
758 if(f.get_factory().get_building_type().get_output() == c)
784 dcon::culture_id c{ dcon::culture_id::value_base_t(cindex) };
785 dcon::province_id p{ dcon::province_id::value_base_t(sindex) };
787 for(
auto co : state->world.province_get_core(p)) {
788 if(co.get_identity().get_primary_culture() == c)
830 dcon::nation_id target{ dcon::nation_id::value_base_t(tindex) };
831 dcon::nation_id source{ dcon::nation_id::value_base_t(sindex) };
853 dcon::nation_id n{ dcon::nation_id::value_base_t(nindex) };
854 dcon::unit_name_id t{ dcon::unit_name_id::value_base_t(name) };
856 for(
auto l : state->world.nation_get_leader_loyalty(n)) {
857 auto lname = l.get_leader().get_name();
858 if(state->to_string_view(lname) == state->to_string_view(t))
881 dcon::nation_id n{ dcon::nation_id::value_base_t(nindex) };
882 dcon::national_identity_id t{ dcon::national_identity_id::value_base_t(tindex) };
903 dcon::nation_id target{ dcon::nation_id::value_base_t(tindex) };
904 dcon::nation_id source{ dcon::nation_id::value_base_t(sindex) };
925 dcon::nation_id s{ dcon::nation_id::value_base_t(s_index) };
926 for(
auto p : state->world.nation_get_province_ownership(s)) {
927 auto rng = p.get_province().get_factory_location();
928 if(
rng.begin() !=
rng.end())
949 dcon::nation_id target{ dcon::nation_id::value_base_t(tindex) };
950 dcon::nation_id source{ dcon::nation_id::value_base_t(sindex) };
971 dcon::global_flag_id s{ dcon::global_flag_id::value_base_t(s_index) };
972 return state->national_definitions.is_global_flag_variable_set(s);
990 dcon::nation_id s{ dcon::nation_id::value_base_t(s_index) };
991 for(
auto c : state->world.nation_get_unilateral_relationship_as_target(s)) {
992 if(c.get_foreign_investment() > 0.0f)
1013 dcon::nation_id s{ dcon::nation_id::value_base_t(s_index) };
1016 float max_str = 0.0f;
1017 for(
auto m : state->world.nation_get_movement_within(s)) {
1018 auto issue = m.get_movement().get_associated_issue_option();
1020 if(
culture::issue_type(issue.get_parent_issue().get_issue_type()) == itype && m.get_movement().get_pop_support() > max_str) {
1021 max_str = m.get_movement().get_pop_support();
1025 auto ncpop = state->world.nation_get_non_colonial_population(s);
1026 return ncpop > 0.0f ? max_str * state->defines.movement_support_uh_factor / ncpop : 0.0f;
1043 memcpy(&data, &fres, 4);
1048 dcon::nation_id gp{ dcon::nation_id::value_base_t(n_index) };
1049 dcon::nation_id t{ dcon::nation_id::value_base_t(t_index) };
1051 auto gpr = state->world.get_gp_relationship_by_gp_influence_pair(t, gp);
1052 return state->world.gp_relationship_get_influence(gpr);
1069 memcpy(&data, &fres, 4);
1074 dcon::nation_id n{ dcon::nation_id::value_base_t(n_index) };
1075 dcon::nation_id t{ dcon::nation_id::value_base_t(t_index) };
1077 auto rel = state->world.get_diplomatic_relation_by_diplomatic_pair(t, n);
1078 return state->world.diplomatic_relation_get_value(rel);
1095 memcpy(&data, &fres, 4);
1100 dcon::nation_id n{ dcon::nation_id::value_base_t(s_index) };
1101 auto prim_culture = state->world.nation_get_primary_culture(n);
1102 auto culture_group = state->world.culture_get_group_from_culture_group_membership(prim_culture);
1104 for(
auto s : state->world.nation_get_gp_relationship_as_great_power(n)) {
1106 s.get_influence_target().get_primary_culture().get_group_from_culture_group_membership() == culture_group) {
1128 dcon::commodity_id c{ dcon::commodity_id::value_base_t(cindex) };
1129 dcon::state_instance_id si{ dcon::state_instance_id::value_base_t(sindex) };
1131 auto o = state->world.state_instance_get_nation_from_state_ownership(si);
1132 auto d = state->world.state_instance_get_definition(si);
1133 for(
auto p : state->world.state_definition_get_abstract_state_membership(d)) {
1134 if(p.get_province().get_nation_from_province_ownership() == o) {
1135 if(p.get_province().get_rgo() == c)
1159 dcon::nation_id n{ dcon::nation_id::value_base_t(nindex) };
1161 auto sz = state->crisis_participants.size();
1163 if(!state->crisis_participants[i].id)
1165 if(state->crisis_participants[i].id == n)
1186 dcon::province_id p{ dcon::province_id::value_base_t(cindex) };
1187 dcon::nation_id n{ dcon::nation_id::value_base_t(sindex) };
1189 return state->world.province_get_is_coast(p)
1210 return state->nations_by_rank.data();
1229 return "state_ownership-state nation @ ";
1232 return "province_ownership-province nation @ ";
1235 return "province_control-province nation @ ";
1238 return "pop_location-pop province @ ";
1244 return "identity_holder-nation @ identity ";
1247 return "identity_holder-identity nation @ ";
1251 dcon::nation_id n{ dcon::nation_id::value_base_t(s_index) };
1252 dcon::ideology_id i{ dcon::ideology_id::value_base_t(ideoindex) };
1253 dcon::text_key m{ dcon::text_key::value_base_t(nameindex) };
1255 auto holder = state->world.nation_get_identity_from_identity_holder(n);
1257 auto start = state->world.national_identity_get_political_party_first(holder).id.index();
1258 auto end = start + state->world.national_identity_get_political_party_count(holder);
1260 for(int32_t j = start; j < end; j++) {
1261 auto pid = dcon::political_party_id(dcon::political_party_id::value_base_t(j));
1263 return state->world.political_party_get_name(pid) == m;
1288 dcon::nation_id n{ dcon::nation_id::value_base_t(s_index) };
1289 dcon::ideology_id i{ dcon::ideology_id::value_base_t(ideoindex) };
1290 dcon::issue_option_id m{ dcon::issue_option_id::value_base_t(optid) };
1292 auto popt = state->world.issue_option_get_parent_issue(m);
1293 auto holder = state->world.nation_get_identity_from_identity_holder(n);
1295 auto start = state->world.national_identity_get_political_party_first(holder).id.index();
1296 auto end = start + state->world.national_identity_get_political_party_count(holder);
1298 for(int32_t j = start; j < end; j++) {
1299 auto pid = dcon::political_party_id(dcon::political_party_id::value_base_t(j));
1301 return state->world.political_party_get_party_issues(pid, popt) == m;
1333 values.push_back_main(
fif::fif_opaque_ptr, (int64_t)(dcon::shared_backing_storage.allocation),
nullptr);
1337 " ptr(nil) global state-ptr "
1338 " : set-state state-ptr ! ; "
1339 " :export set_state ptr(nil) set-state ; ",
1347 auto nation_id_type = env.
dict.
types.find(
"nation_id")->second;
1348 auto prov_id_type = env.
dict.
types.find(
"province_id")->second;
1400 " : start-date " + std::to_string(offsetof(
sys::state, start_date)) +
" state-ptr @ buf-add ptr-cast ptr(i64) ; "
1401 " : current-date " + std::to_string(offsetof(
sys::state, current_date)) +
" state-ptr @ buf-add ptr-cast ptr(u16) ; "
1402 " : crisis-state " + std::to_string(offsetof(
sys::state, crisis_state)) +
" state-ptr @ buf-add ptr-cast ptr(state_instance_id) ; "
1403 " : sea-province? >index first-sea-province @ >index >= ; "
1409 ":struct gp-iterator ptr(nil) base i32 count i32 size i32 gp-count ; "
1410 ":s next gp-iterator s: let it it .count " + std::to_string(
sizeof(dcon::nation_id)) +
" * it .base buf-add ptr-cast ptr(nation_id) @ it .count@ 1 + swap .count! swap ; "
1411 ":s more? gp-iterator s: let it it .count it .size < it .gp-count " + std::to_string(state.defines.great_nations_count) +
" < and it swap ; "
1412 ":s inc-gp gp-iterator s: .gp-count@ 1 + swap .gp-count! ; "
1413 ": make-gp-it make gp-iterator state-ptr @ ranked-nation-array swap .base! nation-size swap .size! ; "
1415 ":struct state-prov-iterator vpool-abstract_state_membership-state base i32 count state_instance_id parent ; "
1416 ":s next state-prov-iterator s: let it it .base it .count index @ province it .count@ 1 - swap .count! swap dup state_membership @ it .parent = ; "
1417 ":s more? state-prov-iterator s: .count@ 0 >= ; "
1418 ": make-sp-it dup definition @ abstract_state_membership-state make state-prov-iterator .base! .parent! .base@ size 1 - swap .count! ; "
1420 ":struct nation-prov-iterator vpool-province_ownership-nation base i32 count ; "
1421 ":s next nation-prov-iterator s: let it it .base it .count index @ province it .count@ 1 - swap .count! swap ; "
1422 ":s more? nation-prov-iterator s: .count@ 0 >= ; "
1423 ": make-n-it province_ownership-nation make nation-prov-iterator .base! .base@ size 1 - swap .count! ; "
1425 ":struct pcore-iterator vpool-core-province base i32 count ; "
1426 ":s next pcore-iterator s: let it it .base it .count index @ identity @ " +
tag_to_nation() +
" it .count@ 1 - swap .count! swap ; "
1427 ":s more? pcore-iterator s: .count@ 0 >= ; "
1428 ": make-pc-it core-province make pcore-iterator .base! .base@ size 1 - swap .count! ; "
1430 ":struct ncore-iterator vpool-core-identity base i32 count ; "
1431 ":s next ncore-iterator s: let it it .base it .count index @ province @ it .count@ 1 - swap .count! swap ; "
1432 ":s more? ncore-iterator s: .count@ 0 >= ; "
1433 ": make-nc-it core-identity make ncore-iterator .base! .base@ size 1 - swap .count! ; "
1435 ":struct nation-state-iterator vpool-state_ownership-nation base i32 count ; "
1436 ":s next nation-state-iterator s: let it it .base it .count index @ state it .count@ 1 - swap .count! swap ; "
1437 ":s more? nation-state-iterator s: .count@ 0 >= ; "
1438 ": make-ns-it state_ownership-nation make nation-state-iterator .base! .base@ size 1 - swap .count! ; "
1440 ":struct nation-vassal-iterator vpool-overlord-ruler base i32 count ; "
1441 ":s next nation-vassal-iterator s: let it it .base it .count index @ subject it .count@ 1 - swap .count! swap ; "
1442 ":s more? nation-vassal-iterator s: .count@ 0 >= ; "
1443 ": make-nv-it overlord-ruler make nation-vassal-iterator .base! .base@ size 1 - swap .count! ; "
1445 ":struct nation-gp-iterator vpool-gp_relationship-great_power base i32 count ; "
1447 ":s more? nation-gp-iterator s: .count@ 0 >= ; "
1448 ": make-ngp-it gp_relationship-great_power make nation-gp-iterator .base! .base@ size 1 - swap .count! ; "
1450 ":struct prov-pop-iterator vpool-pop_location-province base i32 count ; "
1451 ":s next prov-pop-iterator s: let it it .base it .count index @ pop it .count@ 1 - swap .count! swap ; "
1452 ":s more? prov-pop-iterator s: .count@ 0 >= ; "
1453 ": make-pp-it pop_location-province make prov-pop-iterator .base! .base@ size 1 - swap .count! ; "
1455 ":struct astate-prov-iterator vpool-abstract_state_membership-state base i32 count ; "
1456 ":s next astate-prov-iterator s: let it it .base it .count index @ province it .count@ 1 - swap .count! swap ; "
1457 ":s more? astate-prov-iterator s: .count@ 0 >= ; "
1458 ": make-asp-it abstract_state_membership-state make astate-prov-iterator .base! .base@ size 1 - swap .count! ; "
1460 ":struct aregion-prov-iterator vpool-region_membership-region base i32 count ; "
1461 ":s next aregion-prov-iterator s: let it it .base it .count index @ province @ it .count@ 1 - swap .count! swap ; "
1462 ":s more? aregion-prov-iterator s: .count@ 0 >= ; "
1463 ": make-arp-it region_membership-region make aregion-prov-iterator .base! .base@ size 1 - swap .count! ; "
1465 ":struct adj-prov-iterator vpool-province_adjacency-connected_provinces base i32 count province_id parent ; "
1466 ":s next adj-prov-iterator s: let it it .base it .count index @ dup >r "
1467 "connected_provinces .wrapped dup ptr-cast ptr(nil) " + std::to_string(
sizeof(dcon::province_id)) +
" swap buf-add ptr-cast ptr(province_id) @ swap @ dup it .parent = not select "
1468 "it .count@ 1 - swap .count! swap "
1470 ":s more? adj-prov-iterator s: .count@ 0 >= ; "
1471 ": make-ap-it dup province_adjacency-connected_provinces make adj-prov-iterator .base! .parent! .base@ size 1 - swap .count! ; "
1473 ":struct adj-nation-iterator vpool-nation_adjacency-connected_nations base i32 count nation_id parent ; "
1474 ":s next adj-nation-iterator s: let it it .base it .count index @ "
1475 "connected_nations .wrapped dup ptr-cast ptr(nil) " + std::to_string(
sizeof(dcon::nation_id)) +
" swap buf-add ptr-cast ptr(nation_id) @ swap @ dup it .parent = not select "
1476 "it .count@ 1 - swap .count! swap ; "
1477 ":s more? adj-nation-iterator s: .count@ 0 >= ; "
1478 ": make-an-it dup nation_adjacency-connected_nations make adj-nation-iterator .base! .parent! .base@ size 1 - swap .count! ; "
ankerl::unordered_dense::map< std::string, int32_t > types
f_true_accumulator(F &&f)
void add_value(int32_t v)
virtual int64_t main_data_back(size_t index) const =0
virtual void pop_main()=0
virtual void push_back_main(int32_t type, int64_t data, LLVMValueRef expr)=0
#define assert(condition)
bool has_building(sys::state const &state, dcon::state_instance_id si, dcon::factory_type_id fac)
bool is_bankrupt_debtor_to(sys::state &state, dcon::nation_id debt_holder, dcon::nation_id debtor)
bool has_factory(sys::state const &state, dcon::state_instance_id si)
std::string evaluate(sys::state &state, dcon::trigger_key key)
std::string multiplicative_modifier(sys::state &state, dcon::value_modifier_key modifier)
std::string additive_modifier(sys::state &state, dcon::value_modifier_key modifier)
bool f_units_in_province(sys::state *state, int32_t sindex, int32_t nindex)
bool f_core_in_province(sys::state *state, int32_t p_index, int32_t t_index)
bool f_has_culture_core(sys::state *state, int32_t cindex, int32_t sindex)
int32_t f_date_to_year(int64_t v)
int32_t * f_has_nmod_b(fif::state_stack &s, int32_t *p, fif::environment *e)
std::string province_to_controller()
bool f_is_bankrupt_debtor_to(sys::state *state, int32_t tindex, int32_t sindex)
int32_t * f_core_in_province_b(fif::state_stack &s, int32_t *p, fif::environment *e)
int32_t * f_unowned_core_b(fif::state_stack &s, int32_t *p, fif::environment *e)
bool f_unowned_core(sys::state *state, int32_t n_index)
int32_t * f_core_fully_state_b(fif::state_stack &s, int32_t *p, fif::environment *e)
int32_t * f_has_any_factory_b(fif::state_stack &s, int32_t *p, fif::environment *e)
bool f_owns_region(sys::state *state, int32_t rindex, int32_t n_index)
void run_fif_interpreter(environment &env, std::string_view on_text)
int32_t * f_has_culture_core_b(fif::state_stack &s, int32_t *p, fif::environment *e)
constexpr int32_t fif_i32
int32_t * f_state_rgo_b(fif::state_stack &s, int32_t *p, fif::environment *e)
bool f_are_at_war(sys::state *state, int32_t sindex, int32_t nindex)
int32_t * f_influence_on_b(fif::state_stack &s, int32_t *p, fif::environment *e)
int32_t * f_has_access_with_b(fif::state_stack &s, int32_t *p, fif::environment *e)
std::string tag_to_nation()
bool f_has_factory(sys::state *state, int32_t findex, int32_t s_index)
int32_t * f_coastal_s_b(fif::state_stack &s, int32_t *p, fif::environment *e)
bool f_core_in_state(sys::state *state, int32_t s_index, int32_t t_index)
int32_t * f_truce_with_b(fif::state_stack &s, int32_t *p, fif::environment *e)
int32_t * f_units_in_province_b(fif::state_stack &s, int32_t *p, fif::environment *e)
bool f_has_pmod(sys::state *state, int32_t m_index, int32_t p_index)
constexpr int32_t fif_bool
bool f_empty_adjacent_state(sys::state *state, int32_t p_index)
bool f_owns_state(sys::state *state, int32_t rindex, int32_t n_index)
bool f_in_crisis(sys::state *state, int32_t nindex)
float f_influence_on(sys::state *state, int32_t t_index, int32_t n_index)
int32_t * f_can_build_naval_base_b(fif::state_stack &s, int32_t *p, fif::environment *e)
int32_t * f_can_nationalize_b(fif::state_stack &s, int32_t *p, fif::environment *e)
int32_t * f_party_pos_b(fif::state_stack &s, int32_t *p, fif::environment *e)
int32_t * f_are_at_war_b(fif::state_stack &s, int32_t *p, fif::environment *e)
int32_t * f_canal_enabled_b(fif::state_stack &s, int32_t *p, fif::environment *e)
std::string nation_to_tag()
bool f_state_produces(sys::state *state, int32_t cindex, int32_t sindex)
int32_t * f_in_region_b(fif::state_stack &s, int32_t *p, fif::environment *e)
int32_t * f_global_flag_set_b(fif::state_stack &s, int32_t *p, fif::environment *e)
int32_t * f_general_in_p_b(fif::state_stack &s, int32_t *p, fif::environment *e)
int32_t * f_nation_has_any_factory_b(fif::state_stack &s, int32_t *p, fif::environment *e)
void common_fif_environment(sys::state &state, fif::environment &env)
bool typechecking_mode(fif_mode m)
bool f_core_in_nation(sys::state *state, int32_t n_index, int32_t t_index)
bool f_coastal_s(sys::state *state, int32_t sindex)
bool f_nation_a(sys::state *state, int32_t aindex, int32_t bindex)
int32_t * f_count_ships_b(fif::state_stack &s, int32_t *p, fif::environment *e)
bool f_has_cb_against(sys::state *state, int32_t targ_index, int32_t source_index)
std::string province_to_owner()
int32_t * f_core_in_nation_b(fif::state_stack &s, int32_t *p, fif::environment *e)
void add_import(std::string_view name, void *ptr, fif_call interpreter_implementation, std::vector< int32_t > const ¶ms, std::vector< int32_t > const &returns, environment &env)
bool f_truce_with(sys::state *state, int32_t tindex, int32_t sindex)
bool f_units_in_state(sys::state *state, int32_t sindex, int32_t nindex)
std::string pop_to_location()
int32_t * f_ranked_nations_b(fif::state_stack &s, int32_t *p, fif::environment *e)
int32_t * f_movement_str_b(fif::state_stack &s, int32_t *p, fif::environment *e)
int32_t * f_can_release_b(fif::state_stack &s, int32_t *p, fif::environment *e)
bool f_has_union_sphere(sys::state *state, int32_t s_index)
int32_t * f_has_named_leader_b(fif::state_stack &s, int32_t *p, fif::environment *e)
bool f_has_nmod(sys::state *state, int32_t m_index, int32_t n_index)
std::string pop_to_owner()
int32_t f_count_p_units(sys::state *state, int32_t sindex)
int32_t * f_has_union_sphere_b(fif::state_stack &s, int32_t *p, fif::environment *e)
bool f_core_fully_state(sys::state *state, int32_t s_index, int32_t t_index)
int32_t * f_nation_a_b(fif::state_stack &s, int32_t *p, fif::environment *e)
int32_t * f_empty_adjacent_state_b(fif::state_stack &s, int32_t *p, fif::environment *e)
int32_t * f_relations_b(fif::state_stack &s, int32_t *p, fif::environment *e)
int32_t * f_core_in_state_b(fif::state_stack &s, int32_t *p, fif::environment *e)
std::string state_to_owner()
bool f_has_any_factory(sys::state *state, int32_t s_index)
bool f_party_name(sys::state *state, int32_t s_index, int32_t ideoindex, int32_t nameindex)
int32_t * f_owns_state_b(fif::state_stack &s, int32_t *p, fif::environment *e)
int32_t * f_date_to_year_b(fif::state_stack &s, int32_t *p, fif::environment *e)
int32_t * f_date_to_month_b(fif::state_stack &s, int32_t *p, fif::environment *e)
int32_t * f_has_cb_against_b(fif::state_stack &s, int32_t *p, fif::environment *e)
int32_t f_count_ships(sys::state *state, int32_t sindex)
int32_t * f_has_factory_b(fif::state_stack &s, int32_t *p, fif::environment *e)
bool f_party_pos(sys::state *state, int32_t s_index, int32_t ideoindex, int32_t optid)
bool f_empty_adjacent_province(sys::state *state, int32_t p_index)
int32_t * f_owns_region_b(fif::state_stack &s, int32_t *p, fif::environment *e)
bool f_can_release(sys::state *state, int32_t tindex, int32_t nindex)
bool f_general_in_p(sys::state *state, int32_t sindex)
bool typechecking_failed(fif_mode m)
constexpr sys::year_month_day civil_from_days(int64_t z) noexcept
constexpr int32_t fif_f32
int32_t * f_are_allied_b(fif::state_stack &s, int32_t *p, fif::environment *e)
constexpr int32_t fif_opaque_ptr
bool f_has_access_with(sys::state *state, int32_t targ_index, int32_t source_index)
bool f_can_nationalize(sys::state *state, int32_t s_index)
bool f_can_build_naval_base(sys::state *state, int32_t cindex, int32_t sindex)
void initialize_standard_vocab(environment &fif_env)
int32_t f_date_to_month(int64_t v)
bool f_in_region(sys::state *state, int32_t rindex, int32_t p_index)
auto f_make_true_accumulator(F &&f) -> f_true_accumulator< F >
int32_t * f_empty_adjacent_province_b(fif::state_stack &s, int32_t *p, fif::environment *e)
bool f_are_allied(sys::state *state, int32_t tindex, int32_t sindex)
float f_movement_str(sys::state *state, bool is_social, int32_t s_index)
int32_t * f_state_produces_b(fif::state_stack &s, int32_t *p, fif::environment *e)
bool f_nation_has_any_factory(sys::state *state, int32_t s_index)
bool f_canal_enabled(sys::state *state, int32_t sindex)
int32_t * f_has_pmod_b(fif::state_stack &s, int32_t *p, fif::environment *e)
constexpr int32_t fif_i64
int32_t * f_in_crisis_b(fif::state_stack &s, int32_t *p, fif::environment *e)
float f_relations(sys::state *state, int32_t t_index, int32_t n_index)
int32_t * f_count_p_units_b(fif::state_stack &s, int32_t *p, fif::environment *e)
int32_t * f_party_name_b(fif::state_stack &s, int32_t *p, fif::environment *e)
void * f_ranked_nations(sys::state *state)
bool f_has_named_leader(sys::state *state, int32_t name, int32_t nindex)
int32_t * f_is_bankrupt_debtor_to_b(fif::state_stack &s, int32_t *p, fif::environment *e)
bool f_global_flag_set(sys::state *state, int32_t s_index)
int32_t * f_units_in_state_b(fif::state_stack &s, int32_t *p, fif::environment *e)
bool f_state_rgo(sys::state *state, int32_t cindex, int32_t sindex)
bool can_use_cb_against(sys::state &state, dcon::nation_id from, dcon::nation_id target)
bool has_truce_with(sys::state &state, dcon::nation_id attacker, 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)
constexpr uint8_t level_in_sphere
constexpr uint8_t level_mask
bool can_release_as_vassal(sys::state const &state, dcon::nation_id n, dcon::national_identity_id releasable)
bool are_allied(sys::state &state, dcon::nation_id a, dcon::nation_id b)
bool political_party_is_active(sys::state &state, dcon::nation_id n, dcon::political_party_id p)
constexpr uint8_t impassible_bit
bool state_is_coastal(sys::state &state, dcon::state_instance_id s)
int32_t to_generic(dcon::province_id v)
dcon::province_id to_prov(int32_t v)
bool compress_mask(bool v)