From 950e05b56f761745a1cefa20eb8553b844dfb943 Mon Sep 17 00:00:00 2001 From: Nelsonh Date: Sat, 21 Dec 2024 19:43:54 +0000 Subject: [PATCH 1/5] in depth gene seed --- ChapterMaster.yyp | 1 + objects/obj_controller/Create_0.gml | 1 + objects/obj_creation/Draw_0.gml | 3 + scripts/scr_apothecarium/scr_apothecarium.gml | 41 +++- .../scr_gene_obj_creation.gml | 199 ++++++++++++++++++ .../scr_gene_obj_creation.yy | 11 + scripts/scr_kill_unit/scr_kill_unit.gml | 1 + .../scr_marine_struct/scr_marine_struct.gml | 25 +-- 8 files changed, 261 insertions(+), 21 deletions(-) create mode 100644 scripts/scr_gene_obj_creation/scr_gene_obj_creation.gml create mode 100644 scripts/scr_gene_obj_creation/scr_gene_obj_creation.yy diff --git a/ChapterMaster.yyp b/ChapterMaster.yyp index 02a8506ad2..c7a42c24b4 100644 --- a/ChapterMaster.yyp +++ b/ChapterMaster.yyp @@ -795,6 +795,7 @@ {"id":{"name":"spr_explosion2","path":"sprites/spr_explosion2/spr_explosion2.yy",},}, {"id":{"name":"spr_explosion3","path":"sprites/spr_explosion3/spr_explosion3.yy",},}, {"id":{"name":"spr_battle_block","path":"sprites/spr_battle_block/spr_battle_block.yy",},}, + {"id":{"name":"scr_gene_obj_creation","path":"scripts/scr_gene_obj_creation/scr_gene_obj_creation.yy",},}, {"id":{"name":"spr_battle_block2","path":"sprites/spr_battle_block2/spr_battle_block2.yy",},}, {"id":{"name":"spr_weapon_storm2","path":"sprites/spr_weapon_storm2/spr_weapon_storm2.yy",},}, {"id":{"name":"spr_rg_mk7_helm","path":"sprites/spr_rg_mk7_helm/spr_rg_mk7_helm.yy",},}, diff --git a/objects/obj_controller/Create_0.gml b/objects/obj_controller/Create_0.gml index 5462e28984..1fdf584306 100644 --- a/objects/obj_controller/Create_0.gml +++ b/objects/obj_controller/Create_0.gml @@ -1434,6 +1434,7 @@ if (global.custom=1){ loyalty=100; loyalty_hidden=100;// Updated when inquisitors do an inspection // ** Sets up gene seed ** +gene_stock = new GeneStock(); gene_seed=20; if (scr_has_disadv("Sieged")) then gene_seed = floor(random_range(250, 400)); if scr_has_disadv("Obliterated") then gene_seed=floor(random_range(50,200)); diff --git a/objects/obj_creation/Draw_0.gml b/objects/obj_creation/Draw_0.gml index a77962d748..61398c9d86 100644 --- a/objects/obj_creation/Draw_0.gml +++ b/objects/obj_creation/Draw_0.gml @@ -962,6 +962,9 @@ try { } } +if (slide=5){ + scr_gene_obj_creation(); +} var x1, x2, x3, x4, x6, y1, y2, y3, y4, y6, bs, see_size, total_max, current, top; x1 = 1111; diff --git a/scripts/scr_apothecarium/scr_apothecarium.gml b/scripts/scr_apothecarium/scr_apothecarium.gml index ce74f0fa3c..b0e8a28da1 100644 --- a/scripts/scr_apothecarium/scr_apothecarium.gml +++ b/scripts/scr_apothecarium/scr_apothecarium.gml @@ -1,6 +1,33 @@ // Script assets have changed for v2.3.0 see // https://help.yoyogames.com/hc/en-us/articles/360005277377 for more information +#macro ARR_gene_Seed_mutations ["preomnor", "lyman", "omophagea", "ossmodula", "zygote", "betchers", "catalepsean", "occulobe","mucranoid", "membrane", "voice"]; + + +function create_gene_seed = function(){ + gene_seed_mutations = { + "preomnor":obj_ini.preomnor, + "lyman":obj_ini.lyman, + "omophagea":obj_ini.omophagea, + "ossmodula":obj_ini.ossmodula, + "zygote":obj_ini.zygote, + "betchers":obj_ini.betchers, + "catalepsean":obj_ini.catalepsean, + "occulobe":obj_ini.occulobe, + "mucranoid":obj_ini.mucranoid, + "membrane":obj_ini.membrane, + "voice":obj_ini.voice, + }; + var mutation_names = ARR_gene_Seed_mutations; + for (var mute = 0; mute 0) and (obj_ini.zygote==0) { var _added = false; @@ -34,7 +73,7 @@ function add_new_gene_slave(){ } if (!_added){ array_push(obj_ini.gene_slaves, { - num : 1, + num : [], eta : 120, harvested_once : false, turn : obj_controller.turn, diff --git a/scripts/scr_gene_obj_creation/scr_gene_obj_creation.gml b/scripts/scr_gene_obj_creation/scr_gene_obj_creation.gml new file mode 100644 index 0000000000..f74c2831a1 --- /dev/null +++ b/scripts/scr_gene_obj_creation/scr_gene_obj_creation.gml @@ -0,0 +1,199 @@ +// Script assets have changed for v2.3.0 see +// https://help.yoyogames.com/hc/en-us/articles/360005277377 for more information +function scr_gene_obj_creation(){ + draw_set_color(38144); + draw_set_font(fnt_40k_30b); + draw_set_halign(fa_center); + draw_set_alpha(1); + + tooltip=""; + tooltip2=""; + obj_cursor.image_index=0; + + draw_text(800,80,chapter_name); + + + draw_set_color(38144); + draw_set_halign(fa_left); + draw_text_transformed(580,118,$"Successor Chapters: {successors}",0.6,0.6,0); + draw_set_font(fnt_40k_14b); + + draw_rectangle(445, 200, 1125, 202, true); + + draw_set_font(fnt_40k_30b); + draw_text_transformed(503,210,string_hash_to_newline("Gene-Seed Mutations"),0.6,0.6,0); + if (mutations>mutations_selected) then draw_text_transformed(585,230,$"Select {mutations-mutations_selected} More",0.5,0.5,0); + + var x1,y1,spac=34; + + if (custom<2) then draw_set_alpha(0.5); + var mutations_defects = [ + { + t_tip :"Anemic Preomnor", + t_tip2: "Your Astartes lack the detoxifying gland called the Preomnor- they are more susceptible to poisons and toxins.", + data : preomnor, + mutation_points : 1, + }, + { + t_tip :"Disturbing Voice", + t_tip2: "Your Astartes have a voice like a creaking door or a rumble. Decreases Imperium and Imperial Guard disposition.", + data : voice, + mutation_points : 1, + disposition:[[eFACTION.Imperium,-8]], + }, + { + t_tip :"Doomed", + t_tip2: "Your Chapter cannot make more Astartes until enough research is generated. Counts as four mutations.", + data : doomed, + mutation_points : 4, + disposition:[[eFACTION.Imperium,-8],[6,8]], + }, + { + t_tip :"Faulty Lyman's Ear", + t_tip2: "Lacking a working Lyman's ear, all deep-striked Astartes recieve moderate penalties to both attack and defense.", + data : lyman, + mutation_points : 1, + }, + { + t_tip :"Hyper-Stimulated Omophagea", + t_tip2: "After every battle the Astartes have a chance to feast upon their fallen enemies, or seldom, their allies.", + data : omophagea, + mutation_points : 1, + }, + { + t_tip :"Hyperactive Ossmodula", + t_tip2: "Instead of wound tissue bone is generated; Apothecaries must spend twice the normal time healing your Astartes.", + data : ossmodula, + mutation_points : 1, + }, + { + t_tip :"Lost Zygote", + t_tip2: "One of the Zygotes is faulty or missing. The Astartes only have one each and generate half the normal Gene-Seed.", + data : zygote, + mutation_points : 2, + }, + { + t_tip :"Inactive Sus-an Membrane", + t_tip2: "Your Astartes do not have a Sus-an Membrane; they cannot enter suspended animation and recieve more casualties as a result.", + data : membrane, + mutation_points : 1, + }, + { + t_tip :"Missing Betchers Gland", + t_tip2: "Your Astartes cannot spit acid, and as a result, have slightly less attack in melee combat.", + data : betchers, + mutation_points : 1, + }, + { + t_tip :"Mutated Catalepsean Node", + t_tip2: "Your Astartes have reduced awareness when tired. Slightly less attack in ranged and melee combat.", + data : catalepsean, + mutation_points : 1, + }, + { + t_tip :"Oolitic Secretions", + t_tip2: "Either by secretions or radiation, your Astartes have an unusual or strange skin color. Decreases disposition.", + data : secretions, + mutation_points : 1, + disposition:[[eFACTION.Imperium,-8]], + }, + { + t_tip :"Oversensitive Occulobe", + t_tip2: "Your Astartes are no longer immune to stun grenades, bright lights, and have a massive penalty during morning battles.", + data : occulobe, + mutation_points : 1, + disposition:[[eFACTION.Imperium,-8]], + }, + { + t_tip :"Rampant Mucranoid", + t_tip2: "Your Astartes' Mucranoid cannot be turned off; the slime lowers most dispositions and occasionally damages their armour.", + data : mucranoid, + mutation_points : 1, + disposition:[[1,-4],[eFACTION.Imperium,-8],[3,-4],[4,-4],[5,-4],[6,-4]], + }, + ] + x1=450; + y1=260; + for (var i=0;imutations_selected){ + mutation_data.data=1; + mutations_selected+=mutation_data.mutation_points; + if (struct_exists(mutation_data, "disposition")){ + for (var s=0;s0) then draw_rectangle(655,552,655+(disposition[2]*4.95),567,0); + if (disposition[3]>0) then draw_rectangle(655,552+25,655+(disposition[3]*4.95),567+25,0); + if (disposition[5]>0) then draw_rectangle(655,552+50,655+(disposition[5]*4.95),567+50,0); + if (disposition[4]>0) then draw_rectangle(655,552+75,655+(disposition[4]*4.95),567+75,0); + if (disposition[1]>0) and (founding!=0) then draw_rectangle(655,552+100,655+(disposition[1]*4.95),567+100,0); + if (disposition[6]>0) then draw_rectangle(655,552+125,655+(disposition[6]*4.95),567+125,0); + +} \ No newline at end of file diff --git a/scripts/scr_gene_obj_creation/scr_gene_obj_creation.yy b/scripts/scr_gene_obj_creation/scr_gene_obj_creation.yy new file mode 100644 index 0000000000..c342253365 --- /dev/null +++ b/scripts/scr_gene_obj_creation/scr_gene_obj_creation.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "scr_gene_obj_creation", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "Scripts", + "path": "folders/Scripts.yy", + }, +} \ No newline at end of file diff --git a/scripts/scr_kill_unit/scr_kill_unit.gml b/scripts/scr_kill_unit/scr_kill_unit.gml index 45fcd0ec04..f838c79d30 100644 --- a/scripts/scr_kill_unit/scr_kill_unit.gml +++ b/scripts/scr_kill_unit/scr_kill_unit.gml @@ -48,6 +48,7 @@ function kill_and_recover(company, unit_slot, equipment=true, gene_seed_collect= unit.alter_equipment(strip,false, true); } if (gene_seed_collect && unit.base_group=="astartes"){ + //TODO get rid of string methods if (unit.age() > 30 && !obj_ini.zygote && !obj_ini.doomed) then obj_controller.gene_seed+=1; if (unit.age() > 50 && !obj_ini.doomed) then obj_controller.gene_seed+=1; } diff --git a/scripts/scr_marine_struct/scr_marine_struct.gml b/scripts/scr_marine_struct/scr_marine_struct.gml index 725b730188..f1002cb64f 100644 --- a/scripts/scr_marine_struct/scr_marine_struct.gml +++ b/scripts/scr_marine_struct/scr_marine_struct.gml @@ -811,27 +811,12 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data={}) if (faction ="chapter"){ allegiance = global.chapter_name; } - gene_seed_mutations = { - "preomnor":obj_ini.preomnor, - "lyman":obj_ini.lyman, - "omophagea":obj_ini.omophagea, - "ossmodula":obj_ini.ossmodula, - "zygote":obj_ini.zygote, - "betchers":obj_ini.betchers, - "catalepsean":obj_ini.catalepsean, - "occulobe":obj_ini.occulobe, - "mucranoid":obj_ini.mucranoid, - "membrane":obj_ini.membrane, - "voice":obj_ini.voice, - }; - var mutation_names = struct_get_names(gene_seed_mutations) - for (var mute =0; mute Date: Thu, 26 Dec 2024 17:51:16 +0000 Subject: [PATCH 2/5] swap out for method --- objects/obj_controller/Alarm_5.gml | 69 +----------- objects/obj_controller/Step_0.gml | 14 ++- objects/obj_ncombat/Alarm_5.gml | 11 +- objects/obj_p_assra/Alarm_0.gml | 2 +- objects/obj_p_ship/Alarm_3.gml | 4 +- scripts/scr_PlanetData/scr_PlanetData.gml | 2 +- .../scr_ancient_ruins/scr_ancient_ruins.gml | 2 +- scripts/scr_apothecarium/scr_apothecarium.gml | 101 +++++++++++++++--- .../scr_apothecary_ground.gml | 2 +- scripts/scr_cheatcode/scr_cheatcode.gml | 20 +++- scripts/scr_crusade/scr_crusade.gml | 2 +- .../scr_gene_obj_creation.gml | 2 +- .../scr_inquisition_fleet_functions.gml | 8 +- scripts/scr_kill_unit/scr_kill_unit.gml | 4 +- .../scr_load_controller.gml | 2 +- scripts/scr_recruit_data/scr_recruit_data.gml | 6 +- .../scr_save_controller.gml | 2 +- .../scr_specialist_point_handler.gml | 2 +- scripts/scr_ui_advisors/scr_ui_advisors.gml | 2 +- 19 files changed, 146 insertions(+), 111 deletions(-) diff --git a/objects/obj_controller/Alarm_5.gml b/objects/obj_controller/Alarm_5.gml index d87490d6b4..527689a49b 100644 --- a/objects/obj_controller/Alarm_5.gml +++ b/objects/obj_controller/Alarm_5.gml @@ -591,73 +591,8 @@ imperial_navy_fleet_construction(); // ** Adeptus Mechanicus Geneseed Tithe ** if (gene_tithe==0) and (faction_status[eFACTION.Imperium]!="War"){ gene_tithe=24; - - var expected,txt="",mech_mad=false; - var onceh=0; - expected=max(1,round(obj_controller.gene_seed/20)); - if (obj_controller.faction_status[eFACTION.Mechanicus]=="War") then mech_mad=true; - - if (obj_controller.gene_seed<=0) or (mech_mad==true){ - onceh=2; - gene_iou+=1; - loyalty-=2; - loyalty_hidden-=2; - txt="No Gene-Seed for Adeptus Mechanicus tithe. High Lords of Terra IOU increased to "+string(gene_iou)+"."; - } - if (mech_mad==false){ - if (obj_controller.gene_seed>0) and (und_gene_vaults==0) and (onceh==0){ - obj_controller.gene_seed-=expected; - onceh=1; - if (obj_controller.gene_seed>=gene_iou) and (gene_iou>0){ - expected+=gene_iou; - obj_controller.gene_seed-=gene_iou; - gene_iou=0; - onceh=3; - } - for(var i=0; i<50; i++){ - if (obj_controller.gene_seed0) and (gene_iou>0){ - expected+=1; - obj_controller.gene_seed-=1; - gene_iou-=1; - if (gene_iou==0) then onceh=3; - } - } - - if (gene_iou<0) then gene_iou=0; - - txt=string(expected)+" Gene-Seed sent to Adeptus Mechanicus for tithe."; - if (gene_iou>0) then txt+=" IOU remains at "+string(gene_iou)+"."; - if (onceh==3) then txt+=" IOU has been payed off."; - } - - if (obj_controller.gene_seed>0) and (und_gene_vaults>0) and (onceh==0){ - expected=1; - obj_controller.gene_seed-=expected; - onceh=1; - - if (obj_controller.gene_seed0) and (gene_iou>0){ - expected+=1; - obj_controller.gene_seed-=1; - gene_iou-=1; - if (gene_iou==0) then onceh=3; - } - - if (gene_iou<0) then gene_iou=0; - - txt=string(expected)+" Gene-Seed sent to Adeptus Mechanicus for tithe."; - if (gene_iou>0) then txt+=" IOU remains at "+string(gene_iou)+"."; - if (onceh==3) then txt+=" IOU has been payed off."; - } - - if (onceh!=2){ - scr_alert("green","tithes",txt,0,0); - scr_event_log("",txt); - } - if (onceh==2){ - scr_alert("red","tithes",txt,0,0); - scr_event_log("red",txt); - } - } + gene_stock.mechanicus_tithes(); + } if (gene_sold>0){ disc=0; diff --git a/objects/obj_controller/Step_0.gml b/objects/obj_controller/Step_0.gml index c33d8f3000..6ab849bd60 100644 --- a/objects/obj_controller/Step_0.gml +++ b/objects/obj_controller/Step_0.gml @@ -75,12 +75,20 @@ else if (cheatcode == "req" && global.cheat_req == 1){ } if (cheatcode == "seed" && global.cheat_gene == 0){ global.cheat_gene = 1; - obj_controller.tempGene_seed = obj_controller.gene_seed; - obj_controller.gene_seed = 9999; + obj_controller.tempGene_seed = gene_seed_count(); + with(obj_controller.gene_stock){ + repeat(9999){ + new_gene_seed(); + } + } } else if (cheatcode == "seed" && global.cheat_gene == 1){ global.cheat_gene = 0; - obj_controller.gene_seed = obj_controller.tempGene_seed; + with(obj_controller.gene_stock){ + repeat(obj_controller.tempGene_seed){ + new_gene_seed(); + } + } } if (cheatcode == "dep"){ global.cheat_disp = 1; diff --git a/objects/obj_ncombat/Alarm_5.gml b/objects/obj_ncombat/Alarm_5.gml index 296ab80c29..55333a1d9a 100644 --- a/objects/obj_ncombat/Alarm_5.gml +++ b/objects/obj_ncombat/Alarm_5.gml @@ -52,7 +52,7 @@ if (ground_mission){ seed_saved=(min(seed_max,apothecaries_alive*40))-gene_penalty; if (obj_ini.doomed) then seed_saved=0; -if (seed_saved>0) then obj_controller.gene_seed+=seed_saved; +if (seed_saved>0) then gene_seed_count()+=seed_saved; if (obj_ini.doomed && !apothecaries_alive){ part3=$"Chapter Mutation prevents retrieving Gene-Seed. {seed_max} Gene-Seed lost."; @@ -83,7 +83,8 @@ if (red_thirst>2){ newline=voodoo;newline_color="red"; scr_newtext(); - newline=" ";scr_newtext(); + newline=" "; + scr_newtext(); } @@ -723,8 +724,8 @@ if (obj_ini.fleet_type != ePlayerBase.home_world) and (defeat==1) and (dropping= battle_object.p_feature[obj_ncombat.battle_id][monastery_list[mon]].status="destroyed"; } - if (obj_controller.und_gene_vaults=0) then newline="Your Fortress Monastery has been raided. "+string(obj_controller.gene_seed)+" Gene-Seed has been destroyed or stolen."; - if (obj_controller.und_gene_vaults>0) then newline="Your Fortress Monastery has been raided. "+string(floor(obj_controller.gene_seed/10))+" Gene-Seed has been destroyed or stolen."; + if (obj_controller.und_gene_vaults=0) then newline="Your Fortress Monastery has been raided. "+string(gene_seed_count())+" Gene-Seed has been destroyed or stolen."; + if (obj_controller.und_gene_vaults>0) then newline="Your Fortress Monastery has been raided. "+string(floor(gene_seed_count()/10))+" Gene-Seed has been destroyed or stolen."; scr_event_log("red",newline, battle_object.name); instance_activate_object(obj_event_log); @@ -778,7 +779,7 @@ if (obj_ini.fleet_type != ePlayerBase.home_world) and (defeat==1) and (dropping= //all Gene Pod Incubators and gene seed are lost destroy_all_gene_slaves(false); } - if (obj_controller.und_gene_vaults>0) then obj_controller.gene_seed-=floor(obj_controller.gene_seed/10); + if (obj_controller.und_gene_vaults>0) then gene_seed_count()-=floor(gene_seed_count()/10); } } instance_deactivate_object(obj_star); diff --git a/objects/obj_p_assra/Alarm_0.gml b/objects/obj_p_assra/Alarm_0.gml index 409ca90485..14ce6985d3 100644 --- a/objects/obj_p_assra/Alarm_0.gml +++ b/objects/obj_p_assra/Alarm_0.gml @@ -31,7 +31,7 @@ for (o=0;o0) then obj_controller.gene_seed+=seed_max; + if (obj_fleet.capital+obj_fleet.frigate+obj_fleet.escort>0) then gene_seed_count()+=seed_max; }else if (apothecary>0){ unit.add_or_sub_health(irandom_range(9,14)); apothecary-=0.5; diff --git a/objects/obj_p_ship/Alarm_3.gml b/objects/obj_p_ship/Alarm_3.gml index eeee677d2f..3b337a48b8 100644 --- a/objects/obj_p_ship/Alarm_3.gml +++ b/objects/obj_p_ship/Alarm_3.gml @@ -8,11 +8,11 @@ if (hp0){ - obj_controller.gene_seed-=floor(obj_controller.gene_seed/10); + gene_seed_count()-=floor(gene_seed_count()/10); } } diff --git a/scripts/scr_PlanetData/scr_PlanetData.gml b/scripts/scr_PlanetData/scr_PlanetData.gml index a0b1aaa150..7c2b248e2d 100644 --- a/scripts/scr_PlanetData/scr_PlanetData.gml +++ b/scripts/scr_PlanetData/scr_PlanetData.gml @@ -100,7 +100,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 (obj_controller.gene_seed == 0) and (obj_controller.recruiting > 0) { + if (gene_seed_count() == 0) and (obj_controller.recruiting > 0) { obj_controller.recruiting = 0; obj_controller.income_recruiting = 0; diff --git a/scripts/scr_ancient_ruins/scr_ancient_ruins.gml b/scripts/scr_ancient_ruins/scr_ancient_ruins.gml index dfacde5429..33ea82499e 100644 --- a/scripts/scr_ancient_ruins/scr_ancient_ruins.gml +++ b/scripts/scr_ancient_ruins/scr_ancient_ruins.gml @@ -103,7 +103,7 @@ function scr_ruins_recover_from_dead(){ } if (recoverable_gene_seed>0){ pop.text += $" The strike team returns with remains, apothecaries report the gene-seed was able to be saved;{recoverable_gene_seed} gene-seed is harvested from the chapter’s fallen. At least their genetic legacy will continue, we will recover from this." - obj_controller.gene_seed+=recoverable_gene_seed; + gene_seed_count()+=recoverable_gene_seed; } else{ pop.text += $"The strike team returns with remains, but apothecaries report the gene-seed is too contaminated to use; no gene-seed is harvested from the chapter’s fallen. Their legacy lives on through their armaments, we will hold onto their memory." } diff --git a/scripts/scr_apothecarium/scr_apothecarium.gml b/scripts/scr_apothecarium/scr_apothecarium.gml index b0e8a28da1..c346487875 100644 --- a/scripts/scr_apothecarium/scr_apothecarium.gml +++ b/scripts/scr_apothecarium/scr_apothecarium.gml @@ -31,7 +31,7 @@ function create_gene_seed = function(){ function scr_destroy_gene_slave_batch(batch_id, recover_gene=true){ var _cur_slave = obj_ini.gene_slaves[batch_id]; if (revover_gene){ - obj_controller.gene_seed+=_cur_slave.num; + gene_seed_count()+=_cur_slave.num; scr_add_item("Gene Pod Incubator", _cur_slave.num); } delete _cur_slave; @@ -40,12 +40,12 @@ function scr_destroy_gene_slave_batch(batch_id, recover_gene=true){ function destroy_all_gene_slaves(recover_gene=true){ var _slave_length = array_length(obj_ini.gene_slaves); - if (_slave_length>0){ - for (var i=_slave_length-1; i>=0; i--){ - scr_destroy_gene_slave_batch(i,recover_gene); - } - obj_ini.gene_slaves = []; - } + if (_slave_length>0){ + for (var i=_slave_length-1; i>=0; i--){ + scr_destroy_gene_slave_batch(i,recover_gene); + } + obj_ini.gene_slaves = []; + } } function GeneStock() constructor(chapter_mutations){ @@ -58,6 +58,83 @@ function GeneStock() constructor(chapter_mutations){ } array_push(gene_seed, seed_data); } + static remove_gene_seed = function(){ + var _remove = array_random_index(gene_seed); + var _seed = gene_seed[_remove]; + array_delete(gene_seed, _remove, 1); + return _seed; + } + static mechanicus_tithes = function(){ + var expected,txt=""; + var onceh=0; + expected=max(1,round(gene_seed_count()/20)); + + var mech_mad = obj_controller.faction_status[eFACTION.Mechanicus]=="War"; + + if (!gene_seed_count()) or (mech_mad){ + onceh=2; + gene_iou+=1; + loyalty-=2; + loyalty_hidden-=2; + txt="No Gene-Seed for Adeptus Mechanicus tithe. High Lords of Terra IOU increased to "+string(gene_iou)+"."; + } + + if (!mech_mad){ + if (gene_seed_count()) and (und_gene_vaults==0) and (onceh==0){ + gene_seed_count()-=expected; + onceh=1; + if (gene_seed_count()>=gene_iou) and (gene_iou>0){ + expected+=gene_iou; + gene_seed_count()-=gene_iou; + gene_iou=0; + onceh=3; + } + for(var i=0; i<50; i++){ + if (gene_seed_count()0) and (gene_iou>0){ + expected+=1; + gene_seed_count()-=1; + gene_iou-=1; + if (gene_iou==0) then onceh=3; + } + } + + if (gene_iou<0) then gene_iou=0; + + txt=string(expected)+" Gene-Seed sent to Adeptus Mechanicus for tithe."; + if (gene_iou>0) then txt+=" IOU remains at "+string(gene_iou)+"."; + if (onceh==3) then txt+=" IOU has been payed off."; + } + + if (gene_seed_count()>0) and (und_gene_vaults>0) and (onceh==0){ + expected=1; + gene_seed_count()-=expected; + onceh=1; + + if (gene_seed_count()0) and (gene_iou>0){ + expected+=1; + gene_seed_count()-=1; + gene_iou-=1; + if (gene_iou==0) then onceh=3; + } + + if (gene_iou<0) then gene_iou=0; + + txt=string(expected)+" Gene-Seed sent to Adeptus Mechanicus for tithe."; + if (gene_iou>0) then txt+=" IOU remains at "+string(gene_iou)+"."; + if (onceh==3) then txt+=" IOU has been payed off."; + } + + var _colour = onceh!=2 ? "green": "red"; + + scr_alert(_colour,"tithes",txt,0,0); + scr_event_log(_colour,txt); + + } + } +} + +function gene_seed_count(){ + return array_length(obj_controller.gene_stock.gene_seed); } function add_new_gene_slave(){ @@ -67,7 +144,7 @@ function add_new_gene_slave(){ var _last_set = obj_ini.gene_slaves[array_length(obj_ini.gene_slaves)-1]; if (_last_set.turn == obj_controller.turn){ _last_set.num++; - obj_controller.gene_seed--; + gene_seed_count()--; _added=true; } } @@ -79,7 +156,7 @@ function add_new_gene_slave(){ turn : obj_controller.turn, assigned_apothecaries : [], }); - obj_controller.gene_seed--; + gene_seed_count()--; } scr_add_item("Gene Pod Incubator", -1); } @@ -164,10 +241,10 @@ function scr_apothecarium(){ var blurp2 = ""; var _slave_length = array_length(obj_ini.gene_slaves); if (!obj_ini.zygote) { - if (obj_controller.marines + obj_controller.gene_seed <= 300) and(_slave_length = 0) { + if (obj_controller.marines + gene_seed_count() <= 300) and(_slave_length = 0) { blurp2 = "Our Chapter is disasterously low in number- it is strongly advised that we make use of test-slaves to breed new gene-seed. Give me the word andwe can begin installing gestation pods."; } - else if (obj_controller.marines + obj_controller.gene_seed > 300) and(_slave_length = 0) { + else if (obj_controller.marines + gene_seed_count() > 300) and(_slave_length = 0) { blurp2 = "Our Chapter is capable of using test-slaves to breed new gene-seed. Should our number of astartes ever plummet this may prove a valuable method of rapidly bringing our chapter back up to size."; } else if (_slave_length > 0) { @@ -199,7 +276,7 @@ function scr_apothecarium(){ } } draw_set_alpha(1); - if (obj_controller.gene_seed <= 0) or(obj_ini.zygote = 1) then draw_set_alpha(0.5); + if (gene_seed_count() <= 0) or(obj_ini.zygote = 1) then draw_set_alpha(0.5); draw_set_color(c_gray); draw_set_color(c_black); if (scr_item_count("Gene Pod Incubator")){ diff --git a/scripts/scr_apothecary_ground/scr_apothecary_ground.gml b/scripts/scr_apothecary_ground/scr_apothecary_ground.gml index bb3272365d..aa78524f69 100644 --- a/scripts/scr_apothecary_ground/scr_apothecary_ground.gml +++ b/scripts/scr_apothecary_ground/scr_apothecary_ground.gml @@ -155,7 +155,7 @@ function apothecary_simple(){ } } if (!marines_present){ - if (obj_controller.gene_seed == 0) and (obj_controller.recruiting > 0) { + if (!gene_seed_count()) and (obj_controller.recruiting > 0) { var _training_ground = system_feature_bool(self, P_features.Recruiting_World); if (_training_ground){ obj_controller.recruiting = 0; diff --git a/scripts/scr_cheatcode/scr_cheatcode.gml b/scripts/scr_cheatcode/scr_cheatcode.gml index 6ef5c5248d..146a38c021 100644 --- a/scripts/scr_cheatcode/scr_cheatcode.gml +++ b/scripts/scr_cheatcode/scr_cheatcode.gml @@ -184,12 +184,20 @@ function scr_cheatcode(argument0) { if (global.cheat_gene == 0) { global.cheat_gene = 1; cheatyface = 1; - obj_controller.tempGene_seed = obj_controller.gene_seed; - obj_controller.gene_seed = 9999; + obj_controller.tempGene_seed = gene_seed_count(); + with(obj_controller.gene_stock){ + repeat(9999){ + new_gene_seed(); + } + } } else { global.cheat_gene = 0; cheatyface = 1; - obj_controller.gene_seed = obj_controller.tempGene_seed; + with(obj_controller.gene_stock){ + repeat(obj_controller.tempGene_seed){ + new_gene_seed(); + } + } } break; case "debug": @@ -215,7 +223,11 @@ function scr_cheatcode(argument0) { case "seed": if (global.cheat_gene == 0) { cheatyface = 1; - obj_controller.gene_seed = real(cheat_arguments[0]); + with(obj_controller.gene_stock){ + repeat(real(cheat_arguments[0])){ + new_gene_seed(); + } + } } break; case "depimp": diff --git a/scripts/scr_crusade/scr_crusade.gml b/scripts/scr_crusade/scr_crusade.gml index 10d236c835..0a208d87a9 100644 --- a/scripts/scr_crusade/scr_crusade.gml +++ b/scripts/scr_crusade/scr_crusade.gml @@ -108,7 +108,7 @@ function scr_crusade() { seed=min(seed,apoth*death_data[2]); } if (apoth=0) then seed=floor(seed*0.2); - obj_controller.gene_seed+=seed; + gene_seed_count()+=seed; } // i=-1; diff --git a/scripts/scr_gene_obj_creation/scr_gene_obj_creation.gml b/scripts/scr_gene_obj_creation/scr_gene_obj_creation.gml index f74c2831a1..12dff625f4 100644 --- a/scripts/scr_gene_obj_creation/scr_gene_obj_creation.gml +++ b/scripts/scr_gene_obj_creation/scr_gene_obj_creation.gml @@ -21,7 +21,7 @@ function scr_gene_obj_creation(){ draw_rectangle(445, 200, 1125, 202, true); draw_set_font(fnt_40k_30b); - draw_text_transformed(503,210,string_hash_to_newline("Gene-Seed Mutations"),0.6,0.6,0); + draw_text_transformed(503,210,"Gene-Seed Mutations",0.6,0.6,0); if (mutations>mutations_selected) then draw_text_transformed(585,230,$"Select {mutations-mutations_selected} More",0.5,0.5,0); var x1,y1,spac=34; 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 98fc4894eb..19485948b6 100644 --- a/scripts/scr_inquisition_fleet_functions/scr_inquisition_fleet_functions.gml +++ b/scripts/scr_inquisition_fleet_functions/scr_inquisition_fleet_functions.gml @@ -219,10 +219,10 @@ function inquisitor_approval_gene_banks(){ for (var e=0;e=100) and (obj_controller.gene_seed>=1100) then hur=1; - if (obj_controller.marines<=500) and (obj_controller.marines>200) and (gene_slave_count>=75) and (obj_controller.gene_seed>=900) then hur=1; - if (obj_controller.marines<=700) and (obj_controller.marines>500) and (gene_slave_count>=50) and (obj_controller.gene_seed>=750) then hur=1; - if (obj_controller.marines>700) and (gene_slave_count>=50) and (obj_controller.gene_seed>=500) then hur=1; + if (obj_controller.marines<=200) and (gene_slave_count>=100) and (gene_seed_count()>=1100) then hur=1; + if (obj_controller.marines<=500) and (obj_controller.marines>200) and (gene_slave_count>=75) and (gene_seed_count()>=900) then hur=1; + if (obj_controller.marines<=700) and (obj_controller.marines>500) and (gene_slave_count>=50) and (gene_seed_count()>=750) then hur=1; + if (obj_controller.marines>700) and (gene_slave_count>=50) and (gene_seed_count()>=500) then hur=1; if (obj_controller.marines>990) and (gene_slave_count>=50) then hur=2; return hur; } diff --git a/scripts/scr_kill_unit/scr_kill_unit.gml b/scripts/scr_kill_unit/scr_kill_unit.gml index f838c79d30..4da1446812 100644 --- a/scripts/scr_kill_unit/scr_kill_unit.gml +++ b/scripts/scr_kill_unit/scr_kill_unit.gml @@ -50,7 +50,9 @@ function kill_and_recover(company, unit_slot, equipment=true, gene_seed_collect= if (gene_seed_collect && unit.base_group=="astartes"){ //TODO get rid of string methods if (unit.age() > 30 && !obj_ini.zygote && !obj_ini.doomed) then obj_controller.gene_seed+=1; - if (unit.age() > 50 && !obj_ini.doomed) then obj_controller.gene_seed+=1; + if (unit.age() > 50) and (string_count("Doom",obj_ini.strin2)==0){ + gene_seed_count()+=1; + } } if (obj_ini.race[company][unit_slot]==1){ if(is_specialist(obj_ini.role[company][unit_slot])){ diff --git a/scripts/scr_load_controller/scr_load_controller.gml b/scripts/scr_load_controller/scr_load_controller.gml index fdf62103ab..00ad9917e3 100644 --- a/scripts/scr_load_controller/scr_load_controller.gml +++ b/scripts/scr_load_controller/scr_load_controller.gml @@ -334,7 +334,7 @@ function scr_load_controller(save_id){ obj_controller.loyalty_hidden=ini_read_real("Controller","loyalty_hidden",0); obj_controller.inqis_flag_lair=ini_read_real("Controller","flag_lair",0); obj_controller.inqis_flag_gene=ini_read_real("Controller","flag_gene",0); - obj_controller.gene_seed=ini_read_real("Controller","gene_seed",0); + gene_seed_count()=ini_read_real("Controller","gene_seed",0); obj_controller.marines=ini_read_real("Controller","marines",0); obj_controller.command=ini_read_real("Controller","command",0); obj_controller.info_chips=ini_read_real("Controller","info_chips",0); diff --git a/scripts/scr_recruit_data/scr_recruit_data.gml b/scripts/scr_recruit_data/scr_recruit_data.gml index dca1cf7426..9a74e33cc3 100644 --- a/scripts/scr_recruit_data/scr_recruit_data.gml +++ b/scripts/scr_recruit_data/scr_recruit_data.gml @@ -66,7 +66,7 @@ function planet_training_sequence(local_apothecary_points){ var thirdpop = max_population / 3; var halfpop = max_population / 2; - if (planet_feature_bool(features, P_features.Recruiting_World)) and(obj_controller.gene_seed > 0) and(current_owner <= 5) and(obj_controller.faction_status[current_owner] != "War") { + if (planet_feature_bool(features, P_features.Recruiting_World)) and(gene_seed_count() > 0) and(current_owner <= 5) and(obj_controller.faction_status[current_owner] != "War") { var _planet_population = population; if (large_population) { _planet_population *= 1000000000; @@ -98,7 +98,7 @@ function planet_training_sequence(local_apothecary_points){ if (struct_exists(recruit_type, "seed_waste")){ if (obj_controller.recruiting > 0) { if (random(1)0){ _cur_slave.eta=60; - obj_controller.gene_seed+=_cur_slave.num; + gene_seed_count()+=_cur_slave.num; // color / type / text /x/y scr_alert("green","test-slaves",$"Test-Slave Incubators Batch {i} harvested for {_cur_slave.num} Gene-Seed.",0,0); } else if (_cur_slave.num==0){ diff --git a/scripts/scr_ui_advisors/scr_ui_advisors.gml b/scripts/scr_ui_advisors/scr_ui_advisors.gml index f4e57ae619..a51148cc22 100644 --- a/scripts/scr_ui_advisors/scr_ui_advisors.gml +++ b/scripts/scr_ui_advisors/scr_ui_advisors.gml @@ -225,7 +225,7 @@ function scr_ui_advisors() { draw_text_ext(xx + 336 + 16, yy + 477, string_hash_to_newline(string(blurp2)), -1, 536); - // draw_set_alpha(1);if (obj_controller.gene_seed<=0) or (obj_ini.zygote=1) then draw_set_alpha(0.5); + // draw_set_alpha(1);if (gene_seed_count()<=0) or (obj_ini.zygote=1) then draw_set_alpha(0.5); /* if (menu = 12.1) or(fest_sid + fest_wid > 0) then draw_set_alpha(0.25); draw_set_color(c_gray); From 75a32f3a1a9a3d9a4d1ff8f98c0b5ef7dd66c9b1 Mon Sep 17 00:00:00 2001 From: Nelsonh Date: Thu, 26 Dec 2024 18:26:24 +0000 Subject: [PATCH 3/5] cleanup after mass rework --- objects/obj_ncombat/Alarm_5.gml | 35 ++++++++--------- objects/obj_p_ship/Alarm_3.gml | 4 +- scripts/scr_apothecarium/scr_apothecarium.gml | 38 +++++++++---------- .../scr_inquisition_fleet_functions.gml | 2 +- scripts/scr_recruit_data/scr_recruit_data.gml | 4 +- .../scr_specialist_point_handler.gml | 13 ++++--- 6 files changed, 48 insertions(+), 48 deletions(-) diff --git a/objects/obj_ncombat/Alarm_5.gml b/objects/obj_ncombat/Alarm_5.gml index 55333a1d9a..ee991da96c 100644 --- a/objects/obj_ncombat/Alarm_5.gml +++ b/objects/obj_ncombat/Alarm_5.gml @@ -93,7 +93,7 @@ if (vehicle_deaths>0 || vehicles_saved>0){ if (techmarines_alive=1) then part4+=" ("+string(roles[16])+" prevented the destruction of "+string(vehicles_saved)+")"; if (techmarines_alive>1) then part4+=" ("+string(roles[16])+"s prevented the destruction of "+string(vehicles_saved)+")"; - var i;i=0; + var i=0; repeat(30){i+=1; if (post_unit_lost[i]!="") and (post_units_lost[i]>0) and (post_unit_veh[i]=1){ part5+=string(post_units_lost[i])+"x "+string(post_unit_lost[i])+", "; @@ -188,25 +188,18 @@ if (slime>0){ instance_activate_object(obj_star); -var reduce_fortification=true; -if (battle_special="tyranid_org") then reduce_fortification=false; -if (string_count("_attack",battle_special)>0) then reduce_fortification=false; -if (battle_special="ship_demon") then reduce_fortification=false; -if (enemy+threat=17) then reduce_fortification=false; -if (battle_special="ruins") then reduce_fortification=false; -if (battle_special="ruins_eldar") then reduce_fortification=false; -if (battle_special="fallen1") then reduce_fortification=false; -if (battle_special="fallen2") then reduce_fortification=false; -if (battle_special="study2a") then reduce_fortification=false; -if (battle_special="study2b") then reduce_fortification=false; + +var _non_fortification_destroying_battles = ["tyranid_org", "ship_demon","ruins","ruins_eldar","fallen1","fallen2","study2a","study2b"]; +var reduce_fortification=!array_contains(_non_fortification_destroying_battles, battle_special); +if (reduce_fortification){ + if (string_count("_attack",battle_special)>0) then reduce_fortification=false; + if (enemy+threat=17) then reduce_fortification=false; +} + + if (fortified>0) and (!instance_exists(obj_nfort)) and (reduce_fortification=true){ - part9="Fortification level of "+string(battle_loc); - if (battle_id=1) then part9+=" I"; - if (battle_id=2) then part9+=" II"; - if (battle_id=3) then part9+=" III"; - if (battle_id=4) then part9+=" IV"; - if (battle_id=5) then part9+=" V"; + part9=$"Fortification level of {battle_loc} , scr_roman(battle_id)"; part9+=$" has decreased to {fortified-1} ({fortified}-1)"; newline=part9; scr_newtext(); @@ -779,7 +772,11 @@ if (obj_ini.fleet_type != ePlayerBase.home_world) and (defeat==1) and (dropping= //all Gene Pod Incubators and gene seed are lost destroy_all_gene_slaves(false); } - if (obj_controller.und_gene_vaults>0) then gene_seed_count()-=floor(gene_seed_count()/10); + if (obj_controller.und_gene_vaults>0){ + with (obj_controller.gene_stock){ + remove_gene_seed(floor(gene_seed_count()/10)); + } + } } } instance_deactivate_object(obj_star); diff --git a/objects/obj_p_ship/Alarm_3.gml b/objects/obj_p_ship/Alarm_3.gml index 3b337a48b8..2f8dc58806 100644 --- a/objects/obj_p_ship/Alarm_3.gml +++ b/objects/obj_p_ship/Alarm_3.gml @@ -5,14 +5,14 @@ if (hp0){ - gene_seed_count()-=floor(gene_seed_count()/10); + remove_gene_seed(floor(gene_seed_count()/10)); } } diff --git a/scripts/scr_apothecarium/scr_apothecarium.gml b/scripts/scr_apothecarium/scr_apothecarium.gml index c346487875..90ad25fa44 100644 --- a/scripts/scr_apothecarium/scr_apothecarium.gml +++ b/scripts/scr_apothecarium/scr_apothecarium.gml @@ -58,11 +58,15 @@ function GeneStock() constructor(chapter_mutations){ } array_push(gene_seed, seed_data); } - static remove_gene_seed = function(){ - var _remove = array_random_index(gene_seed); - var _seed = gene_seed[_remove]; - array_delete(gene_seed, _remove, 1); - return _seed; + static remove_gene_seed = function(count=1){ + _seeds = []; + repeat(count){ + var _remove = array_random_index(gene_seed); + var _seed = gene_seed[_remove]; + array_delete(gene_seed, _remove, 1); + array_push(_seeds, _seed); + } + return _seeds; } static mechanicus_tithes = function(){ var expected,txt=""; @@ -81,20 +85,18 @@ function GeneStock() constructor(chapter_mutations){ if (!mech_mad){ if (gene_seed_count()) and (und_gene_vaults==0) and (onceh==0){ - gene_seed_count()-=expected; + gene_stock.remove_gene_seed(expected); onceh=1; - if (gene_seed_count()>=gene_iou) and (gene_iou>0){ - expected+=gene_iou; - gene_seed_count()-=gene_iou; - gene_iou=0; - onceh=3; - } + for(var i=0; i<50; i++){ if (gene_seed_count()0) and (gene_iou>0){ expected+=1; - gene_seed_count()-=1; + gene_stock.remove_gene_seed(gene_iou); + gene_iou-=1; if (gene_iou==0) then onceh=3; + } else { + break; } } @@ -107,12 +109,12 @@ function GeneStock() constructor(chapter_mutations){ if (gene_seed_count()>0) and (und_gene_vaults>0) and (onceh==0){ expected=1; - gene_seed_count()-=expected; + gene_stock.remove_gene_seed(expected); onceh=1; if (gene_seed_count()0) and (gene_iou>0){ expected+=1; - gene_seed_count()-=1; + gene_stock.remove_gene_seed(1); gene_iou-=1; if (gene_iou==0) then onceh=3; } @@ -143,20 +145,18 @@ function add_new_gene_slave(){ if (array_length(obj_ini.gene_slaves)){ var _last_set = obj_ini.gene_slaves[array_length(obj_ini.gene_slaves)-1]; if (_last_set.turn == obj_controller.turn){ - _last_set.num++; - gene_seed_count()--; + _last_set.num = array_concat(_last_set.num,obj_controller.gene_stock.remove_gene_seed(1)); _added=true; } } if (!_added){ array_push(obj_ini.gene_slaves, { - num : [], + num : obj_controller.gene_stock.remove_gene_seed(1), eta : 120, harvested_once : false, turn : obj_controller.turn, assigned_apothecaries : [], }); - gene_seed_count()--; } scr_add_item("Gene Pod Incubator", -1); } 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 19485948b6..6809eb5972 100644 --- a/scripts/scr_inquisition_fleet_functions/scr_inquisition_fleet_functions.gml +++ b/scripts/scr_inquisition_fleet_functions/scr_inquisition_fleet_functions.gml @@ -217,7 +217,7 @@ function inquisitor_approval_gene_banks(){ var gene_slave_count = 0; var hur=0 for (var e=0;e=100) and (gene_seed_count()>=1100) then hur=1; if (obj_controller.marines<=500) and (obj_controller.marines>200) and (gene_slave_count>=75) and (gene_seed_count()>=900) then hur=1; diff --git a/scripts/scr_recruit_data/scr_recruit_data.gml b/scripts/scr_recruit_data/scr_recruit_data.gml index 9a74e33cc3..a7be4cea5f 100644 --- a/scripts/scr_recruit_data/scr_recruit_data.gml +++ b/scripts/scr_recruit_data/scr_recruit_data.gml @@ -98,7 +98,7 @@ function planet_training_sequence(local_apothecary_points){ if (struct_exists(recruit_type, "seed_waste")){ if (obj_controller.recruiting > 0) { if (random(1)0){ + var _slave_num = array_length(_cur_slave.num); + if (_slave_num>0){ _cur_slave.eta--; - if (irandom(100000)0){ _cur_slave.eta=60; - gene_seed_count()+=_cur_slave.num; + for (var i=0;i<_slave_num;i++){ + obj_controller.gene_stock.new_gene_seed(_cur_slave.num[i]); + } // color / type / text /x/y - scr_alert("green","test-slaves",$"Test-Slave Incubators Batch {i} harvested for {_cur_slave.num} Gene-Seed.",0,0); + scr_alert("green","test-slaves",$"Test-Slave Incubators Batch {i} harvested for {_slave_num} Gene-Seed.",0,0); } else if (_cur_slave.num==0){ array_push(_stack_lost_incubators, i); } From 793641259acb9bf68c8fe7dfd245f78111e2c0b5 Mon Sep 17 00:00:00 2001 From: Nelsonh Date: Thu, 26 Dec 2024 18:42:43 +0000 Subject: [PATCH 4/5] rework unit death_handling --- scripts/scr_apothecarium/scr_apothecarium.gml | 22 +++++++++++++++++++ scripts/scr_kill_unit/scr_kill_unit.gml | 14 ++++++++++++ .../scr_marine_struct/scr_marine_struct.gml | 6 ++--- .../scr_specialist_point_handler.gml | 20 +---------------- 4 files changed, 40 insertions(+), 22 deletions(-) diff --git a/scripts/scr_apothecarium/scr_apothecarium.gml b/scripts/scr_apothecarium/scr_apothecarium.gml index 90ad25fa44..6cbc5bb2a8 100644 --- a/scripts/scr_apothecarium/scr_apothecarium.gml +++ b/scripts/scr_apothecarium/scr_apothecarium.gml @@ -58,6 +58,28 @@ function GeneStock() constructor(chapter_mutations){ } array_push(gene_seed, seed_data); } + + static harvest_from_slave_pod = function (slave_pod){ + var _slave_num = array_length(slave_pod.num); + var _lost_gene_slaves=0; + if (_slave_num>0){ + slave_pod.eta--; + if (irandom(100000)0){ + slave_pod.eta=60; + for (var i=0;i<_slave_num;i++){ + new_gene_seed(slave_pod.num[i]); + } + // color / type / text /x/y + scr_alert("green","test-slaves",$"Test-Slave Incubators Batch {i} harvested for {_slave_num} Gene-Seed.",0,0); + } + } + } static remove_gene_seed = function(count=1){ _seeds = []; repeat(count){ diff --git a/scripts/scr_kill_unit/scr_kill_unit.gml b/scripts/scr_kill_unit/scr_kill_unit.gml index 4da1446812..46f2e7c722 100644 --- a/scripts/scr_kill_unit/scr_kill_unit.gml +++ b/scripts/scr_kill_unit/scr_kill_unit.gml @@ -37,7 +37,18 @@ function scr_wipe_unit(company, unit_slot){ function kill_and_recover(company, unit_slot, equipment=true, gene_seed_collect=true){ var unit = obj_ini.TTRPG[company][unit_slot]; + var _returns = { + equipments : false, + gene_seed : [], + } if (equipment){ + returns.equipment = { + "wep1":unit.weapon_one(), + "wep2":unit.weapon_two(), + "mobi":unit.mobility_item(), + "armour":unit.armour(), + "gear":unit.gear(), + } var strip = { "wep1":"", "wep2":"", @@ -45,12 +56,15 @@ function kill_and_recover(company, unit_slot, equipment=true, gene_seed_collect= "armour":"", "gear":"", }; + unit.alter_equipment(strip,false, true); } if (gene_seed_collect && unit.base_group=="astartes"){ //TODO get rid of string methods if (unit.age() > 30 && !obj_ini.zygote && !obj_ini.doomed) then obj_controller.gene_seed+=1; if (unit.age() > 50) and (string_count("Doom",obj_ini.strin2)==0){ + array_push(gene_seed, ) + _returns.gene_seed = unit.gene_seed_mutations; gene_seed_count()+=1; } } diff --git a/scripts/scr_marine_struct/scr_marine_struct.gml b/scripts/scr_marine_struct/scr_marine_struct.gml index f1002cb64f..e51a261272 100644 --- a/scripts/scr_marine_struct/scr_marine_struct.gml +++ b/scripts/scr_marine_struct/scr_marine_struct.gml @@ -811,13 +811,13 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data={}) if (faction ="chapter"){ allegiance = global.chapter_name; } - if (struct_exists(other_spawn_data , "gene_seed_data")){ - gene_seed_mutations = other_spawn_data.gene_seed_data + if (struct_exists(other_spawn_data , "gene_seed")){ + gene_seed_mutations = other_spawn_data.gene_seed } else { gene_seed_mutations = create_gene_seed(); } - if (gene_seed_mutations[$ "voice"] == 1){ + if (gene_seed_mutations.voice == 1){ charisma-=2; } if (instance_exists(obj_controller)){ diff --git a/scripts/scr_specialist_point_handler/scr_specialist_point_handler.gml b/scripts/scr_specialist_point_handler/scr_specialist_point_handler.gml index 12900fab69..b54ec494d3 100644 --- a/scripts/scr_specialist_point_handler/scr_specialist_point_handler.gml +++ b/scripts/scr_specialist_point_handler/scr_specialist_point_handler.gml @@ -380,25 +380,7 @@ function SpecialistPointHandler() constructor{ var _stack_lost_incubators = []; for (var i=0; i<_slave_length; i++){ _cur_slave = _slaves[i]; - var _slave_num = array_length(_cur_slave.num); - if (_slave_num>0){ - _cur_slave.eta--; - if (irandom(100000)0){ - _cur_slave.eta=60; - for (var i=0;i<_slave_num;i++){ - obj_controller.gene_stock.new_gene_seed(_cur_slave.num[i]); - } - // color / type / text /x/y - scr_alert("green","test-slaves",$"Test-Slave Incubators Batch {i} harvested for {_slave_num} Gene-Seed.",0,0); - } else if (_cur_slave.num==0){ - array_push(_stack_lost_incubators, i); - } - } + var _result = obj_controller.gene_stock.harvest_from_slave_pod(_cur_slave); } if (array_length(_stack_lost_incubators)){ var _lost_inc_string = "Incubators Batch no longer has gene slaves and has been removed : "; From 3d4d3484b3a73bd1e54b73476f4aca50dc76ce3e Mon Sep 17 00:00:00 2001 From: Nelsonh Date: Mon, 6 Jan 2025 19:14:20 +0000 Subject: [PATCH 5/5] continued swap of gene_seed count method --- ChapterMaster.yyp | 2 +- fonts/fnt_menu/fnt_menu.old.png | Bin 28184 -> 28184 bytes fonts/fnt_menu/fnt_menu.png | Bin 28184 -> 28184 bytes objects/obj_controller/Create_0.gml | 20 +++++++++--- objects/obj_controller/Draw_64.gml | 5 +-- objects/obj_controller/Mouse_50.gml | 8 ++--- objects/obj_ncombat/Alarm_5.gml | 4 ++- objects/obj_pnunit/Alarm_5.gml | 4 +-- objects/obj_pnunit/Alarm_6.gml | 4 ++- objects/obj_popup/Step_0.gml | 30 ++++++++++-------- scripts/scr_apothecarium/scr_apothecarium.gml | 13 ++++---- scripts/scr_kill_unit/scr_kill_unit.gml | 7 +--- .../scr_marine_struct/scr_marine_struct.gml | 11 +++++++ scripts/scr_random_event/scr_random_event.gml | 2 +- scripts/scr_recruit_data/scr_recruit_data.gml | 4 +-- scripts/scr_ruins_reward/scr_ruins_reward.gml | 4 +-- scripts/scr_trade/scr_trade.gml | 9 +++--- scripts/scr_ui_diplomacy/scr_ui_diplomacy.gml | 10 +++--- 18 files changed, 82 insertions(+), 55 deletions(-) diff --git a/ChapterMaster.yyp b/ChapterMaster.yyp index c7a42c24b4..7ac4c0405f 100644 --- a/ChapterMaster.yyp +++ b/ChapterMaster.yyp @@ -1444,6 +1444,6 @@ ], "templateType": null, "TextureGroups": [ - {"resourceType":"GMTextureGroup","resourceVersion":"1.3","name":"Default","autocrop":true,"border":2,"compressFormat":"bz2","customOptions":"","directory":"","groupParent":null,"isScaled":false,"loadType":"default","mipsToGenerate":0,"targets":-1,}, + {"resourceType":"GMTextureGroup","resourceVersion":"1.3","name":"Default","autocrop":true,"border":2,"compressFormat":"bz2","directory":"","groupParent":null,"isScaled":false,"loadType":"default","mipsToGenerate":0,"targets":-1,}, ], } \ No newline at end of file diff --git a/fonts/fnt_menu/fnt_menu.old.png b/fonts/fnt_menu/fnt_menu.old.png index 379aee7e0530ef586a9adeb767f1a6dac23abbab..5136b0e9e7f152341f52db45d83b57991d89c248 100644 GIT binary patch delta 150 zcmbPnhjGRo#tpr>^`^Q8hPnpEA%>P#28LF~M%o4jRt5&4<;I^F7#LJbTq8{0f22WQ%mvv4FO#q#~ BDDnUR delta 150 zcmbPnhjGRo#tpr>^(MN8M!Lp^A%+%K2F6x~7TN{|Rt5(7Nk=y_Ffgc=xJHzuB$lLF z<>sekrd2W+85m*LAZK683)G+i*HDs~n_66wm|K8bkEd45B_5zA22WQ%mvv4FO#rp! BDA51_ diff --git a/fonts/fnt_menu/fnt_menu.png b/fonts/fnt_menu/fnt_menu.png index 5136b0e9e7f152341f52db45d83b57991d89c248..b63b7faaf30bc112766b32f2c0dd60939fd2c7cf 100644 GIT binary patch delta 92 zcmbPnhjGRo#toBmMa)7BEv!rotqcvc4GgRd45r@>+CF)Ct}KScv$j{bP0l+XkKeTyAN delta 92 zcmbPnhjGRo#toBmMT|oXEv*a;t&EMd4GgRd3_{C|KTTeqD~lnaqSfs;`9`jS0=kZ3 S`&APefWXt$&t;ucLK6TOWg3P6 diff --git a/objects/obj_controller/Create_0.gml b/objects/obj_controller/Create_0.gml index 1fdf584306..0d948fea8c 100644 --- a/objects/obj_controller/Create_0.gml +++ b/objects/obj_controller/Create_0.gml @@ -1435,12 +1435,22 @@ loyalty=100; loyalty_hidden=100;// Updated when inquisitors do an inspection // ** Sets up gene seed ** gene_stock = new GeneStock(); -gene_seed=20; -if (scr_has_disadv("Sieged")) then gene_seed = floor(random_range(250, 400)); -if scr_has_disadv("Obliterated") then gene_seed=floor(random_range(50,200)); -if (global.chapter_name=="Lamenters") then gene_seed=30; -if (global.chapter_name=="Soul Drinkers") then gene_seed=60; +var _gene_count = 20; +if (scr_has_disadv("Sieged")){ + _gene_count= irandom_range(250,400); +} + +if (scr_has_disadv("Obliterated")){ + _gene_count= irandom_range(50,200); +} +if (global.chapter_name=="Lamenters") then _gene_count=30; +if (global.chapter_name=="Soul Drinkers") then _gene_count=60; + + +repeat(_gene_count){ + gene_stock.new_gene_seed(); +} // ** sets up the starting squads** squads = true; game_start_squads(); diff --git a/objects/obj_controller/Draw_64.gml b/objects/obj_controller/Draw_64.gml index 1acb5688ae..9c23d04632 100644 --- a/objects/obj_controller/Draw_64.gml +++ b/objects/obj_controller/Draw_64.gml @@ -132,8 +132,9 @@ if (!zoomed && !zui){ // Draws the current gene seed draw_sprite(spr_new_resource,2,355,17); draw_set_color(c_red); - draw_text(370,16,string_hash_to_newline(string(gene_seed))); - draw_text(370.5,16.5,string_hash_to_newline(string(gene_seed))); + var _gene_count = $"{gene_seed_count()}"; + draw_text(370,16,_gene_count); + draw_text(370.5,16.5,_gene_count); // Draws the current marines in your command draw_sprite(spr_new_resource,3,475-10,17); draw_set_color(16291875); diff --git a/objects/obj_controller/Mouse_50.gml b/objects/obj_controller/Mouse_50.gml index 4976f91cda..c7c52e176c 100644 --- a/objects/obj_controller/Mouse_50.gml +++ b/objects/obj_controller/Mouse_50.gml @@ -59,7 +59,7 @@ if (menu==12) and (cooldown<=0) and (penitorium>0){ // ** Recruitement ** else if (menu==15) and (cooldown<=0){ if (mouse_x>=xx+748) and (mouse_x=yy+355) and (mouse_y0) and (obj_ini.doomed==0) and (string_count("|",recruiting_worlds)>0) and (penitent==0){ + if (mouse_y>=yy+355) and (mouse_y0) and (obj_ini.doomed==0) and (string_count("|",recruiting_worlds)>0) and (penitent==0){ cooldown=8000; recruiting+=1; income_recruiting-=2*(string_count("|",recruiting_worlds)); @@ -335,7 +335,7 @@ if (menu==20) and (diplomacy>0) or ((diplomacy<-5) and (diplomacy>-6)) and (cool } trade_req=requisition; - trade_gene=gene_seed; + trade_gene=gene_seed_count(); trade_chip=stc_wargear_un+stc_vehicles_un+stc_ships_un; trade_info=info_chips; @@ -483,7 +483,7 @@ if (menu==20) and (diplomacy>0) or ((diplomacy<-5) and (diplomacy>-6)) and (cool trade_take[1]="Artifact"; trade_tnum[1]=1; trade_req=requisition; - trade_gene=gene_seed; + trade_gene=gene_seed_count(); trade_chip=info_chips; trade_info=stc_wargear_un+stc_vehicles_un+stc_ships_un; } @@ -631,7 +631,7 @@ if (menu==20) and (diplomacy>0) or ((diplomacy<-5) and (diplomacy>-6)) and (cool click2=1; trade_likely=""; trade_req=requisition; - trade_gene=gene_seed; + trade_gene=gene_seed_count(); trade_chip=stc_wargear_un+stc_vehicles_un+stc_ships_un; trade_info=info_chips; diff --git a/objects/obj_ncombat/Alarm_5.gml b/objects/obj_ncombat/Alarm_5.gml index ee991da96c..d23a67a526 100644 --- a/objects/obj_ncombat/Alarm_5.gml +++ b/objects/obj_ncombat/Alarm_5.gml @@ -52,7 +52,9 @@ if (ground_mission){ seed_saved=(min(seed_max,apothecaries_alive*40))-gene_penalty; if (obj_ini.doomed) then seed_saved=0; -if (seed_saved>0) then gene_seed_count()+=seed_saved; +if (seed_saved>0){ + gene_seed_count()+=seed_saved; +} if (obj_ini.doomed && !apothecaries_alive){ part3=$"Chapter Mutation prevents retrieving Gene-Seed. {seed_max} Gene-Seed lost."; diff --git a/objects/obj_pnunit/Alarm_5.gml b/objects/obj_pnunit/Alarm_5.gml index 398c3c287e..1f968cf316 100644 --- a/objects/obj_pnunit/Alarm_5.gml +++ b/objects/obj_pnunit/Alarm_5.gml @@ -91,7 +91,7 @@ for (var i=0;i0) or (obj_ncombat.defeat!=0)) and (marine_type[i]!="") and (ally[i]=false){ var comm=false; @@ -103,7 +103,7 @@ for (var i=0;i 30) && (obj_controller.gene_seed < 60)) { + else if ((_gene_count > 30) && (_gene_count < 60)) { option1 += "50% of all gene-seed."; } - if (obj_controller.gene_seed >= 60) { + else if (_gene_count >= 60) { option1 += "33% of all gene-seed."; } option2 = "Tell the apothecaries to let it be."; @@ -1090,16 +1094,16 @@ try { if ((press == 1) && (option1 != "") || ((demand == 1) && (mission != "") && (string_count("Inquisition", title) > 0)) || ((demand == 1) && (title == "Inquisition Recon"))) { if (image == "gene_bad") { - var onceh; - onceh = 0; - if ((obj_controller.gene_seed <= 30) && (onceh == 0)) { - obj_controller.gene_seed = 0; + var _gene_count = gene_seed_count(); + var _gene_stock = obj_controller.gene_stock; + if ((_gene_count <= 30)) { + _gene_stock.remove_gene_seed(_gene_count); } - if ((obj_controller.gene_seed > 30) && (obj_controller.gene_seed < 60) && (onceh == 0)) { - obj_controller.gene_seed = round(obj_controller.gene_seed * 0.5); + else if ((_gene_count > 30) && (_gene_count < 60)) { + _gene_stock.remove_gene_seed(floor(_gene_count*0.5)); } - if ((obj_controller.gene_seed >= 60) && (onceh == 0)) { - obj_controller.gene_seed = round(obj_controller.gene_seed * 0.66); + else if ((_gene_count >= 60)) { + _gene_stock.remove_gene_seed(floor(_gene_count*0.66)); } } if ((title == "Inquisitor Located") || (title == "Artifact Offered") || (title == "Mercy Plea")) { diff --git a/scripts/scr_apothecarium/scr_apothecarium.gml b/scripts/scr_apothecarium/scr_apothecarium.gml index 6cbc5bb2a8..18d9d5030d 100644 --- a/scripts/scr_apothecarium/scr_apothecarium.gml +++ b/scripts/scr_apothecarium/scr_apothecarium.gml @@ -162,7 +162,7 @@ function gene_seed_count(){ } function add_new_gene_slave(){ - if (gene_seed>0) and (obj_ini.zygote==0) { + if (gene_seed_count()>0) and (obj_ini.zygote==0) { var _added = false; if (array_length(obj_ini.gene_slaves)){ var _last_set = obj_ini.gene_slaves[array_length(obj_ini.gene_slaves)-1]; @@ -244,10 +244,11 @@ function scr_apothecarium(){ // - if (gene_seed <= 0) then blurp += "##My lord, our stocks of gene-seed are empty. It would be best to have some come mechanicus tithe.##Further training of Neophytes is halted until our stocks replenish."; - if (gene_seed > 0) and(gene_seed <= 10) then blurp += "##My Brother " + string(obj_ini.role[100, 15]) + "s assigned to the gene-vault have informed me that our stocks are nearly gone. They only number " + string(gene_seed) + "; this includes those recently recovered from our fallen comerades-in-arms."; - if (gene_seed > 10) then blurp += "##My Brother " + string(obj_ini.role[100, 15]) + "s assigned to the gene-vault have informed me that our stocks of gene-seed currently number " + string(gene_seed) + ". This includes those recently recovered from our fallen comerades-in-arms."; - if (gene_seed > 0) then blurp += "##The stocks are stable and show no sign of mutation."; + var _gene_count = gene_seed_count(); + if (_gene_count <= 0) then blurp += $"##My lord, our stocks of gene-seed are empty. It would be best to have some come mechanicus tithe.##Further training of Neophytes is halted until our stocks replenish."; + if (_gene_count > 0) and(_gene_count <= 10) then blurp += $"##My Brother {obj_ini.role[100, 15]}s assigned to the gene-vault have informed me that our stocks are nearly gone. They only number {_gene_count}; this includes those recently recovered from our fallen comerades-in-arms."; + if (_gene_count > 10) then blurp += $"##My Brother {obj_ini.role[100, 15]}s assigned to the gene-vault have informed me that our stocks of gene-seed currently number {_gene_count}. This includes those recently recovered from our fallen comerades-in-arms."; + if (_gene_count > 0) then blurp += $"##The stocks are stable and show no sign of mutation."; if (menu_adept = 1) { var _recruit_pace = ARR_recruitment_pace; @@ -255,7 +256,7 @@ function scr_apothecarium(){ blurp += "Training of further " + string(obj_ini.role[100, 15]) + "s"; if (training_apothecary >= 0 && training_apothecary <= 6) then blurp += _recruit_pace[training_apothecary]; if (training_apothecary > 0) then blurp += " The next " + string(obj_ini.role[100, 15]) + " is expected in " + string(eta) + " months."; - blurp += "##You have " + string(gene_seed) + " gene-seed stocked."; + blurp += $"##You have {_gene_count} gene-seed stocked."; } draw_text_ext(xx + 336 + 16, yy + 130, string_hash_to_newline(string(blurp)), -1, 536); diff --git a/scripts/scr_kill_unit/scr_kill_unit.gml b/scripts/scr_kill_unit/scr_kill_unit.gml index 46f2e7c722..3a9bce201d 100644 --- a/scripts/scr_kill_unit/scr_kill_unit.gml +++ b/scripts/scr_kill_unit/scr_kill_unit.gml @@ -61,12 +61,7 @@ function kill_and_recover(company, unit_slot, equipment=true, gene_seed_collect= } if (gene_seed_collect && unit.base_group=="astartes"){ //TODO get rid of string methods - if (unit.age() > 30 && !obj_ini.zygote && !obj_ini.doomed) then obj_controller.gene_seed+=1; - if (unit.age() > 50) and (string_count("Doom",obj_ini.strin2)==0){ - array_push(gene_seed, ) - _returns.gene_seed = unit.gene_seed_mutations; - gene_seed_count()+=1; - } + unit.harvest_gene_seed(); } if (obj_ini.race[company][unit_slot]==1){ if(is_specialist(obj_ini.role[company][unit_slot])){ diff --git a/scripts/scr_marine_struct/scr_marine_struct.gml b/scripts/scr_marine_struct/scr_marine_struct.gml index e51a261272..5c1eaf2a9a 100644 --- a/scripts/scr_marine_struct/scr_marine_struct.gml +++ b/scripts/scr_marine_struct/scr_marine_struct.gml @@ -890,6 +890,17 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data={}) body[$"head"].hood = 1; } } + + static harvest_gene_seed = function(){ + var _gene_data = gene_seed_mutations; + var _gene_stock = obj_Controller.gene_stock; + if (age() > 30 && !_gene_data.zygote && !_gene_data.doomed){ + _gene_stock.new_gene_seed(_gene_data); + } + if (age() > 50) and (!obj_ini.doomed){ + _gene_stock.new_gene_seed(_gene_data); + } + } break; case "tech_priest": loyalty = obj_controller.disposition[eFACTION.Mechanicus]-10; diff --git a/scripts/scr_random_event/scr_random_event.gml b/scripts/scr_random_event/scr_random_event.gml index cb277a9eac..9b381501f6 100644 --- a/scripts/scr_random_event/scr_random_event.gml +++ b/scripts/scr_random_event/scr_random_event.gml @@ -146,7 +146,7 @@ function scr_random_event(execute_now) { } break; case EVENT.mutation: - if(gene_seed < 5){ + if(gene_seed_count() < 5){ events_share[i] -= 1; events_total -= 1; } diff --git a/scripts/scr_recruit_data/scr_recruit_data.gml b/scripts/scr_recruit_data/scr_recruit_data.gml index a7be4cea5f..92cb147e76 100644 --- a/scripts/scr_recruit_data/scr_recruit_data.gml +++ b/scripts/scr_recruit_data/scr_recruit_data.gml @@ -587,7 +587,7 @@ function scr_draw_recruit_advisor(){ blurp += $"Our Chapter currently has {recruits} recruits being trained. {recruit_name[0]} is the next scheduled Neophyte to become a battle brother in {recruit_training[0] + recruit_distance[0]} months' time."; } - if (gene_seed > 0) { + if (gene_seed_count() > 0) { var _recruit_rates = ARR_recruitment_rates; var _cur_recruit_rate = $"The recruitment is {_recruit_rates[recruiting]}"; if ((recruiting == 0) && (marines >= 1000)) { @@ -608,7 +608,7 @@ function scr_draw_recruit_advisor(){ blurp += "\nMutation of our gene-seed currently makes us unable to recruit new Neophytes. We are doomed to a slow demise unless the Apothecaries can fix it."; } - if (gene_seed == 0) { + if (gene_seed_count() == 0) { blurp += "\nThere is no more gene-seed in our vaults and we cannot create more neophytes as a result. Something must be done, Chapter Master."; } diff --git a/scripts/scr_ruins_reward/scr_ruins_reward.gml b/scripts/scr_ruins_reward/scr_ruins_reward.gml index 736e8e9a90..9388b7a88f 100644 --- a/scripts/scr_ruins_reward/scr_ruins_reward.gml +++ b/scripts/scr_ruins_reward/scr_ruins_reward.gml @@ -146,8 +146,8 @@ function scr_ruins_reward(star_system, planet, _ruins) { pop.text="These ruins were once an armoury. We found some weapons and pieces of wargear. "+string(wen1)+"x "+string(wep1)+", "+string(wen2)+"x "+string(wep2)+", and "+string(wen3)+"x "+string(wep3)+" have been added to the Armamentarium."; } else if (loot="gene_seed"){// Requisition - var gene,pop;gene=floor(random_range(20,40))+1; - pop=instance_create(0,0,obj_popup); + var gene=floor(random_range(20,40))+1; + var pop=instance_create(0,0,obj_popup); pop.image="geneseed_lab"; pop.title="Ancient Ruins: Gene-seed"; pop.text="My lord, your battle brothers have located a hidden, fortified laboratory within the ruins. Contained are a number of bio-vaults with astartes gene-seed; "+string(gene)+" in number. Your marines are not able to determine the integrity or origin."; diff --git a/scripts/scr_trade/scr_trade.gml b/scripts/scr_trade/scr_trade.gml index db36d9b49b..b449360a57 100644 --- a/scripts/scr_trade/scr_trade.gml +++ b/scripts/scr_trade/scr_trade.gml @@ -193,11 +193,10 @@ function scr_trade(argument0) { // Temporary work around if (lisc>0){ - for (var i = 1; i <= 4; i += 1) { + for (var i = 1; i <= 4; i++) { if (trade_give[i]="Requisition") then requisition-=trade_mnum[i]; if (trade_give[i]="Gene-Seed") and (trade_mnum[i]>0){ - gene_seed-=trade_mnum[i]; - + gene_stock.remove_gene_seed(trade_mnum[i]); if (diplomacy<=5) and (diplomacy!=4) then gene_sold+=trade_mnum[i]; if (diplomacy>=6) then gene_xeno+=trade_mnum[i]; } @@ -367,7 +366,7 @@ function scr_trade(argument0) { repeat(4){i+=1; if (trade_give[i]="Requisition") then requisition-=trade_mnum[i]; if (trade_give[i]="Gene-Seed") and (trade_mnum[i]>0){ - gene_seed-=trade_mnum[i]; + gene_stock.remove_gene_seed(trade_mnum[i]); if (diplomacy<=5) and (diplomacy!=4) then gene_sold+=trade_mnum[i]; if (diplomacy>=6) then gene_xeno+=trade_mnum[i]; @@ -472,7 +471,7 @@ function scr_trade(argument0) { repeat(4){i+=1; if (trade_give[i]="Requisition") then requisition-=trade_mnum[i]; if (trade_give[i]="Gene-Seed") and (trade_mnum[i]>0){ - gene_seed-=trade_mnum[i]; + gene_stock.remove_gene_seed(trade_mnum[i]); if (diplomacy<=5) and (diplomacy!=4) then gene_sold+=trade_mnum[i]; if (diplomacy>=6) then gene_xeno+=trade_mnum[i]; diff --git a/scripts/scr_ui_diplomacy/scr_ui_diplomacy.gml b/scripts/scr_ui_diplomacy/scr_ui_diplomacy.gml index 4bf64d4522..89131191c0 100644 --- a/scripts/scr_ui_diplomacy/scr_ui_diplomacy.gml +++ b/scripts/scr_ui_diplomacy/scr_ui_diplomacy.gml @@ -759,16 +759,18 @@ function scr_ui_diplomacy() { xx+=419; - if (requisition<=0) then draw_set_alpha(0.33);draw_text_ext(xx+347,yy+379,string_hash_to_newline(string(trade_mine[1])),-1,136);draw_set_alpha(1); + if (requisition<=0) then draw_set_alpha(0.33); + draw_text_ext(xx+347,yy+379,string_hash_to_newline(string(trade_mine[1])),-1,136); + draw_set_alpha(1); if (trade_mine[1]!="") then draw_line(xx+342,yy+422,xx+485,yy+422); if (scr_hit(xx+342,yy+371,xx+485,yy+422)=true){ draw_set_color(c_gray);draw_set_alpha(0.15); draw_rectangle(xx+342,yy+371,xx+485,yy+422,0); draw_set_color(38144); } - draw_set_alpha(1); - - if (gene_seed<=0) then draw_set_alpha(0.33);draw_text_ext(xx+347,yy+430,string_hash_to_newline(string(trade_mine[2])),-1,136);draw_set_alpha(1); + + draw_set_alpha(gene_seed_count()1:0.33); + draw_text_ext(xx+347,yy+430,string_hash_to_newline(string(trade_mine[2])),-1,136);draw_set_alpha(1); if (trade_mine[2]!="") then draw_line(xx+342,yy+470,xx+485,yy+470); if (scr_hit(xx+342,yy+422,xx+485,yy+470)=true){ draw_set_color(c_gray);draw_set_alpha(0.15);