Merge pull request #4074 from Citadel-Station-13/upstream-merge-32624

[MIRROR] [READY]Refactors uplinks to a component!
This commit is contained in:
deathride58
2017-12-04 23:12:45 +00:00
committed by GitHub
30 changed files with 648 additions and 546 deletions
@@ -218,15 +218,6 @@
desc = "This wand uses healing magics to heal and revive. The years of the cold have weakened the magic inside the wand."
max_charges = 5
/obj/item/device/radio/uplink/old
name = "dusty radio"
desc = "A dusty looking radio."
/obj/item/device/radio/uplink/old/Initialize()
. = ..()
hidden_uplink.name = "dusty radio"
hidden_uplink.telecrystals = 10
/obj/effect/mob_spawn/human/syndicatesoldier/coldres
name = "Syndicate Snow Operative"
outfit = /datum/outfit/snowsyndie/corpse
@@ -1,19 +1,19 @@
/datum/species/corporate
name = "Corporate Agent"
id = "agent"
hair_alpha = 0
say_mod = "declares"
speedmod = -2//Fast
brutemod = 0.7//Tough against firearms
burnmod = 0.65//Tough against lasers
coldmod = 0
heatmod = 0.5//it's a little tough to burn them to death not as hard though.
punchdamagelow = 20
punchdamagehigh = 30//they are inhumanly strong
punchstunthreshold = 25
attack_verb = "smash"
attack_sound = 'sound/weapons/resonator_blast.ogg'
blacklisted = 1
use_skintones = 0
species_traits = list(SPECIES_ORGANIC,RADIMMUNE,VIRUSIMMUNE,NOBLOOD,PIERCEIMMUNE,EYECOLOR,NODISMEMBER,NOHUNGER)
sexes = 0
/datum/species/corporate
name = "Corporate Agent"
id = "agent"
hair_alpha = 0
say_mod = "declares"
speedmod = -2//Fast
brutemod = 0.7//Tough against firearms
burnmod = 0.65//Tough against lasers
coldmod = 0
heatmod = 0.5//it's a little tough to burn them to death not as hard though.
punchdamagelow = 20
punchdamagehigh = 30//they are inhumanly strong
punchstunthreshold = 25
attack_verb = "smash"
attack_sound = 'sound/weapons/resonator_blast.ogg'
blacklisted = 1
use_skintones = 0
species_traits = list(SPECIES_ORGANIC,RADIMMUNE,VIRUSIMMUNE,NOBLOOD,PIERCEIMMUNE,EYECOLOR,NODISMEMBER,NOHUNGER)
sexes = 0
@@ -1,71 +1,71 @@
/datum/species/pod
// A mutation caused by a human being ressurected in a revival pod. These regain health in light, and begin to wither in darkness.
name = "Podperson"
id = "pod"
default_color = "59CE00"
species_traits = list(SPECIES_ORGANIC,MUTCOLORS,EYECOLOR)
attack_verb = "slash"
attack_sound = 'sound/weapons/slice.ogg'
miss_sound = 'sound/weapons/slashmiss.ogg'
burnmod = 1.25
heatmod = 1.55
meat = /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/plant
disliked_food = NONE
liked_food = NONE
toxic_food = NONE
/datum/species/pod/on_species_gain(mob/living/carbon/C, datum/species/old_species)
. = ..()
C.faction |= "plants"
C.faction |= "vines"
/datum/species/pod/on_species_loss(mob/living/carbon/C)
. = ..()
C.faction -= "plants"
C.faction -= "vines"
/datum/species/pod/spec_life(mob/living/carbon/human/H)
if(H.stat == DEAD)
return
var/light_amount = 0 //how much light there is in the place, affects receiving nutrition and healing
if(isturf(H.loc)) //else, there's considered to be no light
var/turf/T = H.loc
light_amount = min(1,T.get_lumcount()) - 0.5
H.nutrition += light_amount * 10
if(H.nutrition > NUTRITION_LEVEL_FULL)
H.nutrition = NUTRITION_LEVEL_FULL
if(light_amount > 0.2) //if there's enough light, heal
H.heal_overall_damage(0.75,0)
H.adjustOxyLoss(-0.5)
if(H.nutrition < NUTRITION_LEVEL_STARVING + 55)
H.adjustOxyLoss(5) //can eat to negate this unfortunately
H.adjustToxLoss(3)
/datum/species/pod/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H)
if(chem.id == "plantbgone")
H.adjustToxLoss(5)
H.reagents.remove_reagent(chem.id, REAGENTS_METABOLISM)
H.confused = max(H.confused, 1)
return TRUE
/datum/species/pod/on_hit(obj/item/projectile/P, mob/living/carbon/human/H)
switch(P.type)
if(/obj/item/projectile/energy/floramut)
if(prob(15))
H.rad_act(rand(30,80))
H.Knockdown(100)
H.visible_message("<span class='warning'>[H] writhes in pain as [H.p_their()] vacuoles boil.</span>", "<span class='userdanger'>You writhe in pain as your vacuoles boil!</span>", "<span class='italics'>You hear the crunching of leaves.</span>")
if(prob(80))
H.randmutb()
else
H.randmutg()
H.domutcheck()
else
H.adjustFireLoss(rand(5,15))
H.show_message("<span class='userdanger'>The radiation beam singes you!</span>")
if(/obj/item/projectile/energy/florayield)
H.nutrition = min(H.nutrition+30, NUTRITION_LEVEL_FULL)
/datum/species/pod
// A mutation caused by a human being ressurected in a revival pod. These regain health in light, and begin to wither in darkness.
name = "Podperson"
id = "pod"
default_color = "59CE00"
species_traits = list(SPECIES_ORGANIC,MUTCOLORS,EYECOLOR)
attack_verb = "slash"
attack_sound = 'sound/weapons/slice.ogg'
miss_sound = 'sound/weapons/slashmiss.ogg'
burnmod = 1.25
heatmod = 1.55
meat = /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/plant
disliked_food = NONE
liked_food = NONE
toxic_food = NONE
/datum/species/pod/on_species_gain(mob/living/carbon/C, datum/species/old_species)
. = ..()
C.faction |= "plants"
C.faction |= "vines"
/datum/species/pod/on_species_loss(mob/living/carbon/C)
. = ..()
C.faction -= "plants"
C.faction -= "vines"
/datum/species/pod/spec_life(mob/living/carbon/human/H)
if(H.stat == DEAD)
return
var/light_amount = 0 //how much light there is in the place, affects receiving nutrition and healing
if(isturf(H.loc)) //else, there's considered to be no light
var/turf/T = H.loc
light_amount = min(1,T.get_lumcount()) - 0.5
H.nutrition += light_amount * 10
if(H.nutrition > NUTRITION_LEVEL_FULL)
H.nutrition = NUTRITION_LEVEL_FULL
if(light_amount > 0.2) //if there's enough light, heal
H.heal_overall_damage(0.75,0)
H.adjustOxyLoss(-0.5)
if(H.nutrition < NUTRITION_LEVEL_STARVING + 55)
H.adjustOxyLoss(5) //can eat to negate this unfortunately
H.adjustToxLoss(3)
/datum/species/pod/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H)
if(chem.id == "plantbgone")
H.adjustToxLoss(5)
H.reagents.remove_reagent(chem.id, REAGENTS_METABOLISM)
H.confused = max(H.confused, 1)
return TRUE
/datum/species/pod/on_hit(obj/item/projectile/P, mob/living/carbon/human/H)
switch(P.type)
if(/obj/item/projectile/energy/floramut)
if(prob(15))
H.rad_act(rand(30,80))
H.Knockdown(100)
H.visible_message("<span class='warning'>[H] writhes in pain as [H.p_their()] vacuoles boil.</span>", "<span class='userdanger'>You writhe in pain as your vacuoles boil!</span>", "<span class='italics'>You hear the crunching of leaves.</span>")
if(prob(80))
H.randmutb()
else
H.randmutg()
H.domutcheck()
else
H.adjustFireLoss(rand(5,15))
H.show_message("<span class='userdanger'>The radiation beam singes you!</span>")
if(/obj/item/projectile/energy/florayield)
H.nutrition = min(H.nutrition+30, NUTRITION_LEVEL_FULL)
@@ -34,7 +34,8 @@
/mob/living/simple_animal/drone/syndrone/Initialize()
. = ..()
internal_storage.hidden_uplink.telecrystals = 10
GET_COMPONENT_FROM(hidden_uplink, /datum/component/uplink, internal_storage)
hidden_uplink.telecrystals = 10
/mob/living/simple_animal/drone/syndrone/Login()
..()
@@ -47,7 +48,8 @@
/mob/living/simple_animal/drone/syndrone/badass/Initialize()
. = ..()
internal_storage.hidden_uplink.telecrystals = 30
GET_COMPONENT_FROM(hidden_uplink, /datum/component/uplink, internal_storage)
hidden_uplink.telecrystals = 30
var/obj/item/implant/weapons_auth/W = new/obj/item/implant/weapons_auth(src)
W.implant(src)
@@ -1,18 +1,18 @@
/mob/living/simple_animal/hostile/creature
name = "creature"
desc = "A sanity-destroying otherthing."
icon_state = "otherthing"
icon_living = "otherthing"
icon_dead = "otherthing-dead"
health = 80
maxHealth = 80
obj_damage = 100
melee_damage_lower = 25
melee_damage_upper = 50
attacktext = "chomps"
attack_sound = 'sound/weapons/bite.ogg'
faction = list("creature")
speak_emote = list("screams")
gold_core_spawnable = HOSTILE_SPAWN
atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
minbodytemp = 0
/mob/living/simple_animal/hostile/creature
name = "creature"
desc = "A sanity-destroying otherthing."
icon_state = "otherthing"
icon_living = "otherthing"
icon_dead = "otherthing-dead"
health = 80
maxHealth = 80
obj_damage = 100
melee_damage_lower = 25
melee_damage_upper = 50
attacktext = "chomps"
attack_sound = 'sound/weapons/bite.ogg'
faction = list("creature")
speak_emote = list("screams")
gold_core_spawnable = HOSTILE_SPAWN
atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
minbodytemp = 0
+2 -8
View File
@@ -99,19 +99,13 @@
if(deg && (deg > 0 && deg <= 360))
degrees = deg
to_chat(user, "<span class='notice'>You rotate the top of the pen to [degrees] degrees.</span>")
GET_COMPONENT(hidden_uplink, /datum/component/uplink)
if(hidden_uplink && degrees == traitor_unlock_degrees)
to_chat(user, "<span class='warning'>Your pen makes a clicking noise, before quickly rotating back to 0 degrees!</span>")
degrees = 0
hidden_uplink.locked = FALSE
hidden_uplink.interact(user)
/obj/item/pen/attackby(obj/item/I, mob/user, params)
if(hidden_uplink)
return hidden_uplink.attackby(I, user, params)
else
return ..()
/obj/item/pen/attack(mob/living/M, mob/user,stealth)
if(!istype(M))
return
-162
View File
@@ -1,162 +0,0 @@
GLOBAL_LIST_EMPTY(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.'
* 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.
**/
/obj/item/device/uplink
name = "syndicate uplink"
desc = "There is something wrong if you're examining this."
var/active = FALSE
var/lockable = TRUE
var/telecrystals = 20
var/selected_cat = null
var/owner = null
var/datum/game_mode/gamemode = null
var/spent_telecrystals = 0
var/purchase_log = ""
var/list/uplink_items
var/hidden_crystals = 0
/obj/item/device/uplink/Initialize()
. = ..()
GLOB.uplinks += src
uplink_items = get_uplink_items(gamemode)
/obj/item/device/uplink/proc/set_gamemode(gamemode)
src.gamemode = gamemode
uplink_items = get_uplink_items(gamemode)
/obj/item/device/uplink/Destroy()
GLOB.uplinks -= src
return ..()
/obj/item/device/uplink/attackby(obj/item/I, mob/user, params)
for(var/item in subtypesof(/datum/uplink_item))
var/datum/uplink_item/UI = item
var/path = null
if(initial(UI.refund_path))
path = initial(UI.refund_path)
else
path = initial(UI.item)
var/cost = 0
if(initial(UI.refund_amount))
cost = initial(UI.refund_amount)
else
cost = initial(UI.cost)
var/refundable = initial(UI.refundable)
if(I.type == path && refundable && I.check_uplink_validity())
telecrystals += cost
spent_telecrystals -= cost
to_chat(user, "<span class='notice'>[I] refunded.</span>")
qdel(I)
return
..()
/obj/item/device/uplink/interact(mob/user)
active = TRUE
if(user)
ui_interact(user)
/obj/item/device/uplink/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.inventory_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "uplink", name, 450, 750, master_ui, state)
ui.set_autoupdate(FALSE) // This UI is only ever opened by one person, and never is updated outside of user input.
ui.set_style("syndicate")
ui.open()
/obj/item/device/uplink/ui_data(mob/user)
if(!user.mind)
return
var/list/data = list()
data["telecrystals"] = telecrystals
data["lockable"] = lockable
data["categories"] = list()
for(var/category in uplink_items)
var/list/cat = list(
"name" = category,
"items" = (category == selected_cat ? list() : null))
if(category == selected_cat)
for(var/item in uplink_items[category])
var/datum/uplink_item/I = uplink_items[category][item]
if(I.limited_stock == 0)
continue
if(I.restricted_roles.len)
var/is_inaccessible = 1
for(var/R in I.restricted_roles)
if(R == user.mind.assigned_role)
is_inaccessible = 0
if(is_inaccessible)
continue
cat["items"] += list(list(
"name" = I.name,
"cost" = I.cost,
"desc" = I.desc,
))
data["categories"] += list(cat)
return data
/obj/item/device/uplink/ui_act(action, params)
if(!active)
return
switch(action)
if("buy")
var/item = params["item"]
var/list/buyable_items = list()
for(var/category in uplink_items)
buyable_items += uplink_items[category]
if(item in buyable_items)
var/datum/uplink_item/I = buyable_items[item]
I.buy(usr, src)
. = TRUE
if("lock")
active = FALSE
telecrystals += hidden_crystals
hidden_crystals = 0
SStgui.close_uis(src)
if("select")
selected_cat = params["category"]
return 1
/obj/item/device/uplink/ui_host()
return loc
// Refund certain items by hitting the uplink with it.
/obj/item/device/radio/uplink/attackby(obj/item/I, mob/user, params)
return hidden_uplink.attackby(I, user, params)
// A collection of pre-set uplinks, for admin spawns.
/obj/item/device/radio/uplink/Initialize()
. = ..()
icon_state = "radio"
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
hidden_uplink = new(src)
hidden_uplink.active = TRUE
hidden_uplink.lockable = FALSE
/obj/item/device/radio/uplink/nuclear/Initialize()
. = ..()
hidden_uplink.set_gamemode(/datum/game_mode/nuclear)
/obj/item/device/multitool/uplink/Initialize()
. = ..()
hidden_uplink = new(src)
hidden_uplink.active = TRUE
hidden_uplink.lockable = FALSE
/obj/item/pen/uplink/Initialize()
. = ..()
hidden_uplink = new(src)
traitor_unlock_degrees = 360
File diff suppressed because it is too large Load Diff
-178
View File
@@ -1,178 +0,0 @@
/datum/uplink_item/stealthy_tools/syndi_borer
name = "Syndicate Brain Slug"
desc = "A small cortical borer, modified to be completely loyal to the owner. \
Genetically infertile, these brain slugs can assist medically in a support role, or take direct action \
to assist their host."
item = /obj/item/antag_spawner/syndi_borer
refundable = TRUE
cost = 10
surplus = 20 //Let's not have this be too common
exclude_modes = list(/datum/game_mode/nuclear)
/datum/uplink_item/stealthy_tools/holoparasite
name="Holoparasite Injector"
desc="An injector containing a swarm of holographic parasites. \
They mimic the function of the guardians employed by the Space Wizard Federation, and their form can be selected upon application \
NOTE: The precise nature of the symbiosis required by the parasites renders them incompatible with changelings" //updated to actually describe what they do and warn traitorchans not to buy it
item = /obj/item/storage/box/syndie_kit/holoparasite
refundable = TRUE
cost = 15
surplus = 20 //Nobody needs a ton of parasites
exclude_modes = list(/datum/game_mode/nuclear)
refund_path = /obj/item/guardiancreator/tech/choose/traitor
/obj/item/storage/box/syndie_kit/holoparasite
name = "box"
/obj/item/storage/box/syndie_kit/holoparasite/PopulateContents()
new /obj/item/guardiancreator/tech/choose/traitor(src)
new /obj/item/paper/guides/antag/guardian(src)
/datum/uplink_item/dangerous/antitank
name = "Anti Tank Pistol"
desc = "Essentially amounting to a sniper rifle with no stock and barrel (or indeed, any rifling at all), \
this extremely dubious pistol is guaranteed to dislocate your wrists and hit the broad side of a barn! \
Uses sniper ammo. \
Bullets tend to veer off-course. We are not responsible for any unintentional damage or injury resulting from inaacuracy."
item = /obj/item/gun/ballistic/automatic/pistol/antitank/syndicate
cost = 14
surplus = 25
include_modes = list(/datum/game_mode/nuclear)
/* Commented out due to introduction of reskinnable stetchkins. May still have a niche if people decide it somehow has value.
/datum/uplink_item/dangerous/stealthpistol
name = "Stealth Pistol"
desc = "A compact, easily concealable bullpup pistol that fires 10mm auto rounds in 8 round magazines. \
Has an integrated suppressor."
item = /obj/item/gun/ballistic/automatic/pistol/stealth
cost = 10
surplus = 30
*/
///Soporific 10mm mags///
/datum/uplink_item/ammo/pistolzzz
name = "10mm Soporific Magazine"
desc = "An additional 8-round 10mm magazine; compatible with the Stechkin Pistol. Loaded with soporific rounds that put the target to sleep. \
NOTE: Soporific is not instant acting due to the constraints of the round's scale. Will usually require three shots to take effect."
item = /obj/item/ammo_box/magazine/m10mm/soporific
cost = 2
///flechette memes///
/datum/uplink_item/dangerous/flechettegun
name = "Flechette Launcher"
desc = "A compact bullpup that fires micro-flechettes.\
Flechettes have very poor performance idividually, but can be very deadly in numbers. \
Pre-loaded with armor piercing flechettes that are capable of puncturing most kinds of armor."
item = /obj/item/gun/ballistic/automatic/flechette
cost = 12
surplus = 30
include_modes = list(/datum/game_mode/nuclear)
/datum/uplink_item/ammo/flechetteap
name = "Armor Piercing Flechette Magazine"
desc = "An additional 40-round flechette magazine; compatible with the Flechette Launcer. \
Loaded with armor piercing flechettes that very nearly ignore armor, but are not very effective agaisnt flesh."
item = /obj/item/ammo_box/magazine/flechette
cost = 2
include_modes = list(/datum/game_mode/nuclear)
/datum/uplink_item/ammo/flechettes
name = "Serrated Flechette Magazine"
desc = "An additional 40-round flechette magazine; compatible with the Flechette Launcer. \
Loaded with serrated flechettes that shreds flesh, but is stopped dead in its tracks by armor. \
These flechettes are highly likely to sever arteries, and even limbs."
item = /obj/item/ammo_box/magazine/flechette/s
cost = 2
include_modes = list(/datum/game_mode/nuclear)
///shredder///
/datum/uplink_item/nukeoffer/shredder
name = "Shredder bundle"
desc = "A truly horrific weapon designed simply to maim its victim, the CX Shredder is banned by several intergalactic treaties. \
You'll get two of them with this. And spare ammo to boot. And we'll throw in an extra elite hardsuit and chest rig to hold them all!"
item = /obj/item/storage/backpack/duffelbag/syndie/shredderbundle
cost = 30 // normally 41
///Modular Pistols///
/datum/uplink_item/bundle/modular
name="Modular Pistol Kit"
desc="A heavy briefcase containing one modular pistol (chambered in 10mm), one supressor, and spare ammunition, including a box of soporific ammo. \
Includes a suit jacket that is padded with a robust liner."
item = /obj/item/storage/briefcase/modularbundle
cost = 12
//////Bundle stuff//////
///bundle category///
/datum/uplink_item/bundle
category = "Bundles"
surplus = 0
cant_discount = TRUE
///place bundle storage items here I guess///
/obj/item/storage/briefcase/modularbundle
name = "briefcase"
desc = "It's label reads genuine hardened Captain leather, but suspiciously has no other tags or branding."
icon_state = "briefcase"
flags_1 = CONDUCT_1
force = 10
hitsound = "swing_hit"
throw_speed = 2
throw_range = 4
w_class = WEIGHT_CLASS_BULKY
max_w_class = WEIGHT_CLASS_NORMAL
max_combined_w_class = 21
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked")
resistance_flags = FLAMMABLE
max_integrity = 150
/obj/item/storage/briefcase/modularbundle/PopulateContents()
new /obj/item/gun/ballistic/automatic/pistol/modular(src)
new /obj/item/suppressor(src)
new /obj/item/ammo_box/magazine/m10mm(src)
new /obj/item/ammo_box/magazine/m10mm/soporific(src)
new /obj/item/ammo_box/c10mm/soporific(src)
new /obj/item/clothing/under/lawyer/blacksuit(src)
new /obj/item/clothing/accessory/waistcoat(src)
new /obj/item/clothing/suit/toggle/lawyer/black/syndie(src)
/obj/item/clothing/suit/toggle/lawyer/black/syndie
desc = "A snappy dress jacket. Suspiciously has no tags or branding."
armor = list(melee = 10, bullet = 10, laser = 10, energy = 10, bomb = 10)
/obj/item/storage/backpack/duffelbag/syndie/shredderbundle
desc = "A large duffel bag containing two CX Shredders, some magazines, an elite hardsuit, and a chest rig."
/obj/item/storage/backpack/duffelbag/syndie/shredderbundle/PopulateContents()
new /obj/item/ammo_box/magazine/flechette/shredder(src)
new /obj/item/ammo_box/magazine/flechette/shredder(src)
new /obj/item/ammo_box/magazine/flechette/shredder(src)
new /obj/item/ammo_box/magazine/flechette/shredder(src)
new /obj/item/gun/ballistic/automatic/flechette/shredder(src)
new /obj/item/gun/ballistic/automatic/flechette/shredder(src)
new /obj/item/storage/belt/military(src)
new /obj/item/clothing/suit/space/hardsuit/syndi/elite(src)
///End of Bundle stuff///
/*/////////////////////////////////////////////////////////////////////////
///////////// The TRUE Energy Sword ///////////////////////////
*//////////////////////////////////////////////////////////////////////////
/datum/uplink_item/dangerous/cxneb
name = "Dragon's Tooth Non-Eutactic Blade"
desc = "An illegal modification of a weapon that is functionally identical to the energy sword, \
the Non-Eutactic Blade (NEB) forges a hardlight blade on-demand, \
generating an extremely sharp, unbreakable edge that is guaranteed to satisfy your every need. \
This particular model has a polychromic hardlight generator, allowing you to murder in style! \
The illegal modifications bring this weapon up to par with the classic energy sword, and also gives it the energy sword's distinctive sounds."
item = /obj/item/melee/transforming/energy/sword/cx/traitor
cost = 8