diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 778082fc46a4..48a9cabd5330 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -348,7 +348,7 @@ FORENSIC SCANNER holder = E.reagents for(var/obj/container in E.containers) scan(container) - else if(istype(O,/obj/item/ammo_magazine/rocket/custom)) + else if(istype(O, /obj/item/ammo_magazine/rocket/custom)) var/obj/item/ammo_magazine/rocket/custom/E = O if(!E.warhead) to_chat(user, SPAN_NOTICE("No warhead detected in [E].")) @@ -356,7 +356,7 @@ FORENSIC SCANNER holder = E.warhead.reagents for(var/obj/container in E.warhead.containers) scan(container) - else if(istype(O,/obj/item/mortar_shell/custom)) + else if(istype(O, /obj/item/mortar_shell/custom)) var/obj/item/mortar_shell/custom/E = O if(!E.warhead) to_chat(user, SPAN_NOTICE("No warhead detected in [E].")) @@ -364,6 +364,20 @@ FORENSIC SCANNER holder = E.warhead.reagents for(var/obj/container in E.warhead.containers) scan(container) + else if(istype(O, /obj/structure/ship_ammo/rocket/custom_missile)) + var/obj/structure/ship_ammo/rocket/custom_missile/missile = O + if (length(missile.containers) < 1) + to_chat(user, SPAN_NOTICE("No containers detected in [missile].")) + return + + var/obj/item/explosive/temp = new() //this is kinda janky + temp.create_reagents(1000) + for(var/limit in temp.reaction_limits) + temp.reagents.vars[limit] = missile.reaction_limits[limit] + holder = temp.reagents + + for(var/obj/container in missile.containers) + scan(container) else scan(O) if(O.reagents) diff --git a/code/modules/cm_marines/dropship_ammo.dm b/code/modules/cm_marines/dropship_ammo.dm index 7a07891faa94..7cb7d95c1bdf 100644 --- a/code/modules/cm_marines/dropship_ammo.dm +++ b/code/modules/cm_marines/dropship_ammo.dm @@ -292,6 +292,96 @@ addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(cell_explosion), impact, 300, 40, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, create_cause_data(initial(name)), source_mob), 0.5 SECONDS) //Your standard HE splash damage rocket. Good damage, good range, good speed, it's an all rounder QDEL_IN(src, 0.5 SECONDS) +/obj/structure/ship_ammo/rocket/custom_missile + name = "\improper AIM-224B-C 'Widowmaker Custom'" + desc = "A modified version of the AIM-224B missile, allows for custom reagent mix to be inserted in the receptacle" + icon_state = "custom_missile" + ammo_name = "rocket" + travelling_time = 40 + point_cost = 350 + fire_mission_delay = 0 //direct bombard only + /// the limits of the custom missile + var/list/reaction_limits = list( "max_ex_power" = 300, "base_ex_falloff" = 60, "max_ex_shards" = 128, + "max_fire_rad" = 8, "max_fire_int" = 60, "max_fire_dur" = 48, + "min_fire_rad" = 3, "min_fire_int" = 5, "min_fire_dur" = 5 + ) + /// current assembly state of the missile + var/assembly_stage = ASSEMBLY_UNLOCKED + /// the maximum volume allowed in the rocket + var/max_container_volume = 300 + /// the current total volume + var/current_container_volume = 0 + /// the containers inside the rocket + var/list/obj/item/reagent_container/glass/containers = list() + var/list/allowed_containers = list(/obj/item/reagent_container/glass/beaker, /obj/item/reagent_container/glass/bucket, /obj/item/reagent_container/glass/bottle, /obj/item/reagent_container/glass/bucket/mopbucket) + +/obj/structure/ship_ammo/rocket/custom_missile/attackby(obj/item/item as obj, mob/user as mob) + if(HAS_TRAIT(item, TRAIT_TOOL_SCREWDRIVER)) + if(assembly_stage == ASSEMBLY_UNLOCKED) + to_chat(user, SPAN_NOTICE("You lock the [name].")) + playsound(loc, 'sound/items/Screwdriver.ogg', 25, 0, 6) + assembly_stage = ASSEMBLY_LOCKED + icon_state = "custom_missile_ready" + else if(assembly_stage == ASSEMBLY_LOCKED) + to_chat(user, SPAN_NOTICE("You unlock the [name].")) + playsound(loc, 'sound/items/Screwdriver.ogg', 25, 0, 6) + assembly_stage = ASSEMBLY_UNLOCKED + icon_state = "custom_missile" + else if(is_type_in_list(item, allowed_containers) && (!assembly_stage || assembly_stage == ASSEMBLY_UNLOCKED)) + if(current_container_volume >= max_container_volume) + to_chat(user, SPAN_DANGER("The [name] can not hold more containers.")) + else + if(item.reagents.total_volume) + if(item.reagents.maximum_volume + current_container_volume > max_container_volume) + to_chat(user, SPAN_DANGER("\the [item] is too large for [name].")) + return + if(user.temp_drop_inv_item(item)) + to_chat(user, SPAN_NOTICE("You add \the [item] to the [name].")) + item.forceMove(src) + containers += item + current_container_volume += item.reagents.maximum_volume + assembly_stage = ASSEMBLY_UNLOCKED + else + to_chat(user, SPAN_DANGER("\the [item] is empty.")) + else if(HAS_TRAIT(item, TRAIT_TOOL_CROWBAR)) + if(assembly_stage == ASSEMBLY_UNLOCKED) + if(!length(containers)) + to_chat(user, SPAN_DANGER("\the [name] has no containers.")) + return + for(var/obj/container in containers) + containers -= container + user.put_in_hands(container) + current_container_volume = 0 + else return ..() + +/obj/structure/ship_ammo/rocket/custom_missile/get_examine_text(mob/user) + . = ..() + . += SPAN_NOTICE("Contains [containers.len] container\s.") + switch(assembly_stage) + if(ASSEMBLY_LOCKED) + . += SPAN_NOTICE("It is ready.") + if(ASSEMBLY_UNLOCKED) + . += SPAN_NOTICE("It is unlocked.") + +/obj/structure/ship_ammo/rocket/custom_missile/detonate_on(turf/impact, obj/structure/dropship_equipment/weapon/fired_from) + if(assembly_stage == ASSEMBLY_UNLOCKED || containers.len == 0) //shitty explosion if left unlocked or no containers + impact.ceiling_debris_check(3) + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(cell_explosion), impact, 60, 30, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, create_cause_data(initial(name)), source_mob), 0.5 SECONDS) + else if(assembly_stage == ASSEMBLY_LOCKED) + impact.ceiling_debris_check(3) + var/obj/item/explosive/bomb = new() + bomb.create_reagents(1000) + for(var/limit in bomb.reaction_limits) + bomb.reagents.vars[limit] = reaction_limits[limit] + for(var/obj/container in containers) + container.forceMove(bomb) + bomb.containers += container + bomb.forceMove(impact) + bomb.allow_star_shape = FALSE + bomb.cause_data = create_cause_data(initial(name), source_mob) + bomb.prime(TRUE) + QDEL_IN(src, 0.5 SECONDS) + /obj/structure/ship_ammo/rocket/banshee name = "\improper AGM-227 'Banshee'" desc = "The AGM-227 missile is a mainstay of the overhauled dropship fleet against any mobile or armored ground targets. It's earned the nickname of 'Banshee' from the sudden wail that it emits right before hitting a target. Useful to clear out large areas. Can be loaded into the LAU-444 Guided Missile Launcher." diff --git a/code/modules/cm_marines/dropship_equipment.dm b/code/modules/cm_marines/dropship_equipment.dm index f5865c05bbd4..e035de33ac6f 100644 --- a/code/modules/cm_marines/dropship_equipment.dm +++ b/code/modules/cm_marines/dropship_equipment.dm @@ -684,18 +684,26 @@ break msg_admin_niche("[key_name(user)] is direct-firing [SA] onto [selected_target] at ([target_turf.x],[target_turf.y],[target_turf.z]) [ADMIN_JMP(target_turf)]") - if(ammo_travelling_time) + + if(ammo_travelling_time && !istype(SA, /obj/structure/ship_ammo/rocket/custom_missile)) var/total_seconds = max(floor(ammo_travelling_time/10),1) - for(var/i = 0 to total_seconds) + for(var/i in 0 to total_seconds) sleep(10) if(!selected_target || !selected_target.loc)//if laser disappeared before we reached the target, ammo_accuracy_range++ //accuracy decreases // clamp back to maximum inaccuracy ammo_accuracy_range = min(ammo_accuracy_range, ammo_max_inaccuracy) - var/list/possible_turfs = RANGE_TURFS(ammo_accuracy_range, target_turf) var/turf/impact = pick(possible_turfs) + + if(ammo_travelling_time && istype(SA, /obj/structure/ship_ammo/rocket/custom_missile)) + playsound(impact, ammo_warn_sound, ammo_warn_sound_volume, 1,15) + var/total_seconds = max(floor(ammo_travelling_time/10),1) + for(var/i in 0 to total_seconds) + sleep(10) + new /obj/effect/overlay/temp/blinking_laser (impact) //no decreased accuracy if laser dissapears, it will land where it is telegraphed to land + if(ammo_warn_sound) playsound(impact, ammo_warn_sound, ammo_warn_sound_volume, 1,15) new /obj/effect/overlay/temp/blinking_laser (impact) diff --git a/icons/obj/structures/props/almayer_props64.dmi b/icons/obj/structures/props/almayer_props64.dmi index f47f19be9081..0f8d0b0d2194 100644 Binary files a/icons/obj/structures/props/almayer_props64.dmi and b/icons/obj/structures/props/almayer_props64.dmi differ