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) )
text = "Uplink: <a href='?src=\ref[src];common=uplink'>give</a>"
var/obj/item/device/uplink/suplink = find_syndicate_uplink()
var/crystals
if (suplink)
crystals = suplink.uses
if (suplink)
var/obj/item/device/uplink/U = find_syndicate_uplink()
if(U)
text += "|<a href='?src=\ref[src];common=takeuplink'>take</a>"
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
text += ", [crystals] crystals"
text += ", [U.telecrystals] TC"
text += "." //hiel grammar
out += text
@@ -1226,19 +1223,16 @@
memory = null//Remove any memory they may have had.
log_admin("[key_name(usr)] removed [current]'s uplink.")
if("crystals")
if (check_rights(R_FUN, 0))
var/obj/item/device/uplink/suplink = find_syndicate_uplink()
var/crystals
if (suplink)
crystals = suplink.uses
crystals = input("Amount of telecrystals for [key]","Syndicate uplink", crystals) as null|num
if (!isnull(crystals))
if (suplink)
suplink.uses = crystals
if(check_rights(R_FUN, 0))
var/obj/item/device/uplink/U = find_syndicate_uplink()
if(U)
var/crystals = input("Amount of telecrystals for [key]","Syndicate uplink", U.telecrystals) as null|num
if(!isnull(crystals))
U.telecrystals = 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].")
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>"
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++
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)
if(telecrystals)
synd_mob.equipOutfit(/datum/outfit/syndicate)
@@ -177,7 +172,6 @@
return 1
return ..()
/datum/game_mode/proc/are_operatives_dead()
for(var/datum/mind/operative_mind in syndicates)
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 << "<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")
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>"
@@ -265,13 +259,13 @@
var/TC_uses = 0
for(var/datum/mind/syndicate in syndicates)
text += printplayer(syndicate)
for(var/obj/item/device/uplink/H in world_uplinks)
if(H && H.uplink_owner && H.uplink_owner==syndicate.key)
TC_uses += H.used_TC
for(var/obj/item/device/uplink/H in uplinks)
if(H && H.owner && H.owner == syndicate.key)
TC_uses += H.spent_telecrystals
purchases += H.purchase_log
text += "<br>"
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>"
world << text
return 1
@@ -322,10 +316,9 @@
R.freqlock = 1
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
var/obj/item/device/radio/uplink/nuclear/U = new(H)
U.hidden_uplink.owner = "[H.key]"
U.hidden_uplink.telecrystals = tc
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)
@@ -349,8 +342,6 @@
/obj/item/weapon/tank/jetpack/oxygen/harness=1,\
/obj/item/weapon/pinpointer/nukeop=1)
tc = 30
/datum/outfit/syndicate/full/post_equip(mob/living/carbon/human/H)
..()

View File

@@ -1,6 +1,7 @@
#define CHALLENGE_TELECRYSTALS 280
#define CHALLENGE_TIME_LIMIT 3000
#define MIN_CHALLENGE_PLAYERS 50
#define CHALLENGE_SHUTTLE_DELAY 15000 //25 minutes, so the ops have at least 5 minutes before the shuttle is callable.
#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.
/obj/item/device/nuclear_challenge
name = "Declaration of War (Challenge Mode)"
@@ -10,10 +11,8 @@
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."
/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."
return
if(user.z != ZLEVEL_CENTCOM)
@@ -36,14 +35,15 @@
for(var/obj/machinery/computer/shuttle/syndicate/S in machines)
S.challenge = TRUE
var/obj/item/device/radio/uplink/U = new /obj/item/device/radio/uplink(get_turf(user))
U.hidden_uplink.uplink_owner= "[user.key]"
U.hidden_uplink.uses = 280
U.hidden_uplink.mode_override = /datum/game_mode/nuclear //Maybe we can have a special set of items for the challenge uplink eventually
var/obj/item/device/radio/uplink/nuclear/U = new(get_turf(user))
U.hidden_uplink.owner = "[user.key]"
U.hidden_uplink.telecrystals = CHALLENGE_TELECRYSTALS
U.hidden_uplink.gamemode = /datum/game_mode/nuclear
config.shuttle_refuel_delay = max(config.shuttle_refuel_delay, CHALLENGE_SHUTTLE_DELAY)
qdel(src)
#undef CHALLENGE_TELECRYSTALS
#undef CHALLENGE_TIME_LIMIT
#undef MIN_CHALLENGE_PLAYERS
#undef CHALLENGE_MIN_PLAYERS
#undef CHALLENGE_SHUTTLE_DELAY

View File

