diff --git a/ChapterMaster.yyp b/ChapterMaster.yyp index fc43a26f14..4e7047dfb3 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",}, @@ -114,9 +115,13 @@ ], "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",}, {"$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",}, @@ -592,7 +597,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",},}, @@ -614,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",},}, @@ -789,11 +792,13 @@ {"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",},}, {"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",},}, @@ -840,12 +845,15 @@ {"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_mechanicus_missions","path":"scripts/scr_mechanicus_missions/scr_mechanicus_missions.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",},}, {"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_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",},}, @@ -858,6 +866,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",},}, @@ -901,7 +910,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",},}, @@ -910,6 +918,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",},}, @@ -927,7 +936,6 @@ {"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","path":"scripts/scr_weapon/scr_weapon.yy",},}, @@ -1642,6 +1650,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",},}, @@ -1660,6 +1669,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/datafiles/data/army_profiles.jsonc b/datafiles/data/army_profiles.jsonc new file mode 100644 index 0000000000..a009a76750 --- /dev/null +++ b/datafiles/data/army_profiles.jsonc @@ -0,0 +1,56 @@ +{ + "orks_6": { + "display_name": "Huge Ork Army", + "description": "A huge army of green gigachads.", + "squads": [ + { + "name": "deff_dread", + "count": 12 + }, + { + "name": "battlewagon", + "count": 90 + }, + { + "name": "mekboy", + "count": 6 + }, + { + "name": "warboss", + "count": 1 + }, + { + "name": "gretchin", + "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 + } + ] + } +} \ No newline at end of file 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 new file mode 100644 index 0000000000..044a692b2b --- /dev/null +++ b/datafiles/data/squad_profiles.jsonc @@ -0,0 +1,172 @@ +{ + "flash_gitz": { + "display_name": "Flash Gitz", + "combat_role": "fire_support", + "keywords": [ + "INFANTRY" + ], + "units": { + "flash_git": { + "count": 9 + }, + "kaptin": { + "count": 1 + } + } + }, + "kommandos": { + "display_name": "Kommandos", + "combat_role": "command", + "keywords": [ + "INFANTRY" + ], + "units": { + "kommando": { + "count": 14 + }, + "boss_nob": { + "count": 1 + } + } + }, + "slugga_boyz": { + "display_name": "Slugga Boyz", + "combat_role": "battleline", + "keywords": [ + "INFANTRY" + ], + "units": { + "slugga_boy": { + "count": 29 + }, + "boss_nob": { + "count": 1 + } + } + }, + "shoota_boyz": { + "display_name": "Shoota Boyz", + "combat_role": "battleline", + "keywords": [ + "INFANTRY" + ], + "units": { + "shoota_boy": { + "count": 29 + }, + "boss_nob": { + "count": 1 + } + } + }, + "ard_boyz": { + "display_name": "Ard Boyz", + "combat_role": "assault", + "keywords": [ + "INFANTRY" + ], + "units": { + "ard_boy": { + "count": 29 + }, + "boss_nob": { + "count": 1 + } + } + }, + "gretchin": { + "display_name": "Gretchin", + "combat_role": "assault", + "keywords": [ + "INFANTRY" + ], + "units": { + "gretchin": { + "count": 30 + }, + "runtherd": { + "count": 3 + } + } + }, + "tankbustas": { + "display_name": "Tankbustas", + "combat_role": "anti_armour", + "keywords": [ + "INFANTRY" + ], + "units": { + "tankbusta": { + "count": 14 + }, + "boss_nob": { + "count": 1 + } + } + }, + "meganobz": { + "display_name": "Meganobz", + "combat_role": "assault", + "keywords": [ + "INFANTRY" + ], + "units": { + "meganob": { + "count": 9 + }, + "boss_meganob": { + "count": 1 + } + } + }, + "warboss": { + "display_name": "Warboss", + "combat_role": "command", + "keywords": [ + "INFANTRY", + "CHARACTER" + ], + "units": { + "warboss": { + "count": 1 + } + } + }, + "deff_dread": { + "display_name": "Deff Dread", + "combat_role": "assault", + "keywords": [ + "VEHICLE" + ], + "units": { + "deff_dread": { + "count": 1 + } + } + }, + "battlewagon": { + "display_name": "Battlewagon", + "combat_role": "transport", + "keywords": [ + "VEHICLE" + ], + "units": { + "battlewagon": { + "count": 1 + } + } + }, + "mekboy": { + "display_name": "Mekboy", + "combat_role": "command", + "keywords": [ + "INFANTRY", + "CHARACTER" + ], + "units": { + "mekboy": { + "count": 1 + } + } + } +} \ 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..8453c203f7 --- /dev/null +++ b/datafiles/data/unit_profiles.jsonc @@ -0,0 +1,1981 @@ +{ + "malcadon_spyrer": { + "display_name": "Malcadon Spyrer", + "armour": 35, + "health_points": 200, + "resistance": 1, + "weapons": [ + "Web Spinner", + "Venom Claws" + ], + "unit_type": 0, + "size": 1 + }, + "greater_daemon_of_khorne": { + "display_name": "Greater Daemon of Khorne", + "armour": 12, + "health_points": 700, + "resistance": 0.5, + "weapons": [ + "Khorne Demon Melee" + ], + "unit_type": 1, + "size": 3 + }, + "greater_daemon_of_slaanesh": { + "display_name": "Greater Daemon of Slaanesh", + "armour": 10, + "health_points": 500, + "resistance": 0.25, + "weapons": [ + "Demon Melee", + "Lash Whip" + ], + "unit_type": 1, + "size": 3 + }, + "greater_daemon_of_nurgle": { + "display_name": "Greater Daemon of Nurgle", + "armour": 8, + "health_points": 900, + "resistance": 0.6, + "weapons": [ + "Demon Melee", + "Nurgle Vomit" + ], + "unit_type": 1, + "size": 3 + }, + "greater_daemon_of_tzeentch": { + "display_name": "Greater Daemon of Tzeentch", + "armour": 10, + "health_points": 600, + "resistance": 0.75, + "weapons": [ + "Demon Melee", + "Witchfire" + ], + "unit_type": 1, + "size": 3 + }, + "bloodletter": { + "display_name": "Bloodletter", + "armour": 10, + "health_points": 200, + "resistance": 0.4, + "weapons": [ + "Bloodletter Melee" + ], + "unit_type": 0, + "size": 1 + }, + "daemonette": { + "display_name": "Daemonette", + "armour": 8, + "health_points": 150, + "resistance": 0.3, + "weapons": [ + "Daemonette Melee" + ], + "unit_type": 0, + "size": 1 + }, + "pink_horror": { + "display_name": "Pink Horror", + "armour": 8, + "health_points": 100, + "resistance": 0.5, + "weapons": [ + "Eldritch Fire" + ], + "unit_type": 0, + "size": 1 + }, + "plaguebearer": { + "display_name": "Plaguebearer", + "armour": 5, + "health_points": 300, + "resistance": 0.4, + "weapons": [ + "Plaguebearer Melee" + ], + "unit_type": 0, + "size": 1 + }, + "helbrute": { + "display_name": "Helbrute", + "armour": 40, + "health_points": 300, + "resistance": 0.5, + "weapons": [ + "Power Fist", + "Multi-Melta" + ], + "unit_type": 0, + "size": 10 + }, + "soul_grinder": { + "display_name": "Soul Grinder", + "armour": 30, + "health_points": 350, + "resistance": 0.5, + "weapons": [ + "Warpsword", + "Iron Claw", + "Battle Cannon" + ], + "unit_type": 0, + "size": 10 + }, + "maulerfiend": { + "display_name": "Maulerfiend", + "armour": 30, + "health_points": 250, + "resistance": 0.5, + "weapons": [ + "Maulerfiend Claws" + ], + "unit_type": 0, + "size": 10 + }, + "imperial_guardsman": { + "display_name": "Imperial Guardsman", + "armour": 40, + "health_points": 5, + "resistance": 1, + "weapons": [], + "unit_type": 0, + "size": 1 + }, + "heavy_weapons_team": { + "display_name": "Heavy Weapons Team", + "armour": 10, + "health_points": 100, + "resistance": 0.9, + "weapons": [ + "Heavy Bolter" + ], + "unit_type": 0, + "size": 1 + }, + "ogryn": { + "display_name": "Ogryn", + "armour": 10, + "health_points": 120, + "resistance": 0.75, + "weapons": [ + "Ripper Gun", + "Ogryn Melee" + ], + "unit_type": 0, + "size": 1 + }, + "chimera": { + "display_name": "Chimera", + "armour": 40, + "health_points": 200, + "resistance": 0.75, + "weapons": [ + "Multi-Laster", + "Heavy Bolter" + ], + "unit_type": 0, + "size": 10 + }, + "basilisk": { + "display_name": "Basilisk", + "armour": 20, + "health_points": 150, + "resistance": 1, + "weapons": [ + "Earthshaker Cannon", + "Storm Bolter" + ], + "unit_type": 0, + "size": 10 + }, + "leman_russ_battle_tank": { + "display_name": "Leman Russ Battle Tank", + "armour": 45, + "health_points": 250, + "resistance": 0.25, + "weapons": [ + "Battle Cannon", + "Lascannon" + ], + "unit_type": 0, + "size": 10 + }, + "leman_russ_demolisher": { + "display_name": "Leman Russ Demolisher", + "armour": 40, + "health_points": 250, + "resistance": 0.25, + "weapons": [ + "Demolisher Cannon", + "Lascannon" + ], + "unit_type": 0, + "size": 10 + }, + "vendetta": { + "display_name": "Vendetta", + "armour": 20, + "health_points": 300, + "resistance": 0.25, + "weapons": [ + "Twin-Linked Lascannon", + "Twin-Linked Lascannon", + "Twin-Linked Lascannon" + ], + "unit_type": 0, + "size": 10 + }, + "thallax": { + "display_name": "Thallax", + "armour": 30, + "health_points": 80, + "resistance": 1, + "weapons": [ + "Lightning Gun", + "Thallax Melee" + ], + "unit_type": 0, + "size": 1 + }, + "praetorian_servitor": { + "display_name": "Praetorian Servitor", + "armour": 25, + "health_points": 150, + "resistance": 1, + "weapons": [ + "Phased Plasma-fusil" + ], + "unit_type": 0, + "size": 1 + }, + "adeptas_leader": { + "display_name": "Adeptas Leader", + "armour": 10, + "health_points": 200, + "resistance": 0.25, + "weapons": [ + "Blessed Weapon", + "Laser Mace", + "Infernus Pistol" + ], + "unit_type": 0, + "size": 1 + }, + "palatine": { + "display_name": "Palatine", + "armour": 10, + "health_points": 100, + "resistance": 0.5, + "weapons": [ + "Plasma Pistol", + "Power Weapon" + ], + "unit_type": 0, + "size": 1 + }, + "priest": { + "display_name": "Priest", + "armour": 0, + "health_points": 50, + "resistance": 0.5, + "weapons": [ + "Laspistol" + ], + "unit_type": 0, + "size": 1 + }, + "arco_flagellent": { + "display_name": "Arco-Flagellent", + "armour": 0, + "health_points": 150, + "resistance": 0.7, + "weapons": [ + "Electro-Flail" + ], + "unit_type": 0, + "size": 1 + }, + "celestian": { + "display_name": "Celestian", + "armour": 10, + "health_points": 60, + "resistance": 0.5, + "weapons": [ + "Bolter", + "Chainsword" + ], + "unit_type": 0, + "size": 1 + }, + "mistress": { + "display_name": "Mistress", + "armour": 10, + "health_points": 60, + "resistance": 0.5, + "weapons": [ + "Neural Whip" + ], + "unit_type": 0, + "size": 1 + }, + "sister_repentia": { + "display_name": "Sister Repentia", + "armour": 0, + "health_points": 75, + "resistance": 0.75, + "weapons": [ + "Eviscerator" + ], + "unit_type": 0, + "size": 1 + }, + "battle_sister": { + "display_name": "Battle Sister", + "armour": 10, + "health_points": 60, + "resistance": 0.75, + "weapons": [ + "Bolter", + "Flamer", + "Sarissa" + ], + "unit_type": 0, + "size": 1 + }, + "seraphim": { + "display_name": "Seraphim", + "armour": 10, + "health_points": 60, + "resistance": 0.6, + "weapons": [ + "Seraphim Pistols", + "Chainsword" + ], + "unit_type": 0, + "size": 1 + }, + "dominion": { + "display_name": "Dominion", + "armour": 10, + "health_points": 60, + "resistance": 0.75, + "weapons": [ + "Meltagun", + "Meltabomb" + ], + "unit_type": 0, + "size": 1 + }, + "retributor": { + "display_name": "Retributor", + "armour": 10, + "health_points": 60, + "resistance": 0.6, + "weapons": [ + "Heavy Bolter", + "Missile Launcher", + "Bolt Pistol" + ], + "unit_type": 0, + "size": 1 + }, + "follower": { + "display_name": "Follower", + "armour": 0, + "health_points": 30, + "resistance": 1, + "weapons": [ + "Laspistol", + "melee0.5" + ], + "unit_type": 0, + "size": 1 + }, + "adeptas_rhino": { + "display_name": "Adeptas Rhino", + "armour": 40, + "health_points": 200, + "resistance": 0.75, + "weapons": [ + "Storm Bolter", + "Storm Bolter" + ], + "unit_type": 0, + "size": 10 + }, + "adeptas_chimera": { + "display_name": "Adeptas Chimera", + "armour": 40, + "health_points": 200, + "resistance": 0.75, + "weapons": [ + "Heavy Flamer", + "Heavy Flamer" + ], + "unit_type": 0, + "size": 10 + }, + "immolator": { + "display_name": "Immolator", + "armour": 40, + "health_points": 300, + "resistance": 0.35, + "weapons": [ + "Twin Linked Heavy Flamers" + ], + "unit_type": 0, + "size": 10 + }, + "exorcist": { + "display_name": "Exorcist", + "armour": 40, + "health_points": 200, + "resistance": 0.55, + "weapons": [ + "Exorcist Missile Launcher", + "Storm Bolter" + ], + "unit_type": 0, + "size": 10 + }, + "penitent_engine": { + "display_name": "Penitent Engine", + "armour": 35, + "health_points": 150, + "resistance": 0.5, + "weapons": [ + "Close Combat Weapon", + "Close Combat Weapon", + "Heavy Flamer" + ], + "unit_type": 0, + "size": 10 + }, + "eldar_leader": { + "display_name": "Eldar Leader", + "armour": 10, + "health_points": 150, + "resistance": 0.5, + "weapons": [ + "Singing Spear", + "Singing Spear Throw" + ], + "unit_type": 0, + "size": 1 + }, + "autarch": { + "display_name": "Autarch", + "armour": 12, + "health_points": 150, + "resistance": 0.75, + "weapons": [ + "Power Weapon", + "Fusion Gun" + ], + "unit_type": 0, + "size": 1 + }, + "farseer": { + "display_name": "Farseer", + "armour": 10, + "health_points": 120, + "resistance": 0.6, + "weapons": [ + "Singing Spear", + "Singing Spear Throw" + ], + "unit_type": 0, + "size": 1, + "abilities": [ + "farseer_powers" + ] + }, + "warlock": { + "display_name": "Warlock", + "armour": 10, + "health_points": 80, + "resistance": 0.75, + "weapons": [ + "Witchblade", + "Psyshock" + ], + "unit_type": 0, + "size": 1 + }, + "avatar": { + "display_name": "Avatar", + "armour": 40, + "health_points": 300, + "resistance": 0.55, + "weapons": [ + "Wailing Doom", + "Avatar Smite" + ], + "unit_type": 0, + "size": 10 + }, + "mighty_avatar": { + "display_name": "Mighty Avatar", + "armour": 50, + "health_points": 450, + "resistance": 0.5, + "weapons": [ + "Wailing Doom", + "Avatar Smite" + ], + "unit_type": 0, + "size": 10 + }, + "godly_avatar": { + "display_name": "Godly Avatar", + "armour": 60, + "health_points": 600, + "resistance": 0.4, + "weapons": [ + "Wailing Doom", + "Avatar Smite" + ], + "unit_type": 0, + "size": 10 + }, + "ranger": { + "display_name": "Ranger", + "armour": 8, + "health_points": 40, + "resistance": 0.9, + "weapons": [ + "Ranger Long Rifle", + "Shuriken Pistol" + ], + "unit_type": 0, + "size": 1 + }, + "eldar_pathfinder": { + "display_name": "Eldar Pathfinder", + "armour": 8, + "health_points": 60, + "resistance": 0.8, + "weapons": [ + "Pathfinder Long Rifle", + "Melee1" + ], + "unit_type": 0, + "size": 1 + }, + "dire_avenger": { + "display_name": "Dire Avenger", + "armour": 10, + "health_points": 40, + "resistance": 1, + "weapons": [ + "Avenger Shuriken Catapult", + "Melee1" + ], + "unit_type": 0, + "size": 1, + "abilities": [ + "shimmershield" + ] + }, + "dire_avenger_exarch": { + "display_name": "Dire Avenger Exarch", + "armour": 10, + "health_points": 70, + "resistance": 1, + "weapons": [ + "Power Weapon" + ], + "unit_type": 0, + "size": 1, + "abilities": [ + "shimmershield" + ] + }, + "howling_banshee": { + "display_name": "Howling Banshee", + "armour": 8, + "health_points": 40, + "resistance": 0.8, + "weapons": [ + "Power Weapon", + "Shuriken Pistol" + ], + "unit_type": 0, + "size": 1, + "abilities": [ + "banshee_mask" + ] + }, + "howling_banshee_exarch": { + "display_name": "Howling Banshee Exarch", + "armour": 10, + "health_points": 60, + "resistance": 0.75, + "weapons": [ + "Executioner" + ], + "unit_type": 0, + "size": 1, + "abilities": [ + "banshee_mask" + ] + }, + "striking_scorpion": { + "display_name": "Striking Scorpion", + "armour": 8, + "health_points": 60, + "resistance": 1, + "weapons": [ + "Scorpion Chainsword", + "Shuriken Pistol", + "Mandiblaster" + ], + "unit_type": 0, + "size": 1 + }, + "striking_scorpion_exarch": { + "display_name": "Striking Scorpion Exarch", + "armour": 10, + "health_points": 80, + "resistance": 1, + "weapons": [ + "Biting Blade", + "Scorpion's Claw", + "Mandiblaster" + ], + "unit_type": 0, + "size": 1 + }, + "fire_dragon": { + "display_name": "Fire Dragon", + "armour": 12, + "health_points": 40, + "resistance": 1, + "weapons": [ + "Fusion Gun", + "Meltabomb", + "Melee1" + ], + "unit_type": 0, + "size": 1 + }, + "fire_dragon_exarch": { + "display_name": "Fire Dragon Exarch", + "armour": 12, + "health_points": 60, + "resistance": 1, + "weapons": [ + "Firepike", + "Power Weapon" + ], + "unit_type": 0, + "size": 1 + }, + "warp_spider": { + "display_name": "Warp Spider", + "armour": 8, + "health_points": 40, + "resistance": 0.9, + "weapons": [ + "Deathspinner" + ], + "unit_type": 0, + "size": 1, + "abilities": [ + "warp_jump" + ] + }, + "warp_spider_exarch": { + "display_name": "Warp Spider Exarch", + "armour": 10, + "health_points": 60, + "resistance": 0.8, + "weapons": [ + "Dual Deathspinners", + "Powerblades" + ], + "unit_type": 0, + "size": 1, + "abilities": [ + "warp_jump" + ] + }, + "dark_reaper": { + "display_name": "Dark Reaper", + "armour": 10, + "health_points": 40, + "resistance": 1, + "weapons": [ + "Reaper Launcher", + "Melee1" + ], + "unit_type": 0, + "size": 1 + }, + "dark_reaper_exarch": { + "display_name": "Dark Reaper Exarch", + "armour": 10, + "health_points": 50, + "resistance": 1, + "weapons": [ + "Tempest Launcher", + "Melee1" + ], + "unit_type": 0, + "size": 1 + }, + "shining_spear": { + "display_name": "Shining Spear", + "armour": 10, + "health_points": 75, + "resistance": 0.8, + "weapons": [ + "Laser Lance", + "Twin Linked Shuriken Catapult" + ], + "unit_type": 0, + "size": 10 + }, + "guardian": { + "display_name": "Guardian", + "armour": 8, + "health_points": 30, + "resistance": 1, + "weapons": [ + "Shuriken Catapult", + "Melee1" + ], + "unit_type": 0, + "size": 1 + }, + "grav_platform": { + "display_name": "Grav Platform", + "armour": 10, + "health_points": 60, + "resistance": 1, + "weapons": [ + "Pulse Laser" + ], + "unit_type": 0, + "size": 10 + }, + "trouper": { + "display_name": "Trouper", + "armour": 8, + "health_points": 50, + "resistance": 0.25, + "weapons": [ + "Power Weapon", + "Fusion Pistol" + ], + "unit_type": 0, + "size": 1 + }, + "athair": { + "display_name": "Athair", + "armour": 8, + "health_points": 75, + "resistance": 0.25, + "weapons": [ + "Plasma Pistol", + "Harlequin's Kiss" + ], + "unit_type": 0, + "size": 1 + }, + "wraithguard": { + "display_name": "Wraithguard", + "armour": 15, + "health_points": 125, + "resistance": 0.7, + "weapons": [ + "Wraithcannon" + ], + "unit_type": 0, + "size": 1 + }, + "vyper": { + "display_name": "Vyper", + "armour": 40, + "health_points": 100, + "resistance": 0.8, + "weapons": [ + "Twin Linked Shuriken Catapult", + "Pulse Laser" + ], + "unit_type": 0, + "size": 10 + }, + "falcon": { + "display_name": "Falcon", + "armour": 40, + "health_points": 200, + "resistance": 0.6, + "weapons": [ + "Pulse Laser", + "Shuriken Cannon", + "Bright Lance" + ], + "unit_type": 0, + "size": 10 + }, + "fire_prism": { + "display_name": "Fire Prism", + "armour": 40, + "health_points": 200, + "resistance": 0.5, + "weapons": [ + "Twin Linked Shuriken Catapult", + "Prism Cannon" + ], + "unit_type": 0, + "size": 10 + }, + "nightspinner": { + "display_name": "Nightspinner", + "armour": 40, + "health_points": 200, + "resistance": 0.6, + "weapons": [ + "Twin Linked Doomweaver" + ], + "unit_type": 0, + "size": 10 + }, + "wraithlord": { + "display_name": "Wraithlord", + "armour": 40, + "health_points": 200, + "resistance": 0.5, + "weapons": [ + "Two Power Fists", + "Flamer", + "Starcannon" + ], + "unit_type": 0, + "size": 10 + }, + "phantom_titan": { + "display_name": "Phantom Titan", + "armour": 50, + "health_points": 800, + "resistance": 0.35, + "weapons": [ + "Two Power Fists", + "Phantom Pulsar", + "Titan Starcannon" + ], + "unit_type": 0, + "size": 10 + }, + "warboss": { + "display_name": "Warboss", + "armour": 12, + "health_points": 200, + "resistance": 0.75, + "weapons": [ + "Twin-Linked Shoota", + "Power Klaw" + ], + "unit_type": 1, + "size": 2, + "movement": 6 + }, + "gretchin": { + "display_name": "Gretchin", + "armour": 0, + "health_points": 15, + "resistance": 1, + "weapons": [ + "Grot Blasta" + ], + "unit_type": 1, + "size": 0.5, + "movement": 6 + }, + "slugga_boy": { + "display_name": "Slugga Boy", + "armour": 5, + "health_points": 60, + "resistance": 1, + "weapons": [ + "Choppa", + "Slugga" + ], + "unit_type": 0, + "size": 1, + "movement": 6 + }, + "shoota_boy": { + "display_name": "Shoota Boy", + "armour": 5, + "health_points": 60, + "resistance": 1, + "weapons": [ + "Choppa", + "Shoota" + ], + "unit_type": 0, + "size": 1, + "movement": 6 + }, + "mekboy": { + "display_name": "Mekboy", + "armour": 12, + "health_points": 100, + "resistance": 0.75, + "weapons": [ + "Choppa", + "Slugga" + ], + "unit_type": 0, + "size": 1, + "movement": 6 + }, + "runtherd": { + "display_name": "Runtherd", + "armour": 5, + "health_points": 60, + "resistance": 1, + "weapons": [ + "Choppa", + "Slugga" + ], + "unit_type": 3, + "size": 1, + "movement": 6 + }, + "nob": { + "display_name": "Nob", + "armour": 5, + "health_points": 150, + "resistance": 1, + "weapons": [ + "Power Klaw", + "Big Shoota" + ], + "unit_type": 0, + "size": 1, + "movement": 6 + }, + "boss_nob": { + "display_name": "Boss Nob", + "armour": 7, + "health_points": 200, + "resistance": 1, + "weapons": [ + "Big Choppa", + "Twin-Linked Shoota" + ], + "unit_type": 3, + "size": 2, + "movement": 6 + }, + "meganob": { + "display_name": "Meganob", + "armour": 12, + "health_points": 150, + "resistance": 0.6, + "weapons": [ + "Twin-Linked Shoota", + "Power Klaw" + ], + "unit_type": 1, + "size": 2, + "movement": 5 + }, + "boss_meganob": { + "display_name": "Boss Meganob", + "armour": 12, + "health_points": 150, + "resistance": 0.6, + "weapons": [ + "Twin-Linked Shoota", + "Power Klaw" + ], + "unit_type": 3, + "size": 2, + "movement": 5 + }, + "flash_git": { + "display_name": "Flash Git", + "armour": 8, + "health_points": 100, + "resistance": 1, + "weapons": [ + "Snazzgun" + ], + "unit_type": 0, + "size": 1, + "movement": 6 + }, + "kaptin": { + "display_name": "Kaptin", + "armour": 8, + "health_points": 100, + "resistance": 1, + "weapons": [ + "Snazzgun" + ], + "unit_type": 3, + "size": 1, + "movement": 6 + }, + "cybork": { + "display_name": "Cybork", + "armour": 8, + "health_points": 125, + "resistance": 0.75, + "weapons": [ + "Power Klaw", + "Big Shoota" + ], + "unit_type": 0, + "size": 1, + "movement": 6 + }, + "ard_boy": { + "display_name": "Ard Boy", + "armour": 8, + "health_points": 80, + "resistance": 0.9, + "weapons": [ + "Choppa", + "Slugga" + ], + "unit_type": 0, + "size": 1, + "movement": 6 + }, + "kommando": { + "display_name": "Kommando", + "armour": 10, + "health_points": 125, + "resistance": 0.9, + "weapons": [ + "Choppa", + "Slugga" + ], + "unit_type": 0, + "size": 1, + "movement": 6 + }, + "burna_boy": { + "display_name": "Burna Boy", + "armour": 5, + "health_points": 80, + "resistance": 1, + "weapons": [ + "Choppa", + "Burna" + ], + "unit_type": 0, + "size": 1, + "movement": 6 + }, + "tankbusta": { + "display_name": "Tankbusta", + "armour": 5, + "health_points": 80, + "resistance": 1, + "weapons": [ + "Rokkit Launcha", + "Tankbusta Bomb" + ], + "unit_type": 0, + "size": 1, + "movement": 6 + }, + "stormboy": { + "display_name": "Stormboy", + "armour": 5, + "health_points": 80, + "resistance": 1, + "weapons": [ + "Choppa", + "Slugga" + ], + "abilities": [ + "jump" + ], + "unit_type": 1, + "size": 2, + "movement": 12 + }, + "battlewagon": { + "display_name": "Battlewagon", + "armour": 80, + "health_points": 800, + "resistance": 1, + "weapons": [ + "Kannon", + "Big Shoota", + "Big Shoota", + "Rokkit Launcha", + "Rokkit Launcha" + ], + "unit_type": 0, + "size": 10, + "movement": 10 + }, + "deff_dread": { + "display_name": "Deff Dread", + "armour": 60, + "health_points": 500, + "resistance": 1, + "weapons": [ + "Big Shoota", + "Big Shoota", + "Power Klaw", + "Power Klaw" + ], + "unit_type": 0, + "size": 10, + "movement": 8 + }, + "xv8_commander": { + "display_name": "XV8 Commander", + "armour": 12, + "health_points": 300, + "resistance": 0.5, + "weapons": [ + "Plasma Rifle", + "Fusion Blaster", + "Cyclic Ion Blaster" + ], + "unit_type": 0, + "size": 1 + }, + "xv8_bodyguard": { + "display_name": "XV8 Bodyguard", + "armour": 10, + "health_points": 200, + "resistance": 0.75, + "weapons": [ + "Plasma Rifle", + "Burst Rifle" + ], + "unit_type": 0, + "size": 1 + }, + "xv8_crisis": { + "display_name": "XV8 Crisis", + "armour": 10, + "health_points": 150, + "resistance": 0.75, + "weapons": [ + "Plasma Rifle", + "Missile Pod" + ], + "unit_type": 0, + "size": 1 + }, + "xv8_(brightknife)": { + "display_name": "XV8 (Brightknife)", + "armour": 10, + "health_points": 150, + "resistance": 0.75, + "weapons": [ + "Fusion Blaster", + "Fusion Blaster" + ], + "unit_type": 0, + "size": 1 + }, + "shield_drone": { + "display_name": "Shield Drone", + "armour": 8, + "health_points": 50, + "resistance": 1, + "weapons": [], + "unit_type": 0, + "size": 1 + }, + "xv88_broadside": { + "display_name": "XV88 Broadside", + "armour": 12, + "health_points": 225, + "resistance": 0.75, + "weapons": [ + "Smart Missile System", + "Small Railgun" + ], + "unit_type": 0, + "size": 1 + }, + "xv25_stealthsuit": { + "display_name": "XV25 Stealthsuit", + "armour": 8, + "health_points": 50, + "resistance": 0.75, + "weapons": [ + "Burst Rifle" + ], + "unit_type": 0, + "size": 1 + }, + "fire_warrior": { + "display_name": "Fire Warrior", + "armour": 8, + "health_points": 30, + "resistance": 1, + "weapons": [ + "Pulse Rifle" + ], + "unit_type": 0, + "size": 1 + }, + "tau_pathfinder": { + "display_name": "Tau Pathfinder", + "armour": 8, + "health_points": 30, + "resistance": 1, + "weapons": [ + "Rail Rifle" + ], + "unit_type": 0, + "size": 1 + }, + "kroot": { + "display_name": "Kroot", + "armour": 5, + "health_points": 30, + "resistance": 1, + "weapons": [ + "Kroot Rifle", + "Melee2" + ], + "unit_type": 0, + "size": 1 + }, + "vespid": { + "display_name": "Vespid", + "armour": 5, + "health_points": 50, + "resistance": 1, + "weapons": [ + "Vespid Crystal", + "Melee2" + ], + "unit_type": 0, + "size": 1 + }, + "devilfish": { + "display_name": "Devilfish", + "armour": 30, + "health_points": 150, + "resistance": 0.75, + "weapons": [ + "Smart Missile System" + ], + "unit_type": 0, + "size": 10 + }, + "hammerhead": { + "display_name": "Hammerhead", + "armour": 30, + "health_points": 150, + "resistance": 0.75, + "weapons": [ + "Railgun", + "Smart Missile System" + ], + "unit_type": 0, + "size": 10 + }, + "hive_tyrant": { + "display_name": "Hive Tyrant", + "armour": 20, + "health_points": 400, + "resistance": 0.5, + "weapons": [ + "Bonesword", + "Lashwhip", + "Heavy Venom Cannon" + ], + "unit_type": 0, + "size": 1 + }, + "tyrant_guard": { + "display_name": "Tyrant Guard", + "armour": 12, + "health_points": 200, + "resistance": 0.6, + "weapons": [ + "Crushing Claws" + ], + "unit_type": 0, + "size": 1 + }, + "tyranid_warrior": { + "display_name": "Tyranid Warrior", + "armour": 8, + "health_points": 100, + "resistance": 0.9, + "weapons": [ + "Rending Claws", + "Devourer" + ], + "unit_type": 0, + "size": 1 + }, + "zoanthrope": { + "display_name": "Zoanthrope", + "armour": 8, + "health_points": 300, + "resistance": 0.25, + "weapons": [ + "Zoanthrope Blast" + ], + "unit_type": 0, + "size": 1 + }, + "carnifex": { + "display_name": "Carnifex", + "armour": 20, + "health_points": 300, + "resistance": 0.75, + "weapons": [ + "Carnifex Claws", + "Venom Cannon" + ], + "unit_type": 0, + "size": 10 + }, + "termagaunt": { + "display_name": "Termagaunt", + "armour": 5, + "health_points": 25, + "resistance": 1, + "weapons": [ + "Fleshborer" + ], + "unit_type": 0, + "size": 1 + }, + "hormagaunt": { + "display_name": "Hormagaunt", + "armour": 5, + "health_points": 25, + "resistance": 1, + "weapons": [ + "Scything Talons" + ], + "unit_type": 0, + "size": 1 + }, + "cultist": { + "display_name": "Cultist", + "armour": 0, + "health_points": 35, + "resistance": 1, + "weapons": [ + "Autogun", + "melee0.5" + ], + "unit_type": 0, + "size": 1 + }, + "genestealer": { + "display_name": "Genestealer", + "armour": 5, + "health_points": 75, + "resistance": 1, + "weapons": [ + "Genestealer Claws" + ], + "unit_type": 0, + "size": 1 + }, + "genestealer_patriarch": { + "display_name": "Genestealer Patriarch", + "armour": 8, + "health_points": 300, + "resistance": 0.6, + "weapons": [ + "Genestealer Claws", + "Witchfire" + ], + "unit_type": 0, + "size": 1 + }, + "armoured_limousine": { + "display_name": "Armoured Limousine", + "armour": 10, + "health_points": 150, + "resistance": 0.75, + "weapons": [ + "Autogun", + "Autogun", + "Autogun", + "Autogun" + ], + "unit_type": 0, + "size": 10 + }, + "lictor": { + "display_name": "Lictor", + "armour": 8, + "health_points": 300, + "resistance": 0.6, + "weapons": [ + "Lictor Claws", + "Flesh Hooks" + ], + "unit_type": 0, + "size": 1 + }, + "chaos_leader": { + "display_name": "Chaos Leader", + "weapons": [ + "Meltagun", + "Power Fist" + ], + "armour": 30, + "health_points": 300, + "resistance": 0.75 + }, + "chaos_daemonlord": { + "display_name": "Chaos Daemonlord", + "weapons": [ + "Khorne Demon Melee" + ], + "armour": 30, + "health_points": 300, + "resistance": 0.75 + }, + "fallen": { + "display_name": "Fallen", + "weapons": [ + "Bolt Pistol", + "Power Weapon" + ], + "armour": 30, + "health_points": 120, + "resistance": 0.5 + }, + "chaos_lord": { + "display_name": "Chaos Lord", + "weapons": [ + "Plasma Pistol", + "Power Weapon" + ], + "armour": 30, + "health_points": 150, + "resistance": 0.5 + }, + "chaos_sorcerer": { + "display_name": "Chaos Sorcerer", + "weapons": [ + "Plasma Pistol", + "Force Staff" + ], + "armour": 30, + "health_points": 100, + "resistance": 0.5 + }, + "warpsmith": { + "display_name": "Warpsmith", + "weapons": [ + "Chainfist", + "Meltagun", + "Flamer" + ], + "armour": 30, + "health_points": 100, + "resistance": 0.5 + }, + "chaos_terminator": { + "display_name": "Chaos Terminator", + "weapons": [ + "Power Fist", + "Bolter", + "Combi-Flamer" + ], + "armour": 40, + "health_points": 100, + "resistance": 0.5 + }, + "venerable_chaos_terminator": { + "display_name": "Venerable Chaos Terminator", + "weapons": [ + "Power Fist", + "Bolter", + "Combi-Flamer" + ], + "armour": 40, + "health_points": 120, + "resistance": 0.4 + }, + "world_eaters_terminator": { + "display_name": "World Eaters Terminator", + "weapons": [ + "Power Fist", + "Meltagun" + ], + "armour": 40, + "health_points": 120, + "resistance": 0.4 + }, + "obliterator": { + "display_name": "Obliterator", + "weapons": [ + "Power Fist", + "Obliterator Weapon" + ], + "armour": 40, + "health_points": 200, + "resistance": 0.5 + }, + "chaos_chosen": { + "display_name": "Chaos Chosen", + "weapons": [ + "Meltagun", + "Chainsword" + ], + "armour": 20, + "health_points": 125, + "resistance": 0.85 + }, + "venerable_chaos_chosen": { + "display_name": "Venerable Chaos Chosen", + "weapons": [ + "Meltagun", + "Chainsword" + ], + "armour": 20, + "health_points": 125, + "resistance": 0.75 + }, + "possessed": { + "display_name": "Possessed", + "weapons": [ + "Possessed Claws" + ], + "armour": 17, + "health_points": 150, + "resistance": 0.5 + }, + "chaos_space_marine": { + "display_name": "Chaos Space Marine", + "weapons": [ + "Bolter", + "Chainsword" + ], + "armour": 20, + "health_points": 100, + "resistance": 0.9 + }, + "havoc": { + "display_name": "Havoc", + "weapons": [ + "Missile Launcher", + "Melee1" + ], + "armour": 20, + "health_points": 100, + "resistance": 0.9 + }, + "raptor": { + "display_name": "Raptor", + "weapons": [ + "Chainsword", + "Bolt Pistol" + ], + "armour": 20, + "health_points": 100, + "resistance": 0.75, + "abilities": ["jump"] + }, + "world_eater": { + "display_name": "World Eater", + "weapons": [ + "Bolter", + "Chainaxe" + ], + "armour": 20, + "health_points": 100, + "resistance": 0.75 + }, + "world_eaters_veteran": { + "display_name": "World Eaters Veteran", + "weapons": [ + "Combi-Flamer", + "Chainaxe" + ], + "armour": 20, + "health_points": 100, + "resistance": 0.7 + }, + "khorne_berzerker": { + "display_name": "Khorne Berzerker", + "weapons": [ + "Chainaxe", + "Bolt Pistol" + ], + "armour": 20, + "health_points": 100, + "resistance": 0.65 + }, + "plague_marine": { + "display_name": "Plague Marine", + "weapons": [ + "Bolter", + "Poison Chainsword" + ], + "armour": 20, + "health_points": 150, + "resistance": 0.5 + }, + "noise_marine": { + "display_name": "Noise Marine", + "weapons": [ + "Sonic Blaster", + "Melee1" + ], + "armour": 20, + "health_points": 100, + "resistance": 0.75 + }, + "rubric_marine": { + "display_name": "Rubric Marine", + "weapons": [ + "Rubric Bolter", + "Melee1" + ], + "armour": 20, + "health_points": 125, + "resistance": 0.65 + }, + "rubric_sorcerer": { + "display_name": "Rubric Sorcerer", + "weapons": [ + "Witchfire", + "Force Staff" + ], + "armour": 20, + "health_points": 150, + "resistance": 0.5 + }, + "chaos_cultist": { + "display_name": "Chaos Cultist", + "weapons": [ + "Autogun", + "melee0.5" + ], + "armour": 5, + "health_points": 35 + }, + "hellbrute": { + "display_name": "Hellbrute", + "weapons": [ + "Power Fist", + "Meltagun" + ], + "armour": 40, + "health_points": 300, + "resistance": 0.5, + "unit_type": 0, + "size": 10 + }, + "rhino": { + "display_name": "Rhino", + "weapons": [ + "Storm Bolter" + ], + "armour": 40, + "health_points": 200, + "resistance": 0.75, + "unit_type": 0, + "size": 10 + }, + "predator": { + "display_name": "Predator", + "weapons": [ + "Lascannon", + "Twin Linked Lascannon" + ], + "armour": 45, + "health_points": 350, + "resistance": 0.5, + "unit_type": 0, + "size": 10 + }, + "vindicator": { + "display_name": "Vindicator", + "weapons": [ + "Demolisher Cannon", + "Havoc Launcher" + ], + "armour": 45, + "health_points": 300, + "resistance": 0.5, + "unit_type": 0, + "size": 10 + }, + "land_raider": { + "display_name": "Land Raider", + "weapons": [ + "Twin Linked Heavy Bolters", + "Twin Linked Lascannon" + ], + "armour": 50, + "health_points": 400, + "resistance": 0.25, + "unit_type": 0, + "size": 10 + }, + "heldrake": { + "display_name": "Heldrake", + "weapons": [ + "Baleflame" + ], + "armour": 50, + "health_points": 400, + "resistance": 0.25, + "unit_type": 0, + "size": 10 + }, + "defiler": { + "display_name": "Defiler", + "weapons": [ + "Defiler Claws", + "Battle Cannon", + "Reaper Autocannon", + "Flamer" + ], + "armour": 40, + "health_points": 300, + "resistance": 0.5, + "unit_type": 0, + "size": 10 + }, + "arch_heretic": { + "display_name": "Arch Heretic", + "weapons": [ + "Power Weapon", + "Plasma Pistol" + ], + "armour": 8, + "health_points": 40, + "resistance": 0.75 + }, + "cultist_elite": { + "display_name": "Cultist Elite", + "weapons": [ + "Lasgun", + "Chainaxe" + ], + "armour": 8, + "health_points": 40, + "resistance": 0.9 + }, + "mutant": { + "display_name": "Mutant", + "weapons": [ + "Flesh Hooks" + ], + "armour": 0, + "health_points": 30 + }, + "daemonhost": { + "display_name": "Daemonhost", + "weapons": [ + "Daemonhost Claws", + "Daemonhost_Powers" + ], + "armour": 8, + "health_points": 300, + "resistance": 0.5 + }, + "possessed_alt": { + "display_name": "Possessed Alt", + "weapons": [ + "Possessed Claws" + ], + "armour": 8, + "health_points": 100, + "resistance": 0.75 + }, + "technical": { + "display_name": "Technical", + "weapons": [ + "Autogun", + "Heavy Bolter" + ], + "armour": 10, + "health_points": 100, + "resistance": 0.75, + "unit_type": 0, + "size": 10 + }, + "chaos_leman_russ": { + "display_name": "Chaos Leman Russ", + "weapons": [ + "Battle Cannon", + "Heavy Bolter" + ], + "armour": 45, + "health_points": 250, + "resistance": 0.25, + "unit_type": 0, + "size": 10 + }, + "chaos_basilisk": { + "display_name": "Chaos Basilisk", + "weapons": [ + "Earthshaker Cannon", + "Heavy Bolter" + ], + "armour": 20, + "health_points": 150, + "unit_type": 0, + "size": 10 + }, + "necron_overlord": { + "display_name": "Necron Overlord", + "weapons": [ + "Staff of Light", + "Staff of Light Shooting" + ], + "armour": 12, + "health_points": 300, + "resistance": 0.5, + "unit_type": 0, + "size": 1 + }, + "lychguard": { + "display_name": "Lychguard", + "weapons": [ + "Warscythe" + ], + "armour": 12, + "health_points": 100, + "resistance": 0.75, + "unit_type": 0, + "size": 1 + }, + "flayed_one": { + "display_name": "Flayed One", + "weapons": [ + "Melee5" + ], + "armour": 8, + "health_points": 75, + "resistance": 0.9, + "unit_type": 0, + "size": 1 + }, + "necron_warrior": { + "display_name": "Necron Warrior", + "weapons": [ + "Gauss Flayer", + "Melee3" + ], + "armour": 8, + "health_points": 75, + "resistance": 0.9, + "unit_type": 0, + "size": 1 + }, + "necron_immortal": { + "display_name": "Necron Immortal", + "weapons": [ + "Gauss Blaster", + "Melee3" + ], + "armour": 8, + "health_points": 75, + "resistance": 0.85, + "unit_type": 0, + "size": 1 + }, + "necron_wraith": { + "display_name": "Necron Wraith", + "weapons": [ + "Wraith Claws" + ], + "armour": 10, + "health_points": 200, + "resistance": 0.75, + "unit_type": 0, + "size": 1 + }, + "necron_destroyer": { + "display_name": "Necron Destroyer", + "weapons": [ + "Gauss Cannon", + "Melee3" + ], + "armour": 25, + "health_points": 175, + "resistance": 0.5, + "unit_type": 0, + "size": 1 + }, + "tomb_stalker": { + "display_name": "Tomb Stalker", + "weapons": [ + "Gauss Particle Cannon", + "Overcharged Gauss Cannon", + "Claws" + ], + "armour": 40, + "health_points": 600, + "resistance": 0.5, + "unit_type": 0, + "size": 10 + }, + "canoptek_spyder": { + "display_name": "Canoptek Spyder", + "weapons": [ + "Claws" + ], + "armour": 30, + "health_points": 300, + "resistance": 0.75, + "unit_type": 0, + "size": 10 + }, + "canoptek_scarab": { + "display_name": "Canoptek Scarab", + "weapons": [ + "Melee3" + ], + "armour": 8, + "health_points": 30, + "resistance": 0.75, + "unit_type": 0, + "size": 1 + }, + "necron_monolith": { + "display_name": "Necron Monolith", + "weapons": [ + "Gauss Flux Arc", + "Particle Whip" + ], + "armour": 50, + "health_points": 500, + "resistance": 0.25, + "unit_type": 0, + "size": 10 + }, + "doomsday_arc": { + "display_name": "Doomsday Arc", + "weapons": [ + "Gauss Flayer Array", + "Doomsday Cannon" + ], + "armour": 40, + "health_points": 350, + "resistance": 0.5, + "unit_type": 0, + "size": 10 + } +} \ No newline at end of file diff --git a/datafiles/main/chapters/8.JSON b/datafiles/main/chapters/8.JSON index f873483ba1..405741b694 100644 --- a/datafiles/main/chapters/8.JSON +++ b/datafiles/main/chapters/8.JSON @@ -225,7 +225,7 @@ "custom_roles": { "veteran": { "name": "Firedrake", - "wep1": "Power Sword" + "wep2": "Power Sword" }, "veteran_sergeant": { "name": "Firedrake Master" 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_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_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_controller/Step_0.gml b/objects/obj_controller/Step_0.gml index bb7c9ac2ed..fc371b8415 100644 --- a/objects/obj_controller/Step_0.gml +++ b/objects/obj_controller/Step_0.gml @@ -575,7 +575,7 @@ try { temp[130] += $"{name}: {dr}%\n"; } } - temp[130] += string("CON: {0}%\nEXP: {1}%", round(unit.constitution / 2), round(unit.experience / 10)); + temp[130] += $"CON: {round(unit.constitution / 2)}%"; if (is_struct(temp[121])) { try { temp[121].destroy_image(); diff --git a/objects/obj_enunit/Alarm_0.gml b/objects/obj_enunit/Alarm_0.gml deleted file mode 100644 index 07e44329f8..0000000000 --- a/objects/obj_enunit/Alarm_0.gml +++ /dev/null @@ -1,397 +0,0 @@ -//* This alarm is responsible for the enemy target column selection; - -if (!instance_exists(obj_pnunit)) { - exit; -} - -enemy = flank ? get_leftmost() : get_rightmost(); -if (enemy == "none") { - exit; -} - -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); -// show_debug_message($"enemy is in melee {engaged}") - -if (!engaged){ // Shooting - for (var i=0;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; - - // 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){ - 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;u1) 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; - } - } - } - - // 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]}"); - 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; - } - } - - // 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; - } - } - } - } - } 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]}"); - 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) and target_block_is_valid( enemy,obj_pnunit)){// Melee - engaged=1; - var i=0,dist=999,no_ap=1; - // dist=point_distance(x,y,enemy.x,enemy.y)/10; - 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"); - 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) and (target_block_is_valid(enemy)){// 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 - } - } - - } - - } - - - // 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; -//! 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); -} */ diff --git a/objects/obj_enunit/Alarm_1.gml b/objects/obj_enunit/Alarm_1.gml deleted file mode 100644 index c9e59fd214..0000000000 --- a/objects/obj_enunit/Alarm_1.gml +++ /dev/null @@ -1,1696 +0,0 @@ -var i, g; -i = 0; -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] = ""; - - // 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; - -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; - dudes_defense[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_defense[j] = dudes_defense[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; - -/*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; - if (obj_ncombat.started = 0) { - 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 = 0) or(neww = 1)) or(dudes_num[j] > 1) { - if (dudes[j] = "Greater Daemon of Khorne") { - dudes_ac[j] = 18; - dudes_hp[j] = 600; - } - } - 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 = 0) or(neww = 1)) or(dudes_num[j] > 1) { - if (dudes[j] = "Greater Daemon of Slaanesh") { - dudes_ac[j] = 18; - dudes_hp[j] = 500; - } - } - 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; - 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; - } - } - 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 = 0) or(neww = 1)) or(dudes_num[j] > 1) { - if (dudes[j] = "Greater Daemon of Tzeentch") { - dudes_ac[j] = 18; - dudes_hp[j] = 500; - } - } - 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; - medi += dudes_num[j]; - } - - if (dudes[j] = "Bloodletter") { - scr_en_weapon("Bloodletter Melee", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 15; - dudes_hp[j] = 120; - men += dudes_num[j]; - dudes_dr[j] = 0.7; - } - if (dudes[j] = "Daemonette") { - scr_en_weapon("Daemonette Melee", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 15; - dudes_hp[j] = 100; - men += dudes_num[j]; - dudes_dr[j] = 0.7; - } - 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; - men += dudes_num[j]; - dudes_dr[j] = 0.8; - } - if (dudes[j] = "Plaguebearer") { - scr_en_weapon("Plaguebearer Melee", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 15; - dudes_hp[j] = 145; - men += dudes_num[j]; - dudes_dr[j] = 0.6; - } - - 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; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - dudes_dr[j] = 0.75; - } - 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] = 1; - } - if (dudes[j] = "Maulerfiend") { - scr_en_weapon("Maulerfiend Claws", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 250; - veh += dudes_num[j]; - dudes_vehicle[j] = 1; - dudes_dr[j] = 1; - } - -} -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; - repeat(100) { - i += 1; - att[i] = 0; - apa[i] = 0; - wep_num[i] = 0; - wep_rnum[i] = 0; - } - i = 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] != obj_ini.role[100][eROLE.ChapterMaster])) 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("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] != obj_ini.role[100][eROLE.ChapterMaster])) 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("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 (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); - - exit; - - /* */ -} -__b__ = action_if_variable(obj_ncombat.enemy, 2, 0); -if __b__ { - - repeat(20) { - j += 1; - if (dudes[j] = "Imperial Guardsman") { - dudes_ac[j] = 20; - dudes_hp[j] = 20; - 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_hp[j] = 100; - 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_hp[j] = 120; - 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; - 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_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] = 40; - dudes_hp[j] = 250; - 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; - 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; - 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] = 35; - if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { - dudes_hp[j] = 200; - } - men += dudes_num[j]; - dudes_dr[j] = 0.33; - } - 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_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] = 30; - 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.65; - } - - 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; - men += dudes_num[j]; - dudes_dr[j] = 0.65; - } - if (dudes[j] = "Mistress") { - scr_en_weapon("Neural Whip", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 40; - men += dudes_num[j]; - dudes_dr[j] = 0.75; - } - if (dudes[j] = "Sister Repentia") { - scr_en_weapon("Eviscerator", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 30; - 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] = 20; - dudes_hp[j] = 40; - men += dudes_num[j]; - dudes_dr[j] = 0.8; - } - 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; - men += dudes_num[j]; - dudes_dr[j] = 0.75; - } - 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; - 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] = 20; - dudes_hp[j] = 40; - men += dudes_num[j]; - dudes_dr[j] = 0.75; - } - - 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; - 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_hp[j] = 200; - 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_hp[j] = 200; - 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; - 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; - if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { - dudes_hp[j] = 300; - } - 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; - 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 (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); - } - - /* */ -} -__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] = 30; - dudes_hp[j] = 300; - 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] = 20; - dudes_hp[j] = 150; - 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; - 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; - 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; - 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_hp[j] = 450; - 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_hp[j] = 600; - 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; - 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_hp[j] = 60; - 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; - 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 - 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; - 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; - 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; - 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; - 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; - 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; - 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; - 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; - 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; - 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("Melee1", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 30; - 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]; - } - 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_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; - 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_hp[j] = 50; - 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_hp[j] = 75; - 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; - 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; - 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; - 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; - 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; - 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("Star Cannon", false, dudes_num[j], dudes[j], j); - dudes_ac[j] = 40; - dudes_hp[j] = 200; - 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; - 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] = 60; - if (obj_ncombat.started = 0) 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] = 40; - if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { - dudes_hp[j] = 150; - } - 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; - if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { - dudes_hp[j] = 200; - } - 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; - if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { - dudes_hp[j] = 300; - } - veh += 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] = 10; - dudes_hp[j] = 50; - 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; - 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; - 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; - 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; - 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; - 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; - 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; - 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; - 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; - 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_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] = 40; - dudes_hp[j] = 200; - 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] = 35; - dudes_hp[j] = 150; - 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] = 30; - dudes_hp[j] = 150; - medi += dudes_num[j]; - dudes_vehicle[j] = 1; - } - 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; - } - 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; - } - 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; - } - if (dudes[j] = "Shield Drone") { - dudes_ac[j] = 30; - dudes_hp[j] = 100; - medi += dudes_num[j]; - dudes_vehicle[j] = 1; - } - - 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; - } - if (dudes[j] = "XV25 Stealthsuit") { - scr_en_weapon("Burst Rifle", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 20; - dudes_hp[j] = 50; - 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; - 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; - 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] = 10; - 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; - 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; - 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] = 35; - dudes_hp[j] = 250; - 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; - 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_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; - } - 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_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] = 0; - dudes_hp[j] = 20; - 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; - 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] = 20; - 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; - 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_dr[j] = 0.75; - 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; - 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; - men += dudes_num[j]; - } - - dudes_dr[j] += 0.25; - } - - /* */ -} -__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] = 40; - if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { - dudes_hp[j] = 300; - } - men += dudes_num[j]; - dudes_dr[j] = 0.5; - } - 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; - if (obj_ncombat.started = 0) or(dudes_num[j] > 1) { - dudes_hp[j] = 300; - } - men += dudes_num[j]; - dudes_dr[j] = 0.4; - } - - 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_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; - 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_hp[j] = 100; - 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; - 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.7; - } - 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.6; - } - 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.6; - } - 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_hp[j] = 200; - 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_hp[j] = 125; - 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; - 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; - 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; - 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_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; - 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; - 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; - 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; - 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; - 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_hp[j] = 125; - 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_hp[j] = 150; - 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; - 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] = 200; - dudes_dr[j] = 0.75; - 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] = 20; - dudes_hp[j] = 200; - 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_hp[j] = 300; - 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_hp[j] = 300; - 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_hp[j] = 400; - 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_hp[j] = 400; - 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; - 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] = 20; - dudes_hp[j] = 30; - dudes_dr[j] = 0.7; - 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; - 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] = 30; - 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_hp[j] = 100; - 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; - 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] = 40; - dudes_hp[j] = 250; - 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 = 0) or(dudes_num[j] > 1) { - dudes_ac[j] = 25; - dudes_hp[j] = 300; - } - men += dudes_num[j]; - } - if (dudes[j] = "Lychguard") { - scr_en_weapon("Warscythe", true, dudes_num[j], dudes[j], j); - dudes_ac[j] = 35; - dudes_hp[j] = 100; - 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_hp[j] = 100; - 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_hp[j] = 100; - 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_hp[j] = 100; - 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_hp[j] = 200; - } - men += dudes_num[j]; - dudes_dr[j] = 0.65; - } - 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; - 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 = 0) or(dudes_num[j] > 1) { - dudes_ac[j] = 30; - dudes_hp[j] = 600; - } - 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 = 0) or(dudes_num[j] > 1) { - dudes_ac[j] = 30; - dudes_hp[j] = 300; - } - 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_hp[j] = 30; - 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; - 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; - 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(); - 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; - -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 deleted file mode 100644 index 3b33e338eb..0000000000 --- a/objects/obj_enunit/Create_0.gml +++ /dev/null @@ -1,94 +0,0 @@ - -unit=""; -men=0; -veh=0; -dreads=0; -medi=0; -owner = eFACTION.Imperium; -engaged=0; -hostile_splash=0; -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); -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; -} - - -enemy=0; -enemy2=0; - - - -avg_attack=1; -avg_ranged=1; -avg_defense=1; -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[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]=""; -} - -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.fadein <= 0; -}; diff --git a/objects/obj_enunit/Draw_0.gml b/objects/obj_enunit/Draw_0.gml deleted file mode 100644 index 6522f1979d..0000000000 --- a/objects/obj_enunit/Draw_0.gml +++ /dev/null @@ -1,68 +0,0 @@ -draw_size = min(400, column_size); - -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); - y1 = 450 - (draw_size / 2); - x2 = pos + (centerline_offset * 2) + 10; - y2 = 450 + (draw_size / 2); - - if (hit()) { - 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); - } - } - - draw_block_composition(x1, composition_string); - } - - draw_block_fadein(); -} 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 deleted file mode 100644 index d6b979d297..0000000000 --- a/objects/obj_enunit/obj_enunit.yy +++ /dev/null @@ -1,48 +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":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",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":87,"eventType":9,"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_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/Alarm_0.gml b/objects/obj_ncombat/Alarm_0.gml deleted file mode 100644 index e9eb6c9766..0000000000 --- a/objects/obj_ncombat/Alarm_0.gml +++ /dev/null @@ -1,3108 +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) { - 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; - 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"; - 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 + 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; - instance_deactivate_object(u); - - u = instance_nearest(xxx + 40, 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; - } -} - -// ** 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_hp_multiplier[i] = 1; - } - - 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_3.gml b/objects/obj_ncombat/Alarm_3.gml deleted file mode 100644 index 960ade494f..0000000000 --- a/objects/obj_ncombat/Alarm_3.gml +++ /dev/null @@ -1,184 +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("^",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 deleted file mode 100644 index 0674c4cb17..0000000000 --- a/objects/obj_ncombat/Alarm_5.gml +++ /dev/null @@ -1,922 +0,0 @@ - -// Final Screen -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)); - - -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_chapter(1, 100, "high"); - if (_dice_roll >= _survival_roll) && (_column_id.veh_dead[_vehicle_id] != 2) { - _column_id.veh_hp[_vehicle_id] = roll_dice_chapter(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_chapter(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."; - 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)} disabled during battle."; - 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=roll_dice_chapter(1, 100, "low"), - 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(); - - // 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=roll_dice_chapter(1, 100, "high"); - 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 (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=roll_dice_chapter(1, 100, "high"); - 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=roll_dice_chapter(1, 100, "high"); - 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_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_7.gml b/objects/obj_ncombat/Alarm_7.gml deleted file mode 100644 index 8caf6ca151..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], obj_ini.role[100][eROLE.ChapterMaster]); - 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]==obj_ini.role[100][eROLE.ChapterMaster]) 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,"necron")){ - 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);} - - var star = star_by_name(obj_temp8.loc) - var planet = obj_temp8.wid - // show_message(you.name); - - // show_message("TEMP5: "+string(instance_number(obj_temp5))+"#Star: "+string(you)); - - var ppp;ppp=0; - remove_planet_problem(planet, "necron", star); - seal_tomb_world(star.p_feature[planet]); - - - pip.option1="";pip.option2="";pip.option3=""; - scr_event_log("","Inquisition Mission Completed: Your Astartes have sealed the Necron Tomb on "+string(star.name)+" "+string(scr_roman(planet))+"."); - scr_gov_disp(star.name,planet,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=roll_dice_chapter(1, 100, "high"); - - 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/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 dca5c78274..0a7a96b511 100644 --- a/objects/obj_ncombat/Create_0.gml +++ b/objects/obj_ncombat/Create_0.gml @@ -1,294 +1,394 @@ -if (instance_number(obj_ncombat)>1) then instance_destroy(); +#macro BATTLELOG_MAX_PER_TURN 40 + +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 -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; +player_formation = 0; +enemy_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); + +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; + +player_forces = 0; +player_max = 0; +player_defenses = 0; +player_silos = 0; + +enemy_forces = 0; +enemy_max = 0; +hulk_forces = 0; + +messages_shown = 0; + +units_lost_counts = {}; +vehicles_lost_counts = {}; -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 _messages_size = 70; +lines = array_create(_messages_size, ""); +lines_color = array_create(_messages_size, COL_GREEN); +message = array_create(_messages_size, ""); +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); + +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; +world_size = 0; + +turn_phase = eBATTLE_TURN_PHASE.Movement; + +// + +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; } -instance_create(0,0,obj_centerline); - -local_forces=0; -battle_loc=""; -battle_climate=""; -battle_id=0; -battle_object=0; -battle_special=""; -defeat=0; -defeat_message=0; -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; -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=0; -charged=0; - -fadein=40; -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; - -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; +// Disadvantage-based modifiers +if (scr_has_disadv("Shitty Luck")) { + global_defense *= 0.9; +} -units_lost_counts = {}; -vehicles_lost_counts = {}; +// 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; + +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 = ""; + + if (turn_phase == eBATTLE_TURN_PHASE.Movement) { + 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 (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); + } +} + +/// @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); +} + +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); + +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) + } + }); +}; -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; +update_squads_array = function () { + all_squads = array_concat(player_force.squads, enemy_force.squads); } -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; -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; - - -// - -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; +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/Draw_0.gml b/objects/obj_ncombat/Draw_0.gml index 092eef46b4..ad4b10000b 100644 --- a/objects/obj_ncombat/Draw_0.gml +++ b/objects/obj_ncombat/Draw_0.gml @@ -1,83 +1,3 @@ - -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(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); -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_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")); -} - -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") 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 (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 (started=3) or (started=5){ - draw_set_halign(fa_center); - draw_text(400,860,string_hash_to_newline("[Press Enter to Exit]")); - } -} - - - -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_color(c_black); -draw_set_alpha(fadein/30); -draw_rectangle(0,0,1600,900,0); -draw_set_alpha(1); - +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 new file mode 100644 index 0000000000..d35a674c17 --- /dev/null +++ b/objects/obj_ncombat/Draw_64.gml @@ -0,0 +1,41 @@ +message_log.draw(); + +draw_set_font(fnt_40k_14); +if ((display_p1 > 0) && (player_forces > 0)) { + draw_set_color(COL_YELLOW); + draw_set_halign(fa_left); + draw_text(64, 880, string(display_p1n) + ": " + string(display_p1) + "HP"); +} +if ((display_p2 > 0) && (enemy_forces > 0)) { + draw_set_color(COL_YELLOW); + draw_set_halign(fa_right); + draw_text(800 - 64, 880, string(display_p2n) + ": " + string(display_p2) + "HP"); +} + +draw_set_halign(fa_left); +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_YELLOW); +var _turn_text = ""; +if (battle_stage == eBATTLE_STAGE.Main) { + _turn_text = "[Press Enter to Begin]"; +} else if (battle_stage == eBATTLE_STAGE.PlayerWinEnd || battle_stage == eBATTLE_STAGE.EnemyWinEnd) { + _turn_text = "[Press Enter to Exit]"; +} else if (turn_phase == eBATTLE_TURN_PHASE.Movement) { + _turn_text = "[Press Enter to Continue]"; +} + +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/KeyPress_13.gml b/objects/obj_ncombat/KeyPress_13.gml deleted file mode 100644 index f91f63f383..0000000000 --- a/objects/obj_ncombat/KeyPress_13.gml +++ /dev/null @@ -1,173 +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; -} - -function reset_combat_message_arrays(){ - for (var i=0;i0) 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; - } - if (instance_exists(obj_pnunit)){ - obj_pnunit.alarm[3]=2; - obj_pnunit.alarm[1]=3; - turn_count++; - obj_pnunit.alarm[0]=4; - } - // 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)){ - obj_pnunit.alarm[1]=1; - turn_count++; - } - } - messages=0;messages_to_show = 24;largest=0;random_messages=0;priority=0;messages_shown=0; - reset_combat_message_arrays(); - timer_stage=2;timer=0;done=0;messages_shown=0; -} - - - -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)){ - obj_pnunit.alarm[1]=1; - 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; - } - var messages=0;messages_to_show = 24;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; - } - if (instance_exists(obj_enunit)){ - obj_enunit.alarm[1]=1; - } - // alarm[9]=5; - var i;i=0;messages=0;messages_to_show = 24;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_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..ef0ab8e2f3 100644 --- a/objects/obj_ncombat/Step_0.gml +++ b/objects/obj_ncombat/Step_0.gml @@ -1,114 +1,99 @@ +if (fading_strength > 0) { + fading_strength -= 0.05; +} -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 (wall_destroyed == true) { + wall_destroyed = false; +} +if (battle_stage == eBATTLE_STAGE.Creation) { + if (DEBUG_COMBAT_PERFORMANCE) { + stopwatch("BATTLE_STAGE.Creation"); + } + + enemy_force.name = "orks_6"; + enemy_force.copy_profile(); + enemy_force.spawn_squads(); + player_force.name = "orks_6"; + player_force.copy_profile(); + player_force.spawn_squads(); -if (!instance_exists(obj_enunit)){ - enemy_forces=0; -} -if (!instance_exists(obj_pnunit)){ - player_forces=0; + battle_stage = eBATTLE_STAGE.Main; + + if (DEBUG_COMBAT_PERFORMANCE) { + stopwatch("BATTLE_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("Move Phase"); + } + + turn_count++; + // global_perils -= 1; + queue_battlelog_message($"Turn {turn_count}", COL_YELLOW); + display_message_queue(); -if (fack=1) then instance_activate_object(obj_pnunit); -instance_activate_object(obj_centerline); -instance_activate_object(obj_cursor); - + update_squads_array(); -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); - } - 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(); - } - } - } + squads_move(); - } - 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); - } - } - 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); - } - } - 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);} - } - 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);} + turn_phase = eBATTLE_TURN_PHASE.Attack; + + if (DEBUG_COMBAT_PERFORMANCE) { + stopwatch("Move Phase"); } - messages_shown=105; - done=1; - scr_newtext(); - timer_stage=5;exit; } - exit; -} - + if (turn_phase == eBATTLE_TURN_PHASE.Attack) { + squads_attack(); + turn_phase = eBATTLE_TURN_PHASE.Morale; + } + if (turn_phase == eBATTLE_TURN_PHASE.Morale) { + turn_phase = eBATTLE_TURN_PHASE.Movement; + } + if ((battle_stage == eBATTLE_STAGE.PlayerWinStart) || (battle_stage == eBATTLE_STAGE.EnemyWinStart)) { + battle_stage = eBATTLE_STAGE.PlayerWinEnd; + var _quad_factor = 10; + total_battle_exp_gain = _quad_factor * sqr(threat); + instance_activate_object(obj_star); + instance_activate_object(obj_event_log); + ncombat_battle_end(); -// 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;} + newline = "------------------------------------------------------------------------------"; + scr_newtext(); + newline = "------------------------------------------------------------------------------"; + scr_newtext(); } - - 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 (battle_stage == eBATTLE_STAGE.PlayerWinEnd) { + instance_activate_all(); + instance_destroy(obj_popup); + instance_destroy(obj_star_select); + with (obj_pnunit) { + pnunit_dying_process(); + } + + ncombat_special_end(); } - - if (timer_stage!=4) then fugg2=0; - - - +} +function resolve_battle_state() { + if (enemy_forces <= 0) { + battle_ended = true; + battle_stage = eBATTLE_STAGE.PlayerWinStart; + } else if (player_forces <= 0) { + battle_ended = true; + battle_stage = eBATTLE_STAGE.EnemyWinStart; + defeat = 1; + } +} diff --git a/objects/obj_ncombat/obj_ncombat.yy b/objects/obj_ncombat/obj_ncombat.yy index b2326e3fee..441dfd441f 100644 --- a/objects/obj_ncombat/obj_ncombat.yy +++ b/objects/obj_ncombat/obj_ncombat.yy @@ -3,19 +3,11 @@ "%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",}, {"$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",}, {"$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_p_assra/Step_0.gml b/objects/obj_p_assra/Step_0.gml index 8175b49f48..9adadc463c 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/objects/obj_pnunit/Alarm_0.gml b/objects/obj_pnunit/Alarm_0.gml deleted file mode 100644 index 293a1c15b1..0000000000 --- a/objects/obj_pnunit/Alarm_0.gml +++ /dev/null @@ -1,233 +0,0 @@ -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; - 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; - - var once_only;once_only=0; - var range_shoot=""; - var dist=point_distance(x,y,enemy.x,enemy.y)/10; - - //* Psychic power 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)){ - for (var i=0;i=dist) and (ammo[i]!=0 || range[i]==1){ - if (range[i]!=1) and (engaged=0) then range_shoot="ranged"; - if ((range[i]!=floor(range[i]) || floor(range[i])=1) && engaged=1) then range_shoot="melee"; - } - - if (range_shoot="ranged") and (range[i]>=dist){// Weapon meets preliminary checks - 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 (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 (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 (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 - } - - 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 (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); - - 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); - } - } - } -} 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/Alarm_1.gml b/objects/obj_pnunit/Alarm_1.gml deleted file mode 100644 index e8853cc623..0000000000 --- a/objects/obj_pnunit/Alarm_1.gml +++ /dev/null @@ -1,7 +0,0 @@ - - -/* */ -/* */ -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/objects/obj_pnunit/Alarm_3.gml b/objects/obj_pnunit/Alarm_3.gml deleted file mode 100644 index aca70efbea..0000000000 --- a/objects/obj_pnunit/Alarm_3.gml +++ /dev/null @@ -1,119 +0,0 @@ -try { - - if (obj_ncombat.started=0){ - 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]!=obj_ini.role[100][eROLE.ChapterMaster]) 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"; - obj_ncombat.timer_pause=2; - with(obj_ncombat){ - scr_newtext(); - } - } - } - } - - - - if (obj_ncombat.started>=1){ - - // 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... - - 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 e68c39ab8c..0000000000 --- a/objects/obj_pnunit/Alarm_6.gml +++ /dev/null @@ -1,53 +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) and (veh_type[i]!="") and (veh_ally[i]=false){obj_ini.veh_hp[veh_co[i],veh_id[i]]=veh_hp[i]/veh_hp_multiplier[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 9a02730af4..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); @@ -67,49 +66,35 @@ 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_hp_multiplier[i]=1; - 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); + +weapon_stacks_normal = {}; +weapon_stacks_vehicle = {}; +weapon_stacks_unique = {}; + +var _dudes_size = 72; +dudes = array_create(_dudes_size, ""); +dudes_num = array_create(_dudes_size, 0); +dudes_vehicle = array_create(_dudes_size, 0); -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; - ammo[i]=-1; - splash[i]=0; - wep_owner[i]=""; - wep_solo[i]=[]; - wep_title[i]=""; - - dudes[i]=""; - dudes_num[i]=0; - dudes_vehicle[i]=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; @@ -119,10 +104,6 @@ hostile_unit=""; hostile_type=0; hostile_splash=0; -alarm[1]=4; - -action_set_alarm(1, 3); - -hit = function() { - return scr_hit(x1, y1, x2, y2) && obj_ncombat.fadein <= 0; +is_mouse_over = function() { + return scr_hit(x1, y1, x2, y2) && obj_ncombat.fading_strength == 0; }; 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/Draw_0.gml b/objects/obj_pnunit/Draw_64.gml similarity index 68% rename from objects/obj_pnunit/Draw_0.gml rename to objects/obj_pnunit/Draw_64.gml index 124debc521..0bf3b4d1d3 100644 --- a/objects/obj_pnunit/Draw_0.gml +++ b/objects/obj_pnunit/Draw_64.gml @@ -1,32 +1,27 @@ -draw_size = min(400, column_size); +draw_size = column_size; 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 (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/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/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/objects/obj_pnunit/obj_pnunit.yy b/objects/obj_pnunit/obj_pnunit.yy index 89cc44022f..f383cdbeb5 100644 --- a/objects/obj_pnunit/obj_pnunit.yy +++ b/objects/obj_pnunit/obj_pnunit.yy @@ -3,17 +3,11 @@ "%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",}, - {"$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",}, {"$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..af5b8f2887 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); @@ -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 17621f119c..6d918a3024 100644 --- a/objects/obj_popup/Destroy_0.gml +++ b/objects/obj_popup/Destroy_0.gml @@ -18,13 +18,13 @@ 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"; scr_battle_allies(); setup_battle_formations(); - roster.add_to_battle(); + // roster.add_to_battle(); } } @@ -99,9 +99,7 @@ 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); exit; } diff --git a/objects/obj_popup/Mouse_50.gml b/objects/obj_popup/Mouse_50.gml index 876c23571e..5c5480eb6b 100644 --- a/objects/obj_popup/Mouse_50.gml +++ b/objects/obj_popup/Mouse_50.gml @@ -322,7 +322,7 @@ if (scr_hit(xx+1465, yy+499,xx+1576,yy+518)){// Promoting right here 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 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_after_combat/scr_after_combat.gml b/scripts/scr_after_combat/scr_after_combat.gml index 9cc6cc1f4d..431baa75a9 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_ancient_ruins/scr_ancient_ruins.gml b/scripts/scr_ancient_ruins/scr_ancient_ruins.gml index a381ff7b30..3fc10a3cdf 100644 --- a/scripts/scr_ancient_ruins/scr_ancient_ruins.gml +++ b/scripts/scr_ancient_ruins/scr_ancient_ruins.gml @@ -40,11 +40,10 @@ 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); - instance_destroy(obj_enunit); instance_activate_all(); scr_ruins_reward(_star,_planet,self); } @@ -61,7 +60,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 688a5b848b..6d91822218 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){ @@ -138,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 = ""; @@ -146,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); } @@ -266,3 +266,30 @@ function is_basic_array(_array, _max_depth = 1, _current_depth = 1) { return true; } + +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_civil_roster/scr_civil_roster.gml b/scripts/scr_civil_roster/scr_civil_roster.gml index b01a68ede9..fb0106f2bf 100644 --- a/scripts/scr_civil_roster/scr_civil_roster.gml +++ b/scripts/scr_civil_roster/scr_civil_roster.gml @@ -15,8 +15,6 @@ function scr_civil_roster(_unit_location, _target_location, _is_planet) { //???=obj_drop_select; //???=obj_controller //???=obj_pnunit - //???=obj_enunit - //???=obj_centerline //-------------------------------------------------------------------------------------------------------------------- var stop,okay,sofar; @@ -24,39 +22,28 @@ 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; 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; - 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; @@ -203,7 +190,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_clean/scr_clean.gml b/scripts/scr_clean/scr_clean.gml index 9654735677..2fa5423773 100644 --- a/scripts/scr_clean/scr_clean.gml +++ b/scripts/scr_clean/scr_clean.gml @@ -1,232 +1,214 @@ -/// @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 - } - } - } -} +#macro DEBUG_ENEMY_TARGET_SELECTION false -/// @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(); - } - } -} - -/// @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 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: // 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. // 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) { if (obj_ncombat.wall_destroyed == 1) { exit; } + + var armour_pierce = weapon_data.piercing; + 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 vehicle_hits = 0; - var man_hits = 0; - var total_hits = hostile_shots; - var unit_type = ""; + 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; + } - // ### Vehicle Damage Processing ### - if (!target_is_infantry && veh > 0) { - var you = -1; + 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 = []; + var valid_marines = []; + var units_lost = 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); + // 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) { + if (unit.IsSpecialist(SPECIALISTS_DREADNOUGHTS)) { + var _temp_struct = { + index: m, + type: "dread" + }; + array_push(valid_vehicles, _temp_struct); + } else { + array_push(valid_marines, m); } } + } + valid_marines = array_shuffle(valid_marines); - // 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) { - break; - } + // 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); + + if (target_type == eUNIT_TYPE.Vehicle && array_empty(valid_vehicles)) { + target_type = eUNIT_TYPE.Infantry; + } else if (target_type = eUNIT_TYPE.Infantry && array_empty(valid_marines)) { + target_type = eUNIT_TYPE.Vehicle; + } + + for (var shot = 0; shot < hostile_shots; shot++) { + // ### Vehicle Damage Processing ### + if (target_type == eUNIT_TYPE.Vehicle && !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 random_index = array_random_index(valid_vehicles); - you = random_index; + var vehicle = valid_vehicles[random_index]; + 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++; - - 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); + if (type == "veh") { + unit_type = veh_type[vehicle_id]; + + // Apply damage + var _min_damage = obj_ncombat.enemy == 13 ? 1 : 0.25; + var _dice_sides = 50; + var _random_damage_mod = roll_dice_chapter(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); + + veh_hp[vehicle_id] -= _modified_damage; + + // Check if the vehicle is destroyed + if (veh_hp[vehicle_id] <= 0) { + veh_dead[vehicle_id] = 1; + units_lost++; + obj_ncombat.player_forces -= 1; + + // Record loss + if (struct_exists(lost_units, veh_type[vehicle_id])) { + lost_units[$ veh_type[vehicle_id]]++; + } else { + lost_units[$ veh_type[vehicle_id]] = 1; + } + + // Remove dead vehicles from further hits + array_delete(valid_vehicles, random_index, 1); } + } else { + // ### Dreadnought Processing ### + var marine = unit_struct[vehicle_id]; + unit_type = marine.role(); - // Remove dead vehicles from further hits - array_delete(valid_vehicles, you, 1); - } - // Flavor messages - scr_flavor2(units_lost, unit_type, hostile_range, hostile_weapon, vehicle_hits, hostile_splash); - } - } + // Apply damage + var _min_damage = obj_ncombat.enemy == 13 ? 1 : 0.25; + var _dice_sides = 50; + var _random_damage_mod = roll_dice_chapter(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; + + 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 = max(_min_damage, round(_modified_damage * (1 - damage_resistance))); + } + + if (_modified_damage < 0 && hostile_weapon == "Fleshborer") { + _modified_damage = 1.5; + } - // ### Marine + Dreadnought Processing ### - if (target_is_infantry && (men + dreads > 0)) { - man_hits = total_hits - vehicle_hits; + /* 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; + } */ - // 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); + marine.add_or_sub_health(-_modified_damage); + + // Check if marine is dead + if (check_dead_marines(marine, vehicle_id)) { + // Remove dead infantry from further hits + array_delete(valid_vehicles, random_index, 1); + units_lost++; + if (array_empty(valid_vehicles)) { + target_type = eUNIT_TYPE.Infantry; + continue; + } + } } } - // Apply damage for each shot - for (var shot = 0; shot < man_hits; shot++) { - if (array_length(valid_marines) == 0) { - break; // No valid targets left - } + // ### Marine Processing ### + if (target_type == eUNIT_TYPE.Infantry && !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 _shot_luck = roll_dice_chapter(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 = obj_ncombat.enemy == 13 ? 1 : 0.25; + var _dice_sides = 50; + var _random_damage_mod = roll_dice_chapter(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); if (_modified_damage > 0) { var damage_resistance = marine.damage_resistance() / 100; @@ -252,7 +234,7 @@ function scr_clean(target_object, target_is_infantry, hostile_shots, hostile_dam 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; @@ -267,23 +249,135 @@ function scr_clean(target_object, target_is_infantry, hostile_shots, hostile_dam // 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 = eUNIT_TYPE.Vehicle; + continue; + } } + } - // Flavor messages - scr_flavor2(units_lost, unit_type, hostile_range, hostile_weapon, man_hits, hostile_splash); + // ### 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); } } + +/// @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 + if (struct_exists(lost_units, marine_type[unit_index])) { + lost_units[$ marine_type[unit_index]]++; + } else { + lost_units[$ marine_type[unit_index]] = 1; + } + + 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 +/// @returns {undefined} No return value; modifies target column directly +function compress_enemy_array(_target_column) { + if (!instance_exists(_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 = [{ + arr: dudes, + def: "" + }, { + arr: dudes_num, + def: 0 + }, { + arr: dudes_ac, + def: 0 + }, { + arr: dudes_hp, + def: 0 + }, { + arr: dudes_vehicle, + 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 + } + } + } + + if (DEBUG_COMBAT_PERFORMANCE) { + stopwatch("compress_enemy_array"); + } +} + +/// @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_colors_initialize/scr_colors_initialize.gml b/scripts/scr_colors_initialize/scr_colors_initialize.gml index bbb3b30a4b..1fd2b58ef5 100644 --- a/scripts/scr_colors_initialize/scr_colors_initialize.gml +++ b/scripts/scr_colors_initialize/scr_colors_initialize.gml @@ -1,3 +1,12 @@ +#macro COL_YELLOW #e6bb3b +#macro COL_RED #bf4040 +#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 + enum Colors { White, Silver, diff --git a/scripts/scr_company_order/scr_company_order.gml b/scripts/scr_company_order/scr_company_order.gml index 81d0c70f75..e13c88737f 100644 --- a/scripts/scr_company_order/scr_company_order.gml +++ b/scripts/scr_company_order/scr_company_order.gml @@ -255,8 +255,7 @@ function scr_company_order(company) { var squad_builder = [ ["tactical_squad",_roles[eROLE.Tactical],5], ["devastator_squad",_roles[eROLE.Devastator],5], - ["sternguard_veteran_squad",_roles[eROLE.Veteran],5], - ["vanguard_veteran_squad",_roles[eROLE.Veteran],5], + ["veteran_squad",_roles[eROLE.Veteran],5], ["terminator_squad",_roles[eROLE.Terminator],4], ["terminator_assault_squad",_roles[eROLE.Terminator],4], ["assault_squad",_roles[eROLE.Assault],5], 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_drop_select_function/scr_drop_select_function.gml b/scripts/scr_drop_select_function/scr_drop_select_function.gml index e565148666..13a7b19674 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; @@ -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_en_weapon/scr_en_weapon.gml b/scripts/scr_en_weapon/scr_en_weapon.gml index dce60ac22b..e6af126ae6 100644 --- a/scripts/scr_en_weapon/scr_en_weapon.gml +++ b/scripts/scr_en_weapon/scr_en_weapon.gml @@ -1,1068 +1,953 @@ -function scr_en_weapon(name, is_man, man_number, man_type, group) { +/// @mixin +function scr_en_weapon(_weapon_name, _unit_type, _weapon_count, _unit_name) { // check if double ranged/melee // then add to that weapon //scr_infantry_weapon - // name: name - // is_man: man? //Probably used to differenciate internaly between trooper and vehicle weapons - // man_number: number - // man_type: owner - // group: current dudes block + // _weapon_name: _weapon_name + // _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 - var atta, arp, acr, rang, amm, spli, faith_bonus, i; - i = 0; - rang = 0; - atta = 0; - spli = 0; - arp = 0; - acr = 0; - amm = -1; - faith_bonus = 0; - // var struct = gear_weapon_data("weapon",name); - if (string_count("elee", name) > 0) { - var to; - to = string_delete(name, 0, 5); - atta = 10; - arp = 0; - rang = 1; - spli = 3; + 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",_weapon_name); + + /* 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 = 0; - 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 = 300; - 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 = 100; - 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") or(argument0 = "Firepike") { - atta = 200; - arp = 1; - rang = 2; - amm = 4; - } - if (argument0 = "Singing Spear") { - atta = 120; - arp = 0; - rang = 1; - spli = 3; - } - if (argument0 = "Singing Spear Throw") { - atta = 120; - arp = 1; - rang = 2; - spli = 3; - } - if (argument0 = "Witchblade") { - atta = 100; - arp = 1; - rang = 1; - } - if (argument0 = "Psyshock") { - atta = 50; - arp = 0; - rang = 2; - } - if (argument0 = "Wailing Doom") { - atta = 200; - arp = 1; - rang = 1; - spli = 3; - } - if (argument0 = "Avatar Smite") { - atta = 300; - arp = 1; - rang = 2; - amm = 2; - } - if (argument0 = "Ranger Long Rifle") { - atta = 60; - arp = 0; - rang = 25; - } - if (argument0 = "Pathfinder Long Rifle") { - atta = 70; - arp = 0; - rang = 25; - } - if (argument0 = "Shuriken Catapult") { - atta = 35; - arp = 0; - rang = 2; - } - if (argument0 = "Twin Linked Shuriken Catapult") { - atta = 50; - arp = 0; - rang = 2; - } - if (argument0 = "Avenger Shuriken Catapult") { - atta = 40; - arp = 0; - rang = 3; - } - if (argument0 = "Power Weapon") or(argument0 = "Power Blades") { - atta = 80; - arp = 0; - rang = 1; - spli = 3; - } - if (argument0 = "Shuriken Pistol") { - atta = 25; - arp = 0; - rang = 2.1; - } - if (argument0 = "Executioner") { - atta = 200; - arp = 1; - rang = 1; - } - if (argument0 = "Scorpion Chainsword") { - atta = 40; - arp = 0; - rang = 1; - spli = 3; - } - if (argument0 = "Mandiblaster") { - atta = 20; - arp = 0; - rang = 1; - } - if (argument0 = "Biting Blade") { - atta = 70; - arp = 0; - rang = 1; - spli = 3; - } - if (argument0 = "Scorpian's Claw") { - atta = 150; - arp = 1; - rang = 1; - spli = 3; - } - if (argument0 = "Meltabomb") { - atta = 0; - arp = 200; - rang = 1; - amm = 1; - } - if (argument0 = "Deathspinner") { - atta = 50; - arp = 0; - rang = 2; - } - if (argument0 = "Dual Deathspinner") { - atta = 80; - arp = 0; - rang = 2; - } - if (argument0 = "Reaper Launcher") { - atta = 150; - arp = 80; - rang = 20; - amm = 8; - spli = 3; - } - if (argument0 = "Eldar Missile Launcher") { - atta = 200; - arp = 1; - rang = 20; - amm = 4; - spli = 3; - } - if (argument0 = "Laser Lance") { - atta = 80; - arp = 0; - rang = 2; - spli = 3; - } - if (argument0 = "Fusion Pistol") { - atta = 100; - arp = 1; - rang = 1.1; - amm = 4; - } - if (argument0 = "Plasma Pistol") { - atta = 60; - arp = 1; - rang = 3.1; - } - if (argument0 = "Harlequin's Kiss") { - atta = 350; - arp = 0; - rang = 1; - amm = 1; - } - if (argument0 = "Wraithcannon") { - atta = 80; - arp = 1; - rang = 2.1; - } - if (argument0 = "Pulse Laser") { - atta = 80; - arp = 1; - rang = 15; - } - if (argument0 = "Bright Lance") { - atta = 100; - arp = 1; - rang = 8; - } - if (argument0 = "Shuriken Cannon") { - atta = 65; - arp = 0; - rang = 3; - } - if (argument0 = "Prism Cannon") { - atta = 250; - arp = 1; - rang = 20; - } - if (argument0 = "Twin Linked Doomweaver") { - atta = 100; - arp = 0; - rang = 2; - } // Also create difficult terrain? - if (argument0 = "Starcannon") { - atta = 140; - arp = 1; - rang = 3; - spli = 3; - } - if (argument0 = "Two Power Fists") { - atta = 300; - arp = 1; - rang = 1; - } - if (argument0 = "Flamer") { - atta = 100; - arp = 0; - rang = 2; - amm = 4; - spli = 3; - } - if (argument0 = "Titan Starcannon") { - atta = 220; - arp = 1; - rang = 4; - spli = 3; - } - if (argument0 = "Phantom Pulsar") { - atta = 500; - arp = 1; - rang = 20; - spli = 3; + if (_weapon_name = "Fusion Gun"){ + _attack = 180; + _piercing = 1; + _range = 2; + _ammo = 4; } - } - - if (obj_ncombat.enemy = 7) { - if (argument0 = "Choppa") { - atta = 28; - arp = 0; - rang = 1; - spli = 3; - } - if (argument0 = "Power Klaw") { - atta = 150; - arp = 1; - rang = 1; - spli = 3; - } - if (argument0 = "Slugga") { - atta = 27; - arp = 0; - rang = 3.1; - amm = 4; - spli = 3; - } - if (argument0 = "Tankbusta Bomb") { - atta = 264; - arp = 1; - rang = 1; - amm = 1; - spli = 0; - } - if (argument0 = "Big Shoota") { - atta = 100; - arp = 0; - rang = 12; - amm = 30; - spli = 0; - } - if (argument0 = "Dakkagun") { - atta = 150; - arp = 0; - rang = 10; - amm = 20; - spli = 0; - } - if (argument0 = "Deffgun") { - atta = 120; - arp = 0; - rang = 8; - amm = 20; - spli = 0; - } - if (argument0 = "Snazzgun") { - atta = 80; - arp = 0; - rang = 10; - spli = 0; - } - if (argument0 = "Grot Blasta") { - atta = 12; - arp = 0; - rang = 2; - amm = 6; - } - if (argument0 = "Kannon") { - atta = 200; - arp = 1; - rang = 10.1; - amm = 5; - spli = 3; - } - if (argument0 = "Shoota") { - atta = 30; - arp = 0; - rang = 6; - } - if (argument0 = "Burna") { - atta = 140; - arp = 1; - rang = 2; - amm = 4; - spli = 3; - } - if (argument0 = "Skorcha") { - atta = 160; - arp = 1; - rang = 2; - amm = 6; - spli = 3; - } - if (argument0 = "Rokkit Launcha") { - atta = 150; - arp = 1; - rang = 15; - spli = 3; - } - if (argument0 = "Krooz Missile") { - atta = 250; - arp = 1; - rang = 15; - spli = 3; + if (_weapon_name = "Firepike") { + _attack = 150; + _piercing = 1; + _range = 4; + _ammo = 4; + } + if (_weapon_name = "Singing Spear") { + _attack = 150; + _piercing = 0; + _range = 1; + _shot_count = 3; + } + if (_weapon_name = "Singing Spear Throw") { + _attack = 120; + _piercing = 0; + _range = 2; + _shot_count = 3; + } + if (_weapon_name = "Witchblade") { + _attack = 130; + _piercing = 0; + _range = 1; + } + if (_weapon_name = "Psyshock") { + _attack = 50; + _piercing = 0; + _range = 2; + } + if (_weapon_name = "Wailing Doom") { + _attack = 200; + _piercing = 1; + _range = 1; + _shot_count = 3; + } + if (_weapon_name = "Avatar Smite") { + _attack = 300; + _piercing = 1; + _range = 2; + _ammo = 2; + } + if (_weapon_name = "Ranger Long Rifle") { + _attack = 60; + _piercing = 0; + _range = 25; + } + if (_weapon_name = "Pathfinder Long Rifle") { + _attack = 70; + _piercing = 0; + _range = 25; + } + if (_weapon_name = "Shuriken Catapult") { + _attack = 50; + _piercing = 0; + _range = 2; + } + if (_weapon_name = "Twin Linked Shuriken Catapult") { + _attack = 100; + _piercing = 0; + _range = 2; + } + if (_weapon_name = "Avenger Shuriken Catapult") { + _attack = 90; + _piercing = 0; + _range = 3; + } + if (_weapon_name = "Power Weapon") or(_weapon_name = "Power Blades") { + _attack = 100; + _piercing = 1; + _range = 1; + _shot_count = 3; + } + if (_weapon_name = "Shuriken Pistol") { + _attack = 50; + _piercing = 0; + _range = 2.1; + } + if (_weapon_name = "Executioner") { + _attack = 150; + _piercing = 1; + _range = 1; + } + if (_weapon_name = "Scorpion Chainsword") { + _attack = 100; + _piercing = 0; + _range = 1; + _shot_count = 3; + } + if (_weapon_name = "Mandiblaster") { + _attack = 60; + _piercing = 0; + _range = 1; + } + if (_weapon_name = "Biting Blade") { + _attack = 125; + _piercing = 0; + _range = 1; + _shot_count = 3; + } + if (_weapon_name = "Scorpian's Claw") { + _attack = 150; + _piercing = 1; + _range = 1; + _shot_count = 3; + } + if (_weapon_name = "Meltabomb") { + _attack = 200; + _piercing = 1; + _range = 1; + _ammo = 1; + } + if (_weapon_name = "Deathspinner") { + _attack = 125; + _piercing = 0; + _range = 2; + } + if (_weapon_name = "Dual Deathspinner") { + _attack = 250; + _piercing = 0; + _range = 2; + } + if (_weapon_name = "Reaper Launcher") { + _attack = 120; + _piercing = 1; + _range = 20; + _ammo = 8; + _shot_count = 3; + } + if (_weapon_name = "Tempest Launcher") { + _attack = 200; + _piercing = 0; + _range = 15; + _ammo = 8; + _shot_count = 9; + } + if (_weapon_name = "Laser Lance") { + _attack = 180; + _piercing = 1; + _range = 2; + _shot_count = 3; + } + if (_weapon_name = "Fusion Pistol") { + _attack = 125; + _piercing = 1; + _range = 2.1; + _ammo = 4; + } + if (_weapon_name = "Plasma Pistol") { + _attack = 100; + _piercing = 1; + _range = 3.1; + } + if (_weapon_name = "Harlequin's Kiss") { + _attack = 250; + _piercing = 1; + _range = 1; + _ammo = 1; + } + if (_weapon_name = "Wraithcannon") { + _attack = 200; + _piercing = 1; + _range = 2.1; + } + if (_weapon_name = "Pulse Laser") { + _attack = 120; + _piercing = 0; + _range = 15; + } + if (_weapon_name = "Bright Lance") { + _attack = 200; + _piercing = 1; + _range = 8; + } + if (_weapon_name = "Shuriken Cannon") { + _attack = 160; + _piercing = 0; + _range = 3; + } + if (_weapon_name = "Prism Cannon") { + _attack = 400; + _piercing = 1; + _range = 20; + _shot_count = 1; + } + if (_weapon_name = "Twin Linked Doomweaver") { + _attack = 250; + _piercing = 1; + _range = 2; + _shot_count = 2; + } // Also create difficult terrain? + if (_weapon_name = "Starcannon") { + _attack = 250; + _piercing = 1; + _range = 8; + _shot_count = 4; + } + if (_weapon_name = "Two Power Fists") { + _attack = 300; + _piercing = 1; + _range = 1; + _shot_count = 2; + } + if (_weapon_name = "Flamer") { + _attack = 200; + _piercing = 0; + _range = 2; + _ammo = 4; + _shot_count = 3; + } + if (_weapon_name = "Titan Starcannon") { + _attack = 500; + _piercing = 1; + _range = 4; + _shot_count = 8; + } + if (_weapon_name = "Phantom Pulsar") { + _attack = 500; + _piercing = 1; + _range = 20; + _shot_count = 3; } - } if (obj_ncombat.enemy = 8) { - if (name = "Fusion Blaster") { - atta = 200; - arp = 1; - rang = 2; - amm = 4; - } - if (name = "Plasma Rifle") { - atta = 120; - arp = 1; - rang = 10; - } - if (name = "Cyclic Ion Blaster") { - atta = 180; - 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 = 160; - arp = 1; - rang = 15; - amm = 6; - spli = 3; - } - if (name = "Smart Missile System") { - atta = 150; - arp = 1; - rang = 15; - } - if (name = "Small Railgun") { - atta = 150; - arp = 1; - rang = 18; - } - if (name = "Pulse Rifle") { - atta = 37; - arp = 0; - rang = 12; - } - if (name = "Rail Rifle") { - atta = 65; - arp = 0; - rang = 14; - } - if (name = "Kroot Rifle") { - atta = 25; - arp = 0; - rang = 6; - } - if (name = "Vespid Crystal") { - atta = 60; - arp = 0; - rang = 2.1; - } - if (name = "Railgun") { - atta = 400; - 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 = 0; - rang = 1; - spli = 3; - } - if (argument0 = "Lash Whip") { - atta = 80; - arp = 0; - rang = 2; - } - if (argument0 = "Heavy Venom Cannon") { - atta = 150; - arp = 1; - rang = 8; - } - if (argument0 = "Crushing Claws") { - atta = 90; - arp = 1; - rang = 1; - spli = 3; - } - if (argument0 = "Rending Claws") { - atta = 80; - arp = 1; - rang = 1; - spli = 3; - } - if (argument0 = "Devourer") { - atta = choose(40, 60, 80, 100); - arp = 0; - rang = 5; + if (_weapon_name = "Bonesword") { + _attack = 120; + _piercing = 1; + _range = 1; + _shot_count = 3; + } + if (_weapon_name = "Lash Whip") { + _attack = 100; + _piercing = 0; + _range = 2; + } + if (_weapon_name = "Heavy Venom Cannon") { + _attack = 200; + _piercing = 1; + _range = 8; + } + if (_weapon_name = "Crushing Claws") { + _attack = 150; + _piercing = 1; + _range = 1; + _shot_count = 3; + } + if (_weapon_name = "Rending Claws") { + _attack = 80; + _piercing = 1; + _range = 1; + _shot_count = 3; + } + if (_weapon_name = "Devourer") { + _attack = 90; + _piercing = 0; + _range = 5; + _shot_count = 3 if (obj_ini.preomnor = 1) { - atta = choose(48, 72, 96, 120); + _attack = 180; } } - if (argument0 = "Zoanthrope Blast") { - atta = 200; - arp = 1; - rang = 2; - } - if (argument0 = "Carnifex Claws") { - atta = 300; - arp = 1; - rang = 1; - spli = 3; - } - if (argument0 = "Venom Cannon") { - atta = 150; - arp = 0; - rang = 5; - } - if (argument0 = "Deathspitter") { - atta = 100; - arp = 0; - rang = 2.1; + if (_weapon_name = "Zoanthrope Blast") { + _attack = 250; + _piercing = 1; + _range = 6; + _shot_count = 1; + } + if (_weapon_name = "Carnifex Claws") { + _attack = 200; + _piercing = 1; + _range = 1; + _shot_count = 3; + } + if (_weapon_name = "Venom Cannon") { + _attack = 100; + _piercing = 1; + _range = 5; + } + if (_weapon_name = "Deathspitter") { + _attack = 100; + _piercing = 0; + _range = 2.1; if (obj_ini.preomnor = 1) { - atta = 120; + _attack = 150; } } - if (argument0 = "Fleshborer") { - atta = 15; - arp = 0; - rang = 2.1; + if (_weapon_name = "Fleshborer") { + _attack = 70; + _piercing = 0; + _range = 2.1; if (obj_ini.preomnor = 1) { - atta = 19; + _attack = 19; } } - if (argument0 = "Scything Talons") { - atta = 30; - arp = 0; - rang = 1; - } - if (argument0 = "Genestealer Claws") { - atta = choose(105, 105, 130); - arp = 1; - rang = 1; - } - if (argument0 = "Witchfire") { - atta = 100; - arp = 1; - rang = 2; - } - if (argument0 = "Autogun") { - atta = 20; - arp = 0; - rang = 6; - amm = 12; - spli = 3; - } - if (argument0 = "Lictor Claws") { - atta = 300; - arp = 0; - rang = 1; - } - if (argument0 = "Flesh Hooks") { - atta = 50; - arp = 0; - rang = 2; - amm = 1; + if (_weapon_name = "Scything Talons") { + _attack = 50; + _piercing = 0; + _range = 1; + } + if (_weapon_name = "Genestealer Claws") { + _attack = 70; + _piercing = 1; + _range = 1; + } + if (_weapon_name = "Witchfire") { + _attack = 100; + _piercing = 1; + _range = 2; + } + if (_weapon_name = "Autogun") { + _attack = 60; + _piercing = 0; + _range = 6; + _ammo = 12; + _shot_count = 3; + } + if (_weapon_name = "Lictor Claws") { + _attack = 300; + _piercing = 1; + _range = 1; + } + if (_weapon_name = "Flesh Hooks") { + _attack = 100; + _piercing = 0; + _range = 2; + _ammo = 1; } } 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; - } - if (argument0 = "Power Weapon") { - atta = 120; - arp = 0; - rang = 1; - } - if (argument0 = "Power Sword") { - atta = 120; - arp = 0; - rang = 1; - } - if (argument0 = "Force Weapon") { - atta = 400; - arp = 1; - rang = 1; - } - if (argument0 = "Chainfist") { - atta = 300; - arp = 1; - rang = 1; - spli = 3; - } - if (argument0 = "Meltagun") { - atta = 200; - arp = 1; - rang = 2; - amm = 4; - } - if (argument0 = "Flamer") { - atta = 160; - arp = 0; - rang = 2.1; - amm = 4; - spli = 3; - } - if (argument0 = "Heavy Flamer") { - atta = 250; - arp = 0; - rang = 2.1; - amm = 6; - spli = 3; - } - if (argument0 = "Combi-Flamer") { - atta = 160; - arp = 0; - rang = 2.1; - amm = 1; - spli = 3; - } - if (argument0 = "Bolter") { - atta = 45; - arp = 0; - rang = 12; - amm = 15; - if (obj_ncombat.enemy = 5) then atta = 35; + if (_weapon_name = "Plasma Pistol") { + _attack = 70; + _piercing = 1; + _range = 3.1; + } + if (_weapon_name = "Power Weapon") { + _attack = 120; + _piercing = 1; + _range = 1; + } + if (_weapon_name = "Power Sword") { + _attack = 120; + _piercing = 1; + _range = 1; + } + if (_weapon_name = "Force Weapon") { + _attack = 250; + _piercing = 1; + _range = 1; + } + if (_weapon_name = "Chainfist") { + _attack = 300; + _piercing = 1; + _range = 1; + _shot_count = 3; + } + if (_weapon_name = "Meltagun") { + _attack = 200; + _piercing = 1; + _range = 2; + _ammo = 4; + } + if (_weapon_name = "Flamer") { + _attack = 160; + _piercing = 0; + _range = 2.1; + _ammo = 4; + _shot_count = 3; + } + if (_weapon_name = "Heavy Flamer") { + _attack = 200; + _piercing = 0; + _range = 2.1; + _ammo = 6; + _shot_count = 3; + } + if (_weapon_name = "Combi-Flamer") { + _attack = 160; + _piercing = 0; + _range = 2.1; + _ammo = 1; + _shot_count = 3; + } + 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") { - atta = 425; - arp = 1; - rang = 1; - } - if (argument0 = "Possessed Claws") { - atta = 250; - arp = 1; - rang = 1; - spli = 3; - } - if (argument0 = "Missile Launcher") { - atta = 200; - arp = 1; - rang = 20; - amm = 4; - spli = 3; - } - if (argument0 = "Chainsword") { - atta = 45; - arp = 0; - rang = 1; - } - if (argument0 = "Bolt Pistol") { - atta = 35; - arp = 0; - rang = 3.1; - amm = 18; - } - if (argument0 = "Chainaxe") { - atta = 55; - arp = 0; - rang = 1; - } - if (argument0 = "Poisoned Chainsword") { - atta = 90; - arp = 0; - rang = 1; + if (_weapon_name = "Power Fist") { + _attack = 250; + _piercing = 1; + _range = 1; + } + if (_weapon_name = "Possessed Claws") { + _attack = 150; + _piercing = 0; + _range = 1; + _shot_count = 3; + } + if (_weapon_name = "Missile Launcher") { + _attack = 200; + _piercing = 0; + _range = 20; + _ammo = 4; + } + if (_weapon_name = "Chainsword") { + _attack = 120; + _piercing = 0; + _range = 1; + _shot_count = 4; + } + if (_weapon_name = "Bolt Pistol") { + _attack = 100; + _piercing = 0; + _range = 3.1; + _ammo = 18; + _shot_count = 1; + } + if (_weapon_name = "Chainaxe") { + _attack = 140; + _piercing = 0; + _range = 1; + _shot_count = 3; + } + if (_weapon_name = "Poisoned Chainsword") { + _attack = 150; + _piercing = 0; + _range = 1; + _shot_count = 1; if (obj_ini.preomnor = 1) { - atta = 130; + _attack = 180; } } - if (argument0 = "Sonic Blaster") { - atta = 120; - arp = 0; - rang = 3; - spli = 3; - } - if (argument0 = "Rubric Bolter") { - atta = 80; - arp = 0; - rang = 12; - amm = 15; + if (_weapon_name = "Sonic Blaster") { + _attack = 150; + _piercing = 0; + _range = 3; + _shot_count = 6; + } + if (_weapon_name = "Rubric Bolter") { + _attack = 150; + _piercing = 0; + _range = 12; + _ammo = 15; + _shot_count = 5; } // Bursts - if (argument0 = "Witchfire") { - atta = 200; - arp = 1; - rang = 5.1; - } - if (argument0 = "Autogun") { - atta = 20; - arp = 0; - rang = 6; - amm = 12; - } - if (argument0 = "Storm Bolter") { - atta = 65; - arp = 0; - rang = 8; - amm = 10; - spli = 3; - } - if (argument0 = "Lascannon") { - atta = 200; - arp = 1; - rang = 20; - amm = 8; - } - if (argument0 = "Twin Linked Heavy Bolters") { - atta = 240; - arp = 0; - rang = 16; - spli = 3; - } - if (argument0 = "Twin-Linked Heavy Bolters") { - atta = 240; - arp = 0; - rang = 16; - spli = 3; - } - if (argument0 = "Twin Linked Lascannon") { - atta = 300; - arp = 1; - rang = 20; - } - if (argument0 = "Twin-Linked Lascannon") { - atta = 300; - arp = 1; - rang = 20; - } - if (argument0 = "Battle Cannon") { - atta = 300; - arp = 1; - rang = 12; - } - if (argument0 = "Demolisher Cannon") { - atta = 500; - arp = 1; - rang = 2; - if (instance_exists(obj_nfort)) then rang = 5; - } - if (argument0 = "Earthshaker Cannon") { - atta = 300; - arp = 0; - rang = 12; - spli = 3; - } - if (argument0 = "Havoc Launcher") { - atta = 100; - arp = 0; - rang = 12; - } - if (argument0 = "Baleflame") { - atta = 120; - arp = 0; - rang = 2; - } - if (argument0 = "Defiler Claws") { - atta = 350; - arp = 1; - rang = 1; - spli = 3; - } - if (argument0 = "Reaper Autocannon") { - atta = 320; - arp = 0; - rang = 18; - amm = 10; - spli = 3; + if (_weapon_name = "Witchfire") { + _attack = 200; + _piercing = 1; + _range = 5.1; + _shot_count = 1; + } + if (_weapon_name = "Autogun") { + _attack = 60; + _piercing = 0; + _range = 6; + _ammo = 12; + } + if (_weapon_name = "Storm Bolter") { + _attack = 180; + _piercing = 0; + _range = 8; + _ammo = 10; + _shot_count = 3; + } + if (_weapon_name = "Lascannon") { + _attack = 300; + _piercing = 1; + _range = 20; + _ammo = 8; + _shot_count = 1; + } + if (_weapon_name = "Twin Linked Heavy Bolters") { + _attack = 240; + _piercing = 0; + _range = 16; + _shot_count = 3; + } + if (_weapon_name = "Twin-Linked Heavy Bolters") { + _attack = 240; + _piercing = 0; + _range = 16; + _shot_count = 3; + } + if (_weapon_name = "Twin Linked Lascannon") { + _attack = 600; + _piercing = 1; + _range = 20; + _shot_count = 2; + } + if (_weapon_name = "Twin-Linked Lascannon") { + _attack = 600; + _piercing = 1; + _range = 20; + _shot_count = 2; + } + if (_weapon_name = "Battle Cannon") { + _attack = 300; + _piercing = 0; + _range = 12; + } + if (_weapon_name = "Demolisher Cannon") { + _attack = 500; + _piercing = 1; + _range = 2; + _shot_count = 8; + if (instance_exists(obj_nfort)) then _range = 5; + } + if (_weapon_name = "Earthshaker Cannon") { + _attack = 250; + _piercing = 0; + _range = 12; + _shot_count = 8; + } + if (_weapon_name = "Havoc Launcher") { + _attack = 300; + _piercing = 0; + _range = 12; + _shot_count = 12; + } + if (_weapon_name = "Baleflame") { + _attack = 225; + _piercing = 1; + _range = 2; + } + if (_weapon_name = "Defiler Claws") { + _attack = 350; + _piercing = 1; + _range = 1; + _shot_count = 3; + } + if (_weapon_name = "Reaper Autocannon") { + _attack = 320; + _piercing = 0; + _range = 18; + _ammo = 10; + _shot_count = 3; } - if (name = "Ripper Gun") { - atta = 40; - arp = 0; - rang = 3; - amm = 5; - spli = 0; - } - if (name = "Ogryn Melee") { - atta = 90; - arp = 0; - rang = 1; - } - if (name = "Multi-Laser") { - atta = choose(60, 75, 90, 105); - 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; - } - if (argument0 = "Electro-Flail") { - atta = 125; - arp = 1; - rang = 1; - spli = 3; - } - if (argument0 = "Neural Whip") { - atta = 85; - arp = 0; - rang = 1; - spli = 3 - } - if (argument0 = "Sarissa") { - atta = 65; - arp = 0; - rang = 2; - } - if (argument0 = "Seraphim Pistols") { - atta = 200; - arp = 1; - rang = 4; - } - if (argument0 = "Laser Mace") { - atta = 200; - arp = 1; - rang = 5.1; - amm = 3; - } - if (argument0 = "Heavy Bolter") { - atta = 120; - arp = 0; - rang = 16; - spli = 0; + if (_weapon_name = "Blessed Weapon") { + _attack = 150; + _piercing = 1; + _range = 1; + } + if (_weapon_name = "Electro-Flail") { + _attack = 125; + _piercing = 0; + _range = 1; + _shot_count = 3; + } + if (_weapon_name = "Neural Whip") { + _attack = 85; + _piercing = 0; + _range = 1; + _shot_count = 3 + } + if (_weapon_name = "Sarissa") { + _attack = 65; + _piercing = 0; + _range = 2; + } + if (_weapon_name = "Seraphim Pistols") { + _attack = 120; + _piercing = 0; + _range = 4; + } + if (_weapon_name = "Laser Mace") { + _attack = 150; + _piercing = 0; + _range = 5.1; + _ammo = 3; + } + if (_weapon_name = "Heavy Bolter") { + _attack = 120; + _piercing = 0; + _range = 16; + _shot_count = 0; } - if (name = "Lasgun") { - atta = 20; - 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 = 0; - rang = 3; - spli = 3; - } - if (name = "Warscythe") { - atta = 200; - arp = 1; - rang = 1; - spli = 0; - } - if (name = "Gauss Flayer") { - atta = choose(30, 30, 30, 50, 50, 70); - 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); - rang = 6.1; - spli = 0; - } - if (name = "Gauss Cannon") { - atta = 180; - arp = 1; - rang = 10; - spli = 3; - } - if (name = "Gauss Particle Cannon") { - atta = 300; - 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 = 1; - rang = 1; - spli = 0; - } - if (name = "Claws") { - atta = 300; - arp = 1; - rang = 1; - spli = 0; - } - if (name = "Gauss Flux Arc") { - atta = 180; - arp = 1; - rang = 8; - spli = 3; - } - if (name = "Particle Whip") { - atta = 300; - arp = 1; - rang = 4.1; - spli = 3; - } - if (name = "Gauss Flayer Array") { - atta = 180; - arp = 1; - 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); + var _weapon_struct = global.weapons[$ _weapon_name]; - 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 (_weapon_struct == undefined) { + exit; } - if (is_man = false) then amm = -1; + var _weapon_stack = new WeaponStack(_weapon_struct); + array_push(_weapon_stack.owners, _unit_name); - 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 * man_number; - range[b] = rang; - wep_num[b] += man_number; - if (obj_ncombat.started = 0) then ammo[b] = amm; - 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; - } - if (goody = 0) { - wep[first] = name; - splash[first] = spli; - att[first] += atta * man_number; - apa[first] += arp * man_number; - range[first] = rang; - wep_num[first] += man_number; - if (obj_ncombat.started = 0) then ammo[first] = amm; - goody = 1; - - if (man_number = 1) then wep_owner[first] = man_type; - if (man_number > 1) then wep_owner[first] = "assorted"; - } + // if (obj_ncombat.battle_stage == eBATTLE_STAGE.Creation) { + // _weapon_stack.ammo_max = _ammo; + // _weapon_stack.ammo_current = _ammo; + // _weapon_stack.ammo_reload = _reload; + // } - /* - wep[i]=""; - range[i]=0; - att[i]=0; - apa[i]=0; - */ -} \ No newline at end of file + 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 new file mode 100644 index 0000000000..044cd29072 --- /dev/null +++ b/scripts/scr_enunit_scripts/scr_enunit_scripts.gml @@ -0,0 +1,124 @@ +#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]; + } + + // show_debug_message($"target_block is in melee {engaged}") + + if (!engaged()) { + // Shooting + 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]; + + 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)) { + 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) { + var _target_priority_queue = ds_priority_create(); + + // Scan potential targets + var _targets = []; + with (obj_pnunit) { + if (pnunit_is_valid(self)) { + 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); + } + } + + // 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 = eUNIT_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!"); + } + + 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; + } + } + } else { + // Melee + 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]; + + if (!pnunit_is_valid(target_block)) { + 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 = eUNIT_TYPE.Fortification; + } + + scr_shoot(_weapon_stack, target_block, _target_unit_index); + } + } + //! 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_target/scr_target.yy b/scripts/scr_enunit_scripts/scr_enunit_scripts.yy similarity index 76% rename from scripts/scr_target/scr_target.yy rename to scripts/scr_enunit_scripts/scr_enunit_scripts.yy index f0ce200e8e..474d1aaa33 100644 --- a/scripts/scr_target/scr_target.yy +++ b/scripts/scr_enunit_scripts/scr_enunit_scripts.yy @@ -1,9 +1,9 @@ { "$GMScript":"v1", - "%Name":"scr_target", + "%Name":"scr_enunit_scripts", "isCompatibility":false, "isDnD":false, - "name":"scr_target", + "name":"scr_enunit_scripts", "parent":{ "name":"Combat", "path":"folders/Scripts/Combat.yy", diff --git a/scripts/scr_equipment_struct/scr_equipment_struct.gml b/scripts/scr_equipment_struct/scr_equipment_struct.gml index b4b673d841..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; @@ -45,8 +46,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; } } @@ -132,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; @@ -166,10 +177,17 @@ function EquipmentStruct(item_data, core_type, quality_request = "none") constru array_push(special_properties_array, special_properties[k]); } } - if (arp > 0) { - array_push(special_properties_array, "Armour Piercing"); - } else if (arp < 0) { - array_push(special_properties_array, "Low Penetration"); + if (arp=4){ + array_push(special_properties_array, "Anti Vehicle") + } + else if (arp=1){ + array_push(special_properties_array, "Low Penetration") + } + else if (arp=2){ + array_push(special_properties_array, "Medium Penetration") + } + else if (arp=3){ + 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_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_flavor/scr_flavor.gml b/scripts/scr_flavor/scr_flavor.gml index 82980dd773..6449830bb0 100644 --- a/scripts/scr_flavor/scr_flavor.gml +++ b/scripts/scr_flavor/scr_flavor.gml @@ -1,42 +1,19 @@ -/// @function add_battle_log_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) { - 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; -} - -function display_battle_log_message() { - // Trigger the message processing alarm - obj_ncombat.alarm[3] = 5; -} - -function scr_flavor(id_of_attacking_weapons, target, target_type, number_of_shots, casulties) { +/// @mixin +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 - 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 - 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)) { @@ -44,31 +21,19 @@ function scr_flavor(id_of_attacking_weapons, target, target_type, number_of_shot 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]; } - var character_shot = false, - 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; - // } - // } + var character_shot = false; + var unit_name = ""; + + if (array_length(_weapon_stack.owners) == 1) { + unit_name = $"{_weapon_stack.owners[0]}"; + 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; @@ -77,18 +42,18 @@ function scr_flavor(id_of_attacking_weapons, target, target_type, number_of_shot 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_object.flank = 1) then target_name = "flanking " + target_name; var flavoured = false; 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) { - 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 { @@ -102,7 +67,7 @@ function scr_flavor(id_of_attacking_weapons, target, target_type, number_of_shot } } } 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 { @@ -117,7 +82,7 @@ function scr_flavor(id_of_attacking_weapons, target, target_type, number_of_shot } } } 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 { @@ -142,7 +107,7 @@ function scr_flavor(id_of_attacking_weapons, target, target_type, number_of_shot } 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 { @@ -156,7 +121,7 @@ function scr_flavor(id_of_attacking_weapons, target, target_type, number_of_shot } } } 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."; @@ -176,7 +141,7 @@ function scr_flavor(id_of_attacking_weapons, target, target_type, number_of_shot } 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 { @@ -190,7 +155,7 @@ function scr_flavor(id_of_attacking_weapons, target, target_type, number_of_shot } } } 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 { @@ -208,7 +173,7 @@ function scr_flavor(id_of_attacking_weapons, target, target_type, number_of_shot } 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 { @@ -222,7 +187,7 @@ function scr_flavor(id_of_attacking_weapons, target, target_type, number_of_shot } } } 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 { @@ -240,7 +205,7 @@ function scr_flavor(id_of_attacking_weapons, target, target_type, number_of_shot } 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 { @@ -254,7 +219,7 @@ function scr_flavor(id_of_attacking_weapons, target, target_type, number_of_shot } } } 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 { @@ -290,25 +255,25 @@ function scr_flavor(id_of_attacking_weapons, target, target_type, number_of_shot } 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; @@ -347,14 +312,14 @@ function scr_flavor(id_of_attacking_weapons, target, target_type, number_of_shot } 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."; } @@ -364,7 +329,7 @@ function scr_flavor(id_of_attacking_weapons, target, target_type, number_of_shot 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) { @@ -386,7 +351,7 @@ function scr_flavor(id_of_attacking_weapons, target, target_type, number_of_shot } } } 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 { @@ -402,71 +367,29 @@ 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 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"); - message_priority = 5; + 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"); } } - 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 != "") { - add_battle_log_message(attack_message, message_size, message_priority); - display_battle_log_message(); + obj_ncombat.queue_battlelog_message(attack_message, message_color); } if (leader_message != "") { - add_battle_log_message(leader_message, message_size, message_priority); - display_battle_log_message(); + message_color = COL_BRIGHT_GREEN; + obj_ncombat.queue_battlelog_message(leader_message, message_color); } - -} \ No newline at end of file +} diff --git a/scripts/scr_flavor2/scr_flavor2.gml b/scripts/scr_flavor2/scr_flavor2.gml index 7ad3ad7b45..29d2c51652 100644 --- a/scripts/scr_flavor2/scr_flavor2.gml +++ b/scripts/scr_flavor2/scr_flavor2.gml @@ -1,215 +1,198 @@ -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; - var m1, m2, m3, mes; - m1 = ""; - m2 = ""; - m3 = ""; + 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 _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)); 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) + ". "; - 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 > 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) + ". "; + _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. "; - if (_hostile_shots = 1) then m1 = "A " + string(_hostile_weapon) + "z belches out a large caliber shell. "; + 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. "; + 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") { @@ -217,41 +200,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) + ". "; } } } @@ -260,44 +243,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) { + obj_ncombat.queue_battlelog_message(_message, 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!"; + obj_ncombat.queue_battlelog_message("The fortified wall has been breached!", COL_RED); obj_ncombat.wall_destroyed = 1; with(obj_nfort) { instance_destroy(); @@ -306,95 +284,35 @@ 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 == obj_ini.role[100][eROLE.ChapterMaster] || - unit_role == "Venerable " + string(obj_ini.role[100][eROLE.Dreadnought]) || - unit_role == obj_ini.role[100][eROLE.Captain] || - obj_ncombat.player_max <= 6 - ); - - 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 - } - } - - 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 lost!"; - } else { - obj_ncombat.dead_jim[obj_ncombat.dead_jims] = $"{unit_struct[him].name_role()} has been lost!"; - } - } - } - } - } - - - 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 += " lost."; + var unit_role, units_lost; + var loss_list = " "; - // show_message(m2); + 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]; - 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 += " lost."; - } - 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."; + 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."; + _message_color = COL_BRIGHT_GREEN; + } else { + loss_list += " lost."; + _message_color = COL_RED; + } } - mes = m1 + m2 + m3; - // show_message(mes); + _loss_text = loss_list; + _message = _attack_text + _loss_text; - 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; - } -} \ No newline at end of file + // 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_initialize_custom/scr_initialize_custom.gml b/scripts/scr_initialize_custom/scr_initialize_custom.gml index 0aade9edec..c0cca03995 100644 --- a/scripts/scr_initialize_custom/scr_initialize_custom.gml +++ b/scripts/scr_initialize_custom/scr_initialize_custom.gml @@ -39,6 +39,36 @@ enum ePROGENITOR { RANDOM, } +#macro WEAPON_LIST_RANGED_HEAVY_TERMINATOR ["Heavy Flamer", "Heavy Flamer", "Heavy Flamer", "Assault Cannon", "Assault Cannon", "Multi-Melta", "Plasma Cannon", "Grav-Cannon"] +#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"] +#macro WEAPON_LIST_RANGED_SPECIAL array_concat(WEAPON_LIST_RANGED_SPECIAL_LONG, WEAPON_LIST_RANGED_SPECIAL_ASSAULT) + +#macro WEAPON_LIST_RANGED_COMBI_LONG ["Storm Bolter", "Storm Bolter", "Storm Bolter", "Storm Bolter", "Combiplasma", "Combiplasma", "Combigrav"] +#macro WEAPON_LIST_RANGED_COMBI_ASSAULT ["Combiflamer", "Combiflamer", "Combiflamer", "Combimelta"] +#macro WEAPON_LIST_RANGED_COMBI array_concat(WEAPON_LIST_RANGED_COMBI_LONG, WEAPON_LIST_RANGED_COMBI_ASSAULT) + +#macro WEAPON_LIST_RANGED_PISTOLS_LONG ["Bolt Pistol", "Bolt Pistol", "Bolt Pistol", "Plasma Pistol", "Plasma Pistol", "Grav-Pistol"] +#macro WEAPON_LIST_RANGED_PISTOLS_ASSAULT ["Hand Flamer", "Hand Flamer", "Hand Flamer", "Infernus Pistol"] +#macro WEAPON_LIST_RANGED_PISTOLS array_concat(WEAPON_LIST_RANGED_PISTOLS_LONG, WEAPON_LIST_RANGED_PISTOLS_ASSAULT) + +#macro WEAPON_LIST_RANGED_VETERAN array_concat(["Bolter", "Bolter", "Bolter"], WEAPON_LIST_RANGED_COMBI) +#macro WEAPON_LIST_RANGED array_concat(WEAPON_LIST_RANGED_PISTOLS_LONG, WEAPON_LIST_RANGED_VETERAN) + + +#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]] + function progenitor_map(){ var founding_chapters = [ "", @@ -1426,7 +1456,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", STR_ANY_POWER_ARMOUR, "", "Rosarius"); load_default_gear(eROLE.Apothecary, "Apothecary", "Chainsword", "Bolt Pistol", STR_ANY_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", STR_ANY_POWER_ARMOUR, "", "Psychic Hood"); load_default_gear(eROLE.Sergeant, "Sergeant", "Chainsword", "Bolt Pistol", STR_ANY_POWER_ARMOUR, "", ""); load_default_gear(eROLE.VeteranSergeant, "Veteran Sergeant", "Chainsword", "Plasma Pistol", STR_ANY_POWER_ARMOUR, "", ""); @@ -1593,8 +1623,15 @@ function scr_initialize_custom() { "min": 0, "loadout": { "required": { - "wep1": [wep1[defaults_slot][eROLE.Veteran], 5], - "wep2": [wep2[defaults_slot][eROLE.Veteran], 5], + "wep1": ["", 0], + "wep2": ["Combat Knife", max], + }, + "option": { + "wep1": [ + [ + WEAPON_LIST_RANGED_VETERAN, 5 + ], + ], } }, "role": $"Company {roles.veteran}" @@ -1623,9 +1660,21 @@ function scr_initialize_custom() { "role": $"{roles.terminator} {roles.sergeant}", "loadout": { "required": { - "wep1": [wep1[defaults_slot][eROLE.Terminator], 1], - "wep2": [wep2[defaults_slot][eROLE.Terminator], 1], + "wep1": ["", 0], + "wep2": ["", 0], }, + "option": { + "wep1": [ + [ + ["Power Fist", "Chainfist"], 1 + ], + ], + "wep2": [ + [ + WEAPON_LIST_RANGED_COMBI, 1 + ], + ] + } } }], // Terminator @@ -1635,7 +1684,7 @@ function scr_initialize_custom() { "loadout": { "required": { "wep1": ["", 0], - "wep2": [wep2[100, 4], 3], + "wep2": ["", 0], }, "option": { "wep1": [ @@ -1645,9 +1694,14 @@ function scr_initialize_custom() { ], "wep2": [ [ - ["Assault Cannon", "Heavy Flamer"], 1 + WEAPON_LIST_RANGED_COMBI, 3 ], ], + "wep2": [ + [ + WEAPON_LIST_RANGED_HEAVY_TERMINATOR, 1 + ], + ] } } }], @@ -1697,12 +1751,11 @@ function scr_initialize_custom() { }] ], - "sternguard_veteran_squad": [ - // Sternguard Veteran - [roles.veteran, { - "max": 9, - "min": 4, - "role": $"Sternguard {roles.veteran}", + "veteran_squad": [ + [roles.veteran_sergeant, { + "max": 1, + "min": 1, + "role": $"{roles.veteran_sergeant}", "loadout": { "required": { "wep1": ["", 0], @@ -1711,92 +1764,40 @@ function scr_initialize_custom() { "option": { "wep1": [ [ - ["Bolter", "Stalker Pattern Bolter", "Storm Bolter"], 5 - ], - [ - ["Combiflamer"], 2 + WEAPON_LIST_RANGED_VETERAN, 1 ], - [ - weapon_lists.special_weapons, 1 - ], - [ - weapon_lists.heavy_weapons, 1, { - "wep2":"Combat Knife", - "mobi":"Heavy Weapons Pack", - } - ], - ] + ], } - } - }], - // Sternguard Veteran Sergeant - [roles.veteran_sergeant, { - "max": 1, - "min": 1, - "role": $"Sternguard {roles.veteran_sergeant}", - "loadout": { - "required": { - "wep1": ["Stalker Pattern Bolter", 1], - "wep2": [wep2[100][eROLE.Veteran], 1], - }, - } + }, }], - ["type_data", { - "display_data": $"Sternguard {roles.veteran} {squad_name}", - "formation_options": ["veteran", "assault", "devastator", "scout", "tactical"], - }] - ], - - "vanguard_veteran_squad": [ - // Vanguard Veterans [roles.veteran, { "max": 9, "min": 4, - "role": $"Vanguard {roles.veteran}", + "role": $"{roles.veteran}", "loadout": { "required": { "wep1": ["", 0], - "wep2": ["Bolt Pistol", 4], - "mobi": ["Jump Pack", 9] + "wep2": ["Combat Knife", max], }, "option": { "wep1": [ [ - ["Chainsword", "Power Sword", "Power Axe", "Lightning Claw"], 6 + WEAPON_LIST_RANGED_VETERAN, 7 ], [ - ["Power Fist"], 2 + WEAPON_LIST_RANGED_SPECIAL, 1 ], [ - ["Thunder Hammer"], 1 - ], + WEAPON_LIST_RANGED_HEAVY, 1, { + "mobi": "Heavy Weapons Pack", + } + ] ], - "wep2": [ - [ - ["Storm Shield"], 2, - ], - [ - ["Plasma Pistol"], 3 - ], - ] } - } - }], - // Vanguard Veteran Sergeant - [roles.veteran_sergeant, { - "max": 1, - "min": 1, - "role": $"Vanguard {roles.veteran_sergeant}", - "loadout": { - "required": { - "wep1": ["Thunder Hammer", 1], - "wep2": ["Storm Shield", 1], - "mobi": ["Jump Pack", 1] - }, - } - }], + }, + }, ], ["type_data", { - "display_data": $"Vanguard {roles.veteran} {squad_name}", + "display_data": $"{roles.veteran} {squad_name}", "formation_options": ["veteran", "assault", "devastator", "scout", "tactical"], }] ], @@ -1815,7 +1816,7 @@ function scr_initialize_custom() { "option": { "wep1": [ [ - weapon_lists.heavy_weapons, 4, { + WEAPON_LIST_RANGED_HEAVY, 4, { "mobi":"Heavy Weapons Pack", } ], @@ -1830,19 +1831,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 ], - ], + ] } } }], @@ -1864,10 +1861,10 @@ function scr_initialize_custom() { "option": { "wep1": [ [ - weapon_lists.special_weapons, 1 + WEAPON_LIST_RANGED_SPECIAL, 1 ], [ - weapon_lists.heavy_weapons, 1, { + WEAPON_LIST_RANGED_HEAVY, 1, { "wep2":"Combat Knife", "mobi":"Heavy Weapons Pack", } @@ -1883,17 +1880,17 @@ function scr_initialize_custom() { "loadout": { "required": { "wep1": ["", 0], - "wep2": ["Chainsword", 1] + "wep2": ["", 0] }, "option": { "wep1": [ [ - weapon_lists.pistols, 1 + WEAPON_LIST_RANGED_PISTOLS_LONG, 1 ], ], "wep2": [ [ - weapon_lists.melee_weapons, 1 + WEAPON_LIST_MELEE_BASIC, 1 ], ], } @@ -1927,7 +1924,7 @@ function scr_initialize_custom() { ], "wep2": [ [ - ["Plasma Pistol", "Flamer"], 2 + ["Flamer", "Flamer", "Flamer", "Plasma Pistol"], 2 ] ] } @@ -1946,12 +1943,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 ], ], } @@ -1969,13 +1966,13 @@ function scr_initialize_custom() { "min": 4, "loadout": { "required": { - "wep1": [wep1[100][12], 6], - "wep2": [wep2[100][12], 9] + "wep1": ["", 0], + "wep2": ["Combat Knife", max] }, "option": { "wep1": [ [ - ["Bolter", "Stalker Pattern Bolter"], 2 + ["Bolter", "Bolter", "Shotgun", "Sniper Rifle", "Stalker Pattern Bolter"], 8 ], [ ["Missile Launcher", "Heavy Bolter"], 1 @@ -1988,15 +1985,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": [ - [ - ["Power Sword", "Chainsword", "Power Axe"], 1 + WEAPON_LIST_RANGED, 1 ] ] } @@ -2009,45 +2005,6 @@ function scr_initialize_custom() { "formation_options": ["scout", "tactical", "assault", "devastator"], }], ], - - "scout_sniper_squad": [ - [roles.scout, - { - "max": 9, - "min": 4, - "loadout": { - "required": { - "wep1": ["Sniper Rifle", 8], - "wep2": ["Combat Knife", 9] - }, - "option": { - "wep1": [ - [ - ["Missile Launcher"], 1 - ] - ], - } - }, - "role": $"{roles.scout} Sniper", - }], - [roles.sergeant, { - "max": 1, - "min": 1, - "loadout": { - "required": { - "wep1": ["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}"); @@ -2077,16 +2034,15 @@ 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 - variable_struct_set(st, "assault_squad", [ + if (global.chapter_name == "Salamanders") { + st[$ "assault_squad"][0] = [roles.assault, { "max": 9, "min": 4, - "loadout": { //assault_marine + "loadout": { "required": { - "wep1": [wep1[100, 10], 4], - "wep2": [wep2[100, 10], 4], - "gear": ["Combat Shield", 4] + "wep1": [wep1[100, 10], 5], + "wep2": [wep2[100, 10], 5], }, "option": { "wep1": [ @@ -2102,35 +2058,9 @@ 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 - ] - ] - } - }, - "role": $"{roles.sergeant} {roles.assault}" - }], - ["type_data", { - "display_data": $"{roles.assault} {squad_name}" }] - ]) } + if (scr_has_adv("Lightning Warriors")) { variable_struct_set(st, "bikers", [ [roles.assault, { @@ -2164,6 +2094,7 @@ function scr_initialize_custom() { }] ]) } + if (scr_has_adv("Boarders")) { variable_struct_set(st, "breachers", [ [roles.tactical, { @@ -2180,10 +2111,10 @@ function scr_initialize_custom() { "option": { "wep1": [ [ - ["Flamer", "Grav-Gun", "Meltagun", "Lascutter"], 2, + ["Flamer", "Flamer", "Flamer", "Grav-Gun", "Meltagun", "Lascutter"], 2, ], ] - } + } }, "role": $"Breacher" }], @@ -2200,7 +2131,7 @@ function scr_initialize_custom() { "option": { "wep1": [ [ - ["Bolter", "Bolter", "Bolter", "Combiflamer"], 1 + WEAPON_LIST_RANGED_COMBI, 1 ] ], } @@ -2212,60 +2143,94 @@ function scr_initialize_custom() { "formation_options": ["tactical", "assault", "devastator", "scout" ], }] ]) - variable_struct_set(st,"assault_squad", [ - [roles.assault, { - "max": 9, - "min": 4, + } + + 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": [wep1[100, 10], 7], - "wep2": [wep2[100, 10], 7], + "wep1": ["", 0], + "wep2": ["", 0], + "mobi": ["Jump Pack", max], + "gear": ["Combat Shield", max] }, "option": { "wep1": [ [ - weapon_lists.melee_weapons, 2 + WEAPON_LIST_RANGED_PISTOLS, 1 ], ], "wep2": [ [ - ["Plasma Pistol", "Flamer"], 2 - ] + WEAPON_LIST_MELEE_VETERAN, 1 + ], ] } - } + }, }], - [roles.sergeant, { - "max": 1, - "min": 1, - "role": $"{roles.assault} {roles.sergeant}", + [roles.veteran, { + "max": 9, + "min": 4, + "role": $"{roles.veteran}", "loadout": { "required": { "wep1": ["", 0], "wep2": ["", 0], - "gear": ["Combat Shield", 1] + "mobi": ["Jump Pack", max], + "gear": ["Combat Shield", max] }, "option": { "wep1": [ [ - weapon_lists.pistols, 1 + WEAPON_LIST_RANGED_PISTOLS, 9 ], ], "wep2": [ [ - weapon_lists.melee_weapons, 1 + WEAPON_LIST_MELEE_VETERAN, 9 ], - ], + ] } - } - }], + }, + }, ], ["type_data", { - "display_data": $"{roles.assault} {squad_name}", - "formation_options": ["assault"], + "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}"); @@ -2379,7 +2344,7 @@ function scr_initialize_custom() { // Forge Master name[company, 1] = obj_creation.fmaster; - var _forge_master = add_unit_to_company("marine", company, 1, "Forge Master", eROLE.Techmarine, "Infernus Pistol", "Power Axe", "default", "Servo-harness", _hq_armour); + var _forge_master = add_unit_to_company("marine", company, 1, "Forge Master", eROLE.Techmarine, "Infernus Pistol", "Omnissian Axe", "default", "Servo-harness", _hq_armour); if (_forge_master.technology < 40) { _forge_master.technology = 40; } @@ -2436,7 +2401,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 @@ -2444,14 +2409,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 @@ -2459,7 +2424,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 @@ -2467,7 +2432,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 @@ -2475,7 +2440,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 @@ -2887,7 +2852,7 @@ function scr_initialize_custom() { commands++; _rolename = roles.captain; _erole = eROLE.Captain; - _wep2 = choose_weighted(weapon_weighted_lists.pistols); + _wep2 = choose_weighted(WEAPON_LIST_WEIGHTED_RANGED_PISTOLS); if (equal_specialists == false && _coy.coy == 8) { _mobi = "Jump Pack"; } @@ -2901,7 +2866,7 @@ function scr_initialize_custom() { commands++; _rolename = roles.chaplain; _erole = eROLE.Chaplain; - _wep2 = choose_weighted(weapon_weighted_lists.pistols); + _wep2 = choose_weighted(WEAPON_LIST_WEIGHTED_RANGED_PISTOLS); if (equal_specialists == false && _coy.coy == 8) { _mobi = "Jump Pack"; } 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_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 01de86024b..b2710b22dc 100644 --- a/scripts/scr_marine_struct/scr_marine_struct.gml +++ b/scripts/scr_marine_struct/scr_marine_struct.gml @@ -604,6 +604,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; @@ -676,19 +680,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.025)); + 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.025))); //calculate the effect of unit_health buffs + return _max_health; }; // used both to load unit data from save and to add preset base_stats @@ -1128,7 +1128,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) { @@ -1362,7 +1362,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.0025) * 100)); return damage_res; }; @@ -1423,9 +1423,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(); @@ -1613,14 +1613,16 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} }; 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)), "%#"); - - melee_carrying = melee_hands_limit(); + var _melee_mod = 1; + var explanation_string = ""; + + var melee_carrying = melee_hands_limit(); var _wep1 = get_weapon_one_data(); var _wep2 = get_weapon_two_data(); if (!is_struct(_wep1)) { @@ -1644,7 +1646,6 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} primary_weapon.attack = strength / 3; //calculate damage from player fists primary_weapon.name = "fists"; primary_weapon.range = 1; - primary_weapon.ammo = -1; } else { if (!valid1 && valid2) { primary_weapon = _wep2; @@ -1661,7 +1662,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")) { @@ -1678,26 +1679,55 @@ 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); + explanation_string += $"#Stats:#"; + explanation_string += $" WS: {_format_sign((weapon_skill / 100) * 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 (psionic > 0) { 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; basic_wep_string += $"Psychic Power: +{psychic_bonus}#"; } } - - 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) { @@ -1707,23 +1737,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; @@ -1741,12 +1772,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; }; @@ -2162,11 +2194,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() { @@ -2238,12 +2270,12 @@ 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_dice_unit(1, _psionic_difficulty, "high", self); if (_dice_roll == _psionic_difficulty) { psionic++; - add_battle_log_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_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_ncombat_scripts/scr_ncombat_scripts.gml b/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml new file mode 100644 index 0000000000..c285c008af --- /dev/null +++ b/scripts/scr_ncombat_scripts/scr_ncombat_scripts.gml @@ -0,0 +1,5897 @@ +enum eBATTLE_TURN_PHASE { + Movement, + Attack, + Psychic, + Morale, +} + +enum eBATTLE_STAGE { + Creation, + Main, + PlayerWinStart, + PlayerWinEnd, + EnemyWinStart, + EnemyWinEnd +} + +// 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") { + enemy_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 = 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=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];}*/ + } + + + // 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]; + // } + + + // ** Aeldar Force ** + if (enemy == 6) { + // 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[2] = "Dire Avenger Exarch"; + u.dudes_num[2] = 4; + u.dudes[3] = "Autarch"; + u.dudes_num[3] = 1; + u.dudes[4] = "Farseer"; + u.dudes_num[4] = 1; + 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[4] = "Warp Spider Exarch"; + u.dudes_num[4] = 1; + u.dudes[5] = "Howling Banshee"; + u.dudes_num[5] = 9; + u.dudes[6] = "Howling Banshee Exarch"; + u.dudes_num[6] = 1; + 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[2] = "Dire Avenger Exarch"; + u.dudes_num[2] = 10; + u.dudes[3] = "Autarch"; + u.dudes_num[3] = 1; + u.dudes[4] = "Farseer"; + u.dudes_num[4] = 1; + // 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[4] = "Warp Spider Exarch"; + u.dudes_num[4] = 2; + u.dudes[5] = "Howling Banshee"; + u.dudes_num[5] = 28; + u.dudes[6] = "Howling Banshee Exarch"; + u.dudes_num[6] = 2; + 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[2] = "Dire Avenger Exarch"; + u.dudes_num[2] = 20; + u.dudes[3] = "Autarch"; + u.dudes_num[3] = 3; + u.dudes[4] = "Farseer"; + u.dudes_num[4] = 2; + // 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[4] = "Warp Spider Exarch"; + u.dudes_num[4] = 4; + u.dudes[5] = "Howling Banshee"; + u.dudes_num[5] = 36; + u.dudes[6] = "Howling Banshee Exarch"; + u.dudes_num[6] = 4; + 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[2] = "Dire Avenger Exarch"; + u.dudes_num[2] = 50; + u.dudes[3] = "Autarch"; + u.dudes_num[3] = 5; + u.dudes[4] = "Farseer"; + u.dudes_num[4] = 3; + // 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[4] = "Warp Spider Exarch"; + u.dudes_num[4] = 8; + u.dudes[5] = "Howling Banshee"; + u.dudes_num[5] = 72; + u.dudes[6] = "Howling Banshee Exarch"; + u.dudes_num[6] = 8; + 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[2] = "Dire Avenger Exarch"; + u.dudes_num[2] = 60; + u.dudes[3] = "Autarch"; + u.dudes_num[3] = 8; + u.dudes[4] = "Farseer"; + u.dudes_num[4] = 4; + // 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[4] = "Warp Spider Exarch"; + u.dudes_num[4] = 16; + u.dudes[5] = "Howling Banshee"; + u.dudes_num[5] = 144; + u.dudes[6] = "Howling Banshee Exarch"; + u.dudes_num[6] = 16; + 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_force.name = "orks_6"; + enemy_force.copy_profile(); + if (DEBUG_COMBAT_PERFORMANCE) { + stopwatch("enemy_squad_spawning"); + } + enemy_force.spawn_squads(); + if (DEBUG_COMBAT_PERFORMANCE) { + stopwatch("enemy_squad_spawning"); + } + + player_force.name = "orks_6"; + player_force.copy_profile(); + player_force.spawn_squads(); + } + } + + // ** 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); + 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.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 = 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 = 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.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.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.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.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_force.get_unit_count()); + + 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_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."; + 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_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); + p2 = string_upper(p2); // Capitalize the ENEMY DUDES first letter + } + } + if ((enemy == 7) && (dropping == 1)) { + 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)) { + // 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_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)) { + // 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_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); + 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 = COL_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_chapter(1, 100, "high"); + if ((_dice_roll >= _survival_roll) && (_column_id.veh_dead[_vehicle_id] != 2)) { + _column_id.veh_hp[_vehicle_id] = roll_dice_chapter(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_chapter(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 = COL_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 = COL_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 = COL_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 = COL_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)} disabled during battle."; + newline_color = COL_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 = COL_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 = COL_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 = roll_dice_chapter(1, 100, "low"), 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 = COL_RED; + } + scr_newtext(); + + // 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 = COL_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 = COL_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 = COL_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 = 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=COL_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=COL_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 = COL_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 = roll_dice_chapter(1, 100, "high"); + 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 (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 = roll_dice_chapter(1, 100, "high"); + if ((eatme <= 10) && (allies > 0)) { + obj_controller.disposition[2] -= 2; + if (allies == 1) { + newline = "Local PDF have been eaten!"; + newline_color = COL_RED; + scr_newtext(); + } else if (allies == 2) { + newline = "Local Guardsmen have been eaten!"; + newline_color = COL_RED; + scr_newtext(); + } + } + + // check for inquisitor + eatme = roll_dice_chapter(1, 100, "high");; + 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 = COL_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 = COL_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 = COL_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 = COL_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); + + /* */ + /* */ +} + +// alarm_7 +/// @mixin +function ncombat_special_end() { + 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, "necron")) { + 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); + } + } + + var star = star_by_name(obj_temp8.loc) + var planet = obj_temp8.wid + + // show_message(you.name); + + // show_message("TEMP5: "+string(instance_number(obj_temp5))+"#Star: "+string(you)); + + var ppp;ppp=0; + remove_planet_problem(planet, "necron", star); + seal_tomb_world(star.p_feature[planet]); + + + pip.option1="";pip.option2="";pip.option3=""; + scr_event_log("","Inquisition Mission Completed: Your Astartes have sealed the Necron Tomb on "+string(star.name)+" "+string(scr_roman(planet))+"."); + scr_gov_disp(star.name,planet,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) && (defeat == 0)) { + var diceh=roll_dice_chapter(1, 100, "high"); + + 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(); + } + 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_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..3c758e039e --- /dev/null +++ b/scripts/scr_new_combat_scripts/scr_new_combat_scripts.gml @@ -0,0 +1,559 @@ +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.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); + 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(_x1, _y1, _x2, _y2) { + var _cell_width = (_x2 - _x1) / width; + var _cell_height = (_y2 - _y1) / height; + + for (var _x = 0; _x < width; _x++) { + for (var _y = 0; _y < height; _y++) { + 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(_cell_x1, _cell_y1, _cell_x2, _cell_y2, true); + draw_set_alpha(1); + + var _cell = get_cell(_x, _y); + _cell.draw_contents(_cell_x1, _cell_y1, _cell_x2, _cell_y2); + } + } + + draw_set_alpha(1); + draw_set_color(c_white); + }; +} + +function BattlefieldGridCell() constructor { + // terrain = -1; + 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 = default_size; + 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 allegiance_match = function(_allegiance) { + return array_length(occupants) == 0 || occupants[0].allegiance == _allegiance; + }; + + 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 { + 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; + 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); + } + } + } + + return true; + }; +} + +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; + + 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; + } + } + + // 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; + } + } + }; + + 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_new_combat_scripts/scr_new_combat_scripts.yy b/scripts/scr_new_combat_scripts/scr_new_combat_scripts.yy new file mode 100644 index 0000000000..ba97ee3c29 --- /dev/null +++ b/scripts/scr_new_combat_scripts/scr_new_combat_scripts.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"scr_new_combat_scripts", + "isCompatibility":false, + "isDnD":false, + "name":"scr_new_combat_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_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_perils_table/scr_perils_table.gml b/scripts/scr_perils_table/scr_perils_table.gml index b3586c6ad3..854d6bd421 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_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml b/scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml index 58d028443f..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 @@ -11,61 +11,64 @@ 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.battle_stage == eBATTLE_STAGE.Creation) { + _weapon_stack.ammo_max = weapon.ammo; + _weapon_stack.ammo_current = weapon.ammo; + _weapon_stack.ammo_reload = weapon.reload; + } + + struct_set(_stack_type, weapon.name, _weapon_stack); + } -function add_data_to_stack (stack_index, weapon, unit_damage=false, head_role=false, unit="none"){ - if (unit_damage){ - 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 (obj_ncombat.started=0) then ammo[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_index1) then wep_owner[i]="assorted";// What if they are using two ranged weapons? Hmmmmm? - } 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){ @@ -151,26 +172,19 @@ function scr_player_combat_weapon_stacks() { if (unit.mobility_item() != "Bike" && unit.mobility_item() != "") { if (is_struct(mobi_item)){ if (mobi_item.has_tag("jump")) { - 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); - } - } + 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() == obj_ini.role[100][eROLE.ChapterMaster] && obj_ncombat.chapter_master_psyker == 1)) { @@ -213,29 +227,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[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); } } } @@ -271,12 +270,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); } } } @@ -290,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.battle_stage == eBATTLE_STAGE.Creation){ instance_destroy(); exit; } @@ -313,7 +307,6 @@ function scr_player_combat_weapon_stacks() { } } - 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..bbe4b4e03d --- /dev/null +++ b/scripts/scr_pnunit_scripts/scr_pnunit_scripts.gml @@ -0,0 +1,354 @@ +#macro DEBUG_COLUMN_PRIORITY_PLAYER true + +// alarm_0 +/// @mixin +function pnunit_target_and_shoot() { + // Useful functions: + // target_unit_stack + // 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); + + engaged = collision_point(x - 10, y, obj_enunit, 0, 1) || collision_point(x + 10, y, obj_enunit, 0, 1); + + 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 (!enunit_is_valid(target_block)) { + target_block = instance_nearest(0, y, obj_enunit); + if (!enunit_is_valid(target_block,)) { + 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(); + + // Scan potential targets + var _check_targets = []; + with (obj_enunit) { + if (!enunit_is_valid(self)) { + 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); + } + } + + // 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; + } + } + } 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 (!enunit_is_valid(target_block)) { + 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.queue_battlelog_message(miss, COL_RED); + } + } + } + + 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?' [ ] + } + + // 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]; + } + } + + /* */ + /* */ +} + +function target_enemy_squad(_battle_block, _target_type = -1) { + var _biggest_target = noone; + var _priority_queue = ds_priority_create(); + var _unit_squads = _battle_block.unit_squads; + + for (var i = 0, l = array_length(_unit_squads); i < l; i++){ + var _unit_squad = _unit_squads[i]; + + 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) { + ds_priority_add(_priority_queue, _unit_squad, _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; +} + +function target_enemy_stack(_squad) { + var _biggest_target = noone; + var _priority_queue = ds_priority_create(); + var _unit_stacks = _squad.units; + + 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_vehicle_weapon/scr_vehicle_weapon.yy b/scripts/scr_pnunit_scripts/scr_pnunit_scripts.yy similarity index 76% rename from scripts/scr_vehicle_weapon/scr_vehicle_weapon.yy rename to scripts/scr_pnunit_scripts/scr_pnunit_scripts.yy index 49ccb6c3b8..9327732e58 100644 --- a/scripts/scr_vehicle_weapon/scr_vehicle_weapon.yy +++ b/scripts/scr_pnunit_scripts/scr_pnunit_scripts.yy @@ -1,9 +1,9 @@ { "$GMScript":"v1", - "%Name":"scr_vehicle_weapon", + "%Name":"scr_pnunit_scripts", "isCompatibility":false, "isDnD":false, - "name":"scr_vehicle_weapon", + "name":"scr_pnunit_scripts", "parent":{ "name":"Combat", "path":"folders/Scripts/Combat.yy", diff --git a/scripts/scr_powers/scr_powers.gml b/scripts/scr_powers/scr_powers.gml index c7e707a0d9..889728d7fa 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; - add_battle_log_message(_battle_log_message, 999, 137); + 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; - add_battle_log_message(_battle_log_message, 999, 135); + 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 - } - } - add_battle_log_message(_battle_log_message, _battle_log_priority, 134); + // 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,10 +286,8 @@ function scr_powers(caster_id) { check_dead_marines(_unit, caster_id); _battle_log_message = _cast_flavour_text + _power_flavour_text; - add_battle_log_message(_battle_log_message, 999, 137); + obj_ncombat.queue_battlelog_message(_battle_log_message, COL_RED); } - - display_battle_log_message(); } /// @desc Function to get requested data from the disciplines_data structure. Returns The requested data, or undefined if not found. 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..95fcb0f213 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"; @@ -115,6 +131,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 +183,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); } @@ -213,30 +246,26 @@ function move_unit_block(direction, blocks = 1, allow_collision = false) { } } -/// @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() { +function player_blocks_movement() { if (instance_exists(obj_nfort)) { exit; } - var _direction = flank ? "east" : "west"; - move_unit_block(_direction); -} + if ((obj_ncombat.defending || obj_ncombat.player_formation == 2)) { + exit; + } -/// @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); + var _player_movement_queue = ds_priority_create(); + with (obj_pnunit) { + ds_priority_add(_player_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(); + 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 @@ -275,9 +304,9 @@ function draw_block_composition(_x1, _composition_string) { } function draw_block_fadein() { - if (obj_ncombat.fadein > 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); } @@ -292,3 +321,131 @@ function update_block_size() { function update_block_unit_count() { unit_count = men + medi + dreads + veh; } + +function get_valid_weapon_stacks(_stacks_struct, _range_min, _range_max) { + 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); + } +} + +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() { + if (obj_ncombat.enemy_alpha_strike <= 0) { + return -1; + } + + 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") { + return [id, u]; + } + } + } + + return -1; +} + +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 = (_weapon_stack.range - _distance - 1) * 20; + + // Column size influence (bigger columns = higher threat?) + 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 (_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); + // } + + 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; +} diff --git a/scripts/scr_purge_world/scr_purge_world.gml b/scripts/scr_purge_world/scr_purge_world.gml index fd62e46881..8baddd1cb0 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; @@ -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_roster/scr_roster.gml b/scripts/scr_roster/scr_roster.gml index 68be5a41cf..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){ @@ -721,31 +721,26 @@ 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] * 3; + targ.veh_ac[targ.veh] = 60; } 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] * 2.5; + targ.veh_ac[targ.veh] = 62; } 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] * 4; + targ.veh_ac[targ.veh] = 84; } 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_ac[targ.veh] = 50; + targ.veh_hp[targ.veh] = obj_ini.veh_hp[company][v] * 4.5; + targ.veh_ac[targ.veh] = 100; } // STC Bonuses if (targ.veh_type[targ.veh] != "") { if (obj_controller.stc_bonus[3] = 1) { targ.veh_hp[targ.veh] = round(targ.veh_hp[targ.veh] * 1.1); - targ.veh_hp_multiplier[targ.veh] = targ.veh_hp_multiplier[targ.veh] * 1.1; } if (obj_controller.stc_bonus[3] = 2) { //TODO reimplement STC bonus for ranged vehicle weapons @@ -757,7 +752,6 @@ function add_vehicle_to_battle(company, veh_index, is_local){ } if (obj_controller.stc_bonus[4] = 1) { targ.veh_hp[targ.veh] = round(targ.veh_hp[targ.veh] * 1.1); - targ.veh_hp_multiplier[targ.veh] = targ.veh_hp_multiplier[targ.veh] * 1.1; } if (obj_controller.stc_bonus[4] = 2) { targ.veh_ac[targ.veh] = round(targ.veh_ac[targ.veh] * 1.1); diff --git a/scripts/scr_shoot/scr_shoot.gml b/scripts/scr_shoot/scr_shoot.gml index f77b7b4ab0..c3623477d1 100644 --- a/scripts/scr_shoot/scr_shoot.gml +++ b/scripts/scr_shoot/scr_shoot.gml @@ -1,541 +1,161 @@ -function scr_shoot(weapon_index_position, target_object, target_type, damage_data, melee_or_ranged) { +#macro DEBUG_WEAPON_RELOADING false +#macro DEBUG_PLAYER_TARGET_SELECTION false + +/// @mixin +function scr_shoot(_weapon_stack, _target_object, _target_index) { try { - // weapon_index_position: Weapon number - // target_object: Target object - // target_type: Target dudes - // damage_data: "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 - 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; - 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; } - 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) { - 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; - } + if (!is_struct(_weapon_stack)) { + exit; + } - damage_type = ""; - stop = 0; + 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 (ammo[weapon_index_position] > 0) { - ammo[weapon_index_position] -= 1; - } + if (_shooter_count <= 0 || _weapon_attack <= 0) { + exit; + } - if (damage_data == "medi") { - damage_type = "att"; - if (aggregate_damage < armour_pierce) { - damage_type = "arp"; + // 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 (_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! {_weapon_stack.ammo_current} turns left!"); + // } + _weapon_stack.ammo_current--; + continue; } - } else { - damage_type = damage_data; } - if (wep[weapon_index_position] == "Web Spinner") { - damage_type = "status"; - } - - 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 == "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 (melee_or_ranged != "wall") { - shots_fired *= attack_count_mod; - } - - 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; - } - 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); - } else { - target_object.hostile_shooters = (wep_owner[weapon_index_position] == "assorted") ? 999 : 1; - hostile_type = 0; - - scr_clean(target_object, hostile_type, hit_number, hostile_damage, hostile_weapon, hostile_range, hostile_splash); - } - } + if (_weapon_stack.ammo_current > 0) { + _weapon_stack.ammo_current--; } } - 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]) - var shots_fired = 0; - var stop = 0; - var damage_type = ""; - - if (weapon_index_position >= 0) { - shots_fired = wep_num[weapon_index_position]; + //* Enemy shooting + if (owner == 2) { + 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; + + 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; + scr_clean(_target_object, _weapon_stack); } + } - if (shots_fired == 0) { - exit; + //* Player shooting + if (owner == eFACTION.Player) { + 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!"); + // } + log_error($"{_weapon_name} found no valid targets in the enemy column to attack!"); + 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); - } - }*/ + var _target_stack = target_enemy_stack(_target_squad); - while (target_type < array_length(target_object.dudes_hp)) { - if (target_object.dudes_hp[target_type] == 0) { - target_type++; - stop = 1; - } else { - stop = 0; - break; - } - } + // if (DEBUG_PLAYER_TARGET_SELECTION) { + // show_debug_message($"{_weapon_name} is attacking {_target_object.dudes[_target_squad]}"); + // } - if (weapon_index_position >= 0) { - if (ammo[weapon_index_position] == 0) { - stop = 1; - } - if (ammo[weapon_index_position] > 0) { - ammo[weapon_index_position] -= 1; - } - } - if (wep[weapon_index_position] == "Missile Silo") { + if (_weapon_name == "Missile Silo") { obj_ncombat.player_silos -= min(obj_ncombat.player_silos, 30); } - - if (damage_data != "highest") { - damage_type = damage_data; - } - if ((damage_data == "highest") && (weapon_index_position >= 0)) { - damage_type = "att"; - if ((aggregate_damage >= 100) && (armour_pierce > 0)) { - damage_type = "arp"; - } - } - if (damage_data == "highest") { - if (weapon_index_position == -51 || weapon_index_position == -52 || weapon_index_position == -53) { - damage_type = "att"; + + // Normal shooting + 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_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.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.health; + } else { + _target_stack.health_current = 0; } + _target_stack.unit_count--; + obj_ncombat.enemy_forces--; + _casualties++; } - if ((weapon_index_position >= 0) || (weapon_index_position < -40)) { - // Normal shooting - var overkill = 0, - damage_remaining = 0, - shots_remaining = 0; - - var that_works = false; + _target_object.column_size -= _target_stack.unit_size * _casualties; - if (weapon_index_position >= 0) { - if ((aggregate_damage > 0) && (stop == 0)) { - that_works = true; - } - } - if ((weapon_index_position < -40) && (stop == 0)) { - that_works = true; - } - - if (that_works == true) { - var damage_per_weapon = 0, - c = 0, - target_armour_value = 0, - ap = 0, - wii = ""; - attack_count_mod = 0; - - if (weapon_index_position >= 0) { - damage_per_weapon = aggregate_damage / wep_num[weapon_index_position]; - ap = armour_pierce; - } // Average damage - if (weapon_index_position < -40) { - wii = ""; - attack_count_mod = 3; - - if (weapon_index_position == -51) { - wii = "Heavy Bolter Emplacement"; - at = 160; - armour_pierce = 0; - } - if (weapon_index_position == -52) { - wii = "Missile Launcher Emplacement"; - at = 200; - armour_pierce = 1; - } - if (weapon_index_position == -53) { - wii = "Missile Silo"; - at = 250; - ar = 0; - } - } - - target_armour_value = target_object.dudes_ac[target_type]; - - if (target_object.dudes_vehicle[target_type]) { - if (armour_pierce == 0) { - target_armour_value = target_armour_value * 6; - } - if (armour_pierce == -1) { - target_armour_value = damage_per_weapon; - } - } else { - if (armour_pierce == 1) { - target_armour_value = 0; - } - if (armour_pierce == -1) { - target_armour_value = target_armour_value * 6; - } - } - - attack_count_mod = max(1, splash[weapon_index_position]); - - final_hit_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 - - if (final_hit_damage_value <= 0) { - final_hit_damage_value = 0; - } // Average after armour - - c = shots_fired * final_hit_damage_value; // New damage - - var casualties, onceh = 0, - ponies = 0; - - casualties = min(floor(c / target_object.dudes_hp[target_type]), 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)) { - 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]); - - shots_remaining = round(damage_remaining / damage_per_weapon); - } - - if (target_object.dudes_num[target_type] - 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_type]) && (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_type]); - 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_type; - - // 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])) { - godd = k; - } - } - } - k = target_type; - 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])) { - 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 = 0; - } - if (ap2 == -1) { - target_armour_value2 = target_armour_value2 * 6; - } - } - if (target_object.dudes_vehicle[godd] == 1) { - if (ap2 == 0) { - target_armour_value2 = target_armour_value2 * 6; - } - if (ap2 == -1) { - target_armour_value2 = damage_per_weapon; - } - } - 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_type, 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; - } // Need special flavor here for just damaging - - if (casualties >= 1) { - target_object.dudes_num[target_type] -= casualties; - obj_ncombat.enemy_forces -= casualties; - } + if (_target_stack.unit_count <= 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); } } - if (stop == 0) { - compress_enemy_array(target_object); - destroy_empty_column(target_object); - } + scr_flavor(_weapon_stack, _target_object, _target_stack, _casualties); + + // if (_casualties > 0) { + // compress_enemy_array(_target_object); + // destroy_empty_column(_target_object); + // } } } catch (_exception) { handle_exception(_exception); diff --git a/scripts/scr_squads/scr_squads.gml b/scripts/scr_squads/scr_squads.gml index 36ee13e960..fa91906882 100644 --- a/scripts/scr_squads/scr_squads.gml +++ b/scripts/scr_squads/scr_squads.gml @@ -717,22 +717,14 @@ function game_start_squads(){ last_squad_count = array_length(obj_ini.squads); while (last_squad_count == array_length(obj_ini.squads)){ last_squad_count = (array_length(obj_ini.squads) + 1); - if(last_squad_count%2 == 0){ - create_squad("sternguard_veteran_squad", company); - }else{ - create_squad("vanguard_veteran_squad", company); - } + create_squad("veteran_squad", company); } company = 10; create_squad("command_squad", company); 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_string_functions/scr_string_functions.gml b/scripts/scr_string_functions/scr_string_functions.gml index a38e10fca8..a330327ae2 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"; @@ -56,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 575da55180..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 = {}; @@ -34,7 +59,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,4 +72,60 @@ function CountingMap() constructor { static get = function(_key) { return struct_exists(map, _key) ? map[$ _key] : 0; }; + + static clear = function() { + map = {}; + }; +} + +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); + } } diff --git a/scripts/scr_target/scr_target.gml b/scripts/scr_target/scr_target.gml deleted file mode 100644 index 66668a2335..0000000000 --- a/scripts/scr_target/scr_target.gml +++ /dev/null @@ -1,75 +0,0 @@ -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; - } - } - } - } - - if (final_target!=0) then return(final_target); - if (final_target=0){ - return(1); - } - - -} 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 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/scr_weapon.gml b/scripts/scr_weapon/scr_weapon.gml index c1b8cf8c7b..f9b000e97c 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"], - "hp_mod": { - "standard": 30, - "master_crafted": 35, - "artifact": 40 + "tags": ["shield","boarding 2"], + "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"], - "hp_mod": { - "standard": 15, - "master_crafted": 17.5, - "artifact": 20 + "tags": ["shield","boarding 3"], + "damage_resistance_mod": { + "standard": 20, + "master_crafted": 25, + "artifact": 30 }, }, "Archeotech Laspistol": { @@ -48,95 +43,83 @@ global.weapons = { "melee_hands": 0, "ranged_hands": 0.5, "ammo": 30, - "range": 3.1, - "spli": 1, - "arp": 0, + + "range": 4.1, + "spli": 0, + "arp": 1, "tags": ["pistol", "ancient", "las", "energy"], }, + "Combat Knife": { "abbreviation": "CbKnf", "attack": { - "standard": 25, - "master_crafted": 30, - "artifact": 35 + "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, "ranged_hands": 0, "ammo": 0, "range": 1, - "spli": 1, - "arp": 0, + "spli": 2, + "arp": 4, "tags": ["knife"], }, "Chainsword": { "abbreviation": "ChSwrd", "attack": { - "standard": 50, - "master_crafted": 60, - "artifact": 70 + "standard": 18, + "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, - "arp": 0, - "tags": ["chain", "sword"], + "spli": 2, + "arp": 6, + "tags": ["chain", "sword","savage", "boarding 1"], }, "Chainaxe": { "abbreviation": "ChAxe", "attack": { - "standard": 90, - "master_crafted": 100, - "artifact": 110 - }, - "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": 6, - "arp": 0, - "tags": ["chain", "axe", "dual"], + "spli": 2, + "arp": 6, + "tags": ["chain", "axe", "dual", "savage", "boarding 2"], }, "Company Standard": { "abbreviation": "CmpStnd", "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, + "spli": 3, + "arp": 6, "tags": ["banner"], }, "Eviscerator": { "abbreviation": "Evisc", "attack": { - "standard": 180, - "master_crafted": 190, - "artifact": 200 - }, - "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, @@ -144,52 +127,42 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 3, - "arp": 1, - "tags": ["chain", "sword"], + "arp": 18, + "tags": ["chain", "sword", "savage"], }, "Power Sword": { "abbreviation": "PwrSwrd", "attack": { - "standard": 180, - "master_crafted": 200, - "artifact": 240 - }, - "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": 1, + "spli": 2, + "arp": 12, "special_properties": ["Parry"], - "tags": ["power", "sword"], + "tags": ["power", "sword", "martial", "boarding 1"], }, "Power Spear": { "abbreviation": "PwrSpear", "attack": { - "standard": 200, - "master_crafted": 220, - "artifact": 260 - }, - "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, "ranged_hands": 0, "ammo": 0, "range": 1, - "spli": 6, - "arp": 1, + "spli": 3, + "arp": 14, "special_properties": ["Parry"], - "tags": ["power", "spear"], + "tags": ["power", "spear", "martial"], }, "Xenophase Blade": { "abbreviation": "XenoPhs", @@ -216,105 +189,90 @@ global.weapons = { "Chainfist": { "abbreviation": "ChFst", "attack": { - "standard": 550, - "master_crafted": 600, - "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": 1.25, - "ranged_hands": 1, + "melee_hands": 3, + "ranged_hands": 0, "range": 1, "spli": 2, - "arp": 1, - "tags": ["power","boarding", "chain", "fist", "dual", "siege"], + "tags": ["power","boarding 3", "chain", "fist", "siege", "savage"], + "arp": 20, }, "Lascutter": { "abbreviation": "Lasct", "attack": { - "standard": 100, - "master_crafted": 150, - "artifact": 200 + "standard": 64, + "master_crafted": 64, + "artifact": 64 }, - "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"], + "ammo": 5, + "reload": 2, + "arp": 20, + "tags": ["las","boarding 3", "siege"], }, - "Power Weapon": { - "abbreviation": "PwrWpn", + "Power Axe": { + "abbreviation": "PwrAxe", "attack": { - "standard": 135, - "master_crafted": 145, - "artifact": 155 - }, - "melee_mod": { - "standard": 1.1, - "master_crafted": 1.1, - "artifact": 1.1 + "standard": 28, + "master_crafted": 28, + "artifact": 28 }, - // "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, + "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": 1, - "tags": ["power"], + "spli": 2, + "arp": 14, + "tags": ["power", "axe", "dual","savage", "boarding 2"], }, - "Power Axe": { - "abbreviation": "PwrAxe", + "Omnissian Axe": { + "abbreviation": "OmnAxe", "attack": { - "standard": 190, - "master_crafted": 220, - "artifact": 260 - }, - "melee_mod": { - "standard": 1, - "master_crafted": 1.1, - "artifact": 1.2 + "standard": 32, + "master_crafted": 32, + "artifact": 32 }, - "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, + "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": 1, - "tags": ["power", "axe", "dual"], + "spli": 2, + "arp": 12, + "tags": ["power", "axe", "savage", "boarding 3"], + "specials": { + "combi_tool": 1 + } }, "Executioner Power Axe": { "abbreviation": "ExPwrAxe", "attack": { - "standard": 300, - "master_crafted": 350, - "artifact": 400 - }, - "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": 2, - "arp": 1, - "tags": ["power", "axe"], + "spli": 3, + "arp": 16, + "tags": ["power", "axe", "martial"], }, "Power Fist": { "abbreviation": "PwrFst", "attack": { - "standard": 450, - "master_crafted": 500, - "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, @@ -322,15 +280,15 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 2, - "arp": 1, - "tags": ["power", "dual", "fist"], + "tags": ["power", "dual", "fist", "savage", "boarding 2"], + "arp": 18, }, "Power Fists": { "abbreviation": "PwrFsts", "attack": { - "standard": 900, - "master_crafted": 1000, - "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, @@ -338,31 +296,31 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 4, - "arp": 1, - "tags": ["power", "fist", "pair"], + "tags": ["power", "fist", "pair","savage" ,"boarding 2"], + "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": 1, + "spli": 3, + "arp": 20, "tags": ["siege"], }, "Boltstorm Gauntlet": { "abbreviation": "BlstGnt", "attack": { - "standard": 450, - "master_crafted": 500, - "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, @@ -370,15 +328,15 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 2, - "arp": 1, - "second_profiles": ["Integrated Bolter"], - "tags": ["power", "fist"], + "arp": 18, + "second_profiles": ["Integrated-Bolter"], + "tags": ["power", "fist", "savage", "boarding 2"], }, "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", @@ -386,127 +344,102 @@ global.weapons = { "ranged_hands": 1, "range": 1, "spli": 2, - "arp": 1, + "arp": 3, "second_profiles": ["Assault Cannon"], - "tags": ["power","boarding", "chain", "fist", "dual", "siege"], + "tags": ["power","boarding 3", "chain", "fist", "dual", "siege"], }, "Lightning Claw": { "abbreviation": "LghtClw", "attack": { - "standard": 450, - "master_crafted": 500, - "artifact": 600 + "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, - "arp": 1, - "tags": ["power", "dual", "fist"], + "spli": 2, + "tags": ["power", "dual", "fist", "boarding 2", "martial"], + "arp": 16, }, "Dreadnought Lightning Claw": { "abbreviation": "LghtClw", "attack": { - "standard": 300, - "master_crafted": 400, - "artifact": 600 - }, - "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": 1, + "spli": 3, + "arp": 18, "maintenance" : 0.1, "tags": ["power", "vehicle", "dual", "dreadnought", "fist"], }, "Thunder Hammer": { "abbreviation": "ThndHmr", "attack": { - "standard": 650, - "master_crafted": 750, - "artifact": 900 - }, - "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": 10, - "arp": 1, - "tags": ["power", "hammer", "siege"], + "spli": 2, + "arp": 18, "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, - }, - "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, - "spli": 15, - "arp": 1, - "tags": ["heavy_melee", "power", "hammer", "siege"], - "maintenance" : 0.1, + "arp": 24, + "spli": 3, + "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 - }, - "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, - "spli": 10, - "arp": 1, - "tags": ["power", "mace", "siege"], + "arp": 14, + "spli": 2, + "tags": ["power", "mace", "siege", "savage"], "req_exp": 100, }, "Mace of Absolution": { "abbreviation": "AbsltMace", "attack": { - "standard": 600, - "master_crafted": 700, - "artifact": 800 - }, - "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", @@ -514,9 +447,9 @@ global.weapons = { "ranged_hands": 2, "ammo": 0, "range": 1, - "spli": 10, - "arp": 1, - "tags": ["power", "mace", "siege", "pious"], + "spli": 3, + "arp": 26, + "tags": ["power", "mace", "siege", "pious", "savage"], "req_exp": 100, }, "Tome": { @@ -537,68 +470,95 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 1, - "arp": 0, - "tags": ["arcane"], + "arp": 1, + "tags": ["arcane", "savage"], }, "Crozius Arcanum": { "abbreviation": "Crzus", "attack": { - "standard": 220, - "master_crafted": 250, - "artifact": 300 - }, - "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": 1, - "tags": ["power", "mace", "pious"], + "spli": 2, + "arp": 14, + "tags": ["power", "mace", "pious", "savage", "boarding 2"], }, "Relic Blade": { "abbreviation": "RlcBld", "attack": { - "standard": 700, - "master_crafted": 850, - "artifact": 1000 - }, - "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": 1, + "spli": 3, + "arp": 18, "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 + "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": 18, - "range": 3.1, - "spli": 1, - "arp": 0, - "tags": ["bolt", "pistol"], + "ammo": 7, + "reload": 1, + "range": 4.1, + "spli": 2, + "arp": 8, + "tags": ["bolt", "pistol", "boarding 1"], + }, + "Wrist-Mounted Storm Bolter": { + "abbreviation": "WrstBlt", + "attack": { + "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": 15, + "reload": 2, + "range": 11, + "spli": 4, + "arp": 10, + "maintenance" : 0.1, + "tags": ["bolt", "pistol", "boarding 2"], + }, + "Shotgun": { + "abbreviation": "Shtgn", + "attack": { + "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": 9, + "reload": 1, + "range": 4, + "spli": 2, + "arp": 8, + "tags": ["boarding 2"], }, "Webber": { "abbreviation": "Webbr", @@ -613,376 +573,463 @@ global.weapons = { "ammo": 5, "range": 4.1, "spli": 1, - "arp": 0, + "arp": 1, "tags": ["immobolise"] }, "Grav-Pistol": { "abbreviation": "GrvPstl", "attack": { - "standard": 150, - "master_crafted": 200, - "artifact": 250 + "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": 2.1, - "spli": 1, - "arp": 1, + "ammo": 6, + "reload": 1, + "range": 1, + "spli": 2, + "arp": 12, + "maintenance" : 0.2, "tags": ["grav", "pistol"], - "maintenance" : 0.8, + }, + "Integrated-Grav": { + "abbreviation": "IntGrv", + "attack": { + "standard": 24, + "master_crafted": 24, + "artifact": 24 + }, + "description": "", + "melee_hands": 0, + "ranged_hands": 0, + "ammo": 1, + "reload": 1, + "range": 4, + "spli": 5, + "arp": 16, + "tags": ["grav"] }, "Grav-Gun": { "abbreviation": "GrvGn", "attack": { - "standard": 450, - "master_crafted": 475, - "artifact": 500 + "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": 4, + "ammo": 8, + "reload": 1, "range": 4, - "spli": 3, - "arp": 1, + "spli": 4, + "arp": 16, "tags": ["grav"], - "maintenance" : 0.1, + "maintenance" : 0.5, }, "Grav-Cannon": { "abbreviation": "GrvCan", "attack": { - "standard": 800, - "master_crafted": 850, - "artifact": 900 + "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": 8, + "ammo": 5, + "reload": 3, + "range": 5, "spli": 6, - "arp": 1, - "tags": ["grav", "heavy_weapon"], - "maintenance" : 0.2, - }, - "Underslung Bolter": { - "abbreviation": "UndBltr", - "attack": { - "standard": 60, - "master_crafted": 70, - "artifact": 80 - }, - "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, - "arp": 0, - "tags": ["bolt", "attached"] + "arp": 20, + "tags": ["grav", "heavy_ranged"], + "maintenance" : 0.8, }, "Stalker Pattern Bolter": { "abbreviation": "StlkBltr", "attack": { - "standard": 100, - "master_crafted": 110, - "artifact": 120 + "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": 15, + "ammo": 24, + "reload": 1, + "range": 20, "spli": 1, - "arp": 1, + "arp": 8, "tags": ["bolt", "precision"] }, "Bolter": { "abbreviation": "Bltr", "attack": { - "standard": 50, - "master_crafted": 55, - "artifact": 60 + "standard": 30, + "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, "ranged_hands": 2, - "ammo": 16, - "range": 12, + "ammo": 10, + "reload": 1, + "range": 11, "spli": 3, - "arp": 0, - "tags": ["bolt"] + "arp": 8, + "tags": ["bolt", "boarding 1"] }, "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": 2, - "spli": 5, - "arp": -1, - "tags": ["flame", "heavy_ranged"] + "ammo": 10, + "reload": 3, + "range": 3, + "spli": 9, + "arp": 12, + "tags": ["flame", "heavy_ranged", "boarding 3"] }, "CCW Heavy Flamer": { "abbreviation": "CCWHvyFlmr", "attack": { - "standard": 250, - "master_crafted": 275, - "artifact": 300 + "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": 5, - "arp": -1, + "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": 1, + "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": 1, + "spli": 3, + "arp": 18, "tags": ["vehicle", "dreadnought", "fist"], "maintenance" : 0.1, }, "Inferno Cannon": { "abbreviation": "InfCann", "attack": { - "standard": 400, - "master_crafted": 440, - "artifact": 480 + "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": 3.1, - "spli": 20, - "arp": -1, + "ammo": 10, + "reload": -1, + "range": 6, + "spli": 12, + "arp": 16, "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": 1, + "reload": 1, + "range": 2, + "spli": 1, + "arp": 24, + "tags": ["melta"] + }, "Meltagun": { "abbreviation": "Mltgn", "attack": { - "standard": 450, - "master_crafted": 475, - "artifact": 500 + "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": 4, - "range": 2.1, + "ammo": 6, + "reload": 2, + "range": 2, "spli": 1, - "arp": 1, - "tags": ["melta","boarding"] + "arp": 24, + "tags": ["melta","boarding 3"] }, "Multi-Melta": { "abbreviation": "MltMelt", "attack": { - "standard": 800, - "master_crafted": 850, - "artifact": 900 + "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, + "ammo": 10, + "reload": 2, + "range": 7, "spli": 1, - "arp": 1, - "tags": ["melta", "heavy_ranged", "dreadnought"] + "arp": 26, + "tags": ["melta", "heavy_ranged", "dreadnought", "boarding 1"] }, "Plasma Pistol": { "abbreviation": "PlsmPstl", "attack": { - "standard": 115, - "master_crafted": 130, - "artifact": 150 + "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": 3.1, - "spli": 1, - "arp": 1, - "tags": ["plasma", "energy", "pistol"] + "ammo": 6, + "reload": 3, + "range": 4, + "spli": 2, + "arp": 16, + "tags": ["plasma", "energy", "pistol", "boarding 1"] }, "Plasma Cutter": { // Basically a dual-linked plasma pistol "abbreviation": "PlsmCt", "attack": { - "standard": 230, - "master_crafted": 260, - "artifact": 300 + "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": 3.1, - "spli": 1, - "arp": 1, + "ammo": 6, + "reload": 3, + "range": 1, + "spli": 4, + "arp": 16, "tags": ["plasma", "energy", "pistol"] }, "Infernus Pistol": { "abbreviation": "InfPstl", "attack": { - "standard": 100, - "master_crafted": 110, - "artifact": 120 + "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": 1, - "tags": ["melta", "pistol"] + "reload": 1, + "range": 1, + "spli": 1, + "arp": 24, + "tags": ["melta", "pistol", "boarding 2"] + }, + "Integrated-Plasma": { + "abbreviation": "IntPls", + "attack": { + "standard": 35, + "master_crafted": 35, + "artifact": 35 + }, + "description": "", + "melee_hands": 0, + "ranged_hands": 0, + "ammo": 1, + "reload": 1, + "range": 11, + "spli": 2, + "arp": 20, + "tags": ["plasma","energy"] }, "Plasma Gun": { "abbreviation": "PlsmGn", "attack": { - "standard": 250, - "master_crafted": 275, - "artifact": 300 + "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": 12, - "spli": 3, - "arp": 1, - "tags": ["plasma", "energy"] + "ammo": 12, + "reload": 4, + "range": 11, + "spli": 2, + "arp": 20, + "tags": ["plasma", "energy", "boarding 1"] }, "Plasma Cannon": { "abbreviation": "PlsmCan", "attack": { - "standard": 500, - "master_crafted": 600, - "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": 14, - "spli": 2, - "arp": 1, + "reload": 5, + "range": 16, + "spli": 4, + "arp": 20, "tags": ["plasma","energy","heavy_ranged", "dreadnought"] }, "Sniper Rifle": { "abbreviation": "SnprRfl", "attack": { - "standard": 80, - "master_crafted": 88, - "artifact": 96 + "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": 8, + "reload": 1, + "range": 12, + "spli": 1, + "arp": 10, + "tags": ["precision", "rifle"] + }, + "Needle Sniper Rifle": { + "abbreviation": "NdlSnpr", + "attack": { + "standard": 250, + "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 Deathwatch scouts.", + "melee_hands": 1, + "ranged_hands": 2, "ammo": 20, - "range": 18, + "range": 14, "spli": 1, - "arp": 0, + "arp": 2, "tags": ["precision", "rifle"] }, "Assault Cannon": { "abbreviation": "AssCann", "attack": { - "standard": 240, - "master_crafted": 264, - "artifact": 288 + "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": 1, + "ammo": 20, + "reload": 3, + "range": 16, + "spli": 10, + "arp": 12, "tags": ["heavy_ranged", "dreadnought"] }, "Autocannon": { "abbreviation": "Autocnn", "attack": { - "standard": 380, - "master_crafted": 400, - "artifact": 430 + "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": 18, - "spli": 15, - "arp": 1, - "tags": ["heavy_ranged", "dreadnought"] + "ammo": 5, + "reload": 2, + "range": 30, + "spli": 3, + "arp": 12, + "tags": ["heavy_ranged","explosive", "dreadnought"] }, "Missile Launcher": { "abbreviation": "MsslLnch", "attack": { - "standard": 250, - "master_crafted": 275, - "artifact": 300 + "standard": 52, + "master_crafted": 52, + "artifact": 52 }, - "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": 1, + "reload": 1, + "range": 26, + "spli": 2, + "arp": 16, + + "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": 24, - "spli": 3, - "arp": 0, - "tags": ["heavy_ranged", "dreadnought"] + "range": 8, + "spli": 20, + "arp": 2, + "tags": ["heavy_ranged","explosive"] }, "Lascannon": { "abbreviation": "Lascnn", "attack": { - "standard": 600, - "master_crafted": 700, - "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": 24, + "ammo": 6, + "reload": 2, + "range": 30, "spli": 1, - "arp": 1, + "arp": 20, "tags": ["heavy_ranged", "las", "energy"] }, "Conversion Beam Projector": { @@ -998,351 +1045,383 @@ global.weapons = { "ammo": 1, "range": 20, "spli": 3, - "arp": 1, + "arp": 4, "tags": ["heavy_ranged", "ancient"] }, - "Integrated Bolter": { + "Integrated-Bolter": { "abbreviation": "IntgBltr", "attack": { - "standard": 50, - "master_crafted": 55, - "artifact": 60 + "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": 20, - "range": 12, - "spli": 4, - "arp": 0, + "ammo": 10, + "reload": 1, + "range": 11, + "spli": 3, + "arp": 8, "tags": ["bolt"] }, "Twin Linked Heavy Bolter": { "abbreviation": "TwnHvyBltr", "attack": { - "standard": 320, - "master_crafted": 352, - "artifact": 384 + "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": 9, - "arp": 1, + "spli": 12, + "arp": 10, "tags": ["bolt", "heavy_ranged", "vehicle", "dreadnought"] }, "Twin Linked Lascannon": { "abbreviation": "TwnLascnn", "attack": { - "standard": 600, - "master_crafted": 700, - "artifact": 900 + "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": 1, + "arp": 20, "tags": ["las", "energy", "heavy_ranged", "vehicle", "dreadnought"] }, "Heavy Bolter": { "abbreviation": "HvyBltr", "attack": { - "standard": 320, - "master_crafted": 352, - "artifact": 384 + "standard": 35, + "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, "ranged_hands": 2, "ammo": 10, + "reload": 1, "range": 16, "spli": 6, - "arp": 1, + "arp": 10, "tags": ["heavy_ranged", "bolt"] }, "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": 400, - "master_crafted": 440, - "artifact": 480 + "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": 25, - "arp": 1, + "ammo": 10, + "reload": 2, + "range": 30, + "spli": 11, + "arp": 12, "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": { - "standard": 240, - "master_crafted": 264, - "artifact": 288 + "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": 3, - "arp": 1, + "spli": 12, + "arp": 10, "tags": ["vehicle", "dreadnought", "heavy_ranged", "bolt"] }, "Twin Linked Lascannon Mount": { "attack": { - "standard": 250, - "master_crafted": 275, - "artifact": 300 + "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, - "spli": 3, - "arp": 1, + "ammo": 6, + "reload": 4, + "range": 30, + "spli": 2, + "arp": 20, "tags": ["las", "energy", "vehicle", "heavy_ranged", "dreadnought"] }, "Twin Linked Assault Cannon Mount": { "attack": { - "standard": 240, - "master_crafted": 264, - "artifact": 288 + "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": 30, - "arp": 1, + "ammo": 20, + "reload": 6, + "range": 16, + "spli": 20, + "arp": 12, "tags": ["vehicle","heavy_ranged", "pintle", "dreadnought"] }, "Reaper Autocannon Mount": { "attack": { - "standard": 500, - "master_crafted": 550, - "artifact": 600 + "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, + "ammo": 10, + "reload": 4, + "range": 30, "spli": 6, - "arp": 1, + "arp": 12, "tags": ["vehicle","heavy_ranged", "pintle"] }, "Quad Linked Heavy Bolter Sponsons": { "attack": { - "standard": 320, - "master_crafted": 352, - "artifact": 384 + "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": 5, - "arp": 1, + "spli": 24, + "arp": 10, "tags": ["bolt","heavy_ranged", "vehicle", "sponson"] }, "Twin Linked Lascannon Sponsons": { "attack": { - "standard": 600, - "master_crafted": 700, - "artifact": 900 + "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": 3, - "arp": 1, + "ammo": 6, + "reload": 4, + "range": 30, + "spli": 2, + "arp": 20, "tags": ["las", "energy", "vehicle", "heavy_ranged", "sponson", "twin_linked"] }, "Lascannon Sponsons": { "attack": { - "standard": 500, - "master_crafted": 600, - "artifact": 750 + "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, + "ammo": 6, + "reload": 2, + "range": 30, "spli": 1, - "arp": 1, + "arp": 20, "tags": ["las", "energy","heavy_ranged", "vehicle", "sponson"] }, "Hurricane Bolter Sponsons": { "attack": { - "standard": 50, - "master_crafted": 55, - "artifact": 60 + "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": 0, + "ammo": 25, + "reload": 4, + "range": 6, + "spli": 12, + "arp": 8, "tags": ["bolt","heavy_ranged", "vehicle", "sponson"] }, "Flamestorm Cannon Sponsons": { "attack": { - "standard": 600, - "master_crafted": 660, - "artifact": 720 + "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": 2, - "spli": 3, - "arp": 1, + "ammo": 10, + "reload": 4, + "range": 5, + "spli": 12, + "arp": 18, "tags": ["flame","heavy_ranged", "vehicle", "sponson"] }, "Twin Linked Heavy Flamer Sponsons": { "attack": { - "standard": 500, - "master_crafted": 550, - "artifact": 600 + "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": 2.1, - "spli": 8, - "arp": -1, + "ammo": 10, + "reload": 6, + "range": 3, + "spli": 18, + "arp": 12, "tags": ["flame","heavy_ranged", "vehicle", "dreadnought", "sponson"] }, "Twin Linked Bolters": { "attack": { - "standard": 80, - "master_crafted": 140, - "artifact": 180 + "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": 12, - "spli": 6, - "arp": 0, + "ammo": 10, + "reload": 2, + "range": 16, + "spli": 12, + "arp": 10, "tags": ["bolt", "vehicle"] }, "Twin Linked Multi-Melta Sponsons": { "abbreviation": "TwnMltMelts", "attack": { - "standard": 800, - "master_crafted": 850, - "artifact": 900 + "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": 2, - "arp": 1, + "ammo": 10, + "reload": 2, + "range": 7, + "spli": 1, + "arp": 26, "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": 3, "tags": ["vehicle","heavy_ranged", "Sponson", "volkite", "ancient"] }, "Heavy Bolter Sponsons": { "abbreviation": "HvyBltrs", "attack": { - "standard": 240, - "master_crafted": 264, - "artifact": 288 + "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, + "ammo": 10, + "reload": 1, "range": 16, - "spli": 4, - "arp": 1, - "tags": ["heavy_ranged", "vehicle", "sponson", "bolt"], + "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": 2.1, - "spli": 4, - "arp": -1, + "ammo": 10, + "reload": 3, + "range": 3, + "spli": 9, + "arp": 12, "tags": ["flame","heavy_ranged", "vehicle", "sponson"], "maintenance" : 0.05, }, @@ -1350,335 +1429,339 @@ 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": 3, "tags": ["vehicle","heavy_ranged", "Sponson", "volkite", "ancient"] }, "Autocannon Turret": { "abbreviation": "Autocnn", "attack": { - "standard": 380, - "master_crafted": 528, - "artifact": 576 + "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": 25, - "range": 18, - "spli": 15, - "arp": 0, - "tags": ["vehicle","heavy_ranged", "turret"] + "ammo": 5, + "reload": 2, + "range": 30, + "spli": 3, + "arp": 12, + "tags": ["vehicle","heavy_ranged","explosive", "turret"] }, "Storm Bolter": { "abbreviation": "StrmBltr", "attack": { - "standard": 80, - "master_crafted": 88, - "artifact": 96 + "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.1, - "ranged_hands": 1.1, + "melee_hands": 1, + "ranged_hands": 2, "ammo": 10, - "range": 10, + "reload": 2, + "range": 11, "spli": 6, - "arp": 0, - "tags": ["bolt"], + "arp": 8, "maintenance" : 0.03, + "tags": ["bolt", "boarding 2"] }, "Hand Flamer": { "abbreviation": "HndFlmr", "attack": { - "standard": 125, - "master_crafted": 190, - "artifact": 210 + "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": 2, - "range": 2.1, // Infernus pistol has 2 range, so - "spli": 2, // This should probably be increased to at least 3, but maybe even 5 or 10 - "arp": -1, - "tags": ["pistol", "flame"] //, - // "maintenance" : 0.01, - decide on the value you prefer + "ammo": 4, + "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": 4, - "range": 2.1, - "spli": 4, - "arp": -1, - "tags": ["flame"], + "ammo": 6, + "reload": 2, + "range": 2, + "spli": 6, + "arp": 8, "maintenance" : 0.01, + "tags": ["flame", "boarding 2"] }, - "Underslung Flamer": { + "Integrated-Flamer": { "attack": { - "standard": 200, - "master_crafted": 220, - "artifact": 240 + "standard": 25, + "master_crafted": 25, + "artifact": 25 }, "description": "", - "abbreviation": "UndrFlmr", + "abbreviation": "IntFlmr", "melee_hands": 0, "ranged_hands": 0, - "ammo": 4, - "range": 2.1, - "spli": 3, - "arp": -1, + "ammo": 1, + "reload": 1, + "range": 2, + "spli": 6, + "arp": 8, "tags": ["flame", "attached"] }, "Combiflamer": { "abbreviation": "CmbFlmr", "attack": { - "standard": 100, - "master_crafted": 130, - "artifact": 160 + "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, + "ammo": 10, + "reload": 1, + "range": 11, "spli": 3, - "arp": 0, - "second_profiles": ["Flamer"], - "tags": ["combi", "bolt"] + "arp": 8, + "second_profiles": ["Integrated-Flamer"], + "tags": ["combi", "bolt", "boarding 2"] }, "Combiplasma": { "abbreviation": "CmbPlsm", "attack": { - "standard": 100, - "master_crafted": 130, - "artifact": 160 + "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": 15, - "range": 10, + "ammo": 10, + "reload": 1, + "range": 11, "spli": 3, - "arp": 0, - "second_profiles": ["Plasma Gun"], + "arp": 8, + "second_profiles": ["Integrated-Plasma"], "tags": ["combi", "bolt"] }, "Combigrav": { "abbreviation": "CmbGrv", "attack": { - "standard": 100, - "master_crafted": 130, - "artifact": 160 + "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": 15, - "range": 10, + "ammo": 10, + "reload": 1, + "range": 11, "spli": 3, - "arp": 0, - "second_profiles": ["Grav-Gun"], + "arp": 8, + "second_profiles": ["Integrated-Grav"], "tags": ["combi", "bolt"] }, "Combimelta": { "abbreviation": "CmbMlt", "attack": { - "standard": 100, - "master_crafted": 130, - "artifact": 160 + "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": 15, - "range": 10, + "ammo": 10, + "reload": 1, + "range": 11, "spli": 3, - "arp": 0, - "second_profiles": ["Meltagun"], - "tags": ["combi", "bolt"] + "arp": 8, + "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, - "arp": -1, - "tags": ["flame"] + "ammo": 10, + "reload": 3, + "range": 3, + "spli": 9, + "arp": 12, + "tags": ["flame","boarding 3"] }, "Force Staff": { "attack": { - "standard": 200, - "master_crafted": 230, - "artifact": 270 - }, - "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": 1, - "tags": ["force" ], + "spli": 3, + "arp": 0, "specials": { "psychic_amplification": 25 }, "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": 2, "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": 250, + "master_crafted": 300, + "artifact": 375 }, "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, + "spli": 3, + "arp": 2, "special_description": "Able to be dual-wielded", - "tags": ["force", "axe", "dual"], + "tags": ["force", "axe", "dual", "savage", "boarding 2"], }, "Twin Linked Lascannon Turret": { "attack": { - "standard": 600, - "master_crafted": 700, - "artifact": 900 + "standard": 75, + "master_crafted": 75, + "artifact": 75 }, "abbreviation": "TwnLscnn", "description": "A Predator-compatible turret mounting a twin-linked lascannon.", - "arp": 1, - "range": 24, - "ammo": 5, + "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": 240, - "master_crafted": 264, - "artifact": 288 + "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": 30, - "arp": 1, + "ammo": 20, + "reload": 6, + "range": 16, + "spli": 20, + "arp": 12, "tags": ["heavy_ranged", "twin_linked", "vehicle", "turret"] }, "Flamestorm Cannon Turret": { "abbreviation": "FlmstCnn", "attack": { - "standard": 600, - "master_crafted": 660, - "artifact": 720 + "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": 2, - "spli": 3, - "arp": 1, + "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": 5.1, - "spli": 2, - "arp": 1, + "ammo": 10, + "reload": 2, + "range": 7, + "spli": 1, + "arp": 26, "tags": ["vehicle","heavy_ranged", "turret", "melta"] }, "Plasma Destroyer Turret": { "abbreviation": "PlsmDestr", "attack": { - "standard": 500, - "master_crafted": 600, - "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 is mounted in a tank turret.", "melee_hands": 1, "ranged_hands": 3, "ammo": 16, - "range": 14, - "spli": 3, - "arp": 1, + "reload": 5, + "range": 16, + "spli": 4, + "arp": 20, "tags": ["plasma", "energy","heavy_ranged", "vehicle", "turret"] }, "Heavy Conversion Beam Projector": { @@ -1694,7 +1777,7 @@ global.weapons = { "ammo": 6, "range": 20, "spli": 1, - "arp": 1, + "arp": 4, "tags": ["vehicle","heavy_ranged", "dreadnought", "turret", "ancient"] }, "Neutron Blaster Turret": { @@ -1710,15 +1793,15 @@ global.weapons = { "ammo": 6, "range": 20, "spli": 2, - "arp": 1, + "arp": 4, "tags": ["vehicle","heavy_ranged", "turret"] }, "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, @@ -1726,11 +1809,11 @@ global.weapons = { "ammo": 25, "range": 18, "spli": 30, - "arp": 0, + "arp": 3, "tags": ["vehicle","heavy_ranged", "turret", "volkite", "ancient"] }, -// Hireling weapons + // Hireling weapons // Admech "Hellgun": { "abbreviation": "HllGun", @@ -1743,7 +1826,7 @@ global.weapons = { "ammo": 20, "range": 12, "spli": 3, - "arp": 0, + "arp": 1, "tags": ["las"], "melee_hands": 0, "ranged_hands": 1, @@ -1761,7 +1844,7 @@ global.weapons = { "ammo": 30, "range": 3.1, "spli": 1, - "arp": 0, + "arp": 1, "tags": ["pistol", "las"], }, // Other imperials @@ -1778,7 +1861,7 @@ global.weapons = { "ammo": 16, "range": 10, "spli": 2, - "arp": 0, + "arp": 1, "tags": ["bolt"], "second_profiles": ["Sarissa"] }, @@ -1795,7 +1878,7 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 1, - "arp": 0, + "arp": 1, "tags": ["axe"], }, "Hellrifle": { @@ -1809,7 +1892,7 @@ global.weapons = { "ammo": 10, "range": 20, "spli": 1, - "arp": 0, + "arp": 1, "tags": ["rifle", "arcane"], "ranged_hands": 1, }, @@ -1838,7 +1921,7 @@ global.weapons = { "ammo": 6, "range": 2.1, "spli": 3, - "arp": 0, + "arp": 1, "tags": ["pistol"] }, "Eldar Power Sword": { @@ -1859,97 +1942,261 @@ global.weapons = { "ammo": 0, "range": 1, "spli": 3, - "arp": 1, + "arp": 2, "special_properties": ["Parry"], "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": 28, - "master_crafted": 32, - "artifact": 36 + "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": 80, - "master_crafted": 92, - "artifact": 104 + "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": 0, - "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": { "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": 34, - "artifact": 38 + "standard": 24, + "master_crafted": 28, + "artifact": 32 }, "ranged_mod": { - "standard": 5, - "master_crafted": 10, - "artifact": 15 + "standard": 10, + "master_crafted": 15, + "artifact": 20 }, "melee_mod": { "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": 42, - "master_crafted": 46, - "artifact": 50 - }, - "ranged_mod": { - "standard": -10, - "master_crafted": -5, - "artifact": 0 + "standard": 28, + "master_crafted": 32, + "artifact": 36 }, - "melee_mod": { + "damage_resistance_mod": { "standard": 20, "master_crafted": 25, "artifact": 30 }, + "melee_mod": { + "standard": 15, + "master_crafted": 20, + "artifact": 25 + }, + "ranged_mod": { + "standard": 5, + "master_crafted": 10, + "artifact": 15 + }, + "hp_mod": { + "standard": 5, + "master_crafted": 10, + "artifact": 15 + }, "melee_hands": 2, "ranged_hands": 2, "description": "Terminator Armour is the strongest and most powerful armour designed by humanity, available only to the veterans of the Adeptus Astartes. The Indomitus Pattern is the most widespread and versatile pattern as of M41.", @@ -1960,19 +2207,14 @@ global.gear = { "Dreadnought": { "abbreviation": "Drdnght", "armour_value": { - "standard": 50, - "master_crafted": 55, - "artifact": 60 - }, - "ranged_mod": { - "standard": 0, - "master_crafted": 5, // Augmented - "artifact": 10 // Augmented - }, - "melee_mod": { - "standard": 0, - "master_crafted": 5, // Augmented - "artifact": 10 // Augmented + "standard": 74, + "master_crafted": 78, + "artifact": 82 + }, + "hp_mod": { + "standard": 60, + "master_crafted": 80, + "artifact": 100 }, "melee_hands": 8, "ranged_hands": 8, @@ -1983,20 +2225,30 @@ global.gear = { "Tartaros": { "abbreviation": "Tartrs", "armour_value": { - "standard": 42, - "master_crafted": 46, - "artifact": 50 - }, - "ranged_mod": { - "standard": 0, - "master_crafted": 5, // Augmented - "artifact": 10 // Augmented + "standard": 28, + "master_crafted": 32, + "artifact": 36 }, - "melee_mod": { + "damage_resistance_mod": { "standard": 20, "master_crafted": 25, "artifact": 30 }, + "melee_mod": { + "standard": 15, + "master_crafted": 20, + "artifact": 25 + }, + "ranged_mod": { + "standard": 5, + "master_crafted": 10, + "artifact": 15 + }, + "hp_mod": { + "standard": 5, + "master_crafted": 10, + "artifact": 15 + }, "melee_hands": 2, "ranged_hands": 2, "description": "This pattern is possibly considered the most advanced form of Terminator Armour, providing greater mobility for the wearer compared to the Indomitus with no loss in durability. In the M41 considered to be incredibly rare with wars being fought to secure more suits.", @@ -2007,19 +2259,29 @@ global.gear = { "Cataphractii Pattern Terminator": { "abbreviation": "Catphr", "armour_value": { - "standard": 42, - "master_crafted": 46, - "artifact": 50 + "standard": 30, + "master_crafted": 34, + "artifact": 38 }, - "ranged_mod": { - "standard": 0, - "master_crafted": 5, // Augmented - "artifact": 10 // Augmented + "damage_resistance_mod": { + "standard": 30, + "master_crafted": 35, + "artifact": 40 + }, + "hp_mod": { + "standard": 5, + "master_crafted": 10, + "artifact": 15 }, "melee_mod": { - "standard": 20, - "master_crafted": 25, - "artifact": 30, + "standard": 15, + "master_crafted": 20, + "artifact": 25 + }, + "ranged_mod": { + "standard": 5, + "master_crafted": 10, + "artifact": 15 }, "melee_hands": 2, "ranged_hands": 2, @@ -2031,39 +2293,41 @@ global.gear = { "Scout Armour": { "abbreviation": "SctArm", "armour_value": { - "standard": 11, + "standard": 12, + "master_crafted": 14, + "artifact": 16 + }, + "damage_resistance_mod": { // Concealment + "standard": 10, "master_crafted": 12, "artifact": 14 }, - "ranged_mod": { - "standard": 15, - "master_crafted": 20, // Augmented - "artifact": 25 // Augmented - }, - "melee_mod": { - "standard": 0, - "master_crafted": 5, // Augmented - "artifact": 10 // Augmented - }, "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": 19, + "master_crafted": 23, + "artifact": 27 }, - "ranged_mod": { - "standard": -10, - "master_crafted": -5, - "artifact": 0 + "hp_mod": { + "standard": 10, + "master_crafted": 15, + "artifact": 20 }, "melee_mod": { - "standard": 0, - "master_crafted": 5, // Augmented - "artifact": 10 // Augmented + "standard": 10, + "master_crafted": 15, + "artifact": 20 + }, + "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, @@ -2071,20 +2335,27 @@ global.gear = { "MK4 Maximus": { "abbreviation": "MK4", "armour_value": { - "standard": 22, - "master_crafted": 25, - "artifact": 28 + "standard": 16, + "master_crafted": 20, + "artifact": 24 }, - "ranged_mod": { + "hp_mod": { "standard": 5, "master_crafted": 10, "artifact": 15 }, "melee_mod": { "standard": 5, - "master_crafted": 10, // Augmented - "artifact": 15 // Augmented + "master_crafted": 10, + "artifact": 15 + }, + "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, @@ -2092,20 +2363,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 + }, + "ranged_mod": { + "standard": 0, + "master_crafted": 5, + "artifact": 10 }, + "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, @@ -2113,20 +2391,27 @@ global.gear = { "MK6 Corvus": { "abbreviation": "MK6", "armour_value": { - "standard": 15, - "master_crafted": 17, - "artifact": 19 + "standard": 17, + "master_crafted": 21, + "artifact": 25 }, - "ranged_mod": { - "standard": 15, - "master_crafted": 20, // Augmented - "artifact": 25 // Augmented + "hp_mod": { + "standard": 5, + "master_crafted": 10, + "artifact": 15 }, "melee_mod": { - "standard": 0, - "master_crafted": 5, // Augmented - "artifact": 10 // Augmented + "standard": 5, + "master_crafted": 10, + "artifact": 15 + }, + "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, @@ -2134,20 +2419,27 @@ global.gear = { "MK7 Aquila": { "abbreviation": "MK7", "armour_value": { - "standard": 17, - "master_crafted": 19, - "artifact": 21 + "standard": 18, + "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 + "standard": 5, + "master_crafted": 10, + "artifact": 15 + }, + "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, @@ -2155,43 +2447,30 @@ global.gear = { "MK8 Errant": { "abbreviation": "MK8", "armour_value": { - "standard": 22, - "master_crafted": 24, - "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 - }, - "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 + "standard": 5, + "master_crafted": 10, + "artifact": 15 }, "ranged_mod": { - "standard": 0, - "master_crafted": 5, // Augmented - "artifact": 10 // Augmented - }, - "melee_mod": { - "standard": 0, - "master_crafted": 5, // Augmented - "artifact": 10 // Augmented + "standard": 5, + "master_crafted": 10, + "artifact": 15 }, - "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.", + "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, }, "Armoured Ceramite": { "abbreviation": "ArmCrmt", @@ -2258,8 +2537,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", @@ -2283,7 +2562,7 @@ global.gear = { "artifact": 10 }, }, - // Sororitas and other imperials + // Sororitas and other imperials "Light Power Armour": { "abbreviation": "LPwrArm", "armour_value": { @@ -2322,7 +2601,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.", @@ -2332,7 +2611,7 @@ global.gear = { "artifact": 30 }, }, - // Orks + // Orks "Ork Armour": { "abbreviation": "OrkArm", "armour_value": { @@ -2352,7 +2631,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.", @@ -2371,11 +2650,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", @@ -2384,10 +2658,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", @@ -2400,40 +2674,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", @@ -2448,45 +2713,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": 0, "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" : { @@ -2534,7 +2775,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": { @@ -2544,10 +2784,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": { @@ -2557,6 +2799,9 @@ global.gear = { }, "melee_hands": -0.5, "ranged_hands": -0.5, + "specials": { + "combi_tool": 2 + } }, "Conversion Beamer Pack": { "abbreviation": "CnvBmr", @@ -2569,47 +2814,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. ";} 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 0000000000..8dec0f8143 Binary files /dev/null and b/sprites/spr_weapon_omnissian_axe/cf403b7b-a831-4dd7-94fc-490b330d9a3b.png differ 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 0000000000..8dec0f8143 Binary files /dev/null and b/sprites/spr_weapon_omnissian_axe/layers/cf403b7b-a831-4dd7-94fc-490b330d9a3b/3f223d5d-3d0b-4c23-9457-1ae722299b06.png differ 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 diff --git a/sprites/spr_weapon_shotgun/ed54fad2-a39b-4f07-9737-5b8f916bee92.png b/sprites/spr_weapon_shotgun/ed54fad2-a39b-4f07-9737-5b8f916bee92.png new file mode 100644 index 0000000000..986f85620d Binary files /dev/null and b/sprites/spr_weapon_shotgun/ed54fad2-a39b-4f07-9737-5b8f916bee92.png differ diff --git a/sprites/spr_weapon_shotgun/layers/ed54fad2-a39b-4f07-9737-5b8f916bee92/11b4c573-f844-42a2-905a-d6dace60762b.png b/sprites/spr_weapon_shotgun/layers/ed54fad2-a39b-4f07-9737-5b8f916bee92/11b4c573-f844-42a2-905a-d6dace60762b.png new file mode 100644 index 0000000000..986f85620d Binary files /dev/null and b/sprites/spr_weapon_shotgun/layers/ed54fad2-a39b-4f07-9737-5b8f916bee92/11b4c573-f844-42a2-905a-d6dace60762b.png differ diff --git a/sprites/spr_weapon_shotgun/spr_weapon_shotgun.yy b/sprites/spr_weapon_shotgun/spr_weapon_shotgun.yy new file mode 100644 index 0000000000..3b80d39ea6 --- /dev/null +++ b/sprites/spr_weapon_shotgun/spr_weapon_shotgun.yy @@ -0,0 +1,111 @@ +{ + "$GMSprite":"", + "%Name":"spr_weapon_shotgun", + "bboxMode":0, + "bbox_bottom":192, + "bbox_left":31, + "bbox_right":62, + "bbox_top":99, + "collisionKind":1, + "collisionTolerance":0, + "DynamicTexturePage":false, + "edgeFiltering":false, + "For3D":false, + "frames":[ + {"$GMSpriteFrame":"","%Name":"ed54fad2-a39b-4f07-9737-5b8f916bee92","name":"ed54fad2-a39b-4f07-9737-5b8f916bee92","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, + ], + "gridX":0, + "gridY":0, + "height":231, + "HTile":false, + "layers":[ + {"$GMImageLayer":"","%Name":"11b4c573-f844-42a2-905a-d6dace60762b","blendMode":0,"displayName":"default","isLocked":false,"name":"11b4c573-f844-42a2-905a-d6dace60762b","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,}, + ], + "name":"spr_weapon_shotgun", + "nineSlice":{ + "$GMNineSliceData":"", + "bottom":0, + "enabled":false, + "guideColour":[4294902015,4294902015,4294902015,4294902015,], + "highlightColour":1728023040, + "highlightStyle":0, + "left":0, + "resourceType":"GMNineSliceData", + "resourceVersion":"2.0", + "right":0, + "tileMode":[ + 0, + 0, + 0, + 0, + 0, + ], + "top":0, + }, + "origin":0, + "parent":{ + "name":"ranged", + "path":"folders/Sprites/Marine Viewer/weapons/ranged.yy", + }, + "preMultiplyAlpha":false, + "resourceType":"GMSprite", + "resourceVersion":"2.0", + "sequence":{ + "$GMSequence":"v1", + "%Name":"spr_weapon_shotgun", + "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_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