From 385a21772d81ac30cf26f3ca478a657bc18d8f1a Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Sat, 4 Jul 2015 16:39:59 +0200 Subject: [PATCH] Adds anti-photon grenades. --- baystation12.dme | 1 + .../items/devices/uplink_categories.dm | 7 ++- .../objects/items/devices/uplink_items.dm | 61 ++++++++----------- .../items/devices/uplink_random_lists.dm | 2 +- .../weapons/grenades/anti_photon_grenade.dm | 23 +++++++ .../objects/items/weapons/storage/boxes.dm | 27 +++++++- 6 files changed, 81 insertions(+), 40 deletions(-) create mode 100644 code/game/objects/items/weapons/grenades/anti_photon_grenade.dm diff --git a/baystation12.dme b/baystation12.dme index ba02f28f65..1aecb6137c 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -694,6 +694,7 @@ #include "code\game\objects\items\weapons\circuitboards\machinery\shieldgen.dm" #include "code\game\objects\items\weapons\circuitboards\machinery\telecomms.dm" #include "code\game\objects\items\weapons\circuitboards\machinery\unary_atmos.dm" +#include "code\game\objects\items\weapons\grenades\anti_photon_grenade.dm" #include "code\game\objects\items\weapons\grenades\chem_grenade.dm" #include "code\game\objects\items\weapons\grenades\emgrenade.dm" #include "code\game\objects\items\weapons\grenades\flashbang.dm" diff --git a/code/game/objects/items/devices/uplink_categories.dm b/code/game/objects/items/devices/uplink_categories.dm index 58737e60da..ae005022be 100644 --- a/code/game/objects/items/devices/uplink_categories.dm +++ b/code/game/objects/items/devices/uplink_categories.dm @@ -15,6 +15,9 @@ /datum/uplink_category/ammunition name = "Ammunition" +/datum/uplink_category/grenades + name = "Grenades and Thrown Objects" + /datum/uplink_category/visible_weapons name = "Highly Visible and Dangerous Weapons" @@ -36,8 +39,8 @@ /datum/uplink_category/hardsuit_modules name = "Hardsuit Modules" -/datum/uplink_category/announcements - name = "Announcements" +/datum/uplink_category/services + name = "Services" /datum/uplink_category/badassery name = "Badassery" diff --git a/code/game/objects/items/devices/uplink_items.dm b/code/game/objects/items/devices/uplink_items.dm index 60c5a2863a..2573e1befa 100644 --- a/code/game/objects/items/devices/uplink_items.dm +++ b/code/game/objects/items/devices/uplink_items.dm @@ -9,6 +9,7 @@ var/datum/uplink/uplink = new() items_assoc = list() items = init_subtypes(/datum/uplink_item) categories = init_subtypes(/datum/uplink_category) + categories = dd_sortedObjectList(categories) for(var/datum/uplink_item/item in items) if(!item.name) @@ -167,11 +168,6 @@ datum/uplink_item/dd_SortValue() /datum/uplink_item/item/visible_weapons category = /datum/uplink_category/visible_weapons -/datum/uplink_item/item/visible_weapons/emp - name = "5xEMP Grenades" - item_cost = 3 - path = /obj/item/weapon/storage/box/emps - /datum/uplink_item/item/visible_weapons/energy_sword name = "Energy Sword" item_cost = 4 @@ -452,6 +448,27 @@ datum/uplink_item/dd_SortValue() item_cost = 8 path = /obj/item/rig_module/mounted +/*********** +* Grenades * +************/ +/datum/uplink_item/item/grenades + category = /datum/uplink_category/grenades + +/datum/uplink_item/item/grenades/anti_photon + name = "5xAnti-Photon Grenades" + item_cost = 2 + path = /obj/item/weapon/storage/box/anti_photons + +/datum/uplink_item/item/grenades/emp + name = "5xEMP Grenades" + item_cost = 3 + path = /obj/item/weapon/storage/box/emps + +/datum/uplink_item/item/grenades/smoke + name = "5xSmoke Grenades" + item_cost = 2 + path = /obj/item/weapon/storage/box/smokes + /************ * Badassery * ************/ @@ -547,19 +564,19 @@ var/image/default_abstract_uplink_icon * Announcements * *****************/ /datum/uplink_item/abstract/announcements - category = /datum/uplink_category/announcements + category = /datum/uplink_category/services /datum/uplink_item/abstract/announcements/buy(var/obj/item/device/uplink/U, var/mob/user) . = ..() if(.) - log_and_message_admins("has triggered a falsified [src] announcement", user) + log_and_message_admins("has triggered a falsified [src]", user) /datum/uplink_item/abstract/announcements/fake_centcom item_cost = DEFAULT_TELECRYSTAL_AMOUNT / 2 /datum/uplink_item/abstract/announcements/fake_centcom/New() ..() - name = "[command_name()] Update" + name = "[command_name()] Update Announcement" desc = "Causes a falsified [command_name()] Update. Triggers immediately after supplying additional data." antag_roles = list(MODE_MERCENARY) @@ -581,34 +598,6 @@ var/image/default_abstract_uplink_icon command_announcement.Announce(args.["message"], args.["title"]) return 1 -/datum/uplink_item/abstract/announcements/fake_cryo - name = "Cryogenic Oversight Announcement" - desc = "Causes a falsified cryogenic message. Triggers immediately after supplying additional data." - item_cost = 1 - -/datum/uplink_item/abstract/announcements/fake_cryo/extra_args(var/mob/user) - if(!user) - return 0 - - var/real_name = input(user, "Enter the name of the occupant.", "Occupant Name.", user.name) as text|null - if(!real_name) - return 0 - - var/title = input(user, "Enter the title of the occupant.", "Occupant Title.", "Assistant") as text|null - if(!title) - return 0 - - return list("name" = real_name, "title" = title) - -/datum/uplink_item/abstract/announcements/fake_cryo/get_goods(var/obj/item/device/uplink/U, var/loc, var/mob/user, var/list/args) - if(!args) - return 0 - - var/obj/item/device/radio/intercom/announce = new /obj/item/device/radio/intercom(user) - announce.autosay("[args["name"]], [args["title"]], has entered long-term storage.", "Cryogenic Oversight") - qdel(announce) - return 1 - /datum/uplink_item/abstract/announcements/fake_ion_storm name = "Ion Storm Announcement" desc = "Interferes with the station's ion sensors. Triggers immediately upon investment." diff --git a/code/game/objects/items/devices/uplink_random_lists.dm b/code/game/objects/items/devices/uplink_random_lists.dm index 5e843388c5..8889a52d91 100644 --- a/code/game/objects/items/devices/uplink_random_lists.dm +++ b/code/game/objects/items/devices/uplink_random_lists.dm @@ -44,7 +44,7 @@ var/datum/uplink_random_selection/default_uplink_selection = new/datum/uplink_ra items += new/datum/uplink_random_item(/datum/uplink_item/item/ammo/a357) items += new/datum/uplink_random_item(/datum/uplink_item/item/visible_weapons/heavysniper, 15, 0) items += new/datum/uplink_random_item(/datum/uplink_item/item/ammo/sniperammo, 15, 0) - items += new/datum/uplink_random_item(/datum/uplink_item/item/visible_weapons/emp, 50) + items += new/datum/uplink_random_item(/datum/uplink_item/item/grenades/emp, 50) items += new/datum/uplink_random_item(/datum/uplink_item/item/visible_weapons/crossbow, 33) items += new/datum/uplink_random_item(/datum/uplink_item/item/visible_weapons/energy_sword, 75) diff --git a/code/game/objects/items/weapons/grenades/anti_photon_grenade.dm b/code/game/objects/items/weapons/grenades/anti_photon_grenade.dm new file mode 100644 index 0000000000..1613ff8800 --- /dev/null +++ b/code/game/objects/items/weapons/grenades/anti_photon_grenade.dm @@ -0,0 +1,23 @@ +/obj/item/weapon/grenade/anti_photon + desc = "An experimental device for temporarily removing light in a limited area." + name = "pgoton disruption grenade" + icon = 'icons/obj/grenade.dmi' + icon_state = "emp" + item_state = "emp" + det_time = 20 + origin_tech = list(TECH_BLUESPACE = 4, TECH_MATERIAL = 4) + +/obj/item/weapon/grenade/anti_photon/prime() + playsound(src.loc, 'sound/effects/phasein.ogg', 50, 1, 5) + set_light(10, -10, "#FFFFFF") + + var/extra_delay = rand(0,90) + + spawn(extra_delay) + spawn(200) + if(prob(10+extra_delay)) + set_light(10, 10, "#[num2hex(rand(64,255))][num2hex(rand(64,255))][num2hex(rand(64,255))]") + spawn(210) + ..() + playsound(src.loc, 'sound/effects/bang.ogg', 50, 1, 5) + qdel(src) diff --git a/code/game/objects/items/weapons/storage/boxes.dm b/code/game/objects/items/weapons/storage/boxes.dm index 95c4191622..43594ab550 100644 --- a/code/game/objects/items/weapons/storage/boxes.dm +++ b/code/game/objects/items/weapons/storage/boxes.dm @@ -298,6 +298,31 @@ new /obj/item/weapon/grenade/empgrenade(src) new /obj/item/weapon/grenade/empgrenade(src) +/obj/item/weapon/storage/box/smokes + name = "box of smoke bombs" + desc = "A box containing 5 smoke bombs." + icon_state = "flashbang" + +/obj/item/weapon/storage/box/smokes/New() + ..() + new /obj/item/weapon/grenade/smokebomb(src) + new /obj/item/weapon/grenade/smokebomb(src) + new /obj/item/weapon/grenade/smokebomb(src) + new /obj/item/weapon/grenade/smokebomb(src) + new /obj/item/weapon/grenade/smokebomb(src) + +/obj/item/weapon/storage/box/anti_photons + name = "box of anti-photon grenades" + desc = "A box containing 5 experimental anti-photon grenades." + icon_state = "flashbang" + +/obj/item/weapon/storage/box/anti_photon/New() + ..() + new /obj/item/weapon/grenade/anti_photon(src) + new /obj/item/weapon/grenade/anti_photon(src) + new /obj/item/weapon/grenade/anti_photon(src) + new /obj/item/weapon/grenade/anti_photon(src) + new /obj/item/weapon/grenade/anti_photon(src) /obj/item/weapon/storage/box/trackimp name = "boxed tracking implant kit" @@ -638,4 +663,4 @@ max_w_class = 3 can_hold = list(/obj/item/organ, /obj/item/weapon/reagent_containers/food, /obj/item/weapon/reagent_containers/glass) max_storage_space = 21 - use_to_pickup = 1 // for picking up broken bulbs, not that most people will try + use_to_pickup = 1 // for picking up broken bulbs, not that most people will try