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
21 changes: 12 additions & 9 deletions objects/obj_shop/Draw_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ slate_panel.inside_method = function(){

if (shop="warships"){
if (construction_started>0){
var apa=construction_started/30;draw_set_alpha(apa);
var apa=construction_started/30;
draw_set_alpha(apa);
draw_set_color(c_yellow);
draw_set_halign(fa_center);
draw_text_transformed(__view_get( e__VW.XView, 0 )+420,yy+370,string_hash_to_newline("CONSTRUCTION STARTED!#ETA: "+string(eta)+" months"),1.5,1.5,0);
draw_text_transformed(__view_get( e__VW.XView, 0 )+420,yy+370,$"CONSTRUCTION STARTED!\nETA: {eta} months",1.5,1.5,0);
draw_set_halign(fa_left);
draw_set_color(38144);
draw_set_alpha(1);
Expand Down Expand Up @@ -154,24 +155,26 @@ slate_panel.inside_method = function(){
obj_controller.requisition-=cost;
}

if (obj_controller.requisition>=cost) and (shop="warships"){
if (obj_controller.requisition>=cost) and (shop=="warships"){

var _duration = 4;
if (item[i]="Battle Barge") then _duration=30;
if (item[i]="Strike Cruiser") then _duration=10;
if (item[i]="Battle Barge"){
_duration=30;
}
else if (item[i]="Strike Cruiser"){
_duration=10;
}

eta = _duration;

construction_started=120;
obj_controller.requisition-=cost;
obj_controller.requisition -= cost;
add_event({
e_id : "ship_construction",
ship_class : item[i],
duration : _duration,
})
});
}

obj_controller.cooldown=8000;
}
}
if (!obj_controller.in_forge && nobuy[i]=1) || (obj_controller.in_forge && forge_cost[i]=0){
Expand Down
4 changes: 3 additions & 1 deletion objects/obj_shop/Step_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ var i,xx,yy,x2,y2;i=0;
xx=__view_get( e__VW.XView, 0 )+0;
yy=__view_get( e__VW.YView, 0 )+0;

if (construction_started>0) then construction_started-=1;
if (construction_started>0){
construction_started-=1;
}


/* */
Expand Down
4 changes: 4 additions & 0 deletions scripts/scr_event_code/scr_event_code.gml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@

function add_event(event_data){
var _inserted = false;
if (!struct_exists(event_data,"duration")){
event_data.duration = 1;
}
for (var i=0;i<array_length(obj_controller.event);i++){
var _event = obj_controller.event[i];
if (_event.duration >= event_data.duration){
array_insert(obj_controller.event, i, event_data);
_inserted = true;
break;
}
}
if (!_inserted){
Expand Down