Fix uplink code once and for all

Fixes #14733
This commit is contained in:
Bjorn Neergaard
2016-01-19 16:42:48 -06:00
parent 4dcbdf7717
commit 1c34479376
18 changed files with 1297 additions and 1278 deletions

View File

@@ -560,16 +560,13 @@
istype(current,/mob/living/carbon/human) ) istype(current,/mob/living/carbon/human) )
text = "Uplink: <a href='?src=\ref[src];common=uplink'>give</a>" text = "Uplink: <a href='?src=\ref[src];common=uplink'>give</a>"
var/obj/item/device/uplink/suplink = find_syndicate_uplink() var/obj/item/device/uplink/U = find_syndicate_uplink()
var/crystals if(U)
if (suplink)
crystals = suplink.uses
if (suplink)
text += "|<a href='?src=\ref[src];common=takeuplink'>take</a>" text += "|<a href='?src=\ref[src];common=takeuplink'>take</a>"
if (check_rights(R_FUN, 0)) if (check_rights(R_FUN, 0))
text += ", <a href='?src=\ref[src];common=crystals'>[crystals]</a> crystals" text += ", <a href='?src=\ref[src];common=crystals'>[U.telecrystals]</a> TC"
else else
text += ", [crystals] crystals" text += ", [U.telecrystals] TC"
text += "." //hiel grammar text += "." //hiel grammar
out += text out += text
@@ -1226,19 +1223,16 @@
memory = null//Remove any memory they may have had. memory = null//Remove any memory they may have had.
log_admin("[key_name(usr)] removed [current]'s uplink.") log_admin("[key_name(usr)] removed [current]'s uplink.")
if("crystals") if("crystals")
if (check_rights(R_FUN, 0)) if(check_rights(R_FUN, 0))
var/obj/item/device/uplink/suplink = find_syndicate_uplink() var/obj/item/device/uplink/U = find_syndicate_uplink()
var/crystals if(U)
if (suplink) var/crystals = input("Amount of telecrystals for [key]","Syndicate uplink", U.telecrystals) as null|num
crystals = suplink.uses if(!isnull(crystals))
crystals = input("Amount of telecrystals for [key]","Syndicate uplink", crystals) as null|num U.telecrystals = crystals
if (!isnull(crystals))
if (suplink)
suplink.uses = crystals
message_admins("[key_name_admin(usr)] changed [current]'s telecrystal count to [crystals].") message_admins("[key_name_admin(usr)] changed [current]'s telecrystal count to [crystals].")
log_admin("[key_name(usr)] changed [current]'s telecrystal count to [crystals].") log_admin("[key_name(usr)] changed [current]'s telecrystal count to [crystals].")
if("uplink") if("uplink")
if (!ticker.mode.equip_traitor(current, !(src in ticker.mode.traitors))) if(!ticker.mode.equip_traitor(current, !(src in ticker.mode.traitors)))
usr << "<span class='danger'>Equipping a syndicate failed!</span>" usr << "<span class='danger'>Equipping a syndicate failed!</span>"
log_admin("[key_name(usr)] attempted to give [current] an uplink.") log_admin("[key_name(usr)] attempted to give [current] an uplink.")

File diff suppressed because it is too large Load Diff

View File

@@ -159,11 +159,6 @@
obj_count++ obj_count++
return return
/datum/game_mode/proc/random_radio_frequency()
return 1337 // WHY??? -- Doohl
/datum/game_mode/proc/equip_syndicate(mob/living/carbon/human/synd_mob, telecrystals = TRUE) /datum/game_mode/proc/equip_syndicate(mob/living/carbon/human/synd_mob, telecrystals = TRUE)
if(telecrystals) if(telecrystals)
synd_mob.equipOutfit(/datum/outfit/syndicate) synd_mob.equipOutfit(/datum/outfit/syndicate)
@@ -177,7 +172,6 @@
return 1 return 1
return ..() return ..()
/datum/game_mode/proc/are_operatives_dead() /datum/game_mode/proc/are_operatives_dead()
for(var/datum/mind/operative_mind in syndicates) for(var/datum/mind/operative_mind in syndicates)
if (istype(operative_mind.current,/mob/living/carbon/human) && (operative_mind.current.stat!=2)) if (istype(operative_mind.current,/mob/living/carbon/human) && (operative_mind.current.stat!=2))
@@ -234,7 +228,7 @@
world << "<FONT size = 3><B>Crew Major Victory!</B></FONT>" world << "<FONT size = 3><B>Crew Major Victory!</B></FONT>"
world << "<B>The Research Staff has saved the disc and killed the [syndicate_name()] Operatives</B>" world << "<B>The Research Staff has saved the disc and killed the [syndicate_name()] Operatives</B>"
else if ( disk_rescued ) else if (disk_rescued)
feedback_set_details("round_end_result","loss - evacuation - disk secured") feedback_set_details("round_end_result","loss - evacuation - disk secured")
world << "<FONT size = 3><B>Crew Major Victory</B></FONT>" world << "<FONT size = 3><B>Crew Major Victory</B></FONT>"
world << "<B>The Research Staff has saved the disc and stopped the [syndicate_name()] Operatives!</B>" world << "<B>The Research Staff has saved the disc and stopped the [syndicate_name()] Operatives!</B>"
@@ -265,13 +259,13 @@
var/TC_uses = 0 var/TC_uses = 0
for(var/datum/mind/syndicate in syndicates) for(var/datum/mind/syndicate in syndicates)
text += printplayer(syndicate) text += printplayer(syndicate)
for(var/obj/item/device/uplink/H in world_uplinks) for(var/obj/item/device/uplink/H in uplinks)
if(H && H.uplink_owner && H.uplink_owner==syndicate.key) if(H && H.owner && H.owner == syndicate.key)
TC_uses += H.used_TC TC_uses += H.spent_telecrystals
purchases += H.purchase_log purchases += H.purchase_log
text += "<br>" text += "<br>"
text += "(Syndicates used [TC_uses] TC) [purchases]" text += "(Syndicates used [TC_uses] TC) [purchases]"
if(TC_uses==0 && station_was_nuked && !are_operatives_dead()) if(TC_uses == 0 && station_was_nuked && !are_operatives_dead())
text += "<BIG><IMG CLASS=icon SRC=\ref['icons/BadAss.dmi'] ICONSTATE='badass'></BIG>" text += "<BIG><IMG CLASS=icon SRC=\ref['icons/BadAss.dmi'] ICONSTATE='badass'></BIG>"
world << text world << text
return 1 return 1
@@ -322,10 +316,9 @@
R.freqlock = 1 R.freqlock = 1
if(tc) if(tc)
var/obj/item/device/radio/uplink/U = new /obj/item/device/radio/uplink(H) var/obj/item/device/radio/uplink/nuclear/U = new(H)
U.hidden_uplink.uplink_owner="[H.key]" U.hidden_uplink.owner = "[H.key]"
U.hidden_uplink.uses = tc U.hidden_uplink.telecrystals = tc
U.hidden_uplink.mode_override = /datum/game_mode/nuclear //Goodies
H.equip_to_slot_or_del(U, slot_in_backpack) 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) var/obj/item/weapon/implant/weapons_auth/W = new/obj/item/weapon/implant/weapons_auth(H)
@@ -349,8 +342,6 @@
/obj/item/weapon/tank/jetpack/oxygen/harness=1,\ /obj/item/weapon/tank/jetpack/oxygen/harness=1,\
/obj/item/weapon/pinpointer/nukeop=1) /obj/item/weapon/pinpointer/nukeop=1)
tc = 30
/datum/outfit/syndicate/full/post_equip(mob/living/carbon/human/H) /datum/outfit/syndicate/full/post_equip(mob/living/carbon/human/H)
..() ..()

