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
10 changes: 3 additions & 7 deletions datafiles/data/weapons.json
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,7 @@
"HK Missile": {
"abbreviation": "HKMssl",
"ammo": 1,
"arp": 1,
"arp": 4,
"attack": {
"artifact": 450,
"master_crafted": 400,
Expand Down Expand Up @@ -2739,8 +2739,7 @@
"tags": [
"vehicle",
"heavy_ranged",
"pintle",
"dreadnought"
"pintle"
Comment thread
EttyKitty marked this conversation as resolved.
],
"value": 60
},
Expand Down Expand Up @@ -2833,7 +2832,6 @@
"spli": 21,
"tags": [
"vehicle",
"dreadnought",
"heavy_ranged",
"bolt"
],
Expand Down Expand Up @@ -2862,7 +2860,6 @@
"flame",
"heavy_ranged",
"vehicle",
"dreadnought",
"sponson"
],
"value": 150
Expand Down Expand Up @@ -2911,8 +2908,7 @@
"las",
"energy",
"vehicle",
"heavy_ranged",
"dreadnought"
"heavy_ranged"
]
},
"Twin Linked Lascannon Sponsons": {
Expand Down
7 changes: 6 additions & 1 deletion objects/obj_mass_equip/Step_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,12 @@ try {
}

// Add up messages
all_equip = $"In total they are equipped with: {_total_role_gear.get_total_string()}.";
var _totals_string = _total_role_gear.get_custom_string(function(_key, _count, _i, _keys) {
return $"{_count}x {_key}{smart_delimeter_sign(_keys, _i, false)}";
});
if (_totals_string != "") {
all_equip = $"In total they are equipped with: {_totals_string}.";
}

refresh = false;

Expand Down
1 change: 1 addition & 0 deletions scripts/scr_controller_helpers/scr_controller_helpers.gml
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ function scr_end_turn() {
}

player_forge_data.player_forges = 0;
player_forge_data.vehicle_hanger = [];
requisition += income;
scr_income();
gene_tithe -= 1;
Expand Down
6 changes: 2 additions & 4 deletions scripts/scr_get_item_names/scr_get_item_names.gml
Original file line number Diff line number Diff line change
Expand Up @@ -148,22 +148,20 @@ function push_marine_mobility_item_names(_item_names) {
/// @param {array} _item_names - The list to append to.
/// @returns {void}
function push_dreadnought_ranged_weapons_item_names(_item_names) {
var item_count = 11;
var item_count = 9;
var initial_size = array_length(_item_names);
array_resize(_item_names, initial_size + item_count);

var index = initial_size;
_item_names[@ index++] = "Multi-Melta";
_item_names[@ index++] = "Twin Linked Heavy Flamer Sponsons";
_item_names[@ index++] = "Plasma Cannon";
_item_names[@ index++] = "Assault Cannon";
_item_names[@ index++] = "Autocannon";
_item_names[@ index++] = "Missile Launcher";
_item_names[@ index++] = "Twin Linked Lascannon";
_item_names[@ index++] = "Twin Linked Assault Cannon Mount";
_item_names[@ index++] = "Twin Linked Heavy Bolter";
_item_names[@ index++] = "Heavy Conversion Beam Projector";
_item_names[@ index++] = "Twin-linked Volkite Culverins"; // 10
_item_names[@ index++] = "Twin-linked Volkite Culverins"; // 8
}

/// @description This function appends the list of dreadnought melee weapons to the given list.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,12 +463,12 @@ function SpecialistPointHandler() constructor {
if (master_craft_count > 0) {
scr_add_item(_item.name, master_craft_count, "master_crafted");
var numerical_string = master_craft_count == 1 ? "was" : "were";
quality_string = $"X{master_craft_count} {numerical_string} Completed to a Master Crafted standard";
quality_string = $"x{master_craft_count} {numerical_string} completed to a Master Crafted standard!";
} else {
quality_string = $"all were completed to a standard STC compliant quality";
quality_string = $"All were completed to a standard STC compliant quality!";
}

scr_popup("Forge Completed", $"{_item.display_name} X{_forge_order.count} construction finished {quality_string}", "", "");
scr_popup("Forge Completed", $"Construction of x{_forge_order.count} {_item.display_name} is finished! {quality_string}", "", "");
};

static scr_evaluate_forge_item_completion = function(_forge_order) {
Expand All @@ -481,18 +481,25 @@ function SpecialistPointHandler() constructor {
if (!is_vehicle) {
scr_forge_item(_forge_order);
} else {
var _build_locs = [];

var _loc_counts = new CountingMap();
repeat (_forge_order.count) {
var vehicle = scr_add_vehicle(_item.name, obj_controller.new_vehicles);
var build_loc = array_random_element(obj_controller.player_forge_data.vehicle_hanger);
obj_ini.veh_loc[vehicle[0]][vehicle[1]] = build_loc[0];
obj_ini.veh_wid[vehicle[0]][vehicle[1]] = build_loc[1];
obj_ini.veh_lid[vehicle[0]][vehicle[1]] = -1;
array_push(_build_locs, $"{build_loc[0]} {build_loc[1]}");
_loc_counts.add($"{build_loc[0]} {build_loc[1]}");
}

scr_popup("Forge Completed", $"{_item.display_name} x{_forge_order.count} construction finished! Vehicles waiting at hanger(s) on {string_join_ext(", ", _build_locs)}", "", "");

var _loc_summary = _loc_counts.get_custom_string(function(_key, _count) {
return $"{_count} at {_key}\n";
});

var _company = obj_controller.new_vehicles;
var _company_name = (_company >= 1 && _company <= 10) ? $"{int_to_roman(_company)} Company" : "Reserve";

scr_popup("Forge Completed", $"Construction of x{_forge_order.count} {_item.display_name} is finished!\n\nAssigned to: {_company_name}\n\nReady at:\n{_loc_summary}", "", "");
}
} else if (_item.forge_type == "research") {
scr_advance_research(_item.name);
Expand Down
36 changes: 27 additions & 9 deletions scripts/scr_struct_functions/scr_struct_functions.gml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,13 @@ function gc_struct(vari) {
delete vari;
}

function CountingMap() constructor {
function CountingMap(_initial_array = undefined) constructor {
map = {};

if (_initial_array != undefined) {
add_all(_initial_array);
}

static add = function(_key, number = 1) {
if (_key == "") {
return;
Expand All @@ -75,16 +79,30 @@ function CountingMap() constructor {
}
};

static get_total_string = function() {
var result = "";
var keys = struct_get_names(map);

for (var i = 0; i < array_length(keys); i++) {
var key = keys[i];
result += $"{map[$ key]}x {key}{smart_delimeter_sign(keys, i, false)}";
static add_all = function(_array) {
if (!is_array(_array)) {
return;
}
var _len = array_length(_array);
for (var _i = 0; _i < _len; _i++) {
add(_array[_i]);
}
};

return result;
static get_custom_string = function(_callback) {
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
var _keys = struct_get_names(map);
var _len = array_length(_keys);
if (_len == 0) {
return "";
}

var _parts = array_create(_len);
for (var _i = 0; _i < _len; _i++) {
var _key = _keys[_i];
_parts[_i] = _callback(_key, map[$ _key], _i, _keys);
}

return string_join_ext("", _parts);
};

static get_string = function(_key) {
Expand Down
Loading