Merge branch 'master' of https://github.com/ParadiseSS13/Paradise into BookClub

This commit is contained in:
Aurorablade
2016-07-21 23:56:34 -04:00
1490 changed files with 46551 additions and 25064 deletions
-584
View File
@@ -1,584 +0,0 @@
/*******************************************************************************************************
Emotes
Remember, only 1 instance of each emote is made, and used by all mobs that can access it. As such, the
ONLY place you can safely set object variables during runtime is in New(). Otherwise override the emote.
The only exception to this is custom emotes, which are created as needed and only last until they are finished
VampyrBytes
*******************************************************************************************************/
#define EMOTE_COOLDOWN 20 //Time in deciseconds that the cooldown lasts
#define HEARING_RANGE 7
#define INVALID -1 //Using -1 as I can't see how a negative number could be a valid input
/datum/emote
var/name = ""
var/desc = ""
var/list/commands[0] // list of commands that trigger the emote.
var/text = ""
var/selfText = "" // the version of text that you should see - eg, if text is screams, you want scream here, as You screams is bad grammer
var/startText = "" // if you need to put something in before [user]
var/selfStart = 1 // whether the start text is used in what you see
var/audible = 0
var/mimeText = ""
var/mimeSelf = "" //self version of mimeText
var/sound // sound file
var/vol = 50
var/muzzleAffected = 0 // whether being muzzled affects this emote
var/muzzledNoise = "" // if the emote is audible and you're muzzled, this is what type of noise you make (eg weak, loud).
var/cooldown = 0 // How long the cooldown should be on this emote. Defaults to EMOTE_COOLDOWN if not set and the emote plays a sound
var/restrained = 0 // 1 if being restrained prevents this emote
var/canTarget = 0 // 1 if the emote accepts a target
var/targetMob = 0 // 0 if target can be any atom, 1 if it has to be a mob,
var/mustTarget = 0 // 1 if the emote needs a target to work (won't get None as an option)
var/targetText = "at" // what goes inbetween user and target
var/takesNumber = 0 // 1 if the emote uses a number parameter
var/emoteSpanClass = "notice"
var/userSpanClass = "em"
var/baseLevel = 1
var/allowParent = 0 // 1 if you want the parent available as well as this one
/datum/emote/New()
var/pathString = "[type]"
var/count = 0
for(var/i in 1 to lentext(pathString))
var/char = copytext(pathString, i, i+1)
if(char == "/")
count++
if(count == 4)
baseLevel = 0
break
if(sound && !cooldown)
cooldown = EMOTE_COOLDOWN
if(targetText)
if(!findtextEx(targetText, " ", lentext(targetText)))
targetText += " "
/datum/emote/proc/doEmote(var/mob/user, var/command = "")
if(!istype(user))
return
if(cooldown)
if(handle_emote_CD(user))
return
var/message = ""
var/list/params[0]
params = getParams(user)
for(var/p in params)
if(params[p] == INVALID)
return
if(text)
message = createMessage(user, params)
if(message)
message = addExtras(user, params, message)
. = processMessage(user, params, message)
if(!doMime(user) && (!muzzleAffected || !isMuzzled(user)))
if(playSound(user, params))
. = 2
doAction(user, params)
for(var/obj/item/weapon/implant/I in user)
if(I.implanted)
I.trigger(command, user)
return
// for things that the emote does that aren't text or sound based
/datum/emote/proc/doAction(var/mob/user, var/list/params)
return
/datum/emote/proc/getParams(var/mob/user)
var/list/params[0]
if(takesNumber)
user.set_typing_indicator(1)
user.hud_typing = 1
params["num"] = getNumber(user)
user.hud_typing = 0
user.set_typing_indicator(0)
if(canTarget)
user.set_typing_indicator(1)
user.hud_typing = 1
params["target"] = getTarget(user)
user.hud_typing = 0
user.set_typing_indicator(0)
return params
// return INVALID from either of these getters if you've tested the input and it's failed
/datum/emote/proc/getNumber(var/mob/user)
var/number = input("How many?", "Enter number") as null|num
return number
/datum/emote/proc/getTarget(var/mob/user)
if(user.sdisabilities & BLIND || user.blinded || user.paralysis)
return
var/list/targets = list()
if(!mustTarget)
targets += "None"
var/target
if(targetMob)
target = getMobTarget(user, targets)
else
target = getAtomTarget(user, targets)
if(!target)
return INVALID
if(target == "None")
return
return target
/datum/emote/proc/getMobTarget(var/mob/user, var/list/targets)
for(var/mob/M in view(getLoc(user)))
targets += M
var/mob/target = input("Select target", "Target Mob") as null|anything in targets
return target
/datum/emote/proc/getAtomTarget(var/mob/user, var/list/targets)
for(var/A in oview(getLoc(user)))
if(ismob(A) || isobj(A) || isturf(A))
targets += A
var/atom/target = input("Select target", "Target") as null|anything in targets
return target
// returns the reason the user can't currently do the emote
/datum/emote/proc/prevented(var/mob/user)
if(user.stat == DEAD)
return "you are dead"
if(user.stat == UNCONSCIOUS)
return "you are unconscious"
if(restrained && user.restrained())
return "you are restrained"
if(isbrain(user))
var/mob/living/carbon/brain/brain = user
if(!(brain.container && istype(brain.container, /obj/item/device/mmi)))
return "you need to be in an mmi to do this"
// return 1 if this emote can be used by this type of user
/datum/emote/proc/available(var/mob/user)
return
/datum/emote/proc/createMessage(var/mob/user, var/list/params)
if(!text)
return
var/message = ""
if(doMime(user))
message = mimeMessage(user, params)
if(message)
return message
if(muzzleAffected && isMuzzled(user))
message = muzzleMessage(user, params)
return message
if(checkForParams(params))
message = paramMessage(user, params)
return message
message = standardMessage(user, params)
return message
/datum/emote/proc/isMuzzled(var/mob/user)
if(user.sdisabilities & MUTE || user.is_muzzled())
return 1
if(!isliving(user))
return
var/mob/living/L = user
if(L.silent)
return 1
/datum/emote/proc/checkForParams(var/list/params)
for(var/p in params)
if(p == "target")
continue
return 1
/datum/emote/proc/addExtras(var/mob/user, var/list/params, var/message = "")
if(!message)
return
if(startText)
message = "[startText] [message]"
message = addPunc(message)
message = "<span class='[emoteSpanClass]'>[message]</span>"
return message
/datum/emote/proc/addPunc(var/message = "")
var/regex/endingPunc = new("\[\\.!\\?\"]$")
if(!endingPunc.Find(message))
message += "."
return message
/datum/emote/proc/standardMessage(var/mob/user, var/list/params)
var/message = "<span class='[userSpanClass]'>\The [user]</span> [text]"
if("target" in params)
message = addTarget(user, params, message)
return message
/datum/emote/proc/mimeMessage(var/mob/user, var/list/params)
if(!mimeText)
return
if(checkForParams(params))
return paramMimeMessage(user, params)
var/message = "<span class='[userSpanClass]'>\The [user]</span> [mimeText]"
if(message && "target" in params)
message = addTarget(user, params, message)
return message
/datum/emote/proc/muzzleMessage(var/mob/user, var/list/params)
var/message = "<span class='[userSpanClass]'>\The [user]</span> makes a "
if(muzzledNoise)
message += "[muzzledNoise] "
message += "noise"
return message
// if the emote takes a non target parameter, set up and return the with parameter version in here
/datum/emote/proc/paramMessage(var/mob/user, var/list/params)
return
// as above, but for mimes when there is mimeText
/datum/emote/proc/paramMimeMessage(var/mob/user, var/list/params)
return
/datum/emote/proc/addTarget(var/mob/user, var/list/params, var/message = "")
if(!canTarget)
return message
if(!params["target"])
return message
if(params["target"] == user)
message += " [targetText][getHimself(user)]"
return message
message += " [targetText]\the [params["target"]]"
return message
// What you should see when you perform the emote
/datum/emote/proc/createSelfMessage(var/mob/user, var/list/params, var/message = "")
if(!selfText)
return message
message = replacetext(message, text, selfText)
message = changeTextMacros(user, message)
if(mimeSelf)
message = replacetext(message, mimeText, mimeSelf)
if(startText && !selfStart)
var/start = findtextEx(message, startText)
var/end = start + lentext(startText) + 1
message = copytext(message, 1, start) + copytext(message, end, lentext(message) + 1)
message = replaceMobWithYou(user, message)
return message
/datum/emote/proc/replaceMobWithYou(var/mob/M, var/message = "", var/mob/user) // user passed in in case an override needs to do something different if M != user (see johnny) VB
message = replacetext(message, "\The [M]", "You")
message = replacetext(message, "\the [M]", "you")
return message
/datum/emote/proc/processMessage(var/mob/user, var/list/params, var/message = "")
var/visualOrAudible = audible + 1
if(doMime(user))
visualOrAudible = 1
log_emote("[user.name]/[user.key] : [message]")
sendToDead(message)
for(var/mob/M in getRecipients(getLoc(user, message), visualOrAudible))
var/msg = ""
if(M==user)
msg = createSelfMessage(user, params, message)
if(msg)
outputMessage(M, msg)
continue
if(M.stat == UNCONSCIOUS || (M.sleeping && M.stat != DEAD))
if(!visualOrAudible == 2)
continue
msg = "<span class='italics'>... You can almost hear someone talking ...</span>"
outputMessage(M, msg)
continue
if(M.sdisabilities & DEAF || M.ear_deaf)
if(M.sdisabilities & BLIND || M.blinded || M.paralysis)
continue
if(!(M in getRecipients(user, 1)) || M.see_invisible < user.invisibility)
continue
msg = createDeafMessage(user, params, message)
if(!msg && visualOrAudible == 2)
continue
if(msg)
outputMessage(M, msg)
continue
if(M.sdisabilities & BLIND || M.blinded || M.paralysis || (M.see_invisible < user.invisibility && visualOrAudible == 2))
if(!(M in getRecipients(user, 2)))
continue
msg = createBlindMessage(user, params, message)
if(!msg && visualOrAudible == 1)
continue
if(msg)
outputMessage(M, msg)
continue
if(M.see_invisible < user.invisibility && visualOrAudible == 1)
continue
msg = message
outputMessage(M, msg, user)
if(visualOrAudible == 2)
handleListeningObjects(user, message)
return visualOrAudible
/datum/emote/proc/outputMessage(var/mob/M, var/msg = "", var/mob/user)
msg = replaceMobWithYou(M, msg, user)
to_chat(M, msg)
/datum/emote/proc/getLoc(var/mob/user, var/message = "")
var/loc = checkForHolopad(user, message)
if(loc)
return loc
return user
/datum/emote/proc/checkForHolopad(var/mob/user, var/message = "")
if(!isAI(user))
return
var/mob/living/silicon/ai/AI = user
var/obj/machinery/hologram/holopad/T = AI.holo
if(!(T && T.hologram && T.master == AI))
return
if(message)
to_chat(AI, "<span class='game say'>Holopad action relayed, <span class='message'>[message]</span></span>")
return T
/datum/emote/proc/handleListeningObjects(var/mob/user, var/message = "")
// based on say code
var/omsg = replacetext(message, "<B>[user]</B> ", "")
var/list/listening_obj = new
for(var/atom/movable/A in view(HEARING_RANGE, user))
if(istype(A, /mob))
var/mob/M = A
for(var/obj/O in M.contents)
listening_obj |= O
else if(istype(A, /obj))
var/obj/O = A
listening_obj |= O
for(var/obj/O in listening_obj)
O.hear_message(user, omsg)
/datum/emote/proc/getRecipients(var/location, var/visualOrAudible)
if(visualOrAudible == 1)
return viewers(location)
return get_mobs_in_view(HEARING_RANGE, location)
// set up different messages for blind people here. Empty will mean no message for
//non-audible emotes and the standard message for audible ones
/datum/emote/proc/createBlindMessage(var/mob/user, var/list/params, var/message)
if(audible && selfText)
message = "<span class='[userSpanClass]'>You</span> hear someone [selfText]"
message = addExtras(message)
return message
// set up different messages for deaf people here. Empty will mean no message for
// audible emotes and standard for non-audible ones
/datum/emote/proc/createDeafMessage(var/mob/user, var/list/params, var/message)
message = mimeMessage(user, params)
message = addExtras(message)
return message
/datum/emote/proc/sendToDead(var/message = "")
for(var/mob/M in dead_mob_list)
if(!M.client || istype(M, /mob/new_player))
continue //skip monkeys, leavers and new players
if(M.stat == DEAD && (M.client.prefs.toggles & CHAT_GHOSTSIGHT) && !(M in viewers(src,null)))
M.show_message(message)
/datum/emote/proc/playSound(var/mob/user, var/list/params)
if(!sound)
return
playsound(user, sound, vol)
return 1
/datum/emote/proc/doMime(var/mob/user)
if(mimeText && user.mind && user.mind.miming)
return 1
//Emote Cooldown System (it's so simple!)
/datum/emote/proc/handle_emote_CD(var/mob/user)
if(user.emote_cd == 2) return 1 // Cooldown emotes were disabled by an admin, prevent use
if(user.emote_cd == 1) return 1 // Already on CD, prevent use
user.emote_cd = 1 // Starting cooldown
spawn(cooldown)
if(user.emote_cd == 2) return 1 // Don't reset if cooldown emotes were disabled by an admin during the cooldown
user.emote_cd = 0 // Cooldown complete, ready for more!
return 0 // Proceed with emote
//--FalseIncarnate
/datum/emote/proc/changeTextMacros(var/mob/user, var/message = "")
message = swapHisToYour(user, message)
message = swapHimselfToYourself(user, message)
return message
/datum/emote/proc/getHis(var/mob/user)
var/his = "[user]\his"
his = copytext(his, lentext("[user]") + 1)
return his
/datum/emote/proc/swapHisToYour(var/mob/user, var/message = "")
var/his = getHis(user)
message = replacetext(message, " [his] ", " your ")
return message
/datum/emote/proc/getHimself(var/mob/user)
var/himself = "[user]\himself"
himself = copytext(himself, lentext("[user]") + 1)
return himself
/datum/emote/proc/swapHimselfToYourself(var/mob/user, var/message)
var/himself = getHimself(user)
message = replacetext(message, "[himself]", "yourself")
return message
/******************************************************************************************
Emote Verbs
******************************************************************************************/
/datum/emote/proc/addVerbs(var/mob/user)
if(!istype(user))
return
new /obj/emoteVerb(user, src, commands)
// Dummy object to allow access to the verb, needed as verbs require a valid loc for setting the src
/obj/emoteVerb
var/datum/emote/emote
var/mob/owner
/obj/emoteVerb/New(var/mob/user, var/datum/emote/toAccess)
if(!(istype(user)))
return
if(!(istype(toAccess)))
return
if(!toAccess.commands)
return
owner = user
emote = toAccess
name = "[emote]"
loc = user
user.verbs += new/obj/emoteVerb/proc/runEmote(src, emote.commands[1], emote.desc)
/obj/emoteVerb/proc/runEmote()
set src = usr.contents
set category = "Emotes"
return usr.emoteHandler.runEmote(emote.commands[1])
/obj/emoteVerb/Destroy()
owner.verbs -= new/obj/emoteVerb/proc/runEmote(src, emote.commands[1])
..()
/obj/emoteVerb/custom
obj/emoteVerb/custom/New(var/mob/user)
if(!(istype(user)))
return
owner = user
name = "custom"
user.verbs += new/obj/emoteVerb/proc/runEmote(src, "custom", "Make your own emote")
/obj/emoteVerb/custom/runEmote()
set src = usr.contents
set category = "Emotes"
return usr.emoteHandler.runEmote("me")
/**************************************************************************************************************************
Custom Emotes
As these are made as needed, they aren't searched for the appropriate one. As such, you need to specify conditions for which
one is used in /datum/emote_handler/customEmote().
***************************************************************************************************************************/
/datum/emote/custom
name = "Custom emote"
baseLevel = 0
/datum/emote/custom/New(var/mob/user, var/message = "", var/isAudible)
if(!message)
message = getMessage(user)
text = message
audible = isAudible
/datum/emote/custom/proc/getMessage(var/mob/user)
// user.set_typing_indicator(1)
// user.hud_typing = 1
var/input = sanitize(copytext(input(user,"What do you want to emote?.", "Custom emote") as text|null,1,MAX_MESSAGE_LEN))
// user.hud_typing = 0
// user.set_typing_indicator(0)
input = strip_html_properly(input)
return input
/datum/emote/custom/available(var/mob/user)
return 1
/datum/emote/custom/prevented(var/mob/user)
if(!user.use_me)
return "you are prevented from using custom emotes"
// Yeah, no
/datum/emote/custom/createSelfMessage(var/mob/user, var/list/params, var/message = "")
return
/datum/emote/custom/replaceMobWithYou(var/mob/M, var/message = "", var/mob/user)
return message
/datum/emote/custom/ghost
name = "Ghost emote"
startText = "<span class='prefix'>DEAD: </span>"
emoteSpanClass = "game deadsay"
/datum/emote/custom/ghost/prevented(var/mob/user)
. = ..()
if(.)
return
if(user.client.prefs.muted & MUTE_DEADCHAT)
return "you are muted from deadchat"
if(!(user.client.prefs.toggles & CHAT_DEAD))
return "you have deadchat muted"
if(!user.client.holder)
if(!config.dsay_allowed)
return "deadchat is globally muted"
/datum/emote/custom/ghost/getMessage(var/mob/user)
var/input = sanitize(copytext(input(user,"What do you want to emote?.", "Custom emote") as text|null,1,MAX_MESSAGE_LEN))
input = strip_html_properly(input)
return input
/datum/emote/custom/ghost/processMessage(var/mob/user, var/list/params, var/message = "")
if(!message)
return
log_emote("Ghost/[user.key] : [message]")
sendToDead(message)
-90
View File
@@ -1,90 +0,0 @@
/datum/emoteHandler
var/mob/owner
var/list/commands
/datum/emoteHandler/New(var/mob/user)
owner = user
setupCommands()
/datum/emoteHandler/proc/setupCommands(var/reset = 0)
spawn(0) // needed so at mob creation species is set before emotes are allocated
if(reset)
deleteEmoteVerbs()
commands = new/list()
for(var/e in emotes)
var/datum/emote/emote = e
if(emote.baseLevel || emote.allowParent)
var/datum/emote/found = searchTree(emote)
if(found)
for(var/command in found.commands)
commands[lowertext(command)] = found
found.addVerbs(owner)
/datum/emoteHandler/proc/deleteEmoteVerbs()
for(var/obj/emoteVerb/E in owner.contents)
qdel(E)
/datum/emoteHandler/proc/runEmote(var/command = "", var/message = "", var/audible = 0) // message and audible only used in custom emotes
if(!command)
return 0
if(command == "help")
showCommands()
return 1
var/datum/emote/emote
if(copytext(command, 1, 3) == "me" && !message && lentext(command) >= 4)
message = copytext(command, 4)
command = "me"
if(command == "me")
emote = customEmote(message, audible)
if(!emote)
return 0
if(!commands[command] && !(command == "me"))
to_chat(owner, "<span class='notice'>Unknown emote, please check *help for emotes available to your character</span>")
return 0
if(!emote)
emote = commands[command]
if(!emote.available(owner)) // something's changed, remake the commands list, then try again to see if they've got a different version
setupCommands()
return runEmote(command, message, audible)
var/prevented = emote.prevented(owner)
if(prevented)
to_chat(owner, "<span class='notice'>You can't do that because [prevented]!</span>")
return 0
return emote.doEmote(owner, command)
/datum/emoteHandler/proc/showCommands()
var/emoteList = "Available emotes are "
var/commandAdded = 0
for(var/c in commands)
if(commandAdded)
emoteList += ", "
emoteList += c
commandAdded = 1
to_chat(owner, emoteList)
// recursive search of subtypes - starts checking at the lowest level and breaks out if it finds one that can be done
/datum/emoteHandler/proc/searchTree(var/datum/emote/emote)
var/list/subtypes = subtypesof(emote.type)
var/datum/emote/found
for(var/t in subtypes)
var/datum/emote/em = new t
if(em.allowParent)
continue
found = searchTree(em)
if(found)
return (found)
if(emote.available(owner))
return emote
/datum/emoteHandler/proc/customEmote(var/custom, var/audible)
if(isobserver(owner))
return new /datum/emote/custom/ghost(owner, custom, audible)
return new /datum/emote/custom(owner, custom, audible)
File diff suppressed because it is too large Load Diff
+410
View File
@@ -0,0 +1,410 @@
#define AB_CHECK_RESTRAINED 1
#define AB_CHECK_STUNNED 2
#define AB_CHECK_LYING 4
#define AB_CHECK_CONSCIOUS 8
/datum/action
var/name = "Generic Action"
var/desc = null
var/obj/target = null
var/check_flags = 0
var/processing = 0
var/obj/screen/movable/action_button/button = null
var/button_icon = 'icons/mob/actions.dmi'
var/background_icon_state = "bg_default"
var/icon_icon = 'icons/mob/actions.dmi'
var/button_icon_state = "default"
var/mob/owner
/datum/action/New(var/Target)
target = Target
button = new
button.linked_action = src
button.name = name
/datum/action/Destroy()
if(owner)
Remove(owner)
if(target)
target = null
qdel(button)
button = null
return ..()
/datum/action/proc/Grant(mob/M)
if(owner)
if(owner == M)
return
Remove(owner)
owner = M
M.actions += src
if(M.client)
M.client.screen += button
M.update_action_buttons()
/datum/action/proc/Remove(mob/M)
if(M.client)
M.client.screen -= button
button.moved = FALSE //so the button appears in its normal position when given to another owner.
M.actions -= src
M.update_action_buttons()
owner = null
/datum/action/proc/Trigger()
if(!IsAvailable())
return 0
return 1
/datum/action/proc/Process()
return
/datum/action/proc/IsAvailable()// returns 1 if all checks pass
if(!owner)
return 0
if(check_flags & AB_CHECK_RESTRAINED)
if(owner.restrained())
return 0
if(check_flags & AB_CHECK_STUNNED)
if(owner.stunned || owner.weakened)
return 0
if(check_flags & AB_CHECK_LYING)
if(owner.lying)
return 0
if(check_flags & AB_CHECK_CONSCIOUS)
if(owner.stat)
return 0
return 1
/datum/action/proc/UpdateButtonIcon()
if(button)
button.icon = button_icon
button.icon_state = background_icon_state
ApplyIcon(button)
if(!IsAvailable())
button.color = rgb(128,0,0,128)
else
button.color = rgb(255,255,255,255)
return 1
/datum/action/proc/ApplyIcon(obj/screen/movable/action_button/current_button)
current_button.overlays.Cut()
if(icon_icon && button_icon_state)
var/image/img
img = image(icon_icon, current_button, button_icon_state)
img.pixel_x = 0
img.pixel_y = 0
current_button.overlays += img
//Presets for item actions
/datum/action/item_action
check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_LYING|AB_CHECK_CONSCIOUS
/datum/action/item_action/New(Target)
..()
var/obj/item/I = target
I.actions += src
/datum/action/item_action/Destroy()
var/obj/item/I = target
I.actions -= src
return ..()
/datum/action/item_action/Trigger()
if(!..())
return 0
if(target)
var/obj/item/I = target
I.ui_action_click(owner, type)
return 1
/datum/action/item_action/ApplyIcon(obj/screen/movable/action_button/current_button)
current_button.overlays.Cut()
if(target)
var/obj/item/I = target
var/old_layer = I.layer
var/old_plane = I.plane
I.layer = 21
I.plane = HUD_PLANE
current_button.overlays += I
I.layer = old_layer
I.plane = old_plane
/datum/action/item_action/toggle_light
name = "Toggle Light"
/datum/action/item_action/toggle_hood
name = "Toggle Hood"
/datum/action/item_action/toggle_firemode
name = "Toggle Firemode"
/datum/action/item_action/startchainsaw
name = "Pull The Starting Cord"
/datum/action/item_action/toggle_gunlight
name = "Toggle Gunlight"
/datum/action/item_action/toggle_mode
name = "Toggle Mode"
/datum/action/item_action/toggle_barrier_spread
name = "Toggle Barrier Spread"
/datum/action/item_action/equip_unequip_TED_Gun
name = "Equip/Unequip TED Gun"
/datum/action/item_action/toggle_paddles
name = "Toggle Paddles"
/datum/action/item_action/set_internals
name = "Set Internals"
/datum/action/item_action/set_internals/UpdateButtonIcon()
if(..()) //button available
if(iscarbon(owner))
var/mob/living/carbon/C = owner
if(target == C.internal)
button.icon_state = "bg_default_on"
/datum/action/item_action/toggle_mister
name = "Toggle Mister"
/datum/action/item_action/toggle_helmet_light
name = "Toggle Helmet Light"
/datum/action/item_action/toggle_helmet_mode
name = "Toggle Helmet Mode"
/datum/action/item_action/toggle_hardsuit_mode
name = "Toggle Hardsuit Mode"
/datum/action/item_action/toggle
/datum/action/item_action/toggle/New(Target)
..()
name = "Toggle [target.name]"
button.name = name
/datum/action/item_action/openclose
/datum/action/item_action/openclose/New(Target)
..()
name = "Open/Close [target.name]"
button.name = name
/datum/action/item_action/button
/datum/action/item_action/button/New(Target)
..()
name = "Button/Unbutton [target.name]"
button.name = name
/datum/action/item_action/zipper
/datum/action/item_action/zipper/New(Target)
..()
name = "Zip/Unzip [target.name]"
button.name = name
/datum/action/item_action/halt
name = "HALT!"
/datum/action/item_action/hoot
name = "Hoot"
/datum/action/item_action/caw
name = "Caw"
/datum/action/item_action/toggle_voice_box
name = "Toggle Voice Box"
/datum/action/item_action/change
name = "Change"
/datum/action/item_action/noir
name = "Noir"
/datum/action/item_action/YEEEAAAAAHHHHHHHHHHHHH
name = "YEAH!"
/datum/action/item_action/adjust
/datum/action/item_action/adjust/New(Target)
..()
name = "Adjust [target.name]"
button.name = name
/datum/action/item_action/switch_hud
name = "Switch HUD"
/datum/action/item_action/toggle_wings
name = "Toggle Wings"
/datum/action/item_action/toggle_helmet
name = "Toggle Helmet"
/datum/action/item_action/toggle_jetpack
name = "Toggle Jetpack"
/datum/action/item_action/jetpack_stabilization
name = "Toggle Jetpack Stabilization"
/datum/action/item_action/jetpack_stabilization/IsAvailable()
var/obj/item/weapon/tank/jetpack/J = target
if(!istype(J) || !J.on)
return 0
return ..()
/datum/action/item_action/hands_free
check_flags = AB_CHECK_CONSCIOUS
/datum/action/item_action/hands_free/activate
name = "Activate"
/datum/action/item_action/toggle_research_scanner
name = "Toggle Research Scanner"
button_icon_state = "scan_mode"
/datum/action/item_action/toggle_research_scanner/Trigger()
if(IsAvailable())
owner.research_scanner = !owner.research_scanner
to_chat(owner, "<span class='notice'>Research analyzer is now [owner.research_scanner ? "active" : "deactivated"].</span>")
return 1
/datum/action/item_action/toggle_research_scanner/Remove(mob/living/L)
if(owner)
owner.research_scanner = 0
..()
/datum/action/item_action/toggle_research_scanner/ApplyIcon(obj/screen/movable/action_button/current_button)
current_button.overlays.Cut()
if(button_icon && button_icon_state)
var/image/img = image(button_icon, current_button, "scan_mode")
current_button.overlays += img
/datum/action/item_action/remove_badge
name = "Remove Holobadge"
///prset for organ actions
/datum/action/item_action/organ_action
check_flags = AB_CHECK_CONSCIOUS
/datum/action/item_action/organ_action/IsAvailable()
var/obj/item/organ/internal/I = target
if(!I.owner)
return 0
return ..()
/datum/action/item_action/organ_action/toggle
/datum/action/item_action/organ_action/toggle/New(Target)
..()
name = "Toggle [target.name]"
button.name = name
// for clothing accessories like holsters
/datum/action/item_action/accessory
check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_LYING|AB_CHECK_CONSCIOUS
/datum/action/item_action/accessory/IsAvailable()
. = ..()
if(!.)
return 0
if(target.loc == owner)
return 1
if(istype(target.loc, /obj/item/clothing/under) && target.loc.loc == owner)
return 1
return 0
/datum/action/item_action/accessory/holster
name = "Holster"
/datum/action/item_action/accessory/storage
name = "View Storage"
//Preset for spells
/datum/action/spell_action
check_flags = 0
background_icon_state = "bg_spell"
/datum/action/spell_action/New(Target)
..()
var/obj/effect/proc_holder/spell/S = target
S.action = src
name = S.name
button_icon = S.action_icon
button_icon_state = S.action_icon_state
background_icon_state = S.action_background_icon_state
button.name = name
/datum/action/spell_action/Destroy()
var/obj/effect/proc_holder/spell/S = target
S.action = null
return ..()
/datum/action/spell_action/Trigger()
if(!..())
return 0
if(target)
var/obj/effect/proc_holder/spell = target
spell.Click()
return 1
/datum/action/spell_action/IsAvailable()
if(!target)
return 0
var/obj/effect/proc_holder/spell/spell = target
if(owner)
return spell.can_cast(owner)
return 0
/*
/datum/action/spell_action/alien
/datum/action/spell_action/alien/IsAvailable()
if(!target)
return 0
var/obj/effect/proc_holder/alien/ab = target
if(owner)
return ab.cost_check(ab.check_turf, owner, 1)
return 0
*/
//Preset for general and toggled actions
/datum/action/innate
check_flags = 0
var/active = 0
/datum/action/innate/Trigger()
if(!..())
return 0
if(!active)
Activate()
else
Deactivate()
return 1
/datum/action/innate/proc/Activate()
return
/datum/action/innate/proc/Deactivate()
return
//Preset for action that call specific procs (consider innate)
/datum/action/generic
check_flags = 0
var/procname
/datum/action/generic/Trigger()
if(!..())
return 0
if(target && procname)
call(target,procname)(usr)
return 1
+5 -5
View File
@@ -83,17 +83,17 @@ var/global/const/base_law_type = /datum/ai_laws/nanotrasen
if(full_sync || supplied_laws.len)
S.laws.clear_supplied_laws()
for (var/datum/ai_law/law in ion_laws)
for(var/datum/ai_law/law in ion_laws)
S.laws.add_ion_law(law.law)
for (var/datum/ai_law/law in inherent_laws)
for(var/datum/ai_law/law in inherent_laws)
S.laws.add_inherent_law(law.law)
for (var/datum/ai_law/law in supplied_laws)
for(var/datum/ai_law/law in supplied_laws)
if(law)
S.laws.add_supplied_law(law.index, law.law)
/mob/living/silicon/proc/sync_zeroth(var/datum/ai_law/zeroth_law, var/datum/ai_law/zeroth_law_borg)
if (!is_special_character(src) || mind.original != src)
if(!is_special_character(src) || mind.original != src)
if(zeroth_law_borg)
laws.set_zeroth_law(zeroth_law_borg.law)
else if(zeroth_law)
@@ -159,7 +159,7 @@ var/global/const/base_law_type = /datum/ai_laws/nanotrasen
if(supplied_laws.len >= number && supplied_laws[number])
delete_law(supplied_laws[number])
while (src.supplied_laws.len < number)
while(src.supplied_laws.len < number)
src.supplied_laws += ""
if(state_supplied.len < supplied_laws.len)
state_supplied += 1
+10 -10
View File
@@ -20,13 +20,13 @@
user = nuser
window_id = nwindow_id
if (ntitle)
if(ntitle)
title = format_text(ntitle)
if (nwidth)
if(nwidth)
width = nwidth
if (nheight)
if(nheight)
height = nheight
if (nref)
if(nref)
ref = nref
add_stylesheet("common", 'html/browser/common.css') // this CSS sheet is common to all UIs
@@ -60,18 +60,18 @@
/datum/browser/proc/get_header()
var/key
var/filename
for (key in stylesheets)
for(key in stylesheets)
filename = "[ckey(key)].css"
user << browse_rsc(stylesheets[key], filename)
head_content += "<link rel='stylesheet' type='text/css' href='[filename]'>"
for (key in scripts)
for(key in scripts)
filename = "[ckey(key)].js"
user << browse_rsc(scripts[key], filename)
head_content += "<script type='text/javascript' src='[filename]'></script>"
var/title_attributes = "class='uiTitle'"
if (title_image)
if(title_image)
title_attributes = "class='uiTitle icon' style='background-image: url([title_image]);'"
return {"<!DOCTYPE html>
@@ -103,10 +103,10 @@
/datum/browser/proc/open(var/use_onclose = 1)
var/window_size = ""
if (width && height)
if(width && height)
window_size = "size=[width]x[height];"
user << browse(get_content(), "window=[window_id];[window_size][window_options]")
if (use_onclose)
if(use_onclose)
onclose(user, window_id, ref)
/datum/browser/proc/close()
@@ -118,7 +118,7 @@
/mob/proc/browse_rsc_icon(icon, icon_state, dir = -1)
/*
var/icon/I
if (dir >= 0)
if(dir >= 0)
I = new /icon(icon, icon_state, dir)
else
I = new /icon(icon, icon_state)
+1 -1
View File
@@ -11,7 +11,7 @@ var/global/datum/repository/apc/apc_repository = new()
if(world.time < cache_entry.timestamp)
return cache_entry.data
if (powermonitor && !isnull(powermonitor.powernet))
if(powermonitor && !isnull(powermonitor.powernet))
var/list/L = list()
for(var/obj/machinery/power/terminal/term in powermonitor.powernet.nodes)
if(istype(term.master, /obj/machinery/power/apc))
+1 -1
View File
@@ -62,6 +62,6 @@ var/global/datum/repository/crew/crew_repository = new()
for(var/mob/living/carbon/human/H in mob_list)
if(istype(H.w_uniform, /obj/item/clothing/under))
var/obj/item/clothing/under/C = H.w_uniform
if (C.has_sensor)
if(C.has_sensor)
tracked |= C
return tracked
+2 -2
View File
@@ -156,7 +156,7 @@
blacklist = null
whitelist = list(/obj/item/weapon/tank,/obj/item/weapon/reagent_containers,
/obj/item/stack/medical,/obj/item/weapon/storage/pill_bottle,/obj/item/weapon/gun/syringe,
/obj/item/weapon/c4,/obj/item/weapon/grenade,/obj/item/ammo_box,
/obj/item/weapon/grenade/plastic/c4,/obj/item/weapon/grenade,/obj/item/ammo_box,
/obj/item/weapon/gun/grenadelauncher,/obj/item/weapon/flamethrower, /obj/item/weapon/lighter,
/obj/item/weapon/match,/obj/item/weapon/weldingtool)
@@ -258,7 +258,7 @@
whitelist = list(/obj/item/weapon/banhammer,/obj/item/weapon/sord,/obj/item/weapon/claymore,/obj/item/weapon/holo/esword,
/obj/item/weapon/flamethrower,/obj/item/weapon/grenade,/obj/item/weapon/gun,/obj/item/weapon/hatchet,/obj/item/weapon/katana,
/obj/item/weapon/kitchen/knife,/obj/item/weapon/melee,/obj/item/weapon/nullrod,/obj/item/weapon/pickaxe,/obj/item/weapon/twohanded,
/obj/item/weapon/c4,/obj/item/weapon/scalpel,/obj/item/weapon/shield,/obj/item/weapon/grown/nettle/death)
/obj/item/weapon/grenade/plastic/c4,/obj/item/weapon/scalpel,/obj/item/weapon/shield,/obj/item/weapon/grown/nettle/death)
/datum/cargoprofile/tools
name = "Devices & Tools"
+5 -3
View File
@@ -17,7 +17,7 @@
var/real_title = assignment
for(var/datum/data/record/t in data_core.general)
if (t)
if(t)
if(t.fields["name"] == name)
foundrecord = t
break
@@ -66,6 +66,8 @@
G.fields["sex"] = capitalize(H.gender)
G.fields["species"] = H.get_species()
G.fields["photo"] = get_id_photo(H)
G.fields["photo-south"] = "'data:image/png;base64,[icon2base64(icon(G.fields["photo"], dir = SOUTH))]'"
G.fields["photo-west"] = "'data:image/png;base64,[icon2base64(icon(G.fields["photo"], dir = WEST))]'"
if(H.gen_record && !jobban_isbanned(H, "Records"))
G.fields["notes"] = H.gen_record
else
@@ -129,7 +131,7 @@ proc/get_id_photo(var/mob/living/carbon/human/H)
var/obj/item/organ/external/head/head_organ = H.get_organ("head")
var/g = "m"
if (H.gender == FEMALE)
if(H.gender == FEMALE)
g = "f"
var/icon/icobase = H.species.icobase
@@ -151,7 +153,7 @@ proc/get_id_photo(var/mob/living/carbon/human/H)
// Skin tone
if(H.species.bodyflags & HAS_SKIN_TONE)
if (H.s_tone >= 0)
if(H.s_tone >= 0)
preview_icon.Blend(rgb(H.s_tone, H.s_tone, H.s_tone), ICON_ADD)
else
preview_icon.Blend(rgb(-H.s_tone, -H.s_tone, -H.s_tone), ICON_SUBTRACT)
+37 -30
View File
@@ -20,7 +20,7 @@
title = "[A.name] (\ref[A]) = [A.type]"
#ifdef VARSICON
if (A.icon)
if(A.icon)
body += debug_variable("icon", new/icon(A.icon, A.icon_state, A.dir), 0)
#endif
@@ -43,11 +43,11 @@
if(event.keyCode == 13){ //Enter / return
var vars_ol = document.getElementById('vars');
var lis = vars_ol.getElementsByTagName("li");
for ( var i = 0; i < lis.length; ++i )
for( var i = 0; i < lis.length; ++i )
{
try{
var li = lis\[i\];
if ( li.style.backgroundColor == "#ffee88" )
if( li.style.backgroundColor == "#ffee88" )
{
alist = lis\[i\].getElementsByTagName("a")
if(alist.length > 0){
@@ -62,11 +62,11 @@
if(event.keyCode == 38){ //Up arrow
var vars_ol = document.getElementById('vars');
var lis = vars_ol.getElementsByTagName("li");
for ( var i = 0; i < lis.length; ++i )
for( var i = 0; i < lis.length; ++i )
{
try{
var li = lis\[i\];
if ( li.style.backgroundColor == "#ffee88" )
if( li.style.backgroundColor == "#ffee88" )
{
if( (i-1) >= 0){
var li_new = lis\[i-1\];
@@ -83,11 +83,11 @@
if(event.keyCode == 40){ //Down arrow
var vars_ol = document.getElementById('vars');
var lis = vars_ol.getElementsByTagName("li");
for ( var i = 0; i < lis.length; ++i )
for( var i = 0; i < lis.length; ++i )
{
try{
var li = lis\[i\];
if ( li.style.backgroundColor == "#ffee88" )
if( li.style.backgroundColor == "#ffee88" )
{
if( (i+1) < lis.length){
var li_new = lis\[i+1\];
@@ -113,11 +113,11 @@
var vars_ol = document.getElementById('vars');
var lis = vars_ol.getElementsByTagName("li");
for ( var i = 0; i < lis.length; ++i )
for( var i = 0; i < lis.length; ++i )
{
try{
var li = lis\[i\];
if ( li.innerText.toLowerCase().indexOf(filter) == -1 )
if( li.innerText.toLowerCase().indexOf(filter) == -1 )
{
vars_ol.removeChild(li);
i--;
@@ -126,10 +126,10 @@
}
}
var lis_new = vars_ol.getElementsByTagName("li");
for ( var j = 0; j < lis_new.length; ++j )
for( var j = 0; j < lis_new.length; ++j )
{
var li1 = lis\[j\];
if (j == 0){
if(j == 0){
li1.style.backgroundColor = "#ffee88";
}else{
li1.style.backgroundColor = "white";
@@ -234,6 +234,7 @@
body += "<option value='?_src_=vars;mark_object=\ref[D]'>Mark Object</option>"
body += "<option value='?_src_=vars;proc_call=\ref[D]'>Call Proc</option>"
body += "<option value='?_src_=vars;jump_to=\ref[D]'>Jump to Object</option>"
if(ismob(D))
body += "<option value='?_src_=vars;mob_player_panel=\ref[D]'>Show player panel</option>"
@@ -293,18 +294,18 @@
body += "<ol id='vars'>"
var/list/names = list()
for (var/V in D.vars)
for(var/V in D.vars)
names += V
names = sortList(names)
for (var/V in names)
for(var/V in names)
body += debug_variable(V, D.vars[V], 0, D)
body += "</ol>"
var/html = "<html><head>"
if (title)
if(title)
html += "<title>[title]</title>"
html += {"<style>
body
@@ -342,13 +343,13 @@ body
else
html += "<li>"
if (isnull(value))
if(isnull(value))
html += "[name] = <span class='value'>null</span>"
else if (istext(value))
else if(istext(value))
html += "[name] = <span class='value'>\"[value]\"</span>"
else if (isicon(value))
else if(isicon(value))
#ifdef VARSICON
var/icon/I = new/icon(value)
var/rnd = rand(1,10000)
@@ -359,7 +360,7 @@ body
html += "[name] = /icon (<span class='value'>[value]</span>)"
#endif
/* else if (istype(value, /image))
/* else if(istype(value, /image))
#ifdef VARSICON
var/rnd = rand(1, 10000)
var/image/I = value
@@ -370,22 +371,22 @@ body
html += "[name] = /image (<span class='value'>[value]</span>)"
#endif
*/
else if (isfile(value))
else if(isfile(value))
html += "[name] = <span class='value'>'[value]'</span>"
else if (istype(value, /datum))
else if(istype(value, /datum))
var/datum/D = value
html += "<a href='?_src_=vars;Vars=\ref[value]'>[name] \ref[value]</a> = [D.type]"
else if (istype(value, /client))
else if(istype(value, /client))
var/client/C = value
html += "<a href='?_src_=vars;Vars=\ref[value]'>[name] \ref[value]</a> = [C] [C.type]"
//
else if (istype(value, /list))
else if(istype(value, /list))
var/list/L = value
html += "[name] = /list ([L.len])"
if (L.len > 0 && !(name == "underlays" || name == "overlays" || name == "vars" || L.len > 500))
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>"
@@ -393,12 +394,8 @@ body
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 += debug_variable(index, L[index], level + 1)
for(var/entry in L)
html += debug_variable(index, L[index], level + 1)
index++
html += "</ul>"
@@ -736,6 +733,17 @@ body
if(T)
callproc_datum(T)
else if(href_list["jump_to"])
if(!check_rights(R_ADMIN))
return
var/atom/A = locate(href_list["jump_to"])
var/turf/T = get_turf(A)
if(T)
usr.client.jumptoturf(T)
href_list["datumrefresh"] = href_list["jump_to"]
else if(href_list["rotatedatum"])
if(!check_rights(R_DEBUG|R_ADMIN)) return
@@ -1080,4 +1088,3 @@ body
src.debug_variables(DAT)
return
@@ -30,7 +30,7 @@ Bonus
var/mob/living/M = A.affected_mob
switch(A.stage)
if(4, 5)
if (M.reagents.get_reagent_amount("salbutamol") < 20)
if(M.reagents.get_reagent_amount("salbutamol") < 20)
M.reagents.add_reagent("salbutamol", 20)
else
if(prob(SYMPTOM_ACTIVATION_PROB * 5))
@@ -91,12 +91,12 @@ Bonus
if(prob(15))
M.reagents.add_reagent("morphine",rand(5,7))
if(4)
M.reagents.add_reagent_list(list("ethanol",rand(7,15),"lsd",rand(5,10)))
M.reagents.add_reagent_list(list("ethanol"=rand(7,15),"lsd"=rand(5,10)))
to_chat(M, "<span class='warning'><b>You try to focus on not dying.</b></span>")
if(prob(20))
M.reagents.add_reagent("morphine",rand(5,7))
if(5)
M.reagents.add_reagent_list(list("haloperidol",rand(5,15),"ethanol",rand(7,20),"lsd",rand(5,15)))
M.reagents.add_reagent_list(list("haloperidol"=rand(5,15),"ethanol"=rand(7,20),"lsd"=rand(5,15)))
to_chat(M, "<span class='warning'><b>u can count 2 potato!</b></span>")
if(prob(25))
M.reagents.add_reagent("morphine",rand(5,7))
@@ -30,7 +30,7 @@ Bonus
var/mob/living/M = A.affected_mob
switch(A.stage)
if(5)
if (M.reagents.get_reagent_amount("ephedrine") < 10)
if(M.reagents.get_reagent_amount("ephedrine") < 10)
M.reagents.add_reagent("ephedrine", 10)
else
if(prob(SYMPTOM_ACTIVATION_PROB * 5))
@@ -79,7 +79,7 @@ Bonus
var/mob/living/M = A.affected_mob
switch(A.stage)
if(4, 5)
if (M.reagents.get_reagent_amount("oculine") < 20)
if(M.reagents.get_reagent_amount("oculine") < 20)
M.reagents.add_reagent("oculine", 20)
else
if(prob(SYMPTOM_ACTIVATION_PROB * 5))
+4 -4
View File
@@ -30,14 +30,14 @@
if(2)
if(prob(5))
affected_mob.emote(pick("twitch_s", "scream"))
if (prob(5))
if(prob(5))
var/speak = pick("AAARRGGHHH!!!!", "GRR!!!", "FUCK!! FUUUUUUCK!!!", "FUCKING SHITCOCK!!", "WROOAAAGHHH!!")
affected_mob.say(speak)
if (prob(15))
if(prob(15))
affected_mob.visible_message("<span class='danger'>[affected_mob] twitches violently!</span>")
affected_mob.drop_l_hand()
affected_mob.drop_r_hand()
if (prob(33))
if(prob(33))
if(affected_mob.incapacitated())
affected_mob.visible_message("<span class='danger'>[affected_mob] spasms and twitches!</span>")
return
@@ -46,7 +46,7 @@
if(M == affected_mob)
continue
var/damage = rand(1, 5)
if (prob(80))
if(prob(80))
playsound(affected_mob.loc, "punch", 25, 1, -1)
affected_mob.visible_message("<span class='danger'>[affected_mob] hits [M] with their thrashing!</span>")
M.adjustBruteLoss(damage)
+1 -1
View File
@@ -62,7 +62,7 @@
return
/datum/disease/dnaspread/Destroy()
if (original_dna && transformed && affected_mob)
if(original_dna && transformed && affected_mob)
original_dna.transfer_identity(affected_mob, transfer_SE = 1)
affected_mob.real_name = affected_mob.dna.real_name
affected_mob.updateappearance(mutcolor_update=1)
+1 -1
View File
@@ -20,7 +20,7 @@
if(prob(50))
affected_mob.Jitter(25)
if(2)
if (prob(50))
if(prob(50))
affected_mob.visible_message("<span class='danger'>[affected_mob] laughs uncontrollably!</span>")
affected_mob.Stun(10)
affected_mob.Weaken(10)
+10 -10
View File
@@ -34,11 +34,11 @@
to_chat(affected_mob, "<span class='notice'>You feel better.</span>")
cure()
return
if (prob(8))
if(prob(8))
to_chat(affected_mob, "<span class='danger'>Your head hurts.</span>")
if (prob(9))
if(prob(9))
to_chat(affected_mob, "You feel a tingling sensation in your chest.")
if (prob(9))
if(prob(9))
to_chat(affected_mob, "<span class='danger'>You feel angry.</span>")
if(2)
if(restcure)
@@ -46,14 +46,14 @@
to_chat(affected_mob, "<span class='notice'>You feel better.</span>")
cure()
return
if (prob(8))
if(prob(8))
to_chat(affected_mob, "<span class='danger'>Your skin feels loose.</span>")
if (prob(10))
if(prob(10))
to_chat(affected_mob, "You feel very strange.")
if (prob(4))
if(prob(4))
to_chat(affected_mob, "<span class='danger'>You feel a stabbing pain in your head!</span>")
affected_mob.Paralyse(2)
if (prob(4))
if(prob(4))
to_chat(affected_mob, "<span class='danger'>Your stomach churns.</span>")
if(3)
if(restcure)
@@ -61,10 +61,10 @@
to_chat(affected_mob, "<span class='notice'>You feel better.</span>")
cure()
return
if (prob(10))
if(prob(10))
to_chat(affected_mob, "<span class='danger'>Your entire body vibrates.</span>")
if (prob(35))
if(prob(35))
if(prob(50))
scramble(1, affected_mob, rand(15, 45))
else
@@ -76,7 +76,7 @@
to_chat(affected_mob, "<span class='notice'>You feel better.</span>")
cure()
return
if (prob(60))
if(prob(60))
if(prob(50))
scramble(1, affected_mob, rand(15, 45))
else
+11 -11
View File
@@ -21,16 +21,16 @@
..()
switch(stage)
if(1)
if (prob(stage_prob) && stage1)
if(prob(stage_prob) && stage1)
to_chat(affected_mob, pick(stage1))
if(2)
if (prob(stage_prob) && stage2)
if(prob(stage_prob) && stage2)
to_chat(affected_mob, pick(stage2))
if(3)
if (prob(stage_prob*2) && stage3)
if(prob(stage_prob*2) && stage3)
to_chat(affected_mob, pick(stage3))
if(4)
if (prob(stage_prob*2) && stage4)
if(prob(stage_prob*2) && stage4)
to_chat(affected_mob, pick(stage4))
if(5)
do_disease_transformation(affected_mob)
@@ -134,13 +134,13 @@
..()
switch(stage)
if(3)
if (prob(8))
if(prob(8))
affected_mob.say(pick("Beep, boop", "beep, beep!", "Boop...bop"))
if (prob(4))
if(prob(4))
to_chat(affected_mob, "<span class='danger'>You feel a stabbing pain in your head.</span>")
affected_mob.Paralyse(2)
if(4)
if (prob(20))
if(prob(20))
affected_mob.say(pick("beep, beep!", "Boop bop boop beep.", "kkkiiiill mmme", "I wwwaaannntt tttoo dddiiieeee..."))
@@ -165,11 +165,11 @@
..()
switch(stage)
if(3)
if (prob(4))
if(prob(4))
to_chat(affected_mob, "<span class='danger'>You feel a stabbing pain in your head.</span>")
affected_mob.Paralyse(2)
if(4)
if (prob(20))
if(prob(20))
affected_mob.say(pick("You look delicious.", "Going to... devour you...", "Hsssshhhhh!"))
@@ -221,10 +221,10 @@
..()
switch(stage)
if(3)
if (prob(8))
if(prob(8))
affected_mob.say(pick("YAP", "Woof!"))
if(4)
if (prob(20))
if(prob(20))
affected_mob.say(pick("Bark!", "AUUUUUU"))
/datum/disease/transformation/morph
@@ -45,7 +45,7 @@
proc/custom_action(step, used_atom, user)
if(istype(used_atom, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/W = used_atom
if (W.remove_fuel(0, user))
if(W.remove_fuel(0, user))
playsound(holder, 'sound/items/Welder2.ogg', 50, 1)
else
return 0
+126 -32
View File
@@ -9,6 +9,7 @@
/datum/map_template/New(path = null, map = null, rename = null)
if(path)
mappath = path
if(mappath)
preload_size(mappath)
if(map)
mapfile = map
@@ -16,52 +17,145 @@
name = rename
/datum/map_template/proc/preload_size(path)
var/quote = ascii2text(34)
var/map_file = file2text(path)
var/key_len = length(copytext(map_file,2,findtext(map_file,quote,2,0)))
//assuming one map per file since more makes no sense for templates anyway
var/mapstart = findtext(map_file,"\n(1,1,") //todo replace with something saner
var/content = copytext(map_file,findtext(map_file,quote+"\n",mapstart,0)+2,findtext(map_file,"\n"+quote,mapstart,0)+1)
var/line_len = length(copytext(content,1,findtext(content,"\n",2,0)))
width = line_len/key_len
height = length(content)/(line_len+1)
var/bounds = maploader.load_map(file(path), 1, 1, 1, cropMap = 0, measureOnly = 1)
if(bounds)
width = bounds[MAP_MAXX] // Assumes all templates are rectangular, have a single Z level, and begin at 1,1,1
height = bounds[MAP_MAXY]
return bounds
/datum/map_template/proc/load(turf/T, centered = 0)
var/turf/placement = T
var/min_x = placement.x
var/min_y = placement.y
if(centered)
T = locate(T.x - round(width / 2), T.y - round(height / 2), T.z)
min_x -= round(width/2)
min_y -= round(height/2)
var/max_x = min_x + width - 1
var/max_y = min_y + height - 1
if(!T)
return
if(T.x+width > world.maxx)
return
if(T.y+height > world.maxy)
return
return 0
var/turf/bot_left = locate(max(1, min_x), max(1, min_y), placement.z)
var/turf/top_right = locate(min(world.maxx, max_x), min(world.maxy, max_y), placement.z)
// 1 bigger, to update the turf smoothing
var/turf/ST_bot_left = locate(max(1, min_x-1), max(1, min_y-1), placement.z)
var/turf/ST_top_right = locate(min(world.maxx, max_x+1), min(world.maxy, max_y+1), placement.z)
// This is to place a freeze on initialization until the map's done loading
// otherwise atmos and stuff will start running mid-load
// This system will metaphorically snap in half (not postpone init everywhere)
// if given a multi-z template
// it might need to be adapted for that when that time comes
zlevels.add_dirt(placement.z)
var/list/bounds = maploader.load_map(get_file(), min_x, min_y, placement.z, cropMap = 1)
if(!bounds)
return 0
if(bot_left == null || top_right == null)
log_debug("One of the late setup corners is bust")
else
log_debug("Late Setup from ([bot_left.x],[bot_left.y]) to ([top_right.x],[top_right.y])")
if(ST_bot_left == null || ST_top_right == null)
log_debug("One of the smoothing corners is bust")
else
log_debug("Tile smoothing from ([ST_bot_left.x],[ST_bot_left.y]) to ([ST_top_right.x],[ST_top_right.y])")
maploader.load_map(get_file(), T.x-1, T.y-1, T.z)
late_setup_level(
block(T, locate(T.x + width - 1, T.y + height - 1, T.z)),
block(locate(T.x - 1, T.y - 1, T.z), locate(T.x + width, T.y + height, T.z)))
block(bot_left, top_right),
block(ST_bot_left, ST_top_right))
zlevels.remove_dirt(placement.z)
log_game("[name] loaded at at [T.x],[T.y],[T.z]")
log_game("[name] loaded at [min_x],[min_y],[placement.z]")
return 1
/datum/map_template/proc/get_file()
if(mapfile)
return mapfile
if(mappath)
mapfile = file(mappath)
return mapfile
. = mapfile
else if(mappath)
. = file(mappath)
if(!.)
log_to_dd(" The file of [src] appears to be empty/non-existent.")
/datum/map_template/proc/get_affected_turfs(turf/T, centered = 0)
var/turf/placement = T
var/min_x = placement.x
var/min_y = placement.y
if(centered)
var/turf/corner = locate(placement.x - round(width/2), placement.y - round(height/2), placement.z)
if(corner)
placement = corner
return block(placement, locate(placement.x+width-1, placement.y+height-1, placement.z))
min_x -= round(width/2)
min_y -= round(height/2)
var/max_x = min_x + width-1
var/max_y = min_y + height-1
placement = locate(max(min_x,1), max(min_y,1), placement.z)
return block(placement, locate(min(max_x, world.maxx), min(max_y, world.maxy), placement.z))
/datum/map_template/proc/fits_in_map_bounds(turf/T, centered = 0)
var/turf/placement = T
var/min_x = placement.x
var/min_y = placement.y
if(centered)
min_x -= round(width/2)
min_y -= round(height/2)
var/max_x = min_x + width-1
var/max_y = min_y + height-1
if(min_x < 1 || min_y < 1 || max_x > world.maxx || max_y > world.maxy)
return 0
else
return 1
/proc/preloadTemplates(path = "_maps/map_files/templates/") //see master controller setup
var/list/filelist = flist(path)
for(var/map in filelist)
var/datum/map_template/T = new(path = "[path][map]", rename = "[map]")
map_templates[T.name] = T
for(var/map in flist(path))
if(cmptext(copytext(map, length(map) - 3), ".dmm"))
var/datum/map_template/T = new(path = "[path][map]", rename = "[map]")
map_templates[T.name] = T
if(!config.disable_space_ruins) // so we don't unnecessarily clutter start-up
preloadRuinTemplates()
//preloadShuttleTemplates()
/proc/preloadRuinTemplates()
// Still supporting bans by filename
var/list/banned
if(fexists("config/spaceRuinBlacklist.txt"))
banned = generateMapList("config/spaceRuinBlacklist.txt")
else
banned = generateMapList("config/example/spaceRuinBlacklist.txt")
//banned += generateMapList("config/lavaRuinBlacklist.txt")
for(var/item in subtypesof(/datum/map_template/ruin))
var/datum/map_template/ruin/ruin_type = item
// screen out the abstract subtypes
if(!initial(ruin_type.id))
continue
var/datum/map_template/ruin/R = new ruin_type()
if(banned.Find(R.mappath))
continue
map_templates[R.name] = R
ruins_templates[R.name] = R
/*
if(istype(R, /datum/map_template/ruin/lavaland))
lava_ruins_templates[R.name] = R
*/
if(istype(R, /datum/map_template/ruin/space))
space_ruins_templates[R.name] = R
/*
/proc/preloadShuttleTemplates()
for(var/item in subtypesof(/datum/map_template/shuttle))
var/datum/map_template/shuttle/shuttle_type = item
if(!(initial(shuttle_type.suffix)))
continue
var/datum/map_template/shuttle/S = new shuttle_type()
shuttle_templates[S.shuttle_id] = S
map_templates[S.shuttle_id] = S
*/
+3 -2
View File
@@ -6,7 +6,8 @@ var/datum/atom_hud/huds = list( \
DATA_HUD_SECURITY_ADVANCED = new/datum/atom_hud/data/human/security/advanced(), \
DATA_HUD_MEDICAL_BASIC = new/datum/atom_hud/data/human/medical/basic(), \
DATA_HUD_MEDICAL_ADVANCED = new/datum/atom_hud/data/human/medical/advanced(), \
DATA_HUD_DIAGNOSTIC = new/datum/atom_hud/data/diagnostic(),
DATA_HUD_DIAGNOSTIC = new/datum/atom_hud/data/diagnostic(), \
DATA_HUD_HYDROPONIC = new/datum/atom_hud/data/hydroponic(), \
GAME_HUD_NATIONS = new/datum/atom_hud/antag(), \
ANTAG_HUD_CULT = new/datum/atom_hud/antag(), \
ANTAG_HUD_REV = new/datum/atom_hud/antag(), \
@@ -17,7 +18,7 @@ var/datum/atom_hud/huds = list( \
ANTAG_HUD_NINJA = new/datum/atom_hud/antag/hidden(),\
ANTAG_HUD_CHANGELING = new/datum/atom_hud/antag/hidden(),\
ANTAG_HUD_VAMPIRE = new/datum/atom_hud/antag/hidden(),\
ANTAG_HUD_ABDUCTOR = new/datum/atom_hud/antag/hidden(),\
ANTAG_HUD_ABDUCTOR = new/datum/atom_hud/antag/hidden()\
)
/datum/atom_hud
+180 -177
View File
@@ -147,27 +147,27 @@
)
var/text = ""
var/mob/living/carbon/human/H = current
if (istype(current, /mob/living/carbon/human))
if(istype(current, /mob/living/carbon/human))
/** Impanted**/
if(isloyal(H))
text = "Loyalty Implant:<a href='?src=\ref[src];implant=remove'>Remove</a>|<b>Implanted</b></br>"
text = "Mindshield Implant:<a href='?src=\ref[src];implant=remove'>Remove</a>|<b>Implanted</b></br>"
else
text = "Loyalty Implant:<b>No Implant</b>|<a href='?src=\ref[src];implant=add'>Implant him!</a></br>"
text = "Mindshield Implant:<b>No Implant</b>|<a href='?src=\ref[src];implant=add'>Implant him!</a></br>"
sections["implant"] = text
/** REVOLUTION ***/
text = "revolution"
if (ticker.mode.config_tag=="revolution")
if(ticker.mode.config_tag=="revolution")
text += uppertext(text)
text = "<i><b>[text]</b></i>: "
if (isloyal(H))
if(isloyal(H))
text += "<b>LOYAL EMPLOYEE</b>|headrev|rev"
else if (src in ticker.mode.head_revolutionaries)
else if(src in ticker.mode.head_revolutionaries)
text = "<a href='?src=\ref[src];revolution=clear'>employee</a>|<b>HEADREV</b>|<a href='?src=\ref[src];revolution=rev'>rev</a>"
text += "<br>Flash: <a href='?src=\ref[src];revolution=flash'>give</a>"
var/list/L = current.get_contents()
var/obj/item/device/flash/flash = locate() in L
if (flash)
if(flash)
if(!flash.broken)
text += "|<a href='?src=\ref[src];revolution=takeflash'>take</a>."
else
@@ -176,9 +176,9 @@
text += "."
text += " <a href='?src=\ref[src];revolution=reequip'>Reequip</a> (gives traitor uplink)."
if (objectives.len==0)
if(objectives.len==0)
text += "<br>Objectives are empty! <a href='?src=\ref[src];revolution=autoobjectives'>Set to kill all heads</a>."
else if (src in ticker.mode.revolutionaries)
else if(src in ticker.mode.revolutionaries)
text += "<a href='?src=\ref[src];revolution=clear'>employee</a>|<a href='?src=\ref[src];revolution=headrev'>headrev</a>|<b>REV</b>"
else
text += "<b>EMPLOYEE</b>|<a href='?src=\ref[src];revolution=headrev'>headrev</a>|<a href='?src=\ref[src];revolution=rev'>rev</a>"
@@ -192,16 +192,16 @@
/** CULT ***/
text = "cult"
if (ticker.mode.config_tag=="cult")
if(ticker.mode.config_tag=="cult")
text = uppertext(text)
text = "<i><b>[text]</b></i>: "
if (isloyal(H))
if(isloyal(H))
text += "<B>LOYAL EMPLOYEE</B>|cultist"
else if (src in ticker.mode.cult)
else if(src in ticker.mode.cult)
text += "<a href='?src=\ref[src];cult=clear'>employee</a>|<b>CULTIST</b>"
text += "<br>Give <a href='?src=\ref[src];cult=tome'>tome</a>|<a href='?src=\ref[src];cult=equip'>equip</a>."
/*
if (objectives.len==0)
if(objectives.len==0)
text += "<br>Objectives are empty! Set to sacrifice and <a href='?src=\ref[src];cult=escape'>escape</a> or <a href='?src=\ref[src];cult=summon'>summon</a>."
*/
else
@@ -217,13 +217,13 @@
/** WIZARD ***/
text = "wizard"
if (ticker.mode.config_tag=="wizard")
if(ticker.mode.config_tag=="wizard")
text = uppertext(text)
text = "<i><b>[text]</b></i>: "
if (src in ticker.mode.wizards)
if(src in ticker.mode.wizards)
text += "<b>YES</b>|<a href='?src=\ref[src];wizard=clear'>no</a>"
text += "<br><a href='?src=\ref[src];wizard=lair'>To lair</a>, <a href='?src=\ref[src];common=undress'>undress</a>, <a href='?src=\ref[src];wizard=dressup'>dress up</a>, <a href='?src=\ref[src];wizard=name'>let choose name</a>."
if (objectives.len==0)
if(objectives.len==0)
text += "<br>Objectives are empty! <a href='?src=\ref[src];wizard=autoobjectives'>Randomize!</a>"
else
text += "<a href='?src=\ref[src];wizard=wizard'>yes</a>|<b>NO</b>"
@@ -237,12 +237,12 @@
/** CHANGELING ***/
text = "changeling"
if (ticker.mode.config_tag=="changeling" || ticker.mode.config_tag=="traitorchan")
if(ticker.mode.config_tag=="changeling" || ticker.mode.config_tag=="traitorchan")
text = uppertext(text)
text = "<i><b>[text]</b></i>: "
if (src in ticker.mode.changelings)
if(src in ticker.mode.changelings)
text += "<b>YES</b>|<a href='?src=\ref[src];changeling=clear'>no</a>"
if (objectives.len==0)
if(objectives.len==0)
text += "<br>Objectives are empty! <a href='?src=\ref[src];changeling=autoobjectives'>Randomize!</a>"
if( changeling && changeling.absorbed_dna.len && (current.real_name != changeling.absorbed_dna[1]) )
text += "<br><a href='?src=\ref[src];changeling=initialdna'>Transform to initial appearance.</a>"
@@ -258,16 +258,20 @@
/** VAMPIRE ***/
text = "vampire"
if (ticker.mode.config_tag=="vampire" || ticker.mode.config_tag=="traitorvamp")
if(ticker.mode.config_tag=="vampire" || ticker.mode.config_tag=="traitorvamp")
text = uppertext(text)
text = "<i><b>[text]</b></i>: "
if (src in ticker.mode.vampires)
if(src in ticker.mode.vampires)
text += "<b>YES</b>|<a href='?src=\ref[src];vampire=clear'>no</a>"
if (objectives.len==0)
if(objectives.len==0)
text += "<br>Objectives are empty! <a href='?src=\ref[src];vampire=autoobjectives'>Randomize!</a>"
else
text += "<a href='?src=\ref[src];vampire=vampire'>yes</a>|<b>NO</b>"
if(current && current.client && (ROLE_VAMPIRE in current.client.prefs.be_special))
text += "</b></i>|Enabled in Prefs<i><b>"
else
text += "</b></i>|Disabled in Prefs<i><b>"
/** Enthralled ***/
text += "<br><b>enthralled</b>"
text = "<i><b>[text]</b></i>: "
@@ -282,18 +286,18 @@
/** NUCLEAR ***/
text = "nuclear"
if (ticker.mode.config_tag=="nuclear")
if(ticker.mode.config_tag=="nuclear")
text = uppertext(text)
text = "<i><b>[text]</b></i>: "
if (src in ticker.mode.syndicates)
if(src in ticker.mode.syndicates)
text += "<b>OPERATIVE</b>|<a href='?src=\ref[src];nuclear=clear'>nanotrasen</a>"
text += "<br><a href='?src=\ref[src];nuclear=lair'>To shuttle</a>, <a href='?src=\ref[src];common=undress'>undress</a>, <a href='?src=\ref[src];nuclear=dressup'>dress up</a>."
var/code
for (var/obj/machinery/nuclearbomb/bombue in machines)
if (length(bombue.r_code) <= 5 && bombue.r_code != "LOLNO" && bombue.r_code != "ADMIN")
for(var/obj/machinery/nuclearbomb/bombue in machines)
if(length(bombue.r_code) <= 5 && bombue.r_code != "LOLNO" && bombue.r_code != "ADMIN")
code = bombue.r_code
break
if (code)
if(code)
text += " Code is [code]. <a href='?src=\ref[src];nuclear=tellcode'>tell the code.</a>"
else
text += "<a href='?src=\ref[src];nuclear=nuclear'>operative</a>|<b>NANOTRASEN</b>"
@@ -307,15 +311,15 @@
/** TRAITOR ***/
text = "traitor"
if (ticker.mode.config_tag=="traitor" || ticker.mode.config_tag=="traitorchan" || ticker.mode.config_tag=="traitorvamp")
if(ticker.mode.config_tag=="traitor" || ticker.mode.config_tag=="traitorchan" || ticker.mode.config_tag=="traitorvamp")
text = uppertext(text)
text = "<i><b>[text]</b></i>: "
if (isloyal(H))
if(isloyal(H))
text +="traitor|<b>LOYAL EMPLOYEE</b>"
else
if (src in ticker.mode.traitors)
if(src in ticker.mode.traitors)
text += "<b>TRAITOR</b>|<a href='?src=\ref[src];traitor=clear'>EMPLOYEE</a>"
if (objectives.len==0)
if(objectives.len==0)
text += "<br>Objectives are empty! <a href='?src=\ref[src];traitor=autoobjectives'>Randomize</a>!"
else
text += "<a href='?src=\ref[src];traitor=traitor'>traitor</a>|<b>EMPLOYEE</b>"
@@ -368,53 +372,53 @@
/** SILICON ***/
if (istype(current, /mob/living/silicon))
if(istype(current, /mob/living/silicon))
text = "silicon"
if (ticker.mode.config_tag=="malfunction")
if(ticker.mode.config_tag=="malfunction")
text = uppertext(text)
text = "<i><b>[text]</b></i>: "
if (istype(current, /mob/living/silicon/ai))
if (src in ticker.mode.malf_ai)
if(istype(current, /mob/living/silicon/ai))
if(src in ticker.mode.malf_ai)
text += "<b>MALF</b>|<a href='?src=\ref[src];silicon=unmalf'>not malf</a>"
else
text += "<a href='?src=\ref[src];silicon=malf'>malf</a>|<b>NOT MALF</b>"
var/mob/living/silicon/robot/robot = current
if (istype(robot) && robot.emagged)
if(istype(robot) && robot.emagged)
text += "<br>Cyborg: Is emagged! <a href='?src=\ref[src];silicon=unemag'>Unemag!</a><br>0th law: [robot.laws.zeroth_law]"
var/mob/living/silicon/ai/ai = current
if (istype(ai) && ai.connected_robots.len)
if(istype(ai) && ai.connected_robots.len)
var/n_e_robots = 0
for (var/mob/living/silicon/robot/R in ai.connected_robots)
if (R.emagged)
for(var/mob/living/silicon/robot/R in ai.connected_robots)
if(R.emagged)
n_e_robots++
text += "<br>[n_e_robots] of [ai.connected_robots.len] slaved cyborgs are emagged. <a href='?src=\ref[src];silicon=unemagcyborgs'>Unemag</a>"
sections["malfunction"] = text
if (ticker.mode.config_tag == "traitorchan")
if (sections["traitor"])
if(ticker.mode.config_tag == "traitorchan")
if(sections["traitor"])
out += sections["traitor"]+"<br>"
if (sections["changeling"])
if(sections["changeling"])
out += sections["changeling"]+"<br>"
sections -= "traitor"
sections -= "changeling"
if (ticker.mode.config_tag == "traitorvamp")
if (sections["traitor"])
if(ticker.mode.config_tag == "traitorvamp")
if(sections["traitor"])
out += sections["traitor"]+"<br>"
if (sections["vampire"])
if(sections["vampire"])
out += sections["vampire"]+"<br>"
sections -= "traitor"
sections -= "vampire"
else
if (sections[ticker.mode.config_tag])
if(sections[ticker.mode.config_tag])
out += sections[ticker.mode.config_tag]+"<br>"
sections -= ticker.mode.config_tag
for (var/i in sections)
if (sections[i])
for(var/i in sections)
if(sections[i])
out += sections[i]+"<br>"
if (((src in ticker.mode.head_revolutionaries) || \
if(((src in ticker.mode.head_revolutionaries) || \
(src in ticker.mode.traitors) || \
(src in ticker.mode.syndicates)) && \
istype(current,/mob/living/carbon/human) )
@@ -422,11 +426,11 @@
text = "Uplink: <a href='?src=\ref[src];common=uplink'>give</a>"
var/obj/item/device/uplink/hidden/suplink = find_syndicate_uplink()
var/crystals
if (suplink)
if(suplink)
crystals = suplink.uses
if (suplink)
if(suplink)
text += "|<a href='?src=\ref[src];common=takeuplink'>take</a>"
if (usr.client.holder.rights & (R_SERVER|R_EVENT))
if(usr.client.holder.rights & (R_SERVER|R_EVENT))
text += ", <a href='?src=\ref[src];common=crystals'>[crystals]</a> crystals"
else
text += ", [crystals] crystals"
@@ -439,7 +443,7 @@
out += memory
out += "<br><a href='?src=\ref[src];memory_edit=1'>Edit memory</a><br>"
out += "Objectives:<br>"
if (objectives.len == 0)
if(objectives.len == 0)
out += "EMPTY<br>"
else
var/obj_count = 1
@@ -455,28 +459,28 @@
/datum/mind/Topic(href, href_list)
if(!check_rights(R_ADMIN)) return
if (href_list["role_edit"])
if(href_list["role_edit"])
var/new_role = input("Select new role", "Assigned role", assigned_role) as null|anything in joblist
if (!new_role) return
if(!new_role) return
assigned_role = new_role
log_admin("[key_name(usr)] has changed [key_name(current)]'s assigned role to [assigned_role]")
message_admins("[key_name_admin(usr)] has changed [key_name_admin(current)]'s assigned role to [assigned_role]")
else if (href_list["memory_edit"])
else if(href_list["memory_edit"])
var/new_memo = copytext(input("Write new memory", "Memory", memory) as null|message,1,MAX_MESSAGE_LEN)
if (isnull(new_memo)) return
if(isnull(new_memo)) return
memory = new_memo
log_admin("[key_name(usr)] has edited [key_name(current)]'s memory")
message_admins("[key_name_admin(usr)] has edited [key_name_admin(current)]'s memory")
else if (href_list["obj_edit"] || href_list["obj_add"])
else if(href_list["obj_edit"] || href_list["obj_add"])
var/datum/objective/objective
var/objective_pos
var/def_value
if (href_list["obj_edit"])
if(href_list["obj_edit"])
objective = locate(href_list["obj_edit"])
if (!objective) return
if(!objective) return
objective_pos = objectives.Find(objective)
//Text strings are easy to manipulate. Revised for simplicity.
@@ -486,12 +490,12 @@
def_value = "custom"
var/new_obj_type = input("Select objective type:", "Objective type", def_value) as null|anything in list("assassinate", "blood", "debrain", "protect", "prevent", "brig", "hijack", "escape", "survive", "steal", "download", "nuclear", "capture", "absorb", "destroy", "maroon", "identity theft", "custom")
if (!new_obj_type) return
if(!new_obj_type) return
var/datum/objective/new_objective = null
switch (new_obj_type)
if ("assassinate","protect","debrain", "brig", "maroon")
switch(new_obj_type)
if("assassinate","protect","debrain", "brig", "maroon")
//To determine what to name the objective in explanation text.
var/objective_type_capital = uppertext(copytext(new_obj_type, 1,2))//Capitalize first letter.
var/objective_type_text = copytext(new_obj_type, 2)//Leave the rest of the text.
@@ -499,19 +503,19 @@
var/list/possible_targets = list("Free objective")
for(var/datum/mind/possible_target in ticker.minds)
if ((possible_target != src) && istype(possible_target.current, /mob/living/carbon/human))
if((possible_target != src) && istype(possible_target.current, /mob/living/carbon/human))
possible_targets += possible_target.current
var/mob/def_target = null
var/objective_list[] = list(/datum/objective/assassinate, /datum/objective/protect, /datum/objective/debrain)
if (objective&&(objective.type in objective_list) && objective:target)
if(objective&&(objective.type in objective_list) && objective:target)
def_target = objective:target.current
var/new_target = input("Select target:", "Objective target", def_target) as null|anything in possible_targets
if (!new_target) return
if(!new_target) return
var/objective_path = text2path("/datum/objective/[new_obj_type]")
if (new_target == "Free objective")
if(new_target == "Free objective")
new_objective = new objective_path
new_objective.owner = src
new_objective:target = null
@@ -523,7 +527,7 @@
//Will display as special role if the target is set as MODE. Ninjas/commandos/nuke ops.
new_objective.explanation_text = "[objective_type] [new_target:real_name], the [new_target:mind:assigned_role=="MODE" ? (new_target:mind:special_role) : (new_target:mind:assigned_role)]."
if ("destroy")
if("destroy")
var/list/possible_targets = active_ais(1)
if(possible_targets.len)
var/mob/new_target = input("Select target:", "Objective target") as null|anything in possible_targets
@@ -534,38 +538,38 @@
else
to_chat(usr, "No active AIs with minds")
if ("prevent")
if("prevent")
new_objective = new /datum/objective/block
new_objective.owner = src
if ("hijack")
if("hijack")
new_objective = new /datum/objective/hijack
new_objective.owner = src
if ("escape")
if("escape")
new_objective = new /datum/objective/escape
new_objective.owner = src
if ("survive")
if("survive")
new_objective = new /datum/objective/survive
new_objective.owner = src
if ("die")
if("die")
new_objective = new /datum/objective/die
new_objective.owner = src
if ("nuclear")
if("nuclear")
new_objective = new /datum/objective/nuclear
new_objective.owner = src
if ("steal")
if (!istype(objective, /datum/objective/steal))
if("steal")
if(!istype(objective, /datum/objective/steal))
new_objective = new /datum/objective/steal
new_objective.owner = src
else
new_objective = objective
var/datum/objective/steal/steal = new_objective
if (!steal.select_target())
if(!steal.select_target())
return
if("download","capture","absorb", "blood")
@@ -574,7 +578,7 @@
def_num = objective.target_amount
var/target_number = input("Input target number:", "Objective", def_num) as num|null
if (isnull(target_number))//Ordinarily, you wouldn't need isnull. In this case, the value may already exist.
if(isnull(target_number))//Ordinarily, you wouldn't need isnull. In this case, the value may already exist.
return
switch(new_obj_type)
@@ -596,11 +600,11 @@
if("identity theft")
var/list/possible_targets = list("Free objective")
for(var/datum/mind/possible_target in ticker.minds)
if ((possible_target != src) && istype(possible_target.current, /mob/living/carbon/human))
if((possible_target != src) && istype(possible_target.current, /mob/living/carbon/human))
possible_targets += possible_target.current
var/new_target = input("Select target:", "Objective target") as null|anything in possible_targets
if (!new_target)
if(!new_target)
return
var/datum/mind/targ = new_target
if(!istype(targ))
@@ -610,16 +614,16 @@
new_objective.owner = src
new_objective.target = new_target
new_objective.explanation_text = "Escape on the shuttle or an escape pod with the identity of [targ.current.real_name], the [targ.assigned_role] while wearing their identification card."
if ("custom")
if("custom")
var/expl = sanitize(copytext(input("Custom objective:", "Objective", objective ? objective.explanation_text : "") as text|null,1,MAX_MESSAGE_LEN))
if (!expl) return
if(!expl) return
new_objective = new /datum/objective
new_objective.owner = src
new_objective.explanation_text = expl
if (!new_objective) return
if(!new_objective) return
if (objective)
if(objective)
objectives -= objective
objectives.Insert(objective_pos, new_objective)
else
@@ -628,7 +632,7 @@
log_admin("[key_name(usr)] has updated [key_name(current)]'s objectives: [new_objective]")
message_admins("[key_name_admin(usr)] has updated [key_name_admin(current)]'s objectives: [new_objective]")
else if (href_list["obj_delete"])
else if(href_list["obj_delete"])
var/datum/objective/objective = locate(href_list["obj_delete"])
if(!istype(objective)) return
objectives -= objective
@@ -653,38 +657,38 @@
if(I && I.implanted)
I.removed(H)
qdel(I)
to_chat(H, "\blue <Font size =3><B>Your loyalty implant has been deactivated.</B></FONT>")
log_admin("[key_name(usr)] has deactivated [key_name(current)]'s loyalty implant")
message_admins("[key_name_admin(usr)] has deactivated [key_name_admin(current)]'s loyalty implant")
to_chat(H, "\blue <Font size =3><B>Your mindshield implant has been deactivated.</B></FONT>")
log_admin("[key_name(usr)] has deactivated [key_name(current)]'s mindshield implant")
message_admins("[key_name_admin(usr)] has deactivated [key_name_admin(current)]'s mindshield implant")
if("add")
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
L.imp_in = H
L.implanted = 1
H.sec_hud_set_implants()
log_admin("[key_name(usr)] has given [key_name(current)] a loyalty implant")
message_admins("[key_name_admin(usr)] has given [key_name_admin(current)] a loyalty implant")
log_admin("[key_name(usr)] has given [key_name(current)] a mindshield implant")
message_admins("[key_name_admin(usr)] has given [key_name_admin(current)] a mindshield implant")
to_chat(H, "\red <Font size =3><B>You somehow have become the recepient of a loyalty transplant, and it just activated!</B></FONT>")
to_chat(H, "\red <Font size =3><B>You somehow have become the recepient of a mindshield transplant, and it just activated!</B></FONT>")
if(src in ticker.mode.revolutionaries)
special_role = null
ticker.mode.revolutionaries -= src
to_chat(src, "\red <Font size = 3><B>The nanobots in the loyalty implant remove all thoughts about being a revolutionary. Get back to work!</B></Font>")
to_chat(src, "\red <Font size = 3><B>The nanobots in the mindshield implant remove all thoughts about being a revolutionary. Get back to work!</B></Font>")
if(src in ticker.mode.head_revolutionaries)
special_role = null
ticker.mode.head_revolutionaries -=src
to_chat(src, "\red <Font size = 3><B>The nanobots in the loyalty implant remove all thoughts about being a revolutionary. Get back to work!</B></Font>")
to_chat(src, "\red <Font size = 3><B>The nanobots in the mindshield implant remove all thoughts about being a revolutionary. Get back to work!</B></Font>")
if(src in ticker.mode.cult)
ticker.mode.cult -= src
ticker.mode.update_cult_icons_removed(src)
special_role = null
var/datum/game_mode/cult/cult = ticker.mode
if (istype(cult))
if(istype(cult))
cult.memorize_cult_objectives(src)
to_chat(current, "\red <FONT size = 3><B>The nanobots in the loyalty implant remove all thoughts about being in a cult. Have a productive day!</B></FONT>")
to_chat(current, "\red <FONT size = 3><B>The nanobots in the mindshield implant remove all thoughts about being in a cult. Have a productive day!</B></FONT>")
memory = ""
else if (href_list["revolution"])
else if(href_list["revolution"])
switch(href_list["revolution"])
if("clear")
@@ -725,11 +729,11 @@
to_chat(current, "\blue You are a member of the revolutionaries' leadership now!")
else
return
if (ticker.mode.head_revolutionaries.len>0)
if(ticker.mode.head_revolutionaries.len>0)
// copy targets
var/datum/mind/valid_head = locate() in ticker.mode.head_revolutionaries
if (valid_head)
for (var/datum/objective/mutiny/O in valid_head.objectives)
if(valid_head)
for(var/datum/objective/mutiny/O in valid_head.objectives)
var/datum/objective/mutiny/rev_obj = new
rev_obj.owner = src
rev_obj.target = O.target
@@ -749,7 +753,7 @@
message_admins("[key_name_admin(usr)] has automatically forged revolutionary objectives for [key_name_admin(current)]")
if("flash")
if (!ticker.mode.equip_revolutionary(current))
if(!ticker.mode.equip_revolutionary(current))
to_chat(usr, "\red Spawning flash failed!")
log_admin("[key_name(usr)] has given [key_name(current)] a flash")
message_admins("[key_name_admin(usr)] has given [key_name_admin(current)] a flash")
@@ -757,7 +761,7 @@
if("takeflash")
var/list/L = current.get_contents()
var/obj/item/device/flash/flash = locate() in L
if (!flash)
if(!flash)
to_chat(usr, "\red Deleting flash failed!")
qdel(flash)
log_admin("[key_name(usr)] has taken [key_name(current)]'s flash")
@@ -766,7 +770,7 @@
if("repairflash")
var/list/L = current.get_contents()
var/obj/item/device/flash/flash = locate() in L
if (!flash)
if(!flash)
to_chat(usr, "\red Repairing flash failed!")
else
flash.broken = 0
@@ -781,13 +785,13 @@
var/fail = 0
fail |= !ticker.mode.equip_traitor(current, 1)
fail |= !ticker.mode.equip_revolutionary(current)
if (fail)
if(fail)
to_chat(usr, "\red Reequipping revolutionary goes wrong!")
return
log_admin("[key_name(usr)] has equipped [key_name(current)] as a revolutionary")
message_admins("[key_name_admin(usr)] has equipped [key_name_admin(current)] as a revolutionary")
else if (href_list["cult"])
else if(href_list["cult"])
switch(href_list["cult"])
if("clear")
if(src in ticker.mode.cult)
@@ -805,7 +809,7 @@
message_admins("[key_name_admin(usr)] has culted [key_name_admin(current)]")
if("tome")
var/mob/living/carbon/human/H = current
if (istype(H))
if(istype(H))
var/obj/item/weapon/tome/T = new(H)
var/list/slots = list (
@@ -816,7 +820,7 @@
"right hand" = slot_r_hand,
)
var/where = H.equip_in_one_of_slots(T, slots)
if (!where)
if(!where)
to_chat(usr, "\red Spawning tome failed!")
qdel(T)
else
@@ -825,12 +829,12 @@
message_admins("[key_name_admin(usr)] has spawned a tome for [key_name_admin(current)]")
if("equip")
if (!ticker.mode.equip_cultist(current))
if(!ticker.mode.equip_cultist(current))
to_chat(usr, "\red Spawning equipment failed!")
log_admin("[key_name(usr)] has equipped [key_name(current)] as a cultist")
message_admins("[key_name_admin(usr)] has equipped [key_name_admin(current)] as a cultist")
else if (href_list["wizard"])
else if(href_list["wizard"])
switch(href_list["wizard"])
if("clear")
@@ -872,7 +876,7 @@
message_admins("[key_name_admin(usr)] has automatically forged wizard objectives for [key_name_admin(current)]")
else if (href_list["changeling"])
else if(href_list["changeling"])
switch(href_list["changeling"])
if("clear")
if(src in ticker.mode.changelings)
@@ -911,7 +915,7 @@
log_admin("[key_name(usr)] has reset [key_name(current)]'s DNA")
message_admins("[key_name_admin(usr)] has reset [key_name_admin(current)]'s DNA")
else if (href_list["vampire"])
else if(href_list["vampire"])
switch(href_list["vampire"])
if("clear")
if(src in ticker.mode.vampires)
@@ -945,7 +949,7 @@
message_admins("[key_name_admin(usr)] has automatically forged objectives for [key_name_admin(current)]")
else if (href_list["nuclear"])
else if(href_list["nuclear"])
var/mob/living/carbon/human/H = current
switch(href_list["nuclear"])
@@ -954,7 +958,7 @@
ticker.mode.syndicates -= src
ticker.mode.update_synd_icons_removed(src)
special_role = null
for (var/datum/objective/nuclear/O in objectives)
for(var/datum/objective/nuclear/O in objectives)
objectives-=O
to_chat(current, "\red <FONT size = 3><B>You have been brainwashed! You are no longer a syndicate operative!</B></FONT>")
log_admin("[key_name(usr)] has de-nuke op'd [key_name(current)]")
@@ -963,7 +967,7 @@
if(!(src in ticker.mode.syndicates))
ticker.mode.syndicates += src
ticker.mode.update_synd_icons_added(src)
if (ticker.mode.syndicates.len==1)
if(ticker.mode.syndicates.len==1)
ticker.mode.prepare_syndicate_leader(src)
else
current.real_name = "[syndicate_name()] Operative #[ticker.mode.syndicates.len-1]"
@@ -986,11 +990,10 @@
qdel(H.head)
qdel(H.shoes)
qdel(H.wear_id)
qdel(H.wear_pda)
qdel(H.wear_suit)
qdel(H.w_uniform)
if (!ticker.mode.equip_syndicate(current))
if(!ticker.mode.equip_syndicate(current))
to_chat(usr, "\red Equipping a syndicate failed!")
return
log_admin("[key_name(usr)] has equipped [key_name(current)] as a nuclear operative")
@@ -998,11 +1001,11 @@
if("tellcode")
var/code
for (var/obj/machinery/nuclearbomb/bombue in machines)
if (length(bombue.r_code) <= 5 && bombue.r_code != "LOLNO" && bombue.r_code != "ADMIN")
for(var/obj/machinery/nuclearbomb/bombue in machines)
if(length(bombue.r_code) <= 5 && bombue.r_code != "LOLNO" && bombue.r_code != "ADMIN")
code = bombue.r_code
break
if (code)
if(code)
store_memory("<B>Syndicate Nuclear Bomb Code</B>: [code]", 0, 0)
to_chat(current, "The nuclear authorization code is: <B>[code]</B>")
log_admin("[key_name(usr)] has given [key_name(current)] the nuclear authorization code")
@@ -1010,7 +1013,7 @@
else
to_chat(usr, "\red No valid nuke found!")
else if (href_list["traitor"])
else if(href_list["traitor"])
switch(href_list["traitor"])
if("clear")
if(src in ticker.mode.traitors)
@@ -1052,18 +1055,13 @@
switch(href_list["shadowling"])
if("clear")
ticker.mode.update_shadow_icons_removed(src)
current.spell_list.Cut()
if(src in ticker.mode.shadows)
ticker.mode.shadows -= src
special_role = null
to_chat(current, "<span class='userdanger'>Your powers have been quenched! You are no longer a shadowling!</span>")
current.spell_list.Cut()
if(current.mind)
current.mind.spell_list.Cut()
message_admins("[key_name_admin(usr)] has de-shadowlinged [current].")
log_admin("[key_name(usr)] has de-shadowlinged [current].")
remove_spell(/obj/effect/proc_holder/spell/targeted/shadowling_hatch)
remove_spell(/obj/effect/proc_holder/spell/targeted/shadowling_ascend)
current.spellremove(current)
current.remove_language("Shadowling Hivemind")
else if(src in ticker.mode.shadowling_thralls)
ticker.mode.remove_thrall(src,0)
@@ -1113,7 +1111,7 @@
else
temp.equip_scientist(current)
else if (href_list["silicon"])
else if(href_list["silicon"])
switch(href_list["silicon"])
if("unmalf")
if(src in ticker.mode.malf_ai)
@@ -1144,9 +1142,9 @@
if("unemag")
var/mob/living/silicon/robot/R = current
if (istype(R))
if(istype(R))
R.emagged = 0
if (R.activated(R.module.emag))
if(R.activated(R.module.emag))
R.module_active = null
if(R.module_state_1 == R.module.emag)
R.module_state_1 = null
@@ -1161,12 +1159,12 @@
message_admins("[key_name_admin(usr)] has un-emagged [key_name_admin(current)]")
if("unemagcyborgs")
if (istype(current, /mob/living/silicon/ai))
if(istype(current, /mob/living/silicon/ai))
var/mob/living/silicon/ai/ai = current
for (var/mob/living/silicon/robot/R in ai.connected_robots)
for(var/mob/living/silicon/robot/R in ai.connected_robots)
R.emagged = 0
if (R.module)
if (R.activated(R.module.emag))
if(R.module)
if(R.activated(R.module.emag))
R.module_active = null
if(R.module_state_1 == R.module.emag)
R.module_state_1 = null
@@ -1180,7 +1178,7 @@
log_admin("[key_name(usr)] has unemagged [key_name(ai)]'s cyborgs")
message_admins("[key_name_admin(usr)] has unemagged [key_name_admin(ai)]'s cyborgs")
else if (href_list["common"])
else if(href_list["common"])
switch(href_list["common"])
if("undress")
if(ishuman(current))
@@ -1199,25 +1197,25 @@
log_admin("[key_name(usr)] has taken [key_name(current)]'s uplink")
message_admins("[key_name_admin(usr)] has taken [key_name_admin(current)]'s uplink")
if("crystals")
if (usr.client.holder.rights & (R_SERVER|R_EVENT))
if(usr.client.holder.rights & (R_SERVER|R_EVENT))
var/obj/item/device/uplink/hidden/suplink = find_syndicate_uplink()
var/crystals
if (suplink)
if(suplink)
crystals = suplink.uses
crystals = input("Amount of telecrystals for [key]","Syndicate uplink", crystals) as null|num
if (!isnull(crystals))
if (suplink)
if(!isnull(crystals))
if(suplink)
suplink.uses = crystals
log_admin("[key_name(usr)] has set [key_name(current)]'s telecrystals to [crystals]")
message_admins("[key_name_admin(usr)] has set [key_name_admin(current)]'s telecrystals to [crystals]")
if("uplink")
if (!ticker.mode.equip_traitor(current, !(src in ticker.mode.traitors)))
if(!ticker.mode.equip_traitor(current, !(src in ticker.mode.traitors)))
to_chat(usr, "\red Equipping a syndicate failed!")
return
log_admin("[key_name(usr)] has given [key_name(current)] an uplink")
message_admins("[key_name_admin(usr)] has given [key_name_admin(current)] an uplink")
else if (href_list["obj_announce"])
else if(href_list["obj_announce"])
var/obj_count = 1
to_chat(current, "\blue Your current objectives:")
for(var/datum/objective/objective in objectives)
@@ -1233,16 +1231,16 @@
// remove traitor uplinks
var/list/L = current.get_contents()
for (var/t in L)
if (istype(t, /obj/item/device/pda))
if (t:uplink) qdel(t:uplink)
for(var/t in L)
if(istype(t, /obj/item/device/pda))
if(t:uplink) qdel(t:uplink)
t:uplink = null
else if (istype(t, /obj/item/device/radio))
if (t:traitorradio) qdel(t:traitorradio)
else if(istype(t, /obj/item/device/radio))
if(t:traitorradio) qdel(t:traitorradio)
t:traitorradio = null
t:traitor_frequency = 0.0
else if (istype(t, /obj/item/weapon/SWF_uplink) || istype(t, /obj/item/weapon/syndicate_uplink))
if (t:origradio)
else if(istype(t, /obj/item/weapon/SWF_uplink) || istype(t, /obj/item/weapon/syndicate_uplink))
if(t:origradio)
var/obj/item/device/radio/R = t:origradio
R.loc = current.loc
R.traitorradio = null
@@ -1261,8 +1259,8 @@
/datum/mind/proc/find_syndicate_uplink()
var/list/L = current.get_contents()
for (var/obj/item/I in L)
if (I.hidden_uplink)
for(var/obj/item/I in L)
if(I.hidden_uplink)
return I.hidden_uplink
return null
@@ -1297,7 +1295,7 @@
if(!(src in ticker.mode.syndicates))
ticker.mode.syndicates += src
ticker.mode.update_synd_icons_added(src)
if (ticker.mode.syndicates.len==1)
if(ticker.mode.syndicates.len==1)
ticker.mode.prepare_syndicate_leader(src)
else
current.real_name = "[syndicate_name()] Operative #[ticker.mode.syndicates.len-1]"
@@ -1318,7 +1316,6 @@
qdel(H.head)
qdel(H.shoes)
qdel(H.wear_id)
qdel(H.wear_pda)
qdel(H.wear_suit)
qdel(H.w_uniform)
@@ -1371,7 +1368,7 @@
var/mob/living/carbon/human/H = current
if (istype(H))
if(istype(H))
var/obj/item/weapon/tome/T = new(H)
var/list/slots = list (
@@ -1382,19 +1379,19 @@
"right hand" = slot_r_hand,
)
var/where = H.equip_in_one_of_slots(T, slots)
if (!where)
if(!where)
else
to_chat(H, "A tome, a message from your new master, appears in your [where].")
if (!ticker.mode.equip_cultist(current))
if(!ticker.mode.equip_cultist(current))
to_chat(H, "Spawning an amulet from your Master failed.")
/datum/mind/proc/make_Rev()
if (ticker.mode.head_revolutionaries.len>0)
if(ticker.mode.head_revolutionaries.len>0)
// copy targets
var/datum/mind/valid_head = locate() in ticker.mode.head_revolutionaries
if (valid_head)
for (var/datum/objective/mutiny/O in valid_head.objectives)
if(valid_head)
for(var/datum/objective/mutiny/O in valid_head.objectives)
var/datum/objective/mutiny/rev_obj = new
rev_obj.owner = src
rev_obj.target = O.target
@@ -1485,17 +1482,17 @@
return (duration <= world.time - brigged_since)
/datum/mind/proc/AddSpell(var/obj/effect/proc_holder/spell/spell)
spell_list += spell
if(!spell.action)
spell.action = new/datum/action/spell_action
spell.action.target = spell
spell.action.name = spell.name
spell.action.button_icon = spell.action_icon
spell.action.button_icon_state = spell.action_icon_state
spell.action.background_icon_state = spell.action_background_icon_state
spell.action.Grant(current)
return
/datum/mind/proc/AddSpell(obj/effect/proc_holder/spell/S)
spell_list += S
S.action.Grant(current)
/datum/mind/proc/RemoveSpell(obj/effect/proc_holder/spell/spell) //To remove a specific spell from a mind
if(!spell)
return
for(var/obj/effect/proc_holder/spell/S in spell_list)
if(istype(S, spell))
qdel(S)
spell_list -= S
/datum/mind/proc/transfer_actions(var/mob/living/new_character)
if(current && current.actions)
@@ -1504,16 +1501,22 @@
transfer_mindbound_actions(new_character)
/datum/mind/proc/transfer_mindbound_actions(var/mob/living/new_character)
for(var/obj/effect/proc_holder/spell/spell in spell_list)
if(!spell.action) // Unlikely but whatever
spell.action = new/datum/action/spell_action
spell.action.target = spell
spell.action.name = spell.name
spell.action.button_icon = spell.action_icon
spell.action.button_icon_state = spell.action_icon_state
spell.action.background_icon_state = spell.action_background_icon_state
spell.action.Grant(new_character)
return
for(var/X in spell_list)
var/obj/effect/proc_holder/spell/S = X
S.action.Grant(new_character)
/datum/mind/proc/get_ghost(even_if_they_cant_reenter)
for(var/mob/dead/observer/G in dead_mob_list)
if(G.mind == src)
if(G.can_reenter_corpse || even_if_they_cant_reenter)
return G
break
/datum/mind/proc/grab_ghost(force)
var/mob/dead/observer/G = get_ghost(even_if_they_cant_reenter = force)
. = G
if(G)
G.reenter_corpse()
//Initialisation procs
/mob/proc/mind_initialize()
+8 -8
View File
@@ -7,9 +7,9 @@
/datum/progressbar/New(mob/User, goal_number, atom/target)
. = ..()
if (!istype(target))
if(!istype(target))
EXCEPTION("Invalid target given")
if (goal_number)
if(goal_number)
goal = goal_number
bar = image('icons/effects/progessbar.dmi', target, "prog_bar_0")
bar.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
@@ -20,23 +20,23 @@
/datum/progressbar/proc/update(progress)
// to_chat(world, "Update [progress] - [goal] - [(progress / goal)] - [((progress / goal) * 100)] - [round(((progress / goal) * 100), 5)]")
if (!user || !user.client)
if(!user || !user.client)
shown = 0
return
if (user.client != client)
if (client)
if(user.client != client)
if(client)
client.images -= bar
if (user.client)
if(user.client)
user.client.images += bar
progress = Clamp(progress, 0, goal)
bar.icon_state = "prog_bar_[round(((progress / goal) * 100), 5)]"
if (!shown)
if(!shown)
user.client.images += bar
shown = 1
/datum/progressbar/Destroy()
if (client)
if(client)
client.images -= bar
qdel(bar)
. = ..()
+18 -18
View File
@@ -44,14 +44,14 @@
/datum/recipe/proc/check_reagents(var/datum/reagents/avail_reagents) //1=precisely, 0=insufficiently, -1=superfluous
. = 1
for (var/r_r in reagents)
for(var/r_r in reagents)
var/aval_r_amnt = avail_reagents.get_reagent_amount(r_r)
if (!(abs(aval_r_amnt - reagents[r_r])<0.5)) //if NOT equals
if (aval_r_amnt>reagents[r_r])
if(!(abs(aval_r_amnt - reagents[r_r])<0.5)) //if NOT equals
if(aval_r_amnt>reagents[r_r])
. = -1
else
return 0
if ((reagents?(reagents.len):(0)) < avail_reagents.reagent_list.len)
if((reagents?(reagents.len):(0)) < avail_reagents.reagent_list.len)
return -1
return .
@@ -76,7 +76,7 @@
/datum/recipe/proc/check_items(var/obj/container as obj)
. = 1
if (items && items.len)
if(items && items.len)
var/list/checklist = list()
checklist = items.Copy() // You should really trust Copy
for(var/obj/O in container)
@@ -85,20 +85,20 @@
var/found = 0
for(var/i = 1; i < checklist.len+1; i++)
var/item_type = checklist[i]
if (istype(O,item_type))
if(istype(O,item_type))
checklist.Cut(i, i+1)
found = 1
break
if (!found)
if(!found)
. = 0
if (checklist.len)
if(checklist.len)
. = -1
return .
//general version
/datum/recipe/proc/make(var/obj/container as obj)
var/obj/result_obj = new result(container)
for (var/obj/O in (container.contents-result_obj))
for(var/obj/O in (container.contents-result_obj))
O.reagents.trans_to(result_obj, O.reagents.total_volume)
qdel(O)
container.reagents.clear_reagents()
@@ -108,8 +108,8 @@
// food-related
/datum/recipe/proc/make_food(var/obj/container as obj)
var/obj/result_obj = new result(container)
for (var/obj/O in (container.contents-result_obj))
if (O.reagents)
for(var/obj/O in (container.contents-result_obj))
if(O.reagents)
O.reagents.del_reagent("nutriment")
O.reagents.update_total()
O.reagents.trans_to(result_obj, O.reagents.total_volume)
@@ -119,22 +119,22 @@
return result_obj
/proc/select_recipe(var/list/datum/recipe/avaiable_recipes, var/obj/obj as obj, var/exact = 1 as num)
if (!exact)
if(!exact)
exact = -1
var/list/datum/recipe/possible_recipes = new
for (var/datum/recipe/recipe in avaiable_recipes)
if (recipe.check_reagents(obj.reagents)==exact && recipe.check_items(obj)==exact && recipe.check_fruit(obj)==exact)
for(var/datum/recipe/recipe in avaiable_recipes)
if(recipe.check_reagents(obj.reagents)==exact && recipe.check_items(obj)==exact && recipe.check_fruit(obj)==exact)
possible_recipes+=recipe
if (possible_recipes.len==0)
if(possible_recipes.len==0)
return null
else if (possible_recipes.len==1)
else if(possible_recipes.len==1)
return possible_recipes[1]
else //okay, let's select the most complicated recipe
var/highest_count = 0
. = possible_recipes[1]
for (var/datum/recipe/recipe in possible_recipes)
for(var/datum/recipe/recipe in possible_recipes)
var/count = ((recipe.items)?(recipe.items.len):0) + ((recipe.reagents)?(recipe.reagents.len):0) + ((recipe.fruit)?(recipe.fruit.len):0)
if (count >= highest_count)
if(count >= highest_count)
highest_count = count
. = recipe
return .
+21
View File
@@ -0,0 +1,21 @@
/datum/map_template/ruin
//name = "A Chest of Doubloons"
name = null
var/id = null // For blacklisting purposes, all ruins need an id
var/description = "In the middle of a clearing in the rockface, there's a \
chest filled with gold coins with Spanish engravings. How is there a \
wooden container filled with 18th century coinage in the middle of a \
lavawracked hellscape? It is clearly a mystery."
var/cost = null
var/allow_duplicates = FALSE //A bit boring, don't you think? You can always explicitly allow it on a ruin definition
var/prefix = null
var/suffix = null
/datum/map_template/ruin/New()
if(!name && id)
name = id
mappath = prefix + suffix
..(path = mappath)
+162
View File
@@ -0,0 +1,162 @@
//The bigger ones lag like hell if there is more than one on a z-level, so cost 2 for them
/datum/map_template/ruin/space
prefix = "_maps/map_files/RandomRuins/SpaceRuins/"
cost = 1
/datum/map_template/ruin/space/zoo
id = "zoo"
suffix = "abandonedzoo.dmm"
name = "Biological Storage Facility"
description = "In case society crumbles, we will be able to restore our \
zoos to working order with the breeding stock kept in these 100% \
secure and unbreachable storage facilities. At no point has anything \
escaped. That's our story, and we're sticking to it."
cost = 2
/datum/map_template/ruin/space/asteroid1
id = "asteroid1"
suffix = "asteroid1.dmm"
name = "Asteroid 1"
description = "I-spy with my little eye, something beginning with R."
/datum/map_template/ruin/space/asteroid2
id = "asteroid2"
suffix = "asteroid2.dmm"
name = "Asteroid 2"
description = "Oh my god, a giant rock!"
/datum/map_template/ruin/space/asteroid3
id = "asteroid3"
suffix = "asteroid3.dmm"
name = "Asteroid 3"
description = "This asteroid floating in space has no official \
designation, because the scientist that discovered it deemed it \
'super dull'."
/datum/map_template/ruin/space/asteroid4
id = "asteroid4"
suffix = "asteroid4.dmm"
name = "Asteroid 4"
description = "Nanotrasen Escape Pods have a 100%* success rate, and a \
99%* customer satisfaction rate. *Please note that these statistics, \
are taken from pods that have successfully docked with a recovery \
vessel."
/datum/map_template/ruin/space/asteroid5
id = "asteroid5"
suffix = "asteroid5.dmm"
name = "Asteroid 5"
description = "Oh my god, another giant rock!"
/datum/map_template/ruin/space/deep_storage
id = "deep-storage"
suffix = "deepstorage.dmm"
name = "Survivalist Bunker"
description = "Assume the best, prepare for the worst. Generally, you \
should do so by digging a three man heavily fortified bunker into \
a giant unused asteroid. Then make it self sufficient, mask any \
evidence of construction, hook it covertly into the \
telecommunications network and hope for the best."
cost = 2
/datum/map_template/ruin/space/derelict1
id = "derelict1"
suffix = "derelict1.dmm"
name = "Derelict 1"
description = "Nothing to see here citizen, move along, certainly no \
xeno outbreaks on this piece of station debris. That purple stuff? \
It's uh... station nectar. It's a top secret research installation."
/datum/map_template/ruin/space/derelict2
id = "derelict2"
suffix = "derelict2.dmm"
name = "Dinner for Two"
description = "Oh this is the night\n\
It's a beautiful night\n\
And we call it bella notte"
/datum/map_template/ruin/space/derelict3
id = "derelict3"
suffix = "derelict3.dmm"
name = "Derelict 3"
description = "These hulks were once part of a larger structure, where \
the three great \[REDACTED\] were forged."
/datum/map_template/ruin/space/derelict4
id = "derelict4"
suffix = "derelict4.dmm"
name = "Derelict 4"
description = "Centcom ferries have never crashed, will never crash, \
there is no current investigation into a crashed ferry, and we \
will not let Internal Affairs trample over high security information \
in the name of this baseless witchhunt."
/datum/map_template/ruin/space/derelict5
id = "derelict5"
suffix = "derelict5.dmm"
name = "Derelict 5"
description = "The plan is, we put a whole bunch of crates full of \
treasure in this disused warehouse, launch it into space, and then \
ignore it. Forever."
/datum/map_template/ruin/space/empty_shell
id = "empty-shell"
suffix = "emptyshell.dmm"
name = "Empty Shell"
description = "Cosy, rural property availible for young professional \
couple. Only twelve parsecs from the nearest hyperspace lane!"
/datum/map_template/ruin/space/gas_the_lizards
id = "gas-the-lizards"
suffix = "gasthelizards.dmm"
name = "Disposal Facility 17"
description = "Gas efficiency at 95.6%, fluid elimination at 96.2%. \
Will require renewed supplies of 'carpet' before the end of the \
quarter."
/datum/map_template/ruin/space/intact_empty_ship
id = "intact-empty-ship"
suffix = "intactemptyship.dmm"
name = "Authorship"
description = "Just somewhere quiet, where I can focus on my work with \
no interruptions."
/datum/map_template/ruin/space/mech_transport
id = "mech-transport"
suffix = "mechtransport.dmm"
name = "CF Corsair"
description = "Well, when is it getting here? I have bills to pay; very \
well-armed clients who want their shipments as soon as possible! I \
don't care, just find it!"
/datum/map_template/ruin/space/onehalf
id = "onehalf"
suffix = "onehalf.dmm"
name = "DK Excavator 453"
description = "Based on the trace elements we've detected on the \
gutted asteroids, we suspect that a mining ship using a restricted \
engine is somewhere in the area. We'd like to request a patrol vessel \
to investigate."
cost = 2
/datum/map_template/ruin/space/spacebar
id = "spacebar"
suffix = "spacebar.dmm"
name = "The Rampant Golem and Yellow Hound"
description = "No questions asked. No shoes/foot protection, no service. \
No tabs. No violence in the inside areas. That's it. Welcome to the \
Rampant Golem and Yellow Hound. Can I take your order?"
cost = 2
/datum/map_template/ruin/space/turreted_outpost
id = "turreted-outpost"
suffix = "turretedoutpost.dmm"
name = "Unnamed Turreted Outpost"
description = "We'd ask them to stop blaring that ruskiepop music, but \
none of us are brave enough to go near those death turrets they have."
/datum/map_template/ruin/space/way_home
id = "way-home"
suffix = "way_home.dmm"
name = "Salvation"
description = "In the darkest times, we will find our way home."
+10 -5
View File
@@ -57,10 +57,10 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
/obj/effect/proc_holder/spell/proc/cast_check(skipcharge = 0, mob/living/user = usr) //checks if the spell can be cast based on its settings; skipcharge is used when an additional cast_check is called inside the spell
if(((!user.mind) || !(src in user.mind.spell_list)) && !(src in user.spell_list))
if(((!user.mind) || !(src in user.mind.spell_list)) && !(src in user.mob_spell_list))
to_chat(user, "<span class='warning'>You shouldn't have this spell! Something's wrong.</span>")
return 0
if (istype(user, /mob/living/carbon/human))
if(istype(user, /mob/living/carbon/human))
var/mob/living/carbon/human/caster = user
if(caster.remoteview_target)
caster.remoteview_target = null
@@ -91,7 +91,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
if(ishuman(user) && (invocation_type == "whisper" || invocation_type == "shout") && user.is_muzzled())
to_chat(user, "Mmmf mrrfff!")
return 0
var/obj/effect/proc_holder/spell/noclothes/spell = locate() in (user.spell_list | (user.mind ? user.mind.spell_list : list()))
var/obj/effect/proc_holder/spell/noclothes/spell = locate() in (user.mob_spell_list | (user.mind ? user.mind.spell_list : list()))
if(clothes_req && !(spell && istype(spell)))//clothes check
if(!istype(user, /mob/living/carbon/human))
to_chat(user, "You aren't a human, Why are you trying to cast a human spell, silly non-human? Casting human spells is for humans.")
@@ -134,6 +134,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
/obj/effect/proc_holder/spell/New()
..()
action = new(src)
still_recharging_msg = "<span class='notice'>[name] is still recharging.</span>"
charge_counter = charge_max
@@ -152,9 +153,13 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
return
/obj/effect/proc_holder/spell/proc/start_recharge()
if(action)
action.UpdateButtonIcon()
while(charge_counter < charge_max)
sleep(1)
charge_counter++
if(action)
action.UpdateButtonIcon()
/obj/effect/proc_holder/spell/proc/perform(list/targets, recharge = 1, mob/user = usr) //if recharge is started is important for the trigger spells
before_cast(targets)
@@ -355,7 +360,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
return 1
/obj/effect/proc_holder/spell/proc/can_cast(mob/user = usr)
if(((!user.mind) || !(src in user.mind.spell_list)) && !(src in user.spell_list))
if(((!user.mind) || !(src in user.mind.spell_list)) && !(src in user.mob_spell_list))
return 0
if(user.z == ZLEVEL_CENTCOMM && !centcom_cancast) //Certain spells are not allowed on the centcom zlevel
@@ -381,7 +386,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
if((invocation_type == "whisper" || invocation_type == "shout") && H.is_muzzled())
return 0
var/obj/effect/proc_holder/spell/noclothes/clothcheck = locate() in user.spell_list
var/obj/effect/proc_holder/spell/noclothes/clothcheck = locate() in user.mob_spell_list
var/obj/effect/proc_holder/spell/noclothes/clothcheck2 = locate() in user.mind.spell_list
if(clothes_req && !(clothcheck && istype(clothcheck)) && !(clothcheck2 && istype(clothcheck2)))//clothes check
if(!istype(H.wear_suit, /obj/item/clothing/suit/wizrobe) && !istype(H.wear_suit, /obj/item/clothing/suit/space/rig/wizard))
+2 -2
View File
@@ -20,8 +20,8 @@
if(L.pulling && (istype(L.pulling, /mob/living)))
var/mob/living/M = L.pulling
if(M.spell_list.len != 0 || (M.mind && M.mind.spell_list.len != 0))
for(var/obj/effect/proc_holder/spell/S in M.spell_list)
if(M.mob_spell_list.len != 0 || (M.mind && M.mind.spell_list.len != 0))
for(var/obj/effect/proc_holder/spell/S in M.mob_spell_list)
S.charge_counter = S.charge_max
if(M.mind)
for(var/obj/effect/proc_holder/spell/S in M.mind.spell_list)
+88
View File
@@ -0,0 +1,88 @@
/obj/effect/proc_holder/spell/targeted/touch/cluwne
name = "Curse of the Cluwne"
desc = "Turns the target into a fat and cursed monstrosity of a clown."
hand_path = /obj/item/weapon/melee/touch_attack/cluwne
school = "transmutation"
charge_max = 600
clothes_req = 1
cooldown_min = 200 //100 deciseconds reduction per rank
action_icon_state = "clown"
/mob/living/carbon/human/proc/makeCluwne()
to_chat(src, "<span class='danger'>You feel funny.</span>")
adjustBrainLoss(80)
nutrition = 9000
overeatduration = 9000
confused = 30
if(mind)
mind.assigned_role = "Cluwne"
var/obj/item/organ/internal/honktumor/cursed/tumor = new
tumor.insert(src)
mutations.Add(NERVOUS)
dna.SetSEState(NERVOUSBLOCK, 1, 1)
genemutcheck(src, NERVOUSBLOCK, null, MUTCHK_FORCED)
animate_clownspell(src)
unEquip(w_uniform, 1)
unEquip(shoes, 1)
unEquip(gloves, 1)
if(!istype(wear_mask, /obj/item/clothing/mask/cursedclown)) //Infinite loops otherwise
unEquip(wear_mask, 1)
equip_to_slot_if_possible(new /obj/item/clothing/under/cursedclown, slot_w_uniform, 1, 1, 1)
equip_to_slot_if_possible(new /obj/item/clothing/gloves/cursedclown, slot_gloves, 1, 1, 1)
equip_to_slot_if_possible(new /obj/item/clothing/mask/cursedclown, slot_wear_mask, 1, 1, 1)
equip_to_slot_if_possible(new /obj/item/clothing/shoes/cursedclown, slot_shoes, 1, 1, 1)
real_name = "cluwne"
/mob/living/carbon/human/proc/makeAntiCluwne()
to_chat(src, "<span class='danger'>You don't feel very funny.</span>")
adjustBrainLoss(-120)
nutrition = NUTRITION_LEVEL_STARVING
overeatduration = 0
confused = 0
jitteriness = 0
if(mind)
mind.assigned_role = "Lawyer"
var/obj/item/organ/internal/honktumor/cursed/tumor = get_int_organ(/obj/item/organ/internal/honktumor/cursed)
if(tumor)
tumor.remove(src, clean_remove = 1)
qdel(tumor)
else
mutations.Remove(CLUMSY)
mutations.Remove(COMICBLOCK)
dna.SetSEState(CLUMSYBLOCK,0)
dna.SetSEState(COMICBLOCK,0)
genemutcheck(src, CLUMSYBLOCK, null, MUTCHK_FORCED)
genemutcheck(src, COMICBLOCK, null, MUTCHK_FORCED)
mutations.Remove(NERVOUS)
dna.SetSEState(NERVOUSBLOCK, 0)
genemutcheck(src, NERVOUSBLOCK, null, MUTCHK_FORCED)
animate_clownspell(src)
var/obj/item/clothing/under/U = w_uniform
unEquip(w_uniform, 1)
if(U)
qdel(U)
var/obj/item/clothing/shoes/S = shoes
unEquip(shoes, 1)
if(S)
qdel(S)
if(istype(wear_mask, /obj/item/clothing/mask/cursedclown))
unEquip(wear_mask, 1)
if(istype(gloves, /obj/item/clothing/gloves/cursedclown))
var/obj/item/clothing/gloves/G = gloves
unEquip(gloves, 1)
qdel(G)
equip_to_slot_if_possible(new /obj/item/clothing/under/lawyer/black, slot_w_uniform, 1, 1, 1)
equip_to_slot_if_possible(new /obj/item/clothing/shoes/black, slot_shoes, 1, 1, 1)
+1 -1
View File
@@ -106,7 +106,7 @@
return ..()
/obj/effect/dummy/spell_jaunt/relaymove(var/mob/user, direction)
if (!src.canmove) return
if(!src.canmove) return
var/turf/newLoc = get_step(src,direction)
if(!(newLoc.flags & NOJAUNT))
loc = newLoc
+8 -3
View File
@@ -2,7 +2,7 @@
name = "Genetic"
desc = "This spell inflicts a set of mutations and disabilities upon the target."
var/sdisabilities = 0 //bits
var/disabilities = 0 //bits
var/list/mutations = list() //mutation strings
var/duration = 100 //deciseconds
/*
@@ -22,11 +22,16 @@
target.mutations.Add(x)
/* if(x == HULK && ishuman(target))
target:hulk_time=world.time + duration */
target.sdisabilities |= sdisabilities
target.disabilities |= disabilities
target.update_mutations() //update target's mutation overlays
var/mob/living/carbon/human/H = target
if(ishuman(target))
H.update_body()
spawn(duration)
target.mutations.Remove(mutations)
target.sdisabilities &= ~sdisabilities
target.disabilities &= ~disabilities
target.update_mutations()
if(ishuman(target))
H.update_body()
return
+2 -2
View File
@@ -34,14 +34,14 @@
if(amt_dam_brute > 0)
if(amt_dam_fire >= 0)
target.take_overall_damage(amt_dam_brute,amt_dam_fire)
else if (amt_dam_fire < 0)
else if(amt_dam_fire < 0)
target.take_overall_damage(amt_dam_brute,0)
target.heal_overall_damage(0,amt_dam_fire)
else if(amt_dam_brute < 0)
if(amt_dam_fire > 0)
target.take_overall_damage(0,amt_dam_fire)
target.heal_overall_damage(amt_dam_brute,0)
else if (amt_dam_fire <= 0)
else if(amt_dam_fire <= 0)
target.heal_overall_damage(amt_dam_brute,amt_dam_fire)
target.adjustToxLoss(amt_dam_tox)
target.oxyloss += amt_dam_oxy
+5 -8
View File
@@ -19,19 +19,18 @@ Urist: I don't feel like figuring out how you store object spells so I'm leaving
Make sure spells that are removed from spell_list are actually removed and deleted when mind transfering.
Also, you never added distance checking after target is selected. I've went ahead and did that.
*/
/obj/effect/proc_holder/spell/targeted/mind_transfer/cast(list/targets,mob/user = usr)
/obj/effect/proc_holder/spell/targeted/mind_transfer/cast(list/targets, mob/user = usr, distanceoverride)
if(!targets.len)
to_chat(user, "No mind found.")
return
if(targets.len > 1)
to_chat(user, "Too many minds! You're not a hive damnit!")//Whaa...aat?
return
var/mob/living/target = targets[1]
if(!(target in oview(range)))//If they are not in overview after selection. Do note that !() is necessary for in to work because ! takes precedence over it.
if(!(target in oview(range)) && !distanceoverride)//If they are not in overview after selection. Do note that !() is necessary for in to work because ! takes precedence over it.
to_chat(user, "They are too far away!")
return
@@ -64,18 +63,16 @@ Also, you never added distance checking after target is selected. I've went ahea
victim.verbs -= V
var/mob/dead/observer/ghost = victim.ghostize(0)
ghost.spell_list = victim.spell_list//If they have spells, transfer them. Now we basically have a backup mob.
caster.mind.transfer_to(victim)
victim.spell_list = caster.spell_list//Now they are inside the victim's body.
if(victim.mind.special_verbs.len)//To add all the special verbs for the original caster.
for(var/V in caster.mind.special_verbs)//Not too important but could come into play.
caster.verbs += V
ghost.mind.transfer_to(caster)
caster.key = ghost.key //have to transfer the key since the mind was not active
caster.spell_list = ghost.spell_list
if(ghost.key)
caster.key = ghost.key //have to transfer the key since the mind was not active
qdel(ghost)
if(caster.mind.special_verbs.len)//If they had any special verbs, we add them here.
for(var/V in caster.mind.special_verbs)
+47
View File
@@ -0,0 +1,47 @@
/obj/effect/proc_holder/spell/targeted/rathens
name = "Rathen's Secret"
desc = "Summons a powerful shockwave around you that tears the appendix and limbs off of enemies."
charge_max = 500
clothes_req = 1
invocation = "ARSE NATH!"
invocation_type = "shout"
max_targets = 0
range = 7
cooldown_min = 200
selection_type = "view"
action_icon_state = "superfart"
/obj/effect/proc_holder/spell/targeted/rathens/cast(list/targets, mob/user = usr)
playsound(get_turf(user), 'sound/goonstation/effects/superfart.ogg', 25, 1)
for(var/mob/living/carbon/human/H in targets)
var/datum/effect/system/harmless_smoke_spread/s = new /datum/effect/system/harmless_smoke_spread
s.set_up(5, 0, H)
s.start()
var/obj/item/organ/internal/appendix/A = H.get_int_organ(/obj/item/organ/internal/appendix)
if(A)
A.remove(H)
A.forceMove(get_turf(H))
spawn()
A.throw_at(get_edge_target_turf(H, pick(alldirs)), rand(1, 10), 5)
H.visible_message("<span class='danger'>[H]'s [A.name] flies out of their body in a magical explosion!</span>",\
"<span class='danger'>Your [A.name] flies out of your body in a magical explosion!</span>")
H.Weaken(2)
else
var/obj/effect/decal/cleanable/blood/gibs/G = new/obj/effect/decal/cleanable/blood/gibs(get_turf(H))
spawn()
G.throw_at(get_edge_target_turf(H, pick(alldirs)), rand(1, 10), 5)
H.apply_damage(10, BRUTE, "chest")
to_chat(H, "<span class='userdanger'>You have no appendix, but something had to give! Holy shit, what was that?</span>")
H.Weaken(3)
for(var/obj/item/organ/external/E in H.organs)
if(istype(E, /obj/item/organ/external/head))
continue
if(istype(E, /obj/item/organ/external/chest))
continue
if(istype(E, /obj/item/organ/external/groin))
continue
if(prob(7))
to_chat(H, "<span class='userdanger'>Your [E] was severed by the explosion!</span>")
E.droplimb(1, DROPLIMB_EDGE, 0, 1)
+5 -5
View File
@@ -1,5 +1,5 @@
/obj/effect/proc_holder/spell/targeted/touch/
var/hand_path = "/obj/item/weapon/melee/touch_attack"
/obj/effect/proc_holder/spell/targeted/touch
var/hand_path = /obj/item/weapon/melee/touch_attack
var/obj/item/weapon/melee/touch_attack/attached_hand = null
invocation_type = "none" //you scream on connecting, not summoning
include_user = 1
@@ -47,7 +47,7 @@
/obj/effect/proc_holder/spell/targeted/touch/disintegrate
name = "Disintegrate"
desc = "This spell charges your hand with vile energy that can be used to violently explode victims."
hand_path = "/obj/item/weapon/melee/touch_attack/disintegrate"
hand_path = /obj/item/weapon/melee/touch_attack/disintegrate
school = "evocation"
charge_max = 600
@@ -59,11 +59,11 @@
/obj/effect/proc_holder/spell/targeted/touch/flesh_to_stone
name = "Flesh to Stone"
desc = "This spell charges your hand with the power to turn victims into inert statues for a long period of time."
hand_path = "/obj/item/weapon/melee/touch_attack/fleshtostone"
hand_path = /obj/item/weapon/melee/touch_attack/fleshtostone
school = "transmutation"
charge_max = 600
clothes_req = 1
cooldown_min = 200 //100 deciseconds reduction per rank
action_icon_state = "statue"
action_icon_state = "statue"
+10 -1
View File
@@ -53,6 +53,15 @@
action_icon_state = "mutate"
/obj/effect/proc_holder/spell/targeted/genetic/mutate/cast(list/targets)
for(var/mob/living/target in targets)
target.dna.SetSEState(HULKBLOCK, 1)
genemutcheck(target, HULKBLOCK, null, MUTCHK_FORCED)
spawn(duration)
target.dna.SetSEState(HULKBLOCK, 0)
genemutcheck(target, HULKBLOCK, null, MUTCHK_FORCED)
..()
/obj/effect/proc_holder/spell/targeted/smoke
name = "Smoke"
desc = "This spell spawns a cloud of choking smoke at your location and does not require wizard garb."
@@ -222,7 +231,7 @@
amt_eye_blurry = 20
/obj/effect/proc_holder/spell/targeted/genetic/blind
sdisabilities = BLIND
disabilities = BLIND
duration = 300
/obj/effect/proc_holder/spell/dumbfire/fireball
+12 -4
View File
@@ -375,10 +375,10 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
/////// Implants & etc
/datum/supply_packs/security/armory/loyalty
name = "Loyalty Implants Crate"
name = "Mindshield Implants Crate"
contains = list (/obj/item/weapon/storage/lockbox/loyalty)
cost = 40
containername = "loyalty implant crate"
containername = "mindshield implant crate"
/datum/supply_packs/security/armory/trackingimp
name = "Tracking Implants Crate"
@@ -861,8 +861,8 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
name = "Food Crate"
contains = list(/obj/item/weapon/reagent_containers/food/condiment/flour,
/obj/item/weapon/reagent_containers/food/condiment/rice,
/obj/item/weapon/reagent_containers/food/drinks/milk,
/obj/item/weapon/reagent_containers/food/drinks/soymilk,
/obj/item/weapon/reagent_containers/food/condiment/milk,
/obj/item/weapon/reagent_containers/food/condiment/soymilk,
/obj/item/weapon/reagent_containers/food/condiment/saltshaker,
/obj/item/weapon/reagent_containers/food/condiment/peppermill,
/obj/item/weapon/storage/fancy/egg_box,
@@ -1083,6 +1083,14 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
cost = 10
containername = "beekeeper suits"
//Bottler
/datum/supply_packs/organic/bottler
name = "Brewing Buddy Bottler Unit"
contains = list(/obj/machinery/bottler,
/obj/item/weapon/wrench)
cost = 35
containername = "bottler crate"
//////////////////////////////////////////////////////////////////////////////
//////////////////////////// Materials ///////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
+105 -23
View File
@@ -80,14 +80,14 @@ var/list/uplink_items = list()
if(!istype(U))
return 0
if (user.stat || user.restrained())
if(user.stat || user.restrained())
return 0
if (!(istype(user, /mob/living/carbon/human)))
if(!(istype(user, /mob/living/carbon/human)))
return 0
// If the uplink's holder is in the user's contents
if ((U.loc in user.contents || (in_range(U.loc, user) && istype(U.loc.loc, /turf))))
if((U.loc in user.contents || (in_range(U.loc, user) && istype(U.loc.loc, /turf))))
user.set_machine(U)
if(cost > U.uses)
return 0
@@ -101,9 +101,9 @@ var/list/uplink_items = list()
if(istype(I,/obj/item/weapon/storage/box/) && I.contents.len>0)
for(var/atom/o in I)
U.purchase_log += "<BIG>\icon[o]</BIG>"
U.purchase_log += "<BIG>[bicon(o)]</BIG>"
else
U.purchase_log += "<BIG>\icon[I]</BIG>"
U.purchase_log += "<BIG>[bicon(I)]</BIG>"
//U.interact(user)
return 1
@@ -378,6 +378,15 @@ var/list/uplink_items = list()
gamemodes = list(/datum/game_mode/nuclear)
surplus = 0
/datum/uplink_item/dangerous/sniper
name = "Sniper Rifle"
desc = "Ranged fury, Syndicate style. guaranteed to cause shock and awe or your TC back!"
reference = "SSR"
item = /obj/item/weapon/gun/projectile/automatic/sniper_rifle/syndicate
cost = 16
surplus = 25
gamemodes = list(/datum/game_mode/nuclear)
/datum/uplink_item/dangerous/crossbow
name = "Energy Crossbow"
desc = "A miniature energy crossbow that is small enough both to fit into a pocket and to slip into a backpack unnoticed by observers. Fires bolts tipped with toxin, a poisonous substance that is the product of a living organism. Stuns enemies for a short period of time. Recharges automatically."
@@ -403,6 +412,16 @@ var/list/uplink_items = list()
item = /obj/item/weapon/melee/energy/sword/saber
cost = 8
/datum/uplink_item/dangerous/powerfist
name = "Power Fist"
desc = "The power-fist is a metal gauntlet with a built-in piston-ram powered by an external gas supply.\
Upon hitting a target, the piston-ram will extend foward to make contact for some serious damage. \
Using a wrench on the piston valve will allow you to tweak the amount of gas used per punch to \
deal extra damage and hit targets further. Use a screwdriver to take out any attached tanks."
reference = "PF"
item = /obj/item/weapon/melee/powerfist
cost = 8
/datum/uplink_item/dangerous/chainsaw
name = "Chainsaw"
desc = "A high powered chainsaw for cutting up ...you know...."
@@ -620,6 +639,38 @@ var/list/uplink_items = list()
gamemodes = list(/datum/game_mode/nuclear)
surplus = 0
/datum/uplink_item/ammo/sniper
cost = 4
gamemodes = list(/datum/game_mode/nuclear)
/datum/uplink_item/ammo/sniper/basic
name = ".50 Magazine"
desc = "An additional standard 6-round magazine for use with .50 sniper rifles."
reference = "50M"
item = /obj/item/ammo_box/magazine/sniper_rounds
/datum/uplink_item/ammo/sniper/soporific
name = ".50 Soporific Magazine"
desc = "A 3-round magazine of soporific ammo designed for use with .50 sniper rifles. Put your enemies to sleep today!"
reference = "50S"
item = /obj/item/ammo_box/magazine/sniper_rounds/soporific
cost = 6
/datum/uplink_item/ammo/sniper/haemorrhage
name = ".50 Haemorrhage Magazine"
desc = "A 5-round magazine of haemorrhage ammo designed for use with .50 sniper rifles; causes heavy bleeding \
in the target."
reference = "50B"
item = /obj/item/ammo_box/magazine/sniper_rounds/haemorrhage
/datum/uplink_item/ammo/sniper/penetrator
name = ".50 Penetrator Magazine"
desc = "A 5-round magazine of penetrator ammo designed for use with .50 sniper rifles. \
Can pierce walls and multiple enemies."
reference = "50P"
item = /obj/item/ammo_box/magazine/sniper_rounds/penetrator
cost = 5
// STEALTHY WEAPONS
/datum/uplink_item/stealthy_weapons
@@ -711,6 +762,13 @@ var/list/uplink_items = list()
item = /obj/item/toy/carpplushie/dehy_carp
cost = 3
/datum/uplink_item/stealthy_weapons/chamsechud
name = "Chameleon Security HUD"
desc = "A stolen Nanotrasen Security HUD with Syndicate chameleon technology implemented into it. Similarly to a chameleon jumpsuit, the HUD can be morphed into various other eyewear, while retaining the HUD qualities when worn."
reference = "CHHUD"
item = /obj/item/clothing/glasses/hud/security/chameleon
cost = 2
// STEALTHY TOOLS
/datum/uplink_item/stealthy_tools
@@ -844,33 +902,49 @@ var/list/uplink_items = list()
cost = 9
gamemodes = list(/datum/game_mode/nuclear)
/datum/uplink_item/device_tools/space_suit
name = "Space Suit"
desc = "The red and black syndicate space suit is less encumbering than Nanotrasen variants, fits inside bags, and has a weapon slot. Nanotrasen crewmembers are trained to report red space suit sightings."
//Space Suits and Hardsuits
/datum/uplink_item/suits
category = "Space Suits and Hardsuits"
surplus = 40
/datum/uplink_item/suits/space_suit
name = "Syndicate Space Suit"
desc = "This red and black syndicate space suit is less encumbering than Nanotrasen variants, \
fits inside bags, and has a weapon slot. Nanotrasen crewmembers are trained to report red space suit \
sightings, however."
reference = "SS"
item = /obj/item/weapon/storage/box/syndie_kit/space
cost = 4
/datum/uplink_item/device_tools/hardsuit
name = "Blood-red Hardsuit"
desc = "The feared suit of a syndicate nuclear agent. Features slightly better armor. When the helmet is deployed your identity will be protected. Toggling the suit into combat mode \
will allow you all the mobility of a loose fitting uniform without sacrificing armor. Additionally the suit is collapsible, small enough to fit within a backpack. \
Nanotrasen crewmembers are trained to report red space suit sightings, these suits in particular are known to drive employees into a panic."
/datum/uplink_item/suits/hardsuit
name = "Syndicate Hardsuit"
desc = "The feared suit of a syndicate nuclear agent. Features slightly better armoring and a built in jetpack \
that runs off standard atmospheric tanks. When the built in helmet is deployed your identity will be \
protected, even in death, as the suit cannot be removed by outside forces. Toggling the suit in and out of \
combat mode will allow you all the mobility of a loose fitting uniform without sacrificing armoring. \
Additionally the suit is collapsible, making it small enough to fit within a backpack. \
Nanotrasen crew who spot these suits are known to panic."
reference = "BRHS"
item = /obj/item/weapon/storage/box/syndie_kit/hardsuit
cost = 8
/datum/uplink_item/device_tools/elite_hardsuit
/datum/uplink_item/suits/hardsuit/elite
name = "Elite Syndicate Hardsuit"
desc = "The elite Syndicate hardsuit is worn by only the best nuclear agents. Features much better armoring and complete fireproofing. \
When the built in helmet is deployed your identity will be protected. Toggling the suit into combat mode will allow you all the mobility \
of a loose fitting uniform without sacrificing armoring. Additionally the suit is collapsible, small enough to fit within a backpack. \
Nanotrasen crewmembers are trained to report red space suit sightings; these suits in particular are known to drive employees into a panic."
reference = "ESHS"
desc = "An advanced hardsuit with superior armor and mobility to the standard Syndicate Hardsuit."
item = /obj/item/weapon/storage/box/syndie_kit/elite_hardsuit
cost = 8
reference = "ESHS"
gamemodes = list(/datum/game_mode/nuclear)
/datum/uplink_item/suits/hardsuit/shielded
name = "Shielded Hardsuit"
desc = "An advanced hardsuit with built in energy shielding. The shields will rapidly recharge when not under fire."
item = /obj/item/weapon/storage/box/syndie_kit/shielded_hardsuit
cost = 30
reference = "SHS"
gamemodes = list(/datum/game_mode/nuclear)
/datum/uplink_item/device_tools/thermal
name = "Thermal Imaging Glasses"
desc = "These glasses are thermals disguised as engineers' optical meson scanners. They allow you to see organisms through walls by capturing the upper portion of the infra-red light spectrum, emitted as heat and light by objects. Hotter objects, such as warm bodies, cybernetic organisms and artificial intelligence cores emit more of this light than cooler objects like walls and airlocks."
@@ -912,11 +986,19 @@ var/list/uplink_items = list()
/datum/uplink_item/device_tools/plastic_explosives
name = "Composition C-4"
desc = "C-4 is plastic explosive of the common variety Composition C. You can use it to breach walls or connect a signaller to its wiring to make it remotely detonable. It has a modifiable timer with a minimum setting of 10 seconds."
desc = "C-4 is plastic explosive of the common variety Composition C. You can use it to breach walls or connect an assembly to its wiring to make it remotely detonable. It has a modifiable timer with a minimum setting of 10 seconds."
reference = "C4"
item = /obj/item/weapon/c4
item = /obj/item/weapon/grenade/plastic/c4
cost = 1
/datum/uplink_item/device_tools/breaching_charge
name = "Composition X-4"
desc = "X-4 is a shaped charge designed to be safe to the user while causing maximum damage to the occupants of the room beach breached. It has a modifiable timer with a minimum setting of 10 seconds."
reference = "X4"
item = /obj/item/weapon/grenade/plastic/x4
cost = 2
gamemodes = list(/datum/game_mode/nuclear)
/datum/uplink_item/device_tools/powersink
name = "Power Sink"
desc = "When screwed to wiring attached to an electric grid, then activated, this large device places excessive load on the grid, causing a stationwide blackout. The sink cannot be carried because of its excessive size. Ordering this sends you a small beacon that will teleport the power sink to your location on activation."
@@ -1220,7 +1302,7 @@ var/list/uplink_items = list()
bought_items += I.item
remaining_TC -= I.cost
U.purchase_log += "<BIG>\icon[C]</BIG>"
U.purchase_log += "<BIG>[bicon(C)]</BIG>"
for(var/item in bought_items)
new item(C)
U.purchase_log += "<BIG>\icon[item]</BIG>"
U.purchase_log += "<BIG>[bicon(item)]</BIG>"
+134
View File
@@ -0,0 +1,134 @@
//The effects of weather occur across an entire z-level. For instance, lavaland has periodic ash storms that scorch most unprotected creatures.
#define STARTUP_STAGE 1
#define MAIN_STAGE 2
#define WIND_DOWN_STAGE 3
#define END_STAGE 4
/datum/weather
var/name = "space wind"
var/desc = "Heavy gusts of wind blanket the area, periodically knocking down anyone caught in the open."
var/telegraph_message = "<span class='warning'>The wind begins to pick up.</span>" //The message displayed in chat to foreshadow the weather's beginning
var/telegraph_duration = 300 //In deciseconds, how long from the beginning of the telegraph until the weather begins
var/telegraph_sound //The sound file played to everyone on an affected z-level
var/telegraph_overlay //The overlay applied to all tiles on the z-level
var/weather_message = "<span class='userdanger'>The wind begins to blow ferociously!</span>" //Displayed in chat once the weather begins in earnest
var/weather_duration = 1200 //In deciseconds, how long the weather lasts once it begins
var/weather_duration_lower = 1200 //See above - this is the lowest possible duration
var/weather_duration_upper = 1500 //See above - this is the highest possible duration
var/weather_sound
var/weather_overlay
var/end_message = "<span class='danger'>The wind relents its assault.</span>" //Displayed once the wather is over
var/end_duration = 300 //In deciseconds, how long the "wind-down" graphic will appear before vanishing entirely
var/end_sound
var/end_overlay
var/area_type = /area/space //Types of area to affect
var/list/impacted_areas = list() //Areas to be affected by the weather, calculated when the weather begins
var/target_z = ZLEVEL_STATION //The z-level to affect
var/overlay_layer = 10 //Since it's above everything else, this is the layer used by default. 2 is below mobs and walls if you need to use that.
var/aesthetic = FALSE //If the weather has no purpose other than looks
var/immunity_type = "storm" //Used by mobs to prevent them from being affected by the weather
var/stage = END_STAGE //The stage of the weather, from 1-4
var/probability = FALSE //Percent chance to happen if there are other possible weathers on the z-level
/datum/weather/New()
..()
weather_master.existing_weather |= src
/datum/weather/Destroy()
weather_master.existing_weather -= src
return ..()
/datum/weather/proc/telegraph()
if(stage == STARTUP_STAGE)
return
stage = STARTUP_STAGE
for(var/V in get_areas(area_type))
var/area/A = V
if(A.z == target_z)
impacted_areas |= A
weather_duration = rand(weather_duration_lower, weather_duration_upper)
update_areas()
for(var/V in player_list)
var/mob/M = V
if(M.z == target_z)
if(telegraph_message)
to_chat(M, telegraph_message)
if(telegraph_sound)
M << sound(telegraph_sound)
addtimer(src, "start", telegraph_duration)
/datum/weather/proc/start()
if(stage >= MAIN_STAGE)
return
stage = MAIN_STAGE
update_areas()
for(var/V in player_list)
var/mob/M = V
if(M.z == target_z)
if(weather_message)
to_chat(M, weather_message)
if(weather_sound)
M << sound(weather_sound)
weather_master.processing_weather |= src
addtimer(src, "wind_down", weather_duration)
/datum/weather/proc/wind_down()
if(stage >= WIND_DOWN_STAGE)
return
stage = WIND_DOWN_STAGE
update_areas()
for(var/V in player_list)
var/mob/M = V
if(M.z == target_z)
if(end_message)
to_chat(M, end_message)
if(end_sound)
M << sound(end_sound)
weather_master.processing_weather -= src
addtimer(src, "end", end_duration)
/datum/weather/proc/end()
if(stage == END_STAGE)
return
stage = END_STAGE
update_areas()
/datum/weather/proc/can_impact(mob/living/L) //Can this weather impact a mob?
if(L.z != target_z)
return
if(immunity_type in L.weather_immunities)
return
if(!(get_area(L) in impacted_areas))
return
return 1
/datum/weather/proc/impact(mob/living/L) //What effect does this weather have on the hapless mob?
return
/datum/weather/proc/update_areas()
for(var/V in impacted_areas)
var/area/N = V
N.layer = overlay_layer
N.icon = 'icons/effects/weather_effects.dmi'
N.invisibility = 0
switch(stage)
if(STARTUP_STAGE)
N.icon_state = telegraph_overlay
if(MAIN_STAGE)
N.icon_state = weather_overlay
if(WIND_DOWN_STAGE)
N.icon_state = end_overlay
if(END_STAGE)
N.icon_state = initial(N.icon_state)
N.icon = 'icons/turf/areas.dmi'
N.layer = 10 //Just default back to normal area stuff since I assume setting a var is faster than initial
N.invisibility = INVISIBILITY_MAXIMUM
N.opacity = 0
+118
View File
@@ -0,0 +1,118 @@
//Different types of weather.
/datum/weather/floor_is_lava //The Floor is Lava: Makes all turfs damage anyone on them unless they're standing on a solid object.
name = "the floor is lava"
desc = "The ground turns into surprisingly cool lava, lightly damaging anything on the floor."
telegraph_message = "<span class='warning'>Waves of heat emanate from the ground...</span>"
telegraph_duration = 150
weather_message = "<span class='userdanger'>The floor is lava! Get on top of something!</span>"
weather_duration_lower = 300
weather_duration_upper = 600
weather_overlay = "lava"
end_message = "<span class='danger'>The ground cools and returns to its usual form.</span>"
end_duration = 0
area_type = /area
target_z = ZLEVEL_STATION
overlay_layer = 2 //Covers floors only
immunity_type = "lava"
/datum/weather/floor_is_lava/impact(mob/living/L)
for(var/obj/structure/O in L.loc)
if(O.density)
return
if(L.loc.density)
return
if(!L.client) //Only sentient people are going along with it!
return
L.adjustFireLoss(3)
/datum/weather/floor_is_lava/fake
name = "fake lava"
aesthetic = TRUE
/datum/weather/advanced_darkness //Advanced Darkness: Restricts the vision of all affected mobs to a single tile in the cardinal directions.
name = "advanced darkness"
desc = "Everything in the area is effectively blinded, unable to see more than a foot or so around itself."
telegraph_message = "<span class='warning'>The lights begin to dim... is the power going out?</span>"
telegraph_duration = 150
weather_message = "<span class='userdanger'>This isn't your everyday darkness... this is <i>advanced</i> darkness!</span>"
weather_duration_lower = 300
weather_duration_upper = 300
end_message = "<span class='danger'>At last, the darkness recedes.</span>"
end_duration = 0
area_type = /area
target_z = ZLEVEL_STATION
/datum/weather/advanced_darkness/update_areas()
for(var/V in impacted_areas)
var/area/A = V
if(stage == MAIN_STAGE)
A.invisibility = 0
A.opacity = 1
A.layer = overlay_layer
A.icon = 'icons/effects/weather_effects.dmi'
A.icon_state = "darkness"
else
A.invisibility = INVISIBILITY_MAXIMUM
A.opacity = 0
/datum/weather/ash_storm //Ash Storms: Common happenings on lavaland. Heavily obscures vision and deals heavy fire damage to anyone caught outside.
name = "ash storm"
desc = "An intense atmospheric storm lifts ash off of the planet's surface and billows it down across the area, dealing intense fire damage to the unprotected."
telegraph_message = "<span class='boldwarning'>An eerie moan rises on the wind. Sheets of burning ash blacken the horizon. Seek shelter.</span>"
telegraph_duration = 300
telegraph_sound = 'sound/lavaland/ash_storm_windup.ogg'
telegraph_overlay = "light_ash"
weather_message = "<span class='userdanger'><i>Smoldering clouds of scorching ash billow down around you! Get inside!</i></span>"
weather_duration_lower = 600
weather_duration_upper = 1500
weather_sound = 'sound/lavaland/ash_storm_start.ogg'
weather_overlay = "ash_storm"
end_message = "<span class='boldannounce'>The shrieking wind whips away the last of the ash falls to its usual murmur. It should be safe to go outside now.</span>"
end_duration = 300
end_sound = 'sound/lavaland/ash_storm_end.ogg'
end_overlay = "light_ash"
area_type = /area/mine
target_z = ZLEVEL_ASTEROID
immunity_type = "ash"
probability = 90
/datum/weather/ash_storm/impact(mob/living/L)
if(istype(L.loc, /obj/mecha))
return
if(ishuman(L))
var/mob/living/carbon/human/H = L
var/thermal_protection = H.get_thermal_protection()
if(thermal_protection >= FIRE_IMMUNITY_SUIT_MAX_TEMP_PROTECT)
return
L.adjustFireLoss(4)
/datum/weather/ash_storm/emberfall //Emberfall: An ash storm passes by, resulting in harmless embers falling like snow. 10% to happen in place of an ash storm.
name = "emberfall"
desc = "A passing ash storm blankets the area in harmless embers."
weather_message = "<span class='notice'>Gentle embers waft down around you like grotesque snow. The storm seems to have passed you by...</span>"
weather_sound = 'sound/lavaland/ash_storm_windup.ogg'
weather_overlay = "light_ash"
end_message = "<span class='notice'>The emberfall slows, stops. Another layer of hardened soot to the basalt beneath your feet.</span>"
aesthetic = TRUE
probability = 10
+10 -5
View File
@@ -100,14 +100,15 @@ var/const/AIRLOCK_WIRE_LIGHT = 2048
A.electrify(0)
return // Don't update the dialog.
if (AIRLOCK_WIRE_SAFETY)
if(AIRLOCK_WIRE_SAFETY)
A.safe = mended
if(AIRLOCK_WIRE_SPEED)
A.autoclose = mended
if(mended)
if(!A.density)
A.close()
spawn(0)
A.close()
if(AIRLOCK_WIRE_LIGHT)
A.lights = mended
@@ -159,12 +160,16 @@ var/const/AIRLOCK_WIRE_LIGHT = 2048
//will succeed only if the ID wire is cut or the door requires no access and it's not emagged
if(A.emagged) return
if(!A.requiresID() || A.check_access(null))
if(A.density) A.open()
else A.close()
spawn(0)
if(A.density)
A.open()
else
A.close()
if(AIRLOCK_WIRE_SAFETY)
A.safe = !A.safe
if(!A.density)
A.close()
spawn(0)
A.close()
if(AIRLOCK_WIRE_SPEED)
A.normalspeed = !A.normalspeed
+8 -8
View File
@@ -35,8 +35,8 @@ var/const/AALARM_WIRE_AALARM = 16
A.update_icon()
// to_chat(world, "Power wire cut")
if (AALARM_WIRE_AI_CONTROL)
if (A.aidisabled == !mended)
if(AALARM_WIRE_AI_CONTROL)
if(A.aidisabled == !mended)
A.aidisabled = mended
// to_chat(world, "AI Control Wire Cut")
@@ -47,7 +47,7 @@ var/const/AALARM_WIRE_AALARM = 16
// to_chat(world, "Syphon Wire Cut")
if(AALARM_WIRE_AALARM)
if (A.alarm_area.atmosalert(2, A))
if(A.alarm_area.atmosalert(2, A))
A.post_alert(2)
A.update_icon()
@@ -58,7 +58,7 @@ var/const/AALARM_WIRE_AALARM = 16
A.locked = !A.locked
// to_chat(world, "Idscan wire pulsed")
if (AALARM_WIRE_POWER)
if(AALARM_WIRE_POWER)
// to_chat(world, "Power wire pulsed")
if(A.shorted == 0)
A.shorted = 1
@@ -70,13 +70,13 @@ var/const/AALARM_WIRE_AALARM = 16
A.update_icon()
if (AALARM_WIRE_AI_CONTROL)
if(AALARM_WIRE_AI_CONTROL)
// to_chat(world, "AI Control wire pulsed")
if (A.aidisabled == 0)
if(A.aidisabled == 0)
A.aidisabled = 1
A.updateDialog()
spawn(100)
if (A.aidisabled == 1)
if(A.aidisabled == 1)
A.aidisabled = 0
if(AALARM_WIRE_SYPHON)
@@ -89,6 +89,6 @@ var/const/AALARM_WIRE_AALARM = 16
if(AALARM_WIRE_AALARM)
// to_chat(world, "Aalarm wire pulsed")
if (A.alarm_area.atmosalert(0, A))
if(A.alarm_area.atmosalert(0, A))
A.post_alert(0)
A.update_icon()
+5 -5
View File
@@ -33,7 +33,7 @@ var/const/APC_WIRE_AI_CONTROL = 8
A.locked = 1
A.updateDialog()
if (APC_WIRE_MAIN_POWER1, APC_WIRE_MAIN_POWER2)
if(APC_WIRE_MAIN_POWER1, APC_WIRE_MAIN_POWER2)
if(A.shorted == 0)
A.shorted = 1
@@ -42,8 +42,8 @@ var/const/APC_WIRE_AI_CONTROL = 8
A.shorted = 0
A.updateDialog()
if (APC_WIRE_AI_CONTROL)
if (A.aidisabled == 0)
if(APC_WIRE_AI_CONTROL)
if(A.aidisabled == 0)
A.aidisabled = 1
spawn(10)
@@ -70,9 +70,9 @@ var/const/APC_WIRE_AI_CONTROL = 8
if(APC_WIRE_AI_CONTROL)
if(!mended)
if (A.aidisabled == 0)
if(A.aidisabled == 0)
A.aidisabled = 1
else
if (A.aidisabled == 1)
if(A.aidisabled == 1)
A.aidisabled = 0
A.updateDialog()
+1 -1
View File
@@ -66,7 +66,7 @@ var/const/CAMERA_WIRE_NOTHING2 = 32
C.light_disabled = !C.light_disabled
if(CAMERA_WIRE_ALARM)
C.visible_message("\icon[C] *beep*", "\icon[C] *beep*")
C.visible_message("[bicon(C)] *beep*", "[bicon(C)] *beep*")
return
/datum/wires/camera/proc/CanDeconstruct()
-13
View File
@@ -17,19 +17,6 @@ var/const/WIRE_EXPLODE = 1
if(!mended)
explode()
/datum/wires/explosive/plastic
holder_type = /obj/item/weapon/c4
/datum/wires/explosive/plastic/CanUse(var/mob/living/L)
var/obj/item/weapon/c4/P = holder
if(P.open_panel)
return 1
return 0
/datum/wires/explosive/plastic/explode()
var/obj/item/weapon/c4/P = holder
P.explode(get_turf(P))
/datum/wires/explosive/gibtonite
holder_type = /obj/item/weapon/twohanded/required/gibtonite
+5 -5
View File
@@ -28,15 +28,15 @@ var/const/WIRE_BEACON_RX = 256 // beacon ping recv
/datum/wires/mulebot/UpdatePulsed(var/index)
switch(index)
if(WIRE_POWER1, WIRE_POWER2)
holder.visible_message("\blue \icon[holder] The charge light flickers.")
holder.visible_message("\blue [bicon(holder)] The charge light flickers.")
if(WIRE_AVOIDANCE)
holder.visible_message("\blue \icon[holder] The external warning lights flash briefly.")
holder.visible_message("\blue [bicon(holder)] The external warning lights flash briefly.")
if(WIRE_LOADCHECK)
holder.visible_message("\blue \icon[holder] The load platform clunks.")
holder.visible_message("\blue [bicon(holder)] The load platform clunks.")
if(WIRE_MOTOR1, WIRE_MOTOR2)
holder.visible_message("\blue \icon[holder] The drive motor whines briefly.")
holder.visible_message("\blue [bicon(holder)] The drive motor whines briefly.")
else
holder.visible_message("\blue \icon[holder] You hear a radio crackle.")
holder.visible_message("\blue [bicon(holder)] You hear a radio crackle.")
// HELPER PROCS
+2 -2
View File
@@ -41,7 +41,7 @@ var/const/NUCLEARBOMB_WIRE_SAFETY = 4
set_security_level(N.previous_level)
N.visible_message("\blue The [N] quiets down.")
if(!N.lighthack)
if (N.icon_state == "nuclearbomb2")
if(N.icon_state == "nuclearbomb2")
N.icon_state = "nuclearbomb1"
else
N.visible_message("\blue The [N] emits a quiet whirling noise!")
@@ -56,7 +56,7 @@ var/const/NUCLEARBOMB_WIRE_SAFETY = 4
N.explode()
if(NUCLEARBOMB_WIRE_TIMING)
if(!N.lighthack)
if (N.icon_state == "nuclearbomb2")
if(N.icon_state == "nuclearbomb2")
N.icon_state = "nuclearbomb1"
N.timing = 0
bomb_set = 0
+1 -1
View File
@@ -28,7 +28,7 @@ var/const/PARTICLE_LIMIT_POWER_WIRE = 8 // Determines how strong the PA can be.
C.interface_control = !C.interface_control
if(PARTICLE_LIMIT_POWER_WIRE)
C.visible_message("\icon[C]<b>[C]</b> makes a large whirring noise.")
C.visible_message("[bicon(C)]<b>[C]</b> makes a large whirring noise.")
/datum/wires/particle_acc/control_box/UpdateCut(var/index, var/mended)
var/obj/machinery/particle_accelerator/control_box/C = holder
+8 -8
View File
@@ -34,25 +34,25 @@ var/const/BORG_WIRE_LAWCHECK = 16 // Not used on MoMMIs
switch(index)
if(BORG_WIRE_LAWCHECK) //Cut the law wire, and the borg will no longer receive law updates from its AI
if(!mended)
if (R.lawupdate == 1)
if(R.lawupdate == 1)
to_chat(R, "LawSync protocol engaged.")
R.show_laws()
else
if (R.lawupdate == 0 && !R.emagged)
if(R.lawupdate == 0 && !R.emagged)
R.lawupdate = 1
if (BORG_WIRE_AI_CONTROL) //Cut the AI wire to reset AI control
if(BORG_WIRE_AI_CONTROL) //Cut the AI wire to reset AI control
if(!mended)
if (R.connected_ai)
if(R.connected_ai)
R.connected_ai = null
if (BORG_WIRE_CAMERA)
if(BORG_WIRE_CAMERA)
if(!isnull(R.camera) && !R.scrambledcodes)
R.camera.status = mended
R.camera.toggle_cam(usr, 0) // Will kick anyone who is watching the Cyborg's camera.
if(BORG_WIRE_LAWCHECK) //Forces a law update if the borg is set to receive them. Since an update would happen when the borg checks its laws anyway, not much use, but eh
if (R.lawupdate)
if(R.lawupdate)
R.lawsync()
if(BORG_WIRE_LOCKED_DOWN)
@@ -63,12 +63,12 @@ var/const/BORG_WIRE_LAWCHECK = 16 // Not used on MoMMIs
var/mob/living/silicon/robot/R = holder
switch(index)
if (BORG_WIRE_AI_CONTROL) //pulse the AI wire to make the borg reselect an AI
if(BORG_WIRE_AI_CONTROL) //pulse the AI wire to make the borg reselect an AI
if(!R.emagged)
R.connected_ai = select_active_ai()
R.notify_ai(1)
if (BORG_WIRE_CAMERA)
if(BORG_WIRE_CAMERA)
if(!isnull(R.camera) && R.camera.can_use() && !R.scrambledcodes)
R.camera.toggle_cam(usr, 0) // Kick anyone watching the Cyborg's camera, doesn't display you disconnecting the camera.
R.visible_message("[R]'s camera lense focuses loudly.")
+16 -16
View File
@@ -20,32 +20,32 @@ var/const/WIRE_ACTIVATE = 16 // Will start a bombs timer if pulsed, will hint if
var/obj/machinery/syndicatebomb/P = holder
switch(index)
if(WIRE_BOOM)
if (P.active)
P.loc.visible_message("<span class='danger'>\icon[holder] An alarm sounds! It's go-</span>")
if(P.active)
P.loc.visible_message("<span class='danger'>[bicon(holder)] An alarm sounds! It's go-</span>")
P.timer = 0
if(WIRE_UNBOLT)
P.loc.visible_message("<span class='notice'>\icon[holder] The bolts spin in place for a moment.</span>")
P.loc.visible_message("<span class='notice'>[bicon(holder)] The bolts spin in place for a moment.</span>")
if(WIRE_DELAY)
playsound(P.loc, 'sound/machines/chime.ogg', 30, 1)
P.loc.visible_message("<span class='notice'>\icon[holder] The bomb chirps.</span>")
P.loc.visible_message("<span class='notice'>[bicon(holder)] The bomb chirps.</span>")
P.timer += 10
if(WIRE_PROCEED)
playsound(P.loc, 'sound/machines/buzz-sigh.ogg', 30, 1)
P.loc.visible_message("<span class='danger'>\icon[holder] The bomb buzzes ominously!</span>")
if (P.timer >= 61) //Long fuse bombs can suddenly become more dangerous if you tinker with them
P.loc.visible_message("<span class='danger'>[bicon(holder)] The bomb buzzes ominously!</span>")
if(P.timer >= 61) //Long fuse bombs can suddenly become more dangerous if you tinker with them
P.timer = 60
if (P.timer >= 21)
if(P.timer >= 21)
P.timer -= 10
else if (P.timer >= 11) //both to prevent negative timers and to have a little mercy
else if(P.timer >= 11) //both to prevent negative timers and to have a little mercy
P.timer = 10
if(WIRE_ACTIVATE)
if(!P.active && !P.defused)
playsound(P.loc, 'sound/machines/click.ogg', 30, 1)
P.loc.visible_message("<span class='danger'>\icon[holder] You hear the bomb start ticking!</span>")
P.loc.visible_message("<span class='danger'>[bicon(holder)] You hear the bomb start ticking!</span>")
P.active = 1
P.icon_state = "[initial(P.icon_state)]-active[P.open_panel ? "-wires" : ""]"
else
P.loc.visible_message("<span class='notice'>\icon[holder] The bomb seems to hesitate for a moment.</span>")
P.loc.visible_message("<span class='notice'>[bicon(holder)] The bomb seems to hesitate for a moment.</span>")
P.timer += 5
/datum/wires/syndicatebomb/UpdateCut(var/index, var/mended)
@@ -54,24 +54,24 @@ var/const/WIRE_ACTIVATE = 16 // Will start a bombs timer if pulsed, will hint if
if(WIRE_EXPLODE)
if(!mended)
if(P.active)
P.loc.visible_message("<span class='danger'>\icon[holder] An alarm sounds! It's go-</span>")
P.loc.visible_message("<span class='danger'>[bicon(holder)] An alarm sounds! It's go-</span>")
P.timer = 0
else
P.defused = 1
if(mended)
P.defused = 0 //cutting and mending all the wires of an inactive bomb will thus cure any sabotage
if(WIRE_UNBOLT)
if (!mended && P.anchored)
if(!mended && P.anchored)
playsound(P.loc, 'sound/effects/stealthoff.ogg', 30, 1)
P.loc.visible_message("<span class='notice'>\icon[holder] The bolts lift out of the ground!</span>")
P.loc.visible_message("<span class='notice'>[bicon(holder)] The bolts lift out of the ground!</span>")
P.anchored = 0
if(WIRE_PROCEED)
if(!mended && P.active)
P.loc.visible_message("<span class='danger'>\icon[holder] An alarm sounds! It's go-</span>")
P.loc.visible_message("<span class='danger'>[bicon(holder)] An alarm sounds! It's go-</span>")
P.timer = 0
if(WIRE_ACTIVATE)
if (!mended && P.active)
P.loc.visible_message("<span class='notice'>\icon[holder] The timer stops! The bomb has been defused!</span>")
if(!mended && P.active)
P.loc.visible_message("<span class='notice'>[bicon(holder)] The timer stops! The bomb has been defused!</span>")
P.icon_state = "[initial(P.icon_state)]-inactive[P.open_panel ? "-wires" : ""]"
P.active = 0
P.defused = 1