Skip to content

Commit

Permalink
Merge branch 'master' into turn-both-keys
Browse files Browse the repository at this point in the history
Conflicts:
	tgui/assets/tgui.js
  • Loading branch information
coiax committed Jul 9, 2016
2 parents 78100f8 + f95884f commit a75b7b7
Show file tree
Hide file tree
Showing 59 changed files with 826 additions and 218 deletions.
2 changes: 1 addition & 1 deletion code/__HELPERS/names.dm
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ var/religion_name = null
if(2)
new_station_name += pick(greek_letters)
if(3)
new_station_name += pick(roman_numerals)
new_station_name += "\Roman[rand(1,99)]"
if(4)
new_station_name += pick(phonetic_alphabet)
if(5)
Expand Down
15 changes: 1 addition & 14 deletions code/__HELPERS/type2type.dm
Original file line number Diff line number Diff line change
Expand Up @@ -572,17 +572,4 @@ for(var/t in test_times)
var/R = hex2num(copytext(A,2,4))
var/G = hex2num(copytext(A,4,6))
var/B = hex2num(copytext(A,6,0))
return R+G+B

//Converts a positive interger to its roman numeral equivilent. Ignores any decimals.
//Numbers over 3999 will display with extra "M"s (don't tell the Romans) and can get comically long, so be careful.
/proc/num2roman(A)
var/list/values = list("M" = 1000, "CM" = 900, "D" = 500, "CD" = 400, "C" = 100, "XC" = 90, "L" = 50, "XL" = 40, "X" = 10, "IX" = 9, "V" = 5, "IV" = 4, "I" = 1)
if(!A || !isnum(A))
return 0
while(A >= 1)
for(var/i in values)
if(A >= values[i])
. += i
A -= values[i]
break
return R+G+B
7 changes: 2 additions & 5 deletions code/_globalvars/lists/flavor_misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,6 @@ var/global/list/greek_letters = list("Alpha", "Beta", "Gamma", "Delta",
"Nu", "Xi", "Omicron", "Pi", "Rho", "Sigma", "Tau", "Upsilon", "Phi",
"Chi", "Psi", "Omega")

var/global/list/roman_numerals = list("I", "II", "III", "IV", "V", "VI",
"VII", "VIII", "IX", "X", "XI", "XII", "XIII", "XIV", "XV", "XVI",
"XVII", "XVIII", "XIX", "XX")

