Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions scripts/scr_shoot/scr_shoot.gml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat
}
if (wep[weapon_index_position] = "Web Spinner") then damage_type = "status";

var attack_count_mod = splash[weapon_index_position];
var attack_count_mod = max(1, splash[weapon_index_position]);

if (damage_type = "status") and(stop = 0) and(shots_fired > 0) {
var damage_per_weapon = 0,
hit_number = shots_fired;
if (attack_count_mod > 1) and(melee_or_ranged != "wall") {
if (melee_or_ranged != "wall") {
shots_fired *= attack_count_mod;
}
if (hit_number > 0) and(melee_or_ranged != "wall") and(instance_exists(target_object)) {
Expand Down Expand Up @@ -101,7 +101,7 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat
damage_per_weapon = floor((doom * damage_per_weapon));
hit_number = floor(hit_number * doom);
}
if (attack_count_mod > 1) and(melee_or_ranged != "wall") {
if (melee_or_ranged != "wall") {
shots_fired *= attack_count_mod;
}

Expand Down Expand Up @@ -133,7 +133,7 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat
damage_per_weapon = floor((doom * damage_per_weapon));
hit_number = floor(hit_number * doom);
}
if (attack_count_mod > 1) and(melee_or_ranged != "wall") {
if (melee_or_ranged != "wall") {
shots_fired *= attack_count_mod;
}

Expand All @@ -143,8 +143,8 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat
hostile_weapon = wep[weapon_index_position];
hostile_range = range[weapon_index_position];
hostile_splash = attack_count_mod;
hostile_damage = (hostile_splash == 1) ? attack_count_mod * 3 : 0;
hostile_damage += damage_per_weapon / hit_number;
hostile_damage = damage_per_weapon / hit_number;
if (hostile_splash > 1) then hostile_damage += attack_count_mod * 3;
if (melee_or_ranged == "wall") {
var dest = 0;

Expand Down Expand Up @@ -234,7 +234,7 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat
target_armour_value = 0,
ap = 0,
wii = "";
attack_count_mod = 0;
attack_count_mod = 0;

if (weapon_index_position >= 0) {
damage_per_weapon = (aggregate_damage / wep_num[weapon_index_position]);
Expand Down Expand Up @@ -271,7 +271,7 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat
if (armour_pierce = -1) then target_armour_value = target_armour_value * 6;
}

attack_count_mod = splash[weapon_index_position] < 1 ? 1 : splash[weapon_index_position];
attack_count_mod = max(1, splash[weapon_index_position]);

final_hit_damage_value = damage_per_weapon - (target_armour_value * attack_count_mod); //damage armour reduction

Expand Down
73 changes: 49 additions & 24 deletions scripts/scr_weapon/scr_weapon.gml
Original file line number Diff line number Diff line change
Expand Up @@ -2293,27 +2293,52 @@ global.gear = {
}

function EquipmentStruct(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];
type = core_type;
for (var i=0;i<array_length(names);i++){
if (struct_exists(item_data,names[i])){
self[$names[i]] = item_data[$names[i]];
if (quality!="none"){
if (is_struct(self[$names[i]])){
if (struct_exists(self[$names[i]],quality)){
self[$names[i]]=self[$names[i]][$quality];
} else {
self[$names[i]]=self[$names[i]].standard;
}
}
}
} else {
self[$names[i]]=defaults[i];
}
}
variable_struct_set(self, "quality", quality=="none"?"standard":quality);
type = core_type;

var properties = [
["hp_mod", 0],
["description", ""],
["damage_resistance_mod", 0],
["ranged_mod", 0],
["melee_mod", 0],
["armour_value", 0],
["attack", 0],
["melee_hands", 0],
["ranged_hands", 0],
["ammo", 0],
["range", 0],
["spli", 0],
["arp", 0],
["special_description", ""],
["special_properties", []],
["abbreviation", ""],
["tags", []],
["name", ""],
["second_profiles", []],
["req_exp", 0]
];

for (var i = 0; i < array_length(properties); i++) {
var name = properties[i][0];
var default_value = properties[i][1];

if (struct_exists(item_data, name)) {
self[$ name] = item_data[$ name];
if (quality != "none") {
if (is_struct(self[$ name])) {
if (struct_exists(self[$ name], quality)) {
self[$ name] = self[$ name][$ quality];
} else {
self[$ name] = self[$ name].standard;
}
}
}
} else {
self[$ name] = default_value;
}
}

variable_struct_set(self, "quality", quality == "none" ? "standard" : quality);

static item_tooltip_desc_gen = function(){
item_desc_tooltip = "";
Expand Down Expand Up @@ -2385,9 +2410,9 @@ function EquipmentStruct(item_data, core_type,quality="none") constructor{
}
break;
case "spli":
if (spli>0){
item_desc_tooltip += $"Max Kills: {spli}#"
}
if item_type = "weapon"{
item_desc_tooltip += $"Max Kills: {max(1, spli)}#"
}
break;
case "ranged_mod":
if (ranged_mod!=0){
Expand Down