diff --git a/scripts/scr_marine_struct/scr_marine_struct.gml b/scripts/scr_marine_struct/scr_marine_struct.gml index 98dbeb5cf..7b5cfd300 100644 --- a/scripts/scr_marine_struct/scr_marine_struct.gml +++ b/scripts/scr_marine_struct/scr_marine_struct.gml @@ -1707,6 +1707,7 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data={}) _wep1.owner_data("chapter"); _wep2.owner_data("chapter"); } + ranged_att += get_weapon_stat_bonus(_wep1) + get_weapon_stat_bonus(_wep2); var primary_weapon= new equipment_struct({},""); var secondary_weapon= new equipment_struct({},""); if (carry_data[0]>carry_data[1]){ @@ -1858,10 +1859,10 @@ 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); - 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)), "%#"); + var explanation_string = "1"; + // 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)), "%#"); melee_carrying = melee_hands_limit(); var _wep1 = get_weapon_one_data(); @@ -1872,6 +1873,9 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data={}) _wep1.owner_data("chapter"); _wep2.owner_data("chapter"); } + + melee_att += get_weapon_stat_bonus(_wep1) + get_weapon_stat_bonus(_wep2); + var primary_weapon; var secondary_weapon="none"; if (weapon_slot==0){ @@ -1983,6 +1987,21 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data={}) return melee_damage_data; }; + static get_weapon_stat_bonus = function(_weapon) { + var _total_bonus = 0; + if (_weapon.stat_scaling != 0) { + var _stats = struct_get_names(_weapon.stat_scaling); + for (var i = 0; i < array_length(stats); i++) { + var _stat_name = stats[i]; + var _stat_value = variable_struct_get(self, stat_name); + if (stat_value != 0) { + _total_bonus += variable_struct_get(_weapon.stat_scaling, stat_name) * stat_value; + } + } + } + return _total_bonus; + } + //TODO just did this so that we're not loosing featuring but this porbably needs a rethink static hammer_of_wrath = function(){ var wrath = new equipment_struct({},""); diff --git a/scripts/scr_weapon/scr_weapon.gml b/scripts/scr_weapon/scr_weapon.gml index 0156b90ff..6c9822144 100644 --- a/scripts/scr_weapon/scr_weapon.gml +++ b/scripts/scr_weapon/scr_weapon.gml @@ -201,6 +201,10 @@ global.weapons = { "spli": 4, "arp": 0, "tags": ["chain", "sword"], + "stat_scaling": { + "strength": 1.2, + "dexterity": 1.4, + } }, "Chainaxe": { "abbreviation": "ChAxe", @@ -2314,13 +2318,13 @@ global.gear = { function equipment_struct(item_data, core_type,quality="none") constructor{ //This could be done with 2d arrays [[],[]] - var names = ["hp_mod", "description","damage_resistance_mod", "ranged_mod", "melee_mod","armour_value" ,"attack","melee_hands","ranged_hands","ammo","range","spli","arp","special_description", "special_properties", "abbreviation","tags","name","second_profiles","req_exp"]; - var defaults = [0,"",0,0,0,0,0,0,0,0,0,0,0,"",[],"",[],"",[],0]; + var names = ["hp_mod", "description","damage_resistance_mod", "ranged_mod", "melee_mod","armour_value" ,"attack","melee_hands","ranged_hands","ammo","range","spli","arp","special_description", "special_properties", "abbreviation","tags","name","second_profiles","req_exp", "stat_scaling"]; + var defaults = [0,"",0,0,0,0,0,0,0,0,0,0,0,"",[],"",[],"",[],0, 0]; type = core_type; for (var i=0;i