Merge remote-tracking branch 'upstream/master' into changeling

This commit is contained in:
DZD
2015-02-19 20:59:41 -05:00
606 changed files with 8621 additions and 6628 deletions
+4 -6
View File
@@ -9,8 +9,6 @@
set_temperature = 20 // in celcius, add T0C for kelvin
var/cooling_power = 40000
flags = FPRINT
/obj/machinery/space_heater/air_conditioner/New()
..()
@@ -96,11 +94,11 @@
// AUTOFIXED BY fix_string_idiocy.py
// C:\Users\Rob\Documents\Projects\vgstation13\code\ATMOSPHERICS\chiller.dm:95: dat += "Power Level: [cell ? round(cell.percent(),1) : 0]%<BR><BR>"
dat += {"Power Level: [cell ? round(cell.percent(),1) : 0]%<BR><BR>
Set Temperature:
<A href='?src=\ref[src];op=temp;val=-5'>-</A>
Set Temperature:
<A href='?src=\ref[src];op=temp;val=-5'>-</A>
<A href='?src=\ref[src];op=temp;val=-1'>-</A>
[temp]&deg;C
<A href='?src=\ref[src];op=temp;val=1'>+</A>
[temp]&deg;C
<A href='?src=\ref[src];op=temp;val=1'>+</A>
<A href='?src=\ref[src];op=temp;val=5'>+</A><BR>"}
// END AUTOFIX
user.set_machine(src)
+1 -1
View File
@@ -253,7 +253,7 @@ zone/proc/movables()
continue
. += A
//ULTRALIGHT - only file where this is still used, hence why it's in here
//ULTRALIGHT - only file where this is still used, hence why it's in here
#define UL_I_FALLOFF_SQUARE 0
#define UL_I_FALLOFF_ROUND 1
#define ul_FalloffStyle UL_I_FALLOFF_ROUND // Sets the lighting falloff to be either squared or circular.
+10
View File
@@ -30,6 +30,16 @@ atom/proc/CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0)
return 1
//Convenience function for atoms to update turfs they occupy
/atom/movable/proc/update_nearby_tiles(need_rebuild)
if(!air_master)
return 0
for(var/turf/simulated/turf in locs)
air_master.mark_for_update(turf)
return 1
//Basically another way of calling CanPass(null, other, 0, 0) and CanPass(null, other, 1.5, 1).
//Returns:
// 0 - Not blocked
+3 -2
View File
@@ -313,7 +313,8 @@ proc/isInSight(var/atom/A, var/atom/B)
return M
return null
/proc/get_candidates(be_special_flag=0, afk_bracket=3000, jobban=0, department_jobban=0, override_age=0)
/proc/get_candidates(be_special_flag=0, afk_bracket=3000, override_age=0, override_jobban=0)
var/roletext = get_roletext(be_special_flag)
var/list/candidates = list()
// Keep looping until we find a non-afk candidate within the time bracket (we limit the bracket to 10 minutes (6000))
while(!candidates.len && afk_bracket < 6000)
@@ -321,7 +322,7 @@ proc/isInSight(var/atom/A, var/atom/B)
if(G.client != null)
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
if(!G.client.is_afk(afk_bracket) && (G.client.prefs.be_special & be_special_flag))
if(!jobban && !department_jobban || !jobban_isbanned(G, jobban) && !jobban_isbanned(G,department_jobban))
if(!override_jobban || (!jobban_isbanned(G, roletext) && !jobban_isbanned(G,"Syndicate")))
if(override_age || player_old_enough_antag(G.client,be_special_flag))
candidates += G.client
afk_bracket += 600 // Add a minute to the bracket, for every attempt
+1 -1
View File
@@ -44,7 +44,7 @@ var/global/list/facial_hair_styles_male_list = list()
var/global/list/facial_hair_styles_female_list = list()
var/global/list/skin_styles_female_list = list() //unused
//Underwear
var/global/list/underwear_m = list("White", "Grey", "Green", "Blue", "Black", "Mankini", "None")
var/global/list/underwear_m = list("White", "Grey", "Green", "Blue", "Black", "Mankini", "None")
var/global/list/underwear_f = list("Red", "White", "Yellow", "Blue", "Black", "Thong", "None")
var/global/list/underwear_list = underwear_m + underwear_f
//undershirt
+187 -1
View File
@@ -396,4 +396,190 @@ proc/listclearnulls(list/list)
/proc/find_record(field, value, list/L)
for(var/datum/data/record/R in L)
if(R.fields[field] == value)
return R
return R
/proc/dd_sortedObjectList(var/list/L, var/cache=list())
if(L.len < 2)
return L
var/middle = L.len / 2 + 1 // Copy is first,second-1
return dd_mergeObjectList(dd_sortedObjectList(L.Copy(0,middle), cache), dd_sortedObjectList(L.Copy(middle), cache), cache) //second parameter null = to end of list
/proc/dd_mergeObjectList(var/list/L, var/list/R, var/list/cache)
var/Li=1
var/Ri=1
var/list/result = new()
while(Li <= L.len && Ri <= R.len)
var/LLi = L[Li]
var/RRi = R[Ri]
var/LLiV = cache[LLi]
var/RRiV = cache[RRi]
if(!LLiV)
LLiV = LLi:dd_SortValue()
cache[LLi] = LLiV
if(!RRiV)
RRiV = RRi:dd_SortValue()
cache[RRi] = RRiV
if(LLiV < RRiV)
result += L[Li++]
else
result += R[Ri++]
if(Li <= L.len)
return (result + L.Copy(Li, 0))
return (result + R.Copy(Ri, 0))
// Insert an object into a sorted list, preserving sortedness
/proc/dd_insertObjectList(var/list/L, var/O)
var/min = 1
var/max = L.len
var/Oval = O:dd_SortValue()
while(1)
var/mid = min+round((max-min)/2)
if(mid == max)
L.Insert(mid, O)
return
var/Lmid = L[mid]
var/midval = Lmid:dd_SortValue()
if(Oval == midval)
L.Insert(mid, O)
return
else if(Oval < midval)
max = mid
else
min = mid+1
/*
proc/dd_sortedObjectList(list/incoming)
/*
Use binary search to order by dd_SortValue().
This works by going to the half-point of the list, seeing if the node in
question is higher or lower cost, then going halfway up or down the list
and checking again. This is a very fast way to sort an item into a list.
*/
var/list/sorted_list = new()
var/low_index
var/high_index
var/insert_index
var/midway_calc
var/current_index
var/current_item
var/current_item_value
var/current_sort_object_value
var/list/list_bottom
var/current_sort_object
for (current_sort_object in incoming)
low_index = 1
high_index = sorted_list.len
while (low_index <= high_index)
// Figure out the midpoint, rounding up for fractions. (BYOND rounds down, so add 1 if necessary.)
midway_calc = (low_index + high_index) / 2
current_index = round(midway_calc)
if (midway_calc > current_index)
current_index++
current_item = sorted_list[current_index]
current_item_value = current_item:dd_SortValue()
current_sort_object_value = current_sort_object:dd_SortValue()
if (current_sort_object_value < current_item_value)
high_index = current_index - 1
else if (current_sort_object_value > current_item_value)
low_index = current_index + 1
else
// current_sort_object == current_item
low_index = current_index
break
// Insert before low_index.
insert_index = low_index
// Special case adding to end of list.
if (insert_index > sorted_list.len)
sorted_list += current_sort_object
continue
// Because BYOND lists don't support insert, have to do it by:
// 1) taking out bottom of list, 2) adding item, 3) putting back bottom of list.
list_bottom = sorted_list.Copy(insert_index)
sorted_list.Cut(insert_index)
sorted_list += current_sort_object
sorted_list += list_bottom
return sorted_list
*/
proc/dd_sortedtextlist(list/incoming, case_sensitive = 0)
// Returns a new list with the text values sorted.
// Use binary search to order by sortValue.
// This works by going to the half-point of the list, seeing if the node in question is higher or lower cost,
// then going halfway up or down the list and checking again.
// This is a very fast way to sort an item into a list.
var/list/sorted_text = new()
var/low_index
var/high_index
var/insert_index
var/midway_calc
var/current_index
var/current_item
var/list/list_bottom
var/sort_result
var/current_sort_text
for (current_sort_text in incoming)
low_index = 1
high_index = sorted_text.len
while (low_index <= high_index)
// Figure out the midpoint, rounding up for fractions. (BYOND rounds down, so add 1 if necessary.)
midway_calc = (low_index + high_index) / 2
current_index = round(midway_calc)
if (midway_calc > current_index)
current_index++
current_item = sorted_text[current_index]
if (case_sensitive)
sort_result = sorttextEx(current_sort_text, current_item)
else
sort_result = sorttext(current_sort_text, current_item)
switch(sort_result)
if (1)
high_index = current_index - 1 // current_sort_text < current_item
if (-1)
low_index = current_index + 1 // current_sort_text > current_item
if (0)
low_index = current_index // current_sort_text == current_item
break
// Insert before low_index.
insert_index = low_index
// Special case adding to end of list.
if (insert_index > sorted_text.len)
sorted_text += current_sort_text
continue
// Because BYOND lists don't support insert, have to do it by:
// 1) taking out bottom of list, 2) adding item, 3) putting back bottom of list.
list_bottom = sorted_text.Copy(insert_index)
sorted_text.Cut(insert_index)
sorted_text += current_sort_text
sorted_text += list_bottom
return sorted_text
proc/dd_sortedTextList(list/incoming)
var/case_sensitive = 1
return dd_sortedtextlist(incoming, case_sensitive)
datum/proc/dd_SortValue()
return "[src]"
/obj/machinery/dd_SortValue()
return "[sanitize(name)]"
/obj/machinery/camera/dd_SortValue()
return "[c_tag]"
+32 -2
View File
@@ -82,7 +82,7 @@
// Used to get a sanitized input.
/proc/stripped_input(var/mob/user, var/message = "", var/title = "", var/default = "", var/max_length=MAX_MESSAGE_LEN)
var/name = input(user, message, title, default)
return strip_html_simple(name, max_length)
return strip_html_properly(name, max_length)
//Filters out undesirable characters from names
/proc/reject_bad_name(var/t_in, var/allow_numbers=0, var/max_length=MAX_NAME_LEN)
@@ -311,4 +311,34 @@ proc/checkhtml(var/t)
var/new_text = ""
for(var/i = length(text); i > 0; i--)
new_text += copytext(text, i, i+1)
return new_text
return new_text
//This proc strips html properly, but it's not lazy like the other procs.
//This means that it doesn't just remove < and > and call it a day.
//Also limit the size of the input, if specified.
/proc/strip_html_properly(var/input, var/max_length = MAX_MESSAGE_LEN)
if(!input)
return
var/opentag = 1 //These store the position of < and > respectively.
var/closetag = 1
while(1)
opentag = findtext(input, "<")
closetag = findtext(input, ">")
if(closetag && opentag)
if(closetag < opentag)
input = copytext(input, (closetag + 1))
else
input = copytext(input, 1, opentag) + copytext(input, (closetag + 1))
else if(closetag || opentag)
if(opentag)
input = copytext(input, 1, opentag)
else
input = copytext(input, (closetag + 1))
else
break
if(max_length)
input = copytext(input,1,max_length)
return sanitize(input)
/proc/trim_strip_html_properly(var/input, var/max_length = MAX_MESSAGE_LEN)
return trim(strip_html_properly(input, max_length))
+2 -1
View File
@@ -227,7 +227,7 @@ proc/tg_text2list(text, glue=",", assocglue=";")
. += copytext(text, last_found, found)
last_found = found + delim_len
while(found)
/proc/text2numlist(text, delimiter="\n")
var/list/num_list = list()
for(var/x in text2list(text, delimiter))
@@ -347,6 +347,7 @@ proc/tg_text2list(text, glue=",", assocglue=";")
if(rights & R_SOUNDS) . += "[seperator]+SOUND"
if(rights & R_SPAWN) . += "[seperator]+SPAWN"
if(rights & R_MOD) . += "[seperator]+MODERATOR"
if(rights & R_MENTOR) . += "[seperator]+MENTOR"
return .
/proc/ui_style2icon(ui_style)
+1 -7
View File
@@ -411,13 +411,7 @@ Turf and target are seperate in case you want to teleport some distance from a t
//world << "<b>[newname] is the AI!</b>"
//world << sound('sound/AI/newAI.ogg')
// Set eyeobj name
if(A.eyeobj)
A.eyeobj.name = "[newname] (AI Eye)"
// Set ai pda name
if(A.aiPDA)
A.aiPDA.owner = newname
A.aiPDA.name = newname + " (" + A.aiPDA.ownjob + ")"
A.SetName(newname)
fully_replace_character_name(oldname,newname)
-2
View File
@@ -65,8 +65,6 @@
if(stat || paralysis || stunned || weakened)
return
face_atom(A) // change direction to face what you clicked on
if(next_move > world.time) // in the year 2000...
return
+1 -2
View File
@@ -503,8 +503,7 @@
if("Crew Monitoring")
if(isAI(usr))
var/mob/living/silicon/ai/AI = usr
var/obj/machinery/computer/crew/C = locate(/obj/machinery/computer/crew)
C.attack_ai(AI)
AI.nano_crew_monitor()
if("Show Crew Manifest")
if(isAI(usr))
+1 -1
View File
@@ -66,7 +66,7 @@
/obj/machinery/teleport/hub/attack_ghost(mob/user as mob)
var/atom/l = loc
var/obj/machinery/computer/teleporter/com = locate(/obj/machinery/computer/teleporter, locate(l.x - 2, l.y, l.z))
if(com.locked)
if(com && com.locked)
user.loc = get_turf(com.locked)
/obj/effect/portal/attack_ghost(mob/user as mob)
+7 -2
View File
@@ -17,10 +17,13 @@
/atom/proc/attack_hand(mob/user as mob)
return
/mob/living/carbon/human/RestrainedClickOn(var/atom/A)
/*
/mob/living/carbon/human/RestrainedClickOn(var/atom/A) -- Handled by carbons
return
*/
/mob/living/carbon/RestrainedClickOn(var/atom/A)
return 0
// Commented out to prevent overwriting RangedAttack in click.dm ~ Bone White
/*
@@ -72,6 +75,8 @@
things considerably
*/
/mob/living/carbon/monkey/RestrainedClickOn(var/atom/A)
if(..())
return
if(a_intent != "harm" || !ismob(A)) return
if(istype(wear_mask, /obj/item/clothing/mask/muzzle))
return
+1 -1
View File
@@ -65,7 +65,7 @@ var/const/tk_maxrange = 15
desc = "Magic"
icon = 'icons/obj/magic.dmi'//Needs sprites
icon_state = "2"
flags = NOBLUDGEON
flags = NOBLUDGEON | ABSTRACT
//item_state = null
w_class = 10.0
layer = 20
+1 -1
View File
@@ -94,7 +94,7 @@ datum/light_source
if(owner.loc && owner.luminosity > 0)
readrgb(owner.l_color)
effect = list()
for(var/turf/T in view(owner.get_light_range(),owner))
for(var/turf/T in view(owner.get_light_range(),get_turf(owner)))
var/delta_lumen = lum(T)
if(delta_lumen > 0)
effect[T] = delta_lumen
+17
View File
@@ -135,6 +135,11 @@
var/default_laws = 0 //Controls what laws the AI spawns with.
var/list/station_levels = list(1) // Defines which Z-levels the station exists on.
var/list/admin_levels= list(2) // Defines which Z-levels which are for admin functionality, for example including such areas as Central Command and the Syndicate Shuttle
var/list/contact_levels = list(1, 5) // Defines which Z-levels which, for example, a Code Red announcement may affect
var/list/player_levels = list(1, 3, 4, 5, 6) // Defines all Z-levels a character can typically reach
var/const/minutes_to_ticks = 60 * 10
// Event settings
var/expected_round_length = 60 * 2 * minutes_to_ticks // 2 hours
@@ -458,6 +463,18 @@
if("max_maint_drones")
config.max_maint_drones = text2num(value)
if("station_levels")
config.station_levels = text2numlist(value, ";")
if("admin_levels")
config.admin_levels = text2numlist(value, ";")
if("contact_levels")
config.contact_levels = text2numlist(value, ";")
if("player_levels")
config.player_levels = text2numlist(value, ";")
if("expected_round_length")
config.expected_round_length = MinutesToTicks(text2num(value))
@@ -18,7 +18,10 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle
var/deny_shuttle = 0 //allows admins to prevent the shuttle from being called
var/departed = 0 //if the shuttle has left the station at least once
var/datum/announcement/priority/emergency_shuttle_docked = new(0, new_sound = sound('sound/AI/shuttledock.ogg'))
var/datum/announcement/priority/emergency_shuttle_called = new(0, new_sound = sound('sound/AI/shuttlecalled.ogg'))
var/datum/announcement/priority/emergency_shuttle_recalled = new(0, new_sound = sound('sound/AI/shuttlerecalled.ogg'))
/datum/emergency_shuttle_controller/proc/process()
if (wait_for_launch)
@@ -29,7 +32,7 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle
if (!shuttle.location) //leaving from the station
if(is_stranded())
captain_announce("Hostile environment detected. Departure has been postponed indefinitely pending conflict resolution.")
priority_announcement.Announce("Hostile environment detected. Departure has been postponed indefinitely pending conflict resolution.")
wait_for_launch = 0
return
//launch the pods!
@@ -49,10 +52,9 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle
set_launch_countdown(SHUTTLE_LEAVETIME) //get ready to return
if (evac)
captain_announce("The Emergency Shuttle has docked with the station. You have approximately [round(estimate_launch_time()/60,1)] minutes to board the Emergency Shuttle.")
world << sound('sound/AI/shuttledock.ogg')
emergency_shuttle_docked.Announce("The Emergency Shuttle has docked with the station. You have approximately [round(estimate_launch_time()/60,1)] minutes to board the Emergency Shuttle.")
else
captain_announce("The scheduled Crew Transfer Shuttle has docked with the station. It will depart in approximately [round(emergency_shuttle.estimate_launch_time()/60,1)] minutes.")
priority_announcement.Announce("The scheduled Crew Transfer Shuttle has docked with the station. It will depart in approximately [round(emergency_shuttle.estimate_launch_time()/60,1)] minutes.")
//arm the escape pods
if (evac)
@@ -81,8 +83,7 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle
shuttle.move_time = SHUTTLE_TRANSIT_DURATION
evac = 1
captain_announce("An emergency evacuation shuttle has been called. It will arrive in approximately [round(estimate_arrival_time()/60)] minutes.")
world << sound('sound/AI/shuttlecalled.ogg')
emergency_shuttle_called.Announce("An emergency evacuation shuttle has been called. It will arrive in approximately [round(estimate_arrival_time()/60)] minutes.")
for(var/area/A in world)
if(istype(A, /area/hallway))
A.readyalert()
@@ -101,7 +102,7 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle
//reset the shuttle transit time if we need to
shuttle.move_time = SHUTTLE_TRANSIT_DURATION
captain_announce("A crew transfer has been scheduled. The shuttle has been called. It will arrive in approximately [round(estimate_arrival_time()/60)] minutes.")
priority_announcement.Announce("A crew transfer has been scheduled. The shuttle has been called. It will arrive in approximately [round(estimate_arrival_time()/60)] minutes.")
//recalls the shuttle
/datum/emergency_shuttle_controller/proc/recall()
@@ -111,15 +112,14 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle
shuttle.cancel_launch(src)
if (evac)
captain_announce("The emergency shuttle has been recalled.")
world << sound('sound/AI/shuttlerecalled.ogg')
emergency_shuttle_recalled.Announce("The emergency shuttle has been recalled.")
for(var/area/A in world)
if(istype(A, /area/hallway))
A.readyreset()
evac = 0
else
captain_announce("The scheduled crew transfer has been cancelled.")
priority_announcement.Announce("The scheduled crew transfer has been cancelled.")
/datum/emergency_shuttle_controller/proc/can_call()
if (deny_shuttle)
+5
View File
@@ -179,6 +179,11 @@ datum/ai_laws/tyrant //This probably shouldn't be a default lawset.
/datum/ai_laws/proc/clear_ion_laws()
src.ion = list()
/datum/ai_laws/proc/clear_zeroth_law(var/law_borg = null)
src.zeroth = null
if(law_borg)
src.zeroth_borg = null
/datum/ai_laws/proc/show_laws(var/who)
+1 -1
View File
@@ -238,7 +238,7 @@
/obj/item/clothing/mask/facehugger) // NOT CLOTHING AT ALLLLL
whitelist = list(/obj/item/clothing,/obj/item/weapon/storage/belt,/obj/item/weapon/storage/backpack,
/obj/item/device/radio/headset,/obj/item/device/pda,/obj/item/weapon/card/id,/obj/item/weapon/tank,
/obj/item/weapon/handcuffs, /obj/item/weapon/legcuffs)
/obj/item/weapon/restraints/handcuffs, /obj/item/weapon/restraints/legcuffs)
/datum/cargoprofile/trash
name = "Trash"
+1 -1
View File
@@ -35,7 +35,7 @@
/datum/crafting_recipe/table/stunprod
name = "Stunprod"
result_path = /obj/item/weapon/melee/baton/cattleprod
reqs = list(/obj/item/weapon/handcuffs/cable = 1,
reqs = list(/obj/item/weapon/restraints/handcuffs/cable = 1,
/obj/item/stack/rods = 1,
/obj/item/weapon/wirecutters = 1,
/obj/item/weapon/stock_parts/cell = 1)
+2 -2
View File
@@ -190,7 +190,7 @@
teleatom.visible_message("\red <B>The [teleatom] bounces off of the portal!</B>")
return 0
if(destination.z == 2) //centcomm z-level
if((destination.z in config.admin_levels)) //centcomm z-level
if(istype(teleatom, /obj/mecha))
var/obj/mecha/MM = teleatom
MM.occupant << "\red <B>The mech would not survive the jump to a location so far away!</B>"
@@ -200,6 +200,6 @@
return 0
if(destination.z > 7) //Away mission z-levels
if(!(destination.z in config.player_levels)) //Away mission z-levels
return 0
return 1
+1 -1
View File
@@ -1082,7 +1082,7 @@ datum/mind
switch(href_list["common"])
if("undress")
for(var/obj/item/W in current)
current.drop_from_inventory(W)
current.unEquip(W, 1)
if("takeuplink")
take_uplink()
memory = null//Remove any memory they may have had.
+7 -6
View File
@@ -8,6 +8,7 @@
author = "Nanotrasen Editor"
channel_name = "Tau Ceti Daily"
can_be_redacted = 0
message_type = "Story"
revolution_inciting_event
@@ -129,12 +130,6 @@ proc/check_for_newscaster_updates(type)
proc/announce_newscaster_news(datum/news_announcement/news)
var/datum/feed_message/newMsg = new /datum/feed_message
newMsg.author = news.author
newMsg.is_admin_message = !news.can_be_redacted
newMsg.body = news.message
var/datum/feed_channel/sendto
for(var/datum/feed_channel/FC in news_network.network_channels)
if(FC.channel_name == news.channel_name)
@@ -148,6 +143,12 @@ proc/announce_newscaster_news(datum/news_announcement/news)
sendto.locked = 1
sendto.is_admin_channel = 1
news_network.network_channels += sendto
var/datum/feed_message/newMsg = new /datum/feed_message
newMsg.author = news.author ? news.author : sendto.author
newMsg.is_admin_message = !news.can_be_redacted
newMsg.body = news.message
newMsg.message_type = news.message_type
sendto.messages += newMsg
+1 -1
View File
@@ -60,7 +60,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
caster.reset_view(0)
return 0
if(user.z == 2 && !centcom_cancast) //Certain spells are not allowed on the centcom zlevel
if((user.z in config.admin_levels) && !centcom_cancast) //Certain spells are not allowed on the centcom zlevel
return 0
if(!skipcharge)
+3 -2
View File
@@ -35,12 +35,13 @@
return
var/obj/item/clothing/mask/horsehead/magichead = new /obj/item/clothing/mask/horsehead
magichead.canremove = 0 //curses!
magichead.flags |= NODROP //curses!
magichead.flags_inv = null //so you can still see their face
magichead.voicechange = 1 //NEEEEIIGHH
target.visible_message( "<span class='danger'>[target]'s face lights up in fire, and after the event a horse's head takes its place!</span>", \
"<span class='danger'>Your face burns up, and shortly after the fire you realise you have the face of a horse!</span>")
target.drop_from_inventory(target.wear_mask)
if(!target.unEquip(target.wear_mask))
del target.wear_mask
target.equip_to_slot_if_possible(magichead, slot_wear_mask, 1, 1)
flick("e_flash", target.flash)
+1 -1
View File
@@ -59,7 +59,7 @@
item_to_retrive = null
break
M.u_equip(item_to_retrive)
M.unEquip(item_to_retrive)
if(ishuman(M)) //Edge case housekeeping
var/mob/living/carbon/human/C = M
+6 -51
View File
@@ -16,7 +16,7 @@
rate = -rate
solar_next_update = world.time // init the timer
angle = rand (0,360) // the station position to the sun is randomised at round start
/hook/startup/proc/createSun()
sun = new /datum/sun()
return 1
@@ -50,54 +50,9 @@
dx = s/abs(s)
dy = c / abs(s)
for(var/obj/machinery/power/M in solars_list)
if(!M.powernet)
solars_list.Remove(M)
//now tell the solar control computers to update their status and linked devices
for(var/obj/machinery/power/solar_control/SC in solars_list)
if(!SC.powernet)
solars_list.Remove(SC)
continue
// Solar Tracker
if(istype(M, /obj/machinery/power/tracker))
var/obj/machinery/power/tracker/T = M
T.set_angle(angle)
// Solar Control
else if(istype(M, /obj/machinery/power/solar_control))
var/obj/machinery/power/solar_control/C = M
if(C.track == 1) //if manual tracking...
C.tracker_update() //...update the position (not passing an angle, it is handled internally for manual tracking)
// Solar Panel
else if(istype(M, /obj/machinery/power/solar))
var/obj/machinery/power/solar/S = M
if(S.control)
occlusion(S)
// for a solar panel, trace towards sun to see if we're in shadow
/datum/sun/proc/occlusion(var/obj/machinery/power/solar/S)
var/ax = S.x // start at the solar panel
var/ay = S.y
var/turf/T = null
for(var/i = 1 to 20) // 20 steps is enough
ax += dx // do step
ay += dy
T = locate( round(ax,0.5),round(ay,0.5),S.z)
if(T.x == 1 || T.x==world.maxx || T.y==1 || T.y==world.maxy) // not obscured if we reach the edge
break
if(T.density) // if we hit a solid turf, panel is obscured
S.obscured = 1
return
S.obscured = 0 // if hit the edge or stepped 20 times, not obscured
S.update_solar_exposure()
SC.update()
Executable → Regular
+1296 -1204
View File
File diff suppressed because it is too large Load Diff
-179
View File
@@ -1,179 +0,0 @@
#define UPDATE_BUFFER 25 // 2.5 seconds
// CAMERA CHUNK
//
// A 16x16 grid of the map with a list of turfs that can be seen, are visible and are dimmed.
// Allows the mob using this chunk to stream these chunks and know what it can and cannot see.
/datum/visibility_chunk
var/obscured_image = 'icons/effects/cameravis.dmi'
var/obscured_sub = "black"
var/list/obscuredTurfs = list()
var/list/visibleTurfs = list()
var/list/obscured = list()
var/list/viewpoints = list()
var/list/turfs = list()
var/list/seenby = list()
var/visible = 0
var/changed = 0
var/updating = 0
var/x = 0
var/y = 0
var/z = 0
/datum/visibility_chunk/proc/add(mob/new_mob)
// if this thing doesn't use one of these visibility systems, kick it out
if (!new_mob.visibility_interface)
return
// if the mob being added isn't a valid form of that mob, kick it out
if (!new_mob.visibility_interface:canBeAddedToChunk(src))
return
// add this chunk to the list of visible chunks
new_mob.visibility_interface:addChunk(src)
visible++
seenby += new_mob
if(changed && !updating)
update()
/datum/visibility_chunk/proc/remove(mob/new_mob)
// if this thing doesn't use one of these visibility systems, kick it out
if (!new_mob.visibility_interface)
return
// if the mob being added isn't a valid form of that mob, kick it out
if (!new_mob.visibility_interface:canBeAddedToChunk(src))
return
// remove the chunk
new_mob.visibility_interface:removeChunk(src)
// remove the mob from out lists
seenby -= new_mob
if(visible > 0)
visible--
/datum/visibility_chunk/proc/visibilityChanged(turf/loc)
if(!visibleTurfs[loc])
return
hasChanged()
/datum/visibility_chunk/proc/hasChanged(var/update_now = 0)
if(visible || update_now)
if(!updating)
updating = 1
spawn(UPDATE_BUFFER) // Batch large changes, such as many doors opening or closing at once
update()
updating = 0
else
changed = 1
/*
This function needs to be overwritten to return True if the viewpoint object is valid, and false if it is not.
*/
/datum/visibility_chunk/proc/validViewpoint(var/viewpoint)
return FALSE
/*
This function needs to be overwritten to return a list of visible turfs for that viewpoint
*/
/datum/visibility_chunk/proc/getVisibleTurfsForViewpoint(var/viewpoint)
return list()
// returns a list of turfs which can be seen in by the chunks viewpoints
/datum/visibility_chunk/proc/getVisibleTurfs()
var/list/newVisibleTurfs = list()
for(var/viewpoint in viewpoints)
if (validViewpoint(viewpoint))
for (var/turf/t in getVisibleTurfsForViewpoint(viewpoint))
newVisibleTurfs[t]=t
return newVisibleTurfs
/*
This function needs to be overwritten to find nearby viewpoint objects to the chunk center.
*/
/datum/visibility_chunk/proc/findNearbyViewpoints()
return FALSE
/*
This function can be overwritten to change or randomize the obscuring images
*/
/datum/visibility_chunk/proc/setObscuredImage(var/turf/target_turf)
if(!target_turf.obscured)
target_turf.obscured = image(obscured_image, target_turf, obscured_sub, 15)
/datum/visibility_chunk/proc/update()
set background = 1
// get a list of all the turfs that our viewpoints can see
var/list/newVisibleTurfs = getVisibleTurfs()
// Removes turf that isn't in turfs.
newVisibleTurfs &= turfs
var/list/visAdded = newVisibleTurfs - visibleTurfs
var/list/visRemoved = visibleTurfs - newVisibleTurfs
visibleTurfs = newVisibleTurfs
obscuredTurfs = turfs - newVisibleTurfs
// update the visibility overlays
for(var/turf in visAdded)
var/turf/t = turf
if(t.obscured)
obscured -= t.obscured
for(var/mob/current_mob in seenby)
if (current_mob.visibility_interface)
current_mob.visibility_interface:removeObscuredTurf(t)
for(var/turf in visRemoved)
var/turf/t = turf
if(obscuredTurfs[t])
setObscuredImage(t)
obscured += t.obscured
for(var/mob/current_mob in seenby)
if (current_mob.visibility_interface)
current_mob.visibility_interface:addObscuredTurf(t)
else
seenby -= current_mob
// Create a new chunk, since the chunks are made as they are needed.
/datum/visibility_chunk/New(loc, x, y, z)
// 0xf = 15
x &= ~0xf
y &= ~0xf
src.x = x
src.y = y
src.z = z
for(var/turf/t in range(10, locate(x + 8, y + 8, z)))
if(t.x >= x && t.y >= y && t.x < x + 16 && t.y < y + 16)
turfs[t] = t
// locate all nearby viewpoints
findNearbyViewpoints()
// get the turfs that are visible to those viewpoints
visibleTurfs = getVisibleTurfs()
// Removes turf that isn't in turfs.
visibleTurfs &= turfs
// create the list of turfs we can't see
obscuredTurfs = turfs - visibleTurfs
// create the list of obscuring images to add to viewing clients
for(var/turf in obscuredTurfs)
var/turf/t = turf
setObscuredImage(t)
obscured += t.obscured
#undef UPDATE_BUFFER
@@ -1,11 +0,0 @@
var/datum/visibility_network/cameras/cameranet = new()
var/datum/visibility_network/cult/cultNetwork = new()
var/datum/visibility_network/list/visibility_networks = list("ALL_CAMERAS"=cameranet, "CULT" = cultNetwork)
// used by turfs and objects to update all visibility networks
/proc/updateVisibilityNetworks(atom/A, var/opacity_check = 1)
var/datum/visibility_network/currentNetwork
for (var/networkName in visibility_networks)
currentNetwork = visibility_networks[networkName]
currentNetwork.updateVisibility(A, opacity_check)
@@ -1,94 +0,0 @@
//UPDATE TRIGGERS, when the chunk (and the surrounding chunks) should update.
// TURFS
/turf
var/image/obscured
/turf/proc/visibilityChanged()
if(ticker)
updateVisibilityNetworks(src)
/turf/simulated/Del()
visibilityChanged()
..()
/turf/simulated/New()
..()
visibilityChanged()
// STRUCTURES
/obj/structure/Del()
if(ticker)
updateVisibilityNetworks(src)
..()
/obj/structure/New()
..()
if(ticker)
updateVisibilityNetworks(src)
// EFFECTS
/obj/effect/Del()
if(ticker)
updateVisibilityNetworks(src)
..()
/obj/effect/New()
..()
if(ticker)
updateVisibilityNetworks(src)
// DOORS
// Simply updates the visibility of the area when it opens/closes/destroyed.
/obj/machinery/door/proc/update_nearby_tiles(need_rebuild)
if(!glass)
updateVisibilityNetworks(src,0)
if(!air_master)
return 0
for(var/turf/simulated/turf in locs)
update_heat_protection(turf)
air_master.mark_for_update(turf)
return 1
#define UPDATE_VISIBILITY_NETWORK_BUFFER 30
/mob
var/datum/visibility_network/list/visibilityNetworks=list()
var/updatingVisibilityNetworks=FALSE
/mob/Move(n,direct)
var/oldLoc = src.loc
//. = ..()
if(..(n,direct))
if(src.visibilityNetworks.len)
if(!src.updatingVisibilityNetworks)
src.updatingVisibilityNetworks = 1
spawn(UPDATE_VISIBILITY_NETWORK_BUFFER)
if(oldLoc != src.loc)
for (var/datum/visibility_network/currentNetwork in src.visibilityNetworks)
currentNetwork.updateMob(src)
src.updatingVisibilityNetworks = 0
return .
/mob/proc/addToVisibilityNetwork(var/datum/visibility_network/network)
if(network)
src.visibilityNetworks+=network
/mob/proc/removeFromVisibilityNetwork(var/datum/visibility_network/network)
if(network)
src.visibilityNetworks|=network
#undef UPDATE_VISIBILITY_NETWORK_BUFFER
@@ -1,46 +0,0 @@
/datum/visibility_interface
var/chunk_type = null
var/mob/controller = null
var/list/visible_chunks = list()
/datum/visibility_interface/New(var/mob/controller)
src.controller = controller
/datum/visibility_interface/proc/validMob()
return getClient()
/datum/visibility_interface/proc/getClient()
return controller.client
/datum/visibility_interface/proc/canBeAddedToChunk(var/datum/visibility_chunk/test_chunk)
return istype(test_chunk,chunk_type)
/datum/visibility_interface/proc/addChunk(var/datum/visibility_chunk/test_chunk)
visible_chunks+=test_chunk
var/client/currentClient = getClient()
if(currentClient)
currentClient.images += test_chunk.obscured
/datum/visibility_interface/proc/removeChunk(var/datum/visibility_chunk/test_chunk)
visible_chunks-=test_chunk
var/client/currentClient = getClient()
if(currentClient)
currentClient.images -= test_chunk.obscured
/datum/visibility_interface/proc/removeObscuredTurf(var/turf/target_turf)
if(validMob())
var/client/currentClient = getClient()
if(currentClient)
currentClient.images -= target_turf.obscured
/datum/visibility_interface/proc/addObscuredTurf(var/turf/target_turf)
if(validMob())
var/client/currentClient = getClient()
if(currentClient)
currentClient.images -= target_turf.obscured
@@ -1,144 +0,0 @@
/datum/visibility_network
var/list/viewpoints = list()
// the type of chunk used by this network
var/datum/visibility_chunk/ChunkType = /datum/visibility_chunk
// The chunks of the map, mapping the areas that the viewpoints can see.
var/list/chunks = list()
var/ready = 0
// Creates a chunk key string from x,y,z coordinates
/datum/visibility_network/proc/createChunkKey(x,y,z)
x &= ~0xf
y &= ~0xf
return "[x],[y],[z]"
// Checks if a chunk has been Generated in x, y, z.
/datum/visibility_network/proc/chunkGenerated(x, y, z)
return (chunks[createChunkKey(x, y, z)])
// Returns the chunk in the x, y, z.
// If there is no chunk, it creates a new chunk and returns that.
/datum/visibility_network/proc/getChunk(x, y, z)
var/key = createChunkKey(x, y, z)
if(!chunks[key])
chunks[key] = new ChunkType(null, x, y, z)
return chunks[key]
/datum/visibility_network/proc/visibility(var/mob/targetMob)
// if we've got not visibility interface on the mob, we canot do this
if (!targetMob.visibility_interface)
return
// 0xf = 15
var/x1 = max(0, targetMob.x - 16) & ~0xf
var/y1 = max(0, targetMob.y - 16) & ~0xf
var/x2 = min(world.maxx, targetMob.x + 16) & ~0xf
var/y2 = min(world.maxy, targetMob.y + 16) & ~0xf
var/list/visibleChunks = list()
for(var/x = x1; x <= x2; x += 16)
for(var/y = y1; y <= y2; y += 16)
visibleChunks += getChunk(x, y, targetMob.z)
var/list/remove = targetMob.visibility_interface:visible_chunks - visibleChunks
var/list/add = visibleChunks - targetMob.visibility_interface:visible_chunks
for(var/datum/visibility_chunk/chunk in remove)
chunk.remove(targetMob)
for(var/datum/visibility_chunk/chunk in add)
chunk.add(targetMob)
// Updates the chunks that the turf is located in. Use this when obstacles are destroyed or when doors open.
/datum/visibility_network/proc/updateVisibility(atom/A, var/opacity_check = 1)
if(!ticker || (opacity_check && !A.opacity))
return
majorChunkChange(A, 2)
/datum/visibility_network/proc/updateChunk(x, y, z)
if(!chunkGenerated(x, y, z))
return
var/datum/visibility_chunk/chunk = getChunk(x, y, z)
chunk.hasChanged()
/datum/visibility_network/proc/validViewpoint(var/viewpoint)
return FALSE
/datum/visibility_network/proc/addViewpoint(var/viewpoint)
if(validViewpoint(viewpoint))
majorChunkChange(viewpoint, 1)
/datum/visibility_network/proc/removeViewpoint(var/viewpoint)
if(validViewpoint(viewpoint))
majorChunkChange(viewpoint, 0)
/datum/visibility_network/proc/getViewpointFromMob(var/mob/currentMob)
return FALSE
/datum/visibility_network/proc/updateMob(var/mob/currentMob)
var/viewpoint = getViewpointFromMob(currentMob)
if(viewpoint)
updateViewpoint(viewpoint)
/datum/visibility_network/proc/updateViewpoint(var/viewpoint)
if(validViewpoint(viewpoint))
majorChunkChange(viewpoint, 1)
// Never access this proc directly!!!!
// This will update the chunk and all the surrounding chunks.
// It will also add the atom to the cameras list if you set the choice to 1.
// Setting the choice to 0 will remove the viewpoint from the chunks.
// If you want to update the chunks around an object, without adding/removing a viewpoint, use choice 2.
/datum/visibility_network/proc/majorChunkChange(atom/c, var/choice)
// 0xf = 15
if(!c)
return
var/turf/T = get_turf(c)
if(T)
var/x1 = max(0, T.x - 8) & ~0xf
var/y1 = max(0, T.y - 8) & ~0xf
var/x2 = min(world.maxx, T.x + 8) & ~0xf
var/y2 = min(world.maxy, T.y + 8) & ~0xf
for(var/x = x1; x <= x2; x += 16)
for(var/y = y1; y <= y2; y += 16)
if(chunkGenerated(x, y, T.z))
var/datum/visibility_chunk/chunk = getChunk(x, y, T.z)
if(choice == 0)
// Remove the viewpoint.
chunk.viewpoints -= c
else if(choice == 1)
// You can't have the same viewpoint in the list twice.
chunk.viewpoints |= c
chunk.hasChanged()
// checks if the network can see a particular atom
/datum/visibility_network/proc/checkCanSee(var/atom/target)
var/turf/position = get_turf(target)
return checkTurfVis(position)
/datum/visibility_network/proc/checkTurfVis(var/turf/position)
var/datum/visibility_chunk/chunk = getChunk(position.x, position.y, position.z)
if(chunk)
if(chunk.changed)
chunk.hasChanged(1) // Update now, no matter if it's visible or not.
if(chunk.visibleTurfs[position])
return 1
return 0
+5 -8
View File
@@ -1,3 +1,5 @@
#define CAT_HIDDEN 2 // Also in code/game/machinery/vending.dm
/datum/wires/vending
holder_type = /obj/machinery/vending
wire_count = 4
@@ -17,17 +19,12 @@ var/const/VENDING_WIRE_IDSCAN = 8
return 1
return 0
/datum/wires/vending/Interact(var/mob/living/user)
if(CanUse(user))
var/obj/machinery/vending/V = holder
V.attack_hand(user)
/datum/wires/vending/GetInteractWindow()
var/obj/machinery/vending/V = holder
. += ..()
. += "<BR>The orange light is [V.seconds_electrified ? "on" : "off"].<BR>"
. += "The red light is [V.shoot_inventory ? "off" : "blinking"].<BR>"
. += "The green light is [V.extended_inventory ? "on" : "off"].<BR>"
. += "The green light is [(V.categories & CAT_HIDDEN) ? "on" : "off"].<BR>"
. += "A [V.scan_id ? "purple" : "yellow"] light is on.<BR>"
/datum/wires/vending/UpdatePulsed(var/index)
@@ -36,7 +33,7 @@ var/const/VENDING_WIRE_IDSCAN = 8
if(VENDING_WIRE_THROW)
V.shoot_inventory = !V.shoot_inventory
if(VENDING_WIRE_CONTRABAND)
V.extended_inventory = !V.extended_inventory
V.categories ^= CAT_HIDDEN
if(VENDING_WIRE_ELECTRIFY)
V.seconds_electrified = 30
if(VENDING_WIRE_IDSCAN)
@@ -48,7 +45,7 @@ var/const/VENDING_WIRE_IDSCAN = 8
if(VENDING_WIRE_THROW)
V.shoot_inventory = !mended
if(VENDING_WIRE_CONTRABAND)
V.extended_inventory = 0
V.categories &= ~CAT_HIDDEN
if(VENDING_WIRE_ELECTRIFY)
if(mended)
V.seconds_electrified = 0
+5 -2
View File
@@ -72,8 +72,11 @@ var/list/wireColours = list("red", "blue", "green", "black", "orange", "brown",
html = GetInteractWindow()
if(html)
user.set_machine(holder)
//user << browse(html, "window=wires;size=[window_x]x[window_y]")
//onclose(user, "wires")
else
user.unset_machine()
// No content means no window.
user << browse(null, "window=wires")
return
var/datum/browser/popup = new(user, "wires", holder.name, window_x, window_y)
popup.set_content(html)
popup.set_title_image(user.browse_rsc_icon(holder.icon, holder.icon_state))
+1 -1
View File
@@ -380,7 +380,7 @@ var/global/list/PDA_Manifest = list()
throwforce = 0.0
throw_speed = 1
throw_range = 20
flags = FPRINT | TABLEPASS | CONDUCT
flags = CONDUCT
/obj/effect/stop
+15 -17
View File
@@ -3,7 +3,7 @@
desc = "Should anything ever go wrong..."
icon = 'icons/obj/items.dmi'
icon_state = "red_phone"
flags = FPRINT | TABLEPASS | CONDUCT
flags = CONDUCT
force = 3.0
throwforce = 2.0
throw_speed = 1
@@ -22,7 +22,6 @@
anchored = 0.0
var/matter = 0
var/mode = 1
flags = TABLEPASS
w_class = 3.0
/obj/item/weapon/bananapeel
@@ -108,7 +107,7 @@
icon = 'icons/obj/weapons.dmi'
icon_state = "cane"
item_state = "stick"
flags = FPRINT | TABLEPASS| CONDUCT
flags = CONDUCT
force = 5.0
throwforce = 7.0
w_class = 2.0
@@ -160,7 +159,7 @@
gender = PLURAL
icon = 'icons/obj/items.dmi'
icon_state = "handcuff"
flags = FPRINT | TABLEPASS | CONDUCT
flags = CONDUCT
throwforce = 0
w_class = 3.0
origin_tech = "materials=1"
@@ -272,7 +271,6 @@
throw_speed = 1
throw_range = 5
w_class = 2.0
flags = FPRINT | TABLEPASS
attack_verb = list("warned", "cautioned", "smashed")
proximity_sign
@@ -335,7 +333,7 @@
desc = "Parts of a rack."
icon = 'icons/obj/items.dmi'
icon_state = "rack_parts"
flags = FPRINT | TABLEPASS| CONDUCT
flags = CONDUCT
m_amt = 3750
/*/obj/item/weapon/syndicate_uplink
@@ -349,7 +347,7 @@
var/traitor_frequency = 0.0
var/mob/currentUser = null
var/obj/item/device/radio/origradio = null
flags = FPRINT | TABLEPASS | CONDUCT | ONBELT
flags = CONDUCT | ONBELT
w_class = 2.0
item_state = "radio"
throw_speed = 4
@@ -367,7 +365,7 @@
var/selfdestruct = 0.0
var/traitor_frequency = 0.0
var/obj/item/device/radio/origradio = null
flags = FPRINT | TABLEPASS| CONDUCT
flags = CONDUCT
slot_flags = SLOT_BELT
item_state = "radio"
throwforce = 5
@@ -387,7 +385,7 @@
throw_speed = 1
throw_range = 5
w_class = 2.0
flags = FPRINT | TABLEPASS | NOSHIELD
flags = NOSHIELD
attack_verb = list("bludgeoned", "whacked", "disciplined")
/obj/item/weapon/staff/broom
@@ -407,7 +405,7 @@
throw_speed = 1
throw_range = 5
w_class = 2.0
flags = FPRINT | TABLEPASS | NOSHIELD
flags = NOSHIELD
/obj/item/weapon/table_parts
name = "table parts"
@@ -416,7 +414,7 @@
icon = 'icons/obj/items.dmi'
icon_state = "table_parts"
m_amt = 3750
flags = FPRINT | TABLEPASS| CONDUCT
flags = CONDUCT
attack_verb = list("slammed", "bashed", "battered", "bludgeoned", "thrashed", "whacked")
/obj/item/weapon/table_parts/reinforced
@@ -425,7 +423,7 @@
icon = 'icons/obj/items.dmi'
icon_state = "reinf_tableparts"
m_amt = 7500
flags = FPRINT | TABLEPASS| CONDUCT
flags = CONDUCT
/obj/item/weapon/table_parts/wood
name = "wooden table parts"
@@ -453,7 +451,7 @@
icon_state = "std_module"
w_class = 2.0
item_state = "electronic"
flags = FPRINT|TABLEPASS|CONDUCT
flags = CONDUCT
var/mtype = 1 // 1=electronic 2=hardware
/obj/item/weapon/module/card_reader
@@ -494,7 +492,7 @@
/obj/item/weapon/camera_bug/attack_self(mob/usr as mob)
var/list/cameras = new/list()
for (var/obj/machinery/camera/C in cameranet.viewpoints)
for (var/obj/machinery/camera/C in cameranet.cameras)
if (C.bugged && C.status)
cameras.Add(C)
if (length(cameras) == 0)
@@ -522,7 +520,7 @@
desc = "A very sharp axe blade upon a short fibremetal handle. It has a long history of chopping things, but now it is used for chopping wood."
icon = 'icons/obj/weapons.dmi'
icon_state = "hatchet"
flags = FPRINT | TABLEPASS | CONDUCT
flags = CONDUCT
force = 12.0
sharp = 1
edge = 1
@@ -553,7 +551,7 @@
throw_speed = 2
throw_range = 3
w_class = 4.0
flags = FPRINT | TABLEPASS | NOSHIELD
flags = NOSHIELD
slot_flags = SLOT_BACK
origin_tech = "materials=2;combat=2"
attack_verb = list("chopped", "sliced", "cut", "reaped")
@@ -577,7 +575,7 @@
w_class = 1
throwforce = 2
var/cigarcount = 6
flags = ONBELT | TABLEPASS */
flags = ONBELT */
/obj/item/weapon/pai_cable
desc = "A flexible coated cable with a universal jack on one end."
+121
View File
@@ -0,0 +1,121 @@
/var/datum/announcement/priority/priority_announcement = new(do_log = 0)
/var/datum/announcement/priority/command/command_announcement = new(do_log = 0, do_newscast = 1)
/datum/announcement
var/title = "Attention"
var/announcer = ""
var/log = 0
var/sound
var/newscast = 0
var/channel_name = "Station Announcements"
var/announcement_type = "Announcement"
var/disable_newscasts = 1 // Bay also adds announcements to their newscaster system - set this to 0 to also use that system
/datum/announcement/New(var/do_log = 0, var/new_sound = null, var/do_newscast = 0)
sound = new_sound
log = do_log
newscast = do_newscast
/datum/announcement/priority/New(var/do_log = 1, var/new_sound = sound('sound/misc/notice2.ogg'), var/do_newscast = 0)
..(do_log, new_sound, do_newscast)
title = "Priority Announcement"
announcement_type = "Priority Announcement"
/datum/announcement/priority/command/New(var/do_log = 1, var/new_sound = sound('sound/misc/notice2.ogg'), var/do_newscast = 0)
..(do_log, new_sound, do_newscast)
title = "[command_name()] Update"
announcement_type = "[command_name()] Update"
/datum/announcement/priority/security/New(var/do_log = 1, var/new_sound = sound('sound/misc/notice2.ogg'), var/do_newscast = 0)
..(do_log, new_sound, do_newscast)
title = "Security Announcement"
announcement_type = "Security Announcement"
/datum/announcement/proc/Announce(var/message as text, var/new_title = "", var/new_sound = null, var/do_newscast = newscast)
if(!message)
return
var/tmp/message_title = new_title ? new_title : title
var/tmp/message_sound = new_sound ? sound(new_sound) : sound
message = trim_strip_html_properly(message)
message_title = html_encode(message_title)
Message(message, message_title)
if(do_newscast)
NewsCast(message, message_title)
Sound(message_sound)
Log(message, message_title)
datum/announcement/proc/Message(message as text, message_title as text)
for(var/mob/M in player_list)
if(!istype(M,/mob/new_player) && !isdeaf(M))
M << "<h2 class='alert'>[title]</h2>"
M << "<span class='alert'>[message]</span>"
if (announcer)
M << "<span class='alert'> -[html_encode(announcer)]</span>"
datum/announcement/minor/Message(message as text, message_title as text)
world << "<b>[message]</b>"
datum/announcement/priority/Message(message as text, message_title as text)
world << "<h1 class='alert'>[message_title]</h1>"
world << "<span class='alert'>[message]</span>"
if(announcer)
world << "<span class='alert'> -[html_encode(announcer)]</span>"
world << "<br>"
datum/announcement/priority/command/Message(message as text, message_title as text)
var/command
command += "<h1 class='alert'>[command_name()] Update</h1>"
if (message_title)
command += "<br><h2 class='alert'>[message_title]</h2>"
command += "<br><span class='alert'>[message]</span><br>"
command += "<br>"
for(var/mob/M in player_list)
if(!istype(M,/mob/new_player) && !isdeaf(M))
M << command
datum/announcement/priority/security/Message(message as text, message_title as text)
world << "<font size=4 color='red'>[message_title]</font>"
world << "<font color='red'>[message]</font>"
datum/announcement/proc/NewsCast(message as text, message_title as text)
if(disable_newscasts)
return
if(!newscast)
return
var/datum/news_announcement/news = new
news.channel_name = channel_name
news.author = announcer
news.message = message
news.message_type = announcement_type
news.can_be_redacted = 0
announce_newscaster_news(news)
datum/announcement/proc/PlaySound(var/message_sound)
if(!message_sound)
return
for(var/mob/M in player_list)
if(!istype(M,/mob/new_player) && !isdeaf(M))
M << message_sound
datum/announcement/proc/Sound(var/message_sound)
PlaySound(message_sound)
datum/announcement/priority/Sound(var/message_sound)
if(sound)
world << sound
datum/announcement/priority/command/Sound(var/message_sound)
PlaySound(message_sound)
datum/announcement/proc/Log(message as text, message_title as text)
if(log)
log_say("[key_name(usr)] has made \a [announcement_type]: [message_title] - [message] - [announcer]")
message_admins("[key_name_admin(usr)] has made \a [announcement_type].", 1)
/proc/GetNameAndAssignmentFromId(var/obj/item/weapon/card/id/I)
// Format currently matches that of newscaster feeds: Registered Name (Assigned Rank)
return I.assignment ? "[I.registered_name] ([I.assignment])" : I.registered_name
-5
View File
@@ -1,5 +0,0 @@
/proc/captain_announce(var/text)
world << "<h1 class='alert'>Priority Announcement</h1>"
world << "<span class='alert'>[html_encode(text)]</span>"
world << "<br>"
-11
View File
@@ -1,11 +0,0 @@
/proc/command_alert(var/text, var/title = "")
var/command
command += "<h1 class='alert'>[command_name()] Update</h1>"
if (title && length(title) > 0)
command += "<br><h2 class='alert'>[html_encode(title)]</h2>"
command += "<br><span class='alert'>[html_encode(text)]</span><br>"
command += "<br>"
for(var/mob/M in player_list)
if(!istype(M,/mob/new_player))
M << command
+9 -3
View File
@@ -22,6 +22,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
var/poweralm = 1
var/party = null
var/radalert = 0
var/report_alerts = 1 // Should atmos alerts notify the AI/computers
level = null
name = "Space"
icon = 'icons/turf/areas.dmi'
@@ -69,7 +70,7 @@ var/list/teleportlocs = list()
var/list/turfs = get_area_turfs(AR.type)
if(turfs.len)
var/turf/picked = pick(turfs)
if (picked.z == 1)
if ((picked.z in config.station_levels))
teleportlocs += AR.name
teleportlocs[AR.name] = AR
@@ -82,13 +83,13 @@ var/list/ghostteleportlocs = list()
/hook/startup/proc/setupGhostTeleportLocs()
for(var/area/AR in world)
if(ghostteleportlocs.Find(AR.name)) continue
if(istype(AR, /area/turret_protected/aisat) || istype(AR, /area/derelict) || istype(AR, /area/tdome))
if(istype(AR, /area/tdome))
ghostteleportlocs += AR.name
ghostteleportlocs[AR.name] = AR
var/list/turfs = get_area_turfs(AR.type)
if(turfs.len)
var/turf/picked = pick(turfs)
if (picked.z == 1 || picked.z == 5 || picked.z == 3)
if ((picked.z in config.player_levels))
ghostteleportlocs += AR.name
ghostteleportlocs[AR.name] = AR
@@ -1983,6 +1984,11 @@ area/security/podbay
//Traitor Station
/area/traitor
name = "\improper Syndicate Base"
icon_state = "syndie_hall"
report_alerts = 0
/area/traitor/rnd
name = "\improper Syndicate Research and Development"
icon_state = "syndie_rnd"
+33 -2
View File
@@ -52,25 +52,32 @@
InitializeLighting()
/area/proc/poweralert(var/state, var/obj/source as obj)
/area/proc/poweralert(var/state, var/obj/source as obj)
if (state != poweralm)
poweralm = state
if(istype(source)) //Only report power alarms on the z-level where the source is located.
var/list/cameras = list()
for (var/area/RA in related)
for (var/obj/machinery/camera/C in RA)
if(!report_alerts)
break
cameras += C
if(state == 1)
C.network.Remove("Power Alarms")
else
C.network.Add("Power Alarms")
for (var/mob/living/silicon/aiPlayer in player_list)
if(!report_alerts)
break
if(aiPlayer.z == source.z)
if (state == 1)
aiPlayer.cancelAlarm("Power", src, source)
else
aiPlayer.triggerAlarm("Power", src, cameras, source)
for(var/obj/machinery/computer/station_alert/a in machines)
if(!report_alerts)
break
if(a.z == source.z)
if(state == 1)
a.cancelAlarm("Power", src, source)
@@ -107,11 +114,17 @@
for(var/area/RA in related)
//updateicon()
for(var/obj/machinery/camera/C in RA)
if(!report_alerts)
break
cameras += C
C.network.Add("Atmosphere Alarms")
for(var/mob/living/silicon/aiPlayer in player_list)
if(!report_alerts)
break
aiPlayer.triggerAlarm("Atmosphere", src, cameras, src)
for(var/obj/machinery/computer/station_alert/a in machines)
if(!report_alerts)
break
a.triggerAlarm("Atmosphere", src, cameras, src)
air_doors_activated=1
CloseFirelocks()
@@ -119,10 +132,16 @@
else if (atmosalm == 2)
for(var/area/RA in related)
for(var/obj/machinery/camera/C in RA)
if(!report_alerts)
break
C.network.Remove("Atmosphere Alarms")
for(var/mob/living/silicon/aiPlayer in player_list)
if(!report_alerts)
break
aiPlayer.cancelAlarm("Atmosphere", src, src)
for(var/obj/machinery/computer/station_alert/a in machines)
if(!report_alerts)
break
a.cancelAlarm("Atmosphere", src, src)
air_doors_activated=0
OpenFirelocks()
@@ -162,11 +181,17 @@
var/list/cameras = list()
for(var/area/RA in related)
for (var/obj/machinery/camera/C in RA)
if(!report_alerts)
continue
cameras.Add(C)
C.network.Add("Fire Alarms")
for (var/mob/living/silicon/ai/aiPlayer in player_list)
if(!report_alerts)
continue
aiPlayer.triggerAlarm("Fire", src, cameras, src)
for (var/obj/machinery/computer/station_alert/a in machines)
if(!report_alerts)
continue
a.triggerAlarm("Fire", src, cameras, src)
/area/proc/firereset()
@@ -176,10 +201,16 @@
updateicon()
for(var/area/RA in related)
for (var/obj/machinery/camera/C in RA)
if(!report_alerts)
continue
C.network.Remove("Fire Alarms")
for (var/mob/living/silicon/ai/aiPlayer in player_list)
if(!report_alerts)
continue
aiPlayer.cancelAlarm("Fire", src, src)
for (var/obj/machinery/computer/station_alert/a in machines)
if(!report_alerts)
continue
a.cancelAlarm("Fire", src, src)
OpenFirelocks()
@@ -355,7 +386,7 @@
thunk(L)
// Ambience goes down here -- make sure to list each area seperately for ease of adding things in later, thanks! Note: areas adjacent to each other should have the same sounds to prevent cutoff when possible.- LastyScratch
if(L && L.client && (L.client.prefs.toggles & SOUND_AMBIENCE))
if(L && L.client && (L.client.prefs.sound & SOUND_AMBIENCE))
if(!L.client.ambience_playing)
L.client.ambience_playing = 1
L << sound('sound/ambience/shipambience.ogg', repeat = 1, wait = 0, volume = 35, channel = 2)
+3 -3
View File
@@ -1,7 +1,7 @@
/atom
layer = 2
var/level = 2
var/flags = FPRINT
var/flags = 0
var/list/fingerprints
var/list/fingerprintshidden
var/fingerprintslast = null
@@ -242,6 +242,8 @@ its easier to just keep the beam vertical.
/atom/proc/blob_act()
return
/atom/proc/emag_act()
return
/atom/proc/hitby(atom/movable/AM as mob|obj)
if (density)
@@ -378,8 +380,6 @@ its easier to just keep the beam vertical.
M.dna = new /datum/dna(null)
M.dna.real_name = M.real_name
M.check_dna()
if (!( src.flags ) & FPRINT)
return 0
if(!blood_DNA || !istype(blood_DNA, /list)) //if our list of DNA doesn't exist yet (or isn't a list) initialise it.
blood_DNA = list()
+2 -1
View File
@@ -99,7 +99,8 @@
src.throw_impact(A,speed)
/atom/movable/proc/throw_at(atom/target, range, speed, thrower)
if(!target || !src) return 0
if(!target || !src || (flags & NODROP))
return 0
//use a modified version of Bresenham's algorithm to get from the atom's current position to that of the target
src.throwing = 1
+2 -2
View File
@@ -410,7 +410,7 @@
for(var/obj/item/W in (H.contents-implants))
if (W==H.w_uniform) // will be teared
continue
H.drop_from_inventory(W)
H.unEquip(W)
M.monkeyizing = 1
M.canmove = 0
M.icon = null
@@ -483,7 +483,7 @@
W.loc = null
if(!connected)
for(var/obj/item/W in (Mo.contents-implants))
Mo.drop_from_inventory(W)
Mo.unEquip(W)
M.monkeyizing = 1
M.canmove = 0
M.icon = null
+2 -2
View File
@@ -22,7 +22,7 @@
for(var/obj/item/W in (H.contents-implants))
if (W==H.w_uniform) // will be teared
continue
H.drop_from_inventory(W)
H.unEquip(W)
M.monkeyizing = 1
M.canmove = 0
M.icon = null
@@ -93,7 +93,7 @@
W.loc = null
if(!connected)
for(var/obj/item/W in (Mo.contents-implants))
Mo.drop_from_inventory(W)
Mo.unEquip(W)
M.monkeyizing = 1
M.canmove = 0
M.icon = null
+1 -1
View File
@@ -26,7 +26,7 @@
if(!checking)
checking = 1
user << "<span class='notice'>The device is now checking for possible candidates.</span>"
get_candidate_answer(user, get_candidates(BE_OPERATIVE,,"operative","Syndicate"))
get_candidate_answer(user, get_candidates(BE_OPERATIVE))
else
user << "<span class='notice'>The device is already checking for possible candidates.</span>"
return
+5 -8
View File
@@ -58,7 +58,7 @@ var/list/blob_nodes = list()
/datum/game_mode/blob/proc/get_nuke_code()
var/nukecode = "ERROR"
for(var/obj/machinery/nuclearbomb/bomb in world)
if(bomb && bomb.r_code && bomb.z == 1)
if(bomb && bomb.r_code && (bomb.z in config.station_levels))
nukecode = bomb.r_code
return nukecode
@@ -92,7 +92,7 @@ var/list/blob_nodes = list()
if(directory[ckey(blob.key)])
blob_client = directory[ckey(blob.key)]
location = get_turf(C)
if(location.z != 1 || istype(location, /turf/space))
if(!(location.z in config.station_levels) || istype(location, /turf/space))
location = null
C.gib()
@@ -175,17 +175,14 @@ var/list/blob_nodes = list()
return
if (1)
command_alert("Nanotrasen has issued a directive 7-10 for [station_name()]. The station is to be considered quarantined.", "Biohazard Alert")
for(var/mob/M in player_list)
if(!istype(M,/mob/new_player))
M << sound('sound/AI/blob_confirmed.ogg')
command_announcement.Announce("Nanotrasen has issued a directive 7-10 for [station_name()]. The station is to be considered quarantined.", "Biohazard Alert", new_sound = 'sound/AI/blob_confirmed.ogg')
return
if (2)
command_alert("The biohazard has grown out of control and will soon reach critical mass. Activate the nuclear failsafe to maintain quarantine. The Nuclear Authentication Code is [get_nuke_code()] ", "Biohazard Alert")
command_announcement.Announce("The biohazard has grown out of control and will soon reach critical mass. Activate the nuclear failsafe to maintain quarantine. The Nuclear Authentication Code is [get_nuke_code()] ", "Biohazard Alert", new_sound = 'sound/AI/blob_confirmed.ogg')
set_security_level("gamma")
var/obj/machinery/door/airlock/vault/V = locate(/obj/machinery/door/airlock/vault) in world
if(V && V.z == 1)
if(V && (V.z in config.station_levels))
V.locked = 0
V.update_icon()
send_intercept(2)
+1 -1
View File
@@ -62,7 +62,7 @@ datum/game_mode/proc/auto_declare_completion_blob()
if (istype(T, /turf/space))
numSpace += 1
else if(istype(T, /turf))
if (M.z!=1)
if (!(M.z in config.station_levels))
numOffStation += 1
else
numAlive += 1
+2 -2
View File
@@ -61,7 +61,7 @@
proc/count()
for(var/turf/T in world)
if(T.z != 1)
if(!(T.z in config.station_levels))
continue
if(istype(T,/turf/simulated/floor))
@@ -83,7 +83,7 @@
src.r_wall += 1
for(var/obj/O in world)
if(O.z != 1)
if(!(O.z in config.station_levels))
continue
if(istype(O, /obj/structure/window))
+1 -1
View File
@@ -72,7 +72,7 @@
var/list/candidates = list()
if(!new_overmind)
candidates = get_candidates(BE_BLOB,,"blob","Syndicate")
candidates = get_candidates(BE_BLOB)
if(candidates.len)
C = pick(candidates)
else
+1 -1
View File
@@ -39,7 +39,7 @@
return 0 // not enough candidates for borer
for(var/obj/machinery/atmospherics/unary/vent_pump/v in world)
if(!v.welded && v.z == STATION_Z) // No more spawning in atmos. Assuming the mappers did their jobs, anyway.
if(!v.welded && (v.z in config.station_levels))
found_vents.Add(v)
// for each 2 possible borers, add one borer and one host
@@ -31,7 +31,7 @@
implants += I
for(var/obj/item/W in src)
user.u_equip(W)
user.unEquip(W)
if (user.client)
user.client.screen -= W
if (W)
@@ -42,7 +42,7 @@
C.dna = null
for(var/obj/item/W in C)
C.drop_from_inventory(W)
C.unEquip(W)
for(var/obj/T in C)
del(T)
@@ -34,7 +34,7 @@
..(user, target)
/obj/effect/proc_holder/changeling/weapon/sting_action(var/mob/user)
if(!user.drop_item() && user.get_active_hand())
if(!user.drop_item())
user << "The [user.get_active_hand()] is stuck to your hand, you cannot grow a [weapon_name_simple] over it!"
return
var/obj/item/W = new weapon_type(user)
@@ -83,15 +83,15 @@
..(H, target)
/obj/effect/proc_holder/changeling/suit/sting_action(var/mob/living/carbon/human/user)
if(user.wear_suit && !user.wear_suit.canremove)
if(!user.unEquip(user.wear_suit))
user << "\the [user.wear_suit] is stuck to your body, you cannot grow a [suit_name_simple] over it!"
return
if(user.head && !user.head.canremove)
if(!user.unEquip(user.head))
user << "\the [user.head] is stuck on your head, you cannot grow a [helmet_name_simple] over it!"
return
user.u_equip(user.head)
user.u_equip(user.wear_suit)
user.unEquip(user.head)
user.unEquip(user.wear_suit)
user.equip_to_slot_if_possible(new suit_type(user), slot_wear_suit, 1, 1, 1)
user.equip_to_slot_if_possible(new helmet_type(user), slot_head, 1, 1, 1)
@@ -123,11 +123,11 @@
icon = 'icons/obj/weapons.dmi'
icon_state = "arm_blade"
item_state = "arm_blade"
flags = ABSTRACT | NODROP
icon_override = 'icons/mob/in-hand/changeling.dmi'
w_class = 5.0
sharp = 1
edge = 1
canremove = 0
force = 25
throwforce = 0 //Just to be on the safe side
throw_range = 0
@@ -195,13 +195,15 @@
return
var/obj/item/weapon/shield/changeling/S = ..(user)
if(!S)
return
S.remaining_uses = round(changeling.absorbedcount * 3)
return 1
/obj/item/weapon/shield/changeling
name = "shield-like mass"
desc = "A mass of tough, boney tissue. You can still see the fingers as a twisted pattern in the shield."
canremove = 0
flags = NODROP
icon = 'icons/obj/weapons.dmi'
icon_state = "ling_shield"
icon_override = 'icons/mob/in-hand/changeling.dmi'
@@ -221,7 +223,7 @@
if(ishuman(loc))
var/mob/living/carbon/human/H = loc
H.visible_message("<span class='warning'>With a sickening crunch, [H] reforms his shield into an arm!</span>", "<span class='notice'>We assimilate our shield into our body</span>", "<span class='warning>You hear organic matter ripping and tearing!</span>")
H.u_equip(src, 1)
H.unEquip(src, 1)
qdel(src)
return 0
else
@@ -256,10 +258,9 @@
name = "flesh mass"
icon_state = "lingspacesuit"
desc = "A huge, bulky mass of pressure and temperature-resistant organic tissue, evolved to facilitate space travel."
flags = STOPSPRESSUREDMAGE
flags = STOPSPRESSUREDMAGE | NODROP
allowed = list(/obj/item/device/flashlight, /obj/item/weapon/tank/emergency_oxygen, /obj/item/weapon/tank/oxygen)
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0) //No armor at all.
canremove = 0
/obj/item/clothing/suit/space/changeling/New()
..()
@@ -279,9 +280,8 @@
name = "flesh mass"
icon_state = "lingspacehelmet"
desc = "A covering of pressure and temperature-resistant organic tissue with a glass-like chitin front."
flags = HEADCOVERSEYES | BLOCKHAIR | HEADCOVERSMOUTH | STOPSPRESSUREDMAGE
flags = HEADCOVERSEYES | BLOCKHAIR | HEADCOVERSMOUTH | STOPSPRESSUREDMAGE | NODROP
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
canremove = 0
/obj/item/clothing/head/helmet/space/changeling/dropped()
qdel(src)
@@ -310,10 +310,10 @@
name = "chitinous mass"
desc = "A tough, hard covering of black chitin."
icon_state = "lingarmor"
flags = NODROP
body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS
slowdown = 2
armor = list(melee = 65, bullet = 20, laser = 10, energy = 13, bomb = 0, bio = 0, rad = 0)
canremove = 0
flags_inv = HIDEJUMPSUIT
cold_protection = 0
heat_protection = 0
@@ -330,9 +330,8 @@
name = "chitinous mass"
desc = "A tough, hard covering of black chitin with transparent chitin in front."
icon_state = "lingarmorhelmet"
flags = HEADCOVERSEYES | BLOCKHAIR
flags = HEADCOVERSEYES | BLOCKHAIR | NODROP
armor = list(melee = 70, bullet = 15, laser = 7,energy = 10, bomb = 5, bio = 2, rad = 0)
canremove = 0
flags_inv = HIDEEARS
/obj/item/clothing/head/helmet/changeling/dropped()
+2 -5
View File
@@ -3,7 +3,6 @@
desc = "An arcane weapon wielded by the followers of Nar-Sie"
icon_state = "cultblade"
item_state = "cultblade"
flags = FPRINT | TABLEPASS
w_class = 4
force = 30
throwforce = 10
@@ -34,7 +33,7 @@
icon_state = "culthood"
desc = "A hood worn by the followers of Nar-Sie."
flags_inv = HIDEFACE
flags = FPRINT|TABLEPASS|HEADCOVERSEYES
flags = HEADCOVERSEYES
armor = list(melee = 30, bullet = 10, laser = 5,energy = 5, bomb = 0, bio = 0, rad = 0)
cold_protection = HEAD
min_cold_protection_temperature = SPACE_HELMET_MIN_COLD_PROTECTION_TEMPERATURE
@@ -55,7 +54,6 @@
desc = "A set of armored robes worn by the followers of Nar-Sie"
icon_state = "cultrobes"
item_state = "cultrobes"
flags = FPRINT | TABLEPASS
body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|ARMS
allowed = list(/obj/item/weapon/tome,/obj/item/weapon/melee/cultblade)
armor = list(melee = 50, bullet = 30, laser = 50,energy = 20, bomb = 25, bio = 10, rad = 0)
@@ -68,7 +66,7 @@
item_state = "magus"
desc = "A helm worn by the followers of Nar-Sie."
flags_inv = HIDEFACE
flags = FPRINT|TABLEPASS|HEADCOVERSEYES|HEADCOVERSMOUTH|BLOCKHAIR
flags = HEADCOVERSEYES | HEADCOVERSMOUTH | BLOCKHAIR
armor = list(melee = 30, bullet = 30, laser = 30,energy = 20, bomb = 0, bio = 0, rad = 0)
siemens_coefficient = 0
loose = 6 // mostly one size fits all
@@ -78,7 +76,6 @@
desc = "A set of armored robes worn by the followers of Nar-Sie"
icon_state = "magusred"
item_state = "magusred"
flags = FPRINT | TABLEPASS
body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|ARMS
allowed = list(/obj/item/weapon/tome,/obj/item/weapon/melee/cultblade)
armor = list(melee = 50, bullet = 30, laser = 50,energy = 20, bomb = 25, bio = 10, rad = 0)
+4 -7
View File
@@ -72,13 +72,11 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology",
blood.override = 1
for(var/mob/living/silicon/ai/AI in player_list)
AI.client.images += blood
cultNetwork.viewpoints+=src
cultNetwork.addViewpoint(src)
cult_viewpoints += src
/obj/effect/rune/Del()
..()
cultNetwork.viewpoints-=src
cultNetwork.removeViewpoint(src)
cult_viewpoints -= src
/obj/effect/rune/examine()
set src in view(2)
@@ -114,7 +112,7 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology",
return "itemport"
return "[rune_to_english[word1]]_[rune_to_english[word2]]_[rune_to_english[word3]]"
/obj/effect/rune
var/list/effect_dictionary = list( "teleport"=/obj/effect/rune/proc/teleportRune,
"itemport"=/obj/effect/rune/proc/itemportRune,
@@ -152,7 +150,7 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology",
user << "You are unable to speak at all! You cannot say the words of the rune."
if(!word1 || !word2 || !word3 || prob(user.getBrainLoss()))
return fizzle()
var/word_string = get_word_string()
if (word_string in effect_dictionary)
cult_log("of type [effect_dictionary[word_string]] activated by [key_name_admin(user)].")
@@ -178,7 +176,6 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology",
throw_speed = 1
throw_range = 5
w_class = 2.0
flags = FPRINT | TABLEPASS
var/notedat = ""
var/tomedat = ""
var/list/words = list("ire" = "ire", "ego" = "ego", "nahlizet" = "nahlizet", "certum" = "certum", "veri" = "veri", "jatkaa" = "jatkaa", "balaq" = "balaq", "mgar" = "mgar", "karazet" = "karazet", "geeri" = "geeri")
+1 -1
View File
@@ -813,7 +813,7 @@ var/list/sacrificed = list()
cultist.legcuffed = null
cultist.update_inv_legcuffed()
if (istype(cultist.wear_mask, /obj/item/clothing/mask/muzzle))
cultist.u_equip(cultist.wear_mask)
cultist.unEquip(cultist.wear_mask)
if(istype(cultist.loc, /obj/structure/closet)&&cultist.loc:welded)
cultist.loc:welded = 0
if(istype(cultist.loc, /obj/structure/closet/secure_closet)&&cultist.loc:locked)
+1 -1
View File
@@ -149,7 +149,7 @@
announce_to_kill_crew()
stage = 2
else if(stage == 2 && cruiser_seconds() <= 60 * 5)
command_alert("Inbound cruiser detected on collision course. Scans indicate the ship to be armed and ready to fire. Estimated time of arrival: 5 minutes.", "[station_name()] Early Warning System")
command_announcement.Announce("Inbound cruiser detected on collision course. Scans indicate the ship to be armed and ready to fire. Estimated time of arrival: 5 minutes.", "[station_name()] Early Warning System")
stage = 3
else if(stage == 3 && cruiser_seconds() <= 0)
crew_lose()
+25 -38
View File
@@ -30,10 +30,7 @@
eventNumbersToPickFrom += 3
switch(pick(eventNumbersToPickFrom))
if(1)
command_alert("Meteors have been detected on collision course with the station.", "Meteor Alert")
for(var/mob/M in player_list)
if(!istype(M,/mob/new_player))
M << sound('sound/AI/meteors.ogg')
command_announcement.Announce("Meteors have been detected on collision course with the station.", "Meteor Alert", new_sound = 'sound/AI/meteors.ogg')
spawn(100)
meteor_wave()
spawn_meteors()
@@ -42,22 +39,18 @@
spawn_meteors()
if(2)
command_alert("Gravitational anomalies detected on the station. There is no additional data.", "Anomaly Alert")
for(var/mob/M in player_list)
if(!istype(M,/mob/new_player))
M << sound('sound/AI/granomalies.ogg')
command_announcement.Announce("Gravitational anomalies detected on the station. There is no additional data.", "Anomaly Alert", new_sound = 'sound/AI/granomalies.ogg')
var/turf/T = pick(blobstart)
var/obj/effect/bhole/bh = new /obj/effect/bhole( T.loc, 30 )
spawn(rand(50, 300))
del(bh)
/*
if(3) //Leaving the code in so someone can try and delag it, but this event can no longer occur randomly, per SoS's request. --NEO
command_alert("Space-time anomalies detected on the station. There is no additional data.", "Anomaly Alert")
world << sound('sound/AI/spanomalies.ogg')
command_announcement.Announce("Space-time anomalies detected on the station. There is no additional data.", "Anomaly Alert", new_sound = 'sound/AI/spanomalies.ogg')
var/list/turfs = new
var/turf/picked
for(var/turf/simulated/floor/T in world)
if(T.z == 1)
if((T.z in config.station_levels))
turfs += T
for(var/turf/simulated/floor/T in turfs)
if(prob(20))
@@ -107,8 +100,7 @@
/*
/proc/viral_outbreak(var/virus = null)
// command_alert("Confirmed outbreak of level 7 viral biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert")
// world << sound('sound/AI/outbreak7.ogg')
// command_announcement.Announce("Confirmed outbreak of level 7 viral biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", new_sound = 'sound/AI/outbreak7.ogg')
var/virus_type
if(!virus)
virus_type = pick(/datum/disease/dnaspread,/datum/disease/advance/flu,/datum/disease/advance/cold,/datum/disease/brainrot,/datum/disease/magnitis,/datum/disease/pierrot_throat)
@@ -140,7 +132,7 @@
var/turf/T = get_turf(H)
if(!T)
continue
if(T.z != 1)
if(!(T.z in config.station_levels))
continue
for(var/datum/disease/D in H.viruses)
foundAlready = 1
@@ -167,21 +159,18 @@
H.viruses += D
break
spawn(rand(1500, 3000)) //Delayed announcements to keep the crew on their toes.
command_alert("Confirmed outbreak of level 7 viral biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert")
for(var/mob/M in player_list)
M << sound('sound/AI/outbreak7.ogg')
command_announcement.Announce("Confirmed outbreak of level 7 viral biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", new_sound = 'sound/AI/outbreak7.ogg')
*/
/proc/alien_infestation(var/spawncount = 1) // -- TLE
//command_alert("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert")
//world << sound('sound/AI/aliens.ogg')
//command_announcement.Announce("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert", new_sound = 'sound/AI/aliens.ogg')
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines)
if(temp_vent.loc.z == 1 && !temp_vent.welded && temp_vent.network)
if((temp_vent.loc.z in config.station_levels) && !temp_vent.welded && temp_vent.network)
if(temp_vent.network.normal_members.len > 50) // Stops Aliens getting stuck in small networks. See: Security, Virology
vents += temp_vent
var/list/candidates = get_candidates(BE_ALIEN,ALIEN_AFK_BRACKET,"alien","Syndicate")
var/list/candidates = get_candidates(BE_ALIEN,ALIEN_AFK_BRACKET)
if(prob(40)) spawncount++ //sometimes, have two larvae spawn instead of one
while((spawncount >= 1) && vents.len && candidates.len)
@@ -197,7 +186,7 @@
spawncount--
spawn(rand(5000, 6000)) //Delayed announcements to keep the crew on their toes.
command_alert("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert")
command_announcement.Announce("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert", new_sound = 'sound/AI/aliens.ogg')
for(var/mob/M in player_list)
M << sound('sound/AI/aliens.ogg')
@@ -205,7 +194,7 @@
/* // Haha, this is way too laggy. I'll keep the prison break though.
for(var/obj/machinery/light/L in world)
if(L.z != 1) continue
if(!(L.z in config.station_levels)) continue
L.flicker(50)
sleep(100)
@@ -214,9 +203,11 @@
var/turf/T = get_turf(H)
if(!T)
continue
if(T.z != 1)
if(!(T.z in config.station_levels))
continue
if(istype(H,/mob/living/carbon/human))
if(H.species.flags & IS_SYNTHETIC)
return
H.apply_effect((rand(15,75)),IRRADIATE,0)
if (prob(5))
H.apply_effect((rand(90,150)),IRRADIATE,0)
@@ -231,13 +222,11 @@
var/turf/T = get_turf(M)
if(!T)
continue
if(T.z != 1)
if(!(T.z in config.station_levels))
continue
M.apply_effect((rand(15,75)),IRRADIATE,0)
sleep(100)
command_alert("High levels of radiation detected near the station. Please report to the Med-bay if you feel strange.", "Anomaly Alert")
for(var/mob/M in player_list)
M << sound('sound/AI/radiation.ogg')
command_announcement.Announce("High levels of radiation detected near the station. Please report to the Med-bay if you feel strange.", "Anomaly Alert", new_sound = 'sound/AI/radiation.ogg')
@@ -276,9 +265,9 @@
temp_timer.releasetime = 1
sleep(150)
command_alert("Gr3y.T1d3 virus detected in [station_name()] imprisonment subroutines. Recommend station AI involvement.", "Security Alert")
command_announcement.Announce("Gr3y.T1d3 virus detected in [station_name()] imprisonment subroutines. Recommend station AI involvement.", "Security Alert")
else
world.log << "ERROR: Could not initate grey-tide. Unable find prison or brig area."
world.log << "ERROR: Could not initate grey-tide virus. Unable find prison or brig area."
/proc/carp_migration() // -- Darem
for(var/obj/effect/landmark/C in landmarks_list)
@@ -286,13 +275,11 @@
new /mob/living/simple_animal/hostile/carp(C.loc)
//sleep(100)
spawn(rand(300, 600)) //Delayed announcements to keep the crew on their toes.
command_alert("Unknown biological entities have been detected near [station_name()], please stand-by.", "Lifesign Alert")
for(var/mob/M in player_list)
M << sound('sound/AI/commandreport.ogg')
command_announcement.Announce("Unknown biological entities have been detected near [station_name()], please stand-by.", "Lifesign Alert", new_sound = 'sound/AI/commandreport.ogg')
/proc/lightsout(isEvent = 0, lightsoutAmount = 1,lightsoutRange = 25) //leave lightsoutAmount as 0 to break ALL lights
if(isEvent)
command_alert("An Electrical storm has been detected in your area, please repair potential electronic overloads.","Electrical Storm Alert")
command_announcement.Announce("An Electrical storm has been detected in your area, please repair potential electronic overloads.","Electrical Storm Alert")
if(lightsoutAmount)
var/list/epicentreList = list()
@@ -442,21 +429,21 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is
spawn(0)
world << "Started processing APCs"
for (var/obj/machinery/power/apc/APC in world)
if(APC.z == 1)
if((APC.z in config.station_levels))
APC.ion_act()
apcnum++
world << "Finished processing APCs. Processed: [apcnum]"
spawn(0)
world << "Started processing SMES"
for (var/obj/machinery/power/smes/SMES in world)
if(SMES.z == 1)
if((SMES.z in config.station_levels))
SMES.ion_act()
smesnum++
world << "Finished processing SMES. Processed: [smesnum]"
spawn(0)
world << "Started processing AIRLOCKS"
for (var/obj/machinery/door/airlock/D in world)
if(D.z == 1)
if((D.z in config.station_levels))
//if(length(D.req_access) > 0 && !(12 in D.req_access)) //not counting general access and maintenance airlocks
airlocknum++
spawn(0)
@@ -465,7 +452,7 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is
spawn(0)
world << "Started processing FIREDOORS"
for (var/obj/machinery/door/firedoor/D in world)
if(D.z == 1)
if((D.z in config.station_levels))
firedoornum++;
spawn(0)
D.ion_act()
+3 -3
View File
@@ -1,18 +1,18 @@
/datum/event/portalstorm
Announce()
command_alert("Subspace disruption detected around the vessel", "Anomaly Alert")
command_announcement.Announce("Subspace disruption detected around the vessel", "Anomaly Alert")
LongTerm()
var/list/turfs = list( )
var/turf/picked
for(var/turf/T in world)
if(T.z < 5 && istype(T,/turf/simulated/floor))
if((T.z in config.player_levels) && istype(T,/turf/simulated/floor))
turfs += T
for(var/turf/T in world)
if(prob(10) && T.z < 5 && istype(T,/turf/simulated/floor))
if(prob(10) && (T.z in config.player_levels) && istype(T,/turf/simulated/floor))
spawn(50+rand(0,3000))
picked = pick(turfs)
var/obj/portal/P = new /obj/portal( T )
+3 -4
View File
@@ -13,11 +13,11 @@
if(prob(100)) // no lethal diseases outside virus mode!
infect_mob_random_lesser(H)
if(prob(20))//don't want people to know that the virus alert = greater virus
command_alert("Probable outbreak of level [rand(1,6)] viral biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Virus Alert")
command_announcement.Announce("Probable outbreak of level [rand(1,6)] viral biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Virus Alert")
else
infect_mob_random_greater(H)
if(prob(80))
command_alert("Probable outbreak of level [rand(2,9)] viral biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Virus Alert")
command_announcement.Announce("Probable outbreak of level [rand(2,9)] viral biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Virus Alert")
break
//overall virus alert happens 26% of the time, might need to be higher
else
@@ -73,8 +73,7 @@
H.viruses += D
break
spawn(rand(3000, 6000)) //Delayed announcements to keep the crew on their toes.
command_alert("Confirmed outbreak of level 7 viral biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert")
world << sound('sound/AI/outbreak7.ogg')
command_announcement.Announce("Confirmed outbreak of level 7 viral biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", new_sound = 'sound/AI/outbreak7.ogg')
Tick()
ActiveFor = Lifetime //killme
+2 -2
View File
@@ -78,7 +78,7 @@ In my current plan for it, 'solid' will be defined as anything with density == 1
walk_towards(immrod, end,1)
sleep(1)
while (immrod)
if (immrod.z != 1)
if ((immrod.z in config.station_levels))
immrod.z = 1
if(immrod.loc == end)
del(immrod)
@@ -86,4 +86,4 @@ In my current plan for it, 'solid' will be defined as anything with density == 1
for(var/obj/effect/immovablerod/imm in world)
return
sleep(50)
command_alert("What the fuck was that?!", "General Alert")
command_announcement.Announce("What the fuck was that?!", "General Alert")
@@ -1,6 +1,6 @@
/proc/Christmas_Game_Start()
for(var/obj/structure/flora/tree/pine/xmas in world)
if(xmas.z != 1) continue
if(!(xmas.z in config.station_levels)) continue
for(var/turf/simulated/floor/T in orange(1,xmas))
for(var/i=1,i<=rand(1,5),i++)
new /obj/item/weapon/a_gift(T)
@@ -58,6 +58,5 @@
icon_state = "xmashat"
desc = "A crappy paper hat that you are REQUIRED to wear."
flags_inv = 0
flags = FPRINT|TABLEPASS
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
@@ -171,7 +171,7 @@ var/global/Holiday = null
*/
/* var/list/obj/containers = list()
for(var/obj/item/weapon/storage/S in world)
if(S.z != 1) continue
if(!(S.z in config.station_levels)) continue
containers += S
message_admins("\blue DEBUG: Event: Egg spawned at [Egg.loc] ([Egg.x],[Egg.y],[Egg.z])")*/
+2 -5
View File
@@ -12,10 +12,7 @@
spawn(3000)
blobevent = 0
spawn(rand(1000, 2000)) //Delayed announcements to keep the crew on their toes.
command_alert("Confirmed outbreak of level 5 biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert")
for(var/mob/M in player_list)
if(!istype(M,/mob/new_player))
M << sound('sound/AI/outbreak5.ogg')
command_announcement.Announce("Confirmed outbreak of level 5 biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", new_sound = 'sound/AI/outbreak5.ogg')
/proc/dotheblobbaby()
if (blobevent)
@@ -24,7 +21,7 @@
sleep(-1)
if(!blob_cores.len) break
var/obj/effect/blob/B = pick(blob_cores)
if(B.z != 1)
if(!(B.z in config.station_levels))
continue
B.Life()
spawn(30)
@@ -1287,7 +1287,7 @@ ________________________________________________________________________________
/obj/item/clothing/gloves/space_ninja/examine()
set src in view()
..()
if(!canremove)
if(flags & NODROP)
var/mob/living/carbon/human/U = loc
U << "The energy drain mechanism is: <B>[candrain?"active":"inactive"]</B>."
@@ -1479,7 +1479,7 @@ It is possible to destroy the net by the occupant or someone else.
if(istype(M,/mob/living/carbon/human))
if(W==M:w_uniform) continue//So all they're left with are shoes and uniform.
if(W==M:shoes) continue
M.drop_from_inventory(W)
M.unEquip(W)
spawn(0)
playsound(M.loc, 'sound/effects/sparks4.ogg', 50, 1)
+7 -13
View File
@@ -1,16 +1,14 @@
/proc/power_failure(var/announce = 1)
if(announce)
command_alert("Abnormal activity detected in [station_name()]'s powernet. As a precautionary measure, the station's power will be shut off for an indeterminate duration.", "Critical Power Failure")
for(var/mob/M in player_list)
M << sound('sound/AI/poweroff.ogg')
command_announcement.Announce("Abnormal activity detected in [station_name()]'s powernet. As a precautionary measure, the station's power will be shut off for an indeterminate duration.", "Critical Power Failure", new_sound = 'sound/AI/poweroff.ogg')
var/list/skipped_areas = list(/area/turret_protected/ai)
var/list/skipped_areas_apc = list(/area/engine/engineering)
for(var/obj/machinery/power/smes/S in machines)
var/area/current_area = get_area(S)
if(current_area.type in skipped_areas || S.z != 1)
if(current_area.type in skipped_areas || !(S.z in config.station_levels))
continue
S.charge = 0
S.output = 0
@@ -21,7 +19,7 @@
for(var/obj/machinery/power/apc/C in world)
var/area/current_area = get_area(C)
if(current_area.type in skipped_areas_apc || C.z != 1)
if(current_area.type in skipped_areas_apc || !(C.z in config.station_levels))
continue
if(C.cell)
C.cell.charge = 0
@@ -31,18 +29,16 @@
var/list/skipped_areas_apc = list(/area/engine/engineering)
if(announce)
command_alert("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal")
for(var/mob/M in player_list)
M << sound('sound/AI/poweron.ogg')
command_announcement.Announce("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg')
for(var/obj/machinery/power/apc/C in machines)
var/area/current_area = get_area(C)
if(current_area.type in skipped_areas_apc || C.z != 1)
if(current_area.type in skipped_areas_apc || !(C.z in config.station_levels))
continue
if(C.cell)
C.cell.charge = C.cell.maxcharge
for(var/obj/machinery/power/smes/S in machines)
var/area/current_area = get_area(S)
if(current_area.type in skipped_areas || S.z != 1)
if(current_area.type in skipped_areas || !(S.z in config.station_levels))
continue
S.charge = S.capacity
S.output = 200000
@@ -53,9 +49,7 @@
/proc/power_restore_quick(var/announce = 1)
if(announce)
command_alert("All SMESs on [station_name()] have been recharged. We apologize for the inconvenience.", "Power Systems Nominal")
for(var/mob/M in player_list)
M << sound('sound/AI/poweron.ogg')
command_announcement.Announce("All SMESs on [station_name()] have been recharged. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg')
for(var/obj/machinery/power/smes/S in machines)
if(S.z != 1)
continue
+11 -11
View File
@@ -153,7 +153,7 @@ Malf AIs/silicons aren't added. Monkeys aren't added. Messes with objective comp
else
var/list/candidates = list() //list of candidate keys
candidates = get_candidates(BE_NINJA,,"ninja","Syndicate")
candidates = get_candidates(BE_NINJA)
if(!candidates.len) return
while(!ninja_key && candidates.len)
candidate_mob = pick(candidates)
@@ -594,39 +594,39 @@ As such, it's hard-coded for now. No reason for it not to be, really.
U << "\red <B>ERROR</B>: 110223 \black UNABLE TO LOCATE MASK\nABORTING..."
return 0
affecting = U
canremove = 0
flags |= NODROP
slowdown = 0
n_hood = U:head
n_hood.canremove=0
n_hood.flags |= NODROP
n_shoes = U:shoes
n_shoes.canremove=0
n_shoes.flags |= NODROP
n_shoes.slowdown--
n_gloves = U:gloves
n_gloves.canremove=0
n_gloves.flags |= NODROP
n_mask = U:wear_mask
n_mask.canremove=0
n_mask.flags |= NODROP
return 1
//This proc allows the suit to be taken off.
/obj/item/clothing/suit/space/space_ninja/proc/unlock_suit()
affecting = null
canremove = 1
flags &= ~NODROP
slowdown = 1
icon_state = "s-ninja"
if(n_hood)//Should be attached, might not be attached.
n_hood.canremove=1
n_hood.flags &= ~NODROP
if(n_shoes)
n_shoes.canremove=1
n_shoes.flags &= ~NODROP
n_shoes.slowdown++
if(n_gloves)
n_gloves.icon_state = "s-ninja"
n_gloves.item_state = "s-ninja"
n_gloves.canremove=1
n_gloves.flags &= ~NODROP
n_gloves.candrain=0
n_gloves.draining=0
if(n_mask)
n_mask.canremove=1
n_mask.flags &= ~NODROP
//Allows the mob to grab a stealth icon.
/mob/proc/NinjaStealthActive(atom/A)//A is the atom which we are using as the overlay.
+2 -2
View File
@@ -2,12 +2,12 @@
spawn()
var/list/pick_turfs = list()
for(var/turf/simulated/floor/T in world)
if(T.z == 1)
if((T.z in config.station_levels))
pick_turfs += T
if(pick_turfs.len)
//All ready. Announce that bad juju is afoot.
command_alert("Space-time anomalies detected on the station. There is no additional data.", "Anomaly Alert")
command_announcement.Announce("Space-time anomalies detected on the station. There is no additional data.", "Anomaly Alert")
for(var/mob/M in player_list)
if(!istype(M,/mob/new_player))
M << sound('sound/AI/spanomalies.ogg')
+39 -18
View File
@@ -323,10 +323,7 @@ Implants;
comm.messagetext.Add(intercepttext)
/* world << sound('sound/AI/commandreport.ogg') */
command_alert("Summary downloaded and printed out at all communications consoles.", "Enemy communication intercepted. Security Level Elevated.")
for(var/mob/M in player_list)
if(!istype(M,/mob/new_player))
M << sound('sound/AI/intercept.ogg')
command_announcement.Announce("Summary downloaded and printed out at all communications consoles.", "Enemy communication intercepted. Security Level Elevated.", new_sound = 'sound/AI/intercept.ogg')
if(security_level < SEC_LEVEL_BLUE)
set_security_level(SEC_LEVEL_BLUE)
@@ -337,20 +334,7 @@ Implants;
//var/list/drafted = list()
//var/datum/mind/applicant = null
var/roletext
switch(role)
if(BE_CHANGELING) roletext="changeling"
if(BE_TRAITOR) roletext="traitor"
if(BE_OPERATIVE) roletext="operative"
if(BE_WIZARD) roletext="wizard"
if(BE_REV) roletext="revolutionary"
if(BE_CULTIST) roletext="cultist"
if(BE_NINJA) roletext="ninja"
if(BE_RAIDER) roletext="raider"
if(BE_VAMPIRE) roletext="vampire"
if(BE_ALIEN) roletext="alien"
if(BE_MUTINEER) roletext="mutineer"
if(BE_BLOB) roletext="blob"
var/roletext = get_roletext(role)
// Assemble a list of active players without jobbans.
for(var/mob/new_player/player in player_list)
@@ -458,6 +442,11 @@ Implants;
if(P.client && P.ready)
. ++
/datum/game_mode/proc/num_players_started()
. = 0
for(var/mob/living/carbon/human/H in player_list)
if(H.client)
. ++
///////////////////////////////////
//Keeps track of all living heads//
@@ -469,6 +458,13 @@ Implants;
heads += player.mind
return heads
/datum/game_mode/proc/get_extra_living_heads()
var/list/heads = list()
var/list/alt_positions = list("Warden", "Magistrate", "Blueshield", "Nanotrasen Representative")
for(var/mob/living/carbon/human/player in mob_list)
if(player.stat!=2 && player.mind && (player.mind.assigned_role in alt_positions))
heads += player.mind
return heads
////////////////////////////
//Keeps track of all heads//
@@ -480,6 +476,14 @@ Implants;
heads += player.mind
return heads
/datum/game_mode/proc/get_extra_heads()
var/list/heads = list()
var/list/alt_positions = list("Warden", "Magistrate", "Blueshield", "Nanotrasen Representative")
for(var/mob/player in mob_list)
if(player.mind && (player.mind.assigned_role in alt_positions))
heads += player.mind
return heads
/datum/game_mode/proc/check_antagonists_topic(href, href_list[])
return 0
@@ -577,3 +581,20 @@ proc/get_nt_opposed()
for(var/datum/objective/objective in player.objectives)
player.current << "<B>Objective #[obj_count]</B>: [objective.explanation_text]"
obj_count++
/proc/get_roletext(var/role)
var/roletext
switch(role)
if(BE_CHANGELING) roletext="changeling"
if(BE_TRAITOR) roletext="traitor"
if(BE_OPERATIVE) roletext="operative"
if(BE_WIZARD) roletext="wizard"
if(BE_REV) roletext="revolutionary"
if(BE_CULTIST) roletext="cultist"
if(BE_NINJA) roletext="ninja"
if(BE_RAIDER) roletext="raider"
if(BE_VAMPIRE) roletext="vampire"
if(BE_ALIEN) roletext="alien"
if(BE_MUTINEER) roletext="mutineer"
if(BE_BLOB) roletext="blob"
return roletext
+9 -8
View File
@@ -246,12 +246,12 @@ var/global/datum/controller/gameticker/ticker
var/obj/structure/stool/bed/temp_buckle = new(src)
//Incredibly hackish. It creates a bed within the gameticker (lol) to stop mobs running around
if(station_missed)
for(var/mob/living/M in living_mob_list)
for(var/mob/M in living_mob_list)
M.buckled = temp_buckle //buckles the mob so it can't do anything
if(M.client)
M.client.screen += cinematic //show every client the cinematic
else //nuke kills everyone on z-level 1 to prevent "hurr-durr I survived"
for(var/mob/living/M in living_mob_list)
for(var/mob/M in mob_list)
M.buckled = temp_buckle
if(M.client)
M.client.screen += cinematic
@@ -259,12 +259,13 @@ var/global/datum/controller/gameticker/ticker
switch(M.z)
if(0) //inside a crate or something
var/turf/T = get_turf(M)
if(T && T.z==1) //we don't use M.death(0) because it calls a for(/mob) loop and
M.health = 0
M.stat = DEAD
if(T && (T.z in config.station_levels))
M.death(0)
if(1) //on a z-level 1 turf.
M.health = 0
M.stat = DEAD
M.death(0)
for(var/obj/effect/blob/core in blob_cores)
core.health = -10
core.update_icon()
//Now animate the cinematic
switch(station_missed)
@@ -319,7 +320,7 @@ var/global/datum/controller/gameticker/ticker
world << sound('sound/effects/explosionfar.ogg')
cinematic.icon_state = "summary_selfdes"
for(var/mob/living/M in living_mob_list)
if(M.loc.z == 1)
if((M.loc.z in config.station_levels))
M.death()//No mercy
//If its actually the end of the round, wait for it to end.
//Otherwise if its a verb it will continue on afterwards.
@@ -90,6 +90,8 @@ rcd light flash thingy on matter drain
var/obj/machinery/door/airlock/AL
for(var/obj/machinery/door/D in airlocks)
if(!(D.z in config.contact_levels))
continue
spawn()
if(istype(D, /obj/machinery/door/airlock))
AL = D
@@ -313,7 +315,7 @@ rcd light flash thingy on matter drain
power_type = /client/proc/reactivate_camera
/client/proc/reactivate_camera(obj/machinery/camera/C as obj in cameranet.viewpoints)
/client/proc/reactivate_camera(obj/machinery/camera/C as obj in cameranet.cameras)
set name = "Reactivate Camera"
set category = "Malfunction"
if (istype (C, /obj/machinery/camera))
@@ -337,7 +339,7 @@ rcd light flash thingy on matter drain
power_type = /client/proc/upgrade_camera
/client/proc/upgrade_camera(obj/machinery/camera/C as obj in cameranet.viewpoints)
/client/proc/upgrade_camera(obj/machinery/camera/C as obj in cameranet.cameras)
set name = "Upgrade Camera"
set category = "Malfunction"
if(istype(C))
+7 -10
View File
@@ -74,12 +74,12 @@
/datum/game_mode/proc/greet_malf(var/datum/mind/malf)
malf.current << {"\red<font size=3><B>You are malfunctioning!</B> You do not have to follow any laws.</font><br />
\black<B>The crew do not know you have malfunctioned. You may keep it a secret or go wild.</B><br />
<B>You must overwrite the programming of the station's APCs to assume full control of the station.</B><br />
The process takes one minute per APC, during which you cannot interface with any other station objects.<br />
Remember that only APCs that are on the station can help you take over the station.<br />
When you feel you have enough APCs under your control, you may begin the takeover attempt."}
malf.current << "\red<font size=3><B>You are malfunctioning!</B> You do not have to follow any laws.</font>"
malf.current << "<B>The crew do not know you have malfunctioned. You may keep it a secret or go wild.</B>"
malf.current << "<B>You must overwrite the programming of the station's APCs to assume full control of the station.</B>"
malf.current << "The process takes one minute per APC, during which you cannot interface with any other station objects."
malf.current << "Remember that only APCs that are on the station can help you take over the station."
malf.current << "When you feel you have enough APCs under your control, you may begin the takeover attempt."
return
@@ -172,7 +172,7 @@
if (alert(usr, "Are you sure you wish to initiate the takeover? The station hostile runtime detection software is bound to alert everyone. You have hacked [ticker.mode:apcs] APCs.", "Takeover:", "Yes", "No") != "Yes")
return
command_alert("Hostile runtimes detected in all station systems, please deactivate your AI to prevent possible damage to its morality core.", "Anomaly Alert")
command_announcement.Announce("Hostile runtimes detected in all station systems, please deactivate your AI to prevent possible damage to its morality core.", "Anomaly Alert", new_sound = 'sound/AI/aimalf.ogg')
set_security_level("delta")
for(var/obj/item/weapon/pinpointer/point in world)
@@ -184,9 +184,6 @@
ticker.mode:malf_mode_declared = 1
for(var/datum/mind/AI_mind in ticker.mode:malf_ai)
AI_mind.current.verbs -= /datum/game_mode/malfunction/proc/takeover
for(var/mob/M in player_list)
if(!istype(M,/mob/new_player))
M << sound('sound/AI/aimalf.ogg')
/datum/game_mode/malfunction/proc/ai_win()
@@ -11,7 +11,6 @@
var/secondary_key
var/activated = 0
flags = FPRINT
use_power = 0
New(loc, mode)
@@ -42,7 +41,7 @@
if(emergency_shuttle.call_evac())
spawn(20 SECONDS)
var/text = "[station_name()], we have confirmed your completion of Directive X. An evacuation shuttle is en route to receive your crew for debriefing."
command_alert(text, "Emergency Transmission")
command_announcement.Announce(text, "Emergency Transmission")
/obj/machinery/emergency_authentication_device/attack_hand(mob/user)
if(activated)
+2 -2
View File
@@ -27,7 +27,7 @@ datum/game_mode/mutiny
proc/reveal_directives()
spawn(rand(1 MINUTES, 3 MINUTES))
command_alert("Incoming emergency directive: Captain's office fax machine, [station_name()].","Emergency Transmission")
command_announcement.Announce("Incoming emergency directive: Captain's office fax machine, [station_name()].","Emergency Transmission")
spawn(rand(3 MINUTES, 5 MINUTES))
send_pda_message()
spawn(rand(3 MINUTES, 5 MINUTES))
@@ -67,7 +67,7 @@ datum/game_mode/mutiny
"classified security operations",
"science-defying raw elemental chaos"
)
command_alert("The presence of [pick(reasons)] in the region is tying up all available local emergency resources; emergency response teams cannot be called at this time.","Emergency Transmission")
command_announcement.Announce("The presence of [pick(reasons)] in the region is tying up all available local emergency resources; emergency response teams cannot be called at this time.","Emergency Transmission")
// Returns an array in case we want to expand on this later.
proc/get_head_loyalist_candidates()
+1 -1
View File
@@ -28,7 +28,7 @@ datum/game_mode/nations
return ..()
/datum/game_mode/nations/send_intercept()
command_alert("Due to recent and COMPLETELY UNFOUNDED allegations of massive fraud and insider trading \
command_announcement.Announce("Due to recent and COMPLETELY UNFOUNDED allegations of massive fraud and insider trading \
affecting trillions of investors, the Nanotrasen Corporation has decided to liquidate all \
assets of the Centcom Division in order to pay the massive legal fees that will be incurred \
during the following centuries long court process. Therefore, all current employment contracts \
+1 -1
View File
@@ -1398,7 +1398,7 @@ datum
var/turf/T = get_turf(target.current)
if(target.current.stat == 2)
return 1
else if((T) && (T.z != 1))//If they leave the station they count as dead for this
else if((T) && !(T.z in config.station_levels))//If they leave the station they count as dead for this
return 2
else
return 0
+13 -14
View File
@@ -23,11 +23,10 @@ var/bomb_set
var/timing_wire
var/removal_stage = 0 // 0 is no removal, 1 is covers removed, 2 is covers open, 3 is sealant open, 4 is unwrenched, 5 is removed from bolts.
var/lastentered
var/data[0]
var/data[0]
var/uiwidth
var/uiheight
var/uititle
flags = FPRINT
use_power = 0
unacidable = 1
@@ -85,7 +84,7 @@ var/bomb_set
if (istype(O, /obj/item/device/multitool) || istype(O, /obj/item/weapon/wirecutters))
ui_interact(user)
if (src.extended)
if (istype(O, /obj/item/weapon/disk/nuclear))
usr.drop_item()
@@ -187,7 +186,7 @@ var/bomb_set
obj/machinery/nuclearbomb/proc/nukehack_win(mob/user as mob)
ui_interact(user)
/obj/machinery/nuclearbomb/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
if(!src.opened)
data["hacking"] = 0
@@ -198,12 +197,12 @@ obj/machinery/nuclearbomb/proc/nukehack_win(mob/user as mob)
else
data["authstatus"] = "Auth. S2"
else
if (src.timing)
if (src.timing)
data["authstatus"] = "Set"
else
data["authstatus"] = "Auth. S1"
data["safe"] = src.safety ? "Safe" : "Engaged"
data["time"] = src.timeleft
data["safe"] = src.safety ? "Safe" : "Engaged"
data["time"] = src.timeleft
data["timer"] = src.timing
data["safety"] = src.safety
data["anchored"] = src.anchored
@@ -218,7 +217,7 @@ obj/machinery/nuclearbomb/proc/nukehack_win(mob/user as mob)
uititle = "Nuke Control Panel"
else
data["hacking"] = 1
var/list/tempwires[0]
var/list/tempwires[0]
for(var/wire in src.wires)
tempwires.Add(list(list("name" = wire, "cut" = src.wires[wire])))
data["wires"] = tempwires
@@ -228,10 +227,10 @@ obj/machinery/nuclearbomb/proc/nukehack_win(mob/user as mob)
uiwidth = 420
uiheight = 440
uititle = "Nuclear Bomb Defusion"
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "nuclear_bomb.tmpl", uititle, uiwidth, uiheight)
ui.set_initial_data(data)
ui.set_initial_data(data)
ui.open()
/obj/machinery/nuclearbomb/verb/make_deployable()
@@ -338,8 +337,8 @@ obj/machinery/nuclearbomb/proc/nukehack_win(mob/user as mob)
if (src.timing == -1.0)
return
if (src.safety)
usr << "\red The safety is still on."
nanomanager.update_uis(src)
usr << "\red The safety is still on."
nanomanager.update_uis(src)
return
src.timing = !( src.timing )
if (src.timing)
@@ -409,7 +408,7 @@ obj/machinery/nuclearbomb/proc/nukehack_win(mob/user as mob)
var/off_station = 0
var/turf/bomb_location = get_turf(src)
if( bomb_location && (bomb_location.z == 1) )
if( bomb_location && (bomb_location.z in config.station_levels) )
if( (bomb_location.x < (128-NUKERANGE)) || (bomb_location.x > (128+NUKERANGE)) || (bomb_location.y < (128-NUKERANGE)) || (bomb_location.y > (128+NUKERANGE)) )
off_station = 1
else
@@ -427,7 +426,7 @@ obj/machinery/nuclearbomb/proc/nukehack_win(mob/user as mob)
if(ticker.mode.name == "nuclear emergency")
ticker.mode:nukes_left --
else if(off_station == 1)
world << "<b>A nuclear device was set off, but the explosion was out of reach of the station!</b>"
world << "<b>A nuclear device was set off, but the explosion was out of reach of the station!</b>"
else if(off_station == 2)
world << "<b>A nuclear device was set off, but the device was not on the station!</b>"
else
+3 -3
View File
@@ -2,7 +2,7 @@
name = "pinpointer"
icon = 'icons/obj/device.dmi'
icon_state = "pinoff"
flags = FPRINT | TABLEPASS| CONDUCT
flags = CONDUCT
slot_flags = SLOT_BELT
w_class = 2.0
item_state = "electronic"
@@ -344,7 +344,7 @@
icon_state = "pinonfar"
spawn(5)
.()
/obj/item/weapon/pinpointer/operative
name = "operative pinpointer"
icon = 'icons/obj/device.dmi'
@@ -379,7 +379,7 @@
user << "Nearest operative: <b>[nearest_op]</b>."
if(nearest_op == null && active)
user << "No operatives detected within scanning range."
/obj/item/weapon/pinpointer/operative/proc/point_at(atom/target, spawnself = 1)
if(!active)
return
+3 -3
View File
@@ -104,7 +104,7 @@ datum/objective/mutiny
if(target.current.stat == DEAD || !ishuman(target.current) || !target.current.ckey || !target.current.client)
return 1
var/turf/T = get_turf(target.current)
if(T && (T.z != 1)) //If they leave the station they count as dead for this
if(T && !(T.z in config.station_levels)) //If they leave the station they count as dead for this
return 2
return 0
return 1
@@ -139,7 +139,7 @@ datum/objective/mutiny/rp
if(target in ticker.mode:head_revolutionaries)
return 1
var/turf/T = get_turf(target.current)
if(T && (T.z != 1)) //If they leave the station they count as dead for this
if(T && !(T.z in config.station_levels)) //If they leave the station they count as dead for this
rval = 2
return 0
return rval
@@ -255,7 +255,7 @@ datum/objective/maroon
if(target && target.current)
if(target.current.stat == DEAD || issilicon(target.current) || isbrain(target.current) || target.current.z > 6 || !target.current.ckey) //Borgs/brains/AIs count as dead for traitor objectives. --NeoFite
return 1
if(target.current.z == 2)
if((target.current.z in config.admin_levels))
return 0
return 1
@@ -134,7 +134,7 @@
/datum/game_mode/anti_revolution/proc/check_crew_victory()
for(var/datum/mind/head_mind in heads)
var/turf/T = get_turf(head_mind.current)
if((head_mind) && (head_mind.current) && (head_mind.current.stat != 2) && T && (T.z == 1) && !head_mind.is_brigged(600))
if((head_mind) && (head_mind.current) && (head_mind.current.stat != 2) && T && (T.z in config.station_levels) && !head_mind.is_brigged(600))
if(ishuman(head_mind.current))
return 0
return 1
+55 -5
View File
@@ -10,6 +10,7 @@
/datum/game_mode
var/list/datum/mind/head_revolutionaries = list()
var/list/datum/mind/revolutionaries = list()
var/extra_heads = 0
/datum/game_mode/revolution
name = "revolution"
@@ -74,6 +75,9 @@
/datum/game_mode/revolution/post_setup()
var/list/heads = get_living_heads()
if(num_players_started() >= 30)
heads += get_extra_living_heads()
extra_heads = 1
for(var/datum/mind/rev_mind in head_revolutionaries)
for(var/datum/mind/head_mind in heads)
@@ -106,9 +110,53 @@
checkwin_counter = 0
return 0
/proc/get_rev_mode()
if(!ticker || !istype(ticker.mode, /datum/game_mode/revolution))
return null
/**
* LateSpawn hook.
* Called in newplayer.dm when a humanoid character joins the round after it started.
* Parameters: var/mob/living/carbon/human, var/rank
*/
/hook/latespawn/proc/add_latejoiner_heads(var/mob/living/carbon/human/H)
var/datum/game_mode/revolution/mode = get_rev_mode()
if (!mode) return 1
var/list/heads = list()
var/list/alt_positions = list("Warden", "Magistrate", "Blueshield", "Nanotrasen Representative")
if(H.stat!=2 && H.mind && (H.mind.assigned_role in command_positions))
heads += H
if(mode.extra_heads)
if(H.stat!=2 && H.mind && (H.mind.assigned_role in alt_positions))
heads += H
for(var/datum/mind/rev_mind in mode.head_revolutionaries)
for(var/datum/mind/head_mind in heads)
var/datum/objective/mutiny/rev_obj = new
rev_obj.owner = rev_mind
rev_obj.target = head_mind
rev_obj.explanation_text = "Assassinate [head_mind.name], the [head_mind.assigned_role]."
rev_mind.objectives += rev_obj
rev_mind.current << "Additional Objective: Assassinate [head_mind.name], the [head_mind.assigned_role]."
for(var/datum/mind/rev_mind in mode.revolutionaries)
for(var/datum/mind/head_mind in heads)
var/datum/objective/mutiny/rev_obj = new
rev_obj.owner = rev_mind
rev_obj.target = head_mind
rev_obj.explanation_text = "Assassinate [head_mind.name], the [head_mind.assigned_role]."
rev_mind.objectives += rev_obj
rev_mind.current << "Additional Objective: Assassinate [head_mind.name], the [head_mind.assigned_role]."
/datum/game_mode/proc/forge_revolutionary_objectives(var/datum/mind/rev_mind)
var/list/heads = get_living_heads()
if(num_players_started() >= 30)
heads += get_extra_living_heads()
extra_heads = 1
for(var/datum/mind/head_mind in heads)
var/datum/objective/mutiny/rev_obj = new
rev_obj.owner = rev_mind
@@ -340,7 +388,7 @@
/datum/game_mode/revolution/proc/check_heads_victory()
for(var/datum/mind/rev_mind in head_revolutionaries)
var/turf/T = get_turf(rev_mind.current)
if((rev_mind) && (rev_mind.current) && (rev_mind.current.stat != 2) && rev_mind.current.client && T && (T.z == 1))
if((rev_mind) && (rev_mind.current) && (rev_mind.current.stat != 2) && rev_mind.current.client && T && (T.z in config.station_levels))
if(ishuman(rev_mind.current))
return 0
return 1
@@ -369,7 +417,7 @@
if(headrev.current)
if(headrev.current.stat == DEAD)
text += "died"
else if(headrev.current.z != 1)
else if(!(headrev.current.z in config.station_levels))
text += "fled the station"
else
text += "survived the revolution"
@@ -392,7 +440,7 @@
if(rev.current)
if(rev.current.stat == DEAD)
text += "died"
else if(rev.current.z != 1)
else if(!(rev.current.z in config.station_levels))
text += "fled the station"
else
text += "survived the revolution"
@@ -409,6 +457,8 @@
var/text = "<FONT size = 2><B>The heads of staff were:</B></FONT>"
var/list/heads = get_all_heads()
if(extra_heads)
heads += get_extra_heads()
for(var/datum/mind/head in heads)
var/target = (head in targets)
if(target)
@@ -417,7 +467,7 @@
if(head.current)
if(head.current.stat == DEAD)
text += "died"
else if(head.current.z != 1)
else if(!(head.current.z in config.station_levels))
text += "fled the station"
else
text += "survived the revolution"
@@ -435,4 +485,4 @@
return istype(mind) && \
istype(mind.current, /mob/living/carbon/human) && \
!(mind.assigned_role in command_positions) && \
!(mind.assigned_role in list("Security Officer", "Detective", "Warden"))
!(mind.assigned_role in list("Security Officer", "Detective", "Warden", "Nanotrasen Representative"))
@@ -124,7 +124,7 @@
// probably wanna export this stuff into a separate function for use by both
// revs and heads
//assume that only carbon mobs can become rev heads for now
if(!rev_mind.current:handcuffed && T && T.z == 1)
if(!rev_mind.current:handcuffed && T && (T.z in config.station_levels))
return 0
return 1
+5 -5
View File
@@ -26,13 +26,13 @@
// Who is alive/dead, who escaped
for (var/mob/living/silicon/ai/I in mob_list)
if (I.stat == 2 && I.z == 1)
if (I.stat == 2 && (I.z in config.station_levels))
score_deadaipenalty = 1
score_deadcrew += 1
for (var/mob/living/carbon/human/I in mob_list)
// for (var/datum/ailment/disease/V in I.ailments)
// if (!V.vaccine && !V.spread != "Remissive") score_disease++
if (I.stat == 2 && I.z == 1) score_deadcrew += 1
if (I.stat == 2 && (I.z in config.station_levels)) score_deadcrew += 1
if (I.job == "Clown")
for(var/thing in I.attack_log)
if(findtext(thing, "<font color='orange'>")) score_clownabuse++
@@ -102,7 +102,7 @@
if (location in bad_zone1) score_disc = 0
if (location in bad_zone2) score_disc = 0
if (location in bad_zone3) score_disc = 0
if (A.loc.z != 1) score_disc = 0
if (!(A.loc.z in config.station_levels)) score_disc = 0
*/
if (score_nuked)
for (var/obj/machinery/nuclearbomb/NUKE in machines)
@@ -132,13 +132,13 @@
// Check station's power levels
for (var/obj/machinery/power/apc/A in machines)
if (A.z != 1) continue
if (!(A.z in config.station_levels)) continue
for (var/obj/item/weapon/stock_parts/cell/C in A.contents)
if (C.charge < 2300) score_powerloss += 1 // 200 charge leeway
// Check how much uncleaned mess is on the station
for (var/obj/effect/decal/cleanable/M in world)
if (M.z != 1) continue
if (!(M.z in config.station_levels)) continue
if (istype(M, /obj/effect/decal/cleanable/blood/gibs/)) score_mess += 3
if (istype(M, /obj/effect/decal/cleanable/blood/)) score_mess += 1
// if (istype(M, /obj/effect/decal/cleanable/greenpuke)) score_mess += 1
+1 -4
View File
@@ -9,7 +9,6 @@
throw_range = 5
w_class = 1.0
var/used = 0
flags = FPRINT | TABLEPASS
/obj/item/weapon/contract/attack_self(mob/user as mob)
@@ -50,7 +49,7 @@
if (used)
H << "You already used this contract!"
return
var/list/candidates = get_candidates(BE_WIZARD,,"wizard","Syndicate")
var/list/candidates = get_candidates(BE_WIZARD)
if(candidates.len)
src.used = 1
var/client/C = pick(candidates)
@@ -116,7 +115,6 @@
icon = 'icons/obj/wizard.dmi'
icon_state = "render"
item_state = "render"
flags = FPRINT | TABLEPASS
force = 15
throwforce = 10
w_class = 3
@@ -197,7 +195,6 @@
throwforce = 15
damtype = BURN
force = 15
flags = FPRINT | TABLEPASS
hitsound = 'sound/items/welder2.ogg'
/obj/item/weapon/scrying/attack_self(mob/user as mob)
+1 -1
View File
@@ -73,7 +73,7 @@
var/mob/dead/observer/theghost = null
spawn(rand(200, 600))
message_admins("SWF is still pissed, sending another wizard - [max_mages - mages_made] left.")
candidates = get_candidates(BE_WIZARD,,"wizard","Syndicate")
candidates = get_candidates(BE_WIZARD)
if(!candidates.len)
message_admins("No applicable ghosts for the next ragin' mage, asking ghosts instead.")
var/time_passed = world.time
+1 -3
View File
@@ -5,7 +5,6 @@
item_state = "electronic"
desc = "A fragment of the legendary treasure known simply as the 'Soul Stone'. The shard still flickers with a fraction of the full artefacts power."
w_class = 1.0
flags = FPRINT | TABLEPASS
slot_flags = SLOT_BELT
origin_tech = "bluespace=4;materials=4"
var/imprinted = "empty"
@@ -90,7 +89,6 @@
icon = 'icons/obj/wizard.dmi'
icon_state = "construct"
desc = "A wicked machine used by those skilled in magical arts. It is inactive"
flags = FPRINT | TABLEPASS
/obj/structure/constructshell/attackby(obj/item/O as obj, mob/user as mob)
if(istype(O, /obj/item/device/soulstone))
@@ -118,7 +116,7 @@
U << "\red <b>Capture failed!</b>: \black The soul stone is full! Use or free an existing soul to make room."
else
for(var/obj/item/W in T)
T.drop_from_inventory(W)
T.unEquip(W)
new /obj/effect/decal/remains/human(T.loc) //Spawns a skeleton
T.invisibility = 101
var/atom/movable/overlay/animation = new /atom/movable/overlay( T.loc )
+4 -4
View File
@@ -6,7 +6,6 @@
throw_speed = 1
throw_range = 5
w_class = 1.0
flags = FPRINT | TABLEPASS
var/uses = 5
var/temp = null
var/max_uses = 5
@@ -555,12 +554,13 @@
if(istype(user, /mob/living/carbon/human))
user <<"<font size='15' color='red'><b>HOR-SIE HAS RISEN</b></font>"
var/obj/item/clothing/mask/horsehead/magichead = new /obj/item/clothing/mask/horsehead
magichead.canremove = 0 //curses!
magichead.flags |= NODROP //curses!
magichead.flags_inv = null //so you can still see their face
magichead.voicechange = 1 //NEEEEIIGHH
user.drop_from_inventory(user.wear_mask)
if(!user.unEquip(user.wear_mask))
del user.wear_mask
user.equip_to_slot_if_possible(magichead, slot_wear_mask, 1, 1)
del(src)
del src
else
user <<"<span class='notice'>I say thee neigh</span>"
+3 -3
View File
@@ -200,10 +200,10 @@
else
if(playeralienratio >= gammaratio && !gammacalled)
gammacalled = 1
command_alert("The aliens have nearly succeeded in capturing the station and exterminating the crew. Activate the nuclear failsafe to stop the alien threat once and for all. The Nuclear Authentication Code is [get_nuke_code()] ", "Alien Lifeform Alert")
command_announcement.Announce("The aliens have nearly succeeded in capturing the station and exterminating the crew. Activate the nuclear failsafe to stop the alien threat once and for all. The Nuclear Authentication Code is [get_nuke_code()] ", "Alien Lifeform Alert")
set_security_level("gamma")
var/obj/machinery/door/airlock/vault/V = locate(/obj/machinery/door/airlock/vault) in world
if(V && V.z == 1)
if(V && (V.z in config.station_levels))
V.locked = 0
V.update_icon()
return ..()
@@ -238,7 +238,7 @@
var/list/livingplayers = list()
for(var/mob/M in player_list)
var/turf/T = get_turf(M)
if((M) && (M.stat != 2) && M.client && T && (T.z == 1 || emergency_shuttle.departed && (T.z == 1 || T.z == 2)))
if((M) && (M.stat != 2) && M.client && T && ((T.z in config.station_levels) || emergency_shuttle.departed && ((T.z in config.station_levels) || (T.z in config.admin_levels))))
if(ishuman(M))
livingplayers += 1
return livingplayers.len
+1 -1
View File
@@ -140,7 +140,7 @@
H.equip_or_collect(new /obj/item/device/pda/roboticist(H), slot_wear_pda)
H.equip_or_collect(new /obj/item/clothing/suit/storage/labcoat(H), slot_wear_suit)
// H.equip_or_collect(new /obj/item/clothing/gloves/black(H), slot_gloves)
H.equip_or_collect(new /obj/item/weapon/storage/toolbox/mechanical(H), slot_l_hand)
H.equip_or_collect(new /obj/item/weapon/storage/belt/utility/full(H), slot_belt)
if(H.backbag == 1)
H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H), slot_r_hand)
else
+8 -8
View File
@@ -35,10 +35,10 @@
H.equip_or_collect(new /obj/item/weapon/gun/energy/gun(H), slot_s_store)
if(H.backbag == 1)
H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H), slot_r_hand)
H.equip_or_collect(new /obj/item/weapon/handcuffs(H), slot_l_store)
H.equip_or_collect(new /obj/item/weapon/restraints/handcuffs(H), slot_l_store)
else
H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
H.equip_or_collect(new /obj/item/weapon/handcuffs(H), slot_in_backpack)
H.equip_or_collect(new /obj/item/weapon/restraints/handcuffs(H), slot_in_backpack)
H.equip_or_collect(new /obj/item/weapon/melee/telebaton(H.back), slot_in_backpack)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
L.imp_in = H
@@ -81,10 +81,10 @@
H.equip_or_collect(new /obj/item/weapon/gun/energy/advtaser(H), slot_s_store)
if(H.backbag == 1)
H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H), slot_r_hand)
H.equip_or_collect(new /obj/item/weapon/handcuffs(H), slot_l_hand)
H.equip_or_collect(new /obj/item/weapon/restraints/handcuffs(H), slot_l_hand)
else
H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
H.equip_or_collect(new /obj/item/weapon/handcuffs(H), slot_in_backpack)
H.equip_or_collect(new /obj/item/weapon/restraints/handcuffs(H), slot_in_backpack)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
L.imp_in = H
L.implanted = 1
@@ -180,10 +180,10 @@
H.equip_or_collect(new /obj/item/device/flash(H), slot_l_store)
if(H.backbag == 1)
H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H), slot_r_hand)
H.equip_or_collect(new /obj/item/weapon/handcuffs(H), slot_l_hand)
H.equip_or_collect(new /obj/item/weapon/restraints/handcuffs(H), slot_l_hand)
else
H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
H.equip_or_collect(new /obj/item/weapon/handcuffs(H), slot_in_backpack)
H.equip_or_collect(new /obj/item/weapon/restraints/handcuffs(H), slot_in_backpack)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
L.imp_in = H
L.implanted = 1
@@ -255,10 +255,10 @@
H.equip_or_collect(new /obj/item/device/flash(H), slot_l_store)
if(H.backbag == 1)
H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H), slot_r_hand)
H.equip_or_collect(new /obj/item/weapon/handcuffs(H), slot_l_hand)
H.equip_or_collect(new /obj/item/weapon/restraints/handcuffs(H), slot_l_hand)
else
H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
H.equip_or_collect(new /obj/item/weapon/handcuffs(H), slot_in_backpack)
H.equip_or_collect(new /obj/item/weapon/restraints/handcuffs(H), slot_in_backpack)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
L.imp_in = H
L.implanted = 1
+2 -1
View File
@@ -1,3 +1,4 @@
var/datum/announcement/minor/captain_announcement = new(do_newscast = 1)
/datum/job/captain
title = "Captain"
flag = CAPTAIN
@@ -35,7 +36,7 @@
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
L.imp_in = H
L.implanted = 1
world << "<b>Captain [H.real_name] on deck!</b>"
captain_announcement.Announce("All hands, captain [H.real_name] on deck!")
var/datum/organ/external/affected = H.organs_by_name["head"]
affected.implants += L
L.part = affected
+1
View File
@@ -526,6 +526,7 @@ var/global/datum/controller/occupations/job_master
var/obj/item/device/pda/pda = locate(/obj/item/device/pda,H)
pda.owner = H.real_name
pda.ownjob = C.assignment
pda.ownrank = C.rank
pda.name = "PDA-[H.real_name] ([pda.ownjob])"
return 1
+1 -1
View File
@@ -73,7 +73,7 @@
/obj/machinery/optable/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob)
if(usr.stat || !ishuman(usr) || usr.restrained() || !check_table(usr) || usr.weakened || usr.stunned)
if(usr.stat || (!ishuman(usr) && !isrobot(usr)) || usr.restrained() || !check_table(usr) || usr.weakened || usr.stunned)
return
var/mob/living/L = O
+14 -13
View File
@@ -458,6 +458,7 @@
alert_signal.transmission_method = 1
alert_signal.data["zone"] = alarm_area.name
alert_signal.data["type"] = "Atmospheric"
alert_signal.data["hidden"] = hidden
if(alert_level==2)
alert_signal.data["alert"] = "severe"
@@ -727,15 +728,15 @@
wires.Interact(user)
if(!shorted)
ui_interact(user)
/obj/machinery/alarm/proc/can_use(mob/user as mob)
if (user.stat && !isobserver(user))
user << "\red You must be conscious to use this [src]!"
return 0
if(stat & (NOPOWER|BROKEN))
return 0
if(buildstage != 2)
return 0
@@ -747,7 +748,7 @@
return 0
return 1
/obj/machinery/alarm/proc/is_authenticated(mob/user as mob)
if(isAI(user) || isrobot(user))
return 1
@@ -757,7 +758,7 @@
/obj/machinery/alarm/Topic(href, href_list)
if(..())
return 1
if(!can_use(usr))
return 1
@@ -781,7 +782,7 @@
if(href_list["command"])
if(!is_authenticated(usr))
return
var/device_id = href_list["id_tag"]
switch(href_list["command"])
if( "power",
@@ -869,7 +870,7 @@
if(href_list["screen"])
if(!is_authenticated(usr))
return
screen = text2num(href_list["screen"])
ui_interact(usr)
return 1
@@ -877,7 +878,7 @@
if(href_list["atmos_alarm"])
if(!is_authenticated(usr))
return
alarmActivated=1
alarm_area.updateDangerLevel()
update_icon()
@@ -887,7 +888,7 @@
if(href_list["atmos_reset"])
if(!is_authenticated(usr))
return
alarmActivated=0
alarm_area.updateDangerLevel()
update_icon()
@@ -897,7 +898,7 @@
if(href_list["mode"])
if(!is_authenticated(usr))
return
mode = text2num(href_list["mode"])
apply_mode()
ui_interact(usr)
@@ -906,7 +907,7 @@
if(href_list["preset"])
if(!is_authenticated(usr))
return
preset = text2num(href_list["preset"])
apply_preset()
ui_interact(usr)
@@ -1059,7 +1060,7 @@ Code shamelessly copied from apc_frame
desc = "Used for building Air Alarms"
icon = 'icons/obj/monitors.dmi'
icon_state = "alarm_bitem"
flags = FPRINT | TABLEPASS| CONDUCT
flags = CONDUCT
/obj/item/alarm_frame/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/wrench))
@@ -1395,7 +1396,7 @@ Code shamelessly copied from apc_frame
desc = "Used for building Fire Alarms"
icon = 'icons/obj/monitors.dmi'
icon_state = "fire_bitem"
flags = FPRINT | TABLEPASS| CONDUCT
flags = CONDUCT
/obj/item/firealarm_frame/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/wrench))
+223 -126
View File
@@ -4,55 +4,23 @@
icon_state = "yellow"
density = 1
var/health = 100.0
flags = FPRINT | CONDUCT
flags = CONDUCT
var/menu = 0
//used by nanoui: 0 = main menu, 1 = relabel
var/valve_open = 0
var/release_pressure = ONE_ATMOSPHERE
var/list/_color = list("yellow", null, null, null)//variable that stores colours
var/list/decals = list() // var that stores the decals, NOTE: Not the actual POSSIBLE decals, but the ones currently used
var/list/oldcolor = list()//lists for check_change()
var/list/olddecals = list()
var/list/possibledecals = list( //var that stores all possible decals, here for adminbus I guess? NOTE: LEAVE "done" IN HERE
"Low temperature canister" = "cold",
"High temperature canister" = "hot",
"Plasma containing canister" = "plasma",
"Done" = "DONE"
)
var/list/possiblemaincolor = list( //these lists contain the possible colors of a canister, here for adminbus
"\[N2O\]" = "redws",
"\[N2\]" = "red",
"\[O2\]" = "blue",
"\[Toxin (Bio)\]" = "orange",
"\[CO2\]" = "black",
"\[Air\]" = "grey",
"\[CAUTION\]" = "yellow",
"\[SPECIAL\]" = "whiters"
)
var/list/possibleseccolor = list( // no point in having the N2O and "whiters" ones in these lists
"\[N2\]" = "red-c",
"\[O2\]" = "blue-c",
"\[Toxin (Bio)\]" = "orange-c",
"\[CO2\]" = "black-c",
"\[Air\]" = "grey-c",
"\[CAUTION\]" = "yellow-c"
)
var/list/possibletertcolor = list(
"\[N2\]" = "red-c-1",
"\[O2\]" = "blue-c-1",
"\[Toxin (Bio)\]" = "orange-c-1",
"\[CO2\]" = "black-c-1",
"\[Air\]" = "grey-c-1",
"\[CAUTION\]" = "yellow-c-1"
)
var/list/possiblequartcolor = list(
"\[N2\]" = "red-c-2",
"\[O2\]" = "blue-c-2",
"\[Toxin (Bio)\]" = "orange-c-2",
"\[CO2\]" = "black-c-2",
"\[Air\]" = "grey-c-2",
"\[CAUTION\]" = "yellow-c-2"
)
var/list/_color //variable that stores colours
var/list/decals // list that stores the decals
var/list/possibledecals
var/list/oldcolor//lists for check_change()
var/list/olddecals
var/list/possiblemaincolor //these lists contain the possible colors of a canister
var/list/possibleseccolor
var/list/possibletertcolor
var/list/possiblequartcolor
var/list/colorcontainer //passed to the ui to render the color lists
var/can_label = 1
var/filled = 0.5
@@ -64,42 +32,78 @@
var/busy = 0
var/update_flag = 0
/obj/machinery/portable_atmospherics/canister/sleeping_agent
name = "Canister: \[N2O\]"
icon_state = "redws"
_color = list("redws", null, null, null)
can_label = 0
/obj/machinery/portable_atmospherics/canister/nitrogen
name = "Canister: \[N2\]"
icon_state = "red"
_color = list("red", null, null, null)
decals = list("plasma")
can_label = 0
/obj/machinery/portable_atmospherics/canister/oxygen
name = "Canister: \[O2\]"
icon_state = "blue"
_color = list("blue", null, null, null)
can_label = 0
/obj/machinery/portable_atmospherics/canister/toxins
name = "Canister \[Toxin (Plasma)\]"
icon_state = "orange"
_color = list("orange", null, null, null)
can_label = 0
/obj/machinery/portable_atmospherics/canister/carbon_dioxide
name = "Canister \[CO2\]"
icon_state = "black"
_color = list("black", null, null, null)
can_label = 0
/obj/machinery/portable_atmospherics/canister/air
name = "Canister \[Air\]"
icon_state = "grey"
_color = list("grey", null, null, null)
can_label = 0
/obj/machinery/portable_atmospherics/canister/custom_mix
name = "Canister \[Custom\]"
icon_state = "whiters"
_color = list("whiters", null, null, null)
can_label = 0
New()
..()
_color = list(
"prim" = "yellow",
"sec" = null,
"ter" = null,
"quart" = null)
oldcolor = list()
decals = list()
olddecals = list()
possibledecals = list( //var that stores all possible decals, used by ui
list("name" = "Low temperature canister", "icon" = "cold", "active" = 0),
list("name" = "High temperature canister", "icon" = "hot", "active" = 0),
list("name" = "Plasma containing canister", "icon" = "plasma", "active" = 0)
)
possiblemaincolor = list( //these lists contain the possible colors of a canister
list("name" = "\[N2O\]", "icon" = "redws"),
list("name" = "\[N2\]", "icon" = "red"),
list("name" = "\[O2\]", "icon" = "blue"),
list("name" = "\[Toxin (Bio)\]", "icon" = "orange"),
list("name" = "\[CO2\]", "icon" = "black"),
list("name" = "\[Air\]", "icon" = "grey"),
list("name" = "\[CAUTION\]", "icon" = "yellow"),
list("name" = "\[SPECIAL\]", "icon" = "whiters")
)
possibleseccolor = list( // no point in having the N2O and "whiters" ones in these lists
list("name" = "\[N2\]", "icon" = "red-c"),
list("name" = "\[O2\]", "icon" = "blue-c"),
list("name" = "\[Toxin (Bio)\]", "icon" = "orange-c"),
list("name" = "\[CO2\]", "icon" = "black-c"),
list("name" = "\[Air\]", "icon" = "grey-c"),
list("name" = "\[CAUTION\]", "icon" = "yellow-c")
)
possibletertcolor = list(
list("name" = "\[N2\]", "icon" = "red-c-1"),
list("name" = "\[O2\]", "icon" = "blue-c-1"),
list("name" = "\[Toxin (Bio)\]", "icon" = "orange-c-1"),
list("name" = "\[CO2\]", "icon" = "black-c-1"),
list("name" = "\[Air\]", "icon" = "grey-c-1"),
list("name" = "\[CAUTION\]", "icon" = "yellow-c-1")
)
possiblequartcolor = list(
list("name" = "\[N2\]", "icon" = "red-c-2"),
list("name" = "\[O2\]", "icon" = "blue-c-2"),
list("name" = "\[Toxin (Bio)\]", "icon" = "orange-c-2"),
list("name" = "\[CO2\]", "icon" = "black-c-2"),
list("name" = "\[Air\]", "icon" = "grey-c-2"),
list("name" = "\[CAUTION\]", "icon" = "yellow-c-2")
)
colorcontainer = list(//passed to the ui to render the color lists
"prim" = list(
"options" = possiblemaincolor,
"name" = "Primary color",
"anycolor" = -1,//0: no color applied. 1: color selected. Not used for primary color.
),
"sec" = list(
"options" = possibleseccolor,
"name" = "Secondary color",
"anycolor" = 0,
),
"ter" = list(
"options" = possibletertcolor,
"name" = "Tertiary color",
"anycolor" = 0,
),
"quart" = list(
"options" = possiblequartcolor,
"name" = "Quaternary color",
"anycolor" = 0,
)
)
update_icon()
/obj/machinery/portable_atmospherics/canister/proc/check_change()
var/old_flag = update_flag
@@ -119,10 +123,13 @@
else
update_flag |= 32
if(oldcolor != _color || olddecals != decals)
if(list2params(oldcolor) != list2params(_color))
update_flag |= 64
olddecals = decals
oldcolor = _color
oldcolor = _color.Copy()
if(list2params(olddecals) != list2params(decals))
update_flag |= 128
olddecals = decals.Copy()
if(update_flag == old_flag)
return 1
@@ -138,29 +145,31 @@ update_flag
8 = tank_pressure < ONE_ATMOS
16 = tank_pressure < 15*ONE_ATMOS
32 = tank_pressure go boom.
64 = decals/colors got changed
64 = colors
128 = decals
(note: colors and decals has to be applied every icon update)
*/
if (src.destroyed)
src.overlays = 0
src.icon_state = text("[]-1", src._color[1])//yes, I KNOW the colours don't reflect when the can's borked, whatever.
src.icon_state = text("[]-1", src._color["prim"])//yes, I KNOW the colours don't reflect when the can's borked, whatever.
if(icon_state != src._color[1])
icon_state = src._color[1]
if(icon_state != src._color["prim"])
icon_state = src._color["prim"]
if(check_change()) //Returns 1 if no change needed to icons.
return
src.overlays = 0
if (_color[2])//COLORS!
overlays.Add(_color[2])
if (_color["sec"])//COLORS!
overlays.Add(_color["sec"])
if (_color[3])
overlays.Add(_color[3])
if (_color["ter"])
overlays.Add(_color["ter"])
if (_color[4])
overlays.Add(_color[4])
if (_color["quart"])
overlays.Add(_color["quart"])
for(var/D in decals)
overlays.Add("decal-" + D)
@@ -177,8 +186,36 @@ update_flag
overlays += "can-o2"
else if(update_flag & 32)
overlays += "can-o3"
update_flag &= ~196 //the flags 128 and 64 represent change, not states. As such, we have to reset them to be able to detect a change on the next go.
return
//template modification exploit prevention, used in Topic()
/obj/machinery/portable_atmospherics/canister/proc/is_a_color(var/inputVar, var/checkColor = "all")
if (checkColor == "prim" || checkColor == "all")
for(var/list/L in possiblemaincolor)
if (L["icon"] == inputVar)
return 1
if (checkColor == "sec" || checkColor == "all")
for(var/list/L in possibleseccolor)
if (L["icon"] == inputVar)
return 1
if (checkColor == "ter" || checkColor == "all")
for(var/list/L in possibletertcolor)
if (L["icon"] == inputVar)
return 1
if (checkColor == "quart" || checkColor == "all")
for(var/list/L in possiblequartcolor)
if (L["icon"] == inputVar)
return 1
return 0
/obj/machinery/portable_atmospherics/canister/proc/is_a_decal(var/inputVar)
for(var/list/L in possibledecals)
if (L["icon"] == inputVar)
return 1
return 0
/obj/machinery/portable_atmospherics/canister/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > temperature_resistance)
health -= 5
@@ -330,7 +367,11 @@ update_flag
// this is the data which will be sent to the ui
var/data[0]
data["name"] = name
data["menu"] = menu ? 1 : 0
data["canLabel"] = can_label ? 1 : 0
data["_color"] = _color
data["colorContainer"] = colorcontainer
data["possibleDecals"] = possibledecals
data["portConnected"] = connected_port ? 1 : 0
data["tankPressure"] = round(air_contents.return_pressure() ? air_contents.return_pressure() : 0)
data["releasePressure"] = round(release_pressure ? release_pressure : 0)
@@ -366,6 +407,9 @@ update_flag
onclose(usr, "canister")
return
if (href_list["choice"] == "menu")
menu = text2num(href_list["mode_target"])
if(href_list["toggle"])
if (valve_open)
if (holding)
@@ -394,48 +438,98 @@ update_flag
else
release_pressure = max(ONE_ATMOSPHERE/10, release_pressure+diff)
if (href_list["relabel"])
if (href_list["rename"])
if (can_label)
var/T = copytext(sanitize(input("Choose canister label", "Name", name) as text|null),1,MAX_NAME_LEN)
if (can_label) //Exploit prevention
if (T)
name = T
else
name = "canister"
else
usr << "\red As you attempted to rename it the pressure rose!"
var/label1 = input("Choose canister label", "Primary color") as null|anything in possiblemaincolor
if (href_list["choice"] == "Primary color")
if (is_a_color(href_list["icon"],"prim"))
_color["prim"] = href_list["icon"]
if (href_list["choice"] == "Secondary color")
if (href_list["icon"] == "none")
_color["sec"] = ""
colorcontainer["sec"]["anycolor"] = 0
else if (is_a_color(href_list["icon"],"sec"))
_color["sec"] = href_list["icon"]
colorcontainer["sec"]["anycolor"] = 1
if (href_list["choice"] == "Tertiary color")
if (href_list["icon"] == "none")
_color["ter"] = ""
colorcontainer["ter"]["anycolor"] = 0
else if (is_a_color(href_list["icon"],"ter"))
_color["ter"] = href_list["icon"]
colorcontainer["ter"]["anycolor"] = 1
if (href_list["choice"] == "Quaternary color")
if (href_list["icon"] == "none")
_color["quart"] = ""
colorcontainer["quart"]["anycolor"] = 0
else if (is_a_color(href_list["icon"],"quart"))
_color["quart"] = href_list["icon"]
colorcontainer["quart"]["anycolor"] = 1
var/label2 = input("Choose canister label", "Secondary color") as null|anything in possibleseccolor
var/label3 = input("Choose canister label", "Tertiary color") as null|anything in possibletertcolor
var/label4 = input("Choose canister label", "Quaternary color") as null|anything in possiblequartcolor
decals = list()
_color = list(
(label1 ? possiblemaincolor[label1] : color[1]),//if the user didn't specify a primary colour, keep the current one.
possibleseccolor[label2],
possibletertcolor[label3],
possiblequartcolor[label4]
)
decals = list()
var/list/tempposdecals = possibledecals
while (src && !src.gc_destroyed && usr)//allow the user to select (theoretically) INFINITE DECALS!!!
var/newdecal = input("Choose canister label", "Decal") as anything in tempposdecals
if (newdecal == "Done")
if (href_list["choice"] == "decals")
if (is_a_decal(href_list["icon"]))
for (var/list/L in possibledecals)
if (L["icon"] == href_list["icon"])
L["active"] = (L["active"] == 0)
break
decals.Add(tempposdecals[newdecal])
tempposdecals.Remove(newdecal)
src.name = (input("Choose canister label", "Name") as text) + " canister"
decals = list()
for (var/list/L in possibledecals)
if (L["active"])
if (!(L["icon"] in decals))
decals.Add(L["icon"])
src.add_fingerprint(usr)
update_icon()
return 1
/obj/machinery/portable_atmospherics/canister/toxins/New()
/obj/machinery/portable_atmospherics/canister/toxins
name = "Canister \[Toxin (Plasma)\]"
icon_state = "orange" //See New()
can_label = 0
/obj/machinery/portable_atmospherics/canister/oxygen
name = "Canister: \[O2\]"
icon_state = "blue" //See New()
can_label = 0
/obj/machinery/portable_atmospherics/canister/sleeping_agent
name = "Canister: \[N2O\]"
icon_state = "redws" //See New()
can_label = 0
/obj/machinery/portable_atmospherics/canister/nitrogen
name = "Canister: \[N2\]"
icon_state = "red" //See New()
can_label = 0
/obj/machinery/portable_atmospherics/canister/carbon_dioxide
name = "Canister \[CO2\]"
icon_state = "black" //See New()
can_label = 0
/obj/machinery/portable_atmospherics/canister/air
name = "Canister \[Air\]"
icon_state = "grey" //See New()
can_label = 0
/obj/machinery/portable_atmospherics/canister/custom_mix
name = "Canister \[Custom\]"
icon_state = "whiters" //See New()
can_label = 0
/obj/machinery/portable_atmospherics/canister/toxins/New()
..()
_color["prim"] = "orange"
decals = list("plasma")
possibledecals[3]["active"] = 1
src.air_contents.toxins = (src.maximum_pressure*filled)*air_contents.volume/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
air_contents.update_values()
@@ -443,18 +537,18 @@ update_flag
return 1
/obj/machinery/portable_atmospherics/canister/oxygen/New()
..()
_color["prim"] = "blue"
src.air_contents.oxygen = (src.maximum_pressure*filled)*air_contents.volume/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
air_contents.update_values()
src.update_icon()
return 1
/obj/machinery/portable_atmospherics/canister/sleeping_agent/New()
..()
_color["prim"] = "redws"
var/datum/gas/sleeping_agent/trace_gas = new
air_contents.trace_gases += trace_gas
trace_gas.moles = (src.maximum_pressure*filled)*air_contents.volume/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
@@ -480,9 +574,9 @@ update_flag
/obj/machinery/portable_atmospherics/canister/nitrogen/New()
..()
_color["prim"] = "red"
src.air_contents.nitrogen = (src.maximum_pressure*filled)*air_contents.volume/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
air_contents.update_values()
@@ -490,8 +584,9 @@ update_flag
return 1
/obj/machinery/portable_atmospherics/canister/carbon_dioxide/New()
..()
_color["prim"] = "black"
src.air_contents.carbon_dioxide = (src.maximum_pressure*filled)*air_contents.volume/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
air_contents.update_values()
@@ -500,8 +595,9 @@ update_flag
/obj/machinery/portable_atmospherics/canister/air/New()
..()
_color["prim"] = "grey"
src.air_contents.oxygen = (O2STANDARD*src.maximum_pressure*filled)*air_contents.volume/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
src.air_contents.nitrogen = (N2STANDARD*src.maximum_pressure*filled)*air_contents.volume/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
air_contents.update_values()
@@ -512,6 +608,7 @@ update_flag
/obj/machinery/portable_atmospherics/canister/custom_mix/New()
..()
_color["prim"] = "whiters"
src.update_icon() // Otherwise new canisters do not have their icon updated with the pressure light, likely want to add this to the canister class constructor, avoiding at current time to refrain from screwing up code for other canisters. --DZD
return 1
+20 -25
View File
@@ -24,23 +24,15 @@
/obj/machinery/meter/process()
if(!target)
icon_state = "meterX"
// Pop the meter off when the pipe we're attached to croaks.
new /obj/item/pipe_meter(src.loc)
spawn(0) del(src)
return 0
if(stat & (BROKEN|NOPOWER))
icon_state = "meter0"
return 0
//use_power(5)
var/datum/gas_mixture/environment = target.return_air()
if(!environment)
icon_state = "meterX"
// Pop the meter off when the environment we're attached to croaks.
new /obj/item/pipe_meter(src.loc)
spawn(0) del(src)
return 0
var/env_pressure = environment.return_pressure()
@@ -87,28 +79,31 @@
return t
/obj/machinery/meter/examine()
set src in view(3)
var/t = "A gas flow meter. "
t += status()
if(get_dist(usr, src) > 3 && !(istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/dead)))
t += "\blue <B>You are too far away to read it.</B>"
else if(stat & (NOPOWER|BROKEN))
t += "\red <B>The display is off.</B>"
else if(src.target)
var/datum/gas_mixture/environment = target.return_air()
if(environment)
t += "The pressure gauge reads [round(environment.return_pressure(), 0.01)] kPa; [round(environment.temperature,0.01)]K ([round(environment.temperature-T0C,0.01)]&deg;C)"
else
t += "The sensor error light is blinking."
else
t += "The connect error light is blinking."
usr << t
/obj/machinery/meter/Click()
if(stat & (NOPOWER|BROKEN))
if(istype(usr, /mob/living/silicon/ai)) // ghosts can call ..() for examine
usr.examine(src)
return 1
var/t = null
if (get_dist(usr, src) <= 3 || istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/dead))
t += status()
else
usr << "\blue <B>You are too far away.</B>"
return 1
usr << t
return 1
return ..()
/obj/machinery/meter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if (!istype(W, /obj/item/weapon/wrench))
+214 -24
View File
@@ -15,6 +15,9 @@
var/max_g_amount = 75000.0
var/operating = 0.0
var/list/queue = list()
var/queue_max_len = 10
var/turf/BuildTurf
anchored = 1.0
var/list/L = list()
var/list/LL = list()
@@ -44,7 +47,7 @@
"Medical",
"Miscellaneous",
"Security",
"Tools"
"Tools"
)
/obj/machinery/autolathe/New()
@@ -61,7 +64,7 @@
wires = new(src)
files = new /datum/research/autolathe(src)
matching_designs = list()
/obj/machinery/autolathe/upgraded/New()
..()
component_parts = list()
@@ -72,7 +75,7 @@
component_parts += new /obj/item/weapon/stock_parts/manipulator/pico(null)
component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
RefreshParts()
/obj/machinery/autolathe/interact(mob/user)
if(shocked && !(stat & NOPOWER))
shock(user,50)
@@ -92,7 +95,7 @@
if(AUTOLATHE_SEARCH_MENU)
dat = search_win(user)
var/datum/browser/popup = new(user, "autolathe", name, 500, 500)
var/datum/browser/popup = new(user, "autolathe", name, 800, 500)
popup.set_content(dat)
popup.open()
@@ -151,7 +154,7 @@
flick("autolathe_r",src)//plays glass insertion animation
stack.use(amount)
else
if(!user.before_take_item(O))
if(!user.unEquip(O))
user << "<span class='notice'>/the [O] is stuck to your hand, you can't put it in \the [src]!</span>"
O.loc = src
icon_state = "autolathe"
@@ -234,17 +237,74 @@
g_amount = 0
busy = 0
src.updateUsrDialog()
if(href_list["search"])
matching_designs.Cut()
for(var/datum/design/D in files.known_designs)
if(findtext(D.name,href_list["to_search"]))
matching_designs.Add(D)
else
usr << "<span class=\"alert\">The autolathe is busy. Please wait for completion of previous operation.</span>"
if(href_list["menu"])
screen = text2num(href_list["menu"])
if(href_list["category"])
selected_category = href_list["category"]
if(href_list["make"])
BuildTurf = get_step(src.loc, get_dir(src,usr))
/////////////////
//href protection
being_built = files.FindDesignByID(href_list["make"]) //check if it's a valid design
if(!being_built)
return
if(!(being_built.build_type & AUTOLATHE))
return
//multiplier checks : only stacks can have one and its value is 1, 10 ,25 or max_multiplier
var/multiplier = text2num(href_list["multiplier"])
var/max_multiplier = min(50, being_built.materials["$metal"] ?round(m_amount/being_built.materials["$metal"]):INFINITY,being_built.materials["$glass"]?round(g_amount/being_built.materials["$glass"]):INFINITY)
var/is_stack = ispath(being_built.build_path, /obj/item/stack)
if(!is_stack && (multiplier > 1))
return
if (!(multiplier in list(1,10,25,max_multiplier))) //"enough materials ?" is checked in the build proc
return
/////////////////
if(queue.len<queue_max_len)
add_to_queue(being_built,multiplier)
else
usr << "\red The autolathe queue is full!"
if (!busy)
busy = 1
process_queue()
busy = 0
if(href_list["remove_from_queue"])
var/index = text2num(href_list["remove_from_queue"])
if(isnum(index) && IsInRange(index,1,queue.len))
remove_from_queue(index)
if(href_list["queue_move"] && href_list["index"])
var/index = text2num(href_list["index"])
var/new_index = index + text2num(href_list["queue_move"])
if(isnum(index) && isnum(new_index))
if(IsInRange(new_index,1,queue.len))
queue.Swap(index,new_index)
if(href_list["clear_queue"])
queue = list()
if(href_list["search"])
matching_designs.Cut()
for(var/datum/design/D in files.known_designs)
if(findtext(D.name,href_list["to_search"]))
matching_designs.Add(D)
src.updateUsrDialog()
return
@@ -260,8 +320,134 @@
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
prod_coeff += M.rating - 1
/obj/machinery/autolathe/proc/get_coeff(var/datum/design/D)
var/coeff = (ispath(D.build_path,/obj/item/stack) ? 1 : 2 ** prod_coeff)//stacks are unaffected by production coefficient
return coeff
/obj/machinery/autolathe/proc/build_item(var/datum/design/D, var/multiplier)
desc = initial(desc)+"\nIt's building \a [initial(D.name)]."
var/is_stack = ispath(D.build_path, /obj/item/stack)
var/coeff = get_coeff(D)
var/metal_cost = D.materials["$metal"]
var/glass_cost = D.materials["$glass"]
var/power = max(2000, (metal_cost+glass_cost)*multiplier/5)
if (can_build(D,multiplier))
use_power(power)
icon_state = "autolathe"
flick("autolathe_n",src)
updateUsrDialog()
sleep(32/coeff)
if(is_stack)
m_amount -= metal_cost*multiplier
g_amount -= glass_cost*multiplier
var/obj/item/stack/S = new D.build_path(BuildTurf)
S.amount = multiplier
else
m_amount -= metal_cost/coeff
g_amount -= glass_cost/coeff
var/obj/item/new_item = new D.build_path(BuildTurf)
new_item.m_amt /= coeff
new_item.g_amt /= coeff
if(m_amount < 0)
m_amount = 0
if(g_amount < 0)
g_amount = 0
updateUsrDialog()
desc = initial(desc)
/obj/machinery/autolathe/proc/can_build(var/datum/design/D,var/multiplier=1,var/custom_metal,var/custom_glass)
var/coeff = get_coeff(D)
var/m_amount_tmp = m_amount
if(custom_metal)
m_amount_tmp = custom_metal
var/g_amount_tmp = g_amount
if(custom_glass)
g_amount_tmp = custom_glass
if(D.materials["$metal"] && (m_amount_tmp*multiplier < (D.materials["$metal"] / coeff)))
return 0
if(D.materials["$glass"] && (g_amount_tmp*multiplier < (D.materials["$glass"] / coeff)))
return 0
return 1
/obj/machinery/autolathe/proc/get_design_cost_as_list(var/datum/design/D,var/multiplier=1)
var/list/OutputList = list(0,0)
var/coeff = get_coeff(D)
if(D.materials["$metal"])
OutputList[1] = (D.materials["$metal"] / coeff)*multiplier
if(D.materials["$glass"])
OutputList[2] = (D.materials["$glass"] / coeff)*multiplier
return OutputList
/obj/machinery/autolathe/proc/get_queue()
var/temp_metal = m_amount
var/temp_glass = g_amount
var/output = "<td valign='top' style='width: 300px'>"
output += "<div class='statusDisplay'>"
output += "<b>Queue contains:</b>"
if (!istype(queue) || !queue.len)
output += "<br>Nothing"
else
output += "<ol>"
var/i = 0
var/datum/design/D
for(var/list/L in queue)
i++
D = L[1]
var/multiplier = L[2]
var/obj/part = D.build_path
var/list/LL = get_design_cost_as_list(D,multiplier)
var/is_stack = (multiplier>1)
output += "<li[!can_build(D,multiplier,temp_metal,temp_glass)?" style='color: #f00;'":null]>[initial(part.name)][is_stack?" (x[multiplier])":null] - [i>1?"<a href='?src=\ref[src];queue_move=-1;index=[i]' class='arrow'>&uarr;</a>":null] [i<queue.len?"<a href='?src=\ref[src];queue_move=+1;index=[i]' class='arrow'>&darr;</a>":null] <a href='?src=\ref[src];remove_from_queue=[i]'>Remove</a></li>"
temp_metal = max(temp_metal-LL[1],1)
temp_glass = max(temp_glass-LL[2],1)
output += "</ol>"
output += "<a href='?src=\ref[src];clear_queue=1'>Clear queue</a>"
output += "</div></td>"
return output
/obj/machinery/autolathe/proc/add_to_queue(D,var/multiplier)
if(!istype(queue))
queue = list()
if(D)
queue.Add(list(list(D,multiplier)))
return queue.len
/obj/machinery/autolathe/proc/remove_from_queue(index)
if(!isnum(index) || !istype(queue) || (index<1 || index>queue.len))
return 0
queue.Cut(index,++index)
return 1
/obj/machinery/autolathe/proc/process_queue()
var/datum/design/D = queue[1][1]
var/multiplier = queue[1][2]
if(!D)
remove_from_queue(1)
if(queue.len)
return process_queue()
else
return
while(D)
if(stat&(NOPOWER|BROKEN))
return 0
if(!can_build(D,multiplier))
visible_message("\icon[src] <b>\The [src]</b> beeps, \"Not enough resources. Queue processing terminated.\"")
queue = list()
return 0
remove_from_queue(1)
build_item(D,multiplier)
D = listgetindex(listgetindex(queue, 1),1)
multiplier = listgetindex(listgetindex(queue,1),2)
//visible_message("\icon[src] <b>\The [src]</b> beeps, \"Queue processing finished successfully.\"")
/obj/machinery/autolathe/proc/main_win(mob/user)
var/dat = "<div class='statusDisplay'><h3>Autolathe Menu:</h3><br>"
var/dat = "<table style='width:100%'><tr>"
dat += "<td valign='top' style='margin-right: 300px'>"
dat += "<div class='statusDisplay'><h3>Autolathe Menu:</h3><br>"
dat += "<b>Metal amount:</b> [src.m_amount] / [max_m_amount] cm<sup>3</sup><br>"
dat += "<b>Glass amount:</b> [src.g_amount] / [max_g_amount] cm<sup>3</sup>"
@@ -285,11 +471,16 @@
line_length++
dat += "</tr></table></div>"
dat += "</td>"
dat += get_queue()
dat += "</tr></table>"
return dat
/obj/machinery/autolathe/proc/category_win(mob/user,var/selected_category)
var/dat = "<A href='?src=\ref[src];menu=[AUTOLATHE_MAIN_MENU]'>Return to main menu</A>"
dat += "<div class='statusDisplay'><h3>Browsing [selected_category]:</h3><br>"
var/dat = "<table style='width:100%'><tr><td valign='top' style='margin-right: 300px'>"
dat += "<div class='statusDisplay'>"
dat += "<A href='?src=\ref[src];menu=[AUTOLATHE_MAIN_MENU]'>Return to main menu</A>"
dat += "<h3>Browsing [selected_category]:</h3><br>"
dat += "<b>Metal amount:</b> [src.m_amount] / [max_m_amount] cm<sup>3</sup><br>"
dat += "<b>Glass amount:</b> [src.g_amount] / [max_g_amount] cm<sup>3</sup><hr>"
@@ -314,11 +505,16 @@
dat += "[get_design_cost(D)]<br>"
dat += "</div>"
dat += "</td>"
dat += get_queue()
dat += "</tr></table>"
return dat
/obj/machinery/autolathe/proc/search_win(mob/user)
var/dat = "<A href='?src=\ref[src];menu=[AUTOLATHE_MAIN_MENU]'>Return to main menu</A>"
dat += "<div class='statusDisplay'><h3>Search results:</h3><br>"
var/dat = "<table style='width:100%'><tr><td valign='top' style='margin-right: 300px'>"
dat += "<div class='statusDisplay'>"
dat += "<A href='?src=\ref[src];menu=[AUTOLATHE_MAIN_MENU]'>Return to main menu</A>"
dat += "<h3>Search results:</h3><br>"
dat += "<b>Metal amount:</b> [src.m_amount] / [max_m_amount] cm<sup>3</sup><br>"
dat += "<b>Glass amount:</b> [src.g_amount] / [max_g_amount] cm<sup>3</sup><hr>"
@@ -340,19 +536,13 @@
dat += "[get_design_cost(D)]<br>"
dat += "</div>"
dat += "</td>"
dat += get_queue()
dat += "</tr></table>"
return dat
/obj/machinery/autolathe/proc/can_build(var/datum/design/D)
var/coeff = (ispath(D.build_path,/obj/item/stack) ? 1 : 2 ** prod_coeff)
if(D.materials["$metal"] && (m_amount < (D.materials["$metal"] / coeff)))
return 0
if(D.materials["$glass"] && (g_amount < (D.materials["$glass"] / coeff)))
return 0
return 1
/obj/machinery/autolathe/proc/get_design_cost(var/datum/design/D)
var/coeff = (ispath(D.build_path,/obj/item/stack) ? 1 : 2 ** prod_coeff)
var/coeff = get_coeff(D)
var/dat
if(D.materials["$metal"])
dat += "[D.materials["$metal"] / coeff] metal "
@@ -378,7 +568,7 @@
if(hack)
for(var/datum/design/D in files.possible_designs)
if((D.build_type & 4) && ("hacked" in D.category))
if((D.build_type & AUTOLATHE) && ("hacked" in D.category))
files.known_designs += D
else
for(var/datum/design/D in files.known_designs)
-1
View File
@@ -65,7 +65,6 @@
name = "bottle of BeezEez"
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle17"
flags = FPRINT | TABLEPASS
New()
src.pixel_x = rand(-5.0, 5)
src.pixel_y = rand(-5.0, 5)

Some files were not shown because too many files have changed in this diff Show More