diff --git a/aurorastation.dme b/aurorastation.dme index 028809f5b58..08934079824 100644 --- a/aurorastation.dme +++ b/aurorastation.dme @@ -2678,6 +2678,7 @@ #include "code\modules\overmap\ship_weaponry\weaponry\coilgun.dm" #include "code\modules\overmap\ship_weaponry\weaponry\francisca.dm" #include "code\modules\overmap\ship_weaponry\weaponry\grauwolf.dm" +#include "code\modules\overmap\ship_weaponry\weaponry\grauwolf_probe.dm" #include "code\modules\overmap\ship_weaponry\weaponry\lammergeier.dm" #include "code\modules\overmap\ship_weaponry\weaponry\leviathan.dm" #include "code\modules\overmap\ship_weaponry\weaponry\longbow.dm" diff --git a/code/__defines/ship_weapons.dm b/code/__defines/ship_weapons.dm index 9be52c8ebb8..9f8a4c5118e 100644 --- a/code/__defines/ship_weapons.dm +++ b/code/__defines/ship_weapons.dm @@ -18,6 +18,7 @@ #define SHIP_AMMO_CAN_HIT_PLANETS 4 #define SHIP_AMMO_IMPACT_HE "high explosive" +#define SHIP_AMMO_IMPACT_PROBE "sensor probe" #define SHIP_AMMO_IMPACT_FMJ "full metal jacket" #define SHIP_AMMO_IMPACT_AP "armour-piercing" #define SHIP_AMMO_IMPACT_LASER "laser" @@ -52,4 +53,4 @@ //Targeting flags for overmap effects. #define TARGETING_FLAG_GENERIC_WAYPOINTS 1 -#define TARGETING_FLAG_ENTRYPOINTS 2 \ No newline at end of file +#define TARGETING_FLAG_ENTRYPOINTS 2 diff --git a/code/modules/overmap/ship_weaponry/_ship_ammunition.dm b/code/modules/overmap/ship_weaponry/_ship_ammunition.dm index 72bfd5fd539..7a4d376139e 100644 --- a/code/modules/overmap/ship_weaponry/_ship_ammunition.dm +++ b/code/modules/overmap/ship_weaponry/_ship_ammunition.dm @@ -7,6 +7,7 @@ slowdown = 2 drop_sound = 'sound/items/drop/shell_drop.ogg' var/projectile_type_override //Override projectile type fired by the gun. This is because certain guns don't use ammo (the Leviathan) but with some we want the ammo to matter. + var/overmap_projectile_type_override //Override projectile type on the overmap, fired by the gun. Like the Grauwolf Probe. var/name_override //If set, this will override the ammunition name for the overmap effect. var/written_message var/wielded = FALSE @@ -173,7 +174,12 @@ if(!start_object) return FALSE - var/obj/effect/overmap/projectile/P = new(null, start_object.x, start_object.y) + var/obj/effect/overmap/projectile/P = null + if(overmap_projectile_type_override) + P = new overmap_projectile_type_override(null, start_object.x, start_object.y, origin) + else + P = new(null, start_object.x, start_object.y, origin) + P.name = name_override ? name_override : name P.desc = desc P.ammunition = src diff --git a/code/modules/overmap/ship_weaponry/weaponry/grauwolf_probe.dm b/code/modules/overmap/ship_weaponry/weaponry/grauwolf_probe.dm new file mode 100644 index 00000000000..18384c031bf --- /dev/null +++ b/code/modules/overmap/ship_weaponry/weaponry/grauwolf_probe.dm @@ -0,0 +1,92 @@ +/obj/item/ship_ammunition/grauwolf_probe + name = "grauwolf sensor probe" + desc = "A gun-launched sensor probe, used to scan the area around and relay findings using the datalink." + icon = 'icons/obj/guns/ship/grauwolfprobe.dmi' + icon_state = "probe_2" + overmap_icon_state = "missle_probe" + caliber = SHIP_CALIBER_90MM + ammunition_behaviour = SHIP_AMMO_BEHAVIOUR_DUMBFIRE + impact_type = SHIP_AMMO_IMPACT_PROBE + overmap_behaviour = null // This ammo cannot hit anything + projectile_type_override = /obj/item/projectile/ship_ammo/grauwolf_probe + overmap_projectile_type_override = /obj/effect/overmap/projectile/probe + burst = 1 + +/obj/effect/overmap/projectile/probe + var/list/contacts = list() // Contacts, aka overmap effects, in view of the probe + var/scan_range = 4 // How far the probe "sees", aka how strong the radar is, aka in what radius it will reveal effects + var/obj/effect/overmap/visitable/ship/ship = null // The ship that shot us, aka the one to datalink send contacts to + speed = 40 + + icon_state = "missle_probe" + instant_contact = TRUE + requires_contact = FALSE + +/obj/effect/overmap/projectile/probe/Initialize(maploading, sx, sy, origin) + . = ..() + ship = origin + +/obj/effect/overmap/projectile/probe/Move() + + var/list/diff_contacts = contacts.Copy() //Stores the previous-cycle viewed effects that are no longer visible + + // Get a list of effects in a radius that the probe sees + contacts = list() + for(var/obj/effect/overmap/contact in view(scan_range, src)) + if(contact != ship && !(contact in ship.datalinked)) + contacts |= list(contact) + + // Compute the effects that are no longer visible, now the variable is actually a diff, be sure to not remove the ship or datalinked ships + diff_contacts -= (contacts - list(ship)) + + // Removes the contacts no longer visible + remove_lost_contacts: + for(var/obj/effect/overmap/lost_contact in diff_contacts) + for(var/obj/machinery/computer/ship/sensors/sensor_console in ship.consoles) + + // If the ship is seeing it directly, do not remove + if(lost_contact in sensor_console.objects_in_view) + continue remove_lost_contacts + + // If another ship is supplying this contact via the datalink, do not remove + for(var/obj/effect/overmap/visitable/datalinked_ship in ship.datalinked) + if(lost_contact in sensor_console.datalink_contacts[datalinked_ship]) + continue remove_lost_contacts + + sensor_console.datalink_remove_contact(lost_contact, ship) + + // Add the new ones + for(var/obj/machinery/computer/ship/sensors/sensor_console in ship.consoles) + for(var/contact in contacts) + sensor_console.datalink_add_contact(contact, ship) + . = ..() + +// /obj/effect/overmap/projectile/probe/Initialize(var/maploading, var/sx, var/sy, var/obj/effect/overmap/visitable/shooter) +// // origin = shooter +// . = ..(maploading, sx, sy, shooter) + +/obj/effect/overmap/projectile/probe/Destroy() + + remove_contacts: + for(var/obj/effect/overmap/contact in contacts) + for(var/obj/machinery/computer/ship/sensors/sensor_console in ship.consoles) + // If the ship is seeing it directly, do not remove + if(contact in sensor_console.objects_in_view) + continue remove_contacts + + // If another ship is supplying this contact via the datalink, do not remove + for(var/obj/effect/overmap/visitable/datalinked_ship in ship.datalinked) + if(contact in sensor_console.datalink_contacts[datalinked_ship]) + continue remove_contacts + + sensor_console.datalink_remove_contact(contact, ship) + . = ..() + +/obj/item/projectile/ship_ammo/grauwolf_probe + name = "sensor probe projectile" + icon_state = "small_burst" + damage = 0 + armor_penetration = 0 + penetrating = 0 + anti_materiel_potential = 0 + speed = 40 diff --git a/html/changelogs/fluffyghost-grauwolfprobe.yml b/html/changelogs/fluffyghost-grauwolfprobe.yml new file mode 100644 index 00000000000..83b5c2c5edb --- /dev/null +++ b/html/changelogs/fluffyghost-grauwolfprobe.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: FluffyGhost + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Added a grauwolf probe projectile, can reveal things in a radius, does not hit anything and possess no damage, basically a minigame to extend sensor range." diff --git a/icons/obj/guns/ship/grauwolfprobe.dmi b/icons/obj/guns/ship/grauwolfprobe.dmi new file mode 100644 index 00000000000..f52abcca891 Binary files /dev/null and b/icons/obj/guns/ship/grauwolfprobe.dmi differ diff --git a/icons/obj/guns/ship/overmap_projectiles.dmi b/icons/obj/guns/ship/overmap_projectiles.dmi index eda978ef6cb..e17139cd883 100644 Binary files a/icons/obj/guns/ship/overmap_projectiles.dmi and b/icons/obj/guns/ship/overmap_projectiles.dmi differ