procedure start;
procedure LevelChange;
procedure PickedPerk;
//imported traits
#define UnarmedMaster "Unarmed Master"
#define DiligentLearner "Diligent learner"
//perks
#define RapidPerks "Rapid Perks"
#define ToughBastard "Tough Bastard"
#define AllStats "Massive Stat Gain"
#define dude_global (get_sfall_global_int("perks_00"))
#define dude_level (get_pc_stat(1))
procedure LevelChange begin
if(get_sfall_global_int("perk_per") > 1 and has_fake_perk(RapidPerks) == 0) then begin
set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
set_sfall_global("rapid_01", 1);
end
if(get_sfall_global_int("perk_per") > 1 and has_fake_perk(RapidPerks) == 1) then begin
set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
set_sfall_global("rapid_01", 2);
end
if(get_sfall_global_int("perk_per") > 1 and has_fake_perk(RapidPerks) == 2) then begin
set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
set_sfall_global("rapid_01", 3);
end
if(get_sfall_global_int("perk_per") > 1 and has_fake_perk(RapidPerks) == 3) then begin
set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
set_sfall_global("rapid_01", 4);
end
if(get_sfall_global_int("perk_per") > 1 and has_fake_perk(RapidPerks) == 4) then begin
set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
set_sfall_global("rapid_01", 5);
end
if(get_sfall_global_int("perk_per") > 1 and has_fake_perk(RapidPerks) == 5) then begin
set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
set_sfall_global("rapid_01", 6);
end
if(get_sfall_global_int("perk_per") > 1 and has_fake_perk(RapidPerks) == 6) then begin
set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
set_sfall_global("rapid_01", 7);
end
if(get_sfall_global_int("perk_per") > 1 and has_fake_perk(RapidPerks) == 7) then begin
set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
set_sfall_global("rapid_01", 8);
end
if(get_sfall_global_int("perk_per") > 1 and has_fake_perk(RapidPerks) == 8) then begin
set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
set_sfall_global("rapid_01", 9);
end
if(dude_level >1) and (has_fake_perk(ToughBastard) == 0) then begin
set_selectable_perk(ToughBastard, 1, 1, "For each level of this perk you gain 100 health.");
set_sfall_global("Tbastard", 1);
end
if(dude_level >1) and (has_fake_perk(ToughBastard) == 1) then begin
set_selectable_perk(ToughBastard, 1, 1, "For each level of this perk you gain 100 health.");
set_sfall_global("Tbastard", 2);
end
if(dude_level >1) and (has_fake_perk(ToughBastard) == 2) then begin
set_selectable_perk(ToughBastard, 1, 1, "For each level of this perk you gain 100 health.");
set_sfall_global("Tbastard", 3);
end
if(dude_level >1) and (has_fake_perk(ToughBastard) == 3) then begin
set_selectable_perk(ToughBastard, 1, 1, "For each level of this perk you gain 100 health.");
set_sfall_global("Tbastard", 4);
end
if(dude_level >1) and (has_fake_perk(ToughBastard) == 4) then begin
set_selectable_perk(ToughBastard, 1, 1, "For each level of this perk you gain 100 health.");
set_sfall_global("Tbastard", 5);
end
if(dude_level >1) and (has_fake_perk(AllStats) == 0) then begin
set_selectable_perk(AllStats, 1, 1, "For each level of this perk you gain one to all primary stats and adds 2 levels to perk gain rate.");
set_sfall_global("AllStats", 1);
end
if(dude_level >1) and (has_fake_perk(AllStats) == 1) then begin
set_selectable_perk(AllStats, 1, 1, "For each level of this perk you gain one to all primary stats and adds 2 levels to perk gain rate.");
set_sfall_global("AllStats", 2);
end
if(get_sfall_global_int("perk_per") == 1)then begin
set_selectable_perk(RapidPerks, 0, 1, "For each level of this perk you reduce the levels between perks by one.");
end
if(get_sfall_global_int("Tbastard") == 6) then begin
set_selectable_perk(ToughBastard, 0, 1, "For each level of this perk you gain 100 health.");
end
if(get_sfall_global_int("AllStats") == 3) then begin
set_selectable_perk(AllStats, 0, 1, "For each level of this perk you gain one to all primary stats and adds 2 levels to perk gain rate.");
end
end
procedure PickedPerk begin
if(has_fake_perk(RapidPerks) == 1 and get_sfall_global_int("rapid_01") == 1) then begin
set_sfall_global("rapid_01", 2);
set_sfall_global("perk_per", get_sfall_global_int("perk_per") - 1);
//display_msg("rapid_01");
end
if(has_fake_perk(RapidPerks) == 2 and get_sfall_global_int("rapid_01") == 2) then begin
set_sfall_global("rapid_01", 3);
set_sfall_global("perk_per", get_sfall_global_int("perk_per") - 1);
//display_msg("rapid_2");
end
if(has_fake_perk(RapidPerks) == 3 and get_sfall_global_int("rapid_01") == 3) then begin
set_sfall_global("rapid_01", 4);
set_sfall_global("perk_per", get_sfall_global_int("perk_per") - 1);
//display_msg("rapid_3");
end
if(has_fake_perk(RapidPerks) == 4 and get_sfall_global_int("rapid_01") == 4) then begin
set_sfall_global("rapid_01", 5);
set_sfall_global("perk_per", get_sfall_global_int("perk_per") - 1);
//display_msg("rapid_4");
end
if(has_fake_perk(RapidPerks) == 5 and get_sfall_global_int("rapid_01") == 5) then begin
set_sfall_global("rapid_01", 6);
set_sfall_global("perk_per", get_sfall_global_int("perk_per") - 1);
//display_msg("rapid_5");
end
if(has_fake_perk(RapidPerks) == 6 and get_sfall_global_int("rapid_01") == 6) then begin
set_sfall_global("rapid_01", 7);
set_sfall_global("perk_per", get_sfall_global_int("perk_per") - 1);
//display_msg("rapid_6");
end
if(has_fake_perk(RapidPerks) == 7 and get_sfall_global_int("rapid_01") == 7) then begin
set_sfall_global("rapid_01", 8);
set_sfall_global("perk_per", get_sfall_global_int("perk_per") - 1);
//display_msg("rapid_7");
end
if(has_fake_perk(RapidPerks) == 8 and get_sfall_global_int("rapid_01") == 8) then begin
set_sfall_global("rapid_01", 9);
set_sfall_global("perk_per", get_sfall_global_int("perk_per") - 1);
//display_msg("rapid_8");
end
if(has_fake_perk(RapidPerks) == 9 and get_sfall_global_int("rapid_01") == 9) then begin
set_sfall_global("rapid_01", 10);
set_sfall_global("perk_per", get_sfall_global_int("perk_per") - 1);
//display_msg("rapid_9");
end
if(has_fake_perk(ToughBastard) == 1 and get_sfall_global_int("Tbastard") == 1) then begin
set_sfall_global("Tbastard", 2);
set_pc_extra_stat(7, (100 + get_pc_extra_stat(7)));
//display_msg("bastard 1");
end
if(has_fake_perk(ToughBastard) == 2 and get_sfall_global_int("Tbastard") == 2) then begin
set_sfall_global("Tbastard", 3);
set_pc_extra_stat(7, (100 + get_pc_extra_stat(7)));
//display_msg("bastard 2");
end
if(has_fake_perk(ToughBastard) == 3 and get_sfall_global_int("Tbastard") == 3) then begin
set_sfall_global("Tbastard", 4);
set_pc_extra_stat(7, (100 + get_pc_extra_stat(7)));
//display_msg("bastard 3");
end
if(has_fake_perk(ToughBastard) == 4 and get_sfall_global_int("Tbastard") == 4) then begin
set_sfall_global("Tbastard", 5);
set_pc_extra_stat(7, (100 + get_pc_extra_stat(7)));
//display_msg("bastard 4");
end
if(has_fake_perk(ToughBastard) == 5 and get_sfall_global_int("Tbastard") == 5) then begin
set_sfall_global("Tbastard", 6);
set_pc_extra_stat(7, (100 + get_pc_extra_stat(7)));
//display_msg("bastard 5");
end
if((has_fake_perk(AllStats) == 1) and get_sfall_global_int("AllStats") == 1) then begin
set_sfall_global("AllStats", 2);
set_sfall_global("perk_per", get_sfall_global_int("perk_per") + 2);
set_pc_base_stat(0, (get_pc_base_stat(0) + 1));
set_pc_base_stat(1, (get_pc_base_stat(1) + 1));
set_pc_base_stat(2, (get_pc_base_stat(2) + 1));
set_pc_base_stat(3, (get_pc_base_stat(3) + 1));
set_pc_base_stat(4, (get_pc_base_stat(4) + 1));
set_pc_base_stat(5, (get_pc_base_stat(5) + 1));
set_pc_base_stat(6, (get_pc_base_stat(6) + 1));
//display_msg("AllStats 1");
end
if((has_fake_perk(AllStats) == 2) and get_sfall_global_int("AllStats") == 2) then begin
set_sfall_global("AllStats", 3);
set_sfall_global("perk_per", get_sfall_global_int("perk_per") + 2);
set_pc_base_stat(0, (get_pc_base_stat(0) + 1));
set_pc_base_stat(1, (get_pc_base_stat(1) + 1));
set_pc_base_stat(2, (get_pc_base_stat(2) + 1));
set_pc_base_stat(3, (get_pc_base_stat(3) + 1));
set_pc_base_stat(4, (get_pc_base_stat(4) + 1));
set_pc_base_stat(5, (get_pc_base_stat(5) + 1));
set_pc_base_stat(6, (get_pc_base_stat(6) + 1));
//display_msg("AllStats 2");
end
call LevelChange;
end
procedure start begin
set_global_script_repeat(1);
if(dude_global != dude_level)then begin
call LevelChange;
set_sfall_global("perks_00", dude_level);
end
call PickedPerk;
end