Merge pull request #555 from Citadel-Station-13/upstream-merge-26501

[MIRROR] Small abductors refactor
This commit is contained in:
LetterJay
2017-04-25 20:10:20 -05:00
committed by GitHub
9 changed files with 257 additions and 271 deletions

View File

@@ -1192,14 +1192,17 @@
log_admin("[key_name(usr)] turned [current] into abductor.")
SSticker.mode.update_abductor_icons_added(src)
if("equip")
if(!ishuman(current))
to_chat(usr, "<span class='warning'>This only works on humans!</span>")
return
var/mob/living/carbon/human/H = current
var/gear = alert("Agent or Scientist Gear","Gear","Agent","Scientist")
if(gear)
var/datum/game_mode/abduction/temp = new
temp.equip_common(current)
if(gear=="Agent")
temp.equip_agent(current)
H.equipOutfit(/datum/outfit/abductor/agent)
else
temp.equip_scientist(current)
H.equipOutfit(/datum/outfit/abductor/scientist)
else if (href_list["monkey"])
var/mob/living/L = current
@@ -1468,11 +1471,8 @@
H.set_species(/datum/species/abductor)
var/datum/species/abductor/S = H.dna.species
switch(role)
if("Agent")
S.agent = 1
if("Scientist")
S.scientist = 1
if(role == "Scientist")
S.scientist = TRUE
S.team = team
var/list/obj/effect/landmark/abductor/agent_landmarks = new
@@ -1489,13 +1489,10 @@
if(teleport=="Yes")
switch(role)
if("Agent")
S.agent = 1
L = agent_landmarks[team]
H.loc = L.loc
if("Scientist")
S.scientist = 1
L = agent_landmarks[team]
H.loc = L.loc
L = scientist_landmarks[team]
H.forceMove(L.loc)
/datum/mind/proc/AddSpell(obj/effect/proc_holder/spell/S)
spell_list += S

View File

