Skip to content
Draft
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
4 changes: 3 additions & 1 deletion ChapterMaster.yyp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
{"$GMFolder":"","%Name":"Diplomacy","folderPath":"folders/Scripts/User Interface/Diplomacy.yy","name":"Diplomacy","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"Common","folderPath":"folders/Scripts/User Interface/Diplomacy/Common.yy","name":"Common","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"Render Components","folderPath":"folders/Scripts/User Interface/Render Components.yy","name":"Render Components","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"UUID Suite","folderPath":"folders/Scripts/UUID Suite.yy","name":"UUID Suite","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"Sequences","folderPath":"folders/Sequences.yy","name":"Sequences","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"Shaders","folderPath":"folders/Shaders.yy","name":"Shaders","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"Sounds","folderPath":"folders/Sounds.yy","name":"Sounds","resourceType":"GMFolder","resourceVersion":"2.0",},
Expand Down Expand Up @@ -866,6 +867,7 @@
{"id":{"name":"scr_unit_spawn_functions","path":"scripts/scr_unit_spawn_functions/scr_unit_spawn_functions.yy",},},
{"id":{"name":"scr_unit_traits","path":"scripts/scr_unit_traits/scr_unit_traits.yy",},},
{"id":{"name":"scr_uuid_generate","path":"scripts/scr_uuid_generate/scr_uuid_generate.yy",},},
{"id":{"name":"scr_uuid_management","path":"scripts/scr_uuid_management/scr_uuid_management.yy",},},
{"id":{"name":"scr_vehicle_count","path":"scripts/scr_vehicle_count/scr_vehicle_count.yy",},},
{"id":{"name":"scr_vehicle_helpers","path":"scripts/scr_vehicle_helpers/scr_vehicle_helpers.yy",},},
{"id":{"name":"scr_vehicle_order","path":"scripts/scr_vehicle_order/scr_vehicle_order.yy",},},
Expand Down Expand Up @@ -1720,4 +1722,4 @@
"TextureGroups":[
{"$GMTextureGroup":"","%Name":"Default","autocrop":true,"border":2,"compressFormat":"bz2","customOptions":"","directory":"","groupParent":null,"isScaled":false,"loadType":"default","mipsToGenerate":0,"name":"Default","resourceType":"GMTextureGroup","resourceVersion":"2.0","targets":-1,},
],
}
}
34 changes: 18 additions & 16 deletions objects/obj_controller/Alarm_5.gml
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,18 @@ for (var c = 0; c < 11; c++){
}
}
// STC Bonuses
if (obj_controller.stc_ships>=6){
if (obj_controller.stc_ships >= 6) {
//self healing ships logic
for (var v=0; v<array_length(obj_ini.ship_hp); v++){
if (obj_ini.ship[v]=="" || obj_ini.ship_hp[v]<0) then continue;
if (obj_ini.ship_hp[v]<obj_ini.ship_maxhp[v]){
var _max = obj_ini.ship_maxhp[v];
obj_ini.ship_hp[v] = min(_max,obj_ini.ship_hp[v]+round(_max*0.06));
var _ship_UUIDs = struct_get_names(INI_USHIPROOT);
var _ship_count = array_length(_ship_UUIDs);
for (var v = 0; v < _ship_count; v++) {
var _ship_struct = fetch_ship(_ship_UUIDs[v]);
var _health = _ship_struct.health
if (_health.hp < 0) { continue; }

var _max = _health.maxhp;
if (_health.hp < _max) {
_health.hp = min(_max, _health.hp + round(_max * 0.06));
}
}
}
Expand Down Expand Up @@ -612,12 +617,15 @@ for(var i=1; i<=99; i++){
// Creates the ship
var last_ship = new_player_ship(new_ship_event, ship_spawn.system.name);

add_ship_to_fleet(last_ship, _new_player_fleet)
add_ship_to_fleet(last_ship, _new_player_fleet);

// show_message(string(obj_ini.ship_class[last_ship])+":"+string(obj_ini.ship[last_ship]));

if (obj_ini.ship_size[last_ship]!=1) then scr_popup("Ship Constructed",$"Your new {obj_ini.ship_class[last_ship]} '{obj_ini.ship[last_ship]}' has finished being constructed. It is orbiting {ship_spawn.system.name} and awaits its maiden voyage.","shipyard","");
if (obj_ini.ship_size[last_ship]==1) then scr_popup("Ship Constructed",$"Your new {obj_ini.ship_class[last_ship]} Escort '{obj_ini.ship[last_ship]}' has finished being constructed. It is orbiting {ship_spawn.system.name} and awaits its maiden voyage.","shipyard","");
if (last_ship.size != 1) {
scr_popup("Ship Constructed", $"Your new {last_ship.class} '{last_ship.name}' has finished being constructed. It is orbiting {ship_spawn.system.name} and awaits its maiden voyage.", "shipyard", "");
} else {
scr_popup("Ship Constructed", $"Your new {last_ship.class} Escort '{last_ship.name}' has finished being constructed. It is orbiting {ship_spawn.system.name} and awaits its maiden voyage.", "shipyard", "");
}
var bob=instance_create(ship_spawn.system.x+16,ship_spawn.system.y-24,obj_star_event);
bob.image_alpha=1;
bob.image_speed=1;
Expand Down Expand Up @@ -680,13 +688,7 @@ for(var i=1; i<=99; i++){
if (item=="Artifact"){
var last_artifact=0;
scr_event_log("",string(obj_ini.role[100][16])+" "+string(marine_name)+" constructs an Artifact.");
if (obj_ini.fleet_type==ePlayerBase.home_world){
last_artifact = scr_add_artifact("random_nodemon","",0,obj_ini.home_name,2);
} else {
if (obj_ini.fleet_type != ePlayerBase.home_world){
last_artifact = scr_add_artifact("random_nodemon","",0,obj_ini.ship_location[0],501);
}
}
last_artifact = scr_add_artifact("random_nodemon", "", 0);

tixt+=$"some form of divine inspiration has seemed to have taken hold of him. An artifact {obj_ini.artifact[last_artifact]} has been crafted.";
}
Expand Down
63 changes: 33 additions & 30 deletions objects/obj_controller/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ tagged_training=0;

// ** Default menu items **
selecting_planet=0;
selecting_ship=-1;
selecting_ship = "";
fleet_minimized=0;
fleet_all=1;
unload=0;
Expand Down Expand Up @@ -695,14 +695,13 @@ for(var i=0; i<501; i++){
// ship management arrays
// they are used to display a paginated subset of ships
// at a particular location for the load to ship screen.
sh_ide = []
sh_uid = []
sh_name = []
sh_class = []
sh_loc = []
sh_hp = []
sh_cargo = []
sh_cargo_max = []
sh_uuid = [];
sh_name = [];
sh_class = [];
sh_loc = [];
sh_hp = [];
sh_cargo = [];
sh_cargo_max = [];
reset_manage_arrays();
alll=0;
//
Expand Down Expand Up @@ -1251,6 +1250,7 @@ faction_defeated[13]=0;
battle_cry="For the Emperor";
fortress_name="";
flagship_name="";
flagship_UUID = "";
home_name="";
home_type="";
recruiting_name="";
Expand Down Expand Up @@ -1315,7 +1315,7 @@ if (instance_exists(obj_ini)){
}
if (global.chapter_name=="Blood Ravens"){
for(var i=0; i<3; i++){
scr_add_artifact("random_nodemon","",0,obj_ini.ship[0],501);
scr_add_artifact("random_nodemon", "", 0);
}
}
// TODO should add special bonus to different chapters based on lore
Expand Down Expand Up @@ -1709,25 +1709,28 @@ temp[62]="##Your fleet contains ";
var bb=0,sk=0,glad=0,hunt=0,ships=0,bb_names=[],sk_names=[],glad_names=[],hunt_names=[];

codex[0]="";codex_discovered[0]=0;
for(var mm=0; mm<array_length(obj_ini.ship); mm++){
if (obj_ini.ship[mm]!=""){
ships++;
if (obj_ini.ship_class[mm] == "Battle Barge") {
bb++;
array_push(bb_names, string(obj_ini.ship[mm]));
}
if (obj_ini.ship_class[mm] == "Strike Cruiser") {
sk++;
array_push(sk_names, string(obj_ini.ship[mm]));
}
if (obj_ini.ship_class[mm] == "Gladius") {
glad++;
array_push(glad_names, string(obj_ini.ship[mm]));
}
if (obj_ini.ship_class[mm] == "Hunter") {
hunt++;
array_push(hunt_names, string(obj_ini.ship[mm]));
}
var _ship_UUIDs = struct_get_names(INI_USHIPROOT);
var _ship_count = array_length(_ship_UUIDs);
for (var mm = 0; mm < _ship_count; mm++) {
ships++;
var _ship_struct = fetch_ship(_ship_UUIDs[mm]);
switch _ship_struct.class {
case "Battle Barge":
bb++;
array_push(bb_names, _ship_struct.name);
break;
case "Strike Cruiser":
sk++;
array_push(sk_names, _ship_struct.name);
break;
case "Gladius":
glad++;
array_push(glad_names, _ship_struct.name);
break;
case "Hunter":
hunt++;
array_push(hunt_names, _ship_struct.name);
break;
}
codex[mm]="";
codex_discovered[mm]=0;
Expand All @@ -1736,7 +1739,7 @@ for(var mm=0; mm<array_length(obj_ini.ship); mm++){
temp[62]+=$" {string_plural_count("warship", ships)}-\n";

if (obj_ini.fleet_type != ePlayerBase.home_world || bb == 1) {
temp[62] += $"Your flagship, Battle Barge {obj_ini.ship[0]}.";
temp[62] += $"Your flagship, Battle Barge {fetch_ship(flagship_UUID).name}.";
temp[62] += "\n";
bb--;
}
Expand Down
56 changes: 31 additions & 25 deletions objects/obj_controller/Step_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -771,24 +771,37 @@ try {
acted = 2;
}
}
for (var i = 1; i < array_length(obj_ini.ship); i++) {
if ((obj_ini.ship_location[i] != "Warp") && (obj_ini.ship_location[i] != "Lost")) {
obj_ini.ship_hp[i] = obj_ini.ship_maxhp[i];

var _ship_UUIDs = struct_get_names(INI_USHIPROOT);
var _ship_count = array_length(_ship_UUIDs);
for (var i = 0; i < _ship_count; i++) {
var _ship_struct = fetch_ship(_ship_UUIDs[i]);
if ((_ship_struct.location != "Warp") && (_ship_struct.location != "Lost")) {
_ship_struct.health.hp = _ship_struct.health.maxhp;
}
}
// TODO need something here to veryify that the ships are within a friendly star system
}
// Unloads units from a ship
if (unload > 0) {
cooldown = 8;
var b = selecting_ship;
var _ship_struct;
if (selecting_ship != "") {
_ship_struct = fetch_ship(selecting_ship);
}

var unit, company, unit_id;
if (_ship_struct == undefined) {
for (var q = 0; q < array_length(display_unit); q++) {
if (ma_lid[q] != "") {
_ship_struct = fetch_ship(ma_lid[q]);
break;
}
}
}

for (var q = 0; q < array_length(display_unit); q++) {
if ((man[q] == "man") && (ma_loc[q] == selecting_location) && (ma_wid[q] < 1) && (man_sel[q] != 0)) {
if (b == -1) {
b = ma_lid[q];
}
unit = display_unit[q];
if (!is_struct(unit)) {
continue;
Expand All @@ -798,37 +811,30 @@ try {
}
unit_id = unit.marine_number;
company = unit.company;
obj_ini.loc[company][unit_id] = obj_ini.ship_location[b];
unit.ship_location = -1;
obj_ini.loc[company][unit_id] = _ship_struct.location;
unit.ship_location = "";
unit.planet_location = unload;
obj_ini.uid[company][unit_id] = 0;

ma_loc[q] = obj_ini.ship_location[b];
ma_lid[q] = -1;
ma_loc[q] = _ship_struct.location;
ma_lid[q] = "";
ma_wid[q] = unload;
} else if ((man[q] == "vehicle") && (ma_loc[q] == selecting_location) && (ma_wid[q] < 1) && (man_sel[q] != 0)) {
if (b == -1) {
b = ma_lid[q];
}
var unit_id = display_unit[q][1];
var company = display_unit[q][0];
obj_ini.veh_loc[company][unit_id] = obj_ini.ship_location[b];
obj_ini.veh_lid[company][unit_id] = -1;
obj_ini.veh_loc[company][unit_id] = _ship_struct.location;
obj_ini.veh_lid[company][unit_id] = "";
obj_ini.veh_wid[company][unit_id] = unload;
obj_ini.veh_uid[company][unit_id] = 0;

ma_loc[q] = obj_ini.ship_location[b];
ma_lid[q] = -1;
ma_loc[q] = _ship_struct.location;
ma_lid[q] = "";
ma_wid[q] = unload;
}
}
selecting_location = "";
for (var i = 0; i < array_length(display_unit); i++) {
man_sel[i] = 0;
}
if (b > -1 && b < array_length(obj_ini.ship_carrying)) {
obj_ini.ship_carrying[b] -= man_size;
}
_ship_struct.cargo.carrying -= man_size;
reset_ship_manage_arrays();
cooldown = 10;
sel_loading = -1;
Expand All @@ -839,11 +845,11 @@ try {
}
}
// Resets selections
if ((managing > 0) && (man_size == 0) && ((selecting_location != "") || (selecting_types != "") || (selecting_planet != 0) || (selecting_ship != -1))) {
if ((managing > 0) && (man_size == 0) && ((selecting_location != "") || (selecting_types != "") || (selecting_planet != 0) || (selecting_ship != ""))) {
selecting_location = "";
selecting_types = "";
selecting_planet = 0;
selecting_ship = -1;
selecting_ship = "";
}

if ((marines <= 0) && (alarm[7] == -1) && (!instance_exists(obj_fleet_controller)) && (!instance_exists(obj_ncombat))) {
Expand Down
8 changes: 4 additions & 4 deletions objects/obj_ground_mission/Alarm_2.gml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

scr_return_ship(loc,self,num);

var man_size,ship_id,comp,plan,i;
i=0;ship_id=0;man_size=0;comp=0;plan=0;
ship_id = get_valid_player_ship("", loc);
var man_size,_ship_UUID,comp,plan,i;
i=0;_ship_UUID="";man_size=0;comp=0;plan=0;
_ship_UUID = get_valid_player_ship(loc);
plan=instance_nearest(x,y,obj_star);
last_artifact = scr_add_artifact("random","random",4,loc,ship_id+500);
last_artifact = scr_add_artifact("random", "random", 4, fetch_ship(_ship_UUID).name, _ship_UUID);

var pop=instance_create(0,0,obj_popup);
pop.image="artifact_recovered";
Expand Down
8 changes: 4 additions & 4 deletions objects/obj_ground_mission/Alarm_3.gml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@

scr_return_ship(loc,self,num);

var man_size,ship_id,comp,plan,i;
var man_size,_ship_UUID,comp,plan,i;
i=0;
ship_id=0;
_ship_UUID = "";
man_size=0;
comp=0;
plan=0;

ship_id = get_valid_player_ship("", loc);
_ship_UUID = get_valid_player_ship(loc);

i=0;
plan=instance_nearest(x,y,obj_star);
last_artifact = scr_add_artifact("random","random",4,loc,ship_id+500);
last_artifact = scr_add_artifact("random", "random", 4, fetch_ship(_ship_UUID).name, _ship_UUID);


var pop;
Expand Down
8 changes: 4 additions & 4 deletions objects/obj_ground_mission/Alarm_4.gml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

scr_return_ship(loc,self,num);

var man_size,ship_id,comp,planet,i;
i=0;ship_id=0;man_size=0;comp=0;planet=0;
ship_id = get_valid_player_ship("", loc);
var man_size,_ship_UUID,comp,planet,i;
i=0;_ship_UUID="";man_size=0;comp=0;planet=0;
_ship_UUID = get_valid_player_ship(loc);
planet=instance_nearest(x,y,obj_star);
var last_artifact = scr_add_artifact("random","random",4,loc,ship_id+500);
var last_artifact = scr_add_artifact("random", "random", 4, fetch_ship(_ship_UUID).name, _ship_UUID);

var i=0;

Expand Down
8 changes: 5 additions & 3 deletions objects/obj_ini/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,12 @@ repeat(200){i+=1;
artifact_condition[i]=100;
artifact_quality[i]="artifact";
artifact_loc[i]="";
artifact_sid[i]=0;// Over 500 : ship
artifact_sid[i] = {};// Over 500 : ship
// Weapon Unidentified
artifact_struct[i] = new ArtifactStruct(i);
}

var i=-1;
init_player_fleet_arrays();
ship_id = [];

var v;
var company=-1;
Expand All @@ -76,6 +74,10 @@ repeat(11){
}
}

UUID_marine = {};
UUID_vehicle = {};
UUID_ship = {};

/*if (obj_creation.fleet_type=3){
obj_controller.penitent=1;
obj_controller.penitent_max=(obj_creation.maximum_size*1000)+300;
Expand Down
Loading