@@ -1,5 +1,4 @@
/datum/game_mode
// this includes admin-appointed traitors and multitraitors. Easy!
var/traitor_name = "traitor"
var/list/datum/mind/traitors = list()
@@ -227,10 +226,10 @@
var/TC_uses = 0
var/uplink_true = 0
var/purchases = ""
for(var/obj/item/device/uplink/H in world_uplinks)
if(H && H.uplink_owner && H.uplink_owner==traitor.key)
TC_uses += H.used_TC
uplink_true=1
for(var/obj/item/device/uplink/H in uplinks)
if(H && H.owner && H.owner == traitor.key)
TC_uses += H.spent_telecrystals
uplink_true = 1
purchases += H.purchase_log
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.dna.remove_mutation(CLOWNMUT)
// find a radio! toolbox(es), backpack, belt, headset
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
if(!R)
R = locate(/obj/item/device/radio) in traitor_mob.contents
var/obj/item/I = locate(/obj/item/device/pda) in traitor_mob.contents //Hide the uplink in a PDA if available, otherwise radio
if(!I)
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."
. = 0
else
if (istype(R, /obj/item/device/radio))
// generate list of radio freqs
var/obj/item/device/radio/target_radio = R
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/U = new(I)
U.owner = "[traitor_mob.key]"
I.hidden_uplink = U
var/obj/item/device/uplink/T = new(R)
target_radio.hidden_uplink = T
T.uplink_owner = "[traitor_mob.key]"
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")]"
if(istype(I, /obj/item/device/radio))
var/obj/item/device/radio/R = I
R.traitor_frequency = sanitize_frequency(rand(MIN_FREQ, MAX_FREQ))
var/obj/item/device/uplink/T = new(R)
R.hidden_uplink = T
T.uplink_owner = "[traitor_mob.key]"
var/obj/item/device/pda/P = R
P.lock_code = pda_pass
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."
traitor_mob.mind.store_memory("<B>Radio Frequency:</B> [format_frequency(R.traitor_frequency)] ([R.name] [loc]).")
else if(istype(I, /obj/item/device/pda))
var/obj/item/device/pda/P = I
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.mind.store_memory("<B>Uplink Passcode:</B> [pda_pass] ([R.name] [loc]).")
if(!safety)//If they are not a rev. Can be added on to.
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> [P.lock_code] ([P.name] [loc]).")
if(!safety) // If they are not a rev. Can be added on to.
give_codewords(traitor_mob)
/datum/game_mode/proc/assign_exchange_role(datum/mind/owner)

View File

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

View File

@@ -2,7 +2,6 @@
var/list/possible_uplinker_IDs = list("Alfa","Bravo","Charlie","Delta","Echo","Foxtrot","Zero", "Niner")
/obj/machinery/computer/telecrystals
name = "\improper Telecrystal assignment station"
desc = "A device used to manage telecrystals during group operations. You shouldn't be looking at this particular one..."
@@ -29,34 +28,28 @@ var/list/possible_uplinker_IDs = list("Alfa","Bravo","Charlie","Delta","Echo","F
else
name = "[name] [rand(1,999)]"
/obj/machinery/computer/telecrystals/uplinker/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item))
if(uplinkholder)
user << "<span class='notice'>The [src] already has an uplink in it.</span>"
return
if(O.hidden_uplink)
var/obj/item/P = user.get_active_hand()
var/obj/item/I = user.get_active_hand()
if(!user.drop_item())
return
uplinkholder = P
P.loc = src
P.add_fingerprint(user)
uplinkholder = I
I.loc = src
I.add_fingerprint(user)
update_icon()
updateUsrDialog()
else
user << "<span class='notice'>The [O] doesn't appear to be an uplink...</span>"
/obj/machinery/computer/telecrystals/uplinker/update_icon()
..()
if(uplinkholder)
overlays += "[initial(icon_state)]-closed"
/obj/machinery/computer/telecrystals/uplinker/proc/ejectuplink()
if(uplinkholder)
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)
if(uplinkholder && linkedboss)
if(amt <= uplinkholder.hidden_uplink.uses)
uplinkholder.hidden_uplink.uses -= amt
if(amt <= uplinkholder.hidden_uplink.telecrystals)
uplinkholder.hidden_uplink.telecrystals -= amt
linkedboss.storedcrystals += amt
if(addLog)
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)
if(uplinkholder && linkedboss)
if(amt <= linkedboss.storedcrystals)
uplinkholder.hidden_uplink.uses += amt
uplinkholder.hidden_uplink.telecrystals += amt
linkedboss.storedcrystals -= amt
if(addLog)
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>"
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)
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>"
@@ -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)
dat += "[A.name] | "
if(A.uplinkholder)
dat += "[A.uplinkholder.hidden_uplink.uses] telecrystals."
dat += "[A.uplinkholder.hidden_uplink.telecrystals] telecrystals."
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>"

View File

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

View File

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

View File

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

View File

@@ -301,61 +301,6 @@
slowdown = 1
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
name = "captain's dufflebag"
desc = "A large dufflebag for holding extra captainly goods."
@@ -388,6 +333,62 @@
icon_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
desc = "A large dufflebag, packed to the brim with C20r magazines."
@@ -400,14 +401,14 @@
/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()
..()
contents = list()
for(var/i in 1 to 4)
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/a40mm(src)
new /obj/item/ammo_box/magazine/sniper_rounds(src)

