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
2 changes: 1 addition & 1 deletion objects/obj_controller/Alarm_1.gml
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ if (did){
}
}


instance_activate_object(obj_ini);
if (field=="both"){
if (obj_ini.fleet_type==ePlayerBase.penitent) then orkz+=3;
orkz+=3;
Expand Down
16 changes: 9 additions & 7 deletions objects/obj_controller/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ chapter_made = 0;
// obj_cuicons.alarm[1]=1; // Clean up custom icons
map_scale = 1;
scale_mod = 1;
unit_manage_constants = {};
unit_manage_constants.current_data = [-1,-1];


diplomacy_pathway = "";
Expand Down Expand Up @@ -435,14 +437,14 @@ unit_bio=false;
view_squad=false;
company_report=false;
company_data = {};
obj_controller.unit_focus = false;
unit_focus = false;
filter_mode = false;
manage_tags = [];
pauldron_trim=0;
last_unit=[0,0];
pauldron_trim = 0;
last_unit = [0,0];
ui_coloring="";
ui_melee_penalty=0;
ui_ranged_penalty=0;
ui_melee_penalty = 0;
ui_ranged_penalty = 0;
management_tags = [];

// ** Sets default mouse vars **
Expand Down Expand Up @@ -711,6 +713,7 @@ sel_system_x=0;
sel_system_y=0;
popup_master_crafted=0;
close_popups = true;
unit_manage_image = false;
// ** Sets starting turn **
turn=1;
// turn=40;
Expand Down Expand Up @@ -1220,7 +1223,7 @@ serialize = function(){

}
var excluded_from_save = ["temp", "serialize", "deserialize", "build_chaos_gods", "company_data","menu_buttons",
"location_viewer", "production_research_pathways", "specialist_point_handler", "spec_train_data", "tooltips", "last_unit", "unit_manage_constants"],
"location_viewer", "production_research_pathways", "specialist_point_handler", "spec_train_data", "tooltips", "last_unit", "unit_manage_constants", "unit_manage_image"],
var excluded_from_save_start = ["restart_"];

