diff --git a/ChapterMaster.yyp b/ChapterMaster.yyp index 6fd18c028e..c0d01793d9 100644 --- a/ChapterMaster.yyp +++ b/ChapterMaster.yyp @@ -579,7 +579,7 @@ "isEcma":false, "LibraryEmitters":[], "MetaData":{ - "IDEVersion":"2024.1400.0.901", + "IDEVersion":"2024.1400.0.904", }, "name":"ChapterMaster", "resources":[ @@ -753,8 +753,8 @@ {"id":{"name":"scr_array_functions","path":"scripts/scr_array_functions/scr_array_functions.yy",},}, {"id":{"name":"scr_arti_descr","path":"scripts/scr_arti_descr/scr_arti_descr.yy",},}, {"id":{"name":"scr_audience","path":"scripts/scr_audience/scr_audience.yy",},}, + {"id":{"name":"scr_automated_ship_combat_functions","path":"scripts/scr_automated_ship_combat_functions/scr_automated_ship_combat_functions.yy",},}, {"id":{"name":"scr_battle_allies","path":"scripts/scr_battle_allies/scr_battle_allies.yy",},}, - {"id":{"name":"scr_battle_sort","path":"scripts/scr_battle_sort/scr_battle_sort.yy",},}, {"id":{"name":"scr_bionics_count","path":"scripts/scr_bionics_count/scr_bionics_count.yy",},}, {"id":{"name":"scr_boarding_actions","path":"scripts/scr_boarding_actions/scr_boarding_actions.yy",},}, {"id":{"name":"scr_bolt","path":"scripts/scr_bolt/scr_bolt.yy",},}, @@ -787,9 +787,9 @@ {"id":{"name":"scr_crusade","path":"scripts/scr_crusade/scr_crusade.yy",},}, {"id":{"name":"scr_culture_visuals","path":"scripts/scr_culture_visuals/scr_culture_visuals.yy",},}, {"id":{"name":"scr_DataSlate","path":"scripts/scr_DataSlate/scr_DataSlate.yy",},}, - {"id":{"name":"scr_dead_marines","path":"scripts/scr_dead_marines/scr_dead_marines.yy",},}, {"id":{"name":"scr_demand","path":"scripts/scr_demand/scr_demand.yy",},}, {"id":{"name":"scr_destroy_planet","path":"scripts/scr_destroy_planet/scr_destroy_planet.yy",},}, + {"id":{"name":"scr_destroy_vehicle","path":"scripts/scr_destroy_vehicle/scr_destroy_vehicle.yy",},}, {"id":{"name":"scr_dialogue","path":"scripts/scr_dialogue/scr_dialogue.yy",},}, {"id":{"name":"scr_diplomacy_helpers","path":"scripts/scr_diplomacy_helpers/scr_diplomacy_helpers.yy",},}, {"id":{"name":"scr_display_number","path":"scripts/scr_display_number/scr_display_number.yy",},}, @@ -805,11 +805,14 @@ {"id":{"name":"scr_drop_fiddle","path":"scripts/scr_drop_fiddle/scr_drop_fiddle.yy",},}, {"id":{"name":"scr_drop_select_function","path":"scripts/scr_drop_select_function/scr_drop_select_function.yy",},}, {"id":{"name":"scr_en_weapon","path":"scripts/scr_en_weapon/scr_en_weapon.yy",},}, + {"id":{"name":"scr_end_turn_audiences_and_final","path":"scripts/scr_end_turn_audiences_and_final/scr_end_turn_audiences_and_final.yy",},}, + {"id":{"name":"scr_end_turn_combat_helpers","path":"scripts/scr_end_turn_combat_helpers/scr_end_turn_combat_helpers.yy",},}, {"id":{"name":"scr_enemy_ai_a","path":"scripts/scr_enemy_ai_a/scr_enemy_ai_a.yy",},}, {"id":{"name":"scr_enemy_ai_b","path":"scripts/scr_enemy_ai_b/scr_enemy_ai_b.yy",},}, {"id":{"name":"scr_enemy_ai_c","path":"scripts/scr_enemy_ai_c/scr_enemy_ai_c.yy",},}, {"id":{"name":"scr_enemy_ai_d","path":"scripts/scr_enemy_ai_d/scr_enemy_ai_d.yy",},}, {"id":{"name":"scr_enemy_ai_e","path":"scripts/scr_enemy_ai_e/scr_enemy_ai_e.yy",},}, + {"id":{"name":"scr_enemy_fleet_spawn_combat","path":"scripts/scr_enemy_fleet_spawn_combat/scr_enemy_fleet_spawn_combat.yy",},}, {"id":{"name":"scr_equipment_struct","path":"scripts/scr_equipment_struct/scr_equipment_struct.yy",},}, {"id":{"name":"scr_event_code","path":"scripts/scr_event_code/scr_event_code.yy",},}, {"id":{"name":"scr_event_dudes","path":"scripts/scr_event_dudes/scr_event_dudes.yy",},}, @@ -877,6 +880,7 @@ {"id":{"name":"scr_pen_And_paper","path":"scripts/scr_pen_And_paper/scr_pen_And_paper.yy",},}, {"id":{"name":"scr_perils_table","path":"scripts/scr_perils_table/scr_perils_table.yy",},}, {"id":{"name":"scr_planet_heresy","path":"scripts/scr_planet_heresy/scr_planet_heresy.yy",},}, + {"id":{"name":"scr_planet_setup_functions","path":"scripts/scr_planet_setup_functions/scr_planet_setup_functions.yy",},}, {"id":{"name":"scr_planetary_feature","path":"scripts/scr_planetary_feature/scr_planetary_feature.yy",},}, {"id":{"name":"scr_PlanetData","path":"scripts/scr_PlanetData/scr_PlanetData.yy",},}, {"id":{"name":"scr_player_combat_weapon_stacks","path":"scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.yy",},}, @@ -913,8 +917,11 @@ {"id":{"name":"scr_serialization_functions","path":"scripts/scr_serialization_functions/scr_serialization_functions.yy",},}, {"id":{"name":"scr_shader_initialize","path":"scripts/scr_shader_initialize/scr_shader_initialize.yy",},}, {"id":{"name":"scr_ship_battle","path":"scripts/scr_ship_battle/scr_ship_battle.yy",},}, + {"id":{"name":"scr_ship_combat_data","path":"scripts/scr_ship_combat_data/scr_ship_combat_data.yy",},}, {"id":{"name":"scr_ship_count","path":"scripts/scr_ship_count/scr_ship_count.yy",},}, {"id":{"name":"scr_ship_occupants","path":"scripts/scr_ship_occupants/scr_ship_occupants.yy",},}, + {"id":{"name":"scr_ship_weapon_struct","path":"scripts/scr_ship_weapon_struct/scr_ship_weapon_struct.yy",},}, + {"id":{"name":"scr_ShipStruct","path":"scripts/scr_ShipStruct/scr_ShipStruct.yy",},}, {"id":{"name":"scr_shoot","path":"scripts/scr_shoot/scr_shoot.yy",},}, {"id":{"name":"scr_special_view","path":"scripts/scr_special_view/scr_special_view.yy",},}, {"id":{"name":"scr_specialist_point_handler","path":"scripts/scr_specialist_point_handler/scr_specialist_point_handler.yy",},}, @@ -931,6 +938,7 @@ {"id":{"name":"scr_struct_functions","path":"scripts/scr_struct_functions/scr_struct_functions.yy",},}, {"id":{"name":"scr_system_search_helpers","path":"scripts/scr_system_search_helpers/scr_system_search_helpers.yy",},}, {"id":{"name":"scr_system_spawn_functions","path":"scripts/scr_system_spawn_functions/scr_system_spawn_functions.yy",},}, + {"id":{"name":"scr_system_spawn","path":"scripts/scr_system_spawn/scr_system_spawn.yy",},}, {"id":{"name":"scr_Table","path":"scripts/scr_Table/scr_Table.yy",},}, {"id":{"name":"scr_target","path":"scripts/scr_target/scr_target.yy",},}, {"id":{"name":"scr_text_hit","path":"scripts/scr_text_hit/scr_text_hit.yy",},}, @@ -940,6 +948,8 @@ {"id":{"name":"scr_trade","path":"scripts/scr_trade/scr_trade.yy",},}, {"id":{"name":"scr_transfer_marines","path":"scripts/scr_transfer_marines/scr_transfer_marines.yy",},}, {"id":{"name":"scr_turn_first","path":"scripts/scr_turn_first/scr_turn_first.yy",},}, + {"id":{"name":"scr_tyranid_fleet_functions","path":"scripts/scr_tyranid_fleet_functions/scr_tyranid_fleet_functions.yy",},}, + {"id":{"name":"scr_tyranid_planet_functions","path":"scripts/scr_tyranid_planet_functions/scr_tyranid_planet_functions.yy",},}, {"id":{"name":"scr_ui_advisors","path":"scripts/scr_ui_advisors/scr_ui_advisors.yy",},}, {"id":{"name":"scr_ui_diplomacy","path":"scripts/scr_ui_diplomacy/scr_ui_diplomacy.yy",},}, {"id":{"name":"scr_ui_display_weapons","path":"scripts/scr_ui_display_weapons/scr_ui_display_weapons.yy",},}, @@ -1621,6 +1631,7 @@ {"id":{"name":"spr_ship_razorfiend","path":"sprites/spr_ship_razorfiend/spr_ship_razorfiend.yy",},}, {"id":{"name":"spr_ship_reaper","path":"sprites/spr_ship_reaper/spr_ship_reaper.yy",},}, {"id":{"name":"spr_ship_shadow","path":"sprites/spr_ship_shadow/spr_ship_shadow.yy",},}, + {"id":{"name":"spr_ship_shields","path":"sprites/spr_ship_shields/spr_ship_shields.yy",},}, {"id":{"name":"spr_ship_shroud","path":"sprites/spr_ship_shroud/spr_ship_shroud.yy",},}, {"id":{"name":"spr_ship_slam","path":"sprites/spr_ship_slam/spr_ship_slam.yy",},}, {"id":{"name":"spr_ship_song","path":"sprites/spr_ship_song/spr_ship_song.yy",},}, diff --git a/datafiles/data/traits.json b/datafiles/data/traits.json index 1d090f0ba2..346646c2df 100644 --- a/datafiles/data/traits.json +++ b/datafiles/data/traits.json @@ -464,7 +464,7 @@ }, "perfectionist": { "display_name": "Perfectionist", - "flavour_text": "Obsessed with doing things correctly", + "flavour_text": "Obsessed with doing things correctly and Training to perfection", "wisdom": [ 2, 2, @@ -487,7 +487,8 @@ "piety": [ 2, 1 - ] + ], + "effect": "When captaining a ship weapons have a 10% increased reload time" }, "guardian": { "display_name": "Guardian", diff --git a/objects/obj_al_in/Step_0.gml b/objects/obj_al_in/Step_0.gml index ea44b7dc0a..d36373fff1 100644 --- a/objects/obj_al_in/Step_0.gml +++ b/objects/obj_al_in/Step_0.gml @@ -8,21 +8,21 @@ if (owner == eFACTION.Chaos) then sprite_index = spr_ship_dreadclaw; image_angle = direction; if (cooldown1 > 0) then cooldown1 -= 1; -var dist, range; +var target_distance, range; if (instance_exists(target)) { - dist = point_distance(x, y, target.x, target.y); + target_distance = point_distance(x, y, target.x, target.y); range = 100 + max(sprite_get_width(target.sprite_index), sprite_get_height(target.sprite_index)); if (action == "close") { speed = 4; direction = turn_towards_point(direction, x, y, target.x, target.y, 6); } - if (dist < range) and(dist > 100) and(action = "close") then action = "shoot"; - if (action == "shoot") and(dist > range) then action = "close"; - if (dist < 80) and(action = "shoot") then action = "bank"; + if (target_distance < range) and(target_distance > 100) and(action = "close") then action = "shoot"; + if (action == "shoot") and(target_distance > range) then action = "close"; + if (target_distance < 80) and(action = "shoot") then action = "bank"; if (action == "bank") then direction = turn_towards_point(direction, x, y, room_width, room_height / 2, 3); - if (action == "bank") and(dist > 300) then action = "close"; + if (action == "bank") and(target_distance > 300) then action = "close"; if (action == "shoot") and(cooldown1 <= 0) { var bull; @@ -36,6 +36,7 @@ if (instance_exists(target)) { bull.image_xscale = 0.5; bull.image_yscale = 0.5; bull.dam = 3; + bull.explosion_sprite = spr_explosion; if (owner == 7) then bull.dam = 2; } } else if (!instance_exists(target)) or (target.x <= -4000) { diff --git a/objects/obj_al_round/Collision_obj_en_ship.gml b/objects/obj_al_round/Collision_obj_en_ship.gml index a85ef7b1fa..d11e694a5c 100644 --- a/objects/obj_al_round/Collision_obj_en_ship.gml +++ b/objects/obj_al_round/Collision_obj_en_ship.gml @@ -1,20 +1 @@ -// Handles damage allocation on space combat against ships based on shields and hp -var arm = other.armour_front; -var t1 = 0; - -if (arm < dam) { - dam -= arm; - if (other.shields > 0) other.shields -= dam / 2; - else other.hp -= dam / 2; -} - -if (arm > dam) { - if (other.shields > 0) other.shields -= 0.5; - if (other.shields <= 0) other.hp -= 0.5; -} - -if (sprite_index == spr_torpedo) { - instance_create(x, y, obj_explosion); -} - -instance_destroy(); \ No newline at end of file +round_collision_with_ship(); \ No newline at end of file diff --git a/objects/obj_al_round/Create_0.gml b/objects/obj_al_round/Create_0.gml index 67d9ddee3c..d4ed7544cc 100644 --- a/objects/obj_al_round/Create_0.gml +++ b/objects/obj_al_round/Create_0.gml @@ -1,2 +1,3 @@ dam = 0; -image_angle=direction; \ No newline at end of file +image_angle=direction; +explosion_sprite = spr_explosion; \ No newline at end of file diff --git a/objects/obj_al_round/Step_0.gml b/objects/obj_al_round/Step_0.gml index 8fe3452409..2151dd3ed0 100644 --- a/objects/obj_al_round/Step_0.gml +++ b/objects/obj_al_round/Step_0.gml @@ -1,19 +1 @@ -image_angle = direction; - -if (x < -1000) - or(x > room_width + 1000) - or(y < -1000) - or(y > room_height + 1000) - then instance_destroy(); - -var th, thd; -if (dam <= 4) { - if (instance_exists(obj_p_th)) { - th = instance_nearest(x, y, obj_p_th); - thd = point_distance(x, y, th.x, th.y); - if (thd < 6) { - th.hp -= (self.dam - 1); - instance_destroy(); - } - } -} \ No newline at end of file +round_step_logic(); \ No newline at end of file diff --git a/objects/obj_al_ship/Alarm_0.gml b/objects/obj_al_ship/Alarm_0.gml deleted file mode 100644 index e7bd72ed28..0000000000 --- a/objects/obj_al_ship/Alarm_0.gml +++ /dev/null @@ -1,887 +0,0 @@ -// Sets up the ships for each race -for(var i=1; i0) and (shields0) and (instance_exists(obj_en_ship)){ + is_targeted(); // TODO on another PR we need to redo how combat works, currently its just "attack" perhaps we can have more precise choise based AI with // simpler patterns? if (class=="Apocalypse Class Battleship"){ - o_dist=500; + closing_distance=500; action="attack"; spid=20; } if (class=="Nemesis Class Fleet Carrier"){ - o_dist=1000; + closing_distance=1000; action="attack"; spid=20; } if (class=="Leviathan"){ - o_dist=160; + closing_distance=160; action="attack"; spid=20; } if (class=="Battle Barge") or (class=="Custodian"){ - o_dist=300; + closing_distance=300; action="attack"; spid=20; } if (class=="Desecrator"){ - o_dist=300; + closing_distance=300; action="attack"; spid=20; } if (class=="Razorfiend"){ - o_dist=100; + closing_distance=100; action="attack"; spid=25; } if (class=="Dethdeala") or (class=="Protector") or (class=="Emissary"){ - o_dist=200; + closing_distance=200; action="attack"; spid=20; } if (class=="Gorbag's Revenge"){ - o_dist=200; + closing_distance=200; action="attack"; spid=20; } if (class=="Kroolboy") or (class=="Slamblasta"){ - o_dist=200; + closing_distance=200; action="attack"; spid=25; } if (class=="Battlekroozer"){ - o_dist=200; + closing_distance=200; action="attack"; spid=30; } if (class=="Avenger") or (class=="Carnage") or (class=="Daemon"){ - o_dist=200; + closing_distance=200; action="attack"; spid=20; } if (class=="Ravager") or (class=="Iconoclast") or (class=="Castellan") or (class=="Warden"){ - o_dist=300; + closing_distance=300; action="attack"; spid=35; } if (class=="Stalker") or (class=="Sword Class Frigate"){ - o_dist=100; + closing_distance=100; action="attack"; spid=20; } if (class=="Prowler"){ - o_dist=100; + closing_distance=100; action="attack"; spid=35; } if (class=="Avenger Class Grand Cruiser"){ - o_dist=48; + closing_distance=48; action="broadside"; spid=20; } // if (class!="big") then flank!!!! + closing_distance = closing_distance; spid=spid*speed_bonus; - dist=point_distance(x,y,target.x,target.y)-(max(sprite_get_width(sprite_index),sprite_get_height(sprite_index))); + target_distance=point_distance(x,y,target.x,target.y)-(max(sprite_get_width(sprite_index),sprite_get_height(sprite_index))); + target_distance = target_distance; // For example here we could improve the options and how ships beheave... if (target!=0) and (action=="attack"){ direction=turn_towards_point(direction,x,y,target.x,target.y,.1); } - if (target!=0) and (action=="broadside") and (dist>o_dist){ - if (y>=target.y) then dist=point_distance(x,y,target.x+lengthdir_x(64,target.direction-180),target.y+lengthdir_y(128,target.direction-90))-(max(sprite_get_width(sprite_index),sprite_get_height(sprite_index))); - if (ytarget.y) and (dist>o_dist) then direction=turn_towards_point(direction,x+lengthdir_x(64,target.direction-180),y,target.x,target.y+lengthdir_y(128,target.direction-90),.2); - if (yo_dist) then direction=turn_towards_point(direction,x+lengthdir_x(64,target.direction-180),y,target.x,target.y+lengthdir_y(128,target.direction+90),.2); - if (turn_bonus>1){ - if (yo_dist) then direction=turn_towards_point(direction,x+lengthdir_x(64,target.direction-180),y,target.x,target.y+lengthdir_y(128,target.direction+90),.2); - } - } - /*if (target!=0) and (action="broadside") and (o_dist>=dist){ + broadside_movement(); + flank_behaviour(); + /*if (target!=0) and (action="broadside") and (closing_distance>=target_distance){ direction=turn_towards_point(direction,x+lengthdir_x(128,target.direction-90),y,target.x,target.y+lengthdir_y(128,target.direction-90),.2) }*/ - /*if (target!=0) and (action="broadside") and (o_dist>=dist){ + /*if (target!=0) and (action="broadside") and (closing_distance>=target_distance){ var re_deh;re_deh=relative_direction(direction,target.direction); // if (re_deh<45) or (re_deh>315) or ((re_deh>135) and (re_deh<225)) then direction=turn_towards_point(direction,x+lengthdir_x(128,target.direction-90),y,target.x,target.y+lengthdir_y(128,target.direction-90),.2) var wok; @@ -178,36 +160,28 @@ if (!__b__){ // direction=turn_towards_point(direction,x+lengthdir_x(128,target.direction-90),y,target.x,target.y+lengthdir_y(128,target.direction-90),.2) }*/ // Controls speed based on action - if (action="attack"){ - if (dist>o_dist) and (speed<((spid)/10)) then speed+=0.005; - if (dist0) then speed-=0.025; - } - if (action="broadside"){ - if (dist>o_dist) and (speed<((spid)/10)) then speed+=0.005; - if (dist0) then speed-=0.025; - } + speed_down = 0.025; + combat_acceleration_control(); + if (speed<0) then speed=speed*0.9; // Weapon reloads - if (cooldown[1]>0) then cooldown[1]-=1; - if (cooldown[2]>0) then cooldown[2]-=1; - if (cooldown[3]>0) then cooldown[3]-=1; - if (cooldown[4]>0) then cooldown[4]-=1; - if (cooldown[5]>0) then cooldown[5]-=1; if (turret_cool>0) then turret_cool-=1; targe=0; rdir=0; - dist=9999; + target_distance=9999; xx=x; yy=y; // Turret targetting - if (turrets>0) and (instance_exists(obj_en_in)) and (turret_cool=0){ + if (turrets>0) and (instance_exists(obj_en_in)) and (turret_cool==0){ targe=instance_nearest(x,y,obj_en_in); - if (instance_exists(targe)) then dist=point_distance(x,y,targe.x,targe.y); - if (dist>64) and (dist<300){ + if (instance_exists(targe)) then target_distance=point_distance(x,y,targe.x,targe.y); + + if (target_distance>64) and (target_distance<300){ bull=instance_create(x,y,obj_al_round); bull.direction=point_direction(x,y,targe.x,targe.y); - if (owner == eFACTION.Tyranids) then bull.sprite_index=spr_glob; + if (owner = eFACTION.Tyranids) then bull.sprite_index=spr_glob; + if (owner = eFACTION.Tau) or (owner = eFACTION.Eldar) then bull.sprite_index=spr_pulse; bull.speed=20; bull.dam=3; bull.image_xscale=0.5; @@ -216,8 +190,7 @@ if (!__b__){ bull.direction+=choose(random(10),1*-(random(10))); } } - targe=0; - dist=9999; + ship_shoot_weapons(); xx=lengthdir_x(64,direction+90); yy=lengthdir_y(64,direction+90); @@ -236,152 +209,6 @@ if (!__b__){ if (collision_line(x,y,x+lengthdir_x(2000,direction),y+lengthdir_y(2000,direction),obj_en_ship,0,1)) then front=1; - f=0; - facing=""; - ammo=0; - range=0; - wep=""; - dam=0; - - for(var gg=1; gg<=weapons; gg++){ - // Resets - ok=0; - f+=1; - facing=""; - ammo=0; - range=0; - wep=""; - - if (cooldown[gg]<=0) and (weapon[gg]!="") and (weapon_ammo[gg]>0) then ok=1; - if (ok==1){ - facing=weapon_facing[gg]; - ammo=weapon_ammo[gg]; - range=weapon_range[gg]; - } - - targe=target; - if (facing=="front") and (front==1) then ok=2; - if (facing=="most") then ok=2; - /* - if (facing="right") then targe=target_r; - if (facing="left") then targe=target_l; - if ((facing="front") or (facing="most")) and (front=1) then ok=2; - if (facing="right") or (facing="most") and (right=1) then ok=2; - if (facing="left") or (facing="most") and (left=1) then ok=2; - */ - if (facing=="special") then ok=2; - if (!instance_exists(targe)) then exit; - dist=point_distance(x,y,targe.x,targe.y); - if (facing=="right") and (point_direction(x,y,target_r.x,target_r.y)<337) and (point_direction(x,y,target_r.x,target_r.y)>203) then ok=2; - if (facing=="left") and (point_direction(x,y,target_r.x,target_r.y)>22) and (point_direction(x,y,target_r.x,target_r.y)<157) then ok=2; - /*var re_deh;re_deh=relative_direction(direction,target.direction); - if (re_deh<45) or (re_deh>315) or ((re_deh>135) and (re_deh<225)) then direction=turn_towards_point(direction,x+lengthdir_x(128,target.direction-90),y,target.x,target.y+lengthdir_y(128,target.direction-90),.2) - */ - if (ok==2) and (dist<(range+(max(sprite_get_width(sprite_index),sprite_get_height(sprite_index))))){ - if (ammo>0) and (ammo<900) then ammo-=1; - weapon_ammo[gg]=ammo; - cooldown[gg]=weapon_cooldown[gg]; - wep=weapon[gg]; - dam=weapon_dam[gg]; - // if (f=3) and (ship_id=2) then show_message("ammo: "+string(ammo)+" | range: "+string(range)); - if (ammo<0) then ok=0; - ok=3; - // Weapons fire - if (string_count("orpedo",wep)==0) and (string_count("Interceptor",wep)==0) and (string_count("ommerz",wep)==0) and (string_count("Claws",wep)==0) and (string_count("endrils",wep)==0) and (ok==3){ - bull=instance_create(x+lengthdir_x(32,direction),y+lengthdir_y(32,direction),obj_al_round); - bull.speed=20; - bull.dam=dam; - if (targe==target) then bull.direction=point_direction(x+lengthdir_x(32,direction),y+lengthdir_y(32,direction),target.x,target.y); - if (facing!="front"){bull.direction=point_direction(x+lengthdir_x(32,direction),y+lengthdir_y(32,direction),target.x,target.y);} - if (string_count("ova",wep)==1){ - bull.image_xscale=2; - bull.image_yscale=2; - } - if (string_count("eavy Gunz",wep)==1){ - bull.image_xscale=1.5; - bull.image_yscale=1.5; - } - if (string_count("Lance",wep)==1){ - bull.sprite_index=spr_ground_las; - bull.image_xscale=1.5; - bull.image_yscale=1.5; - } - if (string_count("Ion",wep)==1){ - bull.sprite_index=spr_pulse; - bull.image_xscale=1.5; - bull.image_yscale=1.5; - } - if (string_count("Rail",wep)==1){ - bull.sprite_index=spr_railgun; - bull.image_xscale=1.5; - bull.image_yscale=1.5; - } - if (string_count("Gravitic",wep)==1){ - bull.image_xscale=2; - bull.image_yscale=2; - } - if (string_count("Plasma",wep)==1){ - bull.sprite_index=spr_ground_plasma; - bull.image_xscale=2; - bullimage_yscale=2; - bull.speed=15; - } - if (string_count("Pyro-Acid",wep)==1){ - bull.sprite_index=spr_glob; - bull.image_xscale=2; - bullimage_yscale=2; - } - if (string_count("Weapons",wep)==1) and (owner == eFACTION.Eldar){ - bull.sprite_index=spr_ground_las; - bull.image_xscale=2; - bull.image_yscale=2; - } - if (string_count("Pulse",wep)==1) and (owner == eFACTION.Eldar){ - bull.sprite_index=spr_pulse; - bull.image_xscale=1.5; - bull.image_yscale=1.5; - } - } - // Torpedo weapons - if (string_count("orpedo",wep)==1) and (ok==3){ - if (class!="Ravager"){ - bull=instance_create(x,y+lengthdir_y(-30,direction+90),obj_al_round); - bull.speed=10; - bull.direction=direction; - bull.sprite_index=spr_torpedo; - bull.dam=dam; - } - bull=instance_create(x,y+lengthdir_y(-10,direction+90),obj_al_round); - bull.speed=10; - bull.direction=direction; - bull.sprite_index=spr_torpedo; - bull.dam=dam; - bull=instance_create(x,y+lengthdir_y(10,direction+90),obj_al_round); - bull.speed=10; - bull.direction=direction; - bull.sprite_index=spr_torpedo; - bull.dam=dam; - if (class!="Ravager"){ - bull=instance_create(x,y+lengthdir_y(30,direction+90),obj_al_round); - bull.speed=10; - bull.direction=direction; - bull.sprite_index=spr_torpedo; - bull.dam=dam; - } - } - // Melee ship weapons (nids) - if ((string_count("Claws",wep)==1) or (string_count("endrils",wep)==1)) and (ok==3){ - if (target.shields<=0) then target.hp-=weapon_dam[wep]; - if (target.shields>0) then target.shields-=weapon_dam[wep]; - } - // Special weapons - if ((string_count("Interceptor",wep)==1) or (string_count("ommerz",wep)==1) or (string_count("Manta",wep)==1) or (string_count("Glands",wep)==1) or (string_count("Eldar Launch",wep)==1)) and (ok==3){ - bull=instance_create(x,y+lengthdir_y(-30,direction+90),obj_al_in); - bull.direction=self.direction; - bull.owner=self.owner; - } - } - } } } // Checks if the enemy fleet is Eldar @@ -391,7 +218,7 @@ if (__b__){ if (obj_fleet.start!=5) then exit; - o_dist=0; + closing_distance=0; spid=0; if (shields>0) and (shields0) and (instance_exists(obj_en_ship)){ if (class=="Void Stalker"){ - o_dist=300; + closing_distance=300; action="swoop"; spid=60; } if (class=="Shadow Class"){ - o_dist=200; + closing_distance=200; action="swoop"; spid=80; } if (class=="Hellebore") or (class=="Aconite"){ - o_dist=200; + closing_distance=200; action="swoop"; spid=100; } - dist=point_distance(x,y,target.x,target.y)-(max(sprite_get_width(target.sprite_index),sprite_get_height(sprite_index))); + target_distance=point_distance(x,y,target.x,target.y)-(max(sprite_get_width(target.sprite_index),sprite_get_height(sprite_index))); if (target!=0){ if (speed<((spid)/10)) then speed+=0.02; if (instance_exists(target)){ - dist=point_distance(x,y,target.x,target.y); + target_distance=point_distance(x,y,target.x,target.y); - if (action=="swoop"){direction=turn_towards_point(direction,x,y,target.x,target.y,5-ship_size);} - if (dist<=o_dist) and (collision_line(x,y,x+lengthdir_x(o_dist,direction),y+lengthdir_y(o_dist,direction),obj_en_ship,0,1)) then action="attack"; - if (dist<300) and (action=="attack") then action="bank"; - if (action=="bank") then direction=turn_towards_point(direction,x,y,room_width,room_height/2,5-ship_size); - if (action=="bank") and (dist>700) then action="attack"; + if (action=="swoop"){ + direction=turn_towards_point(direction,x,y,target.x,target.y,5-size); + } + if (target_distance<=closing_distance) and (collision_line(x,y,x+lengthdir_x(closing_distance,direction),y+lengthdir_y(closing_distance,direction),obj_en_ship,0,1)) then action="attack"; + if (target_distance<300) and (action=="attack") then action="bank"; + if (action=="bank") then direction=turn_towards_point(direction,x,y,room_width,room_height/2,5-size); + if (action=="bank") and (target_distance>700){ + action="attack"; + } } } if (y<-2000) or (y>room_height+2000) or (x<-2000) or (x>room_width+2000) then hp=-50; // Weapon and turret cooldown - for (var i = 1; i < array_length(cooldown); i++) { - if (cooldown[i]>0){ - cooldown[i]--; - } - } + if (turret_cool>0) then turret_cool-=1; targe=0; - dist=9999; + target_distance=9999; xx=x; yy=y; if (turrets>0) and (instance_exists(obj_en_in)) and (turret_cool==0){ targe=instance_nearest(x,y,obj_en_in); - if (instance_exists(targe)) then dist=point_distance(x,y,targe.x,targe.y); + if (instance_exists(targe)) then target_distance=point_distance(x,y,targe.x,targe.y); - if (dist>64) and (dist<300){ + if (target_distance>64) and (target_distance<300){ bull=instance_create(x,y,obj_al_round); bull.direction=point_direction(x,y,targe.x,targe.y); if (owner = eFACTION.Tyranids) then bull.sprite_index=spr_glob; @@ -488,172 +315,6 @@ if (__b__){ bull.direction+=choose(random(10),1*-(random(10))); } } - targe=0; - rdir=0; - dist=9999; - - xx=lengthdir_x(64,direction+90); - yy=lengthdir_y(64,direction+90); - - front=0; - right=0; - left=0; - rear=0; - - targe=instance_nearest(xx,yy,obj_en_ship); - rdir=point_direction(x,y,target.x,target.y); - // if (rdir>45) and (rdir<=135) and (targe!=target){target_r=targe;right=1;} - // if (rdir>225) and (rdir<=315) and (targe!=target) and (targe!=target_r){target_l=targe;left=1;} - target_l=instance_nearest(x+lengthdir_x(64,direction+90),y+lengthdir_y(64,direction+90),obj_en_ship); - target_r=instance_nearest(x+lengthdir_x(64,direction+270),y+lengthdir_y(64,direction+270),obj_en_ship); - - if (collision_line(x,y,x+lengthdir_x(2000,direction),y+lengthdir_y(2000,direction),obj_en_ship,0,1)) then front=1; - - - f=0; - facing=""; - ammo=0; - range=0; - wep=""; - dam=0; - gg=0; - - for(var gg=1; gg<=weapons; gg++){ - ok=0; - f+=1; - facing=""; - ammo=0; - range=0; - wep=""; - - if (cooldown[gg]<=0) and (weapon[gg]!="") and (weapon_ammo[gg]>0) then ok=1; - if (ok==1){ - facing=weapon_facing[gg]; - ammo=weapon_ammo[gg]; - range=weapon_range[gg]; - } - - targe=target; - if (facing=="front") and (front==1) then ok=2; - if (facing=="most") then ok=2; - /* - if (facing="right") then targe=target_r; - if (facing="left") then targe=target_l; - if ((facing="front") or (facing="most")) and (front=1) then ok=2; - if (facing="right") or (facing="most") and (right=1) then ok=2; - if (facing="left") or (facing="most") and (left=1) then ok=2; - */ - if (facing=="special") then ok=2; - if (!instance_exists(targe)) then exit; - dist=point_distance(x,y,targe.x,targe.y); - - if (facing=="right") and (point_direction(x,y,target_r.x,target_r.y)<337) and (point_direction(x,y,target_r.x,target_r.y)>203) then ok=2; - if (facing=="left") and (point_direction(x,y,target_r.x,target_r.y)>22) and (point_direction(x,y,target_r.x,target_r.y)<157) then ok=2; - /* - var re_deh;re_deh=relative_direction(direction,target.direction); - if (re_deh<45) or (re_deh>315) or ((re_deh>135) and (re_deh<225)) then direction=turn_towards_point(direction,x+lengthdir_x(128,target.direction-90),y,target.x,target.y+lengthdir_y(128,target.direction-90),.2) - */ - if (ok==2) and (dist<(range+(max(sprite_get_width(sprite_index),sprite_get_height(sprite_index))))){ - if (ammo>0) and (ammo<900) then ammo-=1; - weapon_ammo[gg]=ammo; - cooldown[gg]=weapon_cooldown[gg]; - wep=weapon[gg]; - dam=weapon_dam[gg]; - // if (f=3) and (ship_id=2) then show_message("ammo: "+string(ammo)+" | range: "+string(range)); - if (ammo<0) then ok=0; - ok=3; - // Weapon types - if (string_count("orpedo",wep)==0) and (string_count("Interceptor",wep)==0) and (string_count("ommerz",wep)==0) and (string_count("Claws",wep)==0) and (string_count("endrils",wep)==0) and (ok==3){ - bull=instance_create(x+lengthdir_x(32,direction),y+lengthdir_y(32,direction),obj_al_round); - bull.speed=20; - bull.dam=dam; - if (targe==target) then bull.direction=point_direction(x+lengthdir_x(32,direction),y+lengthdir_y(32,direction),target.x,target.y); - if (facing!="front"){bull.direction=point_direction(x+lengthdir_x(32,direction),y+lengthdir_y(32,direction),target.x,target.y);} - if (string_count("ova",wep)==1){ - bull.image_xscale=2; - bull.image_yscale=2; - } - if (string_count("eavy Gunz",wep)==1){ - bull.image_xscale=1.5; - bull.image_yscale=1.5; - } - if (string_count("Lance",wep)==1){ - bull.sprite_index=spr_ground_las; - bull.image_xscale=1.5; - bull.image_yscale=1.5; - } - if (string_count("Ion",wep)==1){ - bull.sprite_index=spr_pulse; - bull.image_xscale=1.5; - bull.image_yscale=1.5; - } - if (string_count("Rail",wep)==1){ - bull.sprite_index=spr_railgun; - bull.image_xscale=1.5; - bull.image_yscale=1.5; - } - if (string_count("Gravitic",wep)==1){ - bull.image_xscale=2; - bull.image_yscale=2; - } - if (string_count("Plasma",wep)==1){ - bull.sprite_index=spr_ground_plasma; - bull.image_xscale=2; - bullimage_yscale=2; - bull.speed=15; - } - if (string_count("Pyro-Acid",wep)==1){ - bull.sprite_index=spr_glob; - bull.image_xscale=2; - bullimage_yscale=2; - } - if (string_count("Weapons",wep)==1) and (owner = eFACTION.Eldar){ - bull.sprite_index=spr_ground_las; - bull.image_xscale=2; - bull.image_yscale=2; - } - if (string_count("Pulse",wep)==1) and (owner = eFACTION.Eldar){ - bull.sprite_index=spr_pulse; - bull.image_xscale=1.5; - bull.image_yscale=1.5; - } - } - if (string_count("orpedo",wep)==1) and (ok==3){ - if (class!="Ravager"){ - bull=instance_create(x,y+lengthdir_y(-30,direction+90),obj_al_round); - bull.speed=10; - bull.direction=direction; - bull.sprite_index=spr_torpedo; - bull.dam=dam; - } - bull=instance_create(x,y+lengthdir_y(-10,direction+90),obj_al_round); - bull.speed=10; - bull.direction=direction; - bull.sprite_index=spr_torpedo; - bull.dam=dam; - bull=instance_create(x,y+lengthdir_y(10,direction+90),obj_al_round); - bull.speed=10; - bull.direction=direction; - bull.sprite_index=spr_torpedo; - bull.dam=dam; - if (class!="Ravager"){ - bull=instance_create(x,y+lengthdir_y(30,direction+90),obj_al_round); - bull.speed=10; - bull.direction=direction; - bull.sprite_index=spr_torpedo; - bull.dam=dam; - } - } - if ((string_count("Claws",wep)==1) or (string_count("endrils",wep)==1)) and (ok==3){ - if (target.shields<=0) then target.hp-=weapon_dam[wep]; - if (target.shields>0) then target.shields-=weapon_dam[wep]; - } - if ((string_count("Interceptor",wep)==1) or (string_count("ommerz",wep)==1) or (string_count("Manta",wep)==1) or (string_count("Glands",wep)==1) or (string_count("Eldar Launch",wep)==1)) and (ok==3){ - bull=instance_create(x,y+lengthdir_y(-30,direction+90),obj_al_in); - bull.direction=self.direction; - bull.owner=self.owner; - } - } - } + ship_shoot_weapons(); } } diff --git a/objects/obj_al_ship/obj_al_ship.yy b/objects/obj_al_ship/obj_al_ship.yy index e6be455e47..637e2f3fde 100644 --- a/objects/obj_al_ship/obj_al_ship.yy +++ b/objects/obj_al_ship/obj_al_ship.yy @@ -3,7 +3,6 @@ "%Name":"obj_al_ship", "eventList":[ {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":3,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, ], diff --git a/objects/obj_bomb_select/Alarm_1.gml b/objects/obj_bomb_select/Alarm_1.gml index b3d421e8ce..6746c4b1cc 100644 --- a/objects/obj_bomb_select/Alarm_1.gml +++ b/objects/obj_bomb_select/Alarm_1.gml @@ -13,10 +13,11 @@ bomb_b = _total_fleet_loaded; bomb_c = _total_fleet_loaded; for (var i=0;i 0){ array_push(ship_ide, _ships[i]); - array_push(ship_max, obj_ini.ship_carrying[_ships[i]]); - array_push(ship, obj_ini.ship[_ships[i]]); + array_push(ship_max, _ship.carrying); + array_push(ship, _ship.name); array_push(ship_use, 0); array_push(ship_all, 0); } diff --git a/objects/obj_bomb_select/Alarm_4.gml b/objects/obj_bomb_select/Alarm_4.gml deleted file mode 100644 index a047d8f63d..0000000000 --- a/objects/obj_bomb_select/Alarm_4.gml +++ /dev/null @@ -1,42 +0,0 @@ -// Sets the targets for the ships, handles bombardment -for(var i=0; i<31; i++){ - ship[i]=""; - ship_all[i]=0; - ship_use[i]=0; - ship_max[i]=0; - ship_ide[i]=-1; -} - -max_ships=sh_target.capital_number+sh_target.frigate_number+sh_target.escort_number; - -var tump=0; - -var i=-1; -for(var b=0; b0)and (instance_exists(obj_star_select)){ bomb_score = 0; for(var i=0; i=chaos_turn) then repeat(times){ if (_star.p_type[plani]!="Dead") and (_star.planets>0) and (turn>=20){ var cathedral=0; - if (planet_feature_bool(_star.p_feature[plani], P_features.Sororitas_Cathedral)==1) then cathedral=choose(0,1,1); + if (planet_feature_bool(_star.p_feature[plani], P_features.SororitasCathedral)==1) then cathedral=choose(0,1,1); if (cathedral=0){ if (_star.p_heresy[plani]>=0) and (_star.p_heresy[plani]<10){ @@ -268,12 +268,9 @@ for (var c = 0; c < 11; c++){ // STC Bonuses if (obj_controller.stc_ships>=6){ //self healing ships logic - for (var v=0; v0) and (turns_ignored[i]<500) then turns_ignored[i]-=1; + if (turns_ignored[i]<500){ + turns_ignored[i] = clamp(turns_ignored[i]-1, 0, 500); + } } if (known[eFACTION.Eldar]>=2) and (faction_gender[6]==2) and (turn%10==0) then turns_ignored[6]+=floor(random_range(0,6)); @@ -469,37 +466,38 @@ with(obj_ground_mission){instance_destroy();} scr_random_event(true); // ** Random events here ** -if (hurssy_time>0) and (hurssy>0) then hurssy_time-=1; +if (hurssy_time>0) and (hurssy>0){ + hurssy_time-=1; +} if (hurssy_time==0) and (hurssy>0){hurssy_time=-1;hurssy=0;} with(obj_p_fleet){ - if (hurssy_time>0) and (hurssy>0) then hurssy_time-=1; - if (hurssy_time==0) and (hurssy>0){hurssy_time=-1;hurssy=0;} -} -with(obj_star){ - if (p_hurssy_time[1]>0) and (p_hurssy[1]>0) then p_hurssy_time[1]-=1; - if (p_hurssy_time[1]==0) and (p_hurssy[1]>0){ - p_hurssy_time[1]=-1; - p_hurssy[1]=0; - } - if (p_hurssy_time[2]>0) and (p_hurssy[2]>0) then p_hurssy_time[2]-=1; - if (p_hurssy_time[2]==0) and (p_hurssy[2]>0){ - p_hurssy_time[2]=-1; - p_hurssy[2]=0; + if (hurssy_time>0) and (hurssy>0){ + hurssy_time-=1; } - if (p_hurssy_time[3]>0) and (p_hurssy[3]>0) then p_hurssy_time[3]-=1; - if (p_hurssy_time[3]=0) and (p_hurssy[3]>0){ - p_hurssy_time[3]=-1; - p_hurssy[3]=0; + if (hurssy_time==0) and (hurssy>0){ + hurssy_time=-1; + hurssy=0; } - if (p_hurssy_time[4]>0) and (p_hurssy[4]>0) then p_hurssy_time[4]-=1; - if (p_hurssy_time[4]==0) and (p_hurssy[4]>0){ - p_hurssy_time[4]=-1; - p_hurssy[4]=0; +} +with(obj_star){ + for (var i=1;i<=planets;i++){ + if (p_hurssy[i]<=0){ + continue; + } + if (p_hurssy_time[i]>0) { + p_hurssy_time[i]-=1; + } + if (p_hurssy_time[i]==0) { + p_hurssy_time[i]=-1; + p_hurssy[i]=0; + } } } if (turn==2){ - if (obj_ini.master_name=="Zakis Randi") or (global.chapter_name=="Knights Inductor") and (obj_controller.faction_status[eFACTION.Imperium]!="War") then alarm[8]=1; + if (obj_ini.master_name=="Zakis Randi") or (global.chapter_name=="Knights Inductor") and (obj_controller.faction_status[eFACTION.Imperium]!="War"){ + alarm[8]=1; + } } // ** Player-set events ** if (fest_scheduled>0) and (fest_repeats>0){ @@ -507,7 +505,7 @@ if (fest_scheduled>0) and (fest_repeats>0){ fest_repeats-=1; lock=scr_master_loc(); - if (fest_sid>0) and (obj_ini.ship[fest_sid]=lock) then cm_present=true; + if (fest_sid>0) and (obj_ini.ship_data[fest_sid].name=lock) then cm_present=true; if (fest_wid>0) and (string(fest_star)+"."+string(fest_wid)=lock) then cm_present=true; if (cm_present==true){ @@ -522,7 +520,7 @@ if (fest_scheduled>0) and (fest_repeats>0){ if (fest_type=="Triumphal March") then imag="event_march"; if (fest_wid>0) then scr_popup("Scheduled Event","Your "+string(fest_type)+" takes place on "+string(fest_star)+" "+scr_roman(fest_wid)+". Would you like to spectate the event?",imag,""); - if (fest_sid>0) then scr_popup("Scheduled Event","Your "+string(fest_type)+" takes place on the ship '"+string(obj_ini.ship[fest_sid])+". Would you like to spectate the event?",imag,""); + if (fest_sid>0) then scr_popup("Scheduled Event","Your "+string(fest_type)+" takes place on the ship '"+string(obj_ini.ship_data[fest_sid].name)+". Would you like to spectate the event?",imag,""); } } @@ -550,7 +548,7 @@ init_ork_waagh(); return_lost_ships_chance(); //complex route plotting for player fleets with (obj_p_fleet){ - if (array_length(complex_route)>0 && action == ""){ + if (array_length(complex_route) > 0 && action == ""){ set_new_player_fleet_course(complex_route); } } @@ -565,3 +563,9 @@ if (helpful_places != false){ instance_activate_object(obj_star); instance_activate_object(obj_en_fleet); + +// Right here need to sort the battles within the obj_turn_end +with(obj_turn_end){ + end_turn_battle_next_sequence(true, 20); +} + diff --git a/objects/obj_controller/Create_0.gml b/objects/obj_controller/Create_0.gml index 7ffe555bca..84380f9751 100644 --- a/objects/obj_controller/Create_0.gml +++ b/objects/obj_controller/Create_0.gml @@ -572,19 +572,16 @@ stc_un_total=0; stc_wargear_un=0; stc_vehicles_un=0; stc_ships_un=0; -stc_bonus[0]=0; -stc_bonus[1]=0; -stc_bonus[2]=0; -stc_bonus[3]=0; -stc_bonus[4]=0; -stc_bonus[5]=0; -stc_bonus[6]=0; +stc_bonus = array_create(7,0); + stc_research = { wargear:0, vehicles:0, ships:0, research_focus:"wargear", } + +flagship = 0; // ** Resets the years ** check_number=0; year_fraction=0; @@ -1009,35 +1006,10 @@ annoyed = array_create(14, 0); // ** Sets diplomacy ignore status ** ignore = array_create(14, 0); // ** Sets diplomacy turns to be ignored ** -turns_ignored[0]=0; -turns_ignored[1]=0; -turns_ignored[2]=0; -turns_ignored[3]=0; -turns_ignored[4]=0; -turns_ignored[5]=0; -turns_ignored[6]=0; -turns_ignored[7]=0; -turns_ignored[8]=0; -turns_ignored[9]=0; -turns_ignored[10]=0; -turns_ignored[11]=0; -turns_ignored[12]=0; -turns_ignored[13]=0; +turns_ignored = array_create(15, 0); + // ** Sets faction defeated ** -faction_defeated[0]=0; -faction_defeated[1]=0; -faction_defeated[2]=0; -faction_defeated[3]=0; -faction_defeated[4]=0; -faction_defeated[5]=0; -faction_defeated[6]=0; -faction_defeated[7]=0; -faction_defeated[8]=0; -faction_defeated[9]=0; -faction_defeated[10]=0; -faction_defeated[11]=0; -faction_defeated[12]=0; -faction_defeated[13]=0; +faction_defeated = array_create(15, 0); // **** CHAPTER CREATION VARS **** // ** Sets up Chapter configuration variables ** @@ -1108,7 +1080,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,obj_ini.ship_data[0].name,501); } } // TODO should add special bonus to different chapters based on lore @@ -1208,7 +1180,7 @@ if (global.load>=0){ -var xx,yy,me,dist,go,planet; +var xx,yy,me,target_distance,go,planet; global.custom=eCHAPTER_TYPE.RANDOM; // ** Sets up base training level and trainees at game start ** @@ -1503,26 +1475,29 @@ 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=xx+953) and (mouse_x>=yy+84+(i*20)) and (mouse_x0) or ((diplomacy<-5) and (diplomacy>-6)) and (cooldown<=0) and (diplomacy<10){ diff --git a/objects/obj_controller/Step_0.gml b/objects/obj_controller/Step_0.gml index 10b599d842..4aebc43569 100644 --- a/objects/obj_controller/Step_0.gml +++ b/objects/obj_controller/Step_0.gml @@ -522,9 +522,10 @@ 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]; + for (var i = 0; i < array_length(obj_ini.ship_data); i++) { + var _ship = obj_ini.ship_data[selecting_ship]; + if ((c.location != "Warp") && (_ship.location != "Lost")) { + _ship.hp = _ship.max_hp; } } // TODO need something here to veryify that the ships are within a friendly star system @@ -533,7 +534,7 @@ try { if (unload > 0) { cooldown = 8; var b = selecting_ship; - + var _ship = obj_ini.ship_data[b]; var unit, company, unit_id; 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)) { @@ -549,12 +550,10 @@ try { } unit_id = unit.marine_number; company = unit.company; - unit.location_string = obj_ini.ship_location[b]; + unit.location_string = _ship.location; unit.ship_location = -1; unit.planet_location = unload; - obj_ini.uid[company][unit_id] = 0; - - ma_loc[q] = obj_ini.ship_location[b]; + ma_loc[q] = _ship.location; ma_lid[q] = -1; ma_wid[q] = unload; } else if ((man[q] == "vehicle") && (ma_loc[q] == selecting_location) && (ma_wid[q] < 1) && (man_sel[q] != 0)) { @@ -563,12 +562,12 @@ try { } 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_loc[company][unit_id] = _ship.location; obj_ini.veh_lid[company][unit_id] = -1; 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_loc[q] = _ship.location; ma_lid[q] = -1; ma_wid[q] = unload; } @@ -577,8 +576,8 @@ try { 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; + if (b > -1 && b < array_length(obj_ini.ship_data)) { + obj_ini.ship_data[b].carrying -= man_size; } reset_ship_manage_arrays(); cooldown = 10; diff --git a/objects/obj_controller/obj_controller.yy b/objects/obj_controller/obj_controller.yy index 5bcf8c48b1..fe87b5252d 100644 --- a/objects/obj_controller/obj_controller.yy +++ b/objects/obj_controller/obj_controller.yy @@ -8,10 +8,7 @@ {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":6,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":5,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":4,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":3,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":2,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":1,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":3,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":84,"eventType":5,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":61,"eventType":6,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, diff --git a/objects/obj_defeat/Draw_0.gml b/objects/obj_defeat/Draw_64.gml similarity index 89% rename from objects/obj_defeat/Draw_0.gml rename to objects/obj_defeat/Draw_64.gml index 8fffcf8417..a56fc0f228 100644 --- a/objects/obj_defeat/Draw_0.gml +++ b/objects/obj_defeat/Draw_64.gml @@ -1,4 +1,3 @@ - draw_set_alpha(1); // draw_sprite(spr_defeat,global.defeat,331,73); scr_image("defeat",global.defeat,331,73,938,554); @@ -19,6 +18,4 @@ draw_set_color(c_black); draw_set_alpha(fade/faded); draw_rectangle(0,0,room_width,room_height,0); draw_set_alpha(fadeout/30); -draw_rectangle(0,0,room_width,room_height,0); - - +draw_rectangle(0,0,room_width,room_height,0); \ No newline at end of file diff --git a/objects/obj_defeat/KeyPress_13.gml b/objects/obj_defeat/KeyPress_13.gml index aa04db2e7a..ea9a5fa85c 100644 --- a/objects/obj_defeat/KeyPress_13.gml +++ b/objects/obj_defeat/KeyPress_13.gml @@ -1,6 +1,4 @@ -var __b__; -__b__ = action_if_variable(fade, 0, 3); -if __b__ -{ -goodbye = 1; + +if (fade <= 0){ + goodbye = 1; } diff --git a/objects/obj_defeat/obj_defeat.yy b/objects/obj_defeat/obj_defeat.yy index de66a6039e..69b5b02793 100644 --- a/objects/obj_defeat/obj_defeat.yy +++ b/objects/obj_defeat/obj_defeat.yy @@ -4,8 +4,8 @@ "eventList":[ {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":3,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":13,"eventType":9,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, ], "managed":true, "name":"obj_defeat", diff --git a/objects/obj_drop_select/Alarm_2.gml b/objects/obj_drop_select/Alarm_2.gml deleted file mode 100644 index f58e7404dc..0000000000 --- a/objects/obj_drop_select/Alarm_2.gml +++ /dev/null @@ -1,62 +0,0 @@ - -var i;i=-1; -repeat(31){ - i+=1; - ship[i]=""; - ship_all[i]=0; - ship_use[i]=0; - ship_max[i]=0; - ship_ide[i]=-1; -} - -max_ships=0; -if (sh_target!=-50){ - max_ships=sh_target.capital_number+sh_target.frigate_number+sh_target.escort_number; -} - - -if (ship_max[500]!=0) then max_ships+=1; - -ship_all[500]=0; -ship_use[500]=0; -if (l_size>0) then l_size=l_size*-1; - - - -if (sh_target!=-50){ - var tump = 0; - var i = 0; - for (var q = 0; q < sh_target.capital_number; q++){ - if (sh_target.capital[q]!="") and (obj_ini.ship_carrying[sh_target.capital_num[q]]>0){ - ship[i]=sh_target.capital[i]; - ship_use[i]=0; - tump=sh_target.capital_num[i]; - ship_max[i]=obj_ini.ship_carrying[tump]; - ship_ide[i]=tump; - ship_size[i]=3; - i+=1; - } - } - for (var q = 0; q < sh_target.frigate_number; q++) { - if (sh_target.frigate[q]!="") and (obj_ini.ship_carrying[sh_target.frigate_num[q]]>0){ - ship[i]=sh_target.frigate[q]; - ship_use[i]=0; - tump=sh_target.frigate_num[q]; - ship_max[i]=obj_ini.ship_carrying[tump]; - ship_ide[i]=tump; - ship_size[i]=2; - i+=1; - } - } - for (var q = 0; q < sh_target.escort_number; q++) { - if (sh_target.escort[q]!="") and (obj_ini.ship_carrying[sh_target.escort_num[q]]>0){ - ship[i]=sh_target.escort[q]; - ship_use[i]=0; - tump=sh_target.escort_num[q]; - ship_max[i]=obj_ini.ship_carrying[tump]; - ship_ide[i]=tump; - ship_size[i]=1; - i+=1; - } - } -} diff --git a/objects/obj_drop_select/Alarm_3.gml b/objects/obj_drop_select/Alarm_3.gml deleted file mode 100644 index 7b04af3c23..0000000000 --- a/objects/obj_drop_select/Alarm_3.gml +++ /dev/null @@ -1,71 +0,0 @@ -var i;i=-1; -repeat(61){ - i+=1; - ship[i]=""; - ship_all[i]=0; - ship_use[i]=0; - ship_max[i]=0; - ship_ide[i]=-1; -} - -max_ships=0; - - -if (sh_target!=-50){ - max_ships=sh_target.capital_number+sh_target.frigate_number+sh_target.escort_number; - - - var tump;tump=0; - - var i, q, b;i=0;q=0;b=0; - repeat(sh_target.capital_number){ - b+=1; - if (sh_target.capital[b]!=""){ - i+=1; - ship[i]=sh_target.capital[i]; - - ship_use[i]=0; - tump=sh_target.capital_num[i]; - ship_max[i]=obj_ini.ship_carrying[tump]; - ship_ide[i]=tump; - ship_size[i]=3; - - purge_a+=3; - purge_b+=ship_max[i];purge_c+=ship_max[i]; - } - } - q=0; - repeat(sh_target.frigate_number){ - q+=1; - if (sh_target.frigate[q]!=""){ - i+=1; - ship[i]=sh_target.frigate[q]; - - ship_use[i]=0; - tump=sh_target.frigate_num[q]; - ship_max[i]=obj_ini.ship_carrying[tump]; - ship_ide[i]=tump; - ship_size[i]=2; - - purge_a+=1; - purge_b+=ship_max[i];purge_c+=ship_max[i]; - } - } - q=0; - repeat(sh_target.escort_number){ - q+=1; - if (sh_target.escort[q]!="") and (obj_ini.ship_carrying[sh_target.escort_num[q]]>0){ - i+=1; - ship[i]=sh_target.escort[q]; - - ship_use[i]=0; - tump=sh_target.escort_num[q]; - ship_max[i]=obj_ini.ship_carrying[tump]; - ship_ide[i]=tump; - ship_size[i]=1; - - purge_b+=ship_max[i];purge_c+=ship_max[i]; - } - } -} - diff --git a/objects/obj_drop_select/Alarm_4.gml b/objects/obj_drop_select/Alarm_4.gml index 9236122bdd..65ab19b455 100644 --- a/objects/obj_drop_select/Alarm_4.gml +++ b/objects/obj_drop_select/Alarm_4.gml @@ -19,42 +19,21 @@ if (sh_target!=-50){ max_ships=sh_target.capital_number+sh_target.frigate_number+sh_target.escort_number; - var tump;tump=0; - - var i, q, b;i=0;q=0;b=0; - repeat(sh_target.capital_number){ - b+=1; - if (sh_target.capital[b]!=""){ - i+=1; - ship[i]=sh_target.capital[i]; - + var i = 0; + var _ships = fleet_full_ship_array(sh_target); + for (var q = 0; q < array_length(_ships); q++){ + var _ship_id = _ships[q]; + var _ship = _ships[_ship_id]; + if (_ship.carrying){ + ship[i]=_ship.name; ship_use[i]=0; - tump=sh_target.capital_num[i]; - ship_max[i]=obj_ini.ship_carrying[tump]; - ship_ide[i]=tump; - ship_size[i]=3; - - purge_a+=3; - purge_b+=ship_max[i]; - purge_c+=ship_max[i]; - } - } - q=0; - repeat(sh_target.frigate_number){ - q+=1; - if (sh_target.frigate[q]!=""){ + ship_max[i]=_ship.carrying; + ship_ide[i]=_ship_id; + purge_a += ship_bombard_score(_ship_id); + purge_b += ship_max[i]; + purge_c += ship_max[i]; i+=1; - ship[i]=sh_target.frigate[q]; - - ship_use[i]=0; - tump=sh_target.frigate_num[q]; - ship_max[i]=obj_ini.ship_carrying[tump]; - ship_ide[i]=tump; - ship_size[i]=2; - - purge_a+=1; - purge_b+=ship_max[i];purge_c+=ship_max[i]; - } + } } } diff --git a/objects/obj_drop_select/Create_0.gml b/objects/obj_drop_select/Create_0.gml index 4668c55940..9aec1c27bc 100644 --- a/objects/obj_drop_select/Create_0.gml +++ b/objects/obj_drop_select/Create_0.gml @@ -63,7 +63,7 @@ if (action_if_number(obj_saveload, 0, 0)){ var i=-1; - var _ship_index = array_length(obj_ini.ship); + var _ship_index = array_length(obj_ini.ship_data); ship=array_create(_ship_index, ""); ship_size=array_create(_ship_index, 0); ship_all=array_create(_ship_index, 0); @@ -73,7 +73,6 @@ if (action_if_number(obj_saveload, 0, 0)){ i=500; ship[i]="Local"; - ship_size[i]=0; ship_all[i]=0; ship_use[i]=0; ship_max[i]=0; diff --git a/objects/obj_drop_select/obj_drop_select.yy b/objects/obj_drop_select/obj_drop_select.yy index 53c940d64f..e3354546de 100644 --- a/objects/obj_drop_select/obj_drop_select.yy +++ b/objects/obj_drop_select/obj_drop_select.yy @@ -6,8 +6,6 @@ {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":6,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":5,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":4,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":3,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":2,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":1,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":3,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":56,"eventType":6,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, diff --git a/objects/obj_dropdown_sel/Draw_0.gml b/objects/obj_dropdown_sel/Draw_0.gml index 9ca101db53..ee489728e7 100644 --- a/objects/obj_dropdown_sel/Draw_0.gml +++ b/objects/obj_dropdown_sel/Draw_0.gml @@ -104,8 +104,8 @@ if (opened=1){ obj_controller.fest_sid=option_id[ii]; obj_controller.fest_wid=0; if (option_id[ii]>0){ - if (obj_controller.fest_warp=0) and (obj_ini.ship_location[option_id[ii]]="Warp") then obj_controller.fest_warp=1; - if (obj_controller.fest_warp=1) and (obj_ini.ship_location[option_id[ii]]!="Warp") then obj_controller.fest_warp=0; + var _ship = obj_ini.ship_data[option_id[ii]]; + obj_controller.fest_warp = _ship.location == "Warp"; obj_controller.fest_attend=scr_event_dudes(0,0,"",option_id[ii]); } if (option[ii]="None Selected"){obj_controller.fest_sid=0;obj_controller.fest_attend="";} diff --git a/objects/obj_dropdown_sel/Step_0.gml b/objects/obj_dropdown_sel/Step_0.gml index 63bfafdc4e..6bc16b02b0 100644 --- a/objects/obj_dropdown_sel/Step_0.gml +++ b/objects/obj_dropdown_sel/Step_0.gml @@ -160,9 +160,15 @@ if (option[1]=""){ // Present ship options if (obj_controller.fest_planet=0){ - repeat(70){q+=1;thatone=false; - if (obj_ini.ship[q]!="") and (obj_ini.ship_carrying[q]>0){ - works+=1;option[works]=obj_ini.ship[q];option_id[works]=q;options+=1;thatone=false; + for(q=0;qfrigate_number){ - capital_number-=1;frigate_number+=2; - } - - if (capital_number*4>escort_number){ - var rand; - rand=choose(1,2,3,4); - if (rand=4) then escort_number+=1; - } - - - - if (capital_number>0){ - var capitals_engaged=0; - with (orbiting){ - for (var i=1;i5) then n=5; - - instance_deactivate_object(orbiting); - - repeat(100){ - if (good!=5){ - xx=self.x+random_range(-300,300); - yy=self.y+random_range(-300,300); - if (good=0) then plin=instance_nearest(xx,yy,obj_star); - if (good=1) and (n=5) then plin2=instance_nearest(xx,yy,obj_star); - - good = !array_contains(plin.p_type, "dead"); - - if (good=1) and (n=5){ - if (!instance_exists(plin2)) then exit; - if (!array_contains(plin.p_type, "dead")) then good++ - - var new_fleet; - new_fleet=instance_create(x,y,obj_en_fleet); - new_fleet.capital_number=floor(capital_number*0.4); - new_fleet.frigate_number=floor(frigate_number*0.4); - new_fleet.escort_number=floor(escort_number*0.4); - - capital_number-=new_fleet.capital_number; - frigate_number-=new_fleet.frigate_number; - escort_number-=new_fleet.escort_number; - - new_fleet.owner=eFACTION.Tyranids; - new_fleet.sprite_index=spr_fleet_tyranid; - new_fleet.image_index=1; - - /*with(new_fleet){ - var ii;ii=0;ii+=capital_number;ii+=round((frigate_number/2));ii+=round((escort_number/4)); - if (ii<=1) then ii=1;image_index=ii; - }*/ - - new_fleet.action_x=plin2.x; - new_fleet.action_y=plin2.y; - with(new_fleet){ - set_fleet_movement(); - } - break; - } - - - if (good=1) and (instance_exists(plin)){ - action_x=plin.x; - action_y=plin.y; - set_fleet_movement(); - if (n!=5) then good=5; - } - } - } - instance_activate_object(obj_star); - } + if (owner = eFACTION.Tyranids) {// Juggle sbio-resources + tyranid_fleet_planet_action(); } } diff --git a/objects/obj_en_fleet/Alarm_4.gml b/objects/obj_en_fleet/Alarm_4.gml index 5e07d20081..172a947d23 100644 --- a/objects/obj_en_fleet/Alarm_4.gml +++ b/objects/obj_en_fleet/Alarm_4.gml @@ -11,10 +11,13 @@ if (action!=""){ mine=instance_nearest(x,y,obj_star); if (mine.x=sys.x2) and (mine.y=sys.y2) then connected=1; - var eta;eta=0; - eta=floor(point_distance(x,y,action_x,action_y)/action_spd)+1; - if (connected=0) then eta=eta*2; - if (connected=1) then connected=1; + var _eta=0; + _eta=floor(point_distance(x,y,action_x,action_y)/action_spd)+1; + if (connected=0){ + _eta=_eta*2; + } else { + connected=1; + } if (owner=eFACTION.Inquisition) and (action_eta<2) then action_eta=2; // action_x=sys.x; @@ -62,7 +65,7 @@ if (action==""){ if (cont=20){// Move the entire fleet, don't worry about the other crap turns_static = 0; - var eta=0; + var _eta=0; if (trade_goods!="") and (owner != eFACTION.Tyranids) and (owner != eFACTION.Chaos) and (string_count("Inqis",trade_goods)=0) and (string_count("merge",trade_goods)=0)and (string_count("_her",trade_goods)=0) and (trade_goods!="cancel_inspection") and (trade_goods!="return"){ if (scr_valid_fleet_target(target)){ @@ -78,12 +81,12 @@ if (action==""){ } } - eta=floor(point_distance(x,y,action_x,action_y)/action_spd)+1; - if (connected=0) then eta=eta*2; + _eta=floor(point_distance(x,y,action_x,action_y)/action_spd)+1; + if (connected=0) then _eta=_eta*2; if (connected=1) then connected=1; if (action_eta<=0) or (owner != eFACTION.Inquisition){ - action_eta=eta; + action_eta=_eta; if (owner = eFACTION.Inquisition) and (action_eta<2) and (string_count("_her",trade_goods)=0) then action_eta=2; } diff --git a/objects/obj_en_fleet/Step_0.gml b/objects/obj_en_fleet/Step_0.gml index 00144c38dc..18f4de7ca0 100644 --- a/objects/obj_en_fleet/Step_0.gml +++ b/objects/obj_en_fleet/Step_0.gml @@ -49,14 +49,14 @@ if (ii_check=0){ } -if (owner = eFACTION.Tyranids){ +/*if (owner = eFACTION.Tyranids){ image_alpha=0; if (instance_exists(obj_p_fleet)){ - var bundy;bundy=instance_nearest(x,y,obj_p_fleet); + var bundy=instance_nearest(x,y,obj_p_fleet); if (bundy.action="") and (self.action="") and (point_distance(bundy.x,bundy.y,x,y)<90) and (bundy.x>x) and (bundy.y0) then cooldown1-=1; -var dist, range; +var target_distance, range; if (instance_exists(target)){ - dist=point_distance(x,y,target.x,target.y); + target_distance=point_distance(x,y,target.x,target.y); range=100+max(sprite_get_width(target.sprite_index),sprite_get_height(target.sprite_index)); if (action="close"){speed=4;direction=turn_towards_point(direction,x,y,target.x,target.y,6);} - if (dist100) and (action="close") then action="shoot"; - if (action="shoot") and (dist>range) then action="close"; - if (dist<80) and (action="shoot") then action="bank"; + if (target_distance100) and (action="close") then action="shoot"; + if (action="shoot") and (target_distance>range) then action="close"; + if (target_distance<80) and (action="shoot") then action="bank"; if (action="bank") then direction=turn_towards_point(direction,x,y,room_width,room_height/2,3); - if (action="bank") and (dist>300) then action="close"; + if (action="bank") and (target_distance>300) then action="close"; if (action="shoot") and (cooldown1<=0){ - var bull;cooldown1=30;if (owner = eFACTION.Tau) then cooldown1=20; + var bull; + cooldown1=30; + if (owner = eFACTION.Tau) then cooldown1=20; bull=instance_create(x,y,obj_en_round);bull.direction=self.direction; if (owner = eFACTION.Tau) or (owner = eFACTION.Eldar) then bull.sprite_index=spr_pulse; if (owner = eFACTION.Tyranids) then bull.sprite_index=spr_glob; - bull.speed=20;bull.image_xscale=0.5;bull.image_yscale=0.5;bull.dam=3; + bull.speed=20; + bull.image_xscale=0.5; + bull.image_yscale=0.5;bull.dam=3; if (owner = eFACTION.Ork) then bull.dam=2; + bull.explosion_sprite = spr_explosion; } } diff --git a/objects/obj_en_round/Collision_obj_al_ship.gml b/objects/obj_en_round/Collision_obj_al_ship.gml index a07e8ce3c9..e6918d728a 100644 --- a/objects/obj_en_round/Collision_obj_al_ship.gml +++ b/objects/obj_en_round/Collision_obj_al_ship.gml @@ -1,21 +1,2 @@ - - - -var arm; -arm=other.armour_front; - -if (arm0) then other.shields-=dam/2; - if (other.shields<=0) then other.hp-=dam/2; -} - -if (arm>dam) and (other.shields>0) then other.shields-=0.5; -if (arm>dam) and (other.shields<=0) then other.hp-=0.5; - -if (sprite_index=spr_torpedo){ - instance_create(x,y,obj_explosion); -} - -instance_destroy(); +round_collision_with_ship(); diff --git a/objects/obj_en_round/Collision_obj_p_ship.gml b/objects/obj_en_round/Collision_obj_p_ship.gml index ca69454d04..e6918d728a 100644 --- a/objects/obj_en_round/Collision_obj_p_ship.gml +++ b/objects/obj_en_round/Collision_obj_p_ship.gml @@ -1,27 +1,2 @@ - - - -var arm; -arm=other.armour_front; - -var t1;t1=0; -if (obj_fleet.global_defense!=1){ - t1=1-(obj_fleet.global_defense-1); - dam=dam*t1; -} - -if (arm0) then other.shields-=dam; - if (other.shields<=0) then other.hp-=dam; -} - -if (arm>dam) and (other.shields>0) then other.shields-=1; -if (arm>dam) and (other.shields<=0) then other.hp-=1; - -if (sprite_index=spr_torpedo){ - instance_create(x,y,obj_explosion); -} - -instance_destroy(); +round_collision_with_ship(); diff --git a/objects/obj_en_round/Create_0.gml b/objects/obj_en_round/Create_0.gml index 8c524b1e31..a494bf6d3b 100644 --- a/objects/obj_en_round/Create_0.gml +++ b/objects/obj_en_round/Create_0.gml @@ -1,3 +1,4 @@ dam = 0; image_angle=direction; +explosion_sprite = spr_explosion; diff --git a/objects/obj_en_round/Step_0.gml b/objects/obj_en_round/Step_0.gml index ec58b7cc89..7b2cf3f60d 100644 --- a/objects/obj_en_round/Step_0.gml +++ b/objects/obj_en_round/Step_0.gml @@ -1,20 +1,4 @@ -image_angle=direction; - -if (x<-1000) or (x>room_width+1000) or (y<-1000) or (y>room_height+1000) then instance_destroy(); - -var th, thd; -if (dam<=4){ - if (instance_exists(obj_p_small)){ - th=instance_nearest(x,y,obj_p_small); - thd=point_distance(x,y,th.x,th.y); - if (thd<6){th.hp-=(self.dam-1);instance_destroy();} - } - if (instance_exists(obj_al_in)){ - th=instance_nearest(x,y,obj_al_in); - thd=point_distance(x,y,th.x,th.y); - if (thd<6){th.hp-=(self.dam-1);instance_destroy();} - } -} +round_step_logic(); diff --git a/objects/obj_en_ship/Alarm_0.gml b/objects/obj_en_ship/Alarm_0.gml deleted file mode 100644 index ce2ca6378e..0000000000 --- a/objects/obj_en_ship/Alarm_0.gml +++ /dev/null @@ -1,1286 +0,0 @@ - - -cooldown[1]=0; - -cooldown[2]=0; - -cooldown[3]=0; - -cooldown[4]=0; - -cooldown[5]=0; - - - -if (class="Apocalypse Class Battleship"){sprite_index=spr_ship_apoc; - ship_size=3; - - name=""; - hp=1200; - maxhp=1200; - conditions=""; - shields=400; - maxshields=400; - leadership=90; - - armour_front=6; - armour_other=5; - weapons=4; - turrets=4; - capacity=150; - carrying=0; - - weapon[1]="Lance Battery"; - weapon_facing[1]="left"; - weapon_dam[1]=14; - weapon_range[1]=300; - weapon_cooldown[1]=30; - - weapon[2]="Lance Battery"; - weapon_facing[2]="right"; - weapon_dam[2]=14; - weapon_range[2]=300; - weapon_cooldown[2]=30; - - weapon[3]="Nova Cannon"; - weapon_facing[3]="front"; - weapon_dam[3]=34; - weapon_range[3]=1500; - weapon_minrange[3]=300; - weapon_cooldown[3]=120; - - weapon[4]="Weapons Battery"; - weapon_facing[4]="most"; - weapon_dam[4]=14; - weapon_range[4]=600; - weapon_cooldown[4]=20; - -} - -if (class="Nemesis Class Fleet Carrier"){sprite_index=spr_ship_nem; - ship_size=3; - - name=""; - hp=1000; - maxhp=1000; - conditions=""; - shields=400; - maxshields=400; - leadership=85; - - armour_front=5; - armour_other=5; - weapons=3; - turrets=5; - capacity=100; - carrying=24; - - weapon[1]="Interceptor Launch Bays"; - weapon_facing[1]="special"; - weapon_range[1]=9999; - weapon_ammo[1]=6; - weapon_cooldown[1]=120; - - weapon[2]="Interceptor Launch Bays"; - weapon_facing[2]="special"; - weapon_range[2]=9999; - weapon_ammo[2]=6; - weapon_cooldown[2]=120; - cooldown[2]=30; - - weapon[3]="Lance Battery"; - weapon_facing[3]="front"; - weapon_dam[3]=14; - weapon_range[3]=300; - weapon_cooldown[3]=30; - -} - -if (class="Avenger Class Grand Cruiser"){sprite_index=spr_ship_aven; - ship_size=2; - - name=""; - hp=1000; - maxhp=1000; - conditions=""; - shields=300; - maxshields=300; - leadership=85; - - armour_front=5; - armour_other=5; - weapons=2; - turrets=3; - capacity=50; - carrying=0; - - weapon[1]="Lance Battery"; - weapon_facing[1]="most"; - weapon_dam[1]=14; - weapon_range[1]=300; - weapon_cooldown[1]=25; - - // weapon[1]="Lance Battery"; - weapon_facing[1]="left"; - weapon_dam[1]=14; - weapon_range[1]=300; - weapon_cooldown[1]=25; - - // weapon[2]="Lance Battery"; - weapon_facing[2]="right"; - weapon_dam[2]=14; - weapon_range[2]=300; - weapon_cooldown[2]=25; - -} - -if (class="Sword Class Frigate"){sprite_index=spr_ship_sword; - ship_size=1; - - name=""; - hp=100; - maxhp=100; - conditions=""; - shields=100; - maxshields=100; - leadership=80; - - armour_front=5; - armour_other=5; - weapons=1; - turrets=2; - capacity=50; - carrying=0; - - weapon[1]="Weapons Battery"; - weapon_facing[1]="most"; - weapon_dam[1]=8; - weapon_range[1]=300; - weapon_cooldown[1]=20; - -} - - - -// Eldar - -if (class="Void Stalker"){sprite_index=spr_ship_void; - ship_size=3; - - name=""; - hp=1000; - maxhp=1000; - conditions=""; - shields=300; - maxshields=300; - leadership=100; - - armour_front=5; - armour_other=4; - weapons=3; - turrets=4; - capacity=150; - carrying=0; - - weapon[1]="Eldar Launch Bay"; - weapon_facing[1]="special"; - weapon_dam[1]=0; - weapon_range[1]=9999; - weapon_cooldown[1]=90; - weapon_ammo[1]=4; - - weapon[2]="Weapons Battery"; - weapon_facing[2]="most"; - weapon_dam[2]=14; - weapon_range[2]=600; - weapon_cooldown[2]=30; - - weapon[3]="Pulsar Lances"; - weapon_facing[3]="most"; - weapon_dam[3]=10; - weapon_range[3]=600; - weapon_cooldown[3]=10; - - // weapon[4]="Torpedoes"; - weapon_facing[4]="front"; - weapon_dam[4]=12; - weapon_range[4]=450; - weapon_cooldown[4]=90; - -} - -if (class="Shadow Class"){sprite_index=spr_ship_shadow; - ship_size=3; - - name=""; - hp=600; - maxhp=600; - conditions=""; - shields=200; - maxshields=200; - leadership=90; - - armour_front=5; - armour_other=4; - weapons=2; - turrets=3; - capacity=100; - carrying=0; - - weapon[1]="Torpedoes"; - weapon_facing[1]="front"; - weapon_dam[1]=12; - weapon_range[1]=450; - weapon_cooldown[1]=90; - - weapon[2]="Weapons Battery"; - weapon_facing[2]="front"; - weapon_dam[2]=10; - weapon_range[2]=450; - weapon_cooldown[2]=30; - -} - -if (class="Hellebore"){sprite_index=spr_ship_hellebore; - ship_size=1; - - name=""; - hp=200; - maxhp=200; - conditions=""; - shields=200; - maxshields=200; - leadership=90; - - armour_front=5; - armour_other=4; - weapons=3; - turrets=2; - capacity=50; - carrying=0; - - weapon[1]="Pulsar Lances"; - weapon_facing[1]="front"; - weapon_dam[1]=10; - weapon_range[1]=450; - weapon_cooldown[1]=20; - - weapon[2]="Weapons Battery"; - weapon_facing[2]="front"; - weapon_dam[2]=8; - weapon_range[2]=450; - weapon_cooldown[2]=30; - - weapon[3]="Eldar Launch Bay"; - weapon_facing[3]="special"; - weapon_dam[3]=0; - weapon_range[3]=9999; - weapon_cooldown[3]=90; - weapon_ammo[1]=1; - -} - -if (class="Aconite"){sprite_index=spr_ship_aconite; - ship_size=1; - - name=""; - hp=200; - maxhp=200; - conditions=""; - shields=200; - maxshields=200; - leadership=90; - - armour_front=5; - armour_other=4; - weapons=3; - turrets=2; - capacity=50; - carrying=0; - - weapon[1]="Weapons Battery"; - weapon_facing[1]="front"; - weapon_dam[1]=8; - weapon_range[1]=450; - weapon_cooldown[1]=30; - -} - - - - -// Orks - -if (class="Dethdeala"){sprite_index=spr_ship_deth; - ship_size=3; - - name=""; - hp=1200; - maxhp=1200; - conditions=""; - shields=200; - maxshields=200; - leadership=100; - - armour_front=6; - armour_other=5; - weapons=5; - turrets=3; - capacity=250; - carrying=0; - - weapon[1]="Gunz Battery"; - weapon_facing[1]="left"; - weapon_dam[1]=8; - weapon_range[1]=300; - weapon_cooldown[1]=30; - - weapon[2]="Gunz Battery"; - weapon_facing[2]="right"; - weapon_dam[2]=8; - weapon_range[2]=300; - weapon_cooldown[2]=30; - - weapon[3]="Bombardment Cannon"; - weapon_facing[3]="front"; - weapon_dam[3]=12; - weapon_range[3]=450; - weapon_cooldown[3]=120; - - weapon[4]="Heavy Gunz"; - weapon_facing[4]="most"; - weapon_dam[4]=12; - weapon_range[4]=200; - weapon_cooldown[4]=40; - - weapon[5]="Fighta Bommerz"; - weapon_facing[5]="special"; - weapon_dam[5]=0; - weapon_range[5]=9999; - weapon_cooldown[5]=90; - -} - -if (class="Gorbag's Revenge"){sprite_index=spr_ship_gorbag; - ship_size=3; - - name=""; - hp=1200; - maxhp=1200; - conditions=""; - shields=200; - maxshields=200; - leadership=100; - - armour_front=6; - armour_other=5; - weapons=5; - turrets=3; - capacity=250; - carrying=0; - - weapon[1]="Gunz Battery"; - weapon_facing[1]="front"; - weapon_dam[1]=8; - weapon_range[1]=450; - weapon_cooldown[1]=30; - - weapon[2]="Torpedoes"; - weapon_facing[2]="front"; - weapon_dam[2]=12; - weapon_range[2]=300; - weapon_cooldown[2]=120; - - weapon[3]="Heavy Gunz"; - weapon_facing[3]="most"; - weapon_dam[3]=12; - weapon_range[3]=200; - weapon_cooldown[3]=40; - - weapon[4]="Fighta Bommerz"; - weapon_facing[4]="special"; - weapon_dam[4]=0; - weapon_ammo[4]=3; - weapon_range[4]=9999; - weapon_cooldown[4]=90; - - weapon[5]="Fighta Bommerz"; - weapon_facing[5]="special"; - weapon_dam[5]=0; - weapon_ammo[5]=3; - weapon_range[5]=9999; - weapon_cooldown[5]=90; - cooldown[5]=30; - -} - -if (class="Kroolboy") or (class="Slamblasta"){ship_size=3; - sprite_index=spr_ship_krool; - - if (class="Kroolboy") then sprite_index=spr_ship_krool; - - if (class="Slamblasta") then sprite_index=spr_ship_slam; - - name=""; - hp=1200; - maxhp=1200; - conditions=""; - shields=200; - maxshields=200; - leadership=100; - - armour_front=6; - armour_other=5; - weapons=3; - turrets=3; - capacity=250; - carrying=0; - - weapon[1]="Fighta Bommerz"; - weapon_facing[1]="special"; - weapon_dam[1]=0; - weapon_ammo[1]=3; - weapon_range[1]=9999; - weapon_cooldown[1]=120; - - weapon[2]="Gunz Battery"; - weapon_facing[2]="most"; - weapon_dam[2]=8; - weapon_range[2]=300; - weapon_cooldown[2]=30; - - weapon[3]="Heavy Gunz"; - weapon_facing[3]="most"; - weapon_dam[3]=12; - weapon_range[3]=200; - weapon_cooldown[3]=40; - -} - -if (class="Battlekroozer"){sprite_index=spr_ship_kroozer; - ship_size=3; - - name=""; - hp=1000; - maxhp=1000; - conditions=""; - shields=200; - maxshields=200; - leadership=100; - - armour_front=6; - armour_other=5; - weapons=5; - turrets=3; - capacity=250; - carrying=0; - - weapon[1]="Gunz Battery"; - weapon_facing[1]="most"; - weapon_dam[1]=8; - weapon_range[1]=450; - weapon_cooldown[1]=30; - - weapon[2]="Heavy Gunz"; - weapon_facing[2]="left"; - weapon_dam[2]=12; - weapon_range[2]=200; - weapon_cooldown[2]=40; - - weapon[3]="Heavy Gunz"; - weapon_facing[3]="right"; - weapon_dam[3]=12; - weapon_range[3]=200; - weapon_cooldown[3]=40; - - weapon[4]="Fighta Bommerz"; - weapon_facing[4]="special"; - weapon_dam[4]=0; - weapon_ammo[4]=3; - weapon_range[4]=9999; - weapon_cooldown[4]=90; - - weapon[5]="Fighta Bommerz"; - weapon_facing[5]="special"; - weapon_dam[5]=0; - weapon_ammo[5]=3; - weapon_range[5]=9999; - weapon_cooldown[5]=90; - cooldown[5]=30; - -} - -if (class="Ravager"){sprite_index=spr_ship_ravager; - ship_size=1; - - name=""; - hp=100; - maxhp=100; - conditions=""; - shields=100; - maxshields=100; - leadership=80; - - armour_front=6; - armour_other=4; - weapons=2; - turrets=2; - capacity=50; - carrying=0; - - weapon[1]="Gunz Battery"; - weapon_facing[1]="front"; - weapon_dam[1]=8; - weapon_range[1]=300; - weapon_cooldown[1]=30; - - weapon[2]="Torpedoes"; - weapon_facing[2]="front"; - weapon_dam[2]=12; - weapon_range[2]=300; - weapon_cooldown[2]=120; - -} - -// Tau - -if (class="Custodian"){sprite_index=spr_ship_custodian; - ship_size=3; - - name=""; - hp=1000; - maxhp=1000; - conditions=""; - shields=200; - maxshields=200; - leadership=100; - - armour_front=6; - armour_other=5; - weapons=4; - turrets=5; - capacity=1000; - carrying=0; - - weapon[1]="Gravitic launcher"; - weapon_facing[1]="front"; - weapon_dam[1]=12; - weapon_range[1]=400; - weapon_minrange[1]=200; - weapon_cooldown[1]=30; - - weapon[2]="Railgun Battery"; - weapon_facing[2]="most"; - weapon_dam[2]=12; - weapon_range[2]=450; - weapon_cooldown[2]=30; - - weapon[3]="Ion Cannons"; - weapon_facing[3]="most"; - weapon_dam[3]=8; - weapon_range[3]=300; - weapon_cooldown[3]=15; - - weapon[4]="Manta Launch Bay"; - weapon_facing[4]="special"; - weapon_dam[4]=0; - weapon_range[4]=9999; - weapon_cooldown[4]=90; - weapon_ammo[4]=4; - -} - -if (class="Protector"){sprite_index=spr_ship_protector; - ship_size=2; - - name=""; - hp=600; - maxhp=600; - conditions=""; - shields=200; - maxshields=200; - leadership=90; - - armour_front=6; - armour_other=5; - weapons=4; - turrets=3; - capacity=250; - carrying=0; - - weapon[1]="Gravitic launcher"; - weapon_facing[1]="front"; - weapon_dam[1]=12; - weapon_range[1]=400; - weapon_minrange[1]=200; - weapon_cooldown[1]=30; - - weapon[2]="Railgun Battery"; - weapon_facing[2]="most"; - weapon_dam[2]=10; - weapon_range[2]=450; - weapon_cooldown[2]=30; - - weapon[3]="Ion Cannons"; - weapon_facing[3]="most"; - weapon_dam[3]=8; - weapon_range[3]=300; - weapon_cooldown[3]=15; - - weapon[4]="Manta Launch Bay"; - weapon_facing[4]="special"; - weapon_dam[4]=0; - weapon_range[4]=9999; - weapon_cooldown[4]=90; - weapon_ammo[4]=2; - -} - -if (class="Emissary"){sprite_index=spr_ship_emissary; - ship_size=2; - - name=""; - hp=400; - maxhp=400; - conditions=""; - shields=100; - maxshields=100; - leadership=100; - - armour_front=6; - armour_other=5; - weapons=4; - turrets=2; - capacity=100; - carrying=0; - - weapon[1]="Gravitic launcher"; - weapon_facing[1]="front"; - weapon_dam[1]=12; - weapon_range[1]=400; - weapon_minrange[1]=200; - weapon_cooldown[1]=30; - - weapon[2]="Railgun Battery"; - weapon_facing[2]="most"; - weapon_dam[2]=10; - weapon_range[2]=450; - weapon_cooldown[2]=30; - - weapon[3]="Ion Cannons"; - weapon_facing[3]="most"; - weapon_dam[3]=8; - weapon_range[3]=300; - weapon_cooldown[3]=15; - - weapon[4]="Manta Launch Bay"; - weapon_facing[4]="special"; - weapon_dam[4]=0; - weapon_range[4]=9999; - weapon_cooldown[4]=90; - weapon_ammo[4]=1; - -} - -if (class="Warden"){sprite_index=spr_ship_warden; - ship_size=1; - - name=""; - hp=100; - maxhp=100; - conditions=""; - shields=100; - maxshields=100; - leadership=80; - - armour_front=5; - armour_other=4; - weapons=2; - turrets=1; - capacity=50; - carrying=0; - - weapon[1]="Ion Cannon"; - weapon_facing[1]="most"; - weapon_dam[1]=8; - weapon_range[1]=300; - weapon_cooldown[1]=50; - - weapon[2]="Railgun Battery"; - weapon_facing[2]="front"; - weapon_dam[2]=10; - weapon_range[2]=300; - weapon_cooldown[2]=60; - -} - -if (class="Castellan"){sprite_index=spr_ship_castellan; - ship_size=1; - - name=""; - hp=100; - maxhp=100; - conditions=""; - shields=100; - maxshields=100; - leadership=80; - - armour_front=5; - armour_other=4; - weapons=2; - turrets=2; - capacity=50; - carrying=0; - - weapon[1]="Gravitic launcher"; - weapon_facing[1]="front"; - weapon_dam[1]=12; - weapon_range[1]=400; - weapon_minrange[1]=200; - weapon_cooldown[1]=40; - - weapon[2]="Railgun Battery"; - weapon_facing[2]="front"; - weapon_dam[2]=10; - weapon_range[2]=300; - weapon_cooldown[2]=40; - -} - -// Chaos - -if (class="Desecrator"){sprite_index=spr_ship_dese; - ship_size=3; - - name=""; - hp=1200; - maxhp=1200; - conditions=""; - shields=400; - maxshields=400; - leadership=90; - - armour_front=7; - armour_other=5; - weapons=5; - turrets=4; - capacity=150; - carrying=0; - - weapon[1]="Lance Battery"; - weapon_facing[1]="left"; - weapon_dam[1]=12; - weapon_range[1]=300; - weapon_cooldown[1]=30; - - weapon[2]="Lance Battery"; - weapon_facing[2]="right"; - weapon_dam[2]=12; - weapon_range[2]=300; - weapon_cooldown[2]=30; - - weapon[3]="Weapons Battery"; - weapon_facing[3]="front"; - weapon_dam[3]=18; - weapon_range[3]=600; - weapon_cooldown[3]=60; - - weapon[4]="Torpedoes"; - weapon_facing[4]="front"; - weapon_dam[4]=18; - weapon_range[4]=450; - weapon_cooldown[4]=120; - - weapon[5]="Fighta Bommerz"; - weapon_facing[5]="special"; - weapon_dam[5]=0; - weapon_range[5]=9999; - weapon_cooldown[5]=90; - -} - -if (class="Avenger"){sprite_index=spr_ship_veng; - ship_size=2; - - name=""; - hp=1000; - maxhp=1000; - conditions=""; - shields=300; - maxshields=300; - leadership=85; - - armour_front=5; - armour_other=5; - weapons=2; - turrets=3; - capacity=50; - carrying=0; - - weapon[1]="Lance Battery"; - weapon_facing[1]="left"; - weapon_dam[1]=12; - weapon_range[1]=300; - weapon_cooldown[1]=30; - - weapon[2]="Lance Battery"; - weapon_facing[2]="right"; - weapon_dam[2]=12; - weapon_range[2]=300; - weapon_cooldown[2]=30; - -} - -if (class="Carnage") or (class="Daemon"){sprite_index=spr_ship_carnage; - ship_size=2; - - name=""; - hp=1000; - maxhp=1000; - conditions=""; - shields=300; - maxshields=300; - leadership=85; - - armour_front=5; - armour_other=5; - weapons=3; - turrets=3; - capacity=50; - carrying=0; - - weapon[1]="Lance Battery"; - weapon_facing[1]="most"; - weapon_dam[1]=12; - weapon_range[1]=450; - weapon_cooldown[1]=30; - - weapon[2]="Weapons Battery"; - weapon_facing[2]="left"; - weapon_dam[2]=12; - weapon_range[2]=300; - weapon_cooldown[2]=45; - - weapon[3]="Weapons Battery"; - weapon_facing[3]="right"; - weapon_dam[3]=12; - weapon_range[3]=300; - weapon_cooldown[3]=45; - - if (class="Daemon"){sprite_index=spr_ship_daemon; - image_alpha=0.1; -} -} - -if (class="Iconoclast"){sprite_index=spr_ship_icono; - ship_size=1; - - name=""; - hp=100; - maxhp=100; - conditions=""; - shields=100; - maxshields=100; - leadership=80; - - armour_front=7; - armour_other=4; - weapons=1; - turrets=2; - capacity=50; - carrying=0; - - weapon[1]="Weapons Battery"; - weapon_facing[1]="most"; - weapon_dam[1]=8; - weapon_range[1]=300; - weapon_cooldown[1]=30; - -} - -// Tyranids - -if (class="Leviathan"){sprite_index=spr_ship_leviathan; - ship_size=3; - - name=""; - hp=1000; - maxhp=1000; - conditions=""; - shields=300; - maxshields=300; - leadership=100; - - armour_front=7; - armour_other=5; - weapons=5; - turrets=3; - capacity=0; - carrying=0; - - weapon[1]="Feeder Tendrils"; - weapon_facing[1]="most"; - weapon_dam[1]=12; - weapon_range[1]=160; - weapon_cooldown[1]=30; - - weapon[2]="Bio-Plasma Discharge"; - weapon_facing[2]="most"; - weapon_dam[2]=10; - weapon_range[2]=260; - weapon_cooldown[2]=30; - - weapon[3]="Pyro-Acid Battery"; - weapon_facing[3]="front"; - weapon_dam[3]=18; - weapon_range[3]=500; - weapon_cooldown[3]=40; - - weapon[4]="Launch Glands"; - weapon_facing[4]="special"; - weapon_range[4]=9999; - weapon_ammo[4]=6; - weapon_cooldown[4]=120; - -} - -if (class="Razorfiend"){sprite_index=spr_ship_razorfiend; - ship_size=2; - - name=""; - hp=600; - maxhp=600; - conditions=""; - shields=200; - maxshields=200; - leadership=100; - - armour_front=5; - armour_other=4; - weapons=3; - turrets=2; - capacity=0; - carrying=0; - - weapon[1]="Pyro-Acid Battery"; - weapon_facing[1]="front"; - weapon_dam[1]=12; - weapon_range[1]=300; - weapon_cooldown[1]=30; - - weapon[2]="Feeder Tendrils"; - weapon_facing[2]="most"; - weapon_dam[2]=8; - weapon_range[2]=100; - weapon_cooldown[2]=30; - - weapon[3]="Massive Claws"; - weapon_facing[3]="most"; - weapon_dam[3]=20; - weapon_range[3]=64; - weapon_cooldown[3]=60; - -} - -if (class="Stalker"){sprite_index=spr_ship_stalker; - ship_size=1; - - name=""; - hp=100; - maxhp=100; - conditions=""; - shields=100; - maxshields=100; - leadership=100; - - armour_front=5; - armour_other=4; - weapons=1; - turrets=0; - capacity=0; - carrying=0; - - weapon[1]="Pyro-Acid Battery"; - weapon_facing[1]="front"; - weapon_dam[1]=8; - weapon_range[1]=300; - weapon_cooldown[1]=60; - - weapon[2]="Feeder Tendrils"; - weapon_facing[2]="most"; - weapon_dam[2]=8; - weapon_range[2]=100; - weapon_cooldown[2]=30; - - weapon[3]="Bio-Plasma Discharge"; - weapon_facing[3]="front"; - weapon_dam[3]=6; - weapon_range[3]=200; - weapon_cooldown[3]=60; - -} - -if (class="Prowler"){sprite_index=spr_ship_prowler; - ship_size=1; - - name=""; - hp=100; - maxhp=100; - conditions=""; - shields=100; - maxshields=100; - leadership=100; - - armour_front=5; - armour_other=4; - weapons=1; - turrets=0; - capacity=0; - carrying=0; - - weapon[1]="Pyro-acid Battery"; - weapon_facing[1]="most"; - weapon_dam[1]=8; - weapon_range[1]=300; - weapon_cooldown[1]=30; - - weapon[2]="Feeder Tendrils"; - weapon_facing[2]="most"; - weapon_dam[2]=8; - weapon_range[2]=100; - weapon_cooldown[1]=30; - -} - - - - -if (owner = eFACTION.Tyranids){ - var i; - i=0; - - repeat(2){ - i+=1; - - if (obj_fleet.en_mutation[i]="Spore Clouds") then shields=shields+100; - - if (obj_fleet.en_mutation[i]="Health"){hp=floor(hp*1.1); - maxhp=hp; - } - if (obj_fleet.en_mutation[i]="Armour") then armour_front+=1; - - if (obj_fleet.en_mutation[i]="Speed") then speed_bonus=speed_bonus*1.1; - - if (obj_fleet.en_mutation[i]="Turn") then turn_bonus=1.2; - - if (obj_fleet.en_mutation[i]="Turret") then turrets+=1; - - } -} - - - - - - -// Necrons -if (class="Cairn Class"){sprite_index=spr_ship_cairn; - ship_size=3; - - name=""; - hp=1100; - maxhp=1100; - conditions=""; - shields=550; - maxshields=550; - leadership=100; - - armour_front=5; - armour_other=5; - weapons=3; - turrets=5; - capacity=800; - carrying=0; - - weapon[1]="Lightning Arc"; - weapon_facing[1]="most"; - weapon_dam[1]=0; - weapon_range[1]=300; - weapon_cooldown[1]=15; - - weapon[2]="Star Pulse Generator"; - weapon_facing[2]="front"; - weapon_dam[2]=0; - weapon_range[2]=220; - weapon_cooldown[2]=210; - - weapon[3]="Gauss Particle Whip"; - weapon_facing[3]="front"; - weapon_dam[3]=30; - weapon_range[3]=450; - weapon_cooldown[3]=90; - -} - -if (class="Reaper Class"){sprite_index=spr_ship_reaper; - ship_size=3; - - name=""; - hp=900; - maxhp=900; - conditions=""; - shields=450; - maxshields=450; - leadership=100; - - armour_front=5; - armour_other=5; - weapons=3; - turrets=4; - capacity=500; - carrying=0; - - weapon[1]="Lightning Arc"; - weapon_facing[1]="most"; - weapon_dam[1]=0; - weapon_range[1]=300; - weapon_cooldown[1]=15; - - weapon[2]="Star Pulse Generator"; - weapon_facing[2]="front"; - weapon_dam[2]=0; - weapon_range[2]=220; - weapon_cooldown[2]=210; - - weapon[3]="Gauss Particle Whip"; - weapon_facing[3]="front"; - weapon_dam[3]=30; - weapon_range[3]=450; - weapon_cooldown[3]=90; - -} - -if (class="Shroud Class"){ship_size=2; - sprite_index=spr_ship_shroud; - - name=""; - hp=400; - maxhp=400; - conditions=""; - shields=200; - maxshields=200; - leadership=100; - - armour_front=5; - armour_other=5; - weapons=1; - turrets=2; - capacity=250; - carrying=0; - - weapon[1]="Lightning Arc"; - weapon_facing[1]="most"; - weapon_dam[1]=0; - weapon_range[1]=300; - weapon_cooldown[1]=15; - -} - -if (class="Jackal Class"){ship_size=2; - sprite_index=spr_ship_jackal; - - name=""; - hp=100; - maxhp=100; - conditions=""; - shields=100; - maxshields=100; - leadership=100; - - armour_front=4; - armour_other=4; - weapons=1; - turrets=2; - capacity=25; - carrying=0; - - weapon[1]="Lightning Arc"; - weapon_facing[1]="most"; - weapon_dam[1]=0; - weapon_range[1]=250; - weapon_cooldown[1]=15; - -} - -if (class="Dirge Class"){ship_size=2; - sprite_index=spr_ship_dirge; - - name=""; - hp=100; - maxhp=100; - conditions=""; - shields=100; - maxshields=100; - leadership=100; - - armour_front=4; - armour_other=4; - weapons=1; - turrets=2; - capacity=25; - carrying=0; - - weapon[1]="Lightning Arc"; - weapon_facing[1]="most"; - weapon_dam[1]=0; - weapon_range[1]=250; - weapon_cooldown[1]=15; - -} - - - - - - - - - - - - - -if (owner != eFACTION.Eldar) and (owner != eFACTION.Necrons){ - hp=hp/2; - maxhp=hp; - shields=shields/2; - maxshields=shields; - -} - -bridge=maxhp; - -/* -if (obj_fleet.enemy == 2) { - hp = hp * 0.75; - maxhp = hp; - shields = shields * 0.75; - maxshields = shields; -} - */ -// hp=1; -shields=1; - - - -// if (obj_fleet.enemy="orks") then name=global.name_generator.generate_ork_ship_name(); - -name="sdagdsagdasg"; - - - -// show_message(string(class)); - - -/* */ -/* */ diff --git a/objects/obj_en_ship/Create_0.gml b/objects/obj_en_ship/Create_0.gml index 7c83962b6c..2f3f9cdfca 100644 --- a/objects/obj_en_ship/Create_0.gml +++ b/objects/obj_en_ship/Create_0.gml @@ -12,6 +12,11 @@ hostile=1; lightning=0; whip=0; bridge=0; +draw_targets = false; +bullets_for = []; +target_distance = 9999; +closing_distance = 0; + cooldown[0]=0; cooldown[1]=0; @@ -24,21 +29,22 @@ turret_cool=0; name=""; class=""; -size=0; +size=1; hp=0; maxhp=0; conditions=""; shields=1; maxshields=1; armour_front=0; -armour_other=0; -weapons=0; +side_armour=0; +weapons=[]; turrets=0; +max_speed = 20; turn_bonus=1; speed_bonus=1; - +ai_type = "enemy"; var i;i=-1; repeat(6){i+=1; weapon[i]=""; @@ -50,5 +56,3 @@ repeat(6){i+=1; weapon_range[i]=0; weapon_minrange[i]=0; } - -action_set_alarm(1, 0); diff --git a/objects/obj_en_ship/Draw_0.gml b/objects/obj_en_ship/Draw_0.gml index 11ad8d73c7..e58bb0d92a 100644 --- a/objects/obj_en_ship/Draw_0.gml +++ b/objects/obj_en_ship/Draw_0.gml @@ -14,29 +14,37 @@ draw_set_halign(fa_center); draw_set_alpha(1); - +if (point_distance(x, y, mouse_x, mouse_y)< 50){ + for (var i=0;i01) and (instance_exists(target)){ - draw_set_color(c_lime);lightning-=1; + draw_set_color(c_lime); + lightning-=1; scr_bolt(x,y,target.x,target.y,0); } if (whip>0) and (instance_exists(target)){ - draw_set_color(c_lime);whip-=1; + draw_set_color(c_lime); + whip-=1; scr_bolt(x,y,target.x,target.y,0); scr_bolt(x-1,y+1,target.x-1,target.y+1,0); } draw_set_color(CM_GREEN_COLOR); -if (class!="Battlekroozer") then draw_self(); -if (class="Battlekroozer") then draw_sprite_ext(sprite_index,0,x,y,0.75,0.75,direction,c_white,1); - - - +if (class!="Battlekroozer"){ + draw_self(); +} else { + draw_sprite_ext(sprite_index,0,x,y,0.85,0.85,direction,c_white,1); +} +draw_ship_heathshields(); if (owner != eFACTION.Tau){ if (shields<=0){ - if (obj_controller.zoomed=0){if (maxhp!=0) then draw_text(x,y-(sprite_height/2),string_hash_to_newline(string(floor((hp/maxhp)*100))+"%"));} - if (obj_controller.zoomed=1){if (maxhp!=0) then draw_text_transformed(x,y-sprite_height,string_hash_to_newline(string(floor((hp/maxhp)*100))+"%"),2,2,0);} + if (obj_controller.zoomed=0){if (maxhp!=0) then draw_text(x,y-(sprite_height/2),string_hash_to_newline(string(floor((hp/maxhp)*100))+"%"));} + if (obj_controller.zoomed=1){if (maxhp!=0) then draw_text_transformed(x,y-sprite_height,string_hash_to_newline(string(floor((hp/maxhp)*100))+"%"),2,2,0);} } if (shields>0){ @@ -46,7 +54,7 @@ if (owner != eFACTION.Tau){ } } -if (owner = eFACTION.Tau){ +else if (owner = eFACTION.Tau){ if (shields<=0){ if (obj_controller.zoomed=0){if (maxhp!=0) then draw_text(x,y-(sprite_width/2),string_hash_to_newline(string(floor((hp/maxhp)*100))+"%"));} if (obj_controller.zoomed=1){if (maxhp!=0) then draw_text_transformed(x,y-sprite_width,string_hash_to_newline(string(floor((hp/maxhp)*100))+"%"),2,2,0);} diff --git a/objects/obj_en_ship/Step_0.gml b/objects/obj_en_ship/Step_0.gml index 26a2e67635..c729307da5 100644 --- a/objects/obj_en_ship/Step_0.gml +++ b/objects/obj_en_ship/Step_0.gml @@ -3,322 +3,140 @@ __b__ = action_if_variable(owner, 6, 0); if !__b__ { image_angle=direction; - +turning_speed=0.2; if (obj_fleet.start!=5) then exit; if (class="Daemon") and (image_alpha<1) then image_alpha+=0.006; -var o_dist, dist, ch_rang, ex, spid;spid=0; - -if (shields>0) and (shieldspoint_distance(x,y,tp2.x,tp2.y)) then target=tp2; -} +find_ship_combat_target(obj_p_ship, obj_al_ship); + + if (!instance_exists(target)) then exit; if (hp<=0){ - var wh,gud;wh=0;gud=0; - repeat(5){wh+=1;if (obj_fleet.enemy[wh]=owner) then gud=wh;} + var wh=0,gud=0; + for (var wh=0;wh=3) then obj_fleet.en_capital_lost[gud]+=1; if (size=2) then obj_fleet.en_frigate_lost[gud]+=1; if (size=1) then obj_fleet.en_escort_lost[gud]+=1; - image_alpha=0.5; - - - if (owner != eFACTION.Tyranids){ - // ex=instance_create(x,y,obj_explosion); - // ex.image_xscale=2;ex.image_yscale=2;ex.image_speed=0.75; - var husk;husk=instance_create(x,y,obj_en_husk); - husk.sprite_index=sprite_index;husk.direction=direction; - husk.image_angle=image_angle;husk.depth=depth;husk.image_speed=0; - repeat(choose(4,5,6)){ - var explo;explo=instance_create(x,y,obj_explosion); - explo.image_xscale=0.5;explo.image_yscale=0.5; - explo.x+=random_range(sprite_width*0.25,sprite_width*-0.25); - explo.y+=random_range(sprite_width*0.25,sprite_width*-0.25); - } - } - if (owner = eFACTION.Tyranids) then effect_create_above(ef_firework,x,y,1,c_purple); - instance_destroy(); + destroy_ship_and_leave_husk(); } if (hp>0) and (instance_exists(obj_p_ship)){ + is_targeted(); - if (class="Apocalypse Class Battleship"){o_dist=500;action="attack";spid=20;} - if (class="Nemesis Class Fleet Carrier"){o_dist=1000;action="attack";spid=20;} - if (class="Leviathan"){o_dist=160;action="attack";spid=20;} - if (class="Battle Barge") or (class="Custodian"){o_dist=300;action="attack";spid=20;} - if (class="Desecrator"){o_dist=300;action="attack";spid=20;} - if (class="Razorfiend"){o_dist=100;action="attack";spid=25;} - if (class="Cairn Class") or (class="Reaper Class"){o_dist=199;action="attack";spid=25;if (class="Reaper Class") then spid=30;} - - if (class="Dethdeala") or (class="Protector") or (class="Emissary"){o_dist=200;action="attack";spid=20;} - if (class="Gorbag's Revenge"){o_dist=200;action="attack";spid=20;} - if (class="Kroolboy") or (class="Slamblasta"){o_dist=200;action="attack";spid=25;} - if (class="Battlekroozer"){o_dist=200;action="attack";spid=30;} - if (class="Avenger") or (class="Carnage") or (class="Daemon"){o_dist=200;action="attack";spid=20;} - - if (class="Ravager") or (class="Iconoclast") or (class="Castellan") or (class="Warden"){o_dist=300;action="attack";spid=35;} - if (class="Shroud Class"){o_dist=250;action="attack";spid=35;} - - if (class="Stalker") or (class="Sword Class Frigate"){o_dist=100;action="attack";spid=20;} - if (class="Prowler"){o_dist=100;action="attack";spid=35;} - if (class="Avenger Class Grand Cruiser"){o_dist=48;action="broadside";spid=20;} - if (class="Jackal Class"){o_dist=200;action="attack";spid=40;} - if (class="Dirge Class"){o_dist=200;action="attack";spid=45;} + if (class="Apocalypse Class Battleship"){ + closing_distance=500; + action="attack"; + spid=20; + } + if (class="Nemesis Class Fleet Carrier"){ + closing_distance=1000;action="attack"; + spid=20; + } + if (class="Leviathan"){closing_distance=160;action="attack";spid=20;} + if (class="Battle Barge") or (class="Custodian"){closing_distance=300;action="attack";spid=20;} + if (class="Desecrator"){closing_distance=300;action="attack";spid=20;} + if (class="Razorfiend"){closing_distance=100;action="attack";spid=25;} + if (class="Cairn Class") or (class="Reaper Class"){closing_distance=199;action="attack";spid=25;if (class="Reaper Class") then spid=30;} + + if (class="Dethdeala") or (class="Protector") or (class="Emissary"){ + closing_distance=200; + action="attack"; + spid=20; + } + if (class="Gorbag's Revenge"){closing_distance=200;action="attack";spid=20;} + if (class="Kroolboy") or (class="Slamblasta"){closing_distance=200;action="attack";spid=25;} + if (class="Battlekroozer"){closing_distance=200;action="attack";spid=30;} + if (class="Avenger") or (class="Carnage") or (class="Daemon"){closing_distance=200;action="attack";spid=20;} + + if (class="Ravager") or (class="Iconoclast") or (class="Castellan") or (class="Warden"){closing_distance=300;action="attack";spid=35;} + if (class="Shroud Class"){closing_distance=250;action="attack";spid=35;} + + if (class="Stalker") or (class="Sword Class Frigate"){closing_distance=100;action="attack";spid=20;} + if (class="Prowler"){closing_distance=100;action="attack";spid=35;} + if (class="Avenger Class Grand Cruiser"){closing_distance=48;action="broadside";spid=20;} + if (class="Jackal Class"){closing_distance=200;action="attack";spid=40;} + if (class="Dirge Class"){closing_distance=200;action="attack";spid=45;} + + if (size==1){ + action = "flank"; + } // if (class!="big") then flank!!!! - spid=spid*speed_bonus; - dist=point_distance(x,y,target.x,target.y)-(max(sprite_get_width(sprite_index),sprite_get_height(sprite_index))); - + target_distance=point_distance(x,y,target.x,target.y)-(max(sprite_get_width(sprite_index),sprite_get_height(sprite_index))); if (target!=0) and (action="attack"){ direction=turn_towards_point(direction,x,y,target.x,target.y,.1); } - if (target!=0) and (action="broadside") and (dist>o_dist){ - if (y>=target.y) then dist=point_distance(x,y,target.x+lengthdir_x(64,target.direction-180),target.y+lengthdir_y(128,target.direction-90))-(max(sprite_get_width(sprite_index),sprite_get_height(sprite_index))); - if (ytarget.y) and (dist>o_dist) then direction=turn_towards_point(direction,x+lengthdir_x(64,target.direction-180),y,target.x,target.y+lengthdir_y(128,target.direction-90),.2); - if (yo_dist) then direction=turn_towards_point(direction,x+lengthdir_x(64,target.direction-180),y,target.x,target.y+lengthdir_y(128,target.direction+90),.2); - if (turn_bonus>1){ - if (yo_dist) then direction=turn_towards_point(direction,x+lengthdir_x(64,target.direction-180),y,target.x,target.y+lengthdir_y(128,target.direction+90),.2); - } - } - - - /*if (target!=0) and (action="broadside") and (o_dist>=dist){ - direction=turn_towards_point(direction,x+lengthdir_x(128,target.direction-90),y,target.x,target.y+lengthdir_y(128,target.direction-90),.2) - }*/ - - /*if (target!=0) and (action="broadside") and (o_dist>=dist){ - var re_deh;re_deh=relative_direction(direction,target.direction); - - // if (re_deh<45) or (re_deh>315) or ((re_deh>135) and (re_deh<225)) then direction=turn_towards_point(direction,x+lengthdir_x(128,target.direction-90),y,target.x,target.y+lengthdir_y(128,target.direction-90),.2) - - var wok; - wok=0; - - if (!instance_exists(target_l)) then wok=2; - if (!instance_exists(target_r)) then wok=1; - - if (instance_exists(target_l)) and (instance_exists(target_r)){ - if (point_distance(x,y,target_l.x,target_l.y))<(point_distance(x,y,target_r.x,target_r.y)) then wok=1; - else{wok=2;} - - } - - - if (wok=1){ - direction=turn_towards_point(direction,x,y,x+lengthdir_x(256,90),y+lengthdir_y(256,90),.2) - } - - if (wok=2){ - direction=turn_towards_point(direction,x,y,x+lengthdir_x(256,270),y+lengthdir_y(256,270),.2) - } - - // direction=turn_towards_point(direction,x+lengthdir_x(128,target.direction-90),y,target.x,target.y+lengthdir_y(128,target.direction-90),.2) - - - - }*/ - + broadside_movement(); + flank_behaviour(); + - if (action="attack"){ - if (dist>o_dist) and (speed<((spid)/10)) then speed+=0.005; - if (dist0) then speed-=0.025; - } - if (action="broadside"){ - if (dist>o_dist) and (speed<((spid)/10)) then speed+=0.005; - if (dist0) then speed-=0.025; - } + speed_down = 0.025; + combat_acceleration_control(); if (speed<0) then speed=speed*0.9; - if (cooldown[1]>0) then cooldown[1]-=1; - if (cooldown[2]>0) then cooldown[2]-=1; - if (cooldown[3]>0) then cooldown[3]-=1; - if (cooldown[4]>0) then cooldown[4]-=1; - if (cooldown[5]>0) then cooldown[5]-=1; if (turret_cool>0) then turret_cool-=1; - - - var bull, targe, rdir, dirr, dist, xx, yy, ok; - targe=0;rdir=0;dirr="";dist=9999;xx=x;yy=y; + var targe=0,rdir=0,dirr="",target_distance=9999,xx=x,yy=y; if (turrets>0) and (instance_exists(obj_p_small)) and (turret_cool=0){ targe=instance_nearest(x,y,obj_p_small); - if (instance_exists(targe)) then dist=point_distance(x,y,targe.x,targe.y); - - if (dist>64) and (dist<300){ - bull=instance_create(x,y,obj_en_round);bull.direction=point_direction(x,y,targe.x,targe.y); - if (owner = eFACTION.Tyranids) then bull.sprite_index=spr_glob; - bull.speed=20;bull.dam=3;bull.image_xscale=0.5;bull.image_yscale=0.5;turret_cool=floor(60/turrets); - if (owner = eFACTION.Necrons){bull.sprite_index=spr_green_las;bull.image_yscale=1;} - bull.direction+=choose(random(10),1*-(random(10))); + if (instance_exists(targe)){ + target_distance=point_distance(x,y,targe.x,targe.y); } - } - targe=0;rdir=0;dirr="";dist=9999; - - - xx=lengthdir_x(64,direction+90); - yy=lengthdir_y(64,direction+90); - - var front, right, left, rear; - front=0;right=0;left=0;rear=0; - - targe=instance_nearest(xx,yy,obj_p_ship); - rdir=point_direction(x,y,target.x,target.y); - // if (rdir>45) and (rdir<=135) and (targe!=target){target_r=targe;right=1;} - // if (rdir>225) and (rdir<=315) and (targe!=target) and (targe!=target_r){target_l=targe;left=1;} - target_l=instance_nearest(x+lengthdir_x(64,direction+90),y+lengthdir_y(64,direction+90),obj_p_ship); - target_r=instance_nearest(x+lengthdir_x(64,direction+270),y+lengthdir_y(64,direction+270),obj_p_ship); - - if (collision_line(x,y,x+lengthdir_x(2000,direction),y+lengthdir_y(2000,direction),obj_p_ship,0,1)) then front=1; - - - var f, facing, ammo, range, wep, dam, gg;f=0;facing="";ammo=0;range=0;wep="";dam=0;gg=0; - - lightning=0; - - repeat(weapons){ - gg+=1; - - ok=0;f+=1;facing="";ammo=0;range=0;wep=""; - - //weapon[gg]=0;weapon_ammo[gg]=0;weapon_range[gg]=0; - - if (cooldown[gg]<=0) and (weapon[gg]!="") and (weapon_ammo[gg]>0) then ok=1; - if (ok=1){ - facing=weapon_facing[gg];ammo=weapon_ammo[gg];range=weapon_range[gg];} - - targe=target; - if (facing="front") and (front=1) then ok=2; - if (facing="most") then ok=2; - - - /* - if (facing="right") then targe=target_r; - if (facing="left") then targe=target_l; - if ((facing="front") or (facing="most")) and (front=1) then ok=2; - if (facing="right") or (facing="most") and (right=1) then ok=2; - if (facing="left") or (facing="most") and (left=1) then ok=2; - */ - if (facing="special") then ok=2; - if (!instance_exists(targe)) then exit; - dist=point_distance(x,y,targe.x,targe.y); - - if (facing="right") and (point_direction(x,y,target_r.x,target_r.y)<337) and (point_direction(x,y,target_r.x,target_r.y)>203) then ok=2; - if (facing="left") and (point_direction(x,y,target_r.x,target_r.y)>22) and (point_direction(x,y,target_r.x,target_r.y)<157) then ok=2; - - /*var re_deh;re_deh=relative_direction(direction,target.direction); - if (re_deh<45) or (re_deh>315) or ((re_deh>135) and (re_deh<225)) then direction=turn_towards_point(direction,x+lengthdir_x(128,target.direction-90),y,target.x,target.y+lengthdir_y(128,target.direction-90),.2) - */ - - - - if (ok=2) and (dist<(range+(max(sprite_get_width(sprite_index),sprite_get_height(sprite_index))))){ - if (ammo>0) and (ammo<900) then ammo-=1; - weapon_ammo[gg]=ammo;cooldown[gg]=weapon_cooldown[gg];wep=weapon[gg];dam=weapon_dam[gg]; - - // if (f=3) and (ship_id=2) then show_message("ammo: "+string(ammo)+" | range: "+string(range)); - - if (ammo<0) then ok=0; - ok=3; - - if (string_count("orpedo",wep)=0) and (string_count("Interceptor",wep)=0) and (string_count("ommerz",wep)=0) and (string_count("Claws",wep)=0) and (string_count("endrils",wep)=0) and (ok=3) and (owner != eFACTION.Necrons){ - bull=instance_create(x+lengthdir_x(32,direction),y+lengthdir_y(32,direction),obj_en_round); - bull.speed=20;bull.dam=dam; - if (targe=target) then bull.direction=point_direction(x+lengthdir_x(32,direction),y+lengthdir_y(32,direction),target.x,target.y); - if (facing!="front"){bull.direction=point_direction(x+lengthdir_x(32,direction),y+lengthdir_y(32,direction),target.x,target.y);} - if (string_count("ova",wep)=1){bull.image_xscale=2;bull.image_yscale=2;} - if (string_count("eavy Gunz",wep)=1){bull.image_xscale=1.5;bull.image_yscale=1.5;} - if (string_count("Lance",wep)=1){bull.sprite_index=spr_ground_las;bull.image_xscale=1.5;bull.image_yscale=1.5;} - if (string_count("Ion",wep)=1){bull.sprite_index=spr_pulse;bull.image_xscale=1.5;bull.image_yscale=1.5;} - if (string_count("Rail",wep)=1){bull.sprite_index=spr_railgun;bull.image_xscale=1.5;bull.image_yscale=1.5;} - if (string_count("Gravitic",wep)=1){bull.image_xscale=2;bull.image_yscale=2;} - if (string_count("Plasma",wep)=1){bull.sprite_index=spr_ground_plasma;bull.image_xscale=2;bullimage_yscale=2;bull.speed=15;} - if (string_count("Pyro-Acid",wep)=1){bull.sprite_index=spr_glob;bull.image_xscale=2;bullimage_yscale=2;} - - if (string_count("Weapons",wep)=1) and (owner = eFACTION.Eldar){bull.sprite_index=spr_ground_las;bull.image_xscale=2;bull.image_yscale=2;} - if (string_count("Pulse",wep)=1) and (owner = eFACTION.Eldar){bull.sprite_index=spr_pulse;bull.image_xscale=1.5;bull.image_yscale=1.5;} - - } - if (string_count("orpedo",wep)=1) and (ok=3) and (owner != eFACTION.Necrons){ - if (class!="Ravager"){ - bull=instance_create(x,y+lengthdir_y(-30,direction+90),obj_en_round); - bull.speed=10;bull.direction=direction;bull.sprite_index=spr_torpedo;bull.dam=dam; - } - bull=instance_create(x,y+lengthdir_y(-10,direction+90),obj_en_round); - bull.speed=10;bull.direction=direction;bull.sprite_index=spr_torpedo;bull.dam=dam; - bull=instance_create(x,y+lengthdir_y(10,direction+90),obj_en_round); - bull.speed=10;bull.direction=direction;bull.sprite_index=spr_torpedo;bull.dam=dam; - - if (class!="Ravager"){ - bull=instance_create(x,y+lengthdir_y(30,direction+90),obj_en_round); - bull.speed=10;bull.direction=direction;bull.sprite_index=spr_torpedo;bull.dam=dam; - } - - } - - if (wep="Lightning Arc"){lightning=10; - if (target.shields>0){ - if (class="Cairn Class") or (class="Reaper Class") then target.shields-=20; - else{target.shields-=20;} - } - if (target.shields<=0){ - if (class="Cairn Class") or (class="Reaper Class") then target.hp-=10; - else{target.hp-=10;} - } - } - if (wep="Gauss Particle Whip"){whip=15; - if (target.shields>0) then target.shields-=dam; - if (target.shields<=0) then target.hp-=dam; - } - if (wep="Star Pulse Generator") and (ok=3) and (instance_exists(target)){ - bull=instance_create(x+lengthdir_x(32,direction),y+lengthdir_y(32,direction),obj_en_pulse); - bull.speed=20; - if (targe=target) then bull.direction=point_direction(x+lengthdir_x(32,direction),y+lengthdir_y(32,direction),target.x,target.y); - if (facing!="front"){bull.direction=point_direction(x+lengthdir_x(32,direction),y+lengthdir_y(32,direction),target.x,target.y);} - bull.target_x=target.x;bull.target_y=target.y; - } - - - - if ((string_count("Claws",wep)=1) or (string_count("endrils",wep)=1)) and (ok=3){ - if (target.shields<=0) then target.hp-=weapon_dam[wep]; - if (target.shields>0) then target.shields-=weapon_dam[wep]; + if (target_distance>64) and (target_distance<300){ + bull=instance_create(x,y,obj_en_round); + bull.direction=point_direction(x,y,targe.x,targe.y); + if (owner = eFACTION.Tyranids){ + bull.sprite_index=spr_glob; } - if ((string_count("Interceptor",wep)=1) or (string_count("ommerz",wep)=1) or (string_count("Manta",wep)=1) or (string_count("Glands",wep)=1) or (string_count("Eldar Launch",wep)=1)) and (ok=3){ - bull=instance_create(x,y+lengthdir_y(-30,direction+90),obj_en_in);bull.direction=self.direction;bull.owner=self.owner; + bull.speed=20; + bull.dam=3; + bull.image_xscale=0.5; + bull.image_yscale=0.5; + turret_cool=floor(60/turrets); + if (owner = eFACTION.Necrons){ + bull.sprite_index=spr_green_las; + bull.image_yscale=1; } + bull.direction+=choose(random(10),1*-(random(10))); + + bull.explosion_sprite = spr_explosion; } } - + + ship_shoot_weapons(); } +shields.step(); + + /* */ } __b__ = action_if_variable(owner, 6, 0); @@ -328,18 +146,14 @@ image_angle=direction; if (obj_fleet.start!=5) then exit; -var o_dist, dist, ch_rang, ex, spid;spid=0; - -if (shields>0) and (shields0) and (instance_exists(obj_p_ship)){ - if (class="Void Stalker"){o_dist=300;action="swoop";spid=60;} - if (class="Shadow Class"){o_dist=200;action="swoop";spid=80;} - if (class="Hellebore") or (class="Aconite"){o_dist=200;action="swoop";spid=100;} + if (class="Void Stalker"){ + closing_distance=300; + action="swoop";spid=60;} + if (class="Shadow Class"){ + closing_distance=200; + action="swoop";spid=80;} + if (class="Hellebore") or (class="Aconite"){ + closing_distance=200; + action="swoop"; + spid=100; + } - dist=point_distance(x,y,target.x,target.y)-(max(sprite_get_width(target.sprite_index),sprite_get_height(sprite_index))); + target_distance=point_distance(x,y,target.x,target.y)-(max(sprite_get_width(target.sprite_index),sprite_get_height(sprite_index))); @@ -378,157 +200,45 @@ if (hp>0) and (instance_exists(obj_p_ship)){ if (target!=0){ if (speed<((spid)/10)) then speed+=0.02; - var dist, range; + var range; if (instance_exists(target)){ - dist=point_distance(x,y,target.x,target.y); + target_distance=point_distance(x,y,target.x,target.y); - if (action="swoop"){direction=turn_towards_point(direction,x,y,target.x,target.y,5-ship_size);} - if (dist<=o_dist) and (collision_line(x,y,x+lengthdir_x(o_dist,direction),y+lengthdir_y(o_dist,direction),obj_p_ship,0,1)) then action="attack"; - if (dist<300) and (action="attack") then action="bank"; - if (action="bank") then direction=turn_towards_point(direction,x,y,room_width,room_height/2,5-ship_size); - if (action="bank") and (dist>700) then action="attack"; + if (action="swoop"){direction=turn_towards_point(direction,x,y,target.x,target.y,5-size);} + if (target_distance<=closing_distance) and (collision_line(x,y,x+lengthdir_x(closing_distance,direction),y+lengthdir_y(closing_distance,direction),obj_p_ship,0,1)) then action="attack"; + if (target_distance<300) and (action="attack") then action="bank"; + if (action="bank") then direction=turn_towards_point(direction,x,y,room_width,room_height/2,5-size); + if (action="bank") and (target_distance>700) then action="attack"; } } if (y<-2000) or (y>room_height+2000) or (x<-2000) or (x>room_width+2000) then hp=-50; - - - if (cooldown[1]>0) then cooldown[1]-=1; - if (cooldown[2]>0) then cooldown[2]-=1; - if (cooldown[3]>0) then cooldown[3]-=1; - if (cooldown[4]>0) then cooldown[4]-=1; - if (cooldown[5]>0) then cooldown[5]-=1; + if (turret_cool>0) then turret_cool-=1; - var bull, targe, rdir, dirr, dist, xx, yy, ok; - targe=0;rdir=0;dirr="";dist=9999;xx=x;yy=y; + var bull, targe, rdir, dirr, target_distance, xx, yy, ok; + targe=0;rdir=0;dirr="";target_distance=9999;xx=x;yy=y; if (turrets>0) and (instance_exists(obj_p_small)) and (turret_cool=0){ targe=instance_nearest(x,y,obj_p_small); - if (instance_exists(targe)) then dist=point_distance(x,y,targe.x,targe.y); + if (instance_exists(targe)) then target_distance=point_distance(x,y,targe.x,targe.y); - if (dist>64) and (dist<300){ + if (target_distance>64) and (target_distance<300){ bull=instance_create(x,y,obj_en_round);bull.direction=point_direction(x,y,targe.x,targe.y); if (owner = eFACTION.Tyranids) then bull.sprite_index=spr_glob; if (owner = eFACTION.Tau) or (owner = eFACTION.Eldar) then bull.sprite_index=spr_pulse; - bull.speed=20;bull.dam=3;bull.image_xscale=0.5;bull.image_yscale=0.5;turret_cool=floor(60/turrets); + bull.speed=20; + bull.dam=3; + bull.image_xscale=0.5; + bull.image_yscale=0.5;turret_cool=floor(60/turrets); bull.direction+=choose(random(10),1*-(random(10))); } } - targe=0;rdir=0;dirr="";dist=9999; - - - xx=lengthdir_x(64,direction+90); - yy=lengthdir_y(64,direction+90); - - var front, right, left, rear; - front=0;right=0;left=0;rear=0; - - targe=instance_nearest(xx,yy,obj_p_ship); - rdir=point_direction(x,y,target.x,target.y); - // if (rdir>45) and (rdir<=135) and (targe!=target){target_r=targe;right=1;} - // if (rdir>225) and (rdir<=315) and (targe!=target) and (targe!=target_r){target_l=targe;left=1;} - target_l=instance_nearest(x+lengthdir_x(64,direction+90),y+lengthdir_y(64,direction+90),obj_p_ship); - target_r=instance_nearest(x+lengthdir_x(64,direction+270),y+lengthdir_y(64,direction+270),obj_p_ship); - - if (collision_line(x,y,x+lengthdir_x(2000,direction),y+lengthdir_y(2000,direction),obj_p_ship,0,1)) then front=1; - - - var f, facing, ammo, range, wep, dam, gg;f=0;facing="";ammo=0;range=0;wep="";dam=0;gg=0; - - - repeat(weapons){ - gg+=1; - - ok=0;f+=1;facing="";ammo=0;range=0;wep=""; - - //weapon[gg]=0;weapon_ammo[gg]=0;weapon_range[gg]=0; - - - if (cooldown[gg]<=0) and (weapon[gg]!="") and (weapon_ammo[gg]>0) then ok=1; - if (ok=1){ - facing=weapon_facing[gg];ammo=weapon_ammo[gg];range=weapon_range[gg];} - - targe=target; - if (facing="front") and (front=1) then ok=2; - if (facing="most") then ok=2; - - - /* - if (facing="right") then targe=target_r; - if (facing="left") then targe=target_l; - if ((facing="front") or (facing="most")) and (front=1) then ok=2; - if (facing="right") or (facing="most") and (right=1) then ok=2; - if (facing="left") or (facing="most") and (left=1) then ok=2; - */ - if (facing="special") then ok=2; - if (!instance_exists(targe)) then exit; - dist=point_distance(x,y,targe.x,targe.y); - - if (facing="right") and (point_direction(x,y,target_r.x,target_r.y)<337) and (point_direction(x,y,target_r.x,target_r.y)>203) then ok=2; - if (facing="left") and (point_direction(x,y,target_r.x,target_r.y)>22) and (point_direction(x,y,target_r.x,target_r.y)<157) then ok=2; - - /*var re_deh;re_deh=relative_direction(direction,target.direction); - if (re_deh<45) or (re_deh>315) or ((re_deh>135) and (re_deh<225)) then direction=turn_towards_point(direction,x+lengthdir_x(128,target.direction-90),y,target.x,target.y+lengthdir_y(128,target.direction-90),.2) - */ - - - - if (ok=2) and (dist<(range+(max(sprite_get_width(sprite_index),sprite_get_height(sprite_index))))){ - if (ammo>0) and (ammo<900) then ammo-=1; - weapon_ammo[gg]=ammo;cooldown[gg]=weapon_cooldown[gg];wep=weapon[gg];dam=weapon_dam[gg]; - - // if (f=3) and (ship_id=2) then show_message("ammo: "+string(ammo)+" | range: "+string(range)); - - if (ammo<0) then ok=0; - ok=3; - - if (string_count("orpedo",wep)=0) and (string_count("Interceptor",wep)=0) and (string_count("ommerz",wep)=0) and (string_count("Claws",wep)=0) and (string_count("endrils",wep)=0) and (ok=3){ - bull=instance_create(x+lengthdir_x(32,direction),y+lengthdir_y(32,direction),obj_en_round); - bull.speed=20;bull.dam=dam; - if (targe=target) then bull.direction=point_direction(x+lengthdir_x(32,direction),y+lengthdir_y(32,direction),target.x,target.y); - if (facing!="front"){bull.direction=point_direction(x+lengthdir_x(32,direction),y+lengthdir_y(32,direction),target.x,target.y);} - if (string_count("ova",wep)=1){bull.image_xscale=2;bull.image_yscale=2;} - if (string_count("eavy Gunz",wep)=1){bull.image_xscale=1.5;bull.image_yscale=1.5;} - if (string_count("Lance",wep)=1){bull.sprite_index=spr_ground_las;bull.image_xscale=1.5;bull.image_yscale=1.5;} - if (string_count("Ion",wep)=1){bull.sprite_index=spr_pulse;bull.image_xscale=1.5;bull.image_yscale=1.5;} - if (string_count("Rail",wep)=1){bull.sprite_index=spr_railgun;bull.image_xscale=1.5;bull.image_yscale=1.5;} - if (string_count("Gravitic",wep)=1){bull.image_xscale=2;bull.image_yscale=2;} - if (string_count("Plasma",wep)=1){bull.sprite_index=spr_ground_plasma;bull.image_xscale=2;bullimage_yscale=2;bull.speed=15;} - if (string_count("Pyro-Acid",wep)=1){bull.sprite_index=spr_glob;bull.image_xscale=2;bullimage_yscale=2;} - - if (string_count("Weapons",wep)=1) and (owner = eFACTION.Eldar){bull.sprite_index=spr_ground_las;bull.image_xscale=2;bull.image_yscale=2;} - if (string_count("Pulse",wep)=1) and (owner = eFACTION.Eldar){bull.sprite_index=spr_pulse;bull.image_xscale=1.5;bull.image_yscale=1.5;} - - } - if (string_count("orpedo",wep)=1) and (ok=3){ - if (class!="Ravager"){ - bull=instance_create(x,y+lengthdir_y(-30,direction+90),obj_en_round); - bull.speed=10;bull.direction=direction;bull.sprite_index=spr_torpedo;bull.dam=dam; - } - bull=instance_create(x,y+lengthdir_y(-10,direction+90),obj_en_round); - bull.speed=10;bull.direction=direction;bull.sprite_index=spr_torpedo;bull.dam=dam; - bull=instance_create(x,y+lengthdir_y(10,direction+90),obj_en_round); - bull.speed=10;bull.direction=direction;bull.sprite_index=spr_torpedo;bull.dam=dam; - - if (class!="Ravager"){ - bull=instance_create(x,y+lengthdir_y(30,direction+90),obj_en_round); - bull.speed=10;bull.direction=direction;bull.sprite_index=spr_torpedo;bull.dam=dam; - } - - } - if ((string_count("Claws",wep)=1) or (string_count("endrils",wep)=1)) and (ok=3){ - if (target.shields<=0) then target.hp-=weapon_dam[wep]; - if (target.shields>0) then target.shields-=weapon_dam[wep]; - } - if ((string_count("Interceptor",wep)=1) or (string_count("ommerz",wep)=1) or (string_count("Manta",wep)=1) or (string_count("Glands",wep)=1) or (string_count("Eldar Launch",wep)=1)) and (ok=3){ - bull=instance_create(x,y+lengthdir_y(-30,direction+90),obj_en_in);bull.direction=self.direction;bull.owner=self.owner; - } - } - } + + ship_shoot_weapons(); } diff --git a/objects/obj_en_ship/obj_en_ship.yy b/objects/obj_en_ship/obj_en_ship.yy index 0e2b4100ef..c03f0d75c9 100644 --- a/objects/obj_en_ship/obj_en_ship.yy +++ b/objects/obj_en_ship/obj_en_ship.yy @@ -3,7 +3,6 @@ "%Name":"obj_en_ship", "eventList":[ {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":3,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, ], diff --git a/objects/obj_enunit/Alarm_0.gml b/objects/obj_enunit/Alarm_0.gml index cce9d94850..7e58c265fb 100644 --- a/objects/obj_enunit/Alarm_0.gml +++ b/objects/obj_enunit/Alarm_0.gml @@ -43,14 +43,14 @@ if (!engaged){ // Shooting if (instance_exists(obj_nfort) && !flank) { enemy = instance_nearest(x,y,obj_nfort); - dist = 2; + target_distance = 2; } else { - dist=get_block_distance(enemy); + target_distance=get_block_distance(enemy); } target_unit_index=0; - if (range[i] >= dist) { // The weapon is in range; + if (range[i] >= target_distance) { // The weapon is in range; var _target_vehicles = apa[i] > 0 ? true : false; // AP weapons target vehicles // if (string_count("Gauss",wep[i])>0) then _target_vehicles=true; @@ -214,8 +214,8 @@ if (!engaged){ // Shooting //TODO: The melee code was not refactored; else if ((engaged || enemy.engaged) and target_block_is_valid( enemy,obj_pnunit)){// Melee engaged=1; - var i=0,dist=999,no_ap=1; - // dist=point_distance(x,y,enemy.x,enemy.y)/10; + var i=0,target_distance=999,no_ap=1; + // target_distance=point_distance(x,y,enemy.x,enemy.y)/10; if !(instance_exists(obj_pnunit))then exit; for (var i=0;i=dist) and (ammo[i]!=0){ + if (wep[i]!="") and (range[i]>=target_distance) and (ammo[i]!=0){ if (range[i]!=1) and (engaged=0) then range_shoot="ranged"; if ((range[i]!=floor(range[i])) or (range[i]=1)) and (engaged=1) then range_shoot="melee"; } @@ -350,7 +350,7 @@ var range_shooti; - if (wep[i]!="") and (range_shoot="ranged") and (range[i]>=dist){// Weapon meets preliminary checks + if (wep[i]!="") and (range_shoot="ranged") and (range[i]>=target_distance){// Weapon meets preliminary checks var _armour_piercing;_armour_piercing=0;if (apa[i]>att[i]) then _armour_piercing=1;// Determines if it is _armour_piercing or not // if (wep[i]="Missile Launcher") then _armour_piercing=1; diff --git a/objects/obj_event/Step_0.gml b/objects/obj_event/Step_0.gml index 1cc544cc36..8853ab6034 100644 --- a/objects/obj_event/Step_0.gml +++ b/objects/obj_event/Step_0.gml @@ -34,16 +34,23 @@ if (closing=true) and (fading=-1) and (fade_alpha<=0){ p1=obj_controller.fest_type; p3=""; p2=obj_controller.fest_planet; + + if (p2>0) then p3=string(obj_controller.fest_star)+" "+scr_roman(obj_controller.fest_wid); - if (p2<=0) then p3=+" the vessel '"+string(obj_ini.ship[obj_controller.fest_sid])+"'"; + if (p2<=0){ + var _ship = fetch_ship(obj_controller.fest_sid); + p3=+$" the vessel '{_ship.name}'"; + } scr_alert("green","event",string(p1)+" on "+string(p3)+" ends.",0,0); scr_event_log("green",string(p1)+" on "+string(p3)+" ends.", p3); } with(obj_popup){ - if (number!=0) then obj_turn_end.alarm[1]=10; + if (number!=0){ + setup_audience_and_popup_timer(10); + } instance_destroy(); } obj_controller.cooldown=30; diff --git a/objects/obj_fleet/Alarm_0.gml b/objects/obj_fleet/Alarm_0.gml index a5c46ed6e7..5cfd277731 100644 --- a/objects/obj_fleet/Alarm_0.gml +++ b/objects/obj_fleet/Alarm_0.gml @@ -7,5 +7,8 @@ start=7; with(obj_controller){ if (zoomed=1) then scr_zoom(); + camera_set_view_size(view_camera[0], room_width, room_height); + x = room_width/2; + y = room_height/2; } diff --git a/objects/obj_fleet/Alarm_1.gml b/objects/obj_fleet/Alarm_1.gml index e4450c8a7c..6edcbfbcd7 100644 --- a/objects/obj_fleet/Alarm_1.gml +++ b/objects/obj_fleet/Alarm_1.gml @@ -7,13 +7,23 @@ if (control=1) then instance_activate_object(obj_cursor); if (enemy=2){ - if (en_escort>0){en_column[4]="Sword Class Frigate";en_num[4]=en_escort;en_size[4]=1;} + if (en_escort>0){ + en_column[4]="Sword Class Frigate"; + en_num[4]=en_escort; + en_size[4]=1; + } - if (en_frigate>0){en_column[3]="Avenger Class Grand Cruiser";en_num[3]=en_frigate;en_size[3]=2;} + if (en_frigate>0){ + en_column[3]="Avenger Class Grand Cruiser"; + en_num[3]=en_frigate; + en_size[3]=2; + } - var i;i=0;i=en_capital; + var i=0; + i=en_capital; if (i>0){ - en_column[2]="Apocalypse Class Battleship";en_num[2]=floor(random(i))+1; + en_column[2]="Apocalypse Class Battleship"; + en_num[2]=floor(random(i))+1; if (en_num[2]<(en_capital*0.6)) then en_num[2]=round(en_capital*0.6); i-=en_num[2];en_size[2]=3; } @@ -97,7 +107,7 @@ if (enemy=9){ } if (enemy=10){ - var i;i=0;i=en_frigate; + var i=0;i=en_frigate; if (en_capital>0){en_column[1]="Desecrator";en_num[1]=en_capital;en_size[1]=3;} @@ -107,7 +117,11 @@ if (enemy=10){ if (i>0){en_column[4]="Daemon";en_num[4]=i;i-=en_num[4];en_size[4]=2;}// en_num[3]+=en_num[2]+1; - if (en_escort>0){en_column[5]="Iconoclast";en_num[5]=en_escort;en_size[5]=1;}// en_num[5]+=en_num[4]+1; + if (en_escort>0){ + en_column[5]="Iconoclast"; + en_num[5]=en_escort; + en_size[5]=1; + }// en_num[5]+=en_num[4]+1; } diff --git a/objects/obj_fleet/Alarm_2.gml b/objects/obj_fleet/Alarm_2.gml index c4cd3fd765..7e87f39d30 100644 --- a/objects/obj_fleet/Alarm_2.gml +++ b/objects/obj_fleet/Alarm_2.gml @@ -19,7 +19,7 @@ player_fleet_ship_spawner(); if (enemy=2){// This is an orderly Tau ship formation var xx,yy,i, temp1, x2, man; - xx=0;yy=0;i=0;temp1=0;x2=1200;man=0; + xx=0;yy=0;i=0;temp1=0;x2=room_width-500;man=0; if (en_num[4]>0){ yy=(room_height/2)-((en_height[4]*en_num[4])/2); @@ -70,7 +70,7 @@ if (en_capital>0){en_column[1]="Void Stalker";en_num[1]=en_capital;en_size[1]=3; if (enemy=6){// This is an orderly Tau ship formation var xx,yy,i, temp1, x2, man; - xx=0;yy=0;i=0;temp1=0;x2=1200;man=0; + xx=0;yy=0;i=0;temp1=0;x2=room_width-500;man=0; if (en_num[4]>0){ yy=128; @@ -109,8 +109,8 @@ if (enemy=6){// This is an orderly Tau ship formation if (enemy=7) or (enemy=10){// This is spew out random ships without regard for formations - var xx,yy,dist,targ,numb,man; - xx=0;yy=0;dist=0;target=0;numb=0;man=0; + var xx,yy,target_distance,targ,numb,man; + xx=0;yy=0;target_distance=0;target=0;numb=0;man=0; var i;i=0; @@ -136,7 +136,7 @@ if (enemy=7) or (enemy=10){// This is spew out random ships without regard for f if (enemy=8){// This is an orderly Tau ship formation var xx,yy,i, temp1, x2, man; - xx=0;yy=0;i=0;temp1=0;x2=1200;man=0; + xx=0;yy=0;i=0;temp1=0;x2=room_width-500;man=0; yy=(room_height/2)-((en_height[5]*en_num[5])/2); yy+=(en_height[5]/2); @@ -175,7 +175,7 @@ if (enemy=8){// This is an orderly Tau ship formation if (enemy=9){// This is an orderly Tyranid ship formation var xx,yy,i, temp1, x2, man; - xx=0;yy=0;i=0;temp1=0;x2=1200;man=0; + xx=0;yy=0;i=0;temp1=0;x2=room_width-500;man=0; yy=(room_height/2)-((en_height[4]*en_num[4])/2); yy+=(en_height[4]/2); diff --git a/objects/obj_fleet/Alarm_4.gml b/objects/obj_fleet/Alarm_4.gml index 605cd4a9b5..645cd895ed 100644 --- a/objects/obj_fleet/Alarm_4.gml +++ b/objects/obj_fleet/Alarm_4.gml @@ -21,28 +21,28 @@ instance_activate_object(obj_turn_end); if (player_started=0){ with(obj_turn_end){ - current_battle+=1; - alarm[0]=1; + end_turn_battle_next_sequence(); } } if (player_started=1){ var taxt;taxt=""; taxt=string(global.chapter_name)+" engage and destroy a"; - if (enemy[1]=2) or (enemy[1]=4) or (enemy[1]=5) or (enemy[1]=6) then taxt+="n"; - taxt+=" "+string(obj_controller.faction[enemy[1]]); - taxt+=" fleet at "+string(ene_fleet.name)+".";scr_event_log("",taxt); + if (enemy[target_enemy]=2) or (enemy[target_enemy]=4) or (enemy[target_enemy]=5) or (enemy[target_enemy]=6) then taxt+="n"; + taxt+=" "+string(obj_controller.faction[enemy[target_enemy]]); + taxt+=" fleet at "+string(battle_system.name)+".";scr_event_log("",taxt); if (instance_exists(obj_star_select)) then with(obj_star_select){ - alarm[1]=1;player_fleet=0; + alarm[1]=1; + player_fleet=0; var i=-1;repeat(15){i+=1;en_fleet[i]=0;} } if (instance_exists(pla_fleet)){ pla_fleet.acted=2; if (capital+frigate+escort=0) then with(pla_fleet){instance_destroy();} } - if (enemy[1]!=4) and (obj_controller.faction_status[enemy[1]]!="War"){ - scr_audience(enemy[1], "declare_war", obj_controller.disposition[enemy[1]]-20, "War", 3, 2); + if (enemy[target_enemy]!=4) and (obj_controller.faction_status[enemy[target_enemy]]!="War"){ + scr_audience(enemy[target_enemy], "declare_war", obj_controller.disposition[enemy[target_enemy]]-20, "War", 3, 2); } } @@ -54,6 +54,6 @@ if (view_x+view_y>0){ -// show_message(obj_turn_end.current_battle); + with(obj_controller){instance_activate_all();} instance_destroy(); diff --git a/objects/obj_fleet/Alarm_6.gml b/objects/obj_fleet/Alarm_6.gml deleted file mode 100644 index 1d2846a7d0..0000000000 --- a/objects/obj_fleet/Alarm_6.gml +++ /dev/null @@ -1,114 +0,0 @@ - -/* -enemy[2]=6;enemy_status[2]=1; -en_capital[2]=2;en_frigate[2]=3;en_escort[2]=5; -en_capital_max[2]=2;en_frigate_max[2]=3;en_escort_max[2]=5; -en_ships_max[2]=10; - -enemy[3]=2;enemy_status[3]=1; -en_capital[3]=1;en_frigate[3]=2;en_escort[3]=3; -en_capital_max[3]=1;en_frigate_max[3]=2;en_escort_max[3]=3; -en_ships_max[3]=6; -*/ - -var total_enemies, total_allies, t, tt, y1, y2, fug, spawner; -total_enemies=0; -total_allies=1; -spawner=0; -t=0;y1=0;y2=0;tt=0;fug=0; - -repeat(6){t+=1; - if (enemy[t]!=0){ - if (enemy_status[t]<0) then total_enemies+=1; - if (enemy_status[t]>0) then total_allies+=1; - - // show_message("Computer "+string(t)+":"+string(enemy[t])+", status:"+string(enemy_status[t])); - } -} - - - -if (total_enemies>0){ - t=1;y2=room_height/total_enemies/2;tt=0; - repeat(5){fug+=1; - if (enemy_status[fug]<0){ - tt+=1;y1=(t*y2); - - spawner=instance_create(room_width+200,y1,obj_fleet_spawner); - spawner.owner=enemy[fug]; - spawner.height=(y2); - spawner.number=fug; - - t+=2; - } - } -} - -if (total_allies>0){ - y1=0;fug=0; - t=1; - y2=room_height/total_allies/2; - tt=0; - repeat(5){ - fug+=1; - if (enemy_status[fug]>0){ - tt+=1; - y1=(t*y2); - - spawner=instance_create(200,y1,obj_fleet_spawner); - - if (fug=1) then spawner.owner = eFACTION.Player; - if (fug>1) then spawner.owner=enemy[fug];// Get the ENEMY after the actual enemies - - spawner.height=(y2); - spawner.number=fug; - - t+=2; - } - } -} - - -// show_message("Total Enemies: "+string(total_enemies)); -// show_message("Total Allies: "+string(total_allies)); - - -// Buffs here -// if (ambushers=1) or (enemy=8) then -attack_mode="offensive"; -// if (enemy=9) then attack_mode="defensive"; - -if (ambushers=1) and (ambushers=999) then global_attack=global_attack*1.1;// Need to finish this -if (bolter_drilling=1) then global_bolter=global_bolter*1.1; -// if (enemy_eldar=1) and (enemy=6){global_attack=global_attack*1.1;global_defense=global_defense*1.1;} -// if (enemy_fallen=1) and (enemy=10){global_attack=global_attack*1.1;global_defense=global_defense*1.1;} -// if (enemy_orks=1) and (enemy=7){global_attack=global_attack*1.1;global_defense=global_defense*1.1;} -// if (enemy_tau=1) and (enemy=8){global_attack=global_attack*1.1;global_defense=global_defense*1.1;} -// if (enemy_tyranids=1) and (enemy=10){global_attack=global_attack*1.1;global_defense=global_defense*1.1;} -if (siege=1) and (siege=555) then global_attack=global_attack*1.2;// Need to finish this -if (slow=1){global_attack=global_attack*0.9;global_defense=global_defense*1.2;} -if (melee=1) then global_melee=global_melee*1.15; -// -if (shitty_luck=1) then global_defense=global_defense*0.9; -// if (lyman=1) and (dropping=1) then ||| handle within each object -if (ossmodula=1){global_attack=global_attack*0.95;global_defense=global_defense*0.95;} -if (betchers=1) then global_melee=global_melee*0.95; -if (catalepsean=1){global_attack=global_attack*0.95;} -// if (occulobe=1){if (time=5) or (time=6) then global_attack=global_attack*0.7;global_defense=global_defense*0.9;} - -// More prep for player - -var i=0,k=0,onceh=0; - -// instance_activate_object(obj_combat_info); - -capital_max=capital; -frigate_max=frigate; -escort_max=escort; - -obj_fleet_spawner.alarm[0]=1; - - -// alarm[1]=2; -/* */ -/* */ diff --git a/objects/obj_fleet/Alarm_7.gml b/objects/obj_fleet/Alarm_7.gml deleted file mode 100644 index 2cd61ecc75..0000000000 --- a/objects/obj_fleet/Alarm_7.gml +++ /dev/null @@ -1,166 +0,0 @@ -try { - var _player_battle_fleet, yeehaw2, tstar; - _player_battle_fleet=0;yeehaw2=0;tstar=0; - - if (player_started=1){ - _player_battle_fleet=pla_fleet; - yeehaw2=ene_fleet; - } - - if (player_started=0) and (instance_exists(obj_turn_end)){ - _player_battle_fleet=obj_turn_end.battle_pobject[obj_turn_end.current_battle]; - } - - - if (instance_number(obj_en_ship)>0){ - scr_recent("fleet_defeat",star_name,(capital_lost*6)+(frigate_lost*2)+escort_lost); - } - if (instance_number(obj_en_ship)<=0){ - with(obj_p_ship){ - if (hp<=0) then scr_recent("ship_destroyed",obj_ini.ship[ship_id],ship_id); - } - } - - with (_player_battle_fleet){ - scr_ini_ship_cleanup() - - if (player_fleet_ship_count() == 0) then instance_destroy(); - } - - var op,ii,killer,killer_tg;op=0;killer=0;killer_tg=0;ii=-50; - - - - - - if (player_started=0) and (instance_exists(obj_turn_end)) then with(obj_star){if (name!=obj_turn_end.battle_location[obj_turn_end.current_battle]){x-=10000;y-=10000;}} - if (player_started=1) then with(obj_star){if (id!=obj_fleet.ene_fleet){x-=10000;y-=10000;}} - ii=instance_nearest(room_width,room_height,obj_star); - obj_controller.temp[1070]=ii.id; - with(obj_star){if (x<-5000) and (y<-5000){x+=10000;y+=10000;}} - - - - - - - - op=0;var ofleet;ofleet=0; - repeat(5) { - op+=1; - if (enemy[op]!=0) and (enemy[op]!=4){ofleet=0; - obj_controller.temp[1071]=enemy[op]; - - // show_message("Hiding all but the fleet owned by "+string(obj_controller.temp[1071])); - - with(obj_en_fleet){if (owner!=obj_controller.temp[1071]) or (orbiting!=obj_controller.temp[1070]){x-=10000;y-=10000;}} - - ofleet=instance_nearest(room_width/2,room_height/2,obj_en_fleet); - // show_message("Fleet: "+string(ofleet.capital_number)+"/"+string(ofleet.frigate_number)+"/"+string(ofleet.escort_number)+", lost "+string(en_capital_lost[op])+"/"+string(en_frigate_lost[op])+"/"+string(en_escort_lost[op])); - - repeat(50){ - if (!instance_exists(ofleet)){ofleet=instance_nearest(room_width/2,room_height/2,obj_en_fleet);} - if (instance_exists(ofleet)){ - if (ofleet.trade_goods="player_hold") then ofleet.trade_goods=""; - // show_message("ofleet x:"+string(ofleet.x)+", ofleet y:"+string(ofleet.y)+", ofleet owner: "+string(ofleet.owner)+" wants "+string(enemy[op])); - if (ofleet.x>-7000) and (ofleet.y>-7000) and (ofleet.owner=enemy[op]){ - if (en_capital_lost[op]+en_frigate_lost[op]+en_escort_lost[op]>=ofleet.capital_number+ofleet.frigate_number+ofleet.escort_number){ - en_capital_lost[op]-=ofleet.capital_number;en_frigate_lost[op]-=ofleet.frigate_number;en_escort_lost[op]-=ofleet.escort_number; - // show_message("Fleet baleeted"); - with(ofleet){instance_destroy();} - } - if (en_capital_lost[op]+en_frigate_lost[op]+en_escort_lost[op]>0) and (instance_exists(ofleet)){ - // show_message("Fleet: "+string(ofleet.capital_number)+"/"+string(ofleet.frigate_number)+"/"+string(ofleet.escort_number)+", lost "+string(en_capital_lost[op])+"/"+string(en_frigate_lost[op])+"/"+string(en_escort_lost[op])); - if (en_capital_lost[op]>0) and (ofleet.capital_number>0){en_capital_lost[op]-=1;ofleet.capital_number-=1;} - if (en_frigate_lost[op]>0) and (ofleet.frigate_number>0){en_frigate_lost[op]-=1;ofleet.frigate_number-=1;} - if (en_escort_lost[op]>0) and (ofleet.escort_number>0){en_escort_lost[op]-=1;ofleet.escort_number-=1;} - if (ofleet.capital_number+ofleet.frigate_number+ofleet.escort_number<=0) then with(ofleet){instance_destroy();} - } - } - } - } - - with(obj_en_fleet){if (x<-7000) and (y<-7000){x+=10000;y+=10000;}} - - // if (instance_exists(ofleet)){show_message("Fleet: "+string(ofleet.capital_number)+"/"+string(ofleet.frigate_number)+"/"+string(ofleet.escort_number));} - // if (!instance_exists(ofleet)){show_message("FlEET WAS DELETED");} - } - - // show_message("End ship removing"); - - if (enemy[op]=4) and (enemy_status[op]<0){ - obj_controller.temp[1071]=enemy[op]; - with(obj_en_fleet){if (owner!=obj_controller.temp[1071]) or (orbiting!=obj_controller.temp[1070]){x-=10000;y-=10000;}} - ofleet=instance_nearest(room_width/2,room_height/2,obj_en_fleet); - killer=1; - obj_controller.temp[1071]=enemy[op]; - killer_tg=ofleet.inquisitor; - with(ofleet){instance_destroy();} - with(obj_en_fleet){{x+=10000;y+=10000;}} - } - } - - - - - - obj_controller.cooldown=20; - - if (killer>0){ - scr_loyalty("Inquisitor Killer","+"); - if (obj_controller.loyalty>=85) then obj_controller.last_world_inspection-=44; - if (obj_controller.loyalty>=70) and (obj_controller.loyalty<85) then obj_controller.last_world_inspection-=32; - if (obj_controller.loyalty>=50) and (obj_controller.loyalty<70) then obj_controller.last_world_inspection-=20; - if (obj_controller.loyalty<50) then scr_loyalty("Inquisitor Killer","+"); - - var msg="",msg2="",i=0; - if (killer_tg > 0){ - var inquis_name = obj_controller.inquisitor[killer_tg]; - msg+=$"Inquisitor {inquis_name} has been killed!"; - msg2=$"Inquisitor {inquis_name}"; - } - if (obj_controller.inquisitor_type[killer_tg]=="Ordo Hereticus") then scr_loyalty("Inquisitor Killer","+"); - - array_delete(obj_controller.inquisitor_gender, killer_tg,1); - array_delete(obj_controller.inquisitor_type, killer_tg,1); - array_delete(obj_controller.inquisitor, killer_tg,1); - - array_push(obj_controller.inquisitor_gender, choose(0,0,0,1,1,1,1)); - array_push(obj_controller.inquisitor_type, choose("Ordo Malleus","Ordo Xenos","Ordo Hereticus","Ordo Hereticus","Ordo Hereticus","Ordo Hereticus","Ordo Hereticus","Ordo Hereticus")); - array_push(obj_controller.inquisitor, global.name_generator.generate_imperial_name(obj_controller.inquisitor_gender[i])); - - instance_activate_object(obj_turn_end); - - if (instance_exists(obj_turn_end)) then scr_alert("red","inqis",string(msg),ii.x+16,ii.y-24); - if (!instance_exists(obj_turn_end)) and (obj_controller.faction_status[eFACTION.Inquisition]!="War"){ - var pip;pip=instance_create(0,0,obj_popup); - pip.title="Inquisitor Killed"; - pip.text=msg; - pip.image="inquisition"; - pip.cooldown=20; - - if (obj_controller.known[eFACTION.Inquisition]<3){ - pip.title="EXCOMMUNICATUS TRAITORUS"; - pip.text=$"The Inquisition has noticed your uncalled murder of {msg2} and declared your chapter Excommunicatus Traitorus."; - obj_controller.alarm[8]=1; - } - } - - - // if (obj_controller.known[eFACTION.Inquisition]<3) then with(obj_popup){instance_destroy();} - - - - // excommunicatus traitorus - } - - instance_activate_all(); - - if (instance_exists(obj_p_assra)){obj_p_assra.alarm[0]=1;} - alarm[4]=2; - - - -} catch(_exception) { - handle_exception(_exception); -} \ No newline at end of file diff --git a/objects/obj_fleet/Create_0.gml b/objects/obj_fleet/Create_0.gml index 68c77a33db..67fc8b279d 100644 --- a/objects/obj_fleet/Create_0.gml +++ b/objects/obj_fleet/Create_0.gml @@ -3,12 +3,17 @@ instance_activate_object(obj_controller); log_message("Fleet Combat Started"); -beg=0;fallen=0;fallen_command=0; +beg=0;fallen=0; +fallen_command=0; obj_controller.cooldown=20; -sel_x1=0;sel_y1=0;control=0; +sel_x1=0; +sel_y1=0;control=0; ships_selected=0; battle_special=""; -csm_exp=0;star_name=""; +csm_exp=0; +star_name=""; + +explosions = []; // woohoo=0; left_down=0; @@ -19,9 +24,19 @@ obj_controller.x=0; obj_controller.y=240; obj_controller.combat=1; is_zoomed=obj_controller.zoomed; -start=0;combat_end=170; - -if (obj_controller.zoomed=0) then with(obj_controller){scr_zoom();} +start=0; +combat_end=170; + +fleet_select_box = false; + +if (obj_controller.zoomed=0){ + set_zoom_to_default() +} else { + with(obj_controller){ + scr_zoom(); + } + set_zoom_to_default(); +} enemy=0; enemy_status="attacking"; @@ -34,7 +49,7 @@ player_lasers=0; player_lasers_cd=70; player_lasers_target=0; pla_fleet=0; -ene_fleet=0; +battle_system=0; victory=false; instance_deactivate_all(true); @@ -63,27 +78,23 @@ k=-1; j=-1; -repeat(6){k+=1;j=-1; - repeat(11){j+=1; - enemy[j]=0; - enemy_status[j]=0; - - /*en_column[j,k]=""; - en_width[j,k]=0;en_height[j,k]=0; - en_num[j,k]=0;en_size[j,k]=0;*/ - - en_capital[j]=0; - en_capital_max[j]=0; - en_capital_lost[j]=0; - en_frigate[j]=0; - en_frigate_max[j]=0; - en_frigate_lost[j]=0; - en_escort[j]=0; - en_escort_max[j]=0; - en_escort_lost[j]=0; - en_ships_max[j]=0; - } -} +enemy = []; +enemy_status = []; + +/*en_column[j,k]=""; +en_width[j,k]=0;en_height[j,k]=0; +en_num[j,k]=0;en_size[j,k]=0;*/ + +en_capital = []; +en_capital_max = []; +en_capital_lost = []; +en_frigate = []; +en_frigate_max = []; +en_frigate_lost = []; +en_escort = []; +en_escort_max = []; +en_escort_lost = []; +en_ships_max = []; // Should be 0-5 for each of the factions @@ -157,7 +168,8 @@ ship_id = []; // screwing around below here -alarm[6]=2; +wait_and_execute(2, start_enemy_fleet_spawn,[] , self); + // // waiting at this point- show loading screen // in this time the obj_controller passes over which units will be fighting, similar to the below code diff --git a/objects/obj_fleet/Draw_0.gml b/objects/obj_fleet/Draw_0.gml index e69de29bb2..7ddce9239a 100644 --- a/objects/obj_fleet/Draw_0.gml +++ b/objects/obj_fleet/Draw_0.gml @@ -0,0 +1,54 @@ + + +draw_set_alpha(1); + +for (var i=array_length(explosions)-1; i>= 0;i--){ + if (explosions[i].draw() == -1){ + delete explosions[i]; + array_delete(explosions, i , 1); + } +} +if (start!=5){ + exit; +} +if(mouse_check_button_pressed(mb_left)){ + var _mb_consts = return_mouse_consts(); + fleet_select_box = new DragBox( + _mb_consts[0], + _mb_consts[1], + mb_left, + function(x_start,y_start,x_end,y_end){ + obj_fleet.ships_selected = 0; + with (obj_p_ship){ + if (point_in_rectangle(x, y,x_start,y_start,x_end,y_end )){ + obj_fleet.ships_selected++; + selected = 1; + } else { + if (selected && !keyboard_check(vk_shift)){ + selected = 0; + } + } + } + }, + function(x_start,y_start,x_end,y_end){ + obj_fleet.ships_selected = 0; + with (obj_p_ship){ + if (point_in_rectangle(x, y,x_start,y_start,x_end,y_end )){ + obj_fleet.ships_selected++; + selected = 1; + } else { + if (selected && !keyboard_check(vk_shift)){ + selected = 0; + } + } + } + } + ); +} + +if (fleet_select_box!= false){ + if (!fleet_select_box.step()){ + delete fleet_select_box; + fleet_select_box = false; + }; +} \ No newline at end of file diff --git a/objects/obj_fleet/Draw_64.gml b/objects/obj_fleet/Draw_64.gml index dd80258628..baaac949ab 100644 --- a/objects/obj_fleet/Draw_64.gml +++ b/objects/obj_fleet/Draw_64.gml @@ -206,3 +206,5 @@ if (start == 7) { draw_set_valign(fa_bottom); draw_text(_result_center_x, _bbox_y2 - _padding_y, _result_box_footer); } + + diff --git a/objects/obj_fleet/KeyPress_13.gml b/objects/obj_fleet/KeyPress_13.gml index 5b3cc5e72e..6e0bac5ea7 100644 --- a/objects/obj_fleet/KeyPress_13.gml +++ b/objects/obj_fleet/KeyPress_13.gml @@ -1,39 +1,33 @@ -var __b__; -__b__ = action_if_variable(obj_controller.cooldown, 0, 2); -if !__b__ -{ -__b__ = action_if_variable(start, 7, 0); -if !__b__ -{ -{ -start = 5; -// show_message(string(ships_max)); - -/*en_capital_max=en_capital; -en_frigate_max=en_frigate; -en_escort_max=en_escort;*/ - -beg=1; - -/* */ -} -} + + +//this is key press enter because who the fuck knows whar keypress_13 is +var _cool = obj_controller.cooldown; +if (_cool){ + exit; } -__b__ = action_if_variable(obj_controller.cooldown, 0, 2); -if !__b__ -{ -__b__ = action_if_variable(start, 7, 0); -if __b__ -{ -// End battle crap here +//why 7? idk ask duke +if (start != 7){ + { + start = 5; + // show_message(string(ships_max)); -instance_activate_all(); -room_speed=30; -alarm[7]=1; + /*en_capital_max=en_capital; + en_frigate_max=en_frigate; + en_escort_max=en_escort;*/ + beg=1; -/* */ -} + /* */ + } +}else { + + // End battle crap heres + + instance_activate_all(); + room_speed=30; + wait_and_execute(1, ship_combat_cleanup,[] , self); + + /* */ } /* */ diff --git a/objects/obj_fleet/Mouse_53.gml b/objects/obj_fleet/Mouse_53.gml deleted file mode 100644 index 1e74f5a699..0000000000 --- a/objects/obj_fleet/Mouse_53.gml +++ /dev/null @@ -1,13 +0,0 @@ - -if (sel_x1+sel_y1=0) and (control=1){ - if (instance_exists(obj_p_ship)){ - left_down=50;sel_x1=mouse_x;sel_y1=mouse_y;ships_selected=0; - - with(obj_p_ship){ - if (keyboard_check(vk_shift)=false) then selected=0; - sel_x1=mouse_x;sel_y1=mouse_y; - } - } -} - - diff --git a/objects/obj_fleet/Mouse_56.gml b/objects/obj_fleet/Mouse_56.gml index 9d4a7d0548..aa0d6f2ff2 100644 --- a/objects/obj_fleet/Mouse_56.gml +++ b/objects/obj_fleet/Mouse_56.gml @@ -1,39 +1,5 @@ -var pressy;pressy=0; -sel_x1=0;sel_y1=0; - - -if (instance_exists(obj_p_ship)) and (control=1){ - left_down=0; - with(obj_p_ship){ - var casey=2; - sel_x2=mouse_x; - sel_y2=mouse_y; - - if (point_distance(sel_x1,sel_y1,sel_x2,sel_y2)<30) then casey=1; - - if (casey=1){ - selected=0; - if (point_distance(mouse_x,mouse_y,x,y)<=30){ - selected=1; - obj_fleet.ships_selected+=1; - } - } - - if (casey=2){ - if point_in_rectangle(x,y,sel_x1,sel_y1,sel_x2,sel_y2){ - selected=1; - obj_fleet.ships_selected+=1; - } - else{ - if (!keyboard_check(vk_shift)) then selected=0; - } - } - - sel_x1=0;sel_y1=0;sel_x2=0;sel_y2=0; - } -} if (start=5) and (obj_controller.zoomed=0){ if (mouse_x>=__view_get( e__VW.XView, 0 )+12) and (mouse_y>=__view_get( e__VW.YView, 0 )+436) and (mouse_x<__view_get( e__VW.XView, 0 )+48) and (mouse_y<__view_get( e__VW.YView, 0 )+480) and (room_speed<90) then room_speed+=30; diff --git a/objects/obj_fleet/Step_0.gml b/objects/obj_fleet/Step_0.gml index 475e3f1b9f..beb26c54f0 100644 --- a/objects/obj_fleet/Step_0.gml +++ b/objects/obj_fleet/Step_0.gml @@ -16,7 +16,7 @@ if (beg!=0)/* and (instance_exists(obj_fleet_controller))*/{ //^have this be the same as roomSettings Height and Width or fleets will auto end! combat_end-=1; - log_message("Fleet Combat Ended- Loss - Enemy:"+string(enemy[1])); + log_message("Fleet Combat Ended- Loss - Enemy:"+string(enemy[0])); } } } @@ -25,7 +25,7 @@ if (beg!=0)/* and (instance_exists(obj_fleet_controller))*/{ start=6; obj_p_ship.alarm[3]=1; alarm[0]=10; - log_message("Fleet Combat Ended- Victory - Enemy:"+string(enemy[1])); + log_message("Fleet Combat Ended- Victory - Enemy:"+string(enemy[0])); } if (combat_end>-1) and (instance_number(obj_en_ship)=0) then combat_end-=1; @@ -45,6 +45,7 @@ if (start=5){ las.direction=point_direction(las.x,las.y,player_lasers_target.x,player_lasers_target.y)+round(random_range(-4,4)); las.image_xscale=1.5;las.image_yscale=1.5;las.speed=30;las.dam=30; las.sprite_index=spr_ground_las;las.image_index=0;las.image_speed=0; + las.explosion_sprite = spr_explosion; } } diff --git a/objects/obj_fleet/obj_fleet.yy b/objects/obj_fleet/obj_fleet.yy index 1a782880de..6fe862b4e0 100644 --- a/objects/obj_fleet/obj_fleet.yy +++ b/objects/obj_fleet/obj_fleet.yy @@ -3,7 +3,6 @@ "%Name":"obj_fleet", "eventList":[ {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":7,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":6,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":5,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":4,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, @@ -13,11 +12,11 @@ {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":3,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":56,"eventType":6,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":53,"eventType":6,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":67,"eventType":9,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":32,"eventType":9,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":13,"eventType":9,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, ], "managed":true, "name":"obj_fleet", diff --git a/objects/obj_fleet_select/Create_0.gml b/objects/obj_fleet_select/Create_0.gml index 7fd220a21a..a6c0df13ae 100644 --- a/objects/obj_fleet_select/Create_0.gml +++ b/objects/obj_fleet_select/Create_0.gml @@ -18,10 +18,14 @@ void_wid=0; void_hei=0; player_fleet=false; +select_all_button = new UnitButtonObject(); + +manage_units_button = new UnitButtonObject({style : "pixel"}); + helpful_navigator=new HelpfulPlaces(); selection_window.inside_method = function(){ - var mnz=0; + var _minimised=0; var xx = selection_window.XX; var yy = selection_window.YY; draw_set_font(fnt_40k_14); @@ -32,30 +36,38 @@ selection_window.inside_method = function(){ // draw_text(view_xview[0]+46,view_yview[0]+117,"Title"); // draw_text(view_xview[0]+46,view_yview[0]+142,"1#2#3#4#5#6#7#8#9#10#11#1#13#14#15#16#17#18#19#20#21#22#23#24#25"); - var type="capital",lines=0,posi=-1,colu=1,x3=48,y3=60,escorts,frigates,capitals,ty=0,current_ship=0,current_fleet=0,name="",sal=0,selection_box,scale=1,void_h=122,shew,ship_health=0; - escorts=escort; - frigates=frigate; - capitals=capital; + var type="capital",lines=0,posi=-1,colu=1,x3=48,y3=60,ty=0,current_ship=0,current_fleet=0,name="",sal=0,selection_box,scale=1,void_h=122,_show,ship_health=0; + var escorts=escort; + var frigates=frigate; + var capitals=capital; current_fleet=instance_nearest(x,y,obj_p_fleet); - if (escorts>0) then ty++; - if (frigates>0) then ty++; - if (capitals>0) then ty++; + ty = capitals>0 + frigates>0 +escorts>0; + draw_set_halign(fa_center); var set = "capitol"; - var fleet_sel = "[X]"; - if (!fleet_all) then fleet_sel = "[ ]"; - var fleet_all_click = false; + var _fleet_all_click = false; if (!fleet_minimized){ - if (point_and_click(draw_unit_buttons([xx+width-60, yy+40], fleet_sel,[1,1],c_red))){ - fleet_all = fleet_all==1?0:1; - fleet_all_click=true; + select_all_button.update({ + x1 : xx+width-60, + y1 : yy+40, + label : fleet_all ? "[X]" : "[ ]", + color : c_red, + }) + if (select_all_button.draw()){ + fleet_all = fleet_all == 1 ? 0 : 1; + _fleet_all_click=true; } var math_string = (string_width("Manage Units")/2)+6 - if (point_and_click(draw_unit_buttons([center_draw-math_string, yy+height-50], "Manage Units",[1,1],c_blue))){ + manage_units_button.update({ + x1 : center_draw - math_string, + y1 : yy+height-50, + label : "Manage Units" + }); + if (manage_units_button.draw()){ var _fleet_array = fleet_full_ship_array(current_fleet); var _fleet_marines = collect_role_group("all", ["", 0, _fleet_array]); @@ -76,6 +88,7 @@ selection_window.inside_method = function(){ draw_set_halign(fa_center); var ship_type,current_ship, sel_set, full_id; if (screen_expansion>0){ + //An astonishing bit of duke era code that has been botched into the modern era. Why does it work? honestly who can be fucked to read and find out for(var j=0; j<(escorts+frigates+capitals); j++){ draw_set_color(c_gray); y3+=20; @@ -83,12 +96,12 @@ selection_window.inside_method = function(){ lines++; posi++; scale=1; - shew=1; + _show=1; ship_health=100; if (colu==1) then void_h=min(void_h+20,560); if (posi==0){ - if (mnz=0) then draw_text(center_draw,yy+y3,string_hash_to_newline("=Capital Ships=")); + if (!_minimised) then draw_text(center_draw,yy+y3,"=Capital Ships="); y3+=20; if (y3>height-50) then break; set = "capitol"; @@ -97,7 +110,7 @@ selection_window.inside_method = function(){ if (posi==capitals) and (frigates>0){ y3+=20; if (y3>height-50) then break; - if (mnz=0) then draw_text(center_draw,yy+y3,string_hash_to_newline("=Frigates=")); + if (!_minimised) then draw_text(center_draw,yy+y3,"=Frigates="); y3+=20; if (y3>height-50) then break; @@ -106,7 +119,7 @@ selection_window.inside_method = function(){ if (posi==capitals+frigates) and (escorts>0){ y3+=20; if (y3>height-50) then break; - if (mnz=0) then draw_text(center_draw,yy+y3,string_hash_to_newline("=Escorts=")); + if (!_minimised) then draw_text(center_draw,yy+y3,"=Escorts="); y3+=20; if (y3>height-50) then break; set = "escort"; @@ -137,7 +150,9 @@ selection_window.inside_method = function(){ } break; } - if (fleet_all_click) then ship_select=fleet_all; + if (_fleet_all_click){ + ship_select=fleet_all; + } /*if (y3>670) and (posi<=escorts+frigates+capitals){ lines=1; @@ -149,6 +164,7 @@ selection_window.inside_method = function(){ if (posi<=escorts+frigates+capitals) && is_array(ship_type) && current_ship179){ for (var i=0;i<9;i++){ if (string_width(name)*scale>179) then scale-=0.05; @@ -160,7 +176,7 @@ selection_window.inside_method = function(){ if (string_width(name)*scale>135) then scale-=0.05; } } - shew=2; + _show=2; } if (point_and_click([xx+10,yy+y3,xx+width-10,yy+y3+18])){ if (!(obj_controller.fest_scheduled>0 && obj_controller.fest_sid==full_id)){ @@ -171,23 +187,24 @@ selection_window.inside_method = function(){ } } } - if (obj_ini.ship_maxhp[current_ship]>0){ - ship_health=round((obj_ini.ship_hp[current_ship]/obj_ini.ship_maxhp[current_ship])*100); - } + + ship_health=round(_ship.ship_hp_percentage()); if (ship_select==0){ selection_box="[ ]"; }else if (ship_select==1){ selection_box="[x] "; } - if (mnz==0){ + if (!_minimised){ draw_text(xx+width-25,yy+y3,selection_box); - if (shew==2) then draw_text(xx+width-60,yy+y3,$"{ship_health}%"); + if (_show==2) then draw_text(xx+width-60,yy+y3,$"{ship_health}%"); + + if (ship_health<=60) and (ship_health>40) then draw_set_color(c_yellow); + if (ship_health<=40) and (ship_health>20) then draw_set_color(c_orange); + if (ship_health<=20) then draw_set_color(c_red); + + draw_text_transformed(center_draw,yy+y3,name,scale,1,0); } - if (ship_health<=60) and (ship_health>40) then draw_set_color(c_yellow); - if (ship_health<=40) and (ship_health>20) then draw_set_color(c_orange); - if (ship_health<=20) then draw_set_color(c_red); - if (mnz=0) then draw_text_transformed(center_draw,yy+y3,name,scale,1,0); draw_set_color(c_gray); } switch(set){ diff --git a/objects/obj_fleet_select/Draw_0.gml b/objects/obj_fleet_select/Draw_0.gml index 325f0c0ba3..30f5f04b0f 100644 --- a/objects/obj_fleet_select/Draw_0.gml +++ b/objects/obj_fleet_select/Draw_0.gml @@ -103,14 +103,14 @@ if (owner == eFACTION.Player && player_fleet.action==""){ draw_line_dashed(x,y,sys.x,sys.y,16,scale); draw_set_font(fnt_40k_14b); - var eta=0; + var _eta=0; - eta = calculate_fleet_eta(mine.x,mine.y,sys.x,sys.y, selection_travel_speed, ,,player_fleet.warp_able); + _eta = calculate_fleet_eta(mine.x,mine.y,sys.x,sys.y, selection_travel_speed, ,,player_fleet.warp_able); - if (sys.storm>0) or (instance_nearest(x,y,obj_star).storm>0) then eta="N/A"; + if (sys.storm>0) or (instance_nearest(x,y,obj_star).storm>0) then _eta="N/A"; draw_set_font(fnt_40k_14b); - eta = "ETA "+string(eta) + "#Press SHIFT to ignore way points"; + _eta = "ETA "+string(_eta) + "#Press SHIFT to ignore way points"; var speed_string = ""; var viable=true; var types = [0,0,0]; @@ -127,9 +127,9 @@ if (owner == eFACTION.Player && player_fleet.action==""){ } } } - eta+=speed_string; + _eta+=speed_string; - draw_text_transformed(sys.x+17,sys.y,string_hash_to_newline(eta),scale,scale,0); + draw_text_transformed(sys.x+17,sys.y,string_hash_to_newline(_eta),scale,scale,0); if (mouse_check_button(mb_right) && viable){ var ship_count = player_fleet_ship_count(player_fleet); var fleet_selected = player_fleet_selected_count(player_fleet); diff --git a/objects/obj_fleet_spawner/Alarm_0.gml b/objects/obj_fleet_spawner/Alarm_0.gml deleted file mode 100644 index 3d952708c4..0000000000 --- a/objects/obj_fleet_spawner/Alarm_0.gml +++ /dev/null @@ -1,175 +0,0 @@ - - - - -if (number=1){ - // create blocks of infantry - - - var i=0,k=0,x2=224,hei=0,man=0,sizz=0; - - - sort_ships_into_columns(obj_fleet); - - with (obj_fleet){ - player_fleet_ship_spawner(); - } - - -} - - - -if (number>0) and (owner!=1){ - - en_escort=obj_fleet.en_escort[number]; - en_frigate=obj_fleet.en_frigate[number]; - en_capital=obj_fleet.en_capital[number]; - - - if (owner = eFACTION.Imperium){ - if (en_escort>0){ - en_column[4]="Sword Class Frigate"; - en_num[4]=en_escort; - en_size[4]=1; - } - - if (en_frigate>0){en_column[3]="Avenger Class Grand Cruiser";en_num[3]=en_frigate;en_size[3]=2;} - - var i;i=0;i=en_capital; - if (i>0){ - en_column[2]="Apocalypse Class Battleship";en_num[2]=floor(random(i))+1; - if (en_num[2]<(en_capital*0.6)) then en_num[2]=round(en_capital*0.6); - i-=en_num[2];en_size[2]=3; - } - - if (i>0){en_column[1]="Nemesis Class Fleet Carrier";en_num[1]=i;i-=en_num[1];en_size[1]=3;} - } - - - - if (owner = eFACTION.Eldar){ - if (en_escort>0){en_column[4]="Aconite";en_num[4]=max(1,floor(en_escort/2));en_size[4]=1;} - if (en_escort>1){en_column[3]="Hellebore";en_num[3]=max(1,floor(en_escort/2));en_size[3]=1;} - if (en_frigate>0){en_column[2]="Shadow Class";en_num[2]=en_frigate;en_size[2]=2;} - if (en_capital>0){en_column[1]="Void Stalker";en_num[1]=en_capital;en_size[1]=3;} - } - - - - - if (owner = eFACTION.Ork){ - var i;i=0;i=en_capital; - - if (i>0){en_column[1]="Dethdeala";en_num[1]=floor(random(i))+1;i-=en_num[1];en_size[1]=3;} - - if (i>0){en_column[2]="Gorbag's Revenge";en_num[2]=floor(random(i))+1;i-=en_num[2];en_size[2]=3;}// en_num[2]+=en_num[1]+1; - - if (i>0){en_column[3]="Kroolboy";en_num[3]=i;i-=en_num[3];en_size[3]=3;}// en_num[3]+=en_num[2]+1; - - if (en_frigate>0){en_column[4]="Battlekroozer";en_num[4]=en_frigate;en_size[4]=2;}// en_num[4]+=en_num[3]+1; - - if (en_escort>0){en_column[5]="Ravager";en_num[5]=en_escort;en_size[5]=1;}// en_num[5]+=en_num[4]+1; - } - - if (owner = eFACTION.Tau){ - var i;i=0;i=en_frigate; - - if (en_capital>0){en_column[1]="Custodian";en_num[1]=en_capital;en_size[1]=3;} - - if (i>0){en_column[2]="Emissary";en_num[2]=1;i-=en_num[2];en_size[2]=2;} - - if (i>0){en_column[3]="Protector";en_num[3]=i;i-=en_num[3];en_size[3]=2;}// en_num[3]+=en_num[2]+1; - - if (en_escort>0){en_column[4]="Castellan";en_num[4]=round((en_escort/3)*2);en_size[4]=1;} - - if (en_escort>2){en_column[5]="Warden";en_num[5]=en_escort-en_num[5];en_size[5]=1;} - } - - if (owner = eFACTION.Tyranids){ - var i;i=0;i=en_escort; - - if (en_capital>0){en_column[1]="Leviathan";en_num[1]=en_capital;en_size[1]=3;} - - if (i>0){en_column[2]="Stalker";en_num[2]=floor(i/3)+1;i-=en_num[2];en_size[2]=1;} - - if (en_frigate>0){en_column[3]="Razorfiend";en_num[3]=en_frigate;en_size[3]=2;}// en_num[2]+=en_num[1]+1; - - if (i>0){en_column[4]="Prowler";en_num[4]=i;en_size[4]=1;}// en_num[5]+=en_num[4]+1; - } - - if (owner = eFACTION.Chaos){ - var i;i=0;i=en_frigate; - - if (en_capital>0){en_column[1]="Desecrator";en_num[1]=en_capital;en_size[1]=3;} - - if (i>0){en_column[2]="Avenger";en_num[2]=floor(random(i))+1;i-=en_num[2];en_size[2]=2;} - - if (i>0){en_column[3]="Carnage";en_num[3]=floor(random(i))+1;i-=en_num[3];en_size[3]=2;}// en_num[2]+=en_num[1]+1; - - if (i>0){en_column[4]="Daemon";en_num[4]=i;i-=en_num[4];en_size[4]=2;}// en_num[3]+=en_num[2]+1; - - if (en_escort>0){en_column[5]="Iconoclast";en_num[5]=en_escort;en_size[5]=1;}// en_num[5]+=en_num[4]+1; - } - - if (owner = eFACTION.Necrons){ - var i;i=0;i=en_escort; - - if (en_capital>0){en_column[1]="Reaper Class";en_num[1]=en_capital;en_size[1]=3;} - // Cairn Class Tombship are very rare - - if (i>0){en_column[2]="Shroud Class";en_num[2]=en_frigate;en_size[2]=2;} - - if (i>0){en_column[3]="Jackal Class";en_num[3]=round(i/2);i-=en_num[3];en_size[3]=1;} - if (en_escort>0){en_column[4]="Dirge Class";en_num[4]=i;en_size[4]=1;} - } - - - - - var i;i=0; - repeat(5){i+=1; - if (en_column[i]="Avenger Class Grand Cruiser"){en_width[i]=196;en_height[i]=96;} - if (en_column[i]="Apocalypse Class Battleship"){en_width[i]=272;en_height[i]=128;} - if (en_column[i]="Nemesis Class Fleet Carrier"){en_width[i]=272;en_height[i]=128;} - if (en_column[i]="Sword Class Frigate"){en_width[i]=96;en_height[i]=64;} - - if (en_column[i]="Void Stalker"){en_width[i]=260;en_height[i]=192;} - if (en_column[i]="Shadow Class"){en_width[i]=212;en_height[i]=160;} - if (en_column[i]="Hellebore"){en_width[i]=160;en_height[i]=64;} - if (en_column[i]="Aconite"){en_width[i]=128;en_height[i]=64;} - - if (en_column[i]="Deathdeala"){en_width[i]=196;en_height[i]=128;} - if (en_column[i]="Gorbag's Revenge"){en_width[i]=196;en_height[i]=128;} - if (en_column[i]="Kroolboy"){en_width[i]=196;en_height[i]=128;} - if (en_column[i]="Slamblasta"){en_width[i]=196;en_height[i]=128;} - if (en_column[i]="Battlekroozer"){en_width[i]=160;en_height[i]=96;} - if (en_column[i]="Ravager"){en_width[i]=128;en_height[i]=64;} - - if (en_column[i]="Desecrator"){en_width[i]=196;en_height[i]=128;} - if (en_column[i]="Avenger"){en_width[i]=160;en_height[i]=96;} - if (en_column[i]="Carnage"){en_width[i]=160;en_height[i]=96;} - if (en_column[i]="Daemon"){en_width[i]=160;en_height[i]=96;} - if (en_column[i]="Iconoclast"){en_width[i]=128;en_height[i]=64;} - - if (en_column[i]="Custodian"){en_width[i]=128;en_height[i]=256;} - if (en_column[i]="Emissary"){en_width[i]=160;en_height[i]=96;} - if (en_column[i]="Protector"){en_width[i]=64;en_height[i]=180;} - if (en_column[i]="Castellan"){en_width[i]=48;en_height[i]=96;} - if (en_column[i]="Warden"){en_width[i]=48;en_height[i]=80;} - - if (en_column[i]="Leviathan"){en_width[i]=200;en_height[i]=128;} - if (en_column[i]="Razorfiend"){en_width[i]=160;en_height[i]=128;} - if (en_column[i]="Stalker"){en_width[i]=96;en_height[i]=64;} - if (en_column[i]="Prowler"){en_width[i]=80;en_height[i]=64;} - - if (en_column[i]="Cairn Class Tombship"){en_width[i]=256;en_height[i]=224;} - if (en_column[i]="Reaper Class"){en_width[i]=286;en_height[i]=161;} - if (en_column[i]="Shroud Class"){en_width[i]=200;en_height[i]=150;} - if (en_column[i]="Jackal Class"){en_width[i]=99;en_height[i]=123;} - if (en_column[i]="Dirge Class"){en_width[i]=100;en_height[i]=91;} - } -} - -action_set_alarm(1, 1); - diff --git a/objects/obj_fleet_spawner/Alarm_1.gml b/objects/obj_fleet_spawner/Alarm_1.gml deleted file mode 100644 index c802db6cd4..0000000000 --- a/objects/obj_fleet_spawner/Alarm_1.gml +++ /dev/null @@ -1,353 +0,0 @@ - - - -if (owner = eFACTION.Imperium) or (owner = eFACTION.Eldar){// This is an orderly Imperial ship formation - var xx,yy,i, temp1, x2, man; - xx=0;yy=0;i=0;temp1=0;x2=0;man=0; - var fuck=0; - if (obj_fleet.enemy_status[number]<0){ - x2=1200; - fuck=5 - }else if (obj_fleet.enemy_status[number]>0){ - x2=50; - fuck=0; - } - - repeat(4){ - if (obj_fleet.enemy_status[number]<0) then fuck-=1; - if (obj_fleet.enemy_status[number]>0) then fuck+=1; - - yy=y-((en_height[fuck]*en_num[fuck])/2); - if (en_num[fuck]>0){ - yy+=(en_height[fuck]/2); - repeat(en_num[fuck]){ - if (en_size[fuck]<3){ - if (obj_fleet.enemy_status[number]<0){ - man=instance_create(x2,yy,obj_en_cruiser); - yy+=en_height[fuck]; - man.class=en_column[fuck]; - man.owner=owner; - man.size=en_size[fuck]; - } - if (obj_fleet.enemy_status[number]>0){ - man=instance_create(x2,yy,obj_al_cruiser); - yy+=en_height[fuck]; - man.class=en_column[fuck]; - man.owner=owner; - man.size=en_size[fuck]; - } - } - if (en_size[fuck]>=3){ - if (obj_fleet.enemy_status[number]<0){ - man=instance_create(x2,yy,obj_en_capital); - yy+=en_height[fuck]; - man.class=en_column[fuck]; - man.owner=owner; - man.size=en_size[fuck]; - } - else if (obj_fleet.enemy_status[number]>0){ - man=instance_create(x2,yy,obj_al_capital); - yy+=en_height[fuck]; - man.class=en_column[fuck]; - man.owner=owner; - man.size=en_size[fuck];} - } - } - x2+=en_width[fuck]; - } - } - - - - /* - if (en_num[4]>0){ - yy=y-((en_height[4]*en_num[4])/2); - yy+=(en_height[4]/2); - repeat(en_num[4]){ - man=instance_create(x2,yy,obj_en_cruiser); - yy+=en_height[4]; - man.class=en_column[4]; - man.owner=owner; - } - x2+=en_width[4]; - } - if (en_num[3]>0){ - yy=y-((en_height[3]*en_num[3])/2); - yy+=(en_height[3]/2); - repeat(en_num[3]){ - man=instance_create(x2,yy,obj_en_cruiser); - yy+=en_height[3]; - man.class=en_column[3]; - man.owner=owner; - } - x2+=en_width[3]; - } - if (en_num[2]>0){ - yy=y-((en_height[2]*en_num[2])/2); - yy+=(en_height[2]/2); - repeat(en_num[2]){ - man=instance_create(x2,yy,obj_en_capital); - yy+=en_height[2]; - man.class=en_column[2]; - man.owner=owner; - } - x2+=en_width[2]; - } - if (en_num[1]>0){ - yy=256; - repeat(en_num[1]){ - man=instance_create(x2,yy,obj_en_capital); - yy+=en_height[1]; - man.class=en_column[1]; - man.owner=owner; - yy+=(en_height[1]); - } - }*/ -} - - - - - - -/* -if (en_escort>0){en_column[4]="Aconite";en_num[4]=max(1,floor(en_escort/2));en_size[4]=1;} -if (en_escort>1){en_column[3]="Hellebore";en_num[3]=max(1,floor(en_escort/2));en_size[3]=1;} -if (en_frigate>0){en_column[2]="Shadow Class";en_num[2]=en_frigate;en_size[2]=2;} -if (en_capital>0){en_column[1]="Void Stalker";en_num[1]=en_capital;en_size[1]=3;} -*/ - - -/* -if (owner = eFACTION.Eldar){// This is an orderly Eldar ship formation - var xx,yy,i, temp1, x2, man; - xx=0;yy=0;i=0;temp1=0;x2=1200;man=0; - - if (en_num[4]>0){ - yy=128; - repeat(en_num[4]){ - man=instance_create(x2,yy,obj_en_cruiser); - yy+=en_height[4]; - man.class=en_column[4]; - man.owner=owner; - } - } - if (en_num[3]>0){ - yy=room_height-128; - repeat(en_num[3]){ - man=instance_create(x2,yy,obj_en_cruiser); - yy-=en_height[3]; - man.class=en_column[3]; - man.owner=owner; - } - } - x2+=max(en_width[3],en_width[4]); - - if (en_num[2]>0){ - yy=y-((en_height[2]*en_num[2])/2); - yy+=(en_height[2]/2); - repeat(en_num[2]){ - man=instance_create(x2,yy,obj_en_capital); - yy+=en_height[2]; - man.class=en_column[2]; - man.owner=owner; - } - x2+=en_width[2]; - } - if (en_num[1]>0){ - yy=256; - repeat(en_num[1]){ - man=instance_create(x2,yy,obj_en_capital); - yy+=en_height[1]; - man.class=en_column[1]; - man.owner=owner; - yy+=(en_height[1]); - } - } -}*/ - - - - - - -if (owner = eFACTION.Ork) or (owner = eFACTION.Chaos){// This is spew out random ships without regard for formations - var xx,yy,dist,targ,numb,man; - xx=0;yy=0;dist=0;targ=0;numb=0;man=0; - - var i;i=0; - - repeat(5){ - - i+=1; - - if (en_column[i]!="") then for(s = 0; s < en_num[i]; s += 1){ - if (en_size[i]>1) then man=instance_create(random_range(1200,1400),round(random_range(y,y+height)+50),obj_en_capital); - if (en_size[i]=1) then man=instance_create(random_range(1200,1400),round(random_range(y,y+height)+50),obj_en_cruiser); - man.class=en_column[i]; - man.owner=owner; - man.size=en_size[i]; - } - - - } -} - - - - - - - -if (owner = eFACTION.Tau){// This is an orderly Tau ship formation - var xx,yy,i, temp1, x2, man; - xx=0;yy=0;i=0;temp1=0;x2=1200;man=0; - - yy=y-((en_height[5]*en_num[5])/2); - yy+=(en_height[5]/2); - repeat(en_num[5]){ - man=instance_create(x2,yy,obj_en_cruiser); - yy+=en_height[5]; - man.class="Warden";man.owner=owner; - man.size=en_size[5]; - } - x2+=en_width[5]; - - yy=y-((en_height[2]*en_num[2])/2)-((en_height[3]*en_num[3])/2); - yy+=(en_height[2]/2); - yy+=(en_height[3]/2); - repeat(en_num[2]){ - man=instance_create(x2,yy,obj_en_cruiser); - yy+=en_height[2]; - man.class="Emissary";man.owner=owner; - man.size=en_size[2]; - } - repeat(en_num[3]){ - man=instance_create(x2,yy,obj_en_cruiser); - yy+=en_height[3]; - man.class="Protector";man.owner=owner; - man.size=en_size[3]; - } - x2+=max(en_width[2],en_width[3]); - - yy=y-((en_height[4]*en_num[4])/2); - yy+=(en_height[4]/2); - repeat(en_num[4]){ - man=instance_create(x2,yy,obj_en_cruiser); - yy+=en_height[4]; - man.class="Castellan";man.owner=owner; - man.size=en_size[4]; - } - x2+=en_width[4]; - - yy=y-((en_height[1]*en_num[1])/2); - yy+=(en_height[1]/2); - repeat(en_num[1]){ - man=instance_create(x2,yy,obj_en_capital); - yy+=en_height[1]; - man.class="Custodian";man.owner=owner; - man.size=en_size[1]; - } - -} - - - - -if (owner = eFACTION.Tyranids){// This is an orderly Tyranid ship formation - var xx,yy,i, temp1, x2, man; - xx=0;yy=0;i=0;temp1=0;x2=1200;man=0; - - yy=y-((en_height[4]*en_num[4])/2); - yy+=(en_height[4]/2); - repeat(en_num[4]){ - man=instance_create(x2,yy,obj_en_cruiser); - yy+=en_height[4]; - man.class="Prowler";man.owner=owner; - man.size=en_size[4]; - } - x2+=en_width[4]; - - yy=y-((en_height[3]*en_num[3])/2); - yy+=(en_height[3]/2); - repeat(en_num[3]){ - man=instance_create(x2,yy,obj_en_cruiser); - yy+=en_height[3]; - man.class="Razorfiend";man.owner=owner; - man.size=en_size[3]; - } - x2+=en_width[3]; - - yy=y-((en_height[2]*en_num[2])/2); - yy+=(en_height[2]/2); - repeat(en_num[2]){ - man=instance_create(x2,yy,obj_en_cruiser); - yy+=en_height[2]; - man.class="Stalker";man.owner=owner; - man.size=en_size[2]; - } - x2+=en_width[2]; - - yy=y-((en_height[1]*en_num[1])/2); - yy+=(en_height[1]/2); - repeat(en_num[1]){ - man=instance_create(x2,yy,obj_en_capital); - yy+=en_height[1]; - man.class="Leviathan";man.owner=owner; - man.size=en_size[1]; - } - -} - - - - -if (owner = eFACTION.Necrons){// This is an orderly Necron ship formation - var xx,yy,i, temp1, x2, man; - xx=0;yy=0;i=0;temp1=0;x2=1200;man=0; - - yy=y-((en_height[4]*en_num[4])/2); - yy+=(en_height[4]/2); - repeat(en_num[4]){ - man=instance_create(x2,yy,obj_en_cruiser); - yy+=en_height[4]; - man.class="Dirge Class";man.owner=owner; - man.size=en_size[4]; - } - x2+=en_width[4]; - - yy=y-((en_height[3]*en_num[3])/2); - yy+=(en_height[3]/2); - repeat(en_num[3]){ - man=instance_create(x2,yy,obj_en_cruiser); - yy+=en_height[3]; - man.class="Jackal Class";man.owner=owner; - man.size=en_size[3]; - } - x2+=en_width[3]; - - yy=y-((en_height[2]*en_num[2])/2); - yy+=(en_height[2]/2); - repeat(en_num[2]){ - man=instance_create(x2,yy,obj_en_cruiser); - yy+=en_height[2]; - man.class="Shroud Class";man.owner=owner; - man.size=en_size[2]; - } - x2+=en_width[2]; - - yy=y-((en_height[1]*en_num[1])/2); - yy+=(en_height[1]/2); - repeat(en_num[1]){ - man=instance_create(x2,yy,obj_en_capital); - yy+=en_height[1]; - man.class="Reaper Class";man.owner=owner; - man.size=en_size[1]; - } -} - - - - -/* */ -/* */ diff --git a/objects/obj_fleet_spawner/Create_0.gml b/objects/obj_fleet_spawner/Create_0.gml index c5b8d2262e..50a07677a5 100644 --- a/objects/obj_fleet_spawner/Create_0.gml +++ b/objects/obj_fleet_spawner/Create_0.gml @@ -3,12 +3,14 @@ owner=0; height=0; number=0; -alarm[0]=1; - -var i,t;i=-1;t=0; -repeat(11){i+=1; - en_column[i]="";en_width[i]=0; - en_height[i]=0;en_num[i]=0; +wait_and_execute(1, setup_fleet_spawn_characteristics,[] , self); +var i=-1,t=0; +repeat(11){ + i+=1; + en_column[i]=""; + en_width[i]=0; + en_height[i]=0; + en_num[i]=0; en_size[i]=0; } diff --git a/objects/obj_ground_mission/Alarm_0.gml b/objects/obj_ground_mission/Alarm_0.gml index 8a5cc06fed..efa7a41d83 100644 --- a/objects/obj_ground_mission/Alarm_0.gml +++ b/objects/obj_ground_mission/Alarm_0.gml @@ -4,7 +4,7 @@ if (num > 0) { stah = instance_nearest(x, y, obj_star); obj_controller.menu = 0; - if (planet_feature_bool(stah.p_feature[num], P_features.STC_Fragment) == 1) { // STC is present + if (planet_feature_bool(stah.p_feature[num], P_features.STCFragment) == 1) { // STC is present } if (planet_feature_bool(stah.p_feature[num], P_features.Artifact) == 1) { // Artifact is present diff --git a/objects/obj_ground_mission/Alarm_5.gml b/objects/obj_ground_mission/Alarm_5.gml index c353d62d6e..579e0993de 100644 --- a/objects/obj_ground_mission/Alarm_5.gml +++ b/objects/obj_ground_mission/Alarm_5.gml @@ -105,7 +105,7 @@ if (scr_has_adv("Tech-Scavengers")){ with(obj_star_select){instance_destroy();} with(obj_fleet_select){instance_destroy();} -delete_features(plan.p_feature[num], P_features.STC_Fragment); +delete_features(plan.p_feature[num], P_features.STCFragment); scr_add_stc_fragment();// STC here diff --git a/objects/obj_ground_teams/Alarm_0.gml b/objects/obj_ground_teams/Alarm_0.gml index 10351f4083..6aa0ae85af 100644 --- a/objects/obj_ground_teams/Alarm_0.gml +++ b/objects/obj_ground_teams/Alarm_0.gml @@ -1,4 +1,4 @@ -if (feature.f_type == P_features.Ancient_Ruins){ +if (feature.f_type == P_features.AncientRuins){ newline = "Your marines warily stalk through into the entrance of the ruins"; newline_color = "red"; scr_newtext(); diff --git a/objects/obj_img/Create_0.gml b/objects/obj_img/Create_0.gml index f54fbb9b62..1785370ae6 100644 --- a/objects/obj_img/Create_0.gml +++ b/objects/obj_img/Create_0.gml @@ -26,8 +26,10 @@ repeat(301){i+=1; postbattle[i]=0;postbattle_exists[i]=-1; postspace[i]=0;postspace_exists[i]=-1; formation[i]=0;formation_exists[i]=-1; - popup[i]=0;popup_exists[i]=-1; - commander[i]=0;commander_exists[i]=-1; + popup[i]=0; + popup_exists[i]=-1; + commander[i]=0; + commander_exists[i]=-1; planet_good[i]=0;planet_exists[i]=-1; attacked[i]=0;attacked_exists[i]=-1; force[i]=0;force_exists[i]=-1; diff --git a/objects/obj_ini/Create_0.gml b/objects/obj_ini/Create_0.gml index b075fbcac3..01d107518e 100644 --- a/objects/obj_ini/Create_0.gml +++ b/objects/obj_ini/Create_0.gml @@ -28,6 +28,9 @@ penitent_end=0; man_size=0; home_planet = 2; artifact_struct = array_create(200); +flagship = 0; + +ship_weapons = []; // Equipment- maybe the bikes should go here or something? yes they should equipment = {}; @@ -54,7 +57,10 @@ var company=-1; repeat(11){ company+=1;v=-1;// show_message("v company: "+string(company)); repeat(205){v+=1;// show_message(string(company)+"."+string(v)); - last_ship[company,v] = {uid : "", name : ""}; + last_ship[company,v] = { + uid : "", + name : "" + }; veh_race[company,v]=0; veh_loc[company,v]=""; veh_name[company,v]=""; @@ -131,6 +137,43 @@ serialize = function(){ array_push(artifact_struct_trimmed, artifact_struct[i]); } } + + var ship_structs = []; + + for (var s = 0; s < array_length(ship_data); s++){ + var _ship = ship_data[s]; + var left_broad = variable_clone(_ship.left_broad_positions); + var right_broad = variable_clone(_ship.right_broad_positions); + var center_cannons = variable_clone(_ship.forward_positions); + + var _lb = array_length(left_broad); + var _rb = array_length(right_broad); + var _cb = array_length(center_cannons); + var _longest = max(_lb, _rb, _cb); + for (var i=0;i < _longest; i++){ + if (i<_lb){ + if (left_broad[i].weapon != false){ + left_broad[i].weapon = jsonify_struct(left_broad[i].weapon); + } + } + if (i<_rb){ + if (right_broad[i].weapon != false){ + right_broad[i].weapon = jsonify_struct(right_broad[i].weapon); + } + } + if (i<_cb){ + if (center_cannons[i].weapon != false){ + center_cannons[i].weapon = jsonify_struct(center_cannons[i].weapon); + } + } + } + var _copy_ship = variable_clone(_ship); + _copy_ship.left_broad_positions = left_broad; + _copy_ship.right_broad_positions = right_broad; + _copy_ship.forward_positions = center_cannons; + + array_push(ship_structs, jsonify_struct(_copy_ship)); + } var save_data = { @@ -146,7 +189,9 @@ serialize = function(){ marine_structs: marines, squad_structs: squads, equipment: equipment, - gene_slaves: gene_slaves + gene_slaves: gene_slaves, + ship_weapons, + ship_structs : ship_structs, // marines, // squads } @@ -163,7 +208,7 @@ serialize = function(){ } deserialize = function(save_data){ - var exclusions = ["complex_livery_data", "full_liveries","company_liveries", "squad_types", "marine_structs", "squad_structs"]; // skip automatic setting of certain vars, handle explicitly later + var exclusions = ["complex_livery_data", "full_liveries","company_liveries", "squad_types", "marine_structs", "squad_structs", "ship_weapons","ship_structs"]; // skip automatic setting of certain vars, handle explicitly later // Automatic var setting var all_names = struct_get_names(save_data); @@ -254,6 +299,58 @@ deserialize = function(save_data){ } } + ship_weapons = []; + if (struct_exists(save_data, "ship_weapons")){ + show_debug_message(save_data.ship_weapons); + var _wep_data = save_data.ship_weapons; + for (var i=0 ; i0) and (defeat=1){ //TODO this logic is wrong assumes all player units died in ruins @@ -305,11 +286,10 @@ try { if ((string_count("spyrer",battle_special)>0))/* and (string_count("demon",battle_special)>0))*/ and (defeat=0){ instance_activate_object(obj_star); - // show_message(obj_turn_end.current_battle); - // show_message(obj_turn_end.battle_world[obj_turn_end.current_battle]); + // title / text / image / speshul - var cur_star = obj_turn_end.battle_object[obj_turn_end.current_battle]; - var planet = obj_turn_end.battle_world[obj_turn_end.current_battle] + var cur_star = obj_turn_end.battle[obj_turn_end.current_battle].system; + var planet = obj_turn_end.battle[obj_turn_end.current_battle].planet; var _planet_string = scr_roman_numerals()[planet-1]; remove_planet_problem(planet ,"spyrer",cur_star) @@ -355,20 +335,22 @@ try { if (diceh<=15){ var ship,ship_hp,i=-1; - for (var i=0;i0) then cooldown-=1; -var dist; +var target_distance; if (instance_exists(target)){ if (target.owner = eFACTION.Tyranids) or (target.owner = eFACTION.Necrons){damage=true;plasma_bomb=true;steal=false;} if (target.owner != eFACTION.Tyranids) and (target.owner != eFACTION.Necrons){ @@ -11,7 +11,7 @@ if (instance_exists(target)){ if (obj_controller.command_set[22]=1) then steal=true; // important for boarding and commandeering ships later down the line? } - dist=point_distance(x,y,target.x,target.y); + target_distance=point_distance(x,y,target.x,target.y); if (action="goto"){speed=4; direction=turn_towards_point(direction,x,y,target.x,target.y,8); @@ -169,7 +169,9 @@ if (boarding=true) and (board_cooldown>=0) and (instance_exists(target)) and (in with(target){ var wh,gud;wh=0;gud=0; - repeat(5){wh+=1;if (obj_fleet.enemy[wh]=owner) then gud=wh;} + for (var wh=0;wh=95) and (dist<=300){ + if (rando>=95) and (target_distance<=300){ obj_controller.known[eFACTION.Eldar]=1; scr_alert("green","elfs","Eldar Craftworld discovered.",steh.old_x,steh.old_y); with(obj_en_fleet){if (owner = eFACTION.Eldar) then image_alpha=1;} } // Quene eldar introduction - // if (rando>=95) and (dist<=300) then show_message("MON'KEIGH"); + // if (rando>=95) and (target_distance<=300) then show_message("MON'KEIGH"); } } diff --git a/objects/obj_p_fleet/Alarm_4.gml b/objects/obj_p_fleet/Alarm_4.gml index 203fe9e104..0bbc544ea1 100644 --- a/objects/obj_p_fleet/Alarm_4.gml +++ b/objects/obj_p_fleet/Alarm_4.gml @@ -3,11 +3,11 @@ var sys_dist, mine, connected, fleet, cont; sys_dist=9999;connected=0;cont=0; -var eta=calculate_fleet_eta(x,y, action_x,action_y,action_spd, false, false,warp_able); -// if (connected=0) then eta=eta*2; +var _eta=calculate_fleet_eta(x,y, action_x,action_y,action_spd, false, false,warp_able); +// if (connected=0) then _eta=_eta*2; // if (connected=1) then connected=1; -// if (web=1) then eta=1; -action_eta=eta; +// if (web=1) then _eta=1; +action_eta=_eta; // if (action="crusade2") then action="crusade3"; diff --git a/objects/obj_p_fleet/Alarm_5.gml b/objects/obj_p_fleet/Alarm_5.gml index ded94fbfb5..adecbc53da 100644 --- a/objects/obj_p_fleet/Alarm_5.gml +++ b/objects/obj_p_fleet/Alarm_5.gml @@ -1,43 +1,18 @@ var i, minhp, maxhp; - - -if (capital_number>0){ - i=0;minhp=0;maxhp=0; - for (var i=0;i-1){ - minhp+=obj_ini.ship_hp[i]; - maxhp+=obj_ini.ship_maxhp[i]; - } +function determine_ship_class_health(class_array){ + var _total_percent = 0 + for (var i=0;i0) then capital_health=round((minhp/maxhp)*100); - else capital_health=0; + return max(_total_percent/array_length(class_array),0); } +capital_health = determine_ship_class_health(capital_num); +frigate_health = determine_ship_class_health(frigate_num); +escort_health = determine_ship_class_health(escort_num); -if (frigate_number>0){ - i=0;minhp=0;maxhp=0; - for (var i=0;i-1 && frigate_num[i]0) then frigate_health=round((minhp/maxhp)*100); - else frigate_health=0; -} - -if (escort_number>0){ - i=0;minhp=0;maxhp=0; - for (var i=0;i-1){ - minhp+=obj_ini.ship_hp[i]; - maxhp+=obj_ini.ship_maxhp[i]; - } - } - if (maxhp>0) then escort_health=round((minhp/maxhp)*100); - else escort_health=0; -} diff --git a/objects/obj_p_fleet/Alarm_7.gml b/objects/obj_p_fleet/Alarm_7.gml index 63b1549765..53468d466b 100644 --- a/objects/obj_p_fleet/Alarm_7.gml +++ b/objects/obj_p_fleet/Alarm_7.gml @@ -9,10 +9,10 @@ var capital_id; var capital_list = fleet_full_ship_array(, ,true,true); for(var i=0;igood){ + var _ship = fetch_ship(capital_id); + if (_ship.hp>good){ c=capital_id; - good=obj_ini.ship_hp[capital_id]; + good=_ship.hp; } } @@ -22,7 +22,8 @@ if (good>0){ if (obj_ini.artifact[a]=="") then continue; if (array_contains(ships_list, obj_ini.artifact_sid[a]-500)){ obj_ini.artifact_sid[a]=c+500; - obj_ini.artifact_loc[a]=obj_ini.ship[c]; + var _ship = fetch_ship(c); + obj_ini.artifact_loc[a]=_ship.name; } } } diff --git a/objects/obj_p_round/Collision_obj_en_ship.gml b/objects/obj_p_round/Collision_obj_en_ship.gml index 59e9c01cf9..d11e694a5c 100644 --- a/objects/obj_p_round/Collision_obj_en_ship.gml +++ b/objects/obj_p_round/Collision_obj_en_ship.gml @@ -1,25 +1 @@ - -if (other.class!="Daemon") or (other.image_alpha>=1){ - - var arm; - arm=other.armour_front; - - dam=dam*obj_fleet.global_attack; - - if (arm0) then other.shields-=dam; - if (other.shields<=0) then other.hp-=dam; - } - - if (arm>dam) and (other.shields>0) then other.shields-=1; - if (arm>dam) and (other.shields<=0) then other.hp-=1; - - if (sprite_index=spr_torpedo){ - instance_create(x,y,obj_explosion); - } - -} - -instance_destroy(); - +round_collision_with_ship(); \ No newline at end of file diff --git a/objects/obj_p_round/Create_0.gml b/objects/obj_p_round/Create_0.gml index 8c524b1e31..a494bf6d3b 100644 --- a/objects/obj_p_round/Create_0.gml +++ b/objects/obj_p_round/Create_0.gml @@ -1,3 +1,4 @@ dam = 0; image_angle=direction; +explosion_sprite = spr_explosion; diff --git a/objects/obj_p_round/Step_0.gml b/objects/obj_p_round/Step_0.gml index cf6d346158..2151dd3ed0 100644 --- a/objects/obj_p_round/Step_0.gml +++ b/objects/obj_p_round/Step_0.gml @@ -1,13 +1 @@ -image_angle=direction; - -if (x<-1000) or (x>room_width+1000) or (y<-1000) or (y>room_height+1000) then instance_destroy(); - -var th, thd; -if (dam<=4){ - if (instance_exists(obj_en_in)){ - th=instance_nearest(x,y,obj_en_in); - thd=point_distance(x,y,th.x,th.y); - if (thd<6){th.hp-=(self.dam-1);instance_destroy();} - } -} - +round_step_logic(); \ No newline at end of file diff --git a/objects/obj_p_ship/Alarm_0.gml b/objects/obj_p_ship/Alarm_0.gml deleted file mode 100644 index eabf2f872f..0000000000 --- a/objects/obj_p_ship/Alarm_0.gml +++ /dev/null @@ -1,225 +0,0 @@ - - -action=""; - direction=0; - - - cooldown1=0; - cooldown2=0; - cooldown3=0; - cooldown4=0; - cooldown5=0; - - - name=obj_ini.ship[ship_id]; - class=obj_ini.ship_class[ship_id]; - hp=obj_ini.ship_hp[ship_id]*1; - maxhp=obj_ini.ship_hp[ship_id]*1; - conditions=obj_ini.ship_conditions[ship_id]; - shields=obj_ini.ship_shields[ship_id]*100; - maxshields=shields; - armour_front=obj_ini.ship_front_armour[ship_id]; - armour_other=obj_ini.ship_other_armour[ship_id]; - weapons=obj_ini.ship_weapons[ship_id]; - turrets=0; - ship_colour=obj_controller.body_colour_replace; - weapon = obj_ini.ship_wep[ship_id] - - weapon_facing[1]=""; - weapon_cooldown[1]=0; - weapon_hp[1]=hp/4; - weapon_dam[1]=0; - weapon_ammo[1]=999; - weapon_range[1]=0; - weapon_minrange[1]=0; - weapon_facing[2]=""; - weapon_cooldown[2]=0; - weapon_hp[2]=hp/4; - weapon_dam[2]=0; - weapon_ammo[2]=999; - weapon_range[2]=0; - weapon_minrange[2]=0; - - weapon_facing[3]=""; - weapon_cooldown[3]=0; - weapon_hp[3]=hp/4; - weapon_dam[3]=0; - weapon_ammo[3]=999; - weapon_range[3]=0; - weapon_minrange[3]=0; - - weapon_facing[4]=""; - weapon_cooldown[4]=0; - weapon_hp[4]=hp/4; - weapon_dam[4]=0; - weapon_ammo[4]=999; - weapon_range[4]=0; - weapon_minrange[4]=0; - - weapon_facing[5]=""; - weapon_cooldown[5]=0; - weapon_hp[5]=hp/4; - weapon_dam[5]=0; - weapon_ammo[5]=999; - weapon_range[5]=0; - weapon_minrange[5]=0; - - - - - - if (class="Battle Barge"){ - turrets=3; - weapons=5; - shield_size=3; - sprite_index=spr_ship_bb; - weapon_facing[1]="left"; - weapon_dam[1]=15; - weapon_range[1]=450; - weapon_cooldown[1]=30; - weapon_facing[2]="right"; - weapon_dam[2]=15; - weapon_range[2]=450; - weapon_cooldown[2]=30; - weapon_facing[3]="special"; - weapon_cooldown[3]=90; - weapon_ammo[3]=3; - weapon_range[3]=9999; - weapon_facing[4]="front"; - weapon_dam[4]=12; - weapon_range[4]=1000; - weapon_cooldown[4]=120;// volley several - weapon_facing[5]="most"; - weapon_dam[5]=16; - weapon_range[5]=300; - weapon_cooldown[5]=30; - } - - if (class="Slaughtersong"){turrets=3; - weapons=5;shield_size=3;sprite_index=spr_ship_song; - weapon_facing[1]="most"; - weapon_dam[1]=16; - weapon_range[1]=550; - weapon_cooldown[1]=26; - weapon_facing[2]="most"; - weapon_dam[2]=16; - weapon_range[2]=550; - weapon_cooldown[2]=26; - weapon_facing[3]="most"; - weapon_dam[3]=16; - weapon_range[3]=550; - weapon_cooldown[3]=26; - weapon_facing[4]="front"; - weapon_dam[4]=32; - weapon_range[4]=1000; - weapon_cooldown[4]=90; - } - - -if (class="Gloriana"){ - turrets=3; - weapons=5; - shield_size=3; - sprite_index=spr_ship_song; - weapon_facing[1]="most"; - weapon_dam[1]=16; - weapon_range[1]=550; - weapon_cooldown[1]=26; - weapon_facing[2]="most"; - weapon_dam[2]=16; - weapon_range[2]=550; - weapon_cooldown[2]=26; - weapon_facing[3]="most"; - weapon_dam[3]=16; - weapon_range[3]=550; - weapon_cooldown[3]=26; - weapon_facing[4]="front"; - weapon_dam[4]=32; - weapon_range[4]=1000; - weapon_cooldown[4]=90; -} - if (class="Strike Cruiser"){turrets=1; - weapons=4; - shield_size=1; - sprite_index=spr_ship_stri; - weapon_facing[1]="left"; - weapon_dam[1]=8; - weapon_range[1]=300; - weapon_cooldown[1]=30; - weapon_facing[2]="right"; - weapon_dam[2]=8; - weapon_range[2]=300; - weapon_cooldown[2]=30; - weapon_facing[3]="special"; - weapon_cooldown[3]=90; - weapon_ammo[3]=3; - weapon_range[3]=9999; - weapon_facing[4]="most"; - weapon_dam[4]=12; - weapon_range[4]=300; - weapon_cooldown[4]=30; - } - - if (class="Hunter"){turrets=1; - weapons=2;shield_size=1;sprite_index=spr_ship_hunt; - weapon_facing[1]="front"; - weapon_dam[1]=8; - weapon_range[1]=450; - weapon_cooldown[1]=60; - weapon_facing[2]="most"; - weapon_dam[2]=8; - weapon_range[2]=300; - weapon_cooldown[2]=60; - } - - if (class="Gladius"){turrets=1; - weapons=2;shield_size=1;sprite_index=spr_ship_glad; - weapon_facing[1]="most"; - weapon_dam[1]=8; - weapon_range[1]=300; - weapon_cooldown[1]=30; - } - - - // STC Bonuses - if (obj_controller.stc_bonus[5]=5){armour_front=round(armour_front*1.1);armour_other=round(armour_other*1.1);} - if (obj_controller.stc_bonus[6]=2){armour_front=round(armour_front*1.1);armour_other=round(armour_other*1.1);} - - - var i=0, unit, b=0; - - for (var co=0;co<=obj_ini.companies;co++){ - for (i=0;i(unit.max_health()/10)){ - array_push(board_co, co); - array_push(board_id, i); - array_push(board_location, 0); - array_push(board_raft, 0); - boarders+=1; - } - // Loc 0: on origin ship - // Loc 1: in transit - // Loc >1: (instance_id), on enemy vessel - if (co==0 && master_present==0 && i<100){ - if (unit.role()==obj_ini.role[100][eROLE.ChapterMaster] && unit.ship_location==ship_id){ - master_present=1; - obj_fleet.control=1; - } - } - } - } - } - - if (boarders>0){ - if (obj_controller.command_set[25]=1) then board_capital=true; - if (obj_controller.command_set[26]=1) then board_frigate=true; - } - - if (hp<=0){ - x=-1000; - y=room_height/2; - if (ship_id=0) then instance_destroy(); - } \ No newline at end of file diff --git a/objects/obj_p_ship/Alarm_3.gml b/objects/obj_p_ship/Alarm_3.gml index eeee677d2f..9e0682c019 100644 --- a/objects/obj_p_ship/Alarm_3.gml +++ b/objects/obj_p_ship/Alarm_3.gml @@ -1,11 +1,12 @@ if (hp0){ scr_image("ui/force",1,x-16-32,y+12-32,64,64); draw_set_color(0); - draw_text(x-16,y+12,string_hash_to_newline(string(boarders))); - draw_text(x-16-1,y+12-1,string_hash_to_newline(string(boarders))); - draw_text(x-16+1,y+12+1,string_hash_to_newline(string(boarders))); - draw_text(x-16+1,y+12,string_hash_to_newline(string(boarders))); + draw_text(x-16,y+12,string(boarders)); + draw_text(x-16-1,y+12-1,string(boarders)); + draw_text(x-16+1,y+12+1,string(boarders)); + draw_text(x-16+1,y+12,string(boarders)); draw_set_color(c_white); - draw_text(x-16,y+12,string_hash_to_newline(string(boarders))); -} -draw_set_color(CM_GREEN_COLOR); - - -if (maxhp!=0){ - var zoom_modifier = obj_controller.zoomed?2:1; - if (shields<=0){ - var hp_percent = $"{(hp/maxhp)*100}%" - - draw_text_transformed(x,y-sprite_height,hp_percent,zoom_modifier,zoom_modifier,0); - } - - if (shields>0){ - draw_set_color(c_white); - var shield_percent = $"{(shields/maxshields)*100}%" - - draw_text_transformed(x,y-sprite_height,shield_percent,zoom_modifier,zoom_modifier,0); - } + draw_text(x-16,y+12,string(boarders)); } +draw_set_color(38144); if (master_present!=0) then draw_sprite_ext(spr_popup_select,0,x,y,2,2,0,c_white,1); diff --git a/objects/obj_p_ship/Step_0.gml b/objects/obj_p_ship/Step_0.gml index e48c62af00..701595446e 100644 --- a/objects/obj_p_ship/Step_0.gml +++ b/objects/obj_p_ship/Step_0.gml @@ -1,27 +1,30 @@ image_angle=direction; if (obj_fleet.start!=5) then exit; - - -var dist; - -if (shields>0) and (shields=0) then board_cooldown-=1; // Need to every couple of seconds check this // with obj_en_ship if not big then disable, check nearest, and activate once more - - -if (instance_exists(target)){if ((target.x<3) and (target.y<3)) or (target.hp<0) then target=-50;} +draw_targets = false; +if (instance_exists(target)){ + if ((target.x<3) and (target.y<3)) or (target.hp<0){ + target=-50; + } +} if (!instance_exists(target)) or (target=-50){ - with(obj_en_ship){if ((x<3) and (y<3)) or (hp<=0) then instance_deactivate_object(id);} + with(obj_en_ship){ + if ((x<3) and (y<3)) or (hp<=0) then instance_deactivate_object(id); + } target=instance_nearest(x,y,obj_en_ship); instance_activate_object(obj_en_ship); } //if (!instance_exists(target)) then exit; if (instance_exists(obj_en_ship)){ - if (!instance_exists(target) and (instance_nearest(x,y,obj_en_ship).x>500)) then target=instance_nearest(x,y,obj_en_ship); + if (!instance_exists(target) and (instance_nearest(x,y,obj_en_ship).x>500)){ + target=instance_nearest(x,y,obj_en_ship); + + } if (!instance_exists(target)) then target=instance_nearest(x,y,obj_en_ship); } @@ -50,264 +53,160 @@ if (hp<=0) and (x>-5000){ image_alpha=0.5; if (obj_fleet.start!=0){ - /*ex=instance_create(x,y,obj_explosion); - ex.image_xscale=2;ex.image_yscale=2; - ex.image_speed=0.75;*/ - - var husk;husk=instance_create(x,y,obj_en_husk); - husk.sprite_index=sprite_index;husk.direction=direction; - husk.image_angle=image_angle;husk.depth=depth;husk.image_speed=0; - repeat(choose(4,5,6)){ - var explo;explo=instance_create(x,y,obj_explosion); - explo.image_xscale=0.5;explo.image_yscale=0.5; - explo.x+=random_range(sprite_width*0.25,sprite_width*-0.25); - explo.y+=random_range(sprite_width*0.25,sprite_width*-0.25); - } - + destroy_ship_and_leave_husk(); } - x=-7000;y=room_height/2; + x=-7000; + y=room_height/2; } if (hp>0) and (instance_exists(target)){ - for (var i=0;i0){ - cooldown[i]--; - } - } + is_targeted(); if (class="Apocalypse Class Battleship") or (class="Gloriana"){ - o_dist=500; + closing_distance=500; action="attack"; } else if (class="Nemesis Class Fleet Carrier"){ - o_dist=1000; + closing_distance=1000; action="attack"; } else if (class="Avenger Class Grand Cruiser"){ - o_dist=64; + closing_distance=64; action="broadside"; } - else if (class="Battle Barge") or (class="Strike Cruiser"){ - o_dist=300; - action="attack"; + else if (class="Battle Barge"){ + closing_distance=300; + action="broadside"; + } else if (class == "Strike Cruiser"){ + action="broadside"; + closing_distance=300; } else if (class="Hunter") or (class="Gladius"){ - o_dist=64; + closing_distance=64; action="flank"; } + + if (action = "flank" && target.action == "flank"){ + action = "attack"; + } + + if (action == "broadside"){ + var _near_enemy = instance_nearest(x,y,obj_en_ship); + if (_near_enemy.size >= size){ + target = _near_enemy; + } + } + + show_debug_message($"closing:{closing_distance}"); + // if (class!="big") then flank!!!! - dist=point_distance(x,y,target.x,target.y)-(max(sprite_get_width(sprite_index),sprite_get_height(sprite_index))); + target_distance=point_distance(x,y,target.x,target.y)-(max(sprite_get_width(sprite_index),sprite_get_height(sprite_index))); + target_distance = target_distance; // STC Bonuses - var ts;ts=0.2;if (obj_controller.stc_bonus[5]=3) then ts+=0.1; - + + turning_speed = ship_data.calc_turn_speed(); + speed_up = ship_data.final_acceleration(); + show_debug_message($"accel:{speed_up}"); + + speed_down = ship_data.deceleration(); + + var _player_action = (paction=="move" || paction=="attack_move" || paction=="turn" || paction=="attack_turn"); - if (paction!="move") and (paction!="attack_move") and (paction!="turn") and (paction!="attack_turn"){ - if (target!=0) and (action="attack"){ - direction=turn_towards_point(direction,x,y,target.x,target.y,ts/2); - } - if (target!=0) and (action="broadside") and (dist>o_dist){ - if (y>=target.y) then dist=point_distance(x,y,target.x+lengthdir_x(64,target.direction-180),target.y+lengthdir_y(128,target.direction-90))-(max(sprite_get_width(sprite_index),sprite_get_height(sprite_index))); - if (ytarget.y) and (dist>o_dist) then direction=turn_towards_point(direction,x+lengthdir_x(64,target.direction-180),y,target.x,target.y+lengthdir_y(128,target.direction-90),ts); - if (yo_dist) then direction=turn_towards_point(direction,x+lengthdir_x(64,target.direction-180),y,target.x,target.y+lengthdir_y(128,target.direction+90),ts); - } - if (target!=0) and (action="flank") and (dist>o_dist){ - if (y>=target.y) then dist=point_distance(x,y,target.x+lengthdir_x(64,target.direction-180),target.y+lengthdir_y(128,target.direction-90))-(max(sprite_get_width(sprite_index),sprite_get_height(sprite_index))); - if (ytarget.y) and (dist>o_dist) then direction=turn_towards_point(direction,x,y,target.x,target.y,ts); - if (yo_dist) then direction=turn_towards_point(direction,x,y,target.x,target.y,ts); + if (!_player_action){ + if (target!=0) and (action=="attack"){ + ship_turn_towards_point(target.x,target.y); } + ideal_broadside(); + //broadside_movement(); + flank_behaviour(); } - - // STC Bonuses - var speed_up, speed_down;speed_up=0.005;speed_down=0.025; - if (obj_controller.stc_bonus[6]=3){speed_up=0.008;speed_down=0.037;} - - if (paction="turn") or (paction="attack_turn"){ - direction=turn_towards_point(direction,x,y,target_x,target_y,ts/2); - dist=point_distance(x,y,target_x,target_y); - if (y>target_y) then direction=turn_towards_point(direction,x,y,target_x,target_y,ts); - if (y0) then speed-=speed_down; - - if (direction-point_direction(x,y,target_x,target_y)<=2) and (direction-point_direction(x,y,target_x,target_y)>=-2){ - if (paction="turn") then paction="move"; - if (paction="attack_turn") then paction="attack_move"; - } + + if (draw_targets != false){ + target_distance=point_distance(x,y,draw_targets[0], draw_targets[1]); } - if (paction!="move") and (paction!="turn") and (paction!="attack_move") and (paction!="attack_turn"){ - if (action="attack"){ - if (dist>o_dist) and (speed<(max_speed)) then speed+=speed_up; - if (dist0) then speed-=speed_down; - } - if (action="broadside"){ - if (dist>o_dist) and (speed<(max_speed)) then speed+=speed_up; - if (dist0) then speed-=speed_down; - } - if (action="flank"){// flank here - if (dist>o_dist) and (speed<(max_speed)) then speed+=speed_up; - if (dist0) then speed-=speed_down; - } + if (!_player_action){ + show_debug_message($"accelcalcs"); + combat_acceleration_control(); } - if (paction="move") or (paction="attack_move"){ - direction=turn_towards_point(direction,x,y,target_x,target_y,ts/2); - var dist;dist=point_distance(x,y,target_x,target_y); - if (y>target_y) then direction=turn_towards_point(direction,x,y,target_x,target_y,ts); - if (ytarget_y || y0) then speed-=speed_down; + + if (direction-point_direction(x,y,target_x,target_y)<=2) and (direction-point_direction(x,y,target_x,target_y)>=-2){ + if (paction="turn") then paction="move"; + if (paction="attack_turn") then paction="attack_move"; + } } - if (dist>20) and (speed<(max_speed)) then speed+=speed_up; - if (dist<=20) and (speed>0){ - paction=""; - action="attack"; + + if (paction="move") or (paction="attack_move"){ + direction=turn_towards_point(direction,x,y,target_x,target_y,turning_speed/2); + target_distance=point_distance(x,y,target_x,target_y); + + if(y>target_y || y20) and (speed<(max_speed)) then speed+=speed_up; + if (target_distance<=20) and (speed>0){ + paction=""; + action="attack"; + } } } if (speed<0) then speed=speed*0.9; - if (turret_cool>0) then turret_cool-=1; + if (turret_cool>0){ + turret_cool-=1; + } - var bull, targe, rdir, dirr, dist, xx, yy, ok; - targe=0;rdir=0;dirr="";dist=9999;xx=x;yy=y; + var bull, targe, rdir, dirr, target_distance, xx, yy, ok; + targe=0;rdir=0;dirr="";target_distance=9999;xx=x;yy=y; if (turrets>0) and (instance_exists(obj_en_in)) and (turret_cool=0){ targe=instance_nearest(x,y,obj_en_in); - if (instance_exists(targe)) then dist=point_distance(x,y,targe.x,targe.y); + if (instance_exists(targe)) then target_distance=point_distance(x,y,targe.x,targe.y); - if (dist>64) and (dist<300){ + if (target_distance>64) and (target_distance<300){ bull=instance_create(x,y,obj_p_round); bull.direction=point_direction(x,y,targe.x,targe.y); - bull.speed=20;bull.dam=3; - bull.image_xscale=0.5; - bull.image_yscale=0.5; + bull.speed=20; + bull.dam=3; + bull.image_xscale=0.25; + bull.image_yscale=0.25; turret_cool=floor(60/turrets); bull.direction+=choose(random(3),1*-(random(3))); + bull.explosion_sprite = spr_explosion; } } - targe=0;rdir=0;dirr="";dist=9999; - - - xx=lengthdir_x(64,direction+90); - yy=lengthdir_y(64,direction+90); - - var front, right, left, rear; - front=0;right=0;left=0;rear=0; - - targe=instance_nearest(xx,yy,obj_en_ship); - if (instance_exists(targe)){ - rdir=point_direction(x,y,target.x,target.y); - if (rdir>45) and (rdir<=135) and (targe!=target){target_r=targe;right=1;} - if (rdir>225) and (rdir<=315) and (targe!=target) and (targe!=target_r){target_l=targe;left=1;} - if (collision_line(x,y,x+lengthdir_x(2000,direction),y+lengthdir_y(2000,direction),obj_en_ship,0,1)) then front=1; - - - var f=0,facing="",ammo=0,range=0,wep="",dam=0; - - for (var gg=1;gg0) then cooldown[gg]-=1; - - ok=0;f+=1;facing="";ammo=0;range=0;wep=""; - - - if (cooldown[gg]<=0) and (weapon[gg]!="") and (weapon_ammo[gg]>0) then ok=1; - if (ok=1){ - facing=weapon_facing[gg]; - ammo=weapon_ammo[gg]; - range=weapon_range[gg]; - } - - targe=target; - - if (facing="right") then targe=target_r; - if (facing="left") then targe=target_l; - if ((facing="front") or (facing="most")) and (front=1) then ok=2; - if (facing="right") or (facing="most") and (right=1) then ok=2; - if (facing="left") or (facing="most") and (left=1) then ok=2; - if (facing="special") then ok=2; - if (instance_exists(targe)){ - - - dist=point_distance(x,y,targe.x,targe.y); - - - if (ok=2) and (dist<(range+(max(sprite_get_width(sprite_index),sprite_get_height(sprite_index))))){ - //if (ammo>0) and (ammo<500) then ammo-=1; - weapon_ammo[gg]=ammo; - cooldown[gg]=weapon_cooldown[gg]; - wep=weapon[gg]; - dam=weapon_dam[gg]; - - // if (f=3) and (ship_id=2) then show_message("ammo: "+string(ammo)+" | range: "+string(range)); - - if (ammo<0) then ok=0; - ok=3; - - if (string_count("orpedo",wep)=0) and (string_count("hawk",wep)=0) and (ok=3){ - bull=instance_create(x+lengthdir_x(32,direction),y+lengthdir_y(32,direction),obj_p_round); - bull.speed=20;bull.dam=dam; - if (targe=target) then bull.direction=point_direction(x+lengthdir_x(32,direction),y+lengthdir_y(32,direction),target.x,target.y); - if (facing!="front"){bull.direction=point_direction(x+lengthdir_x(32,direction),y+lengthdir_y(32,direction),target.x,target.y);} - if (string_count("ova",wep)=1){bull.image_xscale=2;bull.image_yscale=2;} - if (wep="Lance Battery"){ - bull.sprite_index=spr_ground_las; - bull.image_xscale=2; - bull.image_yscale=2; - } - if (wep="Plasma Cannon"){ - bull.sprite_index=spr_ground_plasma; - bull.image_xscale=3;bull.image_yscale=3; - } - } - if (string_count("orpedo",wep)=1) and (ok=3){ - - if (sprite_index=spr_ship_bb){ - bull=instance_create(x,y+lengthdir_y(-30,direction+90),obj_p_round); - bull.speed=10;bull.direction=direction;bull.sprite_index=spr_torpedo;bull.dam=dam; - } - - bull=instance_create(x,y+lengthdir_y(-10,direction+90),obj_p_round); - bull.speed=10; - bull.direction=direction;bull.sprite_index=spr_torpedo; - bull.dam=dam; - bull=instance_create(x,y+lengthdir_y(10,direction+90),obj_p_round); - bull.speed=10; - bull.direction=direction;bull.sprite_index=spr_torpedo; - bull.dam=dam; - - if (sprite_index=spr_ship_bb){ - bull=instance_create(x,y+lengthdir_y(30,direction+90),obj_p_round); - bull.speed=10; - bull.direction=direction;bull.sprite_index=spr_torpedo;bull.dam=dam; - } - } - if (string_count("hawk",wep)=1) and (ok=3){ - bull=instance_create(x,y+lengthdir_y(-30,direction+90),obj_p_th); - bull.direction=self.direction; - } - } - } - } - } - + ship_shoot_weapons(); - + } - - +shields.step(); @@ -318,8 +217,13 @@ if (instance_exists(obj_en_ship)) and (boarders>0) and (board_cooldown<=0) and ( var eh=0,te=0; repeat(2){ eh+=1;te=0; - if (eh=1) and (board_capital=true){if (instance_exists(obj_en_capital)) then te=instance_nearest(x,y,obj_en_capital);} - if (eh=2) and (board_frigate=true){if (instance_exists(obj_en_cruiser)) then te=instance_nearest(x,y,obj_en_cruiser);} + if (eh=1) and (board_capital=true){ + if (instance_exists(obj_en_capital)){ + te=instance_nearest(x,y,obj_en_capital); + } + } + if (eh=2) and (board_frigate=true){ + if (instance_exists(obj_en_cruiser)) then te=instance_nearest(x,y,obj_en_cruiser);} if (te!=0) and (instance_exists(te)){ if (point_distance(x,y,te.x,te.y)<=428){ create_boarding_craft(te); diff --git a/objects/obj_p_ship/obj_p_ship.yy b/objects/obj_p_ship/obj_p_ship.yy index 88ab5c0200..72aef3cf06 100644 --- a/objects/obj_p_ship/obj_p_ship.yy +++ b/objects/obj_p_ship/obj_p_ship.yy @@ -4,7 +4,6 @@ "eventList":[ {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":3,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":3,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":51,"eventType":6,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, @@ -25,7 +24,7 @@ "physicsGroup":0, "physicsKinematic":false, "physicsLinearDamping":0.1, - "physicsObject":false, + "physicsObject":true, "physicsRestitution":0.1, "physicsSensor":false, "physicsShape":0, diff --git a/objects/obj_p_th/Step_0.gml b/objects/obj_p_th/Step_0.gml index f09a7fa620..54c0ad010c 100644 --- a/objects/obj_p_th/Step_0.gml +++ b/objects/obj_p_th/Step_0.gml @@ -3,25 +3,29 @@ image_angle=direction; if (cooldown1>0) then cooldown1-=1; -var dist, range; +var target_distance, range; if (instance_exists(target)){ - dist=point_distance(x,y,target.x,target.y); + target_distance=point_distance(x,y,target.x,target.y); range=100+max(sprite_get_width(target.sprite_index),sprite_get_height(target.sprite_index)); if (action="close"){speed=4;direction=turn_towards_point(direction,x,y,target.x,target.y,8);} - if (dist100) and (action="close") then action="shoot"; - if (action="shoot") and (dist>range) then action="close"; - if (dist<80) and (action="shoot") then action="bank"; + if (target_distance100) and (action="close") then action="shoot"; + if (action="shoot") and (target_distance>range) then action="close"; + if (target_distance<80) and (action="shoot") then action="bank"; if (action="bank") then direction=turn_towards_point(direction,x,y,0,room_height/2,4); - if (action="bank") and (dist>300) then action="close"; + if (action="bank") and (target_distance>300) then action="close"; if (action="shoot") and (cooldown1<=0){ var bull;cooldown1=30; - bull=instance_create(x,y,obj_p_round);bull.direction=self.direction; - bull.speed=20;bull.image_xscale=0.5;bull.image_yscale=0.5;bull.dam=3; + bull=instance_create(x,y,obj_p_round); + bull.direction=self.direction; + bull.speed=20;bull.image_xscale=0.5; + bull.image_yscale=0.5; + bull.dam=3; + bull.explosion_sprite = spr_explosion; } diff --git a/objects/obj_pnunit/Alarm_0.gml b/objects/obj_pnunit/Alarm_0.gml index 293a1c15b1..c3974e4e19 100644 --- a/objects/obj_pnunit/Alarm_0.gml +++ b/objects/obj_pnunit/Alarm_0.gml @@ -25,7 +25,7 @@ try { var once_only;once_only=0; var range_shoot=""; - var dist=point_distance(x,y,enemy.x,enemy.y)/10; + var target_distance=point_distance(x,y,enemy.x,enemy.y)/10; //* Psychic power buffs for (var i = 0; i < array_length(unit_struct); i++) { @@ -69,12 +69,12 @@ try { } - if (range[i]>=dist) and (ammo[i]!=0 || range[i]==1){ + if (range[i]>=target_distance) and (ammo[i]!=0 || range[i]==1){ if (range[i]!=1) and (engaged=0) then range_shoot="ranged"; if ((range[i]!=floor(range[i]) || floor(range[i])=1) && engaged=1) then range_shoot="melee"; } - if (range_shoot="ranged") and (range[i]>=dist){// Weapon meets preliminary checks + if (range_shoot="ranged") and (range[i]>=target_distance){// Weapon meets preliminary checks var ap=0; if (apa[i]>att[i]) then ap=1;// Determines if it is AP or not if (wep[i]="Missile Launcher") then ap=1; diff --git a/objects/obj_pnunit/Alarm_6.gml b/objects/obj_pnunit/Alarm_6.gml index e68c39ab8c..5836810dd2 100644 --- a/objects/obj_pnunit/Alarm_6.gml +++ b/objects/obj_pnunit/Alarm_6.gml @@ -17,7 +17,10 @@ for (var i=0;i0) then obj_ncombat.world_size+=man_size; - if (unit.ship_location>-1) then obj_ini.ship_carrying[unit.ship_location]-=man_size; + if (unit.ship_location>-1){ + var _ship = obj_ini.ship_data[unit.ship_location] + _ship.carrying-=man_size; + } // scr_kill_unit(unit.company,unit.marine_number); } @@ -38,7 +41,11 @@ for (var i=0;i-1) then obj_ncombat.world_size+=man_size; - if (obj_ini.veh_lid[veh_co[i],veh_id[i]]>-1) then obj_ini.ship_carrying[obj_ini.veh_lid[veh_co[i],veh_id[i]]]-=man_size; + var _ship_id = obj_ini.veh_lid[veh_co[i],veh_id[i]]; + if (_ship_id>-1){ + var _ship = obj_ini.ship_data[_ship_id]; + _ship.carrying-=man_size; + } // show_message(string(veh_type[i])+" ("+string(veh_co[i])+"."+string(veh_id[i])+") dead"); diff --git a/objects/obj_popup/Destroy_0.gml b/objects/obj_popup/Destroy_0.gml index 3af0fb3804..0c35df4704 100644 --- a/objects/obj_popup/Destroy_0.gml +++ b/objects/obj_popup/Destroy_0.gml @@ -107,7 +107,8 @@ if (instance_exists(obj_controller)){ if (obj_controller.current_eventing="chaos_meeting_end") and (instance_exists(obj_turn_end)){ - obj_turn_end.alarm[1]=1;obj_controller.current_eventing=""; + setup_audience_and_popup_timer(1); + obj_controller.current_eventing=""; } } diff --git a/objects/obj_popup/Draw_64.gml b/objects/obj_popup/Draw_64.gml index abb454c313..945a31a605 100644 --- a/objects/obj_popup/Draw_64.gml +++ b/objects/obj_popup/Draw_64.gml @@ -72,7 +72,7 @@ try{ draw_set_color(255); } } - draw_text_transformed(x1 + (sprite_width / 2), y1 + (sprite_height * 0.07), string_hash_to_newline(string(title)), 1.1, 1.1, 0); + draw_text_transformed(x1 + (sprite_width / 2), y1 + (sprite_height * 0.07), title, 1.1, 1.1, 0); // draw_text(xx+320.5,yy+123.5,string(title)); draw_set_font(fnt_40k_14); @@ -80,12 +80,13 @@ try{ draw_set_color(CM_GREEN_COLOR); if (instance_exists(obj_turn_end)) { - if (obj_turn_end.popups > 0) { - draw_text(x1 + 20, y1 + (sprite_height * 0.07), $"{obj_turn_end.current_popup}/{obj_turn_end.popups}" ) + var _pop_count = array_length(obj_turn_end.popup); + if (_pop_count) { + draw_text(x1 + 20, y1 + (sprite_height * 0.07), $"{obj_turn_end.current_popup+1}/{_pop_count}"); } } if (image == "debug") { - draw_text_ext(x1 + 20, y1 + (sprite_height * 0.18), string_hash_to_newline(string(text)), -1, sprite_width - 40); + draw_text_ext(x1 + 20, y1 + (sprite_height * 0.18), string_hash_to_newline(text), -1, sprite_width - 40); } else if (image == "") { if (size == 1) { draw_text_ext(x1 + 5, y1 + (sprite_height * 0.18), string_hash_to_newline(string(text)), -1, width); diff --git a/objects/obj_popup/Keyboard_13.gml b/objects/obj_popup/Keyboard_13.gml index f8c09b1a10..cc6131a758 100644 --- a/objects/obj_popup/Keyboard_13.gml +++ b/objects/obj_popup/Keyboard_13.gml @@ -17,17 +17,14 @@ if (array_length(options == 0) && type<5){ obj_controller.cooldown=10; if (number!=0) and (obj_controller.complex_event=false){ if (instance_exists(obj_turn_end)){ - obj_turn_end.alarm[1]=4; + setup_audience_and_popup_timer(4); } } instance_destroy(); } if (type=POPUP_TYPE.BATTLE_OPTIONS){ - obj_controller.cooldown=10; - obj_turn_end.current_battle+=1; - obj_turn_end.alarm[0]=1; - obj_controller.force_scroll=0; + end_turn_battle_next_sequence(); instance_destroy(); } diff --git a/objects/obj_popup/Keyboard_32.gml b/objects/obj_popup/Keyboard_32.gml index 058a40765d..6d92196e0a 100644 --- a/objects/obj_popup/Keyboard_32.gml +++ b/objects/obj_popup/Keyboard_32.gml @@ -15,14 +15,15 @@ if (battle_special>0){ if (array_length(options) == 0) and (type<5){ obj_controller.cooldown=10; - if (number!=0) and (obj_controller.complex_event=false) then obj_turn_end.alarm[1]=4; + if (number!=0) and (obj_controller.complex_event=false){ + setup_audience_and_popup_timer(4); + } instance_destroy(); } if (type=POPUP_TYPE.BATTLE_OPTIONS){ obj_controller.cooldown=10; - obj_turn_end.current_battle+=1; - obj_turn_end.alarm[0]=1; + end_turn_battle_next_sequence(); obj_controller.force_scroll=0; instance_destroy(); } diff --git a/objects/obj_popup/Step_0.gml b/objects/obj_popup/Step_0.gml index d2e20d8bd9..7153b27bc5 100644 --- a/objects/obj_popup/Step_0.gml +++ b/objects/obj_popup/Step_0.gml @@ -136,7 +136,7 @@ try { } if ((press == 2) && instance_exists(obj_turn_end)) { if (number != 0) { - obj_turn_end.alarm[1] = 4; + setup_audience_and_popup_timer(4); } with (obj_temp_meeting) { instance_destroy(); @@ -207,7 +207,7 @@ try { p3 = string(obj_controller.fest_star) + " " + scr_roman(obj_controller.fest_wid); } if (p2 <= 0) { - p3 = +" the vessel '" + string(obj_ini.ship[obj_controller.fest_sid]) + "'"; + p3 = +" the vessel '{obj_ini.ship_data[obj_controller.fest_sid].name}'"; } scr_alert("green", "event", string(p1) + " on " + string(p3) + " ends.", 0, 0); @@ -215,7 +215,7 @@ try { } obj_controller.cooldown = 10; if (number != 0 && instance_exists(obj_turn_end)) { - obj_turn_end.alarm[1] = 4; + setup_audience_and_popup_timer(4); } instance_destroy(); } @@ -351,7 +351,7 @@ try { last_artifact = scr_add_artifact("good", "inquisition", 0, obj_ini.home_name, 2); } else if (obj_ini.fleet_type != ePlayerBase.home_world) { image = "artifact_given"; - last_artifact = scr_add_artifact("good", "inquisition", 0, obj_ini.ship[0], 501); + last_artifact = scr_add_artifact("good", "inquisition", 0, obj_ini.ship_data[0].name, 501); } title = "New Artifact"; @@ -362,7 +362,7 @@ try { text += "within your Fortress Monastery."; } if (obj_ini.fleet_type != ePlayerBase.home_world) { - text += $"upon your ship '{obj_ini.ship[0]}'."; + text += $"upon your ship '{obj_ini.ship_data[0].name}'."; } scr_event_log("", "Inquisition Mission Accepted: The Inquisition has left an Artifact in your care."); @@ -394,7 +394,7 @@ try { obj_controller.cooldown = 10; if (obj_controller.complex_event == false) { if (number != 0 && instance_exists(obj_turn_end)) { - obj_turn_end.alarm[1] = 4; + setup_audience_and_popup_timer(4); } instance_destroy(); } @@ -436,7 +436,7 @@ try { man_size = 0; comp = 0; plan = 0; - ship_id = array_get_index(obj_ini.ship, obj_ground_mission.loc); + ship_id = get_ship_by_name(obj_ground_mission.loc); obj_controller.menu = 0; obj_controller.managing = 0; obj_controller.cooldown = 10; @@ -451,7 +451,7 @@ try { if (obj_controller.complex_event == false) { if (number != 0 && instance_exists(obj_turn_end)) { - obj_turn_end.alarm[1] = 4; + setup_audience_and_popup_timer(4); } instance_destroy(); } diff --git a/objects/obj_star/Alarm_0.gml b/objects/obj_star/Alarm_0.gml index 09b69d56cc..da2c20a10e 100644 --- a/objects/obj_star/Alarm_0.gml +++ b/objects/obj_star/Alarm_0.gml @@ -180,7 +180,7 @@ switch (name) { planets = 3; p_type[1] = "Feudal"; planet[1] = 1; - array_push(p_feature[1], new NewPlanetFeature(P_features.Necron_Tomb)); + array_push(p_feature[1], new PlanetFeature(P_features.NecronTomb)); p_type[2] = "Dead"; planet[2] = 1; p_type[3] = "Dead"; diff --git a/objects/obj_star/Alarm_1.gml b/objects/obj_star/Alarm_1.gml deleted file mode 100644 index 360fc6d552..0000000000 --- a/objects/obj_star/Alarm_1.gml +++ /dev/null @@ -1,484 +0,0 @@ -// the min population of a planet is usually 1/3 of the max. so lava has 1500 max. min is 500. min + random should = max -// its important to know the population of a planet due to recruitment changing depending on population max -// If getting to max pop is very rare, it will be awful to recruit from -// some planets may be better or worse than others depending on their max pop. -// TODO refactor and improve logic -for(var i=1; i<=4; i++){ - p_population[i]=0;// 10B - switch (p_type[i]) { - case "Lava": - p_population[i] = irandom(1500) + 500; - p_station[i] = 2; - p_max_population[i] = 2000; - break; - case "Desert": - p_population[i] = irandom(150000000) + 100000000; - p_fortified[i] = choose(2, 3, 4); - p_station[i] = 3; - p_max_population[i] = 250000000; - break; - case "Hive": - p_population[i] = random(100) + 50; - p_large[i] = 1; - p_fortified[i] = 4; - p_station[i] = choose(4, 5); - p_max_population[i] = 150; - break; - case "Agri": - p_population[i] = irandom(1000000) + 500000; - p_fortified[i] = choose(0, 1); - p_station[i] = choose(0, 1); - p_max_population[i] = 1500000; - break; - case "Temperate": - p_population[i] = irandom(4) + 2; - p_large[i] = 1; - p_fortified[i] = choose(3, 4); - p_station[i] = choose(3, 4); - p_max_population[i] = 6; - break; - case "Shrine": - p_population[i] = irandom(5) + 3; - p_large[i] = 1; - p_fortified[i] = choose(4, 5); - p_station[i] = choose(4, 5); - p_max_population[i] = 8; - break; - case "Ice": - p_population[i] = irandom(13500000) + 6500000; - p_fortified[i] = choose(1, 2, 3); - p_station[i] = choose(1, 2, 3); - p_max_population[i] = 20000000; - break; - case "Feudal": - p_population[i] = irandom(400000000) + 200000000; - p_fortified[i] = choose(2, 3); - p_station[i] = choose(2, 3, 4); - p_max_population[i] = 600000000; - break; - case "Forge": - p_population[i] = random(26) + 4; - p_large[i] = 1; - p_fortified[i] = 5; - p_station[i] = 5; - p_max_population[i] = 30; - break; - case "Death": - p_population[i] = irandom(300000) + 200000; - p_station[i] = choose(2, 3); - p_max_population[i] = 500000; - break; - case "Craftworld": - p_population[i] = irandom_range(150000, 300000); - p_station = 6; - p_max_population[i] = p_population[i]; - break; - } - // Sets military on planet - if (p_population[i]>=10000000){ - var military=p_population[i]/470; - p_guardsmen[i]=floor(military*0.25); - p_pdf[i]=floor(military*0.75); - } - if (p_population[i]>=5000000) and (p_population[i]<10000000){ - var military=p_population[i]/200; - p_guardsmen[i]=floor(military*0.25); - p_pdf[i]=floor(military*0.75); - } - if (p_population[i]>=100000) and (p_population[i]<5000000){ - var military=p_population[i]/50; - p_guardsmen[i]=floor(military*0.25); - p_pdf[i]=floor(military*0.75); - } - if (p_population[i]<100000) and (p_population[i]>5) and (p_large[i]==0){ - p_pdf[i]=floor(p_population[i]/25); - } - if (p_population[i]<2000) and (p_population[i]>5) and (p_large[i]==0){ - p_pdf[i]=floor(p_population[i]/10); - } - if (p_large[i]==1){ - p_guardsmen[i]=floor(p_population[i]*1250000); - p_pdf[i]=p_guardsmen[i]*3; - } - - if (p_population[i]<1000000) and (p_large[i]==0)then p_pop[i]=string(p_population[i]); - if (p_population[i]>999999) and (p_large[i]==0)and (p_population[i]<1000000000) then p_pop[i]=string(p_population[i]/1000000)+"M"; - if (p_large[i]==1) then p_pop[i]=string(p_population[i])+"B"; - - if (craftworld==1){ - p_guardsmen[i]=0; - p_pdf[i]=0; - p_eldar[i]=6; - owner = eFACTION.Eldar; - p_owner[1]=6; - warp_lanes=[]; - x2=0; - } - // p_guardsmen[i]=0; -} - -for(var i=1; i<=4; i++){p_guardsmen[i]=0;} - -var fleet, system_fleet=0,capital=0,frigate=0,escort=0; -// Create Imperium Fleet -if (owner == eFACTION.Imperium || owner == eFACTION.Ork || owner == eFACTION.Mechanicus){ - for(var g=1; g<=4; g++){ - switch (p_type[g]) { - case "Hive": - system_fleet += 4; - break; - case "Forge": - system_fleet += 8; - break; - case "Desert": - case "Temperate": - system_fleet += 1; - break; - case "Feudal": - case "Ice": - system_fleet += 0.5; - break; - case "Shrine": - system_fleet += 2; - break; - } - } - - frigate=round(system_fleet/2); - escort=round(system_fleet); - - if (capital<0) then capital=0; - if (frigate<0) then frigate=0; - if (escort<0) then escort=0; - - if (system_fleet>0){ // DISABLED FOR TESTING FLEET COMBAT - fleet=instance_create(x,y,obj_en_fleet); - fleet.owner = eFACTION.Imperium; - - fleet.capital_number=capital; - fleet.frigate_number=frigate; - fleet.escort_number=escort; - - // present_fleet[2]+=1; - - // Create ships here - fleet.image_speed=0; - var ii=0; - ii+=capital-1; - ii+=round((frigate/2)); - ii+=round((escort/4)); - if (ii<=1) and (capital+frigate+escort>0) then ii=1; - fleet.image_index=ii; - } -} -// Creates Ork forces -if (owner == eFACTION.Ork){ - if (p_population[1]>0) then p_orks[1]=1; - if (p_population[2]>0) then p_orks[2]=1; - if (p_population[3]>0) then p_orks[3]=1; - if (p_population[4]>0) then p_orks[4]=1; - - if (p_orks[1]>0){p_orks[1]=choose(1,2,3,3,4,5); - if (p_type[1]="Forge") or (p_type[1]="Hive") then p_orks[1]=choose(4,5);} - if (p_orks[2]>0){p_orks[2]=choose(1,2,3,3,4,5); - if (p_type[2]="Forge") or (p_type[2]="Hive") then p_orks[2]=choose(4,5);} - if (p_orks[3]>0){p_orks[3]=choose(1,2,3,3,4,5); - if (p_type[3]="Forge") or (p_type[3]="Hive") then p_orks[3]=choose(4,5);} - if (p_orks[4]>0){p_orks[4]=choose(1,2,3,3,4,5); - if (p_type[4]="Forge") or (p_type[4]="Hive") then p_orks[4]=choose(4,5);} -} - -system_fleet=1; -capital=0; -frigate=0; -escort=0; -// Create Tau Fleet -if (owner == eFACTION.Tau){ - for (var i = 1; i <= planets; i++) { - if (p_type[i] == "Desert") { - system_fleet += 5; - } - } - - if (system_fleet>=4){ - capital=choose(1,2,2,2,3,4); - frigate=floor(random_range(5,10)); - escort=floor(random_range(8,14)); - } - if (system_fleet>=1) and (system_fleet<3){ - capital=choose(1,2,2); - frigate=floor(random_range(4,8)); - escort=floor(random_range(5,12)); - } - if (system_fleet>0){ - fleet=instance_create(x,y,obj_en_fleet); - fleet.owner = eFACTION.Tau; - // Create ships here - fleet.sprite_index=spr_fleet_tau; - fleet.image_speed=0; - - fleet.capital_number=capital; - fleet.frigate_number=frigate; - fleet.escort_number=escort; - - fleet.image_index=floor((capital)+(frigate/2)+(escort/4)); - } - - for (var i = 1; i <=planets; i++) { - if (p_type[i] != "Dead") { - p_tau[i] = choose(1,2,3,4); - } - } - for (var i = 1; i <=planets; i++) { - if (p_type[i] == "Desert" && p_tau[i] < 4) { - p_tau[i] = 4; - } - } - for (var i = 1; i <=planets; i++) { - if (p_tau[i] > 0) { - p_owner[i] = 8; - p_first[i] = 8; - - switch (p_type[i]) { - case "Forge": - case "Hive": - p_tau[i] = choose(2,3); - break; - case "Ice": - p_tau[i] = choose(1,2); - break; - case "Temperate": - case "Desert": - case "Feudal": - p_tau[i] = choose(3,3,4,4,5); - break; - } - } - } - for (var i=1;i<=planets;i++){ - p_owner[i]=eFACTION.Tau; - p_first[i]=eFACTION.Tau; - p_influence[i][eFACTION.Tau]=65+irandom(15); - } -} -// Create Nids -if (owner == eFACTION.Tyranids){ - for (var i = 1; i <= planets; i++) { - if (p_population[i] > 0) { - p_tyranids[i] = 1; - - switch (p_type[i]) { - case "Forge": - case "Hive": - p_tyranids[i] = choose(4,5,5); - break; - } - //array_push(p_feature[i], new NewPlanetFeature(P_features.Gene_Stealer_Cult)); - - } - p_owner[i] = eFACTION.Imperium; - } -} - -if (owner>20){ - for (var i = 1; i <= planets; i++) { - if (p_population[i] > 0) { - var new_cult = new NewPlanetFeature(P_features.Gene_Stealer_Cult); - array_push(p_feature[i], new_cult); - new_cult.cult_age = irandom(300) - p_influence[i][eFACTION.Tyranids] = new_cult.cult_age/10 + irandom(30); - p_tyranids[i] = min(3, floor(p_influence[i][eFACTION.Tyranids]/15)) - if (p_tyranids[i]!=0){ - new_cult.hiding =false; - } - } - p_owner[i] = 2; - } - owner = eFACTION.Tyranids; -} - -for(var i=1; i<=planets; i++){ - if (p_owner[i]=8) and (p_guardsmen[i]>0){ - p_pdf[i]+=p_guardsmen[i]; - p_guardsmen[i]=0; - } - if (p_type[i]="Shrine") and (p_owner[i]!=1) and (p_first[i]!=1){ - p_owner[i]=5; - p_first[i]=5; - p_sisters[i]=4; - adjust_influence(eFACTION.Ecclesiarchy, (p_sisters[i]*10)-irandom(5), i); - } - // if (p_owner[i]=3) or (p_owner[i]=5){p_feature[i]="Artifact|";}Testing ; 137 -} - -if (name=="Kim Jong") and (owner == eFACTION.Chaos){ - for (var i = 1; i <=planets; i++) { - if (p_type[i] != "Dead") { - p_heresy[i] = 100; - p_traitors[i] = 2; - } - } -} - -obj_controller.alarm[3]=1; - -var i=choose(0,1); -if (i==1) and (planets>0){ - var nostart=false,aa=0; - i=floor(random(planets))+1; - - if (instance_exists(obj_p_fleet)) { - aa = instance_nearest(x, y, obj_p_fleet); - if (point_distance(x, y, aa.x, aa.y) > 50) { - nostart = true; - } - } - if (!instance_exists(obj_p_fleet)) then nostart=true; - - if (array_length(p_feature[i])==0) and (p_owner[i]!=1) and (nostart){ - var ranb=0; - // if (ranb=1) and (p_owner[i]!=1) and (p_owner[i]!=2) and (p_owner[i]!=3) then ranb=floor(random(4))+2; - // - var goo=0; - if (goo==0){ - for(var j=0; j<10; j++){ - if (goo==0)and (irandom(9)<2){ - ranb=floor(random(6))+1; - - switch (name) { - case "Vulvis Major": - ranb = 1; - break; - case "Necron Assrape": - ranb = 2; - break; - case "Morrowynd": - ranb = 5; - break; - } - - if (goo==0){ - switch (ranb){ - case 1: - array_push(p_feature[i], new NewPlanetFeature(P_features.Sororitas_Cathedral)) - if (p_heresy[i]>10) then p_heresy[i]-=10; - p_sisters[i]=choose(2,2,3); - adjust_influence(eFACTION.Ecclesiarchy, (p_sisters[i]*10)-irandom(3), i) - goo=1; - break; - case 2: - if (p_type[i]!="Hive") and (p_type[i]!="Lava") and (goo==0){ - array_push(p_feature[i], new NewPlanetFeature(P_features.Necron_Tomb)) - goo=1; - } - break; - case 3: - array_push(p_feature[i], new NewPlanetFeature( P_features.Artifact)) - goo=1; - break; - case 4: - array_push(p_feature[i], new NewPlanetFeature( P_features.STC_Fragment)) - goo=1; - break; - case 5: - if (p_type[i]!="Ice") and (p_type[i]!="Dead") and (p_type[i]!="Feudal"){ - goo=1; - array_push(p_feature[i], new NewPlanetFeature( P_features.Ancient_Ruins)) - } - break; - //alternative spawn for necron tomb probably needs merging with other method - case 6: - if ((p_type[i]=="Ice") or (p_type[i]=="Dead")){ - array_push(p_feature[i], new NewPlanetFeature( P_features.Necron_Tomb)) - goo=1; - } - break; - case 7: - if ((p_type[i]=="Dead") or (p_type[i]=="Desert")){ - var randum=floor(random(100))+1; - if (randum<=25){ - array_push(p_feature[i], new NewPlanetFeature( P_features.Cave_Network)) - goo=1; - } - } - break; - } - } - } - } - } - } -} - -var hyu=0; -for(var i=1; i<=4; i++){ - if (p_tyranids[i]>=5){ - p_guardsmen[i]=0; - p_pdf[i]=0; - p_population[i]=0; - hyu+=1; - p_owner[i]=9; - } - if (p_first[i]<=5) and (dispo[i]>-5000){ - dispo[i]=-20; - } -} -if (hyu==0) and (owner == eFACTION.Tyranids) then owner = eFACTION.Imperium; - -scr_star_ownership(false); - -if (obj_controller.is_test_map=true){ - /*if (p_owner[1]=3) then p_feature[1]="STC Fragment|"; - if (p_owner[2]=3) then p_feature[2]="STC Fragment|"; - if (p_owner[3]=3) then p_feature[3]="STC Fragment|"; - - - // Testing new guardsmen - p_guardsmen[1]=5000000; - p_tyranids[1]=4; - - p_guardsmen[2]=500000; - p_tyranids[2]=3; - - p_guardsmen[3]=100000; - p_tyranids[3]=2; - - p_orks[1]=0;p_orks[2]=0;p_orks[3]=0;*/ -} - -// if (obj_controller.is_test_map=true) and (p_owner[2]=1){ - -if (p_owner[2]=1){ - /* - p_guardsmen[2]=10000000; - p_pdf[2]=0; - obj_controller.faction_status[eFACTION.Imperium]="War"; - */ - - // p_type[1]="Dead"; - // p_feature[2]=""; - - // p_orks[2]=3; - // p_feature[2]="Starship!0!|"; - - /*repeat(4){ - var fleet;fleet=instance_create(x+(floor(random_range(100,200))*choose(1,-1)),y+(floor(random_range(100,200))*choose(1,-1)),obj_en_fleet); - fleet.owner = eFACTION.Chaos;fleet.sprite_index=spr_fleet_chaos;fleet.orbiting=0; - fleet.action_x=x;fleet.action_y=y;fleet.alarm[4]=1; - - fleet.capital_number=0; - fleet.frigate_number=1; - fleet.escort_number=2; - - // Create ships here - fleet.image_speed=0; - var ii;ii=0;ii+=capital-1;ii+=round((frigate/2));ii+=round((escort/4)); - if (ii<=1) and (capital+frigate+escort>0) then ii=1; - fleet.image_index=ii; - }*/ - -} - -if (obj_controller.is_test_map!=true) and (p_owner[2]!=1){ - for(var i=1; i<=4; i++){p_guardsmen[i]=0;} -} diff --git a/objects/obj_star/Alarm_2.gml b/objects/obj_star/Alarm_2.gml deleted file mode 100644 index 72e0de1e8e..0000000000 --- a/objects/obj_star/Alarm_2.gml +++ /dev/null @@ -1,23 +0,0 @@ -// Assigns the income to the player system based on its neighbours -if (instance_exists(obj_temp1)){ - var tempy=0,tempy_d=9999,biggy=0; - - tempy=instance_nearest(x,y,obj_temp1); - tempy_d=point_distance(x,y,tempy.x,tempy.y); - - // Nearby star system - if (tempy_d>10) and (tempy_d<=180){ - for(var i=1; i<=planets; i++){ - if (p_type[i]=="Forge") and (p_owner[i]==3) then obj_controller.income_forge+=6; - if (p_type[i]=="Agri") and (p_owner[i]==2) then obj_controller.income_agri+=3; - } - } - biggy=instance_nearest(obj_temp1.x,obj_temp1.y,obj_star); - var connected = determine_warp_join(biggy, self.id); - if (biggy.owner==eFACTION.Player) and (tempy_d>180) and (connected){ - for(var i=1; i<=planets; i++){ - if (p_type[i]=="Forge") and (p_owner[i]==3) then obj_controller.income_forge+=6; - if (p_type[i]=="Agri") and (p_owner[i]==2) then obj_controller.income_agri+=3; - } - } -} diff --git a/objects/obj_star/obj_star.yy b/objects/obj_star/obj_star.yy index d7c5b02f61..48a5509994 100644 --- a/objects/obj_star/obj_star.yy +++ b/objects/obj_star/obj_star.yy @@ -5,7 +5,6 @@ {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":4,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":3,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":2,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":1,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":3,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, diff --git a/objects/obj_star_select/Alarm_1.gml b/objects/obj_star_select/Alarm_1.gml index ce93d559ae..ab0555a30a 100644 --- a/objects/obj_star_select/Alarm_1.gml +++ b/objects/obj_star_select/Alarm_1.gml @@ -9,21 +9,12 @@ tau_fleet=target.present_fleet[8]; tyranid_fleet=target.present_fleet[9]; heretic_fleet=target.present_fleet[10]; -en_fleet[0]=0; -var i;i=-1; -repeat(15){i+=1;en_fleet[i]=0;} +en_fleet = []; -if (player_fleet>0) and (imperial_fleet+mechanicus_fleet+inquisitor_fleet+eldar_fleet+ork_fleet+tau_fleet+heretic_fleet>0){ - var open;open=1;i=-1; - - if (imperial_fleet>0){en_fleet[open]=2;open+=1;} - if (mechanicus_fleet>0){en_fleet[open]=3;open+=1;} - if (inquisitor_fleet>0){en_fleet[open]=4;open+=1;} - if (eldar_fleet>0){en_fleet[open]=6;open+=1;} - if (ork_fleet>0){en_fleet[open]=7;open+=1;} - if (tau_fleet>0){en_fleet[open]=8;open+=1;} - if (tyranid_fleet>0){en_fleet[open]=9;open+=1;} - if (heretic_fleet>0){en_fleet[open]=10;open+=1;} +for (var i=2;i<15;i++){ + if (scr_orbiting_fleet(i, target) != "none"){ + array_push(en_fleet, i); + } } diff --git a/objects/obj_star_select/Create_0.gml b/objects/obj_star_select/Create_0.gml index b5397e8489..6a012c48e0 100644 --- a/objects/obj_star_select/Create_0.gml +++ b/objects/obj_star_select/Create_0.gml @@ -73,11 +73,11 @@ recruiting_button.update({ target : target, }); recruiting_button.bind_method = function(){ - if (!p_data.has_feature(P_features.Recruiting_World)) { - p_data.add_feature(P_features.Recruiting_World); + if (!p_data.has_feature(P_features.RecruitingWorld)) { + p_data.add_feature(P_features.RecruitingWorld); obj_controller.recruiting_worlds += $"{planet_numeral_name(obj_controller.selecting_planet, target)}|"; } else { - delete_features(target.p_feature[obj_controller.selecting_planet], P_features.Recruiting_World); + delete_features(target.p_feature[obj_controller.selecting_planet], P_features.RecruitingWorld); obj_controller.recruiting_worlds=string_replace(obj_controller.recruiting_worlds,string(target.name)+" "+scr_roman(obj_controller.selecting_planet)+"|",""); } }; @@ -89,7 +89,7 @@ recruitment_type_button.update({ target : target, }); recruitment_type_button.bind_method = function(){ - var _recruit_world = p_data.get_features(P_features.Recruiting_World)[0]; + var _recruit_world = p_data.get_features(P_features.RecruitingWorld)[0]; if (_recruit_world.recruit_type < 1) { _recruit_world.recruit_type++ } else { @@ -104,7 +104,7 @@ recruitment_costdown_button.update({ target : target, }); recruitment_costdown_button.bind_method = function(){ - var _recruit_world = p_data.get_features(P_features.Recruiting_World)[0]; + var _recruit_world = p_data.get_features(P_features.RecruitingWorld)[0]; _recruit_world.recruit_cost-- }; @@ -115,7 +115,7 @@ recruitment_costup_button.update({ target : target, }); recruitment_costup_button.bind_method = function(){ - var _recruit_world = p_data.get_features(P_features.Recruiting_World)[0]; + var _recruit_world = p_data.get_features(P_features.RecruitingWorld)[0]; _recruit_world.recruit_cost++ }; diff --git a/objects/obj_star_select/Draw_64.gml b/objects/obj_star_select/Draw_64.gml index 0ee09b3011..092bb0e3e4 100644 --- a/objects/obj_star_select/Draw_64.gml +++ b/objects/obj_star_select/Draw_64.gml @@ -22,8 +22,8 @@ if (loading=1){ xx=xx; yy=yy; } else if (loading==1){ - var temp1, dist; - dist=999; + var temp1, target_distance; + target_distance=999; obj_controller.selecting_planet=0; button1=""; @@ -210,11 +210,11 @@ if (obj_controller.selecting_planet!=0){ chock = !p_data.xenos_and_heretics(); if (chock==1){ - if (p_data.has_upgrade(P_features.Secret_Base)){ + if (p_data.has_upgrade(P_features.SecretBase)){ button1="Base"; }else if (p_data.has_upgrade(P_features.Arsenal)){ button1="Arsenal"; - }else if (p_data.has_upgrade(P_features.Gene_Vault)){ + }else if (p_data.has_upgrade(P_features.GeneVault)){ button1="Gene-Vault"; }else if (array_length(p_data.upgrades)==0){ button1="Build"; @@ -230,7 +230,7 @@ if (obj_controller.selecting_planet!=0){ } if (obj_controller.recruiting_worlds_bought>0 && !p_data.at_war()){ - if (!p_data.has_feature(P_features.Recruiting_World) && p_data.planet_type != "Dead" && !target.space_hulk){ + if (!p_data.has_feature(P_features.RecruitingWorld) && p_data.planet_type != "Dead" && !target.space_hulk){ button4="+Recruiting"; } } @@ -251,7 +251,12 @@ if (obj_controller.selecting_planet!=0){ var slate_draw_scale = 420/850; if (feature!=""){ if (is_struct(feature)){ - feature.draw_planet_features(344+main_data_slate.width-4,165) + try{ + feature.draw_planet_features(344+main_data_slate.width-4,165); + } catch(_exception){ + handle_exception(_exception); + feature = ""; + } if (feature.remove){ feature=""; }else if (feature.destroy){ @@ -324,8 +329,8 @@ if (obj_controller.selecting_planet!=0){ allow_click : true, }); recruiting_button.draw(); - if (p_data.has_feature(P_features.Recruiting_World)) { - var _recruit_world = p_data.get_features(P_features.Recruiting_World)[0]; + if (p_data.has_feature(P_features.RecruitingWorld)) { + var _recruit_world = p_data.get_features(P_features.RecruitingWorld)[0]; if (_recruit_world.recruit_type == 0) && (obj_controller.faction_status[p_data.current_owner] != "War" && obj_controller.faction_status[p_data.current_owner] != "Antagonism" || p_data.player_disposition >= 50) { draw_text(xx+(spacing_x*3)+35, half_way-20, "Open: Voluntery"); } else if (_recruit_world.recruit_type == 0 && p_data.player_disposition <= 50) { @@ -381,9 +386,9 @@ if (obj_controller.selecting_planet!=0){ var building=instance_create(x,y,obj_temp_build); building.target=target; building.planet=obj_controller.selecting_planet; - if (p_data.has_upgrade(P_features.Secret_Base)) then building.lair=1; + if (p_data.has_upgrade(P_features.SecretBase)) then building.lair=1; if (p_data.has_upgrade(P_features.Arsenal)) then building.arsenal=1; - if (p_data.has_upgrade(P_features.Gene_Vault)) then building.gene_vault=1; + if (p_data.has_upgrade(P_features.GeneVault)) then building.gene_vault=1; obj_controller.temp[104]=string(scr_master_loc()); obj_controller.menu=60; with(obj_star_select){ @@ -444,11 +449,11 @@ if (obj_controller.selecting_planet!=0){ } }else if (current_button=="+Recruiting"){ if (obj_controller.recruiting_worlds_bought > 0 && p_data.current_owner <= 5 && !p_data.at_war()) { - if (!p_data.has_feature(P_features.Recruiting_World)) { + if (!p_data.has_feature(P_features.RecruitingWorld)) { if (obj_controller.faction_status[eFACTION.Imperium] == "War") { obj_controller.recruiting_worlds_bought -= 1; } - array_push(target.p_feature[obj_controller.selecting_planet], new NewPlanetFeature(P_features.Recruiting_World)); + array_push(target.p_feature[obj_controller.selecting_planet], new PlanetFeature(P_features.RecruitingWorld)); if (obj_controller.selecting_planet) { obj_controller.recruiting_worlds += planet_numeral_name(obj_controller.selecting_planet, target); @@ -502,17 +507,37 @@ if (target!=0){ // x3=46;y3=252; x3=49;y3=441; - repeat(7){i+=1; - if (en_fleet[i]>0){ + var _combating = 0; + for (var i=0;i1){ // draw_sprite_ext(spr_force_icon,en_fleet[i],x3,y3,0.5,0.5,0,c_white,1); scr_image("ui/force",en_fleet[i],x3-16,y3-16,32,32); + //draw_rectangle_array() + if (point_and_click([x3-24, y3-24, x3+48, y3+48])){ + _combating=en_fleet[i]; + show_debug_message("battle ") + } x3+=64; } } - + if (_combating>0){ + setup_fleet_battle(_combating, target); + fleet_start = 0; + } + } +} + + +if (instance_exists(obj_fleet)){ + fleet_start++; + if (fleet_start == 500){ + start_fleet_battle(); } } +draw_planet_debug_options(); + + pop_draw_return_values(); diff --git a/objects/obj_star_select/Mouse_50.gml b/objects/obj_star_select/Mouse_50.gml index c015c64398..874d0157f1 100644 --- a/objects/obj_star_select/Mouse_50.gml +++ b/objects/obj_star_select/Mouse_50.gml @@ -15,10 +15,10 @@ draw_set_color(0); if (obj_controller.menu=60) then exit; -var xx, yy, dist, close; +var xx, yy, target_distance, close; xx=__view_get( e__VW.XView, 0 )+0; yy=__view_get( e__VW.YView, 0 )+0; -dist=999;close=false; +target_distance=999;close=false; @@ -69,165 +69,6 @@ if (obj_controller.cooldown<=0) and (loading==1){ attack=0;bombard=0;raid=0;purge=0; -if (player_fleet>0) and (imperial_fleet+mechanicus_fleet+inquisitor_fleet+eldar_fleet+ork_fleet+tau_fleet+heretic_fleet>0) and (obj_controller.cooldown<=0){ - var i,x3,y3;i=0; - // x3=xx+46;y3=yy+252; - x3=xx+49;y3=yy+441; - - var combating=0; - - repeat(7){i+=1; - if (en_fleet[i]>0) and (mouse_x>=x3-24) and (mouse_y>=y3-24) and (mouse_x0){ - obj_controller.combat=combating; - - var xx=false, yy=false, good=false, e1=false,e2=false,e3=false; - - - var enemy_fleet = array_create(20, 0); - var allied_fleet = array_create(20, 0); - var ecap = array_create(20, 0); - var efri = array_create(20, 0); - var eesc = array_create(20, 0); - var acap = array_create(20, 0); - var afri = array_create(20, 0); - var aesc = array_create(20, 0); - - good=1; - - var p_fleet = get_nearest_player_fleet(x,y,true); - - obj_controller.temp[1099]=target.name; - good = (p_fleet!="none" and instance_exists(target)); - - if (good=1){// trying to find the star - instance_activate_object(obj_star); - obj_controller.x=target.x; - obj_controller.y=target.y;// show=current_battle; - - strin[1]=string(p_fleet.capital_number); - strin[2]=string(p_fleet.frigate_number); - strin[3]=string(p_fleet.escort_number); - // pull health values here - strin[4]=string(p_fleet.capital_health); - strin[5]=string(p_fleet.frigate_health); - strin[6]=string(p_fleet.escort_health); - - // pull enemy ships here - - var e=1; - var khorne_count=0; - var chaos_space_marine_count=0; - var en_capitals, en_frigates, en_escorts; - repeat(9){e+=1; - if (target.present_fleet[e]>0){ - obj_controller.temp[1070]=target.id; - obj_controller.temp[1071]=e; - en_capitals=0; - en_frigates=0; - en_escorts=0; - - with(obj_en_fleet){ - if (orbiting=obj_controller.temp[1070]) and (owner=obj_controller.temp[1071]){ - en_capitals+=capital_number; - en_frigates+=frigate_number; - en_escorts+=escort_number; - if (fleet_has_cargo("warband")) then khorne_count++; - if (fleet_has_cargo("csm")){ - chaos_space_marine_count++; - } - } - } - - var l1,l2;l1=0;l2=0; - if (obj_controller.faction_status[e]!="War") and (e!=combating){ - repeat(10){ - l1+=1; - if (allied_fleet[l1]=0) and (l2=0) then l2=l1; - } - allied_fleet[l2]=e; - acap[l2]=en_capitals; - afri[l2]=en_frigates; - aesc[l2]=en_escorts; - }else if (obj_controller.faction_status[e]="War") or (e=9) or (e=combating){ - repeat(10){ - l1+=1; - if (enemy_fleet[l1]=0) and (l2=0) then l2=l1; - } - enemy_fleet[l2]=e; - ecap[l2]=en_capitals; - efri[l2]=en_frigates; - eesc[l2]=en_escorts; - } - } - } - - - obj_controller.cooldown=8000; - - // Start battle here - - combating=1; - - instance_deactivate_all(true); - instance_activate_object(obj_controller); - instance_activate_object(obj_ini); - // instance_activate_object(battle_object[current_battle]); - instance_activate_object(p_fleet); - instance_activate_object(obj_star); - - instance_create(0,0,obj_fleet); - obj_fleet.star_name=target.name; - // - obj_fleet.enemy[1]=enemy_fleet[1]; - obj_fleet.enemy_status[1]=-1; - - obj_fleet.en_capital[1]=ecap[1]; - obj_fleet.en_frigate[1]=efri[1]; - obj_fleet.en_escort[1]=eesc[1]; - - // Plug in all of the enemies first - // And then plug in the allies after then with their status set to positive - - if (chaos_space_marine_count){ - obj_fleet.csm_exp=1; - } - if (khorne_count){ - obj_fleet.csm_exp=2; - } - - - for (var i=0;i=2){ - if (battle[i]!=0) and (battle[i-1]!=0) and (battle_world[i]=-50) and (battle_world[i-1]>0){ - var tem1, tem2, tem3, tem4, tem5, tem6, tem7; - tem1=battle[i-1]; - tem2=battle_location[i-1]; - tem3=battle_world[i-1]; - tem4=battle_opponent[i-1]; - tem5=battle_object[i-1]; - tem6=battle_pobject[i-1]; - tem7=battle_special[i-1]; - - battle[i-1]=battle[i]; - battle_location[i-1]=battle_location[i]; - battle_world[i-1]=battle_world[i]; - battle_opponent[i-1]=battle_opponent[i]; - // battle_object[i-1]=battle_object[i]; - battle_pobject[i-1]=battle_pobject[i]; - battle_special[i-1]=battle_special[i]; - - battle[i]=tem1; - battle_location[i]=tem2; - battle_world[i]=tem3; - battle_opponent[i]=tem4; - battle_object[i]=tem5; - battle_pobject[i]=tem6; - battle_special[i]=tem7; - } - } -} - - - -// Probably want something right here to organize the battle just in case -// Space battles first -// Ground battles after - - - - -if (battles>0) and (current_battle<=battles){ - var ii, xx, yy, good; - ii=0; - good=0; - - var battle_star = star_by_name(battle_location[current_battle]); - - if (battle_star!="none"){// trying to find the star - obj_controller.x=battle_star.x; - obj_controller.y=battle_star.y; - show=current_battle; - - if (battle_world[current_battle]=-50){ - strin[1]=string(round(battle_pobject[current_battle].capital_number)); - strin[2]=string(round(battle_pobject[current_battle].frigate_number)); - strin[3]=string(round(battle_pobject[current_battle].escort_number)); - // pull health values here - strin[4]=string(round(battle_pobject[current_battle].capital_health)); - strin[5]=string(round(battle_pobject[current_battle].frigate_health)); - strin[6]=string(round(battle_pobject[current_battle].escort_health)); - - // pull enemy ships here - - var e=1; - repeat(10){ - e+=1; - if (e=11) then e=13; - if (battle_star.present_fleet[e]>0){ - obj_controller.temp[1070]=battle_star.id; - obj_controller.temp[1071]=e; - obj_controller.temp[1072]=0; - obj_controller.temp[1073]=0; - obj_controller.temp[1074]=0; - - with(obj_en_fleet){ - if (orbiting=obj_controller.temp[1070]) and (owner=obj_controller.temp[1071]){ - obj_controller.temp[1072]+=round(capital_number); - obj_controller.temp[1073]+=round(frigate_number); - obj_controller.temp[1074]+=round(escort_number); - } - } - - var l1,l2;l1=0;l2=0; - if (obj_controller.faction_status[e]!="War"){ - repeat(10){l1+=1;if (allied_fleet[l1]=0) and (l2=0) then l2=l1;} - allied_fleet[l2]=e; - acap[l2]=obj_controller.temp[1072]; - afri[l2]=obj_controller.temp[1073]; - aesc[l2]=obj_controller.temp[1074]; - } - if (obj_controller.faction_status[e]="War") or (e=9) or (e=13){ - repeat(10){l1+=1;if (enemy_fleet[l1]=0) and (l2=0) then l2=l1;} - enemy_fleet[l2]=e; - ecap[l2]=obj_controller.temp[1072]; - efri[l2]=obj_controller.temp[1073]; - eesc[l2]=obj_controller.temp[1074]; - } - } - } - - } - - if (battle_world[current_battle]>=1){ - scr_count_forces(string(battle_location[current_battle]),battle_world[current_battle],true); - - strin[1]=info_mahreens; - strin[2]=info_vehicles; - - if (info_mahreens+info_vehicles=0){ - if (battles>current_battle) then alarm[4]=1; - if (battles=current_battle) then alarm[1]=1; - } - - strin[3]=""; - - var tempy=0; - tempy=battle_object[current_battle].p_owner[battle_world[current_battle]]; - - if (tempy=1) or (tempy=2) or (tempy=3){ - var array_string = ["","Minimally","Lightly","Moderately","Highly","Extremely","Maximally"]; - var battle_fortification = battle_object[current_battle].p_fortified[battle_world[current_battle]]; - strin[3] = array_string[clamp(battle_fortification, 1, 6)]; - } - - tempy=0; - if (battle_opponent[current_battle]=7) then tempy=battle_object[current_battle].p_orks[battle_world[current_battle]]; - if (battle_opponent[current_battle]=8) then tempy=battle_object[current_battle].p_tau[battle_world[current_battle]]; - if (battle_opponent[current_battle]=9) then tempy=battle_object[current_battle].p_tyranids[battle_world[current_battle]]; - if (battle_opponent[current_battle]=10) then tempy=battle_object[current_battle].p_traitors[battle_world[current_battle]]; - if (battle_opponent[current_battle]=13) then tempy=battle_object[current_battle].p_necrons[battle_world[current_battle]]; - - if (tempy=1) then strin[4]="Minimal Forces"; - if (tempy=2) then strin[4]="Sparse Forces"; - if (tempy=3) then strin[4]="Moderate Forces"; - if (tempy=4) then strin[4]="Numerous Forces"; - if (tempy=5) then strin[4]="Very Numerous"; - if (tempy=6) then strin[4]="Overwhelming"; - - // if (battle_opponent[current_battle]=2) then obj_controller.alarm[7]=1; - obj_controller.cooldown=9999; - } - - if (obj_controller.zoomed=1) then with(obj_controller){scr_zoom();} - } - instance_activate_object(obj_star); - -} - -instance_activate_object(obj_star); - - - - -if (battle[1]=0) or (current_battle>battles){// This is temporary for the sake of testing - if (battle[1]=0){ - obj_controller.x=first_x; - obj_controller.y=first_y; - } - alarm[1]=1; -} - -/* */ -/* */ -}); diff --git a/objects/obj_turn_end/Alarm_4.gml b/objects/obj_turn_end/Alarm_4.gml deleted file mode 100644 index 939fd4a72e..0000000000 --- a/objects/obj_turn_end/Alarm_4.gml +++ /dev/null @@ -1,100 +0,0 @@ - -var battle_o;battle_o=0; -current_battle+=1; -combating=0; - -instance_activate_object(obj_star); - -if (battles>0) and (current_battle<=battles){ - - var ii=0,good=0; - var battle_star = star_by_name(battle_location[current_battle]); - obj_controller.temp[1060]=battle_location[current_battle]; - - if (battle_star!="none"){ - obj_controller.x=battle_star.x; - obj_controller.y=battle_star.y; - show=current_battle; - - if (battle_world[current_battle]=-50){ - strin[1]=string(battle_pobject[current_battle].capital_number); - strin[2]=string(battle_pobject[current_battle].frigate_number); - strin[3]=string(battle_pobject[current_battle].escort_number); - // pull health values here - strin[4]=string(battle_pobject[current_battle].capital_health); - strin[5]=string(battle_pobject[current_battle].frigate_health); - strin[6]=string(battle_pobject[current_battle].escort_health); - - // Here - strin[7]=string(battle_object[current_battle].capital_number); - strin[8]=string(battle_object[current_battle].frigate_number); - strin[9]=string(battle_object[current_battle].escort_number); - // pull health values here - strin[10]="100"; - strin[11]="100"; - strin[12]="100"; - } - - - - if (battle_world[current_battle]>=1){ - - scr_count_forces(string(battle_location[current_battle]),battle_world[current_battle],true); - - strin[1]=info_mahreens; - strin[2]=info_vehicles; - - if (info_mahreens+info_vehicles=0){ - if (battles>current_battle) then alarm[4]=1; - if (battles=current_battle) then alarm[1]=1; - } - - strin[3]=""; - - var tempy;tempy=0; - tempy=battle_object[current_battle].p_owner[battle_world[current_battle]]; - - if (tempy=1) or (tempy=2) or (tempy=3){ - if (battle_object[current_battle].p_fortified[battle_world[current_battle]]=1) then strin[3]="Minimally"; - if (battle_object[current_battle].p_fortified[battle_world[current_battle]]=2) then strin[3]="Lightly"; - if (battle_object[current_battle].p_fortified[battle_world[current_battle]]=3) then strin[3]="Moderately"; - if (battle_object[current_battle].p_fortified[battle_world[current_battle]]=4) then strin[3]="Highly"; - if (battle_object[current_battle].p_fortified[battle_world[current_battle]]=5) then strin[3]="Extremely"; - if (battle_object[current_battle].p_fortified[battle_world[current_battle]]=6) then strin[3]="Maximally"; - } - - tempy=0; - if (battle_opponent[current_battle]=7) then tempy=battle_object[current_battle].p_orks[battle_world[current_battle]]; - if (battle_opponent[current_battle]=8) then tempy=battle_object[current_battle].p_tau[battle_world[current_battle]]; - if (battle_opponent[current_battle]=9) then tempy=battle_object[current_battle].p_tyranids[battle_world[current_battle]]; - if (battle_opponent[current_battle]=10) then tempy=battle_object[current_battle].p_traitors[battle_world[current_battle]]; - if (battle_opponent[current_battle]=30){tempy=1;strin[4]="Master Spyrer";} - - if (battle_opponent[current_battle]<=20){ - if (tempy=1) then strin[4]="Minimal Forces"; - if (tempy=2) then strin[4]="Sparse Forces"; - if (tempy=3) then strin[4]="Moderate Forces"; - if (tempy=4) then strin[4]="Numerous Forces"; - if (tempy=5) then strin[4]="Very Numerous"; - if (tempy=6) then strin[4]="Overwhelming"; - } - } - - if (obj_controller.zoomed=1) then with(obj_controller){scr_zoom();} - } - instance_activate_object(obj_star); - -} - -instance_activate_object(obj_star); - - - - - - -if (battle[1]=0) or (current_battle>battles){// This is temporary for the sake of testing - if (battle[1]=0){obj_controller.x=first_x;obj_controller.y=first_y;} - alarm[1]=1; -} - diff --git a/objects/obj_turn_end/Create_0.gml b/objects/obj_turn_end/Create_0.gml index 77a0406cb6..d37b8965e6 100644 --- a/objects/obj_turn_end/Create_0.gml +++ b/objects/obj_turn_end/Create_0.gml @@ -14,8 +14,8 @@ alerts=0; fadeout=0; popups_end=0; -current_battle=1; -current_popup=0; +current_battle=-1; +current_popup=-1; fast=0;// This is increased, once the alert[i]=1 and >=fast then it begins to fade in and get letters info_mahreens=0; @@ -26,40 +26,42 @@ first_y=obj_controller.y; combating=0; cooldown=10; +main_slate = new DataSlate(); obj_controller.menu=999;// show nothing, click nothing -i=-1;repeat(11){i+=1;enemy_fleet[i]=0;allied_fleet[i]=0;ecap[i]=0;efri[i]=0;eesc[i]=0;acap[i]=0;afri[i]=0;aesc[i]=0;} - -i=-1; -repeat(91){ - i+=1; - - popup[i]=0; - popup_type[i]=""; - popup_text[i]=""; - popup_image[i]=""; - popup_special[i]=""; - - alert[i]=0; - alert_type[i]=""; - alert_text[i]=""; - - alert_char[i]=0; - alert_alpha[i]=0; - alert_txt[i]=""; - alert_color[i]=""; +enemy_fleet = array_create(11, 0); +allied_fleet = array_create(11, 0); +ecap = array_create(11, 0); +efri = array_create(11, 0); +eesc = array_create(11, 0); +acap = array_create(11, 0); +afri = array_create(11, 0); +aesc = array_create(11, 0); + + +popup = []; +popup_type = []; +popup_text = []; +popup_image = []; +popup_special = []; + +alert = []; +alert_type = []; +alert_text = []; + +alert_char = []; +alert_alpha = []; +alert_txt = []; +alert_color = []; + +battle = [];// Set to 0 for none, 1 for battle to do, and 2 for resolved +battle_location = []; +battle_world = [];// Be like -50 for space battle +battle_opponent = [];// faction ID +battle_object = [];// faction object for the fleets + +battle = []; - battle[i]=0;// Set to 0 for none, 1 for battle to do, and 2 for resolved - battle_location[i]=""; - battle_world[i]=0;// Be like -50 for space battle - battle_opponent[i]=0;// faction ID - battle_object[i]=0;// faction object for the fleets - battle_pobject[i]=0;// player object for the fleets - battle_special[i]=""; - - - if (i<16) then strin[i]=""; -} audiences = 0; audience = 0; @@ -69,7 +71,7 @@ alert_alpha[1]=0.2; alert_char[1]=1; i=-1 -handle_discovered_governor_assasinations() +handle_discovered_governor_assasinations(); if (audiences>0){// This is a one-off change all messages to declare war @@ -77,7 +79,7 @@ if (audiences>0){// This is a one-off change all messages to declare war var war; repeat(15){ i+=1; - war[i]=0; + war = []; } for (var i=0;i0){// This is a one-off change all messages to declare war alerts=0; fast=0; -show=0; +show=-1; /* */ diff --git a/objects/obj_turn_end/Draw_0.gml b/objects/obj_turn_end/Draw_0.gml index fe52d5d5c0..f1f2b555ed 100644 --- a/objects/obj_turn_end/Draw_0.gml +++ b/objects/obj_turn_end/Draw_0.gml @@ -12,284 +12,3 @@ if (obj_controller.audience>0) then exit; if (show=0) and (obj_controller.zoomed=0) and (current_popup=0) then draw_sprite(spr_loading,image_index,__view_get( e__VW.XView, 0 )+23,__view_get( e__VW.YView, 0 )+73); if (show=0) and (obj_controller.zoomed=1) and (current_popup=0) then draw_sprite_ext(spr_loading,image_index,40,40,2,2,0,c_white,1); - - -if (show>0) and (current_battle<=battles){ - var xxx,yyy,i; - xxx=__view_get( e__VW.XView, 0 )+535; - yyy=__view_get( e__VW.YView, 0 )+200; - i=current_battle; - - draw_sprite(spr_purge_panel,0,xxx,yyy); - // if (battle_world[i]=-50) then draw_sprite(spr_attacked,1,xxx+12,yyy+54); - // if (battle_world[i]>0) then draw_sprite(spr_attacked,0,xxx+12,yyy+54); - if (battle_world[i]=-50) then scr_image("attacked",1,xxx+12,yyy+54,254,174); - if (battle_world[i]>0) then scr_image("attacked",0,xxx+12,yyy+54,254,174); - - draw_set_font(fnt_40k_14);draw_set_halign(fa_left);draw_set_color(c_gray); - draw_text(xxx+8,yyy+13,string_hash_to_newline(string(i)+"/"+string(battles))); - - draw_set_halign(fa_center); - draw_set_font(fnt_40k_30b); - - if (battle_world[i]>0) then draw_text_transformed(xxx+265,yyy+11,string_hash_to_newline("Forces Attacked! ("+string(battle_location[i])+" "+scr_roman(battle_world[i])+")"),0.7,0.7,0); - if (battle_world[i]=-50) then draw_text_transformed(xxx+265,yyy+11,string_hash_to_newline("Fleet Attacked! ("+string(battle_location[i])+" System)"),0.7,0.7,0); - - scr_image("ui/force",1,xxx+378-32,yyy+86-32,64,64); - // draw_sprite(spr_force_icon,1,xxx+378,yyy+86); - - draw_set_font(fnt_40k_14);draw_set_halign(fa_left); - - - - if (battle_world[i]<0){ - draw_set_font(fnt_40k_14b); - draw_set_halign(fa_left); - - draw_text(xxx+12,yyy+237,string_hash_to_newline("Enemy Fleets:")); - draw_text(xxx+332,yyy+237,string_hash_to_newline("Allied Fleets:")); - - if (string(strin[1])="1") then draw_text(xxx+310,yyy+118,string_hash_to_newline(string(strin[1])+" Battleship ("+string(strin[4])+"% HP)")); - if (string(strin[2])="1") then draw_text(xxx+310,yyy+138,string_hash_to_newline(string(strin[2])+" Frigate ("+string(strin[5])+"% HP)")); - if (string(strin[3])="1") then draw_text(xxx+310,yyy+158,string_hash_to_newline(string(strin[3])+" Escort ("+string(strin[6])+"% HP)")); - if (string(strin[1])!="1") then draw_text(xxx+310,yyy+118,string_hash_to_newline(string(strin[1])+" Battleships ("+string(strin[4])+"% HP)")); - if (string(strin[2])!="1") then draw_text(xxx+310,yyy+138,string_hash_to_newline(string(strin[2])+" Frigates ("+string(strin[5])+"% HP)")); - if (string(strin[3])!="1") then draw_text(xxx+310,yyy+158,string_hash_to_newline(string(strin[3])+" Escorts ("+string(strin[6])+"% HP)")); - - - draw_set_halign(fa_center); - - if (enemy_fleet[1]!=0){ - // draw_sprite(spr_force_icon,enemy_fleet[1],xxx+44,yyy+269); - scr_image("ui/force",enemy_fleet[1],xxx+44-32,yyy+269-32,64,64); - var shw;shw=""; - if (ecap[1]=1) then shw+=string(ecap[1])+" Battleship#"; - if (ecap[1]!=1) then shw+=string(ecap[1])+" Battleships#"; - if (efri[1]=1) then shw+=string(efri[1])+" Frigate#"; - if (efri[1]!=1) then shw+=string(efri[1])+" Frigates#"; - if (eesc[1]=1) then shw+=string(eesc[1])+" Escort#"; - if (eesc[1]!=1) then shw+=string(eesc[1])+" Escorts#"; - - draw_text_transformed(xxx+44,yyy+286,string_hash_to_newline(string(shw)),0.7,1,0); - draw_set_halign(fa_center);draw_set_font(fnt_40k_14b); - } - if (enemy_fleet[2]!=0){ - // draw_sprite(spr_force_icon,enemy_fleet[2],xxx+154,yyy+269); - scr_image("ui/force",enemy_fleet[2],xxx+154-32,yyy+269-32,64,64); - var shw;shw=""; - if (ecap[2]=1) then shw+=string(ecap[2])+" Battleship#"; - if (ecap[2]!=1) then shw+=string(ecap[2])+" Battleships#"; - if (efri[2]=1) then shw+=string(efri[2])+" Frigate#"; - if (efri[2]!=1) then shw+=string(efri[2])+" Frigates#"; - if (eesc[2]=1) then shw+=string(eesc[2])+" Escort#"; - if (eesc[2]!=1) then shw+=string(eesc[2])+" Escorts#"; - - draw_text_transformed(xxx+154,yyy+286,string_hash_to_newline(string(shw)),0.7,1,0); - draw_set_halign(fa_center);draw_set_font(fnt_40k_14b); - } - if (enemy_fleet[3]!=0){ - // draw_sprite(spr_force_icon,enemy_fleet[3],xxx+264,yyy+269); - scr_image("ui/force",enemy_fleet[3],xxx+264-32,yyy+269-32,64,64); - var shw;shw=""; - if (ecap[3]=1) then shw+=string(ecap[3])+" Battleship#"; - if (ecap[3]!=1) then shw+=string(ecap[3])+" Battleships#"; - if (efri[3]=1) then shw+=string(efri[3])+" Frigate#"; - if (efri[3]!=1) then shw+=string(efri[3])+" Frigates#"; - if (eesc[3]=1) then shw+=string(eesc[3])+" Escort#"; - if (eesc[3]!=1) then shw+=string(eesc[3])+" Escorts#"; - - draw_text_transformed(xxx+264,yyy+286,string_hash_to_newline(string(shw)),0.7,1,0); - draw_set_halign(fa_center);draw_set_font(fnt_40k_14b); - } - - if (allied_fleet[1]!=0){ - // draw_sprite(spr_force_icon,allied_fleet[1],xxx+374,yyy+269); - scr_image("ui/force",allied_fleet[1],xxx+374-32,yyy+269-32,64,64); - var shw;shw=""; - if (acap[1]=1) then shw+=string(acap[1])+" Battleship#"; - if (acap[1]!=1) then shw+=string(acap[1])+" Battleships#"; - if (afri[1]=1) then shw+=string(afri[1])+" Frigate#"; - if (afri[1]!=1) then shw+=string(afri[1])+" Frigates#"; - if (aesc[1]=1) then shw+=string(aesc[1])+" Escort#"; - if (aesc[1]!=1) then shw+=string(aesc[1])+" Escorts#"; - - draw_text_transformed(xxx+374,yyy+286,string_hash_to_newline(string(shw)),0.7,1,0); - draw_set_halign(fa_center);draw_set_font(fnt_40k_14b); - } - if (allied_fleet[2]!=0){ - // draw_sprite(spr_force_icon,allied_fleet[1],xxx+484,yyy+269); - scr_image("ui/force",allied_fleet[1],xxx+484-32,yyy+269-32,64,64); - var shw;shw=""; - if (acap[2]=1) then shw+=string(acap[2])+" Battleship#"; - if (acap[2]!=1) then shw+=string(acap[2])+" Battleships#"; - if (afri[2]=1) then shw+=string(afri[2])+" Frigate#"; - if (afri[2]!=1) then shw+=string(afri[2])+" Frigates#"; - if (aesc[2]=1) then shw+=string(aesc[2])+" Escort#"; - if (aesc[2]!=1) then shw+=string(aesc[2])+" Escorts#"; - - draw_text_transformed(xxx+484,yyy+286,string_hash_to_newline(string(shw)),0.7,1,0); - draw_set_halign(fa_center);draw_set_font(fnt_40k_14b); - } - - - - - - draw_set_color(c_gray);draw_rectangle(xxx+132,yyy+354,xxx+259,yyy+389,0); - draw_set_color(0);draw_text_transformed(xxx+195,yyy+362,string_hash_to_newline("Retreat"),1.1,1.1,0); - if (scr_hit(xxx+132,yyy+354,xxx+259,yyy+389)=true){ - draw_set_alpha(0.2);draw_rectangle(xxx+132,yyy+354,xxx+259,yyy+389,0);draw_set_alpha(1); - } - - draw_set_color(c_gray);draw_rectangle(xxx+272,yyy+354,xxx+399,yyy+389,0); - draw_set_color(0);draw_text_transformed(xxx+335,yyy+362,string_hash_to_newline("Fight"),1.1,1.1,0); - if (scr_hit(xxx+272,yyy+354,xxx+399,yyy+389)=true){ - draw_set_alpha(0.2);draw_rectangle(xxx+272,yyy+354,xxx+399,yyy+389,0);draw_set_alpha(1); - } - - } - - - if (battle_world[i]>=1){ - if (battle_opponent[i]<=20){ - draw_text(xxx+310,yyy+118,string_hash_to_newline(string(strin[1])+" Marines")); - draw_text(xxx+310,yyy+138,string_hash_to_newline(string(strin[2])+" Vehicles")); - if (strin[3]!="") then draw_text(xxx+310,yyy+158,string_hash_to_newline(string(strin[3])+" Fortified"));// Not / Barely / Lightly / Moderately / Highly / Maximally - } - - draw_set_font(fnt_40k_14b); - draw_set_halign(fa_left); - - draw_text(xxx+12,yyy+237,string_hash_to_newline("Enemy Factions:")); - draw_text(xxx+332,yyy+237,string_hash_to_newline("Allies:")); - - - - draw_set_halign(fa_center); - // draw_sprite(spr_force_icon,battle_opponent[i],xxx+44,yyy+289); - scr_image("ui/force",battle_opponent[i],xxx+44-32,yyy+289-32,64,64); - draw_text_transformed(xxx+44,yyy+316,string_hash_to_newline(string(strin[4])),0.75,1,0); - draw_set_halign(fa_center);draw_set_font(fnt_40k_14b); - - - draw_set_color(c_gray);draw_rectangle(xxx+132,yyy+354,xxx+259,yyy+389,0); - draw_set_color(0);draw_text_transformed(xxx+195,yyy+362,string_hash_to_newline("Offensive"),1.1,1.1,0); - if (scr_hit(xxx+132,yyy+354,xxx+259,yyy+389)=true){ - draw_set_alpha(0.2);draw_rectangle(xxx+132,yyy+354,xxx+259,yyy+389,0);draw_set_alpha(1); - } - - draw_set_color(c_gray);draw_rectangle(xxx+272,yyy+354,xxx+399,yyy+389,0); - draw_set_color(0);draw_text_transformed(xxx+335,yyy+362,string_hash_to_newline("Defensive"),1.1,1.1,0); - if (scr_hit(xxx+272,yyy+354,xxx+399,yyy+389)=true){ - draw_set_alpha(0.2);draw_rectangle(xxx+272,yyy+354,xxx+399,yyy+389,0);draw_set_alpha(1); - } - - - - - - } -} - - - - - - - -/* - -if (show>0) and (current_battle<=battles){ - var xxx,yyy,i; - xxx=view_xview[0]; - yyy=view_yview[0]; - i=current_battle; - - if (battle_world[i]>0) then draw_sprite(spr_attacked,0,xxx+90,yyy+101); - if (battle_world[i]=-50) then draw_sprite(spr_attacked,1,xxx+90,yyy+101); - - draw_set_font(fnt_info);draw_set_halign(fa_left);draw_set_color(CM_GREEN_COLOR); - draw_text(xxx+103,yyy+115,string(i)+"/"+string(battles)); - - draw_set_halign(fa_center); - draw_set_font(fnt_fancy); - - if (battle_world[i]>0) then draw_text_transformed(xxx+313,yyy+111,"Forces Attacked!",1.5,1.5,0); - if (battle_world[i]=-50) then draw_text_transformed(xxx+313,yyy+111,"Fleet Attacked!",1.5,1.5,0); - - if (battle_world[i]>0) then draw_text_transformed(xxx+313,yyy+144,"Planet "+string(battle_location[i])+" "+string(battle_world[i]),1,1,0); - if (battle_world[i]=-50) then draw_text_transformed(xxx+313,yyy+144,string(battle_location[i])+" System",1,1,0); - - draw_sprite(spr_force_icon,1,xxx+340,yyy+191); - if (battle_world[i]>0) then draw_sprite(spr_force_icon,battle_opponent[i],xxx+340,yyy+285); - draw_set_font(fnt_40k_14);draw_set_halign(fa_left); - - - - - if (battle_world[i]=-50){ - if (strin[1]!="0"){ - if (string(strin[1])="1") then draw_text(xxx+367,yyy+210,string(strin[1])+" Battleship ("+string(strin[4])+"% HP)"); - if (string(strin[1])!="1") then draw_text(xxx+367,yyy+210,string(strin[1])+" Battleships ("+string(strin[4])+"% HP)");} - - if (strin[2]!="0"){ - if (string(strin[2])="1") then draw_text(xxx+367,yyy+222,string(strin[2])+" Cruiser ("+string(strin[5])+"% HP)"); - if (string(strin[2])!="1") then draw_text(xxx+367,yyy+222,string(strin[2])+" Cruisers ("+string(strin[5])+"% HP)");} - - if (strin[3]!="0"){ - if (string(strin[3])="1") then draw_text(xxx+367,yyy+234,string(strin[3])+" Escort ("+string(strin[6])+"% HP)"); - if (string(strin[3])!="1") then draw_text(xxx+367,yyy+234,string(strin[3])+" Escorts ("+string(strin[6])+"% HP)");} - - - if (strin[7]!="0"){ - if (string(strin[7])="1") draw_text(xxx+367,yyy+302,string(strin[7])+" Battleship ("+string(strin[10])+"% HP)"); - if (string(strin[7])!="1") draw_text(xxx+367,yyy+302,string(strin[7])+" Battleships ("+string(strin[10])+"% HP)");} - - if (strin[8]!="0"){ - if (string(strin[8])="1") draw_text(xxx+367,yyy+314,string(strin[8])+" Cruiser ("+string(strin[11])+"% HP)"); - if (string(strin[8])!="1") draw_text(xxx+367,yyy+314,string(strin[8])+" Cruisers ("+string(strin[11])+"% HP)");} - - if (strin[9]!="0"){ - if (string(strin[9])="1") draw_text(xxx+367,yyy+326,string(strin[9])+" Escort ("+string(strin[12])+"% HP)"); - if (string(strin[9])!="1") draw_text(xxx+367,yyy+326,string(strin[9])+" Escorts ("+string(strin[12])+"% HP)");} - - draw_rectangle(xxx+188,yyy+350,xxx+297,yyy+372,1);draw_rectangle(xxx+328,yyy+350,xxx+437,yyy+372,1); - draw_set_alpha(0.5); - draw_rectangle(xxx+189,yyy+351,xxx+296,yyy+371,1);draw_rectangle(xxx+329,yyy+351,xxx+436,yyy+371,1); - draw_set_alpha(1); - - draw_set_halign(fa_center); - draw_text(xxx+241,yyy+353,"Fight");draw_text(xxx+383,yyy+353,"Retreat"); - draw_set_halign(fa_left); - } - - - if (battle_world[i]>=1){ - if (battle_opponent[i]<=20){ - draw_text(xxx+367,yyy+210,string(strin[1])+" Marines"); - draw_text(xxx+367,yyy+222,string(strin[2])+" Vehicles"); - if (strin[3]!="") then draw_text(xxx+367,yyy+234,string(strin[3])+" Fortified");// Not / Barely / Lightly / Moderately / Highly / Maximally - } - - draw_set_halign(fa_center); - draw_text(xxx+440,yyy+302,string(strin[4])); - - draw_rectangle(xxx+188,yyy+350,xxx+297,yyy+372,1);draw_rectangle(xxx+328,yyy+350,xxx+437,yyy+372,1); - draw_set_alpha(0.5); - draw_rectangle(xxx+189,yyy+351,xxx+296,yyy+371,1);draw_rectangle(xxx+329,yyy+351,xxx+436,yyy+371,1); - draw_set_alpha(1); - - draw_text(xxx+241,yyy+353,"Offensive");draw_text(xxx+383,yyy+353,"Defensive"); - draw_set_halign(fa_left); - } - - - - -}*/ - - -/* */ - -/* */ -/* */ diff --git a/objects/obj_turn_end/Draw_64.gml b/objects/obj_turn_end/Draw_64.gml index 15c5c40f25..fcd123fa22 100644 --- a/objects/obj_turn_end/Draw_64.gml +++ b/objects/obj_turn_end/Draw_64.gml @@ -2,7 +2,7 @@ // You can write your code in this editor - +add_draw_return_values(); var i=0; @@ -10,27 +10,25 @@ draw_set_font(fnt_40k_14b); draw_set_halign(fa_left); draw_set_color(CM_GREEN_COLOR); -if (alerts>0) and (popups_end=1){ - repeat(alerts){ - i+=1; - set_alert_draw_colour(alert_color[i]); - draw_set_alpha(min(1,alert_alpha[i])); - - if (obj_controller.zoomed=0){ - draw_text(32,+46+(i*20),string_hash_to_newline(string(alert_txt[i]))); - // draw_text(view_xview[0]+16.5,view_yview[0]+40.5+(i*12),string(alert_txt[i])); - } - /*if (obj_controller.zoomed=1){ - draw_text_transformed(80,80+(i*24),string(alert_txt[i]),2,2,0); - draw_text_transformed(81,81+(i*24),string(alert_txt[i]),2,2,0); - }*/ - - if (obj_controller.zoomed=1){ - draw_text_transformed(32,92+(i*40),string_hash_to_newline(string(alert_txt[i])),2,2,0); - // draw_text_transformed(122,122+(i*36),string(alert_txt[i]),3,3,0); - } +if (array_length(alert) && popups_end) { + for (var i=0;i-1 && current_battle-1){ + var _cur_battle = battle[current_battle]; + _cur_battle.draw(); +} +pop_draw_return_values(); diff --git a/objects/obj_turn_end/Mouse_56.gml b/objects/obj_turn_end/Mouse_56.gml deleted file mode 100644 index a2822f4842..0000000000 --- a/objects/obj_turn_end/Mouse_56.gml +++ /dev/null @@ -1,207 +0,0 @@ -var __b__; - -//so this only runs if there aren't these types of instances -__b__ = action_if_number(obj_saveload, 0, 0); -if __b__ -{ -__b__ = action_if_number(obj_popup, 0, 0); - if __b__ - { - __b__ = action_if_number(obj_ncombat, 0, 0); - if __b__ - { - __b__ = action_if_number(obj_fleet, 0, 0); - if __b__ - { - - if (obj_controller.complex_event=true) or (instance_exists(obj_temp_meeting)) then exit; - - - - var xxx,yyy; - xxx=__view_get( e__VW.XView, 0 )+535; - yyy=__view_get( e__VW.YView, 0 )+200; - - if (cooldown<=0) and (battle_world[current_battle]=-50) and (combating=0){ - if (mouse_x>=xxx+132) and (mouse_y>=yyy+354) and (mouse_x=xxx+272) and (mouse_y>=yyy+354) and (mouse_x0) and (combating=0){ - - var tip;tip=""; - - if (mouse_x>=xxx+132) and (mouse_y>=yyy+354) and (mouse_x=xxx+272) and (mouse_y>=yyy+354) and (mouse_x5){ - obj_ncombat.threat = _planet_data.planet_forces[_enemy]; - } - else if (_enemy=30){ - obj_ncombat.threat=1; - } - - // - _roster = new Roster(); - with (_roster){ - roster_location = _loc; - roster_planet = _planet; - determine_full_roster(); - only_locals(); - update_roster(); - if (array_length(selected_units)){ - setup_battle_formations(); - add_to_battle(); - } - } - delete _roster - instance_deactivate_object(battle_object[current_battle]); - } - } - } - } - } -} diff --git a/objects/obj_turn_end/Step_0.gml b/objects/obj_turn_end/Step_0.gml index 201e530948..53e9d42c0a 100644 --- a/objects/obj_turn_end/Step_0.gml +++ b/objects/obj_turn_end/Step_0.gml @@ -1,31 +1,4 @@ -var i; -i=0; - -if (cooldown>=0) then cooldown-=1; - -if (alerts>0) and (popups_end=1) and (fadeout=0){ - repeat(alerts){ - i+=1; - - if (fast>=i) and (string_length(alert_txt[i])=i) and (alert_alpha[i]<1) then alert_alpha[i]+=0.03; - } -} - - -if (fadeout=1){ - i=0; - repeat(alerts){ - i+=1;alert_alpha[i]-=0.05; - if (i=1) and (alert_alpha[1]<=0) then instance_destroy(); - } -} - - if (alarm[2]=2000) then instance_destroy(); diff --git a/objects/obj_turn_end/obj_turn_end.yy b/objects/obj_turn_end/obj_turn_end.yy index dd6d187e86..471e34017a 100644 --- a/objects/obj_turn_end/obj_turn_end.yy +++ b/objects/obj_turn_end/obj_turn_end.yy @@ -4,13 +4,11 @@ "eventList":[ {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":1,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":4,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":3,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":2,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":1,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":3,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":56,"eventType":6,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, ], diff --git a/scripts/__global_object_depths/__global_object_depths.gml b/scripts/__global_object_depths/__global_object_depths.gml index 288b2b6164..5a9abd60c6 100644 --- a/scripts/__global_object_depths/__global_object_depths.gml +++ b/scripts/__global_object_depths/__global_object_depths.gml @@ -8,7 +8,7 @@ function __global_object_depths() { // NOTE: MacroExpansion is used to insert the array initialisation at import time // insert the generated arrays here - global.__objectDepths[0] = -5000; // obj_fleet + global.__objectDepths[0] = -10000; // obj_fleet global.__objectDepths[1] = 0; // obj_circular global.__objectDepths[2] = -9999; // obj_fleet_spawner global.__objectDepths[3] = 8; // obj_fleet_controller diff --git a/scripts/macros/macros.gml b/scripts/macros/macros.gml index 2815195514..f87c998978 100644 --- a/scripts/macros/macros.gml +++ b/scripts/macros/macros.gml @@ -26,6 +26,13 @@ #macro ALLIANCE_GRADES ["Hated", "Hostile","Suspicious","Uneasy","Neutral","Allies","Close Allies","Battle Brothers"] +#macro AUTO_BATTLE_FORCES_GRADE ["None", "Minimal Forces", "Sparse Forces", "Moderate Forces", "Numerous Forces", "Very Numerous", "Overwhelming"] + +#macro FORTIFICATION_GRADES ["None", "Sparse","Light","Moderate","Heavy","Major","Extreme", "Maximum"] + +#macro FORTIFICATION_GRADES_DESCRIPTIONS ["None", "Minimally","Lightly","Moderately","Highly","Extremely","Maximally", "Maximum"] + + enum eFACTION { Player = 1, Imperium, diff --git a/scripts/scr_PlanetData/scr_PlanetData.gml b/scripts/scr_PlanetData/scr_PlanetData.gml index 96dc83e039..b621134fff 100644 --- a/scripts/scr_PlanetData/scr_PlanetData.gml +++ b/scripts/scr_PlanetData/scr_PlanetData.gml @@ -538,7 +538,7 @@ function PlanetData(planet, system) constructor{ } static add_feature = function(feature_type){ - var new_feature = new NewPlanetFeature(feature_type); + var new_feature = new PlanetFeature(feature_type); array_push(system.p_feature[planet], new_feature); return new_feature; } @@ -576,7 +576,7 @@ function PlanetData(planet, system) constructor{ static planet_training = function(local_screening_points) { var _training_happend = false; - if (has_feature(P_features.Recruiting_World)) { + if (has_feature(P_features.RecruitingWorld)) { if (obj_controller.gene_seed == 0 && obj_controller.recruiting > 0) { obj_controller.recruiting = 0; scr_alert("red", "recruiting", "The Chapter has run out of gene-seed!", 0, 0); @@ -709,7 +709,7 @@ function PlanetData(planet, system) constructor{ if (current_owner== eFACTION.Tau){ return false; } - if (has_feature(P_features.Gene_Stealer_Cult) && current_owner==eFACTION.Tyranids){ + if (has_feature(P_features.GeneStealerCult) && current_owner==eFACTION.Tyranids){ return false; } @@ -740,9 +740,11 @@ function PlanetData(planet, system) constructor{ // if (p_tyranids[planet]>0) and (guard_attack="") then guard_attack="tyranids"; if (planet_forces[eFACTION.Tyranids]>=4){ guard_attack="tyranids"; + }else if (planet_forces[eFACTION.Tyranids]>0){ - if (has_feature(P_features.Gene_Stealer_Cult)){ - var _hidden_cult = get_features(P_features.Gene_Stealer_Cult)[0].hiding; + if (has_feature(P_features.GeneStealerCult)){ + var _hidden_cult = get_features(P_features.GeneStealerCult)[0].hiding; + if (!_hidden_cult){ guard_attack="tyranids"; }else if (population_influences[eFACTION.Tyranids]>=50){ @@ -762,7 +764,7 @@ function PlanetData(planet, system) constructor{ static pdf_attack_matrix = function(){ var _no_notable_traitors = planet_forces[eFACTION.Heretics]<=1; var _pdf_attack = ""; - if (planet_forces[eFACTION.Tyranids]>=4 && !has_feature(P_features.Gene_Stealer_Cult)){ + if (planet_forces[eFACTION.Tyranids]>=4 && !has_feature(P_features.GeneStealerCult)){ _pdf_attack = "tyranids"; } @@ -780,7 +782,7 @@ function PlanetData(planet, system) constructor{ } } else if (current_owner == eFACTION.Tau){ _pdf_attack="guard"; - }else if (has_feature(P_features.Gene_Stealer_Cult) && population_influences[eFACTION.Tyranids]>=50){ + }else if (has_feature(P_features.GeneStealerCult) && population_influences[eFACTION.Tyranids]>=50){ _pdf_attack="guard"; } } @@ -888,8 +890,8 @@ function PlanetData(planet, system) constructor{ var bar_percent_length = (bar_width/100); var current_bar_percent = 0; var hidden_cult = false; - if (has_feature(P_features.Gene_Stealer_Cult)){ - hidden_cult = get_features(P_features.Gene_Stealer_Cult)[0].hiding; + if (has_feature(P_features.GeneStealerCult)){ + hidden_cult = get_features(P_features.GeneStealerCult)[0].hiding; } for (var i=1;i<13;i++){ @@ -993,7 +995,7 @@ function PlanetData(planet, system) constructor{ draw_set_alpha(1); draw_set_color(0); } - var forti_string = ["None", "Sparse","Light","Moderate","Heavy","Major","Extreme"]; + var forti_string = FORTIFICATION_GRADES; var planet_forti = $"Defenses: {forti_string[fortification_level]}"; draw_text(xx+480,yy+280,planet_forti); @@ -1080,7 +1082,7 @@ function PlanetData(planet, system) constructor{ for (i =0; i < feat_count ;i++){ cur_feature= features[i] if (cur_feature.planet_display != 0){ - if (cur_feature.f_type == P_features.Gene_Stealer_Cult){ + if (cur_feature.f_type == P_features.GeneStealerCult){ if (!cur_feature.hiding){ array_push(planet_displays, [cur_feature.planet_display, cur_feature]); } @@ -1102,7 +1104,7 @@ function PlanetData(planet, system) constructor{ if (upgrade_count>0){ for (i =0; i < upgrade_count ;i++){ var _upgrade = upgrades[i]; - if (_upgrade.f_type == P_features.Secret_Base){ + if (_upgrade.f_type == P_features.SecretBase){ if (_upgrade.forge>0){ var forge = _upgrade.forge_data; var size_string= $"{size[forge.size]} Chapter Forge" @@ -1218,9 +1220,9 @@ function PlanetData(planet, system) constructor{ if (population_influences[eFACTION.Tyranids] > 3){ var _max_influence_reduction = min(_pop_percentage_kill,population_influences[eFACTION.Tyranids]-3); adjust_influence(eFACTION.Tyranids,-_max_influence_reduction,planet,system); - if (has_feature(P_features.Gene_Stealer_Cult)){ + if (has_feature(P_features.GeneStealerCult)){ if (population_influences[eFACTION.Tyranids]<20){ - delete_feature(P_features.Gene_Stealer_Cult); + delete_feature(P_features.GeneStealerCult); } } } diff --git a/scripts/scr_ShipStruct/scr_ShipStruct.gml b/scripts/scr_ShipStruct/scr_ShipStruct.gml new file mode 100644 index 0000000000..717cee4d88 --- /dev/null +++ b/scripts/scr_ShipStruct/scr_ShipStruct.gml @@ -0,0 +1,341 @@ + +//general functions to help with dealing with ship data +function fetch_ship(id){ + return obj_ini.ship_data[id]; +} + +function get_ship_by_name(ship_name){ + for (var i=0;i= minimum_tech_requirements; + } + + static get_dock = function(){ + if (docked != false){ + var _dock = search_system_features_uid(star.p_feature,docked); + return _dock; + } + return false; + } + + + static dock_space = function(){ + if (location == "Warp" || location == "Lost"){ + possible_dock = false; + } else { + var star = star_by_name(location); + if (star == "none"){ + possible_dock = false; + } else { + var _dock = get_dock(); + if (is_struct(_dock)){ + return false; + } else { + docked = false; + } + _planet = system_feature_bool(star.p_feature,P_features.ShipDock); + if (_planet <= 0){ + possible_dock = false; + } else { + var _dock = return_planet_features(star.p_feature[_planet], P_features.ShipDock); + if (array_length(_dock)){ + _dock = _dock[0]; + if (_dock.has_dock_space(size)){ + possible_dock = _dock; + possible_dock.planet = _planet; + } else { + possible_dock = false; + } + } else { + possible_dock = false; + } + + } + } + } + return possible_dock; + } + + static update_ship_combat_data = function(){ + get_occupants(); + fetch_captain(); + calc_tech_fulfilment(false); + dock_space(); + } + + static find_array_pos = function(){ + for (var i=0;i= required; + } + + static calc_turn_speed = function(){ + var _final_speed = turning_speed; + if (obj_controller.stc_bonus[5]=3){ + _final_speed *= 1.05; + } + if (!minimum_tech){ + _final_speed *= 0.9; + } + return _final_speed; + } + + static add_weapon_to_slot = function(weapon_name,overide_data,slot){ + var _s_data = slot; + with (overide_data){ + move_data_to_current_scope(_s_data); + } + var _wep = new ShipWeapon(weapon_name, overide_data); + array_push(weapons, _wep); + slot.weapon = _wep; + } + + static draw_ui_manage = function(x, y){ + var _x_offset = sprite_get_xoffset(sprite_index); + var _y_offset = sprite_get_yoffset(sprite_index); + draw_sprite(sprite_index, 0, x+280, y+210); + var _draw_corner = [x+280 - _x_offset, y+210-_y_offset]; + var _l_length = array_length(left_broad_positions); + var _r_length = array_length(right_broad_positions); + var _f_length = array_length(forward_positions); + var iter = max(_l_length, _r_length, _f_length); + var draw_weapon_box = function(pos, corner){ + var coords = pos.ship_position; + var _box_size = pos.slot_size *3; + var draw_coords = [corner[0]+ coords[0]-_box_size, corner[1]+coords[1]-_box_size, corner[0]+coords[0]+_box_size, corner[1]+coords[1]+_box_size]; + if (scr_hit(draw_coords)){ + draw_set_colour(c_green); + var _re_equip_s = docked ? "\nclick to equip new weapon" : "\ndock ship to re-equip"; + tooltip_draw($"Emplacement direction : {pos.facing}\nEmplacement Size : {pos.slot_size}{_re_equip_s}"); + obj_controller.weapon_slate.weapon = pos.weapon; + obj_controller.weapon_slate.slot = pos; + if (docked && scr_click_left()){ + obj_controller.fleet_temps.weapon_equip = true; + obj_controller.fleet_temps.wep_change_slot = slot; + } + } else { + draw_set_colour(c_blue); + } + draw_rectangle_array(draw_coords,true); + } + if (possible_dock != false){ + var _dock_button = draw_unit_buttons([x+280 - (string_width("Dock Ship")/2), y+300], "Dock Ship"); + if (point_and_click(_dock_button)){ + docked = possible_dock.uid; + possible_dock.space_taken += size; + var _loc = location; + for (var i=0;i= array_length(obj_ini.ship_location)){ - obj_ini.artifact_sid[index] = 500 + array_length(obj_ini.ship_location) -1; + if (_index >= array_length(obj_ini.ship_data)){ + obj_ini.artifact_sid[index] = 500 + array_length(obj_ini.ship_data) -1; } return obj_ini.artifact_sid[index] - 500; }; @@ -325,7 +325,7 @@ function ArtifactStruct(Index) constructor { static location_string = function() { if (sid() >= 500) { - return obj_ini.ship[ship_id()]; + return obj_ini.ship_data[ship_id()].name; } else { return $"{loc()} {sid()}"; } @@ -337,10 +337,11 @@ function ArtifactStruct(Index) constructor { identifiable = 1; } if (sid() >= 500) { - if (obj_ini.ship_location[ship_id()] == obj_ini.home_name) { + var _ship = obj_ini.ship_data[ship_id()]; + if (_ship.location == obj_ini.home_name) { identifiable = 1; } - if (obj_ini.ship_class[ship_id()] == "Battle Barge") { + if (_ship.class == "Battle Barge") { identifiable = 1; } } @@ -425,7 +426,8 @@ function ArtifactStruct(Index) constructor { if (_ship_id > 0) { var demonSummonChance = roll_dice_chapter(1, 100, "high"); - if ((demonSummonChance <= 60) && (obj_ini.ship_carrying[_ship_id] > 0)) { + var _ship = obj_ini.ship_data[_ship_id]; + if (demonSummonChance <= 60 && _ship.carrying) { instance_create(0, 0, obj_ncombat); obj_ncombat.battle_special = "ship_demon"; obj_ncombat.formation_set = 1; @@ -487,7 +489,7 @@ function ArtifactStruct(Index) constructor { unit.update_mobility_item("", false, true); } bearer = false; - obj_ini.artifact_equipped[index] = false; + obj_ini.artifact_struct[index].equipped() = false; } else if (equipped()) { var _b_type = determine_base_type(); var _bearer = false; diff --git a/scripts/scr_add_corruption/scr_add_corruption.gml b/scripts/scr_add_corruption/scr_add_corruption.gml index fd70036c87..5e46356d1e 100644 --- a/scripts/scr_add_corruption/scr_add_corruption.gml +++ b/scripts/scr_add_corruption/scr_add_corruption.gml @@ -8,16 +8,15 @@ function scr_add_corruption(is_fleet, modifier_type) { var shi,m,co,ide, unit; shi=0;m=0;co=0;ide=0; ships = []; + if (is_fleet=true){ - for (var i=0;i0) then array_push(ships, capital_num[i]); - } - for (var i=0;i0) then array_push(ships, frigate_num[i]); - } - for (var i=0;i0) then array_push(ships, escort_num[c]); - } + var _ships = fleet_full_ship_array(); + for (var i=0;i=13) then obj_ini.god[target_company][good]=2;// Khorne!!!1 XDDDDDDD - if (missing = 1) and(man_role == obj_ini.role[100][12]) { - if (string_count("has joined the X Company", obj_turn_end.alert_text[obj_turn_end.alerts])) { + if (missing = 1) and (man_role == obj_ini.role[100][12]) { + if (instance_exists(obj_turn_end)) { scr_alert("red", $"recruiting", "Not enough {obj_ini.role[100][12]} equipment in the armoury!", 0, 0); } } diff --git a/scripts/scr_add_vehicle/scr_add_vehicle.gml b/scripts/scr_add_vehicle/scr_add_vehicle.gml index 63e3cf7d7d..7fdc9e65e6 100644 --- a/scripts/scr_add_vehicle/scr_add_vehicle.gml +++ b/scripts/scr_add_vehicle/scr_add_vehicle.gml @@ -22,7 +22,6 @@ function scr_add_vehicle(vehicle_type, target_company,otherdata={} ,weapon1 = "s if (good != 0) { obj_ini.veh_race[target_company][good] = 1; - if (!struct_exists(otherdata,"loc")){ if (obj_ini.fleet_type == ePlayerBase.home_world) { obj_ini.veh_loc[target_company][good] = obj_ini.home_name; @@ -32,25 +31,31 @@ function scr_add_vehicle(vehicle_type, target_company,otherdata={} ,weapon1 = "s if (obj_ini.fleet_type != ePlayerBase.home_world) { // Need a more elaborate ship_carrying += here for the different types of units - var first = -1, backup = -1, i = 0; - for (var i = 0; i < array_length(obj_ini.ship_class); i++) { - if ((obj_ini.ship_class[i] == "Battle Barge") && (first == -1) && (obj_ini.ship_capacity[i] > obj_ini.ship_carrying[i])) { + var first = -1, backup = -1, i = 0; + for (var i = 0; i < array_length(obj_ini.ship_data); i++) { + var _ship = obj_ini.ship_data[i]; + if (!_ship.has_space()){ + continue; + } + if ((_ship.class == "Battle Barge") && (first == -1)) { first = i; } - if ((obj_ini.ship_class[i] == "Strike Cruiser") && (backup == -1) && (obj_ini.ship_capacity[i] > obj_ini.ship_carrying[i])) { + if ((_ship.class == "Strike Cruiser") && (backup == -1)) { backup = i; } } if (first != -1) { + var _ship = obj_ini.ship_data[first]; obj_ini.veh_lid[target_company][good] = first; - obj_ini.veh_loc[target_company][good] = obj_ini.ship_location[first]; + obj_ini.veh_loc[target_company][good] = obj_ini.ship_data[first].location; obj_ini.veh_wid[target_company][good] = 0; - obj_ini.ship_carrying[first] += 1; + _ship.carrying += 1; } else if ((first == -1) && (backup != -1)) { + var _ship = obj_ini.ship_data[backup]; obj_ini.veh_lid[target_company][good] = backup; - obj_ini.veh_loc[target_company][good] = obj_ini.ship_location[backup]; + obj_ini.veh_loc[target_company][good] = obj_ini.ship_data[backup.location]; obj_ini.veh_wid[target_company][good] = 0; - obj_ini.ship_carrying[backup] += 1; + _ship.carrying += 1; } else if ((first == -1) && (backup == -1)) { obj_ini.veh_lid[target_company][good] = -1; obj_ini.veh_loc[target_company][good] = ""; diff --git a/scripts/scr_alert/scr_alert.gml b/scripts/scr_alert/scr_alert.gml index 26faa10d9e..2bb7037271 100644 --- a/scripts/scr_alert/scr_alert.gml +++ b/scripts/scr_alert/scr_alert.gml @@ -16,6 +16,59 @@ function set_alert_draw_colour(alert_colour) { } } +function EndTurnAlert(type, text,colour)constructor{ + self.type=type; + self.text=text; + char=0; + alpha=1; + txt=""; + self.color=colour; + static turn = 0 + + static alert_count = 0 + if (turn != obj_controller.turn){ + turn = obj_controller.turn; + alert_count = 0; + } + + alert_id = alert_count; + + alert_count++; + + + static draw = function(){ + add_draw_return_values(); + var _fast = obj_turn_end.fast; + if (_fast>=alert_id) and (string_length(txt)=alert_id) and (alpha<1){ + alpha+=0.03; + } + if (obj_turn_end.fadeout){ + alpha-=0.05; + } + set_alert_draw_colour(color); + draw_set_alpha(min(1,alpha)); + + if (obj_controller.zoomed=0){ + draw_text(32,+66+(alert_id*20),string_hash_to_newline(txt)); + // draw_text(view_xview[0]+16.5,view_yview[0]+40.5+(i*12),string(alert_txt[i])); + } + /*if (obj_controller.zoomed=1){ + draw_text_transformed(80,80+(i*24),string(alert_txt[i]),2,2,0); + draw_text_transformed(81,81+(i*24),string(alert_txt[i]),2,2,0); + }*/ + + if (obj_controller.zoomed=1){ + draw_text_transformed(32,232+(alert_id*40),string_hash_to_newline(txt),2,2,0); + // draw_text_transformed(122,122+(i*36),string(alert_txt[i]),3,3,0); + } + pop_draw_return_values(); + } +} + function scr_alert(colour, alert_type, alert_text, xx=00, yy=00) { // color / type / text /x/y @@ -26,16 +79,9 @@ function scr_alert(colour, alert_type, alert_text, xx=00, yy=00) { // if (obj_turn_end.alerts>0){ - if (instance_exists(obj_turn_end)){ - if (obj_turn_end.alert_type[obj_turn_end.alerts]!="-"+string(alert_text)) and (alert_type!="blank") and (colour!="blank"){ - obj_turn_end.alerts+=1; - obj_turn_end.alert[obj_turn_end.alerts]=1; - obj_turn_end.alert_color[obj_turn_end.alerts]=colour; // takes green, yellow, red, purple, default GM colorcodes(with c_ prefix), decimal, hexadecimal(with $ prefix, 6 or 8 digits) and CSS(with # prefix) - // if (colour="purple") then obj_turn_end.alert_color[obj_turn_end.alerts]="red"; - obj_turn_end.alert_type[obj_turn_end.alerts]=alert_type; - obj_turn_end.alert_text[obj_turn_end.alerts]="-"+string(alert_text); - obj_turn_end.alert[obj_turn_end.alerts]=1; - } + if (instance_exists(obj_turn_end) && (alert_type!="blank" && colour!="blank")){ + var _new_alert = new EndTurnAlert(alert_type,alert_text,colour); + array_push(obj_turn_end.alert, _new_alert); } diff --git a/scripts/scr_ancient_ruins/scr_ancient_ruins.gml b/scripts/scr_ancient_ruins/scr_ancient_ruins.gml index 543821a348..703c0a7162 100644 --- a/scripts/scr_ancient_ruins/scr_ancient_ruins.gml +++ b/scripts/scr_ancient_ruins/scr_ancient_ruins.gml @@ -8,7 +8,7 @@ function scr_ancient_ruins_setup(){ recoverables=[]; failed_exploration = 0; unrecovered_items = false; - f_type = P_features.Ancient_Ruins; + f_type = P_features.AncientRuins; exploration_complete= false; planet_display = $"{ruins_size} Unexplored Ancient Ruins"; completion_level = 0; @@ -358,7 +358,7 @@ function ruins_exploration_main_sequence(){ /// @mixin PlanetData function scr_check_for_ruins_exploration(){ - var _ruins_list = get_features(P_features.Ancient_Ruins); + var _ruins_list = get_features(P_features.AncientRuins); var _explore_ruins=0; if (array_length(_ruins_list) > 0){ for (var _ruin = 0; _ruin < array_length(_ruins_list); _ruin++){ diff --git a/scripts/scr_apothecary_ground/scr_apothecary_ground.gml b/scripts/scr_apothecary_ground/scr_apothecary_ground.gml index 50df4e8392..8d865ab1ae 100644 --- a/scripts/scr_apothecary_ground/scr_apothecary_ground.gml +++ b/scripts/scr_apothecary_ground/scr_apothecary_ground.gml @@ -13,6 +13,10 @@ function calculate_full_chapter_spread(){ var _tech_spread = {}; var _apoth_spread = {}; var _unit_spread = {}; + for (var i=0;i-1){ veh_location = obj_ini.veh_lid[company][v]; - var _ship_loc = obj_ini.ship_location[veh_location]; + var _ship = obj_ini.ship_data[veh_location]; + var _ship_loc = _ship.location; if (_ship_loc == "Warp" || _ship_loc=="Lost"){ if instance_exists(obj_p_fleet){ with (obj_p_fleet){ @@ -90,9 +99,9 @@ function calculate_full_chapter_spread(){ } } } - } else if (obj_ini.ship_location[veh_location] != ""){ + } else if (_ship_loc != ""){ array_slot=eSystemLoc.orbit; - key_val=obj_ini.ship_location[veh_location]; + key_val=_ship_loc; } } if (obj_ini.veh_wid[company][v]>0){ @@ -156,7 +165,7 @@ function apothecary_simple(){ } if (!marines_present){ if (obj_controller.gene_seed == 0) and (obj_controller.recruiting > 0) { - var _training_ground = system_feature_bool(self.p_feature, P_features.Recruiting_World); + var _training_ground = system_feature_bool(self.p_feature, P_features.RecruitingWorld); if (_training_ground){ obj_controller.recruiting = 0; scr_alert("red", "recruiting", "The Chapter has run out of gene-seed!", 0, 0); diff --git a/scripts/scr_array_functions/scr_array_functions.gml b/scripts/scr_array_functions/scr_array_functions.gml index a922b336ea..e81f6010af 100644 --- a/scripts/scr_array_functions/scr_array_functions.gml +++ b/scripts/scr_array_functions/scr_array_functions.gml @@ -90,6 +90,12 @@ function array_random_element(choice_array){ return choice_array[irandom(array_length(choice_array) - 1)]; } +function array_pop_random(choice_array){ + var i = array_random_index(choice_array); + var _item = choice_array[i]; + array_delete(choice_array, i, 1); + return _item; +} function array_random_index(choice_array){ return irandom(array_length(choice_array) - 1); } diff --git a/scripts/scr_automated_ship_combat_functions/scr_automated_ship_combat_functions.gml b/scripts/scr_automated_ship_combat_functions/scr_automated_ship_combat_functions.gml new file mode 100644 index 0000000000..567feb0039 --- /dev/null +++ b/scripts/scr_automated_ship_combat_functions/scr_automated_ship_combat_functions.gml @@ -0,0 +1,576 @@ +function point_on_circle(start_x, start_y, radius, angle){ + var _angle_radians = degtorad(angle); + var _final_x = start_x + lengthdir_x(radius, angle); + var _final_y = start_y + lengthdir_y(radius, angle); + return [_final_x, _final_y]; +} + + +function find_ship_combat_target(primary_target_type = obj_en_ship, secondary_target_type = -1){ + if (instance_exists(primary_target_type) && !instance_exists(secondary_target_type)){ + target=instance_nearest(x,y,obj_p_ship); + } + if (!instance_exists(primary_target_type) && instance_exists(secondary_target_type)){ + target=instance_nearest(x,y,secondary_target_type); + } + if (instance_exists(primary_target_type)) and (instance_exists(secondary_target_type)){ + var _tp1=instance_nearest(x,y,primary_target_type); + var _tp2=instance_nearest(x,y,secondary_target_type); + if (point_distance(x,y,_tp1.x,_tp1.y)<=point_distance(x,y,_tp2.x,_tp2.y)){ + target=_tp1; + } + if (point_distance(x,y,_tp1.x,_tp1.y)>point_distance(x,y,_tp2.x,_tp2.y)){ + target=_tp2; + } + } +} + +function combat_acceleration_control(){ + var travel_distance = draw_targets == false ? target_distance : point_distance(x, y, draw_targets[0], draw_targets[1]); + var _start_slowing = start_slowing_telemetry(travel_distance, speed_down); + if (_start_slowing){ + // if (object_index==obj_p_ship){ + //show_debug_message("start_Slow"); + // } + speed-=speed_down; + } else { + //if (object_index==obj_p_ship){ + //show_debug_message($"start_speed{speed}"); + //} + speed+=speed_up; + /*if (action=="attack"){ + if (target_distance>closing_distance) and (speed<(max_speed)) then speed+=speed_up; + } else if (action=="broadside"){ + if (target_distance>closing_distance) and (speed<(max_speed)) then speed+=speed_up; + } else if (action=="flank"){// flank here + if (target_distance>closing_distance) and (speed<(max_speed)) then speed+=speed_up; + }*/ + //if (object_index==obj_p_ship){ + //show_debug_message($"end_speed{speed}, {max_speed}"); + //} + } +} +/*function circle_mechanics(end_location){ + var _turn_require = point_direction(x,y,end_location[0],end_location[1]); + if (_turn_require<180){ + time_to_face = 180/turning_speed; + } else{ + time_to_face = (_turn_require-180)/turning_speed; + } + + var x_travel = end_location[0] - x; + var y_travel = end_location[1] - y; + + for (var i=0; i 270){ + _enemy_points_right += size; + } else if (_rel_direct < 90) { + _enemy_points_left += size; + } + } + var _break_direction = (_enemy_points_right > _enemy_points_left) ? 90 : 270; + + + draw_targets = point_on_circle(target.x, target.y, 450 ,_break_direction); + ship_turn_towards_point(draw_targets[0],draw_targets[1]); + } + +} + + +function broadside_movement(){ + var _target_direction = target.direction; + if (target!=0) and (action="broadside") and (target_distance>closing_distance){ + if (y>=target.y){ + target_distance=point_distance(x,y,target.x+lengthdir_x(64,target.direction-180),target.y+lengthdir_y(128,target.direction-90))-(max(sprite_get_width(sprite_index),sprite_get_height(sprite_index))); + } + if (ytarget.y) and (target_distance>closing_distance){ + direction=turn_towards_point(direction,x+lengthdir_x(64,target.direction-180),y,target.x,target.y+lengthdir_y(128,target.direction-90),.2); + } + if (yclosing_distance){ + direction=turn_towards_point(direction,x+lengthdir_x(64,target.direction-180),y,target.x,target.y+lengthdir_y(128,target.direction+90),.2); + } + if (turn_bonus>1){ + if (yclosing_distance) then direction=turn_towards_point(direction,x+lengthdir_x(64,target.direction-180),y,target.x,target.y+lengthdir_y(128,target.direction+90),.2); + } + } +} + +function return_longest_range_weapon(weapons, facing = "none"){ + var _weapon = false; + for (var i=0;i _weapon.range){ + _weapon = weapons[i]; + } + } + } + return _weapon; +} + +function flank_direction_move(main_weapon = false){ + var _rel_direction = point_direction(target.x, target.y, x, y) - target.direction; + if (abs(_rel_direction) < 105){ + if (main_weapon == false){ + ship_rear_approach(_rel_direction); + } else { + if (point_distance(x, y, target.x, target.y) < (main_weapon.range*2) && abs(_rel_direction) <= main_weapon.firing_arc){ + avoid_ship_weapon(main_weapon, rel_direction); + } else { + ship_rear_approach(_rel_direction); + } + } + + } else { + defualt_target_movement(); + } +} + +function avoid_ship_weapon(weapon, rel_direction){ + if (rel_direction){ + var avoid_angle = target.direction + weapon.firing_arc; + } else { + var avoid_angle = target.direction - weapon.firing_arc; + } + var _sx = xm + lengthdir_x(weapon.range, avoid_angle); + var _sy = ym + lengthdir_y(weapon.range, avoid_angle); + draw_targets = [_sx, _sy]; + ship_turn_towards_point(_sx, _sy); +} + +function ship_rear_approach(rel_direction){ + var _attack_angle = target.direction + ((rel_direction > 0) ? 105 : -105); + if (_attack_angle > 360){ + _attack_angle -= 360; + } else if (_attack_angle< 0){ + _attack_angle = 360 -_attack_angle; + } + var _flank_margin = closing_distance*2 + var _target_lock = [target.x + lengthdir_x(_flank_margin, _attack_angle), target.y + lengthdir_y(_flank_margin, _attack_angle)] + draw_targets = _target_lock; + ship_turn_towards_point(_target_lock[0],_target_lock[1]); + closing_distance = 0; +} + +function get_out_of_weapon_firing_arc(weapon, weapon_owner){ + var _rel_direction = point_direction(weapon_owner.x, weapon_owner.y, x, y) - weapon_owner.direction; + var _travel_direct = 0; + if (_rel_direction>0){ + _travel_direct = weapon_owner.direction + weapon.firing_arc + 90; + } else { + _travel_direct = weapon_owner.direction - weapon.firing_arc - 90; + } + var _target_lock = [x + lengthdir_x(1000, _travel_direct), y + lengthdir_y(1000, _travel_direct)] + ship_turn_towards_point(_target_lock[0],_target_lock[1]); + draw_targets = _target_lock; +} + +function flank_behaviour(){ + var _normal_target = false; + if (target!=0 && action=="flank"){ + var _target_main_weapon = return_longest_range_weapon(target.weapons, "front"); + if (!under_fire){ + if (!_target_main_weapon){ + flank_direction_move(); + } else { + var _rel_direction = point_direction(target.x, target.y, x, y) - target.direction; + if (abs(_rel_direction) <= _target_main_weapon.firing_arc){ + get_out_of_weapon_firing_arc(_target_main_weapon, target); + } else { + flank_direction_move(); + } + } + } else { + + _normal_target = true; + } + } + if (_normal_target ){ + defualt_target_movement(); + } +} + +function defualt_target_movement(){ + if (y>=target.y){ + target_distance=point_distance(x,y,target.x+lengthdir_x(64,target.direction-180),target.y+lengthdir_y(128,target.direction-90))-(max(sprite_get_width(sprite_index),sprite_get_height(sprite_index))); + } else if (ytarget.y && target_distance>closing_distance) ){ + direction=turn_towards_point(direction,x,y,target.x,target.y,turning_speed); + } else if (yclosing_distance){ + direction=turn_towards_point(direction,x,y,target.x,target.y,turning_speed); + } +} + +function start_slowing_telemetry(distance_to_target, deceleration){ + var _start_slowing = false; + if (speed>0){ + var _time_to_stop = (speed/deceleration); + var _distance_traveled_while_slowing = speed*_time_to_stop+ ((1/2) * deceleration * sqr(_time_to_stop)); + + if (distance_to_target - _distance_traveled_while_slowing < closing_distance){ + _start_slowing = true; + } + } + return _start_slowing; +} + + +function destroy_ship_and_leave_husk(){ + image_alpha=0.5; + + if (ai_type == "player" || owner != eFACTION.Tyranids){ + husk=instance_create(x,y,obj_en_husk); + husk.sprite_index=sprite_index; + husk.direction=direction; + husk.image_angle=image_angle; + husk.depth=depth; + husk.image_speed=0; + for(var i=0; i 0) r = yr/xr; + else r = 0; + a1 = point_direction(0,0,(x3-xm)*r,y3-ym); + a2 = point_direction(0,0,(x4-xm)*r,y4-ym); + if (a2-1;i--){ + var _bullet = bullets_for[i]; + if (!instance_exists(_bullet)){ + array_delete(bullets_for, i, 1); + } else { + under_fire = true; + break; + } + } +} + +function ship_shoot_weapons(){ + for (var i=0;i0) then ok=1; + if (!ok) { + return 0; + } + front = true; + targe=target; + if (facing="front") and (front=1) then ok=2; + if (facing="most") then ok=2; + + + /* + if (facing="right") then targe=target_r; + if (facing="left") then targe=target_l; + if ((facing="front") or (facing="most")) and (front=1) then ok=2; + if (facing="right") or (facing="most") and (right=1) then ok=2; + if (facing="left") or (facing="most") and (left=1) then ok=2; + */ + if (facing="special") then ok=2; + if (!instance_exists(targe)) then exit; + target_distance=point_distance(x,y,targe.x,targe.y); + + if (facing="right") and (point_direction(x,y,target_r.x,target_r.y)<337) and (point_direction(x,y,target_r.x,target_r.y)>203) then ok=2; + if (facing="left") and (point_direction(x,y,target_r.x,target_r.y)>22) and (point_direction(x,y,target_r.x,target_r.y)<157) then ok=2; + + /*var re_deh;re_deh=relative_direction(direction,target.direction); + if (re_deh<45) or (re_deh>315) or ((re_deh>135) and (re_deh<225)) then direction=turn_towards_point(direction,x+lengthdir_x(128,target.direction-90),y,target.x,target.y+lengthdir_y(128,target.direction-90),.2) + */ + + + + if (ok=2) and (target_distance<(range+(max(sprite_get_width(sprite_index),sprite_get_height(sprite_index))))){ + if (ammo>0) and (ammo<900) then ammo-=1; + weapon_ammo[wep_id]=ammo; + cooldown[wep_id]=weapon_cooldown[wep_id]; + wep=weapon[wep_id]; + dam=weapon_dam[wep_id]; + + create_ship_projectile(wep_id); + } +} + +function ship_combat_cleanup(){ + try { + var _player_battle_fleet, yeehaw2, tstar; + _player_battle_fleet=0;yeehaw2=0;tstar=0; + + if (player_started=1){ + _player_battle_fleet=pla_fleet; + yeehaw2=battle_system; + } + + if (player_started=0) and (instance_exists(obj_turn_end)){ + _player_battle_fleet=fetch_current_battle().player_object; + } + + + if (instance_number(obj_en_ship)>0){ + scr_recent("fleet_defeat",star_name,(capital_lost*6)+(frigate_lost*2)+escort_lost); + } + if (instance_number(obj_en_ship)<=0){ + with(obj_p_ship){ + var _ship = fetch_ship(ship_id); + ship_data.hp = hp; + ship_data.weapons = weapons; + if (hp<=0){ + scr_recent("ship_destroyed",_ship.name,ship_id); + } + } + } + + if (instance_exists(_player_battle_fleet)){ + with (_player_battle_fleet){ + scr_ini_ship_cleanup(); + + if (player_fleet_ship_count() == 0){ + instance_destroy(); + } + } + } + + var op,ii,killer,killer_tg;op=0;killer=0;killer_tg=0;ii=-50; + + + if (!player_started && instance_exists(obj_turn_end)){ + ii = fetch_current_battle().system; + } else { + with(obj_star){ + if (id==obj_fleet.battle_system){ + ii = self.id; + } + } + } + + obj_controller.temp[1070]=ii.id; + + + + op=0;var ofleet;ofleet=0; + for (var op=0;op-7000) and (ofleet.y>-7000) and (ofleet.owner=enemy[op]){ + if (en_capital_lost[op]+en_frigate_lost[op]+en_escort_lost[op]>=ofleet.capital_number+ofleet.frigate_number+ofleet.escort_number){ + en_capital_lost[op]-=ofleet.capital_number;en_frigate_lost[op]-=ofleet.frigate_number;en_escort_lost[op]-=ofleet.escort_number; + // show_message("Fleet baleeted"); + with(ofleet){instance_destroy();} + } + if (en_capital_lost[op]+en_frigate_lost[op]+en_escort_lost[op]>0) and (instance_exists(ofleet)){ + // show_message("Fleet: "+string(ofleet.capital_number)+"/"+string(ofleet.frigate_number)+"/"+string(ofleet.escort_number)+", lost "+string(en_capital_lost[op])+"/"+string(en_frigate_lost[op])+"/"+string(en_escort_lost[op])); + if (en_capital_lost[op]>0) and (ofleet.capital_number>0){en_capital_lost[op]-=1;ofleet.capital_number-=1;} + if (en_frigate_lost[op]>0) and (ofleet.frigate_number>0){en_frigate_lost[op]-=1;ofleet.frigate_number-=1;} + if (en_escort_lost[op]>0) and (ofleet.escort_number>0){en_escort_lost[op]-=1;ofleet.escort_number-=1;} + if (ofleet.capital_number+ofleet.frigate_number+ofleet.escort_number<=0) then with(ofleet){instance_destroy();} + } + } + } + } + + with(obj_en_fleet){if (x<-7000) and (y<-7000){x+=10000;y+=10000;}} + + // if (instance_exists(ofleet)){show_message("Fleet: "+string(ofleet.capital_number)+"/"+string(ofleet.frigate_number)+"/"+string(ofleet.escort_number));} + // if (!instance_exists(ofleet)){show_message("FlEET WAS DELETED");} + } + + // show_message("End ship removing"); + + if (enemy[op]=4) and (enemy_status[op]<0){ + obj_controller.temp[1071]=enemy[op]; + with(obj_en_fleet){if (owner!=obj_controller.temp[1071]) or (orbiting!=obj_controller.temp[1070]){x-=10000;y-=10000;}} + ofleet=instance_nearest(room_width/2,room_height/2,obj_en_fleet); + killer=1; + obj_controller.temp[1071]=enemy[op]; + killer_tg=ofleet.inquisitor; + with(ofleet){instance_destroy();} + with(obj_en_fleet){{x+=10000;y+=10000;}} + } + } + + + + + + obj_controller.cooldown=20; + + if (killer>0){ + scr_loyalty("Inquisitor Killer","+"); + if (obj_controller.loyalty>=85) then obj_controller.last_world_inspection-=44; + if (obj_controller.loyalty>=70) and (obj_controller.loyalty<85) then obj_controller.last_world_inspection-=32; + if (obj_controller.loyalty>=50) and (obj_controller.loyalty<70) then obj_controller.last_world_inspection-=20; + if (obj_controller.loyalty<50) then scr_loyalty("Inquisitor Killer","+"); + + var msg="",msg2="",i=0; + if (killer_tg > 0){ + var inquis_name = obj_controller.inquisitor[killer_tg]; + msg+=$"Inquisitor {inquis_name} has been killed!"; + msg2=$"Inquisitor {inquis_name}"; + } + if (obj_controller.inquisitor_type[killer_tg]=="Ordo Hereticus") then scr_loyalty("Inquisitor Killer","+"); + + array_delete(obj_controller.inquisitor_gender, killer_tg,1); + array_delete(obj_controller.inquisitor_type, killer_tg,1); + array_delete(obj_controller.inquisitor, killer_tg,1); + + array_push(obj_controller.inquisitor_gender, choose(0,0,0,1,1,1,1)); + array_push(obj_controller.inquisitor_type, choose("Ordo Malleus","Ordo Xenos","Ordo Hereticus","Ordo Hereticus","Ordo Hereticus","Ordo Hereticus","Ordo Hereticus","Ordo Hereticus")); + array_push(obj_controller.inquisitor, global.name_generator.generate_imperial_name(obj_controller.inquisitor_gender[i])); + + instance_activate_object(obj_turn_end); + + if (instance_exists(obj_turn_end)) then scr_alert("red","inqis",string(msg),ii.x+16,ii.y-24); + if (!instance_exists(obj_turn_end)) and (obj_controller.faction_status[eFACTION.Inquisition]!="War"){ + var pip;pip=instance_create(0,0,obj_popup); + pip.title="Inquisitor Killed"; + pip.text=msg; + pip.image="inquisition"; + pip.cooldown=20; + + if (obj_controller.known[eFACTION.Inquisition]<3){ + pip.title="EXCOMMUNICATUS TRAITORUS"; + pip.text=$"The Inquisition has noticed your uncalled murder of {msg2} and declared your chapter Excommunicatus Traitorus."; + obj_controller.alarm[8]=1; + } + } + + + // if (obj_controller.known[eFACTION.Inquisition]<3) then with(obj_popup){instance_destroy();} + + + + // excommunicatus traitorus + } + + instance_activate_all(); + + if (instance_exists(obj_p_assra)){ + obj_p_assra.alarm[0]=1; + } + alarm[4]=2; + + + + } catch(_exception) { + handle_exception(_exception); + } +} + diff --git a/scripts/scr_automated_ship_combat_functions/scr_automated_ship_combat_functions.yy b/scripts/scr_automated_ship_combat_functions/scr_automated_ship_combat_functions.yy new file mode 100644 index 0000000000..22126cdb43 --- /dev/null +++ b/scripts/scr_automated_ship_combat_functions/scr_automated_ship_combat_functions.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"scr_automated_ship_combat_functions", + "isCompatibility":false, + "isDnD":false, + "name":"scr_automated_ship_combat_functions", + "parent":{ + "name":"fleet", + "path":"folders/Scripts/fleet.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/scr_battle_sort/scr_battle_sort.gml b/scripts/scr_battle_sort/scr_battle_sort.gml deleted file mode 100644 index bd51d5d290..0000000000 --- a/scripts/scr_battle_sort/scr_battle_sort.gml +++ /dev/null @@ -1,47 +0,0 @@ -function scr_battle_sort() { - - var i; - i=50; - - - // This is ran in order to sort the battles that have been quened up - // Space battles are placed in front whenever possible - - repeat(50){ - i-=1; - - if (battles<=i) and (i>=2) and (battles>0){ - if (battle[i]!=0) and (battle[i-1]!=0) and (battle_world[i]=-50) and (battle_world[i-1]>0){ - var tem1, tem2, tem3, tem4, tem5, tem6, tem7; - tem1=battle[i-1]; - tem2=battle_location[i-1]; - tem3=battle_world[i-1]; - tem4=battle_opponent[i-1]; - tem5=battle_object[i-1]; - tem6=battle_pobject[i-1]; - tem7=battle_special[i-1]; - - battle[i-1]=battle[i]; - battle_location[i-1]=battle_location[i]; - battle_world[i-1]=battle_world[i]; - battle_opponent[i-1]=battle_opponent[i]; - battle_object[i-1]=battle_object[i]; - battle_pobject[i-1]=battle_pobject[i]; - battle_special[i-1]=battle_special[i]; - - battle[i]=tem1; - battle_location[i]=tem2; - battle_world[i]=tem3; - battle_opponent[i]=tem4; - battle_object[i]=tem5; - battle_pobject[i]=tem6; - battle_special[i]=tem7; - } - } - } - - - alarm[0]=15; - - -} diff --git a/scripts/scr_bomb_world/scr_bomb_world.gml b/scripts/scr_bomb_world/scr_bomb_world.gml index 70662fab14..4b17f23a0b 100644 --- a/scripts/scr_bomb_world/scr_bomb_world.gml +++ b/scripts/scr_bomb_world/scr_bomb_world.gml @@ -293,8 +293,8 @@ function scr_bomb_world(bombard_target_faction, bombard_ment_power, target_stren } scr_audience(eFACTION.Mechanicus, "bombard_angry", _disp_neg,); } - if (planet_feature_bool(system.p_feature[planet], P_features.Gene_Stealer_Cult)) { - delete_features(system.p_feature[planet], P_features.Gene_Stealer_Cult); + if (planet_feature_bool(system.p_feature[planet], P_features.GeneStealerCult)) { + delete_features(system.p_feature[planet], P_features.GeneStealerCult); adjust_influence(eFACTION.Tyranids, -100, planet, system); pip.text += " The xeno taint of the tyranids that was infesting the population has been completely eradicated with the planets cleansing"; } else { diff --git a/scripts/scr_buttons/scr_buttons.gml b/scripts/scr_buttons/scr_buttons.gml index 357b0afc34..80cbebb5f7 100644 --- a/scripts/scr_buttons/scr_buttons.gml +++ b/scripts/scr_buttons/scr_buttons.gml @@ -421,6 +421,50 @@ function UnitButtonObject(data = false) constructor { }; } +function icon_button() : UnitButtonObject() constructor{ + + click_method = false; + hover_method = false; + static set_sprite_data = function(x_scale=1,y_scale=1, sprite, subimg){ + self.x_scale = x_scale; + self.y_scale = y_scale; + self.sprite = sprite; + self.subimg = subimg; + update(); + } + + static update = function(){ + w = sprite_get_width(sprite)*x_scale; + h = sprite_get_height(sprite)*y_scale; + x2 = x1 + w; + y2 = y1 + h; + } + relative_x = 0; + relative_y = 0; + + static draw = function(allow_click=true){ + var xx = x1 + relative_x; + var yy = y1 + relative_y; + var xx2 = x2 + relative_x; + var yy2 = y2 + relative_y; + + draw_sprite_ext(sprite, subimg, xx, yy, x_scale, y_scale, 0, c_white, 1); + if (hover_method!=false){ + if (scr_hit(xx, yy, xx2, yy2)){ + hover_method(); + } + } + if (click_method != false){ + if (point_and_click([xx, yy, xx2, yy2])){ + click_method(); + } + } + } + +} + + + /// @function PurchaseButton(req) /// @constructor /// @category UI diff --git a/scripts/scr_cheatcode/scr_cheatcode.gml b/scripts/scr_cheatcode/scr_cheatcode.gml index ac2319de16..18eb1b6102 100644 --- a/scripts/scr_cheatcode/scr_cheatcode.gml +++ b/scripts/scr_cheatcode/scr_cheatcode.gml @@ -65,10 +65,10 @@ function scr_cheatcode(argument0) { break; case "artifact": if (cheat_arguments[0] == "1") { - scr_add_artifact("random", "", 6, obj_ini.ship[0], 501); + scr_add_artifact("random", "", 6, obj_ini.ship_data[0].name, 501); } else { repeat(real(cheat_arguments[1])){ - scr_add_artifact(cheat_arguments[0], "", 6, obj_ini.ship[0], 501); + scr_add_artifact(cheat_arguments[0], "", 6, obj_ini.ship_data[0].name, 501); } } break; @@ -117,7 +117,7 @@ function scr_cheatcode(argument0) { break; case "inquisarti": scr_quest(0, "artifact_loan", 4, 10); - var last_artifact = scr_add_artifact("good", "inquisition", 0, obj_ini.ship[0], 501); + var last_artifact = scr_add_artifact("good", "inquisition", 0, obj_ini.ship_data[0].name, 501); break; case "govmission": var problem = ""; @@ -190,21 +190,21 @@ function scr_cheatcode(argument0) { case "artifactpopulate": with (obj_star) { for (var i = 1; i <= planets; i++) { - array_push(p_feature[i], new NewPlanetFeature(P_features.Artifact)); + array_push(p_feature[i], new PlanetFeature(P_features.Artifact)); } } break; case "ruinspopulate": with (obj_star) { for (var i = 1; i <= planets; i++) { - array_push(p_feature[i], new NewPlanetFeature(P_features.Ancient_Ruins)); + array_push(p_feature[i], new PlanetFeature(P_features.AncientRuins)); } } break; case "stcpopulate": with (obj_star) { for (var i = 1; i <= planets; i++) { - array_push(p_feature[i], new NewPlanetFeature(P_features.STC_Fragment)); + array_push(p_feature[i], new NewPlanetFeature(P_features.STCFragment)); } } break; @@ -375,6 +375,13 @@ function scr_cheatcode(argument0) { var _fleet = get_nearest_player_fleet(0,0); add_ship_to_fleet(new_player_ship("Gloriana"),_fleet); break; + case "nidinvasion": + with (obj_star){ + if (system_feature_bool(p_feature,P_features.GeneStealerCult)){ + summon_new_hive_fleet(); + } + } + break; case "zoom": set_zoom_to_default(); break; @@ -436,11 +443,11 @@ function draw_planet_debug_options(){ function draw_planet_debug_features(){ static _addable_features = [ { - e_num : P_features.Gene_Stealer_Cult, + e_num : P_features.GeneStealerCult, name : "GeneStealer Cult" }, { - e_num : P_features.Ancient_Ruins, + e_num : P_features.AncientRuins, name : "Ancient Ruins" }, { @@ -448,11 +455,11 @@ function draw_planet_debug_features(){ name : "Artefact" }, { - e_num : P_features.STC_Fragment, + e_num : P_features.STCFragment, name : "STC Fragment" }, { - e_num : P_features.Sororitas_Cathedral, + e_num : P_features.SororitasCathedral, name : "Sororitas Cathedral" }, { diff --git a/scripts/scr_company_load/scr_company_load.gml b/scripts/scr_company_load/scr_company_load.gml index 2e077f65c2..5842a65034 100644 --- a/scripts/scr_company_load/scr_company_load.gml +++ b/scripts/scr_company_load/scr_company_load.gml @@ -3,17 +3,18 @@ function scr_company_load(ship_loc) { with (obj_controller){ reset_ship_manage_arrays(); - var ships = array_length(obj_ini.ship); + var ships = array_length(obj_ini.ship_data); for (var i = 0; i < ships; i++) { - if (obj_ini.ship[i] != "" && obj_ini.ship_location[i] == ship_loc){ + var _ship = obj_ini.ship_data[selecting_ship]; + if (_ship.location == ship_loc){ array_push(sh_ide, i); - array_push(sh_name, obj_ini.ship[i]); - array_push(sh_class, obj_ini.ship_class[i]); - array_push(sh_loc, obj_ini.ship_location[i]); - array_push(sh_uid, obj_ini.ship_uid[i]); - array_push(sh_hp, $"{round(obj_ini.ship_hp[i] / obj_ini.ship_maxhp[i]) * 100}% HP") - array_push(sh_cargo, obj_ini.ship_carrying[i]); - array_push(sh_cargo_max, obj_ini.ship_capacity[i]); + array_push(sh_name, _ship.name); + array_push(sh_class, _ship.class); + array_push(sh_loc, _ship.location); + array_push(sh_uid, _ship.uid); + array_push(sh_hp, $"{round(_ship.hp / _ship.max_hp) * 100}% HP") + array_push(sh_cargo, _ship.carrying); + array_push(sh_cargo_max, _ship.capacity); } } diff --git a/scripts/scr_company_view/scr_company_view.gml b/scripts/scr_company_view/scr_company_view.gml index 69a3927bd3..22642077e3 100644 --- a/scripts/scr_company_view/scr_company_view.gml +++ b/scripts/scr_company_view/scr_company_view.gml @@ -108,7 +108,8 @@ function add_vehicle_to_manage_arrays(unit){ array_push(ma_wid,obj_ini.veh_wid[unit[0]][unit[1]]); array_push(ma_race,obj_ini.veh_race[unit[0]][unit[1]]); if (obj_ini.veh_lid[unit[0]][unit[1]]>-1){ - array_push(ma_loc,obj_ini.ship_location[obj_ini.veh_lid[unit[0]][unit[1]]]); + var _ship = obj_ini.ship_data[fetch_deep_array(obj_ini.veh_lid,unit)]; + array_push(ma_loc,_ship.location); } else { array_push(ma_loc,obj_ini.veh_loc[unit[0]][unit[1]]); } @@ -160,14 +161,16 @@ function scr_company_view(company) { if (unit.name() != "") { unit_loc = unit.marine_location(); - // Check if unit is on a lost ship - if ( - unit_loc[0] == location_types.ship && - obj_ini.ship_location[unit_loc[1]] == "Lost" - ) { - continue; + // Check if unit is on a lost ship + if (unit_loc[0] == location_types.ship){ + var _ship = obj_ini.ship_data[unit_loc[1]]; + if (_ship.location == "Lost"){ + continue; + } } + // Check if unit is on a lost ship + mans += 1; add_man_to_manage_arrays(unit); var go = 0, op = 0; @@ -198,11 +201,11 @@ function scr_company_view(company) { } // Check if unit is on a lost ship - if ( - obj_ini.veh_lid[company][i] > -1 && - obj_ini.ship_location[obj_ini.veh_lid[company][i]] == "Lost" - ) { - continue + if (obj_ini.veh_lid[company][i]){ + var _ship = obj_ini.ship_data[obj_ini.veh_lid[company][i]]; + if (_ship.location == "Lost"){ + continue; + } } add_vehicle_to_manage_arrays([company, i]); diff --git a/scripts/scr_controller_helpers/scr_controller_helpers.gml b/scripts/scr_controller_helpers/scr_controller_helpers.gml index de456d5257..86e7b648c7 100644 --- a/scripts/scr_controller_helpers/scr_controller_helpers.gml +++ b/scripts/scr_controller_helpers/scr_controller_helpers.gml @@ -347,65 +347,17 @@ function scr_toggle_fleet_area() { hide_banner = 1; //TODO rewrite all this shit when fleets finally become OOP menu = MENU.Fleet; + fleet_advisor_data_setup(); + cooldown = 8000; click = 1; - for (var i = 37; i <= 41; i++) { - temp[i] = ""; - } - for (var i = 101; i < 120; i++) { - temp[i] = ""; - } - - var g = 0, - u = 0, - m = 0, - d = 0; - temp[37] = 0; - temp[38] = 0; - temp[39] = 0; - for (var i = 0; i < array_length(obj_ini.ship); i++) { - if (obj_ini.ship[i] != "") { - if (obj_ini.ship_size[i] == 3) { - temp[37]++; - } - if (obj_ini.ship_size[i] == 2) { - temp[38]++; - } - if (obj_ini.ship_size[i] == 1) { - temp[39]++; - } - } - } + } else if (menu == 16) { + menu = 0; - g = 0; - temp[41] = "1"; - for (var i = 0; i < array_length(obj_ini.ship); i++) { - if ((g != 0) && (obj_ini.ship[i] != "")) { - if ((obj_ini.ship_hp[i] / obj_ini.ship_maxhp[i]) < u) { - g = i; - u = obj_ini.ship_hp[i] / obj_ini.ship_maxhp[i]; - } - } - if ((g == 0) && (obj_ini.ship[i] != "")) { - g = i; - u = obj_ini.ship_hp[i] / obj_ini.ship_maxhp[i]; - } - if (obj_ini.ship[i] != "") { - m = i; - } - if ((obj_ini.ship[i] != "") && ((obj_ini.ship_hp[i] / obj_ini.ship_maxhp[i]) < 0.25)) { - d += 1; - } - } - if (g != 0) { - temp[40] = string(obj_ini.ship_class[g]) + " '" + string(obj_ini.ship[g]) + "'"; - temp[41] = string(u); - temp[42] = string(d); - } - man_max = m; - man_current = 0; + cooldown = 8000; + click = 1; } } }); diff --git a/scripts/scr_crusade/scr_crusade.gml b/scripts/scr_crusade/scr_crusade.gml index 8de63b4609..e45cdd1ee2 100644 --- a/scripts/scr_crusade/scr_crusade.gml +++ b/scripts/scr_crusade/scr_crusade.gml @@ -79,7 +79,8 @@ function scr_crusade() { } if (dead){ var man_size=0; - obj_ini.ship_carrying[unit.ship_location]-=unit.get_unit_size(); + var _ship = obj_ini.ship_data[unit.ship_location]; + _ship.carrying-=unit.get_unit_size(); if (unit.IsSpecialist(SPECIALISTS_STANDARD,true)){ obj_controller.command--; } else { @@ -126,7 +127,7 @@ function scr_crusade() { if (roll3<=10) then artifacts+=1; if (artifacts>0) then repeat(artifacts){ if (obj_ini.fleet_type=ePlayerBase.home_world) then scr_add_artifact("random","",4,obj_ini.home_name,2); - if (obj_ini.fleet_type != ePlayerBase.home_world) then scr_add_artifact("random","",4,obj_ini.ship[0],501); + if (obj_ini.fleet_type != ePlayerBase.home_world) then scr_add_artifact("random","",4,obj_ini.ship_data[0].name,501); } @@ -177,7 +178,7 @@ function launch_crusade(){ } var travel_leeway = 10; if (_nearest_player_fleet.action == "move"){ - travel_leeway += _nearest_player_fleet.eta; + travel_leeway += _nearest_player_fleet.action_eta; } var _eta = get_viable_travel_time(travel_leeway, _nearest_player_fleet.x, _nearest_player_fleet.y, star_id.x,star_id.y, _nearest_player_fleet,false) scr_popup("Crusade",$"Fellow Astartes legions are preparing to embark on a Crusade to a nearby sector. Your forces are expected at {star_id.name}; {_eta} months from now your ships there shall begin their journey.","crusade",""); diff --git a/scripts/scr_dead_marines/scr_dead_marines.gml b/scripts/scr_dead_marines/scr_dead_marines.gml deleted file mode 100644 index fbdd4047a5..0000000000 --- a/scripts/scr_dead_marines/scr_dead_marines.gml +++ /dev/null @@ -1,70 +0,0 @@ -function scr_dead_marines(run) { - - // WeeeeeeEEEEEEEEEE~ - - // If a ship has been destroyed this kills the fuck out relevant marines - // Also checks for lost company standards, chapter master, and cleans up - // the company arrays afterward. - - var i, company, shi, comp_length,clean; - i=0;shi=999; - - if (run==1){ - obj_controller.marines=0; - obj_controller.command=0; - } - - i=0; - var unit, squad; - if (run == 1){ - for (company=0;company<11;company++){ - comp_length = array_length(obj_ini.name[company]); - clean = true; - for (i=0;i-1){ - if ((ship_lost[unit.ship_location]>0) or (obj_ini.ship_hp[unit.ship_location]<=0)){ - fallen+=1; - clean = false; - scr_kill_unit(company, i); - } - } - } - - if (obj_ini.name[company,i]!="") and (obj_ini.role[company,i]!="") and (obj_ini.race[company,i]=1){ - if (is_specialist(obj_ini.role[company][i])=false){ - obj_controller.marines+=1 - } - else obj_controller.command+=1; - } - - if (i<120){ - if (obj_ini.veh_role[company,i]!="") and ((ship_lost[obj_ini.veh_lid[company,i]]>0) or (obj_ini.ship_hp[obj_ini.veh_lid[company,i]]<=0)) and (obj_ini.veh_lid[company,i]>-1){ - destroy_vehicle(company,i); - } - } - } - if (clean == false){ - with(obj_ini){scr_company_order(company);scr_vehicle_order(company);} - } - } - } -} - - -function destroy_vehicle(co, num){ - obj_ini.veh_race[co][num]=0; - obj_ini.veh_loc[co][num]=""; - obj_ini.veh_name[co][num]=""; - obj_ini.veh_role[co][num]=""; - obj_ini.veh_wep1[co][num]=""; - obj_ini.veh_wep2[co][num]=""; - obj_ini.veh_wep3[co][num]=""; - obj_ini.veh_upgrade[co][num]=""; - obj_ini.veh_acc[co][num]=""; - obj_ini.veh_hp[co][num]=100; - obj_ini.veh_chaos[co][num]=0; - obj_ini.veh_pilots[co][num]=0; - obj_ini.veh_lid[co][num]=-1; -} diff --git a/scripts/scr_destroy_planet/scr_destroy_planet.gml b/scripts/scr_destroy_planet/scr_destroy_planet.gml index ae7d8e7f04..dfcd745863 100644 --- a/scripts/scr_destroy_planet/scr_destroy_planet.gml +++ b/scripts/scr_destroy_planet/scr_destroy_planet.gml @@ -117,14 +117,14 @@ function scr_destroy_planet(destruction_method) { } scr_audience(eFACTION.Imperium, "declare_war", -50, "War", 9999, 2); - } else if (obj_controller.faction_status[eFACTION.Imperium] != "War" && planet_feature_bool(you.p_feature[baid], P_features.Daemonic_Incursion) == 0 && you.p_tyranids[baid] < 5) { + } else if (obj_controller.faction_status[eFACTION.Imperium] != "War" && planet_feature_bool(you.p_feature[baid], P_features.DaemonicIncursion) == 0 && you.p_tyranids[baid] < 5) { if (you.p_first[baid] == eFACTION.Imperium && you.p_type[baid] == "Hive") { obj_controller.loyalty -= 50; obj_controller.loyalty_hidden -= 50; decare_war_on_imperium_audiences() - if (planet_feature_bool(you.p_feature[baid], P_features.Sororitas_Cathedral) == 1) { + if (planet_feature_bool(you.p_feature[baid], P_features.SororitasCathedral) == 1) { obj_controller.disposition[5] -= 30; } } else if (you.p_owner[baid] == eFACTION.Imperium && (you.p_type[baid] == "Temperate" || you.p_type[baid] == "Desert")) { diff --git a/scripts/scr_destroy_vehicle/scr_destroy_vehicle.gml b/scripts/scr_destroy_vehicle/scr_destroy_vehicle.gml new file mode 100644 index 0000000000..9c44fd8f36 --- /dev/null +++ b/scripts/scr_destroy_vehicle/scr_destroy_vehicle.gml @@ -0,0 +1,17 @@ + + +function destroy_vehicle(co, num){ + obj_ini.veh_race[co][num]=0; + obj_ini.veh_loc[co][num]=""; + obj_ini.veh_name[co][num]=""; + obj_ini.veh_role[co][num]=""; + obj_ini.veh_wep1[co][num]=""; + obj_ini.veh_wep2[co][num]=""; + obj_ini.veh_wep3[co][num]=""; + obj_ini.veh_upgrade[co][num]=""; + obj_ini.veh_acc[co][num]=""; + obj_ini.veh_hp[co][num]=100; + obj_ini.veh_chaos[co][num]=0; + obj_ini.veh_pilots[co][num]=0; + obj_ini.veh_lid[co][num]=-1; +} diff --git a/scripts/scr_battle_sort/scr_battle_sort.yy b/scripts/scr_destroy_vehicle/scr_destroy_vehicle.yy similarity index 75% rename from scripts/scr_battle_sort/scr_battle_sort.yy rename to scripts/scr_destroy_vehicle/scr_destroy_vehicle.yy index ab4ca19ee8..aeb570d770 100644 --- a/scripts/scr_battle_sort/scr_battle_sort.yy +++ b/scripts/scr_destroy_vehicle/scr_destroy_vehicle.yy @@ -1,9 +1,9 @@ { "$GMScript":"v1", - "%Name":"scr_battle_sort", + "%Name":"scr_destroy_vehicle", "isCompatibility":false, "isDnD":false, - "name":"scr_battle_sort", + "name":"scr_destroy_vehicle", "parent":{ "name":"Combat", "path":"folders/Scripts/Combat.yy", diff --git a/scripts/scr_dialogue/scr_dialogue.gml b/scripts/scr_dialogue/scr_dialogue.gml index 170c773fa1..d85a4aa85c 100644 --- a/scripts/scr_dialogue/scr_dialogue.gml +++ b/scripts/scr_dialogue/scr_dialogue.gml @@ -372,12 +372,8 @@ function scr_dialogue(diplo_keyphrase, data = {}) { obj_controller.chaos_rating+=1; // Casket, Chalice, Tome - if (obj_ini.fleet_type=ePlayerBase.home_world){ - scr_add_artifact("chaos_gift","",0,obj_ini.home_name,2); - } - if (obj_ini.fleet_type != ePlayerBase.home_world){ - scr_add_artifact("chaos_gift","",0,obj_ini.ship[0],501); - } + if (obj_ini.fleet_type=ePlayerBase.home_world) then scr_add_artifact("chaos_gift","",0,obj_ini.home_name,2); + if (obj_ini.fleet_type != ePlayerBase.home_world) then scr_add_artifact("chaos_gift","",0,obj_ini.ship_data[0].name,501); } if (string_count("cs_meeting_battle",diplo_keyphrase)>0){ var current_eventing=diplo_keyphrase;combating=1; diff --git a/scripts/scr_draw_management_unit/scr_draw_management_unit.gml b/scripts/scr_draw_management_unit/scr_draw_management_unit.gml index 5c995cc73c..557abb7d24 100644 --- a/scripts/scr_draw_management_unit/scr_draw_management_unit.gml +++ b/scripts/scr_draw_management_unit/scr_draw_management_unit.gml @@ -48,7 +48,7 @@ function scr_draw_management_unit(selected, yy = 0, xx = 0, draw = true, click_l //get roman numeral for system planet unit_location_string += scr_roman(unit_location[1]); } else if (unit_location[0] == location_types.ship) { - unit_location_string = obj_ini.ship[unit_location[1]]; + unit_location_string = obj_ini.ship_data[unit_location[1]].name; } } else { unit_location_string = ma_loc[selected]; @@ -112,7 +112,7 @@ function scr_draw_management_unit(selected, yy = 0, xx = 0, draw = true, click_l //numeral for vehicle planet unit_location_string += scr_roman(ma_wid[selected]); } else if (ma_lid[selected] > -1) { - unit_location_string = obj_ini.ship[ma_lid[selected]]; + unit_location_string = obj_ini.ship_data[ma_lid[selected]].name; } health_string = string(round(ma_health[selected])) + "% HP"; exp_string = ""; @@ -463,7 +463,8 @@ function scr_draw_management_unit(selected, yy = 0, xx = 0, draw = true, click_l if (ma_lid[selected] == -1) { wrong_location = true; } else { - wrong_location = obj_ini.ship_location[ma_lid[selected]] != selecting_location; + var _ship = obj_ini.ship_data[ma_lid[selected]]; + wrong_location = _ship.location != selecting_location; } } else { wrong_location = ma_loc[selected] != selecting_location; diff --git a/scripts/scr_draw_planet_features/scr_draw_planet_features.gml b/scripts/scr_draw_planet_features/scr_draw_planet_features.gml index 32ea1b2f2d..041e655443 100644 --- a/scripts/scr_draw_planet_features/scr_draw_planet_features.gml +++ b/scripts/scr_draw_planet_features/scr_draw_planet_features.gml @@ -110,7 +110,7 @@ function FeatureSelected(Feature, system, planet) constructor{ //TODO somthing if the forge has a hanger } break; - case P_features.Necron_Tomb: + case P_features.NecronTomb: generic=true; if (feature.awake==0 && feature.sealed==0){ @@ -129,17 +129,17 @@ function FeatureSelected(Feature, system, planet) constructor{ title = "Unknown Artifact"; body = "Unload Marines onto the planet to search for the artifact"; break; - case P_features.Ancient_Ruins: + case P_features.AncientRuins: generic=true; title = "Ancinet Ruins"; body = "Unload Marines onto the planet to explore the ruins"; break; - case P_features.STC_Fragment: + case P_features.STCFragment: generic=true; title = "STC Fragment"; body = $"Unload a {obj_ini.role[100][16]} and whatever entourage you deem necessary to recover the STC Fragment"; break; - case P_features.Gene_Stealer_Cult: + case P_features.GeneStealerCult: generic=true; var cult_control = planet_data.population_influences[eFACTION.Tyranids]; title = $"Cult of {feature.name}"; @@ -155,7 +155,7 @@ function FeatureSelected(Feature, system, planet) constructor{ } body = $"The Cult of {feature.name} {control_string}"; break; - case P_features.Victory_Shrine: + case P_features.VictoryShrine: draw_text_transformed(xx+(area_width/2), yy +10, "Victory Shrine", 2, 2, 0); draw_set_halign(fa_left); draw_set_color(c_gray); @@ -187,12 +187,12 @@ function FeatureSelected(Feature, system, planet) constructor{ body = "Without a force of orks to hold it together the fortress is slowly pulled apart from within by the inhabitants, It's capabilities will constantly decrease until soon there will be nothing left"; } break - case P_features.Recruiting_World: + case P_features.RecruitingWorld: generic = true; var _planet = planet_data.planet; var _star = obj_star_select.target; var p_data = new PlanetData(_planet, _star); - var _recruit_world = p_data.get_features(P_features.Recruiting_World)[0]; + var _recruit_world = p_data.get_features(P_features.RecruitingWorld)[0]; var _spare_apoth_points = p_data.get_local_apothecary_points(); title = "Marine Recruitment"; body = $"There are {_spare_apoth_points} apothecary rescource points available for recruit screening,\n\n"; @@ -224,6 +224,35 @@ function FeatureSelected(Feature, system, planet) constructor{ body += "To increase recruit success chance more apothecaries will be required on the planet surface."; } break; + case P_features.ShipDock: + title = "Ship Dock"; + var _size_description = ""; + var _size_literal; + var _monestary = planet_data.has_feature(P_features.Monastery); + + switch(feature.size){ + case 1: + _size_description = "are small and unsuited to working on medium and large vessels and are mostly for the convieniencce of local traders of the planet"; + _size_literal = "Escort"; + break; + case 2: + _size_description = "are large establishments plenty capable of of working on a range of larger ships simultaniously, however they are still unsuited to working on the largest ships beyond basic repairs"; + _size_literal = "Frigate"; + break; + case 3: + _size_description = "are huge facilities capable of working on all grades of ships and undertaking most works any captain could requir for a price"; + _size_literal = "Capital"; + break; + } + var _base_dock = _monestary ? "Your Fortress Monestary docks" : $"The Docks of {planet_data.name()}"; + var _description = $"{_base_dock} {_size_description}\n\n"; + _description += $"The docks are capable of berthing {feature.capacity} ships of sizes up to {_size_literal} ships, ships being worked on in berths will not be able to participate in combat while they are being worked on and will take 2 months to recomission to duty once work has commenced"; + draw_set_halign(fa_left); + draw_text_ext(xx+10, yy+40,_description,-1,area_width-20); + var _off_height = string_height_ext(_description, -1,area_width-20); + //draw_unit_buttons([xx+10, ]); + break; + case P_features.Mission: var mission_description=$""; var planet_name = planet_numeral_name(planet_data.planet, obj_star_select.target); diff --git a/scripts/scr_drop_select_function/scr_drop_select_function.gml b/scripts/scr_drop_select_function/scr_drop_select_function.gml index 574867809f..1ef28a434c 100644 --- a/scripts/scr_drop_select_function/scr_drop_select_function.gml +++ b/scripts/scr_drop_select_function/scr_drop_select_function.gml @@ -489,70 +489,21 @@ function collect_local_units() { instance_destroy(); } - var tump; - tump = 0; - - var i, q, b; - i = -1; - q = -1; - b = -1; - repeat(sh_target.capital_number) { - b += 1; - if (sh_target.capital[b] != "") { - i += 1; - ship[i] = sh_target.capital[i]; - - ship_use[i] = 0; - tump = sh_target.capital_num[i]; - ship_max[i] = obj_ini.ship_carrying[tump]; - ship_ide[i] = tump; - - ship_size[i] = 3; - - purge_a += 3; + var i = 0; + var _ships = fleet_full_ship_array(sh_target); + for (var q = 0; q < array_length(_ships); q++){ + var _ship_id = _ships[q]; + var _ship = _ships[_ship_id]; + if (_ship.carrying>0){ + ship[i]=_ship.name; + ship_use[i]=0; + ship_max[i]=_ship.carrying; + ship_ide[i]=_ship_id; + purge_a += ship_bombard_score(_ship_id); purge_b += ship_max[i]; purge_c += ship_max[i]; - purge_d += ship_max[i]; - } - } - q = -1; - repeat(sh_target.frigate_number) { - q += 1; - if (sh_target.frigate[q] != "") { - i += 1; - ship[i] = sh_target.frigate[q]; - - ship_use[i] = 0; - tump = sh_target.frigate_num[q]; - ship_max[i] = obj_ini.ship_carrying[tump]; - ship_ide[i] = tump; - - ship_size[i] = 2; - - purge_a += 1; - purge_b += ship_max[i]; - purge_c += ship_max[i]; - purge_d += ship_max[i]; - } - } - q = -1; - repeat(sh_target.escort_number) { - q += 1; - if ((sh_target.escort[q] != "") && (obj_ini.ship_carrying[sh_target.escort_num[q]] > 0)) { - i += 1; - ship[i] = sh_target.escort[q]; - - ship_use[i] = 0; - tump = sh_target.escort_num[q]; - ship_max[i] = obj_ini.ship_carrying[tump]; - ship_ide[i] = tump; - - ship_size[i] = 1; - - purge_b += ship_max[i]; - purge_c += ship_max[i]; - purge_d += ship_max[i]; - } + i+=1; + } } } diff --git a/objects/obj_turn_end/Alarm_1.gml b/scripts/scr_end_turn_audiences_and_final/scr_end_turn_audiences_and_final.gml similarity index 53% rename from objects/obj_turn_end/Alarm_1.gml rename to scripts/scr_end_turn_audiences_and_final/scr_end_turn_audiences_and_final.gml index e8d9b3a34e..e53c320b18 100644 --- a/objects/obj_turn_end/Alarm_1.gml +++ b/scripts/scr_end_turn_audiences_and_final/scr_end_turn_audiences_and_final.gml @@ -1,70 +1,69 @@ +function scr_end_turn_check_audiences_and_popups(){ + var _is_audience = false; + if (array_length(audience_stack) > 0){ + var current_audience = audience_stack[0]; + _is_audience = true; + } + + + if (_is_audience){ + with(obj_controller){ + if (zoomed=1){ + scr_zoom(); + } + } + + //show_debug_message(current_audience); + + if (obj_controller.menu != MENU.Diplomacy){ + scr_toggle_diplomacy(); + } + obj_controller.audience = current_audience.faction; + obj_controller.diplomacy = current_audience.faction; + obj_controller.audience_data = current_audience.audience_data; + + if (obj_controller.diplomacy=10) and (obj_controller.faction_gender[10]=2){ + scr_music("blood",60); + } + + if (string_count("intro",current_audience.topic)>0){ + obj_controller.known[obj_controller.diplomacy]=2; + obj_controller.faction_justmet=1; + if (obj_controller.diplomacy=6){ + + scr_dialogue("intro1"); + + } + if (obj_controller.diplomacy!=6){ + //show_debug_message("new_intro"); + scr_dialogue("intro"); + + } + }else { + scr_dialogue(current_audience.topic); + + } + array_delete(audience_stack, 0, 1); + exit; + } + + + if (!_is_audience){ + turn_end_popups(); + } -var _is_audience = false; -if (array_length(audience_stack) > 0){ - var current_audience = audience_stack[0]; - _is_audience = true; } - -if (_is_audience){ - with(obj_controller){ - if (zoomed=1){ - scr_zoom(); - } - } - - show_debug_message(current_audience); - - if (obj_controller.menu != MENU.Diplomacy){ - scr_toggle_diplomacy(); - } - obj_controller.audience=current_audience.faction; - obj_controller.diplomacy=current_audience.faction; - obj_controller.audience_data = current_audience.audience_data; - - if (obj_controller.diplomacy=10) and (obj_controller.faction_gender[10]=2){ - scr_music("blood",60); - } - - if (string_count("intro",current_audience.topic)>0){ - obj_controller.known[obj_controller.diplomacy]=2; - obj_controller.faction_justmet=1; - if (obj_controller.diplomacy=6){ - - scr_dialogue("intro1"); - - } - if (obj_controller.diplomacy!=6){ - //show_debug_message("new_intro"); - scr_dialogue("intro"); - - } - }else { - scr_dialogue(current_audience.topic); - - } - array_delete(audience_stack, 0, 1); - exit; +function setup_audience_and_popup_timer(timer = 1){ + wait_and_execute(timer,scr_end_turn_check_audiences_and_popups,[], obj_turn_end); } - - - - - - - - -// if (current_audience<=audiences) then alarm[1]=5; - - -if (!_is_audience){ - current_popup+=1; - - - if (popup[current_popup]!=0){ - var pip; - pip=instance_create(0,0,obj_popup); +function turn_end_popups(){ + current_popup+=1; + + + if (current_popup>=0 && current_popuppopups) or (popup[1]=0){ - if (popups_end=0) then popups_end=1; - // obj_controller.x=first_x; - // obj_controller.y=first_y; - // instance_destroy(); - } - - + popups_end = current_popup>=array_length(popup); + if (popups_end){ + final_end_turn_sequence(); + } // obj_controller.x=first_x; // obj_controller.y=first_y; // instance_destroy(); } + /*if (popups=0){ + obj_controller.x=first_x; + obj_controller.y=first_y; + instance_destroy(); + }*/ -// if (current_popup>popups) or (popup[1]=0) then popups_end=1; - -if (popups_end=1){ - - - /*if (popups=0){ - obj_controller.x=first_x; - obj_controller.y=first_y; - instance_destroy(); - }*/ - - - obj_controller.x=first_x; - obj_controller.y=first_y; +function final_end_turn_sequence(){ + obj_controller.x = first_x; + obj_controller.y = first_y; alarm[2]=10; obj_controller.menu=0; combating=0; - + increment_in_game_time(); +} + +function increment_in_game_time(){ with(obj_controller){ year_fraction+=84; if (year_fraction>999){ - year+=1;year_fraction=0; + year+=1; + year_fraction=0; } if (year>=1000){ - millenium+=1;year-=1000; + millenium+=1; + year-=1000; } // menu=0; } - } - -/* */ -/* */ diff --git a/scripts/scr_end_turn_audiences_and_final/scr_end_turn_audiences_and_final.yy b/scripts/scr_end_turn_audiences_and_final/scr_end_turn_audiences_and_final.yy new file mode 100644 index 0000000000..b71e0761eb --- /dev/null +++ b/scripts/scr_end_turn_audiences_and_final/scr_end_turn_audiences_and_final.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"scr_end_turn_audiences_and_final", + "isCompatibility":false, + "isDnD":false, + "name":"scr_end_turn_audiences_and_final", + "parent":{ + "name":"Turn", + "path":"folders/Scripts/Turn.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/scr_end_turn_combat_helpers/scr_end_turn_combat_helpers.gml b/scripts/scr_end_turn_combat_helpers/scr_end_turn_combat_helpers.gml new file mode 100644 index 0000000000..653dab0413 --- /dev/null +++ b/scripts/scr_end_turn_combat_helpers/scr_end_turn_combat_helpers.gml @@ -0,0 +1,484 @@ + + +enum EndTurnBattleTypes { + Ground, + Fleet, +} + + +function fetch_current_battle(){ + return obj_turn_end.battle[obj_turn_end.current_battle]; +} +function EndTurnBattle (battle_type, system)constructor{ + type = battle_type; + self.system = system; + planet = 1; + special = ""; + opponent = 7; + player_object = -1; + slate = new DataSlate(); + slate.inside_method = function(){ + var xxx=slate.XX; + var yyy=slate.YY; + var i=current_battle; + + // if (battle_world[i]>0) then draw_sprite(spr_attacked,0,xxx+12,yyy+54); + var _img = type; + + scr_image("attacked",_img,xxx+12,yyy+54,254,174); + + draw_set_font(fnt_40k_14); + draw_set_halign(fa_left); + draw_set_color(c_gray); + draw_text(xxx+8,yyy+13,$"{current_battle+1}/{array_length(battle)}"); + + draw_set_halign(fa_center); + draw_set_font(fnt_40k_30b); + + if (type == EndTurnBattleTypes.Ground){ + draw_text_transformed(xxx+265,yyy+11,$"Forces Attacked! ({pdata.name()})",0.7,0.7,0); + } else { + draw_text_transformed(xxx+265,yyy+11,$"Fleet Attacked! ({location} System)",0.7,0.7,0); + } + + scr_image("ui/force",1,xxx+378-32,yyy+86-32,64,64); + // draw_sprite(spr_force_icon,1,xxx+378,yyy+86); + + draw_set_font(fnt_40k_14); + draw_set_halign(fa_left); + if (type == EndTurnBattleTypes.Fleet){ + draw_player_fleet_combat_options(); + } else if (type == EndTurnBattleTypes.Ground){ + draw_player_ground_combat_options(); + } + } + + static add_to_stack = function(){ + var _new_battle = self; + location = system.name; + if (type == EndTurnBattleTypes.Ground){ + pdata = new PlanetData(planet,system); + } + with (obj_turn_end){ + if (_new_battle.type == Fleet){ + _new_battle.collect_fleet_battle_variables(); + //final check that there definatly are infact enemy ships to fight + if (array_length(_new_battle.enemy_fleets)){ + array_insert(battle, _new_battle, 0); + } + } else { + _new_battle.collect_ground_battle_variables(); + if (roster.total_selected()){ + array_push(battle,_new_battle); + } + } + } + } + + static new_ship_class_tracker = function(){ + return { + capital : 0, + frigate : 0, + escort : 0, + }; + } + static collect_fleet_battle_variables = function(){ + var _fleets = scr_orbiting_fleets_all(system); + enemy_fleets = []; + allied_fleets = []; + + for (var i=0;i= 3 && opponent <= 13){ + var _op_grade = pdata.planet_forces[opponent]; + enemy_forces_descripton = AUTO_BATTLE_FORCES_GRADE[clamp(_op_grade,0,7)]; + } + if (battle_opponent[current_battle]=30){ + enemy_forces_descripton = "Master Spyrer"; + } + + } + + static draw = function(){ + add_draw_return_values(); + slate.draw_with_dimensions(535, 200, 530, 400); + pop_draw_return_values(); + } +} + + +function check_for_finished_end_turn_battles(){ + if (!array_length(battle) || current_battle >= array_length(battle)){ + show_debug_message("battles_over"); + setup_audience_and_popup_timer(); + } +} +function end_turn_battle_next_sequence(next_battle = true, wait_time = 1){ + show_debug_message("sequence"); + if (next_battle){ + obj_turn_end.current_battle++; + } + obj_controller.force_scroll=0; + var _main_func = function(){ + instance_activate_object(obj_star); + combating=0; + + collect_next_end_turn_battle(); + + instance_activate_object(obj_star); + + check_for_finished_end_turn_battles(); + } + + wait_and_execute(wait_time,_main_func,[],obj_turn_end) + + /* */ +} + +function collect_next_end_turn_battle(){ + if (array_length(battle) <=0 || current_battle>array_length(battle)){ + exit; + } + var xx, yy; + var ii=0; + var good=0; + + var _battle = battle[current_battle]; + + var battle_star = _battle.system; + + if (battle_star != "none"){// trying to find the star + obj_controller.x=battle_star.x; + obj_controller.y=battle_star.y; + + show=current_battle; + + if (obj_controller.zoomed=1){ + with(obj_controller){ + scr_zoom(); + } + } + } + instance_activate_object(obj_star); +} + +function draw_player_fleet_combat_options(){ + var xxx=main_slate.XX; + var yyy=main_slate.YY; + draw_set_font(fnt_40k_14b); + draw_set_halign(fa_left); + + draw_text(xxx+12,yyy+237,"Enemy Fleets:"); + draw_text(xxx+332,yyy+237,"Allied Fleets:"); + + draw_text(xxx+310,yyy+118,$"{caps} {string_plural("Battleship",caps)} ({capital_percentage}% HP)"); + draw_text(xxx+310,yyy+138,$"{frigs} {string_plural("Frigate",frigs)} ({frigs_percentage}% HP)"); + draw_text(xxx+310,yyy+158,$"{escorts} {string_plural("Escort",escorts)} ({escorts_percentage}% HP)"); + + + draw_set_halign(fa_center); + + for (var i=0;i0){ + xxx+=110; + } + var _fleet = enemy_fleets[i]; + + scr_image("ui/force",_fleet.owner,xxx+44-32,yyy+269-32,64,64); + var _ship_type_string=""; + + _ship_type_string += $"{_fleet.capital} :"+string_plural( "Battleship",_fleet.capital) + "\n"; + _ship_type_string += $"{_fleet.frigate} :"+string_plural("Frigate",_fleet.frigate) + "\n"; + _ship_type_string +=$"{_fleet.escort} :"+string_plural( "Escort",_fleet.escort) + "\n"; + + draw_text_transformed(xxx+44,yyy+286,_ship_type_string,0.7,1,0); + draw_set_halign(fa_center); + draw_set_font(fnt_40k_14b); + + } + var xxx=main_slate.XX; + for (var i=0;i0){ + xxx+=110; + } + var _fleet = allied_fleets[i]; + + scr_image("ui/force",_fleet.owner,xxx+44-32+_ali_mod,yyy+269-32,64,64); + var _ship_type_string=""; + _ship_type_string += $"{_fleet.capital} :"+string_plural( "Battleship",_fleet.capital) + "\n"; + _ship_type_string += $"{_fleet.frigate} :"+string_plural("Frigate",_fleet.frigate) + "\n"; + _ship_type_string +=$"{_fleet.escort} :"+string_plural( "Escort",_fleet.escort) + "\n"; + + draw_text_transformed(xxx+44+_ali_mod,yyy+286,_ship_type_string,0.7,1,0); + draw_set_halign(fa_center); + draw_set_font(fnt_40k_14b); + + } + + var xxx=main_slate.XX; + + var _retreat_button = draw_unit_buttons([xxx+180,yyy+350],"Retreat"); + if (point_and_click(_retreat_button)){ + with(obj_fleet_select){ + instance_destroy(); + } + + player_object.alarm[3]=1; + var that2=instance_create(0,0,obj_popup); + that2.type=99; + obj_controller.force_scroll=1; + } + + var _fight_button = draw_unit_buttons([xxx+272,yyy+350],"Fight"); + if (point_and_click(_fight_button)){ + instance_activate_all(); + + setup_fleet_battle(opponent, system); + + if (instance_exists(obj_fleet)){ + wait_and_execute(20, start_fleet_battle,[] , obj_turn_end); + } + // Start battle here + } + +} + + +function draw_player_ground_combat_options(){ + var xxx=main_slate.XX; + var yyy=main_slate.YY; + if (opponent<=20){ + draw_text(xxx+310,yyy+118, $"{player_marines} Marines"); + draw_text(xxx+310,yyy+138, $"{player_vehicles} Vehicles"); + + draw_text(xxx+310,yyy+158,$"{fortified_description} Fortified");// Not / Barely / Lightly / Moderately / Highly / Maximally + + } + + draw_set_font(fnt_40k_14b); + draw_set_halign(fa_left); + + draw_text(xxx+12,yyy+237,"Enemy Factions:"); + draw_text(xxx+332,yyy+237,"Allies:"); + + + + draw_set_halign(fa_center); + + scr_image("ui/force",opponent,xxx+44-32,yyy+289-32,64,64); + draw_text_transformed(xxx+44,yyy+316,enemy_forces_descripton,0.75,1,0); + draw_set_halign(fa_center); + draw_set_font(fnt_40k_14b); + + + var _init_battle = false; + if (point_and_click(draw_unit_buttons([xxx+195,yyy+362],"Offensive"))){ + _init_battle = true; + var _battle_stance = "offensive" + } + + if (point_and_click(draw_unit_buttons([xxx+335,yyy+362],"Defensive"))){ + _init_battle = true; + var _battle_stance = "defensive" + } + + if (_init_battle){ + var _loc = location + var _planet = planet; // Fight fight fight, ground + obj_controller.cooldown=8; + + // Start battle here + + combating=1; + + instance_deactivate_all(true); + instance_activate_object(obj_controller); + instance_activate_object(obj_ini); + instance_activate_object(system); + + var _battle_obj = system; + + instance_create(0,0,obj_ncombat); + obj_ncombat.enemy = opponent; + obj_ncombat.battle_object=system; + obj_ncombat.battle_loc=_loc; + obj_ncombat.battle_id=_planet; + + var _enemy = obj_ncombat.enemy; + + var _planet_data = new PlanetData(_planet, _battle_obj); + if (_battle_stance="offensive"){ + obj_ncombat.formation_set=1; + } else if (_battle_stance="defensive"){ + obj_ncombat.formation_set=2; + } + + + var _allow_fortifications=false; + var _fort_factions = [eFACTION.Player, eFACTION.Tyranids,eFACTION.Ork]; + _allow_fortifications = (array_contains(_fort_factions, _planet_data.current_owner)) + + if (!_allow_fortifications){ + var owner_fac_status + _allow_fortifications = (_planet_data.owner_status() != "War"); + } + + if (_allow_fortifications) then obj_ncombat.fortified=_planet_data.fortification_level; + + if (obj_ncombat.enemy==13) then obj_ncombat.fortified=0; + + obj_ncombat.battle_special=special; + obj_ncombat.battle_climate=_planet_data.planet_type; + + + //TODO recover and move to mopdern syntax + // show_message(string(battle_object[current_battle].p_feature[battle_world[current_battle]])); + /*if (scr_planetary_feature.plant_feature_bool(battle_object[current_battle].p_feature[battle_world[current_battle]], P_features.Monastery)==1){ + // show_message(string(battle_object[current_battle].p_defenses[battle_world[current_battle]])); + // show_message(string(battle_object[current_battle].p_silo[battle_world[current_battle]])); + obj_ncombat.player_defenses+=battle_object[current_battle].p_defenses[battle_world[current_battle]]; + obj_ncombat.player_silos+=battle_object[current_battle].p_silo[battle_world[current_battle]]; + }*/ + + if (_enemy == eFACTION.Imperium){ + obj_ncombat.threat=min(1000000,_planet_data.guardsmen); + } else if (obj_ncombat.enemy<14 && _enemy>5){ + obj_ncombat.threat = _planet_data.planet_forces[_enemy]; + } + else if (_enemy=30){ + obj_ncombat.threat=1; + } + + // + with (roster){ + //final check that there are in fact player units present + if (total_selected()){ + setup_battle_formations(); + add_to_battle(); + } + } + delete roster; + instance_deactivate_object(system); + } + +} + +function add_system_end_turn_fleet_battles(){ + + //IF no valid enemy or player fleets just skip this step + var _nearest_en_fleet = instance_nearest(x,y,obj_en_fleet); + if (_nearest_en_fleet.x != x && _nearest_en_fleet.y != y) { + exit; + } + + var _nearest_p_fleet = instance_nearest(x,y,obj_p_fleet); + + if (_nearest_p_fleet.x != x || _nearest_p_fleet.y != y || _nearest_p_fleet.action == "move") { + exit; + } + + var _orbiting_fleets = scr_orbiting_fleets_all(); + + if (!array_length(_orbiting_fleets)){ + exit; + } + var _largest_fleet = -1; + var _largest_score = 0; + + for (var i=0;i _largest_score){ + _largest_fleet = _cur_fleet.id; + _largest_score = _cur_largest; + } + } + + if (_largest_score <=0 || !instance_exists(_largest_fleet)){ + exit; + } + + var _fleet_battle = new EndTurnBattle(EndTurnBattleTypes.Fleet, self); + + _fleet_battle.opponent = _largest_fleet.owner; + + _fleet_battle.player_object = _nearest_p_fleet; + + if (fleet_has_cargo("warband", _largest_fleet)){ + _fleet_battle.special = "BLOOD"; + } + + if (fleet_has_cargo("csm", _largest_fleet)){ + _fleet_battle.special = "CSM"; + } + + _fleet_battle.add_to_stack(); + +} diff --git a/scripts/scr_end_turn_combat_helpers/scr_end_turn_combat_helpers.yy b/scripts/scr_end_turn_combat_helpers/scr_end_turn_combat_helpers.yy new file mode 100644 index 0000000000..e1420ee885 --- /dev/null +++ b/scripts/scr_end_turn_combat_helpers/scr_end_turn_combat_helpers.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"scr_end_turn_combat_helpers", + "isCompatibility":false, + "isDnD":false, + "name":"scr_end_turn_combat_helpers", + "parent":{ + "name":"Turn", + "path":"folders/Scripts/Turn.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml b/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml index 1a05acc620..b8ce8069dd 100644 --- a/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml +++ b/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml @@ -320,12 +320,12 @@ function scr_enemy_ai_a() { if (guard_score>=3) and (p_pdf[_run]<10000) then p_pdf[_run]*=(min(0.95, 0+pdf_loss_reduction)); if (guard_score>=2) and (p_pdf[_run]<2000) then p_pdf[_run]=0; if (guard_score>=1) and (p_pdf[_run]<200) then p_pdf[_run]=0; - if (_planet_data.population_influences[eFACTION.Tyranids] > 50 && _planet_data.has_feature(P_features.Gene_Stealer_Cult)){ + if (_planet_data.population_influences[eFACTION.Tyranids] > 50 && _planet_data.has_feature(P_features.GeneStealerCult)){ var _cur_influ = p_influence[_run][eFACTION.Tyranids]; var _influence_reduction = _cur_influ * (p_pdf[_run]/_pdf_before); adjust_influence(eFACTION.Tyranids,-min(_influence_reduction,_cur_influ-3) , _run); if (p_influence[_run][eFACTION.Tyranids] < 20){ - _planet_data.delete_feature(P_features.Gene_Stealer_Cult); + _planet_data.delete_feature(P_features.GeneStealerCult); } } } @@ -526,7 +526,7 @@ function scr_enemy_ai_a() { if (p_type[_run] == "Forge") { dispo[_run] -= 5; // 10 Disposition decrease for the planet govrnor if it's overrun by orks obj_controller.disposition[3] -= 5; // obj_controller.disposition[3] refer to the disposition of the toaster jocks. - } else if (planet_feature_bool(p_feature[_run], P_features.Sororitas_Cathedral) or(p_type[_run] == "Shrine")) { + } else if (planet_feature_bool(p_feature[_run], P_features.SororitasCathedral) or(p_type[_run] == "Shrine")) { dispo[_run] -= 10; // diso[_run] is the disposition of the planet. where _run refer to the planet that is currently running the code. obj_controller.disposition[5] -= 3; // obj_controller.disposition[2] refer to the disposition of the sororitas while 3 refer to mechanicus } else dispo[_run] -= 5; @@ -747,7 +747,7 @@ function scr_enemy_ai_a() { if (p_type[_run] == "Forge") { //visited variable check whether the star has been visisted or not 1 for true 0 for false dispo[_run] -= 10; // 10 Disposition decrease for the planet govrnor if it's overrun by necrons obj_controller.disposition[3] -= 10; // 10 dis decrease for the faction mechanicus - } else if (planet_feature_bool(p_feature[_run], P_features.Sororitas_Cathedral) or(p_type[_run] == "Shrine")) { + } else if (planet_feature_bool(p_feature[_run], P_features.SororitasCathedral) or(p_type[_run] == "Shrine")) { dispo[_run] -= 10; // 10 Disposition decrease for the planet govrnor if it's overrun by necrons obj_controller.disposition[5] -= 5; // 5 dis decrease for the Nurses } else dispo[_run] -= 10; @@ -776,9 +776,9 @@ function scr_enemy_ai_a() { p_necrons[_run]=after_combat_necrons; if (p_tyranids[_run] != after_combat_tyranids){ p_tyranids[_run] = after_combat_tyranids; - if (_planet_data.has_feature(P_features.Gene_Stealer_Cult)){ + if (_planet_data.has_feature(P_features.GeneStealerCult)){ adjust_influence(eFACTION.Tyranids,-min(p_influence[_run][eFACTION.Tyranids]-4, 5),_run); - var _cult = _planet_data.get_features(P_features.Gene_Stealer_Cult)[0]; + var _cult = _planet_data.get_features(P_features.GeneStealerCult)[0]; if (p_influence[_run][eFACTION.Tyranids]<5){ _cult.hiding = true; } @@ -814,10 +814,10 @@ function scr_enemy_ai_a() { }else if (p_owner[_run] = 10) { who_cleansed="Chaos" make_alert=true; - } else if (planet_feature_bool(p_feature[_run], P_features.Gene_Stealer_Cult) && p_tyranids[_run] <= 0){ + } else if (planet_feature_bool(p_feature[_run], P_features.GeneStealerCult) && p_tyranids[_run] <= 0){ who_cleansed="Gene Stealer Cult" make_alert=true; - delete_features(p_feature[_run], P_features.Gene_Stealer_Cult); + delete_features(p_feature[_run], P_features.GeneStealerCult); adjust_influence(eFACTION.Tyranids, -25, _run); } if (make_alert){ diff --git a/scripts/scr_enemy_ai_b/scr_enemy_ai_b.gml b/scripts/scr_enemy_ai_b/scr_enemy_ai_b.gml index 3ee0b01044..c893231048 100644 --- a/scripts/scr_enemy_ai_b/scr_enemy_ai_b.gml +++ b/scripts/scr_enemy_ai_b/scr_enemy_ai_b.gml @@ -18,7 +18,7 @@ function scr_enemy_ai_b() { total_garrison = cur_garrison.total_garrison; is_garrison_force = cur_garrison.garrison_force; - var planet_string = $"{string(name)} {scr_roman_numerals()[i - 1]}"; + var planet_string = planet_numeral_name(i); // Orks grow in number var ork_growth = floor(random(100)) + 1; success = false; // This part handles the increasing in numbers @@ -197,7 +197,7 @@ function scr_enemy_ai_b() { if (p_type[i] == "Forge") { dispo[i] -= 10; // 10 disposition decreases for the respective planet obj_controller.disposition[3] -= 3; // 10 disposition decrease for the toaster Fetishest since they aren't that numerous - } else if (planet_feature_bool(p_feature[i], P_features.Sororitas_Cathedral) || (p_type[i] == "Shrine")) { + } else if (planet_feature_bool(p_feature[i], P_features.SororitasCathedral) || (p_type[i] == "Shrine")) { dispo[i] -= 4; // similarly 10 disposition decrease, note those nurses are a bit pissy and // and you can't easily gain their favor because you cannot ask them to "step down" from office. obj_controller.disposition[5] -= 5; @@ -288,11 +288,10 @@ function scr_enemy_ai_b() { scr_alert("red", "owner", $"Massive heretic uprising on {n_name}.", x, y); scr_event_log("purple", $"Massive heretic uprising on {n_name}.", name); } // Huge uprising - if ((rando >= 100) && (p_traitors[i] < 5)) { p_traitors[i] = 6; p_owner[i] = 10; - array_push(p_feature[i], new NewPlanetFeature(P_features.Daemonic_Incursion)); + array_push(p_feature[i], new PlanetFeature(P_features.DaemonicIncursion)); if (p_heresy[i] >= 80) { p_heresy[i] = 95; @@ -307,61 +306,10 @@ function scr_enemy_ai_b() { scr_alert("red", "owner", tixt, x, y); scr_event_log("purple", tixt, name); } - // if (p_traitors[i]>2){obj_controller.x=self.x;obj_controller.y=self.y;} - } // End traitors cult - } - // Genestealer cults grow in number - if (planet_feature_bool(p_feature[i], P_features.Gene_Stealer_Cult)) { - var cult = return_planet_features(p_feature[i], P_features.Gene_Stealer_Cult)[0]; - cult.cult_age++; - adjust_influence(eFACTION.Tyranids, cult.cult_age / 100, i); - var planet_garrison = system_garrison[i - 1]; - if (cult.hiding) { - var find_nid_chance = 50 - planet_garrison.total_garrison; - if (p_influence[i][eFACTION.Tyranids] > 50) { - var find_cult_chance = irandom(50); - var alert_text = $"A hidden Genestealer Cult in {name} Has suddenly burst forth from hiding!"; - if (planet_garrison.garrison_force) { - var alert_text = $"A hidden Genestealer Cult in {name} Has been discovered by marine garrison!"; - find_cult_chance -= 25; - } - if (find_cult_chance < 1) { - cult.hiding = false; - scr_popup("System Lost", alert_text, "Genestealer Cult", ""); - owner = eFACTION.Tyranids; - scr_event_log("red", $"A hidden Genestealer Cult in {name} {i} has Started a revolt.", name); - p_tyranids[i] += 1; - } - } } - if ((!cult.hiding) && (p_tyranids[i] <= 3) && (p_type[i] != "Space Hulk") && (p_influence[i][eFACTION.Tyranids] > 10)) { - var spread = 0; - rando = irandom(150); - rando -= p_influence[i][eFACTION.Tyranids]; - if (rando <= 15) { - spread = 1; - } - - if ((p_type[i] == "Lava") && (p_tyranids[i] == 2)) { - spread = 0; - } - if (((p_type[i] == "Ice") || (p_type[i] == "Desert")) && (p_tyranids[i] == 3)) { - spread = 0; - } - - if (spread == 1) { - p_tyranids[i] += 1; - } - } - if (p_influence[i][eFACTION.Tyranids] > 55) { - p_owner[i] = eFACTION.Tyranids; - } - } else if (p_influence[i][eFACTION.Tyranids] > 5) { - adjust_influence(eFACTION.Tyranids, -1, i); - if ((irandom(200) + (p_influence[i][eFACTION.Tyranids] / 10)) > 195) { - array_push(p_feature[i], new NewPlanetFeature(P_features.Gene_Stealer_Cult)); - } - } + } + // Genestealer cults grow in number + genestealer_cult_end_turn_growth(i); // Spread influence on controlled sector if ((p_type[i] != "Space Hulk") && (p_type[i] != "Dead")) { @@ -470,7 +418,7 @@ function scr_enemy_ai_b() { if (p_type[i] == "Forge") { dispo[i] -= 10; // 10 disposition decreases for the respective planet obj_controller.disposition[eFACTION.Mechanicus] -= 10; // 10 disposition decrease for the toaster Fetishest since they aren't that many toasters in 41 millennia - } else if (planet_feature_bool(p_feature[i], P_features.Sororitas_Cathedral) || (p_type[i] == "Shrine")) { + } else if (planet_feature_bool(p_feature[i], P_features.SororitasCathedral) || (p_type[i] == "Shrine")) { dispo[i] -= 10; // 10 disposition decreases for the respective planet obj_controller.disposition[5] -= 5; } else { diff --git a/scripts/scr_enemy_ai_c/scr_enemy_ai_c.gml b/scripts/scr_enemy_ai_c/scr_enemy_ai_c.gml index 33b4d73bf4..020742899c 100644 --- a/scripts/scr_enemy_ai_c/scr_enemy_ai_c.gml +++ b/scripts/scr_enemy_ai_c/scr_enemy_ai_c.gml @@ -226,7 +226,8 @@ function scr_enemy_ai_c() { - contin=0;rando=floor(random(100))+1;// This part handles the ship building + contin=0; + rando=floor(random(100))+1;// This part handles the ship building if (planets=1) and (p_owner[1]=8) then contin=1; if (planets=2) and (p_owner[1]=8) and (p_owner[2]=8) then contin=1; @@ -329,48 +330,7 @@ function scr_enemy_ai_c() { } } - - - // Tyranids here - var i=0; - repeat(planets){i+=1; - if (p_tyranids[i]>=5) and (planets>=i) and (p_player[i]+p_orks[i]+p_guardsmen[i]+p_pdf[i]+p_chaos[i]=0){ - var ship=scr_orbiting_fleet(eFACTION.Tyranids); - if (ship!="none") and (p_type[i]!="Dead") and (array_length(p_feature[i])!=0){ - if (ship.capital_number>0){ - if (planet_feature_bool(p_feature[i], P_features.Reclamation_pools) ==1){ - p_tyranids[i]=0; - if (p_type[i]="Death") or (p_type[i]="Hive") then ship.capital_number+=choose(0,1,1); - ship.capital_number+=1; - ship.escort_number+=3; - ship.image_index=floor((ship.capital_number)+(ship.frigate_number/2)+(ship.escort_number/4)); - p_type[i]="Dead"; - delete_features(p_feature[i], P_features.Reclamation_pools);// show_message("D"); - if (planets=1) and (p_type[1]="Dead") then image_alpha=0.33; - if (planets=2) and (p_type[1]="Dead") and (p_type[2]="Dead") then image_alpha=0.33; - if (planets=3) and (p_type[1]="Dead") and (p_type[2]="Dead") and (p_type[3]="Dead") then image_alpha=0.33; - if (planets=4) and (p_type[1]="Dead") and (p_type[2]="Dead") and (p_type[3]="Dead") and (p_type[4]="Dead") then image_alpha=0.33; - - - // if image_alpha = 0.33 then send the ship somewhere new - - } - if (planet_feature_bool(p_feature[i], P_features.Capillary_Towers)==1) and (p_type[i]!="Dead"){ - p_population[i]=floor(p_population[i]*0.3); - } - if (planet_feature_bool(p_feature[i], P_features.Capillary_Towers)==1) and (p_type[i]!="Dead"){ - p_feature[i]=[]; - array_push(p_feature[i], new NewPlanetFeature(P_features.Capillary_Towers), new NewPlanetFeature(P_features.Reclamation_pools)); - p_population[i]=0;// show_message("C"); - } - if (planet_feature_bool(p_feature[i], P_features.Capillary_Towers)==0) and (planet_feature_bool(p_feature[i], P_features.Reclamation_pools)==0) and (p_type[i]!="Dead"){ - array_push(p_feature[i], new NewPlanetFeature(P_features.Capillary_Towers));// show_message("B"); - } - } - } - } - } - + tyranids_planet_biomass_extraction(); with(obj_star){ diff --git a/scripts/scr_enemy_ai_d/scr_enemy_ai_d.gml b/scripts/scr_enemy_ai_d/scr_enemy_ai_d.gml index 974fb2790c..811edc2525 100644 --- a/scripts/scr_enemy_ai_d/scr_enemy_ai_d.gml +++ b/scripts/scr_enemy_ai_d/scr_enemy_ai_d.gml @@ -95,7 +95,7 @@ function scr_enemy_ai_d() { if (result="imperial"){alert_text+="."; scr_alert("green","succession",alert_text,x,y); } - delete_features(p_feature[i], P_features.Succession_War); + delete_features(p_feature[i], P_features.SuccessionWar); if (result="chaos") then scr_event_log("purple",alert_text); if (result="tau") then scr_event_log("red",alert_text); if (result="imperial") then scr_event_log("",alert_text); @@ -244,91 +244,26 @@ function scr_enemy_ai_d() { } } - if ((p_tyranids[i]=3) or (p_tyranids[i]=4)) and (p_population[i]>0){ + if (p_tyranids[i] > 3 && planet_feature_bool(p_feature[i], P_features.GeneStealerCult) && obj_controller.turn > 120){ if (!(has_problem_planet(i, "Hive Fleet"))){ - var roll=irandom_range(100,300); + var roll=irandom_range(0,300); var cont=0; if (p_tyranids[i]=3) and (roll<=5) then cont=1; if (p_tyranids[i]=4) and (roll<=8) then cont=1; - var firstest=open_problem_slot(i); - if (cont=1 && firstest>-1){ - - p_problem[i][firstest]="Hive Fleet"; - p_timer[i][firstest]=irandom_range(60,120)+1; - p_timer[i][firstest]+=irandom_range(80,120)+1; - // p_timer[i][firstest]=floor(random_range(3,6))+1; - // show_message("Hive Fleet Destination: "+string(name)+"#ETA: "+string(p_timer[i][firstest])); - - - var fleet, xx, yy; - xx=random_range(room_width*1.25,room_width*2); - xx=choose(xx*-1,xx); - xx=x+xx; - yy=random_range(room_height*1.25,room_height*2); - yy=choose(yy*-1,yy); - yy=y+yy; - fleet=instance_create(xx,yy,obj_en_fleet); - fleet.owner = eFACTION.Tyranids; - fleet.sprite_index=spr_fleet_tyranid; - fleet.image_speed=0; - - fleet.capital_number=choose(7,8,9); - fleet.frigate_number=round(random_range(6,12)); - fleet.escort_number=round(random_range(12,27)); - - /*fleet.capital_number=choose(5,6); - fleet.frigate_number=round(random_range(4,8)); - fleet.escort_number=round(random_range(8,18));*/ - - fleet.image_index=floor((fleet.capital_number)+(fleet.frigate_number/2)+(fleet.escort_number/4)); - fleet.image_alpha=0; - - fleet.action_x=x; - fleet.action_y=y; - - fleet.action_eta=p_timer[i][firstest]; - fleet.action="move"; + if (cont = 1 && firstest > -1){ + var _capitals = choose(7,8,9); + var _frigates = irandom_range(6,12); + var _escorts = irandom_range(12,27); + var _fleet = summon_new_hive_fleet(_capitals, _frigates, _escorts); + add_new_problem(i, "Hive Fleet", _fleet.action_eta, self, {}); } - - } } - - if (has_problem_planet_and_time(i,"Hive Fleet", 3)>-1){ - var woop=scr_role_count("Chief "+string(obj_ini.role[100,17]),""); - - var o,yep,yep2;o=0;yep=true;yep2=false; - if (scr_has_disadv("Psyker Intolerant")) then yep=false; - - if (obj_controller.known[eFACTION.Tyranids]=0) and (woop!=0) and (yep!=false){ - scr_popup("Shadow in the Warp",$"Chief {obj_ini.role[100,17]} "+string(obj_ini.name[0,5])+" reports a disturbance in the warp. He claims it is like a shadow.","shadow",""); - scr_event_log("red",$"Chief {obj_ini.role[100,17]} reports a disturbance in the warp. He claims it is like a shadow."); - } - if (obj_controller.known[eFACTION.Tyranids]=0) and (woop=0) and (yep!=false){ - var q=0,q2=0; - repeat(90){ - if (q2=0){q+=1; - if (obj_ini.role[0,q]==obj_ini.role[100][eROLE.ChapterMaster]){q2=q; - if (string_count("0",obj_ini.spe[0,q2])>0) then yep2=true; - } - } - } - if (yep2=true){ - scr_popup("Shadow in the Warp","You are distracted and bothered by a nagging sensation in the warp. It feels as though a shadow descends upon your sector.","shadow",""); - scr_event_log("red","You sense a disturbance in the warp. It feels something like a massive shadow."); - } - } - - - - g=50; - i=50; - obj_controller.known[eFACTION.Tyranids]=1; - } + hive_fleet_arrives_from_out_of_system(); } @@ -347,11 +282,12 @@ function scr_enemy_ai_d() { } } - - // Colonists Colonize - - with(obj_star){if (x<-10000){x+=20000;y+=20000;}} - with(obj_star){if (x<-10000){x+=20000;y+=20000;}} + with(obj_star){ + if (x<-10000){ + x+=20000; + y+=20000; + } + } var already_enroute = false; var cur_star = id; diff --git a/scripts/scr_enemy_ai_e/scr_enemy_ai_e.gml b/scripts/scr_enemy_ai_e/scr_enemy_ai_e.gml index 7764e2e567..141e11589b 100644 --- a/scripts/scr_enemy_ai_e/scr_enemy_ai_e.gml +++ b/scripts/scr_enemy_ai_e/scr_enemy_ai_e.gml @@ -385,58 +385,7 @@ function scr_enemy_ai_e() { } // End AI battle if (battle > 0) { - if (present_fleet[1] > 0) and((present_fleet[6] + present_fleet[7] + present_fleet[8] + present_fleet[9] + present_fleet[10] + present_fleet[13] > 0) or((present_fleet[2] > 0) and(obj_controller.faction_status[2] = "War"))) { - var i, onceh; - i = 1; - onceh = 0; - - repeat(9) { - i += 1; - var special_stop = false;; - if (i = 10) or(i = 11) { - special_stop = has_problem_star("meeting")||has_problem_star("meeting_trap"); - } - - if (obj_controller.faction_status[i] = "War") and(onceh = 0) and(!special_stop) { // Quene battle - obj_turn_end.battles += 1; - obj_turn_end.battle[obj_turn_end.battles] = 1; - obj_turn_end.battle_world[obj_turn_end.battles] = -50; - obj_turn_end.battle_opponent[obj_turn_end.battles] = i; // Who triggered it first - obj_turn_end.battle_location[obj_turn_end.battles] = name; - // obj_turn_end.battle_object[obj_turn_end.battles]=instance_nearest(x,y,obj_en_fleet); - obj_turn_end.battle_pobject[obj_turn_end.battles] = instance_nearest(x, y, obj_p_fleet); - - if (i = 10) { - obj_controller.temp[1049] = string(name); - with(obj_temp2) { - instance_destroy(); - } - with(obj_temp3) { - instance_destroy(); - } - with(obj_en_fleet) { - if (action = "") and(orbiting = obj_controller.temp[1049]) and(owner = 10) { - if (string_count("warband", trade_goods) > 0) then instance_create(x, y, obj_temp2); - if (string_lower(trade_goods) = "csm") then instance_create(x, y, obj_temp3); - } - } - if (instance_exists(obj_temp2)) { - obj_turn_end.battle_special[obj_turn_end.battles] = "BLOOD"; - with(obj_temp2) { - instance_destroy(); - } - } - if (instance_exists(obj_temp3)) { - obj_turn_end.battle_special[obj_turn_end.battles] = "CSM"; - with(obj_temp2) { - instance_destroy(); - } - } - } - onceh = 1; - } - } - } + add_system_end_turn_fleet_battles(); } instance_activate_object(obj_p_fleet); @@ -483,37 +432,17 @@ function scr_enemy_ai_e() { tixt += " seems to have vanished, presumably gone into hiding."; scr_popup("Spyrer Rampage", tixt, "spyrer", ""); } else if ((p_player[run] <= 20)){ - obj_turn_end.battles += 1; - obj_turn_end.battle[obj_turn_end.battles] = 1; - obj_turn_end.battle_world[obj_turn_end.battles] = run; - obj_turn_end.battle_opponent[obj_turn_end.battles] = 30; - obj_turn_end.battle_location[obj_turn_end.battles] = name; - obj_turn_end.battle_object[obj_turn_end.battles] = id; - obj_turn_end.battle_special[obj_turn_end.battles] = "spyrer"; + var _battle = new EndTurnBattle(EndTurnBattleTypes.Ground, self); + _battle.planet = run; + _battle.battle_special = "spyrer"; + _battle.battle_opponent = 30; + + _battle.add_to_stack(); } } if (p_player[run] > 0) and (has_problem_planet(run, "fallen")) { - var chan; - chan = choose(1, 2, 3, 4); - if (chan <= 2) { - obj_turn_end.battles += 1; - obj_turn_end.battle[obj_turn_end.battles] = 1; - obj_turn_end.battle_world[obj_turn_end.battles] = run; - obj_turn_end.battle_opponent[obj_turn_end.battles] = 10; - obj_turn_end.battle_location[obj_turn_end.battles] = name; - obj_turn_end.battle_object[obj_turn_end.battles] = id; - if (chan = 1) then obj_turn_end.battle_special[obj_turn_end.battles] = "fallen1"; - if (chan = 2) then obj_turn_end.battle_special[obj_turn_end.battles] = "fallen2"; - - }else if (chan >= 3) { - if (remove_planet_problem(run, "fallen")){ - tixt = "Your marines have scoured " + planet_numeral_name(run); - tixt += " in search of the Fallen. Despite their best efforts, and meticulous searching, none have been found. It appears as though the information was faulty or out of date."; - scr_popup("Hunt the Fallen", tixt, "fallen", ""); - scr_event_log("", $"Mission Successful: No Fallen located upon {planet_numeral_name(run)}"); - } - } + setup_fallen_capture_battle(); } } if (p_player[run] > 0 && has_problem_planet(run,"necron")){ @@ -583,13 +512,10 @@ function scr_enemy_ai_e() { // other battle crap here if (battle_opponent > 0) { - // obj_controller.x=self.x;obj_controller.y=self.y; - obj_turn_end.battles += 1; - obj_turn_end.battle[obj_turn_end.battles] = 1; - obj_turn_end.battle_world[obj_turn_end.battles] = run; - obj_turn_end.battle_opponent[obj_turn_end.battles] = battle_opponent; - obj_turn_end.battle_location[obj_turn_end.battles] = name; - obj_turn_end.battle_object[obj_turn_end.battles] = id; + var _battle = new EndTurnBattle(EndTurnBattleTypes.Ground, self); + _battle.planet = run; + _battle.battle_opponent = battle_opponent; + _battle.add_to_stack(); } } } @@ -659,10 +585,10 @@ function scr_enemy_ai_e() { if (upgrade_type == P_features.Arsenal) { display_type = "Arsenal"; obj_controller.und_armouries++; - }else if (upgrade_type == P_features.Secret_Base) { + }else if (upgrade_type == P_features.SecretBase) { display_type = "Lair"; obj_controller.und_lairs++; - }else if (upgrade_type == P_features.Gene_Vault) { + }else if (upgrade_type == P_features.GeneVault) { display_type = "Gene Vault"; obj_controller.und_gene_vaults++; } @@ -670,7 +596,7 @@ function scr_enemy_ai_e() { scr_alert("green", "owner", string(tx), x, y); scr_event_log("", string(tx)); } - if (upgrade.built<=obj_controller.turn && upgrade_type == P_features.Secret_Base){ + if (upgrade.built<=obj_controller.turn && upgrade_type == P_features.SecretBase){ if (upgrade.forge > 0){ obj_controller.player_forge_data.player_forges+=sqr(upgrade.forge_data.size); if (upgrade.forge_data.vehicle_hanger){ diff --git a/scripts/scr_enemy_fleet_spawn_combat/scr_enemy_fleet_spawn_combat.gml b/scripts/scr_enemy_fleet_spawn_combat/scr_enemy_fleet_spawn_combat.gml new file mode 100644 index 0000000000..8d47d67537 --- /dev/null +++ b/scripts/scr_enemy_fleet_spawn_combat/scr_enemy_fleet_spawn_combat.gml @@ -0,0 +1,868 @@ +function start_enemy_fleet_spawn(){ + + show_debug_message("start spawning enemy fleet"); + + var total_enemies=0; + var total_allies=1; + var spawner=0; + var t=0,y1=0,y2=0,tt=0; + + for (var t=0;t0){ + total_allies++; + } + + // show_message("Computer "+string(t)+":"+string(enemy[t])+", status:"+string(enemy_status[t])); + } + } + + + + if (total_enemies>0){ + t=1; + y2=room_height/total_enemies/2;tt=0; + for (var fug=0;fug0){ + y1=0; + t=1; + y2=room_height/total_allies/2; + tt=0; + for (var fug=0;fug0){ + tt+=1; + y1=(t*y2); + + spawner=instance_create(200,y1,obj_fleet_spawner); + + if (fug=1) then spawner.owner = eFACTION.Player; + if (fug>1) then spawner.owner=enemy[fug];// Get the ENEMY after the actual enemies + + spawner.height=(y2); + spawner.number=fug; + + t+=2; + } + } + } + + + // show_message("Total Enemies: "+string(total_enemies)); + // show_message("Total Allies: "+string(total_allies)); + + + // Buffs here + // if (ambushers=1) or (enemy=8) then + attack_mode="offensive"; + // if (enemy=9) then attack_mode="defensive"; + + if (ambushers=1 && ambushers=999) then global_attack=global_attack*1.1;// Need to finish this + if (bolter_drilling=1) then global_bolter=global_bolter*1.1; + // if (enemy_eldar=1) and (enemy=6){global_attack=global_attack*1.1;global_defense=global_defense*1.1;} + // if (enemy_fallen=1) and (enemy=10){global_attack=global_attack*1.1;global_defense=global_defense*1.1;} + // if (enemy_orks=1) and (enemy=7){global_attack=global_attack*1.1;global_defense=global_defense*1.1;} + // if (enemy_tau=1) and (enemy=8){global_attack=global_attack*1.1;global_defense=global_defense*1.1;} + // if (enemy_tyranids=1) and (enemy=10){global_attack=global_attack*1.1;global_defense=global_defense*1.1;} + if (siege=1) and (siege=555) then global_attack=global_attack*1.2;// Need to finish this + if (slow=1){global_attack=global_attack*0.9;global_defense=global_defense*1.2;} + if (melee=1) then global_melee=global_melee*1.15; + // + if (shitty_luck=1){ + global_defense=global_defense*0.9; + } + // if (lyman=1) and (dropping=1) then ||| handle within each object + if (ossmodula=1){ + global_attack=global_attack*0.95; + global_defense=global_defense*0.95; + } + if (betchers=1){ + global_melee=global_melee*0.95; + } + if (catalepsean=1){ + global_attack=global_attack*0.95; + } + // if (occulobe=1){if (time=5) or (time=6) then global_attack=global_attack*0.7;global_defense=global_defense*0.9;} + + // More prep for player + + var i=0,k=0,onceh=0; + + // instance_activate_object(obj_combat_info); + + capital_max=capital; + frigate_max=frigate; + escort_max=escort; + // alarm[1]=2;s + /* */ + /* */ +} + + +function setup_fleet_spawn_characteristics(){ + + show_debug_message("enemy fleet characteristics"); + + + var i=0,k=0,x2=224,hei=0,man=0,sizz=0; + + + if (owner!=1){ + + en_escort=obj_fleet.en_escort[number]; + en_frigate=obj_fleet.en_frigate[number]; + en_capital=obj_fleet.en_capital[number]; + + + if (owner = eFACTION.Imperium){ + if (en_escort>0){ + en_column[4]="Sword Class Frigate"; + en_num[4]=en_escort; + en_size[4]=1; + } + + if (en_frigate>0){ + en_column[3]="Avenger Class Grand Cruiser"; + en_num[3]=en_frigate; + en_size[3]=2; + } + + var i=0; + i=en_capital; + if (i>0){ + en_column[2]="Apocalypse Class Battleship"; + en_num[2]=floor(random(i))+1; + if (en_num[2]<(en_capital*0.6)){ + en_num[2]=round(en_capital*0.6); + } + i-=en_num[2]; + en_size[2]=3; + } + + if (i>0){ + en_column[1]="Nemesis Class Fleet Carrier"; + en_num[1]=i; + i-=en_num[1]; + en_size[1]=3;} + } + + + + if (owner = eFACTION.Eldar){ + if (en_escort>0){ + en_column[4]="Aconite"; + en_num[4]=max(1,floor(en_escort/2)); + en_size[4]=1;} + if (en_escort>1){ + en_column[3]="Hellebore"; + en_num[3]=max(1,floor(en_escort/2)); + en_size[3]=1;} + if (en_frigate>0){ + en_column[2]="Shadow Class"; + en_num[2]=en_frigate; + en_size[2]=2;} + if (en_capital>0){ + en_column[1]="Void Stalker"; + en_num[1]=en_capital; + en_size[1]=3;} + } + + + + + if (owner = eFACTION.Ork){ + var i; + i=0; + i=en_capital; + + if (i>0){ + en_column[1]="Dethdeala"; + en_num[1]=floor(random(i))+1; + i-=en_num[1]; + en_size[1]=3; + } + + if (i>0){ + en_column[2]="Gorbag's Revenge"; + en_num[2]=floor(random(i))+1; + i-=en_num[2]; + en_size[2]=3; + }// en_num[2]+=en_num[1]+1; + + if (i>0){ + en_column[3]="Kroolboy"; + en_num[3]=i; + i-=en_num[3]; + en_size[3]=3; + }// en_num[3]+=en_num[2]+1; + + if (en_frigate>0){ + en_column[4]="Battlekroozer"; + en_num[4]=en_frigate; + en_size[4]=2; + }// en_num[4]+=en_num[3]+1; + + if (en_escort>0){ + en_column[5]="Ravager"; + en_num[5]=en_escort; + en_size[5]=1; + }// en_num[5]+=en_num[4]+1; + } + + if (owner = eFACTION.Tau){ + var i; + i=0; + i=en_frigate; + + if (en_capital>0){ + en_column[1]="Custodian"; + en_num[1]=en_capital; + en_size[1]=3;} + + if (i>0){ + en_column[2]="Emissary"; + en_num[2]=1; + i-=en_num[2]; + en_size[2]=2;} + + if (i>0){ + en_column[3]="Protector"; + en_num[3]=i; + i-=en_num[3]; + en_size[3]=2;}// en_num[3]+=en_num[2]+1; + + if (en_escort>0){ + en_column[4]="Castellan"; + en_num[4]=round((en_escort/3)*2); + en_size[4]=1;} + + if (en_escort>2){ + en_column[5]="Warden"; + en_num[5]=en_escort-en_num[5]; + en_size[5]=1;} + } + + if (owner = eFACTION.Tyranids){ + var i; + i=0; + i=en_escort; + + if (en_capital>0){ + en_column[1]="Leviathan"; + en_num[1]=en_capital; + en_size[1]=3;} + + if (i>0){ + en_column[2]="Stalker"; + en_num[2]=floor(i/3)+1; + i-=en_num[2]; + en_size[2]=1;} + + if (en_frigate>0){ + en_column[3]="Razorfiend"; + en_num[3]=en_frigate; + en_size[3]=2;}// en_num[2]+=en_num[1]+1; + + if (i>0){ + en_column[4]="Prowler"; + en_num[4]=i; + en_size[4]=1;}// en_num[5]+=en_num[4]+1; + } + + if (owner = eFACTION.Chaos){ + var i; + i=0; + i=en_frigate; + + if (en_capital>0){ + en_column[1]="Desecrator"; + en_num[1]=en_capital; + en_size[1]=3;} + + if (i>0){ + en_column[2]="Avenger"; + en_num[2]=floor(random(i))+1; + i-=en_num[2]; + en_size[2]=2;} + + if (i>0){ + en_column[3]="Carnage"; + en_num[3]=floor(random(i))+1; + i-=en_num[3]; + en_size[3]=2;}// en_num[2]+=en_num[1]+1; + + if (i>0){ + en_column[4]="Daemon"; + en_num[4]=i; + i-=en_num[4]; + en_size[4]=2;}// en_num[3]+=en_num[2]+1; + + if (en_escort>0){ + en_column[5]="Iconoclast"; + en_num[5]=en_escort; + en_size[5]=1;}// en_num[5]+=en_num[4]+1; + } + + if (owner = eFACTION.Necrons){ + var i; + i=0; + i=en_escort; + + if (en_capital>0){ + en_column[1]="Reaper Class"; + en_num[1]=en_capital; + en_size[1]=3;} + // Cairn Class Tombship are very rare + + if (i>0){ + en_column[2]="Shroud Class"; + en_num[2]=en_frigate; + en_size[2]=2;} + + if (i>0){ + en_column[3]="Jackal Class"; + en_num[3]=round(i/2); + i-=en_num[3]; + en_size[3]=1;} + if (en_escort>0){ + en_column[4]="Dirge Class"; + en_num[4]=i; + en_size[4]=1;} + } + + + + + var i; + i=0; + repeat(5){i+=1; + if (en_column[i]="Avenger Class Grand Cruiser"){ + en_width[i]=196; + en_height[i]=96;} + if (en_column[i]="Apocalypse Class Battleship"){ + en_width[i]=272; + en_height[i]=128;} + if (en_column[i]="Nemesis Class Fleet Carrier"){ + en_width[i]=272; + en_height[i]=128;} + if (en_column[i]="Sword Class Frigate"){ + en_width[i]=96; + en_height[i]=64;} + + if (en_column[i]="Void Stalker"){ + en_width[i]=260; + en_height[i]=192;} + if (en_column[i]="Shadow Class"){ + en_width[i]=212; + en_height[i]=160;} + if (en_column[i]="Hellebore"){ + en_width[i]=160; + en_height[i]=64;} + if (en_column[i]="Aconite"){ + en_width[i]=128; + en_height[i]=64;} + + if (en_column[i]="Deathdeala"){ + en_width[i]=196; + en_height[i]=128;} + if (en_column[i]="Gorbag's Revenge"){ + en_width[i]=196; + en_height[i]=128;} + if (en_column[i]="Kroolboy"){ + en_width[i]=196; + en_height[i]=128;} + if (en_column[i]="Slamblasta"){ + en_width[i]=196; + en_height[i]=128;} + if (en_column[i]="Battlekroozer"){ + en_width[i]=160; + en_height[i]=96;} + if (en_column[i]="Ravager"){ + en_width[i]=128; + en_height[i]=64;} + + if (en_column[i]="Desecrator"){ + en_width[i]=196; + en_height[i]=128;} + if (en_column[i]="Avenger"){ + en_width[i]=160; + en_height[i]=96;} + if (en_column[i]="Carnage"){ + en_width[i]=160; + en_height[i]=96;} + if (en_column[i]="Daemon"){ + en_width[i]=160; + en_height[i]=96;} + if (en_column[i]="Iconoclast"){ + en_width[i]=128; + en_height[i]=64;} + + if (en_column[i]="Custodian"){ + en_width[i]=128; + en_height[i]=256;} + if (en_column[i]="Emissary"){ + en_width[i]=160; + en_height[i]=96;} + if (en_column[i]="Protector"){ + en_width[i]=64; + en_height[i]=180;} + if (en_column[i]="Castellan"){ + en_width[i]=48; + en_height[i]=96;} + if (en_column[i]="Warden"){ + en_width[i]=48; + en_height[i]=80;} + + if (en_column[i]="Leviathan"){ + en_width[i]=200; + en_height[i]=128;} + if (en_column[i]="Razorfiend"){ + en_width[i]=160; + en_height[i]=128;} + if (en_column[i]="Stalker"){ + en_width[i]=96; + en_height[i]=64;} + if (en_column[i]="Prowler"){ + en_width[i]=80; + en_height[i]=64;} + + if (en_column[i]="Cairn Class Tombship"){ + en_width[i]=256; + en_height[i]=224;} + if (en_column[i]="Reaper Class"){ + en_width[i]=286; + en_height[i]=161;} + if (en_column[i]="Shroud Class"){ + en_width[i]=200; + en_height[i]=150;} + if (en_column[i]="Jackal Class"){ + en_width[i]=99; + en_height[i]=123;} + if (en_column[i]="Dirge Class"){ + en_width[i]=100; + en_height[i]=91;} + } + } + + wait_and_execute(3, position_ships_and_assign_stats,[] , self); +} + + +function position_ships_and_assign_stats(){ + show_debug_message("assign ship stats"); + + if (owner = eFACTION.Imperium) or (owner = eFACTION.Eldar){// This is an orderly Imperial ship formation + var xx,yy,i, temp1, x2, man; + xx=0;yy=0; + i=0;temp1=0;x2=0; + man=0; + var fuck=0; + if (obj_fleet.enemy_status[number]<0){ + x2=room_width-800; + fuck=5 + }else if (obj_fleet.enemy_status[number]>0){ + x2=50; + fuck=0; + } + + repeat(4){ + if (obj_fleet.enemy_status[number]<0) then fuck-=1; + if (obj_fleet.enemy_status[number]>0) then fuck+=1; + + yy=y-((en_height[fuck]*en_num[fuck])/2); + if (en_num[fuck]>0){ + yy+=(en_height[fuck]/2); + repeat(en_num[fuck]){ + if (en_size[fuck]<3){ + if (obj_fleet.enemy_status[number]<0){ + man=instance_create(x2,yy,obj_en_cruiser); + yy+=en_height[fuck]; + man.class=en_column[fuck]; + man.owner=owner; + man.size=en_size[fuck]; + } + if (obj_fleet.enemy_status[number]>0){ + man=instance_create(x2,yy,obj_al_cruiser); + yy+=en_height[fuck]; + man.class=en_column[fuck]; + man.owner=owner; + man.size=en_size[fuck]; + } + } + if (en_size[fuck]>=3){ + if (obj_fleet.enemy_status[number]<0){ + man=instance_create(x2,yy,obj_en_capital); + yy+=en_height[fuck]; + man.class=en_column[fuck]; + man.owner=owner; + man.size=en_size[fuck]; + } + else if (obj_fleet.enemy_status[number]>0){ + man=instance_create(x2,yy,obj_al_capital); + yy+=en_height[fuck]; + man.class=en_column[fuck]; + man.owner=owner; + man.size=en_size[fuck];} + } + } + x2+=en_width[fuck]; + } + } + + + + /* + if (en_num[4]>0){ + yy=y-((en_height[4]*en_num[4])/2); + yy+=(en_height[4]/2); + repeat(en_num[4]){ + man=instance_create(x2,yy,obj_en_cruiser); + yy+=en_height[4]; + man.class=en_column[4]; + man.owner=owner; + } + x2+=en_width[4]; + } + if (en_num[3]>0){ + yy=y-((en_height[3]*en_num[3])/2); + yy+=(en_height[3]/2); + repeat(en_num[3]){ + man=instance_create(x2,yy,obj_en_cruiser); + yy+=en_height[3]; + man.class=en_column[3]; + man.owner=owner; + } + x2+=en_width[3]; + } + if (en_num[2]>0){ + yy=y-((en_height[2]*en_num[2])/2); + yy+=(en_height[2]/2); + repeat(en_num[2]){ + man=instance_create(x2,yy,obj_en_capital); + yy+=en_height[2]; + man.class=en_column[2]; + man.owner=owner; + } + x2+=en_width[2]; + } + if (en_num[1]>0){ + yy=256; + repeat(en_num[1]){ + man=instance_create(x2,yy,obj_en_capital); + yy+=en_height[1]; + man.class=en_column[1]; + man.owner=owner; + yy+=(en_height[1]); + } + }*/ + } + + + + + + + /* + if (en_escort>0){ + en_column[4]="Aconite"; + en_num[4]=max(1,floor(en_escort/2)); + en_size[4]=1;} + if (en_escort>1){ + en_column[3]="Hellebore"; + en_num[3]=max(1,floor(en_escort/2)); + en_size[3]=1;} + if (en_frigate>0){ + en_column[2]="Shadow Class"; + en_num[2]=en_frigate; + en_size[2]=2;} + if (en_capital>0){ + en_column[1]="Void Stalker"; + en_num[1]=en_capital; + en_size[1]=3;} + */ + + + /* + if (owner = eFACTION.Eldar){// This is an orderly Eldar ship formation + var xx,yy,i, temp1, x2, man; + xx=0;yy=0; + i=0;temp1=0;x2=1200; + man=0; + + if (en_num[4]>0){ + yy=128; + repeat(en_num[4]){ + man=instance_create(x2,yy,obj_en_cruiser); + yy+=en_height[4]; + man.class=en_column[4]; + man.owner=owner; + } + } + if (en_num[3]>0){ + yy=room_height-128; + repeat(en_num[3]){ + man=instance_create(x2,yy,obj_en_cruiser); + yy-=en_height[3]; + man.class=en_column[3]; + man.owner=owner; + } + } + x2+=max(en_width[3],en_width[4]); + + if (en_num[2]>0){ + yy=y-((en_height[2]*en_num[2])/2); + yy+=(en_height[2]/2); + repeat(en_num[2]){ + man=instance_create(x2,yy,obj_en_capital); + yy+=en_height[2]; + man.class=en_column[2]; + man.owner=owner; + } + x2+=en_width[2]; + } + if (en_num[1]>0){ + yy=256; + repeat(en_num[1]){ + man=instance_create(x2,yy,obj_en_capital); + yy+=en_height[1]; + man.class=en_column[1]; + man.owner=owner; + yy+=(en_height[1]); + } + } + }*/ + + + + + + + if (owner = eFACTION.Ork || owner = eFACTION.Chaos){// This is spew out random ships without regard for formations + var xx = 0,yy = 0,target_distance = 0,targ = 0,numb = 0,man = 0; + + var i; + i=0; + + repeat(5){ + + i+=1; + + if (en_column[i]!="") then for(s = 0; s < en_num[i]; s += 1){ + var _x = room_width-irandom_range(700, 950); + var _y = irandom_range(y,y+height)+50; + if (en_size[i]>1){ + man=instance_create(_x ,_y ,obj_en_capital); + } + else if (en_size[i]==2){ + man=instance_create(_x, _y, obj_en_cruiser); + } + else if (en_size[i]=1){ + man=instance_create(_x ,_y ,obj_en_cruiser); + } + man.class=en_column[i]; + man.owner=owner; + man.size=en_size[i]; + } + + + } + } + + + + + + + + if (owner = eFACTION.Tau){// This is an orderly Tau ship formation + var xx,yy,i, temp1, x2, man; + xx=0;yy=0; + i=0;temp1=0;x2=1200; + man=0; + + yy=y-((en_height[5]*en_num[5])/2); + yy+=(en_height[5]/2); + repeat(en_num[5]){ + man=instance_create(x2,yy,obj_en_cruiser); + yy+=en_height[5]; + man.class="Warden"; + man.owner=owner; + man.size=en_size[5]; + } + x2+=en_width[5]; + + yy=y-((en_height[2]*en_num[2])/2)-((en_height[3]*en_num[3])/2); + yy+=(en_height[2]/2); + yy+=(en_height[3]/2); + repeat(en_num[2]){ + man=instance_create(x2,yy,obj_en_cruiser); + yy+=en_height[2]; + man.class="Emissary"; + man.owner=owner; + man.size=en_size[2]; + } + repeat(en_num[3]){ + man=instance_create(x2,yy,obj_en_cruiser); + yy+=en_height[3]; + man.class="Protector"; + man.owner=owner; + man.size=en_size[3]; + } + x2+=max(en_width[2],en_width[3]); + + yy=y-((en_height[4]*en_num[4])/2); + yy+=(en_height[4]/2); + repeat(en_num[4]){ + man=instance_create(x2,yy,obj_en_cruiser); + yy+=en_height[4]; + man.class="Castellan"; + man.owner=owner; + man.size=en_size[4]; + } + x2+=en_width[4]; + + yy=y-((en_height[1]*en_num[1])/2); + yy+=(en_height[1]/2); + repeat(en_num[1]){ + man=instance_create(x2,yy,obj_en_capital); + yy+=en_height[1]; + man.class="Custodian"; + man.owner=owner; + man.size=en_size[1]; + } + + } + + + + + if (owner = eFACTION.Tyranids){// This is an orderly Tyranid ship formation + var xx,yy,i, temp1, x2, man; + xx=0;yy=0; + i=0;temp1=0;x2=1200; + man=0; + + yy=y-((en_height[4]*en_num[4])/2); + yy+=(en_height[4]/2); + repeat(en_num[4]){ + man=instance_create(x2,yy,obj_en_cruiser); + yy+=en_height[4]; + man.class="Prowler"; + man.owner=owner; + man.size=en_size[4]; + } + x2+=en_width[4]; + + yy=y-((en_height[3]*en_num[3])/2); + yy+=(en_height[3]/2); + repeat(en_num[3]){ + man=instance_create(x2,yy,obj_en_cruiser); + yy+=en_height[3]; + man.class="Razorfiend"; + man.owner=owner; + man.size=en_size[3]; + } + x2+=en_width[3]; + + yy=y-((en_height[2]*en_num[2])/2); + yy+=(en_height[2]/2); + repeat(en_num[2]){ + man=instance_create(x2,yy,obj_en_cruiser); + yy+=en_height[2]; + man.class="Stalker"; + man.owner=owner; + man.size=en_size[2]; + } + x2+=en_width[2]; + + yy=y-((en_height[1]*en_num[1])/2); + yy+=(en_height[1]/2); + repeat(en_num[1]){ + man=instance_create(x2,yy,obj_en_capital); + yy+=en_height[1]; + man.class="Leviathan"; + man.owner=owner; + man.size=en_size[1]; + } + + } + + + + + if (owner = eFACTION.Necrons){// This is an orderly Necron ship formation + var xx,yy,i, temp1, x2, man; + xx=0;yy=0; + i=0;temp1=0;x2=1200; + man=0; + + yy=y-((en_height[4]*en_num[4])/2); + yy+=(en_height[4]/2); + repeat(en_num[4]){ + man=instance_create(x2,yy,obj_en_cruiser); + yy+=en_height[4]; + man.class="Dirge Class"; + man.owner=owner; + man.size=en_size[4]; + } + x2+=en_width[4]; + + yy=y-((en_height[3]*en_num[3])/2); + yy+=(en_height[3]/2); + repeat(en_num[3]){ + man=instance_create(x2,yy,obj_en_cruiser); + yy+=en_height[3]; + man.class="Jackal Class"; + man.owner=owner; + man.size=en_size[3]; + } + x2+=en_width[3]; + + yy=y-((en_height[2]*en_num[2])/2); + yy+=(en_height[2]/2); + repeat(en_num[2]){ + man=instance_create(x2,yy,obj_en_cruiser); + yy+=en_height[2]; + man.class="Shroud Class"; + man.owner=owner; + man.size=en_size[2]; + } + x2+=en_width[2]; + + yy=y-((en_height[1]*en_num[1])/2); + yy+=(en_height[1]/2); + repeat(en_num[1]){ + man=instance_create(x2,yy,obj_en_capital); + yy+=en_height[1]; + man.class="Reaper Class"; + man.owner=owner; + man.size=en_size[1]; + } + } + + with (obj_en_ship){ + assign_ship_stats(); + } + with (obj_al_ship){ + assign_ship_stats(); + } + + +} + diff --git a/scripts/scr_enemy_fleet_spawn_combat/scr_enemy_fleet_spawn_combat.yy b/scripts/scr_enemy_fleet_spawn_combat/scr_enemy_fleet_spawn_combat.yy new file mode 100644 index 0000000000..a7e0bba3cc --- /dev/null +++ b/scripts/scr_enemy_fleet_spawn_combat/scr_enemy_fleet_spawn_combat.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"scr_enemy_fleet_spawn_combat", + "isCompatibility":false, + "isDnD":false, + "name":"scr_enemy_fleet_spawn_combat", + "parent":{ + "name":"Scripts", + "path":"folders/Scripts.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/scr_event_code/scr_event_code.gml b/scripts/scr_event_code/scr_event_code.gml index 35bf476edc..97a209ea47 100644 --- a/scripts/scr_event_code/scr_event_code.gml +++ b/scripts/scr_event_code/scr_event_code.gml @@ -138,11 +138,10 @@ function event_end_turn_action(){ var last_ship = new_player_ship(new_ship_event, ship_spawn.system.name); add_ship_to_fleet(last_ship, _new_player_fleet) + var _ship = obj_ini.ship_data[last_ship]; - // 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 (_ship.size!=1) then scr_popup("Ship Constructed",$"Your new {_ship.class} '{_ship.name}' has finished being constructed. It is orbiting {ship_spawn.system.name} and awaits its maiden voyage.","shipyard",""); + if (_ship.size==1) then scr_popup("Ship Constructed",$"Your new {_ship.class} Escort '{_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; diff --git a/scripts/scr_fleet_advisor/scr_fleet_advisor.gml b/scripts/scr_fleet_advisor/scr_fleet_advisor.gml index 38bcdea95b..7db6df54a9 100644 --- a/scripts/scr_fleet_advisor/scr_fleet_advisor.gml +++ b/scripts/scr_fleet_advisor/scr_fleet_advisor.gml @@ -1,3 +1,281 @@ +function fleet_advisor_data_setup(){ + fleet_temps = { + capitals : 0, + frigates : 0, + escorts : 0, + ships_with_damage : false, + heavy_damaged_ships : 0, + most_damaged_ship : -1, + view_ship : -1, + view_ship_struct : false, + view_ship_occupants : "", + weapon_equip:false + } + var _goto_button = new icon_button(); + + _goto_button.set_sprite_data(1,1,spr_view_small, 0); + with (_goto_button){ + click_method = function(){ + var _temps = obj_controller.fleet_temps; + var _ship = _temps.view_ship_struct; + var _select_data = { + purpose : $"{_ship.name} technical suppliers", + purpose_code : "ship_tech_suppliers", + number : 0, + ship : _temps.view_ship, + } + group_selection(_ship.tech_suppliers,_select_data); + } + + hover_method = function(){ + tooltip_draw("Click to viewmarines currently contributing to fullfilling technical requirements"); + } + } + + fleet_temps.tech_fulfilment_view = _goto_button; + + ship_slate = new DataSlate(); + list_slate = new DataSlate(); + weapon_slate = new DataSlate(); + weapon_slate.weapon = false; + weapon_slate.slot = false; + for (var i = 0; i < array_length(obj_ini.ship_data); i++) { + var _ship = obj_ini.ship_data[i]; + + switch(_ship.size){ + case 3: + fleet_temps.capitals++; + break; + case 2: + fleet_temps.frigates++; + break; + case 1: + fleet_temps.escorts++; + break; + } + + } + + var _most_damage = 100; + for (var i = 0; i < array_length(obj_ini.ship_data); i++) { + var _ship = fetch_ship(i); + _ship.update_ship_combat_data(); + var _percent = _ship.ship_hp_percentage(); + if (_percent<100 && !fleet_temps.ships_with_damage){ + fleet_temps.ships_with_damage = true; + } + if (_percent<25){ + fleet_temps.heavy_damaged_ships++; + } + if (_percent<_most_damage){ + fleet_temps.most_damaged_ship = i; + _most_damage = _percent; + } + } + man_max = i; + man_current = 0; + var _text = "Greetings, Chapter Master.\n\nYou requested a report? Our fleet contains "; + _text += $"Your fleet contains {fleet_temps.capitals} Capital Ships, {fleet_temps.frigates} Frigates, and {fleet_temps.escorts} Escorts"; + if (fleet_temps.ships_with_damage == 0){ + _text += ", none of which are damaged."; + } + if (_most_damage < 100){ + _text += $". Our most damaged vessel is the {fetch_ship(fleet_temps.most_damaged_ship).name} - it has {_most_damage}% Hull Integrity."; + } + + if (fleet_temps.heavy_damaged_ships == 2){ + _text += " Two of our ships are highly damaged. You may wish to purchase a Repair License from the Sector Governerner."; + } + if (fleet_temps.heavy_damaged_ships > 2){ + _text += " Several of our ships are highly damaged. It is advisable that you purchase a Repair License from the Sector Governer."; + } + + _text += "\n\nHere are the current positions of our ships and their contents:"; + if (menu_adept = 1) { + _text = string_replace(_text, "Our", "Your"); + _text = string_replace(_text, " our", " your"); + _text = string_replace(_text, "We", "You"); + } + fleet_temps.advisor_text = _text; + + var _feet_surface = surface_create(685, 752); + surface_set_target(_feet_surface); + fleet_temps.goto_buttons = []; + fleet_temps.hitboxes = []; + fleet_select_surface(); + surface_reset_target(); + fleet_temps.fleet_list_surface = _feet_surface; +} + +function fleet_select_surface(){ + draw_set_font(fnt_40k_14b); + draw_set_color(c_white); + var _columns = { + name: { + w: 176, + text: "Name", + h_align: fa_left, + y1 : 0, + }, + class: { + w: 154, + text: "Class", + h_align: fa_left, + y1 : 0, + }, + location: { + w: 130, + text: "Location", + h_align: fa_left, + y1 : 0, + }, + hp: { + w: 44, + text: "HP", + h_align: fa_right, + y1 : 0, + }, + carrying: { + w: 84, + text: "Carrying", + h_align: fa_right, + y1 : 0, + }, + }; + + var _column_x = 0 + 40 + var yy = 0; + var xx = 0; + var _header_offset = 80; + var _columns_array = ["name", "class", "location", "hp", "carrying"]; + + for (var i = 0; i < array_length(_columns_array); i++) { + with(_columns[$ _columns_array[i]]) { + x1 = _column_x; + _column_x += w; + x2 = x1 + w; + y1 = yy + _header_offset; + header_y = (y1 - 2); + switch (h_align) { + case fa_right: + header_x = x2; + break; + case fa_center: + header_x = (x1 + x2) / 2; + break; + case fa_left: + default: + header_x = x1; + break; + } + draw_set_halign(h_align); + draw_text(header_x, header_y, text); + } + } + draw_set_halign(fa_left); + + var _row_height = 20; + var _row_gap = 2; + for (var i = ship_current; i < ship_current + 34; i++) { + if (i >= array_length(obj_ini.ship_data)){ + continue; + } + + var _row_y = _columns.name.y1 + _row_height + (i * (_row_height + _row_gap)); + + var _goto_button = new icon_button(); + + _goto_button.x1 = _columns.location.x1 - 20; + _goto_button.y1 = _row_y + 4; + + _goto_button.set_sprite_data(1,1,spr_view_small, 0); + _goto_button.id = i; + with (_goto_button){ + click_method = function(){ + var i = id; + with(obj_p_fleet) { + var _fleet_ships = fleet_full_ship_array(); + if (array_contains(_fleet_ships, i)){ + obj_controller.x = x; + obj_controller.y = y; + obj_controller.menu = 0; + with(obj_fleet_show) { + instance_destroy(); + } + instance_create(x, y, obj_fleet_show); + } + } + } + } + + array_push(fleet_temps.goto_buttons, _goto_button) + + var _ship = obj_ini.ship_data[i]; + + with(_columns) { + name.contents = string_truncate(_ship.name, _columns.name.w - 6); + class.contents = _ship.class; + location.contents = _ship.location; + hp.contents = $"{round(_ship.hp / _ship.max_hp * 100)}%"; + carrying.contents = $"{_ship.carrying}/{_ship.capacity}"; + } + + for (var g = 0; g < array_length(_columns_array); g++) { + with(_columns[$ _columns_array[g]]) { + draw_set_halign(h_align); + switch (h_align) { + case fa_right: + draw_text(x2, _row_y, contents); + break; + case fa_center: + draw_text((x1 + x2) / 2, _row_y, contents); + break; + case fa_left: + default: + draw_text(x1, _row_y, contents); + break; + } + } + } + var _hit_box = { + x1 : xx + 25, + x2 : xx + 1546, + y1 : _row_y, + y2 : _row_y + _row_height, + ship : obj_ini.ship_data[i], + id : i, + relative_x : 0, + relative_y : 0, + } + with (_hit_box){ + enter = function(){ + if (scr_hit(relative_x + x1, relative_y + y1, relative_x+ x2, relative_y + y2)) { + if (obj_controller.fleet_temps.view_ship != id){ + obj_controller.fleet_temps.view_ship = id; + obj_controller.fleet_temps.view_ship_struct = ship; + obj_controller.fleet_temps.view_ship_occupants = scr_ship_occupants(id); + } + tooltip_draw($"Carrying ({ship.carrying}/{ship.capacity}"); + } + } + } + array_push(fleet_temps.hitboxes, _hit_box); + } +} + +function setup_weapon_selection_equip(){ + var _weps = obj_ini.ship_weapons; + var _slot = obj_controller.fleet_temps.wep_change_slot; + for (var i=0;i= 1) then blurp += ", none of which are damaged."; - if (va < 1) then blurp += $". Our most damaged vessel is the {temp[40]} - it has {min(99, round(va * 100))}% Hull Integrity."; - - va = real(temp[42]); - if (va = 2) then blurp += " Two of our ships are highly damaged. You may wish to purchase a Repair License from the Sector Governerner."; - if (va > 2) then blurp += " Several of our ships are highly damaged. It is advisable that you purchase a Repair License from the Sector Governer."; - blurp += "\n\nHere are the current positions of our ships and their contents:"; - - if (menu_adept = 1) { - blurp = string_replace(blurp, "Our", "Your"); - blurp = string_replace(blurp, " our", " your"); - blurp = string_replace(blurp, "We", "You"); - } - - draw_text_ext(xx + 336 + 16, yy + 130, blurp, -1, 536); + draw_text_ext(xx + 336 + 16, yy + 130, fleet_temps.advisor_text, -1, 536); draw_set_font(fnt_40k_30b); draw_set_halign(fa_center); @@ -79,209 +322,139 @@ function scr_fleet_advisor(){ // TODO: Probably a good idea to turn this whole interactive list/sheet generating logic into a constructor, that can be reused on many screens. // I have no passion for this atm. - if (instance_exists(cn)) { - var _columns = { - name: { - w: 176, - text: "Name", - h_align: fa_left, - }, - class: { - w: 154, - text: "Class", - h_align: fa_left, - }, - location: { - w: 130, - text: "Location", - h_align: fa_left, - }, - hp: { - w: 44, - text: "HP", - h_align: fa_right, - }, - carrying: { - w: 84, - text: "Carrying", - h_align: fa_right, - }, - }; - - var _column_x = xx + 953; - var _header_offset = 80; - var _columns_array = ["name", "class", "location", "hp", "carrying"]; - - for (var i = 0; i < array_length(_columns_array); i++) { - with(_columns[$ _columns_array[i]]) { - x1 = _column_x; - _column_x += w; - x2 = x1 + w; - y1 = yy + _header_offset; - header_y = (y1 - 2); - switch (h_align) { - case fa_right: - header_x = x2; - break; - case fa_center: - header_x = (x1 + x2) / 2; - break; - case fa_left: - default: - header_x = x1; - break; + + if (obj_controller.fleet_temps.weapon_equip == false){ + list_slate.inside_method = function(){ + draw_surface(fleet_temps.fleet_list_surface, list_slate.XX, list_slate.YY); + var _loop = max(array_length(fleet_temps.goto_buttons), array_length(fleet_temps.hitboxes)); + for (var i=0;i<_loop;i++){ + if (i= array_length(obj_ini.ship)) then continue; - if (obj_ini.ship[i] != "") { - var _row_y = _columns[$ "name"].y1 + _row_height + (i * (_row_height + _row_gap)); - draw_rectangle(xx + 950, _row_y, xx + 1546, _row_y + _row_height, 1); - - var _goto_button = { - x1: _columns.location.x1 - 20, - y1: _row_y + 4, - sprite: spr_view_small, - click: function() { - return point_and_click([x1, y1, x2, y2]); - } - }; - with(_goto_button) { - w = sprite_get_width(sprite); - h = sprite_get_height(sprite); - x2 = x1 + w; - y2 = y1 + h; - draw_sprite(sprite, 0, x1, y1); - } - - with(_columns) { - name.contents = string_truncate(obj_ini.ship[i], _columns.name.w - 6); - class.contents = obj_ini.ship_class[i]; - location.contents = obj_ini.ship_location[i]; - hp.contents = $"{round(obj_ini.ship_hp[i] / obj_ini.ship_maxhp[i] * 100)}%"; - carrying.contents = $"{obj_ini.ship_carrying[i]}/{obj_ini.ship_capacity[i]}"; - } - - for (var g = 0; g < array_length(_columns_array); g++) { - with(_columns[$ _columns_array[g]]) { - draw_set_halign(h_align); - switch (h_align) { - case fa_right: - draw_text(x2, _row_y, contents); - break; - case fa_center: - draw_text((x1 + x2) / 2, _row_y, contents); - break; - case fa_left: - default: - draw_text(x1, _row_y, contents); - break; - } - } - } - - if scr_hit(xx + 950, _row_y, xx + 1546, _row_y + _row_height) { - if (cn.temp[101] != obj_ini.ship[i]) { - cn.temp[101] = obj_ini.ship[i]; - cn.temp[102] = obj_ini.ship_class[i]; - - cn.temp[103] = string(obj_ini.ship_hp[i]); - cn.temp[104] = string(obj_ini.ship_maxhp[i]); - cn.temp[105] = string(obj_ini.ship_shields[i] * 100); - - cn.temp[106] = string(obj_ini.ship_speed[i]); - - cn.temp[107] = string(obj_ini.ship_front_armour[i]); - cn.temp[108] = string(obj_ini.ship_other_armour[i]); - - cn.temp[109] = string(obj_ini.ship_turrets[i]); + } - var facing_length = array_length(obj_ini.ship_wep_facing[i]); - var wep_length = array_length(obj_ini.ship_wep[i]); - var max_weapons = min(facing_length, wep_length, 5); - for (var s = 1; s < max_weapons; s++) { - cn.temp[110+((s-1)*2)] = obj_ini.ship_wep[i][s]; - cn.temp[110+((s-1)*2)+1] = obj_ini.ship_wep_facing[i][s]; - } + list_slate.draw_with_dimensions(xx + 900, yy + 66, 685, 752); - cn.temp[118] = $"{obj_ini.ship_carrying[i]}/{obj_ini.ship_capacity[i]}"; - cn.temp[119] = ""; - if (obj_ini.ship_carrying[i] > 0) then cn.temp[119] = scr_ship_occupants(i); - } - tooltip_draw($"Carrying ({cn.temp[118]}): {cn.temp[119]}"); - if (_goto_button.click()) { - with(obj_p_fleet) { - var _fleet_ships = fleet_full_ship_array(); - if (array_contains(_fleet_ships, i)){ - obj_controller.x = x; - obj_controller.y = y; - obj_controller.menu = 0; - with(obj_fleet_show) { - instance_destroy(); - } - instance_create(x, y, obj_fleet_show); - } - } + ship_slate.inside_method = function(){ + var xx = ship_slate.XX; + var _center_x = (ship_slate.width/2) + xx + var yy = ship_slate.YY; + if (fleet_temps.view_ship>-1) { + var _ship = fleet_temps.view_ship_struct; + draw_set_font(fnt_40k_30b); + draw_set_halign(fa_center); + draw_text_transformed(xx + 280, yy + 60, _ship.name, 0.75, 0.75, 0); + draw_text_transformed(xx + 280, yy + 90, _ship.class, 0.5, 0.5, 0); + if (_ship.captain != ""){ + draw_text_transformed(xx + 280, yy + 120, $"Current Captain : {_ship.captain_data.name_role()}", 0.5, 0.5, 0); + } else { + var _new_cap = draw_unit_buttons([xx + 240, yy + 120], "Choose Captain", [1, 1], 38144, , fnt_40k_14b); + if (point_and_click(_new_cap)){ + var _candidates = collect_role_group("all", ["",0,fleet_temps.view_ship]); + var _select_data = { + purpose:"Ship Management", + purpose_code : "ship_captain", + number:1, + system:0, + feature:"none", + planet : 0, + ship : fleet_temps.view_ship, + selections : [], } + group_selection(_candidates,_select_data); } + } - } - - if (cn.temp[101] != "") { - draw_set_font(fnt_40k_30b); - draw_set_halign(fa_center); - draw_text_transformed(xx + 622, yy + 434, cn.temp[101], 0.75, 0.75, 0); - draw_text_transformed(xx + 622, yy + 464, cn.temp[102], 0.5, 0.5, 0); draw_set_color(c_gray); - draw_rectangle(xx + 488, yy + 492, xx + 756, yy + 634, 1); + draw_rectangle(xx + 146, yy + 492, xx + 411, yy + 634, 1); var ships = ["Battle Barge", "Strike Cruiser","Gladius","Hunter"]; var ship_im = 0; for (var i=0;iobj_ini.ship_carrying[ship_ident]){ - obj_ini.ship_carrying[ship_ident]+=unit.size; + var _ship = obj_ini.ship_data[ship_ident]; + if (ship_ident.has_space(unit.size)){ + _ship.carrying+=unit.size; unit.planet_location=0; - unit.location_string=obj_ini.ship_location[ship_ident]; + unit.location_string=_ship.location; unit.ship_location=ship_ident; loaded=true; break @@ -224,7 +223,7 @@ function load_unit_to_fleet(fleet, unit){ } function calculate_fleet_eta(xx,yy,xxx,yyy, fleet_speed,star1=true, star2=true,warp_able=false){ var warp_lane = false; - eta = 0; + _eta = 0; //Some duke unfinished webway stuff copied here for reference /*for (var w = 1;w<5;w++){ if (planet_feature_bool(mine.p_feature[w], P_features.Webway)==1) then web1=1; @@ -237,21 +236,21 @@ function calculate_fleet_eta(xx,yy,xxx,yyy, fleet_speed,star1=true, star2=true,w } else if (star1){ star1 = instance_nearest(xx,yy, obj_star); } - eta=floor(point_distance(xx,yy,xxx,yyy)/fleet_speed)+1; - if (!warp_lane) then eta*=2; - if (warp_lane && warp_able) then eta = ceil(eta/warp_lane); - if (!star2) then return eta; + _eta=floor(point_distance(xx,yy,xxx,yyy)/fleet_speed)+1; + if (!warp_lane) then _eta*=2; + if (warp_lane && warp_able) then _eta = ceil(_eta/warp_lane); + if (!star2) then return _eta; //check end location for warp storm if (instance_exists(star2)){ if(star2.object_index == obj_star) { if (star2.storm){ - eta += 10000; + _eta += 10000; } } } - return eta; + return _eta; } @@ -476,6 +475,19 @@ function scr_orbiting_fleet(faction, system="none"){ return _found_fleet; } +function scr_orbiting_fleets_all(system="none"){ + var xx = system == "none" ? x : system.x; + var yy = system == "none" ? y : system.y; + var _found_fleets = []; + with (obj_en_fleet){ + if (x==xx && y==yy){ + array_push(_found_fleets, id); + } + } + + return _found_fleets; +} + /// @function object_distance(obj_1, obj_2) /// @description Returns the distance in pixels between two instances or objects based on their `x` and `y` coordinates. @@ -556,13 +568,34 @@ function get_orbiting_fleets(faction,system="none"){ return _fleets; } +function standard_fleet_strength_calc(fleet = "none"){ + if (fleet == "none"){ + return capital_number + (frigate_number/2) + (escort_number/4); + } else { + with (fleet){ + return standard_fleet_strength_calc(); + } + } +} + +function fleet_faction_status(fleet = "none"){ + if (fleet == "none"){ + return obj_controller.faction_status[owner]; + } else { + with (fleet){ + return fleet_faction_status(); + } + } +} + + function sector_imperial_fleet_strength(){ obj_controller.imp_ships = 0; var _imperial_planet_count = 0; var _mech_worlds = 0; with(obj_en_fleet){ if (owner==eFACTION.Imperium){ - var _imperial_fleet_defence_score = capital_number + (frigate_number/2) + (escort_number/4); + var _imperial_fleet_defence_score = standard_fleet_strength_calc(); obj_controller.imp_ships += _imperial_fleet_defence_score; } } @@ -1123,9 +1156,9 @@ function fleet_respond_crusade(){ var min_dist = 40; var to_ignore = [eFACTION.Imperium, eFACTION.Mechanicus,eFACTION.Inquisition, eFACTION.Ecclesiarchy]; - var dist = point_distance(x,y,ns.x,ns.y) + var target_distance = point_distance(x,y,ns.x,ns.y) var valid_target = !array_contains_ext(ns.p_owner, to_ignore, false) - if valid_target and dist <= max_dist and dist >= min_dist and (owner = eFACTION.Imperium) + if valid_target and target_distance <= max_dist and target_distance >= min_dist and (owner = eFACTION.Imperium) then ok = true; // if ((ns.owner>5) or (ns.owner = eFACTION.Player)) and (point_distance(x,y,ns.x,ns.y)<=max_dis) and (point_distance(x,y,ns.x,ns.y)>40) and (owner = eFACTION.Imperium){ diff --git a/scripts/scr_hit/scr_hit.gml b/scripts/scr_hit/scr_hit.gml index b1c4ea0724..cf52afc68a 100644 --- a/scripts/scr_hit/scr_hit.gml +++ b/scripts/scr_hit/scr_hit.gml @@ -206,6 +206,45 @@ function mouse_distance_less(xx, yy, distance){ return (point_distance(xx,yy,_mouse_consts[0],_mouse_consts[1])<=distance) } +function DragBox(xx, yy, bind_button = mb_left, on_release=false, on_drag = false) constructor{ + x1 = xx; + y1 = yy; + + x2 = xx; + y2 = yy; + + self.bind_button = bind_button; + self.on_release = on_release; + self.on_drag = on_drag; + + box_colour = CM_GREEN_COLOR; + + drag_alpha = 0.25; + + static step = function(){ + var _mb_consts = return_mouse_consts(); + x2 = _mb_consts[0]; + y2 = _mb_consts[1]; + if (!mouse_button_held(bind_button)){ + if (is_callable(on_release)){ + on_release(x1,y1,x2,y2); + return false; + } + } else { + draw_set_color(box_colour); + draw_set_alpha(drag_alpha); + draw_rectangle(x1, y1, x2, y2, 0); + draw_set_alpha(1); + draw_rectangle(x1, y1, x2, y2, 1); + + if (is_callable(on_drag)){ + on_drag(x1,y1,x2,y2); + } + } + return true; + } +} + function return_mouse_consts_tooltip(){ var consts = return_mouse_consts(); return [consts[0], consts[1]] diff --git a/scripts/scr_imperial_navy_functions/scr_imperial_navy_functions.gml b/scripts/scr_imperial_navy_functions/scr_imperial_navy_functions.gml index 0fa27ee7f9..bf32b03f2d 100644 --- a/scripts/scr_imperial_navy_functions/scr_imperial_navy_functions.gml +++ b/scripts/scr_imperial_navy_functions/scr_imperial_navy_functions.gml @@ -280,7 +280,7 @@ function imperial_navy_bombard(){ _bombard=p; } else{ - var _cults = return_planet_features(orbiting.p_feature[p],P_features.Gene_Stealer_Cult); + var _cults = return_planet_features(orbiting.p_feature[p],P_features.GeneStealerCult); if (array_length(_cults)){ if (!_cults[0].hiding){ _bombard=p; diff --git a/scripts/scr_income/scr_income.gml b/scripts/scr_income/scr_income.gml index 3f83c2f510..c7655c4053 100644 --- a/scripts/scr_income/scr_income.gml +++ b/scripts/scr_income/scr_income.gml @@ -3,11 +3,18 @@ function scr_income() { // Determines income - income_base=32;income_tribute=0;income_controlled_planets=0; - if (obj_ini.fleet_type != ePlayerBase.home_world) then income_base=40; + income_base=32; + + income_tribute=0; + income_controlled_planets=0; + if (obj_ini.fleet_type != ePlayerBase.home_world){ + income_base=40; + } income_home=0; - if (obj_ini.fleet_type=ePlayerBase.home_world) then income_home=8;// Homeworld-based income + if (obj_ini.fleet_type=ePlayerBase.home_world){ + income_home=8;// Homeworld-based income + } income_fleet=0; with(obj_p_fleet){ @@ -15,7 +22,10 @@ function scr_income() { obj_controller.income_fleet-=frigate_number/2; obj_controller.income_fleet-=escort_number/10; } - if (obj_ini.fleet_type = ePlayerBase.home_world) then obj_controller.income_fleet=round(obj_controller.income_fleet/2); + + if (obj_ini.fleet_type = ePlayerBase.home_world){ + obj_controller.income_fleet=round(obj_controller.income_fleet/2); + } income_forge=0; income_agri=0; @@ -28,46 +38,49 @@ function scr_income() { } } - if (training_apothecary=1) then income_training-=1; - if (training_apothecary=2) then income_training-=2; - if (training_apothecary=3) then income_training-=3; - if (training_apothecary=4) then income_training-=4; - if (training_apothecary=5) then income_training-=6; - if (training_apothecary=6) then income_training-=12; - - if (training_chaplain=1) then income_training-=1; - if (training_chaplain=2) then income_training-=2; - if (training_chaplain=3) then income_training-=3; - if (training_chaplain=4) then income_training-=4; - if (training_chaplain=5) then income_training-=6; - if (training_chaplain=6) then income_training-=12; - - if (training_psyker=1) then income_training-=1; - if (training_psyker=2) then income_training-=2; - if (training_psyker=3) then income_training-=3; - if (training_psyker=4) then income_training-=4; - if (training_psyker=5) then income_training-=6; - if (training_psyker=6) then income_training-=12; - - if (training_techmarine=1) then income_training-=1; - if (training_techmarine=2) then income_training-=2; - if (training_techmarine=3) then income_training-=3; - if (training_techmarine=4) then income_training-=4; - if (training_techmarine=5) then income_training-=6; - if (training_techmarine=6) then income_training-=12; - - tau_stars=0;if (instance_exists(obj_turn_end)) then tau_messenger+=1; + static training_cost_chart = [0,1,2,3,4,6,12]; + + var training_sets = [training_apothecary,training_chaplain,training_psyker,training_techmarine]; + for (var i=0;i 0 && training_sets[i] < 7){ + income_training -=training_sets[training_sets[i]]; + } + } + + tau_stars=0; + if (instance_exists(obj_turn_end)) then tau_messenger+=1; if (obj_ini.fleet_type=ePlayerBase.home_world){ with(obj_star){ - if (planet_feature_bool(p_feature[1], P_features.Monastery)==1){obj_controller.income+=10;instance_create(x,y,obj_temp1);} - if (planet_feature_bool(p_feature[2], P_features.Monastery)==1){obj_controller.income+=10;instance_create(x,y,obj_temp1);} - if (owner = eFACTION.Tau) then obj_controller.tau_stars+=1; - alarm[2]=1; + if (space_hulk){ + continue; + } + if (system_feature_bool(p_feature, P_features.Monastery)){ + obj_controller.income+=10; + var _joined = nearest_warp_joined(self); + if (_joined!="none"){ + with (_joined){ + for(var i=1; i<=planets; i++){ + if (p_type[i]=="Forge") and (p_owner[i]==3) then obj_controller.income_forge+=6; + if (p_type[i]=="Agri") and (p_owner[i]==2) then obj_controller.income_agri+=3; + } + } + } else { + var _nearest = distance_removed_star(x, y, 1); + if (point_distance(x,y,_nearest.x,_nearest.y) <= 180){ + with (_nearest){ + if (p_type[i]=="Forge") and (p_owner[i]==3) then obj_controller.income_forge+=6; + if (p_type[i]=="Agri") and (p_owner[i]==2) then obj_controller.income_agri+=3; + } + } + } + } + if (owner = eFACTION.Tau){ + obj_controller.tau_stars+=1; + } } } - if (obj_ini.fleet_type != ePlayerBase.home_world){ with(obj_p_fleet){ if (action="") and (capital_number>0){ @@ -85,8 +98,9 @@ function scr_income() { with(obj_star){ - var o;o=0; - repeat(4){o+=1; + var o=0; + repeat(planets){ + o+=1; if (dispo[o]>=100){ if (planet_feature_bool(p_feature[1], P_features.Monastery)==0){ obj_controller.income_controlled_planets+=1;obj_controller.income_tribute+=1; diff --git a/scripts/scr_ini_ship_cleanup/scr_ini_ship_cleanup.gml b/scripts/scr_ini_ship_cleanup/scr_ini_ship_cleanup.gml index 8cab32875a..603e978023 100644 --- a/scripts/scr_ini_ship_cleanup/scr_ini_ship_cleanup.gml +++ b/scripts/scr_ini_ship_cleanup/scr_ini_ship_cleanup.gml @@ -4,6 +4,7 @@ function scr_kill_ship(index){ with(obj_ini){ var _units_on_ship = []; var _unit; + var _ship = ship_data[index]; for (var co=0;co<=companies;co++){ for (var i=0;i0){ + while (_ship.has_space() && f<_total_units && array_length(_units_on_ship)>0){ f++; - if (_units_on_ship[0].get_unit_size()+ship_carrying[_cur_ship]<=ship_capacity[_cur_ship]){ + if (_ship.has_space(_units_on_ship[0].get_unit_size())){ _units_on_ship[0].load_marine(_cur_ship); array_delete(_units_on_ship, 0, 1); } @@ -71,33 +76,7 @@ function scr_kill_ship(index){ } } } - array_delete(ship,index,1); - array_delete(ship_uid,index,1); - array_delete(ship_owner,index,1); - array_delete(ship_class,index,1); - array_delete(ship_size,index,1); - array_delete(ship_leadership,index,1); - array_delete(ship_hp,index,1); - array_delete(ship_maxhp,index,1); - - array_delete(ship_location,index,1); - array_delete(ship_shields,index,1); - array_delete(ship_conditions,index,1); - array_delete(ship_speed,index,1); - array_delete(ship_turning,index,1); - - array_delete(ship_front_armour,index,1); - array_delete(ship_other_armour,index,1); - array_delete(ship_weapons,index,1); - - array_delete(ship_wep ,index,1); - array_delete(ship_wep_condition,index,1); - array_delete(ship_wep_facing,index,1); - - array_delete(ship_capacity,index,1); - array_delete(ship_carrying,index,1); - array_delete(ship_contents,index,1); - array_delete(ship_turrets,index,1); + array_delete(ship_data,index,1); if (!in_warp){ if (_nearest_star!="none"){ @@ -122,10 +101,12 @@ function scr_ini_ship_cleanup() { // If the ship is dead then make it fucking dead man with(obj_ini){ if (array_length(ship)){ - for (var i=array_length(ship)-1;i>=0;i--){ - if (ship[i]!="") and (ship_hp[i]<=0){ - scr_kill_ship(i); - } + var _ships = array_length(ship) + for (var i=_ships-1;i>=0;i--){ + var _ship = fetch_ship(i); + if (_ship.hp<0){ + scr_kill_ship(i); + } } } sort_all_companies(); diff --git a/scripts/scr_inquisition_fleet_functions/scr_inquisition_fleet_functions.gml b/scripts/scr_inquisition_fleet_functions/scr_inquisition_fleet_functions.gml index aebf6119af..0d080982ee 100644 --- a/scripts/scr_inquisition_fleet_functions/scr_inquisition_fleet_functions.gml +++ b/scripts/scr_inquisition_fleet_functions/scr_inquisition_fleet_functions.gml @@ -281,7 +281,7 @@ function inquisitor_inspect_base(){ p_owner[cur_planet]=1; } if (p_type[cur_planet]=="Dead") and (array_length(p_upgrades[cur_planet])>0){ - if (planet_feature_bool(p_feature[cur_planet], [P_features.Secret_Base,P_features.Arsenal,P_features.Gene_Vault])==0) /*and (string_count(".0|",p_upgrades[cur_planet])>0)*/{ + if (planet_feature_bool(p_feature[cur_planet], [P_features.SecretBase,P_features.Arsenal,P_features.GeneVault])==0) /*and (string_count(".0|",p_upgrades[cur_planet])>0)*/{ yep=cur_planet; } } diff --git a/scripts/scr_inquisition_inspection/scr_inquisition_inspection.gml b/scripts/scr_inquisition_inspection/scr_inquisition_inspection.gml index 60108b8eb0..9748ba29ae 100644 --- a/scripts/scr_inquisition_inspection/scr_inquisition_inspection.gml +++ b/scripts/scr_inquisition_inspection/scr_inquisition_inspection.gml @@ -141,7 +141,7 @@ function inquisitor_inspection_structure() constructor { if (pidx >= star.planets) { continue; } if (!is_array(star.p_upgrades[pidx]) || array_length(star.p_upgrades[pidx]) == 0) { continue; } - var base_search = search_planet_features(star.p_upgrades[pidx], P_features.Secret_Base); + var base_search = search_planet_features(star.p_upgrades[pidx], P_features.SecretBase); if (array_length(base_search) > 0) { any_found = true; var player_base = star.p_upgrades[pidx][base_search[0]]; @@ -239,7 +239,7 @@ function inquisitor_inspection_structure() constructor { if (pidx >= star.planets) { continue; } if (!is_array(star.p_upgrades[pidx]) || array_length(star.p_upgrades[pidx]) == 0) { continue; } - var vault_search = search_planet_features(star.p_upgrades[pidx], P_features.Gene_Vault); + var vault_search = search_planet_features(star.p_upgrades[pidx], P_features.GeneVault); if (array_length(vault_search) > 0) { var gene_vault = star.p_upgrades[pidx][vault_search[0]]; gene_vault.inquis_hidden = 0; @@ -362,7 +362,9 @@ function inquisitor_inspection_structure() constructor { str1: "Over your dead body", choice_func: function() { obj_controller.cooldown = 10; - if (number != 0 && instance_exists(obj_turn_end)) { obj_turn_end.alarm[1] = 4; } + if (number != 0 && instance_exists(obj_turn_end)) { + setup_audience_and_popup_timer(4); + } instance_destroy(); exit; } diff --git a/scripts/scr_inquisition_mission/scr_inquisition_mission.gml b/scripts/scr_inquisition_mission/scr_inquisition_mission.gml index b333eba560..83020f9008 100644 --- a/scripts/scr_inquisition_mission/scr_inquisition_mission.gml +++ b/scripts/scr_inquisition_mission/scr_inquisition_mission.gml @@ -52,7 +52,7 @@ function scr_inquisition_mission(event, forced_mission = -1){ for(var s = 0, _len = array_length(all_stars); s <_len; s++){ var _star = all_stars[s]; - if (scr_star_has_planet_with_feature(_star, P_features.Necron_Tomb) && !awake_necron_star(_star.id)){ + if (scr_star_has_planet_with_feature(_star, P_features.NecronTomb) && !awake_necron_star(_star.id)){ array_push(necron_tomb_worlds, _star); found_sleeping_necrons = true; } @@ -198,11 +198,11 @@ function mission_inquisition_tomb_world(tomb_worlds){ _star = tomb_worlds; } - var planet = scr_get_planet_with_feature(_star, P_features.Necron_Tomb); + var planet = scr_get_planet_with_feature(_star, P_features.NecronTomb); if (planet == -1){ planet = irandom_range(1,_star.planets); - array_push(_star.p_feature[planet],new NewPlanetFeature(P_features.Necron_Tomb)); + array_push(_star.p_feature[planet],new NewPlanetFeature(P_features.NecronTomb)); } var eta = scr_mission_eta(_star.x, _star.y,1) @@ -695,7 +695,7 @@ function mission_investigate_planet(){ var stars = scr_get_stars(); var _valid_stars = array_filter_ext(stars, function(_star,index){ - if (scr_star_has_planet_with_feature(_star, P_features.Ancient_Ruins)){ + if (scr_star_has_planet_with_feature(_star, P_features.AncientRuins)){ var fleet = instance_nearest(_star.x,_star.y,obj_p_fleet); if (fleet == undefined || point_distance(_star.x,_star.y,fleet.x,fleet.y)>=160){ return true; @@ -711,7 +711,7 @@ function mission_investigate_planet(){ } var _star = array_random_element(_valid_stars); - var planet = scr_get_planet_with_feature(_star, P_features.Ancient_Ruins); + var planet = scr_get_planet_with_feature(_star, P_features.AncientRuins); if (planet == -1){ log_error("RE: Investigate Planet, couldn't pick a planet"); exit; @@ -843,7 +843,7 @@ function necron_tomb_mission_sequence(){ mission_star = star_by_name(pop_data.loc); remove_planet_problem(planet, "necron", mission_star); seal_tomb_world(mission_star.p_feature[planet]); - // mission_star.p_feature[planet][search_planet_features(mission_star.p_feature[planet], P_features.Necron_Tomb)[0]].sealed = 1; + // mission_star.p_feature[planet][search_planet_features(mission_star.p_feature[planet], P_features.NecronTomb)[0]].sealed = 1; scr_event_log("", $"Inquisition Mission Completed: Your Astartes have sealed the Necron Tomb on {mission_star.name} {scr_roman(planet)}.", mission_star.name); scr_gov_disp(mission_star.name, planet, irandom_range(3, 7)); diff --git a/scripts/scr_khornate_fleet_functions/scr_khornate_fleet_functions.gml b/scripts/scr_khornate_fleet_functions/scr_khornate_fleet_functions.gml index f0f032b0a2..4f5d9fdd1a 100644 --- a/scripts/scr_khornate_fleet_functions/scr_khornate_fleet_functions.gml +++ b/scripts/scr_khornate_fleet_functions/scr_khornate_fleet_functions.gml @@ -165,7 +165,7 @@ function khorne_fleet_cargo(){ if (chase_fleet != "none") and (action == "") { var intercept_time = fleet_intercept_time_calculate(chase_fleet); if (chase_fleet.action!=""){ - if (intercept_time<=chase_fleet.eta){ + if (intercept_time<=chase_fleet._eta){ target = chase_fleet; chase_fleet_target_set(target); target_chosen=true; @@ -259,6 +259,7 @@ function spawn_chaos_warlord(){ frigate_number=20; escort_number=40; } + var rep, filtered_array, candidate_systems; candidate_systems = []; with(obj_star){ diff --git a/scripts/scr_manage_task_selector/scr_manage_task_selector.gml b/scripts/scr_manage_task_selector/scr_manage_task_selector.gml index d2fc2a5291..7ec0f8abb2 100644 --- a/scripts/scr_manage_task_selector/scr_manage_task_selector.gml +++ b/scripts/scr_manage_task_selector/scr_manage_task_selector.gml @@ -1,14 +1,25 @@ // Script assets have changed for v2.3.0 see // https://help.yoyogames.com/hc/en-us/articles/360005277377 for more information -function scr_manage_task_selector(){ - if (exit_button.draw_shutter(400,70, "Exit", 0.5, true)){ - if (selection_data.purpose_code == "artifact_equip"){ - scr_toggle_lib(); - obj_controller.menu_artifact = selection_data.artifact; - equip_artifact_popup_setup(); - exit; - } +function scr_manage_task_selector(){ + if (exit_button.draw_shutter(xx+400,yy+70, "Exit", 0.5, true)){ + switch(selection_data.purpose_code){ + case "ship_tech_suppliers": + case "ship_captain": + var _ship = fetch_ship(selection_data.ship); + exit_adhoc_manage(); + scr_toggle_fleet_area(); + fleet_temps.view_ship = selection_data.ship; + fleet_temps.view_ship_struct = _ship; + exit; + break; + case "artifact_equip": + scr_toggle_lib(); + obj_controller.menu_artifact = selection_data.artifact; + equip_artifact_popup_setup(); + exit; + break; + } if (struct_exists(selection_data, "target_company")){ if (is_real(selection_data.target_company) && selection_data.target_company <= 10 && selection_data.target_company >= 0){ managing = selection_data.target_company; @@ -32,6 +43,7 @@ function scr_manage_task_selector(){ if (selection_data.select_type == MissionSelectType.Units){ task_selector_man_manage(); } else { + task_selector_squad_manage(); } } @@ -174,6 +186,19 @@ function task_selector_man_manage(){ init_train_forces_mission(selection_data.planet, selection_data.system,selection_data.array_slot, _unit); obj_controller.close_popups = false; exit_adhoc_manage(); + exit; + case "ship_captain": + var _unit = display_unit[i]; + var _ship = fetch_ship(selection_data.ship); + show_debug_message(_unit.uid); + _ship.captain = _unit.uid; + _unit.captain = _ship.uid; + show_debug_message(_ship.name); + _ship.captain_data = _unit; + exit_adhoc_manage(); + scr_toggle_fleet_area(); + fleet_temps.view_ship = selection_data.ship; + fleet_temps.view_ship_struct = _ship; exit; case "artifact_equip": scr_toggle_lib(); diff --git a/scripts/scr_marine_struct/scr_marine_struct.gml b/scripts/scr_marine_struct/scr_marine_struct.gml index 18dacac89b..62c2874af0 100644 --- a/scripts/scr_marine_struct/scr_marine_struct.gml +++ b/scripts/scr_marine_struct/scr_marine_struct.gml @@ -466,6 +466,9 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} planet_location = obj_ini.home_planet; } ship_location = -1; + static ship = function(){ + return fetch_ship(ship_location); + } last_ship = { uid: "", name: "" @@ -477,6 +480,7 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} corruption = 0; religion_sub_cult = "none"; base_group = "none"; + captain = ""; role_history = []; enum eROLE_TAG { Techmarine = 0, @@ -1962,8 +1966,9 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} } else { location_type = location_types.ship; //marine is on ship location_id = ship_location > -1 ? ship_location : 0; //ship array position - if (location_id < array_length(obj_ini.ship_location)) { - location_name = obj_ini.ship_location[location_id]; //location of ship + if (location_id < array_length(obj_ini.ship_data)) { + var _ship = ship(); + location_name = _ship.location; //location of ship } else { location_name = location_string; } @@ -2001,7 +2006,8 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} get_unit_size(); // make sure marines size given it's current equipment is correct var current_location = marine_location(); var system = current_location[2]; - var target_ship_location = obj_ini.ship_location[ship]; + var _ship = obj_ini.ship_data[ship]; + var target_ship_location = _ship.location; set_last_ship(); if (assignment() != "none") { return "on assignment"; @@ -2016,10 +2022,10 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} system = obj_ini.home_name; } //check if ship is in the same location as marine and has enough space; - if ((target_ship_location == system) && ((obj_ini.ship_carrying[ship] + size) <= obj_ini.ship_capacity[ship])) { + if (target_ship_location == system && _ship.has_space(size)) { planet_location = 0; //mark marine as no longer on planet ship_location = ship; //id of ship marine is now loaded on - obj_ini.ship_carrying[ship] += size; //update ship capacity + _ship.carrying += size; //update ship capacity if (star == "none") { star = star_by_name(system); @@ -2033,18 +2039,21 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} } else if (current_location[0] == location_types.ship) { //with this addition marines can now be moved between ships freely as long as they are in the same system var off_loading_ship = current_location[1]; - if ((obj_ini.ship_location[ship] == obj_ini.ship_location[off_loading_ship]) && ((obj_ini.ship_carrying[ship] + size) <= obj_ini.ship_capacity[ship])) { - obj_ini.ship_carrying[off_loading_ship] -= size; // remove from previous ship capacity + var _ship = obj_ini.ship_data[ship]; + var _offload_ship = obj_ini.ship_data[off_loading_ship]; + if (_ship.location == _offload_ship.location && _ship.has_space(size)) { + oboff_loading_ship.carrying -= size; // remove from previous ship capacity ship_location = ship; // change marine location to new ship - obj_ini.ship_carrying[ship] += size; //add marine capacity to new ship + _ship.carrying += size; //add marine capacity to new ship } } }; static set_last_ship = function() { if (ship_location > -1) { - last_ship.uid = obj_ini.ship_uid[ship_location]; - last_ship.name = obj_ini.ship[ship_location]; + var _ship = fetch_ship(ship_location); + last_ship.uid = _ship.uid; + last_ship.name = _ship.name; } else { last_ship = { uid: "", @@ -2061,12 +2070,13 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} } if (current_location[0] == location_types.ship) { if (current_location[2] != "Warp" && current_location[2] == system.name) { - location_string = obj_ini.ship_location[current_location[1]]; + var _ship = obj_ini.ship_data[current_location[1]]; + location_string = _ship.location; planet_location = planet_number; ship_location = -1; get_unit_size(); system.p_player[planet_number] += size; - obj_ini.ship_carrying[current_location[1]] -= size; + _ship.carrying -= size; } } else { ship_location = -1; @@ -2134,8 +2144,9 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} }else if (ship == -1 && planet == 0) { if (ship_location > -1) { - if (obj_ini.ship_location[ship_location] == location) { - _is_at_loc = true; + var _ship = obj_ini.ship_data[ship_location]; + if (_ship.location == location) { + is_at_loc = true; } } else if (location_string == location) { _is_at_loc = true; @@ -2454,26 +2465,31 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} }; } -function jsonify_marine_struct(company, marine, stringify=true) { - var copy_marine_struct = obj_ini.TTRPG[company, marine]; //grab marine structure - var new_marine = {}; + +function jsonify_struct(copy_struct, stringify){ + var _new_struct = {}; var copy_part; - var names = variable_struct_get_names(copy_marine_struct); // get all keys within structure + var names = variable_struct_get_names(copy_struct); // get all keys within structure for (var name = 0; name < array_length(names); name++) { //loop through keys to find which ones are methods as they can't be saved as a json string - if (!is_method(copy_marine_struct[$ names[name]])) { - copy_part = variable_clone(copy_marine_struct[$ names[name]]); - variable_struct_set(new_marine, names[name], copy_part); //if key value is not a method add to copy structure + if (!is_method(copy_struct[$ names[name]])) { + copy_part = variable_clone(copy_struct[$ names[name]]); + variable_struct_set(_new_struct, names[name], copy_part); //if key value is not a method add to copy structure delete copy_part; } } if(stringify){ - return json_stringify(new_marine, true); + return json_stringify(_new_struct, true); } else { - return new_marine; + return _new_struct; } } +function jsonify_marine_struct(company, marine, stringify=true) { + var copy_marine_struct = obj_ini.TTRPG[company, marine]; //grab marine structure + return jsonify_struct(copy_marine_struct, stringify); +} + /// @param {Array} unit where unit[0] is company and unit[1] is the position /// @returns {Struct.TTRPG_stats} unit function fetch_unit(unit) { @@ -2494,3 +2510,47 @@ function fetch_unit_uid(uuid){ return "none"; } + + +function determine_highest_ranking(unit_list){ + var unit; + var member_length = array_length(unit_list); + var hierarchy = role_hierarchy(); + var leader_hier_pos=array_length(hierarchy); + var leader="none", unit; + var highest_exp = 0; + for (var i=0;i0) and (unit.ship_location<0) then lick=$"{unit.location_string}."+string(unit.planet_location); - if (unit.planet_location<=0) and (unit.ship_location>-1) then lick=string(obj_ini.ship[unit.ship_location]); - if (lick!=""){ - good=false; - return(lick); - } - } - } + if (unit.planet_location>0) and (unit.ship_location<0){ + lick=$"{unit.location_string}."+string(unit.planet_location); + } + if (unit.planet_location<=0) and (unit.ship_location>-1){ + var _ship = fetch_ship(unit.ship_location); + lick=_ship.name; + } + if (lick!=""){return(lick);good=false;} + } + } } } } diff --git a/scripts/scr_mechanicus_missions/scr_mechanicus_missions.gml b/scripts/scr_mechanicus_missions/scr_mechanicus_missions.gml index 1ab242d254..44f8ccd557 100644 --- a/scripts/scr_mechanicus_missions/scr_mechanicus_missions.gml +++ b/scripts/scr_mechanicus_missions/scr_mechanicus_missions.gml @@ -39,25 +39,25 @@ function mechanicus_missions_end_turn(planet){ if (roll1>=98) then battli=2;// very oops, much necron, wow if (battli>0) and (p_player[planet]>0){// Quene the battle - obj_turn_end.battles+=1; - obj_turn_end.battle[obj_turn_end.battles]=1; - obj_turn_end.battle_world[obj_turn_end.battles]=planet; - obj_turn_end.battle_opponent[obj_turn_end.battles]=13; - obj_turn_end.battle_location[obj_turn_end.battles]=name; - obj_turn_end.battle_object[obj_turn_end.battles]=id; - if (battli=1) then obj_turn_end.battle_special[obj_turn_end.battles]="study2a"; - if (battli=2) then obj_turn_end.battle_special[obj_turn_end.battles]="study2b"; - - if (obj_turn_end.battle_opponent[obj_turn_end.battles]==11){ + var _battle = new EndTurnBattle(EndTurnBattleTypes.Ground, self.id); + _battle.special = battli==1 ? "study2a" : "study2b"; + _battle.opponent = eFACTION.Necrons; + _battle.planet = planet; + + + //clearly reserved for an unfinished version of the mission where the player has to instead fight CSSM + if (_battle.opponent == 11){ if (planet_feature_bool(p_feature[planet],P_features.ChaosWarband)==1){ - obj_turn_end.battle_special[obj_turn_end.battles]="ChaosWarband"; + _battle.special="ChaosWarband"; } } + + _battle.add_to_stack(); } if (battli>0) and (p_player[planet]<=0){// XDDDDD scr_popup("Mechanicus Mission Failed","The Mechanicus Research team on planet "+string(name)+" "+scr_roman(planet)+" have been killed by Necrons in the absence of your astartes. The Mechanicus are absolutely livid, doubly so because of the promised security they did not recieve.","",""); - obj_controller.turns_ignored[3]+=choose(8,10,12,14,16,18,20,22,24); - obj_controller.disposition[3]-=25; + obj_controller.turns_ignored[eFACTION.Mechanicus]+=choose(8,10,12,14,16,18,20,22,24); + alter_disposition(eFACTION.Mechanicus,-25); remove_planet_problem(planet,"mech_tomb2"); } } @@ -76,6 +76,7 @@ function mechanicus_missions_end_turn(planet){ scr_event_log("","Mechanicus Mission Completed: The Mechanicus research team on "+string(name)+" "+scr_roman(planet)+" have completed their work."); } else if (reward==2){ + var last_artifact = scr_add_artifact("random", "", 0); text="The Mechanicus Research team on planet "+string(name)+" "+scr_roman(planet)+" have completed their work without any major setbacks. Pleased with your astartes' work, they have granted your Chapter an artifact, to be used as you see fit."; @@ -148,8 +149,8 @@ function spawn_mechanicus_mission(chosen_mission = "random"){ with(obj_star){ - if(scr_star_has_planet_with_feature(id,P_features.Necron_Tomb)) and (awake_necron_star(id)!= 0){ - var planet = scr_get_planet_with_feature(id, P_features.Necron_Tomb); + if(scr_star_has_planet_with_feature(id,P_features.NecronTomb)) and (awake_necron_star(id)!= 0){ + var planet = scr_get_planet_with_feature(id, P_features.NecronTomb); if(scr_is_planet_owned_by_allies(self, planet)){ array_push(mechanicus_missions, "mech_tomb"); break; @@ -237,8 +238,8 @@ function spawn_mechanicus_mission(chosen_mission = "random"){ stars = scr_get_stars(); var valid_stars = array_filter_ext(stars, function(star,index) { - if(scr_star_has_planet_with_feature(star,P_features.Necron_Tomb)) and (awake_necron_star(star)!= 0){ - var planet = scr_get_planet_with_feature(star, P_features.Necron_Tomb); + if(scr_star_has_planet_with_feature(star,P_features.NecronTomb)) and (awake_necron_star(star)!= 0){ + var planet = scr_get_planet_with_feature(star, P_features.NecronTomb); if(scr_is_planet_owned_by_allies(star, planet)) { return true; } @@ -408,9 +409,10 @@ function mechanicus_mars_mission_target_time_elapsed(planet){ techs_taken+=1; } if (_unit.ship_location>-1){ - ship_planet=obj_ini.ship_location[_unit.ship_location]; + var _ship = fetch_ship(_unit.ship_location) + ship_planet = _ship.location; if (ship_planet=name){ - obj_ini.ship_carrying[_unit.ship_location]-=_unit.get_unit_size(); + _ship.carrying -= _unit.get_unit_size(); _unit.location_string="Mechanicus Vessel"; _unit.planet_location=0; _unit.ship_location=-1; diff --git a/scripts/scr_mission_eta/scr_mission_eta.gml b/scripts/scr_mission_eta/scr_mission_eta.gml index 5aa6c8cb2b..a872be8bcf 100644 --- a/scripts/scr_mission_eta/scr_mission_eta.gml +++ b/scripts/scr_mission_eta/scr_mission_eta.gml @@ -21,42 +21,9 @@ function scr_mission_eta(star_x, star_y, type=1, leeway = 10) { if (nearest_fleet != "none"){ eta1 = get_viable_travel_time(leeway, nearest_fleet.x, nearest_fleet.y, star_x, star_y, nearest_fleet, false); } - // n1=instance_nearest(x,y,obj_p_fleet); - // with(n1){y-=3000;} - // n2=instance_nearest(x,y,obj_p_fleet); - // with(n1){y+=3000;} - - // eta1=((point_distance(star_x,star_y,n1.x,n1.y)+point_distance(star_x,star_y,n2.x,n2.y))/2)/48; - // eta1+=2+choose(-1,0,0,0,1,2); } - /// None of this is used anywhere it seems - // if (type>1){ - // with(obj_p_fleet){ - // var good,i;good=0;i=0; - - // repeat(50){ - // i+=1; - // if (i<=20){if (capital[i]!="") and (obj_ini.ship_carrying[capital_num[i]]>0) then good=1;} - // if (frigate[i]!="") and (obj_ini.ship_carrying[frigate_num[i]]>0) then good=1; - // if (escort[i]!="") and (obj_ini.ship_carrying[escort_num[i]]>0) then good=1; - // } - // if (good>0) then instance_create(x,y,obj_temp_inq); - // } - - // if (instance_exists(obj_temp_inq)){ - // n1=instance_nearest(x,y,obj_temp_inq); - // with(n1){y-=3000;} - // n2=instance_nearest(x,y,obj_temp_inq); - // with(n1){y+=3000;} - - // eta1=((point_distance(star_x,star_y,n1.x,n1.y)+point_distance(star_x,star_y,n2.x,n2.y))/2)/48; - // eta1+=2+choose(-1,0,0,0,1,2); - // if (type=3) then eta1+=choose(1,2,3); - // with(obj_temp_inq){instance_destroy();} - // } - // if (!instance_exists(obj_temp_inq)) then eta1=floor(random_range(12,26))+1; - // } + } if (!instance_exists(obj_p_fleet)) then eta1=floor(random_range(12,26))+1; diff --git a/scripts/scr_mission_functions/scr_mission_functions.gml b/scripts/scr_mission_functions/scr_mission_functions.gml index ecd0676530..765267fd36 100644 --- a/scripts/scr_mission_functions/scr_mission_functions.gml +++ b/scripts/scr_mission_functions/scr_mission_functions.gml @@ -12,7 +12,7 @@ function location_out_of_player_control(unit_loc){ return (array_contains(_locs,unit_loc )); } -#macro planet_problem_keys ["meeting_trap","meeting","succession","mech_raider","mech_bionics","mech_mars","mech_tomb1","fallen","great_crusade","harlequins","fund_elder","provide_garrison","hunt_beast","protect_raiders","join_communion","join_parade","recover_artifacts","train_forces","spyrer","inquisitor","recon","cleanse","purge","tyranid_org","artifact_loan","necron","ethereal","demon_world"] +#macro planet_problem_keys ["meeting_trap","meeting","succession","mech_raider","mech_bionics","mech_mars","mech_tomb1","fallen","great_crusade","harlequins","fund_elder","provide_garrison","hunt_beast","protect_raiders","join_communion","join_parade","recover_artifacts","train_forces","spyrer","inquisitor","recon","cleanse","purge","tyranid_org","artifact_loan","necron","ethereal","demon_world","deliver_trophy"] function mission_name_key(mission){ var mission_key = { @@ -86,13 +86,15 @@ function scr_new_governor_mission(planet, problem = ""){ }; if (problem != ""){ if (problem == "provide_garrison"){ - if (system_garrison[planet-1].garrison_force) then exit; + if (system_garrison[planet-1].garrison_force){ + exit; + } mission_data.reason = choose("stability", "importance"); } else if (problem=="purge_enemies"){ var enemy = 0; if (planets>1){ for (var i=1;i<=planets;i++){ - if(i=planet) then continue; + if (i=planet) then continue; if (p_owner[i]==eFACTION.Imperium){ enemy=i; break; @@ -151,30 +153,6 @@ function init_garrison_mission(planet, star, mission_slot){ } - - -function init_beast_hunt_mission(planet, star, mission_slot){ - var problems_data = star.p_problem_other_data[planet] - var mission_data = problems_data[mission_slot]; - if (mission_data.stage == "preliminary"){ - var numeral_name = planet_numeral_name(planet, star); - mission_data.stage = "active"; - var _mission_length=(irandom_range(2,5)); - star.p_timer[planet][mission_slot] = _mission_length; - //pop.image="ancient_ruins"; - var gar_pop=instance_create(0,0,obj_popup); - //TODO some new universal methods for popups - gar_pop.title=$"Marines assigned to hunt beasts around {numeral_name}"; - gar_pop.text=$"The govornor of {numeral_name} Thanks you for the participation of your elite warriors in your execution of such a menial task."; - //pip.image="event_march" - gar_pop.add_option("Happy Hunting"); - gar_pop.image=""; - gar_pop.cooldown=8; - obj_controller.cooldown=20; - scr_event_log("",$"Beast hunters deployed to {numeral_name} for {_mission_length} months.", star.name); - } -} - function role_compare(unit, role){ return unit.role() == obj_ini.role[100][role]; } @@ -355,8 +333,8 @@ function complete_garrison_mission(targ_planet, problem_index){ _mission_string+=$"while stationed {p_garrison.garrison_leader.name_role()} makes several notable observations and is able to instruct the planets defense core leaving the world better defended (fortifications++)."; } //TODO just generall apply this each turn with a garrison to see if a cult is found - if (planet_feature_bool(p_feature[targ_planet], P_features.Gene_Stealer_Cult)){ - var cult = return_planet_features(planet.features,P_features.Gene_Stealer_Cult)[0]; + if (planet_feature_bool(p_feature[targ_planet], P_features.GeneStealerCult)){ + var cult = return_planet_features(planet.features,P_features.GeneStealerCult)[0]; if (cult.hiding){ widom_test = tester.standard_test(p_garrison.garrison_leader, "wisdom",0, ["tyranids"]); if (widom_test[0]){ @@ -392,10 +370,10 @@ function complete_train_forces_mission(targ_planet, problem_index){ var _tyannic_vet = _trainer.has_trait("tyrannic_vet"); if (_tyannic_vet){ _wis_test_difficulty += 10; - if (planet.has_feature(P_features.Gene_Stealer_Cult)){ - var _cult = planet.get_features(P_features.Gene_Stealer_Cult)[0]; + if (planet.has_feature(P_features.GeneStealerCult)){ + var _cult = planet.get_features(P_features.GeneStealerCult)[0]; if (_cult.hiding){ - planet.delete_feature(P_features.Gene_Stealer_Cult); + planet.delete_feature(P_features.GeneStealerCult); _mission_string += $"Fortune has smiled on this mission, {_trainer.name_role()}'s abilities as a Veteran of dealing with the Tyranids came in handy and in a short period was able to discern the existencee of a cult. He was able to organise those he considered to be still loyal to rally an extermiation of the cult, reeports suggest he was so successful as to have completely wiped the genestealer presence from the planet"; } } @@ -471,6 +449,32 @@ function complete_train_forces_mission(targ_planet, problem_index){ } } } + +function init_beast_hunt_mission(planet, star, mission_slot){ + var problems_data = star.p_problem_other_data[planet] + var mission_data = problems_data[mission_slot]; + if (mission_data.stage == "preliminary"){ + var numeral_name = planet_numeral_name(planet, star); + mission_data.stage = "active"; + var _mission_length=(irandom_range(2,5)); + star.p_timer[planet][mission_slot] = _mission_length; + //pop.image="ancient_ruins"; + var gar_pop=instance_create(0,0,obj_popup); + //TODO some new universal methods for popups + gar_pop.title=$"Marines assigned to hunt beasts around {numeral_name}"; + gar_pop.text=$"The govornor of {numeral_name} Thanks you for the participation of your elite warriors in your execution of such a menial task."; + //pip.image="event_march" + gar_pop.add_option({ + str1: "Happy Hunting" + }); + gar_pop.image=""; + gar_pop.cooldown=8; + obj_controller.cooldown=20; + scr_event_log("",$"Beast hunters deployed to {numeral_name} for {_mission_length} months.", star.name); + } +} + + function complete_beast_hunt_mission(targ_planet, problem_index){ var planet = new PlanetData(targ_planet, self); if (problem_has_key_and_value(targ_planet,problem_index,"stage","active")){ @@ -490,18 +494,19 @@ function complete_beast_hunt_mission(targ_planet, problem_index){ remove_planet_problem(targ_planet, "hunt_beast"); return; } + var _successful_hunters = []; + var _largest_pass= 0; for (var i=0;i 20 && array_length(_navy_fleets)){ + _pop_data = { + trophy_owner : array_random_element(_successful_hunters), + system: self.name, + planet : targ_planet, + target_fleet : array_random_element(_navy_fleets) + }; + + var _options = { + choice_func : init_deliver_trophy_mission, + str1 : "Continue", + } + + _pop_data.options = _options; + } if (_success){ _mission_string = $"The mission was a success and a great number of beasts rounded up and slain, your marines were able to gain great skills and the prestige of your chapter has increased greatly across the planets populace." if (_deaths){ @@ -532,12 +555,84 @@ function complete_beast_hunt_mission(targ_planet, problem_index){ _mission_string = $"The mission was a failiure. The governor is disapointed and the legend of your chapter has undoubtedly been diminished"; _mission_string += $"\n{_unit_report_string}"; } - scr_popup($"Beast Hunt on {planet_numeral_name(i)}",_mission_string,"",""); + scr_popup($"Beast Hunt on {planet_numeral_name(i)}",_mission_string,"",_pop_data); remove_planet_problem(targ_planet, "hunt_beast"); + } else { remove_planet_problem(targ_planet, "hunt_beast"); } } +function init_deliver_trophy_mission(){ + text = $"After your marines return there is a great feast to honour them. Much fanfare is made of the great trophy {pop_data.trophy_owner.name_role()} bears, a great monstrous head as tall as he is that the governor proclaims must be the largest of it's kind and the momst fearsome beast in the sector."; + + text += $"\n\nAn astropathic message is later recieved from the Commander of an Imperial Navy fleet explaining that his fleet is currrently home to the {irandom_numeral(100)},{irandom_numeral(100)} and {irandom_numeral(100)} {pop_data.system} Regiments and pleads that the trophy be handed over to his fleet in order to boost the moral of the regiments and fleet in general"; + + replace_options([ + { + str1 : "Refuse and place the trophy into the Librarium", + choice_func : function(){ + scr_add_artifact(); + } + + }, + { + str1 : "Accept", + choice_func : accept_deliver_trophy_mission + } + ]); + +} + + + +function accept_deliver_trophy_mission(){ + text = $"You Send a reply to tell the commander you accept and will ensure the trophy is delivered in person by the marine that slew the beast"; + var _targ_fleet = pop_data.target_fleet; + + var _targ_fleet_intercept = fleets_next_location(_targ_fleet); + if (_targ_fleet.action==""){ + text += $"\n\n the fleet in question is currently active around the {_targ_fleet_intercept.name} system"; + } else { + text += $"\n\n the fleet will next be accessible around the {_targ_fleet_intercept.name} system"; + } + + pop_data.target_fleet = _targ_fleet.uid; + + pop_data.delivering_marine = pop_data.trophy_owner.name_role(); + var _t_owner = pop_data.trophy_owner; + pop_data.trophy_owner = _t_owner.uid; + + var _fleet_event = new FleetEvent(pop_data); + + _fleet_event.turn_end = "deliver_trophy_end_turn_check"; + _fleet_event.destroy = "deliver_trophy_mission_fleet_destroyed"; + _fleet_event.timer_end = "deliver_trophy_mission_timed_out"; + + _fleet_event.timer = 120; + + _targ_fleet.add_event(_fleet_event); + + reset_popup_options(); +} + + +///@mixin FleetEvent +function deliver_trophy_mission_timed_out(){ + scr_popup( + "Objective Forgotten", + $"It has been so long in the life of a mortal that the commanders that once saught your delivery of the trophy from the hunt on {fleetevent_data.system} have now all either died or moved to greener pastures. The trophy will instead remain in the chapters possession", + ); +} + +///@mixin FleetEvent +function deliver_trophy_mission_fleet_destroyed(){ + scr_popup( + "Fleet Destroyed", + $"With the Imperial Navy fleet containing the regiments from {fleetevent_data.system} destroyed there is no reason to now deliver the trophy from the hunt to them The trophy will instead remain in the chapters possession", + ); +} + + //TODO allow most of these functions to be condensed and allow arrays of problems or planets and maybe increase filtering options //filtering options could be done via universal methods that all the filters to be passed to many other game systems diff --git a/scripts/scr_mission_reward/scr_mission_reward.gml b/scripts/scr_mission_reward/scr_mission_reward.gml index 758755e91f..4049df5769 100644 --- a/scripts/scr_mission_reward/scr_mission_reward.gml +++ b/scripts/scr_mission_reward/scr_mission_reward.gml @@ -14,8 +14,6 @@ function scr_mission_reward(mission, star, planet) { if (mission="mars_spelunk"){ - - var roll1=roll_dice_chapter(1, 100, "high");;// For the first STC var found_stc=0,found_artifact=0,found_requisition=0; var techs_lost=0, techs_alive=0; diff --git a/scripts/scr_necron_tombs/scr_necron_tombs.gml b/scripts/scr_necron_tombs/scr_necron_tombs.gml index cb7adb1005..8d6480071d 100644 --- a/scripts/scr_necron_tombs/scr_necron_tombs.gml +++ b/scripts/scr_necron_tombs/scr_necron_tombs.gml @@ -5,7 +5,7 @@ function awaken_tomb_event(){ var valid_stars = array_filter_ext(stars, function(star, index){ - var tomb_world = scr_get_planet_with_feature(star,P_features.Necron_Tomb); + var tomb_world = scr_get_planet_with_feature(star,P_features.NecronTomb); if (tomb_world == -1) then return false; else { diff --git a/scripts/scr_ork_fleet_functions/scr_ork_fleet_functions.gml b/scripts/scr_ork_fleet_functions/scr_ork_fleet_functions.gml index 566029cad3..4c5743d283 100644 --- a/scripts/scr_ork_fleet_functions/scr_ork_fleet_functions.gml +++ b/scripts/scr_ork_fleet_functions/scr_ork_fleet_functions.gml @@ -82,8 +82,8 @@ function ork_fleet_arrive_target(){ //generate refugee ships to spread tyranids if (p_tyranids[ork_attack_planet]<=0){ - if (planet_feature_bool(p_feature[ork_attack_planet], P_features.Gene_Stealer_Cult)){ - _pdata.delete_feature(P_features.Gene_Stealer_Cult); + if (planet_feature_bool(p_feature[ork_attack_planet], P_features.GeneStealerCult)){ + _pdata.delete_feature(P_features.GeneStealerCult); adjust_influence(eFACTION.Tyranids, -25, ork_attack_planet); var nearest_imperial = nearest_star_with_ownership(x,y,eFACTION.Imperium, self.id); if (nearest_imperial != "none"){ diff --git a/scripts/scr_ork_planet_functions/scr_ork_planet_functions.gml b/scripts/scr_ork_planet_functions/scr_ork_planet_functions.gml index 4c03940d98..65d93f0163 100644 --- a/scripts/scr_ork_planet_functions/scr_ork_planet_functions.gml +++ b/scripts/scr_ork_planet_functions/scr_ork_planet_functions.gml @@ -80,7 +80,7 @@ function ork_ship_production(planet){ } function kill_warboss(){ - f_type = P_features.Victory_Shrine + f_type = P_features.VictoryShrine planet_display= $"{obj_controller.faction_leader[eFACTION.Ork]} Death Place"; Warboss = "dead"; parade = false; diff --git a/scripts/scr_planet_setup_functions/scr_planet_setup_functions.gml b/scripts/scr_planet_setup_functions/scr_planet_setup_functions.gml new file mode 100644 index 0000000000..89e5b400a4 --- /dev/null +++ b/scripts/scr_planet_setup_functions/scr_planet_setup_functions.gml @@ -0,0 +1,579 @@ + + + +function setup_forge_world(star, choice_planet, dock = 0){ + with(star){ + var _sys_data = obj_controller.system_setup_data + planet[choice_planet]=1; + p_type[choice_planet]="Forge"; + owner = eFACTION.Mechanicus; + p_owner[choice_planet] = owner; + p_first[choice_planet] = owner; + var _size = dock + if (_size == 0){ + if (_sys_data.large_docks == 0){ + var _size = 3; + } else { + _size = choose(2,3); + } + } + switch (_size){ + case 1: + _sys_data.small_docks++; + break + case 2: + _sys_data.medium_docks++; + break + case 3: + _sys_data.large_docks++; + break + + } + if (_size == 3){ + _sys_data.large_docks++; + } + array_push(p_feature[choice_planet], new PlanetFeature(P_features.ShipDock, {size : _size})); + } +} + +function setup_tau_world(star, planet){ + var _p = planet; + with (star){ + p_owner[_p] = eFACTION.Tau; + owner = eFACTION.Tau; + p_influence[_p][eFACTION.Tau]=70; + p_first[_p] = eFACTION.Tau; + } +} + +function setup_chaos_world(star, planet){ + var _p = planet; + with (star){ + planet[_p]=1; + p_owner[_p]=10; + p_heresy[_p] = irandom_range(30, 80); + owner = eFACTION.Chaos; + } +} + + +function setup_sisters_world(star, planet){ + var _p = planet; + with (star){ + p_owner[_p]=5; + p_first[_p]=5; + p_sisters[_p]=4; + adjust_influence(eFACTION.Ecclesiarchy, (p_sisters[_p]*10)-irandom(5), _p); + } +} + +function setup_genecult_infestation(){ + var _planets = shuffled_planet_array(); + var _culted = false; + for (var i = 0; i < planets; i++) { + var _planet = _planets[i]; + if (!_culted){ + _add_cult = true + } else { + _add_cult = irandom(1); + } + if (_add_cult){ + if (p_population[_planet] > 0) { + _culted = true; + var new_cult = new PlanetFeature(P_features.GeneStealerCult); + array_push(p_feature[_planet], new_cult); + new_cult.cult_age = irandom(300) + p_influence[_planet][eFACTION.Tyranids] = new_cult.cult_age/10 + irandom(30); + p_tyranids[_planet] = min(3, floor(p_influence[_planet][eFACTION.Tyranids]/15)) + if (p_tyranids[_planet]!=0){ + new_cult.hiding = false; + } + } + } + p_owner[_planet] = 2; + } + owner = 2; +} + +function setup_star_planet_defualts(){ + // the min population of a planet is usually 1/3 of the max. so lava has 1500 max. min is 500. min + random should = max + // its important to know the population of a planet due to recruitment changing depending on population max + // If getting to max pop is very rare, it will be awful to recruit from + // some planets may be better or worse than others depending on their max pop. + // TODO refactor and improve logic + var _sys_data = obj_controller.system_setup_data + with(obj_star){ + for(var i=1; i<=planets; i++){ + + p_population[i]=0;// 10B + switch (p_type[i]) { + case "Lava": + p_population[i] = irandom(1500) + 500; + p_station[i] = 2; + p_max_population[i] = 100000; + break; + case "Desert": + p_population[i] = irandom(150000000) + 100000000; + p_fortified[i] = choose(2, 3, 4); + p_station[i] = 3; + p_max_population[i] = 250000000; + break; + case "Hive": + p_population[i] = random(100) + 50; + p_large[i] = 1; + p_fortified[i] = 4; + p_station[i] = choose(4, 5); + p_max_population[i] = 150; + break; + case "Agri": + p_population[i] = irandom(1000000) + 500000; + p_fortified[i] = choose(0, 1); + p_station[i] = choose(0, 1); + p_max_population[i] = 1500000; + break; + case "Temperate": + p_population[i] = irandom(4) + 2; + p_large[i] = 1; + p_fortified[i] = choose(3, 4); + p_station[i] = choose(3, 4); + p_max_population[i] = 6; + break; + case "Shrine": + p_population[i] = irandom(5) + 3; + p_large[i] = 1; + p_fortified[i] = choose(4, 5); + p_station[i] = choose(4, 5); + p_max_population[i] = 8; + break; + case "Ice": + p_population[i] = irandom(13500000) + 6500000; + p_fortified[i] = choose(1, 2, 3); + p_station[i] = choose(1, 2, 3); + p_max_population[i] = 20000000; + break; + case "Feudal": + p_population[i] = irandom(400000000) + 200000000; + p_fortified[i] = choose(2, 3); + p_station[i] = choose(2, 3, 4); + p_max_population[i] = 600000000; + break; + case "Forge": + p_population[i] = random(26) + 4; + p_large[i] = 1; + p_fortified[i] = 5; + p_station[i] = 5; + p_max_population[i] = 30; + break; + case "Death": + p_population[i] = irandom(300000) + 200000; + p_station[i] = choose(2, 3); + p_max_population[i] = 500000; + break; + case "Craftworld": + p_population[i] = irandom_range(150000, 300000); + p_station[i] = 6; + p_max_population[i] = p_population[i]; + break; + } + if (_sys_data.map_dock_qouta){ + switch (p_type[i]) { + case "Temperate": + case "Shrine": + if (!irandom(3)){ + array_push(p_feature[i], new PlanetFeature(P_features.ShipDock, {size : choose(1,2)})); + _sys_data.map_dock_qouta--; + } + break; + case "Hive": + if (irandom(1)){ + array_push(p_feature[i], new PlanetFeature(P_features.ShipDock, {size : 2})); + _sys_data.map_dock_qouta--; + } + break; + case "Feudal": + case "Desert" : + if (!irandom(5)){ + array_push(p_feature[i], new PlanetFeature(P_features.ShipDock, {size : 1})); + _sys_data.map_dock_qouta--; + } + case "Agri": + case "Lava": + if (!irandom(1)){ + array_push(p_feature[i], new PlanetFeature(P_features.ShipDock, {size : 1})); + _sys_data.map_dock_qouta--; + } + } + } + // Sets military on planet + if (p_population[i]>=10000000){ + var military=p_population[i]/470; + p_guardsmen[i]=floor(military*0.25); + p_pdf[i]=floor(military*0.75); + } + if (p_population[i]>=5000000) and (p_population[i]<10000000){ + var military=p_population[i]/200; + p_guardsmen[i]=floor(military*0.25); + p_pdf[i]=floor(military*0.75); + } + if (p_population[i]>=100000) and (p_population[i]<5000000){ + var military=p_population[i]/50; + p_guardsmen[i]=floor(military*0.25); + p_pdf[i]=floor(military*0.75); + } + if (p_population[i]<100000) and (p_population[i]>5) and (p_large[i]==0){ + p_pdf[i]=floor(p_population[i]/25); + } + if (p_population[i]<2000) and (p_population[i]>5) and (p_large[i]==0){ + p_pdf[i]=floor(p_population[i]/10); + } + if (p_large[i]==1){ + p_guardsmen[i]=floor(p_population[i]*1250000); + p_pdf[i]=p_guardsmen[i]*3; + } + + if (p_population[i]<1000000) and (p_large[i]==0)then p_pop[i]=string(p_population[i]); + if (p_population[i]>999999) and (p_large[i]==0)and (p_population[i]<1000000000) then p_pop[i]=string(p_population[i]/1000000)+"M"; + if (p_large[i]==1) then p_pop[i]=string(p_population[i])+"B"; + + if (craftworld==1){ + p_guardsmen[i]=0; + p_pdf[i]=0; + p_eldar[i]=6; + owner = eFACTION.Eldar; + p_owner[1]=6; + warp_lanes=[]; + x2=0; + } + // p_guardsmen[i]=0; + } + + for(var i=1; i<=4; i++){p_guardsmen[i]=0;} + + var fleet, system_fleet=0,capital=0,frigate=0,escort=0; + // Create Imperium Fleet + if (owner == eFACTION.Imperium || owner == eFACTION.Ork || owner == eFACTION.Mechanicus){ + for(var g=1; g<=4; g++){ + switch (p_type[g]) { + case "Hive": + system_fleet += 4; + break; + case "Forge": + system_fleet += 8; + break; + case "Desert": + case "Temperate": + system_fleet += 1; + break; + case "Feudal": + case "Ice": + system_fleet += 0.5; + break; + case "Shrine": + system_fleet += 2; + break; + } + } + + frigate=round(system_fleet/2); + escort=round(system_fleet); + + if (capital<0) then capital=0; + if (frigate<0) then frigate=0; + if (escort<0) then escort=0; + + if (system_fleet>0){ // DISABLED FOR TESTING FLEET COMBAT + fleet=instance_create(x,y,obj_en_fleet); + fleet.owner = eFACTION.Imperium; + + fleet.capital_number=capital; + fleet.frigate_number=frigate; + fleet.escort_number=escort; + + // present_fleet[2]+=1; + + // Create ships here + fleet.image_speed=0; + var ii=0; + ii+=capital-1; + ii+=round((frigate/2)); + ii+=round((escort/4)); + if (ii<=1) and (capital+frigate+escort>0) then ii=1; + fleet.image_index=ii; + } + } + // Creates Ork forces + if (owner == eFACTION.Ork){ + for (var i=1;i<=planets;i++){ + if (p_population[i]>0){ + p_orks[i]=choose(1,2,3,3,4,5); + } + if (p_type[i]=="Forge" || p_type[i]="Hive"){ + p_orks[i] = 5; + } + } + + } + + system_fleet=1; + capital=0; + frigate=0; + escort=0; + // Create Tau Fleet + if (owner == eFACTION.Tau){ + for (var i = 1; i <= planets; i++) { + if (p_type[i] == "Desert") { + system_fleet += 5; + } + } + + if (system_fleet>=4){ + capital=choose(1,2,2,2,3,4); + frigate=floor(random_range(5,10)); + escort=floor(random_range(8,14)); + } + if (system_fleet>=1) and (system_fleet<3){ + capital=choose(1,2,2); + frigate=floor(random_range(4,8)); + escort=floor(random_range(5,12)); + } + if (system_fleet>0){ + fleet=instance_create(x,y,obj_en_fleet); + fleet.owner = eFACTION.Tau; + // Create ships here + fleet.sprite_index=spr_fleet_tau; + fleet.image_speed=0; + + fleet.capital_number=capital; + fleet.frigate_number=frigate; + fleet.escort_number=escort; + + fleet.image_index=floor((capital)+(frigate/2)+(escort/4)); + } + + for (var i = 1; i <=planets; i++) { + if (p_type[i] != "Dead") { + p_tau[i] = choose(1,2,3,4); + } + } + for (var i = 1; i <=planets; i++) { + if (p_type[i] == "Desert" && p_tau[i] < 4) { + p_tau[i] = 4; + } + } + for (var i = 1; i <=planets; i++) { + if (p_tau[i] > 0) { + p_owner[i] = 8; + p_first[i] = 8; + + switch (p_type[i]) { + case "Forge": + case "Hive": + p_tau[i] = choose(2,3); + break; + case "Ice": + p_tau[i] = choose(1,2); + break; + case "Temperate": + case "Desert": + case "Feudal": + p_tau[i] = choose(3,3,4,4,5); + break; + } + } + } + for (var i=1;i<=planets;i++){ + p_owner[i]=eFACTION.Tau; + p_first[i]=eFACTION.Tau; + p_influence[i][eFACTION.Tau]=65+irandom(15); + } + } + // Create Nids + if (owner == eFACTION.Tyranids){ + setup_genecult_infestation(); + } + + for(var i=1; i<=planets; i++){ + if (p_owner[i]=8) and (p_guardsmen[i]>0){ + p_pdf[i]+=p_guardsmen[i]; + p_guardsmen[i]=0; + } + if (p_type[i]="Shrine") and (p_owner[i]!=1) and (p_first[i]!=1){ + setup_sisters_world(self, i); + } + // if (p_owner[i]=3) or (p_owner[i]=5){p_feature[i]="Artifact|";}Testing ; 137 + } + + if (name=="Kim Jong") and (owner == eFACTION.Chaos){ + for (var i = 1; i <=planets; i++) { + if (p_type[i] != "Dead") { + p_heresy[i] = 100; + p_traitors[i] = 2; + } + } + } + + wait_and_execute(1,scr_income,[],obj_controller); + wait_and_execute(10,create_start_imperial_fleets,[],obj_controller); + + var i=choose(0,1); + if (i==1) and (planets>0){ + var nostart=false,aa=0; + i=floor(random(planets))+1; + + if (instance_exists(obj_p_fleet)) { + aa = instance_nearest(x, y, obj_p_fleet); + if (point_distance(x, y, aa.x, aa.y) > 50) { + nostart = true; + } + } + if (!instance_exists(obj_p_fleet)) then nostart=true; + + if (array_length(p_feature[i])==0) and (p_owner[i]!=1) and (nostart){ + var ranb=0; + // if (ranb=1) and (p_owner[i]!=1) and (p_owner[i]!=2) and (p_owner[i]!=3) then ranb=floor(random(4))+2; + // + var goo=0; + if (goo==0){ + for(var j=0; j<10; j++){ + if (goo==0)and (irandom(9)<2){ + ranb=floor(random(6))+1; + + switch (name) { + case "Vulvis Major": + ranb = 1; + break; + case "Necron Assrape": + ranb = 2; + break; + case "Morrowynd": + ranb = 5; + break; + } + + if (goo==0){ + switch (ranb){ + case 1: + array_push(p_feature[i], new PlanetFeature(P_features.SororitasCathedral)) + if (p_heresy[i]>10) then p_heresy[i]-=10; + p_sisters[i]=choose(2,2,3); + adjust_influence(eFACTION.Ecclesiarchy, (p_sisters[i]*10)-irandom(3), i) + goo=1; + break; + case 2: + if (p_type[i]!="Hive") and (p_type[i]!="Lava") and (goo==0){ + array_push(p_feature[i], new PlanetFeature(P_features.NecronTomb)) + goo=1; + } + break; + case 3: + array_push(p_feature[i], new PlanetFeature( P_features.Artifact)) + goo=1; + break; + case 4: + array_push(p_feature[i], new PlanetFeature( P_features.STCFragment)) + goo=1; + break; + case 5: + if (p_type[i]!="Ice") and (p_type[i]!="Dead") and (p_type[i]!="Feudal"){ + goo=1; + array_push(p_feature[i], new PlanetFeature( P_features.AncientRuins)) + } + break; + //alternative spawn for necron tomb probably needs merging with other method + case 6: + if ((p_type[i]=="Ice") or (p_type[i]=="Dead")){ + array_push(p_feature[i], new PlanetFeature( P_features.NecronTomb)) + goo=1; + } + break; + case 7: + if ((p_type[i]=="Dead") or (p_type[i]=="Desert")){ + var randum=floor(random(100))+1; + if (randum<=25){ + array_push(p_feature[i], new PlanetFeature( P_features.CaveNetwork)) + goo=1; + } + } + break; + } + } + } + } + } + } + } + + var hyu=0; + for(var i=1; i<=4; i++){ + if (p_tyranids[i]>=5){ + p_guardsmen[i]=0; + p_pdf[i]=0; + p_population[i]=0; + hyu+=1; + p_owner[i]=9; + } + if (p_first[i]<=5) and (dispo[i]>-5000){ + dispo[i]=-20; + } + } + if (hyu==0) and (owner == eFACTION.Tyranids) then owner = eFACTION.Imperium; + + scr_star_ownership(false); + + if (obj_controller.is_test_map=true){ + /*if (p_owner[1]=3) then p_feature[1]="STC Fragment|"; + if (p_owner[2]=3) then p_feature[2]="STC Fragment|"; + if (p_owner[3]=3) then p_feature[3]="STC Fragment|"; + + + // Testing new guardsmen + p_guardsmen[1]=5000000; + p_tyranids[1]=4; + + p_guardsmen[2]=500000; + p_tyranids[2]=3; + + p_guardsmen[3]=100000; + p_tyranids[3]=2; + + p_orks[1]=0;p_orks[2]=0;p_orks[3]=0;*/ + } + + // if (obj_controller.is_test_map=true) and (p_owner[2]=1){ + + if (p_owner[2]=1){ + /* + p_guardsmen[2]=10000000; + p_pdf[2]=0; + obj_controller.faction_status[eFACTION.Imperium]="War"; + */ + + // p_type[1]="Dead"; + // p_feature[2]=""; + + // p_orks[2]=3; + // p_feature[2]="Starship!0!|"; + + /*repeat(4){ + var fleet;fleet=instance_create(x+(floor(random_range(100,200))*choose(1,-1)),y+(floor(random_range(100,200))*choose(1,-1)),obj_en_fleet); + fleet.owner = eFACTION.Chaos;fleet.sprite_index=spr_fleet_chaos;fleet.orbiting=0; + fleet.action_x=x;fleet.action_y=y;fleet.alarm[4]=1; + + fleet.capital_number=0; + fleet.frigate_number=1; + fleet.escort_number=2; + + // Create ships here + fleet.image_speed=0; + var ii;ii=0;ii+=capital-1;ii+=round((frigate/2));ii+=round((escort/4)); + if (ii<=1) and (capital+frigate+escort>0) then ii=1; + fleet.image_index=ii; + }*/ + + } + + if (obj_controller.is_test_map!=true) and (p_owner[2]!=1){ + for(var i=1; i<=4; i++){p_guardsmen[i]=0;} + } + } +} \ No newline at end of file diff --git a/scripts/scr_planet_setup_functions/scr_planet_setup_functions.yy b/scripts/scr_planet_setup_functions/scr_planet_setup_functions.yy new file mode 100644 index 0000000000..39fec4560d --- /dev/null +++ b/scripts/scr_planet_setup_functions/scr_planet_setup_functions.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"scr_planet_setup_functions", + "isCompatibility":false, + "isDnD":false, + "name":"scr_planet_setup_functions", + "parent":{ + "name":"Sys", + "path":"folders/Scripts/Sys.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/scr_planetary_feature/scr_planetary_feature.gml b/scripts/scr_planetary_feature/scr_planetary_feature.gml index a793501f93..891eb67ee9 100644 --- a/scripts/scr_planetary_feature/scr_planetary_feature.gml +++ b/scripts/scr_planetary_feature/scr_planetary_feature.gml @@ -1,34 +1,34 @@ enum P_features { - Sororitas_Cathedral, - Necron_Tomb, + SororitasCathedral, + NecronTomb, Artifact, - STC_Fragment, - Ancient_Ruins, - Cave_Network, - Recruiting_World, + STCFragment, + AncientRuins, + CaveNetwork, + RecruitingWorld, Monastery, Warlord6, OrkWarboss, Warlord10, - Special_Force, + SpecialForce, ChaosWarband, Webway, - Secret_Base, + SecretBase, Starship, - Succession_War, - Mechanicus_Forge, - Reclamation_pools, - Capillary_Towers, - Daemonic_Incursion, - Victory_Shrine, + SuccessionWar, + MechanicusForge, + ReclamationPools, + CapillaryTowers, + DaemonicIncursion, + VictoryShrine, Arsenal, - Gene_Vault, + GeneVault, Forge, - Gene_Stealer_Cult, + GeneStealerCult, Mission, - OrkStronghold - - }; + OrkStronghold, + ShipDock +}; enum base_types{ Lair, @@ -43,31 +43,35 @@ function PlayerForge() constructor{ } // Function creates a new struct planet feature of a specified type -function NewPlanetFeature(feature_type, other_data={}) constructor{ +function PlanetFeature(feature_type, other_data={}) constructor{ f_type = feature_type; + player_hidden=false; static reveal_to_player = function(){ if (player_hidden == 1){ player_hidden = 0; } } + uid = scr_uuid_generate(); switch(f_type){ - case P_features.Gene_Stealer_Cult: + case P_features.GeneStealerCult: PDF_control = 0; sealed = 0; - player_hidden = 1; + player_hidden = false; + hive_summoned=false; planet_display = "Genestealer Cult"; cult_age = 0; hiding=true; name = global.name_generator.generate_genestealer_cult_name(); break; - case P_features.Necron_Tomb: + + case P_features.NecronTomb: awake = 0; sealed = 0; player_hidden = 1 planet_display = "Dormant Necron Tomb"; break; - case P_features.Secret_Base: + case P_features.SecretBase: base_type = base_types.Lair; inquis_hidden =1; planet_display = "Hidden Secret Base"; @@ -97,7 +101,7 @@ function NewPlanetFeature(feature_type, other_data={}) constructor{ player_hidden = 0; built = obj_controller.turn+3; break; - case P_features.Gene_Vault: + case P_features.GeneVault: inquis_hidden=1; planet_display = "Arsenal"; player_hidden = 0; @@ -110,7 +114,7 @@ function NewPlanetFeature(feature_type, other_data={}) constructor{ player_hidden = 0; engineer_score = 0; break; - case P_features.Ancient_Ruins: + case P_features.AncientRuins: static ruins_explored = scr_ruins_explored; static explore = scr_explore_ruins; static determine_race = scr_ruins_determine_race; @@ -121,17 +125,17 @@ function NewPlanetFeature(feature_type, other_data={}) constructor{ static ruins_combat_end=scr_ruins_combat_end; scr_ancient_ruins_setup(); break; - case P_features.STC_Fragment: + case P_features.STCFragment: player_hidden = 1; Fragment_type =0; planet_display = "STC Fragment"; break; - case P_features.Cave_Network: + case P_features.CaveNetwork: player_hidden = 1; cave_depth =irandom(3);//allow_multiple levels of caves, option to go deeper planet_display = "Unexplored Cave Network"; break; - case P_features.Sororitas_Cathedral: + case P_features.SororitasCathedral: player_hidden = 1; planet_display = "Sororitas Cathedral"; break; @@ -157,12 +161,37 @@ function NewPlanetFeature(feature_type, other_data={}) constructor{ forge=0; name=global.name_generator.generate_imperial_ship_name(); break; - case P_features.Recruiting_World: + case P_features.RecruitingWorld: planet_display="Recruitment"; player_hidden = 0; recruit_type = 0; recruit_cost = 0; break; + case P_features.ShipDock: + player_hidden = 0; + size = 1; + move_data_to_current_scope(other_data); + switch(size){ + case 1: + capacity = 3; + break; + case 2: + capacity = 9; + break; + case 3: + capacity = 20; + break; + } + space_taken = 0; + static has_dock_space = function(dock_space_wanted){ + if (size >= dock_space_wanted){ + return (capacity-space_taken >= dock_space_wanted); + } else { + return false; + } + } + planet_display = "Docks"; + break; case P_features.ChaosWarband: if !(struct_exists(other_data, "patron")){ patron = choose("slaanesh", "tzeentch", "khorne", "nurgle", "undivided"); @@ -182,6 +211,7 @@ function NewPlanetFeature(feature_type, other_data={}) constructor{ variable_struct_set(self, names[i], variable_struct_get(data, names[i])) } } + move_data_to_current_scope(other_data); } function move_feature_to_fleet(planet, feature_slot, fleet, cargo_key){ var _feat = p_feature[planet][feature_slot]; @@ -192,6 +222,30 @@ function move_feature_to_fleet(planet, feature_slot, fleet, cargo_key){ function move_feature_to_planet(cargo_key, star, planet){ } +function search_system_features_uid(system, uuid){ + var sys_bool = false; + for (var sys =1; sys<5; sys++){ + sys_bool = search_planet_features_uid(system[sys], uuid) + if (sys_bool!=false){ + break; + } + } + return sys_bool; +} + +function search_planet_features_uid(planet, uuid){ + var feature_count = array_length(planet); + var _feature = false; + if (feature_count > 0){ + for (var fc = 0; fc < feature_count; fc++){ + if (planet[fc].uid == uuid){ + return planet[fc]; + } + } + } + return _feature; +} + // returns an array of all the positions that a certain planet feature occurs on th p_feature array of a planet // this works for both planet_Features and planet upgrades function search_planet_features(planet, search_feature){ @@ -274,11 +328,28 @@ function awake_necron_star(star){ return 0 } +function planet_player_hidden_feature(planet){ + for (var i=0;i0){ for (var tomb =0;tomb0){ for (var tomb =0;tomb0){ for (var tomb =0;tomb10) then p_heresy[planet_num]-=10; p_sisters[planet_num]=choose(2,2,3);goo=1; break; - case P_features.Necron_Tomb: + case P_features.NecronTomb: var lop=$"Necron Tomb discovered on {numeral_n}."; scr_alert("red","feature",lop,x,y); scr_event_log("red",lop); @@ -354,17 +425,17 @@ function scr_planetary_feature(planet_num) { scr_alert("green","feature",lop,x,y); scr_event_log("",lop); break; - case P_features.STC_Fragment: + case P_features.STCFragment: var lop=$"STC Fragment located on {numeral_n}."; scr_alert("green","feature",lop,x,y); scr_event_log("",lop); break; - case P_features.Ancient_Ruins: + case P_features.AncientRuins: var lop=$"A {feat.ruins_size} Ancient Ruins discovered on {string(name)} {scr_roman(planet_num)}."; scr_alert("green","feature",lop,x,y); scr_event_log("",lop); break; - case P_features.Cave_Network: + case P_features.CaveNetwork: var lop=$"Extensive Cave Network discovered on {numeral_n}."; scr_alert("green","feature",lop,x,y); scr_event_log("",lop); @@ -386,7 +457,7 @@ function create_starship_event(){ return false; }else { var planet=irandom(star.planets-1)+1; - array_push(star.p_feature[planet], new NewPlanetFeature(P_features.Starship)) + array_push(star.p_feature[planet], new PlanetFeature(P_features.Starship)) scr_event_log("","Ancient Starship discovered on "+string(star.name)+" "+scr_roman(planet)+".", star.name); } } @@ -547,7 +618,7 @@ function planet_selection_action(){ /// @mixin PlanetData function check_for_stc_grab_mission(){ // STC Grab - if (has_feature(P_features.STC_Fragment)){ + if (has_feature(P_features.STCFragment)){ var _techs=0,_mech_techs = 0; var _units = obj_controller.display_unit; for (var frag=0; frag < array_length(_units); frag++){ @@ -929,7 +1000,7 @@ function remove_stc_from_planet(){ with(obj_star_select){instance_destroy();} with(obj_fleet_select){instance_destroy();} - pdata.delete_feature(P_features.STC_Fragment); + pdata.delete_feature(P_features.STCFragment); scr_add_stc_fragment();// STC here @@ -977,7 +1048,7 @@ function send_stc_to_adeptus_mech(){ with (obj_ground_mission){ var _target_planet; _target_planet = instance_nearest(x, y, obj_star); - pdata.delete_feature(P_features.STC_Fragment); + pdata.delete_feature(P_features.STCFragment); scr_return_ship(pdata.system.name, self, pdata.planet); diff --git a/scripts/scr_player_fleet_combat_functions/scr_player_fleet_combat_functions.gml b/scripts/scr_player_fleet_combat_functions/scr_player_fleet_combat_functions.gml index 96bd4d704e..ee58f9fad2 100644 --- a/scripts/scr_player_fleet_combat_functions/scr_player_fleet_combat_functions.gml +++ b/scripts/scr_player_fleet_combat_functions/scr_player_fleet_combat_functions.gml @@ -5,66 +5,123 @@ function add_fleet_ships_to_combat(fleet, combat){ var _ship_id; var _ships = fleet_full_ship_array(fleet); var _ship_array_length = array_length(_ships); + show_debug_message($"{_ships}") for (var i=0;i<_ship_array_length;i++){ try{ if (i>=array_length(_ships)) then break; _ship_id = _ships[i]; - if (obj_ini.ship_hp[_ship_id]<=0 || obj_ini.ship[_ship_id]==""){ + var _ship_d = obj_ini.ship_data[i]; + if (_ship_d.hp<=0){ continue; } - if (obj_ini.ship_size[_ship_id]>=3) then combat.capital++; - if (obj_ini.ship_size[_ship_id]==2) then combat.frigate++; - if (obj_ini.ship_size[_ship_id]==1) then combat.escort++; + if (_ship_d.size>=3) then combat.capital++; + if (_ship_d.size==2) then combat.frigate++; + if (_ship_d.size==1) then combat.escort++; + + array_push(combat.ship_data , _ship_d); - array_push(combat.ship_class, player_ships_class(_ship_id)); - array_push(combat.ship, obj_ini.ship[_ship_id]); array_push(combat.ship_id, _ship_id); - array_push(combat.ship_size, obj_ini.ship_size[_ship_id]); - array_push(combat.ship_leadership, 100); - array_push(combat.ship_hp, obj_ini.ship_hp[_ship_id]); - array_push(combat.ship_maxhp, obj_ini.ship_maxhp[_ship_id]); - array_push(combat.ship_conditions, obj_ini.ship_conditions[_ship_id]); - array_push(combat.ship_speed, obj_ini.ship_speed[_ship_id]); - array_push(combat.ship_turning, obj_ini.ship_turning[_ship_id]); - array_push(combat.ship_front_armour, obj_ini.ship_front_armour[_ship_id]); - array_push(combat.ship_other_armour, obj_ini.ship_other_armour[_ship_id]); - array_push(combat.ship_weapons, obj_ini.ship_weapons[_ship_id]); - - array_push(combat.ship_wep, obj_ini.ship_wep[_ship_id]); - array_push(combat.ship_wep_facing, obj_ini.ship_wep_facing[_ship_id]); - array_push(combat.ship_wep_condition, obj_ini.ship_wep_condition[_ship_id]); - array_push(combat.ship_capacity, obj_ini.ship_capacity[_ship_id]); - array_push(combat.ship_carrying, obj_ini.ship_carrying[_ship_id]); - array_push(combat.ship_contents, obj_ini.ship_contents[_ship_id]); - array_push(combat.ship_turrets, obj_ini.ship_turrets[_ship_id]); } catch (_exception){ handle_exception(_exception); } } + sort_ships_into_columns(obj_fleet); + + with (obj_fleet){ + player_fleet_ship_spawner(); + } +} + +function add_ai_fleet_to_combat(en_fleet, fleet_battle, status = -1){ + array_push(fleet_battle.enemy, en_fleet.owner); + array_push(fleet_battle.enemy_status, status); + + array_push(fleet_battle.en_capital, en_fleet.capital_number); + array_push(fleet_battle.en_frigate, en_fleet.frigate_number); + array_push(fleet_battle.en_escort, en_fleet.escort_number); + + if (fleet_has_cargo("warband", en_fleet)){ + fleet_battle.csm_exp+=2; + } + if (fleet_has_cargo("csm", en_fleet)){ + fleet_battle.csm_exp++; + } +} + +function setup_fleet_battle(combating, star){ + + obj_controller.combat=combating; + var _p_fleet = get_nearest_player_fleet(x,y,true); + var good = (_p_fleet!="none" and instance_exists(star)); + if (!good){ + obj_controller.combat = 0; + exit; + } + show_debug_message($"create combat {combating}"); + instance_create(0,0,obj_fleet); + obj_fleet.target_enemy = combating; + instance_activate_object(obj_en_fleet); + for (var e=2;e<12;e++){ + var _fleets = get_orbiting_fleets(e, star); + show_debug_message($"fleet : {_fleets}"); + if (!array_length(_fleets)){ + continue; + } + if (e == combating || obj_controller.faction_status[e]=="War"){ + show_debug_message("target combat fleet"); + for (var f=0;f=3)) then combat.column_num[col]+=1; - if ((combat.column[col-1]="capital" && combat.ship_size[k]>=3)) then combat.column_num[col-1]+=1; - if ((combat.column[col-2]="capital" && combat.ship_size[k]>=3)) then combat.column_num[col-2]+=1; - if ((combat.column[col-3]="capital" && combat.ship_size[k]>=3)) then combat.column_num[col-3]+=1; - if ((combat.column[col-4]="capital" && combat.ship_size[k]>=3)) then combat.column_num[col-4]+=1; - - if (combat.ship_class[k]=combat.column[col]) then combat.column_num[col]+=1; - if (combat.ship_class[k]=combat.column[col-1]) then combat.column_num[col-1]+=1; - if (combat.ship_class[k]=combat.column[col-2]) then combat.column_num[col-2]+=1; - if (combat.ship_class[k]=combat.column[col-3]) then combat.column_num[col-3]+=1; - if (combat.ship_class[k]=combat.column[col-4]) then combat.column_num[col-4]+=1; - - if ((combat.column[col]="escort" && combat.ship_size[k]=1)) then combat.column_num[col]+=1; - if ((combat.column[col-1]="escort" && combat.ship_size[k]=1)) then combat.column_num[col-1]+=1; - if ((combat.column[col-2]="escort" && combat.ship_size[k]=1)) then combat.column_num[col-2]+=1; - if ((combat.column[col-3]="escort" && combat.ship_size[k]=1)) then combat.column_num[col-3]+=1; - if ((combat.column[col-4]="escort" && combat.ship_size[k]=1)) then combat.column_num[col-4]+=1; + for (var k = 0;k0;col--){ + if ((combat.column[col]="capital" && _ship.size>=3)){ + combat.column_num[col]++; + } + else if (combat.column[col]=="frigate"&& _ship.size==2){ + combat.column_num[col]++; + } + else if ((combat.column[col]=="escort" && _ship.size==1)){ + combat.column_num[col]++; + } + } } } @@ -81,7 +138,7 @@ function player_fleet_ship_spawner(){ if (col<5) then x2-=column_width[col]; if (column_num[col]>0){// Start ship creation - if (column[col]=="capital"){ + if (column[col] == "capital" || column[col] == "Battle Barge"){ hei=160; sizz=3; } @@ -97,30 +154,34 @@ function player_fleet_ship_spawner(){ hei=64; sizz=1; } - else if (column[col]=="escort"){hei=64;sizz=1;} + else if (column[col]=="escort"){ + hei=64; + sizz=1; + } - temp1=column_num[col]*hei; - temp2=((room_height/2)-(temp1/2))+64; + temp1 = max(column_num[col],1) * hei; + temp2 = ((room_height/2)-(temp1/2))+64; if (column_num[col]=1) then temp2+=20; // show_message(string(column_num[col])+" "+string(column[col])+" X:"+string(x2)); for (var k = 0;k=3 && ship_class[k]!="") { + if (sizz>=3 && _ship.class!="") { man=instance_create(x2,temp2,obj_p_capital); man.ship_id=ship_id[k]; - temp2+=hei; + temp2 += hei; } - if (sizz=2 && ship_class[k]!="") { + if (sizz=2 && _ship.class!="") { man=instance_create(x2,temp2,obj_p_cruiser); man.ship_id=ship_id[k]; - temp2+=hei; + temp2 += hei; } - if (sizz=1 && ship_class[k]!="") { + if (sizz=1 && _ship.class!="") { man=instance_create(x2,temp2,obj_p_escort); man.ship_id=ship_id[k]; - temp2+=hei; + temp2 += hei; } if (instance_exists(man)){ with (man){ @@ -136,181 +197,103 @@ function player_fleet_ship_spawner(){ }// End repeat } +function draw_ellipse_rotated(){ -function setup_player_combat_ship(){ - action=""; - direction=0; - - - cooldown1=0; - cooldown2=0; - cooldown3=0; - cooldown4=0; - cooldown5=0; - - - name=obj_ini.ship[ship_id]; - class=obj_ini.ship_class[ship_id]; - hp=obj_ini.ship_hp[ship_id]*1; - maxhp=obj_ini.ship_hp[ship_id]*1; - conditions=obj_ini.ship_conditions[ship_id]; - shields=obj_ini.ship_shields[ship_id]*100; - maxshields=shields; - armour_front=obj_ini.ship_front_armour[ship_id]; - armour_other=obj_ini.ship_other_armour[ship_id]; - weapons=obj_ini.ship_weapons[ship_id]; - turrets=0; - ship_colour=obj_controller.body_colour_replace; - max_speed = obj_ini.ship_speed[ship_id]; - weapon = obj_ini.ship_wep[ship_id]; - - weapon_facing[1]=""; - weapon_cooldown[1]=0; - weapon_hp[1]=hp/4; - weapon_dam[1]=0; - weapon_ammo[1]=999; - weapon_range[1]=0; - weapon_minrange[1]=0; - weapon_facing[2]=""; - weapon_cooldown[2]=0; - weapon_hp[2]=hp/4; - weapon_dam[2]=0; - weapon_ammo[2]=999; - weapon_range[2]=0; - weapon_minrange[2]=0; - - weapon_facing[3]=""; - weapon_cooldown[3]=0; - weapon_hp[3]=hp/4; - weapon_dam[3]=0; - weapon_ammo[3]=999; - weapon_range[3]=0; - weapon_minrange[3]=0; - - weapon_facing[4]=""; - weapon_cooldown[4]=0; - weapon_hp[4]=hp/4; - weapon_dam[4]=0; - weapon_ammo[4]=999; - weapon_range[4]=0; - weapon_minrange[4]=0; - - weapon_facing[5]=""; - weapon_cooldown[5]=0; - weapon_hp[5]=hp/4; - weapon_dam[5]=0; - weapon_ammo[5]=999; - weapon_range[5]=0; - weapon_minrange[5]=0; - - - - - - if (class="Battle Barge"){ - turrets=3; - weapons=5; - shield_size=3; - sprite_index=spr_ship_bb; - weapon_facing[1]="left"; - weapon_dam[1]=15; - weapon_range[1]=450; - weapon_cooldown[1]=30; - weapon_facing[2]="right"; - weapon_dam[2]=15; - weapon_range[2]=450; - weapon_cooldown[2]=30; - weapon_facing[3]="special"; - weapon_cooldown[3]=90; - weapon_ammo[3]=3; - weapon_range[3]=9999; - weapon_facing[4]="front"; - weapon_dam[4]=12; - weapon_range[4]=1000; - weapon_cooldown[4]=120;// volley several - weapon_facing[5]="most"; - weapon_dam[5]=16; - weapon_range[5]=300; - weapon_cooldown[5]=30; +} +//data must have keys, shields, recharge, and reboot +function ShipShieldGenerator(data) constructor{ + move_data_to_current_scope(data); + destroyed = false; + disabled = false; + disabled_timer = 0; + x_scale = 1; + y_scale = 1; + shield_sprite = spr_ship_shields; + var _ship_sprite = ship.sprite_index; + x_scale = sprite_get_width(_ship_sprite) / sprite_get_width(shield_sprite); + y_scale = sprite_get_height(_ship_sprite) / sprite_get_height(shield_sprite); + + + static draw = function(){ + if (shields > 0 && !destroyed && !disabled){ + draw_sprite_ext(shield_sprite, 0, ship.x, ship.y, x_scale, y_scale, ship.direction, c_white, 1); + + draw_set_color(c_white); + var shield_percent = $"{(shields/maxshields)*100}%" + + draw_text_transformed(ship.x,ship.y-ship.sprite_height,shield_percent,x_scale*obj_controller.scale_mod,y_scale*obj_controller.scale_mod,0); + + } } - else if (class=="Slaughtersong" || class=="Gloriana"){turrets=3; - weapons=5;shield_size=3;sprite_index=spr_ship_song; - weapon_facing[1]="most"; - weapon_dam[1]=16; - weapon_range[1]=550; - weapon_cooldown[1]=26; - weapon_facing[2]="most"; - weapon_dam[2]=16; - weapon_range[2]=550; - weapon_cooldown[2]=26; - weapon_facing[3]="most"; - weapon_dam[3]=16; - weapon_range[3]=550; - weapon_cooldown[3]=26; - weapon_facing[4]="front"; - weapon_dam[4]=32; - weapon_range[4]=1000; - weapon_cooldown[4]=90; + static active = function(){ + return (shields && !destroyed && !disabled); } + static step = function(){ + if (destroyed){ + exit; + } + if (disabled){ + disabled_timer++; + if (disabled_timer >= shields_reboot_time){ + disabled_timer = 0; + disabled = false; + } else { + exit; + } + } - else if (class="Strike Cruiser"){turrets=1; - weapons=4;shield_size=1;sprite_index=spr_ship_stri; - weapon_facing[1]="left"; - weapon_dam[1]=8; - weapon_range[1]=300; - weapon_cooldown[1]=30; - weapon_facing[2]="right"; - weapon_dam[2]=8; - weapon_range[2]=300; - weapon_cooldown[2]=30; - weapon_facing[3]="special"; - weapon_cooldown[3]=90; - weapon_ammo[3]=3; - weapon_range[3]=9999; - weapon_facing[4]="most"; - weapon_dam[4]=12; - weapon_range[4]=300; - weapon_cooldown[4]=30; + if (!disabled){ + if (shields0) { which=array_random_index(mfleet.escort_num); sayd=mfleet.escort_num[which]; + var _ship = fetch_ship(sayd); if (!array_contains(ship_lost, sayd)){ esc_lost+=1; - obj_ini.ship_hp[sayd]=0; + _ship.hp=0; ship_lost[sayd]=1; mfleet.escort_number-=1; array_push(ship_lost, sayd); @@ -359,9 +335,10 @@ function player_retreat_from_fleet_combat(){ else if (mfleet.frigate_number>0) { which=array_random_index(mfleet.frigate_num); sayd=mfleet.frigate_num[which]; + var _ship = fetch_ship(sayd); if (!array_contains(ship_lost, sayd)){ frig_lost+=1; - obj_ini.ship_hp[sayd]=0; + _ship.hp=0; ship_lost[sayd]=1; mfleet.frigate_number-=1; array_push(ship_lost, sayd); @@ -370,9 +347,10 @@ function player_retreat_from_fleet_combat(){ else if (mfleet.capital_number>0) { which=array_random_index(mfleet.capital_num); sayd=mfleet.capital_num[which]; + var _ship = fetch_ship(sayd); if (!array_contains(ship_lost, sayd)){ cap_lost+=1; - obj_ini.ship_hp[sayd]=0; + _ship.hp=0; ship_lost[sayd]=1; mfleet.capital_number-=1; array_push(ship_lost, sayd); @@ -405,8 +383,11 @@ function player_retreat_from_fleet_combat(){ obj_controller.menu=0; // 139; - with(obj_temp_inq){instance_destroy();} - instance_create(obj_turn_end.battle_pobject[obj_turn_end.current_battle].x,obj_turn_end.battle_pobject[obj_turn_end.current_battle].y,obj_temp_inq); + with(obj_temp_inq){ + instance_destroy(); + } + var _p_fleet = fetch_current_battle().player_object; + instance_create(_p_fleet.x,_p_fleet.y,obj_temp_inq); with(obj_en_fleet){ if (navy=1) and (point_distance(x,y,obj_temp_inq.x,obj_temp_inq.y)<40) and (trade_goods="player_hold") then trade_goods=""; } @@ -443,10 +424,6 @@ function player_retreat_from_fleet_combat(){ } with(obj_fleet_select){instance_destroy();} - /* - with(obj_ini){scr_dead_marines(1);} - with(obj_ini){scr_ini_ship_cleanup();} - */ } catch(_exception){ handle_exception(_exception) } @@ -454,7 +431,7 @@ function player_retreat_from_fleet_combat(){ function fleet_full_ship_array(fleet="none", exclude_capitals=false, exclude_frigates = false, exclude_escorts = false){ var all_ships = []; var i; - var _ship_count = array_length(obj_ini.ship); + var _ship_count = array_length(obj_ini.ship_data); if (fleet=="none"){ if (!exclude_capitals){ for (i=0; i=0 && temp < array_length(obj_ini.ship_location)){ - obj_ini.ship_location[temp] = location; + if (temp>=0 && temp < array_length(obj_ini.ship_data)){ + var _ship = obj_ini.ship_data[temp]; + _ship.location = location; } } var unit; @@ -512,19 +490,19 @@ function selected_ship_types(){ var capitals=0,frigates=0,escorts=0,i; for (i=0; i97){ - return_lost_ship(); + for (var i=0;i97){ + return_lost_ship(); + } } } } @@ -9,6 +11,7 @@ function return_lost_ships_chance(){ function return_lost_ship(){ var _return_id = get_valid_player_ship("Lost"); if (_return_id!=-1){ + var _ship = fetch_ship(_return_id); var _lost_fleet = "none"; with (obj_p_fleet){ if (action == "Lost"){ @@ -31,10 +34,10 @@ function return_lost_ship(){ } var _return_defect = roll_dice_chapter(1, 100, "high"); - var _text = $"The ship {obj_ini.ship[_return_id]} has returned to real space and is now orbiting the {_star.name} system\n"; + var _text = $"The ship {_ship.name} has returned to real space and is now orbiting the {_star.name} system\n"; if (_return_defect<90){ if (_return_defect>80){ - obj_ini.ship_hp[_return_id] *= random_range(0.2,0.8); + _ship.hp *= random_range(0.2,0.8); _text += $"Reports indicate it has suffered damage as a result of it's time in the warp"; } else if (_return_defect>70){ var techs = collect_role_group(SPECIALISTS_TECHS, [_star.name, 0, _return_id]); @@ -74,7 +77,7 @@ function return_lost_ship(){ } }else if (_return_defect>20){ //This would be an awsome oppertunity and ideal kick off place to allow a redemtion arc either liberating the ship or some of your captured marines gene seed other bits - _text += $"The fate of your ship {obj_ini.ship[_return_id]} has now become clear\n A Chaos fleet has warped into the {_star.name} system with your once prized ship now a part of it"; + _text += $"The fate of your ship {_ship.name} has now become clear\n A Chaos fleet has warped into the {_star.name} system with your once prized ship now a part of it"; var _units = collect_role_group("all", [_star.name, 0, _return_id]); if (array_length(_units)>0){ _text += $"You must assume the worst for your crew"; @@ -93,7 +96,7 @@ function return_lost_ship(){ } else{ var _units = collect_role_group("all", [_star.name, 0, _return_id]); - _text += $"The fate of your ship {obj_ini.ship[_return_id]} has now become clear. While it did not survive it's travels through the warp and tore itself apart somewhere in the {_star.name} system. "; + _text += $"The fate of your ship {_ship.name} has now become clear. While it did not survive it's travels through the warp and tore itself apart somewhere in the {_star.name} system. "; scr_kill_ship(_return_id); if (array_length(_units)>0){ _text += "Some of your astartes may have been able to jetison and survive the ships destruction"; @@ -115,58 +118,36 @@ function return_lost_ship(){ function get_player_ships(location="", name=""){ var _ships = []; - for (var i = 0;i0){ - obj_ini.ship_class[index]="Battle Barge"; - obj_ini.ship_size[index]=3; - obj_ini.ship_hp[index]=1200; - obj_ini.ship_maxhp[index]=1200; - obj_ini.ship_conditions[index]=""; - obj_ini.ship_speed[index]=20; - obj_ini.ship_turning[index]=45; - obj_ini.ship_front_armour[index]=6; - obj_ini.ship_other_armour[index]=6; - obj_ini.ship_weapons[index]=5; - obj_ini.ship_shields[index]=12; - obj_ini.ship_wep[index,1]="Weapons Battery"; - obj_ini.ship_wep_facing[index,1]="left"; - obj_ini.ship_wep_condition[index,1]=""; - obj_ini.ship_wep[index,2]="Weapons Battery"; - obj_ini.ship_wep_facing[index,2]="right"; - obj_ini.ship_wep_condition[index,2]=""; - obj_ini.ship_wep[index,3]="Thunderhawk Launch Bays"; - obj_ini.ship_wep_facing[index,3]="special"; - obj_ini.ship_wep_condition[index,3]=""; - obj_ini.ship_wep[index,4]="Torpedo Tubes"; - obj_ini.ship_wep_facing[index,4]="front"; - obj_ini.ship_wep_condition[index,4]=""; - obj_ini.ship_wep[index,5]="Macro Bombardment Cannons"; - obj_ini.ship_wep_facing[index,5]="most"; - obj_ini.ship_wep_condition[index,5]=""; - obj_ini.ship_capacity[index]=600; - obj_ini.ship_carrying[index]=0; - obj_ini.ship_contents[index]=""; - obj_ini.ship_turrets[index]=3; + with(_struct){ + left_broad_positions = [ + { + ship_position : [162, 36], + slot_size : 2, + weapon : false, + facing : "left" + }, + { + ship_position : [173, 36], + slot_size : 2, + weapon : false, + facing : "left" + }, + { + ship_position : [185,36], + slot_size : 2, + weapon : false, + facing : "left" + }, + { + ship_position : [197, 36], + slot_size : 2, + weapon : false, + facing : "left" + }, + { + ship_position : [210,36], + slot_size : 2, + weapon : false, + facing : "left" + }, + { + ship_position : [222, 36], + slot_size : 2, + weapon : false, + facing : "left" + }, + ]; + right_broad_positions = [ + { + ship_position : [162, 75], + slot_size : 2, + weapon : false, + facing : "right" + }, + { + ship_position : [173, 75], + slot_size : 2, + weapon : false, + facing : "right" + }, + { + ship_position : [185,75], + slot_size : 2, + weapon : false, + facing : "right" + }, + { + ship_position : [197, 75], + slot_size : 2, + weapon : false, + facing : "right" + }, + { + ship_position : [210,75], + slot_size : 2, + weapon : false, + facing : "right" + }, + { + ship_position : [222, 75], + slot_size : 2, + weapon : false, + facing : "right" + }, + ]; + var _broadsl = left_broad_positions; + var _broadsr = right_broad_positions; + for (var i=0;i0){ - obj_ini.ship_class[index]="Strike Cruiser"; - obj_ini.ship_size[index]=2; - obj_ini.ship_hp[index]=600; - obj_ini.ship_maxhp[index]=600; - obj_ini.ship_conditions[index]=""; - obj_ini.ship_speed[index]=25; - obj_ini.ship_turning[index]=90; - obj_ini.ship_front_armour[index]=6; - obj_ini.ship_other_armour[index]=6; - obj_ini.ship_weapons[index]=4; - obj_ini.ship_shields[index]=6; - obj_ini.ship_wep[index,1]="Weapons Battery"; - obj_ini.ship_wep_facing[index,1]="left"; - obj_ini.ship_wep_condition[index,1]=""; - obj_ini.ship_wep[index,2]="Weapons Battery"; - obj_ini.ship_wep_facing[index,2]="right"; - obj_ini.ship_wep_condition[index,2]=""; - obj_ini.ship_wep[index,3]="Thunderhawk Launch Bays"; - obj_ini.ship_wep_facing[index,3]="special"; - obj_ini.ship_wep_condition[index,3]=""; - obj_ini.ship_wep[index,4]="Bombardment Cannons"; - obj_ini.ship_wep_facing[index,4]="most"; - obj_ini.ship_wep_condition[index,4]=""; - obj_ini.ship_capacity[index]=250; - obj_ini.ship_carrying[index]=0; - obj_ini.ship_contents[index]=""; - obj_ini.ship_turrets[index]=1; + with(_struct){ + left_broad_positions = [ + { + ship_position : [56, 37], + slot_size : 2, + weapon : false, + facing : "left" + }, + { + ship_position : [65, 37], + slot_size : 2, + weapon : false, + facing : "left" + }, + { + ship_position : [74,37], + slot_size : 2, + weapon : false, + facing : "left" + }, + { + ship_position : [83, 37], + slot_size : 2, + weapon : false, + facing : "left" + }, + ] + right_broad_positions = [ + { + ship_position : [56, 37], + slot_size : 2, + weapon : false, + facing : "right" + }, + { + ship_position : [65, 37], + slot_size : 2, + weapon : false, + facing : "right" + }, + { + ship_position : [74,37], + slot_size : 2, + weapon : false, + facing : "right" + }, + { + ship_position : [83, 37], + slot_size : 2, + weapon : false, + facing : "right" + } + ]; + var _broadsl = left_broad_positions; + var _broadsr = right_broad_positions; + for (var i=0;i0){ - obj_ini.ship_class[index]="Gladius"; - obj_ini.ship_hp[index]=200; - obj_ini.ship_maxhp[index]=200; - obj_ini.ship_conditions[index]=""; - obj_ini.ship_speed[index]=30; - obj_ini.ship_turning[index]=90; - obj_ini.ship_front_armour[index]=5; - obj_ini.ship_other_armour[index]=5; - obj_ini.ship_weapons[index]=1; - obj_ini.ship_shields[index]=1; - obj_ini.ship_wep[index,1]="Weapons Battery"; - obj_ini.ship_wep_facing[index,1]="most"; - obj_ini.ship_wep_condition[index,1]=""; - obj_ini.ship_capacity[index]=30; - obj_ini.ship_carrying[index]=0; - obj_ini.ship_contents[index]=""; - obj_ini.ship_turrets[index]=1; + with(_struct){ + class = "Gladius"; + add_weapon_to_ship("Macro Cannon"); + turrets = [{}]; + hp = 200; + max_hp = 200; + capacity = 30; + turning_speed = 0.3; + max_speed = 30; + front_armour = 5; + side_armour = 4; + rear_armour = 1; + shields = 1; + sprite_index=spr_ship_glad; + minimum_tech_requirements = 6; + } } if (string_count("Hunter",type)>0){ - obj_ini.ship_class[index]="Hunter"; - obj_ini.ship_hp[index]=200; - obj_ini.ship_maxhp[index]=200; - obj_ini.ship_conditions[index]=""; - obj_ini.ship_speed[index]=30; - obj_ini.ship_turning[index]=90; - obj_ini.ship_front_armour[index]=5; - obj_ini.ship_other_armour[index]=5; - obj_ini.ship_weapons[index]=2; - obj_ini.ship_shields[index]=1; - obj_ini.ship_wep[index,1]="Torpedoes"; - obj_ini.ship_wep_facing[index,1]="front"; - obj_ini.ship_wep_condition[index,1]=""; - obj_ini.ship_wep[index,2]="Weapons Battery"; - obj_ini.ship_wep_facing[index,2]="most"; - obj_ini.ship_wep_condition[index,2]=""; - obj_ini.ship_capacity[index]=25; - obj_ini.ship_carrying[index]=0; - obj_ini.ship_contents[index]=""; - obj_ini.ship_turrets[index]=1; + with(_struct){ + class = "Hunter"; + add_weapon_to_ship("Torpedoes"); + add_weapon_to_ship("Macro Cannon"); + turrets = [{}]; + hp = 200; + max_hp = 200; + capacity = 25; + turning_speed = 0.4; + max_speed = 38; + front_armour = 4; + side_armour = 3; + rear_armour = 1; + shields = 1; + sprite_index=spr_ship_hunt; + minimum_tech_requirements = 8; + } + + } - if (string_count("Gloriana",type)>0){ - obj_ini.ship[index]=new_name; - obj_ini.ship_size[index]=3; - - obj_ini.ship_class[index]="Gloriana"; - - obj_ini.ship_hp[index]=2400; - obj_ini.ship_maxhp[index]=2400; - obj_ini.ship_conditions[index]=""; - obj_ini.ship_speed[index]=25; - obj_ini.ship_turning[index]=60; - obj_ini.ship_front_armour[index]=8; - obj_ini.ship_other_armour[index]=8; - obj_ini.ship_weapons[index]=4; - obj_ini.ship_shields[index]=24; - obj_ini.ship_wep[index,1]="Lance Battery"; - obj_ini.ship_wep_facing[index,1]="most"; - obj_ini.ship_wep_condition[index,1]=""; - obj_ini.ship_wep[index,2]="Lance Battery"; - obj_ini.ship_wep_facing[index,2]="most"; - obj_ini.ship_wep_condition[index,2]=""; - obj_ini.ship_wep[index,3]="Lance Battery"; - obj_ini.ship_wep_facing[index,3]="most"; - obj_ini.ship_wep_condition[index,3]=""; - obj_ini.ship_wep[index,4]="Plasma Cannon"; - obj_ini.ship_wep_facing[index,4]="front"; - obj_ini.ship_wep_condition[index,4]=""; - obj_ini.ship_wep[index,5]="Macro Bombardment Cannons"; - obj_ini.ship_wep_facing[index,5]="most"; - obj_ini.ship_wep_condition[index,5]=""; - obj_ini.ship_capacity[index]=800; - obj_ini.ship_carrying[index]=0; - obj_ini.ship_contents[index]=""; - obj_ini.ship_turrets[index]=8; + if (string_count("Gloriana",type)>0){ + + with(_struct){ + class = "Gloriana"; + add_weapon_to_ship("Lance Battery", {facing : "right"}); + add_weapon_to_ship("Lance Battery",{facing : "left"}); + add_weapon_to_ship("Lance Battery",{facing : "front"}); + add_weapon_to_ship("Plasma Cannon"); + add_weapon_to_ship("Macro Bombardment Cannons"); + turrets = [{},{},{},{},{},{},{},{}]; + hp = 2400; + max_hp = 2400; + size = 3; + capacity = 800; + turning_speed = 0.23; + max_speed = 23; + front_armour = 6; + side_armour = 8; + rear_armour = 2; + shields = 24; + sprite_index=spr_ship_song; + } + } return index; } function ship_class_name(index){ - var _ship_name = obj_ini.ship[index]; - var _ship_class = obj_ini.ship_class[index]; - return $"{_ship_class} '{_ship_name}'"; + var _ship = fetch_ship(index); + return $"{_ship.class} '{_ship.name}'"; } function player_ships_class(index){ var _escorts = ["Escort", "Hunter", "Gladius"]; var _capitals = ["Gloriana", "Battle Barge", "Capital"]; var _frigates = ["Strike Cruiser", "Frigate"]; - var _ship_name_class = obj_ini.ship_class[index]; + var _ship_name_class = fetch_ship(index).class; if (array_contains(_escorts, _ship_name_class)){ return "escort"; } else if (array_contains(_capitals, _ship_name_class)){ @@ -424,25 +556,11 @@ function player_ships_class(index){ function ship_bombard_score(ship_id){ var _bomb_score = 0; - static weapon_bomb_scores = { - "Bombardment Cannons" : { - value : 1, - }, - "Macro Bombardment Cannons" : { - value : 2, - }, - "Plasma Cannon" : { - value : 4 - }, - "Torpedo Tubes" : { - value : 1 - } - } - for (var b=0;b0) and (pop_after=0) then heres_after=0; var nid_influence = star.p_influence[planet][eFACTION.Tyranids]; - if (planet_feature_bool(star.p_feature[planet], P_features.Gene_Stealer_Cult)) { - var cult = return_planet_features(star.p_feature[planet], P_features.Gene_Stealer_Cult)[0]; + if (planet_feature_bool(star.p_feature[planet], P_features.GeneStealerCult)) { + var cult = return_planet_features(star.p_feature[planet], P_features.GeneStealerCult)[0]; if (cult.hiding) {} } else { if (nid_influence > 25) { diff --git a/scripts/scr_random_event/scr_random_event.gml b/scripts/scr_random_event/scr_random_event.gml index b02d9853b5..6faf3d15bd 100644 --- a/scripts/scr_random_event/scr_random_event.gml +++ b/scripts/scr_random_event/scr_random_event.gml @@ -509,7 +509,7 @@ function scr_random_event(execute_now) { } } - array_push(star.p_feature[planet], new NewPlanetFeature(P_features.Succession_War)); + array_push(star.p_feature[planet], new PlanetFeature(P_features.SuccessionWar)); add_new_problem(planet, "succession",irandom(6) + 4, star); star.dispo[planet] = -5000; diff --git a/scripts/scr_recruit_data/scr_recruit_data.gml b/scripts/scr_recruit_data/scr_recruit_data.gml index e926978a58..48f531de38 100644 --- a/scripts/scr_recruit_data/scr_recruit_data.gml +++ b/scripts/scr_recruit_data/scr_recruit_data.gml @@ -21,7 +21,7 @@ enum eTrials{ function find_recruit_success_chance(local_apothecary_points, system, planet, ui=0) { var p_data = new PlanetData(planet, system); - var _recruit_world = p_data.get_features(P_features.Recruiting_World)[0]; + var _recruit_world = p_data.get_features(P_features.RecruitingWorld)[0]; var _recruit_cost = _recruit_world.recruit_cost; var recruit_type = scr_trial_data(obj_controller.recruit_trial); diff --git a/scripts/scr_return_ship/scr_return_ship.gml b/scripts/scr_return_ship/scr_return_ship.gml index c04bf731cc..158be1cbc2 100644 --- a/scripts/scr_return_ship/scr_return_ship.gml +++ b/scripts/scr_return_ship/scr_return_ship.gml @@ -6,34 +6,36 @@ function scr_return_ship(ship_name, object, planet_number) { i = 0; man_size = 0; - /*repeat(30){ - i+=1;if (obj_ini.ship[i]=ship_name) then ship_id=i; - }*/ - i = 0; + // ship_name: name of ship + // object: object with man_selecting + // planet_number: planet number + var man_size,i; + i=0;man_size=0; - // Increase ship storage ship_carrying[i] + i=0; - var unit; - var return_planet = obj_controller.return_object; - with (object) { - var man_size; - for (var i = 0; i < array_length(display_unit); i++) { - if (object.man_sel[i] > 0) { - unit = display_unit[i]; - if (is_struct(unit)) { - if (return_place[i] > 0) { - unit.load_marine(return_place[i], return_planet); - } - } else if (is_array(unit)) { - if (return_place[i] > 0) { - obj_ini.veh_lid[unit[0]][unit[1]] = return_place[i]; - obj_ini.veh_wid[unit[0]][unit[1]] = 0; - var man_size = scr_unit_size("", obj_ini.veh_role[unit[0]][unit[1]], true); - return_planet.p_player[planet_number] -= man_size; - obj_ini.ship_carrying[return_place[i]] += man_size; - } - } - } - } - } + var unit; + var return_planet = obj_controller.return_object; + with (object){ + var man_size + for (var i=0; i0){ + unit = display_unit[i]; + if (is_struct(unit)){ + if (return_place[i]>0){ + unit.load_marine(return_place[i], return_planet); + } + } else if (is_array(unit)) { + if (return_place[i]>0){ + obj_ini.veh_lid[unit[0]][unit[1]]=return_place[i]; + obj_ini.veh_wid[unit[0]][unit[1]]=0; + var man_size =scr_unit_size("",obj_ini.veh_role[unit[0]][unit[1]], true); + return_planet.p_player[planet_number]-=man_size; + var _ship = obj_ini.ship_data[return_place[i]]; + _ship.carrying += man_size; + } + } + } + } + } } diff --git a/scripts/scr_roster/scr_roster.gml b/scripts/scr_roster/scr_roster.gml index d7f1b1485a..c844027d7c 100644 --- a/scripts/scr_roster/scr_roster.gml +++ b/scripts/scr_roster/scr_roster.gml @@ -10,6 +10,7 @@ function Roster() constructor{ squad_buttons = []; company_buttons = []; roster_local_string = ""; + local_button = new ToggleButton(); local_button.str1 = "Local Forces"; local_button.text_halign = fa_center; @@ -300,10 +301,11 @@ function Roster() constructor{ } } if (obj_ini.veh_lid[co][i]>-1){ - if (obj_ini.veh_lid[co][i]>= array_length(obj_ini.ship_location)){ + if (obj_ini.veh_lid[co][i]>= array_length(obj_ini.ship_data)){ obj_ini.veh_lid[co][i] = -1; } - if (obj_ini.ship_location[obj_ini.veh_lid[co][i]] == roster_location){ + var _ship = obj_ini.ship_data[obj_ini.veh_lid[co][i]]; + if (_ship.location == roster_location){ _allow=true; } } @@ -342,8 +344,9 @@ function Roster() constructor{ var _ship_index; for (var s=0;s0){ - new_ship_button(obj_ini.ship[_ship_index],_ship_index); + var _ship = obj_ini.ship_data[_ship_index]; + if (_ship.carrying>0){ + new_ship_button(_ship.name,_ship_index); } } } @@ -394,29 +397,42 @@ function Roster() constructor{ } - static marines_total = function(){ + static marines_total = function(selected_only = false){ var _marines = 0; - for (var i=0;i 360){ + _direct_-=360; + } else if (_direct_< 0){ + _direct_ +=360; + } + + return _direct_; +} + + +function assign_ship_stats(){ + rear_armour = 1; + shields_recharge_rate = 0.2; + shields_reboot_time = 20; + max_speed = 20; + speed_up = 0.008; + speed_down = 0.004; + turning_speed = 0.2; + if (class="Apocalypse Class Battleship"){ + sprite_index=spr_ship_apoc; + size=3; + name=""; + hp=1200; + maxhp=1200; + conditions=""; + shields=400; + maxshields=400; + leadership=90; + armour_front=6; + side_armour=5; + turrets=4; + capacity=150; + carrying=0; + max_speed = 20; + turning_speed = 0.23; + add_weapon_to_ship("Lance Battery", {facing:"left"}); + add_weapon_to_ship("Lance Battery", {facing:"right"}); + add_weapon_to_ship("Nova Cannon"); + add_weapon_to_ship("Weapons Battery"); + + } + + if (class="Nemesis Class Fleet Carrier"){ + sprite_index=spr_ship_nem; + size=3; + name=""; + hp=1000; + maxhp=1000; + conditions=""; + shields=400; + maxshields=400; + leadership=85; + armour_front=5; + side_armour=5; + turrets=5; + capacity=100; + carrying=24; + add_weapon_to_ship("Interceptor Launch Bays"); + add_weapon_to_ship("Interceptor Launch Bays"); + add_weapon_to_ship("Lance Battery"); + max_speed = 20; + + } + + if (class="Avenger Class Grand Cruiser"){ + sprite_index=spr_ship_aven; + size=2; + name=""; + hp=1000; + maxhp=1000; + conditions=""; + shields=300; + maxshields=300; + leadership=85; + armour_front=5; + side_armour=5; + turrets=3; + capacity=50; + add_weapon_to_ship("Lance Battery", {cooldown:30}); + add_weapon_to_ship("Lance Battery", {cooldown:25, direction:"left"}); + add_weapon_to_ship("Lance Battery", {cooldown:25, direction:"right"}); + + } + + if (class="Sword Class Frigate"){ + sprite_index=spr_ship_sword; + size=1; + name=""; + hp=100; + maxhp=100; + conditions=""; + shields=100; + maxshields=100; + leadership=80; + armour_front=5; + side_armour=5; + turrets=2; + capacity=50; + carrying=0; + add_weapon_to_ship("Weapons Battery", {weapon_range:300}); + + } + + + + // Eldar + + if (class="Void Stalker"){ + sprite_index=spr_ship_void; + size=3; + name=""; + hp=1000; + maxhp=1000; + conditions=""; + shields=300; + maxshields=300; + leadership=100; + armour_front=5; + side_armour=4; + turrets=4; + capacity=150; + + add_weapon_to_ship("Weapons Battery"); + add_weapon_to_ship("Eldar Launch Bay"); + add_weapon_to_ship("Pulsar Lances"); + + } + + if (class="Shadow Class"){ + sprite_index=spr_ship_shadow; + size=3; + name=""; + hp=600; + maxhp=600; + conditions=""; + shields=200; + maxshields=200; + leadership=90; + armour_front=5; + side_armour=4; + turrets=3; + capacity=100; + carrying=0; + add_weapon_to_ship("Torpedoes"); + add_weapon_to_ship("Light Weapons Battery", {range : 450}); + + } + + if (class="Hellebore"){ + sprite_index=spr_ship_hellebore; + size=1; + name=""; + hp=200; + maxhp=200; + conditions=""; + shields=200; + maxshields=200; + leadership=90; + armour_front=5; + side_armour=4; + turrets=2; + capacity=50; + carrying=0; + + add_weapon_to_ship("Light Weapons Battery", {range : 450, cooldown :20, facing : "front"}); + + add_weapon_to_ship("Light Weapons Battery", {range : 450}); + add_weapon_to_ship("Eldar Launch Bay", {ammo : 1}); + + } + + if (class="Aconite"){sprite_index=spr_ship_aconite; + sprite_index=spr_ship_aconite; + size=1; + name=""; + hp=200; + maxhp=200; + conditions=""; + shields=200; + maxshields=200; + leadership=90; + armour_front=5; + side_armour=4; + turrets=2; + capacity=50; + carrying=0; + add_weapon_to_ship("Light Weapons Battery", {range : 450}); + + } + + + + + // Orks + + if (class="Dethdeala"){ + sprite_index=spr_ship_deth; + size=3; + name=""; + hp=1200; + maxhp=1200; + conditions=""; + shields=200; + maxshields=200; + leadership=100; + armour_front=6; + side_armour=5; + turrets=3; + capacity=250; + carrying=0; + + add_weapon_to_ship("Gunz Battery", {facing:"left"}); + add_weapon_to_ship("Gunz Battery", {facing:"right"}); + add_weapon_to_ship("Bombardment Cannon"); + add_weapon_to_ship("Heavy Gunz"); + add_weapon_to_ship("Fighta Bommerz"); + + } + + if (class="Gorbag's Revenge"){ + sprite_index=spr_ship_gorbag; + size=3; + name=""; + hp=1200; + maxhp=1200; + conditions=""; + shields=200; + maxshields=200; + leadership=100; + armour_front=6; + side_armour=5; + turrets=3; + capacity=250; + carrying=0; + add_weapon_to_ship("Gunz Battery"); + add_weapon_to_ship("Torpedoes", {dam:12, range:300, cooldown:120}); + + add_weapon_to_ship("Fighta Bommerz", {ammo : 3}); + add_weapon_to_ship("Fighta Bommerz", {ammo : 3}); + + } + + if (class=="Kroolboy") or (class=="Slamblasta"){ + size=3; + sprite_index=spr_ship_krool; + if (class=="Kroolboy"){ + sprite_index=spr_ship_krool; + } else if (class=="Slamblasta"){ + sprite_index=spr_ship_slam; + } + name=""; + hp=1200; + maxhp=1200; + conditions=""; + shields=200; + maxshields=200; + leadership=100; + armour_front=6; + side_armour=5; + turrets=3; + capacity=250; + carrying=0; + + add_weapon_to_ship("Fighta Bommerz", {ammo : 12, cooldown : 120}); + add_weapon_to_ship("Gunz Battery"); + add_weapon_to_ship("Heavy Gunz"); + + }else if (class=="Battlekroozer"){ + sprite_index=spr_ship_kroozer; + size=2; + name=""; + hp=800; + maxhp=800; + conditions=""; + shields=200; + maxshields=200; + leadership=100; + armour_front=5; + side_armour=5; + turrets=3; + capacity=250; + carrying=0; + add_weapon_to_ship("Gunz Battery" , {range : 450}); + add_weapon_to_ship("Heavy Gunz" , {facing : "left"}); + add_weapon_to_ship("Heavy Gunz" , {facing : "right"}); + add_weapon_to_ship("Fighta Bommerz"); + add_weapon_to_ship("Fighta Bommerz"); + }else + if (class=="Ravager"){ + sprite_index=spr_ship_ravager; + size=1; + name=""; + hp=100; + maxhp=100; + conditions=""; + shields=100; + maxshields=100; + leadership=80; + armour_front=3; + side_armour=3; + turrets=2; + capacity=50; + carrying=0; + add_weapon_to_ship("Gunz Battery"); + add_weapon_to_ship("Torpedoes", {range : 300, cooldown:120,barrel_count:2}); + } + // ** Tau ** + if (class=="Custodian"){ + sprite_index=spr_ship_custodian; + size=3; + name=""; + hp=1000; + maxhp=1000; + conditions=""; + shields=200; + maxshields=200; + leadership=100; + armour_front=6; + side_armour=5; + turrets=5; + capacity=1000; + carrying=0; + add_weapon_to_ship("Gravitic launcher"); + add_weapon_to_ship("Railgun Battery"); + add_weapon_to_ship("Ion Cannons"); + add_weapon_to_ship("Manta Launch Bay"); + + }else + if (class=="Protector"){ + sprite_index=spr_ship_protector; + size=2; + name=""; + hp=600; + maxhp=600; + conditions=""; + shields=200; + maxshields=200; + leadership=90; + armour_front=6; + side_armour=5; + turrets=3; + capacity=250; + carrying=0; + add_weapon_to_ship("Gravitic launcher"); + add_weapon_to_ship("Railgun Battery"); + add_weapon_to_ship("Ion Cannons"); + add_weapon_to_ship("Manta Launch Bay", {ammo:2}); + }else + if (class=="Emissary"){ + sprite_index=spr_ship_emissary; + size=2; + name=""; + hp=400; + maxhp=400; + conditions=""; + shields=100; + maxshields=100; + leadership=100; + armour_front=6; + side_armour=5; + turrets=2; + capacity=100; + carrying=0; + add_weapon_to_ship("Gravitic launcher"); + add_weapon_to_ship("Railgun Battery"); + add_weapon_to_ship("Ion Cannons"); + add_weapon_to_ship("Manta Launch Bay", {ammo:1}); + }else + if (class=="Warden"){ + sprite_index=spr_ship_warden; + size=1; + name="";hp=100; + maxhp=100; + conditions=""; + shields=100; + maxshields=100; + leadership=80; + armour_front=5; + side_armour=4; + turrets=1; + capacity=50; + carrying=0; + add_weapon_to_ship("Ion Cannons", {cooldown:50}); + add_weapon_to_ship("Railgun Battery", {cooldown:60, range:300}); + + }else + if (class=="Castellan"){ + sprite_index=spr_ship_castellan; + size=1; + name=""; + hp=100; + maxhp=100; + conditions=""; + shields=100; + maxshields=100; + leadership=80; + armour_front=5; + side_armour=4; + turrets=2; + capacity=50; + carrying=0; + add_weapon_to_ship("Gravitic launcher"); + add_weapon_to_ship("Railgun Battery", {cooldown:40, range:300}); + } + // ** Chaos ** + if (class=="Desecrator"){ + sprite_index=spr_ship_dese; + size=3; + name=""; + hp=1200; + maxhp=1200; + conditions=""; + shields=400; + maxshields=400; + leadership=90; + armour_front=7; + side_armour=5; + turrets=4; + capacity=150; + carrying=0; + add_weapon_to_ship("Lance Battery", {facing:"left"}); + add_weapon_to_ship("Lance Battery", {facing:"right"}); + add_weapon_to_ship("Weapons Battery"); + add_weapon_to_ship("Torpedoes", {cooldown:120}); + add_weapon_to_ship("Fighta Bommerz"); + } + + if (class="Avenger"){ + sprite_index=spr_ship_veng; + size=2; + name=""; + hp=1000; + maxhp=1000; + conditions=""; + shields=300; + maxshields=300; + leadership=85; + armour_front=5; + side_armour=5; + turrets=3; + capacity=50; + carrying=0; + add_weapon_to_ship("Lance Battery", {facing : "left"}); + add_weapon_to_ship("Lance Battery", {facing : "right"}); + + } + + if (class="Carnage") or (class="Daemon"){ + sprite_index=spr_ship_carnage; + size=2; + name=""; + hp=1000; + maxhp=1000; + conditions=""; + shields=300; + maxshields=300; + leadership=85; + armour_front=5; + side_armour=5; + turrets=3; + capacity=50; + carrying=0; + + add_weapon_to_ship("Lance Battery"); + add_weapon_to_ship("Light Weapons Battery", {dam : 12,facing : "left", cooldown : 45}); + add_weapon_to_ship("Light Weapons Battery", {dam : 12,facing : "right", cooldown : 45}); + if (class=="Daemon"){ + sprite_index=spr_ship_daemon; + image_alpha=0.5; + } + } + + + if (class="Iconoclast"){ + sprite_index=spr_ship_icono; + sprite_index=spr_ship_icono; + size=1; + name=""; + hp=100; + maxhp=100; + conditions=""; + shields=100; + maxshields=100; + leadership=80; + armour_front=7; + side_armour=4; + turrets=2; + capacity=50; + carrying=0; + add_weapon_to_ship("Light Weapons Battery"); + + } + + // Tyranids + if (owner = eFACTION.Tyranids){ + set_nid_ships(); + } + + // Necrons + if (class="Cairn Class"){ + sprite_index=spr_ship_cairn; + size=3; + + name=""; + hp=1100; + maxhp=1100; + conditions=""; + shields=550; + maxshields=550; + leadership=100; + + armour_front=5; + side_armour=5; + turrets=5; + capacity=800; + carrying=0; + + add_weapon_to_ship("Lightning Arc"); + add_weapon_to_ship("Star Pulse Generator"); + add_weapon_to_ship("Gauss Particle Whip"); + + weapon[3]="Gauss Particle Whip"; + weapon_facing[3]="front"; + weapon_dam[3]=30; + weapon_range[3]=450; + weapon_cooldown[3]=90; + + } + + if (class="Reaper Class"){sprite_index=spr_ship_reaper; + size=3; + + name=""; + hp=900; + maxhp=900; + conditions=""; + shields=450; + maxshields=450; + leadership=100; + + armour_front=5; + side_armour=5; + turrets=4; + capacity=500; + carrying=0; + + add_weapon_to_ship("Lightning Arc"); + add_weapon_to_ship("Star Pulse Generator"); + add_weapon_to_ship("Gauss Particle Whip"); + + } + + if (class="Shroud Class"){size=2; + sprite_index=spr_ship_shroud; + + name=""; + hp=400; + maxhp=400; + conditions=""; + shields=200; + maxshields=200; + leadership=100; + + armour_front=5; + side_armour=5; + turrets=2; + capacity=250; + carrying=0; + + add_weapon_to_ship("Lightning Arc", {dam : 10}); + + } + + if (class="Jackal Class"){ + size=2; + sprite_index=spr_ship_jackal; + + name=""; + hp=100; + maxhp=100; + conditions=""; + shields=100; + maxshields=100; + leadership=100; + + armour_front=4; + side_armour=4; + turrets=2; + capacity=25; + carrying=0; + + add_weapon_to_ship("Lightning Arc", {dam : 10,range :250}); + + } + + if (class="Dirge Class"){ + size=2; + sprite_index=spr_ship_dirge; + + name=""; + hp=100; + maxhp=100; + conditions=""; + shields=100; + maxshields=100; + leadership=100; + + armour_front=4; + side_armour=4; + turrets=2; + capacity=25; + carrying=0; + + add_weapon_to_ship("Lightning Arc", {dam : 10,range :250}); + } + + + + + + + + if (owner == eFACTION.Tyranids){ + for(var i=1; i<=2; i++){ + if (obj_fleet.en_mutation[i]=="Spore Clouds") then shields=shields+100; + if (obj_fleet.en_mutation[i]=="Health"){ + hp=floor(hp*1.1); + maxhp=hp; + } + if (obj_fleet.en_mutation[i]=="Armour") then armour_front+=1; + if (obj_fleet.en_mutation[i]=="Speed") then speed_bonus=speed_bonus*1.1; + if (obj_fleet.en_mutation[i]=="Turn") then turn_bonus=1.2; + if (obj_fleet.en_mutation[i]=="Turret") then turrets+=1; + } + } + if (owner != eFACTION.Eldar){ + hp/=2; + maxhp=hp; + shields=shields/2; + maxshields=shields; + } + shields = new ShipShieldGenerator({shields, maxshields, recharge_rate:shields_recharge_rate, shields_reboot:shields_reboot_time, ship:id}); + + // if (obj_fleet.enemy=2){hp=hp*0.75;maxhp=hp;shields=shields*0.75;maxshields=shields;} + // hp=1;shields=1; + // if (obj_fleet.enemy="orks") then name=global.name_generator.generate_ork_ship_name(); + // show_message(string(class)); + + + bridge=maxhp; + + // if (obj_fleet.enemy="orks") then name=global.name_generator.generate_ork_ship_name(); + + name="sdagdsagdasg"; + + + + // show_message(string(class)); +} + + +function draw_ship_heathshields(){ + shields.draw(); + if (maxhp!=0){ + var zoom_modifier = obj_controller.zoomed?2:1; + if (!shields.active()){ + var hp_percent = $"{(hp/maxhp)*100}%" + + draw_text_transformed(x,y-sprite_height,hp_percent,zoom_modifier,zoom_modifier,0); + } + } +} diff --git a/scripts/scr_ship_combat_data/scr_ship_combat_data.yy b/scripts/scr_ship_combat_data/scr_ship_combat_data.yy new file mode 100644 index 0000000000..9e3237d070 --- /dev/null +++ b/scripts/scr_ship_combat_data/scr_ship_combat_data.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"scr_ship_combat_data", + "isCompatibility":false, + "isDnD":false, + "name":"scr_ship_combat_data", + "parent":{ + "name":"fleet", + "path":"folders/Scripts/fleet.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/scr_ship_count/scr_ship_count.gml b/scripts/scr_ship_count/scr_ship_count.gml index b729ebb058..71cb540384 100644 --- a/scripts/scr_ship_count/scr_ship_count.gml +++ b/scripts/scr_ship_count/scr_ship_count.gml @@ -5,8 +5,9 @@ function scr_ship_count(wanted_ship_class) { var count=0,i=0; - for (var i=0;i animation_frames){ + return -1; + } + return 1; + } + + array_push(obj_fleet.explosions, self); +} + + +function ShipWeapon(weapon_name, overide_data={}) constructor{ + if (struct_exists(global.ship_weapons_stats, weapon_name)){ + var _wep_data = global.ship_weapons_stats[$ weapon_name]; + move_data_to_current_scope(_wep_data); + } + move_data_to_current_scope(overide_data); + move_data_to_current_scope(global.ship_weapon_defualts, false); + name = weapon_name; + cooldown_timer = 0; + + target = 0; + + static weapon_direction = function (){ + var _tangent_direction = 0; + var _facing = facing; + + with (ship){ + _tangent_direction = facing_weapon_angle(_facing); + } + return _tangent_direction; + } + + + static create_projectile = function(){ + var _bullet = -1; + + var _bul_x = x + var barrel_offset = 32; + var _bul_y = y + + if (bullet_obj==obj_en_round){ + if (ship.ai_type = "player" ){ + bullet_obj = obj_p_round + }else if (ship.ai_type = "allies"){ + bullet_obj = obj_al_round + } + } + var _direction = point_direction(_bul_x,_bul_y, target.x,target.y); + + if (accuracy < 100){ + _direction += ((100-accuracy) * random_range(-0.5,0.5)); + } + + var _bullet_qualities = { + speed : bullet_speed, + dam : dam, + image_xscale : draw_scale, + image_yscale : draw_scale, + direction : _direction, + target : target, + target_x:target.x, + target_y:target.y, + sprite_index : img, + explosion_sprite : explosion_sprite, + } + + _bullet = instance_create_layer( + _bul_x, + _bul_y, + layer_get_all()[0], + bullet_obj + ); + with (_bullet){ + move_data_to_current_scope(_bullet_qualities); + } + array_push(target.bullets_for, _bullet.id); + barrel_offset+=20 + + } + static fire = function(){ + if (cooldown_timer > 0){ + cooldown_timer--; + } + draw_set_alpha(1); + draw_set_color(c_red); + if (cooldown_timer <= 0 && instance_exists(target) && (ammo == -1 || ammo>0)){ + if (ammo>0){ + ammo--; + } + cooldown_timer = cooldown; + if (!melee && facing != "special"){ + create_projectile(); + } else if (facing != "special"){ + if (target.shields<=0){ + target.hp-=dam; + } + else if (target.shields>0){ + target.shields-=dam; + } + } else if (facing == "special") { + launch_flyers(); + } + } + } + + static launch_flyers = function(){ + var _launch_x = ship.x; + var _launch_y = ship.y; + + if (ship.ai_type = "player" ){ + var _flyer=instance_create(_launch_x,_launch_y,obj_p_th); + _flyer.direction=ship.direction; + }else if (ship.ai_type = "allies"){ + var _flyer = instance_create(_launch_x,_launch_y,obj_al_in); + _flyer.direction=ship.direction; + _flyer.owner=ship.owner; + } else { + var _flyer = instance_create(_launch_x,_launch_y,obj_en_in); + _flyer.direction=ship.direction; + _flyer.owner=ship.owner; + } + } + + static calc_gun_position = function(){ + if (struct_exists(self, "ship_position")){ + var _ship_sprite = ship.sprite_index; + var _x_offset = sprite_get_xoffset(_ship_sprite); + var _y_offset = sprite_get_yoffset(_ship_sprite); + var _dist = point_distance(_x_offset, _y_offset, ship_position[0], ship_position[1]); + var _rel_direction = point_direction(_x_offset,_y_offset, ship_position[0], ship_position[1]); + x = ship.x + lengthdir_x(_dist , ship.direction+_rel_direction); + y = ship.y + lengthdir_y(_dist , ship.direction+_rel_direction); + } else { + x = ship.x; + y = ship.y; + } + } + static find_target = function(){ + calc_gun_position(); + var _shoot_angle = weapon_direction(); + + if (ship.ai_type == "player" || ship.ai_type == "allies"){ + + var _enemies = instance_number(obj_en_ship); + for (var i=0;i<_enemies;i++){ + var _targ = instance_nearest(ship.x, ship.y, obj_en_ship); + if (_targ.hp<=0){ + instance_deactivate_object(_targ.id); + continue; + } + var _distance = point_distance(_targ.x, _targ.y, x,y); + if (_distance > range){ + break; + } + if (minrange>0 && _distance (_shoot_angle - firing_arc)){ + target = _targ.id; + break; + } + } + instance_activate_object(obj_en_ship); + } else if (ship.ai_type = "enemy"){ + var _enemies = instance_number(obj_p_ship) + instance_number(obj_al_ship); + for (var i=0;i<_enemies;i++){ + var _targ = instance_nearest(ship.x, ship.y, obj_p_ship); + var _targ_2 = instance_nearest(ship.x, ship.y, obj_al_ship); + if (!instance_exists(_targ)){ + if (instance_exists(_targ_2)){ + _targ = _targ_2; + } else { + break; + } + } else if (instance_exists(_targ) && instance_exists(_targ_2)){ + if (point_distance(_targ_2.x, _targ_2.y, x,y) range){ + break; + } + if (minrange>0 && _distance (_shoot_angle - firing_arc)){ + target = _targ; + break; + } + } + instance_activate_object(obj_p_ship); + instance_activate_object(obj_al_ship); + } + if (instance_exists(target)){ + draw_set_color(c_red); + draw_line(x, y, target.x, target.y); + } + } + static draw_weapon_firing_arc = function(arc_col = CM_GREEN_COLOR){ + var _tangent_direction = weapon_direction(); + var _facing = facing + + var _max_distance = range; + + calc_gun_position(); + + var _left = x - _max_distance; + var _top = y - _max_distance; + var _right = x + _max_distance; + var _bottom = y + _max_distance; + + if (facing == "most"){ + firing_arc = 110; + } + draw_set_color(arc_col); + + var _start_x = x + lengthdir_x(_max_distance, _tangent_direction - firing_arc); + var _start_y = y + lengthdir_y(_max_distance, _tangent_direction - firing_arc); + var _end_x = x + lengthdir_x(_max_distance, _tangent_direction + firing_arc); + var _end_y = y + lengthdir_y(_max_distance, _tangent_direction + firing_arc); + + draw_arc(_left, _top, _right, _bottom, _start_x, _start_y, _end_x, _end_y); + draw_line(x, y, _start_x, _start_y); + draw_line(x, y, _end_x, _end_y); + + if (minrange > 0){ + draw_set_color(c_red); + var _start_x = x + lengthdir_x(minrange, _tangent_direction - firing_arc); + var _start_y = y + lengthdir_y(minrange, _tangent_direction - firing_arc); + var _end_x = x + lengthdir_x(minrange, _tangent_direction + firing_arc); + var _end_y = y + lengthdir_y(minrange, _tangent_direction + firing_arc); + + draw_arc(_left, _top, _right, _bottom, _start_x, _start_y, _end_x, _end_y); + draw_line(x, y, _start_x, _start_y); + draw_line(x, y, _end_x, _end_y); + } + } +} + +function add_weapon_to_ship(weapon_name, overide_data={}){ + if (instance_exists(obj_fleet)){ + overide_data.ship = id; + } + var _wep = new ShipWeapon(weapon_name, overide_data); + array_push(weapons, _wep); +}; + + +function round_collision_with_ship(){ + + + var _rel_direction = point_direction(other.x, other.y, x, y); + var arm=other.armour_front; + + var t1=0; + /*if (obj_fleet.global_defense!=1){ + t1=1-(obj_fleet.global_defense-1); + dam=dam*t1; + }*/ + if (other.shields.active()){ + other.shields.shields-=dam; + } else { + var _arm = 0; + var _rel_direction = point_direction(other.x, other.y, x, y); + if (_rel_direction <= 45 || _rel_direction >= 315){ + _arm = other.armour_front; + } else if (_rel_direction <225 && _rel_direction > 135){ + _arm = other.rear_armour; + } else { + _arm = other.side_armour; + } + if (_armroom_width+1000) or (y<-1000) or (y>room_height+1000){ + instance_destroy(); + } + + var th, thd; + if (object_index == obj_en_round){ + if (dam<=4){ + if (instance_exists(obj_p_small)){ + th=instance_nearest(x,y,obj_p_small); + thd=point_distance(x,y,th.x,th.y); + if (thd<6){ + th.hp-=(self.dam-1); + new ShipWeaponExplosion(explosion_sprite, x,y, image_xscale); + } + } + if (instance_exists(obj_al_in)){ + th=instance_nearest(x,y,obj_al_in); + thd=point_distance(x,y,th.x,th.y); + if (thd<6){ + th.hp-=(self.dam-1); + new ShipWeaponExplosion(explosion_sprite, x,y, image_xscale); + } + } + } + } else { + if (dam<=4){ + if (instance_exists(obj_en_in)){ + th=instance_nearest(x,y,obj_en_in); + thd=point_distance(x,y,th.x,th.y); + if (thd<6){ + th.hp-=(self.dam-1); + new ShipWeaponExplosion(explosion_sprite, x,y, image_xscale); + instance_destroy(); + } + } + } + } +} \ No newline at end of file diff --git a/scripts/scr_ship_weapon_struct/scr_ship_weapon_struct.yy b/scripts/scr_ship_weapon_struct/scr_ship_weapon_struct.yy new file mode 100644 index 0000000000..0747bed5ba --- /dev/null +++ b/scripts/scr_ship_weapon_struct/scr_ship_weapon_struct.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"scr_ship_weapon_struct", + "isCompatibility":false, + "isDnD":false, + "name":"scr_ship_weapon_struct", + "parent":{ + "name":"fleet", + "path":"folders/Scripts/fleet.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/scr_special_view/scr_special_view.gml b/scripts/scr_special_view/scr_special_view.gml index 85428f6cdf..ac856a7865 100644 --- a/scripts/scr_special_view/scr_special_view.gml +++ b/scripts/scr_special_view/scr_special_view.gml @@ -80,7 +80,8 @@ function scr_special_view(command_group) { if (obj_ini.name[0][v]== ""){continue;} if (obj_ini.TTRPG[0][v].ship_location>-1){ var ham=obj_ini.TTRPG[0][v].ship_location; - if (obj_ini.ship_location[ham]=="Lost") then continue; + var _ship = obj_ini.ship_data[ham]; + if (_ship.location=="Lost") then continue; } unit = obj_ini.TTRPG[0][v]; diff --git a/scripts/scr_specialist_points/scr_specialist_points.gml b/scripts/scr_specialist_points/scr_specialist_points.gml index c25a89d206..22178cd642 100644 --- a/scripts/scr_specialist_points/scr_specialist_points.gml +++ b/scripts/scr_specialist_points/scr_specialist_points.gml @@ -12,7 +12,7 @@ function unit_apothecary_points_gen(turn_end=false){ return [points,reasons]; } -function unit_forge_point_generation(turn_end=false){ +function unit_forge_point_generation(turn_end=false, base=false){ var _trained_person = IsSpecialist(SPECIALISTS_TECHS); var crafter = has_trait("crafter"); var reasons = {}; @@ -20,8 +20,11 @@ function unit_forge_point_generation(turn_end=false){ if (_trained_person){ var points = technology / 5; reasons.trained = points; + } else if (technology >= 40){ + var points = (technology-40) / 5; + reasons.talented = points; } - if (job!="none"){ + if (job!="none" && !base){ if (job.type == "forge"){ if (crafter){ @@ -45,6 +48,7 @@ function unit_forge_point_generation(turn_end=false){ points+=10; reasons.master = 10; } + if (!base){ var maintenance = equipment_maintenance_burden(); points -= maintenance; reasons.maintenance = $"-{maintenance}"; @@ -55,6 +59,7 @@ function unit_forge_point_generation(turn_end=false){ var _tech_score_mod = 1/(technology/30); reasons.maintenance += $"\n tech modifier : X{_tech_score_mod} (lower is better)"; } + } return [points,reasons]; } diff --git a/scripts/scr_specialist_training/scr_specialist_training.gml b/scripts/scr_specialist_training/scr_specialist_training.gml index 7cf686d1fa..a54434b1c5 100644 --- a/scripts/scr_specialist_training/scr_specialist_training.gml +++ b/scripts/scr_specialist_training/scr_specialist_training.gml @@ -396,7 +396,8 @@ function techmarine_training(){ if (obj_controller.faction_status[eFACTION.Mechanicus] != "War") { if (unit.ship_location>-1){ var man_size=unit.get_unit_size(); - obj_ini.ship_carrying[unit.ship_location]-=man_size; + var _ship = obj_ini.ship_data[unit.ship_location]; + _ship.carrying-=man_size; } unit.location_string="Terra"; unit.planet_location=4; diff --git a/scripts/scr_squads/scr_squads.gml b/scripts/scr_squads/scr_squads.gml index f650589e89..26aff704d9 100644 --- a/scripts/scr_squads/scr_squads.gml +++ b/scripts/scr_squads/scr_squads.gml @@ -539,7 +539,8 @@ function UnitSquad(squad_type = undefined, company = undefined) constructor{ } else if (same_loc_type){ if (loc_type==location_types.ship){ if (exact_loc){ - final_loc_status=$"aboard {obj_ini.ship[loc_id]}" + var _ship = fetch_ship(loc_id); + final_loc_status=$"aboard {_ship.name}" } else if (in_orbit){ final_loc_status=$"various ships orbiting {system}" } diff --git a/scripts/scr_star_ownership/scr_star_ownership.gml b/scripts/scr_star_ownership/scr_star_ownership.gml index 9a83157e90..272e0745c4 100644 --- a/scripts/scr_star_ownership/scr_star_ownership.gml +++ b/scripts/scr_star_ownership/scr_star_ownership.gml @@ -51,7 +51,7 @@ function scr_star_ownership(argument0) { } var _nid_chosen = false; - if (planet_feature_bool(p_feature[run], P_features.Gene_Stealer_Cult)){ + if (planet_feature_bool(p_feature[run], P_features.GeneStealerCult)){ if (p_influence[run][eFACTION.Tyranids]>50){ p_owner[run]=eFACTION.Tyranids; tyranids_owner++; @@ -106,7 +106,7 @@ function scr_star_ownership(argument0) { if (argument0!=false){ if (array_length(p_feature[run]) != 0){ - if (planet_feature_bool(p_feature[run], P_features.Daemonic_Incursion)){ + if (planet_feature_bool(p_feature[run], P_features.DaemonicIncursion)==1){ p_heresy[run]+=2; if (!p_large[run] && p_population[run]>10000){ p_population[run]=floor(p_population[run]*0.5); @@ -125,14 +125,14 @@ function scr_star_ownership(argument0) { } } if (array_length(p_feature[run])!=0){ - if (p_type[run]!="Dead" && planet_feature_bool(p_feature[run], P_features.Daemonic_Incursion) && p_heresy[run]>=100){ + if (p_type[run]!="Dead") and (planet_feature_bool(p_feature[run], P_features.DaemonicIncursion)==1) and (p_heresy[run]>=100){ var randoo=choose(1,2,3,4); if (randoo=4){ p_type[run]="Daemon"; p_fortified[run]=6; p_traitors[run]=7; p_owner[run]=10; - delete_features(p_feature[run],P_features.Daemonic_Incursion); + delete_features(p_feature[run],P_features.DaemonicIncursion); } } } diff --git a/scripts/scr_star_travel_algorithm/scr_star_travel_algorithm.gml b/scripts/scr_star_travel_algorithm/scr_star_travel_algorithm.gml index b50dd523f9..244deb9e3f 100644 --- a/scripts/scr_star_travel_algorithm/scr_star_travel_algorithm.gml +++ b/scripts/scr_star_travel_algorithm/scr_star_travel_algorithm.gml @@ -26,17 +26,17 @@ function FastestRouteAlgorithm(start_x,start_y, xx,yy,fleet, start_from_star=fal function find_star_travel_distances(cur_star_id){ var current_star = unvisited_stars[cur_star_id][0]; var cur_travel = unvisited_stars[cur_star_id][1]; - var eta; + var _eta; var warp_lane = false; for (var s=cur_star_id+1; sworst_case){ + if (_eta>worst_case){ visit_data[3] = true; } }*/ @@ -74,9 +74,9 @@ function FastestRouteAlgorithm(start_x,start_y, xx,yy,fleet, start_from_star=fal cur_star = final_route_info[2][i]; } draw_line_dashed(cur_star.x,cur_star.y,final_route_info[0].x,final_route_info[0].y,16,0.5); - var eta = $"ETA {final_route_info[1]+1}"; + var _eta = $"ETA {final_route_info[1]+1}"; var zoom_size = obj_controller.zoomed?5:1; - draw_text_transformed(cur_star.x+24,cur_star.y+40,eta,zoom_size,zoom_size,0); + draw_text_transformed(cur_star.x+24,cur_star.y+40,_eta,zoom_size,zoom_size,0); } static final_array_path = function(){ diff --git a/scripts/scr_start_load/scr_start_load.gml b/scripts/scr_start_load/scr_start_load.gml index 889d251141..d2d026afb1 100644 --- a/scripts/scr_start_load/scr_start_load.gml +++ b/scripts/scr_start_load/scr_start_load.gml @@ -53,13 +53,13 @@ function scr_start_load(fleet, load_from_star, load_options) { function load_vehicles(_companies, _equip ,_ship, size){ obj_ini.veh_wid[_companies, _equip] = 0; obj_ini.veh_lid[_companies, _equip] = _ship; - obj_ini.veh_loc[_companies, _equip] = obj_ini.ship_location[_ship]; - obj_ini.ship_carrying[_ship] += size; + var _ship_s = obj_ini.ship_data[_ship]; + obj_ini.veh_loc[_companies, _equip] = _ship_s.location; + _ship_s.carrying += size; } var ship_size, _companies_loaded; _company_size = 0; var ship = 0; - //ship_size = obj_ini.ship_size[ship]; _companies_loaded = 1; var ship_return = 1; var ship_has_space =true; @@ -69,8 +69,8 @@ function scr_start_load(fleet, load_from_star, load_options) { var ship_loop_start = 0; for (_comp = 0; _comp<10;_comp++){ if ((split_vets == 1 && _comp == 1) || (!comp_has_units[_comp])) then continue; - if (ship_loop_start>=array_length(obj_ini.ship_carrying)){ - ship_loop_start=array_length(obj_ini.ship_carrying); + if (ship_loop_start>=array_length(obj_ini.ship_data)){ + ship_loop_start=array_length(obj_ini.ship_data); } total_vehic_size = 0; var _company_size = 0; @@ -113,14 +113,16 @@ function scr_start_load(fleet, load_from_star, load_options) { } _company_size += total_vehic_size; //if company won't fit onto ship - if ((obj_ini.ship_carrying[ship_loop_start] + _company_size) > obj_ini.ship_capacity[ship_loop_start]){ - ship_fit = false; - } + var _starting_ship = obj_ini.ship_data[ship_loop_start]; + ship_fit = _starting_ship.has_space(_company_size) //if entire company won't fit on ship test to see if there is any ship in the fleet the company will fit on; if (ship_fit == false){ - for (ship_loop = ship_loop_start; ship_loop< array_length(obj_ini.ship_carrying);ship_loop++){ - if (escort_load == 2) and (obj_ini.ship_capacity[ship_loop] < 250){continue} - if ((obj_ini.ship_carrying[ship_loop] + _company_size) <= obj_ini.ship_capacity[ship_loop]){ + for (ship_loop = ship_loop_start; ship_loop< array_length(obj_ini.ship_data);ship_loop++){ + var _loop_ship = obj_ini.ship_data[ship_loop]; + if (escort_load == 2) and (_loop_ship.capacity < 250){ + continue + } + if (_loop_ship.has_space(_company_size)){ //load marines for (var m = 0; m 0){ + instance_activate_object(obj_star); + return _trial_star.id; + } + instance_deactivate_object(id); + } + instance_activate_object(obj_star); + return "none"; +} + function nearest_star_with_ownership(xx,yy, ownership, start_star="none", ignore_dead = true){ var nearest = "none" @@ -530,4 +545,24 @@ function planet_has_forces(star, planet_id, faction, minimum_strength = 1){ break; } return found; +} + + +function planet_all_forces(star, planet_id){ + var forces_list; + with (star){ + forces_list = [ + p_tau[planet_id], + p_tyranids[planet_id], + p_orks[planet_id], + p_eldar[planet_id], + p_necrons[planet_id], + p_demons[planet_id], + p_player[planet_id], + p_chaos[planet_id], + p_traitors[planet_id] + + ] + } + return array_sum(forces_list); } \ No newline at end of file diff --git a/objects/obj_controller/Alarm_1.gml b/scripts/scr_system_spawn/scr_system_spawn.gml similarity index 80% rename from objects/obj_controller/Alarm_1.gml rename to scripts/scr_system_spawn/scr_system_spawn.gml index 278dd034d1..e0bfffc17e 100644 --- a/objects/obj_controller/Alarm_1.gml +++ b/scripts/scr_system_spawn/scr_system_spawn.gml @@ -1,3 +1,21 @@ +function system_setup_controller(){ + instance_activate_all(); + if (instance_exists(obj_ini)) and (global.load==-1){ + show_debug_message("system spawn main"); + wait_and_execute(2, scr_system_spawn, [], self); + instance_activate_object(obj_star); + instance_activate_all(); + } + +} + +function scr_system_spawn(){ + system_setup_data = { + large_docks : 0, + medium_docks : 0, + small_docks : 0, + }; + show_debug_message("system complexities"); // Sets up the sector spawn and assigns spawned enemies to the sector instance_activate_object(obj_star); instance_activate_all(); @@ -37,7 +55,7 @@ if (did){ } with(_current_system){ for(var f=1; f<=4; f++){ - if (array_length( search_planet_features(p_feature[f], P_features.Monastery)) >0)and (array_length( search_planet_features(p_feature[f], P_features.Recruiting_World)) >0){ + if (array_length( search_planet_features(p_feature[f], P_features.Monastery)) >0)and (array_length( search_planet_features(p_feature[f], P_features.RecruitingWorld)) >0){ if (p_owner[f]==eFACTION.Player) then p_owner[f]=eFACTION.Imperium; } if (array_length( search_planet_features(p_feature[f], P_features.Monastery)) >0){ @@ -58,7 +76,7 @@ if (did){ var fleet=instance_create(_current_system.x,_current_system.y,obj_p_fleet); fleet.owner = eFACTION.Player; - for(var f=0; f0) and (_current_system.p_type[1]!="Dead") and (_current_system.owner == eFACTION.Imperium){ - p_owner[1] = eFACTION.Tau; - owner = eFACTION.Tau; - p_influence[1][eFACTION.Tau]=70; - } + if (is_dead_star() || planets<0){ + continue; + } + if (owner != eFACTION.Imperium){ + continue; + } + + for (var s=1;s<=planets;s++){ + if (p_type[s] != "Dead" && choose(0,1)){ + setup_tau_world(_current_system, s); + break; + } + } } instance_deactivate_object(_current_system); } @@ -327,39 +353,7 @@ if (did){ instance_activate_object(obj_star); } // Chaos - repeat(2+irandom(4)){ - xx=floor(random(1152))+64; - yy=floor(random(748))+64; - _current_system=instance_nearest(xx,yy,obj_star); - with (_current_system){ - if (planets>0) and (owner == eFACTION.Imperium){ - planet[1]=1; - p_owner[1]=10; - owner = eFACTION.Chaos; - } - } - instance_deactivate_object(_current_system); - } - // More sneaky this way; you have to be noted of rising heresy or something, or have a ship in the system - var hell_holes = ["Badab", "Hellsiris","Vraks","Isstvan","Stygies","Stygia","Nostromo","Jhanna","Gangrenous Rot"]; - with(obj_star){ - if (array_contains(hell_holes, name)){ - rando=choose(1,1); // make 1's 0's if you want less chaos - if (rando==1){ - - owner = eFACTION.Chaos; - p_owner = array_create(5, owner); - for (var i=1;i<=planets;i++){ - p_heresy[i]=floor(random_range(75,100)); - if (p_type[i]=="Dead") then p_type[i]=choose("Hive","Temperate","Desert","Ice"); - - if (p_type[i]!="Dead") then p_traitors[i]=6; - // give them big defences - if (p_type[i]!="Dead") then p_fortified[i]=choose(4,5,5,4,4,3,6); - } - } - } - } + spawn_chaos_stars(); // Ork planets here @@ -419,34 +413,37 @@ if (did){ } } + + //seeds genestealer cults instance_activate_object(obj_ini); if (field=="both"){ - if (obj_ini.fleet_type==ePlayerBase.penitent) then orkz+=3; + if (obj_ini.fleet_type==ePlayerBase.penitent){ + orkz+=3; + } orkz+=3; n=array_length(_non_xenos_chaos); for (var j=0; j0) and (_current_system.owner == eFACTION.Imperium){ - var forge_planet = irandom(_current_system.planets-1)+1; - _current_system.plant[forge_planet]=1; - _current_system.p_type[forge_planet]="Forge"; - _current_system.owner = eFACTION.Mechanicus; - _current_system.p_owner[forge_planet] = _current_system.owner; - _current_system.p_first[forge_planet] = _current_system.owner; + var _forge_planet = irandom(_current_system.planets-1)+1; + if (system_setup_data.large_docks == 0){ + var _dock_size = 3; + } else { + _dock_size = choose(2,3); + } + setup_forge_world(_current_system, _forge_planet, choose(2,3)); } instance_deactivate_object(_current_system); } @@ -458,8 +455,12 @@ y=py; instance_activate_object(obj_star); -if (did==0) then alarm[1]=5; -if (did!=0) then obj_star.alarm[1]=1; +if (did==0){ + wait_and_execute(5, scr_system_spawn, [], self); +} else { + system_setup_data.map_dock_qouta = irandom_range(10, 20); + wait_and_execute(1, setup_star_planet_defualts, [], self); +} // Eldar craftworld here @@ -481,7 +482,7 @@ for(var i=0; i<100; i++){ var craft=instance_create(xx,yy,obj_star); craft.craftworld=1; go=999; - array_push(craft.p_feature[1],new NewPlanetFeature(P_features.Warlord6)); + array_push(craft.p_feature[1],new PlanetFeature(P_features.Warlord6)); var elforce=instance_create(xx,yy,obj_en_fleet); elforce.sprite_index=spr_fleet_eldar; @@ -545,32 +546,34 @@ obj_crusade.placing=1;scr_zoom();*/ // scr_add_artifact("Weapon","",4,obj_ini.home_name,1); -/*scr_add_artifact("good","daemonic",0,obj_ini.ship[0],501); -scr_add_artifact("good","daemonic",0,obj_ini.ship[0],501); -scr_add_artifact("good","daemonic",0,obj_ini.ship[0],501); -scr_add_artifact("good","daemonic",0,obj_ini.ship[0],501); -scr_add_artifact("good","daemonic",0,obj_ini.ship[0],501); -scr_add_artifact("good","daemonic",0,obj_ini.ship[0],501); -scr_add_artifact("good","daemonic",0,obj_ini.ship[0],501);*/ +/*scr_add_artifact("good","daemonic",0,obj_ini.ship_data[0].name,501); +scr_add_artifact("good","daemonic",0,obj_ini.ship_data[0].name,501); +scr_add_artifact("good","daemonic",0,obj_ini.ship_data[0].name,501); +scr_add_artifact("good","daemonic",0,obj_ini.ship_data[0].name,501); +scr_add_artifact("good","daemonic",0,obj_ini.ship_data[0].name,501); +scr_add_artifact("good","daemonic",0,obj_ini.ship_data[0].name,501); +scr_add_artifact("good","daemonic",0,obj_ini.ship_data[0].name,501);*/ // scr_add_item("Cyclonic Torpedo",5); // scr_add_item("Exterminatus",5); if (is_test_map==true){ // scr_add_item("Exterminatus",5); - /*scr_add_artifact("good","",0,obj_ini.ship[0],501); - scr_add_artifact("good","",0,obj_ini.ship[0],501); - scr_add_artifact("good","",0,obj_ini.ship[0],501); - scr_add_artifact("good","",0,obj_ini.ship[0],501); - scr_add_artifact("good","",0,obj_ini.ship[0],501); - scr_add_artifact("good","",0,obj_ini.ship[0],501); - scr_add_artifact("good","",0,obj_ini.ship[0],501);*/ + /*scr_add_artifact("good","",0,obj_ini.ship_data[0].name,501); + scr_add_artifact("good","",0,obj_ini.ship_data[0].name,501); + scr_add_artifact("good","",0,obj_ini.ship_data[0].name,501); + scr_add_artifact("good","",0,obj_ini.ship_data[0].name,501); + scr_add_artifact("good","",0,obj_ini.ship_data[0].name,501); + scr_add_artifact("good","",0,obj_ini.ship_data[0].name,501); + scr_add_artifact("good","",0,obj_ini.ship_data[0].name,501);*/ } -with(obj_temp7){instance_destroy();} //for tau fleets, if it is stationed on a system it owns, make a temp7 obj +var _tau_stars = []; with(obj_en_fleet){ - if (owner == eFACTION.Tau) and (instance_nearest(x,y,obj_star).owner == eFACTION.Tau) then instance_create(x,y,obj_temp7); + if (owner == eFACTION.Tau) and (instance_nearest(x,y,obj_star).owner == eFACTION.Tau){ + instance_create(x,y,obj_temp7); + } } //if any temp objects exist, find the one nearest to the center of the room and set your direction to //the angle to the room center @@ -581,8 +584,13 @@ if (instance_exists(obj_temp7)){ } } +with(obj_temp7){instance_destroy();}; + /*with(obj_star){ scr_star_ownership(false); }*/ // x=0;y=0; +instance_activate_all(); + +} \ No newline at end of file diff --git a/scripts/scr_system_spawn/scr_system_spawn.yy b/scripts/scr_system_spawn/scr_system_spawn.yy new file mode 100644 index 0000000000..902b2661c2 --- /dev/null +++ b/scripts/scr_system_spawn/scr_system_spawn.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"scr_system_spawn", + "isCompatibility":false, + "isDnD":false, + "name":"scr_system_spawn", + "parent":{ + "name":"Sys", + "path":"folders/Scripts/Sys.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/scr_system_spawn_functions/scr_system_spawn_functions.gml b/scripts/scr_system_spawn_functions/scr_system_spawn_functions.gml index d4a08641d7..344f990a58 100644 --- a/scripts/scr_system_spawn_functions/scr_system_spawn_functions.gml +++ b/scripts/scr_system_spawn_functions/scr_system_spawn_functions.gml @@ -66,7 +66,7 @@ function player_home_star(home_planet){ } name=obj_ini.home_name; } - array_push(p_feature[home_planet], new NewPlanetFeature(P_features.Monastery)); + array_push(p_feature[home_planet], new PlanetFeature(P_features.Monastery)); p_owner[home_planet]=eFACTION.Player; p_first[home_planet]=1; //monestary @@ -122,7 +122,7 @@ function set_player_recruit_planet(recruit_planet){ name=obj_ini.home_name; } } - array_push(p_feature[recruit_planet], new NewPlanetFeature(P_features.Recruiting_World));//recruiting world + array_push(p_feature[recruit_planet], new PlanetFeature(P_features.RecruitingWorld));//recruiting world if (p_type[recruit_planet]=="random") then p_type[recruit_planet]=choose("Death","Temperate","Desert","Ice","Hive", "Fuedal"); if (global.chapter_name!="Lamenters") then obj_controller.recruiting_worlds+=string(name)+" II|"; } @@ -149,7 +149,7 @@ function set_player_homeworld_star(chosen_star){ var _recruit_star = array_random_element(_possible_planets) set_player_recruit_planet(_recruit_star); } else if (obj_ini.recruit_relative_loc==0){ - array_push(p_feature[_home_star], new NewPlanetFeature(P_features.Recruiting_World));//recruiting world + array_push(p_feature[_home_star], new PlanetFeature(P_features.RecruitingWorld));//recruiting world for (var i=1;i<=planets;i++){ if (i!=_home_star){ p_type[i] = array_random_element(_planet_types); @@ -175,3 +175,42 @@ function create_recruit_system(star){ } + +function spawn_chaos_stars(){ + // Chaos + var _chaos_stars = 2+irandom(4); + repeat(_chaos_stars){ + var xx=irandom(1152)+64; + var yy=irandom(748)+64; + var _current_system=instance_nearest(xx,yy,obj_star); + with (_current_system){ + var _planet = irandom_range(1, planets); + if (planets>0) and (owner == eFACTION.Imperium){ + var _planet = irandom_range(1, planets); + setup_chaos_world(id,_planet); + } + } + instance_deactivate_object(_current_system); + } + // More sneaky this way; you have to be noted of rising heresy or something, or have a ship in the system + var hell_holes = ["Badab", "Hellsiris","Vraks","Isstvan","Stygies","Stygia","Nostromo","Jhanna","Gangrenous Rot"]; + with(obj_star){ + if (array_contains(hell_holes, name)){ + rando=choose(1,1); // make 1's 0's if you want less chaos + if (rando==1){ + + owner = eFACTION.Chaos; + p_owner = array_create(5, owner); + for (var i=1;i<=planets;i++){ + p_heresy[i]=floor(random_range(75,100)); + if (p_type[i]=="Dead") then p_type[i]=choose("Hive","Temperate","Desert","Ice"); + + if (p_type[i]!="Dead") then p_traitors[i]=6; + // give them big defences + if (p_type[i]!="Dead") then p_fortified[i]=choose(4,5,5,4,4,3,6); + } + } + } + } +} + diff --git a/scripts/scr_trade/scr_trade.gml b/scripts/scr_trade/scr_trade.gml index 09975ba533..3def3a9c33 100644 --- a/scripts/scr_trade/scr_trade.gml +++ b/scripts/scr_trade/scr_trade.gml @@ -226,7 +226,7 @@ function TradeAttempt(diplomacy) constructor{ repeat(planets){ q+=1; if (p_owner[q]=5) then ahuh=1; - if (p_owner[q]<6) and (planet_feature_bool(p_feature[q],P_features.Sororitas_Cathedral) == 1) then ahuh=1; + if (p_owner[q]<6) and (planet_feature_bool(p_feature[q],P_features.SororitasCathedral) == 1) then ahuh=1; } if (ahuh=1){ array_push(viable_faction_trade_stars, id); diff --git a/scripts/scr_turn_first/scr_turn_first.gml b/scripts/scr_turn_first/scr_turn_first.gml index c470e2540b..c89f17144f 100644 --- a/scripts/scr_turn_first/scr_turn_first.gml +++ b/scripts/scr_turn_first/scr_turn_first.gml @@ -1,42 +1,42 @@ function scr_turn_first() { try { - // I believe this is ran at the start of the end of the turn. That would make sense, right? + // I believe this is ran at the start of the end of the turn. That would make sense, right? + var identifiable=0; + var unload=0; + var cur_arti; + for (var i=0;i-1){ + var _ship = fetch_ship(valid_ship); + obj_ini.artifact_loc[unload] = _ship.name; + obj_ini.artifact_sid[unload] = 500+valid_ship; + } + } + if (cur_arti.identified()>0){ + var _identifiable = cur_arti.is_identifiable() + + if (instance_exists(obj_p_fleet)) and (!_identifiable){ + var _arti_fleet = find_ships_fleet(cur_arti.ship_id()); + if (_arti_fleet!="none"){ + if (array_length(_arti_fleet.capital_num)){ + _identifiable = true; + cur_arti.set_ship_id(_arti_fleet.capital_num[0]); + } + } + } + + if (_identifiable) then obj_ini.artifact_identified[unload]-=1; + if (obj_ini.artifact_identified[unload]=0) then scr_alert("green","artifact","Artifact ("+string(obj_ini.artifact[unload])+") has been identified.",0,0); + } + _identifiable=false; + } + unload=0; - var _unload_i = 0; - for (var i = 0, l = array_length(obj_ini.artifact); i < l; i++) { - _unload_i = i; - if (obj_ini.artifact[_unload_i] == "") { - continue; - } - var _cur_arti = obj_ini.artifact_struct[_unload_i]; - if (_cur_arti.loc() == "") { - var _valid_ship_i = get_valid_player_ship(); - if (_valid_ship_i > -1) { - obj_ini.artifact_loc[_unload_i] = obj_ini.ship[_valid_ship_i]; - obj_ini.artifact_sid[_unload_i] = 500 + _valid_ship_i; - } - } - if (_cur_arti.identified() > 0) { - var _identifiable = _cur_arti.is_identifiable(); - - if (instance_exists(obj_p_fleet) && (!_identifiable)) { - var _arti_fleet = find_ships_fleet(_cur_arti.ship_id()); - if (_arti_fleet != "none") { - if (array_length(_arti_fleet.capital_num)) { - _identifiable = true; - _cur_arti.set_ship_id(_arti_fleet.capital_num[0]); - } - } - } - - if (_identifiable) { - obj_ini.artifact_identified[_unload_i] -= 1; - } - if (obj_ini.artifact_identified[_unload_i] == 0) { - scr_alert("green", "artifact", "Artifact (" + string(obj_ini.artifact[_unload_i]) + ") has been identified.", 0, 0); - } - } - } var _peace_check = obj_controller.turn > 100; // peace_check=1;// Testing diff --git a/scripts/scr_tyranid_fleet_functions/scr_tyranid_fleet_functions.gml b/scripts/scr_tyranid_fleet_functions/scr_tyranid_fleet_functions.gml new file mode 100644 index 0000000000..b0664ea4aa --- /dev/null +++ b/scripts/scr_tyranid_fleet_functions/scr_tyranid_fleet_functions.gml @@ -0,0 +1,395 @@ +function find_nearest_edge_coords(x, y){ + var edge_coords = [0,0]; + var left_distance = x; + var right_distance = room_width-x; + var top_distance = y; + var bottom_distance = room_height-y; + var small_dist = min(left_distance,right_distance,top_distance,bottom_distance); + switch(small_dist){ + case left_distance: + edge_coords = [0,y]; + break; + case right_distance: + edge_coords = [room_width,y]; + break; + case top_distance: + edge_coords = [x,0]; + break; + case bottom_distance: + edge_coords = [x,room_height]; + break; + } + + return edge_coords; +} + +function plus_or_minus_rand(figure, variation){ + return figure+(irandom(variation)*choose(-1,1)); +} + +function plus_or_minus_clamp(figure, variation, bottom,top){ + return clamp(plus_or_minus_rand(figure, variation), bottom,top); +} + +function tyranid_fleet_planet_action(){ + + var is_dead=false; + with (orbiting){ + is_dead = is_dead_star(); + if (!is_dead) { + for (var i=1;i<=planets;i++){ + if (planet_feature_bool(p_feature[i], P_features.GeneStealerCult)){ + if (p_influence[i][eFACTION.Tyranids]>50){ + var alert = $"The Genestealer Cult on {planet_numeral_name(i)} is exceedingly thorough, there is almost no resistance as the swarm descends and what little resistance remains is quickly quelled by infiltrators, most of the populations willingly offer themselves to their new gods jumping into acid vats to form biomass for their newly arrived gods or otherwise allowing themselves to be devoured by the teaming ripper swarms"; + scr_popup("Tyranids",alert,"",""); + p_pdf[i] = 0; + scr_alert("red","owner",$"Tyranid swarms begin the process of stripping {planet_numeral_name(i)} for biomass",x,y); + } else { + scr_alert("red","owner",$"The pdf of {planet_numeral_name(i)} is badly degraded by genestealer cult forces as the hive fleet decends",x,y); + scr_popup("Tyranids",scr_alert,"",""); + p_pdf[i]*=(p_influence[i][eFACTION.Tyranids]/100); + } + delete_features(p_feature[i], P_features.GeneStealerCult); + } + } + } + } + organise_tyranid_fleet_bio(); +} + +function summon_new_hive_fleet(capitals = 5,frigates = 0, escorts = 0, biomass = 1000){ + var start_coords = find_nearest_edge_coords(x,y); + + if (start_coords[0] != 0 && start_coords[0]!= room_width){ + start_coords[0] = plus_or_minus_clamp(start_coords[0], 200, 0, room_width); + } else { + if (start_coords[0]==0){ + start_coords[0]+=100 + } else { + start_coords[0]-=100 + } + } + if (start_coords[1] != 0 && start_coords[1]!= room_height){ + start_coords[1] = plus_or_minus_clamp(start_coords[1], 200, 0, room_height); + } else { + if (start_coords[1]==0){ + start_coords[1]+=100 + } else { + start_coords[1]-=100 + } + } + + var _fleet=new_tyranid_fleet(start_coords[0],start_coords[1], capitals, frigates, escorts, biomass); + _fleet.action_x = x; + _fleet.action_y = y; + with(_fleet){ + set_fleet_movement(); + } + + return _fleet +} + +function hive_fleet_arrives_from_out_of_system(){ + if (has_problem_planet_and_time(i,"Hive Fleet", 3)>-1){ + var _chief_lib=scr_role_count("Chief "+string(obj_ini.role[100,17]),,"units"); + var _has_chief_lib = array_length(_chief_lib); + if (_has_chief_lib){ + _chief_lib = _chief_lib[0]; + } + + var _master_psy = false; + + var _intolerant = scr_has_disadv("Psyker Intolerant"); + + if (obj_controller.known[eFACTION.Tyranids]=0 && _has_chief_lib && !_intolerant){ + scr_popup("Shadow in the Warp",$"Chief {_chief_lib.name_role()} reports a disturbance in the warp. He claims it is like a shadow.","shadow",""); + scr_event_log("red",$"Chief {_chief_lib.name_role()} reports a disturbance in the warp. He claims it is like a shadow."); + } + if (!obj_controller.known[eFACTION.Tyranids] && !_has_chief_lib && !_intolerant){ + var q=0,q2=0; + repeat(90){ + if (q2=0){ + q+=1; + if (obj_ini.role[0,q]==obj_ini.role[100][eROLE.ChapterMaster]){q2=q; + if (string_count("0",obj_ini.spe[0,q2])>0) then _master_psy=true; + } + } + } + if (_master_psy=true){ + scr_popup("Shadow in the Warp","You are distracted and bothered by a nagging sensation in the warp. It feels as though a shadow descends upon your sector.","shadow",""); + scr_event_log("red","You sense a disturbance in the warp. It feels something like a massive shadow."); + } + } + + g=50; + i=50; + obj_controller.known[eFACTION.Tyranids]=1; + } +} + +function new_tyranid_fleet(xx, yy, capitals = 5,frigates = 0, escorts = 0, fleet_biomass = 1000){ + var _fleet = instance_create(xx, yy,obj_en_fleet); + var _mass = fleet_biomass + with (_fleet){ + owner = eFACTION.Tyranids; + sprite_index = spr_fleet_tyranid; + image_index = 1; + capital_number = capitals; + frigate_number = frigates; + escort_number = escorts; + action = ""; + action_spd = 10; + biomass = _mass; + warp_able = false; + } + return _fleet; +} + +function star_biomass_value(star, fleet=false){ + var _bio_val = 0; + if (is_dead_star(star)){ + _bio_val = -1; + } else { + for (var i=0;i _bio){ + var _temp = _star; + _stars[s] = _star2; + _stars[s + 1] = _temp; + _swaps = true; + } + } + if (!_swaps){ + break; + } + } + + return [_stars, _bio_vals]; +} + +function split_off_new_nid_splinter(){ + var _systems = sort_planets_by_biomass_potential(); + var _bio = _systems[1]; + _systems = _systems[0]; + var _target = _systems[irandom(2)]; + var _new_fleet = new_tyranid_fleet(x, y, 4,0,0,100); + biomass -= 500; + + _new_fleet.action_x=_target.x; + _new_fleet.action_y=_target.y; + with (new_fleet){ + set_fleet_movement(); + } + +} + +function organise_tyranid_fleet_bio(){ + if (capital_number < 5 && biomass > 300){ + capital_number++; + biomass -= 100; + } + if (capital_number*2>frigate_number){ + capital_number-=1; + frigate_number+=2; + } + + if (capital_number*4>escort_number){ + var rand=choose(1,2,3,4); + if (rand=4) then escort_number+=1; + } + + + + if (capital_number>0){ + var capitals_engaged=0; + var caps = capital_number; + var _planets = []; + for (var i=1;i<=array_length(orbiting.planets);i++){ + array_push(_planets, i); + } + _planets = array_shuffle(_planets); + capitals_engaged = 0; + for (var i=0;i= capital_number){ + break; + } + var _planet = _planets[i]; + if (orbiting.p_tyranids[_planet] < 6 && biomass > 0){ + var _all_except_nids = planet_all_forces(orbiting, _planet) - orbiting.p_tyranids[_planet]; + if (orbiting.p_pdf[_planet] > 0 || orbiting.p_guardsmen[_planet] || _all_except_nids>0){ + for (var n=0;orbiting.p_tyranids[_planet]<6 && biomass>9;n++){ + orbiting.p_tyranids[_planet]++; + biomass -=10; + } + capitals_engaged++; + } + } + + } + } + + + + var _is_dead=false; + with (orbiting){ + _is_dead = is_dead_star(); + } + + if (_is_dead){ + + var xx=0,yy=0,good=0,plin=0,plin2=0; + var _split_fleet = false; + if (bio_mass > 1000){ + _split_fleet=true; + } + + if (split_fleet){ + split_off_new_nid_splinter(); + } + } +} + + +function set_nid_ships(){ + if (class=="Leviathan"){ + sprite_index=spr_ship_leviathan; + size=3; + name=""; + hp=1000; + maxhp=1000; + conditions=""; + shields=300; + maxshields=300; + leadership=100; + armour_front=7; + side_armour=5; + weapons=5; + turrets=3; + capacity=0; + carrying=0; + add_weapon_to_ship("Feeder Tendrils" , { + dam : 12, + range :160 + }); + add_weapon_to_ship("Bio-Plasma Discharge" , { + dam : 10, + range : 260, + cooldown : 10, + facing : "most", + }); + + add_weapon_to_ship("Pyro-Acid Battery" , { + dam : 18, + range : 500, + cooldown : 40, + facing : "front", + }); + + add_weapon_to_ship("Launch Glands"); + + }else + if (class=="Razorfiend"){ + sprite_index=spr_ship_razorfiend; + size=2; + name=""; + hp=600; + maxhp=600; + conditions=""; + shields=200; + maxshields=200; + leadership=100; + armour_front=5; + side_armour=4; + weapons=3; + turrets=2; + capacity=0; + carrying=0; + + add_weapon_to_ship("Pyro-Acid Battery" , {dam : 12, facing : "front"}); + add_weapon_to_ship("Feeder Tendrils"); + add_weapon_to_ship("Massive Claws"); + + }else + if (class=="Stalker"){ + sprite_index=spr_ship_stalker; + size=1; + name=""; + hp=100; + maxhp=100; + conditions=""; + shields=100; + maxshields=100; + leadership=100; + armour_front=5; + side_armour=4; + weapons=1; + turrets=0; + capacity=0; + carrying=0; + add_weapon_to_ship("Pyro-acid Battery", {cooldown : 60}); + add_weapon_to_ship("Feeder Tendrils", {cooldown : 20}); + add_weapon_to_ship("Bio-Plasma Discharge"); + max_speed = 20; + + }else + if (class=="Prowler"){ + sprite_index=spr_ship_prowler; + size=1; + name=""; + hp=100; + maxhp=100; + conditions=""; + shields=100; + maxshields=100; + leadership=100; + armour_front=5; + side_armour=4; + weapons=1; + turrets=0; + capacity=0; + carrying=0; + add_weapon_to_ship("Pyro-acid Battery"); + add_weapon_to_ship("Feeder Tendrils"); + max_speed = 14; + } + +} \ No newline at end of file diff --git a/scripts/scr_tyranid_fleet_functions/scr_tyranid_fleet_functions.yy b/scripts/scr_tyranid_fleet_functions/scr_tyranid_fleet_functions.yy new file mode 100644 index 0000000000..5b82ba2b58 --- /dev/null +++ b/scripts/scr_tyranid_fleet_functions/scr_tyranid_fleet_functions.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"scr_tyranid_fleet_functions", + "isCompatibility":false, + "isDnD":false, + "name":"scr_tyranid_fleet_functions", + "parent":{ + "name":"Scripts", + "path":"folders/Scripts.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/scr_tyranid_planet_functions/scr_tyranid_planet_functions.gml b/scripts/scr_tyranid_planet_functions/scr_tyranid_planet_functions.gml new file mode 100644 index 0000000000..d95624f74a --- /dev/null +++ b/scripts/scr_tyranid_planet_functions/scr_tyranid_planet_functions.gml @@ -0,0 +1,115 @@ +function tyranids_planet_biomass_extraction(){ + // Tyranids here + var planet=0; + for (var planet=1;planet=5) and (planets>=planet) and (p_player[planet]+p_orks[planet]+p_guardsmen[planet]+p_pdf[planet]+p_chaos[planet]=0){ + var ship=scr_orbiting_fleet(eFACTION.Tyranids); + if (ship!="none" && p_type[planet]!="Dead" && ship.capital_number){ + if (planet_feature_bool(p_feature[planet], P_features.ReclamationPools) ==1){ + p_tyranids[planet]=0; + if (p_type[planet]="Death") or (p_type[planet]="Hive") then ship.capital_number+=choose(0,1,1); + ship.capital_number+=1; + ship.escort_number+=3; + ship.image_index=floor((ship.capital_number)+(ship.frigate_number/2)+(ship.escort_number/4)); + p_type[planet]="Dead"; + delete_features(p_feature[planet], P_features.ReclamationPools);// show_message("D"); + if (is_dead_star()) then image_alpha=0.33; + + // if image_alpha = 0.33 then send the ship somewhere new + + } + if (planet_feature_bool(p_feature[planet], P_features.CapillaryTowers)==1) and (p_type[planet]!="Dead"){ + p_population[planet]=floor(p_population[planet]*0.3); + } + if (planet_feature_bool(p_feature[planet], P_features.CapillaryTowers)==1) and (p_type[planet]!="Dead"){ + p_feature[planet]=[]; + array_push(p_feature[planet], new PlanetFeature(P_features.ReclamationPools)); + p_population[planet]=0;// show_message("C"); + } + if (planet_feature_bool(p_feature[planet], P_features.CapillaryTowers)==0) and (planet_feature_bool(p_feature[planet], P_features.ReclamationPools)==0) and (p_type[planet]!="Dead"){ + array_push(p_feature[planet], new PlanetFeature(P_features.CapillaryTowers));// show_message("B"); + } + + } + } + } +} + +function deploy_reclamation_pools(planet){ + if (p_pdf[planet] <= 0){ + new PlanetFeature(P_features.ReclamationPools); + array_push(p_feature[planet], ) + } +} + + + +function genestealer_cult_end_turn_growth(planet){ + if (planet_feature_bool(p_feature[planet], P_features.GeneStealerCult)) { + var cult = return_planet_features(p_feature[planet], P_features.GeneStealerCult)[0]; + cult.cult_age++; + adjust_influence(eFACTION.Tyranids, cult.cult_age / 100, planet); + var planet_garrison = system_garrison[planet - 1]; + if (cult.hiding) { + var find_cult_chance = irandom(1000) - planet_garrison.total_garrison; + var alert_text = $"A hidden Genestealer Cult in {name} Has been discovered!"; + if (planet_garrison.garrison_force) { + var alert_text = $"A hidden Genestealer Cult in {name} Has been discovered by marine garrison!"; + find_cult_chance -= 25; + } + if (p_influence[planet][eFACTION.Tyranids] > 50) { + var find_cult_chance = irandom(50); + var alert_text = $"A hidden Genestealer Cult in {name} Has suddenly burst forth from hiding!"; + } + if (find_cult_chance < 1) { + cult.hiding = false; + scr_popup("System Lost", alert_text, "Genestealer Cult", ""); + owner = eFACTION.Tyranids; + scr_event_log("red", $"A hidden Genestealer Cult in {name} {planet} has Started a revolt.", name); + p_tyranids[planet] += 1; + } + } + if ((!cult.hiding) && (p_tyranids[planet] <= 3) && (p_type[planet] != "Space Hulk") && (p_influence[planet][eFACTION.Tyranids] > 10)) { + var spread = 0; + rando = irandom(150); + rando -= p_influence[planet][eFACTION.Tyranids]; + if (rando <= 15) { + spread = 1; + } + + if ((p_type[planet] == "Lava") && (p_tyranids[planet] == 2)) { + spread = 0; + } + if (((p_type[planet] == "Ice") || (p_type[planet] == "Desert")) && (p_tyranids[planet] == 3)) { + spread = 0; + } + + if (spread == 1) { + p_tyranids[planet] += 1; + } + } + if (p_influence[planet][eFACTION.Tyranids] > 55) { + p_owner[planet] = eFACTION.Tyranids; + if (obj_controller.turn > 150){ + var _cult_influence = p_influence[planet][eFACTION.Tyranids] + var _summon_fleet_chance = roll_dice(1,1000); + if (p_large[planet]){ + _summon_fleet_chance-=5; + if (_cult_influence>70){ + var _growth_extra = (_cult_influence-60)/10; + _summon_fleet_chance -= (power(2, _growth_extra)); + } + if (_summon_fleet_chance<=1){ + summon_new_hive_fleet(); + } + } + } + } + + } else if (p_influence[planet][eFACTION.Tyranids] > 5) { + adjust_influence(eFACTION.Tyranids, -1, planet); + if ((irandom(200) + (p_influence[planet][eFACTION.Tyranids] / 10)) > 195) { + array_push(p_feature[planet], new PlanetFeature(P_features.GeneStealerCult)); + } + } +} \ No newline at end of file diff --git a/scripts/scr_tyranid_planet_functions/scr_tyranid_planet_functions.yy b/scripts/scr_tyranid_planet_functions/scr_tyranid_planet_functions.yy new file mode 100644 index 0000000000..c1e1f6f569 --- /dev/null +++ b/scripts/scr_tyranid_planet_functions/scr_tyranid_planet_functions.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"scr_tyranid_planet_functions", + "isCompatibility":false, + "isDnD":false, + "name":"scr_tyranid_planet_functions", + "parent":{ + "name":"Scripts", + "path":"folders/Scripts.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/scr_ui_advisors/scr_ui_advisors.gml b/scripts/scr_ui_advisors/scr_ui_advisors.gml index d7a9233515..1f317b5b7a 100644 --- a/scripts/scr_ui_advisors/scr_ui_advisors.gml +++ b/scripts/scr_ui_advisors/scr_ui_advisors.gml @@ -99,15 +99,15 @@ function scr_ui_advisors() { draw_set_halign(fa_left); var behav = 0, - r_eta = 0,unit; + r_eta = 0,_unit; for (var qp = 1; qp <= min(36, penitorium); qp++) { - unit = obj_ini.TTRPG[penit_co[qp]][penit_id[qp]]; - if (unit.corruption > 0) then r_eta = round((unit.corruption * unit.corruption) / 50); - if (unit.corruption >= 90) then r_eta = "Never"; - if (unit.corruption <= 0) then r_eta = "0"; + _unit = obj_ini.TTRPG[penit_co[qp]][penit_id[qp]]; + if (_unit.corruption > 0) then r_eta = round((_unit.corruption * _unit.corruption) / 50); + if (_unit.corruption >= 90) then r_eta = "Never"; + if (_unit.corruption <= 0) then r_eta = "0"; draw_rectangle(xx + 947, yy + 100 + ((qp - 1) * 20), xx + 1577, yy + 100 + (qp * 20), 1); - draw_text(xx + 950, yy + 100 + ((qp - 1) * 20), string_hash_to_newline(unit.name_role())); + draw_text(xx + 950, yy + 100 + ((qp - 1) * 20), string_hash_to_newline(_unit.name_role())); draw_text(xx + 1200, yy + 100 + ((qp - 1) * 20), string_hash_to_newline("ETA: " + string(r_eta))); draw_text(xx + 1432, yy + 100 + ((qp - 1) * 20), string_hash_to_newline("[Execute] [Release]")); } @@ -153,8 +153,8 @@ function scr_ui_advisors() { if (fest_scheduled = 1) { if (fest_type != "Chapter Relic") then blurp2 = "A " + string(fest_type) + " has been scheduled on "; if (fest_type = "Chapter Relic") then blurp2 = "Chapter Relic construction has been scheduled on "; - - if (fest_planet = 0) then blurp2 += string(obj_ini.ship[fest_sid]); + var _ship = fetch_ship(fest_sid); + if (fest_planet = 0) then blurp2 += _ship.name(); if (fest_planet > 0) then blurp2 += string(fest_star) + " " + scr_roman(fest_wid); if (fest_honoring = 0) then blurp2 += ". "; @@ -665,8 +665,12 @@ function scr_ui_advisors() { draw_text_ext(xx + 222, yy + 216, string_hash_to_newline(string(tot_ki)), -1, 396); var unit = fetch_unit([0,1]); - if (unit.ship_location == -1) then draw_text(xx + 222, yy + 380, string_hash_to_newline($"Current Location: {unit.location_string} {unit.planet_location}#Health: " + unit.hp() + "%")); - if (unit.ship_location>-1) then draw_text(xx + 222, yy + 380, string_hash_to_newline($"Current Location: Onboard {obj_ini.ship[unit.ship_location]}#Health: {unit.hp()}%")); + if (unit.ship_location == -1){ + draw_text(xx + 222, yy + 380, string_hash_to_newline($"Current Location: {unit.location_string} {unit.planet_location}#Health: {unit.hp()}%")); + } else if (_unit.ship_location>-1) { + var _ship = _unit.ship(); + draw_text(xx + 222, yy + 380, string_hash_to_newline($"Current Location: Onboard {_ship.name}#Health: {_unit.hp()}%")); + } draw_text(xx + 222.5, yy + 380.5, string_hash_to_newline("Current Location:#Health:")); draw_sprite(spr_arrow, 0, xx + 217, yy + 32); diff --git a/scripts/scr_ui_manage/scr_ui_manage.gml b/scripts/scr_ui_manage/scr_ui_manage.gml index a935f8e312..7a7264e9f4 100644 --- a/scripts/scr_ui_manage/scr_ui_manage.gml +++ b/scripts/scr_ui_manage/scr_ui_manage.gml @@ -19,12 +19,14 @@ function load_marines_into_ship(system, ship, units, reload = false) { _set(obj_ini.veh_lid, vehicle, sh_ide[ship]); _set(obj_ini.veh_wid, vehicle, 0); _set(obj_ini.veh_uid, vehicle, sh_uid[ship]); - obj_ini.ship_carrying[sh_ide[ship]] += size; + var _ship = obj_ini.ship_data[sh_ide[ship]]; + _ship.carrying += size; if (start_planet) { load_from_star.p_player[start_planet] -= size; } else if (start_ship) { - obj_ini.ship_carrying[start_ship] -= size; + var _ship = obj_ini.ship_data[start_ship]; + _ship.carrying -= size; } set_vehicle_last_ship(vehicle, true); diff --git a/scripts/scr_ui_popup/scr_ui_popup.gml b/scripts/scr_ui_popup/scr_ui_popup.gml index e83fda09b2..c3b3c67b54 100644 --- a/scripts/scr_ui_popup/scr_ui_popup.gml +++ b/scripts/scr_ui_popup/scr_ui_popup.gml @@ -20,9 +20,9 @@ function scr_ui_popup() { var ttitle=""; var woob=""; - if (planet_feature_bool(planet_upgrades, P_features.Secret_Base)==1){s_base=1} + if (planet_feature_bool(planet_upgrades, P_features.SecretBase)==1){s_base=1} if (planet_feature_bool(planet_upgrades, P_features.Arsenal)==1){arsenal=1} - if (planet_feature_bool(planet_upgrades, P_features.Gene_Vault)==1){gene_vault=1} + if (planet_feature_bool(planet_upgrades, P_features.GeneVault)==1){gene_vault=1} un_upgraded = gene_vault+arsenal+s_base; if (obj_temp_build.isnew == 1) { title = "Secret Lair (" + string(obj_temp_build.target.name) + " " + scr_roman(obj_temp_build.planet) + ")"; @@ -67,7 +67,7 @@ function scr_ui_popup() { if (scr_click_left()) { var base_options = {style: style.tag}; obj_temp_build.isnew = 0; - array_push(planet_upgrades, new NewPlanetFeature(P_features.Secret_Base, base_options)); + array_push(planet_upgrades, new PlanetFeature(P_features.SecretBase, base_options)); } } @@ -94,7 +94,7 @@ function scr_ui_popup() { draw_set_halign(fa_left); if (s_base>0){ - var search_list =search_planet_features(planet_upgrades, P_features.Secret_Base); + var search_list =search_planet_features(planet_upgrades, P_features.SecretBase); if (array_length(search_list) > 0){ woob=""; var secret=true; @@ -287,10 +287,10 @@ function scr_ui_popup() { if (arsenal.inquis_hidden == 1) then woob="A moderate sized secret Arsenal, this structure has ample holding area to store any number of artifacts and wargear. Chaos and Daemonic items will be sent here by your Master of Relics, and due to the secret nature of its existance, the Inquisition will not find them during routine inspections."; if (arsenal.inquis_hidden == 0) then woob="A moderate sized Arsenal, this structure has ample holding area to store any number of artifacts and wargear. Since being discovered it may no longer hide Chaos and Daemonic wargear from routine Inquisition inspections. You may wish to construct another Arsenal on a different planet."; } - if (planet_feature_bool(planet_upgrades, P_features.Gene_Vault)==1){ - var gene_vault = planet_upgrades[search_planet_features(planet_upgrades, P_features.Gene_Vault)[0]]; - if (gene_vault.inquis_hidden == 1) then woob="A large facility with Gene-Vaults and additional spare rooms, this structure safely stores the majority of your Gene-Seed and is ran by servitors. Due to its secret nature you may amass Gene-Seed and Test-Slave Incubators without fear of Inquisition reprisal or taking offense."; - if (gene_vault.inquis_hidden == 0) then woob="A large facility with Gene-Vaults and additional spare rooms, this structure safely stores the majority of your Gene-Seed and is ran by servitors. Since being discovered all the contents are known to the Inquisition. Your Gene-Seed remains protected but you may wish to build a new, secret one."; + if (planet_feature_bool(planet_upgrades, P_features.GeneVault)==1){ + var gene_vault = planet_upgrades[search_planet_features(planet_upgrades, P_features.GeneVault)[0]]; + if (gene_vault.inquis_hidden == 1) then woob="A large facility with Gene-Vaults and additional spare rooms, this structure safely stores the majority of your Gene-Seed and is ran by servitors. Due to its secret nature you may amass Gene-Seed and Test-Slave Incubators without fear of Inquisition reprisal or taking offense."; + if (gene_vault.inquis_hidden == 0) then woob="A large facility with Gene-Vaults and additional spare rooms, this structure safely stores the majority of your Gene-Seed and is ran by servitors. Since being discovered all the contents are known to the Inquisition. Your Gene-Seed remains protected but you may wish to build a new, secret one."; } if (arsenal!=0) or (gene_vault!=0){ draw_text_ext(xx+21,yy+65,string_hash_to_newline(string(woob)),-1,595); @@ -330,7 +330,7 @@ function scr_ui_popup() { draw_set_alpha(1); if (scr_click_left()) and (obj_controller.requisition>=1500){ - array_push(planet_upgrades, new NewPlanetFeature(P_features.Arsenal)); + array_push(planet_upgrades, new PlanetFeature(P_features.Arsenal)); obj_controller.requisition-=1500; } }draw_set_halign(fa_left); @@ -348,7 +348,7 @@ function scr_ui_popup() { draw_set_alpha(0.2);draw_rectangle(xx+300,yy+175,xx+400,yy+195,0);draw_set_alpha(1); if (scr_click_left()) and (obj_controller.requisition>=4000){ - array_push(planet_upgrades, new NewPlanetFeature(P_features.Gene_Vault)); + array_push(planet_upgrades, new PlanetFeature(P_features.GeneVault)); obj_controller.requisition-=4000; } }draw_set_halign(fa_left); diff --git a/scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml b/scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml index 5069a55bff..503c7db73c 100644 --- a/scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml +++ b/scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml @@ -63,7 +63,8 @@ function UnitQuickFindPanel() constructor{ } } else if (unit_location[0]==location_types.ship){ if (unit.ship_location-1){ - obj_ini.ship_carrying[unit.ship_location]+=unit.get_unit_size(); + var _ship = fetch_ship(unit.ship_location); + _ship.carrying += unit.get_unit_size(); } } } @@ -90,36 +91,39 @@ function UnitQuickFindPanel() constructor{ garrison_log[$ unit_location].vehicles++; } } else if (obj_ini.veh_lid[co][u]>-1){ - obj_ini.ship_carrying[obj_ini.veh_lid[co][u]]+=scr_unit_size("",obj_ini.veh_role[co][u],true); + var _ship = fetch_ship(obj_ini.veh_lid[co][u]); + _ship.carrying += scr_unit_size("",obj_ini.veh_role[co][u],true); } } static update_garrison_log = function(){ try{ - for (var i = 0;i -1) { - if (obj_ini.ship_location[_v_ship] == _location) { + var _shipstruct = obj_ini.ship_data[selecting_ship]; + if (_shipstruct.location == _location) { is_at_loc = true; } } else if (_loc == _location) { diff --git a/scripts/scr_vehicle_helpers/scr_vehicle_helpers.gml b/scripts/scr_vehicle_helpers/scr_vehicle_helpers.gml index b5ffd1a092..1497294658 100644 --- a/scripts/scr_vehicle_helpers/scr_vehicle_helpers.gml +++ b/scripts/scr_vehicle_helpers/scr_vehicle_helpers.gml @@ -2,9 +2,10 @@ function set_vehicle_last_ship(vehic_array, empty = false) { if (!empty) { var vehic_ini = obj_ini.veh_lid[vehic_array[0]][vehic_array[1]]; + var _ship = obj_ini.ship_data[vehic_array[0]][vehic_array[1]]; var _last_ship_data = { - uid : obj_ini.ship_uid[vehic_ini], - name : obj_ini.ship[vehic_ini], + uid : _ship.uid, + name : _ship.name, } } else { var _last_ship_data = { diff --git a/scripts/scr_wait_and_execute/scr_wait_and_execute.gml b/scripts/scr_wait_and_execute/scr_wait_and_execute.gml index da49c17eac..daffa62f88 100644 --- a/scripts/scr_wait_and_execute/scr_wait_and_execute.gml +++ b/scripts/scr_wait_and_execute/scr_wait_and_execute.gml @@ -3,11 +3,12 @@ /// @arg {real} timer How many steps to wait. 0 executes it next frame. /// @arg {function} func /// @arg {array} func_args -function wait_and_execute(timer, func, func_args = []) { +function wait_and_execute(timer, func, func_args = [], exec_scope = undefined) { var _timer_obj = instance_create(0, 0, obj_timer); with(_timer_obj){ time_set = timer; end_function = func; end_function_args = func_args; + execution_scope = exec_scope; } } diff --git a/scripts/turn_towards_point/turn_towards_point.gml b/scripts/turn_towards_point/turn_towards_point.gml index b878add6d0..8e5af1ca11 100644 --- a/scripts/turn_towards_point/turn_towards_point.gml +++ b/scripts/turn_towards_point/turn_towards_point.gml @@ -1,15 +1,11 @@ -function turn_towards_point(argument0, argument1, argument2, argument3, argument4, argument5) { +function turn_towards_point(current_angle, x1, y1, x2, y2, turning_speed) { // turn_towards_point(currentAngle, x1, y1, x2, y2, speed); - var ca, x1, y1, x2, y2, sp, a; - ca = argument0 * pi/180; - x1 = argument1; - y1 = argument2; - x2 = argument3; - y2 = argument4; - sp = argument5 * pi/180; + var ca = degtorad(current_angle); - a = arctan2(y1-y2, x2-x1) - ca; + var sp = degtorad(turning_speed); + + var a = arctan2(y1-y2, x2-x1) - ca; while (a < -pi || a > pi) a += (pi*2) * -sign(a); @@ -23,3 +19,7 @@ function turn_towards_point(argument0, argument1, argument2, argument3, argument } + +function ship_turn_towards_point(target_x,target_y){ + direction = turn_towards_point(direction, x, y, target_x, target_y, turning_speed); +} diff --git a/sprites/spr_bionics_hand/spr_bionics_hand.yy b/sprites/spr_bionics_hand/spr_bionics_hand.yy index 13d8a91eff..3899c5be2b 100644 --- a/sprites/spr_bionics_hand/spr_bionics_hand.yy +++ b/sprites/spr_bionics_hand/spr_bionics_hand.yy @@ -66,6 +66,8 @@ "playbackSpeedType":0, "resourceType":"GMSequence", "resourceVersion":"2.0", + "seqHeight":232.0, + "seqWidth":167.0, "showBackdrop":true, "showBackdropImage":false, "timeUnits":1, diff --git a/sprites/spr_creation_other/71b3704f-7424-4cb3-852e-03a47b1f609c.png b/sprites/spr_creation_other/71b3704f-7424-4cb3-852e-03a47b1f609c.png new file mode 100644 index 0000000000..752ebfa9a2 Binary files /dev/null and b/sprites/spr_creation_other/71b3704f-7424-4cb3-852e-03a47b1f609c.png differ diff --git a/sprites/spr_creation_other/layers/71b3704f-7424-4cb3-852e-03a47b1f609c/d07f3659-6442-4004-bcfa-c2f9ad3619bf.png b/sprites/spr_creation_other/layers/71b3704f-7424-4cb3-852e-03a47b1f609c/d07f3659-6442-4004-bcfa-c2f9ad3619bf.png new file mode 100644 index 0000000000..752ebfa9a2 Binary files /dev/null and b/sprites/spr_creation_other/layers/71b3704f-7424-4cb3-852e-03a47b1f609c/d07f3659-6442-4004-bcfa-c2f9ad3619bf.png differ diff --git a/sprites/spr_creation_slate/5386c8da-edfc-46b5-84d6-8b7f0dc471d6.png b/sprites/spr_creation_slate/5386c8da-edfc-46b5-84d6-8b7f0dc471d6.png new file mode 100644 index 0000000000..752ebfa9a2 Binary files /dev/null and b/sprites/spr_creation_slate/5386c8da-edfc-46b5-84d6-8b7f0dc471d6.png differ diff --git a/sprites/spr_creation_slate/layers/5386c8da-edfc-46b5-84d6-8b7f0dc471d6/edca4948-39ec-4e5f-ab97-4d1d7c174675.png b/sprites/spr_creation_slate/layers/5386c8da-edfc-46b5-84d6-8b7f0dc471d6/edca4948-39ec-4e5f-ab97-4d1d7c174675.png new file mode 100644 index 0000000000..752ebfa9a2 Binary files /dev/null and b/sprites/spr_creation_slate/layers/5386c8da-edfc-46b5-84d6-8b7f0dc471d6/edca4948-39ec-4e5f-ab97-4d1d7c174675.png differ diff --git a/sprites/spr_explosion/spr_explosion.yy b/sprites/spr_explosion/spr_explosion.yy index df2e8e7255..ab1f1e9b0e 100644 --- a/sprites/spr_explosion/spr_explosion.yy +++ b/sprites/spr_explosion/spr_explosion.yy @@ -69,6 +69,8 @@ "playbackSpeedType":1, "resourceType":"GMSequence", "resourceVersion":"2.0", + "seqHeight":64.0, + "seqWidth":64.0, "showBackdrop":true, "showBackdropImage":false, "timeUnits":1, @@ -83,10 +85,7 @@ {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"dc87f3f2-ac65-4454-8e89-30f2d18e5b5a","path":"sprites/spr_explosion/spr_explosion.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"e3586009-fe9f-4ffd-ae6b-5306a1bbaa08","IsCreationKey":false,"Key":6.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, ],"resourceType":"KeyframeStore","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,}, ], - "visibleRange":{ - "x":0.0, - "y":0.0, - }, + "visibleRange":null, "volume":1.0, "xorigin":32, "yorigin":32, diff --git a/sprites/spr_explosion2/spr_explosion2.yy b/sprites/spr_explosion2/spr_explosion2.yy index a8272afb7c..8ab1632c74 100644 --- a/sprites/spr_explosion2/spr_explosion2.yy +++ b/sprites/spr_explosion2/spr_explosion2.yy @@ -76,6 +76,8 @@ "playbackSpeedType":1, "resourceType":"GMSequence", "resourceVersion":"2.0", + "seqHeight":64.0, + "seqWidth":64.0, "showBackdrop":true, "showBackdropImage":false, "timeUnits":1, @@ -97,10 +99,7 @@ {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"e45b252c-a2f1-4447-a61b-29b3c77e1f8b","path":"sprites/spr_explosion2/spr_explosion2.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"6a8df266-eb69-44d0-a7dc-ac3177820f19","IsCreationKey":false,"Key":13.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, ],"resourceType":"KeyframeStore","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,}, ], - "visibleRange":{ - "x":0.0, - "y":0.0, - }, + "visibleRange":null, "volume":1.0, "xorigin":32, "yorigin":32, diff --git a/sprites/spr_explosion3/spr_explosion3.yy b/sprites/spr_explosion3/spr_explosion3.yy index 01e7ba1419..66f94debbb 100644 --- a/sprites/spr_explosion3/spr_explosion3.yy +++ b/sprites/spr_explosion3/spr_explosion3.yy @@ -86,6 +86,8 @@ "playbackSpeedType":1, "resourceType":"GMSequence", "resourceVersion":"2.0", + "seqHeight":64.0, + "seqWidth":64.0, "showBackdrop":true, "showBackdropImage":false, "timeUnits":1, @@ -117,10 +119,7 @@ {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"4927e668-61af-4c28-9c28-857835e7f1c2","path":"sprites/spr_explosion3/spr_explosion3.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"b45e1ad1-5605-4f37-9ba1-0739e0a8a14c","IsCreationKey":false,"Key":23.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, ],"resourceType":"KeyframeStore","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,}, ], - "visibleRange":{ - "x":0.0, - "y":0.0, - }, + "visibleRange":null, "volume":1.0, "xorigin":32, "yorigin":32, diff --git a/sprites/spr_explosion_plas/spr_explosion_plas.yy b/sprites/spr_explosion_plas/spr_explosion_plas.yy index 746a35bfbe..d9a43d70c1 100644 --- a/sprites/spr_explosion_plas/spr_explosion_plas.yy +++ b/sprites/spr_explosion_plas/spr_explosion_plas.yy @@ -69,6 +69,8 @@ "playbackSpeedType":1, "resourceType":"GMSequence", "resourceVersion":"2.0", + "seqHeight":64.0, + "seqWidth":64.0, "showBackdrop":true, "showBackdropImage":false, "timeUnits":1, @@ -83,10 +85,7 @@ {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"9f249bfd-e297-460c-9f3e-42e085e4218e","path":"sprites/spr_explosion_plas/spr_explosion_plas.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"a319f899-f3d0-4b64-9869-6965563b4843","IsCreationKey":false,"Key":6.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, ],"resourceType":"KeyframeStore","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,}, ], - "visibleRange":{ - "x":0.0, - "y":0.0, - }, + "visibleRange":null, "volume":1.0, "xorigin":32, "yorigin":32, diff --git a/sprites/spr_fleet_imperial/spr_fleet_imperial.yy b/sprites/spr_fleet_imperial/spr_fleet_imperial.yy index bd2735723c..8de0f77ce1 100644 --- a/sprites/spr_fleet_imperial/spr_fleet_imperial.yy +++ b/sprites/spr_fleet_imperial/spr_fleet_imperial.yy @@ -77,22 +77,39 @@ "timeUnits":1, "tracks":[ {"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore":"","Keyframes":[ - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"7ed3ac9a-c1a3-4966-8c07-799101e9fca6","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"f2227933-b8bc-4bf6-9d8e-524410250dc7","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"cdb72c37-035a-45e6-9261-6bb7235b36d0","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"1746812c-c63b-415d-b459-f12dc9208349","IsCreationKey":false,"Key":1.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"b70d4f7d-d6e5-4417-a451-df64b6cc0dfc","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"edc14729-eece-4ed2-8dfc-a5f8c7dfe38b","IsCreationKey":false,"Key":2.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"7c517f52-18b0-4ce3-907a-266b27998f5e","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"da9e9585-4af5-4c8f-bf1e-b0865913f48c","IsCreationKey":false,"Key":3.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"7e369ca2-e39c-4f3a-95cf-1f7ece113915","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"e924ab6f-120a-498b-80ba-78f1ec0f34fe","IsCreationKey":false,"Key":4.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"83e2105e-06f4-433a-b155-899860422247","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"6e7f9699-c511-43fb-b4aa-f01b6cb66560","IsCreationKey":false,"Key":5.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"7b33f482-c952-4a96-ae8e-fc3c743bb25f","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"8cfe88df-f523-462d-bcf6-20f2367cf625","IsCreationKey":false,"Key":6.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"948a2eb0-29bf-4b0d-8710-2641375e304c","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"e41b6128-03e4-490c-be0e-4c177c1dcfaa","IsCreationKey":false,"Key":7.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"c527feba-1ebf-430b-bcce-57c3998dd2ba","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"38bd26a6-a925-4d86-8cc1-91d1fa137e25","IsCreationKey":false,"Key":8.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"3a21b19b-398c-43ca-98e1-b7cbeafd021a","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"212d7172-82b2-47e9-95c1-fb55d943413e","IsCreationKey":false,"Key":9.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"7ed3ac9a-c1a3-4966-8c07-799101e9fca6","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"f2227933-b8bc-4bf6-9d8e-524410250dc7","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"cdb72c37-035a-45e6-9261-6bb7235b36d0","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"1746812c-c63b-415d-b459-f12dc9208349","IsCreationKey":false,"Key":1.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"b70d4f7d-d6e5-4417-a451-df64b6cc0dfc","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"edc14729-eece-4ed2-8dfc-a5f8c7dfe38b","IsCreationKey":false,"Key":2.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"7c517f52-18b0-4ce3-907a-266b27998f5e","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"da9e9585-4af5-4c8f-bf1e-b0865913f48c","IsCreationKey":false,"Key":3.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"7e369ca2-e39c-4f3a-95cf-1f7ece113915","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"e924ab6f-120a-498b-80ba-78f1ec0f34fe","IsCreationKey":false,"Key":4.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"83e2105e-06f4-433a-b155-899860422247","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"6e7f9699-c511-43fb-b4aa-f01b6cb66560","IsCreationKey":false,"Key":5.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"7b33f482-c952-4a96-ae8e-fc3c743bb25f","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"8cfe88df-f523-462d-bcf6-20f2367cf625","IsCreationKey":false,"Key":6.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"948a2eb0-29bf-4b0d-8710-2641375e304c","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"e41b6128-03e4-490c-be0e-4c177c1dcfaa","IsCreationKey":false,"Key":7.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"c527feba-1ebf-430b-bcce-57c3998dd2ba","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"38bd26a6-a925-4d86-8cc1-91d1fa137e25","IsCreationKey":false,"Key":8.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"3a21b19b-398c-43ca-98e1-b7cbeafd021a","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"212d7172-82b2-47e9-95c1-fb55d943413e","IsCreationKey":false,"Key":9.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, ],"resourceType":"KeyframeStore","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,}, ], - "visibleRange":{ - "x":0.0, - "y":0.0, - }, + "visibleRange":null, "volume":1.0, "xorigin":11, "yorigin":11, diff --git a/sprites/spr_fleet_tau/spr_fleet_tau.yy b/sprites/spr_fleet_tau/spr_fleet_tau.yy index 3e3b10899a..ea24ba85e3 100644 --- a/sprites/spr_fleet_tau/spr_fleet_tau.yy +++ b/sprites/spr_fleet_tau/spr_fleet_tau.yy @@ -78,23 +78,42 @@ "timeUnits":1, "tracks":[ {"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore":"","Keyframes":[ - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"cdd4c365-a564-4c95-85ab-bda104c5d5e1","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"1641c7b0-ba32-46a1-bdef-7751da95e1c5","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"95d93dc5-c7db-4369-b68a-31026d5959fc","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"b1f176e9-a3cc-4a3b-94bf-ade7ddc106a3","IsCreationKey":false,"Key":1.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"617ee12d-133c-4e96-ba8d-93535804252d","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"1051b8c3-13b3-4b12-909d-886c3a09de27","IsCreationKey":false,"Key":2.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"06e6544f-caed-4f40-8705-c7108e508215","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"195aff74-b345-485c-8c41-640d808b3d87","IsCreationKey":false,"Key":3.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"3e69a52d-25e9-4c9b-89b5-80990b84fd94","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"a06bc4eb-65c2-4824-b12e-4b2594e8cdc6","IsCreationKey":false,"Key":4.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"1a9a662c-67fe-4cdf-bdbf-c87e0070a330","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"a5c0c0a4-63b3-43bc-8743-90cbd113bcb7","IsCreationKey":false,"Key":5.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"bb9a18cc-c332-4f49-86d2-1dd6b6a501ca","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"4c0c4440-a668-4464-9e1c-647382b2af86","IsCreationKey":false,"Key":6.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"a28eb7be-b330-4c6f-a971-0412e89f9546","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"21ad7732-67d7-4445-a580-dc99939fd767","IsCreationKey":false,"Key":7.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"6faa2ba4-5a83-4f02-8506-0aed83da2623","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"8c836550-2c0b-4ff6-bdf5-db3f343e1f8c","IsCreationKey":false,"Key":8.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"93464d16-aa98-4c7b-83a4-f5f56f3bf632","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"621a69a7-bcaa-4299-821f-7014d3b98d91","IsCreationKey":false,"Key":9.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"4f6782bd-e559-446b-9cfb-76c842cac2e6","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"ed6f8cbd-bba9-4119-b444-6aa8e37e6443","IsCreationKey":false,"Key":10.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"cdd4c365-a564-4c95-85ab-bda104c5d5e1","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"1641c7b0-ba32-46a1-bdef-7751da95e1c5","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"95d93dc5-c7db-4369-b68a-31026d5959fc","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"b1f176e9-a3cc-4a3b-94bf-ade7ddc106a3","IsCreationKey":false,"Key":1.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"617ee12d-133c-4e96-ba8d-93535804252d","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"1051b8c3-13b3-4b12-909d-886c3a09de27","IsCreationKey":false,"Key":2.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"06e6544f-caed-4f40-8705-c7108e508215","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"195aff74-b345-485c-8c41-640d808b3d87","IsCreationKey":false,"Key":3.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"3e69a52d-25e9-4c9b-89b5-80990b84fd94","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"a06bc4eb-65c2-4824-b12e-4b2594e8cdc6","IsCreationKey":false,"Key":4.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"1a9a662c-67fe-4cdf-bdbf-c87e0070a330","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"a5c0c0a4-63b3-43bc-8743-90cbd113bcb7","IsCreationKey":false,"Key":5.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"bb9a18cc-c332-4f49-86d2-1dd6b6a501ca","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"4c0c4440-a668-4464-9e1c-647382b2af86","IsCreationKey":false,"Key":6.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"a28eb7be-b330-4c6f-a971-0412e89f9546","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"21ad7732-67d7-4445-a580-dc99939fd767","IsCreationKey":false,"Key":7.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"6faa2ba4-5a83-4f02-8506-0aed83da2623","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"8c836550-2c0b-4ff6-bdf5-db3f343e1f8c","IsCreationKey":false,"Key":8.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"93464d16-aa98-4c7b-83a4-f5f56f3bf632","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"621a69a7-bcaa-4299-821f-7014d3b98d91","IsCreationKey":false,"Key":9.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"4f6782bd-e559-446b-9cfb-76c842cac2e6","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"ed6f8cbd-bba9-4119-b444-6aa8e37e6443","IsCreationKey":false,"Key":10.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, ],"resourceType":"KeyframeStore","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,}, ], - "visibleRange":{ - "x":0.0, - "y":0.0, - }, + "visibleRange":null, "volume":1.0, "xorigin":11, "yorigin":11, diff --git a/sprites/spr_psy_hood_complex/da4d2ca5-ded6-4a96-bef4-a1c048f10f67.png b/sprites/spr_psy_hood_complex/da4d2ca5-ded6-4a96-bef4-a1c048f10f67.png index f2fb69297c..3a6e90b473 100644 Binary files a/sprites/spr_psy_hood_complex/da4d2ca5-ded6-4a96-bef4-a1c048f10f67.png and b/sprites/spr_psy_hood_complex/da4d2ca5-ded6-4a96-bef4-a1c048f10f67.png differ diff --git a/sprites/spr_psy_hood_complex/layers/da4d2ca5-ded6-4a96-bef4-a1c048f10f67/0b5e7fba-d4a1-441e-a726-f45a72c56663.png b/sprites/spr_psy_hood_complex/layers/da4d2ca5-ded6-4a96-bef4-a1c048f10f67/0b5e7fba-d4a1-441e-a726-f45a72c56663.png index f2fb69297c..3a6e90b473 100644 Binary files a/sprites/spr_psy_hood_complex/layers/da4d2ca5-ded6-4a96-bef4-a1c048f10f67/0b5e7fba-d4a1-441e-a726-f45a72c56663.png and b/sprites/spr_psy_hood_complex/layers/da4d2ca5-ded6-4a96-bef4-a1c048f10f67/0b5e7fba-d4a1-441e-a726-f45a72c56663.png differ diff --git a/sprites/spr_ship_bb/spr_ship_bb.yy b/sprites/spr_ship_bb/spr_ship_bb.yy index 3d8709745b..63fe300fb8 100644 --- a/sprites/spr_ship_bb/spr_ship_bb.yy +++ b/sprites/spr_ship_bb/spr_ship_bb.yy @@ -23,7 +23,7 @@ ], "name":"spr_ship_bb", "nineSlice":null, - "origin":4, + "origin":9, "parent":{ "name":"Imperium", "path":"folders/Sprites/Ships/Imperium.yy", @@ -75,7 +75,7 @@ ], "visibleRange":null, "volume":1.0, - "xorigin":155, + "xorigin":182, "yorigin":56, }, "swatchColours":null, diff --git a/sprites/spr_ship_glad/be2b8b48-0ab2-4b69-b879-4af5e4ede8a4.png b/sprites/spr_ship_glad/be2b8b48-0ab2-4b69-b879-4af5e4ede8a4.png index 4a4431613a..474f1d3a15 100644 Binary files a/sprites/spr_ship_glad/be2b8b48-0ab2-4b69-b879-4af5e4ede8a4.png and b/sprites/spr_ship_glad/be2b8b48-0ab2-4b69-b879-4af5e4ede8a4.png differ diff --git a/sprites/spr_ship_glad/layers/be2b8b48-0ab2-4b69-b879-4af5e4ede8a4/0c5eee0d-3e20-4de4-893d-69756dc63a39.png b/sprites/spr_ship_glad/layers/be2b8b48-0ab2-4b69-b879-4af5e4ede8a4/0c5eee0d-3e20-4de4-893d-69756dc63a39.png index 4a4431613a..474f1d3a15 100644 Binary files a/sprites/spr_ship_glad/layers/be2b8b48-0ab2-4b69-b879-4af5e4ede8a4/0c5eee0d-3e20-4de4-893d-69756dc63a39.png and b/sprites/spr_ship_glad/layers/be2b8b48-0ab2-4b69-b879-4af5e4ede8a4/0c5eee0d-3e20-4de4-893d-69756dc63a39.png differ diff --git a/sprites/spr_ship_glad/spr_ship_glad.yy b/sprites/spr_ship_glad/spr_ship_glad.yy index 8f67c0bf03..276ee030e0 100644 --- a/sprites/spr_ship_glad/spr_ship_glad.yy +++ b/sprites/spr_ship_glad/spr_ship_glad.yy @@ -3,11 +3,11 @@ "%Name":"spr_ship_glad", "bboxMode":0, "bbox_bottom":29, - "bbox_left":1, + "bbox_left":2, "bbox_right":77, "bbox_top":1, - "collisionKind":1, - "collisionTolerance":0, + "collisionKind":2, + "collisionTolerance":140, "DynamicTexturePage":false, "edgeFiltering":false, "For3D":false, @@ -70,7 +70,9 @@ "timeUnits":1, "tracks":[ {"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore":"","Keyframes":[ - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"be2b8b48-0ab2-4b69-b879-4af5e4ede8a4","path":"sprites/spr_ship_glad/spr_ship_glad.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"dc542ebd-2f6e-43f1-b053-8b4014539608","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"be2b8b48-0ab2-4b69-b879-4af5e4ede8a4","path":"sprites/spr_ship_glad/spr_ship_glad.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"dc542ebd-2f6e-43f1-b053-8b4014539608","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, ],"resourceType":"KeyframeStore","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,}, ], "visibleRange":null, diff --git a/sprites/spr_ship_shields/a9f7a1f3-c0fb-4f8b-b270-14a3cb990890.png b/sprites/spr_ship_shields/a9f7a1f3-c0fb-4f8b-b270-14a3cb990890.png new file mode 100644 index 0000000000..7e5ad3594b Binary files /dev/null and b/sprites/spr_ship_shields/a9f7a1f3-c0fb-4f8b-b270-14a3cb990890.png differ diff --git a/sprites/spr_ship_shields/layers/a9f7a1f3-c0fb-4f8b-b270-14a3cb990890/7e9c9e28-a54e-4389-8a37-9735f9adc44f.png b/sprites/spr_ship_shields/layers/a9f7a1f3-c0fb-4f8b-b270-14a3cb990890/7e9c9e28-a54e-4389-8a37-9735f9adc44f.png new file mode 100644 index 0000000000..7e5ad3594b Binary files /dev/null and b/sprites/spr_ship_shields/layers/a9f7a1f3-c0fb-4f8b-b270-14a3cb990890/7e9c9e28-a54e-4389-8a37-9735f9adc44f.png differ diff --git a/sprites/spr_ship_shields/spr_ship_shields.yy b/sprites/spr_ship_shields/spr_ship_shields.yy new file mode 100644 index 0000000000..6939078681 --- /dev/null +++ b/sprites/spr_ship_shields/spr_ship_shields.yy @@ -0,0 +1,90 @@ +{ + "$GMSprite":"v2", + "%Name":"spr_ship_shields", + "bboxMode":0, + "bbox_bottom":50, + "bbox_left":0, + "bbox_right":130, + "bbox_top":0, + "collisionKind":4, + "collisionTolerance":0, + "DynamicTexturePage":false, + "edgeFiltering":false, + "For3D":false, + "frames":[ + {"$GMSpriteFrame":"v1","%Name":"a9f7a1f3-c0fb-4f8b-b270-14a3cb990890","name":"a9f7a1f3-c0fb-4f8b-b270-14a3cb990890","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, + ], + "gridX":0, + "gridY":0, + "height":51, + "HTile":false, + "layers":[ + {"$GMImageLayer":"","%Name":"7e9c9e28-a54e-4389-8a37-9735f9adc44f","blendMode":0,"displayName":"default","isLocked":false,"name":"7e9c9e28-a54e-4389-8a37-9735f9adc44f","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,}, + ], + "name":"spr_ship_shields", + "nineSlice":null, + "origin":4, + "parent":{ + "name":"Imperium", + "path":"folders/Sprites/Ships/Imperium.yy", + }, + "preMultiplyAlpha":false, + "resourceType":"GMSprite", + "resourceVersion":"2.0", + "sequence":{ + "$GMSequence":"v1", + "%Name":"spr_ship_shields", + "autoRecord":true, + "backdropHeight":1080, + "backdropImageOpacity":0.5, + "backdropImagePath":"", + "backdropWidth":1920, + "backdropXOffset":0.0, + "backdropYOffset":0.0, + "events":{ + "$KeyframeStore":"", + "Keyframes":[], + "resourceType":"KeyframeStore", + "resourceVersion":"2.0", + }, + "eventStubScript":null, + "eventToFunction":{}, + "length":1.0, + "lockOrigin":false, + "moments":{ + "$KeyframeStore":"", + "Keyframes":[], + "resourceType":"KeyframeStore", + "resourceVersion":"2.0", + }, + "name":"spr_ship_shields", + "playback":1, + "playbackSpeed":1.0, + "playbackSpeedType":1, + "resourceType":"GMSequence", + "resourceVersion":"2.0", + "seqHeight":51.0, + "seqWidth":131.0, + "showBackdrop":true, + "showBackdropImage":false, + "timeUnits":1, + "tracks":[ + {"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore":"","Keyframes":[ + {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"a9f7a1f3-c0fb-4f8b-b270-14a3cb990890","path":"sprites/spr_ship_shields/spr_ship_shields.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"43a254cb-346b-4949-bbdc-8440067748f4","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + ],"resourceType":"KeyframeStore","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,}, + ], + "visibleRange":null, + "volume":1.0, + "xorigin":65, + "yorigin":25, + }, + "swatchColours":null, + "swfPrecision":2.525, + "textureGroupId":{ + "name":"NavalCombat", + "path":"texturegroups/NavalCombat", + }, + "type":0, + "VTile":false, + "width":131, +} \ No newline at end of file diff --git a/sprites/spr_ship_song/spr_ship_song.yy b/sprites/spr_ship_song/spr_ship_song.yy index 3b0b109fbd..780e27ec22 100644 --- a/sprites/spr_ship_song/spr_ship_song.yy +++ b/sprites/spr_ship_song/spr_ship_song.yy @@ -6,7 +6,7 @@ "bbox_left":2, "bbox_right":345, "bbox_top":4, - "collisionKind":1, + "collisionKind":0, "collisionTolerance":0, "DynamicTexturePage":false, "edgeFiltering":false, @@ -70,7 +70,9 @@ "timeUnits":1, "tracks":[ {"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore":"","Keyframes":[ - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"7f882f8a-eb3f-4429-b7ee-96426a62cfce","path":"sprites/spr_ship_song/spr_ship_song.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"0c049868-56f8-4a4a-b66e-0a379b5bd341","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"7f882f8a-eb3f-4429-b7ee-96426a62cfce","path":"sprites/spr_ship_song/spr_ship_song.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"0c049868-56f8-4a4a-b66e-0a379b5bd341","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, ],"resourceType":"KeyframeStore","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,}, ], "visibleRange":null, diff --git a/sprites/spr_ship_stri/a9f7a1f3-c0fb-4f8b-b270-14a3cb990890.png b/sprites/spr_ship_stri/a9f7a1f3-c0fb-4f8b-b270-14a3cb990890.png index f7c8e431c0..69eade3752 100644 Binary files a/sprites/spr_ship_stri/a9f7a1f3-c0fb-4f8b-b270-14a3cb990890.png and b/sprites/spr_ship_stri/a9f7a1f3-c0fb-4f8b-b270-14a3cb990890.png differ diff --git a/sprites/spr_ship_stri/layers/a9f7a1f3-c0fb-4f8b-b270-14a3cb990890/7e9c9e28-a54e-4389-8a37-9735f9adc44f.png b/sprites/spr_ship_stri/layers/a9f7a1f3-c0fb-4f8b-b270-14a3cb990890/7e9c9e28-a54e-4389-8a37-9735f9adc44f.png index f7c8e431c0..69eade3752 100644 Binary files a/sprites/spr_ship_stri/layers/a9f7a1f3-c0fb-4f8b-b270-14a3cb990890/7e9c9e28-a54e-4389-8a37-9735f9adc44f.png and b/sprites/spr_ship_stri/layers/a9f7a1f3-c0fb-4f8b-b270-14a3cb990890/7e9c9e28-a54e-4389-8a37-9735f9adc44f.png differ diff --git a/sprites/spr_weapon_powmace/spr_weapon_powmace.yy b/sprites/spr_weapon_powmace/spr_weapon_powmace.yy index 72f95d9407..ee158ba307 100644 --- a/sprites/spr_weapon_powmace/spr_weapon_powmace.yy +++ b/sprites/spr_weapon_powmace/spr_weapon_powmace.yy @@ -63,6 +63,8 @@ "playbackSpeedType":1, "resourceType":"GMSequence", "resourceVersion":"2.0", + "seqHeight":262.0, + "seqWidth":181.0, "showBackdrop":true, "showBackdropImage":false, "timeUnits":1,