@@ -0,0 +1,148 @@
/datum/objective/abductee
dangerrating = 5
completed = 1
/datum/objective/abductee/steal
explanation_text = "Steal all"
/datum/objective/abductee/steal/New()
var/target = pick(list("pets","lights","monkeys","fruits","shoes","bars of soap", "weapons", "computers", "organs"))
explanation_text+=" [target]."
/datum/objective/abductee/paint
explanation_text = "The station is hideous. You must color it all"
/datum/objective/abductee/paint/New()
var/color = pick(list("red", "blue", "green", "yellow", "orange", "purple", "black", "in rainbows", "in blood"))
explanation_text+= " [color]!"
/datum/objective/abductee/speech
explanation_text = "Your brain is broken... you can only communicate in"
/datum/objective/abductee/speech/New()
var/style = pick(list("pantomime", "rhyme", "haiku", "extended metaphors", "riddles", "extremely literal terms", "sound effects", "military jargon"))
explanation_text+= " [style]."
/datum/objective/abductee/capture
explanation_text = "Capture"
/datum/objective/abductee/capture/New()
var/list/jobs = SSjob.occupations.Copy()
for(var/datum/job/J in jobs)
if(J.current_positions < 1)
jobs -= J
if(jobs.len > 0)
var/datum/job/target = pick(jobs)
explanation_text += " a [target.title]."
else
explanation_text += " someone."
/datum/objective/abductee/shuttle
explanation_text = "You must escape the station! Get the shuttle called!"
/datum/objective/abductee/noclone
explanation_text = "Don't allow anyone to be cloned."
/datum/objective/abductee/oxygen
explanation_text = "The oxygen is killing them all and they don't even know it. Make sure no oxygen is on the station."
/datum/objective/abductee/blazeit
explanation_text = "Your body must be improved. Ingest as many drugs as you can."
/datum/objective/abductee/yumyum
explanation_text = "You are hungry. Eat as much food as you can find."
/datum/objective/abductee/insane
explanation_text = "You see you see what they cannot you see the open door you seeE you SEeEe you SEe yOU seEee SHOW THEM ALL"
/datum/objective/abductee/cannotmove
explanation_text = "Convince the crew that you are a paraplegic."
/datum/objective/abductee/deadbodies
explanation_text = "Start a collection of corpses. Don't kill people to get these corpses."
/datum/objective/abductee/floors
explanation_text = "Replace all the floor tiles with wood, carpeting, grass or bling."
/datum/objective/abductee/POWERUNLIMITED
explanation_text = "Flood the station's powernet with as much electricity as you can."
/datum/objective/abductee/pristine
explanation_text = "The CEO of Nanotrasen is coming! Ensure the station is in absolutely pristine condition."
/datum/objective/abductee/nowalls
explanation_text = "The crew must get to know one another better. Break down the walls inside the station!"
/datum/objective/abductee/nations
explanation_text = "Ensure your department prospers over all else."
/datum/objective/abductee/abductception
explanation_text = "You have been changed forever. Find the ones that did this to you and give them a taste of their own medicine."
/datum/objective/abductee/summon
explanation_text = "The elder gods hunger. Gather a cult and conduct a ritual to summon one."
/datum/objective/abductee/machine
explanation_text = "You are secretly an android. Interface with as many machines as you can to boost your own power so the AI may acknowledge you at last."
/datum/objective/abductee/calling
explanation_text = "Call forth a spirit from the other side."
/datum/objective/abductee/calling/New()
var/mob/dead/D = pick(GLOB.dead_mob_list)
if(D)
explanation_text = "You know that [D] has perished. Hold a seance to call them from the spirit realm."
/datum/objective/abductee/social_experiment
explanation_text = "This is a secret social experiment conducted by Nanotrasen. Convince the crew that this is the truth."
/datum/objective/abductee/vr
explanation_text = "It's all an entirely virtual simulation within an underground vault. Convince the crew to escape the shackles of VR."
/datum/objective/abductee/pets
explanation_text = "Nanotrasen is abusing the animals! Save as many as you can!"
/datum/objective/abductee/defect
explanation_text = "Fuck the system! Defect from the station and start an independent colony in space, Lavaland or the derelict. Recruit crewmates if you can."
/datum/objective/abductee/promote
explanation_text = "Climb the corporate ladder all the way to the top!"
/datum/objective/abductee/science
explanation_text = "So much lies undiscovered. Look deeper into the machinations of the universe."
/datum/objective/abductee/build
explanation_text = "Expand the station."
/datum/objective/abductee/pragnant
explanation_text = "You are pregnant and soon due. Find a safe place to deliver your baby."
/datum/objective/abductee/engine
explanation_text = "Go have a good conversation with the singularity/tesla/supermatter crystal. Bonus points if it responds."
/datum/objective/abductee/music
explanation_text = "You burn with passion for music. Share your vision. If anyone hates it, beat them on the head with your instrument!"
/datum/objective/abductee/clown
explanation_text = "The clown is not funny. You can do better! Steal his audience and make the crew laugh!"
/datum/objective/abductee/party
explanation_text = "You're throwing a huge rager. Make it as awesome as possible so the whole crew comes... OR ELSE!"
/datum/objective/abductee/pets
explanation_text = "All the pets around here suck. You need to make them cooler. Replace them with exotic beasts!"
/datum/objective/abductee/conspiracy
explanation_text = "The leaders of this station are hiding a grand, evil conspiracy. Only you can learn what it is, and expose it to the people!"
/datum/objective/abductee/stalker
explanation_text = "The Syndicate has hired you to compile dossiers on all important members of the crew. Be sure they don't know you're doing it."
/datum/objective/abductee/narrator
explanation_text = "You're the narrator of this tale. Follow around the protagonists to tell their story."
/datum/objective/abductee/lurve
explanation_text = "You are doomed to feel woefully incomplete forever... until you find your true love on this station. They're waiting for you!"
/datum/objective/abductee/sixthsense
explanation_text = "You died back there and went to heaven... or is it hell? No one here seems to know they're dead. Convince them, and maybe you can escape this limbo."

View File