var/global/list/phonetic_alphabet = list("Alpha", "Bravo", "Charlie",
"Delta", "Echo", "Foxtrot", "Golf", "Hotel", "India", "Juliet",
"Kilo", "Lima", "Mike", "November", "Oscar", "Papa", "Quebec",
Expand All @@ -151,6 +147,7 @@ var/global/list/numbers_as_words = list("One", "Two", "Three", "Four",
var/list/L
for(var/i in 1 to 99)
L += "[i]"
L += "\Roman[i]"
return L

var/global/list/station_numerals = greek_letters + roman_numerals + phonetic_alphabet + numbers_as_words + generate_number_strings()
var/global/list/station_numerals = greek_letters + phonetic_alphabet + numbers_as_words + generate_number_strings()
2 changes: 0 additions & 2 deletions code/_onclick/hud/action_button.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,11 @@
else
icon_state = "bg_default"
UpdateIcon()
return

/obj/screen/movable/action_button/hide_toggle/proc/UpdateIcon()
cut_overlays()
var/image/img = image(icon, src, hidden ? "show" : "hide")
add_overlay(img)
return


/obj/screen/movable/action_button/MouseEntered(location,control,params)
Expand Down
74 changes: 74 additions & 0 deletions code/controllers/subsystem/augury.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
var/datum/subsystem/augury/SSaugury

/datum/subsystem/augury
name = "Augury"
flags = SS_NO_INIT

var/list/watchers = list()
var/list/doombringers = list()

var/list/observers_given_action = list()

/datum/subsystem/augury/New()
NEW_SS_GLOBAL(SSaugury)

/datum/subsystem/augury/stat_entry(msg)
..("W:[watchers.len]|D:[doombringers.len]")

/datum/subsystem/augury/proc/register_doom(atom/A, severity)
doombringers[A] = severity

/datum/subsystem/augury/fire()
var/biggest_doom = null
var/biggest_threat = null

for(var/d in doombringers)
if(!d || qdeleted(d))
doombringers -= d
continue
var/threat = doombringers[d]
if((biggest_threat == null) || (biggest_threat < threat))
biggest_doom = d
biggest_threat = threat

if(doombringers.len)
for(var/i in player_list)
if(isobserver(i) && (!(observers_given_action[i])))
var/datum/action/innate/augury/A = new
A.Grant(i)
observers_given_action[i] = TRUE

for(var/w in watchers)
if(!w)
watchers -= w
continue
var/mob/dead/observer/O = w
if(O.orbiting)
continue
else if(biggest_doom)
addtimer(O, "orbit", 0, FALSE, biggest_doom)

/datum/action/innate/augury
name = "Auto Follow Debris"
icon_icon = 'icons/obj/meteor.dmi'
button_icon_state = "flaming"

/datum/action/innate/augury/Activate()
SSaugury.watchers[owner] = TRUE
owner << "<span class='notice'>You are now auto-following debris.</span>"
active = TRUE
UpdateButtonIcon()

/datum/action/innate/augury/Deactivate()
SSaugury.watchers -= owner
owner << "<span class='notice'>You are no longer auto-following \
debris.</span>"
active = FALSE
UpdateButtonIcon()

/datum/action/innate/augury/UpdateButtonIcon()
..()
if(active)
button.icon_state = "bg_default_on"
else
button.icon_state = background_icon_state
10 changes: 6 additions & 4 deletions code/datums/action.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
var/processing = 0
var/obj/screen/movable/action_button/button = null
var/button_icon = 'icons/mob/actions.dmi'
var/button_icon_state = "default"
var/background_icon_state = "bg_default"

var/icon_icon = 'icons/mob/actions.dmi'
var/button_icon_state = "default"
var/mob/owner

/datum/action/New(Target)
Expand Down Expand Up @@ -88,9 +90,9 @@

/datum/action/proc/ApplyIcon(obj/screen/movable/action_button/current_button)
current_button.cut_overlays()
if(button_icon && button_icon_state)
if(icon_icon && button_icon_state)
var/image/img
img = image(button_icon, current_button, button_icon_state)
img = image(icon_icon, current_button, button_icon_state)
img.pixel_x = 0
img.pixel_y = 0
current_button.add_overlay(img)
Expand Down Expand Up @@ -197,7 +199,7 @@

/datum/action/item_action/hierophant
name = "Hierophant Network"
button_icon_state = "hierophant"
button_icon_state = "hierophant_slab"
background_icon_state = "bg_clock"

/datum/action/item_action/hierophant/IsAvailable()
Expand Down
43 changes: 22 additions & 21 deletions code/datums/datumvars.dm
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// reference: /client/proc/modify_variables(var/atom/O, var/param_var_name = null, var/autodetect_class = 0)

var/global/list/internal_byond_list_vars = list("contents" = TRUE, "verbs" = TRUE, "screen" = TRUE, "images" = TRUE)

/datum
var/var_edited = 0 //Warrenty void if seal is broken

/datum/proc/on_varedit(modified_var) //called whenever a var is edited
var_edited = 1
return

/client/proc/debug_variables(datum/D in world)
set category = "Debug"
Expand Down Expand Up @@ -343,8 +344,6 @@ body

usr << browse(html, "window=variables\ref[D];size=475x650")

return

/client/proc/debug_variable(name, value, level, datum/DA = null)
var/html = ""

Expand Down Expand Up @@ -397,21 +396,27 @@ body
html += "[html_encode(name)] = /list ([L.len])"

if (L.len > 0 && !(name == "underlays" || name == "overlays" || name == "vars" || L.len > 500))
// not sure if this is completely right...
if(0) //(L.vars.len > 0)
html += "<ol>"
html += "</ol>"
else
html += "<ul>"
var/index = 1
for (var/entry in L)
if(istext(entry))
html += debug_variable(entry, L[entry], level + 1)
//html += debug_variable("[index]", L[index], level + 1)
else
html += "<ul>"
var/index = 1
for(var/entry in L)
var/state = "INDEX"
var/val = null
if(isnum(entry) || internal_byond_list_vars[entry])
state = "INDEX"
else
val = L[entry]
if(!isnull(val))
state = "ASSOC"
if(!isnull(L[index]))
state = "ASSOC"

switch(state)
if("INDEX")
html += debug_variable(index, L[index], level + 1)
index++
html += "</ul>"
if("ASSOC")
html += debug_variable(entry, val, level + 1)
index++
html += "</ul>"

else
html += "[html_encode(name)] = <span class='value'>[html_encode(value)]</span>"
Expand Down Expand Up @@ -961,7 +966,3 @@ body
log_admin("[key_name(usr)] dealt [amount] amount of [Text] damage to [L] ")
message_admins("<span class='notice'>[key_name(usr)] dealt [amount] amount of [Text] damage to [L] </span>")
href_list["datumrefresh"] = href_list["mobToDamage"]


return

8 changes: 7 additions & 1 deletion code/game/gamemodes/clock_cult/clock_cult.dm
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,15 @@ This file's folder contains:
var/mob/living/silicon/robot/R = S
R.UnlinkSelf()
R.emagged = 1
R << "<span class='warning'><b>You have been desynced from your master AI. In addition, your onboard camera is no longer active and your safeties have been disabled.</b></span>"
R << "<span class='boldwarning'>You have been desynced from your master AI. In addition, your onboard camera is no longer active and your safeties have been disabled.</span>"
S.laws = new/datum/ai_laws/ratvar
S.laws.associate(S)
S.update_icons()
S.show_laws()
var/datum/action/innate/hierophant/H = new()
H.Grant(S)
H.title = null //so it's just the borg's name
S << "<span class='heavy_brass'>You can communicate with other servants by using the Hierophant Network action button in the upper left.</span>"
if(istype(ticker.mode, /datum/game_mode/clockwork_cult))
var/datum/game_mode/clockwork_cult/C = ticker.mode
C.present_tasks(M) //Memorize the objectives
Expand All @@ -136,6 +140,8 @@ This file's folder contains:
M.attack_log += "\[[time_stamp()]\] <span class='brass'>Has renounced the cult of Ratvar!</span>"
for(var/datum/action/innate/function_call/F in M.actions) //Removes any bound Ratvarian spears
qdel(F)
for(var/datum/action/innate/hierophant/H in M.actions) //Removes any communication actions
qdel(H)
if(issilicon(M))
var/mob/living/silicon/S = M
if(isrobot(S))
Expand Down
20 changes: 20 additions & 0 deletions code/game/gamemodes/clock_cult/clock_unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,26 @@
else if(is_servant_of_ratvar(M))
M << message

//Hierophant Network action, allows a servant with it to communicate
/datum/action/innate/hierophant
name = "Hierophant Network"
button_icon_state = "hierophant"
background_icon_state = "bg_clock"
check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_CONSCIOUS
var/title = "Servant"

/datum/action/innate/hierophant/IsAvailable()
if(!is_servant_of_ratvar(owner))
return 0
return ..()

/datum/action/innate/hierophant/Activate()
var/input = stripped_input(usr, "Please enter a message to send to other servants.", "Hierophant Network", "")
if(!input || !IsAvailable())
return

titled_hierophant_message(owner, input, "heavy_brass", "brass", title)

//Function Call action: Calls forth a Ratvarian spear.
/datum/action/innate/function_call
name = "Function Call"
Expand Down
Loading

0 comments on commit a75b7b7

Please sign in to comment.