Adds a dna adder to head code so that head removal doesn't runtime ever

This commit is contained in:
Crazylemon
2015-12-20 18:46:47 -08:00
230 changed files with 16417 additions and 17179 deletions
+7 -12
View File
@@ -401,20 +401,15 @@
dat += "Current Game Mode: <B>[ticker.mode.name]</B><BR>"
dat += "Round Duration: <B>[round(world.time / 36000)]:[add_zero(num2text(world.time / 600 % 60), 2)]:[add_zero(num2text(world.time / 10 % 60), 2)]</B><BR>"
dat += "<B>Emergency shuttle</B><BR>"
if (!emergency_shuttle.online())
if(shuttle_master.emergency.mode < SHUTTLE_CALL)
dat += "<a href='?src=\ref[src];call_shuttle=1'>Call Shuttle</a><br>"
else
if (emergency_shuttle.wait_for_launch)
var/timeleft = emergency_shuttle.estimate_launch_time()
dat += "ETL: <a href='?src=\ref[src];edit_shuttle_time=1'>[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]</a><BR>"
else if (emergency_shuttle.shuttle.has_arrive_time())
var/timeleft = emergency_shuttle.estimate_arrival_time()
dat += "ETA: <a href='?src=\ref[src];edit_shuttle_time=1'>[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]</a><BR>"
dat += "<a href='?src=\ref[src];call_shuttle=2'>Send Back</a><br>"
if (emergency_shuttle.shuttle.moving_status == SHUTTLE_WARMUP)
dat += "Launching now..."
var/timeleft = shuttle_master.emergency.timeLeft()
if(shuttle_master.emergency.mode < SHUTTLE_DOCKED)
dat += "ETA: <a href='?_src_=holder;edit_shuttle_time=1'>[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]</a><BR>"
dat += "<a href='?_src_=holder;call_shuttle=2'>Send Back</a><br>"
else
dat += "ETA: <a href='?_src_=holder;edit_shuttle_time=1'>[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]</a><BR>"
dat += "<a href='?src=\ref[src];delay_round_end=1'>[ticker.delay_end ? "End Round Normally" : "Delay Round End"]</a><br>"
if(ticker.mode.syndicates.len)
+5
View File
@@ -119,6 +119,11 @@
<BR>
<A href='?src=\ref[src];secretsfun=rolldice'>Roll the Dice</A><BR>
<BR>
<BR>
<A href='?src=\ref[src];secretsfun=moveferry'>Move Ferry</A><BR>
<A href='?src=\ref[src];secretsfun=moveminingshuttle'>Move Mining Shuttle</A><BR>
<A href='?src=\ref[src];secretsfun=movelaborshuttle'>Move Labor Shuttle</A><BR>
<BR>
</center>"}
dat += "</center></body></html>"
var/datum/browser/popup = new(usr, "secrets", "<div align='center'>Admin Secrets</div>", 630, 670)
+42 -139
View File
@@ -261,49 +261,37 @@
switch(href_list["call_shuttle"])
if("1")
if ((!( ticker ) || !emergency_shuttle.location()))
if(shuttle_master.emergency.mode >= SHUTTLE_DOCKED)
return
if (emergency_shuttle.can_call())
emergency_shuttle.call_evac()
log_admin("[key_name(usr)] called the Emergency Shuttle")
message_admins("\blue [key_name_admin(usr)] called the Emergency Shuttle to the station", 1)
shuttle_master.emergency.request()
log_admin("[key_name(usr)] called the Emergency Shuttle")
message_admins("<span class='adminnotice'>[key_name_admin(usr)] called the Emergency Shuttle to the station</span>")
if("2")
if (!( ticker ) || !emergency_shuttle.location())
if(shuttle_master.emergency.mode >= SHUTTLE_DOCKED)
return
if (emergency_shuttle.can_call())
emergency_shuttle.call_evac()
log_admin("[key_name(usr)] called the Emergency Shuttle")
message_admins("\blue [key_name_admin(usr)] called the Emergency Shuttle to the station", 1)
switch(shuttle_master.emergency.mode)
if(SHUTTLE_CALL)
shuttle_master.emergency.cancel()
log_admin("[key_name(usr)] sent the Emergency Shuttle back")
message_admins("<span class='adminnotice'>[key_name_admin(usr)] sent the Emergency Shuttle back</span>")
else
shuttle_master.emergency.cancel()
log_admin("[key_name(usr)] called the Emergency Shuttle")
message_admins("<span class='adminnotice'>[key_name_admin(usr)] called the Emergency Shuttle to the station</span>")
else if (emergency_shuttle.can_recall())
emergency_shuttle.recall()
log_admin("[key_name(usr)] sent the Emergency Shuttle back")
message_admins("\blue [key_name_admin(usr)] sent the Emergency Shuttle back", 1)
href_list["secretsadmin"] = "check_antagonist"
href_list["secrets"] = "check_antagonist"
else if(href_list["edit_shuttle_time"])
if(!check_rights(R_SERVER)) return
if (emergency_shuttle.wait_for_launch)
var/new_time_left = input("Enter new shuttle launch countdown (seconds):","Edit Shuttle Launch Time", emergency_shuttle.estimate_launch_time() ) as num
emergency_shuttle.launch_time = world.time + new_time_left*10
log_admin("[key_name(usr)] edited the Emergency Shuttle's launch time to [new_time_left]")
message_admins("\blue [key_name_admin(usr)] edited the Emergency Shuttle's launch time to [new_time_left*10]", 1)
else if (emergency_shuttle.shuttle.has_arrive_time())
var/new_time_left = input("Enter new shuttle arrival time (seconds):","Edit Shuttle Arrival Time", emergency_shuttle.estimate_arrival_time() ) as num
emergency_shuttle.shuttle.arrive_time = world.time + new_time_left*10
log_admin("[key_name(usr)] edited the Emergency Shuttle's arrival time to [new_time_left]")
message_admins("\blue [key_name_admin(usr)] edited the Emergency Shuttle's arrival time to [new_time_left*10]", 1)
else
alert("The shuttle is neither counting down to launch nor is it in transit. Please try again when it is.")
href_list["secretsadmin"] = "check_antagonist"
var/timer = input("Enter new shuttle duration (seconds):","Edit Shuttle Timeleft", shuttle_master.emergency.timeLeft() ) as num
shuttle_master.emergency.setTimer(timer*10)
log_admin("[key_name(usr)] edited the Emergency Shuttle's timeleft to [timer] seconds")
minor_announcement.Announce("The emergency shuttle will reach its destination in [round(shuttle_master.emergency.timeLeft(600))] minutes.")
message_admins("<span class='adminnotice'>[key_name_admin(usr)] edited the Emergency Shuttle's timeleft to [timer] seconds</span>")
href_list["secrets"] = "check_antagonist"
else if(href_list["delay_round_end"])
if(!check_rights(R_SERVER)) return
@@ -2359,112 +2347,6 @@
message_admins("\blue [key_name_admin(usr)] used everyone is a traitor secret. Objective is [objective]", 1)
log_admin("[key_name(usr)] used everyone is a traitor secret. Objective is [objective]")
if("launchshuttle")
if(!shuttle_controller) return // Something is very wrong, the shuttle controller has not been created.
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","ShL")
var/list/valid_shuttles = list()
for (var/shuttle_tag in shuttle_controller.shuttles)
if (istype(shuttle_controller.shuttles[shuttle_tag], /datum/shuttle/ferry))
valid_shuttles += shuttle_tag
var/shuttle_tag = input("Which shuttle do you want to launch?") as null|anything in valid_shuttles
if (!shuttle_tag)
return
var/datum/shuttle/ferry/S = shuttle_controller.shuttles[shuttle_tag]
if (S.can_launch())
S.launch(usr)
message_admins("\blue [key_name_admin(usr)] launched the [shuttle_tag] shuttle", 1)
log_admin("[key_name(usr)] launched the [shuttle_tag] shuttle")
else
alert("The [shuttle_tag] shuttle cannot be launched at this time. It's probably busy.")
if("forcelaunchshuttle")
if(!shuttle_controller) return // Something is very wrong, the shuttle controller has not been created.
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","ShFL")
var/list/valid_shuttles = list()
for (var/shuttle_tag in shuttle_controller.shuttles)
if (istype(shuttle_controller.shuttles[shuttle_tag], /datum/shuttle/ferry))
valid_shuttles += shuttle_tag
var/shuttle_tag = input("Which shuttle's launch do you want to force?") as null|anything in valid_shuttles
if (!shuttle_tag)
return
var/datum/shuttle/ferry/S = shuttle_controller.shuttles[shuttle_tag]
if (S.can_force())
S.force_launch(usr)
message_admins("\blue [key_name_admin(usr)] has forced the [shuttle_tag] shuttle launch", 1)
log_admin("[key_name(usr)] has forced the [shuttle_tag] shuttle launch")
else
alert("The [shuttle_tag] shuttle launch cannot be forced at this time. It's busy, or hasn't been launched yet.")
if("jumpshuttle")
if(!shuttle_controller) return // Something is very wrong, the shuttle controller has not been created.
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","ShJ")
var/shuttle_tag = input("Which shuttle do you want to jump?") as null|anything in shuttle_controller.shuttles
if (!shuttle_tag) return
var/datum/shuttle/S = shuttle_controller.shuttles[shuttle_tag]
var/origin_area = input("Which area is the shuttle at now? (MAKE SURE THIS IS CORRECT OR THINGS WILL BREAK)") as null|area in world
if (!origin_area) return
var/destination_area = input("Which area is the shuttle at now? (MAKE SURE THIS IS CORRECT OR THINGS WILL BREAK)") as null|area in world
if (!destination_area) return
var/long_jump = alert("Is there a transition area for this jump?","", "Yes", "No")
if (long_jump == "Yes")
var/transition_area = input("Which area is the transition area? (MAKE SURE THIS IS CORRECT OR THINGS WILL BREAK)") as null|area in world
if (!transition_area) return
var/move_duration = input("How many seconds will this jump take?") as num
S.long_jump(origin_area, destination_area, transition_area, move_duration)
message_admins("\blue [key_name_admin(usr)] has initiated a jump from [origin_area] to [destination_area] lasting [move_duration] seconds for the [shuttle_tag] shuttle", 1)
log_admin("[key_name(usr)] has initiated a jump from [origin_area] to [destination_area] lasting [move_duration] seconds for the [shuttle_tag] shuttle")
else
S.short_jump(origin_area, destination_area)
message_admins("\blue [key_name_admin(usr)] has initiated a jump from [origin_area] to [destination_area] for the [shuttle_tag] shuttle", 1)
log_admin("[key_name(usr)] has initiated a jump from [origin_area] to [destination_area] for the [shuttle_tag] shuttle")
if("moveshuttle")
if(!shuttle_controller) return // Something is very wrong, the shuttle controller has not been created.
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","ShM")
var/confirm = alert("This command directly moves a shuttle from one area to another. DO NOT USE THIS UNLESS YOU ARE DEBUGGING A SHUTTLE AND YOU KNOW WHAT YOU ARE DOING.", "Are you sure?", "Ok", "Cancel")
if (confirm == "Cancel")
return
var/shuttle_tag = input("Which shuttle do you want to jump?") as null|anything in shuttle_controller.shuttles
if (!shuttle_tag) return
var/datum/shuttle/S = shuttle_controller.shuttles[shuttle_tag]
var/origin_area = input("Which area is the shuttle at now? (MAKE SURE THIS IS CORRECT OR THINGS WILL BREAK)") as null|area in world
if (!origin_area) return
var/destination_area = input("Which area is the shuttle at now? (MAKE SURE THIS IS CORRECT OR THINGS WILL BREAK)") as null|area in world
if (!destination_area) return
S.move(origin_area, destination_area)
message_admins("\blue [key_name_admin(usr)] moved the [shuttle_tag] shuttle", 1)
log_admin("[key_name(usr)] moved the [shuttle_tag] shuttle")
if("togglebombcap")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","BC")
@@ -2736,6 +2618,27 @@
if("securitylevel5")
set_security_level(5)
message_admins("\blue [key_name_admin(usr)] change security level to Delta.", 1)
if("moveminingshuttle")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","ShM")
if(!shuttle_master.toggleShuttle("mining","mining_home","mining_away"))
message_admins("[key_name_admin(usr)] moved mining shuttle")
log_admin("[key_name(usr)] moved the mining shuttle")
if("movelaborshuttle")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","ShL")
if(!shuttle_master.toggleShuttle("laborcamp","laborcamp_home","laborcamp_away"))
message_admins("[key_name_admin(usr)] moved labor shuttle")
log_admin("[key_name(usr)] moved the labor shuttle")
if("moveferry")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","ShF")
if(!shuttle_master.toggleShuttle("ferry","ferry_home","ferry_away"))
message_admins("[key_name_admin(usr)] moved the centcom ferry")
log_admin("[key_name(usr)] moved the centcom ferry")
if(usr)
log_admin("[key_name(usr)] used secret [href_list["secretsfun"]]")
if (ok)
+11 -30
View File
@@ -749,10 +749,11 @@ Traitors and the like can also be revived with the previous role mostly intact.
feedback_add_details("admin_verb","CVRA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/admin_call_shuttle()
set category = "Admin"
set name = "Call Shuttle"
if ((!( ticker ) || !emergency_shuttle.location()))
if(shuttle_master.emergency.mode >= SHUTTLE_DOCKED)
return
if(!check_rights(R_ADMIN))
@@ -761,30 +762,11 @@ Traitors and the like can also be revived with the previous role mostly intact.
var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No")
if(confirm != "Yes") return
var/choice
if(emergency_shuttle.auto_recall)
choice = input("The shuttle will just return if you call it. Call anyway?") in list("Confirm", "Cancel")
if(choice != "Confirm")
return
if(emergency_shuttle.no_escape)
choice = input("The shuttle will not be able to leave if you call it. Call anyway?") in list("Confirm", "Cancel")
if(choice != "Confirm")
return
choice = input("Is this an emergency evacuation or a crew transfer?") in list("Emergency", "Crew Transfer")
if (choice == "Emergency")
var/reason = input(usr, "Optional: Please enter the reason for calling the shuttle.", "Shuttle Call Reason.","") as text|null
emergency_shuttle.call_evac(reason)
else
emergency_shuttle.call_transfer()
shuttle_master.emergency.request()
feedback_add_details("admin_verb","CSHUT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
log_admin("[key_name(usr)] admin-called the emergency shuttle.")
message_admins("\blue [key_name_admin(usr)] admin-called the emergency shuttle.", 1)
message_admins("<span class='adminnotice'>[key_name_admin(usr)] admin-called the emergency shuttle.</span>")
return
/client/proc/admin_cancel_shuttle()
@@ -793,17 +775,15 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(!check_rights(R_ADMIN))
return
if(alert(src, "You sure?", "Confirm", "Yes", "No") != "Yes") return
if(!ticker || !emergency_shuttle.can_recall())
if(shuttle_master.emergency.mode >= SHUTTLE_DOCKED)
return
emergency_shuttle.recall()
shuttle_master.emergency.cancel()
feedback_add_details("admin_verb","CCSHUT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
log_admin("[key_name(usr)] admin-recalled the emergency shuttle.")
message_admins("\blue [key_name_admin(usr)] admin-recalled the emergency shuttle.", 1)
message_admins("<span class='adminnotice'>[key_name_admin(usr)] admin-recalled the emergency shuttle.</span>")
return
/client/proc/admin_deny_shuttle()
@@ -816,10 +796,11 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(!check_rights(R_ADMIN))
return
emergency_shuttle.deny_shuttle = !emergency_shuttle.deny_shuttle
if(shuttle_master)
shuttle_master.emergencyNoEscape = !shuttle_master.emergencyNoEscape
log_admin("[key_name(src)] has [emergency_shuttle.deny_shuttle ? "denied" : "allowed"] the shuttle to be called.")
message_admins("[key_name_admin(usr)] has [emergency_shuttle.deny_shuttle ? "denied" : "allowed"] the shuttle to be called.")
log_admin("[key_name(src)] has [shuttle_master.emergencyNoEscape ? "denied" : "allowed"] the shuttle to be called.")
message_admins("[key_name_admin(usr)] has [shuttle_master.emergencyNoEscape ? "denied" : "allowed"] the shuttle to be called.")
/client/proc/cmd_admin_attack_log(mob/M as mob in mob_list)
set category = "Special Verbs"
+1 -3
View File
@@ -27,9 +27,7 @@ var/global/sent_strike_team = 0
sent_strike_team = 1
if (emergency_shuttle.can_recall())
emergency_shuttle.recall()
shuttle_master.cancelEvac()
var/commando_number = commandos_possible //for selecting a leader
var/leader_selected = 0 //when the leader is chosen. The last person spawned.
+11 -1
View File
@@ -135,6 +135,7 @@
flags = GLASSESCOVERSEYES
slot_flags = SLOT_EYES
materials = list(MAT_GLASS = 250)
var/emagged = 0
var/vision_flags = 0
var/darkness_view = 0//Base human is 2
var/invisa_view = 0
@@ -223,6 +224,11 @@ BLIND // can't see anything
user << "Your suit will now report your vital lifesigns."
if(3)
user << "Your suit will now report your vital lifesigns as well as your coordinate position."
if(istype(user,/mob/living/carbon/human))
var/mob/living/carbon/human/H = user
if(H.w_uniform == src)
H.update_suit_sensors()
else if (istype(src.loc, /mob))
switch(sensor_mode)
if(0)
@@ -237,6 +243,10 @@ BLIND // can't see anything
if(3)
for(var/mob/V in viewers(user, 1))
V.show_message("[user] sets [src.loc]'s sensors to maximum.", 1)
if(istype(src,/mob/living/carbon/human))
var/mob/living/carbon/human/H = src
if(H.w_uniform == src)
H.update_suit_sensors()
/obj/item/clothing/under/verb/toggle()
set name = "Toggle Suit Sensors"
@@ -253,7 +263,7 @@ BLIND // can't see anything
var/blockTracking // Do we block AI tracking?
var/flash_protect = 0
var/tint = 0
var/HUDType = 0
var/HUDType = null
var/vision_flags = 0
var/see_darkness = 1
-18
View File
@@ -10,7 +10,6 @@
var/prescription = 0
var/prescription_upgradable = 0
var/see_darkness = 1
var/HUDType = 0
/obj/item/clothing/glasses/New()
. = ..()
@@ -327,23 +326,6 @@
"Vox" = 'icons/mob/species/vox/eyes.dmi'
)
/obj/item/clothing/glasses/sunglasses/sechud
name = "HUDSunglasses"
desc = "Sunglasses with a HUD."
icon_state = "sunhud"
darkness_view = 1
flash_protect = 1
tint = 1
HUDType = SECHUD
prescription_upgradable = 1
species_fit = list("Vox")
sprite_sheets = list(
"Vox" = 'icons/mob/species/vox/eyes.dmi'
)
/obj/item/clothing/glasses/sunglasses/sechud/prescription
prescription = 1
/obj/item/clothing/glasses/thermal
name = "Optical Thermal Scanner"
desc = "Thermals in the shape of glasses."
+51 -4
View File
@@ -3,23 +3,38 @@
desc = "A heads-up display that provides important info in (almost) real time."
flags = null //doesn't protect eyes because it's a monocle, duh
origin_tech = "magnets=3;biotech=2"
HUDType = SECHUD
var/HUDType = null //Hudtype is defined on glasses.dm
prescription_upgradable = 1
var/list/icon/current = list() //the current hud icons
/obj/item/clothing/glasses/hud/equipped(mob/living/carbon/human/user, slot)
if(HUDType && slot == slot_glasses)
var/datum/atom_hud/H = huds[HUDType]
H.add_hud_to(user)
/obj/item/clothing/glasses/hud/dropped(mob/living/carbon/human/user)
if(HUDType && istype(user) && user.glasses == src)
var/datum/atom_hud/H = huds[HUDType]
H.remove_hud_from(user)
/obj/item/clothing/glasses/hud/emp_act(severity)
if(emagged == 0)
emagged = 1
desc = desc + " The display flickers slightly."
/obj/item/clothing/glasses/hud/health
name = "\improper Health Scanner HUD"
desc = "A heads-up display that scans the humans in view and provides accurate data about their health status."
icon_state = "healthhud"
HUDType = MEDHUD
HUDType = DATA_HUD_MEDICAL_ADVANCED
/obj/item/clothing/glasses/hud/health_advanced
/obj/item/clothing/glasses/hud/health/health_advanced
name = "\improper Advanced Health Scanner HUD"
desc = "A heads-up display that scans the humans in view and provides accurate data about their health status. Includes anti-flash filter."
icon_state = "advmedhud"
flash_protect = 1
HUDType = MEDHUD
HUDType = DATA_HUD_MEDICAL_ADVANCED
/obj/item/clothing/glasses/hud/health/night
name = "\improper Night Vision Health Scanner HUD"
@@ -30,6 +45,20 @@
see_darkness = 0
prescription_upgradable = 0
/obj/item/clothing/glasses/hud/diagnostic
name = "Diagnostic HUD"
desc = "A heads-up display capable of analyzing the integrity and status of robotics and exosuits."
icon_state = "diagnostichud"
HUDType = DATA_HUD_DIAGNOSTIC
/obj/item/clothing/glasses/hud/diagnostic/night
name = "Night Vision Diagnostic HUD"
desc = "A robotics diagnostic HUD fitted with a light amplifier."
icon_state = "diagnostichudnight"
item_state = "glasses"
darkness_view = 8
see_darkness = 0
prescription_upgradable = 0
/obj/item/clothing/glasses/hud/security
name = "\improper Security HUD"
@@ -37,6 +66,7 @@
icon_state = "securityhud"
var/global/list/jobs[0]
flash_protect = 1
HUDType = DATA_HUD_SECURITY_ADVANCED
/obj/item/clothing/glasses/hud/security/jensenshades
name = "augmented shades"
@@ -53,3 +83,20 @@
darkness_view = 8
see_darkness = 0
prescription_upgradable = 0
/obj/item/clothing/glasses/hud/security/sunglasses
name = "HUDSunglasses"
desc = "Sunglasses with a HUD."
icon_state = "sunhud"
darkness_view = 1
flash_protect = 1
tint = 1
HUDType = DATA_HUD_SECURITY_ADVANCED
prescription_upgradable = 1
species_fit = list("Vox")
sprite_sheets = list(
"Vox" = 'icons/mob/species/vox/eyes.dmi'
)
/obj/item/clothing/glasses/hud/security/sunglasses/prescription
prescription = 1
@@ -42,9 +42,9 @@
var/status_display_freq = "1435"
var/stat_msg1
var/stat_msg2
var/datum/announcement/priority/crew_announcement = new
New()
..()
crew_announcement.newscast = 1
@@ -75,7 +75,7 @@
if(access_captain in I.GetAccess())
authenticated = 2
crew_announcement.announcer = GetNameAndAssignmentFromId(I)
if("logout" in href_list)
authenticated = 0
crew_announcement.announcer = ""
@@ -133,15 +133,13 @@
if(!input || ..(href, href_list) || !authenticated)
return
call_shuttle_proc(usr, input)
if(emergency_shuttle.online())
if(shuttle_master.emergency.timer)
post_status("shuttle")
state = STATE_DEFAULT
if("cancelshuttle" in href_list)
state = STATE_DEFAULT
if(authenticated)
cancel_call_proc(usr)
if(emergency_shuttle.online())
post_status("shuttle")
state = STATE_CANCELSHUTTLE
if("messagelist" in href_list)
currmsg = 0
@@ -284,9 +282,9 @@
proc/main_menu()
var/dat = ""
if (computer.radio.subspace)
if(emergency_shuttle.online() && emergency_shuttle.location())
var/timeleft = emergency_shuttle.estimate_arrival_time()
dat += "<B>Emergency shuttle</B>\n<BR>\nETA: [timeleft / 60 % 60]:[add_zero(num2text(timeleft % 60), 2)]<BR>"
if(shuttle_master.emergency.mode == SHUTTLE_CALL)
var/timeleft = shuttle_master.emergency.timeLeft()
dat += "<B>Emergency shuttle</B>\n<BR>\nETA: [timeleft / 60 % 60]:[add_zero(num2text(timeleft % 60), 2)]"
refresh = 1
else
refresh = 0
+3 -2
View File
@@ -565,8 +565,7 @@ What a mess.*/
if ("Change Criminal Status")
if (active2)
for(var/mob/living/carbon/human/H in player_list)
H.hud_updateflag |= 1 << WANTED_HUD
switch(href_list["criminal2"])
if("none")
active2.fields["criminal"] = "None"
@@ -578,6 +577,8 @@ What a mess.*/
active2.fields["criminal"] = "Parolled"
if("released")
active2.fields["criminal"] = "Released"
for(var/mob/living/carbon/human/H in mob_list)
H.sec_hud_set_security_status()
if ("Delete Record (Security) Execute")
if (active2)
+90 -14
View File
@@ -19,20 +19,20 @@
/obj/item/weapon/claymore/fluff/IsShield()
return 0
/obj/item/weapon/crowbar/fluff/zelda_creedy_1 // Zomgponies: Griffin Rowley
name = "Zelda's Crowbar"
desc = "A pink crow bar that has an engraving that reads, 'To Zelda. Love always, Dawn'"
icon = 'icons/obj/custom_items.dmi'
icon_state = "zeldacrowbar"
item_state = "crowbar"
/obj/item/clothing/glasses/meson/fluff/book_berner_1 // Adrkiller59: Adam Cooper
name = "bespectacled mesonic surveyors"
desc = "One of the older meson scanner models retrofitted to perform like its modern counterparts."
icon = 'icons/obj/custom_items.dmi'
icon_state = "book_berner_1"
/obj/item/weapon/lighter/zippo/fluff/purple // GodOfOreos: Jason Conrad
name = "purple engraved zippo"
desc = "All craftsspacemanship is of the highest quality. It is encrusted with refined plasma sheets. On the item is an image of a dwarf and the words 'Strike the Earth!' etched onto the side."
@@ -40,7 +40,7 @@
icon_state = "purple_zippo_off"
icon_on = "purple_zippo_on"
icon_off = "purple_zippo_off"
/obj/item/weapon/lighter/zippo/fluff/michael_guess_1 // mrbits: Callista Gold
name = "engraved lighter"
desc = "A golden lighter, engraved with some ornaments and a G."
@@ -48,7 +48,47 @@
icon_state = "guessip"
icon_on = "guessipon"
icon_off = "guessip"
/obj/item/weapon/fluff/dogwhistle //phantasmicdream: Zeke Varloss
name = "Sax's whistle"
desc = "This whistle seems to have a strange aura about it. Maybe you should blow on it?"
icon = 'icons/obj/custom_items.dmi'
icon_state = "dogwhistle"
item_state = "dogwhistle"
force = 2
/obj/item/weapon/fluff/dogwhistle/attack_self(mob/user)
user.visible_message("<span class='notice'>[user] blows on the whistle, but no sound comes out.</span>", "<span class='notice'>You blow on the whistle, but don't hear anything.</span>")
spawn(20)
var/mob/living/simple_animal/pet/corgi/C = new /mob/living/simple_animal/pet/corgi(get_turf(user))
var/obj/item/clothing/head/det_hat/D = new /obj/item/clothing/head/det_hat(C)
D.flags |= NODROP
C.inventory_head = D
C.regenerate_icons()
C.name = "Detective Sax"
C.visible_message("<span class='notice'>[C] suddenly winks into existence at [user]'s feet!</span>")
user << "<span class='danger'>[src] crumbles to dust in your hands!</span>"
qdel(src)
/obj/item/weapon/storage/toolbox/fluff/lunchbox //godoforeos: Jason Conrad
name = "lunchpail"
desc = "A simple black lunchpail."
icon = 'icons/obj/custom_items.dmi'
icon_state = "lunch_box"
item_state = "lunch_box"
force = 5
throwforce = 5
w_class = 3
max_combined_w_class = 9
storage_slots = 3
/obj/item/weapon/storage/toolbox/fluff/lunchbox/New()
..()
new /obj/item/weapon/reagent_containers/food/snacks/sandwich(src)
new /obj/item/weapon/reagent_containers/food/snacks/chips(src)
new /obj/item/weapon/reagent_containers/food/drinks/cans/cola(src)
//////////////////////////////////
//////////// Clothing ////////////
//////////////////////////////////
@@ -71,19 +111,25 @@
icon = 'icons/obj/custom_items.dmi'
icon_state = "polarbearpelt"
item_state = "polarbearpelt"
/obj/item/clothing/head/fluff/sparkyninja_beret // Sparkyninja: Neil Wilkinson
name = "royal marines commando beret"
desc = "Dark Green beret with an old insignia on it."
icon_state = "sparkyninja_beret"
/obj/item/clothing/head/beret/fluff/sigholt //sigholtstarsong: Sigholt Starsong
name = "Lieutenant Starsong's beret"
desc = "This beret bears insignia of the SOLGOV Marine Corps 417th Regiment, 2nd Battalion, Bravo Company. It looks meticulously maintained."
icon_state = "hosberet"
item_state = "hosberet"
//////////// Suits ////////////
/obj/item/clothing/suit/storage/labcoat/fluff/aeneas_rinil //Socialsystem: Lynn Fea
name = "Robotics labcoat"
desc = "A labcoat with a few markings denoting it as the labcoat of roboticist."
icon = 'icons/obj/custom_items.dmi'
icon_state = "aeneasrinil_open"
/obj/item/clothing/suit/jacket/fluff/kidosvest // Anxipal: Kido Qasteth
name = "Kido's Vest"
desc = "A rugged leather vest with a tag labelled \"Men of Mayhem.\""
@@ -121,13 +167,13 @@
usr << "You attempt to hit the button but can't."
return
usr.update_inv_wear_suit()
/obj/item/clothing/suit/storage/labcoat/fluff/red // Sweetjealousy: Sophie Faust-Noms
/obj/item/clothing/suit/storage/labcoat/fluff/red // Sweetjealousy: Sophie Faust-Noms
name = "red labcoat"
desc = "A suit that protects against minor chemical spills. Has a red stripe on the shoulders and rolled up sleeves."
icon = 'icons/obj/custom_items.dmi'
icon_state = "labcoat_red_open"
/obj/item/clothing/suit/fluff/stobarico_greatcoat // Stobarico: F.U.R.R.Y
name = "\improper F.U.R.R.Y's Nanotrasen Greatcoat"
desc = "A greatcoat with Nanotrasen colors."
@@ -154,7 +200,7 @@
icon_state = "castile_dress"
item_state = "castile_dress"
item_color = "castile_dress"
/obj/item/clothing/under/psysuit/fluff/isaca_sirius_1 // Xilia: Isaca Sirius
name = "Isaca's suit"
desc = "Black, comfortable and nicely fitting suit. Made not to hinder the wearer in any way. Made of some exotic fabric. And some strange glowing jewel at the waist. Name labels says; Property of Isaca Sirius; The Seeder."
@@ -200,8 +246,8 @@
icon = 'icons/obj/custom_items.dmi'
icon_state = "fox_jacket"
item_state = "fox_jacket"
/obj/item/clothing/under/fluff/fox
/obj/item/clothing/under/fluff/fox
name = "Aeronautics Jumpsuit"
desc = "A jumpsuit tailor made for spacefaring fighter pilots; this one seems very old."
icon = 'icons/obj/custom_items.dmi'
@@ -230,3 +276,33 @@
body_parts_covered = HEAD
flags = BLOCKHAIR
flags_inv = HIDEFACE
/obj/item/clothing/under/fluff/tactical_suit //chronx100: Hughe O'Splash
name = "Hughe O'Splash's tactical suit"
desc = "A very comfortable suit that covers your entire body; it makes you feel very stealthy."
icon = 'icons/obj/custom_items.dmi'
icon_state = "chronx_suit"
item_state = "chronx_suit"
item_color = "chronxsuit"
/obj/item/clothing/mask/fluff/tactical_balaclava //chronx100: Hughe O'Splash
name = "Hughe O'Splash's tactical balaclava"
desc = "Keeps your face warm and tactical during those cold space winter months, sadly it's not so effective against the cold void of space itself."
icon = 'icons/obj/custom_items.dmi'
icon_state = "chronx_balaclava"
item_state = "chronx_balaclava"
flags = BLOCKHAIR
w_class = 2
/obj/item/clothing/suit/armor/vest/fluff/tactical //m3hillus: Medusa Schlofield
name = "tactical armor vest"
desc = "A tactical vest with armored plate inserts."
icon = 'icons/obj/clothing/ties.dmi'
icon_state = "vest_black"
item_state = "vest_black"
/obj/item/clothing/under/pants/fluff/combat
name = "combat pants"
desc = "Medium style tactical pants, for the fashion aware combat units out there."
icon_state = "chaps"
item_color = "combat_pants"
+1 -2
View File
@@ -132,8 +132,7 @@ var/list/event_last_fired = list()
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Trivial News", /datum/event/trivial_news, 400),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Mundane News", /datum/event/mundane_news, 300),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Vermin Infestation",/datum/event/infestation, 100, list(ASSIGNMENT_JANITOR = 100)),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Wallrot", /datum/event/wallrot, 0, list(ASSIGNMENT_ENGINEER = 30, ASSIGNMENT_GARDENER = 50)),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Cargo Bonus", /datum/event/cargo_bonus, 100)
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Wallrot", /datum/event/wallrot, 0, list(ASSIGNMENT_ENGINEER = 30, ASSIGNMENT_GARDENER = 50))
)
/datum/event_container/moderate
+2 -4
View File
@@ -320,13 +320,11 @@
/area/solar,
/area/holodeck,
/area/shuttle/arrival,
/area/shuttle/escape/station,
/area/shuttle/escape,
/area/shuttle/escape_pod1/station,
/area/shuttle/escape_pod2/station,
/area/shuttle/escape_pod3/station,
/area/shuttle/escape_pod5/station,
/area/shuttle/mining/station,
/area/shuttle/transport1/station,
/area/shuttle/specops/station,
/area/shuttle/prison/station,
/area/shuttle/administration/station
@@ -361,7 +359,7 @@
if(P.client)
players++
return players
// Returns how many characters are currently active(not logged out, not AFK for more than 10 minutes)
// with a specific role.
// Note that this isn't sorted by department, because e.g. having a roboticist shouldn't make meteors spawn.
+2 -1
View File
@@ -87,7 +87,8 @@
else //No light, set the turf's luminosity to 0 to remove it from view()
T.luminosity = 0
else
warning("A lighting overlay realised its loc was NOT a turf (actual loc: [loc][loc ? ", " + loc.type : ""]) in update_overlay() and got qdel'ed!")
//warning("A lighting overlay realised its loc was NOT a turf (actual loc: [loc][loc ? ", " + loc.type : "null"]) in update_overlay() and got qdel'ed!") //fucking bullshit bugs means this spams when shuttles move, feel free to fix
log_debug("A lighting overlay realised its loc was NOT a turf (actual loc: [loc][loc ? ", " + loc.type : "null"]) in update_overlay() and got qdel'ed!")
qdel(src)
/atom/movable/lighting_overlay/singularity_act()
+1 -1
View File
@@ -22,4 +22,4 @@
A = T.loc
if(A.lighting_use_dynamic)
var/atom/movable/lighting_overlay/O = new(T)
T.lighting_overlay = O
T.lighting_overlay = O
-1
View File
@@ -534,7 +534,6 @@
return
var/chosen_beacon = pick(L)
var/obj/effect/portal/wormhole/jaunt_tunnel/J = new /obj/effect/portal/wormhole/jaunt_tunnel(get_turf(src), chosen_beacon)
J.target = chosen_beacon
try_move_adjacent(J)
playsound(src,'sound/effects/sparks4.ogg',50,1)
qdel(src)
+16 -125
View File
@@ -1,136 +1,27 @@
var/labor_shuttle_tickstomove = 10
var/labor_shuttle_moving = 0
var/labor_shuttle_location = 0 // 0 = station 13, 1 = labor station
proc/move_labor_shuttle() //TODO: Security Access only; add moving the shuttle to the station to the release button.
if(labor_shuttle_moving) return
labor_shuttle_moving = 1
spawn(labor_shuttle_tickstomove*10)
var/area/fromArea
var/area/toArea
if (labor_shuttle_location == 1)
fromArea = locate(/area/shuttle/siberia/outpost)
toArea = locate(/area/shuttle/siberia/station)
else
fromArea = locate(/area/shuttle/siberia/station)
toArea = locate(/area/shuttle/siberia/outpost)
var/list/dstturfs = list()
var/throwy = world.maxy
for(var/turf/T in toArea)
dstturfs += T
if(T.y < throwy)
throwy = T.y
// hey you, get out of the way!
for(var/turf/T in dstturfs)
// find the turf to move things to
var/turf/D = locate(T.x, throwy - 1, 1)
//var/turf/E = get_step(D, SOUTH)
for(var/atom/movable/AM as mob|obj in T)
AM.Move(D)
// NOTE: Commenting this out to avoid recreating mass driver glitch
/*
spawn(0)
AM.throw_at(E, 1, 1)
return
*/
if(istype(T, /turf/simulated))
qdel(T)
for(var/mob/living/carbon/bug in toArea) // If someone somehow is still in the shuttle's docking area...
bug.gib()
fromArea.move_contents_to(toArea)
if (labor_shuttle_location)
labor_shuttle_location = 0
else
labor_shuttle_location = 1
for(var/mob/M in toArea)
if(M.client)
spawn(0)
if(M.buckled)
shake_camera(M, 3, 1) // buckled, not a lot of shaking
else
shake_camera(M, 10, 1) // unbuckled, HOLY SHIT SHAKE THE ROOM
if(istype(M, /mob/living/carbon))
if(!M.buckled)
M.Weaken(3)
labor_shuttle_moving = 0
return
/obj/machinery/computer/labor_shuttle
/obj/machinery/computer/shuttle/labor
name = "labor shuttle console"
icon = 'icons/obj/computer.dmi'
icon_state = "shuttle"
desc = "Used to call and send the labor camp shuttle."
circuit = /obj/item/weapon/circuitboard/labor_shuttle
var/location = 0 //0 = station, 1 = labor camp
shuttleId = "laborcamp"
possible_destinations = "laborcamp_home;laborcamp_away"
req_access = list(access_brig)
var/hacked = 0
/obj/machinery/computer/labor_shuttle/attack_hand(user as mob)
if(..(user))
return
src.add_fingerprint(usr)
var/dat
dat = text("<center><A href='?src=\ref[src];move=[1]'>Send Labor Shuttle</A></center>")
//user << browse("[dat]", "window=laborshuttle;size=200x100")
var/datum/browser/popup = new(user, "laborshuttle", name, 200, 140)
popup.set_content(dat)
popup.set_title_image(usr.browse_rsc_icon(src.icon, src.icon_state))
popup.open()
/obj/machinery/computer/labor_shuttle/Topic(href, href_list)
usr.set_machine(src)
src.add_fingerprint(usr)
if(href_list["move"])
if(!allowed(usr))
usr << "\red Access denied."
return
if (!labor_shuttle_moving)
usr << "\blue Shuttle recieved message and will be sent shortly."
move_labor_shuttle()
else
usr << "\blue Shuttle is already moving."
/obj/machinery/computer/labor_shuttle/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
if (istype(W, /obj/item/weapon/card/emag))
src.req_access = list()
hacked = 1
usr << "You fried the consoles ID checking system. It's now available to everyone!"
else
..()
/obj/machinery/computer/labor_shuttle/one_way
/obj/machinery/computer/shuttle/labor/one_way
name = "prisoner shuttle console"
desc = "A one-way shuttle console, used to summon the shuttle to the labor camp."
possible_destinations = "laborcamp_away"
circuit = /obj/item/weapon/circuitboard/labor_shuttle/one_way
req_access = list( )
/obj/machinery/computer/labor_shuttle/one_way/attack_hand(user as mob)
if(..(user))
return
src.add_fingerprint(usr)
var/dat
dat = text("<center><A href='?src=\ref[src];move=[1]'>Summon Labor Shuttle</A></center>")
//user << browse("[dat]", "window=laborshuttle;size=200x100")
var/datum/browser/popup = new(user, "laborshuttle", name, 200, 140)
popup.set_content(dat)
popup.set_title_image(usr.browse_rsc_icon(src.icon, src.icon_state))
popup.open()
/obj/machinery/computer/labor_shuttle/one_way/Topic(href, href_list)
if(href_list["move"] && labor_shuttle_location == 1)
usr << "\blue Shuttle is already at the outpost."
return
/obj/machinery/computer/shuttle/labor/one_way/Topic(href, href_list)
if(href_list["move"])
var/obj/docking_port/mobile/M = shuttle_master.getShuttle("laborcamp")
if(!M)
usr << "<span class='warning'>Cannot locate shuttle!</span>"
return 0
var/obj/docking_port/stationary/S = M.get_docked()
if(S && S.name == "laborcamp_away")
usr << "<span class='warning'>Shuttle is already at the outpost!</span>"
return 0
..()
+10 -9
View File
@@ -77,7 +77,6 @@
/obj/machinery/mineral/labor_claim_console/Topic(href, href_list)
var/datum/shuttle/ferry/shuttle = shuttle_controller.shuttles["Labor"]
usr.set_machine(src)
src.add_fingerprint(usr)
if(href_list["choice"])
@@ -102,20 +101,22 @@
if(!alone_in_area(get_area(src), usr))
usr << "<span class='warning'>Prisoners are only allowed to be released while alone.</span>"
else
if(shuttle.location == 1)
if (shuttle.moving_status == SHUTTLE_IDLE)
switch(shuttle_master.moveShuttle("laborcamp","laborcamp_home"))
if(1)
usr << "<span class='notice'>Shuttle not found</span>"
if(2)
usr << "<span class='notice'>Shuttle already at station</span>"
if(3)
usr << "<span class='notice'>No permission to dock could be granted.</span>"
else
var/message = "[inserted_id.registered_name] has returned to the station. Minerals and Prisoner ID card ready for retrieval."
announcer.autosay(message, "Labor Camp Controller", "Security")
usr << "<span class='notice'>Shuttle received message and will be sent shortly.</span>"
shuttle.launch()
else
usr << "<span class='notice'>Shuttle is already moving.</span>"
else
usr << "<span class='notice'>Shuttle is already on-station.</span>"
if(href_list["choice"] == "release")
if(alone_in_area(get_area(loc), usr))
if(shuttle.location == 1)
var/obj/docking_port/stationary/S = shuttle_master.getDock("laborcamp_home")
if(S && S.get_docked())
if(release_door && release_door.density)
release_door.open()
else
+8
View File
@@ -37,6 +37,14 @@
new /obj/item/weapon/pickaxe(src)
new /obj/item/clothing/glasses/meson(src)
/**********************Shuttle Computer**************************/
/obj/machinery/computer/shuttle/mining
name = "Mining Shuttle Console"
desc = "Used to call and send the mining shuttle."
circuit = /obj/item/weapon/circuitboard/mining_shuttle
shuttleId = "mining"
possible_destinations = "mining_home;mining_away"
/******************************Lantern*******************************/
+36 -48
View File
@@ -23,12 +23,12 @@ var/list/image/ghost_darkness_images = list() //this is a list of images for thi
//Note that this is not a reliable way to determine if admins started as observers, since they change mobs a lot.
universal_speak = 1
var/atom/movable/following = null
var/medHUD = 0
var/secHUD = 0
var/anonsay = 0
var/image/ghostimage = null //this mobs ghost image, for deleting and stuff
var/ghostvision = 1 //is the ghost able to see things humans can't?
var/seedarkness = 1
var/data_hud_seen = 0 //this should one of the defines in __DEFINES/hud.dm
var/medhud = 0
/mob/dead/observer/New(var/mob/body=null, var/flags=1)
sight |= SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF
@@ -111,45 +111,28 @@ Works together with spawning an observer, noted above.
if(!loc) return
if(!client) return 0
regular_hud_updates()
if(client.images.len)
for(var/image/hud in client.images)
if(copytext(hud.icon_state,1,4) == "hud")
client.images.Remove(hud)
if(antagHUD)
var/list/target_list = list()
for(var/mob/living/target in oview(src, 14))
if(target.mind && (target.mind.special_role || issilicon(target) || target.mind.nation))
target_list += target
if(target_list.len)
assess_targets(target_list, src)
if(medHUD)
process_medHUD(src)
if(secHUD)
process_secHUD(src)
//regular_hud_updates()
//if(client.images.len)
// for(var/image/hud in client.images)
// if(copytext(hud.icon_state,1,4) == "hud")
// client.images.Remove(hud)
//if(antagHUD)
// var/list/target_list = list()
// for(var/mob/living/target in oview(src, 14))
// if(target.mind && (target.mind.special_role || issilicon(target) || target.mind.nation))
// target_list += target
// if(target_list.len)
// assess_targets(target_list, src)
/mob/dead/proc/process_medHUD(var/mob/M)
var/client/C = M.client
for(var/mob/living/carbon/human/patient in oview(M, 14))
C.images += patient.hud_list[HEALTH_HUD]
C.images += patient.hud_list[STATUS_HUD_OOC]
/mob/dead/proc/process_secHUD(var/mob/M)
var/client/C = M.client
for(var/mob/living/carbon/human/target in oview(M, 14))
C.images += target.hud_list[IMPTRACK_HUD]
C.images += target.hud_list[IMPLOYAL_HUD]
C.images += target.hud_list[IMPCHEM_HUD]
/mob/dead/proc/assess_targets(list/target_list, mob/dead/observer/U)
var/client/C = U.client
for(var/mob/living/carbon/human/target in target_list)
C.images += target.hud_list[SPECIALROLE_HUD]
C.images += target.hud_list[NATIONS_HUD]
//C.images += target.hud_list[NATIONS_HUD]
for(var/mob/living/silicon/target in target_list)
C.images += target.hud_list[SPECIALROLE_HUD]
C.images += target.hud_list[NATIONS_HUD]
//C.images += target.hud_list[NATIONS_HUD]
return 1
@@ -236,10 +219,10 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
//world << "DEBUG: malf mode ticker test"
if(ticker.mode:malf_mode_declared)
stat(null, "Time left: [max(ticker.mode:AI_win_timeleft/(ticker.mode:apcs/3), 0)]")
if(emergency_shuttle)
var/eta_status = emergency_shuttle.get_status_panel_eta()
if(eta_status)
stat(null, eta_status)
if(shuttle_master.emergency.mode >= SHUTTLE_RECALL)
var/timeleft = shuttle_master.emergency.timeLeft()
if(timeleft > 0)
stat(null, "[add_zero(num2text((timeleft / 60) % 60),2)]:[add_zero(num2text(timeleft % 60), 2)]")
/mob/dead/observer/verb/reenter_corpse()
set category = "Ghost"
@@ -270,18 +253,21 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
return 1
/mob/dead/observer/verb/toggle_medHUD()
set category = "Ghost"
set name = "Toggle MedicHUD"
set desc = "Toggles the medical HUD."
if(!client)
return
if(medHUD)
medHUD = 0
src << "\blue <B>Medical HUD Disabled</B>"
var/datum/atom_hud/H = huds[DATA_HUD_MEDICAL_BASIC]
H.remove_hud_from(src)//out with the old..
if(medhud==0)//TOGGLE!
medhud = 1
H.add_hud_to(src)
else
medHUD = 1
src << "\blue <B>Medical HUD Enabled</B>"
medhud = 0
/mob/dead/observer/verb/toggle_antagHUD()
set category = "Ghost"
@@ -304,12 +290,14 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
respawnable_list -= M
if(!M.has_enabled_antagHUD && !check_rights(R_ADMIN|R_MOD,0))
M.has_enabled_antagHUD = 1
if(M.antagHUD)
M.antagHUD = 0
src << "\blue <B>AntagHUD Disabled</B>"
else
M.antagHUD = 1
src << "\blue <B>AntagHUD Enabled</B>"
var/datum/atom_hud/A = huds[DATA_HUD_SECURITY_ADVANCED]
var/adding_hud = (usr in A.hudusers) ? 0 : 1
for(var/datum/atom_hud/H in huds)
if(istype(H, /datum/atom_hud/antag) || istype(H, /datum/atom_hud/data/human/security/advanced))
(adding_hud) ? H.add_hud_to(usr) : H.remove_hud_from(usr)
usr << "AntagHud Toggled [adding_hud ? "ON" : "OFF"]"
/mob/dead/observer/proc/dead_tele(A in ghostteleportlocs)
set category = "Ghost"
@@ -181,10 +181,10 @@
if (client.statpanel == "Status")
stat(null, "Plasma Stored: [getPlasma()]/[max_plasma]")
if(emergency_shuttle)
var/eta_status = emergency_shuttle.get_status_panel_eta()
if(eta_status)
stat(null, eta_status)
if(shuttle_master.emergency.mode >= SHUTTLE_RECALL)
var/timeleft = shuttle_master.emergency.timeLeft()
if(timeleft > 0)
stat(null, "[add_zero(num2text((timeleft / 60) % 60),2)]:[add_zero(num2text(timeleft % 60), 2)]")
/mob/living/carbon/alien/Stun(amount)
if(status_flags & CANSTUN)
@@ -14,6 +14,9 @@ var/const/ALIEN_AFK_BRACKET = 450 // 45 seconds
if(istype(loc, /mob/living))
affected_mob = loc
affected_mob.status_flags |= XENO_HOST
if(istype(affected_mob,/mob/living/carbon))
var/mob/living/carbon/H = affected_mob
H.med_hud_set_status()
processing_objects.Add(src)
spawn(0)
AddInfectionImages(affected_mob)
@@ -23,6 +26,9 @@ var/const/ALIEN_AFK_BRACKET = 450 // 45 seconds
/obj/item/alien_embryo/Destroy()
if(affected_mob)
affected_mob.status_flags &= ~(XENO_HOST)
if(istype(affected_mob,/mob/living/carbon))
var/mob/living/carbon/H = affected_mob
H.med_hud_set_status()
spawn(0)
RemoveInfectionImages(affected_mob)
return ..()
@@ -31,6 +37,9 @@ var/const/ALIEN_AFK_BRACKET = 450 // 45 seconds
if(!affected_mob) return
if(loc != affected_mob)
affected_mob.status_flags &= ~(XENO_HOST)
if(istype(affected_mob,/mob/living/carbon))
var/mob/living/carbon/H = affected_mob
H.med_hud_set_status()
processing_objects.Remove(src)
spawn(0)
RemoveInfectionImages(affected_mob)
@@ -85,10 +85,11 @@ I'm using this for Stat to give it a more nifty interface to work with
statpanel("Status")
stat(null, "Station Time: [worldtime2text()]")
if(emergency_shuttle)
var/eta_status = emergency_shuttle.get_status_panel_eta()
if(eta_status)
stat(null, eta_status)
if(shuttle_master.emergency.mode >= SHUTTLE_RECALL)
var/timeleft = shuttle_master.emergency.timeLeft()
if(timeleft > 0)
stat(null, "[add_zero(num2text((timeleft / 60) % 60),2)]:[add_zero(num2text(timeleft % 60), 2)]")
if(client.statpanel == "Status")
//Knowing how well-off your mech is doing is really important as an MMI
if(istype(src.loc, /obj/mecha))
@@ -37,11 +37,15 @@
brainmob.client.screen.len = null //clear the hud
/obj/item/organ/brain/proc/transfer_identity(var/mob/living/carbon/H)
name = "\the [H]'s [initial(src.name)]"
brainmob = new(src)
brainmob.name = H.real_name
brainmob.real_name = H.real_name
brainmob.dna = H.dna.Clone()
if(isnull(dna)) // someone didn't set this right...
log_to_dd("[src] at [loc] did not contain a dna datum at time of removed.")
dna = H.dna.Clone()
name = "\the [dna.real_name]'s [initial(src.name)]"
brainmob.dna = dna.Clone() // Silly baycode, what you do
// brainmob.dna = H.dna.Clone() Putting in and taking out a brain doesn't make it a carbon copy of the original brain of the body you put it in
brainmob.name = dna.real_name
brainmob.real_name = dna.real_name
brainmob.timeofhostdeath = H.timeofdeath
if(H.mind)
H.mind.transfer_to(brainmob)
@@ -59,33 +63,38 @@
/obj/item/organ/brain/removed(var/mob/living/user)
if(!owner) return ..() // Probably a redundant removal; just bail
name = "[owner.real_name]'s brain"
var/mob/living/simple_animal/borer/borer = owner.has_brain_worms()
if(borer)
borer.detatch() //Should remove borer if the brain is removed - RR
owner.brain_op_stage = 4.0
var/obj/item/organ/brain/B = src
if(istype(B) && istype(owner))
if(istype(B) && istype(owner) && is_primary_organ())
var/mob/living/simple_animal/borer/borer = owner.has_brain_worms()
if(borer)
borer.detatch() //Should remove borer if the brain is removed - RR
owner.brain_op_stage = 4.0
B.transfer_identity(owner)
..()
/obj/item/organ/brain/replaced(var/mob/living/target)
if(target.key)
target.ghostize()
var/mob/living/carbon/C = target
if(istype(C))
C.brain_op_stage = 1.0
if(brainmob)
if(brainmob.mind)
brainmob.mind.transfer_to(target)
else
target.key = brainmob.key
var/brain_already_exists = 0
if(istype(target,/mob/living/carbon/human)) // No more IPC multibrain shenanigans
var/mob/living/carbon/human/H = target
if(organ_tag in H.internal_organs_by_name)
brain_already_exists = 1
if(!brain_already_exists)
if(target.key)
target.ghostize()
var/mob/living/carbon/C = target
if(istype(C))
C.brain_op_stage = 1.0
if(brainmob)
if(brainmob.mind)
brainmob.mind.transfer_to(target)
else
target.key = brainmob.key
..()
/obj/item/organ/brain/slime
+1 -7
View File
@@ -93,10 +93,4 @@
sight &= ~SEE_OBJS
see_in_dark = 2
see_invisible = SEE_INVISIBLE_LIVING
if (container && istype(container, /obj/item/device/mmi))
var/obj/item/device/mmi/mmi = container
if (mmi.mecha)
var/obj/mecha/piloted = mmi.mecha
piloted.pilot_mmi_hud(src)
handle_hud_icons_health()
handle_hud_icons_health()
+14
View File
@@ -7,6 +7,20 @@ mob/living
update_hud()
return
/mob/living/carbon/prepare_huds()
..()
prepare_data_huds()
/mob/living/carbon/proc/prepare_data_huds()
..()
med_hud_set_health()
med_hud_set_status()
/mob/living/carbon/updatehealth()
..()
med_hud_set_health()
med_hud_set_status()
/mob/living/carbon/Destroy()
for(var/atom/movable/guts in internal_organs)
qdel(guts)
@@ -1,5 +1,6 @@
/mob/living/carbon/
gender = MALE
hud_possible = list(HEALTH_HUD,STATUS_HUD,SPECIALROLE_HUD)
var/list/stomach_contents = list()
var/brain_op_stage = 0.0
var/list/datum/disease2/disease/virus2 = list()
+5
View File
@@ -0,0 +1,5 @@
/mob/living/carbon/death(gibbed)
losebreath = 0
med_hud_set_health()
med_hud_set_status()
..(gibbed)
@@ -91,11 +91,6 @@
dizziness = 0
jitteriness = 0
hud_updateflag |= 1 << HEALTH_HUD
hud_updateflag |= 1 << STATUS_HUD
handle_hud_list()
//Handle species-specific deaths.
if(species) species.handle_death(src)
@@ -135,6 +130,8 @@
if(client) blind.layer = 0
timeofdeath = worldtime2text()
med_hud_set_health()
med_hud_set_status()
if(mind) mind.store_memory("Time of death: [timeofdeath]", 0)
if(ticker && ticker.mode)
// log_to_dd("k")
@@ -486,20 +486,17 @@
var/mob/living/carbon/human/H = M
switch(hudtype)
if("security")
return istype(H.glasses, /obj/item/clothing/glasses/hud/security) || istype(H.glasses, /obj/item/clothing/glasses/sunglasses/sechud)
return istype(H.glasses, /obj/item/clothing/glasses/hud/security) || istype(H.glasses, /obj/item/clothing/glasses/hud/security/sunglasses)
if("medical")
return istype(H.glasses, /obj/item/clothing/glasses/hud/health) || istype(H.glasses, /obj/item/clothing/glasses/hud/health_advanced)
return istype(H.glasses, /obj/item/clothing/glasses/hud/health) || istype(H.glasses, /obj/item/clothing/glasses/hud/health/health_advanced)
else
return 0
else if(istype(M, /mob/living/silicon))
var/mob/living/silicon/R = M
switch(hudtype)
if("security")
if(R.sensor_mode == 1)
return 1
return 1
if("medical")
if(R.sensor_mode == 2)
return 1
return 1
else
return 0
else
+23 -25
View File
@@ -6,7 +6,7 @@
icon_state = "body_m_s"
//why are these here and not in human_defines.dm
var/list/hud_list[10]
//var/list/hud_list[10]
var/datum/species/species //Contains icon generation and language information, set during New().
var/embedded_flag //To check if we've need to roll for damage on movement while an item is imbedded in us.
var/obj/item/weapon/rig/wearing_rig // This is very not good, but it's much much better than calling get_rig() every update_canmove() call.
@@ -29,17 +29,6 @@
reagents = R
R.my_atom = src
hud_list[HEALTH_HUD] = image('icons/mob/hud.dmi', src, "hudhealth100")
hud_list[STATUS_HUD] = image('icons/mob/hud.dmi', src, "hudhealthy")
hud_list[ID_HUD] = image('icons/mob/hud.dmi', src, "hudunknown")
hud_list[WANTED_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPLOYAL_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPCHEM_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPTRACK_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[SPECIALROLE_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[STATUS_HUD_OOC] = image('icons/mob/hud.dmi', src, "hudhealthy")
hud_list[NATIONS_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
..()
prev_gender = gender // Debug for plural genders
@@ -55,6 +44,16 @@
sync_organ_dna() //this shouldn't be necessaaaarrrryyyyyyyy
UpdateAppearance()
/mob/living/carbon/human/prepare_data_huds()
//Update med hud images...
..()
//...sec hud images...
sec_hud_set_ID()
sec_hud_set_implants()
sec_hud_set_security_status()
//...and display them.
add_to_all_human_data_huds()
/mob/living/carbon/human/Destroy()
for(var/atom/movable/organelle in organs)
qdel(organelle)
@@ -251,10 +250,10 @@
if(ticker && ticker.mode && ticker.mode.name == "AI malfunction")
if(ticker.mode:malf_mode_declared)
stat(null, "Time left: [max(ticker.mode:AI_win_timeleft/(ticker.mode:apcs/3), 0)]")
if(emergency_shuttle)
var/eta_status = emergency_shuttle.get_status_panel_eta()
if(eta_status)
stat(null, eta_status)
if(shuttle_master.emergency.mode >= SHUTTLE_RECALL)
var/timeleft = shuttle_master.emergency.timeLeft()
if(timeleft > 0)
stat(null, "[add_zero(num2text((timeleft / 60) % 60),2)]:[add_zero(num2text(timeleft % 60), 2)]")
if(client.statpanel == "Status")
if(locate(/obj/item/device/assembly/health) in src)
@@ -858,13 +857,12 @@
modified = 1
spawn()
hud_updateflag |= 1 << WANTED_HUD
if(istype(usr,/mob/living/carbon/human))
var/mob/living/carbon/human/U = usr
U.handle_regular_hud_updates()
//var/mob/living/carbon/human/U = usr
sec_hud_set_security_status()
if(istype(usr,/mob/living/silicon/robot))
var/mob/living/silicon/robot/U = usr
U.handle_regular_hud_updates()
//var/mob/living/silicon/robot/U = usr
sec_hud_set_security_status()
if(!modified)
usr << "\red Unable to locate a data core entry for this person."
@@ -990,11 +988,11 @@
spawn()
if(istype(usr,/mob/living/carbon/human))
var/mob/living/carbon/human/U = usr
U.handle_regular_hud_updates()
//var/mob/living/carbon/human/U = usr
sec_hud_set_security_status()
if(istype(usr,/mob/living/silicon/robot))
var/mob/living/silicon/robot/U = usr
U.handle_regular_hud_updates()
//var/mob/living/silicon/robot/U = usr
sec_hud_set_security_status()
if(!modified)
usr << "\red Unable to locate a data core entry for this person."
@@ -24,6 +24,8 @@
update_revive()
if(stat == CONSCIOUS && (src in dead_mob_list)) //Defib fix
update_revive()
med_hud_set_health()
med_hud_set_status()
/mob/living/carbon/human/adjustBrainLoss(var/amount)
if(status_flags & GODMODE)
@@ -88,7 +90,6 @@
take_overall_damage(amount, 0)
else
heal_overall_damage(-amount, 0)
hud_updateflag |= 1 << HEALTH_HUD
/mob/living/carbon/human/adjustFireLoss(var/amount)
if(species && species.burn_mod)
@@ -97,7 +98,6 @@
take_overall_damage(0, amount)
else
heal_overall_damage(0, -amount)
hud_updateflag |= 1 << HEALTH_HUD
/mob/living/carbon/human/proc/adjustBruteLossByPart(var/amount, var/organ_name, var/obj/damage_source = null)
if(species && species.brute_mod)
@@ -112,7 +112,6 @@
//if you don't want to heal robot organs, they you will have to check that yourself before using this proc.
O.heal_damage(-amount, 0, internal=0, robo_repair=(O.status & ORGAN_ROBOT))
hud_updateflag |= 1 << HEALTH_HUD
/mob/living/carbon/human/proc/adjustFireLossByPart(var/amount, var/organ_name, var/obj/damage_source = null)
if(species && species.burn_mod)
@@ -127,7 +126,6 @@
//if you don't want to heal robot organs, they you will have to check that yourself before using this proc.
O.heal_damage(0, -amount, internal=0, robo_repair=(O.status & ORGAN_ROBOT))
hud_updateflag |= 1 << HEALTH_HUD
/mob/living/carbon/human/Stun(amount)
..()
@@ -181,7 +179,6 @@
O.unmutate()
src << "<span class='notice'>Your [O.name] is shaped normally again.</span>"
hud_updateflag |= 1 << HEALTH_HUD //what even is this shit
// Defined here solely to take species flags into account without having to recast at mob/living level.
/mob/living/carbon/human/getOxyLoss()
@@ -246,7 +243,6 @@
var/obj/item/organ/external/picked = pick(parts)
if(picked.heal_damage(brute,burn))
UpdateDamageIcon()
hud_updateflag |= 1 << HEALTH_HUD
updatehealth()
//Damages ONE external organ, organ gets randomly selected from damagable ones.
@@ -259,7 +255,6 @@
var/obj/item/organ/external/picked = pick(parts)
if(picked.take_damage(brute,burn,sharp,edge))
UpdateDamageIcon()
hud_updateflag |= 1 << HEALTH_HUD
updatehealth()
speech_problem_flag = 1
@@ -283,7 +278,6 @@
parts -= picked
updatehealth()
hud_updateflag |= 1 << HEALTH_HUD
speech_problem_flag = 1
if(update)
UpdateDamageIcon()
@@ -308,7 +302,6 @@
parts -= picked
updatehealth()
hud_updateflag |= 1 << HEALTH_HUD
if(update)
UpdateDamageIcon()
@@ -335,7 +328,6 @@ This function restores all organs.
if(istype(E, /obj/item/organ/external))
if(E.heal_damage(brute, burn))
UpdateDamageIcon()
hud_updateflag |= 1 << HEALTH_HUD
else
return 0
@@ -409,5 +401,4 @@ This function restores all organs.
// Will set our damageoverlay icon to the next level, which will then be set back to the normal level the next mob.Life().
updatehealth()
hud_updateflag |= 1 << HEALTH_HUD
return 1
@@ -1,4 +1,6 @@
/mob/living/carbon/human
hud_possible = list(HEALTH_HUD,STATUS_HUD,ID_HUD,WANTED_HUD,IMPLOYAL_HUD,IMPCHEM_HUD,IMPTRACK_HUD,SPECIALROLE_HUD,NATIONS_HUD)
//Hair colour and style
var/r_hair = 0
var/g_hair = 0
@@ -164,9 +164,11 @@
if(internals)
internals.icon_state = "internal0"
internal = null
sec_hud_set_ID()
update_inv_wear_mask()
else if(I == wear_id)
wear_id = null
sec_hud_set_ID()
update_inv_wear_id()
else if(I == wear_pda)
wear_pda = null
@@ -220,6 +222,7 @@
wear_mask = W
if((wear_mask.flags & BLOCKHAIR) || (wear_mask.flags & BLOCKHEADHAIR))
update_hair(redraw_mob) //rebuild hair
sec_hud_set_ID()
update_inv_wear_mask(redraw_mob)
if(slot_handcuffed)
handcuffed = W
@@ -238,6 +241,7 @@
update_inv_belt(redraw_mob)
if(slot_wear_id)
wear_id = W
sec_hud_set_ID()
update_inv_wear_id(redraw_mob)
if(slot_wear_pda)
wear_pda = W
+3 -188
View File
@@ -51,8 +51,9 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
loc_as_cryobag.used++
in_stasis = 1
if(mob_master.current_cycle % 30 == 15)
hud_updateflag = 1022
//if(mob_master.current_cycle % 30 == 15)
//hud_updateflag = 1022
//HudRefactor:WTF do i put here....
voice = GetVoice()
@@ -990,15 +991,6 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
/mob/living/carbon/human/handle_hud_icons()
species.handle_hud_icons(src)
/mob/living/carbon/human/handle_regular_hud_updates()
if(hud_updateflag)
handle_hud_list()
if(..())
if(hud_updateflag)
handle_hud_list()
/mob/living/carbon/human/handle_random_events()
// Puke if toxloss is too high
if(!stat)
@@ -1260,183 +1252,6 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
*/
/mob/living/carbon/human/proc/handle_hud_list()
if(hud_updateflag & 1 << HEALTH_HUD)
var/image/holder = hud_list[HEALTH_HUD]
if(stat == 2)
holder.icon_state = "hudhealth-100" // X_X
else
holder.icon_state = "hud[RoundHealth(health)]"
hud_list[HEALTH_HUD] = holder
if(hud_updateflag & 1 << STATUS_HUD)
var/foundVirus = 0
for (var/ID in virus2)
if (ID in virusDB)
foundVirus = 1
break
var/image/holder = hud_list[STATUS_HUD]
var/image/holder2 = hud_list[STATUS_HUD_OOC]
if(stat == 2)
holder.icon_state = "huddead"
holder2.icon_state = "huddead"
else if(status_flags & XENO_HOST)
holder.icon_state = "hudxeno"
holder2.icon_state = "hudxeno"
else if(foundVirus)
holder.icon_state = "hudill"
else if(has_brain_worms())
var/mob/living/simple_animal/borer/B = has_brain_worms()
if(B.controlling)
holder.icon_state = "hudbrainworm"
else
holder.icon_state = "hudhealthy"
holder2.icon_state = "hudbrainworm"
else
holder.icon_state = "hudhealthy"
if(virus2.len)
holder2.icon_state = "hudill"
else
holder2.icon_state = "hudhealthy"
hud_list[STATUS_HUD] = holder
hud_list[STATUS_HUD_OOC] = holder2
if(hud_updateflag & 1 << ID_HUD)
var/image/holder = hud_list[ID_HUD]
if(wear_id)
var/obj/item/weapon/card/id/I = wear_id.GetID()
if(I)
holder.icon_state = "hud[ckey(I.GetJobName())]"
else
holder.icon_state = "hudunknown"
else
holder.icon_state = "hudunknown"
hud_list[ID_HUD] = holder
if(hud_updateflag & 1 << WANTED_HUD)
var/image/holder = hud_list[WANTED_HUD]
holder.icon_state = "hudblank"
var/perpname = name
if(wear_id)
var/obj/item/weapon/card/id/I = wear_id.GetID()
if(I)
perpname = I.registered_name
for(var/datum/data/record/E in data_core.general)
if(E.fields["name"] == perpname)
for (var/datum/data/record/R in data_core.security)
if((R.fields["id"] == E.fields["id"]) && (R.fields["criminal"] == "*Arrest*"))
holder.icon_state = "hudwanted"
break
else if((R.fields["id"] == E.fields["id"]) && (R.fields["criminal"] == "Incarcerated"))
holder.icon_state = "hudprisoner"
break
else if((R.fields["id"] == E.fields["id"]) && (R.fields["criminal"] == "Parolled"))
holder.icon_state = "hudparolled"
break
else if((R.fields["id"] == E.fields["id"]) && (R.fields["criminal"] == "Released"))
holder.icon_state = "hudreleased"
break
hud_list[WANTED_HUD] = holder
if(hud_updateflag & 1 << IMPLOYAL_HUD || hud_updateflag & 1 << IMPCHEM_HUD || hud_updateflag & 1 << IMPTRACK_HUD)
var/image/holder1 = hud_list[IMPTRACK_HUD]
var/image/holder2 = hud_list[IMPLOYAL_HUD]
var/image/holder3 = hud_list[IMPCHEM_HUD]
holder1.icon_state = "hudblank"
holder2.icon_state = "hudblank"
holder3.icon_state = "hudblank"
for(var/obj/item/weapon/implant/I in src)
if(I.implanted)
if(istype(I,/obj/item/weapon/implant/tracking))
holder1.icon_state = "hud_imp_tracking"
if(istype(I,/obj/item/weapon/implant/loyalty))
holder2.icon_state = "hud_imp_loyal"
if(istype(I,/obj/item/weapon/implant/chem))
holder3.icon_state = "hud_imp_chem"
hud_list[IMPTRACK_HUD] = holder1
hud_list[IMPLOYAL_HUD] = holder2
hud_list[IMPCHEM_HUD] = holder3
if(hud_updateflag & 1 << SPECIALROLE_HUD)
var/image/holder = hud_list[SPECIALROLE_HUD]
holder.icon_state = "hudblank"
if(mind)
switch(mind.special_role)
if("traitor","Syndicate")
holder.icon_state = "hudsyndicate"
if("Revolutionary")
holder.icon_state = "hudrevolutionary"
if("Head Revolutionary")
holder.icon_state = "hudheadrevolutionary"
if("Cultist")
holder.icon_state = "hudcultist"
if("Changeling")
holder.icon_state = "hudchangeling"
if("Wizard","Fake Wizard")
holder.icon_state = "hudwizard"
if("Death Commando")
holder.icon_state = "huddeathsquad"
if("Ninja")
holder.icon_state = "hudninja"
if("Vampire") // TODO: Check this
holder.icon_state = "hudvampire"
if("VampThrall")
holder.icon_state = "hudvampthrall"
if("head_loyalist")
holder.icon_state = "loyalist"
if("loyalist")
holder.icon_state = "loyalist"
if("head_mutineer")
holder.icon_state = "mutineer"
if("mutineer")
holder.icon_state = "mutineer"
if("Shadowling")
holder.icon_state = "hudshadowling"
if("shadowling thrall")
holder.icon_state = "hudshadowlingthrall"
hud_list[SPECIALROLE_HUD] = holder
if(hud_updateflag & 1 << NATIONS_HUD)
var/image/holder = hud_list[NATIONS_HUD]
holder.icon_state = "hudblank"
if(mind && mind.nation)
switch(mind.nation.default_name)
if("Atmosia")
holder.icon_state = "hudatmosia"
if("Brigston")
holder.icon_state = "hudbrigston"
if("Cargonia")
holder.icon_state = "hudcargonia"
if("People's Republic of Commandzakstan")
holder.icon_state = "hudcommand"
if("Servicion")
holder.icon_state = "hudservice"
if("Medistan")
holder.icon_state = "hudmedistan"
if("Scientopia")
holder.icon_state = "hudscientopia"
hud_list[NATIONS_HUD] = holder
hud_updateflag = 0
/mob/living/carbon/human/handle_silent()
if(..())
speech_problem_flag = 1
@@ -5,6 +5,4 @@
src << "<span class='notice'>You can ventcrawl! Use alt+click on vents to quickly travel about the station.</span>"
update_pipe_vision()
update_hud()
if(ticker && ticker.mode)
ticker.mode.update_all_synd_icons() //This proc only sounds CPU-expensive on paper. It is O(n^2), but the outer for-loop only iterates through syndicates, which are only prsenet in nuke rounds and even when they exist, there's usually 6 of them.
return
@@ -424,13 +424,13 @@
if(!G.see_darkness)
H.see_invisible = SEE_INVISIBLE_MINIMUM
switch(G.HUDType)
if(SECHUD)
process_sec_hud(H,1)
if(MEDHUD)
process_med_hud(H,1)
if(ANTAGHUD)
process_antag_hud(H)
//switch(G.HUDType)
// if(SECHUD)
// process_sec_hud(H,1)
// if(MEDHUD)
// process_med_hud(H,1)
// if(ANTAGHUD)
// process_antag_hud(H)
if(H.head)
if(istype(H.head, /obj/item/clothing/head))
@@ -440,13 +440,13 @@
if(!hat.see_darkness)
H.see_invisible = SEE_INVISIBLE_MINIMUM
switch(hat.HUDType)
if(SECHUD)
process_sec_hud(H,1)
if(MEDHUD)
process_med_hud(H,1)
if(ANTAGHUD)
process_antag_hud(H)
//switch(hat.HUDType)
// if(SECHUD)
// process_sec_hud(H,1)
// if(MEDHUD)
// process_med_hud(H,1)
// if(ANTAGHUD)
// process_antag_hud(H)
if(istype(H.back, /obj/item/weapon/rig)) ///ahhhg so snowflakey
var/obj/item/weapon/rig/rig = H.back
@@ -462,13 +462,13 @@
if(!G.see_darkness)
H.see_invisible = SEE_INVISIBLE_MINIMUM
switch(G.HUDType)
if(SECHUD)
process_sec_hud(H,1)
if(MEDHUD)
process_med_hud(H,1)
if(ANTAGHUD)
process_antag_hud(H)
//switch(G.HUDType)
// if(SECHUD)
// process_sec_hud(H,1)
// if(MEDHUD)
// process_med_hud(H,1)
// if(ANTAGHUD)
// process_antag_hud(H)
if(H.vision_type)
H.see_in_dark = max(H.see_in_dark, H.vision_type.see_in_dark, darksight)
@@ -571,9 +571,6 @@ var/global/list/damage_icon_parts = list()
else
overlays_standing[ID_LAYER] = null
hud_updateflag |= 1 << ID_HUD
hud_updateflag |= 1 << WANTED_HUD
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_gloves(var/update_icons=1)
+1 -1
View File
@@ -54,7 +54,7 @@
update_canmove()
if(client)
regular_hud_updates() //THIS DOESN'T FUCKING UPDATE SHIT
//regular_hud_updates() //THIS DOESN'T FUCKING UPDATE SHIT
handle_regular_hud_updates() //IT JUST REMOVES FUCKING HUD IMAGES
if(get_nations_mode())
process_nations()
-4
View File
@@ -314,8 +314,6 @@
for(var/datum/reagent/R in C.reagents.reagent_list)
C.reagents.clear_reagents()
C.reagents.addiction_list.Cut()
hud_updateflag |= 1 << HEALTH_HUD
hud_updateflag |= 1 << STATUS_HUD
/mob/living/proc/update_revive() // handles revival through other means than cloning or adminbus (defib, IPC repair)
stat = CONSCIOUS
@@ -381,8 +379,6 @@
stat = CONSCIOUS
update_fire()
regenerate_icons()
hud_updateflag |= 1 << HEALTH_HUD
hud_updateflag |= 1 << STATUS_HUD
return
/mob/living/proc/UpdateDamageIcon()
@@ -5,7 +5,6 @@
var/maxHealth = 100 //Maximum health that should be possible.
var/health = 100 //A mob's health
var/hud_updateflag = 0
//Damage related vars, NOTE: THESE SHOULD ONLY BE MODIFIED BY PROCS
var/bruteloss = 0.0 //Brutal damage caused by brute force (punching, being clubbed by a toolbox ect... this also accounts for pressure damage)
+1 -24
View File
@@ -11,30 +11,7 @@
src << "<span class='notice'>You can ventcrawl! Use alt+click on vents to quickly travel about the station.</span>"
//Should update regardless of if we can ventcrawl, since we can end up in pipes in other ways.
update_pipe_vision()
update_interface()
//Round specific stuff like hud updates
if(ticker && ticker.mode)
var/ref = "\ref[mind]"
switch(ticker.mode.name)
if("revolution")
if((mind in ticker.mode.revolutionaries) || (src.mind in ticker.mode:head_revolutionaries))
ticker.mode.update_rev_icons_added(src.mind)
if("cult")
if(mind in ticker.mode:cult)
ticker.mode.update_cult_icons_added(src.mind)
if("nuclear emergency")
if(mind in ticker.mode:syndicates)
ticker.mode.update_all_synd_icons()
if("mutiny")
var/datum/game_mode/mutiny/mode = get_mutiny_mode()
if(mode)
mode.update_all_icons()
if("vampire")
if((ref in ticker.mode.vampire_thralls) || (mind in ticker.mode.vampire_enthralled))
ticker.mode.update_vampire_icons_added(mind)
if("shadowling")
if((mind in ticker.mode.shadowling_thralls) || (mind in ticker.mode.shadows))
ticker.mode.update_shadow_icons_added(src.mind)
return .
+7 -18
View File
@@ -82,10 +82,12 @@ var/list/ai_verbs_default = list(
var/turf/waypoint //Holds the turf of the currently selected waypoint.
var/waypoint_mode = 0 //Waypoint mode is for selecting a turf via clicking.
var/obj/item/borg/sight/hud/sec/sechud = null
var/obj/item/borg/sight/hud/med/healthhud = null
//var/obj/item/borg/sight/hud/sec/sechud = null
//var/obj/item/borg/sight/hud/med/healthhud = null
var/arrivalmsg = "$name, $rank, has arrived on the station."
med_hud = DATA_HUD_MEDICAL_BASIC
sec_hud = DATA_HUD_SECURITY_BASIC
/mob/living/silicon/ai/proc/add_ai_verbs()
src.verbs |= ai_verbs_default
@@ -175,19 +177,9 @@ var/list/ai_verbs_default = list(
new /obj/machinery/ai_powersupply(src)
hud_list[HEALTH_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[STATUS_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[ID_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[WANTED_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPLOYAL_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPCHEM_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPTRACK_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[SPECIALROLE_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[NATIONS_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
ai_list += src
shuttle_caller_list += src
..()
return
/mob/living/silicon/ai/proc/on_mob_init()
src << "<B>You are playing the station's AI. The AI cannot move, but can interact with many objects while viewing them (through cameras).</B>"
@@ -229,6 +221,8 @@ var/list/ai_verbs_default = list(
/mob/living/silicon/ai/Destroy()
ai_list -= src
shuttle_caller_list -= src
shuttle_master.autoEvac()
qdel(eyeobj) // No AI, no Eye
return ..()
@@ -374,11 +368,6 @@ var/list/ai_verbs_default = list(
call_shuttle_proc(src, input)
// hack to display shuttle timer
if(emergency_shuttle.online())
var/obj/machinery/computer/communications/C = locate() in machines
if(C)
C.post_status("shuttle")
return
/mob/living/silicon/ai/proc/ai_cancel_call()
+2 -30
View File
@@ -12,36 +12,8 @@
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
var/callshuttle = 0
for(var/obj/machinery/computer/communications/commconsole in world)
if((commconsole.z in config.admin_levels))
continue
if(istype(commconsole.loc,/turf))
break
callshuttle++
for(var/obj/item/weapon/circuitboard/communications/commboard in world)
if((commboard.z in config.admin_levels))
continue
if(istype(commboard.loc,/turf) || istype(commboard.loc,/obj/item/weapon/storage))
break
callshuttle++
for(var/mob/living/silicon/ai/shuttlecaller in player_list)
if((shuttlecaller.z in config.admin_levels))
continue
if(!shuttlecaller.stat && shuttlecaller.client && istype(shuttlecaller.loc,/turf))
break
callshuttle++
if(ticker.mode.name == "revolution" || ticker.mode.name == "AI malfunction" || sent_strike_team)
callshuttle = 0
if(callshuttle == 3) //if all three conditions are met
emergency_shuttle.call_evac()
log_game("All the AIs, comm consoles and boards are destroyed. Shuttle called.")
message_admins("All the AIs, comm consoles and boards are destroyed. Shuttle called.", 1)
shuttle_caller_list -= src
shuttle_master.autoEvac()
if(explosive)
spawn(10)
+3 -7
View File
@@ -145,13 +145,6 @@
theAPC = null
process_queued_alarms()
regular_hud_updates()
switch(sensor_mode)
if (SEC_HUD)
process_sec_hud(src, 1, eyeobj)
if (MED_HUD)
process_med_hud(src, 1, eyeobj)
if(get_nations_mode())
process_nations_ai()
@@ -165,6 +158,9 @@
health = 100 - getOxyLoss() - getToxLoss() - getBruteLoss()
else
health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss()
diag_hud_set_status()
diag_hud_set_health()
/mob/living/silicon/ai/proc/lacks_power()
var/turf/T = get_turf(src)
+4 -4
View File
@@ -1,10 +1,10 @@
/mob/living/silicon/pai/Life()
. = ..()
if(.)
if(secHUD == 1)
process_sec_hud(src, 1)
if(medHUD == 1)
process_med_hud(src, 1)
//if(secHUD == 1)
// process_sec_hud(src, 1)
////if(medHUD == 1)
// process_med_hud(src, 1)
if(silence_time)
if(world.timeofday >= silence_time)
silence_time = null
@@ -460,7 +460,9 @@
toggle(mob/living/silicon/pai/user)
user.secHUD = !user.secHUD
user.remove_med_sec_hud()
if(user.secHUD)
user.add_sec_hud()
is_active(mob/living/silicon/pai/user)
return user.secHUD
@@ -471,6 +473,9 @@
toggle(mob/living/silicon/pai/user)
user.medHUD = !user.medHUD
user.remove_med_sec_hud()
if(user.medHUD)
user.add_med_hud()
is_active(mob/living/silicon/pai/user)
return user.medHUD
+14 -9
View File
@@ -71,6 +71,7 @@
stat = UNCONSCIOUS
update_headlamp(1)
Paralyse(3)
diag_hud_set_borgcell()
/mob/living/silicon/robot/handle_regular_status_updates()
@@ -95,6 +96,7 @@
if(.) //alive
if(health <= config.health_threshold_dead)
death()
diag_hud_set_status()
return
if(!istype(src, /mob/living/silicon/robot/drone))
@@ -119,6 +121,8 @@
else
stat = CONSCIOUS
diag_hud_set_health()
diag_hud_set_status()
else //dead
eye_blind = 1
@@ -224,15 +228,15 @@
cells.icon_state = "charge-empty"
/mob/living/silicon/robot/handle_regular_hud_updates()
if(!client)
return
switch(sensor_mode)
if(SEC_HUD)
process_sec_hud(src,1)
if(MED_HUD)
process_med_hud(src,1)
/*/mob/living/silicon/robot/handle_regular_hud_updates()
// if(!client)
// return
//
// switch(sensor_mode)
// if(SEC_HUD)
// process_sec_hud(src,1)
// if(MED_HUD)
// process_med_hud(src,1)
if(syndicate)
if(ticker.mode.name == "traitor")
@@ -251,6 +255,7 @@
..()
return 1
*/
@@ -8,4 +8,5 @@
if(mind) ticker.mode.remove_revolutionary(mind)
if(mind) ticker.mode.remove_thrall(mind,0)
if(mind) ticker.mode.remove_shadowling(mind)
if(mind) ticker.mode.remove_changeling(mind)
return
@@ -80,6 +80,8 @@ var/list/robot_verbs_default = list(
var/updating = 0 //portable camera camerachunk update
hud_possible = list(SPECIALROLE_HUD, DIAG_STAT_HUD, DIAG_HUD, DIAG_BATT_HUD,NATIONS_HUD)
var/jetpackoverlay = 0
var/magpulse = 0
@@ -141,15 +143,7 @@ var/list/robot_verbs_default = list(
cell_component.wrapped = cell
cell_component.installed = 1
hud_list[HEALTH_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[STATUS_HUD] = image('icons/mob/hud.dmi', src, "hudhealth100")
hud_list[ID_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[WANTED_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPLOYAL_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPCHEM_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPTRACK_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[SPECIALROLE_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[NATIONS_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
diag_hud_set_borgcell()
scanner.Grant(src)
/mob/living/silicon/robot/proc/init(var/alien=0)
@@ -719,6 +713,7 @@ var/list/robot_verbs_default = list(
//This will mean that removing and replacing a power cell will repair the mount, but I don't care at this point. ~Z
C.brute_damage = 0
C.electronics_damage = 0
diag_hud_set_borgcell()
else if (istype(W, /obj/item/weapon/wirecutters) || istype(W, /obj/item/device/multitool))
if (wiresexposed)
@@ -959,6 +954,7 @@ var/list/robot_verbs_default = list(
user << "You remove \the [cell]."
cell = null
update_icons()
diag_hud_set_borgcell()
if(!opened && (!istype(user, /mob/living/silicon)))
if (user.a_intent == I_HELP)
+45 -12
View File
@@ -8,7 +8,7 @@
var/list/stating_laws = list()// Channels laws are currently being stated on
var/list/alarms_to_show = list()
var/list/alarms_to_clear = list()
var/list/hud_list[10]
//var/list/hud_list[10]
var/list/speech_synthesizer_langs = list() //which languages can be vocalized by the speech synthesizer
var/list/alarm_handlers = list() // List of alarm handlers this silicon is registered to
var/designation = ""
@@ -19,19 +19,28 @@
var/speak_query = "queries"
var/pose //Yes, now AIs can pose too.
var/sensor_mode = 0 //Determines the current HUD.
//var/sensor_mode = 0 //Determines the current HUD.
var/next_alarm_notice
var/list/datum/alarm/queued_alarms = new()
#define SEC_HUD 1 //Security HUD mode
#define MED_HUD 2 //Medical HUD mode
hud_possible = list(SPECIALROLE_HUD, DIAG_STAT_HUD, DIAG_HUD,NATIONS_HUD)
var/med_hud = DATA_HUD_MEDICAL_ADVANCED //Determines the med hud to use
var/sec_hud = DATA_HUD_SECURITY_ADVANCED //Determines the sec hud to use
var/d_hud = DATA_HUD_DIAGNOSTIC //There is only one kind of diag hud
var/local_transmit //If set, can only speak to others of the same type within a short range.
var/obj/item/device/radio/common_radio
/mob/living/silicon/New()
silicon_mob_list |= src
..()
var/datum/atom_hud/data/diagnostic/diag_hud = huds[DATA_HUD_DIAGNOSTIC]
diag_hud.add_to_hud(src)
diag_hud_set_status()
diag_hud_set_health()
add_language("Galactic Common")
init_subsystems()
@@ -140,10 +149,10 @@
// this function displays the shuttles ETA in the status panel if the shuttle has been called
/mob/living/silicon/proc/show_emergency_shuttle_eta()
if(emergency_shuttle)
var/eta_status = emergency_shuttle.get_status_panel_eta()
if(eta_status)
stat(null, eta_status)
if(shuttle_master.emergency.mode >= SHUTTLE_RECALL)
var/timeleft = shuttle_master.emergency.timeLeft()
if(timeleft > 0)
stat(null, "[add_zero(num2text((timeleft / 60) % 60),2)]:[add_zero(num2text(timeleft % 60), 2)]")
@@ -252,17 +261,41 @@
/mob/living/silicon/binarycheck()
return 1
/mob/living/silicon/proc/remove_med_sec_hud()
var/datum/atom_hud/secsensor = huds[sec_hud]
var/datum/atom_hud/medsensor = huds[med_hud]
var/datum/atom_hud/diagsensor = huds[d_hud]
secsensor.remove_hud_from(src)
medsensor.remove_hud_from(src)
diagsensor.remove_hud_from(src)
/mob/living/silicon/proc/add_sec_hud()
var/datum/atom_hud/secsensor = huds[sec_hud]
secsensor.add_hud_to(src)
/mob/living/silicon/proc/add_med_hud()
var/datum/atom_hud/medsensor = huds[med_hud]
medsensor.add_hud_to(src)
/mob/living/silicon/proc/add_diag_hud()
var/datum/atom_hud/diagsensor = huds[d_hud]
diagsensor.add_hud_to(src)
/mob/living/silicon/proc/toggle_sensor_mode()
var/sensor_type = input("Please select sensor type.", "Sensor Integration", null) in list("Security", "Medical","Disable")
var/sensor_type = input("Please select sensor type.", "Sensor Integration", null) in list("Security", "Medical","Diagnostic","Disable")
remove_med_sec_hud()
switch(sensor_type)
if ("Security")
sensor_mode = SEC_HUD
add_sec_hud()
src << "<span class='notice'>Security records overlay enabled.</span>"
if ("Medical")
sensor_mode = MED_HUD
add_med_hud()
src << "<span class='notice'>Life signs monitor overlay enabled.</span>"
if ("Diagnostic")
add_diag_hud()
src << "<span class='notice'>Robotics diagnostic overlay enabled.</span>"
if ("Disable")
sensor_mode = 0
src << "Sensor augmentations disabled."
/mob/living/silicon/proc/receive_alarm(var/datum/alarm_handler/alarm_handler, var/datum/alarm/alarm, was_raised)
@@ -111,10 +111,10 @@
..()
statpanel("Status")
if(emergency_shuttle)
var/eta_status = emergency_shuttle.get_status_panel_eta()
if(eta_status)
stat(null, eta_status)
if(shuttle_master.emergency.mode >= SHUTTLE_RECALL)
var/timeleft = shuttle_master.emergency.timeLeft()
if(timeleft > 0)
stat(null, "[add_zero(num2text((timeleft / 60) % 60),2)]:[add_zero(num2text(timeleft % 60), 2)]")
if (client.statpanel == "Status")
stat("Chemicals", chemicals)
@@ -131,7 +131,7 @@
if("head")
if(inventory_head)
if(inventory_head.flags & NODROP)
usr << "<span = 'warning'>\The [inventory_head] is stuck too hard to [src] for you to remove!</span>"
usr << "<span class='warning'>\The [inventory_head] is stuck too hard to [src] for you to remove!</span>"
return
name = real_name
desc = initial(desc)
@@ -150,7 +150,7 @@
if("back")
if(inventory_back)
if(inventory_back.flags & NODROP)
usr << "<span = 'warning'>\The [inventory_back] is stuck too hard to [src] for you to remove!</span>"
usr << "<span class='warning'>\The [inventory_back] is stuck too hard to [src] for you to remove!</span>"
return
inventory_back.loc = src.loc
inventory_back = null
@@ -129,13 +129,14 @@
var/input = stripped_input(src, "Please enter a message to tell your summoner.", "Guardian", "")
if(!input) return
for(var/mob/M in mob_list)
if(M == summoner)
M << "<span class='changeling'><i>[src]:</i> [input]</span>"
log_say("Guardian Communication: [key_name(src)] -> [key_name(M)] : [input]")
else if (M in dead_mob_list)
M << "<span class='changeling'><i>Guardian Communication from <b>[src]</b> ([ghost_follow_link(src, ghost=M)]): [input]</i>"
src << "<span class='changeling'><i>[src]:</i> [input]</span>"
log_say("Guardian Communication: [src.real_name]/[src.key] : [input]")
/mob/living/simple_animal/hostile/guardian/proc/ToggleMode()
src << "<span class='danger'><B>You dont have another mode!</span></B>"
@@ -153,10 +154,11 @@
var/mob/living/simple_animal/hostile/guardian/G = M
if(G.summoner == src)
G << "<span class='changeling'><i>[src]:</i> [input]</span>"
log_say("Guardian Communication: [key_name(src)] -> [key_name(G)] : [input]")
else if (M in dead_mob_list)
M << "<span class='changeling'><i>Guardian Communication from <b>[src]</b> ([ghost_follow_link(src, ghost=M)]): [input]</i>"
src << "<span class='changeling'><i>[src]:</i> [input]</span>"
log_say("Guardian Communication: [src.real_name]/[src.key] : [text]")
/mob/living/proc/guardian_recall()
set name = "Recall Guardian"
@@ -340,8 +342,8 @@
/mob/living/simple_animal/hostile/guardian/healer/Life()
..()
regular_hud_updates()
process_med_hud(src, 1)
var/datum/atom_hud/medsensor = huds[DATA_HUD_MEDICAL_ADVANCED]
medsensor.add_hud_to(src)
/mob/living/simple_animal/hostile/guardian/healer/AttackingTarget()
..()
+3
View File
@@ -64,6 +64,9 @@
client.screen += client.void
//HUD updates (antag hud, etc)
//readd this mob's HUDs (antag, med, etc)
reload_huds()
CallHook("Login", list("client" = src.client, "mob" = src))
+9
View File
@@ -18,8 +18,13 @@
dead_mob_list += src
else
living_mob_list += src
prepare_huds()
..()
/atom/proc/prepare_huds()
for(var/hud in hud_possible)
hud_list[hud] = image('icons/mob/hud.dmi', src, "")
/mob/proc/generate_name()
return name
@@ -1393,6 +1398,10 @@ mob/proc/yank_out_object()
spell.action.Grant(src)
return
//override to avoid rotating pixel_xy on mobs
/mob/shuttleRotate(rotation)
dir = angle2dir(rotation+dir2angle(dir))
/mob/proc/handle_ventcrawl()
return // Only living mobs can ventcrawl
+2
View File
@@ -131,6 +131,8 @@
var/datum/hud/hud_used = null
hud_possible = list(SPECIALROLE_HUD)
var/research_scanner = 0 //For research scanner equipped mobs. Enable to show research data when examining.
var/datum/action/scan_mode/scanner = new
+4 -8
View File
@@ -379,14 +379,10 @@
var/dat = "<html><body><center>"
dat += "Round Duration: [round(hours)]h [round(mins)]m<br>"
if(emergency_shuttle) //In case Nanotrasen decides reposess CentComm's shuttles.
if(emergency_shuttle.going_to_centcom()) //Shuttle is going to centcomm, not recalled
dat += "<font color='red'><b>The station has been evacuated.</b></font><br>"
if(emergency_shuttle.online())
if (emergency_shuttle.evac) // Emergency shuttle is past the point of no recall
dat += "<font color='red'>The station is currently undergoing evacuation procedures.</font><br>"
else // Crew transfer initiated
dat += "<font color='red'>The station is currently undergoing crew transfer procedures.</font><br>"
if(shuttle_master.emergency.mode >= SHUTTLE_ESCAPE)
dat += "<font color='red'><b>The station has been evacuated.</b></font><br>"
else if(shuttle_master.emergency.mode >= SHUTTLE_CALL)
dat += "<font color='red'>The station is currently undergoing evacuation procedures.</font><br>"
dat += "Choose from the following open positions:<br>"
for(var/datum/job/job in job_master.occupations)
+1 -1
View File
@@ -113,7 +113,7 @@
// let spirits identify cultists
if(ticker.mode)
ticker.mode.reset_cult_icons_for_spirit(new_spirit)
ticker.mode.add_cult_icon_to_spirit(new_spirit)
// highlander test
there_can_be_only_one_mask(new_spirit)
+21 -7
View File
@@ -288,13 +288,14 @@ var/list/organ_cache = list()
take_damage(0,3)
/obj/item/organ/proc/removed(var/mob/living/user)
if(!istype(owner))
return
owner.internal_organs_by_name[organ_tag] = null
owner.internal_organs_by_name -= organ_tag
owner.internal_organs_by_name -= null
if(is_primary_organ())
owner.internal_organs_by_name[organ_tag] = null
owner.internal_organs_by_name -= organ_tag
owner.internal_organs_by_name -= null // uh what does this line even do this seems silly
owner.internal_organs -= src
var/obj/item/organ/external/affected = owner.get_organ(parent_organ)
@@ -307,7 +308,7 @@ var/list/organ_cache = list()
if(!organ_blood || !organ_blood.data["blood_DNA"])
owner.vessel.trans_to(src, 5, 1, 1)
if(owner && vital)
if(owner && vital && is_primary_organ()) // I'd do another check for species or whatever so that you couldn't "kill" an IPC by removing a human head from them, but it doesn't matter since they'll come right back from the dead
if(user)
user.attack_log += "\[[time_stamp()]\]<font color='red'> removed a vital organ ([src]) from [key_name(owner)] (INTENT: [uppertext(user.a_intent)])</font>"
owner.attack_log += "\[[time_stamp()]\]<font color='orange'> had a vital organ ([src]) removed by [key_name(user)] (INTENT: [uppertext(user.a_intent)])</font>"
@@ -323,7 +324,8 @@ var/list/organ_cache = list()
processing_objects -= src
target.internal_organs |= src
affected.internal_organs |= src
target.internal_organs_by_name[organ_tag] = src
if (!(organ_tag in target.internal_organs_by_name))
target.internal_organs_by_name[organ_tag] = src // In case multiple of the same type are inserted, only the first one is the primary organ
src.loc = target
if(robotic)
status |= ORGAN_ROBOT
@@ -358,4 +360,16 @@ var/list/organ_cache = list()
qdel(src)
/obj/item/organ/proc/surgeryize()
return
return
/*
Returns 1 if this is the organ that is handling all the functionalities of that particular organ slot
Returns 0 if it isn't
I use this so that this can be made better once the organ overhaul rolls out -- Crazylemon
*/
/obj/item/organ/proc/is_primary_organ(var/mob/living/carbon/human/O = null)
if (isnull(O))
O = owner
if (!istype(owner)) // You're not the primary organ of ANYTHING, bucko
return 0
return src == O.internal_organs_by_name[organ_tag]
+9 -1
View File
@@ -859,7 +859,8 @@ Note that amputating the affected organ does in fact remove the infection from t
release_restraints(victim)
victim.organs -= src
victim.organs_by_name[limb_name] = null // Remove from owner's vars.
if(is_primary_organ(victim))
victim.organs_by_name[limb_name] = null // Remove from owner's vars.
//Robotic limbs explode if sabotaged.
if(is_robotic && sabotaged)
@@ -889,3 +890,10 @@ Note that amputating the affected organ does in fact remove the infection from t
"\red <b>Your [name] melts away!</b>", \
"\red You hear a sickening sizzle.")
disfigured = 1
/obj/item/organ/external/is_primary_organ(var/mob/living/carbon/human/O = null)
if (isnull(O))
O = owner
if (!istype(O)) // You're not the primary organ of ANYTHING, bucko
return 0
return src == O.organs_by_name[limb_name]
+1 -4
View File
@@ -34,10 +34,7 @@
narsie_spawn_animation()
sleep(70)
if(emergency_shuttle && emergency_shuttle.can_call())
emergency_shuttle.call_evac()
emergency_shuttle.launch_time = 0 // Cannot recall
shuttle_master.emergency.request(null, 0.3) // Cannot recall
/obj/singularity/narsie/large/attack_ghost(mob/dead/observer/user as mob)
if(!(src in view()))
@@ -355,4 +355,69 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
self_recharge = 1
use_external_power = 1
recharge_time = 5
recharge_time = 5
/obj/item/weapon/gun/energy/wormhole_projector
name = "bluespace wormhole projector"
desc = "A projector that emits high density quantum-coupled bluespace beams."
projectile_type = "/obj/item/projectile/beam/wormhole"
charge_cost = 0
fire_sound = "sound/weapons/pulse3.ogg"
item_state = null
icon_state = "wormhole_projector100"
modifystate = "wormhole_projector"
var/obj/effect/portal/blue
var/obj/effect/portal/orange
var/mode = 0 //0 = blue 1 = orange
/obj/item/weapon/gun/energy/wormhole_projector/attack_self(mob/living/user as mob)
switch_modes()
/obj/item/weapon/gun/energy/wormhole_projector/proc/switch_modes(mob/living/user as mob)
switch(mode)
if(0)
mode = 1
user << "<span class='warning'>[name] is now set to orange.</span>"
projectile_type = "/obj/item/projectile/beam/wormhole/orange"
modifystate = "wormhole_projector_orange"
if(1)
mode = 0
user << "<span class='warning'>[name] is now set to blue.</span>"
projectile_type = "/obj/item/projectile/beam/wormhole"
modifystate = "wormhole_projector"
update_icon()
if(user.hand)
user.update_inv_l_hand()
else
user.update_inv_r_hand()
/obj/item/weapon/gun/energy/wormhole_projector/Fire(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, params, reflex = 0)
..()
switch_modes(user)
/obj/item/weapon/gun/energy/wormhole_projector/proc/portal_destroyed(obj/effect/portal/P)
if(P.icon_state == "portal")
blue = null
if(orange)
orange.target = null
else
orange = null
if(blue)
blue.target = null
/obj/item/weapon/gun/energy/wormhole_projector/proc/create_portal(obj/item/projectile/beam/wormhole/W)
var/obj/effect/portal/P = new /obj/effect/portal(get_turf(W), null, src)
P.precision = 0
P.failchance = 0
if(W.name == "bluespace beam")
qdel(blue)
blue = P
else
qdel(orange)
P.icon_state = "portal1"
orange = P
if(orange && blue)
blue.target = get_turf(orange)
orange.target = get_turf(blue)
+127
View File
@@ -0,0 +1,127 @@
/obj/item/weapon/gun/medbeam
name = "Medical Beamgun"
desc = "Delivers medical nanites in a focused beam."
icon = 'icons/obj/chronos.dmi'
icon_state = "chronogun"
item_state = "chronogun"
w_class = 3.0
var/mob/living/current_target
var/last_check = 0
var/check_delay = 10 //Check los as often as possible, max resolution is SSobj tick though
var/max_range = 8
var/active = 0
var/datum/beam/current_beam = null
heavy_weapon = 1
/obj/item/weapon/gun/medbeam/New()
..()
processing_objects.Add(src)
/obj/item/weapon/gun/medbeam/Destroy()
processing_objects.Remove(src)
return ..()
/obj/item/weapon/gun/medbeam/dropped(mob/user)
..()
LoseTarget()
/obj/item/weapon/gun/medbeam/proc/LoseTarget()
if(active)
qdel(current_beam)
active = 0
on_beam_relase(current_target)
current_target = null
/obj/item/weapon/gun/medbeam/Fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, params)
add_fingerprint(user)
if(!isliving(target))
return
if(current_target)
LoseTarget()
current_target = target
active = 1
current_beam = new(user,current_target,time=6000)
spawn(0)
current_beam.Start()
feedback_add_details("gun_fired","[src.type]")
/obj/item/weapon/gun/medbeam/afterattack(obj/target, mob/user, proximity)
if(target.loc == loc || target == user)
return
if(!current_target && isliving(target))
current_target = target
active = 1
current_beam = new(user,current_target,time=6000)
spawn(0)
current_beam.Start()
/obj/item/weapon/gun/medbeam/process()
var/mob/living/carbon/human/H = loc
if(!istype(H))
LoseTarget()
return
if(!current_target)
LoseTarget()
return
if(world.time <= last_check+check_delay)
return
last_check = world.time
if(get_dist(H,current_target)>max_range || !los_check(H,current_target))
LoseTarget()
H << "<span class='warning'>You lose control of the beam!</span>"
return
if(current_target)
on_beam_tick(current_target)
/obj/item/weapon/gun/medbeam/proc/los_check(mob/user,mob/target)
var/turf/user_turf = user.loc
if(!istype(user_turf))
return 0
var/obj/dummy = new(user_turf)
dummy.pass_flags |= PASSTABLE & PASSGLASS & PASSGRILLE //Grille/Glass so it can be used through common windows
for(var/turf/turf in getline(user_turf,target))
if(turf.density)
qdel(dummy)
return 0
for(var/atom/movable/AM in turf)
if(!AM.CanPass(dummy,turf,1))
qdel(dummy)
return 0
for(var/obj/effect/ebeam/medical/B in turf)// Don't cross the str-beams!
if(B.owner != current_beam)
explosion(B.loc,0,3,5,8)
qdel(dummy)
return 0
qdel(dummy)
return 1
/obj/item/weapon/gun/medbeam/proc/on_beam_hit(var/mob/living/target)
return
/obj/item/weapon/gun/medbeam/proc/on_beam_tick(var/mob/living/target)
target.adjustBruteLoss(-4)
target.adjustFireLoss(-4)
if(ishuman(target))
var/var/mob/living/carbon/human/H = target
for(var/obj/item/organ/external/E in H.organs)
if(prob(10))
if(E.mend_fracture())
E.perma_injury = 0
return
/obj/item/weapon/gun/medbeam/proc/on_beam_relase(var/mob/living/target)
return
/obj/effect/ebeam/medical
name = "medical beam"
@@ -9,6 +9,7 @@
/obj/item/projectile/energy/electrode
name = "electrode"
icon_state = "spark"
color = "#FFFF00"
nodamage = 1
stun = 5
weaken = 5
@@ -331,3 +331,27 @@ obj/item/projectile/kinetic/New()
/obj/item/projectile/plasma/adv/mech
damage = 10
range = 6
/obj/item/projectile/beam/wormhole
name = "bluespace beam"
icon_state = "spark"
hitsound = "sparks"
damage = 3
var/obj/item/weapon/gun/energy/wormhole_projector/gun = null
color = "#33CCFF"
/obj/item/projectile/beam/wormhole/orange
name = "orange bluespace beam"
color = "#FF6600"
/obj/item/projectile/beam/wormhole/OnFired()
gun = shot_from
/obj/item/projectile/beam/wormhole/on_hit(atom/target)
if(ismob(target))
var/turf/portal_destination = pick(orange(6, src))
do_teleport(target, portal_destination)
return ..()
if(!gun)
qdel(src)
gun.create_portal(src)
@@ -141,3 +141,23 @@
materials = list(MAT_METAL = 250, MAT_GLASS = 300, MAT_PLASMA = 250, MAT_URANIUM = 1000)
build_path = /obj/item/clothing/glasses/science/night
category = list("Equipment")
/datum/design/diagnostic_hud
name = "Diagnostic HUD"
desc = "A HUD used to analyze and determine faults within robotic machinery."
id = "dianostic_hud"
req_tech = list("magnets" = 3, "engineering" = 3, "materials" = 2)
build_type = PROTOLATHE
materials = list("$metal" = 50, "$glass" = 50)
build_path = /obj/item/clothing/glasses/hud/diagnostic
category = list("Equipment")
/datum/design/diagnostic_hud_night
name = "Night Vision Diagnostic HUD"
desc = "Upgraded version of the diagnostic HUD designed to function during a power failure."
id = "dianostic_hud_night"
req_tech = list("magnets" = 5, "engineering" = 4, "materials" = 4)
build_type = PROTOLATHE
materials = list("$metal" = 200, "$glass" = 200, "$uranium" = 1000, "$plasma" = 300)
build_path = /obj/item/clothing/glasses/hud/diagnostic/night
category = list("Equipment")
@@ -60,6 +60,16 @@
locked = 1
category = list("Weapons")
/datum/design/wormhole_projector
name = "Bluespace Wormhole Projector"
desc = "A projector that emits high density quantum-coupled bluespace beams."
id = "wormholeprojector"
req_tech = list("combat" = 6, "materials" = 6, "bluespace" = 4)
build_type = PROTOLATHE
materials = list(MAT_SILVER = 1000, MAT_METAL = 5000, MAT_DIAMOND = 3000)
build_path = /obj/item/weapon/gun/energy/wormhole_projector
category = list("Weapons")
/datum/design/large_grenade
name = "Large Grenade"
desc = "A grenade that affects a larger area and use larger containers."
@@ -133,7 +143,7 @@
materials = list(MAT_METAL = 2000)
build_path = /obj/item/ammo_box/magazine/smgm9mm
category = list("Weapons")
/datum/design/mag_smg/ap_mag
name = "Saber Submachine Gun Magazine (9mmAP)"
desc = "A 30-round armour piercing magazine for the Saber submachine gun. Deals slightly less damage but bypasses most armor."
+148
View File
@@ -0,0 +1,148 @@
<!-- TOC depth:6 withLinks:1 updateOnSave:1 orderedList:0 -->
- [Shuttle system](#shuttle-system)
- [Introduction](#introduction)
- [Docking ports](#docking-ports)
- [/obj/docking_port](#obj-docking_port)
- [Variables](#variables)
- [/obj/docking_port/mobile](#objdockingportmobile)
- [/obj/docking_port/mobile](#objdockingportmobile)
- [Modifications](#modifications)
- [Shuttle Controller](#shuttle-controller)
- [Airlocks](#airlocks)
- [Initialization](#initialization)
<!-- /TOC -->
# Shuttle system
## Introduction
This folder belongs to the "shuttle" system. The shuttle system is used to control the
"Shuttles" on the map, which are, at their core, a rectangular area of turfs that "move".
The shuttle system is comprised of two primary files.
[`shuttle.dm`](http://github.com/ParadiseSS13/Paradise/blob/master/code/modules/shuttle/shuttle.dm),
which contains the primary code, and
[`shuttles.dm`](http://github.com/ParadiseSS13/Paradise/blob/master/code/controllers/Process/shuttles.dm)
which contains the back-end controller system.
There are a few other files, but it isn't worth noting on.
Shuttles are used for many purposes, including the end of rounds, so it's important to
understand them.
## Docking ports
### obj docking_port
The `/obj/docking_port` type is the primary component of the shuttle system. Almost all of
the shuttle system is controlled by the docking ports, the only thing that isn't, really,
is the shuttle manager, which manages, you guessed it, the docking ports.
Docking ports are split into two main types: `/obj/docking_port/stationary`, and
`/obj/docking_port/mobile`, but they share a few variables and procs defined at the
`/obj/docking_port` level.
#### Variables
`id`: This variable is used for any plain-text references to the docking port. It should
always be lowercase.
`width`, `height`: The width and height variables are **absolute** value variables which
define the bounding box of the docking port. It is very important to note that these are
different from the `dwidth` and `dheight` in terms of how they are counted. As they are
absolute representations of the size of the bounding box, they need to be equal to the
amount of turfs on the side of the bounding box. An easy way to think of it is, if you
start at the very corner piece, you would start the count at `1` from that corner piece,
IE, you move 1 turf in any direction, it would be `2`.
A crude ASCII example:
```
||D|||
```
Would be classed by the values `width` = 6, `height` = 1.
It is important to note that bounding boxes are *always* rectangular. However, shuttles
are allowed to be any shape they so wish, as anything that matches the `turf_type` of
stationary docking ports will not be moved with the shuttle- by default, this is equal to
`/turf/space`.
Another quick example of this:
```
|||
|||
|||
|||||
||||||D
|||||||
||| |||
```
This, even though it is not exactly a rectangle, would be classified by the values
`width` = `7`, `height` = `7`.
`dwidth`, `dheight`: The relative offset of the docking port to the bounding box. These
values are calculated **relative** to the bounding box. The values are counted from the
bottom left corner of the bounding box, **relative** to the direction of the docking port.
The "bottom left corner" changes depending on the direction of the docking port object.
so a docking port **facing north** that looks something like this:
```
|||
|||
|||D|
|||||
```
Would have a `dwidth` value of `3`, and a `dheight` value of `1`.
A docking port **facing south** that looks like this:
```
||||||
|||D||
||||
```
Would have a `dwidth` value of `2`, and a `dheight` value of `1`
### /obj/docking_port/mobile
`/obj/docking_port/mobile`, or, "Mobile" docking ports are used to define and control the
movement of the shuttle chunks. The "Mobile" docking port moves with the shuttle, and is
essentially attached to it. A "Mobile" docking port only moves to predefined positions
on the map, referred to as "Stationary" docking ports.
### /obj/docking_port/mobile
`/obj/docking_port/stationary`, or "Stationary" docking ports are used as predefined
references for where "Mobile" docking ports may move. "Stationary" docking ports do not
move unless something has gone horribly wrong. They are essentially static points in
space. Going into details, whenever a "Mobile" docking port "moves", it registers with the
stationary docking port that it was requested to move to, and moves itself to it. It is
important to note that docking ports will switch direction on the fly, and a "Stationary"
docking port not matching the initial direction of the "Mobile" docking port will cause
the entire shuttle to be rotated in order for the "Mobile" docking port to face the same
direction as the "Stationary" docking port.
## Modifications
There are three main differences between -tg-station13's shuttle system and the one in
use on Paradise, and none are very complex.
### Shuttle Controller
This is a very simple change. On -tg-station13, the shuttle controller is referenced by a
variable named `SSShuttle`. On Paradise, due to controller naming conventions, it is
instead named `shuttle_master`.
### Airlocks
The biggest modification comes in the form of how docking ports interact with airlocks.
With -tg-station13's base code, any door on the shuttle will be closed, and any door
directly next to the mobile docking port will be closed off of the shuttle.
In Paradise, however, when a mobile docking port undocks from the stationary docking port,
it will look for any door in the machine list who's `id_tag` variable matches the
stationary docking port's `id` variable. When it finds these doors, it will close *and*
bolt the doors shut. Any airlocks on the shuttle will be closed as per usual, but any
airlocks within the shuttle with the `id_tag` of `s_docking_airlock` will also be bolted,
and will stay bolted until the shuttle has exited transit space.
### Initialization
In -tg-station13's shuttle system, all docking ports register with the shuttle controller
on `New()`. However, as Paradise uses a different system for the shuttle controller, it is
not yet created when `New()` is called.
To fix this issue, all docking ports will not initialize automatically on `New()`.
Instead, they are manually initialized by the shuttle controller when it is created, via
a proc called `initialize()`.
+736
View File
@@ -0,0 +1,736 @@
//use this define to highlight docking port bounding boxes (ONLY FOR DEBUG USE)
//#define DOCKING_PORT_HIGHLIGHT
//NORTH default dir
/obj/docking_port
invisibility = 101
icon = 'icons/obj/device.dmi'
//icon = 'icons/dirsquare.dmi'
icon_state = "pinonfar"
unacidable = 1
anchored = 1
var/id
dir = NORTH //this should point -away- from the dockingport door, ie towards the ship
var/width = 0 //size of covered area, perpendicular to dir
var/height = 0 //size of covered area, paralell to dir
var/dwidth = 0 //position relative to covered area, perpendicular to dir
var/dheight = 0 //position relative to covered area, parallel to dir
//these objects are indestructable
/obj/docking_port/Destroy()
return QDEL_HINT_LETMELIVE
/obj/docking_port/singularity_pull()
return
/obj/docking_port/singularity_act()
return 0
/obj/docking_port/shuttleRotate()
return //we don't rotate with shuttles via this code.
//returns a list(x0,y0, x1,y1) where points 0 and 1 are bounding corners of the projected rectangle
/obj/docking_port/proc/return_coords(_x, _y, _dir)
if(!_dir)
_dir = dir
if(!_x)
_x = x
if(!_y)
_y = y
//byond's sin and cos functions are inaccurate. This is faster and perfectly accurate
var/cos = 1
var/sin = 0
switch(_dir)
if(WEST)
cos = 0
sin = 1
if(SOUTH)
cos = -1
sin = 0
if(EAST)
cos = 0
sin = -1
return list(
_x + (-dwidth*cos) - (-dheight*sin),
_y + (-dwidth*sin) + (-dheight*cos),
_x + (-dwidth+width-1)*cos - (-dheight+height-1)*sin,
_y + (-dwidth+width-1)*sin + (-dheight+height-1)*cos
)
//returns turfs within our projected rectangle in a specific order.
//this ensures that turfs are copied over in the same order, regardless of any rotation
/obj/docking_port/proc/return_ordered_turfs(_x, _y, _z, _dir, area/A)
if(!_dir)
_dir = dir
if(!_x)
_x = x
if(!_y)
_y = y
if(!_z)
_z = z
var/cos = 1
var/sin = 0
switch(_dir)
if(WEST)
cos = 0
sin = 1
if(SOUTH)
cos = -1
sin = 0
if(EAST)
cos = 0
sin = -1
. = list()
var/xi
var/yi
for(var/dx=0, dx<width, ++dx)
for(var/dy=0, dy<height, ++dy)
xi = _x + (dx-dwidth)*cos - (dy-dheight)*sin
yi = _y + (dy-dheight)*cos + (dx-dwidth)*sin
var/turf/T = locate(xi, yi, _z)
if(A)
if(get_area(T) == A)
. += T
else
. += null
else
. += T
#ifdef DOCKING_PORT_HIGHLIGHT
//Debug proc used to highlight bounding area
/obj/docking_port/proc/highlight(_color)
var/list/L = return_coords()
var/turf/T0 = locate(L[1],L[2],z)
var/turf/T1 = locate(L[3],L[4],z)
for(var/turf/T in block(T0,T1))
T.color = _color
T.maptext = null
if(_color)
var/turf/T = locate(L[1], L[2], z)
T.color = "#0f0"
T = locate(L[3], L[4], z)
T.color = "#00f"
#endif
//return first-found touching dockingport
/obj/docking_port/proc/get_docked()
return locate(/obj/docking_port/stationary) in loc
/obj/docking_port/proc/getDockedId()
var/obj/docking_port/P = get_docked()
if(P) return P.id
/obj/docking_port/proc/register()
return 0
/obj/docking_port/stationary
name = "dock"
var/turf_type = /turf/space
var/area_type = /area/space
/obj/docking_port/stationary/register()
if(!shuttle_master)
throw EXCEPTION("docking port [src] could not initialize.")
return 0
shuttle_master.stationary += src
if(!id)
id = "[shuttle_master.stationary.len]"
if(name == "dock")
name = "dock[shuttle_master.stationary.len]"
#ifdef DOCKING_PORT_HIGHLIGHT
highlight("#f00")
#endif
return 1
//returns first-found touching shuttleport
/obj/docking_port/stationary/get_docked()
return locate(/obj/docking_port/mobile) in loc
/*
for(var/turf/T in return_ordered_turfs())
. = locate(/obj/docking_port/mobile) in loc
if(.)
return .
*/
/obj/docking_port/stationary/transit
name = "In Transit"
turf_type = /turf/space/transit
/obj/docking_port/stationary/transit/register()
if(!..())
return 0
name = "In Transit" //This looks weird, but- it means that the on-map instances can be named something actually usable to search for, but still appear correctly in terminals.
shuttle_master.transit += src
return 1
/obj/docking_port/mobile
icon_state = "mobile"
name = "shuttle"
icon_state = "pinonclose"
var/area/shuttle/areaInstance
var/timer //used as a timer (if you want time left to complete move, use timeLeft proc)
var/mode = SHUTTLE_IDLE //current shuttle mode (see global defines)
var/callTime = 50 //time spent in transit (deciseconds)
var/roundstart_move //id of port to send shuttle to at roundstart
var/travelDir = 0 //direction the shuttle would travel in
var/obj/docking_port/stationary/destination
var/obj/docking_port/stationary/previous
/obj/docking_port/mobile/New()
..()
var/area/A = get_area(src)
if(istype(A, /area/shuttle))
areaInstance = A
if(!areaInstance)
areaInstance = new()
areaInstance.name = name
areaInstance.contents += return_ordered_turfs()
#ifdef DOCKING_PORT_HIGHLIGHT
highlight("#0f0")
#endif
/obj/docking_port/mobile/register()
if(!shuttle_master)
throw EXCEPTION("docking port [src] could not initialize.")
return 0
shuttle_master.mobile += src
if(!id)
id = "[shuttle_master.mobile.len]"
if(name == "shuttle")
name = "shuttle[shuttle_master.mobile.len]"
return 1
//this is a hook for custom behaviour. Maybe at some point we could add checks to see if engines are intact
/obj/docking_port/mobile/proc/canMove()
return 0 //0 means we can move
//this is to check if this shuttle can physically dock at dock S
/obj/docking_port/mobile/proc/canDock(obj/docking_port/stationary/S)
if(!istype(S))
return 1
if(istype(S, /obj/docking_port/stationary/transit))
return 0
//check dock is big enough to contain us
if(dwidth > S.dwidth)
return 2
if(width-dwidth > S.width-S.dwidth)
return 3
if(dheight > S.dheight)
return 4
if(height-dheight > S.height-S.dheight)
return 5
//check the dock isn't occupied
if(S.get_docked())
return 6
return 0 //0 means we can dock
//call the shuttle to destination S
/obj/docking_port/mobile/proc/request(obj/docking_port/stationary/S)
if(canDock(S))
. = 1
throw EXCEPTION("request(): shuttle cannot dock")
return 1 //we can't dock at S
switch(mode)
if(SHUTTLE_CALL)
if(S == destination)
if(world.time <= timer)
timer = world.time
else
destination = S
timer = world.time
if(SHUTTLE_RECALL)
if(S == destination)
timer = world.time - timeLeft(1)
else
destination = S
timer = world.time
mode = SHUTTLE_CALL
else
destination = S
mode = SHUTTLE_CALL
timer = world.time
enterTransit() //hyperspace
//recall the shuttle to where it was previously
/obj/docking_port/mobile/proc/cancel()
if(mode != SHUTTLE_CALL)
return
timer = world.time - timeLeft(1)
mode = SHUTTLE_RECALL
/obj/docking_port/mobile/proc/enterTransit()
previous = null
// if(!destination)
// return
var/obj/docking_port/stationary/S0 = get_docked()
var/obj/docking_port/stationary/S1 = findTransitDock()
if(S1)
if(dock(S1))
WARNING("shuttle \"[id]\" could not enter transit space. Docked at [S0 ? S0.id : "null"]. Transit dock [S1 ? S1.id : "null"].")
else
previous = S0
else
WARNING("shuttle \"[id]\" could not enter transit space. S0=[S0 ? S0.id : "null"] S1=[S1 ? S1.id : "null"]")
//default shuttleRotate
/atom/proc/shuttleRotate(rotation)
//rotate our direction
dir = angle2dir(rotation+dir2angle(dir))
//rotate the pixel offsets too.
if (pixel_x || pixel_y)
if (rotation < 0)
rotation += 360
for (var/turntimes=rotation/90;turntimes>0;turntimes--)
var/oldPX = pixel_x
var/oldPY = pixel_y
pixel_x = oldPY
pixel_y = (oldPX*(-1))
//this is the main proc. It instantly moves our mobile port to stationary port S1
//it handles all the generic behaviour, such as sanity checks, closing doors on the shuttle, stunning mobs, etc
/obj/docking_port/mobile/proc/dock(obj/docking_port/stationary/S1)
. = canDock(S1)
if(.)
throw EXCEPTION("dock(): shuttle cannot dock")
return .
if(canMove())
return -1
// //rotate transit docking ports, so we don't need zillions of variants
// if(istype(S1, /obj/docking_port/stationary/transit))
// S1.dir = turn(NORTH, -travelDir)
var/obj/docking_port/stationary/S0 = get_docked()
var/turf_type = /turf/space
var/area_type = /area/space
if(S0)
if(S0.turf_type)
turf_type = S0.turf_type
if(S0.area_type)
area_type = S0.area_type
//close and lock the dock's airlocks
closePortDoors(S0)
var/list/L0 = return_ordered_turfs(x, y, z, dir, areaInstance)
var/list/L1 = return_ordered_turfs(S1.x, S1.y, S1.z, S1.dir)
var/rotation = dir2angle(S1.dir)-dir2angle(dir)
if ((rotation % 90) != 0)
rotation += (rotation % 90) //diagonal rotations not allowed, round up
rotation = SimplifyDegrees(rotation)
//remove area surrounding docking port
if(areaInstance.contents.len)
var/area/A0 = locate("[area_type]")
if(!A0)
A0 = new area_type(null)
for(var/turf/T0 in L0)
A0.contents += T0
//move or squish anything in the way ship at destination
roadkill(L1, S1.dir)
var/list/door_unlock_list = list()
for(var/i=1, i<=L0.len, ++i)
var/turf/T0 = L0[i]
if(!T0)
continue
var/turf/T1 = L1[i]
if(!T1)
continue
T0.copyTurf(T1)
areaInstance.contents += T1
//copy over air
if(istype(T1, /turf/simulated))
var/turf/simulated/Ts1 = T1
Ts1.copy_air_with_tile(T0)
//move mobile to new location
for(var/atom/movable/AM in T0)
if (rotation)
AM.shuttleRotate(rotation)
if (istype(AM,/obj))
var/obj/O = AM
if(O.invisibility >= 101)
continue
O.loc = T1
//close open doors
if(istype(O, /obj/machinery/door))
var/obj/machinery/door/Door = O
spawn(-1)
if(Door)
Door.close()
if(istype(Door, /obj/machinery/door/airlock))
var/obj/machinery/door/airlock/A = Door
if(A.id_tag == "s_docking_airlock")
A.lock()
door_unlock_list += A
else if (istype(AM,/mob))
var/mob/M = AM
if(!M.move_on_shuttle)
continue
M.loc = T1
//docking turbulence
if(M.client)
spawn(0)
if(M.buckled)
shake_camera(M, 2, 1) // turn it down a bit come on
else
shake_camera(M, 7, 1)
if(istype(M, /mob/living/carbon))
if(!M.buckled)
M.Weaken(3)
if (rotation)
T1.shuttleRotate(rotation)
//lighting stuff
T1.reconsider_lights()
T1.lighting_build_overlays()
air_master.remove_from_active(T1)
T1.CalculateAdjacentTurfs()
air_master.add_to_active(T1,1)
T0.ChangeTurf(turf_type)
T0.reconsider_lights()
air_master.remove_from_active(T0)
T0.CalculateAdjacentTurfs()
air_master.add_to_active(T0,1)
loc = S1.loc
dir = S1.dir
unlockPortDoors(S1)
if(S1 && S1.id != "[id]_transit")
for(var/obj/machinery/door/airlock/A in door_unlock_list)
spawn(-1)
A.unlock()
/*
if(istype(S1, /obj/docking_port/stationary/transit))
var/d = turn(dir, 180 + travelDir)
for(var/turf/space/transit/T in S1.return_ordered_turfs())
T.pushdirection = d
T.update_icon()
*/
/obj/docking_port/mobile/proc/findTransitDock()
var/obj/docking_port/stationary/transit/T = shuttle_master.getDock("[id]_transit")
if(T && !canDock(T))
return T
/* commented out due to issues with rotation
for(var/obj/docking_port/stationary/transit/S in shuttle_master.transit)
if(S.id)
continue
if(!canDock(S))
return S
*/
//shuttle-door closing is handled in the dock() proc whilst looping through turfs
//this one closes the door where we are docked at, if there is one there.
/obj/docking_port/mobile/proc/closePortDoors(obj/docking_port/stationary/S0)
if(!istype(S0))
return 1
for(var/obj/machinery/door/airlock/A in machines)
if(A.id_tag == S0.id)
spawn(-1)
A.close()
A.lock()
/obj/docking_port/mobile/proc/unlockPortDoors(obj/docking_port/stationary/S1)
if(!istype(S1))
return 0
for(var/obj/machinery/door/airlock/A in machines)
if(A.id_tag == S1.id)
spawn(-1)
if(A.locked)
A.unlock()
/obj/docking_port/mobile/proc/roadkill(list/L, dir, x, y)
for(var/turf/T in L)
for(var/atom/movable/AM in T)
if(ismob(AM))
if(istype(AM, /mob/living))
var/mob/living/M = AM
M.Paralyse(10)
M.take_organ_damage(80)
M.anchored = 0
else
continue
if(!AM.anchored)
step(AM, dir)
else
qdel(AM)
/*
//used to check if atom/A is within the shuttle's bounding box
/obj/docking_port/mobile/proc/onShuttleCheck(atom/A)
var/turf/T = get_turf(A)
if(!T)
return 0
var/list/L = return_coords()
if(L[1] > L[3])
L.Swap(1,3)
if(L[2] > L[4])
L.Swap(2,4)
if(L[1] <= T.x && T.x <= L[3])
if(L[2] <= T.y && T.y <= L[4])
return 1
return 0
*/
//used by shuttle subsystem to check timers
/obj/docking_port/mobile/proc/check()
var/timeLeft = timeLeft(1)
if(timeLeft <= 0)
switch(mode)
if(SHUTTLE_CALL)
if(dock(destination))
setTimer(20) //can't dock for some reason, try again in 2 seconds
return
if(SHUTTLE_RECALL)
if(dock(previous))
setTimer(20) //can't dock for some reason, try again in 2 seconds
return
mode = SHUTTLE_IDLE
timer = 0
destination = null
/obj/docking_port/mobile/proc/setTimer(wait)
if(timer <= 0)
timer = world.time
timer += wait - timeLeft(1)
//returns timeLeft
/obj/docking_port/mobile/proc/timeLeft(divisor)
if(divisor <= 0)
divisor = 10
if(!timer)
return round(callTime/divisor, 1)
return max( round((timer+callTime-world.time)/divisor,1), 0 )
/obj/docking_port/mobile/proc/getStatusText()
var/obj/docking_port/stationary/dockedAt = get_docked()
. = (dockedAt && dockedAt.name) ? dockedAt.name : "unknown"
if(istype(dockedAt, /obj/docking_port/stationary/transit))
var/obj/docking_port/stationary/dst
if(mode == SHUTTLE_RECALL)
dst = previous
else
dst = destination
. += " towards [dst ? dst.name : "unknown location"] ([timeLeft(600)]mins)"
/obj/machinery/computer/shuttle
name = "Shuttle Console"
icon_screen = "shuttle"
icon_keyboard = "tech_key"
req_access = list( )
circuit = /obj/item/weapon/circuitboard/shuttle
var/shuttleId
var/possible_destinations = ""
var/admin_controlled
/obj/machinery/computer/shuttle/New(location, obj/item/weapon/circuitboard/shuttle/C)
..()
if(istype(C))
possible_destinations = C.possible_destinations
shuttleId = C.shuttleId
/obj/machinery/computer/shuttle/attack_hand(mob/user)
if(..(user))
return
src.add_fingerprint(usr)
var/list/options = params2list(possible_destinations)
var/obj/docking_port/mobile/M = shuttle_master.getShuttle(shuttleId)
var/dat = "Status: [M ? M.getStatusText() : "*Missing*"]<br><br>"
if(M)
var/destination_found
for(var/obj/docking_port/stationary/S in shuttle_master.stationary)
if(!options.Find(S.id))
continue
if(M.canDock(S))
continue
destination_found = 1
dat += "<A href='?src=\ref[src];move=[S.id]'>Send to [S.name]</A><br>"
if(!destination_found)
dat += "<B>Shuttle Locked</B><br>"
if(admin_controlled)
dat += "Authorized personnel only<br>"
dat += "<A href='?src=\ref[src];request=1]'>Request Authorization</A><br>"
dat += "<a href='?src=\ref[user];mach_close=computer'>Close</a>"
var/datum/browser/popup = new(user, "computer", M ? M.name : "shuttle", 300, 200)
popup.set_content("<center>[dat]</center>")
popup.set_title_image(usr.browse_rsc_icon(src.icon, src.icon_state))
popup.open()
/obj/machinery/computer/shuttle/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
src.add_fingerprint(usr)
if(!allowed(usr))
usr << "<span class='danger'>Access denied.</span>"
return
if(href_list["move"])
switch(shuttle_master.moveShuttle(shuttleId, href_list["move"], 1))
if(0) usr << "<span class='notice'>Shuttle received message and will be sent shortly.</span>"
if(1) usr << "<span class='warning'>Invalid shuttle requested.</span>"
else usr << "<span class='notice'>Unable to comply.</span>"
updateUsrDialog()
/obj/machinery/computer/shuttle/emag_act(mob/user)
if(!emagged)
src.req_access = list()
emagged = 1
user << "<span class='notice'>You fried the consoles ID checking system.</span>"
/obj/machinery/computer/shuttle/ferry
name = "transport ferry console"
circuit = /obj/item/weapon/circuitboard/ferry
shuttleId = "ferry"
possible_destinations = "ferry_home;ferry_away"
/obj/machinery/computer/shuttle/ferry/request
name = "ferry console"
circuit = /obj/item/weapon/circuitboard/ferry/request
var/cooldown //prevents spamming admins
possible_destinations = "ferry_home"
admin_controlled = 1
/obj/machinery/computer/shuttle/ferry/request/Topic(href, href_list)
..()
if(href_list["request"])
if(cooldown)
return
cooldown = 1
usr << "<span class='notice'>Your request has been recieved by Centcom.</span>"
admins << "<b>FERRY: <font color='blue'>[key_name_admin(usr)] (<A HREF='?_src_=holder;adminmoreinfo=\ref[usr]'>?</A>) (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[usr]'>FLW</A>) (<A HREF='?_src_=holder;secretsfun=moveferry'>Move Ferry</a>)</b> is requesting to move the transport ferry to Centcom.</font>"
spawn(600) //One minute cooldown
cooldown = 0
/obj/machinery/computer/shuttle/ert
name = "specops shuttle console"
//circuit = /obj/item/weapon/circuitboard/ert
shuttleId = "specops"
possible_destinations = "specops_home;specops_away"
/obj/machinery/computer/shuttle/white_ship
name = "White Ship Console"
desc = "Used to control the White Ship."
circuit = /obj/item/weapon/circuitboard/white_ship
shuttleId = "whiteship"
possible_destinations = "whiteship_away;whiteship_home;whiteship_z4"
/obj/machinery/computer/shuttle/syndicate
name = "syndicate shuttle terminal"
icon_screen = "syndishuttle"
icon_keyboard = "syndie_key"
req_access = list(access_syndicate)
shuttleId = "syndicate"
possible_destinations = "syndicate_away;syndicate_z5;syndicate_z3;syndicate_ne;syndicate_nw;syndicate_n;syndicate_se;syndicate_sw;syndicate_s"
/obj/machinery/computer/shuttle/syndicate/recall
name = "syndicate shuttle recall terminal"
possible_destinations = "syndicate_away"
/obj/machinery/computer/shuttle/vox
name = "skipjack control console"
req_access = list(access_vox)
shuttleId = "skipjack"
possible_destinations = "skipjack_away;skipjack_ne;skipjack_nw;skipjack_se;skipjack_sw;skipjack_z5"
/obj/machinery/computer/shuttle/engineering
name = "Engineering Shuttle Console"
desc = "Used to call and send the engineering shuttle."
shuttleId = "engineering"
possible_destinations = "engineering_home;engineering_away"
/obj/machinery/computer/shuttle/science
name = "Science Shuttle Console"
desc = "Used to call and send the science shuttle."
shuttleId = "science"
possible_destinations = "science_home;science_away"
/obj/machinery/computer/shuttle/admin
name = "Administration Shuttle Console"
desc = "Used to call and send the administration shuttle."
shuttleId = "admin"
possible_destinations = "admin_home;admin_away"
#undef DOCKING_PORT_HIGHLIGHT
/turf/proc/copyTurf(turf/T)
if(T.type != type)
var/obj/O
if(underlays.len) //we have underlays, which implies some sort of transparency, so we want to a snapshot of the previous turf as an underlay
O = new()
O.underlays.Add(T)
T = new type(T)
if(underlays.len)
T.underlays = O.underlays
if(T.icon_state != icon_state)
T.icon_state = icon_state
if(T.icon != icon)
T.icon = icon
if(T.color != color)
T.color = color
if(T.dir != dir)
T.dir = dir
return T
-49
View File
@@ -1,49 +0,0 @@
/obj/machinery/computer/shuttle_control/multi/vox
name = "skipjack control console"
req_access = list(access_vox)
shuttle_tag = "Vox Skipjack"
is_syndicate = 1
warn_on_return = 1
/obj/machinery/computer/shuttle_control/multi/vox/attack_ai(user as mob)
user << "<span class='warning'>Access Denied.</span>"
return 1
/obj/machinery/computer/shuttle_control/multi/syndicate
name = "\improper Syndicate control console"
req_access = list(access_syndicate)
shuttle_tag = "Syndicate"
is_syndicate = 1
/obj/machinery/computer/shuttle_control/multi/syndicate/attack_ai(user as mob)
user << "<span class='warning'>Access Denied.</span>"
return 1
/obj/machinery/computer/shuttle_control/multi/xenos
name = "alien control console"
shuttle_tag = "Xenomorph"
icon_keyboard = "telesci_key"
icon_screen = "telesci"
/obj/machinery/computer/shuttle_control/multi/xenos/attack_hand(user as mob)
user << "<span class='warning'>You do not know how to operate this machinery.</span>"
return 1
/obj/machinery/computer/shuttle_control/multi/xenos/attack_ai(user as mob)
user << "<span class='warning'>Access Denied.</span>"
return 1
/obj/machinery/computer/shuttle_control/multi/xenos/attack_ghost(user as mob)
ui_interact(user)
/obj/machinery/computer/shuttle_control/multi/xenos/attack_alien(user as mob)
ui_interact(user)
/obj/machinery/computer/shuttle_control/multi/xenos/CanUseTopic(mob/user)
if(isalien(user))
return STATUS_INTERACTIVE
if(ishuman(user))
return STATUS_CLOSE
return ..()
-47
View File
@@ -1,47 +0,0 @@
/obj/machinery/computer/shuttle_control/mining
name = "mining shuttle console"
shuttle_tag = "Mining"
req_access = list()
circuit = /obj/item/weapon/circuitboard/mining_shuttle
/obj/machinery/computer/shuttle_control/engineering
name = "engineering shuttle console"
shuttle_tag = "Engineering"
req_one_access_txt = "10;24"
circuit = /obj/item/weapon/circuitboard/engineering_shuttle
/obj/machinery/computer/shuttle_control/research
name = "research shuttle console"
shuttle_tag = "Research"
req_access = list(access_xenoarch)
circuit = /obj/item/weapon/circuitboard/research_shuttle
/obj/machinery/computer/shuttle_control/labor_camp
name = "labor camp shuttle console"
shuttle_tag = "Labor"
req_access = list(access_brig)
/obj/machinery/computer/shuttle_control/labor_camp/one_way
name = "prisoner shuttle console"
req_access = list()
/obj/machinery/computer/shuttle_control/labor_camp/one_way/launch()
var/datum/shuttle/ferry/shuttle = shuttle_controller.shuttles[shuttle_tag]
if (!istype(shuttle))
return
if (shuttle.location)
src.visible_message("\blue Shuttle is already at the outpost.")
return
..()
/obj/machinery/computer/shuttle_control/labor_camp/one_way/force_launch()
var/datum/shuttle/ferry/shuttle = shuttle_controller.shuttles[shuttle_tag]
if (!istype(shuttle))
return
if (shuttle.location)
src.visible_message("\blue Shuttle is already at the outpost.")
return
..()
/obj/machinery/computer/shuttle_control/labor_camp/one_way/cancel_launch()
src.visible_message("\red That command has been disabled.")
-141
View File
@@ -1,141 +0,0 @@
/datum/shuttle/ferry/escape_pod
var/datum/computer/file/embedded_program/docking/simple/escape_pod/arming_controller
/datum/shuttle/ferry/escape_pod/can_launch()
if(arming_controller && !arming_controller.armed) //must be armed
return 0
if(location)
return 0 //it's a one-way trip.
return ..()
/datum/shuttle/ferry/escape_pod/can_force()
if (arming_controller.eject_time && world.time < arming_controller.eject_time + 50)
return 0 //dont allow force launching until 5 seconds after the arming controller has reached it's countdown
return ..()
/datum/shuttle/ferry/escape_pod/can_cancel()
return 0
//This controller goes on the escape pod itself
/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod
name = "escape pod controller"
var/datum/shuttle/ferry/escape_pod/pod
/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
var/data[0]
data = list(
"docking_status" = docking_program.get_docking_status(),
"override_enabled" = docking_program.override_enabled,
"door_state" = docking_program.memory["door_status"]["state"],
"door_lock" = docking_program.memory["door_status"]["lock"],
"can_force" = pod.can_force() || (emergency_shuttle.departed && pod.can_launch()), //allow players to manually launch ahead of time if the shuttle leaves
"is_armed" = pod.arming_controller.armed,
)
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "escape_pod_console.tmpl", name, 470, 290)
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1)
/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod/Topic(href, href_list)
if(..()) //I hate this "return 1 to indicate they are not allowed to use the controller" crap, but not sure how else to do it without being able to call machinery/Topic() directly.
return 1
if("manual_arm")
pod.arming_controller.arm()
if("force_launch")
if (pod.can_force())
pod.force_launch(src)
else if (emergency_shuttle.departed && pod.can_launch()) //allow players to manually launch ahead of time if the shuttle leaves
pod.launch(src)
return 0
//This controller is for the escape pod berth (station side)
/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod_berth
name = "escape pod berth controller"
/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod_berth/initialize()
..()
docking_program = new/datum/computer/file/embedded_program/docking/simple/escape_pod(src)
program = docking_program
/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod_berth/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
var/data[0]
var/armed = null
if (istype(docking_program, /datum/computer/file/embedded_program/docking/simple/escape_pod))
var/datum/computer/file/embedded_program/docking/simple/escape_pod/P = docking_program
armed = P.armed
data = list(
"docking_status" = docking_program.get_docking_status(),
"override_enabled" = docking_program.override_enabled,
"armed" = armed,
)
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "escape_pod_berth_console.tmpl", name, 470, 290)
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1)
/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod_berth/emag_act(user as mob)
if (!emagged)
user << "\blue You emag the [src], arming the escape pod!"
emagged = 1
if (istype(docking_program, /datum/computer/file/embedded_program/docking/simple/escape_pod))
var/datum/computer/file/embedded_program/docking/simple/escape_pod/P = docking_program
if (!P.armed)
P.arm()
//A docking controller program for a simple door based docking port
/datum/computer/file/embedded_program/docking/simple/escape_pod
var/armed = 0
var/eject_delay = 10 //give latecomers some time to get out of the way if they don't make it onto the pod
var/eject_time = null
var/closing = 0
/datum/computer/file/embedded_program/docking/simple/escape_pod/proc/arm()
armed = 1
open_door()
/datum/computer/file/embedded_program/docking/simple/escape_pod/receive_user_command(command)
if (!armed)
return
..(command)
/datum/computer/file/embedded_program/docking/simple/escape_pod/process()
..()
if (eject_time && world.time >= eject_time && !closing)
close_door()
closing = 1
/datum/computer/file/embedded_program/docking/simple/escape_pod/prepare_for_docking()
return
/datum/computer/file/embedded_program/docking/simple/escape_pod/ready_for_docking()
return 1
/datum/computer/file/embedded_program/docking/simple/escape_pod/finish_docking()
return //don't do anything - the doors only open when the pod is armed.
/datum/computer/file/embedded_program/docking/simple/escape_pod/prepare_for_undocking()
eject_time = world.time + eject_delay*10
/*
/datum/computer/file/embedded_program/docking/simple/escape_pod/ready_for_undocking()
if (world.time < eject_time)
return 0
return ..()
*/
-126
View File
@@ -1,126 +0,0 @@
//These lists are populated in /datum/shuttle_controller/New()
//Shuttle controller is instantiated in master_controller.dm.
//shuttle moving state defines are in setup.dm
/datum/shuttle
var/warmup_time = 0
var/moving_status = SHUTTLE_IDLE
var/docking_controller_tag //tag of the controller used to coordinate docking
var/datum/computer/file/embedded_program/docking/docking_controller //the controller itself. (micro-controller, not game controller)
var/arrive_time = 0 //the time at which the shuttle arrives when long jumping
/datum/shuttle/proc/short_jump(var/area/origin,var/area/destination)
if(moving_status != SHUTTLE_IDLE) return
//it would be cool to play a sound here
moving_status = SHUTTLE_WARMUP
spawn(warmup_time*10)
if (moving_status == SHUTTLE_IDLE)
return //someone cancelled the launch
move(origin, destination)
moving_status = SHUTTLE_IDLE
/datum/shuttle/proc/long_jump(var/area/departing, var/area/destination, var/area/interim, var/travel_time, var/direction)
//world << "shuttle/long_jump: departing=[departing], destination=[destination], interim=[interim], travel_time=[travel_time]"
if(moving_status != SHUTTLE_IDLE) return
//it would be cool to play a sound here
moving_status = SHUTTLE_WARMUP
spawn(warmup_time*10)
if (moving_status == SHUTTLE_IDLE)
return //someone cancelled the launch
move(departing, interim, direction)
moving_status = SHUTTLE_INTRANSIT
arrive_time = world.time + travel_time*10
while (world.time < arrive_time)
sleep(5)
move(interim, destination, direction)
moving_status = SHUTTLE_IDLE
/datum/shuttle/proc/dock()
if (!docking_controller)
return
var/dock_target = current_dock_target()
if (!dock_target)
return
docking_controller.initiate_docking(dock_target)
/datum/shuttle/proc/undock()
if (!docking_controller)
return
docking_controller.initiate_undocking()
/datum/shuttle/proc/current_dock_target()
return null
/datum/shuttle/proc/skip_docking_checks()
if (!docking_controller || !current_dock_target())
return 1 //shuttles without docking controllers or at locations without docking ports act like old-style shuttles
return 0
//just moves the shuttle from A to B, if it can be moved
/datum/shuttle/proc/move(var/area/origin, var/area/destination, var/direction=null)
//world << "move_shuttle() called for [shuttle_tag] leaving [origin] en route to [destination]."
//world << "area_coming_from: [origin]"
//world << "destination: [destination]"
if(origin == destination)
//world << "cancelling move, shuttle will overlap."
return
if (docking_controller && !docking_controller.undocked())
docking_controller.force_undock()
var/list/dstturfs = list()
var/throwy = world.maxy
for(var/turf/T in destination)
dstturfs += T
if(T.y < throwy)
throwy = T.y
for(var/turf/T in dstturfs)
var/turf/D = locate(T.x, throwy - 1, 1)
for(var/atom/movable/AM as mob|obj in T)
AM.Move(D, SOUTH)
if(istype(T, /turf/simulated))
qdel(T)
for(var/mob/living/carbon/bug in destination)
bug.gib()
for(var/mob/living/simple_animal/pest in destination)
pest.gib()
origin.move_contents_to(destination, direction=direction)
for(var/mob/M in destination)
if(M.client)
spawn(0)
if(M.buckled)
M << "\red Sudden acceleration presses you into your chair!"
shake_camera(M, 3, 1)
else
M << "\red The floor lurches beneath you!"
shake_camera(M, 10, 1)
if(istype(M, /mob/living/carbon))
if(!M.buckled)
M.Weaken(3)
return
//returns 1 if the shuttle has a valid arrive time
/datum/shuttle/proc/has_arrive_time()
return (moving_status == SHUTTLE_INTRANSIT)
-108
View File
@@ -1,108 +0,0 @@
/obj/machinery/computer/shuttle_control
name = "shuttle control console"
icon = 'icons/obj/computer.dmi'
icon_screen = "shuttle"
icon_keyboard = "med_key"
circuit = null
var/shuttle_tag // Used to coordinate data in shuttle controller.
var/hacked = 0 // Has been emagged, no access restrictions.
/obj/machinery/computer/shuttle_control/attack_hand(user as mob)
if(..(user))
return
if(!allowed(user) && !isobserver(user))
user << "<span class='warning'>Access denied.</span>"
return 1
ui_interact(user)
/obj/machinery/computer/shuttle_control/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
var/data[0]
var/datum/shuttle/ferry/shuttle = shuttle_controller.shuttles[shuttle_tag]
if (!istype(shuttle))
return
var/shuttle_state
switch(shuttle.moving_status)
if(SHUTTLE_IDLE) shuttle_state = "idle"
if(SHUTTLE_WARMUP) shuttle_state = "warmup"
if(SHUTTLE_INTRANSIT) shuttle_state = "in_transit"
var/shuttle_status
switch (shuttle.process_state)
if(IDLE_STATE)
if (shuttle.in_use)
shuttle_status = "Busy."
else if (!shuttle.location)
shuttle_status = "Standing-by at station."
else
shuttle_status = "Standing-by at offsite location."
if(WAIT_LAUNCH)
shuttle_status = "Shuttle has recieved command and will depart shortly."
if(WAIT_ARRIVE)
shuttle_status = "Proceeding to destination."
if(WAIT_FINISH)
shuttle_status = "Arriving at destination now."
data = list(
"shuttle_status" = shuttle_status,
"shuttle_state" = shuttle_state,
"has_docking" = shuttle.docking_controller? 1 : 0,
"docking_status" = shuttle.docking_controller? shuttle.docking_controller.get_docking_status() : null,
"docking_override" = shuttle.docking_controller? shuttle.docking_controller.override_enabled : null,
"can_launch" = shuttle.can_launch(),
"can_cancel" = shuttle.can_cancel(),
"can_force" = shuttle.can_force(),
)
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "shuttle_control_console.tmpl", "[shuttle_tag] Shuttle Control", 470, 310)
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1)
/obj/machinery/computer/shuttle_control/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
src.add_fingerprint(usr)
if(href_list["move"])
launch(usr)
if(href_list["force"])
force_launch(usr)
else if(href_list["cancel"])
cancel_launch(usr)
/obj/machinery/computer/shuttle_control/proc/launch(var/mob/user)
var/datum/shuttle/ferry/shuttle = shuttle_controller.shuttles[shuttle_tag]
if (!istype(shuttle))
return
shuttle.launch(user)
/obj/machinery/computer/shuttle_control/proc/force_launch(var/mob/user)
var/datum/shuttle/ferry/shuttle = shuttle_controller.shuttles[shuttle_tag]
if (!istype(shuttle))
return
shuttle.force_launch(user)
/obj/machinery/computer/shuttle_control/proc/cancel_launch(var/mob/user)
var/datum/shuttle/ferry/shuttle = shuttle_controller.shuttles[shuttle_tag]
if (!istype(shuttle))
return
shuttle.cancel_launch(user)
/obj/machinery/computer/shuttle_control/emag_act(user as mob)
src.req_access = list()
src.req_one_access = list()
hacked = 1
usr << "You short out the console's ID checking system. It's now available to everyone!"
/obj/machinery/computer/shuttle_control/bullet_act(var/obj/item/projectile/Proj)
visible_message("[Proj] ricochets off [src]!")
-245
View File
@@ -1,245 +0,0 @@
/datum/shuttle/ferry/emergency
//pass
/datum/shuttle/ferry/emergency/arrived()
if (istype(in_use, /obj/machinery/computer/shuttle_control/emergency))
var/obj/machinery/computer/shuttle_control/emergency/C = in_use
C.reset_authorization()
emergency_shuttle.shuttle_arrived()
/datum/shuttle/ferry/emergency/long_jump(var/area/departing, var/area/destination, var/area/interim, var/travel_time, var/direction)
//world << "shuttle/ferry/emergency/long_jump: departing=[departing], destination=[destination], interim=[interim], travel_time=[travel_time]"
if (!location)
travel_time = SHUTTLE_TRANSIT_DURATION_RETURN
else
travel_time = SHUTTLE_TRANSIT_DURATION
//update move_time so we get correct ETAs
move_time = travel_time
..()
/datum/shuttle/ferry/emergency/move(var/area/origin,var/area/destination)
if (origin == area_station) //leaving the station
emergency_shuttle.departed = 1
if (emergency_shuttle.evac)
priority_announcement.Announce("The Emergency Shuttle has left the station. Estimate [round(emergency_shuttle.estimate_arrival_time()/60,1)] minutes until the shuttle docks at Central Command.")
else
priority_announcement.Announce("The Crew Transfer Shuttle has left the station. Estimate [round(emergency_shuttle.estimate_arrival_time()/60,1)] minutes until the shuttle docks at Central Command.")
..(origin, destination)
/datum/shuttle/ferry/emergency/can_launch(var/mob/user)
if (istype(user, /obj/machinery/computer/shuttle_control/emergency))
var/obj/machinery/computer/shuttle_control/emergency/C = user
if (!C.has_authorization())
return 0
if(moving_status == SHUTTLE_STRANDED && C.has_authorization())
return 1
return ..()
/datum/shuttle/ferry/emergency/can_force(var/mob/user)
if (istype(user, /obj/machinery/computer/shuttle_control/emergency))
var/obj/machinery/computer/shuttle_control/emergency/C = user
//initiating or cancelling a launch ALWAYS requires authorization, but if we are already set to launch anyways than forcing does not.
//this is so that people can force launch if the docking controller cannot safely undock without needing X heads to swipe.
if (process_state != WAIT_LAUNCH && !C.has_authorization())
return 0
return ..()
/datum/shuttle/ferry/emergency/can_cancel(var/mob/user)
if (istype(user, /obj/machinery/computer/shuttle_control/emergency))
var/obj/machinery/computer/shuttle_control/emergency/C = user
if (!C.has_authorization())
return 0
return ..()
/datum/shuttle/ferry/emergency/launch(var/user)
if (!can_launch(user)) return
if(emergency_shuttle.no_escape)
user << "<span class='warning'>The emergency shuttle has been disabled by Central Command.</span>"
return
if (istype(user, /obj/machinery/computer/shuttle_control/emergency)) //if we were given a command by an emergency shuttle console
if (emergency_shuttle.autopilot)
emergency_shuttle.autopilot = 0
world << "\blue <B>Alert: The shuttle autopilot has been overridden. Launch sequence initiated!</B>"
..(user)
/datum/shuttle/ferry/emergency/force_launch(var/user)
if (!can_force(user)) return
if (istype(user, /obj/machinery/computer/shuttle_control/emergency)) //if we were given a command by an emergency shuttle console
if (emergency_shuttle.autopilot)
emergency_shuttle.autopilot = 0
world << "\blue <B>Alert: The shuttle autopilot has been overridden. Bluespace drive engaged!</B>"
..(user)
/datum/shuttle/ferry/emergency/cancel_launch(var/user)
if (!can_cancel(user)) return
if (istype(user, /obj/machinery/computer/shuttle_control/emergency)) //if we were given a command by an emergency shuttle console
if (emergency_shuttle.autopilot)
emergency_shuttle.autopilot = 0
world << "\blue <B>Alert: The shuttle autopilot has been overridden. Launch sequence aborted!</B>"
..(user)
/obj/machinery/computer/shuttle_control/emergency
shuttle_tag = "Escape"
var/debug = 0
var/req_authorizations = 2
var/list/authorized = list()
/obj/machinery/computer/shuttle_control/emergency/proc/has_authorization()
return (authorized.len >= req_authorizations || emagged)
/obj/machinery/computer/shuttle_control/emergency/proc/reset_authorization()
//no need to reset emagged status. If they really want to go back to the station they can.
authorized = initial(authorized)
//returns 1 if the ID was accepted and a new authorization was added, 0 otherwise
/obj/machinery/computer/shuttle_control/emergency/proc/read_authorization(var/ident)
if (!ident)
return 0
if (authorized.len >= req_authorizations)
return 0 //don't need any more
var/list/access
var/auth_name
var/dna_hash
if(istype(ident, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/ID = ident
access = ID.access
auth_name = "[ID.registered_name] ([ID.assignment])"
dna_hash = ID.dna_hash
if(istype(ident, /obj/item/device/pda))
var/obj/item/device/pda/PDA = ident
access = PDA.id.access
auth_name = "[PDA.id.registered_name] ([PDA.id.assignment])"
dna_hash = PDA.id.dna_hash
if (!access || !istype(access))
return 0 //not an ID
if (dna_hash in authorized)
src.visible_message("[src] buzzes. That ID has already been scanned.")
return 0
if (!(access_heads in access))
src.visible_message("[src] buzzes, rejecting [ident].")
return 0
src.visible_message("[src] beeps as it scans [ident].")
authorized[dna_hash] = auth_name
if (req_authorizations - authorized.len)
world << "<span class='notice'>Alert: [req_authorizations - authorized.len] authorization\s needed to override the shuttle autopilot.</span>"
return 1
/obj/machinery/computer/shuttle_control/emergency/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
read_authorization(W)
..()
/obj/machinery/computer/shuttle_control/emergency/emag_act(user as mob)
if (!emagged)
user << "<span class='notice'>You short out the [src]'s authorization protocols.</span>"
emagged = 1
return
/obj/machinery/computer/shuttle_control/emergency/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
var/data[0]
var/datum/shuttle/ferry/emergency/shuttle = shuttle_controller.shuttles[shuttle_tag]
if (!istype(shuttle))
return
var/shuttle_state
switch(shuttle.moving_status)
if(SHUTTLE_IDLE) shuttle_state = "idle"
if(SHUTTLE_WARMUP) shuttle_state = "warmup"
if(SHUTTLE_INTRANSIT) shuttle_state = "in_transit"
if(SHUTTLE_STRANDED) shuttle_state = "idle"
var/shuttle_status
switch (shuttle.process_state)
if(IDLE_STATE)
if (shuttle.in_use)
shuttle_status = "Busy."
else if (!shuttle.location)
shuttle_status = "Standing-by at [station_name]."
else
shuttle_status = "Standing-by at Central Command."
if(WAIT_LAUNCH)
shuttle_status = "Shuttle has received command and will depart shortly."
if(WAIT_ARRIVE)
shuttle_status = "Proceeding to destination."
if(WAIT_FINISH)
shuttle_status = "Arriving at destination now."
//build a list of authorizations
var/list/auth_list[req_authorizations]
if (!emagged)
var/i = 1
for (var/dna_hash in authorized)
auth_list[i++] = list("auth_name"=authorized[dna_hash], "auth_hash"=dna_hash)
while (i <= req_authorizations) //fill up the rest of the list with blank entries
auth_list[i++] = list("auth_name"="", "auth_hash"=null)
else
for (var/i = 1; i <= req_authorizations; i++)
auth_list[i] = list("auth_name"="<font color=\"red\">ERROR</font>", "auth_hash"=null)
var/has_auth = has_authorization()
data = list(
"shuttle_status" = shuttle_status,
"shuttle_state" = shuttle_state,
"has_docking" = shuttle.docking_controller? 1 : 0,
"docking_status" = shuttle.docking_controller? shuttle.docking_controller.get_docking_status() : null,
"docking_override" = shuttle.docking_controller? shuttle.docking_controller.override_enabled : null,
"can_launch" = shuttle.can_launch(src),
//"can_cancel" = shuttle.can_cancel(src),
"can_force" = shuttle.can_force(src),
"auth_list" = auth_list,
"has_auth" = has_auth,
"user" = debug? user : null,
)
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "escape_shuttle_control_console.tmpl", "Shuttle Control", 470, 420)
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1)
/obj/machinery/computer/shuttle_control/emergency/Topic(href, href_list)
if(..())
return
if(href_list["removeid"])
var/dna_hash = href_list["removeid"]
authorized -= dna_hash
if(!emagged && href_list["scanid"])
//They selected an empty entry. Try to scan their id.
if (ishuman(usr))
var/mob/living/carbon/human/H = usr
if (!read_authorization(H.get_active_hand())) //try to read what's in their hand first
read_authorization(H.wear_id)
-165
View File
@@ -1,165 +0,0 @@
#define IDLE_STATE 0
#define WAIT_LAUNCH 1
#define WAIT_ARRIVE 2
#define WAIT_FINISH 3
#define DOCK_ATTEMPT_TIMEOUT 200 //how long in ticks we wait before assuming the docking controller is broken or blown up.
/datum/shuttle/ferry
var/location = 0 //0 = at area_station, 1 = at area_offsite
var/direction = 0 //0 = going to station, 1 = going to offsite.
var/process_state = IDLE_STATE
var/in_use = null //tells the controller whether this shuttle needs processing
var/area_transition
var/move_time = 0 //the time spent in the transition area
var/transit_direction = null //needed for area/move_contents_to() to properly handle shuttle corners - not exactly sure how it works.
var/area_station
var/area_offsite
//TODO: change location to a string and use a mapping for area and dock targets.
var/dock_target_station
var/dock_target_offsite
var/last_dock_attempt_time = 0
/datum/shuttle/ferry/short_jump(var/area/origin,var/area/destination)
if(isnull(location))
return
if(!destination)
destination = get_location_area(!location)
if(!origin)
origin = get_location_area(location)
direction = !location
..(origin, destination)
/datum/shuttle/ferry/long_jump(var/area/departing, var/area/destination, var/area/interim, var/travel_time, var/direction)
//world << "shuttle/ferry/long_jump: departing=[departing], destination=[destination], interim=[interim], travel_time=[travel_time]"
if(isnull(location))
return
if(!destination)
destination = get_location_area(!location)
if(!departing)
departing = get_location_area(location)
direction = !location
..(departing, destination, interim, travel_time, direction)
/datum/shuttle/ferry/move(var/area/origin,var/area/destination)
..(origin, destination)
if (destination == area_station) location = 0
if (destination == area_offsite) location = 1
//if this is a long_jump retain the location we were last at until we get to the new one
/datum/shuttle/ferry/dock()
..()
last_dock_attempt_time = world.time
/datum/shuttle/ferry/proc/get_location_area(location_id = null)
if (isnull(location_id))
location_id = location
if (!location_id)
return area_station
return area_offsite
/datum/shuttle/ferry/proc/process()
switch(process_state)
if (WAIT_LAUNCH)
if (skip_docking_checks() || docking_controller.can_launch())
//world << "shuttle/ferry/process: area_transition=[area_transition], travel_time=[travel_time]"
if (move_time && area_transition)
long_jump(interim=area_transition, travel_time=move_time, direction=transit_direction)
else
short_jump()
process_state = WAIT_ARRIVE
if (WAIT_ARRIVE)
if (moving_status == SHUTTLE_IDLE)
dock()
in_use = null //release lock
process_state = WAIT_FINISH
if (WAIT_FINISH)
if (skip_docking_checks() || docking_controller.docked() || world.time > last_dock_attempt_time + DOCK_ATTEMPT_TIMEOUT)
process_state = IDLE_STATE
arrived()
/datum/shuttle/ferry/current_dock_target()
var/dock_target
if (!location) //station
dock_target = dock_target_station
else
dock_target = dock_target_offsite
return dock_target
/datum/shuttle/ferry/proc/launch(var/user)
if (!can_launch()) return
in_use = user //obtain an exclusive lock on the shuttle
process_state = WAIT_LAUNCH
undock()
/datum/shuttle/ferry/proc/force_launch(var/user)
if (!can_force()) return
in_use = user //obtain an exclusive lock on the shuttle
if (move_time && area_transition)
long_jump(interim=area_transition, travel_time=move_time, direction=transit_direction)
else
short_jump()
process_state = WAIT_ARRIVE
/datum/shuttle/ferry/proc/cancel_launch(var/user)
if (!can_cancel()) return
moving_status = SHUTTLE_IDLE
process_state = WAIT_FINISH
in_use = null
if (docking_controller && !docking_controller.undocked())
docking_controller.force_undock()
spawn(10)
dock()
return
/datum/shuttle/ferry/proc/can_launch()
if (moving_status != SHUTTLE_IDLE)
return 0
if (in_use)
return 0
return 1
/datum/shuttle/ferry/proc/can_force()
if ((moving_status == SHUTTLE_IDLE) && process_state == WAIT_LAUNCH)
return 1
return 0
/datum/shuttle/ferry/proc/can_cancel()
if (moving_status == SHUTTLE_WARMUP || process_state == WAIT_LAUNCH)
return 1
return 0
//returns 1 if the shuttle is getting ready to move, but is not in transit yet
/datum/shuttle/ferry/proc/is_launching()
return (moving_status == SHUTTLE_WARMUP || process_state == WAIT_LAUNCH)
//This gets called when the shuttle finishes arriving at it's destination
//This can be used by subtypes to do things when the shuttle arrives.
/datum/shuttle/ferry/proc/arrived()
return //do nothing for now
-211
View File
@@ -1,211 +0,0 @@
/obj/machinery/computer/shuttle_control/specops
name = "special operations shuttle console"
shuttle_tag = "Special Operations"
icon_screen = "syndishuttle"
icon_keyboard = "syndie_key"
req_access = list(access_cent_specops)
/obj/machinery/computer/shuttle_control/specops/attack_ai(user as mob)
user << "\red Access Denied."
return 1
//for shuttles that may use a different docking port at each location
/datum/shuttle/ferry/multidock
var/docking_controller_tag_station
var/docking_controller_tag_offsite
var/datum/computer/file/embedded_program/docking/docking_controller_station
var/datum/computer/file/embedded_program/docking/docking_controller_offsite
/datum/shuttle/ferry/multidock/move(var/area/origin,var/area/destination)
..(origin, destination)
if (!location)
docking_controller = docking_controller_station
else
docking_controller = docking_controller_offsite
/datum/shuttle/ferry/multidock/specops
var/specops_return_delay = 6000 //After moving, the amount of time that must pass before the shuttle may move again
var/specops_countdown_time = 600 //Length of the countdown when moving the shuttle
var/obj/item/device/radio/intercom/announcer = null
var/reset_time = 0 //the world.time at which the shuttle will be ready to move again.
var/launch_prep = 0
var/cancel_countdown = 0
/datum/shuttle/ferry/multidock/specops/New()
..()
announcer = new /obj/item/device/radio/intercom(null)//We need a fake AI to announce some stuff below. Otherwise it will be wonky.
announcer.config(list("Response Team" = 0, "Special Ops" = 1))
/datum/shuttle/ferry/multidock/specops/proc/radio_announce(var/message, var/specOpsFreqOnly = 0)
if(announcer)
announcer.autosay(message, "A.L.I.C.E.", "Special Ops", list(1,2))
if(!specOpsFreqOnly)
announcer.autosay(message, "A.L.I.C.E.", "Response Team", list(1,2))
/datum/shuttle/ferry/multidock/specops/launch(var/user)
if (!can_launch())
return
if (istype(user, /obj/machinery/computer))
var/obj/machinery/computer/C = user
if(world.time <= reset_time)
C.visible_message("\blue Central Command will not allow the Special Operations shuttle to launch yet.")
if (((world.time - reset_time)/10) > 60)
C.visible_message("\blue [-((world.time - reset_time)/10)/60] minutes remain!")
else
C.visible_message("\blue [-(world.time - reset_time)/10] seconds remain!")
return
C.visible_message("\blue The Special Operations shuttle will depart in [(specops_countdown_time/10)] seconds.")
if (!location) //returning
radio_announce("THE SPECIAL OPERATIONS SHUTTLE IS PREPARING TO RETURN")
else
radio_announce("THE SPECIAL OPERATIONS SHUTTLE IS PREPARING FOR LAUNCH")
radio_announce("ARMORED SQUAD TAKE YOUR POSITION ON GRAVITY LAUNCH PAD", 1)
sleep_until_launch()
//launch
radio_announce("ALERT: INITIATING LAUNCH SEQUENCE")
..(user)
/datum/shuttle/ferry/multidock/specops/move(var/area/origin,var/area/destination)
..(origin, destination)
if (location) //just arrived home
for(var/turf/T in get_area_turfs(destination))
var/mob/M = locate(/mob) in T
M << "<span class='warning'>You have arrived at Central Command. Operation has ended!</span>"
else //just left for the station
launch_mauraders()
for(var/turf/T in get_area_turfs(destination))
var/mob/M = locate(/mob) in T
M << "<span class='warning'>You have arrived at [station_name]. Commence operation!</span>"
reset_time = world.time + specops_return_delay //set the timeout
/datum/shuttle/ferry/multidock/specops/cancel_launch()
if (!can_cancel())
return
cancel_countdown = 1
radio_announce("ALERT: LAUNCH SEQUENCE ABORTED")
if (istype(in_use, /obj/machinery/computer))
var/obj/machinery/computer/C = in_use
C.visible_message("<span class='warning'>Launch sequence aborted.</span>")
..()
/datum/shuttle/ferry/multidock/specops/can_launch()
if(launch_prep)
return 0
return ..()
//should be fine to allow forcing. process_state only becomes WAIT_LAUNCH after the countdown is over.
///datum/shuttle/ferry/multidock/specops/can_force()
// return 0
/datum/shuttle/ferry/multidock/specops/can_cancel()
if(launch_prep)
return 1
return ..()
/datum/shuttle/ferry/multidock/specops/proc/sleep_until_launch()
var/message_tracker[] = list(0,1,2,3,5,10,30,45)//Create a a list with potential time values.
var/launch_time = world.time + specops_countdown_time
var/time_until_launch
cancel_countdown = 0
launch_prep = 1
while(!cancel_countdown && (launch_time - world.time) > 0)
var/ticksleft = launch_time - world.time
//if(ticksleft > 1e5)
// launch_time = world.timeofday + 10 // midnight rollover
time_until_launch = (ticksleft / 10)
//All this does is announce the time before launch.
var/rounded_time_left = round(time_until_launch)//Round time so that it will report only once, not in fractions.
if(rounded_time_left in message_tracker)//If that time is in the list for message announce.
radio_announce("ALERT: [rounded_time_left] SECOND[(rounded_time_left!=1)?"S":""] REMAIN")
message_tracker -= rounded_time_left//Remove the number from the list so it won't be called again next cycle.
//Should call all the numbers but lag could mean some issues. Oh well. Not much I can do about that.
sleep(5)
launch_prep = 0
/proc/launch_mauraders()
var/area/centcom/specops/special_ops = locate()//Where is the specops area located?
//Begin Marauder launchpad.
spawn(0)//So it parallel processes it.
for(var/obj/machinery/door/poddoor/M in special_ops)
switch(M.id_tag)
if("ASSAULT0")
spawn(10)//1 second delay between each.
M.open()
if("ASSAULT1")
spawn(20)
M.open()
if("ASSAULT2")
spawn(30)
M.open()
if("ASSAULT3")
spawn(40)
M.open()
sleep(10)
var/spawn_marauder[] = new()
for(var/obj/effect/landmark/L in world)
if(L.name == "Marauder Entry")
spawn_marauder.Add(L)
for(var/obj/effect/landmark/L in world)
if(L.name == "Marauder Exit")
var/obj/effect/portal/P = new(L.loc)
P.invisibility = 101//So it is not seen by anyone.
P.failchance = 0//So it has no fail chance when teleporting.
P.target = pick(spawn_marauder)//Where the marauder will arrive.
spawn_marauder.Remove(P.target)
sleep(10)
for(var/obj/machinery/mass_driver/M in special_ops)
switch(M.id_tag)
if("ASSAULT0")
spawn(10)
M.drive()
if("ASSAULT1")
spawn(20)
M.drive()
if("ASSAULT2")
spawn(30)
M.drive()
if("ASSAULT3")
spawn(40)
M.drive()
sleep(50)//Doors remain open for 5 seconds.
for(var/obj/machinery/door/poddoor/M in special_ops)
switch(M.id_tag)//Doors close at the same time.
if("ASSAULT0")
spawn(0)
M.close()
if("ASSAULT1")
spawn(0)
M.close()
if("ASSAULT2")
spawn(0)
M.close()
if("ASSAULT3")
spawn(0)
M.close()
special_ops.readyreset()//Reset firealarm after the team launched.
//End Marauder launchpad.
-73
View File
@@ -1,73 +0,0 @@
/datum/shuttle/ferry/supply
var/away_location = 1 //the location to hide at while pretending to be in-transit
var/late_chance = 0
var/max_late_time = 300
/datum/shuttle/ferry/supply/short_jump(var/area/origin,var/area/destination)
if(moving_status != SHUTTLE_IDLE)
return
if(isnull(location))
return
if(!destination)
destination = get_location_area(!location)
if(!origin)
origin = get_location_area(location)
if (!at_station()) //at centcom
supply_controller.buy()
//it would be cool to play a sound here
moving_status = SHUTTLE_WARMUP
spawn(warmup_time*10)
if (moving_status == SHUTTLE_IDLE)
return //someone cancelled the launch
if (at_station() && forbidden_atoms_check())
//cancel the launch because of forbidden atoms. announce over supply channel?
moving_status = SHUTTLE_IDLE
return
//We pretend it's a long_jump by making the shuttle stay at centcom for the "in-transit" period.
var/area/away_area = get_location_area(away_location)
if (origin == away_area)
moving_status = SHUTTLE_INTRANSIT //pretend
else
move(origin, away_area)
//wait ETA here.
arrive_time = world.time + supply_controller.movetime
while (world.time <= arrive_time)
sleep(5)
if (destination != away_area)
//late
if (prob(late_chance))
sleep(rand(0,max_late_time))
move(away_area, destination)
moving_status = SHUTTLE_IDLE
if (!at_station()) //at centcom
supply_controller.sell()
// returns 1 if the supply shuttle should be prevented from moving because it contains forbidden atoms
/datum/shuttle/ferry/supply/proc/forbidden_atoms_check()
if (!at_station())
return 0 //if badmins want to send mobs or a nuke on the supply shuttle from centcom we don't care
return supply_controller.forbidden_atoms_check(get_location_area())
/datum/shuttle/ferry/supply/proc/at_station()
return (!location)
//returns 1 if the shuttle is idle and we can still mess with the cargo shopping list
/datum/shuttle/ferry/supply/proc/idle()
return (moving_status == SHUTTLE_IDLE)
//returns the ETA in minutes
/datum/shuttle/ferry/supply/proc/eta_minutes()
var/ticksleft = arrive_time - world.time
return round(ticksleft/600,1)
-209
View File
@@ -1,209 +0,0 @@
//This is a holder for things like the Vox and Nuke shuttle.
/datum/shuttle/multi_shuttle
var/cloaked = 1
var/can_cloak = 1
var/at_origin = 1
var/returned_home = 0
var/move_time = 240
var/cooldown = 20
var/last_move = 0 //the time at which we last moved
var/announcer
var/arrival_message
var/departure_message
var/area/interim
var/area/last_departed
var/list/destinations
var/area/origin
/datum/shuttle/multi_shuttle/New()
..()
if(origin)
last_departed = origin
/datum/shuttle/multi_shuttle/move(var/area/origin, var/area/destination)
..()
last_move = world.time
if (destination == src.origin)
returned_home = 1
/datum/shuttle/multi_shuttle/proc/announce_departure()
if(cloaked || isnull(departure_message))
return
command_announcement.Announce(departure_message,(announcer ? announcer : "Central Command"))
/datum/shuttle/multi_shuttle/proc/announce_arrival()
if(cloaked || isnull(arrival_message))
return
command_announcement.Announce(arrival_message,(announcer ? announcer : "Central Command"))
/obj/machinery/computer/shuttle_control/multi
icon_screen = "shuttle"
icon_keyboard = "med_key"
var/is_syndicate = 0
var/warn_on_return = 0
/obj/machinery/computer/shuttle_control/multi/New()
..()
if(is_syndicate)
icon_screen = "syndishuttle"
icon_keyboard = "syndie_key"
/obj/machinery/computer/shuttle_control/multi/attack_hand(user as mob)
if(..(user))
return 1
if(!allowed(user) && !isobserver(user))
user << "<span class='warning'>Access Denied.</span>"
return 1
ui_interact(user)
/obj/machinery/computer/shuttle_control/multi/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
var/data[0]
var/datum/shuttle/multi_shuttle/MS = shuttle_controller.shuttles[shuttle_tag]
if (!istype(MS))
return
var/shuttle_state
switch(MS.moving_status)
if(SHUTTLE_IDLE) shuttle_state = "idle"
if(SHUTTLE_WARMUP) shuttle_state = "warmup"
if(SHUTTLE_INTRANSIT) shuttle_state = "in_transit"
if(MS.moving_status == SHUTTLE_IDLE && (MS.last_move + MS.cooldown*10) > world.time)
shuttle_state = "charging"
var/shuttle_status
if (MS.moving_status != SHUTTLE_IDLE)
shuttle_status = "Proceeding to destination."
else if (MS.at_origin)
shuttle_status = "Standing-by at base."
else
var/area/areacheck = get_area(src)
shuttle_status = "Standing-by at [sanitize(areacheck.name)]."
data = list(
"shuttle_status" = shuttle_status,
"shuttle_state" = shuttle_state,
"can_launch" = can_launch(),
"can_return_to_base" = can_return_to_base(),
"can_cloak" = MS.can_cloak,
"cloaked" = MS.cloaked,
"is_syndicate" = is_syndicate
)
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "shuttle_control_multi_console.tmpl", "[shuttle_tag] Ship Control", 470, 310)
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1)
/obj/machinery/computer/shuttle_control/multi/proc/can_launch()
var/datum/shuttle/multi_shuttle/MS = shuttle_controller.shuttles[shuttle_tag]
if (!istype(MS))
return
if (MS.moving_status != SHUTTLE_IDLE)
return 0
if((MS.last_move + MS.cooldown * 10) > world.time)
return 0
return 1
/obj/machinery/computer/shuttle_control/multi/proc/can_return_to_base()
var/datum/shuttle/multi_shuttle/MS = shuttle_controller.shuttles[shuttle_tag]
if (!istype(MS))
return
if(MS.moving_status != SHUTTLE_IDLE)
return 0
if((MS.last_move + MS.cooldown * 10) > world.time)
return 0
if(MS.at_origin)
return 0
return 1
/obj/machinery/computer/shuttle_control/multi/proc/return_to_base()
var/datum/shuttle/multi_shuttle/MS = shuttle_controller.shuttles[shuttle_tag]
if (!istype(MS))
return
if(!can_return_to_base())
return
if(warn_on_return)
var/confirm = alert("Returning to your home base will end your mission. Are you sure you want to return to base?", "Confirm Return to Base", "Yes", "No")
if(confirm == "No")
return
MS.long_jump(MS.last_departed,MS.origin,MS.interim,MS.move_time)
MS.last_departed = MS.origin
MS.at_origin = 1
/obj/machinery/computer/shuttle_control/multi/proc/toggle_cloak()
var/datum/shuttle/multi_shuttle/MS = shuttle_controller.shuttles[shuttle_tag]
if (!istype(MS))
return
MS.cloaked = !MS.cloaked
/obj/machinery/computer/shuttle_control/multi/proc/launch_multi()
var/datum/shuttle/multi_shuttle/MS = shuttle_controller.shuttles[shuttle_tag]
if (!istype(MS))
return
if(MS.moving_status != SHUTTLE_IDLE)
return 0
if((MS.last_move + MS.cooldown * 10) > world.time)
return 0
var/choice = input("Select a destination.") as null|anything in MS.destinations
if(!choice)
return
if(MS.at_origin)
MS.announce_arrival()
MS.last_departed = MS.origin
MS.at_origin = 0
MS.long_jump(MS.last_departed, MS.destinations[choice], MS.interim, MS.move_time)
MS.last_departed = MS.destinations[choice]
return
else if(choice == MS.origin)
MS.announce_departure()
MS.short_jump(MS.last_departed, MS.destinations[choice])
MS.last_departed = MS.destinations[choice]
/obj/machinery/computer/shuttle_control/multi/Topic(href, href_list)
if(..())
return 1
if(!allowed(usr))
return 1
usr.set_machine(src)
src.add_fingerprint(usr)
var/datum/shuttle/multi_shuttle/MS = shuttle_controller.shuttles[shuttle_tag]
if(!istype(MS))
return
if(href_list["start"])
return_to_base()
if(href_list["toggle_cloak"])
toggle_cloak()
if(href_list["move_multi"])
launch_multi()
-23
View File
@@ -1,23 +0,0 @@
/obj/machinery/computer/shuttle_control/multi/whiteship
name = "medical ship control console"
req_access = list()
shuttle_tag = "White Ship"
circuit = /obj/item/weapon/circuitboard/white_ship
light_color = LIGHT_COLOR_DARKRED
/obj/machinery/computer/shuttle_control/multi/whiteship/attack_ai(user as mob)
user << "\red Access Denied."
return 1
/obj/machinery/computer/shuttle_control/multi/whiteship/New()
var/area/A = get_area(src)
if(!istype(A,/area/shuttle/derelict/ship))
visible_message("<span class='warning'>\The [src] displays a message: No connectible systems located. Shutting down.</span>")
var/V = text2path(circuit)
new V(loc)
animate(src, alpha = 10, time = 20)
spawn(20)
visible_message("<span class='danger'>\The [src] fades out of existence!</span>")
qdel(src)
..()
+8 -2
View File
@@ -131,7 +131,7 @@
/datum/storeitem/flag/diona
name = "Diona flag"
desc = "A flag proudly proclaiming the superior heritage of Diona."
desc = "A flag proudly proclaiming the superior heritage of Dionae."
typepath = /obj/item/flag/species/diona
cost = 1000
@@ -155,7 +155,7 @@
/datum/storeitem/flag/taj
name = "Tajaran flag"
desc = "A flag proudly proclaiming the superior heritage of Tajaran."
desc = "A flag proudly proclaiming the superior heritage of Tajara."
typepath = /obj/item/flag/species/taj
cost = 1000
@@ -165,6 +165,12 @@
typepath = /obj/item/flag/species/unathi
cost = 1000
/datum/storeitem/flag/vulp
name = "Vulpkanin flag"
desc = "A flag proudly proclaiming the superior heritage of Vulpkanin."
typepath = /obj/item/flag/species/vulp
cost = 1000
/datum/storeitem/flag/ian
name = "Ian flag"
desc = "The banner of Ian, because SQUEEEEE."
+2 -2
View File
@@ -31,7 +31,7 @@
if ("groin")
return "abdominal"
return ""
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, scraping around inside [target]'s [affected.name] with \the [tool]!", \
@@ -177,7 +177,7 @@
"\blue You take [obj] out of [target]'s [affected.name]s with \the [tool]." )
affected.implants -= obj
target.hud_updateflag |= 1 << IMPLOYAL_HUD
target.sec_hud_set_implants()
//Handle possessive brain borers.
if(istype(obj,/mob/living/simple_animal/borer))
+29 -15
View File
@@ -207,18 +207,20 @@
return 0
target.op_stage.current_organ = null
target.op_stage.organ_ref = null
var/list/attached_organs = list()
for(var/organ in target.internal_organs_by_name)
var/obj/item/organ/I = target.internal_organs_by_name[organ]
for(var/organ in affected.internal_organs)
var/obj/item/organ/I = organ
if(I && !(I.status & ORGAN_CUT_AWAY) && I.parent_organ == target_zone)
attached_organs |= organ
attached_organs[I.organ_tag] = I
var/organ_to_remove = input(user, "Which organ do you want to prepare for removal?") as null|anything in attached_organs
if(!organ_to_remove)
return 0
target.op_stage.current_organ = organ_to_remove
target.op_stage.organ_ref = attached_organs[organ_to_remove]
return ..() && organ_to_remove
@@ -235,7 +237,7 @@
user.visible_message("\blue [user] has separated [target]'s [target.op_stage.current_organ] with \the [tool]." , \
"\blue You have separated [target]'s [target.op_stage.current_organ] with \the [tool].")
var/obj/item/organ/I = target.internal_organs_by_name[target.op_stage.current_organ]
var/obj/item/organ/I = target.op_stage.organ_ref
if(I && istype(I))
spread_germs_to_organ(I, user)
I.status |= ORGAN_CUT_AWAY
@@ -261,20 +263,26 @@
if (!..())
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if(!istype(affected))
return 0
target.op_stage.current_organ = null
target.op_stage.organ_ref = null
var/list/removable_organs = list()
for(var/organ in target.internal_organs_by_name)
var/obj/item/organ/I = target.internal_organs_by_name[organ]
if((I.status & ORGAN_CUT_AWAY) && I.parent_organ == target_zone)
removable_organs |= organ
for(var/organ in affected.internal_organs)
var/obj/item/organ/I = organ
if(istype(I) && (I.status & ORGAN_CUT_AWAY) && I.parent_organ == target_zone)
removable_organs[I.organ_tag] = I
var/organ_to_remove = input(user, "Which organ do you want to remove?") as null|anything in removable_organs
if(!organ_to_remove)
return 0
target.op_stage.current_organ = organ_to_remove
target.op_stage.organ_ref = removable_organs[organ_to_remove]
return ..()
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
@@ -289,11 +297,10 @@
// Extract the organ!
if(target.op_stage.current_organ)
var/obj/item/organ/O = target.internal_organs_by_name[target.op_stage.current_organ]
var/obj/item/organ/O = target.op_stage.organ_ref
if(O && istype(O))
spread_germs_to_organ(O, user)
O.removed(user)
target.op_stage.current_organ = null
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -395,19 +402,26 @@
if (!..())
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if(!istype(affected))
return 0
target.op_stage.current_organ = null
target.op_stage.organ_ref = null
var/list/removable_organs = list()
for(var/organ in target.internal_organs_by_name)
var/obj/item/organ/I = target.internal_organs_by_name[organ]
if(I && (I.status & ORGAN_CUT_AWAY) && !(I.status & ORGAN_ROBOT) && I.parent_organ == target_zone)
removable_organs |= organ
for(var/organ in affected.internal_organs)
var/obj/item/organ/I = organ
if(I && istype(I) && (I.status & ORGAN_CUT_AWAY) && !(I.status & ORGAN_ROBOT) && I.parent_organ == target_zone)
removable_organs[I.organ_tag] = I
var/organ_to_replace = input(user, "Which organ do you want to reattach?") as null|anything in removable_organs
if(!organ_to_replace)
return 0
target.op_stage.current_organ = organ_to_replace
target.op_stage.organ_ref = removable_organs[organ_to_replace]
return ..()
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
@@ -420,7 +434,7 @@
user.visible_message("\blue [user] has reattached [target]'s [target.op_stage.current_organ] with \the [tool]." , \
"\blue You have reattached [target]'s [target.op_stage.current_organ] with \the [tool].")
var/obj/item/organ/I = target.internal_organs_by_name[target.op_stage.current_organ]
var/obj/item/organ/I = target.op_stage.organ_ref
if(I && istype(I))
I.status &= ~ORGAN_CUT_AWAY
spread_germs_to_organ(I, user)
+12 -8
View File
@@ -289,18 +289,20 @@
return 0
target.op_stage.current_organ = null
target.op_stage.organ_ref = null
var/list/attached_organs = list()
for(var/organ in target.internal_organs_by_name)
var/obj/item/organ/I = target.internal_organs_by_name[organ]
if(I && !(I.status & ORGAN_CUT_AWAY) && I.parent_organ == target_zone)
attached_organs |= organ
for(var/organ in affected.internal_organs)
var/obj/item/organ/I = organ
if(I && istype(I) && !(I.status & ORGAN_CUT_AWAY) && I.parent_organ == target_zone)
attached_organs[I.organ_tag] = I
var/organ_to_remove = input(user, "Which organ do you want to prepare for removal?") as null|anything in attached_organs
if(!organ_to_remove)
return 0
target.op_stage.current_organ = organ_to_remove
target.op_stage.organ_ref = attached_organs[organ_to_remove]
return ..() && organ_to_remove
@@ -338,18 +340,20 @@
return 0
target.op_stage.current_organ = null
target.op_stage.organ_ref = null
var/list/removable_organs = list()
for(var/organ in target.internal_organs_by_name)
var/obj/item/organ/I = target.internal_organs_by_name[organ]
if(I && (I.status & ORGAN_CUT_AWAY) && (I.status & ORGAN_ROBOT) && I.parent_organ == target_zone)
removable_organs |= organ
for(var/organ in affected.internal_organs)
var/obj/item/organ/I = organ
if(I && istype(I) && (I.status & ORGAN_CUT_AWAY) && (I.status & ORGAN_ROBOT) && I.parent_organ == target_zone)
removable_organs[I.organ_tag] = I
var/organ_to_replace = input(user, "Which organ do you want to reattach?") as null|anything in removable_organs
if(!organ_to_replace)
return 0
target.op_stage.current_organ = organ_to_replace
target.op_stage.organ_ref = removable_organs[organ_to_replace]
return ..()
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+1
View File
@@ -131,4 +131,5 @@
var/ribcage = 0
var/head_reattach = 0
var/current_organ = "organ"
var/obj/item/organ/organ_ref = null
var/list/in_progress = list()
-1
View File
@@ -110,7 +110,6 @@
for(var/datum/disease2/effectholder/e in effects)
e.effect.deactivate(mob)
mob.virus2.Remove("[uniqueID]")
mob.hud_updateflag |= 1 << STATUS_HUD
/datum/disease2/disease/proc/minormutate()
//uniqueID = rand(0,10000)
+3 -6
View File
@@ -3,11 +3,11 @@ proc/get_infection_chance(var/mob/living/carbon/M, var/vector = "Airborne")
var/score = 0
if (!istype(M))
return 0
var/mob/living/carbon/human/H = M
if(istype(H) && H.species.virus_immune)
return 0
return 0
if(istype(M, /mob/living/carbon/human))
if (vector == "Airborne")
if(M.internal) //not breathing infected air helps greatly
@@ -89,7 +89,6 @@ proc/airborne_can_reach(turf/source, turf/target, var/radius=5)
var/datum/disease2/disease/D = disease.getcopy()
D.minormutate()
M.virus2["[D.uniqueID]"] = D
M.hud_updateflag |= 1 << STATUS_HUD
//Infects mob M with random lesser disease, if he doesn't have one
/proc/infect_mob_random_lesser(var/mob/living/carbon/M)
@@ -97,14 +96,12 @@ proc/airborne_can_reach(turf/source, turf/target, var/radius=5)
D.makerandom()
D.infectionchance = 1
M.virus2["[D.uniqueID]"] = D
M.hud_updateflag |= 1 << STATUS_HUD
//Infects mob M with random greated disease, if he doesn't have one
/proc/infect_mob_random_greater(var/mob/living/carbon/M)
var/datum/disease2/disease/D = new /datum/disease2/disease
D.makerandom(1)
M.virus2["[D.uniqueID]"] = D
M.hud_updateflag |= 1 << STATUS_HUD
//Fancy prob() function.
/proc/dprob(var/p)