diff --git a/objects/obj_controller/Alarm_5.gml b/objects/obj_controller/Alarm_5.gml index e18d60ef7d..e5727e7d6e 100644 --- a/objects/obj_controller/Alarm_5.gml +++ b/objects/obj_controller/Alarm_5.gml @@ -391,7 +391,9 @@ if (training_psyker>0){ unit.update_powers(); psyker_aspirant=1; - if (string_count("Abund",obj_ini.strin)>0) then obj_ini.experience[0][g1]+=floor(random(5))+3; + if (scr_has_adv("Psyker Abundance")){ + unit.add_exp(irandom_range(5, 8)); + } unit.update_gear(""); unit.update_mobility_item(""); diff --git a/objects/obj_controller/KeyPress_73.gml b/objects/obj_controller/KeyPress_73.gml index 7a23a75f7c..89af2712a0 100644 --- a/objects/obj_controller/KeyPress_73.gml +++ b/objects/obj_controller/KeyPress_73.gml @@ -8,10 +8,6 @@ if (audio_is_playing(snd_blood)=true) then scr_music("royal",2000); scr_dialogue("lol"); */ -/*var g;g=0; -repeat(100){g+=1; - show_message(string(obj_ini.role[0,g])+": "+string(obj_ini.experience[0,g])); -}*/ // alarm[7]=1; diff --git a/objects/obj_controller/Step_0.gml b/objects/obj_controller/Step_0.gml index 547c31b229..05fcb096d4 100644 --- a/objects/obj_controller/Step_0.gml +++ b/objects/obj_controller/Step_0.gml @@ -316,7 +316,7 @@ if (menu==1 && (managing>0 || managing<0)){ } //if (string_count("&",temp[106])>0) then temp[106]=clean_tags(temp[106]); // Experience - temp[113]=string(floor(unit.experience())); + temp[113]=string(floor(unit.experience)); // Bonuses temp[119]=""; if (string_length(unit.specials())>0){ diff --git a/objects/obj_creation/Create_0.gml b/objects/obj_creation/Create_0.gml index 7be95379a0..1bf9b460e9 100644 --- a/objects/obj_creation/Create_0.gml +++ b/objects/obj_creation/Create_0.gml @@ -670,7 +670,8 @@ ye=99;i=-1;repeat(51){i+=1; wep2[ye,i]=""; armour[ye,i]=""; gear[ye,i]=""; - mobi[ye,i]="";experience[ye,i]=0; + mobi[ye,i]=""; + } ye=100;i=-1;repeat(51){i+=1; race[ye,i]=1;loc[ye,i]=""; @@ -679,7 +680,7 @@ ye=100;i=-1;repeat(51){i+=1; wep2[ye,i]=""; armour[ye,i]=""; gear[ye,i]=""; - mobi[ye,i]="";experience[ye,i]=0; + mobi[ye,i]=""; } ye=101;i=-1;repeat(51){i+=1; race[ye,i]=1;loc[ye,i]=""; @@ -688,7 +689,7 @@ ye=101;i=-1;repeat(51){i+=1; wep2[ye,i]=""; armour[ye,i]=""; gear[ye,i]=""; - mobi[ye,i]="";experience[ye,i]=0; + mobi[ye,i]=""; } ye=102;i=-1;repeat(51){i+=1; race[ye,i]=1;loc[ye,i]=""; @@ -697,7 +698,7 @@ ye=102;i=-1;repeat(51){i+=1; wep2[ye,i]=""; armour[ye,i]=""; gear[ye,i]=""; - mobi[ye,i]="";experience[ye,i]=0; + mobi[ye,i]=""; } ye=103;i=-1;repeat(51){i+=1; race[ye,i]=1;loc[ye,i]=""; @@ -706,7 +707,7 @@ ye=103;i=-1;repeat(51){i+=1; wep2[ye,i]=""; armour[ye,i]=""; gear[ye,i]=""; - mobi[ye,i]="";experience[ye,i]=0; + mobi[ye,i]=""; } diff --git a/objects/obj_p_assra/Step_0.gml b/objects/obj_p_assra/Step_0.gml index 427191915e..1470694fb9 100644 --- a/objects/obj_p_assra/Step_0.gml +++ b/objects/obj_p_assra/Step_0.gml @@ -87,7 +87,7 @@ if (boarding=true) and (board_cooldown>=0) and (instance_exists(target)) and (in if (unit.hp()>0){ // Bonuses - difficulty+=unit.experience()/20; + difficulty+=unit.experience/20; difficulty+=(1-(target.hp/target.maxhp))*33; //TODO define tag for bording weapons if (array_contains(["Chainfist","Meltagun","Lascutter","Boarding Shield"], unit.weapon_one())) then difficulty+=3; @@ -317,7 +317,7 @@ if (boarding=true) and (board_cooldown>=0) and (instance_exists(target)) and (in co=origin.board_co[o]; i=origin.board_id[o]; unit = obj_ini.TTRPG[co][i]; - unit_exp=unit.experience() + unit_exp=unit.experience exp_roll=irandom(150+unit_exp)+1; if (exp_roll>=unit_exp){ if (unit_exp<50){new_exp=experience diff --git a/objects/obj_pnunit/Alarm_5.gml b/objects/obj_pnunit/Alarm_5.gml index ce48bde08b..5b964bff54 100644 --- a/objects/obj_pnunit/Alarm_5.gml +++ b/objects/obj_pnunit/Alarm_5.gml @@ -7,7 +7,7 @@ if (obj_ncombat.defeat=0){ if (is_struct(unit)){ if (marine_dead[i]=0) and (obj_ncombat.player_max=40) then new_exp+=choose(0,0,1); if (cur_exp>=20) and (cur_exp<40) then new_exp+=choose(0,1); if (cur_exp<20) then new_exp+=1; diff --git a/objects/obj_popup/Draw_0.gml b/objects/obj_popup/Draw_0.gml index a1a391f784..db6f0a9183 100644 --- a/objects/obj_popup/Draw_0.gml +++ b/objects/obj_popup/Draw_0.gml @@ -909,7 +909,7 @@ if (zoom=0) and (type=6) and (instance_exists(obj_controller)){ var g=-1,exp_check=0; for (var g=0;g= 6) then target_company = 5; else if (unit.company >= 2) then target_company = 1; var promotion_limit = company_promotion_limits[target_company] - if (unit.experience()>=promotion_limit && promotion_limit>0){ + if (unit.experience>=promotion_limit && promotion_limit>0){ ma_promote[v]=1; } if (ma_health[v]<=10) then ma_promote[v]=10; } else if (ma_role[v]=obj_ini.role[100][5]){ var promotion_limit = company_promotion_limits[unit.company - 1] - if (unit.experience()>=promotion_limit+25 && promotion_limit>0){ + if (unit.experience>=promotion_limit+25 && promotion_limit>0){ } } diff --git a/scripts/scr_crusade/scr_crusade.gml b/scripts/scr_crusade/scr_crusade.gml index 65c25a2afa..bf9765cc98 100644 --- a/scripts/scr_crusade/scr_crusade.gml +++ b/scripts/scr_crusade/scr_crusade.gml @@ -47,7 +47,7 @@ function scr_crusade() { //TODO figure out how to quantify and present these risks so the player knows to protect dudes with trait if (unit.has_trait("very_hard_to_kill")) then death_determination-=20; death_determination_2=death_determination; - death_determination-=(unit.experience()/2); + death_determination-=(unit.experience/2); //more generalised trait bonus mainly linked to chapter advantage of same name if (unit.has_trait("slow_and_purposeful")) then death_determination-=10; diff --git a/scripts/scr_draw_armentarium/scr_draw_armentarium.gml b/scripts/scr_draw_armentarium/scr_draw_armentarium.gml index 370543d9ef..bc4c7544cf 100644 --- a/scripts/scr_draw_armentarium/scr_draw_armentarium.gml +++ b/scripts/scr_draw_armentarium/scr_draw_armentarium.gml @@ -134,7 +134,7 @@ function calculate_research_points(turn_end=false){ if (struct_exists(gen_data,"crafter")) then crafters++; if (struct_exists(gen_data,"at_forge")){ at_forge++; - master_craft_chance += (techs[i].experience()/50) + master_craft_chance += (techs[i].experience/50) } forge_points += forge_point_gen[0]; if (techs[i].has_trait("tech_heretic")){ diff --git a/scripts/scr_garrison/scr_garrison.gml b/scripts/scr_garrison/scr_garrison.gml index 517fc8baaa..79f02828c0 100644 --- a/scripts/scr_garrison/scr_garrison.gml +++ b/scripts/scr_garrison/scr_garrison.gml @@ -111,7 +111,7 @@ function GarrisonForce(planet_operatives, turn_end=false, type="garrison") const } } }else if (hierarchy[leader_hier_pos]==unit.role()){ - if (garrison_leader.experience()=15){ var stat_gains = choose("weapon_skill", "ballistic_skill", "wisdom"); @@ -1606,7 +1604,7 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data={}) qual_string = quality; if (scr_item_count(new_weapon, quality)>0){ var exp_require = gear_weapon_data("weapon", new_weapon, "req_exp", false, quality); - if (exp_require>experience()){ + if (exp_require>experience){ viable = false; qual_string = "exp_low"; } @@ -1665,7 +1663,7 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data={}) damage_res+=get_mobility_data("damage_resistance_mod"); damage_res+=get_weapon_one_data("damage_resistance_mod"); damage_res+=get_weapon_two_data("damage_resistance_mod"); - damage_res = min(75, damage_res+floor(((constitution*0.005) + (experience()/1000))*100)); + damage_res = min(75, damage_res+floor(((constitution*0.005) + (experience/1000))*100)); return damage_res; }; @@ -1726,9 +1724,9 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data={}) static ranged_attack = function(weapon_slot=0){ encumbered_ranged=false; //base modifyer based on unit skill set - ranged_att = 100*(((ballistic_skill/50) + (dexterity/400)+ (experience()/500))); + ranged_att = 100*(((ballistic_skill/50) + (dexterity/400)+ (experience/500))); var final_range_attack=0; - var explanation_string = $"Stat Mod: x{ranged_att/100}# BS: x{ballistic_skill/50}# DEX: x{dexterity/400}# EXP: x{experience()/500}#"; + var explanation_string = $"Stat Mod: x{ranged_att/100}# BS: x{ballistic_skill/50}# DEX: x{dexterity/400}# EXP: x{experience/500}#"; //determine capavbility to weild bulky weapons var carry_data =ranged_hands_limit(); @@ -1895,11 +1893,11 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data={}) } static melee_attack = function(weapon_slot=0){ encumbered_melee=false; - melee_att = 100*(((weapon_skill/100) * (strength/20)) + (experience()/1000)+0.1); + melee_att = 100*(((weapon_skill/100) * (strength/20)) + (experience/1000)+0.1); var explanation_string = string_concat("#Stats: ", format_number_with_sign(round(((melee_att/100)-1)*100)), "%#"); explanation_string += " Base: +10%#"; explanation_string += string_concat(" WSxSTR: ", format_number_with_sign(round((((weapon_skill/100)*(strength/20))-1)*100)), "%#"); - explanation_string += string_concat(" EXP: ", format_number_with_sign(round((experience()/1000)*100)), "%#"); + explanation_string += string_concat(" EXP: ", format_number_with_sign(round((experience/1000)*100)), "%#"); melee_carrying = melee_hands_limit(); var _wep1 = get_weapon_one_data(); @@ -1958,9 +1956,9 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data={}) var basic_wep_string = $"{primary_weapon.name}: {primary_weapon.attack}#"; if IsSpecialist("libs") or has_trait("warp_touched"){ if (primary_weapon.has_tag("force") ||_wep2.has_tag("force")){ - var force_modifier = (((weapon_skill/100) * (psionic/10) * (intelligence/10)) + (experience()/1000)+0.1); + var force_modifier = (((weapon_skill/100) * (psionic/10) * (intelligence/10)) + (experience/1000)+0.1); primary_weapon.attack *= force_modifier; - basic_wep_string += $"Active Force Weapon: x{force_modifier}# Base: 0.10# WSxPSIxINT: x{(weapon_skill/100)*(psionic/10)*(intelligence/10)}# EXP: x{experience()/1000}#"; + basic_wep_string += $"Active Force Weapon: x{force_modifier}# Base: 0.10# WSxPSIxINT: x{(weapon_skill/100)*(psionic/10)*(intelligence/10)}# EXP: x{experience/1000}#"; } }; explanation_string = basic_wep_string + explanation_string @@ -2348,7 +2346,7 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data={}) static assign_reactionary_traits = function() { var _age = age(); - var _exp = experience(); + var _exp = experience; var _total_score = _age + _exp; if (_total_score > 280){ diff --git a/scripts/scr_max_marine/scr_max_marine.gml b/scripts/scr_max_marine/scr_max_marine.gml index 3542270f19..b340653e05 100644 --- a/scripts/scr_max_marine/scr_max_marine.gml +++ b/scripts/scr_max_marine/scr_max_marine.gml @@ -27,8 +27,9 @@ function scr_max_marine(max_type) { man_i=i; } }else if (max_type="exp"){ - if (obj_ini.experience[c,i]>value){ - value=obj_ini.experience[c,i];man_c=c;man_i=i; + if (unit.experience>value){ + value=unit.experience; + man_c=c;man_i=i; } } } diff --git a/scripts/scr_mission_reward/scr_mission_reward.gml b/scripts/scr_mission_reward/scr_mission_reward.gml index f0a7c4fd6f..00103d7480 100644 --- a/scripts/scr_mission_reward/scr_mission_reward.gml +++ b/scripts/scr_mission_reward/scr_mission_reward.gml @@ -31,11 +31,12 @@ function scr_mission_reward(argument0, argument1, argument2) { cleanup[com]=1; } if (roll2>50){ - argument1.p_player[argument2]+=scr_unit_size(obj_ini.armour[com][i],obj_ini.role[com][i],true); + var unit = obj_ini.TTRPG[com][i]; + argument1.p_player[argument2]+=unit.get_unit_size(); obj_ini.loc[com][i]=argument1.name; - obj_ini.TTRPG[com][i].planet_location=argument2; + unit.planet_location=argument2; techs_alive+=1; - repeat(3){obj_ini.experience[com][i]+=choose(1,2,3,4,5,6);} + unit.add_experience(irandom_range(3,18)); if (roll2<80) then found_requisition+=floor(random_range(5,40))+1; } if (roll2>=80) and (roll2<88) then found_requisition+=100; diff --git a/scripts/scr_move_unit_info/scr_move_unit_info.gml b/scripts/scr_move_unit_info/scr_move_unit_info.gml index 793c60ab61..8345d15216 100644 --- a/scripts/scr_move_unit_info/scr_move_unit_info.gml +++ b/scripts/scr_move_unit_info/scr_move_unit_info.gml @@ -18,7 +18,6 @@ function scr_move_unit_info(start_company,end_company, start_slot, end_slot, eva obj_ini.gear[end_company][end_slot]=obj_ini.gear[start_company][start_slot]; obj_ini.armour[end_company][end_slot]=obj_ini.armour[start_company][start_slot]; obj_ini.god[end_company][end_slot]=obj_ini.god[start_company][start_slot]; - obj_ini.experience[end_company][end_slot]=obj_ini.experience[start_company][start_slot]; obj_ini.age[end_company][end_slot]=obj_ini.age[start_company][start_slot]; obj_ini.mobi[end_company][end_slot]=obj_ini.mobi[start_company][start_slot]; var temp_struct = jsonify_marine_struct(start_company,start_slot); //jsonified for stransfer of struct (makes a deep copy) diff --git a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml index ac527446e9..f7b6820053 100644 --- a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml +++ b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml @@ -172,7 +172,7 @@ function scr_player_combat_weapon_stacks() { var cast_dice=irandom(99)+1; if (array_contains(obj_ini.dis,"Warp Touched")) then cast_dice-=5; - cast_dice-=(unit.psionic+(unit.experience()/60)) + cast_dice-=(unit.psionic+(unit.experience/60)) if (cast_dice<=50) then marine_casting[g]=1; @@ -313,7 +313,7 @@ function scr_add_unit_to_roster(unit, is_ally=false){ array_push(marine_mobi, unit.mobility_item()); array_push(marine_hp, unit.hp()); array_push(marine_mobi, unit.mobility_item()); - array_push(marine_exp, unit.experience()); + array_push(marine_exp, unit.experience); array_push(marine_powers, unit.specials()); array_push(marine_ranged, unit.ranged_attack()); array_push(marine_powers, unit.specials()); diff --git a/scripts/scr_powers_new/scr_powers_new.gml b/scripts/scr_powers_new/scr_powers_new.gml index c98eb3d9a8..bb71e3714b 100644 --- a/scripts/scr_powers_new/scr_powers_new.gml +++ b/scripts/scr_powers_new/scr_powers_new.gml @@ -19,7 +19,7 @@ function scr_powers_new(){ // higer psionice means more powers learnt - powers_should_have=floor((experience()-30)/(45-psionic))+1;// +1 for the primary + powers_should_have=floor((experience-30)/(45-psionic))+1;// +1 for the primary powers_have=string_count(string(power_code),specials()); diff --git a/scripts/scr_random_event/scr_random_event.gml b/scripts/scr_random_event/scr_random_event.gml index e4bdeb0c3a..630108550c 100644 --- a/scripts/scr_random_event/scr_random_event.gml +++ b/scripts/scr_random_event/scr_random_event.gml @@ -325,7 +325,7 @@ function scr_random_event(execute_now) { unit.add_exp(10); } else { - unit.add_exp(max(20, unit.experience())); + unit.add_exp(max(20, unit.experience)); } scr_popup("Promotions!",text,"distinguished",""); diff --git a/scripts/scr_random_marine/scr_random_marine.gml b/scripts/scr_random_marine/scr_random_marine.gml index 9efc95fb54..a3a93411d9 100644 --- a/scripts/scr_random_marine/scr_random_marine.gml +++ b/scripts/scr_random_marine/scr_random_marine.gml @@ -75,7 +75,7 @@ function scr_random_marine(role, exp_req, search_params="none"){ } //check corect experience - if (unit.experience() highest_exp){ - highest_exp = unit.experience(); + if (unit.experience > highest_exp){ + highest_exp = unit.experience; exp_unit = unit; }; } @@ -330,8 +330,8 @@ function UnitSquad(squad_type = undefined, company = undefined) constructor{ i--; continue; } - if (unit.experience() > highest_exp){ - highest_exp = unit.experience(); + if (unit.experience > highest_exp){ + highest_exp = unit.experience; exp_unit = unit; }; } @@ -538,7 +538,7 @@ function UnitSquad(squad_type = undefined, company = undefined) constructor{ } } }else if (hierarchy[leader_hier_pos]==unit.role()){ - if (obj_ini.TTRPG[leader[0]][leader[1]].experience()0){ var exp_require = _new_armour_data.req_exp; - if (exp_require>experience()){ + if (exp_require>experience){ return "exp_low"; } quality=scr_add_item(new_armour,-1,quality); @@ -209,7 +209,7 @@ function scr_update_unit_gear(new_gear,from_armoury=true, to_armoury=true, quali if (from_armoury) and (new_gear!="") and (!arti){ if (scr_item_count(new_gear,quality)>0){ var exp_require = gear_weapon_data("gear", new_gear, "req_exp", false, quality); - if (exp_require>experience()){ + if (exp_require>experience){ return "exp_low"; } quality=scr_add_item(new_gear,-1, quality); @@ -273,7 +273,7 @@ function scr_update_unit_mobility_item(new_mobility_item, from_armoury = true, t if (from_armoury && new_mobility_item!="" && !arti){ if (scr_item_count(new_mobility_item, quality)>0){ var exp_require = gear_weapon_data("weapon", new_mobility_item, "req_exp", false, quality); - if (exp_require>experience()){ + if (exp_require>experience){ return "exp_low"; } quality=scr_add_item(new_mobility_item,-1, quality); diff --git a/scripts/scr_unit_spawn_functions/scr_unit_spawn_functions.gml b/scripts/scr_unit_spawn_functions/scr_unit_spawn_functions.gml index 1e2a60715c..8e1f95df1b 100644 --- a/scripts/scr_unit_spawn_functions/scr_unit_spawn_functions.gml +++ b/scripts/scr_unit_spawn_functions/scr_unit_spawn_functions.gml @@ -215,7 +215,7 @@ function scr_marine_spawn_age(){ } function scr_marine_spawn_armour(){ var _age = age(); - var _exp = experience(); + var _exp = experience; var _total_score = _age + _exp; var armour_weighted_lists = { @@ -450,13 +450,13 @@ function scr_marine_game_spawn_constructions(){ add_trait("tyrannic_vet"); bionic_count+=irandom(2); }; - if (irandom(399-experience()) == 0){ + if (irandom(399-experience) == 0){ add_trait("still_standing"); }; - if (irandom(399-experience()) == 0){ + if (irandom(399-experience) == 0){ add_trait("beast_slayer"); }; - if (irandom(499-experience())==0){ + if (irandom(499-experience)==0){ add_trait("lone_survivor"); } for(var i=0;i