View File

@@ -1,19 +1,18 @@
#define CHALLENGE_TELECRYSTALS 280
#define CHALLENGE_TIME_LIMIT 3000 #define CHALLENGE_TIME_LIMIT 3000
#define MIN_CHALLENGE_PLAYERS 50 #define CHALLENGE_MIN_PLAYERS 50
#define CHALLENGE_SHUTTLE_DELAY 15000 //25 minutes, so the ops have at least 5 minutes before the shuttle is callable. #define CHALLENGE_SHUTTLE_DELAY 15000 // 25 minutes, so the ops have at least 5 minutes before the shuttle is callable.
/obj/item/device/nuclear_challenge /obj/item/device/nuclear_challenge
name = "Declaration of War (Challenge Mode)" name = "Declaration of War (Challenge Mode)"
icon_state = "gangtool-red" icon_state = "gangtool-red"
item_state = "walkietalkie" item_state = "walkietalkie"
desc = "Use to send a declaration of hostilities to the target, delaying your shuttle departure for 20 minutes while they prepare for your assault. \ desc = "Use to send a declaration of hostilities to the target, delaying your shuttle departure for 20 minutes while they prepare for your assault. \
Such a brazen move will attract the attention of powerful benefactors within the Syndicate, who will supply your team with a massive amount of bonus telecrystals. \ Such a brazen move will attract the attention of powerful benefactors within the Syndicate, who will supply your team with a massive amount of bonus telecrystals. \
Must be used within five minutes, or your benefactors will lose interest." Must be used within five minutes, or your benefactors will lose interest."
/obj/item/device/nuclear_challenge/attack_self(mob/living/user) /obj/item/device/nuclear_challenge/attack_self(mob/living/user)
if(player_list.len < MIN_CHALLENGE_PLAYERS) if(player_list.len < CHALLENGE_MIN_PLAYERS)
user << "The enemy crew is too small to be worth declaring war on." user << "The enemy crew is too small to be worth declaring war on."
return return
if(user.z != ZLEVEL_CENTCOM) if(user.z != ZLEVEL_CENTCOM)
@@ -36,14 +35,15 @@
for(var/obj/machinery/computer/shuttle/syndicate/S in machines) for(var/obj/machinery/computer/shuttle/syndicate/S in machines)
S.challenge = TRUE S.challenge = TRUE
var/obj/item/device/radio/uplink/U = new /obj/item/device/radio/uplink(get_turf(user)) var/obj/item/device/radio/uplink/nuclear/U = new(get_turf(user))
U.hidden_uplink.uplink_owner= "[user.key]" U.hidden_uplink.owner = "[user.key]"
U.hidden_uplink.uses = 280 U.hidden_uplink.telecrystals = CHALLENGE_TELECRYSTALS
U.hidden_uplink.mode_override = /datum/game_mode/nuclear //Maybe we can have a special set of items for the challenge uplink eventually U.hidden_uplink.gamemode = /datum/game_mode/nuclear
config.shuttle_refuel_delay = max(config.shuttle_refuel_delay, CHALLENGE_SHUTTLE_DELAY) config.shuttle_refuel_delay = max(config.shuttle_refuel_delay, CHALLENGE_SHUTTLE_DELAY)
qdel(src) qdel(src)
#undef CHALLENGE_TELECRYSTALS
#undef CHALLENGE_TIME_LIMIT #undef CHALLENGE_TIME_LIMIT
#undef MIN_CHALLENGE_PLAYERS #undef CHALLENGE_MIN_PLAYERS
#undef CHALLENGE_SHUTTLE_DELAY #undef CHALLENGE_SHUTTLE_DELAY

View File

