From de18d08fe2549c77a115bb730231a8442e44e896 Mon Sep 17 00:00:00 2001 From: Da Fist <144086663+KRdaMystic@users.noreply.github.com> Date: Thu, 16 Jan 2025 06:51:40 +0900 Subject: [PATCH 01/80] feat: Combat overhaul Pt 1 (#352) --- objects/obj_p_assra/Step_0.gml | 174 ++-- .../scr_equipment_struct.gml | 12 +- .../scr_marine_struct/scr_marine_struct.gml | 85 +- scripts/scr_shoot/scr_shoot.gml | 20 +- scripts/scr_weapon/scr_weapon.gml | 853 ++++++++++-------- 5 files changed, 631 insertions(+), 513 deletions(-) diff --git a/objects/obj_p_assra/Step_0.gml b/objects/obj_p_assra/Step_0.gml index cf0fe5a32b..87248869e1 100644 --- a/objects/obj_p_assra/Step_0.gml +++ b/objects/obj_p_assra/Step_0.gml @@ -67,8 +67,8 @@ if (boarding=true) and (board_cooldown>=0) and (instance_exists(target)) and (in board_cooldown-=1; if (board_cooldown=0){board_cooldown=60; - var o,challenge,difficulty,roll1,roll2,attack,arp,wep,ac,dr,co,i,hits,hurt,damaged_ship; - o=firstest-1;difficulty=50;challenge=0;roll1=0;roll2=0;attack=0;arp=0;wep="";hits=0;hurt=0;damaged_ship=0; + var o,challenge,boarding_odds,boarding_difficulty,boarding_advantage,boarding_disadvantage,gear_bonus,marine_bonus,outcome_roll,damage_roll,attack,arp,wep,ac,dr,co,i,hits,hurt,damaged_ship,bridge_damage; + o=firstest-1;boarding_odds=0;challenge=0;outcome_roll=0;damage_roll=0;attack=0;arp=0;wep="";hits=0;hurt=0;damaged_ship=0;bridge_damage=1; co=0;i=0;ac=0;dr=1; for (var o=0;o=0) and (instance_exists(target)) and (in co=origin.board_co[o]; i=origin.board_id[o]; - difficulty=50; ac=0; dr=1; unit=fetch_unit([co,i]); + gear_bonus=0; + marine_bonus=0; + boarding_odds=50; + boarding_advantage=0; + boarding_disadvantage=0; if (unit.hp()>0){ // Bonuses - difficulty+=unit.experience/20; - difficulty+=(1-(target.hp/target.maxhp))*33; - //TODO define tag for bording weapons - if (array_contains(["Chainfist","Meltagun","Lascutter","Boarding Shield"], unit.weapon_one())) then difficulty+=3; - if (array_contains(["Chainfist","Meltagun","Lascutter","Boarding Shield"], unit.weapon_two())) then difficulty+=3; + marine_bonus+=unit.experience/20; + marine_bonus+=(1-(target.hp/target.maxhp))*33; // if wounded marine will perform worse - if (scr_has_adv("Boarders")) then difficulty+=7; - if (scr_has_adv("Assault Doctrine")) then difficulty+=3; - if (scr_has_adv("Lightning Warriors")) then difficulty+=3; + var _weapons = [unit.get_weapon_one_data(), unit.get_weapon_two_data()]; + if (_weapons[0] == "" && _weapons[1] == "") { + gear_bonus -= 10; + } else { + for (var i = 0; i <= 1; i++) { + var _weapon = _weapons[i]; + if (!is_struct(_weapon)) then break + + if (_weapon.has_tag("boarding 1")) { + gear_bonus += 2; + bridge_damage = max(bridge_damage, 3); + } else if (_weapon.has_tag("boarding 2")) { + gear_bonus += 4; + bridge_damage = max(bridge_damage, 5); + } else if (_weapon.has_tag("boarding 3")) { + gear_bonus += 6; + bridge_damage = max(bridge_damage, 7); + } + } + } + if (scr_has_adv("Boarders")) then marine_bonus+=7; + if (scr_has_adv("Assault Doctrine")) then marine_bonus+=3; + if (scr_has_adv("Lightning Warriors")) then marine_bonus+=3; + + boarding_advantage+=(gear_bonus+marine_bonus) // Penalties - if (unit.weapon_one()=="")then difficulty-=10; - if (unit.weapon_two()=="")then difficulty-=10; if (unit.base_group == "astartes"){ - if (unit.gene_seed_mutations.occulobe==1) then difficulty-=5; + if (unit.gene_seed_mutations.occulobe==1) then boarding_disadvantage-=5; } - if (target.owner = eFACTION.Imperium) or ((target.owner = eFACTION.Chaos) and (obj_fleet.csm_exp=0)) then difficulty-=0;// Cultists/Pirates/Humans - if (target.owner = eFACTION.Player) or (target.owner = eFACTION.Ecclesiarchy) or (target.owner = eFACTION.Ork) or (target.owner = eFACTION.Eldar) or (target.owner = eFACTION.Necrons) then difficulty-=10; - if (target.owner = eFACTION.Chaos) and (obj_fleet.csm_exp=1) then difficulty-=20;// Veteran marines - if ((target.owner = eFACTION.Chaos) and (obj_fleet.csm_exp=2)) or (target.owner = eFACTION.Tyranids) then difficulty-=30;// Daemons, veteran CSM, tyranids - - roll1=floor(random(100))+1; + if (target.owner = eFACTION.Imperium) or ((target.owner = eFACTION.Chaos) and (obj_fleet.csm_exp=0)) then boarding_disadvantage-=0;// Cultists/Pirates/Humans + if (target.owner = eFACTION.Player) or (target.owner = eFACTION.Ecclesiarchy) or (target.owner = eFACTION.Ork) or (target.owner = eFACTION.Eldar) or (target.owner = eFACTION.Necrons) then boarding_disadvantage-=10; + if (target.owner = eFACTION.Chaos) and (obj_fleet.csm_exp=1) then boarding_disadvantage-=20;// Veteran marines + if ((target.owner = eFACTION.Chaos) and (obj_fleet.csm_exp=2)) or (target.owner = eFACTION.Tyranids) then boarding_disadvantage-=30;// Daemons, veteran CSM, tyranids + + boarding_odds+=boarding_advantage+boarding_disadvantage; + boarding_odds=clamp(boarding_odds,0,100); + outcome_roll=floor(random(100))+1; - if (roll1<=difficulty){// Success + if (outcome_roll<=boarding_odds){// Success if (damage=true) and (steal=false){// Damaging var to_bomb;to_bomb=false; if (plasma_bomb=true) and (obj_ini.gear[co][i]="Plasma Bomb") then to_bomb=true; @@ -124,39 +147,12 @@ if (boarding=true) and (board_cooldown>=0) and (instance_exists(target)) and (in obj_ini.gear[co][i]=""; } } + if (steal=true) and (damage=false){// Stealing - var bridge_damage=0; damaged_ship=max(1,damaged_ship); - - var we,whi,we1,we2;we=""; - we1=unit.weapon_one(); - we2=unit.weapon_two(); - whi=0; - - bridge_damage=3; - //TODO tagging system to slove this - we="Heavy Thunder Hammer"; - if (we1=we) or (we2=we) then bridge_damage=max(bridge_damage,8); - we="Eviscerator"; - if (we1=we) or (we2=we) then bridge_damage=max(bridge_damage,7); - we="Chainfist"; - if (we1=we) or (we2=we) then bridge_damage=max(bridge_damage,7); - we="Lascutter"; - if (we1=we) or (we2=we) then bridge_damage=max(bridge_damage,7); - we="Meltagun"; - if (we1=we) or (we2=we) then bridge_damage=max(bridge_damage,7); - we="Power Fist"; - if (we1=we) or (we2=we) then bridge_damage=max(bridge_damage,6); - we="Thunder Hammer"; - if (we1=we) or (we2=we) then bridge_damage=max(bridge_damage,6); - we="Plasma Gun"; - if (we1=we) or (we2=we) then bridge_damage=max(bridge_damage,5); - we="Relic Blade"; - if (we1=we) or (we2=we) then bridge_damage=max(bridge_damage,4); - if (string_pos("&",string(obj_ini.wep1[co][i])+string(obj_ini.wep2[co][i]))>0) then bridge_damage=9; - target.bridge-=bridge_damage; } + if ((target.hp<=0) or (target.bridge<=0)){ var husk=instance_create(target.x,target.y,obj_en_husk); @@ -196,67 +192,67 @@ if (boarding=true) and (board_cooldown>=0) and (instance_exists(target)) and (in } - if (roll1>difficulty){// FAILURE + if (outcome_roll>boarding_odds){// FAILURE ac=unit.armour_calc() dr = unit.damage_resistance()/100 - roll2=floor(random(100))+1; + damage_roll=floor(random(100))+1; //TODO streamline enemy weapons if (target.owner = eFACTION.Imperium) or (target.owner = eFACTION.Chaos) or (target.owner = eFACTION.Ecclesiarchy){ // Make worse for CSM wep="Lasgun"; hits=1; - if (roll2<=90) then hits=2; - if (roll2<=75) then hits=3; - if (roll2<=50){wep="Bolt Pistol";hits=1;} - if (roll2<=40){wep="Bolter";hits=1;} - if (roll2<=30){wep="Bolter";hits=2;} - if (roll2<=20){wep="Heavy Bolter";hits=1;} - if (roll2<=10){wep="Plasma Pistol";hits=1;} - if (roll2<=5){wep="Meltagun";hits=1;} + if (damage_roll<=90) then hits=2; + if (damage_roll<=75) then hits=3; + if (damage_roll<=50){wep="Bolt Pistol";hits=1;} + if (damage_roll<=40){wep="Bolter";hits=1;} + if (damage_roll<=30){wep="Bolter";hits=2;} + if (damage_roll<=20){wep="Heavy Bolter";hits=1;} + if (damage_roll<=10){wep="Plasma Pistol";hits=1;} + if (damage_roll<=5){wep="Meltagun";hits=1;} } if (target.owner = eFACTION.Eldar){ wep="Shuriken Pistol";hits=1; - if (roll2<=90) then hits=2; - if (roll2<=75) then hits=3; - if (roll2<=60){wep="Shuriken Catapult";hits=2;} - if (roll2<=50){wep="Shuriken Catapult";hits=3;} - if (roll2<=40){wep="Shuriken Catapult";hits=4;} - if (roll2<=30){wep="Wraith Cannon";hits=1;} - if (roll2<=20){wep="Singing Spear";hits=1;} - if (roll2<=10){wep="Meltagun";hits=1;} + if (damage_roll<=90) then hits=2; + if (damage_roll<=75) then hits=3; + if (damage_roll<=60){wep="Shuriken Catapult";hits=2;} + if (damage_roll<=50){wep="Shuriken Catapult";hits=3;} + if (damage_roll<=40){wep="Shuriken Catapult";hits=4;} + if (damage_roll<=30){wep="Wraith Cannon";hits=1;} + if (damage_roll<=20){wep="Singing Spear";hits=1;} + if (damage_roll<=10){wep="Meltagun";hits=1;} } if (target.owner = eFACTION.Ork){ wep="Shoota";hits=1; - if (roll2<=90) then hits=2; - if (roll2<=75) then hits=3; - if (roll2<=60) then hits=4; - if (roll2<=50){wep="Dakkagun";hits=1;} - if (roll2<=40){wep="Big Shoota";hits=1;} - if (roll2<=30){wep="Big Shoota";hits=2;} - if (roll2<=15){wep="Rokkit";hits=1;} + if (damage_roll<=90) then hits=2; + if (damage_roll<=75) then hits=3; + if (damage_roll<=60) then hits=4; + if (damage_roll<=50){wep="Dakkagun";hits=1;} + if (damage_roll<=40){wep="Big Shoota";hits=1;} + if (damage_roll<=30){wep="Big Shoota";hits=2;} + if (damage_roll<=15){wep="Rokkit";hits=1;} } if (target.owner = eFACTION.Tau){ wep="Pulse Rifle";hits=1; - if (roll2<=80) then hits=2; - if (roll2<=65) then hits=3; - if (roll2<=50) then hits=4; - if (roll2<=40){wep="Missile Pod";hits=1;} - if (roll2<=30){wep="Burst Rifle";hits=1;} - if (roll2<=15){wep="Meltagun";hits=1;} + if (damage_roll<=80) then hits=2; + if (damage_roll<=65) then hits=3; + if (damage_roll<=50) then hits=4; + if (damage_roll<=40){wep="Missile Pod";hits=1;} + if (damage_roll<=30){wep="Burst Rifle";hits=1;} + if (damage_roll<=15){wep="Meltagun";hits=1;} } if (target.owner = eFACTION.Tyranids){ wep="Flesh Hooks";hits=1; - if (roll2<=90) then hits=2; - if (roll2<=75) then hits=3; - if (roll2<=60){wep="Devourer";hits=2;} - if (roll2<=50){wep="Devourer";hits=3;} - if (roll2<=40){wep="Devourer";hits=4;} - if (roll2<=30){wep="Venom Cannon";hits=1;} - if (roll2<=20){wep="Lictor Claws";hits=1;} - if (roll2<=10){wep="Zoanthrope Blast";hits=1;} + if (damage_roll<=90) then hits=2; + if (damage_roll<=75) then hits=3; + if (damage_roll<=60){wep="Devourer";hits=2;} + if (damage_roll<=50){wep="Devourer";hits=3;} + if (damage_roll<=40){wep="Devourer";hits=4;} + if (damage_roll<=30){wep="Venom Cannon";hits=1;} + if (damage_roll<=20){wep="Lictor Claws";hits=1;} + if (damage_roll<=10){wep="Zoanthrope Blast";hits=1;} } if (wep="Lasgun"){attack=25;arp=0;} diff --git a/scripts/scr_equipment_struct/scr_equipment_struct.gml b/scripts/scr_equipment_struct/scr_equipment_struct.gml index 72e92c728d..61f4a19bb3 100644 --- a/scripts/scr_equipment_struct/scr_equipment_struct.gml +++ b/scripts/scr_equipment_struct/scr_equipment_struct.gml @@ -173,11 +173,17 @@ function EquipmentStruct(item_data, core_type,quality="none") constructor{ array_push(special_properties_array, special_properties[k]); } } - if (arp>0){ - array_push(special_properties_array, "Armour Piercing") + if (arp=1){ + array_push(special_properties_array, "Anti Vehicle") } - else if (arp<0){ + else if (arp=0){ array_push(special_properties_array, "Low Penetration") + } + else if (arp=-1){ + array_push(special_properties_array, "Medium Penetration") + } + else if (arp=-2){ + array_push(special_properties_array, "High Penetration") } if (array_length(second_profiles)>0){ for (var h = 0; h < array_length(second_profiles); h++) { diff --git a/scripts/scr_marine_struct/scr_marine_struct.gml b/scripts/scr_marine_struct/scr_marine_struct.gml index eb488b38fc..7c7db6ca23 100644 --- a/scripts/scr_marine_struct/scr_marine_struct.gml +++ b/scripts/scr_marine_struct/scr_marine_struct.gml @@ -1406,16 +1406,19 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data={}) carry_string+=$"{mobility_item()}: {format_number_with_sign(mobility_carry)}#"; } return [melee_carrying,melee_hands_limit,carry_string] - } + } + static melee_attack = function(weapon_slot=0){ + var _format_sign = function(_num) { + _num = format_number_with_sign(round(_num)); + return _num; + } + encumbered_melee=false; - melee_att = 100*(((weapon_skill/100) * (strength/20)) + (experience/1000)+0.1); - var explanation_string = string_concat("#Stats: ", format_number_with_sign(round(((melee_att/100)-1)*100)), "%#"); - explanation_string += " Base: +10%#"; - explanation_string += string_concat(" WSxSTR: ", format_number_with_sign(round((((weapon_skill/100)*(strength/20))-1)*100)), "%#"); - explanation_string += string_concat(" EXP: ", format_number_with_sign(round((experience/1000)*100)), "%#"); + var _melee_mod = 1; + var explanation_string = ""; - melee_carrying = melee_hands_limit(); + var melee_carrying = melee_hands_limit(); var _wep1 = get_weapon_one_data(); var _wep2 = get_weapon_two_data(); if (!is_struct(_wep1)) then _wep1 = new EquipmentStruct({},""); @@ -1452,7 +1455,7 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data={}) secondary_weapon=highest; } else { primary_weapon=highest; - melee_att*=0.5; + _melee_mod += 0.5; if (primary_weapon.has_tag("flame")){ explanation_string+=$"Primary is Flame: -50%#" } else if primary_weapon.has_tag("pistol"){ @@ -1469,19 +1472,53 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data={}) primary_weapon=_wep2; } }; + var basic_wep_string = $"{primary_weapon.name}: {primary_weapon.attack}#"; + explanation_string = basic_wep_string + explanation_string; + + _melee_mod += (weapon_skill / 100) + (experience / 500); + explanation_string += $"#Stats:#"; + explanation_string += $" WS: {_format_sign((weapon_skill / 100) * 100)}%#"; + explanation_string += $" EXP: {_format_sign((experience / 500) * 100)}%#"; + + if (primary_weapon.has_tag("martial") || primary_weapon.has_tag("savage")) { + var bonus_modifier = 0; + var martial_bonus = 0; + var savage_bonus = 0; + + if (primary_weapon.has_tag("martial")) { + martial_bonus = dexterity / 100; + } + if (primary_weapon.has_tag("savage")) { + savage_bonus = strength / 100; + } + + bonus_modifier = martial_bonus + savage_bonus; + _melee_mod += bonus_modifier; + + if (martial_bonus != 0) { + explanation_string += $" DEX (Martial): {_format_sign(martial_bonus * 100)}%#"; + } + if (savage_bonus != 0) { + explanation_string += $" STR (Savage): {_format_sign(savage_bonus * 100)}%#"; + } + } else { + _melee_mod += (strength / 200) + (dexterity / 200); + explanation_string += $" STR: {_format_sign((strength / 200) * 100)}%#"; + explanation_string += $" DEX: {_format_sign((dexterity / 200) * 100)}%#"; + } + if IsSpecialist("libs") or has_trait("warp_touched"){ - if (primary_weapon.has_tag("force") ||_wep2.has_tag("force")){ - var force_modifier = (((weapon_skill/100) * (psionic/10) * (intelligence/10)) + (experience/1000)+0.1); - primary_weapon.attack *= force_modifier; - basic_wep_string += $"Active Force Weapon: x{force_modifier}# Base: 0.10# WSxPSIxINT: x{(weapon_skill/100)*(psionic/10)*(intelligence/10)}# EXP: x{experience/1000}#"; + if (primary_weapon.has_tag("force")){ + var force_modifier = (psionic * 3) * (intelligence/40); + _melee_mod += force_modifier / 100; + explanation_string += $" PSYxINT (Force): {_format_sign(force_modifier)}%#"; } - }; - explanation_string = basic_wep_string + explanation_string + } if (melee_carrying[0]>melee_carrying[1]){ encumbered_melee=true; - melee_att*=0.6; + _melee_mod*=0.6; explanation_string+=$"Encumbered: x0.6#" } if (!encumbered_melee){ @@ -1491,23 +1528,24 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data={}) total_gear_mod+=get_mobility_data("melee_mod"); total_gear_mod+=_wep1.melee_mod; total_gear_mod+=_wep2.melee_mod; - melee_att+=total_gear_mod; - explanation_string+=$"#Gear Mod: {(total_gear_mod/100)*100}%#"; + total_gear_mod/=100; + _melee_mod += total_gear_mod; + explanation_string+=$"#Gear Mod: {_format_sign(total_gear_mod * 100)}%#"; //TODO make trait data like this more structured to be able to be moddable if (has_trait("feet_floor") && mobility_item()!=""){ - melee_att*=0.9; + _melee_mod*=0.9; explanation_string+=$"{global.trait_list.feet_floor.display_name}: x0.9#"; } if (primary_weapon.has_tag("fist") && has_trait("brawler")){ - melee_att*=1.1; + _melee_mod*=1.1; explanation_string+=$"{global.trait_list.brawler.display_name}: x1.1#"; } if (primary_weapon.has_tag("power") && has_trait("duelist")){ - melee_att*=1.3; + _melee_mod*=1.3; explanation_string+=$"{global.trait_list.duelist.display_name}: x1.3#"; } } - var final_attack = floor((melee_att/100)*primary_weapon.attack); + var final_attack = floor((_melee_mod)*primary_weapon.attack); if (secondary_weapon!="none" && !encumbered_melee){ var side_arm_data="Standard: x0.5"; var secondary_modifier = 0.5; @@ -1525,12 +1563,13 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data={}) secondary_modifier = 0.3; side_arm_data="Flame: x0.3"; } - var side_arm = floor(secondary_modifier*((melee_att/100)*secondary_weapon.attack)); + var side_arm = floor(secondary_modifier*(_melee_mod*secondary_weapon.attack)); if (side_arm>0){ final_attack+=side_arm; - explanation_string+=$"Side Arm: +{side_arm}({side_arm_data})#"; + explanation_string+=$"Side Arm: +{side_arm} ({side_arm_data})#"; } } + melee_damage_data=[final_attack,explanation_string,melee_carrying,primary_weapon, secondary_weapon]; return melee_damage_data; }; diff --git a/scripts/scr_shoot/scr_shoot.gml b/scripts/scr_shoot/scr_shoot.gml index aebcff4458..49c90ac9cd 100644 --- a/scripts/scr_shoot/scr_shoot.gml +++ b/scripts/scr_shoot/scr_shoot.gml @@ -252,23 +252,28 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat if (weapon_index_position = -52) { wii = "Missile Launcher Emplacement"; at = 200; - armour_pierce = 1; + armour_pierce = -1; } if (weapon_index_position = -53) { wii = "Missile Silo"; at = 250; - ar = 0; + armour_pierce = 0; } } target_armour_value = target_object.dudes_ac[target_type]; + // Calculate final armor value based on armor piercing (AP) rating against target type if (target_object.dudes_vehicle[target_type]) { + if (armour_pierce = 1) then target_armour_value = 0; if (armour_pierce = 0) then target_armour_value = target_armour_value * 6; - if (armour_pierce = -1) then target_armour_value = damage_per_weapon; + if (armour_pierce = -1) then target_armour_value = target_armour_value * 4 ; + if (armour_pierce = -2) then target_armour_value = target_armour_value * 2; } else { if (armour_pierce = 1) then target_armour_value = 0; - if (armour_pierce = -1) then target_armour_value = target_armour_value * 6; + if (armour_pierce = 0) then target_armour_value = target_armour_value * 4; + if (armour_pierce = -1) then target_armour_value = target_armour_value * 3; + if (armour_pierce = -2) then target_armour_value = target_armour_value * 1.5; } attack_count_mod = max(1, splash[weapon_index_position]); @@ -358,11 +363,14 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat target_armour_value2 = target_object.dudes_ac[godd]; if (target_object.dudes_vehicle[godd] = 0) { if (ap2 = 1) then target_armour_value2 = 0; - if (ap2 = -1) then target_armour_value2 = target_armour_value2 * 6; + if (ap2 = 0) then target_armour_value2 = target_armour_value2 * 4; + if (ap2 = -1) then target_armour_value2 = target_armour_value2 * 3; + if (ap2 = -2) then target_armour_value2 = target_armour_value2 * 1.5; } if (target_object.dudes_vehicle[godd] = 1) { if (ap2 = 0) then target_armour_value2 = target_armour_value2 * 6; - if (ap2 = -1) then target_armour_value2 = damage_per_weapon; + if (ap2 = -1) then target_armour_value2 = target_armour_value2 * 4; + if (ap2 = -2) then target_armour_value2 = target_armour_value2 * 2; } b2 = a2 - target_armour_value2; if (b2 <= 0) then b2 = 0; // Average after armour diff --git a/scripts/scr_weapon/scr_weapon.gml b/scripts/scr_weapon/scr_weapon.gml index 2f5a9b534c..2be38fdafb 100644 --- a/scripts/scr_weapon/scr_weapon.gml +++ b/scripts/scr_weapon/scr_weapon.gml @@ -48,17 +48,19 @@ global.weapons = { "melee_hands": 0, "ranged_hands": 0.5, "ammo": 30, - "range": 3.1, - "spli": 1, + + "range": 4.1, + "spli": 0, "arp": 0, "tags": ["pistol", "ancient", "las", "energy"], }, + "Combat Knife": { "abbreviation": "CbKnf", "attack": { - "standard": 25, - "master_crafted": 30, - "artifact": 35 + "standard": 50, + "master_crafted": 75, + "artifact": 100 }, "description": "More of a sword than a knife, this tough and thick blade becomes a deadly weapon in the hand of an Astartes.", "melee_hands": 0, @@ -72,9 +74,9 @@ global.weapons = { "Chainsword": { "abbreviation": "ChSwrd", "attack": { - "standard": 50, - "master_crafted": 60, - "artifact": 70 + "standard": 130, + "master_crafted": 150, + "artifact": 200 }, "description": "A standard Chainsword. It is popular among Assault Marines due to their raw power while maintaining speed.", "melee_hands": 1, @@ -83,14 +85,14 @@ global.weapons = { "range": 1, "spli": 4, "arp": 0, - "tags": ["chain", "sword"], + "tags": ["chain", "sword","savage", "boarding 1"], }, "Chainaxe": { "abbreviation": "ChAxe", "attack": { - "standard": 90, - "master_crafted": 100, - "artifact": 110 + "standard": 110, + "master_crafted": 130, + "artifact": 150 }, "melee_mod": { "standard": 5, @@ -104,7 +106,7 @@ global.weapons = { "range": 1, "spli": 6, "arp": 0, - "tags": ["chain", "axe", "dual"], + "tags": ["chain", "axe", "dual", "savage", "boarding 2"], }, "Company Standard": { "abbreviation": "CmpStnd", @@ -129,9 +131,9 @@ global.weapons = { "Eviscerator": { "abbreviation": "Evisc", "attack": { - "standard": 180, - "master_crafted": 190, - "artifact": 200 + "standard": 260, + "master_crafted": 290, + "artifact": 330 }, "melee_mod": { "standard": 2, @@ -143,16 +145,16 @@ global.weapons = { "ranged_hands": 1, "ammo": 0, "range": 1, - "spli": 3, - "arp": 1, - "tags": ["chain", "sword"], + "spli": 6, + "arp": -1, + "tags": ["chain", "sword", "savage"], }, "Power Sword": { "abbreviation": "PwrSwrd", "attack": { - "standard": 180, - "master_crafted": 200, - "artifact": 240 + "standard": 225, + "master_crafted": 260, + "artifact": 300 }, "melee_mod": { "standard": 1, @@ -165,16 +167,16 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 4, - "arp": 1, + "arp": -1, "special_properties": ["Parry"], - "tags": ["power", "sword"], + "tags": ["power", "sword", "martial", "boarding 1"], }, "Power Spear": { "abbreviation": "PwrSpear", "attack": { - "standard": 200, - "master_crafted": 220, - "artifact": 260 + "standard": 300, + "master_crafted": 375, + "artifact": 450 }, "melee_mod": { "standard": 1, @@ -187,9 +189,9 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 6, - "arp": 1, + "arp": -1, "special_properties": ["Parry"], - "tags": ["power", "spear"], + "tags": ["power", "spear", "martial"], }, "Chainfist": { "abbreviation": "ChFst", @@ -199,12 +201,12 @@ global.weapons = { "artifact": 700 }, "description": "Created by mounting a chainsword to a power fist, this weapon is easily able to carve through armoured bulkheads.", - "melee_hands": 1.25, - "ranged_hands": 1, + "melee_hands": 3, + "ranged_hands": 0, "range": 1, - "spli": 2, - "arp": 1, - "tags": ["power","boarding", "chain", "fist", "dual", "siege"], + "spli": 4, + "tags": ["power","boarding 3", "chain", "fist", "dual", "siege", "savage"], + "arp": -2, }, "Lascutter": { "abbreviation": "Lasct", @@ -237,15 +239,15 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 3, - "arp": 1, + "arp": -2, "tags": ["power"], }, "Power Axe": { "abbreviation": "PwrAxe", "attack": { - "standard": 190, - "master_crafted": 220, - "artifact": 260 + "standard": 200, + "master_crafted": 225, + "artifact": 300 }, "melee_mod": { "standard": 1, @@ -258,15 +260,15 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 5, - "arp": 1, - "tags": ["power", "axe", "dual"], + "arp": -1, + "tags": ["power", "axe", "dual","savage", "boarding 2"], }, "Executioner Power Axe": { "abbreviation": "ExPwrAxe", "attack": { - "standard": 300, - "master_crafted": 350, - "artifact": 400 + "standard": 800, + "master_crafted": 850, + "artifact": 925 }, "melee_mod": { "standard": 10, @@ -280,7 +282,7 @@ global.weapons = { "range": 1, "spli": 2, "arp": 1, - "tags": ["power", "axe"], + "tags": ["power", "axe", "martial"], }, "Power Fist": { "abbreviation": "PwrFst", @@ -300,8 +302,8 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 2, - "arp": 1, - "tags": ["power", "dual", "fist"], + "tags": ["power", "dual", "fist", "savage", "boarding 2"], + "arp": -2, }, "Power Fists": { "abbreviation": "PwrFsts", @@ -316,8 +318,8 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 4, - "arp": 1, - "tags": ["power", "fist", "pair"], + "tags": ["power", "fist", "pair","savage" ,"boarding 2"], + "arp": -2, }, "Servo-arm(M)": { "abbreviation": "MchArm", @@ -332,7 +334,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 2, - "arp": 1, + "arp": -2, "tags": ["siege"], }, "Boltstorm Gauntlet": { @@ -348,9 +350,9 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 2, - "arp": 1, + "arp": -2, "second_profiles": ["Integrated Bolter"], - "tags": ["power", "fist"], + "tags": ["power", "fist", "savage", "boarding 2"], }, "Assault Chainfist": { "abbreviation": "AssltChFst", @@ -364,7 +366,7 @@ global.weapons = { "ranged_hands": 1, "range": 1, "spli": 2, - "arp": 1, + "arp": -2, "second_profiles": ["Assault Cannon"], "tags": ["power","boarding", "chain", "fist", "dual", "siege"], }, @@ -381,8 +383,8 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 5, - "arp": 1, - "tags": ["power", "dual", "fist"], + "tags": ["power", "dual", "fist", "boarding 2", "martial"], + "arp": -1, }, "Dreadnought Lightning Claw": { "abbreviation": "LghtClw", @@ -402,7 +404,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 15, - "arp": 1, + "arp": -2, "maintenance" : 0.1, "tags": ["power", "vehicle", "dual", "dreadnought", "fist"], }, @@ -424,17 +426,17 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 10, - "arp": 1, - "tags": ["power", "hammer", "siege"], + "arp": -2, "maintenance" : 0.1, "req_exp": 100, + "tags": ["power", "hammer", "siege", "savage", "boarding 2"], }, "Heavy Thunder Hammer": { "abbreviation": "HvyThndHmr", "attack": { - "standard": 975, - "master_crafted": 1125, - "artifact": 1350, + "standard": 800, + "master_crafted": 950, + "artifact": 1100, }, "melee_mod": { "standard": 1.3, @@ -446,11 +448,11 @@ global.weapons = { "ranged_hands": 2, "ammo": 0, "range": 1, + "arp": -2, "spli": 15, - "arp": 1, - "tags": ["heavy_melee", "power", "hammer", "siege"], - "maintenance" : 0.1, + "maintenance" : 0.1, "req_exp": 100, + "tags": ["heavy_melee", "power", "hammer", "siege", "savage"], }, "Power Mace": { "abbreviation": "PwrMace", @@ -469,9 +471,9 @@ global.weapons = { "ranged_hands": 2, "ammo": 0, "range": 1, + "arp": -2, "spli": 10, - "arp": 1, - "tags": ["power", "mace", "siege"], + "tags": ["power", "mace", "siege", "savage"], "req_exp": 100, }, "Mace of Absolution": { @@ -493,8 +495,8 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 10, - "arp": 1, - "tags": ["power", "mace", "siege", "pious"], + "arp": -2, + "tags": ["power", "mace", "siege", "pious", "savage"], "req_exp": 100, }, "Tome": { @@ -516,14 +518,14 @@ global.weapons = { "range": 1, "spli": 1, "arp": 0, - "tags": ["arcane"], + "tags": ["arcane", "savage"], }, "Crozius Arcanum": { "abbreviation": "Crzus", "attack": { - "standard": 220, + "standard": 200, "master_crafted": 250, - "artifact": 300 + "artifact": 325 }, "melee_mod": { "standard": 1, @@ -536,15 +538,15 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 4, - "arp": 1, - "tags": ["power", "mace", "pious"], + "arp": -1, + "tags": ["power", "mace", "pious", "savage", "boarding 2"], }, "Relic Blade": { "abbreviation": "RlcBld", "attack": { - "standard": 700, - "master_crafted": 850, - "artifact": 1000 + "standard": 850, + "master_crafted": 950, + "artifact": 1100 }, "melee_mod": { "standard": 1, @@ -557,26 +559,43 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 8, - "arp": 1, + "arp": -1, "special_properties": ["Parry"], - "maintenance" : 0.1, - "tags": ["power", "sword"], + "maintenance" : 0.1, + "tags": ["power", "sword", "martial"], + }, "Bolt Pistol": { "abbreviation": "BltPstl", "attack": { - "standard": 30, - "master_crafted": 35, - "artifact": 40 + "standard": 100, + "master_crafted": 120, + "artifact": 150 }, "description": "A smaller, more compact version of the venerable Boltgun. This model is produced in the standard Godwyn pattern.", "melee_hands": 0, "ranged_hands": 1, "ammo": 18, - "range": 3.1, - "spli": 1, + "range": 4.1, + "spli": 3, + "arp": 0, + "tags": ["bolt", "pistol", "boarding 1"], + }, + "Wrist-Mounted Storm Bolter": { // TODO: Not used outside of this file atm; + "abbreviation": "WrstBlt", + "attack": { + "standard": 200, + "master_crafted": 240, + "artifact": 300 + }, + "description": "A smaller, more compact version of the venerable Boltgun. This model is produced in the standard Godwyn pattern.", + "melee_hands": 0, + "ranged_hands": 1, + "ammo": 18, + "range": 4.1, + "spli": 6, "arp": 0, - "tags": ["bolt", "pistol"], + "tags": ["bolt", "pistol", "boarding 2"], }, "Webber": { "abbreviation": "Webbr", @@ -597,32 +616,49 @@ global.weapons = { "Grav-Pistol": { "abbreviation": "GrvPstl", "attack": { - "standard": 150, - "master_crafted": 200, - "artifact": 250 + "standard": 300, + "master_crafted": 350, + "artifact": 425 }, "description": "A smaller version of the Grav-Gun which utilises the gravitic reaction principle most commonly seen powering grav-vehicles such as the Land Speeder.", "melee_hands": 0, "ranged_hands": 1, "ammo": 4, - "range": 2.1, + "range": 4.1, "spli": 1, "arp": 1, + "maintenance" : 0.8, "tags": ["grav", "pistol"], "maintenance" : 0.8, }, + "Integrated-Grav": { + "abbreviation": "IntGrv", + "attack": { + "standard": 500, + "master_crafted": 550, + "artifact": 625 + }, + "description": "", + "melee_hands": 0, + "ranged_hands": 0, + "ammo": 3, + "range": 5.1, + "spli": 1, + "arp": 1, + "tags": ["grav"] + }, "Grav-Gun": { "abbreviation": "GrvGn", "attack": { - "standard": 450, - "master_crafted": 475, - "artifact": 500 + "standard": 500, + "master_crafted": 550, + "artifact": 625 }, "description": "A medium-sized weapon which utilises the gravitic reaction principle most commonly seen powering grav-vehicles such as the Land Speeder.", "melee_hands": 1, "ranged_hands": 2, - "ammo": 4, - "range": 4, + "ammo": 6, + "range": 5, "spli": 3, "arp": 1, "tags": ["grav"], @@ -633,13 +669,13 @@ global.weapons = { "attack": { "standard": 800, "master_crafted": 850, - "artifact": 900 + "artifact": 960 }, "description": "A bigger version of the Grav-Gun which utilises the gravitic reaction principle most commonly seen powering grav-vehicles such as the Land Speeder.", "melee_hands": 1, "ranged_hands": 2, "ammo": 8, - "range": 8, + "range": 6, "spli": 6, "arp": 1, "tags": ["grav", "heavy_weapon"], @@ -648,9 +684,9 @@ global.weapons = { "Underslung Bolter": { "abbreviation": "UndBltr", "attack": { - "standard": 60, - "master_crafted": 70, - "artifact": 80 + "standard": 100, + "master_crafted": 125, + "artifact": 150 }, "description": "A compact, secondary Bolter weapon often attached under the barrel of a larger firearm. It allows for rapid fire in close quarters combat.", "melee_hands": 0, @@ -664,34 +700,34 @@ global.weapons = { "Stalker Pattern Bolter": { "abbreviation": "StlkBltr", "attack": { - "standard": 100, - "master_crafted": 110, - "artifact": 120 + "standard": 180, + "master_crafted": 200, + "artifact": 240 }, "description": "The Stalker Bolter is a scoped long-range variant of the standard Bolter. Depending on the specific modifications made by the wielder, the Stalker Bolter can serve as a precision battle rifle or a high-powered sniper weapon.", "melee_hands": 0, "ranged_hands": 2, "ammo": 20, - "range": 15, - "spli": 1, - "arp": 1, + "range": 16, + "spli": 3, + "arp": -1, "tags": ["bolt", "precision"] }, "Bolter": { "abbreviation": "Bltr", "attack": { - "standard": 50, - "master_crafted": 55, - "artifact": 60 + "standard": 150, + "master_crafted": 175, + "artifact": 200 }, "description": "A standard Bolter, a two-handed firearm that launches rocket propelled projectiles that detonate after penetrating the target. It is a versatile and iconic weapon of Adeptus Astartes, their resounding detonations carry the Emperor's Wrath.", "melee_hands": 1, "ranged_hands": 2, "ammo": 16, - "range": 12, - "spli": 3, + "range": 10, + "spli": 5, "arp": 0, - "tags": ["bolt"] + "tags": ["bolt", "boarding 1"] }, "Heavy Flamer": { "abbreviation": "HvyFlmr", @@ -705,23 +741,23 @@ global.weapons = { "ranged_hands": 2.25, "ammo": 8, "range": 2, - "spli": 5, + "spli": 20, "arp": -1, - "tags": ["flame", "heavy_ranged"] + "tags": ["flame", "heavy_ranged", "boarding 3"] }, "CCW Heavy Flamer": { "abbreviation": "CCWHvyFlmr", "attack": { - "standard": 250, - "master_crafted": 275, - "artifact": 300 + "standard": 500, + "master_crafted": 550, + "artifact": 600 }, "description": "A powerful close combat weapon integrated with a flamer. Enemeies rarely expect a dreadnough claw to spew promethium.", "melee_hands": 1, "ranged_hands": 0, "ammo": 6, "range": 2.1, - "spli": 5, + "spli": 20, "arp": -1, "tags": ["dreadnought","heavy_ranged", "flame"] }, @@ -758,66 +794,82 @@ global.weapons = { "Inferno Cannon": { "abbreviation": "InfCann", "attack": { - "standard": 400, - "master_crafted": 440, - "artifact": 480 + "standard": 750, + "master_crafted": 875, + "artifact": 1000 }, "description": "A huge vehicle-mounted flame weapon that fires with explosive force. The reservoir is liable to explode.", "melee_hands": 0, "ranged_hands": 3, "ammo": 0, - "range": 3.1, + "range": 4.1, "spli": 20, "arp": -1, "tags": ["vehicle","heavy_ranged", "flame", "dreadnought"] }, + "Integrated-Melta": { + "abbreviation": "IntMlt", + "attack": { + "standard": 400, + "master_crafted": 475, + "artifact": 600 + }, + "description": "", + "melee_hands": 0, + "ranged_hands": 0, + "ammo": 5, + "range": 2.1, + "spli": 1, + "arp": 1, + "tags": ["melta"] + }, "Meltagun": { "abbreviation": "Mltgn", "attack": { - "standard": 450, + "standard": 400, "master_crafted": 475, - "artifact": 500 + "artifact": 600 }, "description": "A loud weapon that roars with fury, this gun vaporizes flesh and armor alike. Due to heat dissipation, it has only a short range.", "melee_hands": 1, "ranged_hands": 2, - "ammo": 4, + "ammo": 6, "range": 2.1, - "spli": 1, - "arp": 1, - "tags": ["melta","boarding"] + "spli": 6, + "arp": -2, + "tags": ["melta","boarding 3"] }, "Multi-Melta": { "abbreviation": "MltMelt", "attack": { - "standard": 800, - "master_crafted": 850, - "artifact": 900 + "standard": 700, + "master_crafted": 800, + "artifact": 950 }, "description": "Though bearing longer range than the Meltagun, this weapon's great size usually restricts it to vehicles though those with Power Armor can carry this cumbersome weapon into battle.", "melee_hands": 1, "ranged_hands": 2.25, "ammo": 8, "range": 4.1, - "spli": 1, - "arp": 1, - "tags": ["melta", "heavy_ranged", "dreadnought"] + "spli": 10, + "arp": -2, + "tags": ["melta", "heavy_ranged", "dreadnought", "boarding 1"] }, "Plasma Pistol": { "abbreviation": "PlsmPstl", "attack": { - "standard": 115, - "master_crafted": 130, - "artifact": 150 + "standard": 250, + "master_crafted": 290, + "artifact": 320 }, "description": "A pistol variant of the plasma gun, this dangerous-to-use weapon has exceptional armor-piercing capabilities.", "melee_hands": 0, "ranged_hands": 1, "ammo": 0, - "range": 3.1, - "spli": 1, - "arp": 1, - "tags": ["plasma", "energy", "pistol"] + "range": 5.1, + "spli": 2, + "arp": -2, + "tags": ["plasma", "energy", "pistol", "boarding 1"] }, "Plasma Cutter": { // Basically a dual-linked plasma pistol "abbreviation": "PlsmCt", @@ -830,17 +882,17 @@ global.weapons = { "melee_hands": 0, "ranged_hands": 0, "ammo": 0, - "range": 3.1, + "range": 4.1, "spli": 1, - "arp": 1, + "arp": -2, "tags": ["plasma", "energy", "pistol"] }, "Infernus Pistol": { "abbreviation": "InfPstl", "attack": { - "standard": 100, - "master_crafted": 110, - "artifact": 120 + "standard": 250, + "master_crafted": 280, + "artifact": 325 }, "description": "The Infernus Pistol is a compact pistol varient of the melta gun. A brutal blast of heat to burn away the The Emperor's foes.", "melee_hands": 0, @@ -848,63 +900,79 @@ global.weapons = { "ammo": 4, "range": 2.1, "spli": 3, - "arp": 1, - "tags": ["melta", "pistol"] + "arp": -2, + "tags": ["melta", "pistol", "boarding 2"] + }, + "Integrated-Plasma": { + "abbreviation": "IntPls", + "attack": { + "standard": 350, + "master_crafted": 400, + "artifact": 475 + }, + "description": "", + "melee_hands": 0, + "ranged_hands": 0, + "ammo": 6, + "range": 10, + "spli": 2, + "arp": -1, + "tags": ["plasma"] }, "Plasma Gun": { "abbreviation": "PlsmGn", "attack": { - "standard": 250, - "master_crafted": 275, - "artifact": 300 + "standard": 350, + "master_crafted": 400, + "artifact": 475 }, "description": "A two-handed weapon that launches blobs of plasma at the target. They are considered both sacred and dangerous, overheating through rapid firing of the weapon. Overheating can result in detonation of the weapon, killing the wielder.", "melee_hands": 0, "ranged_hands": 2, "ammo": 16, - "range": 12, + "range": 10, "spli": 3, - "arp": 1, - "tags": ["plasma", "energy"] + "arp": -2, + "tags": ["plasma", "energy", "boarding 1"] }, "Plasma Cannon": { "abbreviation": "PlsmCan", "attack": { - "standard": 500, - "master_crafted": 600, - "artifact": 750 + "standard": 700, + "master_crafted": 800, + "artifact": 900 }, "description": "A heavy variant of the plasma gun, its power output is significantly higher and its damage capability shows. However, it maintains the overheating risk of the Plasma Gun", "melee_hands": 1, "ranged_hands": 3, "ammo": 16, - "range": 14, - "spli": 2, - "arp": 1, + "range": 10, + "spli": 8, + "arp": -2, "tags": ["plasma","energy","heavy_ranged", "dreadnought"] }, "Sniper Rifle": { "abbreviation": "SnprRfl", "attack": { - "standard": 80, - "master_crafted": 88, - "artifact": 96 + "standard": 120, + "master_crafted": 150, + "artifact": 200 }, "description": "The Sniper Rifle fires a solid shell over long range and boasts powerful telescopic sights to assist, allowing the user to target enemy weak points and distant foes.", "melee_hands": 1, "ranged_hands": 2, "ammo": 20, - "range": 18, + "range": 14, "spli": 1, - "arp": 0, + "arp": -1, "tags": ["precision", "rifle"] }, "Assault Cannon": { "abbreviation": "AssCann", "attack": { - "standard": 240, - "master_crafted": 264, - "artifact": 288 + "standard": 400, + "master_crafted": 440, + "artifact": 500 }, "description": "A heavy rotary autocannon with a devastating fire rate that can be counted in the hundreds per minute. It is incredibly effective against infantry and light armored targets.", "melee_hands": 2.1, @@ -912,39 +980,39 @@ global.weapons = { "ammo": 5, "range": 12, "spli": 20, - "arp": 1, + "arp": 0, "tags": ["heavy_ranged", "dreadnought"] }, "Autocannon": { "abbreviation": "Autocnn", "attack": { - "standard": 380, - "master_crafted": 400, - "artifact": 430 + "standard": 450, + "master_crafted": 500, + "artifact": 600 }, "description": "A rapid-firing weapon able to use a wide variety of ammunition, from mass-reactive explosive to solid shells. It has been found to be incredibly effective against large groups of targets and even Traitor Astartes to an extent.", "melee_hands": 0, "ranged_hands": 2.25, "ammo": 25, - "range": 18, - "spli": 15, - "arp": 1, + "range": 14, + "spli": 12, + "arp": -1, "tags": ["heavy_ranged", "dreadnought"] }, "Missile Launcher": { "abbreviation": "MsslLnch", "attack": { - "standard": 250, - "master_crafted": 275, - "artifact": 300 + "standard": 300, + "master_crafted": 350, + "artifact": 425 }, - "description": "This shoulder mounted weapon is capable of firing either armor-piercing or fragmentation rockets. It's ammunition is limited by what the bearer has carried with them.", + "description": "This shoulder fired weapon is capable of firing either armor-piercing or fragmentation rockets. It's ammunition is limited by what the bearer has carried with them.", "melee_hands": 1, "ranged_hands": 2, "ammo": 6, - "range": 24, - "spli": 3, - "arp": 0, + "range": 15, + "spli": 10, + "arp": -1, "tags": ["heavy_ranged", "dreadnought"] }, "Lascannon": { @@ -958,7 +1026,7 @@ global.weapons = { "melee_hands": 1, "ranged_hands": 2.25, "ammo": 8, - "range": 24, + "range": 20, "spli": 1, "arp": 1, "tags": ["heavy_ranged", "las", "energy"] @@ -979,17 +1047,17 @@ global.weapons = { "arp": 1, "tags": ["heavy_ranged", "ancient"] }, - "Integrated Bolter": { + "Integrated-Bolter": { "abbreviation": "IntgBltr", "attack": { - "standard": 50, - "master_crafted": 55, - "artifact": 60 + "standard": 150, + "master_crafted": 175, + "artifact": 200 }, "description": "A Bolter that can be built directly into the structure of the vehicle, armor, another weapon or Dreadnought. When used as a weapon, it leaves both hands free, allowing to use any, even a twohanded weapon, efficiently.", "melee_hands": 0, "ranged_hands": 0, - "ammo": 20, + "ammo": 8, "range": 12, "spli": 4, "arp": 0, @@ -998,25 +1066,25 @@ global.weapons = { "Twin Linked Heavy Bolter": { "abbreviation": "TwnHvyBltr", "attack": { - "standard": 320, - "master_crafted": 352, - "artifact": 384 + "standard": 450, + "master_crafted": 500, + "artifact": 650 }, "description": "Twin-linked Heavy Bolters are an upgraded version of the standard Heavy Bolter weapon, which is known for its high rate of fire and effectiveness against infantry and light vehicles.", "melee_hands": 0, "ranged_hands": 0, "ammo": 20, "range": 16, - "spli": 9, - "arp": 1, + "spli": 28, + "arp": 0, "tags": ["bolt", "heavy_ranged", "vehicle", "dreadnought"] }, "Twin Linked Lascannon": { "abbreviation": "TwnLascnn", "attack": { - "standard": 600, - "master_crafted": 700, - "artifact": 900 + "standard": 800, + "master_crafted": 900, + "artifact": 1000 }, "description": "The Twin-Linked Lascannons is a powerful anti-armour weapons that fire highly focused and devastating duel energy beams capable of penetrating even the toughest armor.", "melee_hands": 0, @@ -1030,24 +1098,24 @@ global.weapons = { "Heavy Bolter": { "abbreviation": "HvyBltr", "attack": { - "standard": 320, - "master_crafted": 352, - "artifact": 384 + "standard": 300, + "master_crafted": 350, + "artifact": 390 }, "description": "The Heavy Bolter is a heavy weapon that fires larger and more powerful bolt shells compared to the standard Bolter.", "melee_hands": 1, "ranged_hands": 2, "ammo": 10, - "range": 16, - "spli": 6, - "arp": 1, + "range": 14, + "spli": 12, + "arp": 0, "tags": ["heavy_ranged", "bolt"] }, "Whirlwind Missiles": { "attack": { - "standard": 400, - "master_crafted": 440, - "artifact": 480 + "standard": 600, + "master_crafted": 650, + "artifact": 800 }, "description": "The Whirlwind Missile Launcher is a vehicle-mounted artillery weapon that launches a barrage of powerful missiles at the enemy.", "abbreviation": "WhrlMssl", @@ -1055,8 +1123,8 @@ global.weapons = { "ranged_hands": 0, "ammo": 6, "range": 20, - "spli": 25, - "arp": 1, + "spli": 40, + "arp": -1, "tags": ["vehicle","heavy_ranged", "indirect"] }, "HK Missile": { @@ -1066,9 +1134,9 @@ global.weapons = { }, "Twin Linked Heavy Bolter Mount": { "attack": { - "standard": 240, - "master_crafted": 264, - "artifact": 288 + "standard": 450, + "master_crafted": 550, + "artifact": 700 }, "description": "The Twin-linked Heavy Bolters are an upgraded version of the standard Heavy Bolter weapon. They are mounted onto vehicles to create effective fire support platforms.", "abbreviation": "TwnHvyBltr", @@ -1076,15 +1144,15 @@ global.weapons = { "ranged_hands": 0, "ammo": 20, "range": 16, - "spli": 3, - "arp": 1, + "spli": 21, + "arp": 0, "tags": ["vehicle", "dreadnought", "heavy_ranged", "bolt"] }, "Twin Linked Lascannon Mount": { "attack": { - "standard": 250, - "master_crafted": 275, - "artifact": 300 + "standard": 800, + "master_crafted": 900, + "artifact": 1000 }, "description": "The Twin-Lascannons are powerful anti-armour weapons that fire highly focused and devastating energy beams capable of penetrating even the toughest armour. This version is mounted onto vehicles to incease anti-armor capabilities.", "abbreviation": "TwnLascnn", @@ -1092,15 +1160,15 @@ global.weapons = { "ranged_hands": 0, "ammo": 10, "range": 20, - "spli": 3, + "spli": 2, "arp": 1, "tags": ["las", "energy", "vehicle", "heavy_ranged", "dreadnought"] }, "Twin Linked Assault Cannon Mount": { "attack": { - "standard": 240, - "master_crafted": 264, - "artifact": 288 + "standard": 800, + "master_crafted": 900, + "artifact": 1100 }, "description": "A twin mount of rotary autocannons, boasting an incredible rate of fire numbering in the hundreds of shots fired per second.", "abbreviation": "TwnAssCnn", @@ -1108,15 +1176,15 @@ global.weapons = { "ranged_hands": 0, "ammo": 6, "range": 12, - "spli": 30, - "arp": 1, + "spli": 40, + "arp": 0, "tags": ["vehicle","heavy_ranged", "pintle", "dreadnought"] }, "Reaper Autocannon Mount": { "attack": { - "standard": 500, - "master_crafted": 550, - "artifact": 600 + "standard": 700, + "master_crafted": 850, + "artifact": 1000 }, "description": "An archaic twin-linked autocannon design dating back to the Great Crusade. The Reaper Autocannon is effective against infantry and armored targets. This version is mounted onto vehicles.", "abbreviation": "RprAtcnn", @@ -1124,15 +1192,15 @@ global.weapons = { "ranged_hands": 0, "ammo": 25, "range": 15, - "spli": 6, - "arp": 1, + "spli": 24, + "arp": -1, "tags": ["vehicle","heavy_ranged", "pintle"] }, "Quad Linked Heavy Bolter Sponsons": { "attack": { - "standard": 320, - "master_crafted": 352, - "artifact": 384 + "standard": 800, + "master_crafted": 900, + "artifact": 1100 }, "description": "Quad-linked Heavy Bolters are a significantly upgraded version of the standard Heavy Bolter mount; already punishing in a single mount, this quad mount is devastating against a variety of targets.", "abbreviation": "QdHvyBltrs", @@ -1140,15 +1208,15 @@ global.weapons = { "ranged_hands": 0, "ammo": 15, "range": 16, - "spli": 5, - "arp": 1, + "spli": 50, + "arp": 0, "tags": ["bolt","heavy_ranged", "vehicle", "sponson"] }, "Twin Linked Lascannon Sponsons": { "attack": { - "standard": 600, - "master_crafted": 700, - "artifact": 900 + "standard": 800, + "master_crafted": 1000, + "artifact": 1200 }, "description": "The Twin-Linked Lascannons are powerful anti-armour weapons that fire highly focused and devastating energy beams capable of penetrating even the toughest armour. This version is mounted onto the sides of vehicles.", "abbreviation": "TwnLascnns", @@ -1156,15 +1224,15 @@ global.weapons = { "ranged_hands": 0, "ammo": 5, "range": 20, - "spli": 3, + "spli": 4, "arp": 1, "tags": ["las", "energy", "vehicle", "heavy_ranged", "sponson", "twin_linked"] }, "Lascannon Sponsons": { "attack": { - "standard": 500, - "master_crafted": 600, - "artifact": 750 + "standard": 700, + "master_crafted": 850, + "artifact": 1000 }, "description": "Lascannons are powerful anti-armour weapons that fire highly focused and devastating energy beams capable of penetrating even the toughest armour. This version is mounted onto the sides of vehicles.", "abbreviation": "Lscnns", @@ -1172,15 +1240,15 @@ global.weapons = { "ranged_hands": 0, "ammo": 8, "range": 20, - "spli": 1, + "spli": 2, "arp": 1, "tags": ["las", "energy","heavy_ranged", "vehicle", "sponson"] }, "Hurricane Bolter Sponsons": { "attack": { - "standard": 50, - "master_crafted": 55, - "artifact": 60 + "standard": 600, + "master_crafted": 700, + "artifact": 800 }, "description": "Hurricane Bolters are large hex-mount bolter arrays that are able to deliver a withering hail of anti-infantry fire at short ranges. This version is mounted onto the sides of vehicles.", "abbreviation": "HrcBltrs", @@ -1194,100 +1262,100 @@ global.weapons = { }, "Flamestorm Cannon Sponsons": { "attack": { - "standard": 600, - "master_crafted": 660, - "artifact": 720 + "standard": 750, + "master_crafted": 850, + "artifact": 900 }, "description": "A huge vehicle-mounted flamethrower cannon, the heat produced by this terrifying weapon can melt armoured ceramite.", "abbreviation": "FlmstCnns", "melee_hands": 0, "ranged_hands": 0, "ammo": 6, - "range": 2, - "spli": 3, - "arp": 1, + "range": 4.1, + "spli": 30, + "arp": -2, "tags": ["flame","heavy_ranged", "vehicle", "sponson"] }, "Twin Linked Heavy Flamer Sponsons": { "attack": { - "standard": 500, - "master_crafted": 550, - "artifact": 600 + "standard": 600, + "master_crafted": 750, + "artifact": 900 }, "description": "A twin-linked significantly heavier flamer attached to the sponsons on a vehicle.", "abbreviation": "TwnHvyFlmrs", "melee_hands": 0, "ranged_hands": 0, "ammo": 8, - "range": 2.1, - "spli": 8, + "range": 4.1, + "spli": 40, "arp": -1, "tags": ["flame","heavy_ranged", "vehicle", "dreadnought", "sponson"] }, "Twin Linked Bolters": { "attack": { - "standard": 80, - "master_crafted": 140, - "artifact": 180 + "standard": 225, + "master_crafted": 350, + "artifact": 450 }, "description": "A Twin-linked Bolter consists of two Bolter weapons mounted side by side, typically on a vehicle or a dedicated weapons platform.", "abbreviation": "TwnBltrs", "melee_hands": 1, "ranged_hands": 2, "ammo": 30, - "range": 12, - "spli": 6, + "range": 10, + "spli": 10, "arp": 0, "tags": ["bolt", "vehicle"] }, "Twin Linked Multi-Melta Sponsons": { "abbreviation": "TwnMltMelts", "attack": { - "standard": 800, - "master_crafted": 850, - "artifact": 900 + "standard": 1200, + "master_crafted": 1400, + "artifact": 1650 }, "description": "Though bearing longer range than the Meltagun, this weapon's great size usually restricts it to vehicles. In this case it is mounted to the sponsons on a vehicle.", "melee_hands": 0, "ranged_hands": 0, "ammo": 8, "range": 4.1, - "spli": 2, - "arp": 1, + "spli": 20, + "arp": -2, "tags": ["vehicle","heavy_ranged", "Sponson", "melta"], "maintenance" : 0.05, }, "Twin Linked Volkite Culverin Sponsons": { "abbreviation": "TwnVlkCulvs", "attack": { - "standard": 480, - "master_crafted": 510, - "artifact": 540 + "standard": 950, + "master_crafted": 1150, + "artifact": 1300 }, "description": "An advanced thermal weapon from a bygone era, Volkite Culverins are able to ignite entire formations of enemy forces. In this case it is mounted to the sponsons on a vehicle.", "melee_hands": 0, "ranged_hands": 0, "ammo": 25, "range": 18, - "spli": 9, - "arp": 0, + "spli": 12, + "arp": -2, "tags": ["vehicle","heavy_ranged", "Sponson", "volkite", "ancient"] }, "Heavy Bolter Sponsons": { "abbreviation": "HvyBltrs", "attack": { - "standard": 240, - "master_crafted": 264, - "artifact": 288 + "standard": 450, + "master_crafted": 550, + "artifact": 750 }, "description": "Heavy Bolters are mounted in sponsons. They are known for high rates of fire and effectiveness against infantry and light vehicles.", "melee_hands": 0, "ranged_hands": 0, "ammo": 20, - "range": 16, - "spli": 4, - "arp": 1, - "tags": ["heavy_ranged", "vehicle", "sponson", "bolt"], + "range": 14, + "spli": 28, + "arp": 0, + "tags": ["heavy_ranged", "vehicle", "sponson", "bolt"] }, "Heavy Flamer Sponsons": { "abbreviation": "HvyFlmrs", @@ -1301,8 +1369,8 @@ global.weapons = { "melee_hands": 0, "ranged_hands": 0, "ammo": 8, - "range": 2.1, - "spli": 4, + "range": 4.1, + "spli": 40, "arp": -1, "tags": ["flame","heavy_ranged", "vehicle", "sponson"], "maintenance" : 0.05, @@ -1311,66 +1379,67 @@ global.weapons = { "abbreviation": "VlkClvs", "attack": { "standard": 480, - "master_crafted": 528, - "artifact": 576 + "master_crafted": 600, + "artifact": 750 }, "description": "An advanced thermal weapon from a bygone era, Volkite Culverins are able to ignite entire formations of enemy forces. In this case it is mounted to the sponsons on a vehicle.", "melee_hands": 0, "ranged_hands": 0, "ammo": 25, "range": 18, - "spli": 5, - "arp": 1, + "spli": 6, + "arp": -2, "tags": ["vehicle","heavy_ranged", "Sponson", "volkite", "ancient"] }, "Autocannon Turret": { "abbreviation": "Autocnn", "attack": { - "standard": 380, - "master_crafted": 528, - "artifact": 576 + "standard": 600, + "master_crafted": 700, + "artifact": 850 }, "description": "A Predator-compatible turret mounting a reliable all-purpose autocannon capable of doing effective damage to infantry and lightly armored targets.", "melee_hands": 0, "ranged_hands": 0, - "ammo": 25, + "ammo": 18, "range": 18, "spli": 15, - "arp": 0, + "arp": -1, "tags": ["vehicle","heavy_ranged", "turret"] }, "Storm Bolter": { "abbreviation": "StrmBltr", "attack": { - "standard": 80, - "master_crafted": 88, - "artifact": 96 + "standard": 275, + "master_crafted": 300, + "artifact": 350 }, "description": "Compact and double-barreled, this bolt weapon is inaccurate but grants an enormous amount of firepower. Its psychological effect on the enemy should not be understated.", - "melee_hands": 1.1, - "ranged_hands": 1.1, + "melee_hands": 1, + "ranged_hands": 2, "ammo": 10, - "range": 10, - "spli": 6, + "range": 8, + "spli": 8, "arp": 0, - "tags": ["bolt"], - "maintenance" : 0.03, + "maintenance" : 0.03, + "tags": ["bolt", "boarding 2"] + }, "Hand Flamer": { "abbreviation": "HndFlmr", "attack": { - "standard": 125, - "master_crafted": 190, - "artifact": 210 + "standard": 250, + "master_crafted": 275, + "artifact": 350 }, "description": "Along with using a lower-capacity fuel tank it has much reduced range, which makes it suited for assault and close-combat purposes, incinerating foes at short range. The weapon is often used by assault squads.", "melee_hands": 0, "ranged_hands": 1, - "ammo": 2, - "range": 1.1, - "spli": 2, - "arp": -1, - "tags": ["pistol", "flame"] + "ammo": 4, + "range": 2.1, + "spli": 8, + "arp": 0, + "tags": ["pistol", "flame", "boarding 2"] }, "Flamer": { "abbreviation": "Flmr", @@ -1387,118 +1456,118 @@ global.weapons = { "description": "Blackened at the tip, this weapon unleashes a torrent of burning promethium - all the better to cleanse sin and impurity with.", "melee_hands": 1, "ranged_hands": 2, - "ammo": 4, - "range": 2.1, - "spli": 4, - "arp": -1, - "tags": ["flame"], - "maintenance" : 0.01, + "ammo": 8, + "range": 4.1, + "spli": 14, + "arp": 0, + "maintenance" : 0.01, + "tags": ["flame", "boarding 2"] }, - "Underslung Flamer": { + "Integrated-Flamer": { "attack": { - "standard": 200, - "master_crafted": 220, - "artifact": 240 + "standard": 350, + "master_crafted": 385, + "artifact": 420 }, "description": "", - "abbreviation": "UndrFlmr", + "abbreviation": "IntFlmr", "melee_hands": 0, "ranged_hands": 0, "ammo": 4, - "range": 2.1, + "range": 4.1, "spli": 3, - "arp": -1, + "arp": 0, "tags": ["flame", "attached"] }, "Combiflamer": { "abbreviation": "CmbFlmr", "attack": { - "standard": 100, - "master_crafted": 130, - "artifact": 160 + "standard": 150, + "master_crafted": 175, + "artifact": 200 }, "description": "A standard Bolter with an underbarrel Flamer for expanded tactical utility.", "melee_hands": 1, "ranged_hands": 2, "ammo": 15, "range": 10, - "spli": 3, + "spli": 5, "arp": 0, - "second_profiles": ["Flamer"], - "tags": ["combi", "bolt"] + "second_profiles": ["Integrated-Flamer"], + "tags": ["combi", "bolt", "boarding 2"] }, "Combiplasma": { "abbreviation": "CmbPlsm", "attack": { - "standard": 100, - "master_crafted": 130, - "artifact": 160 + "standard": 150, + "master_crafted": 175, + "artifact": 200 }, "description": "A standard Bolter with an underbarrel Plasma Gun for expanded tactical utility.", "melee_hands": 1, "ranged_hands": 2, - "ammo": 15, + "ammo": 8, "range": 10, - "spli": 3, + "spli": 5, "arp": 0, - "second_profiles": ["Plasma Gun"], + "second_profiles": ["Integrated-Plasma"], "tags": ["combi", "bolt"] }, "Combigrav": { "abbreviation": "CmbGrv", "attack": { - "standard": 100, - "master_crafted": 130, - "artifact": 160 + "standard": 150, + "master_crafted": 175, + "artifact": 200 }, "description": "A standard Bolter with an underbarrel Grav-Gun for expanded tactical utility.", "melee_hands": 1, "ranged_hands": 2, - "ammo": 15, + "ammo": 8, "range": 10, - "spli": 3, + "spli": 5, "arp": 0, - "second_profiles": ["Grav-Gun"], + "second_profiles": ["Integrated-Grav"], "tags": ["combi", "bolt"] }, "Combimelta": { "abbreviation": "CmbMlt", "attack": { - "standard": 100, - "master_crafted": 130, - "artifact": 160 + "standard": 150, + "master_crafted": 175, + "artifact": 200 }, "description": "A standard Bolter with an underbarrel Meltagun for expanded tactical utility.", "melee_hands": 1, "ranged_hands": 2, - "ammo": 15, + "ammo": 8, "range": 10, - "spli": 3, + "spli": 5, "arp": 0, - "second_profiles": ["Meltagun"], - "tags": ["combi", "bolt"] + "second_profiles": ["Integrated-Melta"], + "tags": ["combi", "bolt", "boarding 3"] }, "Incinerator": { "attack": { - "standard": 200, - "master_crafted": 220, - "artifact": 240 + "standard": 500, + "master_crafted": 550, + "artifact": 600 }, "description": "This flamer weapon utilizes psychically-charged promethium and blessed oils concoction to create an azure flame that bypasses psychich protections. It is particularly effective against Daemons and their ilk.", "abbreviation": "Incnrtr", "melee_hands": 1, "ranged_hands": 1, "ammo": 4, - "range": 2.1, - "spli": 3, + "range": 4.1, + "spli": 20, "arp": -1, - "tags": ["flame"] + "tags": ["flame","boarding 3"] }, "Force Staff": { "attack": { - "standard": 200, - "master_crafted": 230, - "artifact": 270 + "standard": 225, + "master_crafted": 270, + "artifact": 350 }, "melee_mod": { "standard": 1, @@ -1511,101 +1580,101 @@ global.weapons = { "ranged_hands": 1, "range": 1, "spli": 5, - "arp": 1, + "arp": -1, "special_description": "Spell Damage +100%", - "tags": ["force" ], - "maintenance" : 0.1, +"maintenance" : 0.1, + "tags": ["force"] }, "Force Sword": { - "abbreviation": "FrcSwrd", "attack": { - "standard": 180, - "master_crafted": 200, - "artifact": 240 + "standard": 225, + "master_crafted": 270, + "artifact": 350 }, "melee_mod": { "standard": 1, "master_crafted": 1.1, "artifact": 1.2 }, + "abbreviation": "FrcSwrd", "description": "The Force Sword is a psychically-attuned close combat weapon that is only fully effective in the hands of a psyker.", "melee_hands": 1, "ranged_hands": 0, "ammo": 0, "range": 1, "spli": 4, - "arp": 1, + "arp": -1, "special_description": "Spell damage +25%", "special_properties": ["Parry"], - "tags": ["force", "sword"], - "maintenance" : 0.1, + "maintenance" : 0.1, + "tags": ["force", "sword", "martial", "boarding 1"], }, "Force Axe": { - "abbreviation": "FrcAxe", "attack": { - "standard": 190, - "master_crafted": 220, - "artifact": 260 + "standard": 200, + "master_crafted": 250, + "artifact": 350 }, "melee_mod": { "standard": 1, "master_crafted": 1.1, "artifact": 1.2 }, + "abbreviation": "FrcAxe", "description": "The Force Axe is a psychically-attuned close combat weapon that is only fully effective in the hands of a psyker.", "melee_hands": 1, "ranged_hands": 0, "ammo": 0, "range": 1, "spli": 5, - "arp": 1, + "arp": -1, "special_description": "Able to be dual-wielded, Spell damage +25%", - "tags": ["force", "axe", "dual"], + "tags": ["force", "axe", "dual", "savage", "boarding 2"], }, "Twin Linked Lascannon Turret": { "attack": { - "standard": 600, - "master_crafted": 700, - "artifact": 900 + "standard": 1000, + "master_crafted": 1100, + "artifact": 1300 }, "abbreviation": "TwnLscnn", "description": "A Predator-compatible turret mounting a twin-linked lascannon.", "arp": 1, "range": 24, "ammo": 5, - "spli": 2, + "spli": 1, "tags": ["las", "energy", "twin_linked","heavy_ranged", "vehicle", "turret"] }, "Twin Linked Assault Cannon Turret": { "abbreviation": "TwnAssCnn", "attack": { - "standard": 240, - "master_crafted": 264, - "artifact": 288 + "standard": 800, + "master_crafted": 900, + "artifact": 1100 }, "description": "A heavy rotary autocannon with a devastating fire rate that can be counted in the hundreds per minute, in a twin mount. It is incredibly effective against infantry and lightly armored targets.", "melee_hands": 2.1, "ranged_hands": 2.25, "ammo": 5, "range": 12, - "spli": 30, - "arp": 1, + "spli": 40, + "arp": 0, "tags": ["heavy_ranged", "twin_linked", "vehicle", "turret"] }, "Flamestorm Cannon Turret": { "abbreviation": "FlmstCnn", "attack": { - "standard": 600, - "master_crafted": 660, - "artifact": 720 + "standard": 700, + "master_crafted": 850, + "artifact": 900 }, "description": "A huge vehicle-mounted flamethrower cannon, the heat produced by this terrifying weapon can melt armoured ceramite.", "melee_hands": 0, "ranged_hands": 0, "ammo": 12, - "range": 2, - "spli": 3, - "arp": 1, + "range": 4.1, + "spli": 25, + "arp": -2, "tags": ["flame","heavy_ranged", "vehicle", "turret"] }, "Magna-Melta Turret": { @@ -1619,25 +1688,25 @@ global.weapons = { "melee_hands": 0, "ranged_hands": 0, "ammo": 6, - "range": 5.1, - "spli": 2, - "arp": 1, + "range": 4.1, + "spli": 20, + "arp": -2, "tags": ["vehicle","heavy_ranged", "turret", "melta"] }, "Plasma Destroyer Turret": { "abbreviation": "PlsmDestr", "attack": { - "standard": 500, - "master_crafted": 600, - "artifact": 750 + "standard": 800, + "master_crafted": 900, + "artifact": 1000 }, "description": "A heavy variant of the plasma gun, its power output is significantly higher and its damage capability shows. However, it is mounted in a tank turret.", "melee_hands": 1, "ranged_hands": 3, "ammo": 16, "range": 14, - "spli": 3, - "arp": 1, + "spli": 12, + "arp": -2, "tags": ["plasma", "energy","heavy_ranged", "vehicle", "turret"] }, "Heavy Conversion Beam Projector": { @@ -1675,9 +1744,9 @@ global.weapons = { "Volkite Saker Turret": { "abbreviation": "VlkSkr", "attack": { - "standard": 300, - "master_crafted": 333, - "artifact": 375 + "standard": 1000, + "master_crafted": 1150, + "artifact": 1400 }, "description": "An advanced thermal weapon from a bygone era, Volkite sakers are optimized for spreading damage across swaths of enemy troops.", "melee_hands": 0, @@ -1685,7 +1754,7 @@ global.weapons = { "ammo": 25, "range": 18, "spli": 30, - "arp": 0, + "arp": -2, "tags": ["vehicle","heavy_ranged", "turret", "volkite", "ancient"] }, // Hireling weapons @@ -1817,7 +1886,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 3, - "arp": 1, + "arp": -1, "special_properties": ["Parry"], "tags": ["power", "sword", "elder", "xenos"], }, From 51b68264de91d9ce23de340c7593e86f681f7ddd Mon Sep 17 00:00:00 2001 From: Da Fist <144086663+KRdaMystic@users.noreply.github.com> Date: Thu, 23 Jan 2025 19:33:03 +0900 Subject: [PATCH 02/80] feat: Combat adjustments p2 (#455) --- objects/obj_enunit/Alarm_1.gml | 384 ++++++++++++++---------- scripts/scr_en_weapon/scr_en_weapon.gml | 194 ++++++------ scripts/scr_shoot/scr_shoot.gml | 8 +- scripts/scr_weapon/scr_weapon.gml | 60 ++-- 4 files changed, 358 insertions(+), 288 deletions(-) diff --git a/objects/obj_enunit/Alarm_1.gml b/objects/obj_enunit/Alarm_1.gml index e1e66d781c..5d74eaac96 100644 --- a/objects/obj_enunit/Alarm_1.gml +++ b/objects/obj_enunit/Alarm_1.gml @@ -349,38 +349,41 @@ if __b__ { repeat(20) { j += 1; if (dudes[j] = "Imperial Guardsman") { - dudes_ac[j] = 20; - dudes_hp[j] = 20; + dudes_ac[j] = 40; + dudes_hp[j] = 5; men += dudes_num[j]; } if (dudes[j] = "Heavy Weapons Team") { scr_en_weapon("Heavy Bolter", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 0; + dudes_ac[j] = 10; dudes_hp[j] = 100; + dudes_dr[j] = 0.1; men += dudes_num[j]; } if (dudes[j] = "Ogryn") { scr_en_weapon("Ripper Gun", true, dudes_num[j], dudes[j], j); scr_en_weapon("Ogryn Melee", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; + dudes_ac[j] = 10; dudes_hp[j] = 120; + dudes_dr[j] = 0.25; men += dudes_num[j]; } if (dudes[j] = "Chimera") { scr_en_weapon("Multi-Laster", false, dudes_num[j], dudes[j], j); scr_en_weapon("Heavy Bolter", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 150; + dudes_ac[j] = 40; + dudes_hp[j] = 200; + dudes_dr[j] = 0.25; veh += dudes_num[j]; dudes_vehicle[j] = 1; } if (dudes[j] = "Basilisk") { scr_en_weapon("Earthshaker Cannon", false, dudes_num[j], dudes[j], j); scr_en_weapon("Storm Bolter", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 15; + dudes_ac[j] = 20; dudes_hp[j] = 150; veh += dudes_num[j]; dudes_vehicle[j] = 1; @@ -388,8 +391,9 @@ if __b__ { if (dudes[j] = "Leman Russ Battle Tank") { scr_en_weapon("Battle Cannon", false, dudes_num[j], dudes[j], j); scr_en_weapon("Lascannon", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; + dudes_ac[j] = 45; dudes_hp[j] = 250; + dudes_dr[j] = 0.75; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -398,6 +402,7 @@ if __b__ { scr_en_weapon("Lascannon", false, dudes_num[j], dudes[j], j); dudes_ac[j] = 40; dudes_hp[j] = 250; + dudes_dr[j] = 0.75; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -405,6 +410,7 @@ if __b__ { scr_en_weapon("Twin-Linked Lascannon", false, dudes_num[j] * 3, dudes[j], j); dudes_ac[j] = 20; dudes_hp[j] = 300; + dudes_dr[j] = 0.75; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -457,17 +463,17 @@ if __b__ { scr_en_weapon("Blessed Weapon", true, dudes_num[j], dudes[j], j); scr_en_weapon("Laser Mace", true, dudes_num[j], dudes[j], j); scr_en_weapon("Infernus Pistol", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 35; + dudes_ac[j] = 10; if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { dudes_hp[j] = 200; } men += dudes_num[j]; - dudes_dr[j] = 0.33; + dudes_dr[j] = 0.75; } if (dudes[j] = "Palatine") { scr_en_weapon("Plasma Pistol", true, dudes_num[j], dudes[j], j); scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 22; + dudes_ac[j] = 10; dudes_hp[j] = 100; men += dudes_num[j]; dudes_dr[j] = 0.5; @@ -475,7 +481,7 @@ if __b__ { if (dudes[j] = "Priest") { scr_en_weapon("Laspistol", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 0; - dudes_hp[j] = 30; + dudes_hp[j] = 50; men += dudes_num[j]; dudes_dr[j] = 0.5; } @@ -485,30 +491,30 @@ if __b__ { dudes_ac[j] = 0; dudes_hp[j] = 150; men += dudes_num[j]; - dudes_dr[j] = 0.65; + dudes_dr[j] = 0.3; } if (dudes[j] = "Celestian") { scr_en_weapon("Bolter", true, dudes_num[j], dudes[j], j); scr_en_weapon("Chainsword", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 40; + dudes_ac[j] = 10; + dudes_hp[j] = 60; men += dudes_num[j]; - dudes_dr[j] = 0.65; + dudes_dr[j] = 0.50; } if (dudes[j] = "Mistress") { scr_en_weapon("Neural Whip", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 40; + dudes_ac[j] = 10; + dudes_hp[j] = 60; men += dudes_num[j]; - dudes_dr[j] = 0.75; + dudes_dr[j] = 0.50; } if (dudes[j] = "Sister Repentia") { scr_en_weapon("Eviscerator", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 30; + dudes_ac[j] = 0; + dudes_hp[j] = 75; men += dudes_num[j]; - dudes_dr[j] = 0.75; + dudes_dr[j] = 0.25; } if (dudes[j] = "Battle Sister") { @@ -520,26 +526,26 @@ if __b__ { scr_en_weapon("Bolter", true, dudes_num[j] - nem, dudes[j], j); } scr_en_weapon("Sarissa", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 40; + dudes_ac[j] = 10; + dudes_hp[j] = 60; men += dudes_num[j]; - dudes_dr[j] = 0.8; + dudes_dr[j] = 0.25; } if (dudes[j] = "Seraphim") { scr_en_weapon("Seraphim Pistols", true, dudes_num[j], dudes[j], j); scr_en_weapon("Chainsword", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 40; + dudes_ac[j] = 10; + dudes_hp[j] = 60; men += dudes_num[j]; - dudes_dr[j] = 0.75; + dudes_dr[j] = 0.4; } if (dudes[j] = "Dominion") { scr_en_weapon("Meltagun", true, dudes_num[j], dudes[j], j); scr_en_weapon("Meltabomb", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 40; + dudes_ac[j] = 10; + dudes_hp[j] = 60; men += dudes_num[j]; - dudes_dr[j] = 0.75; + dudes_dr[j] = 0.25; } if (dudes[j] = "Retributor") { if (dudes_num[j] <= 3) then scr_en_weapon("Heavy Bolter", true, dudes_num[j], dudes[j], j); @@ -550,50 +556,54 @@ if __b__ { scr_en_weapon("Heavy Bolter", true, dudes_num[j] - nem, dudes[j], j); } scr_en_weapon("Bolt Pistol", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 40; + dudes_ac[j] = 10; + dudes_hp[j] = 60; men += dudes_num[j]; - dudes_dr[j] = 0.75; + dudes_dr[j] = 0.4; } if (dudes[j] = "Follower") { scr_en_weapon("Laspistol", true, dudes_num[j], dudes[j], j); scr_en_weapon("melee0.5", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 0; - dudes_hp[j] = 20; + dudes_hp[j] = 30; men += dudes_num[j]; } if (dudes[j] = "Rhino") { scr_en_weapon("Storm Bolter", false, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 20; + dudes_ac[j] = 40; dudes_hp[j] = 200; + dudes_dr[j] = 0.25; veh += dudes_num[j]; dudes_vehicle[j] = 1; } if (dudes[j] = "Chimera") { scr_en_weapon("Heavy Flamer", false, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 23; + dudes_ac[j] = 40; dudes_hp[j] = 200; + dudes_dr[j] = 0.25; veh += dudes_num[j]; dudes_vehicle[j] = 1; } if (dudes[j] = "Immolator") { scr_en_weapon("Twin Linked Heavy Flamers", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 200; + dudes_ac[j] = 40; + dudes_hp[j] = 300; + dudes_dr[j] = 0.50; veh += dudes_num[j]; dudes_vehicle[j] = 1; } if (dudes[j] = "Exorcist") { scr_en_weapon("Exorcist Missile Launcher", false, dudes_num[j], dudes[j], j); scr_en_weapon("Storm Bolter", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; + dudes_ac[j] = 40; if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { - dudes_hp[j] = 300; + dudes_hp[j] = 200; } + dudes_dr[j] = 0.25; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -603,6 +613,7 @@ if __b__ { scr_en_weapon("Heavy Flamer", false, dudes_num[j], dudes[j], j); dudes_ac[j] = 35; dudes_hp[j] = 150; + dudes_dr[j] = 0.50; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -851,7 +862,7 @@ if __b__ { if (dudes[j] = "Wraithlord") { scr_en_weapon("Two Power Fists", false, dudes_num[j], dudes[j], j); scr_en_weapon("Flamer", false, dudes_num[j] * 2, dudes[j], j); - scr_en_weapon("Star Cannon", false, dudes_num[j], dudes[j], j); + scr_en_weapon("Starcannon", false, dudes_num[j], dudes[j], j); dudes_ac[j] = 40; dudes_hp[j] = 200; veh += dudes_num[j]; @@ -880,7 +891,7 @@ if __b__ { scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); scr_en_weapon("Rokkit Launcha", true, dudes_num[j], dudes[j], j); scr_en_weapon("Big Shoota", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 60; + dudes_ac[j] = 12; if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { dudes_hp[j] = 600; } @@ -891,29 +902,32 @@ if __b__ { if (dudes[j] = "Minor Warboss") { scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); scr_en_weapon("Big Shoota", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; + dudes_ac[j] = 10; if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { dudes_hp[j] = 150; + dudes_dr[j] = 0.25; } men += dudes_num[j]; } if (dudes[j] = "Warboss") { scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); scr_en_weapon("Rokkit Launcha", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 50; + dudes_ac[j] = 12; if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { dudes_hp[j] = 200; + dudes_dr[j] = 0.25; } men += dudes_num[j]; } if (dudes[j] = "Big Warboss") { scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); scr_en_weapon("Rokkit Launcha", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 60; + dudes_ac[j] = 12; if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { dudes_hp[j] = 300; + dudes_dr[j] = 0.5; } - veh += dudes_num[j]; + men += dudes_num[j]; } if (dudes[j] = "Gretchin") { @@ -925,81 +939,84 @@ if __b__ { if (dudes[j] = "Slugga Boy") { scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); scr_en_weapon("Slugga", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 50; + dudes_ac[j] = 5; + dudes_hp[j] = 60; men += dudes_num[j]; } if (dudes[j] = "Shoota Boy") { scr_en_weapon("Shoota", true, dudes_num[j], dudes[j], j); scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 50; + dudes_ac[j] = 5; + dudes_hp[j] = 60; men += dudes_num[j]; } if (dudes[j] = "Mekboy") { scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); scr_en_weapon("Big Shoota", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 60; + dudes_ac[j] = 15; + dudes_hp[j] = 100; + dudes_dr[j] = 0.25; men += dudes_num[j]; } if (dudes[j] = "Meganob") { scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); scr_en_weapon("Big Shoota", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 120; + dudes_ac[j] = 15; + dudes_hp[j] = 150; + dudes_dr[j] = 0.25; men += dudes_num[j]; } if (dudes[j] = "Flash Git") { scr_en_weapon("Snazzgun", true, dudes_num[j], dudes[j], j); scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 15; - dudes_hp[j] = 65; + dudes_ac[j] = 10; + dudes_hp[j] = 100; men += dudes_num[j]; } if (dudes[j] = "Cybork") { scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); scr_en_weapon("Big Shoota", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 80; + dudes_ac[j] = 10; + dudes_hp[j] = 100; + dudes_dr[j] = 0.25; men += dudes_num[j]; } if (dudes[j] = "Ard Boy") { scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); scr_en_weapon("Slugga", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 70; + dudes_ac[j] = 10; + dudes_hp[j] = 80; men += dudes_num[j]; } if (dudes[j] = "Kommando") { scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); scr_en_weapon("Rokkit Launcha", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 10; - dudes_hp[j] = 80; + dudes_hp[j] = 150; men += dudes_num[j]; } if (dudes[j] = "Burna Boy") { scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); scr_en_weapon("Burna", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 35; + dudes_ac[j] = 5; + dudes_hp[j] = 80; men += dudes_num[j]; } if (dudes[j] = "Tankbusta") { scr_en_weapon("Rokkit Launcha", true, dudes_num[j], dudes[j], j); scr_en_weapon("Tankbusta Bomb", true, dudes_num[j], dudes[j], j); scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 50; + dudes_ac[j] = 5; + dudes_hp[j] = 80; men += dudes_num[j]; } if (dudes[j] = "Stormboy") { scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); scr_en_weapon("Slugga", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 50; + dudes_ac[j] = 5; + dudes_hp[j] = 80; dudes_special[j] = "Jetpack"; men += dudes_num[j]; } @@ -1008,8 +1025,9 @@ if __b__ { scr_en_weapon("Kannon", false, dudes_num[j], dudes[j], j); scr_en_weapon("Big Shoota", false, dudes_num[j] * 2, dudes[j], j); scr_en_weapon("Rokkit Launcha", false, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 40; + dudes_ac[j] = 30; dudes_hp[j] = 200; + dudes_dr[j] = 0.5; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -1017,8 +1035,9 @@ if __b__ { scr_en_weapon("Power Klaw", false, dudes_num[j] * 2, dudes[j], j); scr_en_weapon("Big Shoota", false, dudes_num[j], dudes[j], j); scr_en_weapon("Rokkit Launcha", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 35; - dudes_hp[j] = 150; + dudes_ac[j] = 20; + dudes_hp[j] = 200; + dudes_dr[j] = 0.25; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -1035,67 +1054,66 @@ if __b__ { scr_en_weapon("Plasma Rifle", true, dudes_num[j], dudes[j], j); scr_en_weapon("Fusion Blaster", true, dudes_num[j], dudes[j], j); scr_en_weapon("Cyclic Ion Blaster", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 150; - medi += dudes_num[j]; - dudes_vehicle[j] = 1; + dudes_ac[j] = 15; + dudes_hp[j] = 300; + dudes_dr[j] = 0.5; + men += dudes_num[j]; } if (dudes[j] = "XV8 Bodyguard") { scr_en_weapon("Plasma Rifle", true, dudes_num[j], dudes[j], j); scr_en_weapon("Burst Rifle", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 100; - medi += dudes_num[j]; - dudes_vehicle[j] = 1; + dudes_ac[j] = 10; + dudes_hp[j] = 200; + dudes_dr[j] = 0.25; + men += dudes_num[j]; } if (dudes[j] = "XV8 Crisis") { scr_en_weapon("Plasma Rifle", true, dudes_num[j], dudes[j], j); scr_en_weapon("Missile Pod", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 75; - medi += dudes_num[j]; - dudes_vehicle[j] = 1; + dudes_ac[j] = 10; + dudes_hp[j] = 150; + dudes_dr[j] = 0.25; + men += dudes_num[j]; } if (dudes[j] = "XV8 (Brightknife)") { scr_en_weapon("Fusion Blaster", true, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 75; - medi += dudes_num[j]; - dudes_vehicle[j] = 1; + dudes_ac[j] = 10; + dudes_hp[j] = 150; + dudes_dr[j] = 0.25; + men += dudes_num[j]; } if (dudes[j] = "Shield Drone") { - dudes_ac[j] = 30; - dudes_hp[j] = 100; - medi += dudes_num[j]; - dudes_vehicle[j] = 1; + dudes_ac[j] = 10; + dudes_hp[j] = 50; + men += dudes_num[j]; } if (dudes[j] = "XV88 Broadside") { scr_en_weapon("Smart Missile System", true, dudes_num[j] * 2, dudes[j], j); scr_en_weapon("Small Railgun", true, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 150; - medi += dudes_num[j]; - dudes_vehicle[j] = 1; + dudes_ac[j] = 15; + dudes_hp[j] = 225; + dudes_dr[j] = 0.25; + men += dudes_num[j]; } if (dudes[j] = "XV25 Stealthsuit") { scr_en_weapon("Burst Rifle", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; + dudes_ac[j] = 10; dudes_hp[j] = 50; + dudes_dr[j] = 0.25; men += dudes_num[j]; - dudes_vehicle[j] = 1; } if (dudes[j] = "Fire Warrior") { scr_en_weapon("Pulse Rifle", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 20; + dudes_ac[j] = 10; + dudes_hp[j] = 30; men += dudes_num[j]; } if (dudes[j] = "Pathfinder") { scr_en_weapon("Rail Rifle", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 20; + dudes_ac[j] = 10; + dudes_hp[j] = 30; men += dudes_num[j]; } if (dudes[j] = "Kroot") { @@ -1108,7 +1126,7 @@ if __b__ { if (dudes[j] = "Vespid") { scr_en_weapon("Vespid Crystal", true, dudes_num[j], dudes[j], j); scr_en_weapon("Melee2", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; + dudes_ac[j] = 5; dudes_hp[j] = 50; men += dudes_num[j]; } @@ -1117,14 +1135,16 @@ if __b__ { scr_en_weapon("Smart Missile System", false, dudes_num[j], dudes[j], j); dudes_ac[j] = 30; dudes_hp[j] = 150; + dudes_dr[j] = 0.25; veh += dudes_num[j]; dudes_vehicle[j] = 1; } if (dudes[j] = "Hammerhead") { scr_en_weapon("Railgun", false, dudes_num[j], dudes[j], j); scr_en_weapon("Smart Missile System", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 250; + dudes_ac[j] = 30; + dudes_hp[j] = 150; + dudes_dr[j] = 0.25; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -1141,51 +1161,52 @@ if __b__ { scr_en_weapon("Bonesword", true, dudes_num[j], dudes[j], j); scr_en_weapon("Lashwhip", true, dudes_num[j], dudes[j], j); scr_en_weapon("Heavy Venom Cannon", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 35; - dudes_hp[j] = 250; + dudes_ac[j] = 20; + dudes_hp[j] = 400; + dudes_dr[j] = 0.6; men += dudes_num[j]; } if (dudes[j] = "Tyrant Guard") { scr_en_weapon("Crushing Claws", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 100; + dudes_ac[j] = 15; + dudes_hp[j] = 200; + dudes_dr[j] = 0.4; men += dudes_num[j]; } if (dudes[j] = "Tyranid Warrior") { scr_en_weapon("Rending Claws", true, dudes_num[j], dudes[j], j); scr_en_weapon("Devourer", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; + dudes_ac[j] = 10; dudes_hp[j] = 100; men += dudes_num[j]; } if (dudes[j] = "Zoanthrope") { scr_en_weapon("Zoanthrope Blast", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 200; - dudes_dr[j] = 0.5; - medi += dudes_num[j]; - dudes_vehicle[j] = 1.5; + dudes_ac[j] = 10; + dudes_hp[j] = 300; + dudes_dr[j] = 0.75; + men += dudes_num[j]; } if (dudes[j] = "Carnifex") { scr_en_weapon("Carnifex Claws", false, dudes_num[j], dudes[j], j); scr_en_weapon("Venom Cannon", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; + dudes_ac[j] = 20; dudes_hp[j] = 300; - dudes_dr[j] = 0.75; + dudes_dr[j] = 0.25; veh += dudes_num[j]; dudes_vehicle[j] = 1; } if (dudes[j] = "Termagaunt") { scr_en_weapon("Fleshborer", true, dudes_num[j] / 10, dudes[j], j); - dudes_ac[j] = 0; - dudes_hp[j] = 20; + dudes_ac[j] = 5; + dudes_hp[j] = 25; men += dudes_num[j]; } if (dudes[j] = "Hormagaunt") { scr_en_weapon("Scything Talons", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 0; - dudes_hp[j] = 20; + dudes_ac[j] = 5; + dudes_hp[j] = 25; men += dudes_num[j]; } @@ -1193,20 +1214,20 @@ if __b__ { scr_en_weapon("Autogun", true, dudes_num[j], dudes[j], j); scr_en_weapon("melee0.5", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 0; - dudes_hp[j] = 20; + dudes_hp[j] = 35; men += dudes_num[j]; } if (dudes[j] = "Genestealer") { scr_en_weapon("Genestealer Claws", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 50; + dudes_ac[j] = 5; + dudes_hp[j] = 75; men += dudes_num[j]; } if (dudes[j] = "Genestealer Patriarch") { scr_en_weapon("Genestealer Claws", true, dudes_num[j], dudes[j], j); scr_en_weapon("Witchfire", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 150; + dudes_ac[j] = 10; + dudes_hp[j] = 300; dudes_dr[j] = 0.75; men += dudes_num[j]; } @@ -1214,18 +1235,19 @@ if __b__ { scr_en_weapon("Autogun", false, dudes_num[j] * 4, dudes[j], j); dudes_ac[j] = 10; dudes_hp[j] = 150; + dudes_dr[j] = 0.25; veh += dudes_num[j]; dudes_vehicle[j] = 1; } if (dudes[j] = "Lictor") { scr_en_weapon("Lictor Claws", true, dudes_num[j], dudes[j], j); scr_en_weapon("Flesh Hooks", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 150; + dudes_ac[j] = 10; + dudes_hp[j] = 300; + dudes_dr[j] = 0.75; men += dudes_num[j]; } - dudes_dr[j] += 0.25; } /* */ @@ -1240,21 +1262,21 @@ if __b__ { if (dudes[j] = "Leader") and(obj_controller.faction_gender[10] = 1) { scr_en_weapon("Meltagun", true, dudes_num[j], dudes[j], j); scr_en_weapon("Power Fist", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; + dudes_ac[j] = 20; if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { dudes_hp[j] = 300; } men += dudes_num[j]; - dudes_dr[j] = 0.5; + dudes_dr[j] = 0.75; } if (dudes[j] = "Leader") and(obj_controller.faction_gender[10] = 2) { scr_en_weapon("Khorne Demon Melee", true, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 44; + dudes_ac[j] = 20; if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { dudes_hp[j] = 300; } men += dudes_num[j]; - dudes_dr[j] = 0.4; + dudes_dr[j] = 0.75; } if (dudes[j] = "Fallen") { @@ -1269,23 +1291,26 @@ if __b__ { if (dudes[j] = "Chaos Lord") { scr_en_weapon("Plasma Pistol", true, dudes_num[j], dudes[j], j); scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; + dudes_ac[j] = 20; dudes_hp[j] = 150; + dudes_dr[j] = 0.5; men += dudes_num[j]; } if (dudes[j] = "Chaos Sorcerer") { scr_en_weapon("Plasma Pistol", true, dudes_num[j], dudes[j], j); scr_en_weapon("Force Staff", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 25; + dudes_ac[j] = 20; dudes_hp[j] = 100; + dudes_dr[j] = 0.5; men += dudes_num[j]; } if (dudes[j] = "Warpsmith") { scr_en_weapon("Chainfist", true, dudes_num[j], dudes[j], j); scr_en_weapon("Meltagun", true, dudes_num[j], dudes[j], j); scr_en_weapon("Flamer", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; + dudes_ac[j] = 20; dudes_hp[j] = 100; + dudes_dr[j] = 0.5; men += dudes_num[j]; } @@ -1296,7 +1321,7 @@ if __b__ { dudes_ac[j] = 40; dudes_hp[j] = 100; men += dudes_num[j]; - dudes_dr[j] = 0.7; + dudes_dr[j] = 0.5; } if (dudes[j] = "Venerable Chaos Terminator") { scr_en_weapon("Power Fist", true, dudes_num[j], dudes[j], j); @@ -1318,14 +1343,15 @@ if __b__ { if (dudes[j] = "Obliterator") { scr_en_weapon("Power Fist", true, dudes_num[j], dudes[j], j); scr_en_weapon("Obliterator Weapon", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; + dudes_ac[j] = 40; dudes_hp[j] = 200; + dudes_dr[j] = 0.5; men += dudes_num[j]; } if (dudes[j] = "Chaos Chosen") { scr_en_weapon("Meltagun", true, dudes_num[j], dudes[j], j); scr_en_weapon("Chainsword", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 17; + dudes_ac[j] = 20; dudes_hp[j] = 125; men += dudes_num[j]; } @@ -1335,13 +1361,14 @@ if __b__ { dudes_ac[j] = 20; dudes_hp[j] = 125; men += dudes_num[j]; - dudes_dr[j] = 0.75; + dudes_dr[j] = 0.25; } if (dudes[j] = "Possessed") { scr_en_weapon("Possessed Claws", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 17; dudes_hp[j] = 150; + dudes_dr[j] = 0.5; men += dudes_num[j]; } if (dudes[j] = "Chaos Space Marine") { @@ -1363,6 +1390,7 @@ if __b__ { scr_en_weapon("Bolt Pistol", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 20; dudes_hp[j] = 100; + dudes_dr[j] = 0.25; dudes_special[j] = "Jump Pack"; men += dudes_num[j]; } @@ -1372,6 +1400,7 @@ if __b__ { scr_en_weapon("Chainaxe", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 20; dudes_hp[j] = 100; + dudes_dr[j] = 0.25; men += dudes_num[j]; } if (dudes[j] = "World Eaters Veteran") { @@ -1379,6 +1408,7 @@ if __b__ { scr_en_weapon("Chainaxe", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 20; dudes_hp[j] = 100; + dudes_dr[j] = 0.3; men += dudes_num[j]; } @@ -1387,6 +1417,7 @@ if __b__ { scr_en_weapon("Bolt Pistol", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 20; dudes_hp[j] = 100; + dudes_dr[j] = 0.35; men += dudes_num[j]; } if (dudes[j] = "Plague Marine") { @@ -1394,6 +1425,7 @@ if __b__ { scr_en_weapon("Poison Chainsword", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 20; dudes_hp[j] = 150; + dudes_dr[j] = 0.5; men += dudes_num[j]; } if (dudes[j] = "Noise Marine") { @@ -1401,27 +1433,30 @@ if __b__ { scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 20; dudes_hp[j] = 100; + dudes_dr[j] = 0.25; men += dudes_num[j]; } if (dudes[j] = "Rubric Marine") { scr_en_weapon("Rubric Bolter", true, dudes_num[j], dudes[j], j); scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 25; + dudes_ac[j] = 20; dudes_hp[j] = 125; + dudes_dr[j] = 0.35; men += dudes_num[j]; } if (dudes[j] = "Rubric Sorcerer") { scr_en_weapon("Witchfire", true, dudes_num[j], dudes[j], j); scr_en_weapon("Force Staff", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 25; + dudes_ac[j] = 20; dudes_hp[j] = 150; + dudes_dr[j] = 0.5; men += dudes_num[j]; } if (dudes[j] = "Cultist") { scr_en_weapon("Autogun", true, dudes_num[j], dudes[j], j); scr_en_weapon("melee0.5", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 0; - dudes_hp[j] = 30; + dudes_ac[j] = 5; + dudes_hp[j] = 35; men += dudes_num[j]; } if (dudes[j] = "Hellbrute") { @@ -1435,39 +1470,44 @@ if __b__ { } if (dudes[j] = "Rhino") { scr_en_weapon("Storm Bolter", false, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 20; + dudes_ac[j] = 40; dudes_hp[j] = 200; + dudes_dr[j] = 0.25; veh += dudes_num[j]; dudes_vehicle[j] = 1; } if (dudes[j] = "Predator") { scr_en_weapon("Lascannon", false, dudes_num[j] * 2, dudes[j], j); scr_en_weapon("Twin Linked Lascannon", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; + dudes_ac[j] = 45; dudes_hp[j] = 300; + dudes_dr[j] = 0.5; veh += dudes_num[j]; dudes_vehicle[j] = 1; } if (dudes[j] = "Vindicator") { scr_en_weapon("Demolisher Cannon", false, dudes_num[j], dudes[j], j); scr_en_weapon("Havoc Launcher", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; + dudes_ac[j] = 45; dudes_hp[j] = 300; + dudes_dr[j] = 0.5; veh += dudes_num[j]; dudes_vehicle[j] = 1; } if (dudes[j] = "Land Raider") { scr_en_weapon("Twin Linked Heavy Bolters", false, dudes_num[j], dudes[j], j); scr_en_weapon("Twin Linked Lascannon", false, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 40; + dudes_ac[j] = 50; dudes_hp[j] = 400; + dudes_dr[j] = 0.75; veh += dudes_num[j]; dudes_vehicle[j] = 1; } if (dudes[j] = "Heldrake") { scr_en_weapon("Baleflame", false, dudes_num[j] * 5, dudes[j], j); - dudes_ac[j] = 25; + dudes_ac[j] = 50; dudes_hp[j] = 400; + dudes_dr[j] = 0.75; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -1478,6 +1518,7 @@ if __b__ { scr_en_weapon("Flamer", false, dudes_num[j], dudes[j], j); dudes_ac[j] = 40; dudes_hp[j] = 300; + dudes_dr[j] = 0.5; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -1485,16 +1526,16 @@ if __b__ { if (dudes[j] = "Arch Heretic") { scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); scr_en_weapon("Plasma Pistol", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 30; - dudes_dr[j] = 0.7; + dudes_ac[j] = 10; + dudes_hp[j] = 40; + dudes_dr[j] = 0.25; men += dudes_num[j]; } if (dudes[j] = "Cultist Elite") { scr_en_weapon("Lasgun", true, dudes_num[j], dudes[j], j); scr_en_weapon("Chainaxe", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 10; - dudes_hp[j] = 20; + dudes_hp[j] = 40; men += dudes_num[j]; } if (dudes[j] = "Mutant") { @@ -1506,14 +1547,14 @@ if __b__ { if (dudes[j] = "Daemonhost") { scr_en_weapon("Daemonhost Claws", true, dudes_num[j], dudes[j], j); scr_en_weapon("Daemonhost_Powers", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; + dudes_ac[j] = 10; dudes_hp[j] = 300; dudes_dr[j] = 0.5; medi += dudes_num[j]; } if (dudes[j] = "Possessed") { scr_en_weapon("Possessed Claws", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 17; + dudes_ac[j] = 10; dudes_hp[j] = 100; men += dudes_num[j]; } @@ -1530,6 +1571,7 @@ if __b__ { scr_en_weapon("Heavy Bolter", false, dudes_num[j], dudes[j], j); dudes_ac[j] = 10; dudes_hp[j] = 100; + dudes_dr[j] = 0.25; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -1537,8 +1579,9 @@ if __b__ { if (dudes[j] = "Chaos Leman Russ") { scr_en_weapon("Battle Cannon", false, dudes_num[j], dudes[j], j); scr_en_weapon("Heavy Bolter", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; + dudes_ac[j] = 45; dudes_hp[j] = 250; + dudes_dr[j] = 0.75; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -1574,53 +1617,59 @@ if __b__ { scr_en_weapon("Staff of Light", true, dudes_num[j], dudes[j], j); scr_en_weapon("Staff of Light Shooting", true, dudes_num[j], dudes[j], j); if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { - dudes_ac[j] = 25; + dudes_ac[j] = 10; dudes_hp[j] = 300; + dudes_dr[j] = 0.5; } men += dudes_num[j]; } if (dudes[j] = "Lychguard") { scr_en_weapon("Warscythe", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 35; + dudes_ac[j] = 15; dudes_hp[j] = 100; + dudes_dr[j] = 0.25; men += dudes_num[j]; } if (dudes[j] = "Flayed One") { scr_en_weapon("Melee5", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 25; + dudes_ac[j] = 10; dudes_hp[j] = 100; + dudes_dr[j] = 0.1; men += dudes_num[j]; } if (dudes[j] = "Necron Warrior") { scr_en_weapon("Gauss Flayer", true, dudes_num[j], dudes[j], j); scr_en_weapon("Melee3", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 25; + dudes_ac[j] = 10; dudes_hp[j] = 100; + dudes_dr[j] = 0.1; men += dudes_num[j]; } if (dudes[j] = "Necron Immortal") { scr_en_weapon("Gauss Blaster", true, dudes_num[j], dudes[j], j); scr_en_weapon("Melee3", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 25; + dudes_ac[j] = 12; dudes_hp[j] = 100; + dudes_dr[j] = 0.15; men += dudes_num[j]; } if (dudes[j] = "Necron Wraith") { scr_en_weapon("Wraith Claws", true, dudes_num[j], dudes[j], j); if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { - dudes_ac[j] = 25; + dudes_ac[j] = 10; dudes_hp[j] = 200; } men += dudes_num[j]; - dudes_dr[j] = 0.65; + dudes_dr[j] = 0.25; } if (dudes[j] = "Necron Destroyer") { scr_en_weapon("Gauss Cannon", true, dudes_num[j], dudes[j], j); scr_en_weapon("Melee3", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 25; dudes_hp[j] = 175; + dudes_dr[j] = 0.5; men += dudes_num[j]; } @@ -1629,9 +1678,10 @@ if __b__ { scr_en_weapon("Overcharged Gauss Cannon", false, dudes_num[j] * 2, dudes[j], j); scr_en_weapon("Claws", false, dudes_num[j] * 5, dudes[j], j); if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { - dudes_ac[j] = 30; + dudes_ac[j] = 40; dudes_hp[j] = 600; } + dudes_dr[j] = 0.5; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -1641,6 +1691,7 @@ if __b__ { dudes_ac[j] = 30; dudes_hp[j] = 300; } + dudes_dr[j] = 0.25; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -1648,14 +1699,16 @@ if __b__ { scr_en_weapon("Melee3", false, dudes_num[j] * 2, dudes[j], j); dudes_ac[j] = 10; dudes_hp[j] = 30; + dudes_dr[j] = 0.25; men += dudes_num[j]; dudes_vehicle[j] = 0; } if (dudes[j] = "Necron Monolith") { scr_en_weapon("Gauss Flux Arc", false, dudes_num[j] * 4, dudes[j], j); scr_en_weapon("Particle Whip", false, dudes_num[j] * 1, dudes[j], j); - dudes_ac[j] = 70; - dudes_hp[j] = 300; + dudes_ac[j] = 50; + dudes_hp[j] = 500; + dudes_dr[j] = 0.5; veh += dudes_num[j]; dudes_vehicle[j] = 1; // was 50 / 500 @@ -1665,6 +1718,7 @@ if __b__ { scr_en_weapon("Doomsday Cannon", false, dudes_num[j] * 1, dudes[j], j); dudes_ac[j] = 30; dudes_hp[j] = 150; + dudes_dr[j] = 0.3; veh += dudes_num[j]; dudes_vehicle[j] = 1; } diff --git a/scripts/scr_en_weapon/scr_en_weapon.gml b/scripts/scr_en_weapon/scr_en_weapon.gml index 49c1f41a96..f424ffc980 100644 --- a/scripts/scr_en_weapon/scr_en_weapon.gml +++ b/scripts/scr_en_weapon/scr_en_weapon.gml @@ -36,7 +36,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { if (name = "Venom Claws") { atta = 200; - arp = 0; + arp = -1; rang = 1; spli = 0; if (obj_ini.preomnor = 1) { @@ -52,19 +52,19 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (name = "Warpsword") { atta = 300; - arp = 1; + arp = -2; rang = 1; spli = 3; } if (name = "Iron Claw") { atta = 400; - arp = 1; + arp = -2; rang = 1; spli = 0; } if (name = "Maulerfiend Claws") { atta = 300; - arp = 300; + arp = 1; rang = 1; spli = 3; } @@ -76,19 +76,19 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (name = "Bloodletter Melee") { atta = 70; - arp = 0; + arp = -1; rang = 1; spli = 3; } if (name = "Daemonette Melee") { atta = 65; - arp = 0; + arp = -1; rang = 1; spli = 3; } if (name = "Plaguebearer Melee") { atta = 60; - arp = 0; + arp = -1; rang = 1; spli = 3; if (obj_ini.preomnor = 1) { @@ -97,13 +97,13 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (name = "Khorne Demon Melee") { atta = 350; - arp = 1; + arp = -2; rang = 1; spli = 3; } if (name = "Demon Melee") { atta = 250; - arp = 1; + arp = -2; rang = 1; spli = 3; } @@ -132,7 +132,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { if (obj_ncombat.enemy = 3) { if (name = "Phased Plasma-fusil") { atta = 100; - arp = 1; + arp = -2; rang = 7.1; spli = 3; } @@ -144,7 +144,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (name = "Thallax Melee") { atta = 80; - arp = 0; + arp = -1; rang = 1; spli = 3; } @@ -160,19 +160,19 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Singing Spear") { atta = 120; - arp = 0; + arp = -1; rang = 1; spli = 3; } if (argument0 = "Singing Spear Throw") { atta = 120; - arp = 1; + arp = -1; rang = 2; spli = 3; } if (argument0 = "Witchblade") { atta = 100; - arp = 1; + arp = -1; rang = 1; } if (argument0 = "Psyshock") { @@ -194,43 +194,43 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Ranger Long Rifle") { atta = 60; - arp = 0; + arp = -1; rang = 25; } if (argument0 = "Pathfinder Long Rifle") { atta = 70; - arp = 0; + arp = -1; rang = 25; } if (argument0 = "Shuriken Catapult") { atta = 35; - arp = 0; + arp = -1; rang = 2; } if (argument0 = "Twin Linked Shuriken Catapult") { atta = 50; - arp = 0; + arp = -1; rang = 2; } if (argument0 = "Avenger Shuriken Catapult") { atta = 40; - arp = 0; + arp = -1; rang = 3; } if (argument0 = "Power Weapon") or(argument0 = "Power Blades") { atta = 80; - arp = 0; + arp = -1; rang = 1; spli = 3; } if (argument0 = "Shuriken Pistol") { atta = 25; - arp = 0; + arp = -1; rang = 2.1; } if (argument0 = "Executioner") { atta = 200; - arp = 1; + arp = -2; rang = 1; } if (argument0 = "Scorpion Chainsword") { @@ -246,19 +246,19 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Biting Blade") { atta = 70; - arp = 0; + arp = -1; rang = 1; spli = 3; } if (argument0 = "Scorpian's Claw") { atta = 150; - arp = 1; + arp = -2; rang = 1; spli = 3; } if (argument0 = "Meltabomb") { - atta = 0; - arp = 200; + atta = 200; + arp = 1; rang = 1; amm = 1; } @@ -274,21 +274,21 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Reaper Launcher") { atta = 150; - arp = 80; + arp = -2; rang = 20; amm = 8; spli = 3; } if (argument0 = "Eldar Missile Launcher") { atta = 200; - arp = 1; + arp = -1; rang = 20; amm = 4; spli = 3; } if (argument0 = "Laser Lance") { atta = 80; - arp = 0; + arp = -2; rang = 2; spli = 3; } @@ -300,7 +300,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Plasma Pistol") { atta = 60; - arp = 1; + arp = -2; rang = 3.1; } if (argument0 = "Harlequin's Kiss") { @@ -316,7 +316,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Pulse Laser") { atta = 80; - arp = 1; + arp = 0; rang = 15; } if (argument0 = "Bright Lance") { @@ -326,7 +326,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Shuriken Cannon") { atta = 65; - arp = 0; + arp = -1; rang = 3; } if (argument0 = "Prism Cannon") { @@ -381,7 +381,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Power Klaw") { atta = 150; - arp = 1; + arp = -1; rang = 1; spli = 3; } @@ -401,21 +401,21 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Big Shoota") { atta = 100; - arp = 0; + arp = -1; rang = 12; amm = 30; spli = 0; } if (argument0 = "Dakkagun") { - atta = 150; - arp = 0; + atta = 200; + arp = -1; rang = 10; amm = 20; spli = 0; } if (argument0 = "Deffgun") { atta = 120; - arp = 0; + arp = -2; rang = 8; amm = 20; spli = 0; @@ -434,7 +434,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Kannon") { atta = 200; - arp = 1; + arp = -1; rang = 10.1; amm = 5; spli = 3; @@ -446,21 +446,21 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Burna") { atta = 140; - arp = 1; + arp = 0; rang = 2; amm = 4; spli = 3; } if (argument0 = "Skorcha") { atta = 160; - arp = 1; + arp = -1; rang = 2; amm = 6; spli = 3; } if (argument0 = "Rokkit Launcha") { atta = 150; - arp = 1; + arp = -1; rang = 15; spli = 3; } @@ -482,56 +482,56 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (name = "Plasma Rifle") { atta = 120; - arp = 1; + arp = -2; rang = 10; } if (name = "Cyclic Ion Blaster") { atta = 180; - arp = 0; + arp = -1; rang = 6; spli = 3; } // x6 if (name = "Burst Rifle") { atta = 130; - arp = 0; + arp = -1; rang = 16; spli = 3; } if (name = "Missile Pod") { atta = 160; - arp = 1; + arp = -1; rang = 15; amm = 6; spli = 3; } if (name = "Smart Missile System") { atta = 150; - arp = 1; + arp = -1; rang = 15; } if (name = "Small Railgun") { atta = 150; - arp = 1; + arp = -2; rang = 18; } if (name = "Pulse Rifle") { - atta = 37; + atta = 100; arp = 0; rang = 12; } if (name = "Rail Rifle") { atta = 65; - arp = 0; + arp = 1; rang = 14; } if (name = "Kroot Rifle") { - atta = 25; + atta = 75; arp = 0; rang = 6; } if (name = "Vespid Crystal") { atta = 60; - arp = 0; + arp = -2; rang = 2.1; } if (name = "Railgun") { @@ -545,7 +545,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { if (argument0 = "Bonesword") { atta = 120; - arp = 0; + arp = -2; rang = 1; spli = 3; } @@ -556,11 +556,11 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Heavy Venom Cannon") { atta = 150; - arp = 1; + arp = -2; rang = 8; } if (argument0 = "Crushing Claws") { - atta = 90; + atta = 100; arp = 1; rang = 1; spli = 3; @@ -581,7 +581,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Zoanthrope Blast") { atta = 200; - arp = 1; + arp = -2; rang = 2; } if (argument0 = "Carnifex Claws") { @@ -592,12 +592,12 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Venom Cannon") { atta = 150; - arp = 0; + arp = -2; rang = 5; } if (argument0 = "Deathspitter") { atta = 100; - arp = 0; + arp = -2; rang = 2.1; if (obj_ini.preomnor = 1) { atta = 120; @@ -612,13 +612,13 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } } if (argument0 = "Scything Talons") { - atta = 30; - arp = 0; + atta = 50; + arp = -1; rang = 1; } if (argument0 = "Genestealer Claws") { atta = choose(105, 105, 130); - arp = 1; + arp = -2; rang = 1; } if (argument0 = "Witchfire") { @@ -635,7 +635,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Lictor Claws") { atta = 300; - arp = 0; + arp = -2; rang = 1; } if (argument0 = "Flesh Hooks") { @@ -651,27 +651,27 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { if (argument0 = "Plasma Pistol") { atta = 70; - arp = 1; + arp = -2; rang = 3.1; } if (argument0 = "Power Weapon") { atta = 120; - arp = 0; + arp = -1; rang = 1; } if (argument0 = "Power Sword") { atta = 120; - arp = 0; + arp = -1; rang = 1; } if (argument0 = "Force Weapon") { atta = 400; - arp = 1; + arp = -1; rang = 1; } if (argument0 = "Chainfist") { atta = 300; - arp = 1; + arp = -2; rang = 1; spli = 3; } @@ -690,7 +690,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Heavy Flamer") { atta = 250; - arp = 0; + arp = -1; rang = 2.1; amm = 6; spli = 3; @@ -711,18 +711,18 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } // Bursts if (argument0 = "Power Fist") { atta = 425; - arp = 1; + arp = -2; rang = 1; } if (argument0 = "Possessed Claws") { atta = 250; - arp = 1; + arp = -1; rang = 1; spli = 3; } if (argument0 = "Missile Launcher") { atta = 200; - arp = 1; + arp = -1; rang = 20; amm = 4; spli = 3; @@ -753,19 +753,19 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Sonic Blaster") { atta = 120; - arp = 0; + arp = -1; rang = 3; spli = 3; } if (argument0 = "Rubric Bolter") { atta = 80; - arp = 0; + arp = -1; rang = 12; amm = 15; } // Bursts if (argument0 = "Witchfire") { atta = 200; - arp = 1; + arp = -2; rang = 5.1; } if (argument0 = "Autogun") { @@ -789,13 +789,13 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Twin Linked Heavy Bolters") { atta = 240; - arp = 0; + arp = -1; rang = 16; spli = 3; } if (argument0 = "Twin-Linked Heavy Bolters") { atta = 240; - arp = 0; + arp = -1; rang = 16; spli = 3; } @@ -811,18 +811,18 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Battle Cannon") { atta = 300; - arp = 1; + arp = -1; rang = 12; } if (argument0 = "Demolisher Cannon") { atta = 500; - arp = 1; + arp = -2; rang = 2; if (instance_exists(obj_nfort)) then rang = 5; } if (argument0 = "Earthshaker Cannon") { atta = 300; - arp = 0; + arp = -1; rang = 12; spli = 3; } @@ -844,7 +844,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Reaper Autocannon") { atta = 320; - arp = 0; + arp = -1; rang = 18; amm = 10; spli = 3; @@ -852,14 +852,14 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { if (name = "Ripper Gun") { atta = 40; - arp = 0; + arp = -1; rang = 3; amm = 5; spli = 0; } if (name = "Ogryn Melee") { atta = 90; - arp = 0; + arp = -1; rang = 1; } if (name = "Multi-Laser") { @@ -870,18 +870,18 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { if (argument0 = "Blessed Weapon") { atta = 150; - arp = 1; + arp = -2; rang = 1; } if (argument0 = "Electro-Flail") { atta = 125; - arp = 1; + arp = -1; rang = 1; spli = 3; } if (argument0 = "Neural Whip") { atta = 85; - arp = 0; + arp = -1; rang = 1; spli = 3 } @@ -892,18 +892,18 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Seraphim Pistols") { atta = 200; - arp = 1; + arp = -1; rang = 4; } if (argument0 = "Laser Mace") { atta = 200; - arp = 1; + arp = -1; rang = 5.1; amm = 3; } if (argument0 = "Heavy Bolter") { atta = 120; - arp = 0; + arp = -1; rang = 16; spli = 0; } @@ -931,19 +931,19 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { if (obj_ncombat.enemy = 13) { // Some of these, like the Gauss Particle Cannon and Particle Whip, used to be more than twice as strong. if (name = "Staff of Light") { atta = 200; - arp = 1; + arp = -2; rang = 1; spli = 3; } if (name = "Staff of Light Shooting") { atta = 180; - arp = 0; + arp = -2; rang = 3; spli = 3; } if (name = "Warscythe") { atta = 200; - arp = 1; + arp = -2; rang = 1; spli = 0; } @@ -961,13 +961,13 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (name = "Gauss Cannon") { atta = 180; - arp = 1; + arp = -2; rang = 10; spli = 3; } if (name = "Gauss Particle Cannon") { atta = 300; - arp = 1; + arp = -2; rang = 10.1; spli = 3; } @@ -979,31 +979,31 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (name = "Wraith Claws") { atta = 80; - arp = 1; + arp = -1; rang = 1; spli = 0; } if (name = "Claws") { atta = 300; - arp = 1; + arp = -1; rang = 1; spli = 0; } if (name = "Gauss Flux Arc") { atta = 180; - arp = 1; + arp = -1; rang = 8; spli = 3; } if (name = "Particle Whip") { atta = 300; - arp = 1; + arp = -1; rang = 4.1; spli = 3; } if (name = "Gauss Flayer Array") { atta = 180; - arp = 1; + arp = 0; rang = 8.1; spli = 3; } diff --git a/scripts/scr_shoot/scr_shoot.gml b/scripts/scr_shoot/scr_shoot.gml index 49c90ac9cd..e1665d5411 100644 --- a/scripts/scr_shoot/scr_shoot.gml +++ b/scripts/scr_shoot/scr_shoot.gml @@ -271,8 +271,8 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat if (armour_pierce = -2) then target_armour_value = target_armour_value * 2; } else { if (armour_pierce = 1) then target_armour_value = 0; - if (armour_pierce = 0) then target_armour_value = target_armour_value * 4; - if (armour_pierce = -1) then target_armour_value = target_armour_value * 3; + if (armour_pierce = 0) then target_armour_value = target_armour_value * 3; + if (armour_pierce = -1) then target_armour_value = target_armour_value * 2; if (armour_pierce = -2) then target_armour_value = target_armour_value * 1.5; } @@ -363,8 +363,8 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat target_armour_value2 = target_object.dudes_ac[godd]; if (target_object.dudes_vehicle[godd] = 0) { if (ap2 = 1) then target_armour_value2 = 0; - if (ap2 = 0) then target_armour_value2 = target_armour_value2 * 4; - if (ap2 = -1) then target_armour_value2 = target_armour_value2 * 3; + if (ap2 = 0) then target_armour_value2 = target_armour_value2 * 3; + if (ap2 = -1) then target_armour_value2 = target_armour_value2 * 2; if (ap2 = -2) then target_armour_value2 = target_armour_value2 * 1.5; } if (target_object.dudes_vehicle[godd] = 1) { diff --git a/scripts/scr_weapon/scr_weapon.gml b/scripts/scr_weapon/scr_weapon.gml index 2be38fdafb..2876480038 100644 --- a/scripts/scr_weapon/scr_weapon.gml +++ b/scripts/scr_weapon/scr_weapon.gml @@ -281,7 +281,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 2, - "arp": 1, + "arp": -2, "tags": ["power", "axe", "martial"], }, "Power Fist": { @@ -351,7 +351,7 @@ global.weapons = { "range": 1, "spli": 2, "arp": -2, - "second_profiles": ["Integrated Bolter"], + "second_profiles": ["Integrated-Bolter"], "tags": ["power", "fist", "savage", "boarding 2"], }, "Assault Chainfist": { @@ -568,30 +568,30 @@ global.weapons = { "Bolt Pistol": { "abbreviation": "BltPstl", "attack": { - "standard": 100, - "master_crafted": 120, - "artifact": 150 + "standard": 150, + "master_crafted": 175, + "artifact": 200 }, "description": "A smaller, more compact version of the venerable Boltgun. This model is produced in the standard Godwyn pattern.", "melee_hands": 0, "ranged_hands": 1, "ammo": 18, "range": 4.1, - "spli": 3, + "spli": 2, "arp": 0, "tags": ["bolt", "pistol", "boarding 1"], }, "Wrist-Mounted Storm Bolter": { // TODO: Not used outside of this file atm; "abbreviation": "WrstBlt", "attack": { - "standard": 200, - "master_crafted": 240, - "artifact": 300 + "standard": 275, + "master_crafted": 300, + "artifact": 350 }, "description": "A smaller, more compact version of the venerable Boltgun. This model is produced in the standard Godwyn pattern.", "melee_hands": 0, "ranged_hands": 1, - "ammo": 18, + "ammo": 10, "range": 4.1, "spli": 6, "arp": 0, @@ -967,6 +967,22 @@ global.weapons = { "arp": -1, "tags": ["precision", "rifle"] }, + "Needle Sniper Rifle": { + "abbreviation": "SnprRfl", + "attack": { + "standard": 250, + "master_crafted": 300, + "artifact": 350 + }, + "description": "The Sniper Rifle fires a solid shell over long range and boasts powerful telescopic sights to assist, allowing the user to target enemy weak points and distant foes.", + "melee_hands": 1, + "ranged_hands": 2, + "ammo": 20, + "range": 14, + "spli": 1, + "arp": -1, + "tags": ["precision", "rifle"] + }, "Assault Cannon": { "abbreviation": "AssCann", "attack": { @@ -980,7 +996,7 @@ global.weapons = { "ammo": 5, "range": 12, "spli": 20, - "arp": 0, + "arp": -1, "tags": ["heavy_ranged", "dreadnought"] }, "Autocannon": { @@ -1076,7 +1092,7 @@ global.weapons = { "ammo": 20, "range": 16, "spli": 28, - "arp": 0, + "arp": -1, "tags": ["bolt", "heavy_ranged", "vehicle", "dreadnought"] }, "Twin Linked Lascannon": { @@ -1108,7 +1124,7 @@ global.weapons = { "ammo": 10, "range": 14, "spli": 12, - "arp": 0, + "arp": -1, "tags": ["heavy_ranged", "bolt"] }, "Whirlwind Missiles": { @@ -1145,7 +1161,7 @@ global.weapons = { "ammo": 20, "range": 16, "spli": 21, - "arp": 0, + "arp": -1, "tags": ["vehicle", "dreadnought", "heavy_ranged", "bolt"] }, "Twin Linked Lascannon Mount": { @@ -1177,7 +1193,7 @@ global.weapons = { "ammo": 6, "range": 12, "spli": 40, - "arp": 0, + "arp": -1, "tags": ["vehicle","heavy_ranged", "pintle", "dreadnought"] }, "Reaper Autocannon Mount": { @@ -1209,7 +1225,7 @@ global.weapons = { "ammo": 15, "range": 16, "spli": 50, - "arp": 0, + "arp": -1, "tags": ["bolt","heavy_ranged", "vehicle", "sponson"] }, "Twin Linked Lascannon Sponsons": { @@ -1321,7 +1337,7 @@ global.weapons = { "ammo": 8, "range": 4.1, "spli": 20, - "arp": -2, + "arp": 1, "tags": ["vehicle","heavy_ranged", "Sponson", "melta"], "maintenance" : 0.05, }, @@ -1354,7 +1370,7 @@ global.weapons = { "ammo": 20, "range": 14, "spli": 28, - "arp": 0, + "arp": -1, "tags": ["heavy_ranged", "vehicle", "sponson", "bolt"] }, "Heavy Flamer Sponsons": { @@ -1475,7 +1491,7 @@ global.weapons = { "ranged_hands": 0, "ammo": 4, "range": 4.1, - "spli": 3, + "spli": 10, "arp": 0, "tags": ["flame", "attached"] }, @@ -1658,7 +1674,7 @@ global.weapons = { "ammo": 5, "range": 12, "spli": 40, - "arp": 0, + "arp": -1, "tags": ["heavy_ranged", "twin_linked", "vehicle", "turret"] }, "Flamestorm Cannon Turret": { @@ -1690,7 +1706,7 @@ global.weapons = { "ammo": 6, "range": 4.1, "spli": 20, - "arp": -2, + "arp": 1, "tags": ["vehicle","heavy_ranged", "turret", "melta"] }, "Plasma Destroyer Turret": { @@ -1706,7 +1722,7 @@ global.weapons = { "ammo": 16, "range": 14, "spli": 12, - "arp": -2, + "arp": 1, "tags": ["plasma", "energy","heavy_ranged", "vehicle", "turret"] }, "Heavy Conversion Beam Projector": { From a28d065e1de70a730753b942de34d74e3491fcfe Mon Sep 17 00:00:00 2001 From: Nelsonh <81228864+OH296@users.noreply.github.com> Date: Fri, 24 Jan 2025 20:49:41 +0000 Subject: [PATCH 03/80] fix: enemy and player close combat targeting (#457) --- objects/obj_enunit/Alarm_0.gml | 6 +-- objects/obj_enunit/Alarm_1.gml | 6 +-- objects/obj_ncombat/KeyPress_13.gml | 42 ++++++------------- objects/obj_pnunit/Alarm_0.gml | 5 +-- objects/obj_pnunit/Create_0.gml | 2 - scripts/scr_flavor/scr_flavor.gml | 30 ++++++------- .../scr_marine_struct/scr_marine_struct.gml | 4 +- .../scr_player_combat_weapon_stacks.gml | 31 +++++++++++++- scripts/scr_shoot/scr_shoot.gml | 9 ++-- 9 files changed, 68 insertions(+), 67 deletions(-) diff --git a/objects/obj_enunit/Alarm_0.gml b/objects/obj_enunit/Alarm_0.gml index 8c995e9fc8..c12692b733 100644 --- a/objects/obj_enunit/Alarm_0.gml +++ b/objects/obj_enunit/Alarm_0.gml @@ -41,7 +41,7 @@ else if (flank=1){ } //In melee check -engaged = point_distance(x,0,enemy.x,0)<=10 || !position_empty(x+flank?10:-10,y); +engaged = collision_point(x-10, y, obj_pnunit, 0, 1) || collision_point(x+10, y, obj_pnunit, 0, 1); show_debug_message($"enemy is in melee {engaged}") @@ -253,7 +253,7 @@ else if ((engaged || enemy.engaged) and target_block_is_valid( enemy,obj_pnunit) if (apa[i]=0) or (apa[i]0) then _armour_piercing=1;// Determines if it is _armour_piercing or not if (_armour_piercing) and (instance_exists(obj_nfort)) and (!flank){// Huff and puff and blow the wall down @@ -272,7 +272,7 @@ else if ((engaged || enemy.engaged) and target_block_is_valid( enemy,obj_pnunit) if (!good) then _armour_piercing=0;// Fuck it, shoot at infantry } - if (!_armour_piercing) and (target_block_is_valid(enemy)){// Check for men + if (!_armour_piercing) {// Check for men // show_message(string(wep[i])); var enemy2,g=0,good=0; if ((enemy.men)){ diff --git a/objects/obj_enunit/Alarm_1.gml b/objects/obj_enunit/Alarm_1.gml index 5d74eaac96..39f611d6d4 100644 --- a/objects/obj_enunit/Alarm_1.gml +++ b/objects/obj_enunit/Alarm_1.gml @@ -1750,16 +1750,14 @@ if (obj_ncombat.battle_special = "ruins") or(obj_ncombat.battle_special = "ruins */ if (men + veh + medi <= 0) { - instance_destroy(); + instance_destroy(id); exit; } if (obj_ncombat.started = 0) { obj_ncombat.enemy_forces += self.men + self.veh + self.medi; } - -if (!collision_point(x + 10, y, obj_pnunit, 0, 1)) and(!collision_point(x - 10, y, obj_pnunit, 0, 1)) then engaged = 0; -if (collision_point(x + 10, y, obj_pnunit, 0, 1)) or(collision_point(x - 10, y, obj_pnunit, 0, 1)) then engaged = 1; +engaged = (collision_point(x + 12, y, obj_pnunit, 0, 1)) or(collision_point(x - 12, y, obj_pnunit, 0, 1)); if (neww = 1) then neww = 0; diff --git a/objects/obj_ncombat/KeyPress_13.gml b/objects/obj_ncombat/KeyPress_13.gml index 5b81e982d4..f12f939de7 100644 --- a/objects/obj_ncombat/KeyPress_13.gml +++ b/objects/obj_ncombat/KeyPress_13.gml @@ -83,31 +83,21 @@ if (started>0){// This might be causing problems? if (instance_exists(obj_enunit)) then obj_enunit.alarm[8]=8; } -function reset_combat_message_arrays(){ - for (var i=0;i0) then global_perils-=4; if (global_perils<0) then global_perils=0; turns+=1; - four_show=0;click_stall_timer=15; + four_show=0; + click_stall_timer=15; // if (battle_over!=1) then alarm[8]=15; if (enemy!=6){ if (instance_exists(obj_enunit)){ obj_enunit.alarm[1]=1; } - if (instance_exists(obj_pnunit)){ - obj_pnunit.alarm[3]=2; - obj_pnunit.alarm[1]=3; - turn_count++; - obj_pnunit.alarm[0]=4; - } + set_up_player_blocks_turn(); // alarm[9]=5; } @@ -117,13 +107,12 @@ if (timer_stage=1) or (timer_stage=5){ obj_enunit.alarm[0]=3; } if (instance_exists(obj_pnunit)){ - obj_pnunit.alarm[1]=1; + wait_and_execute(1, scr_player_combat_weapon_stacks); turn_count++; } } - messages=0;messages_to_show=8;largest=0;random_messages=0;priority=0;messages_shown=0; - reset_combat_message_arrays(); - timer_stage=2;timer=0;done=0;messages_shown=0; + reset_combat_message_arrays(); + timer_stage=2; } @@ -134,7 +123,9 @@ else if (timer_stage=3){ if (enemy!=6){ if (instance_exists(obj_pnunit)){ - obj_pnunit.alarm[1]=1; + with(obj_pnunit){ + wait_and_execute(1, scr_player_combat_weapon_stacks); + } turn_count++; } if (instance_exists(obj_enunit)){ @@ -143,25 +134,16 @@ else if (timer_stage=3){ obj_enunit.alarm[8]=4; turns+=1; } - var messages=0;messages_to_show=8;largest=0;random_messages=0;priority=0;messages_shown=0; reset_combat_message_arrays(); - timer_stage=4;timer=0;done=0;messages_shown=0; } if (enemy=6){ - if (instance_exists(obj_pnunit)){ - obj_pnunit.alarm[3]=2; - obj_pnunit.alarm[1]=3; - turn_count++; - obj_pnunit.alarm[0]=4; - turns+=1; - } + set_up_player_blocks_turn(); + turns+=1; if (instance_exists(obj_enunit)){ obj_enunit.alarm[1]=1; } // alarm[9]=5; - var i;i=0;messages=0;messages_to_show=8;largest=0;random_messages=0;priority=0;messages_shown=0; reset_combat_message_arrays(); - timer_stage=4;timer=0;done=0;messages_shown=0; } } diff --git a/objects/obj_pnunit/Alarm_0.gml b/objects/obj_pnunit/Alarm_0.gml index 31d67dd0ac..0ce076d874 100644 --- a/objects/obj_pnunit/Alarm_0.gml +++ b/objects/obj_pnunit/Alarm_0.gml @@ -21,10 +21,9 @@ if (obj_ncombat.defending=false) or (obj_ncombat.dropping=1){ } if (!instance_exists(enemy)) then exit; -if (collision_point(x+10,y,obj_enunit,0,1)) or (collision_point(x-10,y,obj_enunit,0,1)) then engaged=1; -if (!collision_point(x+10,y,obj_enunit,0,1)) and (!collision_point(x-10,y,obj_enunit,0,1)) then engaged=0; +engaged = collision_point(x-14, y, obj_enunit, 0, 1) || collision_point(x+14, y, obj_enunit, 0, 1); -var once_only;once_only=0; +var once_only=0; var i=0,dist=999; var range_shoot=""; dist=point_distance(x,y,enemy.x,enemy.y)/10; diff --git a/objects/obj_pnunit/Create_0.gml b/objects/obj_pnunit/Create_0.gml index cb9991e35e..c40be967f7 100644 --- a/objects/obj_pnunit/Create_0.gml +++ b/objects/obj_pnunit/Create_0.gml @@ -110,5 +110,3 @@ hostile_type=0; hostile_splash=0; alarm[1]=4; - -action_set_alarm(1, 3); diff --git a/scripts/scr_flavor/scr_flavor.gml b/scripts/scr_flavor/scr_flavor.gml index dac3b6a7a7..c5b1382f9d 100644 --- a/scripts/scr_flavor/scr_flavor.gml +++ b/scripts/scr_flavor/scr_flavor.gml @@ -32,21 +32,21 @@ function scr_flavor(id_of_attacking_weapons, target, target_type, number_of_shot unit_name = "", cm_kill = 0; - // I don't understand how this part of code works, nor how it should work, but it doesn't seem to be working properly. - // if (id_of_attacking_weapons > 0) { - // if (array_length(wep_solo[id_of_attacking_weapons]) > 0) { - // character_shot = true; - // full_names = wep_solo[id_of_attacking_weapons]; - // if (wep_title[id_of_attacking_weapons] != "") { - // if (array_length(full_names) == 1) { - // unit_name = wep_title[id_of_attacking_weapons] + " " + wep_solo[id_of_attacking_weapons][0]; - // } else { - // unit_name = wep_title[id_of_attacking_weapons] + "'s" - // } - // } - // if (wep_solo[id_of_attacking_weapons][0] == obj_ini.master_name) then cm_kill = 1; - // } - // } + + if (id_of_attacking_weapons > 0) { + if (array_length(wep_solo[id_of_attacking_weapons]) > 0) { + character_shot = true; + full_names = wep_solo[id_of_attacking_weapons]; + if (wep_title[id_of_attacking_weapons] != "") { + if (array_length(full_names) == 1) { + unit_name = wep_title[id_of_attacking_weapons] + " " + wep_solo[id_of_attacking_weapons][0]; + } else { + unit_name = wep_title[id_of_attacking_weapons] + "'s" + } + } + if (wep_solo[id_of_attacking_weapons][0] == obj_ini.master_name) then cm_kill = 1; + } + } if (obj_ncombat.battle_special = "WL10_reveal") or (obj_ncombat.battle_special = "WL10_later") { if (target_name = "Veteran Chaos Terminator") and (target_name > 0) then obj_ncombat.chaos_angry += casulties * 2; diff --git a/scripts/scr_marine_struct/scr_marine_struct.gml b/scripts/scr_marine_struct/scr_marine_struct.gml index 7c7db6ca23..91f4c84a46 100644 --- a/scripts/scr_marine_struct/scr_marine_struct.gml +++ b/scripts/scr_marine_struct/scr_marine_struct.gml @@ -1437,8 +1437,7 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data={}) primary_weapon=new EquipmentStruct({},"");//create blank weapon struct primary_weapon.attack=strength/3;//calculate damage from player fists primary_weapon.name="fists"; - primary_weapon.range = 1; - primary_weapon.ammo = -1; + primary_weapon.range = 1; } else { if (!valid1 && valid2){ primary_weapon=_wep2; @@ -1580,7 +1579,6 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data={}) wrath.attack=(strength*2) +(0.5*weapon_skill); wrath.name = "hammer_of_wrath"; wrath.range = 1; - wrath.ammo = -1; return wrath; } diff --git a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml index c76c1a3fa2..f07e194a71 100644 --- a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml +++ b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml @@ -122,7 +122,7 @@ function scr_player_combat_weapon_stacks() { if (marine_casting[g]>=0) then marine_casting[g]=0; if (marine_casting[g]<0) then marine_casting[g]+=1;//timer for libs to be able to cast - if (unit.hp()>0) then marine_dead[g]=0; + if (unit.hp()>0) then marine_dead[g]=false; if (unit.hp()>0 && marine_dead[g]!=true){ var head_role = unit.IsSpecialist(); var armour_data = unit.get_armour_data(); @@ -151,7 +151,6 @@ function scr_player_combat_weapon_stacks() { var stack_index = find_stack_index("hammer_of_wrath", head_role, unit); if (stack_index > -1){ add_data_to_stack(stack_index, unit.hammer_of_wrath(), false, head_role, unit); - ammo[stack_index] = -1; if (head_role){ player_head_role_stack(stack_index, unit); } @@ -302,6 +301,34 @@ function scr_player_combat_weapon_stacks() { } } +function set_up_player_blocks_turn(){ + if (instance_exists(obj_pnunit)){ + with (obj_pnunit){ + alarm[3]=2; + wait_and_execute(3, scr_player_combat_weapon_stacks); + alarm[0]=4; + } + } + turn_count++; +} + +function reset_combat_message_arrays(){ + messages=0; + messages_to_show=8; + largest=0; + random_messages=0; + priority=0; + messages_shown=0; + for (var i=0;i ((target_object.veh + target_object.dreads) * 5)) { doom = ((target_object.veh + target_object.dreads) * 5) / shots_fired; @@ -133,9 +135,6 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat damage_per_weapon = floor((doom * damage_per_weapon)); hit_number = floor(hit_number * doom); } - if (melee_or_ranged != "wall") { - shots_fired *= attack_count_mod; - } if (damage_per_weapon = 0) then damage_per_weapon = shots_fired * doom; @@ -202,7 +201,7 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat } if (weapon_index_position >= 0) { - if (ammo[weapon_index_position] = 0) then stop = 1; + if (ammo[weapon_index_position] == 0) then stop = 1; if (ammo[weapon_index_position] > 0) then ammo[weapon_index_position] -= 1; } if (wep[weapon_index_position] == "Missile Silo") then obj_ncombat.player_silos -= min(obj_ncombat.player_silos, 30); From d6533da4156813634053a098ea698ad94bc8fd0f Mon Sep 17 00:00:00 2001 From: KR Da Mystic Date: Mon, 10 Feb 2025 16:40:59 +0900 Subject: [PATCH 04/80] drop maint. value changes --- datafiles/main/chapters/8.JSON | 2 +- .../scr_equipment_struct.gml | 4 +- .../scr_initialize_custom.gml | 50 ++++++------- scripts/scr_weapon/scr_weapon.gml | 73 ++++++++++++++----- 4 files changed, 83 insertions(+), 46 deletions(-) diff --git a/datafiles/main/chapters/8.JSON b/datafiles/main/chapters/8.JSON index 5a53582dbf..cfccd20ae1 100644 --- a/datafiles/main/chapters/8.JSON +++ b/datafiles/main/chapters/8.JSON @@ -226,7 +226,7 @@ "custom_roles": { "veteran": { "name": "Firedrake", - "wep1": "Power Sword" + "wep2": "Power Sword" }, "veteran_sergeant": { "name": "Firedrake Master" diff --git a/scripts/scr_equipment_struct/scr_equipment_struct.gml b/scripts/scr_equipment_struct/scr_equipment_struct.gml index 61f4a19bb3..29ca8eca82 100644 --- a/scripts/scr_equipment_struct/scr_equipment_struct.gml +++ b/scripts/scr_equipment_struct/scr_equipment_struct.gml @@ -49,7 +49,7 @@ function EquipmentStruct(item_data, core_type,quality="none") constructor{ if (maintenance == 0){ if (has_tags(["heavy_ranged","power", "plasma", "melta"])){ - maintenance = 0.05; + maintenance += 0.05; } } static item_tooltip_desc_gen = function(){ @@ -295,7 +295,7 @@ function EquipmentStruct(item_data, core_type,quality="none") constructor{ if (obj_controller.stc_bonus[2]>0 && obj_controller.stc_bonus[2]<3){ if (obj_controller.stc_bonus[1]==1 && has_tag("fist")){ attack*=1.1; - } else if (obj_controller.stc_bonus[1]==2 && has_tag("Plasma")){ + } else if (obj_controller.stc_bonus[1]==2 && has_tag("plasma")){ attack*=1.1; } } diff --git a/scripts/scr_initialize_custom/scr_initialize_custom.gml b/scripts/scr_initialize_custom/scr_initialize_custom.gml index 14f3a9698a..4cf2d0b0f6 100644 --- a/scripts/scr_initialize_custom/scr_initialize_custom.gml +++ b/scripts/scr_initialize_custom/scr_initialize_custom.gml @@ -1340,20 +1340,24 @@ function scr_initialize_custom() { } var weapon_lists = { - heavy_weapons: ["Heavy Bolter", "Heavy Bolter", "Heavy Bolter", "Heavy Bolter", "Missile Launcher", "Missile Launcher", "Multi-Melta", "Lascannon"], - special_weapons: ["Flamer", "Flamer", "Flamer", "Meltagun", "Meltagun", "Plasma Gun"], - melee_weapons: ["Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Power Sword", "Power Sword", "Power Sword", "Lightning Claw", "Lightning Claw", "Lightning Claw", "Power Fist", "Power Fist"], - ranged_weapons: ["Bolter", "Bolter", "Bolter", "Bolter", "Bolter", "Bolter", "Storm Bolter", "Storm Bolter", "Storm Bolter", "Combiflamer", "Combiflamer", "Plasma Pistol"], - pistols: ["Bolt Pistol", "Bolt Pistol", "Bolt Pistol", "Bolt Pistol", "Plasma Pistol"], + heavy_weapons: ["Heavy Bolter", "Heavy Bolter", "Missile Launcher", "Missile Launcher", "Multi-Melta", "Lascannon","Plasma Cannon","Grav Cannon"], + melee_weapons: ["Chainsword", "Chainsword", "Chainsword", "Chainaxe", "Chainaxe"], + special_melee_weapons: [ "Eviscerator", "Eviscerator", "Power Sword", "Power Sword", "Power Axe", "Power Axe", "Lightning Claw", "Lightning Claw", "Lightning Claw", "Power Fist", "Power Fist"], + ranged_weapons: ["Bolter", "Bolter", "Storm Bolter", "Storm Bolter", "Stalker Pattern Bolter", "Stalker Pattern Bolter" ], + special_ranged_weapons: ["Flamer", "Flamer", "Meltagun", "Meltagun", "Plasma Gun", "Grav-Gun"], + combi_weapons: ["Combiflamer","Combiplasma","Combigrav","Combimelta"], + pistols: ["Bolt Pistol", "Bolt Pistol", "Bolt Pistol", "Bolt Pistol", "Hand Flamer", "Hand Flamer", "Plasma Pistol", "Plasma Pistol", "Grav-Pistol"], one_hand_melee: ["Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Power Sword", "Power Sword", "Power Sword", "Lightning Claw", "Lightning Claw", "Lightning Claw", "Power Fist", "Power Fist", "Thunder Hammer"], } var weapon_weighted_lists = { - heavy_weapons: [["Heavy Bolter", 4], ["Missile Launcher", 3], ["Multi-Melta", 2], ["Lascannon", 1]], - special_weapons: [["Flamer", 3], ["Meltagun", 2], ["Plasma Gun", 1]], - melee_weapons: [["Chainsword", 5], ["Power Sword", 4], ["Lightning Claw", 3], ["Power Fist", 2], ["Thunder Hammer", 1]], - ranged_weapons: [["Bolter", 10], ["Storm Bolter", 3], ["Combiflamer", 2], ["Plasma Pistol", 1]], - pistols: [["Bolt Pistol", 5], ["Plasma Pistol", 1]], + heavy_weapons: [["Heavy Bolter", 3], ["Missile Launcher", 3], ["Multi-Melta", 1], ["Lascannon", 1], ["Plasma Cannon", 1], ["Grav Cannon", 1]], + ranged_weapons: [["Bolter", 4], ["Storm Bolter", 2],["Stalker Pattern Bolter", 2]], + special_ranged_weapons: [["Flamer", 2], ["Meltagun", 2], ["Plasma Gun", 1], ["Grav-Gun", 1]], + melee_weapons: [["Chainsword", 3], ["Chainaxe", 2]], + special_melee_weapons: [["Power Sword", 3], ["Power Axe", 3], ["Lightning Claw", 2], ["Power Fist", 2], ["Thunder Hammer", 1]], + combi_weapons: [["Combiflamer", 1], ["Combiplasma", 1], ["Combigrav", 1], ["Combimelta", 1]], + pistols: [["Bolt Pistol", 4],["Hand Flamer", 2], ["Plasma Pistol", 2], ["Grav-Pistol", 1]], } /* squad guidance @@ -1536,13 +1540,13 @@ function scr_initialize_custom() { "option": { "wep1": [ [ - ["Bolter", "Stalker Pattern Bolter", "Storm Bolter"], 5 + weapon_lists.ranged_weapons, 3 ], [ - ["Combiflamer"], 2 + weapon_lists.combi_weapons, 4 ], [ - weapon_lists.special_weapons, 1 + weapon_lists.special_ranged_weapons, 1 ], [ weapon_lists.heavy_weapons, 1 @@ -1584,13 +1588,7 @@ function scr_initialize_custom() { "option": { "wep1": [ [ - ["Chainsword", "Power Sword", "Power Axe", "Lightning Claw"], 6 - ], - [ - ["Power Fist"], 2 - ], - [ - ["Thunder Hammer"], 1 + weapon_lists.special_melee_weapons, 9 ], ], "wep2": [ @@ -1598,7 +1596,7 @@ function scr_initialize_custom() { ["Storm Shield"], 2, ], [ - ["Plasma Pistol"], 3 + weapon_lists.pistols, 3 ], ] } @@ -1686,7 +1684,7 @@ function scr_initialize_custom() { "option": { "wep1": [ [ - weapon_lists.special_weapons, 1 + weapon_lists.special_ranged_weapons, 1 ], [ weapon_lists.heavy_weapons, 1, { @@ -1742,7 +1740,7 @@ function scr_initialize_custom() { "option": { "wep1": [ [ - weapon_lists.melee_weapons, 2, + "Eviscerator", 2, ], ], "wep2": [ @@ -1855,7 +1853,7 @@ function scr_initialize_custom() { "min": 1, "loadout": { "required": { - "wep1": ["Sniper Rifle", 1], + "wep1": ["Needle Sniper Rifle", 1], "wep2": ["Combat Knife", 1] }, }, @@ -1965,7 +1963,7 @@ function scr_initialize_custom() { "option": { "wep1": [ [ - weapon_lists.special_weapons, 3 + weapon_lists.special_ranged_weapons, 3 ], ], "wep2": [ @@ -2020,7 +2018,7 @@ function scr_initialize_custom() { "option": { "wep1": [ [ - weapon_lists.special_weapons, 1 + weapon_lists.special_ranged_weapons, 1 ], [ weapon_lists.heavy_weapons, 1, { diff --git a/scripts/scr_weapon/scr_weapon.gml b/scripts/scr_weapon/scr_weapon.gml index 2876480038..25066829b7 100644 --- a/scripts/scr_weapon/scr_weapon.gml +++ b/scripts/scr_weapon/scr_weapon.gml @@ -211,15 +211,15 @@ global.weapons = { "Lascutter": { "abbreviation": "Lasct", "attack": { - "standard": 100, - "master_crafted": 150, - "artifact": 200 + "standard": 250, + "master_crafted": 300, + "artifact": 425 }, - "description": "Origonally industrial tools used for breaking through bulkheads, this laser weapon is devastating in close combat.", + "description": "Originally industrial tools used for breaking through bulkheads, this laser weapon is devastating in close combat.", "melee_hands": 1, "range": 1, "arp": 1, - "tags": ["las","boarding", "siege"], + "tags": ["las","boarding 3", "siege"], }, "Power Weapon": { "abbreviation": "PwrWpn", @@ -239,7 +239,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 3, - "arp": -2, + "arp": -1, "tags": ["power"], }, "Power Axe": { @@ -263,6 +263,27 @@ global.weapons = { "arp": -1, "tags": ["power", "axe", "dual","savage", "boarding 2"], }, + "Omnissian Axe": { + "abbreviation": "OmnAxe", + "attack": { + "standard": 400, + "master_crafted": 450, + "artifact": 550 + }, + "melee_mod": { + "standard": 1, + "master_crafted": 1.1, + "artifact": 1.2 + }, + "description": "A symbol that is equally weapon and holy icon given only to those trained by the Adeptus Mechanicus and have shown their devotion to the Omnissiah in battle.", + "melee_hands": 1, + "ranged_hands": 0, + "ammo": 0, + "range": 1, + "spli": 5, + "arp": -1, + "tags": ["power", "axe", "savage", "boarding 3"], + }, "Executioner Power Axe": { "abbreviation": "ExPwrAxe", "attack": { @@ -280,7 +301,7 @@ global.weapons = { "ranged_hands": 2, "ammo": 0, "range": 1, - "spli": 2, + "spli": 5, "arp": -2, "tags": ["power", "axe", "martial"], }, @@ -368,7 +389,7 @@ global.weapons = { "spli": 2, "arp": -2, "second_profiles": ["Assault Cannon"], - "tags": ["power","boarding", "chain", "fist", "dual", "siege"], + "tags": ["power","boarding 3", "chain", "fist", "dual", "siege"], }, "Lightning Claw": { "abbreviation": "LghtClw", @@ -389,9 +410,9 @@ global.weapons = { "Dreadnought Lightning Claw": { "abbreviation": "LghtClw", "attack": { - "standard": 300, - "master_crafted": 400, - "artifact": 600 + "standard": 600, + "master_crafted": 700, + "artifact": 850 }, "melee_mod": { "standard": 1.2, @@ -452,7 +473,7 @@ global.weapons = { "spli": 15, "maintenance" : 0.1, "req_exp": 100, - "tags": ["heavy_melee", "power", "hammer", "siege", "savage"], + "tags": ["heavy_melee", "power", "hammer", "siege", "savage"], }, "Power Mace": { "abbreviation": "PwrMace", @@ -593,7 +614,7 @@ global.weapons = { "ranged_hands": 1, "ammo": 10, "range": 4.1, - "spli": 6, + "spli": 8, "arp": 0, "tags": ["bolt", "pistol", "boarding 2"], }, @@ -678,7 +699,7 @@ global.weapons = { "range": 6, "spli": 6, "arp": 1, - "tags": ["grav", "heavy_weapon"], + "tags": ["grav", "heavy_ranged"], "maintenance" : 0.2, }, "Underslung Bolter": { @@ -980,7 +1001,7 @@ global.weapons = { "ammo": 20, "range": 14, "spli": 1, - "arp": -1, + "arp": -2, "tags": ["precision", "rifle"] }, "Assault Cannon": { @@ -1014,6 +1035,7 @@ global.weapons = { "spli": 12, "arp": -1, "tags": ["heavy_ranged", "dreadnought"] + "tags": ["heavy_ranged","explosive", "dreadnought"] }, "Missile Launcher": { "abbreviation": "MsslLnch", @@ -1029,7 +1051,24 @@ global.weapons = { "range": 15, "spli": 10, "arp": -1, - "tags": ["heavy_ranged", "dreadnought"] + + "tags": ["heavy_ranged","explosive", "dreadnought"] + }, + "Cyclone Missile Launcher": { + "abbreviation": "CycLnch", + "attack": { + "standard": 600, + "master_crafted": 700, + "artifact": 950 + }, + "description": "This power pack mounted weapon is capable of unleashing a hail of either armor-piercing or fragmentation rockets. It's ammunition is limited by what the bearer has carried with them.", + "melee_hands": 1, + "ranged_hands": 2, + "ammo": 6, + "range": 15, + "spli": 20, + "arp": -1, + "tags": ["heavy_ranged","explosive"] }, "Lascannon": { "abbreviation": "Lascnn", @@ -1421,7 +1460,7 @@ global.weapons = { "range": 18, "spli": 15, "arp": -1, - "tags": ["vehicle","heavy_ranged", "turret"] + "tags": ["vehicle","heavy_ranged","explosive", "turret"] }, "Storm Bolter": { "abbreviation": "StrmBltr", From 7d6ea4430440b7a20ab57b96e26daf8f70aa498c Mon Sep 17 00:00:00 2001 From: KR Da Mystic Date: Mon, 10 Feb 2025 16:55:20 +0900 Subject: [PATCH 05/80] grav tag maint values --- scripts/scr_weapon/scr_weapon.gml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/scr_weapon/scr_weapon.gml b/scripts/scr_weapon/scr_weapon.gml index 25066829b7..ed87e96076 100644 --- a/scripts/scr_weapon/scr_weapon.gml +++ b/scripts/scr_weapon/scr_weapon.gml @@ -648,9 +648,8 @@ global.weapons = { "range": 4.1, "spli": 1, "arp": 1, - "maintenance" : 0.8, + "maintenance" : 0.2, "tags": ["grav", "pistol"], - "maintenance" : 0.8, }, "Integrated-Grav": { "abbreviation": "IntGrv", @@ -683,7 +682,7 @@ global.weapons = { "spli": 3, "arp": 1, "tags": ["grav"], - "maintenance" : 0.1, + "maintenance" : 0.5, }, "Grav-Cannon": { "abbreviation": "GrvCan", @@ -700,7 +699,7 @@ global.weapons = { "spli": 6, "arp": 1, "tags": ["grav", "heavy_ranged"], - "maintenance" : 0.2, + "maintenance" : 0.8, }, "Underslung Bolter": { "abbreviation": "UndBltr", From 62f15dee23e0da8d338b89d54c31d40fc0ae49ec Mon Sep 17 00:00:00 2001 From: KR Da Mystic Date: Mon, 10 Feb 2025 19:47:01 +0900 Subject: [PATCH 06/80] Shop/forge adds --- objects/obj_shop/Create_0.gml | 12 ++++++++++++ scripts/scr_weapon/scr_weapon.gml | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/objects/obj_shop/Create_0.gml b/objects/obj_shop/Create_0.gml index 49d3fef414..c100c2cab7 100644 --- a/objects/obj_shop/Create_0.gml +++ b/objects/obj_shop/Create_0.gml @@ -380,6 +380,13 @@ if (shop = "equipment") { item_cost[i] = 0; } i += 1; + item[i] = "Wrist-Mounted Storm Bolter"; + item_stocked[i] = scr_item_count(item[i]); + item_cost[i] = 80; + forge_cost[i] = 300; + if (research.bolt[0]<2) then forge_cost[i] = 0; + nobuy[i] = 1; + i += 1; item[i] = "Hand Flamer"; forge_cost[i] = 75; if (research.flame[0]<1) then forge_cost[i] = 0; @@ -508,6 +515,11 @@ if (shop = "equipment") { item_stocked[i] = scr_item_count(item[i]); item_cost[i] = 70; i += 1; + item[i] = "Cyclone Missile Launcher"; + forge_cost[i] = 350; + item_stocked[i] = scr_item_count(item[i]); + item_cost[i] = 150; + i += 1; item[i] = "Lascannon"; item_stocked[i] = scr_item_count(item[i]); forge_cost[i] = 500; diff --git a/scripts/scr_weapon/scr_weapon.gml b/scripts/scr_weapon/scr_weapon.gml index ed87e96076..286501e800 100644 --- a/scripts/scr_weapon/scr_weapon.gml +++ b/scripts/scr_weapon/scr_weapon.gml @@ -602,7 +602,7 @@ global.weapons = { "arp": 0, "tags": ["bolt", "pistol", "boarding 1"], }, - "Wrist-Mounted Storm Bolter": { // TODO: Not used outside of this file atm; + "Wrist-Mounted Storm Bolter": { "abbreviation": "WrstBlt", "attack": { "standard": 275, @@ -616,6 +616,7 @@ global.weapons = { "range": 4.1, "spli": 8, "arp": 0, + "maintenance" : 0.1, "tags": ["bolt", "pistol", "boarding 2"], }, "Webber": { @@ -1033,7 +1034,6 @@ global.weapons = { "range": 14, "spli": 12, "arp": -1, - "tags": ["heavy_ranged", "dreadnought"] "tags": ["heavy_ranged","explosive", "dreadnought"] }, "Missile Launcher": { From 8b69603eae4f225d34545a5ca6ab9ec5b26ee3b3 Mon Sep 17 00:00:00 2001 From: KR Da Mystic Date: Mon, 10 Feb 2025 19:47:48 +0900 Subject: [PATCH 07/80] Librarian power buffs --- scripts/scr_powers/scr_powers.gml | 44 +++++++++++++++---------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/scripts/scr_powers/scr_powers.gml b/scripts/scr_powers/scr_powers.gml index ff446f714b..86bf9be2b8 100644 --- a/scripts/scr_powers/scr_powers.gml +++ b/scripts/scr_powers/scr_powers.gml @@ -236,17 +236,17 @@ function scr_powers(power_set, power_count, enemy_target, unit_id) { // Chaos powers here - if (power_name="Wave of Entropy"){p_type="attack";p_rang=3;p_tar=3;p_spli=1;p_att=220;p_arp=0;p_duration=0; + if (power_name="Wave of Entropy"){p_type="attack";p_rang=3;p_tar=3;p_spli=1;p_att=250;p_arp=-1;p_duration=0; flavour_text2="- a putrid cone of warp energy splashes outward, "; if (obj_ncombat.enemy=9) then flavour_text2+="twisting and rusting everything it touches. "; if (obj_ncombat.enemy!=9) then flavour_text2+="boiling and putrifying flesh. "; if (obj_ncombat.sorcery_seen<2) and (obj_ncombat.present_inquisitor=1) then obj_ncombat.sorcery_seen=1; } - if (power_name="Wave of Change"){p_type="attack";p_rang=3;p_tar=3;p_spli=1;p_att=220;p_arp=0;p_duration=0; + if (power_name="Wave of Change"){p_type="attack";p_rang=3;p_tar=3;p_spli=1;p_att=300;p_arp=-2;p_duration=0; flavour_text2="- a wispy cone of warp energy reaches outward, twisting and morphing all that it touches. "; if (obj_ncombat.sorcery_seen<2) and (obj_ncombat.present_inquisitor=1) then obj_ncombat.sorcery_seen=1; } - if (power_name="Insect Swarm"){p_type="attack";p_rang=3;p_tar=3;p_spli=1;p_att=500;p_arp=1;p_duration=0; + if (power_name="Insect Swarm"){p_type="attack";p_rang=3;p_tar=3;p_spli=1;p_att=500;p_arp=-1;p_duration=0; var rah;rah=choose(1,2); if (rah=1) then flavour_text2="- a massive, black cloud of insects spew from his body. At once they begin burrowing into your foes. "; if (rah=2) then flavour_text2="- rank, ichory insects spew forth from his body at your foes. They begin burrowing through flesh and armour alike. "; @@ -259,13 +259,13 @@ function scr_powers(power_set, power_count, enemy_target, unit_id) { marine_attack[unit_id]+=2;marine_ranged[unit_id]=0; if (obj_ncombat.sorcery_seen<2) and (obj_ncombat.present_inquisitor=1) then obj_ncombat.sorcery_seen=1; } - if (power_name="Putrid Vomit"){p_type="attack";p_rang=2.1;p_tar=3;p_spli=1;p_att=600;p_arp=0;p_duration=0; + if (power_name="Putrid Vomit"){p_type="attack";p_rang=2.1;p_tar=3;p_spli=1;p_att=600;p_arp=-2;p_duration=0; var rah;rah=choose(1,2); flavour_text2="- from in front of their mouth a stream of rancid, acidic vomit spews forth at tremendous pressure, splashing over his foes. "; if (obj_ncombat.enemy=9) then p_att=450; if (obj_ncombat.sorcery_seen<2) and (obj_ncombat.present_inquisitor=1) then obj_ncombat.sorcery_seen=1; } - if (power_name="Warp Bolts"){p_type="attack";p_rang=5;p_tar=3;p_spli=1;p_att=300;p_arp=0;p_duration=0; + if (power_name="Warp Bolts"){p_type="attack";p_rang=5;p_tar=3;p_spli=1;p_att=450;p_arp=1;p_duration=0; var rah;rah=choose(1,2,3); if (rah=1) then flavour_text2="- several bolts of purple warp energy appear and are flung at the enemy. "; if (rah=2) then flavour_text2="- he launches a series of rapid warp bolts at the enemy. "; @@ -320,11 +320,11 @@ function scr_powers(power_set, power_count, enemy_target, unit_id) { // target 0: self 1: ally 2: ally vehicle 3: enemy 4: enemy vehicle - if (power_name="Minor Smite"){p_type="attack";p_rang=5;p_tar=3;p_spli=1;p_att=160;p_arp=0;p_duration=0; + if (power_name="Minor Smite"){p_type="attack";p_rang=5;p_tar=3;p_spli=1;p_att=250;p_arp=-2;p_duration=0; flavour_text2="- a coil of warp energy lashes out at the enemy. "; if (binders=true) then flavour_text2="- a green, sickly coil of energy lashes out at the enemy. "; } - if (power_name="Smite"){p_type="attack";p_rang=5;p_tar=3;p_spli=1;p_att=260;p_arp=0;p_duration=0; + if (power_name="Smite"){p_type="attack";p_rang=5;p_tar=3;p_spli=1;p_att=350;p_arp=-2;p_duration=0; var rah;rah=choose(1,2,3); if (rah=1) then flavour_text2="- a blast of warp energy smashes into the enemy. "; if (rah=2) then flavour_text2="- warp lightning crackles and leaps to the enemy. "; @@ -337,10 +337,10 @@ function scr_powers(power_set, power_count, enemy_target, unit_id) { if (binders=true) then flavour_text2=". An oozing, shifting dome of sorcerous energy appears, covering your forces."; if (binders=true) and (obj_ncombat.sorcery_seen<2) and (obj_ncombat.present_inquisitor=1) then obj_ncombat.sorcery_seen=1; } - if (power_name="Machine Curse"){p_type="attack";p_rang=5;p_tar=4;p_spli=0;p_att=300;p_arp=1;p_duration=0; + if (power_name="Machine Curse"){p_type="attack";p_rang=5;p_tar=4;p_spli=0;p_att=400;p_arp=1;p_duration=0; flavour_text2="- the machine spirit within an enemy vehicle is roused. "; } - if (power_name="Avenge"){p_type="attack";p_rang=5;p_tar=3;p_spli=1;p_att=500;p_arp=0;p_duration=0; + if (power_name="Avenge"){p_type="attack";p_rang=5;p_tar=3;p_spli=1;p_att=500;p_arp=-2;p_duration=0; var rah;rah=choose(1,2); if (rah=1) then flavour_text2="- a destructive avatar of rolling flame crashes into the enemy. "; if (rah=2) then flavour_text2="- a massive conflagration rises up and then crashes down upon the enemy. "; @@ -353,14 +353,14 @@ function scr_powers(power_set, power_count, enemy_target, unit_id) { if (power_name="Might of the Ancients"){p_type="buff";p_rang=0;p_tar=0;p_spli=0;p_att=0;p_arp=0;p_duration=3; flavour_text2=". His physical power and might is increased to unimaginable levels."; } - if (power_name="Vortex of Doom"){p_type="attack";p_rang=5;p_tar=3;p_spli=1;p_att=800;p_arp=1;p_duration=0; + if (power_name="Vortex of Doom"){p_type="attack";p_rang=5;p_tar=3;p_spli=1;p_att=800;p_arp=-2;p_duration=0; flavour_text2="- a hole between real and warp space is torn open with deadly effect. "; if (binders=true) then flavour_text2="- a hole bewteen realspace and the warp is torn, unleashing a myriad of sorcerous energies. "; if (binders=true) and (obj_ncombat.sorcery_seen<2) and (obj_ncombat.present_inquisitor=1) then obj_ncombat.sorcery_seen=1; } - if (power_name="Breathe Fire"){p_type="attack";p_rang=3;p_tar=3;p_spli=0;p_att=200;p_arp=-1;p_duration=0; + if (power_name="Breathe Fire"){p_type="attack";p_rang=3;p_tar=3;p_spli=0;p_att=300;p_arp=-1;p_duration=0; flavour_text2="- a bright jet of flame shoots forth at the enemy. "; if (binders=true) then flavour_text2="- a greenish, eery jet of flame shoots forth at the enemy. "; } @@ -372,14 +372,14 @@ function scr_powers(power_set, power_count, enemy_target, unit_id) { flavour_text2=". Orange sheets of fire shimmer around your forces, protecting them. "; if (binders=true) then flavour_text2="- Purple sheets of warp fire shimmer around your forces, protecting them. "; } - if (power_name="Inferno"){p_type="attack";p_rang=4;p_tar=3;p_spli=1;p_att=600;p_arp=0;p_duration=0; + if (power_name="Inferno"){p_type="attack";p_rang=4;p_tar=3;p_spli=1;p_att=600;p_arp=-1;p_duration=0; var rah;rah=choose(1,2); if (rah=1) then flavour_text2="- a massive conflagration rises up and then crashes down upon the enemy. "; if (rah=2) then flavour_text2="- after breathing deeply a massive jet of flame is unleashed. Smoke billows into the sky. "; if (binders=true) and (rah=1) then flavour_text2="- a hideous being of rolling flame crashes into the enemy. "; if (binders=true) and (rah=2) then flavour_text2="- a massive conflagration rises up and then crashes down upon the enemy. "; } - if (power_name="Sun Burst"){p_type="attack";p_rang=8;p_tar=4;p_spli=1;p_att=200;p_arp=1;p_duration=0; + if (power_name="Sun Burst"){p_type="attack";p_rang=8;p_tar=4;p_spli=1;p_att=400;p_arp=1;p_duration=0; flavour_text2="- a crackling, hissing beam of purple-red flame shoots from him. "; if (binders=true) then flavour_text2="- a crackling, hissing beam of purple warp shoots from him. "; if (binders=true) and (obj_ncombat.sorcery_seen<2) and (obj_ncombat.present_inquisitor=1) then obj_ncombat.sorcery_seen=1; @@ -390,7 +390,7 @@ function scr_powers(power_set, power_count, enemy_target, unit_id) { if (binders=true) and (obj_ncombat.sorcery_seen<2) and (obj_ncombat.present_inquisitor=1) then obj_ncombat.sorcery_seen=1; } - if (power_name="Blood Boil"){p_type="attack";p_rang=3;p_tar=3;p_spli=0;p_att=220;p_arp=0;p_duration=0; + if (power_name="Blood Boil"){p_type="attack";p_rang=3;p_tar=3;p_spli=0;p_att=250;p_arp=1;p_duration=0; flavour_text2="- accelerating the pulse and blood pressure of his foes. "; } if (power_name="Iron Arm"){p_type="buff";p_rang=0;p_tar=0;p_spli=0;p_att=0;p_arp=0;p_duration=3; @@ -402,14 +402,14 @@ function scr_powers(power_set, power_count, enemy_target, unit_id) { if (power_name="Regenerate"){p_type="buff";p_rang=0;p_tar=0;p_spli=0;p_att=0;p_arp=0;p_duration=0; flavour_text2=". His flesh shimmers and twists back together, sealing up wounds and damage. "; } - if (power_name="Haemorrhage"){p_type="attack";p_rang=3;p_tar=3;p_spli=1;p_att=800;p_arp=0;p_duration=0; + if (power_name="Haemorrhage"){p_type="attack";p_rang=3;p_tar=3;p_spli=1;p_att=800;p_arp=-2;p_duration=0; flavour_text2="- reaching inside of his foes and lighting their flesh aflame. "; } - if (power_name="Crush"){p_type="attack";p_rang=4;p_tar=3;p_spli=0;p_att=190;p_arp=0;p_duration=0; + if (power_name="Crush"){p_type="attack";p_rang=4;p_tar=4;p_spli=0;p_att=300;p_arp=1;p_duration=0; flavour_text2="- his foes are entraped in a crushing mass of force. "; } - if (power_name="Shockwave"){p_type="attack";p_rang=4;p_tar=3;p_spli=1;p_att=280;p_arp=0;p_duration=0; + if (power_name="Shockwave"){p_type="attack";p_rang=4;p_tar=3;p_spli=1;p_att=300;p_arp=0;p_duration=0; var rah;rah=choose(1,2,3); flavour_text2="- a massive wave of force smashes aside his foes. "; } @@ -421,22 +421,22 @@ function scr_powers(power_set, power_count, enemy_target, unit_id) { } - if (power_name="Living Lightning"){p_type="attack";p_rang=5;p_tar=3;p_spli=0;p_att=160;p_arp=0;p_duration=0; + if (power_name="Living Lightning"){p_type="attack";p_rang=5;p_tar=3;p_spli=0;p_att=300;p_arp=0;p_duration=0; flavour_text2="- arcs of lightning shoot from hand and strike his foes. "; } if (power_name="Stormbringer"){p_type="buff";p_rang=1;p_tar=1;p_spli=0;p_att=0;p_arp=0;p_duration=2; flavour_text2=". A vortex of ice and winds crackle into existance, covering your forces."; } - if (power_name="Murderous Hurricane"){p_type="attack";p_rang=4;p_tar=3;p_spli=1;p_att=320;p_arp=0;p_duration=0; + if (power_name="Murderous Hurricane"){p_type="attack";p_rang=4;p_tar=3;p_spli=1;p_att=450;p_arp=-1;p_duration=0; var rah;rah=choose(1,2,3); flavour_text2="- a mighty winter gale billows forth, shredding and freezing flesh. "; } - if (power_name="Fury of the Wolf Spirits"){p_type="attack";p_rang=3;p_tar=3;p_spli=1;p_att=440;p_arp=0;p_duration=0; + if (power_name="Fury of the Wolf Spirits"){p_type="attack";p_rang=3;p_tar=3;p_spli=1;p_att=440;p_arp=-2;p_duration=0; var rah;rah=choose(1,2); if (rah=1) then flavour_text2="- a pair of Thunderwolf revenants sprint outward, running down and overwhelming foes. "; if (rah=2) then flavour_text2="- ghostly visages of Freki and Geri launch into his foes, overwhelming them. "; } - if (power_name="Thunderclap"){p_type="attack";p_rang=1.1;p_tar=3;p_spli=1;p_att=600;p_arp=0;p_duration=0; + if (power_name="Thunderclap"){p_type="attack";p_rang=1.1;p_tar=3;p_spli=1;p_att=600;p_arp=-2;p_duration=0; flavour_text2="- smashing his gauntlets together and unleashing a mighty shockwave. "; } if (power_name="Jaws of the World Wolf"){p_type="attack";p_rang=5;p_tar=3;p_spli=1;p_att=800;p_arp=1;p_duration=0; @@ -445,7 +445,7 @@ function scr_powers(power_set, power_count, enemy_target, unit_id) { - if (power_name="Avenge"){p_type="attack";p_rang=5;p_tar=3;p_spli=1;p_att=500;p_arp=0;p_duration=0; + if (power_name="Avenge"){p_type="attack";p_rang=5;p_tar=3;p_spli=1;p_att=500;p_arp=-1;p_duration=0; var rah;rah=choose(1,2); if (rah=1) then flavour_text2="- a destructive avatar of rolling flame crashes into the enemy. "; if (rah=2) then flavour_text2="- a massive conflagration rises up and then crashes down upon the enemy. "; From cde88c280d7c74d998a7a5603ce7c8929d71cac9 Mon Sep 17 00:00:00 2001 From: KR Da Mystic Date: Mon, 10 Feb 2025 19:48:06 +0900 Subject: [PATCH 08/80] list distribution adj --- scripts/scr_initialize_custom/scr_initialize_custom.gml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/scr_initialize_custom/scr_initialize_custom.gml b/scripts/scr_initialize_custom/scr_initialize_custom.gml index 4cf2d0b0f6..8f29b7521d 100644 --- a/scripts/scr_initialize_custom/scr_initialize_custom.gml +++ b/scripts/scr_initialize_custom/scr_initialize_custom.gml @@ -1346,7 +1346,7 @@ function scr_initialize_custom() { ranged_weapons: ["Bolter", "Bolter", "Storm Bolter", "Storm Bolter", "Stalker Pattern Bolter", "Stalker Pattern Bolter" ], special_ranged_weapons: ["Flamer", "Flamer", "Meltagun", "Meltagun", "Plasma Gun", "Grav-Gun"], combi_weapons: ["Combiflamer","Combiplasma","Combigrav","Combimelta"], - pistols: ["Bolt Pistol", "Bolt Pistol", "Bolt Pistol", "Bolt Pistol", "Hand Flamer", "Hand Flamer", "Plasma Pistol", "Plasma Pistol", "Grav-Pistol"], + pistols: ["Bolt Pistol", "Bolt Pistol", "Bolt Pistol", "Hand Flamer", "Hand Flamer", "Plasma Pistol", "Plasma Pistol", "Grav-Pistol"], one_hand_melee: ["Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Power Sword", "Power Sword", "Power Sword", "Lightning Claw", "Lightning Claw", "Lightning Claw", "Power Fist", "Power Fist", "Thunder Hammer"], } @@ -1745,7 +1745,7 @@ function scr_initialize_custom() { ], "wep2": [ [ - ["Plasma Pistol", "Flamer"], 2 + weapon_lists.pistols, 2 ] ] } @@ -1814,7 +1814,7 @@ function scr_initialize_custom() { ], "wep2": [ [ - ["Power Sword", "Chainsword", "Power Axe"], 1 + weapon_lists.melee_weapons, 1 ] ] } @@ -1841,7 +1841,7 @@ function scr_initialize_custom() { "option": { "wep1": [ [ - ["Missile Launcher"], 1 + ["Missile Launcher","Needle Sniper Rifle"], 1 ] ], } From c968d93c49468f4acaac91fccb23503197f7608f Mon Sep 17 00:00:00 2001 From: KR Da Mystic Date: Mon, 10 Feb 2025 20:14:07 +0900 Subject: [PATCH 09/80] Lib arp patch --- ChapterMaster.yyp | 7 +++---- scripts/scr_powers/scr_powers.gml | 7 +++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ChapterMaster.yyp b/ChapterMaster.yyp index f7db82a09a..5eb9780ea5 100644 --- a/ChapterMaster.yyp +++ b/ChapterMaster.yyp @@ -185,7 +185,6 @@ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"daemon7.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"daemon8.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"daemon9.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy_icons.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy10.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy11.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy12.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, @@ -447,10 +446,10 @@ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"eldar.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"genestealercult.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"hulk.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"imperial_ship.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"imperial.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ork_ship.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"imperial_ship.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ork.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ork_ship.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"sector.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"space_marine.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"star.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, @@ -1525,6 +1524,6 @@ ], "templateType": null, "TextureGroups": [ - {"resourceType":"GMTextureGroup","resourceVersion":"1.3","name":"Default","autocrop":true,"border":2,"compressFormat":"bz2","directory":"","groupParent":null,"isScaled":false,"loadType":"default","mipsToGenerate":0,"targets":-1,}, + {"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,}, ], } \ No newline at end of file diff --git a/scripts/scr_powers/scr_powers.gml b/scripts/scr_powers/scr_powers.gml index 86bf9be2b8..fa4e5f8485 100644 --- a/scripts/scr_powers/scr_powers.gml +++ b/scripts/scr_powers/scr_powers.gml @@ -864,12 +864,15 @@ function scr_powers(power_set, power_count, enemy_target, unit_id) { if (enemy5.dudes_vehicle[good2]=0){ if (p_arp=1) then eac=0; - if (p_arp=-1) then eac=eac*6; + if (p_arp=0) then eac=eac*3; + if (p_arp=-1) then eac=eac*2; + if (p_arp=-2) then eac=eac*1.5; } if (enemy5.dudes_vehicle[good2]=1){ if (p_arp=-1) then eac=a; if (p_arp=0) then eac=eac*6; - if (p_arp=-1) then eac=a; + if (p_arp=-1) then eac=eac*4; + if (p_arp=-2) then eac=eac*2; } b=a-eac;if (b<=0) then b=0; From 99eff3992e1aebe07931cfe61af8f42e6afa632f Mon Sep 17 00:00:00 2001 From: KR Da Mystic Date: Fri, 14 Feb 2025 22:56:07 +0900 Subject: [PATCH 10/80] assault loadout adjustment --- scripts/scr_initialize_custom/scr_initialize_custom.gml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/scr_initialize_custom/scr_initialize_custom.gml b/scripts/scr_initialize_custom/scr_initialize_custom.gml index 8f29b7521d..6444eb3f77 100644 --- a/scripts/scr_initialize_custom/scr_initialize_custom.gml +++ b/scripts/scr_initialize_custom/scr_initialize_custom.gml @@ -1745,7 +1745,7 @@ function scr_initialize_custom() { ], "wep2": [ [ - weapon_lists.pistols, 2 + ["Plasma Pistol", "Flamer"], 2 ] ] } From a7675a8edacc02c476ec4058d8550c9974a45489 Mon Sep 17 00:00:00 2001 From: KR Da Mystic Date: Fri, 14 Feb 2025 23:15:58 +0900 Subject: [PATCH 11/80] enemy damage reduc inversion Inverts values so Damage reduction works as intended --- objects/obj_enunit/Alarm_1.gml | 225 +++++++++++++++++---------------- 1 file changed, 116 insertions(+), 109 deletions(-) diff --git a/objects/obj_enunit/Alarm_1.gml b/objects/obj_enunit/Alarm_1.gml index 39f611d6d4..e94f21dc83 100644 --- a/objects/obj_enunit/Alarm_1.gml +++ b/objects/obj_enunit/Alarm_1.gml @@ -134,31 +134,31 @@ repeat(20) { if (dudes[j] = "Bloodletter") { scr_en_weapon("Bloodletter Melee", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 15; - dudes_hp[j] = 120; + dudes_ac[j] = 10; + dudes_hp[j] = 150; men += dudes_num[j]; - dudes_dr[j] = 0.7; + dudes_dr[j] = 0.5; } if (dudes[j] = "Daemonette") { scr_en_weapon("Daemonette Melee", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 15; + dudes_ac[j] = 8; dudes_hp[j] = 100; men += dudes_num[j]; - dudes_dr[j] = 0.7; + dudes_dr[j] = 0.25; } if (dudes[j] = "Pink Horror") { scr_en_weapon("Eldritch Fire", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 15; - dudes_hp[j] = 100; + dudes_ac[j] = 8; + dudes_hp[j] = 80; men += dudes_num[j]; - dudes_dr[j] = 0.8; + dudes_dr[j] = 0.2; } if (dudes[j] = "Plaguebearer") { scr_en_weapon("Plaguebearer Melee", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 15; - dudes_hp[j] = 145; + dudes_ac[j] = 8; + dudes_hp[j] = 200; men += dudes_num[j]; - dudes_dr[j] = 0.6; + dudes_dr[j] = 0.25; } if (dudes[j] = "Helbrute") { @@ -168,7 +168,7 @@ repeat(20) { dudes_hp[j] = 100; veh += dudes_num[j]; dudes_vehicle[j] = 1; - dudes_dr[j] = 0.75; + dudes_dr[j] = 0.25; } if (dudes[j] = "Soul Grinder") { scr_en_weapon("Warpsword", false, dudes_num[j], dudes[j], j); @@ -178,7 +178,7 @@ repeat(20) { dudes_hp[j] = 350; veh += dudes_num[j]; dudes_vehicle[j] = 1; - dudes_dr[j] = 1; + dudes_dr[j] = 0.75; } if (dudes[j] = "Maulerfiend") { scr_en_weapon("Maulerfiend Claws", false, dudes_num[j], dudes[j], j); @@ -186,7 +186,7 @@ repeat(20) { dudes_hp[j] = 250; veh += dudes_num[j]; dudes_vehicle[j] = 1; - dudes_dr[j] = 1; + dudes_dr[j] = 0.75; } } @@ -358,7 +358,7 @@ if __b__ { scr_en_weapon("Heavy Bolter", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 10; dudes_hp[j] = 100; - dudes_dr[j] = 0.1; + dudes_dr[j] = 0.9; men += dudes_num[j]; } @@ -367,7 +367,7 @@ if __b__ { scr_en_weapon("Ogryn Melee", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 10; dudes_hp[j] = 120; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; men += dudes_num[j]; } @@ -376,7 +376,7 @@ if __b__ { scr_en_weapon("Heavy Bolter", false, dudes_num[j], dudes[j], j); dudes_ac[j] = 40; dudes_hp[j] = 200; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -393,7 +393,7 @@ if __b__ { scr_en_weapon("Lascannon", false, dudes_num[j], dudes[j], j); dudes_ac[j] = 45; dudes_hp[j] = 250; - dudes_dr[j] = 0.75; + dudes_dr[j] = 0.25; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -402,7 +402,7 @@ if __b__ { scr_en_weapon("Lascannon", false, dudes_num[j], dudes[j], j); dudes_ac[j] = 40; dudes_hp[j] = 250; - dudes_dr[j] = 0.75; + dudes_dr[j] = 0.25; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -410,7 +410,7 @@ if __b__ { scr_en_weapon("Twin-Linked Lascannon", false, dudes_num[j] * 3, dudes[j], j); dudes_ac[j] = 20; dudes_hp[j] = 300; - dudes_dr[j] = 0.75; + dudes_dr[j] = 0.25; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -468,7 +468,7 @@ if __b__ { dudes_hp[j] = 200; } men += dudes_num[j]; - dudes_dr[j] = 0.75; + dudes_dr[j] = 0.25; } if (dudes[j] = "Palatine") { scr_en_weapon("Plasma Pistol", true, dudes_num[j], dudes[j], j); @@ -491,7 +491,7 @@ if __b__ { dudes_ac[j] = 0; dudes_hp[j] = 150; men += dudes_num[j]; - dudes_dr[j] = 0.3; + dudes_dr[j] = 0.7; } if (dudes[j] = "Celestian") { @@ -514,7 +514,7 @@ if __b__ { dudes_ac[j] = 0; dudes_hp[j] = 75; men += dudes_num[j]; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; } if (dudes[j] = "Battle Sister") { @@ -529,7 +529,7 @@ if __b__ { dudes_ac[j] = 10; dudes_hp[j] = 60; men += dudes_num[j]; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; } if (dudes[j] = "Seraphim") { scr_en_weapon("Seraphim Pistols", true, dudes_num[j], dudes[j], j); @@ -537,7 +537,7 @@ if __b__ { dudes_ac[j] = 10; dudes_hp[j] = 60; men += dudes_num[j]; - dudes_dr[j] = 0.4; + dudes_dr[j] = 0.6; } if (dudes[j] = "Dominion") { scr_en_weapon("Meltagun", true, dudes_num[j], dudes[j], j); @@ -545,7 +545,7 @@ if __b__ { dudes_ac[j] = 10; dudes_hp[j] = 60; men += dudes_num[j]; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; } if (dudes[j] = "Retributor") { if (dudes_num[j] <= 3) then scr_en_weapon("Heavy Bolter", true, dudes_num[j], dudes[j], j); @@ -559,7 +559,7 @@ if __b__ { dudes_ac[j] = 10; dudes_hp[j] = 60; men += dudes_num[j]; - dudes_dr[j] = 0.4; + dudes_dr[j] = 0.6; } if (dudes[j] = "Follower") { @@ -574,7 +574,7 @@ if __b__ { scr_en_weapon("Storm Bolter", false, dudes_num[j] * 2, dudes[j], j); dudes_ac[j] = 40; dudes_hp[j] = 200; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -583,7 +583,7 @@ if __b__ { scr_en_weapon("Heavy Flamer", false, dudes_num[j] * 2, dudes[j], j); dudes_ac[j] = 40; dudes_hp[j] = 200; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -592,7 +592,7 @@ if __b__ { scr_en_weapon("Twin Linked Heavy Flamers", false, dudes_num[j], dudes[j], j); dudes_ac[j] = 40; dudes_hp[j] = 300; - dudes_dr[j] = 0.50; + dudes_dr[j] = 0.35; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -603,7 +603,7 @@ if __b__ { if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { dudes_hp[j] = 200; } - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.55; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -902,10 +902,10 @@ if __b__ { if (dudes[j] = "Minor Warboss") { scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); scr_en_weapon("Big Shoota", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; + dudes_ac[j] = 8; if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { dudes_hp[j] = 150; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; } men += dudes_num[j]; } @@ -915,7 +915,7 @@ if __b__ { dudes_ac[j] = 12; if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { dudes_hp[j] = 200; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; } men += dudes_num[j]; } @@ -954,47 +954,49 @@ if __b__ { if (dudes[j] = "Mekboy") { scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); scr_en_weapon("Big Shoota", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 15; + dudes_ac[j] = 12; dudes_hp[j] = 100; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; men += dudes_num[j]; } if (dudes[j] = "Meganob") { scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); scr_en_weapon("Big Shoota", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 15; + dudes_ac[j] = 12; dudes_hp[j] = 150; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.6; men += dudes_num[j]; } if (dudes[j] = "Flash Git") { scr_en_weapon("Snazzgun", true, dudes_num[j], dudes[j], j); scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; + dudes_ac[j] = 8; dudes_hp[j] = 100; men += dudes_num[j]; } if (dudes[j] = "Cybork") { scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); scr_en_weapon("Big Shoota", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 100; - dudes_dr[j] = 0.25; + dudes_ac[j] = 8; + dudes_hp[j] = 125; + dudes_dr[j] = 0.75; men += dudes_num[j]; } if (dudes[j] = "Ard Boy") { scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); scr_en_weapon("Slugga", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; + dudes_ac[j] = 8; dudes_hp[j] = 80; + dudes_dr[j] = 0.9; men += dudes_num[j]; } if (dudes[j] = "Kommando") { scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); scr_en_weapon("Rokkit Launcha", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 10; - dudes_hp[j] = 150; + dudes_hp[j] = 125; + dudes_dr[j] = 0.9; men += dudes_num[j]; } if (dudes[j] = "Burna Boy") { @@ -1037,7 +1039,7 @@ if __b__ { scr_en_weapon("Rokkit Launcha", false, dudes_num[j], dudes[j], j); dudes_ac[j] = 20; dudes_hp[j] = 200; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -1054,7 +1056,7 @@ if __b__ { scr_en_weapon("Plasma Rifle", true, dudes_num[j], dudes[j], j); scr_en_weapon("Fusion Blaster", true, dudes_num[j], dudes[j], j); scr_en_weapon("Cyclic Ion Blaster", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 15; + dudes_ac[j] = 12; dudes_hp[j] = 300; dudes_dr[j] = 0.5; men += dudes_num[j]; @@ -1064,7 +1066,7 @@ if __b__ { scr_en_weapon("Burst Rifle", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 10; dudes_hp[j] = 200; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; men += dudes_num[j]; } if (dudes[j] = "XV8 Crisis") { @@ -1072,18 +1074,18 @@ if __b__ { scr_en_weapon("Missile Pod", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 10; dudes_hp[j] = 150; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; men += dudes_num[j]; } if (dudes[j] = "XV8 (Brightknife)") { scr_en_weapon("Fusion Blaster", true, dudes_num[j] * 2, dudes[j], j); dudes_ac[j] = 10; dudes_hp[j] = 150; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; men += dudes_num[j]; } if (dudes[j] = "Shield Drone") { - dudes_ac[j] = 10; + dudes_ac[j] = 8; dudes_hp[j] = 50; men += dudes_num[j]; } @@ -1091,28 +1093,28 @@ if __b__ { if (dudes[j] = "XV88 Broadside") { scr_en_weapon("Smart Missile System", true, dudes_num[j] * 2, dudes[j], j); scr_en_weapon("Small Railgun", true, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 15; + dudes_ac[j] = 12; dudes_hp[j] = 225; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; men += dudes_num[j]; } if (dudes[j] = "XV25 Stealthsuit") { scr_en_weapon("Burst Rifle", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; + dudes_ac[j] = 8; dudes_hp[j] = 50; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; men += dudes_num[j]; } if (dudes[j] = "Fire Warrior") { scr_en_weapon("Pulse Rifle", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; + dudes_ac[j] = 8; dudes_hp[j] = 30; men += dudes_num[j]; } if (dudes[j] = "Pathfinder") { scr_en_weapon("Rail Rifle", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; + dudes_ac[j] = 8; dudes_hp[j] = 30; men += dudes_num[j]; } @@ -1135,7 +1137,7 @@ if __b__ { scr_en_weapon("Smart Missile System", false, dudes_num[j], dudes[j], j); dudes_ac[j] = 30; dudes_hp[j] = 150; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -1144,7 +1146,7 @@ if __b__ { scr_en_weapon("Smart Missile System", false, dudes_num[j], dudes[j], j); dudes_ac[j] = 30; dudes_hp[j] = 150; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -1163,29 +1165,30 @@ if __b__ { scr_en_weapon("Heavy Venom Cannon", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 20; dudes_hp[j] = 400; - dudes_dr[j] = 0.6; + dudes_dr[j] = 0.5; men += dudes_num[j]; } if (dudes[j] = "Tyrant Guard") { scr_en_weapon("Crushing Claws", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 15; + dudes_ac[j] = 12; dudes_hp[j] = 200; - dudes_dr[j] = 0.4; + dudes_dr[j] = 0.6; men += dudes_num[j]; } if (dudes[j] = "Tyranid Warrior") { scr_en_weapon("Rending Claws", true, dudes_num[j], dudes[j], j); scr_en_weapon("Devourer", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; + dudes_ac[j] = 8; dudes_hp[j] = 100; + dudes_dr[j] = 0.9; men += dudes_num[j]; } if (dudes[j] = "Zoanthrope") { scr_en_weapon("Zoanthrope Blast", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; + dudes_ac[j] = 8; dudes_hp[j] = 300; - dudes_dr[j] = 0.75; + dudes_dr[j] = 0.25; men += dudes_num[j]; } if (dudes[j] = "Carnifex") { @@ -1226,25 +1229,25 @@ if __b__ { if (dudes[j] = "Genestealer Patriarch") { scr_en_weapon("Genestealer Claws", true, dudes_num[j], dudes[j], j); scr_en_weapon("Witchfire", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; + dudes_ac[j] = 8; dudes_hp[j] = 300; - dudes_dr[j] = 0.75; + dudes_dr[j] = 0.60; men += dudes_num[j]; } if (dudes[j] = "Armoured Limousine") { scr_en_weapon("Autogun", false, dudes_num[j] * 4, dudes[j], j); dudes_ac[j] = 10; dudes_hp[j] = 150; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; veh += dudes_num[j]; dudes_vehicle[j] = 1; } if (dudes[j] = "Lictor") { scr_en_weapon("Lictor Claws", true, dudes_num[j], dudes[j], j); scr_en_weapon("Flesh Hooks", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; + dudes_ac[j] = 8; dudes_hp[j] = 300; - dudes_dr[j] = 0.75; + dudes_dr[j] = 0.60; men += dudes_num[j]; } @@ -1330,7 +1333,7 @@ if __b__ { dudes_ac[j] = 40; dudes_hp[j] = 120; men += dudes_num[j]; - dudes_dr[j] = 0.6; + dudes_dr[j] = 0.4; } if (dudes[j] = "World Eaters Terminator") { scr_en_weapon("Power Fist", true, dudes_num[j] * 2, dudes[j], j); @@ -1338,7 +1341,7 @@ if __b__ { dudes_ac[j] = 40; dudes_hp[j] = 120; men += dudes_num[j]; - dudes_dr[j] = 0.6; + dudes_dr[j] = 0.4; } if (dudes[j] = "Obliterator") { scr_en_weapon("Power Fist", true, dudes_num[j], dudes[j], j); @@ -1353,6 +1356,7 @@ if __b__ { scr_en_weapon("Chainsword", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 20; dudes_hp[j] = 125; + dudes_dr[j] = 0.85; men += dudes_num[j]; } if (dudes[j] = "Venerable Chaos Chosen") { @@ -1361,7 +1365,7 @@ if __b__ { dudes_ac[j] = 20; dudes_hp[j] = 125; men += dudes_num[j]; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; } if (dudes[j] = "Possessed") { @@ -1376,6 +1380,7 @@ if __b__ { scr_en_weapon("Chainsword", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 20; dudes_hp[j] = 100; + dudes_dr[j] = 0.9; men += dudes_num[j]; } if (dudes[j] = "Havoc") { @@ -1383,6 +1388,7 @@ if __b__ { scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 20; dudes_hp[j] = 100; + dudes_dr[j] = 0.9; men += dudes_num[j]; } if (dudes[j] = "Raptor") { @@ -1390,7 +1396,7 @@ if __b__ { scr_en_weapon("Bolt Pistol", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 20; dudes_hp[j] = 100; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; dudes_special[j] = "Jump Pack"; men += dudes_num[j]; } @@ -1400,7 +1406,7 @@ if __b__ { scr_en_weapon("Chainaxe", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 20; dudes_hp[j] = 100; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; men += dudes_num[j]; } if (dudes[j] = "World Eaters Veteran") { @@ -1408,7 +1414,7 @@ if __b__ { scr_en_weapon("Chainaxe", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 20; dudes_hp[j] = 100; - dudes_dr[j] = 0.3; + dudes_dr[j] = 0.7; men += dudes_num[j]; } @@ -1417,7 +1423,7 @@ if __b__ { scr_en_weapon("Bolt Pistol", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 20; dudes_hp[j] = 100; - dudes_dr[j] = 0.35; + dudes_dr[j] = 0.65; men += dudes_num[j]; } if (dudes[j] = "Plague Marine") { @@ -1433,7 +1439,7 @@ if __b__ { scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 20; dudes_hp[j] = 100; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; men += dudes_num[j]; } if (dudes[j] = "Rubric Marine") { @@ -1441,7 +1447,7 @@ if __b__ { scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 20; dudes_hp[j] = 125; - dudes_dr[j] = 0.35; + dudes_dr[j] = 0.65; men += dudes_num[j]; } if (dudes[j] = "Rubric Sorcerer") { @@ -1472,7 +1478,7 @@ if __b__ { scr_en_weapon("Storm Bolter", false, dudes_num[j] * 2, dudes[j], j); dudes_ac[j] = 40; dudes_hp[j] = 200; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -1499,7 +1505,7 @@ if __b__ { scr_en_weapon("Twin Linked Lascannon", false, dudes_num[j] * 2, dudes[j], j); dudes_ac[j] = 50; dudes_hp[j] = 400; - dudes_dr[j] = 0.75; + dudes_dr[j] = 0.25; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -1507,7 +1513,7 @@ if __b__ { scr_en_weapon("Baleflame", false, dudes_num[j] * 5, dudes[j], j); dudes_ac[j] = 50; dudes_hp[j] = 400; - dudes_dr[j] = 0.75; + dudes_dr[j] = 0.25; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -1526,16 +1532,17 @@ if __b__ { if (dudes[j] = "Arch Heretic") { scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); scr_en_weapon("Plasma Pistol", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; + dudes_ac[j] = 8; dudes_hp[j] = 40; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; men += dudes_num[j]; } if (dudes[j] = "Cultist Elite") { scr_en_weapon("Lasgun", true, dudes_num[j], dudes[j], j); scr_en_weapon("Chainaxe", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; + dudes_ac[j] = 8; dudes_hp[j] = 40; + dudes_dr[j] = 0.9; men += dudes_num[j]; } if (dudes[j] = "Mutant") { @@ -1547,15 +1554,16 @@ if __b__ { if (dudes[j] = "Daemonhost") { scr_en_weapon("Daemonhost Claws", true, dudes_num[j], dudes[j], j); scr_en_weapon("Daemonhost_Powers", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; + dudes_ac[j] = 8; dudes_hp[j] = 300; dudes_dr[j] = 0.5; medi += dudes_num[j]; } if (dudes[j] = "Possessed") { scr_en_weapon("Possessed Claws", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; + dudes_ac[j] = 8; dudes_hp[j] = 100; + dudes_dr[j] = 0.75; men += dudes_num[j]; } @@ -1571,7 +1579,7 @@ if __b__ { scr_en_weapon("Heavy Bolter", false, dudes_num[j], dudes[j], j); dudes_ac[j] = 10; dudes_hp[j] = 100; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -1581,7 +1589,7 @@ if __b__ { scr_en_weapon("Heavy Bolter", false, dudes_num[j], dudes[j], j); dudes_ac[j] = 45; dudes_hp[j] = 250; - dudes_dr[j] = 0.75; + dudes_dr[j] = 0.25; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -1617,7 +1625,7 @@ if __b__ { scr_en_weapon("Staff of Light", true, dudes_num[j], dudes[j], j); scr_en_weapon("Staff of Light Shooting", true, dudes_num[j], dudes[j], j); if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { - dudes_ac[j] = 10; + dudes_ac[j] = 12; dudes_hp[j] = 300; dudes_dr[j] = 0.5; } @@ -1625,33 +1633,33 @@ if __b__ { } if (dudes[j] = "Lychguard") { scr_en_weapon("Warscythe", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 15; + dudes_ac[j] = 12; dudes_hp[j] = 100; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; men += dudes_num[j]; } if (dudes[j] = "Flayed One") { scr_en_weapon("Melee5", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 100; - dudes_dr[j] = 0.1; + dudes_ac[j] = 8; + dudes_hp[j] = 75; + dudes_dr[j] = 0.9; men += dudes_num[j]; } if (dudes[j] = "Necron Warrior") { scr_en_weapon("Gauss Flayer", true, dudes_num[j], dudes[j], j); scr_en_weapon("Melee3", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 100; - dudes_dr[j] = 0.1; + dudes_ac[j] = 8; + dudes_hp[j] = 75; + dudes_dr[j] = 0.9; men += dudes_num[j]; } if (dudes[j] = "Necron Immortal") { scr_en_weapon("Gauss Blaster", true, dudes_num[j], dudes[j], j); scr_en_weapon("Melee3", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 12; - dudes_hp[j] = 100; - dudes_dr[j] = 0.15; + dudes_ac[j] = 8; + dudes_hp[j] = 75; + dudes_dr[j] = 0.85; men += dudes_num[j]; } @@ -1662,7 +1670,7 @@ if __b__ { dudes_hp[j] = 200; } men += dudes_num[j]; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; } if (dudes[j] = "Necron Destroyer") { scr_en_weapon("Gauss Cannon", true, dudes_num[j], dudes[j], j); @@ -1691,15 +1699,15 @@ if __b__ { dudes_ac[j] = 30; dudes_hp[j] = 300; } - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; veh += dudes_num[j]; dudes_vehicle[j] = 1; } if (dudes[j] = "Canoptek Scarab") { scr_en_weapon("Melee3", false, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 10; + dudes_ac[j] = 8; dudes_hp[j] = 30; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; men += dudes_num[j]; dudes_vehicle[j] = 0; } @@ -1708,17 +1716,16 @@ if __b__ { scr_en_weapon("Particle Whip", false, dudes_num[j] * 1, dudes[j], j); dudes_ac[j] = 50; dudes_hp[j] = 500; - dudes_dr[j] = 0.5; + dudes_dr[j] = 0.25; veh += dudes_num[j]; dudes_vehicle[j] = 1; - // was 50 / 500 } if (dudes[j] = "Doomsday Arc") { scr_en_weapon("Gauss Flayer Array", false, dudes_num[j] * 2, dudes[j], j); scr_en_weapon("Doomsday Cannon", false, dudes_num[j] * 1, dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 150; - dudes_dr[j] = 0.3; + dudes_ac[j] = 40; + dudes_hp[j] = 350; + dudes_dr[j] = 0.5; veh += dudes_num[j]; dudes_vehicle[j] = 1; } From bf5658b25f20d6d5ab31fff761e54d096582284a Mon Sep 17 00:00:00 2001 From: KR Da Mystic Date: Sat, 15 Feb 2025 00:50:33 +0900 Subject: [PATCH 12/80] Eldar Durability --- objects/obj_enunit/Alarm_1.gml | 117 ++++++++++++++++++++------------- 1 file changed, 70 insertions(+), 47 deletions(-) diff --git a/objects/obj_enunit/Alarm_1.gml b/objects/obj_enunit/Alarm_1.gml index e94f21dc83..8b935e419e 100644 --- a/objects/obj_enunit/Alarm_1.gml +++ b/objects/obj_enunit/Alarm_1.gml @@ -640,8 +640,8 @@ if __b__ { if (dudes[j] = "Leader") { scr_en_weapon("Singing Spear", true, dudes_num[j], dudes[j], j); scr_en_weapon("Singing Spear Throw", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 300; + dudes_ac[j] = 10; + dudes_hp[j] = 150; men += dudes_num[j]; dudes_dr[j] = 0.5; } @@ -649,22 +649,25 @@ if __b__ { if (dudes[j] = "Autarch") { scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); scr_en_weapon("Fusion Gun", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; + dudes_ac[j] = 12; dudes_hp[j] = 150; + dudes_dr[j] = 0.75; men += dudes_num[j]; } if (dudes[j] = "Farseer") { scr_en_weapon("Singing Spear", true, dudes_num[j], dudes[j], j); scr_en_weapon("Singing Spear Throw", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 150; + dudes_ac[j] = 10; + dudes_hp[j] = 120; + dudes_dr[j] = 0.6; men += dudes_num[j]; } if (dudes[j] = "Warlock") { scr_en_weapon("Witchblade", true, dudes_num[j], dudes[j], j); scr_en_weapon("Psyshock", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 100; + dudes_ac[j] = 10; + dudes_hp[j] = 80; + dudes_dr[j] = 0.75; men += dudes_num[j]; } if (dudes[j] = "Avatar") { @@ -672,159 +675,173 @@ if __b__ { scr_en_weapon("Avatar Smite", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 40; dudes_hp[j] = 300; + dudes_dr[j] = 0.55; veh += dudes_num[j]; } if (dudes[j] = "Mighty Avatar") { scr_en_weapon("Wailing Doom", true, dudes_num[j], dudes[j], j); scr_en_weapon("Avatar Smite", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 55; + dudes_ac[j] = 50; dudes_hp[j] = 450; + dudes_dr[j] = 0.5; veh += dudes_num[j]; } if (dudes[j] = "Godly Avatar") { scr_en_weapon("Wailing Doom", true, dudes_num[j], dudes[j], j); scr_en_weapon("Avatar Smite", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 70; + dudes_ac[j] = 60; dudes_hp[j] = 600; + dudes_dr[j] = 0.40; veh += dudes_num[j]; } if (dudes[j] = "Ranger") { scr_en_weapon("Ranger Long Rifle", true, dudes_num[j], dudes[j], j); scr_en_weapon("Shuriken Pistol", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 30; + dudes_ac[j] = 8; + dudes_hp[j] = 40; + dudes_dr[j] = 0.9; men += dudes_num[j]; } if (dudes[j] = "Pathfinder") { scr_en_weapon("Pathfinder Long Rifle", true, dudes_num[j], dudes[j], j); scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; + dudes_ac[j] = 8; dudes_hp[j] = 60; + dudes_dr[j] = 0.8; men += dudes_num[j]; } if (dudes[j] = "Dire Avenger") { scr_en_weapon("Avenger Shuriken Catapult", true, dudes_num[j], dudes[j], j); scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 15; - dudes_hp[j] = 30; + dudes_ac[j] = 10; + dudes_hp[j] = 40; men += dudes_num[j]; } if (dudes[j] = "Dire Avenger Exarch") { scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 50; // Shimmershield + dudes_ac[j] = 10; + dudes_hp[j] = 70; // Shimmershield men += dudes_num[j]; } if (dudes[j] = "Howling Banshee") { scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); scr_en_weapon("Shuriken Pistol", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 15; - dudes_hp[j] = 30; + dudes_ac[j] = 8; + dudes_hp[j] = 40; + dudes_dr[j] = 0.8; men += dudes_num[j]; } if (dudes[j] = "Howling Banshee Exarch") { scr_en_weapon("Executioner", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 50; + dudes_ac[j] = 10; + dudes_hp[j] = 60; + dudes_dr[j] = 0.75; men += dudes_num[j]; } if (dudes[j] = "Striking Scorpion") { scr_en_weapon("Scorpion Chainsword", true, dudes_num[j], dudes[j], j); scr_en_weapon("Shuriken Pistol", true, dudes_num[j], dudes[j], j); scr_en_weapon("Mandiblaster", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 30; + dudes_ac[j] = 8; + dudes_hp[j] = 60; men += dudes_num[j]; } if (dudes[j] = "Striking Scorpion Exarch") { scr_en_weapon("Biting Blade", true, dudes_num[j], dudes[j], j); scr_en_weapon("Scorpion's Claw", true, dudes_num[j], dudes[j], j); scr_en_weapon("Mandiblaster", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 50; + dudes_ac[j] = 10; + dudes_hp[j] = 80; men += dudes_num[j]; } if (dudes[j] = "Fire Dragon") { scr_en_weapon("Fusion Gun", true, dudes_num[j], dudes[j], j); scr_en_weapon("Meltabomb", true, dudes_num[j], dudes[j], j); scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 15; - dudes_hp[j] = 30; + dudes_ac[j] = 12; + dudes_hp[j] = 40; men += dudes_num[j]; } if (dudes[j] = "Fire Dragon Exarch") { scr_en_weapon("Firepike", true, dudes_num[j], dudes[j], j); scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 50; + dudes_ac[j] = 12; + dudes_hp[j] = 60; men += dudes_num[j]; } if (dudes[j] = "Warp Spider") { scr_en_weapon("Deathspinner", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 15; - dudes_hp[j] = 30; + dudes_ac[j] = 8; + dudes_hp[j] = 40; + dudes_dr[j] = 0.9; men += dudes_num[j]; } if (dudes[j] = "Warp Spider Exarch") { scr_en_weapon("Dual Deathspinners", true, dudes_num[j], dudes[j], j); scr_en_weapon("Powerblades", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 50; + dudes_ac[j] = 10; + dudes_hp[j] = 60; + dudes_dr[j] = 0.8; men += dudes_num[j]; } if (dudes[j] = "Dark Reaper") { scr_en_weapon("Reaper Launcher", true, dudes_num[j], dudes[j], j); scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 30; + dudes_ac[j] = 10; + dudes_hp[j] = 40; men += dudes_num[j]; } if (dudes[j] = "Dark Reaper Exarch") { - scr_en_weapon("Eldar Missile Launcher", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Tempest Launcher", true, dudes_num[j], dudes[j], j); scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; + dudes_ac[j] = 10; dudes_hp[j] = 50; men += dudes_num[j]; } if (dudes[j] = "Shining Spear") { scr_en_weapon("Laser Lance", true, dudes_num[j], dudes[j], j); scr_en_weapon("Twin Linked Shuriken Catapult", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 30; - men += dudes_num[j]; + dudes_ac[j] = 10; + dudes_hp[j] = 75; + dudes_dr[j] = 0.8; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; } if (dudes[j] = "Guardian") { scr_en_weapon("Shuriken Catapult", true, dudes_num[j], dudes[j], j); scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 15; + dudes_ac[j] = 8; dudes_hp[j] = 30; men += dudes_num[j]; } if (dudes[j] = "Grav Platform") { scr_en_weapon("Pulse Laser", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 15; - dudes_hp[j] = 70; + dudes_ac[j] = 10; + dudes_hp[j] = 60; men += dudes_num[j]; } if (dudes[j] = "Trouper") { scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); scr_en_weapon("Fusion Pistol", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; + dudes_ac[j] = 8; dudes_hp[j] = 50; + dudes_dr[j] = 0.25; men += dudes_num[j]; } if (dudes[j] = "Athair") { scr_en_weapon("Plasma Pistol", true, dudes_num[j], dudes[j], j); scr_en_weapon("Harlequin's Kiss", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; + dudes_ac[j] = 8; dudes_hp[j] = 75; + dudes_dr[j] = 0.25; men += dudes_num[j]; } if (dudes[j] = "Wraithguard") { scr_en_weapon("Wraithcannon", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 80; + dudes_ac[j] = 15; + dudes_hp[j] = 125; + dudes_dr[j] = 0.70; men += dudes_num[j]; } if (dudes[j] = "Vyper") { @@ -832,6 +849,7 @@ if __b__ { scr_en_weapon("Pulse Laser", false, dudes_num[j], dudes[j], j); dudes_ac[j] = 40; dudes_hp[j] = 100; + dudes_dr[j] = 0.8; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -841,6 +859,7 @@ if __b__ { scr_en_weapon("Bright Lance", false, dudes_num[j], dudes[j], j); dudes_ac[j] = 40; dudes_hp[j] = 200; + dudes_dr[j] = 0.6; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -849,13 +868,15 @@ if __b__ { scr_en_weapon("Prism Cannon", false, dudes_num[j], dudes[j], j); dudes_ac[j] = 40; dudes_hp[j] = 200; + dudes_dr[j] = 0.5; veh += dudes_num[j]; dudes_vehicle[j] = 1; } if (dudes[j] = "Nightspinner") { scr_en_weapon("Twin Linked Doomweaver", false, dudes_num[j], dudes[j], j); dudes_ac[j] = 40; - dudes_hp[j] = 170; + dudes_hp[j] = 200; + dudes_dr[j] = 0.6; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -865,6 +886,7 @@ if __b__ { scr_en_weapon("Starcannon", false, dudes_num[j], dudes[j], j); dudes_ac[j] = 40; dudes_hp[j] = 200; + dudes_dr[j] = 0.5; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -874,6 +896,7 @@ if __b__ { scr_en_weapon("Titan Starcannon", false, dudes_num[j], dudes[j], j); dudes_ac[j] = 50; dudes_hp[j] = 800; + dudes_dr[j] = 0.35; veh += dudes_num[j]; dudes_vehicle[j] = 1; } From c82af0ab4fe848519474658fdfc342f5d5e57cc5 Mon Sep 17 00:00:00 2001 From: KR Da Mystic Date: Sat, 15 Feb 2025 00:50:49 +0900 Subject: [PATCH 13/80] Eldar weapon --- scripts/scr_en_weapon/scr_en_weapon.gml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/scripts/scr_en_weapon/scr_en_weapon.gml b/scripts/scr_en_weapon/scr_en_weapon.gml index f424ffc980..f830b93a35 100644 --- a/scripts/scr_en_weapon/scr_en_weapon.gml +++ b/scripts/scr_en_weapon/scr_en_weapon.gml @@ -152,12 +152,19 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { if (obj_ncombat.enemy = 6) { - if (argument0 = "Fusion Gun") or(argument0 = "Firepike") { + if (argument0 = "Fusion Gun"){ atta = 200; arp = 1; rang = 2; amm = 4; } + + if (argument0 = "Firepike") { + atta = 300; + arp = 1; + rang = 4; + amm = 4; + } if (argument0 = "Singing Spear") { atta = 120; arp = -1; @@ -268,7 +275,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 2; } if (argument0 = "Dual Deathspinner") { - atta = 80; + atta = 100; arp = 0; rang = 2; } @@ -279,12 +286,12 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { amm = 8; spli = 3; } - if (argument0 = "Eldar Missile Launcher") { + if (argument0 = "Tempest Launcher") { atta = 200; arp = -1; rang = 20; - amm = 4; - spli = 3; + amm = 8; + spli = 9; } if (argument0 = "Laser Lance") { atta = 80; From bdccc770db26bd4d1ad98cbe636be707be5bfec3 Mon Sep 17 00:00:00 2001 From: KR Da Mystic Date: Sat, 15 Feb 2025 01:22:47 +0900 Subject: [PATCH 14/80] Daemons Durability --- objects/obj_enunit/Alarm_1.gml | 56 ++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/objects/obj_enunit/Alarm_1.gml b/objects/obj_enunit/Alarm_1.gml index 8b935e419e..25e9ac8929 100644 --- a/objects/obj_enunit/Alarm_1.gml +++ b/objects/obj_enunit/Alarm_1.gml @@ -85,8 +85,8 @@ repeat(20) { if ((obj_ncombat.started = 0) or(neww = 1)) or(dudes_num[j] > 1) { if (dudes[j] = "Greater Daemon of Khorne") { - dudes_ac[j] = 18; - dudes_hp[j] = 600; + dudes_ac[j] = 12; + dudes_hp[j] = 700; } } if (dudes[j] = "Greater Daemon of Khorne") { @@ -97,20 +97,22 @@ repeat(20) { } if ((obj_ncombat.started = 0) or(neww = 1)) or(dudes_num[j] > 1) { if (dudes[j] = "Greater Daemon of Slaanesh") { - dudes_ac[j] = 18; - dudes_hp[j] = 500; + dudes_ac[j] = 10; + dudes_hp[j] = 500; + dudes_dr[j] = 0.25; } } if (dudes[j] = "Greater Daemon of Slaanesh") { scr_en_weapon("Demon Melee", true, dudes_num[j], dudes[j], j); scr_en_weapon("Lash Whip", true, dudes_num[j], dudes[j], j); - dudes_dr[j] = 0.7; + dudes_dr[j] = 0.25; medi += dudes_num[j]; } if ((obj_ncombat.started = 0) or(neww = 1)) or(dudes_num[j] > 1) { if (dudes[j] = "Greater Daemon of Nurgle") { - dudes_ac[j] = 25; - dudes_hp[j] = 700; + dudes_ac[j] = 8; + dudes_hp[j] = 900; + dudes_dr[j] = 0.2; } } if (dudes[j] = "Greater Daemon of Nurgle") { @@ -121,54 +123,54 @@ repeat(20) { } if ((obj_ncombat.started = 0) or(neww = 1)) or(dudes_num[j] > 1) { if (dudes[j] = "Greater Daemon of Tzeentch") { - dudes_ac[j] = 18; - dudes_hp[j] = 500; + dudes_ac[j] = 10; + dudes_hp[j] = 600; } } if (dudes[j] = "Greater Daemon of Tzeentch") { scr_en_weapon("Demon Melee", true, dudes_num[j], dudes[j], j); scr_en_weapon("Witchfire", true, dudes_num[j], dudes[j], j); - dudes_dr[j] = 0.7; + dudes_dr[j] = 0.75; medi += dudes_num[j]; } if (dudes[j] = "Bloodletter") { scr_en_weapon("Bloodletter Melee", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 10; - dudes_hp[j] = 150; + dudes_hp[j] = 200; men += dudes_num[j]; - dudes_dr[j] = 0.5; + dudes_dr[j] = 0.4; } if (dudes[j] = "Daemonette") { scr_en_weapon("Daemonette Melee", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 8; - dudes_hp[j] = 100; + dudes_hp[j] = 150; men += dudes_num[j]; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.3; } if (dudes[j] = "Pink Horror") { scr_en_weapon("Eldritch Fire", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 8; - dudes_hp[j] = 80; + dudes_hp[j] = 100; men += dudes_num[j]; - dudes_dr[j] = 0.2; + dudes_dr[j] = 0.5; } if (dudes[j] = "Plaguebearer") { scr_en_weapon("Plaguebearer Melee", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 200; + dudes_ac[j] = 5; + dudes_hp[j] = 300; men += dudes_num[j]; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.4; } if (dudes[j] = "Helbrute") { scr_en_weapon("Power Fist", false, dudes_num[j], dudes[j], j); scr_en_weapon("Multi-Melta", false, dudes_num[j], dudes[j], j); dudes_ac[j] = 40; - dudes_hp[j] = 100; + dudes_hp[j] = 300; veh += dudes_num[j]; dudes_vehicle[j] = 1; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.5; } if (dudes[j] = "Soul Grinder") { scr_en_weapon("Warpsword", false, dudes_num[j], dudes[j], j); @@ -178,15 +180,15 @@ repeat(20) { dudes_hp[j] = 350; veh += dudes_num[j]; dudes_vehicle[j] = 1; - dudes_dr[j] = 0.75; + dudes_dr[j] = 0.5; } if (dudes[j] = "Maulerfiend") { scr_en_weapon("Maulerfiend Claws", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; + dudes_ac[j] = 30; dudes_hp[j] = 250; veh += dudes_num[j]; dudes_vehicle[j] = 1; - dudes_dr[j] = 0.75; + dudes_dr[j] = 0.5; } } @@ -1219,7 +1221,7 @@ if __b__ { scr_en_weapon("Venom Cannon", false, dudes_num[j], dudes[j], j); dudes_ac[j] = 20; dudes_hp[j] = 300; - dudes_dr[j] = 0.25; + dudes_dr[j] = 0.75; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -1492,8 +1494,8 @@ if __b__ { scr_en_weapon("Power Fist", false, dudes_num[j], dudes[j], j); scr_en_weapon("Meltagun", false, dudes_num[j], dudes[j], j); dudes_ac[j] = 40; - dudes_hp[j] = 200; - dudes_dr[j] = 0.75; + dudes_hp[j] = 300; + dudes_dr[j] = 0.5; veh += dudes_num[j]; dudes_vehicle[j] = 1; } From 0d4d624f99a95b240b840445d5eefc049ef8206c Mon Sep 17 00:00:00 2001 From: KR Da Mystic Date: Sat, 15 Feb 2025 16:02:06 +0900 Subject: [PATCH 15/80] display weapon finished --- objects/obj_shop/Create_0.gml | 6 +++++- scripts/scr_ui_display_weapons/scr_ui_display_weapons.gml | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/objects/obj_shop/Create_0.gml b/objects/obj_shop/Create_0.gml index c100c2cab7..f7dfc69c38 100644 --- a/objects/obj_shop/Create_0.gml +++ b/objects/obj_shop/Create_0.gml @@ -508,7 +508,11 @@ if (shop = "equipment") { forge_cost[i] = 200; item_stocked[i] = scr_item_count(item[i]); item_cost[i] = 10; - + i += 1; + item[i] = "Needle Sniper Rifle"; + forge_cost[i] = 500; + item_stocked[i] = scr_item_count(item[i]); + item_cost[i] = 200; i += 1; item[i] = "Missile Launcher"; forge_cost[i] = 300; diff --git a/scripts/scr_ui_display_weapons/scr_ui_display_weapons.gml b/scripts/scr_ui_display_weapons/scr_ui_display_weapons.gml index 3a1fe35450..963e5ba064 100644 --- a/scripts/scr_ui_display_weapons/scr_ui_display_weapons.gml +++ b/scripts/scr_ui_display_weapons/scr_ui_display_weapons.gml @@ -68,6 +68,7 @@ function scr_ui_display_weapons(left_or_right, current_armor, equiped_weapon, cu "Infernus Pistol":spr_weapon_inferno, "Bolter":spr_weapon_bolter, "Storm Bolter":spr_weapon_sbolter, + "Wrist-Mounted Storm Bolter":spr_weapon_sbolter, "Plasma Pistol":spr_weapon_plasp, "Plasma Gun":spr_weapon_plasg, "Flamer":spr_weapon_flamer, @@ -127,6 +128,7 @@ function scr_ui_display_weapons(left_or_right, current_armor, equiped_weapon, cu "Power Spear":spr_weapon_powspear, "Thunder Hammer":spr_weapon_thhammer, "Power Axe":spr_weapon_powaxe, + "Omnissian Axe":spr_weapon_powaxe, "Crozius Arcanum":spr_weapon_crozarc, "Chainaxe":spr_weapon_chaxe, "Force Staff":spr_weapon_frcstaff, @@ -189,6 +191,7 @@ function scr_ui_display_weapons(left_or_right, current_armor, equiped_weapon, cu if (!sprite_found){ var special_ranged ={ "Sniper Rifle":spr_weapon_sniper, + "Needle Sniper Rifle":spr_weapon_sniper, "Autocannon":spr_weapon_autocannon2, } var special_ranged_names=struct_get_names(special_ranged); @@ -324,7 +327,7 @@ function scr_ui_display_weapons(left_or_right, current_armor, equiped_weapon, cu hand_variant[left_or_right] = 3; } - if (array_contains(["Sniper Rifle", "Force Staff", "Power Sword", "Thunder Hammer", "Autocannon", "Combat Knife", "Power Spear", "Chainsword", "Force Sword"], equiped_weapon)) { + if (array_contains(["Sniper Rifle", "Needle Sniper Rifle", "Force Staff", "Power Sword", "Thunder Hammer", "Autocannon", "Combat Knife", "Power Spear", "Chainsword", "Force Sword"], equiped_weapon)) { hand_variant[left_or_right] = 2; hand_on_top[left_or_right] = true; } From c6b426a440efdb379ecd4039c7b814240d55f9ec Mon Sep 17 00:00:00 2001 From: KR Da Mystic Date: Sat, 15 Feb 2025 16:14:32 +0900 Subject: [PATCH 16/80] libs revisit --- scripts/scr_powers/scr_powers.gml | 48 +++++++++++++++---------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/scripts/scr_powers/scr_powers.gml b/scripts/scr_powers/scr_powers.gml index fa4e5f8485..f4ad97b7a1 100644 --- a/scripts/scr_powers/scr_powers.gml +++ b/scripts/scr_powers/scr_powers.gml @@ -236,17 +236,17 @@ function scr_powers(power_set, power_count, enemy_target, unit_id) { // Chaos powers here - if (power_name="Wave of Entropy"){p_type="attack";p_rang=3;p_tar=3;p_spli=1;p_att=250;p_arp=-1;p_duration=0; + if (power_name="Wave of Entropy"){p_type="attack";p_rang=3;p_tar=3;p_spli=10;p_att=250;p_arp=-1;p_duration=0; flavour_text2="- a putrid cone of warp energy splashes outward, "; if (obj_ncombat.enemy=9) then flavour_text2+="twisting and rusting everything it touches. "; if (obj_ncombat.enemy!=9) then flavour_text2+="boiling and putrifying flesh. "; if (obj_ncombat.sorcery_seen<2) and (obj_ncombat.present_inquisitor=1) then obj_ncombat.sorcery_seen=1; } - if (power_name="Wave of Change"){p_type="attack";p_rang=3;p_tar=3;p_spli=1;p_att=300;p_arp=-2;p_duration=0; + if (power_name="Wave of Change"){p_type="attack";p_rang=3;p_tar=3;p_spli=10;p_att=300;p_arp=-2;p_duration=0; flavour_text2="- a wispy cone of warp energy reaches outward, twisting and morphing all that it touches. "; if (obj_ncombat.sorcery_seen<2) and (obj_ncombat.present_inquisitor=1) then obj_ncombat.sorcery_seen=1; } - if (power_name="Insect Swarm"){p_type="attack";p_rang=3;p_tar=3;p_spli=1;p_att=500;p_arp=-1;p_duration=0; + if (power_name="Insect Swarm"){p_type="attack";p_rang=3;p_tar=3;p_spli=8;p_att=500;p_arp=-1;p_duration=0; var rah;rah=choose(1,2); if (rah=1) then flavour_text2="- a massive, black cloud of insects spew from his body. At once they begin burrowing into your foes. "; if (rah=2) then flavour_text2="- rank, ichory insects spew forth from his body at your foes. They begin burrowing through flesh and armour alike. "; @@ -259,24 +259,24 @@ function scr_powers(power_set, power_count, enemy_target, unit_id) { marine_attack[unit_id]+=2;marine_ranged[unit_id]=0; if (obj_ncombat.sorcery_seen<2) and (obj_ncombat.present_inquisitor=1) then obj_ncombat.sorcery_seen=1; } - if (power_name="Putrid Vomit"){p_type="attack";p_rang=2.1;p_tar=3;p_spli=1;p_att=600;p_arp=-2;p_duration=0; + if (power_name="Putrid Vomit"){p_type="attack";p_rang=2.1;p_tar=3;p_spli=15;p_att=600;p_arp=-2;p_duration=0; var rah;rah=choose(1,2); flavour_text2="- from in front of their mouth a stream of rancid, acidic vomit spews forth at tremendous pressure, splashing over his foes. "; if (obj_ncombat.enemy=9) then p_att=450; if (obj_ncombat.sorcery_seen<2) and (obj_ncombat.present_inquisitor=1) then obj_ncombat.sorcery_seen=1; } - if (power_name="Warp Bolts"){p_type="attack";p_rang=5;p_tar=3;p_spli=1;p_att=450;p_arp=1;p_duration=0; + if (power_name="Warp Bolts"){p_type="attack";p_rang=5;p_tar=3;p_spli=8;p_att=450;p_arp=1;p_duration=0; var rah;rah=choose(1,2,3); if (rah=1) then flavour_text2="- several bolts of purple warp energy appear and are flung at the enemy. "; if (rah=2) then flavour_text2="- he launches a series of rapid warp bolts at the enemy. "; if (rah=3) then flavour_text2="- three oozing, shifting bolts of warp energy fly outward from his palms. "; if (obj_ncombat.sorcery_seen<2) and (obj_ncombat.present_inquisitor=1) then obj_ncombat.sorcery_seen=1; } - if (power_name="Warp Beam"){p_type="attack";p_rang=8;p_tar=4;p_spli=1;p_att=600;p_arp=1;p_duration=0; + if (power_name="Warp Beam"){p_type="attack";p_rang=8;p_tar=4;p_spli=4;p_att=600;p_arp=1;p_duration=0; flavour_text2="- a massive beam of purple warp energy shoots forth. All that it touches is consumed. "; if (obj_ncombat.sorcery_seen<2) and (obj_ncombat.present_inquisitor=1) then obj_ncombat.sorcery_seen=1; } - if (power_name="Rainbow Beam"){p_type="attack";p_rang=10;p_tar=3;p_spli=1;p_att=500;p_arp=1;p_duration=0; + if (power_name="Rainbow Beam"){p_type="attack";p_rang=10;p_tar=3;p_spli=8;p_att=750;p_arp=1;p_duration=0; flavour_text2="- a massive beam of warp energy hisses at the enemy, the crackling energy shifting through every color imaginable sickeningly fast. "; if (obj_ncombat.sorcery_seen<2) and (obj_ncombat.present_inquisitor=1) then obj_ncombat.sorcery_seen=1; } @@ -320,11 +320,11 @@ function scr_powers(power_set, power_count, enemy_target, unit_id) { // target 0: self 1: ally 2: ally vehicle 3: enemy 4: enemy vehicle - if (power_name="Minor Smite"){p_type="attack";p_rang=5;p_tar=3;p_spli=1;p_att=250;p_arp=-2;p_duration=0; + if (power_name="Minor Smite"){p_type="attack";p_rang=5;p_tar=3;p_spli=10;p_att=250;p_arp=-2;p_duration=0; flavour_text2="- a coil of warp energy lashes out at the enemy. "; if (binders=true) then flavour_text2="- a green, sickly coil of energy lashes out at the enemy. "; } - if (power_name="Smite"){p_type="attack";p_rang=5;p_tar=3;p_spli=1;p_att=350;p_arp=-2;p_duration=0; + if (power_name="Smite"){p_type="attack";p_rang=5;p_tar=3;p_spli=15;p_att=350;p_arp=-2;p_duration=0; var rah;rah=choose(1,2,3); if (rah=1) then flavour_text2="- a blast of warp energy smashes into the enemy. "; if (rah=2) then flavour_text2="- warp lightning crackles and leaps to the enemy. "; @@ -340,7 +340,7 @@ function scr_powers(power_set, power_count, enemy_target, unit_id) { if (power_name="Machine Curse"){p_type="attack";p_rang=5;p_tar=4;p_spli=0;p_att=400;p_arp=1;p_duration=0; flavour_text2="- the machine spirit within an enemy vehicle is roused. "; } - if (power_name="Avenge"){p_type="attack";p_rang=5;p_tar=3;p_spli=1;p_att=500;p_arp=-2;p_duration=0; + if (power_name="Avenge"){p_type="attack";p_rang=8;p_tar=3;p_spli=12;p_att=500;p_arp=-2;p_duration=0; var rah;rah=choose(1,2); if (rah=1) then flavour_text2="- a destructive avatar of rolling flame crashes into the enemy. "; if (rah=2) then flavour_text2="- a massive conflagration rises up and then crashes down upon the enemy. "; @@ -360,7 +360,7 @@ function scr_powers(power_set, power_count, enemy_target, unit_id) { } - if (power_name="Breathe Fire"){p_type="attack";p_rang=3;p_tar=3;p_spli=0;p_att=300;p_arp=-1;p_duration=0; + if (power_name="Breathe Fire"){p_type="attack";p_rang=3;p_tar=3;p_spli=12;p_att=300;p_arp=-1;p_duration=0; flavour_text2="- a bright jet of flame shoots forth at the enemy. "; if (binders=true) then flavour_text2="- a greenish, eery jet of flame shoots forth at the enemy. "; } @@ -372,25 +372,25 @@ function scr_powers(power_set, power_count, enemy_target, unit_id) { flavour_text2=". Orange sheets of fire shimmer around your forces, protecting them. "; if (binders=true) then flavour_text2="- Purple sheets of warp fire shimmer around your forces, protecting them. "; } - if (power_name="Inferno"){p_type="attack";p_rang=4;p_tar=3;p_spli=1;p_att=600;p_arp=-1;p_duration=0; + if (power_name="Inferno"){p_type="attack";p_rang=4;p_tar=3;p_spli=20;p_att=600;p_arp=-1;p_duration=0; var rah;rah=choose(1,2); if (rah=1) then flavour_text2="- a massive conflagration rises up and then crashes down upon the enemy. "; if (rah=2) then flavour_text2="- after breathing deeply a massive jet of flame is unleashed. Smoke billows into the sky. "; if (binders=true) and (rah=1) then flavour_text2="- a hideous being of rolling flame crashes into the enemy. "; if (binders=true) and (rah=2) then flavour_text2="- a massive conflagration rises up and then crashes down upon the enemy. "; } - if (power_name="Sun Burst"){p_type="attack";p_rang=8;p_tar=4;p_spli=1;p_att=400;p_arp=1;p_duration=0; + if (power_name="Sun Burst"){p_type="attack";p_rang=8;p_tar=4;p_spli=2;p_att=400;p_arp=1;p_duration=0; flavour_text2="- a crackling, hissing beam of purple-red flame shoots from him. "; if (binders=true) then flavour_text2="- a crackling, hissing beam of purple warp shoots from him. "; if (binders=true) and (obj_ncombat.sorcery_seen<2) and (obj_ncombat.present_inquisitor=1) then obj_ncombat.sorcery_seen=1; } - if (power_name="Molten Beam"){p_type="attack";p_rang=8;p_tar=4;p_spli=1;p_att=600;p_arp=1;p_duration=0; + if (power_name="Molten Beam"){p_type="attack";p_rang=8;p_tar=4;p_spli=4;p_att=600;p_arp=1;p_duration=0; flavour_text2="- a white-blue beam, blinding to behold, shoots forth. All that it touches turns to slag. "; if (binders=true) then flavour_text2="- a massive beam of purple warp energy shoots forth. All that it touches is consumed. "; if (binders=true) and (obj_ncombat.sorcery_seen<2) and (obj_ncombat.present_inquisitor=1) then obj_ncombat.sorcery_seen=1; } - if (power_name="Blood Boil"){p_type="attack";p_rang=3;p_tar=3;p_spli=0;p_att=250;p_arp=1;p_duration=0; + if (power_name="Blood Boil"){p_type="attack";p_rang=3;p_tar=3;p_spli=6;p_att=250;p_arp=1;p_duration=0; flavour_text2="- accelerating the pulse and blood pressure of his foes. "; } if (power_name="Iron Arm"){p_type="buff";p_rang=0;p_tar=0;p_spli=0;p_att=0;p_arp=0;p_duration=3; @@ -402,14 +402,14 @@ function scr_powers(power_set, power_count, enemy_target, unit_id) { if (power_name="Regenerate"){p_type="buff";p_rang=0;p_tar=0;p_spli=0;p_att=0;p_arp=0;p_duration=0; flavour_text2=". His flesh shimmers and twists back together, sealing up wounds and damage. "; } - if (power_name="Haemorrhage"){p_type="attack";p_rang=3;p_tar=3;p_spli=1;p_att=800;p_arp=-2;p_duration=0; + if (power_name="Haemorrhage"){p_type="attack";p_rang=3;p_tar=3;p_spli=3;p_att=800;p_arp=-2;p_duration=0; flavour_text2="- reaching inside of his foes and lighting their flesh aflame. "; } - if (power_name="Crush"){p_type="attack";p_rang=4;p_tar=4;p_spli=0;p_att=300;p_arp=1;p_duration=0; + if (power_name="Crush"){p_type="attack";p_rang=8;p_tar=4;p_spli=2;p_att=300;p_arp=1;p_duration=0; flavour_text2="- his foes are entraped in a crushing mass of force. "; } - if (power_name="Shockwave"){p_type="attack";p_rang=4;p_tar=3;p_spli=1;p_att=300;p_arp=0;p_duration=0; + if (power_name="Shockwave"){p_type="attack";p_rang=6;p_tar=3;p_spli=6;p_att=300;p_arp=-1;p_duration=0; var rah;rah=choose(1,2,3); flavour_text2="- a massive wave of force smashes aside his foes. "; } @@ -421,31 +421,31 @@ function scr_powers(power_set, power_count, enemy_target, unit_id) { } - if (power_name="Living Lightning"){p_type="attack";p_rang=5;p_tar=3;p_spli=0;p_att=300;p_arp=0;p_duration=0; + if (power_name="Living Lightning"){p_type="attack";p_rang=5;p_tar=3;p_spli=12;p_att=300;p_arp=-1;p_duration=0; flavour_text2="- arcs of lightning shoot from hand and strike his foes. "; } if (power_name="Stormbringer"){p_type="buff";p_rang=1;p_tar=1;p_spli=0;p_att=0;p_arp=0;p_duration=2; flavour_text2=". A vortex of ice and winds crackle into existance, covering your forces."; } - if (power_name="Murderous Hurricane"){p_type="attack";p_rang=4;p_tar=3;p_spli=1;p_att=450;p_arp=-1;p_duration=0; + if (power_name="Murderous Hurricane"){p_type="attack";p_rang=8;p_tar=3;p_spli=10;p_att=450;p_arp=-1;p_duration=0; var rah;rah=choose(1,2,3); flavour_text2="- a mighty winter gale billows forth, shredding and freezing flesh. "; } - if (power_name="Fury of the Wolf Spirits"){p_type="attack";p_rang=3;p_tar=3;p_spli=1;p_att=440;p_arp=-2;p_duration=0; + if (power_name="Fury of the Wolf Spirits"){p_type="attack";p_rang=5;p_tar=3;p_spli=8;p_att=440;p_arp=-2;p_duration=0; var rah;rah=choose(1,2); if (rah=1) then flavour_text2="- a pair of Thunderwolf revenants sprint outward, running down and overwhelming foes. "; if (rah=2) then flavour_text2="- ghostly visages of Freki and Geri launch into his foes, overwhelming them. "; } - if (power_name="Thunderclap"){p_type="attack";p_rang=1.1;p_tar=3;p_spli=1;p_att=600;p_arp=-2;p_duration=0; + if (power_name="Thunderclap"){p_type="attack";p_rang=2.1;p_tar=3;p_spli=1;p_att=600;p_arp=-2;p_duration=0; flavour_text2="- smashing his gauntlets together and unleashing a mighty shockwave. "; } - if (power_name="Jaws of the World Wolf"){p_type="attack";p_rang=5;p_tar=3;p_spli=1;p_att=800;p_arp=1;p_duration=0; + if (power_name="Jaws of the World Wolf"){p_type="attack";p_rang=5;p_tar=3;p_spli=20;p_att=800;p_arp=1;p_duration=0; flavour_text2="- chasms open up beneath his foes, swallowing them down and crushing them. "; } - if (power_name="Avenge"){p_type="attack";p_rang=5;p_tar=3;p_spli=1;p_att=500;p_arp=-1;p_duration=0; + if (power_name="Avenge"){p_type="attack";p_rang=8;p_tar=3;p_spli=12;p_att=500;p_arp=-2;p_duration=0; var rah;rah=choose(1,2); if (rah=1) then flavour_text2="- a destructive avatar of rolling flame crashes into the enemy. "; if (rah=2) then flavour_text2="- a massive conflagration rises up and then crashes down upon the enemy. "; From ed940b66968b2f5b51d9f9295f2d0afd917b1156 Mon Sep 17 00:00:00 2001 From: KR Da Mystic Date: Tue, 18 Feb 2025 23:22:51 +0900 Subject: [PATCH 17/80] needle snipe description and abbreviation --- scripts/scr_weapon/scr_weapon.gml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/scr_weapon/scr_weapon.gml b/scripts/scr_weapon/scr_weapon.gml index 286501e800..87a4bb4d46 100644 --- a/scripts/scr_weapon/scr_weapon.gml +++ b/scripts/scr_weapon/scr_weapon.gml @@ -989,13 +989,13 @@ global.weapons = { "tags": ["precision", "rifle"] }, "Needle Sniper Rifle": { - "abbreviation": "SnprRfl", + "abbreviation": "NdlSnpr", "attack": { "standard": 250, "master_crafted": 300, "artifact": 350 }, - "description": "The Sniper Rifle fires a solid shell over long range and boasts powerful telescopic sights to assist, allowing the user to target enemy weak points and distant foes.", + "description": "The Needle Sniper Rifle is a deadly weapon that uses both directed lasers and crystallised neurotoxic needles to dispatch enemies, commonly favoured by assasins and Astartes Scouts .", "melee_hands": 1, "ranged_hands": 2, "ammo": 20, From aeae47d1981feb8a2ed94c276d6e17c4b9c8c2fa Mon Sep 17 00:00:00 2001 From: KR Da Mystic Date: Wed, 19 Feb 2025 00:24:23 +0900 Subject: [PATCH 18/80] grav-cannon typo fix --- scripts/scr_initialize_custom/scr_initialize_custom.gml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/scr_initialize_custom/scr_initialize_custom.gml b/scripts/scr_initialize_custom/scr_initialize_custom.gml index 6444eb3f77..04c399c0a8 100644 --- a/scripts/scr_initialize_custom/scr_initialize_custom.gml +++ b/scripts/scr_initialize_custom/scr_initialize_custom.gml @@ -1340,7 +1340,7 @@ function scr_initialize_custom() { } var weapon_lists = { - heavy_weapons: ["Heavy Bolter", "Heavy Bolter", "Missile Launcher", "Missile Launcher", "Multi-Melta", "Lascannon","Plasma Cannon","Grav Cannon"], + heavy_weapons: ["Heavy Bolter", "Heavy Bolter", "Missile Launcher", "Missile Launcher", "Multi-Melta", "Lascannon","Plasma Cannon","Grav-Cannon"], melee_weapons: ["Chainsword", "Chainsword", "Chainsword", "Chainaxe", "Chainaxe"], special_melee_weapons: [ "Eviscerator", "Eviscerator", "Power Sword", "Power Sword", "Power Axe", "Power Axe", "Lightning Claw", "Lightning Claw", "Lightning Claw", "Power Fist", "Power Fist"], ranged_weapons: ["Bolter", "Bolter", "Storm Bolter", "Storm Bolter", "Stalker Pattern Bolter", "Stalker Pattern Bolter" ], @@ -1351,7 +1351,7 @@ function scr_initialize_custom() { } var weapon_weighted_lists = { - heavy_weapons: [["Heavy Bolter", 3], ["Missile Launcher", 3], ["Multi-Melta", 1], ["Lascannon", 1], ["Plasma Cannon", 1], ["Grav Cannon", 1]], + heavy_weapons: [["Heavy Bolter", 3], ["Missile Launcher", 3], ["Multi-Melta", 1], ["Lascannon", 1], ["Plasma Cannon", 1], ["Grav-Cannon", 1]], ranged_weapons: [["Bolter", 4], ["Storm Bolter", 2],["Stalker Pattern Bolter", 2]], special_ranged_weapons: [["Flamer", 2], ["Meltagun", 2], ["Plasma Gun", 1], ["Grav-Gun", 1]], melee_weapons: [["Chainsword", 3], ["Chainaxe", 2]], From 768e212cd33afa2bbde55f1831f516cb9f4a6f44 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Sat, 22 Mar 2025 22:08:04 +0300 Subject: [PATCH 19/80] Discard changes to ChapterMaster.yyp --- ChapterMaster.yyp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ChapterMaster.yyp b/ChapterMaster.yyp index d516caad1b..de2b304055 100644 --- a/ChapterMaster.yyp +++ b/ChapterMaster.yyp @@ -186,6 +186,7 @@ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"daemon7.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"daemon8.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"daemon9.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy_icons.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy10.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy11.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy12.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, @@ -447,10 +448,10 @@ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"eldar.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"genestealercult.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"hulk.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"imperial.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"imperial_ship.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ork.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"imperial.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ork_ship.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ork.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"sector.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"space_marine.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"star.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, @@ -1528,6 +1529,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 From 20991ae243810c2e6a4f7f7860c4facf20633493 Mon Sep 17 00:00:00 2001 From: KR Da Mystic Date: Sat, 29 Mar 2025 16:18:32 +0900 Subject: [PATCH 20/80] Armors and Vehicle Adjustments --- scripts/scr_roster/scr_roster.gml | 22 +-- scripts/scr_weapon/scr_weapon.gml | 237 ++++++++++++++++++++++-------- 2 files changed, 187 insertions(+), 72 deletions(-) diff --git a/scripts/scr_roster/scr_roster.gml b/scripts/scr_roster/scr_roster.gml index 8599c017a2..494881af80 100644 --- a/scripts/scr_roster/scr_roster.gml +++ b/scripts/scr_roster/scr_roster.gml @@ -717,23 +717,23 @@ function add_vehicle_to_battle(company, veh_index, is_local){ if (obj_ini.veh_role[company][v] = "Land Speeder") { - targ.veh_hp[targ.veh] = obj_ini.veh_hp[company][v] * 3; - targ.veh_hp_multiplier[targ.veh] = 3; - targ.veh_ac[targ.veh] = 30; + targ.veh_hp[targ.veh] = obj_ini.veh_hp[company][v] * 2.5; + targ.veh_hp_multiplier[targ.veh] = 2.5; + targ.veh_ac[targ.veh] = 20; } else if (obj_ini.veh_role[company][v] = "Rhino") or(obj_ini.veh_role[company][v] = "Whirlwind") { - targ.veh_hp[targ.veh] = obj_ini.veh_hp[company][v] * 5; - targ.veh_hp_multiplier[targ.veh] = 5; - targ.veh_ac[targ.veh] = 40; + targ.veh_hp[targ.veh] = obj_ini.veh_hp[company][v] * 3; + targ.veh_hp_multiplier[targ.veh] = 3; + targ.veh_ac[targ.veh] = 35; } else if (obj_ini.veh_role[company][v] = "Predator") { - targ.veh_hp[targ.veh] = obj_ini.veh_hp[company][v] * 6; - targ.veh_hp_multiplier[targ.veh] = 6; - targ.veh_ac[targ.veh] = 45; + targ.veh_hp[targ.veh] = obj_ini.veh_hp[company][v] * 3; + targ.veh_hp_multiplier[targ.veh] = 3; + targ.veh_ac[targ.veh] = 40; } else if (obj_ini.veh_role[company][v] = "Land Raider") { - targ.veh_hp[targ.veh] = obj_ini.veh_hp[company][v] * 8; - targ.veh_hp_multiplier[targ.veh] = 8; + targ.veh_hp[targ.veh] = obj_ini.veh_hp[company][v] * 5; + targ.veh_hp_multiplier[targ.veh] = 5; targ.veh_ac[targ.veh] = 50; } diff --git a/scripts/scr_weapon/scr_weapon.gml b/scripts/scr_weapon/scr_weapon.gml index 87a4bb4d46..bd4c81dfd6 100644 --- a/scripts/scr_weapon/scr_weapon.gml +++ b/scripts/scr_weapon/scr_weapon.gml @@ -1960,9 +1960,9 @@ global.weapons = { "Snazzgun": { "abbreviation": "Snazz", "attack": { - "standard": 80, - "master_crafted": 92, - "artifact": 104 + "standard": 200, + "master_crafted": 230, + "artifact": 280 }, "ranged_hands": 1, "ammo": 20, @@ -1998,18 +1998,28 @@ global.gear = { "abbreviation": "Artfcr", "armour_value": { "standard": 30, - "master_crafted": 34, - "artifact": 38 + "master_crafted": 30, // This is already a custom suit of armor shouldnt Master crafted be its base state? + "artifact": 30 }, "ranged_mod": { - "standard": 5, - "master_crafted": 10, - "artifact": 15 + "standard": 15, + "master_crafted": 20, + "artifact": 25 }, "melee_mod": { - "standard": 10, - "master_crafted": 15, - "artifact": 20 + "standard": 15, + "master_crafted": 20, + "artifact": 25 + }, + "hp_mod":{ + "standard": 15, + "master_crafted": 20, + "artifact": 25 + }, + "damage_resistance_mod": { + "standard": 15, + "master_crafted": 20, + "artifact": 25 }, "description": "A custom suit of power armored created by master artificiers and decorated without compare, this ancient Power Armour is beyond priceless. This suit's history is ancient and its users many.", "tags": ["power_armour"], @@ -2017,7 +2027,7 @@ global.gear = { "Terminator Armour": { "abbreviation": "Indmts", "armour_value": { - "standard": 42, + "standard": 40, "master_crafted": 46, "artifact": 50 }, @@ -2027,9 +2037,19 @@ global.gear = { "artifact": 0 }, "melee_mod": { - "standard": 20, - "master_crafted": 25, - "artifact": 30 + "standard": 10, + "master_crafted": 15, + "artifact": 20 + }, + "hp_mod":{ + "standard": 10, + "master_crafted": 15, + "artifact": 20 + }, + "damage_resistance_mod": { + "standard": 0, + "master_crafted": 5, + "artifact": 10 }, "melee_hands": 2, "ranged_hands": 2, @@ -2041,19 +2061,29 @@ global.gear = { "Dreadnought": { "abbreviation": "Drdnght", "armour_value": { - "standard": 50, + "standard": 30, "master_crafted": 55, "artifact": 60 }, "ranged_mod": { - "standard": 0, - "master_crafted": 5, // Augmented - "artifact": 10 // Augmented + "standard": -10, + "master_crafted": 0, + "artifact": 10 }, "melee_mod": { - "standard": 0, - "master_crafted": 5, // Augmented - "artifact": 10 // Augmented + "standard": -10, + "master_crafted": 0, + "artifact": 10 + }, + "hp_mod":{ + "standard": 30, + "master_crafted": 35, + "artifact": 60 + }, + "damage_resistance_mod": { + "standard": -30, + "master_crafted": -25, + "artifact": -20 }, "melee_hands": 8, "ranged_hands": 8, @@ -2064,19 +2094,24 @@ global.gear = { "Tartaros": { "abbreviation": "Tartrs", "armour_value": { - "standard": 42, + "standard": 40, "master_crafted": 46, "artifact": 50 }, "ranged_mod": { - "standard": 0, - "master_crafted": 5, // Augmented - "artifact": 10 // Augmented + "standard": 10, + "master_crafted": 15, // Augmented + "artifact": 20 // Augmented }, "melee_mod": { - "standard": 20, - "master_crafted": 25, - "artifact": 30 + "standard": 10, + "master_crafted": 20, + "artifact": 25 + }, + "hp_mod":{ + "standard": 5, + "master_crafted": 10, + "artifact": 15 }, "melee_hands": 2, "ranged_hands": 2, @@ -2093,14 +2128,24 @@ global.gear = { "artifact": 50 }, "ranged_mod": { - "standard": 0, - "master_crafted": 5, // Augmented - "artifact": 10 // Augmented + "standard": -5, + "master_crafted": 0, + "artifact": 5 }, "melee_mod": { - "standard": 20, - "master_crafted": 25, - "artifact": 30, + "standard": -5, + "master_crafted": 0, + "artifact": 5 + }, + "hp_mod":{ + "standard": 10, + "master_crafted": 15, + "artifact": 20 + }, + "damage_resistance_mod": { + "standard": 10, + "master_crafted": 15, + "artifact": 20 }, "melee_hands": 2, "ranged_hands": 2, @@ -2117,23 +2162,33 @@ global.gear = { "artifact": 14 }, "ranged_mod": { - "standard": 15, - "master_crafted": 20, // Augmented - "artifact": 25 // Augmented + "standard": 10, + "master_crafted": 15, // Augmented + "artifact": 20 // Augmented }, "melee_mod": { "standard": 0, "master_crafted": 5, // Augmented "artifact": 10 // Augmented }, + "hp_mod":{ + "standard": 0, + "master_crafted": 10, + "artifact": 0 + }, + "damage_resistance_mod": { + "standard": 0, + "master_crafted": 10, + "artifact": 0 + }, "description": "A non-powered suit made up of carapace armour and ballistic nylon. Includes biohazard shielding, nutrient feed, and camouflage." }, "MK3 Iron Armour": { "abbreviation": "MK3", "armour_value": { - "standard": 26, - "master_crafted": 29, - "artifact": 32 + "standard": 22, + "master_crafted": 24, + "artifact": 28 }, "ranged_mod": { "standard": -10, @@ -2141,9 +2196,19 @@ global.gear = { "artifact": 0 }, "melee_mod": { + "standard": 10, + "master_crafted": 10, // Augmented + "artifact": 15 // Augmented + }, + "hp_mod":{ + "standard": 10, + "master_crafted": 15, + "artifact": 20 + }, + "damage_resistance_mod": { "standard": 0, - "master_crafted": 5, // Augmented - "artifact": 10 // Augmented + "master_crafted": 5, + "artifact": 10 }, "description": "An ancient set of Power Armor dating back to the early Great Crusade. The Mark III has heavier armor plating but is far heavier then its contemporaries.", "tags": ["power_armour"], @@ -2152,19 +2217,29 @@ global.gear = { "MK4 Maximus": { "abbreviation": "MK4", "armour_value": { - "standard": 22, - "master_crafted": 25, - "artifact": 28 + "standard": 17, + "master_crafted": 19, + "artifact": 23 }, "ranged_mod": { - "standard": 5, - "master_crafted": 10, - "artifact": 15 + "standard": 10, + "master_crafted": 15, + "artifact": 20 }, "melee_mod": { - "standard": 5, - "master_crafted": 10, // Augmented - "artifact": 15 // Augmented + "standard": 10, + "master_crafted": 15, // Augmented + "artifact": 20 // Augmented + }, + "hp_mod":{ + "standard": 0, + "master_crafted": 5, + "artifact": 10 + }, + "damage_resistance_mod": { + "standard": 0, + "master_crafted": 10, + "artifact": 0 }, "description": "Power Armor dating back to the end of the Great Crusade. It is considered the pinnacle of Power Armor by some Astartes. However, the components are no longer reproducible, the knowledge having been lost to time.", "tags": ["power_armour"], @@ -2187,6 +2262,16 @@ global.gear = { "master_crafted": 25, "artifact": 30 }, + "hp_mod":{ + "standard": 0, + "master_crafted": 5, + "artifact": 10 + }, + "damage_resistance_mod": { + "standard": -5, + "master_crafted": 0, + "artifact": 5 + }, "description": "A hastily assembled Power Armor that first started appearing during the Horus Heresy to act as a stopgap while new suits were produced and sent to loyalist legions. It excels in close combat but it has limited sensors for ranged combat.", "tags": ["power_armour"], "maintenance" : 0.05, @@ -2196,18 +2281,28 @@ global.gear = { "armour_value": { "standard": 15, "master_crafted": 17, - "artifact": 19 + "artifact": 21 }, "ranged_mod": { - "standard": 15, - "master_crafted": 20, // Augmented - "artifact": 25 // Augmented + "standard": 10, + "master_crafted": 15, // Augmented + "artifact": 30 // Augmented }, "melee_mod": { "standard": 0, "master_crafted": 5, // Augmented "artifact": 10 // Augmented }, + "hp_mod":{ + "standard": -5, + "master_crafted": 0, + "artifact": 5 + }, + "damage_resistance_mod": { + "standard": 0, + "master_crafted": 5, + "artifact": 5 + }, "description": "A suit dating back to the Horus Heresy, first tested by the Raven Guard. It contains boosted olfactory and auditory sensors that increase the ranged accuracy of the wearer. This however makes it more fragile to an extent.", "tags": ["power_armour"], "maintenance" : 0.05, @@ -2215,9 +2310,9 @@ global.gear = { "MK7 Aquila": { "abbreviation": "MK7", "armour_value": { - "standard": 17, - "master_crafted": 19, - "artifact": 21 + "standard": 18, + "master_crafted": 20, + "artifact": 24 }, "ranged_mod": { "standard": 0, @@ -2229,6 +2324,16 @@ global.gear = { "master_crafted": 5, // Augmented "artifact": 10 // Augmented }, + "hp_mod":{ + "standard": 0, + "master_crafted": 5, + "artifact": 10 + }, + "damage_resistance_mod": { + "standard": 0, + "master_crafted": 5, + "artifact": 10 + }, "description": "The most common power armour of the Adeptus Astartes and the only power armour still widely manufactured by the Imperium.", "tags": ["power_armour"], "maintenance" : 0.01, @@ -2236,8 +2341,8 @@ global.gear = { "MK8 Errant": { "abbreviation": "MK8", "armour_value": { - "standard": 22, - "master_crafted": 24, + "standard": 20, + "master_crafted": 22, "artifact": 26 }, "ranged_mod": { @@ -2250,6 +2355,16 @@ global.gear = { "master_crafted": 5, // Augmented "artifact": 10 // Augmented }, + "hp_mod":{ + "standard": 0, + "master_crafted": 5, + "artifact": 10 + }, + "damage_resistance_mod": { + "standard": 0, + "master_crafted": 5, + "artifact": 10 + }, "description": "The newest and most advanced of the standard mark power armours as such production has not yet reached maximum capacity creating a supply shortage while chapters rush to get access to them.", "tags": ["power_armour"], "maintenance" : 0.02, From e02bbba61804404627b16f3ec6994c37852ec990 Mon Sep 17 00:00:00 2001 From: KR Da Mystic Date: Mon, 31 Mar 2025 08:27:55 +0900 Subject: [PATCH 21/80] Weapons again :( --- scripts/scr_en_weapon/scr_en_weapon.gml | 220 +++++++++--------- scripts/scr_weapon/scr_weapon.gml | 282 +++++++++++++----------- 2 files changed, 263 insertions(+), 239 deletions(-) diff --git a/scripts/scr_en_weapon/scr_en_weapon.gml b/scripts/scr_en_weapon/scr_en_weapon.gml index f830b93a35..ecb18114d5 100644 --- a/scripts/scr_en_weapon/scr_en_weapon.gml +++ b/scripts/scr_en_weapon/scr_en_weapon.gml @@ -138,7 +138,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (name = "Lightning Gun") { atta = choose(80, 80, 80, 150); - arp = 0; + arp = -1; rang = 5; spli = 0; } @@ -210,7 +210,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 25; } if (argument0 = "Shuriken Catapult") { - atta = 35; + atta = 70; arp = -1; rang = 2; } @@ -225,13 +225,13 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 3; } if (argument0 = "Power Weapon") or(argument0 = "Power Blades") { - atta = 80; + atta = 100; arp = -1; rang = 1; spli = 3; } if (argument0 = "Shuriken Pistol") { - atta = 25; + atta = 50; arp = -1; rang = 2.1; } @@ -241,18 +241,18 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 1; } if (argument0 = "Scorpion Chainsword") { - atta = 40; + atta = 100; arp = 0; rang = 1; spli = 3; } if (argument0 = "Mandiblaster") { - atta = 20; + atta = 60; arp = 0; rang = 1; } if (argument0 = "Biting Blade") { - atta = 70; + atta = 150; arp = -1; rang = 1; spli = 3; @@ -270,105 +270,108 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { amm = 1; } if (argument0 = "Deathspinner") { - atta = 50; + atta = 125; arp = 0; rang = 2; } if (argument0 = "Dual Deathspinner") { - atta = 100; + atta = 250; arp = 0; rang = 2; } if (argument0 = "Reaper Launcher") { - atta = 150; + atta = 200; arp = -2; rang = 20; amm = 8; spli = 3; } if (argument0 = "Tempest Launcher") { - atta = 200; + atta = 350; arp = -1; - rang = 20; + rang = 15; amm = 8; spli = 9; } if (argument0 = "Laser Lance") { - atta = 80; + atta = 180; arp = -2; rang = 2; spli = 3; } if (argument0 = "Fusion Pistol") { - atta = 100; + atta = 125; arp = 1; rang = 1.1; amm = 4; } if (argument0 = "Plasma Pistol") { - atta = 60; + atta = 100; arp = -2; rang = 3.1; } if (argument0 = "Harlequin's Kiss") { atta = 350; - arp = 0; + arp = 1; rang = 1; amm = 1; } if (argument0 = "Wraithcannon") { - atta = 80; + atta = 200; arp = 1; rang = 2.1; } if (argument0 = "Pulse Laser") { - atta = 80; - arp = 0; + atta = 150; + arp = -1; rang = 15; } if (argument0 = "Bright Lance") { - atta = 100; + atta = 200; arp = 1; rang = 8; } if (argument0 = "Shuriken Cannon") { - atta = 65; + atta = 300; arp = -1; rang = 3; } if (argument0 = "Prism Cannon") { - atta = 250; + atta = 400; arp = 1; rang = 20; + spli = 1; } if (argument0 = "Twin Linked Doomweaver") { - atta = 100; - arp = 0; + atta = 400; + arp = 1; rang = 2; + spli = 2; } // Also create difficult terrain? if (argument0 = "Starcannon") { - atta = 140; - arp = 1; - rang = 3; - spli = 3; + atta = 250; + arp = -2; + rang = 8; + spli = 4; } if (argument0 = "Two Power Fists") { atta = 300; arp = 1; rang = 1; + spli = 2; } if (argument0 = "Flamer") { - atta = 100; + atta = 200; arp = 0; rang = 2; amm = 4; spli = 3; } if (argument0 = "Titan Starcannon") { - atta = 220; + atta = 500; arp = 1; rang = 4; - spli = 3; + spli = 8; } if (argument0 = "Phantom Pulsar") { atta = 500; @@ -381,60 +384,60 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { if (obj_ncombat.enemy = 7) { if (argument0 = "Choppa") { - atta = 28; + atta = 140; arp = 0; rang = 1; spli = 3; } if (argument0 = "Power Klaw") { - atta = 150; - arp = -1; + atta = 300; + arp = -2; rang = 1; spli = 3; } if (argument0 = "Slugga") { - atta = 27; + atta = 120; arp = 0; rang = 3.1; amm = 4; spli = 3; } if (argument0 = "Tankbusta Bomb") { - atta = 264; + atta = 400; arp = 1; rang = 1; amm = 1; - spli = 0; + spli = 1; } if (argument0 = "Big Shoota") { - atta = 100; + atta = 110; arp = -1; - rang = 12; + rang = 6; amm = 30; - spli = 0; + spli = 5; } if (argument0 = "Dakkagun") { - atta = 200; + atta = 220; arp = -1; - rang = 10; + rang = 8; amm = 20; - spli = 0; + spli = 10; } if (argument0 = "Deffgun") { - atta = 120; + atta = 250; arp = -2; rang = 8; amm = 20; - spli = 0; + spli = 1; } if (argument0 = "Snazzgun") { - atta = 80; - arp = 0; - rang = 10; + atta = 200; + arp = -1; + rang = 5; spli = 0; } if (argument0 = "Grot Blasta") { - atta = 12; + atta = 50; arp = 0; rang = 2; amm = 6; @@ -447,27 +450,27 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { spli = 3; } if (argument0 = "Shoota") { - atta = 30; + atta = 80; arp = 0; - rang = 6; + rang = 5; } if (argument0 = "Burna") { atta = 140; - arp = 0; + arp = -1; rang = 2; amm = 4; spli = 3; } if (argument0 = "Skorcha") { - atta = 160; - arp = -1; + atta = 250; + arp = -2; rang = 2; amm = 6; spli = 3; } if (argument0 = "Rokkit Launcha") { - atta = 150; - arp = -1; + atta = 300; + arp = 1; rang = 15; spli = 3; } @@ -520,24 +523,25 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { atta = 150; arp = -2; rang = 18; + spli = 1; } if (name = "Pulse Rifle") { - atta = 100; - arp = 0; + atta = 80; + arp = -1; rang = 12; } if (name = "Rail Rifle") { - atta = 65; + atta = 80; arp = 1; rang = 14; } if (name = "Kroot Rifle") { - atta = 75; + atta = 100; arp = 0; rang = 6; } if (name = "Vespid Crystal") { - atta = 60; + atta = 100; arp = -2; rang = 2.1; } @@ -552,22 +556,22 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { if (argument0 = "Bonesword") { atta = 120; - arp = -2; + arp = 1; rang = 1; spli = 3; } if (argument0 = "Lash Whip") { - atta = 80; + atta = 100; arp = 0; rang = 2; } if (argument0 = "Heavy Venom Cannon") { - atta = 150; - arp = -2; + atta = 200; + arp = 1; rang = 8; } if (argument0 = "Crushing Claws") { - atta = 100; + atta = 150; arp = 1; rang = 1; spli = 3; @@ -579,17 +583,17 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { spli = 3; } if (argument0 = "Devourer") { - atta = choose(40, 60, 80, 100); + atta = 150; arp = 0; rang = 5; if (obj_ini.preomnor = 1) { - atta = choose(48, 72, 96, 120); + atta = 180; } } if (argument0 = "Zoanthrope Blast") { - atta = 200; - arp = -2; - rang = 2; + atta = 400; + arp = 1; + rang = 6; } if (argument0 = "Carnifex Claws") { atta = 300; @@ -598,8 +602,8 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { spli = 3; } if (argument0 = "Venom Cannon") { - atta = 150; - arp = -2; + atta = 200; + arp = 1; rang = 5; } if (argument0 = "Deathspitter") { @@ -607,11 +611,11 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { arp = -2; rang = 2.1; if (obj_ini.preomnor = 1) { - atta = 120; + atta = 150; } } if (argument0 = "Fleshborer") { - atta = 15; + atta = 80; arp = 0; rang = 2.1; if (obj_ini.preomnor = 1) { @@ -624,7 +628,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 1; } if (argument0 = "Genestealer Claws") { - atta = choose(105, 105, 130); + atta = 90; arp = -2; rang = 1; } @@ -710,11 +714,11 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { spli = 3; } if (argument0 = "Bolter") { - atta = 45; + atta = 120; arp = 0; rang = 12; amm = 15; - if (obj_ncombat.enemy = 5) then atta = 35; + if (obj_ncombat.enemy = 5) then atta = 120; } // Bursts if (argument0 = "Power Fist") { atta = 425; @@ -735,37 +739,37 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { spli = 3; } if (argument0 = "Chainsword") { - atta = 45; + atta = 120; arp = 0; rang = 1; } if (argument0 = "Bolt Pistol") { - atta = 35; + atta = 100; arp = 0; rang = 3.1; amm = 18; } if (argument0 = "Chainaxe") { - atta = 55; + atta = 140; arp = 0; rang = 1; } if (argument0 = "Poisoned Chainsword") { - atta = 90; + atta = 150; arp = 0; rang = 1; if (obj_ini.preomnor = 1) { - atta = 130; + atta = 180; } } if (argument0 = "Sonic Blaster") { - atta = 120; + atta = 150; arp = -1; rang = 3; spli = 3; } if (argument0 = "Rubric Bolter") { - atta = 80; + atta = 150; arp = -1; rang = 12; amm = 15; @@ -776,20 +780,20 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 5.1; } if (argument0 = "Autogun") { - atta = 20; + atta = 60; arp = 0; rang = 6; amm = 12; } if (argument0 = "Storm Bolter") { - atta = 65; + atta = 180; arp = 0; rang = 8; amm = 10; spli = 3; } if (argument0 = "Lascannon") { - atta = 200; + atta = 300; arp = 1; rang = 20; amm = 8; @@ -807,14 +811,16 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { spli = 3; } if (argument0 = "Twin Linked Lascannon") { - atta = 300; + atta = 600; arp = 1; rang = 20; + spli = 2; } if (argument0 = "Twin-Linked Lascannon") { - atta = 300; + atta = 600; arp = 1; rang = 20; + spli = 2; } if (argument0 = "Battle Cannon") { atta = 300; @@ -825,27 +831,29 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { atta = 500; arp = -2; rang = 2; + spli = 8; if (instance_exists(obj_nfort)) then rang = 5; } if (argument0 = "Earthshaker Cannon") { - atta = 300; + atta = 250; arp = -1; rang = 12; - spli = 3; + spli = 8; } if (argument0 = "Havoc Launcher") { - atta = 100; + atta = 300; arp = 0; rang = 12; + spli = 12; } if (argument0 = "Baleflame") { - atta = 120; - arp = 0; + atta = 350; + arp = -2; rang = 2; } if (argument0 = "Defiler Claws") { atta = 350; - arp = 1; + arp = -2; rang = 1; spli = 3; } @@ -858,20 +866,20 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (name = "Ripper Gun") { - atta = 40; + atta = 120; arp = -1; rang = 3; amm = 5; spli = 0; } if (name = "Ogryn Melee") { - atta = 90; - arp = -1; + atta = 150; + arp = -2; rang = 1; } if (name = "Multi-Laser") { - atta = choose(60, 75, 90, 105); - arp = 0; + atta = 150; + arp = -1; rang = 10; } @@ -916,7 +924,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (name = "Lasgun") { - atta = 20; + atta = 80; arp = 0; rang = 6; amm = 30; @@ -955,14 +963,14 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { spli = 0; } if (name = "Gauss Flayer") { - atta = choose(50, 50, 50, 50, 50, 70); - atta = choose(30, 30, 30, 30, 30, 70); + atta = 70; + arp = -1; rang = 6.1; spli = 0; } if (name = "Gauss Blaster") { - atta = choose(70, 70, 70, 70, 70, 100); - arp = choose(0, 0, 0, 0, 0, 1); + atta = 120; + arp = -1; rang = 6.1; spli = 0; } diff --git a/scripts/scr_weapon/scr_weapon.gml b/scripts/scr_weapon/scr_weapon.gml index bd4c81dfd6..45d9e8ac21 100644 --- a/scripts/scr_weapon/scr_weapon.gml +++ b/scripts/scr_weapon/scr_weapon.gml @@ -14,7 +14,7 @@ global.weapons = { }, "melee_hands": 0.9, "ranged_hands": 1, - "tags": ["shield"], + "tags": ["shield","boarding 2"], "hp_mod": { "standard": 30, "master_crafted": 35, @@ -30,7 +30,7 @@ global.weapons = { "artifact": 6 }, "melee_hands": 0.9, - "tags": ["shield","boarding"], + "tags": ["shield","boarding 3"], "hp_mod": { "standard": 15, "master_crafted": 17.5, @@ -58,25 +58,25 @@ global.weapons = { "Combat Knife": { "abbreviation": "CbKnf", "attack": { - "standard": 50, - "master_crafted": 75, - "artifact": 100 + "standard": 100, + "master_crafted": 125, + "artifact": 150 }, "description": "More of a sword than a knife, this tough and thick blade becomes a deadly weapon in the hand of an Astartes.", "melee_hands": 0, "ranged_hands": 0, "ammo": 0, "range": 1, - "spli": 1, + "spli": 2, "arp": 0, "tags": ["knife"], }, "Chainsword": { "abbreviation": "ChSwrd", "attack": { - "standard": 130, - "master_crafted": 150, - "artifact": 200 + "standard": 150, + "master_crafted": 180, + "artifact": 250 }, "description": "A standard Chainsword. It is popular among Assault Marines due to their raw power while maintaining speed.", "melee_hands": 1, @@ -90,9 +90,9 @@ global.weapons = { "Chainaxe": { "abbreviation": "ChAxe", "attack": { - "standard": 110, - "master_crafted": 130, - "artifact": 150 + "standard": 175, + "master_crafted": 225, + "artifact": 275 }, "melee_mod": { "standard": 5, @@ -104,7 +104,7 @@ global.weapons = { "ranged_hands": 0, "ammo": 0, "range": 1, - "spli": 6, + "spli": 3, "arp": 0, "tags": ["chain", "axe", "dual", "savage", "boarding 2"], }, @@ -131,9 +131,9 @@ global.weapons = { "Eviscerator": { "abbreviation": "Evisc", "attack": { - "standard": 260, - "master_crafted": 290, - "artifact": 330 + "standard": 250, + "master_crafted": 300, + "artifact": 350 }, "melee_mod": { "standard": 2, @@ -153,8 +153,8 @@ global.weapons = { "abbreviation": "PwrSwrd", "attack": { "standard": 225, - "master_crafted": 260, - "artifact": 300 + "master_crafted": 275, + "artifact": 325 }, "melee_mod": { "standard": 1, @@ -188,7 +188,7 @@ global.weapons = { "ranged_hands": 0, "ammo": 0, "range": 1, - "spli": 6, + "spli": 3, "arp": -1, "special_properties": ["Parry"], "tags": ["power", "spear", "martial"], @@ -196,8 +196,8 @@ global.weapons = { "Chainfist": { "abbreviation": "ChFst", "attack": { - "standard": 550, - "master_crafted": 600, + "standard": 400, + "master_crafted": 550, "artifact": 700 }, "description": "Created by mounting a chainsword to a power fist, this weapon is easily able to carve through armoured bulkheads.", @@ -205,7 +205,7 @@ global.weapons = { "ranged_hands": 0, "range": 1, "spli": 4, - "tags": ["power","boarding 3", "chain", "fist", "dual", "siege", "savage"], + "tags": ["power","boarding 3", "chain", "fist", "siege", "savage"], "arp": -2, }, "Lascutter": { @@ -245,9 +245,9 @@ global.weapons = { "Power Axe": { "abbreviation": "PwrAxe", "attack": { - "standard": 200, - "master_crafted": 225, - "artifact": 300 + "standard": 250, + "master_crafted": 300, + "artifact": 350 }, "melee_mod": { "standard": 1, @@ -259,7 +259,7 @@ global.weapons = { "ranged_hands": 0, "ammo": 0, "range": 1, - "spli": 5, + "spli": 3, "arp": -1, "tags": ["power", "axe", "dual","savage", "boarding 2"], }, @@ -276,12 +276,12 @@ global.weapons = { "artifact": 1.2 }, "description": "A symbol that is equally weapon and holy icon given only to those trained by the Adeptus Mechanicus and have shown their devotion to the Omnissiah in battle.", - "melee_hands": 1, + "melee_hands": 1.5, "ranged_hands": 0, "ammo": 0, "range": 1, "spli": 5, - "arp": -1, + "arp": -2, "tags": ["power", "axe", "savage", "boarding 3"], }, "Executioner Power Axe": { @@ -308,8 +308,8 @@ global.weapons = { "Power Fist": { "abbreviation": "PwrFst", "attack": { - "standard": 450, - "master_crafted": 500, + "standard": 400, + "master_crafted": 450, "artifact": 600 }, "melee_mod": { @@ -329,8 +329,8 @@ global.weapons = { "Power Fists": { "abbreviation": "PwrFsts", "attack": { - "standard": 900, - "master_crafted": 1000, + "standard": 800, + "master_crafted": 900, "artifact": 1200 }, "description": "A large, ceramite clad gauntlets surrounded by power energy fields. Though cumbersome to use, they dish out tremendous damage to enemies, leaving very little behind.", @@ -361,8 +361,8 @@ global.weapons = { "Boltstorm Gauntlet": { "abbreviation": "BlstGnt", "attack": { - "standard": 450, - "master_crafted": 500, + "standard": 400, + "master_crafted": 450, "artifact": 600 }, "description": "The Boltstorm Gauntlet is a Power Fists with an Integrated Bolter, so aside from being reinforced with a crackling power field and able to crush armour, bone and even thick vehicle plating, it is also capable of firing bolts at an astonishing rate", @@ -378,8 +378,8 @@ global.weapons = { "Assault Chainfist": { "abbreviation": "AssltChFst", "attack": { - "standard": 550, - "master_crafted": 600, + "standard": 400, + "master_crafted": 550, "artifact": 700 }, "description": "Created by mounting a chainsword to a power fist, this weapon is easily able to carve through armoured bulkheads. Contains an integrated Assault Cannon", @@ -394,9 +394,9 @@ global.weapons = { "Lightning Claw": { "abbreviation": "LghtClw", "attack": { - "standard": 450, - "master_crafted": 500, - "artifact": 600 + "standard": 375, + "master_crafted": 425, + "artifact": 575 }, "description": "Lightning claws are specialized close combat weapons with built-in disruptor fields. These lethal claws rip into infantry like butter, bringing terror to the foe.", "melee_hands": 1.1, @@ -432,9 +432,9 @@ global.weapons = { "Thunder Hammer": { "abbreviation": "ThndHmr", "attack": { - "standard": 650, - "master_crafted": 750, - "artifact": 900 + "standard": 500, + "master_crafted": 600, + "artifact": 750 }, "melee_mod": { "standard": 1.3, @@ -446,7 +446,7 @@ global.weapons = { "ranged_hands": 1, "ammo": 0, "range": 1, - "spli": 10, + "spli": 3, "arp": -2, "maintenance" : 0.1, "req_exp": 100, @@ -455,9 +455,9 @@ global.weapons = { "Heavy Thunder Hammer": { "abbreviation": "HvyThndHmr", "attack": { - "standard": 800, - "master_crafted": 950, - "artifact": 1100, + "standard": 700, + "master_crafted": 850, + "artifact": 1000, }, "melee_mod": { "standard": 1.3, @@ -470,17 +470,17 @@ global.weapons = { "ammo": 0, "range": 1, "arp": -2, - "spli": 15, - "maintenance" : 0.1, + "spli": 4, + "maintenance" : 0.1, "req_exp": 100, "tags": ["heavy_melee", "power", "hammer", "siege", "savage"], }, "Power Mace": { "abbreviation": "PwrMace", "attack": { - "standard": 600, - "master_crafted": 700, - "artifact": 800 + "standard": 400, + "master_crafted": 450, + "artifact": 600 }, "melee_mod": { "standard": 1.3, @@ -493,16 +493,16 @@ global.weapons = { "ammo": 0, "range": 1, "arp": -2, - "spli": 10, + "spli": 6, "tags": ["power", "mace", "siege", "savage"], "req_exp": 100, }, "Mace of Absolution": { "abbreviation": "AbsltMace", "attack": { - "standard": 600, - "master_crafted": 700, - "artifact": 800 + "standard": 400, + "master_crafted": 450, + "artifact": 600 }, "melee_mod": { "standard": 1.3, @@ -515,7 +515,7 @@ global.weapons = { "ranged_hands": 2, "ammo": 0, "range": 1, - "spli": 10, + "spli": 6, "arp": -2, "tags": ["power", "mace", "siege", "pious", "savage"], "req_exp": 100, @@ -544,9 +544,9 @@ global.weapons = { "Crozius Arcanum": { "abbreviation": "Crzus", "attack": { - "standard": 200, - "master_crafted": 250, - "artifact": 325 + "standard": 250, + "master_crafted": 300, + "artifact": 400 }, "melee_mod": { "standard": 1, @@ -565,9 +565,9 @@ global.weapons = { "Relic Blade": { "abbreviation": "RlcBld", "attack": { - "standard": 850, - "master_crafted": 950, - "artifact": 1100 + "standard": 600, + "master_crafted": 750, + "artifact": 900 }, "melee_mod": { "standard": 1, @@ -619,6 +619,23 @@ global.weapons = { "maintenance" : 0.1, "tags": ["bolt", "pistol", "boarding 2"], }, + "Shotgun": { + "abbreviation": "Shotgun", + "attack": { + "standard": 250, + "master_crafted": 300, + "artifact": 350 + }, + "description": "An Astartes Shotgun capable of firing slug and other specialist munitions deadly up close but loses effectiveness at range.", + "melee_hands": 0, + "ranged_hands": 1, + "ammo": 10, + "range": 4.1, + "spli": 8, + "arp": 0, + "maintenance" : 0.1, + "tags": ["bolt", "pistol", "boarding 2"], + }, "Webber": { "abbreviation": "Webbr", "attack": { @@ -638,8 +655,8 @@ global.weapons = { "Grav-Pistol": { "abbreviation": "GrvPstl", "attack": { - "standard": 300, - "master_crafted": 350, + "standard": 250, + "master_crafted": 300, "artifact": 425 }, "description": "A smaller version of the Grav-Gun which utilises the gravitic reaction principle most commonly seen powering grav-vehicles such as the Land Speeder.", @@ -655,9 +672,9 @@ global.weapons = { "Integrated-Grav": { "abbreviation": "IntGrv", "attack": { - "standard": 500, - "master_crafted": 550, - "artifact": 625 + "standard": 400, + "master_crafted": 450, + "artifact": 600 }, "description": "", "melee_hands": 0, @@ -671,9 +688,9 @@ global.weapons = { "Grav-Gun": { "abbreviation": "GrvGn", "attack": { - "standard": 500, - "master_crafted": 550, - "artifact": 625 + "standard": 400, + "master_crafted": 450, + "artifact": 600 }, "description": "A medium-sized weapon which utilises the gravitic reaction principle most commonly seen powering grav-vehicles such as the Land Speeder.", "melee_hands": 1, @@ -688,9 +705,9 @@ global.weapons = { "Grav-Cannon": { "abbreviation": "GrvCan", "attack": { - "standard": 800, - "master_crafted": 850, - "artifact": 960 + "standard": 600, + "master_crafted": 700, + "artifact": 850 }, "description": "A bigger version of the Grav-Gun which utilises the gravitic reaction principle most commonly seen powering grav-vehicles such as the Land Speeder.", "melee_hands": 1, @@ -705,16 +722,16 @@ global.weapons = { "Underslung Bolter": { "abbreviation": "UndBltr", "attack": { - "standard": 100, - "master_crafted": 125, - "artifact": 150 + "standard": 150, + "master_crafted": 200, + "artifact": 300 }, "description": "A compact, secondary Bolter weapon often attached under the barrel of a larger firearm. It allows for rapid fire in close quarters combat.", "melee_hands": 0, "ranged_hands": 1, "ammo": 0, "range": 10, - "spli": 2, + "spli": 3, "arp": 0, "tags": ["bolt", "attached"] }, @@ -722,8 +739,8 @@ global.weapons = { "abbreviation": "StlkBltr", "attack": { "standard": 180, - "master_crafted": 200, - "artifact": 240 + "master_crafted": 250, + "artifact": 380 }, "description": "The Stalker Bolter is a scoped long-range variant of the standard Bolter. Depending on the specific modifications made by the wielder, the Stalker Bolter can serve as a precision battle rifle or a high-powered sniper weapon.", "melee_hands": 0, @@ -731,7 +748,7 @@ global.weapons = { "ammo": 20, "range": 16, "spli": 3, - "arp": -1, + "arp": 0, "tags": ["bolt", "precision"] }, "Bolter": { @@ -761,7 +778,7 @@ global.weapons = { "melee_hands": 1, "ranged_hands": 2.25, "ammo": 8, - "range": 2, + "range": 4, "spli": 20, "arp": -1, "tags": ["flame", "heavy_ranged", "boarding 3"] @@ -839,7 +856,7 @@ global.weapons = { "melee_hands": 0, "ranged_hands": 0, "ammo": 5, - "range": 2.1, + "range": 3.1, "spli": 1, "arp": 1, "tags": ["melta"] @@ -847,9 +864,9 @@ global.weapons = { "Meltagun": { "abbreviation": "Mltgn", "attack": { - "standard": 400, - "master_crafted": 475, - "artifact": 600 + "standard": 350, + "master_crafted": 425, + "artifact": 550 }, "description": "A loud weapon that roars with fury, this gun vaporizes flesh and armor alike. Due to heat dissipation, it has only a short range.", "melee_hands": 1, @@ -863,9 +880,9 @@ global.weapons = { "Multi-Melta": { "abbreviation": "MltMelt", "attack": { - "standard": 700, - "master_crafted": 800, - "artifact": 950 + "standard": 500, + "master_crafted": 600, + "artifact": 700 }, "description": "Though bearing longer range than the Meltagun, this weapon's great size usually restricts it to vehicles though those with Power Armor can carry this cumbersome weapon into battle.", "melee_hands": 1, @@ -879,8 +896,8 @@ global.weapons = { "Plasma Pistol": { "abbreviation": "PlsmPstl", "attack": { - "standard": 250, - "master_crafted": 290, + "standard": 220, + "master_crafted": 270, "artifact": 320 }, "description": "A pistol variant of the plasma gun, this dangerous-to-use weapon has exceptional armor-piercing capabilities.", @@ -895,9 +912,9 @@ global.weapons = { "Plasma Cutter": { // Basically a dual-linked plasma pistol "abbreviation": "PlsmCt", "attack": { - "standard": 230, - "master_crafted": 260, - "artifact": 300 + "standard": 220, + "master_crafted": 270, + "artifact": 320 }, "description": "While actually intended to be used on the battlefield as a tool to repair damaged war machines, the Plasma Cutter is equally adept at slicing through even terminator armour with its intense, constant beam of superheated plasma.", "melee_hands": 0, @@ -927,41 +944,41 @@ global.weapons = { "Integrated-Plasma": { "abbreviation": "IntPls", "attack": { - "standard": 350, - "master_crafted": 400, - "artifact": 475 + "standard": 300, + "master_crafted": 350, + "artifact": 450 }, "description": "", "melee_hands": 0, "ranged_hands": 0, "ammo": 6, "range": 10, - "spli": 2, - "arp": -1, - "tags": ["plasma"] + "spli": 4, + "arp": -2, + "tags": ["plasma","energy"] }, "Plasma Gun": { "abbreviation": "PlsmGn", "attack": { - "standard": 350, - "master_crafted": 400, - "artifact": 475 + "standard": 300, + "master_crafted": 350, + "artifact": 450 }, "description": "A two-handed weapon that launches blobs of plasma at the target. They are considered both sacred and dangerous, overheating through rapid firing of the weapon. Overheating can result in detonation of the weapon, killing the wielder.", "melee_hands": 0, "ranged_hands": 2, "ammo": 16, "range": 10, - "spli": 3, + "spli": 4, "arp": -2, "tags": ["plasma", "energy", "boarding 1"] }, "Plasma Cannon": { "abbreviation": "PlsmCan", "attack": { - "standard": 700, - "master_crafted": 800, - "artifact": 900 + "standard": 450, + "master_crafted": 550, + "artifact": 750 }, "description": "A heavy variant of the plasma gun, its power output is significantly higher and its damage capability shows. However, it maintains the overheating risk of the Plasma Gun", "melee_hands": 1, @@ -975,9 +992,9 @@ global.weapons = { "Sniper Rifle": { "abbreviation": "SnprRfl", "attack": { - "standard": 120, - "master_crafted": 150, - "artifact": 200 + "standard": 180, + "master_crafted": 220, + "artifact": 320 }, "description": "The Sniper Rifle fires a solid shell over long range and boasts powerful telescopic sights to assist, allowing the user to target enemy weak points and distant foes.", "melee_hands": 1, @@ -985,7 +1002,7 @@ global.weapons = { "ammo": 20, "range": 14, "spli": 1, - "arp": -1, + "arp": 0, "tags": ["precision", "rifle"] }, "Needle Sniper Rifle": { @@ -1001,7 +1018,7 @@ global.weapons = { "ammo": 20, "range": 14, "spli": 1, - "arp": -2, + "arp": -1, "tags": ["precision", "rifle"] }, "Assault Cannon": { @@ -1047,7 +1064,7 @@ global.weapons = { "melee_hands": 1, "ranged_hands": 2, "ammo": 6, - "range": 15, + "range": 12, "spli": 10, "arp": -1, @@ -1064,7 +1081,7 @@ global.weapons = { "melee_hands": 1, "ranged_hands": 2, "ammo": 6, - "range": 15, + "range": 8, "spli": 20, "arp": -1, "tags": ["heavy_ranged","explosive"] @@ -1072,8 +1089,8 @@ global.weapons = { "Lascannon": { "abbreviation": "Lascnn", "attack": { - "standard": 600, - "master_crafted": 700, + "standard": 450, + "master_crafted": 600, "artifact": 900 }, "description": "A formidable laser weapon, the lascannon can pierce most vehicles or power armored targets from a tremendous range. The weapon is known for its reliability in combat.", @@ -1105,15 +1122,15 @@ global.weapons = { "abbreviation": "IntgBltr", "attack": { "standard": 150, - "master_crafted": 175, - "artifact": 200 + "master_crafted": 200, + "artifact": 300 }, "description": "A Bolter that can be built directly into the structure of the vehicle, armor, another weapon or Dreadnought. When used as a weapon, it leaves both hands free, allowing to use any, even a twohanded weapon, efficiently.", "melee_hands": 0, "ranged_hands": 0, "ammo": 8, - "range": 12, - "spli": 4, + "range": 10, + "spli": 5, "arp": 0, "tags": ["bolt"] }, @@ -1152,9 +1169,9 @@ global.weapons = { "Heavy Bolter": { "abbreviation": "HvyBltr", "attack": { - "standard": 300, - "master_crafted": 350, - "artifact": 390 + "standard": 250, + "master_crafted": 300, + "artifact": 450 }, "description": "The Heavy Bolter is a heavy weapon that fires larger and more powerful bolt shells compared to the standard Bolter.", "melee_hands": 1, @@ -1348,7 +1365,7 @@ global.weapons = { }, "Twin Linked Bolters": { "attack": { - "standard": 225, + "standard": 275, "master_crafted": 350, "artifact": 450 }, @@ -1483,14 +1500,14 @@ global.weapons = { "abbreviation": "HndFlmr", "attack": { "standard": 250, - "master_crafted": 275, - "artifact": 350 + "master_crafted": 300, + "artifact": 450 }, "description": "Along with using a lower-capacity fuel tank it has much reduced range, which makes it suited for assault and close-combat purposes, incinerating foes at short range. The weapon is often used by assault squads.", "melee_hands": 0, "ranged_hands": 1, "ammo": 4, - "range": 2.1, + "range": 3.1, "spli": 8, "arp": 0, "tags": ["pistol", "flame", "boarding 2"] @@ -1636,7 +1653,7 @@ global.weapons = { "spli": 5, "arp": -1, "special_description": "Spell Damage +100%", -"maintenance" : 0.1, + "maintenance" : 0.1, "tags": ["force"] }, "Force Sword": { @@ -1658,16 +1675,15 @@ global.weapons = { "range": 1, "spli": 4, "arp": -1, - "special_description": "Spell damage +25%", "special_properties": ["Parry"], - "maintenance" : 0.1, + "maintenance" : 0.1, "tags": ["force", "sword", "martial", "boarding 1"], }, "Force Axe": { "attack": { - "standard": 200, - "master_crafted": 250, - "artifact": 350 + "standard": 250, + "master_crafted": 300, + "artifact": 375 }, "melee_mod": { "standard": 1, @@ -1680,7 +1696,7 @@ global.weapons = { "ranged_hands": 0, "ammo": 0, "range": 1, - "spli": 5, + "spli": 3, "arp": -1, "special_description": "Able to be dual-wielded, Spell damage +25%", "tags": ["force", "axe", "dual", "savage", "boarding 2"], From d4c7107018ba17f47392ad78baeeb9994e507bad Mon Sep 17 00:00:00 2001 From: KR Da Mystic Date: Mon, 31 Mar 2025 08:28:23 +0900 Subject: [PATCH 22/80] Enemy Artificer armor --- objects/obj_enunit/Alarm_1.gml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/objects/obj_enunit/Alarm_1.gml b/objects/obj_enunit/Alarm_1.gml index 25e9ac8929..023bbe60eb 100644 --- a/objects/obj_enunit/Alarm_1.gml +++ b/objects/obj_enunit/Alarm_1.gml @@ -1290,7 +1290,7 @@ if __b__ { if (dudes[j] = "Leader") and(obj_controller.faction_gender[10] = 1) { scr_en_weapon("Meltagun", true, dudes_num[j], dudes[j], j); scr_en_weapon("Power Fist", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; + dudes_ac[j] = 30; if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { dudes_hp[j] = 300; } @@ -1299,7 +1299,7 @@ if __b__ { } if (dudes[j] = "Leader") and(obj_controller.faction_gender[10] = 2) { scr_en_weapon("Khorne Demon Melee", true, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 20; + dudes_ac[j] = 30; if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { dudes_hp[j] = 300; } @@ -1310,7 +1310,7 @@ if __b__ { if (dudes[j] = "Fallen") { scr_en_weapon("Bolt Pistol", true, dudes_num[j], dudes[j], j); scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; + dudes_ac[j] = 30; dudes_hp[j] = 120; men += dudes_num[j]; dudes_dr[j] = 0.5; @@ -1319,7 +1319,7 @@ if __b__ { if (dudes[j] = "Chaos Lord") { scr_en_weapon("Plasma Pistol", true, dudes_num[j], dudes[j], j); scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; + dudes_ac[j] = 30; dudes_hp[j] = 150; dudes_dr[j] = 0.5; men += dudes_num[j]; @@ -1327,7 +1327,7 @@ if __b__ { if (dudes[j] = "Chaos Sorcerer") { scr_en_weapon("Plasma Pistol", true, dudes_num[j], dudes[j], j); scr_en_weapon("Force Staff", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; + dudes_ac[j] = 30; dudes_hp[j] = 100; dudes_dr[j] = 0.5; men += dudes_num[j]; @@ -1336,7 +1336,7 @@ if __b__ { scr_en_weapon("Chainfist", true, dudes_num[j], dudes[j], j); scr_en_weapon("Meltagun", true, dudes_num[j], dudes[j], j); scr_en_weapon("Flamer", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; + dudes_ac[j] = 30; dudes_hp[j] = 100; dudes_dr[j] = 0.5; men += dudes_num[j]; @@ -1511,7 +1511,7 @@ if __b__ { scr_en_weapon("Lascannon", false, dudes_num[j] * 2, dudes[j], j); scr_en_weapon("Twin Linked Lascannon", false, dudes_num[j], dudes[j], j); dudes_ac[j] = 45; - dudes_hp[j] = 300; + dudes_hp[j] = 350; dudes_dr[j] = 0.5; veh += dudes_num[j]; dudes_vehicle[j] = 1; From ff1c6ab8d5f38674d907916abcca81160ca3a633 Mon Sep 17 00:00:00 2001 From: KR Da Mystic Date: Tue, 1 Apr 2025 19:02:37 +0900 Subject: [PATCH 23/80] Armors revisited --- scripts/scr_weapon/scr_weapon.gml | 35 +++++++++++++------------------ 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/scripts/scr_weapon/scr_weapon.gml b/scripts/scr_weapon/scr_weapon.gml index 45d9e8ac21..074e1b5225 100644 --- a/scripts/scr_weapon/scr_weapon.gml +++ b/scripts/scr_weapon/scr_weapon.gml @@ -1964,9 +1964,9 @@ global.weapons = { "Choppa": { "abbreviation": "Chop", "attack": { - "standard": 28, - "master_crafted": 32, - "artifact": 36 + "standard": 100, + "master_crafted": 125, + "artifact": 200 }, "melee_hands": 1, "range": 1, @@ -2043,9 +2043,9 @@ global.gear = { "Terminator Armour": { "abbreviation": "Indmts", "armour_value": { - "standard": 40, - "master_crafted": 46, - "artifact": 50 + "standard": 30, + "master_crafted": 36, + "artifact": 40 }, "ranged_mod": { "standard": -10, @@ -2077,9 +2077,9 @@ global.gear = { "Dreadnought": { "abbreviation": "Drdnght", "armour_value": { - "standard": 30, - "master_crafted": 55, - "artifact": 60 + "standard": 40, + "master_crafted": 45, + "artifact": 50 }, "ranged_mod": { "standard": -10, @@ -2096,11 +2096,6 @@ global.gear = { "master_crafted": 35, "artifact": 60 }, - "damage_resistance_mod": { - "standard": -30, - "master_crafted": -25, - "artifact": -20 - }, "melee_hands": 8, "ranged_hands": 8, "description": "A massive war-machine that can be piloted by an honored Astarte, who otherwise would have fallen in combat. Some of the Astartes consider this a fate worse than death", @@ -2110,9 +2105,9 @@ global.gear = { "Tartaros": { "abbreviation": "Tartrs", "armour_value": { - "standard": 40, - "master_crafted": 46, - "artifact": 50 + "standard": 30, + "master_crafted": 36, + "artifact": 40 }, "ranged_mod": { "standard": 10, @@ -2139,9 +2134,9 @@ global.gear = { "Cataphractii Pattern Terminator": { "abbreviation": "Catphr", "armour_value": { - "standard": 42, - "master_crafted": 46, - "artifact": 50 + "standard": 32, + "master_crafted": 38, + "artifact": 42 }, "ranged_mod": { "standard": -5, From 4aba5369a55220a35d3935cc4a762bc9e9212f85 Mon Sep 17 00:00:00 2001 From: KR Da Mystic Date: Tue, 1 Apr 2025 20:35:26 +0900 Subject: [PATCH 24/80] Marine CON changes --- scripts/scr_marine_struct/scr_marine_struct.gml | 6 +++--- scripts/scr_ui_manage/scr_ui_manage.gml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/scr_marine_struct/scr_marine_struct.gml b/scripts/scr_marine_struct/scr_marine_struct.gml index 1007fd8a45..ba5a3d187a 100644 --- a/scripts/scr_marine_struct/scr_marine_struct.gml +++ b/scripts/scr_marine_struct/scr_marine_struct.gml @@ -553,7 +553,7 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data={}) static update_mobility_item = scr_update_unit_mobility_item; static max_health =function(base=false){ - var max_h = 100 * (1+((constitution - 40)*0.025)); + var max_h = 100 * (1+((constitution - 40)*0.05)); if (!base){ max_h += gear_weapon_data("armour", armour(), "hp_mod"); max_h += gear_weapon_data("gear", gear(), "hp_mod"); @@ -565,7 +565,7 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data={}) }; static increase_max_health = function(increase){ - return max_health() + (increase*(1+((constitution - 40)*0.025))); //calculate the effect of unit_health buffs + return max_health() + (increase*(1+((constitution - 40)*0.05))); //calculate the effect of unit_health buffs }; // used both to load unit data from save and to add preset base_stats @@ -1167,7 +1167,7 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data={}) damage_res+=get_mobility_data("damage_resistance_mod"); damage_res+=get_weapon_one_data("damage_resistance_mod"); damage_res+=get_weapon_two_data("damage_resistance_mod"); - damage_res = min(75, damage_res+floor(((constitution*0.005) + (experience/1000))*100)); + damage_res = min(75, damage_res+floor((constitution*0.005)*100)); return damage_res; }; diff --git a/scripts/scr_ui_manage/scr_ui_manage.gml b/scripts/scr_ui_manage/scr_ui_manage.gml index f422ccacc1..0c03363417 100644 --- a/scripts/scr_ui_manage/scr_ui_manage.gml +++ b/scripts/scr_ui_manage/scr_ui_manage.gml @@ -485,7 +485,7 @@ function scr_ui_manage() { } } var_text = string_hash_to_newline(string("Damage Resistance: {0}",cn.temp[118])) - tooltip_text += string_hash_to_newline(string("CON: {0}%#EXP: {1}%", round(selected_unit.constitution/2), round(selected_unit.experience/10))); + tooltip_text += string_hash_to_newline(string("CON: {0}", round(selected_unit.constitution/2))); x1 = x_left; y1 = yy+378; x2 = x1+string_width(var_text); From db7e921d8b009a1d466f12e5c55af98822f7ddf8 Mon Sep 17 00:00:00 2001 From: KR Da Mystic Date: Tue, 1 Apr 2025 20:37:16 +0900 Subject: [PATCH 25/80] Enemy Weaps Revisit --- scripts/scr_en_weapon/scr_en_weapon.gml | 130 +++++++++++++----------- 1 file changed, 69 insertions(+), 61 deletions(-) diff --git a/scripts/scr_en_weapon/scr_en_weapon.gml b/scripts/scr_en_weapon/scr_en_weapon.gml index ecb18114d5..77606829e6 100644 --- a/scripts/scr_en_weapon/scr_en_weapon.gml +++ b/scripts/scr_en_weapon/scr_en_weapon.gml @@ -131,7 +131,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { if (obj_ncombat.enemy = 3) { if (name = "Phased Plasma-fusil") { - atta = 100; + atta = 80; arp = -2; rang = 7.1; spli = 3; @@ -153,20 +153,20 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { if (obj_ncombat.enemy = 6) { if (argument0 = "Fusion Gun"){ - atta = 200; + atta = 180; arp = 1; rang = 2; amm = 4; } if (argument0 = "Firepike") { - atta = 300; + atta = 150; arp = 1; rang = 4; amm = 4; } if (argument0 = "Singing Spear") { - atta = 120; + atta = 150; arp = -1; rang = 1; spli = 3; @@ -178,7 +178,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { spli = 3; } if (argument0 = "Witchblade") { - atta = 100; + atta = 130; arp = -1; rang = 1; } @@ -210,17 +210,17 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 25; } if (argument0 = "Shuriken Catapult") { - atta = 70; + atta = 50; arp = -1; rang = 2; } if (argument0 = "Twin Linked Shuriken Catapult") { - atta = 50; + atta = 100; arp = -1; rang = 2; } if (argument0 = "Avenger Shuriken Catapult") { - atta = 40; + atta = 90; arp = -1; rang = 3; } @@ -236,7 +236,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 2.1; } if (argument0 = "Executioner") { - atta = 200; + atta = 150; arp = -2; rang = 1; } @@ -252,7 +252,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 1; } if (argument0 = "Biting Blade") { - atta = 150; + atta = 125; arp = -1; rang = 1; spli = 3; @@ -280,14 +280,14 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 2; } if (argument0 = "Reaper Launcher") { - atta = 200; + atta = 120; arp = -2; rang = 20; amm = 8; spli = 3; } if (argument0 = "Tempest Launcher") { - atta = 350; + atta = 200; arp = -1; rang = 15; amm = 8; @@ -302,7 +302,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { if (argument0 = "Fusion Pistol") { atta = 125; arp = 1; - rang = 1.1; + rang = 2.1; amm = 4; } if (argument0 = "Plasma Pistol") { @@ -311,7 +311,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 3.1; } if (argument0 = "Harlequin's Kiss") { - atta = 350; + atta = 250; arp = 1; rang = 1; amm = 1; @@ -322,7 +322,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 2.1; } if (argument0 = "Pulse Laser") { - atta = 150; + atta = 120; arp = -1; rang = 15; } @@ -332,7 +332,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 8; } if (argument0 = "Shuriken Cannon") { - atta = 300; + atta = 160; arp = -1; rang = 3; } @@ -343,8 +343,8 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { spli = 1; } if (argument0 = "Twin Linked Doomweaver") { - atta = 400; - arp = 1; + atta = 250; + arp = -2; rang = 2; spli = 2; } // Also create difficult terrain? @@ -384,47 +384,47 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { if (obj_ncombat.enemy = 7) { if (argument0 = "Choppa") { - atta = 140; + atta = 100; arp = 0; rang = 1; spli = 3; } if (argument0 = "Power Klaw") { - atta = 300; + atta = 160; arp = -2; rang = 1; spli = 3; } if (argument0 = "Slugga") { - atta = 120; + atta = 80; arp = 0; rang = 3.1; amm = 4; spli = 3; } if (argument0 = "Tankbusta Bomb") { - atta = 400; + atta = 150; arp = 1; rang = 1; amm = 1; spli = 1; } if (argument0 = "Big Shoota") { - atta = 110; + atta = 80; arp = -1; rang = 6; amm = 30; spli = 5; } if (argument0 = "Dakkagun") { - atta = 220; + atta = 140; arp = -1; rang = 8; amm = 20; spli = 10; } if (argument0 = "Deffgun") { - atta = 250; + atta = 150; arp = -2; rang = 8; amm = 20; @@ -462,14 +462,14 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { spli = 3; } if (argument0 = "Skorcha") { - atta = 250; + atta = 200; arp = -2; rang = 2; amm = 6; spli = 3; } if (argument0 = "Rokkit Launcha") { - atta = 300; + atta = 125; arp = 1; rang = 15; spli = 3; @@ -485,7 +485,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { if (obj_ncombat.enemy = 8) { if (name = "Fusion Blaster") { - atta = 200; + atta = 150; arp = 1; rang = 2; amm = 4; @@ -496,19 +496,19 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 10; } if (name = "Cyclic Ion Blaster") { - atta = 180; + atta = 80; arp = -1; rang = 6; spli = 3; } // x6 if (name = "Burst Rifle") { atta = 130; - arp = -1; + arp = 0; rang = 16; spli = 3; } if (name = "Missile Pod") { - atta = 160; + atta = 150; arp = -1; rang = 15; amm = 6; @@ -521,7 +521,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (name = "Small Railgun") { atta = 150; - arp = -2; + arp = 1; rang = 18; spli = 1; } @@ -532,7 +532,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (name = "Rail Rifle") { atta = 80; - arp = 1; + arp = -2; rang = 14; } if (name = "Kroot Rifle") { @@ -546,7 +546,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 2.1; } if (name = "Railgun") { - atta = 400; + atta = 250; arp = 1; rang = 20; } @@ -556,7 +556,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { if (argument0 = "Bonesword") { atta = 120; - arp = 1; + arp = -2; rang = 1; spli = 3; } @@ -583,39 +583,41 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { spli = 3; } if (argument0 = "Devourer") { - atta = 150; - arp = 0; + atta = 120; + arp = -1; rang = 5; + spli = 3 if (obj_ini.preomnor = 1) { atta = 180; } } if (argument0 = "Zoanthrope Blast") { - atta = 400; + atta = 250; arp = 1; rang = 6; + spli = 1; } if (argument0 = "Carnifex Claws") { - atta = 300; + atta = 200; arp = 1; rang = 1; spli = 3; } if (argument0 = "Venom Cannon") { - atta = 200; + atta = 100; arp = 1; rang = 5; } if (argument0 = "Deathspitter") { atta = 100; - arp = -2; + arp = -1; rang = 2.1; if (obj_ini.preomnor = 1) { atta = 150; } } if (argument0 = "Fleshborer") { - atta = 80; + atta = 70; arp = 0; rang = 2.1; if (obj_ini.preomnor = 1) { @@ -628,7 +630,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 1; } if (argument0 = "Genestealer Claws") { - atta = 90; + atta = 70; arp = -2; rang = 1; } @@ -638,7 +640,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 2; } if (argument0 = "Autogun") { - atta = 20; + atta = 60; arp = 0; rang = 6; amm = 12; @@ -650,7 +652,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 1; } if (argument0 = "Flesh Hooks") { - atta = 50; + atta = 100; arp = 0; rang = 2; amm = 1; @@ -676,7 +678,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 1; } if (argument0 = "Force Weapon") { - atta = 400; + atta = 250; arp = -1; rang = 1; } @@ -700,7 +702,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { spli = 3; } if (argument0 = "Heavy Flamer") { - atta = 250; + atta = 200; arp = -1; rang = 2.1; amm = 6; @@ -718,15 +720,15 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { arp = 0; rang = 12; amm = 15; - if (obj_ncombat.enemy = 5) then atta = 120; + if (obj_ncombat.enemy = 5) then atta = 80; } // Bursts if (argument0 = "Power Fist") { - atta = 425; + atta = 250; arp = -2; rang = 1; } if (argument0 = "Possessed Claws") { - atta = 250; + atta = 150; arp = -1; rang = 1; spli = 3; @@ -736,28 +738,31 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { arp = -1; rang = 20; amm = 4; - spli = 3; } if (argument0 = "Chainsword") { atta = 120; arp = 0; rang = 1; + spli = 4; } if (argument0 = "Bolt Pistol") { atta = 100; arp = 0; rang = 3.1; amm = 18; + spli = 1; } if (argument0 = "Chainaxe") { atta = 140; arp = 0; rang = 1; + spli = 3; } if (argument0 = "Poisoned Chainsword") { atta = 150; arp = 0; rang = 1; + spli = 1; if (obj_ini.preomnor = 1) { atta = 180; } @@ -766,18 +771,20 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { atta = 150; arp = -1; rang = 3; - spli = 3; + spli = 6; } if (argument0 = "Rubric Bolter") { atta = 150; arp = -1; rang = 12; amm = 15; + spli = 5; } // Bursts if (argument0 = "Witchfire") { atta = 200; arp = -2; rang = 5.1; + spli = 1; } if (argument0 = "Autogun") { atta = 60; @@ -797,6 +804,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { arp = 1; rang = 20; amm = 8; + spli = 1; } if (argument0 = "Twin Linked Heavy Bolters") { atta = 240; @@ -847,7 +855,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { spli = 12; } if (argument0 = "Baleflame") { - atta = 350; + atta = 225; arp = -2; rang = 2; } @@ -873,7 +881,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { spli = 0; } if (name = "Ogryn Melee") { - atta = 150; + atta = 90; arp = -2; rang = 1; } @@ -906,12 +914,12 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 2; } if (argument0 = "Seraphim Pistols") { - atta = 200; + atta = 120; arp = -1; rang = 4; } if (argument0 = "Laser Mace") { - atta = 200; + atta = 150; arp = -1; rang = 5.1; amm = 3; @@ -963,25 +971,25 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { spli = 0; } if (name = "Gauss Flayer") { - atta = 70; + atta = 50; arp = -1; rang = 6.1; - spli = 0; + spli = 1; } if (name = "Gauss Blaster") { - atta = 120; + atta = 80; arp = -1; rang = 6.1; spli = 0; } if (name = "Gauss Cannon") { - atta = 180; + atta = 120; arp = -2; rang = 10; spli = 3; } if (name = "Gauss Particle Cannon") { - atta = 300; + atta = 250; arp = -2; rang = 10.1; spli = 3; From 30ebf070d647ae0a4ba248d9996773ed5c3c2bc4 Mon Sep 17 00:00:00 2001 From: KR Da Mystic Date: Fri, 4 Apr 2025 04:05:01 +0900 Subject: [PATCH 26/80] ARP change x2 Changed ARP values to make it more sensible and allow for extension in the future. --- .../scr_equipment_struct.gml | 8 +- scripts/scr_shoot/scr_shoot.gml | 30 +-- scripts/scr_weapon/scr_weapon.gml | 235 +++++++++--------- 3 files changed, 137 insertions(+), 136 deletions(-) diff --git a/scripts/scr_equipment_struct/scr_equipment_struct.gml b/scripts/scr_equipment_struct/scr_equipment_struct.gml index f700def250..0d6021b7e6 100644 --- a/scripts/scr_equipment_struct/scr_equipment_struct.gml +++ b/scripts/scr_equipment_struct/scr_equipment_struct.gml @@ -173,16 +173,16 @@ function EquipmentStruct(item_data, core_type,quality="none") constructor{ array_push(special_properties_array, special_properties[k]); } } - if (arp=1){ + if (arp=4){ array_push(special_properties_array, "Anti Vehicle") } - else if (arp=0){ + else if (arp=1){ array_push(special_properties_array, "Low Penetration") } - else if (arp=-1){ + else if (arp=2){ array_push(special_properties_array, "Medium Penetration") } - else if (arp=-2){ + else if (arp=3){ array_push(special_properties_array, "High Penetration") } if (array_length(second_profiles)>0){ diff --git a/scripts/scr_shoot/scr_shoot.gml b/scripts/scr_shoot/scr_shoot.gml index 5273877788..6ef2db8a52 100644 --- a/scripts/scr_shoot/scr_shoot.gml +++ b/scripts/scr_shoot/scr_shoot.gml @@ -264,15 +264,15 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat // Calculate final armor value based on armor piercing (AP) rating against target type if (target_object.dudes_vehicle[target_type]) { - if (armour_pierce = 1) then target_armour_value = 0; - if (armour_pierce = 0) then target_armour_value = target_armour_value * 6; - if (armour_pierce = -1) then target_armour_value = target_armour_value * 4 ; - if (armour_pierce = -2) then target_armour_value = target_armour_value * 2; + if (armour_pierce = 4) then target_armour_value = 0; + if (armour_pierce = 3) then target_armour_value = target_armour_value * 2; + if (armour_pierce = 2) then target_armour_value = target_armour_value * 4 ; + if (armour_pierce = 1) then target_armour_value = target_armour_value * 6; } else { - if (armour_pierce = 1) then target_armour_value = 0; - if (armour_pierce = 0) then target_armour_value = target_armour_value * 3; - if (armour_pierce = -1) then target_armour_value = target_armour_value * 2; - if (armour_pierce = -2) then target_armour_value = target_armour_value * 1.5; + if (armour_pierce = 4) then target_armour_value = 0; + if (armour_pierce = 3) then target_armour_value = target_armour_value * 1.5; + if (armour_pierce = 2) then target_armour_value = target_armour_value * 2; + if (armour_pierce = 1) then target_armour_value = target_armour_value * 3; } attack_count_mod = max(1, splash[weapon_index_position]); @@ -361,15 +361,15 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat target_armour_value2 = target_object.dudes_ac[godd]; if (target_object.dudes_vehicle[godd] = 0) { - if (ap2 = 1) then target_armour_value2 = 0; - if (ap2 = 0) then target_armour_value2 = target_armour_value2 * 3; - if (ap2 = -1) then target_armour_value2 = target_armour_value2 * 2; - if (ap2 = -2) then target_armour_value2 = target_armour_value2 * 1.5; + if (ap2 = 1) then target_armour_value2 = target_armour_value2 * 3; + if (ap2 = 2) then target_armour_value2 = target_armour_value2 * 2; + if (ap2 = 3) then target_armour_value2 = target_armour_value2 * 1.5; + if (ap2 = 4) then target_armour_value2 = 0; } if (target_object.dudes_vehicle[godd] = 1) { - if (ap2 = 0) then target_armour_value2 = target_armour_value2 * 6; - if (ap2 = -1) then target_armour_value2 = target_armour_value2 * 4; - if (ap2 = -2) then target_armour_value2 = target_armour_value2 * 2; + if (ap2 = 1) then target_armour_value2 = target_armour_value2 * 6; + if (ap2 = 2) then target_armour_value2 = target_armour_value2 * 4; + if (ap2 = 3) then target_armour_value2 = target_armour_value2 * 2; } b2 = a2 - target_armour_value2; if (b2 <= 0) then b2 = 0; // Average after armour diff --git a/scripts/scr_weapon/scr_weapon.gml b/scripts/scr_weapon/scr_weapon.gml index 074e1b5225..167097ad1a 100644 --- a/scripts/scr_weapon/scr_weapon.gml +++ b/scripts/scr_weapon/scr_weapon.gml @@ -51,7 +51,7 @@ global.weapons = { "range": 4.1, "spli": 0, - "arp": 0, + "arp": 1, "tags": ["pistol", "ancient", "las", "energy"], }, @@ -68,7 +68,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 2, - "arp": 0, + "arp": 1, "tags": ["knife"], }, "Chainsword": { @@ -84,7 +84,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 4, - "arp": 0, + "arp": 1, "tags": ["chain", "sword","savage", "boarding 1"], }, "Chainaxe": { @@ -105,7 +105,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 3, - "arp": 0, + "arp": 1, "tags": ["chain", "axe", "dual", "savage", "boarding 2"], }, "Company Standard": { @@ -126,6 +126,7 @@ global.weapons = { "ranged_hands": 1, "range": 1, "spli": 1, + "arp": 1, "tags": ["banner"], }, "Eviscerator": { @@ -146,7 +147,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 6, - "arp": -1, + "arp": 2, "tags": ["chain", "sword", "savage"], }, "Power Sword": { @@ -167,7 +168,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 4, - "arp": -1, + "arp": 2, "special_properties": ["Parry"], "tags": ["power", "sword", "martial", "boarding 1"], }, @@ -189,7 +190,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 3, - "arp": -1, + "arp": 2, "special_properties": ["Parry"], "tags": ["power", "spear", "martial"], }, @@ -206,7 +207,7 @@ global.weapons = { "range": 1, "spli": 4, "tags": ["power","boarding 3", "chain", "fist", "siege", "savage"], - "arp": -2, + "arp": 3, }, "Lascutter": { "abbreviation": "Lasct", @@ -218,7 +219,7 @@ global.weapons = { "description": "Originally industrial tools used for breaking through bulkheads, this laser weapon is devastating in close combat.", "melee_hands": 1, "range": 1, - "arp": 1, + "arp": 4, "tags": ["las","boarding 3", "siege"], }, "Power Weapon": { @@ -239,7 +240,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 3, - "arp": -1, + "arp": 2, "tags": ["power"], }, "Power Axe": { @@ -260,7 +261,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 3, - "arp": -1, + "arp": 2, "tags": ["power", "axe", "dual","savage", "boarding 2"], }, "Omnissian Axe": { @@ -281,7 +282,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 5, - "arp": -2, + "arp": 3, "tags": ["power", "axe", "savage", "boarding 3"], }, "Executioner Power Axe": { @@ -302,7 +303,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 5, - "arp": -2, + "arp": 3, "tags": ["power", "axe", "martial"], }, "Power Fist": { @@ -324,7 +325,7 @@ global.weapons = { "range": 1, "spli": 2, "tags": ["power", "dual", "fist", "savage", "boarding 2"], - "arp": -2, + "arp": 3, }, "Power Fists": { "abbreviation": "PwrFsts", @@ -340,7 +341,7 @@ global.weapons = { "range": 1, "spli": 4, "tags": ["power", "fist", "pair","savage" ,"boarding 2"], - "arp": -2, + "arp": 3, }, "Servo-arm(M)": { "abbreviation": "MchArm", @@ -355,7 +356,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 2, - "arp": -2, + "arp": 3, "tags": ["siege"], }, "Boltstorm Gauntlet": { @@ -371,7 +372,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 2, - "arp": -2, + "arp": 3, "second_profiles": ["Integrated-Bolter"], "tags": ["power", "fist", "savage", "boarding 2"], }, @@ -387,7 +388,7 @@ global.weapons = { "ranged_hands": 1, "range": 1, "spli": 2, - "arp": -2, + "arp": 3, "second_profiles": ["Assault Cannon"], "tags": ["power","boarding 3", "chain", "fist", "dual", "siege"], }, @@ -405,7 +406,7 @@ global.weapons = { "range": 1, "spli": 5, "tags": ["power", "dual", "fist", "boarding 2", "martial"], - "arp": -1, + "arp": 2, }, "Dreadnought Lightning Claw": { "abbreviation": "LghtClw", @@ -425,7 +426,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 15, - "arp": -2, + "arp": 3, "maintenance" : 0.1, "tags": ["power", "vehicle", "dual", "dreadnought", "fist"], }, @@ -447,7 +448,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 3, - "arp": -2, + "arp": 3, "maintenance" : 0.1, "req_exp": 100, "tags": ["power", "hammer", "siege", "savage", "boarding 2"], @@ -469,7 +470,7 @@ global.weapons = { "ranged_hands": 2, "ammo": 0, "range": 1, - "arp": -2, + "arp": 3, "spli": 4, "maintenance" : 0.1, "req_exp": 100, @@ -492,7 +493,7 @@ global.weapons = { "ranged_hands": 2, "ammo": 0, "range": 1, - "arp": -2, + "arp": 3, "spli": 6, "tags": ["power", "mace", "siege", "savage"], "req_exp": 100, @@ -516,7 +517,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 6, - "arp": -2, + "arp": 3, "tags": ["power", "mace", "siege", "pious", "savage"], "req_exp": 100, }, @@ -538,7 +539,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 1, - "arp": 0, + "arp": 1, "tags": ["arcane", "savage"], }, "Crozius Arcanum": { @@ -559,7 +560,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 4, - "arp": -1, + "arp": 2, "tags": ["power", "mace", "pious", "savage", "boarding 2"], }, "Relic Blade": { @@ -580,7 +581,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 8, - "arp": -1, + "arp": 2, "special_properties": ["Parry"], "maintenance" : 0.1, "tags": ["power", "sword", "martial"], @@ -599,7 +600,7 @@ global.weapons = { "ammo": 18, "range": 4.1, "spli": 2, - "arp": 0, + "arp": 1, "tags": ["bolt", "pistol", "boarding 1"], }, "Wrist-Mounted Storm Bolter": { @@ -615,7 +616,7 @@ global.weapons = { "ammo": 10, "range": 4.1, "spli": 8, - "arp": 0, + "arp": 1, "maintenance" : 0.1, "tags": ["bolt", "pistol", "boarding 2"], }, @@ -632,7 +633,7 @@ global.weapons = { "ammo": 10, "range": 4.1, "spli": 8, - "arp": 0, + "arp": 1, "maintenance" : 0.1, "tags": ["bolt", "pistol", "boarding 2"], }, @@ -649,7 +650,7 @@ global.weapons = { "ammo": 5, "range": 4.1, "spli": 1, - "arp": 0, + "arp": 1, "tags": ["immobolise"] }, "Grav-Pistol": { @@ -665,7 +666,7 @@ global.weapons = { "ammo": 4, "range": 4.1, "spli": 1, - "arp": 1, + "arp": 4, "maintenance" : 0.2, "tags": ["grav", "pistol"], }, @@ -682,7 +683,7 @@ global.weapons = { "ammo": 3, "range": 5.1, "spli": 1, - "arp": 1, + "arp": 4, "tags": ["grav"] }, "Grav-Gun": { @@ -698,7 +699,7 @@ global.weapons = { "ammo": 6, "range": 5, "spli": 3, - "arp": 1, + "arp": 4, "tags": ["grav"], "maintenance" : 0.5, }, @@ -715,7 +716,7 @@ global.weapons = { "ammo": 8, "range": 6, "spli": 6, - "arp": 1, + "arp": 4, "tags": ["grav", "heavy_ranged"], "maintenance" : 0.8, }, @@ -732,7 +733,7 @@ global.weapons = { "ammo": 0, "range": 10, "spli": 3, - "arp": 0, + "arp": 1, "tags": ["bolt", "attached"] }, "Stalker Pattern Bolter": { @@ -748,7 +749,7 @@ global.weapons = { "ammo": 20, "range": 16, "spli": 3, - "arp": 0, + "arp": 1, "tags": ["bolt", "precision"] }, "Bolter": { @@ -764,7 +765,7 @@ global.weapons = { "ammo": 16, "range": 10, "spli": 5, - "arp": 0, + "arp": 1, "tags": ["bolt", "boarding 1"] }, "Heavy Flamer": { @@ -780,7 +781,7 @@ global.weapons = { "ammo": 8, "range": 4, "spli": 20, - "arp": -1, + "arp": 2, "tags": ["flame", "heavy_ranged", "boarding 3"] }, "CCW Heavy Flamer": { @@ -796,7 +797,7 @@ global.weapons = { "ammo": 6, "range": 2.1, "spli": 20, - "arp": -1, + "arp": 2, "tags": ["dreadnought","heavy_ranged", "flame"] }, "Dreadnought Power Claw": { @@ -810,7 +811,7 @@ global.weapons = { "melee_hands": 5, "range": 1, "spli": 10, - "arp": 1, + "arp": 4, "tags": ["power", "vehicle", "dual", "dreadnought", "fist"], "maintenance" : 0.1, }, @@ -825,7 +826,7 @@ global.weapons = { "melee_hands": 5, "range": 1, "spli": 10, - "arp": 1, + "arp": 4, "tags": ["vehicle", "dreadnought", "fist"], "maintenance" : 0.1, }, @@ -842,7 +843,7 @@ global.weapons = { "ammo": 0, "range": 4.1, "spli": 20, - "arp": -1, + "arp": 2, "tags": ["vehicle","heavy_ranged", "flame", "dreadnought"] }, "Integrated-Melta": { @@ -858,7 +859,7 @@ global.weapons = { "ammo": 5, "range": 3.1, "spli": 1, - "arp": 1, + "arp": 4, "tags": ["melta"] }, "Meltagun": { @@ -874,7 +875,7 @@ global.weapons = { "ammo": 6, "range": 2.1, "spli": 6, - "arp": -2, + "arp": 3, "tags": ["melta","boarding 3"] }, "Multi-Melta": { @@ -890,7 +891,7 @@ global.weapons = { "ammo": 8, "range": 4.1, "spli": 10, - "arp": -2, + "arp": 3, "tags": ["melta", "heavy_ranged", "dreadnought", "boarding 1"] }, "Plasma Pistol": { @@ -906,7 +907,7 @@ global.weapons = { "ammo": 0, "range": 5.1, "spli": 2, - "arp": -2, + "arp": 3, "tags": ["plasma", "energy", "pistol", "boarding 1"] }, "Plasma Cutter": { // Basically a dual-linked plasma pistol @@ -922,7 +923,7 @@ global.weapons = { "ammo": 0, "range": 4.1, "spli": 1, - "arp": -2, + "arp": 3, "tags": ["plasma", "energy", "pistol"] }, "Infernus Pistol": { @@ -938,7 +939,7 @@ global.weapons = { "ammo": 4, "range": 2.1, "spli": 3, - "arp": -2, + "arp": 3, "tags": ["melta", "pistol", "boarding 2"] }, "Integrated-Plasma": { @@ -954,7 +955,7 @@ global.weapons = { "ammo": 6, "range": 10, "spli": 4, - "arp": -2, + "arp": 3, "tags": ["plasma","energy"] }, "Plasma Gun": { @@ -970,7 +971,7 @@ global.weapons = { "ammo": 16, "range": 10, "spli": 4, - "arp": -2, + "arp": 3, "tags": ["plasma", "energy", "boarding 1"] }, "Plasma Cannon": { @@ -986,7 +987,7 @@ global.weapons = { "ammo": 16, "range": 10, "spli": 8, - "arp": -2, + "arp": 3, "tags": ["plasma","energy","heavy_ranged", "dreadnought"] }, "Sniper Rifle": { @@ -1002,7 +1003,7 @@ global.weapons = { "ammo": 20, "range": 14, "spli": 1, - "arp": 0, + "arp": 1, "tags": ["precision", "rifle"] }, "Needle Sniper Rifle": { @@ -1018,7 +1019,7 @@ global.weapons = { "ammo": 20, "range": 14, "spli": 1, - "arp": -1, + "arp": 2, "tags": ["precision", "rifle"] }, "Assault Cannon": { @@ -1034,7 +1035,7 @@ global.weapons = { "ammo": 5, "range": 12, "spli": 20, - "arp": -1, + "arp": 2, "tags": ["heavy_ranged", "dreadnought"] }, "Autocannon": { @@ -1050,7 +1051,7 @@ global.weapons = { "ammo": 25, "range": 14, "spli": 12, - "arp": -1, + "arp": 2, "tags": ["heavy_ranged","explosive", "dreadnought"] }, "Missile Launcher": { @@ -1066,7 +1067,7 @@ global.weapons = { "ammo": 6, "range": 12, "spli": 10, - "arp": -1, + "arp": 2, "tags": ["heavy_ranged","explosive", "dreadnought"] }, @@ -1083,7 +1084,7 @@ global.weapons = { "ammo": 6, "range": 8, "spli": 20, - "arp": -1, + "arp": 2, "tags": ["heavy_ranged","explosive"] }, "Lascannon": { @@ -1099,7 +1100,7 @@ global.weapons = { "ammo": 8, "range": 20, "spli": 1, - "arp": 1, + "arp": 4, "tags": ["heavy_ranged", "las", "energy"] }, "Conversion Beam Projector": { @@ -1115,7 +1116,7 @@ global.weapons = { "ammo": 1, "range": 20, "spli": 3, - "arp": 1, + "arp": 4, "tags": ["heavy_ranged", "ancient"] }, "Integrated-Bolter": { @@ -1131,7 +1132,7 @@ global.weapons = { "ammo": 8, "range": 10, "spli": 5, - "arp": 0, + "arp": 1, "tags": ["bolt"] }, "Twin Linked Heavy Bolter": { @@ -1147,7 +1148,7 @@ global.weapons = { "ammo": 20, "range": 16, "spli": 28, - "arp": -1, + "arp": 2, "tags": ["bolt", "heavy_ranged", "vehicle", "dreadnought"] }, "Twin Linked Lascannon": { @@ -1163,7 +1164,7 @@ global.weapons = { "ammo": 8, "range": 24, "spli": 2, - "arp": 1, + "arp": 4, "tags": ["las", "energy", "heavy_ranged", "vehicle", "dreadnought"] }, "Heavy Bolter": { @@ -1179,7 +1180,7 @@ global.weapons = { "ammo": 10, "range": 14, "spli": 12, - "arp": -1, + "arp": 2, "tags": ["heavy_ranged", "bolt"] }, "Whirlwind Missiles": { @@ -1195,7 +1196,7 @@ global.weapons = { "ammo": 6, "range": 20, "spli": 40, - "arp": -1, + "arp": 2, "tags": ["vehicle","heavy_ranged", "indirect"] }, "HK Missile": { @@ -1216,7 +1217,7 @@ global.weapons = { "ammo": 20, "range": 16, "spli": 21, - "arp": -1, + "arp": 2, "tags": ["vehicle", "dreadnought", "heavy_ranged", "bolt"] }, "Twin Linked Lascannon Mount": { @@ -1232,7 +1233,7 @@ global.weapons = { "ammo": 10, "range": 20, "spli": 2, - "arp": 1, + "arp": 4, "tags": ["las", "energy", "vehicle", "heavy_ranged", "dreadnought"] }, "Twin Linked Assault Cannon Mount": { @@ -1248,7 +1249,7 @@ global.weapons = { "ammo": 6, "range": 12, "spli": 40, - "arp": -1, + "arp": 2, "tags": ["vehicle","heavy_ranged", "pintle", "dreadnought"] }, "Reaper Autocannon Mount": { @@ -1264,7 +1265,7 @@ global.weapons = { "ammo": 25, "range": 15, "spli": 24, - "arp": -1, + "arp": 2, "tags": ["vehicle","heavy_ranged", "pintle"] }, "Quad Linked Heavy Bolter Sponsons": { @@ -1280,7 +1281,7 @@ global.weapons = { "ammo": 15, "range": 16, "spli": 50, - "arp": -1, + "arp": 2, "tags": ["bolt","heavy_ranged", "vehicle", "sponson"] }, "Twin Linked Lascannon Sponsons": { @@ -1296,7 +1297,7 @@ global.weapons = { "ammo": 5, "range": 20, "spli": 4, - "arp": 1, + "arp": 4, "tags": ["las", "energy", "vehicle", "heavy_ranged", "sponson", "twin_linked"] }, "Lascannon Sponsons": { @@ -1312,7 +1313,7 @@ global.weapons = { "ammo": 8, "range": 20, "spli": 2, - "arp": 1, + "arp": 4, "tags": ["las", "energy","heavy_ranged", "vehicle", "sponson"] }, "Hurricane Bolter Sponsons": { @@ -1328,7 +1329,7 @@ global.weapons = { "ammo": 10, "range": 10, "spli": 60, - "arp": 0, + "arp": 1, "tags": ["bolt","heavy_ranged", "vehicle", "sponson"] }, "Flamestorm Cannon Sponsons": { @@ -1344,7 +1345,7 @@ global.weapons = { "ammo": 6, "range": 4.1, "spli": 30, - "arp": -2, + "arp": 3, "tags": ["flame","heavy_ranged", "vehicle", "sponson"] }, "Twin Linked Heavy Flamer Sponsons": { @@ -1360,7 +1361,7 @@ global.weapons = { "ammo": 8, "range": 4.1, "spli": 40, - "arp": -1, + "arp": 2, "tags": ["flame","heavy_ranged", "vehicle", "dreadnought", "sponson"] }, "Twin Linked Bolters": { @@ -1376,7 +1377,7 @@ global.weapons = { "ammo": 30, "range": 10, "spli": 10, - "arp": 0, + "arp": 1, "tags": ["bolt", "vehicle"] }, "Twin Linked Multi-Melta Sponsons": { @@ -1392,7 +1393,7 @@ global.weapons = { "ammo": 8, "range": 4.1, "spli": 20, - "arp": 1, + "arp": 4, "tags": ["vehicle","heavy_ranged", "Sponson", "melta"], "maintenance" : 0.05, }, @@ -1409,7 +1410,7 @@ global.weapons = { "ammo": 25, "range": 18, "spli": 12, - "arp": -2, + "arp": 3, "tags": ["vehicle","heavy_ranged", "Sponson", "volkite", "ancient"] }, "Heavy Bolter Sponsons": { @@ -1425,7 +1426,7 @@ global.weapons = { "ammo": 20, "range": 14, "spli": 28, - "arp": -1, + "arp": 2, "tags": ["heavy_ranged", "vehicle", "sponson", "bolt"] }, "Heavy Flamer Sponsons": { @@ -1442,7 +1443,7 @@ global.weapons = { "ammo": 8, "range": 4.1, "spli": 40, - "arp": -1, + "arp": 2, "tags": ["flame","heavy_ranged", "vehicle", "sponson"], "maintenance" : 0.05, }, @@ -1459,7 +1460,7 @@ global.weapons = { "ammo": 25, "range": 18, "spli": 6, - "arp": -2, + "arp": 3, "tags": ["vehicle","heavy_ranged", "Sponson", "volkite", "ancient"] }, "Autocannon Turret": { @@ -1475,7 +1476,7 @@ global.weapons = { "ammo": 18, "range": 18, "spli": 15, - "arp": -1, + "arp": 2, "tags": ["vehicle","heavy_ranged","explosive", "turret"] }, "Storm Bolter": { @@ -1491,7 +1492,7 @@ global.weapons = { "ammo": 10, "range": 8, "spli": 8, - "arp": 0, + "arp": 1, "maintenance" : 0.03, "tags": ["bolt", "boarding 2"] @@ -1509,7 +1510,7 @@ global.weapons = { "ammo": 4, "range": 3.1, "spli": 8, - "arp": 0, + "arp": 1, "tags": ["pistol", "flame", "boarding 2"] }, "Flamer": { @@ -1530,7 +1531,7 @@ global.weapons = { "ammo": 8, "range": 4.1, "spli": 14, - "arp": 0, + "arp": 1, "maintenance" : 0.01, "tags": ["flame", "boarding 2"] }, @@ -1547,7 +1548,7 @@ global.weapons = { "ammo": 4, "range": 4.1, "spli": 10, - "arp": 0, + "arp": 1, "tags": ["flame", "attached"] }, "Combiflamer": { @@ -1563,7 +1564,7 @@ global.weapons = { "ammo": 15, "range": 10, "spli": 5, - "arp": 0, + "arp": 1, "second_profiles": ["Integrated-Flamer"], "tags": ["combi", "bolt", "boarding 2"] }, @@ -1580,7 +1581,7 @@ global.weapons = { "ammo": 8, "range": 10, "spli": 5, - "arp": 0, + "arp": 1, "second_profiles": ["Integrated-Plasma"], "tags": ["combi", "bolt"] }, @@ -1597,7 +1598,7 @@ global.weapons = { "ammo": 8, "range": 10, "spli": 5, - "arp": 0, + "arp": 1, "second_profiles": ["Integrated-Grav"], "tags": ["combi", "bolt"] }, @@ -1614,7 +1615,7 @@ global.weapons = { "ammo": 8, "range": 10, "spli": 5, - "arp": 0, + "arp": 1, "second_profiles": ["Integrated-Melta"], "tags": ["combi", "bolt", "boarding 3"] }, @@ -1631,7 +1632,7 @@ global.weapons = { "ammo": 4, "range": 4.1, "spli": 20, - "arp": -1, + "arp": 2, "tags": ["flame","boarding 3"] }, "Force Staff": { @@ -1651,7 +1652,7 @@ global.weapons = { "ranged_hands": 1, "range": 1, "spli": 5, - "arp": -1, + "arp": 2, "special_description": "Spell Damage +100%", "maintenance" : 0.1, "tags": ["force"] @@ -1674,7 +1675,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 4, - "arp": -1, + "arp": 2, "special_properties": ["Parry"], "maintenance" : 0.1, "tags": ["force", "sword", "martial", "boarding 1"], @@ -1697,7 +1698,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 3, - "arp": -1, + "arp": 2, "special_description": "Able to be dual-wielded, Spell damage +25%", "tags": ["force", "axe", "dual", "savage", "boarding 2"], }, @@ -1709,7 +1710,7 @@ global.weapons = { }, "abbreviation": "TwnLscnn", "description": "A Predator-compatible turret mounting a twin-linked lascannon.", - "arp": 1, + "arp": 4, "range": 24, "ammo": 5, "spli": 1, @@ -1728,7 +1729,7 @@ global.weapons = { "ammo": 5, "range": 12, "spli": 40, - "arp": -1, + "arp": 2, "tags": ["heavy_ranged", "twin_linked", "vehicle", "turret"] }, "Flamestorm Cannon Turret": { @@ -1744,7 +1745,7 @@ global.weapons = { "ammo": 12, "range": 4.1, "spli": 25, - "arp": -2, + "arp": 3, "tags": ["flame","heavy_ranged", "vehicle", "turret"] }, "Magna-Melta Turret": { @@ -1760,7 +1761,7 @@ global.weapons = { "ammo": 6, "range": 4.1, "spli": 20, - "arp": 1, + "arp": 4, "tags": ["vehicle","heavy_ranged", "turret", "melta"] }, "Plasma Destroyer Turret": { @@ -1776,7 +1777,7 @@ global.weapons = { "ammo": 16, "range": 14, "spli": 12, - "arp": 1, + "arp": 4, "tags": ["plasma", "energy","heavy_ranged", "vehicle", "turret"] }, "Heavy Conversion Beam Projector": { @@ -1792,7 +1793,7 @@ global.weapons = { "ammo": 6, "range": 20, "spli": 1, - "arp": 1, + "arp": 4, "tags": ["vehicle","heavy_ranged", "dreadnought", "turret", "ancient"] }, "Neutron Blaster Turret": { @@ -1808,7 +1809,7 @@ global.weapons = { "ammo": 6, "range": 20, "spli": 2, - "arp": 1, + "arp": 4, "tags": ["vehicle","heavy_ranged", "turret"] }, "Volkite Saker Turret": { @@ -1824,7 +1825,7 @@ global.weapons = { "ammo": 25, "range": 18, "spli": 30, - "arp": -2, + "arp": 3, "tags": ["vehicle","heavy_ranged", "turret", "volkite", "ancient"] }, // Hireling weapons @@ -1840,7 +1841,7 @@ global.weapons = { "ammo": 20, "range": 12, "spli": 3, - "arp": 0, + "arp": 1, "tags": ["las"], "melee_hands": 0, "ranged_hands": 1, @@ -1858,7 +1859,7 @@ global.weapons = { "ammo": 30, "range": 3.1, "spli": 1, - "arp": 0, + "arp": 1, "tags": ["pistol", "las"], }, // Other imperials @@ -1875,7 +1876,7 @@ global.weapons = { "ammo": 16, "range": 10, "spli": 2, - "arp": 0, + "arp": 1, "tags": ["bolt"], "second_profiles": ["Sarissa"] }, @@ -1892,7 +1893,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 1, - "arp": 0, + "arp": 1, "tags": ["axe"], }, "Hellrifle": { @@ -1906,7 +1907,7 @@ global.weapons = { "ammo": 10, "range": 20, "spli": 1, - "arp": 0, + "arp": 1, "tags": ["rifle", "arcane"], "ranged_hands": 1, }, @@ -1935,7 +1936,7 @@ global.weapons = { "ammo": 6, "range": 2.1, "spli": 3, - "arp": 0, + "arp": 1, "tags": ["pistol"] }, "Eldar Power Sword": { @@ -1956,7 +1957,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 3, - "arp": -1, + "arp": 2, "special_properties": ["Parry"], "tags": ["power", "sword", "elder", "xenos"], }, @@ -1984,7 +1985,7 @@ global.weapons = { "ammo": 20, "range": 3.1, "spli": 3, - "arp": 0, + "arp": 1, "tags": ["rifle"] }, } @@ -2228,9 +2229,9 @@ global.gear = { "MK4 Maximus": { "abbreviation": "MK4", "armour_value": { - "standard": 17, - "master_crafted": 19, - "artifact": 23 + "standard": 15, + "master_crafted": 17, + "artifact": 21 }, "ranged_mod": { "standard": 10, @@ -2248,9 +2249,9 @@ global.gear = { "artifact": 10 }, "damage_resistance_mod": { - "standard": 0, - "master_crafted": 10, - "artifact": 0 + "standard": -10, + "master_crafted": 0, + "artifact": 10 }, "description": "Power Armor dating back to the end of the Great Crusade. It is considered the pinnacle of Power Armor by some Astartes. However, the components are no longer reproducible, the knowledge having been lost to time.", "tags": ["power_armour"], @@ -2664,7 +2665,7 @@ global.gear = { "ammo": 0, "range": 1, "spli": 1, - "arp": 0, + "arp": 1, "tags": ["vehicle"], }, "Searchlight": { From c9e4c7b8a107b6f4e49f9d083f611a0662c5f200 Mon Sep 17 00:00:00 2001 From: KR Da Mystic Date: Fri, 4 Apr 2025 04:05:19 +0900 Subject: [PATCH 27/80] revert enemy arp values --- scripts/scr_en_weapon/scr_en_weapon.gml | 190 ++++++++++++------------ 1 file changed, 95 insertions(+), 95 deletions(-) diff --git a/scripts/scr_en_weapon/scr_en_weapon.gml b/scripts/scr_en_weapon/scr_en_weapon.gml index 77606829e6..98a0d60e12 100644 --- a/scripts/scr_en_weapon/scr_en_weapon.gml +++ b/scripts/scr_en_weapon/scr_en_weapon.gml @@ -36,7 +36,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { if (name = "Venom Claws") { atta = 200; - arp = -1; + arp = 1; rang = 1; spli = 0; if (obj_ini.preomnor = 1) { @@ -52,13 +52,13 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (name = "Warpsword") { atta = 300; - arp = -2; + arp = 1; rang = 1; spli = 3; } if (name = "Iron Claw") { atta = 400; - arp = -2; + arp = 1; rang = 1; spli = 0; } @@ -76,19 +76,19 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (name = "Bloodletter Melee") { atta = 70; - arp = -1; + arp = 0; rang = 1; spli = 3; } if (name = "Daemonette Melee") { atta = 65; - arp = -1; + arp = 0; rang = 1; spli = 3; } if (name = "Plaguebearer Melee") { atta = 60; - arp = -1; + arp = 0; rang = 1; spli = 3; if (obj_ini.preomnor = 1) { @@ -97,13 +97,13 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (name = "Khorne Demon Melee") { atta = 350; - arp = -2; + arp = 1; rang = 1; spli = 3; } if (name = "Demon Melee") { atta = 250; - arp = -2; + arp = 1; rang = 1; spli = 3; } @@ -132,19 +132,19 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { if (obj_ncombat.enemy = 3) { if (name = "Phased Plasma-fusil") { atta = 80; - arp = -2; + arp = 1; rang = 7.1; spli = 3; } if (name = "Lightning Gun") { atta = choose(80, 80, 80, 150); - arp = -1; + arp = 0; rang = 5; spli = 0; } if (name = "Thallax Melee") { atta = 80; - arp = -1; + arp = 0; rang = 1; spli = 3; } @@ -167,19 +167,19 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Singing Spear") { atta = 150; - arp = -1; + arp = 0; rang = 1; spli = 3; } if (argument0 = "Singing Spear Throw") { atta = 120; - arp = -1; + arp = 0; rang = 2; spli = 3; } if (argument0 = "Witchblade") { atta = 130; - arp = -1; + arp = 0; rang = 1; } if (argument0 = "Psyshock") { @@ -201,43 +201,43 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Ranger Long Rifle") { atta = 60; - arp = -1; + arp = 0; rang = 25; } if (argument0 = "Pathfinder Long Rifle") { atta = 70; - arp = -1; + arp = 0; rang = 25; } if (argument0 = "Shuriken Catapult") { atta = 50; - arp = -1; + arp = 0; rang = 2; } if (argument0 = "Twin Linked Shuriken Catapult") { atta = 100; - arp = -1; + arp = 0; rang = 2; } if (argument0 = "Avenger Shuriken Catapult") { atta = 90; - arp = -1; + arp = 0; rang = 3; } if (argument0 = "Power Weapon") or(argument0 = "Power Blades") { atta = 100; - arp = -1; + arp = 1; rang = 1; spli = 3; } if (argument0 = "Shuriken Pistol") { atta = 50; - arp = -1; + arp = 0; rang = 2.1; } if (argument0 = "Executioner") { atta = 150; - arp = -2; + arp = 1; rang = 1; } if (argument0 = "Scorpion Chainsword") { @@ -253,13 +253,13 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Biting Blade") { atta = 125; - arp = -1; + arp = 0; rang = 1; spli = 3; } if (argument0 = "Scorpian's Claw") { atta = 150; - arp = -2; + arp = 1; rang = 1; spli = 3; } @@ -281,21 +281,21 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Reaper Launcher") { atta = 120; - arp = -2; + arp = 1; rang = 20; amm = 8; spli = 3; } if (argument0 = "Tempest Launcher") { atta = 200; - arp = -1; + arp = 0; rang = 15; amm = 8; spli = 9; } if (argument0 = "Laser Lance") { atta = 180; - arp = -2; + arp = 1; rang = 2; spli = 3; } @@ -307,7 +307,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Plasma Pistol") { atta = 100; - arp = -2; + arp = 1; rang = 3.1; } if (argument0 = "Harlequin's Kiss") { @@ -323,7 +323,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Pulse Laser") { atta = 120; - arp = -1; + arp = 0; rang = 15; } if (argument0 = "Bright Lance") { @@ -333,7 +333,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Shuriken Cannon") { atta = 160; - arp = -1; + arp = 0; rang = 3; } if (argument0 = "Prism Cannon") { @@ -344,13 +344,13 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Twin Linked Doomweaver") { atta = 250; - arp = -2; + arp = 1; rang = 2; spli = 2; } // Also create difficult terrain? if (argument0 = "Starcannon") { atta = 250; - arp = -2; + arp = 1; rang = 8; spli = 4; } @@ -391,7 +391,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Power Klaw") { atta = 160; - arp = -2; + arp = 1; rang = 1; spli = 3; } @@ -410,29 +410,29 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { spli = 1; } if (argument0 = "Big Shoota") { - atta = 80; - arp = -1; + atta = 120; + arp = 0; rang = 6; amm = 30; spli = 5; } if (argument0 = "Dakkagun") { atta = 140; - arp = -1; + arp = 0; rang = 8; amm = 20; spli = 10; } if (argument0 = "Deffgun") { atta = 150; - arp = -2; + arp = 1; rang = 8; amm = 20; spli = 1; } if (argument0 = "Snazzgun") { atta = 200; - arp = -1; + arp = 0; rang = 5; spli = 0; } @@ -444,7 +444,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Kannon") { atta = 200; - arp = -1; + arp = 1; rang = 10.1; amm = 5; spli = 3; @@ -456,14 +456,14 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Burna") { atta = 140; - arp = -1; + arp = 0; rang = 2; amm = 4; spli = 3; } if (argument0 = "Skorcha") { atta = 200; - arp = -2; + arp = 1; rang = 2; amm = 6; spli = 3; @@ -492,12 +492,12 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (name = "Plasma Rifle") { atta = 120; - arp = -2; + arp = 1; rang = 10; } if (name = "Cyclic Ion Blaster") { atta = 80; - arp = -1; + arp = 0; rang = 6; spli = 3; } // x6 @@ -509,14 +509,14 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (name = "Missile Pod") { atta = 150; - arp = -1; + arp = 0; rang = 15; amm = 6; spli = 3; } if (name = "Smart Missile System") { atta = 150; - arp = -1; + arp = 0; rang = 15; } if (name = "Small Railgun") { @@ -527,12 +527,12 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (name = "Pulse Rifle") { atta = 80; - arp = -1; + arp = 0; rang = 12; } if (name = "Rail Rifle") { atta = 80; - arp = -2; + arp = 1; rang = 14; } if (name = "Kroot Rifle") { @@ -542,7 +542,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (name = "Vespid Crystal") { atta = 100; - arp = -2; + arp = 1; rang = 2.1; } if (name = "Railgun") { @@ -556,7 +556,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { if (argument0 = "Bonesword") { atta = 120; - arp = -2; + arp = 1; rang = 1; spli = 3; } @@ -583,8 +583,8 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { spli = 3; } if (argument0 = "Devourer") { - atta = 120; - arp = -1; + atta = 90; + arp = 0; rang = 5; spli = 3 if (obj_ini.preomnor = 1) { @@ -610,7 +610,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Deathspitter") { atta = 100; - arp = -1; + arp = 0; rang = 2.1; if (obj_ini.preomnor = 1) { atta = 150; @@ -626,12 +626,12 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Scything Talons") { atta = 50; - arp = -1; + arp = 0; rang = 1; } if (argument0 = "Genestealer Claws") { atta = 70; - arp = -2; + arp = 1; rang = 1; } if (argument0 = "Witchfire") { @@ -648,7 +648,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Lictor Claws") { atta = 300; - arp = -2; + arp = 1; rang = 1; } if (argument0 = "Flesh Hooks") { @@ -664,27 +664,27 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { if (argument0 = "Plasma Pistol") { atta = 70; - arp = -2; + arp = 1; rang = 3.1; } if (argument0 = "Power Weapon") { atta = 120; - arp = -1; + arp = 1; rang = 1; } if (argument0 = "Power Sword") { atta = 120; - arp = -1; + arp = 1; rang = 1; } if (argument0 = "Force Weapon") { atta = 250; - arp = -1; + arp = 1; rang = 1; } if (argument0 = "Chainfist") { atta = 300; - arp = -2; + arp = 1; rang = 1; spli = 3; } @@ -703,7 +703,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Heavy Flamer") { atta = 200; - arp = -1; + arp = 0; rang = 2.1; amm = 6; spli = 3; @@ -724,18 +724,18 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } // Bursts if (argument0 = "Power Fist") { atta = 250; - arp = -2; + arp = 1; rang = 1; } if (argument0 = "Possessed Claws") { atta = 150; - arp = -1; + arp = 0; rang = 1; spli = 3; } if (argument0 = "Missile Launcher") { atta = 200; - arp = -1; + arp = 0; rang = 20; amm = 4; } @@ -769,20 +769,20 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Sonic Blaster") { atta = 150; - arp = -1; + arp = 0; rang = 3; spli = 6; } if (argument0 = "Rubric Bolter") { atta = 150; - arp = -1; + arp = 0; rang = 12; amm = 15; spli = 5; } // Bursts if (argument0 = "Witchfire") { atta = 200; - arp = -2; + arp = 1; rang = 5.1; spli = 1; } @@ -808,13 +808,13 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Twin Linked Heavy Bolters") { atta = 240; - arp = -1; + arp = 0; rang = 16; spli = 3; } if (argument0 = "Twin-Linked Heavy Bolters") { atta = 240; - arp = -1; + arp = 0; rang = 16; spli = 3; } @@ -832,19 +832,19 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Battle Cannon") { atta = 300; - arp = -1; + arp = 0; rang = 12; } if (argument0 = "Demolisher Cannon") { atta = 500; - arp = -2; + arp = 1; rang = 2; spli = 8; if (instance_exists(obj_nfort)) then rang = 5; } if (argument0 = "Earthshaker Cannon") { atta = 250; - arp = -1; + arp = 0; rang = 12; spli = 8; } @@ -856,18 +856,18 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Baleflame") { atta = 225; - arp = -2; + arp = 1; rang = 2; } if (argument0 = "Defiler Claws") { atta = 350; - arp = -2; + arp = 1; rang = 1; spli = 3; } if (argument0 = "Reaper Autocannon") { atta = 320; - arp = -1; + arp = 0; rang = 18; amm = 10; spli = 3; @@ -875,36 +875,36 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { if (name = "Ripper Gun") { atta = 120; - arp = -1; + arp = 0; rang = 3; amm = 5; spli = 0; } if (name = "Ogryn Melee") { atta = 90; - arp = -2; + arp = 1; rang = 1; } if (name = "Multi-Laser") { atta = 150; - arp = -1; + arp = 0; rang = 10; } if (argument0 = "Blessed Weapon") { atta = 150; - arp = -2; + arp = 1; rang = 1; } if (argument0 = "Electro-Flail") { atta = 125; - arp = -1; + arp = 0; rang = 1; spli = 3; } if (argument0 = "Neural Whip") { atta = 85; - arp = -1; + arp = 0; rang = 1; spli = 3 } @@ -915,18 +915,18 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Seraphim Pistols") { atta = 120; - arp = -1; + arp = 0; rang = 4; } if (argument0 = "Laser Mace") { atta = 150; - arp = -1; + arp = 0; rang = 5.1; amm = 3; } if (argument0 = "Heavy Bolter") { atta = 120; - arp = -1; + arp = 0; rang = 16; spli = 0; } @@ -954,43 +954,43 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { if (obj_ncombat.enemy = 13) { // Some of these, like the Gauss Particle Cannon and Particle Whip, used to be more than twice as strong. if (name = "Staff of Light") { atta = 200; - arp = -2; + arp = 1; rang = 1; spli = 3; } if (name = "Staff of Light Shooting") { atta = 180; - arp = -2; + arp = 1; rang = 3; spli = 3; } if (name = "Warscythe") { atta = 200; - arp = -2; + arp = 1; rang = 1; spli = 0; } if (name = "Gauss Flayer") { atta = 50; - arp = -1; + arp = 0; rang = 6.1; spli = 1; } if (name = "Gauss Blaster") { atta = 80; - arp = -1; + arp = 0; rang = 6.1; spli = 0; } if (name = "Gauss Cannon") { atta = 120; - arp = -2; + arp = 1; rang = 10; spli = 3; } if (name = "Gauss Particle Cannon") { atta = 250; - arp = -2; + arp = 1; rang = 10.1; spli = 3; } @@ -1002,25 +1002,25 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (name = "Wraith Claws") { atta = 80; - arp = -1; + arp = 0; rang = 1; spli = 0; } if (name = "Claws") { atta = 300; - arp = -1; + arp = 0; rang = 1; spli = 0; } if (name = "Gauss Flux Arc") { atta = 180; - arp = -1; + arp = 0; rang = 8; spli = 3; } if (name = "Particle Whip") { atta = 300; - arp = -1; + arp = 0; rang = 4.1; spli = 3; } From b2ece2ff5c1da6712bd549b57cfd71f6e95612a5 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Fri, 4 Apr 2025 03:22:44 +0300 Subject: [PATCH 28/80] Loadout adjustments --- .../scr_initialize_custom.gml | 227 +++++------------- scripts/scr_squads/scr_squads.gml | 6 +- scripts/scr_weapon/scr_weapon.gml | 2 +- 3 files changed, 66 insertions(+), 169 deletions(-) diff --git a/scripts/scr_initialize_custom/scr_initialize_custom.gml b/scripts/scr_initialize_custom/scr_initialize_custom.gml index a859707757..cc9962702e 100644 --- a/scripts/scr_initialize_custom/scr_initialize_custom.gml +++ b/scripts/scr_initialize_custom/scr_initialize_custom.gml @@ -39,6 +39,22 @@ enum ePROGENITOR { RANDOM, } +#macro WEAPON_LIST_RANGED_BASIC ["Bolter", "Bolter", "Bolter", "Storm Bolter", "Storm Bolter"] +#macro WEAPON_LIST_RANGED_HEAVY ["Heavy Bolter", "Heavy Bolter", "Missile Launcher", "Missile Launcher", "Multi-Melta", "Lascannon", "Plasma Cannon", "Grav-Cannon"] +#macro WEAPON_LIST_RANGED_SPECIAL ["Flamer", "Flamer", "Meltagun", "Meltagun", "Plasma Gun", "Grav-Gun"] +#macro WEAPON_LIST_RANGED_COMBI ["Combiflamer", "Combiplasma", "Combigrav", "Combimelta"] +#macro WEAPON_LIST_RANGED_PISTOLS ["Bolt Pistol", "Bolt Pistol", "Bolt Pistol", "Plasma Pistol", "Plasma Pistol", "Grav-Pistol"] +#macro WEAPON_LIST_RANGED_VANGUARD ["Bolt Pistol", "Bolt Pistol", "Bolt Pistol", "Bolt Pistol", "Plasma Pistol", "Plasma Pistol", "Grav-Pistol"] +#macro WEAPON_LIST_RANGED_STERNGUARD array_concat(WEAPON_LIST_RANGED_BASIC, WEAPON_LIST_RANGED_COMBI) +#macro WEAPON_LIST_RANGED array_concat(WEAPON_LIST_RANGED_PISTOLS, WEAPON_LIST_RANGED_STERNGUARD, WEAPON_LIST_RANGED_COMBI) + +#macro WEAPON_LIST_MELEE_BASIC ["Chainsword", "Chainsword", "Chainsword", "Chainaxe", "Chainaxe"] +#macro WEAPON_LIST_MELEE_1H ["Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Power Sword", "Power Sword", "Power Sword", "Lightning Claw", "Lightning Claw", "Lightning Claw", "Power Fist", "Power Fist", "Thunder Hammer"] +#macro WEAPON_LIST_MELEE_HEAVY ["Eviscerator"] +#macro WEAPON_LIST_MELEE_VANGUARD ["Chainsword", "Chainsword", "Chainsword", "Power Sword", "Power Axe", "Lightning Claw", "Lightning Claw", "Power Fist", "Power Fist", "Thunder Hammer"] + +#macro WEAPON_LIST_WEIGHTED_RANGED_PISTOLS [["Bolt Pistol", 4], ["Hand Flamer", 2], ["Plasma Pistol", 2], ["Grav-Pistol", 1]] + function progenitor_map(){ var founding_chapters = [ "", @@ -1452,27 +1468,7 @@ function scr_initialize_custom() { sergeant: role[defaults_slot][eROLE.Sergeant], veteran_sergeant: role[defaults_slot][eROLE.VeteranSergeant], } - - var weapon_lists = { - heavy_weapons: ["Heavy Bolter", "Heavy Bolter", "Missile Launcher", "Missile Launcher", "Multi-Melta", "Lascannon","Plasma Cannon","Grav-Cannon"], - melee_weapons: ["Chainsword", "Chainsword", "Chainsword", "Chainaxe", "Chainaxe"], - special_melee_weapons: [ "Eviscerator", "Eviscerator", "Power Sword", "Power Sword", "Power Axe", "Power Axe", "Lightning Claw", "Lightning Claw", "Lightning Claw", "Power Fist", "Power Fist"], - ranged_weapons: ["Bolter", "Bolter", "Storm Bolter", "Storm Bolter", "Stalker Pattern Bolter", "Stalker Pattern Bolter" ], - special_ranged_weapons: ["Flamer", "Flamer", "Meltagun", "Meltagun", "Plasma Gun", "Grav-Gun"], - combi_weapons: ["Combiflamer","Combiplasma","Combigrav","Combimelta"], - pistols: ["Bolt Pistol", "Bolt Pistol", "Bolt Pistol", "Hand Flamer", "Hand Flamer", "Plasma Pistol", "Plasma Pistol", "Grav-Pistol"], - one_hand_melee: ["Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Power Sword", "Power Sword", "Power Sword", "Lightning Claw", "Lightning Claw", "Lightning Claw", "Power Fist", "Power Fist", "Thunder Hammer"], - } - - var weapon_weighted_lists = { - heavy_weapons: [["Heavy Bolter", 3], ["Missile Launcher", 3], ["Multi-Melta", 1], ["Lascannon", 1], ["Plasma Cannon", 1], ["Grav-Cannon", 1]], - ranged_weapons: [["Bolter", 4], ["Storm Bolter", 2],["Stalker Pattern Bolter", 2]], - special_ranged_weapons: [["Flamer", 2], ["Meltagun", 2], ["Plasma Gun", 1], ["Grav-Gun", 1]], - melee_weapons: [["Chainsword", 3], ["Chainaxe", 2]], - special_melee_weapons: [["Power Sword", 3], ["Power Axe", 3], ["Lightning Claw", 2], ["Power Fist", 2], ["Thunder Hammer", 1]], - combi_weapons: [["Combiflamer", 1], ["Combiplasma", 1], ["Combigrav", 1], ["Combimelta", 1]], - pistols: [["Bolt Pistol", 4],["Hand Flamer", 2], ["Plasma Pistol", 2], ["Grav-Pistol", 1]], - } + /* squad guidance define a role that can exist in a squad by defining @@ -1654,16 +1650,13 @@ function scr_initialize_custom() { "option": { "wep1": [ [ - weapon_lists.ranged_weapons, 3 + WEAPON_LIST_RANGED_STERNGUARD, 7 ], [ - weapon_lists.combi_weapons, 4 + WEAPON_LIST_RANGED_SPECIAL, 1 ], [ - weapon_lists.special_ranged_weapons, 1 - ], - [ - weapon_lists.heavy_weapons, 1, { + WEAPON_LIST_RANGED_HEAVY, 1, { "wep2":"Combat Knife", "mobi":"Heavy Weapons Pack", } @@ -1679,9 +1672,16 @@ function scr_initialize_custom() { "role": $"Sternguard {roles.veteran_sergeant}", "loadout": { "required": { - "wep1": ["Stalker Pattern Bolter", 1], - "wep2": [wep2[100][eROLE.Veteran], 1], + "wep1": ["", 0], + "wep2": ["Combat Knife", max], }, + "option": { + "wep1": [ + [ + WEAPON_LIST_RANGED_STERNGUARD, 1 + ] + ] + } } }], ["type_data", { @@ -1699,21 +1699,18 @@ function scr_initialize_custom() { "loadout": { "required": { "wep1": ["", 0], - "wep2": ["Bolt Pistol", 4], + "wep2": ["", 0], "mobi": ["Jump Pack", 9] }, "option": { "wep1": [ [ - weapon_lists.special_melee_weapons, 9 + WEAPON_LIST_MELEE_VANGUARD, 9 ], ], "wep2": [ [ - ["Storm Shield"], 2, - ], - [ - weapon_lists.pistols, 3 + WEAPON_LIST_RANGED_VANGUARD, 9 ], ] } @@ -1752,7 +1749,7 @@ function scr_initialize_custom() { "option": { "wep1": [ [ - weapon_lists.heavy_weapons, 4, { + WEAPON_LIST_RANGED_HEAVY, 4, { "mobi":"Heavy Weapons Pack", } ], @@ -1767,19 +1764,15 @@ function scr_initialize_custom() { "role": $"{roles.devastator} {roles.sergeant}", "loadout": { "required": { - "mobi": ["", 1], + "wep2": ["Combat Knife", 1], + "mobi": ["", 0] }, "option": { "wep1": [ [ - weapon_lists.pistols, 1 - ], - ], - "wep2": [ - [ - weapon_lists.melee_weapons, 1 + WEAPON_LIST_RANGED, 1 ], - ], + ] } } }], @@ -1801,10 +1794,10 @@ function scr_initialize_custom() { "option": { "wep1": [ [ - weapon_lists.special_ranged_weapons, 1 + WEAPON_LIST_RANGED_SPECIAL, 1 ], [ - weapon_lists.heavy_weapons, 1, { + WEAPON_LIST_RANGED_HEAVY, 1, { "wep2":"Combat Knife", "mobi":"Heavy Weapons Pack", } @@ -1820,17 +1813,17 @@ function scr_initialize_custom() { "loadout": { "required": { "wep1": ["", 0], - "wep2": ["Chainsword", 1] + "wep2": ["", 0] }, "option": { "wep1": [ [ - weapon_lists.pistols, 1 + WEAPON_LIST_RANGED_PISTOLS, 1 ], ], "wep2": [ [ - weapon_lists.melee_weapons, 1 + WEAPON_LIST_MELEE_BASIC, 1 ], ], } @@ -1883,12 +1876,12 @@ function scr_initialize_custom() { "option": { "wep1": [ [ - weapon_lists.pistols, 1 + WEAPON_LIST_RANGED_PISTOLS, 1 ], ], "wep2": [ [ - weapon_lists.melee_weapons, 1 + WEAPON_LIST_MELEE_1H, 1 ], ], } @@ -1906,13 +1899,13 @@ function scr_initialize_custom() { "min": 4, "loadout": { "required": { - "wep1": [wep1[100][12], 6], - "wep2": [wep2[100][12], 9] + "wep1": ["", 0], + "wep2": ["Combat Knife", 9] }, "option": { "wep1": [ [ - ["Bolter", "Stalker Pattern Bolter"], 2 + ["Bolter", "Sniper Rifle", "Bolter", "Sniper Rifle", "Stalker Pattern Bolter"], 9 ], [ ["Missile Launcher", "Heavy Bolter"], 1 @@ -1925,15 +1918,14 @@ function scr_initialize_custom() { "max": 1, "min": 1, "loadout": { + "required": { + "wep1": ["", 0], + "wep2": ["Combat Knife", 1] + }, "option": { "wep1": [ [ - ["Bolt Pistol", "Bolt Pistol", "Plasma Pistol", "Bolter", "Bolter", "Stalker Pattern Bolter"], 1 - ] - ], - "wep2": [ - [ - weapon_lists.melee_weapons, 1 + WEAPON_LIST_RANGED, 1 ] ] } @@ -1946,45 +1938,6 @@ function scr_initialize_custom() { "formation_options": ["scout"], }], ], - - "scout_sniper_squad": [ - [roles.scout, - { - "max": 9, - "min": 4, - "loadout": { - "required": { - "wep1": ["Sniper Rifle", 8], - "wep2": ["Combat Knife", 9] - }, - "option": { - "wep1": [ - [ - ["Missile Launcher","Needle Sniper Rifle"], 1 - ] - ], - } - }, - "role": $"{roles.scout} Sniper", - }], - [roles.sergeant, { - "max": 1, - "min": 1, - "loadout": { - "required": { - "wep1": ["Needle Sniper Rifle", 1], - "wep2": ["Combat Knife", 1] - }, - }, - "role": $"Sniper {roles.sergeant}", - } - ], - ["type_data", { - "display_data": $"{roles.scout} Sniper {squad_name}", - "class": ["scout"], - "formation_options": ["scout"], - }], - ] }; // show_debug_message($"squads object for chapter {chapter_name}"); @@ -2014,7 +1967,7 @@ function scr_initialize_custom() { // show_debug_message($"roles object for chapter {chapter_name} after setting from obj"); // show_debug_message($"{st}"); - if (scr_has_adv("Crafters")) { //salamanders squads + if (global.chapter_name == "Salamanders") { variable_struct_set(st, "assault_squad", [ [roles.assault, { "max": 9, @@ -2149,58 +2102,6 @@ function scr_initialize_custom() { "formation_options": ["tactical"], }] ]) - variable_struct_set(st,"assault_squad", [ - [roles.assault, { - "max": 9, - "min": 4, - "loadout": { - "required": { - "wep1": [wep1[100, 10], 7], - "wep2": [wep2[100, 10], 7], - }, - "option": { - "wep1": [ - [ - weapon_lists.melee_weapons, 2 - ], - ], - "wep2": [ - [ - ["Plasma Pistol", "Flamer"], 2 - ] - ] - } - } - }], - [roles.sergeant, { - "max": 1, - "min": 1, - "role": $"{roles.assault} {roles.sergeant}", - "loadout": { - "required": { - "wep1": ["", 0], - "wep2": ["", 0], - "gear": ["Combat Shield", 1] - }, - "option": { - "wep1": [ - [ - weapon_lists.pistols, 1 - ], - ], - "wep2": [ - [ - weapon_lists.melee_weapons, 1 - ], - ], - } - } - }], - ["type_data", { - "display_data": $"{roles.assault} {squad_name}", - "formation_options": ["assault"], - }] - ]) } @@ -2464,7 +2365,7 @@ function scr_initialize_custom() { k += 1; commands += 1; man_size += 1; - add_unit_to_company("marine", company, k, roles.techmarine, eROLE.Techmarine, "default", choose_weighted(weapon_weighted_lists.pistols)); + add_unit_to_company("marine", company, k, roles.techmarine, eROLE.Techmarine, "default", choose_weighted(WEAPON_LIST_WEIGHTED_RANGED_PISTOLS)); } // Librarians in the librarium @@ -2472,14 +2373,14 @@ function scr_initialize_custom() { k += 1; commands += 1; man_size += 1; - var _epi = add_unit_to_company("marine", company, k, roles.librarian, eROLE.Librarian, "default", choose_weighted(weapon_weighted_lists.pistols)); + var _epi = add_unit_to_company("marine", company, k, roles.librarian, eROLE.Librarian, "default", choose_weighted(WEAPON_LIST_WEIGHTED_RANGED_PISTOLS)); } // Codiciery repeat(codiciery) { k += 1; commands += 1; man_size += 1; - var _codi = add_unit_to_company("marine", company, k, "Codiciery", eROLE.Librarian, "default", choose_weighted(weapon_weighted_lists.pistols)); + var _codi = add_unit_to_company("marine", company, k, "Codiciery", eROLE.Librarian, "default", choose_weighted(WEAPON_LIST_WEIGHTED_RANGED_PISTOLS)); } // Lexicanum @@ -2487,7 +2388,7 @@ function scr_initialize_custom() { k += 1; commands += 1; man_size += 1; - var _lexi = add_unit_to_company("marine", company, k, "Lexicanum", eROLE.Librarian, "default", choose_weighted(weapon_weighted_lists.pistols)); + var _lexi = add_unit_to_company("marine", company, k, "Lexicanum", eROLE.Librarian, "default", choose_weighted(WEAPON_LIST_WEIGHTED_RANGED_PISTOLS)); } // Apothecaries in Apothecarion @@ -2495,7 +2396,7 @@ function scr_initialize_custom() { k += 1; commands += 1; man_size += 1; - add_unit_to_company("marine", company, k, roles.apothecary, eROLE.Apothecary,"Chainsword", choose_weighted(weapon_weighted_lists.pistols)); + add_unit_to_company("marine", company, k, roles.apothecary, eROLE.Apothecary,"Chainsword", choose_weighted(WEAPON_LIST_WEIGHTED_RANGED_PISTOLS)); } // Chaplains in Reclusium @@ -2503,7 +2404,7 @@ function scr_initialize_custom() { k += 1; commands += 1; man_size += 1; - add_unit_to_company("marine", company, k, roles.chaplain, eROLE.Chaplain,"default", choose_weighted(weapon_weighted_lists.pistols)); + add_unit_to_company("marine", company, k, roles.chaplain, eROLE.Chaplain,"default", choose_weighted(WEAPON_LIST_WEIGHTED_RANGED_PISTOLS)); } // Honour Guard @@ -2950,7 +2851,7 @@ function scr_initialize_custom() { var _mobi = mobi[defaults_slot, eROLE.Captain]; if (company = 8) and(obj_creation.equal_specialists = 0) then _mobi = "Jump Pack"; - add_unit_to_company("marine", company, k, roles.captain, eROLE.Captain, "default",choose_weighted(weapon_weighted_lists.pistols),"default",_mobi); + add_unit_to_company("marine", company, k, roles.captain, eROLE.Captain, "default",choose_weighted(WEAPON_LIST_WEIGHTED_RANGED_PISTOLS),"default",_mobi); repeat (chaplains_per_company){ k += 1; @@ -2961,7 +2862,7 @@ function scr_initialize_custom() { role[company][k] = roles.chaplain; wep1[company][k] = wep1[defaults_slot, eROLE.Chaplain]; name[company][k] = global.name_generator.generate_space_marine_name(); - wep2[company][k] = choose_weighted(weapon_weighted_lists.pistols); + wep2[company][k] = choose_weighted(WEAPON_LIST_WEIGHTED_RANGED_PISTOLS); gear[company][k] = gear[defaults_slot, eROLE.Chaplain]; if (company = 8) and(obj_creation.equal_specialists = 0) then mobi[company][k] = "Jump Pack"; if (mobi[defaults_slot, eROLE.Chaplain] != "") then mobi[company][k] = mobi[defaults_slot, eROLE.Chaplain]; @@ -2971,19 +2872,19 @@ function scr_initialize_custom() { repeat (apothecary_per_company){ k += 1; commands += 1; // Company Apothecary - add_unit_to_company("marine", company, k, roles.apothecary, eROLE.Apothecary, "default",choose_weighted(weapon_weighted_lists.pistols)); + add_unit_to_company("marine", company, k, roles.apothecary, eROLE.Apothecary, "default",choose_weighted(WEAPON_LIST_WEIGHTED_RANGED_PISTOLS)); } repeat(techmarines_per_company) { k += 1; // Company Techmarine commands += 1; - add_unit_to_company("marine", company, k, roles.techmarine, eROLE.Techmarine, "default",choose_weighted(weapon_weighted_lists.pistols)); + add_unit_to_company("marine", company, k, roles.techmarine, eROLE.Techmarine, "default",choose_weighted(WEAPON_LIST_WEIGHTED_RANGED_PISTOLS)); } if (!scr_has_disadv("Psyker Intolerant")) { k += 1; // Company Librarian commands += 1; - add_unit_to_company("marine", company, k, roles.librarian, eROLE.Librarian, "default",choose_weighted(weapon_weighted_lists.pistols)); + add_unit_to_company("marine", company, k, roles.librarian, eROLE.Librarian, "default",choose_weighted(WEAPON_LIST_WEIGHTED_RANGED_PISTOLS)); } k += 1; // Standard Bearer diff --git a/scripts/scr_squads/scr_squads.gml b/scripts/scr_squads/scr_squads.gml index 85a53e0807..b1e14cfc39 100644 --- a/scripts/scr_squads/scr_squads.gml +++ b/scripts/scr_squads/scr_squads.gml @@ -708,11 +708,7 @@ function game_start_squads(){ last_squad_count = array_length(obj_ini.squads); while (last_squad_count == array_length(obj_ini.squads)){ ///keep making tact squads for as long as there are enough tact marines last_squad_count = (array_length(obj_ini.squads) + 1); - if(last_squad_count%2 == 0){ - create_squad("scout_squad", company); - }else{ - create_squad("scout_sniper_squad", company); - } + create_squad("scout_squad", company); } with (obj_ini){ diff --git a/scripts/scr_weapon/scr_weapon.gml b/scripts/scr_weapon/scr_weapon.gml index 1955686800..e739e35f6b 100644 --- a/scripts/scr_weapon/scr_weapon.gml +++ b/scripts/scr_weapon/scr_weapon.gml @@ -1013,7 +1013,7 @@ global.weapons = { "master_crafted": 300, "artifact": 350 }, - "description": "The Needle Sniper Rifle is a deadly weapon that uses both directed lasers and crystallised neurotoxic needles to dispatch enemies, commonly favoured by assasins and Astartes Scouts .", + "description": "The Needle Sniper Rifle is a deadly weapon that uses both directed lasers and crystallised neurotoxic needles to dispatch enemies, commonly favoured by assasins and Deathwatch scouts.", "melee_hands": 1, "ranged_hands": 2, "ammo": 20, From d3540e97b945c814f002636bbf495acc4f5da421 Mon Sep 17 00:00:00 2001 From: Da Fist <144086663+KRdaMystic@users.noreply.github.com> Date: Sun, 6 Apr 2025 05:44:27 +0900 Subject: [PATCH 29/80] feat: Proper Shotgun addition (#687) Co-authored-by: EttyKitty <20323032+EttyKitty@users.noreply.github.com> --- ChapterMaster.yyp | 1 + objects/obj_shop/Create_0.gml | 5 + .../scr_initialize_custom.gml | 4 +- .../scr_ui_display_weapons.gml | 1 + scripts/scr_weapon/scr_weapon.gml | 5 +- .../ed54fad2-a39b-4f07-9737-5b8f916bee92.png | Bin 0 -> 2179 bytes .../11b4c573-f844-42a2-905a-d6dace60762b.png | Bin 0 -> 2179 bytes .../spr_weapon_shotgun/spr_weapon_shotgun.yy | 111 ++++++++++++++++++ 8 files changed, 122 insertions(+), 5 deletions(-) create mode 100644 sprites/spr_weapon_shotgun/ed54fad2-a39b-4f07-9737-5b8f916bee92.png create mode 100644 sprites/spr_weapon_shotgun/layers/ed54fad2-a39b-4f07-9737-5b8f916bee92/11b4c573-f844-42a2-905a-d6dace60762b.png create mode 100644 sprites/spr_weapon_shotgun/spr_weapon_shotgun.yy diff --git a/ChapterMaster.yyp b/ChapterMaster.yyp index 714beea7ae..259b43aeb0 100644 --- a/ChapterMaster.yyp +++ b/ChapterMaster.yyp @@ -1569,6 +1569,7 @@ {"id":{"name":"spr_weapon_relbla","path":"sprites/spr_weapon_relbla/spr_weapon_relbla.yy",},}, {"id":{"name":"spr_weapon_relic_blade","path":"sprites/spr_weapon_relic_blade/spr_weapon_relic_blade.yy",},}, {"id":{"name":"spr_weapon_sbolter","path":"sprites/spr_weapon_sbolter/spr_weapon_sbolter.yy",},}, + {"id":{"name":"spr_weapon_shotgun","path":"sprites/spr_weapon_shotgun/spr_weapon_shotgun.yy",},}, {"id":{"name":"spr_weapon_skill_icon","path":"sprites/spr_weapon_skill_icon/spr_weapon_skill_icon.yy",},}, {"id":{"name":"spr_weapon_sniper","path":"sprites/spr_weapon_sniper/spr_weapon_sniper.yy",},}, {"id":{"name":"spr_weapon_stalker","path":"sprites/spr_weapon_stalker/spr_weapon_stalker.yy",},}, diff --git a/objects/obj_shop/Create_0.gml b/objects/obj_shop/Create_0.gml index 5dd2193650..52a5152b97 100644 --- a/objects/obj_shop/Create_0.gml +++ b/objects/obj_shop/Create_0.gml @@ -338,6 +338,11 @@ if (shop = "equipment") { item_cost[i] = 80; forge_cost[i] = 230; i += 1; + item[i] = "Shotgun"; + forge_cost[i] = 100; + item_stocked[i] = scr_item_count(item[i]); + item_cost[i] = 10; + i += 1; x_mod[i] = 9; item[i] = "Combiflamer"; item_stocked[i] = scr_item_count(item[i]); diff --git a/scripts/scr_initialize_custom/scr_initialize_custom.gml b/scripts/scr_initialize_custom/scr_initialize_custom.gml index cc9962702e..ca68f6e30b 100644 --- a/scripts/scr_initialize_custom/scr_initialize_custom.gml +++ b/scripts/scr_initialize_custom/scr_initialize_custom.gml @@ -1900,12 +1900,12 @@ function scr_initialize_custom() { "loadout": { "required": { "wep1": ["", 0], - "wep2": ["Combat Knife", 9] + "wep2": ["Combat Knife", "max"] }, "option": { "wep1": [ [ - ["Bolter", "Sniper Rifle", "Bolter", "Sniper Rifle", "Stalker Pattern Bolter"], 9 + ["Bolter", "Bolter", "Shotgun", "Sniper Rifle", "Stalker Pattern Bolter"], 8 ], [ ["Missile Launcher", "Heavy Bolter"], 1 diff --git a/scripts/scr_ui_display_weapons/scr_ui_display_weapons.gml b/scripts/scr_ui_display_weapons/scr_ui_display_weapons.gml index 3b1e5362c1..79f7502168 100644 --- a/scripts/scr_ui_display_weapons/scr_ui_display_weapons.gml +++ b/scripts/scr_ui_display_weapons/scr_ui_display_weapons.gml @@ -82,6 +82,7 @@ function scr_ui_display_weapons(left_or_right, current_armor, equiped_weapon, cu "Grav-Gun":spr_weapon_grav_gun, "Missile Launcher":spr_weapon_missile, "Hand Flamer":spr_weapon_hand_flamer, + "Shotgun":spr_weapon_shotgun } var normal_ranged_names = struct_get_names(normal_ranged); for (var i=0;iDos03cZ(0Mau7U=4hg{s924n*hLE zFaTJW0Kk4Cy~)Q03@BgmaCHJUHt(NXE2#hgNkBWbM zp56^X=OOg-dwArLsoZ|^9LfR6Hf7w3`Zm?B$h;S`X>XUb@|u3f{lwJES~}QW;>%B5 zxlzlI9r|gA^hvZDNwaJWY_UpB;-{9AjQ#!wQvW|MH@$%+Wpl*F7-sm2hVNX76c(8v z=4;7ivZ~5T*O~UT(auhX6-tx>9~U>2lU_mdxXeOzG#N=D)?Ezak;%5yfHLthD(}}t zo7Fa*Rzjdaabn*smUO#y2gCSvUVi@ENR40NFAEE?K`l2B(8za^V&lu^c6P>ST4`y~ z{5p+Bi;GSpo^F%E#>j{Y(Y2a#`!%GW8ktPyEvJg&Q0R#tpS88Ia2&&dMRQwQ_{_{g z+O0#!oaxX?go~r2qtE{7NkbNs85J8F+nY=xkqUpw%G&y9Wlt7-tI^BJF;we!=h*Pg{NFAUd(@};}pynk&Kl}8aL4X*e2q30x$;jXT(d^YvV zYRlD#i1R1*oj5IfLeUil%N@>Jv=;4UZ9ng31(-5_q^h8ELPiUc|7#~ zW%c#hK>PS_iX<2eR^8a>SNH^6N_WNs2II(GJ916bjhFrX)qzGeptZMO20KI0(b3V+ zce2aV=MZWy-}~LdRfg~2aHZG7;7=Qq>l4MV$)cv3 z6OEx&qn}G?G~ZL@1^H&rDvsLH=LBQ~_Tt5;q}AH_^`^9qZw-B!T(jFRMD>P6FY-Nd zD0o)pu-ni*D*~PX`TJXUB!l}Q-*&E4k7Pj42J4Nxe*OG7{(_ia%5FuCJv^+=*HwAa z(sBYl=)G$)QSZ@Bumyvf6V7nCT-x2cb${ky^mYp~*^@AXq9sbiNqU-B=jWF8A7nN` z?cbNCYsWTlt06nJ-F6lG1w$l4rMLb%;*>A%dG|Lovm8PukOqa%6OaK@os4&#R5E+~ z@t0MbG??CZ_-yLpgj(MkBEnxyt3p>r_Ho<{Ze)auj_zMF3N3h?&DJbw^VF9JKf2gw zhSh6fyaK~+9@yhVyd%BCKE74Gke7`70V&|3?K6=L1*m3I$1Yj8>9}fyAM{X#F_o9x zh}nz;@L98SePQ*}aS0D~udJEg1$i|Nb=6NX%^WlR8v-y;@If1+n=dDtI)eF|-}85U z@MmfxJ?L1@L4v%#SW~kDCg5)Cs+(daGX5PbHO|2*7K}I968gr+GjiJ9iw!|W{$8g` zif9PMQ@|ZpS28PloW0nwRsFdqd_ov@Q>CsjNNo^TLEDsJ=9J}NKR?qxI?+hD+vce@ z0gqT;8pOrP!%Z&|P^fU#SbQU0y5X}m^t}bA?2>16_ol`e)W&r7hjg2yjj4Uj-OM@= zsXrma*XrV)-oLXfR)@Rd{C7q)cYc~Qx4CU3;A-r15+a0lQeTFq26kXi?0wy}VI@l? z{(-Lpi&$;DZ$XqTD^J){aWtV&SmKqivy76<Dos03cZ(0Mau7U=4hg{s924n*hLE zFaTJW0Kk4Cy~)Q03@BgmaCHJUHt(NXE2#hgNkBWbM zp56^X=OOg-dwArLsoZ|^9LfR6Hf7w3`Zm?B$h;S`X>XUb@|u3f{lwJES~}QW;>%B5 zxlzlI9r|gA^hvZDNwaJWY_UpB;-{9AjQ#!wQvW|MH@$%+Wpl*F7-sm2hVNX76c(8v z=4;7ivZ~5T*O~UT(auhX6-tx>9~U>2lU_mdxXeOzG#N=D)?Ezak;%5yfHLthD(}}t zo7Fa*Rzjdaabn*smUO#y2gCSvUVi@ENR40NFAEE?K`l2B(8za^V&lu^c6P>ST4`y~ z{5p+Bi;GSpo^F%E#>j{Y(Y2a#`!%GW8ktPyEvJg&Q0R#tpS88Ia2&&dMRQwQ_{_{g z+O0#!oaxX?go~r2qtE{7NkbNs85J8F+nY=xkqUpw%G&y9Wlt7-tI^BJF;we!=h*Pg{NFAUd(@};}pynk&Kl}8aL4X*e2q30x$;jXT(d^YvV zYRlD#i1R1*oj5IfLeUil%N@>Jv=;4UZ9ng31(-5_q^h8ELPiUc|7#~ zW%c#hK>PS_iX<2eR^8a>SNH^6N_WNs2II(GJ916bjhFrX)qzGeptZMO20KI0(b3V+ zce2aV=MZWy-}~LdRfg~2aHZG7;7=Qq>l4MV$)cv3 z6OEx&qn}G?G~ZL@1^H&rDvsLH=LBQ~_Tt5;q}AH_^`^9qZw-B!T(jFRMD>P6FY-Nd zD0o)pu-ni*D*~PX`TJXUB!l}Q-*&E4k7Pj42J4Nxe*OG7{(_ia%5FuCJv^+=*HwAa z(sBYl=)G$)QSZ@Bumyvf6V7nCT-x2cb${ky^mYp~*^@AXq9sbiNqU-B=jWF8A7nN` z?cbNCYsWTlt06nJ-F6lG1w$l4rMLb%;*>A%dG|Lovm8PukOqa%6OaK@os4&#R5E+~ z@t0MbG??CZ_-yLpgj(MkBEnxyt3p>r_Ho<{Ze)auj_zMF3N3h?&DJbw^VF9JKf2gw zhSh6fyaK~+9@yhVyd%BCKE74Gke7`70V&|3?K6=L1*m3I$1Yj8>9}fyAM{X#F_o9x zh}nz;@L98SePQ*}aS0D~udJEg1$i|Nb=6NX%^WlR8v-y;@If1+n=dDtI)eF|-}85U z@MmfxJ?L1@L4v%#SW~kDCg5)Cs+(daGX5PbHO|2*7K}I968gr+GjiJ9iw!|W{$8g` zif9PMQ@|ZpS28PloW0nwRsFdqd_ov@Q>CsjNNo^TLEDsJ=9J}NKR?qxI?+hD+vce@ z0gqT;8pOrP!%Z&|P^fU#SbQU0y5X}m^t}bA?2>16_ol`e)W&r7hjg2yjj4Uj-OM@= zsXrma*XrV)-oLXfR)@Rd{C7q)cYc~Qx4CU3;A-r15+a0lQeTFq26kXi?0wy}VI@l? z{(-Lpi&$;DZ$XqTD^J){aWtV&SmKqivy76<":"", + "Keyframes":[], + "resourceType":"KeyframeStore", + "resourceVersion":"2.0", + }, + "eventStubScript":null, + "eventToFunction":{}, + "length":1.0, + "lockOrigin":false, + "moments":{ + "$KeyframeStore":"", + "Keyframes":[], + "resourceType":"KeyframeStore", + "resourceVersion":"2.0", + }, + "name":"spr_weapon_shotgun", + "playback":1, + "playbackSpeed":1.0, + "playbackSpeedType":1, + "resourceType":"GMSequence", + "resourceVersion":"2.0", + "seqHeight":231.0, + "seqWidth":167.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":"ed54fad2-a39b-4f07-9737-5b8f916bee92","path":"sprites/spr_weapon_shotgun/spr_weapon_shotgun.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"1f0fec53-317a-4842-bc53-a72fcbb31466","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":0, + "yorigin":0, + }, + "swatchColours":null, + "swfPrecision":2.525, + "textureGroupId":{ + "name":"Default", + "path":"texturegroups/Default", + }, + "type":0, + "VTile":false, + "width":167, +} \ No newline at end of file From d2cd100f74a9b38b446ae3509e12375c8de6118f Mon Sep 17 00:00:00 2001 From: Da Fist <144086663+KRdaMystic@users.noreply.github.com> Date: Sun, 6 Apr 2025 06:00:49 +0900 Subject: [PATCH 30/80] feat: Fully working Omnissian Axe and a combi-tool ability (#685) Co-authored-by: EttyKitty <20323032+EttyKitty@users.noreply.github.com> --- ChapterMaster.yyp | 1 + scripts/scr_after_combat/scr_after_combat.gml | 10 +- .../scr_initialize_custom.gml | 4 +- .../scr_ui_display_weapons.gml | 5 +- scripts/scr_weapon/scr_weapon.gml | 11 ++- .../cf403b7b-a831-4dd7-94fc-490b330d9a3b.png | Bin 0 -> 4575 bytes .../3f223d5d-3d0b-4c23-9457-1ae722299b06.png | Bin 0 -> 4575 bytes .../spr_weapon_omnissian_axe.yy | 92 ++++++++++++++++++ 8 files changed, 110 insertions(+), 13 deletions(-) create mode 100644 sprites/spr_weapon_omnissian_axe/cf403b7b-a831-4dd7-94fc-490b330d9a3b.png create mode 100644 sprites/spr_weapon_omnissian_axe/layers/cf403b7b-a831-4dd7-94fc-490b330d9a3b/3f223d5d-3d0b-4c23-9457-1ae722299b06.png create mode 100644 sprites/spr_weapon_omnissian_axe/spr_weapon_omnissian_axe.yy diff --git a/ChapterMaster.yyp b/ChapterMaster.yyp index 259b43aeb0..068d961c3f 100644 --- a/ChapterMaster.yyp +++ b/ChapterMaster.yyp @@ -1551,6 +1551,7 @@ {"id":{"name":"spr_weapon_melta","path":"sprites/spr_weapon_melta/spr_weapon_melta.yy",},}, {"id":{"name":"spr_weapon_missile","path":"sprites/spr_weapon_missile/spr_weapon_missile.yy",},}, {"id":{"name":"spr_weapon_mmelta","path":"sprites/spr_weapon_mmelta/spr_weapon_mmelta.yy",},}, + {"id":{"name":"spr_weapon_omnissian_axe","path":"sprites/spr_weapon_omnissian_axe/spr_weapon_omnissian_axe.yy",},}, {"id":{"name":"spr_weapon_plasc","path":"sprites/spr_weapon_plasc/spr_weapon_plasc.yy",},}, {"id":{"name":"spr_weapon_plasg","path":"sprites/spr_weapon_plasg/spr_weapon_plasg.yy",},}, {"id":{"name":"spr_weapon_plasma_cannon_term","path":"sprites/spr_weapon_plasma_cannon_term/spr_weapon_plasma_cannon_term.yy",},}, diff --git a/scripts/scr_after_combat/scr_after_combat.gml b/scripts/scr_after_combat/scr_after_combat.gml index eee6ab0bf3..7f556d1503 100644 --- a/scripts/scr_after_combat/scr_after_combat.gml +++ b/scripts/scr_after_combat/scr_after_combat.gml @@ -454,13 +454,9 @@ function after_battle_part1() { // Techmarines for saving vehicles; if (unit.IsSpecialist(SPECIALISTS_TECHS, true)) { skill_level = unit.technology / 10; - if (marine_mobi[i]=="Servo-arm") { - skill_level *= 1.5; - } else if (marine_mobi[i]=="Servo-harness") { - skill_level *= 2; - } - skill_level += random(unit.luck / 2); - obj_ncombat.vehicle_recovery_score += skill_level; + skill_level += random(unit.luck / 2); + skill_level += unit.gear_special_value("combi_tool"); + obj_ncombat.vehicle_recovery_score += round(skill_level); obj_ncombat.techmarines_alive++; } } diff --git a/scripts/scr_initialize_custom/scr_initialize_custom.gml b/scripts/scr_initialize_custom/scr_initialize_custom.gml index ca68f6e30b..e44ba1a458 100644 --- a/scripts/scr_initialize_custom/scr_initialize_custom.gml +++ b/scripts/scr_initialize_custom/scr_initialize_custom.gml @@ -1385,7 +1385,7 @@ function scr_initialize_custom() { load_default_gear(eROLE.Scout, "Scout", "Bolter", "Combat Knife", "Scout Armour", "", ""); load_default_gear(eROLE.Chaplain, "Chaplain", "Crozius Arcanum", "Bolt Pistol", "Power Armour", "", "Rosarius"); load_default_gear(eROLE.Apothecary, "Apothecary", "Chainsword", "Bolt Pistol", "Power Armour", "", "Narthecium"); - load_default_gear(eROLE.Techmarine, "Techmarine", "Power Axe", "Bolt Pistol", _hi_qual_armour, "Servo-arm", ""); + load_default_gear(eROLE.Techmarine, "Techmarine", "Omnissian Axe", "Bolt Pistol", _hi_qual_armour, "Servo-arm", ""); load_default_gear(eROLE.Librarian, "Librarian", "Force Staff", "Bolt Pistol", "Power Armour", "", "Psychic Hood"); load_default_gear(eROLE.Sergeant, "Sergeant", "Chainsword", "Bolt Pistol", "Power Armour", "", ""); load_default_gear(eROLE.VeteranSergeant, "Veteran Sergeant", "Chainsword", "Plasma Pistol", "Power Armour", "", ""); @@ -2307,7 +2307,7 @@ function scr_initialize_custom() { // Forge Master name[company, 2] = obj_creation.fmaster; - var _forge_master = add_unit_to_company("marine", company, 2, "Forge Master", eROLE.Techmarine, "Infernus Pistol", "Power Axe", "default", "Servo-harness", _hq_armour); + var _forge_master = add_unit_to_company("marine", company, 2, "Forge Master", eROLE.Techmarine, "Infernus Pistol", "Omnissian Axe", "default", "Servo-harness", _hq_armour); if (_forge_master.technology < 40) { _forge_master.technology = 40; } diff --git a/scripts/scr_ui_display_weapons/scr_ui_display_weapons.gml b/scripts/scr_ui_display_weapons/scr_ui_display_weapons.gml index 79f7502168..8b55e5a885 100644 --- a/scripts/scr_ui_display_weapons/scr_ui_display_weapons.gml +++ b/scripts/scr_ui_display_weapons/scr_ui_display_weapons.gml @@ -140,6 +140,7 @@ function scr_ui_display_weapons(left_or_right, current_armor, equiped_weapon, cu "Power Mace":spr_weapon_powmace, "Mace of Absolution":spr_weapon_mace_of_absolution, "Show Maul":spr_weapon_powmaul, + "Omnissian Axe":spr_weapon_omnissian_axe } var melee_weapons_names=struct_get_names(melee_weapons); var wep_ @@ -328,13 +329,13 @@ function scr_ui_display_weapons(left_or_right, current_armor, equiped_weapon, cu hand_variant[left_or_right] = 3; } - if (array_contains(["Sniper Rifle", "Needle Sniper Rifle", "Force Staff", "Power Sword", "Thunder Hammer", "Autocannon", "Combat Knife", "Power Spear", "Chainsword", "Force Sword"], equiped_weapon)) { + if (array_contains(["Sniper Rifle", "Needle Sniper Rifle", "Force Staff", "Power Sword", "Thunder Hammer", "Autocannon", "Combat Knife", "Power Spear", "Chainsword", "Force Sword", "Omnissian Axe"], equiped_weapon)) { hand_variant[left_or_right] = 2; hand_on_top[left_or_right] = true; } // New weapon draw method - if (array_contains(["Force Staff", "Mace of Absolution", "Power Mace", "Power Axe", "Power Sword", "Autocannon", "Combat Knife", "Power Spear", "Shock Maul", "Chainsword", "Chainaxe", "Force Sword", "Force Axe"], equiped_weapon)) { + if (array_contains(["Force Staff", "Mace of Absolution", "Power Mace", "Power Axe", "Power Sword", "Autocannon", "Combat Knife", "Power Spear", "Shock Maul", "Chainsword", "Chainaxe", "Force Sword", "Force Axe", "Omnissian Axe"], equiped_weapon)) { new_weapon_draw[left_or_right] = true; } diff --git a/scripts/scr_weapon/scr_weapon.gml b/scripts/scr_weapon/scr_weapon.gml index 39f97fee1d..d0882b4f82 100644 --- a/scripts/scr_weapon/scr_weapon.gml +++ b/scripts/scr_weapon/scr_weapon.gml @@ -284,6 +284,9 @@ global.weapons = { "spli": 5, "arp": 3, "tags": ["power", "axe", "savage", "boarding 3"], + "specials": { + "combi_tool": 1 + } }, "Executioner Power Axe": { "abbreviation": "ExPwrAxe", @@ -2743,7 +2746,6 @@ global.gear = { }, "Servo-arm": { "abbreviation": "SrvArm", - "special_properties": ["Repairs Vehicles"], "second_profiles": ["Servo-arm(M)"], "description": "A manipulator mechandendrite, also known as a Servo-arm. This artificial limb is a great aid to help trained Techmarines repair damaged vehicles on the battlefield, yet may be used in melee combat, thanks to its considerable crushing power and weight.", "damage_resistance_mod": { @@ -2753,10 +2755,12 @@ global.gear = { }, "melee_hands": -0.25, "ranged_hands": -0.25, + "specials": { + "combi_tool": 1 + } }, "Servo-harness": { "abbreviation": "SrvHrns", - "special_properties": ["Repairs Vehicles"], "second_profiles": ["Servo-arm(M)", "Servo-arm(M)", "Flamer", "Plasma Cutter"], "description": "A Servo-Harness is a special type of augmetic aid, often used by Chapter's Master of the Forge or his senior Techmarines. It consists of many blessed tools, two Servo-arms and a couple of deadly weapons. With it, one can make battlefield repairs on any vehicle, shore up defences, or even assist his battle-brothers in combat.", "damage_resistance_mod": { @@ -2766,6 +2770,9 @@ global.gear = { }, "melee_hands": -0.5, "ranged_hands": -0.5, + "specials": { + "combi_tool": 2 + } }, "Conversion Beamer Pack": { "abbreviation": "CnvBmr", diff --git a/sprites/spr_weapon_omnissian_axe/cf403b7b-a831-4dd7-94fc-490b330d9a3b.png b/sprites/spr_weapon_omnissian_axe/cf403b7b-a831-4dd7-94fc-490b330d9a3b.png new file mode 100644 index 0000000000000000000000000000000000000000..8dec0f8143d1f2b1a3a60fd6fe2328eff9506fcb GIT binary patch literal 4575 zcmd5=XHZjJw>}`DMnF)S6hWj2NC-hfZ=nR~y&FJ!i_)a`E~tnI(nKjD(gXx)0rDc6 zh=5dqycnv2Q92shcYN>6H*;t1_vg<2aZk?5o;iEg-m5(8+3TDPGZX#O%zVrM0Gvh} zpe(?#8kAK=dhkEWL@yp3F1Q<57z0407y!g40{|6#6#o?fLSX=~h5-QO0s!E~7I&Dd zf)n&^*Yr`q$)Deo?&=2s!2Su1(z3ceLm>tETUyUCZ2at|Oxv{`3s|mTkX#pKjTq^T z=@R8cq&XmG$M4XERM9PnT)3lAe;!uMxgGzCj&?IekBbv_cm^saCd%@dos+{Q;{xWk z4VJAj%+I!RedeI6U_UZwHo%A!8F+9cswhLEe5Ld#RpWwxs6o>IuP<*Xx-gbzQS*JD z`$y)_$7vSI%F0l-4`mt}+&L;z@4&f>W_nGP6C_eLfnaE5WAn7LQ)O&W=NV>bhlK}i zY<$}PYLROeN+h+eyF2FH>U?K78}8(|Gpy``&M)k-V}d5I`myBvkma~dfwRVGAA~d2 z%(;`iy1ToJkEQGV;$>C&?3sJTkvD((oU+8Vd};KzPh+9$_YLU8O-qf!RSA2PSq3(% z+>Jg4A!zt_g6;K~ltH05e%7>8B_$=&rEsGq#pALTC&`4_R~{^aQQzh0Xldw@w19YN z;&gXZ+p!Yi@9rpbYwHwVdC%T&AtL;&@=tihcDzhth!MXwToDMwo$*^$2BIA4gNs<@ z66_nNdmg-?)jx43>No85f`glBftZ+>_Am+`;7wBk_h1Gi1dBV4hCsizb1D}DW-czQ zog`KO+es==k5P_{iaNub(lRS$TMzvmtx%jRs+I2{kxBcA2x*(m#=z23Q|S$Ili$A8 z1A0NrXaLX?GL|QcTb7>Z!yR_@;u9NH!KwZliOeu5BD~n7n#-bWn87~3>E@!|cTy*} zuCDGzWH*phC}%GO`cRWAse`!%~icsgM8kM)ZUCwfIKWlHdJD4jp5Cs4k85!iw z1v&=@2LSrIo@y*paO|r#0lWNb9hHkS5hGtX;^FLB-Z?mG{Ok|VSBpFw^(Me_b7+Cq z*49+ai!%8MEN!o)sagv0k?g5oDq!Gz+I+8d1h1MP6ci*G*aVYjDSAFWl0W9&Jowgj zNt{vO<5JT#Qg4Jqt!)E6aQ57}^5@SbD%n4!S(=`%7e%MWN2&^fU;s2lIka?jA>YGP zwzjvGj+I!GS-rM)mV06jTFL^Z8-+dC)dlam6Y?bQiK1Dm_&zS>Z&#Pae)=KKk(4b>X=zm<%~lu)3N|> zveoLWH5Ie=6I>#1a(iu}RzgBT6SUoNSWYZN3*q&V|3i`D@P=J%Y!7)}z08!QNZB6& zgFQK?>5Ez1M1rRJ`uWiS;wHra(6#+h1&icQO*9DbnHXB!#7xyYPrnX0Uw<8!las@G zxJ8sL4i|FQZY#E_Jr~v~z``Xx;?Sor7(o}c_kA>RDXepJVghm@wAWc>FojdGp5p z2qy|Fa5rhmAA|KeJ3F7w8c6g;WXgMe1OSsV^*YMjV#xG1_m`@A9sT!08)TU!HwvRG;j*NA{h*b^M?`gx4$-l)D%ISwcE z2lP|xDR?rETmb;x_lZs)SCHIZ8A=-ahLYw=n(!R}ci33SlJyNH&qr@(zutan-;8N> z5GKN}IJL*e9P9~mW%UKNEl$=sdItu+B|Mb6UsiTEF_9L(vi;l4(XqB(m-9- zw?T&d@}W@vd3}BAQ;A=Dvq3k%Ps@Sj>Nl1KmOXxJnYg(#X1ZADRjTFeEC5n$we_lO z_fGEQQEl5=ObjfIWfAKf;pZnc7pQ1xX!vFGHu7&JdK7att>$_^4Nu~k3=|k$?CM7W zJL&u-rO@ZY*7%xOy4%YSZOv?K@;~WT$Iv`GG*Sv)F)}JuK~KQ8D5wZ^h~qn|}qGv6b6pA`Ow@UFOYrHhwEbAV0^ zeE-}GrW;G{hqSb|_K~q*(yEK6?|&asoCnz}b(SJ{Yufucxe{b7J_pZ)`DKK!SA>mRVdnN=p--kK22fa*3S2s>j=HJUMlO- z#fZVCKF8rs5VT}{j_`ZcfGWJPr zEeqHi0Q7@O^S2jI14&Y0$PyDB%>ybGET=5%S{w3u18%ZZ-lDBO>>HvdS=}S>`0)2T zB2fp%gNlp8T@4q^);p7}N8UdG3#8R@<%a#+@fu5WbMx}LtcsxDtnXJqTN5-NiNKzOK22fK|L&hCiJ zl|=qdq3EK~8Ln|hbv^8a;o(6r1YjvPV#(Sj_Bq1k_}`0nHE4k@mxi!}qT^)thAF=S z2%lszc+RJ>3eW;|Tl2U$jjMrk>F5VymC@?fL8lUcXmz2PnVF5R&+aZ{h?jzg7Fhx1 zZuAxV!uGl{KPwap1vCkHH;j$5!*(l=D;AcpYqDW}K0bYSc;&Ibw>CLGFbSA^`FV+*Gb7nG#$=aoZ)@vT029hSAB<0HD{`#0^zzYDW*vyU zbFICdU3zEuPfu#Vd#3(0%jH{d*s}((C&x#^`@g?84+DVTcaBOP}Chx6;li<)13)$GH=6<-I;UY)zb0el-N*8xupkk4mUM?j0Ytqp9O z7-(tm_CH-3xIyrIu|O;u{K~gxr1Z;E4a8lMv zSg}-fd}{jg({z%vWBHKb`fjeaMi;{8lc-EGK6H7Fx{+tEofiDOH(PIO!=eN8qCC%o zH#Zdi(gk;jb+;gG;KN0lV!BPSk4x{d8& z4Yq^1CHspCd23%flx63qr_=lUwT(dChYuglbQpRKm+FRwDx7*uQ^mN7D}P-~)daUF zQ3-$1X#nJf^g-#9Kz6s;FTa`3N$vuhQ&F^G56nae>9amrMV!pfQM8KH@T;zmL zNCtz=qa@isC}^tf@q6x4w2uD`S`dOq#qF;6RN?*2$Zoq<--luLFb@Xv&QJ)f^p~6y zxQ^sUF!f&4(6Km!aje_K3+ox%j*0_5UqY;Q`1-kX=L%z)^0c(m9^5KwBvH-u+IzEK zrPuV=-~ydVR^Z!1VQj>X5ZJ;i2K{aHJO4|_ry;>J+2<}r%r?5}5ZqlFY-?(2%=4w~ z`>p3+-Fq$r!eDf`u6AvG9Rz&KgqlQD2A>IV&!kjU$=|PFyd>BGPAnj^y-?ks3kF{! z!29`&7yaE)`x~=CIAI>>0!S&IO00aB?mL z-wlbjgNid{kwsnQibbVUA0!W8a~pX~IJofW|K()950`a&%)!;;!)?=KyembjPO>wj z=MK@^CWrIL&O0wTNXgIF7t{RN%*v{Q1a^YL92wqi6bhvBES?Wncu+%6~NrVhw?`hn=X4 zY$C&s8|IA$wVvI`EUy5S0H89$Min8<1`hbeypj(i3yl{TsVY$i;t-NP;?Drf0e{Mstf}8;kuS@6e-6W`cdfybRn7xX>IUA(Qmq6as>7_;^PAX9dpChZ>-Q#J_h4@d@w<4si{@ W{%0K&rsWH$1E6(HQ1#lF#D4+RD|#9L literal 0 HcmV?d00001 diff --git a/sprites/spr_weapon_omnissian_axe/layers/cf403b7b-a831-4dd7-94fc-490b330d9a3b/3f223d5d-3d0b-4c23-9457-1ae722299b06.png b/sprites/spr_weapon_omnissian_axe/layers/cf403b7b-a831-4dd7-94fc-490b330d9a3b/3f223d5d-3d0b-4c23-9457-1ae722299b06.png new file mode 100644 index 0000000000000000000000000000000000000000..8dec0f8143d1f2b1a3a60fd6fe2328eff9506fcb GIT binary patch literal 4575 zcmd5=XHZjJw>}`DMnF)S6hWj2NC-hfZ=nR~y&FJ!i_)a`E~tnI(nKjD(gXx)0rDc6 zh=5dqycnv2Q92shcYN>6H*;t1_vg<2aZk?5o;iEg-m5(8+3TDPGZX#O%zVrM0Gvh} zpe(?#8kAK=dhkEWL@yp3F1Q<57z0407y!g40{|6#6#o?fLSX=~h5-QO0s!E~7I&Dd zf)n&^*Yr`q$)Deo?&=2s!2Su1(z3ceLm>tETUyUCZ2at|Oxv{`3s|mTkX#pKjTq^T z=@R8cq&XmG$M4XERM9PnT)3lAe;!uMxgGzCj&?IekBbv_cm^saCd%@dos+{Q;{xWk z4VJAj%+I!RedeI6U_UZwHo%A!8F+9cswhLEe5Ld#RpWwxs6o>IuP<*Xx-gbzQS*JD z`$y)_$7vSI%F0l-4`mt}+&L;z@4&f>W_nGP6C_eLfnaE5WAn7LQ)O&W=NV>bhlK}i zY<$}PYLROeN+h+eyF2FH>U?K78}8(|Gpy``&M)k-V}d5I`myBvkma~dfwRVGAA~d2 z%(;`iy1ToJkEQGV;$>C&?3sJTkvD((oU+8Vd};KzPh+9$_YLU8O-qf!RSA2PSq3(% z+>Jg4A!zt_g6;K~ltH05e%7>8B_$=&rEsGq#pALTC&`4_R~{^aQQzh0Xldw@w19YN z;&gXZ+p!Yi@9rpbYwHwVdC%T&AtL;&@=tihcDzhth!MXwToDMwo$*^$2BIA4gNs<@ z66_nNdmg-?)jx43>No85f`glBftZ+>_Am+`;7wBk_h1Gi1dBV4hCsizb1D}DW-czQ zog`KO+es==k5P_{iaNub(lRS$TMzvmtx%jRs+I2{kxBcA2x*(m#=z23Q|S$Ili$A8 z1A0NrXaLX?GL|QcTb7>Z!yR_@;u9NH!KwZliOeu5BD~n7n#-bWn87~3>E@!|cTy*} zuCDGzWH*phC}%GO`cRWAse`!%~icsgM8kM)ZUCwfIKWlHdJD4jp5Cs4k85!iw z1v&=@2LSrIo@y*paO|r#0lWNb9hHkS5hGtX;^FLB-Z?mG{Ok|VSBpFw^(Me_b7+Cq z*49+ai!%8MEN!o)sagv0k?g5oDq!Gz+I+8d1h1MP6ci*G*aVYjDSAFWl0W9&Jowgj zNt{vO<5JT#Qg4Jqt!)E6aQ57}^5@SbD%n4!S(=`%7e%MWN2&^fU;s2lIka?jA>YGP zwzjvGj+I!GS-rM)mV06jTFL^Z8-+dC)dlam6Y?bQiK1Dm_&zS>Z&#Pae)=KKk(4b>X=zm<%~lu)3N|> zveoLWH5Ie=6I>#1a(iu}RzgBT6SUoNSWYZN3*q&V|3i`D@P=J%Y!7)}z08!QNZB6& zgFQK?>5Ez1M1rRJ`uWiS;wHra(6#+h1&icQO*9DbnHXB!#7xyYPrnX0Uw<8!las@G zxJ8sL4i|FQZY#E_Jr~v~z``Xx;?Sor7(o}c_kA>RDXepJVghm@wAWc>FojdGp5p z2qy|Fa5rhmAA|KeJ3F7w8c6g;WXgMe1OSsV^*YMjV#xG1_m`@A9sT!08)TU!HwvRG;j*NA{h*b^M?`gx4$-l)D%ISwcE z2lP|xDR?rETmb;x_lZs)SCHIZ8A=-ahLYw=n(!R}ci33SlJyNH&qr@(zutan-;8N> z5GKN}IJL*e9P9~mW%UKNEl$=sdItu+B|Mb6UsiTEF_9L(vi;l4(XqB(m-9- zw?T&d@}W@vd3}BAQ;A=Dvq3k%Ps@Sj>Nl1KmOXxJnYg(#X1ZADRjTFeEC5n$we_lO z_fGEQQEl5=ObjfIWfAKf;pZnc7pQ1xX!vFGHu7&JdK7att>$_^4Nu~k3=|k$?CM7W zJL&u-rO@ZY*7%xOy4%YSZOv?K@;~WT$Iv`GG*Sv)F)}JuK~KQ8D5wZ^h~qn|}qGv6b6pA`Ow@UFOYrHhwEbAV0^ zeE-}GrW;G{hqSb|_K~q*(yEK6?|&asoCnz}b(SJ{Yufucxe{b7J_pZ)`DKK!SA>mRVdnN=p--kK22fa*3S2s>j=HJUMlO- z#fZVCKF8rs5VT}{j_`ZcfGWJPr zEeqHi0Q7@O^S2jI14&Y0$PyDB%>ybGET=5%S{w3u18%ZZ-lDBO>>HvdS=}S>`0)2T zB2fp%gNlp8T@4q^);p7}N8UdG3#8R@<%a#+@fu5WbMx}LtcsxDtnXJqTN5-NiNKzOK22fK|L&hCiJ zl|=qdq3EK~8Ln|hbv^8a;o(6r1YjvPV#(Sj_Bq1k_}`0nHE4k@mxi!}qT^)thAF=S z2%lszc+RJ>3eW;|Tl2U$jjMrk>F5VymC@?fL8lUcXmz2PnVF5R&+aZ{h?jzg7Fhx1 zZuAxV!uGl{KPwap1vCkHH;j$5!*(l=D;AcpYqDW}K0bYSc;&Ibw>CLGFbSA^`FV+*Gb7nG#$=aoZ)@vT029hSAB<0HD{`#0^zzYDW*vyU zbFICdU3zEuPfu#Vd#3(0%jH{d*s}((C&x#^`@g?84+DVTcaBOP}Chx6;li<)13)$GH=6<-I;UY)zb0el-N*8xupkk4mUM?j0Ytqp9O z7-(tm_CH-3xIyrIu|O;u{K~gxr1Z;E4a8lMv zSg}-fd}{jg({z%vWBHKb`fjeaMi;{8lc-EGK6H7Fx{+tEofiDOH(PIO!=eN8qCC%o zH#Zdi(gk;jb+;gG;KN0lV!BPSk4x{d8& z4Yq^1CHspCd23%flx63qr_=lUwT(dChYuglbQpRKm+FRwDx7*uQ^mN7D}P-~)daUF zQ3-$1X#nJf^g-#9Kz6s;FTa`3N$vuhQ&F^G56nae>9amrMV!pfQM8KH@T;zmL zNCtz=qa@isC}^tf@q6x4w2uD`S`dOq#qF;6RN?*2$Zoq<--luLFb@Xv&QJ)f^p~6y zxQ^sUF!f&4(6Km!aje_K3+ox%j*0_5UqY;Q`1-kX=L%z)^0c(m9^5KwBvH-u+IzEK zrPuV=-~ydVR^Z!1VQj>X5ZJ;i2K{aHJO4|_ry;>J+2<}r%r?5}5ZqlFY-?(2%=4w~ z`>p3+-Fq$r!eDf`u6AvG9Rz&KgqlQD2A>IV&!kjU$=|PFyd>BGPAnj^y-?ks3kF{! z!29`&7yaE)`x~=CIAI>>0!S&IO00aB?mL z-wlbjgNid{kwsnQibbVUA0!W8a~pX~IJofW|K()950`a&%)!;;!)?=KyembjPO>wj z=MK@^CWrIL&O0wTNXgIF7t{RN%*v{Q1a^YL92wqi6bhvBES?Wncu+%6~NrVhw?`hn=X4 zY$C&s8|IA$wVvI`EUy5S0H89$Min8<1`hbeypj(i3yl{TsVY$i;t-NP;?Drf0e{Mstf}8;kuS@6e-6W`cdfybRn7xX>IUA(Qmq6as>7_;^PAX9dpChZ>-Q#J_h4@d@w<4si{@ W{%0K&rsWH$1E6(HQ1#lF#D4+RD|#9L literal 0 HcmV?d00001 diff --git a/sprites/spr_weapon_omnissian_axe/spr_weapon_omnissian_axe.yy b/sprites/spr_weapon_omnissian_axe/spr_weapon_omnissian_axe.yy new file mode 100644 index 0000000000..66bd248f42 --- /dev/null +++ b/sprites/spr_weapon_omnissian_axe/spr_weapon_omnissian_axe.yy @@ -0,0 +1,92 @@ +{ + "$GMSprite":"", + "%Name":"spr_weapon_omnissian_axe", + "bboxMode":0, + "bbox_bottom":222, + "bbox_left":33, + "bbox_right":82, + "bbox_top":63, + "collisionKind":1, + "collisionTolerance":0, + "DynamicTexturePage":false, + "edgeFiltering":false, + "For3D":false, + "frames":[ + {"$GMSpriteFrame":"","%Name":"cf403b7b-a831-4dd7-94fc-490b330d9a3b","name":"cf403b7b-a831-4dd7-94fc-490b330d9a3b","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, + ], + "gridX":0, + "gridY":0, + "height":231, + "HTile":false, + "layers":[ + {"$GMImageLayer":"","%Name":"3f223d5d-3d0b-4c23-9457-1ae722299b06","blendMode":0,"displayName":"default","isLocked":false,"name":"3f223d5d-3d0b-4c23-9457-1ae722299b06","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,}, + ], + "name":"spr_weapon_omnissian_axe", + "nineSlice":null, + "origin":0, + "parent":{ + "name":"melee", + "path":"folders/Sprites/Marine Viewer/weapons/melee.yy", + }, + "preMultiplyAlpha":false, + "resourceType":"GMSprite", + "resourceVersion":"2.0", + "sequence":{ + "$GMSequence":"v1", + "%Name":"spr_weapon_omnissian_axe", + "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_weapon_omnissian_axe", + "playback":1, + "playbackSpeed":1.0, + "playbackSpeedType":1, + "resourceType":"GMSequence", + "resourceVersion":"2.0", + "seqHeight":231.0, + "seqWidth":167.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":"cf403b7b-a831-4dd7-94fc-490b330d9a3b","path":"sprites/spr_weapon_omnissian_axe/spr_weapon_omnissian_axe.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"877d958c-0ba3-4cf7-b6c6-61d21827c596","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":0, + "yorigin":0, + }, + "swatchColours":null, + "swfPrecision":2.525, + "textureGroupId":{ + "name":"Default", + "path":"texturegroups/Default", + }, + "type":0, + "VTile":false, + "width":167, +} \ No newline at end of file From 068e9e5c3ea757ec72218b8d4f28e2182dbc04a9 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Mon, 7 Apr 2025 18:13:09 +0300 Subject: [PATCH 31/80] feat: Sternguard and Vanguard > Veteran; Loadout adjustments (#683) --- objects/obj_popup/Mouse_50.gml | 2 +- .../scr_company_order/scr_company_order.gml | 3 +- .../scr_initialize_custom.gml | 242 ++++++++---------- scripts/scr_squads/scr_squads.gml | 6 +- 4 files changed, 106 insertions(+), 147 deletions(-) diff --git a/objects/obj_popup/Mouse_50.gml b/objects/obj_popup/Mouse_50.gml index 1e24a2e80d..6e24631790 100644 --- a/objects/obj_popup/Mouse_50.gml +++ b/objects/obj_popup/Mouse_50.gml @@ -321,7 +321,7 @@ if (point_in_rectangle(mouse_x, mouse_y, xx+1465, yy+499,xx+1576,yy+518)){// Pro variable_struct_set(role_squad_equivilances,obj_ini.role[100][9],"devastator_squad"); variable_struct_set(role_squad_equivilances,obj_ini.role[100][10],"assault_squad"); variable_struct_set(role_squad_equivilances,obj_ini.role[100][12],"scout_squad"); - variable_struct_set(role_squad_equivilances,obj_ini.role[100][3],"sternguard_veteran_squad"); + variable_struct_set(role_squad_equivilances,obj_ini.role[100][3],"veteran_squad"); variable_struct_set(role_squad_equivilances,obj_ini.role[100][4],"terminator_squad"); for(i=0;i Date: Wed, 9 Apr 2025 06:46:16 +0300 Subject: [PATCH 32/80] Fix "max" (that I broke) and more Veteran loadouts --- .../scr_initialize_custom.gml | 130 +++++++++++++++--- 1 file changed, 109 insertions(+), 21 deletions(-) diff --git a/scripts/scr_initialize_custom/scr_initialize_custom.gml b/scripts/scr_initialize_custom/scr_initialize_custom.gml index 97392a810d..9e71e1404e 100644 --- a/scripts/scr_initialize_custom/scr_initialize_custom.gml +++ b/scripts/scr_initialize_custom/scr_initialize_custom.gml @@ -43,7 +43,7 @@ enum ePROGENITOR { #macro WEAPON_LIST_RANGED_HEAVY_LONG ["Heavy Bolter", "Heavy Bolter", "Heavy Bolter", "Heavy Bolter", "Missile Launcher", "Missile Launcher", "Missile Launcher", "Lascannon", "Lascannon", "Plasma Cannon", "Grav-Cannon"] #macro WEAPON_LIST_RANGED_HEAVY_ASSAULT ["Heavy Flamer", "Heavy Flamer", "Heavy Flamer", "Multi-Melta"] #macro WEAPON_LIST_RANGED_HEAVY array_concat(WEAPON_LIST_RANGED_HEAVY_LONG, WEAPON_LIST_RANGED_HEAVY_ASSAULT) - +#macro WEAPON_LIST_RANGED_HEAVY_VETERAN ["Heavy Bolter", "Heavy Bolter", "Missile Launcher", "Lascannon", "Lascannon", "Multi-Melta", "Plasma Cannon", "Grav-Cannon"] #macro WEAPON_LIST_RANGED_SPECIAL_LONG ["Plasma Gun", "Plasma Gun", "Plasma Gun", "Grav-Gun"] #macro WEAPON_LIST_RANGED_SPECIAL_ASSAULT ["Flamer", "Flamer", "Flamer", "Meltagun"] @@ -64,6 +64,8 @@ enum ePROGENITOR { #macro WEAPON_LIST_MELEE_BASIC ["Chainsword", "Chainsword", "Chainaxe"] #macro WEAPON_LIST_MELEE_1H ["Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Chainsword", "Power Sword", "Power Sword", "Power Sword", "Lightning Claw", "Lightning Claw", "Lightning Claw", "Power Fist", "Power Fist", "Thunder Hammer"] #macro WEAPON_LIST_MELEE_HEAVY ["Eviscerator", "Eviscerator", "Eviscerator", "Eviscerator", "Eviscerator", "Heavy Thunder Hammer"] +#macro WEAPON_LIST_MELEE_VETERAN ["Chainsword", "Chainsword", "Chainsword", "Power Sword", "Power Sword", "Power Sword", "Lightning Claw", "Lightning Claw", "Lightning Claw", "Power Fist", "Power Fist", "Thunder Hammer"] + #macro WEAPON_LIST_WEIGHTED_RANGED_PISTOLS [["Bolt Pistol", 4], ["Plasma Pistol", 2], ["Grav-Pistol", 1]] @@ -1545,7 +1547,7 @@ function scr_initialize_custom() { "loadout": { "required": { "wep1": ["", 0], - "wep2": ["Combat Knife", "max"], + "wep2": ["Combat Knife", max], }, "option": { "wep1": [ @@ -1680,7 +1682,7 @@ function scr_initialize_custom() { "loadout": { "required": { "wep1": ["", 0], - "wep2": ["Combat Knife", "max"], + "wep2": ["Combat Knife", max], }, "option": { "wep1": [ @@ -1698,7 +1700,7 @@ function scr_initialize_custom() { "loadout": { "required": { "wep1": ["", 0], - "wep2": ["Combat Knife", "max"], + "wep2": ["Combat Knife", max], }, "option": { "wep1": [ @@ -1888,7 +1890,7 @@ function scr_initialize_custom() { "loadout": { "required": { "wep1": ["", 0], - "wep2": ["Combat Knife", "max"] + "wep2": ["Combat Knife", max] }, "option": { "wep1": [ @@ -1991,9 +1993,9 @@ function scr_initialize_custom() { "min": 4, "loadout": { //tactical marine "required": { - "wep1": ["", "max"], - "wep2": ["Chainsword", "max"], - "mobi": ["Bike", "max"] + "wep1": ["", max], + "wep2": ["Chainsword", max], + "mobi": ["Bike", max] } }, "role": $"Biker" @@ -2003,8 +2005,8 @@ function scr_initialize_custom() { "min": 1, "loadout": { //sergeant "required": { - "wep1": ["", "max"], - "wep2": ["Chainsword", "max"], + "wep1": ["", max], + "wep2": ["Chainsword", max], "mobi": ["Bike", 1] } }, @@ -2026,18 +2028,18 @@ function scr_initialize_custom() { "loadout": { //tactical breacher marine "required": { "wep1":[wep1[100, 8], 7], - "wep2":["Boarding Shield", "max"], - "armour":["MK3 Iron Armour", "max"], - "gear":["Plasma Bomb", "max"], - "mobi":["", "max"] + "wep2":["Boarding Shield", max], + "armour":["MK3 Iron Armour", max], + "gear":["Plasma Bomb", max], + "mobi":["", max] }, "option": { "wep1": [ [ - ["Flamer", "Grav-Gun", "Meltagun", "Lascutter"], 2, + ["Flamer", "Flamer", "Flamer", "Grav-Gun", "Meltagun", "Lascutter"], 2, ], ] - } + } }, "role": $"Breacher" }], @@ -2046,15 +2048,15 @@ function scr_initialize_custom() { "min": 1, "loadout": { //sergeant "required": { - "wep2":["Boarding Shield", "max"], - "armour":["MK3 Iron Armour", "max"], - "mobi": ["", "max"], - "gear": ["Plasma Bomb", "max"] + "wep2":["Boarding Shield", max], + "armour":["MK3 Iron Armour", max], + "mobi": ["", max], + "gear": ["Plasma Bomb", max] }, "option": { "wep1": [ [ - ["Bolter", "Bolter", "Bolter", "Combiflamer"], 1 + WEAPON_LIST_RANGED_COMBI, 1 ] ], } @@ -2068,6 +2070,92 @@ function scr_initialize_custom() { ]) } + if (scr_has_adv("Assault Doctrine")) { + variable_struct_set(st, "veteran_squad", [ + [roles.veteran_sergeant, { + "max": 1, + "min": 1, + "role": $"{roles.veteran_sergeant}", + "loadout": { + "required": { + "wep1": ["", 0], + "wep2": ["", 0], + "mobi": ["Jump Pack", max], + "gear": ["Combat Shield", max] + }, + "option": { + "wep1": [ + [ + WEAPON_LIST_RANGED_PISTOLS, 1 + ], + ], + "wep2": [ + [ + WEAPON_LIST_MELEE_VETERAN, 1 + ], + ] + } + }, + }], + [roles.veteran, { + "max": 9, + "min": 4, + "role": $"{roles.veteran}", + "loadout": { + "required": { + "wep1": ["", 0], + "wep2": ["", 0], + "mobi": ["Jump Pack", max], + "gear": ["Combat Shield", max] + }, + "option": { + "wep1": [ + [ + WEAPON_LIST_RANGED_PISTOLS, 9 + ], + ], + "wep2": [ + [ + WEAPON_LIST_MELEE_VETERAN, 9 + ], + ] + } + }, + }, ], + ["type_data", { + "display_data": $"{roles.veteran} {squad_name}", + "formation_options": ["veteran", "assault", "devastator", "scout", "tactical"], + }] + ]) + } + + if (scr_has_adv("Devastator Doctrine")) { + st[$ "veteran_squad"][1] = + [roles.veteran, { + "max": 9, + "min": 4, + "role": $"{roles.veteran}", + "loadout": { + "required": { + "wep1": ["", 0], + "wep2": ["Combat Knife", max], + }, + "option": { + "wep1": [ + [ + WEAPON_LIST_RANGED_VETERAN, 5 + ], + [ + WEAPON_LIST_RANGED_HEAVY_VETERAN, 4, { + "mobi": "Heavy Weapons Pack", + } + ] + ], + } + }, + }, ] + } + var squad_names = struct_get_names(st); // show_debug_message($" {squad_names}"); From a8e8001f9b8e40148aa73091737f1ff54032ae02 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Wed, 9 Apr 2025 06:52:27 +0300 Subject: [PATCH 33/80] Enemy combat overhaul P1 --- objects/obj_enunit/Alarm_0.gml | 12 +- .../scr_array_functions.gml | 6 +- scripts/scr_clean/scr_clean.gml | 204 +++++++++---- scripts/scr_en_weapon/scr_en_weapon.gml | 125 ++++---- scripts/scr_flavor2/scr_flavor2.gml | 10 +- scripts/scr_shoot/scr_shoot.gml | 270 +++++------------- 6 files changed, 301 insertions(+), 326 deletions(-) diff --git a/objects/obj_enunit/Alarm_0.gml b/objects/obj_enunit/Alarm_0.gml index c1ade84f64..d1c8b30d03 100644 --- a/objects/obj_enunit/Alarm_0.gml +++ b/objects/obj_enunit/Alarm_0.gml @@ -46,16 +46,10 @@ if (!engaged){ // Shooting target_unit_index=0; if (range[i] >= dist) { // 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; - // if (wep[i]="Missile Launcher") or (wep[i]="Rokkit Launcha") or (wep[i]="Kannon") then _target_vehicles=true; - // if (wep[i]="Big Shoota") then _target_vehicles=false; - // if (wep[i]="Devourer") then _target_vehicles=false; - // if (wep[i]="Gauss Particle Cannon") or (wep[i]="Overcharged Gauss Cannon") or (wep[i]="Particle Whip") then _target_vehicles=true; + var _target_vehicles = apa[i] > 6 ? true : false; // AP weapons target vehicles // Weird alpha strike mechanic, that changes target unit index to CM; - if ((wep[i]="Power Fist") or (wep[i]="Bolter")) and (obj_ncombat.alpha_strike>0) and (wep_num[i]>5){ + if (obj_ncombat.alpha_strike>0) { obj_ncombat.alpha_strike-=0.5; var cm_present = false; @@ -211,7 +205,7 @@ if (!engaged){ // Shooting } } //TODO: The melee code was not refactored; -else if ((engaged || enemy.engaged) and target_block_is_valid( enemy,obj_pnunit)){// Melee +else if ((engaged || enemy.engaged) ) {// Melee engaged=1; var i=0,dist=999,no_ap=1; // dist=point_distance(x,y,enemy.x,enemy.y)/10; diff --git a/scripts/scr_array_functions/scr_array_functions.gml b/scripts/scr_array_functions/scr_array_functions.gml index fc173d2cc6..13ed5f7b61 100644 --- a/scripts/scr_array_functions/scr_array_functions.gml +++ b/scripts/scr_array_functions/scr_array_functions.gml @@ -1,5 +1,3 @@ - - function array_iter_length(choice_array, offset, length){ if (length == 0){ if (offset==0){ @@ -257,3 +255,7 @@ function is_basic_array(_array, _max_depth = 1, _current_depth = 1) { return true; } + +function array_empty(_array) { + return array_length(_array) == 0; +} diff --git a/scripts/scr_clean/scr_clean.gml b/scripts/scr_clean/scr_clean.gml index 78e64a7c29..a070eae29a 100644 --- a/scripts/scr_clean/scr_clean.gml +++ b/scripts/scr_clean/scr_clean.gml @@ -110,7 +110,7 @@ function check_dead_marines(unit_struct, unit_index) { return unit_lost; } -function scr_clean(target_object, target_is_infantry, hostile_shots, hostile_damage, hostile_weapon, hostile_range, hostile_splash) { +function scr_clean(target_object, weapon_data) { // Converts enemy scr_shoot damage into player marine or vehicle casualties. // // Parameters: @@ -120,7 +120,6 @@ function scr_clean(target_object, target_is_infantry, hostile_shots, hostile_dam // hostile_damage: The amount of damage per shot. This value is reduced by armor or damage resistance before being applied. // hostile_weapon: The name of the weapon used in the attack. Certain weapons have special effects that modify damage behavior. // hostile_range: The range of the weapon. This may influence damage or other combat mechanics. - // hostile_splash: The splash damage modifier. Indicates if the weapon affects multiple targets or has an area-of-effect component. try { with(target_object) { @@ -128,85 +127,174 @@ function scr_clean(target_object, target_is_infantry, hostile_shots, hostile_dam exit; } + var armour_pierce = weapon_data.armour_pierce; + var hostile_shots = weapon_data.shot_count; + var hostile_damage = weapon_data.damage; + var hostile_weapon = weapon_data.name; + var hostile_range = weapon_data.type; + var target_is_infantry = weapon_data.target_type; var vehicle_hits = 0; var man_hits = 0; var total_hits = hostile_shots; var unit_type = ""; + var valid_vehicles = []; + var valid_marines = []; - // ### Vehicle Damage Processing ### - if (!target_is_infantry && veh > 0) { - var you = -1; + for (var m = 0; m < array_length(unit_struct); m++) { + var unit = unit_struct[m]; + if (is_struct(unit) && unit.hp() > 0 && marine_dead[m] == 0) { + if (unit.IsSpecialist(SPECIALISTS_DREADNOUGHTS)) { + var _temp_struct = { + index: m, + type: "dread" + }; + array_push(valid_vehicles, _temp_struct); + } else { + array_push(valid_marines, m); + } + } + } + // ### Vehicle Damage Processing ### + if (!target_is_infantry && (veh + dreads > 0)) { // Find valid vehicle targets - var valid_vehicles = []; for (var v = 0; v < veh; v++) { if (veh_hp[v] > 0 && veh_dead[v] == 0) { - array_push(valid_vehicles, v); + var _temp_struct = { + index: v, + type: "veh" + }; + array_push(valid_vehicles, _temp_struct); } } + valid_vehicles = array_shuffle(valid_vehicles); // Apply damage for each hostile shot, until we run out of targets for (var shot = 0; shot < total_hits; shot++) { - if (array_length(valid_vehicles) == 0) { + if (array_empty(valid_vehicles)) { break; } // Select a random vehicle from the valid list - var random_index = array_random_index(valid_vehicles); - you = random_index; + var vehicle = array_random_element(valid_vehicles); + var vehicle_id = vehicle.index; + var type = vehicle.type; - // Apply damage - var _modified_damage = hostile_damage - veh_ac[you]; - if (_modified_damage < 0) { - _modified_damage = 0.25; - } - if (enemy == 13 && _modified_damage < 1) { - _modified_damage = 1; - } - veh_hp[you] -= _modified_damage; - unit_type = veh_type[you]; - vehicle_hits++; + if (type == "veh") { + unit_type = veh_type[vehicle_id]; + vehicle_hits++; - var units_lost = 0; - // Check if the vehicle is destroyed - if (veh_hp[you] <= 0 && veh_dead[you] == 0) { - veh_dead[you] = 1; - units_lost++; - obj_ncombat.player_forces -= 1; - - // Record loss - var existing_index = array_get_index(lost, veh_type[you]); - if (existing_index != -1) { - lost_num[existing_index] += 1; - } else { - array_push(lost, veh_type[you]); - array_push(lost_num, 1); + // Apply damage + var _min_damage = enemy == 13 ? 1 : 0.25; + var _random_damage_mod_min = 0.5; + var _dice_sides = 100; + var _random_damage_mod = _random_damage_mod_min + (roll_dice(1, _dice_sides, "low") / _dice_sides); + var _armour_points = veh_ac[vehicle_id] - armour_pierce; + var _modified_damage = max(_min_damage, (hostile_damage * _random_damage_mod) - _armour_points); + + veh_hp[vehicle_id] -= _modified_damage; + + var units_lost = 0; + // Check if the vehicle is destroyed + if (veh_hp[vehicle_id] <= 0 && veh_dead[vehicle_id] == 0) { + veh_dead[vehicle_id] = 1; + units_lost++; + obj_ncombat.player_forces -= 1; + + // Record loss + var existing_index = array_get_index(lost, veh_type[vehicle_id]); + if (existing_index != -1) { + lost_num[existing_index] += 1; + } else { + array_push(lost, veh_type[vehicle_id]); + array_push(lost_num, 1); + } + + // Remove dead vehicles from further hits + array_delete(valid_vehicles, vehicle_id, 1); } + // Flavor messages + scr_flavor2(units_lost, unit_type, hostile_range, hostile_weapon, vehicle_hits); + } else { + var marine = unit_struct[vehicle_id]; + unit_type = marine.role(); + vehicle_hits++; + + // Apply damage + var _min_damage = enemy == 13 ? 1 : 0.25; + var _random_damage_mod_min = 0.5; + var _dice_sides = 100; + var _random_damage_mod = _random_damage_mod_min + (roll_dice(1, _dice_sides, "low") / _dice_sides); + var _armour_points = marine_ac[vehicle_id] - armour_pierce; + var _modified_damage = max(_min_damage, (hostile_damage * _random_damage_mod) - _armour_points); - // Remove dead vehicles from further hits - array_delete(valid_vehicles, you, 1); + if (_modified_damage > 0) { + var damage_resistance = marine.damage_resistance() / 100; + if (marine_mshield[vehicle_id] > 0) { + damage_resistance += 0.1; + } + if (marine_fiery[vehicle_id] > 0) { + damage_resistance += 0.15; + } + if (marine_fshield[vehicle_id] > 0) { + damage_resistance += 0.08; + } + if (marine_quick[vehicle_id] > 0) { + damage_resistance += 0.2; + } // TODO: only if melee + if (marine_dome[vehicle_id] > 0) { + damage_resistance += 0.15; + } + if (marine_iron[vehicle_id] > 0) { + if (damage_resistance <= 0) { + marine.add_or_sub_health(20); + } else { + damage_resistance += marine_iron[vehicle_id] / 5; + } + } + _modified_damage = round(_modified_damage * (1 - damage_resistance)); + } + + if (_modified_damage < 0 && hostile_weapon == "Fleshborer") { + _modified_damage = 1.5; + } + + /* if (hostile_weapon == "Web Spinner") { + var webr = floor(random(100)) + 1; + var chunk = max(10, 62 - (marine_ac[vehicle_id] * 2)); + _modified_damage = (webr <= chunk) ? 5000 : 0; + } */ + + marine.add_or_sub_health(-_modified_damage); + + // Check if marine is dead + var units_lost = 0; + if (check_dead_marines(marine, vehicle_id)) { + // Remove dead infantry from further hits + array_delete(valid_vehicles, vehicle_id, 1); + units_lost++; + } + + // Flavor messages + scr_flavor2(units_lost, unit_type, hostile_range, hostile_weapon, vehicle_hits); + } + + if ((veh + dreads) <= 0) { + break; } - // Flavor messages - scr_flavor2(units_lost, unit_type, hostile_range, hostile_weapon, vehicle_hits, hostile_splash); } } // ### Marine + Dreadnought Processing ### - if (target_is_infantry && (men + dreads > 0)) { + if (target_is_infantry && (men > 0)) { man_hits = total_hits - vehicle_hits; // Find valid infantry targets - var valid_marines = []; - for (var m = 0; m < array_length(unit_struct); m++) { - var unit = unit_struct[m]; - if (is_struct(unit) && unit.hp() > 0 && marine_dead[m] == 0) { - array_push(valid_marines, m); - } - } + valid_marines = array_shuffle(valid_marines); // Apply damage for each shot for (var shot = 0; shot < man_hits; shot++) { - if (array_length(valid_marines) == 0) { + if (array_empty(valid_marines)) { break; // No valid targets left } @@ -218,15 +306,12 @@ function scr_clean(target_object, target_is_infantry, hostile_shots, hostile_dam var units_lost = 0; // Apply damage - var _shot_luck = roll_dice(1, 100, "low"); - var _modified_damage = 0; - if (_shot_luck <= 5) { - _modified_damage = hostile_damage - (2 * marine_ac[marine_index]); - } else if (_shot_luck > 95) { - _modified_damage = hostile_damage; - } else { - _modified_damage = hostile_damage - marine_ac[marine_index]; - } + var _min_damage = enemy == 13 ? 1 : 0.25; + var _random_damage_mod_min = 0.5; + var _dice_sides = 100; + var _random_damage_mod = _random_damage_mod_min + (roll_dice(1, _dice_sides, "low") / _dice_sides); + var _armour_points = marine_ac[marine_index] - armour_pierce; + var _modified_damage = max(_min_damage, (hostile_damage * _random_damage_mod) - _armour_points); if (_modified_damage > 0) { var damage_resistance = marine.damage_resistance() / 100; @@ -272,7 +357,10 @@ function scr_clean(target_object, target_is_infantry, hostile_shots, hostile_dam } // Flavor messages - scr_flavor2(units_lost, unit_type, hostile_range, hostile_weapon, man_hits, hostile_splash); + scr_flavor2(units_lost, unit_type, hostile_range, hostile_weapon, man_hits); + if (men <= 0) { + break; + } } } diff --git a/scripts/scr_en_weapon/scr_en_weapon.gml b/scripts/scr_en_weapon/scr_en_weapon.gml index dcab092600..9353be91a2 100644 --- a/scripts/scr_en_weapon/scr_en_weapon.gml +++ b/scripts/scr_en_weapon/scr_en_weapon.gml @@ -12,7 +12,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { // Determines combined damage for enemy battle blocks for a single weapon - var atta, arp, acr, rang, amm, spli, faith_bonus, i; + var atta, arp, acr, rang, amm, spli, i; i = 0; rang = 0; atta = 0; @@ -20,8 +20,9 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { arp = 0; acr = 0; amm = -1; - faith_bonus = 0; + // faith_bonus = 0; // var struct = gear_weapon_data("weapon",name); + if (string_count("elee", name) > 0) { var to; to = string_delete(name, 0, 5); @@ -383,101 +384,107 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { if (obj_ncombat.enemy = 7) { if (argument0 = "Choppa") { - atta = 100; - arp = 0; + atta = 12; + arp = 4; rang = 1; - spli = 3; + spli = 1; } if (argument0 = "Power Klaw") { - atta = 160; - arp = 1; + atta = 30; + arp = 20; rang = 1; - spli = 3; + spli = 1; } if (argument0 = "Slugga") { - atta = 80; + atta = 20; arp = 0; rang = 3.1; - amm = 4; + amm = 6; spli = 3; } if (argument0 = "Tankbusta Bomb") { - atta = 150; - arp = 1; + atta = 65; + arp = 16; rang = 1; amm = 1; spli = 1; } if (argument0 = "Big Shoota") { - atta = 120; + atta = 24; arp = 0; - rang = 6; - amm = 30; - spli = 5; + rang = 13; + amm = 6; + spli = 10; } if (argument0 = "Dakkagun") { - atta = 140; - arp = 0; + atta = 24; + arp = 4; rang = 8; - amm = 20; - spli = 10; + amm = 14; + spli = 7; } if (argument0 = "Deffgun") { - atta = 150; - arp = 1; - rang = 8; - amm = 20; - spli = 1; + atta = 30; + arp = 4; + rang = 10; + amm = 6; + spli = 8; } if (argument0 = "Snazzgun") { - atta = 200; - arp = 0; - rang = 5; - spli = 0; + atta = 30; + arp = 5; + rang = 11; + amm = 10; + spli = 2; } if (argument0 = "Grot Blasta") { - atta = 50; + atta = 20; arp = 0; - rang = 2; - amm = 6; + rang = 4; + amm = 5; + spli = 1; } if (argument0 = "Kannon") { - atta = 200; - arp = 1; - rang = 10.1; - amm = 5; - spli = 3; + atta = 54; + arp = 12; + rang = 20; + amm = 1; + spli = 5; } if (argument0 = "Shoota") { - atta = 80; + atta = 20; arp = 0; - rang = 5; + amm = 10; + rang = 7; + spli = 3; } if (argument0 = "Burna") { - atta = 140; - arp = 0; - rang = 2; - amm = 4; - spli = 3; + atta = 22; + arp = 4; + rang = 3; + amm = 6; + spli = 6; } if (argument0 = "Skorcha") { - atta = 200; - arp = 1; - rang = 2; + atta = 25; + arp = 6; + rang = 4; amm = 6; - spli = 3; + spli = 8; } if (argument0 = "Rokkit Launcha") { - atta = 125; - arp = 1; - rang = 15; + atta = 38; + arp = 6; + rang = 16; spli = 3; + amm = 1; } if (argument0 = "Krooz Missile") { - atta = 250; - arp = 1; - rang = 15; - spli = 3; + atta = 48; + arp = 8; + rang = 18; + spli = 4; + amm = 1; } } @@ -1037,8 +1044,8 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } } - if (faith_bonus = 1) then atta = atta * 2; - if (faith_bonus = 2) then atta = atta * 3; + // if (faith_bonus = 1) then atta = atta * 2; + // if (faith_bonus = 2) then atta = atta * 3; atta = round(atta * obj_ncombat.global_defense); arp = round(arp * obj_ncombat.global_defense); @@ -1057,7 +1064,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { repeat(30) { if (wep[b] = name) and(goody = 0) { att[b] += atta * man_number; - apa[b] += arp * man_number; + apa[b] = arp; range[b] = rang; wep_num[b] += man_number; if (obj_ncombat.started = 0) then ammo[b] = amm; @@ -1073,7 +1080,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { wep[first] = name; splash[first] = spli; att[first] += atta * man_number; - apa[first] += arp * man_number; + apa[first] = arp; range[first] = rang; wep_num[first] += man_number; if (obj_ncombat.started = 0) then ammo[first] = amm; diff --git a/scripts/scr_flavor2/scr_flavor2.gml b/scripts/scr_flavor2/scr_flavor2.gml index 6d44ba7b94..4d4d61eaed 100644 --- a/scripts/scr_flavor2/scr_flavor2.gml +++ b/scripts/scr_flavor2/scr_flavor2.gml @@ -1,4 +1,4 @@ -function scr_flavor2(lost_units_count, target_type, hostile_range, hostile_weapon, hostile_shots, hostile_splash) { +function scr_flavor2(lost_units_count, target_type, hostile_range, hostile_weapon, hostile_shots) { // Generates flavor based on the damage and casualties from scr_shoot, only for the opponent if (obj_ncombat.wall_destroyed = 1) then exit; @@ -8,26 +8,22 @@ function scr_flavor2(lost_units_count, target_type, hostile_range, hostile_weapo m2 = ""; m3 = ""; - var _hostile_range, _hostile_weapon, _hostile_shots; - _hostile_range = 0; + var _hostile_weapon, _hostile_shots; _hostile_weapon = ""; _hostile_shots = 0; if (target_type != "wall") { - _hostile_range = hostile_range; _hostile_weapon = hostile_weapon; _hostile_shots = hostile_shots; } else if (target_type = "wall") and(instance_exists(obj_nfort)) { var hehh; hehh = "the fortification"; - _hostile_range = 999; _hostile_weapon = obj_nfort.hostile_weapons; _hostile_shots = obj_nfort.hostile_shots; } if (_hostile_weapon = "Fleshborer") then _hostile_shots = _hostile_shots * 10; - if (hostile_splash = 1) then _hostile_shots = max(1, round(_hostile_shots / 3)); // show_message(string(hostile_weapon)+"|"+string(_hostile_weapon)+"#"+string(los)+"#"+string(los_num)); @@ -72,7 +68,7 @@ function scr_flavor2(lost_units_count, target_type, hostile_range, hostile_weapo if (_hostile_shots = 1) then m1 = "A Maulerfiend advances, wrenching and smashing its claws into " + string(target_type) + ". "; } - if (hostile_range > 1) { + if (hostile_range == "ranged") { if (_hostile_weapon = "Big Shoota") { m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "z roar and blast away at " + string(target_type) + ". "; flavor = 1; diff --git a/scripts/scr_shoot/scr_shoot.gml b/scripts/scr_shoot/scr_shoot.gml index b15e33c1b1..8652f8a033 100644 --- a/scripts/scr_shoot/scr_shoot.gml +++ b/scripts/scr_shoot/scr_shoot.gml @@ -1,3 +1,4 @@ +/// @mixin function scr_shoot(weapon_index_position, target_object, target_type, damage_data, melee_or_ranged) { try { // weapon_index_position: Weapon number @@ -7,203 +8,90 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat // melee_or_ranged: melee or ranged // This massive clusterfuck of a script uses the newly determined weapon and target data to attack and assign damage + for (var j = 1; j <= 100; j++) { obj_ncombat.dead_ene[j] = ""; obj_ncombat.dead_ene_n[j] = 0; } + obj_ncombat.dead_enemies = 0; - var hostile_type; - var hostile_damage; - var hostile_weapon; - var hostile_range; - var hostile_splash; - var aggregate_damage = att[weapon_index_position]; - var armour_pierce = apa[weapon_index_position]; if (obj_ncombat.wall_destroyed == 1) { exit; } + var _weapon_max_kills = splash[weapon_index_position]; + var _total_damage = att[weapon_index_position]; + var _weapon_ap = apa[weapon_index_position]; + var _weapon_name = wep[weapon_index_position]; + var _weapon_ammo = ammo[weapon_index_position]; + var _shooter = wep_owner[weapon_index_position]; + var _shooter_count = wep_num[weapon_index_position]; + var _shot_count = _shooter_count * _weapon_max_kills; + var _weapon_damage_type = damage_data; + var _weapon_damage_per_hit = _total_damage / _shooter_count; + + //* Enemy shooting if ((weapon_index_position >= 0) && instance_exists(target_object) && (owner == 2)) { - var stop, damage_type, doom; - var shots_fired = wep_num[weapon_index_position]; - if (shots_fired == 0 || ammo[weapon_index_position] == 0) { + if (_shooter_count == 0 || _weapon_ammo == 0) { exit; - } - doom = 0; - if ((shots_fired != 1) && (melee_or_ranged != "melee")) { - switch (obj_ncombat.enemy) { - case eFACTION.Ecclesiarchy: - doom = 0.3; - break; - case eFACTION.Eldar: - doom = 0.4; - break; - case eFACTION.Ork: - doom = 0.2; - break; - case eFACTION.Tau: - doom = 0.4; - break; - case eFACTION.Tyranids: - doom = 0.4; - break; - } - } - if (obj_ncombat.enemy == 11) { - aggregate_damage = round(aggregate_damage * 1.15); - armour_pierce = round(armour_pierce * 1.15); - } - if ((obj_ncombat.enemy == 10) && (obj_ncombat.threat == 7)) { - doom = 1; - } - - damage_type = ""; - stop = 0; - - if (ammo[weapon_index_position] > 0) { + } else if (_weapon_ammo > 0) { ammo[weapon_index_position] -= 1; } - if (damage_data == "medi") { - damage_type = "att"; - if (aggregate_damage < armour_pierce) { - damage_type = "arp"; - } - } else { - damage_type = damage_data; + if (_weapon_name == "Web Spinner") { + _weapon_damage_type = "status"; + } else if (_weapon_damage_type == "medi") { + _weapon_damage_type = (_total_damage < _weapon_ap) ? "arp" : "att"; } - if (wep[weapon_index_position] == "Web Spinner") { - damage_type = "status"; + + var _weapon_data = { + name: _weapon_name, + damage: _weapon_damage_per_hit, + armour_pierce: _weapon_ap, + shot_count: _shooter_count, + type: melee_or_ranged, + target_type: 0 } - var attack_count_mod = max(1, splash[weapon_index_position]); - - if ((damage_type == "status") && (stop == 0) && (shots_fired > 0)) { - var damage_per_weapon = 0, - hit_number = shots_fired; - if (melee_or_ranged != "wall") { - shots_fired *= attack_count_mod; - } - if ((hit_number > 0) && (melee_or_ranged != "wall") && instance_exists(target_object)) { - if (wep_owner[weapon_index_position] == "assorted") { - target_object.hostile_shooters = 999; - } else if (wep_owner[weapon_index_position] != "assorted") { - target_object.hostile_shooters = 1; - } - hostile_damage = 0; - hostile_weapon = wep[weapon_index_position]; - hostile_type = 1; - hostile_range = range[weapon_index_position]; - hostile_splash = attack_count_mod; - - scr_clean(target_object, hostile_type, hit_number, hostile_damage, hostile_weapon, hostile_range, hostile_splash); - } - } else if ((damage_type == "att") && (aggregate_damage > 0) && (stop == 0) && (shots_fired > 0)) { - var damage_per_weapon, hit_number; - - damage_per_weapon = aggregate_damage; - - if (melee_or_ranged == "melee") { - if (shots_fired > (target_object.men - target_object.dreads) * 2) { - doom = ((target_object.men - target_object.dreads) * 2) / shots_fired; - } - } - - hit_number = shots_fired; - - if ((doom != 0) && (shots_fired > 1)) { - damage_per_weapon = floor((doom * damage_per_weapon)); - hit_number = floor(hit_number * doom); - } - if (melee_or_ranged != "wall") { - shots_fired *= attack_count_mod; - } - - if ((hit_number > 0) && (melee_or_ranged != "wall") && instance_exists(target_object)) { - if (wep_owner[weapon_index_position] == "assorted") { - target_object.hostile_shooters = 999; - } - if (wep_owner[weapon_index_position] != "assorted") { - target_object.hostile_shooters = 1; - } - hostile_damage = damage_per_weapon / hit_number; - hostile_weapon = wep[weapon_index_position]; - hostile_type = 1; - hostile_range = range[weapon_index_position]; - hostile_splash = attack_count_mod; - if (hostile_splash > 1) { - hostile_damage += attack_count_mod * 3; - } - - scr_clean(target_object, hostile_type, hit_number, hostile_damage, hostile_weapon, hostile_range, hostile_splash); - } - } else if (((damage_type == "arp") || (damage_type == "dread")) && (armour_pierce > 0) && (stop == 0) && (shots_fired > 0)) { - var damage_per_weapon, hit_number; - damage_per_weapon = aggregate_damage; - if (aggregate_damage == 0) { - damage_per_weapon = shots_fired; - } - if (melee_or_ranged != "wall") { - shots_fired *= attack_count_mod; - } - if (melee_or_ranged == "melee") { - if (shots_fired > ((target_object.veh + target_object.dreads) * 5)) { - doom = ((target_object.veh + target_object.dreads) * 5) / shots_fired; - } - } - hit_number = shots_fired; - - if ((doom != 0) && (shots_fired > 1)) { - damage_per_weapon = floor((doom * damage_per_weapon)); - hit_number = floor(hit_number * doom); - } - - if (damage_per_weapon == 0) { - damage_per_weapon = shots_fired * doom; - } - - if (hit_number > 0 && instance_exists(target_object)) { - hostile_weapon = wep[weapon_index_position]; - hostile_range = range[weapon_index_position]; - hostile_splash = attack_count_mod; - hostile_damage = damage_per_weapon / hit_number; - if (hostile_splash > 1) { - hostile_damage += attack_count_mod * 3; - } + switch (_weapon_damage_type) { + case "status": + target_object.hostile_shooters = (_shooter == "assorted") ? 999 : 1; + _weapon_data.damage = 0; + _weapon_data.target_type = 1; + scr_clean(target_object, _weapon_data); + break; + case "att": + _weapon_data.target_type = 1; + case "arp": + case "dread": if (melee_or_ranged == "wall") { - var dest = 0; - - hostile_damage -= target_object.ac[1]; - hostile_damage = max(0, hostile_damage); - hostile_damage = round(hostile_damage) * hit_number; - target_object.hp[1] -= hostile_damage; - if (target_object.hp[1] <= 0) { - dest = 1; - } - obj_nfort.hostile_weapons = hostile_weapon; - obj_nfort.hostile_shots = hit_number; - obj_nfort.hostile_damage = hostile_damage; - - scr_flavor2(dest, "wall", hostile_range, hostile_weapon, hit_number, hostile_splash); + var _wall_weapon_damage = max(1, round(_weapon_damage_per_hit - target_object.ac[1])) * _shooter_count * max(1, _weapon_max_kills / 4); + target_object.hp[1] -= _wall_weapon_damage; + + obj_nfort.hostile_weapons = _weapon_name; + obj_nfort.hostile_shots = _shooter_count; + obj_nfort.hostile_weapon_damage = _wall_weapon_damage; + + scr_flavor2((target_object.hp[1] <= 0), "wall", melee_or_ranged, _weapon_name, _shooter_count); } else { - target_object.hostile_shooters = (wep_owner[weapon_index_position] == "assorted") ? 999 : 1; - hostile_type = 0; + target_object.hostile_shooters = (_shooter == "assorted") ? 999 : 1; - scr_clean(target_object, hostile_type, hit_number, hostile_damage, hostile_weapon, hostile_range, hostile_splash); + scr_clean(target_object, _weapon_data); } - } + break; } } + //* Player shooting if (instance_exists(target_object) && (owner == eFACTION.Player)) { - // show_debug_message("{0}, {1}, {2}, {3}, {4}", wep_num[weapon_index_position], wep[weapon_index_position], splash[weapon_index_position], range[weapon_index_position], att[weapon_index_position]) + // show_debug_message("{0}, {1}, {2}, {3}, {4}", _shooter_count, _weapon_name, _weapon_max_kills, _weapon_range, att[weapon_index_position]) var shots_fired = 0; var stop = 0; var damage_type = ""; if (weapon_index_position >= 0) { - shots_fired = wep_num[weapon_index_position]; + shots_fired = _shooter_count; } if (shots_fired == 0) { @@ -231,14 +119,14 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat } if (weapon_index_position >= 0) { - if (ammo[weapon_index_position] == 0) { + if (_weapon_ammo == 0) { stop = 1; } - if (ammo[weapon_index_position] > 0) { - ammo[weapon_index_position] -= 1; + if (_weapon_ammo > 0) { + _weapon_ammo -= 1; } } - if (wep[weapon_index_position] == "Missile Silo") { + if (_weapon_name == "Missile Silo") { obj_ncombat.player_silos -= min(obj_ncombat.player_silos, 30); } @@ -247,7 +135,7 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat } if ((damage_data == "highest") && (weapon_index_position >= 0)) { damage_type = "att"; - if ((aggregate_damage >= 100) && (armour_pierce > 0)) { + if ((_total_damage >= 100) && (_weapon_ap > 0)) { damage_type = "arp"; } } @@ -266,7 +154,7 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat var that_works = false; if (weapon_index_position >= 0) { - if ((aggregate_damage > 0) && (stop == 0)) { + if ((_total_damage > 0) && (stop == 0)) { that_works = true; } } @@ -283,8 +171,8 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat attack_count_mod = 0; if (weapon_index_position >= 0) { - damage_per_weapon = aggregate_damage / wep_num[weapon_index_position]; - ap = armour_pierce; + damage_per_weapon = _total_damage / _shooter_count; + ap = _weapon_ap; } // Average damage if (weapon_index_position < -40) { wii = ""; @@ -293,17 +181,17 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat if (weapon_index_position == -51) { wii = "Heavy Bolter Emplacement"; at = 160; - armour_pierce = 0; + _weapon_ap = 0; } if (weapon_index_position == -52) { wii = "Missile Launcher Emplacement"; at = 200; - armour_pierce = -1; + _weapon_ap = -1; } if (weapon_index_position == -53) { wii = "Missile Silo"; at = 250; - armour_pierce = 0; + _weapon_ap = 0; } } @@ -311,44 +199,44 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat // Calculate final armor value based on armor piercing (AP) rating against target type if (target_object.dudes_vehicle[target_type]) { - if (armour_pierce == 4) { + if (_weapon_ap == 4) { target_armour_value = 0; } - if (armour_pierce == 3) { + if (_weapon_ap == 3) { target_armour_value = target_armour_value * 2; } - if (armour_pierce == 2) { + if (_weapon_ap == 2) { target_armour_value = target_armour_value * 4; } - if (armour_pierce == 1) { + if (_weapon_ap == 1) { target_armour_value = target_armour_value * 6; } } else { - if (armour_pierce == 4) { + if (_weapon_ap == 4) { target_armour_value = 0; } - if (armour_pierce == 3) { + if (_weapon_ap == 3) { target_armour_value = target_armour_value * 1.5; } - if (armour_pierce == 2) { + if (_weapon_ap == 2) { target_armour_value = target_armour_value * 2; } - if (armour_pierce == 1) { + if (_weapon_ap == 1) { target_armour_value = target_armour_value * 3; } } - attack_count_mod = max(1, splash[weapon_index_position]); + attack_count_mod = max(1, _weapon_max_kills); - final_hit_damage_value = damage_per_weapon - (target_armour_value * attack_count_mod); //damage armour reduction + final_hit_weapon_damage_value = damage_per_weapon - (target_armour_value * attack_count_mod); //damage armour reduction - final_hit_damage_value *= target_object.dudes_dr[target_type]; //damage_resistance mod + final_hit_weapon_damage_value *= target_object.dudes_dr[target_type]; //damage_resistance mod - if (final_hit_damage_value <= 0) { - final_hit_damage_value = 0; + if (final_hit_weapon_damage_value <= 0) { + final_hit_weapon_damage_value = 0; } // Average after armour - c = shots_fired * final_hit_damage_value; // New damage + c = shots_fired * final_hit_weapon_damage_value; // New damage var casualties, onceh = 0, ponies = 0; From e6e99db838d9899ac6e2c790d50d47750865aa1d Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Wed, 9 Apr 2025 14:30:45 +0300 Subject: [PATCH 34/80] Enemy combat overhaul P2 --- objects/obj_enunit/Alarm_0.gml | 323 +++++++----------- scripts/scr_clean/scr_clean.gml | 121 +++---- scripts/scr_en_weapon/scr_en_weapon.gml | 8 +- scripts/scr_flavor2/scr_flavor2.gml | 36 +- .../scr_punit_combat_heplers.gml | 19 +- scripts/scr_shoot/scr_shoot.gml | 73 ++-- 6 files changed, 237 insertions(+), 343 deletions(-) diff --git a/objects/obj_enunit/Alarm_0.gml b/objects/obj_enunit/Alarm_0.gml index d1c8b30d03..f7d4244ce1 100644 --- a/objects/obj_enunit/Alarm_0.gml +++ b/objects/obj_enunit/Alarm_0.gml @@ -18,8 +18,6 @@ engaged = collision_point(x-10, y, obj_pnunit, 0, 1) || collision_point(x+10, y, if (!engaged){ // Shooting for (var i=0;i= dist) { // The weapon is in range; - var _target_vehicles = apa[i] > 6 ? true : false; // AP weapons target vehicles + if (range[i] >= dist) { + var _target_type = apa[i] > 8 ? "arp" : "att"; + var _weapon_type = "ranged"; + var _target_priority_queue = ds_priority_create(); - // Weird alpha strike mechanic, that changes target unit index to CM; - if (obj_ncombat.alpha_strike>0) { - obj_ncombat.alpha_strike-=0.5; - - var cm_present = false; - var cm_index = -1; - var cm_block = false; - with(obj_pnunit){ - for (var u=0;u 0) { + obj_ncombat.alpha_strike -= 0.5; + with (obj_pnunit) { + for (var u = 0; u < array_length(unit_struct); u++) { + if (marine_type[u] == "Chapter Master") { + enemy = id; + target_unit_index = u; } } } - if (cm_present){ - enemy=cm_block; - target_unit_index=cm_index; - } } - - - // AP weapons attacking vehicles and forts; - var _no_vehicles_present = false; - if (_target_vehicles) { - var _shot = false; - if (!instance_exists(obj_nfort)) or (flank) { - if (block_has_armour(enemy)) or (enemy.veh_type[1]=="Defenses"){ - scr_shoot(i,enemy,target_unit_index,"arp","ranged"); - // show_debug_message($"I'm shooting at a vehicle! {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}"); - continue; - } else if (instance_number(obj_pnunit)>1) and (obj_ncombat.enemy!=7) { - var x2=enemy.x; - repeat(instance_number(obj_pnunit)-1){ - x2 += flank == 0 ? -10 : 10; - var enemy2=instance_nearest(x2,y,obj_pnunit); - if (!target_block_is_valid(enemy2, obj_pnunit)) { - continue; - } - if (range[i] < get_block_distance(enemy2)) { - break; - } - if (block_has_armour(enemy2)) { - scr_shoot(i,enemy2,target_unit_index,"arp","ranged"); - // show_debug_message($"I'm shooting at a vehicle in another row! {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}"); - _shot = true; - break; - } - } - if (!_shot) { - _no_vehicles_present = true; - _target_vehicles = false; - } - } - } else { - enemy=instance_nearest(x,y,obj_nfort); - if (range[i] >= get_block_distance(enemy)) { - scr_shoot(i,enemy,1,"arp","wall"); - // show_debug_message($"I'm shooting at the fort! {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}"); - continue; - } + + // Scan potential targets + var _check_targets = []; + with (obj_pnunit) { + if (!target_block_is_valid(self, obj_pnunit)) { + continue; } + array_push(_check_targets, self.id); } - - // Non-AP weapons attacking normal units; - if ((!_target_vehicles) && ((!instance_exists(obj_nfort)) || flank)) { - var _shot = false; - if (enemy.men > 0) { - // There are marines in the first column; - scr_shoot(i, enemy, target_unit_index, "att", "ranged"); - // show_debug_message($"I'm shooting at a normal unit! {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}"); + var _fort_present = instance_exists(obj_nfort); + + for (var t = 0; t < array_length(_check_targets); t++) { + var enemy_block = _check_targets[t]; + + var _distance = get_block_distance(enemy_block); + if (_distance > range[i]) { continue; - } else if (instance_number(obj_pnunit) > 1) { - // There were no marines in the first column, looking behind; - var _column_size_value = enemy.column_size; - var x2 = enemy.x; - - repeat (instance_number(obj_pnunit) - 1) { - x2 += !flank ? 10 : -10; - var enemy2 = instance_nearest(x2, y, obj_pnunit); - if (!target_block_is_valid(enemy2, obj_pnunit)) { - // show_debug_message($"The block is invalid!"); - continue; - } - - if (range[i] < get_block_distance(enemy2)) { - // show_debug_message($"The range is bad!"); - break; - } - - var _back_column_size_value = enemy2.column_size; - if (_back_column_size_value < _column_size_value) { - // show_debug_message($"Protection value is too big!"); - continue; - } else { - // Calculate chance of shots passing through to back row - // Higher ratio of back column size to front column size increases pass-through chance - // Maximum chance capped at 40% to ensure some protection remains - var _pass_chance = ((_back_column_size_value / _column_size_value) - 1) * 100; - if (irandom_range(1, 100) < min(_pass_chance, 80)) { - // show_debug_message($"I failed the protection check!"); - continue; - } - } - scr_shoot(i, enemy2, target_unit_index, "att", "ranged"); - // show_debug_message($"I'm shooting at a normal unit in another row! {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}"); - _shot = true; - break; - } + } + + // Distance weight (closer = higher priority) + var _distance_priority = _distance * 10; + + // Column size influence (bigger columns = higher threat?) + var _size_priority = min(1, enemy_block.column_size / wep_num[i]) * 100; + + // Target type match bonus + var _type_priority = 0; + if (_target_type == "arp") { + _type_priority += block_type_size(enemy_block, "armour") / enemy_block.column_size; + } else if (_target_type == "att") { + _type_priority += block_type_size(enemy_block, "men") / enemy_block.column_size; + show_debug_message($"block_type_size: {block_type_size(enemy_block, "armour")}"); + show_debug_message($"column_size: {enemy_block.column_size}"); } - // We failed to find normal units to attack, attacking vehicles with a non-AP weapon; - //TODO: All of these code blocks should be functions instead; - if (!_shot && !_no_vehicles_present) { - if (!instance_exists(obj_nfort)) or (flank) { - if (block_has_armour(enemy)) or (enemy.veh_type[1]=="Defenses"){ - scr_shoot(i,enemy,target_unit_index,"att","ranged"); - // show_debug_message($"I'm shooting at a vehicle, because I can't find a normal unit! {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}"); - continue; - } else if (instance_number(obj_pnunit)>1) and (obj_ncombat.enemy!=7) { - var x2=enemy.x; - repeat(instance_number(obj_pnunit)-1){ - x2 += flank == 0 ? -10 : 10; - var enemy2=instance_nearest(x2,y,obj_pnunit); - if (!target_block_is_valid(enemy2, obj_pnunit)) { - continue; - } - if (range[i] < get_block_distance(enemy2)) { - break; - } - if (block_has_armour(enemy2)) { - scr_shoot(i,enemy2,target_unit_index,"att","ranged"); - // show_debug_message($"I'm shooting at a vehicle in another row, because I can't find a normal unit! {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}"); - break; - } - } - } - } else { - enemy=instance_nearest(x,y,obj_nfort); - if (range[i] >= get_block_distance(enemy)) { - scr_shoot(i,enemy,1,"att","wall"); - // show_debug_message($"I'm shooting at a fort, because I can't find a normal unit! {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}"); - continue; - } + var priority = 0; + priority += 100 * _type_priority; + priority += _size_priority; + priority -= _distance_priority; + + show_debug_message($"{wep[i]} priority {priority} _type_priority: {_type_priority} _size_priority: {_size_priority} _distance_priority: {_distance_priority}"); + ds_priority_add(_target_priority_queue, enemy_block, priority); + } + + // Add fort as fallback target + if (_fort_present && !flank) { + var fort = instance_nearest(x, y, obj_nfort); + if (fort != noone) { + var d = get_block_distance(fort); + if (d <= range[i]) { + var fort_priority = 9000; + ds_priority_add(_target_priority_queue, fort, fort_priority); } } } + + // Shoot highest-priority target + if (!ds_priority_empty(_target_priority_queue)) { + var best_target = ds_priority_delete_max(_target_priority_queue); + var is_fort = (best_target.object_index == obj_nfort); + var _shoot_type = is_fort ? "wall" : _weapon_type; + var unit_index = is_fort ? 1 : target_unit_index; + + scr_shoot(i, best_target, unit_index, _target_type, "ranged"); + } else { + log_error($"{wep[i]} didn't find a valid target! This shouldn't happen!"); + show_debug_message($"We didn't find a valid target! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}"); + } + + ds_priority_destroy(_target_priority_queue); } else { - // show_debug_message($"I can't shoot, my range is too small! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}"); + show_debug_message($"I can't shoot, my range is too small! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}"); continue; } - log_error($"{wep[i]} didn't find a valid target! This shouldn't happen!"); - // show_debug_message($"We didn't find a valid target! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}"); } } + //TODO: The melee code was not refactored; -else if ((engaged || enemy.engaged) ) {// Melee - engaged=1; - var i=0,dist=999,no_ap=1; - // dist=point_distance(x,y,enemy.x,enemy.y)/10; - if !(instance_exists(obj_pnunit))then exit; - for (var i=0;i0) then _armour_piercing=1;// Determines if it is _armour_piercing or not - if (_armour_piercing) and (instance_exists(obj_nfort)) and (!flank){// Huff and puff and blow the wall down - enemy=instance_nearest(x,y,obj_nfort); - scr_shoot(i,enemy,1,"arp","wall"); + + if ((range[i] >= 2) || (ammo[i]==0)) { + // show_debug_message($"A melee or no ammo weapon was found! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}; Ammo: {ammo[i]}"); + continue; + } + + if ((range[i]==0)) { + log_error($"{wep[i]} has broken range! This shouldn't happen! Range: {range[i]}; Ammo: {ammo[i]}; Owner: {wep_owner[i]}"); + // show_debug_message($"A broken weapon was found! i:{i}; Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}; Ammo: {ammo[i]}"); + continue; + } + + if (!target_block_is_valid(enemy,obj_pnunit)){ + exit; + } + + if (instance_exists(obj_nfort) && (!flank)) { + enemy = instance_nearest(x, y, obj_nfort); + scr_shoot(i, enemy, 1, "arp", "wall"); + continue; + } + + var _armour_piercing = apa[i] > 6 ? true : false; + if (_armour_piercing) { + // Check for vehicles + if (block_has_armour(enemy)) { + scr_shoot(i, enemy, 1, "arp", "melee"); continue; - } - if (_armour_piercing){// Check for vehicles - var g=0,good=0,enemy2; - - if (block_has_armour(enemy)){ - // good=scr_target(enemy,"veh");// First target has vehicles, blow it to hell - scr_shoot(i,enemy,1,"arp","melee"); - good = true; - } - if (!good) then _armour_piercing=0;// Fuck it, shoot at infantry } - - if (!_armour_piercing) {// Check for men - // show_message(string(wep[i])); - var enemy2,g=0,good=0; - if ((enemy.men)){ - // good=scr_target(enemy,"men");// First target has vehicles, blow it to hell - scr_shoot(i,enemy,1,"att","melee"); - } - else if (block_has_armour(enemy)){ - scr_shoot(i,enemy,1,"arp","melee");// Swing anyways, maybe they'll get lucky - } + _armour_piercing = false; + } + + if (!_armour_piercing) { + if (enemy.men > 0) { + scr_shoot(i, enemy, 1, "att", "melee"); + } else if (block_has_armour(enemy)) { + scr_shoot(i, enemy, 1, "arp", "melee"); } - } - } - - - // if (no_ap=30) and (enemy.men=0) and (flank=0){// Next turn? - - // } - - - } - instance_activate_object(obj_pnunit); //TODO: Everything bellow has to be scrapped and reworked; diff --git a/scripts/scr_clean/scr_clean.gml b/scripts/scr_clean/scr_clean.gml index a070eae29a..5134d6e168 100644 --- a/scripts/scr_clean/scr_clean.gml +++ b/scripts/scr_clean/scr_clean.gml @@ -115,7 +115,7 @@ function scr_clean(target_object, weapon_data) { // // Parameters: // target_object: The obj_pnunit instance taking casualties. Represents the player's rank being attacked. - // target_is_infantry: Boolean-like value (1 for infantry, 0 for vehicles). Determines whether to process as infantry/dreadnoughts or vehicles. + // target_type: Boolean-like value (1 for infantry, 0 for vehicles). Determines whether to process as infantry/dreadnoughts or vehicles. // hostile_shots: The number of shots fired at the target. Represents the total hits from the attacking unit. // hostile_damage: The amount of damage per shot. This value is reduced by armor or damage resistance before being applied. // hostile_weapon: The name of the weapon used in the attack. Certain weapons have special effects that modify damage behavior. @@ -131,15 +131,16 @@ function scr_clean(target_object, weapon_data) { var hostile_shots = weapon_data.shot_count; var hostile_damage = weapon_data.damage; var hostile_weapon = weapon_data.name; - var hostile_range = weapon_data.type; - var target_is_infantry = weapon_data.target_type; - var vehicle_hits = 0; - var man_hits = 0; - var total_hits = hostile_shots; + var hostile_range = weapon_data.attack_type; + var target_type = weapon_data.target_type; + var shooter_count = weapon_data.shooter_count; + var hits = 0; var unit_type = ""; var valid_vehicles = []; var valid_marines = []; + var units_lost = 0; + // Find valid infantry targets for (var m = 0; m < array_length(unit_struct); m++) { var unit = unit_struct[m]; if (is_struct(unit) && unit.hp() > 0 && marine_dead[m] == 0) { @@ -154,35 +155,41 @@ function scr_clean(target_object, weapon_data) { } } } - - // ### Vehicle Damage Processing ### - if (!target_is_infantry && (veh + dreads > 0)) { - // Find valid vehicle targets - for (var v = 0; v < veh; v++) { - if (veh_hp[v] > 0 && veh_dead[v] == 0) { - var _temp_struct = { - index: v, - type: "veh" - }; - array_push(valid_vehicles, _temp_struct); - } + valid_marines = array_shuffle(valid_marines); + + // Find valid vehicle targets + for (var v = 0; v < veh; v++) { + if (veh_hp[v] > 0 && veh_dead[v] == 0) { + var _temp_struct = { + index: v, + type: "veh" + }; + array_push(valid_vehicles, _temp_struct); } - valid_vehicles = array_shuffle(valid_vehicles); + } + valid_vehicles = array_shuffle(valid_vehicles); - // Apply damage for each hostile shot, until we run out of targets - for (var shot = 0; shot < total_hits; shot++) { - if (array_empty(valid_vehicles)) { - break; - } + if (target_type == "arp" && array_empty(valid_vehicles)) { + target_type = "att"; + } else if (target_type = "att" && array_empty(valid_marines)) { + target_type = "arp"; + } + + for (var shot = 0; shot < hostile_shots; shot++) { + // ### Vehicle Damage Processing ### + if (target_type == "arp" && !array_empty(valid_vehicles)) { + // Apply damage for each hostile shot, until we run out of targets + + hits++; // Select a random vehicle from the valid list - var vehicle = array_random_element(valid_vehicles); + var random_index = array_random_index(valid_vehicles); + var vehicle = valid_vehicles[random_index]; var vehicle_id = vehicle.index; var type = vehicle.type; if (type == "veh") { unit_type = veh_type[vehicle_id]; - vehicle_hits++; // Apply damage var _min_damage = enemy == 13 ? 1 : 0.25; @@ -194,7 +201,6 @@ function scr_clean(target_object, weapon_data) { veh_hp[vehicle_id] -= _modified_damage; - var units_lost = 0; // Check if the vehicle is destroyed if (veh_hp[vehicle_id] <= 0 && veh_dead[vehicle_id] == 0) { veh_dead[vehicle_id] = 1; @@ -213,12 +219,9 @@ function scr_clean(target_object, weapon_data) { // Remove dead vehicles from further hits array_delete(valid_vehicles, vehicle_id, 1); } - // Flavor messages - scr_flavor2(units_lost, unit_type, hostile_range, hostile_weapon, vehicle_hits); } else { var marine = unit_struct[vehicle_id]; unit_type = marine.role(); - vehicle_hits++; // Apply damage var _min_damage = enemy == 13 ? 1 : 0.25; @@ -268,42 +271,28 @@ function scr_clean(target_object, weapon_data) { marine.add_or_sub_health(-_modified_damage); // Check if marine is dead - var units_lost = 0; if (check_dead_marines(marine, vehicle_id)) { // Remove dead infantry from further hits - array_delete(valid_vehicles, vehicle_id, 1); + array_delete(valid_vehicles, random_index, 1); units_lost++; + if (array_empty(valid_vehicles)) { + target_type = "att"; + continue; + } } - - // Flavor messages - scr_flavor2(units_lost, unit_type, hostile_range, hostile_weapon, vehicle_hits); - } - - if ((veh + dreads) <= 0) { - break; } } - } - - // ### Marine + Dreadnought Processing ### - if (target_is_infantry && (men > 0)) { - man_hits = total_hits - vehicle_hits; - // Find valid infantry targets - valid_marines = array_shuffle(valid_marines); - - // Apply damage for each shot - for (var shot = 0; shot < man_hits; shot++) { - if (array_empty(valid_marines)) { - break; // No valid targets left - } + // ### Marine + Dreadnought Processing ### + if (target_type == "att" && !array_empty(valid_marines)) { + // Apply damage for each shot + hits++; // Select a random marine from the valid list var random_index = array_random_index(valid_marines); var marine_index = valid_marines[random_index]; var marine = unit_struct[marine_index]; unit_type = marine.role(); - var units_lost = 0; // Apply damage var _min_damage = enemy == 13 ? 1 : 0.25; @@ -352,24 +341,26 @@ function scr_clean(target_object, weapon_data) { // Check if marine is dead if (check_dead_marines(marine, marine_index)) { // Remove dead infantry from further hits - array_delete(valid_marines, marine_index, 1); + array_delete(valid_marines, random_index, 1); units_lost++; + if (array_empty(valid_marines)) { + target_type = "arp"; + continue; + } } + } - // Flavor messages - scr_flavor2(units_lost, unit_type, hostile_range, hostile_weapon, man_hits); - if (men <= 0) { - break; - } + // ### Cleanup ### + // If the target_object got wiped out, move it off-screen + if ((men + veh + dreads) <= 0) { + x = -5000; + instance_deactivate_object(id); + break; } } - // ### Cleanup ### - // If the target_object got wiped out, move it off-screen - if ((men + veh + dreads) <= 0) { - x = -5000; - instance_deactivate_object(id); - } + // Flavour battle-log message + scr_flavor2(units_lost, unit_type, hostile_range, hostile_weapon, shooter_count); } } catch (_exception) { handle_exception(_exception); diff --git a/scripts/scr_en_weapon/scr_en_weapon.gml b/scripts/scr_en_weapon/scr_en_weapon.gml index 9353be91a2..9f0fd02e3f 100644 --- a/scripts/scr_en_weapon/scr_en_weapon.gml +++ b/scripts/scr_en_weapon/scr_en_weapon.gml @@ -411,7 +411,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Big Shoota") { atta = 24; - arp = 0; + arp = 4; rang = 13; amm = 6; spli = 10; @@ -432,7 +432,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Snazzgun") { atta = 30; - arp = 5; + arp = 10; rang = 11; amm = 10; spli = 2; @@ -474,14 +474,14 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { } if (argument0 = "Rokkit Launcha") { atta = 38; - arp = 6; + arp = 12; rang = 16; spli = 3; amm = 1; } if (argument0 = "Krooz Missile") { atta = 48; - arp = 8; + arp = 16; rang = 18; spli = 4; amm = 1; diff --git a/scripts/scr_flavor2/scr_flavor2.gml b/scripts/scr_flavor2/scr_flavor2.gml index 4d4d61eaed..b66f472bd2 100644 --- a/scripts/scr_flavor2/scr_flavor2.gml +++ b/scripts/scr_flavor2/scr_flavor2.gml @@ -3,10 +3,10 @@ function scr_flavor2(lost_units_count, target_type, hostile_range, hostile_weapo if (obj_ncombat.wall_destroyed = 1) then exit; - var m1, m2, m3, mes; + var m1, m2, mes; + mes = "INVALID! lost_units_count:{lost_units_count} target_type:{target_type} hostile_range:{hostile_range} hostile_weapon:{hostile_weapon} hostile_shots:{hostile_shots}"; m1 = ""; m2 = ""; - m3 = ""; var _hostile_weapon, _hostile_shots; _hostile_weapon = ""; @@ -29,19 +29,6 @@ function scr_flavor2(lost_units_count, target_type, hostile_range, hostile_weapo var flavor = 0; - /* - if (lost_units_count="Venom Claws"){atta=200;arp=0;rang=1;spli=0;if (obj_ini.preomnor=1){atta=240;}} - if (lost_units_count="Web Spinner"){atta=40;arp=0;rang=2.1;spli=1;amm=1;} - if (lost_units_count="Warpsword"){atta=300;arp=200;rang=1;spli=1;} - if (lost_units_count="Iron Claw"){atta=300;arp=400;rang=1;spli=0;} - if (lost_units_count="Maulerfiend Claws"){atta=300;arp=300;rang=1;spli=1;} - - if (lost_units_count="Eldritch Fire"){atta=80;arp=40;rang=5.1;} - if (lost_units_count="Khorne Demon Melee"){atta=350;arp=400;rang=1;spli=1;} - if (lost_units_count="Demon Melee"){atta=250;arp=300;rang=1;spli=1;} - if (lost_units_count="Lash Whip"){atta=80;arp=0;rang=2;} - */ - if (_hostile_weapon = "Daemonette Melee") { flavor = 1; if (_hostile_shots > 1) then m1 = string(_hostile_shots) + " Daemonettes rake and claw at " + string(target_type) + ". "; @@ -91,8 +78,8 @@ function scr_flavor2(lost_units_count, target_type, hostile_range, hostile_weapo } if (_hostile_weapon = "Kannon") { flavor = 1; - if (_hostile_shots > 1) then m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "z belch out large caliber shells. "; - if (_hostile_shots = 1) then m1 = "A " + string(_hostile_weapon) + "z belches out a large caliber shell. "; + if (_hostile_shots > 1) then m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "z belch out large caliber shells at " + string(target_type) + ". "; + if (_hostile_shots = 1) then m1 = "A " + string(_hostile_weapon) + "z belches out a large caliber shell at " + string(target_type) + ". "; } if (_hostile_weapon = "Shoota") { flavor = 1; @@ -117,7 +104,7 @@ function scr_flavor2(lost_units_count, target_type, hostile_range, hostile_weapo ranz = choose(1, 2, 2, 3, 3); if (ranz = 1) then m1 = string(_hostile_shots) + " rokkitz shoot at " + string(target_type) + ", the explosions disrupting. "; if (ranz = 2) then m1 = string(_hostile_shots) + " rokkitz scream upward and then fall upon " + string(target_type) + ". "; - if (ranz = 3) then m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "z roar and fire their payloads. "; + if (ranz = 3) then m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "z roar and fire their payloads at " + string(target_type) + ". "; } if (_hostile_weapon = "Staff of Light Shooting") and(_hostile_shots = 1) { @@ -382,15 +369,8 @@ function scr_flavor2(lost_units_count, target_type, hostile_range, hostile_weapo if (lost_units_count = 1) then m2 += " has been incapacitated."; } - mes = m1 + m2 + m3; - // show_message(mes); - - if (string_length(mes) > 3) { - obj_ncombat.messages += 1; - obj_ncombat.message[obj_ncombat.messages] = mes; - obj_ncombat.message_sz[obj_ncombat.messages] = lost_units_count + (0.5 - (obj_ncombat.messages / 100)); - obj_ncombat.message_priority[obj_ncombat.messages] = 0; - obj_ncombat.alarm[3] = 2; - } + mes = m1 + m2; + add_battle_log_message(mes, lost_units_count); + display_battle_log_message(); } \ No newline at end of file diff --git a/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml b/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml index b205db3637..aabe127e1e 100644 --- a/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml +++ b/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml @@ -115,6 +115,23 @@ function block_has_armour(target) { } } +function block_type_size(target, type) { + try { + if (type == "men") { + return (target.men * 0.5) + target.medi; + } else if (type == "veh") { + return (target.veh * 2.5); + } else if (type == "dread") { + return (target.dreads * 2); + } else if (type == "armour") { + return (target.veh * 2.5) + (target.dreads * 2); + } + return 0; + } catch (_exception) { + handle_exception(_exception); + } +} + function get_leftmost(block_type = obj_pnunit, include_flanking = true) { try { var left_most = "none"; @@ -150,7 +167,7 @@ function get_leftmost(block_type = obj_pnunit, include_flanking = true) { function get_block_distance(block) { try { - return point_distance(x, y, block.x, block.y) / 10; + return round(point_distance(x, y, block.x, block.y) / 10); } catch (_exception) { handle_exception(_exception); } diff --git a/scripts/scr_shoot/scr_shoot.gml b/scripts/scr_shoot/scr_shoot.gml index 8652f8a033..1e2950deda 100644 --- a/scripts/scr_shoot/scr_shoot.gml +++ b/scripts/scr_shoot/scr_shoot.gml @@ -1,10 +1,10 @@ /// @mixin -function scr_shoot(weapon_index_position, target_object, target_type, damage_data, melee_or_ranged) { +function scr_shoot(weapon_index_position, target_object, target_index, target_type, melee_or_ranged) { try { // weapon_index_position: Weapon number // target_object: Target object - // target_type: Target dudes - // damage_data: "att" or "arp" or "highest" + // target_index: Target dudes + // target_type: "att" or "arp" or "highest" // melee_or_ranged: melee or ranged // This massive clusterfuck of a script uses the newly determined weapon and target data to attack and assign damage @@ -28,7 +28,7 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat var _shooter = wep_owner[weapon_index_position]; var _shooter_count = wep_num[weapon_index_position]; var _shot_count = _shooter_count * _weapon_max_kills; - var _weapon_damage_type = damage_data; + var _weapon_damage_type = target_type; var _weapon_damage_per_hit = _total_damage / _shooter_count; //* Enemy shooting @@ -42,27 +42,26 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat if (_weapon_name == "Web Spinner") { _weapon_damage_type = "status"; } else if (_weapon_damage_type == "medi") { - _weapon_damage_type = (_total_damage < _weapon_ap) ? "arp" : "att"; + _weapon_damage_type = _weapon_ap > 6 ? "arp" : "att"; } var _weapon_data = { name: _weapon_name, damage: _weapon_damage_per_hit, armour_pierce: _weapon_ap, - shot_count: _shooter_count, - type: melee_or_ranged, - target_type: 0 + shot_count: _shot_count, + shooter_count: _shooter_count, + attack_type: melee_or_ranged, + target_type: target_type } switch (_weapon_damage_type) { case "status": target_object.hostile_shooters = (_shooter == "assorted") ? 999 : 1; _weapon_data.damage = 0; - _weapon_data.target_type = 1; scr_clean(target_object, _weapon_data); break; case "att": - _weapon_data.target_type = 1; case "arp": case "dread": if (melee_or_ranged == "wall") { @@ -108,9 +107,9 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat } }*/ - while (target_type < array_length(target_object.dudes_hp)) { - if (target_object.dudes_hp[target_type] == 0) { - target_type++; + while (target_index < array_length(target_object.dudes_hp)) { + if (target_object.dudes_hp[target_index] == 0) { + target_index++; stop = 1; } else { stop = 0; @@ -130,16 +129,16 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat obj_ncombat.player_silos -= min(obj_ncombat.player_silos, 30); } - if (damage_data != "highest") { - damage_type = damage_data; + if (target_type != "highest") { + damage_type = target_type; } - if ((damage_data == "highest") && (weapon_index_position >= 0)) { + if ((target_type == "highest") && (weapon_index_position >= 0)) { damage_type = "att"; if ((_total_damage >= 100) && (_weapon_ap > 0)) { damage_type = "arp"; } } - if (damage_data == "highest") { + if (target_type == "highest") { if (weapon_index_position == -51 || weapon_index_position == -52 || weapon_index_position == -53) { damage_type = "att"; } @@ -195,10 +194,10 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat } } - target_armour_value = target_object.dudes_ac[target_type]; + target_armour_value = target_object.dudes_ac[target_index]; // Calculate final armor value based on armor piercing (AP) rating against target type - if (target_object.dudes_vehicle[target_type]) { + if (target_object.dudes_vehicle[target_index]) { if (_weapon_ap == 4) { target_armour_value = 0; } @@ -230,7 +229,7 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat final_hit_weapon_damage_value = damage_per_weapon - (target_armour_value * attack_count_mod); //damage armour reduction - final_hit_weapon_damage_value *= target_object.dudes_dr[target_type]; //damage_resistance mod + final_hit_weapon_damage_value *= target_object.dudes_dr[target_index]; //damage_resistance mod if (final_hit_weapon_damage_value <= 0) { final_hit_weapon_damage_value = 0; @@ -241,21 +240,21 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat var casualties, onceh = 0, ponies = 0; - casualties = min(floor(c / target_object.dudes_hp[target_type]), shots_fired * attack_count_mod); + casualties = min(floor(c / target_object.dudes_hp[target_index]), shots_fired * attack_count_mod); - ponies = target_object.dudes_num[target_type]; - if ((target_object.dudes_num[target_type] == 1) && ((target_object.dudes_hp[target_type] - c) <= 0)) { + ponies = target_object.dudes_num[target_index]; + if ((target_object.dudes_num[target_index] == 1) && ((target_object.dudes_hp[target_index] - c) <= 0)) { casualties = 1; } - if (target_object.dudes_num[target_type] - casualties < 0) { - overkill = casualties - target_object.dudes_num[target_type]; - damage_remaining = c - (overkill * target_object.dudes_hp[target_type]); + if (target_object.dudes_num[target_index] - casualties < 0) { + overkill = casualties - target_object.dudes_num[target_index]; + damage_remaining = c - (overkill * target_object.dudes_hp[target_index]); shots_remaining = round(damage_remaining / damage_per_weapon); } - if (target_object.dudes_num[target_type] - casualties < 0) { + if (target_object.dudes_num[target_index] - casualties < 0) { casualties = ponies; } if (casualties < 0) { @@ -272,7 +271,7 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat if ((obj_ncombat.dead_ene[iii] == "") && (openz == 0)) { openz = iii; } - if ((obj_ncombat.dead_ene[iii] == target_object.dudes[target_type]) && (found == 0)) { + if ((obj_ncombat.dead_ene[iii] == target_object.dudes[target_index]) && (found == 0)) { found = iii; obj_ncombat.dead_ene_n[obj_ncombat.dead_enemies] += casualties; } @@ -280,7 +279,7 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat } if (found == 0) { obj_ncombat.dead_enemies += 1; - obj_ncombat.dead_ene[openz] = string(target_object.dudes[target_type]); + obj_ncombat.dead_ene[openz] = string(target_object.dudes[target_index]); obj_ncombat.dead_ene_n[openz] = casualties; } } @@ -291,23 +290,23 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat if ((damage_remaining > 0) && (shots_remaining > 0)) { var godd; godd = 0; - k = target_type; + k = target_index; // Find similar target in this same group repeat(10) { k += 1; if (godd == 0) { - if ((target_object.dudes_num[k] > 0) && (target_object.dudes_vehicle[k] == target_object.dudes_vehicle[target_type])) { + if ((target_object.dudes_num[k] > 0) && (target_object.dudes_vehicle[k] == target_object.dudes_vehicle[target_index])) { godd = k; } } } - k = target_type; + k = target_index; if (godd == 0) { repeat(10) { k -= 1; if ((godd == 0) && (k >= 1)) { - if ((target_object.dudes_num[k] > 0) && (target_object.dudes_vehicle[k] == target_object.dudes_vehicle[target_type])) { + if ((target_object.dudes_num[k] > 0) && (target_object.dudes_vehicle[k] == target_object.dudes_vehicle[target_index])) { godd = k; } } @@ -428,14 +427,14 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat } } } // End repeat 10 - scr_flavor(weapon_index_position, target_object, target_type, shots_fired - wep_rnum[weapon_index_position], casualties); + scr_flavor(weapon_index_position, target_object, target_index, shots_fired - wep_rnum[weapon_index_position], casualties); - if ((target_object.dudes_num[target_type] == 1) && (c > 0)) { - target_object.dudes_hp[target_type] -= c; + if ((target_object.dudes_num[target_index] == 1) && (c > 0)) { + target_object.dudes_hp[target_index] -= c; } // Need special flavor here for just damaging if (casualties >= 1) { - target_object.dudes_num[target_type] -= casualties; + target_object.dudes_num[target_index] -= casualties; obj_ncombat.enemy_forces -= casualties; } } From b63d81a418f7ee91a683ce655e8ca468fc23773f Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Wed, 9 Apr 2025 18:27:32 +0300 Subject: [PATCH 35/80] Performance debug and faction accuracy --- objects/obj_enunit/Alarm_0.gml | 61 ++++++++++--------------- scripts/scr_clean/scr_clean.gml | 13 ++++++ scripts/scr_en_weapon/scr_en_weapon.gml | 8 ++-- scripts/scr_flavor2/scr_flavor2.gml | 3 +- scripts/scr_shoot/scr_shoot.gml | 21 ++++++++- 5 files changed, 64 insertions(+), 42 deletions(-) diff --git a/objects/obj_enunit/Alarm_0.gml b/objects/obj_enunit/Alarm_0.gml index f7d4244ce1..a4116bbc44 100644 --- a/objects/obj_enunit/Alarm_0.gml +++ b/objects/obj_enunit/Alarm_0.gml @@ -15,7 +15,7 @@ var enemy2 = enemy; //In melee check engaged = collision_point(x-10, y, obj_pnunit, 0, 1) || collision_point(x+10, y, obj_pnunit, 0, 1); // show_debug_message($"enemy is in melee {engaged}") - +var _t_start1 = get_timer(); if (!engaged){ // Shooting for (var i=0;i 6 ? true : false; - if (_armour_piercing) { - // Check for vehicles - if (block_has_armour(enemy)) { - scr_shoot(i, enemy, 1, "arp", "melee"); - continue; - } - _armour_piercing = false; - } - - if (!_armour_piercing) { - if (enemy.men > 0) { - scr_shoot(i, enemy, 1, "att", "melee"); - } else if (block_has_armour(enemy)) { - scr_shoot(i, enemy, 1, "arp", "melee"); - } - } + var _attack_type = apa[i] > 8 ? "arp" : "att"; + scr_shoot(i, enemy, 1, _attack_type, "melee"); } } diff --git a/scripts/scr_clean/scr_clean.gml b/scripts/scr_clean/scr_clean.gml index 5134d6e168..f8c17c30f3 100644 --- a/scripts/scr_clean/scr_clean.gml +++ b/scripts/scr_clean/scr_clean.gml @@ -127,6 +127,8 @@ function scr_clean(target_object, weapon_data) { exit; } + var _t_start = get_timer(); + var armour_pierce = weapon_data.armour_pierce; var hostile_shots = weapon_data.shot_count; var hostile_damage = weapon_data.damage; @@ -359,8 +361,19 @@ function scr_clean(target_object, weapon_data) { } } + var _t_end = get_timer(); + var _elapsed_ms = (_t_end - _t_start) / 1000; + show_debug_message($"⏱️ Clean Execution Time: {_elapsed_ms}ms"); + + show_debug_message($"Hits: {hits}"); + show_debug_message($"Kills: {units_lost}"); + // Flavour battle-log message + var _t_start = get_timer(); scr_flavor2(units_lost, unit_type, hostile_range, hostile_weapon, shooter_count); + var _t_end = get_timer(); + var _elapsed_ms = (_t_end - _t_start) / 1000; + show_debug_message($"⏱️ Flavour Execution Time: {_elapsed_ms}ms"); } } catch (_exception) { handle_exception(_exception); diff --git a/scripts/scr_en_weapon/scr_en_weapon.gml b/scripts/scr_en_weapon/scr_en_weapon.gml index 9f0fd02e3f..75fffb6ffd 100644 --- a/scripts/scr_en_weapon/scr_en_weapon.gml +++ b/scripts/scr_en_weapon/scr_en_weapon.gml @@ -438,11 +438,11 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { spli = 2; } if (argument0 = "Grot Blasta") { - atta = 20; + atta = 14; arp = 0; - rang = 4; - amm = 5; - spli = 1; + rang = 2; + amm = 4; + spli = 2; } if (argument0 = "Kannon") { atta = 54; diff --git a/scripts/scr_flavor2/scr_flavor2.gml b/scripts/scr_flavor2/scr_flavor2.gml index b66f472bd2..fbe2fdecf1 100644 --- a/scripts/scr_flavor2/scr_flavor2.gml +++ b/scripts/scr_flavor2/scr_flavor2.gml @@ -371,6 +371,7 @@ function scr_flavor2(lost_units_count, target_type, hostile_range, hostile_weapo mes = m1 + m2; - add_battle_log_message(mes, lost_units_count); + var _message_priority = lost_units_count <= 0 ? hostile_shots : lost_units_count; + add_battle_log_message(mes, _message_priority); display_battle_log_message(); } \ No newline at end of file diff --git a/scripts/scr_shoot/scr_shoot.gml b/scripts/scr_shoot/scr_shoot.gml index 1e2950deda..ee1f6d2562 100644 --- a/scripts/scr_shoot/scr_shoot.gml +++ b/scripts/scr_shoot/scr_shoot.gml @@ -27,7 +27,26 @@ function scr_shoot(weapon_index_position, target_object, target_index, target_ty var _weapon_ammo = ammo[weapon_index_position]; var _shooter = wep_owner[weapon_index_position]; var _shooter_count = wep_num[weapon_index_position]; - var _shot_count = _shooter_count * _weapon_max_kills; + + var _melee_accuracy_mod = 1; + var _ranged_accuracy_mod = 1; + switch (obj_ncombat.enemy) { + case eFACTION.Ork: + _melee_accuracy_mod = 0.7; + _ranged_accuracy_mod = 0.4; + break; + case eFACTION.Tau: + _melee_accuracy_mod = 0.5; + _ranged_accuracy_mod = 0.6; + break; + case eFACTION.Tyranids: + _melee_accuracy_mod = 0.6; + _ranged_accuracy_mod = 0.6; + break; + } + var _accuracy_mod = melee_or_ranged == "ranged" ? _ranged_accuracy_mod : _melee_accuracy_mod; + + var _shot_count = _shooter_count * _weapon_max_kills * _accuracy_mod; var _weapon_damage_type = target_type; var _weapon_damage_per_hit = _total_damage / _shooter_count; From f2658741e2941a7ad03a1954ee0d770517b67265 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Thu, 10 Apr 2025 17:02:12 +0300 Subject: [PATCH 36/80] More priority tinkering --- objects/obj_enunit/Alarm_0.gml | 141 +++++---------------------------- 1 file changed, 21 insertions(+), 120 deletions(-) diff --git a/objects/obj_enunit/Alarm_0.gml b/objects/obj_enunit/Alarm_0.gml index a4116bbc44..80dc78a20b 100644 --- a/objects/obj_enunit/Alarm_0.gml +++ b/objects/obj_enunit/Alarm_0.gml @@ -15,6 +15,7 @@ var enemy2 = enemy; //In melee check engaged = collision_point(x-10, y, obj_pnunit, 0, 1) || collision_point(x+10, y, obj_pnunit, 0, 1); // show_debug_message($"enemy is in melee {engaged}") + var _t_start1 = get_timer(); if (!engaged){ // Shooting for (var i=0;i= dist) { @@ -81,25 +82,30 @@ if (!engaged){ // Shooting } // Distance weight (closer = higher priority) - var _distance_priority = _distance * 20; + var _distance_bonus = (range[i] - _distance - 1) * 20; // Column size influence (bigger columns = higher threat?) - var _overkill_protection = wep_num[i] / enemy_block.column_size; + var _doomstack_malus = wep_num[i] / enemy_block.column_size; + + // Column size influence (bigger columns = higher threat?) + var _size_bonus = enemy_block.column_size / 10; // Target type match bonus - var _type_priority = 0; + var _type_bonus = 0; if (_target_type == "arp") { - _type_priority = 50 * (block_type_size(enemy_block, "armour") / enemy_block.column_size); + _type_bonus = 20 * (block_type_size(enemy_block, "armour") / enemy_block.column_size); } else if (_target_type == "att") { - _type_priority = 50 * (block_type_size(enemy_block, "men") / enemy_block.column_size); + _type_bonus = 20 * (block_type_size(enemy_block, "men") / enemy_block.column_size); } var priority = 0; - priority += _type_priority; - priority -= _overkill_protection; - priority -= _distance_priority; + priority += _type_bonus; + priority += _size_bonus; + priority -= _doomstack_malus; + priority += _distance_bonus; + priority *= random_range(0.5, 1.5); - show_debug_message($"Priority: {priority} Matching Type: +{_type_priority} Overkill Debuff: -{_overkill_protection} Distance Debuff: -{_distance_priority}"); + show_debug_message($"Priority: {priority}\n Type: +{_type_bonus}\n Size: +{_size_bonus}\n Doomstack: -{_doomstack_malus}\n Distance: +{_distance_bonus}\n"); ds_priority_add(_target_priority_queue, enemy_block, priority); } @@ -160,7 +166,10 @@ if (engaged) { // Melee } if (!target_block_is_valid(enemy,obj_pnunit)){ - exit; + enemy = flank == 0 ? get_rightmost() : get_leftmost(); + if (!target_block_is_valid(enemy,obj_pnunit)){ + exit; + } } if (instance_exists(obj_nfort) && (!flank)) { @@ -176,112 +185,4 @@ if (engaged) { // Melee instance_activate_object(obj_pnunit); -//TODO: Everything bellow has to be scrapped and reworked; -//! Commented out stuff bellow, until I understand why it exists; -/* __b__ = action_if_variable(image_index, -500, 0); -if (__b__) { - var leftest, charge = 0, - enemy2 = 0; - - with(obj_pnunit) { - if (x < -4000) { - instance_deactivate_object(id); - } - } - - if (flank == 0) { - move_unit_block("west"); - // instance_activate_object(obj_cursor); - } - if (flank == 1) { - enemy = instance_nearest(x, y, obj_pnunit); // Right most enemy - enemy2 = enemy; - // if (collision_point(x+10,y,obj_pnunit,0,1)) then engaged=1; - // if (!collision_point(x+10,y,obj_pnunit,0,1)) then engaged=0; - move_unit_block(); - - if (!position_empty(x + 10, y)) { - engaged = 1; - } // Quick smash - // instance_activate_object(obj_cursor); - } - -if (!collision_point(x+10,y,obj_pnunit,0,1)) and (!collision_point(x-10,y,obj_pnunit,0,1)) then engaged=0; -if (collision_point(x+10,y,obj_pnunit,0,1)) or (collision_point(x-10,y,obj_pnunit,0,1)) then engaged=1; - - - -var range_shooti; - - i=0; - - - repeat(30){i+=1; - - - - dist=floor(point_distance(enemy2.x,enemy2.y,x,y)/10); - - - - - - range_shoot=""; - - if (wep[i]!="") and (range[i]>=dist) 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"; - } - - - - - - - - if (wep[i]!="") and (range_shoot="ranged") and (range[i]>=dist){// 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; - - if (string_count("Gauss",wep[i])>0) then _armour_piercing=1; - - if (wep[i]="Missile Launcher") or (wep[i]="Rokkit Launcha") or (wep[i]="Kannon") then _armour_piercing=1; - if (wep[i]="Big Shoota") then _armour_piercing=0;if (wep[i]="Devourer") then _armour_piercing=0; - if (wep[i]="Gauss Particle Cannon") or (wep[i]="Overcharged Gauss Cannon") or (wep[i]="Particle Whip") then _armour_piercing=1; - - - if (instance_exists(enemy2)){ - if (enemy2.veh+enemy2.dreads>0) and (enemy2.men=0) and (apa[i]>10) then _armour_piercing=1; - - if (_armour_piercing=1) and (once_only=0){// Check for vehicles - var g,good;g=0;good=0; - - if (enemy.veh>0){ - // good=scr_target(enemy,"veh");// First target has vehicles, blow it to hell - scr_shoot(i,enemy2,good,"arp","ranged"); - } - if (good=0) and (instance_number(obj_pnunit)>1){// First target does not have vehicles, cycle through objects to find one that has vehicles - var x2;x2=enemy2.x; - repeat(instance_number(obj_enunit)-1){ - if (good=0){ - x2+=10;enemy2=instance_nearest(x2,y,obj_pnunit); - if (enemy2.veh+enemy2.dreads>0) and (good=0){ - good=scr_target(enemy2,"veh");// This target has vehicles, blow it to hell - scr_shoot(i,enemy2,good,"arp","ranged");once_only=1; - } - } - } - } - if (good=0) then _armour_piercing=0;// Fuck it, shoot at infantry - } - } - - } - - - -} - - instance_activate_object(obj_pnunit); -} */ +//! Here was some stuff that depended on image_index here, that got deleted, because I couldn't figure out why it exists; From b7a71d891c852f3fe1ae7e3a418c833dd37378da Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Thu, 10 Apr 2025 17:14:07 +0300 Subject: [PATCH 37/80] Vehicles are no longer made of paper --- objects/obj_ncombat/Alarm_0.gml | 1 - objects/obj_pnunit/Alarm_6.gml | 5 ++++- objects/obj_pnunit/Create_0.gml | 1 - scripts/scr_roster/scr_roster.gml | 22 ++++++++-------------- 4 files changed, 12 insertions(+), 17 deletions(-) diff --git a/objects/obj_ncombat/Alarm_0.gml b/objects/obj_ncombat/Alarm_0.gml index e9eb6c9766..46a47b771a 100644 --- a/objects/obj_ncombat/Alarm_0.gml +++ b/objects/obj_ncombat/Alarm_0.gml @@ -3088,7 +3088,6 @@ if (player_defenses + player_silos > 0) { u.veh_hp[i] = 1000; u.veh_ac[i] = 1000; u.veh_dead[i] = 0; - u.veh_hp_multiplier[i] = 1; } u.veh_wep1[1] = "Heavy Bolter Emplacement"; diff --git a/objects/obj_pnunit/Alarm_6.gml b/objects/obj_pnunit/Alarm_6.gml index e68c39ab8c..a41535ba16 100644 --- a/objects/obj_pnunit/Alarm_6.gml +++ b/objects/obj_pnunit/Alarm_6.gml @@ -46,7 +46,10 @@ for (var i=0;i Date: Thu, 10 Apr 2025 18:34:40 +0300 Subject: [PATCH 38/80] Enemy damage rolls now go from x0.005 to x2 --- scripts/scr_clean/scr_clean.gml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/scr_clean/scr_clean.gml b/scripts/scr_clean/scr_clean.gml index f8c17c30f3..2b69ee6019 100644 --- a/scripts/scr_clean/scr_clean.gml +++ b/scripts/scr_clean/scr_clean.gml @@ -298,9 +298,8 @@ function scr_clean(target_object, weapon_data) { // Apply damage var _min_damage = enemy == 13 ? 1 : 0.25; - var _random_damage_mod_min = 0.5; - var _dice_sides = 100; - var _random_damage_mod = _random_damage_mod_min + (roll_dice(1, _dice_sides, "low") / _dice_sides); + var _dice_sides = 200; + var _random_damage_mod = roll_dice(1, _dice_sides, "low") / _dice_sides; var _armour_points = marine_ac[marine_index] - armour_pierce; var _modified_damage = max(_min_damage, (hostile_damage * _random_damage_mod) - _armour_points); From 06c6adc18c3835bf884288b4f690849b83dfef2d Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Thu, 10 Apr 2025 18:57:13 +0300 Subject: [PATCH 39/80] Enemy vehicles rebalance --- objects/obj_enunit/Alarm_1.gml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/objects/obj_enunit/Alarm_1.gml b/objects/obj_enunit/Alarm_1.gml index 9774f9d4cb..468cc431b4 100644 --- a/objects/obj_enunit/Alarm_1.gml +++ b/objects/obj_enunit/Alarm_1.gml @@ -1035,9 +1035,8 @@ if __b__ { scr_en_weapon("Kannon", false, dudes_num[j], dudes[j], j); scr_en_weapon("Big Shoota", false, dudes_num[j] * 2, dudes[j], j); scr_en_weapon("Rokkit Launcha", false, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 200; - dudes_dr[j] = 0.5; + dudes_ac[j] = 80; + dudes_hp[j] = 800; veh += dudes_num[j]; dudes_vehicle[j] = 1; } @@ -1045,9 +1044,8 @@ if __b__ { scr_en_weapon("Power Klaw", false, dudes_num[j] * 2, dudes[j], j); scr_en_weapon("Big Shoota", false, dudes_num[j], dudes[j], j); scr_en_weapon("Rokkit Launcha", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 200; - dudes_dr[j] = 0.75; + dudes_ac[j] = 60; + dudes_hp[j] = 500; veh += dudes_num[j]; dudes_vehicle[j] = 1; } From a11e7c672014abcb9369156981b5fca1cdf5ab31 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Thu, 10 Apr 2025 18:57:38 +0300 Subject: [PATCH 40/80] Player armour rebalance --- scripts/scr_weapon/scr_weapon.gml | 419 +++++++++++++----------------- 1 file changed, 178 insertions(+), 241 deletions(-) diff --git a/scripts/scr_weapon/scr_weapon.gml b/scripts/scr_weapon/scr_weapon.gml index f0f33e27e0..de0f4f7046 100644 --- a/scripts/scr_weapon/scr_weapon.gml +++ b/scripts/scr_weapon/scr_weapon.gml @@ -2038,79 +2038,74 @@ global.gear = { "Power Armour": { "abbreviation": "PwrArm", "armour_value": { - "standard": 19, - "master_crafted": 25, - "artifact": 30 - }, - "ranged_mod": { - "standard": 0, - "master_crafted": 5, - "artifact": 10 + "standard": 17, + "master_crafted": 21, + "artifact": 25 }, "melee_mod": { - "standard": 0, - "master_crafted": 5, - "artifact": 10 + "standard": 5, + "master_crafted": 10, + "artifact": 15 + }, + "ranged_mod": { + "standard": 5, + "master_crafted": 10, + "artifact": 15 }, + "melee_hands": 1, + "ranged_hands": 1, "description": "A suit of Adeptus Astartes power armour. The Mark can no longer be determined- it appears to be a combination of several types.", "tags": ["power_armour"], }, "Artificer Armour": { "abbreviation": "Artfcr", "armour_value": { - "standard": 30, - "master_crafted": 30, // This is already a custom suit of armor shouldnt Master crafted be its base state? - "artifact": 30 + "standard": 24, + "master_crafted": 28, + "artifact": 32 }, "ranged_mod": { - "standard": 15, - "master_crafted": 20, - "artifact": 25 + "standard": 10, + "master_crafted": 15, + "artifact": 20 }, "melee_mod": { - "standard": 15, - "master_crafted": 20, - "artifact": 25 - }, - "hp_mod":{ - "standard": 15, - "master_crafted": 20, - "artifact": 25 - }, - "damage_resistance_mod": { - "standard": 15, - "master_crafted": 20, - "artifact": 25 + "standard": 10, + "master_crafted": 15, + "artifact": 20 }, + "melee_hands": 1, + "ranged_hands": 1, "description": "A custom suit of power armored created by master artificiers and decorated without compare, this ancient Power Armour is beyond priceless. This suit's history is ancient and its users many.", "tags": ["power_armour"], + "maintenance" : 0.15, }, "Terminator Armour": { "abbreviation": "Indmts", "armour_value": { - "standard": 30, - "master_crafted": 36, - "artifact": 40 + "standard": 28, + "master_crafted": 32, + "artifact": 36 }, - "ranged_mod": { - "standard": -10, - "master_crafted": -5, - "artifact": 0 + "damage_resistance_mod": { + "standard": 20, + "master_crafted": 25, + "artifact": 30 }, "melee_mod": { - "standard": 10, - "master_crafted": 15, - "artifact": 20 + "standard": 15, + "master_crafted": 20, + "artifact": 25 }, - "hp_mod":{ - "standard": 10, - "master_crafted": 15, - "artifact": 20 + "ranged_mod": { + "standard": 5, + "master_crafted": 10, + "artifact": 15 }, - "damage_resistance_mod": { - "standard": 0, - "master_crafted": 5, - "artifact": 10 + "hp_mod": { + "standard": 5, + "master_crafted": 10, + "artifact": 15 }, "melee_hands": 2, "ranged_hands": 2, @@ -2122,24 +2117,14 @@ global.gear = { "Dreadnought": { "abbreviation": "Drdnght", "armour_value": { - "standard": 40, - "master_crafted": 45, - "artifact": 50 - }, - "ranged_mod": { - "standard": -10, - "master_crafted": 0, - "artifact": 10 + "standard": 74, + "master_crafted": 78, + "artifact": 82 }, - "melee_mod": { - "standard": -10, - "master_crafted": 0, - "artifact": 10 - }, - "hp_mod":{ - "standard": 30, - "master_crafted": 35, - "artifact": 60 + "hp_mod": { + "standard": 60, + "master_crafted": 80, + "artifact": 100 }, "melee_hands": 8, "ranged_hands": 8, @@ -2150,21 +2135,26 @@ global.gear = { "Tartaros": { "abbreviation": "Tartrs", "armour_value": { - "standard": 30, - "master_crafted": 36, - "artifact": 40 + "standard": 28, + "master_crafted": 32, + "artifact": 36 }, - "ranged_mod": { - "standard": 10, - "master_crafted": 15, // Augmented - "artifact": 20 // Augmented + "damage_resistance_mod": { + "standard": 20, + "master_crafted": 25, + "artifact": 30 }, "melee_mod": { - "standard": 10, + "standard": 15, "master_crafted": 20, "artifact": 25 }, - "hp_mod":{ + "ranged_mod": { + "standard": 5, + "master_crafted": 10, + "artifact": 15 + }, + "hp_mod": { "standard": 5, "master_crafted": 10, "artifact": 15 @@ -2179,29 +2169,29 @@ global.gear = { "Cataphractii Pattern Terminator": { "abbreviation": "Catphr", "armour_value": { - "standard": 32, - "master_crafted": 38, - "artifact": 42 + "standard": 30, + "master_crafted": 34, + "artifact": 38 }, - "ranged_mod": { - "standard": -5, - "master_crafted": 0, - "artifact": 5 + "damage_resistance_mod": { + "standard": 30, + "master_crafted": 35, + "artifact": 40 }, - "melee_mod": { - "standard": -5, - "master_crafted": 0, - "artifact": 5 + "hp_mod": { + "standard": 5, + "master_crafted": 10, + "artifact": 15 }, - "hp_mod":{ - "standard": 10, - "master_crafted": 15, - "artifact": 20 + "melee_mod": { + "standard": 15, + "master_crafted": 20, + "artifact": 25 }, - "damage_resistance_mod": { - "standard": 10, - "master_crafted": 15, - "artifact": 20 + "ranged_mod": { + "standard": 5, + "master_crafted": 10, + "artifact": 15 }, "melee_hands": 2, "ranged_hands": 2, @@ -2213,59 +2203,41 @@ global.gear = { "Scout Armour": { "abbreviation": "SctArm", "armour_value": { - "standard": 11, - "master_crafted": 12, - "artifact": 14 + "standard": 12, + "master_crafted": 14, + "artifact": 16 }, - "ranged_mod": { + "damage_resistance_mod": { // Concealment "standard": 10, - "master_crafted": 15, // Augmented - "artifact": 20 // Augmented - }, - "melee_mod": { - "standard": 0, - "master_crafted": 5, // Augmented - "artifact": 10 // Augmented - }, - "hp_mod":{ - "standard": 0, - "master_crafted": 10, - "artifact": 0 - }, - "damage_resistance_mod": { - "standard": 0, - "master_crafted": 10, - "artifact": 0 + "master_crafted": 12, + "artifact": 14 }, "description": "A non-powered suit made up of carapace armour and ballistic nylon. Includes biohazard shielding, nutrient feed, and camouflage." }, "MK3 Iron Armour": { "abbreviation": "MK3", "armour_value": { - "standard": 22, - "master_crafted": 24, - "artifact": 28 - }, - "ranged_mod": { - "standard": -10, - "master_crafted": -5, - "artifact": 0 + "standard": 19, + "master_crafted": 23, + "artifact": 27 }, - "melee_mod": { + "hp_mod": { "standard": 10, - "master_crafted": 10, // Augmented - "artifact": 15 // Augmented + "master_crafted": 15, + "artifact": 20 }, - "hp_mod":{ + "melee_mod": { "standard": 10, "master_crafted": 15, "artifact": 20 }, - "damage_resistance_mod": { - "standard": 0, - "master_crafted": 5, - "artifact": 10 + "ranged_mod": { + "standard": -5, + "master_crafted": 0, + "artifact": 5 }, + "melee_hands": 1, + "ranged_hands": 1, "description": "An ancient set of Power Armor dating back to the early Great Crusade. The Mark III has heavier armor plating but is far heavier then its contemporaries.", "tags": ["power_armour"], "maintenance" : 0.1, @@ -2273,30 +2245,27 @@ global.gear = { "MK4 Maximus": { "abbreviation": "MK4", "armour_value": { - "standard": 15, - "master_crafted": 17, - "artifact": 21 + "standard": 16, + "master_crafted": 20, + "artifact": 24 }, - "ranged_mod": { - "standard": 10, - "master_crafted": 15, - "artifact": 20 + "hp_mod": { + "standard": 5, + "master_crafted": 10, + "artifact": 15 }, "melee_mod": { - "standard": 10, - "master_crafted": 15, // Augmented - "artifact": 20 // Augmented - }, - "hp_mod":{ - "standard": 0, - "master_crafted": 5, - "artifact": 10 + "standard": 5, + "master_crafted": 10, + "artifact": 15 }, - "damage_resistance_mod": { - "standard": -10, - "master_crafted": 0, - "artifact": 10 + "ranged_mod": { + "standard": 5, + "master_crafted": 10, + "artifact": 15 }, + "melee_hands": 1, + "ranged_hands": 1, "description": "Power Armor dating back to the end of the Great Crusade. It is considered the pinnacle of Power Armor by some Astartes. However, the components are no longer reproducible, the knowledge having been lost to time.", "tags": ["power_armour"], "maintenance" : 0.2, @@ -2304,30 +2273,27 @@ global.gear = { "MK5 Heresy": { "abbreviation": "MK5", "armour_value": { - "standard": 15, - "master_crafted": 17, - "artifact": 21 + "standard": 17, + "master_crafted": 21, + "artifact": 25 }, - "ranged_mod": { - "standard": -5, - "master_crafted": 0, - "artifact": 0 + "hp_mod": { + "standard": 5, + "master_crafted": 10, + "artifact": 15 }, "melee_mod": { - "standard": 20, - "master_crafted": 25, - "artifact": 30 + "standard": 5, + "master_crafted": 10, + "artifact": 15 }, - "hp_mod":{ + "ranged_mod": { "standard": 0, "master_crafted": 5, "artifact": 10 }, - "damage_resistance_mod": { - "standard": -5, - "master_crafted": 0, - "artifact": 5 - }, + "melee_hands": 1, + "ranged_hands": 1, "description": "A hastily assembled Power Armor that first started appearing during the Horus Heresy to act as a stopgap while new suits were produced and sent to loyalist legions. It excels in close combat but it has limited sensors for ranged combat.", "tags": ["power_armour"], "maintenance" : 0.05, @@ -2335,30 +2301,27 @@ global.gear = { "MK6 Corvus": { "abbreviation": "MK6", "armour_value": { - "standard": 15, - "master_crafted": 17, - "artifact": 21 + "standard": 17, + "master_crafted": 21, + "artifact": 25 }, - "ranged_mod": { - "standard": 10, - "master_crafted": 15, // Augmented - "artifact": 30 // Augmented + "hp_mod": { + "standard": 5, + "master_crafted": 10, + "artifact": 15 }, "melee_mod": { - "standard": 0, - "master_crafted": 5, // Augmented - "artifact": 10 // Augmented - }, - "hp_mod":{ - "standard": -5, - "master_crafted": 0, - "artifact": 5 + "standard": 5, + "master_crafted": 10, + "artifact": 15 }, - "damage_resistance_mod": { - "standard": 0, - "master_crafted": 5, - "artifact": 5 + "ranged_mod": { + "standard": 10, + "master_crafted": 15, + "artifact": 20 }, + "melee_hands": 1, + "ranged_hands": 1, "description": "A suit dating back to the Horus Heresy, first tested by the Raven Guard. It contains boosted olfactory and auditory sensors that increase the ranged accuracy of the wearer. This however makes it more fragile to an extent.", "tags": ["power_armour"], "maintenance" : 0.05, @@ -2367,29 +2330,26 @@ global.gear = { "abbreviation": "MK7", "armour_value": { "standard": 18, - "master_crafted": 20, - "artifact": 24 + "master_crafted": 22, + "artifact": 26 }, - "ranged_mod": { - "standard": 0, - "master_crafted": 5, // Augmented - "artifact": 10 // Augmented + "hp_mod": { + "standard": 5, + "master_crafted": 10, + "artifact": 15 }, "melee_mod": { - "standard": 0, - "master_crafted": 5, // Augmented - "artifact": 10 // Augmented - }, - "hp_mod":{ - "standard": 0, - "master_crafted": 5, - "artifact": 10 + "standard": 5, + "master_crafted": 10, + "artifact": 15 }, - "damage_resistance_mod": { - "standard": 0, - "master_crafted": 5, - "artifact": 10 + "ranged_mod": { + "standard": 5, + "master_crafted": 10, + "artifact": 15 }, + "melee_hands": 1, + "ranged_hands": 1, "description": "The most common power armour of the Adeptus Astartes and the only power armour still widely manufactured by the Imperium.", "tags": ["power_armour"], "maintenance" : 0.01, @@ -2397,54 +2357,31 @@ global.gear = { "MK8 Errant": { "abbreviation": "MK8", "armour_value": { - "standard": 20, - "master_crafted": 22, - "artifact": 26 + "standard": 19, + "master_crafted": 23, + "artifact": 27 }, - "ranged_mod": { - "standard": 0, - "master_crafted": 5, // Augmented - "artifact": 10 // Augmented + "hp_mod": { + "standard": 5, + "master_crafted": 10, + "artifact": 15 }, "melee_mod": { - "standard": 0, - "master_crafted": 5, // Augmented - "artifact": 10 // Augmented - }, - "hp_mod":{ - "standard": 0, - "master_crafted": 5, - "artifact": 10 + "standard": 5, + "master_crafted": 10, + "artifact": 15 }, - "damage_resistance_mod": { - "standard": 0, - "master_crafted": 5, - "artifact": 10 + "ranged_mod": { + "standard": 5, + "master_crafted": 10, + "artifact": 15 }, + "melee_hands": 1, + "ranged_hands": 1, "description": "The newest and most advanced of the standard mark power armours as such production has not yet reached maximum capacity creating a supply shortage while chapters rush to get access to them.", "tags": ["power_armour"], "maintenance" : 0.02, }, - "MK10 Tacticus": { - "abbreviation": "MK10", - "armour_value": { - "standard": 24, - "master_crafted": 26, // Augmented - "artifact": 28 // Augmented - }, - "ranged_mod": { - "standard": 0, - "master_crafted": 5, // Augmented - "artifact": 10 // Augmented - }, - "melee_mod": { - "standard": 0, - "master_crafted": 5, // Augmented - "artifact": 10 // Augmented - }, - "description": "The MKX Tacticus is the most advanced pattern of power armour available to the Adeptus Astartes, featuring advanced armor composites and systems. It was developed by Belisarius Cawl during the development of the Primaris Astartes program.", - "tags": ["power_armour"], - }, "Armoured Ceramite": { "abbreviation": "ArmCrmt", "description": "Supplemental ceramite armour packages provide protection far beyond stock configurations while also adding significant weight to the chassis.", From ed5a4a03c794c003655e5922dea97032866d17be Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Thu, 10 Apr 2025 18:58:43 +0300 Subject: [PATCH 41/80] Test enemy vehicles in the front --- objects/obj_ncombat/Alarm_0.gml | 57 +++++++++++++-------------------- 1 file changed, 23 insertions(+), 34 deletions(-) diff --git a/objects/obj_ncombat/Alarm_0.gml b/objects/obj_ncombat/Alarm_0.gml index 46a47b771a..7360d0cf9e 100644 --- a/objects/obj_ncombat/Alarm_0.gml +++ b/objects/obj_ncombat/Alarm_0.gml @@ -1440,33 +1440,18 @@ if (enemy = 7) { } // Large Ork Army if (threat = 6) { - u = instance_nearest(xxx, 240, obj_enunit); enemy_dudes = "a WAAAAGH!! of 11000"; - u.dudes[1] = "Slugga Boy"; - u.dudes_num[1] = 1200; - u.dudes[2] = "Ard Boy"; - u.dudes_num[2] = 600; - u.dudes[3] = "Gretchin"; - u.dudes_num[3] = 2000; - u.dudes[4] = "Tank Busta"; - u.dudes_num[4] = 100; + u = instance_nearest(xxx, 240, obj_enunit); + u.dudes[1] = "Mekboy"; + u.dudes_num[1] = 6; + u.dudes[2] = "Flash Git"; + u.dudes_num[2] = 50; + u.dudes[3] = "Kommando"; + u.dudes_num[3] = 20; instance_deactivate_object(u); u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Deff Dread"; - u.dudes_num[1] = 40; - u.dudes[2] = "Battlewagon"; - u.dudes_num[2] = 18; - u.dudes[3] = "Mekboy"; - u.dudes_num[3] = 6; - u.dudes[4] = "Flash Git"; - u.dudes_num[4] = 50; - u.dudes[5] = "Kommando"; - u.dudes_num[5] = 20; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 20, 240, obj_enunit); u.dudes[1] = "Slugga Boy"; u.dudes_num[1] = 1200; u.dudes[2] = "Ard Boy"; @@ -1477,20 +1462,16 @@ if (enemy = 7) { u.dudes_num[4] = 100; instance_deactivate_object(u); - u = instance_nearest(xxx + 30, 240, obj_enunit); - u.dudes[1] = "Deff Dread"; - u.dudes_num[1] = 40; - u.dudes[2] = "Battlewagon"; - u.dudes_num[2] = 18; - u.dudes[3] = "Mekboy"; - u.dudes_num[3] = 6; - u.dudes[4] = "Flash Git"; - u.dudes_num[4] = 50; - u.dudes[5] = "Kommando"; - u.dudes_num[5] = 20; + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Mekboy"; + u.dudes_num[1] = 6; + u.dudes[2] = "Flash Git"; + u.dudes_num[2] = 50; + u.dudes[3] = "Kommando"; + u.dudes_num[3] = 20; instance_deactivate_object(u); - u = instance_nearest(xxx + 40, 240, obj_enunit); + u = instance_nearest(xxx + 30, 240, obj_enunit); u.dudes[1] = "Big Warboss"; u.dudes_num[1] = 1; // Spawn Leader @@ -1508,6 +1489,14 @@ if (enemy = 7) { u.dudes_num[4] = 900; u.dudes[5] = "Shoota Boy"; u.dudes_num[5] = 2000; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 40, 240, obj_enunit); + u.dudes[1] = "Deff Dread"; + u.dudes_num[1] = 36; + u.dudes[2] = "Battlewagon"; + u.dudes_num[2] = 220; + instance_deactivate_object(u); } } From 40c6adaddf6765ce4bfa447deccf0f17f41e8cba Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Thu, 10 Apr 2025 22:33:38 +0300 Subject: [PATCH 42/80] Test player attack rework --- objects/obj_enunit/Alarm_1.gml | 1 - objects/obj_pnunit/Create_0.gml | 1 - scripts/scr_en_weapon/scr_en_weapon.gml | 4 +- .../scr_equipment_struct.gml | 14 +- .../scr_player_combat_weapon_stacks.gml | 1 - scripts/scr_shoot/scr_shoot.gml | 462 ++++-------------- scripts/scr_weapon/scr_weapon.gml | 44 +- 7 files changed, 124 insertions(+), 403 deletions(-) diff --git a/objects/obj_enunit/Alarm_1.gml b/objects/obj_enunit/Alarm_1.gml index 468cc431b4..88edf9ae90 100644 --- a/objects/obj_enunit/Alarm_1.gml +++ b/objects/obj_enunit/Alarm_1.gml @@ -241,7 +241,6 @@ if __b__ { att[i] = 0; apa[i] = 0; wep_num[i] = 0; - wep_rnum[i] = 0; } i = 0; diff --git a/objects/obj_pnunit/Create_0.gml b/objects/obj_pnunit/Create_0.gml index 201bc57d37..4a5e7a90a8 100644 --- a/objects/obj_pnunit/Create_0.gml +++ b/objects/obj_pnunit/Create_0.gml @@ -89,7 +89,6 @@ i=-1; repeat(71){i+=1; wep[i]=""; wep_num[i]=0; - wep_rnum[i]=0; range[i]=0; att[i]=0; apa[i]=0; diff --git a/scripts/scr_en_weapon/scr_en_weapon.gml b/scripts/scr_en_weapon/scr_en_weapon.gml index 75fffb6ffd..7b68bf2384 100644 --- a/scripts/scr_en_weapon/scr_en_weapon.gml +++ b/scripts/scr_en_weapon/scr_en_weapon.gml @@ -473,10 +473,10 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { spli = 8; } if (argument0 = "Rokkit Launcha") { - atta = 38; + atta = 21; arp = 12; rang = 16; - spli = 3; + spli = 1; amm = 1; } if (argument0 = "Krooz Missile") { diff --git a/scripts/scr_equipment_struct/scr_equipment_struct.gml b/scripts/scr_equipment_struct/scr_equipment_struct.gml index 797f292cad..812a340426 100644 --- a/scripts/scr_equipment_struct/scr_equipment_struct.gml +++ b/scripts/scr_equipment_struct/scr_equipment_struct.gml @@ -45,8 +45,18 @@ function EquipmentStruct(item_data, core_type, quality_request = "none") constru // Placeholder maintenance values; if (maintenance == 0) { - if (has_tags(["heavy_ranged", "power", "plasma", "melta"])) { - maintenance += 0.05; + maintenance = 0.01; + + if (has_tags(["heavy_ranged"])) { + maintenance += 0.02; + } + + if (has_tags(["power", "plasma", "melta", "grav"])) { + maintenance += 0.02; + } + + if (has_tags(["power_armour"])) { + maintenance += 0.02; } } diff --git a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml index 5385779acb..a98d2b8487 100644 --- a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml +++ b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml @@ -115,7 +115,6 @@ function scr_player_combat_weapon_stacks() { att[i]=0; apa[i]=0; wep_num[i]=0; - wep_rnum[i]=0; // if (wep_owner[i]!="") and (wep_num[i]>1) then wep_owner[i]="assorted";// What if they are using two ranged weapons? Hmmmmm? } diff --git a/scripts/scr_shoot/scr_shoot.gml b/scripts/scr_shoot/scr_shoot.gml index ee1f6d2562..382a3246e4 100644 --- a/scripts/scr_shoot/scr_shoot.gml +++ b/scripts/scr_shoot/scr_shoot.gml @@ -9,17 +9,24 @@ function scr_shoot(weapon_index_position, target_object, target_index, target_ty // This massive clusterfuck of a script uses the newly determined weapon and target data to attack and assign damage - for (var j = 1; j <= 100; j++) { - obj_ncombat.dead_ene[j] = ""; - obj_ncombat.dead_ene_n[j] = 0; + if (!instance_exists(target_object)) { + exit; } - obj_ncombat.dead_enemies = 0; - if (obj_ncombat.wall_destroyed == 1) { exit; } + if (weapon_index_position < 0) { + exit; + } + + for (var j = 1; j <= 100; j++) { + obj_ncombat.dead_ene[j] = ""; + obj_ncombat.dead_ene_n[j] = 0; + } + obj_ncombat.dead_enemies = 0; + var _weapon_max_kills = splash[weapon_index_position]; var _total_damage = att[weapon_index_position]; var _weapon_ap = apa[weapon_index_position]; @@ -27,43 +34,44 @@ function scr_shoot(weapon_index_position, target_object, target_index, target_ty var _weapon_ammo = ammo[weapon_index_position]; var _shooter = wep_owner[weapon_index_position]; var _shooter_count = wep_num[weapon_index_position]; - - var _melee_accuracy_mod = 1; - var _ranged_accuracy_mod = 1; - switch (obj_ncombat.enemy) { - case eFACTION.Ork: - _melee_accuracy_mod = 0.7; - _ranged_accuracy_mod = 0.4; - break; - case eFACTION.Tau: - _melee_accuracy_mod = 0.5; - _ranged_accuracy_mod = 0.6; - break; - case eFACTION.Tyranids: - _melee_accuracy_mod = 0.6; - _ranged_accuracy_mod = 0.6; - break; - } - var _accuracy_mod = melee_or_ranged == "ranged" ? _ranged_accuracy_mod : _melee_accuracy_mod; - - var _shot_count = _shooter_count * _weapon_max_kills * _accuracy_mod; + var _shot_count = _shooter_count * _weapon_max_kills; var _weapon_damage_type = target_type; var _weapon_damage_per_hit = _total_damage / _shooter_count; - //* Enemy shooting - if ((weapon_index_position >= 0) && instance_exists(target_object) && (owner == 2)) { - if (_shooter_count == 0 || _weapon_ammo == 0) { - exit; - } else if (_weapon_ammo > 0) { - ammo[weapon_index_position] -= 1; - } + if (_weapon_ammo == 0 || _shooter_count <= 0 || _total_damage <= 0) { + exit; + } else { + ammo[weapon_index_position] -= 1; + } + //* Enemy shooting + if (owner == 2) { if (_weapon_name == "Web Spinner") { _weapon_damage_type = "status"; } else if (_weapon_damage_type == "medi") { _weapon_damage_type = _weapon_ap > 6 ? "arp" : "att"; } - + + var _melee_accuracy_mod = 1; + var _ranged_accuracy_mod = 1; + switch (obj_ncombat.enemy) { + case eFACTION.Ork: + _melee_accuracy_mod = 0.7; + _ranged_accuracy_mod = 0.4; + break; + case eFACTION.Tau: + _melee_accuracy_mod = 0.5; + _ranged_accuracy_mod = 0.6; + break; + case eFACTION.Tyranids: + _melee_accuracy_mod = 0.6; + _ranged_accuracy_mod = 0.6; + break; + } + var _accuracy_mod = melee_or_ranged == "ranged" ? _ranged_accuracy_mod : _melee_accuracy_mod; + + _shot_count *= _accuracy_mod; + var _weapon_data = { name: _weapon_name, damage: _weapon_damage_per_hit, @@ -102,364 +110,70 @@ function scr_shoot(weapon_index_position, target_object, target_index, target_ty } //* Player shooting - if (instance_exists(target_object) && (owner == eFACTION.Player)) { - // show_debug_message("{0}, {1}, {2}, {3}, {4}", _shooter_count, _weapon_name, _weapon_max_kills, _weapon_range, att[weapon_index_position]) - var shots_fired = 0; - var stop = 0; - var damage_type = ""; - - if (weapon_index_position >= 0) { - shots_fired = _shooter_count; - } - - if (shots_fired == 0) { - exit; - } - - /*if (weapon_index_position<-40){ - if (weapon_index_position=-53){ - if (player_silos>30) then shots_fired=30; - if (player_silos<30) then shots_fired=player_silos; - } - if (weapon_index_position=-51) or (weapon_index_position=-52){ - shots_fired=round(player_silos/2); - } - }*/ - - while (target_index < array_length(target_object.dudes_hp)) { - if (target_object.dudes_hp[target_index] == 0) { - target_index++; - stop = 1; - } else { - stop = 0; - break; - } - } - - if (weapon_index_position >= 0) { - if (_weapon_ammo == 0) { - stop = 1; + if (owner == eFACTION.Player) { + if (target_object.dudes_hp[target_index] <= 0) { + target_index = -1; + for (var i = 0, dudes_len = array_length(target_object.dudes); i < dudes_len; i++) { + if (target_object.dudes_hp[i] > 0) { + target_index = i; + break; + } } - if (_weapon_ammo > 0) { - _weapon_ammo -= 1; + if (target_index == -1) { + exit; } } + if (_weapon_name == "Missile Silo") { obj_ncombat.player_silos -= min(obj_ncombat.player_silos, 30); } - if (target_type != "highest") { - damage_type = target_type; - } - if ((target_type == "highest") && (weapon_index_position >= 0)) { - damage_type = "att"; - if ((_total_damage >= 100) && (_weapon_ap > 0)) { - damage_type = "arp"; - } - } - if (target_type == "highest") { - if (weapon_index_position == -51 || weapon_index_position == -52 || weapon_index_position == -53) { - damage_type = "att"; - } - } - - if ((weapon_index_position >= 0) || (weapon_index_position < -40)) { - // Normal shooting - var overkill = 0, - damage_remaining = 0, - shots_remaining = 0; - - var that_works = false; - - if (weapon_index_position >= 0) { - if ((_total_damage > 0) && (stop == 0)) { - that_works = true; - } - } - if ((weapon_index_position < -40) && (stop == 0)) { - that_works = true; - } + // Normal shooting + var _target_armour_value = target_object.dudes_ac[target_index]; + var _damage_per_weapon = max(0.5, _weapon_damage_per_hit - max(0, _target_armour_value - _weapon_ap)); + _damage_per_weapon *= target_object.dudes_dr[target_index]; + _total_damage = _damage_per_weapon * _shooter_count; - if (that_works == true) { - var damage_per_weapon = 0, - c = 0, - target_armour_value = 0, - ap = 0, - wii = ""; - attack_count_mod = 0; + var _dudes_num = target_object.dudes_num[target_index]; + var _unit_hp = target_object.dudes_hp[target_index]; + var _casualties = min(_shot_count, _dudes_num, floor(_total_damage / _unit_hp)); - if (weapon_index_position >= 0) { - damage_per_weapon = _total_damage / _shooter_count; - ap = _weapon_ap; - } // Average damage - if (weapon_index_position < -40) { - wii = ""; - attack_count_mod = 3; - - if (weapon_index_position == -51) { - wii = "Heavy Bolter Emplacement"; - at = 160; - _weapon_ap = 0; - } - if (weapon_index_position == -52) { - wii = "Missile Launcher Emplacement"; - at = 200; - _weapon_ap = -1; - } - if (weapon_index_position == -53) { - wii = "Missile Silo"; - at = 250; - _weapon_ap = 0; - } - } - - target_armour_value = target_object.dudes_ac[target_index]; + var _used_damage = _casualties * _unit_hp; + var _leftover_damage = _total_damage - _used_damage; + if (_leftover_damage > 0) { + target_object.dudes_hp[target_index] -= _leftover_damage; + } - // Calculate final armor value based on armor piercing (AP) rating against target type - if (target_object.dudes_vehicle[target_index]) { - if (_weapon_ap == 4) { - target_armour_value = 0; - } - if (_weapon_ap == 3) { - target_armour_value = target_armour_value * 2; - } - if (_weapon_ap == 2) { - target_armour_value = target_armour_value * 4; - } - if (_weapon_ap == 1) { - target_armour_value = target_armour_value * 6; - } - } else { - if (_weapon_ap == 4) { - target_armour_value = 0; - } - if (_weapon_ap == 3) { - target_armour_value = target_armour_value * 1.5; - } - if (_weapon_ap == 2) { - target_armour_value = target_armour_value * 2; - } - if (_weapon_ap == 1) { - target_armour_value = target_armour_value * 3; + if (_casualties > 0) { + var found = -1; + var openz = -1; + for (var i = 0, _dead_ene = array_length(obj_ncombat.dead_ene); i < _dead_ene; i++) { + if (obj_ncombat.dead_ene[i] == "") { + if (openz == -1) { + openz = i; } } - - attack_count_mod = max(1, _weapon_max_kills); - - final_hit_weapon_damage_value = damage_per_weapon - (target_armour_value * attack_count_mod); //damage armour reduction - - final_hit_weapon_damage_value *= target_object.dudes_dr[target_index]; //damage_resistance mod - - if (final_hit_weapon_damage_value <= 0) { - final_hit_weapon_damage_value = 0; - } // Average after armour - - c = shots_fired * final_hit_weapon_damage_value; // New damage - - var casualties, onceh = 0, - ponies = 0; - - casualties = min(floor(c / target_object.dudes_hp[target_index]), shots_fired * attack_count_mod); - - ponies = target_object.dudes_num[target_index]; - if ((target_object.dudes_num[target_index] == 1) && ((target_object.dudes_hp[target_index] - c) <= 0)) { - casualties = 1; - } - - if (target_object.dudes_num[target_index] - casualties < 0) { - overkill = casualties - target_object.dudes_num[target_index]; - damage_remaining = c - (overkill * target_object.dudes_hp[target_index]); - - shots_remaining = round(damage_remaining / damage_per_weapon); + + if (obj_ncombat.dead_ene[i] == target_object.dudes[target_index]) { + found = i; + break; } + } - if (target_object.dudes_num[target_index] - casualties < 0) { - casualties = ponies; - } - if (casualties < 0) { - casualties = 0; - } - - if (casualties >= 1) { - var iii = 0, - found = 0, - openz = 0; - for (iii = 0; iii <= 40; iii++) { - iii += 1; - if (found == 0) { - if ((obj_ncombat.dead_ene[iii] == "") && (openz == 0)) { - openz = iii; - } - if ((obj_ncombat.dead_ene[iii] == target_object.dudes[target_index]) && (found == 0)) { - found = iii; - obj_ncombat.dead_ene_n[obj_ncombat.dead_enemies] += casualties; - } - } - } - if (found == 0) { - obj_ncombat.dead_enemies += 1; - obj_ncombat.dead_ene[openz] = string(target_object.dudes[target_index]); - obj_ncombat.dead_ene_n[openz] = casualties; - } - } - - var k = 0; - if ((damage_remaining > 0) && (shots_remaining > 0)) { - repeat(10) { - if ((damage_remaining > 0) && (shots_remaining > 0)) { - var godd; - godd = 0; - k = target_index; - - // Find similar target in this same group - repeat(10) { - k += 1; - if (godd == 0) { - if ((target_object.dudes_num[k] > 0) && (target_object.dudes_vehicle[k] == target_object.dudes_vehicle[target_index])) { - godd = k; - } - } - } - k = target_index; - if (godd == 0) { - repeat(10) { - k -= 1; - if ((godd == 0) && (k >= 1)) { - if ((target_object.dudes_num[k] > 0) && (target_object.dudes_vehicle[k] == target_object.dudes_vehicle[target_index])) { - godd = k; - } - } - } - } - - // Found damage_per_weapon similar target to get the damage - if ((godd > 0) && (damage_remaining > 0) && (shots_remaining > 0)) { - var a2, b2, c2, target_armour_value2, ap2; - ap2 = damage_remaining; - a2 = damage_per_weapon; // Average damage - - target_armour_value2 = target_object.dudes_ac[godd]; - if (target_object.dudes_vehicle[godd] == 0) { - if (ap2 == 1) { - target_armour_value2 = target_armour_value2 * 3; - } - if (ap2 == 2) { - target_armour_value2 = target_armour_value2 * 2; - } - if (ap2 == 3) { - target_armour_value2 = target_armour_value2 * 1.5; - } - if (ap2 == 4) { - target_armour_value2 = 0; - } - } - if (target_object.dudes_vehicle[godd] == 1) { - if (ap2 == 1) { - target_armour_value2 = target_armour_value2 * 6; - } - if (ap2 == 2) { - target_armour_value2 = target_armour_value2 * 4; - } - if (ap2 == 3) { - target_armour_value2 = target_armour_value2 * 2; - } - } - b2 = a2 - target_armour_value2; - if (b2 <= 0) { - b2 = 0; - } // Average after armour - - c2 = b2 * shots_remaining; // New damage - - var casualties2, ponies2, onceh2; - onceh2 = 0; - ponies2 = 0; - if (attack_count_mod <= 1) { - casualties2 = min(floor(c2 / target_object.dudes_hp[godd]), shots_remaining); - } - - if (attack_count_mod > 1) { - casualties2 = floor(c2 / target_object.dudes_hp[godd]); - } - ponies2 = target_object.dudes_num[godd]; - if ((target_object.dudes_num[godd] == 1) && ((target_object.dudes_hp[godd] - c2) <= 0)) { - casualties2 = 1; - } - if (target_object.dudes_num[godd] < casualties2) { - casualties2 = target_object.dudes_num[godd]; - } - if (casualties2 < 1) { - casualties2 = 0; - damage_remaining = 0; - overkill = 0; - shots_remaining = 0; - } - - if ((casualties2 >= 1) && (shots_fired > 0)) { - var iii, found, openz; - iii = 0; - found = 0; - openz = 0; - repeat(40) { - iii += 1; - if (found == 0) { - if ((obj_ncombat.dead_ene[iii] == "") && (openz == 0)) { - openz = iii; - } - if ((obj_ncombat.dead_ene[iii] == target_object.dudes[godd]) && (found == 0)) { - found = iii; - obj_ncombat.dead_ene_n[obj_ncombat.dead_enemies] += casualties; - } - } - } - if (found == 0) { - obj_ncombat.dead_enemies += 1; - obj_ncombat.dead_ene[openz] = string(target_object.dudes[godd]); - obj_ncombat.dead_ene_n[openz] = casualties; - } - - /*obj_ncombat.dead_enemies+=1; - if (casualties2=1) then obj_ncombat.dead_ene[obj_ncombat.dead_enemies]="1 "+string(target_object.dudes[godd]); - if (casualties2>1) then obj_ncombat.dead_ene[obj_ncombat.dead_enemies]=string(casualties2)+" "+string(target_object.dudes[godd]); - obj_ncombat.dead_enemies+=1; - obj_ncombat.dead_ene[obj_ncombat.dead_enemies]=string(target_object.dudes[godd]); - obj_ncombat.dead_ene_n[obj_ncombat.dead_enemies]=casualties;*/ - - target_object.dudes_num[godd] -= casualties2; - obj_ncombat.enemy_forces -= casualties2; - } - - if (casualties2 >= 1) { - if (target_object.dudes_num[godd] <= 0) { - overkill = casualties2 - target_object.dudes_num[godd]; - damage_remaining -= casualties2 * target_object.dudes_hp[godd]; - - var proportional_shots; - proportional_shots = round(damage_remaining / a2); - shots_remaining = proportional_shots; - - // show_message("killed "+string(casualties2)+"x "+string(target_object.dudes[godd])); - // show_message("did "+string(c)+" damage with "+string(proportional_shots)+" shots fired, have "+string(damage_remaining)+" damage remaining"); - } - } - } - } - } - } // End repeat 10 - scr_flavor(weapon_index_position, target_object, target_index, shots_fired - wep_rnum[weapon_index_position], casualties); - - if ((target_object.dudes_num[target_index] == 1) && (c > 0)) { - target_object.dudes_hp[target_index] -= c; - } // Need special flavor here for just damaging - - if (casualties >= 1) { - target_object.dudes_num[target_index] -= casualties; - obj_ncombat.enemy_forces -= casualties; - } + if (found != -1) { + obj_ncombat.dead_ene_n[found] += _casualties; + } else if (openz != -1) { + obj_ncombat.dead_enemies += 1; + obj_ncombat.dead_ene[openz] = string(target_object.dudes[target_index]); + obj_ncombat.dead_ene_n[openz] = _casualties; } } - if (stop == 0) { + scr_flavor(weapon_index_position, target_object, target_index, _shooter_count, _casualties); + + if (_casualties > 0) { + target_object.dudes_num[target_index] -= _casualties; + obj_ncombat.enemy_forces -= _casualties; compress_enemy_array(target_object); destroy_empty_column(target_object); } diff --git a/scripts/scr_weapon/scr_weapon.gml b/scripts/scr_weapon/scr_weapon.gml index de0f4f7046..3d04856c43 100644 --- a/scripts/scr_weapon/scr_weapon.gml +++ b/scripts/scr_weapon/scr_weapon.gml @@ -74,9 +74,9 @@ global.weapons = { "Chainsword": { "abbreviation": "ChSwrd", "attack": { - "standard": 150, - "master_crafted": 180, - "artifact": 250 + "standard": 18, + "master_crafted": 28, + "artifact": 38 }, "description": "A standard Chainsword. It is popular among Assault Marines due to their raw power while maintaining speed.", "melee_hands": 1, @@ -84,7 +84,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 4, - "arp": 1, + "arp": 6, "tags": ["chain", "sword","savage", "boarding 1"], }, "Chainaxe": { @@ -615,17 +615,17 @@ global.weapons = { "Bolt Pistol": { "abbreviation": "BltPstl", "attack": { - "standard": 150, - "master_crafted": 175, - "artifact": 200 + "standard": 30, + "master_crafted": 40, + "artifact": 50 }, "description": "A smaller, more compact version of the venerable Boltgun. This model is produced in the standard Godwyn pattern.", "melee_hands": 0, "ranged_hands": 1, - "ammo": 18, + "ammo": 7, "range": 4.1, "spli": 2, - "arp": 1, + "arp": 8, "tags": ["bolt", "pistol", "boarding 1"], }, "Wrist-Mounted Storm Bolter": { @@ -779,17 +779,17 @@ global.weapons = { "Bolter": { "abbreviation": "Bltr", "attack": { - "standard": 150, - "master_crafted": 175, - "artifact": 200 + "standard": 30, + "master_crafted": 40, + "artifact": 50 }, "description": "A standard Bolter, a two-handed firearm that launches rocket propelled projectiles that detonate after penetrating the target. It is a versatile and iconic weapon of Adeptus Astartes, their resounding detonations carry the Emperor's Wrath.", "melee_hands": 1, "ranged_hands": 2, - "ammo": 16, - "range": 10, - "spli": 5, - "arp": 1, + "ammo": 10, + "range": 11, + "spli": 3, + "arp": 8, "tags": ["bolt", "boarding 1"] }, "Heavy Flamer": { @@ -1194,17 +1194,17 @@ global.weapons = { "Heavy Bolter": { "abbreviation": "HvyBltr", "attack": { - "standard": 250, - "master_crafted": 300, - "artifact": 450 + "standard": 35, + "master_crafted": 45, + "artifact": 55 }, "description": "The Heavy Bolter is a heavy weapon that fires larger and more powerful bolt shells compared to the standard Bolter.", "melee_hands": 1, "ranged_hands": 2, "ammo": 10, - "range": 14, - "spli": 12, - "arp": 2, + "range": 16, + "spli": 6, + "arp": 10, "tags": ["heavy_ranged", "bolt"] }, "Infernus Heavy Bolter": { From 673c718f571822a8090f927e71a7cb2ef4912db1 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Fri, 11 Apr 2025 15:13:21 +0300 Subject: [PATCH 43/80] Weapon reload mechanic and probably a bunch more shit I forgot --- objects/obj_enunit/Alarm_0.gml | 50 +++-- objects/obj_enunit/Create_0.gml | 5 +- objects/obj_pnunit/Alarm_0.gml | 15 +- objects/obj_pnunit/Create_0.gml | 5 +- scripts/scr_clean/scr_clean.gml | 206 +++++++++--------- scripts/scr_en_weapon/scr_en_weapon.gml | 31 ++- .../scr_player_combat_weapon_stacks.gml | 20 +- scripts/scr_shoot/scr_shoot.gml | 82 +++++-- scripts/scr_weapon/scr_weapon.gml | 3 + 9 files changed, 263 insertions(+), 154 deletions(-) diff --git a/objects/obj_enunit/Alarm_0.gml b/objects/obj_enunit/Alarm_0.gml index 80dc78a20b..06cd65ebf6 100644 --- a/objects/obj_enunit/Alarm_0.gml +++ b/objects/obj_enunit/Alarm_0.gml @@ -1,3 +1,5 @@ +#macro DEBUG_COLUMN_PRIORITY false + //* This alarm is responsible for the enemy target column selection; if (!instance_exists(obj_pnunit)) { @@ -16,14 +18,17 @@ var enemy2 = enemy; engaged = collision_point(x-10, y, obj_pnunit, 0, 1) || collision_point(x+10, y, obj_pnunit, 0, 1); // show_debug_message($"enemy is in melee {engaged}") -var _t_start1 = get_timer(); +if (DEBUG_COLUMN_PRIORITY) { + var _t_start1 = get_timer(); +} + if (!engaged){ // Shooting for (var i=0;i= 2) || (ammo[i]==0)) { + if (range[i] >= 2) { // show_debug_message($"A melee or no ammo weapon was found! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}; Ammo: {ammo[i]}"); continue; } diff --git a/objects/obj_enunit/Create_0.gml b/objects/obj_enunit/Create_0.gml index 3b33e338eb..c445a676fb 100644 --- a/objects/obj_enunit/Create_0.gml +++ b/objects/obj_enunit/Create_0.gml @@ -52,7 +52,10 @@ repeat(1001){i+=1; range[i]=0; att[i]=0; apa[i]=0; - ammo[i]=-1; + ammo_current[i]=0; + ammo_max[i]=-1; + ammo_reload_current[i]=-1; + ammo_reload[i]=-1; splash[i]=0; wep_owner[i]=""; diff --git a/objects/obj_pnunit/Alarm_0.gml b/objects/obj_pnunit/Alarm_0.gml index e6c4c1e173..3d6c96b385 100644 --- a/objects/obj_pnunit/Alarm_0.gml +++ b/objects/obj_pnunit/Alarm_0.gml @@ -1,3 +1,10 @@ +// Useful functions: +// scr_target +// get_rightmost +// move_unit_block +// gear_weapon_data +// scr_shoot + try { // with(obj_enunit){show_message(string(dudes[1])+"|"+string(dudes_num[1])+"|"+string(men+medi)+"|"+string(dudes_hp[1]));} @@ -68,7 +75,7 @@ engaged = collision_point(x-14, y, obj_enunit, 0, 1) || collision_point(x+14, y, } - if (range[i]>=dist) and (ammo[i]!=0 || range[i]==1){ + if (range[i]>=dist) { 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"; } @@ -222,11 +229,5 @@ engaged = collision_point(x-14, y, obj_enunit, 0, 1) || collision_point(x+14, y, } } } catch (_exception) { - // show_debug_message($"known_powers: {known_powers}"); - // show_debug_message($"buff_powers: {buff_powers}"); - // show_debug_message($"buff_cast: {buff_cast}"); - // show_debug_message($"power_index: {power_index}"); - // show_debug_message($"known_attack_powers: {known_attack_powers}"); - // show_debug_message($"known_buff_powers: {known_buff_powers}"); handle_exception(_exception); } \ No newline at end of file diff --git a/objects/obj_pnunit/Create_0.gml b/objects/obj_pnunit/Create_0.gml index 4a5e7a90a8..51cdfa8a57 100644 --- a/objects/obj_pnunit/Create_0.gml +++ b/objects/obj_pnunit/Create_0.gml @@ -92,7 +92,10 @@ repeat(71){i+=1; range[i]=0; att[i]=0; apa[i]=0; - ammo[i]=-1; + ammo_current[i]=0; + ammo_max[i]=-1; + ammo_reload_current[i]=-1; + ammo_reload[i]=-1; splash[i]=0; wep_owner[i]=""; wep_solo[i]=[]; diff --git a/scripts/scr_clean/scr_clean.gml b/scripts/scr_clean/scr_clean.gml index 2b69ee6019..b203e55879 100644 --- a/scripts/scr_clean/scr_clean.gml +++ b/scripts/scr_clean/scr_clean.gml @@ -1,79 +1,4 @@ -/// @function compress_enemy_array -/// @description Compresses column data arrays by removing gaps left by eliminated entities, processes only the first 20 indices -/// @param {id.Instance} _target_column - The column instance to clean up -/// @returns {undefined} No return value; modifies target column directly -function compress_enemy_array(_target_column) { - if (!instance_exists(_target_column)) { - return; - } - - with(_target_column) { - // Define all data arrays to be processed with their default values - var _data_arrays = [{ - arr: dudes, - def: "" - }, { - arr: dudes_special, - def: "" - }, { - arr: dudes_num, - def: 0 - }, { - arr: dudes_ac, - def: 0 - }, { - arr: dudes_hp, - def: 0 - }, { - arr: dudes_vehicle, - def: 0 - }, { - arr: dudes_damage, - def: 0 - }]; - - // Track which slots are empty - var _empty_slots = array_create(20, false); - for (var i = 1; i < array_length(_empty_slots); i++) { - if (dudes_num[i] <= 0) { - _empty_slots[i] = true; - } - } - - // Compress arrays using a pointer that doesn't restart from beginning - var pos = 1; - while (pos < array_length(_empty_slots) - 1) { - if (_empty_slots[pos] && !_empty_slots[pos + 1]) { - // Move data from position pos+1 to pos - for (var j = 0; j < array_length(_data_arrays); j++) { - _data_arrays[j].arr[pos] = _data_arrays[j].arr[pos + 1]; - _data_arrays[j].arr[pos + 1] = _data_arrays[j].def; - } - _empty_slots[pos] = false; - _empty_slots[pos + 1] = true; - - // Only backtrack if we're not at the beginning - if (pos > 1) { - pos--; // Check this position again in case we need to shift more - } - } else { - pos++; // Move to next position - } - } - } -} - -/// @function destroy_empty_column -/// @description Destroys the column if it's empty -/// @param {id.Instance} _target_column - The column instance to clean up -function destroy_empty_column(_target_column) { - // Destroy empty non-player columns to conserve memory and processing - with(_target_column) { - if ((men + veh + medi == 0) && (owner != 1)) { - instance_destroy(); - } - } -} +#macro DEBUG_TARGET_SELECTION false /// @function check_dead_marines /// @description Checks if the marine is dead and then runs various related code @@ -127,7 +52,9 @@ function scr_clean(target_object, weapon_data) { exit; } - var _t_start = get_timer(); + if (DEBUG_TARGET_SELECTION) { + var _t_start = get_timer(); + } var armour_pierce = weapon_data.armour_pierce; var hostile_shots = weapon_data.shot_count; @@ -195,10 +122,9 @@ function scr_clean(target_object, weapon_data) { // Apply damage var _min_damage = enemy == 13 ? 1 : 0.25; - var _random_damage_mod_min = 0.5; - var _dice_sides = 100; - var _random_damage_mod = _random_damage_mod_min + (roll_dice(1, _dice_sides, "low") / _dice_sides); - var _armour_points = veh_ac[vehicle_id] - armour_pierce; + var _dice_sides = 200; + var _random_damage_mod = roll_dice(1, _dice_sides, "low") / _dice_sides; + var _armour_points = max(0, veh_ac[vehicle_id] - armour_pierce); var _modified_damage = max(_min_damage, (hostile_damage * _random_damage_mod) - _armour_points); veh_hp[vehicle_id] -= _modified_damage; @@ -227,11 +153,10 @@ function scr_clean(target_object, weapon_data) { // Apply damage var _min_damage = enemy == 13 ? 1 : 0.25; - var _random_damage_mod_min = 0.5; - var _dice_sides = 100; - var _random_damage_mod = _random_damage_mod_min + (roll_dice(1, _dice_sides, "low") / _dice_sides); - var _armour_points = marine_ac[vehicle_id] - armour_pierce; - var _modified_damage = max(_min_damage, (hostile_damage * _random_damage_mod) - _armour_points); + var _dice_sides = 200; + var _random_damage_mod = roll_dice(1, _dice_sides, "low") / _dice_sides; + var _armour_points = max(0, marine_ac[marine_index] - armour_pierce); + var _modified_damage = (hostile_damage * _random_damage_mod) - _armour_points; if (_modified_damage > 0) { var damage_resistance = marine.damage_resistance() / 100; @@ -257,7 +182,7 @@ function scr_clean(target_object, weapon_data) { damage_resistance += marine_iron[vehicle_id] / 5; } } - _modified_damage = round(_modified_damage * (1 - damage_resistance)); + _modified_damage = max(_min_damage, round(_modified_damage * (1 - damage_resistance))); } if (_modified_damage < 0 && hostile_weapon == "Fleshborer") { @@ -300,7 +225,7 @@ function scr_clean(target_object, weapon_data) { var _min_damage = enemy == 13 ? 1 : 0.25; var _dice_sides = 200; var _random_damage_mod = roll_dice(1, _dice_sides, "low") / _dice_sides; - var _armour_points = marine_ac[marine_index] - armour_pierce; + var _armour_points = max(0, marine_ac[marine_index] - armour_pierce); var _modified_damage = max(_min_damage, (hostile_damage * _random_damage_mod) - _armour_points); if (_modified_damage > 0) { @@ -327,7 +252,7 @@ function scr_clean(target_object, weapon_data) { damage_resistance += marine_iron[marine_index] / 5; } } - _modified_damage = round(_modified_damage * (1 - damage_resistance)); + _modified_damage = max(_min_damage, round(_modified_damage * (1 - damage_resistance))); } if (_modified_damage < 0 && hostile_weapon == "Fleshborer") { _modified_damage = 1.5; @@ -360,21 +285,104 @@ function scr_clean(target_object, weapon_data) { } } - var _t_end = get_timer(); - var _elapsed_ms = (_t_end - _t_start) / 1000; - show_debug_message($"⏱️ Clean Execution Time: {_elapsed_ms}ms"); - - show_debug_message($"Hits: {hits}"); - show_debug_message($"Kills: {units_lost}"); + if (DEBUG_TARGET_SELECTION) { + var _t_end = get_timer(); + var _elapsed_ms = (_t_end - _t_start) / 1000; + show_debug_message($"⏱️ Clean Execution Time: {_elapsed_ms}ms"); + + show_debug_message($"Hits: {hits}"); + show_debug_message($"Kills: {units_lost}"); + } // Flavour battle-log message - var _t_start = get_timer(); + if (DEBUG_TARGET_SELECTION) { + var _t_start = get_timer(); + } scr_flavor2(units_lost, unit_type, hostile_range, hostile_weapon, shooter_count); - var _t_end = get_timer(); - var _elapsed_ms = (_t_end - _t_start) / 1000; - show_debug_message($"⏱️ Flavour Execution Time: {_elapsed_ms}ms"); + if (DEBUG_TARGET_SELECTION) { + var _t_end = get_timer(); + var _elapsed_ms = (_t_end - _t_start) / 1000; + show_debug_message($"⏱️ Flavour Execution Time: {_elapsed_ms}ms"); + } } } catch (_exception) { handle_exception(_exception); } } + +/// @function compress_enemy_array +/// @description Compresses column data arrays by removing gaps left by eliminated entities, processes only the first 20 indices +/// @param {id.Instance} _target_column - The column instance to clean up +/// @returns {undefined} No return value; modifies target column directly +function compress_enemy_array(_target_column) { + if (!instance_exists(_target_column)) { + return; + } + + with(_target_column) { + // Define all data arrays to be processed with their default values + var _data_arrays = [{ + arr: dudes, + def: "" + }, { + arr: dudes_special, + def: "" + }, { + arr: dudes_num, + def: 0 + }, { + arr: dudes_ac, + def: 0 + }, { + arr: dudes_hp, + def: 0 + }, { + arr: dudes_vehicle, + def: 0 + }, { + arr: dudes_damage, + def: 0 + }]; + + // Track which slots are empty + var _empty_slots = array_create(20, false); + for (var i = 1; i < array_length(_empty_slots); i++) { + if (dudes_num[i] <= 0) { + _empty_slots[i] = true; + } + } + + // Compress arrays using a pointer that doesn't restart from beginning + var pos = 1; + while (pos < array_length(_empty_slots) - 1) { + if (_empty_slots[pos] && !_empty_slots[pos + 1]) { + // Move data from position pos+1 to pos + for (var j = 0; j < array_length(_data_arrays); j++) { + _data_arrays[j].arr[pos] = _data_arrays[j].arr[pos + 1]; + _data_arrays[j].arr[pos + 1] = _data_arrays[j].def; + } + _empty_slots[pos] = false; + _empty_slots[pos + 1] = true; + + // Only backtrack if we're not at the beginning + if (pos > 1) { + pos--; // Check this position again in case we need to shift more + } + } else { + pos++; // Move to next position + } + } + } +} + +/// @function destroy_empty_column +/// @description Destroys the column if it's empty +/// @param {id.Instance} _target_column - The column instance to clean up +function destroy_empty_column(_target_column) { + // Destroy empty non-player columns to conserve memory and processing + with(_target_column) { + if ((men + veh + medi == 0) && (owner != 1)) { + instance_destroy(); + } + } +} diff --git a/scripts/scr_en_weapon/scr_en_weapon.gml b/scripts/scr_en_weapon/scr_en_weapon.gml index 7b68bf2384..d41baa948b 100644 --- a/scripts/scr_en_weapon/scr_en_weapon.gml +++ b/scripts/scr_en_weapon/scr_en_weapon.gml @@ -20,6 +20,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { arp = 0; acr = 0; amm = -1; + var reload = -1; // faith_bonus = 0; // var struct = gear_weapon_data("weapon",name); @@ -401,6 +402,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 3.1; amm = 6; spli = 3; + reload = 1; } if (argument0 = "Tankbusta Bomb") { atta = 65; @@ -408,6 +410,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 1; amm = 1; spli = 1; + reload = -1; } if (argument0 = "Big Shoota") { atta = 24; @@ -415,6 +418,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 13; amm = 6; spli = 10; + reload = 1; } if (argument0 = "Dakkagun") { atta = 24; @@ -422,6 +426,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 8; amm = 14; spli = 7; + reload = 3; } if (argument0 = "Deffgun") { atta = 30; @@ -429,6 +434,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 10; amm = 6; spli = 8; + reload = 2; } if (argument0 = "Snazzgun") { atta = 30; @@ -436,6 +442,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 11; amm = 10; spli = 2; + reload = 2; } if (argument0 = "Grot Blasta") { atta = 14; @@ -443,6 +450,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 2; amm = 4; spli = 2; + reload = 2; } if (argument0 = "Kannon") { atta = 54; @@ -450,6 +458,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 20; amm = 1; spli = 5; + reload = 1; } if (argument0 = "Shoota") { atta = 20; @@ -457,6 +466,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { amm = 10; rang = 7; spli = 3; + reload = 1; } if (argument0 = "Burna") { atta = 22; @@ -464,6 +474,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 3; amm = 6; spli = 6; + reload = 2; } if (argument0 = "Skorcha") { atta = 25; @@ -471,22 +482,14 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { rang = 4; amm = 6; spli = 8; + reload = 2; } if (argument0 = "Rokkit Launcha") { atta = 21; arp = 12; rang = 16; spli = 1; - amm = 1; } - if (argument0 = "Krooz Missile") { - atta = 48; - arp = 16; - rang = 18; - spli = 4; - amm = 1; - } - } if (obj_ncombat.enemy = 8) { @@ -1055,7 +1058,7 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { if (rang > 1) and(floor(rang) == rang) then atta = round(atta * dudes_ranged[group]); } - if (is_man = false) then amm = -1; + if (is_man = false && amm > 0) then amm *= 2; var b, goody, first; b = 0; @@ -1067,7 +1070,9 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { apa[b] = arp; range[b] = rang; wep_num[b] += man_number; - if (obj_ncombat.started = 0) then ammo[b] = amm; + if (obj_ncombat.started = 0) then ammo_max[b] = amm; + if (obj_ncombat.started = 0) then ammo_current[b] = amm; + if (obj_ncombat.started = 0) then ammo_reload[b] = reload; goody = 1; if (wep_owner[b] != "") or(man_number > 1) then wep_owner[b] = "assorted"; @@ -1083,7 +1088,9 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { apa[first] = arp; range[first] = rang; wep_num[first] += man_number; - if (obj_ncombat.started = 0) then ammo[first] = amm; + if (obj_ncombat.started = 0) then ammo_max[first] = amm; + if (obj_ncombat.started = 0) then ammo_current[first] = amm; + if (obj_ncombat.started = 0) then ammo_reload[first] = reload; goody = 1; if (man_number = 1) then wep_owner[first] = man_type; diff --git a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml index a98d2b8487..e8f93d6de0 100644 --- a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml +++ b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml @@ -34,7 +34,17 @@ function add_data_to_stack (stack_index, weapon, unit_damage=false, head_role=fa wep_num[stack_index]++; splash[stack_index]=weapon.spli; wep[stack_index]=weapon.name; - if (obj_ncombat.started=0) then ammo[stack_index]=weapon.ammo; + if (struct_exists(weapon, "reload")) { + ammo_reload[stack_index]=weapon.reload; + } else { + ammo_reload[stack_index]=-1; + } + + if (obj_ncombat.started == 0) { + ammo_reload_current[stack_index]=-1; + ammo_max[stack_index]=weapon.ammo; + ammo_current[stack_index]=weapon.ammo; + } if (unit!="none"){//this stops a potential infinite loop of secondary profiles add_second_profiles_to_stack(weapon, head_role, unit); @@ -77,7 +87,7 @@ function scr_player_combat_weapon_stacks() { range[i]=99; att[i]=160*wep_num[i]; apa[i]=0; - ammo[i]=-1; + ammo_max[i]=-1; splash[i]=1; i+=1; @@ -86,7 +96,7 @@ function scr_player_combat_weapon_stacks() { range[i]=99; att[i]=200*wep_num[i]; apa[i]=120*wep_num[i]; - ammo[i]=-1; + ammo_max[i]=-1; splash[i]=1; i+=1; @@ -95,7 +105,7 @@ function scr_player_combat_weapon_stacks() { range[i]=99; att[i]=350*wep_num[i]; apa[i]=200*wep_num[i]; - ammo[i]=-1; + ammo_max[i]=-1; splash[i]=1; var rightest=instance_nearest(2000,240,obj_pnunit); @@ -232,7 +242,7 @@ function scr_player_combat_weapon_stacks() { player_head_role_stack(weapon_stack_index,unit); } if (floor(primary_melee.range)<=1 && primary_melee.ammo == 0){ - ammo[weapon_stack_index]=-1; //no ammo limit + ammo_max[weapon_stack_index]=-1; //no ammo limit } } } diff --git a/scripts/scr_shoot/scr_shoot.gml b/scripts/scr_shoot/scr_shoot.gml index 382a3246e4..76141f2d5d 100644 --- a/scripts/scr_shoot/scr_shoot.gml +++ b/scripts/scr_shoot/scr_shoot.gml @@ -1,3 +1,6 @@ +#macro DEBUG_WEAPON_RELOADING true +#macro DEBUG_PLAYER_TARGET_SELECTION true + /// @mixin function scr_shoot(weapon_index_position, target_object, target_index, target_type, melee_or_ranged) { try { @@ -27,21 +30,52 @@ function scr_shoot(weapon_index_position, target_object, target_index, target_ty } obj_ncombat.dead_enemies = 0; - var _weapon_max_kills = splash[weapon_index_position]; - var _total_damage = att[weapon_index_position]; - var _weapon_ap = apa[weapon_index_position]; - var _weapon_name = wep[weapon_index_position]; - var _weapon_ammo = ammo[weapon_index_position]; - var _shooter = wep_owner[weapon_index_position]; - var _shooter_count = wep_num[weapon_index_position]; + var wi = weapon_index_position; + var _weapon_max_kills = splash[wi]; + var _total_damage = att[wi]; + var _weapon_ap = apa[wi]; + var _weapon_name = wep[wi]; + var _shooter = wep_owner[wi]; + var _shooter_count = wep_num[wi]; var _shot_count = _shooter_count * _weapon_max_kills; var _weapon_damage_type = target_type; var _weapon_damage_per_hit = _total_damage / _shooter_count; - if (_weapon_ammo == 0 || _shooter_count <= 0 || _total_damage <= 0) { + if (_shooter_count <= 0 || _total_damage <= 0) { exit; - } else { - ammo[weapon_index_position] -= 1; + } + + if (DEBUG_WEAPON_RELOADING) { + show_debug_message($"Weapon Name: {_weapon_name}\n Max Ammo: {ammo_max[wi]}\n Current Ammo: {ammo_current[wi]}\n Reload Time: {ammo_reload[wi]}\n Current Reload: {ammo_reload_current[wi]}"); + } + + if (ammo_max[wi] != -1) { + if (ammo_current[wi] == 0 && ammo_reload[wi] != -1) { + if (ammo_reload_current[wi] == -1) { + if (DEBUG_WEAPON_RELOADING) { + show_debug_message($"{_weapon_name} is reloading! Will finish in {ammo_reload[wi]} turns!"); + } + ammo_reload_current[wi] = ammo_reload[wi]; + ammo_reload_current[wi]--; + continue; + } else if (ammo_reload_current[wi] == 0) { + if (DEBUG_WEAPON_RELOADING) { + show_debug_message($"{_weapon_name} reloaded! Setting ammo to {ammo_max[wi]}!"); + } + ammo_current[wi] = ammo_max[wi]; + ammo_reload_current[wi] = -1; + } else { + if (DEBUG_WEAPON_RELOADING) { + show_debug_message($"{_weapon_name} is still reloading! {ammo_reload_current[wi]} turns left!"); + } + ammo_reload_current[wi]--; + continue; + } + } + + if (ammo_current[wi] > 0) { + ammo_current[wi]--; + } } //* Enemy shooting @@ -120,19 +154,29 @@ function scr_shoot(weapon_index_position, target_object, target_index, target_ty } } if (target_index == -1) { + if (DEBUG_PLAYER_TARGET_SELECTION) { + show_debug_message($"{_weapon_name} found no valid targets in the enemy column to attack!"); + } exit; } } + if (DEBUG_PLAYER_TARGET_SELECTION) { + show_debug_message($"{_weapon_name} is attacking {target_object.dudes[target_index]}"); + } + if (_weapon_name == "Missile Silo") { obj_ncombat.player_silos -= min(obj_ncombat.player_silos, 30); } // Normal shooting - var _target_armour_value = target_object.dudes_ac[target_index]; - var _damage_per_weapon = max(0.5, _weapon_damage_per_hit - max(0, _target_armour_value - _weapon_ap)); - _damage_per_weapon *= target_object.dudes_dr[target_index]; - _total_damage = _damage_per_weapon * _shooter_count; + var _min_damage = 0.25; + var _dice_sides = 200; + var _random_damage_mod = roll_dice(1, _dice_sides, "low") / _dice_sides; + var _armour_points = max(0, target_object.dudes_ac[target_index] - _weapon_ap); + var _weapon_damage_per_hit = (_weapon_damage_per_hit * _random_damage_mod) - _armour_points; + _weapon_damage_per_hit = max(_min_damage, _weapon_damage_per_hit * target_object.dudes_dr[target_index]); + _total_damage = _weapon_damage_per_hit * _shooter_count; var _dudes_num = target_object.dudes_num[target_index]; var _unit_hp = target_object.dudes_hp[target_index]; @@ -145,6 +189,10 @@ function scr_shoot(weapon_index_position, target_object, target_index, target_ty } if (_casualties > 0) { + if (DEBUG_PLAYER_TARGET_SELECTION) { + show_debug_message($"{_weapon_name} attacked {target_object.dudes[target_index]} and destroyed {_casualties}!"); + } + var found = -1; var openz = -1; for (var i = 0, _dead_ene = array_length(obj_ncombat.dead_ene); i < _dead_ene; i++) { @@ -167,9 +215,13 @@ function scr_shoot(weapon_index_position, target_object, target_index, target_ty obj_ncombat.dead_ene[openz] = string(target_object.dudes[target_index]); obj_ncombat.dead_ene_n[openz] = _casualties; } + } else { + if (DEBUG_PLAYER_TARGET_SELECTION) { + show_debug_message($"{_weapon_name} attacked {target_object.dudes[target_index]} but dealt no damage!"); + } } - scr_flavor(weapon_index_position, target_object, target_index, _shooter_count, _casualties); + scr_flavor(wi, target_object, target_index, _shooter_count, _casualties); if (_casualties > 0) { target_object.dudes_num[target_index] -= _casualties; diff --git a/scripts/scr_weapon/scr_weapon.gml b/scripts/scr_weapon/scr_weapon.gml index 3d04856c43..bc41ae9fab 100644 --- a/scripts/scr_weapon/scr_weapon.gml +++ b/scripts/scr_weapon/scr_weapon.gml @@ -623,6 +623,7 @@ global.weapons = { "melee_hands": 0, "ranged_hands": 1, "ammo": 7, + "reload": 1, "range": 4.1, "spli": 2, "arp": 8, @@ -787,6 +788,7 @@ global.weapons = { "melee_hands": 1, "ranged_hands": 2, "ammo": 10, + "reload": 1, "range": 11, "spli": 3, "arp": 8, @@ -1202,6 +1204,7 @@ global.weapons = { "melee_hands": 1, "ranged_hands": 2, "ammo": 10, + "reload": 1, "range": 16, "spli": 6, "arp": 10, From 1fc657cd987c0f439d2674173107f6dda19f4c49 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Fri, 11 Apr 2025 19:38:40 +0300 Subject: [PATCH 44/80] Kill a bunch of dead events and start reworking the player alarm --- objects/obj_pnunit/Alarm_0.gml | 302 ++++++++++++++--------------- objects/obj_pnunit/Destroy_0.gml | 4 - objects/obj_pnunit/KeyPress_73.gml | 38 ---- objects/obj_pnunit/KeyPress_84.gml | 24 --- objects/obj_pnunit/Mouse_0.gml | 56 ------ objects/obj_pnunit/obj_pnunit.yy | 1 - 6 files changed, 148 insertions(+), 277 deletions(-) delete mode 100644 objects/obj_pnunit/Destroy_0.gml delete mode 100644 objects/obj_pnunit/KeyPress_73.gml delete mode 100644 objects/obj_pnunit/KeyPress_84.gml delete mode 100644 objects/obj_pnunit/Mouse_0.gml diff --git a/objects/obj_pnunit/Alarm_0.gml b/objects/obj_pnunit/Alarm_0.gml index 3d6c96b385..7bddf72cc7 100644 --- a/objects/obj_pnunit/Alarm_0.gml +++ b/objects/obj_pnunit/Alarm_0.gml @@ -6,34 +6,8 @@ // scr_shoot try { - // with(obj_enunit){show_message(string(dudes[1])+"|"+string(dudes_num[1])+"|"+string(men+medi)+"|"+string(dudes_hp[1]));} - var rightest,charge=0,enemy2=0;// psy=false; - - - if (instance_number(obj_enunit)!=1){ - obj_ncombat.flank_x=self.x; - with(obj_enunit){ - if (x<(obj_ncombat.flank_x-20)) then instance_deactivate_object(id); - } - } - - rightest=get_rightmost();// Right most pnunit - enemy=instance_nearest(0,y,obj_enunit);// Left most enemy - enemy2=enemy; - - if (obj_ncombat.dropping || (!obj_ncombat.defending && obj_ncombat.formation_set != 2)){ - move_unit_block("east"); - } - -if (!instance_exists(enemy)) then exit; -engaged = collision_point(x-14, y, obj_enunit, 0, 1) || collision_point(x+14, y, obj_enunit, 0, 1); - - var once_only=0; - var range_shoot=""; - var dist=point_distance(x,y,enemy.x,enemy.y)/10; - - //* Psychic power buffs + //* Buffs for (var i = 0; i < array_length(unit_struct); i++) { if (marine_mshield[i] > 0) { marine_mshield[i] -= 1; @@ -58,164 +32,184 @@ engaged = collision_point(x-14, y, obj_enunit, 0, 1) || collision_point(x+14, y, } } - if (instance_exists(obj_enunit)){ - for (var i=0;i=dist) { + 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 + 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; + if (string_count("Lascan",wep[i])>0) then ap=1; + if (instance_number(obj_enunit)=1) and (obj_enunit.men=0) and (obj_enunit.veh>0) then ap=1; - if (range[i]>=dist) { - 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 - 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; - if (string_count("Lascan",wep[i])>0) then ap=1; - if (instance_number(obj_enunit)=1) and (obj_enunit.men=0) and (obj_enunit.veh>0) then ap=1; + if (instance_exists(enemy)){ + if (obj_enunit.veh>0) and (obj_enunit.men=0) and (apa[i]>10) then ap=1; - - if (instance_exists(enemy)){ - if (obj_enunit.veh>0) and (obj_enunit.men=0) and (apa[i]>10) then ap=1; + if (ap=1) and (once_only=0){// Check for vehicles + var enemy2,g=0,good=0; - if (ap=1) and (once_only=0){// Check for vehicles - var enemy2,g=0,good=0; - - if (enemy.veh>0){ - good=scr_target(enemy,"veh");// First target has vehicles, blow it to hell - scr_shoot(i,enemy,good,"arp","ranged"); - } - if (good=0) and (instance_number(obj_enunit)>1){// First target does not have vehicles, cycle through objects to find one that has vehicles - var x2=enemy.x; - repeat(instance_number(obj_enunit)-1){ - if (good=0){ - x2+=10; - enemy2=instance_nearest(x2,y,obj_enunit); - if (enemy2.veh>0) and (good=0){ - good=scr_target(enemy2,"veh");// This target has vehicles, blow it to hell - scr_shoot(i,enemy2,good,"arp","ranged"); - once_only=1; - } + if (enemy.veh>0){ + good=scr_target(enemy,"veh");// First target has vehicles, blow it to hell + scr_shoot(i,enemy,good,"arp","ranged"); + } + if (good=0) and (instance_number(obj_enunit)>1){// First target does not have vehicles, cycle through objects to find one that has vehicles + var x2=enemy.x; + repeat(instance_number(obj_enunit)-1){ + if (good=0){ + x2+=10; + enemy2=instance_nearest(x2,y,obj_enunit); + if (enemy2.veh>0) and (good=0){ + good=scr_target(enemy2,"veh");// This target has vehicles, blow it to hell + scr_shoot(i,enemy2,good,"arp","ranged"); + once_only=1; } } } - if (good=0) then ap=0;// Fuck it, shoot at infantry } + if (good=0) then ap=0;// Fuck it, shoot at infantry } - - - - - - - if (instance_exists(enemy)) and (once_only=0){ - if (enemy.medi>0) and (enemy.veh=0){ - good=scr_target(enemy,"medi");// First target has vehicles, blow it to hell - scr_shoot(i,enemy,good,"medi","ranged"); - - if (good=0) and (instance_number(obj_enunit)>1){// First target does not have vehicles, cycle through objects to find one that has vehicles - var x2=enemy.x; - repeat(instance_number(obj_enunit)-1){ - if (good=0){ - x2+=10;enemy2=instance_nearest(x2,y,obj_enunit); - if (enemy2.veh>0) and (good=0){ - good=scr_target(enemy2,"medi");// This target has vehicles, blow it to hell - scr_shoot(i,enemy2,good,"medi","ranged");once_only=1; - } + } + + + + + + + if (instance_exists(enemy)) and (once_only=0){ + if (enemy.medi>0) and (enemy.veh=0){ + good=scr_target(enemy,"medi");// First target has vehicles, blow it to hell + scr_shoot(i,enemy,good,"medi","ranged"); + + if (good=0) and (instance_number(obj_enunit)>1){// First target does not have vehicles, cycle through objects to find one that has vehicles + var x2=enemy.x; + repeat(instance_number(obj_enunit)-1){ + if (good=0){ + x2+=10;enemy2=instance_nearest(x2,y,obj_enunit); + if (enemy2.veh>0) and (good=0){ + good=scr_target(enemy2,"medi");// This target has vehicles, blow it to hell + scr_shoot(i,enemy2,good,"medi","ranged");once_only=1; } } } - if (good=0) then ap=0;// Next up is infantry - // Was previously ap=1; } + if (good=0) then ap=0;// Next up is infantry + // Was previously ap=1; } - - - - - - if (instance_exists(enemy)){ - if (ap=0) and (once_only=0){// Check for men - var g,good,enemy2;g=0;good=0; - - if (enemy.men+enemy.medi>0){ - good=scr_target(enemy,"men");// First target has vehicles, blow it to hell - scr_shoot(i,enemy,good,"att","ranged"); - } - if (good=0) and (instance_number(obj_enunit)>1){// First target does not have vehicles, cycle through objects to find one that has vehicles - var x2;x2=enemy.x; - repeat(instance_number(obj_enunit)-1){ - if (good=0){ - x2+=10;enemy2=instance_nearest(x2,y,obj_enunit); - if (enemy2.men>0) and (good=0){ - good=scr_target(enemy2,"men");// This target has vehicles, blow it to hell - scr_shoot(i,enemy2,good,"att","ranged");once_only=1; - } + } + + + + + + if (instance_exists(enemy)){ + if (ap=0) and (once_only=0){// Check for men + var g,good,enemy2;g=0;good=0; + + if (enemy.men+enemy.medi>0){ + good=scr_target(enemy,"men");// First target has vehicles, blow it to hell + scr_shoot(i,enemy,good,"att","ranged"); + } + if (good=0) and (instance_number(obj_enunit)>1){// First target does not have vehicles, cycle through objects to find one that has vehicles + var x2;x2=enemy.x; + repeat(instance_number(obj_enunit)-1){ + if (good=0){ + x2+=10;enemy2=instance_nearest(x2,y,obj_enunit); + if (enemy2.men>0) and (good=0){ + good=scr_target(enemy2,"men");// This target has vehicles, blow it to hell + scr_shoot(i,enemy2,good,"att","ranged");once_only=1; } } } } } - }else if (range_shoot="melee") and ((range[i]==1) or (range[i]!=floor(range[i]))){// Weapon meets preliminary checks - var ap=0; - if (apa[i]==1) then ap=1;// Determines if it is AP or not - - if (enemy.men=0) and (apa[i]=0) and (att[i]>=80){ - apa[i]=floor(att[i]/2);ap=1; - } - - if (apa[i]==1) and (once_only=0){// Check for vehicles - var enemy2,g=0,good=0; - - if (enemy.veh>0){ - good=scr_target(enemy,"veh");// First target has vehicles, blow it to hell - if (range[i]=1) then scr_shoot(i,enemy,good,"arp","melee"); - } - if (good!=0) then once_only=1; - if (good=0) and (att[i]>0) then ap=0;// Fuck it, shoot at infantry - } + } + }else if (range_shoot="melee") and ((range[i]==1) or (range[i]!=floor(range[i]))){// Weapon meets preliminary checks + var ap=0; + if (apa[i]==1) then ap=1;// Determines if it is AP or not + + if (enemy.men=0) and (apa[i]=0) and (att[i]>=80){ + apa[i]=floor(att[i]/2);ap=1; + } + + if (apa[i]==1) and (once_only=0){// Check for vehicles + var enemy2,g=0,good=0; - if (enemy.veh=0) and (enemy.medi>0) and (once_only=0){// Check for vehicles - var enemy2,g=0,good=0; - - if (enemy.medi>0){ - good=scr_target(enemy,"medi");// First target has vehicles, blow it to hell - if (range[i]=1) then scr_shoot(i,enemy,good,"medi","melee"); - } - if (good!=0) then once_only=1; - if (good=0) and (att[i]>0) then ap=0;// Fuck it, shoot at infantry + if (enemy.veh>0){ + good=scr_target(enemy,"veh");// First target has vehicles, blow it to hell + if (range[i]=1) then scr_shoot(i,enemy,good,"arp","melee"); } + if (good!=0) then once_only=1; + if (good=0) and (att[i]>0) then ap=0;// Fuck it, shoot at infantry + } + + if (enemy.veh=0) and (enemy.medi>0) and (once_only=0){// Check for vehicles + var enemy2,g=0,good=0; - - - if (ap=0) and (once_only=0){// Check for men - var g=0,good=0,enemy2; - - if (enemy.men>0) and (once_only=0){ - // show_message(string(wep[i])+" attacking"); - good=scr_target(enemy,"men"); - if (range[i]=1) then scr_shoot(i,enemy,good,"att","melee"); - } - if (good!=0) then once_only=1; + if (enemy.medi>0){ + good=scr_target(enemy,"medi");// First target has vehicles, blow it to hell + if (range[i]=1) then scr_shoot(i,enemy,good,"medi","melee"); } + if (good!=0) then once_only=1; + if (good=0) and (att[i]>0) then ap=0;// Fuck it, shoot at infantry } + if (ap=0) and (once_only=0){// Check for men + var g=0,good=0,enemy2; + + if (enemy.men>0) and (once_only=0){ + // show_message(string(wep[i])+" attacking"); + good=scr_target(enemy,"men"); + if (range[i]=1) then scr_shoot(i,enemy,good,"att","melee"); + } + if (good!=0) then once_only=1; + } } + + + } instance_activate_object(obj_enunit); diff --git a/objects/obj_pnunit/Destroy_0.gml b/objects/obj_pnunit/Destroy_0.gml deleted file mode 100644 index 08d7537f54..0000000000 --- a/objects/obj_pnunit/Destroy_0.gml +++ /dev/null @@ -1,4 +0,0 @@ - -// if (marine_type[1]!="") then show_message(marine_type[1]); - - diff --git a/objects/obj_pnunit/KeyPress_73.gml b/objects/obj_pnunit/KeyPress_73.gml deleted file mode 100644 index 4079a37a9a..0000000000 --- a/objects/obj_pnunit/KeyPress_73.gml +++ /dev/null @@ -1,38 +0,0 @@ - - -/*show_message("X: "+string(x)+", Y: "+string(y)+" -"+string(dudes_num[1])+"x "+string(dudes[1])+" "+string(dudes_vehicle[1])+" -"+string(dudes_num[2])+"x "+string(dudes[2])+" "+string(dudes_vehicle[2])+" -"+string(dudes_num[3])+"x "+string(dudes[3])+" "+string(dudes_vehicle[3])+" -"+string(dudes_num[4])+"x "+string(dudes[4])+" "+string(dudes_vehicle[4])+" -"+string(dudes_num[5])+"x "+string(dudes[5])+" "+string(dudes_vehicle[5])+" -"+string(dudes_num[6])+"x "+string(dudes[6])+" "+string(dudes_vehicle[6])+" -"+string(dudes_num[7])+"x "+string(dudes[7])+" "+string(dudes_vehicle[7])+" -"+string(dudes_num[8])+"x "+string(dudes[8])+" "+string(dudes_vehicle[8])+" -"+string(dudes_num[9])+"x "+string(dudes[9])+" "+string(dudes_vehicle[9])+" -"+string(dudes_num[10])+"x "+string(dudes[10])+" "+string(dudes_vehicle[10]));*/ - - -/* - -show_message("Engaged "+string(engaged)+" -"+string(wep_num[1])+"x "+string(wep[1])+": ATT"+string(att[1])+" ARP"+string(apa[1])+" splash:"+string(splash[1])+" -"+string(wep_num[2])+"x "+string(wep[2])+": ATT"+string(att[2])+" ARP"+string(apa[2])+" splash:"+string(splash[2])+" -"+string(wep_num[3])+"x "+string(wep[3])+": ATT"+string(att[3])+" ARP"+string(apa[3])+" splash:"+string(splash[3])+" -"+string(wep_num[4])+"x "+string(wep[4])+": ATT"+string(att[4])+" ARP"+string(apa[4])+" splash:"+string(splash[4])+" -"+string(wep_num[5])+"x "+string(wep[5])+": ATT"+string(att[5])+" ARP"+string(apa[5])+" splash:"+string(splash[5])+" -"+string(wep_num[6])+"x "+string(wep[6])+": ATT"+string(att[6])+" ARP"+string(apa[6])+" splash:"+string(splash[6])+" -"+string(wep_num[7])+"x "+string(wep[7])+": ATT"+string(att[7])+" ARP"+string(apa[7])+" splash:"+string(splash[7])+" -"+string(wep_num[8])+"x "+string(wep[8])+": ATT"+string(att[8])+" ARP"+string(apa[8])+" splash:"+string(splash[8])+" -"+string(wep_num[9])+"x "+string(wep[9])+": ATT"+string(att[9])+" ARP"+string(apa[9])+" splash:"+string(splash[9])+" -"+string(wep_num[10])+"x "+string(wep[10])+": ATT"+string(att[10])+" ARP"+string(apa[10])+" splash:"+string(splash[10])+" -"+string(wep_num[11])+"x "+string(wep[11])+": ATT"+string(att[11])+" ARP"+string(apa[11])+" splash:"+string(splash[11])+" -"+string(wep_num[12])+"x "+string(wep[12])+": ATT"+string(att[12])+" ARP"+string(apa[12])+" splash:"+string(splash[12])+" -"+string(wep_num[13])+"x "+string(wep[13])+": ATT"+string(att[13])+" ARP"+string(apa[13])+" splash:"+string(splash[13])+" -"+string(wep_num[14])+"x "+string(wep[14])+": ATT"+string(att[14])+" ARP"+string(apa[14])+" splash:"+string(splash[14])+" -"+string(wep_num[15])+"x "+string(wep[15])+": ATT"+string(att[15])+" ARP"+string(apa[15])+" splash:"+string(splash[15])); -*/ - - -/* */ -/* */ diff --git a/objects/obj_pnunit/KeyPress_84.gml b/objects/obj_pnunit/KeyPress_84.gml deleted file mode 100644 index f99ff12e9c..0000000000 --- a/objects/obj_pnunit/KeyPress_84.gml +++ /dev/null @@ -1,24 +0,0 @@ - -/*instance_activate_object(obj_pnunit); - -show_message("Engaged "+string(engaged)+" -"+string(dudes_num[1])+"x "+string(dudes[1])+" "+string(dudes_vehicle[1])+" -"+string(dudes_num[2])+"x "+string(dudes[2])+" "+string(dudes_vehicle[2])+" -"+string(dudes_num[3])+"x "+string(dudes[3])+" "+string(dudes_vehicle[3])+" -"+string(dudes_num[4])+"x "+string(dudes[4])+" "+string(dudes_vehicle[4])+" -"+string(dudes_num[5])+"x "+string(dudes[5])+" "+string(dudes_vehicle[5])+" -"+string(dudes_num[6])+"x "+string(dudes[6])+" "+string(dudes_vehicle[6])+" -"+string(dudes_num[7])+"x "+string(dudes[7])+" "+string(dudes_vehicle[7])+" -"+string(dudes_num[8])+"x "+string(dudes[8])+" "+string(dudes_vehicle[8])+" -"+string(dudes_num[9])+"x "+string(dudes[9])+" "+string(dudes_vehicle[9])+" -"+string(dudes_num[10])+"x "+string(dudes[10])+" "+string(dudes_vehicle[10])+" -"+string(dudes_num[11])+"x "+string(dudes[11])+" "+string(dudes_vehicle[11])+" -"+string(dudes_num[12])+"x "+string(dudes[12])+" "+string(dudes_vehicle[12])+" -"+string(dudes_num[13])+"x "+string(dudes[13])+" "+string(dudes_vehicle[13])+" -"+string(dudes_num[14])+"x "+string(dudes[14])+" "+string(dudes_vehicle[14])+" -"+string(dudes_num[15])+"x "+string(dudes[15])+" "+string(dudes_vehicle[15])+" -"+string(dudes_num[16])+"x "+string(dudes[16])+" "+string(dudes_vehicle[16]));*/ - - -/* */ -/* */ diff --git a/objects/obj_pnunit/Mouse_0.gml b/objects/obj_pnunit/Mouse_0.gml deleted file mode 100644 index 979c4297d0..0000000000 --- a/objects/obj_pnunit/Mouse_0.gml +++ /dev/null @@ -1,56 +0,0 @@ - -/*show_message("Engaged "+string(engaged)+" -"+string(dudes_num[1])+"x "+string(dudes[1])+" -"+string(dudes_num[2])+"x "+string(dudes[2])+" -"+string(dudes_num[3])+"x "+string(dudes[3])+" -"+string(dudes_num[4])+"x "+string(dudes[4])+" -"+string(dudes_num[5])+"x "+string(dudes[5])+" -"+string(dudes_num[6])+"x "+string(dudes[6])+" -"+string(dudes_num[7])+"x "+string(dudes[7])+" -"+string(dudes_num[8])+"x "+string(dudes[8])+" -"+string(dudes_num[9])+"x "+string(dudes[9])+" -"+string(dudes_num[10])+"x "+string(dudes[10])); -*/ - - -/*show_message("Engaged "+string(engaged)+" -"+string(wep_num[1])+"x "+string(wep[1])+": ATT"+string(att[1])+" ARP"+string(apa[1])+" solo:"+string(wep_solo[1])+" -"+string(wep_num[2])+"x "+string(wep[2])+": ATT"+string(att[2])+" ARP"+string(apa[2])+" solo:"+string(wep_solo[2])+" -"+string(wep_num[3])+"x "+string(wep[3])+": ATT"+string(att[3])+" ARP"+string(apa[3])+" solo:"+string(wep_solo[3])+" -"+string(wep_num[4])+"x "+string(wep[4])+": ATT"+string(att[4])+" ARP"+string(apa[4])+" solo:"+string(wep_solo[4])+" -"+string(wep_num[5])+"x "+string(wep[5])+": ATT"+string(att[5])+" ARP"+string(apa[5])+" solo:"+string(wep_solo[5])+" -"+string(wep_num[6])+"x "+string(wep[6])+": ATT"+string(att[6])+" ARP"+string(apa[6])+" solo:"+string(wep_solo[6])+" -"+string(wep_num[7])+"x "+string(wep[7])+": ATT"+string(att[7])+" ARP"+string(apa[7])+" solo:"+string(wep_solo[7])+" -"+string(wep_num[8])+"x "+string(wep[8])+": ATT"+string(att[8])+" ARP"+string(apa[8])+" solo:"+string(wep_solo[8])+" -"+string(wep_num[9])+"x "+string(wep[9])+": ATT"+string(att[9])+" ARP"+string(apa[9])+" solo:"+string(wep_solo[9])+" -"+string(wep_num[10])+"x "+string(wep[10])+": ATT"+string(att[10])+" ARP"+string(apa[10])+" solo:"+string(wep_solo[10])); - -*/ - -/*var blarg;blarg=wep; -show_message(blarg);*/ - - -/*show_message("Engaged "+string(engaged)+" -"+string(dudes_num[1])+"x "+string(dudes[1])+" -"+string(dudes_num[2])+"x "+string(dudes[2])+" -"+string(dudes_num[3])+"x "+string(dudes[3])+" -"+string(dudes_num[4])+"x "+string(dudes[4])+" -"+string(dudes_num[5])+"x "+string(dudes[5])+" -"+string(dudes_num[6])+"x "+string(dudes[6])+" -"+string(dudes_num[7])+"x "+string(dudes[7])+" -"+string(dudes_num[8])+"x "+string(dudes[8])+" -"+string(dudes_num[9])+"x "+string(dudes[9])+" -"+string(dudes_num[10])+"x "+string(dudes[10])+" -"+string(dudes_num[11])+"x "+string(dudes[11])+" -"+string(dudes_num[12])+"x "+string(dudes[12])+" -"+string(dudes_num[13])+"x "+string(dudes[13])+" -"+string(dudes_num[14])+"x "+string(dudes[14])+" -"+string(dudes_num[15])+"x "+string(dudes[15])+" -"+string(dudes_num[16])+"x "+string(dudes[16]));*/ - -var i=0; -repeat(50){i+=1; - if (marine_type[i]!="") then show_message(string(i)+", "+string(marine_type[i])+", HP: "+string(marine_hp[i])); -} - diff --git a/objects/obj_pnunit/obj_pnunit.yy b/objects/obj_pnunit/obj_pnunit.yy index 89cc44022f..50f5d2e782 100644 --- a/objects/obj_pnunit/obj_pnunit.yy +++ b/objects/obj_pnunit/obj_pnunit.yy @@ -3,7 +3,6 @@ "%Name":"obj_pnunit", "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":8,"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":3,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, From 110b3744be4e3e5fe3a4f53c932c907a8dfbcb94 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Fri, 11 Apr 2025 19:38:53 +0300 Subject: [PATCH 45/80] Format, because I can't see --- objects/obj_pnunit/Alarm_0.gml | 315 +++++++++++++++++++-------------- 1 file changed, 179 insertions(+), 136 deletions(-) diff --git a/objects/obj_pnunit/Alarm_0.gml b/objects/obj_pnunit/Alarm_0.gml index 7bddf72cc7..6bdfeeff6a 100644 --- a/objects/obj_pnunit/Alarm_0.gml +++ b/objects/obj_pnunit/Alarm_0.gml @@ -6,7 +6,6 @@ // scr_shoot try { - //* Buffs for (var i = 0; i < array_length(unit_struct); i++) { if (marine_mshield[i] > 0) { @@ -32,184 +31,228 @@ try { } } - if (instance_number(obj_enunit)!=1){ - obj_ncombat.flank_x=self.x; - with(obj_enunit){ - if (x<(obj_ncombat.flank_x-20)) then instance_deactivate_object(id); + if (instance_number(obj_enunit) != 1) { + obj_ncombat.flank_x = self.x; + with (obj_enunit) { + if (x < (obj_ncombat.flank_x - 20)) { + instance_deactivate_object(id); + } } } - enemy = instance_nearest(0,y,obj_enunit); + enemy = instance_nearest(0, y, obj_enunit); var enemy2 = enemy; - if (!instance_exists(enemy)) then exit; + if (!instance_exists(enemy)) { + exit; + } - if (obj_ncombat.dropping || (!obj_ncombat.defending && obj_ncombat.formation_set != 2)){ + if (obj_ncombat.dropping || (!obj_ncombat.defending && obj_ncombat.formation_set != 2)) { move_unit_block("east"); } - engaged = collision_point(x-10, y, obj_enunit, 0, 1) || collision_point(x+10, y, obj_enunit, 0, 1); - - var once_only=0; - var range_shoot=""; - var dist=point_distance(x,y,enemy.x,enemy.y)/10; - - for (var i=0;i=dist) { - 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[i] >= dist) { + if ((range[i] != 1) && (engaged == 0)) { + range_shoot = "ranged"; + } + if ((range[i] != floor(range[i]) || floor(range[i]) == 1) && engaged == 1) { + range_shoot = "melee"; + } } - - if (range_shoot="ranged") and (range[i]>=dist){// 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; - if (string_count("Lascan",wep[i])>0) then ap=1; - if (instance_number(obj_enunit)=1) and (obj_enunit.men=0) and (obj_enunit.veh>0) then ap=1; - - - if (instance_exists(enemy)){ - if (obj_enunit.veh>0) and (obj_enunit.men=0) and (apa[i]>10) then ap=1; - - if (ap=1) and (once_only=0){// Check for vehicles - var enemy2,g=0,good=0; - - if (enemy.veh>0){ - good=scr_target(enemy,"veh");// First target has vehicles, blow it to hell - scr_shoot(i,enemy,good,"arp","ranged"); + + if ((range_shoot == "ranged") && (range[i] >= dist)) { + // Weapon meets preliminary checks + var ap = 0; + if (apa[i] > att[i]) { + ap = 1; + } // Determines if it is AP or not + if (wep[i] == "Missile Launcher") { + ap = 1; + } + if (string_count("Lascan", wep[i]) > 0) { + ap = 1; + } + if ((instance_number(obj_enunit) == 1) && (obj_enunit.men == 0) && (obj_enunit.veh > 0)) { + ap = 1; + } + + if (instance_exists(enemy)) { + if ((obj_enunit.veh > 0) && (obj_enunit.men == 0) && (apa[i] > 10)) { + ap = 1; + } + + if ((ap == 1) && (once_only == 0)) { + // Check for vehicles + var enemy2, g = 0, good = 0; + + if (enemy.veh > 0) { + good = scr_target(enemy, "veh"); // First target has vehicles, blow it to hell + scr_shoot(i, enemy, good, "arp", "ranged"); } - if (good=0) and (instance_number(obj_enunit)>1){// First target does not have vehicles, cycle through objects to find one that has vehicles - var x2=enemy.x; - repeat(instance_number(obj_enunit)-1){ - if (good=0){ - x2+=10; - enemy2=instance_nearest(x2,y,obj_enunit); - if (enemy2.veh>0) and (good=0){ - good=scr_target(enemy2,"veh");// This target has vehicles, blow it to hell - scr_shoot(i,enemy2,good,"arp","ranged"); - once_only=1; + if ((good == 0) && (instance_number(obj_enunit) > 1)) { + // First target does not have vehicles, cycle through objects to find one that has vehicles + var x2 = enemy.x; + repeat (instance_number(obj_enunit) - 1) { + if (good == 0) { + x2 += 10; + enemy2 = instance_nearest(x2, y, obj_enunit); + if ((enemy2.veh > 0) && (good == 0)) { + good = scr_target(enemy2, "veh"); // This target has vehicles, blow it to hell + scr_shoot(i, enemy2, good, "arp", "ranged"); + once_only = 1; } } } } - if (good=0) then ap=0;// Fuck it, shoot at infantry + if (good == 0) { + ap = 0; + } // Fuck it, shoot at infantry } } - - - - - - - if (instance_exists(enemy)) and (once_only=0){ - if (enemy.medi>0) and (enemy.veh=0){ - good=scr_target(enemy,"medi");// First target has vehicles, blow it to hell - scr_shoot(i,enemy,good,"medi","ranged"); - - if (good=0) and (instance_number(obj_enunit)>1){// First target does not have vehicles, cycle through objects to find one that has vehicles - var x2=enemy.x; - repeat(instance_number(obj_enunit)-1){ - if (good=0){ - x2+=10;enemy2=instance_nearest(x2,y,obj_enunit); - if (enemy2.veh>0) and (good=0){ - good=scr_target(enemy2,"medi");// This target has vehicles, blow it to hell - scr_shoot(i,enemy2,good,"medi","ranged");once_only=1; + + if (instance_exists(enemy) && (once_only == 0)) { + if ((enemy.medi > 0) && (enemy.veh == 0)) { + good = scr_target(enemy, "medi"); // First target has vehicles, blow it to hell + scr_shoot(i, enemy, good, "medi", "ranged"); + + if ((good == 0) && (instance_number(obj_enunit) > 1)) { + // First target does not have vehicles, cycle through objects to find one that has vehicles + var x2 = enemy.x; + repeat (instance_number(obj_enunit) - 1) { + if (good == 0) { + x2 += 10; + enemy2 = instance_nearest(x2, y, obj_enunit); + if ((enemy2.veh > 0) && (good == 0)) { + good = scr_target(enemy2, "medi"); // This target has vehicles, blow it to hell + scr_shoot(i, enemy2, good, "medi", "ranged"); + once_only = 1; } } } } - if (good=0) then ap=0;// Next up is infantry + if (good == 0) { + ap = 0; + } // Next up is infantry // Was previously ap=1; } } - - - - - - if (instance_exists(enemy)){ - if (ap=0) and (once_only=0){// Check for men - var g,good,enemy2;g=0;good=0; - - if (enemy.men+enemy.medi>0){ - good=scr_target(enemy,"men");// First target has vehicles, blow it to hell - scr_shoot(i,enemy,good,"att","ranged"); + + if (instance_exists(enemy)) { + if ((ap == 0) && (once_only == 0)) { + // Check for men + var g, good, enemy2; + g = 0; + good = 0; + + if (enemy.men + enemy.medi > 0) { + good = scr_target(enemy, "men"); // First target has vehicles, blow it to hell + scr_shoot(i, enemy, good, "att", "ranged"); } - if (good=0) and (instance_number(obj_enunit)>1){// First target does not have vehicles, cycle through objects to find one that has vehicles - var x2;x2=enemy.x; - repeat(instance_number(obj_enunit)-1){ - if (good=0){ - x2+=10;enemy2=instance_nearest(x2,y,obj_enunit); - if (enemy2.men>0) and (good=0){ - good=scr_target(enemy2,"men");// This target has vehicles, blow it to hell - scr_shoot(i,enemy2,good,"att","ranged");once_only=1; + if ((good == 0) && (instance_number(obj_enunit) > 1)) { + // First target does not have vehicles, cycle through objects to find one that has vehicles + var x2; + x2 = enemy.x; + repeat (instance_number(obj_enunit) - 1) { + if (good == 0) { + x2 += 10; + enemy2 = instance_nearest(x2, y, obj_enunit); + if ((enemy2.men > 0) && (good == 0)) { + good = scr_target(enemy2, "men"); // This target has vehicles, blow it to hell + scr_shoot(i, enemy2, good, "att", "ranged"); + once_only = 1; } } } } } } - }else if (range_shoot="melee") and ((range[i]==1) or (range[i]!=floor(range[i]))){// Weapon meets preliminary checks - var ap=0; - if (apa[i]==1) then ap=1;// Determines if it is AP or not - - if (enemy.men=0) and (apa[i]=0) and (att[i]>=80){ - apa[i]=floor(att[i]/2);ap=1; + } else if ((range_shoot == "melee") && ((range[i] == 1) || (range[i] != floor(range[i])))) { + // Weapon meets preliminary checks + var ap = 0; + if (apa[i] == 1) { + ap = 1; + } // Determines if it is AP or not + + if ((enemy.men == 0) && (apa[i] == 0) && (att[i] >= 80)) { + apa[i] = floor(att[i] / 2); + ap = 1; } - - if (apa[i]==1) and (once_only=0){// Check for vehicles - var enemy2,g=0,good=0; - - if (enemy.veh>0){ - good=scr_target(enemy,"veh");// First target has vehicles, blow it to hell - if (range[i]=1) then scr_shoot(i,enemy,good,"arp","melee"); + + if ((apa[i] == 1) && (once_only == 0)) { + // Check for vehicles + var enemy2, g = 0, good = 0; + + if (enemy.veh > 0) { + good = scr_target(enemy, "veh"); // First target has vehicles, blow it to hell + if (range[i] == 1) { + scr_shoot(i, enemy, good, "arp", "melee"); + } + } + if (good != 0) { + once_only = 1; } - if (good!=0) then once_only=1; - if (good=0) and (att[i]>0) then ap=0;// Fuck it, shoot at infantry + if ((good == 0) && (att[i] > 0)) { + ap = 0; + } // Fuck it, shoot at infantry } - - if (enemy.veh=0) and (enemy.medi>0) and (once_only=0){// Check for vehicles - var enemy2,g=0,good=0; - - if (enemy.medi>0){ - good=scr_target(enemy,"medi");// First target has vehicles, blow it to hell - if (range[i]=1) then scr_shoot(i,enemy,good,"medi","melee"); + + if ((enemy.veh == 0) && (enemy.medi > 0) && (once_only == 0)) { + // Check for vehicles + var enemy2, g = 0, good = 0; + + if (enemy.medi > 0) { + good = scr_target(enemy, "medi"); // First target has vehicles, blow it to hell + if (range[i] == 1) { + scr_shoot(i, enemy, good, "medi", "melee"); + } + } + if (good != 0) { + once_only = 1; } - if (good!=0) then once_only=1; - if (good=0) and (att[i]>0) then ap=0;// Fuck it, shoot at infantry + if ((good == 0) && (att[i] > 0)) { + ap = 0; + } // Fuck it, shoot at infantry } - - - - if (ap=0) and (once_only=0){// Check for men - var g=0,good=0,enemy2; - - if (enemy.men>0) and (once_only=0){ + + if ((ap == 0) && (once_only == 0)) { + // Check for men + var g = 0, good = 0, enemy2; + + if ((enemy.men > 0) && (once_only == 0)) { // show_message(string(wep[i])+" attacking"); - good=scr_target(enemy,"men"); - if (range[i]=1) then scr_shoot(i,enemy,good,"att","melee"); + good = scr_target(enemy, "men"); + if (range[i] == 1) { + scr_shoot(i, enemy, good, "att", "melee"); + } + } + if (good != 0) { + once_only = 1; } - if (good!=0) then once_only=1; } } - - - } instance_activate_object(obj_enunit); @@ -224,4 +267,4 @@ try { } } catch (_exception) { handle_exception(_exception); -} \ No newline at end of file +} From b75cd28b0819f0d094bbb9be81f5bc6431145ae8 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Fri, 11 Apr 2025 19:47:41 +0300 Subject: [PATCH 46/80] Init hell arrays to be a bit more readable --- objects/obj_enunit/Create_0.gml | 77 ++++++++++++++++----------------- objects/obj_pnunit/Create_0.gml | 67 +++++++++++++--------------- 2 files changed, 68 insertions(+), 76 deletions(-) diff --git a/objects/obj_enunit/Create_0.gml b/objects/obj_enunit/Create_0.gml index c445a676fb..367d5b3970 100644 --- a/objects/obj_enunit/Create_0.gml +++ b/objects/obj_enunit/Create_0.gml @@ -44,46 +44,43 @@ averages=1; // x determines column; maybe every 10 or so? -var i;i=0; -i=0; -repeat(1001){i+=1; - wep[i]=""; - wep_num[i]=0; - range[i]=0; - att[i]=0; - apa[i]=0; - ammo_current[i]=0; - ammo_max[i]=-1; - ammo_reload_current[i]=-1; - ammo_reload[i]=-1; - splash[i]=0; - wep_owner[i]=""; - - dude_co[i]=0; - dude_id[i]=0; - - dudes[i]=""; - dudes_special[i]=""; - dudes_num[i]=0; - dudes_onum[i]=-1; - dudes_ac[i]=0; - dudes_hp[i]=0; - dudes_dr[i]=1; - dudes_vehicle[i]=0; - dudes_damage[i]=0; - dudes_exp[i]=0; - dudes_powers[i]=""; - faith[i]=0; - - dudes_attack[i]=1; - dudes_ranged[i]=1; - dudes_defense[i]=1; - - dudes_wep1[i]=""; - dudes_wep2[i]=""; - dudes_gear[i]=""; - dudges_mobi[i]=""; -} +var _enemy_size = 1002; +wep = array_create(_enemy_size, ""); +wep_num = array_create(_enemy_size, 0); +range = array_create(_enemy_size, 0); +att = array_create(_enemy_size, 0); +apa = array_create(_enemy_size, 0); +ammo_current = array_create(_enemy_size, 0); +ammo_max = array_create(_enemy_size, -1); +ammo_reload_current = array_create(_enemy_size, -1); +ammo_reload = array_create(_enemy_size, -1); +splash = array_create(_enemy_size, 0); +wep_owner = array_create(_enemy_size, ""); + +dude_co = array_create(_enemy_size, 0); +dude_id = array_create(_enemy_size, 0); + +dudes = array_create(_enemy_size, ""); +dudes_special = array_create(_enemy_size, ""); +dudes_num = array_create(_enemy_size, 0); +dudes_onum = array_create(_enemy_size, -1); +dudes_ac = array_create(_enemy_size, 0); +dudes_hp = array_create(_enemy_size, 0); +dudes_dr = array_create(_enemy_size, 1); +dudes_vehicle = array_create(_enemy_size, 0); +dudes_damage = array_create(_enemy_size, 0); +dudes_exp = array_create(_enemy_size, 0); +dudes_powers = array_create(_enemy_size, ""); +faith = array_create(_enemy_size, 0); + +dudes_attack = array_create(_enemy_size, 1); +dudes_ranged = array_create(_enemy_size, 1); +dudes_defense = array_create(_enemy_size, 1); + +dudes_wep1 = array_create(_enemy_size, ""); +dudes_wep2 = array_create(_enemy_size, ""); +dudes_gear = array_create(_enemy_size, ""); +dudges_mobi = array_create(_enemy_size, ""); alarm[1]=5; alarm[5]=6; diff --git a/objects/obj_pnunit/Create_0.gml b/objects/obj_pnunit/Create_0.gml index 51cdfa8a57..28b0d8b4b5 100644 --- a/objects/obj_pnunit/Create_0.gml +++ b/objects/obj_pnunit/Create_0.gml @@ -67,44 +67,39 @@ marine_dome=[]; marine_spatial=[]; marine_dementia=[]; -var i;i=-1; -repeat(1500){i+=1; - // - veh_co[i]=0; - veh_id[i]=0; - veh_type[i]=""; - veh_hp[i]=0; - veh_ac[i]=0; - veh_wep1[i]=""; - veh_wep2[i]=""; - veh_wep3[i]=""; - veh_upgrade[i]=""; - veh_acc[i]=""; - veh_dead[i]=0; - veh_local[i]=0; - veh_ally[i]=false; -} +var _vehicles_size = 1500; +veh_co = array_create(_vehicles_size, 0); +veh_id = array_create(_vehicles_size, 0); +veh_type = array_create(_vehicles_size, ""); +veh_hp = array_create(_vehicles_size, 0); +veh_ac = array_create(_vehicles_size, 0); +veh_wep1 = array_create(_vehicles_size, ""); +veh_wep2 = array_create(_vehicles_size, ""); +veh_wep3 = array_create(_vehicles_size, ""); +veh_upgrade = array_create(_vehicles_size, ""); +veh_acc = array_create(_vehicles_size, ""); +veh_dead = array_create(_vehicles_size, 0); +veh_local = array_create(_vehicles_size, 0); +veh_ally = array_create(_vehicles_size, false); -i=-1; -repeat(71){i+=1; - wep[i]=""; - wep_num[i]=0; - range[i]=0; - att[i]=0; - apa[i]=0; - ammo_current[i]=0; - ammo_max[i]=-1; - ammo_reload_current[i]=-1; - ammo_reload[i]=-1; - splash[i]=0; - wep_owner[i]=""; - wep_solo[i]=[]; - wep_title[i]=""; +var _dudes_size = 72; +wep = array_create(_dudes_size, ""); +wep_num = array_create(_dudes_size, 0); +range = array_create(_dudes_size, 0); +att = array_create(_dudes_size, 0); +apa = array_create(_dudes_size, 0); +ammo_current = array_create(_dudes_size, 0); +ammo_max = array_create(_dudes_size, -1); +ammo_reload_current = array_create(_dudes_size, -1); +ammo_reload = array_create(_dudes_size, -1); +splash = array_create(_dudes_size, 0); +wep_owner = array_create(_dudes_size, ""); +wep_solo = array_create(_dudes_size, []); +wep_title = array_create(_dudes_size, ""); +dudes = array_create(_dudes_size, ""); +dudes_num = array_create(_dudes_size, 0); +dudes_vehicle = array_create(_dudes_size, 0); - dudes[i]=""; - dudes_num[i]=0; - dudes_vehicle[i]=0; -} // These arrays are the losses on any one frame. // Let them resize as required. From de7e82048bdc007182549e271123188aaef9afce Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Fri, 11 Apr 2025 19:54:28 +0300 Subject: [PATCH 47/80] Format enunit --- objects/obj_enunit/Alarm_0.gml | 64 ++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/objects/obj_enunit/Alarm_0.gml b/objects/obj_enunit/Alarm_0.gml index 06cd65ebf6..b58470b574 100644 --- a/objects/obj_enunit/Alarm_0.gml +++ b/objects/obj_enunit/Alarm_0.gml @@ -15,45 +15,46 @@ var target_unit_index = 0; var enemy2 = enemy; //In melee check -engaged = collision_point(x-10, y, obj_pnunit, 0, 1) || collision_point(x+10, y, obj_pnunit, 0, 1); +engaged = collision_point(x - 10, y, obj_pnunit, 0, 1) || collision_point(x + 10, y, obj_pnunit, 0, 1); // show_debug_message($"enemy is in melee {engaged}") if (DEBUG_COLUMN_PRIORITY) { var _t_start1 = get_timer(); } -if (!engaged){ // Shooting - for (var i=0;i= dist) { - var _target_type = apa[i] > 8 ? "arp" : "att"; - var _weapon_type = "ranged"; + var _target_type = apa[i] > 8 ? "arp" : "att"; + var _weapon_type = "ranged"; var _target_priority_queue = ds_priority_create(); - + // Alpha strike override if (obj_ncombat.alpha_strike > 0) { obj_ncombat.alpha_strike -= 0.5; @@ -70,7 +71,7 @@ if (!engaged){ // Shooting if (DEBUG_COLUMN_PRIORITY) { var _t_start = get_timer(); } - + // Scan potential targets var _check_targets = []; with (obj_pnunit) { @@ -79,28 +80,28 @@ if (!engaged){ // Shooting } array_push(_check_targets, self.id); } - + if (DEBUG_COLUMN_PRIORITY) { show_debug_message($"{wep[i]} IS HERE!"); } for (var t = 0; t < array_length(_check_targets); t++) { var enemy_block = _check_targets[t]; - + var _distance = get_block_distance(enemy_block); if (_distance > range[i]) { continue; } - + // Distance weight (closer = higher priority) var _distance_bonus = (range[i] - _distance - 1) * 20; - + // Column size influence (bigger columns = higher threat?) var _doomstack_malus = wep_num[i] / enemy_block.column_size; // Column size influence (bigger columns = higher threat?) var _size_bonus = enemy_block.column_size / 10; - + // Target type match bonus var _type_bonus = 0; if (_target_type == "arp") { @@ -121,7 +122,7 @@ if (!engaged){ // Shooting } ds_priority_add(_target_priority_queue, enemy_block, priority); } - + // Add fort as fallback target var fort = instance_nearest(x, y, obj_nfort); if (fort != noone && !flank) { @@ -131,7 +132,7 @@ if (!engaged){ // Shooting ds_priority_add(_target_priority_queue, fort, fort_priority); } } - + if (DEBUG_COLUMN_PRIORITY) { var _t_end = get_timer(); var _elapsed_ms = (_t_end - _t_start) / 1000; @@ -141,10 +142,10 @@ if (!engaged){ // Shooting // Shoot highest-priority target if (!ds_priority_empty(_target_priority_queue)) { var best_target = ds_priority_delete_max(_target_priority_queue); - var is_fort = (best_target.object_index == obj_nfort); + var is_fort = best_target.object_index == obj_nfort; var _shoot_type = is_fort ? "wall" : _weapon_type; var unit_index = is_fort ? 1 : target_unit_index; - + scr_shoot(i, best_target, unit_index, _target_type, "ranged"); } else { log_error($"{wep[i]} didn't find a valid target! This shouldn't happen!"); @@ -152,13 +153,13 @@ if (!engaged){ // Shooting show_debug_message($"We didn't find a valid target! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}"); } } - + ds_priority_destroy(_target_priority_queue); } else { if (DEBUG_COLUMN_PRIORITY) { show_debug_message($"I can't shoot, my range is too small! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}"); } - continue; + continue; } } } @@ -170,9 +171,10 @@ if (DEBUG_COLUMN_PRIORITY) { } //TODO: The melee code was not refactored; -if (engaged) { // Melee +if (engaged) { + // Melee for (var i = 0; i < array_length(wep); i++) { - if (wep[i]=="" || wep_num[i]==0) { + if (wep[i] == "" || wep_num[i] == 0) { continue; } @@ -181,15 +183,15 @@ if (engaged) { // Melee continue; } - if ((range[i]==0)) { + if (range[i] == 0) { log_error($"{wep[i]} has broken range! This shouldn't happen! Range: {range[i]}; Ammo: {ammo[i]}; Owner: {wep_owner[i]}"); // show_debug_message($"A broken weapon was found! i:{i}; Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}; Ammo: {ammo[i]}"); continue; } - if (!target_block_is_valid(enemy,obj_pnunit)){ + if (!target_block_is_valid(enemy, obj_pnunit)) { enemy = flank == 0 ? get_rightmost() : get_leftmost(); - if (!target_block_is_valid(enemy,obj_pnunit)){ + if (!target_block_is_valid(enemy, obj_pnunit)) { exit; } } @@ -207,4 +209,4 @@ if (engaged) { // Melee instance_activate_object(obj_pnunit); -//! Here was some stuff that depended on image_index here, that got deleted, because I couldn't figure out why it exists; +//! Here was some stuff that depended on image_index here, that got deleted, because I couldn't figure out why it exists; From ad6997235a156b449ce1621269c09bb6f4c9016f Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Fri, 11 Apr 2025 20:43:55 +0300 Subject: [PATCH 48/80] Some bits --- objects/obj_enunit/Alarm_0.gml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/objects/obj_enunit/Alarm_0.gml b/objects/obj_enunit/Alarm_0.gml index b58470b574..2d11004219 100644 --- a/objects/obj_enunit/Alarm_0.gml +++ b/objects/obj_enunit/Alarm_0.gml @@ -12,7 +12,6 @@ if (enemy == "none") { } var target_unit_index = 0; -var enemy2 = enemy; //In melee check engaged = collision_point(x - 10, y, obj_pnunit, 0, 1) || collision_point(x + 10, y, obj_pnunit, 0, 1); @@ -146,7 +145,7 @@ if (!engaged) { var _shoot_type = is_fort ? "wall" : _weapon_type; var unit_index = is_fort ? 1 : target_unit_index; - scr_shoot(i, best_target, unit_index, _target_type, "ranged"); + scr_shoot(i, best_target, unit_index, _target_type, _shoot_type); } else { log_error($"{wep[i]} didn't find a valid target! This shouldn't happen!"); if (DEBUG_COLUMN_PRIORITY) { From 95eb18e2fd9b7a10e3e34778b0b6ec874cf1a77c Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Fri, 11 Apr 2025 20:44:38 +0300 Subject: [PATCH 49/80] Copy paste column targeting to player and refactor unit target selection --- objects/obj_pnunit/Alarm_0.gml | 340 +++++++++++++----------------- scripts/scr_shoot/scr_shoot.gml | 18 +- scripts/scr_target/scr_target.gml | 89 ++------ 3 files changed, 168 insertions(+), 279 deletions(-) diff --git a/objects/obj_pnunit/Alarm_0.gml b/objects/obj_pnunit/Alarm_0.gml index 6bdfeeff6a..582c69f7ad 100644 --- a/objects/obj_pnunit/Alarm_0.gml +++ b/objects/obj_pnunit/Alarm_0.gml @@ -31,21 +31,11 @@ try { } } - if (instance_number(obj_enunit) != 1) { - obj_ncombat.flank_x = self.x; - with (obj_enunit) { - if (x < (obj_ncombat.flank_x - 20)) { - instance_deactivate_object(id); - } - } + if (!instance_exists(obj_enunit)) { + exit; } enemy = instance_nearest(0, y, obj_enunit); - var enemy2 = enemy; - - if (!instance_exists(enemy)) { - exit; - } if (obj_ncombat.dropping || (!obj_ncombat.defending && obj_ncombat.formation_set != 2)) { move_unit_block("east"); @@ -53,218 +43,172 @@ try { engaged = collision_point(x - 10, y, obj_enunit, 0, 1) || collision_point(x + 10, y, obj_enunit, 0, 1); - var once_only = 0; - var range_shoot = ""; - var dist = point_distance(x, y, enemy.x, enemy.y) / 10; + if (DEBUG_COLUMN_PRIORITY) { + var _t_start1 = get_timer(); + } - for (var i = 0; i < array_length(wep); i++) { - if (wep[i] == "") { - continue; - } - weapon_data = gear_weapon_data("weapon", wep[i]); - once_only = 0; - enemy = instance_nearest(0, y, obj_enunit); - enemy2 = enemy; - if (enemy.men + enemy.veh + enemy.medi <= 0) { - var x5 = enemy.x; - with (enemy) { - instance_destroy(); + if (!engaged) { + for (var i = 0; i < array_length(unit_struct); i++) { + if (marine_dead[i] == 0 && marine_casting[i] == true) { + var caster_id = i; + scr_powers(caster_id); + exit; } - enemy = instance_nearest(0, y, obj_enunit); - enemy2 = enemy; } - if (range[i] >= dist) { - if ((range[i] != 1) && (engaged == 0)) { - range_shoot = "ranged"; - } - if ((range[i] != floor(range[i]) || floor(range[i]) == 1) && engaged == 1) { - range_shoot = "melee"; + // Shooting + for (var i = 0; i < array_length(wep); i++) { + if (wep[i] == "" || wep_num[i] == 0) { + continue; } - } - - if ((range_shoot == "ranged") && (range[i] >= dist)) { - // Weapon meets preliminary checks - var ap = 0; - if (apa[i] > att[i]) { - ap = 1; - } // Determines if it is AP or not - if (wep[i] == "Missile Launcher") { - ap = 1; + + if (range[i] == 1) { + // show_debug_message($"A melee or no ammo weapon was found! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}; Ammo: {ammo[i]}"); + continue; } - if (string_count("Lascan", wep[i]) > 0) { - ap = 1; + + if (range[i] == 0) { + log_error($"{wep[i]} has broken range! This shouldn't happen! Range: {range[i]}; Ammo: {ammo[i]}; Owner: {wep_owner[i]}"); + // show_debug_message($"A broken weapon was found! i:{i}; Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}; Ammo: {ammo[i]}"); + continue; } - if ((instance_number(obj_enunit) == 1) && (obj_enunit.men == 0) && (obj_enunit.veh > 0)) { - ap = 1; + + if (!target_block_is_valid(enemy, obj_enunit)) { + enemy = instance_nearest(0, y, obj_enunit); + if (!target_block_is_valid(enemy, obj_enunit)) { + exit; + } } - - if (instance_exists(enemy)) { - if ((obj_enunit.veh > 0) && (obj_enunit.men == 0) && (apa[i] > 10)) { - ap = 1; + + var dist = get_block_distance(enemy); + + if (range[i] >= dist) { + var _target_type = apa[i] > 8 ? "arp" : "att"; + var _weapon_type = "ranged"; + var _target_priority_queue = ds_priority_create(); + + if (DEBUG_COLUMN_PRIORITY) { + var _t_start = get_timer(); } - - if ((ap == 1) && (once_only == 0)) { - // Check for vehicles - var enemy2, g = 0, good = 0; - - if (enemy.veh > 0) { - good = scr_target(enemy, "veh"); // First target has vehicles, blow it to hell - scr_shoot(i, enemy, good, "arp", "ranged"); - } - if ((good == 0) && (instance_number(obj_enunit) > 1)) { - // First target does not have vehicles, cycle through objects to find one that has vehicles - var x2 = enemy.x; - repeat (instance_number(obj_enunit) - 1) { - if (good == 0) { - x2 += 10; - enemy2 = instance_nearest(x2, y, obj_enunit); - if ((enemy2.veh > 0) && (good == 0)) { - good = scr_target(enemy2, "veh"); // This target has vehicles, blow it to hell - scr_shoot(i, enemy2, good, "arp", "ranged"); - once_only = 1; - } - } - } + + // Scan potential targets + var _check_targets = []; + with (obj_enunit) { + if (!target_block_is_valid(self, obj_enunit)) { + continue; } - if (good == 0) { - ap = 0; - } // Fuck it, shoot at infantry + array_push(_check_targets, self.id); } - } - - if (instance_exists(enemy) && (once_only == 0)) { - if ((enemy.medi > 0) && (enemy.veh == 0)) { - good = scr_target(enemy, "medi"); // First target has vehicles, blow it to hell - scr_shoot(i, enemy, good, "medi", "ranged"); - - if ((good == 0) && (instance_number(obj_enunit) > 1)) { - // First target does not have vehicles, cycle through objects to find one that has vehicles - var x2 = enemy.x; - repeat (instance_number(obj_enunit) - 1) { - if (good == 0) { - x2 += 10; - enemy2 = instance_nearest(x2, y, obj_enunit); - if ((enemy2.veh > 0) && (good == 0)) { - good = scr_target(enemy2, "medi"); // This target has vehicles, blow it to hell - scr_shoot(i, enemy2, good, "medi", "ranged"); - once_only = 1; - } - } - } - } - if (good == 0) { - ap = 0; - } // Next up is infantry - // Was previously ap=1; + + if (DEBUG_COLUMN_PRIORITY) { + show_debug_message($"{wep[i]} IS HERE!"); } - } - - if (instance_exists(enemy)) { - if ((ap == 0) && (once_only == 0)) { - // Check for men - var g, good, enemy2; - g = 0; - good = 0; - - if (enemy.men + enemy.medi > 0) { - good = scr_target(enemy, "men"); // First target has vehicles, blow it to hell - scr_shoot(i, enemy, good, "att", "ranged"); + + for (var t = 0; t < array_length(_check_targets); t++) { + var enemy_block = _check_targets[t]; + + var _distance = get_block_distance(enemy_block); + if (_distance > range[i]) { + continue; } - if ((good == 0) && (instance_number(obj_enunit) > 1)) { - // First target does not have vehicles, cycle through objects to find one that has vehicles - var x2; - x2 = enemy.x; - repeat (instance_number(obj_enunit) - 1) { - if (good == 0) { - x2 += 10; - enemy2 = instance_nearest(x2, y, obj_enunit); - if ((enemy2.men > 0) && (good == 0)) { - good = scr_target(enemy2, "men"); // This target has vehicles, blow it to hell - scr_shoot(i, enemy2, good, "att", "ranged"); - once_only = 1; - } - } - } + + // Distance weight (closer = higher priority) + var _distance_bonus = (range[i] - _distance - 1) * 20; + + // Column size influence (bigger columns = higher threat?) + var _doomstack_malus = wep_num[i] / enemy_block.column_size; + + // Column size influence (bigger columns = higher threat?) + var _size_bonus = enemy_block.column_size / 10; + + // Target type match bonus + var _type_bonus = 0; + if (_target_type == "arp") { + _type_bonus = 20 * (block_type_size(enemy_block, "armour") / enemy_block.column_size); + } else if (_target_type == "att") { + _type_bonus = 20 * (block_type_size(enemy_block, "men") / enemy_block.column_size); } - } - } - } else if ((range_shoot == "melee") && ((range[i] == 1) || (range[i] != floor(range[i])))) { - // Weapon meets preliminary checks - var ap = 0; - if (apa[i] == 1) { - ap = 1; - } // Determines if it is AP or not - - if ((enemy.men == 0) && (apa[i] == 0) && (att[i] >= 80)) { - apa[i] = floor(att[i] / 2); - ap = 1; - } - - if ((apa[i] == 1) && (once_only == 0)) { - // Check for vehicles - var enemy2, g = 0, good = 0; - - if (enemy.veh > 0) { - good = scr_target(enemy, "veh"); // First target has vehicles, blow it to hell - if (range[i] == 1) { - scr_shoot(i, enemy, good, "arp", "melee"); - } - } - if (good != 0) { - once_only = 1; - } - if ((good == 0) && (att[i] > 0)) { - ap = 0; - } // Fuck it, shoot at infantry - } - - if ((enemy.veh == 0) && (enemy.medi > 0) && (once_only == 0)) { - // Check for vehicles - var enemy2, g = 0, good = 0; - - if (enemy.medi > 0) { - good = scr_target(enemy, "medi"); // First target has vehicles, blow it to hell - if (range[i] == 1) { - scr_shoot(i, enemy, good, "medi", "melee"); + + var priority = 0; + priority += _type_bonus; + priority += _size_bonus; + priority -= _doomstack_malus; + priority += _distance_bonus; + priority *= random_range(0.5, 1.5); + + if (DEBUG_COLUMN_PRIORITY) { + show_debug_message($"Priority: {priority}\n Type: +{_type_bonus}\n Size: +{_size_bonus}\n Doomstack: -{_doomstack_malus}\n Distance: +{_distance_bonus}\n"); } + ds_priority_add(_target_priority_queue, enemy_block, priority); } - if (good != 0) { - once_only = 1; + + if (DEBUG_COLUMN_PRIORITY) { + var _t_end = get_timer(); + var _elapsed_ms = (_t_end - _t_start) / 1000; + show_debug_message($"⏱️ Execution Time: {_elapsed_ms}ms"); } - if ((good == 0) && (att[i] > 0)) { - ap = 0; - } // Fuck it, shoot at infantry - } - - if ((ap == 0) && (once_only == 0)) { - // Check for men - var g = 0, good = 0, enemy2; - - if ((enemy.men > 0) && (once_only == 0)) { - // show_message(string(wep[i])+" attacking"); - good = scr_target(enemy, "men"); - if (range[i] == 1) { - scr_shoot(i, enemy, good, "att", "melee"); + + // Shoot highest-priority target + if (!ds_priority_empty(_target_priority_queue)) { + var best_target = ds_priority_delete_max(_target_priority_queue); + var unit_index = 0; + + scr_shoot(i, best_target, unit_index, _target_type, _weapon_type); + } else { + log_error($"{wep[i]} didn't find a valid target! This shouldn't happen!"); + if (DEBUG_COLUMN_PRIORITY) { + show_debug_message($"We didn't find a valid target! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}"); } } - if (good != 0) { - once_only = 1; + + ds_priority_destroy(_target_priority_queue); + } else { + if (DEBUG_COLUMN_PRIORITY) { + show_debug_message($"I can't shoot, my range is too small! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}"); } + continue; } } } - - instance_activate_object(obj_enunit); - - if (instance_exists(obj_enunit)) { - for (var i = 0; i < array_length(unit_struct); i++) { - if (marine_dead[i] == 0 && marine_casting[i] == true) { - var caster_id = i; - scr_powers(caster_id); + + if (DEBUG_COLUMN_PRIORITY) { + var _t_end1 = get_timer(); + var _elapsed_ms1 = (_t_end1 - _t_start1) / 1000; + show_debug_message($"⏱️ Ranged Alarm Execution Time: {_elapsed_ms1}ms"); + } + + //TODO: The melee code was not refactored; + if (engaged) { + // Melee + for (var i = 0; i < array_length(wep); i++) { + if (wep[i] == "" || wep_num[i] == 0) { + continue; + } + + if (range[i] >= 2) { + // show_debug_message($"A melee or no ammo weapon was found! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}; Ammo: {ammo[i]}"); + continue; + } + + if (range[i] == 0) { + log_error($"{wep[i]} has broken range! This shouldn't happen! Range: {range[i]}; Ammo: {ammo[i]}; Owner: {wep_owner[i]}"); + // show_debug_message($"A broken weapon was found! i:{i}; Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}; Ammo: {ammo[i]}"); + continue; } + + if (!target_block_is_valid(enemy, obj_enunit)) { + enemy = instance_nearest(0, y, obj_enunit); + if (!target_block_is_valid(enemy, obj_enunit)) { + exit; + } + } + + var _attack_type = apa[i] > 8 ? "arp" : "att"; + scr_shoot(i, enemy, 0, _attack_type, "melee"); } } + + instance_activate_object(obj_enunit); } catch (_exception) { handle_exception(_exception); } diff --git a/scripts/scr_shoot/scr_shoot.gml b/scripts/scr_shoot/scr_shoot.gml index 76141f2d5d..8a93724f4a 100644 --- a/scripts/scr_shoot/scr_shoot.gml +++ b/scripts/scr_shoot/scr_shoot.gml @@ -145,20 +145,12 @@ function scr_shoot(weapon_index_position, target_object, target_index, target_ty //* Player shooting if (owner == eFACTION.Player) { - if (target_object.dudes_hp[target_index] <= 0) { - target_index = -1; - for (var i = 0, dudes_len = array_length(target_object.dudes); i < dudes_len; i++) { - if (target_object.dudes_hp[i] > 0) { - target_index = i; - break; - } - } - if (target_index == -1) { - if (DEBUG_PLAYER_TARGET_SELECTION) { - show_debug_message($"{_weapon_name} found no valid targets in the enemy column to attack!"); - } - exit; + target_index = scr_target(target_object, _weapon_damage_type); + if (target_index == -1) { + if (DEBUG_PLAYER_TARGET_SELECTION) { + show_debug_message($"{_weapon_name} found no valid targets in the enemy column to attack!"); } + exit; } if (DEBUG_PLAYER_TARGET_SELECTION) { diff --git a/scripts/scr_target/scr_target.gml b/scripts/scr_target/scr_target.gml index 66668a2335..08d1489bf6 100644 --- a/scripts/scr_target/scr_target.gml +++ b/scripts/scr_target/scr_target.gml @@ -1,75 +1,28 @@ function scr_target(battle_block, man_or_vehicle) { - - - - // battle_block : instance - // man_or_vehicle : "veh" or "men" - - // This naughty, sexy code is used to return a target for a battle block's any particular weapon - - // wih(ob_ennit){showmeage("targ#"+string(dudes[1])+"|"+string(dudes_num[1])+"|"+string(men+medi)+"|"+string(dudes_hp[1]));} - - - var final_target=0; - - repeat(1){ - if (final_target=0){ - var target_num,target_id,target_min,target_max; - var targets=0,roll=0,dice=0; - var valid=false; - - var f=-1; - repeat(31){f+=1; - target_num[f]=0; - target_id[f]=0; - target_min[f]=0; - target_max[f]=0; - } - - f=0; - - for (f=1;f<=30;f++){ - valid=false; - if (battle_block.dudes[f]=="") then continue; - if (man_or_vehicle="veh"){ - if (battle_block.dudes_vehicle[f]==1){ - valid=true; - } - }else if (man_or_vehicle="men"){ - if (battle_block.dudes_vehicle[f]==0){ - valid=true; - } - } else if (man_or_vehicle="medi") and (battle_block.dudes_vehicle[f]=1 || battle_block.dudes_vehicle[f]=0){ - valid = true; - } - if (valid){ - targets+=1; - target_id[targets]=f; - target_num[targets]=battle_block.dudes_num[f]; - dice+=target_num[targets]; - target_max[targets]=dice; - if (targets=1) then target_min[targets]=0; - if (targets>1){ - target_min[targets]=target_max[targets-1]+1; - } - } - } - - roll=floor(random(dice))+1; - f=0; - repeat(targets){f+=1; - if (roll>=target_min[f]) and (roll<=target_max[f]) and (final_target=0){ - final_target=f; - break; - } - } - } + var _biggest_target = -1; + var _priority_queue = ds_priority_create(); + var _target; + + if (man_or_vehicle == "arp"){ + _target = 1; + }else if (man_or_vehicle == "att"){ + _target = 0; + } else { + _target = -1; } - if (final_target!=0) then return(final_target); - if (final_target=0){ - return(1); + for (var i = 0, dudes_len = array_length(battle_block.dudes); i < dudes_len; i++) { + if (battle_block.dudes_hp[i] <= 0 || battle_block.dudes[i] == "") { + continue; + } + + if (_target == -1 || battle_block.dudes_vehicle[i] == _target) { + ds_priority_add(_priority_queue, i, battle_block.dudes_num[i]); + } } + _biggest_target = ds_priority_delete_max(_priority_queue); + ds_priority_destroy(_priority_queue); + return _biggest_target; } From 322d70221755d938afd670b5ddc113374094f141 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Sat, 12 Apr 2025 14:43:53 +0300 Subject: [PATCH 50/80] More shit --- objects/obj_enunit/Alarm_0.gml | 34 ++++---- objects/obj_pnunit/Alarm_0.gml | 44 +++------- scripts/scr_clean/scr_clean.gml | 81 ++++++++++--------- .../scr_player_combat_weapon_stacks.gml | 27 ++++++- scripts/scr_shoot/scr_shoot.gml | 4 +- scripts/scr_target/scr_target.gml | 24 +++--- 6 files changed, 112 insertions(+), 102 deletions(-) diff --git a/objects/obj_enunit/Alarm_0.gml b/objects/obj_enunit/Alarm_0.gml index 2d11004219..5e13dc8a5d 100644 --- a/objects/obj_enunit/Alarm_0.gml +++ b/objects/obj_enunit/Alarm_0.gml @@ -1,4 +1,4 @@ -#macro DEBUG_COLUMN_PRIORITY false +#macro DEBUG_COLUMN_PRIORITY_ENEMY false //* This alarm is responsible for the enemy target column selection; @@ -6,7 +6,9 @@ if (!instance_exists(obj_pnunit)) { exit; } -enemy = flank ? get_leftmost() : get_rightmost(); +var _block_direction = flank ? get_rightmost : get_leftmost; + +enemy = _block_direction(); if (enemy == "none") { exit; } @@ -17,7 +19,7 @@ var target_unit_index = 0; engaged = collision_point(x - 10, y, obj_pnunit, 0, 1) || collision_point(x + 10, y, obj_pnunit, 0, 1); // show_debug_message($"enemy is in melee {engaged}") -if (DEBUG_COLUMN_PRIORITY) { +if (DEBUG_COLUMN_PRIORITY_ENEMY) { var _t_start1 = get_timer(); } @@ -40,7 +42,7 @@ if (!engaged) { } if (!target_block_is_valid(enemy, obj_pnunit)) { - enemy = flank == 0 ? get_rightmost() : get_leftmost(); + enemy = _block_direction(); if (!target_block_is_valid(enemy, obj_pnunit)) { exit; } @@ -67,7 +69,7 @@ if (!engaged) { } } - if (DEBUG_COLUMN_PRIORITY) { + if (DEBUG_COLUMN_PRIORITY_ENEMY) { var _t_start = get_timer(); } @@ -80,7 +82,7 @@ if (!engaged) { array_push(_check_targets, self.id); } - if (DEBUG_COLUMN_PRIORITY) { + if (DEBUG_COLUMN_PRIORITY_ENEMY) { show_debug_message($"{wep[i]} IS HERE!"); } @@ -116,7 +118,7 @@ if (!engaged) { priority += _distance_bonus; priority *= random_range(0.5, 1.5); - if (DEBUG_COLUMN_PRIORITY) { + if (DEBUG_COLUMN_PRIORITY_ENEMY) { show_debug_message($"Priority: {priority}\n Type: +{_type_bonus}\n Size: +{_size_bonus}\n Doomstack: -{_doomstack_malus}\n Distance: +{_distance_bonus}\n"); } ds_priority_add(_target_priority_queue, enemy_block, priority); @@ -132,7 +134,7 @@ if (!engaged) { } } - if (DEBUG_COLUMN_PRIORITY) { + if (DEBUG_COLUMN_PRIORITY_ENEMY) { var _t_end = get_timer(); var _elapsed_ms = (_t_end - _t_start) / 1000; show_debug_message($"⏱️ Execution Time: {_elapsed_ms}ms"); @@ -148,14 +150,14 @@ if (!engaged) { scr_shoot(i, best_target, unit_index, _target_type, _shoot_type); } else { log_error($"{wep[i]} didn't find a valid target! This shouldn't happen!"); - if (DEBUG_COLUMN_PRIORITY) { + if (DEBUG_COLUMN_PRIORITY_ENEMY) { show_debug_message($"We didn't find a valid target! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}"); } } ds_priority_destroy(_target_priority_queue); } else { - if (DEBUG_COLUMN_PRIORITY) { + if (DEBUG_COLUMN_PRIORITY_ENEMY) { show_debug_message($"I can't shoot, my range is too small! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}"); } continue; @@ -163,7 +165,7 @@ if (!engaged) { } } -if (DEBUG_COLUMN_PRIORITY) { +if (DEBUG_COLUMN_PRIORITY_ENEMY) { var _t_end1 = get_timer(); var _elapsed_ms1 = (_t_end1 - _t_start1) / 1000; show_debug_message($"⏱️ Ranged Alarm Execution Time: {_elapsed_ms1}ms"); @@ -189,20 +191,22 @@ if (engaged) { } if (!target_block_is_valid(enemy, obj_pnunit)) { - enemy = flank == 0 ? get_rightmost() : get_leftmost(); + log_error($"One invalid player block was found!"); + enemy = _block_direction(); if (!target_block_is_valid(enemy, obj_pnunit)) { + log_error($"A second invalid player block was found!"); exit; } } - + if (instance_exists(obj_nfort) && (!flank)) { enemy = instance_nearest(x, y, obj_nfort); - scr_shoot(i, enemy, 1, "arp", "wall"); + scr_shoot(i, enemy, 0, "arp", "wall"); continue; } var _attack_type = apa[i] > 8 ? "arp" : "att"; - scr_shoot(i, enemy, 1, _attack_type, "melee"); + scr_shoot(i, enemy, 0, _attack_type, "melee"); } } diff --git a/objects/obj_pnunit/Alarm_0.gml b/objects/obj_pnunit/Alarm_0.gml index 582c69f7ad..777c98ae35 100644 --- a/objects/obj_pnunit/Alarm_0.gml +++ b/objects/obj_pnunit/Alarm_0.gml @@ -1,3 +1,5 @@ +#macro DEBUG_COLUMN_PRIORITY_PLAYER true + // Useful functions: // scr_target // get_rightmost @@ -6,31 +8,6 @@ // scr_shoot try { - //* Buffs - for (var i = 0; i < array_length(unit_struct); i++) { - if (marine_mshield[i] > 0) { - marine_mshield[i] -= 1; - } - if (marine_quick[i] > 0) { - marine_quick[i] -= 1; - } - if (marine_might[i] > 0) { - marine_might[i] -= 1; - } - if (marine_fiery[i] > 0) { - marine_fiery[i] -= 1; - } - if (marine_fshield[i] > 0) { - marine_fshield[i] -= 1; - } - if (marine_dome[i] > 0) { - marine_dome[i] -= 1; - } - if (marine_spatial[i] > 0) { - marine_spatial[i] -= 1; - } - } - if (!instance_exists(obj_enunit)) { exit; } @@ -43,7 +20,7 @@ try { engaged = collision_point(x - 10, y, obj_enunit, 0, 1) || collision_point(x + 10, y, obj_enunit, 0, 1); - if (DEBUG_COLUMN_PRIORITY) { + if (DEBUG_COLUMN_PRIORITY_PLAYER) { var _t_start1 = get_timer(); } @@ -52,7 +29,6 @@ try { if (marine_dead[i] == 0 && marine_casting[i] == true) { var caster_id = i; scr_powers(caster_id); - exit; } } @@ -87,7 +63,7 @@ try { var _weapon_type = "ranged"; var _target_priority_queue = ds_priority_create(); - if (DEBUG_COLUMN_PRIORITY) { + if (DEBUG_COLUMN_PRIORITY_PLAYER) { var _t_start = get_timer(); } @@ -100,7 +76,7 @@ try { array_push(_check_targets, self.id); } - if (DEBUG_COLUMN_PRIORITY) { + if (DEBUG_COLUMN_PRIORITY_PLAYER) { show_debug_message($"{wep[i]} IS HERE!"); } @@ -136,13 +112,13 @@ try { priority += _distance_bonus; priority *= random_range(0.5, 1.5); - if (DEBUG_COLUMN_PRIORITY) { + if (DEBUG_COLUMN_PRIORITY_PLAYER) { show_debug_message($"Priority: {priority}\n Type: +{_type_bonus}\n Size: +{_size_bonus}\n Doomstack: -{_doomstack_malus}\n Distance: +{_distance_bonus}\n"); } ds_priority_add(_target_priority_queue, enemy_block, priority); } - if (DEBUG_COLUMN_PRIORITY) { + if (DEBUG_COLUMN_PRIORITY_PLAYER) { var _t_end = get_timer(); var _elapsed_ms = (_t_end - _t_start) / 1000; show_debug_message($"⏱️ Execution Time: {_elapsed_ms}ms"); @@ -156,14 +132,14 @@ try { scr_shoot(i, best_target, unit_index, _target_type, _weapon_type); } else { log_error($"{wep[i]} didn't find a valid target! This shouldn't happen!"); - if (DEBUG_COLUMN_PRIORITY) { + if (DEBUG_COLUMN_PRIORITY_PLAYER) { show_debug_message($"We didn't find a valid target! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}"); } } ds_priority_destroy(_target_priority_queue); } else { - if (DEBUG_COLUMN_PRIORITY) { + if (DEBUG_COLUMN_PRIORITY_PLAYER) { show_debug_message($"I can't shoot, my range is too small! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}"); } continue; @@ -171,7 +147,7 @@ try { } } - if (DEBUG_COLUMN_PRIORITY) { + if (DEBUG_COLUMN_PRIORITY_PLAYER) { var _t_end1 = get_timer(); var _elapsed_ms1 = (_t_end1 - _t_start1) / 1000; show_debug_message($"⏱️ Ranged Alarm Execution Time: {_elapsed_ms1}ms"); diff --git a/scripts/scr_clean/scr_clean.gml b/scripts/scr_clean/scr_clean.gml index b203e55879..e4225c299d 100644 --- a/scripts/scr_clean/scr_clean.gml +++ b/scripts/scr_clean/scr_clean.gml @@ -1,39 +1,4 @@ -#macro DEBUG_TARGET_SELECTION false - -/// @function check_dead_marines -/// @description Checks if the marine is dead and then runs various related code -/// @mixin -function check_dead_marines(unit_struct, unit_index) { - var unit_lost = false; - - if (unit_struct.hp() <= 0 && marine_dead[unit_index] < 1) { - marine_dead[unit_index] = 1; - unit_lost = true; - obj_ncombat.player_forces -= 1; - - // Record loss - var existing_index = array_get_index(lost, marine_type[unit_index]); - if (existing_index != -1) { - lost_num[existing_index] += 1; - } else { - array_push(lost, marine_type[unit_index]); - array_push(lost_num, 1); - } - - // Check red thirst threadhold - if (obj_ncombat.red_thirst == 1 && marine_type[unit_index] != "Death Company" && ((obj_ncombat.player_forces / obj_ncombat.player_max) < 0.9)) { - obj_ncombat.red_thirst = 2; - } - - if (unit_struct.IsSpecialist(SPECIALISTS_DREADNOUGHTS)) { - dreads -= 1; - } else { - men -= 1; - } - } - - return unit_lost; -} +#macro DEBUG_ENEMY_TARGET_SELECTION false function scr_clean(target_object, weapon_data) { // Converts enemy scr_shoot damage into player marine or vehicle casualties. @@ -52,8 +17,9 @@ function scr_clean(target_object, weapon_data) { exit; } - if (DEBUG_TARGET_SELECTION) { + if (DEBUG_ENEMY_TARGET_SELECTION) { var _t_start = get_timer(); + show_debug_message($"Weapon: {weapon_data.name}"); } var armour_pierce = weapon_data.armour_pierce; @@ -285,7 +251,7 @@ function scr_clean(target_object, weapon_data) { } } - if (DEBUG_TARGET_SELECTION) { + if (DEBUG_ENEMY_TARGET_SELECTION) { var _t_end = get_timer(); var _elapsed_ms = (_t_end - _t_start) / 1000; show_debug_message($"⏱️ Clean Execution Time: {_elapsed_ms}ms"); @@ -295,11 +261,11 @@ function scr_clean(target_object, weapon_data) { } // Flavour battle-log message - if (DEBUG_TARGET_SELECTION) { + if (DEBUG_ENEMY_TARGET_SELECTION) { var _t_start = get_timer(); } scr_flavor2(units_lost, unit_type, hostile_range, hostile_weapon, shooter_count); - if (DEBUG_TARGET_SELECTION) { + if (DEBUG_ENEMY_TARGET_SELECTION) { var _t_end = get_timer(); var _elapsed_ms = (_t_end - _t_start) / 1000; show_debug_message($"⏱️ Flavour Execution Time: {_elapsed_ms}ms"); @@ -310,6 +276,41 @@ function scr_clean(target_object, weapon_data) { } } +/// @function check_dead_marines +/// @description Checks if the marine is dead and then runs various related code +/// @mixin +function check_dead_marines(unit_struct, unit_index) { + var unit_lost = false; + + if (unit_struct.hp() <= 0 && marine_dead[unit_index] < 1) { + marine_dead[unit_index] = 1; + unit_lost = true; + obj_ncombat.player_forces -= 1; + + // Record loss + var existing_index = array_get_index(lost, marine_type[unit_index]); + if (existing_index != -1) { + lost_num[existing_index] += 1; + } else { + array_push(lost, marine_type[unit_index]); + array_push(lost_num, 1); + } + + // Check red thirst threadhold + if (obj_ncombat.red_thirst == 1 && marine_type[unit_index] != "Death Company" && ((obj_ncombat.player_forces / obj_ncombat.player_max) < 0.9)) { + obj_ncombat.red_thirst = 2; + } + + if (unit_struct.IsSpecialist(SPECIALISTS_DREADNOUGHTS)) { + dreads -= 1; + } else { + men -= 1; + } + } + + return unit_lost; +} + /// @function compress_enemy_array /// @description Compresses column data arrays by removing gaps left by eliminated entities, processes only the first 20 indices /// @param {id.Instance} _target_column - The column instance to clean up diff --git a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml index e8f93d6de0..b93c9d53e3 100644 --- a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml +++ b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml @@ -131,8 +131,33 @@ function scr_player_combat_weapon_stacks() { var dreaded=false, unit; var mobi_item; - for (g=0;g 0) { + marine_mshield[g] -= 1; + } + if (marine_quick[g] > 0) { + marine_quick[g] -= 1; + } + if (marine_might[g] > 0) { + marine_might[g] -= 1; + } + if (marine_fiery[g] > 0) { + marine_fiery[g] -= 1; + } + if (marine_fshield[g] > 0) { + marine_fshield[g] -= 1; + } + if (marine_dome[g] > 0) { + marine_dome[g] -= 1; + } + if (marine_spatial[g] > 0) { + marine_spatial[g] -= 1; + } + if (is_struct(unit)) { if (unit.hp()>0) then marine_dead[g]=0; if (unit.hp()>0 && marine_dead[g]!=true){ diff --git a/scripts/scr_shoot/scr_shoot.gml b/scripts/scr_shoot/scr_shoot.gml index 8a93724f4a..73db4459a4 100644 --- a/scripts/scr_shoot/scr_shoot.gml +++ b/scripts/scr_shoot/scr_shoot.gml @@ -1,5 +1,5 @@ -#macro DEBUG_WEAPON_RELOADING true -#macro DEBUG_PLAYER_TARGET_SELECTION true +#macro DEBUG_WEAPON_RELOADING false +#macro DEBUG_PLAYER_TARGET_SELECTION false /// @mixin function scr_shoot(weapon_index_position, target_object, target_index, target_type, melee_or_ranged) { diff --git a/scripts/scr_target/scr_target.gml b/scripts/scr_target/scr_target.gml index 08d1489bf6..ea70ac9884 100644 --- a/scripts/scr_target/scr_target.gml +++ b/scripts/scr_target/scr_target.gml @@ -1,27 +1,31 @@ function scr_target(battle_block, man_or_vehicle) { var _biggest_target = -1; var _priority_queue = ds_priority_create(); - var _target; + var _target = -1; + var _dudes_names = battle_block.dudes; + var _dudes_hps = battle_block.dudes_hp; + var _dudes_nums = battle_block.dudes_num; + var _dudes_vehicles = battle_block.dudes_vehicle; - if (man_or_vehicle == "arp"){ + if (man_or_vehicle == "arp") { _target = 1; - }else if (man_or_vehicle == "att"){ + } else if (man_or_vehicle == "att") { _target = 0; - } else { - _target = -1; } - for (var i = 0, dudes_len = array_length(battle_block.dudes); i < dudes_len; i++) { - if (battle_block.dudes_hp[i] <= 0 || battle_block.dudes[i] == "") { + for (var i = 0, dudes_len = array_length(_dudes_names); i < dudes_len; i++) { + if (_dudes_hps[i] <= 0 || _dudes_names[i] == "") { continue; } - if (_target == -1 || battle_block.dudes_vehicle[i] == _target) { - ds_priority_add(_priority_queue, i, battle_block.dudes_num[i]); + if (_target == -1 || _dudes_vehicles[i] == _target) { + ds_priority_add(_priority_queue, i, _dudes_nums[i]); } } - _biggest_target = ds_priority_delete_max(_priority_queue); + if (!ds_priority_empty(_priority_queue)) { + _biggest_target = ds_priority_delete_max(_priority_queue); + } ds_priority_destroy(_priority_queue); return _biggest_target; From e9782c29a1b6b2f59f77f7b7ea77e4b8dc160d99 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Sat, 12 Apr 2025 17:12:20 +0300 Subject: [PATCH 51/80] More bugfixing --- objects/obj_enunit/Alarm_0.gml | 12 +++++------ objects/obj_pnunit/Alarm_0.gml | 5 +---- objects/obj_pnunit/Create_0.gml | 2 +- scripts/scr_flavor/scr_flavor.gml | 21 +++++-------------- .../scr_player_combat_weapon_stacks.gml | 6 +++--- 5 files changed, 15 insertions(+), 31 deletions(-) diff --git a/objects/obj_enunit/Alarm_0.gml b/objects/obj_enunit/Alarm_0.gml index 5e13dc8a5d..4b03cd62e6 100644 --- a/objects/obj_enunit/Alarm_0.gml +++ b/objects/obj_enunit/Alarm_0.gml @@ -6,7 +6,7 @@ if (!instance_exists(obj_pnunit)) { exit; } -var _block_direction = flank ? get_rightmost : get_leftmost; +var _block_direction = flank ? get_leftmost : get_rightmost; enemy = _block_direction(); if (enemy == "none") { @@ -42,8 +42,10 @@ if (!engaged) { } if (!target_block_is_valid(enemy, obj_pnunit)) { + log_error($"Invalid player block was found by a ranged enemy!"); enemy = _block_direction(); if (!target_block_is_valid(enemy, obj_pnunit)) { + log_error($"Two invalid player blocks were found by a ranged enemy! Exiting!"); exit; } } @@ -191,12 +193,8 @@ if (engaged) { } if (!target_block_is_valid(enemy, obj_pnunit)) { - log_error($"One invalid player block was found!"); - enemy = _block_direction(); - if (!target_block_is_valid(enemy, obj_pnunit)) { - log_error($"A second invalid player block was found!"); - exit; - } + log_error($"Invalid player block was found by a melee enemy!"); + exit; } if (instance_exists(obj_nfort) && (!flank)) { diff --git a/objects/obj_pnunit/Alarm_0.gml b/objects/obj_pnunit/Alarm_0.gml index 777c98ae35..2c56dcacd4 100644 --- a/objects/obj_pnunit/Alarm_0.gml +++ b/objects/obj_pnunit/Alarm_0.gml @@ -173,10 +173,7 @@ try { } if (!target_block_is_valid(enemy, obj_enunit)) { - enemy = instance_nearest(0, y, obj_enunit); - if (!target_block_is_valid(enemy, obj_enunit)) { - exit; - } + exit; } var _attack_type = apa[i] > 8 ? "arp" : "att"; diff --git a/objects/obj_pnunit/Create_0.gml b/objects/obj_pnunit/Create_0.gml index 28b0d8b4b5..59268d67c9 100644 --- a/objects/obj_pnunit/Create_0.gml +++ b/objects/obj_pnunit/Create_0.gml @@ -94,7 +94,7 @@ ammo_reload_current = array_create(_dudes_size, -1); ammo_reload = array_create(_dudes_size, -1); splash = array_create(_dudes_size, 0); wep_owner = array_create(_dudes_size, ""); -wep_solo = array_create(_dudes_size, []); +wep_solo = array_create(_dudes_size, ""); wep_title = array_create(_dudes_size, ""); dudes = array_create(_dudes_size, ""); dudes_num = array_create(_dudes_size, 0); diff --git a/scripts/scr_flavor/scr_flavor.gml b/scripts/scr_flavor/scr_flavor.gml index 39359363ad..c110afdbca 100644 --- a/scripts/scr_flavor/scr_flavor.gml +++ b/scripts/scr_flavor/scr_flavor.gml @@ -22,6 +22,7 @@ function display_battle_log_message() { obj_ncombat.alarm[3] = 5; } +/// @mixin function scr_flavor(id_of_attacking_weapons, target, target_type, number_of_shots, casulties) { // Generates flavor based on the damage and casualties from scr_shoot, only for the player @@ -50,24 +51,12 @@ function scr_flavor(id_of_attacking_weapons, target, target_type, number_of_shot target_name = obj_controller.faction_leader[obj_ncombat.enemy]; } - var character_shot = false, - unit_name = "", - cm_kill = 0; + var character_shot = false; + var unit_name = ""; - - if (id_of_attacking_weapons > 0) { - if (array_length(wep_solo[id_of_attacking_weapons]) > 0) { + if (wep_solo[id_of_attacking_weapons] != "") { + unit_name = $"{wep_title[id_of_attacking_weapons]} {wep_solo[id_of_attacking_weapons]}"; character_shot = true; - full_names = wep_solo[id_of_attacking_weapons]; - if (wep_title[id_of_attacking_weapons] != "") { - if (array_length(full_names) == 1) { - unit_name = wep_title[id_of_attacking_weapons] + " " + wep_solo[id_of_attacking_weapons][0]; - } else { - unit_name = wep_title[id_of_attacking_weapons] + "'s" - } - } - if (wep_solo[id_of_attacking_weapons][0] == obj_ini.master_name) then cm_kill = 1; - } } if (obj_ncombat.battle_special = "WL10_reveal") or (obj_ncombat.battle_special = "WL10_later") { diff --git a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml index b93c9d53e3..c56b2b6412 100644 --- a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml +++ b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml @@ -57,7 +57,7 @@ function find_stack_index (weapon_name, head_role=false, unit="none"){ for (var stack_index=1;stack_index Date: Sat, 12 Apr 2025 18:17:53 +0300 Subject: [PATCH 52/80] More bugfixing and optimization --- objects/obj_enunit/Alarm_0.gml | 18 +++++++------ objects/obj_ncombat/Create_0.gml | 33 +++++++++++------------- objects/obj_pnunit/Alarm_0.gml | 8 +++--- scripts/scr_flavor/scr_flavor.gml | 33 ++---------------------- scripts/scr_shoot/scr_shoot.gml | 43 +++++++------------------------ scripts/scr_target/scr_target.gml | 2 +- 6 files changed, 40 insertions(+), 97 deletions(-) diff --git a/objects/obj_enunit/Alarm_0.gml b/objects/obj_enunit/Alarm_0.gml index 4b03cd62e6..5f1bfaa816 100644 --- a/objects/obj_enunit/Alarm_0.gml +++ b/objects/obj_enunit/Alarm_0.gml @@ -54,7 +54,11 @@ if (!engaged) { target_unit_index = 0; if (range[i] >= dist) { - var _target_type = apa[i] > 8 ? "arp" : "att"; + if (DEBUG_COLUMN_PRIORITY_ENEMY) { + show_debug_message($"{wep[i]} IS SHOOTING!"); + } + + var _target_type = apa[i] > 10 ? "arp" : "att"; var _weapon_type = "ranged"; var _target_priority_queue = ds_priority_create(); @@ -84,10 +88,6 @@ if (!engaged) { array_push(_check_targets, self.id); } - if (DEBUG_COLUMN_PRIORITY_ENEMY) { - show_debug_message($"{wep[i]} IS HERE!"); - } - for (var t = 0; t < array_length(_check_targets); t++) { var enemy_block = _check_targets[t]; @@ -197,17 +197,19 @@ if (engaged) { exit; } + if (DEBUG_COLUMN_PRIORITY_ENEMY) { + show_debug_message($"{wep[i]} IS IN MELEE!"); + } + if (instance_exists(obj_nfort) && (!flank)) { enemy = instance_nearest(x, y, obj_nfort); scr_shoot(i, enemy, 0, "arp", "wall"); continue; } - var _attack_type = apa[i] > 8 ? "arp" : "att"; + var _attack_type = apa[i] > 10 ? "arp" : "att"; scr_shoot(i, enemy, 0, _attack_type, "melee"); } } -instance_activate_object(obj_pnunit); - //! Here was some stuff that depended on image_index here, that got deleted, because I couldn't figure out why it exists; diff --git a/objects/obj_ncombat/Create_0.gml b/objects/obj_ncombat/Create_0.gml index dca5c78274..4c17438f92 100644 --- a/objects/obj_ncombat/Create_0.gml +++ b/objects/obj_ncombat/Create_0.gml @@ -116,28 +116,25 @@ enemy_forces=0;enemy_max=0; hulk_forces=0; i=-1;messages=0;messages_to_show=24;messages_shown=0; -largest=0;priority=0;random_messages=0;dead_enemies=0; +largest=0;priority=0;random_messages=0; units_lost_counts = {}; vehicles_lost_counts = {}; -repeat(70){i+=1; - lines[i]=""; - lines_color[i]=""; - message[i]=""; - message_sz[i]=0; - message_priority[i]=0; - dead_jim[i]=""; - dead_ene[i]=""; - dead_ene_n[i]=0; - - post_equipment_lost[i]=""; - post_equipments_lost[i]=0; - - crunch[i]=0; - - if (i<=10) then mucra[i]=0; -} +var _messages_size = 70; +lines = array_create(_messages_size, ""); +lines_color = array_create(_messages_size, ""); +message = array_create(_messages_size, ""); +message_sz = array_create(_messages_size, 0); +message_priority = array_create(_messages_size, 0); +dead_jim = array_create(_messages_size, ""); + +post_equipment_lost = array_create(_messages_size, ""); +post_equipments_lost = array_create(_messages_size, 0); + +crunch = array_create(_messages_size, 0); +mucra = array_create(11, 0); + slime=0; unit_recovery_score=0; apothecaries_alive=0; diff --git a/objects/obj_pnunit/Alarm_0.gml b/objects/obj_pnunit/Alarm_0.gml index 2c56dcacd4..f869c5ac18 100644 --- a/objects/obj_pnunit/Alarm_0.gml +++ b/objects/obj_pnunit/Alarm_0.gml @@ -1,4 +1,4 @@ -#macro DEBUG_COLUMN_PRIORITY_PLAYER true +#macro DEBUG_COLUMN_PRIORITY_PLAYER false // Useful functions: // scr_target @@ -59,7 +59,7 @@ try { var dist = get_block_distance(enemy); if (range[i] >= dist) { - var _target_type = apa[i] > 8 ? "arp" : "att"; + var _target_type = apa[i] > 10 ? "arp" : "att"; var _weapon_type = "ranged"; var _target_priority_queue = ds_priority_create(); @@ -176,12 +176,10 @@ try { exit; } - var _attack_type = apa[i] > 8 ? "arp" : "att"; + var _attack_type = apa[i] > 10 ? "arp" : "att"; scr_shoot(i, enemy, 0, _attack_type, "melee"); } } - - instance_activate_object(obj_enunit); } catch (_exception) { handle_exception(_exception); } diff --git a/scripts/scr_flavor/scr_flavor.gml b/scripts/scr_flavor/scr_flavor.gml index c110afdbca..3ce81d1974 100644 --- a/scripts/scr_flavor/scr_flavor.gml +++ b/scripts/scr_flavor/scr_flavor.gml @@ -56,8 +56,8 @@ function scr_flavor(id_of_attacking_weapons, target, target_type, number_of_shot if (wep_solo[id_of_attacking_weapons] != "") { unit_name = $"{wep_title[id_of_attacking_weapons]} {wep_solo[id_of_attacking_weapons]}"; - character_shot = true; - } + character_shot = true; + } if (obj_ncombat.battle_special = "WL10_reveal") or (obj_ncombat.battle_special = "WL10_later") { if (target_name = "Veteran Chaos Terminator") and (target_name > 0) then obj_ncombat.chaos_angry += casulties * 2; @@ -391,35 +391,6 @@ function scr_flavor(id_of_attacking_weapons, target, target_type, number_of_shot } } - // if (string_length(attack_message+kill_message+p3)<8) then show_message(weapon_name+" is not displaying anything"); - - // I don't understand what this was supposed to do either. - // if (obj_ncombat.dead_enemies != 0){ - // for (var i = 1; i < array_length_1d(obj_ncombat.dead_ene); i++) { - // if (obj_ncombat.dead_ene[i] != "") { - // if (obj_ncombat.dead_enemies == 1) { - // kill_message += obj_ncombat.dead_ene[i] + " unit has been eliminated."; - // } else if (obj_ncombat.dead_enemies == 2) { - // if (i == 1) { - // kill_message += obj_ncombat.dead_ene[i] + " and "; - // } else { - // kill_message += obj_ncombat.dead_ene[i] + " units have been eliminated."; - // } - // } else if (obj_ncombat.dead_enemies > 2) { - // if (i == 1) { - // kill_message += obj_ncombat.dead_ene[i] + ", "; - // } else if (i == obj_ncombat.dead_enemies) { - // kill_message += "and " + obj_ncombat.dead_ene[i] + " units have been eliminated."; - // } else { - // kill_message += obj_ncombat.dead_ene[i] + ", "; - // } - // } - // } - // obj_ncombat.dead_ene[i] = ""; - // } - // obj_ncombat.dead_enemies = 0; - // } - var message_priority = 0; if (obj_ncombat.enemy <= 10) { if (target_name = obj_controller.faction_leader[obj_ncombat.enemy]) { // Cleaning up the message for the enemy leader diff --git a/scripts/scr_shoot/scr_shoot.gml b/scripts/scr_shoot/scr_shoot.gml index 73db4459a4..b62498ceb2 100644 --- a/scripts/scr_shoot/scr_shoot.gml +++ b/scripts/scr_shoot/scr_shoot.gml @@ -24,12 +24,6 @@ function scr_shoot(weapon_index_position, target_object, target_index, target_ty exit; } - for (var j = 1; j <= 100; j++) { - obj_ncombat.dead_ene[j] = ""; - obj_ncombat.dead_ene_n[j] = 0; - } - obj_ncombat.dead_enemies = 0; - var wi = weapon_index_position; var _weapon_max_kills = splash[wi]; var _total_damage = att[wi]; @@ -147,10 +141,14 @@ function scr_shoot(weapon_index_position, target_object, target_index, target_ty if (owner == eFACTION.Player) { target_index = scr_target(target_object, _weapon_damage_type); if (target_index == -1) { - if (DEBUG_PLAYER_TARGET_SELECTION) { - show_debug_message($"{_weapon_name} found no valid targets in the enemy column to attack!"); + target_index = scr_target(target_object); + if (target_index == -1) { + if (DEBUG_PLAYER_TARGET_SELECTION) { + show_debug_message($"{_weapon_name} found no valid targets in the enemy column to attack!"); + } + log_error($"{_weapon_name} found no valid targets in the enemy column to attack!"); + exit; } - exit; } if (DEBUG_PLAYER_TARGET_SELECTION) { @@ -166,9 +164,9 @@ function scr_shoot(weapon_index_position, target_object, target_index, target_ty var _dice_sides = 200; var _random_damage_mod = roll_dice(1, _dice_sides, "low") / _dice_sides; var _armour_points = max(0, target_object.dudes_ac[target_index] - _weapon_ap); - var _weapon_damage_per_hit = (_weapon_damage_per_hit * _random_damage_mod) - _armour_points; + _weapon_damage_per_hit = (_weapon_damage_per_hit * _random_damage_mod) - _armour_points; _weapon_damage_per_hit = max(_min_damage, _weapon_damage_per_hit * target_object.dudes_dr[target_index]); - _total_damage = _weapon_damage_per_hit * _shooter_count; + _total_damage = _weapon_damage_per_hit * _shot_count; var _dudes_num = target_object.dudes_num[target_index]; var _unit_hp = target_object.dudes_hp[target_index]; @@ -184,29 +182,6 @@ function scr_shoot(weapon_index_position, target_object, target_index, target_ty if (DEBUG_PLAYER_TARGET_SELECTION) { show_debug_message($"{_weapon_name} attacked {target_object.dudes[target_index]} and destroyed {_casualties}!"); } - - var found = -1; - var openz = -1; - for (var i = 0, _dead_ene = array_length(obj_ncombat.dead_ene); i < _dead_ene; i++) { - if (obj_ncombat.dead_ene[i] == "") { - if (openz == -1) { - openz = i; - } - } - - if (obj_ncombat.dead_ene[i] == target_object.dudes[target_index]) { - found = i; - break; - } - } - - if (found != -1) { - obj_ncombat.dead_ene_n[found] += _casualties; - } else if (openz != -1) { - obj_ncombat.dead_enemies += 1; - obj_ncombat.dead_ene[openz] = string(target_object.dudes[target_index]); - obj_ncombat.dead_ene_n[openz] = _casualties; - } } else { if (DEBUG_PLAYER_TARGET_SELECTION) { show_debug_message($"{_weapon_name} attacked {target_object.dudes[target_index]} but dealt no damage!"); diff --git a/scripts/scr_target/scr_target.gml b/scripts/scr_target/scr_target.gml index ea70ac9884..a202adcb05 100644 --- a/scripts/scr_target/scr_target.gml +++ b/scripts/scr_target/scr_target.gml @@ -1,4 +1,4 @@ -function scr_target(battle_block, man_or_vehicle) { +function scr_target(battle_block, man_or_vehicle = "any") { var _biggest_target = -1; var _priority_queue = ds_priority_create(); var _target = -1; From 9b5468fb524849d2f55bd5d5f63a82651dc50039 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Sat, 12 Apr 2025 22:21:44 +0300 Subject: [PATCH 53/80] Overhaul most of the weapons and gear --- objects/obj_enunit/Alarm_1.gml | 4 +- scripts/scr_weapon/scr_weapon.gml | 1402 +++++++++++++---------------- 2 files changed, 625 insertions(+), 781 deletions(-) diff --git a/objects/obj_enunit/Alarm_1.gml b/objects/obj_enunit/Alarm_1.gml index 88edf9ae90..0092b56b4c 100644 --- a/objects/obj_enunit/Alarm_1.gml +++ b/objects/obj_enunit/Alarm_1.gml @@ -300,14 +300,14 @@ if __b__ { if ((dudes[g] != "Chapter Master")) then scr_en_weapon(string(dudes_wep1[g]), false, 1, dudes[g], g); if (dudes_wep1[g] = "Close Combat Weapon") then scr_en_weapon("CCW Heavy Flamer", true, 1, dudes[g], g); - if (string_count("UBOLT", dudes_wep1[g]) > 0) then scr_en_weapon("Underslung Bolter", false, 1, dudes[g], g); + if (string_count("UBOLT", dudes_wep1[g]) > 0) then scr_en_weapon("Integrated-Bolter", false, 1, dudes[g], g); if (string_count("UFL", dudes_wep1[g]) > 0) then scr_en_weapon("Underslung Flamer", false, 1, dudes[g], g); } if (dudes_wep2[g] != "") and (marine_casting[g] == false) { if ((dudes[g] != "Chapter Master")) then scr_en_weapon(string(dudes_wep2[g]), false, 1, dudes[g], g); if (dudes_wep2[g] = "Close Combat Weapon") then scr_en_weapon("CCW Heavy Flamer", true, 1, dudes[g], g); - if (string_count("UBOLT", dudes_wep2[g]) > 0) then scr_en_weapon("Underslung Bolter", false, 1, dudes[g], g); + if (string_count("UBOLT", dudes_wep2[g]) > 0) then scr_en_weapon("Integrated-Bolter", false, 1, dudes[g], g); if (string_count("UFL", dudes_wep2[g]) > 0) then scr_en_weapon("Underslung Flamer", false, 1, dudes[g], g); } } diff --git a/scripts/scr_weapon/scr_weapon.gml b/scripts/scr_weapon/scr_weapon.gml index bc41ae9fab..707ff1b835 100644 --- a/scripts/scr_weapon/scr_weapon.gml +++ b/scripts/scr_weapon/scr_weapon.gml @@ -2,23 +2,18 @@ global.weapons = { "Storm Shield": { "description": "Protects twice as well when boarding. A powered shield that must be held with a hand. While powered by the marines armour it shimmers with blue energy.", "abbreviation": "StrmShld", - "attack": { - "standard": 5, - "master_crafted": 5, - "artifact": 10 - }, "armour_value": { - "standard": 8, - "master_crafted": 10, - "artifact": 12 + "standard": 4, + "master_crafted": 4, + "artifact": 4 }, "melee_hands": 0.75, "ranged_hands": 1, "tags": ["shield","boarding 2"], - "hp_mod": { - "standard": 30, - "master_crafted": 35, - "artifact": 40 + "damage_resistance_mod": { + "standard": 35, + "master_crafted": 40, + "artifact": 45 }, }, "Boarding Shield": { @@ -26,15 +21,15 @@ global.weapons = { "abbreviation": "BrdShld", "armour_value": { "standard": 4, - "master_crafted": 5, - "artifact": 6 + "master_crafted": 4, + "artifact": 4 }, "melee_hands": 0.75, "tags": ["shield","boarding 3"], - "hp_mod": { - "standard": 15, - "master_crafted": 17.5, - "artifact": 20 + "damage_resistance_mod": { + "standard": 20, + "master_crafted": 25, + "artifact": 30 }, }, "Archeotech Laspistol": { @@ -58,9 +53,9 @@ global.weapons = { "Combat Knife": { "abbreviation": "CbKnf", "attack": { - "standard": 100, - "master_crafted": 125, - "artifact": 150 + "standard": 10, + "master_crafted": 10, + "artifact": 10 }, "description": "More of a sword than a knife, this tough and thick blade becomes a deadly weapon in the hand of an Astartes.", "melee_hands": 0, @@ -68,44 +63,39 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 2, - "arp": 1, + "arp": 4, "tags": ["knife"], }, "Chainsword": { "abbreviation": "ChSwrd", "attack": { "standard": 18, - "master_crafted": 28, - "artifact": 38 + "master_crafted": 18, + "artifact": 18 }, "description": "A standard Chainsword. It is popular among Assault Marines due to their raw power while maintaining speed.", "melee_hands": 1, "ranged_hands": 0, "ammo": 0, "range": 1, - "spli": 4, + "spli": 2, "arp": 6, "tags": ["chain", "sword","savage", "boarding 1"], }, "Chainaxe": { "abbreviation": "ChAxe", "attack": { - "standard": 175, - "master_crafted": 225, - "artifact": 275 - }, - "melee_mod": { - "standard": 5, - "master_crafted": 10, - "artifact": 15 + "standard": 20, + "master_crafted": 20, + "artifact": 20 }, "description": "A weapon most frequently seen in the hands of Traitor Astartes, the Chainaxe uses motorized chainsaw teeth to maim and tear. Astartes often duel-wield them to increase frequency of attacks.", "melee_hands": 1, "ranged_hands": 0, "ammo": 0, "range": 1, - "spli": 3, - "arp": 1, + "spli": 2, + "arp": 6, "tags": ["chain", "axe", "dual", "savage", "boarding 2"], }, "Company Standard": { @@ -113,76 +103,56 @@ global.weapons = { "special_properties": ["Morale Boost"], "description": "A banner that represents the honor of a particular company and will bolster the morale of nearby Astartes.", "attack": { - "standard": 45, - "master_crafted": 60, - "artifact": 100 - }, - "hp_mod": { - "standard": 20, - "master_crafted": 20, - "artifact": 20 + "standard": 12, + "master_crafted": 12, + "artifact": 12 }, "melee_hands": 1, "ranged_hands": 1, "range": 1, - "spli": 1, - "arp": 1, + "spli": 3, + "arp": 6, "tags": ["banner"], }, "Eviscerator": { "abbreviation": "Evisc", "attack": { - "standard": 250, - "master_crafted": 300, - "artifact": 350 - }, - "melee_mod": { - "standard": 2, - "master_crafted": 2, - "artifact": 2 + "standard": 22, + "master_crafted": 22, + "artifact": 22 }, "description": "An obscenely large Chainsword, this two-handed weapon can carve through flesh and plasteel with equal ease.", "melee_hands": 2, "ranged_hands": 1, "ammo": 0, "range": 1, - "spli": 6, - "arp": 2, + "spli": 3, + "arp": 18, "tags": ["chain", "sword", "savage"], }, "Power Sword": { "abbreviation": "PwrSwrd", "attack": { - "standard": 225, - "master_crafted": 275, - "artifact": 325 - }, - "melee_mod": { - "standard": 1, - "master_crafted": 1.1, - "artifact": 1.2 + "standard": 24, + "master_crafted": 24, + "artifact": 24 }, "description": "The most common kind of Power Weapon. When active, the blade becomes sheathed in a lethal haze of disruptive energy that seamlessly cuts through ceramite and flesh.", "melee_hands": 1, "ranged_hands": 0, "ammo": 0, "range": 1, - "spli": 4, - "arp": 2, + "spli": 2, + "arp": 12, "special_properties": ["Parry"], "tags": ["power", "sword", "martial", "boarding 1"], }, "Power Spear": { "abbreviation": "PwrSpear", "attack": { - "standard": 300, - "master_crafted": 375, - "artifact": 450 - }, - "melee_mod": { - "standard": 1, - "master_crafted": 1.1, - "artifact": 1.2 + "standard": 24, + "master_crafted": 24, + "artifact": 24 }, "description": "A rare kind of Power Weapon, a power blade mounted on the end of a long shaft, requires great skill to wield. When active, the blade becomes sheathed in a lethal haze of disruptive energy and can tear through all manners of material with ease.", "melee_hands": 1, @@ -190,7 +160,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 3, - "arp": 2, + "arp": 14, "special_properties": ["Parry"], "tags": ["power", "spear", "martial"], }, @@ -219,92 +189,63 @@ global.weapons = { "Chainfist": { "abbreviation": "ChFst", "attack": { - "standard": 400, - "master_crafted": 550, - "artifact": 700 + "standard": 22, + "master_crafted": 22, + "artifact": 22 }, "description": "Created by mounting a chainsword to a power fist, this weapon is easily able to carve through armoured bulkheads.", "melee_hands": 3, "ranged_hands": 0, "range": 1, - "spli": 4, + "spli": 2, "tags": ["power","boarding 3", "chain", "fist", "siege", "savage"], - "arp": 3, + "arp": 20, }, "Lascutter": { "abbreviation": "Lasct", "attack": { - "standard": 250, - "master_crafted": 300, - "artifact": 425 + "standard": 64, + "master_crafted": 64, + "artifact": 64 }, "description": "Originally industrial tools used for breaking through bulkheads, this laser weapon is devastating in close combat.", "melee_hands": 1, "range": 1, - "arp": 4, + "ammo": 5, + "reload": 2, + "arp": 20, "tags": ["las","boarding 3", "siege"], }, - "Power Weapon": { - "abbreviation": "PwrWpn", - "attack": { - "standard": 135, - "master_crafted": 145, - "artifact": 155 - }, - "melee_mod": { - "standard": 1.1, - "master_crafted": 1.1, - "artifact": 1.1 - }, - // "description": "An makeshift power weapon made by Astartes during long term deployment behind enemy lines or when cut from supply lines for long periods of time.", - "melee_hands": 1.1, - "ranged_hands": 0, - "ammo": 0, - "range": 1, - "spli": 3, - "arp": 2, - "tags": ["power"], - }, "Power Axe": { "abbreviation": "PwrAxe", "attack": { - "standard": 250, - "master_crafted": 300, - "artifact": 350 - }, - "melee_mod": { - "standard": 1, - "master_crafted": 1.1, - "artifact": 1.2 + "standard": 28, + "master_crafted": 28, + "artifact": 28 }, "description": "This weapon's power systems can be activated with the press of a button to sheathe the axe-head in a lethal haze of disruptive energy. Those fortunate enough to get their hands on two tend to duel-wield them.", "melee_hands": 1, "ranged_hands": 0, "ammo": 0, "range": 1, - "spli": 3, - "arp": 2, + "spli": 2, + "arp": 14, "tags": ["power", "axe", "dual","savage", "boarding 2"], }, "Omnissian Axe": { "abbreviation": "OmnAxe", "attack": { - "standard": 400, - "master_crafted": 450, - "artifact": 550 - }, - "melee_mod": { - "standard": 1, - "master_crafted": 1.1, - "artifact": 1.2 + "standard": 32, + "master_crafted": 32, + "artifact": 32 }, "description": "A symbol that is equally weapon and holy icon given only to those trained by the Adeptus Mechanicus and have shown their devotion to the Omnissiah in battle.", "melee_hands": 1.5, "ranged_hands": 0, "ammo": 0, "range": 1, - "spli": 5, - "arp": 3, + "spli": 2, + "arp": 12, "tags": ["power", "axe", "savage", "boarding 3"], "specials": { "combi_tool": 1 @@ -313,35 +254,25 @@ global.weapons = { "Executioner Power Axe": { "abbreviation": "ExPwrAxe", "attack": { - "standard": 800, - "master_crafted": 850, - "artifact": 925 - }, - "melee_mod": { - "standard": 10, - "master_crafted": 15, - "artifact": 20 + "standard": 38, + "master_crafted": 38, + "artifact": 38 }, "description": "A heavy two-handed power axe used to rend armor and tear through multiple infantry at once.", "melee_hands": 2.5, "ranged_hands": 2, "ammo": 0, "range": 1, - "spli": 5, - "arp": 3, + "spli": 3, + "arp": 16, "tags": ["power", "axe", "martial"], }, "Power Fist": { "abbreviation": "PwrFst", "attack": { - "standard": 400, - "master_crafted": 450, - "artifact": 600 - }, - "melee_mod": { - "standard": 1, - "master_crafted": 1, - "artifact": 1 + "standard": 22, + "master_crafted": 22, + "artifact": 22 }, "description": "A large, ceramite clad gauntlet surrounded by an power energy field. Though cumbersome to use, it dishes out tremendous damage to enemies, leaving very little behind.", "melee_hands": 1, @@ -350,14 +281,14 @@ global.weapons = { "range": 1, "spli": 2, "tags": ["power", "dual", "fist", "savage", "boarding 2"], - "arp": 3, + "arp": 18, }, "Power Fists": { "abbreviation": "PwrFsts", "attack": { - "standard": 800, - "master_crafted": 900, - "artifact": 1200 + "standard": 22, + "master_crafted": 22, + "artifact": 22 }, "description": "A large, ceramite clad gauntlets surrounded by power energy fields. Though cumbersome to use, they dish out tremendous damage to enemies, leaving very little behind.", "melee_hands": 2, @@ -366,30 +297,30 @@ global.weapons = { "range": 1, "spli": 4, "tags": ["power", "fist", "pair","savage" ,"boarding 2"], - "arp": 3, + "arp": 18, }, "Servo-arm(M)": { "abbreviation": "MchArm", "attack": { - "standard": 220, - "master_crafted": 330, - "artifact": 500 + "standard": 50, + "master_crafted": 50, + "artifact": 50 }, "description": "", "melee_hands": 0, "ranged_hands": 0, "ammo": 0, "range": 1, - "spli": 2, - "arp": 3, + "spli": 3, + "arp": 20, "tags": ["siege"], }, "Boltstorm Gauntlet": { "abbreviation": "BlstGnt", "attack": { - "standard": 400, - "master_crafted": 450, - "artifact": 600 + "standard": 22, + "master_crafted": 22, + "artifact": 22 }, "description": "The Boltstorm Gauntlet is a Power Fists with an Integrated Bolter, so aside from being reinforced with a crackling power field and able to crush armour, bone and even thick vehicle plating, it is also capable of firing bolts at an astonishing rate", "melee_hands": 2, @@ -397,7 +328,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 2, - "arp": 3, + "arp": 18, "second_profiles": ["Integrated-Bolter"], "tags": ["power", "fist", "savage", "boarding 2"], }, @@ -420,83 +351,68 @@ global.weapons = { "Lightning Claw": { "abbreviation": "LghtClw", "attack": { - "standard": 375, - "master_crafted": 425, - "artifact": 575 + "standard": 24, + "master_crafted": 24, + "artifact": 24 }, "description": "Lightning claws are specialized close combat weapons with built-in disruptor fields. These lethal claws rip into infantry like butter, bringing terror to the foe.", - "melee_hands": 1.1, + "melee_hands": 1, "ranged_hands": 1, "ammo": 0, "range": 1, - "spli": 5, + "spli": 2, "tags": ["power", "dual", "fist", "boarding 2", "martial"], - "arp": 2, + "arp": 16, }, "Dreadnought Lightning Claw": { "abbreviation": "LghtClw", "attack": { - "standard": 600, - "master_crafted": 700, - "artifact": 850 - }, - "melee_mod": { - "standard": 1.2, - "master_crafted": 1.2, - "artifact": 1.2 + "standard": 76, + "master_crafted": 76, + "artifact": 76 }, "description": "A specialized Lightning Claw variant designed for Dreadnoughts, these claws are capable of ripping through enemy vehicles and infantry with ease.", "melee_hands": 5, "ranged_hands": 0, "ammo": 0, "range": 1, - "spli": 15, - "arp": 3, + "spli": 3, + "arp": 18, "maintenance" : 0.1, "tags": ["power", "vehicle", "dual", "dreadnought", "fist"], }, "Thunder Hammer": { "abbreviation": "ThndHmr", "attack": { - "standard": 500, - "master_crafted": 600, - "artifact": 750 - }, - "melee_mod": { - "standard": 1.3, - "master_crafted": 1.3, - "artifact": 1.3 + "standard": 32, + "master_crafted": 32, + "artifact": 32 }, "description": "A Thunder hammer is a weapon with a long pole and a double headed hammer on the top. This weapon unleashes a massive, devastating disruption field on impact. Only experienced Astartes can use Thunder Hammers, typically Terminators.", - "melee_hands": 1.1, + "melee_hands": 1, "ranged_hands": 1, "ammo": 0, "range": 1, - "spli": 3, - "arp": 3, + "spli": 2, + "arp": 18, "maintenance" : 0.1, "req_exp": 100, - "tags": ["power", "hammer", "siege", "savage", "boarding 2"], + "tags": ["power", "hammer", "siege", "savage", "boarding 2"], }, "Heavy Thunder Hammer": { "abbreviation": "HvyThndHmr", "attack": { - "standard": 700, - "master_crafted": 850, - "artifact": 1000, - }, - "melee_mod": { - "standard": 1.3, - "master_crafted": 1.3, - "artifact": 1.3, + "standard": 44, + "master_crafted": 44, + "artifact": 44 }, "description": "The Heavy Thunder Hammer is the largest man-portable Thunder Hammer that is used by the Adeptus Astartes - a giant, crushing tool of destruction so heavy even a Space Marine cannot use it one-handed.", "melee_hands": 2, "ranged_hands": 2, "ammo": 0, "range": 1, - "arp": 3, - "spli": 4, + "arp": 24, + "spli": 3, "maintenance" : 0.1, "req_exp": 100, "tags": ["heavy_melee", "power", "hammer", "siege", "savage"], @@ -504,36 +420,26 @@ global.weapons = { "Power Mace": { "abbreviation": "PwrMace", "attack": { - "standard": 400, - "master_crafted": 450, - "artifact": 600 - }, - "melee_mod": { - "standard": 1.3, - "master_crafted": 1.3, - "artifact": 1.3 + "standard": 26, + "master_crafted": 26, + "artifact": 26 }, "description": "Commonly referred to as Power Maul, is a blunt weapon surrounded by a power field. It's quite different from the less lethal Shock Maul, which is a similar type of close combat weapon. In the hands of a skilled warrior, the Power Mace is not just a weapon, it's a statement of power and authority in the grim darkness of far future.", - "melee_hands": 2.25, - "ranged_hands": 2, + "melee_hands": 1, + "ranged_hands": 1, "ammo": 0, "range": 1, - "arp": 3, - "spli": 6, + "arp": 14, + "spli": 2, "tags": ["power", "mace", "siege", "savage"], "req_exp": 100, }, "Mace of Absolution": { "abbreviation": "AbsltMace", "attack": { - "standard": 400, - "master_crafted": 450, - "artifact": 600 - }, - "melee_mod": { - "standard": 1.3, - "master_crafted": 1.3, - "artifact": 1.3, + "standard": 48, + "master_crafted": 48, + "artifact": 48 }, "description": "Wreathed in glowing smoke, these massive weapons are as sinister in aspect as they are lethal in application, and are capable of obliterating even the mightiest heretics in a blaze of killing light.", "special_description": "Dark Angels exclusive", @@ -541,8 +447,8 @@ global.weapons = { "ranged_hands": 2, "ammo": 0, "range": 1, - "spli": 6, - "arp": 3, + "spli": 3, + "arp": 26, "tags": ["power", "mace", "siege", "pious", "savage"], "req_exp": 100, }, @@ -570,45 +476,35 @@ global.weapons = { "Crozius Arcanum": { "abbreviation": "Crzus", "attack": { - "standard": 250, - "master_crafted": 300, - "artifact": 400 - }, - "melee_mod": { - "standard": 1, - "master_crafted": 1, - "artifact": 1 + "standard": 25, + "master_crafted": 25, + "artifact": 25 }, "description": "The Crozius Arcanum serves as both a sacred staff of office and a close combat weapon for Astartes Chaplains.", "melee_hands": 1, "ranged_hands": 0, "ammo": 0, "range": 1, - "spli": 4, - "arp": 2, + "spli": 2, + "arp": 14, "tags": ["power", "mace", "pious", "savage", "boarding 2"], }, "Relic Blade": { "abbreviation": "RlcBld", "attack": { - "standard": 600, - "master_crafted": 750, - "artifact": 900 - }, - "melee_mod": { - "standard": 1, - "master_crafted": 1.1, - "artifact": 1.2 + "standard": 36, + "master_crafted": 36, + "artifact": 36 }, "description": "Ancient Blades of various origins smithed through arcane forging or lost techniques, these blades are deadly beyond belief. These peerless blades slice through ceramite and flesh with ease.", "melee_hands": 2, "ranged_hands": 1, "ammo": 0, "range": 1, - "spli": 8, - "arp": 2, + "spli": 3, + "arp": 18, "special_properties": ["Parry"], - "maintenance" : 0.1, + "maintenance" : 0.1, "tags": ["power", "sword", "martial"], }, @@ -616,8 +512,8 @@ global.weapons = { "abbreviation": "BltPstl", "attack": { "standard": 30, - "master_crafted": 40, - "artifact": 50 + "master_crafted": 30, + "artifact": 30 }, "description": "A smaller, more compact version of the venerable Boltgun. This model is produced in the standard Godwyn pattern.", "melee_hands": 0, @@ -632,34 +528,36 @@ global.weapons = { "Wrist-Mounted Storm Bolter": { "abbreviation": "WrstBlt", "attack": { - "standard": 275, - "master_crafted": 300, - "artifact": 350 + "standard": 30, + "master_crafted": 30, + "artifact": 30 }, "description": "A smaller, more compact version of the venerable Boltgun. This model is produced in the standard Godwyn pattern.", "melee_hands": 0, "ranged_hands": 1, - "ammo": 10, - "range": 4.1, - "spli": 8, - "arp": 1, + "ammo": 15, + "reload": 2, + "range": 11, + "spli": 4, + "arp": 10, "maintenance" : 0.1, "tags": ["bolt", "pistol", "boarding 2"], }, "Shotgun": { "abbreviation": "Shtgn", "attack": { - "standard": 250, - "master_crafted": 300, - "artifact": 350 + "standard": 30, + "master_crafted": 30, + "artifact": 30 }, "description": "An Astartes Shotgun capable of firing slug and other specialist munitions deadly up close but loses effectiveness at range.", "melee_hands": 0, "ranged_hands": 1, - "ammo": 10, - "range": 4.1, - "spli": 8, - "arp": 1, + "ammo": 9, + "reload": 1, + "range": 4, + "spli": 2, + "arp": 8, "tags": ["boarding 2"], }, "Webber": { @@ -681,108 +579,97 @@ global.weapons = { "Grav-Pistol": { "abbreviation": "GrvPstl", "attack": { - "standard": 250, - "master_crafted": 300, - "artifact": 425 + "standard": 18, + "master_crafted": 18, + "artifact": 18 }, "description": "A smaller version of the Grav-Gun which utilises the gravitic reaction principle most commonly seen powering grav-vehicles such as the Land Speeder.", "melee_hands": 0, "ranged_hands": 1, - "ammo": 4, - "range": 4.1, - "spli": 1, - "arp": 4, - "maintenance" : 0.2, + "ammo": 6, + "reload": 1, + "range": 1, + "spli": 2, + "arp": 12, + "maintenance" : 0.2, "tags": ["grav", "pistol"], }, "Integrated-Grav": { "abbreviation": "IntGrv", "attack": { - "standard": 400, - "master_crafted": 450, - "artifact": 600 + "standard": 24, + "master_crafted": 24, + "artifact": 24 }, "description": "", "melee_hands": 0, "ranged_hands": 0, - "ammo": 3, - "range": 5.1, - "spli": 1, - "arp": 4, + "ammo": 1, + "reload": 1, + "range": 4, + "spli": 5, + "arp": 16, "tags": ["grav"] }, "Grav-Gun": { "abbreviation": "GrvGn", "attack": { - "standard": 400, - "master_crafted": 450, - "artifact": 600 + "standard": 24, + "master_crafted": 24, + "artifact": 24 }, "description": "A medium-sized weapon which utilises the gravitic reaction principle most commonly seen powering grav-vehicles such as the Land Speeder.", "melee_hands": 1, "ranged_hands": 2, - "ammo": 6, - "range": 5, - "spli": 3, - "arp": 4, + "ammo": 8, + "reload": 1, + "range": 4, + "spli": 4, + "arp": 16, "tags": ["grav"], "maintenance" : 0.5, }, "Grav-Cannon": { "abbreviation": "GrvCan", "attack": { - "standard": 600, - "master_crafted": 700, - "artifact": 850 + "standard": 28, + "master_crafted": 28, + "artifact": 28 }, "description": "A bigger version of the Grav-Gun which utilises the gravitic reaction principle most commonly seen powering grav-vehicles such as the Land Speeder.", "melee_hands": 1, "ranged_hands": 2, - "ammo": 8, - "range": 6, + "ammo": 5, + "reload": 3, + "range": 5, "spli": 6, - "arp": 4, + "arp": 20, "tags": ["grav", "heavy_ranged"], "maintenance" : 0.8, }, - "Underslung Bolter": { - "abbreviation": "UndBltr", - "attack": { - "standard": 150, - "master_crafted": 200, - "artifact": 300 - }, - "description": "A compact, secondary Bolter weapon often attached under the barrel of a larger firearm. It allows for rapid fire in close quarters combat.", - "melee_hands": 0, - "ranged_hands": 1, - "ammo": 0, - "range": 10, - "spli": 3, - "arp": 1, - "tags": ["bolt", "attached"] - }, "Stalker Pattern Bolter": { "abbreviation": "StlkBltr", "attack": { - "standard": 180, - "master_crafted": 250, - "artifact": 380 + "standard": 30, + "master_crafted": 30, + "artifact": 30 }, "description": "The Stalker Bolter is a scoped long-range variant of the standard Bolter. Depending on the specific modifications made by the wielder, the Stalker Bolter can serve as a precision battle rifle or a high-powered sniper weapon.", - "melee_hands": 0, + "melee_hands": 1, "ranged_hands": 2, - "ammo": 20, - "range": 16, - "spli": 3, - "arp": 1, + "ammo": 24, + "reload": 1, + "range": 20, + "spli": 1, + "arp": 8, "tags": ["bolt", "precision"] }, "Bolter": { "abbreviation": "Bltr", "attack": { "standard": 30, - "master_crafted": 40, - "artifact": 50 + "master_crafted": 30, + "artifact": 30 }, "description": "A standard Bolter, a two-handed firearm that launches rocket propelled projectiles that detonate after penetrating the target. It is a versatile and iconic weapon of Adeptus Astartes, their resounding detonations carry the Emperor's Wrath.", "melee_hands": 1, @@ -797,79 +684,81 @@ global.weapons = { "Heavy Flamer": { "abbreviation": "HvyFlmr", "attack": { - "standard": 500, - "master_crafted": 550, - "artifact": 600 + "standard": 35, + "master_crafted": 35, + "artifact": 35 }, "description": "A significantly heavier flamer typically utilized on vehicle mounts. To carry them on foot requires Power Armor.", "melee_hands": 1, "ranged_hands": 2.25, - "ammo": 8, - "range": 4, - "spli": 20, - "arp": 2, + "ammo": 10, + "reload": 3, + "range": 3, + "spli": 9, + "arp": 12, "tags": ["flame", "heavy_ranged", "boarding 3"] }, "CCW Heavy Flamer": { "abbreviation": "CCWHvyFlmr", "attack": { - "standard": 500, - "master_crafted": 550, - "artifact": 600 + "standard": 70, + "master_crafted": 70, + "artifact": 70 }, "description": "A powerful close combat weapon integrated with a flamer. Enemeies rarely expect a dreadnough claw to spew promethium.", "melee_hands": 1, "ranged_hands": 0, - "ammo": 6, - "range": 2.1, - "spli": 20, - "arp": 2, + "range": 1, + "spli": 3, + "arp": 18, + "second_profiles": ["Heavy Flamer"], "tags": ["dreadnought","heavy_ranged", "flame"] }, "Dreadnought Power Claw": { "abbreviation": "PwrClw", "attack": { - "standard": 400, - "master_crafted": 600, - "artifact": 800 + "standard": 70, + "master_crafted": 70, + "artifact": 70 }, "description": "A brutal crushing claw capable of tearing open armor and flesh with ease utilizing disruptor fields.", "melee_hands": 5, "range": 1, - "spli": 10, - "arp": 4, + "spli": 3, + "arp": 18, "tags": ["power", "vehicle", "dual", "dreadnought", "fist"], "maintenance" : 0.1, }, "Close Combat Weapon": { "abbreviation": "CCW", "attack": { - "standard": 350, - "master_crafted": 450, - "artifact": 550 + "standard": 70, + "master_crafted": 70, + "artifact": 70 }, "description": "While a variety of melee weapons are used by dreadnoughts, this power fist with an integrated flamer is the most common.", "melee_hands": 5, "range": 1, - "spli": 10, - "arp": 4, + "spli": 3, + "arp": 18, "tags": ["vehicle", "dreadnought", "fist"], "maintenance" : 0.1, }, "Inferno Cannon": { "abbreviation": "InfCann", "attack": { - "standard": 750, - "master_crafted": 875, - "artifact": 1000 + "standard": 52, + "master_crafted": 52, + "artifact": 52 }, "description": "A huge vehicle-mounted flame weapon that fires with explosive force. The reservoir is liable to explode.", "melee_hands": 0, "ranged_hands": 3, - "ammo": 0, - "range": 4.1, - "spli": 20, - "arp": 2, + "ammo": 10, + "reload": 4, + "range": 6, + "spli": 12, + "arp": 16, "tags": ["vehicle","heavy_ranged", "flame", "dreadnought"] }, "Integrated-Melta": { @@ -882,154 +771,164 @@ global.weapons = { "description": "", "melee_hands": 0, "ranged_hands": 0, - "ammo": 5, - "range": 3.1, + "ammo": 1, + "reload": 1, + "range": 2, "spli": 1, - "arp": 4, + "arp": 24, "tags": ["melta"] }, "Meltagun": { "abbreviation": "Mltgn", "attack": { - "standard": 350, - "master_crafted": 425, - "artifact": 550 + "standard": 50, + "master_crafted": 50, + "artifact": 50 }, "description": "A loud weapon that roars with fury, this gun vaporizes flesh and armor alike. Due to heat dissipation, it has only a short range.", "melee_hands": 1, "ranged_hands": 2, "ammo": 6, - "range": 2.1, - "spli": 6, - "arp": 3, + "reload": 2, + "range": 2, + "spli": 1, + "arp": 24, "tags": ["melta","boarding 3"] }, "Multi-Melta": { "abbreviation": "MltMelt", "attack": { - "standard": 500, - "master_crafted": 600, - "artifact": 700 + "standard": 55, + "master_crafted": 55, + "artifact": 55 }, "description": "Though bearing longer range than the Meltagun, this weapon's great size usually restricts it to vehicles though those with Power Armor can carry this cumbersome weapon into battle.", "melee_hands": 1, "ranged_hands": 2.25, - "ammo": 8, - "range": 4.1, - "spli": 10, - "arp": 3, + "ammo": 10, + "reload": 2, + "range": 7, + "spli": 1, + "arp": 26, "tags": ["melta", "heavy_ranged", "dreadnought", "boarding 1"] }, "Plasma Pistol": { "abbreviation": "PlsmPstl", "attack": { - "standard": 220, - "master_crafted": 270, - "artifact": 320 + "standard": 30, + "master_crafted": 30, + "artifact": 30 }, "description": "A pistol variant of the plasma gun, this dangerous-to-use weapon has exceptional armor-piercing capabilities.", "melee_hands": 0, "ranged_hands": 1, - "ammo": 0, - "range": 5.1, + "ammo": 6, + "reload": 3, + "range": 4, "spli": 2, - "arp": 3, + "arp": 16, "tags": ["plasma", "energy", "pistol", "boarding 1"] }, "Plasma Cutter": { // Basically a dual-linked plasma pistol "abbreviation": "PlsmCt", "attack": { - "standard": 220, - "master_crafted": 270, - "artifact": 320 + "standard": 30, + "master_crafted": 30, + "artifact": 30 }, "description": "While actually intended to be used on the battlefield as a tool to repair damaged war machines, the Plasma Cutter is equally adept at slicing through even terminator armour with its intense, constant beam of superheated plasma.", "melee_hands": 0, "ranged_hands": 0, - "ammo": 0, - "range": 4.1, - "spli": 1, - "arp": 3, + "ammo": 6, + "reload": 3, + "range": 1, + "spli": 4, + "arp": 16, "tags": ["plasma", "energy", "pistol"] }, "Infernus Pistol": { "abbreviation": "InfPstl", "attack": { - "standard": 250, - "master_crafted": 280, - "artifact": 325 + "standard": 46, + "master_crafted": 46, + "artifact": 46 }, "description": "The Infernus Pistol is a compact pistol varient of the melta gun. A brutal blast of heat to burn away the The Emperor's foes.", "melee_hands": 0, "ranged_hands": 1, "ammo": 4, - "range": 2.1, - "spli": 3, - "arp": 3, + "reload": 1, + "range": 1, + "spli": 1, + "arp": 24, "tags": ["melta", "pistol", "boarding 2"] }, "Integrated-Plasma": { "abbreviation": "IntPls", "attack": { - "standard": 300, - "master_crafted": 350, - "artifact": 450 + "standard": 35, + "master_crafted": 35, + "artifact": 35 }, "description": "", "melee_hands": 0, "ranged_hands": 0, - "ammo": 6, - "range": 10, - "spli": 4, - "arp": 3, + "ammo": 1, + "reload": 1, + "range": 11, + "spli": 2, + "arp": 20, "tags": ["plasma","energy"] }, "Plasma Gun": { "abbreviation": "PlsmGn", "attack": { - "standard": 300, - "master_crafted": 350, - "artifact": 450 + "standard": 35, + "master_crafted": 35, + "artifact": 35 }, "description": "A two-handed weapon that launches blobs of plasma at the target. They are considered both sacred and dangerous, overheating through rapid firing of the weapon. Overheating can result in detonation of the weapon, killing the wielder.", "melee_hands": 0, "ranged_hands": 2, - "ammo": 16, - "range": 10, - "spli": 4, - "arp": 3, + "ammo": 12, + "reload": 4, + "range": 11, + "spli": 2, + "arp": 20, "tags": ["plasma", "energy", "boarding 1"] }, "Plasma Cannon": { "abbreviation": "PlsmCan", "attack": { - "standard": 450, - "master_crafted": 550, - "artifact": 750 + "standard": 46, + "master_crafted": 46, + "artifact": 46 }, "description": "A heavy variant of the plasma gun, its power output is significantly higher and its damage capability shows. However, it maintains the overheating risk of the Plasma Gun", "melee_hands": 1, "ranged_hands": 3, "ammo": 16, - "range": 10, - "spli": 8, - "arp": 3, + "reload": 5, + "range": 16, + "spli": 4, + "arp": 20, "tags": ["plasma","energy","heavy_ranged", "dreadnought"] }, "Sniper Rifle": { "abbreviation": "SnprRfl", "attack": { - "standard": 180, - "master_crafted": 220, - "artifact": 320 + "standard": 30, + "master_crafted": 30, + "artifact": 30 }, "description": "The Sniper Rifle fires a solid shell over long range and boasts powerful telescopic sights to assist, allowing the user to target enemy weak points and distant foes.", "melee_hands": 1, "ranged_hands": 2, - "ammo": 20, - "range": 14, + "ammo": 8, + "reload": 1, + "range": 12, "spli": 1, - "arp": 1, + "arp": 10, "tags": ["precision", "rifle"] }, "Needle Sniper Rifle": { @@ -1051,49 +950,52 @@ global.weapons = { "Assault Cannon": { "abbreviation": "AssCann", "attack": { - "standard": 400, - "master_crafted": 440, - "artifact": 500 + "standard": 56, + "master_crafted": 56, + "artifact": 56 }, "description": "A heavy rotary autocannon with a devastating fire rate that can be counted in the hundreds per minute. It is incredibly effective against infantry and light armored targets.", "melee_hands": 2.1, "ranged_hands": 3, - "ammo": 5, - "range": 12, - "spli": 20, - "arp": 2, + "ammo": 20, + "reload": 3, + "range": 16, + "spli": 10, + "arp": 12, "tags": ["heavy_ranged", "dreadnought"] }, "Autocannon": { "abbreviation": "Autocnn", "attack": { - "standard": 450, - "master_crafted": 500, - "artifact": 600 + "standard": 50, + "master_crafted": 50, + "artifact": 50 }, "description": "A rapid-firing weapon able to use a wide variety of ammunition, from mass-reactive explosive to solid shells. It has been found to be incredibly effective against large groups of targets and even Traitor Astartes to an extent.", "melee_hands": 0, "ranged_hands": 2.25, - "ammo": 25, - "range": 14, - "spli": 12, - "arp": 2, + "ammo": 5, + "reload": 2, + "range": 30, + "spli": 3, + "arp": 12, "tags": ["heavy_ranged","explosive", "dreadnought"] }, "Missile Launcher": { "abbreviation": "MsslLnch", "attack": { - "standard": 300, - "master_crafted": 350, - "artifact": 425 + "standard": 52, + "master_crafted": 52, + "artifact": 52 }, "description": "This shoulder fired weapon is capable of firing either armor-piercing or fragmentation rockets. It's ammunition is limited by what the bearer has carried with them.", "melee_hands": 1, "ranged_hands": 2, - "ammo": 6, - "range": 12, - "spli": 10, - "arp": 2, + "ammo": 1, + "reload": 1, + "range": 26, + "spli": 2, + "arp": 16, "tags": ["heavy_ranged","explosive", "dreadnought"] }, @@ -1116,17 +1018,18 @@ global.weapons = { "Lascannon": { "abbreviation": "Lascnn", "attack": { - "standard": 450, - "master_crafted": 600, - "artifact": 900 + "standard": 75, + "master_crafted": 75, + "artifact": 75 }, "description": "A formidable laser weapon, the lascannon can pierce most vehicles or power armored targets from a tremendous range. The weapon is known for its reliability in combat.", "melee_hands": 1, "ranged_hands": 2.25, - "ammo": 8, - "range": 20, + "ammo": 6, + "reload": 2, + "range": 30, "spli": 1, - "arp": 4, + "arp": 20, "tags": ["heavy_ranged", "las", "energy"] }, "Conversion Beam Projector": { @@ -1148,57 +1051,60 @@ global.weapons = { "Integrated-Bolter": { "abbreviation": "IntgBltr", "attack": { - "standard": 150, - "master_crafted": 200, - "artifact": 300 + "standard": 30, + "master_crafted": 30, + "artifact": 30 }, "description": "A Bolter that can be built directly into the structure of the vehicle, armor, another weapon or Dreadnought. When used as a weapon, it leaves both hands free, allowing to use any, even a twohanded weapon, efficiently.", "melee_hands": 0, "ranged_hands": 0, - "ammo": 8, - "range": 10, - "spli": 5, - "arp": 1, + "ammo": 10, + "reload": 1, + "range": 11, + "spli": 3, + "arp": 8, "tags": ["bolt"] }, "Twin Linked Heavy Bolter": { "abbreviation": "TwnHvyBltr", "attack": { - "standard": 450, - "master_crafted": 500, - "artifact": 650 + "standard": 35, + "master_crafted": 35, + "artifact": 35 }, "description": "Twin-linked Heavy Bolters are an upgraded version of the standard Heavy Bolter weapon, which is known for its high rate of fire and effectiveness against infantry and light vehicles.", "melee_hands": 0, "ranged_hands": 0, - "ammo": 20, + "ammo": 10, + "reload": 2, "range": 16, - "spli": 28, - "arp": 2, + "spli": 12, + "arp": 10, "tags": ["bolt", "heavy_ranged", "vehicle", "dreadnought"] }, "Twin Linked Lascannon": { "abbreviation": "TwnLascnn", "attack": { - "standard": 800, - "master_crafted": 900, - "artifact": 1000 + "standard": 75, + "master_crafted": 75, + "artifact": 75 }, "description": "The Twin-Linked Lascannons is a powerful anti-armour weapons that fire highly focused and devastating duel energy beams capable of penetrating even the toughest armor.", "melee_hands": 0, "ranged_hands": 0, - "ammo": 8, - "range": 24, + "ammo": 6, + "reload": 4, + "range": 30, "spli": 2, - "arp": 4, + "arp": 20, "tags": ["las", "energy", "heavy_ranged", "vehicle", "dreadnought"] }, "Heavy Bolter": { "abbreviation": "HvyBltr", "attack": { "standard": 35, - "master_crafted": 45, - "artifact": 55 + "master_crafted": 35, + "artifact": 35 }, "description": "The Heavy Bolter is a heavy weapon that fires larger and more powerful bolt shells compared to the standard Bolter.", "melee_hands": 1, @@ -1213,34 +1119,36 @@ global.weapons = { "Infernus Heavy Bolter": { "abbreviation": "InfrHvyBltr", "attack": { - "standard": 320, - "master_crafted": 352, - "artifact": 384 + "standard": 35, + "master_crafted": 35, + "artifact": 35 }, "description": "The Deathwatch mag-clamp rare suspensor discs onto their infernus heavy bolters that reduce the weapon’s effective weight considerably. Such weapons are further bolstered by underslung heavy flamers that can incinerate those enemies that make it through the hail of explosive bolts.", "melee_hands": 1, "ranged_hands": 2, "ammo": 10, + "reload": 1, "range": 16, "spli": 6, - "arp": 1, + "arp": 10, "second_profiles": ["Flamer"], "tags": ["heavy_ranged", "combi", "bolt"] }, "Whirlwind Missiles": { "attack": { - "standard": 600, - "master_crafted": 650, - "artifact": 800 + "standard": 42, + "master_crafted": 42, + "artifact": 42 }, "description": "The Whirlwind Missile Launcher is a vehicle-mounted artillery weapon that launches a barrage of powerful missiles at the enemy.", "abbreviation": "WhrlMssl", "melee_hands": 0, "ranged_hands": 0, - "ammo": 6, - "range": 20, - "spli": 40, - "arp": 2, + "ammo": 10, + "reload": 2, + "range": 30, + "spli": 11, + "arp": 12, "tags": ["vehicle","heavy_ranged", "indirect"] }, "HK Missile": { @@ -1250,194 +1158,206 @@ global.weapons = { }, "Twin Linked Heavy Bolter Mount": { "attack": { - "standard": 450, - "master_crafted": 550, - "artifact": 700 + "standard": 35, + "master_crafted": 35, + "artifact": 35 }, "description": "The Twin-linked Heavy Bolters are an upgraded version of the standard Heavy Bolter weapon. They are mounted onto vehicles to create effective fire support platforms.", "abbreviation": "TwnHvyBltr", "melee_hands": 0, "ranged_hands": 0, - "ammo": 20, + "ammo": 10, + "reload": 2, "range": 16, - "spli": 21, - "arp": 2, + "spli": 12, + "arp": 10, "tags": ["vehicle", "dreadnought", "heavy_ranged", "bolt"] }, "Twin Linked Lascannon Mount": { "attack": { - "standard": 800, - "master_crafted": 900, - "artifact": 1000 + "standard": 75, + "master_crafted": 75, + "artifact": 75 }, "description": "The Twin-Lascannons are powerful anti-armour weapons that fire highly focused and devastating energy beams capable of penetrating even the toughest armour. This version is mounted onto vehicles to incease anti-armor capabilities.", "abbreviation": "TwnLascnn", "melee_hands": 0, "ranged_hands": 0, - "ammo": 10, - "range": 20, + "ammo": 6, + "reload": 4, + "range": 30, "spli": 2, - "arp": 4, + "arp": 20, "tags": ["las", "energy", "vehicle", "heavy_ranged", "dreadnought"] }, "Twin Linked Assault Cannon Mount": { "attack": { - "standard": 800, - "master_crafted": 900, - "artifact": 1100 + "standard": 56, + "master_crafted": 56, + "artifact": 56 }, "description": "A twin mount of rotary autocannons, boasting an incredible rate of fire numbering in the hundreds of shots fired per second.", "abbreviation": "TwnAssCnn", "melee_hands": 0, "ranged_hands": 0, - "ammo": 6, - "range": 12, - "spli": 40, - "arp": 2, + "ammo": 20, + "reload": 6, + "range": 16, + "spli": 20, + "arp": 12, "tags": ["vehicle","heavy_ranged", "pintle", "dreadnought"] }, "Reaper Autocannon Mount": { "attack": { - "standard": 700, - "master_crafted": 850, - "artifact": 1000 + "standard": 50, + "master_crafted": 50, + "artifact": 50 }, "description": "An archaic twin-linked autocannon design dating back to the Great Crusade. The Reaper Autocannon is effective against infantry and armored targets. This version is mounted onto vehicles.", "abbreviation": "RprAtcnn", "melee_hands": 0, "ranged_hands": 0, - "ammo": 25, - "range": 15, - "spli": 24, - "arp": 2, + "ammo": 10, + "reload": 4, + "range": 30, + "spli": 6, + "arp": 12, "tags": ["vehicle","heavy_ranged", "pintle"] }, "Quad Linked Heavy Bolter Sponsons": { "attack": { - "standard": 800, - "master_crafted": 900, - "artifact": 1100 + "standard": 35, + "master_crafted": 35, + "artifact": 35 }, "description": "Quad-linked Heavy Bolters are a significantly upgraded version of the standard Heavy Bolter mount; already punishing in a single mount, this quad mount is devastating against a variety of targets.", "abbreviation": "QdHvyBltrs", "melee_hands": 0, "ranged_hands": 0, - "ammo": 15, + "ammo": 10, + "reload": 4, "range": 16, - "spli": 50, - "arp": 2, + "spli": 24, + "arp": 10, "tags": ["bolt","heavy_ranged", "vehicle", "sponson"] }, "Twin Linked Lascannon Sponsons": { "attack": { - "standard": 800, - "master_crafted": 1000, - "artifact": 1200 + "standard": 75, + "master_crafted": 75, + "artifact": 75 }, "description": "The Twin-Linked Lascannons are powerful anti-armour weapons that fire highly focused and devastating energy beams capable of penetrating even the toughest armour. This version is mounted onto the sides of vehicles.", "abbreviation": "TwnLascnns", "melee_hands": 0, "ranged_hands": 0, - "ammo": 5, - "range": 20, - "spli": 4, - "arp": 4, + "ammo": 6, + "reload": 4, + "range": 30, + "spli": 2, + "arp": 20, "tags": ["las", "energy", "vehicle", "heavy_ranged", "sponson", "twin_linked"] }, "Lascannon Sponsons": { "attack": { - "standard": 700, - "master_crafted": 850, - "artifact": 1000 + "standard": 75, + "master_crafted": 75, + "artifact": 75 }, "description": "Lascannons are powerful anti-armour weapons that fire highly focused and devastating energy beams capable of penetrating even the toughest armour. This version is mounted onto the sides of vehicles.", "abbreviation": "Lscnns", "melee_hands": 0, "ranged_hands": 0, - "ammo": 8, - "range": 20, - "spli": 2, - "arp": 4, + "ammo": 6, + "reload": 2, + "range": 30, + "spli": 1, + "arp": 20, "tags": ["las", "energy","heavy_ranged", "vehicle", "sponson"] }, "Hurricane Bolter Sponsons": { "attack": { - "standard": 600, - "master_crafted": 700, - "artifact": 800 + "standard": 32, + "master_crafted": 32, + "artifact": 32 }, "description": "Hurricane Bolters are large hex-mount bolter arrays that are able to deliver a withering hail of anti-infantry fire at short ranges. This version is mounted onto the sides of vehicles.", "abbreviation": "HrcBltrs", "melee_hands": 0, "ranged_hands": 0, - "ammo": 10, - "range": 10, - "spli": 60, - "arp": 1, + "ammo": 25, + "reload": 4, + "range": 6, + "spli": 12, + "arp": 8, "tags": ["bolt","heavy_ranged", "vehicle", "sponson"] }, "Flamestorm Cannon Sponsons": { "attack": { - "standard": 750, - "master_crafted": 850, - "artifact": 900 + "standard": 45, + "master_crafted": 45, + "artifact": 45 }, "description": "A huge vehicle-mounted flamethrower cannon, the heat produced by this terrifying weapon can melt armoured ceramite.", "abbreviation": "FlmstCnns", "melee_hands": 0, "ranged_hands": 0, - "ammo": 6, - "range": 4.1, - "spli": 30, - "arp": 3, + "ammo": 10, + "reload": 4, + "range": 5, + "spli": 12, + "arp": 18, "tags": ["flame","heavy_ranged", "vehicle", "sponson"] }, "Twin Linked Heavy Flamer Sponsons": { "attack": { - "standard": 600, - "master_crafted": 750, - "artifact": 900 + "standard": 35, + "master_crafted": 35, + "artifact": 35 }, "description": "A twin-linked significantly heavier flamer attached to the sponsons on a vehicle.", "abbreviation": "TwnHvyFlmrs", - "melee_hands": 0, - "ranged_hands": 0, - "ammo": 8, - "range": 4.1, - "spli": 40, - "arp": 2, + "melee_hands": 0, + "ranged_hands": 0, + "ammo": 10, + "reload": 6, + "range": 3, + "spli": 18, + "arp": 12, "tags": ["flame","heavy_ranged", "vehicle", "dreadnought", "sponson"] }, "Twin Linked Bolters": { "attack": { - "standard": 275, - "master_crafted": 350, - "artifact": 450 + "standard": 35, + "master_crafted": 35, + "artifact": 35 }, "description": "A Twin-linked Bolter consists of two Bolter weapons mounted side by side, typically on a vehicle or a dedicated weapons platform.", "abbreviation": "TwnBltrs", "melee_hands": 1, "ranged_hands": 2, - "ammo": 30, - "range": 10, - "spli": 10, - "arp": 1, + "ammo": 10, + "reload": 2, + "range": 16, + "spli": 12, + "arp": 10, "tags": ["bolt", "vehicle"] }, "Twin Linked Multi-Melta Sponsons": { "abbreviation": "TwnMltMelts", "attack": { - "standard": 1200, - "master_crafted": 1400, - "artifact": 1650 + "standard": 55, + "master_crafted": 55, + "artifact": 55 }, "description": "Though bearing longer range than the Meltagun, this weapon's great size usually restricts it to vehicles. In this case it is mounted to the sponsons on a vehicle.", "melee_hands": 0, "ranged_hands": 0, - "ammo": 8, - "range": 4.1, - "spli": 20, - "arp": 4, + "ammo": 10, + "reload": 2, + "range": 7, + "spli": 1, + "arp": 26, "tags": ["vehicle","heavy_ranged", "Sponson", "melta"], "maintenance" : 0.05, }, @@ -1460,34 +1380,36 @@ global.weapons = { "Heavy Bolter Sponsons": { "abbreviation": "HvyBltrs", "attack": { - "standard": 450, - "master_crafted": 550, - "artifact": 750 + "standard": 35, + "master_crafted": 35, + "artifact": 35 }, "description": "Heavy Bolters are mounted in sponsons. They are known for high rates of fire and effectiveness against infantry and light vehicles.", "melee_hands": 0, "ranged_hands": 0, - "ammo": 20, - "range": 14, - "spli": 28, - "arp": 2, + "ammo": 10, + "reload": 1, + "range": 16, + "spli": 6, + "arp": 10, "tags": ["heavy_ranged", "vehicle", "sponson", "bolt"] }, "Heavy Flamer Sponsons": { "abbreviation": "HvyFlmrs", "attack": { - "standard": 500, - "master_crafted": 550, - "artifact": 600 + "standard": 35, + "master_crafted": 35, + "artifact": 35 }, "description": "A significantly heavier flamer attached to the sponsons on a vehicle.", "abbreviation": "SpnHvyFlmrs", "melee_hands": 0, "ranged_hands": 0, - "ammo": 8, - "range": 4.1, - "spli": 40, - "arp": 2, + "ammo": 10, + "reload": 3, + "range": 3, + "spli": 9, + "arp": 12, "tags": ["flame","heavy_ranged", "vehicle", "sponson"], "maintenance" : 0.05, }, @@ -1510,156 +1432,159 @@ global.weapons = { "Autocannon Turret": { "abbreviation": "Autocnn", "attack": { - "standard": 600, - "master_crafted": 700, - "artifact": 850 + "standard": 50, + "master_crafted": 50, + "artifact": 50 }, "description": "A Predator-compatible turret mounting a reliable all-purpose autocannon capable of doing effective damage to infantry and lightly armored targets.", "melee_hands": 0, "ranged_hands": 0, - "ammo": 18, - "range": 18, - "spli": 15, - "arp": 2, + "ammo": 5, + "reload": 2, + "range": 30, + "spli": 3, + "arp": 12, "tags": ["vehicle","heavy_ranged","explosive", "turret"] }, "Storm Bolter": { "abbreviation": "StrmBltr", "attack": { - "standard": 275, - "master_crafted": 300, - "artifact": 350 + "standard": 30, + "master_crafted": 30, + "artifact": 30 }, "description": "Compact and double-barreled, this bolt weapon is inaccurate but grants an enormous amount of firepower. Its psychological effect on the enemy should not be understated.", "melee_hands": 1, "ranged_hands": 2, "ammo": 10, - "range": 8, - "spli": 8, - "arp": 1, - "maintenance" : 0.03, + "reload": 2, + "range": 11, + "spli": 6, + "arp": 8, + "maintenance" : 0.03, "tags": ["bolt", "boarding 2"] - }, "Hand Flamer": { "abbreviation": "HndFlmr", "attack": { - "standard": 250, - "master_crafted": 300, - "artifact": 450 + "standard": 30, + "master_crafted": 30, + "artifact": 30 }, "description": "Along with using a lower-capacity fuel tank it has much reduced range, which makes it suited for assault and close-combat purposes, incinerating foes at short range. The weapon is often used by assault squads.", "melee_hands": 0, "ranged_hands": 1, "ammo": 4, - "range": 3.1, - "spli": 8, - "arp": 1, + "reload": 1, + "range": 1, + "spli": 4, + "arp": 8, "tags": ["pistol", "flame", "boarding 2"] }, "Flamer": { "abbreviation": "Flmr", "attack": { - "standard": 350, - "master_crafted": 385, - "artifact": 420 - }, - "melee_mod": { - "standard": 0, - "master_crafted": 0, - "artifact": 0 + "standard": 25, + "master_crafted": 25, + "artifact": 25 }, "description": "Blackened at the tip, this weapon unleashes a torrent of burning promethium - all the better to cleanse sin and impurity with.", "melee_hands": 1, "ranged_hands": 2, - "ammo": 8, - "range": 4.1, - "spli": 14, - "arp": 1, - "maintenance" : 0.01, + "ammo": 6, + "reload": 2, + "range": 2, + "spli": 6, + "arp": 8, + "maintenance" : 0.01, "tags": ["flame", "boarding 2"] }, "Integrated-Flamer": { "attack": { - "standard": 350, - "master_crafted": 385, - "artifact": 420 + "standard": 25, + "master_crafted": 25, + "artifact": 25 }, "description": "", "abbreviation": "IntFlmr", "melee_hands": 0, "ranged_hands": 0, - "ammo": 4, - "range": 4.1, - "spli": 10, - "arp": 1, + "ammo": 1, + "reload": 1, + "range": 2, + "spli": 6, + "arp": 8, "tags": ["flame", "attached"] }, "Combiflamer": { "abbreviation": "CmbFlmr", "attack": { - "standard": 150, - "master_crafted": 175, - "artifact": 200 + "standard": 30, + "master_crafted": 30, + "artifact": 30 }, "description": "A standard Bolter with an underbarrel Flamer for expanded tactical utility.", "melee_hands": 1, "ranged_hands": 2, - "ammo": 15, - "range": 10, - "spli": 5, - "arp": 1, + "ammo": 10, + "reload": 1, + "range": 11, + "spli": 3, + "arp": 8, "second_profiles": ["Integrated-Flamer"], "tags": ["combi", "bolt", "boarding 2"] }, "Combiplasma": { "abbreviation": "CmbPlsm", "attack": { - "standard": 150, - "master_crafted": 175, - "artifact": 200 + "standard": 30, + "master_crafted": 30, + "artifact": 30 }, "description": "A standard Bolter with an underbarrel Plasma Gun for expanded tactical utility.", "melee_hands": 1, "ranged_hands": 2, - "ammo": 8, - "range": 10, - "spli": 5, - "arp": 1, + "ammo": 10, + "reload": 1, + "range": 11, + "spli": 3, + "arp": 8, "second_profiles": ["Integrated-Plasma"], "tags": ["combi", "bolt"] }, "Combigrav": { "abbreviation": "CmbGrv", "attack": { - "standard": 150, - "master_crafted": 175, - "artifact": 200 + "standard": 30, + "master_crafted": 30, + "artifact": 30 }, "description": "A standard Bolter with an underbarrel Grav-Gun for expanded tactical utility.", "melee_hands": 1, "ranged_hands": 2, - "ammo": 8, - "range": 10, - "spli": 5, - "arp": 1, + "ammo": 10, + "reload": 1, + "range": 11, + "spli": 3, + "arp": 8, "second_profiles": ["Integrated-Grav"], "tags": ["combi", "bolt"] }, "Combimelta": { "abbreviation": "CmbMlt", "attack": { - "standard": 150, - "master_crafted": 175, - "artifact": 200 + "standard": 30, + "master_crafted": 30, + "artifact": 30 }, "description": "A standard Bolter with an underbarrel Meltagun for expanded tactical utility.", "melee_hands": 1, "ranged_hands": 2, - "ammo": 8, - "range": 10, - "spli": 5, - "arp": 1, + "ammo": 10, + "reload": 1, + "range": 11, + "spli": 3, + "arp": 8, "second_profiles": ["Integrated-Melta"], "tags": ["combi", "bolt", "boarding 3"] }, @@ -1673,30 +1598,26 @@ global.weapons = { "abbreviation": "Incnrtr", "melee_hands": 1, "ranged_hands": 1, - "ammo": 4, - "range": 4.1, - "spli": 20, - "arp": 2, + "ammo": 10, + "reload": 3, + "range": 3, + "spli": 9, + "arp": 12, "tags": ["flame","boarding 3"] }, "Force Staff": { "attack": { - "standard": 225, - "master_crafted": 270, - "artifact": 350 - }, - "melee_mod": { - "standard": 1, - "master_crafted": 1.1, - "artifact": 1.2 + "standard": 12, + "master_crafted": 12, + "artifact": 12 }, "abbreviation": "FrcStff", "description": "An advanced, psychically-attuned close combat weapon that is only fully effective in the hands of a psyker.", - "melee_hands": 1, + "melee_hands": 2, "ranged_hands": 1, "range": 1, - "spli": 5, - "arp": 2, + "spli": 3, + "arp": 0, "specials": { "psychic_amplification": 25 }, @@ -1750,80 +1671,85 @@ global.weapons = { }, "Twin Linked Lascannon Turret": { "attack": { - "standard": 1000, - "master_crafted": 1100, - "artifact": 1300 + "standard": 75, + "master_crafted": 75, + "artifact": 75 }, "abbreviation": "TwnLscnn", "description": "A Predator-compatible turret mounting a twin-linked lascannon.", - "arp": 4, - "range": 24, - "ammo": 5, - "spli": 1, + "ammo": 6, + "reload": 4, + "range": 30, + "spli": 2, + "arp": 20, "tags": ["las", "energy", "twin_linked","heavy_ranged", "vehicle", "turret"] }, "Twin Linked Assault Cannon Turret": { "abbreviation": "TwnAssCnn", "attack": { - "standard": 800, - "master_crafted": 900, - "artifact": 1100 + "standard": 56, + "master_crafted": 56, + "artifact": 56 }, "description": "A heavy rotary autocannon with a devastating fire rate that can be counted in the hundreds per minute, in a twin mount. It is incredibly effective against infantry and lightly armored targets.", "melee_hands": 2.1, "ranged_hands": 2.25, - "ammo": 5, - "range": 12, - "spli": 40, - "arp": 2, + "ammo": 20, + "reload": 6, + "range": 16, + "spli": 20, + "arp": 12, "tags": ["heavy_ranged", "twin_linked", "vehicle", "turret"] }, "Flamestorm Cannon Turret": { "abbreviation": "FlmstCnn", "attack": { - "standard": 700, - "master_crafted": 850, - "artifact": 900 + "standard": 45, + "master_crafted": 45, + "artifact": 45 }, "description": "A huge vehicle-mounted flamethrower cannon, the heat produced by this terrifying weapon can melt armoured ceramite.", "melee_hands": 0, "ranged_hands": 0, - "ammo": 12, - "range": 4.1, - "spli": 25, - "arp": 3, + "ammo": 10, + "reload": 4, + "range": 5, + "spli": 12, + "arp": 18, "tags": ["flame","heavy_ranged", "vehicle", "turret"] }, "Magna-Melta Turret": { "abbreviation": "MgnMlt", "attack": { - "standard": 800, - "master_crafted": 900, - "artifact": 1000 + "standard": 55, + "master_crafted": 55, + "artifact": 55 }, "description": "Though bearing longer range than the Meltagun, this weapon's great size usually restricts it to vehicles. In this case it is mounted to the turret on a vehicle.", "melee_hands": 0, "ranged_hands": 0, - "ammo": 6, - "range": 4.1, - "spli": 20, - "arp": 4, + "ammo": 10, + "reload": 2, + "range": 7, + "spli": 1, + "arp": 26, "tags": ["vehicle","heavy_ranged", "turret", "melta"] }, "Plasma Destroyer Turret": { "abbreviation": "PlsmDestr", "attack": { - "standard": 800, - "master_crafted": 900, - "artifact": 1000 + "standard": 46, + "master_crafted": 46, + "artifact": 46 }, "description": "A heavy variant of the plasma gun, its power output is significantly higher and its damage capability shows. However, it is mounted in a tank turret.", "melee_hands": 1, "ranged_hands": 3, "ammo": 16, - "range": 14, - "spli": 12, - "arp": 4, + "reload": 5, + "range": 16, + "spli": 4, + "arp": 20, "tags": ["plasma", "energy","heavy_ranged", "vehicle", "turret"] }, "Heavy Conversion Beam Projector": { @@ -1875,7 +1801,7 @@ global.weapons = { "tags": ["vehicle","heavy_ranged", "turret", "volkite", "ancient"] }, -// Hireling weapons + // Hireling weapons // Admech "Hellgun": { "abbreviation": "HllGun", @@ -2450,8 +2376,8 @@ global.gear = { }, "tags": ["vehicle", "Upgrade"], }, -// Hireling Armour - // Admech + // Hireling Armour + // Admech "Skitarii Armour": { "abbreviation": "SkitArm", "description": "Skitarii Armour is something of a misnomer as most Skitarii are in fact bonded more or less permenantly to their advanced mars armour", @@ -2475,7 +2401,7 @@ global.gear = { "artifact": 10 }, }, - // Sororitas and other imperials + // Sororitas and other imperials "Light Power Armour": { "abbreviation": "LPwrArm", "armour_value": { @@ -2514,7 +2440,7 @@ global.gear = { }, "description": "Lighter than most suits, thanks to plug ports that link the Sister's musculature directly to the enhanced fibre bundle network, while providing excellent protection. Helmet has an integrated targeter." }, - // Eldar + // Eldar "Ranger Armour":{ "abbreviation": "RngrArm", "description": "This armour is used by eldar rangers.", @@ -2524,7 +2450,7 @@ global.gear = { "artifact": 30 }, }, - // Orks + // Orks "Ork Armour": { "abbreviation": "OrkArm", "armour_value": { @@ -2544,7 +2470,7 @@ global.gear = { }, "description": "Mismatched basic armour used by ork forces" }, - // T'au + // T'au "Fire Warrior Armour": { "abbreviation": "FWarArm", "description": "This armour is used by T'au fire warriors.", @@ -2563,11 +2489,6 @@ global.gear = { "Bionics": { "abbreviation": "Bncs", "description": "Bionics may be given to wounded Astartes to quickly get them back into a combat-ready state, replacing damaged flesh. This is utilized when a Astarte enters a critical state.", - "hp_mod": { - "standard": 30, // Adjusted - "master_crafted": 50, // Adjusted - "artifact": 50 // Adjusted - } }, "Narthecium": { "abbreviation": "Nrthcm", @@ -2576,10 +2497,10 @@ global.gear = { "melee_hands": -0.5, "ranged_hands": -0.5, "damage_resistance_mod": { - "standard": 0, // Adjusted - "master_crafted": 5, // Adjusted - "artifact": 10 // Adjusted - }, // I also had an idea to make Nartheciums and Servo Arms give bonuses to melee and ranged, when master-crafted or artifact, indicating measuring devices that help to find weakpoints and deal more damage, but I'm not sure if You're okay with that + "standard": 0, + "master_crafted": 5, + "artifact": 10 + }, }, "Psychic Hood": { "abbreviation": "PsyHd", @@ -2592,40 +2513,31 @@ global.gear = { "abbreviation": "Rsrius", "description": "Also called the 'Soul's Armour', this amulet has a powerful built-in shield generator. They are an icon of the Imperial Creed and the Emperor's Protection.", "damage_resistance_mod": { - "standard": 15, // Adjusted - "master_crafted": 20, // Adjusted - "artifact": 25 // Adjusted + "standard": 35, + "master_crafted": 40, + "artifact": 45 }, - "hp_mod": { - "standard": 5, - "master_crafted": 10, - "artifact": 10 - } }, "Iron Halo": { "abbreviation": "IrnHalo", "description": "An ancient artifact, these powerful conversion field generators are granted to high ranking battle brothers or heroes of the chapter. Bearers are often looked to for guidance by their fellow Astartes.", "damage_resistance_mod": { - "standard": 35, // Adjusted - "master_crafted": 40, // Adjusted - "artifact": 45 // Adjusted + "standard": 35, + "master_crafted": 40, + "artifact": 45 }, }, "Combat Shield": { - "description": "A lighter, more maneuverable version of a Storm Shield. Due to its flexibility, Combat Shields leave other hand of a Space Marine free to use other hand-to-hand weaponry.", + "description": "A lighter, more maneuverable version of a Storm Shield. Due to its small size, Combat Shield leaves the hand of a Space Marine free to use other weaponry.", "abbreviation": "CmbtShld", - "armour_value": { - "standard": 4, - "master_crafted": 6, - "artifact": 8 + "melee_hands": -0.25, + "ranged_hands": -0.25, + "damage_resistance_mod": { + "standard": 15, + "master_crafted": 20, + "artifact": 25 }, - "weight": 3, "tags": ["shield"], - "hp_mod": { - "standard": 10, - "master_crafted": 15, - "artifact": 20 - }, }, "Plasma Bomb": { "abbreviation": "PlBomb", @@ -2640,45 +2552,21 @@ global.gear = { "Smoke Launchers": { "description": "Useful for providing concealment in open terrain, these launchers project wide-spectrum concealing smoke to prevent accurate targeting of the vehicle.", "abbreviation": "SmkLnchrs", - "damage_resistance_mod": { - "standard": 5, - "master_crafted": 10, - "artifact": 15 - }, "tags": ["smoke", "conceal", "vehicle", "dreadnought"] }, "Dozer Blades": { "description": "An attachment for the front of vehicles, useful for clearing difficult terrain and can be used as an improvised weapon. ", "abbreviation": "DzrBlds", - "attack": { - "standard": 30, - "master_crafted": 35, - "artifact": 50 - }, - "ammo": 0, - "range": 1, - "spli": 1, - "arp": 1, "tags": ["vehicle"], }, "Searchlight": { "description": "A simple solution for fighting in dark environments, searchlights serve to illuminate enemies for ease of targeting.", "abbreviation": "SrchLght", - "ranged_mod": { - "standard": 5, - "master_crafted": 10, - "artifact": 15 - }, "tags": ["vehicle", "dreadnought"], }, "Frag Assault Launchers": { "abbreviation": "FrgAssLnchrs", "description": "These launchers enable a vehicle to clear an area for its loaded troops, or prevent boarding by an enemy at close range.", - "damage_resistance_mod": { - "standard": 10, - "master_crafted": 15, - "artifact": 20 - }, "tags": ["vehicle"], }, "Gene Pod Incubator" : { @@ -2765,47 +2653,3 @@ global.gear = { // Add more mobility items as needed... } } - - -/* - - repeat(2){ - // Artifact weapons - if (arti_armour=false){ - - if (string_count("DUB",thawep)>0){attack=floor(attack*1.5);melee_hands+=1;ranged_hands+=1;spli=1;} - if (string_count("Dae",thawep)>0){attack=floor(attack*1.5);amm=-1;} - if (string_count("VOI",thawep)>0){attack=floor(attack*1.2);} - if (string_count("ADAMANTINE",thawep)>0){attack=floor(attack*1.1);} - - if (string_count("MINOR",thawep)>0){attack=floor(attack*0.85);} - if (string_count("MNR",thawep)>0){attack=floor(attack*0.85);} - } - - } - // Vehicle Upgrades - - if (equipment_1="Lucifer Pattern Engine"){statt=5;special_description="";emor=1; - descr="A significant upgrade over the more common patterns of Rhino-chassis engines, these engines provide greater output.";} - - // Vehicle Utility Weapons - if (thawep="HK Missile"){attack=350;arp=1;range=50;ranged_hands+=1;amm=1;spli=1; - descr="A single-use long-range anti-tank missile, this weapon can surgically destroy armoured targets in the opening stages of a battle.";} - - // Land Raider Sponsons - // Predator Turrets - - if (thawep="Twin Linked Assault Cannon Turret"){attack=360;arp=0;range=12;amm=10;spli=1; - descr="A Predator-compatible turret mounting a pair of short range anti-infantry assault cannons. ";} - if (thawep="Flamestorm Cannon Turret"){attack=400;arp=1;range=2.1;amm=12;spli=1; - descr="A Predator-compatible turret housing a huge flamethrower, the heat produced by this terrifying weapon can crack even armoured ceramite. ";} - if (thawep="Magna-Melta Turret"){attack=400;arp=1;range=6;amm=12; - descr="A Predator-compatible turret housing a magna-melta, a devastating short-range anti-tank weapon. ";} - if (thawep="Plasma Destroyer Turret"){attack=350;arp=1;range=15;spli=1; - descr="A Predator-compatible turret housing a plasma destroyer, sometimes called the plasma executioner after the vehicle variants that mount this terrifying anti-armour weapon. ";} - if (thawep="Heavy Conversion Beamer Turret"){attack=750;arp=1;range=25;amm=3;spli=1; - descr="A Predator-compatible turret housing a Heavy Conversion Beam Projector, a heavy energy weapon that turns a target's own matter against it by converting it into destructive energy.";} - if (thawep="Neutron Blaster Turret"){attack=400;arp=1;range=15;amm=10 - descr="A Predator-compatible turret housing a neutron blaster; a weapon from the Dark Age of Technology, this weapon is capable of destroying enemy armour with impunity. ";} - if (thawep="Volkite Saker Turret"){attack=400;arp=0;range=18;amm=50;spli=1; - descr="A Predator-compatible turret housing a Volkite Saker, capable of igniting entire formations of enemy forces with a single sweep. ";} From 13a2297e93c98f616e84dc692067d9d0c143dce8 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Sun, 13 Apr 2025 14:50:54 +0300 Subject: [PATCH 54/80] More bugfixing --- objects/obj_pnunit/Alarm_0.gml | 2 ++ scripts/scr_clean/scr_clean.gml | 2 +- .../scr_equipment_struct.gml | 5 ++-- .../scr_player_combat_weapon_stacks.gml | 25 +++++++++---------- scripts/scr_shoot/scr_shoot.gml | 6 ----- scripts/scr_target/scr_target.gml | 1 + scripts/scr_weapon/scr_weapon.gml | 16 ++++++++++-- 7 files changed, 33 insertions(+), 24 deletions(-) diff --git a/objects/obj_pnunit/Alarm_0.gml b/objects/obj_pnunit/Alarm_0.gml index f869c5ac18..82a464deae 100644 --- a/objects/obj_pnunit/Alarm_0.gml +++ b/objects/obj_pnunit/Alarm_0.gml @@ -44,6 +44,7 @@ try { } if (range[i] == 0) { + show_debug_message($"{wep[i]} has broken range! This shouldn't happen!"); log_error($"{wep[i]} has broken range! This shouldn't happen! Range: {range[i]}; Ammo: {ammo[i]}; Owner: {wep_owner[i]}"); // show_debug_message($"A broken weapon was found! i:{i}; Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}; Ammo: {ammo[i]}"); continue; @@ -167,6 +168,7 @@ try { } if (range[i] == 0) { + show_debug_message($"{wep[i]} has broken range! This shouldn't happen!"); log_error($"{wep[i]} has broken range! This shouldn't happen! Range: {range[i]}; Ammo: {ammo[i]}; Owner: {wep_owner[i]}"); // show_debug_message($"A broken weapon was found! i:{i}; Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}; Ammo: {ammo[i]}"); continue; diff --git a/scripts/scr_clean/scr_clean.gml b/scripts/scr_clean/scr_clean.gml index e4225c299d..1bce2de7e0 100644 --- a/scripts/scr_clean/scr_clean.gml +++ b/scripts/scr_clean/scr_clean.gml @@ -121,7 +121,7 @@ function scr_clean(target_object, weapon_data) { var _min_damage = enemy == 13 ? 1 : 0.25; var _dice_sides = 200; var _random_damage_mod = roll_dice(1, _dice_sides, "low") / _dice_sides; - var _armour_points = max(0, marine_ac[marine_index] - armour_pierce); + var _armour_points = max(0, marine_ac[vehicle_id] - armour_pierce); var _modified_damage = (hostile_damage * _random_damage_mod) - _armour_points; if (_modified_damage > 0) { diff --git a/scripts/scr_equipment_struct/scr_equipment_struct.gml b/scripts/scr_equipment_struct/scr_equipment_struct.gml index 812a340426..f256ee50ff 100644 --- a/scripts/scr_equipment_struct/scr_equipment_struct.gml +++ b/scripts/scr_equipment_struct/scr_equipment_struct.gml @@ -11,7 +11,8 @@ function EquipmentStruct(item_data, core_type, quality_request = "none") constru attack = 0; melee_hands = 0; ranged_hands = 0; - ammo = 0; + ammo = -1; + reload = -1; range = 0; spli = 0; arp = 0; @@ -142,7 +143,7 @@ function EquipmentStruct(item_data, core_type, quality_request = "none") constru } break; case "ammo": - if (ammo != 0) { + if (ammo > 0) { item_desc_tooltip += $"Ammo: {ammo}#"; } break; diff --git a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml index c56b2b6412..d699a1b4a6 100644 --- a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml +++ b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml @@ -23,24 +23,21 @@ function add_second_profiles_to_stack(weapon, head_role = false, unit = "none") } -function add_data_to_stack (stack_index, weapon, unit_damage=false, head_role=false, unit="none"){ - if (unit_damage){ +function add_data_to_stack (stack_index, weapon, unit_damage=0, head_role=false, unit="none"){ + if (unit_damage > 0){ att[stack_index]+=unit_damage; } else { att[stack_index]+=weapon.attack; } - apa[stack_index]=weapon.arp; - range[stack_index]=weapon.range; wep_num[stack_index]++; - splash[stack_index]=weapon.spli; - wep[stack_index]=weapon.name; - if (struct_exists(weapon, "reload")) { - ammo_reload[stack_index]=weapon.reload; - } else { - ammo_reload[stack_index]=-1; - } - if (obj_ncombat.started == 0) { + if (!obj_ncombat.started) { + splash[stack_index]=weapon.spli; + wep[stack_index]=weapon.name; + apa[stack_index]=weapon.arp; + range[stack_index]=weapon.range; + + ammo_reload[stack_index]=weapon.reload; ammo_reload_current[stack_index]=-1; ammo_max[stack_index]=weapon.ammo; ammo_current[stack_index]=weapon.ammo; @@ -263,9 +260,11 @@ function scr_player_combat_weapon_stacks() { if (range[weapon_stack_index]>1.9) then continue//creates secondary weapon stack for close combat ranged weaponry use primary_melee.range=1; add_data_to_stack(weapon_stack_index,primary_melee,unit.melee_damage_data[0], head_role,unit); + if (head_role){ player_head_role_stack(weapon_stack_index,unit); - } + } + if (floor(primary_melee.range)<=1 && primary_melee.ammo == 0){ ammo_max[weapon_stack_index]=-1; //no ammo limit } diff --git a/scripts/scr_shoot/scr_shoot.gml b/scripts/scr_shoot/scr_shoot.gml index b62498ceb2..56b858e94f 100644 --- a/scripts/scr_shoot/scr_shoot.gml +++ b/scripts/scr_shoot/scr_shoot.gml @@ -172,12 +172,6 @@ function scr_shoot(weapon_index_position, target_object, target_index, target_ty var _unit_hp = target_object.dudes_hp[target_index]; var _casualties = min(_shot_count, _dudes_num, floor(_total_damage / _unit_hp)); - var _used_damage = _casualties * _unit_hp; - var _leftover_damage = _total_damage - _used_damage; - if (_leftover_damage > 0) { - target_object.dudes_hp[target_index] -= _leftover_damage; - } - if (_casualties > 0) { if (DEBUG_PLAYER_TARGET_SELECTION) { show_debug_message($"{_weapon_name} attacked {target_object.dudes[target_index]} and destroyed {_casualties}!"); diff --git a/scripts/scr_target/scr_target.gml b/scripts/scr_target/scr_target.gml index a202adcb05..574cb3fca7 100644 --- a/scripts/scr_target/scr_target.gml +++ b/scripts/scr_target/scr_target.gml @@ -26,6 +26,7 @@ function scr_target(battle_block, man_or_vehicle = "any") { if (!ds_priority_empty(_priority_queue)) { _biggest_target = ds_priority_delete_max(_priority_queue); } + ds_priority_destroy(_priority_queue); return _biggest_target; diff --git a/scripts/scr_weapon/scr_weapon.gml b/scripts/scr_weapon/scr_weapon.gml index 707ff1b835..8aced7112e 100644 --- a/scripts/scr_weapon/scr_weapon.gml +++ b/scripts/scr_weapon/scr_weapon.gml @@ -755,7 +755,7 @@ global.weapons = { "melee_hands": 0, "ranged_hands": 3, "ammo": 10, - "reload": 4, + "reload": -1, "range": 6, "spli": 12, "arp": 16, @@ -1152,9 +1152,21 @@ global.weapons = { "tags": ["vehicle","heavy_ranged", "indirect"] }, "HK Missile": { + "attack": { + "standard": 65, + "master_crafted": 65, + "artifact": 65 + }, "abbreviation": "HKMssl", "description": "A single shot hunter killer missile that serves as a powerful anti armour/aircraft deterent.", - "tags": ["HK"] + "melee_hands": 0, + "ranged_hands": 0, + "ammo": 1, + "reload": -1, + "range": 30, + "spli": 1, + "arp": 16, + "tags": ["vehicle","heavy_ranged"] }, "Twin Linked Heavy Bolter Mount": { "attack": { From d901e91f117a69b7d5bdf401ee53f0d0eae8492b Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Sun, 13 Apr 2025 14:58:51 +0300 Subject: [PATCH 55/80] Remove XP from a bunch of stat calculation, and change CON --- scripts/scr_clean/scr_clean.gml | 2 +- .../scr_marine_struct/scr_marine_struct.gml | 40 +++++++++---------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/scripts/scr_clean/scr_clean.gml b/scripts/scr_clean/scr_clean.gml index 1bce2de7e0..9314f7400d 100644 --- a/scripts/scr_clean/scr_clean.gml +++ b/scripts/scr_clean/scr_clean.gml @@ -96,7 +96,7 @@ function scr_clean(target_object, weapon_data) { veh_hp[vehicle_id] -= _modified_damage; // Check if the vehicle is destroyed - if (veh_hp[vehicle_id] <= 0 && veh_dead[vehicle_id] == 0) { + if (veh_hp[vehicle_id] <= 0) { veh_dead[vehicle_id] = 1; units_lost++; obj_ncombat.player_forces -= 1; diff --git a/scripts/scr_marine_struct/scr_marine_struct.gml b/scripts/scr_marine_struct/scr_marine_struct.gml index 75e168f608..90fd96464f 100644 --- a/scripts/scr_marine_struct/scr_marine_struct.gml +++ b/scripts/scr_marine_struct/scr_marine_struct.gml @@ -601,6 +601,10 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} unit_health = min(unit_health, max_health()); }; + static restore_max_health = function() { + unit_health = max_health(); + }; + static healing = function(apoth) { if (hp() <= 0) { exit; @@ -674,19 +678,15 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} static update_mobility_item = scr_update_unit_mobility_item; static max_health = function(base = false) { - var max_h = 100 * (1 + ((constitution - 40) * 0.05)); + var _max_health = 1 + (constitution * 3); if (!base) { - max_h += gear_weapon_data("armour", armour(), "hp_mod"); - max_h += gear_weapon_data("gear", gear(), "hp_mod"); - max_h += gear_weapon_data("mobility", mobility_item(), "hp_mod"); - max_h += gear_weapon_data("weapon", weapon_one(), "hp_mod"); - max_h += gear_weapon_data("weapon", weapon_two(), "hp_mod"); + _max_health += gear_weapon_data("armour", armour(), "hp_mod"); + _max_health += gear_weapon_data("gear", gear(), "hp_mod"); + _max_health += gear_weapon_data("mobility", mobility_item(), "hp_mod"); + _max_health += gear_weapon_data("weapon", weapon_one(), "hp_mod"); + _max_health += gear_weapon_data("weapon", weapon_two(), "hp_mod"); } - return max_h; - }; - - static increase_max_health = function(increase) { - return max_health() + (increase * (1 + ((constitution - 40) * 0.05))); //calculate the effect of unit_health buffs + return _max_health; }; // used both to load unit data from save and to add preset base_stats @@ -1122,7 +1122,7 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} static update_gear = scr_update_unit_gear; if (base_group != "none") { - update_health(max_health()); //set marine unit_health to max + restore_max_health(); //set marine unit_health to max } static weapon_one = function(raw = false) { @@ -1356,7 +1356,7 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} damage_res += get_mobility_data("damage_resistance_mod"); damage_res += get_weapon_one_data("damage_resistance_mod"); damage_res += get_weapon_two_data("damage_resistance_mod"); - damage_res = min(75, damage_res + floor((constitution * 0.005) * 100)); + damage_res = min(75, damage_res + floor((constitution * 0.0025) * 100)); return damage_res; }; @@ -1417,9 +1417,9 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} static ranged_attack = function(weapon_slot = 0) { encumbered_ranged = false; //base modifyer based on unit skill set - ranged_att = 100 * ((ballistic_skill / 50) + (dexterity / 400) + (experience / 500)); + ranged_att = 100 * ((ballistic_skill / 50) + (dexterity / 400)); var final_range_attack = 0; - var explanation_string = $"Stat Mod: x{ranged_att / 100}# BS: x{ballistic_skill / 50}# DEX: x{dexterity / 400}# EXP: x{experience / 500}#"; + var explanation_string = $"Stat Mod: x{ranged_att / 100}# BS: x{ballistic_skill / 50}# DEX: x{dexterity / 400}#"; //determine capavbility to weild bulky weapons var carry_data = ranged_hands_limit(); @@ -1677,10 +1677,9 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} var basic_wep_string = $"{primary_weapon.name}: {primary_weapon.attack}#"; explanation_string = basic_wep_string + explanation_string; - _melee_mod += (weapon_skill / 100) + (experience / 500); + _melee_mod += (weapon_skill / 100); explanation_string += $"#Stats:#"; explanation_string += $" WS: {_format_sign((weapon_skill / 100) * 100)}%#"; - explanation_string += $" EXP: {_format_sign((experience / 500) * 100)}%#"; if (primary_weapon.has_tag("martial") || primary_weapon.has_tag("savage")) { var bonus_modifier = 0; @@ -1713,7 +1712,6 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} if (has_force_weapon()) { var psychic_bonus = psionic * 20; psychic_bonus *= 0.5 + (wisdom / 100); - psychic_bonus *= 0.5 + (experience / 100); psychic_bonus *= IsSpecialist(SPECIALISTS_LIBRARIANS) ? 1 : 0.25; psychic_bonus = round(psychic_bonus); primary_weapon.attack += psychic_bonus; @@ -2190,11 +2188,11 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} }; static psychic_amplification = function() { - return round((psionic - 2) + (experience * 0.01)); + return round(psionic - 2); } static psychic_focus = function() { - return round((wisdom * 0.4) + (experience * 0.05)); + return round(wisdom * 0.4); }; static perils_threshold = function() { @@ -2266,7 +2264,7 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} static roll_psionic_increase = function() { if (psionic < 12) { - var _psionic_difficulty = max(1, (psionic * 50) - experience); + var _psionic_difficulty = max(1, (psionic * 50) - wisdom); var _dice_roll = roll_personal_dice(1, _psionic_difficulty, "high", self); if (_dice_roll == _psionic_difficulty) { From 4ff01dced7acea6eb50d4d69e5c5b9a7bcc73d15 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Sun, 13 Apr 2025 17:31:05 +0300 Subject: [PATCH 56/80] Reduce retyping a bit --- objects/obj_enunit/Alarm_0.gml | 151 ++++++------------ objects/obj_pnunit/Alarm_0.gml | 89 ++--------- .../scr_punit_combat_heplers.gml | 76 +++++++++ 3 files changed, 135 insertions(+), 181 deletions(-) diff --git a/objects/obj_enunit/Alarm_0.gml b/objects/obj_enunit/Alarm_0.gml index 5f1bfaa816..5def9c729a 100644 --- a/objects/obj_enunit/Alarm_0.gml +++ b/objects/obj_enunit/Alarm_0.gml @@ -13,34 +13,25 @@ if (enemy == "none") { exit; } -var target_unit_index = 0; +var _target_unit_index = 0; +var _alpha_strike = get_alpha_strike_target(); +if (_alpha_strike != -1) { + enemy = _alpha_strike[0]; + _target_unit_index = _alpha_strike[1]; +} //In melee check engaged = collision_point(x - 10, y, obj_pnunit, 0, 1) || collision_point(x + 10, y, obj_pnunit, 0, 1); // show_debug_message($"enemy is in melee {engaged}") -if (DEBUG_COLUMN_PRIORITY_ENEMY) { - var _t_start1 = get_timer(); -} - if (!engaged) { - // Shooting - for (var i = 0; i < array_length(wep); i++) { - if (wep[i] == "" || wep_num[i] == 0) { - continue; - } - - if (range[i] == 1) { - // show_debug_message($"A melee or no ammo weapon was found! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}; Ammo: {ammo[i]}"); - continue; - } - - if (range[i] == 0) { - log_error($"{wep[i]} has broken range! This shouldn't happen! Range: {range[i]}; Ammo: {ammo[i]}; Owner: {wep_owner[i]}"); - // show_debug_message($"A broken weapon was found! i:{i}; Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}; Ammo: {ammo[i]}"); - continue; - } + if (DEBUG_COLUMN_PRIORITY_ENEMY) { + var _t_start1 = get_timer(); + } + // Shooting + var _ranged_weapons = get_valid_weapons(2, 999); + for (var i = 0, _ranged_len = array_length(_ranged_weapons); i < _ranged_len; i++) { if (!target_block_is_valid(enemy, obj_pnunit)) { log_error($"Invalid player block was found by a ranged enemy!"); enemy = _block_direction(); @@ -51,7 +42,7 @@ if (!engaged) { } var dist = get_block_distance(enemy); - target_unit_index = 0; + _target_unit_index = get_alpha_strike_target(); if (range[i] >= dist) { if (DEBUG_COLUMN_PRIORITY_ENEMY) { @@ -62,68 +53,26 @@ if (!engaged) { var _weapon_type = "ranged"; var _target_priority_queue = ds_priority_create(); - // Alpha strike override - if (obj_ncombat.alpha_strike > 0) { - obj_ncombat.alpha_strike -= 0.5; - with (obj_pnunit) { - for (var u = 0; u < array_length(unit_struct); u++) { - if (marine_type[u] == "Chapter Master") { - enemy = id; - target_unit_index = u; - } - } - } - } - if (DEBUG_COLUMN_PRIORITY_ENEMY) { var _t_start = get_timer(); } // Scan potential targets - var _check_targets = []; + var _targets = []; with (obj_pnunit) { - if (!target_block_is_valid(self, obj_pnunit)) { - continue; + if (target_block_is_valid(self, obj_pnunit)) { + array_push(_targets, self.id); } - array_push(_check_targets, self.id); } - for (var t = 0; t < array_length(_check_targets); t++) { - var enemy_block = _check_targets[t]; - - var _distance = get_block_distance(enemy_block); - if (_distance > range[i]) { - continue; - } - - // Distance weight (closer = higher priority) - var _distance_bonus = (range[i] - _distance - 1) * 20; - - // Column size influence (bigger columns = higher threat?) - var _doomstack_malus = wep_num[i] / enemy_block.column_size; - - // Column size influence (bigger columns = higher threat?) - var _size_bonus = enemy_block.column_size / 10; + for (var t = 0; t < array_length(_targets); t++) { + var _block = _targets[t]; + var _distance = get_block_distance(_block); - // Target type match bonus - var _type_bonus = 0; - if (_target_type == "arp") { - _type_bonus = 20 * (block_type_size(enemy_block, "armour") / enemy_block.column_size); - } else if (_target_type == "att") { - _type_bonus = 20 * (block_type_size(enemy_block, "men") / enemy_block.column_size); + if (_distance <= range[i]) { + var _priority = get_target_priority(i, _block, _target_type); + ds_priority_add(_target_priority_queue, _block, _priority); } - - var priority = 0; - priority += _type_bonus; - priority += _size_bonus; - priority -= _doomstack_malus; - priority += _distance_bonus; - priority *= random_range(0.5, 1.5); - - if (DEBUG_COLUMN_PRIORITY_ENEMY) { - show_debug_message($"Priority: {priority}\n Type: +{_type_bonus}\n Size: +{_size_bonus}\n Doomstack: -{_doomstack_malus}\n Distance: +{_distance_bonus}\n"); - } - ds_priority_add(_target_priority_queue, enemy_block, priority); } // Add fort as fallback target @@ -131,8 +80,7 @@ if (!engaged) { if (fort != noone && !flank) { var d = get_block_distance(fort); if (d <= range[i]) { - var fort_priority = 9000; - ds_priority_add(_target_priority_queue, fort, fort_priority); + ds_priority_add(_target_priority_queue, fort, 999); } } @@ -144,19 +92,18 @@ if (!engaged) { // Shoot highest-priority target if (!ds_priority_empty(_target_priority_queue)) { - var best_target = ds_priority_delete_max(_target_priority_queue); - var is_fort = best_target.object_index == obj_nfort; - var _shoot_type = is_fort ? "wall" : _weapon_type; - var unit_index = is_fort ? 1 : target_unit_index; + var _best_target = ds_priority_delete_max(_target_priority_queue); + var _is_fort = _best_target.object_index == obj_nfort; + var _shoot_type = _is_fort ? "wall" : _weapon_type; + var _unit_index = _is_fort ? 1 : _target_unit_index; - scr_shoot(i, best_target, unit_index, _target_type, _shoot_type); + scr_shoot(i, _best_target, _unit_index, _target_type, _shoot_type); } else { log_error($"{wep[i]} didn't find a valid target! This shouldn't happen!"); if (DEBUG_COLUMN_PRIORITY_ENEMY) { show_debug_message($"We didn't find a valid target! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}"); } } - ds_priority_destroy(_target_priority_queue); } else { if (DEBUG_COLUMN_PRIORITY_ENEMY) { @@ -165,33 +112,19 @@ if (!engaged) { continue; } } -} - -if (DEBUG_COLUMN_PRIORITY_ENEMY) { - var _t_end1 = get_timer(); - var _elapsed_ms1 = (_t_end1 - _t_start1) / 1000; - show_debug_message($"⏱️ Ranged Alarm Execution Time: {_elapsed_ms1}ms"); -} + if (DEBUG_COLUMN_PRIORITY_ENEMY) { + var _t_end1 = get_timer(); + var _elapsed_ms1 = (_t_end1 - _t_start1) / 1000; + show_debug_message($"⏱️ Enemy Ranged Alarm Execution Time: {_elapsed_ms1}ms"); + } +} else { + if (DEBUG_COLUMN_PRIORITY_ENEMY) { + var _t_start1 = get_timer(); + } -//TODO: The melee code was not refactored; -if (engaged) { // Melee - for (var i = 0; i < array_length(wep); i++) { - if (wep[i] == "" || wep_num[i] == 0) { - continue; - } - - if (range[i] >= 2) { - // show_debug_message($"A melee or no ammo weapon was found! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}; Ammo: {ammo[i]}"); - continue; - } - - if (range[i] == 0) { - log_error($"{wep[i]} has broken range! This shouldn't happen! Range: {range[i]}; Ammo: {ammo[i]}; Owner: {wep_owner[i]}"); - // show_debug_message($"A broken weapon was found! i:{i}; Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}; Ammo: {ammo[i]}"); - continue; - } - + var _melee_weapons = get_valid_weapons(1, 2); + for (var i = 0, _wep_len = array_length(_melee_weapons); i < _wep_len; i++) { if (!target_block_is_valid(enemy, obj_pnunit)) { log_error($"Invalid player block was found by a melee enemy!"); exit; @@ -210,6 +143,12 @@ if (engaged) { var _attack_type = apa[i] > 10 ? "arp" : "att"; scr_shoot(i, enemy, 0, _attack_type, "melee"); } + + if (DEBUG_COLUMN_PRIORITY_ENEMY) { + var _t_end1 = get_timer(); + var _elapsed_ms1 = (_t_end1 - _t_start1) / 1000; + show_debug_message($"⏱️ Enemy Melee Alarm Execution Time: {_elapsed_ms1}ms"); + } } //! Here was some stuff that depended on image_index here, that got deleted, because I couldn't figure out why it exists; diff --git a/objects/obj_pnunit/Alarm_0.gml b/objects/obj_pnunit/Alarm_0.gml index 82a464deae..eeb4b29005 100644 --- a/objects/obj_pnunit/Alarm_0.gml +++ b/objects/obj_pnunit/Alarm_0.gml @@ -33,23 +33,8 @@ try { } // Shooting - for (var i = 0; i < array_length(wep); i++) { - if (wep[i] == "" || wep_num[i] == 0) { - continue; - } - - if (range[i] == 1) { - // show_debug_message($"A melee or no ammo weapon was found! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}; Ammo: {ammo[i]}"); - continue; - } - - if (range[i] == 0) { - show_debug_message($"{wep[i]} has broken range! This shouldn't happen!"); - log_error($"{wep[i]} has broken range! This shouldn't happen! Range: {range[i]}; Ammo: {ammo[i]}; Owner: {wep_owner[i]}"); - // show_debug_message($"A broken weapon was found! i:{i}; Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}; Ammo: {ammo[i]}"); - continue; - } - + var _ranged_weapons = get_valid_weapons(2, 999); + for (var i = 0, _ranged_len = array_length(_ranged_weapons); i < _ranged_len; i++) { if (!target_block_is_valid(enemy, obj_enunit)) { enemy = instance_nearest(0, y, obj_enunit); if (!target_block_is_valid(enemy, obj_enunit)) { @@ -85,38 +70,11 @@ try { var enemy_block = _check_targets[t]; var _distance = get_block_distance(enemy_block); - if (_distance > range[i]) { - continue; - } - - // Distance weight (closer = higher priority) - var _distance_bonus = (range[i] - _distance - 1) * 20; - - // Column size influence (bigger columns = higher threat?) - var _doomstack_malus = wep_num[i] / enemy_block.column_size; - - // Column size influence (bigger columns = higher threat?) - var _size_bonus = enemy_block.column_size / 10; - - // Target type match bonus - var _type_bonus = 0; - if (_target_type == "arp") { - _type_bonus = 20 * (block_type_size(enemy_block, "armour") / enemy_block.column_size); - } else if (_target_type == "att") { - _type_bonus = 20 * (block_type_size(enemy_block, "men") / enemy_block.column_size); - } - - var priority = 0; - priority += _type_bonus; - priority += _size_bonus; - priority -= _doomstack_malus; - priority += _distance_bonus; - priority *= random_range(0.5, 1.5); - - if (DEBUG_COLUMN_PRIORITY_PLAYER) { - show_debug_message($"Priority: {priority}\n Type: +{_type_bonus}\n Size: +{_size_bonus}\n Doomstack: -{_doomstack_malus}\n Distance: +{_distance_bonus}\n"); + if (_distance <= range[i]) { + + var _priority = get_target_priority(i, enemy_block, _target_type); + ds_priority_add(_target_priority_queue, enemy_block, _priority); } - ds_priority_add(_target_priority_queue, enemy_block, priority); } if (DEBUG_COLUMN_PRIORITY_PLAYER) { @@ -146,34 +104,15 @@ try { continue; } } - } - - if (DEBUG_COLUMN_PRIORITY_PLAYER) { - var _t_end1 = get_timer(); - var _elapsed_ms1 = (_t_end1 - _t_start1) / 1000; - show_debug_message($"⏱️ Ranged Alarm Execution Time: {_elapsed_ms1}ms"); - } - - //TODO: The melee code was not refactored; - if (engaged) { + if (DEBUG_COLUMN_PRIORITY_PLAYER) { + var _t_end1 = get_timer(); + var _elapsed_ms1 = (_t_end1 - _t_start1) / 1000; + show_debug_message($"⏱️ Ranged Alarm Execution Time: {_elapsed_ms1}ms"); + } + } else { // Melee - for (var i = 0; i < array_length(wep); i++) { - if (wep[i] == "" || wep_num[i] == 0) { - continue; - } - - if (range[i] >= 2) { - // show_debug_message($"A melee or no ammo weapon was found! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}; Ammo: {ammo[i]}"); - continue; - } - - if (range[i] == 0) { - show_debug_message($"{wep[i]} has broken range! This shouldn't happen!"); - log_error($"{wep[i]} has broken range! This shouldn't happen! Range: {range[i]}; Ammo: {ammo[i]}; Owner: {wep_owner[i]}"); - // show_debug_message($"A broken weapon was found! i:{i}; Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}; Ammo: {ammo[i]}"); - continue; - } - + var _melee_weapons = get_valid_weapons(1, 2); + for (var i = 0, _wep_len = array_length(_melee_weapons); i < _wep_len; i++) { if (!target_block_is_valid(enemy, obj_enunit)) { exit; } diff --git a/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml b/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml index aabe127e1e..9ed1abd73b 100644 --- a/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml +++ b/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml @@ -309,3 +309,79 @@ function update_block_size() { function update_block_unit_count() { unit_count = men + medi + dreads + veh; } + +function get_valid_weapons(_range_min, _range_max) { + var valid = []; + + for (var i = 0; i < array_length(wep); i++) { + if (wep[i] == "" || wep_num[i] == 0) { + continue; + } + + if (range[i] == 0) { + log_error($"{wep[i]} has broken range! This shouldn't happen! Range: {range[i]}; Ammo: {ammo[i]}; Owner: {wep_owner[i]}"); + // show_debug_message($"A broken weapon was found! i:{i}; Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}; Ammo: {ammo[i]}"); + continue; + } + + if (range[i] < _range_min || range[i] > _range_max) { + continue; + } + + array_push(valid, i); + } + + return valid; +} + +function get_alpha_strike_target() { + if (obj_ncombat.alpha_strike <= 0) { + return -1; + } + + obj_ncombat.alpha_strike -= 0.5; + with (obj_pnunit) { + for (var u = 0; u < array_length(unit_struct); u++) { + if (marine_type[u] == "Chapter Master") { + return [id, u]; + } + } + } + + return -1; +} + +function get_target_priority(_wep_index, _block, _needed_type) { + var _distance = get_block_distance(_block); + var _size = _block.column_size; + + // Distance weight (closer = higher priority) + var _distance_bonus = (range[_wep_index] - _distance - 1) * 20; + + // Column size influence (bigger columns = higher threat?) + var _doomstack_malus = wep_num[_wep_index] / _size; + + // Column size influence (bigger columns = higher threat?) + var _size_bonus = _size / 10; + + // Target type match bonus + var _type_bonus = 0; + if (_needed_type == "arp") { + _type_bonus = 20 * (block_type_size(_block, "armour") / _size); + } else if (_needed_type == "att") { + _type_bonus = 20 * (block_type_size(_block, "men") / _size); + } + + var _priority = 0; + _priority += _type_bonus; + _priority += _size_bonus; + _priority -= _doomstack_malus; + _priority += _distance_bonus; + _priority *= random_range(0.5, 1.5); + + if (DEBUG_COLUMN_PRIORITY_ENEMY) { + show_debug_message($"Priority: {_priority}\n Type: +{_type_bonus}\n Size: +{_size_bonus}\n Doomstack: -{_doomstack_malus}\n Distance: +{_distance_bonus}\n"); + } + + return _priority; +} From c968415bc6c883dac3f341a1833ae028e26c0f7e Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Sun, 13 Apr 2025 21:26:09 +0300 Subject: [PATCH 57/80] Some cleanup --- objects/obj_enunit/Alarm_1.gml | 3 --- objects/obj_pnunit/Alarm_1.gml | 6 ------ scripts/scr_civil_roster/scr_civil_roster.gml | 1 - scripts/scr_en_weapon/scr_en_weapon.gml | 1 + .../scr_player_combat_weapon_stacks.gml | 3 --- 5 files changed, 1 insertion(+), 13 deletions(-) diff --git a/objects/obj_enunit/Alarm_1.gml b/objects/obj_enunit/Alarm_1.gml index 0092b56b4c..b8a7a4acad 100644 --- a/objects/obj_enunit/Alarm_1.gml +++ b/objects/obj_enunit/Alarm_1.gml @@ -10,8 +10,6 @@ repeat(20) { apa[i] = 0; wep_num[i] = 0; wep_owner[i] = ""; - - // if (wep_owner[i]!="") and (wep_num[i]>1) then wep_owner[i]="";// What if they are using two ranged weapons? Hmmmmm? } i = 0; // men=0;veh=0; @@ -610,7 +608,6 @@ if __b__ { dudes[j] = ""; dudes_num[j] = 0; } - if (dudes_num[j] > 0) and(dudes_onum[j] = -1) then dudes_onum[j] = dudes_num[j]; if (faith[j] > 0) then dudes_dr[j] = max(0.65, dudes_dr[j] + 0.15); } diff --git a/objects/obj_pnunit/Alarm_1.gml b/objects/obj_pnunit/Alarm_1.gml index e8853cc623..a776c983aa 100644 --- a/objects/obj_pnunit/Alarm_1.gml +++ b/objects/obj_pnunit/Alarm_1.gml @@ -1,7 +1 @@ - - -/* */ -/* */ scr_player_combat_weapon_stacks(); - -//show_debug_message("{0},/n{1},/n{2},/n{3},/n{4},/n{5}",wep_num,range,wep,att,wep_solo,wep_title); \ No newline at end of file diff --git a/scripts/scr_civil_roster/scr_civil_roster.gml b/scripts/scr_civil_roster/scr_civil_roster.gml index 4ed12c5e23..557dd29bca 100644 --- a/scripts/scr_civil_roster/scr_civil_roster.gml +++ b/scripts/scr_civil_roster/scr_civil_roster.gml @@ -203,7 +203,6 @@ function scr_civil_roster(_unit_location, _target_location, _is_planet) { targ.dudes_num[targ.men]=1; targ.dudes_hp[targ.men]=unit.hp(); targ.dudes_exp[targ.men]=unit.experience; - targ.dudes_powers[targ.men]=deploying_unit.spe[cooh,va]; targ.dudes_wep1[targ.men]=deploying_unit.wep1[cooh,va]; targ.dudes_wep2[targ.men]=deploying_unit.wep2[cooh,va]; targ.dudes_gear[targ.men]=deploying_unit.gear[cooh,va]; diff --git a/scripts/scr_en_weapon/scr_en_weapon.gml b/scripts/scr_en_weapon/scr_en_weapon.gml index d41baa948b..584feb7107 100644 --- a/scripts/scr_en_weapon/scr_en_weapon.gml +++ b/scripts/scr_en_weapon/scr_en_weapon.gml @@ -1,3 +1,4 @@ +/// @mixin function scr_en_weapon(name, is_man, man_number, man_type, group) { // check if double ranged/melee diff --git a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml index d699a1b4a6..d7c4729276 100644 --- a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml +++ b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml @@ -116,13 +116,10 @@ function scr_player_combat_weapon_stacks() { men=0; dreads=0; for (i=0;i1) then wep_owner[i]="assorted";// What if they are using two ranged weapons? Hmmmmm? } var dreaded=false, unit; From 191edff98c77476d2818c3a2841531c4abdbad15 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Mon, 14 Apr 2025 12:42:46 +0300 Subject: [PATCH 58/80] Weapon stacks to constructors P1 --- ChapterMaster.yyp | 2 +- objects/obj_enunit/Alarm_0.gml | 37 +- objects/obj_enunit/Alarm_1.gml | 28 +- objects/obj_enunit/Create_0.gml | 16 +- objects/obj_pnunit/Alarm_0.gml | 41 +- objects/obj_pnunit/Alarm_3.gml | 35 +- objects/obj_pnunit/Create_0.gml | 17 +- scripts/scr_clean/scr_clean.gml | 26 +- scripts/scr_en_weapon/scr_en_weapon.gml | 1581 ++++++++--------- scripts/scr_flavor/scr_flavor.gml | 20 +- .../scr_player_combat_weapon_stacks.gml | 148 +- .../scr_punit_combat_heplers.gml | 32 +- scripts/scr_shoot/scr_shoot.gml | 204 +-- scripts/scr_target/scr_target.gml | 19 +- .../scr_vehicle_weapon/scr_vehicle_weapon.gml | 127 -- .../scr_weapon_stacks/scr_weapon_stacks.gml | 27 + .../scr_weapon_stacks.yy} | 4 +- 17 files changed, 1079 insertions(+), 1285 deletions(-) delete mode 100644 scripts/scr_vehicle_weapon/scr_vehicle_weapon.gml create mode 100644 scripts/scr_weapon_stacks/scr_weapon_stacks.gml rename scripts/{scr_vehicle_weapon/scr_vehicle_weapon.yy => scr_weapon_stacks/scr_weapon_stacks.yy} (76%) diff --git a/ChapterMaster.yyp b/ChapterMaster.yyp index 532de56643..4e0305b3c3 100644 --- a/ChapterMaster.yyp +++ b/ChapterMaster.yyp @@ -865,9 +865,9 @@ {"id":{"name":"scr_vehicle_count","path":"scripts/scr_vehicle_count/scr_vehicle_count.yy",},}, {"id":{"name":"scr_vehicle_helpers","path":"scripts/scr_vehicle_helpers/scr_vehicle_helpers.yy",},}, {"id":{"name":"scr_vehicle_order","path":"scripts/scr_vehicle_order/scr_vehicle_order.yy",},}, - {"id":{"name":"scr_vehicle_weapon","path":"scripts/scr_vehicle_weapon/scr_vehicle_weapon.yy",},}, {"id":{"name":"scr_void_click","path":"scripts/scr_void_click/scr_void_click.yy",},}, {"id":{"name":"scr_wait_and_execute","path":"scripts/scr_wait_and_execute/scr_wait_and_execute.yy",},}, + {"id":{"name":"scr_weapon_stacks","path":"scripts/scr_weapon_stacks/scr_weapon_stacks.yy",},}, {"id":{"name":"scr_weapon","path":"scripts/scr_weapon/scr_weapon.yy",},}, {"id":{"name":"scr_zoom","path":"scripts/scr_zoom/scr_zoom.yy",},}, {"id":{"name":"turn_towards_point","path":"scripts/turn_towards_point/turn_towards_point.yy",},}, diff --git a/objects/obj_enunit/Alarm_0.gml b/objects/obj_enunit/Alarm_0.gml index 5def9c729a..e8d46753db 100644 --- a/objects/obj_enunit/Alarm_0.gml +++ b/objects/obj_enunit/Alarm_0.gml @@ -30,8 +30,10 @@ if (!engaged) { } // Shooting - var _ranged_weapons = get_valid_weapons(2, 999); + var _ranged_weapons = get_valid_weapon_stacks(weapon_stacks_normal, 2, 999); for (var i = 0, _ranged_len = array_length(_ranged_weapons); i < _ranged_len; i++) { + var _weapon_stack = _ranged_weapons[i]; + if (!target_block_is_valid(enemy, obj_pnunit)) { log_error($"Invalid player block was found by a ranged enemy!"); enemy = _block_direction(); @@ -44,13 +46,11 @@ if (!engaged) { var dist = get_block_distance(enemy); _target_unit_index = get_alpha_strike_target(); - if (range[i] >= dist) { + if (_weapon_stack.range >= dist) { if (DEBUG_COLUMN_PRIORITY_ENEMY) { - show_debug_message($"{wep[i]} IS SHOOTING!"); + show_debug_message($"{_weapon_stack.weapon_name} IS SHOOTING!"); } - var _target_type = apa[i] > 10 ? "arp" : "att"; - var _weapon_type = "ranged"; var _target_priority_queue = ds_priority_create(); if (DEBUG_COLUMN_PRIORITY_ENEMY) { @@ -69,8 +69,8 @@ if (!engaged) { var _block = _targets[t]; var _distance = get_block_distance(_block); - if (_distance <= range[i]) { - var _priority = get_target_priority(i, _block, _target_type); + if (_distance <= _weapon_stack.range) { + var _priority = get_target_priority(_weapon_stack, _block); ds_priority_add(_target_priority_queue, _block, _priority); } } @@ -79,7 +79,7 @@ if (!engaged) { var fort = instance_nearest(x, y, obj_nfort); if (fort != noone && !flank) { var d = get_block_distance(fort); - if (d <= range[i]) { + if (d <= _weapon_stack.range) { ds_priority_add(_target_priority_queue, fort, 999); } } @@ -94,20 +94,16 @@ if (!engaged) { if (!ds_priority_empty(_target_priority_queue)) { var _best_target = ds_priority_delete_max(_target_priority_queue); var _is_fort = _best_target.object_index == obj_nfort; - var _shoot_type = _is_fort ? "wall" : _weapon_type; var _unit_index = _is_fort ? 1 : _target_unit_index; - scr_shoot(i, _best_target, _unit_index, _target_type, _shoot_type); + scr_shoot(_weapon_stack, _best_target, _unit_index); } else { - log_error($"{wep[i]} didn't find a valid target! This shouldn't happen!"); - if (DEBUG_COLUMN_PRIORITY_ENEMY) { - show_debug_message($"We didn't find a valid target! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}"); - } + log_error($"{_weapon_stack.weapon_name} didn't find a valid target! This shouldn't happen!"); } ds_priority_destroy(_target_priority_queue); } else { if (DEBUG_COLUMN_PRIORITY_ENEMY) { - show_debug_message($"I can't shoot, my range is too small! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}"); + show_debug_message($"I can't shoot, my range is too small! Weapon: {_weapon_stack.weapon_name};"); } continue; } @@ -123,25 +119,26 @@ if (!engaged) { } // Melee - var _melee_weapons = get_valid_weapons(1, 2); + var _melee_weapons = get_valid_weapon_stacks(weapon_stacks_normal, 1, 2); for (var i = 0, _wep_len = array_length(_melee_weapons); i < _wep_len; i++) { + var _weapon_stack = _melee_weapons[i]; + if (!target_block_is_valid(enemy, obj_pnunit)) { log_error($"Invalid player block was found by a melee enemy!"); exit; } if (DEBUG_COLUMN_PRIORITY_ENEMY) { - show_debug_message($"{wep[i]} IS IN MELEE!"); + show_debug_message($"{_weapon_stack.weapon_name} IS IN MELEE!"); } if (instance_exists(obj_nfort) && (!flank)) { enemy = instance_nearest(x, y, obj_nfort); - scr_shoot(i, enemy, 0, "arp", "wall"); + scr_shoot(_weapon_stack, enemy, 0); continue; } - var _attack_type = apa[i] > 10 ? "arp" : "att"; - scr_shoot(i, enemy, 0, _attack_type, "melee"); + scr_shoot(_weapon_stack, enemy, 0); } if (DEBUG_COLUMN_PRIORITY_ENEMY) { diff --git a/objects/obj_enunit/Alarm_1.gml b/objects/obj_enunit/Alarm_1.gml index b8a7a4acad..4263aa7c7a 100644 --- a/objects/obj_enunit/Alarm_1.gml +++ b/objects/obj_enunit/Alarm_1.gml @@ -4,13 +4,11 @@ g = 0; men = 0; veh = 0; medi = 0; -repeat(20) { - i += 1; - att[i] = 0; - apa[i] = 0; - wep_num[i] = 0; - wep_owner[i] = ""; -} + +weapon_stacks_normal = {}; +weapon_stacks_vehicle = {}; +weapon_stacks_unique = {}; + i = 0; // men=0;veh=0; @@ -57,15 +55,6 @@ repeat(700) { } j = 0; -/*var no_ap;no_ap=0; - -repeat(18){j+=1; - if (apa[j]=0) then no_ap+=1; -} - -if (no_ap=18){ - if (dudes_veh -}*/ repeat(20) { j += 1; @@ -234,13 +223,6 @@ if __b__ { var i, g; i = 0; g = 0; - repeat(100) { - i += 1; - att[i] = 0; - apa[i] = 0; - wep_num[i] = 0; - } - i = 0; var dreaded; dreaded = false; diff --git a/objects/obj_enunit/Create_0.gml b/objects/obj_enunit/Create_0.gml index 367d5b3970..20c9e1e449 100644 --- a/objects/obj_enunit/Create_0.gml +++ b/objects/obj_enunit/Create_0.gml @@ -44,19 +44,11 @@ averages=1; // x determines column; maybe every 10 or so? -var _enemy_size = 1002; -wep = array_create(_enemy_size, ""); -wep_num = array_create(_enemy_size, 0); -range = array_create(_enemy_size, 0); -att = array_create(_enemy_size, 0); -apa = array_create(_enemy_size, 0); -ammo_current = array_create(_enemy_size, 0); -ammo_max = array_create(_enemy_size, -1); -ammo_reload_current = array_create(_enemy_size, -1); -ammo_reload = array_create(_enemy_size, -1); -splash = array_create(_enemy_size, 0); -wep_owner = array_create(_enemy_size, ""); +weapon_stacks_normal = {}; +weapon_stacks_vehicle = {}; +weapon_stacks_unique = {}; +var _enemy_size = 1002; dude_co = array_create(_enemy_size, 0); dude_id = array_create(_enemy_size, 0); diff --git a/objects/obj_pnunit/Alarm_0.gml b/objects/obj_pnunit/Alarm_0.gml index eeb4b29005..a3704f7108 100644 --- a/objects/obj_pnunit/Alarm_0.gml +++ b/objects/obj_pnunit/Alarm_0.gml @@ -33,7 +33,7 @@ try { } // Shooting - var _ranged_weapons = get_valid_weapons(2, 999); + var _ranged_weapons = get_valid_weapon_stacks(weapon_stacks_normal, 2, 999); for (var i = 0, _ranged_len = array_length(_ranged_weapons); i < _ranged_len; i++) { if (!target_block_is_valid(enemy, obj_enunit)) { enemy = instance_nearest(0, y, obj_enunit); @@ -42,11 +42,10 @@ try { } } + var _weapon_stack = _ranged_weapons[i]; var dist = get_block_distance(enemy); - if (range[i] >= dist) { - var _target_type = apa[i] > 10 ? "arp" : "att"; - var _weapon_type = "ranged"; + if (_weapon_stack.range >= dist) { var _target_priority_queue = ds_priority_create(); if (DEBUG_COLUMN_PRIORITY_PLAYER) { @@ -62,17 +61,17 @@ try { array_push(_check_targets, self.id); } - if (DEBUG_COLUMN_PRIORITY_PLAYER) { - show_debug_message($"{wep[i]} IS HERE!"); - } + // if (DEBUG_COLUMN_PRIORITY_PLAYER) { + // show_debug_message($"{wep[i]} IS HERE!"); + // } for (var t = 0; t < array_length(_check_targets); t++) { var enemy_block = _check_targets[t]; var _distance = get_block_distance(enemy_block); - if (_distance <= range[i]) { + if (_distance <= _weapon_stack.range) { - var _priority = get_target_priority(i, enemy_block, _target_type); + var _priority = get_target_priority(_weapon_stack, enemy_block); ds_priority_add(_target_priority_queue, enemy_block, _priority); } } @@ -88,20 +87,20 @@ try { var best_target = ds_priority_delete_max(_target_priority_queue); var unit_index = 0; - scr_shoot(i, best_target, unit_index, _target_type, _weapon_type); + scr_shoot(_weapon_stack, best_target, unit_index); } else { - log_error($"{wep[i]} didn't find a valid target! This shouldn't happen!"); - if (DEBUG_COLUMN_PRIORITY_PLAYER) { - show_debug_message($"We didn't find a valid target! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}"); - } + log_error($"{_weapon_stack.weapon_name} didn't find a valid target! This shouldn't happen!"); + // if (DEBUG_COLUMN_PRIORITY_PLAYER) { + // show_debug_message($"We didn't find a valid target! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}"); + // } } ds_priority_destroy(_target_priority_queue); } else { - if (DEBUG_COLUMN_PRIORITY_PLAYER) { - show_debug_message($"I can't shoot, my range is too small! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}"); - } - continue; + // if (DEBUG_COLUMN_PRIORITY_PLAYER) { + // show_debug_message($"I can't shoot, my range is too small! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}"); + // } + // continue; } } if (DEBUG_COLUMN_PRIORITY_PLAYER) { @@ -111,14 +110,14 @@ try { } } else { // Melee - var _melee_weapons = get_valid_weapons(1, 2); + var _melee_weapons = get_valid_weapon_stacks(weapon_stacks_normal, 1, 2); for (var i = 0, _wep_len = array_length(_melee_weapons); i < _wep_len; i++) { if (!target_block_is_valid(enemy, obj_enunit)) { exit; } - var _attack_type = apa[i] > 10 ? "arp" : "att"; - scr_shoot(i, enemy, 0, _attack_type, "melee"); + var _weapon_stack = _melee_weapons[i]; + scr_shoot(_weapon_stack, enemy, 0); } } } catch (_exception) { diff --git a/objects/obj_pnunit/Alarm_3.gml b/objects/obj_pnunit/Alarm_3.gml index 6398b1dfe0..b6d4b00008 100644 --- a/objects/obj_pnunit/Alarm_3.gml +++ b/objects/obj_pnunit/Alarm_3.gml @@ -88,28 +88,29 @@ try { // Right here execute some sort of check- if left is open, and engaged, and enemy is only vehicles, and no weapons to hurt them... - if (instance_exists(obj_enunit)){ - if (collision_point(x+10,y,obj_enunit,0,1)) and (!collision_point(x-10,y,obj_pnunit,0,1)){ - var neares=instance_nearest(x+10,y,obj_enunit); + //! This doesn't work very well, so I'll comment it out for now, as I don't want to bother fixing it atm + // if (instance_exists(obj_enunit)){ + // if (collision_point(x+10,y,obj_enunit,0,1)) and (!collision_point(x-10,y,obj_pnunit,0,1)){ + // var neares=instance_nearest(x+10,y,obj_enunit); - if (neares.men=0) and (neares.veh>0){ - var norun; - norun=0; + // if (neares.men=0) and (neares.veh>0){ + // var norun; + // norun=0; - var i;i=0; - repeat(20){i+=1; - if (apa[i]>=30) then norun=1; - } + // var i;i=0; + // repeat(20){i+=1; + // if (apa[i]>=30) then norun=1; + // } - if (norun=0){ - x-=10; - engaged=0; - } + // if (norun=0){ + // x-=10; + // engaged=0; + // } - } - } - } + // } + // } + // } /* */ /* */ diff --git a/objects/obj_pnunit/Create_0.gml b/objects/obj_pnunit/Create_0.gml index 59268d67c9..1de3fd8e15 100644 --- a/objects/obj_pnunit/Create_0.gml +++ b/objects/obj_pnunit/Create_0.gml @@ -82,20 +82,11 @@ veh_dead = array_create(_vehicles_size, 0); veh_local = array_create(_vehicles_size, 0); veh_ally = array_create(_vehicles_size, false); +weapon_stacks_normal = {}; +weapon_stacks_vehicle = {}; +weapon_stacks_unique = {}; + var _dudes_size = 72; -wep = array_create(_dudes_size, ""); -wep_num = array_create(_dudes_size, 0); -range = array_create(_dudes_size, 0); -att = array_create(_dudes_size, 0); -apa = array_create(_dudes_size, 0); -ammo_current = array_create(_dudes_size, 0); -ammo_max = array_create(_dudes_size, -1); -ammo_reload_current = array_create(_dudes_size, -1); -ammo_reload = array_create(_dudes_size, -1); -splash = array_create(_dudes_size, 0); -wep_owner = array_create(_dudes_size, ""); -wep_solo = array_create(_dudes_size, ""); -wep_title = array_create(_dudes_size, ""); dudes = array_create(_dudes_size, ""); dudes_num = array_create(_dudes_size, 0); dudes_vehicle = array_create(_dudes_size, 0); diff --git a/scripts/scr_clean/scr_clean.gml b/scripts/scr_clean/scr_clean.gml index 9314f7400d..4a4a9197d8 100644 --- a/scripts/scr_clean/scr_clean.gml +++ b/scripts/scr_clean/scr_clean.gml @@ -22,13 +22,13 @@ function scr_clean(target_object, weapon_data) { show_debug_message($"Weapon: {weapon_data.name}"); } - var armour_pierce = weapon_data.armour_pierce; + var armour_pierce = weapon_data.piercing; var hostile_shots = weapon_data.shot_count; - var hostile_damage = weapon_data.damage; - var hostile_weapon = weapon_data.name; - var hostile_range = weapon_data.attack_type; + var hostile_damage = weapon_data.attack; + var hostile_weapon = weapon_data.weapon_name; + var hostile_range = weapon_data.range; var target_type = weapon_data.target_type; - var shooter_count = weapon_data.shooter_count; + var shooter_count = weapon_data.weapon_count; var hits = 0; var unit_type = ""; var valid_vehicles = []; @@ -64,15 +64,15 @@ function scr_clean(target_object, weapon_data) { } valid_vehicles = array_shuffle(valid_vehicles); - if (target_type == "arp" && array_empty(valid_vehicles)) { - target_type = "att"; - } else if (target_type = "att" && array_empty(valid_marines)) { - target_type = "arp"; + if (target_type == 1 && array_empty(valid_vehicles)) { + target_type = 0; + } else if (target_type = 0 && array_empty(valid_marines)) { + target_type = 1; } for (var shot = 0; shot < hostile_shots; shot++) { // ### Vehicle Damage Processing ### - if (target_type == "arp" && !array_empty(valid_vehicles)) { + if (target_type == 1 && !array_empty(valid_vehicles)) { // Apply damage for each hostile shot, until we run out of targets hits++; @@ -169,7 +169,7 @@ function scr_clean(target_object, weapon_data) { array_delete(valid_vehicles, random_index, 1); units_lost++; if (array_empty(valid_vehicles)) { - target_type = "att"; + target_type = 0; continue; } } @@ -177,7 +177,7 @@ function scr_clean(target_object, weapon_data) { } // ### Marine + Dreadnought Processing ### - if (target_type == "att" && !array_empty(valid_marines)) { + if (target_type == 0 && !array_empty(valid_marines)) { // Apply damage for each shot hits++; @@ -236,7 +236,7 @@ function scr_clean(target_object, weapon_data) { array_delete(valid_marines, random_index, 1); units_lost++; if (array_empty(valid_marines)) { - target_type = "arp"; + target_type = 1; continue; } } diff --git a/scripts/scr_en_weapon/scr_en_weapon.gml b/scripts/scr_en_weapon/scr_en_weapon.gml index 584feb7107..929bec748e 100644 --- a/scripts/scr_en_weapon/scr_en_weapon.gml +++ b/scripts/scr_en_weapon/scr_en_weapon.gml @@ -1,11 +1,11 @@ /// @mixin -function scr_en_weapon(name, is_man, man_number, man_type, group) { +function scr_en_weapon(_weapon_name, is_man, man_number, man_type, group) { // check if double ranged/melee // then add to that weapon //scr_infantry_weapon - // name: name + // _weapon_name: _weapon_name // is_man: man? //Probably used to differenciate internaly between trooper and vehicle weapons // man_number: number // man_type: owner @@ -13,659 +13,656 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { // Determines combined damage for enemy battle blocks for a single weapon - var atta, arp, acr, rang, amm, spli, i; - i = 0; - rang = 0; - atta = 0; - spli = 0; - arp = 0; - acr = 0; - amm = -1; - var reload = -1; + var _range = 0; + var _attack = 0; + var _shot_count = 0; + var _piercing = 0; + var _ammo = -1; + var _reload = -1; + var _target_type = 0; // faith_bonus = 0; - // var struct = gear_weapon_data("weapon",name); + // var struct = gear_weapon_data("weapon",_weapon_name); - if (string_count("elee", name) > 0) { - var to; - to = string_delete(name, 0, 5); - atta = 10; - arp = 0; - rang = 1; - spli = 3; + if (string_count("elee", _weapon_name) > 0) { + _weapon_name = string_delete(_weapon_name, 0, 5); + _attack = 10; + _piercing = 0; + _range = 1; + _shot_count = 3; } //if (obj_ncombat.enemy=5) then faith_bonus=faith[man_type]; - if (name = "Venom Claws") { - atta = 200; - arp = 1; - rang = 1; - spli = 0; + if (_weapon_name = "Venom Claws") { + _attack = 200; + _piercing = 1; + _range = 1; + _shot_count = 0; if (obj_ini.preomnor = 1) { - atta = 240; + _attack = 240; } } - if (name = "Web Spinner") { - atta = 40; - arp = 0; - rang = 2.1; - spli = 3; - amm = 1; + if (_weapon_name = "Web Spinner") { + _attack = 40; + _piercing = 0; + _range = 2.1; + _shot_count = 3; + _ammo = 1; } - if (name = "Warpsword") { - atta = 300; - arp = 1; - rang = 1; - spli = 3; + if (_weapon_name = "Warpsword") { + _attack = 300; + _piercing = 1; + _range = 1; + _shot_count = 3; } - if (name = "Iron Claw") { - atta = 400; - arp = 1; - rang = 1; - spli = 0; + if (_weapon_name = "Iron Claw") { + _attack = 400; + _piercing = 1; + _range = 1; + _shot_count = 0; } - if (name = "Maulerfiend Claws") { - atta = 300; - arp = 1; - rang = 1; - spli = 3; + if (_weapon_name = "Maulerfiend Claws") { + _attack = 300; + _piercing = 1; + _range = 1; + _shot_count = 3; } - if (name = "Eldritch Fire") { - atta = 80; - arp = 1; - rang = 5.1; + if (_weapon_name = "Eldritch Fire") { + _attack = 80; + _piercing = 1; + _range = 5.1; } - if (name = "Bloodletter Melee") { - atta = 70; - arp = 0; - rang = 1; - spli = 3; + if (_weapon_name = "Bloodletter Melee") { + _attack = 70; + _piercing = 0; + _range = 1; + _shot_count = 3; } - if (name = "Daemonette Melee") { - atta = 65; - arp = 0; - rang = 1; - spli = 3; + if (_weapon_name = "Daemonette Melee") { + _attack = 65; + _piercing = 0; + _range = 1; + _shot_count = 3; } - if (name = "Plaguebearer Melee") { - atta = 60; - arp = 0; - rang = 1; - spli = 3; + if (_weapon_name = "Plaguebearer Melee") { + _attack = 60; + _piercing = 0; + _range = 1; + _shot_count = 3; if (obj_ini.preomnor = 1) { - atta = 70; + _attack = 70; } } - if (name = "Khorne Demon Melee") { - atta = 350; - arp = 1; - rang = 1; - spli = 3; + if (_weapon_name = "Khorne Demon Melee") { + _attack = 350; + _piercing = 1; + _range = 1; + _shot_count = 3; } - if (name = "Demon Melee") { - atta = 250; - arp = 1; - rang = 1; - spli = 3; + if (_weapon_name = "Demon Melee") { + _attack = 250; + _piercing = 1; + _range = 1; + _shot_count = 3; } - if (name = "Lash Whip") { - atta = 80; - arp = 0; - rang = 2; + if (_weapon_name = "Lash Whip") { + _attack = 80; + _piercing = 0; + _range = 2; } - if (name = "Nurgle Vomit") { - atta = 100; - arp = 0; - rang = 2; - spli = 3; + if (_weapon_name = "Nurgle Vomit") { + _attack = 100; + _piercing = 0; + _range = 2; + _shot_count = 3; if (obj_ini.preomnor = 1) { - atta = 260; + _attack = 260; } } - if (name = "Multi-Melta") { - atta = 200; - arp = 1; - rang = 4.1; - spli = 0; - amm = 6; + if (_weapon_name = "Multi-Melta") { + _attack = 200; + _piercing = 1; + _range = 4.1; + _shot_count = 0; + _ammo = 6; } if (obj_ncombat.enemy = 3) { - if (name = "Phased Plasma-fusil") { - atta = 80; - arp = 1; - rang = 7.1; - spli = 3; - } - if (name = "Lightning Gun") { - atta = choose(80, 80, 80, 150); - arp = 0; - rang = 5; - spli = 0; - } - if (name = "Thallax Melee") { - atta = 80; - arp = 0; - rang = 1; - spli = 3; + if (_weapon_name = "Phased Plasma-fusil") { + _attack = 80; + _piercing = 1; + _range = 7.1; + _shot_count = 3; + } + if (_weapon_name = "Lightning Gun") { + _attack = choose(80, 80, 80, 150); + _piercing = 0; + _range = 5; + _shot_count = 0; + } + if (_weapon_name = "Thallax Melee") { + _attack = 80; + _piercing = 0; + _range = 1; + _shot_count = 3; } } if (obj_ncombat.enemy = 6) { if (argument0 = "Fusion Gun"){ - atta = 180; - arp = 1; - rang = 2; - amm = 4; + _attack = 180; + _piercing = 1; + _range = 2; + _ammo = 4; } if (argument0 = "Firepike") { - atta = 150; - arp = 1; - rang = 4; - amm = 4; + _attack = 150; + _piercing = 1; + _range = 4; + _ammo = 4; } if (argument0 = "Singing Spear") { - atta = 150; - arp = 0; - rang = 1; - spli = 3; + _attack = 150; + _piercing = 0; + _range = 1; + _shot_count = 3; } if (argument0 = "Singing Spear Throw") { - atta = 120; - arp = 0; - rang = 2; - spli = 3; + _attack = 120; + _piercing = 0; + _range = 2; + _shot_count = 3; } if (argument0 = "Witchblade") { - atta = 130; - arp = 0; - rang = 1; + _attack = 130; + _piercing = 0; + _range = 1; } if (argument0 = "Psyshock") { - atta = 50; - arp = 0; - rang = 2; + _attack = 50; + _piercing = 0; + _range = 2; } if (argument0 = "Wailing Doom") { - atta = 200; - arp = 1; - rang = 1; - spli = 3; + _attack = 200; + _piercing = 1; + _range = 1; + _shot_count = 3; } if (argument0 = "Avatar Smite") { - atta = 300; - arp = 1; - rang = 2; - amm = 2; + _attack = 300; + _piercing = 1; + _range = 2; + _ammo = 2; } if (argument0 = "Ranger Long Rifle") { - atta = 60; - arp = 0; - rang = 25; + _attack = 60; + _piercing = 0; + _range = 25; } if (argument0 = "Pathfinder Long Rifle") { - atta = 70; - arp = 0; - rang = 25; + _attack = 70; + _piercing = 0; + _range = 25; } if (argument0 = "Shuriken Catapult") { - atta = 50; - arp = 0; - rang = 2; + _attack = 50; + _piercing = 0; + _range = 2; } if (argument0 = "Twin Linked Shuriken Catapult") { - atta = 100; - arp = 0; - rang = 2; + _attack = 100; + _piercing = 0; + _range = 2; } if (argument0 = "Avenger Shuriken Catapult") { - atta = 90; - arp = 0; - rang = 3; + _attack = 90; + _piercing = 0; + _range = 3; } if (argument0 = "Power Weapon") or(argument0 = "Power Blades") { - atta = 100; - arp = 1; - rang = 1; - spli = 3; + _attack = 100; + _piercing = 1; + _range = 1; + _shot_count = 3; } if (argument0 = "Shuriken Pistol") { - atta = 50; - arp = 0; - rang = 2.1; + _attack = 50; + _piercing = 0; + _range = 2.1; } if (argument0 = "Executioner") { - atta = 150; - arp = 1; - rang = 1; + _attack = 150; + _piercing = 1; + _range = 1; } if (argument0 = "Scorpion Chainsword") { - atta = 100; - arp = 0; - rang = 1; - spli = 3; + _attack = 100; + _piercing = 0; + _range = 1; + _shot_count = 3; } if (argument0 = "Mandiblaster") { - atta = 60; - arp = 0; - rang = 1; + _attack = 60; + _piercing = 0; + _range = 1; } if (argument0 = "Biting Blade") { - atta = 125; - arp = 0; - rang = 1; - spli = 3; + _attack = 125; + _piercing = 0; + _range = 1; + _shot_count = 3; } if (argument0 = "Scorpian's Claw") { - atta = 150; - arp = 1; - rang = 1; - spli = 3; + _attack = 150; + _piercing = 1; + _range = 1; + _shot_count = 3; } if (argument0 = "Meltabomb") { - atta = 200; - arp = 1; - rang = 1; - amm = 1; + _attack = 200; + _piercing = 1; + _range = 1; + _ammo = 1; } if (argument0 = "Deathspinner") { - atta = 125; - arp = 0; - rang = 2; + _attack = 125; + _piercing = 0; + _range = 2; } if (argument0 = "Dual Deathspinner") { - atta = 250; - arp = 0; - rang = 2; + _attack = 250; + _piercing = 0; + _range = 2; } if (argument0 = "Reaper Launcher") { - atta = 120; - arp = 1; - rang = 20; - amm = 8; - spli = 3; + _attack = 120; + _piercing = 1; + _range = 20; + _ammo = 8; + _shot_count = 3; } if (argument0 = "Tempest Launcher") { - atta = 200; - arp = 0; - rang = 15; - amm = 8; - spli = 9; + _attack = 200; + _piercing = 0; + _range = 15; + _ammo = 8; + _shot_count = 9; } if (argument0 = "Laser Lance") { - atta = 180; - arp = 1; - rang = 2; - spli = 3; + _attack = 180; + _piercing = 1; + _range = 2; + _shot_count = 3; } if (argument0 = "Fusion Pistol") { - atta = 125; - arp = 1; - rang = 2.1; - amm = 4; + _attack = 125; + _piercing = 1; + _range = 2.1; + _ammo = 4; } if (argument0 = "Plasma Pistol") { - atta = 100; - arp = 1; - rang = 3.1; + _attack = 100; + _piercing = 1; + _range = 3.1; } if (argument0 = "Harlequin's Kiss") { - atta = 250; - arp = 1; - rang = 1; - amm = 1; + _attack = 250; + _piercing = 1; + _range = 1; + _ammo = 1; } if (argument0 = "Wraithcannon") { - atta = 200; - arp = 1; - rang = 2.1; + _attack = 200; + _piercing = 1; + _range = 2.1; } if (argument0 = "Pulse Laser") { - atta = 120; - arp = 0; - rang = 15; + _attack = 120; + _piercing = 0; + _range = 15; } if (argument0 = "Bright Lance") { - atta = 200; - arp = 1; - rang = 8; + _attack = 200; + _piercing = 1; + _range = 8; } if (argument0 = "Shuriken Cannon") { - atta = 160; - arp = 0; - rang = 3; + _attack = 160; + _piercing = 0; + _range = 3; } if (argument0 = "Prism Cannon") { - atta = 400; - arp = 1; - rang = 20; - spli = 1; + _attack = 400; + _piercing = 1; + _range = 20; + _shot_count = 1; } if (argument0 = "Twin Linked Doomweaver") { - atta = 250; - arp = 1; - rang = 2; - spli = 2; + _attack = 250; + _piercing = 1; + _range = 2; + _shot_count = 2; } // Also create difficult terrain? if (argument0 = "Starcannon") { - atta = 250; - arp = 1; - rang = 8; - spli = 4; + _attack = 250; + _piercing = 1; + _range = 8; + _shot_count = 4; } if (argument0 = "Two Power Fists") { - atta = 300; - arp = 1; - rang = 1; - spli = 2; + _attack = 300; + _piercing = 1; + _range = 1; + _shot_count = 2; } if (argument0 = "Flamer") { - atta = 200; - arp = 0; - rang = 2; - amm = 4; - spli = 3; + _attack = 200; + _piercing = 0; + _range = 2; + _ammo = 4; + _shot_count = 3; } if (argument0 = "Titan Starcannon") { - atta = 500; - arp = 1; - rang = 4; - spli = 8; + _attack = 500; + _piercing = 1; + _range = 4; + _shot_count = 8; } if (argument0 = "Phantom Pulsar") { - atta = 500; - arp = 1; - rang = 20; - spli = 3; + _attack = 500; + _piercing = 1; + _range = 20; + _shot_count = 3; } } if (obj_ncombat.enemy = 7) { if (argument0 = "Choppa") { - atta = 12; - arp = 4; - rang = 1; - spli = 1; + _attack = 12; + _piercing = 4; + _range = 1; + _shot_count = 1; } if (argument0 = "Power Klaw") { - atta = 30; - arp = 20; - rang = 1; - spli = 1; + _attack = 30; + _piercing = 20; + _range = 1; + _shot_count = 1; } if (argument0 = "Slugga") { - atta = 20; - arp = 0; - rang = 3.1; - amm = 6; - spli = 3; - reload = 1; + _attack = 20; + _piercing = 0; + _range = 3.1; + _ammo = 6; + _shot_count = 3; + _reload = 1; } if (argument0 = "Tankbusta Bomb") { - atta = 65; - arp = 16; - rang = 1; - amm = 1; - spli = 1; - reload = -1; + _attack = 65; + _piercing = 16; + _range = 1; + _ammo = 1; + _shot_count = 1; + _reload = -1; } if (argument0 = "Big Shoota") { - atta = 24; - arp = 4; - rang = 13; - amm = 6; - spli = 10; - reload = 1; + _attack = 24; + _piercing = 4; + _range = 13; + _ammo = 6; + _shot_count = 10; + _reload = 1; } if (argument0 = "Dakkagun") { - atta = 24; - arp = 4; - rang = 8; - amm = 14; - spli = 7; - reload = 3; + _attack = 24; + _piercing = 4; + _range = 8; + _ammo = 14; + _shot_count = 7; + _reload = 3; } if (argument0 = "Deffgun") { - atta = 30; - arp = 4; - rang = 10; - amm = 6; - spli = 8; - reload = 2; + _attack = 30; + _piercing = 4; + _range = 10; + _ammo = 6; + _shot_count = 8; + _reload = 2; } if (argument0 = "Snazzgun") { - atta = 30; - arp = 10; - rang = 11; - amm = 10; - spli = 2; - reload = 2; + _attack = 30; + _piercing = 10; + _range = 11; + _ammo = 10; + _shot_count = 2; + _reload = 2; } if (argument0 = "Grot Blasta") { - atta = 14; - arp = 0; - rang = 2; - amm = 4; - spli = 2; - reload = 2; + _attack = 14; + _piercing = 0; + _range = 2; + _ammo = 4; + _shot_count = 2; + _reload = 2; } if (argument0 = "Kannon") { - atta = 54; - arp = 12; - rang = 20; - amm = 1; - spli = 5; - reload = 1; + _attack = 54; + _piercing = 12; + _range = 20; + _ammo = 1; + _shot_count = 5; + _reload = 1; } if (argument0 = "Shoota") { - atta = 20; - arp = 0; - amm = 10; - rang = 7; - spli = 3; - reload = 1; + _attack = 20; + _piercing = 0; + _ammo = 10; + _range = 7; + _shot_count = 3; + _reload = 1; } if (argument0 = "Burna") { - atta = 22; - arp = 4; - rang = 3; - amm = 6; - spli = 6; - reload = 2; + _attack = 22; + _piercing = 4; + _range = 3; + _ammo = 6; + _shot_count = 6; + _reload = 2; } if (argument0 = "Skorcha") { - atta = 25; - arp = 6; - rang = 4; - amm = 6; - spli = 8; - reload = 2; + _attack = 25; + _piercing = 6; + _range = 4; + _ammo = 6; + _shot_count = 8; + _reload = 2; } if (argument0 = "Rokkit Launcha") { - atta = 21; - arp = 12; - rang = 16; - spli = 1; + _attack = 21; + _piercing = 12; + _range = 16; + _shot_count = 1; } } if (obj_ncombat.enemy = 8) { - if (name = "Fusion Blaster") { - atta = 150; - arp = 1; - rang = 2; - amm = 4; - } - if (name = "Plasma Rifle") { - atta = 120; - arp = 1; - rang = 10; - } - if (name = "Cyclic Ion Blaster") { - atta = 80; - arp = 0; - rang = 6; - spli = 3; + if (_weapon_name = "Fusion Blaster") { + _attack = 150; + _piercing = 1; + _range = 2; + _ammo = 4; + } + if (_weapon_name = "Plasma Rifle") { + _attack = 120; + _piercing = 1; + _range = 10; + } + if (_weapon_name = "Cyclic Ion Blaster") { + _attack = 80; + _piercing = 0; + _range = 6; + _shot_count = 3; } // x6 - if (name = "Burst Rifle") { - atta = 130; - arp = 0; - rang = 16; - spli = 3; - } - if (name = "Missile Pod") { - atta = 150; - arp = 0; - rang = 15; - amm = 6; - spli = 3; - } - if (name = "Smart Missile System") { - atta = 150; - arp = 0; - rang = 15; - } - if (name = "Small Railgun") { - atta = 150; - arp = 1; - rang = 18; - spli = 1; - } - if (name = "Pulse Rifle") { - atta = 80; - arp = 0; - rang = 12; - } - if (name = "Rail Rifle") { - atta = 80; - arp = 1; - rang = 14; - } - if (name = "Kroot Rifle") { - atta = 100; - arp = 0; - rang = 6; - } - if (name = "Vespid Crystal") { - atta = 100; - arp = 1; - rang = 2.1; - } - if (name = "Railgun") { - atta = 250; - arp = 1; - rang = 20; + if (_weapon_name = "Burst Rifle") { + _attack = 130; + _piercing = 0; + _range = 16; + _shot_count = 3; + } + if (_weapon_name = "Missile Pod") { + _attack = 150; + _piercing = 0; + _range = 15; + _ammo = 6; + _shot_count = 3; + } + if (_weapon_name = "Smart Missile System") { + _attack = 150; + _piercing = 0; + _range = 15; + } + if (_weapon_name = "Small Railgun") { + _attack = 150; + _piercing = 1; + _range = 18; + _shot_count = 1; + } + if (_weapon_name = "Pulse Rifle") { + _attack = 80; + _piercing = 0; + _range = 12; + } + if (_weapon_name = "Rail Rifle") { + _attack = 80; + _piercing = 1; + _range = 14; + } + if (_weapon_name = "Kroot Rifle") { + _attack = 100; + _piercing = 0; + _range = 6; + } + if (_weapon_name = "Vespid Crystal") { + _attack = 100; + _piercing = 1; + _range = 2.1; + } + if (_weapon_name = "Railgun") { + _attack = 250; + _piercing = 1; + _range = 20; } } if (obj_ncombat.enemy = 9) { if (argument0 = "Bonesword") { - atta = 120; - arp = 1; - rang = 1; - spli = 3; + _attack = 120; + _piercing = 1; + _range = 1; + _shot_count = 3; } if (argument0 = "Lash Whip") { - atta = 100; - arp = 0; - rang = 2; + _attack = 100; + _piercing = 0; + _range = 2; } if (argument0 = "Heavy Venom Cannon") { - atta = 200; - arp = 1; - rang = 8; + _attack = 200; + _piercing = 1; + _range = 8; } if (argument0 = "Crushing Claws") { - atta = 150; - arp = 1; - rang = 1; - spli = 3; + _attack = 150; + _piercing = 1; + _range = 1; + _shot_count = 3; } if (argument0 = "Rending Claws") { - atta = 80; - arp = 1; - rang = 1; - spli = 3; + _attack = 80; + _piercing = 1; + _range = 1; + _shot_count = 3; } if (argument0 = "Devourer") { - atta = 90; - arp = 0; - rang = 5; - spli = 3 + _attack = 90; + _piercing = 0; + _range = 5; + _shot_count = 3 if (obj_ini.preomnor = 1) { - atta = 180; + _attack = 180; } } if (argument0 = "Zoanthrope Blast") { - atta = 250; - arp = 1; - rang = 6; - spli = 1; + _attack = 250; + _piercing = 1; + _range = 6; + _shot_count = 1; } if (argument0 = "Carnifex Claws") { - atta = 200; - arp = 1; - rang = 1; - spli = 3; + _attack = 200; + _piercing = 1; + _range = 1; + _shot_count = 3; } if (argument0 = "Venom Cannon") { - atta = 100; - arp = 1; - rang = 5; + _attack = 100; + _piercing = 1; + _range = 5; } if (argument0 = "Deathspitter") { - atta = 100; - arp = 0; - rang = 2.1; + _attack = 100; + _piercing = 0; + _range = 2.1; if (obj_ini.preomnor = 1) { - atta = 150; + _attack = 150; } } if (argument0 = "Fleshborer") { - atta = 70; - arp = 0; - rang = 2.1; + _attack = 70; + _piercing = 0; + _range = 2.1; if (obj_ini.preomnor = 1) { - atta = 19; + _attack = 19; } } if (argument0 = "Scything Talons") { - atta = 50; - arp = 0; - rang = 1; + _attack = 50; + _piercing = 0; + _range = 1; } if (argument0 = "Genestealer Claws") { - atta = 70; - arp = 1; - rang = 1; + _attack = 70; + _piercing = 1; + _range = 1; } if (argument0 = "Witchfire") { - atta = 100; - arp = 1; - rang = 2; + _attack = 100; + _piercing = 1; + _range = 2; } if (argument0 = "Autogun") { - atta = 60; - arp = 0; - rang = 6; - amm = 12; - spli = 3; + _attack = 60; + _piercing = 0; + _range = 6; + _ammo = 12; + _shot_count = 3; } if (argument0 = "Lictor Claws") { - atta = 300; - arp = 1; - rang = 1; + _attack = 300; + _piercing = 1; + _range = 1; } if (argument0 = "Flesh Hooks") { - atta = 100; - arp = 0; - rang = 2; - amm = 1; + _attack = 100; + _piercing = 0; + _range = 2; + _ammo = 1; } } @@ -673,435 +670,435 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { if (obj_ncombat.enemy >= 10) or(obj_ncombat.enemy = 2) or(obj_ncombat.enemy = 5) or(obj_ncombat.enemy = 1) { if (argument0 = "Plasma Pistol") { - atta = 70; - arp = 1; - rang = 3.1; + _attack = 70; + _piercing = 1; + _range = 3.1; } if (argument0 = "Power Weapon") { - atta = 120; - arp = 1; - rang = 1; + _attack = 120; + _piercing = 1; + _range = 1; } if (argument0 = "Power Sword") { - atta = 120; - arp = 1; - rang = 1; + _attack = 120; + _piercing = 1; + _range = 1; } if (argument0 = "Force Weapon") { - atta = 250; - arp = 1; - rang = 1; + _attack = 250; + _piercing = 1; + _range = 1; } if (argument0 = "Chainfist") { - atta = 300; - arp = 1; - rang = 1; - spli = 3; + _attack = 300; + _piercing = 1; + _range = 1; + _shot_count = 3; } if (argument0 = "Meltagun") { - atta = 200; - arp = 1; - rang = 2; - amm = 4; + _attack = 200; + _piercing = 1; + _range = 2; + _ammo = 4; } if (argument0 = "Flamer") { - atta = 160; - arp = 0; - rang = 2.1; - amm = 4; - spli = 3; + _attack = 160; + _piercing = 0; + _range = 2.1; + _ammo = 4; + _shot_count = 3; } if (argument0 = "Heavy Flamer") { - atta = 200; - arp = 0; - rang = 2.1; - amm = 6; - spli = 3; + _attack = 200; + _piercing = 0; + _range = 2.1; + _ammo = 6; + _shot_count = 3; } if (argument0 = "Combi-Flamer") { - atta = 160; - arp = 0; - rang = 2.1; - amm = 1; - spli = 3; + _attack = 160; + _piercing = 0; + _range = 2.1; + _ammo = 1; + _shot_count = 3; } if (argument0 = "Bolter") { - atta = 120; - arp = 0; - rang = 12; - amm = 15; - if (obj_ncombat.enemy = 5) then atta = 80; + _attack = 120; + _piercing = 0; + _range = 12; + _ammo = 15; + if (obj_ncombat.enemy = 5) then _attack = 80; } // Bursts if (argument0 = "Power Fist") { - atta = 250; - arp = 1; - rang = 1; + _attack = 250; + _piercing = 1; + _range = 1; } if (argument0 = "Possessed Claws") { - atta = 150; - arp = 0; - rang = 1; - spli = 3; + _attack = 150; + _piercing = 0; + _range = 1; + _shot_count = 3; } if (argument0 = "Missile Launcher") { - atta = 200; - arp = 0; - rang = 20; - amm = 4; + _attack = 200; + _piercing = 0; + _range = 20; + _ammo = 4; } if (argument0 = "Chainsword") { - atta = 120; - arp = 0; - rang = 1; - spli = 4; + _attack = 120; + _piercing = 0; + _range = 1; + _shot_count = 4; } if (argument0 = "Bolt Pistol") { - atta = 100; - arp = 0; - rang = 3.1; - amm = 18; - spli = 1; + _attack = 100; + _piercing = 0; + _range = 3.1; + _ammo = 18; + _shot_count = 1; } if (argument0 = "Chainaxe") { - atta = 140; - arp = 0; - rang = 1; - spli = 3; + _attack = 140; + _piercing = 0; + _range = 1; + _shot_count = 3; } if (argument0 = "Poisoned Chainsword") { - atta = 150; - arp = 0; - rang = 1; - spli = 1; + _attack = 150; + _piercing = 0; + _range = 1; + _shot_count = 1; if (obj_ini.preomnor = 1) { - atta = 180; + _attack = 180; } } if (argument0 = "Sonic Blaster") { - atta = 150; - arp = 0; - rang = 3; - spli = 6; + _attack = 150; + _piercing = 0; + _range = 3; + _shot_count = 6; } if (argument0 = "Rubric Bolter") { - atta = 150; - arp = 0; - rang = 12; - amm = 15; - spli = 5; + _attack = 150; + _piercing = 0; + _range = 12; + _ammo = 15; + _shot_count = 5; } // Bursts if (argument0 = "Witchfire") { - atta = 200; - arp = 1; - rang = 5.1; - spli = 1; + _attack = 200; + _piercing = 1; + _range = 5.1; + _shot_count = 1; } if (argument0 = "Autogun") { - atta = 60; - arp = 0; - rang = 6; - amm = 12; + _attack = 60; + _piercing = 0; + _range = 6; + _ammo = 12; } if (argument0 = "Storm Bolter") { - atta = 180; - arp = 0; - rang = 8; - amm = 10; - spli = 3; + _attack = 180; + _piercing = 0; + _range = 8; + _ammo = 10; + _shot_count = 3; } if (argument0 = "Lascannon") { - atta = 300; - arp = 1; - rang = 20; - amm = 8; - spli = 1; + _attack = 300; + _piercing = 1; + _range = 20; + _ammo = 8; + _shot_count = 1; } if (argument0 = "Twin Linked Heavy Bolters") { - atta = 240; - arp = 0; - rang = 16; - spli = 3; + _attack = 240; + _piercing = 0; + _range = 16; + _shot_count = 3; } if (argument0 = "Twin-Linked Heavy Bolters") { - atta = 240; - arp = 0; - rang = 16; - spli = 3; + _attack = 240; + _piercing = 0; + _range = 16; + _shot_count = 3; } if (argument0 = "Twin Linked Lascannon") { - atta = 600; - arp = 1; - rang = 20; - spli = 2; + _attack = 600; + _piercing = 1; + _range = 20; + _shot_count = 2; } if (argument0 = "Twin-Linked Lascannon") { - atta = 600; - arp = 1; - rang = 20; - spli = 2; + _attack = 600; + _piercing = 1; + _range = 20; + _shot_count = 2; } if (argument0 = "Battle Cannon") { - atta = 300; - arp = 0; - rang = 12; + _attack = 300; + _piercing = 0; + _range = 12; } if (argument0 = "Demolisher Cannon") { - atta = 500; - arp = 1; - rang = 2; - spli = 8; - if (instance_exists(obj_nfort)) then rang = 5; + _attack = 500; + _piercing = 1; + _range = 2; + _shot_count = 8; + if (instance_exists(obj_nfort)) then _range = 5; } if (argument0 = "Earthshaker Cannon") { - atta = 250; - arp = 0; - rang = 12; - spli = 8; + _attack = 250; + _piercing = 0; + _range = 12; + _shot_count = 8; } if (argument0 = "Havoc Launcher") { - atta = 300; - arp = 0; - rang = 12; - spli = 12; + _attack = 300; + _piercing = 0; + _range = 12; + _shot_count = 12; } if (argument0 = "Baleflame") { - atta = 225; - arp = 1; - rang = 2; + _attack = 225; + _piercing = 1; + _range = 2; } if (argument0 = "Defiler Claws") { - atta = 350; - arp = 1; - rang = 1; - spli = 3; + _attack = 350; + _piercing = 1; + _range = 1; + _shot_count = 3; } if (argument0 = "Reaper Autocannon") { - atta = 320; - arp = 0; - rang = 18; - amm = 10; - spli = 3; + _attack = 320; + _piercing = 0; + _range = 18; + _ammo = 10; + _shot_count = 3; } - if (name = "Ripper Gun") { - atta = 120; - arp = 0; - rang = 3; - amm = 5; - spli = 0; - } - if (name = "Ogryn Melee") { - atta = 90; - arp = 1; - rang = 1; - } - if (name = "Multi-Laser") { - atta = 150; - arp = 0; - rang = 10; + if (_weapon_name = "Ripper Gun") { + _attack = 120; + _piercing = 0; + _range = 3; + _ammo = 5; + _shot_count = 0; + } + if (_weapon_name = "Ogryn Melee") { + _attack = 90; + _piercing = 1; + _range = 1; + } + if (_weapon_name = "Multi-Laser") { + _attack = 150; + _piercing = 0; + _range = 10; } if (argument0 = "Blessed Weapon") { - atta = 150; - arp = 1; - rang = 1; + _attack = 150; + _piercing = 1; + _range = 1; } if (argument0 = "Electro-Flail") { - atta = 125; - arp = 0; - rang = 1; - spli = 3; + _attack = 125; + _piercing = 0; + _range = 1; + _shot_count = 3; } if (argument0 = "Neural Whip") { - atta = 85; - arp = 0; - rang = 1; - spli = 3 + _attack = 85; + _piercing = 0; + _range = 1; + _shot_count = 3 } if (argument0 = "Sarissa") { - atta = 65; - arp = 0; - rang = 2; + _attack = 65; + _piercing = 0; + _range = 2; } if (argument0 = "Seraphim Pistols") { - atta = 120; - arp = 0; - rang = 4; + _attack = 120; + _piercing = 0; + _range = 4; } if (argument0 = "Laser Mace") { - atta = 150; - arp = 0; - rang = 5.1; - amm = 3; + _attack = 150; + _piercing = 0; + _range = 5.1; + _ammo = 3; } if (argument0 = "Heavy Bolter") { - atta = 120; - arp = 0; - rang = 16; - spli = 0; + _attack = 120; + _piercing = 0; + _range = 16; + _shot_count = 0; } - if (name = "Lasgun") { - atta = 80; - arp = 0; - rang = 6; - amm = 30; - } - if (name = "Daemonhost Claws") { - atta = 350; - arp = 1; - rang = 1; - spli = 3; - } - if (name = "Daemonhost_Powers") { - atta = round(random_range(100, 300)); - arp = round(random_range(100, 300)); - rang = round(random_range(1, 6)); - spli = choose(0, 1); + if (_weapon_name = "Lasgun") { + _attack = 80; + _piercing = 0; + _range = 6; + _ammo = 30; + } + if (_weapon_name = "Daemonhost Claws") { + _attack = 350; + _piercing = 1; + _range = 1; + _shot_count = 3; + } + if (_weapon_name = "Daemonhost_Powers") { + _attack = round(random_range(100, 300)); + _piercing = round(random_range(100, 300)); + _range = round(random_range(1, 6)); + _shot_count = choose(0, 1); } } if (obj_ncombat.enemy = 13) { // Some of these, like the Gauss Particle Cannon and Particle Whip, used to be more than twice as strong. - if (name = "Staff of Light") { - atta = 200; - arp = 1; - rang = 1; - spli = 3; - } - if (name = "Staff of Light Shooting") { - atta = 180; - arp = 1; - rang = 3; - spli = 3; - } - if (name = "Warscythe") { - atta = 200; - arp = 1; - rang = 1; - spli = 0; - } - if (name = "Gauss Flayer") { - atta = 50; - arp = 0; - rang = 6.1; - spli = 1; - } - if (name = "Gauss Blaster") { - atta = 80; - arp = 0; - rang = 6.1; - spli = 0; - } - if (name = "Gauss Cannon") { - atta = 120; - arp = 1; - rang = 10; - spli = 3; - } - if (name = "Gauss Particle Cannon") { - atta = 250; - arp = 1; - rang = 10.1; - spli = 3; - } - if (name = "Overcharged Gauss Cannon") { - atta = 250; - arp = 1; - rang = 8.1; - spli = 3; - } - if (name = "Wraith Claws") { - atta = 80; - arp = 0; - rang = 1; - spli = 0; - } - if (name = "Claws") { - atta = 300; - arp = 0; - rang = 1; - spli = 0; - } - if (name = "Gauss Flux Arc") { - atta = 180; - arp = 0; - rang = 8; - spli = 3; - } - if (name = "Particle Whip") { - atta = 300; - arp = 0; - rang = 4.1; - spli = 3; - } - if (name = "Gauss Flayer Array") { - atta = 180; - arp = 0; - rang = 8.1; - spli = 3; - } - if (name = "Doomsday Cannon") { - atta = 300; - arp = 1; - rang = 6.1; - spli = 3; + if (_weapon_name = "Staff of Light") { + _attack = 200; + _piercing = 1; + _range = 1; + _shot_count = 3; + } + if (_weapon_name = "Staff of Light Shooting") { + _attack = 180; + _piercing = 1; + _range = 3; + _shot_count = 3; + } + if (_weapon_name = "Warscythe") { + _attack = 200; + _piercing = 1; + _range = 1; + _shot_count = 0; + } + if (_weapon_name = "Gauss Flayer") { + _attack = 50; + _piercing = 0; + _range = 6.1; + _shot_count = 1; + } + if (_weapon_name = "Gauss Blaster") { + _attack = 80; + _piercing = 0; + _range = 6.1; + _shot_count = 0; + } + if (_weapon_name = "Gauss Cannon") { + _attack = 120; + _piercing = 1; + _range = 10; + _shot_count = 3; + } + if (_weapon_name = "Gauss Particle Cannon") { + _attack = 250; + _piercing = 1; + _range = 10.1; + _shot_count = 3; + } + if (_weapon_name = "Overcharged Gauss Cannon") { + _attack = 250; + _piercing = 1; + _range = 8.1; + _shot_count = 3; + } + if (_weapon_name = "Wraith Claws") { + _attack = 80; + _piercing = 0; + _range = 1; + _shot_count = 0; + } + if (_weapon_name = "Claws") { + _attack = 300; + _piercing = 0; + _range = 1; + _shot_count = 0; + } + if (_weapon_name = "Gauss Flux Arc") { + _attack = 180; + _piercing = 0; + _range = 8; + _shot_count = 3; + } + if (_weapon_name = "Particle Whip") { + _attack = 300; + _piercing = 0; + _range = 4.1; + _shot_count = 3; + } + if (_weapon_name = "Gauss Flayer Array") { + _attack = 180; + _piercing = 0; + _range = 8.1; + _shot_count = 3; + } + if (_weapon_name = "Doomsday Cannon") { + _attack = 300; + _piercing = 1; + _range = 6.1; + _shot_count = 3; } } - // if (faith_bonus = 1) then atta = atta * 2; - // if (faith_bonus = 2) then atta = atta * 3; - atta = round(atta * obj_ncombat.global_defense); - arp = round(arp * obj_ncombat.global_defense); - - if (obj_ncombat.enemy = 1) { - // more attack crap here - if (rang <= 1) or(floor(rang) != rang) then atta = round(atta * dudes_attack[group]); - if (rang > 1) and(floor(rang) == rang) then atta = round(atta * dudes_ranged[group]); + // if (faith_bonus = 1) then _attack = _attack * 2; + // if (faith_bonus = 2) then _attack = _attack * 3; + _attack = round(_attack * obj_ncombat.global_defense); + + if (obj_ncombat.enemy == 1) { + if (_range <= 1 || floor(_range) != _range) { + _attack = round(_attack * dudes_attack[group]); + } else if (_range > 1 && floor(_range) == _range) { + _attack = round(_attack * dudes_ranged[group]); + } + } + + if (!is_man && _ammo > 0) { + _ammo *= 2; } - if (is_man = false && amm > 0) then amm *= 2; - - var b, goody, first; - b = 0; - goody = 0; - first = -1; - repeat(30) { - if (wep[b] = name) and(goody = 0) { - att[b] += atta * man_number; - apa[b] = arp; - range[b] = rang; - wep_num[b] += man_number; - if (obj_ncombat.started = 0) then ammo_max[b] = amm; - if (obj_ncombat.started = 0) then ammo_current[b] = amm; - if (obj_ncombat.started = 0) then ammo_reload[b] = reload; - goody = 1; - - if (wep_owner[b] != "") or(man_number > 1) then wep_owner[b] = "assorted"; - if (wep_owner[b] = "") and(man_number = 1) then wep_owner[b] = man_type; - } - if (wep[b] = "") and(first = -1) then first = b; - b += 1; + var _stack_type = {}; + if (is_man && man_number == 1) { + if (!struct_exists(weapon_stacks_unique, man_type)) { + struct_set(weapon_stacks_unique, man_type, {}); + } + _stack_type = weapon_stacks_unique[$ man_type]; + } else if (is_man) { + _stack_type = weapon_stacks_normal; + } else { + _stack_type = weapon_stacks_vehicle; } - if (goody = 0) { - wep[first] = name; - splash[first] = spli; - att[first] += atta * man_number; - apa[first] = arp; - range[first] = rang; - wep_num[first] += man_number; - if (obj_ncombat.started = 0) then ammo_max[first] = amm; - if (obj_ncombat.started = 0) then ammo_current[first] = amm; - if (obj_ncombat.started = 0) then ammo_reload[first] = reload; - goody = 1; - if (man_number = 1) then wep_owner[first] = man_type; - if (man_number > 1) then wep_owner[first] = "assorted"; + if (struct_exists(_stack_type, _weapon_name)) { + var _weapon_stack = _stack_type[$ _weapon_name]; + _weapon_stack.weapon_count += man_number; + + if (!array_contains(_weapon_stack.owners, man_type)) { + array_push(_weapon_stack.owners, man_type); + } + } else { + var _weapon_stack = new WeaponStack(_weapon_name); + _weapon_stack.attack = _attack; + _weapon_stack.piercing = _piercing; + _weapon_stack.range = _range; + _weapon_stack.weapon_count += man_number; + _weapon_stack.shot_count = _shot_count; + array_push(_weapon_stack.owners, man_type); + + if (obj_ncombat.started == 0) { + _weapon_stack.ammo_max = _ammo; + _weapon_stack.ammo_current = _ammo; + _weapon_stack.ammo_reload = _reload; + } + + struct_set(_stack_type, _weapon_name, _weapon_stack); } - /* - wep[i]=""; - range[i]=0; - att[i]=0; - apa[i]=0; - */ -} \ No newline at end of file + show_debug_message($"weapon_stacks_unique: {weapon_stacks_unique}"); + show_debug_message($"weapon_stacks_normal: {weapon_stacks_normal}"); + show_debug_message($"weapon_stacks_vehicle: {weapon_stacks_vehicle}"); +} diff --git a/scripts/scr_flavor/scr_flavor.gml b/scripts/scr_flavor/scr_flavor.gml index 3ce81d1974..a2e7e90926 100644 --- a/scripts/scr_flavor/scr_flavor.gml +++ b/scripts/scr_flavor/scr_flavor.gml @@ -23,21 +23,23 @@ function display_battle_log_message() { } /// @mixin -function scr_flavor(id_of_attacking_weapons, target, target_type, number_of_shots, casulties) { +function scr_flavor(_weapon_stack, _target_object, _target_i, casulties) { // Generates flavor based on the damage and casualties from scr_shoot, only for the player - var attack_message, kill_message, leader_message, targeh; - targeh = target_type; + var attack_message, kill_message, leader_message; leader_message = ""; attack_message = $""; kill_message = ""; - var weapon_name = wep[id_of_attacking_weapons]; + var weapon_name = _weapon_stack.weapon_name; + var number_of_shots = _weapon_stack.weapon_count + var target = _target_object; + var targeh = _target_i; - if (id_of_attacking_weapons = -51) then weapon_name = "Heavy Bolter Emplacemelse ent"; - if (id_of_attacking_weapons = -52) then weapon_name = "Missile Launcher Emplacement"; - if (id_of_attacking_weapons = -53) then weapon_name = "Missile Silo"; + // if (id_of_attacking_weapons = -51) then weapon_name = "Heavy Bolter Emplacemelse ent"; + // if (id_of_attacking_weapons = -52) then weapon_name = "Missile Launcher Emplacement"; + // if (id_of_attacking_weapons = -53) then weapon_name = "Missile Silo"; var weapon_data = gear_weapon_data("weapon", weapon_name, "all"); if (!is_struct(weapon_data)) { @@ -54,8 +56,8 @@ function scr_flavor(id_of_attacking_weapons, target, target_type, number_of_shot var character_shot = false; var unit_name = ""; - if (wep_solo[id_of_attacking_weapons] != "") { - unit_name = $"{wep_title[id_of_attacking_weapons]} {wep_solo[id_of_attacking_weapons]}"; + if (array_length(_weapon_stack.owners) == 1) { + unit_name = $"{_weapon_stack.owners[0]}"; character_shot = true; } diff --git a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml index d7c4729276..4a1850ca27 100644 --- a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml +++ b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml @@ -11,68 +11,65 @@ function add_second_profiles_to_stack(weapon, head_role = false, unit = "none") } else { _secondary_profile = weapon.second_profiles[p]; } + if (!is_struct(_secondary_profile)) { continue; } - var wep_index = find_stack_index(_secondary_profile.name, head_role, unit); - if (wep_index > -1) { - add_data_to_stack(wep_index, _secondary_profile); - } + + add_data_to_stack(_secondary_profile, 0, head_role, unit); } } } +/// @mixin +function add_data_to_stack (weapon, unit_damage=0, head_role=false, unit="none"){ + var _attack = unit_damage > 0 ? unit_damage : weapon.attack; + var _stack_type = {}; + var _owner_name = unit == "none" ? "Vehicle" : $"{unit.role()} {unit.name()}"; + + if (unit != "none" && head_role) { + if (!struct_exists(weapon_stacks_unique, unit.name())) { + struct_set(weapon_stacks_unique, unit.name(), {}); + } + _stack_type = weapon_stacks_unique[$ unit.name()]; + } else if (unit != "none") { + _stack_type = weapon_stacks_normal; + } else { + _stack_type = weapon_stacks_vehicle; + } + + if (struct_exists(_stack_type, weapon.name)) { + var _weapon_stack = _stack_type[$ weapon.name]; + _weapon_stack.weapon_count++; + + if (!array_contains(_weapon_stack.owners, _owner_name)) { + array_push(_weapon_stack.owners, _owner_name); + } + } else { + var _weapon_stack = new WeaponStack(weapon.name); + _weapon_stack.attack = _attack; + _weapon_stack.piercing = weapon.arp; + _weapon_stack.range = weapon.range; + _weapon_stack.weapon_count++; + _weapon_stack.shot_count = weapon.spli; + array_push(_weapon_stack.owners, _owner_name); + + if (obj_ncombat.started == 0) { + _weapon_stack.ammo_max = weapon.ammo; + _weapon_stack.ammo_current = weapon.ammo; + _weapon_stack.ammo_reload = weapon.reload; + } + + show_debug_message($"weapon: {weapon}"); + struct_set(_stack_type, weapon.name, _weapon_stack); + } -function add_data_to_stack (stack_index, weapon, unit_damage=0, head_role=false, unit="none"){ - if (unit_damage > 0){ - att[stack_index]+=unit_damage; - } else { - att[stack_index]+=weapon.attack; - } - wep_num[stack_index]++; - - if (!obj_ncombat.started) { - splash[stack_index]=weapon.spli; - wep[stack_index]=weapon.name; - apa[stack_index]=weapon.arp; - range[stack_index]=weapon.range; - - ammo_reload[stack_index]=weapon.reload; - ammo_reload_current[stack_index]=-1; - ammo_max[stack_index]=weapon.ammo; - ammo_current[stack_index]=weapon.ammo; - } if (unit!="none"){//this stops a potential infinite loop of secondary profiles add_second_profiles_to_stack(weapon, head_role, unit); } } -function find_stack_index (weapon_name, head_role=false, unit="none"){ - final_index = -1; - var allow = false; - for (var stack_index=1;stack_index -1){ - add_data_to_stack(stack_index, unit.hammer_of_wrath(), false, head_role, unit); - if (head_role){ - player_head_role_stack(stack_index, unit); - } - } + add_data_to_stack(unit.hammer_of_wrath(), 0, head_role, unit); } } } if (is_struct(mobi_item)){ - add_second_profiles_to_stack(mobi_item); + add_second_profiles_to_stack(mobi_item, head_role, unit); } if (is_struct(gear_item)){ - add_second_profiles_to_stack(gear_item); + add_second_profiles_to_stack(gear_item, head_role, unit); } if (is_struct(armour_item)){ - add_second_profiles_to_stack(armour_item); + add_second_profiles_to_stack(armour_item, head_role, unit); } if (unit.IsSpecialist(SPECIALISTS_LIBRARIANS, true) || (unit.role() == "Chapter Master" && obj_ncombat.chapter_master_psyker == 1)) { @@ -240,31 +228,14 @@ function scr_player_combat_weapon_stacks() { } } if (marine_casting[g] == false){ - var weapon_stack_index=0; var primary_ranged = unit.ranged_damage_data[3];//collect unit ranged data - var weapon_stack_index = find_stack_index(primary_ranged.name, head_role, unit); - if (weapon_stack_index>-1){ - add_data_to_stack(weapon_stack_index,primary_ranged,unit.ranged_damage_data[0], head_role,unit); - if (head_role){ - player_head_role_stack(weapon_stack_index,unit); - } + if (primary_ranged.name != "") { + add_data_to_stack(primary_ranged,unit.ranged_damage_data[0], head_role,unit); } - var primary_melee = unit.melee_damage_data[3];//collect unit melee data - var weapon_stack_index = find_stack_index(primary_melee.name, head_role, unit); - if (weapon_stack_index>-1){ - if (range[weapon_stack_index]>1.9) then continue//creates secondary weapon stack for close combat ranged weaponry use - primary_melee.range=1; - add_data_to_stack(weapon_stack_index,primary_melee,unit.melee_damage_data[0], head_role,unit); - - if (head_role){ - player_head_role_stack(weapon_stack_index,unit); - } - - if (floor(primary_melee.range)<=1 && primary_melee.ammo == 0){ - ammo_max[weapon_stack_index]=-1; //no ammo limit - } + if (primary_melee.name != "") { + add_data_to_stack(primary_melee,unit.melee_damage_data[0], head_role,unit); } } } @@ -300,12 +271,7 @@ function scr_player_combat_weapon_stacks() { if (weapon_check!=""){ weapon=gear_weapon_data("weapon",weapon_check,"all", false, "standard"); if (is_struct(weapon)){ - for (j=0;j<=40;j++){ - if (wep[j]==""||wep[j]==weapon.name){ - add_data_to_stack(j,weapon); - break; - } - } + add_data_to_stack(weapon); } } } diff --git a/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml b/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml index 9ed1abd73b..e64b571b5d 100644 --- a/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml +++ b/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml @@ -310,26 +310,30 @@ function update_block_unit_count() { unit_count = men + medi + dreads + veh; } -function get_valid_weapons(_range_min, _range_max) { +function get_valid_weapon_stacks(_stacks_struct, _range_min, _range_max) { var valid = []; - for (var i = 0; i < array_length(wep); i++) { - if (wep[i] == "" || wep_num[i] == 0) { + var _weapon_stack_names = struct_get_names(_stacks_struct); + var _struct_len = array_length(_weapon_stack_names); + for (var i = 0; i < _struct_len; i++){ + var _weapon_stack_name = _weapon_stack_names[i]; + var _weapon_stack = _stacks_struct[$ _weapon_stack_name]; + + if (_weapon_stack.weapon_name == "" || _weapon_stack.weapon_count == 0) { continue; } - if (range[i] == 0) { - log_error($"{wep[i]} has broken range! This shouldn't happen! Range: {range[i]}; Ammo: {ammo[i]}; Owner: {wep_owner[i]}"); - // show_debug_message($"A broken weapon was found! i:{i}; Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}; Ammo: {ammo[i]}"); + if (_weapon_stack.range == 0) { + log_error($"{_weapon_stack.weapon_name} has broken range! This shouldn't happen!"); continue; } - if (range[i] < _range_min || range[i] > _range_max) { + if (_weapon_stack.range < _range_min || _weapon_stack.range > _range_max) { continue; } - array_push(valid, i); - } + array_push(valid, _weapon_stack); + } return valid; } @@ -351,24 +355,24 @@ function get_alpha_strike_target() { return -1; } -function get_target_priority(_wep_index, _block, _needed_type) { +function get_target_priority(_weapon_stack, _block) { var _distance = get_block_distance(_block); var _size = _block.column_size; // Distance weight (closer = higher priority) - var _distance_bonus = (range[_wep_index] - _distance - 1) * 20; + var _distance_bonus = (_weapon_stack.range - _distance - 1) * 20; // Column size influence (bigger columns = higher threat?) - var _doomstack_malus = wep_num[_wep_index] / _size; + var _doomstack_malus = _weapon_stack.weapon_count / _size; // Column size influence (bigger columns = higher threat?) var _size_bonus = _size / 10; // Target type match bonus var _type_bonus = 0; - if (_needed_type == "arp") { + if (_weapon_stack.target_type == 1) { _type_bonus = 20 * (block_type_size(_block, "armour") / _size); - } else if (_needed_type == "att") { + } else { _type_bonus = 20 * (block_type_size(_block, "men") / _size); } diff --git a/scripts/scr_shoot/scr_shoot.gml b/scripts/scr_shoot/scr_shoot.gml index 56b858e94f..df41948126 100644 --- a/scripts/scr_shoot/scr_shoot.gml +++ b/scripts/scr_shoot/scr_shoot.gml @@ -2,17 +2,16 @@ #macro DEBUG_PLAYER_TARGET_SELECTION false /// @mixin -function scr_shoot(weapon_index_position, target_object, target_index, target_type, melee_or_ranged) { +function scr_shoot(_weapon_stack, _target_object, _target_index) { try { - // weapon_index_position: Weapon number - // target_object: Target object - // target_index: Target dudes - // target_type: "att" or "arp" or "highest" + // _target_object: Target object + // _target_index: Target dudes + // _target_type: "att" or "arp" or "highest" // melee_or_ranged: melee or ranged // This massive clusterfuck of a script uses the newly determined weapon and target data to attack and assign damage - if (!instance_exists(target_object)) { + if (!instance_exists(_target_object)) { exit; } @@ -20,66 +19,58 @@ function scr_shoot(weapon_index_position, target_object, target_index, target_ty exit; } - if (weapon_index_position < 0) { + if (!is_struct(_weapon_stack)) { exit; } - var wi = weapon_index_position; - var _weapon_max_kills = splash[wi]; - var _total_damage = att[wi]; - var _weapon_ap = apa[wi]; - var _weapon_name = wep[wi]; - var _shooter = wep_owner[wi]; - var _shooter_count = wep_num[wi]; - var _shot_count = _shooter_count * _weapon_max_kills; - var _weapon_damage_type = target_type; - var _weapon_damage_per_hit = _total_damage / _shooter_count; - - if (_shooter_count <= 0 || _total_damage <= 0) { - exit; - } + var _weapon_shot_count = _weapon_stack.shot_count + var _weapon_attack = _weapon_stack.attack; + var _weapon_piercing = _weapon_stack.piercing; + var _weapon_name = _weapon_stack.weapon_name; + var _shooter = _weapon_stack.owners; + var _shooter_count = _weapon_stack.weapon_count; + var _shot_count = _shooter_count * _weapon_shot_count; + var _target_type = _weapon_stack.target_type; - if (DEBUG_WEAPON_RELOADING) { - show_debug_message($"Weapon Name: {_weapon_name}\n Max Ammo: {ammo_max[wi]}\n Current Ammo: {ammo_current[wi]}\n Reload Time: {ammo_reload[wi]}\n Current Reload: {ammo_reload_current[wi]}"); + if (_shooter_count <= 0 || _weapon_attack <= 0) { + exit; } - if (ammo_max[wi] != -1) { - if (ammo_current[wi] == 0 && ammo_reload[wi] != -1) { - if (ammo_reload_current[wi] == -1) { - if (DEBUG_WEAPON_RELOADING) { - show_debug_message($"{_weapon_name} is reloading! Will finish in {ammo_reload[wi]} turns!"); - } - ammo_reload_current[wi] = ammo_reload[wi]; - ammo_reload_current[wi]--; + // if (DEBUG_WEAPON_RELOADING) { + // show_debug_message($"Weapon Name: {_weapon_name}\n Max Ammo: {_weapon_stack.ammo_max}\n Current Ammo: {_weapon_stack.ammo_current}\n Reload Time: {_weapon_stack.ammo_reload}\n Current Reload: {_weapon_stack.ammo_current}"); + // } + + if (_weapon_stack.ammo_max != -1) { + if (_weapon_stack.ammo_current == 0 && _weapon_stack.ammo_reload != -1) { + if (_weapon_stack.ammo_current == -1) { + // if (DEBUG_WEAPON_RELOADING) { + // show_debug_message($"{_weapon_name} is reloading! Will finish in {_weapon_stack.ammo_reload} turns!"); + // } + _weapon_stack.ammo_current = _weapon_stack.ammo_reload; + _weapon_stack.ammo_current--; continue; - } else if (ammo_reload_current[wi] == 0) { - if (DEBUG_WEAPON_RELOADING) { - show_debug_message($"{_weapon_name} reloaded! Setting ammo to {ammo_max[wi]}!"); - } - ammo_current[wi] = ammo_max[wi]; - ammo_reload_current[wi] = -1; + } else if (_weapon_stack.ammo_current == 0) { + // if (DEBUG_WEAPON_RELOADING) { + // show_debug_message($"{_weapon_name} reloaded! Setting ammo to {_weapon_stack.ammo_max}!"); + // } + _weapon_stack.ammo_current = _weapon_stack.ammo_max; + _weapon_stack.ammo_current = -1; } else { - if (DEBUG_WEAPON_RELOADING) { - show_debug_message($"{_weapon_name} is still reloading! {ammo_reload_current[wi]} turns left!"); - } - ammo_reload_current[wi]--; + // if (DEBUG_WEAPON_RELOADING) { + // show_debug_message($"{_weapon_name} is still reloading! {_weapon_stack.ammo_current} turns left!"); + // } + _weapon_stack.ammo_current--; continue; } } - if (ammo_current[wi] > 0) { - ammo_current[wi]--; + if (_weapon_stack.ammo_current > 0) { + _weapon_stack.ammo_current--; } } //* Enemy shooting if (owner == 2) { - if (_weapon_name == "Web Spinner") { - _weapon_damage_type = "status"; - } else if (_weapon_damage_type == "medi") { - _weapon_damage_type = _weapon_ap > 6 ? "arp" : "att"; - } - var _melee_accuracy_mod = 1; var _ranged_accuracy_mod = 1; switch (obj_ncombat.enemy) { @@ -96,64 +87,43 @@ function scr_shoot(weapon_index_position, target_object, target_index, target_ty _ranged_accuracy_mod = 0.6; break; } - var _accuracy_mod = melee_or_ranged == "ranged" ? _ranged_accuracy_mod : _melee_accuracy_mod; - + + var _accuracy_mod = _weapon_stack.range >= 2 ? _ranged_accuracy_mod : _melee_accuracy_mod; _shot_count *= _accuracy_mod; - var _weapon_data = { - name: _weapon_name, - damage: _weapon_damage_per_hit, - armour_pierce: _weapon_ap, - shot_count: _shot_count, - shooter_count: _shooter_count, - attack_type: melee_or_ranged, - target_type: target_type - } + if (_target_type == "wall") { + var _wall_weapon_damage = max(1, round(_weapon_attack - _target_object.ac[1])) * _shooter_count * max(1, _weapon_shot_count / 4); + _target_object.hp[1] -= _wall_weapon_damage; + + obj_nfort.hostile_weapons = _weapon_name; + obj_nfort.hostile_shots = _shooter_count; + obj_nfort.hostile_weapon_damage = _wall_weapon_damage; + + scr_flavor2((_target_object.hp[1] <= 0), _weapon_stack); + } else { + _target_object.hostile_shooters = (_shooter == "Assorted") ? 999 : 1; - switch (_weapon_damage_type) { - case "status": - target_object.hostile_shooters = (_shooter == "assorted") ? 999 : 1; - _weapon_data.damage = 0; - scr_clean(target_object, _weapon_data); - break; - case "att": - case "arp": - case "dread": - if (melee_or_ranged == "wall") { - var _wall_weapon_damage = max(1, round(_weapon_damage_per_hit - target_object.ac[1])) * _shooter_count * max(1, _weapon_max_kills / 4); - target_object.hp[1] -= _wall_weapon_damage; - - obj_nfort.hostile_weapons = _weapon_name; - obj_nfort.hostile_shots = _shooter_count; - obj_nfort.hostile_weapon_damage = _wall_weapon_damage; - - scr_flavor2((target_object.hp[1] <= 0), "wall", melee_or_ranged, _weapon_name, _shooter_count); - } else { - target_object.hostile_shooters = (_shooter == "assorted") ? 999 : 1; - - scr_clean(target_object, _weapon_data); - } - break; + scr_clean(_target_object, _weapon_stack); } } //* Player shooting if (owner == eFACTION.Player) { - target_index = scr_target(target_object, _weapon_damage_type); - if (target_index == -1) { - target_index = scr_target(target_object); - if (target_index == -1) { - if (DEBUG_PLAYER_TARGET_SELECTION) { - show_debug_message($"{_weapon_name} found no valid targets in the enemy column to attack!"); - } + _target_index = scr_target(_target_object, _target_type); + if (_target_index == -1) { + _target_index = scr_target(_target_object); + if (_target_index == -1) { + // if (DEBUG_PLAYER_TARGET_SELECTION) { + // show_debug_message($"{_weapon_name} found no valid targets in the enemy column to attack!"); + // } log_error($"{_weapon_name} found no valid targets in the enemy column to attack!"); exit; } } - if (DEBUG_PLAYER_TARGET_SELECTION) { - show_debug_message($"{_weapon_name} is attacking {target_object.dudes[target_index]}"); - } + // if (DEBUG_PLAYER_TARGET_SELECTION) { + // show_debug_message($"{_weapon_name} is attacking {_target_object.dudes[_target_index]}"); + // } if (_weapon_name == "Missile Silo") { obj_ncombat.player_silos -= min(obj_ncombat.player_silos, 30); @@ -163,32 +133,32 @@ function scr_shoot(weapon_index_position, target_object, target_index, target_ty var _min_damage = 0.25; var _dice_sides = 200; var _random_damage_mod = roll_dice(1, _dice_sides, "low") / _dice_sides; - var _armour_points = max(0, target_object.dudes_ac[target_index] - _weapon_ap); - _weapon_damage_per_hit = (_weapon_damage_per_hit * _random_damage_mod) - _armour_points; - _weapon_damage_per_hit = max(_min_damage, _weapon_damage_per_hit * target_object.dudes_dr[target_index]); - _total_damage = _weapon_damage_per_hit * _shot_count; - - var _dudes_num = target_object.dudes_num[target_index]; - var _unit_hp = target_object.dudes_hp[target_index]; - var _casualties = min(_shot_count, _dudes_num, floor(_total_damage / _unit_hp)); - - if (_casualties > 0) { - if (DEBUG_PLAYER_TARGET_SELECTION) { - show_debug_message($"{_weapon_name} attacked {target_object.dudes[target_index]} and destroyed {_casualties}!"); - } - } else { - if (DEBUG_PLAYER_TARGET_SELECTION) { - show_debug_message($"{_weapon_name} attacked {target_object.dudes[target_index]} but dealt no damage!"); - } - } - - scr_flavor(wi, target_object, target_index, _shooter_count, _casualties); + var _armour_points = max(0, _target_object.dudes_ac[_target_index] - _weapon_piercing); + _weapon_attack = (_weapon_attack * _random_damage_mod) - _armour_points; + _weapon_attack = max(_min_damage, _weapon_attack * _target_object.dudes_dr[_target_index]); + var _total_attack = _weapon_attack * _shot_count; + + var _dudes_num = _target_object.dudes_num[_target_index]; + var _unit_hp = _target_object.dudes_hp[_target_index]; + var _casualties = min(_shot_count, _dudes_num, floor(_total_attack / _unit_hp)); + + // if (_casualties > 0) { + // if (DEBUG_PLAYER_TARGET_SELECTION) { + // show_debug_message($"{_weapon_name} attacked {_target_object.dudes[_target_index]} and destroyed {_casualties}!"); + // } + // } else { + // if (DEBUG_PLAYER_TARGET_SELECTION) { + // show_debug_message($"{_weapon_name} attacked {_target_object.dudes[_target_index]} but dealt no damage!"); + // } + // } + + scr_flavor(_weapon_stack, _target_object, _target_index, _casualties); if (_casualties > 0) { - target_object.dudes_num[target_index] -= _casualties; + _target_object.dudes_num[_target_index] -= _casualties; obj_ncombat.enemy_forces -= _casualties; - compress_enemy_array(target_object); - destroy_empty_column(target_object); + compress_enemy_array(_target_object); + destroy_empty_column(_target_object); } } } catch (_exception) { diff --git a/scripts/scr_target/scr_target.gml b/scripts/scr_target/scr_target.gml index 574cb3fca7..ee9c40db29 100644 --- a/scripts/scr_target/scr_target.gml +++ b/scripts/scr_target/scr_target.gml @@ -1,24 +1,17 @@ -function scr_target(battle_block, man_or_vehicle = "any") { +function scr_target(_battle_block, _target_type = -1) { var _biggest_target = -1; var _priority_queue = ds_priority_create(); - var _target = -1; - var _dudes_names = battle_block.dudes; - var _dudes_hps = battle_block.dudes_hp; - var _dudes_nums = battle_block.dudes_num; - var _dudes_vehicles = battle_block.dudes_vehicle; - - if (man_or_vehicle == "arp") { - _target = 1; - } else if (man_or_vehicle == "att") { - _target = 0; - } + var _dudes_names = _battle_block.dudes; + var _dudes_hps = _battle_block.dudes_hp; + var _dudes_nums = _battle_block.dudes_num; + var _dudes_vehicles = _battle_block.dudes_vehicle; for (var i = 0, dudes_len = array_length(_dudes_names); i < dudes_len; i++) { if (_dudes_hps[i] <= 0 || _dudes_names[i] == "") { continue; } - if (_target == -1 || _dudes_vehicles[i] == _target) { + if (_target_type == -1 || _dudes_vehicles[i] == _target_type) { ds_priority_add(_priority_queue, i, _dudes_nums[i]); } } diff --git a/scripts/scr_vehicle_weapon/scr_vehicle_weapon.gml b/scripts/scr_vehicle_weapon/scr_vehicle_weapon.gml deleted file mode 100644 index 9a1327281e..0000000000 --- a/scripts/scr_vehicle_weapon/scr_vehicle_weapon.gml +++ /dev/null @@ -1,127 +0,0 @@ -function scr_vehicle_weapon(argument0, argument1) { - - // This is old code for the sprite-based ground combat. Delete it if you like. - - - - - - // argument0 = name - // argument 1 = weapon number - - var weep, class, diy, bull, stahp;weep=string(argument0);class="assault";diy=9999;bull=0; - diy=point_distance(x,y,target[argument1].x,target[argument1].y);stahp=0; - - - // Setting up - - - var melee;melee=0; - if (weep="Close Combat Weapon") then melee=1;if (weep="Chainaxe")then melee=1; - if (weep="Combat Knife")then melee=1;if (weep="Force Staff")then melee=1; - if (weep="Thunder Hammer")then melee=1;if (weep="Power Sword")then melee=1; - if (weep="Power Weapon")then melee=1;if (weep="Power Axe")then melee=1; - if (weep="Power Fist")then melee=1;if (weep="Power Fists")then melee=1; - if (weep="Dozer Blades") then melee=1; - if (melee=1) then wep_range[argument1]=max(target[argument1].sprite_width-8,target[argument1].sprite_height-8,sprite_height-8); - - - - if (wep[1]="Whirlwind Missiles") and (target[1].sprite_index=spr_tyr_tervigon) then stahp=1; - - - - if (diy>wep_range[argument1]) or (stahp=1) then weep=""; - - - - var onceh;onceh=0; - if (wep_clip[argument1]=0) and (weep!=""){onceh=1; - cooldown[argument1]=wep_reload[argument1]+random_range(-4,4); - wep_clip[argument1]=wep_clip_max[argument1]; - } - if (wep_clip[argument1]>0) and (onceh=0) and (weep!=""){onceh=1;wep_clip[argument1]-=1;cooldown[argument1]=wep_cooldown[argument1];} - - - - if (weep!="") and (onceh=1) and (melee=0){ - bull=instance_create(x,y,obj_p_bullet); - bull.direction=point_direction(x,y,target[argument1].x,target[argument1].y); - bull.dam=wep_dam[argument1]; - bull.speed=bullet_spd[argument1]; - } - - - - // Direction of bullet - if (onceh=1){ - if (weep="Autocannon") then bull.direction+=random_range(-6,6); - if (weep="Bolt Pistol") or (weep="Storm Bolter") then bull.direction+=random_range(-8,8); - if (weep="Bolter") or ((weep="Combiflamer") and (diy>=80)) then bull.direction+=random_range(-4,4); - if (weep="Heavy Bolter") then bull.direction+=random_range(-6,6); - if (weep="Lascannon") then bull.direction+=random_range(-2,2); - if (weep="Whirlwind Missiles"){bull.target=target[argument1];bull.direction=70;} - - - - // Appearance - if (bullet[argument1]="bolter"){bull.sprite_index=spr_bolt;bull.image_speed=0;bull.image_index=0;} - if (bullet[argument1]="flamer"){with(bull){instance_destroy();bull=instance_create(x,y,obj_heavy_flamer);bull.direction=self.direction;}} - if (bullet[argument1]="lascannon"){bull.sprite_index=spr_ground_las;bull.image_speed=0;bull.image_index=0;bull.image_xscale=3;speed=0;} - if (bullet[argument1]="whirlwind"){bull.sprite_index=spr_rocket_whirl;bull.image_speed=0;bull.image_index=0;} - - - - // Melee - var dym;dym=wep_dam[argument1];dym-=target[argument1].armour; - if (weep="Chainsword"){with(bull){instance_destroy();}target[argument1].hp-=dym;} - if (weep="Chainaxe"){with(bull){instance_destroy();}target[argument1].hp-=dym;} - if (weep="Combat Knife"){with(bull){instance_destroy();}target[argument1].hp-=dym;} - if (weep="Force Staff"){with(bull){instance_destroy();}target[argument1].hp-=dym;} - if (weep="Thunder Hammer"){with(bull){instance_destroy();}target[argument1].hp-=dym;} - if (weep="Dozer Blades"){with(bull){instance_destroy();}target[argument1].hp-=dym;} - - if (weep="Power Sword"){with(bull){instance_destroy();}target[argument1].hp-=dym;} - if (weep="Power Weapon"){with(bull){instance_destroy();}target[argument1].hp-=dym;} - if (weep="Power Axe"){with(bull){instance_destroy();}target[argument1].hp-=dym;} - if (weep="Power Fist"){with(bull){instance_destroy();}target[argument1].hp-=dym;} - if (weep="Power Fists"){with(bull){instance_destroy();}target[argument1].hp-=dym;} - - } - - - /* - - - // Weapons here - - var w; - w=0; - - - - - - - - if (wep[w]="Conversion Beam Projector"){} - - if (wep[w]="Infernus Pistol"){ - wep_range[w]=160;wep_dam[w]=100;wep_cooldown[w]=90;wep_clip[w]=3;wep_clip_max[w]=3; - wep_reload[w]=9999;wep_antitank[w]=1;bullet[w]="melta_small";bullet_spd[w]=0;wep_type[w]="template"; - } - - - // Master Crafted Combi-flamer - // Master Crafted Heavy Bolter - // Master Crafted Meltagun - // Master Crafted Plasma Pistol - - } - - - - */ - - -} diff --git a/scripts/scr_weapon_stacks/scr_weapon_stacks.gml b/scripts/scr_weapon_stacks/scr_weapon_stacks.gml new file mode 100644 index 0000000000..e49d28a127 --- /dev/null +++ b/scripts/scr_weapon_stacks/scr_weapon_stacks.gml @@ -0,0 +1,27 @@ +function WeaponStack(_name) constructor { + weapon_name = _name; + weapon_count = 0; + range = 0; + attack = 0; + piercing = 0; + ammo_current = 0; + ammo_max = 0; + ammo_reload_current = 0; + ammo_reload = 0; + shot_count = 0; + owners = []; + target_type = 0; // 0 men, 1 vehicle, 2 leaders? +} + +function UnitStack(_name) constructor { + unit_name = _name; + abilities = 0; + count = 0; + armour_points = 0; + health = 0; + resistance = 0; + is_vehicle = false; + attack = 0; + experience = 0; + faith = 0; +} diff --git a/scripts/scr_vehicle_weapon/scr_vehicle_weapon.yy b/scripts/scr_weapon_stacks/scr_weapon_stacks.yy similarity index 76% rename from scripts/scr_vehicle_weapon/scr_vehicle_weapon.yy rename to scripts/scr_weapon_stacks/scr_weapon_stacks.yy index 49ccb6c3b8..d41d71cc0c 100644 --- a/scripts/scr_vehicle_weapon/scr_vehicle_weapon.yy +++ b/scripts/scr_weapon_stacks/scr_weapon_stacks.yy @@ -1,9 +1,9 @@ { "$GMScript":"v1", - "%Name":"scr_vehicle_weapon", + "%Name":"scr_weapon_stacks", "isCompatibility":false, "isDnD":false, - "name":"scr_vehicle_weapon", + "name":"scr_weapon_stacks", "parent":{ "name":"Combat", "path":"folders/Scripts/Combat.yy", From b8980ac4cc00658d06ce02eed425634a252c0dda Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Mon, 14 Apr 2025 15:51:34 +0300 Subject: [PATCH 59/80] More stuff --- .../scr_array_functions.gml | 23 +++++ scripts/scr_clean/scr_clean.gml | 29 +++--- scripts/scr_en_weapon/scr_en_weapon.gml | 31 +++--- .../scr_punit_combat_heplers.gml | 96 ++++++++++++++----- scripts/scr_shoot/scr_shoot.gml | 4 +- .../scr_weapon_stacks/scr_weapon_stacks.gml | 13 ++- 6 files changed, 136 insertions(+), 60 deletions(-) diff --git a/scripts/scr_array_functions/scr_array_functions.gml b/scripts/scr_array_functions/scr_array_functions.gml index 13ed5f7b61..0f65a1fc2c 100644 --- a/scripts/scr_array_functions/scr_array_functions.gml +++ b/scripts/scr_array_functions/scr_array_functions.gml @@ -259,3 +259,26 @@ function is_basic_array(_array, _max_depth = 1, _current_depth = 1) { function array_empty(_array) { return array_length(_array) == 0; } + +/// @description Deletes the first array element that matches the requested value. Returns whenever it succeeded or not. +/// @param {array} _array - The array to check. +/// @param {real} _element_value - Value to find and delete. +function array_delete_ext(_array, _element_value) { + var _pos = array_get_index(_array, _element_value); + if (_pos != -1) { + array_delete(_array, _pos, 1); + return true; + } + return false; +} + +/// @description Pushes a new element to an array, if the array doesn't already contain it. Returns whenever it succeeded or not. +/// @param {array} _array - The array to push to. +/// @param {real} _element_value - The element. +function array_push_unique(_array, _element_value) { + if (!array_contains(_array, _element_value)) { + array_push(_array, _element_value); + return true; + } + return false; +} diff --git a/scripts/scr_clean/scr_clean.gml b/scripts/scr_clean/scr_clean.gml index 4a4a9197d8..51d2cd4b5e 100644 --- a/scripts/scr_clean/scr_clean.gml +++ b/scripts/scr_clean/scr_clean.gml @@ -23,12 +23,14 @@ function scr_clean(target_object, weapon_data) { } var armour_pierce = weapon_data.piercing; - var hostile_shots = weapon_data.shot_count; + var weapon_shot_count = weapon_data.shot_count; var hostile_damage = weapon_data.attack; var hostile_weapon = weapon_data.weapon_name; var hostile_range = weapon_data.range; var target_type = weapon_data.target_type; var shooter_count = weapon_data.weapon_count; + var hostile_shots = weapon_shot_count * shooter_count; + var hits = 0; var unit_type = ""; var valid_vehicles = []; @@ -64,15 +66,15 @@ function scr_clean(target_object, weapon_data) { } valid_vehicles = array_shuffle(valid_vehicles); - if (target_type == 1 && array_empty(valid_vehicles)) { - target_type = 0; - } else if (target_type = 0 && array_empty(valid_marines)) { - target_type = 1; + if (target_type == eTARGET_TYPE.ARMOUR && array_empty(valid_vehicles)) { + target_type = eTARGET_TYPE.NORMAL; + } else if (target_type = eTARGET_TYPE.NORMAL && array_empty(valid_marines)) { + target_type = eTARGET_TYPE.ARMOUR; } for (var shot = 0; shot < hostile_shots; shot++) { // ### Vehicle Damage Processing ### - if (target_type == 1 && !array_empty(valid_vehicles)) { + if (target_type == eTARGET_TYPE.ARMOUR && !array_empty(valid_vehicles)) { // Apply damage for each hostile shot, until we run out of targets hits++; @@ -89,7 +91,7 @@ function scr_clean(target_object, weapon_data) { // Apply damage var _min_damage = enemy == 13 ? 1 : 0.25; var _dice_sides = 200; - var _random_damage_mod = roll_dice(1, _dice_sides, "low") / _dice_sides; + var _random_damage_mod = roll_dice(1, _dice_sides, "low") / 100; var _armour_points = max(0, veh_ac[vehicle_id] - armour_pierce); var _modified_damage = max(_min_damage, (hostile_damage * _random_damage_mod) - _armour_points); @@ -114,13 +116,14 @@ function scr_clean(target_object, weapon_data) { array_delete(valid_vehicles, vehicle_id, 1); } } else { + // ### Dreadnought Processing ### var marine = unit_struct[vehicle_id]; unit_type = marine.role(); // Apply damage var _min_damage = enemy == 13 ? 1 : 0.25; var _dice_sides = 200; - var _random_damage_mod = roll_dice(1, _dice_sides, "low") / _dice_sides; + var _random_damage_mod = roll_dice(1, _dice_sides, "low") / 100; var _armour_points = max(0, marine_ac[vehicle_id] - armour_pierce); var _modified_damage = (hostile_damage * _random_damage_mod) - _armour_points; @@ -169,15 +172,15 @@ function scr_clean(target_object, weapon_data) { array_delete(valid_vehicles, random_index, 1); units_lost++; if (array_empty(valid_vehicles)) { - target_type = 0; + target_type = eTARGET_TYPE.NORMAL; continue; } } } } - // ### Marine + Dreadnought Processing ### - if (target_type == 0 && !array_empty(valid_marines)) { + // ### Marine Processing ### + if (target_type == eTARGET_TYPE.NORMAL && !array_empty(valid_marines)) { // Apply damage for each shot hits++; @@ -190,7 +193,7 @@ function scr_clean(target_object, weapon_data) { // Apply damage var _min_damage = enemy == 13 ? 1 : 0.25; var _dice_sides = 200; - var _random_damage_mod = roll_dice(1, _dice_sides, "low") / _dice_sides; + var _random_damage_mod = roll_dice(1, _dice_sides, "low") / 100; var _armour_points = max(0, marine_ac[marine_index] - armour_pierce); var _modified_damage = max(_min_damage, (hostile_damage * _random_damage_mod) - _armour_points); @@ -236,7 +239,7 @@ function scr_clean(target_object, weapon_data) { array_delete(valid_marines, random_index, 1); units_lost++; if (array_empty(valid_marines)) { - target_type = 1; + target_type = eTARGET_TYPE.ARMOUR; continue; } } diff --git a/scripts/scr_en_weapon/scr_en_weapon.gml b/scripts/scr_en_weapon/scr_en_weapon.gml index 929bec748e..c863e4e4fc 100644 --- a/scripts/scr_en_weapon/scr_en_weapon.gml +++ b/scripts/scr_en_weapon/scr_en_weapon.gml @@ -383,21 +383,21 @@ function scr_en_weapon(_weapon_name, is_man, man_number, man_type, group) { if (obj_ncombat.enemy = 7) { if (argument0 = "Choppa") { - _attack = 12; + _attack = 16; _piercing = 4; _range = 1; - _shot_count = 1; + _shot_count = 2; } if (argument0 = "Power Klaw") { - _attack = 30; + _attack = 22; _piercing = 20; _range = 1; - _shot_count = 1; + _shot_count = 2; } if (argument0 = "Slugga") { _attack = 20; _piercing = 0; - _range = 3.1; + _range = 2; _ammo = 6; _shot_count = 3; _reload = 1; @@ -413,10 +413,10 @@ function scr_en_weapon(_weapon_name, is_man, man_number, man_type, group) { if (argument0 = "Big Shoota") { _attack = 24; _piercing = 4; - _range = 13; + _range = 8; _ammo = 6; _shot_count = 10; - _reload = 1; + _reload = 2; } if (argument0 = "Dakkagun") { _attack = 24; @@ -451,7 +451,7 @@ function scr_en_weapon(_weapon_name, is_man, man_number, man_type, group) { _reload = 2; } if (argument0 = "Kannon") { - _attack = 54; + _attack = 45; _piercing = 12; _range = 20; _ammo = 1; @@ -483,8 +483,8 @@ function scr_en_weapon(_weapon_name, is_man, man_number, man_type, group) { _reload = 2; } if (argument0 = "Rokkit Launcha") { - _attack = 21; - _piercing = 12; + _attack = 45; + _piercing = 18; _range = 16; _shot_count = 1; } @@ -1062,12 +1062,7 @@ function scr_en_weapon(_weapon_name, is_man, man_number, man_type, group) { } var _stack_type = {}; - if (is_man && man_number == 1) { - if (!struct_exists(weapon_stacks_unique, man_type)) { - struct_set(weapon_stacks_unique, man_type, {}); - } - _stack_type = weapon_stacks_unique[$ man_type]; - } else if (is_man) { + if (is_man) { _stack_type = weapon_stacks_normal; } else { _stack_type = weapon_stacks_vehicle; @@ -1097,8 +1092,4 @@ function scr_en_weapon(_weapon_name, is_man, man_number, man_type, group) { struct_set(_stack_type, _weapon_name, _weapon_stack); } - - show_debug_message($"weapon_stacks_unique: {weapon_stacks_unique}"); - show_debug_message($"weapon_stacks_normal: {weapon_stacks_normal}"); - show_debug_message($"weapon_stacks_vehicle: {weapon_stacks_vehicle}"); } diff --git a/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml b/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml index e64b571b5d..1e6872f6be 100644 --- a/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml +++ b/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml @@ -311,31 +311,79 @@ function update_block_unit_count() { } function get_valid_weapon_stacks(_stacks_struct, _range_min, _range_max) { - var valid = []; - - var _weapon_stack_names = struct_get_names(_stacks_struct); - var _struct_len = array_length(_weapon_stack_names); - for (var i = 0; i < _struct_len; i++){ - var _weapon_stack_name = _weapon_stack_names[i]; - var _weapon_stack = _stacks_struct[$ _weapon_stack_name]; - - if (_weapon_stack.weapon_name == "" || _weapon_stack.weapon_count == 0) { - continue; - } - - if (_weapon_stack.range == 0) { - log_error($"{_weapon_stack.weapon_name} has broken range! This shouldn't happen!"); - continue; - } - - if (_weapon_stack.range < _range_min || _weapon_stack.range > _range_max) { - continue; - } - - array_push(valid, _weapon_stack); + try { + var valid = []; + + var _weapon_stack_names = struct_get_names(_stacks_struct); + var _struct_len = array_length(_weapon_stack_names); + for (var i = 0; i < _struct_len; i++){ + var _weapon_stack_name = _weapon_stack_names[i]; + var _weapon_stack = _stacks_struct[$ _weapon_stack_name]; + + if (_weapon_stack.weapon_name == "" || _weapon_stack.weapon_count == 0) { + continue; + } + + if (_weapon_stack.range == 0) { + log_error($"{_weapon_stack.weapon_name} has broken range! This shouldn't happen!"); + continue; + } + + if (_weapon_stack.range < _range_min || _weapon_stack.range > _range_max) { + continue; + } + + array_push(valid, _weapon_stack); + } + + return valid; + } catch (_exception) { + show_debug_message($"_stacks_struct: {_stacks_struct}"); + show_debug_message($"_weapon_stack: {_weapon_stack}"); + handle_exception(_exception); } +} - return valid; +function get_valid_weapon_stacks_unique(_stacks_struct, _range_min, _range_max) { + try { + var valid = []; + + var _unique_names = struct_get_names(_stacks_struct); + var _unique_len = array_length(_unique_names); + for (var u = 0; u < _unique_len; u++){ + var _unique_name = _unique_names[u]; + var _unique_stack = _stacks_struct[$ _unique_name]; + + var _weapon_stack_names = struct_get_names(_unique_stack); + var _stacks_len = array_length(_weapon_stack_names); + for (var i = 0; i < _stacks_len; i++){ + var _weapon_stack_name = _weapon_stack_names[i]; + var _weapon_stack = _unique_stack[$ _weapon_stack_name]; + + if (_weapon_stack.weapon_name == "" || _weapon_stack.weapon_count == 0) { + continue; + } + + if (_weapon_stack.range == 0) { + log_error($"{_weapon_stack.weapon_name} has broken range! This shouldn't happen!"); + continue; + } + + if (_weapon_stack.range < _range_min || _weapon_stack.range > _range_max) { + continue; + } + + array_push(valid, _weapon_stack); + } + } + + return valid; + } catch (_exception) { + show_debug_message($"_stacks_struct: {_stacks_struct}"); + show_debug_message($"_unique_stack: {_unique_stack}"); + show_debug_message($"_weapon_stack: {_weapon_stack}"); + handle_exception(_exception); + } } function get_alpha_strike_target() { @@ -370,7 +418,7 @@ function get_target_priority(_weapon_stack, _block) { // Target type match bonus var _type_bonus = 0; - if (_weapon_stack.target_type == 1) { + if (_weapon_stack.target_type == eTARGET_TYPE.ARMOUR) { _type_bonus = 20 * (block_type_size(_block, "armour") / _size); } else { _type_bonus = 20 * (block_type_size(_block, "men") / _size); diff --git a/scripts/scr_shoot/scr_shoot.gml b/scripts/scr_shoot/scr_shoot.gml index df41948126..c14907bee9 100644 --- a/scripts/scr_shoot/scr_shoot.gml +++ b/scripts/scr_shoot/scr_shoot.gml @@ -91,7 +91,7 @@ function scr_shoot(_weapon_stack, _target_object, _target_index) { var _accuracy_mod = _weapon_stack.range >= 2 ? _ranged_accuracy_mod : _melee_accuracy_mod; _shot_count *= _accuracy_mod; - if (_target_type == "wall") { + if (_target_type == eTARGET_TYPE.FORTIFICATION) { var _wall_weapon_damage = max(1, round(_weapon_attack - _target_object.ac[1])) * _shooter_count * max(1, _weapon_shot_count / 4); _target_object.hp[1] -= _wall_weapon_damage; @@ -132,7 +132,7 @@ function scr_shoot(_weapon_stack, _target_object, _target_index) { // Normal shooting var _min_damage = 0.25; var _dice_sides = 200; - var _random_damage_mod = roll_dice(1, _dice_sides, "low") / _dice_sides; + var _random_damage_mod = roll_dice(1, _dice_sides, "low") / 100; var _armour_points = max(0, _target_object.dudes_ac[_target_index] - _weapon_piercing); _weapon_attack = (_weapon_attack * _random_damage_mod) - _armour_points; _weapon_attack = max(_min_damage, _weapon_attack * _target_object.dudes_dr[_target_index]); diff --git a/scripts/scr_weapon_stacks/scr_weapon_stacks.gml b/scripts/scr_weapon_stacks/scr_weapon_stacks.gml index e49d28a127..77875a21b3 100644 --- a/scripts/scr_weapon_stacks/scr_weapon_stacks.gml +++ b/scripts/scr_weapon_stacks/scr_weapon_stacks.gml @@ -1,3 +1,10 @@ +enum eTARGET_TYPE { + NORMAL, + ARMOUR, + LEADER, + FORTIFICATION, +} + function WeaponStack(_name) constructor { weapon_name = _name; weapon_count = 0; @@ -10,7 +17,11 @@ function WeaponStack(_name) constructor { ammo_reload = 0; shot_count = 0; owners = []; - target_type = 0; // 0 men, 1 vehicle, 2 leaders? + target_type = eTARGET_TYPE.NORMAL; + + static total_attack = function() { + return attack * weapon_count; + }; } function UnitStack(_name) constructor { From ef1faedda334eea5f5e296b9ec6072d5745787e6 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Mon, 14 Apr 2025 15:51:55 +0300 Subject: [PATCH 60/80] Even more --- objects/obj_enunit/Alarm_0.gml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/objects/obj_enunit/Alarm_0.gml b/objects/obj_enunit/Alarm_0.gml index e8d46753db..c78c072f7c 100644 --- a/objects/obj_enunit/Alarm_0.gml +++ b/objects/obj_enunit/Alarm_0.gml @@ -30,7 +30,7 @@ if (!engaged) { } // Shooting - var _ranged_weapons = get_valid_weapon_stacks(weapon_stacks_normal, 2, 999); + var _ranged_weapons = array_concat(get_valid_weapon_stacks(weapon_stacks_normal, 2, 999), get_valid_weapon_stacks_unique(weapon_stacks_unique, 2, 999), get_valid_weapon_stacks(weapon_stacks_vehicle, 2, 999)); for (var i = 0, _ranged_len = array_length(_ranged_weapons); i < _ranged_len; i++) { var _weapon_stack = _ranged_weapons[i]; @@ -44,8 +44,6 @@ if (!engaged) { } var dist = get_block_distance(enemy); - _target_unit_index = get_alpha_strike_target(); - if (_weapon_stack.range >= dist) { if (DEBUG_COLUMN_PRIORITY_ENEMY) { show_debug_message($"{_weapon_stack.weapon_name} IS SHOOTING!"); @@ -93,13 +91,18 @@ if (!engaged) { // Shoot highest-priority target if (!ds_priority_empty(_target_priority_queue)) { var _best_target = ds_priority_delete_max(_target_priority_queue); + var _is_fort = _best_target.object_index == obj_nfort; - var _unit_index = _is_fort ? 1 : _target_unit_index; + if (_is_fort) { + _target_unit_index = 1; + _weapon_stack.target_type = eTARGET_TYPE.FORTIFICATION; + } - scr_shoot(_weapon_stack, _best_target, _unit_index); + scr_shoot(_weapon_stack, _best_target, _target_unit_index); } else { log_error($"{_weapon_stack.weapon_name} didn't find a valid target! This shouldn't happen!"); } + ds_priority_destroy(_target_priority_queue); } else { if (DEBUG_COLUMN_PRIORITY_ENEMY) { @@ -119,7 +122,7 @@ if (!engaged) { } // Melee - var _melee_weapons = get_valid_weapon_stacks(weapon_stacks_normal, 1, 2); + var _melee_weapons = array_concat(get_valid_weapon_stacks(weapon_stacks_normal, 1, 2), get_valid_weapon_stacks_unique(weapon_stacks_unique, 1, 2), get_valid_weapon_stacks(weapon_stacks_vehicle, 1, 999)); for (var i = 0, _wep_len = array_length(_melee_weapons); i < _wep_len; i++) { var _weapon_stack = _melee_weapons[i]; @@ -134,11 +137,11 @@ if (!engaged) { if (instance_exists(obj_nfort) && (!flank)) { enemy = instance_nearest(x, y, obj_nfort); - scr_shoot(_weapon_stack, enemy, 0); - continue; + _target_unit_index = 1; + _weapon_stack.target_type = eTARGET_TYPE.FORTIFICATION; } - scr_shoot(_weapon_stack, enemy, 0); + scr_shoot(_weapon_stack, enemy, _target_unit_index); } if (DEBUG_COLUMN_PRIORITY_ENEMY) { From faf4db493d2f5403e362f9689883b55e48c10b06 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Mon, 14 Apr 2025 19:39:47 +0300 Subject: [PATCH 61/80] Unused var --- objects/obj_enunit/Alarm_1.gml | 2 -- objects/obj_enunit/Create_0.gml | 1 - 2 files changed, 3 deletions(-) diff --git a/objects/obj_enunit/Alarm_1.gml b/objects/obj_enunit/Alarm_1.gml index 4263aa7c7a..b576c89eee 100644 --- a/objects/obj_enunit/Alarm_1.gml +++ b/objects/obj_enunit/Alarm_1.gml @@ -28,7 +28,6 @@ repeat(700) { dudes_damage[j] = 0; dudes_attack[j] = 1; dudes_ranged[j] = 1; - dudes_defense[j] = 1; } if (dudes[j] = "") and(dudes[j + 1] != "") { dudes[j] = dudes[j + 1] dudes_special[j] = dudes_special[j + 1]; @@ -39,7 +38,6 @@ repeat(700) { dudes_damage[j] = dudes_damage[j + 1]; dudes_attack[j] = dudes_attack[j + 1]; dudes_ranged[j] = dudes_ranged[j + 1]; - dudes_defense[j] = dudes_defense[j + 1]; dudes[j + 1] = ""; dudes_special[j + 1] = ""; diff --git a/objects/obj_enunit/Create_0.gml b/objects/obj_enunit/Create_0.gml index 20c9e1e449..23910522b8 100644 --- a/objects/obj_enunit/Create_0.gml +++ b/objects/obj_enunit/Create_0.gml @@ -67,7 +67,6 @@ faith = array_create(_enemy_size, 0); dudes_attack = array_create(_enemy_size, 1); dudes_ranged = array_create(_enemy_size, 1); -dudes_defense = array_create(_enemy_size, 1); dudes_wep1 = array_create(_enemy_size, ""); dudes_wep2 = array_create(_enemy_size, ""); From 2a9e5bb52e1a5f033bb17e3154e2f9a5c4c6faaa Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Mon, 14 Apr 2025 21:08:43 +0300 Subject: [PATCH 62/80] More changes and fixes --- scripts/scr_clean/scr_clean.gml | 56 +++++++++++++------ scripts/scr_flavor2/scr_flavor2.gml | 2 +- .../scr_player_combat_weapon_stacks.gml | 1 - scripts/scr_shoot/scr_shoot.gml | 24 +------- 4 files changed, 41 insertions(+), 42 deletions(-) diff --git a/scripts/scr_clean/scr_clean.gml b/scripts/scr_clean/scr_clean.gml index 51d2cd4b5e..bb398c4b06 100644 --- a/scripts/scr_clean/scr_clean.gml +++ b/scripts/scr_clean/scr_clean.gml @@ -19,7 +19,6 @@ function scr_clean(target_object, weapon_data) { if (DEBUG_ENEMY_TARGET_SELECTION) { var _t_start = get_timer(); - show_debug_message($"Weapon: {weapon_data.name}"); } var armour_pierce = weapon_data.piercing; @@ -31,6 +30,26 @@ function scr_clean(target_object, weapon_data) { var shooter_count = weapon_data.weapon_count; var hostile_shots = weapon_shot_count * shooter_count; + var _melee_accuracy_mod = 1; + var _ranged_accuracy_mod = 1; + switch (obj_ncombat.enemy) { + case eFACTION.Ork: + _melee_accuracy_mod = 0.7; + _ranged_accuracy_mod = 0.4; + break; + case eFACTION.Tau: + _melee_accuracy_mod = 0.5; + _ranged_accuracy_mod = 0.6; + break; + case eFACTION.Tyranids: + _melee_accuracy_mod = 0.6; + _ranged_accuracy_mod = 0.6; + break; + } + + var _accuracy_mod = hostile_range >= 2 ? _ranged_accuracy_mod : _melee_accuracy_mod; + hostile_shots *= _accuracy_mod; + var hits = 0; var unit_type = ""; var valid_vehicles = []; @@ -66,6 +85,16 @@ function scr_clean(target_object, weapon_data) { } valid_vehicles = array_shuffle(valid_vehicles); + if (DEBUG_ENEMY_TARGET_SELECTION) { + var _t_end = get_timer(); + var _elapsed_ms = (_t_end - _t_start) / 1000; + show_debug_message($"⏱️ {hostile_weapon} enemy target validation took: {_elapsed_ms}ms"); + } + + if (DEBUG_ENEMY_TARGET_SELECTION) { + var _t_start = get_timer(); + } + if (target_type == eTARGET_TYPE.ARMOUR && array_empty(valid_vehicles)) { target_type = eTARGET_TYPE.NORMAL; } else if (target_type = eTARGET_TYPE.NORMAL && array_empty(valid_marines)) { @@ -90,8 +119,8 @@ function scr_clean(target_object, weapon_data) { // Apply damage var _min_damage = enemy == 13 ? 1 : 0.25; - var _dice_sides = 200; - var _random_damage_mod = roll_dice(1, _dice_sides, "low") / 100; + var _dice_sides = 50; + var _random_damage_mod = roll_dice(4, _dice_sides, "low") / 100; var _armour_points = max(0, veh_ac[vehicle_id] - armour_pierce); var _modified_damage = max(_min_damage, (hostile_damage * _random_damage_mod) - _armour_points); @@ -113,7 +142,7 @@ function scr_clean(target_object, weapon_data) { } // Remove dead vehicles from further hits - array_delete(valid_vehicles, vehicle_id, 1); + array_delete(valid_vehicles, random_index, 1); } } else { // ### Dreadnought Processing ### @@ -122,8 +151,8 @@ function scr_clean(target_object, weapon_data) { // Apply damage var _min_damage = enemy == 13 ? 1 : 0.25; - var _dice_sides = 200; - var _random_damage_mod = roll_dice(1, _dice_sides, "low") / 100; + var _dice_sides = 50; + var _random_damage_mod = roll_dice(4, _dice_sides, "low") / 100; var _armour_points = max(0, marine_ac[vehicle_id] - armour_pierce); var _modified_damage = (hostile_damage * _random_damage_mod) - _armour_points; @@ -192,8 +221,8 @@ function scr_clean(target_object, weapon_data) { // Apply damage var _min_damage = enemy == 13 ? 1 : 0.25; - var _dice_sides = 200; - var _random_damage_mod = roll_dice(1, _dice_sides, "low") / 100; + var _dice_sides = 50; + var _random_damage_mod = roll_dice(4, _dice_sides, "low") / 100; var _armour_points = max(0, marine_ac[marine_index] - armour_pierce); var _modified_damage = max(_min_damage, (hostile_damage * _random_damage_mod) - _armour_points); @@ -257,22 +286,13 @@ function scr_clean(target_object, weapon_data) { if (DEBUG_ENEMY_TARGET_SELECTION) { var _t_end = get_timer(); var _elapsed_ms = (_t_end - _t_start) / 1000; - show_debug_message($"⏱️ Clean Execution Time: {_elapsed_ms}ms"); - + show_debug_message($"⏱️ {hostile_weapon} enemy damage allocation took: {_elapsed_ms}ms"); show_debug_message($"Hits: {hits}"); show_debug_message($"Kills: {units_lost}"); } // Flavour battle-log message - if (DEBUG_ENEMY_TARGET_SELECTION) { - var _t_start = get_timer(); - } scr_flavor2(units_lost, unit_type, hostile_range, hostile_weapon, shooter_count); - if (DEBUG_ENEMY_TARGET_SELECTION) { - var _t_end = get_timer(); - var _elapsed_ms = (_t_end - _t_start) / 1000; - show_debug_message($"⏱️ Flavour Execution Time: {_elapsed_ms}ms"); - } } } catch (_exception) { handle_exception(_exception); diff --git a/scripts/scr_flavor2/scr_flavor2.gml b/scripts/scr_flavor2/scr_flavor2.gml index fbe2fdecf1..47e629a49d 100644 --- a/scripts/scr_flavor2/scr_flavor2.gml +++ b/scripts/scr_flavor2/scr_flavor2.gml @@ -371,7 +371,7 @@ function scr_flavor2(lost_units_count, target_type, hostile_range, hostile_weapo mes = m1 + m2; - var _message_priority = lost_units_count <= 0 ? hostile_shots : lost_units_count; + var _message_priority = lost_units_count <= 0 ? hostile_shots / 100 : lost_units_count; add_battle_log_message(mes, _message_priority); display_battle_log_message(); } \ No newline at end of file diff --git a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml index 4a1850ca27..2f32ed4471 100644 --- a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml +++ b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml @@ -60,7 +60,6 @@ function add_data_to_stack (weapon, unit_damage=0, head_role=false, unit="none") _weapon_stack.ammo_reload = weapon.reload; } - show_debug_message($"weapon: {weapon}"); struct_set(_stack_type, weapon.name, _weapon_stack); } diff --git a/scripts/scr_shoot/scr_shoot.gml b/scripts/scr_shoot/scr_shoot.gml index c14907bee9..e84856d0b1 100644 --- a/scripts/scr_shoot/scr_shoot.gml +++ b/scripts/scr_shoot/scr_shoot.gml @@ -71,26 +71,6 @@ function scr_shoot(_weapon_stack, _target_object, _target_index) { //* Enemy shooting if (owner == 2) { - var _melee_accuracy_mod = 1; - var _ranged_accuracy_mod = 1; - switch (obj_ncombat.enemy) { - case eFACTION.Ork: - _melee_accuracy_mod = 0.7; - _ranged_accuracy_mod = 0.4; - break; - case eFACTION.Tau: - _melee_accuracy_mod = 0.5; - _ranged_accuracy_mod = 0.6; - break; - case eFACTION.Tyranids: - _melee_accuracy_mod = 0.6; - _ranged_accuracy_mod = 0.6; - break; - } - - var _accuracy_mod = _weapon_stack.range >= 2 ? _ranged_accuracy_mod : _melee_accuracy_mod; - _shot_count *= _accuracy_mod; - if (_target_type == eTARGET_TYPE.FORTIFICATION) { var _wall_weapon_damage = max(1, round(_weapon_attack - _target_object.ac[1])) * _shooter_count * max(1, _weapon_shot_count / 4); _target_object.hp[1] -= _wall_weapon_damage; @@ -131,8 +111,8 @@ function scr_shoot(_weapon_stack, _target_object, _target_index) { // Normal shooting var _min_damage = 0.25; - var _dice_sides = 200; - var _random_damage_mod = roll_dice(1, _dice_sides, "low") / 100; + var _dice_sides = 50; + var _random_damage_mod = roll_dice(4, _dice_sides, "low") / 100; var _armour_points = max(0, _target_object.dudes_ac[_target_index] - _weapon_piercing); _weapon_attack = (_weapon_attack * _random_damage_mod) - _armour_points; _weapon_attack = max(_min_damage, _weapon_attack * _target_object.dudes_dr[_target_index]); From 7bddc10452493a6224af78fc3a09abd9100e79e7 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Tue, 15 Apr 2025 18:44:38 +0300 Subject: [PATCH 63/80] Reworking ncombat and battlelog P1 --- docs/code_guidance.md | 14 +- objects/obj_enunit/Alarm_1.gml | 40 ++- objects/obj_enunit/Create_0.gml | 2 +- objects/obj_ncombat/Alarm_3.gml | 185 ------------ objects/obj_ncombat/Alarm_4.gml | 14 - objects/obj_ncombat/Alarm_5.gml | 1 - objects/obj_ncombat/Alarm_6.gml | 29 -- objects/obj_ncombat/Alarm_8.gml | 30 -- objects/obj_ncombat/Create_0.gml | 28 +- objects/obj_ncombat/Draw_0.gml | 135 +++++---- objects/obj_ncombat/KeyPress_13.gml | 155 ---------- objects/obj_ncombat/KeyPress_67.gml | 8 - objects/obj_ncombat/Step_0.gml | 248 ++++++++++------ objects/obj_ncombat/obj_ncombat.yy | 4 - objects/obj_pnunit/Alarm_3.gml | 5 +- objects/obj_pnunit/Create_0.gml | 5 +- objects/obj_pnunit/Step_0.gml | 4 +- scripts/scr_clean/scr_clean.gml | 16 +- .../scr_colors_initialize.gml | 8 + scripts/scr_en_weapon/scr_en_weapon.gml | 2 +- scripts/scr_flavor/scr_flavor.gml | 71 +++-- scripts/scr_flavor2/scr_flavor2.gml | 279 +++++++----------- .../scr_marine_struct/scr_marine_struct.gml | 2 +- .../scr_player_combat_weapon_stacks.gml | 22 +- scripts/scr_powers/scr_powers.gml | 10 +- .../scr_punit_combat_heplers.gml | 4 +- 26 files changed, 458 insertions(+), 863 deletions(-) delete mode 100644 objects/obj_ncombat/Alarm_3.gml delete mode 100644 objects/obj_ncombat/Alarm_4.gml delete mode 100644 objects/obj_ncombat/Alarm_6.gml delete mode 100644 objects/obj_ncombat/Alarm_8.gml delete mode 100644 objects/obj_ncombat/KeyPress_13.gml delete mode 100644 objects/obj_ncombat/KeyPress_67.gml diff --git a/docs/code_guidance.md b/docs/code_guidance.md index b649665934..50f12b0490 100644 --- a/docs/code_guidance.md +++ b/docs/code_guidance.md @@ -114,9 +114,9 @@ scr_convert_company_to_string(7, true, true); // 7th Reserve Company - once the game has finished it's fade in the player can then click to start the game as defined in obj_ncombat.keypress_13 line 57-66 -- this sets obj_ncombat.timer_stage to 1 +- this sets obj_ncombat.battle_stage to 1 -- once obj_ncombat.timer_stage == 1 the following happens obj_ncombat.keypress_13 line 81-113 +- once obj_ncombat.battle_stage == 1 the following happens obj_ncombat.keypress_13 line 81-113 - a bunch of alarms are set to run over the next 4 frames in this order @@ -132,13 +132,13 @@ scr_convert_company_to_string(7, true, true); // 7th Reserve Company - kicks of scr shoot and scr flavour by extension -- then the timer_stage goes to 2 +- then the battle_stage goes to 2 - while the timer stage is 2 it is waiting for a kerpress defined in obj_ncombat.keypress_13 which kicks of obj_ncombat.alarm[8] -- obj_ncombat.alarm[8] is a timer that kicks the timer_stage up to 3 +- obj_ncombat.alarm[8] is a timer that kicks the battle_stage up to 3 -- now timer_stage is 3 +- now battle_stage is 3 - fllowing alarms are set to run in this order again in obj_ncombat.keypress_13 - obj_pnunit.alarm[3] @@ -153,9 +153,9 @@ scr_convert_company_to_string(7, true, true); // 7th Reserve Company - obj_pnunit.alarm[0] utilises the data from obj_pnunit.alarm[1] to acctually set player -- timer_stage = 4 +- battle_stage = 4 -- this is functionally the same as timer_stage being 2 it's just a wating point to go to timer stage 1/5 (i giess sometimes the enmey can go twice?) +- this is functionally the same as battle_stage being 2 it's just a wating point to go to timer stage 1/5 (i giess sometimes the enmey can go twice?) - this malarky continues unil there are either no active enunit or pnunit objects remaining diff --git a/objects/obj_enunit/Alarm_1.gml b/objects/obj_enunit/Alarm_1.gml index b576c89eee..0f48fa8b50 100644 --- a/objects/obj_enunit/Alarm_1.gml +++ b/objects/obj_enunit/Alarm_1.gml @@ -56,7 +56,7 @@ j = 0; repeat(20) { j += 1; - if (obj_ncombat.started = 0) { + if (obj_ncombat.started == eBATTLE_STAGE.Creation) { if (dudes[j] = "Malcadon Spyrer") { dudes_ac[j] = 35; dudes_hp[j] = 200; @@ -68,7 +68,7 @@ repeat(20) { scr_en_weapon("Venom Claws", true, dudes_num[j], dudes[j], j); } - if ((obj_ncombat.started = 0) or(neww = 1)) or(dudes_num[j] > 1) { + if ((obj_ncombat.started == eBATTLE_STAGE.Creation) or(neww = 1)) or(dudes_num[j] > 1) { if (dudes[j] = "Greater Daemon of Khorne") { dudes_ac[j] = 12; dudes_hp[j] = 700; @@ -80,7 +80,7 @@ repeat(20) { medi += dudes_num[j]; if (obj_ncombat.battle_special = "ship_demon") then dudes_dr[j] = 0.65; } - if ((obj_ncombat.started = 0) or(neww = 1)) or(dudes_num[j] > 1) { + if ((obj_ncombat.started == eBATTLE_STAGE.Creation) or(neww = 1)) or(dudes_num[j] > 1) { if (dudes[j] = "Greater Daemon of Slaanesh") { dudes_ac[j] = 10; dudes_hp[j] = 500; @@ -93,7 +93,7 @@ repeat(20) { dudes_dr[j] = 0.25; medi += dudes_num[j]; } - if ((obj_ncombat.started = 0) or(neww = 1)) or(dudes_num[j] > 1) { + if ((obj_ncombat.started == eBATTLE_STAGE.Creation) or(neww = 1)) or(dudes_num[j] > 1) { if (dudes[j] = "Greater Daemon of Nurgle") { dudes_ac[j] = 8; dudes_hp[j] = 900; @@ -106,7 +106,7 @@ repeat(20) { dudes_dr[j] = 0.6; medi += dudes_num[j]; } - if ((obj_ncombat.started = 0) or(neww = 1)) or(dudes_num[j] > 1) { + if ((obj_ncombat.started == eBATTLE_STAGE.Creation) or(neww = 1)) or(dudes_num[j] > 1) { if (dudes[j] = "Greater Daemon of Tzeentch") { dudes_ac[j] = 10; dudes_hp[j] = 600; @@ -293,10 +293,6 @@ if __b__ { // Right here should be retreat- if important units are exposed they should try to hop left - /*if (dudes_num[1]=0) and (obj_ncombat.started=0){ - instance_destroy(); - exit; - }*/ if (men > 0) and(alarm[5] > 0) then alarm[5] = -1; instance_activate_object(obj_enunit); @@ -426,7 +422,7 @@ if __b__ { scr_en_weapon("Laser Mace", true, dudes_num[j], dudes[j], j); scr_en_weapon("Infernus Pistol", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 10; - if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { + if (obj_ncombat.started == eBATTLE_STAGE.Creation) or(dudes_num[j] > 1) { dudes_hp[j] = 200; } men += dudes_num[j]; @@ -562,7 +558,7 @@ if __b__ { scr_en_weapon("Exorcist Missile Launcher", false, dudes_num[j], dudes[j], j); scr_en_weapon("Storm Bolter", false, dudes_num[j], dudes[j], j); dudes_ac[j] = 40; - if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { + if (obj_ncombat.started == eBATTLE_STAGE.Creation) or(dudes_num[j] > 1) { dudes_hp[j] = 200; } dudes_dr[j] = 0.55; @@ -876,7 +872,7 @@ if __b__ { scr_en_weapon("Rokkit Launcha", true, dudes_num[j], dudes[j], j); scr_en_weapon("Big Shoota", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 12; - if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { + if (obj_ncombat.started == eBATTLE_STAGE.Creation) or(dudes_num[j] > 1) { dudes_hp[j] = 600; } veh += dudes_num[j]; @@ -887,7 +883,7 @@ if __b__ { scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); scr_en_weapon("Big Shoota", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 8; - if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { + if (obj_ncombat.started == eBATTLE_STAGE.Creation) or(dudes_num[j] > 1) { dudes_hp[j] = 150; dudes_dr[j] = 0.75; } @@ -897,7 +893,7 @@ if __b__ { scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); scr_en_weapon("Rokkit Launcha", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 12; - if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { + if (obj_ncombat.started == eBATTLE_STAGE.Creation) or(dudes_num[j] > 1) { dudes_hp[j] = 200; dudes_dr[j] = 0.75; } @@ -907,7 +903,7 @@ if __b__ { scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); scr_en_weapon("Rokkit Launcha", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 12; - if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { + if (obj_ncombat.started == eBATTLE_STAGE.Creation) or(dudes_num[j] > 1) { dudes_hp[j] = 300; dudes_dr[j] = 0.5; } @@ -1248,7 +1244,7 @@ if __b__ { scr_en_weapon("Meltagun", true, dudes_num[j], dudes[j], j); scr_en_weapon("Power Fist", true, dudes_num[j], dudes[j], j); dudes_ac[j] = 30; - if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { + if (obj_ncombat.started == eBATTLE_STAGE.Creation) or(dudes_num[j] > 1) { dudes_hp[j] = 300; } men += dudes_num[j]; @@ -1257,7 +1253,7 @@ if __b__ { if (dudes[j] = "Leader") and(obj_controller.faction_gender[10] = 2) { scr_en_weapon("Khorne Demon Melee", true, dudes_num[j] * 2, dudes[j], j); dudes_ac[j] = 30; - if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { + if (obj_ncombat.started == eBATTLE_STAGE.Creation) or(dudes_num[j] > 1) { dudes_hp[j] = 300; } men += dudes_num[j]; @@ -1606,7 +1602,7 @@ if __b__ { if (dudes[j] = "Necron Overlord") { scr_en_weapon("Staff of Light", true, dudes_num[j], dudes[j], j); scr_en_weapon("Staff of Light Shooting", true, dudes_num[j], dudes[j], j); - if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { + if (obj_ncombat.started == eBATTLE_STAGE.Creation) or(dudes_num[j] > 1) { dudes_ac[j] = 12; dudes_hp[j] = 300; dudes_dr[j] = 0.5; @@ -1647,7 +1643,7 @@ if __b__ { if (dudes[j] = "Necron Wraith") { scr_en_weapon("Wraith Claws", true, dudes_num[j], dudes[j], j); - if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { + if (obj_ncombat.started == eBATTLE_STAGE.Creation) or(dudes_num[j] > 1) { dudes_ac[j] = 10; dudes_hp[j] = 200; } @@ -1667,7 +1663,7 @@ if __b__ { scr_en_weapon("Gauss Particle Cannon", false, dudes_num[j] * 1, dudes[j], j); scr_en_weapon("Overcharged Gauss Cannon", false, dudes_num[j] * 2, dudes[j], j); scr_en_weapon("Claws", false, dudes_num[j] * 5, dudes[j], j); - if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { + if (obj_ncombat.started == eBATTLE_STAGE.Creation) or(dudes_num[j] > 1) { dudes_ac[j] = 40; dudes_hp[j] = 600; } @@ -1677,7 +1673,7 @@ if __b__ { } if (dudes[j] = "Canoptek Spyder") { scr_en_weapon("Claws", false, dudes_num[j] * 2, dudes[j], j); - if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { + if (obj_ncombat.started == eBATTLE_STAGE.Creation) or(dudes_num[j] > 1) { dudes_ac[j] = 30; dudes_hp[j] = 300; } @@ -1743,7 +1739,7 @@ if (men + veh + medi <= 0) { exit; } -if (obj_ncombat.started = 0) { +if (obj_ncombat.started == eBATTLE_STAGE.Creation) { obj_ncombat.enemy_forces += self.men + self.veh + self.medi; } engaged = (collision_point(x + 12, y, obj_pnunit, 0, 1)) or(collision_point(x - 12, y, obj_pnunit, 0, 1)); diff --git a/objects/obj_enunit/Create_0.gml b/objects/obj_enunit/Create_0.gml index 23910522b8..1f3fcf86fe 100644 --- a/objects/obj_enunit/Create_0.gml +++ b/objects/obj_enunit/Create_0.gml @@ -81,5 +81,5 @@ if (obj_ncombat.enemy=1) then alarm[6]=10; hit = function() { - return scr_hit(x1, y1, x2, y2) && obj_ncombat.fadein <= 0; + return scr_hit(x1, y1, x2, y2) && obj_ncombat.fading == false; }; diff --git a/objects/obj_ncombat/Alarm_3.gml b/objects/obj_ncombat/Alarm_3.gml deleted file mode 100644 index 2fc932d6d9..0000000000 --- a/objects/obj_ncombat/Alarm_3.gml +++ /dev/null @@ -1,185 +0,0 @@ - -// if (battle_over=1) then exit; -if (defeat_message=1) then exit; - -if (wall_destroyed=1) then wall_destroyed=0; - -var i,good,changed;i=0;good=0;changed=0; - -// if (messages_to_show = 24) and (messages_shown=0) then alarm[6]=75; -// if (messages_shown=105) then exit; - - - - -/*i+=1;if (message[i]!="") then show_message(message[i]); -i+=1;if (message[i]!="") then show_message(message[i]); -i+=1;if (message[i]!="") then show_message(message[i]); -i+=1;if (message[i]!="") then show_message(message[i]); -i+=1;if (message[i]!="") then show_message(message[i]); -i+=1;if (message[i]!="") then show_message(message[i]);*/ - - - -repeat(100){ - if (good=0){ - changed=0;i=0; - - repeat(55){ - i+=1; - - // Collide the messages if needed - if (message[i]="") and (message[i+1]!=""){ - message[i]=message[i+1]; - message_sz[i]=message_sz[i+1]; - message_priority[i]=message_priority[i+1]; - - message[i+1]=""; - message_sz[i+1]=0; - message_priority[i+1]=0; - changed=1; - } - - // Move larger messages up - if (message[i]!="") and (message[i+1]!="") and (message_sz[i]0) and (messages_shown<24)) and (messages_shown<=100){ - var that_sz,that;// show_message("Largest Message"); - that_sz=0;that=0; - - i=0;repeat(60){ - i+=1; - if (message[i]!="") and (message_sz[i]>that_sz){ - that_sz=message_sz[i];that=i; - } - } - if (that!=0) and (that_sz>0){ - newline=message[that]; - if (message_priority[that]>0) then newline_color="bright"; - if (string_count("lost",newline)>0) then newline_color="red"; - if (string_count("critically damaged",newline)>0) then newline_color="red"; - if (string_count("^",newline)>0){ - newline=string_replace(newline,"^",""); - newline_color="white"; - } - - if (message_priority[that]=134) then newline_color="purple"; - if (message_priority[that]=135) then newline_color="blue"; - if (message_priority[that]=137) then newline_color="red"; - - scr_newtext(); - messages_shown+=1; - largest+=1; - message[that]="";message_sz[that]=0;message_priority[that]=0;messages-=1; - } - - alarm[3]=2; -} - - - - - - - - -if (messages=0) or (messages_shown>=24) then messages_shown=999; - -if (messages=0) then messages_shown=999; - -/*var noloss;noloss=instance_nearest(50,300,obj_pnunit); -if (!instance_exists(noloss)) then player_forces=0; -if (instance_exists(noloss)){if (point_distance(50,300,noloss.x,noloss.y)>500) then player_forces=0;}*/ - - -if (instance_exists(obj_pnunit)){ - var plnear;plnear=instance_nearest(room_width,240,obj_pnunit); - if (plnear.x<-40) then player_forces=0; -} -if (!instance_exists(obj_pnunit)) then player_forces=0; - - -if ((messages_shown=999) or (messages=0)) and (timer_stage=2){ - newline_color="yellow"; - if (obj_ncombat.enemy!=6){ - if (enemy_forces>0) and (obj_ncombat.enemy!=30) then newline="Enemy Forces at "+string(max(1,round((enemy_forces/enemy_max)*100)))+"%"; - if (obj_ncombat.enemy=30) and (instance_exists(obj_enunit)){newline="Enemy has ";var yoo;yoo=instance_nearest(0,0,obj_enunit);newline+=string(round(yoo.dudes_hp[1]))+"HP remaining";} - if (enemy_forces<=0) or (!instance_exists(obj_enunit)) and (defeat_message=0){defeat_message=1;newline="Enemy Forces Defeated";timer_maxspeed=0;timer_speed=0;started=2;instance_activate_object(obj_pnunit);} - } - newline_color="yellow"; - if (obj_ncombat.enemy=6){ - var jims;jims=0; - repeat(20){jims+=1; - if (dead_jim[jims]!="") and (dead_jims>0){ - newline=dead_jim[jims];newline_color="red"; - scr_newtext();dead_jim[jims]="";dead_jims-=1; - } - } - if (player_forces>0){newline=string(global.chapter_name)+" at "+string(round((player_forces/player_max)*100))+"%";four_show=0;} - var plnear;plnear=instance_nearest(room_width,240,obj_pnunit); - if ((player_forces<=0) or (plnear.x<-40)) and (defeat_message=0){defeat_message=1;newline=string(global.chapter_name)+" Defeated";timer_maxspeed=0;timer_speed=0;started=4;defeat=1;instance_activate_object(obj_pnunit);} - } - messages_shown=105;done=1;scr_newtext();timer_stage=3;exit; -} - -if ((messages_shown=999) or (messages=0)) and ((timer_stage=4) or (timer_stage=5)) and (four_show=0){ - newline_color="yellow"; - if (obj_ncombat.enemy!=6){ - var jims;jims=0; - repeat(20){jims+=1; - if (dead_jim[jims]!="") and (dead_jims>0){ - newline=dead_jim[jims];newline_color="red"; - scr_newtext();dead_jim[jims]="";dead_jims-=1; - } - } - if (player_forces>0){newline=string(global.chapter_name)+" at "+string(round((player_forces/player_max)*100))+"%";four_show=1;} - var plnear;plnear=instance_nearest(room_width,240,obj_pnunit); - if ((player_forces<=0) or (plnear.x<-40)) and (defeat_message=0){defeat_message=1;newline=string(global.chapter_name)+" Defeated";timer_maxspeed=0;timer_speed=0;started=4;defeat=1;instance_activate_object(obj_pnunit);} - } - newline_color="yellow"; - if (obj_ncombat.enemy=6){ - if (enemy_forces>0) then newline="Enemy Forces at "+string(max(1,round((enemy_forces/enemy_max)*100)))+"%"; - if ((enemy_forces<=0) or (!instance_exists(obj_enunit))) and (defeat_message=0){defeat_message=1;newline="Enemy Forces Defeated";timer_maxspeed=0;timer_speed=0;started=2;instance_activate_object(obj_pnunit);} - } - messages_shown=105;done=1;scr_newtext();timer_stage=5;exit; -} - -/* */ -/* */ diff --git a/objects/obj_ncombat/Alarm_4.gml b/objects/obj_ncombat/Alarm_4.gml deleted file mode 100644 index 6bd459b445..0000000000 --- a/objects/obj_ncombat/Alarm_4.gml +++ /dev/null @@ -1,14 +0,0 @@ -var jims;jims=0; -repeat(20){ - jims+=1; - - if (dead_jim[jims]!=""){ - newline=dead_jim[jims];newline_color="red"; - scr_newtext(); - dead_jim[jims]=""; - dead_jims-=1; - - if (dead_jims>0) then alarm[4]=1; - } -} - diff --git a/objects/obj_ncombat/Alarm_5.gml b/objects/obj_ncombat/Alarm_5.gml index 9013944a67..57e1a3ded9 100644 --- a/objects/obj_ncombat/Alarm_5.gml +++ b/objects/obj_ncombat/Alarm_5.gml @@ -4,7 +4,6 @@ var part1="",part2="",part3="",part4="",part9=""; var part5="",part6="",part7="",part8="",part10=""; battle_over=1; -alarm[8]=999999; var line_break = "------------------------------------------------------------------------------"; // show_message("Final Deaths: "+string(final_marine_deaths)); diff --git a/objects/obj_ncombat/Alarm_6.gml b/objects/obj_ncombat/Alarm_6.gml deleted file mode 100644 index 95370e80fd..0000000000 --- a/objects/obj_ncombat/Alarm_6.gml +++ /dev/null @@ -1,29 +0,0 @@ - -if (battle_over=1) then exit; - -/*if (messages_to_show = 24){ - if (enemy_forces<=0) or (!instance_exists(obj_enunit)) and (defeat_message=0){defeat_message=1; - newline_color="yellow";newline="Enemy Forces Defeated";timer_maxspeed=0; - timer_speed=0;timer=0;started=2;messages_shown=105;// done=1;// alarm[3]=-1; - scr_newtext();exit; - } - if (player_forces<=0) and (defeat_message=0){defeat_message=1; - newline_color="yellow";newline=string(global.chapter_name)+" Defeated"; - timer_maxspeed=0;timer_speed=0;started=4;messages_shown=105;defeat=1;// done=1; - scr_newtext();exit; - } - if (instance_exists(obj_enunit)){ - if (timer_stage=2){ - timer_stage=3; - timer=0; - } - if (timer_stage=4){ - timer_stage=5; - timer=0; - } - } -} -*/ - -/* */ -/* */ diff --git a/objects/obj_ncombat/Alarm_8.gml b/objects/obj_ncombat/Alarm_8.gml deleted file mode 100644 index feded6b1e0..0000000000 --- a/objects/obj_ncombat/Alarm_8.gml +++ /dev/null @@ -1,30 +0,0 @@ - -if (enemy_forces!=0) and (player_forces!=0) and (battle_over=0){ - - if ((enemy=6)) and (timer_stage=2){ - timer_stage=3; - - messages=0;messages_to_show = 24;largest=0;random_messages=0;priority=0;messages_shown=0; - } - - if ((enemy!=6)) and (timer_stage=2){ - timer_stage=3; - - messages=0;messages_to_show = 24;largest=0;random_messages=0;priority=0;messages_shown=0; - } - - if ((enemy=6)) and (timer_stage=4){ - timer_stage=5; - - messages=0;messages_to_show = 24;largest=0;random_messages=0;priority=0;messages_shown=0; - } - - if ((enemy!=6)) and (timer_stage=4){ - timer_stage=5; - - messages=0;messages_to_show = 24;largest=0;random_messages=0;priority=0;messages_shown=0; - } - -} - - diff --git a/objects/obj_ncombat/Create_0.gml b/objects/obj_ncombat/Create_0.gml index 4c17438f92..d88fa696b1 100644 --- a/objects/obj_ncombat/Create_0.gml +++ b/objects/obj_ncombat/Create_0.gml @@ -15,14 +15,10 @@ if (nope!=1){audio_sound_gain(snd_battle,0.25*obj_controller.master_volume*obj_c //limit on the size of the players forces allowed -enter_pressed = 0 man_size_limit = 0; man_limit_reached = false; man_size_count = 0; -fack=0; -cd=0; owner = eFACTION.Player; -click_stall_timer=0; formation_set=0; on_ship=false; alpha_strike=0; @@ -56,16 +52,13 @@ battle_id=0; battle_object=0; battle_special=""; defeat=0; -defeat_message=0; +battle_ended=false; red_thirst=0; -fugg=0;fugg2=0; battle_over=0; -done=0; captured_gaunt=0; ethereal=0; hulk_treasure=0; -four_show=0; chaos_angry=0; leader=0; @@ -97,10 +90,11 @@ obj_pnunit.alarm[3]=1; alarm[2]=8; -started=0; +started=eBATTLE_STAGE.Creation; charged=0; -fadein=40; +fading_strength = 1; + enemy=0; threat=0; fortified=0; @@ -115,19 +109,19 @@ player_defenses=0;player_silos=0; enemy_forces=0;enemy_max=0; hulk_forces=0; -i=-1;messages=0;messages_to_show=24;messages_shown=0; -largest=0;priority=0;random_messages=0; +messages_shown=0; units_lost_counts = {}; vehicles_lost_counts = {}; +messages_queue = ds_priority_create(); + var _messages_size = 70; lines = array_create(_messages_size, ""); lines_color = array_create(_messages_size, ""); message = array_create(_messages_size, ""); message_sz = array_create(_messages_size, 0); message_priority = array_create(_messages_size, 0); -dead_jim = array_create(_messages_size, ""); post_equipment_lost = array_create(_messages_size, ""); post_equipments_lost = array_create(_messages_size, 0); @@ -155,18 +149,12 @@ final_marine_deaths=0; final_command_deaths=0; vehicle_deaths=0; casualties=0; -dead_jims=0; newline=""; newline_color=""; liness=0; world_size=0; -timer=0; -timer_stage=0; -timer_speed=0; -timer_maxspeed=1; -timer_pause=-1; -turns=1; +battle_stage=eBATTLE_TURN.Creation; // diff --git a/objects/obj_ncombat/Draw_0.gml b/objects/obj_ncombat/Draw_0.gml index 092eef46b4..c4a20166b9 100644 --- a/objects/obj_ncombat/Draw_0.gml +++ b/objects/obj_ncombat/Draw_0.gml @@ -1,83 +1,94 @@ +draw_sprite(spr_rock_bg, 0, 0, 0); -draw_sprite(spr_rock_bg,0,0,0); - -draw_set_color(c_black);draw_set_alpha(1); -draw_rectangle(0,0,800,900,0); -draw_rectangle(818,235,1578,666,0); +draw_set_color(c_black); +draw_set_alpha(1); +draw_rectangle(0, 0, 800, 900, 0); +draw_rectangle(818, 235, 1578, 666, 0); draw_set_color(38144); -var l;l=0; -draw_set_alpha(1);draw_rectangle(0+l,0+l,800-l,900-l,1);l+=1; -draw_set_alpha(0.75);draw_rectangle(0+l,0+l,800-l,900-l,1);l+=1; -draw_set_alpha(0.5);draw_rectangle(0+l,0+l,800-l,900-l,1);l+=1; -draw_set_alpha(0.25);draw_rectangle(0+l,0+l,6800-l,900-l,1); - -l=0; -draw_set_alpha(1);draw_rectangle(818+l,235+l,1578-l,666-l,1);l+=1; -draw_set_alpha(0.75);draw_rectangle(818+l,235+l,1578-l,666-l,1);l+=1; -draw_set_alpha(0.5);draw_rectangle(818+l,235+l,1578-l,666-l,1);l+=1; -draw_set_alpha(0.25);draw_rectangle(818+l,235+l,1578-l,666-l,1); - - -l=0;draw_set_alpha(1); +var l; +l = 0; +draw_set_alpha(1); +draw_rectangle(0 + l, 0 + l, 800 - l, 900 - l, 1); +l += 1; +draw_set_alpha(0.75); +draw_rectangle(0 + l, 0 + l, 800 - l, 900 - l, 1); +l += 1; +draw_set_alpha(0.5); +draw_rectangle(0 + l, 0 + l, 800 - l, 900 - l, 1); +l += 1; +draw_set_alpha(0.25); +draw_rectangle(0 + l, 0 + l, 6800 - l, 900 - l, 1); + +l = 0; +draw_set_alpha(1); +draw_rectangle(818 + l, 235 + l, 1578 - l, 666 - l, 1); +l += 1; +draw_set_alpha(0.75); +draw_rectangle(818 + l, 235 + l, 1578 - l, 666 - l, 1); +l += 1; +draw_set_alpha(0.5); +draw_rectangle(818 + l, 235 + l, 1578 - l, 666 - l, 1); +l += 1; +draw_set_alpha(0.25); +draw_rectangle(818 + l, 235 + l, 1578 - l, 666 - l, 1); + +l = 0; +draw_set_alpha(1); draw_set_font(fnt_40k_14); -if (display_p1>0) and (player_forces>0){ - draw_set_color(c_yellow);draw_set_halign(fa_left); - draw_text(64,880,string_hash_to_newline(string(display_p1n)+": "+string(display_p1)+"HP")); +if ((display_p1 > 0) && (player_forces > 0)) { + draw_set_color(c_yellow); + draw_set_halign(fa_left); + draw_text(64, 880, string_hash_to_newline(string(display_p1n) + ": " + string(display_p1) + "HP")); } -if (display_p2>0) and (enemy_forces>0){ - draw_set_color(c_yellow);draw_set_halign(fa_right); - draw_text(800-64,880,string_hash_to_newline(string(display_p2n)+": "+string(display_p2)+"HP")); +if ((display_p2 > 0) && (enemy_forces > 0)) { + draw_set_color(c_yellow); + draw_set_halign(fa_right); + draw_text(800 - 64, 880, string_hash_to_newline(string(display_p2n) + ": " + string(display_p2) + "HP")); } draw_set_halign(fa_left); - - -repeat(45){l+=1; +repeat (45) { + l += 1; // draw_text(x+6,y-10+(l*14),"."+string(lines[31-l])); draw_set_color(38144); - if (lines_color[l]="red") then draw_set_color(c_red); - if (lines_color[l]="yellow") then draw_set_color(3055825); - if (lines_color[l]="purple") then draw_set_color(16646566); - if (lines_color[l]="bright") then draw_set_color(65280); - if (lines_color[l]="white") then draw_set_color(c_silver); - if (lines_color[l]="blue") then draw_set_color(c_aqua); - draw_text(x+6,y-10+(l*18),string_hash_to_newline(string(lines[l]))); -} - -draw_set_color(38144); -if (click_stall_timer<=0){ - if (fadein<0) and (fadein>-100) and (started=0){ - draw_set_alpha((fadein*-1)/30); - draw_set_halign(fa_center); - draw_text(400,860,string_hash_to_newline("[Press Enter to Begin]")); + if (lines_color[l] == "red") { + draw_set_color(c_red); } - if (started=2) or ((started=1) and ((timer_stage=3) or (timer_stage=5) or (timer_stage=0))) or (started=4){ - draw_set_halign(fa_center); - draw_text(400,860,string_hash_to_newline("[Press Enter to Continue]")); + if (lines_color[l] == "yellow") { + draw_set_color(3055825); } - if (started=3) or (started=5){ - draw_set_halign(fa_center); - draw_text(400,860,string_hash_to_newline("[Press Enter to Exit]")); + if (lines_color[l] == "purple") { + draw_set_color(16646566); } + if (lines_color[l] == "bright") { + draw_set_color(65280); + } + if (lines_color[l] == "white") { + draw_set_color(c_silver); + } + if (lines_color[l] == "blue") { + draw_set_color(c_aqua); + } + draw_text(x + 6, y - 10 + (l * 18), string_hash_to_newline(string(lines[l]))); } +draw_set_color(38144); +draw_set_halign(fa_center); + +if (started == eBATTLE_STAGE.Creation) { + draw_text(400, 860, string_hash_to_newline("[Press Enter to Begin]")); +} else if (started == eBATTLE_STAGE.PlayerWinEnd || started == eBATTLE_STAGE.EnemyWinEnd) { + draw_text(400, 860, string_hash_to_newline("[Press Enter to Exit]")); +} else if (battle_stage == eBATTLE_TURN.PlayerEnd || battle_stage == eBATTLE_TURN.EnemyEnd) { + draw_text(400, 860, string_hash_to_newline("[Press Enter to Continue]")); +} - -draw_set_halign(fa_left);draw_set_alpha(1); - -// Timer -// draw_rectangle(16,464,min(16+(timer*2.026),624),472,0); - - -// draw_text(320,300,"Turn: "+string(turns)); - - +draw_set_alpha(fading_strength); +draw_set_halign(fa_left); draw_set_color(c_black); -draw_set_alpha(fadein/30); -draw_rectangle(0,0,1600,900,0); +draw_rectangle(0, 0, 1600, 900, 0); draw_set_alpha(1); - diff --git a/objects/obj_ncombat/KeyPress_13.gml b/objects/obj_ncombat/KeyPress_13.gml deleted file mode 100644 index 2531ccb64a..0000000000 --- a/objects/obj_ncombat/KeyPress_13.gml +++ /dev/null @@ -1,155 +0,0 @@ -var __b__; -__b__ = action_if_number(obj_popup, 0, 0); -if __b__ -{ -__b__ = action_if_variable(cd, 1, 1); -if __b__ -{ -__b__ = action_if_variable(click_stall_timer, 1, 1); -if __b__ -{ - - -// with(ob_ennt){shomesge(string(dudes[1])+"|"+string(dudes_num[1])+"|"+string(men+medi)+"|"+string(dudes_hp[1]));} - -// 135; -// instance_activate_object(obj_cursor); - -if (enemy_forces<=0) { // Combat for whatever reason sometimes bugs out when there are no enemies, so if enter is pressed 6 times at this state it will set started to 2 - enter_pressed++ -} - -if (started>=2) then instance_activate_object(obj_pnunit); - -if (started=3){ - - instance_activate_all(); - instance_activate_object(obj_pnunit); - instance_activate_object(obj_enunit); - instance_destroy(obj_popup); - instance_destroy(obj_star_select); - if (instance_exists(obj_pnunit)){ - obj_pnunit.alarm[6]=1; - } - - alarm[7]=2; - click_stall_timer=15; -} - -// if (done>=1) then exit; - - - -if (turn_count >= 50 || enter_pressed > 5) { - started=2; -} -if ((started=2) or (started=4)){ - instance_activate_object(obj_pnunit); - instance_activate_object(obj_enunit); - // started=3;alarm[5]=3;obj_pnunit.alarm[4]=1;obj_pnunit.alarm[5]=2;obj_enunit.alarm[1]=3; - started=3; - // obj_pnunit.alarm[4]=2;obj_pnunit.alarm[5]=3;obj_enunit.alarm[1]=1; - var _quad_factor = 10; - total_battle_exp_gain = _quad_factor * sqr(threat); - if (instance_exists(obj_enunit)){obj_enunit.alarm[1]=1;} - instance_activate_object(obj_star); - instance_activate_object(obj_event_log); - alarm[5]=6; - click_stall_timer=15; - - fack=1; - - newline="------------------------------------------------------------------------------"; - scr_newtext(); - newline="------------------------------------------------------------------------------"; - scr_newtext(); -} - -if (fadein<0) and (fadein>-100) and (started=0){ - fadein=-500; - started=1; - timer_speed=1; - timer_stage=1; - timer=100; - - if (enemy=30) then timer_stage=3; - if (battle_special="ship_demon") then timer_stage=3; -} - - -if (started>0){// This might be causing problems? - if (instance_exists(obj_pnunit)) then obj_pnunit.alarm[8]=8; - if (instance_exists(obj_enunit)) then obj_enunit.alarm[8]=8; -} - - -if (timer_stage=1) or (timer_stage=5){ - if (global_perils>0) then global_perils-=1; - if (global_perils<0) then global_perils=0; - turns+=1; - - four_show=0; - click_stall_timer=15; - // if (battle_over!=1) then alarm[8]=15; - - if (enemy!=6){ - if (instance_exists(obj_enunit)){ - obj_enunit.alarm[1]=1; - } - set_up_player_blocks_turn(); - // alarm[9]=5; - } - - else if (enemy==6){ - if (instance_exists(obj_enunit)){ - obj_enunit.alarm[1]=2; - move_enemy_blocks(); - obj_enunit.alarm[0]=3; - } - if (instance_exists(obj_pnunit)){ - wait_and_execute(1, scr_player_combat_weapon_stacks); - turn_count++; - } - } - reset_combat_message_arrays(); - timer_stage=2; -} - - - -else if (timer_stage=3){ - if (battle_over!=1) then alarm[8]=15; - click_stall_timer=15; - - if (enemy!=6){ - if (instance_exists(obj_pnunit)){ - with(obj_pnunit){ - wait_and_execute(1, scr_player_combat_weapon_stacks); - } - turn_count++; - } - if (instance_exists(obj_enunit)){ - obj_enunit.alarm[1]=2; - move_enemy_blocks(); - obj_enunit.alarm[0]=3; - obj_enunit.alarm[8]=4; - turns+=1; - } - reset_combat_message_arrays(); - } - if (enemy=6){ - set_up_player_blocks_turn(); - turns+=1; - if (instance_exists(obj_enunit)){ - obj_enunit.alarm[1]=1; - } - // alarm[9]=5; - reset_combat_message_arrays(); - } -} - - - -} -} -} diff --git a/objects/obj_ncombat/KeyPress_67.gml b/objects/obj_ncombat/KeyPress_67.gml deleted file mode 100644 index c343097b3c..0000000000 --- a/objects/obj_ncombat/KeyPress_67.gml +++ /dev/null @@ -1,8 +0,0 @@ -if (global.cheat_debug == 1) -{ - for (var i = 0; i < 30; i++) - { - if (_message[i] != "") - show_message(string(_message[i])) - } -} diff --git a/objects/obj_ncombat/Step_0.gml b/objects/obj_ncombat/Step_0.gml index daace578be..6fb7c52e5d 100644 --- a/objects/obj_ncombat/Step_0.gml +++ b/objects/obj_ncombat/Step_0.gml @@ -1,114 +1,192 @@ - -if (fadein>-30) then fadein-=1; -if (cd>=0) then cd-=1; -if (click_stall_timer>=0) then click_stall_timer-=1; -// if (done>=1) then done+=1; - - - - -if (!instance_exists(obj_enunit)){ - enemy_forces=0; -} -if (!instance_exists(obj_pnunit)){ - player_forces=0; +enum eBATTLE_TURN { + Creation, + Start, + PlayerStart, + PlayerEnd, + EnemyStart, + EnemyEnd, } +enum eBATTLE_STAGE { + Creation, + Start, + PlayerWinStart, + PlayerWinEnd, + EnemyWinStart, + EnemyWinEnd +} -if (fack=1) then instance_activate_object(obj_pnunit); -instance_activate_object(obj_centerline); -instance_activate_object(obj_cursor); - +if (fading_strength > 0) { + fading_strength -= 0.05; +} -if ((fugg>=60) or (fugg2>=60)) and (messages_shown=0) and (messages_to_show = 24) and (defeat_message=0){ - fugg=0; - fugg2=0; - with (obj_pnunit){ - target_block_is_valid(id,obj_pnunit); +if (!battle_ended) { + with (obj_pnunit) { + target_block_is_valid(id, obj_pnunit); } - with (obj_enunit){ - if (x<0){ + + with (obj_enunit) { + if (x < 0) { instance_destroy(); } else { - var nearest = instance_nearest(x,y,obj_pnunit); - if (instance_exists(nearest)){ - if (point_distance(x, y, nearest.x, nearest.y) > 100){ + var nearest = instance_nearest(x, y, obj_pnunit); + if (instance_exists(nearest)) { + if (point_distance(x, y, nearest.x, nearest.y) > 100) { instance_destroy(); } } } - } - if ((messages_shown=999) or (messages=0)) and (timer_stage=2){ - newline_color="yellow"; - if (obj_ncombat.enemy!=6){ - if (enemy_forces<=0) or (!instance_exists(obj_enunit)) and (defeat_message=0){ - defeat_message=1; - newline="Enemy Forces Defeated"; - timer_maxspeed=0; - timer_speed=0; - started=2; - instance_activate_object(obj_pnunit); - } +} + +if (wall_destroyed == 1) { + wall_destroyed = 0; +} + +if (keyboard_check_pressed(vk_enter) && fading_strength == 0) { + if (started == eBATTLE_STAGE.Creation) { + started = eBATTLE_STAGE.Start; + battle_stage = eBATTLE_TURN.Start; + + if (enemy == 30) { + battle_stage = eBATTLE_TURN.PlayerEnd; } - newline_color="yellow"; - if (obj_ncombat.enemy=6){ - if ((player_forces<=0) or (!instance_exists(obj_pnunit))) and (defeat_message=0){ - defeat_message=1; - newline=string(global.chapter_name)+" Defeated"; - timer_maxspeed=0; - timer_speed=0; - started=4; - defeat=1; - instance_activate_object(obj_pnunit); - } + if (battle_special == "ship_demon") { + battle_stage = eBATTLE_TURN.PlayerEnd; } - messages_shown=105; - done=1; - scr_newtext(); - timer_stage=3; - exit; } - - // show_message("Shown: "+string(messages_shown)+"#Messages: "+string(messages)+"#Timer Stage: "+string(timer_stage)); - if ((messages_shown=999) or (messages=0)) and ((timer_stage=4) or (timer_stage=5)) and (four_show=0){ - newline_color="yellow"; - if (obj_ncombat.enemy!=6){ - if ((player_forces<=0) or (!instance_exists(obj_pnunit))) and (defeat_message=0){defeat_message=1;newline=string(global.chapter_name)+" Defeated";timer_maxspeed=0;timer_speed=0;started=4;defeat=1;instance_activate_object(obj_pnunit);} + + if (started > eBATTLE_STAGE.Creation) { + // This might be causing problems? + if (instance_exists(obj_pnunit)) { + obj_pnunit.alarm[8] = 8; } - newline_color="yellow"; - if (obj_ncombat.enemy=6){ - if ((enemy_forces<=0) or (!instance_exists(obj_enunit))) and (defeat_message=0){defeat_message=1;newline="Enemy Forces Defeated";timer_maxspeed=0;timer_speed=0;started=2;instance_activate_object(obj_pnunit);} + if (instance_exists(obj_enunit)) { + obj_enunit.alarm[8] = 8; } - messages_shown=105; - done=1; - scr_newtext(); - timer_stage=5;exit; } - exit; -} + if (battle_stage == eBATTLE_TURN.PlayerStart) { + if (global_perils > 0) { + global_perils -= 1; + } + + queue_battlelog_message($"Turn {turn_count}", 999, "yellow"); + resolve_battle_state(); + display_message_queue(); + battle_stage = eBATTLE_TURN.PlayerEnd; + } + + if (battle_stage == eBATTLE_TURN.EnemyStart) { + queue_battlelog_message($"Turn {turn_count}", 999, "yellow"); + resolve_battle_state(); + display_message_queue(); + battle_stage = eBATTLE_TURN.EnemyEnd; + } + if ((battle_stage == eBATTLE_TURN.Start) || (battle_stage == eBATTLE_TURN.EnemyEnd)) { + turn_count += 1; + if (enemy != 6) { + if (instance_exists(obj_enunit)) { + obj_enunit.alarm[1] = 1; + } + set_up_player_blocks_turn(); + } else if (enemy == 6) { + if (instance_exists(obj_enunit)) { + obj_enunit.alarm[1] = 2; + move_enemy_blocks(); + obj_enunit.alarm[0] = 3; + } + if (instance_exists(obj_pnunit)) { + wait_and_execute(1, scr_player_combat_weapon_stacks); + turn_count++; + } + } + queue_enemy_force_health(); + display_message_queue(); + messages_shown = 0; + battle_stage = eBATTLE_TURN.PlayerStart; + } else if (battle_stage == eBATTLE_TURN.PlayerEnd) { + if (enemy != 6) { + if (instance_exists(obj_pnunit)) { + with (obj_pnunit) { + wait_and_execute(1, scr_player_combat_weapon_stacks); + } + turn_count++; + } + if (instance_exists(obj_enunit)) { + obj_enunit.alarm[1] = 2; + move_enemy_blocks(); + obj_enunit.alarm[0] = 3; + obj_enunit.alarm[8] = 4; + turn_count += 1; + } + } + if (enemy == 6) { + set_up_player_blocks_turn(); + turn_count += 1; + if (instance_exists(obj_enunit)) { + obj_enunit.alarm[1] = 1; + } + // alarm[9]=5; + } + queue_player_force_health(); + display_message_queue(); + messages_shown = 0; + battle_stage = eBATTLE_TURN.EnemyStart; + } + if (started >= eBATTLE_STAGE.PlayerWinStart) { + instance_activate_object(obj_pnunit); + } + if (started == eBATTLE_STAGE.PlayerWinEnd) { + instance_activate_all(); + instance_activate_object(obj_pnunit); + instance_activate_object(obj_enunit); + instance_destroy(obj_popup); + instance_destroy(obj_star_select); + if (instance_exists(obj_pnunit)) { + obj_pnunit.alarm[6] = 1; + } -// if (player_forces>0) and (enemy_forces>0) and (battle_over=0){ - if (timer_stage=2) then fugg+=1; - if (timer_stage=2) and (fugg>60){ - timer_stage=3;// if (!instance_exists(obj_pnunit)) or (!instance_exists(obj_enunit)){alarm[5]=1;started=4;defeat_message=1;} + alarm[7] = 2; } - - if (timer_stage!=2) then fugg=0; - if (timer_stage=4) then fugg2+=1; - if (timer_stage=4) and (fugg2>60){ - timer_stage=5;// if (!instance_exists(obj_pnunit)) or (!instance_exists(obj_enunit)){alarm[5]=1;started=4;defeat_message=1;} + + if ((started == eBATTLE_STAGE.PlayerWinStart) || (started == eBATTLE_STAGE.EnemyWinStart)) { + instance_activate_object(obj_pnunit); + instance_activate_object(obj_enunit); + started = eBATTLE_STAGE.PlayerWinEnd; + var _quad_factor = 10; + total_battle_exp_gain = _quad_factor * sqr(threat); + if (instance_exists(obj_enunit)) { + obj_enunit.alarm[1] = 1; + } + instance_activate_object(obj_star); + instance_activate_object(obj_event_log); + alarm[5] = 6; + + newline = "------------------------------------------------------------------------------"; + scr_newtext(); + newline = "------------------------------------------------------------------------------"; + scr_newtext(); } - - if (timer_stage!=4) then fugg2=0; - - - +} +function resolve_battle_state() { + if (enemy_forces <= 0 || !instance_exists(obj_enunit)) { + battle_ended = true; + started = eBATTLE_STAGE.PlayerWinStart; + instance_activate_object(obj_pnunit); + battle_stage = eBATTLE_TURN.EnemyStart; + } else if (player_forces <= 0 || !instance_exists(obj_pnunit)) { + battle_ended = true; + started = eBATTLE_STAGE.EnemyWinStart; + defeat = 1; + instance_activate_object(obj_pnunit); + battle_stage = eBATTLE_TURN.EnemyEnd; + } +} diff --git a/objects/obj_ncombat/obj_ncombat.yy b/objects/obj_ncombat/obj_ncombat.yy index b2326e3fee..a90600f347 100644 --- a/objects/obj_ncombat/obj_ncombat.yy +++ b/objects/obj_ncombat/obj_ncombat.yy @@ -3,12 +3,8 @@ "%Name":"obj_ncombat", "eventList":[ {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":8,"eventType":2,"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",}, - {"$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",}, diff --git a/objects/obj_pnunit/Alarm_3.gml b/objects/obj_pnunit/Alarm_3.gml index b6d4b00008..9fe9ed0a64 100644 --- a/objects/obj_pnunit/Alarm_3.gml +++ b/objects/obj_pnunit/Alarm_3.gml @@ -1,6 +1,6 @@ try { - if (obj_ncombat.started=0){ + if (obj_ncombat.started=eBATTLE_STAGE.Creation){ if (men+dreads+veh<=0){ //show_debug_message($"column destroyed {x}") instance_destroy(); @@ -70,7 +70,6 @@ try { if (r_lost>0){ obj_ncombat.newline=miss; obj_ncombat.newline_color="red"; - obj_ncombat.timer_pause=2; with(obj_ncombat){ scr_newtext(); } @@ -80,7 +79,7 @@ try { - if (obj_ncombat.started>=1){ + if (obj_ncombat.started>=eBATTLE_STAGE.Start){ // Should probably have the option under deployment to say 'Should Assault Marines enter the fray with vehicles?' [ ] } diff --git a/objects/obj_pnunit/Create_0.gml b/objects/obj_pnunit/Create_0.gml index 1de3fd8e15..e8650994b4 100644 --- a/objects/obj_pnunit/Create_0.gml +++ b/objects/obj_pnunit/Create_0.gml @@ -95,8 +95,7 @@ dudes_vehicle = array_create(_dudes_size, 0); // These arrays are the losses on any one frame. // Let them resize as required. // Hardcoded lengths lead to bounds issues when hardcoded values disagree. -lost = []; -lost_num = []; +lost_units = {}; hostile_shots=0; hostile_shooters=0; @@ -109,5 +108,5 @@ hostile_splash=0; alarm[1]=4; hit = function() { - return scr_hit(x1, y1, x2, y2) && obj_ncombat.fadein <= 0; + return scr_hit(x1, y1, x2, y2) && obj_ncombat.fading_strength == 0; }; diff --git a/objects/obj_pnunit/Step_0.gml b/objects/obj_pnunit/Step_0.gml index e7e5f44c3a..bac670c5e8 100644 --- a/objects/obj_pnunit/Step_0.gml +++ b/objects/obj_pnunit/Step_0.gml @@ -1,9 +1,7 @@ // These arrays are the losses on any one frame. // Instead of resetting in a bunch of places, we reset here. -array_resize(lost, 0); -array_resize(lost_num, 0); - +lost_units = {}; update_block_size(); update_block_unit_count(); diff --git a/scripts/scr_clean/scr_clean.gml b/scripts/scr_clean/scr_clean.gml index bb398c4b06..3e69eb12ad 100644 --- a/scripts/scr_clean/scr_clean.gml +++ b/scripts/scr_clean/scr_clean.gml @@ -133,12 +133,10 @@ function scr_clean(target_object, weapon_data) { obj_ncombat.player_forces -= 1; // Record loss - var existing_index = array_get_index(lost, veh_type[vehicle_id]); - if (existing_index != -1) { - lost_num[existing_index] += 1; + if (struct_exists(lost_units, veh_type[vehicle_id])) { + lost_units[$ veh_type[vehicle_id]]++; } else { - array_push(lost, veh_type[vehicle_id]); - array_push(lost_num, 1); + lost_units[$ veh_type[vehicle_id]] = 1; } // Remove dead vehicles from further hits @@ -311,12 +309,10 @@ function check_dead_marines(unit_struct, unit_index) { obj_ncombat.player_forces -= 1; // Record loss - var existing_index = array_get_index(lost, marine_type[unit_index]); - if (existing_index != -1) { - lost_num[existing_index] += 1; + if (struct_exists(lost_units, marine_type[unit_index])) { + lost_units[$ marine_type[unit_index]]++; } else { - array_push(lost, marine_type[unit_index]); - array_push(lost_num, 1); + lost_units[$ marine_type[unit_index]] = 1; } // Check red thirst threadhold diff --git a/scripts/scr_colors_initialize/scr_colors_initialize.gml b/scripts/scr_colors_initialize/scr_colors_initialize.gml index b357bb9a07..32dc83a3b4 100644 --- a/scripts/scr_colors_initialize/scr_colors_initialize.gml +++ b/scripts/scr_colors_initialize/scr_colors_initialize.gml @@ -1,3 +1,11 @@ +#macro COL_YELLOW #e6b319 +#macro COL_GREEN #50a076 +#macro COL_RED #bf4040 +#macro COL_PURPLE #c3229b +#macro COL_BRIGHT_GREEN #30c075 +#macro COL_WHITE #e6e6e6 +#macro COL_BLUE #196be6 + enum Colors { White, Silver, diff --git a/scripts/scr_en_weapon/scr_en_weapon.gml b/scripts/scr_en_weapon/scr_en_weapon.gml index c863e4e4fc..657e4dbecf 100644 --- a/scripts/scr_en_weapon/scr_en_weapon.gml +++ b/scripts/scr_en_weapon/scr_en_weapon.gml @@ -1084,7 +1084,7 @@ function scr_en_weapon(_weapon_name, is_man, man_number, man_type, group) { _weapon_stack.shot_count = _shot_count; array_push(_weapon_stack.owners, man_type); - if (obj_ncombat.started == 0) { + if (obj_ncombat.started == eBATTLE_STAGE.Creation) { _weapon_stack.ammo_max = _ammo; _weapon_stack.ammo_current = _ammo; _weapon_stack.ammo_reload = _reload; diff --git a/scripts/scr_flavor/scr_flavor.gml b/scripts/scr_flavor/scr_flavor.gml index a2e7e90926..382745efd8 100644 --- a/scripts/scr_flavor/scr_flavor.gml +++ b/scripts/scr_flavor/scr_flavor.gml @@ -1,25 +1,55 @@ -/// @function add_battle_log_message +#macro BATTLELOG_MAX_PER_TURN 24 + +function queue_enemy_force_health() { + var _text = ""; + + if (enemy_forces > 0) { + _text = $"Enemy Forces at {string(max(1, round((enemy_forces / enemy_max) * 100)))}%"; + } else { + _text = "Enemy Forces Defeated"; + } + + queue_battlelog_message(_text, 999, "yellow"); +} + +function queue_player_force_health() { + var _text = ""; + + if (player_forces > 0) { + _text = $"${global.chapter_name} at {string(round((player_forces / player_max) * 100))}%"; + } else { + _text = $"${global.chapter_name} Defeated"; + } + + queue_battlelog_message(_text, 999, "yellow"); +} + + +function display_message_queue() { + while (!ds_priority_empty(messages_queue) && messages_shown < BATTLELOG_MAX_PER_TURN) { + var _message = ds_priority_delete_max(messages_queue); + newline = _message.message; + newline_color = _message.color; + messages_shown += 1; + scr_newtext(); + } + ds_priority_clear(messages_queue); +} + +/// @function queue_battlelog_message /// @param {string} _message - The message text to add to the battle log /// @param {real} [_message_size=0] - The size/importance of the message (higher values = higher display priority; affects sorting order) /// @param {real} [_message_priority=0] - The priority level (affects sorting and text color: 0=normal, 135=blue, 134=purple) /// @returns {real} The index of the newly added message -function add_battle_log_message(_message, _message_size = 0, _message_priority = 0) { +function queue_battlelog_message(_message, _message_priority = 0, _message_color = COL_GREEN) { if (instance_exists(obj_ncombat)) { - obj_ncombat.messages++; - var _message_index = obj_ncombat.messages; - - obj_ncombat.message[_message_index] = _message; - obj_ncombat.message_sz[_message_index] = _message_size + (0.5 - (obj_ncombat.messages / 100)); - obj_ncombat.message_priority[_message_index] = _message_priority; - - return _message_index; - } - return -1; -} + var _message_struct = { + message: _message, + color: _message_color + } -function display_battle_log_message() { - // Trigger the message processing alarm - obj_ncombat.alarm[3] = 5; + ds_priority_add(obj_ncombat.messages_queue, _message_struct, _message_priority) + } } /// @mixin @@ -422,13 +452,10 @@ function scr_flavor(_weapon_stack, _target_object, _target_i, casulties) { } if (attack_message != "") { - add_battle_log_message(attack_message, message_size, message_priority); - display_battle_log_message(); + queue_battlelog_message(attack_message, message_size); } if (leader_message != "") { - add_battle_log_message(leader_message, message_size, message_priority); - display_battle_log_message(); + queue_battlelog_message(leader_message, message_size); } - -} \ No newline at end of file +} diff --git a/scripts/scr_flavor2/scr_flavor2.gml b/scripts/scr_flavor2/scr_flavor2.gml index 47e629a49d..2e0fd47bb5 100644 --- a/scripts/scr_flavor2/scr_flavor2.gml +++ b/scripts/scr_flavor2/scr_flavor2.gml @@ -3,10 +3,11 @@ function scr_flavor2(lost_units_count, target_type, hostile_range, hostile_weapo if (obj_ncombat.wall_destroyed = 1) then exit; - var m1, m2, mes; - mes = "INVALID! lost_units_count:{lost_units_count} target_type:{target_type} hostile_range:{hostile_range} hostile_weapon:{hostile_weapon} hostile_shots:{hostile_shots}"; - m1 = ""; - m2 = ""; + var _attack_text, _loss_text, _message; + _message = $"INVALID! lost_units_count:{lost_units_count} target_type:{target_type} hostile_range:{hostile_range} hostile_weapon:{hostile_weapon} hostile_shots:{hostile_shots}"; + _attack_text = ""; + _loss_text = ""; + var _message_color = COL_GREEN; var _hostile_weapon, _hostile_shots; _hostile_weapon = ""; @@ -31,168 +32,168 @@ function scr_flavor2(lost_units_count, target_type, hostile_range, hostile_weapo if (_hostile_weapon = "Daemonette Melee") { flavor = 1; - if (_hostile_shots > 1) then m1 = string(_hostile_shots) + " Daemonettes rake and claw at " + string(target_type) + ". "; - if (_hostile_shots = 1) then m1 = "A Daemonette rakes and claws at " + string(target_type) + ". "; + if (_hostile_shots > 1) then _attack_text = string(_hostile_shots) + " Daemonettes rake and claw at " + string(target_type) + ". "; + if (_hostile_shots = 1) then _attack_text = "A Daemonette rakes and claws at " + string(target_type) + ". "; } if (_hostile_weapon = "Plaguebearer Melee") { flavor = 1; - if (_hostile_shots > 1) then m1 = string(_hostile_shots) + " Plague Swords slash into " + string(target_type) + ". "; - if (_hostile_shots = 1) then m1 = "A Plaguesword is swung into " + string(target_type) + ". "; + if (_hostile_shots > 1) then _attack_text = string(_hostile_shots) + " Plague Swords slash into " + string(target_type) + ". "; + if (_hostile_shots = 1) then _attack_text = "A Plaguesword is swung into " + string(target_type) + ". "; } if (_hostile_weapon = "Bloodletter Melee") { flavor = 1; - if (_hostile_shots > 1) then m1 = string(_hostile_shots) + " Hellblades hiss and slash into " + string(target_type) + ". "; - if (_hostile_shots = 1) then m1 = "A Bloodletter swings a Hellblade into " + string(target_type) + ". "; + if (_hostile_shots > 1) then _attack_text = string(_hostile_shots) + " Hellblades hiss and slash into " + string(target_type) + ". "; + if (_hostile_shots = 1) then _attack_text = "A Bloodletter swings a Hellblade into " + string(target_type) + ". "; } if (_hostile_weapon = "Nurgle Vomit") { flavor = 1; - if (_hostile_shots > 1) then m1 = string(_hostile_shots) + " putrid, corrosive streams of Daemonic vomit spew into " + string(target_type) + ". "; - if (_hostile_shots = 1) then m1 = "A putrid, corrosive stream of Daemonic vomit spews into " + string(target_type) + ". "; + if (_hostile_shots > 1) then _attack_text = string(_hostile_shots) + " putrid, corrosive streams of Daemonic vomit spew into " + string(target_type) + ". "; + if (_hostile_shots = 1) then _attack_text = "A putrid, corrosive stream of Daemonic vomit spews into " + string(target_type) + ". "; } if (_hostile_weapon = "Maulerfiend Claws") { flavor = 1; - if (_hostile_shots > 1) then m1 = string(_hostile_shots) + " Maulerfiends advance, wrenching and smashing their claws into " + string(target_type) + ". "; - if (_hostile_shots = 1) then m1 = "A Maulerfiend advances, wrenching and smashing its claws into " + string(target_type) + ". "; + if (_hostile_shots > 1) then _attack_text = string(_hostile_shots) + " Maulerfiends advance, wrenching and smashing their claws into " + string(target_type) + ". "; + if (_hostile_shots = 1) then _attack_text = "A Maulerfiend advances, wrenching and smashing its claws into " + string(target_type) + ". "; } if (hostile_range == "ranged") { if (_hostile_weapon = "Big Shoota") { - m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "z roar and blast away at " + string(target_type) + ". "; + _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "z roar and blast away at " + string(target_type) + ". "; flavor = 1; } if (_hostile_weapon = "Dakkagun") { - m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "z scream and rattle, blasting into " + string(target_type) + ". "; + _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "z scream and rattle, blasting into " + string(target_type) + ". "; flavor = 1; } if (_hostile_weapon = "Deffgun") { - m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "z scream and rattle, blasting into " + string(target_type) + ". "; + _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "z scream and rattle, blasting into " + string(target_type) + ". "; flavor = 1; } if (_hostile_weapon = "Snazzgun") { - m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "z scream and rattle, blasting into " + string(target_type) + ". "; + _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "z scream and rattle, blasting into " + string(target_type) + ". "; flavor = 1; } if (_hostile_weapon = "Grot Blasta") { - m1 = "The Gretchin fire their shoddy weapons and club at your " + string(target_type) + ". "; + _attack_text = "The Gretchin fire their shoddy weapons and club at your " + string(target_type) + ". "; flavor = 1; } if (_hostile_weapon = "Kannon") { flavor = 1; - if (_hostile_shots > 1) then m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "z belch out large caliber shells at " + string(target_type) + ". "; - if (_hostile_shots = 1) then m1 = "A " + string(_hostile_weapon) + "z belches out a large caliber shell at " + string(target_type) + ". "; + if (_hostile_shots > 1) then _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "z belch out large caliber shells at " + string(target_type) + ". "; + if (_hostile_shots = 1) then _attack_text = "A " + string(_hostile_weapon) + "z belches out a large caliber shell at " + string(target_type) + ". "; } if (_hostile_weapon = "Shoota") { flavor = 1; var ranz; ranz = choose(1, 2, 3, 4); - if (ranz = 1) then m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "z fire away at " + string(target_type) + ". "; - if (ranz = 2) then m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "z spit lead at " + string(target_type) + ". "; - if (ranz = 3) then m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "z blast at " + string(target_type) + ". "; - if (ranz = 4) then m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "z roar and fire at " + string(target_type) + ". "; + if (ranz = 1) then _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "z fire away at " + string(target_type) + ". "; + if (ranz = 2) then _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "z spit lead at " + string(target_type) + ". "; + if (ranz = 3) then _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "z blast at " + string(target_type) + ". "; + if (ranz = 4) then _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "z roar and fire at " + string(target_type) + ". "; } if (_hostile_weapon = "Burna") { - m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "z spray napalm into " + string(target_type) + ". "; + _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "z spray napalm into " + string(target_type) + ". "; flavor = 1; } if (_hostile_weapon = "Skorcha") { - m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "z spray huge gouts of napalm into " + string(target_type) + ". "; + _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "z spray huge gouts of napalm into " + string(target_type) + ". "; flavor = 1; } if (_hostile_weapon = "Rokkit Launcha") { flavor = 1; var ranz; ranz = choose(1, 2, 2, 3, 3); - if (ranz = 1) then m1 = string(_hostile_shots) + " rokkitz shoot at " + string(target_type) + ", the explosions disrupting. "; - if (ranz = 2) then m1 = string(_hostile_shots) + " rokkitz scream upward and then fall upon " + string(target_type) + ". "; - if (ranz = 3) then m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "z roar and fire their payloads at " + string(target_type) + ". "; + if (ranz = 1) then _attack_text = string(_hostile_shots) + " rokkitz shoot at " + string(target_type) + ", the explosions disrupting. "; + if (ranz = 2) then _attack_text = string(_hostile_shots) + " rokkitz scream upward and then fall upon " + string(target_type) + ". "; + if (ranz = 3) then _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "z roar and fire their payloads at " + string(target_type) + ". "; } if (_hostile_weapon = "Staff of Light Shooting") and(_hostile_shots = 1) { - m1 = "A Staff of Light crackles with energy and fires upon " + string(target_type) + ". "; + _attack_text = "A Staff of Light crackles with energy and fires upon " + string(target_type) + ". "; flavor = 1; } if (_hostile_weapon = "Staff of Light Shooting") and(_hostile_shots > 1) { - m1 = string(_hostile_shots) + " Staves of Light crackle with energy and fire upon " + string(target_type) + ". "; + _attack_text = string(_hostile_shots) + " Staves of Light crackle with energy and fire upon " + string(target_type) + ". "; flavor = 1; } if (_hostile_weapon = "Gauss Flayer") or(_hostile_weapon = "Gauss Blaster") or(_hostile_weapon = "Gauss Flayer Array") { flavor = 1; var ranz; ranz = choose(1, 2, 3, 4); - if (ranz = 1) then m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "s shoot at " + string(target_type) + ". "; - if (ranz = 2) then m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "s crackle and fire at " + string(target_type) + ". "; - if (ranz = 3) then m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "s discharge upon " + string(target_type) + ". "; - if (ranz = 4) then m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "s spew green energy at " + string(target_type) + ". "; + if (ranz = 1) then _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "s shoot at " + string(target_type) + ". "; + if (ranz = 2) then _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "s crackle and fire at " + string(target_type) + ". "; + if (ranz = 3) then _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "s discharge upon " + string(target_type) + ". "; + if (ranz = 4) then _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "s spew green energy at " + string(target_type) + ". "; } if (_hostile_weapon = "Gauss Cannon") or(_hostile_weapon = "Overcharged Gauss Cannon") or(_hostile_weapon = "Gauss Flux Arc") { flavor = 1; var ranz; ranz = choose(1, 2, 3); - if (ranz = 1) then m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "s charge and then blast at " + string(target_type) + ". "; - if (ranz = 2) then m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "s crackle with a sick amount of energy before firing at " + string(target_type) + ". "; - if (ranz = 3) then m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "s pulse with energy and then discharge upon " + string(target_type) + ". "; + if (ranz = 1) then _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "s charge and then blast at " + string(target_type) + ". "; + if (ranz = 2) then _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "s crackle with a sick amount of energy before firing at " + string(target_type) + ". "; + if (ranz = 3) then _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "s pulse with energy and then discharge upon " + string(target_type) + ". "; } if (_hostile_weapon = "Gauss Particle Cannon") { flavor = 1; - m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "s shine a sick green, pulsing with energy, and then blast solid beams of energy into " + string(target_type) + ". "; + _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "s shine a sick green, pulsing with energy, and then blast solid beams of energy into " + string(target_type) + ". "; } if (_hostile_weapon = "Particle Whip") { flavor = 1; - if (_hostile_shots = 1) then m1 = "The apex of the Monolith pulses with energy. An instant layer it fires, the solid beam of energy crashing into " + string(target_type) + ". "; - if (_hostile_shots > 1) then m1 = "The apex of " + string(_hostile_shots) + " Monoliths pulse with energy. An instant later they fire, the solid beams of energy crashing into " + string(target_type) + ". "; + if (_hostile_shots = 1) then _attack_text = "The apex of the Monolith pulses with energy. An instant layer it fires, the solid beam of energy crashing into " + string(target_type) + ". "; + if (_hostile_shots > 1) then _attack_text = "The apex of " + string(_hostile_shots) + " Monoliths pulse with energy. An instant later they fire, the solid beams of energy crashing into " + string(target_type) + ". "; } if (_hostile_weapon = "Doomsday Cannon") { flavor = 1; - if (_hostile_shots = 1) then m1 = "A Doomsday Arc crackles with energy and then fires. The resulting blast is blinding in intensity, the ground shaking before its might. "; - if (_hostile_shots > 1) then m1 = string(_hostile_shots) + " Doomsday Arcs crackle with energy and then fire. The resulting blasts are blinding in intensity, the ground shaking. "; + if (_hostile_shots = 1) then _attack_text = "A Doomsday Arc crackles with energy and then fires. The resulting blast is blinding in intensity, the ground shaking before its might. "; + if (_hostile_shots > 1) then _attack_text = string(_hostile_shots) + " Doomsday Arcs crackle with energy and then fire. The resulting blasts are blinding in intensity, the ground shaking. "; } if (_hostile_weapon = "Eldritch Fire") { flavor = 1; - if (_hostile_shots = 1) then m1 = "A Pink Horror spits out a globlet of bright energy. The bolt smashes into " + string(target_type) + ". "; - if (_hostile_shots > 1) then m1 = string(_hostile_shots) + " Pink Horrors spit and throw bolts of warp energy into " + string(target_type) + ". "; + if (_hostile_shots = 1) then _attack_text = "A Pink Horror spits out a globlet of bright energy. The bolt smashes into " + string(target_type) + ". "; + if (_hostile_shots > 1) then _attack_text = string(_hostile_shots) + " Pink Horrors spit and throw bolts of warp energy into " + string(target_type) + ". "; } } if (_hostile_shots > 0) { if (_hostile_weapon = "Choppa") { - m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "z cleave into " + string(target_type) + ". "; + _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "z cleave into " + string(target_type) + ". "; flavor = 1; } if (_hostile_weapon = "Power Klaw") { - m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "z rip and tear at " + string(target_type) + ". "; + _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "z rip and tear at " + string(target_type) + ". "; flavor = 1; } if (_hostile_weapon = "Venom Claws") { - if (_hostile_shots > 1) then m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + " rake at " + string(target_type) + ". "; + if (_hostile_shots > 1) then _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + " rake at " + string(target_type) + ". "; flavor = 1; - if (_hostile_shots = 1) then m1 = "The Spyrer rakes at " + string(target_type) + " with his " + string(_hostile_weapon) + ". "; + if (_hostile_shots = 1) then _attack_text = "The Spyrer rakes at " + string(target_type) + " with his " + string(_hostile_weapon) + ". "; flavor = 1; } if (_hostile_weapon = "Slugga") { flavor = 1; var ranz; ranz = choose(1, 2, 3, 4); - if (ranz = 1) then m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "z fire away at " + string(target_type) + ". "; - if (ranz = 2) then m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "z spit lead at " + string(target_type) + ". "; - if (ranz = 3) then m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "z blast at " + string(target_type) + ". "; - if (ranz = 4) then m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "z roar and fire at " + string(target_type) + ". "; + if (ranz = 1) then _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "z fire away at " + string(target_type) + ". "; + if (ranz = 2) then _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "z spit lead at " + string(target_type) + ". "; + if (ranz = 3) then _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "z blast at " + string(target_type) + ". "; + if (ranz = 4) then _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "z roar and fire at " + string(target_type) + ". "; } if (_hostile_weapon = "Tankbusta Bomb") { flavor = 1; var ranz; ranz = choose(1, 2, 3); - if (ranz = 1) then m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "z are attached to " + string(target_type) + ". "; - if (ranz = 2) then m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "z are clamped onto " + string(target_type) + ". "; - if (ranz = 3) then m1 = string(_hostile_shots) + " " + string(_hostile_weapon) + "z are flung into " + string(target_type) + ". "; + if (ranz = 1) then _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "z are attached to " + string(target_type) + ". "; + if (ranz = 2) then _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "z are clamped onto " + string(target_type) + ". "; + if (ranz = 3) then _attack_text = string(_hostile_shots) + " " + string(_hostile_weapon) + "z are flung into " + string(target_type) + ". "; } if (_hostile_weapon = "Melee1") and(enemy = 7) { flavor = 1; var ranz; ranz = choose(1, 2, 3); - if (ranz = 1) then m1 = string(_hostile_shots) + " Orks club and smash at " + string(target_type) + ". "; - if (ranz = 2) then m1 = string(_hostile_shots) + " Orks shoot their Slugas and smash gunbarrels into " + string(target_type) + ". "; - if (ranz = 3) then m1 = string(_hostile_shots) + " Orks claw and punch at " + string(target_type) + ". "; + if (ranz = 1) then _attack_text = string(_hostile_shots) + " Orks club and smash at " + string(target_type) + ". "; + if (ranz = 2) then _attack_text = string(_hostile_shots) + " Orks shoot their Slugas and smash gunbarrels into " + string(target_type) + ". "; + if (ranz = 3) then _attack_text = string(_hostile_shots) + " Orks claw and punch at " + string(target_type) + ". "; } if (_hostile_weapon = "Staff of Light") { @@ -200,41 +201,41 @@ function scr_flavor2(lost_units_count, target_type, hostile_range, hostile_weapo if (_hostile_shots = 1) { var ranz; ranz = choose(1, 2, 3); - if (ranz = 1) then m1 = "A " + string(_hostile_weapon) + " crackles and is swung into " + string(target_type) + ". "; - if (ranz = 2) then m1 = "A " + string(_hostile_weapon) + " pulses and smashes through " + string(target_type) + ". "; - if (ranz = 3) then m1 = "A " + string(_hostile_weapon) + " crackles and smashes into " + string(target_type) + ". "; + if (ranz = 1) then _attack_text = "A " + string(_hostile_weapon) + " crackles and is swung into " + string(target_type) + ". "; + if (ranz = 2) then _attack_text = "A " + string(_hostile_weapon) + " pulses and smashes through " + string(target_type) + ". "; + if (ranz = 3) then _attack_text = "A " + string(_hostile_weapon) + " crackles and smashes into " + string(target_type) + ". "; } if (_hostile_shots > 1) { var ranz; ranz = choose(1, 2, 3); - if (ranz = 1) then m1 = string(_hostile_shots) + " Staves of Light strike at " + string(target_type) + ". "; - if (ranz = 2) then m1 = string(_hostile_shots) + " Staves of Light smash at " + string(target_type) + ". "; - if (ranz = 3) then m1 = string(_hostile_shots) + " Staves of Light swing into " + string(target_type) + ". "; + if (ranz = 1) then _attack_text = string(_hostile_shots) + " Staves of Light strike at " + string(target_type) + ". "; + if (ranz = 2) then _attack_text = string(_hostile_shots) + " Staves of Light smash at " + string(target_type) + ". "; + if (ranz = 3) then _attack_text = string(_hostile_shots) + " Staves of Light swing into " + string(target_type) + ". "; } } if (_hostile_weapon = "Warscythe") { flavor = 1; var ranz; ranz = choose(1, 2, 3); - if (ranz = 1) then m1 = string(_hostile_shots) + " Warscythes strike at " + string(target_type) + ". "; - if (ranz = 2) then m1 = string(_hostile_shots) + " Warscythes of Light slice into " + string(target_type) + ". "; - if (ranz = 3) then m1 = string(_hostile_shots) + " Warscythes of Light hew " + string(target_type) + ". "; + if (ranz = 1) then _attack_text = string(_hostile_shots) + " Warscythes strike at " + string(target_type) + ". "; + if (ranz = 2) then _attack_text = string(_hostile_shots) + " Warscythes of Light slice into " + string(target_type) + ". "; + if (ranz = 3) then _attack_text = string(_hostile_shots) + " Warscythes of Light hew " + string(target_type) + ". "; } if (_hostile_weapon = "Claws") { flavor = 1; if (_hostile_shots = 1) { var ranz; ranz = choose(1, 2, 3); - if (ranz = 1) then m1 = "A massive claw slices through " + string(target_type) + ". "; - if (ranz = 2) then m1 = "A razor-sharp claw slashes into " + string(target_type) + ". "; - if (ranz = 3) then m1 = "A large necron claw strikes at " + string(target_type) + ". "; + if (ranz = 1) then _attack_text = "A massive claw slices through " + string(target_type) + ". "; + if (ranz = 2) then _attack_text = "A razor-sharp claw slashes into " + string(target_type) + ". "; + if (ranz = 3) then _attack_text = "A large necron claw strikes at " + string(target_type) + ". "; } if (_hostile_shots > 1) { var ranz; ranz = choose(1, 2, 3); - if (ranz = 1) then m1 = string(_hostile_shots) + " massive claws strike and slice at " + string(target_type) + ". "; - if (ranz = 2) then m1 = string(_hostile_shots) + " razor-sharp claws assault " + string(target_type) + ". "; - if (ranz = 3) then m1 = string(_hostile_shots) + " large necron claws strike at and shred " + string(target_type) + ". "; + if (ranz = 1) then _attack_text = string(_hostile_shots) + " massive claws strike and slice at " + string(target_type) + ". "; + if (ranz = 2) then _attack_text = string(_hostile_shots) + " razor-sharp claws assault " + string(target_type) + ". "; + if (ranz = 3) then _attack_text = string(_hostile_shots) + " large necron claws strike at and shred " + string(target_type) + ". "; } } } @@ -243,44 +244,39 @@ function scr_flavor2(lost_units_count, target_type, hostile_range, hostile_weapo flavor = true; if (_hostile_shots == 1) { if (lost_units_count == 0) { - m1 += $"{_hostile_weapon} strikes at {target_type}, but fails to inflict any damage."; + _attack_text += $"{_hostile_weapon} strikes at {target_type}, but fails to inflict any damage."; } else { - m1 += $"{_hostile_weapon} strikes at {target_type}. "; + _attack_text += $"{_hostile_weapon} strikes at {target_type}. "; } } else { if (lost_units_count == 0) { - m1 += $"{_hostile_shots} {_hostile_weapon}s strike at {target_type}, but fail to inflict any damage."; + _attack_text += $"{_hostile_shots} {_hostile_weapon}s strike at {target_type}, but fail to inflict any damage."; } else { - m1 += $"{_hostile_shots} {_hostile_weapon}s strike at {target_type}. "; + _attack_text += $"{_hostile_shots} {_hostile_weapon}s strike at {target_type}. "; } } } - // show_message(mes); + // show_message(_message); - // m2="Blah blah blah"; + // _loss_text="Blah blah blah"; if (target_type = "wall") { var _wall_destroyed = obj_nfort.hp[1] <= 0 ? true : false; if (_wall_destroyed) { - mes = m1 + " Destroying the fortifications."; + _message = _attack_text + " Destroying the fortifications."; } else { - mes = m1 + " Fortifications stand strong."; + _message = _attack_text + " Fortifications stand strong."; } - if (string_length(mes) > 3) { - obj_ncombat.messages += 1; - obj_ncombat.message[obj_ncombat.messages] = mes; - obj_ncombat.message_sz[obj_ncombat.messages] = 999; - obj_ncombat.message_priority[obj_ncombat.messages] = 0; - obj_ncombat.alarm[3] = 2; + if (string_length(_message) > 3) { + queue_battlelog_message(_message, 999, COL_RED); } if (obj_nfort.hp[1] <= 0) { s = 0; him = 0; - obj_ncombat.dead_jims += 1; - obj_ncombat.dead_jim[obj_ncombat.dead_jims] = "The fortified wall has been breached!"; + queue_battlelog_message("The fortified wall has been breached!", 999, COL_RED); obj_ncombat.wall_destroyed = 1; with(obj_nfort) { instance_destroy(); @@ -289,89 +285,34 @@ function scr_flavor2(lost_units_count, target_type, hostile_range, hostile_weapo exit; } - var marine_length = array_length(marine_type); - var s, him, special, unit, unit_role, units_lost, plural; - var lost_roles_count = array_length(lost); - for (var role_index = 0; role_index < lost_roles_count; role_index++) { - unit_role = lost[role_index]; - units_lost = lost_num[role_index]; - if (unit_role != "" && units_lost > 0) { - special = ( - is_specialist(unit_role, SPECIALISTS_HEADS) || - unit_role == "Chapter Master" || - unit_role == "Venerable " + string(obj_ini.role[100][6]) || - unit_role == obj_ini.role[100][5] || - obj_ncombat.player_max <= 6 - ); + var unit_role, units_lost; + var loss_list = " "; - if (!special) { - plural = units_lost > 1 ? "s" : ""; - m2 += $"{units_lost} {unit_role}{plural}, "; - } else { - him = -1; // Find which unit this is - for (var marine = 0; marine < marine_length; marine++) { - if (marine_type[marine] == unit_role && marine_hp[marine] <= 0) { - him = marine; - break; // found the unit - } - } + var _lost_roles = struct_get_names(lost_units); + for (var i = 0; i < array_length(_lost_roles); i++) { + unit_role = _lost_roles[i]; + units_lost = lost_units[$ unit_role]; - if (him != -1) { // found a valid unit - obj_ncombat.dead_jims += 1; - if (marine_type[him] == obj_ini.role[100][5]) { - obj_ncombat.dead_jim[obj_ncombat.dead_jims] = $"A {marine_type[him]} has been critically injured!"; - } else { - obj_ncombat.dead_jim[obj_ncombat.dead_jims] = $"{unit_struct[him].name_role()} has been critically injured!"; - } - } - } - } - } - - - var unce = 0; - - if (string_count(", ", m2) > 1) { - - // show_message(m2); - - var lis, y1, y2; - lis = string_rpos(", ", m2); - m2 = string_delete(m2, lis, 3); // This clears the last ', ' and replaces it with the end statement - if (lost_units_count > 0) then m2 += " critically damaged."; - - // show_message(m2); - - lis = string_rpos(", ", m2); // Find the new last ', ' and replace it with the and part - m2 = string_delete(m2, lis, 2); - - // show_message(m2); - - if (string_count(",", m2) > 1) then m2 = string_insert(", and ", m2, lis); - if (string_count(",", m2) = 0) then m2 = string_insert(" and ", m2, lis); - - // show_message(m2); - - unce = 1; + loss_list += string_plural_count(unit_role, units_lost); + if (i < array_length(_lost_roles) - 1) { + loss_list += ", "; + } } - if (string_count(", ", m2) = 1) and(unce = 0) and(hostile_weapon != "Web Spinner") { - var lis, y1, y2; - lis = string_rpos(", ", m2); - m2 = string_delete(m2, lis, 3); - if (lost_units_count > 0) then m2 += " critically damaged."; - } - if (string_count(", ", m2) = 1) and(unce = 0) and(hostile_weapon = "Web Spinner") { - var lis, y1, y2; - lis = string_rpos(", ", m2); - m2 = string_delete(m2, lis, 3); - if (lost_units_count > 1) then m2 += " have been incapacitated."; - if (lost_units_count = 1) then m2 += " has been incapacitated."; + if (loss_list != " ") { + if (hostile_weapon == "Web Spinner") { + loss_list += (lost_units_count == 1) ? " has been incapacitated." : " have been incapacitated."; + _message_color = COL_BRIGHT_GREEN; + } else { + loss_list += " critically damaged."; + _message_color = COL_RED; + } } - mes = m1 + m2; + _loss_text = loss_list; + _message = _attack_text + _loss_text; + var _message_priority = lost_units_count <= 0 ? hostile_shots / 100 : lost_units_count; - add_battle_log_message(mes, _message_priority); - display_battle_log_message(); -} \ No newline at end of file + queue_battlelog_message(_message, _message_priority, _message_color); +} diff --git a/scripts/scr_marine_struct/scr_marine_struct.gml b/scripts/scr_marine_struct/scr_marine_struct.gml index 90fd96464f..052469221d 100644 --- a/scripts/scr_marine_struct/scr_marine_struct.gml +++ b/scripts/scr_marine_struct/scr_marine_struct.gml @@ -2269,7 +2269,7 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} var _dice_roll = roll_personal_dice(1, _psionic_difficulty, "high", self); if (_dice_roll == _psionic_difficulty) { psionic++; - add_battle_log_message($"{name_role()} was touched by the warp!", 999, 135); + queue_battlelog_message($"{name_role()} was touched by the warp!", 999, 135); } } }; diff --git a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml index 2f32ed4471..1cd5e49bbc 100644 --- a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml +++ b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml @@ -54,7 +54,7 @@ function add_data_to_stack (weapon, unit_damage=0, head_role=false, unit="none") _weapon_stack.shot_count = weapon.spli; array_push(_weapon_stack.owners, _owner_name); - if (obj_ncombat.started == 0) { + if (obj_ncombat.started == eBATTLE_STAGE.Creation) { _weapon_stack.ammo_max = weapon.ammo; _weapon_stack.ammo_current = weapon.ammo; _weapon_stack.ammo_reload = weapon.reload; @@ -284,7 +284,7 @@ function scr_player_combat_weapon_stacks() { - if (dudes_num[1]=0) and (obj_ncombat.started=0){ + if (dudes_num[1]=0) and (obj_ncombat.started == eBATTLE_STAGE.Creation){ instance_destroy(); exit; } @@ -318,24 +318,6 @@ function set_up_player_blocks_turn(){ turn_count++; } -function reset_combat_message_arrays(){ - messages=0; - messages_to_show=8; - largest=0; - random_messages=0; - priority=0; - messages_shown=0; - for (var i=0;i 0) { + if (obj_ncombat.fading_strength > 0) { draw_set_color(c_black); - draw_set_alpha(obj_ncombat.fadein/30); + draw_set_alpha(obj_ncombat.fading_strength); draw_rectangle(822,239,1574,662,0); draw_set_alpha(1); } From b20eed35108f4a2c7149e30e8422fd37de5903e7 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Wed, 16 Apr 2025 13:40:59 +0300 Subject: [PATCH 64/80] Kill all ncombat alarms, move to scripts, YES --- ChapterMaster.yyp | 3 + objects/obj_enunit/Alarm_0.gml | 154 - objects/obj_enunit/Alarm_1.gml | 1750 ----- objects/obj_enunit/Alarm_8.gml | 1 - objects/obj_enunit/Create_0.gml | 8 +- objects/obj_enunit/obj_enunit.yy | 3 - objects/obj_ncombat/Alarm_0.gml | 3096 --------- objects/obj_ncombat/Alarm_1.gml | 540 -- objects/obj_ncombat/Alarm_2.gml | 97 - objects/obj_ncombat/Alarm_5.gml | 924 --- objects/obj_ncombat/Alarm_7.gml | 695 -- objects/obj_ncombat/Create_0.gml | 490 +- objects/obj_ncombat/Draw_0.gml | 6 +- objects/obj_ncombat/Step_0.gml | 179 +- objects/obj_ncombat/obj_ncombat.yy | 5 - objects/obj_pnunit/Alarm_0.gml | 125 - objects/obj_pnunit/Alarm_1.gml | 1 - objects/obj_pnunit/Alarm_3.gml | 119 - objects/obj_pnunit/Alarm_6.gml | 56 - objects/obj_pnunit/Alarm_8.gml | 1 - objects/obj_pnunit/Create_0.gml | 2 - objects/obj_pnunit/obj_pnunit.yy | 5 - scripts/scr_clean/scr_clean.gml | 11 +- scripts/scr_en_weapon/scr_en_weapon.gml | 2 +- .../scr_enunit_scripts/scr_enunit_scripts.gml | 1934 ++++++ .../scr_enunit_scripts/scr_enunit_scripts.yy | 13 + scripts/scr_flavor/scr_flavor.gml | 23 +- .../scr_ncombat_scripts.gml | 5985 +++++++++++++++++ .../scr_ncombat_scripts.yy | 13 + .../scr_player_combat_weapon_stacks.gml | 15 +- .../scr_pnunit_scripts/scr_pnunit_scripts.gml | 336 + .../scr_pnunit_scripts/scr_pnunit_scripts.yy | 13 + 32 files changed, 8657 insertions(+), 7948 deletions(-) delete mode 100644 objects/obj_enunit/Alarm_0.gml delete mode 100644 objects/obj_enunit/Alarm_1.gml delete mode 100644 objects/obj_enunit/Alarm_8.gml delete mode 100644 objects/obj_ncombat/Alarm_0.gml delete mode 100644 objects/obj_ncombat/Alarm_1.gml delete mode 100644 objects/obj_ncombat/Alarm_2.gml delete mode 100644 objects/obj_ncombat/Alarm_5.gml delete mode 100644 objects/obj_ncombat/Alarm_7.gml delete mode 100644 objects/obj_pnunit/Alarm_0.gml delete mode 100644 objects/obj_pnunit/Alarm_1.gml delete mode 100644 objects/obj_pnunit/Alarm_3.gml delete mode 100644 objects/obj_pnunit/Alarm_6.gml delete mode 100644 objects/obj_pnunit/Alarm_8.gml create mode 100644 scripts/scr_enunit_scripts/scr_enunit_scripts.gml create mode 100644 scripts/scr_enunit_scripts/scr_enunit_scripts.yy create mode 100644 scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml create mode 100644 scripts/scr_ncombat_scripts/scr_ncombat_scripts.yy create mode 100644 scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml create mode 100644 scripts/scr_pnunit_scripts/scr_pnunit_scripts.yy diff --git a/ChapterMaster.yyp b/ChapterMaster.yyp index 4e0305b3c3..bee3e5e121 100644 --- a/ChapterMaster.yyp +++ b/ChapterMaster.yyp @@ -728,6 +728,7 @@ {"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_enunit_scripts","path":"scripts/scr_enunit_scripts/scr_enunit_scripts.yy",},}, {"id":{"name":"scr_equipment_struct","path":"scripts/scr_equipment_struct/scr_equipment_struct.yy",},}, {"id":{"name":"scr_event_dudes","path":"scripts/scr_event_dudes/scr_event_dudes.yy",},}, {"id":{"name":"scr_event_gossip","path":"scripts/scr_event_gossip/scr_event_gossip.yy",},}, @@ -783,6 +784,7 @@ {"id":{"name":"scr_mission_reward","path":"scripts/scr_mission_reward/scr_mission_reward.yy",},}, {"id":{"name":"scr_move_unit_info","path":"scripts/scr_move_unit_info/scr_move_unit_info.yy",},}, {"id":{"name":"scr_music","path":"scripts/scr_music/scr_music.yy",},}, + {"id":{"name":"scr_ncombat_scripts","path":"scripts/scr_ncombat_scripts/scr_ncombat_scripts.yy",},}, {"id":{"name":"scr_necron_tombs","path":"scripts/scr_necron_tombs/scr_necron_tombs.yy",},}, {"id":{"name":"scr_newtext","path":"scripts/scr_newtext/scr_newtext.yy",},}, {"id":{"name":"scr_ork_fleet_functions","path":"scripts/scr_ork_fleet_functions/scr_ork_fleet_functions.yy",},}, @@ -796,6 +798,7 @@ {"id":{"name":"scr_player_fleet_combat_functions","path":"scripts/scr_player_fleet_combat_functions/scr_player_fleet_combat_functions.yy",},}, {"id":{"name":"scr_player_fleet_functions","path":"scripts/scr_player_fleet_functions/scr_player_fleet_functions.yy",},}, {"id":{"name":"scr_player_ship_functions","path":"scripts/scr_player_ship_functions/scr_player_ship_functions.yy",},}, + {"id":{"name":"scr_pnunit_scripts","path":"scripts/scr_pnunit_scripts/scr_pnunit_scripts.yy",},}, {"id":{"name":"scr_population_influence","path":"scripts/scr_population_influence/scr_population_influence.yy",},}, {"id":{"name":"scr_popup","path":"scripts/scr_popup/scr_popup.yy",},}, {"id":{"name":"scr_powers","path":"scripts/scr_powers/scr_powers.yy",},}, diff --git a/objects/obj_enunit/Alarm_0.gml b/objects/obj_enunit/Alarm_0.gml deleted file mode 100644 index c78c072f7c..0000000000 --- a/objects/obj_enunit/Alarm_0.gml +++ /dev/null @@ -1,154 +0,0 @@ -#macro DEBUG_COLUMN_PRIORITY_ENEMY false - -//* This alarm is responsible for the enemy target column selection; - -if (!instance_exists(obj_pnunit)) { - exit; -} - -var _block_direction = flank ? get_leftmost : get_rightmost; - -enemy = _block_direction(); -if (enemy == "none") { - exit; -} - -var _target_unit_index = 0; -var _alpha_strike = get_alpha_strike_target(); -if (_alpha_strike != -1) { - enemy = _alpha_strike[0]; - _target_unit_index = _alpha_strike[1]; -} - -//In melee check -engaged = collision_point(x - 10, y, obj_pnunit, 0, 1) || collision_point(x + 10, y, obj_pnunit, 0, 1); -// show_debug_message($"enemy is in melee {engaged}") - -if (!engaged) { - if (DEBUG_COLUMN_PRIORITY_ENEMY) { - var _t_start1 = get_timer(); - } - - // Shooting - var _ranged_weapons = array_concat(get_valid_weapon_stacks(weapon_stacks_normal, 2, 999), get_valid_weapon_stacks_unique(weapon_stacks_unique, 2, 999), get_valid_weapon_stacks(weapon_stacks_vehicle, 2, 999)); - for (var i = 0, _ranged_len = array_length(_ranged_weapons); i < _ranged_len; i++) { - var _weapon_stack = _ranged_weapons[i]; - - if (!target_block_is_valid(enemy, obj_pnunit)) { - log_error($"Invalid player block was found by a ranged enemy!"); - enemy = _block_direction(); - if (!target_block_is_valid(enemy, obj_pnunit)) { - log_error($"Two invalid player blocks were found by a ranged enemy! Exiting!"); - exit; - } - } - - var dist = get_block_distance(enemy); - if (_weapon_stack.range >= dist) { - if (DEBUG_COLUMN_PRIORITY_ENEMY) { - show_debug_message($"{_weapon_stack.weapon_name} IS SHOOTING!"); - } - - var _target_priority_queue = ds_priority_create(); - - if (DEBUG_COLUMN_PRIORITY_ENEMY) { - var _t_start = get_timer(); - } - - // Scan potential targets - var _targets = []; - with (obj_pnunit) { - if (target_block_is_valid(self, obj_pnunit)) { - array_push(_targets, self.id); - } - } - - for (var t = 0; t < array_length(_targets); t++) { - var _block = _targets[t]; - var _distance = get_block_distance(_block); - - if (_distance <= _weapon_stack.range) { - var _priority = get_target_priority(_weapon_stack, _block); - ds_priority_add(_target_priority_queue, _block, _priority); - } - } - - // Add fort as fallback target - var fort = instance_nearest(x, y, obj_nfort); - if (fort != noone && !flank) { - var d = get_block_distance(fort); - if (d <= _weapon_stack.range) { - ds_priority_add(_target_priority_queue, fort, 999); - } - } - - if (DEBUG_COLUMN_PRIORITY_ENEMY) { - var _t_end = get_timer(); - var _elapsed_ms = (_t_end - _t_start) / 1000; - show_debug_message($"⏱️ Execution Time: {_elapsed_ms}ms"); - } - - // Shoot highest-priority target - if (!ds_priority_empty(_target_priority_queue)) { - var _best_target = ds_priority_delete_max(_target_priority_queue); - - var _is_fort = _best_target.object_index == obj_nfort; - if (_is_fort) { - _target_unit_index = 1; - _weapon_stack.target_type = eTARGET_TYPE.FORTIFICATION; - } - - scr_shoot(_weapon_stack, _best_target, _target_unit_index); - } else { - log_error($"{_weapon_stack.weapon_name} didn't find a valid target! This shouldn't happen!"); - } - - ds_priority_destroy(_target_priority_queue); - } else { - if (DEBUG_COLUMN_PRIORITY_ENEMY) { - show_debug_message($"I can't shoot, my range is too small! Weapon: {_weapon_stack.weapon_name};"); - } - continue; - } - } - if (DEBUG_COLUMN_PRIORITY_ENEMY) { - var _t_end1 = get_timer(); - var _elapsed_ms1 = (_t_end1 - _t_start1) / 1000; - show_debug_message($"⏱️ Enemy Ranged Alarm Execution Time: {_elapsed_ms1}ms"); - } -} else { - if (DEBUG_COLUMN_PRIORITY_ENEMY) { - var _t_start1 = get_timer(); - } - - // Melee - var _melee_weapons = array_concat(get_valid_weapon_stacks(weapon_stacks_normal, 1, 2), get_valid_weapon_stacks_unique(weapon_stacks_unique, 1, 2), get_valid_weapon_stacks(weapon_stacks_vehicle, 1, 999)); - for (var i = 0, _wep_len = array_length(_melee_weapons); i < _wep_len; i++) { - var _weapon_stack = _melee_weapons[i]; - - if (!target_block_is_valid(enemy, obj_pnunit)) { - log_error($"Invalid player block was found by a melee enemy!"); - exit; - } - - if (DEBUG_COLUMN_PRIORITY_ENEMY) { - show_debug_message($"{_weapon_stack.weapon_name} IS IN MELEE!"); - } - - if (instance_exists(obj_nfort) && (!flank)) { - enemy = instance_nearest(x, y, obj_nfort); - _target_unit_index = 1; - _weapon_stack.target_type = eTARGET_TYPE.FORTIFICATION; - } - - scr_shoot(_weapon_stack, enemy, _target_unit_index); - } - - if (DEBUG_COLUMN_PRIORITY_ENEMY) { - var _t_end1 = get_timer(); - var _elapsed_ms1 = (_t_end1 - _t_start1) / 1000; - show_debug_message($"⏱️ Enemy Melee Alarm Execution Time: {_elapsed_ms1}ms"); - } -} - -//! Here was some stuff that depended on image_index here, that got deleted, because I couldn't figure out why it exists; diff --git a/objects/obj_enunit/Alarm_1.gml b/objects/obj_enunit/Alarm_1.gml deleted file mode 100644 index 0f48fa8b50..0000000000 --- a/objects/obj_enunit/Alarm_1.gml +++ /dev/null @@ -1,1750 +0,0 @@ -var i, g; -i = 0; -g = 0; -men = 0; -veh = 0; -medi = 0; - -weapon_stacks_normal = {}; -weapon_stacks_vehicle = {}; -weapon_stacks_unique = {}; - -i = 0; -// men=0;veh=0; - -j = 0; -good = 0; -open = 0; - -repeat(700) { - j += 1; - if (dudes_num[j] <= 0) { - dudes[j] = ""; - dudes_special[j] = ""; - dudes_num[j] = 0; - dudes_ac[j] = 0; - dudes_hp[j] = 0; - dudes_vehicle[j] = 0; - dudes_damage[j] = 0; - dudes_attack[j] = 1; - dudes_ranged[j] = 1; - } - if (dudes[j] = "") and(dudes[j + 1] != "") { - dudes[j] = dudes[j + 1] dudes_special[j] = dudes_special[j + 1]; - dudes_num[j] = dudes_num[j + 1]; - dudes_ac[j] = dudes_ac[j + 1]; - dudes_hp[j] = dudes_hp[j + 1]; - dudes_vehicle[j] = dudes_vehicle[j + 1]; - dudes_damage[j] = dudes_damage[j + 1]; - dudes_attack[j] = dudes_attack[j + 1]; - dudes_ranged[j] = dudes_ranged[j + 1]; - - dudes[j + 1] = ""; - dudes_special[j + 1] = ""; - dudes_num[j + 1] = 0; - dudes_ac[j + 1] = 0; - dudes_hp[j + 1] = 0; - dudes_vehicle[j + 1] = 0; - dudes_damage[j + 1] = 0; - dudes_ranged[j + 1] = 1; - dudges_defense[j + 1] = 1; - dudes_attack[j + 1] = 1; - } -} -j = 0; - - -repeat(20) { - j += 1; - if (obj_ncombat.started == eBATTLE_STAGE.Creation) { - if (dudes[j] = "Malcadon Spyrer") { - dudes_ac[j] = 35; - dudes_hp[j] = 200; - } - } - if (dudes[j] = "Malcadon Spyrer") { - men += dudes_num[j]; - scr_en_weapon("Web Spinner", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Venom Claws", true, dudes_num[j], dudes[j], j); - } - - if ((obj_ncombat.started == eBATTLE_STAGE.Creation) or(neww = 1)) or(dudes_num[j] > 1) { - if (dudes[j] = "Greater Daemon of Khorne") { - dudes_ac[j] = 12; - dudes_hp[j] = 700; - } - } - if (dudes[j] = "Greater Daemon of Khorne") { - scr_en_weapon("Khorne Demon Melee", true, dudes_num[j], dudes[j], j); - dudes_dr[j] = 0.5; - medi += dudes_num[j]; - if (obj_ncombat.battle_special = "ship_demon") then dudes_dr[j] = 0.65; - } - if ((obj_ncombat.started == eBATTLE_STAGE.Creation) or(neww = 1)) or(dudes_num[j] > 1) { - if (dudes[j] = "Greater Daemon of Slaanesh") { - dudes_ac[j] = 10; - dudes_hp[j] = 500; - dudes_dr[j] = 0.25; - } - } - if (dudes[j] = "Greater Daemon of Slaanesh") { - scr_en_weapon("Demon Melee", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Lash Whip", true, dudes_num[j], dudes[j], j); - dudes_dr[j] = 0.25; - medi += dudes_num[j]; - } - if ((obj_ncombat.started == eBATTLE_STAGE.Creation) or(neww = 1)) or(dudes_num[j] > 1) { - if (dudes[j] = "Greater Daemon of Nurgle") { - dudes_ac[j] = 8; - dudes_hp[j] = 900; - dudes_dr[j] = 0.2; - } - } - if (dudes[j] = "Greater Daemon of Nurgle") { - scr_en_weapon("Demon Melee", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Nurgle Vomit", true, dudes_num[j], dudes[j], j); - dudes_dr[j] = 0.6; - medi += dudes_num[j]; - } - if ((obj_ncombat.started == eBATTLE_STAGE.Creation) or(neww = 1)) or(dudes_num[j] > 1) { - if (dudes[j] = "Greater Daemon of Tzeentch") { - dudes_ac[j] = 10; - dudes_hp[j] = 600; - } - } - if (dudes[j] = "Greater Daemon of Tzeentch") { - scr_en_weapon("Demon Melee", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Witchfire", true, dudes_num[j], dudes[j], j); - dudes_dr[j] = 0.75; - medi += dudes_num[j]; - } - - if (dudes[j] = "Bloodletter") { - scr_en_weapon("Bloodletter Melee", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 200; - men += dudes_num[j]; - dudes_dr[j] = 0.4; - } - if (dudes[j] = "Daemonette") { - scr_en_weapon("Daemonette Melee", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 150; - men += dudes_num[j]; - dudes_dr[j] = 0.3; - } - if (dudes[j] = "Pink Horror") { - scr_en_weapon("Eldritch Fire", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 100; - men += dudes_num[j]; - dudes_dr[j] = 0.5; - } - if (dudes[j] = "Plaguebearer") { - scr_en_weapon("Plaguebearer Melee", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 5; - dudes_hp[j] = 300; - men += dudes_num[j]; - dudes_dr[j] = 0.4; - } - - if (dudes[j] = "Helbrute") { - scr_en_weapon("Power Fist", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Multi-Melta", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 300; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - dudes_dr[j] = 0.5; - } - if (dudes[j] = "Soul Grinder") { - scr_en_weapon("Warpsword", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Iron Claw", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Battle Cannon", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 350; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - dudes_dr[j] = 0.5; - } - if (dudes[j] = "Maulerfiend") { - scr_en_weapon("Maulerfiend Claws", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 250; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - dudes_dr[j] = 0.5; - } - -} -j = 0; - -neww = 0; - -if (men + veh = 1) and(instance_number(obj_enunit) = 1) { - if (men = 1) and(veh = 0) { - var i, h; - i = 0; - h = 0; - repeat(20) { - if (h = 0) { - i += 1; - if (dudes_num[i] = 1) { - h = dudes_hp[i]; - obj_ncombat.display_p2 = h; - obj_ncombat.display_p2n = string(dudes[i]); - } - } - } - } -} - -/* */ -var __b__; -__b__ = action_if_variable(obj_ncombat.enemy, 1, 0); -if __b__ { - - var j; - j = 0; - men = 0; - repeat(100) { - j += 1; - veh = 0; - dreads = 0; - if (dudes[j] != "") and(dudes_vehicle[j] = 0) { - men += dudes_num[j]; - } - } - - // show_message("dudes1:"+string(dudes[1])+", men:"+string(men)); - - var i, g; - i = 0; - g = 0; - - var dreaded; - dreaded = false; - - repeat(700) { - g += 1; - // Why was this here? And why was it later checked, if it always would be false?; - // marine_casting[g] = false; - - if ((dudes[g] != "") and(dudes_num[g] > 0)) and(dudes_hp[g] > 0) { - // if (marine_hp[g]>0) then men+=1; - - /* - scr_en_weapon - argument0: name - argument1: man? - argument2: number - argument3: owner - argument4: dudes number - */ - - if (dudes[g] = obj_ini.role[100][6]) or(dudes[g] = "Venerable " + obj_ini.role[100][6]) and(dudes_hp[g] > 0) { - dreads += 1; - dreaded = true; - } - if (dudes_mobi[g] = "Bike") then scr_en_weapon("Twin Linked Bolters", false, 1, dudes[g], g); - if (dudes_mobi[g] != "Bike") and(dudes_mobi[g] != "") { - if (string_count("Jump Pack", marine_mobi[g]) > 0) then scr_en_weapon("Hammer of Wrath", false, 1, dudes[g], g); - } - - if (dudes_mobi[g] = "Servo-arm") then scr_en_weapon("Servo-arm(M)", false, 1, dudes[g], g); - if (dudes_mobi[g] = "Servo-harness") { - scr_en_weapon("Servo-arm(M)", false, 1, dudes[g], g); - scr_en_weapon("Flamer", false, 1, dudes[g], g); - scr_en_weapon("Plasma Cutter", false, 1, dudes[g], g); - } - - var j, good, open; - j = 0; - good = 0; - open = 0; // Counts the number and types of marines within this object - repeat(20) { - j += 1; - if (dudes[j] = "") and(open = 0) { - open = j; // Determine if vehicle here - - if (dudes[j] = "Venerable " + string(obj_ini.role[100][6])) then dudes_vehicle[j] = 1; - if (dudes[j] = obj_ini.role[100][6]) then dudes_vehicle[j] = 1; - } - // if (dudes[g]=dudes[j]){good=1;dudes_num[j]+=1;} - // if (good=0) and (open!=0){dudes[open]=marine_type[g];dudes_num[open]=1;} - } - - if (dudes_wep1[g] != "") and (marine_casting[g] == false) { // Do not add weapons to the roster while casting - if ((dudes[g] != "Chapter Master")) then scr_en_weapon(string(dudes_wep1[g]), false, 1, dudes[g], g); - - if (dudes_wep1[g] = "Close Combat Weapon") then scr_en_weapon("CCW Heavy Flamer", true, 1, dudes[g], g); - if (string_count("UBOLT", dudes_wep1[g]) > 0) then scr_en_weapon("Integrated-Bolter", false, 1, dudes[g], g); - if (string_count("UFL", dudes_wep1[g]) > 0) then scr_en_weapon("Underslung Flamer", false, 1, dudes[g], g); - } - if (dudes_wep2[g] != "") and (marine_casting[g] == false) { - if ((dudes[g] != "Chapter Master")) then scr_en_weapon(string(dudes_wep2[g]), false, 1, dudes[g], g); - - if (dudes_wep2[g] = "Close Combat Weapon") then scr_en_weapon("CCW Heavy Flamer", true, 1, dudes[g], g); - if (string_count("UBOLT", dudes_wep2[g]) > 0) then scr_en_weapon("Integrated-Bolter", false, 1, dudes[g], g); - if (string_count("UFL", dudes_wep2[g]) > 0) then scr_en_weapon("Underslung Flamer", false, 1, dudes[g], g); - } - } - } - - // Right here should be retreat- if important units are exposed they should try to hop left - - - if (men > 0) and(alarm[5] > 0) then alarm[5] = -1; - instance_activate_object(obj_enunit); - - exit; - - /* */ -} -__b__ = action_if_variable(obj_ncombat.enemy, 2, 0); -if __b__ { - - repeat(20) { - j += 1; - if (dudes[j] = "Imperial Guardsman") { - dudes_ac[j] = 40; - dudes_hp[j] = 5; - men += dudes_num[j]; - } - - if (dudes[j] = "Heavy Weapons Team") { - scr_en_weapon("Heavy Bolter", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 100; - dudes_dr[j] = 0.9; - men += dudes_num[j]; - } - - if (dudes[j] = "Ogryn") { - scr_en_weapon("Ripper Gun", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Ogryn Melee", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 120; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - - if (dudes[j] = "Chimera") { - scr_en_weapon("Multi-Laster", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Heavy Bolter", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 200; - dudes_dr[j] = 0.75; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] = "Basilisk") { - scr_en_weapon("Earthshaker Cannon", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Storm Bolter", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 150; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] = "Leman Russ Battle Tank") { - scr_en_weapon("Battle Cannon", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Lascannon", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 45; - dudes_hp[j] = 250; - dudes_dr[j] = 0.25; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] = "Leman Russ Demolisher") { - scr_en_weapon("Demolisher Cannon", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Lascannon", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 250; - dudes_dr[j] = 0.25; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] = "Vendetta") { - scr_en_weapon("Twin-Linked Lascannon", false, dudes_num[j] * 3, dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 300; - dudes_dr[j] = 0.25; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - - } - - // Twin-Linked Lascannon - // Multi-Laser - // Ripper Gun - // Earthshaker Cannon - - // 0-10,000,000 - // Leman Russ Battle Tank = min.1, max = /40000 - // Leman Russ Demolisher = min.1, max = /60000 - // Chimera = min.1, max = /60000 - - /* */ -} -__b__ = action_if_variable(obj_ncombat.enemy, 3, 0); -if __b__ { - - repeat(20) { - j += 1; - if (dudes[j] = "Thallax") { - scr_en_weapon("Lightning Gun", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Thallax Melee", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 80; - men += dudes_num[j]; - } - if (dudes[j] = "Praetorian Servitor") { - scr_en_weapon("Phased Plasma-fusil", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 25; - dudes_hp[j] = 150; - medi += dudes_num[j]; - } - } - - // - // - - /* */ -} -__b__ = action_if_variable(obj_ncombat.enemy, 5, 0); -if __b__ { - - repeat(20) { - j += 1; - if (dudes[j] = "Leader") { - scr_en_weapon("Blessed Weapon", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Laser Mace", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Infernus Pistol", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - if (obj_ncombat.started == eBATTLE_STAGE.Creation) or(dudes_num[j] > 1) { - dudes_hp[j] = 200; - } - men += dudes_num[j]; - dudes_dr[j] = 0.25; - } - if (dudes[j] = "Palatine") { - scr_en_weapon("Plasma Pistol", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 100; - men += dudes_num[j]; - dudes_dr[j] = 0.5; - } - if (dudes[j] = "Priest") { - scr_en_weapon("Laspistol", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 0; - dudes_hp[j] = 50; - men += dudes_num[j]; - dudes_dr[j] = 0.5; - } - - if (dudes[j] = "Arco-Flagellent") { - scr_en_weapon("Electro-Flail", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 0; - dudes_hp[j] = 150; - men += dudes_num[j]; - dudes_dr[j] = 0.7; - } - - if (dudes[j] = "Celestian") { - scr_en_weapon("Bolter", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Chainsword", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 60; - men += dudes_num[j]; - dudes_dr[j] = 0.50; - } - if (dudes[j] = "Mistress") { - scr_en_weapon("Neural Whip", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 60; - men += dudes_num[j]; - dudes_dr[j] = 0.50; - } - if (dudes[j] = "Sister Repentia") { - scr_en_weapon("Eviscerator", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 0; - dudes_hp[j] = 75; - men += dudes_num[j]; - dudes_dr[j] = 0.75; - } - - if (dudes[j] = "Battle Sister") { - if (dudes_num[j] <= 4) then scr_en_weapon("Bolter", true, dudes_num[j], dudes[j], j); - if (dudes_num[j] >= 5) { - var nem; - nem = round(dudes_num[j] / 4); - scr_en_weapon("Flamer", true, nem, dudes[j], j); - scr_en_weapon("Bolter", true, dudes_num[j] - nem, dudes[j], j); - } - scr_en_weapon("Sarissa", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 60; - men += dudes_num[j]; - dudes_dr[j] = 0.75; - } - if (dudes[j] = "Seraphim") { - scr_en_weapon("Seraphim Pistols", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Chainsword", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 60; - men += dudes_num[j]; - dudes_dr[j] = 0.6; - } - if (dudes[j] = "Dominion") { - scr_en_weapon("Meltagun", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Meltabomb", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 60; - men += dudes_num[j]; - dudes_dr[j] = 0.75; - } - if (dudes[j] = "Retributor") { - if (dudes_num[j] <= 3) then scr_en_weapon("Heavy Bolter", true, dudes_num[j], dudes[j], j); - if (dudes_num[j] >= 4) { - var nem; - nem = round(dudes_num[j] / 4); - scr_en_weapon("Missile Launcher", true, nem, dudes[j], j); - scr_en_weapon("Heavy Bolter", true, dudes_num[j] - nem, dudes[j], j); - } - scr_en_weapon("Bolt Pistol", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 60; - men += dudes_num[j]; - dudes_dr[j] = 0.6; - } - - if (dudes[j] = "Follower") { - scr_en_weapon("Laspistol", true, dudes_num[j], dudes[j], j); - scr_en_weapon("melee0.5", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 0; - dudes_hp[j] = 30; - men += dudes_num[j]; - } - - if (dudes[j] = "Rhino") { - scr_en_weapon("Storm Bolter", false, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 200; - dudes_dr[j] = 0.75; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - - if (dudes[j] = "Chimera") { - scr_en_weapon("Heavy Flamer", false, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 200; - dudes_dr[j] = 0.75; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - - if (dudes[j] = "Immolator") { - scr_en_weapon("Twin Linked Heavy Flamers", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 300; - dudes_dr[j] = 0.35; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] = "Exorcist") { - scr_en_weapon("Exorcist Missile Launcher", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Storm Bolter", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - if (obj_ncombat.started == eBATTLE_STAGE.Creation) or(dudes_num[j] > 1) { - dudes_hp[j] = 200; - } - dudes_dr[j] = 0.55; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - - if (dudes[j] = "Penitent Engine") { - scr_en_weapon("Close Combat Weapon", false, dudes_num[j] * 2, dudes[j], j); - scr_en_weapon("Heavy Flamer", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 35; - dudes_hp[j] = 150; - dudes_dr[j] = 0.50; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - - // if (obj_ncombat.enemy=11) and (dudes_vehicle[j]=0) and (dudes[j]!="Cultist"){dudes_dr[j]=0.8;} - // if (obj_ncombat.enemy=11) and (dudes_vehicle[j]=1){dudes_dr[j]=0.75;} - - // if (dudes[j]!="") and (dudes_num[j]=0){dudes[j]="";dudes_num[j]=0;} - if (dudes[j] != "") and(dudes_hp[j] = 0) { - dudes[j] = ""; - dudes_num[j] = 0; - } - if (faith[j] > 0) then dudes_dr[j] = max(0.65, dudes_dr[j] + 0.15); - } - - /* */ -} -__b__ = action_if_variable(obj_ncombat.enemy, 6, 0); -if __b__ { - - repeat(20) { - j += 1; - if (dudes[j] = "Leader") { - scr_en_weapon("Singing Spear", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Singing Spear Throw", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 150; - men += dudes_num[j]; - dudes_dr[j] = 0.5; - } - - if (dudes[j] = "Autarch") { - scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Fusion Gun", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 12; - dudes_hp[j] = 150; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - if (dudes[j] = "Farseer") { - scr_en_weapon("Singing Spear", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Singing Spear Throw", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 120; - dudes_dr[j] = 0.6; - men += dudes_num[j]; - } - if (dudes[j] = "Warlock") { - scr_en_weapon("Witchblade", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Psyshock", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 80; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - if (dudes[j] = "Avatar") { - scr_en_weapon("Wailing Doom", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Avatar Smite", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 300; - dudes_dr[j] = 0.55; - veh += dudes_num[j]; - } - if (dudes[j] = "Mighty Avatar") { - scr_en_weapon("Wailing Doom", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Avatar Smite", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 50; - dudes_hp[j] = 450; - dudes_dr[j] = 0.5; - veh += dudes_num[j]; - } - if (dudes[j] = "Godly Avatar") { - scr_en_weapon("Wailing Doom", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Avatar Smite", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 60; - dudes_hp[j] = 600; - dudes_dr[j] = 0.40; - veh += dudes_num[j]; - } - - if (dudes[j] = "Ranger") { - scr_en_weapon("Ranger Long Rifle", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Shuriken Pistol", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 40; - dudes_dr[j] = 0.9; - men += dudes_num[j]; - } - if (dudes[j] = "Pathfinder") { - scr_en_weapon("Pathfinder Long Rifle", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 60; - dudes_dr[j] = 0.8; - men += dudes_num[j]; - } - if (dudes[j] = "Dire Avenger") { - scr_en_weapon("Avenger Shuriken Catapult", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 40; - men += dudes_num[j]; - } - if (dudes[j] = "Dire Avenger Exarch") { - scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 70; // Shimmershield - men += dudes_num[j]; - } - if (dudes[j] = "Howling Banshee") { - scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Shuriken Pistol", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 40; - dudes_dr[j] = 0.8; - men += dudes_num[j]; - } - if (dudes[j] = "Howling Banshee Exarch") { - scr_en_weapon("Executioner", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 60; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - if (dudes[j] = "Striking Scorpion") { - scr_en_weapon("Scorpion Chainsword", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Shuriken Pistol", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Mandiblaster", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 60; - men += dudes_num[j]; - } - if (dudes[j] = "Striking Scorpion Exarch") { - scr_en_weapon("Biting Blade", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Scorpion's Claw", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Mandiblaster", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 80; - men += dudes_num[j]; - } - if (dudes[j] = "Fire Dragon") { - scr_en_weapon("Fusion Gun", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Meltabomb", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 12; - dudes_hp[j] = 40; - men += dudes_num[j]; - } - if (dudes[j] = "Fire Dragon Exarch") { - scr_en_weapon("Firepike", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 12; - dudes_hp[j] = 60; - men += dudes_num[j]; - } - if (dudes[j] = "Warp Spider") { - scr_en_weapon("Deathspinner", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 40; - dudes_dr[j] = 0.9; - men += dudes_num[j]; - } - if (dudes[j] = "Warp Spider Exarch") { - scr_en_weapon("Dual Deathspinners", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Powerblades", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 60; - dudes_dr[j] = 0.8; - men += dudes_num[j]; - } - if (dudes[j] = "Dark Reaper") { - scr_en_weapon("Reaper Launcher", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 40; - men += dudes_num[j]; - } - if (dudes[j] = "Dark Reaper Exarch") { - scr_en_weapon("Tempest Launcher", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 50; - men += dudes_num[j]; - } - if (dudes[j] = "Shining Spear") { - scr_en_weapon("Laser Lance", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Twin Linked Shuriken Catapult", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 75; - dudes_dr[j] = 0.8; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] = "Guardian") { - scr_en_weapon("Shuriken Catapult", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 30; - men += dudes_num[j]; - } - if (dudes[j] = "Grav Platform") { - scr_en_weapon("Pulse Laser", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 60; - men += dudes_num[j]; - } - if (dudes[j] = "Trouper") { - scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Fusion Pistol", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 50; - dudes_dr[j] = 0.25; - men += dudes_num[j]; - } - if (dudes[j] = "Athair") { - scr_en_weapon("Plasma Pistol", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Harlequin's Kiss", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 75; - dudes_dr[j] = 0.25; - men += dudes_num[j]; - } - if (dudes[j] = "Wraithguard") { - scr_en_weapon("Wraithcannon", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 15; - dudes_hp[j] = 125; - dudes_dr[j] = 0.70; - men += dudes_num[j]; - } - if (dudes[j] = "Vyper") { - scr_en_weapon("Twin Linked Shuriken Catapult", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Pulse Laser", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 100; - dudes_dr[j] = 0.8; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] = "Falcon") { - scr_en_weapon("Pulse Laser", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Shuriken Cannon", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Bright Lance", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 200; - dudes_dr[j] = 0.6; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] = "Fire Prism") { - scr_en_weapon("Twin Linked Shuriken Catapult", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Prism Cannon", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 200; - dudes_dr[j] = 0.5; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] = "Nightspinner") { - scr_en_weapon("Twin Linked Doomweaver", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 200; - dudes_dr[j] = 0.6; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] = "Wraithlord") { - scr_en_weapon("Two Power Fists", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Flamer", false, dudes_num[j] * 2, dudes[j], j); - scr_en_weapon("Starcannon", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 200; - dudes_dr[j] = 0.5; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] = "Phantom Titan") { - scr_en_weapon("Two Power Fists", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Phantom Pulsar", false, dudes_num[j] * 2, dudes[j], j); - scr_en_weapon("Titan Starcannon", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 50; - dudes_hp[j] = 800; - dudes_dr[j] = 0.35; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - - } - - /* */ -} -__b__ = action_if_variable(obj_ncombat.enemy, 7, 0); -if __b__ { - - repeat(20) { - j += 1; - if (dudes[j] = "Leader") { - scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Rokkit Launcha", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Big Shoota", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 12; - if (obj_ncombat.started == eBATTLE_STAGE.Creation) or(dudes_num[j] > 1) { - dudes_hp[j] = 600; - } - veh += dudes_num[j]; - dudes_dr[j] = 0.5; - } - - if (dudes[j] = "Minor Warboss") { - scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Big Shoota", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - if (obj_ncombat.started == eBATTLE_STAGE.Creation) or(dudes_num[j] > 1) { - dudes_hp[j] = 150; - dudes_dr[j] = 0.75; - } - men += dudes_num[j]; - } - if (dudes[j] = "Warboss") { - scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Rokkit Launcha", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 12; - if (obj_ncombat.started == eBATTLE_STAGE.Creation) or(dudes_num[j] > 1) { - dudes_hp[j] = 200; - dudes_dr[j] = 0.75; - } - men += dudes_num[j]; - } - if (dudes[j] = "Big Warboss") { - scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Rokkit Launcha", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 12; - if (obj_ncombat.started == eBATTLE_STAGE.Creation) or(dudes_num[j] > 1) { - dudes_hp[j] = 300; - dudes_dr[j] = 0.5; - } - men += dudes_num[j]; - } - - if (dudes[j] = "Gretchin") { - scr_en_weapon("Grot Blasta", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 0; - dudes_hp[j] = 15; - men += dudes_num[j]; - } - if (dudes[j] = "Slugga Boy") { - scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Slugga", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 5; - dudes_hp[j] = 60; - men += dudes_num[j]; - } - if (dudes[j] = "Shoota Boy") { - scr_en_weapon("Shoota", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 5; - dudes_hp[j] = 60; - men += dudes_num[j]; - } - - if (dudes[j] = "Mekboy") { - scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Big Shoota", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 12; - dudes_hp[j] = 100; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - if (dudes[j] = "Meganob") { - scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Big Shoota", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 12; - dudes_hp[j] = 150; - dudes_dr[j] = 0.6; - men += dudes_num[j]; - } - if (dudes[j] = "Flash Git") { - scr_en_weapon("Snazzgun", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 100; - men += dudes_num[j]; - } - if (dudes[j] = "Cybork") { - scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Big Shoota", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 125; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - - if (dudes[j] = "Ard Boy") { - scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Slugga", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 80; - dudes_dr[j] = 0.9; - men += dudes_num[j]; - } - if (dudes[j] = "Kommando") { - scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Rokkit Launcha", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 125; - dudes_dr[j] = 0.9; - men += dudes_num[j]; - } - if (dudes[j] = "Burna Boy") { - scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Burna", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 5; - dudes_hp[j] = 80; - men += dudes_num[j]; - } - if (dudes[j] = "Tankbusta") { - scr_en_weapon("Rokkit Launcha", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Tankbusta Bomb", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 5; - dudes_hp[j] = 80; - men += dudes_num[j]; - } - if (dudes[j] = "Stormboy") { - scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Slugga", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 5; - dudes_hp[j] = 80; - dudes_special[j] = "Jetpack"; - men += dudes_num[j]; - } - - if (dudes[j] = "Battlewagon") { - scr_en_weapon("Kannon", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Big Shoota", false, dudes_num[j] * 2, dudes[j], j); - scr_en_weapon("Rokkit Launcha", false, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 80; - dudes_hp[j] = 800; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] = "Deff Dread") { - scr_en_weapon("Power Klaw", false, dudes_num[j] * 2, dudes[j], j); - scr_en_weapon("Big Shoota", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Rokkit Launcha", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 60; - dudes_hp[j] = 500; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - } - - /* */ -} -__b__ = action_if_variable(obj_ncombat.enemy, 8, 0); -if __b__ { - - repeat(20) { - j += 1; - if (dudes[j] = "XV8 Commander") { - scr_en_weapon("Plasma Rifle", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Fusion Blaster", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Cyclic Ion Blaster", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 12; - dudes_hp[j] = 300; - dudes_dr[j] = 0.5; - men += dudes_num[j]; - } - if (dudes[j] = "XV8 Bodyguard") { - scr_en_weapon("Plasma Rifle", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Burst Rifle", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 200; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - if (dudes[j] = "XV8 Crisis") { - scr_en_weapon("Plasma Rifle", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Missile Pod", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 150; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - if (dudes[j] = "XV8 (Brightknife)") { - scr_en_weapon("Fusion Blaster", true, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 150; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - if (dudes[j] = "Shield Drone") { - dudes_ac[j] = 8; - dudes_hp[j] = 50; - men += dudes_num[j]; - } - - if (dudes[j] = "XV88 Broadside") { - scr_en_weapon("Smart Missile System", true, dudes_num[j] * 2, dudes[j], j); - scr_en_weapon("Small Railgun", true, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 12; - dudes_hp[j] = 225; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - if (dudes[j] = "XV25 Stealthsuit") { - scr_en_weapon("Burst Rifle", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 50; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - - if (dudes[j] = "Fire Warrior") { - scr_en_weapon("Pulse Rifle", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 30; - men += dudes_num[j]; - } - if (dudes[j] = "Pathfinder") { - scr_en_weapon("Rail Rifle", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 30; - men += dudes_num[j]; - } - if (dudes[j] = "Kroot") { - scr_en_weapon("Kroot Rifle", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee2", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 5; - dudes_hp[j] = 30; - men += dudes_num[j]; - } - if (dudes[j] = "Vespid") { - scr_en_weapon("Vespid Crystal", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee2", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 5; - dudes_hp[j] = 50; - men += dudes_num[j]; - } - - if (dudes[j] = "Devilfish") { - scr_en_weapon("Smart Missile System", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 150; - dudes_dr[j] = 0.75; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] = "Hammerhead") { - scr_en_weapon("Railgun", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Smart Missile System", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 150; - dudes_dr[j] = 0.75; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - } - - /* */ -} -__b__ = action_if_variable(obj_ncombat.enemy, 9, 0); -if __b__ { - - repeat(20) { - j += 1; - if (dudes[j] = "Hive Tyrant") { - scr_en_weapon("Bonesword", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Lashwhip", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Heavy Venom Cannon", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 400; - dudes_dr[j] = 0.5; - men += dudes_num[j]; - } - - if (dudes[j] = "Tyrant Guard") { - scr_en_weapon("Crushing Claws", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 12; - dudes_hp[j] = 200; - dudes_dr[j] = 0.6; - men += dudes_num[j]; - } - if (dudes[j] = "Tyranid Warrior") { - scr_en_weapon("Rending Claws", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Devourer", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 100; - dudes_dr[j] = 0.9; - men += dudes_num[j]; - } - if (dudes[j] = "Zoanthrope") { - scr_en_weapon("Zoanthrope Blast", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 300; - dudes_dr[j] = 0.25; - men += dudes_num[j]; - } - if (dudes[j] = "Carnifex") { - scr_en_weapon("Carnifex Claws", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Venom Cannon", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 300; - dudes_dr[j] = 0.75; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] = "Termagaunt") { - scr_en_weapon("Fleshborer", true, dudes_num[j] / 10, dudes[j], j); - dudes_ac[j] = 5; - dudes_hp[j] = 25; - men += dudes_num[j]; - } - if (dudes[j] = "Hormagaunt") { - scr_en_weapon("Scything Talons", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 5; - dudes_hp[j] = 25; - men += dudes_num[j]; - } - - if (dudes[j] = "Cultist") { - scr_en_weapon("Autogun", true, dudes_num[j], dudes[j], j); - scr_en_weapon("melee0.5", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 0; - dudes_hp[j] = 35; - men += dudes_num[j]; - } - if (dudes[j] = "Genestealer") { - scr_en_weapon("Genestealer Claws", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 5; - dudes_hp[j] = 75; - men += dudes_num[j]; - } - if (dudes[j] = "Genestealer Patriarch") { - scr_en_weapon("Genestealer Claws", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Witchfire", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 300; - dudes_dr[j] = 0.60; - men += dudes_num[j]; - } - if (dudes[j] = "Armoured Limousine") { - scr_en_weapon("Autogun", false, dudes_num[j] * 4, dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 150; - dudes_dr[j] = 0.75; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] = "Lictor") { - scr_en_weapon("Lictor Claws", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Flesh Hooks", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 300; - dudes_dr[j] = 0.60; - men += dudes_num[j]; - } - - } - - /* */ -} -__b__ = action_if_variable(obj_ncombat.enemy, 10, 4); -if __b__ { - __b__ = action_if_variable(obj_ncombat.enemy, 12, 1); - if __b__ { - - repeat(20) { - j += 1; - if (dudes[j] = "Leader") and(obj_controller.faction_gender[10] = 1) { - scr_en_weapon("Meltagun", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Power Fist", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - if (obj_ncombat.started == eBATTLE_STAGE.Creation) or(dudes_num[j] > 1) { - dudes_hp[j] = 300; - } - men += dudes_num[j]; - dudes_dr[j] = 0.75; - } - if (dudes[j] = "Leader") and(obj_controller.faction_gender[10] = 2) { - scr_en_weapon("Khorne Demon Melee", true, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 30; - if (obj_ncombat.started == eBATTLE_STAGE.Creation) or(dudes_num[j] > 1) { - dudes_hp[j] = 300; - } - men += dudes_num[j]; - dudes_dr[j] = 0.75; - } - - if (dudes[j] = "Fallen") { - scr_en_weapon("Bolt Pistol", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 120; - men += dudes_num[j]; - dudes_dr[j] = 0.5; - } - - if (dudes[j] = "Chaos Lord") { - scr_en_weapon("Plasma Pistol", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 150; - dudes_dr[j] = 0.5; - men += dudes_num[j]; - } - if (dudes[j] = "Chaos Sorcerer") { - scr_en_weapon("Plasma Pistol", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Force Staff", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 100; - dudes_dr[j] = 0.5; - men += dudes_num[j]; - } - if (dudes[j] = "Warpsmith") { - scr_en_weapon("Chainfist", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Meltagun", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Flamer", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 100; - dudes_dr[j] = 0.5; - men += dudes_num[j]; - } - - if (dudes[j] = "Chaos Terminator") { - scr_en_weapon("Power Fist", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Bolter", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Combi-Flamer", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 100; - men += dudes_num[j]; - dudes_dr[j] = 0.5; - } - if (dudes[j] = "Venerable Chaos Terminator") { - scr_en_weapon("Power Fist", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Bolter", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Combi-Flamer", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 120; - men += dudes_num[j]; - dudes_dr[j] = 0.4; - } - if (dudes[j] = "World Eaters Terminator") { - scr_en_weapon("Power Fist", true, dudes_num[j] * 2, dudes[j], j); - scr_en_weapon("Meltagun", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 120; - men += dudes_num[j]; - dudes_dr[j] = 0.4; - } - if (dudes[j] = "Obliterator") { - scr_en_weapon("Power Fist", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Obliterator Weapon", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 200; - dudes_dr[j] = 0.5; - men += dudes_num[j]; - } - if (dudes[j] = "Chaos Chosen") { - scr_en_weapon("Meltagun", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Chainsword", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 125; - dudes_dr[j] = 0.85; - men += dudes_num[j]; - } - if (dudes[j] = "Venerable Chaos Chosen") { - scr_en_weapon("Meltagun", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Chainsword", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 125; - men += dudes_num[j]; - dudes_dr[j] = 0.75; - } - - if (dudes[j] = "Possessed") { - scr_en_weapon("Possessed Claws", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 17; - dudes_hp[j] = 150; - dudes_dr[j] = 0.5; - men += dudes_num[j]; - } - if (dudes[j] = "Chaos Space Marine") { - scr_en_weapon("Bolter", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Chainsword", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 100; - dudes_dr[j] = 0.9; - men += dudes_num[j]; - } - if (dudes[j] = "Havoc") { - scr_en_weapon("Missile Launcher", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 100; - dudes_dr[j] = 0.9; - men += dudes_num[j]; - } - if (dudes[j] = "Raptor") { - scr_en_weapon("Chainsword", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Bolt Pistol", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 100; - dudes_dr[j] = 0.75; - dudes_special[j] = "Jump Pack"; - men += dudes_num[j]; - } - - if (dudes[j] = "World Eater") { - scr_en_weapon("Bolter", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Chainaxe", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 100; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - if (dudes[j] = "World Eaters Veteran") { - scr_en_weapon("Combi-Flamer", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Chainaxe", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 100; - dudes_dr[j] = 0.7; - men += dudes_num[j]; - } - - if (dudes[j] = "Khorne Berzerker") { - scr_en_weapon("Chainaxe", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Bolt Pistol", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 100; - dudes_dr[j] = 0.65; - men += dudes_num[j]; - } - if (dudes[j] = "Plague Marine") { - scr_en_weapon("Bolter", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Poison Chainsword", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 150; - dudes_dr[j] = 0.5; - men += dudes_num[j]; - } - if (dudes[j] = "Noise Marine") { - scr_en_weapon("Sonic Blaster", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 100; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - if (dudes[j] = "Rubric Marine") { - scr_en_weapon("Rubric Bolter", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 125; - dudes_dr[j] = 0.65; - men += dudes_num[j]; - } - if (dudes[j] = "Rubric Sorcerer") { - scr_en_weapon("Witchfire", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Force Staff", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 150; - dudes_dr[j] = 0.5; - men += dudes_num[j]; - } - if (dudes[j] = "Cultist") { - scr_en_weapon("Autogun", true, dudes_num[j], dudes[j], j); - scr_en_weapon("melee0.5", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 5; - dudes_hp[j] = 35; - men += dudes_num[j]; - } - if (dudes[j] = "Hellbrute") { - scr_en_weapon("Power Fist", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Meltagun", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 300; - dudes_dr[j] = 0.5; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] = "Rhino") { - scr_en_weapon("Storm Bolter", false, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 200; - dudes_dr[j] = 0.75; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] = "Predator") { - scr_en_weapon("Lascannon", false, dudes_num[j] * 2, dudes[j], j); - scr_en_weapon("Twin Linked Lascannon", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 45; - dudes_hp[j] = 350; - dudes_dr[j] = 0.5; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] = "Vindicator") { - scr_en_weapon("Demolisher Cannon", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Havoc Launcher", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 45; - dudes_hp[j] = 300; - dudes_dr[j] = 0.5; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] = "Land Raider") { - scr_en_weapon("Twin Linked Heavy Bolters", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Twin Linked Lascannon", false, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 50; - dudes_hp[j] = 400; - dudes_dr[j] = 0.25; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] = "Heldrake") { - scr_en_weapon("Baleflame", false, dudes_num[j] * 5, dudes[j], j); - dudes_ac[j] = 50; - dudes_hp[j] = 400; - dudes_dr[j] = 0.25; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] = "Defiler") { - scr_en_weapon("Defiler Claws", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Battle Cannon", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Reaper Autocannon", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Flamer", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 300; - dudes_dr[j] = 0.5; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - - if (dudes[j] = "Arch Heretic") { - scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Plasma Pistol", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 40; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - if (dudes[j] = "Cultist Elite") { - scr_en_weapon("Lasgun", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Chainaxe", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 40; - dudes_dr[j] = 0.9; - men += dudes_num[j]; - } - if (dudes[j] = "Mutant") { - scr_en_weapon("Flesh Hooks", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 0; - dudes_hp[j] = 30; - men += dudes_num[j]; - } - if (dudes[j] = "Daemonhost") { - scr_en_weapon("Daemonhost Claws", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Daemonhost_Powers", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 300; - dudes_dr[j] = 0.5; - medi += dudes_num[j]; - } - if (dudes[j] = "Possessed") { - scr_en_weapon("Possessed Claws", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 100; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - - /* - if (dudes[j]="Greater Daemon of Khorne"){scr_en_weapon("Khorne Demon Melee",true,dudes_num[j],dudes[j],j);dudes_ac[j]=10;dudes_hp[j]=300;dudes_dr[j]=0.25;medi+=dudes_num[j];} - if (dudes[j]="Greater Daemon of Slaanesh"){scr_en_weapon("Demon Melee",true,dudes_num[j],dudes[j],j);scr_en_weapon("Lash Whip",true,dudes_num[j],dudes[j],j);dudes_ac[j]=10;dudes_hp[j]=250;dudes_dr[j]=0.35;medi+=dudes_num[j];} - if (dudes[j]="Greater Daemon of Nurgle"){scr_en_weapon("Demon Melee",true,dudes_num[j],dudes[j],j);scr_en_weapon("Nurgle Vomit",true,dudes_num[j],dudes[j],j);dudes_ac[j]=15;dudes_hp[j]=400;dudes_dr[j]=0.25;medi+=dudes_num[j];} - if (dudes[j]="Greater Daemon of Tzeentch"){scr_en_weapon("Demon Melee",true,dudes_num[j],dudes[j],j);scr_en_weapon("Witchfire",true,dudes_num[j],dudes[j],j);dudes_ac[j]=10;dudes_hp[j]=250;dudes_dr[j]=0.35;medi+=dudes_num[j];} - */ - - if (dudes[j] = "Technical") { - scr_en_weapon("Autogun", false, dudes_num[j] * 2, dudes[j], j); - scr_en_weapon("Heavy Bolter", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 100; - dudes_dr[j] = 0.75; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - - if (dudes[j] = "Chaos Leman Russ") { - scr_en_weapon("Battle Cannon", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Heavy Bolter", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 45; - dudes_hp[j] = 250; - dudes_dr[j] = 0.25; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] = "Chaos Basilisk") { - scr_en_weapon("Earthshaker Cannon", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Heavy Bolter", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 150; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - - // if (obj_ncombat.enemy=11) and (dudes_vehicle[j]=0) and (dudes[j]!="Cultist"){dudes_dr[j]=0.8;} - // if (obj_ncombat.enemy=11) and (dudes_vehicle[j]=1){dudes_dr[j]=0.75;} - - // if (dudes[j]!="") and (dudes_num[j]=0){dudes[j]="";dudes_num[j]=0;} - if (dudes[j] != "") and(dudes_hp[j] = 0) { - dudes[j] = ""; - dudes_num[j] = 0; - } - } - - /* */ - } -} -__b__ = action_if_variable(obj_ncombat.enemy, 13, 0); -if __b__ { - - repeat(20) { - j += 1; - - if (dudes[j] = "Necron Overlord") { - scr_en_weapon("Staff of Light", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Staff of Light Shooting", true, dudes_num[j], dudes[j], j); - if (obj_ncombat.started == eBATTLE_STAGE.Creation) or(dudes_num[j] > 1) { - dudes_ac[j] = 12; - dudes_hp[j] = 300; - dudes_dr[j] = 0.5; - } - men += dudes_num[j]; - } - if (dudes[j] = "Lychguard") { - scr_en_weapon("Warscythe", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 12; - dudes_hp[j] = 100; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - - if (dudes[j] = "Flayed One") { - scr_en_weapon("Melee5", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 75; - dudes_dr[j] = 0.9; - men += dudes_num[j]; - } - if (dudes[j] = "Necron Warrior") { - scr_en_weapon("Gauss Flayer", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee3", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 75; - dudes_dr[j] = 0.9; - men += dudes_num[j]; - } - if (dudes[j] = "Necron Immortal") { - scr_en_weapon("Gauss Blaster", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee3", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 75; - dudes_dr[j] = 0.85; - men += dudes_num[j]; - } - - if (dudes[j] = "Necron Wraith") { - scr_en_weapon("Wraith Claws", true, dudes_num[j], dudes[j], j); - if (obj_ncombat.started == eBATTLE_STAGE.Creation) or(dudes_num[j] > 1) { - dudes_ac[j] = 10; - dudes_hp[j] = 200; - } - men += dudes_num[j]; - dudes_dr[j] = 0.75; - } - if (dudes[j] = "Necron Destroyer") { - scr_en_weapon("Gauss Cannon", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee3", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 25; - dudes_hp[j] = 175; - dudes_dr[j] = 0.5; - men += dudes_num[j]; - } - - if (dudes[j] = "Tomb Stalker") { - scr_en_weapon("Gauss Particle Cannon", false, dudes_num[j] * 1, dudes[j], j); - scr_en_weapon("Overcharged Gauss Cannon", false, dudes_num[j] * 2, dudes[j], j); - scr_en_weapon("Claws", false, dudes_num[j] * 5, dudes[j], j); - if (obj_ncombat.started == eBATTLE_STAGE.Creation) or(dudes_num[j] > 1) { - dudes_ac[j] = 40; - dudes_hp[j] = 600; - } - dudes_dr[j] = 0.5; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] = "Canoptek Spyder") { - scr_en_weapon("Claws", false, dudes_num[j] * 2, dudes[j], j); - if (obj_ncombat.started == eBATTLE_STAGE.Creation) or(dudes_num[j] > 1) { - dudes_ac[j] = 30; - dudes_hp[j] = 300; - } - dudes_dr[j] = 0.75; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] = "Canoptek Scarab") { - scr_en_weapon("Melee3", false, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 30; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - dudes_vehicle[j] = 0; - } - if (dudes[j] = "Necron Monolith") { - scr_en_weapon("Gauss Flux Arc", false, dudes_num[j] * 4, dudes[j], j); - scr_en_weapon("Particle Whip", false, dudes_num[j] * 1, dudes[j], j); - dudes_ac[j] = 50; - dudes_hp[j] = 500; - dudes_dr[j] = 0.25; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] = "Doomsday Arc") { - scr_en_weapon("Gauss Flayer Array", false, dudes_num[j] * 2, dudes[j], j); - scr_en_weapon("Doomsday Cannon", false, dudes_num[j] * 1, dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 350; - dudes_dr[j] = 0.5; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - - // if (dudes_dr[j]>0.8) then dudes_dr[j]=0.8; - } - - /* */ -} -/* -if (obj_ncombat.battle_special = "ruins") or(obj_ncombat.battle_special = "ruins_eldar") { - var i; - i = 0; - repeat(20) { - i += 1; - if (dudes_vehicle[i] > 0) and(dudes_num[i] > 0) { - obj_ncombat.enemy_forces -= dudes_num[i]; - obj_ncombat.enemy_max -= dudes_num[i]; - dudes[i] = ""; - dudes_special[i] = ""; - dudes_num[i] = 0; - dudes_ac[i] = 0; - dudes_hp[i] = 0; - dudes_dr[i] = 1; - dudes_vehicle[i] = 0; - } - } -} -*/ - -if (men + veh + medi <= 0) { - instance_destroy(id); - exit; -} - -if (obj_ncombat.started == eBATTLE_STAGE.Creation) { - obj_ncombat.enemy_forces += self.men + self.veh + self.medi; -} -engaged = (collision_point(x + 12, y, obj_pnunit, 0, 1)) or(collision_point(x - 12, y, obj_pnunit, 0, 1)); - -if (neww = 1) then neww = 0; - -/* */ -/* */ \ No newline at end of file diff --git a/objects/obj_enunit/Alarm_8.gml b/objects/obj_enunit/Alarm_8.gml deleted file mode 100644 index b3520fee70..0000000000 --- a/objects/obj_enunit/Alarm_8.gml +++ /dev/null @@ -1 +0,0 @@ -action_set_alarm(1, 1); diff --git a/objects/obj_enunit/Create_0.gml b/objects/obj_enunit/Create_0.gml index 1f3fcf86fe..f6816b1213 100644 --- a/objects/obj_enunit/Create_0.gml +++ b/objects/obj_enunit/Create_0.gml @@ -31,8 +31,7 @@ if (obj_ncombat.enemy < array_length(global.star_name_colors) && obj_ncombat.ene } -enemy=0; -enemy2=0; +target_block = noone; @@ -73,13 +72,10 @@ dudes_wep2 = array_create(_enemy_size, ""); dudes_gear = array_create(_enemy_size, ""); dudges_mobi = array_create(_enemy_size, ""); -alarm[1]=5; -alarm[5]=6; -if (obj_ncombat.enemy=1) then alarm[6]=10; // if (obj_ncombat.enemy=1){alarm[1]=8;alarm[5]=10;} hit = function() { - return scr_hit(x1, y1, x2, y2) && obj_ncombat.fading == false; + return scr_hit(x1, y1, x2, y2) && obj_ncombat.fading_strength == false; }; diff --git a/objects/obj_enunit/obj_enunit.yy b/objects/obj_enunit/obj_enunit.yy index d6b979d297..a2a40fbca5 100644 --- a/objects/obj_enunit/obj_enunit.yy +++ b/objects/obj_enunit/obj_enunit.yy @@ -3,9 +3,6 @@ "%Name":"obj_enunit", "eventList":[ {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":8,"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":0,"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",}, diff --git a/objects/obj_ncombat/Alarm_0.gml b/objects/obj_ncombat/Alarm_0.gml deleted file mode 100644 index 7360d0cf9e..0000000000 --- a/objects/obj_ncombat/Alarm_0.gml +++ /dev/null @@ -1,3096 +0,0 @@ -// Sets up the number of enemies based on the threath level, enemy type and specific story events - -try{ -if (battle_special = "cs_meeting_battle5") then alpha_strike = 1; - -instance_activate_object(obj_enunit); - -// show_message("Leader?: "+string(leader)); - -// if (enemy=1) then show_message("exiting obj_ncombat_Alarm 0_2 due to enemy=1"); -if (enemy = 1) { - instance_activate_object(obj_enunit); - exit; -} - -if (battle_special = "study2a") or(battle_special = "study2b") { - ally = 3; - ally_forces = 1; -} -instance_activate_object(obj_pnunit); -if (!instance_exists(obj_pnunit)) then exit; -xxx = instance_nearest(1000, 240, obj_pnunit); -xxx = xxx.x + 80; - -if (string_count("spyrer", battle_special) > 0) or(string_count("fallen", battle_special) > 0) or(string_count("mech", battle_special) > 0) or(battle_special = "space_hulk") or(battle_special = "study2a") or(battle_special = "study2b") then fortified = 0; - -var i = 0, - u; -i = xxx / 10; - -if (fortified > 1) and(enemy + threat != 17) { - u = instance_create(0, 0, obj_nfort); - u.image_speed = 0; - u.image_alpha = 0.5; - - if (fortified = 2) { - u.ac[1] = 30; - u.hp[1] = 400; - } - if (fortified = 3) { - u.ac[1] = 40; - u.hp[1] = 800; - } - if (fortified = 4) { - u.ac[1] = 40; - u.hp[1] = 1250; - } - if (fortified = 5) { - u.ac[1] = 40; - u.hp[1] = 1500; - } - - if (siege = 1) and(fortified > 0) and(defending = true) { - global_attack = global_attack * 1.1; - u.hp[1] = round(u.hp[1] * 1.2); - } - - u.maxhp[1] = u.hp[1]; -} - -for (var j = 0; j < 10; j++) { - i -= 1; - u = instance_create(i * 10, 240, obj_enunit); - u.column = i - ((xxx / 10) - 10); -} -// *** Enemy Forces Special Event *** -// * Malcadon Spyrer * -if (string_count("spyrer", battle_special) > 0) { - fortified = 0; - with(obj_enunit) { - instance_destroy(); - } - u = instance_create(10, 240, obj_enunit); - enemy_dudes = "1"; - u.dudes[1] = "Malcadon Spyrer"; - u.dudes_num[1] = 1; - u.dudes_num[1] = 1; - enemies[1] = 1; - u.flank = 1; -} -// * Small Fallen Group * -if (battle_special = "fallen1") { - fortified = 0; - with(obj_enunit) { - instance_destroy(); - } - u = instance_create(80, 240, obj_enunit); - enemy_dudes = "1"; - u.dudes[1] = "Fallen"; - u.dudes_num[1] = 1; - enemies[1] = 1; -} -// * Large Fallen Group * -if (battle_special = "fallen2") { - fortified = 0; - with(obj_enunit) { - instance_destroy(); - } - u = instance_create(80, 240, obj_enunit); - enemy_dudes = "1"; - u.dudes[1] = "Fallen"; - u.dudes_num[1] = choose(1, 1, 2, 2, 3); - enemies[1] = u.dudes_num[1]; -} -// * Praetorian Servitor Group * -if (string_count("mech", battle_special) > 0) { - fortified = 0; - with(obj_enunit) { - instance_destroy(); - } - u = instance_create(xxx + 10, 240, obj_enunit); - enemy_dudes = ""; - u.dudes[1] = "Thallax"; - u.dudes_num[1] = 4; - enemies[1] = 4; - u.dudes[2] = "Praetorian Servitor"; - u.dudes_num[2] = 6; - enemies[2] = 6; -} -// * Greater Daemon * -if (battle_special = "ship_demon") { - fortified = 0; - with(obj_enunit) { - instance_destroy(); - } - enemy = 10; - u = instance_create(10, 240, obj_enunit); - enemy_dudes = "1"; - u.dudes[1] = choose("Greater Daemon of Khorne", "Greater Daemon of Slaanesh", "Greater Daemon of Tzeentch", "Greater Daemon of Nurgle"); - u.dudes_num[1] = 1; - enemies[1] = 1; - u.flank = 1; - u.engaged = 1; - with(instance_nearest(x + 1000, 240, obj_pnunit)) { - engaged = 1; - } -} -// * Necron Wraith Group * -if (battle_special = "wraith_attack") { - fortified = 0; - with(obj_enunit) { - instance_destroy(); - } - u = instance_create(instance_nearest(x + 1000, 240, obj_pnunit) - .x + 10, 240, obj_enunit); - enemy_dudes = "2"; - u.dudes[1] = "Necron Wraith"; - u.dudes_num[1] = 1; - enemies[1] = 1; - u.dudes[2] = "Necron Wraith"; - u.dudes_num[2] = 1; - enemies[2] = 1; - u.engaged = 1; // u.flank=1; - with(instance_nearest(x + 1000, 240, obj_pnunit)) { - engaged = 1; - } -} -// * Canoptek Spyder Group * -if (battle_special = "spyder_attack") { - fortified = 0; - with(obj_enunit) { - instance_destroy(); - } - u = instance_create(instance_nearest(x + 1000, 240, obj_pnunit) - .x + 10, 240, obj_enunit); - enemy_dudes = "21"; - u.dudes[1] = "Canoptek Spyder"; - u.dudes_num[1] = 1; - enemies[1] = u.dudes[1]; - u.dudes[2] = "Canoptek Scarab"; - u.dudes_num[2] = 20; - enemies[2] = u.dudes[2]; - u.engaged = 1; // u.flank=1; - with(instance_nearest(x + 1000, 240, obj_pnunit)) { - engaged = 1; - } -} -// * Tomb Stalker Group * -if (battle_special = "stalker_attack") { - fortified = 0; - with(obj_enunit) { - instance_destroy(); - } - u = instance_create(instance_nearest(x + 1000, 240, obj_pnunit) - .x + 10, 240, obj_enunit); - enemy_dudes = "1"; - u.dudes[1] = "Tomb Stalker"; - u.dudes_num[1] = 1; - enemies[1] = 1; - u.engaged = 1; // u.flank=1; - with(instance_nearest(x + 1000, 240, obj_pnunit)) { - engaged = 1; - } -} -// * Chaos Space Marine Elite Group * -if (battle_special = "cs_meeting_battle5") or(battle_special = "cs_meeting_battle6") { - fortified = 0; - with(obj_enunit) { - instance_destroy(); - } - u = instance_create(xxx + 20, 240, obj_enunit); - enemy_dudes = ""; - u.dudes[1] = "Leader"; - u.dudes_num[1] = 1; - enemies[1] = 1; - u.dudes[2] = "Greater Daemon of Tzeentch"; - u.dudes_num[2] = 1; - enemies[2] = 1; - u.dudes[3] = "Greater Daemon of Slaanesh"; - u.dudes_num[3] = 1; - enemies[3] = 1; - u = instance_create(xxx + 10, 240, obj_enunit); - enemy_dudes = ""; - u.dudes[1] = "Venerable Chaos Terminator"; - u.dudes_num[1] = 20; - enemies[1] = 20; -} -// * Chaos Space Marine Elite Company * -if (battle_special = "cs_meeting_battle10") { - fortified = 0; - with(obj_enunit) { - instance_destroy(); - } - u = instance_create(xxx + 20, 240, obj_enunit); - enemy_dudes = ""; - u.dudes[1] = "Greater Daemon of Tzeentch"; - u.dudes_num[1] = 1; - enemies[1] = 1; - u.dudes[2] = "Greater Daemon of Slaanesh"; - u.dudes_num[2] = 1; - enemies[2] = 1; - u.dudes[3] = "Venerable Chaos Terminator"; - u.dudes_num[3] = 20; - enemies[3] = 20; - u = instance_create(xxx + 10, 240, obj_enunit); - enemy_dudes = ""; - u.dudes[1] = "Venerable Chaos Chosen"; - u.dudes_num[1] = 40; - enemies[1] = 40; - u.dudes[2] = "Helbrute"; - u.dudes_num[2] = 3; - enemies[2] = 3; -} -// * Tomb world attack enemy setup * -if (battle_special = "wake1_attack") { - enemy = 13; - threat = 2; -} -if (battle_special = "wake2_attack") { - enemy = 13; - threat = 3; -} -if (battle_special = "wake3_attack") { - enemy = 13; - threat = 5; -} -// * Tomb world study attack enemy setup * -if (battle_special = "study2a") { - enemy = 13; - threat = 2; -} -if (battle_special = "study2b") { - enemy = 13; - threat = 3; -} -// ** Space Hulk Forces ** -if (battle_special = "space_hulk") { - var make, modi; - // show_message("space hulk battle, player forces: "+string(player_forces)); - with(obj_enunit) { - instance_destroy(); - } - // * Ork Space Hulk * - if (enemy = 7) { - modi = random_range(0.80, 1.20) + 1; - make = round(max(3, player_starting_dudes * modi)); - - u = instance_create(instance_nearest(x - 1000, 240, obj_pnunit) - .x - 10, 240, obj_enunit); - u.dudes[1] = "Meganob"; - u.dudes_num[1] = make; - enemies[1] = u.dudes[1]; - u.engaged = 1; - u.flank = 1; - with(instance_nearest(x - 1000, 240, obj_pnunit)) { - engaged = 1; - } - - u = instance_create(instance_nearest(x + 1000, 240, obj_pnunit) - .x + 20, 240, obj_enunit); - u.dudes[1] = "Slugga Boy"; - u.dudes_num[1] = make; - enemies[1] = u.dudes[1]; - - u.dudes[2] = "Shoota Boy"; - u.dudes_num[2] = make; - enemies[2] = u.dudes[2]; - - hulk_forces = make * 3; - } - // * Genestealer Space Hulk * - if (enemy = 9) { - modi = random_range(0.80, 1.20) + 1; - make = round(max(3, player_starting_dudes * modi)) * 2; - - u = instance_create(instance_nearest(x - 1000, 240, obj_pnunit) - .x - 10, 240, obj_enunit); - u.dudes[1] = "Genestealer"; - u.dudes_num[1] = round(make / 3); - enemies[1] = u.dudes[1]; - u.engaged = 1; - u.flank = 1; - with(instance_nearest(x - 1000, 240, obj_pnunit)) { - engaged = 1; - } - - u = instance_create(instance_nearest(x + 1000, 240, obj_pnunit) - .x + 10, 240, obj_enunit); - u.dudes[1] = "Genestealer"; - u.dudes_num[1] = round(make / 3); - enemies[1] = u.dudes[1]; - - u = instance_create(instance_nearest(x + 1000, 240, obj_pnunit) - .x + 50, 240, obj_enunit); - u.dudes[1] = "Genestealer"; - u.dudes_num[1] = make - (round(make / 3) * 2); - enemies[1] = u.dudes[1]; - - hulk_forces = make; - } - // * CSM Space Hulk * - if (enemy = 10) { - var make, modi; - modi = random_range(0.80, 1.20) + 1; - make = round(max(3, player_starting_dudes * modi)); - - u = instance_create(instance_nearest(x - 1000, 240, obj_pnunit) - .x - 10, 240, obj_enunit); - u.dudes[1] = "Chaos Terminator"; - u.dudes_num[1] = round(make * 0.25); - enemies[1] = u.dudes[1]; - u.engaged = 1; - u.flank = 1; - with(instance_nearest(x - 1000, 240, obj_pnunit)) { - engaged = 1; - } - - u = instance_create(instance_nearest(x + 1000, 240, obj_pnunit) - .x + 10, 240, obj_enunit); - u.dudes[1] = "Chaos Space Marine"; - u.dudes_num[1] = round(make * 0.25); - enemies[1] = u.dudes[1]; - - u = instance_create(instance_nearest(x + 1000, 240, obj_pnunit) - .x + 50, 240, obj_enunit); - u.dudes[1] = "Cultist"; - u.dudes_num[1] = round(make * 0.5); - enemies[1] = u.dudes[1]; - - hulk_forces = make; - } - - // show_message(string(instance_number(obj_enunit))+"x enemy blocks"); - instance_activate_object(obj_enunit); - exit; -} -// ** Story Reveal of a Chaos World ** -if (battle_special = "WL10_reveal") { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "3300"; - - u.dudes[1] = "Leader"; - u.dudes_num[1] = 1; - - u.dudes[2] = "Greater Daemon of Tzeentch"; - u.dudes_num[2] = 1; - - u.dudes[3] = "Greater Daemon of Slaanesh"; - u.dudes_num[3] = 1; - - u.dudes[4] = "Venerable Chaos Terminator"; - u.dudes_num[4] = 20; - - u.dudes[5] = "Venerable Chaos Chosen"; - u.dudes_num[5] = 50; - // u.dudes[4]="Chaos Basilisk";u.dudes_num[4]=18; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 10, 240, obj_enunit); - // u.dudes[1]="Chaos Leman Russ";u.dudes_num[1]=40; - u.dudes[1] = "Chaos Sorcerer"; - u.dudes_num[1] = 4; - u.dudes[2] = "Chaos Space Marine"; - u.dudes_num[2] = 100; - u.dudes[3] = "Havoc"; - u.dudes_num[3] = 20; - u.dudes[4] = "Raptor"; - u.dudes_num[4] = 20; - u.dudes[5] = "Bloodletter"; - u.dudes_num[5] = 30; - // u.dudes[3]="Vindicator";u.dudes_num[3]=10; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Rhino"; - u.dudes_num[1] = 30; - u.dudes[2] = "Defiler"; - u.dudes_num[2] = 4; - u.dudes[3] = "Heldrake"; - u.dudes_num[3] = 2; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 30, 240, obj_enunit); - u.dudes[1] = "Cultist Elite"; - u.dudes_num[1] = 1500; - // u.dudes[2]="Cultist Elite";u.dudes_num[2]=1500; - u.dudes[2] = "Helbrute"; - u.dudes_num[2] = 3; - // u.dudes[3]="Predator";u.dudes_num[3]=6; - // u.dudes[4]="Vindicator";u.dudes_num[4]=3; - // u.dudes[5]="Land Raider";u.dudes_num[5]=2; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 40, 240, obj_enunit); - // u.dudes[1]="Mutant";u.dudes_num[1]=8000; - u.dudes[1] = "Cultist"; - u.dudes_num[1] = 1500; - u.dudes[2] = "Helbrute"; - u.dudes_num[2] = 3; - instance_deactivate_object(u); -} -// ** Story late reveal of a Chaos World ** -if (battle_special = "WL10_later") { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "200"; - - u.dudes[1] = "Leader"; - u.dudes_num[1] = 1; - u.dudes[2] = "Greater Daemon of Tzeentch"; - u.dudes_num[2] = 1; - u.dudes[3] = "Greater Daemon of Slaanesh"; - u.dudes_num[3] = 1; - u.dudes[4] = "Venerable Chaos Terminator"; - u.dudes_num[4] = 20; - u.dudes[5] = "Venerable Chaos Chosen"; - u.dudes_num[5] = 50; - // u.dudes[4]="Chaos Basilisk";u.dudes_num[4]=18; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 10, 240, obj_enunit); - // u.dudes[1]="Chaos Leman Russ";u.dudes_num[1]=40; - u.dudes[1] = "Chaos Sorcerer"; - u.dudes_num[1] = 2; - u.dudes[1] = "Cultist"; - u.dudes_num[1] = 100; - u.dudes[2] = "Helbrute"; - u.dudes_num[2] = 1; - instance_deactivate_object(u); -} -// * Imperial Guard Force * -if (enemy = 2) { - guard_total = threat; - guard_score = 6; - - /*if (guard_total>=15000000) then guard_score=6; - if (guard_total<15000000) and (guard_total>=6000000) then guard_score=5; - if (guard_total<6000000) and (guard_total>=1000000) then guard_score=4; - if (guard_total<1000000) and (guard_total>=50000) then guard_score=3; - if (guard_total<50000) and (guard_total>=500) then guard_score=2; - if (guard_total<500) then guard_score=1;*/ - - // guard_effective=floor(guard_total)/8; - - var f = 0, - guar = threat / 10; - - // Guardsmen - u = instance_create(xxx, 240, obj_enunit); - enemy_dudes = threat; - u.dudes[1] = "Imperial Guardsman"; - u.dudes_num[1] = round(guar / 5); - enemies[1] = u.dudes[1]; - instance_deactivate_object(u); - - f = round(threat / 20000); - // Leman Russ D and Ogryn - if (f > 0) { - u = instance_create(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Leman Russ Demolisher"; - u.dudes_num[1] = f; - enemies[1] = u.dudes[1]; - f = max(10, round(threat / 6650)); - u.dudes[2] = "Ogryn"; - u.dudes_num[2] = f; - enemies[2] = u.dudes[2]; - instance_deactivate_object(u); - } - - // Chimera and Leman Russ - f = max(1, round(threat / 10000)); - u = instance_create(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Leman Russ Battle Tank"; - u.dudes_num[1] = f; - enemies[1] = u.dudes[1]; - f = max(1, round(threat / 20000)); - u.dudes[2] = "Chimera"; - u.dudes_num[2] = f; - enemies[2] = u.dudes[2]; - instance_deactivate_object(u); - - // More Guard - u = instance_create(xxx + 30, 240, obj_enunit); - u.dudes[1] = "Imperial Guardsman"; - u.dudes_num[1] = round(guar / 5); - enemies[1] = u.dudes[1]; - - u = instance_create(xxx + 40, 240, obj_enunit); - u.dudes[1] = "Imperial Guardsman"; - u.dudes_num[1] = round(guar / 5); - enemies[1] = u.dudes[1]; - - u = instance_create(xxx + 50, 240, obj_enunit); - u.dudes[1] = "Imperial Guardsman"; - u.dudes_num[1] = round(guar / 5); - enemies[1] = u.dudes[1]; - - u = instance_create(xxx + 60, 240, obj_enunit); - u.dudes[1] = "Imperial Guardsman"; - u.dudes_num[1] = round(guar / 5); - enemies[1] = u.dudes[1]; - - u = instance_create(xxx + 70, 240, obj_enunit); - f = round(threat / 50000); - - // Basilisk and Heavy Weapons - if (f > 0) { - u.dudes[1] = "Basilisk"; - u.dudes_num[1] = f; - enemies[1] = u.dudes[1]; - u.dudes[2] = "Heavy Weapons Team"; - u.dudes_num[2] = round(threat / 10000); - enemies[2] = u.dudes[2]; - } - // Heavy Weapons - else { - u.dudes[1] = "Heavy Weapons Team"; - u.dudes_num[1] = round(threat / 10000); - enemies[1] = u.dudes[1]; - } - - f = round(threat / 40000); - // Vendetta - if (f > 0) { - u = instance_create(0, 240, obj_enunit); - u.dudes[1] = "Vendetta"; - u.dudes_num[1] = f; - u.flank = 1; - u.flyer = 1; - } - - /*u=instance_nearest(xxx,240,obj_enunit);enemy_dudes=threat; - u.dudes[1]="Imperial Guardsman";u.dudes_num[1]=floor(guard_effective*0.6);enemies[1]=u.dudes[1]; - u.dudes[2]="Heavy Weapons Team";u.dudes_num[2]=min(1000,floor(guard_effective*0.1));enemies[2]=u.dudes[2]; - if (threat>1){u.dudes[3]="Leman Russ Battle Tank";u.dudes_num[3]=min(1000,floor(guard_effective*0.1));enemies[3]=u.dudes[3];} - - u=instance_nearest(xxx,240+10,obj_enunit);enemy_dudes=threat; - u.dudes[1]="Imperial Guardsman";u.dudes_num[1]=floor(guard_effective*0.6);enemies[1]=u.dudes[1]; - u.dudes[2]="Heavy Weapons Team";u.dudes_num[2]=min(1000,floor(guard_effective*0.1));enemies[2]=u.dudes[2]; - if (threat>1){u.dudes[3]="Leman Russ Battle Tank";u.dudes_num[3]=min(1000,floor(guard_effective*0.1));enemies[3]=u.dudes[3];}*/ -} - -// ** Aeldar Force ** -if (enemy = 6) { - // Ranger Group - if (threat = 1) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "20"; - - u.dudes[1] = "Pathfinder"; - u.dudes_num[1] = 1; - enemies[1] = u.dudes[1]; - u.dudes[2] = "Ranger"; - u.dudes_num[2] = 10; - enemies[2] = u.dudes[2]; - u.dudes[3] = "Striking Scorpian"; - u.dudes_num[3] = 10; - enemies[3] = u.dudes[3]; - } - // Harlequin Group - if (threat = 1) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "9"; - - u.dudes[1] = "Athair"; - u.dudes_num[1] = 1; - enemies[1] = u.dudes[1]; - u.dudes[2] = "Warlock"; - u.dudes_num[2] = 2; - enemies[2] = u.dudes[2]; - u.dudes[3] = "Trouper"; - u.dudes_num[3] = 6; - enemies[3] = u.dudes[3]; - } - // Craftworld Small Group - if (threat = 1) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "24"; - - u.dudes[1] = "Warlock"; - u.dudes_num[1] = 1; - enemies[1] = u.dudes[1]; - enemies_num[1] = 1; - u.dudes[2] = choose("Howling Banshee", "Striking Scorpian"); - u.dudes_num[2] = 8; - enemies[2] = u.dudes[2]; - u.dudes[3] = "Dire Avenger"; - u.dudes_num[3] = 15; - enemies[3] = u.dudes[3]; - if (leader = 1) { - u.dudes[4] = "Leader"; - u.dudes_num[4] = 1; - enemies[4] = 1; - enemies_num[4] = 1; - if (obj_controller.faction_gender[6] = 2) then u.dudes[2] = "Howling Banshee"; - if (obj_controller.faction_gender[6] = 2) then u.dudes[2] = "Dark Reapers"; - } - } - // Craftworld Medium Group - if (threat = 2) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "100"; - - u.dudes[1] = "Dire Avenger"; - u.dudes_num[1] = 56; - u.dudes_special[1] = "shimmershield"; - u.dudes[2] = "Dire Avenger Exarch"; - u.dudes_num[2] = 4; - u.dudes_special[2] = "shimmershield"; - u.dudes[3] = "Autarch"; - u.dudes_num[3] = 1; - u.dudes[4] = "Farseer"; - u.dudes_num[4] = 1; - u.dudes_special[4] = "farseer_powers"; - u.dudes[5] = "Night Spinner"; - u.dudes_num[5] = 1; - // Spawn leader - if (leader = 1) { - u.dudes[4] = "Leader"; - u.dudes_num[4] = 1; - enemies[4] = 1; - enemies_num[4] = 1; - } - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Fire Dragon"; - u.dudes_num[1] = 7; - u.dudes[2] = "Fire Dragon Exarch"; - u.dudes_num[2] = 1; - u.dudes[3] = "Warp Spider"; - u.dudes_num[3] = 7; - u.dudes_special[3] = "warp_jump"; - u.dudes[4] = "Warp Spider Exarch"; - u.dudes_num[4] = 1; - u.dudes_special[4] = "warp_jump"; - u.dudes[5] = "Howling Banshee"; - u.dudes_num[5] = 9; - u.dudes_special[5] = "banshee_mask"; - u.dudes[6] = "Howling Banshee Exarch"; - u.dudes_num[6] = 1; - u.dudes_special[6] = "banshee_mask"; - u.dudes[7] = "Striking Scorpian"; - u.dudes_num[7] = 9; - u.dudes[8] = "Striking Scorpian Exarch"; - u.dudes_num[8] = 1; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Falcon"; - u.dudes_num[1] = 2; - } - // Craftworld Large Group - if (threat = 3) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "300"; - - u.dudes[1] = "Dire Avenger"; - u.dudes_num[1] = 140; - u.dudes_special[1] = "shimmershield"; - u.dudes[2] = "Dire Avenger Exarch"; - u.dudes_num[2] = 10; - u.dudes_special[2] = "shimmershield"; - u.dudes[3] = "Autarch"; - u.dudes_num[3] = 1; - u.dudes[4] = "Farseer"; - u.dudes_num[4] = 1; - u.dudes_special[4] = "farseer_powers"; - // Spawn Leader - if (leader = 1) { - u.dudes[4] = "Leader"; - u.dudes_num[4] = 1; - enemies[4] = 1; - enemies_num[4] = 1; - } - u.dudes[5] = "Fire Prism"; - u.dudes_num[5] = 3; - u.dudes[6] = "Avatar"; - u.dudes_num[6] = 1; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Fire Dragon"; - u.dudes_num[1] = 18; - u.dudes[2] = "Fire Dragon Exarch"; - u.dudes_num[2] = 2; - u.dudes[3] = "Warp Spider"; - u.dudes_num[3] = 18; - u.dudes_special[3] = "warp_jump"; - u.dudes[4] = "Warp Spider Exarch"; - u.dudes_num[4] = 2; - u.dudes_special[4] = "warp_jump"; - u.dudes[5] = "Howling Banshee"; - u.dudes_num[5] = 28; - u.dudes_special[5] = "banshee_mask"; - u.dudes[6] = "Howling Banshee Exarch"; - u.dudes_num[6] = 2; - u.dudes_special[6] = "banshee_mask"; - u.dudes[7] = "Striking Scorpian"; - u.dudes_num[7] = 19; - u.dudes[8] = "Striking Scorpian Exarch"; - u.dudes_num[8] = 1; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Falcon"; - u.dudes_num[1] = 5; - u.dudes[2] = "Vyper"; - u.dudes_num[2] = 12; - u.dudes[3] = "Wraithguard"; - u.dudes_num[3] = 30; - u.dudes[4] = "Wraithlord"; - u.dudes_num[4] = 2; - } - // Craftworld Small Army - if (threat = 4) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "1100"; - - u.dudes[1] = "Dire Avenger"; - u.dudes_num[1] = 280; - u.dudes_special[1] = "shimmershield"; - u.dudes[2] = "Dire Avenger Exarch"; - u.dudes_num[2] = 20; - u.dudes_special[2] = "shimmershield"; - u.dudes[3] = "Autarch"; - u.dudes_num[3] = 3; - u.dudes[4] = "Farseer"; - u.dudes_num[4] = 2; - u.dudes_special[4] = "farseer_powers"; - // Spawn Leader - if (leader = 1) { - u.dudes[4] = "Leader"; - u.dudes_num[4] = 1; - enemies[4] = 1; - enemies_num[4] = 1; - } - u.dudes[5] = "Fire Prism"; - u.dudes_num[5] = 3; - u.dudes[6] = "Avatar"; - u.dudes_num[6] = 1; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Warlock"; - u.dudes_num[1] = 40; - u.dudes[2] = "Guardian"; - u.dudes_num[2] = 400; - u.dudes[3] = "Grav Platform"; - u.dudes_num[3] = 20; - u.dudes[4] = "Dark Reaper"; - u.dudes_num[4] = 18; - u.dudes[5] = "Dark Reaper Exarch"; - u.dudes_num[5] = 2; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Fire Dragon"; - u.dudes_num[1] = 36; - u.dudes[2] = "Fire Dragon Exarch"; - u.dudes_num[2] = 4; - u.dudes[3] = "Warp Spider"; - u.dudes_num[3] = 36; - u.dudes_special[3] = "warp_jump"; - u.dudes[4] = "Warp Spider Exarch"; - u.dudes_num[4] = 4; - u.dudes_special[4] = "warp_jump"; - u.dudes[5] = "Howling Banshee"; - u.dudes_num[5] = 36; - u.dudes_special[5] = "banshee_mask"; - u.dudes[6] = "Howling Banshee Exarch"; - u.dudes_num[6] = 4; - u.dudes_special[6] = "banshee_mask"; - u.dudes[7] = "Striking Scorpian"; - u.dudes_num[7] = 38; - u.dudes[8] = "Striking Scorpian Exarch"; - u.dudes_num[8] = 2; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 30, 240, obj_enunit); - u.dudes[1] = "Falcon"; - u.dudes_num[1] = 12; - u.dudes[2] = "Vyper"; - u.dudes_num[2] = 20; - u.dudes[3] = "Wraithguard"; - u.dudes_num[3] = 90; - u.dudes[4] = "Wraithlord"; - u.dudes_num[4] = 5; - u.dudes[5] = "Shining Spear"; - u.dudes_num[5] = 40; - } - // Craftworld Medium Army - if (threat = 5) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "2500"; - - u.dudes[1] = "Dire Avenger"; - u.dudes_num[1] = 450; - u.dudes_special[1] = "shimmershield"; - u.dudes[2] = "Dire Avenger Exarch"; - u.dudes_num[2] = 50; - u.dudes_special[2] = "shimmershield"; - u.dudes[3] = "Autarch"; - u.dudes_num[3] = 5; - u.dudes[4] = "Farseer"; - u.dudes_num[4] = 3; - u.dudes_special[4] = "farseer_powers"; - // Spawn Leader - if (leader = 1) { - u.dudes[4] = "Leader"; - u.dudes_num[4] = 1; - enemies[4] = 1; - enemies_num[4] = 1; - } - u.dudes[5] = "Fire Prism"; - u.dudes_num[5] = 6; - u.dudes[6] = "Mighty Avatar"; - u.dudes_num[6] = 1; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Warlock"; - u.dudes_num[1] = 80; - u.dudes[2] = "Guardian"; - u.dudes_num[2] = 1200; - u.dudes[3] = "Grav Platform"; - u.dudes_num[3] = 40; - u.dudes[4] = "Dark Reaper"; - u.dudes_num[4] = 36; - u.dudes[5] = "Dark Reaper Exarch"; - u.dudes_num[5] = 4; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Fire Dragon"; - u.dudes_num[1] = 72; - u.dudes[2] = "Fire Dragon Exarch"; - u.dudes_num[2] = 8; - u.dudes[3] = "Warp Spider"; - u.dudes_num[3] = 72; - u.dudes_special[3] = "warp_jump"; - u.dudes[4] = "Warp Spider Exarch"; - u.dudes_num[4] = 8; - u.dudes_special[4] = "warp_jump"; - u.dudes[5] = "Howling Banshee"; - u.dudes_num[5] = 72; - u.dudes_special[5] = "banshee_mask"; - u.dudes[6] = "Howling Banshee Exarch"; - u.dudes_num[6] = 8; - u.dudes_special[6] = "banshee_mask"; - u.dudes[7] = "Striking Scorpian"; - u.dudes_num[7] = 72; - u.dudes[8] = "Striking Scorpian Exarch"; - u.dudes_num[8] = 8; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 30, 240, obj_enunit); - u.dudes[1] = "Falcon"; - u.dudes_num[1] = 24; - u.dudes[2] = "Vyper"; - u.dudes_num[2] = 40; - u.dudes[3] = "Wraithguard"; - u.dudes_num[3] = 180; - u.dudes[4] = "Wraithlord"; - u.dudes_num[4] = 10; - u.dudes[5] = "Shining Spear"; - u.dudes_num[5] = 80; - } - // Craftworld Large Army - if (threat = 6) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "5000"; - - u.dudes[1] = "Dire Avenger"; - u.dudes_num[1] = 540; - u.dudes_special[1] = "shimmershield"; - u.dudes[2] = "Dire Avenger Exarch"; - u.dudes_num[2] = 60; - u.dudes_special[2] = "shimmershield"; - u.dudes[3] = "Autarch"; - u.dudes_num[3] = 8; - u.dudes[4] = "Farseer"; - u.dudes_num[4] = 4; - u.dudes_special[4] = "farseer_powers"; - // Spawn Leader - if (leader = 1) { - u.dudes[4] = "Leader"; - u.dudes_num[4] = 1; - enemies[4] = 1; - enemies_num[4] = 1; - } - u.dudes[5] = "Fire Prism"; - u.dudes_num[5] = 12; - u.dudes[6] = "Godly Avatar"; - u.dudes_num[6] = 1; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Warlock"; - u.dudes_num[1] = 100; - u.dudes[2] = "Guardian"; - u.dudes_num[2] = 3000; - u.dudes[3] = "Grav Platform"; - u.dudes_num[3] = 80; - u.dudes[4] = "Dark Reaper"; - u.dudes_num[4] = 72; - u.dudes[5] = "Dark Reaper Exarch"; - u.dudes_num[5] = 8; - u.dudes[6] = "Phantom Titan"; - u.dudes_num[6] = 2; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Fire Dragon"; - u.dudes_num[1] = 144; - u.dudes[2] = "Fire Dragon Exarch"; - u.dudes_num[2] = 16; - u.dudes[3] = "Warp Spider"; - u.dudes_num[3] = 144; - u.dudes_special[3] = "warp_jump"; - u.dudes[4] = "Warp Spider Exarch"; - u.dudes_num[4] = 16; - u.dudes_special[4] = "warp_jump"; - u.dudes[5] = "Howling Banshee"; - u.dudes_num[5] = 144; - u.dudes_special[5] = "banshee_mask"; - u.dudes[6] = "Howling Banshee Exarch"; - u.dudes_num[6] = 16; - u.dudes_special[6] = "banshee_mask"; - u.dudes[7] = "Striking Scorpian"; - u.dudes_num[7] = 144; - u.dudes[8] = "Striking Scorpian Exarch"; - u.dudes_num[8] = 16; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 30, 240, obj_enunit); - u.dudes[1] = "Falcon"; - u.dudes_num[1] = 48; - u.dudes[2] = "Vyper"; - u.dudes_num[2] = 80; - u.dudes[3] = "Wraithguard"; - u.dudes_num[3] = 360; - u.dudes[4] = "Wraithlord"; - u.dudes_num[4] = 20; - u.dudes[5] = "Shining Spear"; - u.dudes_num[5] = 160; - } -} - -// ** Sisters Force ** -if (enemy = 5) { - // Small Sister Group - if (threat = 1) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "110"; - - u.dudes[1] = "Celestian"; - u.dudes_num[1] = 1; - enemies[1] = u.dudes[1]; - // Spawn Leader - if (leader = 1) { - u.dudes[1] = "Leader"; - u.dudes_num[1] = 1; - enemies[1] = 1; - enemies_num[1] = 1; - } - u.dudes[2] = "Battle Sister"; - u.dudes_num[2] = 4; - enemies[2] = u.dudes[2]; - u.dudes[3] = "Priest"; - u.dudes_num[3] = 10; - enemies[3] = u.dudes[3]; - u.dudes[4] = "Follower"; - u.dudes_num[4] = 100; - enemies[4] = u.dudes[4]; - } - // Medium Sister Group - if (threat = 2) { - u = instance_nearest(xxx + 10, 240, obj_enunit); - enemy_dudes = "nearly 400"; - - u.dudes[1] = "Celestian"; - u.dudes_num[1] = 1; - // Spawn Leader - if (leader = 1) { - u.dudes[1] = "Leader"; - u.dudes_num[1] = 1; - enemies[1] = 1; - enemies_num[1] = 1; - } - u.dudes[2] = "Battle Sister"; - u.dudes_num[2] = 50; - u.dudes[3] = "Follower"; - u.dudes_num[3] = 300; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Arco-Flagellent"; - u.dudes_num[1] = 50; - u.dudes[2] = "Chimera"; - u.dudes_num[2] = 3; - } - // Large Sister Group - if (threat = 3) { - u = instance_nearest(xxx + 30, 240, obj_enunit); - enemy_dudes = "1000"; - - u.dudes[1] = "Palatine"; - u.dudes_num[1] = 1; - // Spawn Leader - if (leader = 1) { - u.dudes[1] = "Leader"; - u.dudes_num[1] = 1; - enemies[1] = 1; - enemies_num[1] = 1; - } - u.dudes[2] = "Battle Sister"; - u.dudes_num[2] = 200; - u.dudes[3] = "Celestian"; - u.dudes_num[3] = 40; - u.dudes[4] = "Retributor"; - u.dudes_num[4] = 50; - u.dudes[5] = "Priest"; - u.dudes_num[5] = 60; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Seraphim"; - u.dudes_num[1] = 50; - u.dudes[2] = "Dominion"; - u.dudes_num[2] = 50; - u.dudes[3] = "Immolator"; - u.dudes_num[3] = 4; - u.dudes[4] = "Exorcist"; - u.dudes_num[4] = 2; - instance_deactivate_object(u); - - u = instance_nearest(xxx, 240, obj_enunit); - u.dudes[1] = "Follower"; - u.dudes_num[1] = 450; - u.dudes[2] = "Sister Repentia"; - u.dudes_num[2] = 50; - u.dudes[3] = "Arco-Flagellent"; - u.dudes_num[3] = 30; - u.dudes[4] = "Penitent Engine"; - u.dudes_num[4] = 4; - } - // Small Sister Army - if (threat = 4) { - u = instance_nearest(xxx + 30, 240, obj_enunit); - enemy_dudes = "4000"; - - u.dudes[1] = "Palatine"; - u.dudes_num[1] = 2; - // Spawn Leader - if (leader = 1) { - u.dudes[1] = "Leader"; - u.dudes_num[1] = 1; - enemies[1] = 1; - enemies_num[1] = 1; - } - u.dudes[2] = "Battle Sister"; - u.dudes_num[2] = 1000; - u.dudes[3] = "Celestian"; - u.dudes_num[3] = 150; - u.dudes[4] = "Retributor"; - u.dudes_num[4] = 150; - u.dudes[5] = "Priest"; - u.dudes_num[5] = 150; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Seraphim"; - u.dudes_num[1] = 200; - u.dudes[2] = "Dominion"; - u.dudes_num[2] = 200; - u.dudes[3] = "Immolator"; - u.dudes_num[3] = 15; - u.dudes[4] = "Exorcist"; - u.dudes_num[4] = 6; - u.dudes[5] = "Follower"; - u.dudes_num[5] = 600; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Follower"; - u.dudes_num[1] = 1500; - u.dudes[2] = "Sister Repentia"; - u.dudes_num[2] = 100; - u.dudes[3] = "Arco-Flagellent"; - u.dudes_num[3] = 30; - u.dudes[4] = "Penitent Engine"; - u.dudes_num[4] = 4; - u.dudes[5] = "Mistress"; - u.dudes_num[5] = 10; - } - // Medium Sister Army - if (threat = 5) { - u = instance_nearest(xxx + 40, 240, obj_enunit); - enemy_dudes = "8000"; - - u.dudes[1] = "Palatine"; - u.dudes_num[1] = 2; - // Spawn Leader - if (leader = 1) { - u.dudes[1] = "Leader"; - u.dudes_num[1] = 1; - enemies[1] = 1; - enemies_num[1] = 1; - } - u.dudes[2] = "Battle Sister"; - u.dudes_num[2] = 1000; - u.dudes[3] = "Celestian"; - u.dudes_num[3] = 150; - u.dudes[4] = "Retributor"; - u.dudes_num[4] = 200; - u.dudes[5] = "Priest"; - u.dudes_num[5] = 200; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 30, 240, obj_enunit); - u.dudes[1] = "Battle Sister"; - u.dudes_num[1] = 1000; - u.dudes[2] = "Celestian"; - u.dudes_num[2] = 150; - u.dudes[3] = "Retributor"; - u.dudes_num[3] = 200; - u.dudes[4] = "Priest"; - u.dudes_num[4] = 200; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Seraphim"; - u.dudes_num[1] = 200; - u.dudes[2] = "Dominion"; - u.dudes_num[2] = 200; - u.dudes[3] = "Immolator"; - u.dudes_num[3] = 25; - u.dudes[4] = "Exorcist"; - u.dudes_num[4] = 10; - u.dudes[5] = "Follower"; - u.dudes_num[5] = 2000; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Follower"; - u.dudes_num[1] = 2000; - u.dudes[2] = "Sister Repentia"; - u.dudes_num[2] = 300; - u.dudes[3] = "Arco-Flagellent"; - u.dudes_num[3] = 100; - u.dudes[4] = "Penitent Engine"; - u.dudes_num[4] = 15; - u.dudes[5] = "Mistress"; - u.dudes_num[5] = 30; - } - // Large Sister Army - if (threat = 6) { - u = instance_nearest(xxx + 50, 240, obj_enunit); - enemy_dudes = "12000"; - - u.dudes[1] = "Palatine"; - u.dudes_num[1] = 1; - // Spawn Leader - if (leader = 1) { - u.dudes[1] = "Leader"; - u.dudes_num[1] = 1; - enemies[1] = 1; - enemies_num[1] = 1; - } - u.dudes[2] = "Battle Sister"; - u.dudes_num[2] = 1500; - u.dudes[3] = "Celestian"; - u.dudes_num[3] = 150; - u.dudes[4] = "Retributor"; - u.dudes_num[4] = 200; - u.dudes[5] = "Priest"; - u.dudes_num[5] = 200; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 40, 240, obj_enunit); - u.dudes[1] = "Battle Sister"; - u.dudes_num[1] = 1500; - u.dudes[2] = "Celestian"; - u.dudes_num[2] = 150; - u.dudes[3] = "Retributor"; - u.dudes_num[3] = 200; - u.dudes[4] = "Priest"; - u.dudes_num[4] = 200; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 30, 240, obj_enunit); - u.dudes[1] = "Seraphim"; - u.dudes_num[1] = 200; - u.dudes[2] = "Dominion"; - u.dudes_num[2] = 200; - u.dudes[3] = "Immolator"; - u.dudes_num[3] = 50; - u.dudes[4] = "Exorcist"; - u.dudes_num[4] = 20; - u.dudes[5] = "Follower"; - u.dudes_num[5] = 2000; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Follower"; - u.dudes_num[1] = 2000; - u.dudes[2] = "Sister Repentia"; - u.dudes_num[2] = 500; - u.dudes[3] = "Arco-Flagellent"; - u.dudes_num[3] = 250; - u.dudes[4] = "Penitent Engine"; - u.dudes_num[4] = 30; - u.dudes[5] = "Mistress"; - u.dudes_num[5] = 50; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Follower"; - u.dudes_num[1] = 3000; - } -} - -// ** Orks Forces ** -if (enemy = 7) { - // u=instance_create(-10,240,obj_enunit); - // u.dudes[1]="Stormboy";u.dudes_num[1]=2500;u.flank=1;// enemies[1]=u.dudes[1]; - - // Small Ork Group - if (threat = 1) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "100"; - - u.dudes[1] = "Meganob"; - u.dudes_num[1] = 1; - enemies[1] = u.dudes[1]; - u.dudes[2] = "Slugga Boy"; - u.dudes_num[2] = 50; - enemies[2] = u.dudes[2]; - u.dudes[3] = "Shoota Boy"; - u.dudes_num[3] = 50; - enemies[3] = u.dudes[3]; - // Spawn Leader - if (leader = 1) { - u.dudes[4] = "Leader"; - u.dudes_num[4] = 1; - enemies[4] = 1; - enemies_num[4] = 1; - } - } - // Medium Ork Group - if (threat = 2) { - u = instance_nearest(xxx + 10, 240, obj_enunit); - enemy_dudes = "nearly 350"; - - u.dudes[1] = "Slugga Boy"; - u.dudes_num[1] = 50; - u.dudes[2] = "Shoota Boy"; - u.dudes_num[2] = 50; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Minor Warboss"; - u.dudes_num[1] = 1; - u.dudes[2] = "Meganob"; - u.dudes_num[2] = 5; - u.dudes[3] = "Slugga Boy"; - u.dudes_num[3] = 70; - u.dudes[4] = "Ard Boy"; - u.dudes_num[4] = 70; - u.dudes[5] = "Shoota Boy"; - u.dudes_num[5] = 100; - // Spawn Leader - if (leader = 1) { - u.dudes[1] = "Leader"; - u.dudes_num[1] = 1; - enemies[1] = 1; - enemies_num[1] = 1; - } - } - // Large Ork Group - if (threat = 3) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "over a 1000"; - - u.dudes[1] = "Slugga Boy"; - u.dudes_num[1] = 300; - u.dudes[2] = "Ard Boy"; - u.dudes_num[2] = 150; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Deff Dread"; - u.dudes_num[1] = 9; - u.dudes[2] = "Battlewagon"; - u.dudes_num[2] = 6; - u.dudes[3] = "Mekboy"; - u.dudes_num[3] = 1; - u.dudes[4] = "Flash Git"; - u.dudes_num[4] = 12; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Warboss"; - u.dudes_num[1] = 1; - // Spawn Leader - if (leader = 1) { - u.dudes[1] = "Leader"; - u.dudes_num[1] = 1; - enemies[1] = 1; - enemies_num[1] = 1; - } - u.dudes[2] = "Meganob"; - u.dudes_num[2] = 10; - u.dudes[3] = "Slugga Boy"; - u.dudes_num[3] = 100; - u.dudes[4] = "Ard Boy"; - u.dudes_num[4] = 150; - u.dudes[5] = "Shoota Boy"; - u.dudes_num[5] = 350; - } - // Small Ork Army - if (threat = 4) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "a green tide of over 3600"; - - u.dudes[1] = "Slugga Boy"; - u.dudes_num[1] = 600; - u.dudes[2] = "Ard Boy"; - u.dudes_num[2] = 300; - u.dudes[3] = "Gretchin"; - u.dudes_num[3] = 1000; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Deff Dread"; - u.dudes_num[1] = 21; - u.dudes[2] = "Battlewagon"; - u.dudes_num[2] = 12; - u.dudes[3] = "Mekboy"; - u.dudes_num[3] = 3; - u.dudes[4] = "Flash Git"; - u.dudes_num[4] = 30; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Warboss"; - u.dudes_num[1] = 1; - // Spawn Leader - if (leader = 1) { - u.dudes[1] = "Leader"; - u.dudes_num[1] = 1; - enemies[1] = 1; - enemies_num[1] = 1; - } - u.dudes[2] = "Meganob"; - u.dudes_num[2] = 30; - u.dudes[3] = "Slugga Boy"; - u.dudes_num[3] = 300; - u.dudes[4] = "Ard Boy"; - u.dudes_num[4] = 450; - u.dudes[5] = "Shoota Boy"; - u.dudes_num[5] = 1000; - } - // Medium Ork Army - if (threat = 5) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "a green tide of over 7000"; - - u.dudes[1] = "Slugga Boy"; - u.dudes_num[1] = 1200; - u.dudes[2] = "Ard Boy"; - u.dudes_num[2] = 600; - u.dudes[3] = "Gretchin"; - u.dudes_num[3] = 2000; - u.dudes[4] = "Tank Busta"; - u.dudes_num[4] = 100; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Deff Dread"; - u.dudes_num[1] = 40; - u.dudes[2] = "Battlewagon"; - u.dudes_num[2] = 18; - u.dudes[3] = "Mekboy"; - u.dudes_num[3] = 6; - u.dudes[4] = "Flash Git"; - u.dudes_num[4] = 50; - u.dudes[5] = "Kommando"; - u.dudes_num[5] = 20; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Warboss"; - u.dudes_num[1] = 1; - // Spawn Leader - if (leader = 1) { - u.dudes[1] = "Leader"; - u.dudes_num[1] = 1; - enemies[1] = 1; - enemies_num[1] = 1; - } - u.dudes[2] = "Meganob"; - u.dudes_num[2] = 80; - u.dudes[3] = "Slugga Boy"; - u.dudes_num[3] = 600; - u.dudes[4] = "Ard Boy"; - u.dudes_num[4] = 900; - u.dudes[5] = "Shoota Boy"; - u.dudes_num[5] = 2000; - } - // Large Ork Army - if (threat = 6) { - enemy_dudes = "a WAAAAGH!! of 11000"; - - u = instance_nearest(xxx, 240, obj_enunit); - u.dudes[1] = "Mekboy"; - u.dudes_num[1] = 6; - u.dudes[2] = "Flash Git"; - u.dudes_num[2] = 50; - u.dudes[3] = "Kommando"; - u.dudes_num[3] = 20; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Slugga Boy"; - u.dudes_num[1] = 1200; - u.dudes[2] = "Ard Boy"; - u.dudes_num[2] = 600; - u.dudes[3] = "Gretchin"; - u.dudes_num[3] = 2000; - u.dudes[4] = "Tank Busta"; - u.dudes_num[4] = 100; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Mekboy"; - u.dudes_num[1] = 6; - u.dudes[2] = "Flash Git"; - u.dudes_num[2] = 50; - u.dudes[3] = "Kommando"; - u.dudes_num[3] = 20; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 30, 240, obj_enunit); - u.dudes[1] = "Big Warboss"; - u.dudes_num[1] = 1; - // Spawn Leader - if (leader = 1) { - u.dudes[1] = "Leader"; - u.dudes_num[1] = 1; - enemies[1] = 1; - enemies_num[1] = 1; - } - u.dudes[2] = "Meganob"; - u.dudes_num[2] = 80; - u.dudes[3] = "Slugga Boy"; - u.dudes_num[3] = 600; - u.dudes[4] = "Ard Boy"; - u.dudes_num[4] = 900; - u.dudes[5] = "Shoota Boy"; - u.dudes_num[5] = 2000; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 40, 240, obj_enunit); - u.dudes[1] = "Deff Dread"; - u.dudes_num[1] = 36; - u.dudes[2] = "Battlewagon"; - u.dudes_num[2] = 220; - instance_deactivate_object(u); - } -} - -// ** Tau Forces ** -if (enemy = 8) { - // Small Tau Group - if (threat = 1) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "11"; - - u.dudes[1] = "XV8 Crisis"; - u.dudes_num[1] = 1; - u.dudes[2] = "Fire Warrior"; - u.dudes_num[2] = 20; - u.dudes[3] = "Kroot"; - u.dudes_num[3] = 20; - enemies[3] = u.dudes[3]; - } - // Medium Tau Group - if (threat = 2) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "100"; - - u.dudes[1] = "XV8 Commander"; - u.dudes_num[1] = 1; - u.dudes[2] = "XV8 Bodyguard"; - u.dudes_num[2] = 6; - u.dudes[3] = "Shield Drone"; - u.dudes_num[3] = 4; - u.dudes[4] = "XV88 Broadside"; - u.dudes_num[4] = 3; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Fire Warrior"; - u.dudes_num[1] = 60; - u.dudes[2] = "Kroot"; - u.dudes_num[2] = 60; - u.dudes[3] = "Pathfinder"; - u.dudes_num[3] = 20; - u.dudes[4] = "XV8 Crisis"; - u.dudes_num[4] = 12; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Hammerhead"; - u.dudes_num[1] = 2; - u.dudes[2] = "Devilfish"; - u.dudes_num[2] = 4; - - u = instance_create(0, 240, obj_enunit); - u.dudes[1] = "XV25 Stealthsuit"; - u.dudes_num[1] = 6; - u.flank = 1; - } - // Large Tau Group - if (threat = 3) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "100"; - - u.dudes[1] = "XV8 Commander"; - u.dudes_num[1] = 1; - u.dudes[2] = "XV8 Bodyguard"; - u.dudes_num[2] = 9; - u.dudes[3] = "Shield Drone"; - u.dudes_num[3] = 8; - u.dudes[4] = "XV88 Broadside"; - u.dudes_num[4] = 6; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Fire Warrior"; - u.dudes_num[1] = 200; - u.dudes[2] = "Kroot"; - u.dudes_num[2] = 150; - u.dudes[3] = "Pathfinder"; - u.dudes_num[3] = 40; - u.dudes[4] = "XV8 Crisis"; - u.dudes_num[4] = 24; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Hammerhead"; - u.dudes_num[1] = 5; - u.dudes[2] = "Devilfish"; - u.dudes_num[2] = 10; - - u = instance_create(0, 240, obj_enunit); - u.dudes[1] = "XV25 Stealthsuit"; - u.dudes_num[1] = 12; - u.flank = 1; - } - // Small Tau Army - if (threat = 4) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "100"; - - u.dudes[1] = "XV8 Commander"; - u.dudes_num[1] = 1; - u.dudes[2] = "XV8 Bodyguard"; - u.dudes_num[2] = 9; - u.dudes[3] = "Shield Drone"; - u.dudes_num[3] = 8; - u.dudes[4] = "XV88 Broadside"; - u.dudes_num[4] = 12; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Fire Warrior"; - u.dudes_num[1] = 800; - u.dudes[2] = "Kroot"; - u.dudes_num[2] = 500; - u.dudes[3] = "Pathfinder"; - u.dudes_num[3] = 60; - u.dudes[4] = "XV8 Crisis"; - u.dudes_num[4] = 48; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Hammerhead"; - u.dudes_num[1] = 40; - u.dudes[2] = "Devilfish"; - u.dudes_num[2] = 15; - u.dudes[3] = "XV8 Crisis"; - u.dudes_num[3] = 48; - - u = instance_create(0, 240, obj_enunit); - u.dudes[1] = "XV25 Stealthsuit"; - u.dudes_num[1] = 12; - u.flank = 1; - u.dudes[2] = "XV8 (Brightknife)"; - u.dudes_num[2] = 6; - u.flank = 1; - } - // Medium Tau Army - if (threat = 5) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "4000"; - - u.dudes[1] = "XV8 Commander"; - u.dudes_num[1] = 2; - u.dudes[2] = "XV8 Bodyguard"; - u.dudes_num[2] = 18; - u.dudes[3] = "Shield Drone"; - u.dudes_num[3] = 20; - u.dudes[4] = "XV88 Broadside"; - u.dudes_num[4] = 24; - u.dudes[5] = "Vespid"; - u.dudes_num[4] = 30; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Fire Warrior"; - u.dudes_num[1] = 1000; - u.dudes[2] = "Kroot"; - u.dudes_num[2] = 700; - u.dudes[3] = "Pathfinder"; - u.dudes_num[3] = 100; - u.dudes[4] = "XV8 Crisis"; - u.dudes_num[4] = 80; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Fire Warrior"; - u.dudes_num[1] = 1000; - u.dudes[2] = "Kroot"; - u.dudes_num[2] = 700; - u.dudes[3] = "Pathfinder"; - u.dudes_num[3] = 100; - u.dudes[4] = "XV8 Crisis"; - u.dudes_num[4] = 80; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 30, 240, obj_enunit); - u.dudes[1] = "Hammerhead"; - u.dudes_num[1] = 40; - u.dudes[2] = "Devilfish"; - u.dudes_num[2] = 40; - u.dudes[3] = "XV8 Crisis"; - u.dudes_num[3] = 48; - - u = instance_create(0, 240, obj_enunit); - u.dudes[1] = "XV25 Stealthsuit"; - u.dudes_num[1] = 12; - u.flank = 1; - u.dudes[2] = "XV8 (Brightknife)"; - u.dudes_num[2] = 18; - u.flank = 1; - } - // Large Tau Army - if (threat = 6) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "6000"; - - u.dudes[1] = "XV8 Commander"; - u.dudes_num[1] = 2; - u.dudes[2] = "XV8 Bodyguard"; - u.dudes_num[2] = 18; - u.dudes[3] = "Shield Drone"; - u.dudes_num[3] = 20; - u.dudes[4] = "XV88 Broadside"; - u.dudes_num[4] = 36; - u.dudes[5] = "Vespid"; - u.dudes_num[4] = 60; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Fire Warrior"; - u.dudes_num[1] = 1000; - u.dudes[2] = "Kroot"; - u.dudes_num[2] = 700; - u.dudes[3] = "Pathfinder"; - u.dudes_num[3] = 100; - u.dudes[4] = "XV8 Crisis"; - u.dudes_num[4] = 80; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Fire Warrior"; - u.dudes_num[1] = 1000; - u.dudes[2] = "Kroot"; - u.dudes_num[2] = 700; - u.dudes[3] = "Pathfinder"; - u.dudes_num[3] = 100; - u.dudes[4] = "XV8 Crisis"; - u.dudes_num[4] = 80; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 30, 240, obj_enunit); - u.dudes[1] = "Fire Warrior"; - u.dudes_num[1] = 1000; - u.dudes[2] = "Kroot"; - u.dudes_num[2] = 700; - u.dudes[3] = "Pathfinder"; - u.dudes_num[3] = 100; - u.dudes[4] = "XV8 Crisis"; - u.dudes_num[4] = 80; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 40, 240, obj_enunit); - u.dudes[1] = "Hammerhead"; - u.dudes_num[1] = 40; - u.dudes[2] = "Devilfish"; - u.dudes_num[2] = 80; - u.dudes[3] = "XV8 Crisis"; - u.dudes_num[3] = 80; - - u = instance_create(0, 240, obj_enunit); - u.dudes[1] = "XV25 Stealthsuit"; - u.dudes_num[1] = 12; - u.flank = 1; - u.dudes[2] = "XV8 (Brightknife)"; - u.dudes_num[2] = 24; - u.flank = 1; - } -} - -// ** Tyranid Forces ** -// Tyranid story event -if (enemy = 9) and(battle_special = "tyranid_org") { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "81"; - u.dudes[1] = "Termagaunt"; - u.dudes_num[1] = 40; - u.dudes[2] = "Hormagaunt"; - u.dudes_num[2] = 40; - // u.dudes[3]="Lictor";u.dudes_num[3]=1; -} -if (enemy = 9) and(battle_special != "tyranid_org") { - // Small Genestealer Group - if (threat = 1) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "11"; - - u.dudes[1] = "Genestealer"; - u.dudes_num[1] = 10; - - u = instance_create(0, 240, obj_enunit); - u.dudes[1] = "Lictor"; - u.dudes_num[1] = 1; - u.flank = 1; - } - // Medium Genestealer Group - if (threat = 2) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "100"; - - u.dudes[1] = "Genestealer Patriarch"; - u.dudes_num[1] = 1; - u.dudes[2] = "Genestealer"; - u.dudes_num[2] = 30; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Cultist"; - u.dudes_num[1] = 150; - - u = instance_create(0, 240, obj_enunit); - u.dudes[1] = "Lictor"; - u.dudes_num[1] = 1; - u.flank = 1; - } - // Large Genestealer Group - if (threat = 3) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "100"; - - u.dudes[1] = "Genestealer Patriarch"; - u.dudes_num[1] = 1; - u.dudes[2] = "Genestealer"; - u.dudes_num[2] = 120; - u.dudes[3] = "Armoured Limousine"; - u.dudes_num[3] = 20; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Cultist"; - u.dudes_num[1] = 600; - - u = instance_create(0, 240, obj_enunit); - u.dudes[1] = "Lictor"; - u.dudes_num[1] = 6; - u.flank = 1; - } - // Small Tyranid Army - if (threat = 4) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "7000"; - - u.dudes[1] = "Hive Tyrant"; - u.dudes_num[1] = 1; - u.dudes[2] = "Tyrant Guard"; - u.dudes_num[2] = 16; - u.dudes[3] = "Tyranid Warrior"; - u.dudes_num[3] = 40; - u.dudes[4] = "Zoanthrope"; - u.dudes_num[4] = 10; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Termagaunt"; - u.dudes_num[1] = 1500; - u.dudes[2] = "Hormagaunt"; - u.dudes_num[2] = 800; - u.dudes[3] = "Carnifex"; - u.dudes_num[3] = 5; - u.dudes[4] = "Tyranid Warrior"; - u.dudes_num[4] = 30; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Termagaunt"; - u.dudes_num[1] = 1500; - u.dudes[2] = "Hormagaunt"; - u.dudes_num[2] = 800; - u.dudes[3] = "Carnifex"; - u.dudes_num[3] = 5; - u.dudes[4] = "Tyranid Warrior"; - u.dudes_num[4] = 30; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 30, 240, obj_enunit); - u.dudes[1] = "Termagaunt"; - u.dudes_num[1] = 1500; - u.dudes[2] = "Hormagaunt"; - u.dudes_num[2] = 800; - u.dudes[3] = "Carnifex"; - u.dudes_num[3] = 5; - u.dudes[4] = "Tyranid Warrior"; - u.dudes_num[4] = 30; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 40, 240, obj_enunit); - u.dudes[1] = "Carnifex"; - u.dudes_num[1] = 6; - - u = instance_create(0, 240, obj_enunit); - u.dudes[1] = "Lictor"; - u.dudes_num[1] = 15; - u.flank = 1; - } - // Medium Tyranid Army - if (threat = 5) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "15000"; - - u.dudes[1] = "Hive Tyrant"; - u.dudes_num[1] = 2; - u.dudes[2] = "Tyrant Guard"; - u.dudes_num[2] = 32; - u.dudes[3] = "Tyranid Warrior"; - u.dudes_num[3] = 80; - u.dudes[4] = "Zoanthrope"; - u.dudes_num[4] = 20; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Termagaunt"; - u.dudes_num[1] = 3300; - u.dudes[2] = "Hormagaunt"; - u.dudes_num[2] = 1600; - u.dudes[3] = "Carnifex"; - u.dudes_num[3] = 10; - u.dudes[4] = "Tyranid Warrior"; - u.dudes_num[4] = 30; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Termagaunt"; - u.dudes_num[1] = 3300; - u.dudes[2] = "Hormagaunt"; - u.dudes_num[2] = 1600; - u.dudes[3] = "Carnifex"; - u.dudes_num[3] = 10; - u.dudes[4] = "Tyranid Warrior"; - u.dudes_num[4] = 30; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 30, 240, obj_enunit); - u.dudes[1] = "Termagaunt"; - u.dudes_num[1] = 3300; - u.dudes[2] = "Hormagaunt"; - u.dudes_num[2] = 1600; - u.dudes[3] = "Carnifex"; - u.dudes_num[3] = 10; - u.dudes[4] = "Tyranid Warrior"; - u.dudes_num[4] = 60; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 40, 240, obj_enunit); - u.dudes[1] = "Carnifex"; - u.dudes_num[1] = 20; - u.dudes[2] = "Zoanthrope"; - u.dudes_num[2] = 10; - - u = instance_create(0, 240, obj_enunit); - u.dudes[1] = "Lictor"; - u.dudes_num[1] = 20; - u.flank = 1; - } - // Large Tyranid Army - if (threat = 6) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "45000"; - - u.dudes[1] = "Hive Tyrant"; - u.dudes_num[1] = 4; - u.dudes[2] = "Tyrant Guard"; - u.dudes_num[2] = 64; - u.dudes[3] = "Tyranid Warrior"; - u.dudes_num[3] = 160; - u.dudes[4] = "Zoanthrope"; - u.dudes_num[4] = 40; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Termagaunt"; - u.dudes_num[1] = 10000; - u.dudes[2] = "Hormagaunt"; - u.dudes_num[2] = 4000; - u.dudes[3] = "Carnifex"; - u.dudes_num[3] = 15; - u.dudes[4] = "Tyranid Warrior"; - u.dudes_num[4] = 90; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Termagaunt"; - u.dudes_num[1] = 10000; - u.dudes[2] = "Hormagaunt"; - u.dudes_num[2] = 4000; - u.dudes[3] = "Carnifex"; - u.dudes_num[3] = 15; - u.dudes[4] = "Tyranid Warrior"; - u.dudes_num[4] = 90; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 30, 240, obj_enunit); - u.dudes[1] = "Termagaunt"; - u.dudes_num[1] = 10000; - u.dudes[2] = "Hormagaunt"; - u.dudes_num[2] = 4000; - u.dudes[3] = "Carnifex"; - u.dudes_num[3] = 15; - u.dudes[4] = "Tyranid Warrior"; - u.dudes_num[4] = 90; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 40, 240, obj_enunit); - u.dudes[1] = "Carnifex"; - u.dudes_num[1] = 40; - u.dudes[2] = "Zoanthrope"; - u.dudes_num[2] = 20; - - u = instance_create(0, 240, obj_enunit); - u.dudes[1] = "Lictor"; - u.dudes_num[1] = 40; - u.flank = 1; - } -} - -// ** Chaos Forces ** -if (enemy = 10) and(battle_special != "ship_demon") and(battle_special != "fallen1") and(battle_special != "fallen2") and(battle_special != "WL10_reveal") and(battle_special != "WL10_later") and(string_count("cs_meeting_battle", battle_special) = 0) { - // u=instance_create(-10,240,obj_enunit); - // u.dudes[1]="Stormboy";u.dudes_num[1]=2500;u.flank=1;// enemies[1]=u.dudes[1]; - // Small Chaos Cult Group - if (threat = 1) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "150"; - - u.dudes[1] = "Arch Heretic"; - u.dudes_num[1] = 1; - enemies[1] = u.dudes[1]; - u.dudes[2] = "Cultist Elite"; - u.dudes_num[2] = 30; - enemies[2] = u.dudes[2]; - u.dudes[3] = "Cultist"; - u.dudes_num[3] = 120; - enemies[3] = u.dudes[3]; - } - // Medium Chaos Cult Group - if (threat = 2) { - u = instance_nearest(xxx + 10, 240, obj_enunit); - enemy_dudes = "nearly 400"; - - u.dudes[1] = "Arch Heretic"; - u.dudes_num[1] = 1; - u.dudes[2] = "Cultist Elite"; - u.dudes_num[2] = 50; - u.dudes[3] = "Cultist"; - u.dudes_num[3] = 300; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Cultist"; - u.dudes_num[1] = 50; - u.dudes[2] = "Technical"; - u.dudes_num[2] = 6; - } - // Large Chaos Cult Group - if (threat = 3) { - u = instance_nearest(xxx + 20, 240, obj_enunit); - enemy_dudes = "1000"; - - u.dudes[1] = "Arch Heretic"; - u.dudes_num[1] = 1; - u.dudes[2] = "Cultist Elite"; - u.dudes_num[2] = 100; - u.dudes[3] = "Mutants"; - u.dudes_num[3] = 200; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Technical"; - u.dudes_num[1] = 9; - u.dudes[2] = "Chaos Leman Russ"; - u.dudes_num[2] = 6; - u.dudes[3] = "Cultist"; - u.dudes_num[3] = 200; - instance_deactivate_object(u); - - u = instance_nearest(xxx, 240, obj_enunit); - u.dudes[1] = "Cultist"; - u.dudes_num[1] = 200; - u.dudes[2] = "Mutant"; - u.dudes_num[2] = 300; - } - // Small Chaos Cult Army - if (threat = 4) { - u = instance_nearest(xxx + 20, 240, obj_enunit); - enemy_dudes = "4000"; - - u.dudes[1] = "Arch Heretic"; - u.dudes_num[1] = 1; - u.dudes[2] = "Cultist Elite"; - u.dudes_num[2] = 400; - u.dudes[3] = "Chaos Basilisk"; - u.dudes_num[3] = 6; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Mutant"; - u.dudes_num[1] = 1500; - u.dudes[2] = "Chaos Leman Russ"; - u.dudes_num[2] = 21; - u.dudes[3] = "Defiler"; - u.dudes_num[3] = 5; - instance_deactivate_object(u); - - u = instance_nearest(xxx, 240, obj_enunit); - u.dudes[1] = "Cultist"; - u.dudes_num[1] = 600; - u.dudes[2] = "Mutant"; - u.dudes_num[2] = 1500; - } - // Medium Chaos Cult Army - if (threat = 5) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "8000"; - - u.dudes[1] = "Daemonhost"; - u.dudes_num[1] = 1; - u.dudes[2] = "Chaos Terminator"; - u.dudes_num[2] = 10; - u.dudes[3] = "Cultist Elite"; - u.dudes_num[3] = 400; - u.dudes[4] = "Chaos Basilisk"; - u.dudes_num[4] = 9; - - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Chaos Leman Russ"; - u.dudes_num[1] = 40; - u.dudes[2] = "Defiler"; - u.dudes_num[2] = 12; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Mutant"; - u.dudes_num[1] = 2000; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 30, 240, obj_enunit); - u.dudes[1] = "Cultist"; - u.dudes_num[1] = 1000; - u.dudes[2] = "Mutant"; - u.dudes_num[2] = 2000; - instance_deactivate_object(u); - - u = instance_nearest(xxx, 40, obj_enunit); - u.dudes[1] = "Cultist"; - u.dudes_num[1] = 1000; - u.dudes[2] = "Mutant"; - u.dudes_num[2] = 2000; - instance_deactivate_object(u); - } - // Large Chaos Cult Army - if (threat = 6) { - u = instance_nearest(xxx + 40, 240, obj_enunit); - enemy_dudes = "12000"; - - u.dudes[1] = "Greater Daemon of " + string(choose("Slaanesh", "Khorne", "Nurgle", "Tzeentch,", "Tzeentch")); - u.dudes_num[1] = 2; - u.dudes[2] = "Chaos Terminator"; - u.dudes_num[2] = 20; - u.dudes[3] = "Chaos Basilisk"; - u.dudes_num[3] = 18; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Chaos Leman Russ"; - u.dudes_num[1] = 80; - u.dudes[2] = "Defiler"; - u.dudes_num[2] = 20; - u.dudes[3] = "Vindicator"; - u.dudes_num[3] = 10; - instance_deactivate_object(u); - - u = instance_nearest(xxx, 240, obj_enunit); - u.dudes[1] = "Mutant"; - u.dudes_num[1] = 8000; - u.dudes[2] = "Cultist Elite"; - u.dudes_num[2] = 4000; - u.dudes[3] = "Havoc"; - u.dudes_num[3] = 50; - u.dudes[4] = "Chaos Space Marine"; - u.dudes_num[4] = 50; - instance_deactivate_object(u); - } - // Chaos Daemons Army - if (threat = 7) { - u = instance_nearest(xxx + 40, 240, obj_enunit); - u.neww = 1; - enemy_dudes = ""; - - u.dudes[1] = "Greater Daemon of Slaanesh"; - u.dudes_num[1] = 1; - u.dudes[2] = "Greater Daemon of Slaanesh"; - u.dudes_num[2] = 1; - // u.dudes[3]="Greater Daemon of Slaanesh";u.dudes_num[3]=1; - u.dudes[4] = "Greater Daemon of Tzeentch"; - u.dudes_num[4] = 1; - u.dudes[5] = "Greater Daemon of Tzeentch"; - u.dudes_num[5] = 1; - // u.dudes[6]="Greater Daemon of Tzeentch";u.dudes_num[6]=1; - u.dudes[7] = "Soul Grinder"; - u.dudes_num[7] = 3; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 30, 240, obj_enunit); - u.neww = 1; - u.dudes[1] = "Greater Daemon of Khorne"; - u.dudes_num[1] = 1; - u.dudes[2] = "Greater Daemon of Khorne"; - u.dudes_num[2] = 1; - // u.dudes[3]="Greater Daemon of Khorne";u.dudes_num[3]=1; - u.dudes[4] = "Greater Daemon of Nurgle"; - u.dudes_num[4] = 1; - u.dudes[5] = "Greater Daemon of Nurgle"; - u.dudes_num[5] = 1; - // u.dudes[6]="Greater Daemon of Nurgle";u.dudes_num[6]=1; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Bloodletter"; - u.dudes_num[1] = 800; - u.dudes[2] = "Daemonette"; - u.dudes_num[2] = 800; - u.dudes[3] = "Plaguebearer"; - u.dudes_num[3] = 800; - u.dudes[4] = "Pink Horror"; - u.dudes_num[4] = 800; - u.dudes[5] = "Maulerfiend"; - u.dudes_num[5] = 3; - instance_deactivate_object(u); - - // u=instance_nearest(xxx+10,240,obj_enunit); - // u.dudes[1]="Mutant";u.dudes_num[1]=6000; - // instance_deactivate_object(u); - } -} - -// ** Chaos Space Marines Forces ** -if (enemy = 11) and(battle_special != "world_eaters") and(string_count("cs_meeting_battle", battle_special) = 0) { - // Small CSM Group - if (threat = 1) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "5"; - - u.dudes[1] = "Chaos Space Marine"; - u.dudes_num[1] = 5; - enemies[1] = u.dudes[1]; - u.dudes[2] = "Cultist"; - u.dudes_num[2] = 30; - enemies[2] = u.dudes[2]; - } - // Medium CSM Group - if (threat = 2) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "41"; - - u.dudes[1] = "Chaos Chosen"; - u.dudes_num[1] = 1; - u.dudes[2] = "Chaos Space Marine"; - u.dudes_num[2] = 35; - u.dudes[3] = "Havoc"; - u.dudes_num[3] = 5; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Cultist"; - u.dudes_num[1] = 100; - u.dudes[2] = "Rhino"; - u.dudes_num[2] = 2; - u.dudes[3] = "Predator"; - u.dudes_num[3] = 4; - } - // Large CSM Group - if (threat = 3) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "over 100"; - - u.dudes[1] = "Chaos Lord"; - u.dudes_num[1] = 1; - u.dudes[2] = "Chaos Sorcerer"; - u.dudes_num[2] = 1; - u.dudes[3] = "Chaos Chosen"; - u.dudes_num[3] = 10; - u.dudes[4] = "Chaos Space Marine"; - u.dudes_num[4] = 100; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Rhino"; - u.dudes_num[1] = 6; - u.dudes[2] = "Defiler"; - u.dudes_num[2] = 2; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Cultist"; - u.dudes_num[1] = 300; - u.dudes[2] = "Helbrute"; - u.dudes_num[2] = 3; - u.dudes[3] = "Predator"; - u.dudes_num[3] = 6; - u.dudes[4] = "Land Raider"; - u.dudes_num[4] = 2; - } - // Small CSM Army - if (threat = 4) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "over 700"; - - u.dudes[1] = "Chaos Lord"; - u.dudes_num[1] = 1; - u.dudes[2] = "Chaos Sorcerer"; - u.dudes_num[2] = 2; - u.dudes[3] = "Chaos Chosen"; - u.dudes_num[3] = 10; - // u.dudes[4]="Chaos Terminator";u.dudes_num[4]=5; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Chaos Space Marine"; - u.dudes_num[1] = 250; - u.dudes[2] = "Havoc"; - u.dudes_num[2] = 20; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Rhino"; - u.dudes_num[1] = 15; - u.dudes[2] = "Defiler"; - u.dudes_num[2] = 4; - u.dudes[3] = "Heldrake"; - u.dudes_num[3] = 1; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 30, 240, obj_enunit); - u.dudes[1] = "Cultist"; - u.dudes_num[1] = 600; - u.dudes[2] = "Helbrute"; - u.dudes_num[2] = 3; - u.dudes[3] = "Predator"; - u.dudes_num[3] = 6; - u.dudes[4] = "Vindicator"; - u.dudes_num[4] = 3; - u.dudes[5] = "Land Raider"; - u.dudes_num[5] = 2; - } - // Medium CSM Army - if (threat = 5) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "over 1200"; - - u.dudes[1] = "Chaos Lord"; - u.dudes_num[1] = 1; - u.dudes[2] = "Chaos Sorcerer"; - u.dudes_num[2] = 3; - u.dudes[3] = "Chaos Chosen"; - u.dudes_num[3] = 20; - u.dudes[4] = "Obliterator"; - u.dudes_num[4] = 6; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Chaos Space Marine"; - u.dudes_num[1] = 600; - u.dudes[2] = "Havoc"; - u.dudes_num[2] = 40; - u.dudes[3] = "Raptor"; - u.dudes_num[3] = 40; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Rhino"; - u.dudes_num[1] = 25; - u.dudes[2] = "Defiler"; - u.dudes_num[2] = 8; - u.dudes[3] = "Heldrake"; - u.dudes_num[3] = 3; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 30, 240, obj_enunit); - u.dudes[1] = "Cultist"; - u.dudes_num[1] = 600; - u.dudes[2] = "Helbrute"; - u.dudes_num[2] = 5; - u.dudes[3] = "Predator"; - u.dudes_num[3] = 10; - u.dudes[4] = "Vindicator"; - u.dudes_num[4] = 6; - u.dudes[5] = "Land Raider"; - u.dudes_num[5] = 3; - u.dudes[6] = "Possessed"; - u.dudes_num[6] = 30; - - u = instance_create(0, 240, obj_enunit); - u.dudes[1] = "Chaos Terminator"; - u.dudes_num[1] = 10; - u.flank = 1; - } - // Large CSM Army - if (threat = 6) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "2000"; - - u.dudes[1] = "Chaos Lord"; - u.dudes_num[1] = 2; - u.dudes[2] = "Chaos Sorcerer"; - u.dudes_num[2] = 10; - u.dudes[3] = "Chaos Chosen"; - u.dudes_num[3] = 40; - u.dudes[4] = "Obliterator"; - u.dudes_num[4] = 12; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Chaos Space Marine"; - u.dudes_num[1] = 800; - u.dudes[2] = "Havoc"; - u.dudes_num[2] = 50; - u.dudes[3] = "Raptor"; - u.dudes_num[3] = 50; - u.dudes[4] = choose("Noise Marine", "Plague Marine", "Khorne Berzerker", "Rubric Marine"); - u.dudes_num[3] = 50; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Rhino"; - u.dudes_num[1] = 30; - u.dudes[2] = "Defiler"; - u.dudes_num[2] = 10; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 30, 240, obj_enunit); - u.dudes[1] = "Cultist"; - u.dudes_num[1] = 1200; - u.dudes[2] = "Helbrute"; - u.dudes_num[2] = 10; - u.dudes[3] = "Predator"; - u.dudes_num[3] = 20; - u.dudes[4] = "Vindicator"; - u.dudes_num[4] = 15; - u.dudes[5] = "Land Raider"; - u.dudes_num[5] = 6; - u.dudes[6] = "Possessed"; - u.dudes_num[6] = 60; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 40, 240, obj_enunit); - u.dudes[1] = "Heldrake"; - u.dudes_num[1] = 6; - u.flank = 1; - u.flyer = 1; - - u = instance_create(0, 240, obj_enunit); - u.dudes[1] = "Chaos Terminator"; - u.dudes_num[1] = 20; - u.flank = 1; - } -} - -// ** World Eaters Forces ** -if (enemy = 11) and(battle_special = "world_eaters") { - // Small WE Group - if (threat = 1) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "20"; - - u.dudes[1] = "Khorne Berzerker"; - u.dudes_num[1] = 15; - enemies[1] = u.dudes[1]; - // Spawn Leader - if (obj_controller.faction_defeated[10] = 0) { - u.dudes[2] = "Leader"; - u.dudes_num[2] = 1; - } - u.dudes[3] = "World Eaters Veteran"; - u.dudes_num[3] = 5; - } - // Medium WE Group - if (threat = 2) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "135"; - - u.dudes[1] = "Chaos Chosen"; - u.dudes_num[1] = 1; - // Spawn Leader - if (obj_controller.faction_defeated[10] = 0) then u.dudes[1] = "Leader"; - u.dudes[2] = "Khorne Berzerker"; - u.dudes_num[2] = 35; - u.dudes[3] = "World Eaters Veteran"; - u.dudes_num[3] = 5; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "World Eater"; - u.dudes_num[1] = 100; - u.dudes[2] = "Rhino"; - u.dudes_num[2] = 2; - u.dudes[3] = "Vindicator"; - u.dudes_num[3] = 4; - } - // Large WE Group - if (threat = 3) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "over 200"; - - u.dudes[1] = "Chaos Chosen"; - u.dudes_num[1] = 1; - // Spawn Leader - if (obj_controller.faction_defeated[10] = 0) then u.dudes[1] = "Leader"; - u.dudes[2] = "Greater Daemon of Khorne"; - u.dudes_num[2] = 1; - u.dudes[3] = "World Eater Terminator"; - u.dudes_num[3] = 10; - u.dudes[4] = "World Eater"; - u.dudes_num[4] = 100; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Rhino"; - u.dudes_num[1] = 6; - u.dudes[2] = "Defiler"; - u.dudes_num[2] = 2; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Khorne Berzerker"; - u.dudes_num[1] = 100; - u.dudes[2] = "Helbrute"; - u.dudes_num[2] = 5; - u.dudes[3] = "Vindicator"; - u.dudes_num[3] = 6; - u.dudes[4] = "Land Raider"; - u.dudes_num[4] = 4; - } - // Small WE Army - if (threat = 4) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "over 300"; - - u.dudes[1] = "Chaos Chosen"; - u.dudes_num[1] = 1; - // Spawn Leader - if (obj_controller.faction_defeated[10] = 0) then u.dudes[1] = "Leader"; - u.dudes[2] = "Greater Daemon of Khorne"; - u.dudes_num[2] = 2; - u.dudes[3] = "World Eater Terminator"; - u.dudes_num[3] = 10; - // u.dudes[4]="Chaos Terminator";u.dudes_num[4]=5; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "World Eaters Veteran"; - u.dudes_num[1] = 250; - u.dudes[2] = "Possessed"; - u.dudes_num[2] = 20; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Vindicator"; - u.dudes_num[1] = 15; - u.dudes[2] = "Defiler"; - u.dudes_num[2] = 4; - u.dudes[3] = "Heldrake"; - u.dudes_num[3] = 1; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 30, 240, obj_enunit); - u.dudes[1] = "Khorne Berzerker"; - u.dudes_num[1] = 300; - u.dudes[2] = "Helbrute"; - u.dudes_num[2] = 3; - u.dudes[3] = "Predator"; - u.dudes_num[3] = 6; - u.dudes[4] = "Vindicator"; - u.dudes_num[4] = 3; - u.dudes[5] = "Land Raider"; - u.dudes_num[5] = 2; - } - // Medium WE Army - if (threat = 5) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "over 900"; - - u.dudes[1] = "Chaos Chosen"; - u.dudes_num[1] = 1; - // Spawn Leader - if (obj_controller.faction_defeated[10] = 0) then u.dudes[1] = "Leader"; - u.dudes[2] = "Greater Daemon of Khorne"; - u.dudes_num[2] = 3; - u.dudes[3] = "World Eater Terminator"; - u.dudes_num[3] = 20; - u.dudes[4] = "Helbrute"; - u.dudes_num[4] = 6; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "World Eaters Veteran"; - u.dudes_num[1] = 600; - u.dudes[2] = "Possessed"; - u.dudes_num[2] = 40; - u.dudes[3] = "Possessed"; - u.dudes_num[3] = 40; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Vindicator"; - u.dudes_num[1] = 15; - u.dudes[2] = "Defiler"; - u.dudes_num[2] = 8; - u.dudes[3] = "Heldrake"; - u.dudes_num[3] = 3; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 30, 240, obj_enunit); - u.dudes[1] = "Khorne Berzerker"; - u.dudes_num[1] = 300; - u.dudes[2] = "Helbrute"; - u.dudes_num[2] = 5; - u.dudes[3] = "Predator"; - u.dudes_num[3] = 10; - u.dudes[4] = "Vindicator"; - u.dudes_num[4] = 6; - u.dudes[5] = "Land Raider"; - u.dudes_num[5] = 3; - u.dudes[6] = "Possessed"; - u.dudes_num[6] = 30; - - u = instance_create(0, 240, obj_enunit); - u.dudes[1] = "Chaos Terminator"; - u.dudes_num[1] = 10; - u.flank = 1; - } - // Large WE Army - if (threat >= 6) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "1300"; - - u.dudes[1] = "Chaos Lord"; - u.dudes_num[1] = 2; - // Spawn Leader - if (obj_controller.faction_defeated[10] = 0) { - u.dudes[1] = "Leader"; - u.dudes_num[1] = 1; - } - u.dudes[2] = "Greater Daemon of Khorne"; - u.dudes_num[2] = 5; - u.dudes[3] = "World Eaters Terminator"; - u.dudes_num[3] = 40; - u.dudes[4] = "Helbrute"; - u.dudes_num[4] = 10; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "World Eaters Veteran"; - u.dudes_num[1] = 800; - u.dudes[2] = "Possessed"; - u.dudes_num[2] = 50; - u.dudes[3] = "Possessed"; - u.dudes_num[3] = 50; - u.dudes[4] = "Khorne Berzerker"; - u.dudes_num[3] = 50; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Vindicator"; - u.dudes_num[1] = 20; - u.dudes[2] = "Defiler"; - u.dudes_num[2] = 10; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 30, 240, obj_enunit); - u.dudes[1] = "Khorne Berzerker"; - u.dudes_num[1] = 500; - u.dudes[2] = "Helbrute"; - u.dudes_num[2] = 10; - u.dudes[3] = "Predator"; - u.dudes_num[3] = 15; - u.dudes[4] = "Vindicator"; - u.dudes_num[4] = 20; - u.dudes[5] = "Land Raider"; - u.dudes_num[5] = 6; - u.dudes[6] = "Possessed"; - u.dudes_num[6] = 60; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 40, 240, obj_enunit); - u.dudes[1] = "Heldrake"; - u.dudes_num[1] = 6; - u.flank = 1; - u.flyer = 1; - - u = instance_create(0, 240, obj_enunit); - u.dudes[1] = "World Eaters Terminator"; - u.dudes_num[1] = 20; - u.flank = 1; - } -} - -// ** Daemon Forces ** -if (enemy = 12) { - // If we want to have multiple story events regarding specific Chaos Gods, we could name slaa into gods and just check the value? TBD - var slaa = false; - if (battle_special = "ruins_eldar") then slaa = true; - // Small Daemon Group - if (threat = 1) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "5"; - - u.dudes[1] = choose("Bloodletter", "Daemonette", "Plaguebearer", "Pink Horror"); - if (slaa) then u.dudes[1] = "Daemonette"; - u.dudes_num[1] = 5; - enemies[1] = u.dudes[1]; - u.dudes[2] = "Cultist Elite"; - u.dudes_num[2] = 30; - enemies[2] = u.dudes[2]; - } - // Medium Daemon Group - if (threat = 2) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "90"; - - u.dudes[1] = choose("Bloodletter", "Daemonette", "Plaguebearer", "Pink Horror"); - if (slaa) then u.dudes[1] = "Daemonette"; - u.dudes_num[1] = 30; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = choose("Bloodletter", "Daemonette", "Plaguebearer", "Pink Horror"); - if (slaa) then u.dudes[1] = "Daemonette"; - u.dudes_num[1] = 30; - u.dudes[2] = "Defiler"; - u.dudes_num[2] = 1; - } - // Large Daemon Group - if (threat = 3) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "240"; - - u.dudes[1] = "Greater Daemon of " + choose("Tzeentch", "Slaanesh", "Nurgle", "Khorne"); - if (slaa) then u.dudes[1] = "Greater Daemon of Slaanesh"; - u.dudes_num[1] = 1; - u.dudes[2] = "Chaos Sorcerer"; - u.dudes_num[2] = 1; - u.dudes[3] = "Pink Horror"; - if (slaa) then u.dudes[3] = "Daemonette"; - u.dudes_num[3] = 60; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Defiler"; - u.dudes_num[1] = 2; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 20, 240, obj_enunit); - if (slaa) { - u.dudes[1] = "Daemonette"; - u.dudes_num[1] = 240; - } else { - u.dudes[1] = "Bloodletter"; - u.dudes_num[1] = 60; - u.dudes[2] = "Plaguebearer"; - u.dudes_num[2] = 60; - u.dudes[3] = "Daemonette"; - u.dudes_num[3] = 60; - u.dudes[4] = "Maulerfiend"; - u.dudes_num[4] = 2; - } - } - // Small Daemon Army - if (threat = 4) { - u = instance_nearest(xxx + 40, 240, obj_enunit); - enemy_dudes = "400"; - u.neww = 1; - - u.dudes[1] = "Greater Daemon of " + string(choose("Slaanesh", "Tzeentch")); - if (slaa) then u.dudes[1] = "Greater Daemon of Slaanesh"; - u.dudes_num[1] = 1; - u.dudes[2] = "Greater Daemon of " + string(choose("Nurgle", "Khorne")); - if (slaa) then u.dudes[2] = "Greater Daemon of Slaanesh"; - u.dudes_num[2] = 1; - // u.dudes[6]="Greater Daemon of Tzeentch";u.dudes_num[6]=1; - u.dudes[3] = "Soul Grinder"; - u.dudes_num[3] = 1; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 20, 240, obj_enunit); - if (slaa) { - u.dudes[1] = "Daemonette"; - u.dudes_num[1] = 400; - u.dudes[2] = "Maulerfiend"; - u.dudes_num[2] = 2; - } else { - u.dudes[1] = "Bloodletter"; - u.dudes_num[1] = 100; - u.dudes[2] = "Daemonette"; - u.dudes_num[2] = 100; - u.dudes[3] = "Plaguebearer"; - u.dudes_num[3] = 100; - u.dudes[4] = "Pink Horror"; - u.dudes_num[4] = 100; - u.dudes[5] = "Maulerfiend"; - u.dudes_num[5] = 2; - } - instance_deactivate_object(u); - } - // Medium Daemon Army - if (threat = 5) { - u = instance_nearest(xxx + 40, 240, obj_enunit); - enemy_dudes = "1000"; - u.neww = 1; - - u.dudes[1] = "Greater Daemon of " + string(choose("Slaanesh", "Tzeentch", "Khorne", "Nurgle")); - if (slaa) then u.dudes[1] = "Greater Daemon of Slaanesh"; - u.dudes_num[1] = 1; - u.dudes[2] = "Greater Daemon of " + string(choose("Slaanesh", "Tzeentch", "Khorne", "Nurgle")); - if (slaa) then u.dudes[2] = "Greater Daemon of Slaanesh"; - u.dudes_num[2] = 1; - u.dudes[3] = "Greater Daemon of " + string(choose("Slaanesh", "Tzeentch", "Khorne", "Nurgle")); - if (slaa) then u.dudes[3] = "Greater Daemon of Slaanesh"; - u.dudes_num[3] = 1; - u.dudes[4] = "Soul Grinder"; - u.dudes_num[4] = 2; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 20, 240, obj_enunit); - if (slaa) { - u.dudes[1] = "Daemonette"; - u.dudes_num[1] = 1000; - u.dudes[2] = "Maulerfiend"; - u.dudes_num[2] = 2; - } else { - u.dudes[1] = "Bloodletter"; - u.dudes_num[1] = 250; - u.dudes[2] = "Daemonette"; - u.dudes_num[2] = 250; - u.dudes[3] = "Plaguebearer"; - u.dudes_num[3] = 250; - u.dudes[4] = "Pink Horror"; - u.dudes_num[4] = 250; - u.dudes[5] = "Maulerfiend"; - u.dudes_num[5] = 2; - } - instance_deactivate_object(u); - } - // Large Daemon Army - if (threat = 6) { - u = instance_nearest(xxx + 40, 240, obj_enunit); - enemy_dudes = "2000"; - u.neww = 1; - - u.dudes[1] = "Greater Daemon of " + string(choose("Slaanesh", "Tzeentch", "Khorne", "Nurgle")); - if (slaa) then u.dudes[1] = "Greater Daemon of Slaanesh"; - u.dudes_num[1] = 1; - u.dudes[2] = "Greater Daemon of " + string(choose("Slaanesh", "Tzeentch", "Khorne", "Nurgle")); - if (slaa) then u.dudes[2] = "Greater Daemon of Slaanesh"; - u.dudes_num[2] = 1; - u.dudes[3] = "Greater Daemon of " + string(choose("Slaanesh", "Tzeentch", "Khorne", "Nurgle")); - if (slaa) then u.dudes[3] = "Greater Daemon of Slaanesh"; - u.dudes_num[3] = 1; - u.dudes[4] = "Soul Grinder"; - u.dudes_num[4] = 1; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 30, 240, obj_enunit); - u.neww = 1; - u.dudes[1] = "Greater Daemon of " + string(choose("Slaanesh", "Tzeentch", "Khorne", "Nurgle")); - if (slaa) then u.dudes[1] = "Greater Daemon of Slaanesh"; - u.dudes_num[1] = 1; - u.dudes[2] = "Greater Daemon of " + string(choose("Slaanesh", "Tzeentch", "Khorne", "Nurgle")); - if (slaa) then u.dudes[2] = "Greater Daemon of Slaanesh"; - u.dudes_num[2] = 1; - u.dudes[3] = "Soul Grinder"; - u.dudes_num[3] = 1; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 20, 240, obj_enunit); - if (slaa) { - u.dudes[1] = "Daemonette"; - u.dudes_num[1] = 2000; - u.dudes[2] = "Maulerfiend"; - u.dudes_num[2] = 3; - } else { - u.dudes[1] = "Bloodletter"; - u.dudes_num[1] = 500; - u.dudes[2] = "Daemonette"; - u.dudes_num[2] = 500; - u.dudes[3] = "Plaguebearer"; - u.dudes_num[3] = 500; - u.dudes[4] = "Pink Horror"; - u.dudes_num[4] = 500; - u.dudes[5] = "Maulerfiend"; - u.dudes_num[5] = 3; - } - instance_deactivate_object(u); - } -} - -// ** Necron Forces ** -if (enemy = 13) and((string_count("_attack", battle_special) = 0) or(string_count("wake", battle_special) > 0)) { - // Small Necron Group - if (threat = 1) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "11"; - - u.dudes[1] = "Necron Destroyer"; - u.dudes_num[1] = 1; - enemies[1] = u.dudes[1]; - u.dudes[2] = "Necron Warrior"; - u.dudes_num[2] = 10; - enemies[2] = u.dudes[2]; - } - // Medium Necron Group - if (threat = 2) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "54"; - - u.dudes[1] = "Necron Destroyer"; - u.dudes_num[1] = 1; - u.dudes[2] = "Necron Warrior"; - u.dudes_num[2] = 20; - u.dudes[3] = "Necron Immortal"; - u.dudes_num[3] = 10; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Necron Warrior"; - u.dudes_num[1] = 20; - u.dudes[2] = "Canoptek Spyder"; - u.dudes_num[2] = 3; - } - // Large Necron Group - if (threat = 3) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "110"; - - u.dudes[1] = "Necron Overlord"; - u.dudes_num[1] = 1; - u.dudes[2] = "Necron Destroyer"; - u.dudes_num[2] = 3; - u.dudes[3] = "Lychguard"; - u.dudes_num[3] = 5; - u.dudes[4] = "Necron Warrior"; - u.dudes_num[4] = 100; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Canoptek Spyder"; - u.dudes_num[1] = 6; - u.dudes[2] = "Canoptek Scarab"; - u.dudes_num[2] = 120; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Doomsday Arc"; - u.dudes_num[1] = 2; - u.dudes[2] = "Monolith"; - u.dudes_num[2] = 1; - } - // Small Necron Army - if (threat = 4) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "290"; - - u.dudes[1] = "Necron Overlord"; - u.dudes_num[1] = 1; - u.dudes[2] = "Necron Destroyer"; - u.dudes_num[2] = 6; - u.dudes[3] = "Lychguard"; - u.dudes_num[3] = 10; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Necron Warrior"; - u.dudes_num[1] = 250; - u.dudes[2] = "Necron Immortal"; - u.dudes_num[2] = 20; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Canoptek Spyder"; - u.dudes_num[1] = 6; - u.dudes[2] = "Canoptek Scarab"; - u.dudes_num[2] = 120; - u.dudes[3] = "Tomb Stalker"; - u.dudes_num[3] = 1; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 30, 240, obj_enunit); - u.dudes[1] = "Doomsday Arc"; - u.dudes_num[1] = 2; - u.dudes[2] = "Monolith"; - u.dudes_num[2] = 1; - - u = instance_create(0, 240, obj_enunit); - u.dudes[1] = "Necron Wraith"; - u.dudes_num[1] = 6; - u.flank = 1; - } - // Medium Necron Army - if (threat = 5) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "700"; - - u.dudes[1] = "Necron Overlord"; - u.dudes_num[1] = 1; - u.dudes[2] = "Necron Destroyer"; - u.dudes_num[2] = 12; - u.dudes[3] = "Lychguard"; - u.dudes_num[3] = 20; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Necron Warrior"; - u.dudes_num[1] = 600; - u.dudes[2] = "Necron Immortal"; - u.dudes_num[2] = 40; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Canoptek Spyder"; - u.dudes_num[1] = 12; - u.dudes[2] = "Canoptek Scarab"; - u.dudes_num[2] = 240; - u.dudes[3] = "Tomb Stalker"; - u.dudes_num[3] = 2; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 30, 240, obj_enunit); - u.dudes[1] = "Doomsday Arc"; - u.dudes_num[1] = 4; - u.dudes[2] = "Monolith"; - u.dudes_num[2] = 2; - u.dudes[3] = "Necron Destroyer"; - u.dudes_num[3] = 12; - - u = instance_create(0, 240, obj_enunit); - u.dudes[1] = "Necron Wraith"; - u.dudes_num[1] = 12; - u.flank = 1; - } - // Large Necron Army - if (threat = 6) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "1000"; - - u.dudes[1] = "Necron Overlord"; - u.dudes_num[1] = 2; - u.dudes[2] = "Necron Destroyer"; - u.dudes_num[2] = 20; - u.dudes[3] = "Lychguard"; - u.dudes_num[3] = 40; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Necron Warrior"; - u.dudes_num[1] = 800; - u.dudes[2] = "Necron Immortal"; - u.dudes_num[2] = 50; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Canoptek Spyder"; - u.dudes_num[1] = 16; - u.dudes[2] = "Canoptek Scarab"; - u.dudes_num[2] = 320; - u.dudes[3] = "Tomb Stalker"; - u.dudes_num[3] = 3; - - instance_deactivate_object(u); - u = instance_nearest(xxx + 30, 240, obj_enunit); - u.dudes[1] = "Doomsday Arc"; - u.dudes_num[1] = 6; - u.dudes[2] = "Monolith"; - u.dudes_num[2] = 2; - u.dudes[3] = "Necron Destroyer"; - u.dudes_num[3] = 20; - - u = instance_create(0, 240, obj_enunit); - u.dudes[1] = "Necron Wraith"; - u.dudes_num[1] = 24; - u.flank = 1; - } -} - -// ** Set up player defenses ** -if (player_defenses + player_silos > 0) { - u = instance_create(-50, 240, obj_pnunit); - u.defenses = 1; - - for (var i = 1; i <= 3; i++) { - u.veh_co[i] = 0; - u.veh_id[i] = 0; - u.veh_type[i] = "Defenses"; - u.veh_hp[i] = 1000; - u.veh_ac[i] = 1000; - u.veh_dead[i] = 0; - } - - u.veh_wep1[1] = "Heavy Bolter Emplacement"; - u.veh_wep1[2] = "Missile Launcher Emplacement"; - u.veh_wep1[3] = "Missile Silo"; - u.veh = 3; - u.sprite_index = spr_weapon_blank; -} - -instance_activate_object(obj_enunit); - -}catch (_exception) { - handle_exception(_exception); - instance_destroy(obj_enunit); - instance_destroy(obj_pnunit); - instance_destroy(obj_ncombat); -} \ No newline at end of file diff --git a/objects/obj_ncombat/Alarm_1.gml b/objects/obj_ncombat/Alarm_1.gml deleted file mode 100644 index cd758f8e86..0000000000 --- a/objects/obj_ncombat/Alarm_1.gml +++ /dev/null @@ -1,540 +0,0 @@ - -var a1;a1=""; - -if (ally>0) and (ally_forces>0){ - if (ally=3){ - if (ally_forces>=1) then a1="Joining your forces are 10 Techpriests and 20 Skitarii. Omnissian Power Axes come to life, crackling and popping with disruptive energy, and Conversion Beam Projectors are levelled to fire. The Tech-Guard are silent as they form a perimeter around their charges, at contrast with their loud litanies and Lingua-technis bursts."; - } -} - - - -// Player crap here -var p1,p2,p3,p4,p5,p6,p8,temp,temp2,temp3,temp4,temp5,temp6; -p1="";p2="";p3="";p4="";p5="";p6="";p8="";temp=0;temp2=0;temp3=0;temp4=0;temp5=0;temp6=0; -var d1,d2,d3,d4,d5,d6,d7,d8; -d1="";d2="";d3="";d4="";d5="";d6="";d7="";d8=""; - - -temp=scouts+tacticals+veterans+devastators+assaults+librarians; -temp+=techmarines+honors+dreadnoughts+terminators+captains; -temp+=standard_bearers+champions+important_dudes+chaplains+apothecaries; -temp+=sgts+vet_sgts - -var color_descr; -color_descr=""; - -if (obj_ini.main_color!=obj_ini.secondary_color) then color_descr=string(obj_controller.col[obj_ini.main_color])+" and "+string(obj_controller.col[obj_ini.secondary_color]); -if (obj_ini.main_color=obj_ini.secondary_color) then color_descr=string(obj_controller.col[obj_ini.main_color]); - -/*show_message(scouts+tacticals+veterans+devastators+assaults+librarians); -show_message(techmarines+honors+dreadnoughts+terminators+captains); -show_message(standard_bearers+important_dudes+chaplains+apothecaries); -show_message(temp);*/ - -// Random variations; dark out, rain pooling down, dawn shining off of the armour, etc. -var variation;variation=""; -variation=choose("","dawn","rain"); - - -if (battle_special="ship_demon"){ - p1="As the Artifact is smashed and melted down some foul smoke begins to erupt from it, spilling outward and upward. After a sparse handful of seconds it takes form into a "; - p1+=string(obj_enunit.dudes[1]); - p1+=". Now free, it seems bent upon slaying your marines. Onboard you have "; -} - -if (battle_special="ruins") or (battle_special="ruins_eldar"){ - p1="Your marines place themselves into a proper fighting position, defensible and ready to fight whatever may come. Enemies may only come from a few directions, though the ancient corridors and alleyways are massive, and provide little cover."; - p1+=" You have "; -} - -if (string_count("mech",battle_special)>0){ - p1="Large, hulking shapes advance upon your men from every direction. The metal corridors and blast chambers prevent escape. Soon 4 Thallax and half a dozen Praetorian Servitors can be seen, with undoubtably more to come."; - p1+=" You have "; -} - -if (battle_special="space_hulk"){ - if (hulk_forces>0) then p1="Your marines manuever through the hull of the Space Hulk, shadows dancing and twisting before their luxcasters. The hallway integrity is nonexistant- twisted metal juts out in hazardous ways or opens into bottomless pits. Still, there is loot and knowledge to be gained. It is not long before your men's sensorium pick up hostile blips. Your own forces are made up of "; - if (hulk_forces=0) then p1="Your marines manuever through the hull of the Space Hulk, shadows dancing and twisting before their luxcasters. The hallway integrity is nonexistant- twisted metal juts out in hazardous ways or opens into bottomless pits. Your forces are made up of "; -} - - -if (battle_special=""){ - if (dropping=0){ - if (temp-dreadnoughts>0){ - if (variation=""){p1="Dirt crunches beneath the soles of "+string(temp)+" "+string(global.chapter_name)+" as they form up. Your ranks are made up of ";} - if (variation="rain"){p1="Rain pelts the ground and fogs the air, partly veiling the "+string(temp)+" "+string(global.chapter_name)+". Your ranks are made up of ";} - if (variation="dawn"){p1="The bright light of dawn reflects off the "+string_lower(color_descr)+" ceremite of "+string(temp)+" "+string(global.chapter_name)+". Your ranks are made up of ";} - } - } - if (dropping=1){ - if (temp-dreadnoughts>0){// lyman - p1="The air rumbles and quakes as "+string(temp)+" "+string(global.chapter_name)+" descend in drop-pods. "; - - - /*if (variation=""){ - if (lyman=0) then p1="The air rumbles and quakes as "+string(temp)+" "+string(global.chapter_name)+" descend in drop-pods. Before the enemy can bring their full ranged power to bear the pods smash down. With practiced speed your marines pour on free. Their ranks are made up of "; - if (lyman=1) then p1="The air rumbles and quakes as "+string(temp)+" "+string(global.chapter_name)+" descend in drop-pods. Before the enemy can bring their full ranged power to bear the pods smash down. Your marines exit the vehicles, shaking off their vertigo and nausea with varying degrees of success. Your ranks are made up of "; - } - */ - } - } -} -if (string_count("spyrer",battle_special)>0){ - p1="Your marines search through the alleyways and corridors likely to contain the Spyrer. It does not take long before the lunatic attacks, springing off from a wall to fall among your men. Your ranks are made up of "; -} -if (string_count("fallen",battle_special)>0){ - p1="Your marines search through the alleyways and dens likely to contain the Fallen. Several days pass before the search is succesful; the prey is located by Auspex and closed in upon. "; - if (battle_climate="Lava") then p1="Your marines search through the broken craggs and spires of the molten planet. Among the bubbling lava, and cracking earth, they search for the Fallen. After several days of searching Auspex detect the prey. "; - if (battle_climate="Dead") then p1="Your marines search through the cratered surface of the debris field. Among the cracking earth and dust they search for the Fallen. After several days of searching Auspex detect the prey. "; - if (battle_climate="Agri") then p1="Endless fields of wheat and barley are an unlikely harbor for a renegade, but your marines search the agri world all the same. After several days of searching Auspex detect the prey. "; - if (battle_climate="Death") then p1="Deadly carniverous plants and endless canopy blot out the surface of the planet. Among the disheveled hills, and heavy underbrush, your marines search for the Fallen. After several days of searching Auspex detect the prey. "; - if (battle_climate="Ice") then p1="Your marines search through the endless glaciers and peaks of the frozen planet. Among the howling wind, and cracking ice, they search for the Fallen. After several days of searching Auspex detect the prey. "; - if (obj_enunit.dudes_num[1]=1) then p1+="The coward soon realizes he has been located, and reacts like a cornered animal, brandishing weapons."; - if (obj_enunit.dudes_num[1]>1) then p1+="The cowards soon realize they have been located, and react like cornered animals, brandishing weapons."; - p1+=" Your ranks are made up of "; -} - - - - - - - -if (string_count("_attack",battle_special)>0){ - var wh;wh=choose(1,2); - if (wh=1) then p1="Cave dirt crunches beneath the soles of your marines as they continue their descent. There is little warning before "; - if (wh=2) then p1="The shadows stretch and morph as the lights cast by your marines move along. One large shadow begins to move on its own- "; - - if (string_count("wake",battle_special)>0){ - p1="Cave dirt crunches beneath the soles of your marines as they continue their descent. There is little warning when the ground begins to shake. An old, dusty breeze seems to flow through the tunnel, followed by rumbling sensations and distant mechanical sounds. "; - if (string_count("1",battle_special)>0) then p1+="Within minutes Necrons begin to appear from every direction. There appears to be nearly fourty, cramped in the dark tunnels."; - if (string_count("2",battle_special)>0) then p1+="Within minutes Necrons begin to appear from every direction. There appears to be nearly a hundred, cramped in the dark tunnels."; - if (string_count("3",battle_special)>0) then p1+="Within minutes Necrons begin to appear from every direction. Their numbers are wihout number."; - } - - - - - if (string_count("wraith",battle_special)>0) then p1+="two Necron Wraiths appear out of nowhere and begin to attack."; - if (string_count("spyder",battle_special)>0) then p1+="a large Canoptek Spyder launches towards your marines, a small group of scuttling Scarabs quickly following."; - if (string_count("stalker",battle_special)>0) then p1+="the tunnel begins to shake and a massive Tomb Stalker scuttles into your midst."; - newline=p1; - scr_newtext(); - exit; -} - - - - - - -if (tacticals>0) and (veterans>0){ - p2=string(tacticals+veterans)+" "+string(obj_ini.role[100][8])+"s, "; -} -if (tacticals>0) and (veterans=0){ - if (tacticals=1) then p2=string(tacticals)+" "+string(obj_ini.role[100][8])+", "; - if (tacticals>1) then p2=string(tacticals)+" "+string(obj_ini.role[100][8])+"s, "; -} -if (tacticals=0) and (veterans>0){ - if (veterans=1) then p2=string(veterans)+" "+string(obj_ini.role[100][3])+", "; - if (veterans>1) then p2=string(veterans)+" "+string(obj_ini.role[100][3])+"s, "; -} - -if (assaults>0){ - if (assaults=1) then p2+=string(assaults)+" "+string(obj_ini.role[100][10])+", "; - if (assaults>1) then p2+=string(assaults)+" "+string(obj_ini.role[100][10])+"s, "; -} -if (devastators>0){ - if (devastators=1) then p2+=string(devastators)+" "+string(obj_ini.role[100][9])+", "; - if (devastators>1) then p2+=string(devastators)+" "+string(obj_ini.role[100][9])+"s, "; -} - -if (temp<200) and (terminators>0){ - if (terminators=1) then p2+=string(terminators)+" Terminator, "; - if (terminators>1) then p2+=string(terminators)+" Terminators, "; -} - -if (temp<200) and (chaplains>0){ - if (chaplains=1) then p2+=string(chaplains)+" "+string(obj_ini.role[100][14])+", "; - if (chaplains>1) then p2+=string(chaplains)+" "+string(obj_ini.role[100][14])+", "; -} - -if (temp<200) and (apothecaries>0){ - if (apothecaries=1) then p2+=string(apothecaries)+" "+string(obj_ini.role[100][15])+", "; - if (apothecaries>1) then p2+=string(apothecaries)+" "+string(obj_ini.role[100][15])+", "; -} - -if (temp<200) and (librarians>0){ - if (librarians=1) then p2+=string(librarians)+" "+string(obj_ini.role[100,17])+", "; - if (librarians>1) then p2+=string(librarians)+" "+string(obj_ini.role[100,17])+", "; -} - -if (temp<200) and (techmarines>0){ - if (techmarines=1) then p2+=string(techmarines)+" "+string(obj_ini.role[100][16])+", "; - if (techmarines>1) then p2+=string(techmarines)+" "+string(obj_ini.role[100][16])+", "; -} -if (temp<200) and (sgts>0){ - if (techmarines=1) then p2+=string(techmarines)+" "+string(obj_ini.role[100][18])+", "; - if (techmarines>1) then p2+=string(techmarines)+" "+string(obj_ini.role[100][18])+", "; -} -if (temp<200) and (vet_sgts>0){ - if (techmarines=1) then p2+=string(techmarines)+" "+string(obj_ini.role[100][19])+", "; - if (techmarines>1) then p2+=string(techmarines)+" "+string(obj_ini.role[100][19])+", "; -} - - -if (scouts>0){ - if (scouts=1) then p2+=string(scouts)+" "+string(obj_ini.role[100][12])+", "; - if (scouts>1) then p2+=string(scouts)+" "+string(obj_ini.role[100][12])+"s, "; -} - - -// temp5=string_length(p2);p2=string_delete(p2,temp5-1,2);// p2+="."; -temp6=honors+captains+important_dudes+standard_bearers; -if (temp>=200) then temp6+=terminators; -if (temp>=200) then temp6+=chaplains; -if (temp>=200) then temp6+=apothecaries; -if (temp>=200) then temp6+=techmarines; -if (temp>=200) then temp6+=librarians; -if (temp6>0) then p2+=string(temp6)+" other various Astartes, "; - -var woo;woo=string_length(p2); -p2=string_delete(p2,woo-1,2); - -if (string_count(", ",p2)>1){ - var woo;woo=string_rpos(", ",p2); - p2=string_insert(" and",p2,woo+1); -} -if (string_count(", ",p2)=1){ - var woo;woo=string_rpos(", ",p2); - p2=string_delete(p2,woo-1,2); - p2=string_insert(" and",p2,woo+1); -} -p2+="."; - - - - - -if (standard_bearers>1) and (dropping=0) then p5=" Chapter Ancients hold your Chapter heraldry high and proud."; - - - -if (dreadnoughts+predators+land_raiders>3){ - p6=" Forming up the armoured division is "; - if (dreadnoughts=1) then p6+=string(dreadnoughts)+" "+string(obj_ini.role[100][6])+", "; - if (dreadnoughts>1) then p6+=string(dreadnoughts)+" "+string(obj_ini.role[100][6])+"s, "; - - if (rhinos=1) then p6+=string(rhinos)+" Rhino, "; - if (rhinos>1) then p6+=string(rhinos)+" Rhinos, "; - - if (predators=1) then p6+=string(predators)+" Predator, "; - if (predators>1) then p6+=string(predators)+" Predators, "; - - if (land_raiders=1) then p6+=string(land_raiders)+" Land Raider, "; - if (land_raiders>1) then p6+=string(land_raiders)+" Land Raiders, "; - - if (land_speeders=1) then p6+=string(land_speeders)+" Land Speeder, "; - if (land_speeders>1) then p6+=string(land_speeders)+" Land Speeders, "; - - - if (whirlwinds=1) then p6+=string(whirlwinds)+" Whirlwind, "; - if (whirlwinds>1) then p6+=string(whirlwinds)+" Whirlwinds, "; - - // Other vehicles here? - - var woo;woo=string_length(p6); - p6=string_delete(p6,woo-1,2); - - if (string_count(", ",p6)>1){ - var woo;woo=string_rpos(", ",p6); - p6=string_insert(" and",p6,woo+1); - } - if (string_count(", ",p6)=1){ - var woo;woo=string_rpos(", ",p6); - p6=string_delete(p6,woo-1,2); - p6=string_insert(" and",p6,woo+1); - } - p6+="."; - -} -// If less than three spell out the individual vehicles - - -if (battle_special="space_hulk"){ - newline=p1+p2;scr_newtext(); - if (a1!=""){newline=a1;scr_newtext();} - if (hulk_forces>0){newline="There are "+string(hulk_forces)+" or so blips.";scr_newtext();} - - exit; -} -if (dropping=0){ - newline=p1+p2+p3+p4+p5+p6; - scr_newtext(); - if (a1!=""){newline=a1;scr_newtext();} -} - -if (dropping=1) and (battle_special!="space_hulk"){ - d1=p1;d2=p2; - d3=p3;d4=p4; - d5=p5;d6=p6; -} - - -if (battle_special="ruins") or (battle_special="ruins_eldar"){ - newline="The enemy forces are made up of "+string(enemy_dudes); - - if (enemy=6) then newline+=" Craftworld Eldar."; - if (enemy=10) then newline+=" Cultists and Mutants."; - if (enemy=11) then newline+=" Chaos Space Marines."; - if (enemy=12) then newline+=" Daemons."; - - scr_newtext();exit; -} - - - - -// Enemy crap here -var rand; -p1="";p2="";p3="";p4="";p5="";p6=""; -temp2=0;temp3=0;temp4=0;temp5=0; - -/*if (terrain=""){rand=choose(1,2,3);// Variations for terrain - if (rand<4) then - // if (rand=2) then p1="Encroaching upon your forces are "; - // if (rand=3) then p1="Advancing upon your forces are "; -} - -// p1+=string(enemy_dudes);// The number descriptor*/ - - -if (enemy=2){ - p1="Opposing your forces are a total of "+scr_display_number(floor(guard_effective))+" Guardsmen, including Heavy Weapons and Armour."; - p2="";p3=""; -} - - - -if (enemy=5) and (dropping=0){ - p1="Marching to face your forces "; - if (threat=1) then p2="are a squad of Adepta Sororitas, back up by a dozen priests. Forming up a protective shield around them are a large group of religious followers, gnashing and screaming out litanies to the Emperor."; - if (threat=2) then p2="are several squads of Adepta Sororitas. A large pack of religious followers forms up a protective shield in front, backed up by numerous Acro-Flagellents."; - if (threat=3) then p2="are more than four hundred Adepta Sororitas, thick clouds of incense and smoke heralding their advance. An equally massive pack of religious followers are spread around, screaming and babbling hyms to the Emperor. Many are already bleeding from self-inflicted wounds or flagellation. Several Penitent Engines clank and advance in the forefront."; - if (threat=4) then p2="are more than a thousand Adepta Sororitas, a large portion of an order, thick clouds of incense and smoke heralding their advance. A massive pack of religious followers are spread among the force, screaming and babbling hyms to the Emperor. Many are already bleeding from self-inflicted wounds or flagellation. Their voices are drowned out by the rumble of Penitent Engines and the loud vox-casters of Excorcists, blasting out litanies and organ music even more deafening volumes."; - if (threat>=5) then p2="is the entirety of an Adepta Sororitas order, the ground shaking beneath their combined thousands of footsteps. Forming a shield around them in a massive, massive pack of religious followers, screaming out or babbling hyms to the Emperor. All of the opposing army is a blurring, shifting mass of robes and ceremite, and sound, Ecclesiarchy Priests and Mistresses whipping the masses into more of a blood frenzy. Organ music and litanies blast from the many Exorcists, the sound deafening to those too close. Carried with the wind, and lingering in the air, is the heavy scent of promethium."; -} - - -if (enemy=6) and (dropping=0){ - // p1+=" Eldar";// Need a few random descriptors here - rand=choose(1,2,3); -} -if (enemy=7) and (dropping=0){ - // p1+=" Orks"; - rand=choose(1,2,3); - if (rand<4){ - p1="Howls and grunts ring from the surrounding terrain as the Orks announce their presence. "; - p2=string(enemy_dudes)+", the bloodthirsty horde advances toward your Marines, ecstatic in their anticipation of carnage. "; - p3=p2;p2=string_delete(p2,2,999);p3=string_delete(p3,1,1);p2=string_upper(p2);// Capitalize the ENEMY DUDES first letter - } -} -if (enemy=7) and (dropping=1){ - p1="The "+string(enemy_dudes)+"-some Orks howl and roar at the oncoming marines. Many of the beasts fire their weapons, more or less spraying rounds aimlessly into the sky."; -} - -if (enemy=8) and (dropping=0){ - // p1+=" Tau"; - rand=choose(1,2,3); -} -if (enemy=9) and (dropping=0){ - // p1+=" Tyranids"; - rand=choose(1,2,3); -} -if (enemy=9) and (dropping=1){ - p1="The "+string(enemy_dudes)+"-some Tyranids hiss and chitter as your marines rain down. Blasts of acid and spikes fill the sky, but none seem to quite find their mark."; -} - -if (enemy=10) and (dropping=0){ - // p1+=" heretics"; - rand=choose(1,2,3); -} - - -if (enemy=10) and (threat=7){ - rand=choose(1,2); - if (rand=1) then p1="Laying before them is a hellish landscape, fitting for nightmares. Twisted, flesh-like spires reach for the sky, each containing a multitude of fanged maws or eyes. Lightning crackles through the red sky. "; - if (rand=2) then p1="Waiting for your marines is a twisted landscape. Mutated, fleshy spires reach for the sky. The ground itself is made up of choking purple ash, kicked up with each footstep, blocking vision. "; - p1+="All that can be seen twists and shifts, as though looking through a massive, distorted lens. "; - p8="The enemy forces are made up of over 3000 lesser Daemons. Their front and rear ranks are made up of Maulerfiends and Soulgrinders, backed up by nearly a dozen Greater Daemons. Each of the four Chaos Gods are represented."; -} - -if (enemy=11) and (dropping=0){ - // p1+=" Chaos Space Marines"; - rand=choose(1,2,3); -} - -if (enemy=12) and (dropping=0){ - // Daemons -} - -if (enemy=13) and (dropping=0){ - rand=choose(1,2,3); - if (rand<4){ - p1="Dirt crunches beneath the feet of the Necrons as they make their silent advance. "; - p2=string(enemy_dudes)+", the souless xeno advance toward your Marines, silent and pulsing with green energy. "; - p3=p2;p2=string_delete(p2,2,999);p3=string_delete(p3,1,1);p2=string_upper(p2);// Capitalize the ENEMY DUDES first letter - } -} - - -if (dropping=0){ - newline=p1+p2+p3+p4+p5+p6; - scr_newtext(); - if (a1!=""){newline=a1;scr_newtext();} - if (p8!=""){newline=p8;scr_newtext();} -} - -if (dropping=1){ - newline=d1+p1;scr_newtext(); - if (lyman=0) then d7="After a brief descent all of the drop-pods smash down, followed quickly by your marines pouring free. Their ranks are made up of "; - if (lyman=1) then d7="After a brief descent all of the drop-pods smash down. Your marines exit the vehicles, shaking off their vertigo and nausea with varying degrees of success. Their ranks are made up of "; - newline=d7+d2+d3+d4+d5+d6;scr_newtext(); - if (a1!=""){newline=a1;scr_newtext();} - if (p8!=""){newline=p8;scr_newtext();} -} - - - - -if (occulobe=1) and (battle_special!="space_hulk"){ - if (time=5) or (time=6){ - newline="The morning light of dawn is blinding your marines!";newline_color="red";scr_newtext(); - } -} - - - -if (fortified>1) and (dropping=0) and (enemy+threat!=17){ - if (fortified=2) then newline="An Aegis Defense Line protects your forces."; - if (fortified=3) then newline="Thick plasteel walls protect your forces."; - if (fortified=4) then newline="A series of thick plasteel walls protect your forces."; - if (fortified>=5) then newline="A massive plasteel bastion protects your forces."; - - if (player_defenses>0) and (player_silos>0) then newline+=" The front of your Monastery also boasts "+string(player_defenses)+" Weapon Emplacements and "+string(player_silos)+" Missile Silos."; - if (player_defenses=0) and (player_silos>0) then newline+=" Your Monastery also boasts "+string(player_silos)+" Missile Silos."; - if (player_defenses>0) and (player_silos=0) then newline+=" The front of your Monastery also boasts "+string(player_defenses)+" Weapon Emplacements."; - - scr_newtext(); -} - - - - - - - - - - - - -// Check for battlecry here -// if (temp>=100) and (threat>1) and (big_mofo!=10) and (dropping=0){ -if (temp>=100) and (threat>1) and (big_mofo>0) and (big_mofo<10) and (dropping=0){ - p1="";p2="";p3="";p4="";p5="";p6=""; - temp4=0;temp5=0; - - if (big_mofo=1) then p1="You "; - if (big_mofo=2) then p1="The Master of Sanctity "; - if (big_mofo=3) then p1="Chief "+string(obj_ini.role[100,17])+" "; - if (big_mofo=5) then p1="A Captain "; - if (big_mofo=8) then p1="A Chaplain "; - - - - var standard_cry;standard_cry=0; - if (global.chapter_name="Salamanders"){standard_cry=1; - var rand;rand=choose(1,2,3,4,5); - if (rand=1) and (big_mofo!=1){p2="breaks the silence, begining the Chapter Battlecry-";}if (rand=1) and (big_mofo=1){p2="break the silence, begining the Chapter Battlecry-";} - if (rand=2) and (big_mofo!=1){p2="roars the first half of the Chapter Battlecry-";}if (rand=2) and (big_mofo=1){p2="roar the first half of the Chapter Battlecry-";} - if (rand=3) and (big_mofo!=1){p2="shouts the start of the Chapter Battlecry-";}if (rand=3) and (big_mofo=1){p2="shout the start of the Chapter Battlecry-";} - if (rand=4) and (big_mofo!=1){p2="calls out to your marines-";}if (rand=4) and (big_mofo=1){p2="call out to your marines-";} - if (rand=5) and (big_mofo!=1){p2="roars to your marines-";}if (rand=5) and (big_mofo=1){p2="roar to your marines-";} - p3="''Into the fires of battle!''"; - if (temp>=100) and (temp<200){p4="Over a hundred Astartes roar in return, their voice one-";} - if (temp>=200) and (temp<400){p4="Several hundred Astartes roar in return, their voice one-";} - if (temp>=500) and (temp<800){p4="Your battle brothers echoe the cry, a massive sound felt more than heard-";} - if (temp>800){p4="The sound is deafening as the "+string(global.chapter_name)+" shout in unison-";} - p5="''UNTO THE ANVIL OF WAR!''"; - newline=p1+p2;scr_newtext(); - newline=p3;scr_newtext(); - newline=p4;scr_newtext(); - newline=p5;scr_newtext(); - } - if (obj_ini.battle_cry == "..."){standard_cry=1; - var rand;rand=choose(1,2,3); - if (rand=1) and (big_mofo!=1){p2="remains silent as the Chapter forms for battle-";}if (rand=1) and (big_mofo=1){p2="remain silent as the Chapter forms for battle-";} - if (rand=2) and (big_mofo!=1){p2="remains silent and issues orders to the Chapter for battle-";}if (rand=2) and (big_mofo=1){p2="remain silent and issues orders to the Chapter for battle-";} - if (rand=3) and (big_mofo!=1){p2="issues orders to the Chapter over Vox-";}if (rand=3) and (big_mofo=1){p2="whisper to your brothers the plans for initial deployment over vox-";} - p3="''Sharp gestures and handsigns from officers direct the Marines''"; - if (temp>=100) and (temp<200){p4="Over a hundred Astartes nod in acknowledgement and move quickly-";} - if (temp>=200) and (temp<400){p4="Several hundred Astartes nod in acknowledgement and move swiftly-";} - if (temp>=500) and (temp<800){p4="Your battle brothers all nod in acknowledgement and move hastily-";} - if (temp>800){p4="The fluidity is astounding as the "+string(global.chapter_name)+" move seamlessly into position ready for battle-";} - p5="''They stand ready to engage the enemy''"; - newline=p1+p2;scr_newtext(); - newline=p3;scr_newtext(); - newline=p4;scr_newtext(); - newline=p5;scr_newtext(); - } - - // show_message(string(global.chapter_name)+"|"+string(global.custom)+"|"+string(standard_cry)); - - if (global.chapter_name="Iron Warriors") and (global.custom=0){standard_cry=1; - var rand;rand=choose(1,2,3,4,5); - if (rand=1) and (big_mofo!=1){p2="breaks the silence, begining the Chapter Battlecry-";}if (rand=1) and (big_mofo=1){p2="break the silence, begining the Chapter Battlecry-";} - if (rand=2) and (big_mofo!=1){p2="roars the first half of the Chapter Battlecry-";}if (rand=2) and (big_mofo=1){p2="roar the first half of the Chapter Battlecry-";} - if (rand=3) and (big_mofo!=1){p2="shouts the start of the Chapter Battlecry-";}if (rand=3) and (big_mofo=1){p2="shout the start of the Chapter Battlecry-";} - if (rand=4) and (big_mofo!=1){p2="calls out to your marines-";}if (rand=4) and (big_mofo=1){p2="call out to your marines-";} - if (rand=5) and (big_mofo!=1){p2="roars to your marines-";}if (rand=5) and (big_mofo=1){p2="roar to your marines-";} - p3="''Iron within!''"; - if (temp>=100) and (temp<200){p4="Over a hundred Astartes roar in return, their voice one-";} - if (temp>=200) and (temp<400){p4="Several hundred Astartes roar in return, their voice one-";} - if (temp>=500) and (temp<800){p4="Your battle brothers echoe the cry, a massive sound felt more than heard-";} - if (temp>800){p4="The sound is deafening as the "+string(global.chapter_name)+" shout in unison-";} - p5="''IRON WITHOUT!''"; - newline=p1+p2;scr_newtext(); - newline=p3;scr_newtext(); - newline=p4;scr_newtext(); - newline=p5;scr_newtext(); - } - - - if (standard_cry=0){standard_cry=1; - var rand;rand=choose(1,2,3,4); - if (rand=1){if (big_mofo!=1) then p2="breaks ";if (big_mofo=1) then p2="break ";p2+="the silence, calling out the Chapter Battlecry-";} - if (rand=2){if (big_mofo!=1) then p2="roars ";if (big_mofo=1) then p2="roar ";p2+="the Chapter Battlecry-";} - if (rand=3){if (big_mofo!=1) then p2="shouts ";if (big_mofo=1) then p2="shout ";p2+="the Chapter Battlecry-";} - if (rand=4){if (big_mofo!=1) then p2="roars ";if (big_mofo=1) then p2="roar ";p2+="to your marines-";} - p3="''"+string(obj_ini.battle_cry)+"!''"; - if (temp>=100) and (temp<200){p4="Over a hundred Astartes echoe the cry or let out shouts of their own.";} - if (temp>=200) and (temp<400){p4="Several hundred Astartes roar in return, echoing the cry.";} - if (temp>=500) and (temp<800){p4="Your battle brothers echoe the cry, a massive sound felt more than heard.";} - if (temp>800) and (rand>=3){p4="The sound is deafening as the "+string(global.chapter_name)+" add their voices.";} - if (temp>800) and (rand<=2){p4="The sound is deafening as the "+string(global.chapter_name)+" return the cry and magnify it a thousand times.";} - newline=p1+p2;scr_newtext(); - newline=p3;scr_newtext(); - newline=p4;scr_newtext(); - } -} - -var line_break = "------------------------------------------------------------------------------"; -newline = line_break; -scr_newtext(); -newline = line_break; -scr_newtext(); - -/* */ -/* */ diff --git a/objects/obj_ncombat/Alarm_2.gml b/objects/obj_ncombat/Alarm_2.gml deleted file mode 100644 index bf67e79f26..0000000000 --- a/objects/obj_ncombat/Alarm_2.gml +++ /dev/null @@ -1,97 +0,0 @@ - -player_max=player_forces; -enemy_max=enemy_forces; - -instance_activate_object(obj_enunit); - -if (dropping){ - squeeze_map_forces(); -} - - -if (ally>0) and (ally_forces>0){ - if (ally=3){ - if (ally_forces>=1){ - var thata,ii,good; - thata=instance_nearest(0,240,obj_pnunit);ii=0;good=0; - - //TODO refactor so that unit structs are created for ally forces - - /* - if (instance_exists(thata)){ - - ii=array_length(marine_type); - if (good>0){ - repeat(10){ - thata.marine_type[ii]="Techpriest"; - thata.marine_hp[ii]=50; - thata.marine_ac[ii]=20;thata.marine_exp[ii]=100; - thata.marine_wep1[ii]="Power Axe"; - thata.marine_wep2[ii]="Laspistol"; - thata.marine_armour[ii]="Dragon Scales"; - thata.marine_gear[ii]=""; - thata.marine_mobi[ii]="Servo-arm"; - thata.ally[ii]=true; - thata.marine_dead[ii]=0; - ii+=1; - thata.men+=1; - } - repeat(20){ - thata.marine_type[ii]="Skitarii"; - thata.marine_hp[ii]=40; - thata.marine_ac[ii]=10; - thata.marine_exp[ii]=10; - thata.marine_wep1[ii]="Hellgun"; - thata.marine_wep2[ii]=""; - thata.marine_armour[ii]="Skitarii Armour"; - thata.marine_gear[ii]=""; - thata.ally[ii]=true; - thata.marine_dead[ii]=0;ii+=1;thata.men+=1; - } - } - - ii=0;good=0; - repeat(50){if (good=0){ii+=1;if (thata.dudes[ii]="") and (thata.dudes_num[ii]=0) then good=ii;}} - if (good>0){thata.dudes[ii]="Techpriest";thata.dudes_num[ii]=10;thata.dudes_vehicle[ii]=0;} - ii=0;good=0; - repeat(50){if (good=0){ii+=1;if (thata.dudes[ii]="") and (thata.dudes_num[ii]=0) then good=ii;}} - if (good>0){thata.dudes[ii]="Skitarii";thata.dudes_num[ii]=20;thata.dudes_vehicle[ii]=0;} - thata.alarm[1]=1; - }*/ - } - } -} - - - - - - -// scr_newtext(); - -/*if (newline!=""){ - var breaks,first_open; - newline=scr_lines(89,newline); - breaks=max(1,string_count("@",newline)); - first_open=liness+1; - - var b,f;b=first_open;f=-1; - explode_script(newline,"@"); - f+=1;lines[b+f]=string("-"+explode[f]); - repeat(breaks-1){f+=1; - lines[b+f]=string(explode[f]); - } - liness+=string_count("@",newline); - - repeat(100){ - if (liness>30){scr_lines_increase(1);liness-=1;} - } -} - -newline="";*/ - - -instance_activate_object(obj_enunit); - -/* */ -/* */ diff --git a/objects/obj_ncombat/Alarm_5.gml b/objects/obj_ncombat/Alarm_5.gml deleted file mode 100644 index 57e1a3ded9..0000000000 --- a/objects/obj_ncombat/Alarm_5.gml +++ /dev/null @@ -1,924 +0,0 @@ - -// Final Screen -var part1="",part2="",part3="",part4="",part9=""; -var part5="",part6="",part7="",part8="",part10=""; -battle_over=1; - -var line_break = "------------------------------------------------------------------------------"; -// show_message("Final Deaths: "+string(final_marine_deaths)); - - -if (turn_count >= 50){ - part1 = "Your forces make a fighting retreat \n" -} -// check for wounded marines here to finish off, if defeated defending -var roles = obj_ini.role[100]; -var ground_mission = (instance_exists(obj_ground_mission)); - -with (obj_pnunit) { - after_battle_part1(); -} - -if (obj_ncombat.defeat == 0) { - marines_to_recover = ds_priority_create(); - vehicles_to_recover = ds_priority_create(); - - with (obj_pnunit) { - add_marines_to_recovery(); - add_vehicles_to_recovery(); - } - - while (!ds_priority_empty(marines_to_recover)) { - var _candidate = ds_priority_delete_max(marines_to_recover); - var _column_id = _candidate.column_id; - var _unit_id = _candidate.id; - var _unit = _candidate.unit; - var _unit_role = _unit.role(); - var _constitution_test_mod = _unit.hp() * -1; - var _constitution_test = global.character_tester.standard_test(_unit, "constitution", _constitution_test_mod); - - if (unit_recovery_score > 0) { - _unit.update_health(_constitution_test[1]); - _column_id.marine_dead[_unit_id] = false; - unit_recovery_score--; - units_saved_count++; - - if (!struct_exists(obj_ncombat.units_saved_counts, _unit_role)) { - obj_ncombat.units_saved_counts[$ _unit_role] = 1; - } else { - obj_ncombat.units_saved_counts[$ _unit_role]++; - } - continue; - } - - if (_unit.base_group == "astartes") { - if (!_unit.gene_seed_mutations[$ "membrane"]) { - var survival_mod = _unit.luck * -1; - survival_mod += _unit.hp() * -1; - - var survival_test = global.character_tester.standard_test(_unit, "constitution", survival_mod); - if (survival_test[0]) { - _column_id.marine_dead[_unit_id] = false; - injured++; - } - } - } - } - ds_priority_destroy(marines_to_recover); - - while (!ds_priority_empty(vehicles_to_recover)) { - var _candidate = ds_priority_delete_max(vehicles_to_recover); - var _column_id = _candidate.column_id; - var _vehicle_id = _candidate.id; - var _vehicle_type = _column_id.veh_type[_vehicle_id]; - - if (obj_controller.stc_bonus[3] = 4) { - var _survival_roll = 70 + _candidate.priority; - var _dice_roll = roll_dice(1, 100, "high"); - if (_dice_roll >= _survival_roll) && (_column_id.veh_dead[_vehicle_id] != 2) { - _column_id.veh_hp[_vehicle_id] = roll_dice(1, 10, "high"); - _column_id.veh_dead[_vehicle_id] = false; - vehicles_saved_count++; - - if (!struct_exists(obj_ncombat.vehicles_saved_counts, _vehicle_type)) { - obj_ncombat.vehicles_saved_counts[$ _vehicle_type] = 1; - } else { - obj_ncombat.vehicles_saved_counts[$ _vehicle_type]++; - } - continue; - } - } - - if (vehicle_recovery_score > 0) { - _column_id.veh_hp[_vehicle_id] = roll_dice(1, 10, "high"); - _column_id.veh_dead[_vehicle_id] = false; - vehicle_recovery_score -= _candidate.priority; - vehicles_saved_count++; - - if (!struct_exists(obj_ncombat.vehicles_saved_counts, _vehicle_type)) { - obj_ncombat.vehicles_saved_counts[$ _vehicle_type] = 1; - } else { - obj_ncombat.vehicles_saved_counts[$ _vehicle_type]++; - } - } - } - ds_priority_destroy(vehicles_to_recover); -} - - -with (obj_pnunit) { - after_battle_part2(); -} - -var _total_deaths = final_marine_deaths + final_command_deaths; -var _total_injured = _total_deaths + injured + units_saved_count; -if (_total_injured > 0) { - newline = $"{string_plural_count("unit", _total_injured)} {smart_verb("was", _total_injured)} critically injured."; - newline_color = "red"; - scr_newtext(); - - if (units_saved_count > 0) { - var _units_saved_string = ""; - var _unit_roles = struct_get_names(units_saved_counts); - - for (var i = 0; i < array_length(_unit_roles); i++) { - var _unit_role = _unit_roles[i]; - var _saved_count = units_saved_counts[$ _unit_role]; - _units_saved_string += $"{string_plural_count(_unit_role, _saved_count)}"; - _units_saved_string += smart_delimeter_sign(_unit_roles, i, false); - } - - newline = $"{units_saved_count}x {smart_verb("was", units_saved_count)} saved by the {string_plural(roles[eROLE.Apothecary], apothecaries_alive)}. ({_units_saved_string})"; - scr_newtext(); - } - - if (injured > 0) { - newline = $"{injured}x survived thanks to the Sus-an Membrane."; - newline_color = "red"; - scr_newtext(); - } - - if (_total_deaths > 0) { - var _units_lost_string = ""; - var _unit_roles = struct_get_names(units_lost_counts); - for (var i = 0; i < array_length(_unit_roles); i++) { - var _unit_role = _unit_roles[i]; - var _lost_count = units_lost_counts[$ _unit_role]; - _units_lost_string += $"{string_plural_count(_unit_role, _lost_count)}"; - _units_lost_string += smart_delimeter_sign(_unit_roles, i, false); - } - newline += $"{_total_deaths} units succumbed to their wounds! ({_units_lost_string})"; - newline_color="red"; - scr_newtext(); - - } - - newline = " "; - scr_newtext(); -} - - -if (ground_mission){ - if (apothecaries_alive < 0){ - obj_ground_mission.apothecary_present = apothecaries_alive; - } -}; - -if (seed_lost > 0) { - if (obj_ini.doomed) { - newline = $"Chapter mutation prevents retrieving gene-seed. {seed_lost} gene-seed lost."; - scr_newtext(); - } else if (!apothecaries_alive) { - newline = $"No able-bodied {roles[eROLE.Apothecary]}. {seed_lost} gene-seed lost."; - scr_newtext(); - } else { - seed_saved = min(seed_harvestable, apothecaries_alive * 40); - newline = $"{seed_saved} gene-seed was recovered; {seed_lost - seed_harvestable} was lost due damage; {seed_harvestable - seed_saved} was left to rot;"; - scr_newtext(); - } - - if (seed_saved > 0) { - obj_controller.gene_seed += seed_saved; - } - - newline = " "; - scr_newtext(); -} - -if (red_thirst>2){ - var voodoo=""; - - if (red_thirst=3) then voodoo="1 Battle Brother lost to the Red Thirst."; - if (red_thirst>3) then voodoo=string(red_thirst-2)+" Battle Brothers lost to the Red Thirst."; - - newline=voodoo;newline_color="red"; - scr_newtext(); - newline=" "; - scr_newtext(); -} - -newline = " "; -scr_newtext(); - - -var _total_damaged_count = vehicle_deaths + vehicles_saved_count; -if (_total_damaged_count > 0) { - newline = $"{string_plural_count("vehicle", _total_damaged_count)} {smart_verb("was", _total_damaged_count)} critically damaged during battle."; - newline_color="red"; - scr_newtext(); - - if (vehicles_saved_count > 0) { - var _vehicles_saved_string = ""; - var _vehicle_types = struct_get_names(vehicles_saved_counts); - - for (var i = 0; i < array_length(_vehicle_types); i++) { - var _vehicle_type = _vehicle_types[i]; - var _saved_count = vehicles_saved_counts[$ _vehicle_type]; - _vehicles_saved_string += $"{string_plural_count(_vehicle_type, _saved_count)}"; - _vehicles_saved_string += smart_delimeter_sign(_vehicle_types, i, false); - } - - newline = $"{string_plural(roles[eROLE.Techmarine], techmarines_alive)} {smart_verb("was", techmarines_alive)} able to restore {vehicles_saved_count}. ({_vehicles_saved_string})"; - scr_newtext(); - } - - if (vehicle_deaths > 0) { - var _vehicles_lost_string = ""; - var _vehicle_types = struct_get_names(vehicles_lost_counts); - - for (var i = 0; i < array_length(_vehicle_types); i++) { - var _vehicle_type = _vehicle_types[i]; - var _lost_count = vehicles_lost_counts[$ _vehicle_type]; - _vehicles_lost_string += $"{string_plural_count(_vehicle_type, _lost_count)}"; - _vehicles_lost_string += smart_delimeter_sign(_vehicle_types, i, false); - } - - newline += $"{vehicle_deaths} {smart_verb("was", vehicle_deaths)} lost forever. ({_vehicles_lost_string})"; - newline_color="red"; - scr_newtext(); - } - - newline = " "; - scr_newtext(); -} - - - -if (post_equipment_lost[1]!=""){ - part6="Equipment Lost: "; - - part7 += arrays_to_string_with_counts(post_equipment_lost, post_equipments_lost, true, false); - if (ground_mission){ - part7 += " Some may be recoverable." - } - newline=part6; - scr_newtext(); - newline=part7; - scr_newtext(); - newline=" "; - scr_newtext(); -} - - - -if (total_battle_exp_gain>0){ - with (obj_pnunit) { - assemble_alive_units(); - } - average_battle_exp_gain = distribute_experience(end_alive_units, total_battle_exp_gain); // Due to cool alarm timer shitshow, I couldn't think of anything but to put it here. - newline = $"Each marine gained {average_battle_exp_gain} experience, reduced by their total experience."; - scr_newtext(); - - var _upgraded_librarians_count = array_length(upgraded_librarians); - if (_upgraded_librarians_count > 0) { - for (var i = 0; i < _upgraded_librarians_count; i++) { - if (i > 0) { - newline += ", "; - } - newline += $"{upgraded_librarians[i].name_role()}"; - } - newline += " learned new psychic powers after gaining enough experience." - scr_newtext(); - } - - newline=" "; - scr_newtext(); -} - -if (ground_mission){ - obj_ground_mission.post_equipment_lost = post_equipment_lost - obj_ground_mission.post_equipments_lost = post_equipments_lost -} - -if (slime>0){ - var slime_string=$"Faulty Mucranoid and other afflictions have caused damage to the equipment. {slime} Forge Points will be allocated for repairs."; - newline=slime_string; - newline_color="red"; - scr_newtext(); - - newline=" "; - scr_newtext(); -} - -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; - -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+=$" has decreased to {fortified-1} ({fortified}-1)"; - newline=part9; - scr_newtext(); - battle_object.p_fortified[battle_id]-=1; -} - - -/*if (enemy=5){ - if (obj_controller.faction_status[eFACTION.Ecclesiarchy]!="War"){ - - } -}*/ - - - - - -if (defeat=0) and (battle_special="space_hulk"){ - var enemy_power=0,loot=0,dicey=floor(random(100))+1,ex=0; - - if (enemy=7){ - enemy_power=battle_object.p_orks[battle_id]; - battle_object.p_orks[battle_id]-=1; - } - else if (enemy=9){ - enemy_power=battle_object.p_tyranids[battle_id]; - battle_object.p_tyranids[battle_id]-=1; - } - else if (enemy=10){ - enemy_power=battle_object.p_traitors[battle_id]; - battle_object.p_traitors[battle_id]-=1; - } - - part10="Space Hulk Exploration at "; - ex=min(100,100-((enemy_power-1)*20)); - part10+=string(ex)+"%"; - newline=part10; - if (ex=100) then newline_color="red"; - scr_newtext(); - - if (scr_has_disadv("Shitty Luck")) then dicey=dicey*1.5; - // show_message("Roll Under: "+string(enemy_power*10)+", Roll: "+string(dicey)); - - if (dicey<=(enemy_power*10)){ - loot=choose(1,2,3,4); - if (enemy!=10) then loot=choose(1,1,2,3); - hulk_treasure=loot; - if (loot>1) then newline="Valuable items recovered."; - if (loot=1) then newline="Resources have been recovered."; - newline_color="yellow"; - scr_newtext(); - } -} - - -if (string_count("ruins",battle_special)>0){ - if (defeat=0) then newline="Ancient Ruins cleared."; - if (defeat=1) then newline="Failed to clear Ancient Ruins."; - newline_color="yellow"; - scr_newtext(); -} - -var reduce_power=true; -if (battle_special="tyranid_org") then reduce_power=false; -if (battle_special="ship_demon") then reduce_power=false; -if (string_count("_attack",battle_special)>0) then reduce_power=false; -if (string_count("ruins",battle_special)>0) then reduce_power=false; -if (battle_special="space_hulk") then reduce_power=false; -if (battle_special="fallen1") then reduce_power=false; -if (battle_special="fallen2") then reduce_power=false; -if (battle_special="study2a") then reduce_power=false; -if (battle_special="study2b") then reduce_power=false; -if (defeat=0) and (reduce_power=true){ - var enemy_power,new_power, power_reduction, final_pow, requisition_reward; - enemy_power=0;new_power=0; power_reduction=0; requisition_reward=0; - - if (enemy=2){ - enemy_power=battle_object.p_guardsmen[battle_id]; - battle_object.p_guardsmen[battle_id]-=threat; - // if (threat=1) or (threat=2) then battle_object.p_guardsmen[battle_id]=0; - } - - if (enemy=5){ - enemy_power=battle_object.p_sisters[battle_id]; - part10="Ecclesiarchy"; - } - else if (enemy=6){ - enemy_power=battle_object.p_eldar[battle_id]; - part10="Eldar"; - } - else if (enemy=7){ - enemy_power=battle_object.p_orks[battle_id]; - part10="Ork"; - } - else if (enemy=8){ - enemy_power=battle_object.p_tau[battle_id]; - part10="Tau"; - } - else if (enemy=9){ - enemy_power=battle_object.p_tyranids[battle_id]; - part10="Tyranid"; - } - else if (enemy=10){ - enemy_power=battle_object.p_traitors[battle_id]; - part10="Heretic";if (threat=7) then part10="Daemon"; - } - else if (enemy=11){ - enemy_power=battle_object.p_chaos[battle_id]; - part10="Chaos Space Marine";} - else if (enemy=13){ - enemy_power=battle_object.p_necrons[battle_id]; - part10="Necrons"; - } - - if (instance_exists(battle_object)) and (enemy_power>2){ - if (awake_tomb_world(battle_object.p_feature[battle_id])!=0){ - scr_gov_disp(battle_object.name,battle_id,floor(enemy_power/2)); - } - } - - - if (enemy!=2){ - if (dropping == true || defending == true) { - power_reduction = 1; - } else { - power_reduction = 2; - } - new_power = enemy_power - power_reduction; - new_power = max(new_power, 0); - - // Give some money for killing enemies? - var _quad_factor = 6; - requisition_reward = _quad_factor * sqr(threat); - obj_controller.requisition += requisition_reward; - - //(¿?) Ramps up threat/enemy presence in case enemy Type == "Daemon" (¿?) - //Does the inverse check/var assignment 10 lines above - if (part10="Daemon") then new_power=7; - if (enemy=9) and (new_power==0){ - var battle_planet = battle_id; - with (battle_object){ - var who_cleansed="Tyranids"; - var who_return=""; - var make_alert = true; - var planet_string = $"{name} {scr_roman(battle_planet)}"; - if (planet_feature_bool(p_feature[battle_planet], P_features.Gene_Stealer_Cult)==1){ - who_cleansed="Gene Stealer Cult" - make_alert=true; - delete_features(p_feature[battle_planet], P_features.Gene_Stealer_Cult); - adjust_influence(eFACTION.Tyranids, -25, battle_planet); - } - if (make_alert){ - if (p_first[battle_planet] == 1){ - who_return = "your"; - p_owner[battle_planet] = eFACTION.Player; - } else if (p_first[battle_planet] == 3 || p_type[battle_planet]=="Forge"){ - who_return="mechanicus"; - obj_controller.disposition[3] += 10; - p_owner[battle_planet] = eFACTION.Mechanicus - }else if (p_type[battle_planet]!="Dead"){ - who_return="the governor"; - if (who_cleansed=="tau"){ - who_return="a more suitable governer" - } - p_owner[battle_planet] = eFACTION.Imperium - } - dispo[battle_planet] += 10; - scr_event_log("", $"{who_cleansed} cleansed from {planet_string}", name); - scr_alert("green", "owner", $"{who_cleansed} cleansed from {planet_string}. Control returned to {who_return}", x, y); - if (dispo[battle_planet] >= 101) then p_owner[battle_planet] = 1; - } - } - } - if (enemy=11) and (enemy_power!=floor(enemy_power)) then enemy_power=floor(enemy_power); - } - - - if ((obj_controller.blood_debt=1) and (defeat=0) && enemy_power>0){ - final_pow = min(enemy_power, 6)-1; - if (enemy=6) or (enemy=9) or (enemy=11) or (enemy=13){ - obj_controller.penitent_turn=0; - obj_controller.penitent_turnly=0; - var penitent_crusade_chart = [25,62,95,190,375,750]; - - final_pow = min(enemy_power, 6)-1; - obj_controller.penitent_current+=penitent_crusade_chart[final_pow]; - - } - else if (enemy=7) or (enemy=8) or (enemy=10){ - obj_controller.penitent_turn=0; - obj_controller.penitent_turnly=0; - final_pow = min(enemy_power, 7)-1; - var penitent_crusade_chart = [25,50,75,150,300,600, 1500]; - obj_controller.penitent_current+=penitent_crusade_chart[final_pow]; - } - } - - if (enemy=5){battle_object.p_sisters[battle_id]=new_power;} - else if (enemy=6){battle_object.p_eldar[battle_id]=new_power;} - else if (enemy=7){battle_object.p_orks[battle_id]=new_power;} - else if (enemy=8){battle_object.p_tau[battle_id]=new_power;} - else if (enemy=9){battle_object.p_tyranids[battle_id]=new_power;} - else if (enemy=10){battle_object.p_traitors[battle_id]=new_power;} - else if (enemy=11){battle_object.p_chaos[battle_id]=new_power;} - else if (enemy=13){battle_object.p_necrons[battle_id]=new_power;} - - if (enemy!=2) and (string_count("cs_meeting_battle",battle_special)=0){ - part10+=" forces on "+string(battle_loc); - if (battle_id=1) then part10+=" I"; - if (battle_id=2) then part10+=" II"; - if (battle_id=3) then part10+=" III"; - if (battle_id=4) then part10+=" IV"; - if (battle_id=5) then part10+=" V"; - if (new_power == 0){ - part10+=$" were completely wiped out. Previous power: { - enemy_power}. Reduction: {power_reduction}."; - } else { - part10+=$" were reduced to {new_power} after this battle. Previous power: { - enemy_power}. Reduction: {power_reduction}."; - } - newline=part10; - scr_newtext(); - part10 = $"Received {requisition_reward} requisition points as a reward for slaying enemies of the Imperium."; - newline=part10; - scr_newtext(); - - if (new_power<=0) and (enemy_power>0) then battle_object.p_raided[battle_id]=1; - } - if (enemy=2){ - part10+=" Imperial Guard Forces on "+string(battle_loc); - if (battle_id=1) then part10+=" I"; - if (battle_id=2) then part10+=" II"; - if (battle_id=3) then part10+=" III"; - if (battle_id=4) then part10+=" IV"; - if (battle_id=5) then part10+=" V"; - part10+=" were reduced to "+string(battle_object.p_guardsmen[battle_id])+" ("+string(enemy_power)+"-"+string(threat)+")"; - newline=part10;scr_newtext(); - } - - - - if (enemy=8) and (ethereal>0) and (defeat=0){ - newline="Tau Ethereal Captured"; - newline_color="yellow"; - scr_newtext(); - } - - if (enemy=13) and (battle_object.p_necrons[battle_id]<3) and (awake_tomb_world(battle_object.p_feature[battle_id])== 1){ - - // var bombs;bombs=scr_check_equip("Plasma Bomb",battle_loc,battle_id,0); - // var bombs;bombs=scr_check_equip("Plasma Bomb","","",0); - - // show_message(string(bombs)); - - if (plasma_bomb>0){ - // scr_check_equip("Plasma Bomb",battle_loc,battle_id,1); - // scr_check_equip("Plasma Bomb","","",1); - newline="Plasma Bomb used to seal the Necron Tomb."; - newline_color="yellow"; - scr_newtext(); - seal_tomb_world(battle_object.p_feature[battle_id]) - } - - if (plasma_bomb<=0){ - battle_object.p_necrons[battle_id]=3;// newline_color="yellow"; - if (dropping!=0) then newline="Deep Strike Ineffective; Plasma Bomb required"; - if (dropping=0) then newline="Attack Ineffective; Plasma Bomb required"; - scr_newtext(); - } - - // popup here - /* - var pip; - pip=instance_create(0,0,obj_popup); - pip.title="Necron Tombs"; - pip.text="The Necrons have been defeated on the surface, but remain able to replenish their numbers and recuperate. Do you wish to advance your army into the tunnels?"; - pip.image="necron_tunnels_1"; - pip.cooldown=15; - cooldown=15; - - pip.option1="Advance!"; - pip.option2="Cancel the attack";*/ - - - - - } - - - - - - /*if (enemy=13) and (new_power<=0) and (dropping=0){ - var bombs;bombs=scr_check_equip("Plasma Bomb",battle_loc,battle_id,0); - if (bombs>0){ - scr_check_equip("Plasma Bomb",battle_loc,battle_id,1); - newline="Plasma Bomb used to seal the Necron Tomb.";newline_color="yellow";scr_newtext(); - if (battle_object.p_feature[battle_id]="Awakened Necron Tomb") then battle_object.p_feature[battle_id]="Necron Tomb"; - } - }*/ -} - -if (defeat=0) and (enemy=9) and (battle_special="tyranid_org"){ - // show_message(string(captured_gaunt)); - if (captured_gaunt=1) then newline=captured_gaunt+" Gaunt organism have been captured."; - if (captured_gaunt>1) or (captured_gaunt=0) then newline=captured_gaunt+" Gaunt organisms have been captured."; - scr_newtext(); - - if (captured_gaunt>0){ - var why,thatta;why=0;thatta=0; - instance_activate_object(obj_star); - // with(obj_star){if (name!=obj_ncombat.battle_loc) then instance_deactivate_object(id);} - // thatta=obj_star; - - with(obj_star){ - remove_star_problem("tyranid_org"); - } - } - - scr_event_log("","Inquisition Mission Completed: A Gaunt organism has been captured for the Inquisition."); - - if (captured_gaunt>1){ - if (instance_exists(obj_turn_end)) then scr_popup("Inquisition Mission Completed","You have captured several Gaunt organisms. The Inquisitor is pleased with your work, though she notes that only one is needed- the rest are to be purged. It will be stored until it may be retrieved. The mission is a success.","inquisition",""); - } - if (captured_gaunt=1){ - if (instance_exists(obj_turn_end)) then scr_popup("Inquisition Mission Completed","You have captured a Gaunt organism- the Inquisitor is pleased with your work. The Tyranid will be stored until it may be retrieved. The mission is a success.","inquisition",""); - } - instance_deactivate_object(obj_star); -} - - -newline=line_break; -scr_newtext(); -newline=line_break; -scr_newtext(); - -if (((leader)) or ((battle_special="world_eaters") and (!obj_controller.faction_defeated[10]))) and (!defeat){ - var nep;nep=false; - newline="The enemy Leader has been killed!";newline_color="yellow";scr_newtext(); - newline=line_break; - scr_newtext(); - newline=line_break; - scr_newtext(); - instance_activate_object(obj_event_log); - if (enemy=5) then scr_event_log("","Enemy Leader Assassinated: Ecclesiarchy Prioress"); - if (enemy=6) then scr_event_log("","Enemy Leader Assassinated: Eldar Farseer"); - if (enemy=7){ - scr_event_log("","Enemy Leader Assassinated: Ork Warboss"); - if (Warlord !=0){ - with (Warlord){ - kill_warboss(); - } - } - } - if (enemy=8) then scr_event_log("","Enemy Leader Assassinated: Tau Diplomat"); - if (enemy=10) then scr_event_log("","Enemy Leader Assassinated: Chaos Lord"); -} - -var endline,inq_eated;endline=1; -inq_eated=false; - - -if (obj_ini.omophagea){ - var eatme=floor(random(100))+1; - if (enemy=13) or (enemy=9) or (battle_special="ship_demon") then eatme+=100; - if (enemy=10) and (battle_object.p_traitors[battle_id]=7) then eatme+=200; - - if (red_thirst=3) then thirsty=1;if (red_thirst>3) then thirsty=red_thirst-2; - if (thirsty>0) then eatme-=(thirsty*6);if (really_thirsty>0) then eatme-=(really_thirsty*15); - if (scr_has_disadv("Shitty Luck")) then eatme-=10; - - if (allies>0){ - obj_controller.disposition[2]-=choose(1,0,0); - obj_controller.disposition[4]-=choose(0,0,1); - obj_controller.disposition[5]-=choose(0,0,1); - } - if (present_inquisitor>0) then obj_controller.disposition[4]-=2; - - if (eatme<=25){endline=0; - if (thirsty=0) and (really_thirsty=0){ - var ran;ran=choose(1,2); - newline="One of your marines slowly makes his way towards the fallen enemies, as if in a spell. Once close enough the helmet is removed and he begins shoveling parts of their carcasses into his mouth."; - newline="Two marines are sharing a quick discussion, and analysis of the battle, when one of the two suddenly drops down and begins shoveling parts of enemy corpses into his mouth."; - newline+=choose(" Bone snaps and pops."," Strange-colored blood squirts from between his teeth."," Veins and tendons squish wetly."); - } - if (thirsty>0) and (really_thirsty=0){ - var ran=choose(1,2); - newline="One of your Death Company marines slowly makes his way towards the fallen enemies, as if in a spell. Once close enough the helmet is removed and he begins shoveling parts of their carcasses into his mouth."; - newline="A marine is observing and communicating with a Death Company marine, to ensure they are responsive, when that Death Company marine drops down and suddenly begins shoveling parts of enemy corpses into his mouth."; - newline+=choose(" Bone snaps and pops."," Strange-colored blood squirts from between his teeth."," Veins and tendons squish wetly."); - } - if (really_thirsty>0){ - newline=$"One of your Death Company {roles[6]} blitzes to the fallen enemy lines. Massive mechanical hands begin to rend and smash at the fallen corpses, trying to squeeze their flesh and blood through the sarcophogi opening."; - } - - newline+=" Almost at once most of the present "+string(global.chapter_name)+" follow suite, joining in and starting a massive feeding frenzy. The sight is gruesome to behold."; - scr_newtext(); - - - // check for pdf/guardsmen - eatme=floor(random(100))+1; - if (scr_has_disadv("Shitty Luck")) then eatme-=10; - if (eatme<=10) and (allies>0){ - obj_controller.disposition[2]-=2; - if (allies=1){ - newline="Local PDF have been eaten!"; - newline_color="red";scr_newtext(); - } - else if (allies=2){ - newline="Local Guardsmen have been eaten!"; - newline_color="red"; - scr_newtext(); - } - } - - // check for inquisitor - eatme=floor(random(100))+1; - if (scr_has_disadv("Shitty Luck")) then eatme-=5; - if (eatme<=40) and (present_inquisitor=1){ - var thatta=0,remove=0,i=0; - obj_controller.disposition[4]-=10; - inq_eated=true; - instance_activate_object(obj_en_fleet); - - if (instance_exists(inquisitor_ship)){ - repeat(2){ - 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,remove=0; - // if (string_count("Inqis",inquisitor_ship.trade_goods)>0) then show_message("B"); - if (inquisitor_ship.inquisitor>0){ - var inquis_name = obj_controller.inquisitor[inquisitor_ship.inquisitor]; - newline=$"Inquisitor {inquis_name} has been eaten!"; - msg=$"Inquisitor {inquis_name}" - remove=obj_controller.inquisitor[inquisitor_ship.inquisitor]; - scr_event_log("red",$"Your Astartes consume {msg}."); - } - newline_color="red"; - scr_newtext(); - if (obj_controller.inquisitor_type[remove]="Ordo Hereticus") then scr_loyalty("Inquisitor Killer","+"); - - i=remove; - repeat(10-remove){ - if (i<10){ - obj_controller.inquisitor_gender[i]=obj_controller.inquisitor_gender[i+1]; - obj_controller.inquisitor_type[i]=obj_controller.inquisitor_type[i+1]; - obj_controller.inquisitor[i]=obj_controller.inquisitor[i+1]; - } - if (i=10){ - obj_controller.inquisitor_gender[i]=choose(0,0,0,1,1,1,1); // 4:3 chance of male Inquisitor - obj_controller.inquisitor_type[i]=choose("Ordo Malleus","Ordo Xenos","Ordo Hereticus","Ordo Hereticus","Ordo Hereticus","Ordo Hereticus","Ordo Hereticus","Ordo Hereticus"); - obj_controller.inquisitor[i]=global.name_generator.generate_imperial_name(obj_controller.inquisitor_gender[i]);// For 'random inquisitor wishes to inspect your fleet - } - i+=1; - } - - instance_activate_object(obj_turn_end); - if (obj_controller.known[eFACTION.Inquisition]<3){ - scr_event_log("red","EXCOMMUNICATUS TRAITORUS"); - obj_controller.alarm[8]=1; - if ((!instance_exists(obj_turn_end))){ - var pip=instance_create(0,0,obj_popup); - pip.title="Inquisitor Killed"; - pip.text=msg; - pip.image="inquisition"; - pip.cooldown=30; - pip.title="EXCOMMUNICATUS TRAITORUS"; - pip.text=$"The Inquisition has noticed your uncalled CONSUMPTION of {msg} and declared your chapter Excommunicatus Traitorus."; - instance_deactivate_object(obj_popup); - } else { - scr_popup("Inquisitor Killed",$"The Inquisition has noticed your uncalled CONSUMPTION of {msg} and declared your chapter Excommunicatus Traitorus.","inquisition",""); - } - } - instance_deactivate_object(obj_turn_end); - - with(inquisitor_ship){instance_destroy();} - with(obj_ground_mission){instance_destroy();} - } - instance_deactivate_object(obj_star); - instance_deactivate_object(obj_en_fleet); - } - } -} - -if (inq_eated=false) and (obj_ncombat.sorcery_seen>=2){ - scr_loyalty("Use of Sorcery","+"); - newline="Inquisitor "+string(obj_controller.inquisitor[1])+" witnessed your Chapter using sorcery."; - scr_event_log("green",string(newline)); - scr_newtext(); -} - -if (exterminatus>0) and (dropping!=0){ - newline="Exterminatus has been succesfully placed."; - newline_color="yellow"; - endline=0; - scr_newtext(); -} - -instance_activate_object(obj_star); -instance_activate_object(obj_turn_end); - -//If not fleet based and... -if (obj_ini.fleet_type != ePlayerBase.home_world) and (defeat==1) and (dropping==0){ - var monastery_list = search_planet_features(battle_object.p_feature[obj_ncombat.battle_id], P_features.Monastery); - var monastery_count = array_length(monastery_list); - if(monastery_count>0){ - for (var mon = 0;mon < monastery_count;mon++){ - 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."; - - scr_event_log("red",newline, battle_object.name); - instance_activate_object(obj_event_log); - newline_color="red";scr_newtext(); - - var lasers_lost,defenses_lost,silos_lost; - lasers_lost=0;defenses_lost=0;silos_lost=0; - - if (player_defenses>0){ - defenses_lost=round(player_defenses*0.75); - } - if (battle_object.p_silo[obj_ncombat.battle_id]>0){ - silos_lost=round(battle_object.p_silo[obj_ncombat.battle_id]*0.75); - } - if (battle_object.p_lasers[obj_ncombat.battle_id]>0){ - lasers_lost=round(battle_object.p_lasers[obj_ncombat.battle_id]*0.75); - } - - if (player_defenses<30) then defenses_lost=player_defenses; - if (battle_object.p_silo[obj_ncombat.battle_id]<30){ - silos_lost=battle_object.p_silo[obj_ncombat.battle_id]; - } - if (battle_object.p_lasers[obj_ncombat.battle_id]<8){ - lasers_lost=battle_object.p_lasers[obj_ncombat.battle_id]; - } - - var percent;percent=0;newline=""; - if (defenses_lost>0){ - percent=round((defenses_lost/player_defenses)*100); - newline=string(defenses_lost)+" Weapon Emplacements have been lost ("+string(percent)+"%)."; - } - if (silos_lost>0){ - percent=round((silos_lost/battle_object.p_silo[obj_ncombat.battle_id])*100); - if (defenses_lost>0) then newline+=" "; - newline+=string(silos_lost)+$" Missile Silos have been lost ({percent}%)."; - } - if (lasers_lost>0){ - percent=round((lasers_lost/battle_object.p_lasers[obj_ncombat.battle_id])*100); - if (silos_lost>0) or (defenses_lost>0) then newline+=" "; - newline+=string(lasers_lost)+" Defense Lasers have been lost ("+string(percent)+"%)."; - } - - battle_object.p_defenses[obj_ncombat.battle_id]-=defenses_lost; - battle_object.p_silo[obj_ncombat.battle_id]-=silos_lost; - battle_object.p_lasers[obj_ncombat.battle_id]-=lasers_lost; - if (defenses_lost+silos_lost+lasers_lost>0){newline_color="red";scr_newtext();} - - endline=0; - - if (obj_controller.und_gene_vaults=0){ - //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); - } -} -instance_deactivate_object(obj_star); -instance_deactivate_object(obj_turn_end); - -if (endline=0){ - newline=line_break; - scr_newtext(); - newline=line_break; - scr_newtext(); -} - - -if (defeat=1){ - player_forces=0; - if (ground_mission){ - obj_ground_mission.recoverable_gene_seed = seed_lost; - } - -} - -gene_slaves = []; - -instance_deactivate_object(obj_star); -instance_deactivate_object(obj_ground_mission); - -show_debug_message($"{started}"); -/* */ -/* */ diff --git a/objects/obj_ncombat/Alarm_7.gml b/objects/obj_ncombat/Alarm_7.gml deleted file mode 100644 index 467ead9d9e..0000000000 --- a/objects/obj_ncombat/Alarm_7.gml +++ /dev/null @@ -1,695 +0,0 @@ -try { - // show_debug_message("alarm 7 start"); - audio_stop_sound(snd_battle); - audio_play_sound(snd_royal,0,true); - audio_sound_gain(snd_royal, 0, 0); - var nope=0;if (obj_controller.master_volume=0) or (obj_controller.music_volume=0) then nope=1; - if (nope!=1){ - audio_sound_gain(snd_royal,0.25*obj_controller.master_volume*obj_controller.music_volume,2000); - } - - // scr_dead_marines(1); - - // Execute the cleaning scripts - // Check for any more battles - - obj_controller.cooldown=10; - - - log_message($"Ground Combat - {defeat ? "Defeat" : "Victory"}Victory - Enemy:{enemy} ({battle_special})"); - - - // If battling own dudes, then remove the loyalists after the fact - - - if (enemy=1){ - - var j=-1 - var cleann = array_create(11,false) - with(obj_enunit){var q=0; - repeat(700){ - q+=1; - if (dude_id[q]>0){ - var commandy=false; - var nco=dude_co[q]; - var nid=dude_id[q]; - cleann[nco]=true; - - // show_message("dude ID:"+string(q)+" ("+string(obj_ini.name[nco,nid])+") is being removed from the array"); - - commandy=is_specialist(obj_ini.role[nco,nid]); - if (commandy=true) then obj_controller.command-=1; - if (commandy=false) then obj_controller.marines-=1; - - obj_ncombat.world_size+=scr_unit_size(obj_ini.armour[nco][nid],obj_ini.role[nco][nid],true, obj_ini.mobi[nco][nid]); - - var recover = !obj_ncombat.defeat - kill_and_recover(nco,nid, recover, recover); - } - } - } - - for (j=0;j<=10;j++){ - if (cleann[j]) then with(obj_ini){ - scr_company_order(j); - } - } - } - if (string_count("cs_meeting",battle_special)>0){ - with(obj_temp_meeting){instance_destroy();} - - with(obj_star){ - if (name=obj_ncombat.battle_loc){ - instance_create(x,y,obj_temp_meeting); - var i=0,ii=0,otm,good=0,master_present=0; - var run=0,s=0,chaos_meeting=0; - - var master_index = array_get_index(obj_ini.role[0], "Chapter Master"); - chaos_meeting=fetch_unit([0,master_index]).planet_location; - - // show_message("meeting planet:"+string(chaos_meeting)); - for (var co=0;co<=10;co++){ - for (var i=0;i=3) then show_message(string(obj_ini.role[co][i])+": "+string(co)+"."+string(i)); - - if (good>=3){ - obj_temp_meeting.dudes+=1; - otm=obj_temp_meeting.dudes; - obj_temp_meeting.present[otm]=1; - obj_temp_meeting.co[otm]=co; - obj_temp_meeting.ide[otm]=i; - if (obj_ini.role[co][i]="Chapter Master") then master_present=1; - } - } - } - // show_message("obj_temp_meeting.dudes:"+string(obj_temp_meeting.dudes)); - - } - } - } - - - - - that = array_get_index(post_equipment_lost,"Company Standard"); - if (that!=-1){ - repeat(post_equipments_lost[that]){ - scr_loyalty("Lost Standard","+"); - } - } - - if (battle_special="ruins" || battle_special="ruins_eldar"){ - obj_ground_mission.defeat=defeat; - obj_ground_mission.explore_feature.ruins_combat_end(); - } - - else if (battle_special="WL10_reveal") or (battle_special="WL10_later"){var moar,ox,oy; - with(obj_temp8){instance_destroy();} - - if (chaos_angry>=5){ - if (string_count("|CPF|",obj_controller.useful_info)=0) then obj_controller.useful_info+="|CPF|"; - } - - if (battle_special="WL10_reveal"){ - instance_create(battle_object.x,battle_object.y,obj_temp8); - ox=battle_object.x;oy=battle_object.y;// battle_object.owner = eFACTION.Chaos; - battle_object.p_traitors[battle_id]=6; - battle_object.p_chaos[battle_id]=4; - battle_object.p_pdf[battle_id]=0; - battle_object.p_owner[battle_id]=10; - - var corro;corro=0; - - repeat(100){var ii;ii=0; - if (corro<=5){ - moar=instance_nearest(ox,oy,obj_star); - - if (moar.owner<=3){corro+=1; - repeat(4){ii+=1; - if (moar.p_owner[ii]<=3) moar.p_heresy[ii]=min(100,moar.p_heresy[ii]+floor(random_range(30,50))); - } - } - moar.y-=20000; - } - } - with(obj_star){if (y<-12000) then y+=20000;} - - if (battle_object.present_fleet[2]>0){ - with(obj_en_fleet){ - if (navy=0) and (owner = eFACTION.Imperium) and (point_distance(x,y,obj_temp8.x,obj_temp8.y)<40){ - owner = eFACTION.Chaos;sprite_index=spr_fleet_chaos; - if (image_index<=2){escort_number+=3;frigate_number+=1;} - if (capital_number=0) then capital_number+=1; - } - } - battle_object.present_fleet[2]-=1; - battle_object.present_fleet[10]+=1; - } - with(obj_temp8){instance_destroy();} - } - - if (defeat=1) and (battle_special="WL10_reveal"){ - obj_controller.audience=10; - obj_controller.menu=20; - obj_controller.diplomacy=10; - obj_controller.known[eFACTION.Chaos]=2; - with(obj_controller){scr_dialogue("intro2");} - } - if (defeat=0){ - obj_controller.known[eFACTION.Chaos]=2; - obj_controller.faction_defeated[10]=1; - - if (instance_exists(obj_turn_end)){ - scr_event_log("","Enemy Leader Assassinated: Chaos Lord"); - scr_alert("","ass","Chaos Lord "+string(obj_controller.faction_leader[eFACTION.Chaos])+" has been killed.",0,0); - scr_popup("Chaos Lord Killed","Chaos Lord "+string(obj_controller.faction_leader[eFACTION.Chaos])+" has been slain in combat. Without his leadership the various forces of Chaos in the sector will crumble apart and disintegrate from infighting. Sector "+string(obj_ini.sector_name)+" is no longer as threatened by the forces of Chaos.","",""); - } - if (!instance_exists(obj_turn_end)){ - scr_event_log("","Enemy Leader Assassinated: Chaos Lord"); - var pop=instance_create(0,0,obj_popup); - pop.image=""; - pop.title="Chaos Lord Killed"; - pop.text="Chaos Lord "+string(obj_controller.faction_leader[eFACTION.Chaos])+" has been slain in combat. Without his leadership the various forces of Chaos in the sector will crumble apart and disintegrate from infighting. Sector "+string(obj_ini.sector_name)+" is no longer as threatened by the forces of Chaos."; - } - - } - } - - - - - if (battle_special="study2a") or (battle_special="study2b"){ - if (defeat=1){ - var ii=0,good=0; - - if (remove_planet_problem(battle_id, "mech_tomb", battle_object)){ - obj_controller.disposition[3]-=10; - - if (battle_special="study2a"){ - scr_popup("Mechanicus Mission Failed","All of your Astartes and the Mechanicus Research party have been killed down to the last man. The research is a bust, and the Adeptus Mechanicus is furious with your chapter for not providing enough security. Relations with them are worse than before.","",""); - } - if (battle_special="study2b"){ - battle_object.p_necrons[battle_id]=5; - awaken_tomb_world( battle_object.p_feature[battle_id]) - obj_controller.disposition[3]-=15;obj_controller.disposition[4]-=5; - scr_popup("Mechanicus Mission Failed","All of your Astartes and the Mechanicus Research party have been killed down to the last man. The research is a bust. To make matters worse the Necron Tomb has fully awakened- countless numbers of the souless machines are now pouring out of the tomb. The Adeptus Mechanicus are furious with your chapter.","necron_army",""); - scr_alert("","inqi","The Inquisition is displeased with your Chapter for tampering with and awakening a Necron Tomb",0,0); - scr_event_log("","The Inquisition is displeased with your Chapter for tampering with and awakening a Necron Tomb"); - } - - scr_event_log("","Mechanicus Mission Failed: Necron Tomb Research Party and present astartes have been killed."); - } - } - } - - - - - if (enemy=5) and (obj_controller.faction_status[eFACTION.Ecclesiarchy]!="War"){ - obj_controller.loyalty-=50;obj_controller.loyalty_hidden-=50; - obj_controller.disposition[2]-=50;obj_controller.disposition[3]-=80; - obj_controller.disposition[4]-=40;obj_controller.disposition[5]-=30; - - obj_controller.faction_status[eFACTION.Imperium]="War";obj_controller.faction_status[eFACTION.Mechanicus]="War"; - obj_controller.faction_status[eFACTION.Inquisition]="War";obj_controller.faction_status[eFACTION.Ecclesiarchy]="War"; - - if (!instance_exists(obj_turn_end)){ - obj_controller.audiences+=1;obj_controller.audien[obj_controller.audiences]=5;obj_controller.audien_topic[obj_controller.audiences]="declare_war"; - if (obj_controller.known[eFACTION.Inquisition]>1){obj_controller.audiences+=1;obj_controller.audien[obj_controller.audiences]=4;obj_controller.audien_topic[obj_controller.audiences]="declare_war";} - obj_controller.audiences+=1;obj_controller.audien[obj_controller.audiences]=2;obj_controller.audien_topic[obj_controller.audiences]="declare_war"; - }else{ - obj_turn_end.audiences+=1;obj_turn_end.audien[obj_turn_end.audiences]=5;obj_turn_end.audien_topic[obj_turn_end.audiences]="declare_war"; - if (obj_turn_end.known[eFACTION.Inquisition]>1){obj_turn_end.audiences+=1;obj_turn_end.audien[obj_turn_end.audiences]=4;obj_turn_end.audien_topic[obj_turn_end.audiences]="declare_war";} - obj_turn_end.audiences+=1;obj_turn_end.audien[obj_turn_end.audiences]=2;obj_turn_end.audien_topic[obj_turn_end.audiences]="declare_war"; - } - } - - - - - if (exterminatus>0) and (dropping!=0) and (string_count("mech",battle_special)=0){ - scr_destroy_planet(1); - } - - if (string_count("mech",battle_special)>0) and (defeat=0) then with(obj_ground_mission){ - var comp,plan,i;i=0;comp=0;plan=0; - plan=instance_nearest(x,y,obj_star); - scr_return_ship(obj_ground_mission.loc,obj_ground_mission,obj_ground_mission.num); - with(obj_ground_mission){instance_destroy();} - } - - with(obj_ini){ - for (var i=0;i<=10;i++){ - scr_company_order(i); - scr_vehicle_order(i); - } - } - - obj_controller.x=view_x; - obj_controller.y=view_y; - obj_controller.combat=0; - obj_controller.marines-=final_marine_deaths; - obj_controller.command-=final_command_deaths; - - instance_activate_all(); - - - if (turn_count < 20){ - if (defeat=0) and (threat>=4) then scr_recent("battle_victory", $"{battle_loc} {scr_roman(battle_id)}",enemy); - - - - if (defeat=1) and (final_marine_deaths+final_command_deaths>=10) then scr_recent("battle_defeat", $"{enemy}, {final_marine_deaths+final_command_deaths}"); - } else { - scr_recent("battle_defeat",$"{enemy}, {final_marine_deaths+final_command_deaths}"); - } - - - - if ((dropping=1) or (attacking=1)) and (string_count("_attack",battle_special)=0) and (string_count("mech",battle_special)=0) and (string_count("ruins",battle_special)=0) and (battle_special!="ship_demon"){ - obj_controller.combat=0; - with(obj_drop_select){ - instance_destroy() - }; - } - if ((dropping+attacking=0)) and (string_count("_attack",battle_special)=0) and (string_count("mech",battle_special)=0) and (string_count("ruins",battle_special)=0) and (battle_special!="ship_demon") and (string_count("cs_meeting",battle_special)=0){ - - if (instance_exists(obj_turn_end)){ - var _battle_index = obj_turn_end.current_battle; - if (_battle_index0) and (defeat=1){ - //TODO this logic is wrong assumes all player units died in ruins - var _combat_star = star_by_name(obj_ncombat.battle_loc); - if (_combat_star!="none"){ - _combat_star.p_player[obj_ncombat.battle_id]-=obj_ncombat.world_size; - } - } - - - - if (string_count("_attack",battle_special)>0) and (string_count("mech",battle_special)=0) and (string_count("ruins",battle_special)=0) and (string_count("cs_meeting",battle_special)=0){ - if (string_count("wake",battle_special)>0){ - var pip=instance_create(0,0,obj_popup); - with(pip){ - title="Necron Tomb Awakens"; - image="necron_army"; - if (obj_ncombat.defeat=0) then text="Your marines make a tactical retreat back to the surface, hounded by Necrons all the way. The Inquisition mission is a failure- you were to blow up the Necron Tomb World stealthily, not wake it up. The Inquisition is not pleased with your conduct."; - if (obj_ncombat.defeat=1) then text="Your marines are killed down to the last man. The Inquisition mission is a failure- you were to blow up the Necron Tomb World stealthily, not wake it up. The Inquisition is not pleased with your conduct."; - } - - instance_activate_object(obj_star); - with(obj_star){if (name!=obj_ncombat.battle_loc) then instance_deactivate_object(id);} - with(obj_star){ - var planet = obj_ncombat.battle_id; - if (remove_planet_problem(planet,"bomb")){ - p_necrons[planet]=4; - } - if (awake_tomb_world(p_feature[planet])==0) then awaken_tomb_world(p_feature[planet]) - } - with(obj_temp7){instance_destroy();} - instance_activate_object(obj_star); - - pip.number=obj_temp8.popup - pip.loc=obj_temp8.loc; - pip.planet=battle_id; - obj_controller.combat=0; - obj_controller.disposition[4]-=5; - obj_controller.cooldown=10; - with(obj_temp8){instance_destroy();} - // obj_turn_end.alarm[1]=4; - } - - - if (defeat=1) and (string_count("wake",battle_special)=0){ - with(obj_temp8){instance_destroy();} - obj_controller.combat=0; - obj_controller.cooldown=10; - obj_turn_end.alarm[1]=4; - } - - if (defeat=0) and (string_count("wake",battle_special)=0){ - obj_temp8.stage+=1; - obj_controller.combat=0; - var pip=instance_create(0,0,obj_popup); - - with(pip){ - title="Necron Tunnels : "+string(obj_temp8.stage); - if (obj_temp8.stage=2){ - image="necron_tunnels_2"; - text="The energy readings are much stronger, now that your marines are deep inside the tunnels. What was once cramped is now luxuriously large, the tunnel ceiling far overhead decorated by stalactites."; - } - if (obj_temp8.stage=3){ - image="necron_tunnels_3"; - text="After several hours of descent the entrance to the Necron Tomb finally looms ahead- dancing, sickly green light shining free. Your marine confirms that the Plasma Bomb is ready."; - } - if (obj_temp8.stage=4){ - if (obj_temp8.stage>=4){ - instance_activate_object(obj_star); - image=""; - title="Inquisition Mission Completed"; - text="Your marines finally enter the deepest catacombs of the Necron Tomb. There they place the Plasma Bomb and arm it. All around are signs of increasing Necron activity. With half an hour set, your men escape back to the surface. There is a brief rumble as the charge goes off, your mission a success."; - option1="";option2="";option3=""; - - if (obj_controller.demanding=0) then obj_controller.disposition[4]+=1; - if (obj_controller.demanding=1) then obj_controller.disposition[4]+=choose(0,0,1); - - // show_message(string(obj_temp8.loc)+"."+string(obj_temp8.wid)); - // obj_controller.temp[200]=obj_temp8.loc; - with(obj_star){if (name!=obj_temp8.loc) then instance_deactivate_object(id);} - with(obj_star){if (name=obj_temp8.loc) then instance_create(x,y,obj_temp5);} - - you=instance_nearest(obj_temp5.x,obj_temp5.y,obj_star);onceh=0; - - // show_message(you.name); - - // show_message("TEMP5: "+string(instance_number(obj_temp5))+"#Star: "+string(you)); - - var ppp;ppp=0; - remove_planet_problem(obj_temp8.wid, "bomb", you); - - pip.option1="";pip.option2="";pip.option3=""; - scr_event_log("","Inquisition Mission Completed: Your Astartes have sealed the Necron Tomb on "+string(you.name)+" "+string(scr_roman(obj_temp8.wid))+"."); - scr_gov_disp(you.name,obj_temp8.wid,choose(1,2,3,4,5)); - - if (!instance_exists(obj_temp8)){ - pip.loc=battle_loc; - pip.planet=battle_id; - } - if (instance_exists(obj_temp8)){ - pip.number=obj_temp8.popup; - pip.loc=obj_temp8.loc; - pip.planet=obj_temp8.wid; - } - - // show_message("Battle Closing: "+string(pip.loc)+"."+string(pip.planet)); - - with(obj_temp5){instance_destroy();} - instance_activate_object(obj_star); - var have_bomb;have_bomb=scr_check_equip("Plasma Bomb",obj_temp8.loc,obj_temp8.wid,1); - } - } - } - - if (instance_exists(obj_temp8)) and (pip.planet=0){ - pip.number=obj_temp8.popup - pip.loc=obj_temp8.loc; - pip.planet=battle_id; - } - } - } - - - 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 planet_string = scr_roman_numerals()[planet-1]; - - remove_planet_problem(planet ,"spyrer",cur_star) - - var tixt=$"The Spyrer on {cur_star.name} {planet_string} has been removed. The citizens and craftsman may sleep more soundly, the Inquisition likely pleased." - - scr_popup("Inquisition Mission Completed",tixt,"spyrer",""); - - if (obj_controller.demanding=0) then obj_controller.disposition[4]+=2; - if (obj_controller.demanding=1) then obj_controller.disposition[4]+=choose(0,0,1); - - scr_event_log("","Inquisition Mission Completed: The Spyrer on {cur_star.name} {planet} has been removed.", cur_star.name); - scr_gov_disp(cur_star.name,planet,choose(1,2,3,4)); - - instance_deactivate_object(obj_star); - } - - if ((string_count("fallen",battle_special)>0)) and (defeat=0){ - var fallen=0; - with (obj_turn_end){ - remove_planet_problem(battle_world[current_battle], "fallen", battle_object[current_battle]) - var tixt="The Fallen on "+ battle_object[current_battle].name; - tixt+=scr_roman(battle_world[current_battle]); - scr_event_log("",$"Mission Succesful: {tixt} have been captured or purged."); - tixt+=$" have been captured or purged. They shall be brought to the Chapter {obj_ini.role[100][14]}s posthaste, in order to account for their sins. "; - var ran;ran=choose(1,1,2,3); - if (ran=1) then tixt+="Suffering is the beginning to penance."; - if (ran=2) then tixt+="Their screams shall be the harbringer of their contrition."; - if (ran=3) then tixt+="The shame they inflicted upon us shall be written in their flesh."; - scr_popup("Hunt the Fallen Completed",tixt,"fallen",""); - } - } - - if (defeat=0) and (enemy=9) and (battle_special="tyranid_org"){ - if (captured_gaunt>1){ - pop=instance_create(0,0,obj_popup); - pop.image="inquisition"; - pop.title="Inquisition Mission Completed"; - pop.text="You have captured several Gaunt organisms. The Inquisitor is pleased with your work, though she notes that only one is needed- the rest are to be purged. It will be stored until it may be retrieved. The mission is a success."; - } - if (captured_gaunt=1){ - pop=instance_create(0,0,obj_popup); - pop.image="inquisition"; - pop.title="Inquisition Mission Completed"; - pop.text="You have captured a Gaunt organism- the Inquisitor is pleased with your work. The Tyranid will be stored until it may be retrieved. The mission is a success."; - } - } - - - - if (enemy=1) and (on_ship=true) and (defeat=0){ - var diceh=floor(random(100))+1; - - if(scr_has_disadv("Shitty Luck")) then diceh-=15; - - if (diceh<=15){ - var ship,ship_hp,i=-1; - for (var i=0;i0){ - // Some kind of popup based on what you were going after - - obj_controller.complex_event=false;obj_controller.diplomacy=0;obj_controller.menu=0; - obj_controller.force_goodbye=0;obj_controller.cooldown=20; - obj_controller.current_eventing="chaos_meeting_end"; - with(obj_temp_meeting){instance_destroy();}with(obj_popup){instance_destroy();} - if (instance_exists(obj_turn_end)){ - obj_turn_end.combating=0;// obj_turn_end.alarm[1]=1; - } - var pip;pip=instance_create(0,0,obj_popup); - pip.title="Chaos Lord Killed";pip.text="(Not completed yet- variable reward based on what chosen)"; - } - with(obj_ground_mission){instance_destroy();} - } - } - - - - if (battle_special="ship_demon"){ - if (defeat=1){ - var ship,ship_hp,i;i=-1; - repeat(51){i+=1; - ship[i]=obj_ini.ship[i];ship_hp[i]=obj_ini.ship_hp[i]; - if (i=battle_id){obj_ini.ship_hp[i]=-50;scr_recent("ship_destroyed",obj_ini.ship[i],i);} - } - var pop;pop=instance_create(0,0,obj_popup); - pop.image=""; - pop.title="Ship Destroyed"; - pop.text="The daemon has slayed all of your marines onboard. It works its way to the engine of the vessel, '"+string(obj_ini.ship[battle_id])+"', and then tears into the main reactor. Your ship explodes in a brilliant cloud of fire."; - scr_event_log("red","A daemon unbound from an Artifact wreaks havoc upon and destroys your vessel '"+string(obj_ini.ship[battle_id])+"'."); - - scr_ini_ship_cleanup(); - } - } - - if (battle_special="space_hulk") and (defeat=0) and (hulk_treasure>0){ - var shi=0,loc=""; - - var shiyp=instance_nearest(battle_object.x,battle_object.y,obj_p_fleet); - if (shiyp.x == battle_object.x && shiyp.y ==battle_object.y){ - shi = fleet_full_ship_array(shiyp)[0]; - loc = obj_ini.ship[shi]; - } - - if (hulk_treasure=1){// Requisition - var reqi=round(random_range(30,60)+1)*10; - obj_controller.requisition+=reqi; - - var pop;pop=instance_create(0,0,obj_popup); - pop.image="space_hulk_done"; - pop.title="Space Hulk: Resources"; - pop.text="Your battle brothers have located several luxury goods and coginators within the Space Hulk. They are salvaged and returned to the ship, granting "+string(reqi)+" Requisition."; - }else if (hulk_treasure=2){// Artifact - //TODO this will eeroniously put artifacts in the wrong place but will resolve crashes - var last_artifact = scr_add_artifact("random","random",4,loc,shi+500); - var i=0; - - var pop=instance_create(0,0,obj_popup); - pop.image="space_hulk_done"; - pop.title="Space Hulk: Artifact"; - pop.text=$"An Artifact has been retrieved from the Space Hulk and stowed upon {loc}. It appears to be a {obj_ini.artifact[last_artifact]} but should be brought home and identified posthaste."; - scr_event_log("","Artifact recovered from the Space Hulk."); - }else if (hulk_treasure=3){// STC - scr_add_stc_fragment();// STC here - var pop;pop=instance_create(0,0,obj_popup); - pop.image="space_hulk_done"; - pop.title="Space Hulk: STC Fragment"; - pop.text="An STC Fragment has been retrieved from the Space Hulk and safely stowed away. It is ready to be decrypted or gifted at your convenience."; - scr_event_log("","STC Fragment recovered from the Space Hulk."); - }else if (hulk_treasure=4){// Termie Armour - var termi=choose(2,2,2,3); - scr_add_item("Terminator Armour",termi); - var pop;pop=instance_create(0,0,obj_popup); - pop.image="space_hulk_done"; - pop.title="Space Hulk: Terminator Armour"; - pop.text="The fallen heretics wore several suits of Terminator Armour- a handful of them were found to be cleansible and worthy of use. "+string(termi)+" Terminator Armour has been added to the Armamentarium."; - } - } - - - - if ((leader=1) or (battle_special="world_eaters")) and (obj_controller.faction_defeated[10]=0) and (defeat=0) and (battle_special!="WL10_reveal") and (battle_special!="WL10_later"){ - if (battle_special!="WL10_reveal") and (battle_special!="WL10_later"){ - // prolly schedule a popup congratulating - obj_controller.faction_defeated[enemy]=1; - if (obj_controller.known[enemy]=0) then obj_controller.known[enemy]=1; - - if (battle_special!="world_eaters") then with(obj_star){ - if (string_count("WL"+string(obj_ncombat.enemy),p_feature[obj_ncombat.battle_id])>0){ - p_feature[obj_ncombat.battle_id]=string_replace(p_feature[obj_ncombat.battle_id],"WL"+string(obj_ncombat.enemy)+"|",""); - } - } - if (battle_special="world_eaters"){ - obj_controller.faction_defeated[10]=1;// show_message("WL10 defeated"); - if (instance_exists(obj_turn_end)){ - scr_event_log("","Enemy Leader Assassinated: Chaos Lord"); - scr_alert("","ass","Chaos Lord "+string(obj_controller.faction_leader[eFACTION.Chaos])+" has been killed.",0,0); - scr_popup("Black Crusade Ended","The Chaos Lord "+string(obj_controller.faction_leader[eFACTION.Chaos])+" has been slain in combat. Without his leadership the Black Crusade is destined to crumble apart and disintegrate from infighting. Sector "+string(obj_ini.sector_name)+" is no longer at threat by the forces of Chaos.","",""); - } - if (!instance_exists(obj_turn_end)){ - scr_event_log("","Enemy Leader Assassinated: Chaos Lord"); - var pop;pop=instance_create(0,0,obj_popup); - pop.image="";pop.title="Black Crusade Ended"; - pop.text="The Chaos Lord "+string(obj_controller.faction_leader[eFACTION.Chaos])+" has been slain in combat. Without his leadership the Black Crusade is destined to crumble apart and disintegrate from infighting. Sector "+string(obj_ini.sector_name)+" is no longer at threat by the forces of Chaos."; - } - } - }} - - - - instance_activate_all(); - with(obj_pnunit){instance_destroy();} - with(obj_enunit){instance_destroy();} - with(obj_nfort){instance_destroy();} - with(obj_centerline){instance_destroy();} - obj_controller.new_buttons_hide=0; - - - if (instance_exists(obj_cursor)){ - obj_cursor.image_index=0; - } - - instance_destroy(); - - /* */ - /* */ - -} catch(_exception) { - handle_exception(_exception); -} \ No newline at end of file diff --git a/objects/obj_ncombat/Create_0.gml b/objects/obj_ncombat/Create_0.gml index d88fa696b1..77c63e019f 100644 --- a/objects/obj_ncombat/Create_0.gml +++ b/objects/obj_ncombat/Create_0.gml @@ -1,115 +1,131 @@ -if (instance_number(obj_ncombat)>1) then instance_destroy(); +if (instance_number(obj_ncombat) > 1) { + instance_destroy(); +} set_zoom_to_default(); -var co,i;co=-1; -co=0;i=0;hue=0; +var co, i; +co = -1; +co = 0; +i = 0; +hue = 0; turn_count = 0; log_message("Ground Combat Started"); audio_stop_sound(snd_royal); -audio_play_sound(snd_battle,0,true); +audio_play_sound(snd_battle, 0, true); audio_sound_gain(snd_battle, 0, 0); -var nope=0;if (obj_controller.master_volume=0) or (obj_controller.music_volume=0) then nope=1; -if (nope!=1){audio_sound_gain(snd_battle,0.25*obj_controller.master_volume*obj_controller.music_volume,2000);} - +var nope = 0; +if ((obj_controller.master_volume == 0) || (obj_controller.music_volume == 0)) { + nope = 1; +} +if (nope != 1) { + audio_sound_gain(snd_battle, 0.25 * obj_controller.master_volume * obj_controller.music_volume, 2000); +} //limit on the size of the players forces allowed man_size_limit = 0; man_limit_reached = false; man_size_count = 0; -owner = eFACTION.Player; -formation_set=0; -on_ship=false; -alpha_strike=0; +owner = eFACTION.Player; +formation_set = 0; +on_ship = false; +alpha_strike = 0; Warlord = 0; -total_battle_exp_gain=0; +total_battle_exp_gain = 0; marines_to_recover = 0; vehicles_to_recover = 0; end_alive_units = []; -average_battle_exp_gain=0; -upgraded_librarians=[]; - -view_x=obj_controller.x;view_y=obj_controller.y; -obj_controller.x=0;obj_controller.y=0; -if (obj_controller.zoomed==1){with(obj_controller){scr_zoom();}} -xxx=200; +average_battle_exp_gain = 0; +upgraded_librarians = []; + +view_x = obj_controller.x; +view_y = obj_controller.y; +obj_controller.x = 0; +obj_controller.y = 0; +if (obj_controller.zoomed == 1) { + with (obj_controller) { + scr_zoom(); + } +} +xxx = 200; instance_activate_object(obj_cursor); instance_activate_object(obj_ini); -instance_activate_object(obj_img) +instance_activate_object(obj_img); -var i,u;i=11; -repeat(10){i-=1;// This creates the objects to then be filled in - u=instance_create(i*10,240,obj_pnunit); +var i, u; +i = 11; +repeat (10) { + i -= 1; // This creates the objects to then be filled in + u = instance_create(i * 10, 240, obj_pnunit); } -instance_create(0,0,obj_centerline); - -local_forces=0; -battle_loc=""; -battle_climate=""; -battle_id=0; -battle_object=0; -battle_special=""; -defeat=0; -battle_ended=false; -red_thirst=0; -battle_over=0; - -captured_gaunt=0; -ethereal=0; -hulk_treasure=0; -chaos_angry=0; - -leader=0; -thirsty=0; -really_thirsty=0; -allies=0; -present_inquisitor=0;sorcery_seen=0; -inquisitor_ship=0; -guard_total=0; -guard_effective=0; -player_starting_dudes=0; -chapter_master_psyker=0; -guard_pre_forces=0; -ally=0; -ally_forces=0; -ally_special=0; - -global_perils=0; -exterminatus=0; -plasma_bomb=0; - -display_p1=0;display_p1n=""; -display_p2=0;display_p2n=""; - - -alarm[0]=2; -alarm[1]=3; -obj_pnunit.alarm[3]=1; -alarm[2]=8; - - -started=eBATTLE_STAGE.Creation; -charged=0; +instance_create(0, 0, obj_centerline); + +local_forces = 0; +battle_loc = ""; +battle_climate = ""; +battle_id = 0; +battle_object = 0; +battle_special = ""; +defeat = 0; +battle_ended = false; +battle_over = 0; + +lost_to_black_rage = 0; + +captured_gaunt = 0; +ethereal = 0; +hulk_treasure = 0; +chaos_angry = 0; + +leader = 0; +allies = 0; +present_inquisitor = 0; +sorcery_seen = 0; +inquisitor_ship = 0; +guard_total = 0; +guard_effective = 0; +player_starting_dudes = 0; +chapter_master_psyker = 0; +guard_pre_forces = 0; +ally = 0; +ally_forces = 0; +ally_special = 0; + +global_perils = 0; +exterminatus = 0; +plasma_bomb = 0; + +display_p1 = 0; +display_p1n = ""; +display_p2 = 0; +display_p2n = ""; + +battle_stage = eBATTLE_STAGE.Creation; +charged = 0; fading_strength = 1; -enemy=0; -threat=0; -fortified=0; -enemy_fortified=0; -wall_destroyed=0; -enem="Orks";enem_sing="Ork"; -flank_x=0; +enemy = 0; +threat = 0; +fortified = 0; +enemy_fortified = 0; +wall_destroyed = 0; +enem = "Orks"; +enem_sing = "Ork"; +flank_x = 0; -player_forces=0;player_max=0; -player_defenses=0;player_silos=0; +player_forces = 0; +player_max = 0; +player_defenses = 0; +player_silos = 0; -enemy_forces=0;enemy_max=0; -hulk_forces=0; +enemy_forces = 0; +enemy_max = 0; +hulk_forces = 0; -messages_shown=0; +messages_shown = 0; units_lost_counts = {}; vehicles_lost_counts = {}; @@ -129,151 +145,163 @@ post_equipments_lost = array_create(_messages_size, 0); crunch = array_create(_messages_size, 0); mucra = array_create(11, 0); -slime=0; -unit_recovery_score=0; -apothecaries_alive=0; -techmarines_alive=0; -vehicle_recovery_score=0; -injured=0; -command_injured=0; -seed_saved=0; -seed_lost=0; -seed_harvestable=0; -units_saved_count=0; -units_saved_counts={}; -vehicles_saved_counts={}; -command_saved=0; -vehicles_saved_count=0; -vehicles_saved_counts={}; -final_marine_deaths=0; -final_command_deaths=0; -vehicle_deaths=0; -casualties=0; -newline=""; -newline_color=""; -liness=0; -world_size=0; - -battle_stage=eBATTLE_TURN.Creation; - - -// - -scouts=0; -tacticals=0; -veterans=0; -devastators=0; -assaults=0; -librarians=0; -techmarines=0; -honors=0; -dreadnoughts=0; -terminators=0; -captains=0; -standard_bearers=0; -champions=0; -important_dudes=0; -chaplains=0; -apothecaries=0; -sgts=0; -vet_sgts=0; - -rhinos=0; -predators=0; -land_raiders=0; -land_speeders=0; -whirlwinds=0; - -big_mofo=10; - - - - -en_scouts=0; -en_tacticals=0; -en_sgts=0; -en_vet_sgts=0; -en_veterans=0; -en_devastators=0; -en_assaults=0; -en_librarians=0; -en_techmarines=0; -en_honors=0; -en_dreadnoughts=0; -en_terminators=0; -en_captains=0; -en_standard_bearers=0; -en_important_dudes=0; -en_chaplains=0; -en_apothecaries=0; - -en_big_mofo=10; -en_important_dudes=0; - -// - -defending=true;// 1 is defensive -dropping=0;// 0 is was on ground -attacking=0;// 1 means attacked from space/local -time=floor(random(24))+1; -terrain=""; -weather=""; - -ambushers=0;if (scr_has_adv("Ambushers")) then ambushers=1; -bolter_drilling=0;if (scr_has_adv("Bolter Drilling")) then bolter_drilling=1; -enemy_eldar=0;if (scr_has_adv("Enemy: Eldar")) then enemy_eldar=1; -enemy_fallen=0;if (scr_has_adv("Enemy: Fallen")) then enemy_fallen=1; -enemy_orks=0;if (scr_has_adv("Enemy: Orks")) then enemy_orks=1; -enemy_tau=0;if (scr_has_adv("Enemy: Tau")) then enemy_tau=1; -enemy_tyranids=0;if (scr_has_adv("Enemy: Tyranids")) then enemy_tyranids=1; -enemy_necrons=0;if (scr_has_adv("Enemy: Necrons")) then enemy_necrons=1; -lightning=0;if (scr_has_adv("Lightning Warriors")) then lightning=1; -siege=0;if (scr_has_adv("Siege Masters")) then siege=1; -slow=0;if (scr_has_adv("Devastator Doctrine")) then slow=1; -melee=0;if (scr_has_adv("Assault Doctrine")) then melee=1; -// -black_rage=0;if (scr_has_disadv("Black Rage")){black_rage=1;red_thirst=1;} -shitty_luck=0;if (scr_has_disadv("Shitty Luck")) then shitty_luck=1; -favoured_by_the_warp=0;if (scr_has_adv("Favoured By The Warp")) then favoured_by_the_warp=1; - - -lyman=obj_ini.lyman;// drop pod penalties -omophagea=obj_ini.omophagea;// feast -ossmodula=obj_ini.ossmodula;// small penalty to all -membrane=obj_ini.membrane;// less chance of survival for wounded -betchers=obj_ini.betchers;// slight melee penalty -catalepsean=obj_ini.catalepsean;// minor global attack decrease -occulobe=obj_ini.occulobe;// penalty if morning and susceptible to flash grenades -mucranoid=obj_ini.mucranoid;// chance to short-circuit -// -global_melee=1; -global_bolter=1; -global_attack=1; -global_defense=1; -// -if (ambushers=1) and (ambushers=999) then global_attack=global_attack*1.1; -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=9){global_attack=global_attack*1.1;global_defense=global_defense*1.1;} -if (enemy_necrons=1) and (enemy=13){global_attack=global_attack*1.1;global_defense=global_defense*1.1;} - -if (siege=1) and (enemy_fortified>=3) and (defending=false) then global_attack=global_attack*1.2; - - -if (slow=1){global_attack-=0.1;global_defense+=0.2;} -if (lightning=1){global_attack+=0.2;global_defense-=0.1;} -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){global_attack=global_attack*0.85;global_defense=global_defense*0.9;} -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){global_attack=global_attack*0.7;global_defense=global_defense*0.8;}} - -enemy_dudes=""; -global_defense=2-global_defense; +slime = 0; +unit_recovery_score = 0; +apothecaries_alive = 0; +techmarines_alive = 0; +vehicle_recovery_score = 0; +injured = 0; +command_injured = 0; +seed_saved = 0; +seed_lost = 0; +seed_harvestable = 0; +units_saved_count = 0; +units_saved_counts = {}; +vehicles_saved_counts = {}; +command_saved = 0; +vehicles_saved_count = 0; +vehicles_saved_counts = {}; +final_marine_deaths = 0; +final_command_deaths = 0; +vehicle_deaths = 0; +casualties = 0; +newline = ""; +newline_color = ""; +liness = 0; +world_size = 0; + +turn_stage = eBATTLE_TURN.PlayerStart; + +// + +scouts = 0; +tacticals = 0; +veterans = 0; +devastators = 0; +assaults = 0; +librarians = 0; +techmarines = 0; +honors = 0; +dreadnoughts = 0; +terminators = 0; +captains = 0; +standard_bearers = 0; +champions = 0; +important_dudes = 0; +chaplains = 0; +apothecaries = 0; +sgts = 0; +vet_sgts = 0; + +rhinos = 0; +predators = 0; +land_raiders = 0; +land_speeders = 0; +whirlwinds = 0; + +big_mofo = 10; + +en_scouts = 0; +en_tacticals = 0; +en_sgts = 0; +en_vet_sgts = 0; +en_veterans = 0; +en_devastators = 0; +en_assaults = 0; +en_librarians = 0; +en_techmarines = 0; +en_honors = 0; +en_dreadnoughts = 0; +en_terminators = 0; +en_captains = 0; +en_standard_bearers = 0; +en_important_dudes = 0; +en_chaplains = 0; +en_apothecaries = 0; + +en_big_mofo = 10; +en_important_dudes = 0; + +// + +defending = true; // 1 is defensive +dropping = 0; // 0 is was on ground +attacking = 0; // 1 means attacked from space/local +time = irandom(24); + +global_melee = 1; +global_attack = 1; +global_defense = 1; + +// Advantage-based modifiers +if (scr_has_adv("Ambushers")) { + global_attack *= 1.1; +} +if ((scr_has_adv("Enemy: Eldar")) && (enemy == eFACTION.Eldar)) { + global_attack *= 1.1; + global_defense *= 1.1; +} +if ((scr_has_adv("Enemy: Fallen")) && (enemy == eFACTION.Heretics)) { + global_attack *= 1.1; + global_defense *= 1.1; +} +if ((scr_has_adv("Enemy: Orks")) && (enemy == eFACTION.Ork)) { + global_attack *= 1.1; + global_defense *= 1.1; +} +if ((scr_has_adv("Enemy: Tau")) && (enemy == eFACTION.Tau)) { + global_attack *= 1.1; + global_defense *= 1.1; +} +if ((scr_has_adv("Enemy: Tyranids")) && (enemy == eFACTION.Tyranids)) { + global_attack *= 1.1; + global_defense *= 1.1; +} +if ((scr_has_adv("Enemy: Necrons")) && (enemy == eFACTION.Necrons)) { + global_attack *= 1.1; + global_defense *= 1.1; +} +if ((scr_has_adv("Siege Masters")) && (enemy_fortified >= 3) && (!defending)) { + global_attack *= 1.2; +} +if (scr_has_adv("Devastator Doctrine")) { + global_attack -= 0.1; + global_defense += 0.2; +} +if (scr_has_adv("Lightning Warriors")) { + global_attack += 0.2; + global_defense -= 0.1; +} +if (scr_has_adv("Assault Doctrine")) { + global_melee *= 1.15; +} + +// Disadvantage-based modifiers +if (scr_has_disadv("Shitty Luck")) { + global_defense *= 0.9; +} + +// Organ rules +if ((obj_ini.lyman) && (dropping)) { + global_attack *= 0.85; + global_defense *= 0.9; +} +if (obj_ini.ossmodula == 1) { + global_attack *= 0.95; + global_defense *= 0.95; +} +if (obj_ini.betchers) { + global_melee *= 0.95; +} +if (obj_ini.catalepsean) { + global_attack *= 0.95; +} +if (obj_ini.occulobe) { + if ((time == 5) || (time == 6)) { + global_attack *= 0.7; + global_defense *= 0.8; + } +} +enemy_dudes = ""; +global_defense = 2 - global_defense; diff --git a/objects/obj_ncombat/Draw_0.gml b/objects/obj_ncombat/Draw_0.gml index c4a20166b9..1f9e13a160 100644 --- a/objects/obj_ncombat/Draw_0.gml +++ b/objects/obj_ncombat/Draw_0.gml @@ -79,11 +79,11 @@ repeat (45) { draw_set_color(38144); draw_set_halign(fa_center); -if (started == eBATTLE_STAGE.Creation) { +if (battle_stage == eBATTLE_STAGE.Start) { draw_text(400, 860, string_hash_to_newline("[Press Enter to Begin]")); -} else if (started == eBATTLE_STAGE.PlayerWinEnd || started == eBATTLE_STAGE.EnemyWinEnd) { +} else if (battle_stage == eBATTLE_STAGE.PlayerWinEnd || battle_stage == eBATTLE_STAGE.EnemyWinEnd) { draw_text(400, 860, string_hash_to_newline("[Press Enter to Exit]")); -} else if (battle_stage == eBATTLE_TURN.PlayerEnd || battle_stage == eBATTLE_TURN.EnemyEnd) { +} else if (turn_stage == eBATTLE_TURN.PlayerStart || turn_stage == eBATTLE_TURN.EnemyStart) { draw_text(400, 860, string_hash_to_newline("[Press Enter to Continue]")); } diff --git a/objects/obj_ncombat/Step_0.gml b/objects/obj_ncombat/Step_0.gml index 6fb7c52e5d..1dbeffdaa6 100644 --- a/objects/obj_ncombat/Step_0.gml +++ b/objects/obj_ncombat/Step_0.gml @@ -1,6 +1,4 @@ enum eBATTLE_TURN { - Creation, - Start, PlayerStart, PlayerEnd, EnemyStart, @@ -39,154 +37,133 @@ if (!battle_ended) { } } -if (wall_destroyed == 1) { - wall_destroyed = 0; +if (wall_destroyed == true) { + wall_destroyed = false; } -if (keyboard_check_pressed(vk_enter) && fading_strength == 0) { - if (started == eBATTLE_STAGE.Creation) { - started = eBATTLE_STAGE.Start; - battle_stage = eBATTLE_TURN.Start; +if (battle_stage == eBATTLE_STAGE.Creation) { + ncombat_enemy_stacks_init(); - if (enemy == 30) { - battle_stage = eBATTLE_TURN.PlayerEnd; - } - if (battle_special == "ship_demon") { - battle_stage = eBATTLE_TURN.PlayerEnd; - } + with (obj_pnunit) { + scr_player_combat_weapon_stacks(); } - if (started > eBATTLE_STAGE.Creation) { - // This might be causing problems? - if (instance_exists(obj_pnunit)) { - obj_pnunit.alarm[8] = 8; - } - if (instance_exists(obj_enunit)) { - obj_enunit.alarm[8] = 8; - } + with (obj_enunit) { + enunit_enemy_profiles_init(); } - if (battle_stage == eBATTLE_TURN.PlayerStart) { - if (global_perils > 0) { - global_perils -= 1; - } + with (obj_pnunit) { + pnunit_battle_effects(); + } - queue_battlelog_message($"Turn {turn_count}", 999, "yellow"); - resolve_battle_state(); - display_message_queue(); - battle_stage = eBATTLE_TURN.PlayerEnd; + ncombat_battle_start(); + + ncombat_ally_init(); + + battle_stage = eBATTLE_STAGE.Start; + + if (obj_ncombat.enemy == 30 || battle_special == "ship_demon") { + turn_stage = eBATTLE_TURN.PlayerEnd; } +} - if (battle_stage == eBATTLE_TURN.EnemyStart) { - queue_battlelog_message($"Turn {turn_count}", 999, "yellow"); +if (keyboard_check_pressed(vk_enter) && fading_strength == 0) { + if (turn_stage == eBATTLE_TURN.PlayerStart || turn_stage == eBATTLE_TURN.EnemyStart) { + turn_count++; + global_perils -= 1; + queue_battlelog_message($"Turn {turn_count}", 1, "yellow"); resolve_battle_state(); display_message_queue(); - battle_stage = eBATTLE_TURN.EnemyEnd; - } - - if ((battle_stage == eBATTLE_TURN.Start) || (battle_stage == eBATTLE_TURN.EnemyEnd)) { - turn_count += 1; - - if (enemy != 6) { - if (instance_exists(obj_enunit)) { - obj_enunit.alarm[1] = 1; - } - set_up_player_blocks_turn(); - } else if (enemy == 6) { + + if (turn_stage == eBATTLE_TURN.EnemyStart) { if (instance_exists(obj_enunit)) { - obj_enunit.alarm[1] = 2; + with (obj_enunit) { + enunit_enemy_profiles_init(); + } move_enemy_blocks(); - obj_enunit.alarm[0] = 3; - } - if (instance_exists(obj_pnunit)) { - wait_and_execute(1, scr_player_combat_weapon_stacks); - turn_count++; + with (obj_enunit) { + enunit_target_and_shoot(); + } } + display_message_queue(); + queue_player_force_health(); + display_message_queue(); } - queue_enemy_force_health(); - display_message_queue(); - messages_shown = 0; - battle_stage = eBATTLE_TURN.PlayerStart; - } else if (battle_stage == eBATTLE_TURN.PlayerEnd) { - if (enemy != 6) { - if (instance_exists(obj_pnunit)) { - with (obj_pnunit) { - wait_and_execute(1, scr_player_combat_weapon_stacks); - } - turn_count++; + if (turn_stage == eBATTLE_TURN.PlayerStart) { + with (obj_pnunit) { + pnunit_battle_effects(); + scr_player_combat_weapon_stacks(); + pnunit_target_and_shoot(); } - if (instance_exists(obj_enunit)) { - obj_enunit.alarm[1] = 2; - move_enemy_blocks(); - obj_enunit.alarm[0] = 3; - obj_enunit.alarm[8] = 4; - turn_count += 1; - } - } - if (enemy == 6) { - set_up_player_blocks_turn(); - turn_count += 1; - if (instance_exists(obj_enunit)) { - obj_enunit.alarm[1] = 1; + with (obj_enunit) { + enunit_enemy_profiles_init(); } - // alarm[9]=5; + display_message_queue(); + queue_enemy_force_health(); + display_message_queue(); } - queue_player_force_health(); - display_message_queue(); - messages_shown = 0; - battle_stage = eBATTLE_TURN.EnemyStart; - } - - if (started >= eBATTLE_STAGE.PlayerWinStart) { - instance_activate_object(obj_pnunit); + turn_stage = (turn_stage == eBATTLE_TURN.PlayerStart) ? eBATTLE_TURN.PlayerEnd : eBATTLE_TURN.EnemyEnd; } - if (started == eBATTLE_STAGE.PlayerWinEnd) { - instance_activate_all(); - instance_activate_object(obj_pnunit); - instance_activate_object(obj_enunit); - instance_destroy(obj_popup); - instance_destroy(obj_star_select); - if (instance_exists(obj_pnunit)) { - obj_pnunit.alarm[6] = 1; + if (turn_stage == eBATTLE_TURN.EnemyEnd || turn_stage == eBATTLE_TURN.PlayerEnd) { + if (turn_stage == eBATTLE_TURN.EnemyEnd) { + turn_stage = eBATTLE_TURN.PlayerStart; } - alarm[7] = 2; + if (turn_stage == eBATTLE_TURN.PlayerEnd) { + turn_stage = eBATTLE_TURN.EnemyStart; + } } - if ((started == eBATTLE_STAGE.PlayerWinStart) || (started == eBATTLE_STAGE.EnemyWinStart)) { + + if ((battle_stage == eBATTLE_STAGE.PlayerWinStart) || (battle_stage == eBATTLE_STAGE.EnemyWinStart)) { instance_activate_object(obj_pnunit); instance_activate_object(obj_enunit); - started = eBATTLE_STAGE.PlayerWinEnd; + battle_stage = eBATTLE_STAGE.PlayerWinEnd; var _quad_factor = 10; total_battle_exp_gain = _quad_factor * sqr(threat); - if (instance_exists(obj_enunit)) { - obj_enunit.alarm[1] = 1; + with (obj_enunit) { + enunit_enemy_profiles_init(); } instance_activate_object(obj_star); instance_activate_object(obj_event_log); - alarm[5] = 6; + ncombat_battle_end(); newline = "------------------------------------------------------------------------------"; scr_newtext(); newline = "------------------------------------------------------------------------------"; scr_newtext(); } + + if (battle_stage == eBATTLE_STAGE.PlayerWinEnd) { + instance_activate_all(); + instance_activate_object(obj_pnunit); + instance_activate_object(obj_enunit); + instance_destroy(obj_popup); + instance_destroy(obj_star_select); + with (obj_pnunit) { + pnunit_dying_process(); + } + + ncombat_special_battle(); + } } function resolve_battle_state() { if (enemy_forces <= 0 || !instance_exists(obj_enunit)) { battle_ended = true; - started = eBATTLE_STAGE.PlayerWinStart; + battle_stage = eBATTLE_STAGE.PlayerWinStart; instance_activate_object(obj_pnunit); - battle_stage = eBATTLE_TURN.EnemyStart; + turn_stage = eBATTLE_TURN.EnemyStart; } else if (player_forces <= 0 || !instance_exists(obj_pnunit)) { + show_debug_message($"enemy_forces: {player_forces}"); + show_debug_message($"obj_enunit count: {instance_number(obj_pnunit)}}"); battle_ended = true; - started = eBATTLE_STAGE.EnemyWinStart; + battle_stage = eBATTLE_STAGE.EnemyWinStart; defeat = 1; instance_activate_object(obj_pnunit); - battle_stage = eBATTLE_TURN.EnemyEnd; + turn_stage = eBATTLE_TURN.EnemyEnd; } } diff --git a/objects/obj_ncombat/obj_ncombat.yy b/objects/obj_ncombat/obj_ncombat.yy index a90600f347..bea3637027 100644 --- a/objects/obj_ncombat/obj_ncombat.yy +++ b/objects/obj_ncombat/obj_ncombat.yy @@ -3,11 +3,6 @@ "%Name":"obj_ncombat", "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":5,"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":0,"eventType":8,"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",}, diff --git a/objects/obj_pnunit/Alarm_0.gml b/objects/obj_pnunit/Alarm_0.gml deleted file mode 100644 index a3704f7108..0000000000 --- a/objects/obj_pnunit/Alarm_0.gml +++ /dev/null @@ -1,125 +0,0 @@ -#macro DEBUG_COLUMN_PRIORITY_PLAYER false - -// Useful functions: -// scr_target -// get_rightmost -// move_unit_block -// gear_weapon_data -// scr_shoot - -try { - if (!instance_exists(obj_enunit)) { - exit; - } - - enemy = instance_nearest(0, y, obj_enunit); - - if (obj_ncombat.dropping || (!obj_ncombat.defending && obj_ncombat.formation_set != 2)) { - move_unit_block("east"); - } - - engaged = collision_point(x - 10, y, obj_enunit, 0, 1) || collision_point(x + 10, y, obj_enunit, 0, 1); - - if (DEBUG_COLUMN_PRIORITY_PLAYER) { - var _t_start1 = get_timer(); - } - - if (!engaged) { - for (var i = 0; i < array_length(unit_struct); i++) { - if (marine_dead[i] == 0 && marine_casting[i] == true) { - var caster_id = i; - scr_powers(caster_id); - } - } - - // Shooting - var _ranged_weapons = get_valid_weapon_stacks(weapon_stacks_normal, 2, 999); - for (var i = 0, _ranged_len = array_length(_ranged_weapons); i < _ranged_len; i++) { - if (!target_block_is_valid(enemy, obj_enunit)) { - enemy = instance_nearest(0, y, obj_enunit); - if (!target_block_is_valid(enemy, obj_enunit)) { - exit; - } - } - - var _weapon_stack = _ranged_weapons[i]; - var dist = get_block_distance(enemy); - - if (_weapon_stack.range >= dist) { - var _target_priority_queue = ds_priority_create(); - - if (DEBUG_COLUMN_PRIORITY_PLAYER) { - var _t_start = get_timer(); - } - - // Scan potential targets - var _check_targets = []; - with (obj_enunit) { - if (!target_block_is_valid(self, obj_enunit)) { - continue; - } - array_push(_check_targets, self.id); - } - - // if (DEBUG_COLUMN_PRIORITY_PLAYER) { - // show_debug_message($"{wep[i]} IS HERE!"); - // } - - for (var t = 0; t < array_length(_check_targets); t++) { - var enemy_block = _check_targets[t]; - - var _distance = get_block_distance(enemy_block); - if (_distance <= _weapon_stack.range) { - - var _priority = get_target_priority(_weapon_stack, enemy_block); - ds_priority_add(_target_priority_queue, enemy_block, _priority); - } - } - - if (DEBUG_COLUMN_PRIORITY_PLAYER) { - var _t_end = get_timer(); - var _elapsed_ms = (_t_end - _t_start) / 1000; - show_debug_message($"⏱️ Execution Time: {_elapsed_ms}ms"); - } - - // Shoot highest-priority target - if (!ds_priority_empty(_target_priority_queue)) { - var best_target = ds_priority_delete_max(_target_priority_queue); - var unit_index = 0; - - scr_shoot(_weapon_stack, best_target, unit_index); - } else { - log_error($"{_weapon_stack.weapon_name} didn't find a valid target! This shouldn't happen!"); - // if (DEBUG_COLUMN_PRIORITY_PLAYER) { - // show_debug_message($"We didn't find a valid target! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}"); - // } - } - - ds_priority_destroy(_target_priority_queue); - } else { - // if (DEBUG_COLUMN_PRIORITY_PLAYER) { - // show_debug_message($"I can't shoot, my range is too small! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}"); - // } - // continue; - } - } - if (DEBUG_COLUMN_PRIORITY_PLAYER) { - var _t_end1 = get_timer(); - var _elapsed_ms1 = (_t_end1 - _t_start1) / 1000; - show_debug_message($"⏱️ Ranged Alarm Execution Time: {_elapsed_ms1}ms"); - } - } else { - // Melee - var _melee_weapons = get_valid_weapon_stacks(weapon_stacks_normal, 1, 2); - for (var i = 0, _wep_len = array_length(_melee_weapons); i < _wep_len; i++) { - if (!target_block_is_valid(enemy, obj_enunit)) { - exit; - } - - var _weapon_stack = _melee_weapons[i]; - scr_shoot(_weapon_stack, enemy, 0); - } - } -} catch (_exception) { - handle_exception(_exception); -} diff --git a/objects/obj_pnunit/Alarm_1.gml b/objects/obj_pnunit/Alarm_1.gml deleted file mode 100644 index a776c983aa..0000000000 --- a/objects/obj_pnunit/Alarm_1.gml +++ /dev/null @@ -1 +0,0 @@ -scr_player_combat_weapon_stacks(); diff --git a/objects/obj_pnunit/Alarm_3.gml b/objects/obj_pnunit/Alarm_3.gml deleted file mode 100644 index 9fe9ed0a64..0000000000 --- a/objects/obj_pnunit/Alarm_3.gml +++ /dev/null @@ -1,119 +0,0 @@ -try { - - if (obj_ncombat.started=eBATTLE_STAGE.Creation){ - if (men+dreads+veh<=0){ - //show_debug_message($"column destroyed {x}") - instance_destroy(); - } - // if (veh+dreads>0) then instance_destroy(); - obj_ncombat.player_forces+=self.men+self.veh+self.dreads; - obj_ncombat.player_max+=self.men+self.veh+self.dreads; - - - //TODO centralise a method for moving units between columns - /*if (men<=4) and (veh=0) and (dreads=0){// Squish leftt - var leftt=instance_nearest(x-12,y,obj_pnunit); - - - }*/ - - } - - if (obj_ncombat.red_thirst>=2) and (obj_ncombat.battle_over=0){ - if (men>0){ - var raar=0,miss="",r_lost=0; - - for (var raar; raar < (men + dreads); raar++) { - r_roll=floor(random(1000))+1; - if (obj_ncombat.player_forces<(obj_ncombat.player_max*0.75)) then r_roll-=8; - if (obj_ncombat.player_forces<(obj_ncombat.player_max/2)) then r_roll-=10; - if (obj_ncombat.player_forces<(obj_ncombat.player_max/4)) then r_roll-=24; - if (obj_ncombat.player_forces<(obj_ncombat.player_max/7)) then r_roll-=104; - if (obj_ncombat.player_forces<(obj_ncombat.player_max/10)) then r_roll-=350; - - - if (marine_dead[raar]=0) and (marine_type[raar]!="Death Company") and (marine_type[raar]!="Chapter Master") and (r_roll<=4){ - r_lost+=1; - marine_type[raar]="Death Company"; - //marine_attack[raar]+=1; - marine_defense[raar]=0.75; - //marine_ranged[raar]=0.75; - obj_ncombat.red_thirst+=1; - if (r_lost=1) then miss+="Battle Brother "+string(obj_ini.name[marine_co[raar],marine_id[raar]])+", "; - if (r_lost>1) then miss+=string(obj_ini.name[marine_co[raar],marine_id[raar]])+", "; - } - } - if (r_lost>1) then string_replace(miss,"Battle Brother","Battle Brothers"); - - - var woo=string_length(miss); - miss=string_delete(miss,woo-1,2);// remove last - - if (string_count(", ",miss)=1){ - /*var woo;woo=string_rpos(", ",miss); - miss=string_insert(" and",miss,woo+1);*/ - - miss=string_replace(miss,", "," and "); - } - if (string_count(", ",miss)>1){ - var woo=string_rpos(", ",miss); - - miss=string_delete(miss,woo-1,3); - if (r_lost>=3) then miss=string_insert(", and ",miss,woo-1); - if (r_lost=2) then miss=string_insert(" and ",miss,woo-1); - } - - - if (r_lost=1) then miss+=" has been lost to the Red Thirst!"; - if (r_lost>1) then miss+=" have been lost to the Red Thirst!"; - - if (r_lost>0){ - obj_ncombat.newline=miss; - obj_ncombat.newline_color="red"; - with(obj_ncombat){ - scr_newtext(); - } - } - } - } - - - - if (obj_ncombat.started>=eBATTLE_STAGE.Start){ - - // Should probably have the option under deployment to say 'Should Assault Marines enter the fray with vehicles?' [ ] - } - - - // Right here execute some sort of check- if left is open, and engaged, and enemy is only vehicles, and no weapons to hurt them... - - //! This doesn't work very well, so I'll comment it out for now, as I don't want to bother fixing it atm - // if (instance_exists(obj_enunit)){ - // if (collision_point(x+10,y,obj_enunit,0,1)) and (!collision_point(x-10,y,obj_pnunit,0,1)){ - // var neares=instance_nearest(x+10,y,obj_enunit); - - // if (neares.men=0) and (neares.veh>0){ - // var norun; - // norun=0; - - // var i;i=0; - // repeat(20){i+=1; - // if (apa[i]>=30) then norun=1; - // } - - - // if (norun=0){ - // x-=10; - // engaged=0; - // } - - // } - // } - // } - - /* */ - /* */ - -} catch(_exception) { - handle_exception(_exception); -} \ No newline at end of file diff --git a/objects/obj_pnunit/Alarm_6.gml b/objects/obj_pnunit/Alarm_6.gml deleted file mode 100644 index a41535ba16..0000000000 --- a/objects/obj_pnunit/Alarm_6.gml +++ /dev/null @@ -1,56 +0,0 @@ -// -// Handles marines dying on battle -// - -// Remove from ships -// Remove from the controller -// Remove from any planetary bodies - -// show_message("pnunit alarm 6"); - -var i=-1,unit; -for (var i=0;i0) and (marine_type[i]!="") and (ally[i]=false){ - unit = unit_struct[i]; - if (!is_struct(unit)) continue; - if (unit.name()=="") continue; - man_size = unit.get_unit_size(); - - if (unit.planet_location>0) then obj_ncombat.world_size+=man_size; - if (unit.ship_location>-1) then obj_ini.ship_carrying[unit.ship_location]-=man_size; - // - scr_kill_unit(unit.company,unit.marine_number); - } -} - -for (var i=0;i0) and (veh_type[i]!="") and (veh_ally[i]=false){ - var man_size=scr_unit_size("",veh_type[i],true); - - /* - if (veh_type[i]="Rhino") then man_size+=10; - if (veh_type[i]="Predator") then man_size+=10; - if (veh_type[i]="Land Raider") then man_size+=20; - if (veh_type[i]="Bike") then man_size+=2; - if (veh_type[i]="Land Speeder") then man_size+=6; - if (veh_type[i]="Whirlwind") then man_size+=10;*/ - - if (obj_ini.veh_wid[veh_co[i],veh_id[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; - - // show_message(string(veh_type[i])+" ("+string(veh_co[i])+"."+string(veh_id[i])+") dead"); - - - // - destroy_vehicle(veh_co[i],veh_id[i]); - } - - if ((veh_dead[i] == 0) && (veh_type[i] != "") && (veh_ally[i] == false)) { - obj_ini.veh_hp[veh_co[i]][veh_id[i]] = veh_hp[i]; - } -} - -/* */ -/* */ diff --git a/objects/obj_pnunit/Alarm_8.gml b/objects/obj_pnunit/Alarm_8.gml deleted file mode 100644 index b3520fee70..0000000000 --- a/objects/obj_pnunit/Alarm_8.gml +++ /dev/null @@ -1 +0,0 @@ -action_set_alarm(1, 1); diff --git a/objects/obj_pnunit/Create_0.gml b/objects/obj_pnunit/Create_0.gml index e8650994b4..45888724b5 100644 --- a/objects/obj_pnunit/Create_0.gml +++ b/objects/obj_pnunit/Create_0.gml @@ -105,8 +105,6 @@ hostile_unit=""; hostile_type=0; hostile_splash=0; -alarm[1]=4; - hit = function() { return scr_hit(x1, y1, x2, y2) && obj_ncombat.fading_strength == 0; }; diff --git a/objects/obj_pnunit/obj_pnunit.yy b/objects/obj_pnunit/obj_pnunit.yy index 50f5d2e782..901f257291 100644 --- a/objects/obj_pnunit/obj_pnunit.yy +++ b/objects/obj_pnunit/obj_pnunit.yy @@ -3,11 +3,6 @@ "%Name":"obj_pnunit", "eventList":[ {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":8,"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":3,"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":0,"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",}, diff --git a/scripts/scr_clean/scr_clean.gml b/scripts/scr_clean/scr_clean.gml index 3e69eb12ad..031ee6bb04 100644 --- a/scripts/scr_clean/scr_clean.gml +++ b/scripts/scr_clean/scr_clean.gml @@ -118,7 +118,7 @@ function scr_clean(target_object, weapon_data) { unit_type = veh_type[vehicle_id]; // Apply damage - var _min_damage = enemy == 13 ? 1 : 0.25; + var _min_damage = obj_ncombat.enemy == 13 ? 1 : 0.25; var _dice_sides = 50; var _random_damage_mod = roll_dice(4, _dice_sides, "low") / 100; var _armour_points = max(0, veh_ac[vehicle_id] - armour_pierce); @@ -148,7 +148,7 @@ function scr_clean(target_object, weapon_data) { unit_type = marine.role(); // Apply damage - var _min_damage = enemy == 13 ? 1 : 0.25; + var _min_damage = obj_ncombat.enemy == 13 ? 1 : 0.25; var _dice_sides = 50; var _random_damage_mod = roll_dice(4, _dice_sides, "low") / 100; var _armour_points = max(0, marine_ac[vehicle_id] - armour_pierce); @@ -218,7 +218,7 @@ function scr_clean(target_object, weapon_data) { unit_type = marine.role(); // Apply damage - var _min_damage = enemy == 13 ? 1 : 0.25; + var _min_damage = obj_ncombat.enemy == 13 ? 1 : 0.25; var _dice_sides = 50; var _random_damage_mod = roll_dice(4, _dice_sides, "low") / 100; var _armour_points = max(0, marine_ac[marine_index] - armour_pierce); @@ -315,11 +315,6 @@ function check_dead_marines(unit_struct, unit_index) { lost_units[$ marine_type[unit_index]] = 1; } - // Check red thirst threadhold - if (obj_ncombat.red_thirst == 1 && marine_type[unit_index] != "Death Company" && ((obj_ncombat.player_forces / obj_ncombat.player_max) < 0.9)) { - obj_ncombat.red_thirst = 2; - } - if (unit_struct.IsSpecialist(SPECIALISTS_DREADNOUGHTS)) { dreads -= 1; } else { diff --git a/scripts/scr_en_weapon/scr_en_weapon.gml b/scripts/scr_en_weapon/scr_en_weapon.gml index 657e4dbecf..a237554b09 100644 --- a/scripts/scr_en_weapon/scr_en_weapon.gml +++ b/scripts/scr_en_weapon/scr_en_weapon.gml @@ -1084,7 +1084,7 @@ function scr_en_weapon(_weapon_name, is_man, man_number, man_type, group) { _weapon_stack.shot_count = _shot_count; array_push(_weapon_stack.owners, man_type); - if (obj_ncombat.started == eBATTLE_STAGE.Creation) { + if (obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) { _weapon_stack.ammo_max = _ammo; _weapon_stack.ammo_current = _ammo; _weapon_stack.ammo_reload = _reload; diff --git a/scripts/scr_enunit_scripts/scr_enunit_scripts.gml b/scripts/scr_enunit_scripts/scr_enunit_scripts.gml new file mode 100644 index 0000000000..0cd1d1a9e0 --- /dev/null +++ b/scripts/scr_enunit_scripts/scr_enunit_scripts.gml @@ -0,0 +1,1934 @@ +#macro DEBUG_COLUMN_PRIORITY_ENEMY false + +//* This script is responsible for the target_block target column selection; previosly alarm_0; +/// @mixin +function enunit_target_and_shoot() { + if (!instance_exists(obj_pnunit)) { + exit; + } + + var _block_direction = flank ? get_leftmost : get_rightmost; + + target_block = _block_direction(); + if (target_block == "none") { + exit; + } + + var _target_unit_index = 0; + var _alpha_strike = get_alpha_strike_target(); + if (_alpha_strike != -1) { + target_block = _alpha_strike[0]; + _target_unit_index = _alpha_strike[1]; + } + + //In melee check + engaged = collision_point(x - 10, y, obj_pnunit, 0, 1) || collision_point(x + 10, y, obj_pnunit, 0, 1); + // show_debug_message($"target_block is in melee {engaged}") + + if (!engaged) { + if (DEBUG_COLUMN_PRIORITY_ENEMY) { + var _t_start1 = get_timer(); + } + + // Shooting + var _ranged_weapons = array_concat(get_valid_weapon_stacks(weapon_stacks_normal, 2, 999), get_valid_weapon_stacks_unique(weapon_stacks_unique, 2, 999), get_valid_weapon_stacks(weapon_stacks_vehicle, 2, 999)); + for (var i = 0, _ranged_len = array_length(_ranged_weapons); i < _ranged_len; i++) { + var _weapon_stack = _ranged_weapons[i]; + + if (!target_block_is_valid(target_block, obj_pnunit)) { + log_error($"Invalid player block was found by a ranged target_block!"); + target_block = _block_direction(); + if (!target_block_is_valid(target_block, obj_pnunit)) { + log_error($"Two invalid player blocks were found by a ranged target_block! Exiting!"); + exit; + } + } + + var dist = get_block_distance(target_block); + if (_weapon_stack.range >= dist) { + if (DEBUG_COLUMN_PRIORITY_ENEMY) { + show_debug_message($"{_weapon_stack.weapon_name} IS SHOOTING!"); + } + + var _target_priority_queue = ds_priority_create(); + + if (DEBUG_COLUMN_PRIORITY_ENEMY) { + var _t_start = get_timer(); + } + + // Scan potential targets + var _targets = []; + with (obj_pnunit) { + if (target_block_is_valid(self, obj_pnunit)) { + array_push(_targets, self.id); + } + } + + for (var t = 0; t < array_length(_targets); t++) { + var _block = _targets[t]; + var _distance = get_block_distance(_block); + + if (_distance <= _weapon_stack.range) { + var _priority = get_target_priority(_weapon_stack, _block); + ds_priority_add(_target_priority_queue, _block, _priority); + } + } + + // Add fort as fallback target + var fort = instance_nearest(x, y, obj_nfort); + if (fort != noone && !flank) { + var d = get_block_distance(fort); + if (d <= _weapon_stack.range) { + ds_priority_add(_target_priority_queue, fort, 999); + } + } + + if (DEBUG_COLUMN_PRIORITY_ENEMY) { + var _t_end = get_timer(); + var _elapsed_ms = (_t_end - _t_start) / 1000; + show_debug_message($"⏱️ Execution Time: {_elapsed_ms}ms"); + } + + // Shoot highest-priority target + if (!ds_priority_empty(_target_priority_queue)) { + var _best_target = ds_priority_delete_max(_target_priority_queue); + + var _is_fort = _best_target.object_index == obj_nfort; + if (_is_fort) { + _target_unit_index = 1; + _weapon_stack.target_type = eTARGET_TYPE.FORTIFICATION; + } + + scr_shoot(_weapon_stack, _best_target, _target_unit_index); + } else { + log_error($"{_weapon_stack.weapon_name} didn't find a valid target! This shouldn't happen!"); + } + + ds_priority_destroy(_target_priority_queue); + } else { + if (DEBUG_COLUMN_PRIORITY_ENEMY) { + show_debug_message($"I can't shoot, my range is too small! Weapon: {_weapon_stack.weapon_name};"); + } + continue; + } + } + if (DEBUG_COLUMN_PRIORITY_ENEMY) { + var _t_end1 = get_timer(); + var _elapsed_ms1 = (_t_end1 - _t_start1) / 1000; + show_debug_message($"⏱️ Enemy Ranged Alarm Execution Time: {_elapsed_ms1}ms"); + } + } else { + if (DEBUG_COLUMN_PRIORITY_ENEMY) { + var _t_start1 = get_timer(); + } + + // Melee + var _melee_weapons = array_concat(get_valid_weapon_stacks(weapon_stacks_normal, 1, 2), get_valid_weapon_stacks_unique(weapon_stacks_unique, 1, 2), get_valid_weapon_stacks(weapon_stacks_vehicle, 1, 999)); + for (var i = 0, _wep_len = array_length(_melee_weapons); i < _wep_len; i++) { + var _weapon_stack = _melee_weapons[i]; + + if (!target_block_is_valid(target_block, obj_pnunit)) { + log_error($"Invalid player block was found by a melee target_block!"); + exit; + } + + if (DEBUG_COLUMN_PRIORITY_ENEMY) { + show_debug_message($"{_weapon_stack.weapon_name} IS IN MELEE!"); + } + + if (instance_exists(obj_nfort) && (!flank)) { + target_block = instance_nearest(x, y, obj_nfort); + _target_unit_index = 1; + _weapon_stack.target_type = eTARGET_TYPE.FORTIFICATION; + } + + scr_shoot(_weapon_stack, target_block, _target_unit_index); + } + + if (DEBUG_COLUMN_PRIORITY_ENEMY) { + var _t_end1 = get_timer(); + var _elapsed_ms1 = (_t_end1 - _t_start1) / 1000; + show_debug_message($"⏱️ Enemy Melee Alarm Execution Time: {_elapsed_ms1}ms"); + } + } + //! Here was some stuff that depended on image_index here, that got deleted, because I couldn't figure out why it exists; +} + +// Previosly alarm_1 +/// @mixin +function enunit_enemy_profiles_init() { + var i, g; + i = 0; + g = 0; + men = 0; + veh = 0; + medi = 0; + + weapon_stacks_normal = {}; + weapon_stacks_vehicle = {}; + weapon_stacks_unique = {}; + + i = 0; + // men=0;veh=0; + + j = 0; + good = 0; + open = 0; + + repeat (700) { + j += 1; + if (dudes_num[j] <= 0) { + dudes[j] = ""; + dudes_special[j] = ""; + dudes_num[j] = 0; + dudes_ac[j] = 0; + dudes_hp[j] = 0; + dudes_vehicle[j] = 0; + dudes_damage[j] = 0; + dudes_attack[j] = 1; + dudes_ranged[j] = 1; + } + if ((dudes[j] == "") && (dudes[j + 1] != "")) { + dudes[j] = dudes[j + 1]; + dudes_special[j] = dudes_special[j + 1]; + dudes_num[j] = dudes_num[j + 1]; + dudes_ac[j] = dudes_ac[j + 1]; + dudes_hp[j] = dudes_hp[j + 1]; + dudes_vehicle[j] = dudes_vehicle[j + 1]; + dudes_damage[j] = dudes_damage[j + 1]; + dudes_attack[j] = dudes_attack[j + 1]; + dudes_ranged[j] = dudes_ranged[j + 1]; + + dudes[j + 1] = ""; + dudes_special[j + 1] = ""; + dudes_num[j + 1] = 0; + dudes_ac[j + 1] = 0; + dudes_hp[j + 1] = 0; + dudes_vehicle[j + 1] = 0; + dudes_damage[j + 1] = 0; + dudes_ranged[j + 1] = 1; + dudges_defense[j + 1] = 1; + dudes_attack[j + 1] = 1; + } + } + j = 0; + + repeat (20) { + j += 1; + if (obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) { + if (dudes[j] == "Malcadon Spyrer") { + dudes_ac[j] = 35; + dudes_hp[j] = 200; + } + } + if (dudes[j] == "Malcadon Spyrer") { + men += dudes_num[j]; + scr_en_weapon("Web Spinner", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Venom Claws", true, dudes_num[j], dudes[j], j); + } + + if (((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (neww == 1)) || (dudes_num[j] > 1)) { + if (dudes[j] == "Greater Daemon of Khorne") { + dudes_ac[j] = 12; + dudes_hp[j] = 700; + } + } + if (dudes[j] == "Greater Daemon of Khorne") { + scr_en_weapon("Khorne Demon Melee", true, dudes_num[j], dudes[j], j); + dudes_dr[j] = 0.5; + medi += dudes_num[j]; + if (obj_ncombat.battle_special == "ship_demon") { + dudes_dr[j] = 0.65; + } + } + if (((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (neww == 1)) || (dudes_num[j] > 1)) { + if (dudes[j] == "Greater Daemon of Slaanesh") { + dudes_ac[j] = 10; + dudes_hp[j] = 500; + dudes_dr[j] = 0.25; + } + } + if (dudes[j] == "Greater Daemon of Slaanesh") { + scr_en_weapon("Demon Melee", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Lash Whip", true, dudes_num[j], dudes[j], j); + dudes_dr[j] = 0.25; + medi += dudes_num[j]; + } + if (((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (neww == 1)) || (dudes_num[j] > 1)) { + if (dudes[j] == "Greater Daemon of Nurgle") { + dudes_ac[j] = 8; + dudes_hp[j] = 900; + dudes_dr[j] = 0.2; + } + } + if (dudes[j] == "Greater Daemon of Nurgle") { + scr_en_weapon("Demon Melee", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Nurgle Vomit", true, dudes_num[j], dudes[j], j); + dudes_dr[j] = 0.6; + medi += dudes_num[j]; + } + if (((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (neww == 1)) || (dudes_num[j] > 1)) { + if (dudes[j] == "Greater Daemon of Tzeentch") { + dudes_ac[j] = 10; + dudes_hp[j] = 600; + } + } + if (dudes[j] == "Greater Daemon of Tzeentch") { + scr_en_weapon("Demon Melee", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Witchfire", true, dudes_num[j], dudes[j], j); + dudes_dr[j] = 0.75; + medi += dudes_num[j]; + } + + if (dudes[j] == "Bloodletter") { + scr_en_weapon("Bloodletter Melee", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 200; + men += dudes_num[j]; + dudes_dr[j] = 0.4; + } + if (dudes[j] == "Daemonette") { + scr_en_weapon("Daemonette Melee", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 150; + men += dudes_num[j]; + dudes_dr[j] = 0.3; + } + if (dudes[j] == "Pink Horror") { + scr_en_weapon("Eldritch Fire", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 100; + men += dudes_num[j]; + dudes_dr[j] = 0.5; + } + if (dudes[j] == "Plaguebearer") { + scr_en_weapon("Plaguebearer Melee", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 5; + dudes_hp[j] = 300; + men += dudes_num[j]; + dudes_dr[j] = 0.4; + } + + if (dudes[j] == "Helbrute") { + scr_en_weapon("Power Fist", false, dudes_num[j], dudes[j], j); + scr_en_weapon("Multi-Melta", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 40; + dudes_hp[j] = 300; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + dudes_dr[j] = 0.5; + } + if (dudes[j] == "Soul Grinder") { + scr_en_weapon("Warpsword", false, dudes_num[j], dudes[j], j); + scr_en_weapon("Iron Claw", false, dudes_num[j], dudes[j], j); + scr_en_weapon("Battle Cannon", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 30; + dudes_hp[j] = 350; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + dudes_dr[j] = 0.5; + } + if (dudes[j] == "Maulerfiend") { + scr_en_weapon("Maulerfiend Claws", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 30; + dudes_hp[j] = 250; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + dudes_dr[j] = 0.5; + } + } + j = 0; + + neww = 0; + + if ((men + veh == 1) && (instance_number(obj_enunit) == 1)) { + if ((men == 1) && (veh == 0)) { + var i, h; + i = 0; + h = 0; + repeat (20) { + if (h == 0) { + i += 1; + if (dudes_num[i] == 1) { + h = dudes_hp[i]; + obj_ncombat.display_p2 = h; + obj_ncombat.display_p2n = string(dudes[i]); + } + } + } + } + } + + /* */ + var __b__; + __b__ = action_if_variable(obj_ncombat.enemy, 1, 0); + if (__b__) { + var j; + j = 0; + men = 0; + repeat (100) { + j += 1; + veh = 0; + dreads = 0; + if ((dudes[j] != "") && (dudes_vehicle[j] == 0)) { + men += dudes_num[j]; + } + } + + // show_message("dudes1:"+string(dudes[1])+", men:"+string(men)); + + var i, g; + i = 0; + g = 0; + + var dreaded; + dreaded = false; + + repeat (700) { + g += 1; + // Why was this here? And why was it later checked, if it always would be false?; + // marine_casting[g] = false; + + if (((dudes[g] != "") && (dudes_num[g] > 0)) && (dudes_hp[g] > 0)) { + // if (marine_hp[g]>0) then men+=1; + + /* + scr_en_weapon + argument0: name + argument1: man? + argument2: number + argument3: owner + argument4: dudes number + */ + + if ((dudes[g] == obj_ini.role[100][6]) || (dudes[g] == "Venerable " + obj_ini.role[100][6]) && (dudes_hp[g] > 0)) { + dreads += 1; + dreaded = true; + } + if (dudes_mobi[g] == "Bike") { + scr_en_weapon("Twin Linked Bolters", false, 1, dudes[g], g); + } + if ((dudes_mobi[g] != "Bike") && (dudes_mobi[g] != "")) { + if (string_count("Jump Pack", marine_mobi[g]) > 0) { + scr_en_weapon("Hammer of Wrath", false, 1, dudes[g], g); + } + } + + if (dudes_mobi[g] == "Servo-arm") { + scr_en_weapon("Servo-arm(M)", false, 1, dudes[g], g); + } + if (dudes_mobi[g] == "Servo-harness") { + scr_en_weapon("Servo-arm(M)", false, 1, dudes[g], g); + scr_en_weapon("Flamer", false, 1, dudes[g], g); + scr_en_weapon("Plasma Cutter", false, 1, dudes[g], g); + } + + var j, good, open; + j = 0; + good = 0; + open = 0; // Counts the number and types of marines within this object + repeat (20) { + j += 1; + if ((dudes[j] == "") && (open == 0)) { + open = j; // Determine if vehicle here + + if (dudes[j] == "Venerable " + string(obj_ini.role[100][6])) { + dudes_vehicle[j] = 1; + } + if (dudes[j] == obj_ini.role[100][6]) { + dudes_vehicle[j] = 1; + } + } + // if (dudes[g]=dudes[j]){good=1;dudes_num[j]+=1;} + // if (good=0) and (open!=0){dudes[open]=marine_type[g];dudes_num[open]=1;} + } + + if ((dudes_wep1[g] != "") && (marine_casting[g] == false)) { + // Do not add weapons to the roster while casting + if (dudes[g] != "Chapter Master") { + scr_en_weapon(string(dudes_wep1[g]), false, 1, dudes[g], g); + } + + if (dudes_wep1[g] == "Close Combat Weapon") { + scr_en_weapon("CCW Heavy Flamer", true, 1, dudes[g], g); + } + if (string_count("UBOLT", dudes_wep1[g]) > 0) { + scr_en_weapon("Integrated-Bolter", false, 1, dudes[g], g); + } + if (string_count("UFL", dudes_wep1[g]) > 0) { + scr_en_weapon("Underslung Flamer", false, 1, dudes[g], g); + } + } + if ((dudes_wep2[g] != "") && (marine_casting[g] == false)) { + if (dudes[g] != "Chapter Master") { + scr_en_weapon(string(dudes_wep2[g]), false, 1, dudes[g], g); + } + + if (dudes_wep2[g] == "Close Combat Weapon") { + scr_en_weapon("CCW Heavy Flamer", true, 1, dudes[g], g); + } + if (string_count("UBOLT", dudes_wep2[g]) > 0) { + scr_en_weapon("Integrated-Bolter", false, 1, dudes[g], g); + } + if (string_count("UFL", dudes_wep2[g]) > 0) { + scr_en_weapon("Underslung Flamer", false, 1, dudes[g], g); + } + } + } + } + + // Right here should be retreat- if important units are exposed they should try to hop left + + if ((men > 0) && (alarm[5] > 0)) { + alarm[5] = -1; + } + instance_activate_object(obj_enunit); + + exit; + + /* */ + } + __b__ = action_if_variable(obj_ncombat.enemy, 2, 0); + if (__b__) { + repeat (20) { + j += 1; + if (dudes[j] == "Imperial Guardsman") { + dudes_ac[j] = 40; + dudes_hp[j] = 5; + men += dudes_num[j]; + } + + if (dudes[j] == "Heavy Weapons Team") { + scr_en_weapon("Heavy Bolter", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 100; + dudes_dr[j] = 0.9; + men += dudes_num[j]; + } + + if (dudes[j] == "Ogryn") { + scr_en_weapon("Ripper Gun", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Ogryn Melee", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 120; + dudes_dr[j] = 0.75; + men += dudes_num[j]; + } + + if (dudes[j] == "Chimera") { + scr_en_weapon("Multi-Laster", false, dudes_num[j], dudes[j], j); + scr_en_weapon("Heavy Bolter", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 40; + dudes_hp[j] = 200; + dudes_dr[j] = 0.75; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + if (dudes[j] == "Basilisk") { + scr_en_weapon("Earthshaker Cannon", false, dudes_num[j], dudes[j], j); + scr_en_weapon("Storm Bolter", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 20; + dudes_hp[j] = 150; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + if (dudes[j] == "Leman Russ Battle Tank") { + scr_en_weapon("Battle Cannon", false, dudes_num[j], dudes[j], j); + scr_en_weapon("Lascannon", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 45; + dudes_hp[j] = 250; + dudes_dr[j] = 0.25; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + if (dudes[j] == "Leman Russ Demolisher") { + scr_en_weapon("Demolisher Cannon", false, dudes_num[j], dudes[j], j); + scr_en_weapon("Lascannon", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 40; + dudes_hp[j] = 250; + dudes_dr[j] = 0.25; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + if (dudes[j] == "Vendetta") { + scr_en_weapon("Twin-Linked Lascannon", false, dudes_num[j] * 3, dudes[j], j); + dudes_ac[j] = 20; + dudes_hp[j] = 300; + dudes_dr[j] = 0.25; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + } + + // Twin-Linked Lascannon + // Multi-Laser + // Ripper Gun + // Earthshaker Cannon + + // 0-10,000,000 + // Leman Russ Battle Tank = min.1, max = /40000 + // Leman Russ Demolisher = min.1, max = /60000 + // Chimera = min.1, max = /60000 + + /* */ + } + __b__ = action_if_variable(obj_ncombat.enemy, 3, 0); + if (__b__) { + repeat (20) { + j += 1; + if (dudes[j] == "Thallax") { + scr_en_weapon("Lightning Gun", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Thallax Melee", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 30; + dudes_hp[j] = 80; + men += dudes_num[j]; + } + if (dudes[j] == "Praetorian Servitor") { + scr_en_weapon("Phased Plasma-fusil", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 25; + dudes_hp[j] = 150; + medi += dudes_num[j]; + } + } + + // + // + + /* */ + } + __b__ = action_if_variable(obj_ncombat.enemy, 5, 0); + if (__b__) { + repeat (20) { + j += 1; + if (dudes[j] == "Leader") { + scr_en_weapon("Blessed Weapon", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Laser Mace", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Infernus Pistol", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 10; + if ((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (dudes_num[j] > 1)) { + dudes_hp[j] = 200; + } + men += dudes_num[j]; + dudes_dr[j] = 0.25; + } + if (dudes[j] == "Palatine") { + scr_en_weapon("Plasma Pistol", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 100; + men += dudes_num[j]; + dudes_dr[j] = 0.5; + } + if (dudes[j] == "Priest") { + scr_en_weapon("Laspistol", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 0; + dudes_hp[j] = 50; + men += dudes_num[j]; + dudes_dr[j] = 0.5; + } + + if (dudes[j] == "Arco-Flagellent") { + scr_en_weapon("Electro-Flail", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 0; + dudes_hp[j] = 150; + men += dudes_num[j]; + dudes_dr[j] = 0.7; + } + + if (dudes[j] == "Celestian") { + scr_en_weapon("Bolter", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Chainsword", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 60; + men += dudes_num[j]; + dudes_dr[j] = 0.50; + } + if (dudes[j] == "Mistress") { + scr_en_weapon("Neural Whip", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 60; + men += dudes_num[j]; + dudes_dr[j] = 0.50; + } + if (dudes[j] == "Sister Repentia") { + scr_en_weapon("Eviscerator", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 0; + dudes_hp[j] = 75; + men += dudes_num[j]; + dudes_dr[j] = 0.75; + } + + if (dudes[j] == "Battle Sister") { + if (dudes_num[j] <= 4) { + scr_en_weapon("Bolter", true, dudes_num[j], dudes[j], j); + } + if (dudes_num[j] >= 5) { + var nem; + nem = round(dudes_num[j] / 4); + scr_en_weapon("Flamer", true, nem, dudes[j], j); + scr_en_weapon("Bolter", true, dudes_num[j] - nem, dudes[j], j); + } + scr_en_weapon("Sarissa", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 60; + men += dudes_num[j]; + dudes_dr[j] = 0.75; + } + if (dudes[j] == "Seraphim") { + scr_en_weapon("Seraphim Pistols", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Chainsword", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 60; + men += dudes_num[j]; + dudes_dr[j] = 0.6; + } + if (dudes[j] == "Dominion") { + scr_en_weapon("Meltagun", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Meltabomb", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 60; + men += dudes_num[j]; + dudes_dr[j] = 0.75; + } + if (dudes[j] == "Retributor") { + if (dudes_num[j] <= 3) { + scr_en_weapon("Heavy Bolter", true, dudes_num[j], dudes[j], j); + } + if (dudes_num[j] >= 4) { + var nem; + nem = round(dudes_num[j] / 4); + scr_en_weapon("Missile Launcher", true, nem, dudes[j], j); + scr_en_weapon("Heavy Bolter", true, dudes_num[j] - nem, dudes[j], j); + } + scr_en_weapon("Bolt Pistol", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 60; + men += dudes_num[j]; + dudes_dr[j] = 0.6; + } + + if (dudes[j] == "Follower") { + scr_en_weapon("Laspistol", true, dudes_num[j], dudes[j], j); + scr_en_weapon("melee0.5", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 0; + dudes_hp[j] = 30; + men += dudes_num[j]; + } + + if (dudes[j] == "Rhino") { + scr_en_weapon("Storm Bolter", false, dudes_num[j] * 2, dudes[j], j); + dudes_ac[j] = 40; + dudes_hp[j] = 200; + dudes_dr[j] = 0.75; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + + if (dudes[j] == "Chimera") { + scr_en_weapon("Heavy Flamer", false, dudes_num[j] * 2, dudes[j], j); + dudes_ac[j] = 40; + dudes_hp[j] = 200; + dudes_dr[j] = 0.75; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + + if (dudes[j] == "Immolator") { + scr_en_weapon("Twin Linked Heavy Flamers", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 40; + dudes_hp[j] = 300; + dudes_dr[j] = 0.35; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + if (dudes[j] == "Exorcist") { + scr_en_weapon("Exorcist Missile Launcher", false, dudes_num[j], dudes[j], j); + scr_en_weapon("Storm Bolter", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 40; + if ((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (dudes_num[j] > 1)) { + dudes_hp[j] = 200; + } + dudes_dr[j] = 0.55; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + + if (dudes[j] == "Penitent Engine") { + scr_en_weapon("Close Combat Weapon", false, dudes_num[j] * 2, dudes[j], j); + scr_en_weapon("Heavy Flamer", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 35; + dudes_hp[j] = 150; + dudes_dr[j] = 0.50; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + + // if (obj_ncombat.enemy=11) and (dudes_vehicle[j]=0) and (dudes[j]!="Cultist"){dudes_dr[j]=0.8;} + // if (obj_ncombat.enemy=11) and (dudes_vehicle[j]=1){dudes_dr[j]=0.75;} + + // if (dudes[j]!="") and (dudes_num[j]=0){dudes[j]="";dudes_num[j]=0;} + if ((dudes[j] != "") && (dudes_hp[j] == 0)) { + dudes[j] = ""; + dudes_num[j] = 0; + } + if (faith[j] > 0) { + dudes_dr[j] = max(0.65, dudes_dr[j] + 0.15); + } + } + + /* */ + } + __b__ = action_if_variable(obj_ncombat.enemy, 6, 0); + if (__b__) { + repeat (20) { + j += 1; + if (dudes[j] == "Leader") { + scr_en_weapon("Singing Spear", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Singing Spear Throw", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 150; + men += dudes_num[j]; + dudes_dr[j] = 0.5; + } + + if (dudes[j] == "Autarch") { + scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Fusion Gun", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 12; + dudes_hp[j] = 150; + dudes_dr[j] = 0.75; + men += dudes_num[j]; + } + if (dudes[j] == "Farseer") { + scr_en_weapon("Singing Spear", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Singing Spear Throw", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 120; + dudes_dr[j] = 0.6; + men += dudes_num[j]; + } + if (dudes[j] == "Warlock") { + scr_en_weapon("Witchblade", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Psyshock", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 80; + dudes_dr[j] = 0.75; + men += dudes_num[j]; + } + if (dudes[j] == "Avatar") { + scr_en_weapon("Wailing Doom", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Avatar Smite", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 40; + dudes_hp[j] = 300; + dudes_dr[j] = 0.55; + veh += dudes_num[j]; + } + if (dudes[j] == "Mighty Avatar") { + scr_en_weapon("Wailing Doom", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Avatar Smite", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 50; + dudes_hp[j] = 450; + dudes_dr[j] = 0.5; + veh += dudes_num[j]; + } + if (dudes[j] == "Godly Avatar") { + scr_en_weapon("Wailing Doom", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Avatar Smite", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 60; + dudes_hp[j] = 600; + dudes_dr[j] = 0.40; + veh += dudes_num[j]; + } + + if (dudes[j] == "Ranger") { + scr_en_weapon("Ranger Long Rifle", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Shuriken Pistol", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 40; + dudes_dr[j] = 0.9; + men += dudes_num[j]; + } + if (dudes[j] == "Pathfinder") { + scr_en_weapon("Pathfinder Long Rifle", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 60; + dudes_dr[j] = 0.8; + men += dudes_num[j]; + } + if (dudes[j] == "Dire Avenger") { + scr_en_weapon("Avenger Shuriken Catapult", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 40; + men += dudes_num[j]; + } + if (dudes[j] == "Dire Avenger Exarch") { + scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 70; // Shimmershield + men += dudes_num[j]; + } + if (dudes[j] == "Howling Banshee") { + scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Shuriken Pistol", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 40; + dudes_dr[j] = 0.8; + men += dudes_num[j]; + } + if (dudes[j] == "Howling Banshee Exarch") { + scr_en_weapon("Executioner", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 60; + dudes_dr[j] = 0.75; + men += dudes_num[j]; + } + if (dudes[j] == "Striking Scorpion") { + scr_en_weapon("Scorpion Chainsword", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Shuriken Pistol", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Mandiblaster", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 60; + men += dudes_num[j]; + } + if (dudes[j] == "Striking Scorpion Exarch") { + scr_en_weapon("Biting Blade", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Scorpion's Claw", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Mandiblaster", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 80; + men += dudes_num[j]; + } + if (dudes[j] == "Fire Dragon") { + scr_en_weapon("Fusion Gun", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Meltabomb", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 12; + dudes_hp[j] = 40; + men += dudes_num[j]; + } + if (dudes[j] == "Fire Dragon Exarch") { + scr_en_weapon("Firepike", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 12; + dudes_hp[j] = 60; + men += dudes_num[j]; + } + if (dudes[j] == "Warp Spider") { + scr_en_weapon("Deathspinner", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 40; + dudes_dr[j] = 0.9; + men += dudes_num[j]; + } + if (dudes[j] == "Warp Spider Exarch") { + scr_en_weapon("Dual Deathspinners", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Powerblades", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 60; + dudes_dr[j] = 0.8; + men += dudes_num[j]; + } + if (dudes[j] == "Dark Reaper") { + scr_en_weapon("Reaper Launcher", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 40; + men += dudes_num[j]; + } + if (dudes[j] == "Dark Reaper Exarch") { + scr_en_weapon("Tempest Launcher", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 50; + men += dudes_num[j]; + } + if (dudes[j] == "Shining Spear") { + scr_en_weapon("Laser Lance", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Twin Linked Shuriken Catapult", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 75; + dudes_dr[j] = 0.8; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + if (dudes[j] == "Guardian") { + scr_en_weapon("Shuriken Catapult", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 30; + men += dudes_num[j]; + } + if (dudes[j] == "Grav Platform") { + scr_en_weapon("Pulse Laser", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 60; + men += dudes_num[j]; + } + if (dudes[j] == "Trouper") { + scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Fusion Pistol", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 50; + dudes_dr[j] = 0.25; + men += dudes_num[j]; + } + if (dudes[j] == "Athair") { + scr_en_weapon("Plasma Pistol", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Harlequin's Kiss", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 75; + dudes_dr[j] = 0.25; + men += dudes_num[j]; + } + if (dudes[j] == "Wraithguard") { + scr_en_weapon("Wraithcannon", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 15; + dudes_hp[j] = 125; + dudes_dr[j] = 0.70; + men += dudes_num[j]; + } + if (dudes[j] == "Vyper") { + scr_en_weapon("Twin Linked Shuriken Catapult", false, dudes_num[j], dudes[j], j); + scr_en_weapon("Pulse Laser", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 40; + dudes_hp[j] = 100; + dudes_dr[j] = 0.8; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + if (dudes[j] == "Falcon") { + scr_en_weapon("Pulse Laser", false, dudes_num[j], dudes[j], j); + scr_en_weapon("Shuriken Cannon", false, dudes_num[j], dudes[j], j); + scr_en_weapon("Bright Lance", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 40; + dudes_hp[j] = 200; + dudes_dr[j] = 0.6; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + if (dudes[j] == "Fire Prism") { + scr_en_weapon("Twin Linked Shuriken Catapult", false, dudes_num[j], dudes[j], j); + scr_en_weapon("Prism Cannon", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 40; + dudes_hp[j] = 200; + dudes_dr[j] = 0.5; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + if (dudes[j] == "Nightspinner") { + scr_en_weapon("Twin Linked Doomweaver", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 40; + dudes_hp[j] = 200; + dudes_dr[j] = 0.6; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + if (dudes[j] == "Wraithlord") { + scr_en_weapon("Two Power Fists", false, dudes_num[j], dudes[j], j); + scr_en_weapon("Flamer", false, dudes_num[j] * 2, dudes[j], j); + scr_en_weapon("Starcannon", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 40; + dudes_hp[j] = 200; + dudes_dr[j] = 0.5; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + if (dudes[j] == "Phantom Titan") { + scr_en_weapon("Two Power Fists", false, dudes_num[j], dudes[j], j); + scr_en_weapon("Phantom Pulsar", false, dudes_num[j] * 2, dudes[j], j); + scr_en_weapon("Titan Starcannon", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 50; + dudes_hp[j] = 800; + dudes_dr[j] = 0.35; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + } + + /* */ + } + __b__ = action_if_variable(obj_ncombat.enemy, 7, 0); + if (__b__) { + repeat (20) { + j += 1; + if (dudes[j] == "Leader") { + scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Rokkit Launcha", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Big Shoota", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 12; + if ((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (dudes_num[j] > 1)) { + dudes_hp[j] = 600; + } + veh += dudes_num[j]; + dudes_dr[j] = 0.5; + } + + if (dudes[j] == "Minor Warboss") { + scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Big Shoota", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + if ((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (dudes_num[j] > 1)) { + dudes_hp[j] = 150; + dudes_dr[j] = 0.75; + } + men += dudes_num[j]; + } + if (dudes[j] == "Warboss") { + scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Rokkit Launcha", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 12; + if ((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (dudes_num[j] > 1)) { + dudes_hp[j] = 200; + dudes_dr[j] = 0.75; + } + men += dudes_num[j]; + } + if (dudes[j] == "Big Warboss") { + scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Rokkit Launcha", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 12; + if ((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (dudes_num[j] > 1)) { + dudes_hp[j] = 300; + dudes_dr[j] = 0.5; + } + men += dudes_num[j]; + } + + if (dudes[j] == "Gretchin") { + scr_en_weapon("Grot Blasta", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 0; + dudes_hp[j] = 15; + men += dudes_num[j]; + } + if (dudes[j] == "Slugga Boy") { + scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Slugga", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 5; + dudes_hp[j] = 60; + men += dudes_num[j]; + } + if (dudes[j] == "Shoota Boy") { + scr_en_weapon("Shoota", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 5; + dudes_hp[j] = 60; + men += dudes_num[j]; + } + + if (dudes[j] == "Mekboy") { + scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Big Shoota", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 12; + dudes_hp[j] = 100; + dudes_dr[j] = 0.75; + men += dudes_num[j]; + } + if (dudes[j] == "Meganob") { + scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Big Shoota", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 12; + dudes_hp[j] = 150; + dudes_dr[j] = 0.6; + men += dudes_num[j]; + } + if (dudes[j] == "Flash Git") { + scr_en_weapon("Snazzgun", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 100; + men += dudes_num[j]; + } + if (dudes[j] == "Cybork") { + scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Big Shoota", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 125; + dudes_dr[j] = 0.75; + men += dudes_num[j]; + } + + if (dudes[j] == "Ard Boy") { + scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Slugga", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 80; + dudes_dr[j] = 0.9; + men += dudes_num[j]; + } + if (dudes[j] == "Kommando") { + scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Rokkit Launcha", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 125; + dudes_dr[j] = 0.9; + men += dudes_num[j]; + } + if (dudes[j] == "Burna Boy") { + scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Burna", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 5; + dudes_hp[j] = 80; + men += dudes_num[j]; + } + if (dudes[j] == "Tankbusta") { + scr_en_weapon("Rokkit Launcha", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Tankbusta Bomb", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 5; + dudes_hp[j] = 80; + men += dudes_num[j]; + } + if (dudes[j] == "Stormboy") { + scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Slugga", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 5; + dudes_hp[j] = 80; + dudes_special[j] = "Jetpack"; + men += dudes_num[j]; + } + + if (dudes[j] == "Battlewagon") { + scr_en_weapon("Kannon", false, dudes_num[j], dudes[j], j); + scr_en_weapon("Big Shoota", false, dudes_num[j] * 2, dudes[j], j); + scr_en_weapon("Rokkit Launcha", false, dudes_num[j] * 2, dudes[j], j); + dudes_ac[j] = 80; + dudes_hp[j] = 800; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + if (dudes[j] == "Deff Dread") { + scr_en_weapon("Power Klaw", false, dudes_num[j] * 2, dudes[j], j); + scr_en_weapon("Big Shoota", false, dudes_num[j], dudes[j], j); + scr_en_weapon("Rokkit Launcha", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 60; + dudes_hp[j] = 500; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + } + + /* */ + } + __b__ = action_if_variable(obj_ncombat.enemy, 8, 0); + if (__b__) { + repeat (20) { + j += 1; + if (dudes[j] == "XV8 Commander") { + scr_en_weapon("Plasma Rifle", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Fusion Blaster", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Cyclic Ion Blaster", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 12; + dudes_hp[j] = 300; + dudes_dr[j] = 0.5; + men += dudes_num[j]; + } + if (dudes[j] == "XV8 Bodyguard") { + scr_en_weapon("Plasma Rifle", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Burst Rifle", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 200; + dudes_dr[j] = 0.75; + men += dudes_num[j]; + } + if (dudes[j] == "XV8 Crisis") { + scr_en_weapon("Plasma Rifle", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Missile Pod", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 150; + dudes_dr[j] = 0.75; + men += dudes_num[j]; + } + if (dudes[j] == "XV8 (Brightknife)") { + scr_en_weapon("Fusion Blaster", true, dudes_num[j] * 2, dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 150; + dudes_dr[j] = 0.75; + men += dudes_num[j]; + } + if (dudes[j] == "Shield Drone") { + dudes_ac[j] = 8; + dudes_hp[j] = 50; + men += dudes_num[j]; + } + + if (dudes[j] == "XV88 Broadside") { + scr_en_weapon("Smart Missile System", true, dudes_num[j] * 2, dudes[j], j); + scr_en_weapon("Small Railgun", true, dudes_num[j] * 2, dudes[j], j); + dudes_ac[j] = 12; + dudes_hp[j] = 225; + dudes_dr[j] = 0.75; + men += dudes_num[j]; + } + if (dudes[j] == "XV25 Stealthsuit") { + scr_en_weapon("Burst Rifle", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 50; + dudes_dr[j] = 0.75; + men += dudes_num[j]; + } + + if (dudes[j] == "Fire Warrior") { + scr_en_weapon("Pulse Rifle", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 30; + men += dudes_num[j]; + } + if (dudes[j] == "Pathfinder") { + scr_en_weapon("Rail Rifle", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 30; + men += dudes_num[j]; + } + if (dudes[j] == "Kroot") { + scr_en_weapon("Kroot Rifle", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Melee2", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 5; + dudes_hp[j] = 30; + men += dudes_num[j]; + } + if (dudes[j] == "Vespid") { + scr_en_weapon("Vespid Crystal", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Melee2", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 5; + dudes_hp[j] = 50; + men += dudes_num[j]; + } + + if (dudes[j] == "Devilfish") { + scr_en_weapon("Smart Missile System", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 30; + dudes_hp[j] = 150; + dudes_dr[j] = 0.75; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + if (dudes[j] == "Hammerhead") { + scr_en_weapon("Railgun", false, dudes_num[j], dudes[j], j); + scr_en_weapon("Smart Missile System", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 30; + dudes_hp[j] = 150; + dudes_dr[j] = 0.75; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + } + + /* */ + } + __b__ = action_if_variable(obj_ncombat.enemy, 9, 0); + if (__b__) { + repeat (20) { + j += 1; + if (dudes[j] == "Hive Tyrant") { + scr_en_weapon("Bonesword", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Lashwhip", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Heavy Venom Cannon", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 20; + dudes_hp[j] = 400; + dudes_dr[j] = 0.5; + men += dudes_num[j]; + } + + if (dudes[j] == "Tyrant Guard") { + scr_en_weapon("Crushing Claws", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 12; + dudes_hp[j] = 200; + dudes_dr[j] = 0.6; + men += dudes_num[j]; + } + if (dudes[j] == "Tyranid Warrior") { + scr_en_weapon("Rending Claws", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Devourer", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 100; + dudes_dr[j] = 0.9; + men += dudes_num[j]; + } + if (dudes[j] == "Zoanthrope") { + scr_en_weapon("Zoanthrope Blast", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 300; + dudes_dr[j] = 0.25; + men += dudes_num[j]; + } + if (dudes[j] == "Carnifex") { + scr_en_weapon("Carnifex Claws", false, dudes_num[j], dudes[j], j); + scr_en_weapon("Venom Cannon", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 20; + dudes_hp[j] = 300; + dudes_dr[j] = 0.75; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + if (dudes[j] == "Termagaunt") { + scr_en_weapon("Fleshborer", true, dudes_num[j] / 10, dudes[j], j); + dudes_ac[j] = 5; + dudes_hp[j] = 25; + men += dudes_num[j]; + } + if (dudes[j] == "Hormagaunt") { + scr_en_weapon("Scything Talons", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 5; + dudes_hp[j] = 25; + men += dudes_num[j]; + } + + if (dudes[j] == "Cultist") { + scr_en_weapon("Autogun", true, dudes_num[j], dudes[j], j); + scr_en_weapon("melee0.5", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 0; + dudes_hp[j] = 35; + men += dudes_num[j]; + } + if (dudes[j] == "Genestealer") { + scr_en_weapon("Genestealer Claws", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 5; + dudes_hp[j] = 75; + men += dudes_num[j]; + } + if (dudes[j] == "Genestealer Patriarch") { + scr_en_weapon("Genestealer Claws", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Witchfire", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 300; + dudes_dr[j] = 0.60; + men += dudes_num[j]; + } + if (dudes[j] == "Armoured Limousine") { + scr_en_weapon("Autogun", false, dudes_num[j] * 4, dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 150; + dudes_dr[j] = 0.75; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + if (dudes[j] == "Lictor") { + scr_en_weapon("Lictor Claws", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Flesh Hooks", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 300; + dudes_dr[j] = 0.60; + men += dudes_num[j]; + } + } + + /* */ + } + __b__ = action_if_variable(obj_ncombat.enemy, 10, 4); + if (__b__) { + __b__ = action_if_variable(obj_ncombat.enemy, 12, 1); + if (__b__) { + repeat (20) { + j += 1; + if ((dudes[j] == "Leader") && (obj_controller.faction_gender[10] == 1)) { + scr_en_weapon("Meltagun", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Power Fist", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 30; + if ((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (dudes_num[j] > 1)) { + dudes_hp[j] = 300; + } + men += dudes_num[j]; + dudes_dr[j] = 0.75; + } + if ((dudes[j] == "Leader") && (obj_controller.faction_gender[10] == 2)) { + scr_en_weapon("Khorne Demon Melee", true, dudes_num[j] * 2, dudes[j], j); + dudes_ac[j] = 30; + if ((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (dudes_num[j] > 1)) { + dudes_hp[j] = 300; + } + men += dudes_num[j]; + dudes_dr[j] = 0.75; + } + + if (dudes[j] == "Fallen") { + scr_en_weapon("Bolt Pistol", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 30; + dudes_hp[j] = 120; + men += dudes_num[j]; + dudes_dr[j] = 0.5; + } + + if (dudes[j] == "Chaos Lord") { + scr_en_weapon("Plasma Pistol", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 30; + dudes_hp[j] = 150; + dudes_dr[j] = 0.5; + men += dudes_num[j]; + } + if (dudes[j] == "Chaos Sorcerer") { + scr_en_weapon("Plasma Pistol", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Force Staff", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 30; + dudes_hp[j] = 100; + dudes_dr[j] = 0.5; + men += dudes_num[j]; + } + if (dudes[j] == "Warpsmith") { + scr_en_weapon("Chainfist", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Meltagun", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Flamer", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 30; + dudes_hp[j] = 100; + dudes_dr[j] = 0.5; + men += dudes_num[j]; + } + + if (dudes[j] == "Chaos Terminator") { + scr_en_weapon("Power Fist", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Bolter", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Combi-Flamer", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 40; + dudes_hp[j] = 100; + men += dudes_num[j]; + dudes_dr[j] = 0.5; + } + if (dudes[j] == "Venerable Chaos Terminator") { + scr_en_weapon("Power Fist", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Bolter", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Combi-Flamer", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 40; + dudes_hp[j] = 120; + men += dudes_num[j]; + dudes_dr[j] = 0.4; + } + if (dudes[j] == "World Eaters Terminator") { + scr_en_weapon("Power Fist", true, dudes_num[j] * 2, dudes[j], j); + scr_en_weapon("Meltagun", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 40; + dudes_hp[j] = 120; + men += dudes_num[j]; + dudes_dr[j] = 0.4; + } + if (dudes[j] == "Obliterator") { + scr_en_weapon("Power Fist", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Obliterator Weapon", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 40; + dudes_hp[j] = 200; + dudes_dr[j] = 0.5; + men += dudes_num[j]; + } + if (dudes[j] == "Chaos Chosen") { + scr_en_weapon("Meltagun", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Chainsword", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 20; + dudes_hp[j] = 125; + dudes_dr[j] = 0.85; + men += dudes_num[j]; + } + if (dudes[j] == "Venerable Chaos Chosen") { + scr_en_weapon("Meltagun", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Chainsword", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 20; + dudes_hp[j] = 125; + men += dudes_num[j]; + dudes_dr[j] = 0.75; + } + + if (dudes[j] == "Possessed") { + scr_en_weapon("Possessed Claws", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 17; + dudes_hp[j] = 150; + dudes_dr[j] = 0.5; + men += dudes_num[j]; + } + if (dudes[j] == "Chaos Space Marine") { + scr_en_weapon("Bolter", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Chainsword", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 20; + dudes_hp[j] = 100; + dudes_dr[j] = 0.9; + men += dudes_num[j]; + } + if (dudes[j] == "Havoc") { + scr_en_weapon("Missile Launcher", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 20; + dudes_hp[j] = 100; + dudes_dr[j] = 0.9; + men += dudes_num[j]; + } + if (dudes[j] == "Raptor") { + scr_en_weapon("Chainsword", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Bolt Pistol", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 20; + dudes_hp[j] = 100; + dudes_dr[j] = 0.75; + dudes_special[j] = "Jump Pack"; + men += dudes_num[j]; + } + + if (dudes[j] == "World Eater") { + scr_en_weapon("Bolter", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Chainaxe", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 20; + dudes_hp[j] = 100; + dudes_dr[j] = 0.75; + men += dudes_num[j]; + } + if (dudes[j] == "World Eaters Veteran") { + scr_en_weapon("Combi-Flamer", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Chainaxe", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 20; + dudes_hp[j] = 100; + dudes_dr[j] = 0.7; + men += dudes_num[j]; + } + + if (dudes[j] == "Khorne Berzerker") { + scr_en_weapon("Chainaxe", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Bolt Pistol", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 20; + dudes_hp[j] = 100; + dudes_dr[j] = 0.65; + men += dudes_num[j]; + } + if (dudes[j] == "Plague Marine") { + scr_en_weapon("Bolter", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Poison Chainsword", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 20; + dudes_hp[j] = 150; + dudes_dr[j] = 0.5; + men += dudes_num[j]; + } + if (dudes[j] == "Noise Marine") { + scr_en_weapon("Sonic Blaster", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 20; + dudes_hp[j] = 100; + dudes_dr[j] = 0.75; + men += dudes_num[j]; + } + if (dudes[j] == "Rubric Marine") { + scr_en_weapon("Rubric Bolter", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 20; + dudes_hp[j] = 125; + dudes_dr[j] = 0.65; + men += dudes_num[j]; + } + if (dudes[j] == "Rubric Sorcerer") { + scr_en_weapon("Witchfire", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Force Staff", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 20; + dudes_hp[j] = 150; + dudes_dr[j] = 0.5; + men += dudes_num[j]; + } + if (dudes[j] == "Cultist") { + scr_en_weapon("Autogun", true, dudes_num[j], dudes[j], j); + scr_en_weapon("melee0.5", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 5; + dudes_hp[j] = 35; + men += dudes_num[j]; + } + if (dudes[j] == "Hellbrute") { + scr_en_weapon("Power Fist", false, dudes_num[j], dudes[j], j); + scr_en_weapon("Meltagun", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 40; + dudes_hp[j] = 300; + dudes_dr[j] = 0.5; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + if (dudes[j] == "Rhino") { + scr_en_weapon("Storm Bolter", false, dudes_num[j] * 2, dudes[j], j); + dudes_ac[j] = 40; + dudes_hp[j] = 200; + dudes_dr[j] = 0.75; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + if (dudes[j] == "Predator") { + scr_en_weapon("Lascannon", false, dudes_num[j] * 2, dudes[j], j); + scr_en_weapon("Twin Linked Lascannon", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 45; + dudes_hp[j] = 350; + dudes_dr[j] = 0.5; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + if (dudes[j] == "Vindicator") { + scr_en_weapon("Demolisher Cannon", false, dudes_num[j], dudes[j], j); + scr_en_weapon("Havoc Launcher", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 45; + dudes_hp[j] = 300; + dudes_dr[j] = 0.5; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + if (dudes[j] == "Land Raider") { + scr_en_weapon("Twin Linked Heavy Bolters", false, dudes_num[j], dudes[j], j); + scr_en_weapon("Twin Linked Lascannon", false, dudes_num[j] * 2, dudes[j], j); + dudes_ac[j] = 50; + dudes_hp[j] = 400; + dudes_dr[j] = 0.25; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + if (dudes[j] == "Heldrake") { + scr_en_weapon("Baleflame", false, dudes_num[j] * 5, dudes[j], j); + dudes_ac[j] = 50; + dudes_hp[j] = 400; + dudes_dr[j] = 0.25; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + if (dudes[j] == "Defiler") { + scr_en_weapon("Defiler Claws", false, dudes_num[j], dudes[j], j); + scr_en_weapon("Battle Cannon", false, dudes_num[j], dudes[j], j); + scr_en_weapon("Reaper Autocannon", false, dudes_num[j], dudes[j], j); + scr_en_weapon("Flamer", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 40; + dudes_hp[j] = 300; + dudes_dr[j] = 0.5; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + + if (dudes[j] == "Arch Heretic") { + scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Plasma Pistol", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 40; + dudes_dr[j] = 0.75; + men += dudes_num[j]; + } + if (dudes[j] == "Cultist Elite") { + scr_en_weapon("Lasgun", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Chainaxe", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 40; + dudes_dr[j] = 0.9; + men += dudes_num[j]; + } + if (dudes[j] == "Mutant") { + scr_en_weapon("Flesh Hooks", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 0; + dudes_hp[j] = 30; + men += dudes_num[j]; + } + if (dudes[j] == "Daemonhost") { + scr_en_weapon("Daemonhost Claws", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Daemonhost_Powers", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 300; + dudes_dr[j] = 0.5; + medi += dudes_num[j]; + } + if (dudes[j] == "Possessed") { + scr_en_weapon("Possessed Claws", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 100; + dudes_dr[j] = 0.75; + men += dudes_num[j]; + } + + /* + if (dudes[j]="Greater Daemon of Khorne"){scr_en_weapon("Khorne Demon Melee",true,dudes_num[j],dudes[j],j);dudes_ac[j]=10;dudes_hp[j]=300;dudes_dr[j]=0.25;medi+=dudes_num[j];} + if (dudes[j]="Greater Daemon of Slaanesh"){scr_en_weapon("Demon Melee",true,dudes_num[j],dudes[j],j);scr_en_weapon("Lash Whip",true,dudes_num[j],dudes[j],j);dudes_ac[j]=10;dudes_hp[j]=250;dudes_dr[j]=0.35;medi+=dudes_num[j];} + if (dudes[j]="Greater Daemon of Nurgle"){scr_en_weapon("Demon Melee",true,dudes_num[j],dudes[j],j);scr_en_weapon("Nurgle Vomit",true,dudes_num[j],dudes[j],j);dudes_ac[j]=15;dudes_hp[j]=400;dudes_dr[j]=0.25;medi+=dudes_num[j];} + if (dudes[j]="Greater Daemon of Tzeentch"){scr_en_weapon("Demon Melee",true,dudes_num[j],dudes[j],j);scr_en_weapon("Witchfire",true,dudes_num[j],dudes[j],j);dudes_ac[j]=10;dudes_hp[j]=250;dudes_dr[j]=0.35;medi+=dudes_num[j];} + */ + + if (dudes[j] == "Technical") { + scr_en_weapon("Autogun", false, dudes_num[j] * 2, dudes[j], j); + scr_en_weapon("Heavy Bolter", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 10; + dudes_hp[j] = 100; + dudes_dr[j] = 0.75; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + + if (dudes[j] == "Chaos Leman Russ") { + scr_en_weapon("Battle Cannon", false, dudes_num[j], dudes[j], j); + scr_en_weapon("Heavy Bolter", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 45; + dudes_hp[j] = 250; + dudes_dr[j] = 0.25; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + if (dudes[j] == "Chaos Basilisk") { + scr_en_weapon("Earthshaker Cannon", false, dudes_num[j], dudes[j], j); + scr_en_weapon("Heavy Bolter", false, dudes_num[j], dudes[j], j); + dudes_ac[j] = 20; + dudes_hp[j] = 150; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + + // if (obj_ncombat.enemy=11) and (dudes_vehicle[j]=0) and (dudes[j]!="Cultist"){dudes_dr[j]=0.8;} + // if (obj_ncombat.enemy=11) and (dudes_vehicle[j]=1){dudes_dr[j]=0.75;} + + // if (dudes[j]!="") and (dudes_num[j]=0){dudes[j]="";dudes_num[j]=0;} + if ((dudes[j] != "") && (dudes_hp[j] == 0)) { + dudes[j] = ""; + dudes_num[j] = 0; + } + } + + /* */ + } + } + __b__ = action_if_variable(obj_ncombat.enemy, 13, 0); + if (__b__) { + repeat (20) { + j += 1; + + if (dudes[j] == "Necron Overlord") { + scr_en_weapon("Staff of Light", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Staff of Light Shooting", true, dudes_num[j], dudes[j], j); + if ((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (dudes_num[j] > 1)) { + dudes_ac[j] = 12; + dudes_hp[j] = 300; + dudes_dr[j] = 0.5; + } + men += dudes_num[j]; + } + if (dudes[j] == "Lychguard") { + scr_en_weapon("Warscythe", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 12; + dudes_hp[j] = 100; + dudes_dr[j] = 0.75; + men += dudes_num[j]; + } + + if (dudes[j] == "Flayed One") { + scr_en_weapon("Melee5", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 75; + dudes_dr[j] = 0.9; + men += dudes_num[j]; + } + if (dudes[j] == "Necron Warrior") { + scr_en_weapon("Gauss Flayer", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Melee3", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 75; + dudes_dr[j] = 0.9; + men += dudes_num[j]; + } + if (dudes[j] == "Necron Immortal") { + scr_en_weapon("Gauss Blaster", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Melee3", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 75; + dudes_dr[j] = 0.85; + men += dudes_num[j]; + } + + if (dudes[j] == "Necron Wraith") { + scr_en_weapon("Wraith Claws", true, dudes_num[j], dudes[j], j); + if ((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (dudes_num[j] > 1)) { + dudes_ac[j] = 10; + dudes_hp[j] = 200; + } + men += dudes_num[j]; + dudes_dr[j] = 0.75; + } + if (dudes[j] == "Necron Destroyer") { + scr_en_weapon("Gauss Cannon", true, dudes_num[j], dudes[j], j); + scr_en_weapon("Melee3", true, dudes_num[j], dudes[j], j); + dudes_ac[j] = 25; + dudes_hp[j] = 175; + dudes_dr[j] = 0.5; + men += dudes_num[j]; + } + + if (dudes[j] == "Tomb Stalker") { + scr_en_weapon("Gauss Particle Cannon", false, dudes_num[j] * 1, dudes[j], j); + scr_en_weapon("Overcharged Gauss Cannon", false, dudes_num[j] * 2, dudes[j], j); + scr_en_weapon("Claws", false, dudes_num[j] * 5, dudes[j], j); + if ((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (dudes_num[j] > 1)) { + dudes_ac[j] = 40; + dudes_hp[j] = 600; + } + dudes_dr[j] = 0.5; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + if (dudes[j] == "Canoptek Spyder") { + scr_en_weapon("Claws", false, dudes_num[j] * 2, dudes[j], j); + if ((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (dudes_num[j] > 1)) { + dudes_ac[j] = 30; + dudes_hp[j] = 300; + } + dudes_dr[j] = 0.75; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + if (dudes[j] == "Canoptek Scarab") { + scr_en_weapon("Melee3", false, dudes_num[j] * 2, dudes[j], j); + dudes_ac[j] = 8; + dudes_hp[j] = 30; + dudes_dr[j] = 0.75; + men += dudes_num[j]; + dudes_vehicle[j] = 0; + } + if (dudes[j] == "Necron Monolith") { + scr_en_weapon("Gauss Flux Arc", false, dudes_num[j] * 4, dudes[j], j); + scr_en_weapon("Particle Whip", false, dudes_num[j] * 1, dudes[j], j); + dudes_ac[j] = 50; + dudes_hp[j] = 500; + dudes_dr[j] = 0.25; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + if (dudes[j] == "Doomsday Arc") { + scr_en_weapon("Gauss Flayer Array", false, dudes_num[j] * 2, dudes[j], j); + scr_en_weapon("Doomsday Cannon", false, dudes_num[j] * 1, dudes[j], j); + dudes_ac[j] = 40; + dudes_hp[j] = 350; + dudes_dr[j] = 0.5; + veh += dudes_num[j]; + dudes_vehicle[j] = 1; + } + + // if (dudes_dr[j]>0.8) then dudes_dr[j]=0.8; + } + + /* */ + } + /* + if (obj_ncombat.battle_special = "ruins") or(obj_ncombat.battle_special = "ruins_eldar") { + var i; + i = 0; + repeat(20) { + i += 1; + if (dudes_vehicle[i] > 0) and(dudes_num[i] > 0) { + obj_ncombat.enemy_forces -= dudes_num[i]; + obj_ncombat.enemy_max -= dudes_num[i]; + dudes[i] = ""; + dudes_special[i] = ""; + dudes_num[i] = 0; + dudes_ac[i] = 0; + dudes_hp[i] = 0; + dudes_dr[i] = 1; + dudes_vehicle[i] = 0; + } + } + } + */ + + if (men + veh + medi <= 0) { + instance_destroy(id); + exit; + } + + if (obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) { + obj_ncombat.enemy_forces += self.men + self.veh + self.medi; + } + engaged = collision_point(x + 12, y, obj_pnunit, 0, 1) || collision_point(x - 12, y, obj_pnunit, 0, 1); + + if (neww == 1) { + neww = 0; + } + + /* */ + /* */ +} diff --git a/scripts/scr_enunit_scripts/scr_enunit_scripts.yy b/scripts/scr_enunit_scripts/scr_enunit_scripts.yy new file mode 100644 index 0000000000..474d1aaa33 --- /dev/null +++ b/scripts/scr_enunit_scripts/scr_enunit_scripts.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"scr_enunit_scripts", + "isCompatibility":false, + "isDnD":false, + "name":"scr_enunit_scripts", + "parent":{ + "name":"Combat", + "path":"folders/Scripts/Combat.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/scr_flavor/scr_flavor.gml b/scripts/scr_flavor/scr_flavor.gml index 382745efd8..86327285a4 100644 --- a/scripts/scr_flavor/scr_flavor.gml +++ b/scripts/scr_flavor/scr_flavor.gml @@ -4,24 +4,24 @@ function queue_enemy_force_health() { var _text = ""; if (enemy_forces > 0) { - _text = $"Enemy Forces at {string(max(1, round((enemy_forces / enemy_max) * 100)))}%"; + _text = $"The enemy forces are at {string(max(1, round((enemy_forces / enemy_max) * 100)))}% strength!"; } else { - _text = "Enemy Forces Defeated"; + _text = "The enemy forces are defeated!"; } - queue_battlelog_message(_text, 999, "yellow"); + queue_battlelog_message(_text, -50, "yellow"); } function queue_player_force_health() { var _text = ""; if (player_forces > 0) { - _text = $"${global.chapter_name} at {string(round((player_forces / player_max) * 100))}%"; + _text = $"The {global.chapter_name} are at {string(round((player_forces / player_max) * 100))}% strength!"; } else { - _text = $"${global.chapter_name} Defeated"; + _text = $"The {global.chapter_name} are defeated!"; } - queue_battlelog_message(_text, 999, "yellow"); + queue_battlelog_message(_text, -50, "yellow"); } @@ -33,6 +33,7 @@ function display_message_queue() { messages_shown += 1; scr_newtext(); } + messages_shown = 0; ds_priority_clear(messages_queue); } @@ -105,7 +106,7 @@ function scr_flavor(_weapon_stack, _target_object, _target_i, casulties) { if (weapon_data.has_tag("bolt")) { flavoured = true; if (!character_shot) { - if (obj_ncombat.bolter_drilling == 1) { + if (scr_has_adv("Bolter Drilling")) { attack_message += "With perfect accuracy "; } if (number_of_shots < 200) { @@ -429,10 +430,10 @@ function scr_flavor(_weapon_stack, _target_object, _target_i, casulties) { leader_message = string_replace(leader_message, "a " + target_name, target_name); leader_message = string_replace(leader_message, "the " + target_name, target_name); leader_message = string_replace(leader_message, target_name + " ranks , inflicting {casulties}", target_name); - if (enemy = 5) then leader_message = string_replace(leader_message, "it", "her"); - if (enemy = 6) and (obj_controller.faction_gender[6] = 1) then leader_message = string_replace(leader_message, "it", "him"); - if (enemy = 6) and (obj_controller.faction_gender[6] = 2) then leader_message = string_replace(leader_message, "it", "her"); - if (enemy != 6) and (enemy != 5) then leader_message = string_replace(leader_message, "it", "him"); + if (obj_ncombat.enemy = 5) then leader_message = string_replace(leader_message, "it", "her"); + if (obj_ncombat.enemy = 6) and (obj_controller.faction_gender[6] = 1) then leader_message = string_replace(leader_message, "it", "him"); + if (obj_ncombat.enemy = 6) and (obj_controller.faction_gender[6] = 2) then leader_message = string_replace(leader_message, "it", "her"); + if (obj_ncombat.enemy != 6) and (obj_ncombat.enemy != 5) then leader_message = string_replace(leader_message, "it", "him"); message_priority = 5; } } diff --git a/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml b/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml new file mode 100644 index 0000000000..888399115f --- /dev/null +++ b/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml @@ -0,0 +1,5985 @@ +// alarm_0 +/// @mixin +function ncombat_enemy_stacks_init() { + // Sets up the number of enemies based on the threath level, enemy type and specific story events + + try { + if (battle_special == "cs_meeting_battle5") { + alpha_strike = 1; + } + + instance_activate_object(obj_enunit); + + // show_message("Leader?: "+string(leader)); + + // if (enemy=1) then show_message("exiting obj_ncombat_Alarm 0_2 due to enemy=1"); + if (enemy == 1) { + instance_activate_object(obj_enunit); + exit; + } + + if ((battle_special == "study2a") || (battle_special == "study2b")) { + ally = 3; + ally_forces = 1; + } + instance_activate_object(obj_pnunit); + if (!instance_exists(obj_pnunit)) { + exit; + } + xxx = instance_nearest(1000, 240, obj_pnunit); + xxx = xxx.x + 80; + + if ((string_count("spyrer", battle_special) > 0) || (string_count("fallen", battle_special) > 0) || (string_count("mech", battle_special) > 0) || (battle_special == "space_hulk") || (battle_special == "study2a") || (battle_special == "study2b")) { + fortified = 0; + } + + var i = 0, u; + i = xxx / 10; + + if ((fortified > 1) && (enemy + threat != 17)) { + u = instance_create(0, 0, obj_nfort); + u.image_speed = 0; + u.image_alpha = 0.5; + + if (fortified == 2) { + u.ac[1] = 30; + u.hp[1] = 400; + } + if (fortified == 3) { + u.ac[1] = 40; + u.hp[1] = 800; + } + if (fortified == 4) { + u.ac[1] = 40; + u.hp[1] = 1250; + } + if (fortified == 5) { + u.ac[1] = 40; + u.hp[1] = 1500; + } + + if ((siege == 1) && (fortified > 0) && (defending == true)) { + global_attack = global_attack * 1.1; + u.hp[1] = round(u.hp[1] * 1.2); + } + + u.maxhp[1] = u.hp[1]; + } + + for (var j = 0; j < 10; j++) { + i -= 1; + u = instance_create(i * 10, 240, obj_enunit); + u.column = i - ((xxx / 10) - 10); + } + // *** Enemy Forces Special Event *** + // * Malcadon Spyrer * + if (string_count("spyrer", battle_special) > 0) { + fortified = 0; + with (obj_enunit) { + instance_destroy(); + } + u = instance_create(10, 240, obj_enunit); + enemy_dudes = "1"; + u.dudes[1] = "Malcadon Spyrer"; + u.dudes_num[1] = 1; + u.dudes_num[1] = 1; + enemies[1] = 1; + u.flank = 1; + } + // * Small Fallen Group * + if (battle_special == "fallen1") { + fortified = 0; + with (obj_enunit) { + instance_destroy(); + } + u = instance_create(80, 240, obj_enunit); + enemy_dudes = "1"; + u.dudes[1] = "Fallen"; + u.dudes_num[1] = 1; + enemies[1] = 1; + } + // * Large Fallen Group * + if (battle_special == "fallen2") { + fortified = 0; + with (obj_enunit) { + instance_destroy(); + } + u = instance_create(80, 240, obj_enunit); + enemy_dudes = "1"; + u.dudes[1] = "Fallen"; + u.dudes_num[1] = choose(1, 1, 2, 2, 3); + enemies[1] = u.dudes_num[1]; + } + // * Praetorian Servitor Group * + if (string_count("mech", battle_special) > 0) { + fortified = 0; + with (obj_enunit) { + instance_destroy(); + } + u = instance_create(xxx + 10, 240, obj_enunit); + enemy_dudes = ""; + u.dudes[1] = "Thallax"; + u.dudes_num[1] = 4; + enemies[1] = 4; + u.dudes[2] = "Praetorian Servitor"; + u.dudes_num[2] = 6; + enemies[2] = 6; + } + // * Greater Daemon * + if (battle_special == "ship_demon") { + fortified = 0; + with (obj_enunit) { + instance_destroy(); + } + enemy = 10; + u = instance_create(10, 240, obj_enunit); + enemy_dudes = "1"; + u.dudes[1] = choose("Greater Daemon of Khorne", "Greater Daemon of Slaanesh", "Greater Daemon of Tzeentch", "Greater Daemon of Nurgle"); + u.dudes_num[1] = 1; + enemies[1] = 1; + u.flank = 1; + u.engaged = 1; + with (instance_nearest(x + 1000, 240, obj_pnunit)) { + engaged = 1; + } + } + // * Necron Wraith Group * + if (battle_special == "wraith_attack") { + fortified = 0; + with (obj_enunit) { + instance_destroy(); + } + u = instance_create(instance_nearest(x + 1000, 240, obj_pnunit).x + 10, 240, obj_enunit); + enemy_dudes = "2"; + u.dudes[1] = "Necron Wraith"; + u.dudes_num[1] = 1; + enemies[1] = 1; + u.dudes[2] = "Necron Wraith"; + u.dudes_num[2] = 1; + enemies[2] = 1; + u.engaged = 1; // u.flank=1; + with (instance_nearest(x + 1000, 240, obj_pnunit)) { + engaged = 1; + } + } + // * Canoptek Spyder Group * + if (battle_special == "spyder_attack") { + fortified = 0; + with (obj_enunit) { + instance_destroy(); + } + u = instance_create(instance_nearest(x + 1000, 240, obj_pnunit).x + 10, 240, obj_enunit); + enemy_dudes = "21"; + u.dudes[1] = "Canoptek Spyder"; + u.dudes_num[1] = 1; + enemies[1] = u.dudes[1]; + u.dudes[2] = "Canoptek Scarab"; + u.dudes_num[2] = 20; + enemies[2] = u.dudes[2]; + u.engaged = 1; // u.flank=1; + with (instance_nearest(x + 1000, 240, obj_pnunit)) { + engaged = 1; + } + } + // * Tomb Stalker Group * + if (battle_special == "stalker_attack") { + fortified = 0; + with (obj_enunit) { + instance_destroy(); + } + u = instance_create(instance_nearest(x + 1000, 240, obj_pnunit).x + 10, 240, obj_enunit); + enemy_dudes = "1"; + u.dudes[1] = "Tomb Stalker"; + u.dudes_num[1] = 1; + enemies[1] = 1; + u.engaged = 1; // u.flank=1; + with (instance_nearest(x + 1000, 240, obj_pnunit)) { + engaged = 1; + } + } + // * Chaos Space Marine Elite Group * + if ((battle_special == "cs_meeting_battle5") || (battle_special == "cs_meeting_battle6")) { + fortified = 0; + with (obj_enunit) { + instance_destroy(); + } + u = instance_create(xxx + 20, 240, obj_enunit); + enemy_dudes = ""; + u.dudes[1] = "Leader"; + u.dudes_num[1] = 1; + enemies[1] = 1; + u.dudes[2] = "Greater Daemon of Tzeentch"; + u.dudes_num[2] = 1; + enemies[2] = 1; + u.dudes[3] = "Greater Daemon of Slaanesh"; + u.dudes_num[3] = 1; + enemies[3] = 1; + u = instance_create(xxx + 10, 240, obj_enunit); + enemy_dudes = ""; + u.dudes[1] = "Venerable Chaos Terminator"; + u.dudes_num[1] = 20; + enemies[1] = 20; + } + // * Chaos Space Marine Elite Company * + if (battle_special == "cs_meeting_battle10") { + fortified = 0; + with (obj_enunit) { + instance_destroy(); + } + u = instance_create(xxx + 20, 240, obj_enunit); + enemy_dudes = ""; + u.dudes[1] = "Greater Daemon of Tzeentch"; + u.dudes_num[1] = 1; + enemies[1] = 1; + u.dudes[2] = "Greater Daemon of Slaanesh"; + u.dudes_num[2] = 1; + enemies[2] = 1; + u.dudes[3] = "Venerable Chaos Terminator"; + u.dudes_num[3] = 20; + enemies[3] = 20; + u = instance_create(xxx + 10, 240, obj_enunit); + enemy_dudes = ""; + u.dudes[1] = "Venerable Chaos Chosen"; + u.dudes_num[1] = 40; + enemies[1] = 40; + u.dudes[2] = "Helbrute"; + u.dudes_num[2] = 3; + enemies[2] = 3; + } + // * Tomb world attack enemy setup * + if (battle_special == "wake1_attack") { + enemy = 13; + threat = 2; + } + if (battle_special == "wake2_attack") { + enemy = 13; + threat = 3; + } + if (battle_special == "wake3_attack") { + enemy = 13; + threat = 5; + } + // * Tomb world study attack enemy setup * + if (battle_special == "study2a") { + enemy = 13; + threat = 2; + } + if (battle_special == "study2b") { + enemy = 13; + threat = 3; + } + // ** Space Hulk Forces ** + if (battle_special == "space_hulk") { + var make, modi; + // show_message("space hulk battle, player forces: "+string(player_forces)); + with (obj_enunit) { + instance_destroy(); + } + // * Ork Space Hulk * + if (enemy == 7) { + modi = random_range(0.80, 1.20) + 1; + make = round(max(3, player_starting_dudes * modi)); + + u = instance_create(instance_nearest(x - 1000, 240, obj_pnunit).x - 10, 240, obj_enunit); + u.dudes[1] = "Meganob"; + u.dudes_num[1] = make; + enemies[1] = u.dudes[1]; + u.engaged = 1; + u.flank = 1; + with (instance_nearest(x - 1000, 240, obj_pnunit)) { + engaged = 1; + } + + u = instance_create(instance_nearest(x + 1000, 240, obj_pnunit).x + 20, 240, obj_enunit); + u.dudes[1] = "Slugga Boy"; + u.dudes_num[1] = make; + enemies[1] = u.dudes[1]; + + u.dudes[2] = "Shoota Boy"; + u.dudes_num[2] = make; + enemies[2] = u.dudes[2]; + + hulk_forces = make * 3; + } + // * Genestealer Space Hulk * + if (enemy == 9) { + modi = random_range(0.80, 1.20) + 1; + make = round(max(3, player_starting_dudes * modi)) * 2; + + u = instance_create(instance_nearest(x - 1000, 240, obj_pnunit).x - 10, 240, obj_enunit); + u.dudes[1] = "Genestealer"; + u.dudes_num[1] = round(make / 3); + enemies[1] = u.dudes[1]; + u.engaged = 1; + u.flank = 1; + with (instance_nearest(x - 1000, 240, obj_pnunit)) { + engaged = 1; + } + + u = instance_create(instance_nearest(x + 1000, 240, obj_pnunit).x + 10, 240, obj_enunit); + u.dudes[1] = "Genestealer"; + u.dudes_num[1] = round(make / 3); + enemies[1] = u.dudes[1]; + + u = instance_create(instance_nearest(x + 1000, 240, obj_pnunit).x + 50, 240, obj_enunit); + u.dudes[1] = "Genestealer"; + u.dudes_num[1] = make - (round(make / 3) * 2); + enemies[1] = u.dudes[1]; + + hulk_forces = make; + } + // * CSM Space Hulk * + if (enemy == 10) { + var make, modi; + modi = random_range(0.80, 1.20) + 1; + make = round(max(3, player_starting_dudes * modi)); + + u = instance_create(instance_nearest(x - 1000, 240, obj_pnunit).x - 10, 240, obj_enunit); + u.dudes[1] = "Chaos Terminator"; + u.dudes_num[1] = round(make * 0.25); + enemies[1] = u.dudes[1]; + u.engaged = 1; + u.flank = 1; + with (instance_nearest(x - 1000, 240, obj_pnunit)) { + engaged = 1; + } + + u = instance_create(instance_nearest(x + 1000, 240, obj_pnunit).x + 10, 240, obj_enunit); + u.dudes[1] = "Chaos Space Marine"; + u.dudes_num[1] = round(make * 0.25); + enemies[1] = u.dudes[1]; + + u = instance_create(instance_nearest(x + 1000, 240, obj_pnunit).x + 50, 240, obj_enunit); + u.dudes[1] = "Cultist"; + u.dudes_num[1] = round(make * 0.5); + enemies[1] = u.dudes[1]; + + hulk_forces = make; + } + + // show_message(string(instance_number(obj_enunit))+"x enemy blocks"); + instance_activate_object(obj_enunit); + exit; + } + // ** Story Reveal of a Chaos World ** + if (battle_special == "WL10_reveal") { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "3300"; + + u.dudes[1] = "Leader"; + u.dudes_num[1] = 1; + + u.dudes[2] = "Greater Daemon of Tzeentch"; + u.dudes_num[2] = 1; + + u.dudes[3] = "Greater Daemon of Slaanesh"; + u.dudes_num[3] = 1; + + u.dudes[4] = "Venerable Chaos Terminator"; + u.dudes_num[4] = 20; + + u.dudes[5] = "Venerable Chaos Chosen"; + u.dudes_num[5] = 50; + // u.dudes[4]="Chaos Basilisk";u.dudes_num[4]=18; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 10, 240, obj_enunit); + // u.dudes[1]="Chaos Leman Russ";u.dudes_num[1]=40; + u.dudes[1] = "Chaos Sorcerer"; + u.dudes_num[1] = 4; + u.dudes[2] = "Chaos Space Marine"; + u.dudes_num[2] = 100; + u.dudes[3] = "Havoc"; + u.dudes_num[3] = 20; + u.dudes[4] = "Raptor"; + u.dudes_num[4] = 20; + u.dudes[5] = "Bloodletter"; + u.dudes_num[5] = 30; + // u.dudes[3]="Vindicator";u.dudes_num[3]=10; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Rhino"; + u.dudes_num[1] = 30; + u.dudes[2] = "Defiler"; + u.dudes_num[2] = 4; + u.dudes[3] = "Heldrake"; + u.dudes_num[3] = 2; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 30, 240, obj_enunit); + u.dudes[1] = "Cultist Elite"; + u.dudes_num[1] = 1500; + // u.dudes[2]="Cultist Elite";u.dudes_num[2]=1500; + u.dudes[2] = "Helbrute"; + u.dudes_num[2] = 3; + // u.dudes[3]="Predator";u.dudes_num[3]=6; + // u.dudes[4]="Vindicator";u.dudes_num[4]=3; + // u.dudes[5]="Land Raider";u.dudes_num[5]=2; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 40, 240, obj_enunit); + // u.dudes[1]="Mutant";u.dudes_num[1]=8000; + u.dudes[1] = "Cultist"; + u.dudes_num[1] = 1500; + u.dudes[2] = "Helbrute"; + u.dudes_num[2] = 3; + instance_deactivate_object(u); + } + // ** Story late reveal of a Chaos World ** + if (battle_special == "WL10_later") { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "200"; + + u.dudes[1] = "Leader"; + u.dudes_num[1] = 1; + u.dudes[2] = "Greater Daemon of Tzeentch"; + u.dudes_num[2] = 1; + u.dudes[3] = "Greater Daemon of Slaanesh"; + u.dudes_num[3] = 1; + u.dudes[4] = "Venerable Chaos Terminator"; + u.dudes_num[4] = 20; + u.dudes[5] = "Venerable Chaos Chosen"; + u.dudes_num[5] = 50; + // u.dudes[4]="Chaos Basilisk";u.dudes_num[4]=18; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 10, 240, obj_enunit); + // u.dudes[1]="Chaos Leman Russ";u.dudes_num[1]=40; + u.dudes[1] = "Chaos Sorcerer"; + u.dudes_num[1] = 2; + u.dudes[1] = "Cultist"; + u.dudes_num[1] = 100; + u.dudes[2] = "Helbrute"; + u.dudes_num[2] = 1; + instance_deactivate_object(u); + } + // * Imperial Guard Force * + if (enemy == 2) { + guard_total = threat; + guard_score = 6; + + /*if (guard_total>=15000000) then guard_score=6; + if (guard_total<15000000) and (guard_total>=6000000) then guard_score=5; + if (guard_total<6000000) and (guard_total>=1000000) then guard_score=4; + if (guard_total<1000000) and (guard_total>=50000) then guard_score=3; + if (guard_total<50000) and (guard_total>=500) then guard_score=2; + if (guard_total<500) then guard_score=1;*/ + + // guard_effective=floor(guard_total)/8; + + var f = 0, guar = threat / 10; + + // Guardsmen + u = instance_create(xxx, 240, obj_enunit); + enemy_dudes = threat; + u.dudes[1] = "Imperial Guardsman"; + u.dudes_num[1] = round(guar / 5); + enemies[1] = u.dudes[1]; + instance_deactivate_object(u); + + f = round(threat / 20000); + // Leman Russ D and Ogryn + if (f > 0) { + u = instance_create(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Leman Russ Demolisher"; + u.dudes_num[1] = f; + enemies[1] = u.dudes[1]; + f = max(10, round(threat / 6650)); + u.dudes[2] = "Ogryn"; + u.dudes_num[2] = f; + enemies[2] = u.dudes[2]; + instance_deactivate_object(u); + } + + // Chimera and Leman Russ + f = max(1, round(threat / 10000)); + u = instance_create(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Leman Russ Battle Tank"; + u.dudes_num[1] = f; + enemies[1] = u.dudes[1]; + f = max(1, round(threat / 20000)); + u.dudes[2] = "Chimera"; + u.dudes_num[2] = f; + enemies[2] = u.dudes[2]; + instance_deactivate_object(u); + + // More Guard + u = instance_create(xxx + 30, 240, obj_enunit); + u.dudes[1] = "Imperial Guardsman"; + u.dudes_num[1] = round(guar / 5); + enemies[1] = u.dudes[1]; + + u = instance_create(xxx + 40, 240, obj_enunit); + u.dudes[1] = "Imperial Guardsman"; + u.dudes_num[1] = round(guar / 5); + enemies[1] = u.dudes[1]; + + u = instance_create(xxx + 50, 240, obj_enunit); + u.dudes[1] = "Imperial Guardsman"; + u.dudes_num[1] = round(guar / 5); + enemies[1] = u.dudes[1]; + + u = instance_create(xxx + 60, 240, obj_enunit); + u.dudes[1] = "Imperial Guardsman"; + u.dudes_num[1] = round(guar / 5); + enemies[1] = u.dudes[1]; + + u = instance_create(xxx + 70, 240, obj_enunit); + f = round(threat / 50000); + + // Basilisk and Heavy Weapons + if (f > 0) { + u.dudes[1] = "Basilisk"; + u.dudes_num[1] = f; + enemies[1] = u.dudes[1]; + u.dudes[2] = "Heavy Weapons Team"; + u.dudes_num[2] = round(threat / 10000); + enemies[2] = u.dudes[2]; + } else { + // Heavy Weapons + u.dudes[1] = "Heavy Weapons Team"; + u.dudes_num[1] = round(threat / 10000); + enemies[1] = u.dudes[1]; + } + + f = round(threat / 40000); + // Vendetta + if (f > 0) { + u = instance_create(0, 240, obj_enunit); + u.dudes[1] = "Vendetta"; + u.dudes_num[1] = f; + u.flank = 1; + u.flyer = 1; + } + + /*u=instance_nearest(xxx,240,obj_enunit);enemy_dudes=threat; + u.dudes[1]="Imperial Guardsman";u.dudes_num[1]=floor(guard_effective*0.6);enemies[1]=u.dudes[1]; + u.dudes[2]="Heavy Weapons Team";u.dudes_num[2]=min(1000,floor(guard_effective*0.1));enemies[2]=u.dudes[2]; + if (threat>1){u.dudes[3]="Leman Russ Battle Tank";u.dudes_num[3]=min(1000,floor(guard_effective*0.1));enemies[3]=u.dudes[3];} + + u=instance_nearest(xxx,240+10,obj_enunit);enemy_dudes=threat; + u.dudes[1]="Imperial Guardsman";u.dudes_num[1]=floor(guard_effective*0.6);enemies[1]=u.dudes[1]; + u.dudes[2]="Heavy Weapons Team";u.dudes_num[2]=min(1000,floor(guard_effective*0.1));enemies[2]=u.dudes[2]; + if (threat>1){u.dudes[3]="Leman Russ Battle Tank";u.dudes_num[3]=min(1000,floor(guard_effective*0.1));enemies[3]=u.dudes[3];}*/ + } + + // ** Aeldar Force ** + if (enemy == 6) { + // Ranger Group + if (threat == 1) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "20"; + + u.dudes[1] = "Pathfinder"; + u.dudes_num[1] = 1; + enemies[1] = u.dudes[1]; + u.dudes[2] = "Ranger"; + u.dudes_num[2] = 10; + enemies[2] = u.dudes[2]; + u.dudes[3] = "Striking Scorpian"; + u.dudes_num[3] = 10; + enemies[3] = u.dudes[3]; + } + // Harlequin Group + if (threat == 1) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "9"; + + u.dudes[1] = "Athair"; + u.dudes_num[1] = 1; + enemies[1] = u.dudes[1]; + u.dudes[2] = "Warlock"; + u.dudes_num[2] = 2; + enemies[2] = u.dudes[2]; + u.dudes[3] = "Trouper"; + u.dudes_num[3] = 6; + enemies[3] = u.dudes[3]; + } + // Craftworld Small Group + if (threat == 1) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "24"; + + u.dudes[1] = "Warlock"; + u.dudes_num[1] = 1; + enemies[1] = u.dudes[1]; + enemies_num[1] = 1; + u.dudes[2] = choose("Howling Banshee", "Striking Scorpian"); + u.dudes_num[2] = 8; + enemies[2] = u.dudes[2]; + u.dudes[3] = "Dire Avenger"; + u.dudes_num[3] = 15; + enemies[3] = u.dudes[3]; + if (leader == 1) { + u.dudes[4] = "Leader"; + u.dudes_num[4] = 1; + enemies[4] = 1; + enemies_num[4] = 1; + if (obj_controller.faction_gender[6] == 2) { + u.dudes[2] = "Howling Banshee"; + } + if (obj_controller.faction_gender[6] == 2) { + u.dudes[2] = "Dark Reapers"; + } + } + } + // Craftworld Medium Group + if (threat == 2) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "100"; + + u.dudes[1] = "Dire Avenger"; + u.dudes_num[1] = 56; + u.dudes_special[1] = "shimmershield"; + u.dudes[2] = "Dire Avenger Exarch"; + u.dudes_num[2] = 4; + u.dudes_special[2] = "shimmershield"; + u.dudes[3] = "Autarch"; + u.dudes_num[3] = 1; + u.dudes[4] = "Farseer"; + u.dudes_num[4] = 1; + u.dudes_special[4] = "farseer_powers"; + u.dudes[5] = "Night Spinner"; + u.dudes_num[5] = 1; + // Spawn leader + if (leader == 1) { + u.dudes[4] = "Leader"; + u.dudes_num[4] = 1; + enemies[4] = 1; + enemies_num[4] = 1; + } + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Fire Dragon"; + u.dudes_num[1] = 7; + u.dudes[2] = "Fire Dragon Exarch"; + u.dudes_num[2] = 1; + u.dudes[3] = "Warp Spider"; + u.dudes_num[3] = 7; + u.dudes_special[3] = "warp_jump"; + u.dudes[4] = "Warp Spider Exarch"; + u.dudes_num[4] = 1; + u.dudes_special[4] = "warp_jump"; + u.dudes[5] = "Howling Banshee"; + u.dudes_num[5] = 9; + u.dudes_special[5] = "banshee_mask"; + u.dudes[6] = "Howling Banshee Exarch"; + u.dudes_num[6] = 1; + u.dudes_special[6] = "banshee_mask"; + u.dudes[7] = "Striking Scorpian"; + u.dudes_num[7] = 9; + u.dudes[8] = "Striking Scorpian Exarch"; + u.dudes_num[8] = 1; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Falcon"; + u.dudes_num[1] = 2; + } + // Craftworld Large Group + if (threat == 3) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "300"; + + u.dudes[1] = "Dire Avenger"; + u.dudes_num[1] = 140; + u.dudes_special[1] = "shimmershield"; + u.dudes[2] = "Dire Avenger Exarch"; + u.dudes_num[2] = 10; + u.dudes_special[2] = "shimmershield"; + u.dudes[3] = "Autarch"; + u.dudes_num[3] = 1; + u.dudes[4] = "Farseer"; + u.dudes_num[4] = 1; + u.dudes_special[4] = "farseer_powers"; + // Spawn Leader + if (leader == 1) { + u.dudes[4] = "Leader"; + u.dudes_num[4] = 1; + enemies[4] = 1; + enemies_num[4] = 1; + } + u.dudes[5] = "Fire Prism"; + u.dudes_num[5] = 3; + u.dudes[6] = "Avatar"; + u.dudes_num[6] = 1; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Fire Dragon"; + u.dudes_num[1] = 18; + u.dudes[2] = "Fire Dragon Exarch"; + u.dudes_num[2] = 2; + u.dudes[3] = "Warp Spider"; + u.dudes_num[3] = 18; + u.dudes_special[3] = "warp_jump"; + u.dudes[4] = "Warp Spider Exarch"; + u.dudes_num[4] = 2; + u.dudes_special[4] = "warp_jump"; + u.dudes[5] = "Howling Banshee"; + u.dudes_num[5] = 28; + u.dudes_special[5] = "banshee_mask"; + u.dudes[6] = "Howling Banshee Exarch"; + u.dudes_num[6] = 2; + u.dudes_special[6] = "banshee_mask"; + u.dudes[7] = "Striking Scorpian"; + u.dudes_num[7] = 19; + u.dudes[8] = "Striking Scorpian Exarch"; + u.dudes_num[8] = 1; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Falcon"; + u.dudes_num[1] = 5; + u.dudes[2] = "Vyper"; + u.dudes_num[2] = 12; + u.dudes[3] = "Wraithguard"; + u.dudes_num[3] = 30; + u.dudes[4] = "Wraithlord"; + u.dudes_num[4] = 2; + } + // Craftworld Small Army + if (threat == 4) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "1100"; + + u.dudes[1] = "Dire Avenger"; + u.dudes_num[1] = 280; + u.dudes_special[1] = "shimmershield"; + u.dudes[2] = "Dire Avenger Exarch"; + u.dudes_num[2] = 20; + u.dudes_special[2] = "shimmershield"; + u.dudes[3] = "Autarch"; + u.dudes_num[3] = 3; + u.dudes[4] = "Farseer"; + u.dudes_num[4] = 2; + u.dudes_special[4] = "farseer_powers"; + // Spawn Leader + if (leader == 1) { + u.dudes[4] = "Leader"; + u.dudes_num[4] = 1; + enemies[4] = 1; + enemies_num[4] = 1; + } + u.dudes[5] = "Fire Prism"; + u.dudes_num[5] = 3; + u.dudes[6] = "Avatar"; + u.dudes_num[6] = 1; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Warlock"; + u.dudes_num[1] = 40; + u.dudes[2] = "Guardian"; + u.dudes_num[2] = 400; + u.dudes[3] = "Grav Platform"; + u.dudes_num[3] = 20; + u.dudes[4] = "Dark Reaper"; + u.dudes_num[4] = 18; + u.dudes[5] = "Dark Reaper Exarch"; + u.dudes_num[5] = 2; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Fire Dragon"; + u.dudes_num[1] = 36; + u.dudes[2] = "Fire Dragon Exarch"; + u.dudes_num[2] = 4; + u.dudes[3] = "Warp Spider"; + u.dudes_num[3] = 36; + u.dudes_special[3] = "warp_jump"; + u.dudes[4] = "Warp Spider Exarch"; + u.dudes_num[4] = 4; + u.dudes_special[4] = "warp_jump"; + u.dudes[5] = "Howling Banshee"; + u.dudes_num[5] = 36; + u.dudes_special[5] = "banshee_mask"; + u.dudes[6] = "Howling Banshee Exarch"; + u.dudes_num[6] = 4; + u.dudes_special[6] = "banshee_mask"; + u.dudes[7] = "Striking Scorpian"; + u.dudes_num[7] = 38; + u.dudes[8] = "Striking Scorpian Exarch"; + u.dudes_num[8] = 2; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 30, 240, obj_enunit); + u.dudes[1] = "Falcon"; + u.dudes_num[1] = 12; + u.dudes[2] = "Vyper"; + u.dudes_num[2] = 20; + u.dudes[3] = "Wraithguard"; + u.dudes_num[3] = 90; + u.dudes[4] = "Wraithlord"; + u.dudes_num[4] = 5; + u.dudes[5] = "Shining Spear"; + u.dudes_num[5] = 40; + } + // Craftworld Medium Army + if (threat == 5) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "2500"; + + u.dudes[1] = "Dire Avenger"; + u.dudes_num[1] = 450; + u.dudes_special[1] = "shimmershield"; + u.dudes[2] = "Dire Avenger Exarch"; + u.dudes_num[2] = 50; + u.dudes_special[2] = "shimmershield"; + u.dudes[3] = "Autarch"; + u.dudes_num[3] = 5; + u.dudes[4] = "Farseer"; + u.dudes_num[4] = 3; + u.dudes_special[4] = "farseer_powers"; + // Spawn Leader + if (leader == 1) { + u.dudes[4] = "Leader"; + u.dudes_num[4] = 1; + enemies[4] = 1; + enemies_num[4] = 1; + } + u.dudes[5] = "Fire Prism"; + u.dudes_num[5] = 6; + u.dudes[6] = "Mighty Avatar"; + u.dudes_num[6] = 1; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Warlock"; + u.dudes_num[1] = 80; + u.dudes[2] = "Guardian"; + u.dudes_num[2] = 1200; + u.dudes[3] = "Grav Platform"; + u.dudes_num[3] = 40; + u.dudes[4] = "Dark Reaper"; + u.dudes_num[4] = 36; + u.dudes[5] = "Dark Reaper Exarch"; + u.dudes_num[5] = 4; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Fire Dragon"; + u.dudes_num[1] = 72; + u.dudes[2] = "Fire Dragon Exarch"; + u.dudes_num[2] = 8; + u.dudes[3] = "Warp Spider"; + u.dudes_num[3] = 72; + u.dudes_special[3] = "warp_jump"; + u.dudes[4] = "Warp Spider Exarch"; + u.dudes_num[4] = 8; + u.dudes_special[4] = "warp_jump"; + u.dudes[5] = "Howling Banshee"; + u.dudes_num[5] = 72; + u.dudes_special[5] = "banshee_mask"; + u.dudes[6] = "Howling Banshee Exarch"; + u.dudes_num[6] = 8; + u.dudes_special[6] = "banshee_mask"; + u.dudes[7] = "Striking Scorpian"; + u.dudes_num[7] = 72; + u.dudes[8] = "Striking Scorpian Exarch"; + u.dudes_num[8] = 8; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 30, 240, obj_enunit); + u.dudes[1] = "Falcon"; + u.dudes_num[1] = 24; + u.dudes[2] = "Vyper"; + u.dudes_num[2] = 40; + u.dudes[3] = "Wraithguard"; + u.dudes_num[3] = 180; + u.dudes[4] = "Wraithlord"; + u.dudes_num[4] = 10; + u.dudes[5] = "Shining Spear"; + u.dudes_num[5] = 80; + } + // Craftworld Large Army + if (threat == 6) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "5000"; + + u.dudes[1] = "Dire Avenger"; + u.dudes_num[1] = 540; + u.dudes_special[1] = "shimmershield"; + u.dudes[2] = "Dire Avenger Exarch"; + u.dudes_num[2] = 60; + u.dudes_special[2] = "shimmershield"; + u.dudes[3] = "Autarch"; + u.dudes_num[3] = 8; + u.dudes[4] = "Farseer"; + u.dudes_num[4] = 4; + u.dudes_special[4] = "farseer_powers"; + // Spawn Leader + if (leader == 1) { + u.dudes[4] = "Leader"; + u.dudes_num[4] = 1; + enemies[4] = 1; + enemies_num[4] = 1; + } + u.dudes[5] = "Fire Prism"; + u.dudes_num[5] = 12; + u.dudes[6] = "Godly Avatar"; + u.dudes_num[6] = 1; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Warlock"; + u.dudes_num[1] = 100; + u.dudes[2] = "Guardian"; + u.dudes_num[2] = 3000; + u.dudes[3] = "Grav Platform"; + u.dudes_num[3] = 80; + u.dudes[4] = "Dark Reaper"; + u.dudes_num[4] = 72; + u.dudes[5] = "Dark Reaper Exarch"; + u.dudes_num[5] = 8; + u.dudes[6] = "Phantom Titan"; + u.dudes_num[6] = 2; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Fire Dragon"; + u.dudes_num[1] = 144; + u.dudes[2] = "Fire Dragon Exarch"; + u.dudes_num[2] = 16; + u.dudes[3] = "Warp Spider"; + u.dudes_num[3] = 144; + u.dudes_special[3] = "warp_jump"; + u.dudes[4] = "Warp Spider Exarch"; + u.dudes_num[4] = 16; + u.dudes_special[4] = "warp_jump"; + u.dudes[5] = "Howling Banshee"; + u.dudes_num[5] = 144; + u.dudes_special[5] = "banshee_mask"; + u.dudes[6] = "Howling Banshee Exarch"; + u.dudes_num[6] = 16; + u.dudes_special[6] = "banshee_mask"; + u.dudes[7] = "Striking Scorpian"; + u.dudes_num[7] = 144; + u.dudes[8] = "Striking Scorpian Exarch"; + u.dudes_num[8] = 16; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 30, 240, obj_enunit); + u.dudes[1] = "Falcon"; + u.dudes_num[1] = 48; + u.dudes[2] = "Vyper"; + u.dudes_num[2] = 80; + u.dudes[3] = "Wraithguard"; + u.dudes_num[3] = 360; + u.dudes[4] = "Wraithlord"; + u.dudes_num[4] = 20; + u.dudes[5] = "Shining Spear"; + u.dudes_num[5] = 160; + } + } + + // ** Sisters Force ** + if (enemy == 5) { + // Small Sister Group + if (threat == 1) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "110"; + + u.dudes[1] = "Celestian"; + u.dudes_num[1] = 1; + enemies[1] = u.dudes[1]; + // Spawn Leader + if (leader == 1) { + u.dudes[1] = "Leader"; + u.dudes_num[1] = 1; + enemies[1] = 1; + enemies_num[1] = 1; + } + u.dudes[2] = "Battle Sister"; + u.dudes_num[2] = 4; + enemies[2] = u.dudes[2]; + u.dudes[3] = "Priest"; + u.dudes_num[3] = 10; + enemies[3] = u.dudes[3]; + u.dudes[4] = "Follower"; + u.dudes_num[4] = 100; + enemies[4] = u.dudes[4]; + } + // Medium Sister Group + if (threat == 2) { + u = instance_nearest(xxx + 10, 240, obj_enunit); + enemy_dudes = "nearly 400"; + + u.dudes[1] = "Celestian"; + u.dudes_num[1] = 1; + // Spawn Leader + if (leader == 1) { + u.dudes[1] = "Leader"; + u.dudes_num[1] = 1; + enemies[1] = 1; + enemies_num[1] = 1; + } + u.dudes[2] = "Battle Sister"; + u.dudes_num[2] = 50; + u.dudes[3] = "Follower"; + u.dudes_num[3] = 300; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Arco-Flagellent"; + u.dudes_num[1] = 50; + u.dudes[2] = "Chimera"; + u.dudes_num[2] = 3; + } + // Large Sister Group + if (threat == 3) { + u = instance_nearest(xxx + 30, 240, obj_enunit); + enemy_dudes = "1000"; + + u.dudes[1] = "Palatine"; + u.dudes_num[1] = 1; + // Spawn Leader + if (leader == 1) { + u.dudes[1] = "Leader"; + u.dudes_num[1] = 1; + enemies[1] = 1; + enemies_num[1] = 1; + } + u.dudes[2] = "Battle Sister"; + u.dudes_num[2] = 200; + u.dudes[3] = "Celestian"; + u.dudes_num[3] = 40; + u.dudes[4] = "Retributor"; + u.dudes_num[4] = 50; + u.dudes[5] = "Priest"; + u.dudes_num[5] = 60; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Seraphim"; + u.dudes_num[1] = 50; + u.dudes[2] = "Dominion"; + u.dudes_num[2] = 50; + u.dudes[3] = "Immolator"; + u.dudes_num[3] = 4; + u.dudes[4] = "Exorcist"; + u.dudes_num[4] = 2; + instance_deactivate_object(u); + + u = instance_nearest(xxx, 240, obj_enunit); + u.dudes[1] = "Follower"; + u.dudes_num[1] = 450; + u.dudes[2] = "Sister Repentia"; + u.dudes_num[2] = 50; + u.dudes[3] = "Arco-Flagellent"; + u.dudes_num[3] = 30; + u.dudes[4] = "Penitent Engine"; + u.dudes_num[4] = 4; + } + // Small Sister Army + if (threat == 4) { + u = instance_nearest(xxx + 30, 240, obj_enunit); + enemy_dudes = "4000"; + + u.dudes[1] = "Palatine"; + u.dudes_num[1] = 2; + // Spawn Leader + if (leader == 1) { + u.dudes[1] = "Leader"; + u.dudes_num[1] = 1; + enemies[1] = 1; + enemies_num[1] = 1; + } + u.dudes[2] = "Battle Sister"; + u.dudes_num[2] = 1000; + u.dudes[3] = "Celestian"; + u.dudes_num[3] = 150; + u.dudes[4] = "Retributor"; + u.dudes_num[4] = 150; + u.dudes[5] = "Priest"; + u.dudes_num[5] = 150; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Seraphim"; + u.dudes_num[1] = 200; + u.dudes[2] = "Dominion"; + u.dudes_num[2] = 200; + u.dudes[3] = "Immolator"; + u.dudes_num[3] = 15; + u.dudes[4] = "Exorcist"; + u.dudes_num[4] = 6; + u.dudes[5] = "Follower"; + u.dudes_num[5] = 600; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Follower"; + u.dudes_num[1] = 1500; + u.dudes[2] = "Sister Repentia"; + u.dudes_num[2] = 100; + u.dudes[3] = "Arco-Flagellent"; + u.dudes_num[3] = 30; + u.dudes[4] = "Penitent Engine"; + u.dudes_num[4] = 4; + u.dudes[5] = "Mistress"; + u.dudes_num[5] = 10; + } + // Medium Sister Army + if (threat == 5) { + u = instance_nearest(xxx + 40, 240, obj_enunit); + enemy_dudes = "8000"; + + u.dudes[1] = "Palatine"; + u.dudes_num[1] = 2; + // Spawn Leader + if (leader == 1) { + u.dudes[1] = "Leader"; + u.dudes_num[1] = 1; + enemies[1] = 1; + enemies_num[1] = 1; + } + u.dudes[2] = "Battle Sister"; + u.dudes_num[2] = 1000; + u.dudes[3] = "Celestian"; + u.dudes_num[3] = 150; + u.dudes[4] = "Retributor"; + u.dudes_num[4] = 200; + u.dudes[5] = "Priest"; + u.dudes_num[5] = 200; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 30, 240, obj_enunit); + u.dudes[1] = "Battle Sister"; + u.dudes_num[1] = 1000; + u.dudes[2] = "Celestian"; + u.dudes_num[2] = 150; + u.dudes[3] = "Retributor"; + u.dudes_num[3] = 200; + u.dudes[4] = "Priest"; + u.dudes_num[4] = 200; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Seraphim"; + u.dudes_num[1] = 200; + u.dudes[2] = "Dominion"; + u.dudes_num[2] = 200; + u.dudes[3] = "Immolator"; + u.dudes_num[3] = 25; + u.dudes[4] = "Exorcist"; + u.dudes_num[4] = 10; + u.dudes[5] = "Follower"; + u.dudes_num[5] = 2000; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Follower"; + u.dudes_num[1] = 2000; + u.dudes[2] = "Sister Repentia"; + u.dudes_num[2] = 300; + u.dudes[3] = "Arco-Flagellent"; + u.dudes_num[3] = 100; + u.dudes[4] = "Penitent Engine"; + u.dudes_num[4] = 15; + u.dudes[5] = "Mistress"; + u.dudes_num[5] = 30; + } + // Large Sister Army + if (threat == 6) { + u = instance_nearest(xxx + 50, 240, obj_enunit); + enemy_dudes = "12000"; + + u.dudes[1] = "Palatine"; + u.dudes_num[1] = 1; + // Spawn Leader + if (leader == 1) { + u.dudes[1] = "Leader"; + u.dudes_num[1] = 1; + enemies[1] = 1; + enemies_num[1] = 1; + } + u.dudes[2] = "Battle Sister"; + u.dudes_num[2] = 1500; + u.dudes[3] = "Celestian"; + u.dudes_num[3] = 150; + u.dudes[4] = "Retributor"; + u.dudes_num[4] = 200; + u.dudes[5] = "Priest"; + u.dudes_num[5] = 200; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 40, 240, obj_enunit); + u.dudes[1] = "Battle Sister"; + u.dudes_num[1] = 1500; + u.dudes[2] = "Celestian"; + u.dudes_num[2] = 150; + u.dudes[3] = "Retributor"; + u.dudes_num[3] = 200; + u.dudes[4] = "Priest"; + u.dudes_num[4] = 200; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 30, 240, obj_enunit); + u.dudes[1] = "Seraphim"; + u.dudes_num[1] = 200; + u.dudes[2] = "Dominion"; + u.dudes_num[2] = 200; + u.dudes[3] = "Immolator"; + u.dudes_num[3] = 50; + u.dudes[4] = "Exorcist"; + u.dudes_num[4] = 20; + u.dudes[5] = "Follower"; + u.dudes_num[5] = 2000; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Follower"; + u.dudes_num[1] = 2000; + u.dudes[2] = "Sister Repentia"; + u.dudes_num[2] = 500; + u.dudes[3] = "Arco-Flagellent"; + u.dudes_num[3] = 250; + u.dudes[4] = "Penitent Engine"; + u.dudes_num[4] = 30; + u.dudes[5] = "Mistress"; + u.dudes_num[5] = 50; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Follower"; + u.dudes_num[1] = 3000; + } + } + + // ** Orks Forces ** + if (enemy == 7) { + // u=instance_create(-10,240,obj_enunit); + // u.dudes[1]="Stormboy";u.dudes_num[1]=2500;u.flank=1;// enemies[1]=u.dudes[1]; + + // Small Ork Group + if (threat == 1) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "100"; + + u.dudes[1] = "Meganob"; + u.dudes_num[1] = 1; + enemies[1] = u.dudes[1]; + u.dudes[2] = "Slugga Boy"; + u.dudes_num[2] = 50; + enemies[2] = u.dudes[2]; + u.dudes[3] = "Shoota Boy"; + u.dudes_num[3] = 50; + enemies[3] = u.dudes[3]; + // Spawn Leader + if (leader == 1) { + u.dudes[4] = "Leader"; + u.dudes_num[4] = 1; + enemies[4] = 1; + enemies_num[4] = 1; + } + } + // Medium Ork Group + if (threat == 2) { + u = instance_nearest(xxx + 10, 240, obj_enunit); + enemy_dudes = "nearly 350"; + + u.dudes[1] = "Slugga Boy"; + u.dudes_num[1] = 50; + u.dudes[2] = "Shoota Boy"; + u.dudes_num[2] = 50; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Minor Warboss"; + u.dudes_num[1] = 1; + u.dudes[2] = "Meganob"; + u.dudes_num[2] = 5; + u.dudes[3] = "Slugga Boy"; + u.dudes_num[3] = 70; + u.dudes[4] = "Ard Boy"; + u.dudes_num[4] = 70; + u.dudes[5] = "Shoota Boy"; + u.dudes_num[5] = 100; + // Spawn Leader + if (leader == 1) { + u.dudes[1] = "Leader"; + u.dudes_num[1] = 1; + enemies[1] = 1; + enemies_num[1] = 1; + } + } + // Large Ork Group + if (threat == 3) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "over a 1000"; + + u.dudes[1] = "Slugga Boy"; + u.dudes_num[1] = 300; + u.dudes[2] = "Ard Boy"; + u.dudes_num[2] = 150; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Deff Dread"; + u.dudes_num[1] = 9; + u.dudes[2] = "Battlewagon"; + u.dudes_num[2] = 6; + u.dudes[3] = "Mekboy"; + u.dudes_num[3] = 1; + u.dudes[4] = "Flash Git"; + u.dudes_num[4] = 12; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Warboss"; + u.dudes_num[1] = 1; + // Spawn Leader + if (leader == 1) { + u.dudes[1] = "Leader"; + u.dudes_num[1] = 1; + enemies[1] = 1; + enemies_num[1] = 1; + } + u.dudes[2] = "Meganob"; + u.dudes_num[2] = 10; + u.dudes[3] = "Slugga Boy"; + u.dudes_num[3] = 100; + u.dudes[4] = "Ard Boy"; + u.dudes_num[4] = 150; + u.dudes[5] = "Shoota Boy"; + u.dudes_num[5] = 350; + } + // Small Ork Army + if (threat == 4) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "a green tide of over 3600"; + + u.dudes[1] = "Slugga Boy"; + u.dudes_num[1] = 600; + u.dudes[2] = "Ard Boy"; + u.dudes_num[2] = 300; + u.dudes[3] = "Gretchin"; + u.dudes_num[3] = 1000; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Deff Dread"; + u.dudes_num[1] = 21; + u.dudes[2] = "Battlewagon"; + u.dudes_num[2] = 12; + u.dudes[3] = "Mekboy"; + u.dudes_num[3] = 3; + u.dudes[4] = "Flash Git"; + u.dudes_num[4] = 30; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Warboss"; + u.dudes_num[1] = 1; + // Spawn Leader + if (leader == 1) { + u.dudes[1] = "Leader"; + u.dudes_num[1] = 1; + enemies[1] = 1; + enemies_num[1] = 1; + } + u.dudes[2] = "Meganob"; + u.dudes_num[2] = 30; + u.dudes[3] = "Slugga Boy"; + u.dudes_num[3] = 300; + u.dudes[4] = "Ard Boy"; + u.dudes_num[4] = 450; + u.dudes[5] = "Shoota Boy"; + u.dudes_num[5] = 1000; + } + // Medium Ork Army + if (threat == 5) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "a green tide of over 7000"; + + u.dudes[1] = "Slugga Boy"; + u.dudes_num[1] = 1200; + u.dudes[2] = "Ard Boy"; + u.dudes_num[2] = 600; + u.dudes[3] = "Gretchin"; + u.dudes_num[3] = 2000; + u.dudes[4] = "Tank Busta"; + u.dudes_num[4] = 100; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Deff Dread"; + u.dudes_num[1] = 40; + u.dudes[2] = "Battlewagon"; + u.dudes_num[2] = 18; + u.dudes[3] = "Mekboy"; + u.dudes_num[3] = 6; + u.dudes[4] = "Flash Git"; + u.dudes_num[4] = 50; + u.dudes[5] = "Kommando"; + u.dudes_num[5] = 20; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Warboss"; + u.dudes_num[1] = 1; + // Spawn Leader + if (leader == 1) { + u.dudes[1] = "Leader"; + u.dudes_num[1] = 1; + enemies[1] = 1; + enemies_num[1] = 1; + } + u.dudes[2] = "Meganob"; + u.dudes_num[2] = 80; + u.dudes[3] = "Slugga Boy"; + u.dudes_num[3] = 600; + u.dudes[4] = "Ard Boy"; + u.dudes_num[4] = 900; + u.dudes[5] = "Shoota Boy"; + u.dudes_num[5] = 2000; + } + // Large Ork Army + if (threat == 6) { + enemy_dudes = "a WAAAAGH!! of 11000"; + + u = instance_nearest(xxx, 240, obj_enunit); + u.dudes[1] = "Mekboy"; + u.dudes_num[1] = 6; + u.dudes[2] = "Flash Git"; + u.dudes_num[2] = 50; + u.dudes[3] = "Kommando"; + u.dudes_num[3] = 20; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Slugga Boy"; + u.dudes_num[1] = 1200; + u.dudes[2] = "Ard Boy"; + u.dudes_num[2] = 600; + u.dudes[3] = "Gretchin"; + u.dudes_num[3] = 2000; + u.dudes[4] = "Tank Busta"; + u.dudes_num[4] = 100; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Mekboy"; + u.dudes_num[1] = 6; + u.dudes[2] = "Flash Git"; + u.dudes_num[2] = 50; + u.dudes[3] = "Kommando"; + u.dudes_num[3] = 20; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 30, 240, obj_enunit); + u.dudes[1] = "Big Warboss"; + u.dudes_num[1] = 1; + // Spawn Leader + if (leader == 1) { + u.dudes[1] = "Leader"; + u.dudes_num[1] = 1; + enemies[1] = 1; + enemies_num[1] = 1; + } + u.dudes[2] = "Meganob"; + u.dudes_num[2] = 80; + u.dudes[3] = "Slugga Boy"; + u.dudes_num[3] = 600; + u.dudes[4] = "Ard Boy"; + u.dudes_num[4] = 900; + u.dudes[5] = "Shoota Boy"; + u.dudes_num[5] = 2000; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 40, 240, obj_enunit); + u.dudes[1] = "Deff Dread"; + u.dudes_num[1] = 36; + u.dudes[2] = "Battlewagon"; + u.dudes_num[2] = 220; + instance_deactivate_object(u); + } + } + + // ** Tau Forces ** + if (enemy == 8) { + // Small Tau Group + if (threat == 1) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "11"; + + u.dudes[1] = "XV8 Crisis"; + u.dudes_num[1] = 1; + u.dudes[2] = "Fire Warrior"; + u.dudes_num[2] = 20; + u.dudes[3] = "Kroot"; + u.dudes_num[3] = 20; + enemies[3] = u.dudes[3]; + } + // Medium Tau Group + if (threat == 2) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "100"; + + u.dudes[1] = "XV8 Commander"; + u.dudes_num[1] = 1; + u.dudes[2] = "XV8 Bodyguard"; + u.dudes_num[2] = 6; + u.dudes[3] = "Shield Drone"; + u.dudes_num[3] = 4; + u.dudes[4] = "XV88 Broadside"; + u.dudes_num[4] = 3; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Fire Warrior"; + u.dudes_num[1] = 60; + u.dudes[2] = "Kroot"; + u.dudes_num[2] = 60; + u.dudes[3] = "Pathfinder"; + u.dudes_num[3] = 20; + u.dudes[4] = "XV8 Crisis"; + u.dudes_num[4] = 12; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Hammerhead"; + u.dudes_num[1] = 2; + u.dudes[2] = "Devilfish"; + u.dudes_num[2] = 4; + + u = instance_create(0, 240, obj_enunit); + u.dudes[1] = "XV25 Stealthsuit"; + u.dudes_num[1] = 6; + u.flank = 1; + } + // Large Tau Group + if (threat == 3) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "100"; + + u.dudes[1] = "XV8 Commander"; + u.dudes_num[1] = 1; + u.dudes[2] = "XV8 Bodyguard"; + u.dudes_num[2] = 9; + u.dudes[3] = "Shield Drone"; + u.dudes_num[3] = 8; + u.dudes[4] = "XV88 Broadside"; + u.dudes_num[4] = 6; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Fire Warrior"; + u.dudes_num[1] = 200; + u.dudes[2] = "Kroot"; + u.dudes_num[2] = 150; + u.dudes[3] = "Pathfinder"; + u.dudes_num[3] = 40; + u.dudes[4] = "XV8 Crisis"; + u.dudes_num[4] = 24; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Hammerhead"; + u.dudes_num[1] = 5; + u.dudes[2] = "Devilfish"; + u.dudes_num[2] = 10; + + u = instance_create(0, 240, obj_enunit); + u.dudes[1] = "XV25 Stealthsuit"; + u.dudes_num[1] = 12; + u.flank = 1; + } + // Small Tau Army + if (threat == 4) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "100"; + + u.dudes[1] = "XV8 Commander"; + u.dudes_num[1] = 1; + u.dudes[2] = "XV8 Bodyguard"; + u.dudes_num[2] = 9; + u.dudes[3] = "Shield Drone"; + u.dudes_num[3] = 8; + u.dudes[4] = "XV88 Broadside"; + u.dudes_num[4] = 12; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Fire Warrior"; + u.dudes_num[1] = 800; + u.dudes[2] = "Kroot"; + u.dudes_num[2] = 500; + u.dudes[3] = "Pathfinder"; + u.dudes_num[3] = 60; + u.dudes[4] = "XV8 Crisis"; + u.dudes_num[4] = 48; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Hammerhead"; + u.dudes_num[1] = 40; + u.dudes[2] = "Devilfish"; + u.dudes_num[2] = 15; + u.dudes[3] = "XV8 Crisis"; + u.dudes_num[3] = 48; + + u = instance_create(0, 240, obj_enunit); + u.dudes[1] = "XV25 Stealthsuit"; + u.dudes_num[1] = 12; + u.flank = 1; + u.dudes[2] = "XV8 (Brightknife)"; + u.dudes_num[2] = 6; + u.flank = 1; + } + // Medium Tau Army + if (threat == 5) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "4000"; + + u.dudes[1] = "XV8 Commander"; + u.dudes_num[1] = 2; + u.dudes[2] = "XV8 Bodyguard"; + u.dudes_num[2] = 18; + u.dudes[3] = "Shield Drone"; + u.dudes_num[3] = 20; + u.dudes[4] = "XV88 Broadside"; + u.dudes_num[4] = 24; + u.dudes[5] = "Vespid"; + u.dudes_num[4] = 30; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Fire Warrior"; + u.dudes_num[1] = 1000; + u.dudes[2] = "Kroot"; + u.dudes_num[2] = 700; + u.dudes[3] = "Pathfinder"; + u.dudes_num[3] = 100; + u.dudes[4] = "XV8 Crisis"; + u.dudes_num[4] = 80; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Fire Warrior"; + u.dudes_num[1] = 1000; + u.dudes[2] = "Kroot"; + u.dudes_num[2] = 700; + u.dudes[3] = "Pathfinder"; + u.dudes_num[3] = 100; + u.dudes[4] = "XV8 Crisis"; + u.dudes_num[4] = 80; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 30, 240, obj_enunit); + u.dudes[1] = "Hammerhead"; + u.dudes_num[1] = 40; + u.dudes[2] = "Devilfish"; + u.dudes_num[2] = 40; + u.dudes[3] = "XV8 Crisis"; + u.dudes_num[3] = 48; + + u = instance_create(0, 240, obj_enunit); + u.dudes[1] = "XV25 Stealthsuit"; + u.dudes_num[1] = 12; + u.flank = 1; + u.dudes[2] = "XV8 (Brightknife)"; + u.dudes_num[2] = 18; + u.flank = 1; + } + // Large Tau Army + if (threat == 6) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "6000"; + + u.dudes[1] = "XV8 Commander"; + u.dudes_num[1] = 2; + u.dudes[2] = "XV8 Bodyguard"; + u.dudes_num[2] = 18; + u.dudes[3] = "Shield Drone"; + u.dudes_num[3] = 20; + u.dudes[4] = "XV88 Broadside"; + u.dudes_num[4] = 36; + u.dudes[5] = "Vespid"; + u.dudes_num[4] = 60; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Fire Warrior"; + u.dudes_num[1] = 1000; + u.dudes[2] = "Kroot"; + u.dudes_num[2] = 700; + u.dudes[3] = "Pathfinder"; + u.dudes_num[3] = 100; + u.dudes[4] = "XV8 Crisis"; + u.dudes_num[4] = 80; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Fire Warrior"; + u.dudes_num[1] = 1000; + u.dudes[2] = "Kroot"; + u.dudes_num[2] = 700; + u.dudes[3] = "Pathfinder"; + u.dudes_num[3] = 100; + u.dudes[4] = "XV8 Crisis"; + u.dudes_num[4] = 80; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 30, 240, obj_enunit); + u.dudes[1] = "Fire Warrior"; + u.dudes_num[1] = 1000; + u.dudes[2] = "Kroot"; + u.dudes_num[2] = 700; + u.dudes[3] = "Pathfinder"; + u.dudes_num[3] = 100; + u.dudes[4] = "XV8 Crisis"; + u.dudes_num[4] = 80; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 40, 240, obj_enunit); + u.dudes[1] = "Hammerhead"; + u.dudes_num[1] = 40; + u.dudes[2] = "Devilfish"; + u.dudes_num[2] = 80; + u.dudes[3] = "XV8 Crisis"; + u.dudes_num[3] = 80; + + u = instance_create(0, 240, obj_enunit); + u.dudes[1] = "XV25 Stealthsuit"; + u.dudes_num[1] = 12; + u.flank = 1; + u.dudes[2] = "XV8 (Brightknife)"; + u.dudes_num[2] = 24; + u.flank = 1; + } + } + + // ** Tyranid Forces ** + // Tyranid story event + if ((enemy == 9) && (battle_special == "tyranid_org")) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "81"; + u.dudes[1] = "Termagaunt"; + u.dudes_num[1] = 40; + u.dudes[2] = "Hormagaunt"; + u.dudes_num[2] = 40; + // u.dudes[3]="Lictor";u.dudes_num[3]=1; + } + if ((enemy == 9) && (battle_special != "tyranid_org")) { + // Small Genestealer Group + if (threat == 1) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "11"; + + u.dudes[1] = "Genestealer"; + u.dudes_num[1] = 10; + + u = instance_create(0, 240, obj_enunit); + u.dudes[1] = "Lictor"; + u.dudes_num[1] = 1; + u.flank = 1; + } + // Medium Genestealer Group + if (threat == 2) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "100"; + + u.dudes[1] = "Genestealer Patriarch"; + u.dudes_num[1] = 1; + u.dudes[2] = "Genestealer"; + u.dudes_num[2] = 30; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Cultist"; + u.dudes_num[1] = 150; + + u = instance_create(0, 240, obj_enunit); + u.dudes[1] = "Lictor"; + u.dudes_num[1] = 1; + u.flank = 1; + } + // Large Genestealer Group + if (threat == 3) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "100"; + + u.dudes[1] = "Genestealer Patriarch"; + u.dudes_num[1] = 1; + u.dudes[2] = "Genestealer"; + u.dudes_num[2] = 120; + u.dudes[3] = "Armoured Limousine"; + u.dudes_num[3] = 20; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Cultist"; + u.dudes_num[1] = 600; + + u = instance_create(0, 240, obj_enunit); + u.dudes[1] = "Lictor"; + u.dudes_num[1] = 6; + u.flank = 1; + } + // Small Tyranid Army + if (threat == 4) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "7000"; + + u.dudes[1] = "Hive Tyrant"; + u.dudes_num[1] = 1; + u.dudes[2] = "Tyrant Guard"; + u.dudes_num[2] = 16; + u.dudes[3] = "Tyranid Warrior"; + u.dudes_num[3] = 40; + u.dudes[4] = "Zoanthrope"; + u.dudes_num[4] = 10; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Termagaunt"; + u.dudes_num[1] = 1500; + u.dudes[2] = "Hormagaunt"; + u.dudes_num[2] = 800; + u.dudes[3] = "Carnifex"; + u.dudes_num[3] = 5; + u.dudes[4] = "Tyranid Warrior"; + u.dudes_num[4] = 30; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Termagaunt"; + u.dudes_num[1] = 1500; + u.dudes[2] = "Hormagaunt"; + u.dudes_num[2] = 800; + u.dudes[3] = "Carnifex"; + u.dudes_num[3] = 5; + u.dudes[4] = "Tyranid Warrior"; + u.dudes_num[4] = 30; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 30, 240, obj_enunit); + u.dudes[1] = "Termagaunt"; + u.dudes_num[1] = 1500; + u.dudes[2] = "Hormagaunt"; + u.dudes_num[2] = 800; + u.dudes[3] = "Carnifex"; + u.dudes_num[3] = 5; + u.dudes[4] = "Tyranid Warrior"; + u.dudes_num[4] = 30; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 40, 240, obj_enunit); + u.dudes[1] = "Carnifex"; + u.dudes_num[1] = 6; + + u = instance_create(0, 240, obj_enunit); + u.dudes[1] = "Lictor"; + u.dudes_num[1] = 15; + u.flank = 1; + } + // Medium Tyranid Army + if (threat == 5) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "15000"; + + u.dudes[1] = "Hive Tyrant"; + u.dudes_num[1] = 2; + u.dudes[2] = "Tyrant Guard"; + u.dudes_num[2] = 32; + u.dudes[3] = "Tyranid Warrior"; + u.dudes_num[3] = 80; + u.dudes[4] = "Zoanthrope"; + u.dudes_num[4] = 20; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Termagaunt"; + u.dudes_num[1] = 3300; + u.dudes[2] = "Hormagaunt"; + u.dudes_num[2] = 1600; + u.dudes[3] = "Carnifex"; + u.dudes_num[3] = 10; + u.dudes[4] = "Tyranid Warrior"; + u.dudes_num[4] = 30; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Termagaunt"; + u.dudes_num[1] = 3300; + u.dudes[2] = "Hormagaunt"; + u.dudes_num[2] = 1600; + u.dudes[3] = "Carnifex"; + u.dudes_num[3] = 10; + u.dudes[4] = "Tyranid Warrior"; + u.dudes_num[4] = 30; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 30, 240, obj_enunit); + u.dudes[1] = "Termagaunt"; + u.dudes_num[1] = 3300; + u.dudes[2] = "Hormagaunt"; + u.dudes_num[2] = 1600; + u.dudes[3] = "Carnifex"; + u.dudes_num[3] = 10; + u.dudes[4] = "Tyranid Warrior"; + u.dudes_num[4] = 60; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 40, 240, obj_enunit); + u.dudes[1] = "Carnifex"; + u.dudes_num[1] = 20; + u.dudes[2] = "Zoanthrope"; + u.dudes_num[2] = 10; + + u = instance_create(0, 240, obj_enunit); + u.dudes[1] = "Lictor"; + u.dudes_num[1] = 20; + u.flank = 1; + } + // Large Tyranid Army + if (threat == 6) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "45000"; + + u.dudes[1] = "Hive Tyrant"; + u.dudes_num[1] = 4; + u.dudes[2] = "Tyrant Guard"; + u.dudes_num[2] = 64; + u.dudes[3] = "Tyranid Warrior"; + u.dudes_num[3] = 160; + u.dudes[4] = "Zoanthrope"; + u.dudes_num[4] = 40; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Termagaunt"; + u.dudes_num[1] = 10000; + u.dudes[2] = "Hormagaunt"; + u.dudes_num[2] = 4000; + u.dudes[3] = "Carnifex"; + u.dudes_num[3] = 15; + u.dudes[4] = "Tyranid Warrior"; + u.dudes_num[4] = 90; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Termagaunt"; + u.dudes_num[1] = 10000; + u.dudes[2] = "Hormagaunt"; + u.dudes_num[2] = 4000; + u.dudes[3] = "Carnifex"; + u.dudes_num[3] = 15; + u.dudes[4] = "Tyranid Warrior"; + u.dudes_num[4] = 90; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 30, 240, obj_enunit); + u.dudes[1] = "Termagaunt"; + u.dudes_num[1] = 10000; + u.dudes[2] = "Hormagaunt"; + u.dudes_num[2] = 4000; + u.dudes[3] = "Carnifex"; + u.dudes_num[3] = 15; + u.dudes[4] = "Tyranid Warrior"; + u.dudes_num[4] = 90; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 40, 240, obj_enunit); + u.dudes[1] = "Carnifex"; + u.dudes_num[1] = 40; + u.dudes[2] = "Zoanthrope"; + u.dudes_num[2] = 20; + + u = instance_create(0, 240, obj_enunit); + u.dudes[1] = "Lictor"; + u.dudes_num[1] = 40; + u.flank = 1; + } + } + + // ** Chaos Forces ** + if ((enemy == 10) && (battle_special != "ship_demon") && (battle_special != "fallen1") && (battle_special != "fallen2") && (battle_special != "WL10_reveal") && (battle_special != "WL10_later") && (string_count("cs_meeting_battle", battle_special) == 0)) { + // u=instance_create(-10,240,obj_enunit); + // u.dudes[1]="Stormboy";u.dudes_num[1]=2500;u.flank=1;// enemies[1]=u.dudes[1]; + // Small Chaos Cult Group + if (threat == 1) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "150"; + + u.dudes[1] = "Arch Heretic"; + u.dudes_num[1] = 1; + enemies[1] = u.dudes[1]; + u.dudes[2] = "Cultist Elite"; + u.dudes_num[2] = 30; + enemies[2] = u.dudes[2]; + u.dudes[3] = "Cultist"; + u.dudes_num[3] = 120; + enemies[3] = u.dudes[3]; + } + // Medium Chaos Cult Group + if (threat == 2) { + u = instance_nearest(xxx + 10, 240, obj_enunit); + enemy_dudes = "nearly 400"; + + u.dudes[1] = "Arch Heretic"; + u.dudes_num[1] = 1; + u.dudes[2] = "Cultist Elite"; + u.dudes_num[2] = 50; + u.dudes[3] = "Cultist"; + u.dudes_num[3] = 300; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Cultist"; + u.dudes_num[1] = 50; + u.dudes[2] = "Technical"; + u.dudes_num[2] = 6; + } + // Large Chaos Cult Group + if (threat == 3) { + u = instance_nearest(xxx + 20, 240, obj_enunit); + enemy_dudes = "1000"; + + u.dudes[1] = "Arch Heretic"; + u.dudes_num[1] = 1; + u.dudes[2] = "Cultist Elite"; + u.dudes_num[2] = 100; + u.dudes[3] = "Mutants"; + u.dudes_num[3] = 200; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Technical"; + u.dudes_num[1] = 9; + u.dudes[2] = "Chaos Leman Russ"; + u.dudes_num[2] = 6; + u.dudes[3] = "Cultist"; + u.dudes_num[3] = 200; + instance_deactivate_object(u); + + u = instance_nearest(xxx, 240, obj_enunit); + u.dudes[1] = "Cultist"; + u.dudes_num[1] = 200; + u.dudes[2] = "Mutant"; + u.dudes_num[2] = 300; + } + // Small Chaos Cult Army + if (threat == 4) { + u = instance_nearest(xxx + 20, 240, obj_enunit); + enemy_dudes = "4000"; + + u.dudes[1] = "Arch Heretic"; + u.dudes_num[1] = 1; + u.dudes[2] = "Cultist Elite"; + u.dudes_num[2] = 400; + u.dudes[3] = "Chaos Basilisk"; + u.dudes_num[3] = 6; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Mutant"; + u.dudes_num[1] = 1500; + u.dudes[2] = "Chaos Leman Russ"; + u.dudes_num[2] = 21; + u.dudes[3] = "Defiler"; + u.dudes_num[3] = 5; + instance_deactivate_object(u); + + u = instance_nearest(xxx, 240, obj_enunit); + u.dudes[1] = "Cultist"; + u.dudes_num[1] = 600; + u.dudes[2] = "Mutant"; + u.dudes_num[2] = 1500; + } + // Medium Chaos Cult Army + if (threat == 5) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "8000"; + + u.dudes[1] = "Daemonhost"; + u.dudes_num[1] = 1; + u.dudes[2] = "Chaos Terminator"; + u.dudes_num[2] = 10; + u.dudes[3] = "Cultist Elite"; + u.dudes_num[3] = 400; + u.dudes[4] = "Chaos Basilisk"; + u.dudes_num[4] = 9; + + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Chaos Leman Russ"; + u.dudes_num[1] = 40; + u.dudes[2] = "Defiler"; + u.dudes_num[2] = 12; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Mutant"; + u.dudes_num[1] = 2000; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 30, 240, obj_enunit); + u.dudes[1] = "Cultist"; + u.dudes_num[1] = 1000; + u.dudes[2] = "Mutant"; + u.dudes_num[2] = 2000; + instance_deactivate_object(u); + + u = instance_nearest(xxx, 40, obj_enunit); + u.dudes[1] = "Cultist"; + u.dudes_num[1] = 1000; + u.dudes[2] = "Mutant"; + u.dudes_num[2] = 2000; + instance_deactivate_object(u); + } + // Large Chaos Cult Army + if (threat == 6) { + u = instance_nearest(xxx + 40, 240, obj_enunit); + enemy_dudes = "12000"; + + u.dudes[1] = "Greater Daemon of " + string(choose("Slaanesh", "Khorne", "Nurgle", "Tzeentch,", "Tzeentch")); + u.dudes_num[1] = 2; + u.dudes[2] = "Chaos Terminator"; + u.dudes_num[2] = 20; + u.dudes[3] = "Chaos Basilisk"; + u.dudes_num[3] = 18; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Chaos Leman Russ"; + u.dudes_num[1] = 80; + u.dudes[2] = "Defiler"; + u.dudes_num[2] = 20; + u.dudes[3] = "Vindicator"; + u.dudes_num[3] = 10; + instance_deactivate_object(u); + + u = instance_nearest(xxx, 240, obj_enunit); + u.dudes[1] = "Mutant"; + u.dudes_num[1] = 8000; + u.dudes[2] = "Cultist Elite"; + u.dudes_num[2] = 4000; + u.dudes[3] = "Havoc"; + u.dudes_num[3] = 50; + u.dudes[4] = "Chaos Space Marine"; + u.dudes_num[4] = 50; + instance_deactivate_object(u); + } + // Chaos Daemons Army + if (threat == 7) { + u = instance_nearest(xxx + 40, 240, obj_enunit); + u.neww = 1; + enemy_dudes = ""; + + u.dudes[1] = "Greater Daemon of Slaanesh"; + u.dudes_num[1] = 1; + u.dudes[2] = "Greater Daemon of Slaanesh"; + u.dudes_num[2] = 1; + // u.dudes[3]="Greater Daemon of Slaanesh";u.dudes_num[3]=1; + u.dudes[4] = "Greater Daemon of Tzeentch"; + u.dudes_num[4] = 1; + u.dudes[5] = "Greater Daemon of Tzeentch"; + u.dudes_num[5] = 1; + // u.dudes[6]="Greater Daemon of Tzeentch";u.dudes_num[6]=1; + u.dudes[7] = "Soul Grinder"; + u.dudes_num[7] = 3; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 30, 240, obj_enunit); + u.neww = 1; + u.dudes[1] = "Greater Daemon of Khorne"; + u.dudes_num[1] = 1; + u.dudes[2] = "Greater Daemon of Khorne"; + u.dudes_num[2] = 1; + // u.dudes[3]="Greater Daemon of Khorne";u.dudes_num[3]=1; + u.dudes[4] = "Greater Daemon of Nurgle"; + u.dudes_num[4] = 1; + u.dudes[5] = "Greater Daemon of Nurgle"; + u.dudes_num[5] = 1; + // u.dudes[6]="Greater Daemon of Nurgle";u.dudes_num[6]=1; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Bloodletter"; + u.dudes_num[1] = 800; + u.dudes[2] = "Daemonette"; + u.dudes_num[2] = 800; + u.dudes[3] = "Plaguebearer"; + u.dudes_num[3] = 800; + u.dudes[4] = "Pink Horror"; + u.dudes_num[4] = 800; + u.dudes[5] = "Maulerfiend"; + u.dudes_num[5] = 3; + instance_deactivate_object(u); + + // u=instance_nearest(xxx+10,240,obj_enunit); + // u.dudes[1]="Mutant";u.dudes_num[1]=6000; + // instance_deactivate_object(u); + } + } + + // ** Chaos Space Marines Forces ** + if ((enemy == 11) && (battle_special != "world_eaters") && (string_count("cs_meeting_battle", battle_special) == 0)) { + // Small CSM Group + if (threat == 1) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "5"; + + u.dudes[1] = "Chaos Space Marine"; + u.dudes_num[1] = 5; + enemies[1] = u.dudes[1]; + u.dudes[2] = "Cultist"; + u.dudes_num[2] = 30; + enemies[2] = u.dudes[2]; + } + // Medium CSM Group + if (threat == 2) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "41"; + + u.dudes[1] = "Chaos Chosen"; + u.dudes_num[1] = 1; + u.dudes[2] = "Chaos Space Marine"; + u.dudes_num[2] = 35; + u.dudes[3] = "Havoc"; + u.dudes_num[3] = 5; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Cultist"; + u.dudes_num[1] = 100; + u.dudes[2] = "Rhino"; + u.dudes_num[2] = 2; + u.dudes[3] = "Predator"; + u.dudes_num[3] = 4; + } + // Large CSM Group + if (threat == 3) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "over 100"; + + u.dudes[1] = "Chaos Lord"; + u.dudes_num[1] = 1; + u.dudes[2] = "Chaos Sorcerer"; + u.dudes_num[2] = 1; + u.dudes[3] = "Chaos Chosen"; + u.dudes_num[3] = 10; + u.dudes[4] = "Chaos Space Marine"; + u.dudes_num[4] = 100; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Rhino"; + u.dudes_num[1] = 6; + u.dudes[2] = "Defiler"; + u.dudes_num[2] = 2; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Cultist"; + u.dudes_num[1] = 300; + u.dudes[2] = "Helbrute"; + u.dudes_num[2] = 3; + u.dudes[3] = "Predator"; + u.dudes_num[3] = 6; + u.dudes[4] = "Land Raider"; + u.dudes_num[4] = 2; + } + // Small CSM Army + if (threat == 4) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "over 700"; + + u.dudes[1] = "Chaos Lord"; + u.dudes_num[1] = 1; + u.dudes[2] = "Chaos Sorcerer"; + u.dudes_num[2] = 2; + u.dudes[3] = "Chaos Chosen"; + u.dudes_num[3] = 10; + // u.dudes[4]="Chaos Terminator";u.dudes_num[4]=5; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Chaos Space Marine"; + u.dudes_num[1] = 250; + u.dudes[2] = "Havoc"; + u.dudes_num[2] = 20; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Rhino"; + u.dudes_num[1] = 15; + u.dudes[2] = "Defiler"; + u.dudes_num[2] = 4; + u.dudes[3] = "Heldrake"; + u.dudes_num[3] = 1; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 30, 240, obj_enunit); + u.dudes[1] = "Cultist"; + u.dudes_num[1] = 600; + u.dudes[2] = "Helbrute"; + u.dudes_num[2] = 3; + u.dudes[3] = "Predator"; + u.dudes_num[3] = 6; + u.dudes[4] = "Vindicator"; + u.dudes_num[4] = 3; + u.dudes[5] = "Land Raider"; + u.dudes_num[5] = 2; + } + // Medium CSM Army + if (threat == 5) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "over 1200"; + + u.dudes[1] = "Chaos Lord"; + u.dudes_num[1] = 1; + u.dudes[2] = "Chaos Sorcerer"; + u.dudes_num[2] = 3; + u.dudes[3] = "Chaos Chosen"; + u.dudes_num[3] = 20; + u.dudes[4] = "Obliterator"; + u.dudes_num[4] = 6; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Chaos Space Marine"; + u.dudes_num[1] = 600; + u.dudes[2] = "Havoc"; + u.dudes_num[2] = 40; + u.dudes[3] = "Raptor"; + u.dudes_num[3] = 40; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Rhino"; + u.dudes_num[1] = 25; + u.dudes[2] = "Defiler"; + u.dudes_num[2] = 8; + u.dudes[3] = "Heldrake"; + u.dudes_num[3] = 3; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 30, 240, obj_enunit); + u.dudes[1] = "Cultist"; + u.dudes_num[1] = 600; + u.dudes[2] = "Helbrute"; + u.dudes_num[2] = 5; + u.dudes[3] = "Predator"; + u.dudes_num[3] = 10; + u.dudes[4] = "Vindicator"; + u.dudes_num[4] = 6; + u.dudes[5] = "Land Raider"; + u.dudes_num[5] = 3; + u.dudes[6] = "Possessed"; + u.dudes_num[6] = 30; + + u = instance_create(0, 240, obj_enunit); + u.dudes[1] = "Chaos Terminator"; + u.dudes_num[1] = 10; + u.flank = 1; + } + // Large CSM Army + if (threat == 6) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "2000"; + + u.dudes[1] = "Chaos Lord"; + u.dudes_num[1] = 2; + u.dudes[2] = "Chaos Sorcerer"; + u.dudes_num[2] = 10; + u.dudes[3] = "Chaos Chosen"; + u.dudes_num[3] = 40; + u.dudes[4] = "Obliterator"; + u.dudes_num[4] = 12; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Chaos Space Marine"; + u.dudes_num[1] = 800; + u.dudes[2] = "Havoc"; + u.dudes_num[2] = 50; + u.dudes[3] = "Raptor"; + u.dudes_num[3] = 50; + u.dudes[4] = choose("Noise Marine", "Plague Marine", "Khorne Berzerker", "Rubric Marine"); + u.dudes_num[3] = 50; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Rhino"; + u.dudes_num[1] = 30; + u.dudes[2] = "Defiler"; + u.dudes_num[2] = 10; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 30, 240, obj_enunit); + u.dudes[1] = "Cultist"; + u.dudes_num[1] = 1200; + u.dudes[2] = "Helbrute"; + u.dudes_num[2] = 10; + u.dudes[3] = "Predator"; + u.dudes_num[3] = 20; + u.dudes[4] = "Vindicator"; + u.dudes_num[4] = 15; + u.dudes[5] = "Land Raider"; + u.dudes_num[5] = 6; + u.dudes[6] = "Possessed"; + u.dudes_num[6] = 60; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 40, 240, obj_enunit); + u.dudes[1] = "Heldrake"; + u.dudes_num[1] = 6; + u.flank = 1; + u.flyer = 1; + + u = instance_create(0, 240, obj_enunit); + u.dudes[1] = "Chaos Terminator"; + u.dudes_num[1] = 20; + u.flank = 1; + } + } + + // ** World Eaters Forces ** + if ((enemy == 11) && (battle_special == "world_eaters")) { + // Small WE Group + if (threat == 1) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "20"; + + u.dudes[1] = "Khorne Berzerker"; + u.dudes_num[1] = 15; + enemies[1] = u.dudes[1]; + // Spawn Leader + if (obj_controller.faction_defeated[10] == 0) { + u.dudes[2] = "Leader"; + u.dudes_num[2] = 1; + } + u.dudes[3] = "World Eaters Veteran"; + u.dudes_num[3] = 5; + } + // Medium WE Group + if (threat == 2) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "135"; + + u.dudes[1] = "Chaos Chosen"; + u.dudes_num[1] = 1; + // Spawn Leader + if (obj_controller.faction_defeated[10] == 0) { + u.dudes[1] = "Leader"; + } + u.dudes[2] = "Khorne Berzerker"; + u.dudes_num[2] = 35; + u.dudes[3] = "World Eaters Veteran"; + u.dudes_num[3] = 5; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "World Eater"; + u.dudes_num[1] = 100; + u.dudes[2] = "Rhino"; + u.dudes_num[2] = 2; + u.dudes[3] = "Vindicator"; + u.dudes_num[3] = 4; + } + // Large WE Group + if (threat == 3) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "over 200"; + + u.dudes[1] = "Chaos Chosen"; + u.dudes_num[1] = 1; + // Spawn Leader + if (obj_controller.faction_defeated[10] == 0) { + u.dudes[1] = "Leader"; + } + u.dudes[2] = "Greater Daemon of Khorne"; + u.dudes_num[2] = 1; + u.dudes[3] = "World Eater Terminator"; + u.dudes_num[3] = 10; + u.dudes[4] = "World Eater"; + u.dudes_num[4] = 100; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Rhino"; + u.dudes_num[1] = 6; + u.dudes[2] = "Defiler"; + u.dudes_num[2] = 2; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Khorne Berzerker"; + u.dudes_num[1] = 100; + u.dudes[2] = "Helbrute"; + u.dudes_num[2] = 5; + u.dudes[3] = "Vindicator"; + u.dudes_num[3] = 6; + u.dudes[4] = "Land Raider"; + u.dudes_num[4] = 4; + } + // Small WE Army + if (threat == 4) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "over 300"; + + u.dudes[1] = "Chaos Chosen"; + u.dudes_num[1] = 1; + // Spawn Leader + if (obj_controller.faction_defeated[10] == 0) { + u.dudes[1] = "Leader"; + } + u.dudes[2] = "Greater Daemon of Khorne"; + u.dudes_num[2] = 2; + u.dudes[3] = "World Eater Terminator"; + u.dudes_num[3] = 10; + // u.dudes[4]="Chaos Terminator";u.dudes_num[4]=5; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "World Eaters Veteran"; + u.dudes_num[1] = 250; + u.dudes[2] = "Possessed"; + u.dudes_num[2] = 20; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Vindicator"; + u.dudes_num[1] = 15; + u.dudes[2] = "Defiler"; + u.dudes_num[2] = 4; + u.dudes[3] = "Heldrake"; + u.dudes_num[3] = 1; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 30, 240, obj_enunit); + u.dudes[1] = "Khorne Berzerker"; + u.dudes_num[1] = 300; + u.dudes[2] = "Helbrute"; + u.dudes_num[2] = 3; + u.dudes[3] = "Predator"; + u.dudes_num[3] = 6; + u.dudes[4] = "Vindicator"; + u.dudes_num[4] = 3; + u.dudes[5] = "Land Raider"; + u.dudes_num[5] = 2; + } + // Medium WE Army + if (threat == 5) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "over 900"; + + u.dudes[1] = "Chaos Chosen"; + u.dudes_num[1] = 1; + // Spawn Leader + if (obj_controller.faction_defeated[10] == 0) { + u.dudes[1] = "Leader"; + } + u.dudes[2] = "Greater Daemon of Khorne"; + u.dudes_num[2] = 3; + u.dudes[3] = "World Eater Terminator"; + u.dudes_num[3] = 20; + u.dudes[4] = "Helbrute"; + u.dudes_num[4] = 6; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "World Eaters Veteran"; + u.dudes_num[1] = 600; + u.dudes[2] = "Possessed"; + u.dudes_num[2] = 40; + u.dudes[3] = "Possessed"; + u.dudes_num[3] = 40; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Vindicator"; + u.dudes_num[1] = 15; + u.dudes[2] = "Defiler"; + u.dudes_num[2] = 8; + u.dudes[3] = "Heldrake"; + u.dudes_num[3] = 3; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 30, 240, obj_enunit); + u.dudes[1] = "Khorne Berzerker"; + u.dudes_num[1] = 300; + u.dudes[2] = "Helbrute"; + u.dudes_num[2] = 5; + u.dudes[3] = "Predator"; + u.dudes_num[3] = 10; + u.dudes[4] = "Vindicator"; + u.dudes_num[4] = 6; + u.dudes[5] = "Land Raider"; + u.dudes_num[5] = 3; + u.dudes[6] = "Possessed"; + u.dudes_num[6] = 30; + + u = instance_create(0, 240, obj_enunit); + u.dudes[1] = "Chaos Terminator"; + u.dudes_num[1] = 10; + u.flank = 1; + } + // Large WE Army + if (threat >= 6) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "1300"; + + u.dudes[1] = "Chaos Lord"; + u.dudes_num[1] = 2; + // Spawn Leader + if (obj_controller.faction_defeated[10] == 0) { + u.dudes[1] = "Leader"; + u.dudes_num[1] = 1; + } + u.dudes[2] = "Greater Daemon of Khorne"; + u.dudes_num[2] = 5; + u.dudes[3] = "World Eaters Terminator"; + u.dudes_num[3] = 40; + u.dudes[4] = "Helbrute"; + u.dudes_num[4] = 10; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "World Eaters Veteran"; + u.dudes_num[1] = 800; + u.dudes[2] = "Possessed"; + u.dudes_num[2] = 50; + u.dudes[3] = "Possessed"; + u.dudes_num[3] = 50; + u.dudes[4] = "Khorne Berzerker"; + u.dudes_num[3] = 50; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Vindicator"; + u.dudes_num[1] = 20; + u.dudes[2] = "Defiler"; + u.dudes_num[2] = 10; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 30, 240, obj_enunit); + u.dudes[1] = "Khorne Berzerker"; + u.dudes_num[1] = 500; + u.dudes[2] = "Helbrute"; + u.dudes_num[2] = 10; + u.dudes[3] = "Predator"; + u.dudes_num[3] = 15; + u.dudes[4] = "Vindicator"; + u.dudes_num[4] = 20; + u.dudes[5] = "Land Raider"; + u.dudes_num[5] = 6; + u.dudes[6] = "Possessed"; + u.dudes_num[6] = 60; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 40, 240, obj_enunit); + u.dudes[1] = "Heldrake"; + u.dudes_num[1] = 6; + u.flank = 1; + u.flyer = 1; + + u = instance_create(0, 240, obj_enunit); + u.dudes[1] = "World Eaters Terminator"; + u.dudes_num[1] = 20; + u.flank = 1; + } + } + + // ** Daemon Forces ** + if (enemy == 12) { + // If we want to have multiple story events regarding specific Chaos Gods, we could name slaa into gods and just check the value? TBD + var slaa = false; + if (battle_special == "ruins_eldar") { + slaa = true; + } + // Small Daemon Group + if (threat == 1) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "5"; + + u.dudes[1] = choose("Bloodletter", "Daemonette", "Plaguebearer", "Pink Horror"); + if (slaa) { + u.dudes[1] = "Daemonette"; + } + u.dudes_num[1] = 5; + enemies[1] = u.dudes[1]; + u.dudes[2] = "Cultist Elite"; + u.dudes_num[2] = 30; + enemies[2] = u.dudes[2]; + } + // Medium Daemon Group + if (threat == 2) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "90"; + + u.dudes[1] = choose("Bloodletter", "Daemonette", "Plaguebearer", "Pink Horror"); + if (slaa) { + u.dudes[1] = "Daemonette"; + } + u.dudes_num[1] = 30; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = choose("Bloodletter", "Daemonette", "Plaguebearer", "Pink Horror"); + if (slaa) { + u.dudes[1] = "Daemonette"; + } + u.dudes_num[1] = 30; + u.dudes[2] = "Defiler"; + u.dudes_num[2] = 1; + } + // Large Daemon Group + if (threat == 3) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "240"; + + u.dudes[1] = "Greater Daemon of " + choose("Tzeentch", "Slaanesh", "Nurgle", "Khorne"); + if (slaa) { + u.dudes[1] = "Greater Daemon of Slaanesh"; + } + u.dudes_num[1] = 1; + u.dudes[2] = "Chaos Sorcerer"; + u.dudes_num[2] = 1; + u.dudes[3] = "Pink Horror"; + if (slaa) { + u.dudes[3] = "Daemonette"; + } + u.dudes_num[3] = 60; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Defiler"; + u.dudes_num[1] = 2; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 20, 240, obj_enunit); + if (slaa) { + u.dudes[1] = "Daemonette"; + u.dudes_num[1] = 240; + } else { + u.dudes[1] = "Bloodletter"; + u.dudes_num[1] = 60; + u.dudes[2] = "Plaguebearer"; + u.dudes_num[2] = 60; + u.dudes[3] = "Daemonette"; + u.dudes_num[3] = 60; + u.dudes[4] = "Maulerfiend"; + u.dudes_num[4] = 2; + } + } + // Small Daemon Army + if (threat == 4) { + u = instance_nearest(xxx + 40, 240, obj_enunit); + enemy_dudes = "400"; + u.neww = 1; + + u.dudes[1] = "Greater Daemon of " + string(choose("Slaanesh", "Tzeentch")); + if (slaa) { + u.dudes[1] = "Greater Daemon of Slaanesh"; + } + u.dudes_num[1] = 1; + u.dudes[2] = "Greater Daemon of " + string(choose("Nurgle", "Khorne")); + if (slaa) { + u.dudes[2] = "Greater Daemon of Slaanesh"; + } + u.dudes_num[2] = 1; + // u.dudes[6]="Greater Daemon of Tzeentch";u.dudes_num[6]=1; + u.dudes[3] = "Soul Grinder"; + u.dudes_num[3] = 1; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 20, 240, obj_enunit); + if (slaa) { + u.dudes[1] = "Daemonette"; + u.dudes_num[1] = 400; + u.dudes[2] = "Maulerfiend"; + u.dudes_num[2] = 2; + } else { + u.dudes[1] = "Bloodletter"; + u.dudes_num[1] = 100; + u.dudes[2] = "Daemonette"; + u.dudes_num[2] = 100; + u.dudes[3] = "Plaguebearer"; + u.dudes_num[3] = 100; + u.dudes[4] = "Pink Horror"; + u.dudes_num[4] = 100; + u.dudes[5] = "Maulerfiend"; + u.dudes_num[5] = 2; + } + instance_deactivate_object(u); + } + // Medium Daemon Army + if (threat == 5) { + u = instance_nearest(xxx + 40, 240, obj_enunit); + enemy_dudes = "1000"; + u.neww = 1; + + u.dudes[1] = "Greater Daemon of " + string(choose("Slaanesh", "Tzeentch", "Khorne", "Nurgle")); + if (slaa) { + u.dudes[1] = "Greater Daemon of Slaanesh"; + } + u.dudes_num[1] = 1; + u.dudes[2] = "Greater Daemon of " + string(choose("Slaanesh", "Tzeentch", "Khorne", "Nurgle")); + if (slaa) { + u.dudes[2] = "Greater Daemon of Slaanesh"; + } + u.dudes_num[2] = 1; + u.dudes[3] = "Greater Daemon of " + string(choose("Slaanesh", "Tzeentch", "Khorne", "Nurgle")); + if (slaa) { + u.dudes[3] = "Greater Daemon of Slaanesh"; + } + u.dudes_num[3] = 1; + u.dudes[4] = "Soul Grinder"; + u.dudes_num[4] = 2; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 20, 240, obj_enunit); + if (slaa) { + u.dudes[1] = "Daemonette"; + u.dudes_num[1] = 1000; + u.dudes[2] = "Maulerfiend"; + u.dudes_num[2] = 2; + } else { + u.dudes[1] = "Bloodletter"; + u.dudes_num[1] = 250; + u.dudes[2] = "Daemonette"; + u.dudes_num[2] = 250; + u.dudes[3] = "Plaguebearer"; + u.dudes_num[3] = 250; + u.dudes[4] = "Pink Horror"; + u.dudes_num[4] = 250; + u.dudes[5] = "Maulerfiend"; + u.dudes_num[5] = 2; + } + instance_deactivate_object(u); + } + // Large Daemon Army + if (threat == 6) { + u = instance_nearest(xxx + 40, 240, obj_enunit); + enemy_dudes = "2000"; + u.neww = 1; + + u.dudes[1] = "Greater Daemon of " + string(choose("Slaanesh", "Tzeentch", "Khorne", "Nurgle")); + if (slaa) { + u.dudes[1] = "Greater Daemon of Slaanesh"; + } + u.dudes_num[1] = 1; + u.dudes[2] = "Greater Daemon of " + string(choose("Slaanesh", "Tzeentch", "Khorne", "Nurgle")); + if (slaa) { + u.dudes[2] = "Greater Daemon of Slaanesh"; + } + u.dudes_num[2] = 1; + u.dudes[3] = "Greater Daemon of " + string(choose("Slaanesh", "Tzeentch", "Khorne", "Nurgle")); + if (slaa) { + u.dudes[3] = "Greater Daemon of Slaanesh"; + } + u.dudes_num[3] = 1; + u.dudes[4] = "Soul Grinder"; + u.dudes_num[4] = 1; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 30, 240, obj_enunit); + u.neww = 1; + u.dudes[1] = "Greater Daemon of " + string(choose("Slaanesh", "Tzeentch", "Khorne", "Nurgle")); + if (slaa) { + u.dudes[1] = "Greater Daemon of Slaanesh"; + } + u.dudes_num[1] = 1; + u.dudes[2] = "Greater Daemon of " + string(choose("Slaanesh", "Tzeentch", "Khorne", "Nurgle")); + if (slaa) { + u.dudes[2] = "Greater Daemon of Slaanesh"; + } + u.dudes_num[2] = 1; + u.dudes[3] = "Soul Grinder"; + u.dudes_num[3] = 1; + instance_deactivate_object(u); + + u = instance_nearest(xxx + 20, 240, obj_enunit); + if (slaa) { + u.dudes[1] = "Daemonette"; + u.dudes_num[1] = 2000; + u.dudes[2] = "Maulerfiend"; + u.dudes_num[2] = 3; + } else { + u.dudes[1] = "Bloodletter"; + u.dudes_num[1] = 500; + u.dudes[2] = "Daemonette"; + u.dudes_num[2] = 500; + u.dudes[3] = "Plaguebearer"; + u.dudes_num[3] = 500; + u.dudes[4] = "Pink Horror"; + u.dudes_num[4] = 500; + u.dudes[5] = "Maulerfiend"; + u.dudes_num[5] = 3; + } + instance_deactivate_object(u); + } + } + + // ** Necron Forces ** + if ((enemy == 13) && ((string_count("_attack", battle_special) == 0) || (string_count("wake", battle_special) > 0))) { + // Small Necron Group + if (threat == 1) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "11"; + + u.dudes[1] = "Necron Destroyer"; + u.dudes_num[1] = 1; + enemies[1] = u.dudes[1]; + u.dudes[2] = "Necron Warrior"; + u.dudes_num[2] = 10; + enemies[2] = u.dudes[2]; + } + // Medium Necron Group + if (threat == 2) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "54"; + + u.dudes[1] = "Necron Destroyer"; + u.dudes_num[1] = 1; + u.dudes[2] = "Necron Warrior"; + u.dudes_num[2] = 20; + u.dudes[3] = "Necron Immortal"; + u.dudes_num[3] = 10; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Necron Warrior"; + u.dudes_num[1] = 20; + u.dudes[2] = "Canoptek Spyder"; + u.dudes_num[2] = 3; + } + // Large Necron Group + if (threat == 3) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "110"; + + u.dudes[1] = "Necron Overlord"; + u.dudes_num[1] = 1; + u.dudes[2] = "Necron Destroyer"; + u.dudes_num[2] = 3; + u.dudes[3] = "Lychguard"; + u.dudes_num[3] = 5; + u.dudes[4] = "Necron Warrior"; + u.dudes_num[4] = 100; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Canoptek Spyder"; + u.dudes_num[1] = 6; + u.dudes[2] = "Canoptek Scarab"; + u.dudes_num[2] = 120; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Doomsday Arc"; + u.dudes_num[1] = 2; + u.dudes[2] = "Monolith"; + u.dudes_num[2] = 1; + } + // Small Necron Army + if (threat == 4) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "290"; + + u.dudes[1] = "Necron Overlord"; + u.dudes_num[1] = 1; + u.dudes[2] = "Necron Destroyer"; + u.dudes_num[2] = 6; + u.dudes[3] = "Lychguard"; + u.dudes_num[3] = 10; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Necron Warrior"; + u.dudes_num[1] = 250; + u.dudes[2] = "Necron Immortal"; + u.dudes_num[2] = 20; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Canoptek Spyder"; + u.dudes_num[1] = 6; + u.dudes[2] = "Canoptek Scarab"; + u.dudes_num[2] = 120; + u.dudes[3] = "Tomb Stalker"; + u.dudes_num[3] = 1; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 30, 240, obj_enunit); + u.dudes[1] = "Doomsday Arc"; + u.dudes_num[1] = 2; + u.dudes[2] = "Monolith"; + u.dudes_num[2] = 1; + + u = instance_create(0, 240, obj_enunit); + u.dudes[1] = "Necron Wraith"; + u.dudes_num[1] = 6; + u.flank = 1; + } + // Medium Necron Army + if (threat == 5) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "700"; + + u.dudes[1] = "Necron Overlord"; + u.dudes_num[1] = 1; + u.dudes[2] = "Necron Destroyer"; + u.dudes_num[2] = 12; + u.dudes[3] = "Lychguard"; + u.dudes_num[3] = 20; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Necron Warrior"; + u.dudes_num[1] = 600; + u.dudes[2] = "Necron Immortal"; + u.dudes_num[2] = 40; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Canoptek Spyder"; + u.dudes_num[1] = 12; + u.dudes[2] = "Canoptek Scarab"; + u.dudes_num[2] = 240; + u.dudes[3] = "Tomb Stalker"; + u.dudes_num[3] = 2; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 30, 240, obj_enunit); + u.dudes[1] = "Doomsday Arc"; + u.dudes_num[1] = 4; + u.dudes[2] = "Monolith"; + u.dudes_num[2] = 2; + u.dudes[3] = "Necron Destroyer"; + u.dudes_num[3] = 12; + + u = instance_create(0, 240, obj_enunit); + u.dudes[1] = "Necron Wraith"; + u.dudes_num[1] = 12; + u.flank = 1; + } + // Large Necron Army + if (threat == 6) { + u = instance_nearest(xxx, 240, obj_enunit); + enemy_dudes = "1000"; + + u.dudes[1] = "Necron Overlord"; + u.dudes_num[1] = 2; + u.dudes[2] = "Necron Destroyer"; + u.dudes_num[2] = 20; + u.dudes[3] = "Lychguard"; + u.dudes_num[3] = 40; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 10, 240, obj_enunit); + u.dudes[1] = "Necron Warrior"; + u.dudes_num[1] = 800; + u.dudes[2] = "Necron Immortal"; + u.dudes_num[2] = 50; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 20, 240, obj_enunit); + u.dudes[1] = "Canoptek Spyder"; + u.dudes_num[1] = 16; + u.dudes[2] = "Canoptek Scarab"; + u.dudes_num[2] = 320; + u.dudes[3] = "Tomb Stalker"; + u.dudes_num[3] = 3; + + instance_deactivate_object(u); + u = instance_nearest(xxx + 30, 240, obj_enunit); + u.dudes[1] = "Doomsday Arc"; + u.dudes_num[1] = 6; + u.dudes[2] = "Monolith"; + u.dudes_num[2] = 2; + u.dudes[3] = "Necron Destroyer"; + u.dudes_num[3] = 20; + + u = instance_create(0, 240, obj_enunit); + u.dudes[1] = "Necron Wraith"; + u.dudes_num[1] = 24; + u.flank = 1; + } + } + + // ** Set up player defenses ** + if (player_defenses + player_silos > 0) { + u = instance_create(-50, 240, obj_pnunit); + u.defenses = 1; + + for (var i = 1; i <= 3; i++) { + u.veh_co[i] = 0; + u.veh_id[i] = 0; + u.veh_type[i] = "Defenses"; + u.veh_hp[i] = 1000; + u.veh_ac[i] = 1000; + u.veh_dead[i] = 0; + } + + u.veh_wep1[1] = "Heavy Bolter Emplacement"; + u.veh_wep1[2] = "Missile Launcher Emplacement"; + u.veh_wep1[3] = "Missile Silo"; + u.veh = 3; + u.sprite_index = spr_weapon_blank; + } + + instance_activate_object(obj_enunit); + } catch (_exception) { + handle_exception(_exception); + instance_destroy(obj_enunit); + instance_destroy(obj_pnunit); + instance_destroy(obj_ncombat); + } +} + +// alarm_1 +/// @mixin +function ncombat_battle_start() { + var a1; + a1 = ""; + + if ((ally > 0) && (ally_forces > 0)) { + if (ally == 3) { + if (ally_forces >= 1) { + a1 = "Joining your forces are 10 Techpriests and 20 Skitarii. Omnissian Power Axes come to life, crackling and popping with disruptive energy, and Conversion Beam Projectors are levelled to fire. The Tech-Guard are silent as they form a perimeter around their charges, at contrast with their loud litanies and Lingua-technis bursts."; + } + } + } + + // Player crap here + var p1, p2, p3, p4, p5, p6, p8, temp, temp2, temp3, temp4, temp5, temp6; + p1 = ""; + p2 = ""; + p3 = ""; + p4 = ""; + p5 = ""; + p6 = ""; + p8 = ""; + temp = 0; + temp2 = 0; + temp3 = 0; + temp4 = 0; + temp5 = 0; + temp6 = 0; + var d1, d2, d3, d4, d5, d6, d7, d8; + d1 = ""; + d2 = ""; + d3 = ""; + d4 = ""; + d5 = ""; + d6 = ""; + d7 = ""; + d8 = ""; + + temp = scouts + tacticals + veterans + devastators + assaults + librarians; + temp += techmarines + honors + dreadnoughts + terminators + captains; + temp += standard_bearers + champions + important_dudes + chaplains + apothecaries; + temp += sgts + vet_sgts; + + var color_descr; + color_descr = ""; + + if (obj_ini.main_color != obj_ini.secondary_color) { + color_descr = string(obj_controller.col[obj_ini.main_color]) + " and " + string(obj_controller.col[obj_ini.secondary_color]); + } + if (obj_ini.main_color == obj_ini.secondary_color) { + color_descr = string(obj_controller.col[obj_ini.main_color]); + } + + /*show_message(scouts+tacticals+veterans+devastators+assaults+librarians); + show_message(techmarines+honors+dreadnoughts+terminators+captains); + show_message(standard_bearers+important_dudes+chaplains+apothecaries); + show_message(temp);*/ + + // Random variations; dark out, rain pooling down, dawn shining off of the armour, etc. + var variation; + variation = ""; + variation = choose("", "dawn", "rain"); + + if (battle_special == "ship_demon") { + p1 = "As the Artifact is smashed and melted down some foul smoke begins to erupt from it, spilling outward and upward. After a sparse handful of seconds it takes form into a "; + p1 += string(obj_enunit.dudes[1]); + p1 += ". Now free, it seems bent upon slaying your marines. Onboard you have "; + } + + if ((battle_special == "ruins") || (battle_special == "ruins_eldar")) { + p1 = "Your marines place themselves into a proper fighting position, defensible and ready to fight whatever may come. Enemies may only come from a few directions, though the ancient corridors and alleyways are massive, and provide little cover."; + p1 += " You have "; + } + + if (string_count("mech", battle_special) > 0) { + p1 = "Large, hulking shapes advance upon your men from every direction. The metal corridors and blast chambers prevent escape. Soon 4 Thallax and half a dozen Praetorian Servitors can be seen, with undoubtably more to come."; + p1 += " You have "; + } + + if (battle_special == "space_hulk") { + if (hulk_forces > 0) { + p1 = "Your marines manuever through the hull of the Space Hulk, shadows dancing and twisting before their luxcasters. The hallway integrity is nonexistant- twisted metal juts out in hazardous ways or opens into bottomless pits. Still, there is loot and knowledge to be gained. It is not long before your men's sensorium pick up hostile blips. Your own forces are made up of "; + } + if (hulk_forces == 0) { + p1 = "Your marines manuever through the hull of the Space Hulk, shadows dancing and twisting before their luxcasters. The hallway integrity is nonexistant- twisted metal juts out in hazardous ways or opens into bottomless pits. Your forces are made up of "; + } + } + + if (battle_special == "") { + if (dropping == 0) { + if (temp - dreadnoughts > 0) { + if (variation == "") { + p1 = "Dirt crunches beneath the soles of " + string(temp) + " " + string(global.chapter_name) + " as they form up. Your ranks are made up of "; + } + if (variation == "rain") { + p1 = "Rain pelts the ground and fogs the air, partly veiling the " + string(temp) + " " + string(global.chapter_name) + ". Your ranks are made up of "; + } + if (variation == "dawn") { + p1 = "The bright light of dawn reflects off the " + string_lower(color_descr) + " ceremite of " + string(temp) + " " + string(global.chapter_name) + ". Your ranks are made up of "; + } + } + } + if (dropping == 1) { + if (temp - dreadnoughts > 0) { + // lyman + p1 = "The air rumbles and quakes as " + string(temp) + " " + string(global.chapter_name) + " descend in drop-pods. "; + + /*if (variation=""){ + if (lyman=0) then p1="The air rumbles and quakes as "+string(temp)+" "+string(global.chapter_name)+" descend in drop-pods. Before the enemy can bring their full ranged power to bear the pods smash down. With practiced speed your marines pour on free. Their ranks are made up of "; + if (lyman=1) then p1="The air rumbles and quakes as "+string(temp)+" "+string(global.chapter_name)+" descend in drop-pods. Before the enemy can bring their full ranged power to bear the pods smash down. Your marines exit the vehicles, shaking off their vertigo and nausea with varying degrees of success. Your ranks are made up of "; + } + */ + } + } + } + if (string_count("spyrer", battle_special) > 0) { + p1 = "Your marines search through the alleyways and corridors likely to contain the Spyrer. It does not take long before the lunatic attacks, springing off from a wall to fall among your men. Your ranks are made up of "; + } + if (string_count("fallen", battle_special) > 0) { + p1 = "Your marines search through the alleyways and dens likely to contain the Fallen. Several days pass before the search is succesful; the prey is located by Auspex and closed in upon. "; + if (battle_climate == "Lava") { + p1 = "Your marines search through the broken craggs and spires of the molten planet. Among the bubbling lava, and cracking earth, they search for the Fallen. After several days of searching Auspex detect the prey. "; + } + if (battle_climate == "Dead") { + p1 = "Your marines search through the cratered surface of the debris field. Among the cracking earth and dust they search for the Fallen. After several days of searching Auspex detect the prey. "; + } + if (battle_climate == "Agri") { + p1 = "Endless fields of wheat and barley are an unlikely harbor for a renegade, but your marines search the agri world all the same. After several days of searching Auspex detect the prey. "; + } + if (battle_climate == "Death") { + p1 = "Deadly carniverous plants and endless canopy blot out the surface of the planet. Among the disheveled hills, and heavy underbrush, your marines search for the Fallen. After several days of searching Auspex detect the prey. "; + } + if (battle_climate == "Ice") { + p1 = "Your marines search through the endless glaciers and peaks of the frozen planet. Among the howling wind, and cracking ice, they search for the Fallen. After several days of searching Auspex detect the prey. "; + } + if (obj_enunit.dudes_num[1] == 1) { + p1 += "The coward soon realizes he has been located, and reacts like a cornered animal, brandishing weapons."; + } + if (obj_enunit.dudes_num[1] > 1) { + p1 += "The cowards soon realize they have been located, and react like cornered animals, brandishing weapons."; + } + p1 += " Your ranks are made up of "; + } + + if (string_count("_attack", battle_special) > 0) { + var wh; + wh = choose(1, 2); + if (wh == 1) { + p1 = "Cave dirt crunches beneath the soles of your marines as they continue their descent. There is little warning before "; + } + if (wh == 2) { + p1 = "The shadows stretch and morph as the lights cast by your marines move along. One large shadow begins to move on its own- "; + } + + if (string_count("wake", battle_special) > 0) { + p1 = "Cave dirt crunches beneath the soles of your marines as they continue their descent. There is little warning when the ground begins to shake. An old, dusty breeze seems to flow through the tunnel, followed by rumbling sensations and distant mechanical sounds. "; + if (string_count("1", battle_special) > 0) { + p1 += "Within minutes Necrons begin to appear from every direction. There appears to be nearly fourty, cramped in the dark tunnels."; + } + if (string_count("2", battle_special) > 0) { + p1 += "Within minutes Necrons begin to appear from every direction. There appears to be nearly a hundred, cramped in the dark tunnels."; + } + if (string_count("3", battle_special) > 0) { + p1 += "Within minutes Necrons begin to appear from every direction. Their numbers are wihout number."; + } + } + + if (string_count("wraith", battle_special) > 0) { + p1 += "two Necron Wraiths appear out of nowhere and begin to attack."; + } + if (string_count("spyder", battle_special) > 0) { + p1 += "a large Canoptek Spyder launches towards your marines, a small group of scuttling Scarabs quickly following."; + } + if (string_count("stalker", battle_special) > 0) { + p1 += "the tunnel begins to shake and a massive Tomb Stalker scuttles into your midst."; + } + newline = p1; + scr_newtext(); + exit; + } + + if ((tacticals > 0) && (veterans > 0)) { + p2 = string(tacticals + veterans) + " " + string(obj_ini.role[100][8]) + "s, "; + } + if ((tacticals > 0) && (veterans == 0)) { + if (tacticals == 1) { + p2 = string(tacticals) + " " + string(obj_ini.role[100][8]) + ", "; + } + if (tacticals > 1) { + p2 = string(tacticals) + " " + string(obj_ini.role[100][8]) + "s, "; + } + } + if ((tacticals == 0) && (veterans > 0)) { + if (veterans == 1) { + p2 = string(veterans) + " " + string(obj_ini.role[100][3]) + ", "; + } + if (veterans > 1) { + p2 = string(veterans) + " " + string(obj_ini.role[100][3]) + "s, "; + } + } + + if (assaults > 0) { + if (assaults == 1) { + p2 += string(assaults) + " " + string(obj_ini.role[100][10]) + ", "; + } + if (assaults > 1) { + p2 += string(assaults) + " " + string(obj_ini.role[100][10]) + "s, "; + } + } + if (devastators > 0) { + if (devastators == 1) { + p2 += string(devastators) + " " + string(obj_ini.role[100][9]) + ", "; + } + if (devastators > 1) { + p2 += string(devastators) + " " + string(obj_ini.role[100][9]) + "s, "; + } + } + + if ((temp < 200) && (terminators > 0)) { + if (terminators == 1) { + p2 += string(terminators) + " Terminator, "; + } + if (terminators > 1) { + p2 += string(terminators) + " Terminators, "; + } + } + + if ((temp < 200) && (chaplains > 0)) { + if (chaplains == 1) { + p2 += string(chaplains) + " " + string(obj_ini.role[100][14]) + ", "; + } + if (chaplains > 1) { + p2 += string(chaplains) + " " + string(obj_ini.role[100][14]) + ", "; + } + } + + if ((temp < 200) && (apothecaries > 0)) { + if (apothecaries == 1) { + p2 += string(apothecaries) + " " + string(obj_ini.role[100][15]) + ", "; + } + if (apothecaries > 1) { + p2 += string(apothecaries) + " " + string(obj_ini.role[100][15]) + ", "; + } + } + + if ((temp < 200) && (librarians > 0)) { + if (librarians == 1) { + p2 += string(librarians) + " " + string(obj_ini.role[100, 17]) + ", "; + } + if (librarians > 1) { + p2 += string(librarians) + " " + string(obj_ini.role[100, 17]) + ", "; + } + } + + if ((temp < 200) && (techmarines > 0)) { + if (techmarines == 1) { + p2 += string(techmarines) + " " + string(obj_ini.role[100][16]) + ", "; + } + if (techmarines > 1) { + p2 += string(techmarines) + " " + string(obj_ini.role[100][16]) + ", "; + } + } + if ((temp < 200) && (sgts > 0)) { + if (techmarines == 1) { + p2 += string(techmarines) + " " + string(obj_ini.role[100][18]) + ", "; + } + if (techmarines > 1) { + p2 += string(techmarines) + " " + string(obj_ini.role[100][18]) + ", "; + } + } + if ((temp < 200) && (vet_sgts > 0)) { + if (techmarines == 1) { + p2 += string(techmarines) + " " + string(obj_ini.role[100][19]) + ", "; + } + if (techmarines > 1) { + p2 += string(techmarines) + " " + string(obj_ini.role[100][19]) + ", "; + } + } + + if (scouts > 0) { + if (scouts == 1) { + p2 += string(scouts) + " " + string(obj_ini.role[100][12]) + ", "; + } + if (scouts > 1) { + p2 += string(scouts) + " " + string(obj_ini.role[100][12]) + "s, "; + } + } + + // temp5=string_length(p2);p2=string_delete(p2,temp5-1,2);// p2+="."; + temp6 = honors + captains + important_dudes + standard_bearers; + if (temp >= 200) { + temp6 += terminators; + } + if (temp >= 200) { + temp6 += chaplains; + } + if (temp >= 200) { + temp6 += apothecaries; + } + if (temp >= 200) { + temp6 += techmarines; + } + if (temp >= 200) { + temp6 += librarians; + } + if (temp6 > 0) { + p2 += string(temp6) + " other various Astartes, "; + } + + var woo; + woo = string_length(p2); + p2 = string_delete(p2, woo - 1, 2); + + if (string_count(", ", p2) > 1) { + var woo; + woo = string_rpos(", ", p2); + p2 = string_insert(" and", p2, woo + 1); + } + if (string_count(", ", p2) == 1) { + var woo; + woo = string_rpos(", ", p2); + p2 = string_delete(p2, woo - 1, 2); + p2 = string_insert(" and", p2, woo + 1); + } + p2 += "."; + + if ((standard_bearers > 1) && (dropping == 0)) { + p5 = " Chapter Ancients hold your Chapter heraldry high and proud."; + } + + if (dreadnoughts + predators + land_raiders > 3) { + p6 = " Forming up the armoured division is "; + if (dreadnoughts == 1) { + p6 += string(dreadnoughts) + " " + string(obj_ini.role[100][6]) + ", "; + } + if (dreadnoughts > 1) { + p6 += string(dreadnoughts) + " " + string(obj_ini.role[100][6]) + "s, "; + } + + if (rhinos == 1) { + p6 += string(rhinos) + " Rhino, "; + } + if (rhinos > 1) { + p6 += string(rhinos) + " Rhinos, "; + } + + if (predators == 1) { + p6 += string(predators) + " Predator, "; + } + if (predators > 1) { + p6 += string(predators) + " Predators, "; + } + + if (land_raiders == 1) { + p6 += string(land_raiders) + " Land Raider, "; + } + if (land_raiders > 1) { + p6 += string(land_raiders) + " Land Raiders, "; + } + + if (land_speeders == 1) { + p6 += string(land_speeders) + " Land Speeder, "; + } + if (land_speeders > 1) { + p6 += string(land_speeders) + " Land Speeders, "; + } + + if (whirlwinds == 1) { + p6 += string(whirlwinds) + " Whirlwind, "; + } + if (whirlwinds > 1) { + p6 += string(whirlwinds) + " Whirlwinds, "; + } + + // Other vehicles here? + + var woo; + woo = string_length(p6); + p6 = string_delete(p6, woo - 1, 2); + + if (string_count(", ", p6) > 1) { + var woo; + woo = string_rpos(", ", p6); + p6 = string_insert(" and", p6, woo + 1); + } + if (string_count(", ", p6) == 1) { + var woo; + woo = string_rpos(", ", p6); + p6 = string_delete(p6, woo - 1, 2); + p6 = string_insert(" and", p6, woo + 1); + } + p6 += "."; + } + // If less than three spell out the individual vehicles + + if (battle_special == "space_hulk") { + newline = p1 + p2; + scr_newtext(); + if (a1 != "") { + newline = a1; + scr_newtext(); + } + if (hulk_forces > 0) { + newline = "There are " + string(hulk_forces) + " or so blips."; + scr_newtext(); + } + + exit; + } + if (dropping == 0) { + newline = p1 + p2 + p3 + p4 + p5 + p6; + scr_newtext(); + if (a1 != "") { + newline = a1; + scr_newtext(); + } + } + + if ((dropping == 1) && (battle_special != "space_hulk")) { + d1 = p1; + d2 = p2; + d3 = p3; + d4 = p4; + d5 = p5; + d6 = p6; + } + + if ((battle_special == "ruins") || (battle_special == "ruins_eldar")) { + newline = "The enemy forces are made up of " + string(enemy_dudes); + + if (enemy == 6) { + newline += " Craftworld Eldar."; + } + if (enemy == 10) { + newline += " Cultists and Mutants."; + } + if (enemy == 11) { + newline += " Chaos Space Marines."; + } + if (enemy == 12) { + newline += " Daemons."; + } + + scr_newtext(); + exit; + } + + // Enemy crap here + var rand; + p1 = ""; + p2 = ""; + p3 = ""; + p4 = ""; + p5 = ""; + p6 = ""; + temp2 = 0; + temp3 = 0; + temp4 = 0; + temp5 = 0; + + /*if (terrain=""){rand=choose(1,2,3);// Variations for terrain + if (rand<4) then + // if (rand=2) then p1="Encroaching upon your forces are "; + // if (rand=3) then p1="Advancing upon your forces are "; + } + + // p1+=string(enemy_dudes);// The number descriptor*/ + + if (enemy == 2) { + p1 = "Opposing your forces are a total of " + scr_display_number(floor(guard_effective)) + " Guardsmen, including Heavy Weapons and Armour."; + p2 = ""; + p3 = ""; + } + + if ((enemy == 5) && (dropping == 0)) { + p1 = "Marching to face your forces "; + if (threat == 1) { + p2 = "are a squad of Adepta Sororitas, back up by a dozen priests. Forming up a protective shield around them are a large group of religious followers, gnashing and screaming out litanies to the Emperor."; + } + if (threat == 2) { + p2 = "are several squads of Adepta Sororitas. A large pack of religious followers forms up a protective shield in front, backed up by numerous Acro-Flagellents."; + } + if (threat == 3) { + p2 = "are more than four hundred Adepta Sororitas, thick clouds of incense and smoke heralding their advance. An equally massive pack of religious followers are spread around, screaming and babbling hyms to the Emperor. Many are already bleeding from self-inflicted wounds or flagellation. Several Penitent Engines clank and advance in the forefront."; + } + if (threat == 4) { + p2 = "are more than a thousand Adepta Sororitas, a large portion of an order, thick clouds of incense and smoke heralding their advance. A massive pack of religious followers are spread among the force, screaming and babbling hyms to the Emperor. Many are already bleeding from self-inflicted wounds or flagellation. Their voices are drowned out by the rumble of Penitent Engines and the loud vox-casters of Excorcists, blasting out litanies and organ music even more deafening volumes."; + } + if (threat >= 5) { + p2 = "is the entirety of an Adepta Sororitas order, the ground shaking beneath their combined thousands of footsteps. Forming a shield around them in a massive, massive pack of religious followers, screaming out or babbling hyms to the Emperor. All of the opposing army is a blurring, shifting mass of robes and ceremite, and sound, Ecclesiarchy Priests and Mistresses whipping the masses into more of a blood frenzy. Organ music and litanies blast from the many Exorcists, the sound deafening to those too close. Carried with the wind, and lingering in the air, is the heavy scent of promethium."; + } + } + + if ((enemy == 6) && (dropping == 0)) { + // p1+=" Eldar";// Need a few random descriptors here + rand = choose(1, 2, 3); + } + if ((enemy == 7) && (dropping == 0)) { + // p1+=" Orks"; + rand = choose(1, 2, 3); + if (rand < 4) { + p1 = "Howls and grunts ring from the surrounding terrain as the Orks announce their presence. "; + p2 = string(enemy_dudes) + ", the bloodthirsty horde advances toward your Marines, ecstatic in their anticipation of carnage. "; + p3 = p2; + p2 = string_delete(p2, 2, 999); + p3 = string_delete(p3, 1, 1); + p2 = string_upper(p2); // Capitalize the ENEMY DUDES first letter + } + } + if ((enemy == 7) && (dropping == 1)) { + p1 = "The " + string(enemy_dudes) + "-some Orks howl and roar at the oncoming marines. Many of the beasts fire their weapons, more or less spraying rounds aimlessly into the sky."; + } + + if ((enemy == 8) && (dropping == 0)) { + // p1+=" Tau"; + rand = choose(1, 2, 3); + } + if ((enemy == 9) && (dropping == 0)) { + // p1+=" Tyranids"; + rand = choose(1, 2, 3); + } + if ((enemy == 9) && (dropping == 1)) { + p1 = "The " + string(enemy_dudes) + "-some Tyranids hiss and chitter as your marines rain down. Blasts of acid and spikes fill the sky, but none seem to quite find their mark."; + } + + if ((enemy == 10) && (dropping == 0)) { + // p1+=" heretics"; + rand = choose(1, 2, 3); + } + + if ((enemy == 10) && (threat == 7)) { + rand = choose(1, 2); + if (rand == 1) { + p1 = "Laying before them is a hellish landscape, fitting for nightmares. Twisted, flesh-like spires reach for the sky, each containing a multitude of fanged maws or eyes. Lightning crackles through the red sky. "; + } + if (rand == 2) { + p1 = "Waiting for your marines is a twisted landscape. Mutated, fleshy spires reach for the sky. The ground itself is made up of choking purple ash, kicked up with each footstep, blocking vision. "; + } + p1 += "All that can be seen twists and shifts, as though looking through a massive, distorted lens. "; + p8 = "The enemy forces are made up of over 3000 lesser Daemons. Their front and rear ranks are made up of Maulerfiends and Soulgrinders, backed up by nearly a dozen Greater Daemons. Each of the four Chaos Gods are represented."; + } + + if ((enemy == 11) && (dropping == 0)) { + // p1+=" Chaos Space Marines"; + rand = choose(1, 2, 3); + } + + if ((enemy == 12) && (dropping == 0)) { + // Daemons + } + + if ((enemy == 13) && (dropping == 0)) { + rand = choose(1, 2, 3); + if (rand < 4) { + p1 = "Dirt crunches beneath the feet of the Necrons as they make their silent advance. "; + p2 = string(enemy_dudes) + ", the souless xeno advance toward your Marines, silent and pulsing with green energy. "; + p3 = p2; + p2 = string_delete(p2, 2, 999); + p3 = string_delete(p3, 1, 1); + p2 = string_upper(p2); // Capitalize the ENEMY DUDES first letter + } + } + + if (dropping == 0) { + newline = p1 + p2 + p3 + p4 + p5 + p6; + scr_newtext(); + if (a1 != "") { + newline = a1; + scr_newtext(); + } + if (p8 != "") { + newline = p8; + scr_newtext(); + } + } + + if (dropping == 1) { + newline = d1 + p1; + scr_newtext(); + if (obj_ini.lyman == 0) { + d7 = "After a brief descent all of the drop-pods smash down, followed quickly by your marines pouring free. Their ranks are made up of "; + } + if (obj_ini.lyman == 1) { + d7 = "After a brief descent all of the drop-pods smash down. Your marines exit the vehicles, shaking off their vertigo and nausea with varying degrees of success. Their ranks are made up of "; + } + newline = d7 + d2 + d3 + d4 + d5 + d6; + scr_newtext(); + if (a1 != "") { + newline = a1; + scr_newtext(); + } + if (p8 != "") { + newline = p8; + scr_newtext(); + } + } + + if ((obj_ini.occulobe) && (battle_special != "space_hulk")) { + if ((time == 5) || (time == 6)) { + newline = "The morning light of dawn is blinding your marines!"; + newline_color = "red"; + scr_newtext(); + } + } + + if ((fortified > 1) && (dropping == 0) && (enemy + threat != 17)) { + if (fortified == 2) { + newline = "An Aegis Defense Line protects your forces."; + } + if (fortified == 3) { + newline = "Thick plasteel walls protect your forces."; + } + if (fortified == 4) { + newline = "A series of thick plasteel walls protect your forces."; + } + if (fortified >= 5) { + newline = "A massive plasteel bastion protects your forces."; + } + + if ((player_defenses > 0) && (player_silos > 0)) { + newline += " The front of your Monastery also boasts " + string(player_defenses) + " Weapon Emplacements and " + string(player_silos) + " Missile Silos."; + } + if ((player_defenses == 0) && (player_silos > 0)) { + newline += " Your Monastery also boasts " + string(player_silos) + " Missile Silos."; + } + if ((player_defenses > 0) && (player_silos == 0)) { + newline += " The front of your Monastery also boasts " + string(player_defenses) + " Weapon Emplacements."; + } + + scr_newtext(); + } + + // Check for battlecry here + // if (temp>=100) and (threat>1) and (big_mofo!=10) and (dropping=0){ + if ((temp >= 100) && (threat > 1) && (big_mofo > 0) && (big_mofo < 10) && (dropping == 0)) { + p1 = ""; + p2 = ""; + p3 = ""; + p4 = ""; + p5 = ""; + p6 = ""; + temp4 = 0; + temp5 = 0; + + if (big_mofo == 1) { + p1 = "You "; + } + if (big_mofo == 2) { + p1 = "The Master of Sanctity "; + } + if (big_mofo == 3) { + p1 = "Chief " + string(obj_ini.role[100, 17]) + " "; + } + if (big_mofo == 5) { + p1 = "A Captain "; + } + if (big_mofo == 8) { + p1 = "A Chaplain "; + } + + var standard_cry; + standard_cry = 0; + if (global.chapter_name == "Salamanders") { + standard_cry = 1; + var rand; + rand = choose(1, 2, 3, 4, 5); + if ((rand == 1) && (big_mofo != 1)) { + p2 = "breaks the silence, begining the Chapter Battlecry-"; + } + if ((rand == 1) && (big_mofo == 1)) { + p2 = "break the silence, begining the Chapter Battlecry-"; + } + if ((rand == 2) && (big_mofo != 1)) { + p2 = "roars the first half of the Chapter Battlecry-"; + } + if ((rand == 2) && (big_mofo == 1)) { + p2 = "roar the first half of the Chapter Battlecry-"; + } + if ((rand == 3) && (big_mofo != 1)) { + p2 = "shouts the start of the Chapter Battlecry-"; + } + if ((rand == 3) && (big_mofo == 1)) { + p2 = "shout the start of the Chapter Battlecry-"; + } + if ((rand == 4) && (big_mofo != 1)) { + p2 = "calls out to your marines-"; + } + if ((rand == 4) && (big_mofo == 1)) { + p2 = "call out to your marines-"; + } + if ((rand == 5) && (big_mofo != 1)) { + p2 = "roars to your marines-"; + } + if ((rand == 5) && (big_mofo == 1)) { + p2 = "roar to your marines-"; + } + p3 = "''Into the fires of battle!''"; + if ((temp >= 100) && (temp < 200)) { + p4 = "Over a hundred Astartes roar in return, their voice one-"; + } + if ((temp >= 200) && (temp < 400)) { + p4 = "Several hundred Astartes roar in return, their voice one-"; + } + if ((temp >= 500) && (temp < 800)) { + p4 = "Your battle brothers echoe the cry, a massive sound felt more than heard-"; + } + if (temp > 800) { + p4 = "The sound is deafening as the " + string(global.chapter_name) + " shout in unison-"; + } + p5 = "''UNTO THE ANVIL OF WAR!''"; + newline = p1 + p2; + scr_newtext(); + newline = p3; + scr_newtext(); + newline = p4; + scr_newtext(); + newline = p5; + scr_newtext(); + } + if (obj_ini.battle_cry == "...") { + standard_cry = 1; + var rand; + rand = choose(1, 2, 3); + if ((rand == 1) && (big_mofo != 1)) { + p2 = "remains silent as the Chapter forms for battle-"; + } + if ((rand == 1) && (big_mofo == 1)) { + p2 = "remain silent as the Chapter forms for battle-"; + } + if ((rand == 2) && (big_mofo != 1)) { + p2 = "remains silent and issues orders to the Chapter for battle-"; + } + if ((rand == 2) && (big_mofo == 1)) { + p2 = "remain silent and issues orders to the Chapter for battle-"; + } + if ((rand == 3) && (big_mofo != 1)) { + p2 = "issues orders to the Chapter over Vox-"; + } + if ((rand == 3) && (big_mofo == 1)) { + p2 = "whisper to your brothers the plans for initial deployment over vox-"; + } + p3 = "''Sharp gestures and handsigns from officers direct the Marines''"; + if ((temp >= 100) && (temp < 200)) { + p4 = "Over a hundred Astartes nod in acknowledgement and move quickly-"; + } + if ((temp >= 200) && (temp < 400)) { + p4 = "Several hundred Astartes nod in acknowledgement and move swiftly-"; + } + if ((temp >= 500) && (temp < 800)) { + p4 = "Your battle brothers all nod in acknowledgement and move hastily-"; + } + if (temp > 800) { + p4 = "The fluidity is astounding as the " + string(global.chapter_name) + " move seamlessly into position ready for battle-"; + } + p5 = "''They stand ready to engage the enemy''"; + newline = p1 + p2; + scr_newtext(); + newline = p3; + scr_newtext(); + newline = p4; + scr_newtext(); + newline = p5; + scr_newtext(); + } + + // show_message(string(global.chapter_name)+"|"+string(global.custom)+"|"+string(standard_cry)); + + if ((global.chapter_name == "Iron Warriors") && (global.custom == 0)) { + standard_cry = 1; + var rand; + rand = choose(1, 2, 3, 4, 5); + if ((rand == 1) && (big_mofo != 1)) { + p2 = "breaks the silence, begining the Chapter Battlecry-"; + } + if ((rand == 1) && (big_mofo == 1)) { + p2 = "break the silence, begining the Chapter Battlecry-"; + } + if ((rand == 2) && (big_mofo != 1)) { + p2 = "roars the first half of the Chapter Battlecry-"; + } + if ((rand == 2) && (big_mofo == 1)) { + p2 = "roar the first half of the Chapter Battlecry-"; + } + if ((rand == 3) && (big_mofo != 1)) { + p2 = "shouts the start of the Chapter Battlecry-"; + } + if ((rand == 3) && (big_mofo == 1)) { + p2 = "shout the start of the Chapter Battlecry-"; + } + if ((rand == 4) && (big_mofo != 1)) { + p2 = "calls out to your marines-"; + } + if ((rand == 4) && (big_mofo == 1)) { + p2 = "call out to your marines-"; + } + if ((rand == 5) && (big_mofo != 1)) { + p2 = "roars to your marines-"; + } + if ((rand == 5) && (big_mofo == 1)) { + p2 = "roar to your marines-"; + } + p3 = "''Iron within!''"; + if ((temp >= 100) && (temp < 200)) { + p4 = "Over a hundred Astartes roar in return, their voice one-"; + } + if ((temp >= 200) && (temp < 400)) { + p4 = "Several hundred Astartes roar in return, their voice one-"; + } + if ((temp >= 500) && (temp < 800)) { + p4 = "Your battle brothers echoe the cry, a massive sound felt more than heard-"; + } + if (temp > 800) { + p4 = "The sound is deafening as the " + string(global.chapter_name) + " shout in unison-"; + } + p5 = "''IRON WITHOUT!''"; + newline = p1 + p2; + scr_newtext(); + newline = p3; + scr_newtext(); + newline = p4; + scr_newtext(); + newline = p5; + scr_newtext(); + } + + if (standard_cry == 0) { + standard_cry = 1; + var rand; + rand = choose(1, 2, 3, 4); + if (rand == 1) { + if (big_mofo != 1) { + p2 = "breaks "; + } + if (big_mofo == 1) { + p2 = "break "; + } + p2 += "the silence, calling out the Chapter Battlecry-"; + } + if (rand == 2) { + if (big_mofo != 1) { + p2 = "roars "; + } + if (big_mofo == 1) { + p2 = "roar "; + } + p2 += "the Chapter Battlecry-"; + } + if (rand == 3) { + if (big_mofo != 1) { + p2 = "shouts "; + } + if (big_mofo == 1) { + p2 = "shout "; + } + p2 += "the Chapter Battlecry-"; + } + if (rand == 4) { + if (big_mofo != 1) { + p2 = "roars "; + } + if (big_mofo == 1) { + p2 = "roar "; + } + p2 += "to your marines-"; + } + p3 = "''" + string(obj_ini.battle_cry) + "!''"; + if ((temp >= 100) && (temp < 200)) { + p4 = "Over a hundred Astartes echoe the cry or let out shouts of their own."; + } + if ((temp >= 200) && (temp < 400)) { + p4 = "Several hundred Astartes roar in return, echoing the cry."; + } + if ((temp >= 500) && (temp < 800)) { + p4 = "Your battle brothers echoe the cry, a massive sound felt more than heard."; + } + if ((temp > 800) && (rand >= 3)) { + p4 = "The sound is deafening as the " + string(global.chapter_name) + " add their voices."; + } + if ((temp > 800) && (rand <= 2)) { + p4 = "The sound is deafening as the " + string(global.chapter_name) + " return the cry and magnify it a thousand times."; + } + newline = p1 + p2; + scr_newtext(); + newline = p3; + scr_newtext(); + newline = p4; + scr_newtext(); + } + } + + var line_break = "------------------------------------------------------------------------------"; + newline = line_break; + scr_newtext(); + newline = line_break; + scr_newtext(); + + /* */ + /* */ +} + +// alarm_2 +/// @mixin +function ncombat_ally_init() { + player_max = player_forces; + enemy_max = enemy_forces; + + instance_activate_object(obj_enunit); + + if (dropping) { + squeeze_map_forces(); + } + + if ((ally > 0) && (ally_forces > 0)) { + if (ally == 3) { + if (ally_forces >= 1) { + var thata, ii, good; + thata = instance_nearest(0, 240, obj_pnunit); + ii = 0; + good = 0; + + //TODO refactor so that unit structs are created for ally forces + } + } + } + + instance_activate_object(obj_enunit); +} + +//alarm_5 +/// @mixin +function ncombat_battle_end() { + // Final Screen + var part1 = "", part2 = "", part3 = "", part4 = "", part9 = ""; + var part5 = "", part6 = "", part7 = "", part8 = "", part10 = ""; + battle_over = 1; + + var line_break = "------------------------------------------------------------------------------"; + // show_message("Final Deaths: "+string(final_marine_deaths)); + + if (turn_count >= 50) { + part1 = "Your forces make a fighting retreat \n"; + } + // check for wounded marines here to finish off, if defeated defending + var roles = obj_ini.role[100]; + var ground_mission = instance_exists(obj_ground_mission); + + with (obj_pnunit) { + after_battle_part1(); + } + + if (obj_ncombat.defeat == 0) { + marines_to_recover = ds_priority_create(); + vehicles_to_recover = ds_priority_create(); + + with (obj_pnunit) { + add_marines_to_recovery(); + add_vehicles_to_recovery(); + } + + while (!ds_priority_empty(marines_to_recover)) { + var _candidate = ds_priority_delete_max(marines_to_recover); + var _column_id = _candidate.column_id; + var _unit_id = _candidate.id; + var _unit = _candidate.unit; + var _unit_role = _unit.role(); + var _constitution_test_mod = _unit.hp() * -1; + var _constitution_test = global.character_tester.standard_test(_unit, "constitution", _constitution_test_mod); + + if (unit_recovery_score > 0) { + _unit.update_health(_constitution_test[1]); + _column_id.marine_dead[_unit_id] = false; + unit_recovery_score--; + units_saved_count++; + + if (!struct_exists(obj_ncombat.units_saved_counts, _unit_role)) { + obj_ncombat.units_saved_counts[$ _unit_role] = 1; + } else { + obj_ncombat.units_saved_counts[$ _unit_role]++; + } + continue; + } + + if (_unit.base_group == "astartes") { + if (!_unit.gene_seed_mutations[$ "membrane"]) { + var survival_mod = _unit.luck * -1; + survival_mod += _unit.hp() * -1; + + var survival_test = global.character_tester.standard_test(_unit, "constitution", survival_mod); + if (survival_test[0]) { + _column_id.marine_dead[_unit_id] = false; + injured++; + } + } + } + } + ds_priority_destroy(marines_to_recover); + + while (!ds_priority_empty(vehicles_to_recover)) { + var _candidate = ds_priority_delete_max(vehicles_to_recover); + var _column_id = _candidate.column_id; + var _vehicle_id = _candidate.id; + var _vehicle_type = _column_id.veh_type[_vehicle_id]; + + if (obj_controller.stc_bonus[3] == 4) { + var _survival_roll = 70 + _candidate.priority; + var _dice_roll = roll_dice(1, 100, "high"); + if ((_dice_roll >= _survival_roll) && (_column_id.veh_dead[_vehicle_id] != 2)) { + _column_id.veh_hp[_vehicle_id] = roll_dice(1, 10, "high"); + _column_id.veh_dead[_vehicle_id] = false; + vehicles_saved_count++; + + if (!struct_exists(obj_ncombat.vehicles_saved_counts, _vehicle_type)) { + obj_ncombat.vehicles_saved_counts[$ _vehicle_type] = 1; + } else { + obj_ncombat.vehicles_saved_counts[$ _vehicle_type]++; + } + continue; + } + } + + if (vehicle_recovery_score > 0) { + _column_id.veh_hp[_vehicle_id] = roll_dice(1, 10, "high"); + _column_id.veh_dead[_vehicle_id] = false; + vehicle_recovery_score -= _candidate.priority; + vehicles_saved_count++; + + if (!struct_exists(obj_ncombat.vehicles_saved_counts, _vehicle_type)) { + obj_ncombat.vehicles_saved_counts[$ _vehicle_type] = 1; + } else { + obj_ncombat.vehicles_saved_counts[$ _vehicle_type]++; + } + } + } + ds_priority_destroy(vehicles_to_recover); + } + + with (obj_pnunit) { + after_battle_part2(); + } + + var _total_deaths = final_marine_deaths + final_command_deaths; + var _total_injured = _total_deaths + injured + units_saved_count; + if (_total_injured > 0) { + newline = $"{string_plural_count("unit", _total_injured)} {smart_verb("was", _total_injured)} critically injured."; + newline_color = "red"; + scr_newtext(); + + if (units_saved_count > 0) { + var _units_saved_string = ""; + var _unit_roles = struct_get_names(units_saved_counts); + + for (var i = 0; i < array_length(_unit_roles); i++) { + var _unit_role = _unit_roles[i]; + var _saved_count = units_saved_counts[$ _unit_role]; + _units_saved_string += $"{string_plural_count(_unit_role, _saved_count)}"; + _units_saved_string += smart_delimeter_sign(_unit_roles, i, false); + } + + newline = $"{units_saved_count}x {smart_verb("was", units_saved_count)} saved by the {string_plural(roles[eROLE.Apothecary], apothecaries_alive)}. ({_units_saved_string})"; + scr_newtext(); + } + + if (injured > 0) { + newline = $"{injured}x survived thanks to the Sus-an Membrane."; + newline_color = "red"; + scr_newtext(); + } + + if (_total_deaths > 0) { + var _units_lost_string = ""; + var _unit_roles = struct_get_names(units_lost_counts); + for (var i = 0; i < array_length(_unit_roles); i++) { + var _unit_role = _unit_roles[i]; + var _lost_count = units_lost_counts[$ _unit_role]; + _units_lost_string += $"{string_plural_count(_unit_role, _lost_count)}"; + _units_lost_string += smart_delimeter_sign(_unit_roles, i, false); + } + newline += $"{_total_deaths} units succumbed to their wounds! ({_units_lost_string})"; + newline_color = "red"; + scr_newtext(); + } + + newline = " "; + scr_newtext(); + } + + if (ground_mission) { + if (apothecaries_alive < 0) { + obj_ground_mission.apothecary_present = apothecaries_alive; + } + } + + if (seed_lost > 0) { + if (obj_ini.doomed) { + newline = $"Chapter mutation prevents retrieving gene-seed. {seed_lost} gene-seed lost."; + scr_newtext(); + } else if (!apothecaries_alive) { + newline = $"No able-bodied {roles[eROLE.Apothecary]}. {seed_lost} gene-seed lost."; + scr_newtext(); + } else { + seed_saved = min(seed_harvestable, apothecaries_alive * 40); + newline = $"{seed_saved} gene-seed was recovered; {seed_lost - seed_harvestable} was lost due damage; {seed_harvestable - seed_saved} was left to rot;"; + scr_newtext(); + } + + if (seed_saved > 0) { + obj_controller.gene_seed += seed_saved; + } + + newline = " "; + scr_newtext(); + } + + if (lost_to_black_rage > 0) { + var voodoo = ""; + + if (lost_to_black_rage == 1) { + voodoo = "1 Battle Brother lost to the Black Rage."; + } else { + voodoo = string(lost_to_black_rage) + " Battle Brothers lost to the Black Rage."; + } + + newline = voodoo; + newline_color = "red"; + scr_newtext(); + newline = " "; + scr_newtext(); + } + + newline = " "; + scr_newtext(); + + var _total_damaged_count = vehicle_deaths + vehicles_saved_count; + if (_total_damaged_count > 0) { + newline = $"{string_plural_count("vehicle", _total_damaged_count)} {smart_verb("was", _total_damaged_count)} critically damaged during battle."; + newline_color = "red"; + scr_newtext(); + + if (vehicles_saved_count > 0) { + var _vehicles_saved_string = ""; + var _vehicle_types = struct_get_names(vehicles_saved_counts); + + for (var i = 0; i < array_length(_vehicle_types); i++) { + var _vehicle_type = _vehicle_types[i]; + var _saved_count = vehicles_saved_counts[$ _vehicle_type]; + _vehicles_saved_string += $"{string_plural_count(_vehicle_type, _saved_count)}"; + _vehicles_saved_string += smart_delimeter_sign(_vehicle_types, i, false); + } + + newline = $"{string_plural(roles[eROLE.Techmarine], techmarines_alive)} {smart_verb("was", techmarines_alive)} able to restore {vehicles_saved_count}. ({_vehicles_saved_string})"; + scr_newtext(); + } + + if (vehicle_deaths > 0) { + var _vehicles_lost_string = ""; + var _vehicle_types = struct_get_names(vehicles_lost_counts); + + for (var i = 0; i < array_length(_vehicle_types); i++) { + var _vehicle_type = _vehicle_types[i]; + var _lost_count = vehicles_lost_counts[$ _vehicle_type]; + _vehicles_lost_string += $"{string_plural_count(_vehicle_type, _lost_count)}"; + _vehicles_lost_string += smart_delimeter_sign(_vehicle_types, i, false); + } + + newline += $"{vehicle_deaths} {smart_verb("was", vehicle_deaths)} lost forever. ({_vehicles_lost_string})"; + newline_color = "red"; + scr_newtext(); + } + + newline = " "; + scr_newtext(); + } + + if (post_equipment_lost[1] != "") { + part6 = "Equipment Lost: "; + + part7 += arrays_to_string_with_counts(post_equipment_lost, post_equipments_lost, true, false); + if (ground_mission) { + part7 += " Some may be recoverable."; + } + newline = part6; + scr_newtext(); + newline = part7; + scr_newtext(); + newline = " "; + scr_newtext(); + } + + if (total_battle_exp_gain > 0) { + with (obj_pnunit) { + assemble_alive_units(); + } + average_battle_exp_gain = distribute_experience(end_alive_units, total_battle_exp_gain); // Due to cool alarm timer shitshow, I couldn't think of anything but to put it here. + newline = $"Each marine gained {average_battle_exp_gain} experience, reduced by their total experience."; + scr_newtext(); + + var _upgraded_librarians_count = array_length(upgraded_librarians); + if (_upgraded_librarians_count > 0) { + for (var i = 0; i < _upgraded_librarians_count; i++) { + if (i > 0) { + newline += ", "; + } + newline += $"{upgraded_librarians[i].name_role()}"; + } + newline += " learned new psychic powers after gaining enough experience."; + scr_newtext(); + } + + newline = " "; + scr_newtext(); + } + + if (ground_mission) { + obj_ground_mission.post_equipment_lost = post_equipment_lost; + obj_ground_mission.post_equipments_lost = post_equipments_lost; + } + + if (slime > 0) { + var slime_string = $"Faulty Mucranoid and other afflictions have caused damage to the equipment. {slime} Forge Points will be allocated for repairs."; + newline = slime_string; + newline_color = "red"; + scr_newtext(); + + newline = " "; + scr_newtext(); + } + + instance_activate_object(obj_star); + + var reduce_fortification = true; + if (battle_special == "tyranid_org") { + reduce_fortification = false; + } + if (string_count("_attack", battle_special) > 0) { + reduce_fortification = false; + } + if (battle_special == "ship_demon") { + reduce_fortification = false; + } + if (enemy + threat == 17) { + reduce_fortification = false; + } + if (battle_special == "ruins") { + reduce_fortification = false; + } + if (battle_special == "ruins_eldar") { + reduce_fortification = false; + } + if (battle_special == "fallen1") { + reduce_fortification = false; + } + if (battle_special == "fallen2") { + reduce_fortification = false; + } + if (battle_special == "study2a") { + reduce_fortification = false; + } + if (battle_special == "study2b") { + reduce_fortification = false; + } + + if ((fortified > 0) && (!instance_exists(obj_nfort)) && (reduce_fortification == true)) { + part9 = "Fortification level of " + string(battle_loc); + if (battle_id == 1) { + part9 += " I"; + } + if (battle_id == 2) { + part9 += " II"; + } + if (battle_id == 3) { + part9 += " III"; + } + if (battle_id == 4) { + part9 += " IV"; + } + if (battle_id == 5) { + part9 += " V"; + } + part9 += $" has decreased to {fortified - 1} ({fortified}-1)"; + newline = part9; + scr_newtext(); + battle_object.p_fortified[battle_id] -= 1; + } + + + if ((defeat == 0) && (battle_special == "space_hulk")) { + var enemy_power = 0, loot = 0, dicey = floor(random(100)) + 1, ex = 0; + + if (enemy == 7) { + enemy_power = battle_object.p_orks[battle_id]; + battle_object.p_orks[battle_id] -= 1; + } else if (enemy == 9) { + enemy_power = battle_object.p_tyranids[battle_id]; + battle_object.p_tyranids[battle_id] -= 1; + } else if (enemy == 10) { + enemy_power = battle_object.p_traitors[battle_id]; + battle_object.p_traitors[battle_id] -= 1; + } + + part10 = "Space Hulk Exploration at "; + ex = min(100, 100 - ((enemy_power - 1) * 20)); + part10 += string(ex) + "%"; + newline = part10; + if (ex == 100) { + newline_color = "red"; + } + scr_newtext(); + + if (scr_has_disadv("Shitty Luck")) { + dicey = dicey * 1.5; + } + // show_message("Roll Under: "+string(enemy_power*10)+", Roll: "+string(dicey)); + + if (dicey <= (enemy_power * 10)) { + loot = choose(1, 2, 3, 4); + if (enemy != 10) { + loot = choose(1, 1, 2, 3); + } + hulk_treasure = loot; + if (loot > 1) { + newline = "Valuable items recovered."; + } + if (loot == 1) { + newline = "Resources have been recovered."; + } + newline_color = "yellow"; + scr_newtext(); + } + } + + if (string_count("ruins", battle_special) > 0) { + if (defeat == 0) { + newline = "Ancient Ruins cleared."; + } + if (defeat == 1) { + newline = "Failed to clear Ancient Ruins."; + } + newline_color = "yellow"; + scr_newtext(); + } + + var reduce_power = true; + if (battle_special == "tyranid_org") { + reduce_power = false; + } + if (battle_special == "ship_demon") { + reduce_power = false; + } + if (string_count("_attack", battle_special) > 0) { + reduce_power = false; + } + if (string_count("ruins", battle_special) > 0) { + reduce_power = false; + } + if (battle_special == "space_hulk") { + reduce_power = false; + } + if (battle_special == "fallen1") { + reduce_power = false; + } + if (battle_special == "fallen2") { + reduce_power = false; + } + if (battle_special == "study2a") { + reduce_power = false; + } + if (battle_special == "study2b") { + reduce_power = false; + } + if ((defeat == 0) && (reduce_power == true)) { + var enemy_power, new_power, power_reduction, final_pow, requisition_reward; + enemy_power = 0; + new_power = 0; + power_reduction = 0; + requisition_reward = 0; + + if (enemy == 2) { + enemy_power = battle_object.p_guardsmen[battle_id]; + battle_object.p_guardsmen[battle_id] -= threat; + // if (threat=1) or (threat=2) then battle_object.p_guardsmen[battle_id]=0; + } + + if (enemy == 5) { + enemy_power = battle_object.p_sisters[battle_id]; + part10 = "Ecclesiarchy"; + } else if (enemy == 6) { + enemy_power = battle_object.p_eldar[battle_id]; + part10 = "Eldar"; + } else if (enemy == 7) { + enemy_power = battle_object.p_orks[battle_id]; + part10 = "Ork"; + } else if (enemy == 8) { + enemy_power = battle_object.p_tau[battle_id]; + part10 = "Tau"; + } else if (enemy == 9) { + enemy_power = battle_object.p_tyranids[battle_id]; + part10 = "Tyranid"; + } else if (enemy == 10) { + enemy_power = battle_object.p_traitors[battle_id]; + part10 = "Heretic"; + if (threat == 7) { + part10 = "Daemon"; + } + } else if (enemy == 11) { + enemy_power = battle_object.p_chaos[battle_id]; + part10 = "Chaos Space Marine"; + } else if (enemy == 13) { + enemy_power = battle_object.p_necrons[battle_id]; + part10 = "Necrons"; + } + + if (instance_exists(battle_object) && (enemy_power > 2)) { + if (awake_tomb_world(battle_object.p_feature[battle_id]) != 0) { + scr_gov_disp(battle_object.name, battle_id, floor(enemy_power / 2)); + } + } + + if (enemy != 2) { + if (dropping == true || defending == true) { + power_reduction = 1; + } else { + power_reduction = 2; + } + new_power = enemy_power - power_reduction; + new_power = max(new_power, 0); + + // Give some money for killing enemies? + var _quad_factor = 6; + requisition_reward = _quad_factor * sqr(threat); + obj_controller.requisition += requisition_reward; + + //(¿?) Ramps up threat/enemy presence in case enemy Type == "Daemon" (¿?) + //Does the inverse check/var assignment 10 lines above + if (part10 == "Daemon") { + new_power = 7; + } + if ((enemy == 9) && (new_power == 0)) { + var battle_planet = battle_id; + with (battle_object) { + var who_cleansed = "Tyranids"; + var who_return = ""; + var make_alert = true; + var planet_string = $"{name} {scr_roman(battle_planet)}"; + if (planet_feature_bool(p_feature[battle_planet], P_features.Gene_Stealer_Cult) == 1) { + who_cleansed = "Gene Stealer Cult"; + make_alert = true; + delete_features(p_feature[battle_planet], P_features.Gene_Stealer_Cult); + adjust_influence(eFACTION.Tyranids, -25, battle_planet); + } + if (make_alert) { + if (p_first[battle_planet] == 1) { + who_return = "your"; + p_owner[battle_planet] = eFACTION.Player; + } else if (p_first[battle_planet] == 3 || p_type[battle_planet] == "Forge") { + who_return = "mechanicus"; + obj_controller.disposition[3] += 10; + p_owner[battle_planet] = eFACTION.Mechanicus; + } else if (p_type[battle_planet] != "Dead") { + who_return = "the governor"; + if (who_cleansed == "tau") { + who_return = "a more suitable governer"; + } + p_owner[battle_planet] = eFACTION.Imperium; + } + dispo[battle_planet] += 10; + scr_event_log("", $"{who_cleansed} cleansed from {planet_string}", name); + scr_alert("green", "owner", $"{who_cleansed} cleansed from {planet_string}. Control returned to {who_return}", x, y); + if (dispo[battle_planet] >= 101) { + p_owner[battle_planet] = 1; + } + } + } + } + if ((enemy == 11) && (enemy_power != floor(enemy_power))) { + enemy_power = floor(enemy_power); + } + } + + if ((obj_controller.blood_debt == 1) && (defeat == 0) && enemy_power > 0) { + final_pow = min(enemy_power, 6) - 1; + if ((enemy == 6) || (enemy == 9) || (enemy == 11) || (enemy == 13)) { + obj_controller.penitent_turn = 0; + obj_controller.penitent_turnly = 0; + var penitent_crusade_chart = [25, 62, 95, 190, 375, 750]; + + final_pow = min(enemy_power, 6) - 1; + obj_controller.penitent_current += penitent_crusade_chart[final_pow]; + } else if ((enemy == 7) || (enemy == 8) || (enemy == 10)) { + obj_controller.penitent_turn = 0; + obj_controller.penitent_turnly = 0; + final_pow = min(enemy_power, 7) - 1; + var penitent_crusade_chart = [25, 50, 75, 150, 300, 600, 1500]; + obj_controller.penitent_current += penitent_crusade_chart[final_pow]; + } + } + + if (enemy == 5) { + battle_object.p_sisters[battle_id] = new_power; + } else if (enemy == 6) { + battle_object.p_eldar[battle_id] = new_power; + } else if (enemy == 7) { + battle_object.p_orks[battle_id] = new_power; + } else if (enemy == 8) { + battle_object.p_tau[battle_id] = new_power; + } else if (enemy == 9) { + battle_object.p_tyranids[battle_id] = new_power; + } else if (enemy == 10) { + battle_object.p_traitors[battle_id] = new_power; + } else if (enemy == 11) { + battle_object.p_chaos[battle_id] = new_power; + } else if (enemy == 13) { + battle_object.p_necrons[battle_id] = new_power; + } + + if ((enemy != 2) && (string_count("cs_meeting_battle", battle_special) == 0)) { + part10 += " forces on " + string(battle_loc); + if (battle_id == 1) { + part10 += " I"; + } + if (battle_id == 2) { + part10 += " II"; + } + if (battle_id == 3) { + part10 += " III"; + } + if (battle_id == 4) { + part10 += " IV"; + } + if (battle_id == 5) { + part10 += " V"; + } + if (new_power == 0) { + part10 += $" were completely wiped out. Previous power: {enemy_power}. Reduction: {power_reduction}."; + } else { + part10 += $" were reduced to {new_power} after this battle. Previous power: {enemy_power}. Reduction: {power_reduction}."; + } + newline = part10; + scr_newtext(); + part10 = $"Received {requisition_reward} requisition points as a reward for slaying enemies of the Imperium."; + newline = part10; + scr_newtext(); + + if ((new_power <= 0) && (enemy_power > 0)) { + battle_object.p_raided[battle_id] = 1; + } + } + if (enemy == 2) { + part10 += " Imperial Guard Forces on " + string(battle_loc); + if (battle_id == 1) { + part10 += " I"; + } + if (battle_id == 2) { + part10 += " II"; + } + if (battle_id == 3) { + part10 += " III"; + } + if (battle_id == 4) { + part10 += " IV"; + } + if (battle_id == 5) { + part10 += " V"; + } + part10 += " were reduced to " + string(battle_object.p_guardsmen[battle_id]) + " (" + string(enemy_power) + "-" + string(threat) + ")"; + newline = part10; + scr_newtext(); + } + + if ((enemy == 8) && (ethereal > 0) && (defeat == 0)) { + newline = "Tau Ethereal Captured"; + newline_color = "yellow"; + scr_newtext(); + } + + if ((enemy == 13) && (battle_object.p_necrons[battle_id] < 3) && (awake_tomb_world(battle_object.p_feature[battle_id]) == 1)) { + // var bombs;bombs=scr_check_equip("Plasma Bomb",battle_loc,battle_id,0); + // var bombs;bombs=scr_check_equip("Plasma Bomb","","",0); + + // show_message(string(bombs)); + + if (plasma_bomb > 0) { + // scr_check_equip("Plasma Bomb",battle_loc,battle_id,1); + // scr_check_equip("Plasma Bomb","","",1); + newline = "Plasma Bomb used to seal the Necron Tomb."; + newline_color = "yellow"; + scr_newtext(); + seal_tomb_world(battle_object.p_feature[battle_id]); + } + + if (plasma_bomb <= 0) { + battle_object.p_necrons[battle_id] = 3; // newline_color="yellow"; + if (dropping != 0) { + newline = "Deep Strike Ineffective; Plasma Bomb required"; + } + if (dropping == 0) { + newline = "Attack Ineffective; Plasma Bomb required"; + } + scr_newtext(); + } + + // popup here + /* + var pip; + pip=instance_create(0,0,obj_popup); + pip.title="Necron Tombs"; + pip.text="The Necrons have been defeated on the surface, but remain able to replenish their numbers and recuperate. Do you wish to advance your army into the tunnels?"; + pip.image="necron_tunnels_1"; + pip.cooldown=15; + cooldown=15; + + pip.option1="Advance!"; + pip.option2="Cancel the attack";*/ + } + + /*if (enemy=13) and (new_power<=0) and (dropping=0){ + var bombs;bombs=scr_check_equip("Plasma Bomb",battle_loc,battle_id,0); + if (bombs>0){ + scr_check_equip("Plasma Bomb",battle_loc,battle_id,1); + newline="Plasma Bomb used to seal the Necron Tomb.";newline_color="yellow";scr_newtext(); + if (battle_object.p_feature[battle_id]="Awakened Necron Tomb") then battle_object.p_feature[battle_id]="Necron Tomb"; + } + }*/ + } + + if ((defeat == 0) && (enemy == 9) && (battle_special == "tyranid_org")) { + // show_message(string(captured_gaunt)); + if (captured_gaunt == 1) { + newline = captured_gaunt + " Gaunt organism have been captured."; + } + if ((captured_gaunt > 1) || (captured_gaunt == 0)) { + newline = captured_gaunt + " Gaunt organisms have been captured."; + } + scr_newtext(); + + if (captured_gaunt > 0) { + var why, thatta; + why = 0; + thatta = 0; + instance_activate_object(obj_star); + // with(obj_star){if (name!=obj_ncombat.battle_loc) then instance_deactivate_object(id);} + // thatta=obj_star; + + with (obj_star) { + remove_star_problem("tyranid_org"); + } + } + + scr_event_log("", "Inquisition Mission Completed: A Gaunt organism has been captured for the Inquisition."); + + if (captured_gaunt > 1) { + if (instance_exists(obj_turn_end)) { + scr_popup("Inquisition Mission Completed", "You have captured several Gaunt organisms. The Inquisitor is pleased with your work, though she notes that only one is needed- the rest are to be purged. It will be stored until it may be retrieved. The mission is a success.", "inquisition", ""); + } + } + if (captured_gaunt == 1) { + if (instance_exists(obj_turn_end)) { + scr_popup("Inquisition Mission Completed", "You have captured a Gaunt organism- the Inquisitor is pleased with your work. The Tyranid will be stored until it may be retrieved. The mission is a success.", "inquisition", ""); + } + } + instance_deactivate_object(obj_star); + } + + newline = line_break; + scr_newtext(); + newline = line_break; + scr_newtext(); + + if ((leader || ((battle_special == "world_eaters") && (!obj_controller.faction_defeated[10]))) && (!defeat)) { + var nep; + nep = false; + newline = "The enemy Leader has been killed!"; + newline_color = "yellow"; + scr_newtext(); + newline = line_break; + scr_newtext(); + newline = line_break; + scr_newtext(); + instance_activate_object(obj_event_log); + if (enemy == 5) { + scr_event_log("", "Enemy Leader Assassinated: Ecclesiarchy Prioress"); + } + if (enemy == 6) { + scr_event_log("", "Enemy Leader Assassinated: Eldar Farseer"); + } + if (enemy == 7) { + scr_event_log("", "Enemy Leader Assassinated: Ork Warboss"); + if (Warlord != 0) { + with (Warlord) { + kill_warboss(); + } + } + } + if (enemy == 8) { + scr_event_log("", "Enemy Leader Assassinated: Tau Diplomat"); + } + if (enemy == 10) { + scr_event_log("", "Enemy Leader Assassinated: Chaos Lord"); + } + } + + var endline, inq_eated; + endline = 1; + inq_eated = false; + + if (obj_ini.omophagea) { + var eatme = floor(random(100)) + 1; + if ((enemy == 13) || (enemy == 9) || (battle_special == "ship_demon")) { + eatme += 100; + } + if ((enemy == 10) && (battle_object.p_traitors[battle_id] == 7)) { + eatme += 200; + } + + eatme -= lost_to_black_rage * 6; + + if (scr_has_disadv("Shitty Luck")) { + eatme -= 10; + } + + if (allies > 0) { + obj_controller.disposition[2] -= choose(1, 0, 0); + obj_controller.disposition[4] -= choose(0, 0, 1); + obj_controller.disposition[5] -= choose(0, 0, 1); + } + if (present_inquisitor > 0) { + obj_controller.disposition[4] -= 2; + } + + if (eatme <= 25) { + endline = 0; + if (lost_to_black_rage == 0) { + var ran; + ran = choose(1, 2); + newline = "One of your marines slowly makes his way towards the fallen enemies, as if in a spell. Once close enough the helmet is removed and he begins shoveling parts of their carcasses into his mouth."; + newline = "Two marines are sharing a quick discussion, and analysis of the battle, when one of the two suddenly drops down and begins shoveling parts of enemy corpses into his mouth."; + newline += choose(" Bone snaps and pops.", " Strange-colored blood squirts from between his teeth.", " Veins and tendons squish wetly."); + } + if (lost_to_black_rage > 0) { + var ran = choose(1, 2); + newline = "One of your Death Company marines slowly makes his way towards the fallen enemies, as if in a spell. Once close enough the helmet is removed and he begins shoveling parts of their carcasses into his mouth."; + newline = "A marine is observing and communicating with a Death Company marine, to ensure they are responsive, when that Death Company marine drops down and suddenly begins shoveling parts of enemy corpses into his mouth."; + newline += choose(" Bone snaps and pops.", " Strange-colored blood squirts from between his teeth.", " Veins and tendons squish wetly."); + } + // if (really_thirsty > 0) { + // newline = $"One of your Death Company {roles[6]} blitzes to the fallen enemy lines. Massive mechanical hands begin to rend and smash at the fallen corpses, trying to squeeze their flesh and blood through the sarcophogi opening."; + // } + + newline += " Almost at once most of the present " + string(global.chapter_name) + " follow suite, joining in and starting a massive feeding frenzy. The sight is gruesome to behold."; + scr_newtext(); + + // check for pdf/guardsmen + eatme = floor(random(100)) + 1; + if (scr_has_disadv("Shitty Luck")) { + eatme -= 10; + } + if ((eatme <= 10) && (allies > 0)) { + obj_controller.disposition[2] -= 2; + if (allies == 1) { + newline = "Local PDF have been eaten!"; + newline_color = "red"; + scr_newtext(); + } else if (allies == 2) { + newline = "Local Guardsmen have been eaten!"; + newline_color = "red"; + scr_newtext(); + } + } + + // check for inquisitor + eatme = floor(random(100)) + 1; + if (scr_has_disadv("Shitty Luck")) { + eatme -= 5; + } + if ((eatme <= 40) && (present_inquisitor == 1)) { + var thatta = 0, remove = 0, i = 0; + obj_controller.disposition[4] -= 10; + inq_eated = true; + instance_activate_object(obj_en_fleet); + + if (instance_exists(inquisitor_ship)) { + repeat (2) { + scr_loyalty("Inquisitor Killer", "+"); + } + if (obj_controller.loyalty >= 85) { + obj_controller.last_world_inspection -= 44; + } + if ((obj_controller.loyalty >= 70) && (obj_controller.loyalty < 85)) { + obj_controller.last_world_inspection -= 32; + } + if ((obj_controller.loyalty >= 50) && (obj_controller.loyalty < 70)) { + obj_controller.last_world_inspection -= 20; + } + if (obj_controller.loyalty < 50) { + scr_loyalty("Inquisitor Killer", "+"); + } + + var msg = "", msg2 = "", i = 0, remove = 0; + // if (string_count("Inqis",inquisitor_ship.trade_goods)>0) then show_message("B"); + if (inquisitor_ship.inquisitor > 0) { + var inquis_name = obj_controller.inquisitor[inquisitor_ship.inquisitor]; + newline = $"Inquisitor {inquis_name} has been eaten!"; + msg = $"Inquisitor {inquis_name}"; + remove = obj_controller.inquisitor[inquisitor_ship.inquisitor]; + scr_event_log("red", $"Your Astartes consume {msg}."); + } + newline_color = "red"; + scr_newtext(); + if (obj_controller.inquisitor_type[remove] == "Ordo Hereticus") { + scr_loyalty("Inquisitor Killer", "+"); + } + + i = remove; + repeat (10 - remove) { + if (i < 10) { + obj_controller.inquisitor_gender[i] = obj_controller.inquisitor_gender[i + 1]; + obj_controller.inquisitor_type[i] = obj_controller.inquisitor_type[i + 1]; + obj_controller.inquisitor[i] = obj_controller.inquisitor[i + 1]; + } + if (i == 10) { + obj_controller.inquisitor_gender[i] = choose(0, 0, 0, 1, 1, 1, 1); // 4:3 chance of male Inquisitor + obj_controller.inquisitor_type[i] = choose("Ordo Malleus", "Ordo Xenos", "Ordo Hereticus", "Ordo Hereticus", "Ordo Hereticus", "Ordo Hereticus", "Ordo Hereticus", "Ordo Hereticus"); + obj_controller.inquisitor[i] = global.name_generator.generate_imperial_name(obj_controller.inquisitor_gender[i]); // For 'random inquisitor wishes to inspect your fleet + } + i += 1; + } + + instance_activate_object(obj_turn_end); + if (obj_controller.known[eFACTION.Inquisition] < 3) { + scr_event_log("red", "EXCOMMUNICATUS TRAITORUS"); + obj_controller.alarm[8] = 1; + if (!instance_exists(obj_turn_end)) { + var pip = instance_create(0, 0, obj_popup); + pip.title = "Inquisitor Killed"; + pip.text = msg; + pip.image = "inquisition"; + pip.cooldown = 30; + pip.title = "EXCOMMUNICATUS TRAITORUS"; + pip.text = $"The Inquisition has noticed your uncalled CONSUMPTION of {msg} and declared your chapter Excommunicatus Traitorus."; + instance_deactivate_object(obj_popup); + } else { + scr_popup("Inquisitor Killed", $"The Inquisition has noticed your uncalled CONSUMPTION of {msg} and declared your chapter Excommunicatus Traitorus.", "inquisition", ""); + } + } + instance_deactivate_object(obj_turn_end); + + with (inquisitor_ship) { + instance_destroy(); + } + with (obj_ground_mission) { + instance_destroy(); + } + } + instance_deactivate_object(obj_star); + instance_deactivate_object(obj_en_fleet); + } + } + } + + if ((inq_eated == false) && (obj_ncombat.sorcery_seen >= 2)) { + scr_loyalty("Use of Sorcery", "+"); + newline = "Inquisitor " + string(obj_controller.inquisitor[1]) + " witnessed your Chapter using sorcery."; + scr_event_log("green", string(newline)); + scr_newtext(); + } + + if ((exterminatus > 0) && (dropping != 0)) { + newline = "Exterminatus has been succesfully placed."; + newline_color = "yellow"; + endline = 0; + scr_newtext(); + } + + instance_activate_object(obj_star); + instance_activate_object(obj_turn_end); + + //If not fleet based and... + if ((obj_ini.fleet_type != ePlayerBase.home_world) && (defeat == 1) && (dropping == 0)) { + var monastery_list = search_planet_features(battle_object.p_feature[obj_ncombat.battle_id], P_features.Monastery); + var monastery_count = array_length(monastery_list); + if (monastery_count > 0) { + for (var mon = 0; mon < monastery_count; mon++) { + battle_object.p_feature[obj_ncombat.battle_id][monastery_list[mon]].status = "destroyed"; + } + + if (obj_controller.und_gene_vaults == 0) { + 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) { + newline = "Your Fortress Monastery has been raided. " + string(floor(obj_controller.gene_seed / 10)) + " Gene-Seed has been destroyed or stolen."; + } + + scr_event_log("red", newline, battle_object.name); + instance_activate_object(obj_event_log); + newline_color = "red"; + scr_newtext(); + + var lasers_lost, defenses_lost, silos_lost; + lasers_lost = 0; + defenses_lost = 0; + silos_lost = 0; + + if (player_defenses > 0) { + defenses_lost = round(player_defenses * 0.75); + } + if (battle_object.p_silo[obj_ncombat.battle_id] > 0) { + silos_lost = round(battle_object.p_silo[obj_ncombat.battle_id] * 0.75); + } + if (battle_object.p_lasers[obj_ncombat.battle_id] > 0) { + lasers_lost = round(battle_object.p_lasers[obj_ncombat.battle_id] * 0.75); + } + + if (player_defenses < 30) { + defenses_lost = player_defenses; + } + if (battle_object.p_silo[obj_ncombat.battle_id] < 30) { + silos_lost = battle_object.p_silo[obj_ncombat.battle_id]; + } + if (battle_object.p_lasers[obj_ncombat.battle_id] < 8) { + lasers_lost = battle_object.p_lasers[obj_ncombat.battle_id]; + } + + var percent; + percent = 0; + newline = ""; + if (defenses_lost > 0) { + percent = round((defenses_lost / player_defenses) * 100); + newline = string(defenses_lost) + " Weapon Emplacements have been lost (" + string(percent) + "%)."; + } + if (silos_lost > 0) { + percent = round((silos_lost / battle_object.p_silo[obj_ncombat.battle_id]) * 100); + if (defenses_lost > 0) { + newline += " "; + } + newline += string(silos_lost) + $" Missile Silos have been lost ({percent}%)."; + } + if (lasers_lost > 0) { + percent = round((lasers_lost / battle_object.p_lasers[obj_ncombat.battle_id]) * 100); + if ((silos_lost > 0) || (defenses_lost > 0)) { + newline += " "; + } + newline += string(lasers_lost) + " Defense Lasers have been lost (" + string(percent) + "%)."; + } + + battle_object.p_defenses[obj_ncombat.battle_id] -= defenses_lost; + battle_object.p_silo[obj_ncombat.battle_id] -= silos_lost; + battle_object.p_lasers[obj_ncombat.battle_id] -= lasers_lost; + if (defenses_lost + silos_lost + lasers_lost > 0) { + newline_color = "red"; + scr_newtext(); + } + + endline = 0; + + if (obj_controller.und_gene_vaults == 0) { + //all Gene Pod Incubators and gene seed are lost + destroy_all_gene_slaves(false); + } + if (obj_controller.und_gene_vaults > 0) { + obj_controller.gene_seed -= floor(obj_controller.gene_seed / 10); + } + } + } + instance_deactivate_object(obj_star); + instance_deactivate_object(obj_turn_end); + + if (endline == 0) { + newline = line_break; + scr_newtext(); + newline = line_break; + scr_newtext(); + } + + if (defeat == 1) { + player_forces = 0; + if (ground_mission) { + obj_ground_mission.recoverable_gene_seed = seed_lost; + } + } + + gene_slaves = []; + + instance_deactivate_object(obj_star); + instance_deactivate_object(obj_ground_mission); + + show_debug_message($"{battle_stage}"); + /* */ + /* */ +} + +// alarm_7 +/// @mixin +function ncombat_special_battle() { + try { + // show_debug_message("alarm 7 start"); + audio_stop_sound(snd_battle); + audio_play_sound(snd_royal, 0, true); + audio_sound_gain(snd_royal, 0, 0); + var nope = 0; + if ((obj_controller.master_volume == 0) || (obj_controller.music_volume == 0)) { + nope = 1; + } + if (nope != 1) { + audio_sound_gain(snd_royal, 0.25 * obj_controller.master_volume * obj_controller.music_volume, 2000); + } + + // scr_dead_marines(1); + + // Execute the cleaning scripts + // Check for any more battles + + obj_controller.cooldown = 10; + + log_message($"Ground Combat - {defeat ? "Defeat" : "Victory"}Victory - Enemy:{enemy} ({battle_special})"); + + // If battling own dudes, then remove the loyalists after the fact + + if (enemy == 1) { + var j = -1; + var cleann = array_create(11, false); + with (obj_enunit) { + var q = 0; + repeat (700) { + q += 1; + if (dude_id[q] > 0) { + var commandy = false; + var nco = dude_co[q]; + var nid = dude_id[q]; + cleann[nco] = true; + + // show_message("dude ID:"+string(q)+" ("+string(obj_ini.name[nco,nid])+") is being removed from the array"); + + commandy = is_specialist(obj_ini.role[nco, nid]); + if (commandy == true) { + obj_controller.command -= 1; + } + if (commandy == false) { + obj_controller.marines -= 1; + } + + obj_ncombat.world_size += scr_unit_size(obj_ini.armour[nco][nid], obj_ini.role[nco][nid], true, obj_ini.mobi[nco][nid]); + + var recover = !obj_ncombat.defeat; + kill_and_recover(nco, nid, recover, recover); + } + } + } + + for (j = 0; j <= 10; j++) { + if (cleann[j]) { + with (obj_ini) { + scr_company_order(j); + } + } + } + } + if (string_count("cs_meeting", battle_special) > 0) { + with (obj_temp_meeting) { + instance_destroy(); + } + + with (obj_star) { + if (name == obj_ncombat.battle_loc) { + instance_create(x, y, obj_temp_meeting); + var i = 0, ii = 0, otm, good = 0, master_present = 0; + var run = 0, s = 0, chaos_meeting = 0; + + var master_index = array_get_index(obj_ini.role[0], "Chapter Master"); + chaos_meeting = fetch_unit([0, master_index]).planet_location; + + // show_message("meeting planet:"+string(chaos_meeting)); + for (var co = 0; co <= 10; co++) { + for (var i = 0; i < array_length(obj_ini.TTRPG[co]); i++) { + good = 0; + unit = fetch_unit([co, i]); + if (unit.role() == "" || obj_ini.loc[co][i] != name) { + continue; + } + if (unit.planet_location == floor(chaos_meeting)) { + good += 1; + } + if ((obj_ini.role[co][i] != obj_ini.role[100][6]) && (obj_ini.role[co][i] != "Venerable " + string(obj_ini.role[100][6]))) { + good += 1; + } + if ((string_count("Dread", obj_ini.armour[co][i]) == 0) || (obj_ini.role[co][i] == "Chapter Master")) { + good += 1; + } + + // if (good>=3) then show_message(string(obj_ini.role[co][i])+": "+string(co)+"."+string(i)); + + if (good >= 3) { + obj_temp_meeting.dudes += 1; + otm = obj_temp_meeting.dudes; + obj_temp_meeting.present[otm] = 1; + obj_temp_meeting.co[otm] = co; + obj_temp_meeting.ide[otm] = i; + if (obj_ini.role[co][i] == "Chapter Master") { + master_present = 1; + } + } + } + } + // show_message("obj_temp_meeting.dudes:"+string(obj_temp_meeting.dudes)); + } + } + } + + that = array_get_index(post_equipment_lost, "Company Standard"); + if (that != -1) { + repeat (post_equipments_lost[that]) { + scr_loyalty("Lost Standard", "+"); + } + } + + if (battle_special == "ruins" || battle_special == "ruins_eldar") { + obj_ground_mission.defeat = defeat; + obj_ground_mission.explore_feature.ruins_combat_end(); + } else if ((battle_special == "WL10_reveal") || (battle_special == "WL10_later")) { + var moar, ox, oy; + with (obj_temp8) { + instance_destroy(); + } + + if (chaos_angry >= 5) { + if (string_count("|CPF|", obj_controller.useful_info) == 0) { + obj_controller.useful_info += "|CPF|"; + } + } + + if (battle_special == "WL10_reveal") { + instance_create(battle_object.x, battle_object.y, obj_temp8); + ox = battle_object.x; + oy = battle_object.y; // battle_object.owner = eFACTION.Chaos; + battle_object.p_traitors[battle_id] = 6; + battle_object.p_chaos[battle_id] = 4; + battle_object.p_pdf[battle_id] = 0; + battle_object.p_owner[battle_id] = 10; + + var corro; + corro = 0; + + repeat (100) { + var ii; + ii = 0; + if (corro <= 5) { + moar = instance_nearest(ox, oy, obj_star); + + if (moar.owner <= 3) { + corro += 1; + repeat (4) { + ii += 1; + if (moar.p_owner[ii] <= 3) { + moar.p_heresy[ii] = min(100, moar.p_heresy[ii] + floor(random_range(30, 50))); + } + } + } + moar.y -= 20000; + } + } + with (obj_star) { + if (y < -12000) { + y += 20000; + } + } + + if (battle_object.present_fleet[2] > 0) { + with (obj_en_fleet) { + if ((navy == 0) && (owner == eFACTION.Imperium) && (point_distance(x, y, obj_temp8.x, obj_temp8.y) < 40)) { + owner = eFACTION.Chaos; + sprite_index = spr_fleet_chaos; + if (image_index <= 2) { + escort_number += 3; + frigate_number += 1; + } + if (capital_number == 0) { + capital_number += 1; + } + } + } + battle_object.present_fleet[2] -= 1; + battle_object.present_fleet[10] += 1; + } + with (obj_temp8) { + instance_destroy(); + } + } + + if ((defeat == 1) && (battle_special == "WL10_reveal")) { + obj_controller.audience = 10; + obj_controller.menu = 20; + obj_controller.diplomacy = 10; + obj_controller.known[eFACTION.Chaos] = 2; + with (obj_controller) { + scr_dialogue("intro2"); + } + } + if (defeat == 0) { + obj_controller.known[eFACTION.Chaos] = 2; + obj_controller.faction_defeated[10] = 1; + + if (instance_exists(obj_turn_end)) { + scr_event_log("", "Enemy Leader Assassinated: Chaos Lord"); + scr_alert("", "ass", "Chaos Lord " + string(obj_controller.faction_leader[eFACTION.Chaos]) + " has been killed.", 0, 0); + scr_popup("Chaos Lord Killed", "Chaos Lord " + string(obj_controller.faction_leader[eFACTION.Chaos]) + " has been slain in combat. Without his leadership the various forces of Chaos in the sector will crumble apart and disintegrate from infighting. Sector " + string(obj_ini.sector_name) + " is no longer as threatened by the forces of Chaos.", "", ""); + } + if (!instance_exists(obj_turn_end)) { + scr_event_log("", "Enemy Leader Assassinated: Chaos Lord"); + var pop = instance_create(0, 0, obj_popup); + pop.image = ""; + pop.title = "Chaos Lord Killed"; + pop.text = "Chaos Lord " + string(obj_controller.faction_leader[eFACTION.Chaos]) + " has been slain in combat. Without his leadership the various forces of Chaos in the sector will crumble apart and disintegrate from infighting. Sector " + string(obj_ini.sector_name) + " is no longer as threatened by the forces of Chaos."; + } + } + } + + if ((battle_special == "study2a") || (battle_special == "study2b")) { + if (defeat == 1) { + var ii = 0, good = 0; + + if (remove_planet_problem(battle_id, "mech_tomb", battle_object)) { + obj_controller.disposition[3] -= 10; + + if (battle_special == "study2a") { + scr_popup("Mechanicus Mission Failed", "All of your Astartes and the Mechanicus Research party have been killed down to the last man. The research is a bust, and the Adeptus Mechanicus is furious with your chapter for not providing enough security. Relations with them are worse than before.", "", ""); + } + if (battle_special == "study2b") { + battle_object.p_necrons[battle_id] = 5; + awaken_tomb_world(battle_object.p_feature[battle_id]); + obj_controller.disposition[3] -= 15; + obj_controller.disposition[4] -= 5; + scr_popup("Mechanicus Mission Failed", "All of your Astartes and the Mechanicus Research party have been killed down to the last man. The research is a bust. To make matters worse the Necron Tomb has fully awakened- countless numbers of the souless machines are now pouring out of the tomb. The Adeptus Mechanicus are furious with your chapter.", "necron_army", ""); + scr_alert("", "inqi", "The Inquisition is displeased with your Chapter for tampering with and awakening a Necron Tomb", 0, 0); + scr_event_log("", "The Inquisition is displeased with your Chapter for tampering with and awakening a Necron Tomb"); + } + + scr_event_log("", "Mechanicus Mission Failed: Necron Tomb Research Party and present astartes have been killed."); + } + } + } + + if ((enemy == 5) && (obj_controller.faction_status[eFACTION.Ecclesiarchy] != "War")) { + obj_controller.loyalty -= 50; + obj_controller.loyalty_hidden -= 50; + obj_controller.disposition[2] -= 50; + obj_controller.disposition[3] -= 80; + obj_controller.disposition[4] -= 40; + obj_controller.disposition[5] -= 30; + + obj_controller.faction_status[eFACTION.Imperium] = "War"; + obj_controller.faction_status[eFACTION.Mechanicus] = "War"; + obj_controller.faction_status[eFACTION.Inquisition] = "War"; + obj_controller.faction_status[eFACTION.Ecclesiarchy] = "War"; + + if (!instance_exists(obj_turn_end)) { + obj_controller.audiences += 1; + obj_controller.audien[obj_controller.audiences] = 5; + obj_controller.audien_topic[obj_controller.audiences] = "declare_war"; + if (obj_controller.known[eFACTION.Inquisition] > 1) { + obj_controller.audiences += 1; + obj_controller.audien[obj_controller.audiences] = 4; + obj_controller.audien_topic[obj_controller.audiences] = "declare_war"; + } + obj_controller.audiences += 1; + obj_controller.audien[obj_controller.audiences] = 2; + obj_controller.audien_topic[obj_controller.audiences] = "declare_war"; + } else { + obj_turn_end.audiences += 1; + obj_turn_end.audien[obj_turn_end.audiences] = 5; + obj_turn_end.audien_topic[obj_turn_end.audiences] = "declare_war"; + if (obj_turn_end.known[eFACTION.Inquisition] > 1) { + obj_turn_end.audiences += 1; + obj_turn_end.audien[obj_turn_end.audiences] = 4; + obj_turn_end.audien_topic[obj_turn_end.audiences] = "declare_war"; + } + obj_turn_end.audiences += 1; + obj_turn_end.audien[obj_turn_end.audiences] = 2; + obj_turn_end.audien_topic[obj_turn_end.audiences] = "declare_war"; + } + } + + if ((exterminatus > 0) && (dropping != 0) && (string_count("mech", battle_special) == 0)) { + scr_destroy_planet(1); + } + + if ((string_count("mech", battle_special) > 0) && (defeat == 0)) { + with (obj_ground_mission) { + var comp, plan, i; + i = 0; + comp = 0; + plan = 0; + plan = instance_nearest(x, y, obj_star); + scr_return_ship(obj_ground_mission.loc, obj_ground_mission, obj_ground_mission.num); + with (obj_ground_mission) { + instance_destroy(); + } + } + } + + with (obj_ini) { + for (var i = 0; i <= 10; i++) { + scr_company_order(i); + scr_vehicle_order(i); + } + } + + obj_controller.x = view_x; + obj_controller.y = view_y; + obj_controller.combat = 0; + obj_controller.marines -= final_marine_deaths; + obj_controller.command -= final_command_deaths; + + instance_activate_all(); + + if (turn_count < 20) { + if ((defeat == 0) && (threat >= 4)) { + scr_recent("battle_victory", $"{battle_loc} {scr_roman(battle_id)}", enemy); + } + + if ((defeat == 1) && (final_marine_deaths + final_command_deaths >= 10)) { + scr_recent("battle_defeat", $"{enemy}, {final_marine_deaths + final_command_deaths}"); + } + } else { + scr_recent("battle_defeat", $"{enemy}, {final_marine_deaths + final_command_deaths}"); + } + + if (((dropping == 1) || (attacking == 1)) && (string_count("_attack", battle_special) == 0) && (string_count("mech", battle_special) == 0) && (string_count("ruins", battle_special) == 0) && (battle_special != "ship_demon")) { + obj_controller.combat = 0; + with (obj_drop_select) { + instance_destroy(); + } + } + if ((dropping + attacking == 0) && (string_count("_attack", battle_special) == 0) && (string_count("mech", battle_special) == 0) && (string_count("ruins", battle_special) == 0) && (battle_special != "ship_demon") && (string_count("cs_meeting", battle_special) == 0)) { + if (instance_exists(obj_turn_end)) { + var _battle_index = obj_turn_end.current_battle; + if (_battle_index < array_length(obj_turn_end.battle_object)) { + var _battle_object = obj_turn_end.battle_object[_battle_index]; + + var _planet = obj_turn_end.battle_world[_battle_index]; + + _battle_object.p_player[_planet] -= world_size; + + if (defeat == 1) { + _battle_object.p_player[_planet] = 0; + } + } + obj_controller.combat = 0; + with (obj_turn_end) { + alarm[4] = 1; + } + } + } + if ((string_count("ruins", battle_special) > 0) && (defeat == 1)) { + //TODO this logic is wrong assumes all player units died in ruins + var _combat_star = star_by_name(obj_ncombat.battle_loc); + if (_combat_star != "none") { + _combat_star.p_player[obj_ncombat.battle_id] -= obj_ncombat.world_size; + } + } + + if ((string_count("_attack", battle_special) > 0) && (string_count("mech", battle_special) == 0) && (string_count("ruins", battle_special) == 0) && (string_count("cs_meeting", battle_special) == 0)) { + if (string_count("wake", battle_special) > 0) { + var pip = instance_create(0, 0, obj_popup); + with (pip) { + title = "Necron Tomb Awakens"; + image = "necron_army"; + if (obj_ncombat.defeat == 0) { + text = "Your marines make a tactical retreat back to the surface, hounded by Necrons all the way. The Inquisition mission is a failure- you were to blow up the Necron Tomb World stealthily, not wake it up. The Inquisition is not pleased with your conduct."; + } + if (obj_ncombat.defeat == 1) { + text = "Your marines are killed down to the last man. The Inquisition mission is a failure- you were to blow up the Necron Tomb World stealthily, not wake it up. The Inquisition is not pleased with your conduct."; + } + } + + instance_activate_object(obj_star); + with (obj_star) { + if (name != obj_ncombat.battle_loc) { + instance_deactivate_object(id); + } + } + with (obj_star) { + var planet = obj_ncombat.battle_id; + if (remove_planet_problem(planet, "bomb")) { + p_necrons[planet] = 4; + } + if (awake_tomb_world(p_feature[planet]) == 0) { + awaken_tomb_world(p_feature[planet]); + } + } + with (obj_temp7) { + instance_destroy(); + } + instance_activate_object(obj_star); + + pip.number = obj_temp8.popup; + pip.loc = obj_temp8.loc; + pip.planet = battle_id; + obj_controller.combat = 0; + obj_controller.disposition[4] -= 5; + obj_controller.cooldown = 10; + with (obj_temp8) { + instance_destroy(); + } + // obj_turn_end.alarm[1]=4; + } + + if ((defeat == 1) && (string_count("wake", battle_special) == 0)) { + with (obj_temp8) { + instance_destroy(); + } + obj_controller.combat = 0; + obj_controller.cooldown = 10; + obj_turn_end.alarm[1] = 4; + } + + if ((defeat == 0) && (string_count("wake", battle_special) == 0)) { + obj_temp8.stage += 1; + obj_controller.combat = 0; + var pip = instance_create(0, 0, obj_popup); + + with (pip) { + title = "Necron Tunnels : " + string(obj_temp8.stage); + if (obj_temp8.stage == 2) { + image = "necron_tunnels_2"; + text = "The energy readings are much stronger, now that your marines are deep inside the tunnels. What was once cramped is now luxuriously large, the tunnel ceiling far overhead decorated by stalactites."; + } + if (obj_temp8.stage == 3) { + image = "necron_tunnels_3"; + text = "After several hours of descent the entrance to the Necron Tomb finally looms ahead- dancing, sickly green light shining free. Your marine confirms that the Plasma Bomb is ready."; + } + if (obj_temp8.stage == 4) { + if (obj_temp8.stage >= 4) { + instance_activate_object(obj_star); + image = ""; + title = "Inquisition Mission Completed"; + text = "Your marines finally enter the deepest catacombs of the Necron Tomb. There they place the Plasma Bomb and arm it. All around are signs of increasing Necron activity. With half an hour set, your men escape back to the surface. There is a brief rumble as the charge goes off, your mission a success."; + option1 = ""; + option2 = ""; + option3 = ""; + + if (obj_controller.demanding == 0) { + obj_controller.disposition[4] += 1; + } + if (obj_controller.demanding == 1) { + obj_controller.disposition[4] += choose(0, 0, 1); + } + + // show_message(string(obj_temp8.loc)+"."+string(obj_temp8.wid)); + // obj_controller.temp[200]=obj_temp8.loc; + with (obj_star) { + if (name != obj_temp8.loc) { + instance_deactivate_object(id); + } + } + with (obj_star) { + if (name == obj_temp8.loc) { + instance_create(x, y, obj_temp5); + } + } + + you = instance_nearest(obj_temp5.x, obj_temp5.y, obj_star); + onceh = 0; + + // show_message(you.name); + + // show_message("TEMP5: "+string(instance_number(obj_temp5))+"#Star: "+string(you)); + + var ppp; + ppp = 0; + remove_planet_problem(obj_temp8.wid, "bomb", you); + + pip.option1 = ""; + pip.option2 = ""; + pip.option3 = ""; + scr_event_log("", "Inquisition Mission Completed: Your Astartes have sealed the Necron Tomb on " + string(you.name) + " " + string(scr_roman(obj_temp8.wid)) + "."); + scr_gov_disp(you.name, obj_temp8.wid, choose(1, 2, 3, 4, 5)); + + if (!instance_exists(obj_temp8)) { + pip.loc = battle_loc; + pip.planet = battle_id; + } + if (instance_exists(obj_temp8)) { + pip.number = obj_temp8.popup; + pip.loc = obj_temp8.loc; + pip.planet = obj_temp8.wid; + } + + // show_message("Battle Closing: "+string(pip.loc)+"."+string(pip.planet)); + + with (obj_temp5) { + instance_destroy(); + } + instance_activate_object(obj_star); + var have_bomb; + have_bomb = scr_check_equip("Plasma Bomb", obj_temp8.loc, obj_temp8.wid, 1); + } + } + } + + if (instance_exists(obj_temp8) && (pip.planet == 0)) { + pip.number = obj_temp8.popup; + pip.loc = obj_temp8.loc; + pip.planet = battle_id; + } + } + } + + if ((string_count("spyrer", battle_special) > 0) /* and (string_count("demon",battle_special)>0))*/ && (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 planet_string = scr_roman_numerals()[planet - 1]; + + remove_planet_problem(planet, "spyrer", cur_star); + + var tixt = $"The Spyrer on {cur_star.name} {planet_string} has been removed. The citizens and craftsman may sleep more soundly, the Inquisition likely pleased."; + + scr_popup("Inquisition Mission Completed", tixt, "spyrer", ""); + + if (obj_controller.demanding == 0) { + obj_controller.disposition[4] += 2; + } + if (obj_controller.demanding == 1) { + obj_controller.disposition[4] += choose(0, 0, 1); + } + + scr_event_log("", "Inquisition Mission Completed: The Spyrer on {cur_star.name} {planet} has been removed.", cur_star.name); + scr_gov_disp(cur_star.name, planet, choose(1, 2, 3, 4)); + + instance_deactivate_object(obj_star); + } + + if ((string_count("fallen", battle_special) > 0) && (defeat == 0)) { + var fallen = 0; + with (obj_turn_end) { + remove_planet_problem(battle_world[current_battle], "fallen", battle_object[current_battle]); + var tixt = "The Fallen on " + battle_object[current_battle].name; + tixt += scr_roman(battle_world[current_battle]); + scr_event_log("", $"Mission Succesful: {tixt} have been captured or purged."); + tixt += $" have been captured or purged. They shall be brought to the Chapter {obj_ini.role[100][14]}s posthaste, in order to account for their sins. "; + var ran; + ran = choose(1, 1, 2, 3); + if (ran == 1) { + tixt += "Suffering is the beginning to penance."; + } + if (ran == 2) { + tixt += "Their screams shall be the harbringer of their contrition."; + } + if (ran == 3) { + tixt += "The shame they inflicted upon us shall be written in their flesh."; + } + scr_popup("Hunt the Fallen Completed", tixt, "fallen", ""); + } + } + + if ((defeat == 0) && (enemy == 9) && (battle_special == "tyranid_org")) { + if (captured_gaunt > 1) { + pop = instance_create(0, 0, obj_popup); + pop.image = "inquisition"; + pop.title = "Inquisition Mission Completed"; + pop.text = "You have captured several Gaunt organisms. The Inquisitor is pleased with your work, though she notes that only one is needed- the rest are to be purged. It will be stored until it may be retrieved. The mission is a success."; + } + if (captured_gaunt == 1) { + pop = instance_create(0, 0, obj_popup); + pop.image = "inquisition"; + pop.title = "Inquisition Mission Completed"; + pop.text = "You have captured a Gaunt organism- the Inquisitor is pleased with your work. The Tyranid will be stored until it may be retrieved. The mission is a success."; + } + } + + if ((enemy == 1) && (on_ship == true) && (defeat == 0)) { + var diceh = floor(random(100)) + 1; + + if (scr_has_disadv("Shitty Luck")) { + diceh -= 15; + } + + if (diceh <= 15) { + var ship, ship_hp, i = -1; + for (var i = 0; i < array_length(obj_ini.ship); i++) { + ship[i] = obj_ini.ship[i]; + ship_hp[i] = obj_ini.ship_hp[i]; + if (i == battle_id) { + obj_ini.ship_hp[i] = -50; + scr_recent("ship_destroyed", obj_ini.ship[i], i); + } + } + var pop = instance_create(0, 0, obj_popup); + pop.image = ""; + pop.title = "Ship Destroyed"; + pop.text = "A handful of loyalist " + string(global.chapter_name) + " make a fighting retreat to the engine of the vessel, '" + string(obj_ini.ship[battle_id]) + "', and then overload the main reactor. Your ship explodes in a brilliant cloud of fire."; + scr_event_log("red", "A handful of loyalist " + string(global.chapter_name) + " overload the main reactor of your vessel '" + string(obj_ini.ship[battle_id]) + "'."); + pop.mission = "loyalist_destroy_ship"; + + scr_ini_ship_cleanup(); + } + } + + if (enemy == 1) { + if ((battle_special == "cs_meeting_battle1") || (battle_special == "cs_meeting_battle2")) { + obj_controller.diplomacy = 10; + obj_controller.menu = 20; + with (obj_controller) { + scr_dialogue("cs_meeting21"); + } + } + + // Chapter Master just murdered absolutely everyone + if ((battle_special == "cs_meeting_battle7") && (defeat == 0)) { + if (obj_controller.chaos_rating < 1) { + obj_controller.chaos_rating += 1; + } + obj_controller.complex_event = false; + obj_controller.diplomacy = 0; + obj_controller.menu = 0; + obj_controller.force_goodbye = 0; + obj_controller.cooldown = 20; + obj_controller.current_eventing = "chaos_meeting_end"; + with (obj_temp_meeting) { + instance_destroy(); + } + with (obj_popup) { + instance_destroy(); + } + if (instance_exists(obj_turn_end)) { + obj_turn_end.combating = 0; // obj_turn_end.alarm[1]=1; + } + var pip; + pip = instance_create(0, 0, obj_popup); + pip.title = "Enemies Vanquished"; + pip.text = "Not only have you killed the Chaos Lord, " + string(obj_controller.faction_leader[eFACTION.Chaos]) + ", but also all of your battle brothers that questioned your rule. As you stand, alone, among the broken corpses of your enemies you begin to question what exactly it is that you accomplished. No matter the results, you feel as though your actions have been noticed."; + } + } + + if (enemy == 10) { + if ((battle_special == "cs_meeting_battle10") && (defeat == 0)) { + obj_controller.complex_event = false; + obj_controller.diplomacy = 0; + obj_controller.menu = 0; + obj_controller.force_goodbye = 0; + obj_controller.cooldown = 20; + obj_controller.current_eventing = "chaos_meeting_end"; + with (obj_temp_meeting) { + instance_destroy(); + } + with (obj_popup) { + instance_destroy(); + } + if (instance_exists(obj_turn_end)) { + obj_turn_end.combating = 0; // obj_turn_end.alarm[1]=1; + } + var pip = instance_create(0, 0, obj_popup); + pip.title = "Survived"; + pip.text = "You and the rest of your battle brothers fight your way out of the catacombs, back through the tunnel where you first entered. By the time you manage it your forces are battered and bloodied and in desperate need of pickup. The whole meeting was a bust- Chaos Lord " + string(obj_controller.faction_leader[eFACTION.Chaos]) + " clearly intended to kill you and simply be done with it."; + } + + if (((battle_special == "cs_meeting_battle5") || (battle_special == "cs_meeting_battle6")) && (defeat == 0)) { + var mos; + mos = false; + + with (obj_ground_mission) { + instance_destroy(); + } + with (obj_pnunit) { + var j; + j = 0; + repeat (300) { + j += 1; + if (marine_type[j] == "Master of Sanctity") { + instance_create(0, 0, obj_ground_mission); + } + } + } + // Master of Sanctity present, wishes to take in the player + if (instance_exists(obj_ground_mission) && (string_count("CRMOS|", obj_controller.useful_info) == 0)) { + obj_controller.menu = 20; + with (obj_controller) { + scr_dialogue("cs_meeting_m5"); + } + } + + // Master of Sanctity not present, just get told that you have defeated the Chaos Lord + if ((!instance_exists(obj_ground_mission)) || (string_count("CRMOS|", obj_controller.useful_info) > 0)) { + // Some kind of popup based on what you were going after + + obj_controller.complex_event = false; + obj_controller.diplomacy = 0; + obj_controller.menu = 0; + obj_controller.force_goodbye = 0; + obj_controller.cooldown = 20; + obj_controller.current_eventing = "chaos_meeting_end"; + with (obj_temp_meeting) { + instance_destroy(); + } + with (obj_popup) { + instance_destroy(); + } + if (instance_exists(obj_turn_end)) { + obj_turn_end.combating = 0; // obj_turn_end.alarm[1]=1; + } + var pip; + pip = instance_create(0, 0, obj_popup); + pip.title = "Chaos Lord Killed"; + pip.text = "(Not completed yet- variable reward based on what chosen)"; + } + with (obj_ground_mission) { + instance_destroy(); + } + } + } + + if (battle_special == "ship_demon") { + if (defeat == 1) { + var ship, ship_hp, i; + i = -1; + repeat (51) { + i += 1; + ship[i] = obj_ini.ship[i]; + ship_hp[i] = obj_ini.ship_hp[i]; + if (i == battle_id) { + obj_ini.ship_hp[i] = -50; + scr_recent("ship_destroyed", obj_ini.ship[i], i); + } + } + var pop; + pop = instance_create(0, 0, obj_popup); + pop.image = ""; + pop.title = "Ship Destroyed"; + pop.text = "The daemon has slayed all of your marines onboard. It works its way to the engine of the vessel, '" + string(obj_ini.ship[battle_id]) + "', and then tears into the main reactor. Your ship explodes in a brilliant cloud of fire."; + scr_event_log("red", "A daemon unbound from an Artifact wreaks havoc upon and destroys your vessel '" + string(obj_ini.ship[battle_id]) + "'."); + + scr_ini_ship_cleanup(); + } + } + + if ((battle_special == "space_hulk") && (defeat == 0) && (hulk_treasure > 0)) { + var shi = 0, loc = ""; + + var shiyp = instance_nearest(battle_object.x, battle_object.y, obj_p_fleet); + if (shiyp.x == battle_object.x && shiyp.y == battle_object.y) { + shi = fleet_full_ship_array(shiyp)[0]; + loc = obj_ini.ship[shi]; + } + + if (hulk_treasure == 1) { + // Requisition + var reqi = round(random_range(30, 60) + 1) * 10; + obj_controller.requisition += reqi; + + var pop; + pop = instance_create(0, 0, obj_popup); + pop.image = "space_hulk_done"; + pop.title = "Space Hulk: Resources"; + pop.text = "Your battle brothers have located several luxury goods and coginators within the Space Hulk. They are salvaged and returned to the ship, granting " + string(reqi) + " Requisition."; + } else if (hulk_treasure == 2) { + // Artifact + //TODO this will eeroniously put artifacts in the wrong place but will resolve crashes + var last_artifact = scr_add_artifact("random", "random", 4, loc, shi + 500); + var i = 0; + + var pop = instance_create(0, 0, obj_popup); + pop.image = "space_hulk_done"; + pop.title = "Space Hulk: Artifact"; + pop.text = $"An Artifact has been retrieved from the Space Hulk and stowed upon {loc}. It appears to be a {obj_ini.artifact[last_artifact]} but should be brought home and identified posthaste."; + scr_event_log("", "Artifact recovered from the Space Hulk."); + } else if (hulk_treasure == 3) { + // STC + scr_add_stc_fragment(); // STC here + var pop; + pop = instance_create(0, 0, obj_popup); + pop.image = "space_hulk_done"; + pop.title = "Space Hulk: STC Fragment"; + pop.text = "An STC Fragment has been retrieved from the Space Hulk and safely stowed away. It is ready to be decrypted or gifted at your convenience."; + scr_event_log("", "STC Fragment recovered from the Space Hulk."); + } else if (hulk_treasure == 4) { + // Termie Armour + var termi = choose(2, 2, 2, 3); + scr_add_item("Terminator Armour", termi); + var pop; + pop = instance_create(0, 0, obj_popup); + pop.image = "space_hulk_done"; + pop.title = "Space Hulk: Terminator Armour"; + pop.text = "The fallen heretics wore several suits of Terminator Armour- a handful of them were found to be cleansible and worthy of use. " + string(termi) + " Terminator Armour has been added to the Armamentarium."; + } + } + + if (((leader == 1) || (battle_special == "world_eaters")) && (obj_controller.faction_defeated[10] == 0) && (defeat == 0) && (battle_special != "WL10_reveal") && (battle_special != "WL10_later")) { + if ((battle_special != "WL10_reveal") && (battle_special != "WL10_later")) { + // prolly schedule a popup congratulating + obj_controller.faction_defeated[enemy] = 1; + if (obj_controller.known[enemy] == 0) { + obj_controller.known[enemy] = 1; + } + + if (battle_special != "world_eaters") { + with (obj_star) { + if (string_count("WL" + string(obj_ncombat.enemy), p_feature[obj_ncombat.battle_id]) > 0) { + p_feature[obj_ncombat.battle_id] = string_replace(p_feature[obj_ncombat.battle_id], "WL" + string(obj_ncombat.enemy) + "|", ""); + } + } + } + if (battle_special == "world_eaters") { + obj_controller.faction_defeated[10] = 1; // show_message("WL10 defeated"); + if (instance_exists(obj_turn_end)) { + scr_event_log("", "Enemy Leader Assassinated: Chaos Lord"); + scr_alert("", "ass", "Chaos Lord " + string(obj_controller.faction_leader[eFACTION.Chaos]) + " has been killed.", 0, 0); + scr_popup("Black Crusade Ended", "The Chaos Lord " + string(obj_controller.faction_leader[eFACTION.Chaos]) + " has been slain in combat. Without his leadership the Black Crusade is destined to crumble apart and disintegrate from infighting. Sector " + string(obj_ini.sector_name) + " is no longer at threat by the forces of Chaos.", "", ""); + } + if (!instance_exists(obj_turn_end)) { + scr_event_log("", "Enemy Leader Assassinated: Chaos Lord"); + var pop; + pop = instance_create(0, 0, obj_popup); + pop.image = ""; + pop.title = "Black Crusade Ended"; + pop.text = "The Chaos Lord " + string(obj_controller.faction_leader[eFACTION.Chaos]) + " has been slain in combat. Without his leadership the Black Crusade is destined to crumble apart and disintegrate from infighting. Sector " + string(obj_ini.sector_name) + " is no longer at threat by the forces of Chaos."; + } + } + } + } + + instance_activate_all(); + with (obj_pnunit) { + instance_destroy(); + } + with (obj_enunit) { + instance_destroy(); + } + with (obj_nfort) { + instance_destroy(); + } + with (obj_centerline) { + instance_destroy(); + } + obj_controller.new_buttons_hide = 0; + + if (instance_exists(obj_cursor)) { + obj_cursor.image_index = 0; + } + + instance_destroy(); + + /* */ + /* */ + } catch (_exception) { + handle_exception(_exception); + } +} diff --git a/scripts/scr_ncombat_scripts/scr_ncombat_scripts.yy b/scripts/scr_ncombat_scripts/scr_ncombat_scripts.yy new file mode 100644 index 0000000000..3743fa9eb9 --- /dev/null +++ b/scripts/scr_ncombat_scripts/scr_ncombat_scripts.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"scr_ncombat_scripts", + "isCompatibility":false, + "isDnD":false, + "name":"scr_ncombat_scripts", + "parent":{ + "name":"Combat", + "path":"folders/Scripts/Combat.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml index 1cd5e49bbc..87e5d017bd 100644 --- a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml +++ b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml @@ -54,7 +54,7 @@ function add_data_to_stack (weapon, unit_damage=0, head_role=false, unit="none") _weapon_stack.shot_count = weapon.spli; array_push(_weapon_stack.owners, _owner_name); - if (obj_ncombat.started == eBATTLE_STAGE.Creation) { + if (obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) { _weapon_stack.ammo_max = weapon.ammo; _weapon_stack.ammo_current = weapon.ammo; _weapon_stack.ammo_reload = weapon.reload; @@ -284,7 +284,7 @@ function scr_player_combat_weapon_stacks() { - if (dudes_num[1]=0) and (obj_ncombat.started == eBATTLE_STAGE.Creation){ + if (dudes_num[1]=0) and (obj_ncombat.battle_stage == eBATTLE_STAGE.Creation){ instance_destroy(); exit; } @@ -307,17 +307,6 @@ function scr_player_combat_weapon_stacks() { } } -function set_up_player_blocks_turn(){ - if (instance_exists(obj_pnunit)){ - with (obj_pnunit){ - alarm[3]=2; - wait_and_execute(3, scr_player_combat_weapon_stacks); - alarm[0]=4; - } - } - turn_count++; -} - function scr_add_unit_to_roster(unit, is_local=false,is_ally=false){ array_push(unit_struct, unit); array_push(marine_co, unit.company); diff --git a/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml b/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml new file mode 100644 index 0000000000..e7b686af0a --- /dev/null +++ b/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml @@ -0,0 +1,336 @@ +#macro DEBUG_COLUMN_PRIORITY_PLAYER false + +// alarm_0 +/// @mixin +function pnunit_target_and_shoot() { + // Useful functions: + // scr_target + // get_rightmost + // move_unit_block + // gear_weapon_data + // scr_shoot + + try { + if (!instance_exists(obj_enunit)) { + exit; + } + + target_block = instance_nearest(0, y, obj_enunit); + + if (obj_ncombat.dropping || (!obj_ncombat.defending && obj_ncombat.formation_set != 2)) { + move_unit_block("east"); + } + + engaged = collision_point(x - 10, y, obj_enunit, 0, 1) || collision_point(x + 10, y, obj_enunit, 0, 1); + + if (DEBUG_COLUMN_PRIORITY_PLAYER) { + var _t_start1 = get_timer(); + } + + if (!engaged) { + for (var i = 0; i < array_length(unit_struct); i++) { + if (marine_dead[i] == 0 && marine_casting[i] == true) { + var caster_id = i; + scr_powers(caster_id); + } + } + + // Shooting + var _ranged_weapons = get_valid_weapon_stacks(weapon_stacks_normal, 2, 999); + for (var i = 0, _ranged_len = array_length(_ranged_weapons); i < _ranged_len; i++) { + if (!target_block_is_valid(target_block, obj_enunit)) { + target_block = instance_nearest(0, y, obj_enunit); + if (!target_block_is_valid(target_block, obj_enunit)) { + exit; + } + } + + var _weapon_stack = _ranged_weapons[i]; + var dist = get_block_distance(target_block); + + if (_weapon_stack.range >= dist) { + var _target_priority_queue = ds_priority_create(); + + if (DEBUG_COLUMN_PRIORITY_PLAYER) { + var _t_start = get_timer(); + } + + // Scan potential targets + var _check_targets = []; + with (obj_enunit) { + if (!target_block_is_valid(self, obj_enunit)) { + continue; + } + array_push(_check_targets, self.id); + } + + // if (DEBUG_COLUMN_PRIORITY_PLAYER) { + // show_debug_message($"{wep[i]} IS HERE!"); + // } + + for (var t = 0; t < array_length(_check_targets); t++) { + var enemy_block = _check_targets[t]; + + var _distance = get_block_distance(enemy_block); + if (_distance <= _weapon_stack.range) { + var _priority = get_target_priority(_weapon_stack, enemy_block); + ds_priority_add(_target_priority_queue, enemy_block, _priority); + } + } + + if (DEBUG_COLUMN_PRIORITY_PLAYER) { + var _t_end = get_timer(); + var _elapsed_ms = (_t_end - _t_start) / 1000; + show_debug_message($"⏱️ Execution Time: {_elapsed_ms}ms"); + } + + // Shoot highest-priority target + if (!ds_priority_empty(_target_priority_queue)) { + var best_target = ds_priority_delete_max(_target_priority_queue); + var unit_index = 0; + + scr_shoot(_weapon_stack, best_target, unit_index); + } else { + log_error($"{_weapon_stack.weapon_name} didn't find a valid target! This shouldn't happen!"); + // if (DEBUG_COLUMN_PRIORITY_PLAYER) { + // show_debug_message($"We didn't find a valid target! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}"); + // } + } + + ds_priority_destroy(_target_priority_queue); + } else { + // if (DEBUG_COLUMN_PRIORITY_PLAYER) { + // show_debug_message($"I can't shoot, my range is too small! Weapon: {wep[i]}; Column ID: {id}; Enemy Unit: {wep_owner[i]}; Range: {range[i]}"); + // } + // continue; + } + } + if (DEBUG_COLUMN_PRIORITY_PLAYER) { + var _t_end1 = get_timer(); + var _elapsed_ms1 = (_t_end1 - _t_start1) / 1000; + show_debug_message($"⏱️ Ranged Alarm Execution Time: {_elapsed_ms1}ms"); + } + } else { + // Melee + var _melee_weapons = get_valid_weapon_stacks(weapon_stacks_normal, 1, 2); + for (var i = 0, _wep_len = array_length(_melee_weapons); i < _wep_len; i++) { + if (!target_block_is_valid(target_block, obj_enunit)) { + exit; + } + + var _weapon_stack = _melee_weapons[i]; + scr_shoot(_weapon_stack, target_block, 0); + } + } + } catch (_exception) { + handle_exception(_exception); + } +} + +// alarm_3 +/// @mixin +function pnunit_battle_effects() { + try { + if (obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) { + if (men + dreads + veh <= 0) { + //show_debug_message($"column destroyed {x}") + instance_destroy(); + } + // if (veh+dreads>0) then instance_destroy(); + obj_ncombat.player_forces += self.men + self.veh + self.dreads; + obj_ncombat.player_max += self.men + self.veh + self.dreads; + + //TODO centralise a method for moving units between columns + /*if (men<=4) and (veh=0) and (dreads=0){// Squish leftt + var leftt=instance_nearest(x-12,y,obj_pnunit); + + + }*/ + } + + if (scr_has_disadv("Black Rage")) && (obj_ncombat.battle_over == 0) { + if (men > 0) { + var raar = 0, miss = "", r_lost = 0; + + for (var raar; raar < (men + dreads); raar++) { + var r_roll = floor(random(1000)) + 1; + if (obj_ncombat.player_forces < (obj_ncombat.player_max * 0.75)) { + r_roll -= 8; + } + if (obj_ncombat.player_forces < (obj_ncombat.player_max / 2)) { + r_roll -= 10; + } + if (obj_ncombat.player_forces < (obj_ncombat.player_max / 4)) { + r_roll -= 24; + } + if (obj_ncombat.player_forces < (obj_ncombat.player_max / 7)) { + r_roll -= 104; + } + if (obj_ncombat.player_forces < (obj_ncombat.player_max / 10)) { + r_roll -= 350; + } + + if ((marine_dead[raar] == 0) && (marine_type[raar] != "Death Company") && (marine_type[raar] != "Chapter Master") && (r_roll <= 4)) { + r_lost += 1; + marine_type[raar] = "Death Company"; + //marine_attack[raar]+=1; + marine_defense[raar] = 0.75; + //marine_ranged[raar]=0.75; + obj_ncombat.lost_to_black_rage++; + if (r_lost == 1) { + miss += "Battle Brother " + string(obj_ini.name[marine_co[raar], marine_id[raar]]) + ", "; + } + if (r_lost > 1) { + miss += string(obj_ini.name[marine_co[raar], marine_id[raar]]) + ", "; + } + } + } + if (r_lost > 1) { + string_replace(miss, "Battle Brother", "Battle Brothers"); + } + + var woo = string_length(miss); + miss = string_delete(miss, woo - 1, 2); // remove last + + if (string_count(", ", miss) == 1) { + /*var woo;woo=string_rpos(", ",miss); + miss=string_insert(" and",miss,woo+1);*/ + + miss = string_replace(miss, ", ", " and "); + } + if (string_count(", ", miss) > 1) { + var woo = string_rpos(", ", miss); + + miss = string_delete(miss, woo - 1, 3); + if (r_lost >= 3) { + miss = string_insert(", and ", miss, woo - 1); + } + if (r_lost == 2) { + miss = string_insert(" and ", miss, woo - 1); + } + } + + if (r_lost == 1) { + miss += " has been lost to the Red Thirst!"; + } + if (r_lost > 1) { + miss += " have been lost to the Red Thirst!"; + } + + if (r_lost > 0) { + obj_ncombat.newline = miss; + obj_ncombat.newline_color = "red"; + with (obj_ncombat) { + scr_newtext(); + } + } + } + } + + if (obj_ncombat.battle_stage >= eBATTLE_STAGE.Start) { + // Should probably have the option under deployment to say 'Should Assault Marines enter the fray with vehicles?' [ ] + } + + // Right here execute some sort of check- if left is open, and engaged, and target_block is only vehicles, and no weapons to hurt them... + + //! This doesn't work very well, so I'll comment it out for now, as I don't want to bother fixing it atm + // if (instance_exists(obj_enunit)){ + // if (collision_point(x+10,y,obj_enunit,0,1)) and (!collision_point(x-10,y,obj_pnunit,0,1)){ + // var neares=instance_nearest(x+10,y,obj_enunit); + + // if (neares.men=0) and (neares.veh>0){ + // var norun; + // norun=0; + + // var i;i=0; + // repeat(20){i+=1; + // if (apa[i]>=30) then norun=1; + // } + + // if (norun=0){ + // x-=10; + // engaged=0; + // } + + // } + // } + // } + + /* */ + /* */ + } catch (_exception) { + handle_exception(_exception); + } +} + +// alarm_6 +/// @mixin +function pnunit_dying_process() { + // + // Handles marines dying on battle + // + + // Remove from ships + // Remove from the controller + // Remove from any planetary bodies + + // show_message("pnunit alarm 6"); + + var i = -1, unit; + for (var i = 0; i < array_length(unit_struct); i++) { + if ((marine_dead[i] > 0) && (marine_type[i] != "") && (ally[i] == false)) { + unit = unit_struct[i]; + if (!is_struct(unit)) { + continue; + } + if (unit.name() == "") { + continue; + } + man_size = unit.get_unit_size(); + + if (unit.planet_location > 0) { + obj_ncombat.world_size += man_size; + } + if (unit.ship_location > -1) { + obj_ini.ship_carrying[unit.ship_location] -= man_size; + } + // + scr_kill_unit(unit.company, unit.marine_number); + } + } + + for (var i = 0; i < array_length(veh_type); i++) { + // if (veh_type[i]="Predator") or (veh_type[i]="Land Raider") then show_message(string(veh_type[i])+" ("+string(veh_co[i])+"."+string(veh_id[i])+")#HP: "+string(veh_hp[i])+"#Dead: "+string(veh_dead[i])+""); + + if ((veh_dead[i] > 0) && (veh_type[i] != "") && (veh_ally[i] == false)) { + var man_size = scr_unit_size("", veh_type[i], true); + + /* + if (veh_type[i]="Rhino") then man_size+=10; + if (veh_type[i]="Predator") then man_size+=10; + if (veh_type[i]="Land Raider") then man_size+=20; + if (veh_type[i]="Bike") then man_size+=2; + if (veh_type[i]="Land Speeder") then man_size+=6; + if (veh_type[i]="Whirlwind") then man_size+=10;*/ + + if (obj_ini.veh_wid[veh_co[i], veh_id[i]] > -1) { + obj_ncombat.world_size += man_size; + } + if (obj_ini.veh_lid[veh_co[i], veh_id[i]] > -1) { + obj_ini.ship_carrying[obj_ini.veh_lid[veh_co[i], veh_id[i]]] -= man_size; + } + + // show_message(string(veh_type[i])+" ("+string(veh_co[i])+"."+string(veh_id[i])+") dead"); + + // + destroy_vehicle(veh_co[i], veh_id[i]); + } + + if ((veh_dead[i] == 0) && (veh_type[i] != "") && (veh_ally[i] == false)) { + obj_ini.veh_hp[veh_co[i]][veh_id[i]] = veh_hp[i]; + } + } + + /* */ + /* */ +} diff --git a/scripts/scr_pnunit_scripts/scr_pnunit_scripts.yy b/scripts/scr_pnunit_scripts/scr_pnunit_scripts.yy new file mode 100644 index 0000000000..9327732e58 --- /dev/null +++ b/scripts/scr_pnunit_scripts/scr_pnunit_scripts.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"scr_pnunit_scripts", + "isCompatibility":false, + "isDnD":false, + "name":"scr_pnunit_scripts", + "parent":{ + "name":"Combat", + "path":"folders/Scripts/Combat.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file From 0c1e20ab95a7177491d6820e7e799f0977c192b5 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Wed, 16 Apr 2025 17:05:08 +0300 Subject: [PATCH 65/80] Some additional fixes and battlelog stuff --- objects/obj_ground_teams/Alarm_0.gml | 27 ++++--- objects/obj_ncombat/Create_0.gml | 64 +++++++++++++-- objects/obj_ncombat/Draw_0.gml | 42 +++------- objects/obj_ncombat/Step_0.gml | 29 ++----- .../scr_colors_initialize.gml | 9 ++- scripts/scr_flavor/scr_flavor.gml | 77 ++----------------- scripts/scr_flavor2/scr_flavor2.gml | 10 +-- .../scr_lines_increase/scr_lines_increase.gml | 2 +- .../scr_marine_struct/scr_marine_struct.gml | 2 +- .../scr_ncombat_scripts.gml | 63 +++++++++------ scripts/scr_newtext/scr_newtext.gml | 53 +++++++------ .../scr_pnunit_scripts/scr_pnunit_scripts.gml | 8 +- scripts/scr_powers/scr_powers.gml | 26 +++---- 13 files changed, 189 insertions(+), 223 deletions(-) diff --git a/objects/obj_ground_teams/Alarm_0.gml b/objects/obj_ground_teams/Alarm_0.gml index 10351f4083..e93116af2a 100644 --- a/objects/obj_ground_teams/Alarm_0.gml +++ b/objects/obj_ground_teams/Alarm_0.gml @@ -1,25 +1,24 @@ if (feature.f_type == P_features.Ancient_Ruins){ - newline = "Your marines warily stalk through into the entrance of the ruins"; - newline_color = "red"; - scr_newtext(); + var _newline = "Your marines warily stalk through into the entrance of the ruins"; + obj_ncombat.queue_battlelog_message(_newline, COL_YELLOW); if (feature.ruins_race ==0){ feature.determine_race(); - newline="Your marines descended into the ancient ruins, mapping them out as they go. They quickly determine the ruins were once "; - if (feature.ruins_race=1) then newline+="a Space Marine fortification from earlier times."; - if (feature.ruins_race=2) then newline+="golden-age Imperial ruins, lost to time."; - if (feature.ruins_race=5) then newline+="a magnificent temple of the Imperial Cult."; - if (feature.ruins_race=6) then newline+="Eldar colonization structures from an unknown time."; - if (feature.ruins_race=10) then newline+="golden-age Imperial ruins, since decorated with spikes and bones."; - scr_newtext(); + var _newline = "Your marines descended into the ancient ruins, mapping them out as they go. They quickly determine the ruins were once "; + if (feature.ruins_race=1) then _newline+="a Space Marine fortification from earlier times."; + if (feature.ruins_race=2) then _newline+="golden-age Imperial ruins, lost to time."; + if (feature.ruins_race=5) then _newline+="a magnificent temple of the Imperial Cult."; + if (feature.ruins_race=6) then _newline+="Eldar colonization structures from an unknown time."; + if (feature.ruins_race=10) then _newline+="golden-age Imperial ruins, since decorated with spikes and bones."; + obj_ncombat.queue_battlelog_message(_newline, COL_YELLOW); }else{ - newline = "The ruins seem much unchange from the last exploration records" - scr_newtext(); + _newline = "The ruins seem much unchange from the last exploration records" + obj_ncombat.queue_battlelog_message(_newline, COL_YELLOW); } var pathway = choose(1,2,3); if (pathway >0 ){ - newline = "After exploring for many the exploration team reach a large chamber branching into three halways one of which is sealed by a thick blast door" - scr_newtext(); + _newline = "After exploring for many the exploration team reach a large chamber branching into three halways one of which is sealed by a thick blast door" + obj_ncombat.queue_battlelog_message(_newline, COL_YELLOW); } } diff --git a/objects/obj_ncombat/Create_0.gml b/objects/obj_ncombat/Create_0.gml index 77c63e019f..67bf4edf30 100644 --- a/objects/obj_ncombat/Create_0.gml +++ b/objects/obj_ncombat/Create_0.gml @@ -1,3 +1,5 @@ +#macro BATTLELOG_MAX_PER_TURN 24 + if (instance_number(obj_ncombat) > 1) { instance_destroy(); } @@ -130,14 +132,14 @@ messages_shown = 0; units_lost_counts = {}; vehicles_lost_counts = {}; -messages_queue = ds_priority_create(); - var _messages_size = 70; lines = array_create(_messages_size, ""); -lines_color = array_create(_messages_size, ""); +lines_color = array_create(_messages_size, COL_GREEN); message = array_create(_messages_size, ""); -message_sz = array_create(_messages_size, 0); -message_priority = array_create(_messages_size, 0); +messages_queue = ds_queue_create(); +newline = ""; +newline_color = COL_GREEN; +liness = 0; post_equipment_lost = array_create(_messages_size, ""); post_equipments_lost = array_create(_messages_size, 0); @@ -165,9 +167,6 @@ final_marine_deaths = 0; final_command_deaths = 0; vehicle_deaths = 0; casualties = 0; -newline = ""; -newline_color = ""; -liness = 0; world_size = 0; turn_stage = eBATTLE_TURN.PlayerStart; @@ -305,3 +304,52 @@ if (obj_ini.occulobe) { enemy_dudes = ""; global_defense = 2 - global_defense; + +queue_force_health = function() { + var _text = ""; + + if (turn_stage == eBATTLE_TURN.PlayerStart) { + if (player_forces > 0) { + _text = $"The {global.chapter_name} are at {string(round((player_forces / player_max) * 100))}% strength!"; + } else { + _text = $"The {global.chapter_name} are defeated!"; + } + } else { + if (enemy_forces > 0) { + _text = $"The enemy forces are at {string(max(1, round((enemy_forces / enemy_max) * 100)))}% strength!"; + } else { + _text = "The enemy forces are defeated!"; + } + } + + if (_text != "") { + queue_battlelog_message(_text, COL_YELLOW); + } +} + +/// @function queue_battlelog_message +/// @param {string} _message - The message text to add to the battle log +/// @param _message_color - Hexadecimal/CSS colour/constant color. +/// @returns {real} The index of the newly added message +queue_battlelog_message = function(_message, _message_color = COL_GREEN) { + if (instance_exists(obj_ncombat)) { + var _message_struct = { + message: _message, + color: _message_color + } + + ds_queue_enqueue(obj_ncombat.messages_queue, _message_struct) + } +} + +display_message_queue = function() { + while (!ds_queue_empty(messages_queue) && messages_shown < BATTLELOG_MAX_PER_TURN) { + var _message = ds_queue_dequeue(messages_queue); + newline = _message.message; + newline_color = _message.color; + messages_shown += 1; + scr_newtext(); + } + messages_shown = 0; + ds_queue_clear(messages_queue); +} diff --git a/objects/obj_ncombat/Draw_0.gml b/objects/obj_ncombat/Draw_0.gml index 1f9e13a160..6ef6d9b51a 100644 --- a/objects/obj_ncombat/Draw_0.gml +++ b/objects/obj_ncombat/Draw_0.gml @@ -5,7 +5,7 @@ draw_set_alpha(1); draw_rectangle(0, 0, 800, 900, 0); draw_rectangle(818, 235, 1578, 666, 0); -draw_set_color(38144); +draw_set_color(COL_GREEN); var l; l = 0; @@ -39,14 +39,14 @@ draw_set_alpha(1); draw_set_font(fnt_40k_14); if ((display_p1 > 0) && (player_forces > 0)) { - draw_set_color(c_yellow); + draw_set_color(COL_YELLOW); draw_set_halign(fa_left); - draw_text(64, 880, string_hash_to_newline(string(display_p1n) + ": " + string(display_p1) + "HP")); + draw_text(64, 880, string(display_p1n) + ": " + string(display_p1) + "HP"); } if ((display_p2 > 0) && (enemy_forces > 0)) { - draw_set_color(c_yellow); + draw_set_color(COL_YELLOW); draw_set_halign(fa_right); - draw_text(800 - 64, 880, string_hash_to_newline(string(display_p2n) + ": " + string(display_p2) + "HP")); + draw_text(800 - 64, 880, string(display_p2n) + ": " + string(display_p2) + "HP"); } draw_set_halign(fa_left); @@ -54,37 +54,19 @@ draw_set_halign(fa_left); repeat (45) { l += 1; // draw_text(x+6,y-10+(l*14),"."+string(lines[31-l])); - draw_set_color(38144); - if (lines_color[l] == "red") { - draw_set_color(c_red); - } - if (lines_color[l] == "yellow") { - draw_set_color(3055825); - } - if (lines_color[l] == "purple") { - draw_set_color(16646566); - } - if (lines_color[l] == "bright") { - draw_set_color(65280); - } - if (lines_color[l] == "white") { - draw_set_color(c_silver); - } - if (lines_color[l] == "blue") { - draw_set_color(c_aqua); - } - draw_text(x + 6, y - 10 + (l * 18), string_hash_to_newline(string(lines[l]))); + draw_set_color(lines_color[l]); + draw_text_ext(x + 6, y - 10 + (l * 18), string(lines[l]), 1, 795); } -draw_set_color(38144); +draw_set_color(COL_GREEN); draw_set_halign(fa_center); -if (battle_stage == eBATTLE_STAGE.Start) { - draw_text(400, 860, string_hash_to_newline("[Press Enter to Begin]")); +if (battle_stage == eBATTLE_STAGE.Main) { + draw_text(400, 860, "[Press Enter to Begin]"); } else if (battle_stage == eBATTLE_STAGE.PlayerWinEnd || battle_stage == eBATTLE_STAGE.EnemyWinEnd) { - draw_text(400, 860, string_hash_to_newline("[Press Enter to Exit]")); + draw_text(400, 860, "[Press Enter to Exit]"); } else if (turn_stage == eBATTLE_TURN.PlayerStart || turn_stage == eBATTLE_TURN.EnemyStart) { - draw_text(400, 860, string_hash_to_newline("[Press Enter to Continue]")); + draw_text(400, 860, "[Press Enter to Continue]"); } draw_set_alpha(fading_strength); diff --git a/objects/obj_ncombat/Step_0.gml b/objects/obj_ncombat/Step_0.gml index 1dbeffdaa6..8cb7e55d3d 100644 --- a/objects/obj_ncombat/Step_0.gml +++ b/objects/obj_ncombat/Step_0.gml @@ -1,19 +1,3 @@ -enum eBATTLE_TURN { - PlayerStart, - PlayerEnd, - EnemyStart, - EnemyEnd, -} - -enum eBATTLE_STAGE { - Creation, - Start, - PlayerWinStart, - PlayerWinEnd, - EnemyWinStart, - EnemyWinEnd -} - if (fading_strength > 0) { fading_strength -= 0.05; } @@ -60,7 +44,7 @@ if (battle_stage == eBATTLE_STAGE.Creation) { ncombat_ally_init(); - battle_stage = eBATTLE_STAGE.Start; + battle_stage = eBATTLE_STAGE.Main; if (obj_ncombat.enemy == 30 || battle_special == "ship_demon") { turn_stage = eBATTLE_TURN.PlayerEnd; @@ -71,7 +55,7 @@ if (keyboard_check_pressed(vk_enter) && fading_strength == 0) { if (turn_stage == eBATTLE_TURN.PlayerStart || turn_stage == eBATTLE_TURN.EnemyStart) { turn_count++; global_perils -= 1; - queue_battlelog_message($"Turn {turn_count}", 1, "yellow"); + queue_battlelog_message($"Turn {turn_count}", COL_YELLOW); resolve_battle_state(); display_message_queue(); @@ -86,8 +70,6 @@ if (keyboard_check_pressed(vk_enter) && fading_strength == 0) { } } display_message_queue(); - queue_player_force_health(); - display_message_queue(); } if (turn_stage == eBATTLE_TURN.PlayerStart) { @@ -100,10 +82,11 @@ if (keyboard_check_pressed(vk_enter) && fading_strength == 0) { enunit_enemy_profiles_init(); } display_message_queue(); - queue_enemy_force_health(); - display_message_queue(); } + queue_force_health(); + display_message_queue(); + turn_stage = (turn_stage == eBATTLE_TURN.PlayerStart) ? eBATTLE_TURN.PlayerEnd : eBATTLE_TURN.EnemyEnd; } @@ -147,7 +130,7 @@ if (keyboard_check_pressed(vk_enter) && fading_strength == 0) { pnunit_dying_process(); } - ncombat_special_battle(); + ncombat_special_end(); } } diff --git a/scripts/scr_colors_initialize/scr_colors_initialize.gml b/scripts/scr_colors_initialize/scr_colors_initialize.gml index 32dc83a3b4..2a5683bf4a 100644 --- a/scripts/scr_colors_initialize/scr_colors_initialize.gml +++ b/scripts/scr_colors_initialize/scr_colors_initialize.gml @@ -1,8 +1,9 @@ -#macro COL_YELLOW #e6b319 -#macro COL_GREEN #50a076 +#macro COL_YELLOW #e6bb3b #macro COL_RED #bf4040 -#macro COL_PURPLE #c3229b -#macro COL_BRIGHT_GREEN #30c075 +#macro COL_PURPLE #a5498e +#macro COL_GREEN #50a076 +#macro COL_DARK_GREEN #4c8b6b +#macro COL_BRIGHT_GREEN #5ec48f #macro COL_WHITE #e6e6e6 #macro COL_BLUE #196be6 diff --git a/scripts/scr_flavor/scr_flavor.gml b/scripts/scr_flavor/scr_flavor.gml index 86327285a4..d4e6803af5 100644 --- a/scripts/scr_flavor/scr_flavor.gml +++ b/scripts/scr_flavor/scr_flavor.gml @@ -1,58 +1,3 @@ -#macro BATTLELOG_MAX_PER_TURN 24 - -function queue_enemy_force_health() { - var _text = ""; - - if (enemy_forces > 0) { - _text = $"The enemy forces are at {string(max(1, round((enemy_forces / enemy_max) * 100)))}% strength!"; - } else { - _text = "The enemy forces are defeated!"; - } - - queue_battlelog_message(_text, -50, "yellow"); -} - -function queue_player_force_health() { - var _text = ""; - - if (player_forces > 0) { - _text = $"The {global.chapter_name} are at {string(round((player_forces / player_max) * 100))}% strength!"; - } else { - _text = $"The {global.chapter_name} are defeated!"; - } - - queue_battlelog_message(_text, -50, "yellow"); -} - - -function display_message_queue() { - while (!ds_priority_empty(messages_queue) && messages_shown < BATTLELOG_MAX_PER_TURN) { - var _message = ds_priority_delete_max(messages_queue); - newline = _message.message; - newline_color = _message.color; - messages_shown += 1; - scr_newtext(); - } - messages_shown = 0; - ds_priority_clear(messages_queue); -} - -/// @function queue_battlelog_message -/// @param {string} _message - The message text to add to the battle log -/// @param {real} [_message_size=0] - The size/importance of the message (higher values = higher display priority; affects sorting order) -/// @param {real} [_message_priority=0] - The priority level (affects sorting and text color: 0=normal, 135=blue, 134=purple) -/// @returns {real} The index of the newly added message -function queue_battlelog_message(_message, _message_priority = 0, _message_color = COL_GREEN) { - if (instance_exists(obj_ncombat)) { - var _message_struct = { - message: _message, - color: _message_color - } - - ds_priority_add(obj_ncombat.messages_queue, _message_struct, _message_priority) - } -} - /// @mixin function scr_flavor(_weapon_stack, _target_object, _target_i, casulties) { @@ -424,7 +369,6 @@ function scr_flavor(_weapon_stack, _target_object, _target_i, casulties) { } } - var message_priority = 0; if (obj_ncombat.enemy <= 10) { if (target_name = obj_controller.faction_leader[obj_ncombat.enemy]) { // Cleaning up the message for the enemy leader leader_message = string_replace(leader_message, "a " + target_name, target_name); @@ -434,29 +378,20 @@ function scr_flavor(_weapon_stack, _target_object, _target_i, casulties) { if (obj_ncombat.enemy = 6) and (obj_controller.faction_gender[6] = 1) then leader_message = string_replace(leader_message, "it", "him"); if (obj_ncombat.enemy = 6) and (obj_controller.faction_gender[6] = 2) then leader_message = string_replace(leader_message, "it", "her"); if (obj_ncombat.enemy != 6) and (obj_ncombat.enemy != 5) then leader_message = string_replace(leader_message, "it", "him"); - message_priority = 5; } } - var message_size = 0; - if (defenses == 1) { - message_size = 999; - } else if (casulties == 0) { - message_size = number_of_shots / 10; - } else { - if (target.dudes_vehicle[targeh] == 1) { - message_size = casulties * 10; - } - else { - message_size = casulties; - } + var message_color = COL_DARK_GREEN; + if (defenses == 1 || casulties != 0) { + message_color = COL_BRIGHT_GREEN; } if (attack_message != "") { - queue_battlelog_message(attack_message, message_size); + obj_ncombat.queue_battlelog_message(attack_message, message_color); } if (leader_message != "") { - queue_battlelog_message(leader_message, message_size); + message_color = COL_BRIGHT_GREEN; + obj_ncombat.queue_battlelog_message(leader_message, message_color); } } diff --git a/scripts/scr_flavor2/scr_flavor2.gml b/scripts/scr_flavor2/scr_flavor2.gml index 2e0fd47bb5..628b93a2b3 100644 --- a/scripts/scr_flavor2/scr_flavor2.gml +++ b/scripts/scr_flavor2/scr_flavor2.gml @@ -7,7 +7,6 @@ function scr_flavor2(lost_units_count, target_type, hostile_range, hostile_weapo _message = $"INVALID! lost_units_count:{lost_units_count} target_type:{target_type} hostile_range:{hostile_range} hostile_weapon:{hostile_weapon} hostile_shots:{hostile_shots}"; _attack_text = ""; _loss_text = ""; - var _message_color = COL_GREEN; var _hostile_weapon, _hostile_shots; _hostile_weapon = ""; @@ -271,12 +270,12 @@ function scr_flavor2(lost_units_count, target_type, hostile_range, hostile_weapo } if (string_length(_message) > 3) { - queue_battlelog_message(_message, 999, COL_RED); + obj_ncombat.queue_battlelog_message(_message, COL_RED); } if (obj_nfort.hp[1] <= 0) { s = 0; him = 0; - queue_battlelog_message("The fortified wall has been breached!", 999, COL_RED); + obj_ncombat.queue_battlelog_message("The fortified wall has been breached!", COL_RED); obj_ncombat.wall_destroyed = 1; with(obj_nfort) { instance_destroy(); @@ -299,6 +298,7 @@ function scr_flavor2(lost_units_count, target_type, hostile_range, hostile_weapo } } + var _message_color = COL_GREEN; if (loss_list != " ") { if (hostile_weapon == "Web Spinner") { loss_list += (lost_units_count == 1) ? " has been incapacitated." : " have been incapacitated."; @@ -313,6 +313,6 @@ function scr_flavor2(lost_units_count, target_type, hostile_range, hostile_weapo _message = _attack_text + _loss_text; - var _message_priority = lost_units_count <= 0 ? hostile_shots / 100 : lost_units_count; - queue_battlelog_message(_message, _message_priority, _message_color); + // var _message_priority = lost_units_count <= 0 ? hostile_shots / 100 : lost_units_count; + obj_ncombat.queue_battlelog_message(_message, _message_color); } diff --git a/scripts/scr_lines_increase/scr_lines_increase.gml b/scripts/scr_lines_increase/scr_lines_increase.gml index 1cc1409130..0729d1050b 100644 --- a/scripts/scr_lines_increase/scr_lines_increase.gml +++ b/scripts/scr_lines_increase/scr_lines_increase.gml @@ -8,7 +8,7 @@ function scr_lines_increase(argument0) { lines[lin]=lines[lin+1]; lines_color[lin]=lines_color[lin+1]; - if (string_count("Defeated",lines[lin])=1) then lines_color[lin]="yellow"; + if (string_count("Defeated",lines[lin])=1) then lines_color[lin]=COL_YELLOW; // lines[lin-1]=lines[lin]; } } diff --git a/scripts/scr_marine_struct/scr_marine_struct.gml b/scripts/scr_marine_struct/scr_marine_struct.gml index 052469221d..0c5bd2ffbf 100644 --- a/scripts/scr_marine_struct/scr_marine_struct.gml +++ b/scripts/scr_marine_struct/scr_marine_struct.gml @@ -2269,7 +2269,7 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} var _dice_roll = roll_personal_dice(1, _psionic_difficulty, "high", self); if (_dice_roll == _psionic_difficulty) { psionic++; - queue_battlelog_message($"{name_role()} was touched by the warp!", 999, 135); + obj_ncombat.queue_battlelog_message($"{name_role()} was touched by the warp!", c_aqua); } } }; diff --git a/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml b/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml index 888399115f..2490beff83 100644 --- a/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml +++ b/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml @@ -1,3 +1,19 @@ +enum eBATTLE_TURN { + PlayerStart, + PlayerEnd, + EnemyStart, + EnemyEnd, +} + +enum eBATTLE_STAGE { + Creation, + Main, + PlayerWinStart, + PlayerWinEnd, + EnemyWinStart, + EnemyWinEnd +} + // alarm_0 /// @mixin function ncombat_enemy_stacks_init() { @@ -3735,7 +3751,7 @@ function ncombat_battle_start() { if ((obj_ini.occulobe) && (battle_special != "space_hulk")) { if ((time == 5) || (time == 6)) { newline = "The morning light of dawn is blinding your marines!"; - newline_color = "red"; + newline_color = COL_RED; scr_newtext(); } } @@ -4179,7 +4195,7 @@ function ncombat_battle_end() { var _total_injured = _total_deaths + injured + units_saved_count; if (_total_injured > 0) { newline = $"{string_plural_count("unit", _total_injured)} {smart_verb("was", _total_injured)} critically injured."; - newline_color = "red"; + newline_color = COL_RED; scr_newtext(); if (units_saved_count > 0) { @@ -4199,7 +4215,7 @@ function ncombat_battle_end() { if (injured > 0) { newline = $"{injured}x survived thanks to the Sus-an Membrane."; - newline_color = "red"; + newline_color = COL_RED; scr_newtext(); } @@ -4213,7 +4229,7 @@ function ncombat_battle_end() { _units_lost_string += smart_delimeter_sign(_unit_roles, i, false); } newline += $"{_total_deaths} units succumbed to their wounds! ({_units_lost_string})"; - newline_color = "red"; + newline_color = COL_RED; scr_newtext(); } @@ -4258,7 +4274,7 @@ function ncombat_battle_end() { } newline = voodoo; - newline_color = "red"; + newline_color = COL_RED; scr_newtext(); newline = " "; scr_newtext(); @@ -4270,7 +4286,7 @@ function ncombat_battle_end() { var _total_damaged_count = vehicle_deaths + vehicles_saved_count; if (_total_damaged_count > 0) { newline = $"{string_plural_count("vehicle", _total_damaged_count)} {smart_verb("was", _total_damaged_count)} critically damaged during battle."; - newline_color = "red"; + newline_color = COL_RED; scr_newtext(); if (vehicles_saved_count > 0) { @@ -4300,7 +4316,7 @@ function ncombat_battle_end() { } newline += $"{vehicle_deaths} {smart_verb("was", vehicle_deaths)} lost forever. ({_vehicles_lost_string})"; - newline_color = "red"; + newline_color = COL_RED; scr_newtext(); } @@ -4355,7 +4371,7 @@ function ncombat_battle_end() { if (slime > 0) { var slime_string = $"Faulty Mucranoid and other afflictions have caused damage to the equipment. {slime} Forge Points will be allocated for repairs."; newline = slime_string; - newline_color = "red"; + newline_color = COL_RED; scr_newtext(); newline = " "; @@ -4439,7 +4455,7 @@ function ncombat_battle_end() { part10 += string(ex) + "%"; newline = part10; if (ex == 100) { - newline_color = "red"; + newline_color = COL_RED; } scr_newtext(); @@ -4460,7 +4476,7 @@ function ncombat_battle_end() { if (loot == 1) { newline = "Resources have been recovered."; } - newline_color = "yellow"; + newline_color = COL_YELLOW; scr_newtext(); } } @@ -4472,7 +4488,7 @@ function ncombat_battle_end() { if (defeat == 1) { newline = "Failed to clear Ancient Ruins."; } - newline_color = "yellow"; + newline_color = COL_YELLOW; scr_newtext(); } @@ -4705,7 +4721,7 @@ function ncombat_battle_end() { if ((enemy == 8) && (ethereal > 0) && (defeat == 0)) { newline = "Tau Ethereal Captured"; - newline_color = "yellow"; + newline_color = COL_YELLOW; scr_newtext(); } @@ -4719,13 +4735,13 @@ function ncombat_battle_end() { // scr_check_equip("Plasma Bomb",battle_loc,battle_id,1); // scr_check_equip("Plasma Bomb","","",1); newline = "Plasma Bomb used to seal the Necron Tomb."; - newline_color = "yellow"; + newline_color = COL_YELLOW; scr_newtext(); seal_tomb_world(battle_object.p_feature[battle_id]); } if (plasma_bomb <= 0) { - battle_object.p_necrons[battle_id] = 3; // newline_color="yellow"; + battle_object.p_necrons[battle_id] = 3; // newline_color=COL_YELLOW; if (dropping != 0) { newline = "Deep Strike Ineffective; Plasma Bomb required"; } @@ -4753,7 +4769,7 @@ function ncombat_battle_end() { var bombs;bombs=scr_check_equip("Plasma Bomb",battle_loc,battle_id,0); if (bombs>0){ scr_check_equip("Plasma Bomb",battle_loc,battle_id,1); - newline="Plasma Bomb used to seal the Necron Tomb.";newline_color="yellow";scr_newtext(); + newline="Plasma Bomb used to seal the Necron Tomb.";newline_color=COL_YELLOW;scr_newtext(); if (battle_object.p_feature[battle_id]="Awakened Necron Tomb") then battle_object.p_feature[battle_id]="Necron Tomb"; } }*/ @@ -4806,7 +4822,7 @@ function ncombat_battle_end() { var nep; nep = false; newline = "The enemy Leader has been killed!"; - newline_color = "yellow"; + newline_color = COL_YELLOW; scr_newtext(); newline = line_break; scr_newtext(); @@ -4894,11 +4910,11 @@ function ncombat_battle_end() { obj_controller.disposition[2] -= 2; if (allies == 1) { newline = "Local PDF have been eaten!"; - newline_color = "red"; + newline_color = COL_RED; scr_newtext(); } else if (allies == 2) { newline = "Local Guardsmen have been eaten!"; - newline_color = "red"; + newline_color = COL_RED; scr_newtext(); } } @@ -4940,7 +4956,7 @@ function ncombat_battle_end() { remove = obj_controller.inquisitor[inquisitor_ship.inquisitor]; scr_event_log("red", $"Your Astartes consume {msg}."); } - newline_color = "red"; + newline_color = COL_RED; scr_newtext(); if (obj_controller.inquisitor_type[remove] == "Ordo Hereticus") { scr_loyalty("Inquisitor Killer", "+"); @@ -5002,7 +5018,7 @@ function ncombat_battle_end() { if ((exterminatus > 0) && (dropping != 0)) { newline = "Exterminatus has been succesfully placed."; - newline_color = "yellow"; + newline_color = COL_YELLOW; endline = 0; scr_newtext(); } @@ -5028,7 +5044,7 @@ function ncombat_battle_end() { scr_event_log("red", newline, battle_object.name); instance_activate_object(obj_event_log); - newline_color = "red"; + newline_color = COL_RED; scr_newtext(); var lasers_lost, defenses_lost, silos_lost; @@ -5082,7 +5098,7 @@ function ncombat_battle_end() { battle_object.p_silo[obj_ncombat.battle_id] -= silos_lost; battle_object.p_lasers[obj_ncombat.battle_id] -= lasers_lost; if (defenses_lost + silos_lost + lasers_lost > 0) { - newline_color = "red"; + newline_color = COL_RED; scr_newtext(); } @@ -5119,14 +5135,13 @@ function ncombat_battle_end() { instance_deactivate_object(obj_star); instance_deactivate_object(obj_ground_mission); - show_debug_message($"{battle_stage}"); /* */ /* */ } // alarm_7 /// @mixin -function ncombat_special_battle() { +function ncombat_special_end() { try { // show_debug_message("alarm 7 start"); audio_stop_sound(snd_battle); diff --git a/scripts/scr_newtext/scr_newtext.gml b/scripts/scr_newtext/scr_newtext.gml index d71a556548..2c589f11ed 100644 --- a/scripts/scr_newtext/scr_newtext.gml +++ b/scripts/scr_newtext/scr_newtext.gml @@ -1,29 +1,36 @@ +/// @mixin function scr_newtext() { + // This is ran in the combat object to detect, prepare, and inject the NEWLINE string into the display - // This is ran in the combat object to detect, prepare, and inject the NEWLINE string into the display + if (newline != "") { + var breaks, first_open; + newline = scr_lines(89 + 20, newline); + breaks = max(1, string_count("@", newline)); + first_open = liness + 1; - if (newline!=""){ - var breaks,first_open; - newline=scr_lines(89+20,newline); - breaks=max(1,string_count("@",newline)); - first_open=liness+1; - - var b,f;b=first_open;f=-1; - explode_script(newline,"@"); - f+=1;lines[b+f]=string("-"+explode[f]);lines_color[b+f]=newline_color; - repeat(breaks-1){f+=1; - lines[b+f]=string(explode[f]); - lines_color[b+f]=newline_color; - } - liness+=string_count("@",newline); - - repeat(100){ - // if (liness>30){scr_lines_increase(1);liness-=1;} - if (liness>45){scr_lines_increase(1);liness-=1;} - } - } - - newline="";newline_color=""; + var b, f; + b = first_open; + f = -1; + explode_script(newline, "@"); + f += 1; + lines[b + f] = string("-" + explode[f]); + lines_color[b + f] = newline_color; + repeat (breaks - 1) { + f += 1; + lines[b + f] = string(explode[f]); + lines_color[b + f] = newline_color; + } + liness += string_count("@", newline); + repeat (100) { + // if (liness>30){scr_lines_increase(1);liness-=1;} + if (liness > 45) { + scr_lines_increase(1); + liness -= 1; + } + } + } + newline = ""; + newline_color = COL_GREEN; } diff --git a/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml b/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml index e7b686af0a..6ad03de5c5 100644 --- a/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml +++ b/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml @@ -218,16 +218,12 @@ function pnunit_battle_effects() { } if (r_lost > 0) { - obj_ncombat.newline = miss; - obj_ncombat.newline_color = "red"; - with (obj_ncombat) { - scr_newtext(); - } + obj_ncombat.queue_battlelog_message(miss, COL_RED); } } } - if (obj_ncombat.battle_stage >= eBATTLE_STAGE.Start) { + if (obj_ncombat.battle_stage >= eBATTLE_STAGE.Main) { // Should probably have the option under deployment to say 'Should Assault Marines enter the fray with vehicles?' [ ] } diff --git a/scripts/scr_powers/scr_powers.gml b/scripts/scr_powers/scr_powers.gml index 87f75c9d1e..4b7f63965f 100644 --- a/scripts/scr_powers/scr_powers.gml +++ b/scripts/scr_powers/scr_powers.gml @@ -90,7 +90,7 @@ function scr_powers(caster_id) { } else { _cast_flavour_text = $"{_unit.name_role()} failed to cast {_power_name}!"; _battle_log_message = _cast_flavour_text; - queue_battlelog_message(_battle_log_message, 999, COL_RED); + obj_ncombat.queue_battlelog_message(_battle_log_message, COL_RED); } //* Buff powers casting code @@ -167,7 +167,7 @@ function scr_powers(caster_id) { } _battle_log_message = _cast_flavour_text + _power_flavour_text; - queue_battlelog_message(_battle_log_message, 999, COL_BRIGHT_GREEN); + obj_ncombat.queue_battlelog_message(_battle_log_message, COL_BRIGHT_GREEN); } else if (_power_type == "attack" && _cast_successful) { //* Attack power casting //TODO: separate the code bellow into a separate function; @@ -259,16 +259,16 @@ function scr_powers(caster_id) { // Log battle message to combat feed _battle_log_message = _cast_flavour_text + _power_flavour_text + _casualties_flavour_text; - if (_casualties == 0) { - _battle_log_priority = _final_damage / 50; // Just to have some priority here, as they don't have the usual "shots fired" - } else { - if (_target_is_vehicle) { - _battle_log_priority = _casualties * 12; // Vehicles are more juicy - } else { - _battle_log_priority = _casualties * 3; // More casualties = higher priority messages - } - } - queue_battlelog_message(_battle_log_message, _battle_log_priority, COL_PURPLE); + // if (_casualties == 0) { + // _battle_log_priority = _final_damage / 50; // Just to have some priority here, as they don't have the usual "shots fired" + // } else { + // if (_target_is_vehicle) { + // _battle_log_priority = _casualties * 12; // Vehicles are more juicy + // } else { + // _battle_log_priority = _casualties * 3; // More casualties = higher priority messages + // } + // } + obj_ncombat.queue_battlelog_message(_battle_log_message, COL_PURPLE); } } } @@ -286,7 +286,7 @@ function scr_powers(caster_id) { check_dead_marines(_unit, caster_id); _battle_log_message = _cast_flavour_text + _power_flavour_text; - queue_battlelog_message(_battle_log_message, 999, COL_RED); + obj_ncombat.queue_battlelog_message(_battle_log_message, COL_RED); } } From 7a3693fb17fd8d15706f3549fa91a166bc90cf3b Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Mon, 21 Apr 2025 01:49:44 +0300 Subject: [PATCH 66/80] I can't keep stashing this huge pile of stuff --- ChapterMaster.yyp | 3 + datafiles/data/army_profiles.jsonc | 84 + datafiles/data/squad_profiles.jsonc | 181 ++ datafiles/data/unit_profiles.jsonc | 1942 +++++++++++++++++ objects/obj_controller/KeyPress_73.gml | 43 - objects/obj_enunit/Create_0.gml | 126 +- objects/obj_enunit/Draw_0.gml | 61 +- objects/obj_enunit/Step_0.gml | 2 - objects/obj_enunit/obj_enunit.yy | 1 - objects/obj_ncombat/Create_0.gml | 5 + objects/obj_ncombat/Step_0.gml | 37 +- objects/obj_pnunit/Create_0.gml | 2 +- objects/obj_pnunit/Draw_0.gml | 6 +- scripts/scr_clean/scr_clean.gml | 22 +- scripts/scr_en_weapon/scr_en_weapon.gml | 15 +- .../scr_enunit_scripts/scr_enunit_scripts.gml | 1783 +-------------- scripts/scr_flavor/scr_flavor.gml | 2 +- .../scr_ncombat_scripts.gml | 185 +- scripts/scr_perils_table/scr_perils_table.gml | 1 - .../scr_pnunit_scripts/scr_pnunit_scripts.gml | 12 +- .../scr_punit_combat_heplers.gml | 88 +- scripts/scr_shoot/scr_shoot.gml | 60 +- .../scr_string_functions.gml | 20 +- scripts/scr_target/scr_target.gml | 19 +- .../scr_weapon_stacks/scr_weapon_stacks.gml | 53 +- 25 files changed, 2564 insertions(+), 2189 deletions(-) create mode 100644 datafiles/data/army_profiles.jsonc create mode 100644 datafiles/data/squad_profiles.jsonc create mode 100644 datafiles/data/unit_profiles.jsonc delete mode 100644 objects/obj_controller/KeyPress_73.gml delete mode 100644 objects/obj_enunit/Step_0.gml diff --git a/ChapterMaster.yyp b/ChapterMaster.yyp index bee3e5e121..138061aa63 100644 --- a/ChapterMaster.yyp +++ b/ChapterMaster.yyp @@ -115,9 +115,12 @@ ], "ForcedPrefabProjectReferences":[], "IncludedFiles":[ + {"$GMIncludedFile":"","%Name":"army_profiles.jsonc","CopyToMask":-1,"filePath":"datafiles/data","name":"army_profiles.jsonc","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"psychic_disciplines.json","CopyToMask":-1,"filePath":"datafiles/data","name":"psychic_disciplines.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"psychic_powers.json","CopyToMask":-1,"filePath":"datafiles/data","name":"psychic_powers.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, + {"$GMIncludedFile":"","%Name":"squad_profiles.jsonc","CopyToMask":-1,"filePath":"datafiles/data","name":"squad_profiles.jsonc","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"traits.json","CopyToMask":-1,"filePath":"datafiles/data","name":"traits.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, + {"$GMIncludedFile":"","%Name":"unit_profiles.jsonc","CopyToMask":-1,"filePath":"datafiles/data","name":"unit_profiles.jsonc","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"1.png","CopyToMask":-1,"filePath":"datafiles/images/advisor/splash","name":"1.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"11.png","CopyToMask":-1,"filePath":"datafiles/images/advisor/splash","name":"11.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"12.png","CopyToMask":-1,"filePath":"datafiles/images/advisor/splash","name":"12.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, diff --git a/datafiles/data/army_profiles.jsonc b/datafiles/data/army_profiles.jsonc new file mode 100644 index 0000000000..3a45d6d1e4 --- /dev/null +++ b/datafiles/data/army_profiles.jsonc @@ -0,0 +1,84 @@ +{ + "orks_6": { + "name": "Huge Ork Army", + "description": "A huge army of green gigachads.", + "columns": [ + { + "units": [ + { + "name": "deff_dread", + "count": 36 + }, + { + "name": "battlewagon", + "count": 220 + } + ], + "squads": [ + { + "name": "gretchins", + "count": 70 + }, + { + "name": "tankbustas", + "count": 6 + }, + { + "name": "meganobz", + "count": 8 + } + ] + }, + { + "squads": [ + { + "name": "slugga_boyz", + "count": 40 + }, + { + "name": "ard_boyz", + "count": 20 + } + ] + }, + { + "squads": [ + { + "name": "slugga_boyz", + "count": 20 + }, + { + "name": "ard_boyz", + "count": 30 + }, + { + "name": "shoota_boyz", + "count": 60 + } + ] + }, + { + "units": [ + { + "name": "mekboy", + "count": 6 + }, + { + "name": "warboss", + "count": 1 + } + ], + "squads": [ + { + "name": "flash_gitz", + "count": 5 + }, + { + "name": "kommandos", + "count": 2 + } + ] + } + ] + } +} \ No newline at end of file diff --git a/datafiles/data/squad_profiles.jsonc b/datafiles/data/squad_profiles.jsonc new file mode 100644 index 0000000000..e9c8d344c8 --- /dev/null +++ b/datafiles/data/squad_profiles.jsonc @@ -0,0 +1,181 @@ +{ + "flash_gitz": { + "display_name": "Flash Gitz", + "members": { + "flash_git": { + "count": 9, + "weapons": [ + "Snazzgun", + "Stickkbombs" + ] + }, + "kaptin": { + "count": 1, + "weapons": [ + "Snazzgun", + "Stickkbombs" + ] + } + } + }, + "kommandos": { + "display_name": "Kommandos", + "members": { + "kommando": { + "count": 14, + "weapons": [ + "Choppa", + "Slugga", + "Stickkbombs" + ] + }, + "boss_nob": { + "count": 1, + "weapons": [ + "Choppa", + "Slugga", + "Stickkbombs" + ] + } + } + }, + "slugga_boyz": { + "display_name": "Slugga Boyz", + "members": { + "ork_boy": { + "display_name": "Slugga Boy", + "count": 29, + "weapons": [ + "Choppa", + "Slugga", + "Stickkbombs" + ] + }, + "boss_nob": { + "count": 1, + "weapons": [ + "Choppa", + "Slugga", + "Stickkbombs" + ] + } + } + }, + "shoota_boyz": { + "display_name": "Shoota Boyz", + "members": { + "ork_boy": { + "display_name": "Shoota Boy", + "count": 29, + "weapons": [ + "Choppa", + "Shoota", + "Stickkbombs" + ] + }, + "boss_nob": { + "count": 1, + "weapons": [ + "Choppa", + "Shoota", + "Stickkbombs" + ] + } + } + }, + "ard_boyz": { + "display_name": "Ard Boyz", + "members": { + "ard_boy": { + "count": 29, + "weapons": [ + "Choppa", + "Slugga", + "Stickkbombs" + ] + }, + "boss_nob": { + "count": 1, + "weapons": [ + "Choppa", + "Slugga", + "Stickkbombs" + ] + } + } + }, + "gretchins": { + "display_name": "Gretchins", + "members": { + "gretchin": { + "count": 30, + "weapons": [ + "Grot Blasta" + ] + }, + "ork_boy": { + "display_name": "Runtherds", + "count": 3, + "weapons": [ + "Grabba Stikk", + "Slugga", + "Stickkbombs" + ] + } + } + }, + "tankbustas": { + "display_name": "Tankbustas", + "members": { + "tankbusta": { + "count": 14, + "weapons": [ + "Rokkit Launcha", + "Tankbusta Bomb" + ] + }, + "boss_nob": { + "count": 1, + "weapons": [ + "Choppa", + "Rokkit Launcha", + "Stikkbombs" + ] + } + } + }, + "meganobz": { + "display_name": "Meganobz", + "members": { + "meganob": { + "count": 9, + "weapons": [ + "Twin-Linked Shoota", + "Power Klaw", + "Stikkbombs" + ] + }, + "boss_meganob": { + "count": 1, + "weapons": [ + "Twin-Linked Shoota", + "Power Klaw", + "Stikkbombs" + ] + } + } + }, + "warboss": { + "display_name": "Warboss", + "members": { + "warboss": { + "count": 1, + "weapons": [ + "Twin-Linked Shoota", + "Power Klaw", + "Stikkbombs" + ] + } + } + } +} \ No newline at end of file diff --git a/datafiles/data/unit_profiles.jsonc b/datafiles/data/unit_profiles.jsonc new file mode 100644 index 0000000000..2c706cdea0 --- /dev/null +++ b/datafiles/data/unit_profiles.jsonc @@ -0,0 +1,1942 @@ +{ + "malcadon_spyrer": { + "display_name": "Malcadon Spyrer", + "armour": 35, + "health": 200, + "resistance": 1, + "weapons": [ + "Web Spinner", + "Venom Claws" + ], + "unit_type": 1, + "unit_size": 1 + }, + "greater_daemon_of_khorne": { + "display_name": "Greater Daemon of Khorne", + "armour": 12, + "health": 700, + "resistance": 0.5, + "weapons": [ + "Khorne Demon Melee" + ], + "unit_type": 1, + "unit_size": 3 + }, + "greater_daemon_of_slaanesh": { + "display_name": "Greater Daemon of Slaanesh", + "armour": 10, + "health": 500, + "resistance": 0.25, + "weapons": [ + "Demon Melee", + "Lash Whip" + ], + "unit_type": 1, + "unit_size": 3 + }, + "greater_daemon_of_nurgle": { + "display_name": "Greater Daemon of Nurgle", + "armour": 8, + "health": 900, + "resistance": 0.6, + "weapons": [ + "Demon Melee", + "Nurgle Vomit" + ], + "unit_type": 1, + "unit_size": 3 + }, + "greater_daemon_of_tzeentch": { + "display_name": "Greater Daemon of Tzeentch", + "armour": 10, + "health": 600, + "resistance": 0.75, + "weapons": [ + "Demon Melee", + "Witchfire" + ], + "unit_type": 1, + "unit_size": 3 + }, + "bloodletter": { + "display_name": "Bloodletter", + "armour": 10, + "health": 200, + "resistance": 0.4, + "weapons": [ + "Bloodletter Melee" + ], + "unit_type": 1, + "unit_size": 1 + }, + "daemonette": { + "display_name": "Daemonette", + "armour": 8, + "health": 150, + "resistance": 0.3, + "weapons": [ + "Daemonette Melee" + ], + "unit_type": 1, + "unit_size": 1 + }, + "pink_horror": { + "display_name": "Pink Horror", + "armour": 8, + "health": 100, + "resistance": 0.5, + "weapons": [ + "Eldritch Fire" + ], + "unit_type": 1, + "unit_size": 1 + }, + "plaguebearer": { + "display_name": "Plaguebearer", + "armour": 5, + "health": 300, + "resistance": 0.4, + "weapons": [ + "Plaguebearer Melee" + ], + "unit_type": 1, + "unit_size": 1 + }, + "helbrute": { + "display_name": "Helbrute", + "armour": 40, + "health": 300, + "resistance": 0.5, + "weapons": [ + "Power Fist", + "Multi-Melta" + ], + "unit_type": 1, + "unit_size": 16 + }, + "soul_grinder": { + "display_name": "Soul Grinder", + "armour": 30, + "health": 350, + "resistance": 0.5, + "weapons": [ + "Warpsword", + "Iron Claw", + "Battle Cannon" + ], + "unit_type": 1, + "unit_size": 16 + }, + "maulerfiend": { + "display_name": "Maulerfiend", + "armour": 30, + "health": 250, + "resistance": 0.5, + "weapons": [ + "Maulerfiend Claws" + ], + "unit_type": 1, + "unit_size": 16 + }, + "imperial_guardsman": { + "display_name": "Imperial Guardsman", + "armour": 40, + "health": 5, + "resistance": 1, + "weapons": [], + "unit_type": 1, + "unit_size": 1 + }, + "heavy_weapons_team": { + "display_name": "Heavy Weapons Team", + "armour": 10, + "health": 100, + "resistance": 0.9, + "weapons": [ + "Heavy Bolter" + ], + "unit_type": 1, + "unit_size": 1 + }, + "ogryn": { + "display_name": "Ogryn", + "armour": 10, + "health": 120, + "resistance": 0.75, + "weapons": [ + "Ripper Gun", + "Ogryn Melee" + ], + "unit_type": 1, + "unit_size": 1 + }, + "chimera": { + "display_name": "Chimera", + "armour": 40, + "health": 200, + "resistance": 0.75, + "weapons": [ + "Multi-Laster", + "Heavy Bolter" + ], + "unit_type": 1, + "unit_size": 16 + }, + "basilisk": { + "display_name": "Basilisk", + "armour": 20, + "health": 150, + "resistance": 1, + "weapons": [ + "Earthshaker Cannon", + "Storm Bolter" + ], + "unit_type": 1, + "unit_size": 16 + }, + "leman_russ_battle_tank": { + "display_name": "Leman Russ Battle Tank", + "armour": 45, + "health": 250, + "resistance": 0.25, + "weapons": [ + "Battle Cannon", + "Lascannon" + ], + "unit_type": 1, + "unit_size": 16 + }, + "leman_russ_demolisher": { + "display_name": "Leman Russ Demolisher", + "armour": 40, + "health": 250, + "resistance": 0.25, + "weapons": [ + "Demolisher Cannon", + "Lascannon" + ], + "unit_type": 1, + "unit_size": 16 + }, + "vendetta": { + "display_name": "Vendetta", + "armour": 20, + "health": 300, + "resistance": 0.25, + "weapons": [ + "Twin-Linked Lascannon", + "Twin-Linked Lascannon", + "Twin-Linked Lascannon" + ], + "unit_type": 1, + "unit_size": 16 + }, + "thallax": { + "display_name": "Thallax", + "armour": 30, + "health": 80, + "resistance": 1, + "weapons": [ + "Lightning Gun", + "Thallax Melee" + ], + "unit_type": 1, + "unit_size": 1 + }, + "praetorian_servitor": { + "display_name": "Praetorian Servitor", + "armour": 25, + "health": 150, + "resistance": 1, + "weapons": [ + "Phased Plasma-fusil" + ], + "unit_type": 1, + "unit_size": 1 + }, + "adeptas_leader": { + "display_name": "Adeptas Leader", + "armour": 10, + "health": 200, + "resistance": 0.25, + "weapons": [ + "Blessed Weapon", + "Laser Mace", + "Infernus Pistol" + ], + "unit_type": 1, + "unit_size": 1 + }, + "palatine": { + "display_name": "Palatine", + "armour": 10, + "health": 100, + "resistance": 0.5, + "weapons": [ + "Plasma Pistol", + "Power Weapon" + ], + "unit_type": 1, + "unit_size": 1 + }, + "priest": { + "display_name": "Priest", + "armour": 0, + "health": 50, + "resistance": 0.5, + "weapons": [ + "Laspistol" + ], + "unit_type": 1, + "unit_size": 1 + }, + "arco_flagellent": { + "display_name": "Arco-Flagellent", + "armour": 0, + "health": 150, + "resistance": 0.7, + "weapons": [ + "Electro-Flail" + ], + "unit_type": 1, + "unit_size": 1 + }, + "celestian": { + "display_name": "Celestian", + "armour": 10, + "health": 60, + "resistance": 0.5, + "weapons": [ + "Bolter", + "Chainsword" + ], + "unit_type": 1, + "unit_size": 1 + }, + "mistress": { + "display_name": "Mistress", + "armour": 10, + "health": 60, + "resistance": 0.5, + "weapons": [ + "Neural Whip" + ], + "unit_type": 1, + "unit_size": 1 + }, + "sister_repentia": { + "display_name": "Sister Repentia", + "armour": 0, + "health": 75, + "resistance": 0.75, + "weapons": [ + "Eviscerator" + ], + "unit_type": 1, + "unit_size": 1 + }, + "battle_sister": { + "display_name": "Battle Sister", + "armour": 10, + "health": 60, + "resistance": 0.75, + "weapons": [ + "Bolter", + "Flamer", + "Sarissa" + ], + "unit_type": 1, + "unit_size": 1 + }, + "seraphim": { + "display_name": "Seraphim", + "armour": 10, + "health": 60, + "resistance": 0.6, + "weapons": [ + "Seraphim Pistols", + "Chainsword" + ], + "unit_type": 1, + "unit_size": 1 + }, + "dominion": { + "display_name": "Dominion", + "armour": 10, + "health": 60, + "resistance": 0.75, + "weapons": [ + "Meltagun", + "Meltabomb" + ], + "unit_type": 1, + "unit_size": 1 + }, + "retributor": { + "display_name": "Retributor", + "armour": 10, + "health": 60, + "resistance": 0.6, + "weapons": [ + "Heavy Bolter", + "Missile Launcher", + "Bolt Pistol" + ], + "unit_type": 1, + "unit_size": 1 + }, + "follower": { + "display_name": "Follower", + "armour": 0, + "health": 30, + "resistance": 1, + "weapons": [ + "Laspistol", + "melee0.5" + ], + "unit_type": 1, + "unit_size": 1 + }, + "adeptas_rhino": { + "display_name": "Adeptas Rhino", + "armour": 40, + "health": 200, + "resistance": 0.75, + "weapons": [ + "Storm Bolter", + "Storm Bolter" + ], + "unit_type": 1, + "unit_size": 16 + }, + "adeptas_chimera": { + "display_name": "Adeptas Chimera", + "armour": 40, + "health": 200, + "resistance": 0.75, + "weapons": [ + "Heavy Flamer", + "Heavy Flamer" + ], + "unit_type": 1, + "unit_size": 16 + }, + "immolator": { + "display_name": "Immolator", + "armour": 40, + "health": 300, + "resistance": 0.35, + "weapons": [ + "Twin Linked Heavy Flamers" + ], + "unit_type": 1, + "unit_size": 16 + }, + "exorcist": { + "display_name": "Exorcist", + "armour": 40, + "health": 200, + "resistance": 0.55, + "weapons": [ + "Exorcist Missile Launcher", + "Storm Bolter" + ], + "unit_type": 1, + "unit_size": 16 + }, + "penitent_engine": { + "display_name": "Penitent Engine", + "armour": 35, + "health": 150, + "resistance": 0.5, + "weapons": [ + "Close Combat Weapon", + "Close Combat Weapon", + "Heavy Flamer" + ], + "unit_type": 1, + "unit_size": 16 + }, + "eldar_leader": { + "display_name": "Eldar Leader", + "armour": 10, + "health": 150, + "resistance": 0.5, + "weapons": [ + "Singing Spear", + "Singing Spear Throw" + ], + "unit_type": 1, + "unit_size": 1 + }, + "autarch": { + "display_name": "Autarch", + "armour": 12, + "health": 150, + "resistance": 0.75, + "weapons": [ + "Power Weapon", + "Fusion Gun" + ], + "unit_type": 1, + "unit_size": 1 + }, + "farseer": { + "display_name": "Farseer", + "armour": 10, + "health": 120, + "resistance": 0.6, + "weapons": [ + "Singing Spear", + "Singing Spear Throw" + ], + "unit_type": 1, + "unit_size": 1, + "abilities": [ + "farseer_powers" + ] + }, + "warlock": { + "display_name": "Warlock", + "armour": 10, + "health": 80, + "resistance": 0.75, + "weapons": [ + "Witchblade", + "Psyshock" + ], + "unit_type": 1, + "unit_size": 1 + }, + "avatar": { + "display_name": "Avatar", + "armour": 40, + "health": 300, + "resistance": 0.55, + "weapons": [ + "Wailing Doom", + "Avatar Smite" + ], + "unit_type": 1, + "unit_size": 16 + }, + "mighty_avatar": { + "display_name": "Mighty Avatar", + "armour": 50, + "health": 450, + "resistance": 0.5, + "weapons": [ + "Wailing Doom", + "Avatar Smite" + ], + "unit_type": 1, + "unit_size": 16 + }, + "godly_avatar": { + "display_name": "Godly Avatar", + "armour": 60, + "health": 600, + "resistance": 0.4, + "weapons": [ + "Wailing Doom", + "Avatar Smite" + ], + "unit_type": 1, + "unit_size": 16 + }, + "ranger": { + "display_name": "Ranger", + "armour": 8, + "health": 40, + "resistance": 0.9, + "weapons": [ + "Ranger Long Rifle", + "Shuriken Pistol" + ], + "unit_type": 1, + "unit_size": 1 + }, + "eldar_pathfinder": { + "display_name": "Eldar Pathfinder", + "armour": 8, + "health": 60, + "resistance": 0.8, + "weapons": [ + "Pathfinder Long Rifle", + "Melee1" + ], + "unit_type": 1, + "unit_size": 1 + }, + "dire_avenger": { + "display_name": "Dire Avenger", + "armour": 10, + "health": 40, + "resistance": 1, + "weapons": [ + "Avenger Shuriken Catapult", + "Melee1" + ], + "unit_type": 1, + "unit_size": 1, + "abilities": [ + "shimmershield" + ] + }, + "dire_avenger_exarch": { + "display_name": "Dire Avenger Exarch", + "armour": 10, + "health": 70, + "resistance": 1, + "weapons": [ + "Power Weapon" + ], + "unit_type": 1, + "unit_size": 1, + "abilities": [ + "shimmershield" + ] + }, + "howling_banshee": { + "display_name": "Howling Banshee", + "armour": 8, + "health": 40, + "resistance": 0.8, + "weapons": [ + "Power Weapon", + "Shuriken Pistol" + ], + "unit_type": 1, + "unit_size": 1, + "abilities": [ + "banshee_mask" + ] + }, + "howling_banshee_exarch": { + "display_name": "Howling Banshee Exarch", + "armour": 10, + "health": 60, + "resistance": 0.75, + "weapons": [ + "Executioner" + ], + "unit_type": 1, + "unit_size": 1, + "abilities": [ + "banshee_mask" + ] + }, + "striking_scorpion": { + "display_name": "Striking Scorpion", + "armour": 8, + "health": 60, + "resistance": 1, + "weapons": [ + "Scorpion Chainsword", + "Shuriken Pistol", + "Mandiblaster" + ], + "unit_type": 1, + "unit_size": 1 + }, + "striking_scorpion_exarch": { + "display_name": "Striking Scorpion Exarch", + "armour": 10, + "health": 80, + "resistance": 1, + "weapons": [ + "Biting Blade", + "Scorpion's Claw", + "Mandiblaster" + ], + "unit_type": 1, + "unit_size": 1 + }, + "fire_dragon": { + "display_name": "Fire Dragon", + "armour": 12, + "health": 40, + "resistance": 1, + "weapons": [ + "Fusion Gun", + "Meltabomb", + "Melee1" + ], + "unit_type": 1, + "unit_size": 1 + }, + "fire_dragon_exarch": { + "display_name": "Fire Dragon Exarch", + "armour": 12, + "health": 60, + "resistance": 1, + "weapons": [ + "Firepike", + "Power Weapon" + ], + "unit_type": 1, + "unit_size": 1 + }, + "warp_spider": { + "display_name": "Warp Spider", + "armour": 8, + "health": 40, + "resistance": 0.9, + "weapons": [ + "Deathspinner" + ], + "unit_type": 1, + "unit_size": 1, + "abilities": [ + "warp_jump" + ] + }, + "warp_spider_exarch": { + "display_name": "Warp Spider Exarch", + "armour": 10, + "health": 60, + "resistance": 0.8, + "weapons": [ + "Dual Deathspinners", + "Powerblades" + ], + "unit_type": 1, + "unit_size": 1, + "abilities": [ + "warp_jump" + ] + }, + "dark_reaper": { + "display_name": "Dark Reaper", + "armour": 10, + "health": 40, + "resistance": 1, + "weapons": [ + "Reaper Launcher", + "Melee1" + ], + "unit_type": 1, + "unit_size": 1 + }, + "dark_reaper_exarch": { + "display_name": "Dark Reaper Exarch", + "armour": 10, + "health": 50, + "resistance": 1, + "weapons": [ + "Tempest Launcher", + "Melee1" + ], + "unit_type": 1, + "unit_size": 1 + }, + "shining_spear": { + "display_name": "Shining Spear", + "armour": 10, + "health": 75, + "resistance": 0.8, + "weapons": [ + "Laser Lance", + "Twin Linked Shuriken Catapult" + ], + "unit_type": 1, + "unit_size": 16 + }, + "guardian": { + "display_name": "Guardian", + "armour": 8, + "health": 30, + "resistance": 1, + "weapons": [ + "Shuriken Catapult", + "Melee1" + ], + "unit_type": 1, + "unit_size": 1 + }, + "grav_platform": { + "display_name": "Grav Platform", + "armour": 10, + "health": 60, + "resistance": 1, + "weapons": [ + "Pulse Laser" + ], + "unit_type": 1, + "unit_size": 16 + }, + "trouper": { + "display_name": "Trouper", + "armour": 8, + "health": 50, + "resistance": 0.25, + "weapons": [ + "Power Weapon", + "Fusion Pistol" + ], + "unit_type": 1, + "unit_size": 1 + }, + "athair": { + "display_name": "Athair", + "armour": 8, + "health": 75, + "resistance": 0.25, + "weapons": [ + "Plasma Pistol", + "Harlequin's Kiss" + ], + "unit_type": 1, + "unit_size": 1 + }, + "wraithguard": { + "display_name": "Wraithguard", + "armour": 15, + "health": 125, + "resistance": 0.7, + "weapons": [ + "Wraithcannon" + ], + "unit_type": 1, + "unit_size": 1 + }, + "vyper": { + "display_name": "Vyper", + "armour": 40, + "health": 100, + "resistance": 0.8, + "weapons": [ + "Twin Linked Shuriken Catapult", + "Pulse Laser" + ], + "unit_type": 1, + "unit_size": 16 + }, + "falcon": { + "display_name": "Falcon", + "armour": 40, + "health": 200, + "resistance": 0.6, + "weapons": [ + "Pulse Laser", + "Shuriken Cannon", + "Bright Lance" + ], + "unit_type": 1, + "unit_size": 16 + }, + "fire_prism": { + "display_name": "Fire Prism", + "armour": 40, + "health": 200, + "resistance": 0.5, + "weapons": [ + "Twin Linked Shuriken Catapult", + "Prism Cannon" + ], + "unit_type": 1, + "unit_size": 16 + }, + "nightspinner": { + "display_name": "Nightspinner", + "armour": 40, + "health": 200, + "resistance": 0.6, + "weapons": [ + "Twin Linked Doomweaver" + ], + "unit_type": 1, + "unit_size": 16 + }, + "wraithlord": { + "display_name": "Wraithlord", + "armour": 40, + "health": 200, + "resistance": 0.5, + "weapons": [ + "Two Power Fists", + "Flamer", + "Starcannon" + ], + "unit_type": 1, + "unit_size": 16 + }, + "phantom_titan": { + "display_name": "Phantom Titan", + "armour": 50, + "health": 800, + "resistance": 0.35, + "weapons": [ + "Two Power Fists", + "Phantom Pulsar", + "Titan Starcannon" + ], + "unit_type": 1, + "unit_size": 16 + }, + "ork_leader": { + "display_name": "Ork Leader", + "armour": 12, + "health": 600, + "resistance": 0.5, + "weapons": [ + "Power Klaw", + "Rokkit Launcha", + "Big Shoota" + ], + "unit_type": 1, + "unit_size": 1 + }, + "warboss": { + "display_name": "Warboss", + "armour": 12, + "health": 200, + "resistance": 0.75, + "weapons": [ + "Power Klaw", + "Rokkit Launcha" + ], + "unit_type": 1, + "unit_size": 2 + }, + "gretchin": { + "display_name": "Gretchin", + "armour": 0, + "health": 15, + "resistance": 1, + "weapons": [ + "Grot Blasta" + ], + "unit_type": 1, + "unit_size": 0.5 + }, + "ork_boy": { + "display_name": "Ork Boy", + "armour": 5, + "health": 60, + "resistance": 1, + "weapons": [ + "Choppa", + "Slugga" + ], + "unit_type": 1, + "unit_size": 1 + }, + "mekboy": { + "display_name": "Mekboy", + "armour": 12, + "health": 100, + "resistance": 0.75, + "weapons": [ + "Choppa", + "Slugga", + "Stickkbombs" + ], + "unit_type": 1, + "unit_size": 1 + }, + "nob": { + "display_name": "Nob", + "armour": 5, + "health": 150, + "resistance": 1, + "weapons": [ + "Power Klaw", + "Big Shoota" + ], + "unit_type": 1, + "unit_size": 1 + }, + "boss_nob": { + "display_name": "Boss Nob", + "armour": 7, + "health": 200, + "resistance": 1, + "weapons": [ + "Power Klaw", + "Big Shoota" + ], + "unit_type": 3, + "unit_size": 2 + }, + "meganob": { + "display_name": "Meganob", + "armour": 12, + "health": 150, + "resistance": 0.6, + "weapons": [ + "Power Klaw", + "Big Shoota" + ], + "unit_type": 1, + "unit_size": 2 + }, + "boss_meganob": { + "display_name": "Boss Meganob", + "armour": 12, + "health": 150, + "resistance": 0.6, + "weapons": [ + "Power Klaw", + "Big Shoota" + ], + "unit_type": 3, + "unit_size": 2 + }, + "flash_git": { + "display_name": "Flash Git", + "armour": 8, + "health": 100, + "resistance": 1, + "weapons": [ + "Snazzgun", + "Choppa" + ], + "unit_type": 1, + "unit_size": 1 + }, + "cybork": { + "display_name": "Cybork", + "armour": 8, + "health": 125, + "resistance": 0.75, + "weapons": [ + "Power Klaw", + "Big Shoota" + ], + "unit_type": 1, + "unit_size": 1 + }, + "ard_boy": { + "display_name": "Ard Boy", + "armour": 8, + "health": 80, + "resistance": 0.9, + "weapons": [ + "Choppa", + "Slugga" + ], + "unit_type": 1, + "unit_size": 1 + }, + "kommando": { + "display_name": "Kommando", + "armour": 10, + "health": 125, + "resistance": 0.9, + "weapons": [ + "Choppa", + "Rokkit Launcha" + ], + "unit_type": 1, + "unit_size": 1 + }, + "burna_boy": { + "display_name": "Burna Boy", + "armour": 5, + "health": 80, + "resistance": 1, + "weapons": [ + "Choppa", + "Burna" + ], + "unit_type": 1, + "unit_size": 1 + }, + "tankbusta": { + "display_name": "Tankbusta", + "armour": 5, + "health": 80, + "resistance": 1, + "weapons": [ + "Rokkit Launcha", + "Tankbusta Bomb", + "Melee1" + ], + "unit_type": 1, + "unit_size": 1 + }, + "stormboy": { + "display_name": "Stormboy", + "armour": 5, + "health": 80, + "resistance": 1, + "weapons": [ + "Choppa", + "Slugga" + ], + "abilities": [ + "jump" + ], + "unit_type": 1, + "unit_size": 2 + }, + "battlewagon": { + "display_name": "Battlewagon", + "armour": 80, + "health": 800, + "resistance": 1, + "weapons": [ + "Kannon", + "Big Shoota", + "Big Shoota", + "Rokkit Launcha", + "Rokkit Launcha" + ], + "unit_type": 1, + "unit_size": 16 + }, + "deff_dread": { + "display_name": "Deff Dread", + "armour": 60, + "health": 500, + "resistance": 1, + "weapons": [ + "Big Shoota", + "Big Shoota", + "Power Klaw", + "Power Klaw" + ], + "unit_type": 1, + "unit_size": 16 + }, + "xv8_commander": { + "display_name": "XV8 Commander", + "armour": 12, + "health": 300, + "resistance": 0.5, + "weapons": [ + "Plasma Rifle", + "Fusion Blaster", + "Cyclic Ion Blaster" + ], + "unit_type": 1, + "unit_size": 1 + }, + "xv8_bodyguard": { + "display_name": "XV8 Bodyguard", + "armour": 10, + "health": 200, + "resistance": 0.75, + "weapons": [ + "Plasma Rifle", + "Burst Rifle" + ], + "unit_type": 1, + "unit_size": 1 + }, + "xv8_crisis": { + "display_name": "XV8 Crisis", + "armour": 10, + "health": 150, + "resistance": 0.75, + "weapons": [ + "Plasma Rifle", + "Missile Pod" + ], + "unit_type": 1, + "unit_size": 1 + }, + "xv8_(brightknife)": { + "display_name": "XV8 (Brightknife)", + "armour": 10, + "health": 150, + "resistance": 0.75, + "weapons": [ + "Fusion Blaster", + "Fusion Blaster" + ], + "unit_type": 1, + "unit_size": 1 + }, + "shield_drone": { + "display_name": "Shield Drone", + "armour": 8, + "health": 50, + "resistance": 1, + "weapons": [], + "unit_type": 1, + "unit_size": 1 + }, + "xv88_broadside": { + "display_name": "XV88 Broadside", + "armour": 12, + "health": 225, + "resistance": 0.75, + "weapons": [ + "Smart Missile System", + "Small Railgun" + ], + "unit_type": 1, + "unit_size": 1 + }, + "xv25_stealthsuit": { + "display_name": "XV25 Stealthsuit", + "armour": 8, + "health": 50, + "resistance": 0.75, + "weapons": [ + "Burst Rifle" + ], + "unit_type": 1, + "unit_size": 1 + }, + "fire_warrior": { + "display_name": "Fire Warrior", + "armour": 8, + "health": 30, + "resistance": 1, + "weapons": [ + "Pulse Rifle" + ], + "unit_type": 1, + "unit_size": 1 + }, + "tau_pathfinder": { + "display_name": "Tau Pathfinder", + "armour": 8, + "health": 30, + "resistance": 1, + "weapons": [ + "Rail Rifle" + ], + "unit_type": 1, + "unit_size": 1 + }, + "kroot": { + "display_name": "Kroot", + "armour": 5, + "health": 30, + "resistance": 1, + "weapons": [ + "Kroot Rifle", + "Melee2" + ], + "unit_type": 1, + "unit_size": 1 + }, + "vespid": { + "display_name": "Vespid", + "armour": 5, + "health": 50, + "resistance": 1, + "weapons": [ + "Vespid Crystal", + "Melee2" + ], + "unit_type": 1, + "unit_size": 1 + }, + "devilfish": { + "display_name": "Devilfish", + "armour": 30, + "health": 150, + "resistance": 0.75, + "weapons": [ + "Smart Missile System" + ], + "unit_type": 1, + "unit_size": 16 + }, + "hammerhead": { + "display_name": "Hammerhead", + "armour": 30, + "health": 150, + "resistance": 0.75, + "weapons": [ + "Railgun", + "Smart Missile System" + ], + "unit_type": 1, + "unit_size": 16 + }, + "hive_tyrant": { + "display_name": "Hive Tyrant", + "armour": 20, + "health": 400, + "resistance": 0.5, + "weapons": [ + "Bonesword", + "Lashwhip", + "Heavy Venom Cannon" + ], + "unit_type": 1, + "unit_size": 1 + }, + "tyrant_guard": { + "display_name": "Tyrant Guard", + "armour": 12, + "health": 200, + "resistance": 0.6, + "weapons": [ + "Crushing Claws" + ], + "unit_type": 1, + "unit_size": 1 + }, + "tyranid_warrior": { + "display_name": "Tyranid Warrior", + "armour": 8, + "health": 100, + "resistance": 0.9, + "weapons": [ + "Rending Claws", + "Devourer" + ], + "unit_type": 1, + "unit_size": 1 + }, + "zoanthrope": { + "display_name": "Zoanthrope", + "armour": 8, + "health": 300, + "resistance": 0.25, + "weapons": [ + "Zoanthrope Blast" + ], + "unit_type": 1, + "unit_size": 1 + }, + "carnifex": { + "display_name": "Carnifex", + "armour": 20, + "health": 300, + "resistance": 0.75, + "weapons": [ + "Carnifex Claws", + "Venom Cannon" + ], + "unit_type": 1, + "unit_size": 16 + }, + "termagaunt": { + "display_name": "Termagaunt", + "armour": 5, + "health": 25, + "resistance": 1, + "weapons": [ + "Fleshborer" + ], + "unit_type": 1, + "unit_size": 1 + }, + "hormagaunt": { + "display_name": "Hormagaunt", + "armour": 5, + "health": 25, + "resistance": 1, + "weapons": [ + "Scything Talons" + ], + "unit_type": 1, + "unit_size": 1 + }, + "cultist": { + "display_name": "Cultist", + "armour": 0, + "health": 35, + "resistance": 1, + "weapons": [ + "Autogun", + "melee0.5" + ], + "unit_type": 1, + "unit_size": 1 + }, + "genestealer": { + "display_name": "Genestealer", + "armour": 5, + "health": 75, + "resistance": 1, + "weapons": [ + "Genestealer Claws" + ], + "unit_type": 1, + "unit_size": 1 + }, + "genestealer_patriarch": { + "display_name": "Genestealer Patriarch", + "armour": 8, + "health": 300, + "resistance": 0.6, + "weapons": [ + "Genestealer Claws", + "Witchfire" + ], + "unit_type": 1, + "unit_size": 1 + }, + "armoured_limousine": { + "display_name": "Armoured Limousine", + "armour": 10, + "health": 150, + "resistance": 0.75, + "weapons": [ + "Autogun", + "Autogun", + "Autogun", + "Autogun" + ], + "unit_type": 1, + "unit_size": 16 + }, + "lictor": { + "display_name": "Lictor", + "armour": 8, + "health": 300, + "resistance": 0.6, + "weapons": [ + "Lictor Claws", + "Flesh Hooks" + ], + "unit_type": 1, + "unit_size": 1 + }, + "chaos_leader": { + "display_name": "Chaos Leader", + "weapons": [ + "Meltagun", + "Power Fist" + ], + "armour": 30, + "health": 300, + "resistance": 0.75 + }, + "chaos_daemonlord": { + "display_name": "Chaos Daemonlord", + "weapons": [ + "Khorne Demon Melee" + ], + "armour": 30, + "health": 300, + "resistance": 0.75 + }, + "fallen": { + "display_name": "Fallen", + "weapons": [ + "Bolt Pistol", + "Power Weapon" + ], + "armour": 30, + "health": 120, + "resistance": 0.5 + }, + "chaos_lord": { + "display_name": "Chaos Lord", + "weapons": [ + "Plasma Pistol", + "Power Weapon" + ], + "armour": 30, + "health": 150, + "resistance": 0.5 + }, + "chaos_sorcerer": { + "display_name": "Chaos Sorcerer", + "weapons": [ + "Plasma Pistol", + "Force Staff" + ], + "armour": 30, + "health": 100, + "resistance": 0.5 + }, + "warpsmith": { + "display_name": "Warpsmith", + "weapons": [ + "Chainfist", + "Meltagun", + "Flamer" + ], + "armour": 30, + "health": 100, + "resistance": 0.5 + }, + "chaos_terminator": { + "display_name": "Chaos Terminator", + "weapons": [ + "Power Fist", + "Bolter", + "Combi-Flamer" + ], + "armour": 40, + "health": 100, + "resistance": 0.5 + }, + "venerable_chaos_terminator": { + "display_name": "Venerable Chaos Terminator", + "weapons": [ + "Power Fist", + "Bolter", + "Combi-Flamer" + ], + "armour": 40, + "health": 120, + "resistance": 0.4 + }, + "world_eaters_terminator": { + "display_name": "World Eaters Terminator", + "weapons": [ + "Power Fist", + "Meltagun" + ], + "armour": 40, + "health": 120, + "resistance": 0.4 + }, + "obliterator": { + "display_name": "Obliterator", + "weapons": [ + "Power Fist", + "Obliterator Weapon" + ], + "armour": 40, + "health": 200, + "resistance": 0.5 + }, + "chaos_chosen": { + "display_name": "Chaos Chosen", + "weapons": [ + "Meltagun", + "Chainsword" + ], + "armour": 20, + "health": 125, + "resistance": 0.85 + }, + "venerable_chaos_chosen": { + "display_name": "Venerable Chaos Chosen", + "weapons": [ + "Meltagun", + "Chainsword" + ], + "armour": 20, + "health": 125, + "resistance": 0.75 + }, + "possessed": { + "display_name": "Possessed", + "weapons": [ + "Possessed Claws" + ], + "armour": 17, + "health": 150, + "resistance": 0.5 + }, + "chaos_space_marine": { + "display_name": "Chaos Space Marine", + "weapons": [ + "Bolter", + "Chainsword" + ], + "armour": 20, + "health": 100, + "resistance": 0.9 + }, + "havoc": { + "display_name": "Havoc", + "weapons": [ + "Missile Launcher", + "Melee1" + ], + "armour": 20, + "health": 100, + "resistance": 0.9 + }, + "raptor": { + "display_name": "Raptor", + "weapons": [ + "Chainsword", + "Bolt Pistol" + ], + "armour": 20, + "health": 100, + "resistance": 0.75, + "special": "Jump Pack" + }, + "world_eater": { + "display_name": "World Eater", + "weapons": [ + "Bolter", + "Chainaxe" + ], + "armour": 20, + "health": 100, + "resistance": 0.75 + }, + "world_eaters_veteran": { + "display_name": "World Eaters Veteran", + "weapons": [ + "Combi-Flamer", + "Chainaxe" + ], + "armour": 20, + "health": 100, + "resistance": 0.7 + }, + "khorne_berzerker": { + "display_name": "Khorne Berzerker", + "weapons": [ + "Chainaxe", + "Bolt Pistol" + ], + "armour": 20, + "health": 100, + "resistance": 0.65 + }, + "plague_marine": { + "display_name": "Plague Marine", + "weapons": [ + "Bolter", + "Poison Chainsword" + ], + "armour": 20, + "health": 150, + "resistance": 0.5 + }, + "noise_marine": { + "display_name": "Noise Marine", + "weapons": [ + "Sonic Blaster", + "Melee1" + ], + "armour": 20, + "health": 100, + "resistance": 0.75 + }, + "rubric_marine": { + "display_name": "Rubric Marine", + "weapons": [ + "Rubric Bolter", + "Melee1" + ], + "armour": 20, + "health": 125, + "resistance": 0.65 + }, + "rubric_sorcerer": { + "display_name": "Rubric Sorcerer", + "weapons": [ + "Witchfire", + "Force Staff" + ], + "armour": 20, + "health": 150, + "resistance": 0.5 + }, + "chaos_cultist": { + "display_name": "Chaos Cultist", + "weapons": [ + "Autogun", + "melee0.5" + ], + "armour": 5, + "health": 35 + }, + "hellbrute": { + "display_name": "Hellbrute", + "weapons": [ + "Power Fist", + "Meltagun" + ], + "armour": 40, + "health": 300, + "resistance": 0.5, + "unit_type": 1, + "unit_size": 16 + }, + "rhino": { + "display_name": "Rhino", + "weapons": [ + "Storm Bolter" + ], + "armour": 40, + "health": 200, + "resistance": 0.75, + "unit_type": 1, + "unit_size": 16 + }, + "predator": { + "display_name": "Predator", + "weapons": [ + "Lascannon", + "Twin Linked Lascannon" + ], + "armour": 45, + "health": 350, + "resistance": 0.5, + "unit_type": 1, + "unit_size": 16 + }, + "vindicator": { + "display_name": "Vindicator", + "weapons": [ + "Demolisher Cannon", + "Havoc Launcher" + ], + "armour": 45, + "health": 300, + "resistance": 0.5, + "unit_type": 1, + "unit_size": 16 + }, + "land_raider": { + "display_name": "Land Raider", + "weapons": [ + "Twin Linked Heavy Bolters", + "Twin Linked Lascannon" + ], + "armour": 50, + "health": 400, + "resistance": 0.25, + "unit_type": 1, + "unit_size": 16 + }, + "heldrake": { + "display_name": "Heldrake", + "weapons": [ + "Baleflame" + ], + "armour": 50, + "health": 400, + "resistance": 0.25, + "unit_type": 1, + "unit_size": 16 + }, + "defiler": { + "display_name": "Defiler", + "weapons": [ + "Defiler Claws", + "Battle Cannon", + "Reaper Autocannon", + "Flamer" + ], + "armour": 40, + "health": 300, + "resistance": 0.5, + "unit_type": 1, + "unit_size": 16 + }, + "arch_heretic": { + "display_name": "Arch Heretic", + "weapons": [ + "Power Weapon", + "Plasma Pistol" + ], + "armour": 8, + "health": 40, + "resistance": 0.75 + }, + "cultist_elite": { + "display_name": "Cultist Elite", + "weapons": [ + "Lasgun", + "Chainaxe" + ], + "armour": 8, + "health": 40, + "resistance": 0.9 + }, + "mutant": { + "display_name": "Mutant", + "weapons": [ + "Flesh Hooks" + ], + "armour": 0, + "health": 30 + }, + "daemonhost": { + "display_name": "Daemonhost", + "weapons": [ + "Daemonhost Claws", + "Daemonhost_Powers" + ], + "armour": 8, + "health": 300, + "resistance": 0.5 + }, + "possessed_alt": { + "display_name": "Possessed Alt", + "weapons": [ + "Possessed Claws" + ], + "armour": 8, + "health": 100, + "resistance": 0.75 + }, + "technical": { + "display_name": "Technical", + "weapons": [ + "Autogun", + "Heavy Bolter" + ], + "armour": 10, + "health": 100, + "resistance": 0.75, + "unit_type": 1, + "unit_size": 16 + }, + "chaos_leman_russ": { + "display_name": "Chaos Leman Russ", + "weapons": [ + "Battle Cannon", + "Heavy Bolter" + ], + "armour": 45, + "health": 250, + "resistance": 0.25, + "unit_type": 1, + "unit_size": 16 + }, + "chaos_basilisk": { + "display_name": "Chaos Basilisk", + "weapons": [ + "Earthshaker Cannon", + "Heavy Bolter" + ], + "armour": 20, + "health": 150, + "unit_type": 1, + "unit_size": 16 + }, + "necron_overlord": { + "display_name": "Necron Overlord", + "weapons": [ + "Staff of Light", + "Staff of Light Shooting" + ], + "armour": 12, + "health": 300, + "resistance": 0.5, + "unit_type": 1, + "unit_size": 1 + }, + "lychguard": { + "display_name": "Lychguard", + "weapons": [ + "Warscythe" + ], + "armour": 12, + "health": 100, + "resistance": 0.75, + "unit_type": 1, + "unit_size": 1 + }, + "flayed_one": { + "display_name": "Flayed One", + "weapons": [ + "Melee5" + ], + "armour": 8, + "health": 75, + "resistance": 0.9, + "unit_type": 1, + "unit_size": 1 + }, + "necron_warrior": { + "display_name": "Necron Warrior", + "weapons": [ + "Gauss Flayer", + "Melee3" + ], + "armour": 8, + "health": 75, + "resistance": 0.9, + "unit_type": 1, + "unit_size": 1 + }, + "necron_immortal": { + "display_name": "Necron Immortal", + "weapons": [ + "Gauss Blaster", + "Melee3" + ], + "armour": 8, + "health": 75, + "resistance": 0.85, + "unit_type": 1, + "unit_size": 1 + }, + "necron_wraith": { + "display_name": "Necron Wraith", + "weapons": [ + "Wraith Claws" + ], + "armour": 10, + "health": 200, + "resistance": 0.75, + "unit_type": 1, + "unit_size": 1 + }, + "necron_destroyer": { + "display_name": "Necron Destroyer", + "weapons": [ + "Gauss Cannon", + "Melee3" + ], + "armour": 25, + "health": 175, + "resistance": 0.5, + "unit_type": 1, + "unit_size": 1 + }, + "tomb_stalker": { + "display_name": "Tomb Stalker", + "weapons": [ + "Gauss Particle Cannon", + "Overcharged Gauss Cannon", + "Claws" + ], + "armour": 40, + "health": 600, + "resistance": 0.5, + "unit_type": 1, + "unit_size": 16 + }, + "canoptek_spyder": { + "display_name": "Canoptek Spyder", + "weapons": [ + "Claws" + ], + "armour": 30, + "health": 300, + "resistance": 0.75, + "unit_type": 1, + "unit_size": 16 + }, + "canoptek_scarab": { + "display_name": "Canoptek Scarab", + "weapons": [ + "Melee3" + ], + "armour": 8, + "health": 30, + "resistance": 0.75, + "unit_type": 1, + "unit_size": 1 + }, + "necron_monolith": { + "display_name": "Necron Monolith", + "weapons": [ + "Gauss Flux Arc", + "Particle Whip" + ], + "armour": 50, + "health": 500, + "resistance": 0.25, + "unit_type": 1, + "unit_size": 16 + }, + "doomsday_arc": { + "display_name": "Doomsday Arc", + "weapons": [ + "Gauss Flayer Array", + "Doomsday Cannon" + ], + "armour": 40, + "health": 350, + "resistance": 0.5, + "unit_type": 1, + "unit_size": 16 + } +} \ No newline at end of file diff --git a/objects/obj_controller/KeyPress_73.gml b/objects/obj_controller/KeyPress_73.gml deleted file mode 100644 index c5aceeb6cc..0000000000 --- a/objects/obj_controller/KeyPress_73.gml +++ /dev/null @@ -1,43 +0,0 @@ - -/*var onceh;onceh=0; -if (audio_is_playing(snd_royal)=true) then scr_music("blood",2000); -if (audio_is_playing(snd_blood)=true) then scr_music("royal",2000); -*/ - -/*menu=20;diplomacy=10.1; -scr_dialogue("lol"); -*/ - - - -// alarm[7]=1; - - -/*with(obj_star){ - var balh;balh=0; - if (string_count("WL10",p_feature[1])>0) then balh=1; - if (string_count("WL10",p_feature[2])>0) then balh=2; - if (string_count("WL10",p_feature[3])>0) then balh=3; - if (string_count("WL10",p_feature[4])>0) then balh=4; - if (balh>0) then show_message(string(name)+" "+scr_roman(balh)); -}*/ - -// loyalty=0;loyalty_hidden=0; - - -// show_message(string(obj_ini.ship[0])+" location: "+string(obj_ini.ship_location[0])); - -// alarm[8]=1; - -// menu=20; -// diplomacy=-5.3; - - - -// show_message(cooldown); - -// instance_activate_object(obj_enunit); - - -/* */ -/* */ diff --git a/objects/obj_enunit/Create_0.gml b/objects/obj_enunit/Create_0.gml index f6816b1213..168a971fd5 100644 --- a/objects/obj_enunit/Create_0.gml +++ b/objects/obj_enunit/Create_0.gml @@ -1,29 +1,18 @@ -unit=""; -men=0; -veh=0; -dreads=0; -medi=0; -owner = eFACTION.Imperium; -engaged=0; -hostile_splash=0; +owner = -1; flank=0; -flyer=0;// Works same as flank, but does not get denoted as such -neww=0; -column_size=0; - -unit_count=0; unit_count_old=0; composition_string=""; pos = 880; centerline_offset = 0; draw_size = 0; -x1 = pos + (centerline_offset * 2); -y1 = 450 - (draw_size / 2); -x2 = pos + (centerline_offset * 2) + 10; -y2 = 450 + (draw_size / 2); +x1 = 0; +y1 = 0; +x2 = 0; +y2 = 0; + if (obj_ncombat.enemy < array_length(global.star_name_colors) && obj_ncombat.enemy >= 0) { column_draw_colour = global.star_name_colors[obj_ncombat.enemy]; } else { @@ -33,49 +22,84 @@ if (obj_ncombat.enemy < array_length(global.star_name_colors) && obj_ncombat.ene target_block = noone; - - -avg_attack=1; -avg_ranged=1; -avg_defense=1; -averages=1; - - -// x determines column; maybe every 10 or so? - weapon_stacks_normal = {}; weapon_stacks_vehicle = {}; weapon_stacks_unique = {}; -var _enemy_size = 1002; -dude_co = array_create(_enemy_size, 0); -dude_id = array_create(_enemy_size, 0); +unit_stacks = {}; -dudes = array_create(_enemy_size, ""); -dudes_special = array_create(_enemy_size, ""); -dudes_num = array_create(_enemy_size, 0); -dudes_onum = array_create(_enemy_size, -1); -dudes_ac = array_create(_enemy_size, 0); -dudes_hp = array_create(_enemy_size, 0); -dudes_dr = array_create(_enemy_size, 1); -dudes_vehicle = array_create(_enemy_size, 0); -dudes_damage = array_create(_enemy_size, 0); -dudes_exp = array_create(_enemy_size, 0); -dudes_powers = array_create(_enemy_size, ""); -faith = array_create(_enemy_size, 0); +column_size = 0; -dudes_attack = array_create(_enemy_size, 1); -dudes_ranged = array_create(_enemy_size, 1); +engaged = function() { + return collision_point(x - 10, y, obj_pnunit, 0, 1) || collision_point(x + 10, y, obj_pnunit, 0, 1); +}; -dudes_wep1 = array_create(_enemy_size, ""); -dudes_wep2 = array_create(_enemy_size, ""); -dudes_gear = array_create(_enemy_size, ""); -dudges_mobi = array_create(_enemy_size, ""); +is_mouse_over = function() { + return scr_hit(x1, y1, x2, y2) && obj_ncombat.fading_strength == false; +}; -// if (obj_ncombat.enemy=1){alarm[1]=8;alarm[5]=10;} +copy_block_composition = function(_composition) { + if (struct_exists(_composition, "units")) { + var _units = _composition.units; + + var _units_len = array_length(_units); + for (var i = 0; i < _units_len; i++) { + var _unit = _units[i]; + var _unit_name = _unit.name; + var _unit_struct = new EnemyUnitStack(_unit_name, _unit.count); + struct_set(unit_stacks, _unit_name, _unit_struct); + column_size += _unit_struct.unit_size * _unit.count; + } + } + + if (struct_exists(_composition, "squads")) { + var _squads = _composition.squads; + + var _squads_len = array_length(_squads); + for (var i = 0; i < _squads_len; i++) { + var _squad = _squads[i]; + + var _squad_template = global.squad_profiles[$ _squad.name]; + var _squad_units = _squad_template.members; + var _squad_count = _squad.count; + + var _unit_names = struct_get_names(_squad_units); + var _unit_len = array_length(_unit_names); + for (var k = 0; k < _unit_len; k++){ + var _unit_name = _unit_names[k]; + var _profile_name = _unit_name; + var _unit = _squad_units[$ _unit_name]; + + if (struct_exists(_unit, "display_name")) { + _unit_name = _unit.display_name; + } + + if (struct_exists(unit_stacks, _unit_name)) { + unit_stacks[$ _unit_name].unit_count += _unit.count * _squad_count; + column_size += unit_stacks[$ _unit_name].unit_size * _unit.count * _squad_count; + } else { + var _unit_struct = new EnemyUnitStack(_profile_name, _unit.count * _squad_count); + _unit_struct.weapons = _unit.weapons; + struct_set(unit_stacks, _unit_name, _unit_struct); + column_size += _unit_struct.unit_size * _unit.count * _squad_count; + } + } + } + } +}; -hit = function() { - return scr_hit(x1, y1, x2, y2) && obj_ncombat.fading_strength == false; +unit_count = function() { + var _unit_count = 0; + + var _unit_stack_names = struct_get_names(unit_stacks); + var _unit_stack_len = array_length(_unit_stack_names); + for (var k = 0; k < _unit_stack_len; k++){ + var _unit_stack_name = _unit_stack_names[k]; + var _unit_stack = unit_stacks[$ _unit_stack_name]; + _unit_count += _unit_stack.unit_count; + } + + return _unit_count; }; diff --git a/objects/obj_enunit/Draw_0.gml b/objects/obj_enunit/Draw_0.gml index 6522f1979d..c9e68f7834 100644 --- a/objects/obj_enunit/Draw_0.gml +++ b/objects/obj_enunit/Draw_0.gml @@ -1,4 +1,4 @@ -draw_size = min(400, column_size); +draw_size = column_size * obj_ncombat.battlefield_scale; if (draw_size > 0){ draw_set_alpha(1); @@ -13,52 +13,29 @@ if (draw_size > 0){ x2 = pos + (centerline_offset * 2) + 10; y2 = 450 + (draw_size / 2); - if (hit()) { + if (is_mouse_over()) { draw_set_alpha(0.8); } draw_rectangle(x1, y1, x2, y2, 0); - if (hit()) { - if (unit_count != unit_count_old) { - unit_count_old = unit_count; - if (obj_ncombat.enemy!=1){ - composition_string = block_composition_string(); - } else { - var variety, variety_num, sofar, compl; - variety = []; - variety_num = []; - sofar = 0; - compl = ""; - - var variety_len = array_length(variety); - for (var q = 0; q < variety_len; q++) { - variety[q] = ""; - variety_num[q] = 0; - } - - var dudes_len = array_length(dudes); - for (var q = 0; q < dudes_len; q++) { - if (dudes[q] != "") and(string_count(string(dudes[q]) + "|", compl) = 0) { - compl += string(dudes[q]) + "|"; - variety[sofar] = dudes[q]; - variety_num[sofar] = 0; - sofar += 1; - } - } - - var dudes_len = array_length(dudes); - for (var q = 0; q < dudes_len; q++) { - if (dudes[q] != "") { - var variety_len = array_length(variety); - for (var i = 0; i < variety_len; i++) { - if (dudes[q] = variety[i]) then variety_num[i] += dudes_num[q]; - } - } - } - - composition_string = arrays_to_string_with_counts(variety, variety_num, true); - } + if (is_mouse_over()) { + if (unit_count() != unit_count_old) { + unit_count_old = unit_count(); + var _counts_array = []; + var _names_array = []; + var _types_array = []; + + var _unit_names = struct_get_names(unit_stacks); + var _unit_len = array_length(_unit_names); + for (var k = 0; k < _unit_len; k++){ + var _unit_name = _unit_names[k]; + var _unit = unit_stacks[$ _unit_name]; + array_push(_names_array, _unit.display_name); + array_push(_counts_array, _unit.unit_count); + } + + composition_string = arrays_to_string_with_counts(_names_array, _counts_array, true); } draw_block_composition(x1, composition_string); diff --git a/objects/obj_enunit/Step_0.gml b/objects/obj_enunit/Step_0.gml deleted file mode 100644 index e73945c5f9..0000000000 --- a/objects/obj_enunit/Step_0.gml +++ /dev/null @@ -1,2 +0,0 @@ -update_block_size(); -update_block_unit_count(); diff --git a/objects/obj_enunit/obj_enunit.yy b/objects/obj_enunit/obj_enunit.yy index a2a40fbca5..c7c6d9b7b0 100644 --- a/objects/obj_enunit/obj_enunit.yy +++ b/objects/obj_enunit/obj_enunit.yy @@ -3,7 +3,6 @@ "%Name":"obj_enunit", "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":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":87,"eventType":9,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, diff --git a/objects/obj_ncombat/Create_0.gml b/objects/obj_ncombat/Create_0.gml index 67bf4edf30..be23e11c32 100644 --- a/objects/obj_ncombat/Create_0.gml +++ b/objects/obj_ncombat/Create_0.gml @@ -353,3 +353,8 @@ display_message_queue = function() { messages_shown = 0; ds_queue_clear(messages_queue); } + +enemy_force_composition = {}; + +battlefield_scale = 0.1; +biggest_block_size = 0; \ No newline at end of file diff --git a/objects/obj_ncombat/Step_0.gml b/objects/obj_ncombat/Step_0.gml index 8cb7e55d3d..3f1fdd5d1c 100644 --- a/objects/obj_ncombat/Step_0.gml +++ b/objects/obj_ncombat/Step_0.gml @@ -2,29 +2,14 @@ if (fading_strength > 0) { fading_strength -= 0.05; } -if (!battle_ended) { - with (obj_pnunit) { - target_block_is_valid(id, obj_pnunit); - } - - with (obj_enunit) { - if (x < 0) { - instance_destroy(); - } else { - var nearest = instance_nearest(x, y, obj_pnunit); - if (instance_exists(nearest)) { - if (point_distance(x, y, nearest.x, nearest.y) > 100) { - instance_destroy(); - } - } - } - } -} - if (wall_destroyed == true) { wall_destroyed = false; } +if (biggest_block_size > 0) { + battlefield_scale = min(1, 400 / biggest_block_size); +} + if (battle_stage == eBATTLE_STAGE.Creation) { ncombat_enemy_stacks_init(); @@ -34,6 +19,9 @@ if (battle_stage == eBATTLE_STAGE.Creation) { with (obj_enunit) { enunit_enemy_profiles_init(); + if (column_size > obj_ncombat.biggest_block_size) { + obj_ncombat.biggest_block_size = column_size; + } } with (obj_pnunit) { @@ -73,6 +61,7 @@ if (keyboard_check_pressed(vk_enter) && fading_strength == 0) { } if (turn_stage == eBATTLE_TURN.PlayerStart) { + player_blocks_movement(); with (obj_pnunit) { pnunit_battle_effects(); scr_player_combat_weapon_stacks(); @@ -91,6 +80,16 @@ if (keyboard_check_pressed(vk_enter) && fading_strength == 0) { } if (turn_stage == eBATTLE_TURN.EnemyEnd || turn_stage == eBATTLE_TURN.PlayerEnd) { + if (!battle_ended) { + with (obj_pnunit) { + pnunit_is_valid(id); + } + + with (obj_enunit) { + enunit_is_valid(id) + } + } + if (turn_stage == eBATTLE_TURN.EnemyEnd) { turn_stage = eBATTLE_TURN.PlayerStart; } diff --git a/objects/obj_pnunit/Create_0.gml b/objects/obj_pnunit/Create_0.gml index 45888724b5..42a3d92823 100644 --- a/objects/obj_pnunit/Create_0.gml +++ b/objects/obj_pnunit/Create_0.gml @@ -105,6 +105,6 @@ hostile_unit=""; hostile_type=0; hostile_splash=0; -hit = function() { +is_mouse_over = function() { return scr_hit(x1, y1, x2, y2) && obj_ncombat.fading_strength == 0; }; diff --git a/objects/obj_pnunit/Draw_0.gml b/objects/obj_pnunit/Draw_0.gml index 124debc521..85623e18fb 100644 --- a/objects/obj_pnunit/Draw_0.gml +++ b/objects/obj_pnunit/Draw_0.gml @@ -1,4 +1,4 @@ -draw_size = min(400, column_size); +draw_size = column_size * obj_ncombat.battlefield_scale; if (draw_size > 0){ draw_set_alpha(1); @@ -20,13 +20,13 @@ if (draw_size > 0){ x2 = pos + (centerline_offset * 2) + 10; y2 = 450 + (draw_size / 2); - if (hit()) { + if (is_mouse_over()) { draw_set_alpha(0.8); } draw_rectangle(x1, y1, x2, y2, 0); - if (hit()) { + if (is_mouse_over()) { if (unit_count != unit_count_old) { unit_count_old = unit_count; composition_string = block_composition_string(); diff --git a/scripts/scr_clean/scr_clean.gml b/scripts/scr_clean/scr_clean.gml index 031ee6bb04..2cdbe44ac0 100644 --- a/scripts/scr_clean/scr_clean.gml +++ b/scripts/scr_clean/scr_clean.gml @@ -95,15 +95,15 @@ function scr_clean(target_object, weapon_data) { var _t_start = get_timer(); } - if (target_type == eTARGET_TYPE.ARMOUR && array_empty(valid_vehicles)) { - target_type = eTARGET_TYPE.NORMAL; - } else if (target_type = eTARGET_TYPE.NORMAL && array_empty(valid_marines)) { - target_type = eTARGET_TYPE.ARMOUR; + if (target_type == eTARGET_TYPE.Armour && array_empty(valid_vehicles)) { + target_type = eTARGET_TYPE.Normal; + } else if (target_type = eTARGET_TYPE.Normal && array_empty(valid_marines)) { + target_type = eTARGET_TYPE.Armour; } for (var shot = 0; shot < hostile_shots; shot++) { // ### Vehicle Damage Processing ### - if (target_type == eTARGET_TYPE.ARMOUR && !array_empty(valid_vehicles)) { + if (target_type == eTARGET_TYPE.Armour && !array_empty(valid_vehicles)) { // Apply damage for each hostile shot, until we run out of targets hits++; @@ -199,7 +199,7 @@ function scr_clean(target_object, weapon_data) { array_delete(valid_vehicles, random_index, 1); units_lost++; if (array_empty(valid_vehicles)) { - target_type = eTARGET_TYPE.NORMAL; + target_type = eTARGET_TYPE.Normal; continue; } } @@ -207,7 +207,7 @@ function scr_clean(target_object, weapon_data) { } // ### Marine Processing ### - if (target_type == eTARGET_TYPE.NORMAL && !array_empty(valid_marines)) { + if (target_type == eTARGET_TYPE.Normal && !array_empty(valid_marines)) { // Apply damage for each shot hits++; @@ -266,7 +266,7 @@ function scr_clean(target_object, weapon_data) { array_delete(valid_marines, random_index, 1); units_lost++; if (array_empty(valid_marines)) { - target_type = eTARGET_TYPE.ARMOUR; + target_type = eTARGET_TYPE.Armour; continue; } } @@ -339,9 +339,6 @@ function compress_enemy_array(_target_column) { var _data_arrays = [{ arr: dudes, def: "" - }, { - arr: dudes_special, - def: "" }, { arr: dudes_num, def: 0 @@ -354,9 +351,6 @@ function compress_enemy_array(_target_column) { }, { arr: dudes_vehicle, def: 0 - }, { - arr: dudes_damage, - def: 0 }]; // Track which slots are empty diff --git a/scripts/scr_en_weapon/scr_en_weapon.gml b/scripts/scr_en_weapon/scr_en_weapon.gml index a237554b09..cf9c6f5728 100644 --- a/scripts/scr_en_weapon/scr_en_weapon.gml +++ b/scripts/scr_en_weapon/scr_en_weapon.gml @@ -31,7 +31,6 @@ function scr_en_weapon(_weapon_name, is_man, man_number, man_type, group) { _shot_count = 3; } - //if (obj_ncombat.enemy=5) then faith_bonus=faith[man_type]; if (_weapon_name = "Venom Claws") { _attack = 200; @@ -1049,13 +1048,13 @@ function scr_en_weapon(_weapon_name, is_man, man_number, man_type, group) { // if (faith_bonus = 2) then _attack = _attack * 3; _attack = round(_attack * obj_ncombat.global_defense); - if (obj_ncombat.enemy == 1) { - if (_range <= 1 || floor(_range) != _range) { - _attack = round(_attack * dudes_attack[group]); - } else if (_range > 1 && floor(_range) == _range) { - _attack = round(_attack * dudes_ranged[group]); - } - } + // if (obj_ncombat.enemy == 1) { + // if (_range <= 1 || floor(_range) != _range) { + // _attack = round(_attack * dudes_attack[group]); + // } else if (_range > 1 && floor(_range) == _range) { + // _attack = round(_attack * dudes_ranged[group]); + // } + // } if (!is_man && _ammo > 0) { _ammo *= 2; diff --git a/scripts/scr_enunit_scripts/scr_enunit_scripts.gml b/scripts/scr_enunit_scripts/scr_enunit_scripts.gml index 0cd1d1a9e0..3ada8bfa39 100644 --- a/scripts/scr_enunit_scripts/scr_enunit_scripts.gml +++ b/scripts/scr_enunit_scripts/scr_enunit_scripts.gml @@ -35,10 +35,10 @@ function enunit_target_and_shoot() { for (var i = 0, _ranged_len = array_length(_ranged_weapons); i < _ranged_len; i++) { var _weapon_stack = _ranged_weapons[i]; - if (!target_block_is_valid(target_block, obj_pnunit)) { + if (!pnunit_is_valid(target_block, obj_pnunit)) { log_error($"Invalid player block was found by a ranged target_block!"); target_block = _block_direction(); - if (!target_block_is_valid(target_block, obj_pnunit)) { + if (!pnunit_is_valid(target_block, obj_pnunit)) { log_error($"Two invalid player blocks were found by a ranged target_block! Exiting!"); exit; } @@ -59,7 +59,7 @@ function enunit_target_and_shoot() { // Scan potential targets var _targets = []; with (obj_pnunit) { - if (target_block_is_valid(self, obj_pnunit)) { + if (pnunit_is_valid(self, obj_pnunit)) { array_push(_targets, self.id); } } @@ -96,7 +96,7 @@ function enunit_target_and_shoot() { var _is_fort = _best_target.object_index == obj_nfort; if (_is_fort) { _target_unit_index = 1; - _weapon_stack.target_type = eTARGET_TYPE.FORTIFICATION; + _weapon_stack.target_type = eTARGET_TYPE.Fortification; } scr_shoot(_weapon_stack, _best_target, _target_unit_index); @@ -127,7 +127,7 @@ function enunit_target_and_shoot() { for (var i = 0, _wep_len = array_length(_melee_weapons); i < _wep_len; i++) { var _weapon_stack = _melee_weapons[i]; - if (!target_block_is_valid(target_block, obj_pnunit)) { + if (!pnunit_is_valid(target_block, obj_pnunit)) { log_error($"Invalid player block was found by a melee target_block!"); exit; } @@ -139,7 +139,7 @@ function enunit_target_and_shoot() { if (instance_exists(obj_nfort) && (!flank)) { target_block = instance_nearest(x, y, obj_nfort); _target_unit_index = 1; - _weapon_stack.target_type = eTARGET_TYPE.FORTIFICATION; + _weapon_stack.target_type = eTARGET_TYPE.Fortification; } scr_shoot(_weapon_stack, target_block, _target_unit_index); @@ -157,1778 +157,7 @@ function enunit_target_and_shoot() { // Previosly alarm_1 /// @mixin function enunit_enemy_profiles_init() { - var i, g; - i = 0; - g = 0; - men = 0; - veh = 0; - medi = 0; - weapon_stacks_normal = {}; weapon_stacks_vehicle = {}; weapon_stacks_unique = {}; - - i = 0; - // men=0;veh=0; - - j = 0; - good = 0; - open = 0; - - repeat (700) { - j += 1; - if (dudes_num[j] <= 0) { - dudes[j] = ""; - dudes_special[j] = ""; - dudes_num[j] = 0; - dudes_ac[j] = 0; - dudes_hp[j] = 0; - dudes_vehicle[j] = 0; - dudes_damage[j] = 0; - dudes_attack[j] = 1; - dudes_ranged[j] = 1; - } - if ((dudes[j] == "") && (dudes[j + 1] != "")) { - dudes[j] = dudes[j + 1]; - dudes_special[j] = dudes_special[j + 1]; - dudes_num[j] = dudes_num[j + 1]; - dudes_ac[j] = dudes_ac[j + 1]; - dudes_hp[j] = dudes_hp[j + 1]; - dudes_vehicle[j] = dudes_vehicle[j + 1]; - dudes_damage[j] = dudes_damage[j + 1]; - dudes_attack[j] = dudes_attack[j + 1]; - dudes_ranged[j] = dudes_ranged[j + 1]; - - dudes[j + 1] = ""; - dudes_special[j + 1] = ""; - dudes_num[j + 1] = 0; - dudes_ac[j + 1] = 0; - dudes_hp[j + 1] = 0; - dudes_vehicle[j + 1] = 0; - dudes_damage[j + 1] = 0; - dudes_ranged[j + 1] = 1; - dudges_defense[j + 1] = 1; - dudes_attack[j + 1] = 1; - } - } - j = 0; - - repeat (20) { - j += 1; - if (obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) { - if (dudes[j] == "Malcadon Spyrer") { - dudes_ac[j] = 35; - dudes_hp[j] = 200; - } - } - if (dudes[j] == "Malcadon Spyrer") { - men += dudes_num[j]; - scr_en_weapon("Web Spinner", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Venom Claws", true, dudes_num[j], dudes[j], j); - } - - if (((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (neww == 1)) || (dudes_num[j] > 1)) { - if (dudes[j] == "Greater Daemon of Khorne") { - dudes_ac[j] = 12; - dudes_hp[j] = 700; - } - } - if (dudes[j] == "Greater Daemon of Khorne") { - scr_en_weapon("Khorne Demon Melee", true, dudes_num[j], dudes[j], j); - dudes_dr[j] = 0.5; - medi += dudes_num[j]; - if (obj_ncombat.battle_special == "ship_demon") { - dudes_dr[j] = 0.65; - } - } - if (((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (neww == 1)) || (dudes_num[j] > 1)) { - if (dudes[j] == "Greater Daemon of Slaanesh") { - dudes_ac[j] = 10; - dudes_hp[j] = 500; - dudes_dr[j] = 0.25; - } - } - if (dudes[j] == "Greater Daemon of Slaanesh") { - scr_en_weapon("Demon Melee", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Lash Whip", true, dudes_num[j], dudes[j], j); - dudes_dr[j] = 0.25; - medi += dudes_num[j]; - } - if (((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (neww == 1)) || (dudes_num[j] > 1)) { - if (dudes[j] == "Greater Daemon of Nurgle") { - dudes_ac[j] = 8; - dudes_hp[j] = 900; - dudes_dr[j] = 0.2; - } - } - if (dudes[j] == "Greater Daemon of Nurgle") { - scr_en_weapon("Demon Melee", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Nurgle Vomit", true, dudes_num[j], dudes[j], j); - dudes_dr[j] = 0.6; - medi += dudes_num[j]; - } - if (((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (neww == 1)) || (dudes_num[j] > 1)) { - if (dudes[j] == "Greater Daemon of Tzeentch") { - dudes_ac[j] = 10; - dudes_hp[j] = 600; - } - } - if (dudes[j] == "Greater Daemon of Tzeentch") { - scr_en_weapon("Demon Melee", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Witchfire", true, dudes_num[j], dudes[j], j); - dudes_dr[j] = 0.75; - medi += dudes_num[j]; - } - - if (dudes[j] == "Bloodletter") { - scr_en_weapon("Bloodletter Melee", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 200; - men += dudes_num[j]; - dudes_dr[j] = 0.4; - } - if (dudes[j] == "Daemonette") { - scr_en_weapon("Daemonette Melee", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 150; - men += dudes_num[j]; - dudes_dr[j] = 0.3; - } - if (dudes[j] == "Pink Horror") { - scr_en_weapon("Eldritch Fire", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 100; - men += dudes_num[j]; - dudes_dr[j] = 0.5; - } - if (dudes[j] == "Plaguebearer") { - scr_en_weapon("Plaguebearer Melee", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 5; - dudes_hp[j] = 300; - men += dudes_num[j]; - dudes_dr[j] = 0.4; - } - - if (dudes[j] == "Helbrute") { - scr_en_weapon("Power Fist", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Multi-Melta", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 300; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - dudes_dr[j] = 0.5; - } - if (dudes[j] == "Soul Grinder") { - scr_en_weapon("Warpsword", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Iron Claw", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Battle Cannon", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 350; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - dudes_dr[j] = 0.5; - } - if (dudes[j] == "Maulerfiend") { - scr_en_weapon("Maulerfiend Claws", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 250; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - dudes_dr[j] = 0.5; - } - } - j = 0; - - neww = 0; - - if ((men + veh == 1) && (instance_number(obj_enunit) == 1)) { - if ((men == 1) && (veh == 0)) { - var i, h; - i = 0; - h = 0; - repeat (20) { - if (h == 0) { - i += 1; - if (dudes_num[i] == 1) { - h = dudes_hp[i]; - obj_ncombat.display_p2 = h; - obj_ncombat.display_p2n = string(dudes[i]); - } - } - } - } - } - - /* */ - var __b__; - __b__ = action_if_variable(obj_ncombat.enemy, 1, 0); - if (__b__) { - var j; - j = 0; - men = 0; - repeat (100) { - j += 1; - veh = 0; - dreads = 0; - if ((dudes[j] != "") && (dudes_vehicle[j] == 0)) { - men += dudes_num[j]; - } - } - - // show_message("dudes1:"+string(dudes[1])+", men:"+string(men)); - - var i, g; - i = 0; - g = 0; - - var dreaded; - dreaded = false; - - repeat (700) { - g += 1; - // Why was this here? And why was it later checked, if it always would be false?; - // marine_casting[g] = false; - - if (((dudes[g] != "") && (dudes_num[g] > 0)) && (dudes_hp[g] > 0)) { - // if (marine_hp[g]>0) then men+=1; - - /* - scr_en_weapon - argument0: name - argument1: man? - argument2: number - argument3: owner - argument4: dudes number - */ - - if ((dudes[g] == obj_ini.role[100][6]) || (dudes[g] == "Venerable " + obj_ini.role[100][6]) && (dudes_hp[g] > 0)) { - dreads += 1; - dreaded = true; - } - if (dudes_mobi[g] == "Bike") { - scr_en_weapon("Twin Linked Bolters", false, 1, dudes[g], g); - } - if ((dudes_mobi[g] != "Bike") && (dudes_mobi[g] != "")) { - if (string_count("Jump Pack", marine_mobi[g]) > 0) { - scr_en_weapon("Hammer of Wrath", false, 1, dudes[g], g); - } - } - - if (dudes_mobi[g] == "Servo-arm") { - scr_en_weapon("Servo-arm(M)", false, 1, dudes[g], g); - } - if (dudes_mobi[g] == "Servo-harness") { - scr_en_weapon("Servo-arm(M)", false, 1, dudes[g], g); - scr_en_weapon("Flamer", false, 1, dudes[g], g); - scr_en_weapon("Plasma Cutter", false, 1, dudes[g], g); - } - - var j, good, open; - j = 0; - good = 0; - open = 0; // Counts the number and types of marines within this object - repeat (20) { - j += 1; - if ((dudes[j] == "") && (open == 0)) { - open = j; // Determine if vehicle here - - if (dudes[j] == "Venerable " + string(obj_ini.role[100][6])) { - dudes_vehicle[j] = 1; - } - if (dudes[j] == obj_ini.role[100][6]) { - dudes_vehicle[j] = 1; - } - } - // if (dudes[g]=dudes[j]){good=1;dudes_num[j]+=1;} - // if (good=0) and (open!=0){dudes[open]=marine_type[g];dudes_num[open]=1;} - } - - if ((dudes_wep1[g] != "") && (marine_casting[g] == false)) { - // Do not add weapons to the roster while casting - if (dudes[g] != "Chapter Master") { - scr_en_weapon(string(dudes_wep1[g]), false, 1, dudes[g], g); - } - - if (dudes_wep1[g] == "Close Combat Weapon") { - scr_en_weapon("CCW Heavy Flamer", true, 1, dudes[g], g); - } - if (string_count("UBOLT", dudes_wep1[g]) > 0) { - scr_en_weapon("Integrated-Bolter", false, 1, dudes[g], g); - } - if (string_count("UFL", dudes_wep1[g]) > 0) { - scr_en_weapon("Underslung Flamer", false, 1, dudes[g], g); - } - } - if ((dudes_wep2[g] != "") && (marine_casting[g] == false)) { - if (dudes[g] != "Chapter Master") { - scr_en_weapon(string(dudes_wep2[g]), false, 1, dudes[g], g); - } - - if (dudes_wep2[g] == "Close Combat Weapon") { - scr_en_weapon("CCW Heavy Flamer", true, 1, dudes[g], g); - } - if (string_count("UBOLT", dudes_wep2[g]) > 0) { - scr_en_weapon("Integrated-Bolter", false, 1, dudes[g], g); - } - if (string_count("UFL", dudes_wep2[g]) > 0) { - scr_en_weapon("Underslung Flamer", false, 1, dudes[g], g); - } - } - } - } - - // Right here should be retreat- if important units are exposed they should try to hop left - - if ((men > 0) && (alarm[5] > 0)) { - alarm[5] = -1; - } - instance_activate_object(obj_enunit); - - exit; - - /* */ - } - __b__ = action_if_variable(obj_ncombat.enemy, 2, 0); - if (__b__) { - repeat (20) { - j += 1; - if (dudes[j] == "Imperial Guardsman") { - dudes_ac[j] = 40; - dudes_hp[j] = 5; - men += dudes_num[j]; - } - - if (dudes[j] == "Heavy Weapons Team") { - scr_en_weapon("Heavy Bolter", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 100; - dudes_dr[j] = 0.9; - men += dudes_num[j]; - } - - if (dudes[j] == "Ogryn") { - scr_en_weapon("Ripper Gun", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Ogryn Melee", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 120; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - - if (dudes[j] == "Chimera") { - scr_en_weapon("Multi-Laster", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Heavy Bolter", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 200; - dudes_dr[j] = 0.75; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] == "Basilisk") { - scr_en_weapon("Earthshaker Cannon", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Storm Bolter", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 150; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] == "Leman Russ Battle Tank") { - scr_en_weapon("Battle Cannon", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Lascannon", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 45; - dudes_hp[j] = 250; - dudes_dr[j] = 0.25; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] == "Leman Russ Demolisher") { - scr_en_weapon("Demolisher Cannon", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Lascannon", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 250; - dudes_dr[j] = 0.25; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] == "Vendetta") { - scr_en_weapon("Twin-Linked Lascannon", false, dudes_num[j] * 3, dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 300; - dudes_dr[j] = 0.25; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - } - - // Twin-Linked Lascannon - // Multi-Laser - // Ripper Gun - // Earthshaker Cannon - - // 0-10,000,000 - // Leman Russ Battle Tank = min.1, max = /40000 - // Leman Russ Demolisher = min.1, max = /60000 - // Chimera = min.1, max = /60000 - - /* */ - } - __b__ = action_if_variable(obj_ncombat.enemy, 3, 0); - if (__b__) { - repeat (20) { - j += 1; - if (dudes[j] == "Thallax") { - scr_en_weapon("Lightning Gun", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Thallax Melee", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 80; - men += dudes_num[j]; - } - if (dudes[j] == "Praetorian Servitor") { - scr_en_weapon("Phased Plasma-fusil", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 25; - dudes_hp[j] = 150; - medi += dudes_num[j]; - } - } - - // - // - - /* */ - } - __b__ = action_if_variable(obj_ncombat.enemy, 5, 0); - if (__b__) { - repeat (20) { - j += 1; - if (dudes[j] == "Leader") { - scr_en_weapon("Blessed Weapon", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Laser Mace", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Infernus Pistol", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - if ((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (dudes_num[j] > 1)) { - dudes_hp[j] = 200; - } - men += dudes_num[j]; - dudes_dr[j] = 0.25; - } - if (dudes[j] == "Palatine") { - scr_en_weapon("Plasma Pistol", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 100; - men += dudes_num[j]; - dudes_dr[j] = 0.5; - } - if (dudes[j] == "Priest") { - scr_en_weapon("Laspistol", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 0; - dudes_hp[j] = 50; - men += dudes_num[j]; - dudes_dr[j] = 0.5; - } - - if (dudes[j] == "Arco-Flagellent") { - scr_en_weapon("Electro-Flail", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 0; - dudes_hp[j] = 150; - men += dudes_num[j]; - dudes_dr[j] = 0.7; - } - - if (dudes[j] == "Celestian") { - scr_en_weapon("Bolter", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Chainsword", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 60; - men += dudes_num[j]; - dudes_dr[j] = 0.50; - } - if (dudes[j] == "Mistress") { - scr_en_weapon("Neural Whip", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 60; - men += dudes_num[j]; - dudes_dr[j] = 0.50; - } - if (dudes[j] == "Sister Repentia") { - scr_en_weapon("Eviscerator", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 0; - dudes_hp[j] = 75; - men += dudes_num[j]; - dudes_dr[j] = 0.75; - } - - if (dudes[j] == "Battle Sister") { - if (dudes_num[j] <= 4) { - scr_en_weapon("Bolter", true, dudes_num[j], dudes[j], j); - } - if (dudes_num[j] >= 5) { - var nem; - nem = round(dudes_num[j] / 4); - scr_en_weapon("Flamer", true, nem, dudes[j], j); - scr_en_weapon("Bolter", true, dudes_num[j] - nem, dudes[j], j); - } - scr_en_weapon("Sarissa", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 60; - men += dudes_num[j]; - dudes_dr[j] = 0.75; - } - if (dudes[j] == "Seraphim") { - scr_en_weapon("Seraphim Pistols", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Chainsword", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 60; - men += dudes_num[j]; - dudes_dr[j] = 0.6; - } - if (dudes[j] == "Dominion") { - scr_en_weapon("Meltagun", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Meltabomb", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 60; - men += dudes_num[j]; - dudes_dr[j] = 0.75; - } - if (dudes[j] == "Retributor") { - if (dudes_num[j] <= 3) { - scr_en_weapon("Heavy Bolter", true, dudes_num[j], dudes[j], j); - } - if (dudes_num[j] >= 4) { - var nem; - nem = round(dudes_num[j] / 4); - scr_en_weapon("Missile Launcher", true, nem, dudes[j], j); - scr_en_weapon("Heavy Bolter", true, dudes_num[j] - nem, dudes[j], j); - } - scr_en_weapon("Bolt Pistol", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 60; - men += dudes_num[j]; - dudes_dr[j] = 0.6; - } - - if (dudes[j] == "Follower") { - scr_en_weapon("Laspistol", true, dudes_num[j], dudes[j], j); - scr_en_weapon("melee0.5", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 0; - dudes_hp[j] = 30; - men += dudes_num[j]; - } - - if (dudes[j] == "Rhino") { - scr_en_weapon("Storm Bolter", false, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 200; - dudes_dr[j] = 0.75; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - - if (dudes[j] == "Chimera") { - scr_en_weapon("Heavy Flamer", false, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 200; - dudes_dr[j] = 0.75; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - - if (dudes[j] == "Immolator") { - scr_en_weapon("Twin Linked Heavy Flamers", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 300; - dudes_dr[j] = 0.35; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] == "Exorcist") { - scr_en_weapon("Exorcist Missile Launcher", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Storm Bolter", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - if ((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (dudes_num[j] > 1)) { - dudes_hp[j] = 200; - } - dudes_dr[j] = 0.55; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - - if (dudes[j] == "Penitent Engine") { - scr_en_weapon("Close Combat Weapon", false, dudes_num[j] * 2, dudes[j], j); - scr_en_weapon("Heavy Flamer", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 35; - dudes_hp[j] = 150; - dudes_dr[j] = 0.50; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - - // if (obj_ncombat.enemy=11) and (dudes_vehicle[j]=0) and (dudes[j]!="Cultist"){dudes_dr[j]=0.8;} - // if (obj_ncombat.enemy=11) and (dudes_vehicle[j]=1){dudes_dr[j]=0.75;} - - // if (dudes[j]!="") and (dudes_num[j]=0){dudes[j]="";dudes_num[j]=0;} - if ((dudes[j] != "") && (dudes_hp[j] == 0)) { - dudes[j] = ""; - dudes_num[j] = 0; - } - if (faith[j] > 0) { - dudes_dr[j] = max(0.65, dudes_dr[j] + 0.15); - } - } - - /* */ - } - __b__ = action_if_variable(obj_ncombat.enemy, 6, 0); - if (__b__) { - repeat (20) { - j += 1; - if (dudes[j] == "Leader") { - scr_en_weapon("Singing Spear", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Singing Spear Throw", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 150; - men += dudes_num[j]; - dudes_dr[j] = 0.5; - } - - if (dudes[j] == "Autarch") { - scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Fusion Gun", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 12; - dudes_hp[j] = 150; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - if (dudes[j] == "Farseer") { - scr_en_weapon("Singing Spear", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Singing Spear Throw", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 120; - dudes_dr[j] = 0.6; - men += dudes_num[j]; - } - if (dudes[j] == "Warlock") { - scr_en_weapon("Witchblade", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Psyshock", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 80; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - if (dudes[j] == "Avatar") { - scr_en_weapon("Wailing Doom", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Avatar Smite", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 300; - dudes_dr[j] = 0.55; - veh += dudes_num[j]; - } - if (dudes[j] == "Mighty Avatar") { - scr_en_weapon("Wailing Doom", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Avatar Smite", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 50; - dudes_hp[j] = 450; - dudes_dr[j] = 0.5; - veh += dudes_num[j]; - } - if (dudes[j] == "Godly Avatar") { - scr_en_weapon("Wailing Doom", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Avatar Smite", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 60; - dudes_hp[j] = 600; - dudes_dr[j] = 0.40; - veh += dudes_num[j]; - } - - if (dudes[j] == "Ranger") { - scr_en_weapon("Ranger Long Rifle", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Shuriken Pistol", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 40; - dudes_dr[j] = 0.9; - men += dudes_num[j]; - } - if (dudes[j] == "Pathfinder") { - scr_en_weapon("Pathfinder Long Rifle", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 60; - dudes_dr[j] = 0.8; - men += dudes_num[j]; - } - if (dudes[j] == "Dire Avenger") { - scr_en_weapon("Avenger Shuriken Catapult", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 40; - men += dudes_num[j]; - } - if (dudes[j] == "Dire Avenger Exarch") { - scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 70; // Shimmershield - men += dudes_num[j]; - } - if (dudes[j] == "Howling Banshee") { - scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Shuriken Pistol", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 40; - dudes_dr[j] = 0.8; - men += dudes_num[j]; - } - if (dudes[j] == "Howling Banshee Exarch") { - scr_en_weapon("Executioner", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 60; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - if (dudes[j] == "Striking Scorpion") { - scr_en_weapon("Scorpion Chainsword", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Shuriken Pistol", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Mandiblaster", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 60; - men += dudes_num[j]; - } - if (dudes[j] == "Striking Scorpion Exarch") { - scr_en_weapon("Biting Blade", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Scorpion's Claw", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Mandiblaster", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 80; - men += dudes_num[j]; - } - if (dudes[j] == "Fire Dragon") { - scr_en_weapon("Fusion Gun", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Meltabomb", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 12; - dudes_hp[j] = 40; - men += dudes_num[j]; - } - if (dudes[j] == "Fire Dragon Exarch") { - scr_en_weapon("Firepike", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 12; - dudes_hp[j] = 60; - men += dudes_num[j]; - } - if (dudes[j] == "Warp Spider") { - scr_en_weapon("Deathspinner", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 40; - dudes_dr[j] = 0.9; - men += dudes_num[j]; - } - if (dudes[j] == "Warp Spider Exarch") { - scr_en_weapon("Dual Deathspinners", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Powerblades", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 60; - dudes_dr[j] = 0.8; - men += dudes_num[j]; - } - if (dudes[j] == "Dark Reaper") { - scr_en_weapon("Reaper Launcher", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 40; - men += dudes_num[j]; - } - if (dudes[j] == "Dark Reaper Exarch") { - scr_en_weapon("Tempest Launcher", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 50; - men += dudes_num[j]; - } - if (dudes[j] == "Shining Spear") { - scr_en_weapon("Laser Lance", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Twin Linked Shuriken Catapult", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 75; - dudes_dr[j] = 0.8; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] == "Guardian") { - scr_en_weapon("Shuriken Catapult", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 30; - men += dudes_num[j]; - } - if (dudes[j] == "Grav Platform") { - scr_en_weapon("Pulse Laser", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 60; - men += dudes_num[j]; - } - if (dudes[j] == "Trouper") { - scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Fusion Pistol", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 50; - dudes_dr[j] = 0.25; - men += dudes_num[j]; - } - if (dudes[j] == "Athair") { - scr_en_weapon("Plasma Pistol", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Harlequin's Kiss", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 75; - dudes_dr[j] = 0.25; - men += dudes_num[j]; - } - if (dudes[j] == "Wraithguard") { - scr_en_weapon("Wraithcannon", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 15; - dudes_hp[j] = 125; - dudes_dr[j] = 0.70; - men += dudes_num[j]; - } - if (dudes[j] == "Vyper") { - scr_en_weapon("Twin Linked Shuriken Catapult", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Pulse Laser", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 100; - dudes_dr[j] = 0.8; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] == "Falcon") { - scr_en_weapon("Pulse Laser", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Shuriken Cannon", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Bright Lance", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 200; - dudes_dr[j] = 0.6; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] == "Fire Prism") { - scr_en_weapon("Twin Linked Shuriken Catapult", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Prism Cannon", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 200; - dudes_dr[j] = 0.5; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] == "Nightspinner") { - scr_en_weapon("Twin Linked Doomweaver", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 200; - dudes_dr[j] = 0.6; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] == "Wraithlord") { - scr_en_weapon("Two Power Fists", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Flamer", false, dudes_num[j] * 2, dudes[j], j); - scr_en_weapon("Starcannon", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 200; - dudes_dr[j] = 0.5; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] == "Phantom Titan") { - scr_en_weapon("Two Power Fists", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Phantom Pulsar", false, dudes_num[j] * 2, dudes[j], j); - scr_en_weapon("Titan Starcannon", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 50; - dudes_hp[j] = 800; - dudes_dr[j] = 0.35; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - } - - /* */ - } - __b__ = action_if_variable(obj_ncombat.enemy, 7, 0); - if (__b__) { - repeat (20) { - j += 1; - if (dudes[j] == "Leader") { - scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Rokkit Launcha", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Big Shoota", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 12; - if ((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (dudes_num[j] > 1)) { - dudes_hp[j] = 600; - } - veh += dudes_num[j]; - dudes_dr[j] = 0.5; - } - - if (dudes[j] == "Minor Warboss") { - scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Big Shoota", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - if ((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (dudes_num[j] > 1)) { - dudes_hp[j] = 150; - dudes_dr[j] = 0.75; - } - men += dudes_num[j]; - } - if (dudes[j] == "Warboss") { - scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Rokkit Launcha", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 12; - if ((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (dudes_num[j] > 1)) { - dudes_hp[j] = 200; - dudes_dr[j] = 0.75; - } - men += dudes_num[j]; - } - if (dudes[j] == "Big Warboss") { - scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Rokkit Launcha", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 12; - if ((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (dudes_num[j] > 1)) { - dudes_hp[j] = 300; - dudes_dr[j] = 0.5; - } - men += dudes_num[j]; - } - - if (dudes[j] == "Gretchin") { - scr_en_weapon("Grot Blasta", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 0; - dudes_hp[j] = 15; - men += dudes_num[j]; - } - if (dudes[j] == "Slugga Boy") { - scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Slugga", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 5; - dudes_hp[j] = 60; - men += dudes_num[j]; - } - if (dudes[j] == "Shoota Boy") { - scr_en_weapon("Shoota", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 5; - dudes_hp[j] = 60; - men += dudes_num[j]; - } - - if (dudes[j] == "Mekboy") { - scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Big Shoota", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 12; - dudes_hp[j] = 100; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - if (dudes[j] == "Meganob") { - scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Big Shoota", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 12; - dudes_hp[j] = 150; - dudes_dr[j] = 0.6; - men += dudes_num[j]; - } - if (dudes[j] == "Flash Git") { - scr_en_weapon("Snazzgun", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 100; - men += dudes_num[j]; - } - if (dudes[j] == "Cybork") { - scr_en_weapon("Power Klaw", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Big Shoota", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 125; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - - if (dudes[j] == "Ard Boy") { - scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Slugga", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 80; - dudes_dr[j] = 0.9; - men += dudes_num[j]; - } - if (dudes[j] == "Kommando") { - scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Rokkit Launcha", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 125; - dudes_dr[j] = 0.9; - men += dudes_num[j]; - } - if (dudes[j] == "Burna Boy") { - scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Burna", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 5; - dudes_hp[j] = 80; - men += dudes_num[j]; - } - if (dudes[j] == "Tankbusta") { - scr_en_weapon("Rokkit Launcha", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Tankbusta Bomb", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 5; - dudes_hp[j] = 80; - men += dudes_num[j]; - } - if (dudes[j] == "Stormboy") { - scr_en_weapon("Choppa", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Slugga", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 5; - dudes_hp[j] = 80; - dudes_special[j] = "Jetpack"; - men += dudes_num[j]; - } - - if (dudes[j] == "Battlewagon") { - scr_en_weapon("Kannon", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Big Shoota", false, dudes_num[j] * 2, dudes[j], j); - scr_en_weapon("Rokkit Launcha", false, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 80; - dudes_hp[j] = 800; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] == "Deff Dread") { - scr_en_weapon("Power Klaw", false, dudes_num[j] * 2, dudes[j], j); - scr_en_weapon("Big Shoota", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Rokkit Launcha", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 60; - dudes_hp[j] = 500; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - } - - /* */ - } - __b__ = action_if_variable(obj_ncombat.enemy, 8, 0); - if (__b__) { - repeat (20) { - j += 1; - if (dudes[j] == "XV8 Commander") { - scr_en_weapon("Plasma Rifle", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Fusion Blaster", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Cyclic Ion Blaster", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 12; - dudes_hp[j] = 300; - dudes_dr[j] = 0.5; - men += dudes_num[j]; - } - if (dudes[j] == "XV8 Bodyguard") { - scr_en_weapon("Plasma Rifle", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Burst Rifle", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 200; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - if (dudes[j] == "XV8 Crisis") { - scr_en_weapon("Plasma Rifle", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Missile Pod", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 150; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - if (dudes[j] == "XV8 (Brightknife)") { - scr_en_weapon("Fusion Blaster", true, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 150; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - if (dudes[j] == "Shield Drone") { - dudes_ac[j] = 8; - dudes_hp[j] = 50; - men += dudes_num[j]; - } - - if (dudes[j] == "XV88 Broadside") { - scr_en_weapon("Smart Missile System", true, dudes_num[j] * 2, dudes[j], j); - scr_en_weapon("Small Railgun", true, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 12; - dudes_hp[j] = 225; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - if (dudes[j] == "XV25 Stealthsuit") { - scr_en_weapon("Burst Rifle", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 50; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - - if (dudes[j] == "Fire Warrior") { - scr_en_weapon("Pulse Rifle", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 30; - men += dudes_num[j]; - } - if (dudes[j] == "Pathfinder") { - scr_en_weapon("Rail Rifle", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 30; - men += dudes_num[j]; - } - if (dudes[j] == "Kroot") { - scr_en_weapon("Kroot Rifle", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee2", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 5; - dudes_hp[j] = 30; - men += dudes_num[j]; - } - if (dudes[j] == "Vespid") { - scr_en_weapon("Vespid Crystal", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee2", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 5; - dudes_hp[j] = 50; - men += dudes_num[j]; - } - - if (dudes[j] == "Devilfish") { - scr_en_weapon("Smart Missile System", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 150; - dudes_dr[j] = 0.75; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] == "Hammerhead") { - scr_en_weapon("Railgun", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Smart Missile System", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 150; - dudes_dr[j] = 0.75; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - } - - /* */ - } - __b__ = action_if_variable(obj_ncombat.enemy, 9, 0); - if (__b__) { - repeat (20) { - j += 1; - if (dudes[j] == "Hive Tyrant") { - scr_en_weapon("Bonesword", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Lashwhip", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Heavy Venom Cannon", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 400; - dudes_dr[j] = 0.5; - men += dudes_num[j]; - } - - if (dudes[j] == "Tyrant Guard") { - scr_en_weapon("Crushing Claws", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 12; - dudes_hp[j] = 200; - dudes_dr[j] = 0.6; - men += dudes_num[j]; - } - if (dudes[j] == "Tyranid Warrior") { - scr_en_weapon("Rending Claws", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Devourer", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 100; - dudes_dr[j] = 0.9; - men += dudes_num[j]; - } - if (dudes[j] == "Zoanthrope") { - scr_en_weapon("Zoanthrope Blast", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 300; - dudes_dr[j] = 0.25; - men += dudes_num[j]; - } - if (dudes[j] == "Carnifex") { - scr_en_weapon("Carnifex Claws", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Venom Cannon", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 300; - dudes_dr[j] = 0.75; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] == "Termagaunt") { - scr_en_weapon("Fleshborer", true, dudes_num[j] / 10, dudes[j], j); - dudes_ac[j] = 5; - dudes_hp[j] = 25; - men += dudes_num[j]; - } - if (dudes[j] == "Hormagaunt") { - scr_en_weapon("Scything Talons", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 5; - dudes_hp[j] = 25; - men += dudes_num[j]; - } - - if (dudes[j] == "Cultist") { - scr_en_weapon("Autogun", true, dudes_num[j], dudes[j], j); - scr_en_weapon("melee0.5", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 0; - dudes_hp[j] = 35; - men += dudes_num[j]; - } - if (dudes[j] == "Genestealer") { - scr_en_weapon("Genestealer Claws", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 5; - dudes_hp[j] = 75; - men += dudes_num[j]; - } - if (dudes[j] == "Genestealer Patriarch") { - scr_en_weapon("Genestealer Claws", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Witchfire", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 300; - dudes_dr[j] = 0.60; - men += dudes_num[j]; - } - if (dudes[j] == "Armoured Limousine") { - scr_en_weapon("Autogun", false, dudes_num[j] * 4, dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 150; - dudes_dr[j] = 0.75; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] == "Lictor") { - scr_en_weapon("Lictor Claws", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Flesh Hooks", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 300; - dudes_dr[j] = 0.60; - men += dudes_num[j]; - } - } - - /* */ - } - __b__ = action_if_variable(obj_ncombat.enemy, 10, 4); - if (__b__) { - __b__ = action_if_variable(obj_ncombat.enemy, 12, 1); - if (__b__) { - repeat (20) { - j += 1; - if ((dudes[j] == "Leader") && (obj_controller.faction_gender[10] == 1)) { - scr_en_weapon("Meltagun", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Power Fist", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - if ((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (dudes_num[j] > 1)) { - dudes_hp[j] = 300; - } - men += dudes_num[j]; - dudes_dr[j] = 0.75; - } - if ((dudes[j] == "Leader") && (obj_controller.faction_gender[10] == 2)) { - scr_en_weapon("Khorne Demon Melee", true, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 30; - if ((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (dudes_num[j] > 1)) { - dudes_hp[j] = 300; - } - men += dudes_num[j]; - dudes_dr[j] = 0.75; - } - - if (dudes[j] == "Fallen") { - scr_en_weapon("Bolt Pistol", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 120; - men += dudes_num[j]; - dudes_dr[j] = 0.5; - } - - if (dudes[j] == "Chaos Lord") { - scr_en_weapon("Plasma Pistol", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 150; - dudes_dr[j] = 0.5; - men += dudes_num[j]; - } - if (dudes[j] == "Chaos Sorcerer") { - scr_en_weapon("Plasma Pistol", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Force Staff", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 100; - dudes_dr[j] = 0.5; - men += dudes_num[j]; - } - if (dudes[j] == "Warpsmith") { - scr_en_weapon("Chainfist", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Meltagun", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Flamer", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - dudes_hp[j] = 100; - dudes_dr[j] = 0.5; - men += dudes_num[j]; - } - - if (dudes[j] == "Chaos Terminator") { - scr_en_weapon("Power Fist", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Bolter", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Combi-Flamer", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 100; - men += dudes_num[j]; - dudes_dr[j] = 0.5; - } - if (dudes[j] == "Venerable Chaos Terminator") { - scr_en_weapon("Power Fist", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Bolter", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Combi-Flamer", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 120; - men += dudes_num[j]; - dudes_dr[j] = 0.4; - } - if (dudes[j] == "World Eaters Terminator") { - scr_en_weapon("Power Fist", true, dudes_num[j] * 2, dudes[j], j); - scr_en_weapon("Meltagun", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 120; - men += dudes_num[j]; - dudes_dr[j] = 0.4; - } - if (dudes[j] == "Obliterator") { - scr_en_weapon("Power Fist", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Obliterator Weapon", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 200; - dudes_dr[j] = 0.5; - men += dudes_num[j]; - } - if (dudes[j] == "Chaos Chosen") { - scr_en_weapon("Meltagun", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Chainsword", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 125; - dudes_dr[j] = 0.85; - men += dudes_num[j]; - } - if (dudes[j] == "Venerable Chaos Chosen") { - scr_en_weapon("Meltagun", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Chainsword", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 125; - men += dudes_num[j]; - dudes_dr[j] = 0.75; - } - - if (dudes[j] == "Possessed") { - scr_en_weapon("Possessed Claws", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 17; - dudes_hp[j] = 150; - dudes_dr[j] = 0.5; - men += dudes_num[j]; - } - if (dudes[j] == "Chaos Space Marine") { - scr_en_weapon("Bolter", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Chainsword", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 100; - dudes_dr[j] = 0.9; - men += dudes_num[j]; - } - if (dudes[j] == "Havoc") { - scr_en_weapon("Missile Launcher", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 100; - dudes_dr[j] = 0.9; - men += dudes_num[j]; - } - if (dudes[j] == "Raptor") { - scr_en_weapon("Chainsword", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Bolt Pistol", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 100; - dudes_dr[j] = 0.75; - dudes_special[j] = "Jump Pack"; - men += dudes_num[j]; - } - - if (dudes[j] == "World Eater") { - scr_en_weapon("Bolter", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Chainaxe", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 100; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - if (dudes[j] == "World Eaters Veteran") { - scr_en_weapon("Combi-Flamer", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Chainaxe", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 100; - dudes_dr[j] = 0.7; - men += dudes_num[j]; - } - - if (dudes[j] == "Khorne Berzerker") { - scr_en_weapon("Chainaxe", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Bolt Pistol", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 100; - dudes_dr[j] = 0.65; - men += dudes_num[j]; - } - if (dudes[j] == "Plague Marine") { - scr_en_weapon("Bolter", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Poison Chainsword", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 150; - dudes_dr[j] = 0.5; - men += dudes_num[j]; - } - if (dudes[j] == "Noise Marine") { - scr_en_weapon("Sonic Blaster", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 100; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - if (dudes[j] == "Rubric Marine") { - scr_en_weapon("Rubric Bolter", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 125; - dudes_dr[j] = 0.65; - men += dudes_num[j]; - } - if (dudes[j] == "Rubric Sorcerer") { - scr_en_weapon("Witchfire", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Force Staff", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 150; - dudes_dr[j] = 0.5; - men += dudes_num[j]; - } - if (dudes[j] == "Cultist") { - scr_en_weapon("Autogun", true, dudes_num[j], dudes[j], j); - scr_en_weapon("melee0.5", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 5; - dudes_hp[j] = 35; - men += dudes_num[j]; - } - if (dudes[j] == "Hellbrute") { - scr_en_weapon("Power Fist", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Meltagun", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 300; - dudes_dr[j] = 0.5; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] == "Rhino") { - scr_en_weapon("Storm Bolter", false, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 200; - dudes_dr[j] = 0.75; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] == "Predator") { - scr_en_weapon("Lascannon", false, dudes_num[j] * 2, dudes[j], j); - scr_en_weapon("Twin Linked Lascannon", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 45; - dudes_hp[j] = 350; - dudes_dr[j] = 0.5; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] == "Vindicator") { - scr_en_weapon("Demolisher Cannon", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Havoc Launcher", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 45; - dudes_hp[j] = 300; - dudes_dr[j] = 0.5; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] == "Land Raider") { - scr_en_weapon("Twin Linked Heavy Bolters", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Twin Linked Lascannon", false, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 50; - dudes_hp[j] = 400; - dudes_dr[j] = 0.25; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] == "Heldrake") { - scr_en_weapon("Baleflame", false, dudes_num[j] * 5, dudes[j], j); - dudes_ac[j] = 50; - dudes_hp[j] = 400; - dudes_dr[j] = 0.25; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] == "Defiler") { - scr_en_weapon("Defiler Claws", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Battle Cannon", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Reaper Autocannon", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Flamer", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 300; - dudes_dr[j] = 0.5; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - - if (dudes[j] == "Arch Heretic") { - scr_en_weapon("Power Weapon", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Plasma Pistol", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 40; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - if (dudes[j] == "Cultist Elite") { - scr_en_weapon("Lasgun", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Chainaxe", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 40; - dudes_dr[j] = 0.9; - men += dudes_num[j]; - } - if (dudes[j] == "Mutant") { - scr_en_weapon("Flesh Hooks", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 0; - dudes_hp[j] = 30; - men += dudes_num[j]; - } - if (dudes[j] == "Daemonhost") { - scr_en_weapon("Daemonhost Claws", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Daemonhost_Powers", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 300; - dudes_dr[j] = 0.5; - medi += dudes_num[j]; - } - if (dudes[j] == "Possessed") { - scr_en_weapon("Possessed Claws", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 100; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - - /* - if (dudes[j]="Greater Daemon of Khorne"){scr_en_weapon("Khorne Demon Melee",true,dudes_num[j],dudes[j],j);dudes_ac[j]=10;dudes_hp[j]=300;dudes_dr[j]=0.25;medi+=dudes_num[j];} - if (dudes[j]="Greater Daemon of Slaanesh"){scr_en_weapon("Demon Melee",true,dudes_num[j],dudes[j],j);scr_en_weapon("Lash Whip",true,dudes_num[j],dudes[j],j);dudes_ac[j]=10;dudes_hp[j]=250;dudes_dr[j]=0.35;medi+=dudes_num[j];} - if (dudes[j]="Greater Daemon of Nurgle"){scr_en_weapon("Demon Melee",true,dudes_num[j],dudes[j],j);scr_en_weapon("Nurgle Vomit",true,dudes_num[j],dudes[j],j);dudes_ac[j]=15;dudes_hp[j]=400;dudes_dr[j]=0.25;medi+=dudes_num[j];} - if (dudes[j]="Greater Daemon of Tzeentch"){scr_en_weapon("Demon Melee",true,dudes_num[j],dudes[j],j);scr_en_weapon("Witchfire",true,dudes_num[j],dudes[j],j);dudes_ac[j]=10;dudes_hp[j]=250;dudes_dr[j]=0.35;medi+=dudes_num[j];} - */ - - if (dudes[j] == "Technical") { - scr_en_weapon("Autogun", false, dudes_num[j] * 2, dudes[j], j); - scr_en_weapon("Heavy Bolter", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 10; - dudes_hp[j] = 100; - dudes_dr[j] = 0.75; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - - if (dudes[j] == "Chaos Leman Russ") { - scr_en_weapon("Battle Cannon", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Heavy Bolter", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 45; - dudes_hp[j] = 250; - dudes_dr[j] = 0.25; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] == "Chaos Basilisk") { - scr_en_weapon("Earthshaker Cannon", false, dudes_num[j], dudes[j], j); - scr_en_weapon("Heavy Bolter", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 150; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - - // if (obj_ncombat.enemy=11) and (dudes_vehicle[j]=0) and (dudes[j]!="Cultist"){dudes_dr[j]=0.8;} - // if (obj_ncombat.enemy=11) and (dudes_vehicle[j]=1){dudes_dr[j]=0.75;} - - // if (dudes[j]!="") and (dudes_num[j]=0){dudes[j]="";dudes_num[j]=0;} - if ((dudes[j] != "") && (dudes_hp[j] == 0)) { - dudes[j] = ""; - dudes_num[j] = 0; - } - } - - /* */ - } - } - __b__ = action_if_variable(obj_ncombat.enemy, 13, 0); - if (__b__) { - repeat (20) { - j += 1; - - if (dudes[j] == "Necron Overlord") { - scr_en_weapon("Staff of Light", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Staff of Light Shooting", true, dudes_num[j], dudes[j], j); - if ((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (dudes_num[j] > 1)) { - dudes_ac[j] = 12; - dudes_hp[j] = 300; - dudes_dr[j] = 0.5; - } - men += dudes_num[j]; - } - if (dudes[j] == "Lychguard") { - scr_en_weapon("Warscythe", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 12; - dudes_hp[j] = 100; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - } - - if (dudes[j] == "Flayed One") { - scr_en_weapon("Melee5", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 75; - dudes_dr[j] = 0.9; - men += dudes_num[j]; - } - if (dudes[j] == "Necron Warrior") { - scr_en_weapon("Gauss Flayer", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee3", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 75; - dudes_dr[j] = 0.9; - men += dudes_num[j]; - } - if (dudes[j] == "Necron Immortal") { - scr_en_weapon("Gauss Blaster", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee3", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 75; - dudes_dr[j] = 0.85; - men += dudes_num[j]; - } - - if (dudes[j] == "Necron Wraith") { - scr_en_weapon("Wraith Claws", true, dudes_num[j], dudes[j], j); - if ((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (dudes_num[j] > 1)) { - dudes_ac[j] = 10; - dudes_hp[j] = 200; - } - men += dudes_num[j]; - dudes_dr[j] = 0.75; - } - if (dudes[j] == "Necron Destroyer") { - scr_en_weapon("Gauss Cannon", true, dudes_num[j], dudes[j], j); - scr_en_weapon("Melee3", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 25; - dudes_hp[j] = 175; - dudes_dr[j] = 0.5; - men += dudes_num[j]; - } - - if (dudes[j] == "Tomb Stalker") { - scr_en_weapon("Gauss Particle Cannon", false, dudes_num[j] * 1, dudes[j], j); - scr_en_weapon("Overcharged Gauss Cannon", false, dudes_num[j] * 2, dudes[j], j); - scr_en_weapon("Claws", false, dudes_num[j] * 5, dudes[j], j); - if ((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (dudes_num[j] > 1)) { - dudes_ac[j] = 40; - dudes_hp[j] = 600; - } - dudes_dr[j] = 0.5; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] == "Canoptek Spyder") { - scr_en_weapon("Claws", false, dudes_num[j] * 2, dudes[j], j); - if ((obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) || (dudes_num[j] > 1)) { - dudes_ac[j] = 30; - dudes_hp[j] = 300; - } - dudes_dr[j] = 0.75; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] == "Canoptek Scarab") { - scr_en_weapon("Melee3", false, dudes_num[j] * 2, dudes[j], j); - dudes_ac[j] = 8; - dudes_hp[j] = 30; - dudes_dr[j] = 0.75; - men += dudes_num[j]; - dudes_vehicle[j] = 0; - } - if (dudes[j] == "Necron Monolith") { - scr_en_weapon("Gauss Flux Arc", false, dudes_num[j] * 4, dudes[j], j); - scr_en_weapon("Particle Whip", false, dudes_num[j] * 1, dudes[j], j); - dudes_ac[j] = 50; - dudes_hp[j] = 500; - dudes_dr[j] = 0.25; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - if (dudes[j] == "Doomsday Arc") { - scr_en_weapon("Gauss Flayer Array", false, dudes_num[j] * 2, dudes[j], j); - scr_en_weapon("Doomsday Cannon", false, dudes_num[j] * 1, dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 350; - dudes_dr[j] = 0.5; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - } - - // if (dudes_dr[j]>0.8) then dudes_dr[j]=0.8; - } - - /* */ - } - /* - if (obj_ncombat.battle_special = "ruins") or(obj_ncombat.battle_special = "ruins_eldar") { - var i; - i = 0; - repeat(20) { - i += 1; - if (dudes_vehicle[i] > 0) and(dudes_num[i] > 0) { - obj_ncombat.enemy_forces -= dudes_num[i]; - obj_ncombat.enemy_max -= dudes_num[i]; - dudes[i] = ""; - dudes_special[i] = ""; - dudes_num[i] = 0; - dudes_ac[i] = 0; - dudes_hp[i] = 0; - dudes_dr[i] = 1; - dudes_vehicle[i] = 0; - } - } - } - */ - - if (men + veh + medi <= 0) { - instance_destroy(id); - exit; - } - - if (obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) { - obj_ncombat.enemy_forces += self.men + self.veh + self.medi; - } - engaged = collision_point(x + 12, y, obj_pnunit, 0, 1) || collision_point(x - 12, y, obj_pnunit, 0, 1); - - if (neww == 1) { - neww = 0; - } - - /* */ - /* */ } diff --git a/scripts/scr_flavor/scr_flavor.gml b/scripts/scr_flavor/scr_flavor.gml index d4e6803af5..e23425ba06 100644 --- a/scripts/scr_flavor/scr_flavor.gml +++ b/scripts/scr_flavor/scr_flavor.gml @@ -44,7 +44,7 @@ function scr_flavor(_weapon_stack, _target_object, _target_i, casulties) { if (target_name = "Greater Daemon of Tzeentch") then obj_ncombat.chaos_angry += casulties * 5; } - if (target.flank = 1) and (target.flyer = 0) then target_name = "flanking " + target_name; + if (target.flank = 1) then target_name = "flanking " + target_name; var flavoured = false; diff --git a/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml b/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml index 2490beff83..2e78ff27fd 100644 --- a/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml +++ b/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml @@ -82,11 +82,11 @@ function ncombat_enemy_stacks_init() { u.maxhp[1] = u.hp[1]; } - for (var j = 0; j < 10; j++) { - i -= 1; - u = instance_create(i * 10, 240, obj_enunit); - u.column = i - ((xxx / 10) - 10); - } + // for (var j = 0; j < 10; j++) { + // i -= 1; + // u = instance_create(i * 10, 240, obj_enunit); + // u.column = i - ((xxx / 10) - 10); + // } // *** Enemy Forces Special Event *** // * Malcadon Spyrer * if (string_count("spyrer", battle_special) > 0) { @@ -566,7 +566,6 @@ function ncombat_enemy_stacks_init() { u.dudes[1] = "Vendetta"; u.dudes_num[1] = f; u.flank = 1; - u.flyer = 1; } /*u=instance_nearest(xxx,240,obj_enunit);enemy_dudes=threat; @@ -580,38 +579,44 @@ function ncombat_enemy_stacks_init() { if (threat>1){u.dudes[3]="Leman Russ Battle Tank";u.dudes_num[3]=min(1000,floor(guard_effective*0.1));enemies[3]=u.dudes[3];}*/ } - // ** Aeldar Force ** - if (enemy == 6) { - // Ranger Group - if (threat == 1) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "20"; - u.dudes[1] = "Pathfinder"; - u.dudes_num[1] = 1; - enemies[1] = u.dudes[1]; - u.dudes[2] = "Ranger"; - u.dudes_num[2] = 10; - enemies[2] = u.dudes[2]; - u.dudes[3] = "Striking Scorpian"; - u.dudes_num[3] = 10; - enemies[3] = u.dudes[3]; - } - // Harlequin Group - if (threat == 1) { - u = instance_nearest(xxx, 240, obj_enunit); - enemy_dudes = "9"; + // Was overwriting shit with no conditionals + // Harlequin Group + // if (threat == 1) { + // u = instance_nearest(xxx, 240, obj_enunit); + // enemy_dudes = "9"; + + // u.dudes[1] = "Athair"; + // u.dudes_num[1] = 1; + // enemies[1] = u.dudes[1]; + // u.dudes[2] = "Warlock"; + // u.dudes_num[2] = 2; + // enemies[2] = u.dudes[2]; + // u.dudes[3] = "Trouper"; + // u.dudes_num[3] = 6; + // enemies[3] = u.dudes[3]; + // } + + // Was overwriting shit with no conditionals + // Ranger Group + // if (threat == 1) { + // u = instance_nearest(xxx, 240, obj_enunit); + // enemy_dudes = "20"; + + // u.dudes[1] = "Pathfinder"; + // u.dudes_num[1] = 1; + // enemies[1] = u.dudes[1]; + // u.dudes[2] = "Ranger"; + // u.dudes_num[2] = 10; + // enemies[2] = u.dudes[2]; + // u.dudes[3] = "Striking Scorpian"; + // u.dudes_num[3] = 10; + // enemies[3] = u.dudes[3]; + // } - u.dudes[1] = "Athair"; - u.dudes_num[1] = 1; - enemies[1] = u.dudes[1]; - u.dudes[2] = "Warlock"; - u.dudes_num[2] = 2; - enemies[2] = u.dudes[2]; - u.dudes[3] = "Trouper"; - u.dudes_num[3] = 6; - enemies[3] = u.dudes[3]; - } + + // ** Aeldar Force ** + if (enemy == 6) { // Craftworld Small Group if (threat == 1) { u = instance_nearest(xxx, 240, obj_enunit); @@ -647,15 +652,12 @@ function ncombat_enemy_stacks_init() { u.dudes[1] = "Dire Avenger"; u.dudes_num[1] = 56; - u.dudes_special[1] = "shimmershield"; u.dudes[2] = "Dire Avenger Exarch"; u.dudes_num[2] = 4; - u.dudes_special[2] = "shimmershield"; u.dudes[3] = "Autarch"; u.dudes_num[3] = 1; u.dudes[4] = "Farseer"; u.dudes_num[4] = 1; - u.dudes_special[4] = "farseer_powers"; u.dudes[5] = "Night Spinner"; u.dudes_num[5] = 1; // Spawn leader @@ -674,16 +676,12 @@ function ncombat_enemy_stacks_init() { u.dudes_num[2] = 1; u.dudes[3] = "Warp Spider"; u.dudes_num[3] = 7; - u.dudes_special[3] = "warp_jump"; u.dudes[4] = "Warp Spider Exarch"; u.dudes_num[4] = 1; - u.dudes_special[4] = "warp_jump"; u.dudes[5] = "Howling Banshee"; u.dudes_num[5] = 9; - u.dudes_special[5] = "banshee_mask"; u.dudes[6] = "Howling Banshee Exarch"; u.dudes_num[6] = 1; - u.dudes_special[6] = "banshee_mask"; u.dudes[7] = "Striking Scorpian"; u.dudes_num[7] = 9; u.dudes[8] = "Striking Scorpian Exarch"; @@ -701,15 +699,12 @@ function ncombat_enemy_stacks_init() { u.dudes[1] = "Dire Avenger"; u.dudes_num[1] = 140; - u.dudes_special[1] = "shimmershield"; u.dudes[2] = "Dire Avenger Exarch"; u.dudes_num[2] = 10; - u.dudes_special[2] = "shimmershield"; u.dudes[3] = "Autarch"; u.dudes_num[3] = 1; u.dudes[4] = "Farseer"; u.dudes_num[4] = 1; - u.dudes_special[4] = "farseer_powers"; // Spawn Leader if (leader == 1) { u.dudes[4] = "Leader"; @@ -730,16 +725,12 @@ function ncombat_enemy_stacks_init() { u.dudes_num[2] = 2; u.dudes[3] = "Warp Spider"; u.dudes_num[3] = 18; - u.dudes_special[3] = "warp_jump"; u.dudes[4] = "Warp Spider Exarch"; u.dudes_num[4] = 2; - u.dudes_special[4] = "warp_jump"; u.dudes[5] = "Howling Banshee"; u.dudes_num[5] = 28; - u.dudes_special[5] = "banshee_mask"; u.dudes[6] = "Howling Banshee Exarch"; u.dudes_num[6] = 2; - u.dudes_special[6] = "banshee_mask"; u.dudes[7] = "Striking Scorpian"; u.dudes_num[7] = 19; u.dudes[8] = "Striking Scorpian Exarch"; @@ -763,15 +754,12 @@ function ncombat_enemy_stacks_init() { u.dudes[1] = "Dire Avenger"; u.dudes_num[1] = 280; - u.dudes_special[1] = "shimmershield"; u.dudes[2] = "Dire Avenger Exarch"; u.dudes_num[2] = 20; - u.dudes_special[2] = "shimmershield"; u.dudes[3] = "Autarch"; u.dudes_num[3] = 3; u.dudes[4] = "Farseer"; u.dudes_num[4] = 2; - u.dudes_special[4] = "farseer_powers"; // Spawn Leader if (leader == 1) { u.dudes[4] = "Leader"; @@ -805,16 +793,12 @@ function ncombat_enemy_stacks_init() { u.dudes_num[2] = 4; u.dudes[3] = "Warp Spider"; u.dudes_num[3] = 36; - u.dudes_special[3] = "warp_jump"; u.dudes[4] = "Warp Spider Exarch"; u.dudes_num[4] = 4; - u.dudes_special[4] = "warp_jump"; u.dudes[5] = "Howling Banshee"; u.dudes_num[5] = 36; - u.dudes_special[5] = "banshee_mask"; u.dudes[6] = "Howling Banshee Exarch"; u.dudes_num[6] = 4; - u.dudes_special[6] = "banshee_mask"; u.dudes[7] = "Striking Scorpian"; u.dudes_num[7] = 38; u.dudes[8] = "Striking Scorpian Exarch"; @@ -840,15 +824,12 @@ function ncombat_enemy_stacks_init() { u.dudes[1] = "Dire Avenger"; u.dudes_num[1] = 450; - u.dudes_special[1] = "shimmershield"; u.dudes[2] = "Dire Avenger Exarch"; u.dudes_num[2] = 50; - u.dudes_special[2] = "shimmershield"; u.dudes[3] = "Autarch"; u.dudes_num[3] = 5; u.dudes[4] = "Farseer"; u.dudes_num[4] = 3; - u.dudes_special[4] = "farseer_powers"; // Spawn Leader if (leader == 1) { u.dudes[4] = "Leader"; @@ -882,16 +863,12 @@ function ncombat_enemy_stacks_init() { u.dudes_num[2] = 8; u.dudes[3] = "Warp Spider"; u.dudes_num[3] = 72; - u.dudes_special[3] = "warp_jump"; u.dudes[4] = "Warp Spider Exarch"; u.dudes_num[4] = 8; - u.dudes_special[4] = "warp_jump"; u.dudes[5] = "Howling Banshee"; u.dudes_num[5] = 72; - u.dudes_special[5] = "banshee_mask"; u.dudes[6] = "Howling Banshee Exarch"; u.dudes_num[6] = 8; - u.dudes_special[6] = "banshee_mask"; u.dudes[7] = "Striking Scorpian"; u.dudes_num[7] = 72; u.dudes[8] = "Striking Scorpian Exarch"; @@ -917,15 +894,12 @@ function ncombat_enemy_stacks_init() { u.dudes[1] = "Dire Avenger"; u.dudes_num[1] = 540; - u.dudes_special[1] = "shimmershield"; u.dudes[2] = "Dire Avenger Exarch"; u.dudes_num[2] = 60; - u.dudes_special[2] = "shimmershield"; u.dudes[3] = "Autarch"; u.dudes_num[3] = 8; u.dudes[4] = "Farseer"; u.dudes_num[4] = 4; - u.dudes_special[4] = "farseer_powers"; // Spawn Leader if (leader == 1) { u.dudes[4] = "Leader"; @@ -961,16 +935,12 @@ function ncombat_enemy_stacks_init() { u.dudes_num[2] = 16; u.dudes[3] = "Warp Spider"; u.dudes_num[3] = 144; - u.dudes_special[3] = "warp_jump"; u.dudes[4] = "Warp Spider Exarch"; u.dudes_num[4] = 16; - u.dudes_special[4] = "warp_jump"; u.dudes[5] = "Howling Banshee"; u.dudes_num[5] = 144; - u.dudes_special[5] = "banshee_mask"; u.dudes[6] = "Howling Banshee Exarch"; u.dudes_num[6] = 16; - u.dudes_special[6] = "banshee_mask"; u.dudes[7] = "Striking Scorpian"; u.dudes_num[7] = 144; u.dudes[8] = "Striking Scorpian Exarch"; @@ -1455,63 +1425,16 @@ function ncombat_enemy_stacks_init() { } // Large Ork Army if (threat == 6) { - enemy_dudes = "a WAAAAGH!! of 11000"; - - u = instance_nearest(xxx, 240, obj_enunit); - u.dudes[1] = "Mekboy"; - u.dudes_num[1] = 6; - u.dudes[2] = "Flash Git"; - u.dudes_num[2] = 50; - u.dudes[3] = "Kommando"; - u.dudes_num[3] = 20; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 10, 240, obj_enunit); - u.dudes[1] = "Slugga Boy"; - u.dudes_num[1] = 1200; - u.dudes[2] = "Ard Boy"; - u.dudes_num[2] = 600; - u.dudes[3] = "Gretchin"; - u.dudes_num[3] = 2000; - u.dudes[4] = "Tank Busta"; - u.dudes_num[4] = 100; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 20, 240, obj_enunit); - u.dudes[1] = "Mekboy"; - u.dudes_num[1] = 6; - u.dudes[2] = "Flash Git"; - u.dudes_num[2] = 50; - u.dudes[3] = "Kommando"; - u.dudes_num[3] = 20; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 30, 240, obj_enunit); - u.dudes[1] = "Big Warboss"; - u.dudes_num[1] = 1; - // Spawn Leader - if (leader == 1) { - u.dudes[1] = "Leader"; - u.dudes_num[1] = 1; - enemies[1] = 1; - enemies_num[1] = 1; + enemy_force_composition = global.army_profiles[$ "orks_6"]; + enemy_dudes = enemy_force_composition.description; + var _block_count = array_length(enemy_force_composition.columns); + for (var b = 0; b < _block_count; b++) { + var _pos = 160 + (b * 10); + var _block = instance_create(_pos, 240, obj_enunit); + _block.copy_block_composition(enemy_force_composition.columns[b]); + enemy_forces += _block.unit_count(); } - u.dudes[2] = "Meganob"; - u.dudes_num[2] = 80; - u.dudes[3] = "Slugga Boy"; - u.dudes_num[3] = 600; - u.dudes[4] = "Ard Boy"; - u.dudes_num[4] = 900; - u.dudes[5] = "Shoota Boy"; - u.dudes_num[5] = 2000; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 40, 240, obj_enunit); - u.dudes[1] = "Deff Dread"; - u.dudes_num[1] = 36; - u.dudes[2] = "Battlewagon"; - u.dudes_num[2] = 220; - instance_deactivate_object(u); + show_debug_message($"enemy_forces: {enemy_forces}"); } } @@ -2183,7 +2106,6 @@ function ncombat_enemy_stacks_init() { // Chaos Daemons Army if (threat == 7) { u = instance_nearest(xxx + 40, 240, obj_enunit); - u.neww = 1; enemy_dudes = ""; u.dudes[1] = "Greater Daemon of Slaanesh"; @@ -2201,7 +2123,6 @@ function ncombat_enemy_stacks_init() { instance_deactivate_object(u); u = instance_nearest(xxx + 30, 240, obj_enunit); - u.neww = 1; u.dudes[1] = "Greater Daemon of Khorne"; u.dudes_num[1] = 1; u.dudes[2] = "Greater Daemon of Khorne"; @@ -2446,7 +2367,6 @@ function ncombat_enemy_stacks_init() { u.dudes[1] = "Heldrake"; u.dudes_num[1] = 6; u.flank = 1; - u.flyer = 1; u = instance_create(0, 240, obj_enunit); u.dudes[1] = "Chaos Terminator"; @@ -2693,7 +2613,6 @@ function ncombat_enemy_stacks_init() { u.dudes[1] = "Heldrake"; u.dudes_num[1] = 6; u.flank = 1; - u.flyer = 1; u = instance_create(0, 240, obj_enunit); u.dudes[1] = "World Eaters Terminator"; @@ -2788,7 +2707,6 @@ function ncombat_enemy_stacks_init() { if (threat == 4) { u = instance_nearest(xxx + 40, 240, obj_enunit); enemy_dudes = "400"; - u.neww = 1; u.dudes[1] = "Greater Daemon of " + string(choose("Slaanesh", "Tzeentch")); if (slaa) { @@ -2829,7 +2747,6 @@ function ncombat_enemy_stacks_init() { if (threat == 5) { u = instance_nearest(xxx + 40, 240, obj_enunit); enemy_dudes = "1000"; - u.neww = 1; u.dudes[1] = "Greater Daemon of " + string(choose("Slaanesh", "Tzeentch", "Khorne", "Nurgle")); if (slaa) { @@ -2874,7 +2791,6 @@ function ncombat_enemy_stacks_init() { if (threat == 6) { u = instance_nearest(xxx + 40, 240, obj_enunit); enemy_dudes = "2000"; - u.neww = 1; u.dudes[1] = "Greater Daemon of " + string(choose("Slaanesh", "Tzeentch", "Khorne", "Nurgle")); if (slaa) { @@ -2896,7 +2812,6 @@ function ncombat_enemy_stacks_init() { instance_deactivate_object(u); u = instance_nearest(xxx + 30, 240, obj_enunit); - u.neww = 1; u.dudes[1] = "Greater Daemon of " + string(choose("Slaanesh", "Tzeentch", "Khorne", "Nurgle")); if (slaa) { u.dudes[1] = "Greater Daemon of Slaanesh"; diff --git a/scripts/scr_perils_table/scr_perils_table.gml b/scripts/scr_perils_table/scr_perils_table.gml index 5089235b6b..3882ecfbe1 100644 --- a/scripts/scr_perils_table/scr_perils_table.gml +++ b/scripts/scr_perils_table/scr_perils_table.gml @@ -217,7 +217,6 @@ function scr_perils_table(perils_strength, unit, psy_discipline, power_name, uni d1.medi += 1; obj_ncombat.enemy_forces += 1; obj_ncombat.enemy_max += 1; - d1.neww = 1; d1.alarm[1] = 1; flavour_text2 += string(dem) + " has taken form."; diff --git a/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml b/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml index 6ad03de5c5..fe96123975 100644 --- a/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml +++ b/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml @@ -17,10 +17,6 @@ function pnunit_target_and_shoot() { target_block = instance_nearest(0, y, obj_enunit); - if (obj_ncombat.dropping || (!obj_ncombat.defending && obj_ncombat.formation_set != 2)) { - move_unit_block("east"); - } - engaged = collision_point(x - 10, y, obj_enunit, 0, 1) || collision_point(x + 10, y, obj_enunit, 0, 1); if (DEBUG_COLUMN_PRIORITY_PLAYER) { @@ -38,9 +34,9 @@ function pnunit_target_and_shoot() { // Shooting var _ranged_weapons = get_valid_weapon_stacks(weapon_stacks_normal, 2, 999); for (var i = 0, _ranged_len = array_length(_ranged_weapons); i < _ranged_len; i++) { - if (!target_block_is_valid(target_block, obj_enunit)) { + if (!enunit_is_valid(target_block)) { target_block = instance_nearest(0, y, obj_enunit); - if (!target_block_is_valid(target_block, obj_enunit)) { + if (!enunit_is_valid(target_block,)) { exit; } } @@ -58,7 +54,7 @@ function pnunit_target_and_shoot() { // Scan potential targets var _check_targets = []; with (obj_enunit) { - if (!target_block_is_valid(self, obj_enunit)) { + if (!enunit_is_valid(self)) { continue; } array_push(_check_targets, self.id); @@ -114,7 +110,7 @@ function pnunit_target_and_shoot() { // Melee var _melee_weapons = get_valid_weapon_stacks(weapon_stacks_normal, 1, 2); for (var i = 0, _wep_len = array_length(_melee_weapons); i < _wep_len; i++) { - if (!target_block_is_valid(target_block, obj_enunit)) { + if (!enunit_is_valid(target_block)) { exit; } diff --git a/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml b/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml index e9ccce5995..1b917fcae2 100644 --- a/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml +++ b/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml @@ -49,14 +49,11 @@ function squeeze_map_forces() { } } -function target_block_is_valid(target, desired_type) { +function pnunit_is_valid(target) { try { var _is_valid = false; - if (target == "none") { - return false; - } if (instance_exists(target)) { - if (target.x > 0 && target.object_index == desired_type) { + if (target.x > 0 && target.object_index == obj_pnunit) { if (target.men + target.veh + target.dreads > 0) { _is_valid = true; } else { @@ -71,6 +68,25 @@ function target_block_is_valid(target, desired_type) { } } +function enunit_is_valid(target) { + try { + var _is_valid = false; + if (instance_exists(target)) { + if (target.x > 0 && target.object_index == obj_enunit) { + if (target.unit_count() > 0) { + _is_valid = true; + } else { + x = -5000; + instance_deactivate_object(id); + } + } + } + return _is_valid; + } catch (_exception) { + handle_exception(_exception); + } +} + function get_rightmost(block_type = obj_pnunit, include_flanking = true, include_main_force = true) { try { var rightmost = "none"; @@ -230,6 +246,21 @@ function move_unit_block(direction, blocks = 1, allow_collision = false) { } } +/// @description Creates a priority queue of enemy units based on their x-position and then moves each with `move_enemy_block()`. +function move_enemy_blocks() { + var _enemy_movement_queue = ds_priority_create(); + with (obj_enunit) { + ds_priority_add(_enemy_movement_queue, id, x); + } + while (!ds_priority_empty(_enemy_movement_queue)) { + var _enemy_block = ds_priority_delete_min(_enemy_movement_queue); + with (_enemy_block) { + move_enemy_block(); + } + } + ds_priority_destroy(_enemy_movement_queue); +} + /// @description Attempts to move an enemy unit block, choosing direction based on whenever they are flanking or not, only if `obj_nfort` doesn't exists. /// @mixin function move_enemy_block() { @@ -241,19 +272,26 @@ function move_enemy_block() { move_unit_block(_direction); } -/// @description Creates a priority queue of enemy units based on their x-position and then moves each with `move_enemy_block()`. -function move_enemy_blocks() { - var _enemy_movement_queue = ds_priority_create(); - with (obj_enunit) { - ds_priority_add(_enemy_movement_queue, id, x); +function player_blocks_movement() { + if (instance_exists(obj_nfort)) { + exit; } - while (!ds_priority_empty(_enemy_movement_queue)) { - var _enemy_block = ds_priority_delete_min(_enemy_movement_queue); - with (_enemy_block) { - move_enemy_block(); + + if ((obj_ncombat.defending || obj_ncombat.formation_set == 2)) { + exit; + } + + var _player_movement_queue = ds_priority_create(); + with (obj_pnunit) { + ds_priority_add(_player_movement_queue, id, x); + } + while (!ds_priority_empty(_player_movement_queue)) { + var _player_block = ds_priority_delete_max(_player_movement_queue); + with (_player_block) { + move_unit_block("east"); } } - ds_priority_destroy(_enemy_movement_queue); + ds_priority_destroy(_player_movement_queue); } /// @mixin @@ -417,23 +455,23 @@ function get_target_priority(_weapon_stack, _block) { var _size_bonus = _size / 10; // Target type match bonus - var _type_bonus = 0; - if (_weapon_stack.target_type == eTARGET_TYPE.ARMOUR) { - _type_bonus = 20 * (block_type_size(_block, "armour") / _size); - } else { - _type_bonus = 20 * (block_type_size(_block, "men") / _size); - } + // var _type_bonus = 0; + // if (_weapon_stack.target_type == eTARGET_TYPE.Armour) { + // _type_bonus = 20 * (block_type_size(_block, "armour") / _size); + // } else { + // _type_bonus = 20 * (block_type_size(_block, "men") / _size); + // } var _priority = 0; - _priority += _type_bonus; + // _priority += _type_bonus; _priority += _size_bonus; _priority -= _doomstack_malus; _priority += _distance_bonus; _priority *= random_range(0.5, 1.5); - if (DEBUG_COLUMN_PRIORITY_ENEMY) { - show_debug_message($"Priority: {_priority}\n Type: +{_type_bonus}\n Size: +{_size_bonus}\n Doomstack: -{_doomstack_malus}\n Distance: +{_distance_bonus}\n"); - } + // if (DEBUG_COLUMN_PRIORITY_ENEMY) { + // show_debug_message($"Priority: {_priority}\n Type: +{_type_bonus}\n Size: +{_size_bonus}\n Doomstack: -{_doomstack_malus}\n Distance: +{_distance_bonus}\n"); + // } return _priority; } diff --git a/scripts/scr_shoot/scr_shoot.gml b/scripts/scr_shoot/scr_shoot.gml index e84856d0b1..0f7769b887 100644 --- a/scripts/scr_shoot/scr_shoot.gml +++ b/scripts/scr_shoot/scr_shoot.gml @@ -71,7 +71,7 @@ function scr_shoot(_weapon_stack, _target_object, _target_index) { //* Enemy shooting if (owner == 2) { - if (_target_type == eTARGET_TYPE.FORTIFICATION) { + if (_target_type == eTARGET_TYPE.Fortification) { var _wall_weapon_damage = max(1, round(_weapon_attack - _target_object.ac[1])) * _shooter_count * max(1, _weapon_shot_count / 4); _target_object.hp[1] -= _wall_weapon_damage; @@ -89,10 +89,10 @@ function scr_shoot(_weapon_stack, _target_object, _target_index) { //* Player shooting if (owner == eFACTION.Player) { - _target_index = scr_target(_target_object, _target_type); - if (_target_index == -1) { - _target_index = scr_target(_target_object); - if (_target_index == -1) { + var _target_stack = scr_target(_target_object, _target_type); + if (_target_stack == noone) { + _target_stack = scr_target(_target_object); + if (_target_stack == noone) { // if (DEBUG_PLAYER_TARGET_SELECTION) { // show_debug_message($"{_weapon_name} found no valid targets in the enemy column to attack!"); // } @@ -102,7 +102,7 @@ function scr_shoot(_weapon_stack, _target_object, _target_index) { } // if (DEBUG_PLAYER_TARGET_SELECTION) { - // show_debug_message($"{_weapon_name} is attacking {_target_object.dudes[_target_index]}"); + // show_debug_message($"{_weapon_name} is attacking {_target_object.dudes[_target_stack]}"); // } if (_weapon_name == "Missile Silo") { @@ -113,30 +113,36 @@ function scr_shoot(_weapon_stack, _target_object, _target_index) { var _min_damage = 0.25; var _dice_sides = 50; var _random_damage_mod = roll_dice(4, _dice_sides, "low") / 100; - var _armour_points = max(0, _target_object.dudes_ac[_target_index] - _weapon_piercing); - _weapon_attack = (_weapon_attack * _random_damage_mod) - _armour_points; - _weapon_attack = max(_min_damage, _weapon_attack * _target_object.dudes_dr[_target_index]); - var _total_attack = _weapon_attack * _shot_count; - - var _dudes_num = _target_object.dudes_num[_target_index]; - var _unit_hp = _target_object.dudes_hp[_target_index]; - var _casualties = min(_shot_count, _dudes_num, floor(_total_attack / _unit_hp)); - - // if (_casualties > 0) { - // if (DEBUG_PLAYER_TARGET_SELECTION) { - // show_debug_message($"{_weapon_name} attacked {_target_object.dudes[_target_index]} and destroyed {_casualties}!"); - // } - // } else { - // if (DEBUG_PLAYER_TARGET_SELECTION) { - // show_debug_message($"{_weapon_name} attacked {_target_object.dudes[_target_index]} but dealt no damage!"); - // } - // } + var _armour_points = max(0, _target_stack.armour - _weapon_piercing); + var _modified_weapon_attack = (_weapon_attack * _random_damage_mod) - _armour_points; + _modified_weapon_attack = max(_min_damage, _modified_weapon_attack * _target_stack.resistance); + var _total_attack = _modified_weapon_attack * _shot_count; + + var _unit_hp = _target_stack.unit_health; + var _remaining_count = _target_stack.unit_count; + + // Estimate casualties + var _casualties = min(floor(_total_attack / _unit_hp), _remaining_count); + _target_stack.unit_count -= _casualties; + obj_ncombat.enemy_forces -= _casualties; + var _leftover_damage = _total_attack - (_casualties * _unit_hp); + + // Apply leftover damage to current unit + _target_stack.health_current -= _leftover_damage; + if (_target_stack.health_current <= 0) { + if (_target_stack.unit_count > 1) { + _target_stack.health_current = _target_stack.unit_health; + } else { + _target_stack.health_current = 0; + } + _target_stack.unit_count--; + obj_ncombat.enemy_forces--; + _casualties++; + } - scr_flavor(_weapon_stack, _target_object, _target_index, _casualties); + scr_flavor(_weapon_stack, _target_object, _target_stack, _casualties); if (_casualties > 0) { - _target_object.dudes_num[_target_index] -= _casualties; - obj_ncombat.enemy_forces -= _casualties; compress_enemy_array(_target_object); destroy_empty_column(_target_object); } diff --git a/scripts/scr_string_functions/scr_string_functions.gml b/scripts/scr_string_functions/scr_string_functions.gml index a38e10fca8..cbf6e9fc8e 100644 --- a/scripts/scr_string_functions/scr_string_functions.gml +++ b/scripts/scr_string_functions/scr_string_functions.gml @@ -29,16 +29,22 @@ function string_plural(_string, _variable = 2) { return _string; } - var _last_char = string_char_at(_string, string_length(_string)); - var _last_two_chars = string_copy(_string, string_length(_string) - 1, 2); - if (_last_char == "y") { - return string_copy(_string, 1, string_length(_string) - 1) + "ies"; + var _len = string_length(_string); + var _last_char = string_char_at(_string, _len); + var _second_last_char = string_char_at(_string, _len - 1); + var _last_two_chars = string_copy(_string, _len - 1, 2); + + if (_last_char == "y" && !string_pos(_second_last_char, "aeiou")) { + return string_copy(_string, 1, _len - 1) + "ies"; } - else if (array_contains(["s", "x", "z", "ch", "sh"], _last_char)) { + else if (array_contains(["s", "x", "z"], _last_char) || array_contains(["ch", "sh"], _last_two_chars)) { return _string + "es"; } - else if (_last_char == "f" || _last_two_chars == "fe") { - return string_copy(_string, 1, string_length(_string) - string_length(_last_two_chars)) + "ves"; + else if (_last_char == "f") { + return string_copy(_string, 1, _len - 1) + "ves"; + } + else if (_last_two_chars == "fe") { + return string_copy(_string, 1, _len - 2) + "ves"; } else { return _string + "s"; diff --git a/scripts/scr_target/scr_target.gml b/scripts/scr_target/scr_target.gml index ee9c40db29..69b17fcfd0 100644 --- a/scripts/scr_target/scr_target.gml +++ b/scripts/scr_target/scr_target.gml @@ -1,18 +1,15 @@ function scr_target(_battle_block, _target_type = -1) { - var _biggest_target = -1; + var _biggest_target = noone; var _priority_queue = ds_priority_create(); - var _dudes_names = _battle_block.dudes; - var _dudes_hps = _battle_block.dudes_hp; - var _dudes_nums = _battle_block.dudes_num; - var _dudes_vehicles = _battle_block.dudes_vehicle; + var _unit_stacks = _battle_block.unit_stacks; - for (var i = 0, dudes_len = array_length(_dudes_names); i < dudes_len; i++) { - if (_dudes_hps[i] <= 0 || _dudes_names[i] == "") { - continue; - } + for (var i = 0, dudes_len = array_length(_unit_stacks); i < dudes_len; i++) { + var _unit_stack = _unit_stacks[i]; + var _unit_stack_count = _unit_stack.count; + var _unit_stack_type = _unit_stack.unit_type; - if (_target_type == -1 || _dudes_vehicles[i] == _target_type) { - ds_priority_add(_priority_queue, i, _dudes_nums[i]); + if (_target_type == -1 || _unit_stack_type == _target_type) { + ds_priority_add(_priority_queue, _unit_stack, _unit_stack_count); } } diff --git a/scripts/scr_weapon_stacks/scr_weapon_stacks.gml b/scripts/scr_weapon_stacks/scr_weapon_stacks.gml index 77875a21b3..87da26f8f5 100644 --- a/scripts/scr_weapon_stacks/scr_weapon_stacks.gml +++ b/scripts/scr_weapon_stacks/scr_weapon_stacks.gml @@ -1,8 +1,9 @@ enum eTARGET_TYPE { - NORMAL, - ARMOUR, - LEADER, - FORTIFICATION, + Normal, + Armour, + Heavy, + Leader, + Fortification, } function WeaponStack(_name) constructor { @@ -17,22 +18,48 @@ function WeaponStack(_name) constructor { ammo_reload = 0; shot_count = 0; owners = []; - target_type = eTARGET_TYPE.NORMAL; + target_type = eTARGET_TYPE.Normal; static total_attack = function() { return attack * weapon_count; }; } -function UnitStack(_name) constructor { +global.unit_profiles = json_to_gamemaker(working_directory + "\\data\\unit_profiles.jsonc", json_parse); +global.squad_profiles = json_to_gamemaker(working_directory + "\\data\\squad_profiles.jsonc", json_parse); +global.army_profiles = json_to_gamemaker(working_directory + "\\data\\army_profiles.jsonc", json_parse); +function EnemyUnitStack(_name, _unit_count, _copy_profile = true) constructor { unit_name = _name; - abilities = 0; - count = 0; - armour_points = 0; + display_name = _name; + unit_count = _unit_count; + abilities = []; + armour = 0; health = 0; + health_current = 0; resistance = 0; - is_vehicle = false; - attack = 0; - experience = 0; - faith = 0; + unit_type = eTARGET_TYPE.Normal; + unit_size = 0; + weapons = []; + ranged_mod = 1; + melee_mod = 1; + unit_profile = {}; + + static copy_unit_profile = function(_name) { + var _unit_profiles = global.unit_profiles; + if (struct_exists(_unit_profiles, _name)) { + var _profile_struct = _unit_profiles[$ _name]; + unit_profile = _profile_struct; + var _stat_names = struct_get_names(_profile_struct); + var _stat_len = array_length(_stat_names); + for (var k = 0; k < _stat_len; k++){ + var _stat_name = _stat_names[k]; + struct_set(self, _stat_name, _profile_struct[$ _stat_name]); + } + health_current = health; + } + }; + + if (_copy_profile) { + copy_unit_profile(_name); + } } From c112c1c1d7b9fd0696ce00c30eeb22a42eb6b8a0 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Mon, 21 Apr 2025 21:10:09 +0300 Subject: [PATCH 67/80] Another big chunk of stuff --- ChapterMaster.yyp | 1 - datafiles/data/squad_profiles.jsonc | 119 +---- datafiles/data/unit_profiles.jsonc | 412 ++++++++++-------- objects/obj_enunit/Create_0.gml | 22 +- objects/obj_ncombat/Step_0.gml | 19 + scripts/scr_en_weapon/scr_en_weapon.gml | 28 +- scripts/scr_flavor/scr_flavor.gml | 62 ++- .../scr_player_combat_weapon_stacks.gml | 6 + .../scr_pnunit_scripts/scr_pnunit_scripts.gml | 63 ++- scripts/scr_shoot/scr_shoot.gml | 22 +- scripts/scr_target/scr_target.gml | 23 - scripts/scr_target/scr_target.yy | 13 - 12 files changed, 388 insertions(+), 402 deletions(-) delete mode 100644 scripts/scr_target/scr_target.gml delete mode 100644 scripts/scr_target/scr_target.yy diff --git a/ChapterMaster.yyp b/ChapterMaster.yyp index 138061aa63..d990b47407 100644 --- a/ChapterMaster.yyp +++ b/ChapterMaster.yyp @@ -845,7 +845,6 @@ {"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_target","path":"scripts/scr_target/scr_target.yy",},}, {"id":{"name":"scr_text_hit","path":"scripts/scr_text_hit/scr_text_hit.yy",},}, {"id":{"name":"scr_thought","path":"scripts/scr_thought/scr_thought.yy",},}, {"id":{"name":"scr_tooltip_draw","path":"scripts/scr_tooltip_draw/scr_tooltip_draw.yy",},}, diff --git a/datafiles/data/squad_profiles.jsonc b/datafiles/data/squad_profiles.jsonc index e9c8d344c8..fe6668266d 100644 --- a/datafiles/data/squad_profiles.jsonc +++ b/datafiles/data/squad_profiles.jsonc @@ -3,18 +3,10 @@ "display_name": "Flash Gitz", "members": { "flash_git": { - "count": 9, - "weapons": [ - "Snazzgun", - "Stickkbombs" - ] + "count": 9 }, "kaptin": { - "count": 1, - "weapons": [ - "Snazzgun", - "Stickkbombs" - ] + "count": 1 } } }, @@ -22,64 +14,32 @@ "display_name": "Kommandos", "members": { "kommando": { - "count": 14, - "weapons": [ - "Choppa", - "Slugga", - "Stickkbombs" - ] + "count": 14 }, "boss_nob": { - "count": 1, - "weapons": [ - "Choppa", - "Slugga", - "Stickkbombs" - ] + "count": 1 } } }, "slugga_boyz": { "display_name": "Slugga Boyz", "members": { - "ork_boy": { - "display_name": "Slugga Boy", + "slugga_boy": { "count": 29, - "weapons": [ - "Choppa", - "Slugga", - "Stickkbombs" - ] }, "boss_nob": { - "count": 1, - "weapons": [ - "Choppa", - "Slugga", - "Stickkbombs" - ] + "count": 1 } } }, "shoota_boyz": { "display_name": "Shoota Boyz", "members": { - "ork_boy": { - "display_name": "Shoota Boy", - "count": 29, - "weapons": [ - "Choppa", - "Shoota", - "Stickkbombs" - ] + "shoota_boy": { + "count": 29 }, "boss_nob": { - "count": 1, - "weapons": [ - "Choppa", - "Shoota", - "Stickkbombs" - ] + "count": 1 } } }, @@ -87,20 +47,10 @@ "display_name": "Ard Boyz", "members": { "ard_boy": { - "count": 29, - "weapons": [ - "Choppa", - "Slugga", - "Stickkbombs" - ] + "count": 29 }, "boss_nob": { - "count": 1, - "weapons": [ - "Choppa", - "Slugga", - "Stickkbombs" - ] + "count": 1 } } }, @@ -108,19 +58,10 @@ "display_name": "Gretchins", "members": { "gretchin": { - "count": 30, - "weapons": [ - "Grot Blasta" - ] + "count": 30 }, - "ork_boy": { - "display_name": "Runtherds", + "runtherd": { "count": 3, - "weapons": [ - "Grabba Stikk", - "Slugga", - "Stickkbombs" - ] } } }, @@ -128,19 +69,10 @@ "display_name": "Tankbustas", "members": { "tankbusta": { - "count": 14, - "weapons": [ - "Rokkit Launcha", - "Tankbusta Bomb" - ] + "count": 14 }, "boss_nob": { - "count": 1, - "weapons": [ - "Choppa", - "Rokkit Launcha", - "Stikkbombs" - ] + "count": 1 } } }, @@ -148,20 +80,10 @@ "display_name": "Meganobz", "members": { "meganob": { - "count": 9, - "weapons": [ - "Twin-Linked Shoota", - "Power Klaw", - "Stikkbombs" - ] + "count": 9 }, "boss_meganob": { - "count": 1, - "weapons": [ - "Twin-Linked Shoota", - "Power Klaw", - "Stikkbombs" - ] + "count": 1 } } }, @@ -169,12 +91,7 @@ "display_name": "Warboss", "members": { "warboss": { - "count": 1, - "weapons": [ - "Twin-Linked Shoota", - "Power Klaw", - "Stikkbombs" - ] + "count": 1 } } } diff --git a/datafiles/data/unit_profiles.jsonc b/datafiles/data/unit_profiles.jsonc index 2c706cdea0..60e44aeef5 100644 --- a/datafiles/data/unit_profiles.jsonc +++ b/datafiles/data/unit_profiles.jsonc @@ -8,7 +8,7 @@ "Web Spinner", "Venom Claws" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "greater_daemon_of_khorne": { @@ -66,7 +66,7 @@ "weapons": [ "Bloodletter Melee" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "daemonette": { @@ -77,7 +77,7 @@ "weapons": [ "Daemonette Melee" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "pink_horror": { @@ -88,7 +88,7 @@ "weapons": [ "Eldritch Fire" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "plaguebearer": { @@ -99,7 +99,7 @@ "weapons": [ "Plaguebearer Melee" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "helbrute": { @@ -111,8 +111,8 @@ "Power Fist", "Multi-Melta" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "soul_grinder": { "display_name": "Soul Grinder", @@ -124,8 +124,8 @@ "Iron Claw", "Battle Cannon" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "maulerfiend": { "display_name": "Maulerfiend", @@ -135,8 +135,8 @@ "weapons": [ "Maulerfiend Claws" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "imperial_guardsman": { "display_name": "Imperial Guardsman", @@ -144,7 +144,7 @@ "health": 5, "resistance": 1, "weapons": [], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "heavy_weapons_team": { @@ -155,7 +155,7 @@ "weapons": [ "Heavy Bolter" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "ogryn": { @@ -167,7 +167,7 @@ "Ripper Gun", "Ogryn Melee" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "chimera": { @@ -179,8 +179,8 @@ "Multi-Laster", "Heavy Bolter" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "basilisk": { "display_name": "Basilisk", @@ -191,8 +191,8 @@ "Earthshaker Cannon", "Storm Bolter" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "leman_russ_battle_tank": { "display_name": "Leman Russ Battle Tank", @@ -203,8 +203,8 @@ "Battle Cannon", "Lascannon" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "leman_russ_demolisher": { "display_name": "Leman Russ Demolisher", @@ -215,8 +215,8 @@ "Demolisher Cannon", "Lascannon" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "vendetta": { "display_name": "Vendetta", @@ -228,8 +228,8 @@ "Twin-Linked Lascannon", "Twin-Linked Lascannon" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "thallax": { "display_name": "Thallax", @@ -240,7 +240,7 @@ "Lightning Gun", "Thallax Melee" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "praetorian_servitor": { @@ -251,7 +251,7 @@ "weapons": [ "Phased Plasma-fusil" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "adeptas_leader": { @@ -264,7 +264,7 @@ "Laser Mace", "Infernus Pistol" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "palatine": { @@ -276,7 +276,7 @@ "Plasma Pistol", "Power Weapon" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "priest": { @@ -287,7 +287,7 @@ "weapons": [ "Laspistol" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "arco_flagellent": { @@ -298,7 +298,7 @@ "weapons": [ "Electro-Flail" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "celestian": { @@ -310,7 +310,7 @@ "Bolter", "Chainsword" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "mistress": { @@ -321,7 +321,7 @@ "weapons": [ "Neural Whip" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "sister_repentia": { @@ -332,7 +332,7 @@ "weapons": [ "Eviscerator" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "battle_sister": { @@ -345,7 +345,7 @@ "Flamer", "Sarissa" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "seraphim": { @@ -357,7 +357,7 @@ "Seraphim Pistols", "Chainsword" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "dominion": { @@ -369,7 +369,7 @@ "Meltagun", "Meltabomb" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "retributor": { @@ -382,7 +382,7 @@ "Missile Launcher", "Bolt Pistol" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "follower": { @@ -394,7 +394,7 @@ "Laspistol", "melee0.5" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "adeptas_rhino": { @@ -406,8 +406,8 @@ "Storm Bolter", "Storm Bolter" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "adeptas_chimera": { "display_name": "Adeptas Chimera", @@ -418,8 +418,8 @@ "Heavy Flamer", "Heavy Flamer" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "immolator": { "display_name": "Immolator", @@ -429,8 +429,8 @@ "weapons": [ "Twin Linked Heavy Flamers" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "exorcist": { "display_name": "Exorcist", @@ -441,8 +441,8 @@ "Exorcist Missile Launcher", "Storm Bolter" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "penitent_engine": { "display_name": "Penitent Engine", @@ -454,8 +454,8 @@ "Close Combat Weapon", "Heavy Flamer" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "eldar_leader": { "display_name": "Eldar Leader", @@ -466,7 +466,7 @@ "Singing Spear", "Singing Spear Throw" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "autarch": { @@ -478,7 +478,7 @@ "Power Weapon", "Fusion Gun" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "farseer": { @@ -490,7 +490,7 @@ "Singing Spear", "Singing Spear Throw" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1, "abilities": [ "farseer_powers" @@ -505,7 +505,7 @@ "Witchblade", "Psyshock" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "avatar": { @@ -517,8 +517,8 @@ "Wailing Doom", "Avatar Smite" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "mighty_avatar": { "display_name": "Mighty Avatar", @@ -529,8 +529,8 @@ "Wailing Doom", "Avatar Smite" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "godly_avatar": { "display_name": "Godly Avatar", @@ -541,8 +541,8 @@ "Wailing Doom", "Avatar Smite" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "ranger": { "display_name": "Ranger", @@ -553,7 +553,7 @@ "Ranger Long Rifle", "Shuriken Pistol" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "eldar_pathfinder": { @@ -565,7 +565,7 @@ "Pathfinder Long Rifle", "Melee1" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "dire_avenger": { @@ -577,7 +577,7 @@ "Avenger Shuriken Catapult", "Melee1" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1, "abilities": [ "shimmershield" @@ -591,7 +591,7 @@ "weapons": [ "Power Weapon" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1, "abilities": [ "shimmershield" @@ -606,7 +606,7 @@ "Power Weapon", "Shuriken Pistol" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1, "abilities": [ "banshee_mask" @@ -620,7 +620,7 @@ "weapons": [ "Executioner" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1, "abilities": [ "banshee_mask" @@ -636,7 +636,7 @@ "Shuriken Pistol", "Mandiblaster" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "striking_scorpion_exarch": { @@ -649,7 +649,7 @@ "Scorpion's Claw", "Mandiblaster" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "fire_dragon": { @@ -662,7 +662,7 @@ "Meltabomb", "Melee1" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "fire_dragon_exarch": { @@ -674,7 +674,7 @@ "Firepike", "Power Weapon" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "warp_spider": { @@ -685,7 +685,7 @@ "weapons": [ "Deathspinner" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1, "abilities": [ "warp_jump" @@ -700,7 +700,7 @@ "Dual Deathspinners", "Powerblades" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1, "abilities": [ "warp_jump" @@ -715,7 +715,7 @@ "Reaper Launcher", "Melee1" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "dark_reaper_exarch": { @@ -727,7 +727,7 @@ "Tempest Launcher", "Melee1" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "shining_spear": { @@ -739,8 +739,8 @@ "Laser Lance", "Twin Linked Shuriken Catapult" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "guardian": { "display_name": "Guardian", @@ -751,7 +751,7 @@ "Shuriken Catapult", "Melee1" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "grav_platform": { @@ -762,8 +762,8 @@ "weapons": [ "Pulse Laser" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "trouper": { "display_name": "Trouper", @@ -774,7 +774,7 @@ "Power Weapon", "Fusion Pistol" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "athair": { @@ -786,7 +786,7 @@ "Plasma Pistol", "Harlequin's Kiss" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "wraithguard": { @@ -797,7 +797,7 @@ "weapons": [ "Wraithcannon" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "vyper": { @@ -809,8 +809,8 @@ "Twin Linked Shuriken Catapult", "Pulse Laser" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "falcon": { "display_name": "Falcon", @@ -822,8 +822,8 @@ "Shuriken Cannon", "Bright Lance" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "fire_prism": { "display_name": "Fire Prism", @@ -834,8 +834,8 @@ "Twin Linked Shuriken Catapult", "Prism Cannon" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "nightspinner": { "display_name": "Nightspinner", @@ -845,8 +845,8 @@ "weapons": [ "Twin Linked Doomweaver" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "wraithlord": { "display_name": "Wraithlord", @@ -858,8 +858,8 @@ "Flamer", "Starcannon" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "phantom_titan": { "display_name": "Phantom Titan", @@ -871,8 +871,8 @@ "Phantom Pulsar", "Titan Starcannon" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "ork_leader": { "display_name": "Ork Leader", @@ -884,7 +884,7 @@ "Rokkit Launcha", "Big Shoota" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "warboss": { @@ -893,8 +893,9 @@ "health": 200, "resistance": 0.75, "weapons": [ + "Twin-Linked Shoota", "Power Klaw", - "Rokkit Launcha" + "Stikkbombs" ], "unit_type": 1, "unit_size": 2 @@ -910,18 +911,32 @@ "unit_type": 1, "unit_size": 0.5 }, - "ork_boy": { - "display_name": "Ork Boy", + "slugga_boy": { + "display_name": "Slugga Boy", "armour": 5, "health": 60, "resistance": 1, "weapons": [ "Choppa", - "Slugga" + "Slugga", + "Stickkbombs" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, + "shoota_boy": { + "display_name": "Shoota Boy", + "armour": 5, + "health": 60, + "resistance": 1, + "weapons": [ + "Choppa", + "Shoota", + "Stickkbombs" + ], + "unit_type": 0, + "unit_size": 1 + }, "mekboy": { "display_name": "Mekboy", "armour": 12, @@ -932,9 +947,22 @@ "Slugga", "Stickkbombs" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, + "runtherd": { + "display_name": "Runtherd", + "armour": 12, + "health": 100, + "resistance": 0.75, + "weapons": [ + "Grabba Stikk", + "Slugga", + "Stickkbombs" + ], + "unit_type": 0, + "unit_size": 1 + }, "nob": { "display_name": "Nob", "armour": 5, @@ -944,7 +972,7 @@ "Power Klaw", "Big Shoota" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "boss_nob": { @@ -953,8 +981,9 @@ "health": 200, "resistance": 1, "weapons": [ - "Power Klaw", - "Big Shoota" + "Big Choppa", + "Twin-Linked Shoota", + "Stickkbombs" ], "unit_type": 3, "unit_size": 2 @@ -965,8 +994,9 @@ "health": 150, "resistance": 0.6, "weapons": [ + "Twin-Linked Shoota", "Power Klaw", - "Big Shoota" + "Stikkbombs" ], "unit_type": 1, "unit_size": 2 @@ -977,8 +1007,9 @@ "health": 150, "resistance": 0.6, "weapons": [ + "Twin-Linked Shoota", "Power Klaw", - "Big Shoota" + "Stikkbombs" ], "unit_type": 3, "unit_size": 2 @@ -990,11 +1021,23 @@ "resistance": 1, "weapons": [ "Snazzgun", - "Choppa" + "Stickkbombs" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, + "kaptin": { + "display_name": "Kaptin", + "armour": 8, + "health": 100, + "resistance": 1, + "weapons": [ + "Snazzgun", + "Stickkbombs" + ], + "unit_type": 0, + "unit_size": 1 + }, "cybork": { "display_name": "Cybork", "armour": 8, @@ -1004,7 +1047,7 @@ "Power Klaw", "Big Shoota" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "ard_boy": { @@ -1014,9 +1057,10 @@ "resistance": 0.9, "weapons": [ "Choppa", - "Slugga" + "Slugga", + "Stickkbombs" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "kommando": { @@ -1026,9 +1070,10 @@ "resistance": 0.9, "weapons": [ "Choppa", - "Rokkit Launcha" + "Slugga", + "Stickkbombs" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "burna_boy": { @@ -1040,7 +1085,7 @@ "Choppa", "Burna" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "tankbusta": { @@ -1050,10 +1095,9 @@ "resistance": 1, "weapons": [ "Rokkit Launcha", - "Tankbusta Bomb", - "Melee1" + "Tankbusta Bomb" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "stormboy": { @@ -1083,8 +1127,8 @@ "Rokkit Launcha", "Rokkit Launcha" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "deff_dread": { "display_name": "Deff Dread", @@ -1097,8 +1141,8 @@ "Power Klaw", "Power Klaw" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "xv8_commander": { "display_name": "XV8 Commander", @@ -1110,7 +1154,7 @@ "Fusion Blaster", "Cyclic Ion Blaster" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "xv8_bodyguard": { @@ -1122,7 +1166,7 @@ "Plasma Rifle", "Burst Rifle" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "xv8_crisis": { @@ -1134,7 +1178,7 @@ "Plasma Rifle", "Missile Pod" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "xv8_(brightknife)": { @@ -1146,7 +1190,7 @@ "Fusion Blaster", "Fusion Blaster" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "shield_drone": { @@ -1155,7 +1199,7 @@ "health": 50, "resistance": 1, "weapons": [], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "xv88_broadside": { @@ -1167,7 +1211,7 @@ "Smart Missile System", "Small Railgun" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "xv25_stealthsuit": { @@ -1178,7 +1222,7 @@ "weapons": [ "Burst Rifle" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "fire_warrior": { @@ -1189,7 +1233,7 @@ "weapons": [ "Pulse Rifle" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "tau_pathfinder": { @@ -1200,7 +1244,7 @@ "weapons": [ "Rail Rifle" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "kroot": { @@ -1212,7 +1256,7 @@ "Kroot Rifle", "Melee2" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "vespid": { @@ -1224,7 +1268,7 @@ "Vespid Crystal", "Melee2" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "devilfish": { @@ -1235,8 +1279,8 @@ "weapons": [ "Smart Missile System" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "hammerhead": { "display_name": "Hammerhead", @@ -1247,8 +1291,8 @@ "Railgun", "Smart Missile System" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "hive_tyrant": { "display_name": "Hive Tyrant", @@ -1260,7 +1304,7 @@ "Lashwhip", "Heavy Venom Cannon" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "tyrant_guard": { @@ -1271,7 +1315,7 @@ "weapons": [ "Crushing Claws" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "tyranid_warrior": { @@ -1283,7 +1327,7 @@ "Rending Claws", "Devourer" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "zoanthrope": { @@ -1294,7 +1338,7 @@ "weapons": [ "Zoanthrope Blast" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "carnifex": { @@ -1306,8 +1350,8 @@ "Carnifex Claws", "Venom Cannon" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "termagaunt": { "display_name": "Termagaunt", @@ -1317,7 +1361,7 @@ "weapons": [ "Fleshborer" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "hormagaunt": { @@ -1328,7 +1372,7 @@ "weapons": [ "Scything Talons" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "cultist": { @@ -1340,7 +1384,7 @@ "Autogun", "melee0.5" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "genestealer": { @@ -1351,7 +1395,7 @@ "weapons": [ "Genestealer Claws" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "genestealer_patriarch": { @@ -1363,7 +1407,7 @@ "Genestealer Claws", "Witchfire" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "armoured_limousine": { @@ -1377,8 +1421,8 @@ "Autogun", "Autogun" ], - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "lictor": { "display_name": "Lictor", @@ -1389,7 +1433,7 @@ "Lictor Claws", "Flesh Hooks" ], - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "chaos_leader": { @@ -1642,8 +1686,8 @@ "armour": 40, "health": 300, "resistance": 0.5, - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "rhino": { "display_name": "Rhino", @@ -1653,8 +1697,8 @@ "armour": 40, "health": 200, "resistance": 0.75, - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "predator": { "display_name": "Predator", @@ -1665,8 +1709,8 @@ "armour": 45, "health": 350, "resistance": 0.5, - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "vindicator": { "display_name": "Vindicator", @@ -1677,8 +1721,8 @@ "armour": 45, "health": 300, "resistance": 0.5, - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "land_raider": { "display_name": "Land Raider", @@ -1689,8 +1733,8 @@ "armour": 50, "health": 400, "resistance": 0.25, - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "heldrake": { "display_name": "Heldrake", @@ -1700,8 +1744,8 @@ "armour": 50, "health": 400, "resistance": 0.25, - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "defiler": { "display_name": "Defiler", @@ -1714,8 +1758,8 @@ "armour": 40, "health": 300, "resistance": 0.5, - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "arch_heretic": { "display_name": "Arch Heretic", @@ -1773,8 +1817,8 @@ "armour": 10, "health": 100, "resistance": 0.75, - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "chaos_leman_russ": { "display_name": "Chaos Leman Russ", @@ -1785,8 +1829,8 @@ "armour": 45, "health": 250, "resistance": 0.25, - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "chaos_basilisk": { "display_name": "Chaos Basilisk", @@ -1796,8 +1840,8 @@ ], "armour": 20, "health": 150, - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "necron_overlord": { "display_name": "Necron Overlord", @@ -1808,7 +1852,7 @@ "armour": 12, "health": 300, "resistance": 0.5, - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "lychguard": { @@ -1819,7 +1863,7 @@ "armour": 12, "health": 100, "resistance": 0.75, - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "flayed_one": { @@ -1830,7 +1874,7 @@ "armour": 8, "health": 75, "resistance": 0.9, - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "necron_warrior": { @@ -1842,7 +1886,7 @@ "armour": 8, "health": 75, "resistance": 0.9, - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "necron_immortal": { @@ -1854,7 +1898,7 @@ "armour": 8, "health": 75, "resistance": 0.85, - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "necron_wraith": { @@ -1865,7 +1909,7 @@ "armour": 10, "health": 200, "resistance": 0.75, - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "necron_destroyer": { @@ -1877,7 +1921,7 @@ "armour": 25, "health": 175, "resistance": 0.5, - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "tomb_stalker": { @@ -1890,8 +1934,8 @@ "armour": 40, "health": 600, "resistance": 0.5, - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "canoptek_spyder": { "display_name": "Canoptek Spyder", @@ -1901,8 +1945,8 @@ "armour": 30, "health": 300, "resistance": 0.75, - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "canoptek_scarab": { "display_name": "Canoptek Scarab", @@ -1912,7 +1956,7 @@ "armour": 8, "health": 30, "resistance": 0.75, - "unit_type": 1, + "unit_type": 0, "unit_size": 1 }, "necron_monolith": { @@ -1924,8 +1968,8 @@ "armour": 50, "health": 500, "resistance": 0.25, - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 }, "doomsday_arc": { "display_name": "Doomsday Arc", @@ -1936,7 +1980,7 @@ "armour": 40, "health": 350, "resistance": 0.5, - "unit_type": 1, - "unit_size": 16 + "unit_type": 0, + "unit_size": 10 } } \ No newline at end of file diff --git a/objects/obj_enunit/Create_0.gml b/objects/obj_enunit/Create_0.gml index 168a971fd5..c33a722cc3 100644 --- a/objects/obj_enunit/Create_0.gml +++ b/objects/obj_enunit/Create_0.gml @@ -40,6 +40,8 @@ is_mouse_over = function() { copy_block_composition = function(_composition) { + var _t_start_copy_block_composition = get_timer(); + if (struct_exists(_composition, "units")) { var _units = _composition.units; @@ -71,24 +73,34 @@ copy_block_composition = function(_composition) { var _profile_name = _unit_name; var _unit = _squad_units[$ _unit_name]; - if (struct_exists(_unit, "display_name")) { - _unit_name = _unit.display_name; - } - if (struct_exists(unit_stacks, _unit_name)) { unit_stacks[$ _unit_name].unit_count += _unit.count * _squad_count; column_size += unit_stacks[$ _unit_name].unit_size * _unit.count * _squad_count; } else { var _unit_struct = new EnemyUnitStack(_profile_name, _unit.count * _squad_count); - _unit_struct.weapons = _unit.weapons; struct_set(unit_stacks, _unit_name, _unit_struct); column_size += _unit_struct.unit_size * _unit.count * _squad_count; } } } } + + var _t_end_copy_block_composition = get_timer(); + var _elapsed_ms_copy_block_composition = (_t_end_copy_block_composition - _t_start_copy_block_composition) / 1000; + show_debug_message($"⏱️ Execution Time copy_block_composition: {_elapsed_ms_copy_block_composition}ms"); }; +assign_weapon_stacks = function() { + var _unit_stack_names = struct_get_names(unit_stacks); + var _unit_stack_len = array_length(_unit_stack_names); + for (var k = 0; k < _unit_stack_len; k++){ + var _unit_stack_name = _unit_stack_names[k]; + var _unit_stack = unit_stacks[$ _unit_stack_name]; + for (var w = 0; w < array_length(_unit_stack.weapons)) { + scr_en_weapon(_unit_stack.weapons[w], _unit_stack.unit_type, _unit_stack.unit_count, _unit_stack_name, self); + } + } +} unit_count = function() { var _unit_count = 0; diff --git a/objects/obj_ncombat/Step_0.gml b/objects/obj_ncombat/Step_0.gml index 3f1fdd5d1c..0f50d6c8d3 100644 --- a/objects/obj_ncombat/Step_0.gml +++ b/objects/obj_ncombat/Step_0.gml @@ -11,6 +11,8 @@ if (biggest_block_size > 0) { } if (battle_stage == eBATTLE_STAGE.Creation) { + var _t_start_creation_stage = get_timer(); + ncombat_enemy_stacks_init(); with (obj_pnunit) { @@ -37,10 +39,16 @@ if (battle_stage == eBATTLE_STAGE.Creation) { if (obj_ncombat.enemy == 30 || battle_special == "ship_demon") { turn_stage = eBATTLE_TURN.PlayerEnd; } + + var _t_end_creation_stage = get_timer(); + var _elapsed_ms_creation_stage = (_t_end_creation_stage - _t_start_creation_stage) / 1000; + show_debug_message($"⏱️ Execution Time creation_stage: {_elapsed_ms_creation_stage}ms"); } if (keyboard_check_pressed(vk_enter) && fading_strength == 0) { if (turn_stage == eBATTLE_TURN.PlayerStart || turn_stage == eBATTLE_TURN.EnemyStart) { + var _t_start_turn_start = get_timer(); + turn_count++; global_perils -= 1; queue_battlelog_message($"Turn {turn_count}", COL_YELLOW); @@ -54,6 +62,7 @@ if (keyboard_check_pressed(vk_enter) && fading_strength == 0) { } move_enemy_blocks(); with (obj_enunit) { + assign_weapon_stacks(); enunit_target_and_shoot(); } } @@ -77,9 +86,15 @@ if (keyboard_check_pressed(vk_enter) && fading_strength == 0) { display_message_queue(); turn_stage = (turn_stage == eBATTLE_TURN.PlayerStart) ? eBATTLE_TURN.PlayerEnd : eBATTLE_TURN.EnemyEnd; + + var _t_end_turn_start = get_timer(); + var _elapsed_ms_turn_start = (_t_end_turn_start - _t_start_turn_start) / 1000; + show_debug_message($"⏱️ Execution Time turn_start: {_elapsed_ms_turn_start}ms"); } if (turn_stage == eBATTLE_TURN.EnemyEnd || turn_stage == eBATTLE_TURN.PlayerEnd) { + var _t_start_turn_end = get_timer(); + if (!battle_ended) { with (obj_pnunit) { pnunit_is_valid(id); @@ -97,6 +112,10 @@ if (keyboard_check_pressed(vk_enter) && fading_strength == 0) { if (turn_stage == eBATTLE_TURN.PlayerEnd) { turn_stage = eBATTLE_TURN.EnemyStart; } + + var _t_end_turn_end = get_timer(); + var _elapsed_ms_turn_end = (_t_end_turn_end - _t_start_turn_end) / 1000; + show_debug_message($"⏱️ Execution Time turn_end: {_elapsed_ms_turn_end}ms"); } diff --git a/scripts/scr_en_weapon/scr_en_weapon.gml b/scripts/scr_en_weapon/scr_en_weapon.gml index cf9c6f5728..db056ce3b9 100644 --- a/scripts/scr_en_weapon/scr_en_weapon.gml +++ b/scripts/scr_en_weapon/scr_en_weapon.gml @@ -1,15 +1,15 @@ /// @mixin -function scr_en_weapon(_weapon_name, is_man, man_number, man_type, group) { +function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _unit_block) { // check if double ranged/melee // then add to that weapon //scr_infantry_weapon // _weapon_name: _weapon_name - // is_man: man? //Probably used to differenciate internaly between trooper and vehicle weapons - // man_number: number - // man_type: owner - // group: current dudes block + // _unit_type: man? //Probably used to differenciate internaly between trooper and vehicle weapons + // _weapon_count: number + // _unit_name: owner + // _unit_block: current dudes block // Determines combined damage for enemy battle blocks for a single weapon @@ -1050,18 +1050,18 @@ function scr_en_weapon(_weapon_name, is_man, man_number, man_type, group) { // if (obj_ncombat.enemy == 1) { // if (_range <= 1 || floor(_range) != _range) { - // _attack = round(_attack * dudes_attack[group]); + // _attack = round(_attack * dudes_attack[_unit_block]); // } else if (_range > 1 && floor(_range) == _range) { - // _attack = round(_attack * dudes_ranged[group]); + // _attack = round(_attack * dudes_ranged[_unit_block]); // } // } - if (!is_man && _ammo > 0) { + if (!_unit_type && _ammo > 0) { _ammo *= 2; } var _stack_type = {}; - if (is_man) { + if (_unit_type) { _stack_type = weapon_stacks_normal; } else { _stack_type = weapon_stacks_vehicle; @@ -1069,19 +1069,19 @@ function scr_en_weapon(_weapon_name, is_man, man_number, man_type, group) { if (struct_exists(_stack_type, _weapon_name)) { var _weapon_stack = _stack_type[$ _weapon_name]; - _weapon_stack.weapon_count += man_number; + _weapon_stack.weapon_count += _weapon_count; - if (!array_contains(_weapon_stack.owners, man_type)) { - array_push(_weapon_stack.owners, man_type); + if (!array_contains(_weapon_stack.owners, _unit_name)) { + array_push(_weapon_stack.owners, _unit_name); } } else { var _weapon_stack = new WeaponStack(_weapon_name); _weapon_stack.attack = _attack; _weapon_stack.piercing = _piercing; _weapon_stack.range = _range; - _weapon_stack.weapon_count += man_number; + _weapon_stack.weapon_count += _weapon_count; _weapon_stack.shot_count = _shot_count; - array_push(_weapon_stack.owners, man_type); + array_push(_weapon_stack.owners, _unit_name); if (obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) { _weapon_stack.ammo_max = _ammo; diff --git a/scripts/scr_flavor/scr_flavor.gml b/scripts/scr_flavor/scr_flavor.gml index e23425ba06..6449830bb0 100644 --- a/scripts/scr_flavor/scr_flavor.gml +++ b/scripts/scr_flavor/scr_flavor.gml @@ -1,5 +1,5 @@ /// @mixin -function scr_flavor(_weapon_stack, _target_object, _target_i, casulties) { +function scr_flavor(_weapon_stack, _target_object, _target_stack, casulties) { // Generates flavor based on the damage and casualties from scr_shoot, only for the player @@ -10,8 +10,6 @@ function scr_flavor(_weapon_stack, _target_object, _target_i, casulties) { var weapon_name = _weapon_stack.weapon_name; var number_of_shots = _weapon_stack.weapon_count - var target = _target_object; - var targeh = _target_i; // if (id_of_attacking_weapons = -51) then weapon_name = "Heavy Bolter Emplacemelse ent"; // if (id_of_attacking_weapons = -52) then weapon_name = "Missile Launcher Emplacement"; @@ -23,7 +21,7 @@ function scr_flavor(_weapon_stack, _target_object, _target_i, casulties) { weapon_data.name = weapon_name; } - var target_name = target.dudes[targeh]; + var target_name = _target_stack.display_name; if (target_name = "Leader") and (obj_ncombat.enemy <= 10) { target_name = obj_controller.faction_leader[obj_ncombat.enemy]; @@ -44,7 +42,7 @@ function scr_flavor(_weapon_stack, _target_object, _target_i, casulties) { if (target_name = "Greater Daemon of Tzeentch") then obj_ncombat.chaos_angry += casulties * 5; } - if (target.flank = 1) then target_name = "flanking " + target_name; + if (_target_object.flank = 1) then target_name = "flanking " + target_name; var flavoured = false; @@ -55,7 +53,7 @@ function scr_flavor(_weapon_stack, _target_object, _target_i, casulties) { attack_message += "With perfect accuracy "; } if (number_of_shots < 200) { - if (target.dudes_num[targeh] == 1) { + if (_target_stack.unit_count == 1) { if (casulties == 0) { attack_message += $"{number_of_shots} {weapon_name}s fire. The {target_name} is hit but survives."; } else { @@ -69,7 +67,7 @@ function scr_flavor(_weapon_stack, _target_object, _target_i, casulties) { } } } else { - if (target.dudes_num[targeh] == 1) { + if (_target_stack.unit_count == 1) { if (casulties == 0) { attack_message += $"{number_of_shots} {weapon_name}s fire. Explosions rock the {target_name}'s armour but don't kill it."; } else { @@ -84,7 +82,7 @@ function scr_flavor(_weapon_stack, _target_object, _target_i, casulties) { } } } else { - if (target.dudes_num[targeh] == 1) { + if (_target_stack.unit_count == 1) { if (casulties == 0) { attack_message += $"{string(unit_name)} fires his {weapon_name} at the {target_name} but fails to kill it."; } else { @@ -109,7 +107,7 @@ function scr_flavor(_weapon_stack, _target_object, _target_i, casulties) { } else { attack_message += $"A massive wave of {number_of_shots} Astartes rise, their Jump Packs a furious beast. They crash down, smashing their foe- "; } - if (target.dudes_num[targeh] == 1) { + if (_target_stack.unit_count == 1) { if (casulties == 0) { attack_message += $"but the {target_name} endures the onslaught."; } else { @@ -123,7 +121,7 @@ function scr_flavor(_weapon_stack, _target_object, _target_i, casulties) { } } } else { - if (target.dudes_num[targeh] == 1) { + if (_target_stack.unit_count == 1) { attack_message += string(unit_name) + $" engages his Jump Pack, soaring and crashing into the {target_name}- "; if (casulties == 0) { attack_message += $"but it endures the onslaught."; @@ -143,7 +141,7 @@ function scr_flavor(_weapon_stack, _target_object, _target_i, casulties) { } else if (weapon_name == "Assault Cannon") { flavoured = true; if (!character_shot) { - if (target.dudes_num[targeh] == 1) { + if (_target_stack.unit_count == 1) { if (casulties == 0) { attack_message += $"{number_of_shots} {weapon_name}s roar, explosions clap across the armour of the {target_name} but it remains standing."; } else { @@ -157,7 +155,7 @@ function scr_flavor(_weapon_stack, _target_object, _target_i, casulties) { } } } else { - if (target.dudes_num[targeh] == 1) { + if (_target_stack.unit_count == 1) { if (casulties == 0) { attack_message += $"{string(unit_name)} {weapon_name} fires but the {target_name} survives."; } else { @@ -175,7 +173,7 @@ function scr_flavor(_weapon_stack, _target_object, _target_i, casulties) { } else if (weapon_name == "Missile Launcher") { flavoured = true; if (!character_shot) { - if (target.dudes_num[targeh] == 1) { + if (_target_stack.unit_count == 1) { if (casulties == 0) { attack_message = $"{number_of_shots} {weapon_name}s fire upon the {target_name} but it remains standing."; } else { @@ -189,7 +187,7 @@ function scr_flavor(_weapon_stack, _target_object, _target_i, casulties) { } } } else { - if (target.dudes_num[targeh] == 1) { + if (_target_stack.unit_count == 1) { if (casulties == 0) { attack_message = $"{string(unit_name)} {weapon_name} fires upon the {target_name} but it survives."; } else { @@ -207,7 +205,7 @@ function scr_flavor(_weapon_stack, _target_object, _target_i, casulties) { } else if (weapon_name == "Whirlwind Missiles") { flavoured = true; if (!character_shot) { - if (target.dudes_num[targeh] == 1) { + if (_target_stack.unit_count == 1) { if (casulties == 0) { attack_message = $"{number_of_shots} Whirlwinds fire upon the {target_name} but it remains standing."; } else { @@ -221,7 +219,7 @@ function scr_flavor(_weapon_stack, _target_object, _target_i, casulties) { } } } else { - if (target.dudes_num[targeh] == 1) { + if (_target_stack.unit_count == 1) { if (casulties == 0) { attack_message = $"Whirlwind fires upon the {target_name} but it survives."; } else { @@ -257,25 +255,25 @@ function scr_flavor(_weapon_stack, _target_object, _target_i, casulties) { } else if (weapon_data.has_tag("plasma")) { flavoured = true; - if (target.dudes_num[targeh] = 1) and (casulties = 0) then attack_message = $"{number_of_shots} {weapon_name} shoot bolts of energy into a {target_name}, failing to kill it."; - if (target.dudes_num[targeh] = 1) and (casulties = 1) then attack_message = $"{number_of_shots} {weapon_name} overwhelm a {target_name} with bolts of energy, killing {casulties}."; - if (target.dudes_num[targeh] > 1) and (casulties = 0) then attack_message = $"{number_of_shots} {weapon_name} shoot bolts of energy into the {target_name} ranks, failing to kill any."; - if (target.dudes_num[targeh] > 1) and (casulties > 0) then attack_message = $"{number_of_shots} {weapon_name} shoot bolts of energy into the {target_name}, cleansing {casulties}."; + if (_target_stack.unit_count = 1) and (casulties = 0) then attack_message = $"{number_of_shots} {weapon_name} shoot bolts of energy into a {target_name}, failing to kill it."; + if (_target_stack.unit_count = 1) and (casulties = 1) then attack_message = $"{number_of_shots} {weapon_name} overwhelm a {target_name} with bolts of energy, killing {casulties}."; + if (_target_stack.unit_count > 1) and (casulties = 0) then attack_message = $"{number_of_shots} {weapon_name} shoot bolts of energy into the {target_name} ranks, failing to kill any."; + if (_target_stack.unit_count > 1) and (casulties > 0) then attack_message = $"{number_of_shots} {weapon_name} shoot bolts of energy into the {target_name}, cleansing {casulties}."; } else if (weapon_data.has_tag("flame")) { flavoured = true; - if (target.dudes_num[targeh] = 1) and (casulties = 0) then attack_message = $"{number_of_shots} {weapon_name} bathe the {target_name} in holy promethium, failing to kill it."; - if (target.dudes_num[targeh] = 1) and (casulties = 1) then attack_message = $"{number_of_shots} {weapon_name} flash-fry the {target_name} inside its armour, inflicting {casulties}."; - if (target.dudes_num[targeh] > 1) and (casulties = 0) then attack_message = $"{number_of_shots} {weapon_name} wash over the {target_name} ranks, failing to kill any."; - if (target.dudes_num[targeh] > 1) and (casulties > 0) then attack_message = $"{number_of_shots} {weapon_name} bathe the {target_name} ranks in holy promethium, cleansing {casulties}."; + if (_target_stack.unit_count = 1) and (casulties = 0) then attack_message = $"{number_of_shots} {weapon_name} bathe the {target_name} in holy promethium, failing to kill it."; + if (_target_stack.unit_count = 1) and (casulties = 1) then attack_message = $"{number_of_shots} {weapon_name} flash-fry the {target_name} inside its armour, inflicting {casulties}."; + if (_target_stack.unit_count > 1) and (casulties = 0) then attack_message = $"{number_of_shots} {weapon_name} wash over the {target_name} ranks, failing to kill any."; + if (_target_stack.unit_count > 1) and (casulties > 0) then attack_message = $"{number_of_shots} {weapon_name} bathe the {target_name} ranks in holy promethium, cleansing {casulties}."; } else if (weapon_name = "Webber") { flavoured = true; if ((target_name = "Termagaunt") or (target_name = "Hormagaunt")) and (casulties > 0) then obj_ncombat.captured_gaunt += casulties; - if (target.dudes_num[targeh] = 1) and (casulties = 0) then attack_message = $"{number_of_shots} {weapon_name} spray ooze on the {target_name} but fail to immobilize it."; - if (target.dudes_num[targeh] = 1) and (casulties = 1) then attack_message = $"{number_of_shots} {weapon_name} spray ooze on the {target_name} and fully immobilize it."; - if (target.dudes_num[targeh] > 1) and (casulties = 0) then attack_message = $"{number_of_shots} {weapon_name} spray ooze on the {target_name} ranks, failing to immobilize any."; - if (target.dudes_num[targeh] > 1) and (casulties > 0) then attack_message = $"{number_of_shots} {weapon_name} spray ooze on the {target_name} ranks and immobilize {casulties} of them."; + if (_target_stack.unit_count = 1) and (casulties = 0) then attack_message = $"{number_of_shots} {weapon_name} spray ooze on the {target_name} but fail to immobilize it."; + if (_target_stack.unit_count = 1) and (casulties = 1) then attack_message = $"{number_of_shots} {weapon_name} spray ooze on the {target_name} and fully immobilize it."; + if (_target_stack.unit_count > 1) and (casulties = 0) then attack_message = $"{number_of_shots} {weapon_name} spray ooze on the {target_name} ranks, failing to immobilize any."; + if (_target_stack.unit_count > 1) and (casulties > 0) then attack_message = $"{number_of_shots} {weapon_name} spray ooze on the {target_name} ranks and immobilize {casulties} of them."; } else if (weapon_name = "Close Combat Weapon") { flavoured = true; @@ -314,14 +312,14 @@ function scr_flavor(_weapon_stack, _target_object, _target_i, casulties) { } else if (weapon_data.has_tag("power")) { flavoured = true; - if (target.dudes_num[targeh] = 1) { + if (_target_stack.unit_count = 1) { if (number_of_shots = 1) and (casulties = 0) then attack_message = $"A {target_name} is struck by a {weapon_name} but survives."; if (number_of_shots = 1) and (casulties = 1) then attack_message = $"A {target_name} is struck down by a {weapon_name}."; if (number_of_shots > 1) and (casulties = 0) then attack_message = $"A {target_name} is struck by {number_of_shots} {weapon_name}s but survives."; if (number_of_shots > 1) and (casulties = 1) then attack_message = $"A {target_name} is struck down by {number_of_shots} {weapon_name}s."; } - if (target.dudes_num[targeh] > 1) { + if (_target_stack.unit_count > 1) { if (number_of_shots > 1) and (casulties = 0) then attack_message = $"{number_of_shots} {weapon_name}s crackle and spark, striking at the {target_name} ranks, inflicting no damage."; if (number_of_shots > 1) and (casulties > 0) then attack_message = $"{number_of_shots} {weapon_name}s crackle and spark, hewing through the {target_name} ranks, {casulties} are cut down."; } @@ -331,7 +329,7 @@ function scr_flavor(_weapon_stack, _target_object, _target_i, casulties) { if (flavoured == false) { flavoured = true; if (!character_shot) { - if (target.dudes_num[targeh] == 1) { + if (_target_stack.unit_count == 1) { if (number_of_shots == 1 && casulties == 0) { attack_message = $"A {target_name} is struck by {weapon_name} but survives."; } else if (number_of_shots == 1 && casulties == 1) { @@ -353,7 +351,7 @@ function scr_flavor(_weapon_stack, _target_object, _target_i, casulties) { } } } else { - if (target.dudes_num[targeh] == 1) { + if (_target_stack.unit_count == 1) { if (casulties == 0) { attack_message = $"{string(unit_name)} {weapon_name} strikes at a {target_name} but fails to kill it."; } else { diff --git a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml index 87e5d017bd..ea4fc6175f 100644 --- a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml +++ b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml @@ -71,6 +71,8 @@ function add_data_to_stack (weapon, unit_damage=0, head_role=false, unit="none") /// @mixin function scr_player_combat_weapon_stacks() { + var _t_start_player_weapon_stacks = get_timer(); + if (defenses=1){ var i=0; @@ -277,6 +279,10 @@ function scr_player_combat_weapon_stacks() { } } } + + var _t_end_player_weapon_stacks = get_timer(); + var _elapsed_ms_player_weapon_stacks = (_t_end_player_weapon_stacks - _t_start_player_weapon_stacks) / 1000; + show_debug_message($"⏱️ Execution Time player_weapon_stacks: {_elapsed_ms_player_weapon_stacks}ms"); // Right here should be retreat- if important units are exposed they should try to hop left diff --git a/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml b/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml index fe96123975..87f738f488 100644 --- a/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml +++ b/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml @@ -1,10 +1,10 @@ -#macro DEBUG_COLUMN_PRIORITY_PLAYER false +#macro DEBUG_COLUMN_PRIORITY_PLAYER true // alarm_0 /// @mixin function pnunit_target_and_shoot() { // Useful functions: - // scr_target + // target_unit_stack // get_rightmost // move_unit_block // gear_weapon_data @@ -19,10 +19,6 @@ function pnunit_target_and_shoot() { engaged = collision_point(x - 10, y, obj_enunit, 0, 1) || collision_point(x + 10, y, obj_enunit, 0, 1); - if (DEBUG_COLUMN_PRIORITY_PLAYER) { - var _t_start1 = get_timer(); - } - if (!engaged) { for (var i = 0; i < array_length(unit_struct); i++) { if (marine_dead[i] == 0 && marine_casting[i] == true) { @@ -47,10 +43,6 @@ function pnunit_target_and_shoot() { if (_weapon_stack.range >= dist) { var _target_priority_queue = ds_priority_create(); - if (DEBUG_COLUMN_PRIORITY_PLAYER) { - var _t_start = get_timer(); - } - // Scan potential targets var _check_targets = []; with (obj_enunit) { @@ -74,12 +66,6 @@ function pnunit_target_and_shoot() { } } - if (DEBUG_COLUMN_PRIORITY_PLAYER) { - var _t_end = get_timer(); - var _elapsed_ms = (_t_end - _t_start) / 1000; - show_debug_message($"⏱️ Execution Time: {_elapsed_ms}ms"); - } - // Shoot highest-priority target if (!ds_priority_empty(_target_priority_queue)) { var best_target = ds_priority_delete_max(_target_priority_queue); @@ -101,11 +87,6 @@ function pnunit_target_and_shoot() { // continue; } } - if (DEBUG_COLUMN_PRIORITY_PLAYER) { - var _t_end1 = get_timer(); - var _elapsed_ms1 = (_t_end1 - _t_start1) / 1000; - show_debug_message($"⏱️ Ranged Alarm Execution Time: {_elapsed_ms1}ms"); - } } else { // Melee var _melee_weapons = get_valid_weapon_stacks(weapon_stacks_normal, 1, 2); @@ -127,6 +108,8 @@ function pnunit_target_and_shoot() { /// @mixin function pnunit_battle_effects() { try { + var _t_start_battle_effects = get_timer(); + if (obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) { if (men + dreads + veh <= 0) { //show_debug_message($"column destroyed {x}") @@ -250,6 +233,10 @@ function pnunit_battle_effects() { /* */ /* */ + + var _t_end_battle_effects = get_timer(); + var _elapsed_ms_battle_effects = (_t_end_battle_effects - _t_start_battle_effects) / 1000; + show_debug_message($"⏱️ Execution Time battle_effects: {_elapsed_ms_battle_effects}ms"); } catch (_exception) { handle_exception(_exception); } @@ -326,3 +313,37 @@ function pnunit_dying_process() { /* */ /* */ } + +function target_unit_stack(_battle_block, _target_type = -1) { + var _t_start_target_unit_stack = get_timer(); + + var _biggest_target = noone; + var _priority_queue = ds_priority_create(); + var _unit_stacks = _battle_block.unit_stacks; + + var _unit_stack_names = struct_get_names(_unit_stacks); + var _unit_stack_len = array_length(_unit_stack_names); + for (var k = 0; k < _unit_stack_len; k++){ + var _unit_stack_name = _unit_stack_names[k]; + var _unit_stack = _unit_stacks[$ _unit_stack_name]; + + var _unit_stack_count = _unit_stack.unit_count; + var _unit_stack_type = _unit_stack.unit_type; + + if (_target_type == -1 || _unit_stack_type == _target_type) { + ds_priority_add(_priority_queue, _unit_stack, _unit_stack_count); + } + } + + if (!ds_priority_empty(_priority_queue)) { + _biggest_target = ds_priority_delete_max(_priority_queue); + } + + ds_priority_destroy(_priority_queue); + + var _t_end_target_unit_stack = get_timer(); + var _elapsed_ms_target_unit_stack = (_t_end_target_unit_stack - _t_start_target_unit_stack) / 1000; + show_debug_message($"⏱️ Execution Time target_unit_stack: {_elapsed_ms_target_unit_stack}ms"); + + return _biggest_target; +} diff --git a/scripts/scr_shoot/scr_shoot.gml b/scripts/scr_shoot/scr_shoot.gml index 0f7769b887..2b7e969c24 100644 --- a/scripts/scr_shoot/scr_shoot.gml +++ b/scripts/scr_shoot/scr_shoot.gml @@ -89,9 +89,9 @@ function scr_shoot(_weapon_stack, _target_object, _target_index) { //* Player shooting if (owner == eFACTION.Player) { - var _target_stack = scr_target(_target_object, _target_type); + var _target_stack = target_unit_stack(_target_object, _target_type); if (_target_stack == noone) { - _target_stack = scr_target(_target_object); + _target_stack = target_unit_stack(_target_object); if (_target_stack == noone) { // if (DEBUG_PLAYER_TARGET_SELECTION) { // show_debug_message($"{_weapon_name} found no valid targets in the enemy column to attack!"); @@ -109,6 +109,8 @@ function scr_shoot(_weapon_stack, _target_object, _target_index) { obj_ncombat.player_silos -= min(obj_ncombat.player_silos, 30); } + var _t_start_player_scr_shoot = get_timer(); + // Normal shooting var _min_damage = 0.25; var _dice_sides = 50; @@ -118,7 +120,7 @@ function scr_shoot(_weapon_stack, _target_object, _target_index) { _modified_weapon_attack = max(_min_damage, _modified_weapon_attack * _target_stack.resistance); var _total_attack = _modified_weapon_attack * _shot_count; - var _unit_hp = _target_stack.unit_health; + var _unit_hp = _target_stack.health; var _remaining_count = _target_stack.unit_count; // Estimate casualties @@ -131,7 +133,7 @@ function scr_shoot(_weapon_stack, _target_object, _target_index) { _target_stack.health_current -= _leftover_damage; if (_target_stack.health_current <= 0) { if (_target_stack.unit_count > 1) { - _target_stack.health_current = _target_stack.unit_health; + _target_stack.health_current = _target_stack.health; } else { _target_stack.health_current = 0; } @@ -139,13 +141,17 @@ function scr_shoot(_weapon_stack, _target_object, _target_index) { obj_ncombat.enemy_forces--; _casualties++; } + + var _t_end_player_scr_shoot = get_timer(); + var _elapsed_ms_player_scr_shoot = (_t_end_player_scr_shoot - _t_start_player_scr_shoot) / 1000; + show_debug_message($"⏱️ Execution Time player_scr_shoot: {_elapsed_ms_player_scr_shoot}ms"); scr_flavor(_weapon_stack, _target_object, _target_stack, _casualties); - if (_casualties > 0) { - compress_enemy_array(_target_object); - destroy_empty_column(_target_object); - } + // if (_casualties > 0) { + // compress_enemy_array(_target_object); + // destroy_empty_column(_target_object); + // } } } catch (_exception) { handle_exception(_exception); diff --git a/scripts/scr_target/scr_target.gml b/scripts/scr_target/scr_target.gml deleted file mode 100644 index 69b17fcfd0..0000000000 --- a/scripts/scr_target/scr_target.gml +++ /dev/null @@ -1,23 +0,0 @@ -function scr_target(_battle_block, _target_type = -1) { - var _biggest_target = noone; - var _priority_queue = ds_priority_create(); - var _unit_stacks = _battle_block.unit_stacks; - - for (var i = 0, dudes_len = array_length(_unit_stacks); i < dudes_len; i++) { - var _unit_stack = _unit_stacks[i]; - var _unit_stack_count = _unit_stack.count; - var _unit_stack_type = _unit_stack.unit_type; - - if (_target_type == -1 || _unit_stack_type == _target_type) { - ds_priority_add(_priority_queue, _unit_stack, _unit_stack_count); - } - } - - if (!ds_priority_empty(_priority_queue)) { - _biggest_target = ds_priority_delete_max(_priority_queue); - } - - ds_priority_destroy(_priority_queue); - - return _biggest_target; -} diff --git a/scripts/scr_target/scr_target.yy b/scripts/scr_target/scr_target.yy deleted file mode 100644 index f0ce200e8e..0000000000 --- a/scripts/scr_target/scr_target.yy +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$GMScript":"v1", - "%Name":"scr_target", - "isCompatibility":false, - "isDnD":false, - "name":"scr_target", - "parent":{ - "name":"Combat", - "path":"folders/Scripts/Combat.yy", - }, - "resourceType":"GMScript", - "resourceVersion":"2.0", -} \ No newline at end of file From 830f1602361c736a1f0b5c6a22ffc7113208ef0c Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Mon, 21 Apr 2025 23:27:47 +0300 Subject: [PATCH 68/80] More stuff --- datafiles/data/unit_profiles.jsonc | 48 ++-- objects/obj_enunit/Create_0.gml | 36 ++- objects/obj_ncombat/Create_0.gml | 18 +- objects/obj_ncombat/Step_0.gml | 49 ++-- scripts/macros/macros.gml | 1 + scripts/scr_clean/scr_clean.gml | 8 +- scripts/scr_en_weapon/scr_en_weapon.gml | 238 +++++++++--------- .../scr_enunit_scripts/scr_enunit_scripts.gml | 32 ++- .../scr_player_combat_weapon_stacks.gml | 12 +- .../scr_pnunit_scripts/scr_pnunit_scripts.gml | 24 +- scripts/scr_shoot/scr_shoot.gml | 19 +- 11 files changed, 277 insertions(+), 208 deletions(-) diff --git a/datafiles/data/unit_profiles.jsonc b/datafiles/data/unit_profiles.jsonc index 60e44aeef5..d23f631f00 100644 --- a/datafiles/data/unit_profiles.jsonc +++ b/datafiles/data/unit_profiles.jsonc @@ -894,8 +894,7 @@ "resistance": 0.75, "weapons": [ "Twin-Linked Shoota", - "Power Klaw", - "Stikkbombs" + "Power Klaw" ], "unit_type": 1, "unit_size": 2 @@ -918,8 +917,7 @@ "resistance": 1, "weapons": [ "Choppa", - "Slugga", - "Stickkbombs" + "Slugga" ], "unit_type": 0, "unit_size": 1 @@ -931,8 +929,7 @@ "resistance": 1, "weapons": [ "Choppa", - "Shoota", - "Stickkbombs" + "Shoota" ], "unit_type": 0, "unit_size": 1 @@ -944,23 +941,21 @@ "resistance": 0.75, "weapons": [ "Choppa", - "Slugga", - "Stickkbombs" + "Slugga" ], "unit_type": 0, "unit_size": 1 }, "runtherd": { "display_name": "Runtherd", - "armour": 12, - "health": 100, - "resistance": 0.75, + "armour": 5, + "health": 60, + "resistance": 1, "weapons": [ - "Grabba Stikk", - "Slugga", - "Stickkbombs" + "Choppa", + "Slugga" ], - "unit_type": 0, + "unit_type": 3, "unit_size": 1 }, "nob": { @@ -982,8 +977,7 @@ "resistance": 1, "weapons": [ "Big Choppa", - "Twin-Linked Shoota", - "Stickkbombs" + "Twin-Linked Shoota" ], "unit_type": 3, "unit_size": 2 @@ -995,8 +989,7 @@ "resistance": 0.6, "weapons": [ "Twin-Linked Shoota", - "Power Klaw", - "Stikkbombs" + "Power Klaw" ], "unit_type": 1, "unit_size": 2 @@ -1008,8 +1001,7 @@ "resistance": 0.6, "weapons": [ "Twin-Linked Shoota", - "Power Klaw", - "Stikkbombs" + "Power Klaw" ], "unit_type": 3, "unit_size": 2 @@ -1020,8 +1012,7 @@ "health": 100, "resistance": 1, "weapons": [ - "Snazzgun", - "Stickkbombs" + "Snazzgun" ], "unit_type": 0, "unit_size": 1 @@ -1032,10 +1023,9 @@ "health": 100, "resistance": 1, "weapons": [ - "Snazzgun", - "Stickkbombs" + "Snazzgun" ], - "unit_type": 0, + "unit_type": 3, "unit_size": 1 }, "cybork": { @@ -1057,8 +1047,7 @@ "resistance": 0.9, "weapons": [ "Choppa", - "Slugga", - "Stickkbombs" + "Slugga" ], "unit_type": 0, "unit_size": 1 @@ -1070,8 +1059,7 @@ "resistance": 0.9, "weapons": [ "Choppa", - "Slugga", - "Stickkbombs" + "Slugga" ], "unit_type": 0, "unit_size": 1 diff --git a/objects/obj_enunit/Create_0.gml b/objects/obj_enunit/Create_0.gml index c33a722cc3..53b0338c73 100644 --- a/objects/obj_enunit/Create_0.gml +++ b/objects/obj_enunit/Create_0.gml @@ -1,5 +1,5 @@ -owner = -1; +owner = 2; flank=0; unit_count_old=0; @@ -40,7 +40,9 @@ is_mouse_over = function() { copy_block_composition = function(_composition) { - var _t_start_copy_block_composition = get_timer(); + if (DEBUG_COMBAT_PERFORMANCE) { + var _t_start_copy_block_composition = get_timer(); + } if (struct_exists(_composition, "units")) { var _units = _composition.units; @@ -85,24 +87,40 @@ copy_block_composition = function(_composition) { } } - var _t_end_copy_block_composition = get_timer(); - var _elapsed_ms_copy_block_composition = (_t_end_copy_block_composition - _t_start_copy_block_composition) / 1000; - show_debug_message($"⏱️ Execution Time copy_block_composition: {_elapsed_ms_copy_block_composition}ms"); + if (DEBUG_COMBAT_PERFORMANCE) { + var _t_end_copy_block_composition = get_timer(); + var _elapsed_ms_copy_block_composition = (_t_end_copy_block_composition - _t_start_copy_block_composition) / 1000; + show_debug_message($"⏱️ Execution Time copy_block_composition: {_elapsed_ms_copy_block_composition}ms"); + } }; assign_weapon_stacks = function() { + if (DEBUG_COMBAT_PERFORMANCE) { + var _t_start_enemy_weapon_stacks = get_timer(); + } + var _unit_stack_names = struct_get_names(unit_stacks); var _unit_stack_len = array_length(_unit_stack_names); for (var k = 0; k < _unit_stack_len; k++){ var _unit_stack_name = _unit_stack_names[k]; var _unit_stack = unit_stacks[$ _unit_stack_name]; - for (var w = 0; w < array_length(_unit_stack.weapons)) { + for (var w = 0; w < array_length(_unit_stack.weapons); w++) { scr_en_weapon(_unit_stack.weapons[w], _unit_stack.unit_type, _unit_stack.unit_count, _unit_stack_name, self); } } + + if (DEBUG_COMBAT_PERFORMANCE) { + var _t_end_enemy_weapon_stacks = get_timer(); + var _elapsed_ms_enemy_weapon_stacks = (_t_end_enemy_weapon_stacks - _t_start_enemy_weapon_stacks) / 1000; + show_debug_message($"⏱️ Execution Time enemy_weapon_stacks: {_elapsed_ms_enemy_weapon_stacks}ms"); + } } unit_count = function() { + if (DEBUG_COMBAT_PERFORMANCE) { + var _t_start_unit_count = get_timer(); + } + var _unit_count = 0; var _unit_stack_names = struct_get_names(unit_stacks); @@ -112,6 +130,12 @@ unit_count = function() { var _unit_stack = unit_stacks[$ _unit_stack_name]; _unit_count += _unit_stack.unit_count; } + + if (DEBUG_COMBAT_PERFORMANCE) { + var _t_end_unit_count = get_timer(); + var _elapsed_ms_unit_count = (_t_end_unit_count - _t_start_unit_count) / 1000; + show_debug_message($"⏱️ Execution Time unit_count: {_elapsed_ms_unit_count}ms"); + } return _unit_count; }; diff --git a/objects/obj_ncombat/Create_0.gml b/objects/obj_ncombat/Create_0.gml index be23e11c32..d2cf480d50 100644 --- a/objects/obj_ncombat/Create_0.gml +++ b/objects/obj_ncombat/Create_0.gml @@ -357,4 +357,20 @@ display_message_queue = function() { enemy_force_composition = {}; battlefield_scale = 0.1; -biggest_block_size = 0; \ No newline at end of file +update_battlefield_scale = function() { + var _biggest_block_size = 0; + + with (obj_pnunit) { + if (column_size > _biggest_block_size) { + _biggest_block_size = column_size; + } + } + + with (obj_enunit) { + if (column_size > _biggest_block_size) { + _biggest_block_size = column_size; + } + } + + battlefield_scale = min(1, 400 / _biggest_block_size); +}; \ No newline at end of file diff --git a/objects/obj_ncombat/Step_0.gml b/objects/obj_ncombat/Step_0.gml index 0f50d6c8d3..3ebf17df0d 100644 --- a/objects/obj_ncombat/Step_0.gml +++ b/objects/obj_ncombat/Step_0.gml @@ -6,12 +6,10 @@ if (wall_destroyed == true) { wall_destroyed = false; } -if (biggest_block_size > 0) { - battlefield_scale = min(1, 400 / biggest_block_size); -} - if (battle_stage == eBATTLE_STAGE.Creation) { - var _t_start_creation_stage = get_timer(); + if (DEBUG_COMBAT_PERFORMANCE) { + var _t_start_creation_stage = get_timer(); + } ncombat_enemy_stacks_init(); @@ -21,9 +19,6 @@ if (battle_stage == eBATTLE_STAGE.Creation) { with (obj_enunit) { enunit_enemy_profiles_init(); - if (column_size > obj_ncombat.biggest_block_size) { - obj_ncombat.biggest_block_size = column_size; - } } with (obj_pnunit) { @@ -34,20 +29,26 @@ if (battle_stage == eBATTLE_STAGE.Creation) { ncombat_ally_init(); + update_battlefield_scale(); + battle_stage = eBATTLE_STAGE.Main; if (obj_ncombat.enemy == 30 || battle_special == "ship_demon") { turn_stage = eBATTLE_TURN.PlayerEnd; } - var _t_end_creation_stage = get_timer(); - var _elapsed_ms_creation_stage = (_t_end_creation_stage - _t_start_creation_stage) / 1000; - show_debug_message($"⏱️ Execution Time creation_stage: {_elapsed_ms_creation_stage}ms"); + if (DEBUG_COMBAT_PERFORMANCE) { + var _t_end_creation_stage = get_timer(); + var _elapsed_ms_creation_stage = (_t_end_creation_stage - _t_start_creation_stage) / 1000; + show_debug_message($"⏱️ Execution Time creation_stage: {_elapsed_ms_creation_stage}ms"); + } } -if (keyboard_check_pressed(vk_enter) && fading_strength == 0) { +if ((press_exclusive(vk_enter) || hold_exclusive(vk_enter)) && fading_strength == 0) { if (turn_stage == eBATTLE_TURN.PlayerStart || turn_stage == eBATTLE_TURN.EnemyStart) { - var _t_start_turn_start = get_timer(); + if (DEBUG_COMBAT_PERFORMANCE) { + var _t_start_turn_start = get_timer(); + } turn_count++; global_perils -= 1; @@ -87,13 +88,17 @@ if (keyboard_check_pressed(vk_enter) && fading_strength == 0) { turn_stage = (turn_stage == eBATTLE_TURN.PlayerStart) ? eBATTLE_TURN.PlayerEnd : eBATTLE_TURN.EnemyEnd; - var _t_end_turn_start = get_timer(); - var _elapsed_ms_turn_start = (_t_end_turn_start - _t_start_turn_start) / 1000; - show_debug_message($"⏱️ Execution Time turn_start: {_elapsed_ms_turn_start}ms"); + if (DEBUG_COMBAT_PERFORMANCE) { + var _t_end_turn_start = get_timer(); + var _elapsed_ms_turn_start = (_t_end_turn_start - _t_start_turn_start) / 1000; + show_debug_message($"⏱️ Execution Time turn_start: {_elapsed_ms_turn_start}ms"); + } } if (turn_stage == eBATTLE_TURN.EnemyEnd || turn_stage == eBATTLE_TURN.PlayerEnd) { - var _t_start_turn_end = get_timer(); + if (DEBUG_COMBAT_PERFORMANCE) { + var _t_start_turn_end = get_timer(); + } if (!battle_ended) { with (obj_pnunit) { @@ -105,6 +110,8 @@ if (keyboard_check_pressed(vk_enter) && fading_strength == 0) { } } + update_battlefield_scale(); + if (turn_stage == eBATTLE_TURN.EnemyEnd) { turn_stage = eBATTLE_TURN.PlayerStart; } @@ -113,9 +120,11 @@ if (keyboard_check_pressed(vk_enter) && fading_strength == 0) { turn_stage = eBATTLE_TURN.EnemyStart; } - var _t_end_turn_end = get_timer(); - var _elapsed_ms_turn_end = (_t_end_turn_end - _t_start_turn_end) / 1000; - show_debug_message($"⏱️ Execution Time turn_end: {_elapsed_ms_turn_end}ms"); + if (DEBUG_COMBAT_PERFORMANCE) { + var _t_end_turn_end = get_timer(); + var _elapsed_ms_turn_end = (_t_end_turn_end - _t_start_turn_end) / 1000; + show_debug_message($"⏱️ Execution Time turn_end: {_elapsed_ms_turn_end}ms"); + } } diff --git a/scripts/macros/macros.gml b/scripts/macros/macros.gml index b37510db43..0647e684dd 100644 --- a/scripts/macros/macros.gml +++ b/scripts/macros/macros.gml @@ -10,6 +10,7 @@ #macro CM_RED_COLOR #bf4040 #macro MANAGE_MAN_SEE 34 #macro MANAGE_MAN_MAX array_length(obj_controller.display_unit) + 7 +#macro DEBUG_COMBAT_PERFORMANCE false enum luck { bad = -1, diff --git a/scripts/scr_clean/scr_clean.gml b/scripts/scr_clean/scr_clean.gml index 2cdbe44ac0..55f348291a 100644 --- a/scripts/scr_clean/scr_clean.gml +++ b/scripts/scr_clean/scr_clean.gml @@ -17,7 +17,7 @@ function scr_clean(target_object, weapon_data) { exit; } - if (DEBUG_ENEMY_TARGET_SELECTION) { + if (DEBUG_COMBAT_PERFORMANCE) { var _t_start = get_timer(); } @@ -85,13 +85,13 @@ function scr_clean(target_object, weapon_data) { } valid_vehicles = array_shuffle(valid_vehicles); - if (DEBUG_ENEMY_TARGET_SELECTION) { + if (DEBUG_COMBAT_PERFORMANCE) { var _t_end = get_timer(); var _elapsed_ms = (_t_end - _t_start) / 1000; show_debug_message($"⏱️ {hostile_weapon} enemy target validation took: {_elapsed_ms}ms"); } - if (DEBUG_ENEMY_TARGET_SELECTION) { + if (DEBUG_COMBAT_PERFORMANCE) { var _t_start = get_timer(); } @@ -281,7 +281,7 @@ function scr_clean(target_object, weapon_data) { } } - if (DEBUG_ENEMY_TARGET_SELECTION) { + if (DEBUG_COMBAT_PERFORMANCE) { var _t_end = get_timer(); var _elapsed_ms = (_t_end - _t_start) / 1000; show_debug_message($"⏱️ {hostile_weapon} enemy damage allocation took: {_elapsed_ms}ms"); diff --git a/scripts/scr_en_weapon/scr_en_weapon.gml b/scripts/scr_en_weapon/scr_en_weapon.gml index db056ce3b9..0606ebf438 100644 --- a/scripts/scr_en_weapon/scr_en_weapon.gml +++ b/scripts/scr_en_weapon/scr_en_weapon.gml @@ -150,228 +150,228 @@ function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _uni if (obj_ncombat.enemy = 6) { - if (argument0 = "Fusion Gun"){ + if (_weapon_name = "Fusion Gun"){ _attack = 180; _piercing = 1; _range = 2; _ammo = 4; } - if (argument0 = "Firepike") { + if (_weapon_name = "Firepike") { _attack = 150; _piercing = 1; _range = 4; _ammo = 4; } - if (argument0 = "Singing Spear") { + if (_weapon_name = "Singing Spear") { _attack = 150; _piercing = 0; _range = 1; _shot_count = 3; } - if (argument0 = "Singing Spear Throw") { + if (_weapon_name = "Singing Spear Throw") { _attack = 120; _piercing = 0; _range = 2; _shot_count = 3; } - if (argument0 = "Witchblade") { + if (_weapon_name = "Witchblade") { _attack = 130; _piercing = 0; _range = 1; } - if (argument0 = "Psyshock") { + if (_weapon_name = "Psyshock") { _attack = 50; _piercing = 0; _range = 2; } - if (argument0 = "Wailing Doom") { + if (_weapon_name = "Wailing Doom") { _attack = 200; _piercing = 1; _range = 1; _shot_count = 3; } - if (argument0 = "Avatar Smite") { + if (_weapon_name = "Avatar Smite") { _attack = 300; _piercing = 1; _range = 2; _ammo = 2; } - if (argument0 = "Ranger Long Rifle") { + if (_weapon_name = "Ranger Long Rifle") { _attack = 60; _piercing = 0; _range = 25; } - if (argument0 = "Pathfinder Long Rifle") { + if (_weapon_name = "Pathfinder Long Rifle") { _attack = 70; _piercing = 0; _range = 25; } - if (argument0 = "Shuriken Catapult") { + if (_weapon_name = "Shuriken Catapult") { _attack = 50; _piercing = 0; _range = 2; } - if (argument0 = "Twin Linked Shuriken Catapult") { + if (_weapon_name = "Twin Linked Shuriken Catapult") { _attack = 100; _piercing = 0; _range = 2; } - if (argument0 = "Avenger Shuriken Catapult") { + if (_weapon_name = "Avenger Shuriken Catapult") { _attack = 90; _piercing = 0; _range = 3; } - if (argument0 = "Power Weapon") or(argument0 = "Power Blades") { + if (_weapon_name = "Power Weapon") or(_weapon_name = "Power Blades") { _attack = 100; _piercing = 1; _range = 1; _shot_count = 3; } - if (argument0 = "Shuriken Pistol") { + if (_weapon_name = "Shuriken Pistol") { _attack = 50; _piercing = 0; _range = 2.1; } - if (argument0 = "Executioner") { + if (_weapon_name = "Executioner") { _attack = 150; _piercing = 1; _range = 1; } - if (argument0 = "Scorpion Chainsword") { + if (_weapon_name = "Scorpion Chainsword") { _attack = 100; _piercing = 0; _range = 1; _shot_count = 3; } - if (argument0 = "Mandiblaster") { + if (_weapon_name = "Mandiblaster") { _attack = 60; _piercing = 0; _range = 1; } - if (argument0 = "Biting Blade") { + if (_weapon_name = "Biting Blade") { _attack = 125; _piercing = 0; _range = 1; _shot_count = 3; } - if (argument0 = "Scorpian's Claw") { + if (_weapon_name = "Scorpian's Claw") { _attack = 150; _piercing = 1; _range = 1; _shot_count = 3; } - if (argument0 = "Meltabomb") { + if (_weapon_name = "Meltabomb") { _attack = 200; _piercing = 1; _range = 1; _ammo = 1; } - if (argument0 = "Deathspinner") { + if (_weapon_name = "Deathspinner") { _attack = 125; _piercing = 0; _range = 2; } - if (argument0 = "Dual Deathspinner") { + if (_weapon_name = "Dual Deathspinner") { _attack = 250; _piercing = 0; _range = 2; } - if (argument0 = "Reaper Launcher") { + if (_weapon_name = "Reaper Launcher") { _attack = 120; _piercing = 1; _range = 20; _ammo = 8; _shot_count = 3; } - if (argument0 = "Tempest Launcher") { + if (_weapon_name = "Tempest Launcher") { _attack = 200; _piercing = 0; _range = 15; _ammo = 8; _shot_count = 9; } - if (argument0 = "Laser Lance") { + if (_weapon_name = "Laser Lance") { _attack = 180; _piercing = 1; _range = 2; _shot_count = 3; } - if (argument0 = "Fusion Pistol") { + if (_weapon_name = "Fusion Pistol") { _attack = 125; _piercing = 1; _range = 2.1; _ammo = 4; } - if (argument0 = "Plasma Pistol") { + if (_weapon_name = "Plasma Pistol") { _attack = 100; _piercing = 1; _range = 3.1; } - if (argument0 = "Harlequin's Kiss") { + if (_weapon_name = "Harlequin's Kiss") { _attack = 250; _piercing = 1; _range = 1; _ammo = 1; } - if (argument0 = "Wraithcannon") { + if (_weapon_name = "Wraithcannon") { _attack = 200; _piercing = 1; _range = 2.1; } - if (argument0 = "Pulse Laser") { + if (_weapon_name = "Pulse Laser") { _attack = 120; _piercing = 0; _range = 15; } - if (argument0 = "Bright Lance") { + if (_weapon_name = "Bright Lance") { _attack = 200; _piercing = 1; _range = 8; } - if (argument0 = "Shuriken Cannon") { + if (_weapon_name = "Shuriken Cannon") { _attack = 160; _piercing = 0; _range = 3; } - if (argument0 = "Prism Cannon") { + if (_weapon_name = "Prism Cannon") { _attack = 400; _piercing = 1; _range = 20; _shot_count = 1; } - if (argument0 = "Twin Linked Doomweaver") { + if (_weapon_name = "Twin Linked Doomweaver") { _attack = 250; _piercing = 1; _range = 2; _shot_count = 2; } // Also create difficult terrain? - if (argument0 = "Starcannon") { + if (_weapon_name = "Starcannon") { _attack = 250; _piercing = 1; _range = 8; _shot_count = 4; } - if (argument0 = "Two Power Fists") { + if (_weapon_name = "Two Power Fists") { _attack = 300; _piercing = 1; _range = 1; _shot_count = 2; } - if (argument0 = "Flamer") { + if (_weapon_name = "Flamer") { _attack = 200; _piercing = 0; _range = 2; _ammo = 4; _shot_count = 3; } - if (argument0 = "Titan Starcannon") { + if (_weapon_name = "Titan Starcannon") { _attack = 500; _piercing = 1; _range = 4; _shot_count = 8; } - if (argument0 = "Phantom Pulsar") { + if (_weapon_name = "Phantom Pulsar") { _attack = 500; _piercing = 1; _range = 20; @@ -381,19 +381,19 @@ function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _uni if (obj_ncombat.enemy = 7) { - if (argument0 = "Choppa") { + if (_weapon_name = "Choppa") { _attack = 16; _piercing = 4; _range = 1; _shot_count = 2; } - if (argument0 = "Power Klaw") { + if (_weapon_name = "Power Klaw") { _attack = 22; _piercing = 20; _range = 1; _shot_count = 2; } - if (argument0 = "Slugga") { + if (_weapon_name = "Slugga") { _attack = 20; _piercing = 0; _range = 2; @@ -401,7 +401,7 @@ function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _uni _shot_count = 3; _reload = 1; } - if (argument0 = "Tankbusta Bomb") { + if (_weapon_name = "Tankbusta Bomb") { _attack = 65; _piercing = 16; _range = 1; @@ -409,7 +409,7 @@ function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _uni _shot_count = 1; _reload = -1; } - if (argument0 = "Big Shoota") { + if (_weapon_name = "Big Shoota") { _attack = 24; _piercing = 4; _range = 8; @@ -417,7 +417,7 @@ function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _uni _shot_count = 10; _reload = 2; } - if (argument0 = "Dakkagun") { + if (_weapon_name = "Dakkagun") { _attack = 24; _piercing = 4; _range = 8; @@ -425,7 +425,7 @@ function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _uni _shot_count = 7; _reload = 3; } - if (argument0 = "Deffgun") { + if (_weapon_name = "Deffgun") { _attack = 30; _piercing = 4; _range = 10; @@ -433,7 +433,7 @@ function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _uni _shot_count = 8; _reload = 2; } - if (argument0 = "Snazzgun") { + if (_weapon_name = "Snazzgun") { _attack = 30; _piercing = 10; _range = 11; @@ -441,7 +441,7 @@ function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _uni _shot_count = 2; _reload = 2; } - if (argument0 = "Grot Blasta") { + if (_weapon_name = "Grot Blasta") { _attack = 14; _piercing = 0; _range = 2; @@ -449,7 +449,7 @@ function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _uni _shot_count = 2; _reload = 2; } - if (argument0 = "Kannon") { + if (_weapon_name = "Kannon") { _attack = 45; _piercing = 12; _range = 20; @@ -457,7 +457,7 @@ function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _uni _shot_count = 5; _reload = 1; } - if (argument0 = "Shoota") { + if (_weapon_name = "Shoota") { _attack = 20; _piercing = 0; _ammo = 10; @@ -465,7 +465,15 @@ function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _uni _shot_count = 3; _reload = 1; } - if (argument0 = "Burna") { + if (_weapon_name = "Twin-Linked Shoota") { + _attack = 20; + _piercing = 0; + _ammo = 10; + _range = 7; + _shot_count = 3; + _reload = 1; + } + if (_weapon_name = "Burna") { _attack = 22; _piercing = 4; _range = 3; @@ -473,7 +481,7 @@ function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _uni _shot_count = 6; _reload = 2; } - if (argument0 = "Skorcha") { + if (_weapon_name = "Skorcha") { _attack = 25; _piercing = 6; _range = 4; @@ -481,7 +489,7 @@ function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _uni _shot_count = 8; _reload = 2; } - if (argument0 = "Rokkit Launcha") { + if (_weapon_name = "Rokkit Launcha") { _attack = 45; _piercing = 18; _range = 16; @@ -560,35 +568,35 @@ function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _uni if (obj_ncombat.enemy = 9) { - if (argument0 = "Bonesword") { + if (_weapon_name = "Bonesword") { _attack = 120; _piercing = 1; _range = 1; _shot_count = 3; } - if (argument0 = "Lash Whip") { + if (_weapon_name = "Lash Whip") { _attack = 100; _piercing = 0; _range = 2; } - if (argument0 = "Heavy Venom Cannon") { + if (_weapon_name = "Heavy Venom Cannon") { _attack = 200; _piercing = 1; _range = 8; } - if (argument0 = "Crushing Claws") { + if (_weapon_name = "Crushing Claws") { _attack = 150; _piercing = 1; _range = 1; _shot_count = 3; } - if (argument0 = "Rending Claws") { + if (_weapon_name = "Rending Claws") { _attack = 80; _piercing = 1; _range = 1; _shot_count = 3; } - if (argument0 = "Devourer") { + if (_weapon_name = "Devourer") { _attack = 90; _piercing = 0; _range = 5; @@ -597,24 +605,24 @@ function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _uni _attack = 180; } } - if (argument0 = "Zoanthrope Blast") { + if (_weapon_name = "Zoanthrope Blast") { _attack = 250; _piercing = 1; _range = 6; _shot_count = 1; } - if (argument0 = "Carnifex Claws") { + if (_weapon_name = "Carnifex Claws") { _attack = 200; _piercing = 1; _range = 1; _shot_count = 3; } - if (argument0 = "Venom Cannon") { + if (_weapon_name = "Venom Cannon") { _attack = 100; _piercing = 1; _range = 5; } - if (argument0 = "Deathspitter") { + if (_weapon_name = "Deathspitter") { _attack = 100; _piercing = 0; _range = 2.1; @@ -622,7 +630,7 @@ function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _uni _attack = 150; } } - if (argument0 = "Fleshborer") { + if (_weapon_name = "Fleshborer") { _attack = 70; _piercing = 0; _range = 2.1; @@ -630,34 +638,34 @@ function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _uni _attack = 19; } } - if (argument0 = "Scything Talons") { + if (_weapon_name = "Scything Talons") { _attack = 50; _piercing = 0; _range = 1; } - if (argument0 = "Genestealer Claws") { + if (_weapon_name = "Genestealer Claws") { _attack = 70; _piercing = 1; _range = 1; } - if (argument0 = "Witchfire") { + if (_weapon_name = "Witchfire") { _attack = 100; _piercing = 1; _range = 2; } - if (argument0 = "Autogun") { + if (_weapon_name = "Autogun") { _attack = 60; _piercing = 0; _range = 6; _ammo = 12; _shot_count = 3; } - if (argument0 = "Lictor Claws") { + if (_weapon_name = "Lictor Claws") { _attack = 300; _piercing = 1; _range = 1; } - if (argument0 = "Flesh Hooks") { + if (_weapon_name = "Flesh Hooks") { _attack = 100; _piercing = 0; _range = 2; @@ -668,103 +676,103 @@ function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _uni if (obj_ncombat.enemy >= 10) or(obj_ncombat.enemy = 2) or(obj_ncombat.enemy = 5) or(obj_ncombat.enemy = 1) { - if (argument0 = "Plasma Pistol") { + if (_weapon_name = "Plasma Pistol") { _attack = 70; _piercing = 1; _range = 3.1; } - if (argument0 = "Power Weapon") { + if (_weapon_name = "Power Weapon") { _attack = 120; _piercing = 1; _range = 1; } - if (argument0 = "Power Sword") { + if (_weapon_name = "Power Sword") { _attack = 120; _piercing = 1; _range = 1; } - if (argument0 = "Force Weapon") { + if (_weapon_name = "Force Weapon") { _attack = 250; _piercing = 1; _range = 1; } - if (argument0 = "Chainfist") { + if (_weapon_name = "Chainfist") { _attack = 300; _piercing = 1; _range = 1; _shot_count = 3; } - if (argument0 = "Meltagun") { + if (_weapon_name = "Meltagun") { _attack = 200; _piercing = 1; _range = 2; _ammo = 4; } - if (argument0 = "Flamer") { + if (_weapon_name = "Flamer") { _attack = 160; _piercing = 0; _range = 2.1; _ammo = 4; _shot_count = 3; } - if (argument0 = "Heavy Flamer") { + if (_weapon_name = "Heavy Flamer") { _attack = 200; _piercing = 0; _range = 2.1; _ammo = 6; _shot_count = 3; } - if (argument0 = "Combi-Flamer") { + if (_weapon_name = "Combi-Flamer") { _attack = 160; _piercing = 0; _range = 2.1; _ammo = 1; _shot_count = 3; } - if (argument0 = "Bolter") { + if (_weapon_name = "Bolter") { _attack = 120; _piercing = 0; _range = 12; _ammo = 15; if (obj_ncombat.enemy = 5) then _attack = 80; } // Bursts - if (argument0 = "Power Fist") { + if (_weapon_name = "Power Fist") { _attack = 250; _piercing = 1; _range = 1; } - if (argument0 = "Possessed Claws") { + if (_weapon_name = "Possessed Claws") { _attack = 150; _piercing = 0; _range = 1; _shot_count = 3; } - if (argument0 = "Missile Launcher") { + if (_weapon_name = "Missile Launcher") { _attack = 200; _piercing = 0; _range = 20; _ammo = 4; } - if (argument0 = "Chainsword") { + if (_weapon_name = "Chainsword") { _attack = 120; _piercing = 0; _range = 1; _shot_count = 4; } - if (argument0 = "Bolt Pistol") { + if (_weapon_name = "Bolt Pistol") { _attack = 100; _piercing = 0; _range = 3.1; _ammo = 18; _shot_count = 1; } - if (argument0 = "Chainaxe") { + if (_weapon_name = "Chainaxe") { _attack = 140; _piercing = 0; _range = 1; _shot_count = 3; } - if (argument0 = "Poisoned Chainsword") { + if (_weapon_name = "Poisoned Chainsword") { _attack = 150; _piercing = 0; _range = 1; @@ -773,105 +781,105 @@ function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _uni _attack = 180; } } - if (argument0 = "Sonic Blaster") { + if (_weapon_name = "Sonic Blaster") { _attack = 150; _piercing = 0; _range = 3; _shot_count = 6; } - if (argument0 = "Rubric Bolter") { + if (_weapon_name = "Rubric Bolter") { _attack = 150; _piercing = 0; _range = 12; _ammo = 15; _shot_count = 5; } // Bursts - if (argument0 = "Witchfire") { + if (_weapon_name = "Witchfire") { _attack = 200; _piercing = 1; _range = 5.1; _shot_count = 1; } - if (argument0 = "Autogun") { + if (_weapon_name = "Autogun") { _attack = 60; _piercing = 0; _range = 6; _ammo = 12; } - if (argument0 = "Storm Bolter") { + if (_weapon_name = "Storm Bolter") { _attack = 180; _piercing = 0; _range = 8; _ammo = 10; _shot_count = 3; } - if (argument0 = "Lascannon") { + if (_weapon_name = "Lascannon") { _attack = 300; _piercing = 1; _range = 20; _ammo = 8; _shot_count = 1; } - if (argument0 = "Twin Linked Heavy Bolters") { + if (_weapon_name = "Twin Linked Heavy Bolters") { _attack = 240; _piercing = 0; _range = 16; _shot_count = 3; } - if (argument0 = "Twin-Linked Heavy Bolters") { + if (_weapon_name = "Twin-Linked Heavy Bolters") { _attack = 240; _piercing = 0; _range = 16; _shot_count = 3; } - if (argument0 = "Twin Linked Lascannon") { + if (_weapon_name = "Twin Linked Lascannon") { _attack = 600; _piercing = 1; _range = 20; _shot_count = 2; } - if (argument0 = "Twin-Linked Lascannon") { + if (_weapon_name = "Twin-Linked Lascannon") { _attack = 600; _piercing = 1; _range = 20; _shot_count = 2; } - if (argument0 = "Battle Cannon") { + if (_weapon_name = "Battle Cannon") { _attack = 300; _piercing = 0; _range = 12; } - if (argument0 = "Demolisher Cannon") { + if (_weapon_name = "Demolisher Cannon") { _attack = 500; _piercing = 1; _range = 2; _shot_count = 8; if (instance_exists(obj_nfort)) then _range = 5; } - if (argument0 = "Earthshaker Cannon") { + if (_weapon_name = "Earthshaker Cannon") { _attack = 250; _piercing = 0; _range = 12; _shot_count = 8; } - if (argument0 = "Havoc Launcher") { + if (_weapon_name = "Havoc Launcher") { _attack = 300; _piercing = 0; _range = 12; _shot_count = 12; } - if (argument0 = "Baleflame") { + if (_weapon_name = "Baleflame") { _attack = 225; _piercing = 1; _range = 2; } - if (argument0 = "Defiler Claws") { + if (_weapon_name = "Defiler Claws") { _attack = 350; _piercing = 1; _range = 1; _shot_count = 3; } - if (argument0 = "Reaper Autocannon") { + if (_weapon_name = "Reaper Autocannon") { _attack = 320; _piercing = 0; _range = 18; @@ -897,40 +905,40 @@ function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _uni _range = 10; } - if (argument0 = "Blessed Weapon") { + if (_weapon_name = "Blessed Weapon") { _attack = 150; _piercing = 1; _range = 1; } - if (argument0 = "Electro-Flail") { + if (_weapon_name = "Electro-Flail") { _attack = 125; _piercing = 0; _range = 1; _shot_count = 3; } - if (argument0 = "Neural Whip") { + if (_weapon_name = "Neural Whip") { _attack = 85; _piercing = 0; _range = 1; _shot_count = 3 } - if (argument0 = "Sarissa") { + if (_weapon_name = "Sarissa") { _attack = 65; _piercing = 0; _range = 2; } - if (argument0 = "Seraphim Pistols") { + if (_weapon_name = "Seraphim Pistols") { _attack = 120; _piercing = 0; _range = 4; } - if (argument0 = "Laser Mace") { + if (_weapon_name = "Laser Mace") { _attack = 150; _piercing = 0; _range = 5.1; _ammo = 3; } - if (argument0 = "Heavy Bolter") { + if (_weapon_name = "Heavy Bolter") { _attack = 120; _piercing = 0; _range = 16; @@ -1044,6 +1052,10 @@ function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _uni } } + if (_shot_count == 0) { + exit; + } + // if (faith_bonus = 1) then _attack = _attack * 2; // if (faith_bonus = 2) then _attack = _attack * 3; _attack = round(_attack * obj_ncombat.global_defense); @@ -1056,7 +1068,7 @@ function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _uni // } // } - if (!_unit_type && _ammo > 0) { + if (_unit_type == 1 && _ammo > 0) { _ammo *= 2; } diff --git a/scripts/scr_enunit_scripts/scr_enunit_scripts.gml b/scripts/scr_enunit_scripts/scr_enunit_scripts.gml index 3ada8bfa39..a4ed87250d 100644 --- a/scripts/scr_enunit_scripts/scr_enunit_scripts.gml +++ b/scripts/scr_enunit_scripts/scr_enunit_scripts.gml @@ -21,12 +21,10 @@ function enunit_target_and_shoot() { _target_unit_index = _alpha_strike[1]; } - //In melee check - engaged = collision_point(x - 10, y, obj_pnunit, 0, 1) || collision_point(x + 10, y, obj_pnunit, 0, 1); // show_debug_message($"target_block is in melee {engaged}") - if (!engaged) { - if (DEBUG_COLUMN_PRIORITY_ENEMY) { + if (!engaged()) { + if (DEBUG_COMBAT_PERFORMANCE) { var _t_start1 = get_timer(); } @@ -35,10 +33,10 @@ function enunit_target_and_shoot() { for (var i = 0, _ranged_len = array_length(_ranged_weapons); i < _ranged_len; i++) { var _weapon_stack = _ranged_weapons[i]; - if (!pnunit_is_valid(target_block, obj_pnunit)) { + if (!pnunit_is_valid(target_block)) { log_error($"Invalid player block was found by a ranged target_block!"); target_block = _block_direction(); - if (!pnunit_is_valid(target_block, obj_pnunit)) { + if (!pnunit_is_valid(target_block)) { log_error($"Two invalid player blocks were found by a ranged target_block! Exiting!"); exit; } @@ -46,20 +44,16 @@ function enunit_target_and_shoot() { var dist = get_block_distance(target_block); if (_weapon_stack.range >= dist) { - if (DEBUG_COLUMN_PRIORITY_ENEMY) { - show_debug_message($"{_weapon_stack.weapon_name} IS SHOOTING!"); - } - var _target_priority_queue = ds_priority_create(); - if (DEBUG_COLUMN_PRIORITY_ENEMY) { + if (DEBUG_COMBAT_PERFORMANCE) { var _t_start = get_timer(); } // Scan potential targets var _targets = []; with (obj_pnunit) { - if (pnunit_is_valid(self, obj_pnunit)) { + if (pnunit_is_valid(self)) { array_push(_targets, self.id); } } @@ -83,7 +77,7 @@ function enunit_target_and_shoot() { } } - if (DEBUG_COLUMN_PRIORITY_ENEMY) { + if (DEBUG_COMBAT_PERFORMANCE) { var _t_end = get_timer(); var _elapsed_ms = (_t_end - _t_start) / 1000; show_debug_message($"⏱️ Execution Time: {_elapsed_ms}ms"); @@ -99,6 +93,10 @@ function enunit_target_and_shoot() { _weapon_stack.target_type = eTARGET_TYPE.Fortification; } + if (DEBUG_COLUMN_PRIORITY_ENEMY) { + show_debug_message($"{_weapon_stack.weapon_name} IS SHOOTING!"); + } + scr_shoot(_weapon_stack, _best_target, _target_unit_index); } else { log_error($"{_weapon_stack.weapon_name} didn't find a valid target! This shouldn't happen!"); @@ -112,13 +110,13 @@ function enunit_target_and_shoot() { continue; } } - if (DEBUG_COLUMN_PRIORITY_ENEMY) { + if (DEBUG_COMBAT_PERFORMANCE) { var _t_end1 = get_timer(); var _elapsed_ms1 = (_t_end1 - _t_start1) / 1000; show_debug_message($"⏱️ Enemy Ranged Alarm Execution Time: {_elapsed_ms1}ms"); } } else { - if (DEBUG_COLUMN_PRIORITY_ENEMY) { + if (DEBUG_COMBAT_PERFORMANCE) { var _t_start1 = get_timer(); } @@ -127,7 +125,7 @@ function enunit_target_and_shoot() { for (var i = 0, _wep_len = array_length(_melee_weapons); i < _wep_len; i++) { var _weapon_stack = _melee_weapons[i]; - if (!pnunit_is_valid(target_block, obj_pnunit)) { + if (!pnunit_is_valid(target_block)) { log_error($"Invalid player block was found by a melee target_block!"); exit; } @@ -145,7 +143,7 @@ function enunit_target_and_shoot() { scr_shoot(_weapon_stack, target_block, _target_unit_index); } - if (DEBUG_COLUMN_PRIORITY_ENEMY) { + if (DEBUG_COMBAT_PERFORMANCE) { var _t_end1 = get_timer(); var _elapsed_ms1 = (_t_end1 - _t_start1) / 1000; show_debug_message($"⏱️ Enemy Melee Alarm Execution Time: {_elapsed_ms1}ms"); diff --git a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml index ea4fc6175f..8f01db55dd 100644 --- a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml +++ b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml @@ -71,7 +71,9 @@ function add_data_to_stack (weapon, unit_damage=0, head_role=false, unit="none") /// @mixin function scr_player_combat_weapon_stacks() { - var _t_start_player_weapon_stacks = get_timer(); + if (DEBUG_COMBAT_PERFORMANCE) { + var _t_start_player_weapon_stacks = get_timer(); + } if (defenses=1){ var i=0; @@ -280,9 +282,11 @@ function scr_player_combat_weapon_stacks() { } } - var _t_end_player_weapon_stacks = get_timer(); - var _elapsed_ms_player_weapon_stacks = (_t_end_player_weapon_stacks - _t_start_player_weapon_stacks) / 1000; - show_debug_message($"⏱️ Execution Time player_weapon_stacks: {_elapsed_ms_player_weapon_stacks}ms"); + if (DEBUG_COMBAT_PERFORMANCE) { + var _t_end_player_weapon_stacks = get_timer(); + var _elapsed_ms_player_weapon_stacks = (_t_end_player_weapon_stacks - _t_start_player_weapon_stacks) / 1000; + show_debug_message($"⏱️ Execution Time player_weapon_stacks: {_elapsed_ms_player_weapon_stacks}ms"); + } // Right here should be retreat- if important units are exposed they should try to hop left diff --git a/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml b/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml index 87f738f488..6e2ac4da80 100644 --- a/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml +++ b/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml @@ -108,7 +108,9 @@ function pnunit_target_and_shoot() { /// @mixin function pnunit_battle_effects() { try { - var _t_start_battle_effects = get_timer(); + if (DEBUG_COMBAT_PERFORMANCE) { + var _t_start_battle_effects = get_timer(); + } if (obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) { if (men + dreads + veh <= 0) { @@ -234,9 +236,11 @@ function pnunit_battle_effects() { /* */ /* */ - var _t_end_battle_effects = get_timer(); - var _elapsed_ms_battle_effects = (_t_end_battle_effects - _t_start_battle_effects) / 1000; - show_debug_message($"⏱️ Execution Time battle_effects: {_elapsed_ms_battle_effects}ms"); + if (DEBUG_COMBAT_PERFORMANCE) { + var _t_end_battle_effects = get_timer(); + var _elapsed_ms_battle_effects = (_t_end_battle_effects - _t_start_battle_effects) / 1000; + show_debug_message($"⏱️ Execution Time battle_effects: {_elapsed_ms_battle_effects}ms"); + } } catch (_exception) { handle_exception(_exception); } @@ -315,7 +319,9 @@ function pnunit_dying_process() { } function target_unit_stack(_battle_block, _target_type = -1) { - var _t_start_target_unit_stack = get_timer(); + if (DEBUG_COMBAT_PERFORMANCE) { + var _t_start_target_unit_stack = get_timer(); + } var _biggest_target = noone; var _priority_queue = ds_priority_create(); @@ -341,9 +347,11 @@ function target_unit_stack(_battle_block, _target_type = -1) { ds_priority_destroy(_priority_queue); - var _t_end_target_unit_stack = get_timer(); - var _elapsed_ms_target_unit_stack = (_t_end_target_unit_stack - _t_start_target_unit_stack) / 1000; - show_debug_message($"⏱️ Execution Time target_unit_stack: {_elapsed_ms_target_unit_stack}ms"); + if (DEBUG_COMBAT_PERFORMANCE) { + var _t_end_target_unit_stack = get_timer(); + var _elapsed_ms_target_unit_stack = (_t_end_target_unit_stack - _t_start_target_unit_stack) / 1000; + show_debug_message($"⏱️ Execution Time target_unit_stack: {_elapsed_ms_target_unit_stack}ms"); + } return _biggest_target; } diff --git a/scripts/scr_shoot/scr_shoot.gml b/scripts/scr_shoot/scr_shoot.gml index 2b7e969c24..f9d4098622 100644 --- a/scripts/scr_shoot/scr_shoot.gml +++ b/scripts/scr_shoot/scr_shoot.gml @@ -82,7 +82,6 @@ function scr_shoot(_weapon_stack, _target_object, _target_index) { scr_flavor2((_target_object.hp[1] <= 0), _weapon_stack); } else { _target_object.hostile_shooters = (_shooter == "Assorted") ? 999 : 1; - scr_clean(_target_object, _weapon_stack); } } @@ -109,7 +108,9 @@ function scr_shoot(_weapon_stack, _target_object, _target_index) { obj_ncombat.player_silos -= min(obj_ncombat.player_silos, 30); } - var _t_start_player_scr_shoot = get_timer(); + if (DEBUG_COMBAT_PERFORMANCE) { + var _t_start_player_scr_shoot = get_timer(); + } // Normal shooting var _min_damage = 0.25; @@ -141,10 +142,18 @@ function scr_shoot(_weapon_stack, _target_object, _target_index) { obj_ncombat.enemy_forces--; _casualties++; } + + _target_object.column_size -= _target_stack.unit_size * _casualties; + + if (_target_stack.unit_count <= 0) { + struct_remove(_target_object.unit_stacks, _target_stack.unit_name); + } - var _t_end_player_scr_shoot = get_timer(); - var _elapsed_ms_player_scr_shoot = (_t_end_player_scr_shoot - _t_start_player_scr_shoot) / 1000; - show_debug_message($"⏱️ Execution Time player_scr_shoot: {_elapsed_ms_player_scr_shoot}ms"); + if (DEBUG_COMBAT_PERFORMANCE) { + var _t_end_player_scr_shoot = get_timer(); + var _elapsed_ms_player_scr_shoot = (_t_end_player_scr_shoot - _t_start_player_scr_shoot) / 1000; + show_debug_message($"⏱️ Execution Time player_scr_shoot: {_elapsed_ms_player_scr_shoot}ms"); + } scr_flavor(_weapon_stack, _target_object, _target_stack, _casualties); From 2a0e9de67c89bf8432f87a033b401a2e63b19c1e Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Tue, 22 Apr 2025 17:57:24 +0300 Subject: [PATCH 69/80] Funny js set constructor --- .../scr_struct_functions.gml | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/scripts/scr_struct_functions/scr_struct_functions.gml b/scripts/scr_struct_functions/scr_struct_functions.gml index 575da55180..68d36b8f1f 100644 --- a/scripts/scr_struct_functions/scr_struct_functions.gml +++ b/scripts/scr_struct_functions/scr_struct_functions.gml @@ -48,3 +48,55 @@ function CountingMap() constructor { return struct_exists(map, _key) ? map[$ _key] : 0; }; } + +function Set(_array = []) constructor { + data = ds_map_create(); + + for (var i = 0, l = array_length(_array); i < l; i++) { + ds_map_add(data, _array[i], true); + } + + static add = function(_key) { + return ds_map_add(data, _key, true); + } + + static remove = function(_key) { + ds_map_delete(data, _key); + } + + static clear = function() { + ds_map_clear(data); + } + + static has = function(_key) { + return ds_map_exists(data, _key); + } + + static foreach = function(_callback) { + var _keys = keys(); + for (var i = 0, l = array_length(_keys); i < l; i++) { + var _key = _keys[i]; + _callback(_key); + } + } + + static size = function() { + return ds_map_size(data); + } + + static empty = function() { + return ds_map_empty(data); + } + + static keys = function() { + return ds_map_keys_to_array(data); + } + + static copy = function(_ds_set) { + ds_map_copy(_ds_set, data); + } + + static destroy = function() { + ds_map_destroy(data); + } +} From aa894adba46ab57214e5b605832ecb19e3ee9d2d Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Tue, 22 Apr 2025 22:11:43 +0300 Subject: [PATCH 70/80] Stopwatch function --- ChapterMaster.yyp | 1 + objects/obj_enunit/Create_0.gml | 26 +++++++------------ objects/obj_ncombat/Step_0.gml | 18 +++++-------- scripts/__init_global/__init_global.gml | 1 + scripts/macros/macros.gml | 2 +- scripts/scr_clean/scr_clean.gml | 22 +++++++++------- .../scr_enunit_scripts/scr_enunit_scripts.gml | 18 +++++-------- .../scr_initialize_custom.gml | 25 +----------------- .../scr_misc_functions/scr_misc_functions.gml | 11 ++++++++ .../scr_misc_functions/scr_misc_functions.yy | 13 ++++++++++ .../scr_player_combat_weapon_stacks.gml | 6 ++--- scripts/scr_shoot/scr_shoot.gml | 6 ++--- 12 files changed, 66 insertions(+), 83 deletions(-) create mode 100644 scripts/scr_misc_functions/scr_misc_functions.gml create mode 100644 scripts/scr_misc_functions/scr_misc_functions.yy diff --git a/ChapterMaster.yyp b/ChapterMaster.yyp index a74464c898..7dafb04bbb 100644 --- a/ChapterMaster.yyp +++ b/ChapterMaster.yyp @@ -786,6 +786,7 @@ {"id":{"name":"scr_marine_struct","path":"scripts/scr_marine_struct/scr_marine_struct.yy",},}, {"id":{"name":"scr_master_loc","path":"scripts/scr_master_loc/scr_master_loc.yy",},}, {"id":{"name":"scr_max_marine","path":"scripts/scr_max_marine/scr_max_marine.yy",},}, + {"id":{"name":"scr_misc_functions","path":"scripts/scr_misc_functions/scr_misc_functions.yy",},}, {"id":{"name":"scr_mission_eta","path":"scripts/scr_mission_eta/scr_mission_eta.yy",},}, {"id":{"name":"scr_mission_functions","path":"scripts/scr_mission_functions/scr_mission_functions.yy",},}, {"id":{"name":"scr_mission_reward","path":"scripts/scr_mission_reward/scr_mission_reward.yy",},}, diff --git a/objects/obj_enunit/Create_0.gml b/objects/obj_enunit/Create_0.gml index 53b0338c73..16dd2bea0b 100644 --- a/objects/obj_enunit/Create_0.gml +++ b/objects/obj_enunit/Create_0.gml @@ -41,7 +41,7 @@ is_mouse_over = function() { copy_block_composition = function(_composition) { if (DEBUG_COMBAT_PERFORMANCE) { - var _t_start_copy_block_composition = get_timer(); + stopwatch("copy_block_composition"); } if (struct_exists(_composition, "units")) { @@ -88,15 +88,13 @@ copy_block_composition = function(_composition) { } if (DEBUG_COMBAT_PERFORMANCE) { - var _t_end_copy_block_composition = get_timer(); - var _elapsed_ms_copy_block_composition = (_t_end_copy_block_composition - _t_start_copy_block_composition) / 1000; - show_debug_message($"⏱️ Execution Time copy_block_composition: {_elapsed_ms_copy_block_composition}ms"); + stopwatch("copy_block_composition"); } }; assign_weapon_stacks = function() { if (DEBUG_COMBAT_PERFORMANCE) { - var _t_start_enemy_weapon_stacks = get_timer(); + stopwatch("assign_enemy_weapon_stacks"); } var _unit_stack_names = struct_get_names(unit_stacks); @@ -110,16 +108,14 @@ assign_weapon_stacks = function() { } if (DEBUG_COMBAT_PERFORMANCE) { - var _t_end_enemy_weapon_stacks = get_timer(); - var _elapsed_ms_enemy_weapon_stacks = (_t_end_enemy_weapon_stacks - _t_start_enemy_weapon_stacks) / 1000; - show_debug_message($"⏱️ Execution Time enemy_weapon_stacks: {_elapsed_ms_enemy_weapon_stacks}ms"); + stopwatch("assign_enemy_weapon_stacks"); } } unit_count = function() { - if (DEBUG_COMBAT_PERFORMANCE) { - var _t_start_unit_count = get_timer(); - } + // if (DEBUG_COMBAT_PERFORMANCE) { + // stopwatch("unit_count"); + // } var _unit_count = 0; @@ -131,11 +127,9 @@ unit_count = function() { _unit_count += _unit_stack.unit_count; } - if (DEBUG_COMBAT_PERFORMANCE) { - var _t_end_unit_count = get_timer(); - var _elapsed_ms_unit_count = (_t_end_unit_count - _t_start_unit_count) / 1000; - show_debug_message($"⏱️ Execution Time unit_count: {_elapsed_ms_unit_count}ms"); - } + // if (DEBUG_COMBAT_PERFORMANCE) { + // stopwatch("unit_count"); + // } return _unit_count; }; diff --git a/objects/obj_ncombat/Step_0.gml b/objects/obj_ncombat/Step_0.gml index 3ebf17df0d..ee0ffc37f5 100644 --- a/objects/obj_ncombat/Step_0.gml +++ b/objects/obj_ncombat/Step_0.gml @@ -8,7 +8,7 @@ if (wall_destroyed == true) { if (battle_stage == eBATTLE_STAGE.Creation) { if (DEBUG_COMBAT_PERFORMANCE) { - var _t_start_creation_stage = get_timer(); + stopwatch("BATTLE_STAGE.Creation"); } ncombat_enemy_stacks_init(); @@ -38,16 +38,14 @@ if (battle_stage == eBATTLE_STAGE.Creation) { } if (DEBUG_COMBAT_PERFORMANCE) { - var _t_end_creation_stage = get_timer(); - var _elapsed_ms_creation_stage = (_t_end_creation_stage - _t_start_creation_stage) / 1000; - show_debug_message($"⏱️ Execution Time creation_stage: {_elapsed_ms_creation_stage}ms"); + stopwatch("BATTLE_STAGE.Creation"); } } if ((press_exclusive(vk_enter) || hold_exclusive(vk_enter)) && fading_strength == 0) { if (turn_stage == eBATTLE_TURN.PlayerStart || turn_stage == eBATTLE_TURN.EnemyStart) { if (DEBUG_COMBAT_PERFORMANCE) { - var _t_start_turn_start = get_timer(); + stopwatch("BATTLE_TURN.Start"); } turn_count++; @@ -89,15 +87,13 @@ if ((press_exclusive(vk_enter) || hold_exclusive(vk_enter)) && fading_strength = turn_stage = (turn_stage == eBATTLE_TURN.PlayerStart) ? eBATTLE_TURN.PlayerEnd : eBATTLE_TURN.EnemyEnd; if (DEBUG_COMBAT_PERFORMANCE) { - var _t_end_turn_start = get_timer(); - var _elapsed_ms_turn_start = (_t_end_turn_start - _t_start_turn_start) / 1000; - show_debug_message($"⏱️ Execution Time turn_start: {_elapsed_ms_turn_start}ms"); + stopwatch("BATTLE_TURN.Start"); } } if (turn_stage == eBATTLE_TURN.EnemyEnd || turn_stage == eBATTLE_TURN.PlayerEnd) { if (DEBUG_COMBAT_PERFORMANCE) { - var _t_start_turn_end = get_timer(); + stopwatch("BATTLE_TURN.End"); } if (!battle_ended) { @@ -121,9 +117,7 @@ if ((press_exclusive(vk_enter) || hold_exclusive(vk_enter)) && fading_strength = } if (DEBUG_COMBAT_PERFORMANCE) { - var _t_end_turn_end = get_timer(); - var _elapsed_ms_turn_end = (_t_end_turn_end - _t_start_turn_end) / 1000; - show_debug_message($"⏱️ Execution Time turn_end: {_elapsed_ms_turn_end}ms"); + stopwatch("BATTLE_TURN.End"); } } diff --git a/scripts/__init_global/__init_global.gml b/scripts/__init_global/__init_global.gml index e1afd62310..aae0494955 100644 --- a/scripts/__init_global/__init_global.gml +++ b/scripts/__init_global/__init_global.gml @@ -11,4 +11,5 @@ function __init_global() { global.chapter_name = "None"; global.game_seed = 0; global.ui_click_lock = false; + global.stopwatches = ds_map_create(); } diff --git a/scripts/macros/macros.gml b/scripts/macros/macros.gml index 29d6328afe..c1ceb801ba 100644 --- a/scripts/macros/macros.gml +++ b/scripts/macros/macros.gml @@ -10,7 +10,7 @@ #macro CM_RED_COLOR #bf4040 #macro MANAGE_MAN_SEE 34 #macro MANAGE_MAN_MAX array_length(obj_controller.display_unit) + 7 -#macro DEBUG_COMBAT_PERFORMANCE false +#macro DEBUG_COMBAT_PERFORMANCE true #macro STR_ANY_POWER_ARMOUR "Any Power Armour" #macro STR_ANY_TERMINATOR_ARMOUR "Any Terminator Armour" diff --git a/scripts/scr_clean/scr_clean.gml b/scripts/scr_clean/scr_clean.gml index 55f348291a..2a5f840496 100644 --- a/scripts/scr_clean/scr_clean.gml +++ b/scripts/scr_clean/scr_clean.gml @@ -18,7 +18,7 @@ function scr_clean(target_object, weapon_data) { } if (DEBUG_COMBAT_PERFORMANCE) { - var _t_start = get_timer(); + stopwatch("player_units_validation"); } var armour_pierce = weapon_data.piercing; @@ -86,13 +86,11 @@ function scr_clean(target_object, weapon_data) { valid_vehicles = array_shuffle(valid_vehicles); if (DEBUG_COMBAT_PERFORMANCE) { - var _t_end = get_timer(); - var _elapsed_ms = (_t_end - _t_start) / 1000; - show_debug_message($"⏱️ {hostile_weapon} enemy target validation took: {_elapsed_ms}ms"); + stopwatch("player_units_validation"); } if (DEBUG_COMBAT_PERFORMANCE) { - var _t_start = get_timer(); + stopwatch("player_damage_allocation"); } if (target_type == eTARGET_TYPE.Armour && array_empty(valid_vehicles)) { @@ -282,11 +280,7 @@ function scr_clean(target_object, weapon_data) { } if (DEBUG_COMBAT_PERFORMANCE) { - var _t_end = get_timer(); - var _elapsed_ms = (_t_end - _t_start) / 1000; - show_debug_message($"⏱️ {hostile_weapon} enemy damage allocation took: {_elapsed_ms}ms"); - show_debug_message($"Hits: {hits}"); - show_debug_message($"Kills: {units_lost}"); + stopwatch("player_damage_allocation"); } // Flavour battle-log message @@ -334,6 +328,10 @@ function compress_enemy_array(_target_column) { return; } + if (DEBUG_COMBAT_PERFORMANCE) { + stopwatch("compress_enemy_array"); + } + with(_target_column) { // Define all data arrays to be processed with their default values var _data_arrays = [{ @@ -382,6 +380,10 @@ function compress_enemy_array(_target_column) { } } } + + if (DEBUG_COMBAT_PERFORMANCE) { + stopwatch("compress_enemy_array"); + } } /// @function destroy_empty_column diff --git a/scripts/scr_enunit_scripts/scr_enunit_scripts.gml b/scripts/scr_enunit_scripts/scr_enunit_scripts.gml index a4ed87250d..65a152b30b 100644 --- a/scripts/scr_enunit_scripts/scr_enunit_scripts.gml +++ b/scripts/scr_enunit_scripts/scr_enunit_scripts.gml @@ -25,7 +25,7 @@ function enunit_target_and_shoot() { if (!engaged()) { if (DEBUG_COMBAT_PERFORMANCE) { - var _t_start1 = get_timer(); + stopwatch("enunit_shooting"); } // Shooting @@ -47,7 +47,7 @@ function enunit_target_and_shoot() { var _target_priority_queue = ds_priority_create(); if (DEBUG_COMBAT_PERFORMANCE) { - var _t_start = get_timer(); + stopwatch("enunit_column_picking"); } // Scan potential targets @@ -78,9 +78,7 @@ function enunit_target_and_shoot() { } if (DEBUG_COMBAT_PERFORMANCE) { - var _t_end = get_timer(); - var _elapsed_ms = (_t_end - _t_start) / 1000; - show_debug_message($"⏱️ Execution Time: {_elapsed_ms}ms"); + stopwatch("enunit_column_picking"); } // Shoot highest-priority target @@ -111,13 +109,11 @@ function enunit_target_and_shoot() { } } if (DEBUG_COMBAT_PERFORMANCE) { - var _t_end1 = get_timer(); - var _elapsed_ms1 = (_t_end1 - _t_start1) / 1000; - show_debug_message($"⏱️ Enemy Ranged Alarm Execution Time: {_elapsed_ms1}ms"); + stopwatch("enunit_shooting"); } } else { if (DEBUG_COMBAT_PERFORMANCE) { - var _t_start1 = get_timer(); + stopwatch("enunit_melee"); } // Melee @@ -144,9 +140,7 @@ function enunit_target_and_shoot() { } if (DEBUG_COMBAT_PERFORMANCE) { - var _t_end1 = get_timer(); - var _elapsed_ms1 = (_t_end1 - _t_start1) / 1000; - show_debug_message($"⏱️ Enemy Melee Alarm Execution Time: {_elapsed_ms1}ms"); + stopwatch("enunit_melee"); } } //! Here was some stuff that depended on image_index here, that got deleted, because I couldn't figure out why it exists; diff --git a/scripts/scr_initialize_custom/scr_initialize_custom.gml b/scripts/scr_initialize_custom/scr_initialize_custom.gml index 6f541cbee9..62cee7be9f 100644 --- a/scripts/scr_initialize_custom/scr_initialize_custom.gml +++ b/scripts/scr_initialize_custom/scr_initialize_custom.gml @@ -2062,30 +2062,7 @@ function scr_initialize_custom() { ], } } - }], - [roles.sergeant, { - "max": 1, - "min": 1, //sergeant - "loadout": { - "required": { - "wep1": ["Bolt Pistol", 0], - "wep2": ["Chainsword", 0], - }, - "option": { - "wep1": [ - [ - ["Power Sword", "Thunder Hammer", "Power Fist", "Chainsword"], 1 - ] - ], - "wep2": [ - [ - ["Plasma Pistol", "Combiflamer", "Meltagun"], 1 - ] - ] - } - } - } - ] + }] } if (scr_has_adv("Lightning Warriors")) { diff --git a/scripts/scr_misc_functions/scr_misc_functions.gml b/scripts/scr_misc_functions/scr_misc_functions.gml new file mode 100644 index 0000000000..0a2015a92c --- /dev/null +++ b/scripts/scr_misc_functions/scr_misc_functions.gml @@ -0,0 +1,11 @@ +/// @param {String} _name +function stopwatch(_name) { + if (!ds_map_exists(global.stopwatches, _name)) { + ds_map_add(global.stopwatches, _name, get_timer()); + } else { + var _time_elapsed = (get_timer() - global.stopwatches[? _name]) / 1000; + ds_map_delete(global.stopwatches, _name); + show_debug_message($"⏱️ Stopwatch {_name}: {_time_elapsed}ms"); + return _time_elapsed; + } +} diff --git a/scripts/scr_misc_functions/scr_misc_functions.yy b/scripts/scr_misc_functions/scr_misc_functions.yy new file mode 100644 index 0000000000..f3f9f2efba --- /dev/null +++ b/scripts/scr_misc_functions/scr_misc_functions.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"scr_misc_functions", + "isCompatibility":false, + "isDnD":false, + "name":"scr_misc_functions", + "parent":{ + "name":"Scripts", + "path":"folders/Scripts.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml index 9101a2b368..4e075d1950 100644 --- a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml +++ b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml @@ -72,7 +72,7 @@ function add_data_to_stack (weapon, unit_damage=0, head_role=false, unit="none") /// @mixin function scr_player_combat_weapon_stacks() { if (DEBUG_COMBAT_PERFORMANCE) { - var _t_start_player_weapon_stacks = get_timer(); + stopwatch("scr_player_combat_weapon_stacks"); } if (defenses=1){ @@ -283,9 +283,7 @@ function scr_player_combat_weapon_stacks() { } if (DEBUG_COMBAT_PERFORMANCE) { - var _t_end_player_weapon_stacks = get_timer(); - var _elapsed_ms_player_weapon_stacks = (_t_end_player_weapon_stacks - _t_start_player_weapon_stacks) / 1000; - show_debug_message($"⏱️ Execution Time player_weapon_stacks: {_elapsed_ms_player_weapon_stacks}ms"); + stopwatch("scr_player_combat_weapon_stacks"); } diff --git a/scripts/scr_shoot/scr_shoot.gml b/scripts/scr_shoot/scr_shoot.gml index f9d4098622..8ad959910b 100644 --- a/scripts/scr_shoot/scr_shoot.gml +++ b/scripts/scr_shoot/scr_shoot.gml @@ -109,7 +109,7 @@ function scr_shoot(_weapon_stack, _target_object, _target_index) { } if (DEBUG_COMBAT_PERFORMANCE) { - var _t_start_player_scr_shoot = get_timer(); + stopwatch("player_scr_shoot"); } // Normal shooting @@ -150,9 +150,7 @@ function scr_shoot(_weapon_stack, _target_object, _target_index) { } if (DEBUG_COMBAT_PERFORMANCE) { - var _t_end_player_scr_shoot = get_timer(); - var _elapsed_ms_player_scr_shoot = (_t_end_player_scr_shoot - _t_start_player_scr_shoot) / 1000; - show_debug_message($"⏱️ Execution Time player_scr_shoot: {_elapsed_ms_player_scr_shoot}ms"); + stopwatch("player_scr_shoot"); } scr_flavor(_weapon_stack, _target_object, _target_stack, _casualties); From 8a47fcdd8baee3af9b97905bf0820a7e6485c5e2 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Mon, 28 Apr 2025 22:24:19 +0300 Subject: [PATCH 71/80] refactor: Ork weapons to weapon struct --- scripts/scr_en_weapon/scr_en_weapon.gml | 129 ++--------------- scripts/scr_weapon/scr_weapon.gml | 181 +++++++++++++++++++++--- 2 files changed, 174 insertions(+), 136 deletions(-) diff --git a/scripts/scr_en_weapon/scr_en_weapon.gml b/scripts/scr_en_weapon/scr_en_weapon.gml index 0606ebf438..6096b994b2 100644 --- a/scripts/scr_en_weapon/scr_en_weapon.gml +++ b/scripts/scr_en_weapon/scr_en_weapon.gml @@ -23,7 +23,7 @@ function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _uni // faith_bonus = 0; // var struct = gear_weapon_data("weapon",_weapon_name); - if (string_count("elee", _weapon_name) > 0) { + /* if (string_count("elee", _weapon_name) > 0) { _weapon_name = string_delete(_weapon_name, 0, 5); _attack = 10; _piercing = 0; @@ -379,124 +379,6 @@ function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _uni } } - if (obj_ncombat.enemy = 7) { - - if (_weapon_name = "Choppa") { - _attack = 16; - _piercing = 4; - _range = 1; - _shot_count = 2; - } - if (_weapon_name = "Power Klaw") { - _attack = 22; - _piercing = 20; - _range = 1; - _shot_count = 2; - } - if (_weapon_name = "Slugga") { - _attack = 20; - _piercing = 0; - _range = 2; - _ammo = 6; - _shot_count = 3; - _reload = 1; - } - if (_weapon_name = "Tankbusta Bomb") { - _attack = 65; - _piercing = 16; - _range = 1; - _ammo = 1; - _shot_count = 1; - _reload = -1; - } - if (_weapon_name = "Big Shoota") { - _attack = 24; - _piercing = 4; - _range = 8; - _ammo = 6; - _shot_count = 10; - _reload = 2; - } - if (_weapon_name = "Dakkagun") { - _attack = 24; - _piercing = 4; - _range = 8; - _ammo = 14; - _shot_count = 7; - _reload = 3; - } - if (_weapon_name = "Deffgun") { - _attack = 30; - _piercing = 4; - _range = 10; - _ammo = 6; - _shot_count = 8; - _reload = 2; - } - if (_weapon_name = "Snazzgun") { - _attack = 30; - _piercing = 10; - _range = 11; - _ammo = 10; - _shot_count = 2; - _reload = 2; - } - if (_weapon_name = "Grot Blasta") { - _attack = 14; - _piercing = 0; - _range = 2; - _ammo = 4; - _shot_count = 2; - _reload = 2; - } - if (_weapon_name = "Kannon") { - _attack = 45; - _piercing = 12; - _range = 20; - _ammo = 1; - _shot_count = 5; - _reload = 1; - } - if (_weapon_name = "Shoota") { - _attack = 20; - _piercing = 0; - _ammo = 10; - _range = 7; - _shot_count = 3; - _reload = 1; - } - if (_weapon_name = "Twin-Linked Shoota") { - _attack = 20; - _piercing = 0; - _ammo = 10; - _range = 7; - _shot_count = 3; - _reload = 1; - } - if (_weapon_name = "Burna") { - _attack = 22; - _piercing = 4; - _range = 3; - _ammo = 6; - _shot_count = 6; - _reload = 2; - } - if (_weapon_name = "Skorcha") { - _attack = 25; - _piercing = 6; - _range = 4; - _ammo = 6; - _shot_count = 8; - _reload = 2; - } - if (_weapon_name = "Rokkit Launcha") { - _attack = 45; - _piercing = 18; - _range = 16; - _shot_count = 1; - } - } - if (obj_ncombat.enemy = 8) { if (_weapon_name = "Fusion Blaster") { _attack = 150; @@ -1050,7 +932,14 @@ function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _uni _range = 6.1; _shot_count = 3; } - } + } */ + + var _weapon_struct = global.weapons[$ _weapon_name]; + + _attack = _weapon_struct.attack.standard; + _piercing = _weapon_struct.arp; + _range = _weapon_struct.range; + _shot_count = _weapon_struct.spli; if (_shot_count == 0) { exit; diff --git a/scripts/scr_weapon/scr_weapon.gml b/scripts/scr_weapon/scr_weapon.gml index 8aced7112e..f9b000e97c 100644 --- a/scripts/scr_weapon/scr_weapon.gml +++ b/scripts/scr_weapon/scr_weapon.gml @@ -1947,32 +1947,181 @@ global.weapons = { "tags": ["power", "sword", "elder", "xenos"], }, // Ork weapons + "Rokkit Launcha": { + "attack": { + "standard": 45, + "master_crafted": 45, + "artifact": 45 + }, + "range": 16, + "spli": 1, + "arp": 18 + }, + + "Kannon": { + "attack": { + "standard": 45, + "master_crafted": 45, + "artifact": 45 + }, + "range": 20, + "spli": 5, + "arp": 12 + }, + + "Shoota": { + "attack": { + "standard": 20, + "master_crafted": 20, + "artifact": 20 + }, + "range": 7, + "spli": 3, + "arp": 0 + }, + + "Twin-Linked Shoota": { + "attack": { + "standard": 20, + "master_crafted": 20, + "artifact": 20 + }, + "range": 7, + "spli": 3, + "arp": 0 + }, + + "Burna": { + "attack": { + "standard": 22, + "master_crafted": 22, + "artifact": 22 + }, + "range": 3, + "spli": 6, + "arp": 4 + }, + + "Skorcha": { + "attack": { + "standard": 25, + "master_crafted": 25, + "artifact": 25 + }, + "range": 4, + "spli": 8, + "arp": 6 + }, + "Choppa": { - "abbreviation": "Chop", "attack": { - "standard": 100, - "master_crafted": 125, - "artifact": 200 + "standard": 16, + "master_crafted": 16, + "artifact": 16 + }, + "range": 1, + "spli": 2, + "arp": 4 + }, + + "Big Choppa": { + "attack": { + "standard": 22, + "master_crafted": 22, + "artifact": 22 }, - "melee_hands": 1, "range": 1, "spli": 3, - "tags": ["axe"] + "arp": 4 }, - "Snazzgun": { - "abbreviation": "Snazz", + + "Power Klaw": { "attack": { - "standard": 200, - "master_crafted": 230, - "artifact": 280 + "standard": 22, + "master_crafted": 22, + "artifact": 22 }, - "ranged_hands": 1, - "ammo": 20, - "range": 3.1, + "range": 1, + "spli": 2, + "arp": 20 + }, + + "Slugga": { + "attack": { + "standard": 20, + "master_crafted": 20, + "artifact": 20 + }, + "range": 2, "spli": 3, - "arp": 1, - "tags": ["rifle"] + "arp": 0 + }, + + "Tankbusta Bomb": { + "attack": { + "standard": 65, + "master_crafted": 65, + "artifact": 65 + }, + "range": 1, + "spli": 1, + "arp": 16 + }, + + "Big Shoota": { + "attack": { + "standard": 24, + "master_crafted": 24, + "artifact": 24 + }, + "range": 8, + "spli": 10, + "arp": 4 + }, + + "Dakkagun": { + "attack": { + "standard": 24, + "master_crafted": 24, + "artifact": 24 + }, + "range": 8, + "spli": 7, + "arp": 4 + }, + + "Deffgun": { + "attack": { + "standard": 30, + "master_crafted": 30, + "artifact": 30 + }, + "range": 10, + "spli": 8, + "arp": 4 }, + + "Snazzgun": { + "attack": { + "standard": 30, + "master_crafted": 30, + "artifact": 30 + }, + "range": 11, + "spli": 2, + "arp": 10 + }, + + "Grot Blasta": { + "attack": { + "standard": 14, + "master_crafted": 14, + "artifact": 14 + }, + "range": 2, + "spli": 2, + "arp": 0 + } } global.gear = { "armour": { From 1fc3a161c262f5f0236484b58108f95718b9263d Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Mon, 28 Apr 2025 22:27:41 +0300 Subject: [PATCH 72/80] Change performance debugging --- objects/obj_enunit/Create_0.gml | 8 ------ objects/obj_ncombat/Step_0.gml | 27 +++++++++++++++++++ .../scr_enunit_scripts/scr_enunit_scripts.gml | 15 ----------- .../scr_ncombat_scripts.gml | 7 ++++- .../scr_player_combat_weapon_stacks.gml | 8 ------ .../scr_pnunit_scripts/scr_pnunit_scripts.gml | 20 -------------- 6 files changed, 33 insertions(+), 52 deletions(-) diff --git a/objects/obj_enunit/Create_0.gml b/objects/obj_enunit/Create_0.gml index 16dd2bea0b..cf60408b1d 100644 --- a/objects/obj_enunit/Create_0.gml +++ b/objects/obj_enunit/Create_0.gml @@ -40,10 +40,6 @@ is_mouse_over = function() { copy_block_composition = function(_composition) { - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("copy_block_composition"); - } - if (struct_exists(_composition, "units")) { var _units = _composition.units; @@ -86,10 +82,6 @@ copy_block_composition = function(_composition) { } } } - - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("copy_block_composition"); - } }; assign_weapon_stacks = function() { diff --git a/objects/obj_ncombat/Step_0.gml b/objects/obj_ncombat/Step_0.gml index ee0ffc37f5..f0a7b67376 100644 --- a/objects/obj_ncombat/Step_0.gml +++ b/objects/obj_ncombat/Step_0.gml @@ -13,9 +13,15 @@ if (battle_stage == eBATTLE_STAGE.Creation) { ncombat_enemy_stacks_init(); + if (DEBUG_COMBAT_PERFORMANCE) { + stopwatch("scr_player_combat_weapon_stacks"); + } with (obj_pnunit) { scr_player_combat_weapon_stacks(); } + if (DEBUG_COMBAT_PERFORMANCE) { + stopwatch("scr_player_combat_weapon_stacks"); + } with (obj_enunit) { enunit_enemy_profiles_init(); @@ -60,21 +66,42 @@ if ((press_exclusive(vk_enter) || hold_exclusive(vk_enter)) && fading_strength = enunit_enemy_profiles_init(); } move_enemy_blocks(); + + if (DEBUG_COMBAT_PERFORMANCE) { + stopwatch("enunit_create_weapon_stacks"); + } with (obj_enunit) { assign_weapon_stacks(); + } + if (DEBUG_COMBAT_PERFORMANCE) { + stopwatch("enunit_create_weapon_stacks"); + } + if (DEBUG_COMBAT_PERFORMANCE) { + stopwatch("enunit_target_and_shoot"); + } + with (obj_enunit) { enunit_target_and_shoot(); } + if (DEBUG_COMBAT_PERFORMANCE) { + stopwatch("enunit_target_and_shoot"); + } } display_message_queue(); } if (turn_stage == eBATTLE_TURN.PlayerStart) { player_blocks_movement(); + if (DEBUG_COMBAT_PERFORMANCE) { + stopwatch("pnunit_stacking_shooting"); + } with (obj_pnunit) { pnunit_battle_effects(); scr_player_combat_weapon_stacks(); pnunit_target_and_shoot(); } + if (DEBUG_COMBAT_PERFORMANCE) { + stopwatch("pnunit_stacking_shooting"); + } with (obj_enunit) { enunit_enemy_profiles_init(); } diff --git a/scripts/scr_enunit_scripts/scr_enunit_scripts.gml b/scripts/scr_enunit_scripts/scr_enunit_scripts.gml index 65a152b30b..2377f60f28 100644 --- a/scripts/scr_enunit_scripts/scr_enunit_scripts.gml +++ b/scripts/scr_enunit_scripts/scr_enunit_scripts.gml @@ -24,10 +24,6 @@ function enunit_target_and_shoot() { // show_debug_message($"target_block is in melee {engaged}") if (!engaged()) { - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("enunit_shooting"); - } - // Shooting var _ranged_weapons = array_concat(get_valid_weapon_stacks(weapon_stacks_normal, 2, 999), get_valid_weapon_stacks_unique(weapon_stacks_unique, 2, 999), get_valid_weapon_stacks(weapon_stacks_vehicle, 2, 999)); for (var i = 0, _ranged_len = array_length(_ranged_weapons); i < _ranged_len; i++) { @@ -108,14 +104,7 @@ function enunit_target_and_shoot() { continue; } } - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("enunit_shooting"); - } } else { - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("enunit_melee"); - } - // Melee var _melee_weapons = array_concat(get_valid_weapon_stacks(weapon_stacks_normal, 1, 2), get_valid_weapon_stacks_unique(weapon_stacks_unique, 1, 2), get_valid_weapon_stacks(weapon_stacks_vehicle, 1, 999)); for (var i = 0, _wep_len = array_length(_melee_weapons); i < _wep_len; i++) { @@ -138,10 +127,6 @@ function enunit_target_and_shoot() { scr_shoot(_weapon_stack, target_block, _target_unit_index); } - - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("enunit_melee"); - } } //! Here was some stuff that depended on image_index here, that got deleted, because I couldn't figure out why it exists; } diff --git a/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml b/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml index 2e78ff27fd..1407afbdf1 100644 --- a/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml +++ b/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml @@ -1428,13 +1428,18 @@ function ncombat_enemy_stacks_init() { enemy_force_composition = global.army_profiles[$ "orks_6"]; enemy_dudes = enemy_force_composition.description; var _block_count = array_length(enemy_force_composition.columns); + if (DEBUG_COMBAT_PERFORMANCE) { + stopwatch("ncombat_create_enemy_army"); + } for (var b = 0; b < _block_count; b++) { var _pos = 160 + (b * 10); var _block = instance_create(_pos, 240, obj_enunit); _block.copy_block_composition(enemy_force_composition.columns[b]); enemy_forces += _block.unit_count(); } - show_debug_message($"enemy_forces: {enemy_forces}"); + if (DEBUG_COMBAT_PERFORMANCE) { + stopwatch("ncombat_create_enemy_army"); + } } } diff --git a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml index 4e075d1950..9c3add6d54 100644 --- a/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml +++ b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml @@ -71,10 +71,6 @@ function add_data_to_stack (weapon, unit_damage=0, head_role=false, unit="none") /// @mixin function scr_player_combat_weapon_stacks() { - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("scr_player_combat_weapon_stacks"); - } - if (defenses=1){ var i=0; @@ -281,10 +277,6 @@ function scr_player_combat_weapon_stacks() { } } } - - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("scr_player_combat_weapon_stacks"); - } // Right here should be retreat- if important units are exposed they should try to hop left diff --git a/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml b/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml index 6e2ac4da80..f8de0f1e4e 100644 --- a/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml +++ b/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml @@ -108,10 +108,6 @@ function pnunit_target_and_shoot() { /// @mixin function pnunit_battle_effects() { try { - if (DEBUG_COMBAT_PERFORMANCE) { - var _t_start_battle_effects = get_timer(); - } - if (obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) { if (men + dreads + veh <= 0) { //show_debug_message($"column destroyed {x}") @@ -235,12 +231,6 @@ function pnunit_battle_effects() { /* */ /* */ - - if (DEBUG_COMBAT_PERFORMANCE) { - var _t_end_battle_effects = get_timer(); - var _elapsed_ms_battle_effects = (_t_end_battle_effects - _t_start_battle_effects) / 1000; - show_debug_message($"⏱️ Execution Time battle_effects: {_elapsed_ms_battle_effects}ms"); - } } catch (_exception) { handle_exception(_exception); } @@ -319,10 +309,6 @@ function pnunit_dying_process() { } function target_unit_stack(_battle_block, _target_type = -1) { - if (DEBUG_COMBAT_PERFORMANCE) { - var _t_start_target_unit_stack = get_timer(); - } - var _biggest_target = noone; var _priority_queue = ds_priority_create(); var _unit_stacks = _battle_block.unit_stacks; @@ -347,11 +333,5 @@ function target_unit_stack(_battle_block, _target_type = -1) { ds_priority_destroy(_priority_queue); - if (DEBUG_COMBAT_PERFORMANCE) { - var _t_end_target_unit_stack = get_timer(); - var _elapsed_ms_target_unit_stack = (_t_end_target_unit_stack - _t_start_target_unit_stack) / 1000; - show_debug_message($"⏱️ Execution Time target_unit_stack: {_elapsed_ms_target_unit_stack}ms"); - } - return _biggest_target; } From d7466773cc4f1687d12f28a244de5337716ca99d Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Tue, 29 Apr 2025 02:21:46 +0300 Subject: [PATCH 73/80] Enemy squads test --- objects/obj_enunit/Create_0.gml | 79 +++++++------------ objects/obj_enunit/Draw_0.gml | 11 +-- scripts/scr_en_weapon/scr_en_weapon.gml | 44 ++++------- .../scr_enunit_scripts/scr_enunit_scripts.gml | 6 +- .../scr_pnunit_scripts/scr_pnunit_scripts.gml | 37 ++++++--- scripts/scr_shoot/scr_shoot.gml | 25 +++--- .../scr_weapon_stacks/scr_weapon_stacks.gml | 68 +++++++++++++++- 7 files changed, 153 insertions(+), 117 deletions(-) diff --git a/objects/obj_enunit/Create_0.gml b/objects/obj_enunit/Create_0.gml index cf60408b1d..09ede0ab77 100644 --- a/objects/obj_enunit/Create_0.gml +++ b/objects/obj_enunit/Create_0.gml @@ -22,11 +22,12 @@ if (obj_ncombat.enemy < array_length(global.star_name_colors) && obj_ncombat.ene target_block = noone; -weapon_stacks_normal = {}; +weapon_stacks_normal = []; weapon_stacks_vehicle = {}; weapon_stacks_unique = {}; -unit_stacks = {}; +unit_squads = []; +units = []; column_size = 0; @@ -42,67 +43,44 @@ is_mouse_over = function() { copy_block_composition = function(_composition) { if (struct_exists(_composition, "units")) { var _units = _composition.units; - - var _units_len = array_length(_units); - for (var i = 0; i < _units_len; i++) { + for (var i = 0, l = array_length(_units); i < l; i++) { var _unit = _units[i]; var _unit_name = _unit.name; - var _unit_struct = new EnemyUnitStack(_unit_name, _unit.count); - struct_set(unit_stacks, _unit_name, _unit_struct); - column_size += _unit_struct.unit_size * _unit.count; + var _unit_count = _unit.count; + repeat (_unit_count) { + var _unit_struct = new EnemyUnit(_unit_name); + array_push(units, _unit_struct); + column_size += _unit_struct.unit_size; + } } } if (struct_exists(_composition, "squads")) { var _squads = _composition.squads; - - var _squads_len = array_length(_squads); - for (var i = 0; i < _squads_len; i++) { + for (var i = 0, l = array_length(_squads); i < l; i++) { var _squad = _squads[i]; - - var _squad_template = global.squad_profiles[$ _squad.name]; - var _squad_units = _squad_template.members; + var _squad_name = _squad.name; var _squad_count = _squad.count; - - var _unit_names = struct_get_names(_squad_units); - var _unit_len = array_length(_unit_names); - for (var k = 0; k < _unit_len; k++){ - var _unit_name = _unit_names[k]; - var _profile_name = _unit_name; - var _unit = _squad_units[$ _unit_name]; - - if (struct_exists(unit_stacks, _unit_name)) { - unit_stacks[$ _unit_name].unit_count += _unit.count * _squad_count; - column_size += unit_stacks[$ _unit_name].unit_size * _unit.count * _squad_count; - } else { - var _unit_struct = new EnemyUnitStack(_profile_name, _unit.count * _squad_count); - struct_set(unit_stacks, _unit_name, _unit_struct); - column_size += _unit_struct.unit_size * _unit.count * _squad_count; - } + repeat (_squad_count) { + var _squad_struct = new EnemySquad(_squad_name); + array_push(unit_squads, _squad_struct); + column_size += _squad_struct.squad_size; } } } }; assign_weapon_stacks = function() { - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("assign_enemy_weapon_stacks"); - } - - var _unit_stack_names = struct_get_names(unit_stacks); - var _unit_stack_len = array_length(_unit_stack_names); - for (var k = 0; k < _unit_stack_len; k++){ - var _unit_stack_name = _unit_stack_names[k]; - var _unit_stack = unit_stacks[$ _unit_stack_name]; - for (var w = 0; w < array_length(_unit_stack.weapons); w++) { - scr_en_weapon(_unit_stack.weapons[w], _unit_stack.unit_type, _unit_stack.unit_count, _unit_stack_name, self); + for (var i = 0, l = array_length(unit_squads); i < l; i++){ + var _unit_squad = unit_squads[i]; + for (var s = 0, l2 = array_length(_unit_squad.member_stacks); s < l2; s++) { + var _member_stack = _unit_squad.member_stacks[s]; + for (var w = 0, l3 = array_length(_member_stack.weapons); w < l3; w++) { + scr_en_weapon(_member_stack.weapons[w], _member_stack.unit_type, _member_stack.unit_count, _member_stack.display_name); + } } } - - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("assign_enemy_weapon_stacks"); - } -} +}; unit_count = function() { // if (DEBUG_COMBAT_PERFORMANCE) { @@ -111,12 +89,9 @@ unit_count = function() { var _unit_count = 0; - var _unit_stack_names = struct_get_names(unit_stacks); - var _unit_stack_len = array_length(_unit_stack_names); - for (var k = 0; k < _unit_stack_len; k++){ - var _unit_stack_name = _unit_stack_names[k]; - var _unit_stack = unit_stacks[$ _unit_stack_name]; - _unit_count += _unit_stack.unit_count; + for (var i = 0, l = array_length(unit_squads); i < l; i++){ + var _unit_squad = unit_squads[i]; + _unit_count += _unit_squad.member_count; } // if (DEBUG_COMBAT_PERFORMANCE) { diff --git a/objects/obj_enunit/Draw_0.gml b/objects/obj_enunit/Draw_0.gml index c9e68f7834..07afd5a9fc 100644 --- a/objects/obj_enunit/Draw_0.gml +++ b/objects/obj_enunit/Draw_0.gml @@ -26,13 +26,10 @@ if (draw_size > 0){ var _names_array = []; var _types_array = []; - var _unit_names = struct_get_names(unit_stacks); - var _unit_len = array_length(_unit_names); - for (var k = 0; k < _unit_len; k++){ - var _unit_name = _unit_names[k]; - var _unit = unit_stacks[$ _unit_name]; - array_push(_names_array, _unit.display_name); - array_push(_counts_array, _unit.unit_count); + for (var i = 0, l = array_length(unit_squads); i < l; i++){ + var _unit_squad = unit_squads[i]; + array_push(_names_array, _unit_squad.display_name); + array_push(_counts_array, _unit_squad.member_count); } composition_string = arrays_to_string_with_counts(_names_array, _counts_array, true); diff --git a/scripts/scr_en_weapon/scr_en_weapon.gml b/scripts/scr_en_weapon/scr_en_weapon.gml index 6096b994b2..1af2760d5e 100644 --- a/scripts/scr_en_weapon/scr_en_weapon.gml +++ b/scripts/scr_en_weapon/scr_en_weapon.gml @@ -1,5 +1,5 @@ /// @mixin -function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _unit_block) { +function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name) { // check if double ranged/melee // then add to that weapon @@ -961,35 +961,19 @@ function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name, _uni _ammo *= 2; } - var _stack_type = {}; - if (_unit_type) { - _stack_type = weapon_stacks_normal; - } else { - _stack_type = weapon_stacks_vehicle; - } + var _weapon_stack = new WeaponStack(_weapon_name); + _weapon_stack.attack = _attack; + _weapon_stack.piercing = _piercing; + _weapon_stack.range = _range; + _weapon_stack.weapon_count += _weapon_count; + _weapon_stack.shot_count = _shot_count; + array_push(_weapon_stack.owners, _unit_name); - if (struct_exists(_stack_type, _weapon_name)) { - var _weapon_stack = _stack_type[$ _weapon_name]; - _weapon_stack.weapon_count += _weapon_count; - - if (!array_contains(_weapon_stack.owners, _unit_name)) { - array_push(_weapon_stack.owners, _unit_name); - } - } else { - var _weapon_stack = new WeaponStack(_weapon_name); - _weapon_stack.attack = _attack; - _weapon_stack.piercing = _piercing; - _weapon_stack.range = _range; - _weapon_stack.weapon_count += _weapon_count; - _weapon_stack.shot_count = _shot_count; - array_push(_weapon_stack.owners, _unit_name); - - if (obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) { - _weapon_stack.ammo_max = _ammo; - _weapon_stack.ammo_current = _ammo; - _weapon_stack.ammo_reload = _reload; - } - - struct_set(_stack_type, _weapon_name, _weapon_stack); + if (obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) { + _weapon_stack.ammo_max = _ammo; + _weapon_stack.ammo_current = _ammo; + _weapon_stack.ammo_reload = _reload; } + + array_push(weapon_stacks_normal, _weapon_stack); } diff --git a/scripts/scr_enunit_scripts/scr_enunit_scripts.gml b/scripts/scr_enunit_scripts/scr_enunit_scripts.gml index 2377f60f28..4d17b888e1 100644 --- a/scripts/scr_enunit_scripts/scr_enunit_scripts.gml +++ b/scripts/scr_enunit_scripts/scr_enunit_scripts.gml @@ -25,7 +25,7 @@ function enunit_target_and_shoot() { if (!engaged()) { // Shooting - var _ranged_weapons = array_concat(get_valid_weapon_stacks(weapon_stacks_normal, 2, 999), get_valid_weapon_stacks_unique(weapon_stacks_unique, 2, 999), get_valid_weapon_stacks(weapon_stacks_vehicle, 2, 999)); + var _ranged_weapons = weapon_stacks_normal; for (var i = 0, _ranged_len = array_length(_ranged_weapons); i < _ranged_len; i++) { var _weapon_stack = _ranged_weapons[i]; @@ -106,7 +106,7 @@ function enunit_target_and_shoot() { } } else { // Melee - var _melee_weapons = array_concat(get_valid_weapon_stacks(weapon_stacks_normal, 1, 2), get_valid_weapon_stacks_unique(weapon_stacks_unique, 1, 2), get_valid_weapon_stacks(weapon_stacks_vehicle, 1, 999)); + var _melee_weapons = weapon_stacks_normal; for (var i = 0, _wep_len = array_length(_melee_weapons); i < _wep_len; i++) { var _weapon_stack = _melee_weapons[i]; @@ -134,7 +134,7 @@ function enunit_target_and_shoot() { // Previosly alarm_1 /// @mixin function enunit_enemy_profiles_init() { - weapon_stacks_normal = {}; + weapon_stacks_normal = []; weapon_stacks_vehicle = {}; weapon_stacks_unique = {}; } diff --git a/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml b/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml index f8de0f1e4e..8abd6b4f2f 100644 --- a/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml +++ b/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml @@ -308,22 +308,19 @@ function pnunit_dying_process() { /* */ } -function target_unit_stack(_battle_block, _target_type = -1) { +function target_enemy_squad(_battle_block, _target_type = -1) { var _biggest_target = noone; var _priority_queue = ds_priority_create(); - var _unit_stacks = _battle_block.unit_stacks; + var _unit_squads = _battle_block.unit_squads; - var _unit_stack_names = struct_get_names(_unit_stacks); - var _unit_stack_len = array_length(_unit_stack_names); - for (var k = 0; k < _unit_stack_len; k++){ - var _unit_stack_name = _unit_stack_names[k]; - var _unit_stack = _unit_stacks[$ _unit_stack_name]; + for (var i = 0, l = array_length(_unit_squads); i < l; i++){ + var _unit_squad = _unit_squads[i]; - var _unit_stack_count = _unit_stack.unit_count; - var _unit_stack_type = _unit_stack.unit_type; + var _unit_stack_count = _unit_squad.member_count; + var _unit_stack_type = _unit_squad.squad_type; if (_target_type == -1 || _unit_stack_type == _target_type) { - ds_priority_add(_priority_queue, _unit_stack, _unit_stack_count); + ds_priority_add(_priority_queue, _unit_squad, _unit_stack_count); } } @@ -335,3 +332,23 @@ function target_unit_stack(_battle_block, _target_type = -1) { return _biggest_target; } + +function target_enemy_stack(_squad) { + var _biggest_target = noone; + var _priority_queue = ds_priority_create(); + var _unit_stacks = _squad.member_stacks; + + for (var i = 0, l = array_length(_unit_stacks); i < l; i++){ + var _unit_stack = _unit_stacks[i]; + var _unit_count = _unit_stack.unit_count; + ds_priority_add(_priority_queue, _unit_stack, _unit_count); + } + + if (!ds_priority_empty(_priority_queue)) { + _biggest_target = ds_priority_delete_max(_priority_queue); + } + + ds_priority_destroy(_priority_queue); + + return _biggest_target; +} diff --git a/scripts/scr_shoot/scr_shoot.gml b/scripts/scr_shoot/scr_shoot.gml index 8ad959910b..fbdbb6c629 100644 --- a/scripts/scr_shoot/scr_shoot.gml +++ b/scripts/scr_shoot/scr_shoot.gml @@ -88,10 +88,10 @@ function scr_shoot(_weapon_stack, _target_object, _target_index) { //* Player shooting if (owner == eFACTION.Player) { - var _target_stack = target_unit_stack(_target_object, _target_type); - if (_target_stack == noone) { - _target_stack = target_unit_stack(_target_object); - if (_target_stack == noone) { + var _target_squad = target_enemy_squad(_target_object, _target_type); + if (_target_squad == noone) { + _target_squad = target_enemy_squad(_target_object); + if (_target_squad == noone) { // if (DEBUG_PLAYER_TARGET_SELECTION) { // show_debug_message($"{_weapon_name} found no valid targets in the enemy column to attack!"); // } @@ -100,17 +100,15 @@ function scr_shoot(_weapon_stack, _target_object, _target_index) { } } + var _target_stack = target_enemy_stack(_target_squad); + // if (DEBUG_PLAYER_TARGET_SELECTION) { - // show_debug_message($"{_weapon_name} is attacking {_target_object.dudes[_target_stack]}"); + // show_debug_message($"{_weapon_name} is attacking {_target_object.dudes[_target_squad]}"); // } if (_weapon_name == "Missile Silo") { obj_ncombat.player_silos -= min(obj_ncombat.player_silos, 30); } - - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("player_scr_shoot"); - } // Normal shooting var _min_damage = 0.25; @@ -146,11 +144,10 @@ function scr_shoot(_weapon_stack, _target_object, _target_index) { _target_object.column_size -= _target_stack.unit_size * _casualties; if (_target_stack.unit_count <= 0) { - struct_remove(_target_object.unit_stacks, _target_stack.unit_name); - } - - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("player_scr_shoot"); + array_delete(_target_squad.member_stacks, array_get_index(_target_squad.member_stacks, _target_stack), 1); + if (array_length(_target_squad.member_stacks) <= 0) { + array_delete(_target_object.unit_squads, array_get_index(_target_object.unit_squads, _target_squad), 1); + } } scr_flavor(_weapon_stack, _target_object, _target_stack, _casualties); diff --git a/scripts/scr_weapon_stacks/scr_weapon_stacks.gml b/scripts/scr_weapon_stacks/scr_weapon_stacks.gml index 87da26f8f5..9a4a42e586 100644 --- a/scripts/scr_weapon_stacks/scr_weapon_stacks.gml +++ b/scripts/scr_weapon_stacks/scr_weapon_stacks.gml @@ -28,7 +28,38 @@ function WeaponStack(_name) constructor { global.unit_profiles = json_to_gamemaker(working_directory + "\\data\\unit_profiles.jsonc", json_parse); global.squad_profiles = json_to_gamemaker(working_directory + "\\data\\squad_profiles.jsonc", json_parse); global.army_profiles = json_to_gamemaker(working_directory + "\\data\\army_profiles.jsonc", json_parse); -function EnemyUnitStack(_name, _unit_count, _copy_profile = true) constructor { + +function EnemySquad(_name, _copy_profile = true) constructor { + name = _name; + display_name = _name; + squad_type = eTARGET_TYPE.Normal; + squad_size = 0; + squad_profile = {}; + member_count = 0; + member_stacks = []; + + static copy_squad_profile = function() { + var _squad_template = global.squad_profiles[$ name]; + var _squad_members = _squad_template.members; + display_name = _squad_template.display_name; + + var _unit_names = struct_get_names(_squad_members); + for (var k = 0, l = array_length(_unit_names); k < l; k++){ + var _unit_name = _unit_names[k]; + var _unit = _squad_members[$ _unit_name]; + var _unit_stack = new EnemyStack(_unit_name, _unit.count); + array_push(member_stacks, _unit_stack); + member_count += _unit.count; + squad_size += _unit.count * _unit_stack.unit_size; + } + }; + + if (_copy_profile) { + copy_squad_profile(); + } +} + +function EnemyStack(_name, _unit_count, _copy_profile = true) constructor { unit_name = _name; display_name = _name; unit_count = _unit_count; @@ -63,3 +94,38 @@ function EnemyUnitStack(_name, _unit_count, _copy_profile = true) constructor { copy_unit_profile(_name); } } + +function EnemyUnit(_name, _copy_profile = true) constructor { + unit_name = _name; + display_name = _name; + abilities = []; + armour = 0; + health = 0; + health_current = 0; + resistance = 0; + unit_type = eTARGET_TYPE.Normal; + unit_size = 0; + weapons = []; + ranged_mod = 1; + melee_mod = 1; + unit_profile = {}; + + static copy_unit_profile = function(_name) { + var _unit_profiles = global.unit_profiles; + if (struct_exists(_unit_profiles, _name)) { + var _profile_struct = _unit_profiles[$ _name]; + unit_profile = _profile_struct; + var _stat_names = struct_get_names(_profile_struct); + var _stat_len = array_length(_stat_names); + for (var k = 0; k < _stat_len; k++){ + var _stat_name = _stat_names[k]; + struct_set(self, _stat_name, _profile_struct[$ _stat_name]); + } + health_current = health; + } + }; + + if (_copy_profile) { + copy_unit_profile(_name); + } +} From d3a869124a5207c89b2e006e63ebb34ad5afc538 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Sun, 4 May 2025 09:08:38 +0300 Subject: [PATCH 74/80] I continue to drawn in insanity --- datafiles/data/army_profiles.jsonc | 114 +++++------ datafiles/data/squad_profiles.jsonc | 4 +- datafiles/data/unit_profiles.jsonc | 115 ++++++----- objects/obj_enunit/Create_0.gml | 6 +- .../obj_enunit/{Draw_0.gml => Draw_64.gml} | 14 +- objects/obj_enunit/obj_enunit.yy | 2 +- objects/obj_ncombat/Create_0.gml | 72 +++++-- .../obj_ncombat/{Draw_0.gml => Draw_64.gml} | 34 +++- objects/obj_ncombat/Step_0.gml | 12 +- objects/obj_ncombat/obj_ncombat.yy | 1 + .../obj_pnunit/{Draw_0.gml => Draw_64.gml} | 0 objects/obj_pnunit/obj_pnunit.yy | 2 +- objects/obj_popup/Alarm_0.gml | 2 +- objects/obj_popup/Destroy_0.gml | 2 +- objects/obj_popup/Step_0.gml | 2 +- objects/obj_turn_end/Mouse_56.gml | 4 +- scripts/scr_add_artifact/scr_add_artifact.gml | 2 +- .../scr_ancient_ruins/scr_ancient_ruins.gml | 2 +- .../scr_array_functions.gml | 6 +- scripts/scr_civil_roster/scr_civil_roster.gml | 34 ++-- scripts/scr_clean/scr_clean.gml | 16 -- .../scr_drop_select_function.gml | 2 +- scripts/scr_en_weapon/scr_en_weapon.gml | 40 +--- .../scr_enunit_scripts/scr_enunit_scripts.gml | 16 -- .../scr_ncombat_scripts.gml | 25 +-- .../scr_pnunit_scripts/scr_pnunit_scripts.gml | 2 +- .../scr_punit_combat_heplers.gml | 32 +--- scripts/scr_purge_world/scr_purge_world.gml | 4 +- scripts/scr_roster/scr_roster.gml | 34 ++-- scripts/scr_shoot/scr_shoot.gml | 4 +- .../scr_string_functions.gml | 11 ++ .../scr_struct_functions.gml | 6 +- .../scr_weapon_stacks/scr_weapon_stacks.gml | 179 +++++++++++++----- 33 files changed, 435 insertions(+), 366 deletions(-) rename objects/obj_enunit/{Draw_0.gml => Draw_64.gml} (70%) rename objects/obj_ncombat/{Draw_0.gml => Draw_64.gml} (65%) rename objects/obj_pnunit/{Draw_0.gml => Draw_64.gml} (100%) diff --git a/datafiles/data/army_profiles.jsonc b/datafiles/data/army_profiles.jsonc index 3a45d6d1e4..6a5686b4c7 100644 --- a/datafiles/data/army_profiles.jsonc +++ b/datafiles/data/army_profiles.jsonc @@ -1,83 +1,57 @@ { "orks_6": { - "name": "Huge Ork Army", + "display_name": "Huge Ork Army", "description": "A huge army of green gigachads.", - "columns": [ + "units": [ { - "units": [ - { - "name": "deff_dread", - "count": 36 - }, - { - "name": "battlewagon", - "count": 220 - } - ], - "squads": [ - { - "name": "gretchins", - "count": 70 - }, - { - "name": "tankbustas", - "count": 6 - }, - { - "name": "meganobz", - "count": 8 - } - ] + "name": "deff_dread", + "count": 36 }, { - "squads": [ - { - "name": "slugga_boyz", - "count": 40 - }, - { - "name": "ard_boyz", - "count": 20 - } - ] + "name": "battlewagon", + "count": 220 }, { - "squads": [ - { - "name": "slugga_boyz", - "count": 20 - }, - { - "name": "ard_boyz", - "count": 30 - }, - { - "name": "shoota_boyz", - "count": 60 - } - ] + "name": "mekboy", + "count": 6 }, { - "units": [ - { - "name": "mekboy", - "count": 6 - }, - { - "name": "warboss", - "count": 1 - } - ], - "squads": [ - { - "name": "flash_gitz", - "count": 5 - }, - { - "name": "kommandos", - "count": 2 - } - ] + "name": "warboss", + "count": 1 + } + ], + "squads": [ + { + "name": "gretchins", + "count": 70 + }, + { + "name": "tankbustas", + "count": 6 + }, + { + "name": "meganobz", + "count": 8 + }, + { + "name": "slugga_boyz", + "count": 60 + }, + { + "name": "ard_boyz", + "count": 50 + }, + { + "name": "shoota_boyz", + "count": 60 + }, + { + "name": "flash_gitz", + "count": 5 + }, + { + "name": "kommandos", + "count": 2 } ] } diff --git a/datafiles/data/squad_profiles.jsonc b/datafiles/data/squad_profiles.jsonc index fe6668266d..6b803634fd 100644 --- a/datafiles/data/squad_profiles.jsonc +++ b/datafiles/data/squad_profiles.jsonc @@ -25,7 +25,7 @@ "display_name": "Slugga Boyz", "members": { "slugga_boy": { - "count": 29, + "count": 29 }, "boss_nob": { "count": 1 @@ -61,7 +61,7 @@ "count": 30 }, "runtherd": { - "count": 3, + "count": 3 } } }, diff --git a/datafiles/data/unit_profiles.jsonc b/datafiles/data/unit_profiles.jsonc index d23f631f00..584a6eedef 100644 --- a/datafiles/data/unit_profiles.jsonc +++ b/datafiles/data/unit_profiles.jsonc @@ -885,7 +885,8 @@ "Big Shoota" ], "unit_type": 0, - "unit_size": 1 + "unit_size": 1, + "movement": 1 }, "warboss": { "display_name": "Warboss", @@ -897,7 +898,8 @@ "Power Klaw" ], "unit_type": 1, - "unit_size": 2 + "unit_size": 2, + "movement": 1 }, "gretchin": { "display_name": "Gretchin", @@ -908,7 +910,8 @@ "Grot Blasta" ], "unit_type": 1, - "unit_size": 0.5 + "unit_size": 0.5, + "movement": 1 }, "slugga_boy": { "display_name": "Slugga Boy", @@ -920,19 +923,21 @@ "Slugga" ], "unit_type": 0, - "unit_size": 1 + "unit_size": 1, + "movement": 1 }, "shoota_boy": { - "display_name": "Shoota Boy", - "armour": 5, - "health": 60, - "resistance": 1, - "weapons": [ - "Choppa", - "Shoota" - ], - "unit_type": 0, - "unit_size": 1 + "display_name": "Shoota Boy", + "armour": 5, + "health": 60, + "resistance": 1, + "weapons": [ + "Choppa", + "Shoota" + ], + "unit_type": 0, + "unit_size": 1, + "movement": 1 }, "mekboy": { "display_name": "Mekboy", @@ -944,19 +949,21 @@ "Slugga" ], "unit_type": 0, - "unit_size": 1 + "unit_size": 1, + "movement": 1 }, "runtherd": { - "display_name": "Runtherd", - "armour": 5, - "health": 60, - "resistance": 1, - "weapons": [ - "Choppa", - "Slugga" - ], - "unit_type": 3, - "unit_size": 1 + "display_name": "Runtherd", + "armour": 5, + "health": 60, + "resistance": 1, + "weapons": [ + "Choppa", + "Slugga" + ], + "unit_type": 3, + "unit_size": 1, + "movement": 1 }, "nob": { "display_name": "Nob", @@ -968,7 +975,8 @@ "Big Shoota" ], "unit_type": 0, - "unit_size": 1 + "unit_size": 1, + "movement": 1 }, "boss_nob": { "display_name": "Boss Nob", @@ -980,7 +988,8 @@ "Twin-Linked Shoota" ], "unit_type": 3, - "unit_size": 2 + "unit_size": 2, + "movement": 1 }, "meganob": { "display_name": "Meganob", @@ -992,7 +1001,8 @@ "Power Klaw" ], "unit_type": 1, - "unit_size": 2 + "unit_size": 2, + "movement": 1 }, "boss_meganob": { "display_name": "Boss Meganob", @@ -1004,7 +1014,8 @@ "Power Klaw" ], "unit_type": 3, - "unit_size": 2 + "unit_size": 2, + "movement": 1 }, "flash_git": { "display_name": "Flash Git", @@ -1015,18 +1026,20 @@ "Snazzgun" ], "unit_type": 0, - "unit_size": 1 + "unit_size": 1, + "movement": 1 }, "kaptin": { - "display_name": "Kaptin", - "armour": 8, - "health": 100, - "resistance": 1, - "weapons": [ - "Snazzgun" - ], - "unit_type": 3, - "unit_size": 1 + "display_name": "Kaptin", + "armour": 8, + "health": 100, + "resistance": 1, + "weapons": [ + "Snazzgun" + ], + "unit_type": 3, + "unit_size": 1, + "movement": 1 }, "cybork": { "display_name": "Cybork", @@ -1038,7 +1051,8 @@ "Big Shoota" ], "unit_type": 0, - "unit_size": 1 + "unit_size": 1, + "movement": 1 }, "ard_boy": { "display_name": "Ard Boy", @@ -1050,7 +1064,8 @@ "Slugga" ], "unit_type": 0, - "unit_size": 1 + "unit_size": 1, + "movement": 1 }, "kommando": { "display_name": "Kommando", @@ -1062,7 +1077,8 @@ "Slugga" ], "unit_type": 0, - "unit_size": 1 + "unit_size": 1, + "movement": 1 }, "burna_boy": { "display_name": "Burna Boy", @@ -1074,7 +1090,8 @@ "Burna" ], "unit_type": 0, - "unit_size": 1 + "unit_size": 1, + "movement": 1 }, "tankbusta": { "display_name": "Tankbusta", @@ -1086,7 +1103,8 @@ "Tankbusta Bomb" ], "unit_type": 0, - "unit_size": 1 + "unit_size": 1, + "movement": 1 }, "stormboy": { "display_name": "Stormboy", @@ -1101,7 +1119,8 @@ "jump" ], "unit_type": 1, - "unit_size": 2 + "unit_size": 2, + "movement": 1 }, "battlewagon": { "display_name": "Battlewagon", @@ -1116,7 +1135,8 @@ "Rokkit Launcha" ], "unit_type": 0, - "unit_size": 10 + "unit_size": 10, + "movement": 1 }, "deff_dread": { "display_name": "Deff Dread", @@ -1130,7 +1150,8 @@ "Power Klaw" ], "unit_type": 0, - "unit_size": 10 + "unit_size": 10, + "movement": 1 }, "xv8_commander": { "display_name": "XV8 Commander", diff --git a/objects/obj_enunit/Create_0.gml b/objects/obj_enunit/Create_0.gml index 09ede0ab77..bd114a79bf 100644 --- a/objects/obj_enunit/Create_0.gml +++ b/objects/obj_enunit/Create_0.gml @@ -26,6 +26,8 @@ weapon_stacks_normal = []; weapon_stacks_vehicle = {}; weapon_stacks_unique = {}; +composition_map = new CountingMap(); + unit_squads = []; units = []; @@ -73,8 +75,8 @@ copy_block_composition = function(_composition) { assign_weapon_stacks = function() { for (var i = 0, l = array_length(unit_squads); i < l; i++){ var _unit_squad = unit_squads[i]; - for (var s = 0, l2 = array_length(_unit_squad.member_stacks); s < l2; s++) { - var _member_stack = _unit_squad.member_stacks[s]; + for (var s = 0, l2 = array_length(_unit_squad.units); s < l2; s++) { + var _member_stack = _unit_squad.units[s]; for (var w = 0, l3 = array_length(_member_stack.weapons); w < l3; w++) { scr_en_weapon(_member_stack.weapons[w], _member_stack.unit_type, _member_stack.unit_count, _member_stack.display_name); } diff --git a/objects/obj_enunit/Draw_0.gml b/objects/obj_enunit/Draw_64.gml similarity index 70% rename from objects/obj_enunit/Draw_0.gml rename to objects/obj_enunit/Draw_64.gml index 07afd5a9fc..e7c02ca612 100644 --- a/objects/obj_enunit/Draw_0.gml +++ b/objects/obj_enunit/Draw_64.gml @@ -22,17 +22,19 @@ if (draw_size > 0){ if (is_mouse_over()) { if (unit_count() != unit_count_old) { unit_count_old = unit_count(); - var _counts_array = []; - var _names_array = []; - var _types_array = []; + composition_map.clear(); + for (var i = 0, l = array_length(units); i < l; i++){ + var _unit = units[i]; + composition_map.add($"{_unit.display_name}"); + } + for (var i = 0, l = array_length(unit_squads); i < l; i++){ var _unit_squad = unit_squads[i]; - array_push(_names_array, _unit_squad.display_name); - array_push(_counts_array, _unit_squad.member_count); + composition_map.add($"{_unit_squad.display_name} Squad"); } - composition_string = arrays_to_string_with_counts(_names_array, _counts_array, true); + composition_string = composition_map.get_total_string(); } draw_block_composition(x1, composition_string); diff --git a/objects/obj_enunit/obj_enunit.yy b/objects/obj_enunit/obj_enunit.yy index c7c6d9b7b0..bd4a358ab1 100644 --- a/objects/obj_enunit/obj_enunit.yy +++ b/objects/obj_enunit/obj_enunit.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":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":87,"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_enunit", diff --git a/objects/obj_ncombat/Create_0.gml b/objects/obj_ncombat/Create_0.gml index d2cf480d50..a457073415 100644 --- a/objects/obj_ncombat/Create_0.gml +++ b/objects/obj_ncombat/Create_0.gml @@ -1,4 +1,4 @@ -#macro BATTLELOG_MAX_PER_TURN 24 +#macro BATTLELOG_MAX_PER_TURN 40 if (instance_number(obj_ncombat) > 1) { instance_destroy(); @@ -29,10 +29,8 @@ if (nope != 1) { man_size_limit = 0; man_limit_reached = false; man_size_count = 0; -owner = eFACTION.Player; -formation_set = 0; -on_ship = false; -alpha_strike = 0; +player_formation = 0; +enemy_alpha_strike = 0; Warlord = 0; total_battle_exp_gain = 0; marines_to_recover = 0; @@ -305,6 +303,9 @@ if (obj_ini.occulobe) { enemy_dudes = ""; global_defense = 2 - global_defense; +enemy_force = new EnemyArmy("", false); +player_force = new PlayerArmy(); + queue_force_health = function() { var _text = ""; @@ -354,8 +355,6 @@ display_message_queue = function() { ds_queue_clear(messages_queue); } -enemy_force_composition = {}; - battlefield_scale = 0.1; update_battlefield_scale = function() { var _biggest_block_size = 0; @@ -366,11 +365,58 @@ update_battlefield_scale = function() { } } - with (obj_enunit) { - if (column_size > _biggest_block_size) { - _biggest_block_size = column_size; - } + battlefield_scale = min(1, 400 / _biggest_block_size); +}; + + + +function BattlefieldGridCell() constructor { + terrain = 0; + capacity = 1000; + player_units = []; + player_squads = []; + enemy_units = []; + enemy_squads = []; + + reset = function() { + terrain = 0; + capacity = 1000; + player_units = []; + player_squads = []; + enemy_units = []; + enemy_squads = []; } +} - battlefield_scale = min(1, 400 / _biggest_block_size); -}; \ No newline at end of file +function BattlefieldGrid(_width, _height) constructor { + width = _width; + height = _height; + data = array_create(_width * _height, new BattlefieldGridCell()); + size = array_length(data); + + static index = function(_x, _y) { + return _x + _y * width; + }; + + static set = function(_x, _y, _value) { + if (_x >= 0 && _x < width && _y >= 0 && _y < height) { + data[index(_x, _y)] = _value; + } + }; + + static get = function(_x, _y) { + if (_x >= 0 && _x < width && _y >= 0 && _y < height) { + return data[index(_x, _y)]; + } + return undefined; + }; + + static clear = function(_value) { + var _size = array_length(data); + for (var _i = 0; _i < _size; _i++) { + data[_i].reset(); + } + }; +} + +battlefield = new BattlefieldGrid(100, 1); diff --git a/objects/obj_ncombat/Draw_0.gml b/objects/obj_ncombat/Draw_64.gml similarity index 65% rename from objects/obj_ncombat/Draw_0.gml rename to objects/obj_ncombat/Draw_64.gml index 6ef6d9b51a..f984fe1fca 100644 --- a/objects/obj_ncombat/Draw_0.gml +++ b/objects/obj_ncombat/Draw_64.gml @@ -19,7 +19,7 @@ draw_set_alpha(0.5); draw_rectangle(0 + l, 0 + l, 800 - l, 900 - l, 1); l += 1; draw_set_alpha(0.25); -draw_rectangle(0 + l, 0 + l, 6800 - l, 900 - l, 1); +draw_rectangle(0 + l, 0 + l, 1600 - l, 900 - l, 1); l = 0; draw_set_alpha(1); @@ -33,6 +33,38 @@ draw_rectangle(818 + l, 235 + l, 1578 - l, 666 - l, 1); l += 1; draw_set_alpha(0.25); draw_rectangle(818 + l, 235 + l, 1578 - l, 666 - l, 1); +draw_set_alpha(1); + +var cell_width = 6; +var cell_height = 426; + +// Assuming `my_grid` is your custom grid struct +for (var _x = 0; _x < ds_grid_width(battlefield); _x++) { + for (var _y = 0; _y < ds_grid_height(battlefield); _y++) { + var _screen_x = 822 + _x * cell_width + _x; + var _screen_y = 239 + _y * cell_height; + + // Draw cell rectangle + draw_set_alpha(0.25); + draw_set_color(c_gray); + draw_rectangle(_screen_x, _screen_y, _screen_x + cell_width, _screen_y + cell_height, true); + + // Get cell data + var _cell = ds_grid_get(battlefield, _x, _y); + + // Determine item count + var _item_count = (is_array(_cell)) ? array_length(_cell) : 0; + + // Change color if occupied + if (_item_count > 0) { + draw_set_alpha(1); + draw_set_color(c_green); + draw_rectangle(_screen_x, _screen_y, _screen_x + cell_width, _screen_y + cell_height, false); + } + } +} + +draw_set_color(c_white); // Reset color to default after l = 0; draw_set_alpha(1); diff --git a/objects/obj_ncombat/Step_0.gml b/objects/obj_ncombat/Step_0.gml index f0a7b67376..3d7b06d539 100644 --- a/objects/obj_ncombat/Step_0.gml +++ b/objects/obj_ncombat/Step_0.gml @@ -23,10 +23,6 @@ if (battle_stage == eBATTLE_STAGE.Creation) { stopwatch("scr_player_combat_weapon_stacks"); } - with (obj_enunit) { - enunit_enemy_profiles_init(); - } - with (obj_pnunit) { pnunit_battle_effects(); } @@ -61,12 +57,8 @@ if ((press_exclusive(vk_enter) || hold_exclusive(vk_enter)) && fading_strength = display_message_queue(); if (turn_stage == eBATTLE_TURN.EnemyStart) { - if (instance_exists(obj_enunit)) { - with (obj_enunit) { - enunit_enemy_profiles_init(); - } - move_enemy_blocks(); - + battlefield.move_enemies(); + if (instance_exists(obj_enunit)) { if (DEBUG_COMBAT_PERFORMANCE) { stopwatch("enunit_create_weapon_stacks"); } diff --git a/objects/obj_ncombat/obj_ncombat.yy b/objects/obj_ncombat/obj_ncombat.yy index bea3637027..441dfd441f 100644 --- a/objects/obj_ncombat/obj_ncombat.yy +++ b/objects/obj_ncombat/obj_ncombat.yy @@ -7,6 +7,7 @@ {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":8,"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":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_ncombat", diff --git a/objects/obj_pnunit/Draw_0.gml b/objects/obj_pnunit/Draw_64.gml similarity index 100% rename from objects/obj_pnunit/Draw_0.gml rename to objects/obj_pnunit/Draw_64.gml diff --git a/objects/obj_pnunit/obj_pnunit.yy b/objects/obj_pnunit/obj_pnunit.yy index 901f257291..f383cdbeb5 100644 --- a/objects/obj_pnunit/obj_pnunit.yy +++ b/objects/obj_pnunit/obj_pnunit.yy @@ -5,9 +5,9 @@ {"$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":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":84,"eventType":9,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":73,"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_pnunit", diff --git a/objects/obj_popup/Alarm_0.gml b/objects/obj_popup/Alarm_0.gml index e64a7a74af..1981a18671 100644 --- a/objects/obj_popup/Alarm_0.gml +++ b/objects/obj_popup/Alarm_0.gml @@ -17,7 +17,7 @@ if (battle_special=3.1){ obj_ncombat.fortified=5; obj_ncombat.battle_special="mech_stc"; obj_ncombat.threat=4; - obj_ncombat.formation_set=3; + obj_ncombat.player_formation=3; instance_deactivate_all(true); instance_activate_object(obj_ini); diff --git a/objects/obj_popup/Destroy_0.gml b/objects/obj_popup/Destroy_0.gml index 17621f119c..cc3ce2cb84 100644 --- a/objects/obj_popup/Destroy_0.gml +++ b/objects/obj_popup/Destroy_0.gml @@ -18,7 +18,7 @@ if (image="chaos_symbol") and (title="Concealed Heresy") and (instance_exists(ob obj_ncombat.dropping=0; obj_ncombat.attacking=10; obj_ncombat.enemy=10; - obj_ncombat.formation_set=2; + obj_ncombat.player_formation=2; obj_ncombat.leader=1; obj_ncombat.threat=5; obj_ncombat.battle_special="WL10_reveal"; diff --git a/objects/obj_popup/Step_0.gml b/objects/obj_popup/Step_0.gml index d0b0c70ec3..d07044a570 100644 --- a/objects/obj_popup/Step_0.gml +++ b/objects/obj_popup/Step_0.gml @@ -1192,7 +1192,7 @@ try { obj_ncombat.attacking = 0; obj_ncombat.enemy = 13; obj_ncombat.threat = 1; - obj_ncombat.formation_set = 1; + obj_ncombat.player_formation = 1; if (battle == 1) { obj_ncombat.battle_special = "wraith_attack"; diff --git a/objects/obj_turn_end/Mouse_56.gml b/objects/obj_turn_end/Mouse_56.gml index a2822f4842..2bd38c8400 100644 --- a/objects/obj_turn_end/Mouse_56.gml +++ b/objects/obj_turn_end/Mouse_56.gml @@ -145,9 +145,9 @@ __b__ = action_if_number(obj_popup, 0, 0); var _planet_data = new PlanetData(_planet, _battle_obj); if (tip="offensive"){ - obj_ncombat.formation_set=1; + obj_ncombat.player_formation=1; } else if (tip="defensive"){ - obj_ncombat.formation_set=2; + obj_ncombat.player_formation=2; } diff --git a/scripts/scr_add_artifact/scr_add_artifact.gml b/scripts/scr_add_artifact/scr_add_artifact.gml index 4ccb449881..f45c7df44f 100644 --- a/scripts/scr_add_artifact/scr_add_artifact.gml +++ b/scripts/scr_add_artifact/scr_add_artifact.gml @@ -424,7 +424,7 @@ function ArtifactStruct(Index) constructor { if ((demonSummonChance <= 60) && (obj_ini.ship_carrying[_ship_id] > 0)) { instance_create(0, 0, obj_ncombat); obj_ncombat.battle_special = "ship_demon"; - obj_ncombat.formation_set = 1; + obj_ncombat.player_formation = 1; obj_ncombat.enemy = 10; obj_ncombat.battle_id = _ship_id; scr_ship_battle(_ship_id, 999); diff --git a/scripts/scr_ancient_ruins/scr_ancient_ruins.gml b/scripts/scr_ancient_ruins/scr_ancient_ruins.gml index a381ff7b30..96c072ea5e 100644 --- a/scripts/scr_ancient_ruins/scr_ancient_ruins.gml +++ b/scripts/scr_ancient_ruins/scr_ancient_ruins.gml @@ -61,7 +61,7 @@ function scr_ruins_suprise_attack_player(){ obj_ncombat.attacking=0; obj_ncombat.enemy=obj_ground_mission.ruins_battle; obj_ncombat.threat=obj_ground_mission.battle_threat; - obj_ncombat.formation_set=1; + obj_ncombat.player_formation=1; instance_destroy(obj_popup); instance_destroy(obj_star_select); } catch (_exception) { diff --git a/scripts/scr_array_functions/scr_array_functions.gml b/scripts/scr_array_functions/scr_array_functions.gml index c3522d1c03..6d91822218 100644 --- a/scripts/scr_array_functions/scr_array_functions.gml +++ b/scripts/scr_array_functions/scr_array_functions.gml @@ -136,7 +136,7 @@ function array_to_string_order(_strings_array, _use_and = false, _dot_end = true /// @param {bool} _exclude_null Whether to exclude entries with zero count /// @param {bool} _dot_end Whether to end the string with a period /// @return {string} -function arrays_to_string_with_counts(_names_array, _counts_array, _exclude_null = false, _dot_end = true) { +function arrays_to_string_with_counts(_names_array, _counts_array, _exclude_null = false, _dot_end = true, convert_plural = true) { var _array_length = array_length(_names_array); var _result_string = ""; @@ -144,7 +144,9 @@ function arrays_to_string_with_counts(_names_array, _counts_array, _exclude_null if (_exclude_null && _counts_array[i] == 0) { continue; } - _result_string += string_plural_count(_names_array[i], _counts_array[i]); + + var _function = convert_plural ? string_plural_count : string_with_count; + _result_string += _function(_names_array[i], _counts_array[i]); _result_string += smart_delimeter_sign(_array_length, i, _dot_end); } diff --git a/scripts/scr_civil_roster/scr_civil_roster.gml b/scripts/scr_civil_roster/scr_civil_roster.gml index 45d0e5a1df..8a49bc9443 100644 --- a/scripts/scr_civil_roster/scr_civil_roster.gml +++ b/scripts/scr_civil_roster/scr_civil_roster.gml @@ -24,23 +24,23 @@ function scr_civil_roster(_unit_location, _target_location, _is_planet) { // Formation here - obj_controller.bat_devastator_column=obj_controller.bat_deva_for[new_combat.formation_set]; - obj_controller.bat_assault_column=obj_controller.bat_assa_for[new_combat.formation_set]; - obj_controller.bat_tactical_column=obj_controller.bat_tact_for[new_combat.formation_set]; - obj_controller.bat_veteran_column=obj_controller.bat_vete_for[new_combat.formation_set]; - obj_controller.bat_hire_column=obj_controller.bat_hire_for[new_combat.formation_set]; - obj_controller.bat_librarian_column=obj_controller.bat_libr_for[new_combat.formation_set]; - obj_controller.bat_command_column=obj_controller.bat_comm_for[new_combat.formation_set]; - obj_controller.bat_techmarine_column=obj_controller.bat_tech_for[new_combat.formation_set]; - obj_controller.bat_terminator_column=obj_controller.bat_term_for[new_combat.formation_set]; - obj_controller.bat_honor_column=obj_controller.bat_hono_for[new_combat.formation_set]; - obj_controller.bat_dreadnought_column=obj_controller.bat_drea_for[new_combat.formation_set]; - obj_controller.bat_rhino_column=obj_controller.bat_rhin_for[new_combat.formation_set]; - obj_controller.bat_predator_column=obj_controller.bat_pred_for[new_combat.formation_set]; - obj_controller.bat_landraider_column=obj_controller.bat_landraid_for[new_combat.formation_set]; - obj_controller.bat_landspeeder_column = obj_controller.bat_landspee_for[new_combat.formation_set]; - obj_controller.bat_whirlwind_column = obj_controller.bat_whirl_for[new_combat.formation_set]; - obj_controller.bat_scout_column=obj_controller.bat_scou_for[new_combat.formation_set]; + obj_controller.bat_devastator_column=obj_controller.bat_deva_for[new_combat.player_formation]; + obj_controller.bat_assault_column=obj_controller.bat_assa_for[new_combat.player_formation]; + obj_controller.bat_tactical_column=obj_controller.bat_tact_for[new_combat.player_formation]; + obj_controller.bat_veteran_column=obj_controller.bat_vete_for[new_combat.player_formation]; + obj_controller.bat_hire_column=obj_controller.bat_hire_for[new_combat.player_formation]; + obj_controller.bat_librarian_column=obj_controller.bat_libr_for[new_combat.player_formation]; + obj_controller.bat_command_column=obj_controller.bat_comm_for[new_combat.player_formation]; + obj_controller.bat_techmarine_column=obj_controller.bat_tech_for[new_combat.player_formation]; + obj_controller.bat_terminator_column=obj_controller.bat_term_for[new_combat.player_formation]; + obj_controller.bat_honor_column=obj_controller.bat_hono_for[new_combat.player_formation]; + obj_controller.bat_dreadnought_column=obj_controller.bat_drea_for[new_combat.player_formation]; + obj_controller.bat_rhino_column=obj_controller.bat_rhin_for[new_combat.player_formation]; + obj_controller.bat_predator_column=obj_controller.bat_pred_for[new_combat.player_formation]; + obj_controller.bat_landraider_column=obj_controller.bat_landraid_for[new_combat.player_formation]; + obj_controller.bat_landspeeder_column = obj_controller.bat_landspee_for[new_combat.player_formation]; + obj_controller.bat_whirlwind_column = obj_controller.bat_whirl_for[new_combat.player_formation]; + obj_controller.bat_scout_column=obj_controller.bat_scou_for[new_combat.player_formation]; var co, v, meeting, he_good,unit; co=0;v=0;meeting=true;he_good=false; diff --git a/scripts/scr_clean/scr_clean.gml b/scripts/scr_clean/scr_clean.gml index 5c3156d70e..c68f2f8634 100644 --- a/scripts/scr_clean/scr_clean.gml +++ b/scripts/scr_clean/scr_clean.gml @@ -16,10 +16,6 @@ function scr_clean(target_object, weapon_data) { if (obj_ncombat.wall_destroyed == 1) { exit; } - - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("player_units_validation"); - } var armour_pierce = weapon_data.piercing; var weapon_shot_count = weapon_data.shot_count; @@ -85,14 +81,6 @@ function scr_clean(target_object, weapon_data) { } valid_vehicles = array_shuffle(valid_vehicles); - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("player_units_validation"); - } - - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("player_damage_allocation"); - } - if (target_type == eTARGET_TYPE.Armour && array_empty(valid_vehicles)) { target_type = eTARGET_TYPE.Normal; } else if (target_type = eTARGET_TYPE.Normal && array_empty(valid_marines)) { @@ -279,10 +267,6 @@ function scr_clean(target_object, weapon_data) { } } - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("player_damage_allocation"); - } - // Flavour battle-log message scr_flavor2(units_lost, unit_type, hostile_range, hostile_weapon, shooter_count); } 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 e565148666..5b547143a3 100644 --- a/scripts/scr_drop_select_function/scr_drop_select_function.gml +++ b/scripts/scr_drop_select_function/scr_drop_select_function.gml @@ -268,7 +268,7 @@ function drop_select_draw() { obj_ncombat.dropping = 1 - attack; obj_ncombat.attacking = attack; obj_ncombat.enemy = attacking; - obj_ncombat.formation_set = formation_possible[formation_current]; + obj_ncombat.player_formation = formation_possible[formation_current]; obj_ncombat.defending = false; obj_ncombat.local_forces = roster.local_button.active; diff --git a/scripts/scr_en_weapon/scr_en_weapon.gml b/scripts/scr_en_weapon/scr_en_weapon.gml index 1af2760d5e..e6af126ae6 100644 --- a/scripts/scr_en_weapon/scr_en_weapon.gml +++ b/scripts/scr_en_weapon/scr_en_weapon.gml @@ -936,44 +936,18 @@ function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name) { var _weapon_struct = global.weapons[$ _weapon_name]; - _attack = _weapon_struct.attack.standard; - _piercing = _weapon_struct.arp; - _range = _weapon_struct.range; - _shot_count = _weapon_struct.spli; - - if (_shot_count == 0) { + if (_weapon_struct == undefined) { exit; } - // if (faith_bonus = 1) then _attack = _attack * 2; - // if (faith_bonus = 2) then _attack = _attack * 3; - _attack = round(_attack * obj_ncombat.global_defense); - - // if (obj_ncombat.enemy == 1) { - // if (_range <= 1 || floor(_range) != _range) { - // _attack = round(_attack * dudes_attack[_unit_block]); - // } else if (_range > 1 && floor(_range) == _range) { - // _attack = round(_attack * dudes_ranged[_unit_block]); - // } - // } - - if (_unit_type == 1 && _ammo > 0) { - _ammo *= 2; - } - - var _weapon_stack = new WeaponStack(_weapon_name); - _weapon_stack.attack = _attack; - _weapon_stack.piercing = _piercing; - _weapon_stack.range = _range; - _weapon_stack.weapon_count += _weapon_count; - _weapon_stack.shot_count = _shot_count; + var _weapon_stack = new WeaponStack(_weapon_struct); array_push(_weapon_stack.owners, _unit_name); - if (obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) { - _weapon_stack.ammo_max = _ammo; - _weapon_stack.ammo_current = _ammo; - _weapon_stack.ammo_reload = _reload; - } + // if (obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) { + // _weapon_stack.ammo_max = _ammo; + // _weapon_stack.ammo_current = _ammo; + // _weapon_stack.ammo_reload = _reload; + // } array_push(weapon_stacks_normal, _weapon_stack); } diff --git a/scripts/scr_enunit_scripts/scr_enunit_scripts.gml b/scripts/scr_enunit_scripts/scr_enunit_scripts.gml index 4d17b888e1..3cd84b4605 100644 --- a/scripts/scr_enunit_scripts/scr_enunit_scripts.gml +++ b/scripts/scr_enunit_scripts/scr_enunit_scripts.gml @@ -42,10 +42,6 @@ function enunit_target_and_shoot() { if (_weapon_stack.range >= dist) { var _target_priority_queue = ds_priority_create(); - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("enunit_column_picking"); - } - // Scan potential targets var _targets = []; with (obj_pnunit) { @@ -73,10 +69,6 @@ function enunit_target_and_shoot() { } } - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("enunit_column_picking"); - } - // Shoot highest-priority target if (!ds_priority_empty(_target_priority_queue)) { var _best_target = ds_priority_delete_max(_target_priority_queue); @@ -130,11 +122,3 @@ function enunit_target_and_shoot() { } //! Here was some stuff that depended on image_index here, that got deleted, because I couldn't figure out why it exists; } - -// Previosly alarm_1 -/// @mixin -function enunit_enemy_profiles_init() { - weapon_stacks_normal = []; - weapon_stacks_vehicle = {}; - weapon_stacks_unique = {}; -} diff --git a/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml b/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml index 3a4cb49b2c..6025ef197f 100644 --- a/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml +++ b/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml @@ -21,7 +21,7 @@ function ncombat_enemy_stacks_init() { try { if (battle_special == "cs_meeting_battle5") { - alpha_strike = 1; + enemy_alpha_strike = 1; } instance_activate_object(obj_enunit); @@ -1425,21 +1425,12 @@ function ncombat_enemy_stacks_init() { } // Large Ork Army if (threat == 6) { - enemy_force_composition = global.army_profiles[$ "orks_6"]; - enemy_dudes = enemy_force_composition.description; - var _block_count = array_length(enemy_force_composition.columns); - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("ncombat_create_enemy_army"); - } - for (var b = 0; b < _block_count; b++) { - var _pos = 160 + (b * 10); - var _block = instance_create(_pos, 240, obj_enunit); - _block.copy_block_composition(enemy_force_composition.columns[b]); - enemy_forces += _block.unit_count(); - } - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("ncombat_create_enemy_army"); - } + enemy_force.name = "orks_6"; + enemy_force.copy_profile(); + enemy_force.spawn_squads(); + enemy_dudes = enemy_force.profile.description; + var _cell = ds_grid_get(battlefield, 0, 0); + var _cell = ds_grid_get(battlefield, 1, 0); } } @@ -5627,7 +5618,7 @@ function ncombat_special_end() { } } - if ((enemy == 1) && (on_ship == true) && (defeat == 0)) { + if ((enemy == 1) && (defeat == 0)) { var diceh=roll_dice_chapter(1, 100, "high"); if (diceh <= 15) { diff --git a/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml b/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml index 8abd6b4f2f..2514ddb525 100644 --- a/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml +++ b/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml @@ -336,7 +336,7 @@ function target_enemy_squad(_battle_block, _target_type = -1) { function target_enemy_stack(_squad) { var _biggest_target = noone; var _priority_queue = ds_priority_create(); - var _unit_stacks = _squad.member_stacks; + var _unit_stacks = _squad.units; for (var i = 0, l = array_length(_unit_stacks); i < l; i++){ var _unit_stack = _unit_stacks[i]; diff --git a/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml b/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml index 1b917fcae2..942f10df63 100644 --- a/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml +++ b/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml @@ -246,38 +246,12 @@ function move_unit_block(direction, blocks = 1, allow_collision = false) { } } -/// @description Creates a priority queue of enemy units based on their x-position and then moves each with `move_enemy_block()`. -function move_enemy_blocks() { - var _enemy_movement_queue = ds_priority_create(); - with (obj_enunit) { - ds_priority_add(_enemy_movement_queue, id, x); - } - while (!ds_priority_empty(_enemy_movement_queue)) { - var _enemy_block = ds_priority_delete_min(_enemy_movement_queue); - with (_enemy_block) { - move_enemy_block(); - } - } - ds_priority_destroy(_enemy_movement_queue); -} - -/// @description Attempts to move an enemy unit block, choosing direction based on whenever they are flanking or not, only if `obj_nfort` doesn't exists. -/// @mixin -function move_enemy_block() { - if (instance_exists(obj_nfort)) { - exit; - } - - var _direction = flank ? "east" : "west"; - move_unit_block(_direction); -} - function player_blocks_movement() { if (instance_exists(obj_nfort)) { exit; } - if ((obj_ncombat.defending || obj_ncombat.formation_set == 2)) { + if ((obj_ncombat.defending || obj_ncombat.player_formation == 2)) { exit; } @@ -425,11 +399,11 @@ function get_valid_weapon_stacks_unique(_stacks_struct, _range_min, _range_max) } function get_alpha_strike_target() { - if (obj_ncombat.alpha_strike <= 0) { + if (obj_ncombat.enemy_alpha_strike <= 0) { return -1; } - obj_ncombat.alpha_strike -= 0.5; + obj_ncombat.enemy_alpha_strike -= 0.5; with (obj_pnunit) { for (var u = 0; u < array_length(unit_struct); u++) { if (marine_type[u] == "Chapter Master") { diff --git a/scripts/scr_purge_world/scr_purge_world.gml b/scripts/scr_purge_world/scr_purge_world.gml index fd62e46881..dda90e3a8b 100644 --- a/scripts/scr_purge_world/scr_purge_world.gml +++ b/scripts/scr_purge_world/scr_purge_world.gml @@ -30,7 +30,7 @@ function scr_purge_world(star, planet, action_type, action_score) { obj_ncombat.dropping=0; obj_ncombat.attacking=10; obj_ncombat.enemy=10; - obj_ncombat.formation_set=1; + obj_ncombat.player_formation=1; /* obj_ncombat.battle_object=p_target; @@ -39,7 +39,7 @@ function scr_purge_world(star, planet, action_type, action_score) { obj_ncombat.dropping=1-attack; obj_ncombat.attacking=attack; obj_ncombat.enemy=attacking; - obj_ncombat.formation_set=formation_possible[formation_current]; + obj_ncombat.player_formation=formation_possible[formation_current]; */ obj_ncombat.leader=1; diff --git a/scripts/scr_roster/scr_roster.gml b/scripts/scr_roster/scr_roster.gml index 60743d9397..d337e72220 100644 --- a/scripts/scr_roster/scr_roster.gml +++ b/scripts/scr_roster/scr_roster.gml @@ -470,23 +470,23 @@ function PurgeButton(purge_image,xx,yy, purge_type) constructor{ function setup_battle_formations(){ // Formation here var new_combat = obj_ncombat; - obj_controller.bat_devastator_column = obj_controller.bat_deva_for[new_combat.formation_set]; - obj_controller.bat_assault_column = obj_controller.bat_assa_for[new_combat.formation_set]; - obj_controller.bat_tactical_column = obj_controller.bat_tact_for[new_combat.formation_set]; - obj_controller.bat_veteran_column = obj_controller.bat_vete_for[new_combat.formation_set]; - obj_controller.bat_hire_column = obj_controller.bat_hire_for[new_combat.formation_set]; - obj_controller.bat_librarian_column = obj_controller.bat_libr_for[new_combat.formation_set]; - obj_controller.bat_command_column = obj_controller.bat_comm_for[new_combat.formation_set]; - obj_controller.bat_techmarine_column = obj_controller.bat_tech_for[new_combat.formation_set]; - obj_controller.bat_terminator_column = obj_controller.bat_term_for[new_combat.formation_set]; - obj_controller.bat_honor_column = obj_controller.bat_hono_for[new_combat.formation_set]; - obj_controller.bat_dreadnought_column = obj_controller.bat_drea_for[new_combat.formation_set]; - obj_controller.bat_rhino_column = obj_controller.bat_rhin_for[new_combat.formation_set]; - obj_controller.bat_predator_column = obj_controller.bat_pred_for[new_combat.formation_set]; - obj_controller.bat_landraider_column = obj_controller.bat_landraid_for[new_combat.formation_set]; - obj_controller.bat_landspeeder_column = obj_controller.bat_landspee_for[new_combat.formation_set]; - obj_controller.bat_whirlwind_column = obj_controller.bat_whirl_for[new_combat.formation_set]; - obj_controller.bat_scout_column = obj_controller.bat_scou_for[new_combat.formation_set]; + obj_controller.bat_devastator_column = obj_controller.bat_deva_for[new_combat.player_formation]; + obj_controller.bat_assault_column = obj_controller.bat_assa_for[new_combat.player_formation]; + obj_controller.bat_tactical_column = obj_controller.bat_tact_for[new_combat.player_formation]; + obj_controller.bat_veteran_column = obj_controller.bat_vete_for[new_combat.player_formation]; + obj_controller.bat_hire_column = obj_controller.bat_hire_for[new_combat.player_formation]; + obj_controller.bat_librarian_column = obj_controller.bat_libr_for[new_combat.player_formation]; + obj_controller.bat_command_column = obj_controller.bat_comm_for[new_combat.player_formation]; + obj_controller.bat_techmarine_column = obj_controller.bat_tech_for[new_combat.player_formation]; + obj_controller.bat_terminator_column = obj_controller.bat_term_for[new_combat.player_formation]; + obj_controller.bat_honor_column = obj_controller.bat_hono_for[new_combat.player_formation]; + obj_controller.bat_dreadnought_column = obj_controller.bat_drea_for[new_combat.player_formation]; + obj_controller.bat_rhino_column = obj_controller.bat_rhin_for[new_combat.player_formation]; + obj_controller.bat_predator_column = obj_controller.bat_pred_for[new_combat.player_formation]; + obj_controller.bat_landraider_column = obj_controller.bat_landraid_for[new_combat.player_formation]; + obj_controller.bat_landspeeder_column = obj_controller.bat_landspee_for[new_combat.player_formation]; + obj_controller.bat_whirlwind_column = obj_controller.bat_whirl_for[new_combat.player_formation]; + obj_controller.bat_scout_column = obj_controller.bat_scou_for[new_combat.player_formation]; } function add_unit_to_battle(unit,meeting, is_local){ diff --git a/scripts/scr_shoot/scr_shoot.gml b/scripts/scr_shoot/scr_shoot.gml index fbdbb6c629..7871820134 100644 --- a/scripts/scr_shoot/scr_shoot.gml +++ b/scripts/scr_shoot/scr_shoot.gml @@ -144,8 +144,8 @@ function scr_shoot(_weapon_stack, _target_object, _target_index) { _target_object.column_size -= _target_stack.unit_size * _casualties; if (_target_stack.unit_count <= 0) { - array_delete(_target_squad.member_stacks, array_get_index(_target_squad.member_stacks, _target_stack), 1); - if (array_length(_target_squad.member_stacks) <= 0) { + array_delete(_target_squad.units, array_get_index(_target_squad.units, _target_stack), 1); + if (array_length(_target_squad.units) <= 0) { array_delete(_target_object.unit_squads, array_get_index(_target_object.unit_squads, _target_squad), 1); } } diff --git a/scripts/scr_string_functions/scr_string_functions.gml b/scripts/scr_string_functions/scr_string_functions.gml index cbf6e9fc8e..a330327ae2 100644 --- a/scripts/scr_string_functions/scr_string_functions.gml +++ b/scripts/scr_string_functions/scr_string_functions.gml @@ -62,6 +62,17 @@ function string_plural_count(_string, _variable, _use_x = true) { return _modified_string; } +/// @function string_plural_count +/// @description This function adds the x(variable) text at the start. +/// @param {string} _string +/// @param {real} _variable Variable to add at the start. +/// @returns {string} Modified string. +function string_with_count(_string, _variable, _use_x = true) { + var _x = _use_x ? "x" : ""; + var _modified_string = $"{_variable}{_x} {_string}"; + return _modified_string; +} + /// @function string_truncate /// @description Truncates a string to fit within a specified pixel width, appending "..." if the string was truncated. /// @param {string} _string diff --git a/scripts/scr_struct_functions/scr_struct_functions.gml b/scripts/scr_struct_functions/scr_struct_functions.gml index 68d36b8f1f..9dc286583a 100644 --- a/scripts/scr_struct_functions/scr_struct_functions.gml +++ b/scripts/scr_struct_functions/scr_struct_functions.gml @@ -34,7 +34,7 @@ function CountingMap() constructor { for (var i = 0; i < array_length(keys); i++) { var key = keys[i]; - result += $"{map[$ key]}x {key}{smart_delimeter_sign(keys, i, false)}"; + result += $"{string_plural_count(key, map[$ key])}{smart_delimeter_sign(keys, i, false)}"; } return result; @@ -47,6 +47,10 @@ function CountingMap() constructor { static get = function(_key) { return struct_exists(map, _key) ? map[$ _key] : 0; }; + + static clear = function() { + map = {}; + }; } function Set(_array = []) constructor { diff --git a/scripts/scr_weapon_stacks/scr_weapon_stacks.gml b/scripts/scr_weapon_stacks/scr_weapon_stacks.gml index 9a4a42e586..a58de4743a 100644 --- a/scripts/scr_weapon_stacks/scr_weapon_stacks.gml +++ b/scripts/scr_weapon_stacks/scr_weapon_stacks.gml @@ -6,23 +6,85 @@ enum eTARGET_TYPE { Fortification, } +function PlayerArmy() constructor { + units_count = 0; + vehicle_count = 0; + strength = 0; + +} + +function EnemyArmy(_name = "", _copy_profile = true) constructor { + name = _name; + squads = []; + units = []; + profile = {}; + unit_count = 0; + + static copy_profile = function() { + var _army_profiles = global.army_profiles; + if (struct_exists(_army_profiles, name)) { + var _profile = _army_profiles[$ name]; + profile = _profile; + } + }; + + if (_copy_profile) { + copy_profile(); + } + + static spawn_squads = function() { + if (struct_exists(profile, "units")) { + var _units = profile.units; + for (var i = 0, l = array_length(_units); i < l; i++) { + var _unit = _units[i]; + var _unit_name = _unit.name; + var _unit_count = _unit.count; + repeat (_unit_count) { + var _unit_struct = new EnemyUnit(_unit_name); + array_push(units, _unit_struct); + unit_count++; + var _cell = ds_grid_get(obj_ncombat.battlefield, 0, 0); + array_push(_cell, _unit_struct); + } + } + } + + if (struct_exists(profile, "squads")) { + var _squads = profile.squads; + for (var i = 0, l = array_length(_squads); i < l; i++) { + var _squad = _squads[i]; + var _squad_name = _squad.name; + var _squad_count = _squad.count; + repeat (_squad_count) { + var _squad_struct = new EnemySquad(_squad_name); + array_push(squads, _squad_struct); + unit_count += _squad_struct.member_count; + var _cell = ds_grid_get(obj_ncombat.battlefield, 0, 0); + array_push(_cell, _squad_struct); + } + } + } + }; + + static move_forces = function () { + for (var i = 0, l = array_length(squads); i < l; i++) { + var _squad = squads[i]; + _squad.move(); + } + + for (var i = 0, l = array_length(units); i < l; i++) { + var _unit = units[i]; + _unit.move(); + } + }; +} + function WeaponStack(_name) constructor { weapon_name = _name; weapon_count = 0; - range = 0; - attack = 0; - piercing = 0; - ammo_current = 0; - ammo_max = 0; - ammo_reload_current = 0; - ammo_reload = 0; - shot_count = 0; + weapon_profile = {}; owners = []; target_type = eTARGET_TYPE.Normal; - - static total_attack = function() { - return attack * weapon_count; - }; } global.unit_profiles = json_to_gamemaker(working_directory + "\\data\\unit_profiles.jsonc", json_parse); @@ -32,11 +94,13 @@ global.army_profiles = json_to_gamemaker(working_directory + "\\data\\army_profi function EnemySquad(_name, _copy_profile = true) constructor { name = _name; display_name = _name; - squad_type = eTARGET_TYPE.Normal; - squad_size = 0; squad_profile = {}; - member_count = 0; - member_stacks = []; + units = []; + member_count = array_length(units); + location = -1; + movement = -1; + can_move = true; + target = -1; static copy_squad_profile = function() { var _squad_template = global.squad_profiles[$ name]; @@ -47,52 +111,53 @@ function EnemySquad(_name, _copy_profile = true) constructor { for (var k = 0, l = array_length(_unit_names); k < l; k++){ var _unit_name = _unit_names[k]; var _unit = _squad_members[$ _unit_name]; - var _unit_stack = new EnemyStack(_unit_name, _unit.count); - array_push(member_stacks, _unit_stack); - member_count += _unit.count; - squad_size += _unit.count * _unit_stack.unit_size; + + repeat (_unit.count) { + var _unit_object = new EnemyUnit(_unit_name); + array_push(units, _unit_object); + squad_size += _unit_object.unit_size; + } + + if (movement == -1 || _unit_object.unit_profile.movement < movement) { + movement = _unit_object.unit_profile.movement; + } } }; - if (_copy_profile) { copy_squad_profile(); } -} -function EnemyStack(_name, _unit_count, _copy_profile = true) constructor { - unit_name = _name; - display_name = _name; - unit_count = _unit_count; - abilities = []; - armour = 0; - health = 0; - health_current = 0; - resistance = 0; - unit_type = eTARGET_TYPE.Normal; - unit_size = 0; - weapons = []; - ranged_mod = 1; - melee_mod = 1; - unit_profile = {}; + static get_size = function () { + var _size = 0; - static copy_unit_profile = function(_name) { - var _unit_profiles = global.unit_profiles; - if (struct_exists(_unit_profiles, _name)) { - var _profile_struct = _unit_profiles[$ _name]; - unit_profile = _profile_struct; - var _stat_names = struct_get_names(_profile_struct); - var _stat_len = array_length(_stat_names); - for (var k = 0; k < _stat_len; k++){ - var _stat_name = _stat_names[k]; - struct_set(self, _stat_name, _profile_struct[$ _stat_name]); - } - health_current = health; + for (var i = 0, l = array_length(units); i < l; i++) { + var _unit = units[i]; + + _size += _unit.unit_profile.unit_size; } - }; - if (_copy_profile) { - copy_unit_profile(_name); + return _size; } + + static move = function() { + if (location == -1 || can_move == false) { + exit; + } + + location = min(location + movement, obj_ncombat.battlefield.size - 1); + }; + + static attack = function() { + var _weapons = new CountingMap(); + + for (var i = 0, l = array_length(units); i < l; i++) { + var _unit = units[i]; + var _unit_weapons = _unit.weapons; + for (var w = 0, l2 = array_length(_unit_weapons); w < l2; w++) { + var _unit_weapon = _unit_weapons[w]; + } + } + }; } function EnemyUnit(_name, _copy_profile = true) constructor { @@ -109,6 +174,8 @@ function EnemyUnit(_name, _copy_profile = true) constructor { ranged_mod = 1; melee_mod = 1; unit_profile = {}; + can_move = true; + location = -1; static copy_unit_profile = function(_name) { var _unit_profiles = global.unit_profiles; @@ -128,4 +195,12 @@ function EnemyUnit(_name, _copy_profile = true) constructor { if (_copy_profile) { copy_unit_profile(_name); } + + static move = function() { + if (location == -1 || can_move == false) { + exit; + } + + location = min(location + unit_profile.movement, obj_ncombat.battlefield.size - 1); + }; } From 286c32d939bdad4b1e8a01ca71cf4e49c011af76 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Sun, 4 May 2025 14:44:24 +0300 Subject: [PATCH 75/80] More grid, squad, unit, etc shit --- datafiles/data/army_profiles.jsonc | 8 +- datafiles/data/squad_profiles.jsonc | 84 ++++- objects/obj_enunit/Create_0.gml | 6 +- objects/obj_ncombat/Create_0.gml | 82 +---- objects/obj_ncombat/Draw_64.gml | 2 +- objects/obj_ncombat/Step_0.gml | 34 +- scripts/scr_clean/scr_clean.gml | 16 +- .../scr_enunit_scripts/scr_enunit_scripts.gml | 4 +- .../scr_ncombat_scripts.gml | 29 +- .../scr_pnunit_scripts/scr_pnunit_scripts.gml | 2 +- .../scr_punit_combat_heplers.gml | 2 +- scripts/scr_shoot/scr_shoot.gml | 2 +- .../scr_weapon_stacks/scr_weapon_stacks.gml | 324 ++++++++++++------ 13 files changed, 349 insertions(+), 246 deletions(-) diff --git a/datafiles/data/army_profiles.jsonc b/datafiles/data/army_profiles.jsonc index 6a5686b4c7..bb61573da6 100644 --- a/datafiles/data/army_profiles.jsonc +++ b/datafiles/data/army_profiles.jsonc @@ -2,7 +2,7 @@ "orks_6": { "display_name": "Huge Ork Army", "description": "A huge army of green gigachads.", - "units": [ + "squads": [ { "name": "deff_dread", "count": 36 @@ -18,11 +18,9 @@ { "name": "warboss", "count": 1 - } - ], - "squads": [ + }, { - "name": "gretchins", + "name": "gretchin", "count": 70 }, { diff --git a/datafiles/data/squad_profiles.jsonc b/datafiles/data/squad_profiles.jsonc index 6b803634fd..3846fa112e 100644 --- a/datafiles/data/squad_profiles.jsonc +++ b/datafiles/data/squad_profiles.jsonc @@ -1,7 +1,10 @@ { "flash_gitz": { "display_name": "Flash Gitz", - "members": { + "keywords": [ + "INFANTRY" + ], + "units": { "flash_git": { "count": 9 }, @@ -12,7 +15,10 @@ }, "kommandos": { "display_name": "Kommandos", - "members": { + "keywords": [ + "INFANTRY" + ], + "units": { "kommando": { "count": 14 }, @@ -23,7 +29,10 @@ }, "slugga_boyz": { "display_name": "Slugga Boyz", - "members": { + "keywords": [ + "INFANTRY" + ], + "units": { "slugga_boy": { "count": 29 }, @@ -34,7 +43,10 @@ }, "shoota_boyz": { "display_name": "Shoota Boyz", - "members": { + "keywords": [ + "INFANTRY" + ], + "units": { "shoota_boy": { "count": 29 }, @@ -45,7 +57,10 @@ }, "ard_boyz": { "display_name": "Ard Boyz", - "members": { + "keywords": [ + "INFANTRY" + ], + "units": { "ard_boy": { "count": 29 }, @@ -54,9 +69,12 @@ } } }, - "gretchins": { - "display_name": "Gretchins", - "members": { + "gretchin": { + "display_name": "Gretchin", + "keywords": [ + "INFANTRY" + ], + "units": { "gretchin": { "count": 30 }, @@ -67,7 +85,10 @@ }, "tankbustas": { "display_name": "Tankbustas", - "members": { + "keywords": [ + "INFANTRY" + ], + "units": { "tankbusta": { "count": 14 }, @@ -78,7 +99,10 @@ }, "meganobz": { "display_name": "Meganobz", - "members": { + "keywords": [ + "INFANTRY" + ], + "units": { "meganob": { "count": 9 }, @@ -89,10 +113,48 @@ }, "warboss": { "display_name": "Warboss", - "members": { + "keywords": [ + "INFANTRY", + "CHARACTER" + ], + "units": { "warboss": { "count": 1 } } + }, + "deff_dread": { + "display_name": "Deff Dread", + "keywords": [ + "VEHICLE" + ], + "units": { + "deff_dread": { + "count": 1 + } + } + }, + "battlewagon": { + "display_name": "Battlewagon", + "keywords": [ + "VEHICLE" + ], + "units": { + "battlewagon": { + "count": 1 + } + } + }, + "mekboy": { + "display_name": "Mekboy", + "keywords": [ + "INFANTRY", + "CHARACTER" + ], + "units": { + "mekboy": { + "count": 1 + } + } } } \ No newline at end of file diff --git a/objects/obj_enunit/Create_0.gml b/objects/obj_enunit/Create_0.gml index bd114a79bf..b7b640b51e 100644 --- a/objects/obj_enunit/Create_0.gml +++ b/objects/obj_enunit/Create_0.gml @@ -50,7 +50,7 @@ copy_block_composition = function(_composition) { var _unit_name = _unit.name; var _unit_count = _unit.count; repeat (_unit_count) { - var _unit_struct = new EnemyUnit(_unit_name); + var _unit_struct = new BattleUnit(_unit_name); array_push(units, _unit_struct); column_size += _unit_struct.unit_size; } @@ -64,7 +64,7 @@ copy_block_composition = function(_composition) { var _squad_name = _squad.name; var _squad_count = _squad.count; repeat (_squad_count) { - var _squad_struct = new EnemySquad(_squad_name); + var _squad_struct = new BattleSquad(_squad_name); array_push(unit_squads, _squad_struct); column_size += _squad_struct.squad_size; } @@ -93,7 +93,7 @@ unit_count = function() { for (var i = 0, l = array_length(unit_squads); i < l; i++){ var _unit_squad = unit_squads[i]; - _unit_count += _unit_squad.member_count; + _unit_count += _unit_squad.unit_count; } // if (DEBUG_COMBAT_PERFORMANCE) { diff --git a/objects/obj_ncombat/Create_0.gml b/objects/obj_ncombat/Create_0.gml index a457073415..f06a2d2b3e 100644 --- a/objects/obj_ncombat/Create_0.gml +++ b/objects/obj_ncombat/Create_0.gml @@ -167,7 +167,8 @@ vehicle_deaths = 0; casualties = 0; world_size = 0; -turn_stage = eBATTLE_TURN.PlayerStart; +turn_phase = eBATTLE_TURN_PHASE.Movement; +turn_side = eBATTLE_ALLEGIANCE.Player; // @@ -303,27 +304,27 @@ if (obj_ini.occulobe) { enemy_dudes = ""; global_defense = 2 - global_defense; -enemy_force = new EnemyArmy("", false); -player_force = new PlayerArmy(); +enemy_force = new BattleArmy("", false); +player_force = new BattleArmy(global.chapter_name, false); queue_force_health = function() { var _text = ""; - if (turn_stage == eBATTLE_TURN.PlayerStart) { - if (player_forces > 0) { - _text = $"The {global.chapter_name} are at {string(round((player_forces / player_max) * 100))}% strength!"; + if (turn_phase == eBATTLE_TURN_PHASE.Movement) { + if (turn_side == eBATTLE_ALLEGIANCE.Player) { + if (player_forces > 0) { + _text = $"The {global.chapter_name} are at {string(round((player_forces / player_max) * 100))}% strength!"; + } else { + _text = $"The {global.chapter_name} are defeated!"; + } } else { - _text = $"The {global.chapter_name} are defeated!"; + if (enemy_forces > 0) { + _text = $"The enemy forces are at {string(max(1, round((enemy_forces / enemy_max) * 100)))}% strength!"; + } else { + _text = "The enemy forces are defeated!"; + } } - } else { - if (enemy_forces > 0) { - _text = $"The enemy forces are at {string(max(1, round((enemy_forces / enemy_max) * 100)))}% strength!"; - } else { - _text = "The enemy forces are defeated!"; - } - } - if (_text != "") { queue_battlelog_message(_text, COL_YELLOW); } } @@ -368,55 +369,4 @@ update_battlefield_scale = function() { battlefield_scale = min(1, 400 / _biggest_block_size); }; - - -function BattlefieldGridCell() constructor { - terrain = 0; - capacity = 1000; - player_units = []; - player_squads = []; - enemy_units = []; - enemy_squads = []; - - reset = function() { - terrain = 0; - capacity = 1000; - player_units = []; - player_squads = []; - enemy_units = []; - enemy_squads = []; - } -} - -function BattlefieldGrid(_width, _height) constructor { - width = _width; - height = _height; - data = array_create(_width * _height, new BattlefieldGridCell()); - size = array_length(data); - - static index = function(_x, _y) { - return _x + _y * width; - }; - - static set = function(_x, _y, _value) { - if (_x >= 0 && _x < width && _y >= 0 && _y < height) { - data[index(_x, _y)] = _value; - } - }; - - static get = function(_x, _y) { - if (_x >= 0 && _x < width && _y >= 0 && _y < height) { - return data[index(_x, _y)]; - } - return undefined; - }; - - static clear = function(_value) { - var _size = array_length(data); - for (var _i = 0; _i < _size; _i++) { - data[_i].reset(); - } - }; -} - battlefield = new BattlefieldGrid(100, 1); diff --git a/objects/obj_ncombat/Draw_64.gml b/objects/obj_ncombat/Draw_64.gml index f984fe1fca..666e1abe21 100644 --- a/objects/obj_ncombat/Draw_64.gml +++ b/objects/obj_ncombat/Draw_64.gml @@ -97,7 +97,7 @@ if (battle_stage == eBATTLE_STAGE.Main) { draw_text(400, 860, "[Press Enter to Begin]"); } else if (battle_stage == eBATTLE_STAGE.PlayerWinEnd || battle_stage == eBATTLE_STAGE.EnemyWinEnd) { draw_text(400, 860, "[Press Enter to Exit]"); -} else if (turn_stage == eBATTLE_TURN.PlayerStart || turn_stage == eBATTLE_TURN.EnemyStart) { +} else if (turn_phase == eBATTLE_TURN_PHASE.Movement) { draw_text(400, 860, "[Press Enter to Continue]"); } diff --git a/objects/obj_ncombat/Step_0.gml b/objects/obj_ncombat/Step_0.gml index 3d7b06d539..deff3b901d 100644 --- a/objects/obj_ncombat/Step_0.gml +++ b/objects/obj_ncombat/Step_0.gml @@ -36,7 +36,7 @@ if (battle_stage == eBATTLE_STAGE.Creation) { battle_stage = eBATTLE_STAGE.Main; if (obj_ncombat.enemy == 30 || battle_special == "ship_demon") { - turn_stage = eBATTLE_TURN.PlayerEnd; + turn_side = eBATTLE_ALLEGIANCE.Enemy; } if (DEBUG_COMBAT_PERFORMANCE) { @@ -45,7 +45,7 @@ if (battle_stage == eBATTLE_STAGE.Creation) { } if ((press_exclusive(vk_enter) || hold_exclusive(vk_enter)) && fading_strength == 0) { - if (turn_stage == eBATTLE_TURN.PlayerStart || turn_stage == eBATTLE_TURN.EnemyStart) { + if (turn_phase == eBATTLE_TURN_PHASE.Movement) { if (DEBUG_COMBAT_PERFORMANCE) { stopwatch("BATTLE_TURN.Start"); } @@ -56,7 +56,7 @@ if ((press_exclusive(vk_enter) || hold_exclusive(vk_enter)) && fading_strength = resolve_battle_state(); display_message_queue(); - if (turn_stage == eBATTLE_TURN.EnemyStart) { + if (turn_side == eBATTLE_ALLEGIANCE.Enemy) { battlefield.move_enemies(); if (instance_exists(obj_enunit)) { if (DEBUG_COMBAT_PERFORMANCE) { @@ -81,7 +81,7 @@ if ((press_exclusive(vk_enter) || hold_exclusive(vk_enter)) && fading_strength = display_message_queue(); } - if (turn_stage == eBATTLE_TURN.PlayerStart) { + if (turn_side == eBATTLE_ALLEGIANCE.Player) { player_blocks_movement(); if (DEBUG_COMBAT_PERFORMANCE) { stopwatch("pnunit_stacking_shooting"); @@ -103,14 +103,14 @@ if ((press_exclusive(vk_enter) || hold_exclusive(vk_enter)) && fading_strength = queue_force_health(); display_message_queue(); - turn_stage = (turn_stage == eBATTLE_TURN.PlayerStart) ? eBATTLE_TURN.PlayerEnd : eBATTLE_TURN.EnemyEnd; + turn_phase = eBATTLE_TURN_PHASE.Morale; if (DEBUG_COMBAT_PERFORMANCE) { stopwatch("BATTLE_TURN.Start"); } } - if (turn_stage == eBATTLE_TURN.EnemyEnd || turn_stage == eBATTLE_TURN.PlayerEnd) { + if (turn_phase == eBATTLE_TURN_PHASE.Morale) { if (DEBUG_COMBAT_PERFORMANCE) { stopwatch("BATTLE_TURN.End"); } @@ -127,12 +127,12 @@ if ((press_exclusive(vk_enter) || hold_exclusive(vk_enter)) && fading_strength = update_battlefield_scale(); - if (turn_stage == eBATTLE_TURN.EnemyEnd) { - turn_stage = eBATTLE_TURN.PlayerStart; + if (turn_side == eBATTLE_ALLEGIANCE.Enemy) { + turn_side == eBATTLE_ALLEGIANCE.Player; } - if (turn_stage == eBATTLE_TURN.PlayerEnd) { - turn_stage = eBATTLE_TURN.EnemyStart; + if (turn_side == eBATTLE_ALLEGIANCE.Player) { + turn_side == eBATTLE_ALLEGIANCE.Enemy; } if (DEBUG_COMBAT_PERFORMANCE) { @@ -142,8 +142,6 @@ if ((press_exclusive(vk_enter) || hold_exclusive(vk_enter)) && fading_strength = if ((battle_stage == eBATTLE_STAGE.PlayerWinStart) || (battle_stage == eBATTLE_STAGE.EnemyWinStart)) { - instance_activate_object(obj_pnunit); - instance_activate_object(obj_enunit); battle_stage = eBATTLE_STAGE.PlayerWinEnd; var _quad_factor = 10; total_battle_exp_gain = _quad_factor * sqr(threat); @@ -162,8 +160,6 @@ if ((press_exclusive(vk_enter) || hold_exclusive(vk_enter)) && fading_strength = if (battle_stage == eBATTLE_STAGE.PlayerWinEnd) { instance_activate_all(); - instance_activate_object(obj_pnunit); - instance_activate_object(obj_enunit); instance_destroy(obj_popup); instance_destroy(obj_star_select); with (obj_pnunit) { @@ -175,18 +171,12 @@ if ((press_exclusive(vk_enter) || hold_exclusive(vk_enter)) && fading_strength = } function resolve_battle_state() { - if (enemy_forces <= 0 || !instance_exists(obj_enunit)) { + if (enemy_forces <= 0) { battle_ended = true; battle_stage = eBATTLE_STAGE.PlayerWinStart; - instance_activate_object(obj_pnunit); - turn_stage = eBATTLE_TURN.EnemyStart; - } else if (player_forces <= 0 || !instance_exists(obj_pnunit)) { - show_debug_message($"enemy_forces: {player_forces}"); - show_debug_message($"obj_enunit count: {instance_number(obj_pnunit)}}"); + } else if (player_forces <= 0) { battle_ended = true; battle_stage = eBATTLE_STAGE.EnemyWinStart; defeat = 1; - instance_activate_object(obj_pnunit); - turn_stage = eBATTLE_TURN.EnemyEnd; } } diff --git a/scripts/scr_clean/scr_clean.gml b/scripts/scr_clean/scr_clean.gml index c68f2f8634..d5526c4a8b 100644 --- a/scripts/scr_clean/scr_clean.gml +++ b/scripts/scr_clean/scr_clean.gml @@ -81,15 +81,15 @@ function scr_clean(target_object, weapon_data) { } valid_vehicles = array_shuffle(valid_vehicles); - if (target_type == eTARGET_TYPE.Armour && array_empty(valid_vehicles)) { - target_type = eTARGET_TYPE.Normal; - } else if (target_type = eTARGET_TYPE.Normal && array_empty(valid_marines)) { - target_type = eTARGET_TYPE.Armour; + if (target_type == eUNIT_TYPE.Vehicle && array_empty(valid_vehicles)) { + target_type = eUNIT_TYPE.Infantry; + } else if (target_type = eUNIT_TYPE.Normal && array_empty(valid_marines)) { + target_type = eUNIT_TYPE.Vehicle; } for (var shot = 0; shot < hostile_shots; shot++) { // ### Vehicle Damage Processing ### - if (target_type == eTARGET_TYPE.Armour && !array_empty(valid_vehicles)) { + if (target_type == eUNIT_TYPE.Vehicle && !array_empty(valid_vehicles)) { // Apply damage for each hostile shot, until we run out of targets hits++; @@ -185,7 +185,7 @@ function scr_clean(target_object, weapon_data) { array_delete(valid_vehicles, random_index, 1); units_lost++; if (array_empty(valid_vehicles)) { - target_type = eTARGET_TYPE.Normal; + target_type = eUNIT_TYPE.Infantry; continue; } } @@ -193,7 +193,7 @@ function scr_clean(target_object, weapon_data) { } // ### Marine Processing ### - if (target_type == eTARGET_TYPE.Normal && !array_empty(valid_marines)) { + if (target_type == eUNIT_TYPE.Infantry && !array_empty(valid_marines)) { // Apply damage for each shot hits++; @@ -252,7 +252,7 @@ function scr_clean(target_object, weapon_data) { array_delete(valid_marines, random_index, 1); units_lost++; if (array_empty(valid_marines)) { - target_type = eTARGET_TYPE.Armour; + target_type = eUNIT_TYPE.Vehicle; continue; } } diff --git a/scripts/scr_enunit_scripts/scr_enunit_scripts.gml b/scripts/scr_enunit_scripts/scr_enunit_scripts.gml index 3cd84b4605..044cd29072 100644 --- a/scripts/scr_enunit_scripts/scr_enunit_scripts.gml +++ b/scripts/scr_enunit_scripts/scr_enunit_scripts.gml @@ -76,7 +76,7 @@ function enunit_target_and_shoot() { var _is_fort = _best_target.object_index == obj_nfort; if (_is_fort) { _target_unit_index = 1; - _weapon_stack.target_type = eTARGET_TYPE.Fortification; + _weapon_stack.target_type = eUNIT_TYPE.Fortification; } if (DEBUG_COLUMN_PRIORITY_ENEMY) { @@ -114,7 +114,7 @@ function enunit_target_and_shoot() { if (instance_exists(obj_nfort) && (!flank)) { target_block = instance_nearest(x, y, obj_nfort); _target_unit_index = 1; - _weapon_stack.target_type = eTARGET_TYPE.Fortification; + _weapon_stack.target_type = eUNIT_TYPE.Fortification; } scr_shoot(_weapon_stack, target_block, _target_unit_index); diff --git a/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml b/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml index 6025ef197f..afdea2fae3 100644 --- a/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml +++ b/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml @@ -1,8 +1,10 @@ -enum eBATTLE_TURN { - PlayerStart, - PlayerEnd, - EnemyStart, - EnemyEnd, +enum eBATTLE_TURN_PHASE { + Movement, + Psychic, + Shooting, + Charge, + Fight, + Morale, } enum eBATTLE_STAGE { @@ -1427,10 +1429,7 @@ function ncombat_enemy_stacks_init() { if (threat == 6) { enemy_force.name = "orks_6"; enemy_force.copy_profile(); - enemy_force.spawn_squads(); - enemy_dudes = enemy_force.profile.description; - var _cell = ds_grid_get(battlefield, 0, 0); - var _cell = ds_grid_get(battlefield, 1, 0); + enemy_force.spawn_forces(); } } @@ -3490,7 +3489,7 @@ function ncombat_battle_start() { } if ((battle_special == "ruins") || (battle_special == "ruins_eldar")) { - newline = "The enemy forces are made up of " + string(enemy_dudes); + newline = "The enemy forces are made up of " + string(enemy_force.unit_count); if (enemy == 6) { newline += " Craftworld Eldar."; @@ -3528,7 +3527,7 @@ function ncombat_battle_start() { // if (rand=3) then p1="Advancing upon your forces are "; } - // p1+=string(enemy_dudes);// The number descriptor*/ + // p1+=string(enemy_force.unit_count);// The number descriptor*/ if (enemy == 2) { p1 = "Opposing your forces are a total of " + scr_display_number(floor(guard_effective)) + " Guardsmen, including Heavy Weapons and Armour."; @@ -3564,7 +3563,7 @@ function ncombat_battle_start() { rand = choose(1, 2, 3); if (rand < 4) { p1 = "Howls and grunts ring from the surrounding terrain as the Orks announce their presence. "; - p2 = string(enemy_dudes) + ", the bloodthirsty horde advances toward your Marines, ecstatic in their anticipation of carnage. "; + p2 = string(enemy_force.unit_count) + ", the bloodthirsty horde advances toward your Marines, ecstatic in their anticipation of carnage. "; p3 = p2; p2 = string_delete(p2, 2, 999); p3 = string_delete(p3, 1, 1); @@ -3572,7 +3571,7 @@ function ncombat_battle_start() { } } if ((enemy == 7) && (dropping == 1)) { - p1 = "The " + string(enemy_dudes) + "-some Orks howl and roar at the oncoming marines. Many of the beasts fire their weapons, more or less spraying rounds aimlessly into the sky."; + p1 = "The " + string(enemy_force.unit_count) + "-some Orks howl and roar at the oncoming marines. Many of the beasts fire their weapons, more or less spraying rounds aimlessly into the sky."; } if ((enemy == 8) && (dropping == 0)) { @@ -3584,7 +3583,7 @@ function ncombat_battle_start() { rand = choose(1, 2, 3); } if ((enemy == 9) && (dropping == 1)) { - p1 = "The " + string(enemy_dudes) + "-some Tyranids hiss and chitter as your marines rain down. Blasts of acid and spikes fill the sky, but none seem to quite find their mark."; + p1 = "The " + string(enemy_force.unit_count) + "-some Tyranids hiss and chitter as your marines rain down. Blasts of acid and spikes fill the sky, but none seem to quite find their mark."; } if ((enemy == 10) && (dropping == 0)) { @@ -3617,7 +3616,7 @@ function ncombat_battle_start() { rand = choose(1, 2, 3); if (rand < 4) { p1 = "Dirt crunches beneath the feet of the Necrons as they make their silent advance. "; - p2 = string(enemy_dudes) + ", the souless xeno advance toward your Marines, silent and pulsing with green energy. "; + p2 = string(enemy_force.unit_count) + ", the souless xeno advance toward your Marines, silent and pulsing with green energy. "; p3 = p2; p2 = string_delete(p2, 2, 999); p3 = string_delete(p3, 1, 1); diff --git a/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml b/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml index 2514ddb525..bbe4b4e03d 100644 --- a/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml +++ b/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml @@ -316,7 +316,7 @@ function target_enemy_squad(_battle_block, _target_type = -1) { for (var i = 0, l = array_length(_unit_squads); i < l; i++){ var _unit_squad = _unit_squads[i]; - var _unit_stack_count = _unit_squad.member_count; + var _unit_stack_count = _unit_squad.unit_count; var _unit_stack_type = _unit_squad.squad_type; if (_target_type == -1 || _unit_stack_type == _target_type) { diff --git a/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml b/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml index 942f10df63..95fcb0f213 100644 --- a/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml +++ b/scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml @@ -430,7 +430,7 @@ function get_target_priority(_weapon_stack, _block) { // Target type match bonus // var _type_bonus = 0; - // if (_weapon_stack.target_type == eTARGET_TYPE.Armour) { + // if (_weapon_stack.target_type == eUNIT_TYPE.Armour) { // _type_bonus = 20 * (block_type_size(_block, "armour") / _size); // } else { // _type_bonus = 20 * (block_type_size(_block, "men") / _size); diff --git a/scripts/scr_shoot/scr_shoot.gml b/scripts/scr_shoot/scr_shoot.gml index 7871820134..c3623477d1 100644 --- a/scripts/scr_shoot/scr_shoot.gml +++ b/scripts/scr_shoot/scr_shoot.gml @@ -71,7 +71,7 @@ function scr_shoot(_weapon_stack, _target_object, _target_index) { //* Enemy shooting if (owner == 2) { - if (_target_type == eTARGET_TYPE.Fortification) { + if (_target_type == eUNIT_TYPE.Fortification) { var _wall_weapon_damage = max(1, round(_weapon_attack - _target_object.ac[1])) * _shooter_count * max(1, _weapon_shot_count / 4); _target_object.hp[1] -= _wall_weapon_damage; diff --git a/scripts/scr_weapon_stacks/scr_weapon_stacks.gml b/scripts/scr_weapon_stacks/scr_weapon_stacks.gml index a58de4743a..2d55dbd23c 100644 --- a/scripts/scr_weapon_stacks/scr_weapon_stacks.gml +++ b/scripts/scr_weapon_stacks/scr_weapon_stacks.gml @@ -1,54 +1,154 @@ -enum eTARGET_TYPE { +enum eUNIT_TYPE { + Unknown, + Infantry, + Vehicle, + Monster, + Fortification, +}; + +enum eUNIT_SUBTYPE { Normal, - Armour, - Heavy, - Leader, + Character, + Flyer, + Monster, + Character, Fortification, +}; + +enum eBATTLE_ALLEGIANCE { + Unknown, + Player, + Ally, + Enemy, +}; + +global.unit_profiles = json_to_gamemaker(working_directory + "\\data\\unit_profiles.jsonc", json_parse); +global.squad_profiles = json_to_gamemaker(working_directory + "\\data\\squad_profiles.jsonc", json_parse); + +function convert_keywords_to_set() { + var _squad_names = struct_get_names(global.squad_profiles); + var _squad_len = array_length(_squad_names); + for (var k = 0; k < _squad_len; k++){ + var _squad_name = _squad_names[k]; + var _squad = global.squad_profiles[$ _squad_name]; + _squad.keywords = new Set(_squad.keywords); + } } -function PlayerArmy() constructor { - units_count = 0; - vehicle_count = 0; - strength = 0; +convert_keywords_to_set(); + +global.army_profiles = json_to_gamemaker(working_directory + "\\data\\army_profiles.jsonc", json_parse); + +function BattlefieldGrid(_width, _height) constructor { + width = _width; + height = _height; + /// @type {Array} + cells = array_create(_width * _height); + size = array_length(cells); + for (var i = 0; i < size; i++) { + cells[i] = new BattlefieldGridCell(); + } + + static get_cell_index = function(_x, _y) { + return _x + _y * width; + }; + + static get_cell_coords = function(_index) { + var x = _index % width; + var y = floor(_index / width); + return [x, y]; + }; + + static get_occupants_at = function(_x, _y) { + var _cell = get_cell(_x, _y); + if (_cell != undefined) { + return _cell.occupants; + } + return []; + }; + + static add_squad = function(_x, _y, _squad) { + if (_x >= 0 && _x < width && _y >= 0 && _y < height) { + array_push(cells[get_cell_index(_x, _y)].occupants, _squad); + return true; + } else { + return false; + } + }; + static remove_squad = function(_x, _y, _squad) { + if (_x >= 0 && _x < width && _y >= 0 && _y < height) { + array_delete_value(cells[get_cell_index(_x, _y)], _squad); + return true; + } else { + return false; + } + }; + + static get_cell = function(_x, _y) { + if (_x >= 0 && _x < width && _y >= 0 && _y < height) { + return cells[get_cell_index(_x, _y)]; + } + return undefined; + }; + + static soft_reset = function() { + var _size = array_length(cells); + for (var i = 0; i < _size; i++) { + cells[i].reset(); + } + }; } -function EnemyArmy(_name = "", _copy_profile = true) constructor { +function BattlefieldGridCell() constructor { + // terrain = -1; + // capacity = -1; + occupants = []; + + static reset = function() { + // terrain = 0; + // capacity = 1000; + occupants = []; + }; + + reset(); + + static get_occupants = function(_allegiance_type = -1, _squad_type = -1) { + var _filtered = []; + for (var i = 0, l = array_length(occupants); i < l; ++i) { + var _squad = occupants[i]; + var _match_allegiance = (_allegiance_type == -1 || _squad.allegiance == _allegiance_type); + var _match_type = (_squad_type == -1 || _squad._squad_type == _squad_type); + + if (_match_allegiance && _match_type) { + array_push(_filtered, _squad); + } + } + return _filtered; + } +} + +function BattleArmy(_name = "", _copy_profile = true) constructor { name = _name; - squads = []; - units = []; profile = {}; + squads = []; + squad_count = array_length(squads); unit_count = 0; + allegiance = eBATTLE_ALLEGIANCE.Unknown; + lost_units = []; + lost_squads = []; static copy_profile = function() { var _army_profiles = global.army_profiles; - if (struct_exists(_army_profiles, name)) { - var _profile = _army_profiles[$ name]; - profile = _profile; - } + var _profile = _army_profiles[$ name]; + profile = _profile; }; if (_copy_profile) { copy_profile(); } - static spawn_squads = function() { - if (struct_exists(profile, "units")) { - var _units = profile.units; - for (var i = 0, l = array_length(_units); i < l; i++) { - var _unit = _units[i]; - var _unit_name = _unit.name; - var _unit_count = _unit.count; - repeat (_unit_count) { - var _unit_struct = new EnemyUnit(_unit_name); - array_push(units, _unit_struct); - unit_count++; - var _cell = ds_grid_get(obj_ncombat.battlefield, 0, 0); - array_push(_cell, _unit_struct); - } - } - } - + static spawn_forces = function() { if (struct_exists(profile, "squads")) { var _squads = profile.squads; for (var i = 0, l = array_length(_squads); i < l; i++) { @@ -56,10 +156,11 @@ function EnemyArmy(_name = "", _copy_profile = true) constructor { var _squad_name = _squad.name; var _squad_count = _squad.count; repeat (_squad_count) { - var _squad_struct = new EnemySquad(_squad_name); + var _squad_struct = new BattleSquad(_squad_name); + _squad_struct.army = self; array_push(squads, _squad_struct); - unit_count += _squad_struct.member_count; - var _cell = ds_grid_get(obj_ncombat.battlefield, 0, 0); + unit_count += _squad_struct.unit_count; + var _cell = obj_ncombat.battlefield[0]; array_push(_cell, _squad_struct); } } @@ -71,136 +172,139 @@ function EnemyArmy(_name = "", _copy_profile = true) constructor { var _squad = squads[i]; _squad.move(); } - - for (var i = 0, l = array_length(units); i < l; i++) { - var _unit = units[i]; - _unit.move(); - } }; } -function WeaponStack(_name) constructor { - weapon_name = _name; - weapon_count = 0; - weapon_profile = {}; - owners = []; - target_type = eTARGET_TYPE.Normal; -} - -global.unit_profiles = json_to_gamemaker(working_directory + "\\data\\unit_profiles.jsonc", json_parse); -global.squad_profiles = json_to_gamemaker(working_directory + "\\data\\squad_profiles.jsonc", json_parse); -global.army_profiles = json_to_gamemaker(working_directory + "\\data\\army_profiles.jsonc", json_parse); - -function EnemySquad(_name, _copy_profile = true) constructor { +function BattleSquad(_name, _copy_profile = true) constructor { name = _name; display_name = _name; - squad_profile = {}; units = []; - member_count = array_length(units); + unit_count = array_length(units); location = -1; movement = -1; - can_move = true; - target = -1; + engaged = false; + /// @type {Struct.BattleSquad} + target_squad = {}; + army = {}; + allegiance = eBATTLE_ALLEGIANCE.Unknown; - static copy_squad_profile = function() { - var _squad_template = global.squad_profiles[$ name]; - var _squad_members = _squad_template.members; - display_name = _squad_template.display_name; + static copy_profile = function() { + var _profile = global.squad_profiles[$ name]; + var _units = _profile.units; + display_name = _profile.display_name; - var _unit_names = struct_get_names(_squad_members); + var _unit_names = struct_get_names(_units); for (var k = 0, l = array_length(_unit_names); k < l; k++){ - var _unit_name = _unit_names[k]; - var _unit = _squad_members[$ _unit_name]; + var _unit_name = _unit[k]; + var _unit = _units[$ _unit_name]; repeat (_unit.count) { - var _unit_object = new EnemyUnit(_unit_name); - array_push(units, _unit_object); - squad_size += _unit_object.unit_size; + var _battle_unit = new BattleUnit(_unit_name); + _battle_unit.squad = self; + array_push(units, _battle_unit); } - if (movement == -1 || _unit_object.unit_profile.movement < movement) { - movement = _unit_object.unit_profile.movement; + if (movement == -1 || _battle_unit.profile.movement < movement) { + movement = _battle_unit.profile.movement; } } }; + if (_copy_profile) { - copy_squad_profile(); + copy_profile(); } static get_size = function () { var _size = 0; - for (var i = 0, l = array_length(units); i < l; i++) { var _unit = units[i]; - - _size += _unit.unit_profile.unit_size; + _size += _unit.profile.size; } - return _size; - } + }; static move = function() { - if (location == -1 || can_move == false) { + if (location == -1 || engaged == true) { exit; } - location = min(location + movement, obj_ncombat.battlefield.size - 1); + location = [location[0]++, location[1]++]; }; static attack = function() { - var _weapons = new CountingMap(); + var _all_weapons = []; + for (var i = 0; i < array_length(units); i++) { + array_concat(_all_weapons, units[i].weapons); + } + target_squad.resolve_attacks(_all_weapons); + }; - for (var i = 0, l = array_length(units); i < l; i++) { - var _unit = units[i]; - var _unit_weapons = _unit.weapons; - for (var w = 0, l2 = array_length(_unit_weapons); w < l2; w++) { - var _unit_weapon = _unit_weapons[w]; - } + static resolve_attacks = function(_weapons) { + for (var i = 0; i < array_length(_weapons); i++) { + var _weapon = _weapons[i]; + /// @type {Struct.BattleUnit} + var _target_unit = array_random_element(target_squad.units); + _target_unit.apply_damage(_weapon); + } + + if (unit_count <= 0) { + array_push(army.lost_squads, self); + array_delete_value(army.squads, self); } }; } -function EnemyUnit(_name, _copy_profile = true) constructor { - unit_name = _name; +function BattleUnit(_name, _copy_profile = true) constructor { + name = _name; display_name = _name; abilities = []; armour = 0; health = 0; - health_current = 0; resistance = 0; - unit_type = eTARGET_TYPE.Normal; - unit_size = 0; weapons = []; ranged_mod = 1; melee_mod = 1; - unit_profile = {}; - can_move = true; - location = -1; + profile = {}; + squad = {}; - static copy_unit_profile = function(_name) { - var _unit_profiles = global.unit_profiles; - if (struct_exists(_unit_profiles, _name)) { - var _profile_struct = _unit_profiles[$ _name]; - unit_profile = _profile_struct; - var _stat_names = struct_get_names(_profile_struct); - var _stat_len = array_length(_stat_names); - for (var k = 0; k < _stat_len; k++){ - var _stat_name = _stat_names[k]; - struct_set(self, _stat_name, _profile_struct[$ _stat_name]); - } - health_current = health; + static copy_profile = function(_name) { + var _profile_struct = global.unit_profiles[$ _name]; + profile = _profile_struct; + var _stat_names = struct_get_names(_profile_struct); + var _stat_len = array_length(_stat_names); + for (var k = 0; k < _stat_len; k++){ + var _stat_name = _stat_names[k]; + struct_set(self, _stat_name, _profile_struct[$ _stat_name]); + } + for (var w = 0, l = array_length(weapons); w < l; w++) { + weapons[w] = new BattleWeapon(weapons[w], self); } }; if (_copy_profile) { - copy_unit_profile(_name); + copy_profile(_name); } - static move = function() { - if (location == -1 || can_move == false) { - exit; - } + static apply_damage = function(_weapon) { + var _min_damage = 0.25; + var _dice_sides = 50; + var _random_damage_mod = roll_dice_chapter(4, _dice_sides, "low") / 100; + var _armour_points = max(0, armour - _weapon.arp); + var _modified_damage = max(_min_damage, ((_weapon.attack.standard * _random_damage_mod) - _armour_points) * resistance); - location = min(location + unit_profile.movement, obj_ncombat.battlefield.size - 1); + health -= _modified_damage; + + if (health <= 0) { + array_push(squad.army.lost_units, self); + array_delete_value(squad.units, self); + } }; } + +function BattleWeapon(_name, _owner) constructor { + name = _name; + owner = _owner; + profile = global.weapons[? _name]; + ammo = profile.ammo; + reloading = -1; +} From df4738bdb15b07e3bdfa73a5c8ed6000b5623b01 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Tue, 6 May 2025 11:58:40 +0300 Subject: [PATCH 76/80] At some point it'll be playable --- ChapterMaster.yyp | 4 +- datafiles/data/army_profiles.jsonc | 4 +- datafiles/data/combat_role_profiles.jsonc | 50 ++ datafiles/data/squad_profiles.jsonc | 12 + datafiles/data/unit_profiles.jsonc | 670 +++++++++--------- objects/obj_enunit/Draw_64.gml | 2 +- objects/obj_ncombat/Create_0.gml | 59 +- objects/obj_ncombat/Draw_64.gml | 98 +-- objects/obj_ncombat/Step_0.gml | 134 ++-- objects/obj_pnunit/Draw_64.gml | 2 +- objects/obj_popup/Alarm_0.gml | 2 +- objects/obj_popup/Destroy_0.gml | 2 +- objects/obj_popup/Step_0.gml | 2 +- objects/obj_turn_end/Mouse_56.gml | 2 +- scripts/__init_external/__init_external.gml | 2 + .../scr_ancient_ruins/scr_ancient_ruins.gml | 2 +- scripts/scr_clean/scr_clean.gml | 2 +- .../scr_drop_select_function.gml | 2 +- .../scr_external_data_handling.gml | 29 + .../scr_external_data_handling.yy | 13 + .../scr_json_functions/scr_json_functions.gml | 26 +- .../scr_ncombat_scripts.gml | 30 +- .../scr_new_combat_scripts.gml | 536 ++++++++++++++ .../scr_new_combat_scripts.yy} | 4 +- scripts/scr_purge_world/scr_purge_world.gml | 2 +- .../scr_struct_functions.gml | 25 + .../scr_weapon_stacks/scr_weapon_stacks.gml | 310 -------- 27 files changed, 1173 insertions(+), 853 deletions(-) create mode 100644 datafiles/data/combat_role_profiles.jsonc create mode 100644 scripts/scr_external_data_handling/scr_external_data_handling.gml create mode 100644 scripts/scr_external_data_handling/scr_external_data_handling.yy create mode 100644 scripts/scr_new_combat_scripts/scr_new_combat_scripts.gml rename scripts/{scr_weapon_stacks/scr_weapon_stacks.yy => scr_new_combat_scripts/scr_new_combat_scripts.yy} (73%) delete mode 100644 scripts/scr_weapon_stacks/scr_weapon_stacks.gml diff --git a/ChapterMaster.yyp b/ChapterMaster.yyp index b6bdd2244e..e7a19bfb80 100644 --- a/ChapterMaster.yyp +++ b/ChapterMaster.yyp @@ -115,6 +115,7 @@ "ForcedPrefabProjectReferences":[], "IncludedFiles":[ {"$GMIncludedFile":"","%Name":"army_profiles.jsonc","CopyToMask":-1,"filePath":"datafiles/data","name":"army_profiles.jsonc","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, + {"$GMIncludedFile":"","%Name":"combat_role_profiles.jsonc","CopyToMask":-1,"filePath":"datafiles/data","name":"combat_role_profiles.jsonc","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"psychic_disciplines.json","CopyToMask":-1,"filePath":"datafiles/data","name":"psychic_disciplines.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"psychic_powers.json","CopyToMask":-1,"filePath":"datafiles/data","name":"psychic_powers.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"squad_profiles.jsonc","CopyToMask":-1,"filePath":"datafiles/data","name":"squad_profiles.jsonc","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, @@ -798,6 +799,7 @@ {"id":{"name":"scr_event_gossip","path":"scripts/scr_event_gossip/scr_event_gossip.yy",},}, {"id":{"name":"scr_event_log","path":"scripts/scr_event_log/scr_event_log.yy",},}, {"id":{"name":"scr_event_newlines","path":"scripts/scr_event_newlines/scr_event_newlines.yy",},}, + {"id":{"name":"scr_external_data_handling","path":"scripts/scr_external_data_handling/scr_external_data_handling.yy",},}, {"id":{"name":"scr_flavor","path":"scripts/scr_flavor/scr_flavor.yy",},}, {"id":{"name":"scr_flavor2","path":"scripts/scr_flavor2/scr_flavor2.yy",},}, {"id":{"name":"scr_fleet_advisor","path":"scripts/scr_fleet_advisor/scr_fleet_advisor.yy",},}, @@ -852,6 +854,7 @@ {"id":{"name":"scr_music","path":"scripts/scr_music/scr_music.yy",},}, {"id":{"name":"scr_ncombat_scripts","path":"scripts/scr_ncombat_scripts/scr_ncombat_scripts.yy",},}, {"id":{"name":"scr_necron_tombs","path":"scripts/scr_necron_tombs/scr_necron_tombs.yy",},}, + {"id":{"name":"scr_new_combat_scripts","path":"scripts/scr_new_combat_scripts/scr_new_combat_scripts.yy",},}, {"id":{"name":"scr_newtext","path":"scripts/scr_newtext/scr_newtext.yy",},}, {"id":{"name":"scr_ork_fleet_functions","path":"scripts/scr_ork_fleet_functions/scr_ork_fleet_functions.yy",},}, {"id":{"name":"scr_ork_planet_functions","path":"scripts/scr_ork_planet_functions/scr_ork_planet_functions.yy",},}, @@ -935,7 +938,6 @@ {"id":{"name":"scr_vehicle_order","path":"scripts/scr_vehicle_order/scr_vehicle_order.yy",},}, {"id":{"name":"scr_void_click","path":"scripts/scr_void_click/scr_void_click.yy",},}, {"id":{"name":"scr_wait_and_execute","path":"scripts/scr_wait_and_execute/scr_wait_and_execute.yy",},}, - {"id":{"name":"scr_weapon_stacks","path":"scripts/scr_weapon_stacks/scr_weapon_stacks.yy",},}, {"id":{"name":"scr_weapon","path":"scripts/scr_weapon/scr_weapon.yy",},}, {"id":{"name":"scr_zoom","path":"scripts/scr_zoom/scr_zoom.yy",},}, {"id":{"name":"turn_towards_point","path":"scripts/turn_towards_point/turn_towards_point.yy",},}, diff --git a/datafiles/data/army_profiles.jsonc b/datafiles/data/army_profiles.jsonc index bb61573da6..a009a76750 100644 --- a/datafiles/data/army_profiles.jsonc +++ b/datafiles/data/army_profiles.jsonc @@ -5,11 +5,11 @@ "squads": [ { "name": "deff_dread", - "count": 36 + "count": 12 }, { "name": "battlewagon", - "count": 220 + "count": 90 }, { "name": "mekboy", diff --git a/datafiles/data/combat_role_profiles.jsonc b/datafiles/data/combat_role_profiles.jsonc new file mode 100644 index 0000000000..4bd3ed22bc --- /dev/null +++ b/datafiles/data/combat_role_profiles.jsonc @@ -0,0 +1,50 @@ +{ + "battleline": { + "display_name": "Battleline", + "spawn_position": "center", + "preferred_distance": "mixed", + "description": "" + }, + "fire_support": { + "display_name": "Fire Support", + "spawn_position": "back", + "preferred_distance": "ranged", + "description": "" + }, + "assault": { + "display_name": "Assault", + "spawn_position": "front", + "preferred_distance": "melee", + "description": "" + }, + "command": { + "display_name": "Command", + "spawn_position": "back", + "preferred_distance": "back", + "description": "" + }, + "artillery": { + "display_name": "Artillery", + "spawn_position": "back", + "preferred_distance": "ranged", + "description": "" + }, + "fortification": { + "display_name": "Fortification", + "spawn_position": "front", + "preferred_distance": "none", + "description": "" + }, + "anti_armour": { + "display_name": "Anti-Armour", + "spawn_position": "back", + "preferred_distance": "ranged", + "description": "" + }, + "transport": { + "display_name": "Transport", + "spawn_position": "center", + "preferred_distance": "ranged", + "description": "" + } +} \ No newline at end of file diff --git a/datafiles/data/squad_profiles.jsonc b/datafiles/data/squad_profiles.jsonc index 3846fa112e..044a692b2b 100644 --- a/datafiles/data/squad_profiles.jsonc +++ b/datafiles/data/squad_profiles.jsonc @@ -1,6 +1,7 @@ { "flash_gitz": { "display_name": "Flash Gitz", + "combat_role": "fire_support", "keywords": [ "INFANTRY" ], @@ -15,6 +16,7 @@ }, "kommandos": { "display_name": "Kommandos", + "combat_role": "command", "keywords": [ "INFANTRY" ], @@ -29,6 +31,7 @@ }, "slugga_boyz": { "display_name": "Slugga Boyz", + "combat_role": "battleline", "keywords": [ "INFANTRY" ], @@ -43,6 +46,7 @@ }, "shoota_boyz": { "display_name": "Shoota Boyz", + "combat_role": "battleline", "keywords": [ "INFANTRY" ], @@ -57,6 +61,7 @@ }, "ard_boyz": { "display_name": "Ard Boyz", + "combat_role": "assault", "keywords": [ "INFANTRY" ], @@ -71,6 +76,7 @@ }, "gretchin": { "display_name": "Gretchin", + "combat_role": "assault", "keywords": [ "INFANTRY" ], @@ -85,6 +91,7 @@ }, "tankbustas": { "display_name": "Tankbustas", + "combat_role": "anti_armour", "keywords": [ "INFANTRY" ], @@ -99,6 +106,7 @@ }, "meganobz": { "display_name": "Meganobz", + "combat_role": "assault", "keywords": [ "INFANTRY" ], @@ -113,6 +121,7 @@ }, "warboss": { "display_name": "Warboss", + "combat_role": "command", "keywords": [ "INFANTRY", "CHARACTER" @@ -125,6 +134,7 @@ }, "deff_dread": { "display_name": "Deff Dread", + "combat_role": "assault", "keywords": [ "VEHICLE" ], @@ -136,6 +146,7 @@ }, "battlewagon": { "display_name": "Battlewagon", + "combat_role": "transport", "keywords": [ "VEHICLE" ], @@ -147,6 +158,7 @@ }, "mekboy": { "display_name": "Mekboy", + "combat_role": "command", "keywords": [ "INFANTRY", "CHARACTER" diff --git a/datafiles/data/unit_profiles.jsonc b/datafiles/data/unit_profiles.jsonc index 584a6eedef..8453c203f7 100644 --- a/datafiles/data/unit_profiles.jsonc +++ b/datafiles/data/unit_profiles.jsonc @@ -2,122 +2,122 @@ "malcadon_spyrer": { "display_name": "Malcadon Spyrer", "armour": 35, - "health": 200, + "health_points": 200, "resistance": 1, "weapons": [ "Web Spinner", "Venom Claws" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "greater_daemon_of_khorne": { "display_name": "Greater Daemon of Khorne", "armour": 12, - "health": 700, + "health_points": 700, "resistance": 0.5, "weapons": [ "Khorne Demon Melee" ], "unit_type": 1, - "unit_size": 3 + "size": 3 }, "greater_daemon_of_slaanesh": { "display_name": "Greater Daemon of Slaanesh", "armour": 10, - "health": 500, + "health_points": 500, "resistance": 0.25, "weapons": [ "Demon Melee", "Lash Whip" ], "unit_type": 1, - "unit_size": 3 + "size": 3 }, "greater_daemon_of_nurgle": { "display_name": "Greater Daemon of Nurgle", "armour": 8, - "health": 900, + "health_points": 900, "resistance": 0.6, "weapons": [ "Demon Melee", "Nurgle Vomit" ], "unit_type": 1, - "unit_size": 3 + "size": 3 }, "greater_daemon_of_tzeentch": { "display_name": "Greater Daemon of Tzeentch", "armour": 10, - "health": 600, + "health_points": 600, "resistance": 0.75, "weapons": [ "Demon Melee", "Witchfire" ], "unit_type": 1, - "unit_size": 3 + "size": 3 }, "bloodletter": { "display_name": "Bloodletter", "armour": 10, - "health": 200, + "health_points": 200, "resistance": 0.4, "weapons": [ "Bloodletter Melee" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "daemonette": { "display_name": "Daemonette", "armour": 8, - "health": 150, + "health_points": 150, "resistance": 0.3, "weapons": [ "Daemonette Melee" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "pink_horror": { "display_name": "Pink Horror", "armour": 8, - "health": 100, + "health_points": 100, "resistance": 0.5, "weapons": [ "Eldritch Fire" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "plaguebearer": { "display_name": "Plaguebearer", "armour": 5, - "health": 300, + "health_points": 300, "resistance": 0.4, "weapons": [ "Plaguebearer Melee" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "helbrute": { "display_name": "Helbrute", "armour": 40, - "health": 300, + "health_points": 300, "resistance": 0.5, "weapons": [ "Power Fist", "Multi-Melta" ], "unit_type": 0, - "unit_size": 10 + "size": 10 }, "soul_grinder": { "display_name": "Soul Grinder", "armour": 30, - "health": 350, + "health_points": 350, "resistance": 0.5, "weapons": [ "Warpsword", @@ -125,103 +125,103 @@ "Battle Cannon" ], "unit_type": 0, - "unit_size": 10 + "size": 10 }, "maulerfiend": { "display_name": "Maulerfiend", "armour": 30, - "health": 250, + "health_points": 250, "resistance": 0.5, "weapons": [ "Maulerfiend Claws" ], "unit_type": 0, - "unit_size": 10 + "size": 10 }, "imperial_guardsman": { "display_name": "Imperial Guardsman", "armour": 40, - "health": 5, + "health_points": 5, "resistance": 1, "weapons": [], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "heavy_weapons_team": { "display_name": "Heavy Weapons Team", "armour": 10, - "health": 100, + "health_points": 100, "resistance": 0.9, "weapons": [ "Heavy Bolter" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "ogryn": { "display_name": "Ogryn", "armour": 10, - "health": 120, + "health_points": 120, "resistance": 0.75, "weapons": [ "Ripper Gun", "Ogryn Melee" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "chimera": { "display_name": "Chimera", "armour": 40, - "health": 200, + "health_points": 200, "resistance": 0.75, "weapons": [ "Multi-Laster", "Heavy Bolter" ], "unit_type": 0, - "unit_size": 10 + "size": 10 }, "basilisk": { "display_name": "Basilisk", "armour": 20, - "health": 150, + "health_points": 150, "resistance": 1, "weapons": [ "Earthshaker Cannon", "Storm Bolter" ], "unit_type": 0, - "unit_size": 10 + "size": 10 }, "leman_russ_battle_tank": { "display_name": "Leman Russ Battle Tank", "armour": 45, - "health": 250, + "health_points": 250, "resistance": 0.25, "weapons": [ "Battle Cannon", "Lascannon" ], "unit_type": 0, - "unit_size": 10 + "size": 10 }, "leman_russ_demolisher": { "display_name": "Leman Russ Demolisher", "armour": 40, - "health": 250, + "health_points": 250, "resistance": 0.25, "weapons": [ "Demolisher Cannon", "Lascannon" ], "unit_type": 0, - "unit_size": 10 + "size": 10 }, "vendetta": { "display_name": "Vendetta", "armour": 20, - "health": 300, + "health_points": 300, "resistance": 0.25, "weapons": [ "Twin-Linked Lascannon", @@ -229,35 +229,35 @@ "Twin-Linked Lascannon" ], "unit_type": 0, - "unit_size": 10 + "size": 10 }, "thallax": { "display_name": "Thallax", "armour": 30, - "health": 80, + "health_points": 80, "resistance": 1, "weapons": [ "Lightning Gun", "Thallax Melee" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "praetorian_servitor": { "display_name": "Praetorian Servitor", "armour": 25, - "health": 150, + "health_points": 150, "resistance": 1, "weapons": [ "Phased Plasma-fusil" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "adeptas_leader": { "display_name": "Adeptas Leader", "armour": 10, - "health": 200, + "health_points": 200, "resistance": 0.25, "weapons": [ "Blessed Weapon", @@ -265,80 +265,80 @@ "Infernus Pistol" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "palatine": { "display_name": "Palatine", "armour": 10, - "health": 100, + "health_points": 100, "resistance": 0.5, "weapons": [ "Plasma Pistol", "Power Weapon" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "priest": { "display_name": "Priest", "armour": 0, - "health": 50, + "health_points": 50, "resistance": 0.5, "weapons": [ "Laspistol" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "arco_flagellent": { "display_name": "Arco-Flagellent", "armour": 0, - "health": 150, + "health_points": 150, "resistance": 0.7, "weapons": [ "Electro-Flail" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "celestian": { "display_name": "Celestian", "armour": 10, - "health": 60, + "health_points": 60, "resistance": 0.5, "weapons": [ "Bolter", "Chainsword" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "mistress": { "display_name": "Mistress", "armour": 10, - "health": 60, + "health_points": 60, "resistance": 0.5, "weapons": [ "Neural Whip" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "sister_repentia": { "display_name": "Sister Repentia", "armour": 0, - "health": 75, + "health_points": 75, "resistance": 0.75, "weapons": [ "Eviscerator" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "battle_sister": { "display_name": "Battle Sister", "armour": 10, - "health": 60, + "health_points": 60, "resistance": 0.75, "weapons": [ "Bolter", @@ -346,36 +346,36 @@ "Sarissa" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "seraphim": { "display_name": "Seraphim", "armour": 10, - "health": 60, + "health_points": 60, "resistance": 0.6, "weapons": [ "Seraphim Pistols", "Chainsword" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "dominion": { "display_name": "Dominion", "armour": 10, - "health": 60, + "health_points": 60, "resistance": 0.75, "weapons": [ "Meltagun", "Meltabomb" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "retributor": { "display_name": "Retributor", "armour": 10, - "health": 60, + "health_points": 60, "resistance": 0.6, "weapons": [ "Heavy Bolter", @@ -383,71 +383,71 @@ "Bolt Pistol" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "follower": { "display_name": "Follower", "armour": 0, - "health": 30, + "health_points": 30, "resistance": 1, "weapons": [ "Laspistol", "melee0.5" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "adeptas_rhino": { "display_name": "Adeptas Rhino", "armour": 40, - "health": 200, + "health_points": 200, "resistance": 0.75, "weapons": [ "Storm Bolter", "Storm Bolter" ], "unit_type": 0, - "unit_size": 10 + "size": 10 }, "adeptas_chimera": { "display_name": "Adeptas Chimera", "armour": 40, - "health": 200, + "health_points": 200, "resistance": 0.75, "weapons": [ "Heavy Flamer", "Heavy Flamer" ], "unit_type": 0, - "unit_size": 10 + "size": 10 }, "immolator": { "display_name": "Immolator", "armour": 40, - "health": 300, + "health_points": 300, "resistance": 0.35, "weapons": [ "Twin Linked Heavy Flamers" ], "unit_type": 0, - "unit_size": 10 + "size": 10 }, "exorcist": { "display_name": "Exorcist", "armour": 40, - "health": 200, + "health_points": 200, "resistance": 0.55, "weapons": [ "Exorcist Missile Launcher", "Storm Bolter" ], "unit_type": 0, - "unit_size": 10 + "size": 10 }, "penitent_engine": { "display_name": "Penitent Engine", "armour": 35, - "health": 150, + "health_points": 150, "resistance": 0.5, "weapons": [ "Close Combat Weapon", @@ -455,43 +455,43 @@ "Heavy Flamer" ], "unit_type": 0, - "unit_size": 10 + "size": 10 }, "eldar_leader": { "display_name": "Eldar Leader", "armour": 10, - "health": 150, + "health_points": 150, "resistance": 0.5, "weapons": [ "Singing Spear", "Singing Spear Throw" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "autarch": { "display_name": "Autarch", "armour": 12, - "health": 150, + "health_points": 150, "resistance": 0.75, "weapons": [ "Power Weapon", "Fusion Gun" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "farseer": { "display_name": "Farseer", "armour": 10, - "health": 120, + "health_points": 120, "resistance": 0.6, "weapons": [ "Singing Spear", "Singing Spear Throw" ], "unit_type": 0, - "unit_size": 1, + "size": 1, "abilities": [ "farseer_powers" ] @@ -499,86 +499,86 @@ "warlock": { "display_name": "Warlock", "armour": 10, - "health": 80, + "health_points": 80, "resistance": 0.75, "weapons": [ "Witchblade", "Psyshock" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "avatar": { "display_name": "Avatar", "armour": 40, - "health": 300, + "health_points": 300, "resistance": 0.55, "weapons": [ "Wailing Doom", "Avatar Smite" ], "unit_type": 0, - "unit_size": 10 + "size": 10 }, "mighty_avatar": { "display_name": "Mighty Avatar", "armour": 50, - "health": 450, + "health_points": 450, "resistance": 0.5, "weapons": [ "Wailing Doom", "Avatar Smite" ], "unit_type": 0, - "unit_size": 10 + "size": 10 }, "godly_avatar": { "display_name": "Godly Avatar", "armour": 60, - "health": 600, + "health_points": 600, "resistance": 0.4, "weapons": [ "Wailing Doom", "Avatar Smite" ], "unit_type": 0, - "unit_size": 10 + "size": 10 }, "ranger": { "display_name": "Ranger", "armour": 8, - "health": 40, + "health_points": 40, "resistance": 0.9, "weapons": [ "Ranger Long Rifle", "Shuriken Pistol" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "eldar_pathfinder": { "display_name": "Eldar Pathfinder", "armour": 8, - "health": 60, + "health_points": 60, "resistance": 0.8, "weapons": [ "Pathfinder Long Rifle", "Melee1" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "dire_avenger": { "display_name": "Dire Avenger", "armour": 10, - "health": 40, + "health_points": 40, "resistance": 1, "weapons": [ "Avenger Shuriken Catapult", "Melee1" ], "unit_type": 0, - "unit_size": 1, + "size": 1, "abilities": [ "shimmershield" ] @@ -586,13 +586,13 @@ "dire_avenger_exarch": { "display_name": "Dire Avenger Exarch", "armour": 10, - "health": 70, + "health_points": 70, "resistance": 1, "weapons": [ "Power Weapon" ], "unit_type": 0, - "unit_size": 1, + "size": 1, "abilities": [ "shimmershield" ] @@ -600,14 +600,14 @@ "howling_banshee": { "display_name": "Howling Banshee", "armour": 8, - "health": 40, + "health_points": 40, "resistance": 0.8, "weapons": [ "Power Weapon", "Shuriken Pistol" ], "unit_type": 0, - "unit_size": 1, + "size": 1, "abilities": [ "banshee_mask" ] @@ -615,13 +615,13 @@ "howling_banshee_exarch": { "display_name": "Howling Banshee Exarch", "armour": 10, - "health": 60, + "health_points": 60, "resistance": 0.75, "weapons": [ "Executioner" ], "unit_type": 0, - "unit_size": 1, + "size": 1, "abilities": [ "banshee_mask" ] @@ -629,7 +629,7 @@ "striking_scorpion": { "display_name": "Striking Scorpion", "armour": 8, - "health": 60, + "health_points": 60, "resistance": 1, "weapons": [ "Scorpion Chainsword", @@ -637,12 +637,12 @@ "Mandiblaster" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "striking_scorpion_exarch": { "display_name": "Striking Scorpion Exarch", "armour": 10, - "health": 80, + "health_points": 80, "resistance": 1, "weapons": [ "Biting Blade", @@ -650,12 +650,12 @@ "Mandiblaster" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "fire_dragon": { "display_name": "Fire Dragon", "armour": 12, - "health": 40, + "health_points": 40, "resistance": 1, "weapons": [ "Fusion Gun", @@ -663,30 +663,30 @@ "Melee1" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "fire_dragon_exarch": { "display_name": "Fire Dragon Exarch", "armour": 12, - "health": 60, + "health_points": 60, "resistance": 1, "weapons": [ "Firepike", "Power Weapon" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "warp_spider": { "display_name": "Warp Spider", "armour": 8, - "health": 40, + "health_points": 40, "resistance": 0.9, "weapons": [ "Deathspinner" ], "unit_type": 0, - "unit_size": 1, + "size": 1, "abilities": [ "warp_jump" ] @@ -694,14 +694,14 @@ "warp_spider_exarch": { "display_name": "Warp Spider Exarch", "armour": 10, - "health": 60, + "health_points": 60, "resistance": 0.8, "weapons": [ "Dual Deathspinners", "Powerblades" ], "unit_type": 0, - "unit_size": 1, + "size": 1, "abilities": [ "warp_jump" ] @@ -709,113 +709,113 @@ "dark_reaper": { "display_name": "Dark Reaper", "armour": 10, - "health": 40, + "health_points": 40, "resistance": 1, "weapons": [ "Reaper Launcher", "Melee1" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "dark_reaper_exarch": { "display_name": "Dark Reaper Exarch", "armour": 10, - "health": 50, + "health_points": 50, "resistance": 1, "weapons": [ "Tempest Launcher", "Melee1" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "shining_spear": { "display_name": "Shining Spear", "armour": 10, - "health": 75, + "health_points": 75, "resistance": 0.8, "weapons": [ "Laser Lance", "Twin Linked Shuriken Catapult" ], "unit_type": 0, - "unit_size": 10 + "size": 10 }, "guardian": { "display_name": "Guardian", "armour": 8, - "health": 30, + "health_points": 30, "resistance": 1, "weapons": [ "Shuriken Catapult", "Melee1" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "grav_platform": { "display_name": "Grav Platform", "armour": 10, - "health": 60, + "health_points": 60, "resistance": 1, "weapons": [ "Pulse Laser" ], "unit_type": 0, - "unit_size": 10 + "size": 10 }, "trouper": { "display_name": "Trouper", "armour": 8, - "health": 50, + "health_points": 50, "resistance": 0.25, "weapons": [ "Power Weapon", "Fusion Pistol" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "athair": { "display_name": "Athair", "armour": 8, - "health": 75, + "health_points": 75, "resistance": 0.25, "weapons": [ "Plasma Pistol", "Harlequin's Kiss" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "wraithguard": { "display_name": "Wraithguard", "armour": 15, - "health": 125, + "health_points": 125, "resistance": 0.7, "weapons": [ "Wraithcannon" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "vyper": { "display_name": "Vyper", "armour": 40, - "health": 100, + "health_points": 100, "resistance": 0.8, "weapons": [ "Twin Linked Shuriken Catapult", "Pulse Laser" ], "unit_type": 0, - "unit_size": 10 + "size": 10 }, "falcon": { "display_name": "Falcon", "armour": 40, - "health": 200, + "health_points": 200, "resistance": 0.6, "weapons": [ "Pulse Laser", @@ -823,35 +823,35 @@ "Bright Lance" ], "unit_type": 0, - "unit_size": 10 + "size": 10 }, "fire_prism": { "display_name": "Fire Prism", "armour": 40, - "health": 200, + "health_points": 200, "resistance": 0.5, "weapons": [ "Twin Linked Shuriken Catapult", "Prism Cannon" ], "unit_type": 0, - "unit_size": 10 + "size": 10 }, "nightspinner": { "display_name": "Nightspinner", "armour": 40, - "health": 200, + "health_points": 200, "resistance": 0.6, "weapons": [ "Twin Linked Doomweaver" ], "unit_type": 0, - "unit_size": 10 + "size": 10 }, "wraithlord": { "display_name": "Wraithlord", "armour": 40, - "health": 200, + "health_points": 200, "resistance": 0.5, "weapons": [ "Two Power Fists", @@ -859,12 +859,12 @@ "Starcannon" ], "unit_type": 0, - "unit_size": 10 + "size": 10 }, "phantom_titan": { "display_name": "Phantom Titan", "armour": 50, - "health": 800, + "health_points": 800, "resistance": 0.35, "weapons": [ "Two Power Fists", @@ -872,244 +872,230 @@ "Titan Starcannon" ], "unit_type": 0, - "unit_size": 10 - }, - "ork_leader": { - "display_name": "Ork Leader", - "armour": 12, - "health": 600, - "resistance": 0.5, - "weapons": [ - "Power Klaw", - "Rokkit Launcha", - "Big Shoota" - ], - "unit_type": 0, - "unit_size": 1, - "movement": 1 + "size": 10 }, "warboss": { "display_name": "Warboss", "armour": 12, - "health": 200, + "health_points": 200, "resistance": 0.75, "weapons": [ "Twin-Linked Shoota", "Power Klaw" ], "unit_type": 1, - "unit_size": 2, - "movement": 1 + "size": 2, + "movement": 6 }, "gretchin": { "display_name": "Gretchin", "armour": 0, - "health": 15, + "health_points": 15, "resistance": 1, "weapons": [ "Grot Blasta" ], "unit_type": 1, - "unit_size": 0.5, - "movement": 1 + "size": 0.5, + "movement": 6 }, "slugga_boy": { "display_name": "Slugga Boy", "armour": 5, - "health": 60, + "health_points": 60, "resistance": 1, "weapons": [ "Choppa", "Slugga" ], "unit_type": 0, - "unit_size": 1, - "movement": 1 + "size": 1, + "movement": 6 }, "shoota_boy": { "display_name": "Shoota Boy", "armour": 5, - "health": 60, + "health_points": 60, "resistance": 1, "weapons": [ "Choppa", "Shoota" ], "unit_type": 0, - "unit_size": 1, - "movement": 1 + "size": 1, + "movement": 6 }, "mekboy": { "display_name": "Mekboy", "armour": 12, - "health": 100, + "health_points": 100, "resistance": 0.75, "weapons": [ "Choppa", "Slugga" ], "unit_type": 0, - "unit_size": 1, - "movement": 1 + "size": 1, + "movement": 6 }, "runtherd": { "display_name": "Runtherd", "armour": 5, - "health": 60, + "health_points": 60, "resistance": 1, "weapons": [ "Choppa", "Slugga" ], "unit_type": 3, - "unit_size": 1, - "movement": 1 + "size": 1, + "movement": 6 }, "nob": { "display_name": "Nob", "armour": 5, - "health": 150, + "health_points": 150, "resistance": 1, "weapons": [ "Power Klaw", "Big Shoota" ], "unit_type": 0, - "unit_size": 1, - "movement": 1 + "size": 1, + "movement": 6 }, "boss_nob": { "display_name": "Boss Nob", "armour": 7, - "health": 200, + "health_points": 200, "resistance": 1, "weapons": [ "Big Choppa", "Twin-Linked Shoota" ], "unit_type": 3, - "unit_size": 2, - "movement": 1 + "size": 2, + "movement": 6 }, "meganob": { "display_name": "Meganob", "armour": 12, - "health": 150, + "health_points": 150, "resistance": 0.6, "weapons": [ "Twin-Linked Shoota", "Power Klaw" ], "unit_type": 1, - "unit_size": 2, - "movement": 1 + "size": 2, + "movement": 5 }, "boss_meganob": { "display_name": "Boss Meganob", "armour": 12, - "health": 150, + "health_points": 150, "resistance": 0.6, "weapons": [ "Twin-Linked Shoota", "Power Klaw" ], "unit_type": 3, - "unit_size": 2, - "movement": 1 + "size": 2, + "movement": 5 }, "flash_git": { "display_name": "Flash Git", "armour": 8, - "health": 100, + "health_points": 100, "resistance": 1, "weapons": [ "Snazzgun" ], "unit_type": 0, - "unit_size": 1, - "movement": 1 + "size": 1, + "movement": 6 }, "kaptin": { "display_name": "Kaptin", "armour": 8, - "health": 100, + "health_points": 100, "resistance": 1, "weapons": [ "Snazzgun" ], "unit_type": 3, - "unit_size": 1, - "movement": 1 + "size": 1, + "movement": 6 }, "cybork": { "display_name": "Cybork", "armour": 8, - "health": 125, + "health_points": 125, "resistance": 0.75, "weapons": [ "Power Klaw", "Big Shoota" ], "unit_type": 0, - "unit_size": 1, - "movement": 1 + "size": 1, + "movement": 6 }, "ard_boy": { "display_name": "Ard Boy", "armour": 8, - "health": 80, + "health_points": 80, "resistance": 0.9, "weapons": [ "Choppa", "Slugga" ], "unit_type": 0, - "unit_size": 1, - "movement": 1 + "size": 1, + "movement": 6 }, "kommando": { "display_name": "Kommando", "armour": 10, - "health": 125, + "health_points": 125, "resistance": 0.9, "weapons": [ "Choppa", "Slugga" ], "unit_type": 0, - "unit_size": 1, - "movement": 1 + "size": 1, + "movement": 6 }, "burna_boy": { "display_name": "Burna Boy", "armour": 5, - "health": 80, + "health_points": 80, "resistance": 1, "weapons": [ "Choppa", "Burna" ], "unit_type": 0, - "unit_size": 1, - "movement": 1 + "size": 1, + "movement": 6 }, "tankbusta": { "display_name": "Tankbusta", "armour": 5, - "health": 80, + "health_points": 80, "resistance": 1, "weapons": [ "Rokkit Launcha", "Tankbusta Bomb" ], "unit_type": 0, - "unit_size": 1, - "movement": 1 + "size": 1, + "movement": 6 }, "stormboy": { "display_name": "Stormboy", "armour": 5, - "health": 80, + "health_points": 80, "resistance": 1, "weapons": [ "Choppa", @@ -1119,13 +1105,13 @@ "jump" ], "unit_type": 1, - "unit_size": 2, - "movement": 1 + "size": 2, + "movement": 12 }, "battlewagon": { "display_name": "Battlewagon", "armour": 80, - "health": 800, + "health_points": 800, "resistance": 1, "weapons": [ "Kannon", @@ -1135,13 +1121,13 @@ "Rokkit Launcha" ], "unit_type": 0, - "unit_size": 10, - "movement": 1 + "size": 10, + "movement": 10 }, "deff_dread": { "display_name": "Deff Dread", "armour": 60, - "health": 500, + "health_points": 500, "resistance": 1, "weapons": [ "Big Shoota", @@ -1150,13 +1136,13 @@ "Power Klaw" ], "unit_type": 0, - "unit_size": 10, - "movement": 1 + "size": 10, + "movement": 8 }, "xv8_commander": { "display_name": "XV8 Commander", "armour": 12, - "health": 300, + "health_points": 300, "resistance": 0.5, "weapons": [ "Plasma Rifle", @@ -1164,149 +1150,149 @@ "Cyclic Ion Blaster" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "xv8_bodyguard": { "display_name": "XV8 Bodyguard", "armour": 10, - "health": 200, + "health_points": 200, "resistance": 0.75, "weapons": [ "Plasma Rifle", "Burst Rifle" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "xv8_crisis": { "display_name": "XV8 Crisis", "armour": 10, - "health": 150, + "health_points": 150, "resistance": 0.75, "weapons": [ "Plasma Rifle", "Missile Pod" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "xv8_(brightknife)": { "display_name": "XV8 (Brightknife)", "armour": 10, - "health": 150, + "health_points": 150, "resistance": 0.75, "weapons": [ "Fusion Blaster", "Fusion Blaster" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "shield_drone": { "display_name": "Shield Drone", "armour": 8, - "health": 50, + "health_points": 50, "resistance": 1, "weapons": [], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "xv88_broadside": { "display_name": "XV88 Broadside", "armour": 12, - "health": 225, + "health_points": 225, "resistance": 0.75, "weapons": [ "Smart Missile System", "Small Railgun" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "xv25_stealthsuit": { "display_name": "XV25 Stealthsuit", "armour": 8, - "health": 50, + "health_points": 50, "resistance": 0.75, "weapons": [ "Burst Rifle" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "fire_warrior": { "display_name": "Fire Warrior", "armour": 8, - "health": 30, + "health_points": 30, "resistance": 1, "weapons": [ "Pulse Rifle" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "tau_pathfinder": { "display_name": "Tau Pathfinder", "armour": 8, - "health": 30, + "health_points": 30, "resistance": 1, "weapons": [ "Rail Rifle" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "kroot": { "display_name": "Kroot", "armour": 5, - "health": 30, + "health_points": 30, "resistance": 1, "weapons": [ "Kroot Rifle", "Melee2" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "vespid": { "display_name": "Vespid", "armour": 5, - "health": 50, + "health_points": 50, "resistance": 1, "weapons": [ "Vespid Crystal", "Melee2" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "devilfish": { "display_name": "Devilfish", "armour": 30, - "health": 150, + "health_points": 150, "resistance": 0.75, "weapons": [ "Smart Missile System" ], "unit_type": 0, - "unit_size": 10 + "size": 10 }, "hammerhead": { "display_name": "Hammerhead", "armour": 30, - "health": 150, + "health_points": 150, "resistance": 0.75, "weapons": [ "Railgun", "Smart Missile System" ], "unit_type": 0, - "unit_size": 10 + "size": 10 }, "hive_tyrant": { "display_name": "Hive Tyrant", "armour": 20, - "health": 400, + "health_points": 400, "resistance": 0.5, "weapons": [ "Bonesword", @@ -1314,115 +1300,115 @@ "Heavy Venom Cannon" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "tyrant_guard": { "display_name": "Tyrant Guard", "armour": 12, - "health": 200, + "health_points": 200, "resistance": 0.6, "weapons": [ "Crushing Claws" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "tyranid_warrior": { "display_name": "Tyranid Warrior", "armour": 8, - "health": 100, + "health_points": 100, "resistance": 0.9, "weapons": [ "Rending Claws", "Devourer" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "zoanthrope": { "display_name": "Zoanthrope", "armour": 8, - "health": 300, + "health_points": 300, "resistance": 0.25, "weapons": [ "Zoanthrope Blast" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "carnifex": { "display_name": "Carnifex", "armour": 20, - "health": 300, + "health_points": 300, "resistance": 0.75, "weapons": [ "Carnifex Claws", "Venom Cannon" ], "unit_type": 0, - "unit_size": 10 + "size": 10 }, "termagaunt": { "display_name": "Termagaunt", "armour": 5, - "health": 25, + "health_points": 25, "resistance": 1, "weapons": [ "Fleshborer" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "hormagaunt": { "display_name": "Hormagaunt", "armour": 5, - "health": 25, + "health_points": 25, "resistance": 1, "weapons": [ "Scything Talons" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "cultist": { "display_name": "Cultist", "armour": 0, - "health": 35, + "health_points": 35, "resistance": 1, "weapons": [ "Autogun", "melee0.5" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "genestealer": { "display_name": "Genestealer", "armour": 5, - "health": 75, + "health_points": 75, "resistance": 1, "weapons": [ "Genestealer Claws" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "genestealer_patriarch": { "display_name": "Genestealer Patriarch", "armour": 8, - "health": 300, + "health_points": 300, "resistance": 0.6, "weapons": [ "Genestealer Claws", "Witchfire" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "armoured_limousine": { "display_name": "Armoured Limousine", "armour": 10, - "health": 150, + "health_points": 150, "resistance": 0.75, "weapons": [ "Autogun", @@ -1431,19 +1417,19 @@ "Autogun" ], "unit_type": 0, - "unit_size": 10 + "size": 10 }, "lictor": { "display_name": "Lictor", "armour": 8, - "health": 300, + "health_points": 300, "resistance": 0.6, "weapons": [ "Lictor Claws", "Flesh Hooks" ], "unit_type": 0, - "unit_size": 1 + "size": 1 }, "chaos_leader": { "display_name": "Chaos Leader", @@ -1452,7 +1438,7 @@ "Power Fist" ], "armour": 30, - "health": 300, + "health_points": 300, "resistance": 0.75 }, "chaos_daemonlord": { @@ -1461,7 +1447,7 @@ "Khorne Demon Melee" ], "armour": 30, - "health": 300, + "health_points": 300, "resistance": 0.75 }, "fallen": { @@ -1471,7 +1457,7 @@ "Power Weapon" ], "armour": 30, - "health": 120, + "health_points": 120, "resistance": 0.5 }, "chaos_lord": { @@ -1481,7 +1467,7 @@ "Power Weapon" ], "armour": 30, - "health": 150, + "health_points": 150, "resistance": 0.5 }, "chaos_sorcerer": { @@ -1491,7 +1477,7 @@ "Force Staff" ], "armour": 30, - "health": 100, + "health_points": 100, "resistance": 0.5 }, "warpsmith": { @@ -1502,7 +1488,7 @@ "Flamer" ], "armour": 30, - "health": 100, + "health_points": 100, "resistance": 0.5 }, "chaos_terminator": { @@ -1513,7 +1499,7 @@ "Combi-Flamer" ], "armour": 40, - "health": 100, + "health_points": 100, "resistance": 0.5 }, "venerable_chaos_terminator": { @@ -1524,7 +1510,7 @@ "Combi-Flamer" ], "armour": 40, - "health": 120, + "health_points": 120, "resistance": 0.4 }, "world_eaters_terminator": { @@ -1534,7 +1520,7 @@ "Meltagun" ], "armour": 40, - "health": 120, + "health_points": 120, "resistance": 0.4 }, "obliterator": { @@ -1544,7 +1530,7 @@ "Obliterator Weapon" ], "armour": 40, - "health": 200, + "health_points": 200, "resistance": 0.5 }, "chaos_chosen": { @@ -1554,7 +1540,7 @@ "Chainsword" ], "armour": 20, - "health": 125, + "health_points": 125, "resistance": 0.85 }, "venerable_chaos_chosen": { @@ -1564,7 +1550,7 @@ "Chainsword" ], "armour": 20, - "health": 125, + "health_points": 125, "resistance": 0.75 }, "possessed": { @@ -1573,7 +1559,7 @@ "Possessed Claws" ], "armour": 17, - "health": 150, + "health_points": 150, "resistance": 0.5 }, "chaos_space_marine": { @@ -1583,7 +1569,7 @@ "Chainsword" ], "armour": 20, - "health": 100, + "health_points": 100, "resistance": 0.9 }, "havoc": { @@ -1593,7 +1579,7 @@ "Melee1" ], "armour": 20, - "health": 100, + "health_points": 100, "resistance": 0.9 }, "raptor": { @@ -1603,9 +1589,9 @@ "Bolt Pistol" ], "armour": 20, - "health": 100, + "health_points": 100, "resistance": 0.75, - "special": "Jump Pack" + "abilities": ["jump"] }, "world_eater": { "display_name": "World Eater", @@ -1614,7 +1600,7 @@ "Chainaxe" ], "armour": 20, - "health": 100, + "health_points": 100, "resistance": 0.75 }, "world_eaters_veteran": { @@ -1624,7 +1610,7 @@ "Chainaxe" ], "armour": 20, - "health": 100, + "health_points": 100, "resistance": 0.7 }, "khorne_berzerker": { @@ -1634,7 +1620,7 @@ "Bolt Pistol" ], "armour": 20, - "health": 100, + "health_points": 100, "resistance": 0.65 }, "plague_marine": { @@ -1644,7 +1630,7 @@ "Poison Chainsword" ], "armour": 20, - "health": 150, + "health_points": 150, "resistance": 0.5 }, "noise_marine": { @@ -1654,7 +1640,7 @@ "Melee1" ], "armour": 20, - "health": 100, + "health_points": 100, "resistance": 0.75 }, "rubric_marine": { @@ -1664,7 +1650,7 @@ "Melee1" ], "armour": 20, - "health": 125, + "health_points": 125, "resistance": 0.65 }, "rubric_sorcerer": { @@ -1674,7 +1660,7 @@ "Force Staff" ], "armour": 20, - "health": 150, + "health_points": 150, "resistance": 0.5 }, "chaos_cultist": { @@ -1684,7 +1670,7 @@ "melee0.5" ], "armour": 5, - "health": 35 + "health_points": 35 }, "hellbrute": { "display_name": "Hellbrute", @@ -1693,10 +1679,10 @@ "Meltagun" ], "armour": 40, - "health": 300, + "health_points": 300, "resistance": 0.5, "unit_type": 0, - "unit_size": 10 + "size": 10 }, "rhino": { "display_name": "Rhino", @@ -1704,10 +1690,10 @@ "Storm Bolter" ], "armour": 40, - "health": 200, + "health_points": 200, "resistance": 0.75, "unit_type": 0, - "unit_size": 10 + "size": 10 }, "predator": { "display_name": "Predator", @@ -1716,10 +1702,10 @@ "Twin Linked Lascannon" ], "armour": 45, - "health": 350, + "health_points": 350, "resistance": 0.5, "unit_type": 0, - "unit_size": 10 + "size": 10 }, "vindicator": { "display_name": "Vindicator", @@ -1728,10 +1714,10 @@ "Havoc Launcher" ], "armour": 45, - "health": 300, + "health_points": 300, "resistance": 0.5, "unit_type": 0, - "unit_size": 10 + "size": 10 }, "land_raider": { "display_name": "Land Raider", @@ -1740,10 +1726,10 @@ "Twin Linked Lascannon" ], "armour": 50, - "health": 400, + "health_points": 400, "resistance": 0.25, "unit_type": 0, - "unit_size": 10 + "size": 10 }, "heldrake": { "display_name": "Heldrake", @@ -1751,10 +1737,10 @@ "Baleflame" ], "armour": 50, - "health": 400, + "health_points": 400, "resistance": 0.25, "unit_type": 0, - "unit_size": 10 + "size": 10 }, "defiler": { "display_name": "Defiler", @@ -1765,10 +1751,10 @@ "Flamer" ], "armour": 40, - "health": 300, + "health_points": 300, "resistance": 0.5, "unit_type": 0, - "unit_size": 10 + "size": 10 }, "arch_heretic": { "display_name": "Arch Heretic", @@ -1777,7 +1763,7 @@ "Plasma Pistol" ], "armour": 8, - "health": 40, + "health_points": 40, "resistance": 0.75 }, "cultist_elite": { @@ -1787,7 +1773,7 @@ "Chainaxe" ], "armour": 8, - "health": 40, + "health_points": 40, "resistance": 0.9 }, "mutant": { @@ -1796,7 +1782,7 @@ "Flesh Hooks" ], "armour": 0, - "health": 30 + "health_points": 30 }, "daemonhost": { "display_name": "Daemonhost", @@ -1805,7 +1791,7 @@ "Daemonhost_Powers" ], "armour": 8, - "health": 300, + "health_points": 300, "resistance": 0.5 }, "possessed_alt": { @@ -1814,7 +1800,7 @@ "Possessed Claws" ], "armour": 8, - "health": 100, + "health_points": 100, "resistance": 0.75 }, "technical": { @@ -1824,10 +1810,10 @@ "Heavy Bolter" ], "armour": 10, - "health": 100, + "health_points": 100, "resistance": 0.75, "unit_type": 0, - "unit_size": 10 + "size": 10 }, "chaos_leman_russ": { "display_name": "Chaos Leman Russ", @@ -1836,10 +1822,10 @@ "Heavy Bolter" ], "armour": 45, - "health": 250, + "health_points": 250, "resistance": 0.25, "unit_type": 0, - "unit_size": 10 + "size": 10 }, "chaos_basilisk": { "display_name": "Chaos Basilisk", @@ -1848,9 +1834,9 @@ "Heavy Bolter" ], "armour": 20, - "health": 150, + "health_points": 150, "unit_type": 0, - "unit_size": 10 + "size": 10 }, "necron_overlord": { "display_name": "Necron Overlord", @@ -1859,10 +1845,10 @@ "Staff of Light Shooting" ], "armour": 12, - "health": 300, + "health_points": 300, "resistance": 0.5, "unit_type": 0, - "unit_size": 1 + "size": 1 }, "lychguard": { "display_name": "Lychguard", @@ -1870,10 +1856,10 @@ "Warscythe" ], "armour": 12, - "health": 100, + "health_points": 100, "resistance": 0.75, "unit_type": 0, - "unit_size": 1 + "size": 1 }, "flayed_one": { "display_name": "Flayed One", @@ -1881,10 +1867,10 @@ "Melee5" ], "armour": 8, - "health": 75, + "health_points": 75, "resistance": 0.9, "unit_type": 0, - "unit_size": 1 + "size": 1 }, "necron_warrior": { "display_name": "Necron Warrior", @@ -1893,10 +1879,10 @@ "Melee3" ], "armour": 8, - "health": 75, + "health_points": 75, "resistance": 0.9, "unit_type": 0, - "unit_size": 1 + "size": 1 }, "necron_immortal": { "display_name": "Necron Immortal", @@ -1905,10 +1891,10 @@ "Melee3" ], "armour": 8, - "health": 75, + "health_points": 75, "resistance": 0.85, "unit_type": 0, - "unit_size": 1 + "size": 1 }, "necron_wraith": { "display_name": "Necron Wraith", @@ -1916,10 +1902,10 @@ "Wraith Claws" ], "armour": 10, - "health": 200, + "health_points": 200, "resistance": 0.75, "unit_type": 0, - "unit_size": 1 + "size": 1 }, "necron_destroyer": { "display_name": "Necron Destroyer", @@ -1928,10 +1914,10 @@ "Melee3" ], "armour": 25, - "health": 175, + "health_points": 175, "resistance": 0.5, "unit_type": 0, - "unit_size": 1 + "size": 1 }, "tomb_stalker": { "display_name": "Tomb Stalker", @@ -1941,10 +1927,10 @@ "Claws" ], "armour": 40, - "health": 600, + "health_points": 600, "resistance": 0.5, "unit_type": 0, - "unit_size": 10 + "size": 10 }, "canoptek_spyder": { "display_name": "Canoptek Spyder", @@ -1952,10 +1938,10 @@ "Claws" ], "armour": 30, - "health": 300, + "health_points": 300, "resistance": 0.75, "unit_type": 0, - "unit_size": 10 + "size": 10 }, "canoptek_scarab": { "display_name": "Canoptek Scarab", @@ -1963,10 +1949,10 @@ "Melee3" ], "armour": 8, - "health": 30, + "health_points": 30, "resistance": 0.75, "unit_type": 0, - "unit_size": 1 + "size": 1 }, "necron_monolith": { "display_name": "Necron Monolith", @@ -1975,10 +1961,10 @@ "Particle Whip" ], "armour": 50, - "health": 500, + "health_points": 500, "resistance": 0.25, "unit_type": 0, - "unit_size": 10 + "size": 10 }, "doomsday_arc": { "display_name": "Doomsday Arc", @@ -1987,9 +1973,9 @@ "Doomsday Cannon" ], "armour": 40, - "health": 350, + "health_points": 350, "resistance": 0.5, "unit_type": 0, - "unit_size": 10 + "size": 10 } } \ No newline at end of file diff --git a/objects/obj_enunit/Draw_64.gml b/objects/obj_enunit/Draw_64.gml index e7c02ca612..d88ff9a6e9 100644 --- a/objects/obj_enunit/Draw_64.gml +++ b/objects/obj_enunit/Draw_64.gml @@ -1,4 +1,4 @@ -draw_size = column_size * obj_ncombat.battlefield_scale; +draw_size = column_size; if (draw_size > 0){ draw_set_alpha(1); diff --git a/objects/obj_ncombat/Create_0.gml b/objects/obj_ncombat/Create_0.gml index f06a2d2b3e..ccbad4f05b 100644 --- a/objects/obj_ncombat/Create_0.gml +++ b/objects/obj_ncombat/Create_0.gml @@ -53,12 +53,12 @@ instance_activate_object(obj_cursor); instance_activate_object(obj_ini); instance_activate_object(obj_img); -var i, u; -i = 11; -repeat (10) { - i -= 1; // This creates the objects to then be filled in - u = instance_create(i * 10, 240, obj_pnunit); -} +// var i, u; +// i = 11; +// repeat (10) { +// i -= 1; // This creates the objects to then be filled in +// u = instance_create(i * 10, 240, obj_pnunit); +// } instance_create(0, 0, obj_centerline); @@ -305,7 +305,9 @@ enemy_dudes = ""; global_defense = 2 - global_defense; enemy_force = new BattleArmy("", false); +enemy_force.allegiance = eBATTLE_ALLEGIANCE.Enemy; player_force = new BattleArmy(global.chapter_name, false); +player_force.allegiance = eBATTLE_ALLEGIANCE.Player; queue_force_health = function() { var _text = ""; @@ -356,17 +358,38 @@ display_message_queue = function() { ds_queue_clear(messages_queue); } -battlefield_scale = 0.1; -update_battlefield_scale = function() { - var _biggest_block_size = 0; - - with (obj_pnunit) { - if (column_size > _biggest_block_size) { - _biggest_block_size = column_size; +battlefield_grid = new BattlefieldGrid(100, 1); + +function SimplePanel(_x1, _y1, _x2, _y2) constructor { + x1 = _x1; + y1 = _y1; + x2 = _x2; + y2 = _y2; + x3 = (x1 + x2) / 2; + y3 = (y1 + y2) / 2; + back_colour = c_black; + border_colour = COL_GREEN; + + static draw = function() { + draw_set_color(back_colour); + draw_rectangle(x1, y1, x2, y2, false); + + draw_set_color(border_colour); + var _offset_step = 3 / (4 - 1); + var _alpha_step = 1.0 / (4); + for (var i = 0; i < 4; i++) { + var _current_offset = round(i * _offset_step); + var _current_alpha = 1.0 - (i * _alpha_step); + _current_alpha = clamp(_current_alpha, 0, 1); + + draw_set_alpha(_current_alpha); + + draw_rectangle(x1 + _current_offset, y1 + _current_offset, x2 - _current_offset, y2 - _current_offset, true); } - } - - battlefield_scale = min(1, 400 / _biggest_block_size); -}; + draw_set_alpha(1); + draw_set_color(c_white); + }; +} -battlefield = new BattlefieldGrid(100, 1); +message_log = new SimplePanel(22, 22, 800, 878); +battle_view = new SimplePanel(822, 22, 1578, 878); \ No newline at end of file diff --git a/objects/obj_ncombat/Draw_64.gml b/objects/obj_ncombat/Draw_64.gml index 666e1abe21..10b7e72fc7 100644 --- a/objects/obj_ncombat/Draw_64.gml +++ b/objects/obj_ncombat/Draw_64.gml @@ -1,75 +1,10 @@ draw_sprite(spr_rock_bg, 0, 0, 0); -draw_set_color(c_black); -draw_set_alpha(1); -draw_rectangle(0, 0, 800, 900, 0); -draw_rectangle(818, 235, 1578, 666, 0); - -draw_set_color(COL_GREEN); - -var l; -l = 0; -draw_set_alpha(1); -draw_rectangle(0 + l, 0 + l, 800 - l, 900 - l, 1); -l += 1; -draw_set_alpha(0.75); -draw_rectangle(0 + l, 0 + l, 800 - l, 900 - l, 1); -l += 1; -draw_set_alpha(0.5); -draw_rectangle(0 + l, 0 + l, 800 - l, 900 - l, 1); -l += 1; -draw_set_alpha(0.25); -draw_rectangle(0 + l, 0 + l, 1600 - l, 900 - l, 1); - -l = 0; -draw_set_alpha(1); -draw_rectangle(818 + l, 235 + l, 1578 - l, 666 - l, 1); -l += 1; -draw_set_alpha(0.75); -draw_rectangle(818 + l, 235 + l, 1578 - l, 666 - l, 1); -l += 1; -draw_set_alpha(0.5); -draw_rectangle(818 + l, 235 + l, 1578 - l, 666 - l, 1); -l += 1; -draw_set_alpha(0.25); -draw_rectangle(818 + l, 235 + l, 1578 - l, 666 - l, 1); -draw_set_alpha(1); - -var cell_width = 6; -var cell_height = 426; - -// Assuming `my_grid` is your custom grid struct -for (var _x = 0; _x < ds_grid_width(battlefield); _x++) { - for (var _y = 0; _y < ds_grid_height(battlefield); _y++) { - var _screen_x = 822 + _x * cell_width + _x; - var _screen_y = 239 + _y * cell_height; - - // Draw cell rectangle - draw_set_alpha(0.25); - draw_set_color(c_gray); - draw_rectangle(_screen_x, _screen_y, _screen_x + cell_width, _screen_y + cell_height, true); - - // Get cell data - var _cell = ds_grid_get(battlefield, _x, _y); - - // Determine item count - var _item_count = (is_array(_cell)) ? array_length(_cell) : 0; +message_log.draw(); +battle_view.draw(); +battlefield_grid.draw(); - // Change color if occupied - if (_item_count > 0) { - draw_set_alpha(1); - draw_set_color(c_green); - draw_rectangle(_screen_x, _screen_y, _screen_x + cell_width, _screen_y + cell_height, false); - } - } -} - -draw_set_color(c_white); // Reset color to default after - -l = 0; -draw_set_alpha(1); draw_set_font(fnt_40k_14); - if ((display_p1 > 0) && (player_forces > 0)) { draw_set_color(COL_YELLOW); draw_set_halign(fa_left); @@ -82,27 +17,28 @@ if ((display_p2 > 0) && (enemy_forces > 0)) { } draw_set_halign(fa_left); - -repeat (45) { - l += 1; - // draw_text(x+6,y-10+(l*14),"."+string(lines[31-l])); - draw_set_color(lines_color[l]); - draw_text_ext(x + 6, y - 10 + (l * 18), string(lines[l]), 1, 795); +var _max_line_length = message_log.x2 - message_log.x1 - 6; +for (var i = 0, l = array_length(lines); i < l; i++) { + draw_set_color(lines_color[i]); + draw_text_ext(message_log.x1 + 6, message_log.y1 + 6 + (i * 18), lines[i], 1, _max_line_length); } -draw_set_color(COL_GREEN); -draw_set_halign(fa_center); - +var _turn_text = ""; if (battle_stage == eBATTLE_STAGE.Main) { - draw_text(400, 860, "[Press Enter to Begin]"); + _turn_text = "[Press Enter to Begin]"; } else if (battle_stage == eBATTLE_STAGE.PlayerWinEnd || battle_stage == eBATTLE_STAGE.EnemyWinEnd) { - draw_text(400, 860, "[Press Enter to Exit]"); + _turn_text = "[Press Enter to Exit]"; } else if (turn_phase == eBATTLE_TURN_PHASE.Movement) { - draw_text(400, 860, "[Press Enter to Continue]"); + _turn_text = "[Press Enter to Continue]"; } -draw_set_alpha(fading_strength); +draw_set_color(COL_GREEN); +draw_set_halign(fa_center); +draw_text(message_log.x3, message_log.y2 - 26, _turn_text); draw_set_halign(fa_left); + +draw_set_alpha(fading_strength); draw_set_color(c_black); draw_rectangle(0, 0, 1600, 900, 0); draw_set_alpha(1); +draw_set_color(c_white); diff --git a/objects/obj_ncombat/Step_0.gml b/objects/obj_ncombat/Step_0.gml index deff3b901d..929cd4749f 100644 --- a/objects/obj_ncombat/Step_0.gml +++ b/objects/obj_ncombat/Step_0.gml @@ -16,22 +16,23 @@ if (battle_stage == eBATTLE_STAGE.Creation) { if (DEBUG_COMBAT_PERFORMANCE) { stopwatch("scr_player_combat_weapon_stacks"); } - with (obj_pnunit) { - scr_player_combat_weapon_stacks(); - } + // with (obj_pnunit) { + // scr_player_combat_weapon_stacks(); + // } + if (DEBUG_COMBAT_PERFORMANCE) { stopwatch("scr_player_combat_weapon_stacks"); } - with (obj_pnunit) { - pnunit_battle_effects(); - } + // with (obj_pnunit) { + // pnunit_battle_effects(); + // } - ncombat_battle_start(); + // ncombat_battle_start(); - ncombat_ally_init(); + // ncombat_ally_init(); - update_battlefield_scale(); + // update_battlefield_scale(); battle_stage = eBATTLE_STAGE.Main; @@ -51,57 +52,66 @@ if ((press_exclusive(vk_enter) || hold_exclusive(vk_enter)) && fading_strength = } turn_count++; - global_perils -= 1; + // global_perils -= 1; queue_battlelog_message($"Turn {turn_count}", COL_YELLOW); - resolve_battle_state(); + // resolve_battle_state(); display_message_queue(); if (turn_side == eBATTLE_ALLEGIANCE.Enemy) { - battlefield.move_enemies(); - if (instance_exists(obj_enunit)) { - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("enunit_create_weapon_stacks"); - } - with (obj_enunit) { - assign_weapon_stacks(); - } - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("enunit_create_weapon_stacks"); - } - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("enunit_target_and_shoot"); - } - with (obj_enunit) { - enunit_target_and_shoot(); - } - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("enunit_target_and_shoot"); - } - } - display_message_queue(); - } - - if (turn_side == eBATTLE_ALLEGIANCE.Player) { - player_blocks_movement(); if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("pnunit_stacking_shooting"); - } - with (obj_pnunit) { - pnunit_battle_effects(); - scr_player_combat_weapon_stacks(); - pnunit_target_and_shoot(); + stopwatch("move_enemy_forces"); } + + enemy_force.move_forces(); + if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("pnunit_stacking_shooting"); + stopwatch("move_enemy_forces"); } - with (obj_enunit) { - enunit_enemy_profiles_init(); - } - display_message_queue(); + + // if (instance_exists(obj_enunit)) { + // if (DEBUG_COMBAT_PERFORMANCE) { + // stopwatch("enunit_create_weapon_stacks"); + // } + // with (obj_enunit) { + // assign_weapon_stacks(); + // } + // if (DEBUG_COMBAT_PERFORMANCE) { + // stopwatch("enunit_create_weapon_stacks"); + // } + // if (DEBUG_COMBAT_PERFORMANCE) { + // stopwatch("enunit_target_and_shoot"); + // } + // with (obj_enunit) { + // enunit_target_and_shoot(); + // } + // if (DEBUG_COMBAT_PERFORMANCE) { + // stopwatch("enunit_target_and_shoot"); + // } + // } + // display_message_queue(); } - queue_force_health(); - display_message_queue(); + if (turn_side == eBATTLE_ALLEGIANCE.Player) { + // player_blocks_movement(); + // if (DEBUG_COMBAT_PERFORMANCE) { + // stopwatch("pnunit_stacking_shooting"); + // } + // with (obj_pnunit) { + // pnunit_battle_effects(); + // scr_player_combat_weapon_stacks(); + // pnunit_target_and_shoot(); + // } + // if (DEBUG_COMBAT_PERFORMANCE) { + // stopwatch("pnunit_stacking_shooting"); + // } + // with (obj_enunit) { + // enunit_enemy_profiles_init(); + // } + // display_message_queue(); + } + + // queue_force_health(); + // display_message_queue(); turn_phase = eBATTLE_TURN_PHASE.Morale; @@ -115,25 +125,27 @@ if ((press_exclusive(vk_enter) || hold_exclusive(vk_enter)) && fading_strength = stopwatch("BATTLE_TURN.End"); } - if (!battle_ended) { - with (obj_pnunit) { - pnunit_is_valid(id); - } + // if (!battle_ended) { + // with (obj_pnunit) { + // pnunit_is_valid(id); + // } - with (obj_enunit) { - enunit_is_valid(id) - } - } + // with (obj_enunit) { + // enunit_is_valid(id) + // } + // } - update_battlefield_scale(); + // update_battlefield_scale(); if (turn_side == eBATTLE_ALLEGIANCE.Enemy) { - turn_side == eBATTLE_ALLEGIANCE.Player; + turn_side = eBATTLE_ALLEGIANCE.Player; } if (turn_side == eBATTLE_ALLEGIANCE.Player) { - turn_side == eBATTLE_ALLEGIANCE.Enemy; + turn_side = eBATTLE_ALLEGIANCE.Enemy; } + + turn_phase = eBATTLE_TURN_PHASE.Movement; if (DEBUG_COMBAT_PERFORMANCE) { stopwatch("BATTLE_TURN.End"); diff --git a/objects/obj_pnunit/Draw_64.gml b/objects/obj_pnunit/Draw_64.gml index 85623e18fb..a2fb181e37 100644 --- a/objects/obj_pnunit/Draw_64.gml +++ b/objects/obj_pnunit/Draw_64.gml @@ -1,4 +1,4 @@ -draw_size = column_size * obj_ncombat.battlefield_scale; +draw_size = column_size; if (draw_size > 0){ draw_set_alpha(1); diff --git a/objects/obj_popup/Alarm_0.gml b/objects/obj_popup/Alarm_0.gml index 1981a18671..af5b8f2887 100644 --- a/objects/obj_popup/Alarm_0.gml +++ b/objects/obj_popup/Alarm_0.gml @@ -33,7 +33,7 @@ if (battle_special=3.1){ update_roster(); if (array_length(selected_units)){ setup_battle_formations(); - add_to_battle(); + // add_to_battle(); } else { instance_destroy(obj_ncombat); instance_activate_all(); diff --git a/objects/obj_popup/Destroy_0.gml b/objects/obj_popup/Destroy_0.gml index cc3ce2cb84..8bb48aa41d 100644 --- a/objects/obj_popup/Destroy_0.gml +++ b/objects/obj_popup/Destroy_0.gml @@ -24,7 +24,7 @@ if (image="chaos_symbol") and (title="Concealed Heresy") and (instance_exists(ob obj_ncombat.battle_special="WL10_reveal"; scr_battle_allies(); setup_battle_formations(); - roster.add_to_battle(); + // roster.add_to_battle(); } } diff --git a/objects/obj_popup/Step_0.gml b/objects/obj_popup/Step_0.gml index d07044a570..fc15956158 100644 --- a/objects/obj_popup/Step_0.gml +++ b/objects/obj_popup/Step_0.gml @@ -1168,7 +1168,7 @@ try { update_roster(); if (array_length(selected_units)){ setup_battle_formations(); - add_to_battle(); + // add_to_battle(); } } delete _roster diff --git a/objects/obj_turn_end/Mouse_56.gml b/objects/obj_turn_end/Mouse_56.gml index 2bd38c8400..0a9dfe641e 100644 --- a/objects/obj_turn_end/Mouse_56.gml +++ b/objects/obj_turn_end/Mouse_56.gml @@ -194,7 +194,7 @@ __b__ = action_if_number(obj_popup, 0, 0); update_roster(); if (array_length(selected_units)){ setup_battle_formations(); - add_to_battle(); + // add_to_battle(); } } delete _roster diff --git a/scripts/__init_external/__init_external.gml b/scripts/__init_external/__init_external.gml index cb4821c860..8136a2f6c2 100644 --- a/scripts/__init_external/__init_external.gml +++ b/scripts/__init_external/__init_external.gml @@ -91,4 +91,6 @@ function __init_external() { global.game_version = _version; global.commit_hash = _commit_hash; } + + load_unit_profiles(); } diff --git a/scripts/scr_ancient_ruins/scr_ancient_ruins.gml b/scripts/scr_ancient_ruins/scr_ancient_ruins.gml index 96c072ea5e..c9c4cf2c44 100644 --- a/scripts/scr_ancient_ruins/scr_ancient_ruins.gml +++ b/scripts/scr_ancient_ruins/scr_ancient_ruins.gml @@ -40,7 +40,7 @@ function scr_ruins_suprise_attack_player(){ selected_units = _units; if (array_length(selected_units)){ setup_battle_formations(); - add_to_battle(); + // add_to_battle(); } else { instance_destroy(obj_ncombat); instance_destroy(obj_pnunit); diff --git a/scripts/scr_clean/scr_clean.gml b/scripts/scr_clean/scr_clean.gml index d5526c4a8b..2fa5423773 100644 --- a/scripts/scr_clean/scr_clean.gml +++ b/scripts/scr_clean/scr_clean.gml @@ -83,7 +83,7 @@ function scr_clean(target_object, weapon_data) { if (target_type == eUNIT_TYPE.Vehicle && array_empty(valid_vehicles)) { target_type = eUNIT_TYPE.Infantry; - } else if (target_type = eUNIT_TYPE.Normal && array_empty(valid_marines)) { + } else if (target_type = eUNIT_TYPE.Infantry && array_empty(valid_marines)) { target_type = eUNIT_TYPE.Vehicle; } 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 5b547143a3..13a7b19674 100644 --- a/scripts/scr_drop_select_function/scr_drop_select_function.gml +++ b/scripts/scr_drop_select_function/scr_drop_select_function.gml @@ -378,7 +378,7 @@ function drop_select_draw() { scr_battle_allies(); setup_battle_formations(); - roster.add_to_battle(); + // roster.add_to_battle(); } else if (purge > 1) { draw_set_alpha(0.2); draw_rectangle(954, 556, 1043, 579, 0); diff --git a/scripts/scr_external_data_handling/scr_external_data_handling.gml b/scripts/scr_external_data_handling/scr_external_data_handling.gml new file mode 100644 index 0000000000..a2342dd926 --- /dev/null +++ b/scripts/scr_external_data_handling/scr_external_data_handling.gml @@ -0,0 +1,29 @@ +function UnitProfile(_name) constructor { + name = _name; + display_name = ""; + armour = 0; + health_points = 0; + resistance = 1; + weapons = []; + unit_type = 0; + size = 0; + movement = 0; + abilities = []; +} + +/// @type {Struct} +global.unit_profiles = {}; +function load_unit_profiles() { + var _unit_profiles = json_to_gamemaker(working_directory + "\\data\\unit_profiles.jsonc", json_parse); + var _profile_names = variable_struct_get_names(_unit_profiles); + + for (var i = 0, l = array_length(_profile_names); i < l; i++) { + var _profile_name = _profile_names[i]; + var _profile = _unit_profiles[$ _profile_name]; + var _unit_profile = new UnitProfile(_profile_name); + + struct_load(_unit_profile, _profile); + + global.unit_profiles[$ _profile_name] = _unit_profile; + } +} diff --git a/scripts/scr_external_data_handling/scr_external_data_handling.yy b/scripts/scr_external_data_handling/scr_external_data_handling.yy new file mode 100644 index 0000000000..e6b0484ffb --- /dev/null +++ b/scripts/scr_external_data_handling/scr_external_data_handling.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"scr_external_data_handling", + "isCompatibility":false, + "isDnD":false, + "name":"scr_external_data_handling", + "parent":{ + "name":"Scripts", + "path":"folders/Scripts.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/scr_json_functions/scr_json_functions.gml b/scripts/scr_json_functions/scr_json_functions.gml index 88baa02aa8..284afb96b9 100644 --- a/scripts/scr_json_functions/scr_json_functions.gml +++ b/scripts/scr_json_functions/scr_json_functions.gml @@ -5,25 +5,23 @@ function json_to_gamemaker(_json_path, _func) { var file_buffer = undefined; try { - if (file_exists(_json_path)){ - var _json_string = ""; - var _parsed_json = {}; + var _json_string = ""; + var _parsed_json = {}; - file_buffer = buffer_load(_json_path); + file_buffer = buffer_load(_json_path); - if (file_buffer == -1) { - throw ("Could not open file"); - } - - var _json_string = buffer_read(file_buffer, buffer_string); - var _parsed_json = _func(_json_string); - - return _parsed_json; + if (file_buffer == -1) { + throw ("Could not open file"); } + + var _json_string = buffer_read(file_buffer, buffer_string); + var _parsed_json = _func(_json_string); + + return _parsed_json; } catch (_exception) { handle_exception(_exception); - }finally { - if (is_undefined(file_buffer) == false) { + } finally { + if (!is_undefined(file_buffer)) { buffer_delete(file_buffer); } } diff --git a/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml b/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml index afdea2fae3..ff2efa55b5 100644 --- a/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml +++ b/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml @@ -40,12 +40,12 @@ function ncombat_enemy_stacks_init() { ally = 3; ally_forces = 1; } - instance_activate_object(obj_pnunit); - if (!instance_exists(obj_pnunit)) { - exit; - } - xxx = instance_nearest(1000, 240, obj_pnunit); - xxx = xxx.x + 80; + // instance_activate_object(obj_pnunit); + // if (!instance_exists(obj_pnunit)) { + // exit; + // } + // xxx = instance_nearest(1000, 240, obj_pnunit); + xxx = 80; if ((string_count("spyrer", battle_special) > 0) || (string_count("fallen", battle_special) > 0) || (string_count("mech", battle_special) > 0) || (battle_special == "space_hulk") || (battle_special == "study2a") || (battle_special == "study2b")) { fortified = 0; @@ -1429,7 +1429,13 @@ function ncombat_enemy_stacks_init() { if (threat == 6) { enemy_force.name = "orks_6"; enemy_force.copy_profile(); - enemy_force.spawn_forces(); + if (DEBUG_COMBAT_PERFORMANCE) { + stopwatch("enemy_squad_spawning"); + } + enemy_force.spawn_squads(); + if (DEBUG_COMBAT_PERFORMANCE) { + stopwatch("enemy_squad_spawning"); + } } } @@ -3489,7 +3495,7 @@ function ncombat_battle_start() { } if ((battle_special == "ruins") || (battle_special == "ruins_eldar")) { - newline = "The enemy forces are made up of " + string(enemy_force.unit_count); + newline = "The enemy forces are made up of " + string(enemy_force.get_unit_count()); if (enemy == 6) { newline += " Craftworld Eldar."; @@ -3563,7 +3569,7 @@ function ncombat_battle_start() { rand = choose(1, 2, 3); if (rand < 4) { p1 = "Howls and grunts ring from the surrounding terrain as the Orks announce their presence. "; - p2 = string(enemy_force.unit_count) + ", the bloodthirsty horde advances toward your Marines, ecstatic in their anticipation of carnage. "; + p2 = string(enemy_force.get_unit_count()) + ", the bloodthirsty horde advances toward your Marines, ecstatic in their anticipation of carnage. "; p3 = p2; p2 = string_delete(p2, 2, 999); p3 = string_delete(p3, 1, 1); @@ -3571,7 +3577,7 @@ function ncombat_battle_start() { } } if ((enemy == 7) && (dropping == 1)) { - p1 = "The " + string(enemy_force.unit_count) + "-some Orks howl and roar at the oncoming marines. Many of the beasts fire their weapons, more or less spraying rounds aimlessly into the sky."; + p1 = "The " + string(enemy_force.get_unit_count()) + "-some Orks howl and roar at the oncoming marines. Many of the beasts fire their weapons, more or less spraying rounds aimlessly into the sky."; } if ((enemy == 8) && (dropping == 0)) { @@ -3583,7 +3589,7 @@ function ncombat_battle_start() { rand = choose(1, 2, 3); } if ((enemy == 9) && (dropping == 1)) { - p1 = "The " + string(enemy_force.unit_count) + "-some Tyranids hiss and chitter as your marines rain down. Blasts of acid and spikes fill the sky, but none seem to quite find their mark."; + p1 = "The " + string(enemy_force.get_unit_count()) + "-some Tyranids hiss and chitter as your marines rain down. Blasts of acid and spikes fill the sky, but none seem to quite find their mark."; } if ((enemy == 10) && (dropping == 0)) { @@ -3616,7 +3622,7 @@ function ncombat_battle_start() { rand = choose(1, 2, 3); if (rand < 4) { p1 = "Dirt crunches beneath the feet of the Necrons as they make their silent advance. "; - p2 = string(enemy_force.unit_count) + ", the souless xeno advance toward your Marines, silent and pulsing with green energy. "; + p2 = string(enemy_force.get_unit_count()) + ", the souless xeno advance toward your Marines, silent and pulsing with green energy. "; p3 = p2; p2 = string_delete(p2, 2, 999); p3 = string_delete(p3, 1, 1); diff --git a/scripts/scr_new_combat_scripts/scr_new_combat_scripts.gml b/scripts/scr_new_combat_scripts/scr_new_combat_scripts.gml new file mode 100644 index 0000000000..2eb14da22e --- /dev/null +++ b/scripts/scr_new_combat_scripts/scr_new_combat_scripts.gml @@ -0,0 +1,536 @@ +enum eUNIT_TYPE { + Unknown, + Infantry, + Vehicle, + Monster, + Fortification, +}; + +enum eUNIT_SUBTYPE { + Normal, + Character, + Flyer, + Monster, + Character, + Fortification, +}; + +enum eBATTLE_ALLEGIANCE { + Unknown, + Player, + Ally, + Enemy, +}; + +#macro COMBAT_ROLE_BATTLELINE "battleline" +#macro COMBAT_ROLE_FIRE_SUPPORT "fire_support" +#macro COMBAT_ROLE_ASSAULT "assault" +#macro COMBAT_ROLE_COMMAND "command" +#macro COMBAT_ROLE_ARTILLERY "artillery" +#macro COMBAT_ROLE_FORTIFICATION "fortification" +#macro COMBAT_ROLE_ANTI_ARMOUR "anti_armour" +#macro COMBAT_ROLE_TRANSPORT "transport" + +global.squad_profiles = json_to_gamemaker(working_directory + "\\data\\squad_profiles.jsonc", json_parse); +global.combat_role_profiles = json_to_gamemaker(working_directory + "\\data\\combat_role_profiles.jsonc", json_parse); + +function convert_keywords_to_set() { + var _squad_names = struct_get_names(global.squad_profiles); + var _squad_len = array_length(_squad_names); + for (var k = 0; k < _squad_len; k++){ + var _squad_name = _squad_names[k]; + var _squad = global.squad_profiles[$ _squad_name]; + _squad.keywords = new Set(_squad.keywords); + } +} + +convert_keywords_to_set(); + +global.army_profiles = json_to_gamemaker(working_directory + "\\data\\army_profiles.jsonc", json_parse); + +function BattlefieldGrid(_width, _height) constructor { + width = _width; + height = _height; + + /// @type {Array} + cells = array_create(_width * _height); + + for (var i = 0; i < array_length(cells); i++) { + cells[i] = new BattlefieldGridCell(); + } + + static get_size = function() { + return array_length(cells); + } + + static get_cell_index = function(_x, _y) { + return _x + _y * width; + }; + + static get_cell_coords = function(_index) { + var _x = _index % width; + var _y = floor(_index / width); + return [_x, _y]; + }; + + static get_occupants_at = function(_x, _y) { + var _cell = get_cell(_x, _y); + if (_cell != undefined) { + return _cell.occupants; + } + return []; + }; + + static valid_cell = function(_x, _y) { + return _x >= 0 && _x < width && _y >= 0 && _y < height; + } + + static get_cell = function(_x, _y) { + if (_x >= 0 && _x < width && _y >= 0 && _y < height) { + return cells[get_cell_index(_x, _y)]; + } + return undefined; + }; + + static soft_reset = function() { + var _size = get_size(); + for (var i = 0; i < _size; i++) { + cells[i].reset(); + } + }; + + static move_squad = function(_x, _y, _squad) { + if (valid_cell(_x, _y)) { + var _cell = cells[get_cell_index(_x, _y)]; + var _squad_size = _squad.get_size(); + if (_cell.can_fit(_squad_size)) { + var _old_location = _squad.location; + remove_squad(_old_location[0], _old_location[1], _squad); + add_squad(_x, _y, _squad); + return true; + } else { + return false; + } + } else { + return false; + } + }; + + static add_squad = function(_x, _y, _squad) { + if (valid_cell(_x, _y)) { + var _cell = cells[get_cell_index(_x, _y)]; + var _squad_size = _squad.get_size(); + if (_cell.can_fit(_squad_size)) { + array_push(_cell.occupants, _squad); + _cell.capacity_used += _squad_size; + _squad.location = [_x, _y]; + return true; + } else { + return false; + } + } else { + return false; + } + }; + + static remove_squad = function(_x, _y, _squad) { + if (valid_cell(_x, _y)) { + var _cell = cells[get_cell_index(_x, _y)]; + array_delete_value(_cell.occupants, _squad); + _cell.capacity_used -= _squad.get_size(); + _squad.location = [-1, -1]; + return true; + } else { + return false; + } + }; + + static draw = function() { + var cell_width = 6; + var cell_height = 426; + + var grid_start_x = 822; + var grid_start_y = 239; + + var rect_padding_x = 1; + for (var _x = 0; _x < width; _x++) { + for (var _y = 0; _y < height; _y++) { + var _screen_x = grid_start_x + _x * cell_width + _x; + var _screen_y = grid_start_y + _y * cell_height; + + draw_set_alpha(0.15); + draw_set_color(c_gray); + draw_rectangle(_screen_x, _screen_y, _screen_x + cell_width, _screen_y + cell_height, true); + + var _cell = get_cell(_x, _y); + var _occupants = _cell.occupants; + var _item_count = array_length(_occupants); + + if (_item_count > 0) { + draw_set_alpha(1); + + var total_stack_height = 0; + for (var i = 0; i < _item_count; i++) { + total_stack_height += _occupants[i].get_size(); + } + + var start_offset_y = (cell_height - total_stack_height) / 2; + var _current_y = _screen_y + start_offset_y; + + for (var i = 0; i < _item_count; i++) { + var _squad = _occupants[i]; + var _squad_visual_size = _squad.get_size(); + + if (_squad.allegiance == eBATTLE_ALLEGIANCE.Player) { + draw_set_color(c_blue); + } else if (_squad.allegiance == eBATTLE_ALLEGIANCE.Enemy) { + draw_set_color(c_red); + } else { + draw_set_color(c_gray); + } + + draw_rectangle(_screen_x + rect_padding_x, _current_y, _screen_x + cell_width - rect_padding_x, _current_y + _squad_visual_size, false); + draw_point_color((_screen_x + rect_padding_x) + (cell_width - 2 * rect_padding_x) / 2, _current_y + _squad_visual_size / 2, c_black); + + _current_y += _squad_visual_size; + } + } + } + } + + draw_set_alpha(1); + draw_set_color(c_white); + }; +} + +function BattlefieldGridCell() constructor { + // terrain = -1; + capacity = -1; + capacity_used = -1; + occupants = []; + + static reset = function() { + // terrain = 0; + capacity = 400; + capacity_used = 0; + occupants = []; + }; + + reset(); + + static get_occupants = function(_allegiance_type = -1, _squad_type = -1) { + var _filtered = []; + for (var i = 0, l = array_length(occupants); i < l; ++i) { + var _squad = occupants[i]; + var _match_allegiance = (_allegiance_type == -1 || _squad.allegiance == _allegiance_type); + var _match_type = (_squad_type == -1 || _squad._squad_type == _squad_type); + + if (_match_allegiance && _match_type) { + array_push(_filtered, _squad); + } + } + return _filtered; + } + + static can_fit = function(_size) { + return capacity_used + _size <= capacity; + }; +} + +function BattleArmy(_name = "", _copy_profile = true) constructor { + name = _name; + profile = {}; + + /// @type {Array} + squads = []; + + allegiance = eBATTLE_ALLEGIANCE.Unknown; + + /// @type {Array} + lost_units = []; + + /// @type {Array} + lost_squads = []; + + static copy_profile = function() { + var _army_profiles = global.army_profiles; + var _profile = _army_profiles[$ name]; + profile = _profile; + }; + + if (_copy_profile) { + copy_profile(); + } + + static get_squad_count = function() { + return array_length(squads); + }; + + static get_unit_count = function() { + var _count = 0; + for (var i = 0, l = array_length(squads); i < l; i++) { + var _squad = squads[i]; + _count += _squad.get_unit_count(); + } + return _count; + }; + + static spawn_squads = function() { + if (!struct_exists(profile, "squads")) { + return false; // No squads to spawn + } + + var _battlefield = obj_ncombat.battlefield_grid; + var _deployment_zone_xstart; + + if (allegiance == eBATTLE_ALLEGIANCE.Player) { + _deployment_zone_xstart = 0; + } else if (allegiance == eBATTLE_ALLEGIANCE.Enemy) { + _deployment_zone_xstart = _battlefield.width - 1; + } else { + show_error($"Warning: Cannot spawn forces for army '{name}'! Unknown allegiance!", false); + return; + } + + var _profile_squads = profile.squads; + var _squads_by_role = { + "back": [], + "center": [], + "front": [] + }; + + // Group squads by combat role + for (var i = 0, l = array_length(_profile_squads); i < l; i++) { + var _squad_data = _profile_squads[i]; + var _squad_profile = global.squad_profiles[$ _squad_data.name]; + var _combat_role_profile = global.combat_role_profiles[$ _squad_profile.combat_role]; + var _spawn_distance = _combat_role_profile.spawn_position; + + if (struct_exists(_squads_by_role, _spawn_distance)) { + repeat (_squad_data.count) { + array_push(_squads_by_role[$ _spawn_distance], _squad_data.name); + } + } else { + show_error($"Warning: Unknown spawn position '{_spawn_distance}' for squad '{_squad_data.name}'. Skipping.", false); + } + } + + // Define the order of spawning roles (back to front) + var _spawn_order = ["back", "center", "front"]; + var _current_spawn_x = _deployment_zone_xstart; + var _spawn_direction = (allegiance == eBATTLE_ALLEGIANCE.Player) ? 1 : -1; // Determine spawn direction + + // Spawn squads sequentially by role + for (var r = 0, rl = array_length(_spawn_order); r < rl; r++) { + var _role = _spawn_order[r]; + var _squad_names_in_role = _squads_by_role[$ _role]; + + for (var s = 0, sl = array_length(_squad_names_in_role); s < sl; s++) { + var _squad_name = _squad_names_in_role[s]; + var _battle_squad = new BattleSquad(_squad_name); + _battle_squad.army = self; + _battle_squad.allegiance = self.allegiance; + + // Attempt to place the squad at the current spawn X and Y=0 + var _placed = false; + // Assuming squad size affects placement validation but not the starting cell for sequential placement + // The grid's add_squad method should handle multi-cell squads starting from the given coordinate + if (_battlefield.add_squad(_current_spawn_x, 0, _battle_squad)) { + array_push(squads, _battle_squad); + _placed = true; + } else { + _current_spawn_x += _spawn_direction; + if (_battlefield.add_squad(_current_spawn_x, 0, _battle_squad)) { + array_push(squads, _battle_squad); + _placed = true; + } else { + show_error($"Warning: Could not place squad '{_squad_name}' for '{allegiance}' at ({_current_spawn_x}, 0)! Deployment area full?", false); + } + } + + if (!_placed) { + show_error($"Warning: Could not place squad '{_squad_name}' for '{allegiance}' at ({_current_spawn_x}, 0)!", false); + // The squad instance is not added to the army's list if not placed + } + } + } + + return true; + }; + + static squad_initiative_sort = function(_squad_a, _squad_b) { + array_sort(squads, function(_squad_a, _squad_b) { + return _squad_b.movement - _squad_a.movement; + }); + } + + static move_forces = function () { + if (array_length(squads) == 0) { + exit; + } + + squad_initiative_sort(); + + for (var i = 0, l = array_length(squads); i < l; i++) { + var _squad = squads[i]; + _squad.move(); + } + }; +} + +function BattleSquad(_name, _copy_profile = true) constructor { + name = _name; + display_name = _name; + + /// @type {Array} + units = []; + + location = -1; + movement = -1; + engaged = false; + + /// @type {Struct.BattleSquad} + target_squad = {}; + + army = {}; + allegiance = eBATTLE_ALLEGIANCE.Unknown; + morale = -1; + combat_role = COMBAT_ROLE_BATTLELINE; + + static copy_profile = function() { + var _profile = global.squad_profiles[$ name]; + var _units = _profile.units; + display_name = _profile.display_name; + combat_role = _profile.combat_role; + + var _unit_names = struct_get_names(_units); + for (var k = 0, l = array_length(_unit_names); k < l; k++){ + var _unit_name = _unit_names[k]; + var _unit = _units[$ _unit_name]; + + repeat (_unit.count) { + var _battle_unit = new BattleUnit(_unit_name); + _battle_unit.squad = self; + array_push(units, _battle_unit); + } + + if (movement == -1 || _battle_unit.profile.movement < movement) { + movement = _battle_unit.profile.movement; + } + } + }; + + if (_copy_profile) { + copy_profile(); + } + + static get_unit_count = function() { + return array_length(units); + }; + + static get_size = function () { + var _size = 0; + for (var i = 0, l = array_length(units); i < l; i++) { + var _unit = units[i]; + _size += _unit.profile.size; + } + return _size; + }; + + static move = function() { + if (location == -1 || engaged == true) { + exit; + } + + var _movement_direction = (allegiance == eBATTLE_ALLEGIANCE.Player) ? 1 : -1; + for (var _movement_distance = movement; _movement_distance >= 1; _movement_distance--) { + var _movement_delta = _movement_direction * _movement_distance; + + var _target_x = location[0] + _movement_delta; + var _target_y = location[1]; + + if (obj_ncombat.battlefield_grid.move_squad(_target_x, _target_y, self)) { + exit; + } + } + }; + + static attack = function() { + var _all_weapons = []; + for (var i = 0; i < array_length(units); i++) { + array_concat(_all_weapons, units[i].weapons); + } + target_squad.resolve_attacks(_all_weapons); + }; + + static resolve_attacks = function(_weapons) { + for (var i = 0; i < array_length(_weapons); i++) { + var _weapon = _weapons[i]; + /// @type {Struct.BattleUnit} + var _target_unit = array_random_element(target_squad.units); + _target_unit.apply_damage(_weapon); + } + + if (get_unit_count() <= 0) { + array_push(army.lost_squads, self); + array_delete_value(army.squads, self); + } + }; +} + +function BattleUnit(_name, _copy_profile = true) constructor { + name = _name; + display_name = _name; + abilities = []; + armour = 0; + health_points = 0; + resistance = 0; + ranged_mod = 1; + melee_mod = 1; + + /// @type {Struct.UnitProfile} + profile = {}; + + squad = {}; + + /// @type {Array} + weapons = []; + + static copy_profile = function(_name) { + var _profile_struct = global.unit_profiles[$ _name]; + profile = _profile_struct; + + struct_overwrite(self, _profile_struct); + + for (var w = 0, l = array_length(weapons); w < l; w++) { + weapons[w] = new BattleWeapon(weapons[w], self); + } + }; + + if (_copy_profile) { + copy_profile(_name); + } + + static apply_damage = function(_weapon) { + var _min_damage = 0.25; + var _dice_sides = 50; + var _random_damage_mod = roll_dice_chapter(4, _dice_sides, "low") / 100; + var _armour_points = max(0, armour - _weapon.arp); + var _modified_damage = max(_min_damage, ((_weapon.attack.standard * _random_damage_mod) - _armour_points) * resistance); + + health_points -= _modified_damage; + + if (health_points <= 0) { + array_push(squad.army.lost_units, self); + array_delete_value(squad.units, self); + } + }; +} + +function BattleWeapon(_name, _owner) constructor { + name = _name; + owner = _owner; + profile = global.weapons[$ _name]; + ammo = 6; + reloading = -1; +} diff --git a/scripts/scr_weapon_stacks/scr_weapon_stacks.yy b/scripts/scr_new_combat_scripts/scr_new_combat_scripts.yy similarity index 73% rename from scripts/scr_weapon_stacks/scr_weapon_stacks.yy rename to scripts/scr_new_combat_scripts/scr_new_combat_scripts.yy index d41d71cc0c..ba97ee3c29 100644 --- a/scripts/scr_weapon_stacks/scr_weapon_stacks.yy +++ b/scripts/scr_new_combat_scripts/scr_new_combat_scripts.yy @@ -1,9 +1,9 @@ { "$GMScript":"v1", - "%Name":"scr_weapon_stacks", + "%Name":"scr_new_combat_scripts", "isCompatibility":false, "isDnD":false, - "name":"scr_weapon_stacks", + "name":"scr_new_combat_scripts", "parent":{ "name":"Combat", "path":"folders/Scripts/Combat.yy", diff --git a/scripts/scr_purge_world/scr_purge_world.gml b/scripts/scr_purge_world/scr_purge_world.gml index dda90e3a8b..8baddd1cb0 100644 --- a/scripts/scr_purge_world/scr_purge_world.gml +++ b/scripts/scr_purge_world/scr_purge_world.gml @@ -47,7 +47,7 @@ function scr_purge_world(star, planet, action_type, action_score) { obj_ncombat.battle_special="WL10_later"; scr_battle_allies(); setup_battle_formations(); - roster.add_to_battle(); + // roster.add_to_battle(); } } diff --git a/scripts/scr_struct_functions/scr_struct_functions.gml b/scripts/scr_struct_functions/scr_struct_functions.gml index 9dc286583a..46fe60bd6a 100644 --- a/scripts/scr_struct_functions/scr_struct_functions.gml +++ b/scripts/scr_struct_functions/scr_struct_functions.gml @@ -8,6 +8,31 @@ function DeepCloneStruct(clone_struct) { return variable_clone(clone_struct); } +function struct_load(_destination, _origin) { + try { + var _keys = struct_get_names(_origin); + for (var k = 0, l = array_length(_keys); k < l; k++){ + var _key = _keys[k]; + if (!struct_exists(_destination, _key)) { + log_error($"A key {_key} doesn't exist at destination!") + } + + var _value = _origin[$ _key]; + struct_set(_destination, _key, _value); + } + } catch (_exception) { + handle_exception(_exception); + } +} + +function struct_overwrite(_destination, _origin) { + var _keys = struct_get_names(_origin); + for (var k = 0, l = array_length(_keys); k < l; k++){ + var _key = _keys[k]; + var _value = _origin[$ _key]; + struct_set(_destination, _key, _value); + } +} function CountingMap() constructor { map = {}; diff --git a/scripts/scr_weapon_stacks/scr_weapon_stacks.gml b/scripts/scr_weapon_stacks/scr_weapon_stacks.gml deleted file mode 100644 index 2d55dbd23c..0000000000 --- a/scripts/scr_weapon_stacks/scr_weapon_stacks.gml +++ /dev/null @@ -1,310 +0,0 @@ -enum eUNIT_TYPE { - Unknown, - Infantry, - Vehicle, - Monster, - Fortification, -}; - -enum eUNIT_SUBTYPE { - Normal, - Character, - Flyer, - Monster, - Character, - Fortification, -}; - -enum eBATTLE_ALLEGIANCE { - Unknown, - Player, - Ally, - Enemy, -}; - -global.unit_profiles = json_to_gamemaker(working_directory + "\\data\\unit_profiles.jsonc", json_parse); -global.squad_profiles = json_to_gamemaker(working_directory + "\\data\\squad_profiles.jsonc", json_parse); - -function convert_keywords_to_set() { - var _squad_names = struct_get_names(global.squad_profiles); - var _squad_len = array_length(_squad_names); - for (var k = 0; k < _squad_len; k++){ - var _squad_name = _squad_names[k]; - var _squad = global.squad_profiles[$ _squad_name]; - _squad.keywords = new Set(_squad.keywords); - } -} - -convert_keywords_to_set(); - -global.army_profiles = json_to_gamemaker(working_directory + "\\data\\army_profiles.jsonc", json_parse); - -function BattlefieldGrid(_width, _height) constructor { - width = _width; - height = _height; - /// @type {Array} - cells = array_create(_width * _height); - size = array_length(cells); - for (var i = 0; i < size; i++) { - cells[i] = new BattlefieldGridCell(); - } - - static get_cell_index = function(_x, _y) { - return _x + _y * width; - }; - - static get_cell_coords = function(_index) { - var x = _index % width; - var y = floor(_index / width); - return [x, y]; - }; - - static get_occupants_at = function(_x, _y) { - var _cell = get_cell(_x, _y); - if (_cell != undefined) { - return _cell.occupants; - } - return []; - }; - - static add_squad = function(_x, _y, _squad) { - if (_x >= 0 && _x < width && _y >= 0 && _y < height) { - array_push(cells[get_cell_index(_x, _y)].occupants, _squad); - return true; - } else { - return false; - } - }; - - static remove_squad = function(_x, _y, _squad) { - if (_x >= 0 && _x < width && _y >= 0 && _y < height) { - array_delete_value(cells[get_cell_index(_x, _y)], _squad); - return true; - } else { - return false; - } - }; - - static get_cell = function(_x, _y) { - if (_x >= 0 && _x < width && _y >= 0 && _y < height) { - return cells[get_cell_index(_x, _y)]; - } - return undefined; - }; - - static soft_reset = function() { - var _size = array_length(cells); - for (var i = 0; i < _size; i++) { - cells[i].reset(); - } - }; -} - -function BattlefieldGridCell() constructor { - // terrain = -1; - // capacity = -1; - occupants = []; - - static reset = function() { - // terrain = 0; - // capacity = 1000; - occupants = []; - }; - - reset(); - - static get_occupants = function(_allegiance_type = -1, _squad_type = -1) { - var _filtered = []; - for (var i = 0, l = array_length(occupants); i < l; ++i) { - var _squad = occupants[i]; - var _match_allegiance = (_allegiance_type == -1 || _squad.allegiance == _allegiance_type); - var _match_type = (_squad_type == -1 || _squad._squad_type == _squad_type); - - if (_match_allegiance && _match_type) { - array_push(_filtered, _squad); - } - } - return _filtered; - } -} - -function BattleArmy(_name = "", _copy_profile = true) constructor { - name = _name; - profile = {}; - squads = []; - squad_count = array_length(squads); - unit_count = 0; - allegiance = eBATTLE_ALLEGIANCE.Unknown; - lost_units = []; - lost_squads = []; - - static copy_profile = function() { - var _army_profiles = global.army_profiles; - var _profile = _army_profiles[$ name]; - profile = _profile; - }; - - if (_copy_profile) { - copy_profile(); - } - - static spawn_forces = function() { - if (struct_exists(profile, "squads")) { - var _squads = profile.squads; - for (var i = 0, l = array_length(_squads); i < l; i++) { - var _squad = _squads[i]; - var _squad_name = _squad.name; - var _squad_count = _squad.count; - repeat (_squad_count) { - var _squad_struct = new BattleSquad(_squad_name); - _squad_struct.army = self; - array_push(squads, _squad_struct); - unit_count += _squad_struct.unit_count; - var _cell = obj_ncombat.battlefield[0]; - array_push(_cell, _squad_struct); - } - } - } - }; - - static move_forces = function () { - for (var i = 0, l = array_length(squads); i < l; i++) { - var _squad = squads[i]; - _squad.move(); - } - }; -} - -function BattleSquad(_name, _copy_profile = true) constructor { - name = _name; - display_name = _name; - units = []; - unit_count = array_length(units); - location = -1; - movement = -1; - engaged = false; - /// @type {Struct.BattleSquad} - target_squad = {}; - army = {}; - allegiance = eBATTLE_ALLEGIANCE.Unknown; - - static copy_profile = function() { - var _profile = global.squad_profiles[$ name]; - var _units = _profile.units; - display_name = _profile.display_name; - - var _unit_names = struct_get_names(_units); - for (var k = 0, l = array_length(_unit_names); k < l; k++){ - var _unit_name = _unit[k]; - var _unit = _units[$ _unit_name]; - - repeat (_unit.count) { - var _battle_unit = new BattleUnit(_unit_name); - _battle_unit.squad = self; - array_push(units, _battle_unit); - } - - if (movement == -1 || _battle_unit.profile.movement < movement) { - movement = _battle_unit.profile.movement; - } - } - }; - - if (_copy_profile) { - copy_profile(); - } - - static get_size = function () { - var _size = 0; - for (var i = 0, l = array_length(units); i < l; i++) { - var _unit = units[i]; - _size += _unit.profile.size; - } - return _size; - }; - - static move = function() { - if (location == -1 || engaged == true) { - exit; - } - - location = [location[0]++, location[1]++]; - }; - - static attack = function() { - var _all_weapons = []; - for (var i = 0; i < array_length(units); i++) { - array_concat(_all_weapons, units[i].weapons); - } - target_squad.resolve_attacks(_all_weapons); - }; - - static resolve_attacks = function(_weapons) { - for (var i = 0; i < array_length(_weapons); i++) { - var _weapon = _weapons[i]; - /// @type {Struct.BattleUnit} - var _target_unit = array_random_element(target_squad.units); - _target_unit.apply_damage(_weapon); - } - - if (unit_count <= 0) { - array_push(army.lost_squads, self); - array_delete_value(army.squads, self); - } - }; -} - -function BattleUnit(_name, _copy_profile = true) constructor { - name = _name; - display_name = _name; - abilities = []; - armour = 0; - health = 0; - resistance = 0; - weapons = []; - ranged_mod = 1; - melee_mod = 1; - profile = {}; - squad = {}; - - static copy_profile = function(_name) { - var _profile_struct = global.unit_profiles[$ _name]; - profile = _profile_struct; - var _stat_names = struct_get_names(_profile_struct); - var _stat_len = array_length(_stat_names); - for (var k = 0; k < _stat_len; k++){ - var _stat_name = _stat_names[k]; - struct_set(self, _stat_name, _profile_struct[$ _stat_name]); - } - for (var w = 0, l = array_length(weapons); w < l; w++) { - weapons[w] = new BattleWeapon(weapons[w], self); - } - }; - - if (_copy_profile) { - copy_profile(_name); - } - - static apply_damage = function(_weapon) { - var _min_damage = 0.25; - var _dice_sides = 50; - var _random_damage_mod = roll_dice_chapter(4, _dice_sides, "low") / 100; - var _armour_points = max(0, armour - _weapon.arp); - var _modified_damage = max(_min_damage, ((_weapon.attack.standard * _random_damage_mod) - _armour_points) * resistance); - - health -= _modified_damage; - - if (health <= 0) { - array_push(squad.army.lost_units, self); - array_delete_value(squad.units, self); - } - }; -} - -function BattleWeapon(_name, _owner) constructor { - name = _name; - owner = _owner; - profile = global.weapons[? _name]; - ammo = profile.ammo; - reloading = -1; -} From dc870ba96c108fcf812c8399f9741417400aca12 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Mon, 12 May 2025 13:36:18 +0300 Subject: [PATCH 77/80] Drawing refactored --- objects/obj_ncombat/Create_0.gml | 16 ++- objects/obj_ncombat/Draw_0.gml | 3 + objects/obj_ncombat/Draw_64.gml | 5 +- .../scr_new_combat_scripts.gml | 103 ++++++++++-------- 4 files changed, 76 insertions(+), 51 deletions(-) create mode 100644 objects/obj_ncombat/Draw_0.gml diff --git a/objects/obj_ncombat/Create_0.gml b/objects/obj_ncombat/Create_0.gml index ccbad4f05b..268debcf1d 100644 --- a/objects/obj_ncombat/Create_0.gml +++ b/objects/obj_ncombat/Create_0.gml @@ -367,29 +367,37 @@ function SimplePanel(_x1, _y1, _x2, _y2) constructor { y2 = _y2; x3 = (x1 + x2) / 2; y3 = (y1 + y2) / 2; + width = x2 - x1; + height = y2 - y1; back_colour = c_black; border_colour = COL_GREEN; + alpha = 1; static draw = function() { + draw_set_alpha(alpha); + draw_set_color(back_colour); draw_rectangle(x1, y1, x2, y2, false); draw_set_color(border_colour); var _offset_step = 3 / (4 - 1); - var _alpha_step = 1.0 / (4); + var _alpha_step = alpha / 4; for (var i = 0; i < 4; i++) { var _current_offset = round(i * _offset_step); - var _current_alpha = 1.0 - (i * _alpha_step); + var _current_alpha = alpha - (i * _alpha_step); _current_alpha = clamp(_current_alpha, 0, 1); draw_set_alpha(_current_alpha); draw_rectangle(x1 + _current_offset, y1 + _current_offset, x2 - _current_offset, y2 - _current_offset, true); } + draw_set_alpha(1); draw_set_color(c_white); }; } -message_log = new SimplePanel(22, 22, 800, 878); -battle_view = new SimplePanel(822, 22, 1578, 878); \ No newline at end of file +message_log = new SimplePanel(22, 22, 622, 622); +message_log.alpha = 0.2; + +battle_view = new SimplePanel(22, 22, 1578, 878); \ No newline at end of file diff --git a/objects/obj_ncombat/Draw_0.gml b/objects/obj_ncombat/Draw_0.gml new file mode 100644 index 0000000000..ad4b10000b --- /dev/null +++ b/objects/obj_ncombat/Draw_0.gml @@ -0,0 +1,3 @@ +draw_sprite(spr_rock_bg, 0, 0, 0); +battle_view.draw(); +battlefield_grid.draw(battle_view.x1, battle_view.y1, battle_view.x2, battle_view.y2); diff --git a/objects/obj_ncombat/Draw_64.gml b/objects/obj_ncombat/Draw_64.gml index 10b7e72fc7..d35a674c17 100644 --- a/objects/obj_ncombat/Draw_64.gml +++ b/objects/obj_ncombat/Draw_64.gml @@ -1,8 +1,4 @@ -draw_sprite(spr_rock_bg, 0, 0, 0); - message_log.draw(); -battle_view.draw(); -battlefield_grid.draw(); draw_set_font(fnt_40k_14); if ((display_p1 > 0) && (player_forces > 0)) { @@ -23,6 +19,7 @@ for (var i = 0, l = array_length(lines); i < l; i++) { draw_text_ext(message_log.x1 + 6, message_log.y1 + 6 + (i * 18), lines[i], 1, _max_line_length); } +draw_set_color(COL_YELLOW); var _turn_text = ""; if (battle_stage == eBATTLE_STAGE.Main) { _turn_text = "[Press Enter to Begin]"; diff --git a/scripts/scr_new_combat_scripts/scr_new_combat_scripts.gml b/scripts/scr_new_combat_scripts/scr_new_combat_scripts.gml index 2eb14da22e..438a846310 100644 --- a/scripts/scr_new_combat_scripts/scr_new_combat_scripts.gml +++ b/scripts/scr_new_combat_scripts/scr_new_combat_scripts.gml @@ -145,56 +145,24 @@ function BattlefieldGrid(_width, _height) constructor { } }; - static draw = function() { - var cell_width = 6; - var cell_height = 426; + static draw = function(_x1, _y1, _x2, _y2) { + var _cell_width = (_x2 - _x1) / width; + var _cell_height = (_y2 - _y1) / height; - var grid_start_x = 822; - var grid_start_y = 239; - - var rect_padding_x = 1; for (var _x = 0; _x < width; _x++) { for (var _y = 0; _y < height; _y++) { - var _screen_x = grid_start_x + _x * cell_width + _x; - var _screen_y = grid_start_y + _y * cell_height; + var _cell_x1 = _x1 + _x * _cell_width; + var _cell_y1 = _y1 + _y * _cell_height; + var _cell_x2 = _cell_x1 + _cell_width; + var _cell_y2 = _cell_y1 + _cell_height; draw_set_alpha(0.15); draw_set_color(c_gray); - draw_rectangle(_screen_x, _screen_y, _screen_x + cell_width, _screen_y + cell_height, true); + draw_rectangle(_cell_x1, _cell_y1, _cell_x2, _cell_y2, true); + draw_set_alpha(1); var _cell = get_cell(_x, _y); - var _occupants = _cell.occupants; - var _item_count = array_length(_occupants); - - if (_item_count > 0) { - draw_set_alpha(1); - - var total_stack_height = 0; - for (var i = 0; i < _item_count; i++) { - total_stack_height += _occupants[i].get_size(); - } - - var start_offset_y = (cell_height - total_stack_height) / 2; - var _current_y = _screen_y + start_offset_y; - - for (var i = 0; i < _item_count; i++) { - var _squad = _occupants[i]; - var _squad_visual_size = _squad.get_size(); - - if (_squad.allegiance == eBATTLE_ALLEGIANCE.Player) { - draw_set_color(c_blue); - } else if (_squad.allegiance == eBATTLE_ALLEGIANCE.Enemy) { - draw_set_color(c_red); - } else { - draw_set_color(c_gray); - } - - draw_rectangle(_screen_x + rect_padding_x, _current_y, _screen_x + cell_width - rect_padding_x, _current_y + _squad_visual_size, false); - draw_point_color((_screen_x + rect_padding_x) + (cell_width - 2 * rect_padding_x) / 2, _current_y + _squad_visual_size / 2, c_black); - - _current_y += _squad_visual_size; - } - } + _cell.draw_contents(_cell_x1, _cell_y1, _cell_x2, _cell_y2); } } @@ -208,10 +176,18 @@ function BattlefieldGridCell() constructor { capacity = -1; capacity_used = -1; occupants = []; + x1 = 0; + y1 = 0; + x2 = 0; + y2 = 0; + x3 = 0; + y3 = 0; + + static default_size = 400; static reset = function() { // terrain = 0; - capacity = 400; + capacity = default_size; capacity_used = 0; occupants = []; }; @@ -235,6 +211,47 @@ function BattlefieldGridCell() constructor { static can_fit = function(_size) { return capacity_used + _size <= capacity; }; + + static draw_contents = function(_cell_x1, _cell_y1, _cell_x2, _cell_y2) { + var _cell_width = _cell_x2 - _cell_x1; + var _cell_height = _cell_y2 - _cell_y1; + + var _item_count = array_length(occupants); + if (_item_count > 0) { + var _content_scale = _cell_height / default_size; + + var _cell_padding_x = _cell_width * 0.1 * _content_scale; + + var _total_squad_size = 0; + for (var i = 0; i < _item_count; i++) { + _total_squad_size += occupants[i].get_size(); + } + _total_squad_size *= _content_scale; + + var _current_y = _cell_y1 + ((_cell_height - _total_squad_size) / 2); + + for (var i = 0; i < _item_count; i++) { + var _squad = occupants[i]; + var _squad_size = _squad.get_size() * _content_scale; + + if (_squad.allegiance == eBATTLE_ALLEGIANCE.Player) { + draw_set_color(c_blue); + } else if (_squad.allegiance == eBATTLE_ALLEGIANCE.Enemy) { + draw_set_color(c_red); + } else { + draw_set_color(c_gray); + } + + draw_rectangle(_cell_x1 + _cell_padding_x, _current_y, _cell_x2 - _cell_padding_x, _current_y + _squad_size, false); + + _current_y += _squad_size; + } + } + }; + + static hovered_over = function() { + return scr_hit(x1, y1, x2, y2); + } } function BattleArmy(_name = "", _copy_profile = true) constructor { From 762f0695bedfe9803db3e97c1751115f32b3710b Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Mon, 12 May 2025 13:47:17 +0300 Subject: [PATCH 78/80] Nuke centerline --- ChapterMaster.yyp | 1 - objects/obj_centerline/Step_0.gml | 7 ---- objects/obj_centerline/obj_centerline.yy | 35 ------------------- objects/obj_enunit/Create_0.gml | 1 - objects/obj_enunit/Draw_64.gml | 7 ++-- objects/obj_ncombat/Create_0.gml | 1 - objects/obj_pnunit/Create_0.gml | 5 ++- objects/obj_pnunit/Draw_64.gml | 9 ++--- objects/obj_popup/Destroy_0.gml | 1 - .../__global_object_depths.gml | 2 -- scripts/scr_civil_roster/scr_civil_roster.gml | 2 -- scripts/scr_dialogue/scr_dialogue.gml | 1 - .../scr_ncombat_scripts.gml | 5 +-- .../scr_new_combat_scripts.gml | 16 +++++++-- 14 files changed, 20 insertions(+), 73 deletions(-) delete mode 100644 objects/obj_centerline/Step_0.gml delete mode 100644 objects/obj_centerline/obj_centerline.yy diff --git a/ChapterMaster.yyp b/ChapterMaster.yyp index e7a19bfb80..8f4bf0959d 100644 --- a/ChapterMaster.yyp +++ b/ChapterMaster.yyp @@ -596,7 +596,6 @@ {"id":{"name":"obj_al_ship","path":"objects/obj_al_ship/obj_al_ship.yy",},}, {"id":{"name":"obj_all_fleet","path":"objects/obj_all_fleet/obj_all_fleet.yy",},}, {"id":{"name":"obj_bomb_select","path":"objects/obj_bomb_select/obj_bomb_select.yy",},}, - {"id":{"name":"obj_centerline","path":"objects/obj_centerline/obj_centerline.yy",},}, {"id":{"name":"obj_circular","path":"objects/obj_circular/obj_circular.yy",},}, {"id":{"name":"obj_controller","path":"objects/obj_controller/obj_controller.yy",},}, {"id":{"name":"obj_creation_popup","path":"objects/obj_creation_popup/obj_creation_popup.yy",},}, diff --git a/objects/obj_centerline/Step_0.gml b/objects/obj_centerline/Step_0.gml deleted file mode 100644 index d05a341736..0000000000 --- a/objects/obj_centerline/Step_0.gml +++ /dev/null @@ -1,7 +0,0 @@ -/* -if (instance_exists(obj_pnunit)){ - var _nearest = instance_nearest(-100,240,obj_pnunit); - if (instance_exists(_nearest)){ - x = _nearest.x; - } -} */ diff --git a/objects/obj_centerline/obj_centerline.yy b/objects/obj_centerline/obj_centerline.yy deleted file mode 100644 index 296d855fa1..0000000000 --- a/objects/obj_centerline/obj_centerline.yy +++ /dev/null @@ -1,35 +0,0 @@ -{ - "$GMObject":"", - "%Name":"obj_centerline", - "eventList":[ - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":3,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - ], - "managed":true, - "name":"obj_centerline", - "overriddenProperties":[], - "parent":{ - "name":"New Combat", - "path":"folders/Objects/New Combat.yy", - }, - "parentObjectId":null, - "persistent":false, - "physicsAngularDamping":0.1, - "physicsDensity":0.5, - "physicsFriction":0.2, - "physicsGroup":0, - "physicsKinematic":false, - "physicsLinearDamping":0.1, - "physicsObject":false, - "physicsRestitution":0.1, - "physicsSensor":false, - "physicsShape":0, - "physicsShapePoints":[], - "physicsStartAwake":true, - "properties":[], - "resourceType":"GMObject", - "resourceVersion":"2.0", - "solid":false, - "spriteId":null, - "spriteMaskId":null, - "visible":true, -} \ No newline at end of file diff --git a/objects/obj_enunit/Create_0.gml b/objects/obj_enunit/Create_0.gml index b7b640b51e..549ff9552d 100644 --- a/objects/obj_enunit/Create_0.gml +++ b/objects/obj_enunit/Create_0.gml @@ -6,7 +6,6 @@ unit_count_old=0; composition_string=""; pos = 880; -centerline_offset = 0; draw_size = 0; x1 = 0; y1 = 0; diff --git a/objects/obj_enunit/Draw_64.gml b/objects/obj_enunit/Draw_64.gml index d88ff9a6e9..5fedb79122 100644 --- a/objects/obj_enunit/Draw_64.gml +++ b/objects/obj_enunit/Draw_64.gml @@ -4,13 +4,10 @@ if (draw_size > 0){ draw_set_alpha(1); draw_set_color(column_draw_colour); - if (instance_exists(obj_centerline)){ - centerline_offset=x-obj_centerline.x; - } - x1 = pos + (centerline_offset * 2); + x1 = pos ; y1 = 450 - (draw_size / 2); - x2 = pos + (centerline_offset * 2) + 10; + x2 = pos + 10; y2 = 450 + (draw_size / 2); if (is_mouse_over()) { diff --git a/objects/obj_ncombat/Create_0.gml b/objects/obj_ncombat/Create_0.gml index 268debcf1d..8d79296f21 100644 --- a/objects/obj_ncombat/Create_0.gml +++ b/objects/obj_ncombat/Create_0.gml @@ -60,7 +60,6 @@ instance_activate_object(obj_img); // u = instance_create(i * 10, 240, obj_pnunit); // } -instance_create(0, 0, obj_centerline); local_forces = 0; battle_loc = ""; diff --git a/objects/obj_pnunit/Create_0.gml b/objects/obj_pnunit/Create_0.gml index 42a3d92823..87e86f7a41 100644 --- a/objects/obj_pnunit/Create_0.gml +++ b/objects/obj_pnunit/Create_0.gml @@ -17,12 +17,11 @@ composition_string=""; column_size = 0; -centerline_offset = 0; pos = 880; draw_size = 0; -x1 = pos + (centerline_offset * 2); +x1 = pos; y1 = 450 - (draw_size / 2); -x2 = pos + (centerline_offset * 2) + 10; +x2 = pos + 10; y2 = 450 + (draw_size / 2); // let="";let=string_delete(obj_ini.psy_powers,2,string_length(obj_ini.psy_powers)-1);let=string_upper(let); diff --git a/objects/obj_pnunit/Draw_64.gml b/objects/obj_pnunit/Draw_64.gml index a2fb181e37..0bf3b4d1d3 100644 --- a/objects/obj_pnunit/Draw_64.gml +++ b/objects/obj_pnunit/Draw_64.gml @@ -4,20 +4,15 @@ if (draw_size > 0){ draw_set_alpha(1); draw_set_color(c_red); - if (instance_exists(obj_centerline)){ - centerline_offset=x-obj_centerline.x; - } - if (veh_type[1]=="Defenses"){ draw_size=0; if (instance_exists(obj_nfort)) then draw_size=400; - centerline_offset=135; draw_set_color(c_gray); } - x1 = pos + (centerline_offset * 2); + x1 = pos; y1 = 450 - (draw_size / 2); - x2 = pos + (centerline_offset * 2) + 10; + x2 = pos + 10; y2 = 450 + (draw_size / 2); if (is_mouse_over()) { diff --git a/objects/obj_popup/Destroy_0.gml b/objects/obj_popup/Destroy_0.gml index 8bb48aa41d..7053326cd8 100644 --- a/objects/obj_popup/Destroy_0.gml +++ b/objects/obj_popup/Destroy_0.gml @@ -99,7 +99,6 @@ if (instance_exists(obj_controller)){ instance_activate_object(obj_ini); instance_activate_object(obj_temp_meeting); instance_activate_object(obj_ncombat); - instance_activate_object(obj_centerline); instance_activate_object(obj_pnunit); instance_activate_object(obj_enunit); diff --git a/scripts/__global_object_depths/__global_object_depths.gml b/scripts/__global_object_depths/__global_object_depths.gml index 288b2b6164..07f08279c1 100644 --- a/scripts/__global_object_depths/__global_object_depths.gml +++ b/scripts/__global_object_depths/__global_object_depths.gml @@ -35,7 +35,6 @@ function __global_object_depths() { global.__objectDepths[24] = 3; // obj_en_pulse global.__objectDepths[25] = -50; // obj_explosion global.__objectDepths[26] = -25000; // obj_ncombat - global.__objectDepths[27] = -50000; // obj_centerline global.__objectDepths[28] = -30001; // obj_pnunit global.__objectDepths[29] = -30000; // obj_enunit global.__objectDepths[30] = -30000; // obj_nfort @@ -125,7 +124,6 @@ function __global_object_depths() { global.__objectNames[24] = "obj_en_pulse"; global.__objectNames[25] = "obj_explosion"; global.__objectNames[26] = "obj_ncombat"; - global.__objectNames[27] = "obj_centerline"; global.__objectNames[28] = "obj_pnunit"; global.__objectNames[29] = "obj_enunit"; global.__objectNames[30] = "obj_nfort"; diff --git a/scripts/scr_civil_roster/scr_civil_roster.gml b/scripts/scr_civil_roster/scr_civil_roster.gml index 8a49bc9443..b364f7f5d8 100644 --- a/scripts/scr_civil_roster/scr_civil_roster.gml +++ b/scripts/scr_civil_roster/scr_civil_roster.gml @@ -16,7 +16,6 @@ function scr_civil_roster(_unit_location, _target_location, _is_planet) { //???=obj_controller //???=obj_pnunit //???=obj_enunit - //???=obj_centerline //-------------------------------------------------------------------------------------------------------------------- var stop,okay,sofar; @@ -47,7 +46,6 @@ function scr_civil_roster(_unit_location, _target_location, _is_planet) { instance_activate_object(obj_pnunit); instance_activate_object(obj_enunit); - instance_activate_object(obj_centerline); if (new_combat.enemy=1){ var i,u;i=11; diff --git a/scripts/scr_dialogue/scr_dialogue.gml b/scripts/scr_dialogue/scr_dialogue.gml index 0976887efb..8e2fa109da 100644 --- a/scripts/scr_dialogue/scr_dialogue.gml +++ b/scripts/scr_dialogue/scr_dialogue.gml @@ -397,7 +397,6 @@ function scr_dialogue(diplo_keyphrase) { instance_activate_object(obj_ini); instance_activate_object(obj_temp_meeting); instance_activate_object(obj_ncombat); - instance_activate_object(obj_centerline); instance_activate_object(obj_pnunit); instance_activate_object(obj_enunit); diff --git a/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml b/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml index ff2efa55b5..11fc0f5c09 100644 --- a/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml +++ b/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml @@ -1,7 +1,7 @@ enum eBATTLE_TURN_PHASE { Movement, - Psychic, Shooting, + Psychic, Charge, Fight, Morale, @@ -5879,9 +5879,6 @@ function ncombat_special_end() { with (obj_nfort) { instance_destroy(); } - with (obj_centerline) { - instance_destroy(); - } obj_controller.new_buttons_hide = 0; if (instance_exists(obj_cursor)) { diff --git a/scripts/scr_new_combat_scripts/scr_new_combat_scripts.gml b/scripts/scr_new_combat_scripts/scr_new_combat_scripts.gml index 438a846310..16ee6715b3 100644 --- a/scripts/scr_new_combat_scripts/scr_new_combat_scripts.gml +++ b/scripts/scr_new_combat_scripts/scr_new_combat_scripts.gml @@ -350,8 +350,6 @@ function BattleArmy(_name = "", _copy_profile = true) constructor { // Attempt to place the squad at the current spawn X and Y=0 var _placed = false; - // Assuming squad size affects placement validation but not the starting cell for sequential placement - // The grid's add_squad method should handle multi-cell squads starting from the given coordinate if (_battlefield.add_squad(_current_spawn_x, 0, _battle_squad)) { array_push(squads, _battle_squad); _placed = true; @@ -367,7 +365,6 @@ function BattleArmy(_name = "", _copy_profile = true) constructor { if (!_placed) { show_error($"Warning: Could not place squad '{_squad_name}' for '{allegiance}' at ({_current_spawn_x}, 0)!", false); - // The squad instance is not added to the army's list if not placed } } } @@ -393,6 +390,19 @@ function BattleArmy(_name = "", _copy_profile = true) constructor { _squad.move(); } }; + + static move_forces = function () { + if (array_length(squads) == 0) { + exit; + } + + squad_initiative_sort(); + + for (var i = 0, l = array_length(squads); i < l; i++) { + var _squad = squads[i]; + _squad.move(); + } + }; } function BattleSquad(_name, _copy_profile = true) constructor { From 1c74345526fef5a0c7c138dc2ab7439d1453265f Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Mon, 12 May 2025 14:07:38 +0300 Subject: [PATCH 79/80] Move the constructor out of create --- ChapterMaster.yyp | 2 + objects/obj_ncombat/Create_0.gml | 37 ------------------- .../scr_ui_constructors.gml | 36 ++++++++++++++++++ .../scr_ui_constructors.yy | 13 +++++++ 4 files changed, 51 insertions(+), 37 deletions(-) create mode 100644 scripts/scr_ui_constructors/scr_ui_constructors.gml create mode 100644 scripts/scr_ui_constructors/scr_ui_constructors.yy diff --git a/ChapterMaster.yyp b/ChapterMaster.yyp index 8f4bf0959d..eed53a11ec 100644 --- a/ChapterMaster.yyp +++ b/ChapterMaster.yyp @@ -44,6 +44,7 @@ {"$GMFolder":"","%Name":"save_load","folderPath":"folders/Scripts/save_load.yy","name":"save_load","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"Sys","folderPath":"folders/Scripts/Sys.yy","name":"Sys","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"Turn","folderPath":"folders/Scripts/Turn.yy","name":"Turn","resourceType":"GMFolder","resourceVersion":"2.0",}, + {"$GMFolder":"","%Name":"UI Constructors","folderPath":"folders/Scripts/UI Constructors.yy","name":"UI Constructors","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"User Interface","folderPath":"folders/Scripts/User Interface.yy","name":"User Interface","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"Components","folderPath":"folders/Scripts/User Interface/Components.yy","name":"Components","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"Diplomacy","folderPath":"folders/Scripts/User Interface/Diplomacy.yy","name":"Diplomacy","resourceType":"GMFolder","resourceVersion":"2.0",}, @@ -918,6 +919,7 @@ {"id":{"name":"scr_trade","path":"scripts/scr_trade/scr_trade.yy",},}, {"id":{"name":"scr_turn_first","path":"scripts/scr_turn_first/scr_turn_first.yy",},}, {"id":{"name":"scr_ui_advisors","path":"scripts/scr_ui_advisors/scr_ui_advisors.yy",},}, + {"id":{"name":"scr_ui_constructors","path":"scripts/scr_ui_constructors/scr_ui_constructors.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",},}, {"id":{"name":"scr_ui_formation_bars","path":"scripts/scr_ui_formation_bars/scr_ui_formation_bars.yy",},}, diff --git a/objects/obj_ncombat/Create_0.gml b/objects/obj_ncombat/Create_0.gml index 8d79296f21..6aa62c8ba6 100644 --- a/objects/obj_ncombat/Create_0.gml +++ b/objects/obj_ncombat/Create_0.gml @@ -359,43 +359,6 @@ display_message_queue = function() { battlefield_grid = new BattlefieldGrid(100, 1); -function SimplePanel(_x1, _y1, _x2, _y2) constructor { - x1 = _x1; - y1 = _y1; - x2 = _x2; - y2 = _y2; - x3 = (x1 + x2) / 2; - y3 = (y1 + y2) / 2; - width = x2 - x1; - height = y2 - y1; - back_colour = c_black; - border_colour = COL_GREEN; - alpha = 1; - - static draw = function() { - draw_set_alpha(alpha); - - draw_set_color(back_colour); - draw_rectangle(x1, y1, x2, y2, false); - - draw_set_color(border_colour); - var _offset_step = 3 / (4 - 1); - var _alpha_step = alpha / 4; - for (var i = 0; i < 4; i++) { - var _current_offset = round(i * _offset_step); - var _current_alpha = alpha - (i * _alpha_step); - _current_alpha = clamp(_current_alpha, 0, 1); - - draw_set_alpha(_current_alpha); - - draw_rectangle(x1 + _current_offset, y1 + _current_offset, x2 - _current_offset, y2 - _current_offset, true); - } - - draw_set_alpha(1); - draw_set_color(c_white); - }; -} - message_log = new SimplePanel(22, 22, 622, 622); message_log.alpha = 0.2; diff --git a/scripts/scr_ui_constructors/scr_ui_constructors.gml b/scripts/scr_ui_constructors/scr_ui_constructors.gml new file mode 100644 index 0000000000..565a81280e --- /dev/null +++ b/scripts/scr_ui_constructors/scr_ui_constructors.gml @@ -0,0 +1,36 @@ +function SimplePanel(_x1, _y1, _x2, _y2) constructor { + x1 = _x1; + y1 = _y1; + x2 = _x2; + y2 = _y2; + x3 = (x1 + x2) / 2; + y3 = (y1 + y2) / 2; + width = x2 - x1; + height = y2 - y1; + back_colour = c_black; + border_colour = COL_GREEN; + alpha = 1; + + static draw = function() { + draw_set_alpha(alpha); + + draw_set_color(back_colour); + draw_rectangle(x1, y1, x2, y2, false); + + draw_set_color(border_colour); + var _offset_step = 3 / (4 - 1); + var _alpha_step = alpha / 4; + for (var i = 0; i < 4; i++) { + var _current_offset = round(i * _offset_step); + var _current_alpha = alpha - (i * _alpha_step); + _current_alpha = clamp(_current_alpha, 0, 1); + + draw_set_alpha(_current_alpha); + + draw_rectangle(x1 + _current_offset, y1 + _current_offset, x2 - _current_offset, y2 - _current_offset, true); + } + + draw_set_alpha(1); + draw_set_color(c_white); + }; +} diff --git a/scripts/scr_ui_constructors/scr_ui_constructors.yy b/scripts/scr_ui_constructors/scr_ui_constructors.yy new file mode 100644 index 0000000000..f0654f1add --- /dev/null +++ b/scripts/scr_ui_constructors/scr_ui_constructors.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"scr_ui_constructors", + "isCompatibility":false, + "isDnD":false, + "name":"scr_ui_constructors", + "parent":{ + "name":"UI Constructors", + "path":"folders/Scripts/UI Constructors.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file From 6733a03b8aab2ffb3f349edb9b1442445a690bb8 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Mon, 12 May 2025 19:25:42 +0300 Subject: [PATCH 80/80] Kill enunit and continue to work on stuff --- ChapterMaster.yyp | 1 - objects/obj_enunit/Create_0.gml | 103 -------------- objects/obj_enunit/Draw_64.gml | 41 ------ objects/obj_enunit/obj_enunit.yy | 44 ------ objects/obj_ncombat/Create_0.gml | 71 +++++++--- objects/obj_ncombat/Step_0.gml | 129 +++--------------- objects/obj_popup/Destroy_0.gml | 1 - .../__global_object_depths.gml | 2 - .../scr_ancient_ruins/scr_ancient_ruins.gml | 1 - scripts/scr_civil_roster/scr_civil_roster.gml | 11 -- .../scr_ncombat_scripts.gml | 8 +- .../scr_new_combat_scripts.gml | 74 +++++----- 12 files changed, 107 insertions(+), 379 deletions(-) delete mode 100644 objects/obj_enunit/Create_0.gml delete mode 100644 objects/obj_enunit/Draw_64.gml delete mode 100644 objects/obj_enunit/obj_enunit.yy diff --git a/ChapterMaster.yyp b/ChapterMaster.yyp index eed53a11ec..4e7047dfb3 100644 --- a/ChapterMaster.yyp +++ b/ChapterMaster.yyp @@ -618,7 +618,6 @@ {"id":{"name":"obj_en_round","path":"objects/obj_en_round/obj_en_round.yy",},}, {"id":{"name":"obj_en_ship","path":"objects/obj_en_ship/obj_en_ship.yy",},}, {"id":{"name":"obj_enemy_leftest","path":"objects/obj_enemy_leftest/obj_enemy_leftest.yy",},}, - {"id":{"name":"obj_enunit","path":"objects/obj_enunit/obj_enunit.yy",},}, {"id":{"name":"obj_event_log","path":"objects/obj_event_log/obj_event_log.yy",},}, {"id":{"name":"obj_event","path":"objects/obj_event/obj_event.yy",},}, {"id":{"name":"obj_explosion","path":"objects/obj_explosion/obj_explosion.yy",},}, diff --git a/objects/obj_enunit/Create_0.gml b/objects/obj_enunit/Create_0.gml deleted file mode 100644 index 549ff9552d..0000000000 --- a/objects/obj_enunit/Create_0.gml +++ /dev/null @@ -1,103 +0,0 @@ - -owner = 2; -flank=0; - -unit_count_old=0; -composition_string=""; - -pos = 880; -draw_size = 0; -x1 = 0; -y1 = 0; -x2 = 0; -y2 = 0; - -if (obj_ncombat.enemy < array_length(global.star_name_colors) && obj_ncombat.enemy >= 0) { - column_draw_colour = global.star_name_colors[obj_ncombat.enemy]; -} else { - column_draw_colour = c_dkgrey; -} - - -target_block = noone; - -weapon_stacks_normal = []; -weapon_stacks_vehicle = {}; -weapon_stacks_unique = {}; - -composition_map = new CountingMap(); - -unit_squads = []; -units = []; - -column_size = 0; - -engaged = function() { - return collision_point(x - 10, y, obj_pnunit, 0, 1) || collision_point(x + 10, y, obj_pnunit, 0, 1); -}; - -is_mouse_over = function() { - return scr_hit(x1, y1, x2, y2) && obj_ncombat.fading_strength == false; -}; - - -copy_block_composition = function(_composition) { - if (struct_exists(_composition, "units")) { - var _units = _composition.units; - for (var i = 0, l = array_length(_units); i < l; i++) { - var _unit = _units[i]; - var _unit_name = _unit.name; - var _unit_count = _unit.count; - repeat (_unit_count) { - var _unit_struct = new BattleUnit(_unit_name); - array_push(units, _unit_struct); - column_size += _unit_struct.unit_size; - } - } - } - - if (struct_exists(_composition, "squads")) { - var _squads = _composition.squads; - for (var i = 0, l = array_length(_squads); i < l; i++) { - var _squad = _squads[i]; - var _squad_name = _squad.name; - var _squad_count = _squad.count; - repeat (_squad_count) { - var _squad_struct = new BattleSquad(_squad_name); - array_push(unit_squads, _squad_struct); - column_size += _squad_struct.squad_size; - } - } - } -}; - -assign_weapon_stacks = function() { - for (var i = 0, l = array_length(unit_squads); i < l; i++){ - var _unit_squad = unit_squads[i]; - for (var s = 0, l2 = array_length(_unit_squad.units); s < l2; s++) { - var _member_stack = _unit_squad.units[s]; - for (var w = 0, l3 = array_length(_member_stack.weapons); w < l3; w++) { - scr_en_weapon(_member_stack.weapons[w], _member_stack.unit_type, _member_stack.unit_count, _member_stack.display_name); - } - } - } -}; - -unit_count = function() { - // if (DEBUG_COMBAT_PERFORMANCE) { - // stopwatch("unit_count"); - // } - - var _unit_count = 0; - - for (var i = 0, l = array_length(unit_squads); i < l; i++){ - var _unit_squad = unit_squads[i]; - _unit_count += _unit_squad.unit_count; - } - - // if (DEBUG_COMBAT_PERFORMANCE) { - // stopwatch("unit_count"); - // } - - return _unit_count; -}; diff --git a/objects/obj_enunit/Draw_64.gml b/objects/obj_enunit/Draw_64.gml deleted file mode 100644 index 5fedb79122..0000000000 --- a/objects/obj_enunit/Draw_64.gml +++ /dev/null @@ -1,41 +0,0 @@ -draw_size = column_size; - -if (draw_size > 0){ - draw_set_alpha(1); - draw_set_color(column_draw_colour); - - - x1 = pos ; - y1 = 450 - (draw_size / 2); - x2 = pos + 10; - y2 = 450 + (draw_size / 2); - - if (is_mouse_over()) { - draw_set_alpha(0.8); - } - - draw_rectangle(x1, y1, x2, y2, 0); - - if (is_mouse_over()) { - if (unit_count() != unit_count_old) { - unit_count_old = unit_count(); - composition_map.clear(); - - for (var i = 0, l = array_length(units); i < l; i++){ - var _unit = units[i]; - composition_map.add($"{_unit.display_name}"); - } - - for (var i = 0, l = array_length(unit_squads); i < l; i++){ - var _unit_squad = unit_squads[i]; - composition_map.add($"{_unit_squad.display_name} Squad"); - } - - composition_string = composition_map.get_total_string(); - } - - draw_block_composition(x1, composition_string); - } - - draw_block_fadein(); -} diff --git a/objects/obj_enunit/obj_enunit.yy b/objects/obj_enunit/obj_enunit.yy deleted file mode 100644 index bd4a358ab1..0000000000 --- a/objects/obj_enunit/obj_enunit.yy +++ /dev/null @@ -1,44 +0,0 @@ -{ - "$GMObject":"", - "%Name":"obj_enunit", - "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":6,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":87,"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_enunit", - "overriddenProperties":[], - "parent":{ - "name":"New Combat", - "path":"folders/Objects/New Combat.yy", - }, - "parentObjectId":null, - "persistent":false, - "physicsAngularDamping":0.1, - "physicsDensity":0.5, - "physicsFriction":0.2, - "physicsGroup":0, - "physicsKinematic":false, - "physicsLinearDamping":0.1, - "physicsObject":false, - "physicsRestitution":0.1, - "physicsSensor":false, - "physicsShape":0, - "physicsShapePoints":[ - {"x":0,"y":0,}, - {"x":5,"y":5,}, - ], - "physicsStartAwake":true, - "properties":[], - "resourceType":"GMObject", - "resourceVersion":"2.0", - "solid":true, - "spriteId":{ - "name":"spr_battle_block2", - "path":"sprites/spr_battle_block2/spr_battle_block2.yy", - }, - "spriteMaskId":null, - "visible":true, -} \ No newline at end of file diff --git a/objects/obj_ncombat/Create_0.gml b/objects/obj_ncombat/Create_0.gml index 6aa62c8ba6..0a7a96b511 100644 --- a/objects/obj_ncombat/Create_0.gml +++ b/objects/obj_ncombat/Create_0.gml @@ -53,14 +53,6 @@ instance_activate_object(obj_cursor); instance_activate_object(obj_ini); instance_activate_object(obj_img); -// var i, u; -// i = 11; -// repeat (10) { -// i -= 1; // This creates the objects to then be filled in -// u = instance_create(i * 10, 240, obj_pnunit); -// } - - local_forces = 0; battle_loc = ""; battle_climate = ""; @@ -167,7 +159,6 @@ casualties = 0; world_size = 0; turn_phase = eBATTLE_TURN_PHASE.Movement; -turn_side = eBATTLE_ALLEGIANCE.Player; // @@ -312,18 +303,15 @@ queue_force_health = function() { var _text = ""; if (turn_phase == eBATTLE_TURN_PHASE.Movement) { - if (turn_side == eBATTLE_ALLEGIANCE.Player) { - if (player_forces > 0) { - _text = $"The {global.chapter_name} are at {string(round((player_forces / player_max) * 100))}% strength!"; - } else { - _text = $"The {global.chapter_name} are defeated!"; - } + if (player_forces > 0) { + _text = $"The {global.chapter_name} are at {string(round((player_forces / player_max) * 100))}% strength!"; } else { - if (enemy_forces > 0) { - _text = $"The enemy forces are at {string(max(1, round((enemy_forces / enemy_max) * 100)))}% strength!"; - } else { - _text = "The enemy forces are defeated!"; - } + _text = $"The {global.chapter_name} are defeated!"; + } + if (enemy_forces > 0) { + _text = $"The enemy forces are at {string(max(1, round((enemy_forces / enemy_max) * 100)))}% strength!"; + } else { + _text = "The enemy forces are defeated!"; } queue_battlelog_message(_text, COL_YELLOW); @@ -362,4 +350,45 @@ battlefield_grid = new BattlefieldGrid(100, 1); message_log = new SimplePanel(22, 22, 622, 622); message_log.alpha = 0.2; -battle_view = new SimplePanel(22, 22, 1578, 878); \ No newline at end of file +battle_view = new SimplePanel(22, 22, 1578, 878); + +all_squads = []; + +squad_initiative_sort = function() { + array_sort(all_squads, function(_squad_a, _squad_b) { + var _movement_diff = _squad_b.movement - _squad_a.movement; + if (_movement_diff != 0) { + return _movement_diff; + } else { + return choose(-1, 1) + } + }); +}; + +update_squads_array = function () { + all_squads = array_concat(player_force.squads, enemy_force.squads); +} + +squads_move = function () { + if (array_length(all_squads) == 0) { + exit; + } + + squad_initiative_sort(); + + for (var i = 0, l = array_length(all_squads); i < l; i++) { + var _squad = all_squads[i]; + _squad.move(); + } +}; + +squads_attack = function () { + if (array_length(all_squads) == 0) { + exit; + } + + for (var i = 0, l = array_length(all_squads); i < l; i++) { + var _squad = all_squads[i]; + _squad.attack(); + } +}; diff --git a/objects/obj_ncombat/Step_0.gml b/objects/obj_ncombat/Step_0.gml index 929cd4749f..ef0ab8e2f3 100644 --- a/objects/obj_ncombat/Step_0.gml +++ b/objects/obj_ncombat/Step_0.gml @@ -11,34 +11,16 @@ if (battle_stage == eBATTLE_STAGE.Creation) { stopwatch("BATTLE_STAGE.Creation"); } - ncombat_enemy_stacks_init(); + enemy_force.name = "orks_6"; + enemy_force.copy_profile(); + enemy_force.spawn_squads(); - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("scr_player_combat_weapon_stacks"); - } - // with (obj_pnunit) { - // scr_player_combat_weapon_stacks(); - // } - - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("scr_player_combat_weapon_stacks"); - } - - // with (obj_pnunit) { - // pnunit_battle_effects(); - // } - - // ncombat_battle_start(); - - // ncombat_ally_init(); - // update_battlefield_scale(); + player_force.name = "orks_6"; + player_force.copy_profile(); + player_force.spawn_squads(); battle_stage = eBATTLE_STAGE.Main; - - if (obj_ncombat.enemy == 30 || battle_special == "ship_demon") { - turn_side = eBATTLE_ALLEGIANCE.Enemy; - } if (DEBUG_COMBAT_PERFORMANCE) { stopwatch("BATTLE_STAGE.Creation"); @@ -48,108 +30,33 @@ if (battle_stage == eBATTLE_STAGE.Creation) { if ((press_exclusive(vk_enter) || hold_exclusive(vk_enter)) && fading_strength == 0) { if (turn_phase == eBATTLE_TURN_PHASE.Movement) { if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("BATTLE_TURN.Start"); + stopwatch("Move Phase"); } turn_count++; // global_perils -= 1; queue_battlelog_message($"Turn {turn_count}", COL_YELLOW); - // resolve_battle_state(); display_message_queue(); - - if (turn_side == eBATTLE_ALLEGIANCE.Enemy) { - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("move_enemy_forces"); - } - - enemy_force.move_forces(); - - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("move_enemy_forces"); - } - - // if (instance_exists(obj_enunit)) { - // if (DEBUG_COMBAT_PERFORMANCE) { - // stopwatch("enunit_create_weapon_stacks"); - // } - // with (obj_enunit) { - // assign_weapon_stacks(); - // } - // if (DEBUG_COMBAT_PERFORMANCE) { - // stopwatch("enunit_create_weapon_stacks"); - // } - // if (DEBUG_COMBAT_PERFORMANCE) { - // stopwatch("enunit_target_and_shoot"); - // } - // with (obj_enunit) { - // enunit_target_and_shoot(); - // } - // if (DEBUG_COMBAT_PERFORMANCE) { - // stopwatch("enunit_target_and_shoot"); - // } - // } - // display_message_queue(); - } - if (turn_side == eBATTLE_ALLEGIANCE.Player) { - // player_blocks_movement(); - // if (DEBUG_COMBAT_PERFORMANCE) { - // stopwatch("pnunit_stacking_shooting"); - // } - // with (obj_pnunit) { - // pnunit_battle_effects(); - // scr_player_combat_weapon_stacks(); - // pnunit_target_and_shoot(); - // } - // if (DEBUG_COMBAT_PERFORMANCE) { - // stopwatch("pnunit_stacking_shooting"); - // } - // with (obj_enunit) { - // enunit_enemy_profiles_init(); - // } - // display_message_queue(); - } + update_squads_array(); - // queue_force_health(); - // display_message_queue(); + squads_move(); - turn_phase = eBATTLE_TURN_PHASE.Morale; + turn_phase = eBATTLE_TURN_PHASE.Attack; if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("BATTLE_TURN.Start"); + stopwatch("Move Phase"); } } - if (turn_phase == eBATTLE_TURN_PHASE.Morale) { - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("BATTLE_TURN.End"); - } - - // if (!battle_ended) { - // with (obj_pnunit) { - // pnunit_is_valid(id); - // } - - // with (obj_enunit) { - // enunit_is_valid(id) - // } - // } - - // update_battlefield_scale(); + if (turn_phase == eBATTLE_TURN_PHASE.Attack) { + squads_attack(); - if (turn_side == eBATTLE_ALLEGIANCE.Enemy) { - turn_side = eBATTLE_ALLEGIANCE.Player; - } - - if (turn_side == eBATTLE_ALLEGIANCE.Player) { - turn_side = eBATTLE_ALLEGIANCE.Enemy; - } + turn_phase = eBATTLE_TURN_PHASE.Morale; + } + if (turn_phase == eBATTLE_TURN_PHASE.Morale) { turn_phase = eBATTLE_TURN_PHASE.Movement; - - if (DEBUG_COMBAT_PERFORMANCE) { - stopwatch("BATTLE_TURN.End"); - } } @@ -157,9 +64,7 @@ if ((press_exclusive(vk_enter) || hold_exclusive(vk_enter)) && fading_strength = battle_stage = eBATTLE_STAGE.PlayerWinEnd; var _quad_factor = 10; total_battle_exp_gain = _quad_factor * sqr(threat); - with (obj_enunit) { - enunit_enemy_profiles_init(); - } + instance_activate_object(obj_star); instance_activate_object(obj_event_log); ncombat_battle_end(); diff --git a/objects/obj_popup/Destroy_0.gml b/objects/obj_popup/Destroy_0.gml index 7053326cd8..6d918a3024 100644 --- a/objects/obj_popup/Destroy_0.gml +++ b/objects/obj_popup/Destroy_0.gml @@ -100,7 +100,6 @@ if (instance_exists(obj_controller)){ instance_activate_object(obj_temp_meeting); instance_activate_object(obj_ncombat); instance_activate_object(obj_pnunit); - instance_activate_object(obj_enunit); exit; } diff --git a/scripts/__global_object_depths/__global_object_depths.gml b/scripts/__global_object_depths/__global_object_depths.gml index 07f08279c1..70ff6feaaa 100644 --- a/scripts/__global_object_depths/__global_object_depths.gml +++ b/scripts/__global_object_depths/__global_object_depths.gml @@ -36,7 +36,6 @@ function __global_object_depths() { global.__objectDepths[25] = -50; // obj_explosion global.__objectDepths[26] = -25000; // obj_ncombat global.__objectDepths[28] = -30001; // obj_pnunit - global.__objectDepths[29] = -30000; // obj_enunit global.__objectDepths[30] = -30000; // obj_nfort global.__objectDepths[31] = 0; // obj_temp1 global.__objectDepths[32] = 0; // obj_temp2 @@ -125,7 +124,6 @@ function __global_object_depths() { global.__objectNames[25] = "obj_explosion"; global.__objectNames[26] = "obj_ncombat"; global.__objectNames[28] = "obj_pnunit"; - global.__objectNames[29] = "obj_enunit"; global.__objectNames[30] = "obj_nfort"; global.__objectNames[31] = "obj_temp1"; global.__objectNames[32] = "obj_temp2"; diff --git a/scripts/scr_ancient_ruins/scr_ancient_ruins.gml b/scripts/scr_ancient_ruins/scr_ancient_ruins.gml index c9c4cf2c44..3fc10a3cdf 100644 --- a/scripts/scr_ancient_ruins/scr_ancient_ruins.gml +++ b/scripts/scr_ancient_ruins/scr_ancient_ruins.gml @@ -44,7 +44,6 @@ function scr_ruins_suprise_attack_player(){ } else { instance_destroy(obj_ncombat); instance_destroy(obj_pnunit); - instance_destroy(obj_enunit); instance_activate_all(); scr_ruins_reward(_star,_planet,self); } diff --git a/scripts/scr_civil_roster/scr_civil_roster.gml b/scripts/scr_civil_roster/scr_civil_roster.gml index b364f7f5d8..fb0106f2bf 100644 --- a/scripts/scr_civil_roster/scr_civil_roster.gml +++ b/scripts/scr_civil_roster/scr_civil_roster.gml @@ -15,7 +15,6 @@ function scr_civil_roster(_unit_location, _target_location, _is_planet) { //???=obj_drop_select; //???=obj_controller //???=obj_pnunit - //???=obj_enunit //-------------------------------------------------------------------------------------------------------------------- var stop,okay,sofar; @@ -45,16 +44,6 @@ function scr_civil_roster(_unit_location, _target_location, _is_planet) { co=0;v=0;meeting=true;he_good=false; instance_activate_object(obj_pnunit); - instance_activate_object(obj_enunit); - - if (new_combat.enemy=1){ - var i,u;i=11; - repeat(10){i-=1;// This creates the objects to then be filled in - u=instance_create(110+(i*10),240,obj_enunit); - } - } - - instance_activate_object(obj_enunit); repeat(300){v+=1;he_good=0; diff --git a/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml b/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml index 11fc0f5c09..c285c008af 100644 --- a/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml +++ b/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml @@ -1,9 +1,7 @@ enum eBATTLE_TURN_PHASE { Movement, - Shooting, + Attack, Psychic, - Charge, - Fight, Morale, } @@ -1436,6 +1434,10 @@ function ncombat_enemy_stacks_init() { if (DEBUG_COMBAT_PERFORMANCE) { stopwatch("enemy_squad_spawning"); } + + player_force.name = "orks_6"; + player_force.copy_profile(); + player_force.spawn_squads(); } } diff --git a/scripts/scr_new_combat_scripts/scr_new_combat_scripts.gml b/scripts/scr_new_combat_scripts/scr_new_combat_scripts.gml index 16ee6715b3..3c758e039e 100644 --- a/scripts/scr_new_combat_scripts/scr_new_combat_scripts.gml +++ b/scripts/scr_new_combat_scripts/scr_new_combat_scripts.gml @@ -103,7 +103,7 @@ function BattlefieldGrid(_width, _height) constructor { if (valid_cell(_x, _y)) { var _cell = cells[get_cell_index(_x, _y)]; var _squad_size = _squad.get_size(); - if (_cell.can_fit(_squad_size)) { + if (_cell.allegiance_match(_squad.allegiance) && _cell.can_fit(_squad_size)) { var _old_location = _squad.location; remove_squad(_old_location[0], _old_location[1], _squad); add_squad(_x, _y, _squad); @@ -206,7 +206,11 @@ function BattlefieldGridCell() constructor { } } return _filtered; - } + }; + + static allegiance_match = function(_allegiance) { + return array_length(occupants) == 0 || occupants[0].allegiance == _allegiance; + }; static can_fit = function(_size) { return capacity_used + _size <= capacity; @@ -251,7 +255,7 @@ function BattlefieldGridCell() constructor { static hovered_over = function() { return scr_hit(x1, y1, x2, y2); - } + }; } function BattleArmy(_name = "", _copy_profile = true) constructor { @@ -371,38 +375,6 @@ function BattleArmy(_name = "", _copy_profile = true) constructor { return true; }; - - static squad_initiative_sort = function(_squad_a, _squad_b) { - array_sort(squads, function(_squad_a, _squad_b) { - return _squad_b.movement - _squad_a.movement; - }); - } - - static move_forces = function () { - if (array_length(squads) == 0) { - exit; - } - - squad_initiative_sort(); - - for (var i = 0, l = array_length(squads); i < l; i++) { - var _squad = squads[i]; - _squad.move(); - } - }; - - static move_forces = function () { - if (array_length(squads) == 0) { - exit; - } - - squad_initiative_sort(); - - for (var i = 0, l = array_length(squads); i < l; i++) { - var _squad = squads[i]; - _squad.move(); - } - }; } function BattleSquad(_name, _copy_profile = true) constructor { @@ -470,11 +442,35 @@ function BattleSquad(_name, _copy_profile = true) constructor { } var _movement_direction = (allegiance == eBATTLE_ALLEGIANCE.Player) ? 1 : -1; - for (var _movement_distance = movement; _movement_distance >= 1; _movement_distance--) { - var _movement_delta = _movement_direction * _movement_distance; + + var _max_movement = movement; + var _current_x = location[0]; + var _current_y = location[1]; + + // Step 1: Check for hostile squads in the path + for (var i = 1; i <= movement; i++) { + var _check_x = _current_x + _movement_direction * i; + var _check_y = _current_y; + + if (obj_ncombat.battlefield_grid.valid_cell(_check_x, _check_y)) { + var _cell = obj_ncombat.battlefield_grid.cells[obj_ncombat.battlefield_grid.get_cell_index(_check_x, _check_y)]; + + // If a hostile squad is found + if (!_cell.allegiance_match(allegiance)) { + _max_movement = i - 1; // Cap movement just before the enemy + break; + } + } else { + _max_movement = i - 1; // Cap movement if out of bounds + break; + } + } - var _target_x = location[0] + _movement_delta; - var _target_y = location[1]; + // Step 2: Try to move as far as allowed (from max_movement down to 1) + for (var _movement_distance = _max_movement; _movement_distance >= 1; _movement_distance--) { + var _movement_delta = _movement_direction * _movement_distance; + var _target_x = _current_x + _movement_delta; + var _target_y = _current_y; if (obj_ncombat.battlefield_grid.move_squad(_target_x, _target_y, self)) { exit;