@@ -85,56 +85,14 @@
return 1
/datum/game_mode/abduction/post_setup()
//Spawn Team
var/list/obj/effect/landmark/abductor/agent_landmarks = new
var/list/obj/effect/landmark/abductor/scientist_landmarks = new
agent_landmarks.len = max_teams
scientist_landmarks.len = max_teams
for(var/obj/effect/landmark/abductor/A in GLOB.landmarks_list)
if(istype(A,/obj/effect/landmark/abductor/agent))
agent_landmarks[text2num(A.team)] = A
else if(istype(A,/obj/effect/landmark/abductor/scientist))
scientist_landmarks[text2num(A.team)] = A
var/datum/mind/agent
var/obj/effect/landmark/L
var/datum/mind/scientist
var/team_name
var/mob/living/carbon/human/H
var/datum/species/abductor/S
for(var/team_number=1,team_number<=abductor_teams,team_number++)
team_name = team_names[team_number]
agent = agents[team_number]
H = agent.current
L = agent_landmarks[team_number]
H.loc = L.loc
H.set_species(/datum/species/abductor)
S = H.dna.species
S.agent = 1
S.team = team_number
H.real_name = team_name + " Agent"
equip_common(H,team_number)
equip_agent(H,team_number)
greet_agent(agent,team_number)
scientist = scientists[team_number]
H = scientist.current
L = scientist_landmarks[team_number]
H.loc = L.loc
H.set_species(/datum/species/abductor)
S = H.dna.species
S.scientist = 1
S.team = team_number
H.real_name = team_name + " Scientist"
equip_common(H,team_number)
equip_scientist(H,team_number)
greet_scientist(scientist,team_number)
post_setup_team(team_number)
return ..()
//Used for create antag buttons
/datum/game_mode/abduction/proc/post_setup_team(team_number)
var/list/obj/effect/landmark/abductor/agent_landmarks = new
var/list/obj/effect/landmark/abductor/scientist_landmarks = new
var/list/obj/effect/landmark/abductor/agent_landmarks = list()
var/list/obj/effect/landmark/abductor/scientist_landmarks = list()
agent_landmarks.len = max_teams
scientist_landmarks.len = max_teams
for(var/obj/effect/landmark/abductor/A in GLOB.landmarks_list)
@@ -143,39 +101,36 @@
else if(istype(A,/obj/effect/landmark/abductor/scientist))
scientist_landmarks[text2num(A.team)] = A
var/team_name = team_names[team_number]
var/datum/mind/agent
var/obj/effect/landmark/L
var/datum/mind/scientist
var/team_name
var/mob/living/carbon/human/H
var/datum/species/abductor/S
team_name = team_names[team_number]
agent = agents[team_number]
H = agent.current
L = agent_landmarks[team_number]
H.loc = L.loc
H.forceMove(L.loc)
H.set_species(/datum/species/abductor)
S = H.dna.species
S.agent = 1
S.team = team_number
H.real_name = team_name + " Agent"
equip_common(H,team_number)
equip_agent(H,team_number)
H.equipOutfit(/datum/outfit/abductor/agent)
greet_agent(agent,team_number)
scientist = scientists[team_number]
H = scientist.current
L = scientist_landmarks[team_number]
H.loc = L.loc
H.forceMove(L.loc)
H.set_species(/datum/species/abductor)
S = H.dna.species
S.scientist = 1
S.scientist = TRUE
S.team = team_number
H.real_name = team_name + " Scientist"
equip_common(H,team_number)
equip_scientist(H,team_number)
H.equipOutfit(/datum/outfit/abductor/scientist)
greet_scientist(scientist,team_number)
@@ -200,57 +155,10 @@
abductor.announce_objectives()
/datum/game_mode/abduction/proc/equip_common(mob/living/carbon/human/agent,team_number)
var/radio_freq = GLOB.SYND_FREQ
var/obj/item/device/radio/R = new /obj/item/device/radio/headset/syndicate/alt(agent)
R.set_frequency(radio_freq)
agent.equip_to_slot_or_del(R, slot_ears)
agent.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(agent), slot_shoes)
agent.equip_to_slot_or_del(new /obj/item/clothing/under/color/grey(agent), slot_w_uniform) //they're greys gettit
agent.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(agent), slot_back)
/datum/game_mode/abduction/proc/get_team_console(team)
var/obj/machinery/abductor/console/console
for(var/obj/machinery/abductor/console/c in GLOB.machines)
if(c.team == team)
console = c
break
return console
/datum/game_mode/abduction/proc/equip_agent(mob/living/carbon/human/agent,team_number)
if(!team_number)
var/datum/species/abductor/S = agent.dna.species
team_number = S.team
var/obj/machinery/abductor/console/console = get_team_console(team_number)
var/obj/item/clothing/suit/armor/abductor/vest/V = new /obj/item/clothing/suit/armor/abductor/vest(agent)
if(console!=null)
console.vest = V
V.flags |= NODROP
agent.equip_to_slot_or_del(V, slot_wear_suit)
agent.equip_to_slot_or_del(new /obj/item/weapon/abductor_baton(agent), slot_in_backpack)
agent.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/alien(agent), slot_in_backpack)
agent.equip_to_slot_or_del(new /obj/item/device/abductor/silencer(agent), slot_in_backpack)
agent.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/abductor(agent), slot_head)
agent.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/military/abductor/full(agent), slot_belt)
/datum/game_mode/abduction/proc/equip_scientist(var/mob/living/carbon/human/scientist,var/team_number)
if(!team_number)
var/datum/species/abductor/S = scientist.dna.species
team_number = S.team
var/obj/machinery/abductor/console/console = get_team_console(team_number)
var/obj/item/device/abductor/gizmo/G = new /obj/item/device/abductor/gizmo(scientist)
if(console!=null)
console.gizmo = G
G.console = console
scientist.equip_to_slot_or_del(G, slot_in_backpack)
var/obj/item/weapon/implant/abductor/beamplant = new /obj/item/weapon/implant/abductor(scientist)
beamplant.implant(scientist)
/datum/game_mode/abduction/proc/get_team_console(team_number)
for(var/obj/machinery/abductor/console/C in GLOB.machines)
if(C.team == team_number)
return C
/datum/game_mode/abduction/check_finished()
if(!finished)
@@ -336,152 +244,3 @@
var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_ABDUCTOR]
hud.leave_hud(alien_mind.current)
set_antag_hud(alien_mind.current, null)
/datum/objective/abductee
dangerrating = 5
completed = 1
/datum/objective/abductee/steal
explanation_text = "Steal all"
/datum/objective/abductee/steal/New()
var/target = pick(list("pets","lights","monkeys","fruits","shoes","bars of soap", "weapons", "computers", "organs"))
explanation_text+=" [target]."
/datum/objective/abductee/paint
explanation_text = "The station is hideous. You must color it all"
/datum/objective/abductee/paint/New()
var/color = pick(list("red", "blue", "green", "yellow", "orange", "purple", "black", "in rainbows", "in blood"))
explanation_text+= " [color]!"
/datum/objective/abductee/speech
explanation_text = "Your brain is broken... you can only communicate in"
/datum/objective/abductee/speech/New()
var/style = pick(list("pantomime", "rhyme", "haiku", "extended metaphors", "riddles", "extremely literal terms", "sound effects", "military jargon"))
explanation_text+= " [style]."
/datum/objective/abductee/capture
explanation_text = "Capture"
/datum/objective/abductee/capture/New()
var/list/jobs = SSjob.occupations.Copy()
for(var/datum/job/J in jobs)
if(J.current_positions < 1)
jobs -= J
if(jobs.len > 0)
var/datum/job/target = pick(jobs)
explanation_text += " a [target.title]."
else
explanation_text += " someone."
/datum/objective/abductee/shuttle
explanation_text = "You must escape the station! Get the shuttle called!"
/datum/objective/abductee/noclone
explanation_text = "Don't allow anyone to be cloned."
/datum/objective/abductee/oxygen
explanation_text = "The oxygen is killing them all and they don't even know it. Make sure no oxygen is on the station."
/datum/objective/abductee/blazeit
explanation_text = "Your body must be improved. Ingest as many drugs as you can."
/datum/objective/abductee/yumyum
explanation_text = "You are hungry. Eat as much food as you can find."
/datum/objective/abductee/insane
explanation_text = "You see you see what they cannot you see the open door you seeE you SEeEe you SEe yOU seEee SHOW THEM ALL"
/datum/objective/abductee/cannotmove
explanation_text = "Convince the crew that you are a paraplegic."
/datum/objective/abductee/deadbodies
explanation_text = "Start a collection of corpses. Don't kill people to get these corpses."
/datum/objective/abductee/floors
explanation_text = "Replace all the floor tiles with wood, carpeting, grass or bling."
/datum/objective/abductee/POWERUNLIMITED
explanation_text = "Flood the station's powernet with as much electricity as you can."
/datum/objective/abductee/pristine
explanation_text = "The CEO of Nanotrasen is coming! Ensure the station is in absolutely pristine condition."
/datum/objective/abductee/nowalls
explanation_text = "The crew must get to know one another better. Break down the walls inside the station!"
/datum/objective/abductee/nations
explanation_text = "Ensure your department prospers over all else."
/datum/objective/abductee/abductception
explanation_text = "You have been changed forever. Find the ones that did this to you and give them a taste of their own medicine."
/datum/objective/abductee/summon
explanation_text = "The elder gods hunger. Gather a cult and conduct a ritual to summon one."
/datum/objective/abductee/machine
explanation_text = "You are secretly an android. Interface with as many machines as you can to boost your own power so the AI may acknowledge you at last."
/datum/objective/abductee/calling
explanation_text = "Call forth a spirit from the other side."
/datum/objective/abductee/calling/New()
var/mob/dead/D = pick(GLOB.dead_mob_list)
if(D)
explanation_text = "You know that [D] has perished. Hold a seance to call them from the spirit realm."
/datum/objective/abductee/social_experiment
explanation_text = "This is a secret social experiment conducted by Nanotrasen. Convince the crew that this is the truth."
/datum/objective/abductee/vr
explanation_text = "It's all an entirely virtual simulation within an underground vault. Convince the crew to escape the shackles of VR."
/datum/objective/abductee/pets
explanation_text = "Nanotrasen is abusing the animals! Save as many as you can!"
/datum/objective/abductee/defect
explanation_text = "Fuck the system! Defect from the station and start an independent colony in space, Lavaland or the derelict. Recruit crewmates if you can."
/datum/objective/abductee/promote
explanation_text = "Climb the corporate ladder all the way to the top!"
/datum/objective/abductee/science
explanation_text = "So much lies undiscovered. Look deeper into the machinations of the universe."
/datum/objective/abductee/build
explanation_text = "Expand the station."
/datum/objective/abductee/pragnant
explanation_text = "You are pregnant and soon due. Find a safe place to deliver your baby."
/datum/objective/abductee/engine
explanation_text = "Go have a good conversation with the singularity/tesla/supermatter crystal. Bonus points if it responds."
/datum/objective/abductee/music
explanation_text = "You burn with passion for music. Share your vision. If anyone hates it, beat them on the head with your instrument!"
/datum/objective/abductee/clown
explanation_text = "The clown is not funny. You can do better! Steal his audience and make the crew laugh!"
/datum/objective/abductee/party
explanation_text = "You're throwing a huge rager. Make it as awesome as possible so the whole crew comes... OR ELSE!"
/datum/objective/abductee/pets
explanation_text = "All the pets around here suck. You need to make them cooler. Replace them with exotic beasts!"
/datum/objective/abductee/conspiracy
explanation_text = "The leaders of this station are hiding a grand, evil conspiracy. Only you can learn what it is, and expose it to the people!"
/datum/objective/abductee/stalker
explanation_text = "The Syndicate has hired you to compile dossiers on all important members of the crew. Be sure they don't know you're doing it."
/datum/objective/abductee/narrator
explanation_text = "You're the narrator of this tale. Follow around the protagonists to tell their story."
/datum/objective/abductee/lurve
explanation_text = "You are doomed to feel woefully incomplete forever... until you find your true love on this station. They're waiting for you!"
/datum/objective/abductee/sixthsense
explanation_text = "You died back there and went to heaven... or is it hell? No one here seems to know they're dead. Convince them, and maybe you can escape this limbo."