@@ -1,5 +1,4 @@
/datum/game_mode /datum/game_mode
// this includes admin-appointed traitors and multitraitors. Easy!
var/traitor_name = "traitor" var/traitor_name = "traitor"
var/list/datum/mind/traitors = list() var/list/datum/mind/traitors = list()
@@ -227,10 +226,10 @@
var/TC_uses = 0 var/TC_uses = 0
var/uplink_true = 0 var/uplink_true = 0
var/purchases = "" var/purchases = ""
for(var/obj/item/device/uplink/H in world_uplinks) for(var/obj/item/device/uplink/H in uplinks)
if(H && H.uplink_owner && H.uplink_owner==traitor.key) if(H && H.owner && H.owner == traitor.key)
TC_uses += H.used_TC TC_uses += H.spent_telecrystals
uplink_true=1 uplink_true = 1
purchases += H.purchase_log purchases += H.purchase_log
var/objectives = "" var/objectives = ""
@@ -285,48 +284,32 @@
traitor_mob << "Your training has allowed you to overcome your clownish nature, allowing you to wield weapons without harming yourself." traitor_mob << "Your training has allowed you to overcome your clownish nature, allowing you to wield weapons without harming yourself."
traitor_mob.dna.remove_mutation(CLOWNMUT) traitor_mob.dna.remove_mutation(CLOWNMUT)
// find a radio! toolbox(es), backpack, belt, headset
var/loc = "" var/loc = ""
var/obj/item/R = locate(/obj/item/device/pda) in traitor_mob.contents //Hide the uplink in a PDA if available, otherwise radio var/obj/item/I = locate(/obj/item/device/pda) in traitor_mob.contents //Hide the uplink in a PDA if available, otherwise radio
if(!R) if(!I)
R = locate(/obj/item/device/radio) in traitor_mob.contents I = locate(/obj/item/device/radio) in traitor_mob.contents
if (!R) if (!I)
traitor_mob << "Unfortunately, the Syndicate wasn't able to get you a radio." traitor_mob << "Unfortunately, the Syndicate wasn't able to get you a radio."
. = 0 . = 0
else else
if (istype(R, /obj/item/device/radio)) var/obj/item/device/uplink/U = new(I)
// generate list of radio freqs U.owner = "[traitor_mob.key]"
var/obj/item/device/radio/target_radio = R I.hidden_uplink = U
var/freq = 1441
var/list/freqlist = list()
while (freq <= 1489)
if (freq < 1451 || freq > 1459)
freqlist += freq
freq += 2
if ((freq % 2) == 0)
freq += 1
freq = freqlist[rand(1, freqlist.len)]
var/obj/item/device/uplink/T = new(R) if(istype(I, /obj/item/device/radio))
target_radio.hidden_uplink = T var/obj/item/device/radio/R = I
T.uplink_owner = "[traitor_mob.key]" R.traitor_frequency = sanitize_frequency(rand(MIN_FREQ, MAX_FREQ))
target_radio.traitor_frequency = freq
traitor_mob << "The Syndicate have cunningly disguised a Syndicate Uplink as your [R.name] [loc]. Simply dial the frequency [format_frequency(freq)] to unlock its hidden features."
traitor_mob.mind.store_memory("<B>Radio Freq:</B> [format_frequency(freq)] ([R.name] [loc]).")
else if (istype(R, /obj/item/device/pda))
// generate a passcode if the uplink is hidden in a PDA
var/pda_pass = "[rand(100,999)] [pick("Alpha","Bravo","Delta","Omega")]"
var/obj/item/device/uplink/T = new(R) traitor_mob << "The Syndicate have cunningly disguised a Syndicate Uplink as your [R.name] [loc]. Simply dial the frequency [format_frequency(R.traitor_frequency)] to unlock its hidden features."
R.hidden_uplink = T traitor_mob.mind.store_memory("<B>Radio Frequency:</B> [format_frequency(R.traitor_frequency)] ([R.name] [loc]).")
T.uplink_owner = "[traitor_mob.key]" else if(istype(I, /obj/item/device/pda))
var/obj/item/device/pda/P = R var/obj/item/device/pda/P = I
P.lock_code = pda_pass P.lock_code = "[rand(100,999)] [pick("Alpha","Bravo","Delta","Omega")]"
traitor_mob << "The Syndicate have cunningly disguised a Syndicate Uplink as your [R.name] [loc]. Simply enter the code \"[pda_pass]\" into the ringtone select to unlock its hidden features." traitor_mob << "The Syndicate have cunningly disguised a Syndicate Uplink as your [P.name] [loc]. Simply enter the code \"[P.lock_code]\" into the ringtone select to unlock its hidden features."
traitor_mob.mind.store_memory("<B>Uplink Passcode:</B> [pda_pass] ([R.name] [loc]).") traitor_mob.mind.store_memory("<B>Uplink Passcode:</B> [P.lock_code] ([P.name] [loc]).")
if(!safety)//If they are not a rev. Can be added on to. if(!safety) // If they are not a rev. Can be added on to.
give_codewords(traitor_mob) give_codewords(traitor_mob)
/datum/game_mode/proc/assign_exchange_role(datum/mind/owner) /datum/game_mode/proc/assign_exchange_role(datum/mind/owner)

View File

@@ -617,7 +617,6 @@
return return
/obj/machinery/alarm/proc/post_alert(alert_level) /obj/machinery/alarm/proc/post_alert(alert_level)
var/datum/radio_frequency/frequency = SSradio.return_frequency(alarm_frequency) var/datum/radio_frequency/frequency = SSradio.return_frequency(alarm_frequency)
if(!frequency) return if(!frequency) return

View File

