Add Station Goals

Still to-do:
* Remove old BSA computer.
* Add NanoUI interfaces for all goals.
* Test it.
This commit is contained in:
Markolie
2017-01-23 22:02:29 +01:00
parent 0c3813134e
commit a06c997629
26 changed files with 1050 additions and 52 deletions
+2
View File
@@ -4,3 +4,5 @@
#define isradio(A) istype(A, /obj/item/device/radio)
#define ispill(A) istype(A, /obj/item/weapon/reagent_containers/food/pill)
#define isspaceturf(A) (istype(A, /turf/space))
+3 -1
View File
@@ -285,7 +285,6 @@
#define SOUND_MINIMUM_PRESSURE 10
#define FALLOFF_SOUNDS 0.5
// Bluespace shelter deploy checks
#define SHELTER_DEPLOY_ALLOWED "allowed"
#define SHELTER_DEPLOY_BAD_TURFS "bad turfs"
@@ -299,3 +298,6 @@
// The cooldown on OOC messages such as OOC, LOOC, praying and adminhelps
#define OOC_COOLDOWN 5
// The number of station goals generated each round.
#define STATION_GOAL_BUDGET 1
+17 -1
View File
@@ -46,4 +46,20 @@ var/list/TAGGERLOCATIONS = list("Disposals",
"Robotics", "HoP Office", "Library", "Chapel", "Captain's Office",
"Bar", "Kitchen", "Hydroponics", "Janitor Closet","Genetics","Brig Physician")
var/list/hit_appends = list("-OOF", "-ACK", "-UGH", "-HRNK", "-HURGH", "-GLORF")
var/list/hit_appends = list("-OOF", "-ACK", "-UGH", "-HRNK", "-HURGH", "-GLORF")
var/global/list/greek_letters = list("Alpha", "Beta", "Gamma", "Delta",
"Epsilon", "Zeta", "Eta", "Theta", "Iota", "Kappa", "Lambda", "Mu",
"Nu", "Xi", "Omicron", "Pi", "Rho", "Sigma", "Tau", "Upsilon", "Phi",
"Chi", "Psi", "Omega")
var/global/list/phonetic_alphabet = list("Alpha", "Bravo", "Charlie",
"Delta", "Echo", "Foxtrot", "Golf", "Hotel", "India", "Juliet",
"Kilo", "Lima", "Mike", "November", "Oscar", "Papa", "Quebec",
"Romeo", "Sierra", "Tango", "Uniform", "Victor", "Whiskey", "X-ray",
"Yankee", "Zulu")
var/global/list/numbers_as_words = list("One", "Two", "Three", "Four",
"Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve",
"Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen",
"Eighteen", "Nineteen")
+3 -1
View File
@@ -34,4 +34,6 @@ var/global/list/tracked_implants = list() //list of all current implants that
var/global/list/pinpointer_list = list() //list of all pinpointers. Used to change stuff they are pointing to all at once.
var/global/list/abductor_equipment = list() //list of all abductor equipment
var/global/list/global_intercoms = list() //list of all intercomms, across all z-levels
var/global/list/global_radios = list() //list of all radios, across all z-levels
var/global/list/global_radios = list() //list of all radios, across all z-levels
var/global/list/meteor_list = list() // List of all meteors
+58 -1
View File
@@ -53,6 +53,8 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
var/contraband = 0
var/group = supply_misc
var/list/announce_beacons = list() // Particular beacons that we'll notify the relevant department when we reach
var/special = FALSE //Event/Station Goals/Admin enabled packs
var/special_enabled = FALSE
/datum/supply_packs/New()
@@ -1512,7 +1514,62 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
/obj/item/weapon/beach_ball)
cost = 20
containername = "polo supply crate"
///////////// Station Goals
/datum/supply_packs/misc/bsa
name = "Bluespace Artillery Parts"
cost = 150
special = TRUE
contains = list(/obj/item/weapon/circuitboard/machine/bsa/front,
/obj/item/weapon/circuitboard/machine/bsa/middle,
/obj/item/weapon/circuitboard/machine/bsa/back,
/obj/item/weapon/circuitboard/computer/bsa_control
)
containername = "bluespace artillery parts crate"
/datum/supply_packs/misc/dna_vault
name = "DNA Vault Parts"
cost = 120
special = TRUE
contains = list(
/obj/item/weapon/circuitboard/machine/dna_vault
)
containername = "dna vault parts crate"
/datum/supply_packs/misc/dna_probes
name = "DNA Vault Samplers"
cost = 30
special = TRUE
contains = list(/obj/item/device/dna_probe,
/obj/item/device/dna_probe,
/obj/item/device/dna_probe,
/obj/item/device/dna_probe,
/obj/item/device/dna_probe
)
containername = "dna samplers crate"
/datum/supply_packs/misc/shield_sat
name = "Shield Generator Satellite"
cost = 30
special = TRUE
contains = list(
/obj/machinery/satellite/meteor_shield,
/obj/machinery/satellite/meteor_shield,
/obj/machinery/satellite/meteor_shield
)
containername = "shield sat crate"
/datum/supply_packs/misc/shield_sat_control
name = "Shield System Control Board"
cost = 50
special = TRUE
contains = list(
/obj/item/weapon/circuitboard/machine/computer/sat_control
)
containername = "shield control board crate"
//////////////////////////////////////////////////////////////////////////////
//////////////////////////// Vending /////////////////////////////////////////
@@ -1585,4 +1642,4 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
/obj/item/weapon/vending_refill/cigarette,
/obj/item/weapon/vending_refill/cigarette)
cost = 15
containername = "cigarette supply crate"
containername = "cigarette supply crate"
+9
View File
@@ -0,0 +1,9 @@
/proc/print_command_report(text = "", title = "Central Command Update")
for(var/obj/machinery/computer/communications/C in machines)
if(!(C.stat & (BROKEN|NOPOWER)) && C.z == STATION_LEVEL)
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(C.loc)
P.name = "paper- '[title]'"
P.info = text
C.messagetitle.Add("[title]")
C.messagetext.Add(text)
P.update_icon()
+3 -8
View File
@@ -8,6 +8,7 @@
..()
return
if(1)
interceptname = "Level 5-6 Biohazard Response Procedures"
intercepttext += "<FONT size = 3><B>Nanotrasen Update</B>: Biohazard Alert.</FONT><HR>"
intercepttext += "Reports indicate the probable transfer of a biohazardous agent onto [station_name()] during the last crew deployment cycle.<BR>"
intercepttext += "Preliminary analysis of the organism classifies it as a level 5 biohazard. Its origin is unknown.<BR>"
@@ -26,6 +27,7 @@
if(is_station_level(bomb.z))
bomb.r_code = nukecode
interceptname = "Classified [command_name()] Update"
intercepttext += "<FONT size = 3><B>Nanotrasen Update</B>: Biohazard Alert.</FONT><HR>"
intercepttext += "Directive 7-12 has been issued for [station_name()].<BR>"
intercepttext += "The biohazard has grown out of control and will soon reach critical mass.<BR>"
@@ -41,14 +43,7 @@
aiPlayer.set_zeroth_law(law)
to_chat(aiPlayer, "Laws Updated: [law]")
for(var/obj/machinery/computer/communications/comm in world)
comm.messagetitle.Add(interceptname)
comm.messagetext.Add(intercepttext)
if(!(comm.stat & (BROKEN | NOPOWER)) && comm.prints_intercept)
var/obj/item/weapon/paper/intercept = new /obj/item/weapon/paper( comm.loc )
playsound(comm.loc, "sound/goonstation/machines/printer_dotmatrix.ogg", 50, 1)
intercept.name = "Classified Central Command Update"
intercept.info = intercepttext
print_command_report(intercepttext, interceptname)
event_announcement.Announce("A report has been downloaded and printed out at all communications consoles.", "Incoming Classified Message", 'sound/AI/commandreport.ogg')
return
+35 -1
View File
@@ -37,6 +37,8 @@
var/const/waittime_h = 1800 //upper bound on time before intercept arrives (in tenths of seconds)
var/list/player_draft_log = list()
var/list/datum/mind/xenos = list()
var/list/datum/station_goal/station_goals = list() // A list of all station goals for this game mode
/datum/game_mode/proc/announce() //to be calles when round starts
to_chat(world, "<B>Notice</B>: [src] did not define announce()")
@@ -78,6 +80,7 @@
// if(revdata)
// feedback_set_details("revision","[revdata.revision]")
feedback_set_details("server_ip","[world.internet_address]:[world.port]")
generate_station_goals()
start_state = new /datum/station_state()
start_state.count()
return 1
@@ -222,7 +225,7 @@
/datum/game_mode/proc/check_win() //universal trigger to be called at mob death, nuke explosion, etc. To be called from everywhere.
return 0
/datum/game_mode/proc/get_players_for_role(var/role, override_jobbans=0)
var/list/players = list()
var/list/candidates = list()
@@ -475,3 +478,34 @@ proc/get_nt_opposed()
text += "<br><b>Objective #[count]</b>: [objective.explanation_text] <span class='boldannounce'>Fail.</span>"
count++
return text
/datum/game_mode/proc/generate_station_goals()
var/list/possible = list()
for(var/T in subtypesof(/datum/station_goal))
var/datum/station_goal/G = T
if(config_tag in initial(G.gamemode_blacklist))
continue
possible += T
var/goal_weights = 0
while(possible.len && goal_weights < STATION_GOAL_BUDGET)
var/datum/station_goal/picked = pick_n_take(possible)
goal_weights += initial(picked.weight)
station_goals += new picked
if(station_goals.len)
send_station_goals_message()
/datum/game_mode/proc/send_station_goals_message()
var/message_text = "<b><i>[command_name()] Orders</i></b><hr>"
message_text += "<b>Special Orders for [station_name()]:</b>"
for(var/datum/station_goal/G in station_goals)
G.on_report()
message_text += G.get_report()
print_command_report(message_text, "[command_name()] Orders")
/datum/game_mode/proc/declare_station_goal_completion()
for(var/V in station_goals)
var/datum/station_goal/G = V
G.print_result()
+3 -1
View File
@@ -416,7 +416,6 @@ var/round_start_time = 0
/datum/controller/gameticker/proc/declare_completion()
nologevent = 1 //end of round murder and shenanigans are legal; there's no need to jam up attack logs past this point.
//Round statistics report
var/datum/station_state/end_state = new /datum/station_state()
@@ -471,6 +470,9 @@ var/round_start_time = 0
scoreboard()
karmareminder()
// Declare the completion of the station goals
mode.declare_station_goal_completion()
//Ask the event manager to print round end information
event_manager.RoundEnd()
+2
View File
@@ -118,11 +118,13 @@
return .
/obj/effect/meteor/Destroy()
meteor_list -= src
walk(src,0) //this cancels the walk_towards() proc
return ..()
/obj/effect/meteor/New()
..()
meteor_list += src
SpinAnimation()
/obj/effect/meteor/Bump(atom/A)
@@ -1,26 +1,14 @@
/datum/event/spawn_swarmer
//name = "Sawrmer Spawn"
//one_shot = 1
startWhen = 3 //30 minutes
announceWhen = 10
/datum/event/spawn_swarmer/announce()
if(prob(25)) //25% chance to announce it to the crew
var/swarmer_report = "<font size=3><b>[command_name()] High-Priority Update</b></span>"
swarmer_report += "<br><br>Our long-range sensors have detected an odd signal emanating from your station's gateway. We recommend immediate investigation of your gateway, as something may have come \
through."
for(var/obj/machinery/computer/communications/C in machines)
if(! (C.stat & (BROKEN|NOPOWER) ) )
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( C.loc )
P.name = "'Classified [command_name()] Update'"
P.info = swarmer_report
P.update_icon()
C.messagetitle.Add("Classified [command_name()] Update")
C.messagetext.Add(P.info)
command_announcement.Announce("A report has been downloaded and printed out at all communications consoles.", "Incoming Classified Message", 'sound/AI/commandreport.ogg')
print_command_report(swarmer_report, "Classified [command_name()] Update")
event_announcement.Announce("A report has been downloaded and printed out at all communications consoles.", "Incoming Classified Message", 'sound/AI/commandreport.ogg')
/datum/event/spawn_swarmer/start()
if(find_swarmer())
+2 -1
View File
@@ -110,7 +110,8 @@ var/list/admin_verbs_event = list(
/client/proc/response_team, // Response Teams admin verb
/client/proc/cmd_admin_create_centcom_report,
/client/proc/fax_panel,
/client/proc/event_manager_panel
/client/proc/event_manager_panel,
/client/proc/modify_goals
)
var/list/admin_verbs_spawn = list(
+21
View File
@@ -3017,6 +3017,27 @@
error_viewer.showTo(usr, locate(href_list["viewruntime_backto"]), href_list["viewruntime_linear"])
else
error_viewer.showTo(usr, null, href_list["viewruntime_linear"])
else if(href_list["add_station_goal"])
if(!check_rights(R_EVENT))
return
var/list/type_choices = typesof(/datum/station_goal)
var/picked = input("Choose goal type") in type_choices|null
if(!picked)
return
var/datum/station_goal/G = new picked()
if(picked == /datum/station_goal)
var/newname = input("Enter goal name:") as text|null
if(!newname)
return
G.name = newname
var/description = input("Enter centcom message contents:") as message|null
if(!description)
return
G.report_message = description
message_admins("[key_name_admin(usr)] created \"[G.name]\" station goal.")
ticker.mode.station_goals += G
modify_goals()
/proc/admin_jump_link(var/atom/target)
if(!target) return
+22 -21
View File
@@ -561,36 +561,22 @@ Traitors and the like can also be revived with the previous role mostly intact.
if("Yes")
communications_announcement.Announce(input, customname, , , , from);
if("No")
to_chat(world, "\red [from] available at all communications consoles.")
for(var/obj/machinery/computer/communications/C in machines)
if(! (C.stat & (BROKEN|NOPOWER) ) )
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( C.loc )
P.name = "[from]"
P.info = input
P.update_icon()
C.messagetitle.Add("[from]")
C.messagetext.Add(P.info)
to_chat(world, "<span class='danger'>[from] available at all communications consoles.</span>")
print_command_report(input, from)
if(type == "Centcom Report")
if(!customname)
customname = "Nanotrasen Update"
switch(alert("Should this be announced to the general population?",,"Yes","No"))
var/announce = alert("Should this be announced to the general population?",,"Yes","No")
switch(announce)
if("Yes")
command_announcement.Announce(input, customname);
if("No")
to_chat(world, "\red New Nanotrasen Update available at all communication consoles.")
to_chat(world, "<span class='danger'>New Nanotrasen Update available at all communication consoles.</span>")
for(var/obj/machinery/computer/communications/C in machines)
if(! (C.stat & (BROKEN|NOPOWER) ) )
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( C.loc )
P.name = "'[command_name()] Update.'"
P.info = input
P.update_icon()
C.messagetitle.Add("[command_name()] Update")
C.messagetext.Add(P.info)
print_command_report(input, "[announce == "No" ? "Classified " : ""][command_name()] Update")
// world << sound('sound/AI/commandreport.ogg')
log_admin("[key_name(src)] has created a communications report: [input]")
@@ -892,7 +878,6 @@ Traitors and the like can also be revived with the previous role mostly intact.
message_admins("[key_name_admin(usr)] blanked all telecomms scripts.")
feedback_add_details("admin_verb","RAT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/toggle_ert_calling()
set category = "Event"
set name = "Toggle ERT"
@@ -911,3 +896,19 @@ Traitors and the like can also be revived with the previous role mostly intact.
to_chat(usr, "\red ERT has been <b>Disabled</b>.")
log_admin("Admin [key_name(src)] has disabled ERT calling.")
message_admins("Admin [key_name_admin(usr)] has disabled ERT calling.", 1)
/client/proc/modify_goals()
set category = "Event"
set name = "Modify station goals"
if(!check_rights(R_EVENT))
return
holder.modify_goals()
/datum/admins/proc/modify_goals()
var/dat = ""
for(var/datum/station_goal/S in ticker.mode.station_goals)
dat += "[S.name] - <a href='?src=\ref[S];announce=1'>Announce</a> | <a href='?src=\ref[S];remove=1'>Remove</a><br>"
dat += "<br><a href='?src=\ref[src];add_station_goal=1'>Add New Goal</a>"
usr << browse(dat, "window=goals;size=400x400")
@@ -73,6 +73,7 @@ emp_act
for(var/obj/item/organ/external/organ in organs)
armorval += getarmor_organ(organ, type)
organnum++
return (armorval/max(organnum, 1))
@@ -87,6 +88,10 @@ emp_act
var/obj/item/clothing/C = bp
if(C.body_parts_covered & def_zone.body_part)
protection += C.armor[type]
if(species)
protection += species.armor
return protection
//this proc returns the Siemens coefficient of electrical resistivity for a particular external organ.
@@ -75,6 +75,7 @@
var/clone_mod = 1 // Clone damage reduction/amplification
var/brain_mod = 1 // Brain damage damage reduction/amplification
var/stun_mod = 1 // If a species is more/less impacated by stuns/weakens/paralysis
var/armor = 0 // overall defense for the race... or less defense, if it's negative.
var/total_health = 100
var/punchdamagelow = 0 //lowest possible punch damage
+2 -2
View File
@@ -443,7 +443,7 @@
var/packs_list[0]
for(var/set_name in shuttle_master.supply_packs)
var/datum/supply_packs/pack = shuttle_master.supply_packs[set_name]
if(!pack.contraband && !pack.hidden && pack.group == cat)
if(!pack.contraband && !pack.hidden && !pack.special && pack.group == cat)
// 0/1 after the pack name (set_name) is a boolean for ordering multiple crates
packs_list.Add(list(list("name" = pack.name, "amount" = pack.amount, "cost" = pack.cost, "command1" = list("doorder" = "[set_name]0"), "command2" = list("doorder" = "[set_name]1"), "command3" = list("contents" = set_name))))
@@ -592,7 +592,7 @@
var/packs_list[0]
for(var/set_name in shuttle_master.supply_packs)
var/datum/supply_packs/pack = shuttle_master.supply_packs[set_name]
if((pack.hidden && src.hacked) || (pack.contraband && src.can_order_contraband) || (!pack.contraband && !pack.hidden))
if((pack.hidden && hacked) || (pack.contraband && can_order_contraband) || (pack.special && pack.special_enabled) || (!pack.contraband && !pack.hidden && !pack.special))
if(pack.group == cat)
// 0/1 after the pack name (set_name) is a boolean for ordering multiple crates
packs_list.Add(list(list("name" = pack.name, "amount" = pack.amount, "cost" = pack.cost, "command1" = list("doorder" = "[set_name]0"), "command2" = list("doorder" = "[set_name]1"), "command3" = list("contents" = set_name))))
+344
View File
@@ -0,0 +1,344 @@
// Crew has to build a bluespace cannon
// Cargo orders part for high price
// Requires high amount of power
// Requires high level stock parts
/datum/station_goal/bluespace_cannon
name = "Bluespace Artillery"
/datum/station_goal/bluespace_cannon/get_report()
return {"Our military presence is inadequate in your sector.
We need you to construct BSA-[rand(1,99)] Artillery position aboard your station.
Base parts should be availible for shipping by your cargo shuttle.
-Nanotrasen Naval Command"}
/datum/station_goal/bluespace_cannon/on_report()
//Unlock BSA parts
var/datum/supply_packs/misc/bsa/P = shuttle_master.supply_packs[/datum/supply_packs/misc/bsa]
P.special_enabled = TRUE
/datum/station_goal/bluespace_cannon/check_completion()
if(..())
return TRUE
var/obj/machinery/bsa/full/B = locate()
if(B && !B.stat)
return TRUE
return FALSE
/obj/machinery/bsa
icon = 'icons/obj/machines/particle_accelerator.dmi'
density = 1
anchored = 1
/obj/machinery/bsa/back
name = "Bluespace Artillery Generator"
desc = "Generates cannon pulse. Needs to be linked with a fusor. "
icon_state = "power_box"
/obj/machinery/bsa/back/attackby(obj/item/weapon/W, mob/user, params)
if(istype(W, /obj/item/device/multitool))
var/obj/item/device/multitool/M = W
M.buffer = src
to_chat(user, "<span class='notice'>You store linkage information in [W]'s buffer.</span>")
else if(istype(W, /obj/item/weapon/wrench))
default_unfasten_wrench(user, W, 10)
return TRUE
else
return ..()
/obj/machinery/bsa/front
name = "Bluespace Artillery Bore"
desc = "Do not stand in front of cannon during operation. Needs to be linked with a fusor."
icon_state = "emitter_center"
/obj/machinery/bsa/front/attackby(obj/item/weapon/W, mob/user, params)
if(istype(W, /obj/item/device/multitool))
var/obj/item/device/multitool/M = W
M.buffer = src
to_chat(user, "<span class='notice'>You store linkage information in [W]'s buffer.</span>")
else if(istype(W, /obj/item/weapon/wrench))
default_unfasten_wrench(user, W, 10)
return TRUE
else
return ..()
/obj/machinery/bsa/middle
name = "Bluespace Artillery Fusor"
desc = "Contents classifed by Nanotrasen Naval Command. Needs to be linked with the other BSA parts using multitool."
icon_state = "fuel_chamber"
var/obj/machinery/bsa/back/back
var/obj/machinery/bsa/front/front
/obj/machinery/bsa/middle/attackby(obj/item/weapon/W, mob/user, params)
if(istype(W, /obj/item/device/multitool))
var/obj/item/device/multitool/M = W
if(M.buffer)
if(istype(M.buffer,/obj/machinery/bsa/back))
back = M.buffer
M.buffer = null
to_chat(user, "<span class='notice'>You link [src] with [back].</span>")
else if(istype(M.buffer,/obj/machinery/bsa/front))
front = M.buffer
M.buffer = null
to_chat(user, "<span class='notice'>You link [src] with [front].</span>")
else if(istype(W, /obj/item/weapon/wrench))
default_unfasten_wrench(user, W, 10)
return TRUE
else
return ..()
/obj/machinery/bsa/middle/proc/check_completion()
if(!front || !back)
return "No linked parts detected!"
if(!front.anchored || !back.anchored || !anchored)
return "Linked parts unwrenched!"
if(front.y != y || back.y != y || !(front.x > x && back.x < x || front.x < x && back.x > x) || front.z != z || back.z != z)
return "Parts misaligned!"
if(!has_space())
return "Not enough free space!"
/obj/machinery/bsa/middle/proc/has_space()
var/cannon_dir = get_cannon_direction()
var/x_min
var/x_max
switch(cannon_dir)
if(EAST)
x_min = x - 4 //replace with defines later
x_max = x + 6
if(WEST)
x_min = x + 4
x_max = x - 6
for(var/turf/T in block(locate(x_min,y-1,z),locate(x_max,y+1,z)))
if(T.density || isspaceturf(T))
return FALSE
return TRUE
/obj/machinery/bsa/middle/proc/get_cannon_direction()
if(front.x > x && back.x < x)
return EAST
else if(front.x < x && back.x > x)
return WEST
/obj/machinery/bsa/full
name = "Bluespace Artillery"
desc = "Long range bluespace artillery."
icon = 'icons/obj/lavaland/cannon.dmi'
icon_state = "orbital_cannon1"
var/static/image/top_layer = null
var/ex_power = 3
var/power_used_per_shot = 2000000 //enough to kil standard apc - todo : make this use wires instead and scale explosion power with it
var/ready
pixel_y = -32
pixel_x = -192
bound_width = 352
bound_x = -192
/obj/machinery/bsa/full/proc/get_front_turf()
switch(dir)
if(WEST)
return locate(x - 6,y,z)
if(EAST)
return locate(x + 4,y,z)
return get_turf(src)
/obj/machinery/bsa/full/proc/get_back_turf()
switch(dir)
if(WEST)
return locate(x + 4,y,z)
if(EAST)
return locate(x - 6,y,z)
return get_turf(src)
/obj/machinery/bsa/full/proc/get_target_turf()
switch(dir)
if(WEST)
return locate(1,y,z)
if(EAST)
return locate(world.maxx,y,z)
return get_turf(src)
/obj/machinery/bsa/full/New(loc,cannon_direction = WEST)
..()
switch(cannon_direction)
if(WEST)
dir = WEST
pixel_x = -192
top_layer = image("icons/obj/lavaland/orbital_cannon.dmi", "top_west")
top_layer.layer = 4.1
icon_state = "cannon_west"
if(EAST)
dir = EAST
top_layer = image("icons/obj/lavaland/orbital_cannon.dmi", "top_east")
top_layer.layer = 4.1
icon_state = "cannon_east"
overlays += top_layer
reload()
/obj/machinery/bsa/full/proc/fire(mob/user, turf/bullseye)
var/turf/point = get_front_turf()
for(var/turf/T in getline(get_step(point,dir),get_target_turf()))
T.ex_act(1)
point.Beam(get_target_turf(),icon_state="bsa_beam",time=50,maxdistance = world.maxx) //ZZZAP
message_admins("[key_name_admin(user)] has launched an artillery strike.")
explosion(bullseye,ex_power,ex_power*2,ex_power*4)
reload()
/obj/machinery/bsa/full/proc/reload()
ready = FALSE
use_power(power_used_per_shot)
spawn(600)
ready_cannon()
/obj/machinery/bsa/full/proc/ready_cannon()
ready = TRUE
/obj/structure/filler
name = "big machinery part"
density = 1
anchored = 1
invisibility = 101
var/obj/machinery/parent
/obj/structure/filler/ex_act()
return
/obj/item/weapon/circuitboard/machine/bsa/back
name = "Bluespace Artillery Generator (Machine Board)"
build_path = /obj/machinery/bsa/back
origin_tech = "engineering=2;combat=2;bluespace=2" //No freebies!
req_components = list(
/obj/item/weapon/stock_parts/capacitor/quadratic = 5,
/obj/item/stack/cable_coil = 2)
/obj/item/weapon/circuitboard/machine/bsa/middle
name = "Bluespace Artillery Fusor (Machine Board)"
build_path = /obj/machinery/bsa/middle
origin_tech = "engineering=2;combat=2;bluespace=2"
req_components = list(
/obj/item/weapon/ore/bluespace_crystal = 20,
/obj/item/stack/cable_coil = 2)
/obj/item/weapon/circuitboard/machine/bsa/front
name = "Bluespace Artillery Bore (Machine Board)"
build_path = /obj/machinery/bsa/front
origin_tech = "engineering=2;combat=2;bluespace=2"
req_components = list(
/obj/item/weapon/stock_parts/manipulator/femto = 5,
/obj/item/stack/cable_coil = 2)
/obj/item/weapon/circuitboard/computer/bsa_control
name = "Bluespace Artillery Controls (Computer Board)"
build_path = /obj/machinery/computer/bsa_control
origin_tech = "engineering=2;combat=2;bluespace=2"
/obj/machinery/computer/bsa_control
name = "Bluespace Artillery Control"
var/obj/machinery/bsa/full/cannon
var/notice
var/target
use_power = 0
circuit = /obj/item/weapon/circuitboard/computer/bsa_control
icon = 'icons/obj/machines/particle_accelerator.dmi'
icon_state = "control_boxp"
var/area_aim = FALSE //should also show areas for targeting
/obj/machinery/computer/bsa_control/attack_hand(mob/user)
if(..())
return 1
ui_interact(user)
/obj/machinery/dna_vault/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "dna_vault.tmpl", name, 350, 400)
ui.open()
/obj/machinery/computer/bsa_control/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "bsa.tmpl", name, 400, 305)
ui.open()
/obj/machinery/computer/bsa_control/ui_data(mob/user, ui_key = "main", datum/topic_state/state = physical_state)
var/list/data = list()
data["ready"] = cannon ? cannon.ready : FALSE
data["connected"] = cannon
data["notice"] = notice
if(target)
data["target"] = get_target_name()
return data
/obj/machinery/computer/bsa_control/Topic(href, href_list)
if(..())
return 1
if(href_list["build"])
cannon = deploy()
. = TRUE
if(href_list["fire"])
fire(usr)
. = TRUE
if(href_list["recalibrate"])
calibrate(usr)
. = TRUE
update_icon()
/obj/machinery/computer/bsa_control/proc/calibrate(mob/user)
var/list/gps_locators = list()
for(var/obj/item/device/gps/G in GPS_list) //nulls on the list somehow
gps_locators[G.gpstag] = G
var/list/options = gps_locators
if(area_aim)
options += teleportlocs
var/V = input(user,"Select target", "Select target",null) in options|null
target = options[V]
/obj/machinery/computer/bsa_control/proc/get_target_name()
if(istype(target,/area))
var/area/A = target
return A.name
else if(istype(target,/obj/item/device/gps))
var/obj/item/device/gps/G = target
return G.gpstag
/obj/machinery/computer/bsa_control/proc/get_impact_turf()
if(istype(target,/area))
return pick(get_area_turfs(target))
else if(istype(target,/obj/item/device/gps))
return get_turf(target)
/obj/machinery/computer/bsa_control/proc/fire(mob/user)
if(cannon.stat)
notice = "Cannon unpowered!"
return
notice = null
cannon.fire(user, get_impact_turf())
/obj/machinery/computer/bsa_control/proc/deploy(force=FALSE)
var/obj/machinery/bsa/full/prebuilt = locate() in range(7) //In case of adminspawn
if(prebuilt)
return prebuilt
var/obj/machinery/bsa/middle/centerpiece = locate() in range(7)
if(!centerpiece)
notice = "No BSA parts detected nearby."
return null
notice = centerpiece.check_completion()
if(notice)
return null
//Totally nanite construction system not an immersion breaking spawning
var/datum/effect/system/harmless_smoke_spread/s = new /datum/effect/system/harmless_smoke_spread()
s.set_up(4, 0, get_turf(centerpiece))
s.start()
var/obj/machinery/bsa/full/cannon = new(get_turf(centerpiece),cannon_direction=centerpiece.get_cannon_direction())
qdel(centerpiece.front)
qdel(centerpiece.back)
qdel(centerpiece)
return cannon
+276
View File
@@ -0,0 +1,276 @@
//Crew has to create dna vault
// Cargo can order DNA samplers + DNA vault boards
// DNA vault requires x animals ,y plants, z human dna
// DNA vaults require high tier stock parts and cold
// After completion each crewmember can receive single upgrade chosen out of 2 for the mob.
#define VAULT_TOXIN "Toxin Adaptation"
#define VAULT_NOBREATH "Lung Enhancement"
#define VAULT_FIREPROOF "Thermal Regulation"
#define VAULT_STUNTIME "Neural Repathing"
#define VAULT_ARMOUR "Bone Reinforcement"
/datum/station_goal/dna_vault
name = "DNA Vault"
var/animal_count
var/human_count
var/plant_count
/datum/station_goal/dna_vault/New()
..()
animal_count = rand(15,20) //might be too few given ~15 roundstart stationside ones
human_count = rand(round(0.75 * ticker.mode.num_players()) , ticker.mode.num_players()) // 75%+ roundstart population.
var/non_standard_plants = non_standard_plants_count()
plant_count = rand(round(0.5 * non_standard_plants),round(0.7 * non_standard_plants))
/datum/station_goal/dna_vault/proc/non_standard_plants_count()
. = 0
for(var/T in subtypesof(/datum/seed)) //put a cache if it's used anywhere else
var/datum/seed/S = T
if(S.get_trait(TRAIT_RARITY) > 0)
.++
/datum/station_goal/dna_vault/get_report()
return {"Our long term prediction systems say there's 99% chance of system-wide cataclysm in near future.
We need you to construct DNA Vault aboard your station.
DNA Vault needs to contain samples of:
[animal_count] unique animal data
[plant_count] unique non-standard plant data
[human_count] unique sapient humanoid DNA data
Base vault parts should be availible for shipping by your cargo shuttle."}
/datum/station_goal/dna_vault/on_report()
var/datum/supply_packs/P = shuttle_master.supply_packs[/datum/supply_packs/misc/dna_vault]
P.special_enabled = TRUE
P = shuttle_master.supply_packs[/datum/supply_packs/misc/dna_probes]
P.special_enabled = TRUE
/datum/station_goal/dna_vault/check_completion()
if(..())
return TRUE
for(var/obj/machinery/dna_vault/V in machines)
if(V.animals.len >= animal_count && V.plants.len >= plant_count && V.dna.len >= human_count)
return TRUE
return FALSE
/obj/item/device/dna_probe
name = "DNA Sampler"
desc = "Can be used to take chemical and genetic samples of pretty much anything."
icon = 'icons/obj/hypo.dmi'
item_state = "hypo"
icon_state = "hypo"
flags = NOBLUDGEON
var/list/animals = list()
var/list/plants = list()
var/list/dna = list()
/obj/item/device/dna_probe/proc/clear_data()
animals = list()
plants = list()
dna = list()
var/list/non_simple_animals = typecacheof(list(/mob/living/carbon/human/monkey,/mob/living/carbon/alien))
/obj/item/device/dna_probe/afterattack(atom/target, mob/user, proximity)
..()
if(!proximity || !target)
return
//tray plants
if(istype(target,/obj/machinery/portable_atmospherics/hydroponics))
var/obj/machinery/portable_atmospherics/hydroponics/H = target
if(!H.seed)
return
if(!H.harvest)// So it's bit harder.
to_chat(user, "<span clas='warning'>Plants needs to be ready to harvest to perform full data scan.</span>") //Because space dna is actually magic
return
if(plants[H.seed.type])
to_chat(user, "<span class='notice'>Plant data already present in local storage.<span>")
return
plants[H.seed.type] = 1
to_chat(user, "<span class='notice'>Plant data added to local storage.<span>")
//animals
if(isanimal(target) || is_type_in_typecache(target,non_simple_animals))
if(isanimal(target))
var/mob/living/simple_animal/A = target
if(!A.healable)//simple approximation of being animal not a robot or similar
to_chat(user, "<span class='warning'>No compatibile DNA detected</span>")
return
if(animals[target.type])
to_chat(user, "<span class='notice'>Animal data already present in local storage.<span>")
return
animals[target.type] = 1
to_chat(user, "<span class='notice'>Animal data added to local storage.<span>")
//humans
if(ishuman(target))
var/mob/living/carbon/human/H = target
if(dna[H.dna.uni_identity])
to_chat(user, "<span class='notice'>Humanoid data already present in local storage.<span>")
return
dna[H.dna.uni_identity] = 1
to_chat(user, "<span class='notice'>Humanoid data added to local storage.<span>")
/obj/item/weapon/circuitboard/machine/dna_vault
name = "DNA Vault (Machine Board)"
build_path = /obj/machinery/dna_vault
origin_tech = "engineering=2;combat=2;bluespace=2" //No freebies!
req_components = list(
/obj/item/weapon/stock_parts/capacitor/quadratic = 5,
/obj/item/stack/cable_coil = 2)
/obj/machinery/dna_vault
name = "DNA Vault"
desc = "Break glass in case of apocalypse."
icon = 'icons/obj/machines/dna_vault.dmi'
icon_state = "vault"
density = 1
anchored = 1
idle_power_usage = 5000
pixel_x = -32
pixel_y = -64
luminosity = 1
//High defaults so it's not completed automatically if there's no station goal
var/animals_max = 100
var/plants_max = 100
var/dna_max = 100
var/list/animals = list()
var/list/plants = list()
var/list/dna = list()
var/completed = FALSE
var/list/power_lottery = list()
var/list/obj/structure/fillers = list()
/obj/machinery/dna_vault/New()
//TODO: Replace this,bsa and gravgen with some big machinery datum
var/list/occupied = list()
for(var/direct in list(EAST,WEST,SOUTHEAST,SOUTHWEST))
occupied += get_step(src,direct)
occupied += locate(x+1,y-2,z)
occupied += locate(x-1,y-2,z)
for(var/T in occupied)
var/obj/structure/filler/F = new(T)
F.parent = src
fillers += F
if(ticker.mode)
for(var/datum/station_goal/dna_vault/G in ticker.mode.station_goals)
animals_max = G.animal_count
plants_max = G.plant_count
dna_max = G.human_count
break
/obj/machinery/dna_vault/Destroy()
for(var/V in fillers)
var/obj/structure/filler/filler = V
filler.parent = null
qdel(filler)
. = ..()
/obj/machinery/dna_vault/attack_hand(mob/user)
if(..())
return 1
ui_interact(user)
/obj/machinery/dna_vault/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "dna_vault.tmpl", name, 350, 400)
ui.open()
/obj/machinery/dna_vault/proc/roll_powers(mob/user)
if(user in power_lottery)
return
var/list/L = list()
var/list/possible_powers = list(VAULT_TOXIN,VAULT_NOBREATH,VAULT_FIREPROOF,VAULT_STUNTIME,VAULT_ARMOUR)
L += pick_n_take(possible_powers)
L += pick_n_take(possible_powers)
power_lottery[user] = L
/obj/machinery/dna_vault/ui_data(mob/user, ui_key = "main", datum/topic_state/state = physical_state) //TODO Make it % bars maybe
var/list/data = list()
data["plants"] = plants.len
data["plants_max"] = plants_max
data["animals"] = animals.len
data["animals_max"] = animals_max
data["dna"] = dna.len
data["dna_max"] = dna_max
data["completed"] = completed
data["used"] = TRUE
data["choiceA"] = ""
data["choiceB"] = ""
if(user && completed)
var/list/L = power_lottery[user]
if(L && L.len)
data["used"] = FALSE
data["choiceA"] = L[1]
data["choiceB"] = L[2]
return data
/obj/machinery/dna_vault/Topic(href, href_list)
if(..())
return 1
if(href_list["gene"])
upgrade(usr,href_list["choice"])
. = TRUE
/obj/machinery/dna_vault/proc/check_goal()
if(plants.len >= plants_max && animals.len >= animals_max && dna.len >= dna_max)
completed = TRUE
/obj/machinery/dna_vault/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/device/dna_probe))
var/obj/item/device/dna_probe/P = I
var/uploaded = 0
for(var/plant in P.plants)
if(!plants[plant])
uploaded++
plants[plant] = 1
for(var/animal in P.animals)
if(!animals[animal])
uploaded++
animals[animal] = 1
for(var/ui in P.dna)
if(!dna[ui])
uploaded++
dna[ui] = 1
check_goal()
to_chat(user, "<span class='notice'>[uploaded] new datapoints uploaded.</span>")
else
return ..()
/obj/machinery/dna_vault/proc/upgrade(mob/living/carbon/human/H,upgrade_type)
if(!(upgrade_type in power_lottery[H]))
return
var/datum/species/S = H.dna.species
switch(upgrade_type)
if(VAULT_TOXIN)
to_chat(H, "<span class='notice'>You feel resistant to airborne toxins.</span>")
S.tox_mod = 0
S.virus_immune = 1
if(VAULT_NOBREATH)
to_chat(H, "<span class='notice'>Your lungs feel great.</span>")
S.flags |= NO_BREATHE
if(VAULT_FIREPROOF)
to_chat(H, "<span class='notice'>Your feel fireproof.</span>")
S.burn_mod = 0.5
S.heat_level_1 = 999999999
S.heat_level_2 = 999999999
S.heat_level_3 = 999999999
S.heat_level_3_breathe = 999999999
if(VAULT_STUNTIME)
to_chat(H, "<span class='notice'>Nothing can keep you down for long.</span>")
S.stun_mod = 0.5
if(VAULT_ARMOUR)
to_chat(H, "<span class='notice'>Your feel tough.</span>")
S.armor = 30
power_lottery[H] = list()
+186
View File
@@ -0,0 +1,186 @@
//Station Shield
// A chain of satellites encircles the station
// Satellites be actived to generate a shield that will block unorganic matter from passing it.
/datum/station_goal/station_shield
name = "Station Shield"
var/coverage_goal = 500
/datum/station_goal/station_shield/get_report()
return {"The station is located in a zone full of space debris.
We have a prototype shielding system you will deploy to reduce collision related accidents.
You can order the satellites and control systems through cargo shuttle.
"}
/datum/station_goal/station_shield/on_report()
//Unlock
var/datum/supply_packs/P = shuttle_master.supply_packs[/datum/supply_packs/misc/shield_sat]
P.special_enabled = TRUE
P = shuttle_master.supply_packs[/datum/supply_packs/misc/shield_sat_control]
P.special_enabled = TRUE
/datum/station_goal/station_shield/check_completion()
if(..())
return TRUE
if(get_coverage() >= coverage_goal)
return TRUE
return FALSE
/datum/station_goal/proc/get_coverage()
var/list/coverage = list()
for(var/obj/machinery/satellite/meteor_shield/A in machines)
if(!A.active || (A.z != STATION_LEVEL))
continue
coverage |= view(A.kill_range,A)
return coverage.len
/obj/item/weapon/circuitboard/machine/computer/sat_control
name = "Satellite Network Control (Computer Board)"
build_path = /obj/machinery/computer/sat_control
origin_tech = "engineering=3"
/obj/machinery/computer/sat_control
name = "Satellite control"
desc = "Used to control the satellite network."
circuit = /obj/item/weapon/circuitboard/machine/computer/sat_control
var/notice
/obj/machinery/computer/sat_control/attack_hand(mob/user)
if(..())
return 1
ui_interact(user)
/obj/machinery/computer/sat_control/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "sat_control.tmpl", name, 400, 305)
ui.open()
/obj/machinery/computer/sat_control/Topic(href, href_list)
if(..())
return 1
if(href_list["toggle"])
toggle(text2num(href_list["id"]))
. = TRUE
/obj/machinery/computer/sat_control/proc/toggle(id)
for(var/obj/machinery/satellite/S in machines)
if(S.id == id && S.z == z)
S.toggle()
/obj/machinery/computer/sat_control/ui_data(mob/user, ui_key = "main", datum/topic_state/state = physical_state)
var/list/data = list()
data["satellites"] = list()
for(var/obj/machinery/satellite/S in machines)
data["satellites"] += list(list(
"id" = S.id,
"active" = S.active,
"mode" = S.mode
))
data["notice"] = notice
var/datum/station_goal/station_shield/G = locate() in ticker.mode.station_goals
if(G)
data["meteor_shield"] = 1
data["meteor_shield_coverage"] = G.get_coverage()
data["meteor_shield_coverage_max"] = G.coverage_goal
return data
/obj/machinery/satellite
name = "Defunct Satellite"
desc = ""
icon = 'icons/obj/machines/satellite.dmi'
icon_state = "sat_inactive"
var/mode = "NTPROBEV0.8"
var/active = FALSE
density = 1
use_power = FALSE
var/static/gid = 0
var/id = 0
/obj/machinery/satellite/New()
..()
id = gid++
/obj/machinery/satellite/interact(mob/user)
toggle(user)
/obj/machinery/satellite/proc/toggle(mob/user)
if(!active && !isinspace())
if(user)
to_chat(user, "<span class='warning'>You can only active the [src] in space.</span>")
return FALSE
if(user)
to_chat(user, "<span class='notice'>You [active ? "deactivate": "activate"] the [src]</span>")
active = !active
if(active)
animate(src, pixel_y = 2, time = 10, loop = -1)
anchored = 1
else
animate(src, pixel_y = 0, time = 10)
anchored = 0
update_icon()
/obj/machinery/satellite/update_icon()
icon_state = active ? "sat_active" : "sat_inactive"
/obj/machinery/satellite/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/device/multitool))
to_chat(user, "<span class='notice'>// NTSAT-[id] // Mode : [active ? "PRIMARY" : "STANDBY"] //[emagged ? "DEBUG_MODE //" : ""]</span>")
else
return ..()
/obj/machinery/satellite/meteor_shield
name = "Meteor Shield Satellite"
desc = "Meteor Point Defense Satellite"
mode = "M-SHIELD"
speed_process = TRUE
var/kill_range = 14
/obj/machinery/satellite/meteor_shield/proc/space_los(meteor)
for(var/turf/T in getline(src,meteor))
if(!isspaceturf(T))
return FALSE
return TRUE
/obj/machinery/satellite/meteor_shield/process()
if(!active)
return
for(var/obj/effect/meteor/M in meteor_list)
if(M.z != z)
continue
if(get_dist(M,src) > kill_range)
continue
if(!emagged && space_los(M))
Beam(get_turf(M),icon_state="sat_beam",time=5,maxdistance=kill_range)
qdel(M)
/obj/machinery/satellite/meteor_shield/toggle(user)
if(!..(user))
return FALSE
if(emagged)
if(active)
change_meteor_chance(2)
else
change_meteor_chance(0.5)
/obj/machinery/satellite/meteor_shield/proc/change_meteor_chance(mod)
for(var/datum/event_container/container in event_manager.event_containers)
for(var/datum/event_meta/M in container.available_events)
if(M.event_type == /datum/event/meteor_wave)
M.weight *= mod
/obj/machinery/satellite/meteor_shield/Destroy()
. = ..()
if(active && emagged)
change_meteor_chance(0.5)
/obj/machinery/satellite/meteor_shield/emag_act()
if(!emagged)
emagged = 1
if(active)
change_meteor_chance(2)
@@ -0,0 +1,49 @@
//TODO
// Admin button to override with your own
// Sabotage objective for tators
// Multiple goals with less impact but more department focused
/datum/station_goal
var/name = "Generic Goal"
var/weight = 1 //In case of multiple goals later.
var/required_crew = 10
var/list/gamemode_blacklist = list()
var/completed = FALSE
var/report_message = "Complete this goal."
/datum/station_goal/proc/send_report()
priority_announcement.Announce("Priority Nanotrasen directive received. Project \"[name]\" details inbound.", "Incoming Priority Message", 'sound/AI/commandreport.ogg')
print_command_report(get_report(), "Nanotrasen Directive [pick(phonetic_alphabet)] \Roman[rand(1,50)]")
on_report()
/datum/station_goal/proc/on_report()
//Additional unlocks/changes go here
return
/datum/station_goal/proc/get_report()
return report_message
/datum/station_goal/proc/check_completion()
return completed
/datum/station_goal/proc/print_result()
if(check_completion())
to_chat(world, "<b>Station Goal</b> : [name] : <span class='greenannounce'>Completed!</span>")
else
to_chat(world, "<b>Station Goal</b> : [name] : <span class='boldannounce'>Failed!</span>")
/datum/station_goal/Destroy()
ticker.mode.station_goals -= src
. = ..()
/datum/station_goal/Topic(href, href_list)
..()
if(!check_rights(R_EVENT))
return
if(href_list["announce"])
on_report()
send_report()
else if(href_list["remove"])
qdel(src)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 B

+5
View File
@@ -331,6 +331,7 @@
#include "code\defines\procs\announce.dm"
#include "code\defines\procs\AStar.dm"
#include "code\defines\procs\dbcore.dm"
#include "code\defines\procs\orphaned.dm"
#include "code\defines\procs\radio.dm"
#include "code\defines\procs\records.dm"
#include "code\defines\procs\statistics.dm"
@@ -2025,6 +2026,10 @@
#include "code\modules\spacepods\parts.dm"
#include "code\modules\spacepods\pod_fabricator.dm"
#include "code\modules\spacepods\spacepod.dm"
#include "code\modules\station_goals\bsa.dm"
#include "code\modules\station_goals\dna_vault.dm"
#include "code\modules\station_goals\shield.dm"
#include "code\modules\station_goals\station_goal.dm"
#include "code\modules\store\items.dm"
#include "code\modules\store\store.dm"
#include "code\modules\surgery\bones.dm"