View File

@@ -479,6 +479,25 @@ Congratulations! You are now trained for invasive xenobiology research!"}
if(BATON_PROBE)
to_chat(user, "<span class='warning'>The baton is in probing mode.</span>")
/obj/item/device/radio/headset/abductor
name = "alien headset"
desc = "An advanced alien headset designed to monitor communications of human space stations. Why does it have a microphone? No one knows."
origin_tech = "magnets=2;abductor=3"
icon = 'icons/obj/abductor.dmi'
icon_state = "abductor_headset"
item_state = "abductor_headset"
keyslot2 = new /obj/item/device/encryptionkey/heads/captain
/obj/item/device/radio/headset/abductor/Initialize(mapload)
..()
SET_SECONDARY_FLAG(src, BANG_PROTECT)
make_syndie()
/obj/item/device/radio/headset/abductor/attackby(obj/item/weapon/W, mob/user, params)
if(istype(W, /obj/item/weapon/screwdriver))
return // Stops humans from disassembling abductor headsets.
return ..()
/obj/item/weapon/scalpel/alien
name = "alien scalpel"

View File

@@ -0,0 +1,62 @@
/datum/outfit/abductor
name = "Abductor Basic"
uniform = /obj/item/clothing/under/color/grey //they're greys gettit
shoes = /obj/item/clothing/shoes/combat
back = /obj/item/weapon/storage/backpack
ears = /obj/item/device/radio/headset/abductor
/datum/outfit/abductor/proc/get_team_console(team_number)
for(var/obj/machinery/abductor/console/C in GLOB.machines)
if(C.team == team_number)
return C
/datum/outfit/abductor/proc/link_to_console(mob/living/carbon/human/H, team_number)
if(!team_number && isabductor(H))
var/datum/species/abductor/S = H.dna.species
team_number = S.team
if(!team_number)
team_number = 1
var/obj/machinery/abductor/console/console = get_team_console(team_number)
if(console)
var/obj/item/clothing/suit/armor/abductor/vest/V = locate() in H
if(V)
console.vest = V
V.flags |= NODROP
var/obj/item/device/abductor/gizmo/G = locate() in H.getBackSlot()
if(G)
console.gizmo = G
G.console = console
/datum/outfit/abductor/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE)
..()
if(!visualsOnly)
link_to_console(H)
/datum/outfit/abductor/agent
name = "Abductor Agent"
head = /obj/item/clothing/head/helmet/abductor
suit = /obj/item/clothing/suit/armor/abductor/vest
belt = /obj/item/weapon/storage/belt/military/abductor/full
backpack_contents = list(
/obj/item/weapon/abductor_baton = 1,
/obj/item/weapon/gun/energy/alien = 1,
/obj/item/device/abductor/silencer = 1
)
/datum/outfit/abductor/scientist
name = "Abductor Scientist"
backpack_contents = list(
/obj/item/device/abductor/gizmo = 1
)
/datum/outfit/abductor/scientist/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE)
..()
if(!visualsOnly)
var/obj/item/weapon/implant/abductor/beamplant = new /obj/item/weapon/implant/abductor(H)
beamplant.implant(H)

View File

@@ -3,8 +3,7 @@
id = "abductor"
say_mod = "gibbers"
sexes = 0
species_traits = list(NOBLOOD,NOBREATH,VIRUSIMMUNE,NOGUNS)
species_traits = list(NOBLOOD,NOBREATH,VIRUSIMMUNE,NOGUNS,NOHUNGER)
mutant_organs = list(/obj/item/organ/tongue/abductor)
var/scientist = 0 // vars to not pollute spieces list with castes
var/agent = 0
var/team = 1