View File

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

View File

@@ -1,4 +1,3 @@
////////////////////
//MORE DRONE TYPES//
////////////////////
@@ -28,21 +27,31 @@
default_hatmask = /obj/item/clothing/head/helmet/space/hardsuit/syndi
seeStatic = 0 //Our programming is superior.
/mob/living/simple_animal/drone/syndrone/New()
..()
if(internal_storage && internal_storage.hidden_uplink)
internal_storage.hidden_uplink.uses = (initial(internal_storage.hidden_uplink.uses) / 2)
internal_storage.name = "syndicate uplink"
internal_storage.hidden_uplink.telecrystals = 10
/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
/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
name = "syndrone shell"
desc = "A shell of a syndrone, a modified maintenance drone designed to infiltrate and annihilate."
icon_state = "syndrone_item"
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
*
* 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.
* You might also want the uplink menu to open if active. Check if the uplink is 'active' and then interact() with it.
**/
@@ -12,23 +12,22 @@ var/list/world_uplinks = list()
desc = "There is something wrong if you're examining this."
var/active = FALSE
var/lockable = TRUE
var/uses = 20
var/used_TC = 0
var/uplink_owner = null
var/purchase_log = ""
var/telecrystals = 20
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()
..()
world_uplinks += src
uplinks += src
/obj/item/device/uplink/Destroy()
world_uplinks -= src
uplinks -= src
return ..()
/obj/item/device/uplink/interact(mob/user)
if(!active)
active = TRUE
ui_interact(user)
@@ -36,16 +35,16 @@ var/list/world_uplinks = list()
datum/tgui/master_ui = null, datum/ui_state/state = inventory_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
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.open()
/obj/item/device/uplink/get_ui_data(mob/user)
var/list/data = list()
data["uses"] = uses
data["telecrystals"] = telecrystals
data["lockable"] = lockable
var/list/uplink_items = get_uplink_items(mode_override)
var/list/uplink_items = get_uplink_items(gamemode)
data["buyable"] = list()
for(var/category in uplink_items)
var/list/cat = list(
@@ -69,12 +68,12 @@ var/list/world_uplinks = list()
switch(action)
if("buy")
var/list/uplink_items = get_uplink_items(mode_override)
var/list/uplink_items = get_uplink_items(gamemode)
var/category = params["category"]
var/item = params["item"]
var/datum/uplink_item/I = uplink_items[category][item]
if(I)
I.buy(src, usr)
I.buy(usr, src)
if("lock")
active = FALSE
SStgui.close_uis(src)
@@ -85,43 +84,33 @@ var/list/world_uplinks = list()
return loc
// Refund certain items by hitting the uplink with it.
/obj/item/device/radio/uplink/attackby(obj/item/weapon/W, mob/user, params)
if(istype(W))
for(var/path in subtypesof(/datum/uplink_item))
var/datum/uplink_item/D = path
if(initial(D.item) == W.type && initial(D.refundable))
hidden_uplink.uses += (D.cost)
hidden_uplink.used_TC -= initial(D.cost)
user << "<span class='notice'>[W] refunded.</span>"
qdel(W)
/obj/item/device/radio/uplink/attackby(obj/item/I, mob/user, params)
for(var/item in subtypesof(/datum/uplink_item))
var/datum/uplink_item/UI = item
var/path = initial(UI.item)
var/cost = initial(UI.cost)
var/refundable = initial(UI.refundable)
if(I.type == path && refundable)
hidden_uplink.telecrystals += cost
hidden_uplink.spent_telecrystals -= cost
user << "<span class='notice'>[I] refunded.</span>"
qdel(I)
return
// PRESET UPLINKS
// 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()
..()
icon_state = "radio"
hidden_uplink = new(src)
hidden_uplink.active = TRUE
hidden_uplink.lockable = FALSE
/obj/item/device/radio/uplink/interact(mob/user)
hidden_uplink.interact(user)
/obj/item/device/radio/uplink/nuclear/New()
..()
hidden_uplink.gamemode = /datum/game_mode/nuclear
/obj/item/device/multitool/uplink/New()
..()
hidden_uplink = new(src)
hidden_uplink.active = TRUE
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\spell.dm"
#include "code\datums\supplypacks.dm"
#include "code\datums\uplink_item.dm"
#include "code\datums\votablemap.dm"
#include "code\datums\diseases\_disease.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\traitordevices.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\PDA.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\zlevel.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\pimpin_ride.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 () {
this.on({
hover (event) {
const uses = this.get('data.uses')
const uses = this.get('data.telecrystals')
if (uses >= event.context.params.cost)
this.set('hovered', event.context.params)
},
@@ -22,7 +22,7 @@
{{/if}}
{{/partial}}
<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-display>
{{#each data.buyable}}
@@ -30,7 +30,7 @@
{{#each items}}
<ui-section label='{{name}}' candystripe right>
<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}}}'
on-hover='hover' on-unhover='unhover'>{{cost}} TC</ui-button>
</ui-section>