@@ -2,7 +2,6 @@
var/list/possible_uplinker_IDs = list("Alfa","Bravo","Charlie","Delta","Echo","Foxtrot","Zero", "Niner") var/list/possible_uplinker_IDs = list("Alfa","Bravo","Charlie","Delta","Echo","Foxtrot","Zero", "Niner")
/obj/machinery/computer/telecrystals /obj/machinery/computer/telecrystals
name = "\improper Telecrystal assignment station" name = "\improper Telecrystal assignment station"
desc = "A device used to manage telecrystals during group operations. You shouldn't be looking at this particular one..." desc = "A device used to manage telecrystals during group operations. You shouldn't be looking at this particular one..."
@@ -14,7 +13,7 @@ var/list/possible_uplinker_IDs = list("Alfa","Bravo","Charlie","Delta","Echo","F
/obj/machinery/computer/telecrystals/uplinker /obj/machinery/computer/telecrystals/uplinker
name = "\improper Telecrystal upload/receive station" name = "\improper Telecrystal upload/receive station"
desc = "A device used to manage telecrystals during group operations. To use, simply insert your uplink. With your uplink installed \ desc = "A device used to manage telecrystals during group operations. To use, simply insert your uplink. With your uplink installed \
you can upload your telecrystals to the group's pool using the console, or be assigned additional telecrystals by your lieutenant." you can upload your telecrystals to the group's pool using the console, or be assigned additional telecrystals by your lieutenant."
var/obj/item/uplinkholder = null var/obj/item/uplinkholder = null
var/obj/machinery/computer/telecrystals/boss/linkedboss = null var/obj/machinery/computer/telecrystals/boss/linkedboss = null
@@ -29,34 +28,28 @@ var/list/possible_uplinker_IDs = list("Alfa","Bravo","Charlie","Delta","Echo","F
else else
name = "[name] [rand(1,999)]" name = "[name] [rand(1,999)]"
/obj/machinery/computer/telecrystals/uplinker/attackby(obj/item/O, mob/user, params) /obj/machinery/computer/telecrystals/uplinker/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item)) if(istype(O, /obj/item))
if(uplinkholder) if(uplinkholder)
user << "<span class='notice'>The [src] already has an uplink in it.</span>" user << "<span class='notice'>The [src] already has an uplink in it.</span>"
return return
if(O.hidden_uplink) if(O.hidden_uplink)
var/obj/item/P = user.get_active_hand() var/obj/item/I = user.get_active_hand()
if(!user.drop_item()) if(!user.drop_item())
return return
uplinkholder = P uplinkholder = I
P.loc = src I.loc = src
P.add_fingerprint(user) I.add_fingerprint(user)
update_icon() update_icon()
updateUsrDialog() updateUsrDialog()
else else
user << "<span class='notice'>The [O] doesn't appear to be an uplink...</span>" user << "<span class='notice'>The [O] doesn't appear to be an uplink...</span>"
/obj/machinery/computer/telecrystals/uplinker/update_icon() /obj/machinery/computer/telecrystals/uplinker/update_icon()
..() ..()
if(uplinkholder) if(uplinkholder)
overlays += "[initial(icon_state)]-closed" overlays += "[initial(icon_state)]-closed"
/obj/machinery/computer/telecrystals/uplinker/proc/ejectuplink() /obj/machinery/computer/telecrystals/uplinker/proc/ejectuplink()
if(uplinkholder) if(uplinkholder)
uplinkholder.loc = get_turf(src.loc) uplinkholder.loc = get_turf(src.loc)
@@ -65,8 +58,8 @@ var/list/possible_uplinker_IDs = list("Alfa","Bravo","Charlie","Delta","Echo","F
/obj/machinery/computer/telecrystals/uplinker/proc/donateTC(amt, addLog = 1) /obj/machinery/computer/telecrystals/uplinker/proc/donateTC(amt, addLog = 1)
if(uplinkholder && linkedboss) if(uplinkholder && linkedboss)
if(amt <= uplinkholder.hidden_uplink.uses) if(amt <= uplinkholder.hidden_uplink.telecrystals)
uplinkholder.hidden_uplink.uses -= amt uplinkholder.hidden_uplink.telecrystals -= amt
linkedboss.storedcrystals += amt linkedboss.storedcrystals += amt
if(addLog) if(addLog)
linkedboss.logTransfer("[src] donated [amt] telecrystals to [linkedboss].") linkedboss.logTransfer("[src] donated [amt] telecrystals to [linkedboss].")
@@ -74,7 +67,7 @@ var/list/possible_uplinker_IDs = list("Alfa","Bravo","Charlie","Delta","Echo","F
/obj/machinery/computer/telecrystals/uplinker/proc/giveTC(amt, addLog = 1) /obj/machinery/computer/telecrystals/uplinker/proc/giveTC(amt, addLog = 1)
if(uplinkholder && linkedboss) if(uplinkholder && linkedboss)
if(amt <= linkedboss.storedcrystals) if(amt <= linkedboss.storedcrystals)
uplinkholder.hidden_uplink.uses += amt uplinkholder.hidden_uplink.telecrystals += amt
linkedboss.storedcrystals -= amt linkedboss.storedcrystals -= amt
if(addLog) if(addLog)
linkedboss.logTransfer("[src] received [amt] telecrystals from [linkedboss].") linkedboss.logTransfer("[src] received [amt] telecrystals from [linkedboss].")
@@ -94,7 +87,7 @@ var/list/possible_uplinker_IDs = list("Alfa","Bravo","Charlie","Delta","Echo","F
dat += "No linked management consoles detected. Scan for uplink stations using the management console.<BR><BR>" dat += "No linked management consoles detected. Scan for uplink stations using the management console.<BR><BR>"
if(uplinkholder) if(uplinkholder)
dat += "[uplinkholder.hidden_uplink.uses] telecrystals remain in this uplink.<BR>" dat += "[uplinkholder.hidden_uplink.telecrystals] telecrystals remain in this uplink.<BR>"
if(linkedboss) if(linkedboss)
dat += "Donate TC: <a href='byond://?src=\ref[src];donate1=1'>1</a> | <a href='byond://?src=\ref[src];donate5=1'>5</a>" dat += "Donate TC: <a href='byond://?src=\ref[src];donate1=1'>1</a> | <a href='byond://?src=\ref[src];donate5=1'>5</a>"
dat += "<br><a href='byond://?src=\ref[src];eject=1'>Eject Uplink</a>" dat += "<br><a href='byond://?src=\ref[src];eject=1'>Eject Uplink</a>"
@@ -177,7 +170,7 @@ var/list/possible_uplinker_IDs = list("Alfa","Bravo","Charlie","Delta","Echo","F
for(var/obj/machinery/computer/telecrystals/uplinker/A in TCstations) for(var/obj/machinery/computer/telecrystals/uplinker/A in TCstations)
dat += "[A.name] | " dat += "[A.name] | "
if(A.uplinkholder) if(A.uplinkholder)
dat += "[A.uplinkholder.hidden_uplink.uses] telecrystals." dat += "[A.uplinkholder.hidden_uplink.telecrystals] telecrystals."
if(storedcrystals) if(storedcrystals)
dat+= "<BR>Add TC: <a href ='?src=\ref[src];give1=\ref[A]'>1</a> | <a href ='?src=\ref[src];give5=\ref[A]'>5</a>" dat+= "<BR>Add TC: <a href ='?src=\ref[src];give1=\ref[A]'>1</a> | <a href ='?src=\ref[src];give5=\ref[A]'>5</a>"
dat += "<BR>" dat += "<BR>"

View File

@@ -231,7 +231,7 @@ var/global/image/fire_overlay = image("icon" = 'icons/effects/fire.dmi', "icon_s
/obj/item/interact(mob/user) /obj/item/interact(mob/user)
if(hidden_uplink && hidden_uplink.active) if(hidden_uplink && hidden_uplink.active)
hidden_uplink.interact(user) hidden_uplink.interact(user)
return return 1
ui_interact(user) ui_interact(user)
/obj/item/attack_hand(mob/user) /obj/item/attack_hand(mob/user)

View File

@@ -114,6 +114,8 @@
/obj/item/device/radio/interact(mob/user) /obj/item/device/radio/interact(mob/user)
if (..())
return
if(b_stat && !istype(user, /mob/living/silicon/ai)) if(b_stat && !istype(user, /mob/living/silicon/ai))
wires.Interact(user) wires.Interact(user)
else else

View File

@@ -1,24 +1,24 @@
/obj/item/weapon/implant/uplink /obj/item/weapon/implant/uplink
name = "uplink implant" name = "uplink implant"
desc = "Summon things." desc = "Sneeki breeki."
icon = 'icons/obj/radio.dmi' icon = 'icons/obj/radio.dmi'
icon_state = "radio" icon_state = "radio"
origin_tech = "materials=2;magnets=4;programming=4;biotech=4;syndicate=8;bluespace=5" origin_tech = "materials=2;magnets=4;programming=4;biotech=4;syndicate=8;bluespace=5"
/obj/item/weapon/implant/uplink/New() /obj/item/weapon/implant/uplink/New()
hidden_uplink = new(src) hidden_uplink = new(src)
hidden_uplink.uses = 10 hidden_uplink.telecrystals = 10
..() ..()
/obj/item/weapon/implant/uplink/implant(mob/source) /obj/item/weapon/implant/uplink/implant(mob/user)
var/obj/item/weapon/implant/imp_e = locate(src.type) in source var/obj/item/weapon/implant/imp_e = locate(src.type) in user
if(imp_e && imp_e != src) if(imp_e && imp_e != src)
imp_e.hidden_uplink.uses += hidden_uplink.uses imp_e.hidden_uplink.telecrystals += hidden_uplink.telecrystals
qdel(src) qdel(src)
return 1 return 1
if(..()) if(..())
hidden_uplink.uplink_owner="[source.key]" hidden_uplink.owner = "[user.key]"
return 1 return 1
return 0 return 0
@@ -26,7 +26,6 @@
if(hidden_uplink) if(hidden_uplink)
hidden_uplink.interact(usr) hidden_uplink.interact(usr)
/obj/item/weapon/implanter/uplink /obj/item/weapon/implanter/uplink
name = "implanter (uplink)" name = "implanter (uplink)"

View File

@@ -301,61 +301,6 @@
slowdown = 1 slowdown = 1
max_combined_w_class = 30 max_combined_w_class = 30
/obj/item/weapon/storage/backpack/dufflebag/syndie
name = "suspicious looking dufflebag"
desc = "A large dufflebag for holding extra tactical supplies."
icon_state = "duffle-syndie"
item_state = "duffle-syndiemed"
origin_tech = "syndicate=1"
silent = 1
slowdown = 0
/obj/item/weapon/storage/backpack/dufflebag/syndie/med
name = "medical dufflebag"
desc = "A large dufflebag for holding extra tactical medical supplies."
icon_state = "duffle-syndiemed"
item_state = "duffle-syndiemed"
/obj/item/weapon/storage/backpack/dufflebag/syndie/ammo
name = "ammunition dufflebag"
desc = "A large dufflebag for holding extra weapons ammunition and supplies."
icon_state = "duffle-syndieammo"
item_state = "duffle-syndieammo"
/obj/item/weapon/storage/backpack/dufflebag/syndie/ammo/loaded
desc = "A large dufflebag, packed to the brim with Bulldog shotgun ammo."
/obj/item/weapon/storage/backpack/dufflebag/syndie/ammo/loaded/New()
..()
contents = list()
for(var/i in 1 to 6)
new /obj/item/ammo_box/magazine/m12g(src)
new /obj/item/ammo_box/magazine/m12g/buckshot(src)
new /obj/item/ammo_box/magazine/m12g/stun(src)
new /obj/item/ammo_box/magazine/m12g/dragon(src)
return
/obj/item/weapon/storage/backpack/dufflebag/syndie/surgery
name = "surgery dufflebag"
desc = "A suspicious looking dufflebag for holding surgery tools."
icon_state = "duffle-syndiemed"
item_state = "duffle-syndiemed"
/obj/item/weapon/storage/backpack/dufflebag/syndie/surgery/New()
..()
contents = list()
new /obj/item/weapon/scalpel(src)
new /obj/item/weapon/hemostat(src)
new /obj/item/weapon/retractor(src)
new /obj/item/weapon/circular_saw(src)
new /obj/item/weapon/surgicaldrill(src)
new /obj/item/weapon/cautery(src)
new /obj/item/weapon/surgical_drapes(src)
new /obj/item/clothing/suit/straight_jacket(src)
new /obj/item/clothing/mask/muzzle(src)
new /obj/item/device/mmi/syndie(src)
return
/obj/item/weapon/storage/backpack/dufflebag/captain /obj/item/weapon/storage/backpack/dufflebag/captain
name = "captain's dufflebag" name = "captain's dufflebag"
desc = "A large dufflebag for holding extra captainly goods." desc = "A large dufflebag for holding extra captainly goods."
@@ -388,6 +333,62 @@
icon_state = "duffle-clown" icon_state = "duffle-clown"
item_state = "duffle-clown" item_state = "duffle-clown"
/obj/item/weapon/storage/backpack/dufflebag/syndie
name = "suspicious looking dufflebag"
desc = "A large dufflebag for holding extra tactical supplies."
icon_state = "duffle-syndie"
item_state = "duffle-syndiemed"
origin_tech = "syndicate=1"
silent = 1
slowdown = 0
/obj/item/weapon/storage/backpack/dufflebag/syndie/med
name = "medical dufflebag"
desc = "A large dufflebag for holding extra tactical medical supplies."
icon_state = "duffle-syndiemed"
item_state = "duffle-syndiemed"
/obj/item/weapon/storage/backpack/dufflebag/syndie/surgery
name = "surgery dufflebag"
desc = "A suspicious looking dufflebag for holding surgery tools."
icon_state = "duffle-syndiemed"
item_state = "duffle-syndiemed"
/obj/item/weapon/storage/backpack/dufflebag/syndie/surgery/New()
..()
contents = list()
new /obj/item/weapon/scalpel(src)
new /obj/item/weapon/hemostat(src)
new /obj/item/weapon/retractor(src)
new /obj/item/weapon/circular_saw(src)
new /obj/item/weapon/surgicaldrill(src)
new /obj/item/weapon/cautery(src)
new /obj/item/weapon/surgical_drapes(src)
new /obj/item/clothing/suit/straight_jacket(src)
new /obj/item/clothing/mask/muzzle(src)
new /obj/item/device/mmi/syndie(src)
return
/obj/item/weapon/storage/backpack/dufflebag/syndie/ammo
name = "ammunition dufflebag"
desc = "A large dufflebag for holding extra weapons ammunition and supplies."
icon_state = "duffle-syndieammo"
item_state = "duffle-syndieammo"
/obj/item/weapon/storage/backpack/dufflebag/syndie/ammo/shotgun
desc = "A large dufflebag, packed to the brim with Bulldog shotgun ammo."
/obj/item/weapon/storage/backpack/dufflebag/syndie/ammo/shotgun/New()
..()
contents = list()
for(var/i in 1 to 6)
new /obj/item/ammo_box/magazine/m12g(src)
new /obj/item/ammo_box/magazine/m12g/buckshot(src)
new /obj/item/ammo_box/magazine/m12g/stun(src)
new /obj/item/ammo_box/magazine/m12g/dragon(src)
return
/obj/item/weapon/storage/backpack/dufflebag/syndie/ammo/smg /obj/item/weapon/storage/backpack/dufflebag/syndie/ammo/smg
desc = "A large dufflebag, packed to the brim with C20r magazines." desc = "A large dufflebag, packed to the brim with C20r magazines."
@@ -400,15 +401,15 @@
/obj/item/weapon/storage/backpack/dufflebag/syndie/ammo/fireteam /obj/item/weapon/storage/backpack/dufflebag/syndie/ammo/fireteam
desc = "A large dufflebag, packed to the brim with C20r, M90gl, and sniper ammunition." desc = "A large dufflebag, packed to the brim with .45, 5.56, and .50 ammo."
/obj/item/weapon/storage/backpack/dufflebag/syndie/ammo/fireteam/New() /obj/item/weapon/storage/backpack/dufflebag/syndie/ammo/fireteam/New()
..() ..()
contents = list() contents = list()
for(var/i in 1 to 4) for(var/i in 1 to 4)
new /obj/item/ammo_box/magazine/smgm45(src) new /obj/item/ammo_box/magazine/smgm45(src)
new /obj/item/ammo_box/magazine/m556(src) for(var/i in 1 to 3)
new /obj/item/ammo_box/magazine/m556(src) new /obj/item/ammo_box/magazine/m556(src)
new /obj/item/ammo_box/a40mm(src) new /obj/item/ammo_box/a40mm(src)
new /obj/item/ammo_box/magazine/sniper_rounds(src) new /obj/item/ammo_box/magazine/sniper_rounds(src)
return return

View File

@@ -220,7 +220,7 @@ obj/item/weapon/paper/crumpled/snowdin/shovel
/obj/item/device/radio/uplink/old/New() /obj/item/device/radio/uplink/old/New()
..() ..()
hidden_uplink.name = "dusty radio" hidden_uplink.name = "dusty radio"
hidden_uplink.uses = 10 hidden_uplink.telecrystals = 10
/obj/effect/landmark/corpse/syndicatesoldier/coldres /obj/effect/landmark/corpse/syndicatesoldier/coldres
name = "Syndicate Snow Operative" name = "Syndicate Snow Operative"

View File

@@ -1,4 +1,3 @@
//////////////////// ////////////////////
//MORE DRONE TYPES// //MORE DRONE TYPES//
//////////////////// ////////////////////
@@ -28,21 +27,31 @@
default_hatmask = /obj/item/clothing/head/helmet/space/hardsuit/syndi default_hatmask = /obj/item/clothing/head/helmet/space/hardsuit/syndi
seeStatic = 0 //Our programming is superior. seeStatic = 0 //Our programming is superior.
/mob/living/simple_animal/drone/syndrone/New() /mob/living/simple_animal/drone/syndrone/New()
..() ..()
if(internal_storage && internal_storage.hidden_uplink) internal_storage.hidden_uplink.telecrystals = 10
internal_storage.hidden_uplink.uses = (initial(internal_storage.hidden_uplink.uses) / 2)
internal_storage.name = "syndicate uplink"
/mob/living/simple_animal/drone/syndrone/Login() /mob/living/simple_animal/drone/syndrone/Login()
..() ..()
src << "<span class='notice'>You can kill and eat other drones to increase your health!</span>" //Inform the evil lil guy src << "<span class='notice'>You can kill and eat other drones to increase your health!</span>" //Inform the evil lil guy
/mob/living/simple_animal/drone/syndrone/badass
name = "Badass Syndrone"
default_hatmask = /obj/item/clothing/head/helmet/space/hardsuit/syndi/elite
default_storage = /obj/item/device/radio/uplink/nuclear
/mob/living/simple_animal/drone/syndrone/badass/New()
..()
internal_storage.hidden_uplink.telecrystals = 30
var/obj/item/weapon/implant/weapons_auth/W = new/obj/item/weapon/implant/weapons_auth(src)
W.implant(src)
/obj/item/drone_shell/syndrone /obj/item/drone_shell/syndrone
name = "syndrone shell" name = "syndrone shell"
desc = "A shell of a syndrone, a modified maintenance drone designed to infiltrate and annihilate." desc = "A shell of a syndrone, a modified maintenance drone designed to infiltrate and annihilate."
icon_state = "syndrone_item" icon_state = "syndrone_item"
drone_type = /mob/living/simple_animal/drone/syndrone drone_type = /mob/living/simple_animal/drone/syndrone
/obj/item/drone_shell/syndrone/badass
name = "badass syndrone shell"
drone_type = /mob/living/simple_animal/drone/syndrone/badass

View File

@@ -1,9 +1,9 @@
var/list/world_uplinks = list() var/global/list/uplinks = list()
/** /**
* Uplinks * Uplinks
* *
* All obj/item 's have a hidden_uplink var. By default it's null. Give the item one with 'new(src') (it must be in it's contents). Then add 'uses.' * All /obj/item(s) have a hidden_uplink var. By default it's null. Give the item one with 'new(src') (it must be in it's contents). Then add 'uses.'
* Use whatever conditionals you want to check that the user has an uplink, and then call interact() on their uplink. * Use whatever conditionals you want to check that the user has an uplink, and then call interact() on their uplink.
* You might also want the uplink menu to open if active. Check if the uplink is 'active' and then interact() with it. * You might also want the uplink menu to open if active. Check if the uplink is 'active' and then interact() with it.
**/ **/
@@ -12,40 +12,39 @@ var/list/world_uplinks = list()
desc = "There is something wrong if you're examining this." desc = "There is something wrong if you're examining this."
var/active = FALSE var/active = FALSE
var/lockable = TRUE var/lockable = TRUE
var/uses = 20 var/telecrystals = 20
var/used_TC = 0
var/uplink_owner = null
var/purchase_log = ""
var/mode_override = null var/owner = null
var/datum/game_mode/gamemode = null
var/spent_telecrystals = 0
var/purchase_log = ""
/obj/item/device/uplink/New() /obj/item/device/uplink/New()
..() ..()
world_uplinks += src uplinks += src
/obj/item/device/uplink/Destroy() /obj/item/device/uplink/Destroy()
world_uplinks -= src uplinks -= src
return ..() return ..()
/obj/item/device/uplink/interact(mob/user) /obj/item/device/uplink/interact(mob/user)
if(!active) active = TRUE
active = TRUE
ui_interact(user) ui_interact(user)
/obj/item/device/uplink/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ /obj/item/device/uplink/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
datum/tgui/master_ui = null, datum/ui_state/state = inventory_state) datum/tgui/master_ui = null, datum/ui_state/state = inventory_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui) if(!ui)
ui = new(user, src, ui_key, "uplink", name, 350, 750, master_ui, state) ui = new(user, src, ui_key, "uplink", name, 450, 750, master_ui, state)
ui.set_style("syndicate") ui.set_style("syndicate")
ui.open() ui.open()
/obj/item/device/uplink/get_ui_data(mob/user) /obj/item/device/uplink/get_ui_data(mob/user)
var/list/data = list() var/list/data = list()
data["uses"] = uses data["telecrystals"] = telecrystals
data["lockable"] = lockable data["lockable"] = lockable
var/list/uplink_items = get_uplink_items(mode_override) var/list/uplink_items = get_uplink_items(gamemode)
data["buyable"] = list() data["buyable"] = list()
for(var/category in uplink_items) for(var/category in uplink_items)
var/list/cat = list( var/list/cat = list(
@@ -69,12 +68,12 @@ var/list/world_uplinks = list()
switch(action) switch(action)
if("buy") if("buy")
var/list/uplink_items = get_uplink_items(mode_override) var/list/uplink_items = get_uplink_items(gamemode)
var/category = params["category"] var/category = params["category"]
var/item = params["item"] var/item = params["item"]
var/datum/uplink_item/I = uplink_items[category][item] var/datum/uplink_item/I = uplink_items[category][item]
if(I) if(I)
I.buy(src, usr) I.buy(usr, src)
if("lock") if("lock")
active = FALSE active = FALSE
SStgui.close_uis(src) SStgui.close_uis(src)
@@ -85,43 +84,33 @@ var/list/world_uplinks = list()
return loc return loc
// Refund certain items by hitting the uplink with it. // Refund certain items by hitting the uplink with it.
/obj/item/device/radio/uplink/attackby(obj/item/weapon/W, mob/user, params) /obj/item/device/radio/uplink/attackby(obj/item/I, mob/user, params)
if(istype(W)) for(var/item in subtypesof(/datum/uplink_item))
for(var/path in subtypesof(/datum/uplink_item)) var/datum/uplink_item/UI = item
var/datum/uplink_item/D = path var/path = initial(UI.item)
if(initial(D.item) == W.type && initial(D.refundable)) var/cost = initial(UI.cost)
hidden_uplink.uses += (D.cost) var/refundable = initial(UI.refundable)
hidden_uplink.used_TC -= initial(D.cost) if(I.type == path && refundable)
user << "<span class='notice'>[W] refunded.</span>" hidden_uplink.telecrystals += cost
qdel(W) hidden_uplink.spent_telecrystals -= cost
return user << "<span class='notice'>[I] refunded.</span>"
qdel(I)
// PRESET UPLINKS return
// A collection of preset uplinks.
//
// Includes normal radio uplink, multitool uplink,
// implant uplink (not the implant tool) and a preset headset uplink.
// A collection of pre-set uplinks, for admin spawns.
/obj/item/device/radio/uplink/New() /obj/item/device/radio/uplink/New()
..() ..()
icon_state = "radio" icon_state = "radio"
hidden_uplink = new(src) hidden_uplink = new(src)
hidden_uplink.active = TRUE
hidden_uplink.lockable = FALSE hidden_uplink.lockable = FALSE
/obj/item/device/radio/uplink/interact(mob/user) /obj/item/device/radio/uplink/nuclear/New()
hidden_uplink.interact(user) ..()
hidden_uplink.gamemode = /datum/game_mode/nuclear
/obj/item/device/multitool/uplink/New() /obj/item/device/multitool/uplink/New()
..() ..()
hidden_uplink = new(src) hidden_uplink = new(src)
hidden_uplink.active = TRUE
hidden_uplink.lockable = FALSE hidden_uplink.lockable = FALSE
/obj/item/device/multitool/uplink/interact(mob/user)
hidden_uplink.interact(user)
/obj/item/device/radio/headset/uplink
traitor_frequency = 1445
/obj/item/device/radio/headset/uplink/New()
..()
hidden_uplink = new(src)

File diff suppressed because it is too large Load Diff

View File

@@ -190,7 +190,6 @@
#include "code\datums\recipe.dm" #include "code\datums\recipe.dm"
#include "code\datums\spell.dm" #include "code\datums\spell.dm"
#include "code\datums\supplypacks.dm" #include "code\datums\supplypacks.dm"
#include "code\datums\uplink_item.dm"
#include "code\datums\votablemap.dm" #include "code\datums\votablemap.dm"
#include "code\datums\diseases\_disease.dm" #include "code\datums\diseases\_disease.dm"
#include "code\datums\diseases\_MobProcs.dm" #include "code\datums\diseases\_MobProcs.dm"
@@ -644,7 +643,6 @@
#include "code\game\objects\items\devices\taperecorder.dm" #include "code\game\objects\items\devices\taperecorder.dm"
#include "code\game\objects\items\devices\traitordevices.dm" #include "code\game\objects\items\devices\traitordevices.dm"
#include "code\game\objects\items\devices\transfer_valve.dm" #include "code\game\objects\items\devices\transfer_valve.dm"
#include "code\game\objects\items\devices\uplink.dm"
#include "code\game\objects\items\devices\PDA\cart.dm" #include "code\game\objects\items\devices\PDA\cart.dm"
#include "code\game\objects\items\devices\PDA\PDA.dm" #include "code\game\objects\items\devices\PDA\PDA.dm"
#include "code\game\objects\items\devices\PDA\radio.dm" #include "code\game\objects\items\devices\PDA\radio.dm"
@@ -1608,6 +1606,8 @@
#include "code\modules\tgui\states\states.dm" #include "code\modules\tgui\states\states.dm"
#include "code\modules\tgui\states\zlevel.dm" #include "code\modules\tgui\states\zlevel.dm"
#include "code\modules\tooltip\tooltip.dm" #include "code\modules\tooltip\tooltip.dm"
#include "code\modules\uplink\uplink.dm"
#include "code\modules\uplink\uplink_item.dm"
#include "code\modules\vehicles\atv.dm" #include "code\modules\vehicles\atv.dm"
#include "code\modules\vehicles\pimpin_ride.dm" #include "code\modules\vehicles\pimpin_ride.dm"
#include "code\modules\vehicles\secway.dm" #include "code\modules\vehicles\secway.dm"

File diff suppressed because one or more lines are too long

View File

@@ -3,7 +3,7 @@
oninit () { oninit () {
this.on({ this.on({
hover (event) { hover (event) {
const uses = this.get('data.uses') const uses = this.get('data.telecrystals')
if (uses >= event.context.params.cost) if (uses >= event.context.params.cost)
this.set('hovered', event.context.params) this.set('hovered', event.context.params)
}, },
@@ -22,7 +22,7 @@
{{/if}} {{/if}}
{{/partial}} {{/partial}}
<ui-section label='Telecrystals' right> <ui-section label='Telecrystals' right>
<span class='{{data.uses > 0 ? "good" : "bad"}}'>{{data.uses}} TC</span> <span class='{{data.telecrystals > 0 ? "good" : "bad"}}'>{{data.telecrystals}} TC</span>
</ui-section> </ui-section>
</ui-display> </ui-display>
{{#each data.buyable}} {{#each data.buyable}}
@@ -30,7 +30,7 @@
{{#each items}} {{#each items}}
<ui-section label='{{name}}' candystripe right> <ui-section label='{{name}}' candystripe right>
<ui-button tooltip='{{name}}: {{desc}}' tooltip-side='left' <ui-button tooltip='{{name}}: {{desc}}' tooltip-side='left'
state='{{data.uses < cost || (data.uses - hovered.cost < cost && hovered.item != name) ? "disabled" : null}}' state='{{data.telecrystals < cost || (data.telecrystals - hovered.cost < cost && hovered.item != name) ? "disabled" : null}}'
action='buy' params='{"category": "{{category}}", "item": {{name}}, "cost": {{cost}}}' action='buy' params='{"category": "{{category}}", "item": {{name}}, "cost": {{cost}}}'
on-hover='hover' on-unhover='unhover'>{{cost}} TC</ui-button> on-hover='hover' on-unhover='unhover'>{{cost}} TC</ui-button>
</ui-section> </ui-section>