copy_serializable_fields(object_controller, save_data, excluded_from_save, excluded_from_save_start);
Expand All @@ -1231,7 +1234,6 @@ serialize = function(){
// Deserialization is done within scr_load
#endregion


// ** Loads the game **
if (global.load>=0){
load_game=global.load;
Expand Down
2 changes: 1 addition & 1 deletion objects/obj_mass_equip/Create_0.gml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

tab=0;
tab=-1;
role=obj_controller.settings;
refresh=true;
engage=false;
Expand Down
22 changes: 11 additions & 11 deletions objects/obj_mass_equip/Draw_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ if (total_role_number>0){



if (total_role_number > 0 && tab > 0) {
if (total_role_number > 0 && tab > -1) {
item_name = [];
var infanty_roles = [
eROLE.ChapterMaster,
Expand All @@ -83,20 +83,20 @@ if (total_role_number > 0 && tab > 0) {
eROLE.Dreadnought,
];
// hand slots
if ((tab == 1 || tab ==2) && array_get_index(infanty_roles, obj_controller.settings) >= 0) {
if ((tab == 0 || tab ==1) && array_get_index(infanty_roles, obj_controller.settings) >= 0) {
// Get all available hand weapons
scr_get_item_names(
item_name,
obj_controller.settings, // eROLE
1, // slot
0, // slot
eENGAGEMENT.Any,
true, // include the company standard
false, // do not limit to available items
);
scr_get_item_names(
item_name,
obj_controller.settings, // eROLE
2, // slot
1, // slot
eENGAGEMENT.Any,
false, // include the company standard
false, // do not limit to available items
Expand Down Expand Up @@ -160,19 +160,19 @@ if (total_role_number > 0 && tab > 0) {

switch (tab) {
// slots
case 1: obj_ini.wep1[100, role] = buh; break;
case 2: obj_ini.wep2[100, role] = buh; break;
case 3:
case 0: obj_ini.wep1[100, role] = buh; break;
case 1: obj_ini.wep2[100, role] = buh; break;
case 2:
obj_ini.armour[100, role] = buh;
// No bikes or jump packs for Terminators
if (array_contains(LIST_TERMINATOR_ARMOUR, buh) || buh == STR_ANY_TERMINATOR_ARMOUR) {
obj_ini.mobi[100, role] = "";
}
break;
case 4: obj_ini.gear[100, role] = buh; break;
case 5: obj_ini.mobi[100, role] = buh; break;
case 3: obj_ini.gear[100, role] = buh; break;
case 4: obj_ini.mobi[100, role] = buh; break;
}
tab = 0;
tab = -1;
refresh = true;
}
}
Expand All @@ -191,7 +191,7 @@ if (total_role_number > 0 && tab > 0) {
draw_rectangle(xx + 1347 - (string_width(string_hash_to_newline("CANCEL")) / 2), yy + 720, xx + 1347 + (string_width(string_hash_to_newline("CANCEL")) / 2), yy + 741, 0);
draw_set_alpha(1);
if (scr_click_left()) {
tab = 0;
tab = -1;
}
}
draw_set_alpha(1);
Expand Down
4 changes: 2 additions & 2 deletions objects/obj_mass_equip/Step_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ try {

refresh = false;

if (tab > 0) {
if (tab > -1) {
item_name = [];
var is_hand_slot = tab == 1 || tab == 2;
var is_hand_slot = tab == 0 || tab == 1;
scr_get_item_names(
item_name,
obj_controller.settings, // eROLE
Expand Down
2 changes: 1 addition & 1 deletion scripts/scr_ComplexSet/scr_ComplexSet.gml
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ function ComplexSet(_unit) constructor {
draw_sprite(weapon_right.sprite, 0, x_surface_offset + weapon_right.ui_xmod, y_surface_offset + weapon_right.ui_ymod);
}
if ((weapon_left.sprite != 0) && sprite_exists(weapon_left.sprite)) {
draw_sprite(weapon_left.sprite, 0, x_surface_offset + weapon_left.ui_xmod, y_surface_offset + weapon_left.ui_ymod);
draw_sprite(weapon_left.sprite, 1, x_surface_offset + weapon_left.ui_xmod, y_surface_offset + weapon_left.ui_ymod);
}
exit;
}
Expand Down
67 changes: 65 additions & 2 deletions scripts/scr_buttons/scr_buttons.gml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,69 @@ function pop_draw_return_values(){
array_delete(global.draw_return_stack, _index, 1);
}
}

function ReactiveString(text,x1=0,y1=0,data = false) constructor{
self.x1 = x1;
self.y1 = y1;
x2 = 0;
y2 = 0;
halign = fa_left;
valign = fa_top;

self.text = text;
text_max_width = -1;
font = fnt_40k_14;
colour = CM_GREEN_COLOR;
tooltip = "";
max_width = -1;
h = 0;
w = 0;

move_data_to_current_scope(data);

static update = function(data = {}){
move_data_to_current_scope(data);
add_draw_return_values();
draw_set_font(font);
draw_set_halign(halign);
draw_set_valign(valign);

if (max_width>-1){
w = string_width_ext(text, -1, max_width);
h = string_height_ext(text, -1, max_width);
x2 = x1 + w;
y2 = y1 + h;
}

pop_draw_return_values();
}

update();

static hit = function(){
return scr_hit(x1,y1,x2,y2);
}

static draw = function(){
add_draw_return_values();
draw_set_font(font);
draw_set_halign(halign);
draw_set_valign(valign);
draw_set_color(colour);

if (max_width>-1){
draw_text_ext_outline(x1, y1, text, -1, max_width, 0, c_black, colour);
} else {
draw_text_outline(x1, y1, text, c_black, colour);
}
if (hit()){
tooltip_draw(tooltip);
}
pop_draw_return_values();
}
}


//position, icon, text, text_max_width, tooltip, text_position, font = fnt_40k_14, colour = CM_GREEN_COLOR
function LabeledIcon(icon, text,x1=0,y1=0,data = false) constructor{

Expand Down Expand Up @@ -51,8 +114,8 @@ function LabeledIcon(icon, text,x1=0,y1=0,data = false) constructor{
add_draw_return_values();
draw_set_font(font);
if (text_position == "right"){
w = x1 + icon_width + 2 + string_width(text);;
x2 = w;
w = icon_width + 2 + string_width(text);;
x2 = x1 + w;
h = icon_height;
y2 = y1 + icon_height;
}
Expand Down
7 changes: 7 additions & 0 deletions scripts/scr_culture_visuals/scr_culture_visuals.gml
Original file line number Diff line number Diff line change
Expand Up @@ -1901,6 +1901,7 @@ base: {
sprite: spr_weapon_assca,
body_types: [3],
armours : ["Dreadnought"],
new_weapon_draw: true
}],
},
"Heavy Flamer": {
Expand Down Expand Up @@ -1936,6 +1937,7 @@ base: {
sprite: spr_dread_lascannon,
body_types: [3],
armours : ["Dreadnought"],
new_weapon_draw: true
}
],
},
Expand All @@ -1946,6 +1948,7 @@ base: {
display_type: "dreadnought",
},
armours : ["Dreadnought"],
new_weapon_draw: true
},
variants: [
{
Expand Down Expand Up @@ -2037,6 +2040,7 @@ base: {
sprite: spr_dread_plasma_cannon,
body_types: [3],
armours : ["Dreadnought"],
new_weapon_draw: true
}
],
},
Expand Down Expand Up @@ -2286,6 +2290,7 @@ base: {
sprite: spr_dread_missile,
body_types: [3],
armours : ["Dreadnought"],
new_weapon_draw: true
}
]
},
Expand All @@ -2311,6 +2316,7 @@ base: {
sprite: spr_dread_plasma_cannon,
body_types: [3],
armours : ["Dreadnought"],
new_weapon_draw: true
}
]
},
Expand Down Expand Up @@ -2495,6 +2501,7 @@ base: {
sprite: spr_dread_autocannon,
body_types: [3],
armours : ["Dreadnought"],
new_weapon_draw: true
}
]
},
Expand Down
32 changes: 32 additions & 0 deletions scripts/scr_powers/scr_powers.gml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,38 @@
global.disciplines_data = json_to_gamemaker(working_directory + "\\data\\psychic_disciplines.json", json_parse);
global.powers_data = json_to_gamemaker(working_directory + "\\data\\psychic_powers.json", json_parse);

function generate_marine_powers_description_string(unit){
var _psy_powers_known = unit.powers_known;
var _psy_powers_count = array_length(_psy_powers_known);
var _psy_discipline = unit.psy_discipline();
var _psy_discipline_name = get_discipline_data(_psy_discipline, "name");

var _tooltip = "";
_tooltip += $"Psychic Rating: {unit.psionic}";

var _equipment_psychic_amplification = unit.gear_special_value("psychic_amplification");
var _character_psychic_amplification = unit.psychic_amplification() * 100;
var _equipment_psychic_focus = unit.gear_special_value("psychic_focus");
var _character_psychic_focus = unit.psychic_focus();
var _perils_chance = unit.perils_threshold() / 10;
_tooltip += $"\nAmplification from Equipment: {_equipment_psychic_amplification}%";
_tooltip += $"\nAmplification from Attributes (Psy Rating and EXP): {_character_psychic_amplification}%";

_tooltip += $"\n\nFocus Success Chance: {100 - unit.psychic_focus_difficulty()}%";
_tooltip += $"\nFocus from Equipment: {_equipment_psychic_focus}%";
_tooltip += $"\nFocus from Attributes (WIS and EXP): {_character_psychic_focus}%";

_tooltip += $"\n\nPerils of the Warp Chance: {_perils_chance}%";

_tooltip += $"\n\nMain Discipline: {_psy_discipline_name}";
_tooltip += $"\nKnown Powers: ";
for (var i = 0; i < _psy_powers_count; i++) {
_tooltip += get_power_data(_psy_powers_known[i], "name");
_tooltip += smart_delimeter_sign(_psy_powers_count, i, false);
}
return _tooltip;
}

/// @desc Psychic powers execution mess. Called in the scope of obj_pnunit.
/// @param {real} caster_id - ID of the caster in the player column from obj_pnunit.
/// @mixin
Expand Down
Loading