From c2bc05a7998d44f4e1a4832baa6b1ff4d50cca01 Mon Sep 17 00:00:00 2001 From: KorPhaeron Date: Thu, 17 Dec 2015 06:54:21 -0600 Subject: [PATCH 1/6] Reinforcements for nuke ops --- code/datums/mind.dm | 4 +- code/datums/uplink_item.dm | 9 +++ code/game/gamemodes/antag_spawner.dm | 83 +++++++++++++++++++------- code/game/gamemodes/nuclear/nuclear.dm | 22 ++++--- 4 files changed, 89 insertions(+), 29 deletions(-) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index e68c5d08c52..6955ae2e902 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -1332,7 +1332,7 @@ ticker.mode.finalize_traitor(src) ticker.mode.greet_traitor(src) -/datum/mind/proc/make_Nuke(turf/spawnloc,nuke_code,leader=0) +/datum/mind/proc/make_Nuke(turf/spawnloc,nuke_code,leader=0, telecrystals = TRUE) if(!(src in ticker.mode.syndicates)) ticker.mode.syndicates += src ticker.mode.update_synd_icons_added(src) @@ -1353,7 +1353,7 @@ qdel(H.wear_suit) qdel(H.w_uniform) - ticker.mode.equip_syndicate(current) + ticker.mode.equip_syndicate(current, telecrystals) if (nuke_code) store_memory("Syndicate Nuclear Bomb Code: [nuke_code]", 0, 0) diff --git a/code/datums/uplink_item.dm b/code/datums/uplink_item.dm index a7bad24bddc..68f8238c6c3 100644 --- a/code/datums/uplink_item.dm +++ b/code/datums/uplink_item.dm @@ -259,6 +259,15 @@ var/list/uplink_items = list() if(istype(T)) T.TC_cost = cost + +/datum/uplink_item/dangerous/reinforcement + name = "Reinforcements" + desc = "Call in an additional team member. They won't come with any gear, so you'll have to save some telecrystals to arm them as well." + item = /obj/item/weapon/antag_spawner/borg_tele/operative + cost = 30 + gamemodes = list(/datum/game_mode/nuclear) + surplus = 0 + /datum/uplink_item/dangerous/guardian name = "Holoparasites" desc = "Though capable of near sorcerous feats via use of hardlight holograms and nanomachines, they require an organic host as a home base and source of fuel." diff --git a/code/game/gamemodes/antag_spawner.dm b/code/game/gamemodes/antag_spawner.dm index 77f14f919f3..ef64eeafd3a 100644 --- a/code/game/gamemodes/antag_spawner.dm +++ b/code/game/gamemodes/antag_spawner.dm @@ -1,3 +1,6 @@ +#define BORG_TELE 1 +#define HUMAN_TELE 2 + /obj/item/weapon/antag_spawner throw_speed = 1 throw_range = 5 @@ -10,6 +13,9 @@ /obj/item/weapon/antag_spawner/proc/equip_antag(mob/target) return + +///////////WIZARD + /obj/item/weapon/antag_spawner/contract name = "contract" desc = "A magic contract previously signed by an apprentice. In exchange for instruction in the magical arts, they are bound to answer your call for aid." @@ -119,6 +125,14 @@ target.equip_to_slot_or_del(new /obj/item/weapon/storage/box(target), slot_in_backpack) target.equip_to_slot_or_del(new /obj/item/weapon/teleportation_scroll/apprentice(target), slot_r_store) + + + + + +///////////BORGS AND OPERATIVES + + /obj/item/weapon/antag_spawner/borg_tele name = "syndicate cyborg teleporter" desc = "A single-use teleporter designed to deploy a single Syndicate cyborg onto the field." @@ -127,6 +141,7 @@ var/TC_cost = 0 var/borg_to_spawn var/list/possible_types = list("Assault", "Medical") + var/spawn_type = BORG_TELE /obj/item/weapon/antag_spawner/borg_tele/attack_self(mob/user) if(used) @@ -135,35 +150,59 @@ if(!(user.mind in ticker.mode.syndicates)) user << "AUTHENTICATION FAILURE. ACCESS DENIED." return 0 - borg_to_spawn = input("What type?", "Cyborg Type", type) as null|anything in possible_types - if(!borg_to_spawn) - return + + if(spawn_type == BORG_TELE) + borg_to_spawn = input("What type?", "Cyborg Type", type) as null|anything in possible_types + if(!borg_to_spawn) + return var/list/borg_candicates = get_candidates(ROLE_OPERATIVE, 3000, "operative") if(borg_candicates.len > 0) used = 1 var/client/C = pick(borg_candicates) spawn_antag(C, get_turf(src.loc), "syndieborg") + var/datum/effect_system/spark_spread/S = new /datum/effect_system/spark_spread + S.set_up(4, 1, src) + S.start() else user << "Unable to connect to Syndicate command. Please wait and try again later or use the teleporter on your uplink to get your points refunded." /obj/item/weapon/antag_spawner/borg_tele/spawn_antag(client/C, turf/T, type = "") - if(!borg_to_spawn) //If there's no type at all, let it still be used but don't do anything - used = 0 - return - var/datum/effect_system/spark_spread/S = new /datum/effect_system/spark_spread - S.set_up(4, 1, src) - S.start() - var/mob/living/silicon/robot/R - switch(borg_to_spawn) - if("Medical") - R = new /mob/living/silicon/robot/syndicate/medical(T) - else - R = new /mob/living/silicon/robot/syndicate(T) //Assault borg by default - R.key = C.key - ticker.mode.syndicates += R.mind - ticker.mode.update_synd_icons_added(R.mind) - R.mind.special_role = "syndicate" - R.faction = list("syndicate") + switch(spawn_type) + if(BORG_TELE) + var/mob/living/silicon/robot/R + switch(borg_to_spawn) + if("Medical") + R = new /mob/living/silicon/robot/syndicate/medical(T) + else + R = new /mob/living/silicon/robot/syndicate(T) //Assault borg by default + R.key = C.key + ticker.mode.syndicates += R.mind + ticker.mode.update_synd_icons_added(R.mind) + R.mind.special_role = "syndicate" + R.faction = list("syndicate") + if(HUMAN_TELE) + var/nuke_code = "Ask your leader!" + var/mob/living/carbon/human/M = new/mob/living/carbon/human(T) + C.prefs.copy_to(M) + M.key = C.key + var/obj/machinery/nuclearbomb/nuke = locate("syndienuke") in nuke_list + if(nuke) + nuke.r_code = nuke_code + M.mind.make_Nuke(T, nuke_code, 0, FALSE) + + +/obj/item/weapon/antag_spawner/borg_tele/operative + name = "syndicate operative teleporter" + desc = "A single-use teleporter designed to quickly reinforce operatives in the field.." + icon = 'icons/obj/device.dmi' + icon_state = "locator" + spawn_type = HUMAN_TELE + + + + + +///////////SLAUGHTER DEMON /obj/item/weapon/antag_spawner/slaughter_demon //Warning edgiest item in the game @@ -212,3 +251,7 @@ S << "You are currently not currently in the same plane of existence as the station. Ctrl+Click a blood pool to manifest." S << "Objective #[1]: [new_objective.explanation_text]" S << "Objective #[2]: [new_objective2.explanation_text]" + + +#undef BORG_TELE +#undef HUMAN_TELE \ No newline at end of file diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm index 1b49780d386..da015bfe940 100644 --- a/code/game/gamemodes/nuclear/nuclear.dm +++ b/code/game/gamemodes/nuclear/nuclear.dm @@ -160,8 +160,11 @@ return 1337 // WHY??? -- Doohl -/datum/game_mode/proc/equip_syndicate(mob/living/carbon/human/synd_mob) - synd_mob.equipOutfit(/datum/outfit/syndicate) +/datum/game_mode/proc/equip_syndicate(mob/living/carbon/human/synd_mob, telecrystals = TRUE) + if(telecrystals) + synd_mob.equipOutfit(/datum/outfit/syndicate) + else + synd_mob.equipOutfit(/datum/outfit/syndicate/no_crystals) return 1 @@ -305,16 +308,21 @@ var/tc = 20 +/datum/outfit/syndicate/no_crystals + tc = 0 + + /datum/outfit/syndicate/post_equip(mob/living/carbon/human/H) var/obj/item/device/radio/R = H.ears R.set_frequency(SYND_FREQ) R.freqlock = 1 - var/obj/item/device/radio/uplink/U = new /obj/item/device/radio/uplink(H) - U.hidden_uplink.uplink_owner="[H.key]" - U.hidden_uplink.uses = tc - U.hidden_uplink.mode_override = /datum/game_mode/nuclear //Goodies - H.equip_to_slot_or_del(U, slot_in_backpack) + if(tc) + var/obj/item/device/radio/uplink/U = new /obj/item/device/radio/uplink(H) + U.hidden_uplink.uplink_owner="[H.key]" + U.hidden_uplink.uses = tc + U.hidden_uplink.mode_override = /datum/game_mode/nuclear //Goodies + H.equip_to_slot_or_del(U, slot_in_backpack) var/obj/item/weapon/implant/weapons_auth/W = new/obj/item/weapon/implant/weapons_auth(H) W.implant(H) From 726bea04f045669f83373b2159b720edc8af4f3c Mon Sep 17 00:00:00 2001 From: KorPhaeron Date: Thu, 17 Dec 2015 06:56:39 -0600 Subject: [PATCH 2/6] 25 tc --- code/datums/uplink_item.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/uplink_item.dm b/code/datums/uplink_item.dm index 68f8238c6c3..650ddd3ea71 100644 --- a/code/datums/uplink_item.dm +++ b/code/datums/uplink_item.dm @@ -264,7 +264,7 @@ var/list/uplink_items = list() name = "Reinforcements" desc = "Call in an additional team member. They won't come with any gear, so you'll have to save some telecrystals to arm them as well." item = /obj/item/weapon/antag_spawner/borg_tele/operative - cost = 30 + cost = 25 gamemodes = list(/datum/game_mode/nuclear) surplus = 0 From 95b5829cdeb6a6c384d8180f8b1ba7e6e2fdb29e Mon Sep 17 00:00:00 2001 From: KorPhaeron Date: Thu, 17 Dec 2015 12:55:35 -0600 Subject: [PATCH 3/6] Fixes potential spawn exploits --- code/game/gamemodes/antag_spawner.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/game/gamemodes/antag_spawner.dm b/code/game/gamemodes/antag_spawner.dm index ef64eeafd3a..1810b477d99 100644 --- a/code/game/gamemodes/antag_spawner.dm +++ b/code/game/gamemodes/antag_spawner.dm @@ -150,7 +150,9 @@ if(!(user.mind in ticker.mode.syndicates)) user << "AUTHENTICATION FAILURE. ACCESS DENIED." return 0 - + if(user.z != ZLEVEL_CENTCOM) + user << "[src] is out of range! It can only be used at your base!" + return if(spawn_type == BORG_TELE) borg_to_spawn = input("What type?", "Cyborg Type", type) as null|anything in possible_types if(!borg_to_spawn) @@ -254,4 +256,4 @@ #undef BORG_TELE -#undef HUMAN_TELE \ No newline at end of file +#undef HUMAN_TELE From 86a983d361075032a17b08d23c4564d3c495cff8 Mon Sep 17 00:00:00 2001 From: KorPhaeron Date: Fri, 18 Dec 2015 17:42:49 -0600 Subject: [PATCH 4/6] OOP --- code/datums/uplink_item.dm | 6 +- code/game/gamemodes/antag_spawner.dm | 100 +++++++++++---------- code/game/objects/items/devices/uplinks.dm | 4 +- 3 files changed, 59 insertions(+), 51 deletions(-) diff --git a/code/datums/uplink_item.dm b/code/datums/uplink_item.dm index 650ddd3ea71..b143b40d1cb 100644 --- a/code/datums/uplink_item.dm +++ b/code/datums/uplink_item.dm @@ -248,14 +248,14 @@ var/list/uplink_items = list() /datum/uplink_item/dangerous/syndieborg name = "Syndicate Cyborg" desc = "A cyborg designed and programmed for systematic extermination of non-Syndicate personnel." - item = /obj/item/weapon/antag_spawner/borg_tele + item = /obj/item/weapon/antag_spawner/nuke_ops/borg_tele cost = 50 gamemodes = list(/datum/game_mode/nuclear) surplus = 0 //for refunding the syndieborg teleporter /datum/uplink_item/dangerous/syndieborg/spawn_item() - var/obj/item/weapon/antag_spawner/borg_tele/T = ..() + var/obj/item/weapon/antag_spawner/nuke_ops/T = ..() if(istype(T)) T.TC_cost = cost @@ -263,7 +263,7 @@ var/list/uplink_items = list() /datum/uplink_item/dangerous/reinforcement name = "Reinforcements" desc = "Call in an additional team member. They won't come with any gear, so you'll have to save some telecrystals to arm them as well." - item = /obj/item/weapon/antag_spawner/borg_tele/operative + item = /obj/item/weapon/antag_spawner/nuke_ops cost = 25 gamemodes = list(/datum/game_mode/nuclear) surplus = 0 diff --git a/code/game/gamemodes/antag_spawner.dm b/code/game/gamemodes/antag_spawner.dm index 1810b477d99..c32244b01e1 100644 --- a/code/game/gamemodes/antag_spawner.dm +++ b/code/game/gamemodes/antag_spawner.dm @@ -1,6 +1,3 @@ -#define BORG_TELE 1 -#define HUMAN_TELE 2 - /obj/item/weapon/antag_spawner throw_speed = 1 throw_range = 5 @@ -133,34 +130,36 @@ ///////////BORGS AND OPERATIVES -/obj/item/weapon/antag_spawner/borg_tele - name = "syndicate cyborg teleporter" - desc = "A single-use teleporter designed to deploy a single Syndicate cyborg onto the field." +/obj/item/weapon/antag_spawner/nuke_ops + name = "syndicate operative teleporter" + desc = "A single-use teleporter designed to quickly reinforce operatives in the field." icon = 'icons/obj/device.dmi' icon_state = "locator" var/TC_cost = 0 var/borg_to_spawn var/list/possible_types = list("Assault", "Medical") - var/spawn_type = BORG_TELE -/obj/item/weapon/antag_spawner/borg_tele/attack_self(mob/user) +/obj/item/weapon/antag_spawner/nuke_ops/proc/check_usability(mob/user) if(used) user << "[src] is out of power!" - return + return 0 if(!(user.mind in ticker.mode.syndicates)) user << "AUTHENTICATION FAILURE. ACCESS DENIED." return 0 if(user.z != ZLEVEL_CENTCOM) user << "[src] is out of range! It can only be used at your base!" + return 0 + return 1 + + +/obj/item/weapon/antag_spawner/nuke_ops/attack_self(mob/user) + if(!(check_usability(user))) return - if(spawn_type == BORG_TELE) - borg_to_spawn = input("What type?", "Cyborg Type", type) as null|anything in possible_types - if(!borg_to_spawn) - return - var/list/borg_candicates = get_candidates(ROLE_OPERATIVE, 3000, "operative") - if(borg_candicates.len > 0) + + var/list/nuke_candidates = get_candidates(ROLE_OPERATIVE, 3000, "operative") + if(nuke_candidates.len > 0) used = 1 - var/client/C = pick(borg_candicates) + var/client/C = pick(nuke_candidates) spawn_antag(C, get_turf(src.loc), "syndieborg") var/datum/effect_system/spark_spread/S = new /datum/effect_system/spark_spread S.set_up(4, 1, src) @@ -168,37 +167,50 @@ else user << "Unable to connect to Syndicate command. Please wait and try again later or use the teleporter on your uplink to get your points refunded." -/obj/item/weapon/antag_spawner/borg_tele/spawn_antag(client/C, turf/T, type = "") - switch(spawn_type) - if(BORG_TELE) - var/mob/living/silicon/robot/R - switch(borg_to_spawn) - if("Medical") - R = new /mob/living/silicon/robot/syndicate/medical(T) - else - R = new /mob/living/silicon/robot/syndicate(T) //Assault borg by default - R.key = C.key - ticker.mode.syndicates += R.mind - ticker.mode.update_synd_icons_added(R.mind) - R.mind.special_role = "syndicate" - R.faction = list("syndicate") - if(HUMAN_TELE) - var/nuke_code = "Ask your leader!" - var/mob/living/carbon/human/M = new/mob/living/carbon/human(T) - C.prefs.copy_to(M) - M.key = C.key - var/obj/machinery/nuclearbomb/nuke = locate("syndienuke") in nuke_list - if(nuke) - nuke.r_code = nuke_code - M.mind.make_Nuke(T, nuke_code, 0, FALSE) +/obj/item/weapon/antag_spawner/nuke_ops/spawn_antag(client/C, turf/T) + var/nuke_code = "Ask your leader!" + var/mob/living/carbon/human/M = new/mob/living/carbon/human(T) + C.prefs.copy_to(M) + M.key = C.key + var/obj/machinery/nuclearbomb/nuke = locate("syndienuke") in nuke_list + if(nuke) + nuke.r_code = nuke_code + M.mind.make_Nuke(T, nuke_code, 0, FALSE) -/obj/item/weapon/antag_spawner/borg_tele/operative - name = "syndicate operative teleporter" + + + +//////SYNDICATE BORG + +/obj/item/weapon/antag_spawner/nuke_ops/borg_tele + name = "syndicate cyborg teleporter" desc = "A single-use teleporter designed to quickly reinforce operatives in the field.." icon = 'icons/obj/device.dmi' icon_state = "locator" - spawn_type = HUMAN_TELE + + +/obj/item/weapon/antag_spawner/nuke_ops/borg_tele/attack_self(mob/user) + borg_to_spawn = input("What type?", "Cyborg Type", type) as null|anything in possible_types + if(!borg_to_spawn) + return + ..() + +/obj/item/weapon/antag_spawner/nuke_ops/borg_tele/spawn_antag(client/C, turf/T) + var/mob/living/silicon/robot/R + switch(borg_to_spawn) + if("Medical") + R = new /mob/living/silicon/robot/syndicate/medical(T) + else + R = new /mob/living/silicon/robot/syndicate(T) //Assault borg by default + R.key = C.key + ticker.mode.syndicates += R.mind + ticker.mode.update_synd_icons_added(R.mind) + R.mind.special_role = "syndicate" + R.faction = list("syndicate") + + + @@ -253,7 +265,3 @@ S << "You are currently not currently in the same plane of existence as the station. Ctrl+Click a blood pool to manifest." S << "Objective #[1]: [new_objective.explanation_text]" S << "Objective #[2]: [new_objective2.explanation_text]" - - -#undef BORG_TELE -#undef HUMAN_TELE diff --git a/code/game/objects/items/devices/uplinks.dm b/code/game/objects/items/devices/uplinks.dm index de4801caf63..d60f5efddd1 100644 --- a/code/game/objects/items/devices/uplinks.dm +++ b/code/game/objects/items/devices/uplinks.dm @@ -175,8 +175,8 @@ var/list/world_uplinks = list() return 0 //Refund proc for the borg teleporter (later I'll make a general refund proc if there is demand for it) /obj/item/device/radio/uplink/attackby(obj/item/weapon/W, mob/user, params) - if(istype(W, /obj/item/weapon/antag_spawner/borg_tele)) - var/obj/item/weapon/antag_spawner/borg_tele/S = W + if(istype(W, /obj/item/weapon/antag_spawner/nuke_ops)) + var/obj/item/weapon/antag_spawner/nuke_ops/S = W if(!S.used) hidden_uplink.uses += S.TC_cost qdel(S) From c3195d19d4edaddb1a2503b9e01514ccbe5b8742 Mon Sep 17 00:00:00 2001 From: KorPhaeron Date: Fri, 18 Dec 2015 18:10:26 -0600 Subject: [PATCH 5/6] Refunds --- code/datums/uplink_item.dm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/datums/uplink_item.dm b/code/datums/uplink_item.dm index b143b40d1cb..7f3419d62cc 100644 --- a/code/datums/uplink_item.dm +++ b/code/datums/uplink_item.dm @@ -255,7 +255,7 @@ var/list/uplink_items = list() //for refunding the syndieborg teleporter /datum/uplink_item/dangerous/syndieborg/spawn_item() - var/obj/item/weapon/antag_spawner/nuke_ops/T = ..() + var/obj/item/weapon/antag_spawner/nuke_ops/borg_tele/T = ..() if(istype(T)) T.TC_cost = cost @@ -267,6 +267,12 @@ var/list/uplink_items = list() cost = 25 gamemodes = list(/datum/game_mode/nuclear) surplus = 0 + +/datum/uplink_item/dangerous/reinforcement/spawn_item() + var/obj/item/weapon/antag_spawner/nuke_ops/T = ..() + if(istype(T)) + T.TC_cost = cost + /datum/uplink_item/dangerous/guardian name = "Holoparasites" From 20daeabf9e3e5beded31bec64c7005914956df4c Mon Sep 17 00:00:00 2001 From: KorPhaeron Date: Fri, 18 Dec 2015 18:26:44 -0600 Subject: [PATCH 6/6] Proper refunds --- code/datums/uplink_item.dm | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/code/datums/uplink_item.dm b/code/datums/uplink_item.dm index 7f3419d62cc..1dceb3c61f6 100644 --- a/code/datums/uplink_item.dm +++ b/code/datums/uplink_item.dm @@ -245,7 +245,7 @@ var/list/uplink_items = list() gamemodes = list(/datum/game_mode/nuclear) surplus = 0 -/datum/uplink_item/dangerous/syndieborg +/datum/uplink_item/dangerous/reinforcement/syndieborg name = "Syndicate Cyborg" desc = "A cyborg designed and programmed for systematic extermination of non-Syndicate personnel." item = /obj/item/weapon/antag_spawner/nuke_ops/borg_tele @@ -253,13 +253,6 @@ var/list/uplink_items = list() gamemodes = list(/datum/game_mode/nuclear) surplus = 0 -//for refunding the syndieborg teleporter -/datum/uplink_item/dangerous/syndieborg/spawn_item() - var/obj/item/weapon/antag_spawner/nuke_ops/borg_tele/T = ..() - if(istype(T)) - T.TC_cost = cost - - /datum/uplink_item/dangerous/reinforcement name = "Reinforcements" desc = "Call in an additional team member. They won't come with any gear, so you'll have to save some telecrystals to arm them as well."