Merge remote-tracking branch 'citadel/master' into combat_rework

This commit is contained in:
kevinz000
2020-05-05 17:38:43 -07:00
1360 changed files with 51317 additions and 49624 deletions
+52 -53
View File
@@ -6,13 +6,15 @@
/datum/action
var/name = "Generic Action"
var/desc = null
var/obj/target = null
var/atom/target = null
var/check_flags = 0
var/required_mobility_flags = MOBILITY_USE
var/processing = FALSE
var/obj/screen/movable/action_button/button = null
var/buttontooltipstyle = ""
var/transparent_when_unavailable = TRUE
var/use_target_appearance = FALSE
var/list/target_appearance_matrix //if set, will be used to transform the target button appearance as an arglist.
var/button_icon = 'icons/mob/actions/backgrounds.dmi' //This is the file for the BACKGROUND icon
var/background_icon_state = ACTION_BUTTON_DEFAULT_BACKGROUND //And this is the state for the background icon
@@ -88,14 +90,14 @@
/datum/action/proc/Trigger()
if(!IsAvailable())
return FALSE
if(SEND_SIGNAL(src, COMSIG_ACTION_TRIGGER, src) & COMPONENT_ACTION_BLOCK_TRIGGER)
if(SEND_SIGNAL(src, COMSIG_ACTION_TRIGGER, target) & COMPONENT_ACTION_BLOCK_TRIGGER)
return FALSE
return TRUE
/datum/action/proc/Process()
return
/datum/action/proc/IsAvailable()
/datum/action/proc/IsAvailable(silent = FALSE)
if(!owner)
return FALSE
var/mob/living/L = owner
@@ -116,29 +118,42 @@
return TRUE
/datum/action/proc/UpdateButtonIcon(status_only = FALSE, force = FALSE)
if(button)
if(!status_only)
button.name = name
button.desc = desc
if(owner && owner.hud_used && background_icon_state == ACTION_BUTTON_DEFAULT_BACKGROUND)
var/list/settings = owner.hud_used.get_action_buttons_icons()
if(button.icon != settings["bg_icon"])
button.icon = settings["bg_icon"]
if(button.icon_state != settings["bg_state"])
button.icon_state = settings["bg_state"]
else
if(button.icon != button_icon)
button.icon = button_icon
if(button.icon_state != background_icon_state)
button.icon_state = background_icon_state
if(!button)
return
if(!status_only)
button.name = name
button.desc = desc
if(owner && owner.hud_used && background_icon_state == ACTION_BUTTON_DEFAULT_BACKGROUND)
var/list/settings = owner.hud_used.get_action_buttons_icons()
if(button.icon != settings["bg_icon"])
button.icon = settings["bg_icon"]
if(button.icon_state != settings["bg_state"])
button.icon_state = settings["bg_state"]
else
if(button.icon != button_icon)
button.icon = button_icon
if(button.icon_state != background_icon_state)
button.icon_state = background_icon_state
if(!use_target_appearance)
ApplyIcon(button, force)
if(!IsAvailable())
button.color = transparent_when_unavailable ? rgb(128,0,0,128) : rgb(128,0,0)
else
button.color = rgb(255,255,255,255)
return 1
else if(target && button.appearance_cache != target.appearance) //replace with /ref comparison if this is not valid.
var/mutable_appearance/M = new(target)
M.layer = FLOAT_LAYER
M.plane = FLOAT_PLANE
if(target_appearance_matrix)
var/list/L = target_appearance_matrix
M.transform = matrix(L[1], L[2], L[3], L[4], L[5], L[6])
button.cut_overlays()
button.add_overlay(M)
button.appearance_cache = target.appearance
if(!IsAvailable(TRUE))
button.color = transparent_when_unavailable ? rgb(128,0,0,128) : rgb(128,0,0)
else
button.color = rgb(255,255,255,255)
return 1
/datum/action/proc/ApplyIcon(obj/screen/movable/action_button/current_button, force = FALSE)
if(icon_icon && button_icon_state && ((current_button.button_icon_state != button_icon_state) || force))
@@ -156,7 +171,7 @@
if(!..())
return 0
var/mob/M = target
M.ghostize(1)
M.ghostize(can_reenter_corpse = TRUE, voluntary = TRUE)
/datum/action/proc/OnUpdatedIcon()
UpdateButtonIcon()
@@ -165,6 +180,7 @@
/datum/action/item_action
check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUN|AB_CHECK_LYING|AB_CHECK_CONSCIOUS
button_icon_state = null
use_target_appearance = TRUE
// If you want to override the normal icon being the item
// then change this to an icon state
@@ -188,23 +204,6 @@
I.ui_action_click(owner, src)
return 1
/datum/action/item_action/ApplyIcon(obj/screen/movable/action_button/current_button, force)
if(button_icon && button_icon_state)
// If set, use the custom icon that we set instead
// of the item appearence
..()
else if(target && current_button.appearance_cache != target.appearance) //replace with /ref comparison if this is not valid.
var/obj/item/I = target
var/old_layer = I.layer
var/old_plane = I.plane
I.layer = FLOAT_LAYER //AAAH
I.plane = FLOAT_PLANE //^ what that guy said
current_button.cut_overlays()
current_button.add_overlay(I)
I.layer = old_layer
I.plane = old_plane
current_button.appearance_cache = I.appearance
/datum/action/item_action/toggle_light
name = "Toggle Light"
@@ -308,7 +307,7 @@
icon_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "vortex_recall"
/datum/action/item_action/vortex_recall/IsAvailable()
/datum/action/item_action/vortex_recall/IsAvailable(silent = FALSE)
if(istype(target, /obj/item/hierophant_club))
var/obj/item/hierophant_club/H = target
if(H.teleporting)
@@ -320,7 +319,7 @@
background_icon_state = "bg_clock"
buttontooltipstyle = "clockcult"
/datum/action/item_action/clock/IsAvailable()
/datum/action/item_action/clock/IsAvailable(silent = FALSE)
if(!is_servant_of_ratvar(owner))
return 0
return ..()
@@ -329,7 +328,7 @@
name = "Create Judicial Marker"
desc = "Allows you to create a stunning Judicial Marker at any location in view. Click again to disable."
/datum/action/item_action/clock/toggle_visor/IsAvailable()
/datum/action/item_action/clock/toggle_visor/IsAvailable(silent = FALSE)
if(!is_servant_of_ratvar(owner))
return 0
if(istype(target, /obj/item/clothing/glasses/judicial_visor))
@@ -408,7 +407,7 @@
/datum/action/item_action/jetpack_stabilization
name = "Toggle Jetpack Stabilization"
/datum/action/item_action/jetpack_stabilization/IsAvailable()
/datum/action/item_action/jetpack_stabilization/IsAvailable(silent = FALSE)
var/obj/item/tank/jetpack/J = target
if(!istype(J) || !J.on)
return 0
@@ -465,7 +464,7 @@
/datum/action/item_action/organ_action
check_flags = AB_CHECK_CONSCIOUS
/datum/action/item_action/organ_action/IsAvailable()
/datum/action/item_action/organ_action/IsAvailable(silent = FALSE)
var/obj/item/organ/I = target
if(!I.owner)
return 0
@@ -634,32 +633,32 @@
return FALSE
if(target)
var/obj/effect/proc_holder/S = target
S.Click()
S.Trigger(usr)
return TRUE
/datum/action/spell_action/IsAvailable()
/datum/action/spell_action/IsAvailable(silent = FALSE)
if(!target)
return FALSE
return TRUE
/datum/action/spell_action/spell
/datum/action/spell_action/spell/IsAvailable()
/datum/action/spell_action/spell/IsAvailable(silent = FALSE)
if(!target)
return FALSE
var/obj/effect/proc_holder/spell/S = target
if(owner)
return S.can_cast(owner, FALSE, TRUE)
return S.can_cast(owner, FALSE, silent)
return FALSE
/datum/action/spell_action/alien
/datum/action/spell_action/alien/IsAvailable()
/datum/action/spell_action/alien/IsAvailable(silent = FALSE)
if(!target)
return FALSE
var/obj/effect/proc_holder/alien/ab = target
if(owner)
return ab.cost_check(ab.check_turf,owner,1)
return ab.cost_check(ab.check_turf,owner,silent)
return FALSE
@@ -701,7 +700,7 @@
button.maptext_width = 24
button.maptext_height = 12
/datum/action/cooldown/IsAvailable()
/datum/action/cooldown/IsAvailable(silent = FALSE)
return next_use_time <= world.time
/datum/action/cooldown/proc/StartCooldown()
+1 -1
View File
@@ -253,7 +253,7 @@
var/datum/ai_laws/lawtype
var/list/law_weights = CONFIG_GET(keyed_list/law_weight)
while(!lawtype && law_weights.len)
var/possible_id = pickweightAllowZero(law_weights)
var/possible_id = pickweight(law_weights, 0)
lawtype = lawid_to_type(possible_id)
if(!lawtype)
law_weights -= possible_id
@@ -150,6 +150,8 @@
friend_talk(message)
/mob/camera/imaginary_friend/Hear(message, atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, message_mode, atom/movable/source)
if (client?.prefs.chat_on_map && (client.prefs.see_chat_non_mob || ismob(speaker)))
create_chat_message(speaker, message_language, raw_message, spans, message_mode)
to_chat(src, compose_message(speaker, message_language, raw_message, radio_freq, spans, message_mode, FALSE, source))
/mob/camera/imaginary_friend/proc/friend_talk(message)
+1 -1
View File
@@ -39,7 +39,7 @@
//title_image = ntitle_image
/datum/browser/proc/add_stylesheet(name, file)
if (istype(name, /datum/asset/spritesheet))
if(istype(name, /datum/asset/spritesheet))
var/datum/asset/spritesheet/sheet = name
stylesheets["spritesheet_[sheet.name].css"] = "data/spritesheets/[sheet.name]"
else
+236
View File
@@ -0,0 +1,236 @@
#define CHAT_MESSAGE_SPAWN_TIME 0.2 SECONDS
#define CHAT_MESSAGE_LIFESPAN 5 SECONDS
#define CHAT_MESSAGE_EOL_FADE 0.7 SECONDS
#define CHAT_MESSAGE_EXP_DECAY 0.7 // Messages decay at pow(factor, idx in stack)
#define CHAT_MESSAGE_HEIGHT_DECAY 0.9 // Increase message decay based on the height of the message
#define CHAT_MESSAGE_APPROX_LHEIGHT 11 // Approximate height in pixels of an 'average' line, used for height decay
#define CHAT_MESSAGE_WIDTH 96 // pixels
#define CHAT_MESSAGE_MAX_LENGTH 110 // characters
#define WXH_TO_HEIGHT(x) text2num(copytext((x), findtextEx((x), "x") + 1)) // thanks lummox
/**
* # Chat Message Overlay
*
* Datum for generating a message overlay on the map
*/
/datum/chatmessage
/// The visual element of the chat messsage
var/image/message
/// The location in which the message is appearing
var/atom/message_loc
/// The client who heard this message
var/client/owned_by
/// Contains the scheduled destruction time
var/scheduled_destruction
/// Contains the approximate amount of lines for height decay
var/approx_lines
/**
* Constructs a chat message overlay
*
* Arguments:
* * text - The text content of the overlay
* * target - The target atom to display the overlay at
* * owner - The mob that owns this overlay, only this mob will be able to view it
* * extra_classes - Extra classes to apply to the span that holds the text
* * lifespan - The lifespan of the message in deciseconds
*/
/datum/chatmessage/New(text, atom/target, mob/owner, list/extra_classes = null, lifespan = CHAT_MESSAGE_LIFESPAN)
. = ..()
if (!istype(target))
CRASH("Invalid target given for chatmessage")
if(QDELETED(owner) || !istype(owner) || !owner.client)
stack_trace("/datum/chatmessage created with [isnull(owner) ? "null" : "invalid"] mob owner")
qdel(src)
return
INVOKE_ASYNC(src, .proc/generate_image, text, target, owner, extra_classes, lifespan)
/datum/chatmessage/Destroy()
if (owned_by)
if (owned_by.seen_messages)
LAZYREMOVEASSOC(owned_by.seen_messages, message_loc, src)
owned_by.images.Remove(message)
owned_by = null
message_loc = null
message = null
return ..()
/**
* Generates a chat message image representation
*
* Arguments:
* * text - The text content of the overlay
* * target - The target atom to display the overlay at
* * owner - The mob that owns this overlay, only this mob will be able to view it
* * extra_classes - Extra classes to apply to the span that holds the text
* * lifespan - The lifespan of the message in deciseconds
*/
/datum/chatmessage/proc/generate_image(text, atom/target, mob/owner, list/extra_classes, lifespan)
// Register client who owns this message
owned_by = owner.client
RegisterSignal(owned_by, COMSIG_PARENT_QDELETING, .proc/qdel, src)
// Clip message
var/maxlen = owned_by.prefs.max_chat_length
if (length_char(text) > maxlen)
text = copytext_char(text, 1, maxlen + 1) + "..." // BYOND index moment
// Calculate target color if not already present
if (!target.chat_color || target.chat_color_name != target.name)
target.chat_color = colorize_string(target.name)
target.chat_color_darkened = colorize_string(target.name, 0.85, 0.85)
target.chat_color_name = target.name
// Get rid of any URL schemes that might cause BYOND to automatically wrap something in an anchor tag
var/static/regex/url_scheme = new(@"[A-Za-z][A-Za-z0-9+-\.]*:\/\/", "g")
text = replacetext(text, url_scheme, "")
// Reject whitespace
var/static/regex/whitespace = new(@"^\s*$")
if (whitespace.Find(text))
qdel(src)
return
// Non mobs speakers can be small
if (!ismob(target))
extra_classes |= "small"
// Append radio icon if from a virtual speaker
if (extra_classes.Find("virtual-speaker"))
var/image/r_icon = image('icons/UI_Icons/chat/chat_icons.dmi', icon_state = "radio")
text = "\icon[r_icon]&nbsp;" + text
// We dim italicized text to make it more distinguishable from regular text
var/tgt_color = extra_classes.Find("italics") ? target.chat_color_darkened : target.chat_color
// Approximate text height
// Note we have to replace HTML encoded metacharacters otherwise MeasureText will return a zero height
// BYOND Bug #2563917
// Construct text
var/static/regex/html_metachars = new(@"&[A-Za-z]{1,7};", "g")
var/complete_text = "<span class='center maptext [extra_classes != null ? extra_classes.Join(" ") : ""]' style='color: [tgt_color]'>[text]</span>"
var/mheight = WXH_TO_HEIGHT(owned_by.MeasureText(replacetext(complete_text, html_metachars, "m"), null, CHAT_MESSAGE_WIDTH))
approx_lines = max(1, mheight / CHAT_MESSAGE_APPROX_LHEIGHT)
// Translate any existing messages upwards, apply exponential decay factors to timers
message_loc = target
if (owned_by.seen_messages)
var/idx = 1
var/combined_height = approx_lines
for(var/msg in owned_by.seen_messages[message_loc])
var/datum/chatmessage/m = msg
animate(m.message, pixel_y = m.message.pixel_y + mheight, time = CHAT_MESSAGE_SPAWN_TIME)
combined_height += m.approx_lines
var/sched_remaining = m.scheduled_destruction - world.time
if (sched_remaining > CHAT_MESSAGE_SPAWN_TIME)
var/remaining_time = (sched_remaining) * (CHAT_MESSAGE_EXP_DECAY ** idx++) * (CHAT_MESSAGE_HEIGHT_DECAY ** combined_height)
m.scheduled_destruction = world.time + remaining_time
addtimer(CALLBACK(m, .proc/end_of_life), remaining_time, TIMER_UNIQUE|TIMER_OVERRIDE)
// Build message image
message = image(loc = message_loc, layer = CHAT_LAYER)
message.plane = GAME_PLANE
message.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA | KEEP_APART
message.alpha = 0
message.pixel_y = owner.bound_height * 0.95
message.maptext_width = CHAT_MESSAGE_WIDTH
message.maptext_height = mheight
message.maptext_x = (CHAT_MESSAGE_WIDTH - owner.bound_width) * -0.5
message.maptext = complete_text
// View the message
LAZYADDASSOC(owned_by.seen_messages, message_loc, src)
owned_by.images |= message
animate(message, alpha = 255, time = CHAT_MESSAGE_SPAWN_TIME)
// Prepare for destruction
scheduled_destruction = world.time + (lifespan - CHAT_MESSAGE_EOL_FADE)
addtimer(CALLBACK(src, .proc/end_of_life), lifespan - CHAT_MESSAGE_EOL_FADE, TIMER_UNIQUE|TIMER_OVERRIDE)
/**
* Applies final animations to overlay CHAT_MESSAGE_EOL_FADE deciseconds prior to message deletion
*/
/datum/chatmessage/proc/end_of_life(fadetime = CHAT_MESSAGE_EOL_FADE)
animate(message, alpha = 0, time = fadetime, flags = ANIMATION_PARALLEL)
QDEL_IN(src, fadetime)
/**
* Creates a message overlay at a defined location for a given speaker
*
* Arguments:
* * speaker - The atom who is saying this message
* * message_language - The language that the message is said in
* * raw_message - The text content of the message
* * spans - Additional classes to be added to the message
* * message_mode - Bitflags relating to the mode of the message
*/
/mob/proc/create_chat_message(atom/movable/speaker, datum/language/message_language, raw_message, list/spans, message_mode)
// Ensure the list we are using, if present, is a copy so we don't modify the list provided to us
spans = spans?.Copy()
// Check for virtual speakers (aka hearing a message through a radio)
var/atom/movable/originalSpeaker = speaker
if (istype(speaker, /atom/movable/virtualspeaker))
var/atom/movable/virtualspeaker/v = speaker
speaker = v.source
spans |= "virtual-speaker"
// Ignore virtual speaker (most often radio messages) from ourself
if (originalSpeaker != src && speaker == src)
return
// Display visual above source
new /datum/chatmessage(lang_treat(speaker, message_language, raw_message, spans, null, TRUE), speaker, src, spans)
// Tweak these defines to change the available color ranges
#define CM_COLOR_SAT_MIN 0.6
#define CM_COLOR_SAT_MAX 0.7
#define CM_COLOR_LUM_MIN 0.65
#define CM_COLOR_LUM_MAX 0.75
/**
* Gets a color for a name, will return the same color for a given string consistently within a round.atom
*
* Note that this proc aims to produce pastel-ish colors using the HSL colorspace. These seem to be favorable for displaying on the map.
*
* Arguments:
* * name - The name to generate a color for
* * sat_shift - A value between 0 and 1 that will be multiplied against the saturation
* * lum_shift - A value between 0 and 1 that will be multiplied against the luminescence
*/
/datum/chatmessage/proc/colorize_string(name, sat_shift = 1, lum_shift = 1)
// seed to help randomness
var/static/rseed = rand(1,26)
// get hsl using the selected 6 characters of the md5 hash
var/hash = copytext(md5(name + GLOB.round_id), rseed, rseed + 6)
var/h = hex2num(copytext(hash, 1, 3)) * (360 / 255)
var/s = (hex2num(copytext(hash, 3, 5)) >> 2) * ((CM_COLOR_SAT_MAX - CM_COLOR_SAT_MIN) / 63) + CM_COLOR_SAT_MIN
var/l = (hex2num(copytext(hash, 5, 7)) >> 2) * ((CM_COLOR_LUM_MAX - CM_COLOR_LUM_MIN) / 63) + CM_COLOR_LUM_MIN
// adjust for shifts
s *= clamp(sat_shift, 0, 1)
l *= clamp(lum_shift, 0, 1)
// convert to rgb
var/h_int = round(h/60) // mapping each section of H to 60 degree sections
var/c = (1 - abs(2 * l - 1)) * s
var/x = c * (1 - abs((h / 60) % 2 - 1))
var/m = l - c * 0.5
x = (x + m) * 255
c = (c + m) * 255
m *= 255
switch(h_int)
if(0)
return "#[num2hex(c, 2)][num2hex(x, 2)][num2hex(m, 2)]"
if(1)
return "#[num2hex(x, 2)][num2hex(c, 2)][num2hex(m, 2)]"
if(2)
return "#[num2hex(m, 2)][num2hex(c, 2)][num2hex(x, 2)]"
if(3)
return "#[num2hex(m, 2)][num2hex(x, 2)][num2hex(c, 2)]"
if(4)
return "#[num2hex(x, 2)][num2hex(m, 2)][num2hex(c, 2)]"
if(5)
return "#[num2hex(c, 2)][num2hex(m, 2)][num2hex(x, 2)]"
-95
View File
@@ -1,95 +0,0 @@
/datum/component/archaeology
dupe_mode = COMPONENT_DUPE_UNIQUE
var/list/archdrops = list(/obj/item/bikehorn = list(ARCH_PROB = 100, ARCH_MAXDROP = 1)) // honk~
var/prob2drop
var/dug
var/datum/callback/callback
/datum/component/archaeology/Initialize(list/_archdrops = list(), datum/callback/_callback)
archdrops = _archdrops
for(var/i in archdrops)
if(isnull(archdrops[i][ARCH_MAXDROP]))
archdrops[i][ARCH_MAXDROP] = 1
stack_trace("ARCHAEOLOGY WARNING: [parent] contained a null max_drop value in [i].")
if(isnull(archdrops[i][ARCH_PROB]))
archdrops[i][ARCH_PROB] = 100
stack_trace("ARCHAEOLOGY WARNING: [parent] contained a null probability value in [i].")
callback = _callback
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY,.proc/Dig)
RegisterSignal(parent, COMSIG_ATOM_EX_ACT, .proc/BombDig)
RegisterSignal(parent, COMSIG_ATOM_SING_PULL, .proc/SingDig)
/datum/component/archaeology/InheritComponent(datum/component/archaeology/A, i_am_original)
var/list/other_archdrops = A.archdrops
var/list/_archdrops = archdrops
for(var/I in other_archdrops)
_archdrops[I] += other_archdrops[I]
/datum/component/archaeology/proc/Dig(datum/source, obj/item/I, mob/living/user)
if(dug)
to_chat(user, "<span class='notice'>Looks like someone has dug here already.</span>")
return
if(!isturf(user.loc))
return
if(I.tool_behaviour == TOOL_SHOVEL || I.tool_behaviour == TOOL_MINING)
to_chat(user, "<span class='notice'>You start digging...</span>")
if(I.use_tool(parent, user, 40, volume=50))
to_chat(user, "<span class='notice'>You dig a hole.</span>")
gets_dug()
dug = TRUE
SSblackbox.record_feedback("tally", "pick_used_mining", 1, I.type)
return COMPONENT_NO_AFTERATTACK
/datum/component/archaeology/proc/gets_dug()
if(dug)
return
else
var/turf/open/OT = get_turf(parent)
for(var/thing in archdrops)
var/maxtodrop = archdrops[thing][ARCH_MAXDROP]
for(var/i in 1 to maxtodrop)
if(prob(archdrops[thing][ARCH_PROB])) // can't win them all!
new thing(OT)
if(isopenturf(OT))
if(OT.postdig_icon_change)
if(istype(OT, /turf/open/floor/plating/asteroid/) && !OT.postdig_icon)
var/turf/open/floor/plating/asteroid/AOT = parent
AOT.icon_plating = "[AOT.environment_type]_dug"
AOT.icon_state = "[AOT.environment_type]_dug"
else
if(isplatingturf(OT))
var/turf/open/floor/plating/POT = parent
POT.icon_plating = "[POT.postdig_icon]"
POT.icon_state = "[OT.postdig_icon]"
if(OT.slowdown) //Things like snow slow you down until you dig them.
OT.slowdown = 0
dug = TRUE
if(callback)
callback.Invoke()
/datum/component/archaeology/proc/SingDig(datum/source, S, current_size)
switch(current_size)
if(STAGE_THREE)
if(prob(30))
gets_dug()
if(STAGE_FOUR)
if(prob(50))
gets_dug()
else
if(current_size >= STAGE_FIVE && prob(70))
gets_dug()
/datum/component/archaeology/proc/BombDig(datum/source, severity, target)
switch(severity)
if(3)
return
if(2)
if(prob(20))
gets_dug()
if(1)
gets_dug()
+1 -1
View File
@@ -4,7 +4,7 @@
var/list/bounce_signals = list(COMSIG_MOVABLE_IMPACT, COMSIG_ITEM_HIT_REACT, COMSIG_ITEM_ATTACK)
/datum/component/bouncy/Initialize(_bouncy_mod, list/_bounce_signals)
if(!ismovableatom(parent))
if(!ismovable(parent))
return COMPONENT_INCOMPATIBLE
if(_bouncy_mod)
bouncy_mod = _bouncy_mod
+14 -5
View File
@@ -55,7 +55,7 @@
log_combat(user, H, "starts slicing the throat of")
playsound(H.loc, butcher_sound, 50, TRUE, -1)
if(do_mob(user, H, CLAMP(500 / source.force, 30, 100)) && H.Adjacent(source))
if(do_mob(user, H, clamp(500 / source.force, 30, 100)) && H.Adjacent(source))
if(H.has_status_effect(/datum/status_effect/neck_slice))
user.show_message("<span class='warning'>[H]'s neck has already been already cut, you can't make the bleeding any worse!</span>", 1, \
"<span class='warning'>Their neck has already been already cut, you can't make the bleeding any worse!</span>")
@@ -65,13 +65,17 @@
"<span class='userdanger'>[user] slits your throat...</span>")
log_combat(user, H, "finishes slicing the throat of")
H.apply_damage(source.force, BRUTE, BODY_ZONE_HEAD)
H.bleed_rate = CLAMP(H.bleed_rate + 20, 0, 30)
H.bleed_rate = clamp(H.bleed_rate + 20, 0, 30)
H.apply_status_effect(/datum/status_effect/neck_slice)
/datum/component/butchering/proc/Butcher(mob/living/butcher, mob/living/meat)
var/meat_quality = 50 + (bonus_modifier/10) //increases through quality of butchering tool, and through if it was butchered in the kitchen or not
if(istype(get_area(butcher), /area/crew_quarters/kitchen))
meat_quality = meat_quality + 10
var/turf/T = meat.drop_location()
var/final_effectiveness = effectiveness - meat.butcher_difficulty
var/bonus_chance = max(0, (final_effectiveness - 100) + bonus_modifier) //so 125 total effectiveness = 25% extra chance
var/list/butchered_items = list()
for(var/V in meat.butcher_results)
var/obj/bones = V
var/amount = meat.butcher_results[bones]
@@ -83,16 +87,21 @@
if(butcher)
to_chat(butcher, "<span class='info'>You harvest some extra [initial(bones.name)] from [meat]!</span>")
for(var/i in 1 to 2)
new bones (T)
butchered_items += new bones (T)
else
new bones (T)
butchered_items += new bones (T)
meat.butcher_results.Remove(bones) //in case you want to, say, have it drop its results on gib
for(var/V in meat.guaranteed_butcher_results)
var/obj/sinew = V
var/amount = meat.guaranteed_butcher_results[sinew]
for(var/i in 1 to amount)
new sinew (T)
butchered_items += new sinew (T)
meat.guaranteed_butcher_results.Remove(sinew)
for(var/butchered_item in butchered_items)
if(isfood(butchered_item))
var/obj/item/reagent_containers/food/butchered_meat = butchered_item
butchered_meat.food_quality = meat_quality
if(butcher)
meat.visible_message("<span class='notice'>[butcher] butchers [meat].</span>")
ButcherEffects(meat)
+24 -5
View File
@@ -15,7 +15,7 @@
/datum/component/personal_crafting
var/busy
var/viewing_category = 1 //typical powergamer starting on the Weapons tab
var/viewing_category = 1
var/viewing_subcategory = 1
var/list/categories = list(
CAT_WEAPONRY = list(
@@ -23,7 +23,11 @@
CAT_AMMO,
),
CAT_ROBOT = CAT_NONE,
CAT_MISC = CAT_NONE,
CAT_MISC = list(
CAT_MISCELLANEOUS,
CAT_TOOL,
CAT_FURNITURE,
),
CAT_PRIMAL = CAT_NONE,
CAT_FOOD = list(
CAT_BREAD,
@@ -188,7 +192,7 @@
/datum/component/personal_crafting/proc/construct_item(mob/user, datum/crafting_recipe/R)
var/list/contents = get_surroundings(user)
var/send_feedback = 1
var/send_feedback = TRUE
if(check_contents(user, R, contents))
if(check_tools(user, R, contents))
if(do_after(user, R.time, target = user))
@@ -201,11 +205,23 @@
var/atom/movable/I = new R.result (get_turf(user.loc))
I.CheckParts(parts, R)
if(isitem(I))
if(isfood(I))
var/obj/item/reagent_containers/food/food_result = I
var/total_quality = 0
var/total_items = 0
for(var/obj/item/ingredient in parts)
var/obj/item/reagent_containers/food/food_ingredient = ingredient
total_items += 1
total_quality += food_ingredient.food_quality
if(total_items == 0)
food_result.adjust_food_quality(50)
else
food_result.adjust_food_quality(total_quality / total_items)
user.put_in_hands(I)
if(send_feedback)
SSblackbox.record_feedback("tally", "object_crafted", 1, I.type)
log_craft("[I] crafted by [user] at [loc_name(I.loc)]")
return 0
return FALSE
return "."
return ", missing tool."
return ", missing component."
@@ -408,8 +424,11 @@
switch(action)
if("make")
var/datum/crafting_recipe/TR = locate(params["recipe"]) in GLOB.crafting_recipes
busy = TRUE
ui_interact(usr)
if(busy)
to_chat(usr, "<span class='warning'>You are already making something!</span>")
return
busy = TRUE
var/fail_msg = construct_item(usr, TR)
if(!fail_msg)
to_chat(usr, "<span class='notice'>[TR.name] constructed.</span>")
@@ -14,26 +14,32 @@
name = "Glass working tools"
desc = "A lovely belt of most the tools you will need to shape, mold, and refine glass into more advanced shapes."
icon_state = "glass_tools"
tool_behaviour = TOOL_GLASS_CUT
tool_behaviour = TOOL_GLASS_CUT //Cutting takes 20 ticks
/obj/item/glasswork/blowing_rod
name = "Glass working blow rod"
desc = "A hollow metal stick made for glass blowing."
icon_state = "blowing_rods_unused"
tool_behaviour = TOOL_BLOW
tool_behaviour = TOOL_BLOW //Rods take 5 ticks
/obj/item/glasswork/glass_base
/obj/item/glasswork/glass_base //Welding takes 30 ticks
name = "Glass fodder sheet"
desc = "A sheet of glass set aside for glass working"
icon_state = "glass_base"
var/next_step = null
var/rod = /obj/item/glasswork/blowing_rod
/obj/item/lens
name = "Optical lens"
desc = "Good for selling or crafting, by itself its useless"
icon = 'icons/obj/chemical.dmi'
icon_state = "glass_optics"
/obj/item/tea_plate
name = "Tea Plate"
desc = "A polished plate for a tea cup. How fancy!"
icon = 'icons/obj/glass_ware.dmi'
icon_state = "tea_plate"
/obj/item/tea_cup
name = "Tea Cup"
desc = "A glass cup made for fake tea!"
icon = 'icons/obj/glass_ware.dmi'
icon_state = "tea_plate"
//////////////////////Chem Disk/////////////////////
//Two Steps //
@@ -49,8 +55,9 @@
/obj/item/glasswork/glass_base/dish/attackby(obj/item/I, mob/user, params)
..()
if(I.tool_behaviour == TOOL_GLASS_CUT)
new next_step(user.loc, 1)
qdel(src)
if(do_after(user,20, target = src))
new next_step(user.loc, 1)
qdel(src)
/obj/item/glasswork/glass_base/dish_part1
name = "Half chem dish sheet"
@@ -61,8 +68,9 @@
/obj/item/glasswork/glass_base/dish_part1/attackby(obj/item/I, mob/user, params)
..()
if(I.tool_behaviour == TOOL_GLASS_CUT)
new next_step(user.loc, 1)
qdel(src)
if(do_after(user,20, target = src))
new next_step(user.loc, 1)
qdel(src)
//////////////////////Lens//////////////////////////
//Six Steps //
@@ -78,8 +86,9 @@
/obj/item/glasswork/glass_base/glass_lens/attackby(obj/item/I, mob/user, params)
..()
if(I.tool_behaviour == TOOL_GLASS_CUT)
new next_step(user.loc, 1)
qdel(src)
if(do_after(user,20, target = src))
new next_step(user.loc, 1)
qdel(src)
/obj/item/glasswork/glass_base/glass_lens_part1
name = "Glass fodder sheet"
@@ -90,8 +99,9 @@
/obj/item/glasswork/glass_base/glass_lens_part1/attackby(obj/item/I, mob/user, params)
..()
if(I.tool_behaviour == TOOL_WELDER)
new next_step(user.loc, 1)
qdel(src)
if(do_after(user,30, target = src))
new next_step(user.loc, 1)
qdel(src)
/obj/item/glasswork/glass_base/glass_lens_part2
name = "Glass fodder sheet"
@@ -102,8 +112,9 @@
/obj/item/glasswork/glass_base/glass_lens_part2/attackby(obj/item/I, mob/user, params)
..()
if(I.tool_behaviour == TOOL_WELDER)
new next_step(user.loc, 1)
qdel(src)
if(do_after(user,30, target = src))
new next_step(user.loc, 1)
qdel(src)
/obj/item/glasswork/glass_base/glass_lens_part3
name = "Glass fodder sheet"
@@ -114,9 +125,10 @@
/obj/item/glasswork/glass_base/glass_lens_part3/attackby(obj/item/I, mob/user, params)
..()
if(I.tool_behaviour == TOOL_BLOW)
new next_step(user.loc, 1)
qdel(src)
qdel(I)
if(do_after(user,5, target = src))
new next_step(user.loc, 1)
qdel(src)
qdel(I)
/obj/item/glasswork/glass_base/glass_lens_part4
name = "Glass fodder sheet"
@@ -127,29 +139,31 @@
/obj/item/glasswork/glass_base/glass_lens_part4/attackby(obj/item/I, mob/user, params)
..()
if(I.tool_behaviour == TOOL_GLASS_CUT)
new next_step(user.loc, 1)
new rod(user.loc, 1)
qdel(src)
if(do_after(user,20, target = src))
new next_step(user.loc, 1)
new rod(user.loc, 1)
qdel(src)
/obj/item/glasswork/glass_base/glass_lens_part5
name = "Unpolished glass lens"
desc = "A small unpolished glass lens. Could be polished with some cloth."
icon = 'icons/obj/chemical.dmi'
desc = "A small unpolished glass lens. Could be polished with some silk."
icon = 'icons/obj/glass_ware.dmi'
icon_state = "glass_optics"
next_step = /obj/item/glasswork/glass_base/glass_lens_part6
/obj/item/glasswork/glass_base/glass_lens_part5/attackby(obj/item/I, mob/user, params)
..()
if(istype(I, /obj/item/stack/sheet/cloth))
new next_step(user.loc, 1)
qdel(src)
if(istype(I, /obj/item/stack/sheet/silk))
if(do_after(user,10, target = src))
new next_step(user.loc, 1)
qdel(src)
/obj/item/glasswork/glass_base/glass_lens_part6
name = "Unrefined glass lens"
desc = "A small polished glass lens. Just needs to be refined with some sandstone."
icon = 'icons/obj/chemical.dmi'
icon = 'icons/obj/glass_ware.dmi'
icon_state = "glass_optics"
next_step = /obj/item/lens
next_step = /obj/item/glasswork/glass_base/lens
/obj/item/glasswork/glass_base/glass_lens_part6/attackby(obj/item/I, mob/user, params)
..()
@@ -171,8 +185,9 @@
/obj/item/glasswork/glass_base/spouty/attackby(obj/item/I, mob/user, params)
..()
if(I.tool_behaviour == TOOL_GLASS_CUT)
new next_step(user.loc, 1)
qdel(src)
if(do_after(user,20, target = src))
new next_step(user.loc, 1)
qdel(src)
/obj/item/glasswork/glass_base/spouty_part2
name = "Glass fodder sheet"
@@ -183,8 +198,9 @@
/obj/item/glasswork/glass_base/spouty_part2/attackby(obj/item/I, mob/user, params)
..()
if(I.tool_behaviour == TOOL_WELDER)
new next_step(user.loc, 1)
qdel(src)
if(do_after(user,30, target = src))
new next_step(user.loc, 1)
qdel(src)
/obj/item/glasswork/glass_base/spouty_part3
name = "Glass fodder sheet"
@@ -195,9 +211,10 @@
/obj/item/glasswork/glass_base/spouty_part3/attackby(obj/item/I, mob/user, params)
..()
if(I.tool_behaviour == TOOL_BLOW)
new next_step(user.loc, 1)
qdel(src)
qdel(I)
if(do_after(user,5, target = src))
new next_step(user.loc, 1)
qdel(src)
qdel(I)
/obj/item/glasswork/glass_base/spouty_part4
name = "Glass fodder sheet"
@@ -208,9 +225,10 @@
/obj/item/glasswork/glass_base/spouty_part4/attackby(obj/item/I, mob/user, params)
..()
if(I.tool_behaviour == TOOL_GLASS_CUT)
new next_step(user.loc, 1)
new rod(user.loc, 1)
qdel(src)
if(do_after(user,20, target = src))
new next_step(user.loc, 1)
new rod(user.loc, 1)
qdel(src)
//////////////////////Small Bulb Flask//////////////
//Two Steps //
@@ -226,8 +244,9 @@
/obj/item/glasswork/glass_base/flask_small/attackby(obj/item/I, mob/user, params)
..()
if(I.tool_behaviour == TOOL_WELDER)
new next_step(user.loc, 1)
qdel(src)
if(do_after(user,30, target = src))
new next_step(user.loc, 1)
qdel(src)
/obj/item/glasswork/glass_base/flask_small_part1
name = "Metled glass"
@@ -238,9 +257,10 @@
/obj/item/glasswork/glass_base/flask_small_part1/attackby(obj/item/I, mob/user, params)
..()
if(I.tool_behaviour == TOOL_BLOW)
new next_step(user.loc, 1)
qdel(src)
qdel(I)
if(do_after(user,5, target = src))
new next_step(user.loc, 1)
qdel(src)
qdel(I)
/obj/item/glasswork/glass_base/flask_small_part2
name = "Metled glass"
@@ -251,9 +271,10 @@
/obj/item/glasswork/glass_base/flask_small_part2/attackby(obj/item/I, mob/user, params)
..()
if(I.tool_behaviour == TOOL_GLASS_CUT)
new next_step(user.loc, 1)
new rod(user.loc, 1)
qdel(src)
if(do_after(user,20, target = src))
new next_step(user.loc, 1)
new rod(user.loc, 1)
qdel(src)
//////////////////////Large Bulb Flask//////////////
//Two Steps //
@@ -269,8 +290,9 @@
/obj/item/glasswork/glass_base/flask_large/attackby(obj/item/I, mob/user, params)
..()
if(I.tool_behaviour == TOOL_WELDER)
new next_step(user.loc, 1)
qdel(src)
if(do_after(user,30, target = src))
new next_step(user.loc, 1)
qdel(src)
/obj/item/glasswork/glass_base/flask_large_part1
name = "Metled glass"
@@ -281,9 +303,10 @@
/obj/item/glasswork/glass_base/flask_large_part1/attackby(obj/item/I, mob/user, params)
..()
if(I.tool_behaviour == TOOL_BLOW)
new next_step(user.loc, 1)
qdel(src)
qdel(I)
if(do_after(user,5, target = src))
new next_step(user.loc, 1)
qdel(src)
qdel(I)
/obj/item/glasswork/glass_base/flask_large_part2
name = "Metled glass"
@@ -294,6 +317,138 @@
/obj/item/glasswork/glass_base/flask_large_part2/attackby(obj/item/I, mob/user, params)
..()
if(I.tool_behaviour == TOOL_GLASS_CUT)
new next_step(user.loc, 1)
new rod(user.loc, 1)
qdel(src)
if(do_after(user,20, target = src))
new next_step(user.loc, 1)
new rod(user.loc, 1)
qdel(src)
//////////////////////Tea Plates////////////////////
//Three Steps //
//Sells for 1200 cr, takes 5 glass shets //
//Usefull for selling and chemical things //
////////////////////////////////////////////////////
/obj/item/glasswork/glass_base/tea_plate
name = "Glass fodder sheet"
desc = "A set of glass sheets set aside for glass working, this one is ideal for a tea plate, how fancy! Needs to be heated with some tools."
next_step = /obj/item/glasswork/glass_base/tea_plate1
/obj/item/glasswork/glass_base/tea_plate/attackby(obj/item/I, mob/user, params)
..()
if(I.tool_behaviour == TOOL_WELDER)
if(do_after(user,30, target = src))
new next_step(user.loc, 1)
qdel(src)
/obj/item/glasswork/glass_base/tea_plate1
name = "Metled glass"
desc = "A blob of metled glass, this one is ideal for a tea plate. Needs to be blown with some tools."
icon_state = "glass_base_molding"
next_step = /obj/item/glasswork/glass_base/tea_plate2
/obj/item/glasswork/glass_base/tea_plate1/attackby(obj/item/I, mob/user, params)
..()
if(I.tool_behaviour == TOOL_BLOW)
if(do_after(user,5, target = src))
new next_step(user.loc, 1)
qdel(src)
qdel(I)
/obj/item/glasswork/glass_base/tea_plate2
name = "Metled glass"
desc = "A blob of metled glass on the end of a blowing rod. Needs to be cut off with some tools."
icon_state = "blowing_rods_inuse"
next_step = /obj/item/glasswork/glass_base/tea_plate3
/obj/item/glasswork/glass_base/tea_plate2/attackby(obj/item/I, mob/user, params)
..()
if(I.tool_behaviour == TOOL_GLASS_CUT)
if(do_after(user,20, target = src))
new next_step(user.loc, 1)
new rod(user.loc, 1)
qdel(src)
/obj/item/glasswork/glass_base/tea_plate3
name = "Disk of glass"
desc = "A disk of glass that can be cant be used for much. Needs to be polished with some silk."
icon_state = "glass_base_half"
next_step = /obj/item/tea_plate
/obj/item/glasswork/glass_base/tea_plate3/attackby(obj/item/I, mob/user, params)
..()
if(istype(I, /obj/item/stack/sheet/silk))
if(do_after(user,10, target = src))
new next_step(user.loc, 1)
qdel(src)
//////////////////////Tea Cup///////////////////////
//Four Steps //
//Sells for 1800 cr, takes 6 glass shets //
//Usefull for selling and chemical things //
////////////////////////////////////////////////////
/obj/item/glasswork/glass_base/tea_cup
name = "Glass fodder sheet"
desc = "A set of glass sheets set aside for glass working, this one is ideal for a tea cup, how fancy! Needs to be heated with some tools."
next_step = /obj/item/glasswork/glass_base/tea_cup1
/obj/item/glasswork/glass_base/tea_cup/attackby(obj/item/I, mob/user, params)
..()
if(I.tool_behaviour == TOOL_WELDER)
if(do_after(user,30, target = src))
new next_step(user.loc, 1)
qdel(src)
/obj/item/glasswork/glass_base/tea_cup1
name = "Metled glass"
desc = "A blob of metled glass, this one is ideal for a tea cup. Needs to be blown with some tools."
icon_state = "glass_base_molding"
next_step = /obj/item/glasswork/glass_base/tea_cup2
/obj/item/glasswork/glass_base/tea_cup1/attackby(obj/item/I, mob/user, params)
..()
if(I.tool_behaviour == TOOL_BLOW)
if(do_after(user,5, target = src))
new next_step(user.loc, 1)
qdel(src)
qdel(I)
/obj/item/glasswork/glass_base/tea_cupe2
name = "Metled glass"
desc = "A blob of metled glass on the end of a blowing rod. Needs to be cut off with some tools."
icon_state = "blowing_rods_inuse"
next_step = /obj/item/glasswork/glass_base/tea_cup3
/obj/item/glasswork/glass_base/tea_cup2/attackby(obj/item/I, mob/user, params)
..()
if(I.tool_behaviour == TOOL_GLASS_CUT)
if(do_after(user,20, target = src))
new next_step(user.loc, 1)
new rod(user.loc, 1)
qdel(src)
/obj/item/glasswork/glass_base/tea_cup3
name = "Disk of glass"
desc = "A bowl of glass that can be cant be used for much. Needs to be polished with some silk."
icon_state = "glass_base_half"
next_step = /obj/item/glasswork/glass_base/tea_cup4
/obj/item/glasswork/glass_base/cup3/attackby(obj/item/I, mob/user, params)
..()
if(istype(I, /obj/item/stack/sheet/silk))
if(do_after(user,10, target = src))
new next_step(user.loc, 1)
qdel(src)
/obj/item/glasswork/glass_base/tea_cup4
name = "Disk of glass"
desc = "A bowl of polished glass that can be cant be used for much. Needs some more glass to make a handle."
icon_state = "glass_base_half"
next_step = /obj/item/tea_cup
/obj/item/glasswork/glass_base/cup4/attackby(obj/item/I, mob/user, params)
..()
if(istype(I, /obj/item/stack/sheet/glass))
if(do_after(user,10, target = src))
new next_step(user.loc, 1)
qdel(src)
@@ -0,0 +1,98 @@
//This file is for crafting using a lens!
/obj/item/glasswork/glass_base/lens
name = "Optical lens"
desc = "Good for selling or crafting, by itself its useless"
icon = 'icons/obj/glass_ware.dmi'
icon_state = "glass_optics"
//Laser pointers - 2600
/obj/item/glasswork/glass_base/laserpointer_shell
name = "Laser pointer assembly"
desc = "Good for selling or crafting, by itself its useless. Needs a power capactor."
icon_state = "laser_case"
icon = 'icons/obj/glass_ware.dmi'
next_step = /obj/item/glasswork/glass_base/laserpointer_shell_1
/obj/item/glasswork/glass_base/laserpointer_shell/attackby(obj/item/I, mob/user, params)
..()
if(istype(I, /obj/item/stock_parts/capacitor))
new next_step(user.loc, 1)
qdel(src)
/obj/item/glasswork/glass_base/laserpointer_shell_1
name = "Laser pointer assembly"
desc = "Good for selling or crafting, by itself its useless. Needs a glass lens."
icon_state = "laser_wire"
icon_state = "laser_case"
next_step = /obj/item/glasswork/glass_base/laserpointer_shell_2
/obj/item/glasswork/glass_base/laserpointer_shell_1/attackby(obj/item/I, mob/user, params)
..()
if(istype(I, /obj/item/glasswork/glass_base/lens))
new next_step(user.loc, 1)
qdel(src)
/obj/item/glasswork/glass_base/laserpointer_shell_2
name = "Laser pointer assembly"
desc = "Good for selling or crafting, by itself its useless. Needs to be screwed together."
icon_state = "laser_wire"
icon_state = "laser_case"
next_step = /obj/item/laser_pointer/blue/handmade
/obj/item/glasswork/glass_base/laserpointer_shell_2/attackby(obj/item/I, mob/user, params)
..()
if(I.tool_behaviour == TOOL_SCREWDRIVER)
if(do_after(user,260, target = src))
new next_step(user.loc, 1)
qdel(src)
//NERD SHIT - 5000
/obj/item/glasswork/glass_base/glasses_frame
name = "Glasses Frame"
desc = "Good for crafting a pare of glasses, by itself its useless. Just add a pare of lens."
icon = 'icons/obj/glass_ware.dmi'
icon_state = "frames"
next_step = /obj/item/glasswork/glass_base/glasses_frame_1
/obj/item/glasswork/glass_base/glasses_frame/attackby(obj/item/I, mob/user, params)
..()
if(istype(I, /obj/item/glasswork/glass_base/lens))
if(do_after(user,60, target = src))
new next_step(user.loc, 1)
qdel(src)
/obj/item/glasswork/glass_base/glasses_frame_1
name = "Glasses Frame"
desc = "Good for crafting a pare of glasses, by itself its useless. Just add a the other lens."
icon = 'icons/obj/glass_ware.dmi'
icon_state = "frames_1"
next_step = /obj/item/glasswork/glass_base/glasses_frame_2
/obj/item/glasswork/glass_base/glasses_frame_1/attackby(obj/item/I, mob/user, params)
..()
if(istype(I, /obj/item/glasswork/glass_base/lens))
if(do_after(user,60, target = src))
new next_step(user.loc, 1)
qdel(src)
/obj/item/glasswork/glass_base/glasses_frame_2
name = "Glasses Frame"
desc = "Good for crafting a pare of glasses, by itself its useless. Just adjust the pices into the frame with a screwdriver."
icon = 'icons/obj/glass_ware.dmi'
icon_state = "frames_2"
next_step = /obj/item/glasswork/glasses
/obj/item/glasswork/glass_base/glasses_frame_2/attackby(obj/item/I, mob/user, params)
..()
if(I.tool_behaviour == TOOL_SCREWDRIVER)
if(do_after(user,180, target = src))
new next_step(user.loc, 1)
qdel(src)
/obj/item/glasswork/glasses
name = "Hand Made Glasses"
desc = "Hande made glasses that have not been polished at all making them useless. Selling them could still be worth a bit of credits."
icon = 'icons/obj/glass_ware.dmi'
icon_state = "frames_2"
@@ -23,3 +23,4 @@
*/
/datum/crafting_recipe/proc/check_requirements(mob/user, list/collected_requirements)
return TRUE
@@ -39,6 +39,30 @@
time = 10
reqs = list(/obj/item/paper = 20)
category = CAT_CLOTHING
/datum/crafting_recipe/armwraps
name = "Armwraps"
result = /obj/item/clothing/gloves/fingerless/pugilist
time = 60
tools = list(TOOL_WIRECUTTER)
reqs = list(/obj/item/stack/sheet/cloth = 4,
/obj/item/stack/sheet/silk = 2,
/obj/item/stack/sheet/leather = 2)
category = CAT_CLOTHING
/datum/crafting_recipe/armwrapsplusone
name = "Armwraps of Mighty Fists"
result = /obj/item/clothing/gloves/fingerless/pugilist/magic
time = 300
tools = list(TOOL_WIRECUTTER, /obj/item/book/codex_gigas, /obj/item/clothing/head/wizard, /obj/item/clothing/suit/wizrobe)
reqs = list(/obj/item/stack/sheet/cloth = 2,
/obj/item/stack/sheet/leather = 2,
/obj/item/stack/sheet/durathread = 2,
/datum/reagent/consumable/ethanol/sake = 100,
/datum/reagent/consumable/ethanol/wizz_fizz = 100,
/obj/item/stack/sheet/sinew = 1,
/obj/item/stack/sheet/mineral/gold = 50)
category = CAT_CLOTHING
////////
//Huds//
@@ -294,3 +318,25 @@
/obj/item/bedsheet/cosmos = 1)
time = 60
category = CAT_CLOTHING
/datum/crafting_recipe/garlic_necklace
name = "Garlic Necklace"
result = /obj/item/clothing/neck/garlic_necklace
reqs = list(/obj/item/reagent_containers/food/snacks/grown/garlic = 15,
/obj/item/stack/cable_coil = 10)
time = 100 //Takes awhile to put all the garlics on the coil and knot it.
category = CAT_CLOTHING
/datum/crafting_recipe/gripperoffbrand
name = "Improvised Gripper Gloves"
reqs = list(
/obj/item/clothing/gloves/fingerless = 1,
// /obj/item/stack/sticky_tape = 1
/obj/item/stack/cable_coil = 5,
/obj/item/stack/sheet/cloth = 2,
)
result = /obj/item/clothing/gloves/tackler/offbrand
category = CAT_CLOTHING
tools = list(TOOL_WIRECUTTER)
time = 20
@@ -8,6 +8,7 @@
/obj/item/stack/sheet/plastic = 2,
/obj/item/stack/rods = 1)
result = /obj/structure/curtain
subcategory = CAT_FURNITURE
category = CAT_MISC
/datum/crafting_recipe/guillotine
@@ -18,6 +19,7 @@
/obj/item/stack/sheet/mineral/wood = 20,
/obj/item/stack/cable_coil = 10)
tools = list(TOOL_SCREWDRIVER, TOOL_WRENCH, TOOL_WELDER)
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/femur_breaker
@@ -27,12 +29,119 @@
reqs = list(/obj/item/stack/sheet/metal = 20,
/obj/item/stack/cable_coil = 30)
tools = list(TOOL_SCREWDRIVER, TOOL_WRENCH, TOOL_WELDER)
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
// Blood Sucker stuff //
/datum/crafting_recipe/bloodsucker/blackcoffin
name = "Black Coffin"
result = /obj/structure/closet/crate/coffin/blackcoffin
tools = list(/obj/item/weldingtool,
/obj/item/screwdriver)
reqs = list(/obj/item/stack/sheet/cloth = 1,
/obj/item/stack/sheet/mineral/wood = 5,
/obj/item/stack/sheet/metal = 1)
///obj/item/stack/packageWrap = 8,
///obj/item/pipe = 2)
time = 150
subcategory = CAT_FURNITURE
category = CAT_MISC
always_availible = TRUE
/datum/crafting_recipe/bloodsucker/meatcoffin
name = "Meat Coffin"
result =/obj/structure/closet/crate/coffin/meatcoffin
tools = list(/obj/item/kitchen/knife,
/obj/item/kitchen/rollingpin)
reqs = list(/obj/item/reagent_containers/food/snacks/meat/slab = 5,
/obj/item/restraints/handcuffs/cable = 1)
time = 150
subcategory = CAT_FURNITURE
category = CAT_MISC
always_availible = TRUE
/datum/crafting_recipe/bloodsucker/metalcoffin
name = "Metal Coffin"
result =/obj/structure/closet/crate/coffin/metalcoffin
tools = list(/obj/item/weldingtool,
/obj/item/screwdriver)
reqs = list(/obj/item/stack/sheet/metal = 5)
time = 100
subcategory = CAT_FURNITURE
category = CAT_MISC
always_availible = TRUE
/datum/crafting_recipe/bloodsucker/vassalrack
name = "Persuasion Rack"
//desc = "For converting crewmembers into loyal Vassals."
result = /obj/structure/bloodsucker/vassalrack
tools = list(/obj/item/weldingtool,
//obj/item/screwdriver,
/obj/item/wrench
)
reqs = list(/obj/item/stack/sheet/mineral/wood = 3,
/obj/item/stack/sheet/metal = 2,
/obj/item/restraints/handcuffs/cable = 2,
//obj/item/storage/belt = 1,
//obj/item/stack/sheet/animalhide = 1,
//obj/item/stack/sheet/leather = 1,
//obj/item/stack/sheet/plasteel = 5
)
//parts = list(/obj/item/storage/belt = 1
// )
time = 150
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
always_availible = FALSE // Disabled til learned
/datum/crafting_recipe/bloodsucker/candelabrum
name = "Candelabrum"
//desc = "For converting crewmembers into loyal Vassals."
result = /obj/structure/bloodsucker/candelabrum
tools = list(/obj/item/weldingtool,
/obj/item/wrench
)
reqs = list(/obj/item/stack/sheet/metal = 3,
/obj/item/stack/rods = 1,
/obj/item/candle = 1
)
time = 100
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
always_availible = FALSE // Disabled til learned
///////////////////
//Tools & Storage//
///////////////////
/datum/crafting_recipe/upgraded_gauze
name = "Improved Gauze"
result = /obj/item/stack/medical/gauze/adv
time = 1
reqs = list(/obj/item/stack/medical/gauze = 1,
/datum/reagent/space_cleaner/sterilizine = 10)
category = CAT_MISC
subcategory = CAT_TOOL
/datum/crafting_recipe/bruise_pack
name = "Bruise Pack"
result = /obj/item/stack/medical/bruise_pack
time = 1
reqs = list(/obj/item/stack/medical/gauze = 1,
/datum/reagent/medicine/styptic_powder = 10)
category = CAT_MISC
subcategory = CAT_TOOL
/datum/crafting_recipe/burn_pack
name = "Brun Ointment"
result = /obj/item/stack/medical/ointment
time = 1
reqs = list(/obj/item/stack/medical/gauze = 1,
/datum/reagent/medicine/silver_sulfadiazine = 10)
category = CAT_MISC
subcategory = CAT_TOOL
/datum/crafting_recipe/ghettojetpack
name = "Improvised Jetpack"
result = /obj/item/tank/jetpack/improvised
@@ -42,6 +151,7 @@
/obj/item/pipe = 3,
/obj/item/stack/cable_coil = 30)
category = CAT_MISC
subcategory = CAT_TOOL
tools = list(TOOL_WRENCH, TOOL_WELDER, TOOL_WIRECUTTER)
/datum/crafting_recipe/goldenbox
@@ -53,6 +163,23 @@
/obj/item/stack/sheet/mineral/gold = 1,
/datum/reagent/water = 15)
time = 40
subcategory = CAT_TOOL
category = CAT_MISC
/datum/crafting_recipe/papersack
name = "Paper Sack"
result = /obj/item/storage/box/papersack
time = 10
reqs = list(/obj/item/paper = 5)
subcategory = CAT_TOOL
category = CAT_MISC
/datum/crafting_recipe/smallcarton
name = "Small Carton"
result = /obj/item/reagent_containers/food/drinks/sillycup/smallcarton
time = 10
reqs = list(/obj/item/stack/sheet/cardboard = 1)
subcategory = CAT_TOOL
category = CAT_MISC
/datum/crafting_recipe/bronze_driver
@@ -64,6 +191,7 @@
/obj/item/stack/tile/bronze = 1,
/datum/reagent/water = 15)
time = 40
subcategory = CAT_TOOL
category = CAT_MISC
/datum/crafting_recipe/bronze_welder
@@ -75,6 +203,7 @@
/obj/item/stack/tile/bronze = 1,
/datum/reagent/water = 15)
time = 40
subcategory = CAT_TOOL
category = CAT_MISC
/datum/crafting_recipe/bronze_wirecutters
@@ -86,6 +215,7 @@
/obj/item/stack/tile/bronze = 1,
/datum/reagent/water = 15)
time = 40
subcategory = CAT_TOOL
category = CAT_MISC
/datum/crafting_recipe/bronze_crowbar
@@ -97,6 +227,7 @@
/obj/item/stack/tile/bronze = 1,
/datum/reagent/water = 15)
time = 40
subcategory = CAT_TOOL
category = CAT_MISC
/datum/crafting_recipe/bronze_wrench
@@ -108,6 +239,7 @@
/obj/item/stack/tile/bronze = 1,
/datum/reagent/water = 15)
time = 40
subcategory = CAT_TOOL
category = CAT_MISC
/datum/crafting_recipe/rcl
@@ -116,6 +248,25 @@
time = 40
tools = list(TOOL_WELDER, TOOL_SCREWDRIVER, TOOL_WRENCH)
reqs = list(/obj/item/stack/sheet/metal = 15)
subcategory = CAT_TOOL
category = CAT_MISC
/datum/crafting_recipe/picket_sign
name = "Picket Sign"
result = /obj/item/picket_sign
reqs = list(/obj/item/stack/rods = 1,
/obj/item/stack/sheet/cardboard = 2)
time = 80
subcategory = CAT_TOOL
category = CAT_MISC
/datum/crafting_recipe/electrochromatic_kit
name = "Electrochromatic Kit"
result = /obj/item/electronics/electrochromatic_kit
reqs = list(/obj/item/stack/sheet/metal = 1,
/obj/item/stack/cable_coil = 1)
time = 5
subcategory = CAT_TOOL
category = CAT_MISC
////////////
@@ -128,6 +279,7 @@
reqs = list(/obj/item/stack/sheet/plasteel = 2,
/obj/item/stack/rods = 8)
time = 100
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/skateboard
@@ -136,6 +288,7 @@
time = 60
reqs = list(/obj/item/stack/sheet/metal = 5,
/obj/item/stack/rods = 10)
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/scooter
@@ -144,6 +297,7 @@
time = 65
reqs = list(/obj/item/stack/sheet/metal = 5,
/obj/item/stack/rods = 12)
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/////////
@@ -154,18 +308,21 @@
name = "Toy Sword"
reqs = list(/obj/item/light/bulb = 1, /obj/item/stack/cable_coil = 1, /obj/item/stack/sheet/plastic = 4)
result = /obj/item/toy/sword
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/extendohand
name = "Extendo-Hand"
reqs = list(/obj/item/bodypart/r_arm/robot = 1, /obj/item/clothing/gloves/boxing = 1)
result = /obj/item/extendohand
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/toyneb
name = "Non-Euplastic Blade"
reqs = list(/obj/item/light/tube = 1, /obj/item/stack/cable_coil = 1, /obj/item/stack/sheet/plastic = 4)
result = /obj/item/toy/sword/cx
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
////////////
@@ -176,6 +333,7 @@
name = "Black Carpet"
reqs = list(/obj/item/stack/tile/carpet = 50, /obj/item/toy/crayon/black = 1)
result = /obj/item/stack/tile/carpet/black/fifty
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/paperframes
@@ -183,6 +341,7 @@
result = /obj/item/stack/sheet/paperframes/five
time = 10
reqs = list(/obj/item/stack/sheet/mineral/wood = 5, /obj/item/paper = 20)
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/naturalpaper
@@ -191,6 +350,7 @@
reqs = list(/datum/reagent/water = 50, /obj/item/stack/sheet/mineral/wood = 1)
tools = list(/obj/item/hatchet)
result = /obj/item/paper_bin/bundlenatural
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/bluespacehonker
@@ -200,6 +360,7 @@
reqs = list(/obj/item/stack/ore/bluespace_crystal = 1,
/obj/item/toy/crayon/blue = 1,
/obj/item/bikehorn = 1)
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/mousetrap
@@ -208,13 +369,7 @@
time = 10
reqs = list(/obj/item/stack/sheet/cardboard = 1,
/obj/item/stack/rods = 1)
category = CAT_MISC
/datum/crafting_recipe/papersack
name = "Paper Sack"
result = /obj/item/storage/box/papersack
time = 10
reqs = list(/obj/item/paper = 5)
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/flashlight_eyes
@@ -225,13 +380,7 @@
/obj/item/flashlight = 2,
/obj/item/restraints/handcuffs/cable = 1
)
category = CAT_MISC
/datum/crafting_recipe/smallcarton
name = "Small Carton"
result = /obj/item/reagent_containers/food/drinks/sillycup/smallcarton
time = 10
reqs = list(/obj/item/stack/sheet/cardboard = 1)
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/pressureplate
@@ -242,6 +391,7 @@
/obj/item/stack/tile/plasteel = 1,
/obj/item/stack/cable_coil = 2,
/obj/item/assembly/igniter = 1)
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/gold_horn
@@ -250,6 +400,7 @@
time = 20
reqs = list(/obj/item/stack/sheet/mineral/bananium = 5,
/obj/item/bikehorn = 1)
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/spooky_camera
@@ -259,6 +410,7 @@
reqs = list(/obj/item/camera = 1,
/datum/reagent/water/holywater = 10)
parts = list(/obj/item/camera = 1)
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/paperwork
@@ -267,6 +419,16 @@
time = 10 //Takes time for people to file and complete paper work!
tools = list(/obj/item/pen)
reqs = list(/obj/item/folder/paperwork = 1)
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/coconut_bong
name = "Coconut Bong"
result = /obj/item/bong/coconut
reqs = list(/obj/item/stack/sheet/mineral/bamboo = 2,
/obj/item/reagent_containers/food/snacks/grown/coconut = 1)
time = 70
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
//////////////
@@ -279,6 +441,7 @@
time = 40
reqs = list(/obj/item/stack/rods = 2,
/obj/item/clothing/under/rank/captain/parade = 1)
subcategory = CAT_FURNITURE
category = CAT_MISC
/datum/crafting_recipe/engineering_banner
@@ -287,6 +450,7 @@
time = 40
reqs = list(/obj/item/stack/rods = 2,
/obj/item/clothing/under/rank/engineering/engineer = 1)
subcategory = CAT_FURNITURE
category = CAT_MISC
/datum/crafting_recipe/cargo_banner
@@ -295,6 +459,7 @@
time = 40
reqs = list(/obj/item/stack/rods = 2,
/obj/item/clothing/under/rank/cargo/tech = 1)
subcategory = CAT_FURNITURE
category = CAT_MISC
/datum/crafting_recipe/science_banner
@@ -303,6 +468,7 @@
time = 40
reqs = list(/obj/item/stack/rods = 2,
/obj/item/clothing/under/rank/rnd/scientist = 1)
subcategory = CAT_FURNITURE
category = CAT_MISC
/datum/crafting_recipe/medical_banner
@@ -311,6 +477,7 @@
time = 40
reqs = list(/obj/item/stack/rods = 2,
/obj/item/clothing/under/rank/medical/doctor = 1)
subcategory = CAT_FURNITURE
category = CAT_MISC
/datum/crafting_recipe/security_banner
@@ -319,50 +486,5 @@
time = 40
reqs = list(/obj/item/stack/rods = 2,
/obj/item/clothing/under/rank/security/officer = 1)
subcategory = CAT_FURNITURE
category = CAT_MISC
/datum/crafting_recipe/bloodsucker/vassalrack
name = "Persuasion Rack"
//desc = "For converting crewmembers into loyal Vassals."
result = /obj/structure/bloodsucker/vassalrack
tools = list(/obj/item/weldingtool,
///obj/item/screwdriver,
/obj/item/wrench
)
reqs = list(/obj/item/stack/sheet/mineral/wood = 3,
/obj/item/stack/sheet/metal = 2,
/obj/item/restraints/handcuffs/cable = 2,
///obj/item/storage/belt = 1
///obj/item/stack/sheet/animalhide = 1, // /obj/item/stack/sheet/leather = 1,
///obj/item/stack/sheet/plasteel = 5
)
//parts = list(/obj/item/storage/belt = 1
// )
time = 150
category = CAT_MISC
always_availible = FALSE // Disabled til learned
/datum/crafting_recipe/bloodsucker/candelabrum
name = "Candelabrum"
//desc = "For converting crewmembers into loyal Vassals."
result = /obj/structure/bloodsucker/candelabrum
tools = list(/obj/item/weldingtool,
/obj/item/wrench
)
reqs = list(/obj/item/stack/sheet/metal = 3,
/obj/item/stack/rods = 1,
/obj/item/candle = 1
)
time = 100
category = CAT_MISC
always_availible = FALSE // Disabled til learned
/datum/crafting_recipe/coconut_bong
name = "Coconut Bong"
result = /obj/item/bong/coconut
reqs = list(/obj/item/stack/sheet/mineral/bamboo = 2,
/obj/item/reagent_containers/food/snacks/grown/coconut = 1)
time = 70
category = CAT_MISC
@@ -298,7 +298,7 @@
subcategory = CAT_AMMO
/datum/crafting_recipe/ashen_arrow
name = "Fire Hardened Arrow"
name = "Ashen Arrow"
result = /obj/item/ammo_casing/caseless/arrow/ash
tools = list(TOOL_WELDER)
time = 30
+1 -1
View File
@@ -3,7 +3,7 @@
var/list/say_lines
/datum/component/edit_complainer/Initialize(list/text)
if(!ismovableatom(parent))
if(!ismovable(parent))
return COMPONENT_INCOMPATIBLE
var/static/list/default_lines = list(
+1 -1
View File
@@ -13,7 +13,7 @@
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, .proc/explodable_attack)
RegisterSignal(parent, COMSIG_TRY_STORAGE_INSERT, .proc/explodable_insert_item)
RegisterSignal(parent, COMSIG_ATOM_EX_ACT, .proc/detonate)
if(ismovableatom(parent))
if(ismovable(parent))
RegisterSignal(parent, COMSIG_MOVABLE_IMPACT, .proc/explodable_impact)
RegisterSignal(parent, COMSIG_MOVABLE_BUMP, .proc/explodable_bump)
if(isitem(parent))
+1 -1
View File
@@ -54,7 +54,7 @@
/datum/fantasy_affix/pyromantic/apply(datum/component/fantasy/comp, newName)
var/obj/item/master = comp.parent
comp.appliedComponents += master.AddComponent(/datum/component/igniter, CLAMP(comp.quality, 1, 10))
comp.appliedComponents += master.AddComponent(/datum/component/igniter, clamp(comp.quality, 1, 10))
return "pyromantic [newName]"
/datum/fantasy_affix/vampiric
+88
View File
@@ -0,0 +1,88 @@
/**
* Identification components
*/
/datum/component/identification
/// General flags for how we should work.
var/identification_flags = NONE
/// General flags for what we should do.
var/identification_effect_flags = NONE
/// General flags for how we can be identified.
var/identification_method_flags = NONE
/// If this is set, show this on examine to the examiner if they know how to use it.
var/additional_examine_text = "<span class='notice'>You seem to know more about this item than others..</span>"
/// Added to deconstructive analyzer say on success if set
var/deconstructor_reveal_text = "item operation instructions"
/datum/component/identification/Initialize(id_flags, id_effect_flags, id_method_flags)
if(!isobj(parent))
return COMPONENT_INCOMPATIBLE
. = ..()
if(. & COMPONENT_INCOMPATIBLE)
return
identification_flags = id_flags
identification_effect_flags = id_effect_flags
identification_method_flags = id_method_flags
/datum/component/identification/RegisterWithParent()
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/on_examine)
if(identification_effect_flags & ID_COMPONENT_EFFECT_NO_ACTIONS)
RegisterSignal(parent, COMSIG_ITEM_EQUIPPED, .proc/on_equip)
if(identification_method_flags & ID_COMPONENT_IDENTIFY_WITH_DECONSTRUCTOR)
RegisterSignal(parent, COMSIG_ITEM_DECONSTRUCTOR_DEEPSCAN, .proc/on_deconstructor_deepscan)
/datum/component/identification/UnregisterFromParent()
var/list/unregister = list(COMSIG_PARENT_EXAMINE)
if(identification_effect_flags & ID_COMPONENT_EFFECT_NO_ACTIONS)
unregister += COMSIG_ITEM_EQUIPPED
if(identification_method_flags & ID_COMPONENT_IDENTIFY_WITH_DECONSTRUCTOR)
unregister += COMSIG_ITEM_DECONSTRUCTOR_DEEPSCAN
UnregisterSignal(parent, unregister)
/datum/component/identification/proc/on_examine(datum/source, mob/user, list/returnlist)
if(check_knowledge(user) != ID_COMPONENT_KNOWLEDGE_FULL)
return
if(!additional_examine_text)
return
returnlist += additional_examine_text
/datum/component/identification/vv_edit_var(var_name, var_value)
// since i care SOOO much about memory optimization, we only register signals we need to
// so when someone vv's us, we should probably make sure we have the ones we need to with an update.
if((var_value == NAMEOF(src, identification_flags)) || (var_value == NAMEOF(src, identification_effect_flags)) || (var_value == NAMEOF(src, identification_method_flags)))
UnregisterFromParent()
. = ..()
if((var_value == NAMEOF(src, identification_flags)) || (var_value == NAMEOF(src, identification_effect_flags)) || (var_value == NAMEOF(src, identification_method_flags)))
RegisterWithParent()
/datum/component/identification/proc/on_equip(datum/source, mob/user)
if(check_knowledge(user) == ID_COMPONENT_KNOWLEDGE_FULL)
return
if(identification_method_flags & ID_COMPONENT_EFFECT_NO_ACTIONS)
return COMPONENT_NO_GRANT_ACTIONS
/datum/component/identification/proc/check_knowledge(mob/user)
return ID_COMPONENT_KNOWLEDGE_NONE
/datum/component/identification/proc/on_identify(mob/user)
if(identification_flags & ID_COMPONENT_DEL_ON_IDENTIFY)
qdel(src)
/datum/component/identification/proc/on_deconstructor_deepscan(datum/source, obj/machinery/rnd/destructive_analyzer/analyzer, mob/user, list/information = list())
if((identification_method_flags & ID_COMPONENT_IDENTIFY_WITH_DECONSTRUCTOR) && !(identification_flags & ID_COMPONENT_DECONSTRUCTOR_DEEPSCANNED))
identification_flags |= ID_COMPONENT_DECONSTRUCTOR_DEEPSCANNED
on_identify(user)
if(deconstructor_reveal_text)
information += deconstructor_reveal_text
return COMPONENT_DEEPSCAN_UNCOVERED_INFORMATION
/**
* Identification component subtype - Syndicate
*
* Checks if the user is a traitor.
*/
/datum/component/identification/syndicate
/datum/component/identification/syndicate/check_knowledge(mob/user)
. = ..()
if(user?.mind?.has_antag_datum(/datum/antagonist/traitor))
. = max(., ID_COMPONENT_KNOWLEDGE_FULL)
+1 -1
View File
@@ -13,7 +13,7 @@
expire_time = world.time + expire_in
QDEL_IN(src, expire_in)
if(!ismovableatom(parent))
if(!ismovable(parent))
return COMPONENT_INCOMPATIBLE
RegisterSignal(parent, COMSIG_COMPONENT_CLEAN_ACT, .proc/clean)
RegisterSignal(parent, COMSIG_MOVABLE_BUCKLE, .proc/try_infect_buckle)
+1 -1
View File
@@ -34,7 +34,7 @@
do_knockback(target, null, angle2dir(Angle))
/datum/component/knockback/proc/do_knockback(atom/target, mob/thrower, throw_dir)
if(!ismovableatom(target) || throw_dir == null)
if(!ismovable(target) || throw_dir == null)
return
var/atom/movable/throwee = target
if(throwee.anchored && !throw_anchored)
+1 -1
View File
@@ -2,7 +2,7 @@
if(!isatom(parent))
return COMPONENT_INCOMPATIBLE
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/examine)
if(ismovableatom(parent))
if(ismovable(parent))
RegisterSignal(parent, COMSIG_MOVABLE_CROSSED, .proc/crossed_react)
RegisterSignal(parent, COMSIG_MOVABLE_UNCROSSED, .proc/uncrossed_react)
for(var/i in get_turf(parent))
+3 -2
View File
@@ -14,8 +14,8 @@
var/x = target.x
var/y = target.y
var/z = target.z
var/turf/southwest = locate(CLAMP(x - (direction & WEST ? range : 0), 1, world.maxx), CLAMP(y - (direction & SOUTH ? range : 0), 1, world.maxy), CLAMP(z, 1, world.maxz))
var/turf/northeast = locate(CLAMP(x + (direction & EAST ? range : 0), 1, world.maxx), CLAMP(y + (direction & NORTH ? range : 0), 1, world.maxy), CLAMP(z, 1, world.maxz))
var/turf/southwest = locate(clamp(x - (direction & WEST ? range : 0), 1, world.maxx), clamp(y - (direction & SOUTH ? range : 0), 1, world.maxy), clamp(z, 1, world.maxz))
var/turf/northeast = locate(clamp(x + (direction & EAST ? range : 0), 1, world.maxx), clamp(y + (direction & NORTH ? range : 0), 1, world.maxy), clamp(z, 1, world.maxz))
//holder.vis_contents += block(southwest, northeast) // This doesnt work because of beta bug memes
for(var/i in block(southwest, northeast))
holder.vis_contents += i
@@ -39,4 +39,5 @@
/obj/effect/abstract/mirage_holder
name = "Mirage holder"
anchored = TRUE
plane = PLANE_SPACE
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
+6 -6
View File
@@ -175,27 +175,27 @@
switch(sanity)
if(-INFINITY to SANITY_CRAZY)
setInsanityEffect(MAJOR_INSANITY_PEN)
master.add_movespeed_modifier(MOVESPEED_ID_SANITY, TRUE, 100, override=TRUE, multiplicative_slowdown=1.5) //Did we change something ? movetypes is runtiming, movetypes=(~FLYING))
master.add_movespeed_modifier(/datum/movespeed_modifier/sanity/insane)
sanity_level = 6
if(SANITY_CRAZY to SANITY_UNSTABLE)
setInsanityEffect(MINOR_INSANITY_PEN)
master.add_movespeed_modifier(MOVESPEED_ID_SANITY, TRUE, 100, override=TRUE, multiplicative_slowdown=1)//, movetypes=(~FLYING))
master.add_movespeed_modifier(/datum/movespeed_modifier/sanity/crazy)
sanity_level = 5
if(SANITY_UNSTABLE to SANITY_DISTURBED)
setInsanityEffect(0)
master.add_movespeed_modifier(MOVESPEED_ID_SANITY, TRUE, 100, override=TRUE, multiplicative_slowdown=0.5)//, movetypes=(~FLYING))
master.add_movespeed_modifier(/datum/movespeed_modifier/sanity/disturbed)
sanity_level = 4
if(SANITY_DISTURBED to SANITY_NEUTRAL)
setInsanityEffect(0)
master.remove_movespeed_modifier(MOVESPEED_ID_SANITY, TRUE)
master.remove_movespeed_modifier(MOVESPEED_ID_SANITY)
sanity_level = 3
if(SANITY_NEUTRAL+1 to SANITY_GREAT+1) //shitty hack but +1 to prevent it from responding to super small differences
setInsanityEffect(0)
master.remove_movespeed_modifier(MOVESPEED_ID_SANITY, TRUE)
master.remove_movespeed_modifier(MOVESPEED_ID_SANITY)
sanity_level = 2
if(SANITY_GREAT+1 to INFINITY)
setInsanityEffect(0)
master.remove_movespeed_modifier(MOVESPEED_ID_SANITY, TRUE)
master.remove_movespeed_modifier(MOVESPEED_ID_SANITY)
sanity_level = 1
//update_mood_icon()
+6 -6
View File
@@ -12,7 +12,7 @@
var/list/datum/nanite_program/programs = list()
var/max_programs = NANITE_PROGRAM_LIMIT
var/list/datum/nanite_program/protocol/protocols = list() ///Separate list of protocol programs, to avoid looping through the whole programs list when cheking for conflicts
var/list/datum/nanite_program/protocol/protocols = list() ///Separate list of protocol programs, to avoid looping through the whole programs list when checking for conflicts
var/start_time = 0 ///Timestamp to when the nanites were first inserted in the host
var/stealth = FALSE //if TRUE, does not appear on HUDs and health scans
var/diagnostics = TRUE //if TRUE, displays program list when scanned by nanite scanners
@@ -175,7 +175,7 @@
return (nanite_volume > 0)
/datum/component/nanites/proc/adjust_nanites(datum/source, amount)
nanite_volume = CLAMP(nanite_volume + amount, 0, max_nanites)
nanite_volume = clamp(nanite_volume + amount, 0, max_nanites)
if(nanite_volume <= 0) //oops we ran out
qdel(src)
@@ -187,7 +187,7 @@
if(remove || stealth)
return //bye icon
var/nanite_percent = (nanite_volume / max_nanites) * 100
nanite_percent = CLAMP(CEILING(nanite_percent, 10), 10, 100)
nanite_percent = clamp(CEILING(nanite_percent, 10), 10, 100)
holder.icon_state = "nanites[nanite_percent]"
/datum/component/nanites/proc/on_emp(datum/source, severity)
@@ -249,13 +249,13 @@
return FALSE
/datum/component/nanites/proc/set_volume(datum/source, amount)
nanite_volume = CLAMP(amount, 0, max_nanites)
nanite_volume = clamp(amount, 0, max_nanites)
/datum/component/nanites/proc/set_max_volume(datum/source, amount)
max_nanites = max(1, max_nanites)
/datum/component/nanites/proc/set_cloud(datum/source, amount)
cloud_id = CLAMP(amount, 0, 100)
cloud_id = clamp(amount, 0, 100)
/datum/component/nanites/proc/set_cloud_sync(datum/source, method)
switch(method)
@@ -267,7 +267,7 @@
cloud_active = TRUE
/datum/component/nanites/proc/set_safety(datum/source, amount)
safety_threshold = CLAMP(amount, 0, max_nanites)
safety_threshold = clamp(amount, 0, max_nanites)
/datum/component/nanites/proc/set_regen(datum/source, amount)
regen_rate = amount
+4 -4
View File
@@ -22,14 +22,14 @@
/datum/component/orbiter/RegisterWithParent()
. = ..()
var/atom/target = parent
while(ismovableatom(target))
while(ismovable(target))
RegisterSignal(target, COMSIG_MOVABLE_MOVED, .proc/move_react)
target = target.loc
/datum/component/orbiter/UnregisterFromParent()
. = ..()
var/atom/target = parent
while(ismovableatom(target))
while(ismovable(target))
UnregisterSignal(target, COMSIG_MOVABLE_MOVED)
target = target.loc
@@ -111,12 +111,12 @@
// These are prety rarely activated, how often are you following something in a bag?
if(oldloc && !isturf(oldloc)) // We used to be registered to it, probably
var/atom/target = oldloc
while(ismovableatom(target))
while(ismovable(target))
UnregisterSignal(target, COMSIG_MOVABLE_MOVED)
target = target.loc
if(orbited?.loc && orbited.loc != newturf) // We want to know when anything holding us moves too
var/atom/target = orbited.loc
while(ismovableatom(target))
while(ismovable(target))
RegisterSignal(target, COMSIG_MOVABLE_MOVED, .proc/move_react, TRUE)
target = target.loc
+4 -4
View File
@@ -1,8 +1,8 @@
//This component applies a customizable drop_shadow filter to its wearer when they toggle combat mode on or off. This can stack.
/datum/component/wearertargeting/phantomthief
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS
signals = list(COMSIG_LIVING_COMBAT_ENABLED)
dupe_mode = COMPONENT_DUPE_ALLOWED
signals = list(COMSIG_LIVING_COMBAT_ENABLED, COMSIG_LIVING_COMBAT_DISABLED)
proctype = .proc/handlefilterstuff
var/filter_x
var/filter_y
@@ -19,8 +19,8 @@
filter_color = _color
valid_slots = _valid_slots
/datum/component/wearertargeting/phantomthief/proc/handlefilterstuff(datum/source, mob/user, combatmodestate)
if(!combatmodestate)
/datum/component/wearertargeting/phantomthief/proc/handlefilterstuff(mob/living/user, was_forced = FALSE)
if(!(user.combat_flags & COMBAT_FLAG_COMBAT_ACTIVE))
user.remove_filter("phantomthief")
else
user.add_filter("phantomthief", 4, list(type = "drop_shadow", x = filter_x, y = filter_y, size = filter_size, color = filter_color))
+1 -2
View File
@@ -25,7 +25,6 @@
RegisterSignal(parent, COMSIG_ITEM_ATTACK_OBJ, .proc/rad_attack)
else
CRASH("Something that wasn't an atom was given /datum/component/radioactive")
return
if(strength > RAD_MINIMUM_CONTAMINATION)
SSradiation.warn(src)
@@ -84,4 +83,4 @@
#undef RAD_AMOUNT_LOW
#undef RAD_AMOUNT_MEDIUM
#undef RAD_AMOUNT_HIGH
#undef RAD_AMOUNT_EXTREME
#undef RAD_AMOUNT_EXTREME
+28 -15
View File
@@ -21,7 +21,7 @@
var/list/offhands = list() // keyed list containing all the current riding offsets associated by mob
/datum/component/riding/Initialize()
if(!ismovableatom(parent))
if(!ismovable(parent))
return COMPONENT_INCOMPATIBLE
RegisterSignal(parent, COMSIG_MOVABLE_BUCKLE, .proc/vehicle_mob_buckle)
RegisterSignal(parent, COMSIG_MOVABLE_UNBUCKLE, .proc/vehicle_mob_unbuckle)
@@ -66,6 +66,9 @@
var/atom/movable/AM = parent
AM.unbuckle_mob(M)
/datum/component/riding/proc/additional_offset_checks()
return TRUE
/datum/component/riding/proc/handle_vehicle_offsets()
var/atom/movable/AM = parent
var/AM_dir = "[AM.dir]"
@@ -77,16 +80,17 @@
var/list/offsets = get_offsets(passindex)
var/rider_dir = get_rider_dir(passindex)
buckled_mob.setDir(rider_dir)
dir_loop:
for(var/offsetdir in offsets)
if(offsetdir == AM_dir)
var/list/diroffsets = offsets[offsetdir]
buckled_mob.pixel_x = diroffsets[1]
if(diroffsets.len >= 2)
buckled_mob.pixel_y = diroffsets[2]
if(diroffsets.len == 3)
buckled_mob.layer = diroffsets[3]
break dir_loop
for(var/offsetdir in offsets)
if(offsetdir == AM_dir)
var/list/diroffsets = offsets[offsetdir]
buckled_mob.pixel_x = diroffsets[1]
if(diroffsets.len >= 2)
buckled_mob.pixel_y = diroffsets[2]
if(diroffsets.len == 3)
buckled_mob.layer = diroffsets[3]
break
if (!additional_offset_checks())
return
var/list/static/default_vehicle_pixel_offsets = list(TEXT_NORTH = list(0, 0), TEXT_SOUTH = list(0, 0), TEXT_EAST = list(0, 0), TEXT_WEST = list(0, 0))
var/px = default_vehicle_pixel_offsets[AM_dir]
var/py = default_vehicle_pixel_offsets[AM_dir]
@@ -147,7 +151,6 @@
if(user.incapacitated())
Unbuckle(user)
return
if(world.time < last_vehicle_move + ((last_move_diagonal? 2 : 1) * vehicle_move_delay))
return
last_vehicle_move = world.time
@@ -169,8 +172,8 @@
else
last_move_diagonal = FALSE
handle_vehicle_layer()
handle_vehicle_offsets()
handle_vehicle_layer()
else
to_chat(user, "<span class='notice'>You'll need the keys in one of your hands to [drive_verb] [AM].</span>")
@@ -195,13 +198,14 @@
/datum/component/riding/human/Initialize()
. = ..()
directional_vehicle_layers = list(TEXT_NORTH = MOB_LOWER_LAYER, TEXT_SOUTH = MOB_UPPER_LAYER, TEXT_EAST = MOB_UPPER_LAYER, TEXT_WEST = MOB_UPPER_LAYER)
RegisterSignal(parent, COMSIG_HUMAN_MELEE_UNARMED_ATTACK, .proc/on_host_unarmed_melee)
/datum/component/riding/human/vehicle_mob_unbuckle(datum/source, mob/living/M, force = FALSE)
. = ..()
var/mob/living/carbon/human/H = parent
if(!length(H.buckled_mobs))
H.remove_movespeed_modifier(MOVESPEED_ID_HUMAN_CARRYING)
H.remove_movespeed_modifier(/datum/movespeed_modifier/human_carry)
if(!fireman_carrying)
M.Daze(25)
REMOVE_TRAIT(M, TRAIT_MOBILITY_NOUSE, src)
@@ -210,7 +214,7 @@
. = ..()
var/mob/living/carbon/human/H = parent
if(length(H.buckled_mobs))
H.add_movespeed_modifier(MOVESPEED_ID_HUMAN_CARRYING, multiplicative_slowdown = fireman_carrying? FIREMAN_CARRY_SLOWDOWN : PIGGYBACK_CARRY_SLOWDOWN)
H.add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/human_carry, TRUE, fireman_carrying? FIREMAN_CARRY_SLOWDOWN : PIGGYBACK_CARRY_SLOWDOWN)
if(fireman_carrying)
ADD_TRAIT(M, TRAIT_MOBILITY_NOUSE, src)
@@ -220,6 +224,7 @@
force_dismount(target)
/datum/component/riding/human/handle_vehicle_layer()
. = ..()
var/atom/movable/AM = parent
if(AM.buckled_mobs && AM.buckled_mobs.len)
for(var/mob/M in AM.buckled_mobs) //ensure proper layering of piggyback and carry, sometimes weird offsets get applied
@@ -244,6 +249,10 @@
else
return list(TEXT_NORTH = list(0, 6), TEXT_SOUTH = list(0, 6), TEXT_EAST = list(-6, 4), TEXT_WEST = list( 6, 4))
/datum/component/riding/human/additional_offset_checks()
var/mob/living/carbon/human/H = parent
return !H.buckled
/datum/component/riding/human/force_dismount(mob/living/user)
var/atom/movable/AM = parent
AM.unbuckle_mob(user)
@@ -253,6 +262,10 @@
/datum/component/riding/cyborg
/datum/component/riding/cyborg/Initialize()
. = ..()
directional_vehicle_layers = list(TEXT_NORTH = MOB_LOWER_LAYER, TEXT_SOUTH = MOB_UPPER_LAYER, TEXT_EAST = MOB_UPPER_LAYER, TEXT_WEST = MOB_UPPER_LAYER)
/datum/component/riding/cyborg/ride_check(mob/user)
var/atom/movable/AM = parent
if(user.incapacitated())
+1 -1
View File
@@ -14,7 +14,7 @@
var/default_rotation_direction = ROTATION_CLOCKWISE
/datum/component/simple_rotation/Initialize(rotation_flags = NONE ,can_user_rotate,can_be_rotated,after_rotation)
if(!ismovableatom(parent))
if(!ismovable(parent))
return COMPONENT_INCOMPATIBLE
//throw if no rotation direction is specificed ?
+191
View File
@@ -0,0 +1,191 @@
/datum/component/shielded
dupe_mode = COMPONENT_DUPE_ALLOWED
can_transfer = TRUE
var/charges = 3
var/max_charges = 3
var/recharge_delay = 20 SECONDS //How long after we've been attacked before we can start recharging.
var/recharge_rate = 1 //How quickly the shield recharges once it starts charging. Can be a decimal. set to zero to disable.
var/last_time_used //Last time the shield attempted to stop an attack.
var/accepted_slots
var/shield_state = "shield-old" //the state of the shield overlay.
var/broken_state //null by default.
var/recharge_sound = 'sound/magic/charge.ogg'
var/recharge_end_sound = 'sound/machines/ding.ogg'
var/mob/living/holder //who is currently benefiting from the shield.
var/dissipating = FALSE //Is this shield meant to dissipate over time instead of recharging.
var/del_on_overload = FALSE //will delete itself once it has no charges left.
/datum/component/shielded/Initialize(current, max = 3, delay = 20 SECONDS, rate = 1, slots, state = "shield-old", broken, \
sound = 'sound/magic/charge.ogg', end_sound = 'sound/machines/ding.ogg', diss = FALSE, del_overload = FALSE)
var/isitem = isitem(parent)
if(!isitem && !isliving(parent))
return COMPONENT_INCOMPATIBLE
max_charges = max
charges = !isnull(current) ? current : max_charges
recharge_delay = delay
recharge_rate = rate
accepted_slots = slots
shield_state = state
broken_state = broken
recharge_sound = sound
recharge_end_sound = end_sound
dissipating = diss
del_on_overload = del_overload
if(dissipating && recharge_rate > 0)
recharge_rate = -recharge_rate
if(recharge_delay && recharge_rate && (charges < max_charges || dissipating))
START_PROCESSING(SSdcs, src)
/datum/component/shielded/RegisterWithParent()
. = ..()
if(isitem(parent))
RegisterSignal(parent, COMSIG_ITEM_EQUIPPED, .proc/on_equip)
RegisterSignal(parent, COMSIG_ITEM_DROPPED, .proc/on_drop)
else //it's a mob
var/mob/living/L = parent
RegisterSignal(L, COMSIG_LIVING_RUN_BLOCK, .proc/living_block)
holder = L
var/to_add = charges >= 1 ? shield_state : broken_state
if(to_add)
var/mutable_appearance/M = mutable_appearance('icons/effects/effects.dmi', to_add)
M.layer = (L.layer > MOB_LAYER ? L.layer : MOB_LAYER) + 0.01
holder.add_overlay(M, TRUE)
/datum/component/shielded/UnregisterFromParent()
. = ..()
if(parent != holder) //not a mob, thus an item.
UnregisterSignal(parent, list(COMSIG_ITEM_RUN_BLOCK,COMSIG_ITEM_CHECK_BLOCK,COMSIG_ITEM_EQUIPPED,COMSIG_ITEM_DROPPED))
if(holder)
UnregisterSignal(holder, list(COMSIG_LIVING_RUN_BLOCK, COMSIG_LIVING_GET_BLOCKING_ITEMS))
var/to_remove = charges >= 1 ? shield_state : broken_state
if(to_remove)
holder.cut_overlay(mutable_appearance('icons/effects/effects.dmi', to_remove), TRUE)
holder = null
/datum/component/shielded/process()
if(world.time < last_time_used && !dissipating)
return
var/old_charges = charges
charges = clamp(charges + recharge_rate, 0, max_charges)
if(round(old_charges) >= round(charges)) //only send outputs if it effectively gained at least one charge
return
var/sound = recharge_sound
if(dissipating ? !charges : charges == max_charges )
STOP_PROCESSING(SSdcs, src)
sound = recharge_end_sound
if(parent && sound)
playsound(parent, sound, 50, 1)
if(charges < 1 && del_on_overload)
if(holder)
holder.visible_message("[holder]'s shield overloads!")
qdel(src)
return
if(holder && (old_charges < 1 && charges >= 1) || (!del_on_overload && old_charges >= 1 && charges < 1))
update_shield_overlay(charges < 1)
/datum/component/shielded/proc/adjust_charges(amount)
var/old_charges = charges
charges = clamp(charges + amount, 0, max_charges)
if(recharge_delay && recharge_rate && (dissipating ? !charges : charges == max_charges))
STOP_PROCESSING(SSdcs, src)
if(charges < 1 && del_on_overload)
if(holder)
holder.visible_message("[holder]'s shield overloads!")
qdel(src)
return
if(holder && (old_charges < 1 && charges >= 1) || (!del_on_overload && old_charges >= 1 && charges < 1))
update_shield_overlay(charges < 1)
/datum/component/shielded/proc/update_shield_overlay(broken)
if(!holder)
return
var/to_remove = broken ? shield_state : broken_state
var/to_add = broken ? broken_state : shield_state
if(to_remove)
holder.cut_overlay(mutable_appearance('icons/effects/effects.dmi', to_remove), TRUE)
if(to_add)
var/mutable_appearance/M = mutable_appearance('icons/effects/effects.dmi', to_add)
M.layer = (holder.layer > MOB_LAYER ? holder.layer : MOB_LAYER) + 0.01
holder.add_overlay(M, TRUE)
/datum/component/shielded/proc/on_equip(obj/item/source, mob/living/equipper, slot)
if(!(accepted_slots & slotdefine2slotbit(slot)))
return
holder = equipper
RegisterSignal(parent, COMSIG_ITEM_RUN_BLOCK, .proc/on_run_block)
RegisterSignal(parent, COMSIG_ITEM_CHECK_BLOCK, .proc/on_check_block)
RegisterSignal(equipper, COMSIG_LIVING_GET_BLOCKING_ITEMS, .proc/include_shield)
var/to_add = charges >= 1 ? shield_state : broken_state
if(to_add)
var/mutable_appearance/M = mutable_appearance('icons/effects/effects.dmi', to_add)
M.layer = (holder.layer > MOB_LAYER ? holder.layer : MOB_LAYER) + 0.01
equipper.add_overlay(M, TRUE)
/datum/component/shielded/proc/on_drop(obj/item/source, mob/dropper)
if(holder == dropper)
UnregisterSignal(holder, COMSIG_LIVING_GET_BLOCKING_ITEMS)
UnregisterSignal(parent, list(COMSIG_ITEM_RUN_BLOCK, COMSIG_ITEM_CHECK_BLOCK))
var/to_remove = charges >= 1 ? shield_state : broken_state
if(to_remove)
holder.cut_overlay(mutable_appearance('icons/effects/effects.dmi', to_remove), TRUE)
holder = null
/datum/component/shielded/proc/include_shield(mob/source, list/items)
items += parent
/datum/component/shielded/proc/on_run_block(obj/item/source, mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return)
if(block_return[BLOCK_RETURN_NORMAL_BLOCK_CHANCE] >= 100) //already blocked by another shielded item, don't do anything.
block_return[BLOCK_RETURN_BLOCK_CAPACITY] += round(charges)
return BLOCK_NONE
last_time_used = world.time + recharge_delay
if(charges < 1)
return BLOCK_NONE
var/datum/effect_system/spark_spread/s = new
s.set_up(2, 1, source)
s.start()
owner.visible_message("<span class='danger'>[holder]'s shields deflect [attack_text] in a shower of sparks!</span>")
charges--
var/rounded_charges = round(charges)
if(recharge_delay && recharge_rate && !dissipating)
START_PROCESSING(SSdcs, src)
if(charges < 1)
owner.visible_message("[holder]'s shield overloads!")
if(del_on_overload)
qdel(src)
else
update_shield_overlay(TRUE)
block_return[BLOCK_RETURN_NORMAL_BLOCK_CHANCE] = 100
block_return[BLOCK_RETURN_BLOCK_CAPACITY] += rounded_charges
return BLOCK_SUCCESS | BLOCK_PHYSICAL_EXTERNAL
/datum/component/shielded/proc/on_check_block(obj/item/source, mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return)
if(charges >= 1)
block_return[BLOCK_RETURN_NORMAL_BLOCK_CHANCE] = 100
block_return[BLOCK_RETURN_BLOCK_CAPACITY] += round(charges)
/datum/component/shielded/proc/living_block(mob/living/source, real_attack, object, damage, attack_text, attack_type, armour_penetration, attacker, def_zone, return_list)
if(!real_attack)
if(charges >= 1)
return_list[BLOCK_RETURN_NORMAL_BLOCK_CHANCE] = 100
return_list[BLOCK_RETURN_BLOCK_CAPACITY] = round(charges)
return
last_time_used = world.time + recharge_delay
if(charges < 1)
return BLOCK_NONE
var/datum/effect_system/spark_spread/s = new
s.set_up(2, 1, source)
s.start()
source.visible_message("<span class='danger'>[source]'s shields deflect [attack_text] in a shower of sparks!</span>")
charges--
var/rounded_charges = round(charges)
if(recharge_delay && recharge_rate && !dissipating)
START_PROCESSING(SSdcs, src)
if(charges < 1)
source.visible_message("[source]'s shield overloads!")
if(del_on_overload)
qdel(src)
else
update_shield_overlay(TRUE)
return_list[BLOCK_RETURN_NORMAL_BLOCK_CHANCE] = 100
return_list[BLOCK_RETURN_BLOCK_CAPACITY] += rounded_charges
return BLOCK_SUCCESS | BLOCK_PHYSICAL_EXTERNAL
+2 -2
View File
@@ -14,7 +14,7 @@
parent_atom.opacity = 0
if(isliving(parent_atom))
var/mob/living/L = parent_atom
L.add_movespeed_modifier(MOVESPEED_ID_SHRINK_RAY, update=TRUE, priority=100, multiplicative_slowdown=4)
L.add_movespeed_modifier(/datum/movespeed_modifier/shrink_ray)
if(iscarbon(L))
var/mob/living/carbon/C = L
C.unequip_everything()
@@ -35,7 +35,7 @@
parent_atom.opacity = oldopac
if(isliving(parent_atom))
var/mob/living/L = parent_atom
L.remove_movespeed_modifier(MOVESPEED_ID_SHRINK_RAY)
L.remove_movespeed_modifier(/datum/movespeed_modifier/shrink_ray)
if(ishuman(L))
var/mob/living/carbon/human/H = L
H.physiology.damage_resistance += 100
+1 -1
View File
@@ -16,7 +16,7 @@
if(!isatom(parent))
return COMPONENT_INCOMPATIBLE
RegisterSignal(parent, list(COMSIG_ATOM_ENTERED, COMSIG_ATOM_BLOB_ACT, COMSIG_ATOM_HULK_ATTACK, COMSIG_PARENT_ATTACKBY), .proc/play_squeak)
if(ismovableatom(parent))
if(ismovable(parent))
RegisterSignal(parent, list(COMSIG_MOVABLE_BUMP, COMSIG_MOVABLE_IMPACT), .proc/play_squeak)
RegisterSignal(parent, list(COMSIG_MOVABLE_CROSSED, COMSIG_ITEM_WEARERCROSSED), .proc/play_squeak_crossed)
RegisterSignal(parent, COMSIG_MOVABLE_DISPOSING, .proc/disposing_react)
+1 -1
View File
@@ -5,7 +5,7 @@
var/allow_death = FALSE
/datum/component/stationloving/Initialize(inform_admins = FALSE, allow_death = FALSE)
if(!ismovableatom(parent))
if(!ismovable(parent))
return COMPONENT_INCOMPATIBLE
RegisterSignal(parent, list(COMSIG_MOVABLE_Z_CHANGED), .proc/check_in_bounds)
RegisterSignal(parent, list(COMSIG_MOVABLE_SECLUDED_LOCATION), .proc/relocate)
@@ -60,7 +60,7 @@
_contents_limbo = null
if(_user_limbo)
for(var/i in _user_limbo)
show_to(i)
ui_show(i)
_user_limbo = null
/datum/component/storage/concrete/_insert_physical_item(obj/item/I, override = FALSE)
@@ -18,7 +18,7 @@
return
. = COMPONENT_NO_ATTACK_HAND
if(!check_locked(source, user, TRUE))
show_to(user)
ui_show(user)
A.do_jiggle()
if(rustle_sound)
playsound(A, "rustle", 50, 1, -5)
@@ -56,7 +56,8 @@
/obj/item/scalpel, /obj/item/reagent_containers/syringe, /obj/item/dnainjector,
/obj/item/reagent_containers/hypospray/medipen, /obj/item/reagent_containers/dropper,
/obj/item/implanter, /obj/item/screwdriver, /obj/item/weldingtool/mini,
/obj/item/firing_pin, /obj/item/gun/ballistic/automatic/pistol, /obj/item/gun/ballistic/automatic/magrifle/pistol
/obj/item/firing_pin, /obj/item/gun/ballistic/automatic/pistol, /obj/item/gun/ballistic/automatic/magrifle/pistol,
/obj/item/toy/plush/snakeplushie
))
/datum/component/storage/concrete/pockets/shoes/clown/Initialize()
@@ -3,6 +3,7 @@
allow_quick_gather = TRUE
allow_quick_empty = TRUE
click_gather = TRUE
storage_flags = STORAGE_FLAGS_LEGACY_DEFAULT
max_w_class = WEIGHT_CLASS_NORMAL
max_combined_w_class = 100
max_items = 100
@@ -1,6 +1,7 @@
//Stack-only storage.
/datum/component/storage/concrete/stack
display_numerical_stacking = TRUE
storage_flags = STORAGE_FLAGS_LEGACY_DEFAULT
var/max_combined_stack_amount = 300
max_w_class = WEIGHT_CLASS_NORMAL
max_combined_w_class = WEIGHT_CLASS_NORMAL * 14
+80 -155
View File
@@ -15,15 +15,23 @@
var/datum/component/storage/concrete/master //If not null, all actions act on master and this is just an access point.
var/list/can_hold //if this is set, only things in this typecache will fit.
var/list/can_hold_extra //if this is set, it will also be able to hold these.
var/list/cant_hold //if this is set, anything in this typecache will not be able to fit.
var/list/mob/is_using //lazy list of mobs looking at the contents of this storage.
var/locked = FALSE //when locked nothing can see inside or use it.
var/max_w_class = WEIGHT_CLASS_SMALL //max size of objects that will fit.
var/max_combined_w_class = 14 //max combined sizes of objects that will fit.
var/max_items = 7 //max number of objects that will fit.
/// Storage flags, including what kinds of limiters we use for how many items we can hold
var/storage_flags = STORAGE_FLAGS_LEGACY_DEFAULT
/// Max w_class we can hold. Applies to [STORAGE_LIMIT_COMBINED_W_CLASS] and [STORAGE_LIMIT_VOLUME]
var/max_w_class = WEIGHT_CLASS_SMALL
/// Max combined w_class. Applies to [STORAGE_LIMIT_COMBINED_W_CLASS]
var/max_combined_w_class = WEIGHT_CLASS_SMALL * 7
/// Max items we can hold. Applies to [STORAGE_LIMIT_MAX_ITEMS]
var/max_items = 7
/// Max volume we can hold. Applies to [STORAGE_LIMIT_VOLUME]. Auto scaled on New() if unset.
var/max_volume
var/emp_shielded = FALSE
@@ -39,8 +47,17 @@
var/display_numerical_stacking = FALSE //stack things of the same type and show as a single object with a number.
var/obj/screen/storage/boxes //storage display object
var/obj/screen/close/closer //close button object
/// "legacy"/default view mode's storage "boxes"
var/obj/screen/storage/boxes/ui_boxes
/// New volumetric storage display mode's left side
var/obj/screen/storage/left/ui_left
/// New volumetric storage display mode's center 'blocks'
var/obj/screen/storage/continuous/ui_continuous
/// The close button, used in all modes. Frames right side in volumetric mode.
var/obj/screen/storage/close/ui_close
/// Associative list of list(item = screen object) for volumetric storage item screen blocks
var/list/ui_item_blocks
var/current_maxscreensize
var/allow_big_nesting = FALSE //allow storage objects of the same or greater size.
@@ -68,9 +85,6 @@
return COMPONENT_INCOMPATIBLE
if(master)
change_master(master)
boxes = new(null, src)
closer = new(null, src)
orient2hud()
RegisterSignal(parent, COMSIG_CONTAINS_STORAGE, .proc/on_check)
RegisterSignal(parent, COMSIG_IS_STORAGE_LOCKED, .proc/check_locked)
@@ -111,8 +125,15 @@
/datum/component/storage/Destroy()
close_all()
QDEL_NULL(boxes)
QDEL_NULL(closer)
QDEL_NULL(ui_boxes)
QDEL_NULL(ui_close)
QDEL_NULL(ui_continuous)
QDEL_NULL(ui_left)
// DO NOT USE QDEL_LIST_ASSOC.
if(ui_item_blocks)
for(var/i in ui_item_blocks)
qdel(ui_item_blocks[i]) //qdel the screen object not the item
ui_item_blocks.Cut()
LAZYCLEARLIST(is_using)
return ..()
@@ -286,7 +307,7 @@
if(!_target)
_target = get_turf(parent)
if(usr)
hide_from(usr)
ui_hide(usr)
var/list/contents = contents()
var/atom/real_location = real_location()
for(var/obj/item/I in contents)
@@ -300,106 +321,8 @@
if(check_locked())
close_all()
/datum/component/storage/proc/_process_numerical_display()
. = list()
for(var/obj/item/I in accessible_items())
if(QDELETED(I))
continue
if(!.[I.type])
.[I.type] = new /datum/numbered_display(I, 1)
else
var/datum/numbered_display/ND = .[I.type]
ND.number++
. = sortTim(., /proc/cmp_numbered_displays_name_asc, associative = TRUE)
//This proc determines the size of the inventory to be displayed. Please touch it only if you know what you're doing.
/datum/component/storage/proc/orient2hud(mob/user, maxcolumns)
var/list/accessible_contents = accessible_items()
var/adjusted_contents = length(accessible_contents)
//Numbered contents display
var/list/datum/numbered_display/numbered_contents
if(display_numerical_stacking)
numbered_contents = _process_numerical_display()
adjusted_contents = numbered_contents.len
var/columns = CLAMP(max_items, 1, maxcolumns ? maxcolumns : screen_max_columns)
var/rows = CLAMP(CEILING(adjusted_contents / columns, 1), 1, screen_max_rows)
standard_orient_objs(rows, columns, numbered_contents)
//This proc draws out the inventory and places the items on it. It uses the standard position.
/datum/component/storage/proc/standard_orient_objs(rows, cols, list/obj/item/numerical_display_contents)
boxes.screen_loc = "[screen_start_x]:[screen_pixel_x],[screen_start_y]:[screen_pixel_y] to [screen_start_x+cols-1]:[screen_pixel_x],[screen_start_y+rows-1]:[screen_pixel_y]"
var/cx = screen_start_x
var/cy = screen_start_y
if(islist(numerical_display_contents))
for(var/type in numerical_display_contents)
var/datum/numbered_display/ND = numerical_display_contents[type]
ND.sample_object.mouse_opacity = MOUSE_OPACITY_OPAQUE
ND.sample_object.screen_loc = "[cx]:[screen_pixel_x],[cy]:[screen_pixel_y]"
ND.sample_object.maptext = "<font color='white'>[(ND.number > 1)? "[ND.number]" : ""]</font>"
ND.sample_object.layer = ABOVE_HUD_LAYER
ND.sample_object.plane = ABOVE_HUD_PLANE
cx++
if(cx - screen_start_x >= cols)
cx = screen_start_x
cy++
if(cy - screen_start_y >= rows)
break
else
for(var/obj/O in accessible_items())
if(QDELETED(O))
continue
O.mouse_opacity = MOUSE_OPACITY_OPAQUE //This is here so storage items that spawn with contents correctly have the "click around item to equip"
O.screen_loc = "[cx]:[screen_pixel_x],[cy]:[screen_pixel_y]"
O.maptext = ""
O.layer = ABOVE_HUD_LAYER
O.plane = ABOVE_HUD_PLANE
cx++
if(cx - screen_start_x >= cols)
cx = screen_start_x
cy++
if(cy - screen_start_y >= rows)
break
closer.screen_loc = "[screen_start_x + cols]:[screen_pixel_x],[screen_start_y]:[screen_pixel_y]"
/datum/component/storage/proc/show_to(mob/M, set_screen_size = TRUE)
if(!M.client)
return FALSE
var/list/cview = getviewsize(M.client.view)
var/maxallowedscreensize = cview[1]-8
if(set_screen_size)
current_maxscreensize = maxallowedscreensize
else if(current_maxscreensize)
maxallowedscreensize = current_maxscreensize
if(M.active_storage != src && (M.stat == CONSCIOUS))
for(var/obj/item/I in accessible_items())
if(I.on_found(M))
return FALSE
if(M.active_storage)
M.active_storage.hide_from(M)
orient2hud(M, (isliving(M) ? maxallowedscreensize : 7))
M.client.screen |= boxes
M.client.screen |= closer
M.client.screen |= accessible_items()
M.active_storage = src
LAZYOR(is_using, M)
return TRUE
/datum/component/storage/proc/hide_from(mob/M)
if(!M.client)
return TRUE
var/atom/real_location = real_location()
M.client.screen -= boxes
M.client.screen -= closer
M.client.screen -= real_location.contents
if(M.active_storage == src)
M.active_storage = null
LAZYREMOVE(is_using, M)
return TRUE
/datum/component/storage/proc/close(mob/M)
hide_from(M)
ui_hide(M)
/datum/component/storage/proc/close_all()
. = FALSE
@@ -418,25 +341,6 @@
var/datum/component/storage/concrete/master = master()
master.emp_act(source, severity)
//This proc draws out the inventory and places the items on it. tx and ty are the upper left tile and mx, my are the bottm right.
//The numbers are calculated from the bottom-left The bottom-left slot being 1,1.
/datum/component/storage/proc/orient_objs(tx, ty, mx, my)
var/atom/real_location = real_location()
var/cx = tx
var/cy = ty
boxes.screen_loc = "[tx]:,[ty] to [mx],[my]"
for(var/obj/O in real_location)
if(QDELETED(O))
continue
O.screen_loc = "[cx],[cy]"
O.layer = ABOVE_HUD_LAYER
O.plane = ABOVE_HUD_PLANE
cx++
if(cx > mx)
cx = tx
cy--
closer.screen_loc = "[mx+1],[my]"
//Resets something that is being removed from storage.
/datum/component/storage/proc/_removal_reset(atom/movable/thing)
if(!istype(thing))
@@ -448,6 +352,9 @@
/datum/component/storage/proc/_remove_and_refresh(datum/source, atom/movable/thing)
_removal_reset(thing)
if(LAZYACCESS(ui_item_blocks, thing))
qdel(ui_item_blocks[thing])
ui_item_blocks -= thing
refresh_mob_views()
//Call this proc to handle the removal of an item from the storage item. The item will be moved to the new_location target, if that is null it's being deleted
@@ -462,7 +369,7 @@
/datum/component/storage/proc/refresh_mob_views()
var/list/seeing = can_see_contents()
for(var/i in seeing)
show_to(i)
ui_show(i)
return TRUE
/datum/component/storage/proc/can_see_contents()
@@ -559,7 +466,7 @@
A.add_fingerprint(M)
if(!force && (check_locked(null, M) || !M.CanReach(parent, view_only = TRUE)))
return FALSE
show_to(M, !ghost)
ui_show(M, !ghost)
/datum/component/storage/proc/mousedrop_receive(datum/source, atom/movable/O, mob/M)
if(isitem(O))
@@ -587,30 +494,42 @@
if(M && !stop_messages)
host.add_fingerprint(M)
return FALSE
if(real_location.contents.len >= max_items)
if(!stop_messages)
to_chat(M, "<span class='warning'>[host] is full, make some space!</span>")
return FALSE //Storage item is full
if(length(can_hold))
if(!is_type_in_typecache(I, can_hold))
if(!length(can_hold_extra) || !is_type_in_typecache(I, can_hold_extra))
if(length(can_hold) && !is_type_in_typecache(I, can_hold))
if(!stop_messages)
to_chat(M, "<span class='warning'>[host] cannot hold [I]!</span>")
return FALSE
if(is_type_in_typecache(I, cant_hold)) //Check for specific items which this container can't hold.
if(!stop_messages)
to_chat(M, "<span class='warning'>[host] cannot hold [I]!</span>")
return FALSE
if(I.w_class > max_w_class)
if(!stop_messages)
to_chat(M, "<span class='warning'>[I] is too big for [host]!</span>")
return FALSE
var/sum_w_class = I.w_class
for(var/obj/item/_I in real_location)
sum_w_class += _I.w_class //Adds up the combined w_classes which will be in the storage item if the item is added to it.
if(sum_w_class > max_combined_w_class)
if(!stop_messages)
to_chat(M, "<span class='warning'>[I] won't fit in [host], make some space!</span>")
return FALSE
if(is_type_in_typecache(I, cant_hold)) //Check for specific items which this container can't hold.
if(!stop_messages)
to_chat(M, "<span class='warning'>[host] cannot hold [I]!</span>")
return FALSE
if(storage_flags & STORAGE_LIMIT_MAX_W_CLASS && I.w_class > max_w_class)
if(!stop_messages)
to_chat(M, "<span class='warning'>[I] is too long for [host]!</span>")
return FALSE
// STORAGE LIMITS
if(storage_flags & STORAGE_LIMIT_MAX_ITEMS)
if(real_location.contents.len >= max_items)
if(!stop_messages)
to_chat(M, "<span class='warning'>[host] has too many things in it, make some space!</span>")
return FALSE //Storage item is full
if(storage_flags & STORAGE_LIMIT_COMBINED_W_CLASS)
var/sum_w_class = I.w_class
for(var/obj/item/_I in real_location)
sum_w_class += _I.w_class //Adds up the combined w_classes which will be in the storage item if the item is added to it.
if(sum_w_class > max_combined_w_class)
if(!stop_messages)
to_chat(M, "<span class='warning'>[I] won't fit in [host], make some space!</span>")
return FALSE
if(storage_flags & STORAGE_LIMIT_VOLUME)
var/sum_volume = I.get_w_volume()
for(var/obj/item/_I in real_location)
sum_volume += _I.get_w_volume()
if(sum_volume > get_max_volume())
if(!stop_messages)
to_chat(M, "<span class='warning'>[I] is too spacious to fit in [host], make some space!</span>")
return FALSE
/////////////////
if(isitem(host))
var/obj/item/IP = host
var/datum/component/storage/STR_I = I.GetComponent(/datum/component/storage)
@@ -742,7 +661,7 @@
if(A.loc == user)
. = COMPONENT_NO_ATTACK_HAND
if(!check_locked(source, user, TRUE))
show_to(user)
ui_show(user)
A.do_jiggle()
/datum/component/storage/proc/signal_on_pickup(datum/source, mob/user)
@@ -761,7 +680,7 @@
return do_quick_empty(loctarget)
/datum/component/storage/proc/signal_hide_attempt(datum/source, mob/target)
return hide_from(target)
return ui_hide(target)
/datum/component/storage/proc/on_alt_click(datum/source, mob/user)
if(!isliving(user) || !user.CanReach(parent))
@@ -790,7 +709,7 @@
user.visible_message("<span class='warning'>[user] draws [I] from [parent]!</span>", "<span class='notice'>You draw [I] from [parent].</span>")
return TRUE
/datum/component/storage/proc/action_trigger(datum/signal_source, datum/action/source)
/datum/component/storage/proc/action_trigger(datum/action/source, obj/target)
gather_mode_switch(source.owner)
return COMPONENT_ACTION_BLOCK_TRIGGER
@@ -803,3 +722,9 @@
to_chat(user, "[parent] now picks up all items in a tile at once.")
if(COLLECT_ONE)
to_chat(user, "[parent] now picks up one item at a time.")
/**
* Gets our max volume
*/
/datum/component/storage/proc/get_max_volume()
return max_volume || AUTO_SCALE_STORAGE_VOLUME(max_w_class, max_combined_w_class)
+293
View File
@@ -0,0 +1,293 @@
/**
* Generates a list of numbered_display datums for the numerical display system.
*/
/datum/component/storage/proc/_process_numerical_display()
. = list()
for(var/obj/item/I in accessible_items())
if(QDELETED(I))
continue
if(!.[I.type])
.[I.type] = new /datum/numbered_display(I, 1)
else
var/datum/numbered_display/ND = .[I.type]
ND.number++
. = sortTim(., /proc/cmp_numbered_displays_name_asc, associative = TRUE)
/**
* Orients all objects in legacy mode, and returns the objects to show to the user.
*/
/datum/component/storage/proc/orient2hud_legacy(mob/user, maxcolumns)
. = list()
var/list/accessible_contents = accessible_items()
var/adjusted_contents = length(accessible_contents)
//Numbered contents display
var/list/datum/numbered_display/numbered_contents
if(display_numerical_stacking)
numbered_contents = _process_numerical_display()
adjusted_contents = numbered_contents.len
var/columns = clamp(max_items, 1, maxcolumns ? maxcolumns : screen_max_columns)
var/rows = clamp(CEILING(adjusted_contents / columns, 1), 1, screen_max_rows)
// First, boxes.
ui_boxes = get_ui_boxes()
ui_boxes.screen_loc = "[screen_start_x]:[screen_pixel_x],[screen_start_y]:[screen_pixel_y] to [screen_start_x+columns-1]:[screen_pixel_x],[screen_start_y+rows-1]:[screen_pixel_y]"
. += ui_boxes
// Then, closer.
ui_close = get_ui_close()
ui_close.screen_loc = "[screen_start_x + columns]:[screen_pixel_x],[screen_start_y]:[screen_pixel_y]"
. += ui_close
// Then orient the actual items.
var/cx = screen_start_x
var/cy = screen_start_y
if(islist(numbered_contents))
for(var/type in numbered_contents)
var/datum/numbered_display/ND = numbered_contents[type]
ND.sample_object.mouse_opacity = MOUSE_OPACITY_OPAQUE
ND.sample_object.screen_loc = "[cx]:[screen_pixel_x],[cy]:[screen_pixel_y]"
ND.sample_object.maptext = "<font color='white'>[(ND.number > 1)? "[ND.number]" : ""]</font>"
ND.sample_object.layer = ABOVE_HUD_LAYER
ND.sample_object.plane = ABOVE_HUD_PLANE
. += ND.sample_object
cx++
if(cx - screen_start_x >= columns)
cx = screen_start_x
cy++
if(cy - screen_start_y >= rows)
break
else
for(var/obj/O in accessible_items())
if(QDELETED(O))
continue
O.mouse_opacity = MOUSE_OPACITY_OPAQUE //This is here so storage items that spawn with contents correctly have the "click around item to equip"
O.screen_loc = "[cx]:[screen_pixel_x],[cy]:[screen_pixel_y]"
O.maptext = ""
O.layer = ABOVE_HUD_LAYER
O.plane = ABOVE_HUD_PLANE
. += O
cx++
if(cx - screen_start_x >= columns)
cx = screen_start_x
cy++
if(cy - screen_start_y >= rows)
break
/**
* Orients all objects in .. volumetric mode. Does not support numerical display!
*/
/datum/component/storage/proc/orient2hud_volumetric(mob/user, maxcolumns)
. = list()
// Generate ui_item_blocks for missing ones and render+orient.
var/list/atom/contents = accessible_items()
// our volume
var/our_volume = get_max_volume()
var/horizontal_pixels = (maxcolumns * world.icon_size) - (VOLUMETRIC_STORAGE_EDGE_PADDING * 2)
var/max_horizontal_pixels = horizontal_pixels * screen_max_rows
// sigh loopmania time
var/used = 0
// define outside for performance
var/volume
var/list/volume_by_item = list()
var/list/percentage_by_item = list()
for(var/obj/item/I in contents)
volume = I.get_w_volume()
used += volume
volume_by_item[I] = volume
percentage_by_item[I] = volume / get_max_volume()
var/padding_pixels = ((length(percentage_by_item) - 1) * VOLUMETRIC_STORAGE_ITEM_PADDING) + VOLUMETRIC_STORAGE_EDGE_PADDING * 2
var/min_pixels = (MINIMUM_PIXELS_PER_ITEM * length(percentage_by_item)) + padding_pixels
// do the check for fallback for when someone has too much gamer gear
if((min_pixels) > (max_horizontal_pixels + 4)) // 4 pixel grace zone
to_chat(user, "<span class='warning'>[parent] was showed to you in legacy mode due to your items overrunning the three row limit! Consider not carrying too much or bugging a maintainer to raise this limit!</span>")
return orient2hud_legacy(user, maxcolumns)
// after this point we are sure we can somehow fit all items into our max number of rows.
// determine rows
var/rows = clamp(CEILING(min_pixels / horizontal_pixels, 1), 1, screen_max_rows)
var/overrun = FALSE
if(used > our_volume)
// congratulations we are now in overrun mode. everything will be crammed to minimum storage pixels.
to_chat(user, "<span class='warning'>[parent] rendered in overrun mode due to more items inside than the maximum volume supports.</span>")
overrun = TRUE
// how much we are using
var/using_horizontal_pixels = horizontal_pixels * rows
// item padding
using_horizontal_pixels -= padding_pixels
// define outside for marginal performance boost
var/obj/item/I
// start at this pixel from screen_start_x.
var/current_pixel = VOLUMETRIC_STORAGE_EDGE_PADDING
var/row = 1
LAZYINITLIST(ui_item_blocks)
for(var/i in percentage_by_item)
I = i
var/percent = percentage_by_item[I]
if(!ui_item_blocks[I])
ui_item_blocks[I] = new /obj/screen/storage/volumetric_box/center(null, src, I)
var/obj/screen/storage/volumetric_box/center/B = ui_item_blocks[I]
var/pixels_to_use = overrun? MINIMUM_PIXELS_PER_ITEM : max(using_horizontal_pixels * percent, MINIMUM_PIXELS_PER_ITEM)
var/addrow = FALSE
if(CEILING(pixels_to_use, 1) >= FLOOR(horizontal_pixels - current_pixel - VOLUMETRIC_STORAGE_EDGE_PADDING, 1))
pixels_to_use = horizontal_pixels - current_pixel - VOLUMETRIC_STORAGE_EDGE_PADDING
addrow = TRUE
// now that we have pixels_to_use, place our thing and add it to the returned list.
B.screen_loc = I.screen_loc = "[screen_start_x]:[round(current_pixel + (pixels_to_use * 0.5) + VOLUMETRIC_STORAGE_ITEM_PADDING, 1)],[screen_start_y+row-1]:[screen_pixel_y]"
// add the used pixels to pixel after we place the object
current_pixel += pixels_to_use + VOLUMETRIC_STORAGE_ITEM_PADDING
// set various things
B.set_pixel_size(pixels_to_use)
B.layer = VOLUMETRIC_STORAGE_BOX_LAYER
B.plane = VOLUMETRIC_STORAGE_BOX_PLANE
B.name = I.name
I.mouse_opacity = MOUSE_OPACITY_ICON
I.maptext = ""
I.layer = VOLUMETRIC_STORAGE_ITEM_LAYER
I.plane = VOLUMETRIC_STORAGE_ITEM_PLANE
// finally add our things.
. += B.on_screen_objects()
. += I
// go up a row if needed
if(addrow)
row++
current_pixel = VOLUMETRIC_STORAGE_EDGE_PADDING
// Then, continuous section.
ui_continuous = get_ui_continuous()
ui_continuous.screen_loc = "[screen_start_x]:[screen_pixel_x],[screen_start_y]:[screen_pixel_y] to [screen_start_x+maxcolumns-1]:[screen_pixel_x],[screen_start_y+rows-1]:[screen_pixel_y]"
. += ui_continuous
// Then, left.
ui_left = get_ui_left()
ui_left.screen_loc = "[screen_start_x]:[screen_pixel_x - 2],[screen_start_y]:[screen_pixel_y] to [screen_start_x]:[screen_pixel_x - 2],[screen_start_y+rows-1]:[screen_pixel_y]"
. += ui_left
// Then, closer, which is also our right element.
ui_close = get_ui_close()
ui_close.screen_loc = "[screen_start_x + maxcolumns]:[screen_pixel_x],[screen_start_y]:[screen_pixel_y] to [screen_start_x + maxcolumns]:[screen_pixel_x],[screen_start_y+rows-1]:[screen_pixel_y]"
. += ui_close
/**
* Shows our UI to a mob.
*/
/datum/component/storage/proc/ui_show(mob/M, set_screen_size = TRUE)
if(!M.client)
return FALSE
var/list/cview = getviewsize(M.client.view)
// in tiles
var/maxallowedscreensize = cview[1]-8
if(set_screen_size)
current_maxscreensize = maxallowedscreensize
else if(current_maxscreensize)
maxallowedscreensize = current_maxscreensize
// we got screen size, register signal
RegisterSignal(M, COMSIG_MOB_CLIENT_LOGOUT, .proc/on_logout, override = TRUE)
if(M.active_storage != src)
if(M.active_storage)
M.active_storage.ui_hide(M)
M.active_storage = src
LAZYOR(is_using, M)
if(!M.client?.prefs?.no_tetris_storage && volumetric_ui())
//new volumetric ui bay-style
M.client.screen |= orient2hud_volumetric(M, maxallowedscreensize)
else
//old ui
M.client.screen |= orient2hud_legacy(M, maxallowedscreensize)
return TRUE
/**
* VV hooked to ensure no lingering screen objects.
*/
/datum/component/storage/vv_edit_var(var_name, var_value)
var/list/old
if(var_name == NAMEOF(src, storage_flags))
old = is_using.Copy()
for(var/i in is_using)
ui_hide(i)
. = ..()
if(old)
for(var/i in old)
ui_show(i)
/**
* Proc triggered by signal to ensure logging out clients don't linger.
*/
/datum/component/storage/proc/on_logout(datum/source, client/C)
ui_hide(source)
/**
* Hides our UI from a mob
*/
/datum/component/storage/proc/ui_hide(mob/M)
if(!M.client)
return TRUE
UnregisterSignal(M, COMSIG_MOB_CLIENT_LOGOUT)
M.client.screen -= list(ui_boxes, ui_close, ui_left, ui_continuous) + get_ui_item_objects_hide()
if(M.active_storage == src)
M.active_storage = null
LAZYREMOVE(is_using, M)
return TRUE
/**
* Returns TRUE if we are using volumetric UI instead of box UI
*/
/datum/component/storage/proc/volumetric_ui()
var/atom/real_location = real_location()
return (storage_flags & STORAGE_LIMIT_VOLUME) && (length(real_location.contents) <= MAXIMUM_VOLUMETRIC_ITEMS) && !display_numerical_stacking
/**
* Gets the ui item objects to ui_hide.
*/
/datum/component/storage/proc/get_ui_item_objects_hide()
if(!volumetric_ui())
var/atom/real_location = real_location()
return real_location.contents
else
. = list()
for(var/i in ui_item_blocks)
// get both the box and the item
. += ui_item_blocks[i]
. += i
/**
* Gets our ui_boxes, making it if it doesn't exist.
*/
/datum/component/storage/proc/get_ui_boxes()
if(!ui_boxes)
ui_boxes = new(null, src)
return ui_boxes
/**
* Gets our ui_left, making it if it doesn't exist.
*/
/datum/component/storage/proc/get_ui_left()
if(!ui_left)
ui_left = new(null, src)
return ui_left
/**
* Gets our ui_close, making it if it doesn't exist.
*/
/datum/component/storage/proc/get_ui_close()
if(!ui_close)
ui_close = new(null, src)
return ui_close
/**
* Gets our ui_continuous, making it if it doesn't exist.
*/
/datum/component/storage/proc/get_ui_continuous()
if(!ui_continuous)
ui_continuous = new(null, src)
return ui_continuous
+491
View File
@@ -0,0 +1,491 @@
#define MAX_TABLE_MESSES 8 // how many things can we knock off a table at once?
/**
*#tackle.dm
*
* For when you want to throw a person at something and have fun stuff happen
*
* This component is made for carbon mobs (really, humans), and allows its parent to throw themselves and perform tackles. This is done by enabling throw mode, then clicking on your
* intended target with an empty hand. You will then launch toward your target. If you hit a carbon, you'll roll to see how hard you hit them. If you hit a solid non-mob, you'll
* roll to see how badly you just messed yourself up. If, along your journey, you hit a table, you'll slam onto it and send up to MAX_TABLE_MESSES (8) /obj/items on the table flying,
* and take a bit of extra damage and stun for each thing launched.
*
* There are 2 """skill rolls""" involved here, which are handled and explained in sack() and rollTackle() (for roll 1, carbons), and splat() (for roll 2, walls and solid objects)
*/
/datum/component/tackler
dupe_mode = COMPONENT_DUPE_UNIQUE
///How much stamina it takes to launch a tackle
var/stamina_cost
///Launching a tackle calls Knockdown on you for this long, so this is your cooldown. Once you stand back up, you can tackle again.
var/base_knockdown
///Your max range for how far you can tackle.
var/range
///How fast you sail through the air. Standard tackles are 1 speed, but gloves that throw you faster come at a cost: higher speeds make it more likely you'll be badly injured if you fly into a non-mob obstacle.
var/speed
///A flat modifier to your roll against your target, as described in [rollTackle()][/datum/component/tackler/proc/rollTackle]. Slightly misleading, skills aren't relevant here, this is a matter of what type of gloves (or whatever) is granting you the ability to tackle.
var/skill_mod
///Some gloves, generally ones that increase mobility, may have a minimum distance to fly. Rocket gloves are especially dangerous with this, be sure you'll hit your target or have a clear background if you miss, or else!
var/min_distance
///The throwdatum we're currently dealing with, if we need it
var/datum/thrownthing/tackle
/datum/component/tackler/Initialize(stamina_cost = 25, base_knockdown = 1 SECONDS, range = 4, speed = 1, skill_mod = 0, min_distance = min_distance)
if(!iscarbon(parent))
return COMPONENT_INCOMPATIBLE
src.stamina_cost = stamina_cost
src.base_knockdown = base_knockdown
src.range = range
src.speed = speed
src.skill_mod = skill_mod
src.min_distance = min_distance
var/mob/living/carbon/P = parent
to_chat(P, "<span class='notice'>You are now able to launch tackles! You can do so by activating throw intent, and clicking on your target with an empty hand.</span>")
P.tackling = TRUE
addtimer(CALLBACK(src, .proc/resetTackle), base_knockdown, TIMER_STOPPABLE)
/datum/component/tackler/Destroy()
var/mob/living/carbon/P = parent
to_chat(P, "<span class='notice'>You can no longer tackle.</span>")
P.tackling = FALSE
..()
/datum/component/tackler/RegisterWithParent()
RegisterSignal(parent, COMSIG_MOB_CLICKON, .proc/checkTackle)
RegisterSignal(parent, COMSIG_MOVABLE_IMPACT, .proc/sack)
RegisterSignal(parent, COMSIG_MOVABLE_POST_THROW, .proc/registerTackle)
/datum/component/tackler/UnregisterFromParent()
UnregisterSignal(parent, list(COMSIG_MOB_CLICKON, COMSIG_MOVABLE_IMPACT, COMSIG_MOVABLE_MOVED, COMSIG_MOVABLE_POST_THROW))
///Store the thrownthing datum for later use
/datum/component/tackler/proc/registerTackle(mob/living/carbon/user, datum/thrownthing/TT)
tackle = TT
///See if we can tackle or not. If we can, leap!
/datum/component/tackler/proc/checkTackle(mob/living/carbon/user, atom/A, params)
if(!user.in_throw_mode || user.get_active_held_item() || user.pulling || user.buckling)
return
if(HAS_TRAIT(user, TRAIT_HULK))
to_chat(user, "<span class='warning'>You're too angry to remember how to tackle!</span>")
return
if(user.restrained())
to_chat(user, "<span class='warning'>You need free use of your hands to tackle!</span>")
return
if(!(user.mobility_flags & MOBILITY_STAND))
to_chat(user, "<span class='warning'>You must be standing to tackle!</span>")
return
if(user.tackling)
to_chat(user, "<span class='warning'>You're not ready to tackle!</span>")
return
if(user.has_status_effect(STATUS_EFFECT_TASED)) // can't tackle if you just got tased
to_chat(user, "<span class='warning'>You can't tackle while tased!</span>")
return
user.face_atom(A)
var/list/modifiers = params2list(params)
if(modifiers["alt"] || modifiers["shift"] || modifiers["ctrl"] || modifiers["middle"])
return
user.tackling = TRUE
RegisterSignal(user, COMSIG_MOVABLE_MOVED, .proc/checkObstacle)
playsound(user, 'sound/weapons/thudswoosh.ogg', 40, TRUE, -1)
var/leap_word = iscatperson(user) ? "pounce" : "leap" ///If cat, "pounce" instead of "leap".
if(can_see(user, A, 7))
user.visible_message("<span class='warning'>[user] [leap_word]s at [A]!</span>", "<span class='danger'>You [leap_word] at [A]!</span>")
else
user.visible_message("<span class='warning'>[user] [leap_word]s!</span>", "<span class='danger'>You [leap_word]!</span>")
if(get_dist(user, A) < min_distance)
A = get_ranged_target_turf(user, get_dir(user, A), min_distance) //TODO: this only works in cardinals/diagonals, make it work with in-betweens too!
user.Knockdown(base_knockdown, TRUE, TRUE)
user.adjustStaminaLoss(stamina_cost)
user.throw_at(A, range, speed, user, FALSE)
user.toggle_throw_mode()
addtimer(CALLBACK(src, .proc/resetTackle), base_knockdown, TIMER_STOPPABLE)
return(COMSIG_MOB_CANCEL_CLICKON)
/**
* sack()
*
* sack() is called when you actually smack into something, assuming we're mid-tackle. First it deals with smacking into non-carbons, in two cases:
* * If it's a non-carbon mob, we don't care, get out of here and do normal thrown-into-mob stuff
* * Else, if it's something dense (walls, machinery, structures, most things other than the floor), go to splat() and get ready for some high grade shit
*
* If it's a carbon we hit, we'll call rollTackle() which rolls a die and calculates modifiers for both the tackler and target, then gives us a number. Negatives favor the target, while positives favor the tackler.
* Check [rollTackle()][/datum/component/tackler/proc/rollTackle] for a more thorough explanation on the modifiers at play.
*
* Then, we figure out what effect we want, and we get to work! Note that with standard gripper gloves and no modifiers, the range of rolls is (-3, 3). The results are as follows, based on what we rolled:
* * -inf to -5: Seriously botched tackle, tackler suffers a concussion, brute damage, and a 3 second paralyze, target suffers nothing
* * -4 to -2: weak tackle, tackler gets 3 second knockdown, target gets shove slowdown but is otherwise fine
* * -1 to 0: decent tackle, tackler gets up a bit quicker than the target
* * 1: solid tackle, tackler has more of an advantage getting up quicker
* * 2 to 4: expert tackle, tackler has sizeable advantage and lands on their feet with a free passive grab
* * 5 to inf: MONSTER tackle, tackler gets up immediately and gets a free aggressive grab, target takes sizeable stamina damage from the hit and is paralyzed for one and a half seconds and knocked down for three seconds
*
* Finally, we return a bitflag to [COMSIG_MOVABLE_IMPACT] that forces the hitpush to false so that we don't knock them away.
*/
/datum/component/tackler/proc/sack(mob/living/carbon/user, atom/hit)
if(!user.tackling || !tackle)
return
if(!iscarbon(hit))
if(hit.density)
return splat(user, hit)
return
var/mob/living/carbon/target = hit
var/tackle_word = iscatperson(user) ? "pounce" : "tackle" ///If cat, "pounce" instead of "tackle".
var/roll = rollTackle(target)
user.tackling = FALSE
switch(roll)
if(-INFINITY to -5)
user.visible_message("<span class='danger'>[user] botches [user.p_their()] [tackle_word] and slams [user.p_their()] head into [target], knocking [user.p_them()]self silly!</span>", "<span class='userdanger'>You botch your [tackle_word] and slam your head into [target], knocking yourself silly!</span>", target)
to_chat(target, "<span class='userdanger'>[user] botches [user.p_their()] [tackle_word] and slams [user.p_their()] head into you, knocking [user.p_them()]self silly!</span>")
user.Paralyze(30)
var/obj/item/bodypart/head/hed = user.get_bodypart(BODY_ZONE_HEAD)
if(hed)
hed.receive_damage(brute=20, updating_health=TRUE)
user.gain_trauma(/datum/brain_trauma/mild/concussion)
if(-4 to -2) // glancing blow at best
user.visible_message("<span class='warning'>[user] lands a weak [tackle_word] on [target], briefly knocking [target.p_them()] off-balance!</span>", "<span class='userdanger'>You land a weak [tackle_word] on [target], briefly knocking [target.p_them()] off-balance!</span>", target)
to_chat(target, "<span class='userdanger'>[user] lands a weak [tackle_word] on you, briefly knocking you off-balance!</span>")
user.Knockdown(30)
target.apply_status_effect(STATUS_EFFECT_TASED_WEAK, 6 SECONDS)
if(-1 to 0) // decent hit, both parties are about equally inconvenienced
user.visible_message("<span class='warning'>[user] lands a passable [tackle_word] on [target], sending them both tumbling!</span>", "<span class='userdanger'>You land a passable [tackle_word] on [target], sending you both tumbling!</span>", target)
to_chat(target, "<span class='userdanger'>[user] lands a passable [tackle_word] on you, sending you both tumbling!</span>")
target.adjustStaminaLoss(stamina_cost)
target.Paralyze(5)
user.Knockdown(20)
target.Knockdown(25)
if(1 to 2) // solid hit, tackler has a slight advantage
user.visible_message("<span class='warning'>[user] lands a solid [tackle_word] on [target], knocking them both down hard!</span>", "<span class='userdanger'>You land a solid [tackle_word] on [target], knocking you both down hard!</span>", target)
to_chat(target, "<span class='userdanger'>[user] lands a solid [tackle_word] on you, knocking you both down hard!</span>")
target.adjustStaminaLoss(30)
target.Paralyze(5)
user.Knockdown(10)
target.Knockdown(20)
if(3 to 4) // really good hit, the target is definitely worse off here. Without positive modifiers, this is as good a tackle as you can land
user.visible_message("<span class='warning'>[user] lands an expert [tackle_word] on [target], knocking [target.p_them()] down hard while landing on [user.p_their()] feet with a passive grip!</span>", "<span class='userdanger'>You land an expert [tackle_word] on [target], knocking [target.p_them()] down hard while landing on your feet with a passive grip!</span>", target)
to_chat(target, "<span class='userdanger'>[user] lands an expert [tackle_word] on you, knocking you down hard and maintaining a passive grab!</span>")
user.SetKnockdown(0)
user.set_resting(FALSE, TRUE, FALSE)
user.forceMove(get_turf(target))
target.adjustStaminaLoss(40)
target.Paralyze(5)
target.Knockdown(30)
if(ishuman(target) && iscarbon(user))
target.grabbedby(user)
if(5 to INFINITY) // absolutely BODIED
user.visible_message("<span class='warning'>[user] lands a monster [tackle_word] on [target], knocking [target.p_them()] senseless and applying an aggressive pin!</span>", "<span class='userdanger'>You land a monster [tackle_word] on [target], knocking [target.p_them()] senseless and applying an aggressive pin!</span>", target)
to_chat(target, "<span class='userdanger'>[user] lands a monster [tackle_word] on you, knocking you senseless and aggressively pinning you!</span>")
user.SetKnockdown(0)
user.set_resting(FALSE, TRUE, FALSE)
user.forceMove(get_turf(target))
target.adjustStaminaLoss(40)
target.Paralyze(5)
target.Knockdown(30)
if(ishuman(target) && iscarbon(user))
target.grabbedby(user)
target.grippedby(user, instant = TRUE)
SEND_SIGNAL(user, COMSIG_CARBON_TACKLED, roll)
return COMPONENT_MOVABLE_IMPACT_FLIP_HITPUSH
/**
* rollTackle()
*
* This handles all of the modifiers for the actual carbon-on-carbon tackling, and gets its own proc because of how many there are (with plenty more in mind!)
*
* The base roll is between (-3, 3), with negative numbers favoring the target, and positive numbers favoring the tackler. The target and the tackler are both assessed for
* how easy they are to knock over, with clumsiness and dwarfiness being strong maluses for each, and gigantism giving a bonus for each. These numbers and ideas
* are absolutely subject to change.
* In addition, after subtracting the defender's mod and adding the attacker's mod to the roll, the component's base (skill) mod is added as well. Some sources of tackles
* are better at taking people down, like the bruiser and rocket gloves, while the dolphin gloves have a malus in exchange for better mobility.
*/
/datum/component/tackler/proc/rollTackle(mob/living/carbon/target)
var/defense_mod = 0
var/attack_mod = 0
// DE-FENSE
if(target.drunkenness > 60) // drunks are easier to knock off balance
defense_mod -= 3
else if(target.drunkenness > 30)
defense_mod -= 1
if(HAS_TRAIT(target, TRAIT_CLUMSY))
defense_mod -= 2
if(HAS_TRAIT(target, TRAIT_FAT)) // chonkers are harder to knock over
defense_mod += 1
//if(HAS_TRAIT(target, TRAIT_GRABWEAKNESS)) Todo, port the pushover trait
//defense_mod -= 2
if(HAS_TRAIT(target, TRAIT_DWARF))
defense_mod -= 2
if(HAS_TRAIT(target, TRAIT_GIANT))
defense_mod += 2
if(ishuman(target))
var/mob/living/carbon/human/T = target
var/suit_slot = T.get_item_by_slot(ITEM_SLOT_OCLOTHING)
if(isnull(T.wear_suit) && isnull(T.w_uniform)) // who honestly puts all of their effort into tackling a naked guy?
defense_mod += 2
if(suit_slot && (istype(suit_slot,/obj/item/clothing/suit/space/hardsuit)))
defense_mod += 1
if(T.is_shove_knockdown_blocked()) // riot armor and such
defense_mod += 5
if(T.is_holding_item_of_type(/obj/item/shield))
defense_mod += 2
if(islizard(T))
if(!T.getorganslot(ORGAN_SLOT_TAIL)) // lizards without tails are off-balance
defense_mod -= 1
else if(T.dna.species.is_wagging_tail()) // lizard tail wagging is robust and can swat away assailants!
defense_mod += 1
// OF-FENSE
var/mob/living/carbon/sacker = parent
if(sacker.drunkenness > 60) // you're far too drunk to hold back!
attack_mod += 1
else if(sacker.drunkenness > 30) // if you're only a bit drunk though, you're just sloppy
attack_mod -= 1
if(HAS_TRAIT(sacker, TRAIT_CLUMSY))
attack_mod -= 2
if(HAS_TRAIT(sacker, TRAIT_DWARF))
attack_mod -= 2
if(HAS_TRAIT(sacker, TRAIT_GIANT))
attack_mod += 2
if(ishuman(target))
var/mob/living/carbon/human/S = sacker
var/suit_slot = S.get_item_by_slot(ITEM_SLOT_OCLOTHING)
if(suit_slot && (istype(suit_slot,/obj/item/clothing/suit/armor/riot))) // tackling in riot armor is more effective, but tiring
attack_mod += 2
sacker.adjustStaminaLoss(20)
var/r = rand(-3, 3) - defense_mod + attack_mod + skill_mod
return r
/**
* splat()
*
* This is where we handle diving into dense atoms, generally with effects ranging from bad to REALLY bad. This works as a percentile roll that is modified in two steps as detailed below. The higher
* the roll, the more severe the result.
*
* Mod 1: Speed
* * Base tackle speed is 1, which is what normal gripper gloves use. For other sources with higher speed tackles, like dolphin and ESPECIALLY rocket gloves, we obey Newton's laws and hit things harder.
* * For every unit of speed above 1, move the lower bound of the roll up by 15. Unlike Mod 2, this only serves to raise the lower bound, so it can't be directly counteracted by anything you can control.
*
* Mod 2: Misc
* -Flat modifiers, these take whatever you rolled and add/subtract to it, with the end result capped between the minimum from Mod 1 and 100. Note that since we can't roll higher than 100 to start with,
* wearing a helmet should be enough to remove any chance of permanently paralyzing yourself and dramatically lessen knocking yourself unconscious, even with rocket gloves. Will expand on maybe
* * Wearing a helmet: -6
* * Wearing armor: -6
* * Clumsy: +6
*
* Effects: Below are the outcomes based off your roll, in order of increasing severity
* * 1-63: Knocked down for a few seconds and a bit of brute and stamina damage
* * 64-83: Knocked silly, gain some confusion as well as the above
* * 84-93: Cranial trauma, get a concussion and more confusion, plus more damage
* * 94-98: Knocked unconscious, significant chance to get a random mild brain trauma, as well as a fair amount of damage
* * 99-100: Break your spinal cord, get paralyzed, take a bunch of damage too. Very unlucky!
*/
/datum/component/tackler/proc/splat(mob/living/carbon/user, atom/hit)
if(istype(hit, /obj/structure/window))
var/obj/structure/window/W = hit
splatWindow(user, W)
if(QDELETED(W))
return COMPONENT_MOVABLE_IMPACT_NEVERMIND
return
var/oopsie_mod = 0
var/danger_zone = (speed - 1) * 15 // for every extra speed we have over 1, take away 15 of the safest chance
danger_zone = max(min(danger_zone, 100), 1)
if(ishuman(user))
var/mob/living/carbon/human/S = user
var/head_slot = S.get_item_by_slot(ITEM_SLOT_HEAD)
var/suit_slot = S.get_item_by_slot(ITEM_SLOT_OCLOTHING)
if(head_slot && (istype(head_slot,/obj/item/clothing/head/helmet) || istype(head_slot,/obj/item/clothing/head/hardhat)))
oopsie_mod -= 6
if(suit_slot && (istype(suit_slot,/obj/item/clothing/suit/armor/)))
oopsie_mod -= 6
if(HAS_TRAIT(user, TRAIT_CLUMSY))
oopsie_mod += 6 //honk!
var/oopsie = rand(danger_zone, 100)
if(oopsie >= 94 && oopsie_mod < 0) // good job avoiding getting paralyzed! gold star!
to_chat(user, "<span class='usernotice'>You're really glad you're wearing protection!</span>")
oopsie += oopsie_mod
switch(oopsie)
if(99 to INFINITY)
// can you imagine standing around minding your own business when all of the sudden some guy fucking launches himself into a wall at full speed and irreparably paralyzes himself?
user.visible_message("<span class='danger'>[user] slams face-first into [hit] at an awkward angle, severing [user.p_their()] spinal column with a sickening crack! Holy shit!</span>", "<span class='userdanger'>You slam face-first into [hit] at an awkward angle, severing your spinal column with a sickening crack! Holy shit!</span>")
user.adjustStaminaLoss(30)
user.adjustBruteLoss(30)
playsound(user, 'sound/effects/blobattack.ogg', 60, TRUE)
playsound(user, 'sound/effects/splat.ogg', 70, TRUE)
user.emote("scream")
user.gain_trauma(/datum/brain_trauma/severe/paralysis/paraplegic) // oopsie indeed!
shake_camera(user, 7, 7)
user.overlay_fullscreen("flash", /obj/screen/fullscreen/flash)
user.clear_fullscreen("flash", 4.5)
if(94 to 98)
user.visible_message("<span class='danger'>[user] slams face-first into [hit] with a concerning squish, immediately going limp!</span>", "<span class='userdanger'>You slam face-first into [hit], and immediately lose consciousness!</span>")
user.adjustStaminaLoss(100)
user.adjustBruteLoss(30)
user.Unconscious(100)
user.gain_trauma_type(BRAIN_TRAUMA_MILD)
user.playsound_local(get_turf(user), 'sound/weapons/flashbang.ogg', 100, TRUE, 8, 0.9)
shake_camera(user, 6, 6)
user.overlay_fullscreen("flash", /obj/screen/fullscreen/flash)
user.clear_fullscreen("flash", 3.5)
if(84 to 93)
user.visible_message("<span class='danger'>[user] slams head-first into [hit], suffering major cranial trauma!</span>", "<span class='userdanger'>You slam head-first into [hit], and the world explodes around you!</span>")
user.adjustStaminaLoss(30)
user.adjustBruteLoss(30)
user.confused += 15
if(prob(80))
user.gain_trauma(/datum/brain_trauma/mild/concussion)
user.playsound_local(get_turf(user), 'sound/weapons/flashbang.ogg', 100, TRUE, 8, 0.9)
user.DefaultCombatKnockdown(40)
shake_camera(user, 5, 5)
user.overlay_fullscreen("flash", /obj/screen/fullscreen/flash)
user.clear_fullscreen("flash", 2.5)
if(64 to 83)
user.visible_message("<span class='danger'>[user] slams hard into [hit], knocking [user.p_them()] senseless!</span>", "<span class='userdanger'>You slam hard into [hit], knocking yourself senseless!</span>")
user.adjustStaminaLoss(30)
user.adjustBruteLoss(10)
user.confused += 10
user.DefaultCombatKnockdown(30)
shake_camera(user, 3, 4)
if(1 to 63)
user.visible_message("<span class='danger'>[user] slams into [hit]!</span>", "<span class='userdanger'>You slam into [hit]!</span>")
user.adjustStaminaLoss(20)
user.adjustBruteLoss(10)
user.DefaultCombatKnockdown(30)
shake_camera(user, 2, 2)
playsound(user, 'sound/weapons/smash.ogg', 70, TRUE)
/datum/component/tackler/proc/resetTackle()
var/mob/living/carbon/P = parent
P.tackling = FALSE
QDEL_NULL(tackle)
UnregisterSignal(parent, COMSIG_MOVABLE_MOVED)
///A special case for splatting for handling windows
/datum/component/tackler/proc/splatWindow(mob/living/carbon/user, obj/structure/window/W)
playsound(user, "sound/effects/Glasshit.ogg", 140, TRUE)
if(W.type in list(/obj/structure/window, /obj/structure/window/fulltile, /obj/structure/window/unanchored, /obj/structure/window/fulltile/unanchored)) // boring unreinforced windows
for(var/i = 0, i < speed, i++)
var/obj/item/shard/shard = new /obj/item/shard(get_turf(user))
//shard.embedding = list(embed_chance = 100, ignore_throwspeed_threshold = TRUE, impact_pain_mult=3, pain_chance=5)
//shard.AddElement(/datum/element/embed, shard.embedding)
user.hitby(shard, skipcatch = TRUE, hitpush = FALSE)
//shard.embedding = list()
//shard.AddElement(/datum/element/embed, shard.embedding)
W.obj_destruction()
user.adjustStaminaLoss(10 * speed)
user.DefaultCombatKnockdown(40)
user.Paralyze(5)
user.visible_message("<span class='danger'>[user] slams into [W] and shatters it, shredding [user.p_them()]self with glass!</span>", "<span class='userdanger'>You slam into [W] and shatter it, shredding yourself with glass!</span>")
else
user.visible_message("<span class='danger'>[user] slams into [W] like a bug, then slowly slides off it!</span>", "<span class='userdanger'>You slam into [W] like a bug, then slowly slide off it!</span>")
user.Paralyze(2)
user.DefaultCombatKnockdown(20)
W.take_damage(20 * speed)
user.adjustStaminaLoss(10 * speed)
user.adjustBruteLoss(5 * speed)
/datum/component/tackler/proc/delayedSmash(obj/structure/window/W)
if(W)
W.obj_destruction()
playsound(W, "shatter", 70, TRUE)
///Check to see if we hit a table, and if so, make a big mess!
/datum/component/tackler/proc/checkObstacle(mob/living/carbon/owner)
if(!owner.tackling)
return
var/turf/T = get_turf(owner)
var/obj/structure/table/kevved = locate(/obj/structure/table) in T.contents
if(!kevved)
return
var/list/messes = list()
// we split the mess-making into two parts (check what we're gonna send flying, intermission for dealing with the tackler, then actually send stuff flying) for the benefit of making sure the face-slam text
// comes before the list of stuff that goes flying, but can still adjust text + damage to how much of a mess it made
for(var/obj/item/I in T.contents)
if(!I.anchored)
messes += I
if(messes.len >= MAX_TABLE_MESSES)
break
/// for telling HOW big of a mess we just made
var/HOW_big_of_a_miss_did_we_just_make = ""
if(messes.len)
if(messes.len < MAX_TABLE_MESSES / 4)
HOW_big_of_a_miss_did_we_just_make = ", making a mess"
else if(messes.len < MAX_TABLE_MESSES / 2)
HOW_big_of_a_miss_did_we_just_make = ", making a big mess"
else if(messes.len < MAX_TABLE_MESSES)
HOW_big_of_a_miss_did_we_just_make = ", making a giant mess"
else
HOW_big_of_a_miss_did_we_just_make = ", making a ginormous mess!" // an extra exclamation point!! for emphasis!!!
owner.visible_message("<span class='danger'>[owner] trips over [kevved] and slams into it face-first[HOW_big_of_a_miss_did_we_just_make]!</span>", "<span class='userdanger'>You trip over [kevved] and slam into it face-first[HOW_big_of_a_miss_did_we_just_make]!</span>")
owner.adjustStaminaLoss(20 + messes.len * 2)
owner.adjustBruteLoss(10 + messes.len)
owner.Paralyze(2 * messes.len)
owner.DefaultCombatKnockdown(20 + 5 * messes.len) // 2 seconds of knockdown after the paralyze
for(var/obj/item/I in messes)
var/dist = rand(1, 3)
var/sp = 2
if(prob(25 * (src.speed - 1))) // if our tackle speed is higher than 1, with chance (speed - 1 * 25%), throw the thing at our tackle speed + 1
sp = speed + 1
I.throw_at(get_ranged_target_turf(I, pick(GLOB.alldirs), range = dist), range = dist, speed = sp)
I.visible_message("<span class='danger'>[I] goes flying[sp > 3 ? " dangerously fast" : ""]!</span>") // standard embed speed
playsound(owner, 'sound/weapons/smash.ogg', 70, TRUE)
tackle.finalize(hit=TRUE)
resetTackle()
#undef MAX_TABLE_MESSES
+1 -1
View File
@@ -18,7 +18,7 @@
UnregisterSignal(parent, list(COMSIG_ITEM_EQUIPPED, COMSIG_ITEM_DROPPED))
unmodify()
/datum/component/fantasy/Destroy()
/datum/component/tactical/Destroy()
unmodify()
return ..()
+1 -1
View File
@@ -176,7 +176,7 @@
/**
*The following procs simply acts as hooks for quit(), since components do not use callbacks anymore
*/
/datum/component/virtual_reality/proc/action_trigger(datum/signal_source, datum/action/source)
/datum/component/virtual_reality/proc/action_trigger(datum/action/source, obj/target)
quit()
return COMPONENT_ACTION_BLOCK_TRIGGER
+1 -2
View File
@@ -19,7 +19,6 @@
var/datum/component/wet_floor/WF = newcomp //Lets make an assumption
if(WF.gc()) //See if it's even valid, still. Also does LAZYLEN and stuff for us.
CRASH("Wet floor component tried to inherit another, but the other was able to garbage collect while being inherited! What a waste of time!")
return
for(var/i in WF.time_left_list)
add_wet(text2num(i), WF.time_left_list[i])
@@ -182,7 +181,7 @@
/datum/component/wet_floor/proc/_do_add_wet(type, duration_minimum, duration_add, duration_maximum)
var/time = 0
if(LAZYACCESS(time_left_list, "[type]"))
time = CLAMP(LAZYACCESS(time_left_list, "[type]") + duration_add, duration_minimum, duration_maximum)
time = clamp(LAZYACCESS(time_left_list, "[type]") + duration_add, duration_minimum, duration_maximum)
else
time = min(duration_minimum, duration_maximum)
LAZYSET(time_left_list, "[type]", time)
+2 -2
View File
@@ -19,7 +19,7 @@
dashing_item = dasher
holder = user
/datum/action/innate/dash/IsAvailable()
/datum/action/innate/dash/IsAvailable(silent = FALSE)
if(current_charges > 0)
return TRUE
else
@@ -42,7 +42,7 @@
addtimer(CALLBACK(src, .proc/charge), charge_rate)
/datum/action/innate/dash/proc/charge()
current_charges = CLAMP(current_charges + 1, 0, max_charges)
current_charges = clamp(current_charges + 1, 0, max_charges)
holder.update_action_buttons_icon()
if(recharge_sound)
playsound(dashing_item, recharge_sound, 50, 1)
-2
View File
@@ -175,11 +175,9 @@
if(!islist(jsonlist))
if(!istext(jsonlist))
CRASH("Invalid JSON")
return
jsonlist = json_decode(jsonlist)
if(!islist(jsonlist))
CRASH("Invalid JSON")
return
if(!jsonlist["DATUM_TYPE"])
return
if(!ispath(jsonlist["DATUM_TYPE"]))
+4 -3
View File
@@ -29,7 +29,8 @@
VV_DROPDOWN_OPTION(VV_HK_MARK, "Mark Object")
VV_DROPDOWN_OPTION(VV_HK_DELETE, "Delete")
VV_DROPDOWN_OPTION(VV_HK_EXPOSE, "Show VV To Player")
// VV_DROPDOWN_OPTION(VV_HK_MODIFY_TRAITS, "Modify Traits")
VV_DROPDOWN_OPTION(VV_HK_ADDCOMPONENT, "Add Component/Element")
VV_DROPDOWN_OPTION(VV_HK_MODIFY_TRAITS, "Modify Traits")
//This proc is only called if everything topic-wise is verified. The only verifications that should happen here is things like permission checks!
//href_list is a reference, modifying it in these procs WILL change the rest of the proc in topic.dm of admin/view_variables!
@@ -37,8 +38,8 @@
/datum/proc/vv_do_topic(list/href_list)
if(!usr || !usr.client || !usr.client.holder || !check_rights(NONE))
return FALSE //This is VV, not to be called by anything else.
// if(href_list[VV_HK_MODIFY_TRAITS])
// usr.client.holder.modify_traits(src)
if(href_list[VV_HK_MODIFY_TRAITS])
usr.client.holder.modify_traits(src)
return TRUE
/datum/proc/vv_get_header()
+3 -3
View File
@@ -246,10 +246,10 @@
else
visibility_flags &= ~HIDDEN_SCANNER
SetSpread(CLAMP(2 ** (properties["transmittable"] - symptoms.len), DISEASE_SPREAD_BLOOD, DISEASE_SPREAD_AIRBORNE))
SetSpread(clamp(2 ** (properties["transmittable"] - symptoms.len), DISEASE_SPREAD_BLOOD, DISEASE_SPREAD_AIRBORNE))
permeability_mod = max(CEILING(0.4 * properties["transmittable"], 1), 1)
cure_chance = 15 - CLAMP(properties["resistance"], -5, 5) // can be between 10 and 20
cure_chance = 15 - clamp(properties["resistance"], -5, 5) // can be between 10 and 20
stage_prob = max(properties["stage_rate"], 2)
SetSeverity(properties["severity"])
GenerateCure(properties)
@@ -304,7 +304,7 @@
// Will generate a random cure, the less resistance the symptoms have, the harder the cure.
/datum/disease/advance/proc/GenerateCure()
if(properties && properties.len)
var/res = CLAMP(properties["resistance"] - (symptoms.len / 2), 1, advance_cures.len)
var/res = clamp(properties["resistance"] - (symptoms.len / 2), 1, advance_cures.len)
if(res == oldres)
return
cures = list(pick(advance_cures[res]))
+1 -1
View File
@@ -9,7 +9,7 @@
viable_mobtypes = list(/mob/living/carbon/human)
disease_flags = CAN_CARRY|CAN_RESIST|CURABLE
permeability_mod = 0.75
desc = "Some speculate that this virus is the cause of the Space Wizard Federation's existence. Subjects affected show the signs of mental retardation, yelling obscure sentences or total gibberish. On late stages subjects sometime express the feelings of inner power, and, cite, 'the ability to control the forces of cosmos themselves!' A gulp of strong, manly spirits usually reverts them to normal, humanlike, condition."
desc = "Some speculate that this virus is the cause of the Space Wizard Federation's existence. Subjects affected show the signs of mental hysteria, yelling obscure sentences or total gibberish. On late stages subjects sometime express the feelings of inner power, and, cite, 'the ability to control the forces of cosmos themselves!' A gulp of strong, manly spirits usually reverts them to normal, humanlike, condition."
severity = DISEASE_SEVERITY_HARMFUL
required_organs = list(/obj/item/bodypart/head)
+27 -6
View File
@@ -17,6 +17,7 @@
var/mutation_index[DNA_MUTATION_BLOCKS] //List of which mutations this carbon has and its assigned block
var/stability = 100
var/scrambled = FALSE //Did we take something like mutagen? In that case we cant get our genes scanned to instantly cheese all the powers.
var/skin_tone_override //because custom skin tones are not found in the skin_tones global list.
/datum/dna/New(mob/living/new_holder)
if(istype(new_holder))
@@ -41,9 +42,11 @@
/datum/dna/proc/transfer_identity(mob/living/carbon/destination, transfer_SE = 0)
if(!istype(destination))
return
var/old_size = destination.dna.features["body_size"]
destination.dna.unique_enzymes = unique_enzymes
destination.dna.uni_identity = uni_identity
destination.dna.blood_type = blood_type
destination.dna.skin_tone_override = skin_tone_override
destination.set_species(species.type, icon_update=0)
destination.dna.features = features.Copy()
destination.dna.real_name = real_name
@@ -56,6 +59,8 @@
if(transfer_SE)
destination.dna.mutation_index = mutation_index
destination.dna.update_body_size(old_size)
SEND_SIGNAL(destination, COMSIG_CARBON_IDENTITY_TRANSFERRED_TO, src, transfer_SE)
/datum/dna/proc/copy_dna(datum/dna/new_dna)
@@ -63,6 +68,7 @@
new_dna.mutation_index = mutation_index
new_dna.uni_identity = uni_identity
new_dna.blood_type = blood_type
new_dna.skin_tone_override = skin_tone_override
new_dna.features = features.Copy()
new_dna.species = new species.type
new_dna.real_name = real_name
@@ -259,10 +265,11 @@
return
/datum/dna/proc/is_same_as(datum/dna/D)
if(uni_identity == D.uni_identity && mutation_index == D.mutation_index && real_name == D.real_name && nameless == D.nameless && custom_species == D.custom_species)
if(species.type == D.species.type && features == D.features && blood_type == D.blood_type)
return 1
return 0
if(uni_identity != D.uni_identity || mutation_index != D.mutation_index || real_name != D.real_name || nameless != D.nameless || custom_species != D.custom_species)
return FALSE
if(species.type != D.species.type || features != D.features || blood_type != D.blood_type || skin_tone_override != D.skin_tone_override)
return FALSE
return TRUE
/datum/dna/proc/update_instability(alert=TRUE)
stability = 100
@@ -302,7 +309,7 @@
unique_enzymes = generate_unique_enzymes()
uni_identity = generate_uni_identity()
generate_dna_blocks()
features = random_features(species?.id)
features = random_features(species?.id, holder?.gender)
/datum/dna/stored //subtype used by brain mob's stored_dna
@@ -368,7 +375,9 @@
/mob/living/carbon/human/proc/hardset_dna(ui, list/mutation_index, newreal_name, newblood_type, datum/species/mrace, newfeatures)
if(newfeatures)
var/old_size = dna.features["body_size"]
dna.features = newfeatures
dna.update_body_size(old_size)
if(mrace)
var/datum/species/newrace = new mrace.type
@@ -425,7 +434,7 @@
var/structure = dna.uni_identity
hair_color = sanitize_hexcolor(getblock(structure, DNA_HAIR_COLOR_BLOCK))
facial_hair_color = sanitize_hexcolor(getblock(structure, DNA_FACIAL_HAIR_COLOR_BLOCK))
skin_tone = GLOB.skin_tones[deconstruct_block(getblock(structure, DNA_SKIN_TONE_BLOCK), GLOB.skin_tones.len)]
skin_tone = dna.skin_tone_override || GLOB.skin_tones[deconstruct_block(getblock(structure, DNA_SKIN_TONE_BLOCK), GLOB.skin_tones.len)]
eye_color = sanitize_hexcolor(getblock(structure, DNA_EYE_COLOR_BLOCK))
facial_hair_style = GLOB.facial_hair_styles_list[deconstruct_block(getblock(structure, DNA_FACIAL_HAIR_STYLE_BLOCK), GLOB.facial_hair_styles_list.len)]
hair_style = GLOB.hair_styles_list[deconstruct_block(getblock(structure, DNA_HAIR_STYLE_BLOCK), GLOB.hair_styles_list.len)]
@@ -644,3 +653,15 @@
gib()
else
set_species(/datum/species/dullahan)
/datum/dna/proc/update_body_size(old_size)
if(!holder || features["body_size"] == old_size)
return
holder.resize = features["body_size"] / old_size
holder.update_transform()
var/danger = CONFIG_GET(number/threshold_body_size_slowdown)
if(features["body_size"] < danger)
var/slowdown = 1 + round(danger/features["body_size"], 0.1) * CONFIG_GET(number/body_size_slowdown_multiplier)
holder.add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/small_stride, TRUE, slowdown)
else if(old_size < danger)
holder.remove_movespeed_modifier(/datum/movespeed_modifier/small_stride)
+1 -1
View File
@@ -1,6 +1,6 @@
/datum/element/cleaning/Attach(datum/target)
. = ..()
if(!ismovableatom(target))
if(!ismovable(target))
return ELEMENT_INCOMPATIBLE
RegisterSignal(target, COMSIG_MOVABLE_MOVED, .proc/Clean)
+1 -1
View File
@@ -10,7 +10,7 @@
/datum/element/firestacker/Attach(datum/target, amount)
. = ..()
if(!ismovableatom(target))
if(!ismovable(target))
return ELEMENT_INCOMPATIBLE
src.amount = amount
+17 -36
View File
@@ -1,67 +1,48 @@
GLOBAL_LIST_EMPTY(ghost_eligible_mobs)
GLOBAL_LIST_EMPTY(client_ghost_timeouts)
/datum/element/ghost_role_eligibility
element_flags = ELEMENT_DETACH | ELEMENT_BESPOKE
id_arg_index = 3
var/list/timeouts = list()
var/list/mob/eligible_mobs = list()
id_arg_index = 2
var/penalizing = FALSE
var/free_ghost = FALSE
/datum/element/ghost_role_eligibility/Attach(datum/target,penalize = FALSE,free_ghosting = FALSE, penalize_on_ghost = FALSE)
/datum/element/ghost_role_eligibility/Attach(datum/target,free_ghosting = FALSE, penalize_on_ghost = FALSE)
. = ..()
if(!ismob(target))
return ELEMENT_INCOMPATIBLE
penalizing = penalize_on_ghost
free_ghost = free_ghosting
var/mob/M = target
if(!(M in eligible_mobs))
eligible_mobs += M
if(!(M in GLOB.ghost_eligible_mobs))
GLOB.ghost_eligible_mobs += M
RegisterSignal(M, COMSIG_MOB_GHOSTIZE, .proc/get_ghost_flags)
if(penalize) //penalizing them from making a ghost role / midround antag comeback right away.
var/penalty = CONFIG_GET(number/suicide_reenter_round_timer) MINUTES
var/roundstart_quit_limit = CONFIG_GET(number/roundstart_suicide_time_limit) MINUTES
if(world.time < roundstart_quit_limit) //add up the time difference to their antag rolling penalty if they quit before half a (ingame) hour even passed.
penalty += roundstart_quit_limit - world.time
if(penalty)
penalty += world.realtime
if(SSautotransfer.can_fire && SSautotransfer.maxvotes)
var/maximumRoundEnd = SSautotransfer.starttime + SSautotransfer.voteinterval * SSautotransfer.maxvotes
if(penalty - SSshuttle.realtimeofstart > maximumRoundEnd + SSshuttle.emergencyCallTime + SSshuttle.emergencyDockTime + SSshuttle.emergencyEscapeTime)
penalty = CANT_REENTER_ROUND
if(!(M.ckey in timeouts))
timeouts += M.ckey
timeouts[M.ckey] = 0
else if(timeouts[M.ckey] == CANT_REENTER_ROUND)
return
timeouts[M.ckey] = max(timeouts[M.ckey],penalty)
/datum/element/ghost_role_eligibility/Detach(mob/M)
. = ..()
if(M in eligible_mobs)
eligible_mobs -= M
if(M in GLOB.ghost_eligible_mobs)
GLOB.ghost_eligible_mobs -= M
UnregisterSignal(M, COMSIG_MOB_GHOSTIZE)
/datum/element/ghost_role_eligibility/proc/get_all_ghost_role_eligible(silent = FALSE)
/proc/get_all_ghost_role_eligible(silent = FALSE)
var/list/candidates = list()
for(var/m in eligible_mobs)
for(var/m in GLOB.ghost_eligible_mobs)
var/mob/M = m
if(M.can_reenter_round(TRUE))
candidates += M
return candidates
/mob/proc/can_reenter_round(silent = FALSE)
var/datum/element/ghost_role_eligibility/eli = SSdcs.GetElement(list(/datum/element/ghost_role_eligibility))
return eli.can_reenter_round(src,silent)
/datum/element/ghost_role_eligibility/proc/can_reenter_round(var/mob/M,silent = FALSE)
if(!(M in eligible_mobs))
if(!(src in GLOB.ghost_eligible_mobs))
return FALSE
if(!(M.ckey in timeouts))
if(!(ckey in GLOB.client_ghost_timeouts))
return TRUE
var/timeout = timeouts[M.ckey]
var/timeout = GLOB.client_ghost_timeouts[ckey]
if(timeout != CANT_REENTER_ROUND && timeout <= world.realtime)
return TRUE
if(!silent && M.client)
to_chat(M, "<span class='warning'>You are unable to reenter the round[timeout != CANT_REENTER_ROUND ? " yet. Your ghost role blacklist will expire in [DisplayTimeText(timeout - world.realtime)]" : ""].</span>")
if(!silent && client)
to_chat(src, "<span class='warning'>You are unable to reenter the round[timeout != CANT_REENTER_ROUND ? " yet. Your ghost role blacklist will expire in [DisplayTimeText(timeout - world.realtime)]" : ""].</span>")
return FALSE
/datum/element/ghost_role_eligibility/proc/get_ghost_flags()
+3 -3
View File
@@ -71,7 +71,7 @@
name = "bugged mob"
desc = "Yell at coderbrush."
icon = null
alternate_worn_icon = 'icons/mob/animals_held.dmi'
mob_overlay_icon = 'icons/mob/animals_held.dmi'
righthand_file = 'icons/mob/animals_held_rh.dmi'
lefthand_file = 'icons/mob/animals_held_lh.dmi'
icon_state = ""
@@ -86,7 +86,7 @@
assimilate(target)
if(alt_worn)
alternate_worn_icon = alt_worn
mob_overlay_icon = alt_worn
if(worn_state)
item_state = worn_state
icon_state = worn_state
@@ -164,7 +164,7 @@
release()
/obj/item/clothing/head/mob_holder/mob_can_equip(mob/living/M, mob/living/equipper, slot, disable_warning = FALSE, bypass_equip_delay_self = FALSE)
if(!ishuman(M)) //monkeys holding monkeys holding monkeys...
if(M == held_mob || !ishuman(M)) //monkeys holding monkeys holding monkeys...
return FALSE
return ..()
+187
View File
@@ -0,0 +1,187 @@
#define POLYCHROMIC_ALTCLICK (1<<0)
#define POLYCHROMIC_ACTION (1<<1)
#define POLYCHROMIC_NO_HELD (1<<2)
#define POLYCHROMIC_NO_WORN (1<<3)
/datum/element/polychromic
element_flags = ELEMENT_BESPOKE|ELEMENT_DETACH
id_arg_index = 3
var/overlays_states //A list or a number of states. In the latter case, the atom icon_state/item_state will be used followed by a number.
var/list/colors_by_atom = list() //list of color strings or mutable appearances, depending on the above variable.
var/icon_file
var/worn_file //used in place of items' held or mob overlay icons if present.
var/list/overlays_names //wrap numbers into text strings please.
var/list/actions_by_atom = list()
var/poly_flags
var/static/list/suits_with_helmet_typecache = typecacheof(list(/obj/item/clothing/suit/hooded, /obj/item/clothing/suit/space/hardsuit))
var/list/helmet_by_suit = list() //because poly winter coats exist.
var/list/suit_by_helmet = list() //Idem.
/datum/element/polychromic/Attach(datum/target, list/colors, states, _flags = POLYCHROMIC_ACTION|POLYCHROMIC_NO_HELD, _icon, _worn, list/names = list("Primary", "Secondary", "Tertiary", "Quaternary", "Quinary", "Senary"))
. = ..()
var/make_appearances = islist(states)
var/states_len = make_appearances ? length(states) : states
var/names_len = length(names)
if(!states_len || !names_len || colors_by_atom[target] || !isatom(target))
return ELEMENT_INCOMPATIBLE
var/atom/A = target
overlays_states = states
icon_file = _icon
worn_file = _worn
poly_flags = _flags
var/mut_icon = icon_file || A.icon
var/list/L = list()
for(var/I in 1 to states_len)
var/col = LAZYACCESS(colors, I) || "#FFFFFF"
L += make_appearances ? mutable_appearance(mut_icon, overlays_states[I], color = col) : col
colors_by_atom[A] = L
RegisterSignal(A, COMSIG_ATOM_UPDATE_OVERLAYS, .proc/apply_overlays)
if(_flags & POLYCHROMIC_ALTCLICK)
RegisterSignal(A, COMSIG_PARENT_EXAMINE, .proc/on_examine)
RegisterSignal(A, COMSIG_CLICK_ALT, .proc/set_color)
if(!overlays_names && names) //generate
overlays_names = names
var/diff = states_len - names_len
if(diff > 0)
for(var/i in 1 to diff)
overlays_names += "[names_len + i]°"
else if(diff < 0)
overlays_names.len += diff
if(isitem(A))
if(_flags & POLYCHROMIC_ACTION)
RegisterSignal(A, COMSIG_ITEM_EQUIPPED, .proc/grant_user_action)
RegisterSignal(A, COMSIG_ITEM_DROPPED, .proc/remove_user_action)
if(!(_flags & POLYCHROMIC_NO_WORN) || !(_flags & POLYCHROMIC_NO_HELD))
A.AddElement(/datum/element/update_icon_updates_onmob)
RegisterSignal(A, COMSIG_ITEM_WORN_OVERLAYS, .proc/apply_worn_overlays)
if(suits_with_helmet_typecache[A.type])
RegisterSignal(A, COMSIG_SUIT_MADE_HELMET, .proc/register_helmet)
else if(_flags & POLYCHROMIC_ACTION && ismob(A)) //in the event mob update icon procs are ever standarized.
var/datum/action/polychromic/P = new(A)
RegisterSignal(P, COMSIG_ACTION_TRIGGER, .proc/activate_action)
actions_by_atom[A] = P
P.Grant(A)
A.update_icon() //apply the overlays.
/datum/element/polychromic/Detach(atom/A)
. = ..()
colors_by_atom -= A
var/datum/action/polychromic/P = actions_by_atom[A]
if(P)
actions_by_atom -= A
qdel(P)
UnregisterSignal(A, list(COMSIG_PARENT_EXAMINE, COMSIG_CLICK_ALT, COMSIG_ATOM_UPDATE_OVERLAYS, COMSIG_ITEM_EQUIPPED, COMSIG_ITEM_DROPPED, COMSIG_ITEM_WORN_OVERLAYS, COMSIG_SUIT_MADE_HELMET))
if(isitem(A))
var/obj/item/clothing/head/H = helmet_by_suit[A]
if(H)
UnregisterSignal(H, list(COMSIG_ATOM_UPDATE_OVERLAYS, COMSIG_ITEM_WORN_OVERLAYS, COMSIG_PARENT_QDELETING))
helmet_by_suit -= A
suit_by_helmet -= H
colors_by_atom -= H
if(!QDELETED(H))
H.update_icon() //removing the overlays
if(!(poly_flags & POLYCHROMIC_NO_WORN) || !(poly_flags & POLYCHROMIC_NO_HELD))
A.RemoveElement(/datum/element/update_icon_updates_onmob)
if(!QDELETED(A) && ismob(A.loc))
var/mob/M = A.loc
if(!(poly_flags & POLYCHROMIC_NO_HELD) && M.is_holding(A))
M.update_inv_hands()
else if(!(poly_flags & POLYCHROMIC_NO_WORN))
M.regenerate_icons()
if(!QDELETED(A))
A.update_icon() //removing the overlays
/datum/element/polychromic/proc/apply_overlays(atom/source, list/overlays)
var/list/L = colors_by_atom[source]
var/f_icon = icon_file || source.icon
if(isnum(overlays_states))
for(var/i in 1 to overlays_states)
overlays += mutable_appearance(f_icon, "[source.icon_state]-[i]", color = L[i])
else
overlays += colors_by_atom[source]
/datum/element/polychromic/proc/apply_worn_overlays(obj/item/source, isinhands, icon, used_state, style_flags, list/overlays)
if(poly_flags & (isinhands ? POLYCHROMIC_NO_HELD : POLYCHROMIC_NO_WORN))
return
var/f_icon = worn_file || icon
var/list/L = colors_by_atom[source]
if(isnum(overlays_states))
for(var/i in 1 to overlays_states)
overlays += mutable_appearance(f_icon, "[used_state]-[i]", color = L[i])
else
for(var/i in 1 to length(overlays_states))
var/mutable_appearance/M = L[i]
overlays += mutable_appearance(f_icon, overlays_states[i], color = M.color)
/datum/element/polychromic/proc/set_color(atom/source, mob/user)
var/choice = input(user,"Polychromic options", "Recolor [source]") as null|anything in overlays_names
if(!choice || QDELETED(source) || !user.canUseTopic(source, BE_CLOSE, NO_DEXTERY))
return
var/index = overlays_names.Find(choice)
var/list/L = colors_by_atom[source]
if(!L) // Ummmmmh.
return
var/mutable_appearance/M = L[index]
var/old_color = istype(M) ? M.color : M
var/ncolor = input(user, "Polychromic options", "Choose [choice] Color", old_color) as color|null
if(!ncolor || QDELETED(source) || !colors_by_atom[source] || !user.canUseTopic(source, BE_CLOSE, NO_DEXTERY))
return
ncolor = sanitize_hexcolor(ncolor, 6, TRUE, old_color)
if(istype(M))
M.color = ncolor
else
L[index] = ncolor
source.update_icon()
return TRUE
/datum/element/polychromic/proc/grant_user_action(atom/source, mob/user, slot)
if(slot == SLOT_IN_BACKPACK || slot == SLOT_LEGCUFFED || slot == SLOT_HANDCUFFED || slot == SLOT_GENERC_DEXTROUS_STORAGE)
return
var/datum/action/polychromic/P = actions_by_atom[source]
if(!P)
P = new (source)
P.name = "Modify [source]'\s Colors"
actions_by_atom[source] = P
P.check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUN|AB_CHECK_CONSCIOUS
RegisterSignal(P, COMSIG_ACTION_TRIGGER, .proc/activate_action)
P.Grant(user)
/datum/element/polychromic/proc/remove_user_action(atom/source, mob/user)
var/datum/action/polychromic/P = actions_by_atom[source]
P?.Remove(user)
/datum/element/polychromic/proc/activate_action(datum/action/source, atom/target)
set_color(target, source.owner)
/datum/element/polychromic/proc/on_examine(atom/source, mob/user, list/examine_list)
examine_list += "<span class='notice'>Alt-click to recolor it.</span>"
/datum/element/polychromic/proc/register_helmet(atom/source, obj/item/clothing/head/H)
suit_by_helmet[H] = source
helmet_by_suit[source] = H
colors_by_atom[H] = colors_by_atom[source]
RegisterSignal(H, COMSIG_ATOM_UPDATE_OVERLAYS, .proc/apply_overlays)
RegisterSignal(H, COMSIG_ITEM_WORN_OVERLAYS, .proc/apply_worn_overlays)
RegisterSignal(H, COMSIG_PARENT_QDELETING, .proc/unregister_helmet)
/datum/element/polychromic/proc/unregister_helmet(atom/source)
var/obj/item/clothing/suit/S = suit_by_helmet[source]
suit_by_helmet -= source
helmet_by_suit -= S
colors_by_atom -= source
/datum/action/polychromic
name = "Modify Polychromic Colors"
background_icon_state = "bg_polychromic"
use_target_appearance = TRUE
button_icon_state = null
target_appearance_matrix = list(0.8,0,0,0,0.8,0)
+215
View File
@@ -0,0 +1,215 @@
/*
* Scavenging element. Its scope shouldn't elude your imagination.
* Basically loot piles that can be searched through for some items.
* In my opinion, these are more engaging than normal maintenance loot spawners.
* The loot doesn't have to be strictly made of items and objects, you could also use it to invoke some "events"
* such as mice, rats, an halloween spook, persistent relics, traps, etcetera, go wild.
*/
/datum/element/scavenging
element_flags = ELEMENT_BESPOKE|ELEMENT_DETACH
id_arg_index = 3
var/list/loot_left_per_atom = list() //loot left per attached atom.
var/list/loot_table //pickweight list of available loot.
var/list/unique_loot //limited loot, once the associated value reaches zero, its key is removed from loot_table
var/scavenge_time = 12 SECONDS //how much time it takes
var/can_use_hands = TRUE //bare handed scavenge time multiplier. If set to zero, only tools are usable.
var/list/tool_types //which tool types the player can use instead of scavenging by hand, associated value is their speed.
var/del_atom_on_depletion = FALSE //Will the atom be deleted when there is no loot left?
var/list/search_texts = list("starts searching through", "start searching through", "You hear rummaging...")
var/loot_restriction = NO_LOOT_RESTRICTION
var/maximum_loot_per_player = 1 //only relevant if there is a restriction.
var/list/scavenger_restriction_list //used for restrictions.
var/mean_loot_weight = 0
var/list/progress_per_atom = list() //seconds of ditched progress per atom, used to resume the work instead of starting over.
var/static/list/players_busy_scavenging = list() //players already busy scavenging.
/datum/element/scavenging/Attach(atom/target, amount = 5, list/loot, list/unique, time = 12 SECONDS, hands = TRUE, list/tools, list/texts, \
del_deplete = FALSE, restriction = NO_LOOT_RESTRICTION, max_per_player = 1)
. = ..()
if(. == ELEMENT_INCOMPATIBLE || !length(loot) || !amount || !istype(target) || isarea(target))
return ELEMENT_INCOMPATIBLE
loot_left_per_atom[target] = amount
if(!loot_table)
loot_table = loot
for(var/A in loot_table) //tally the list weights
mean_loot_weight += loot_table[A]
mean_loot_weight /= length(loot_table)
if(!unique_loot)
unique_loot = unique || list()
scavenge_time = time
can_use_hands = hands
tool_types = tools
if(texts)
search_texts = texts
del_atom_on_depletion = del_deplete
loot_restriction = restriction
maximum_loot_per_player = max_per_player
if(can_use_hands)
RegisterSignal(target, list(COMSIG_ATOM_ATTACK_HAND, COMSIG_ATOM_ATTACK_PAW), .proc/scavenge_barehanded)
if(tool_types)
RegisterSignal(target, COMSIG_PARENT_ATTACKBY, .proc/scavenge_tool)
RegisterSignal(target, COMSIG_PARENT_EXAMINE, .proc/on_examine)
/datum/element/scavenging/Detach(atom/target)
. = ..()
loot_left_per_atom -= target
progress_per_atom -= target
if(maximum_loot_per_player == LOOT_RESTRICTION_MIND_PILE || maximum_loot_per_player == LOOT_RESTRICTION_CKEY_PILE)
maximum_loot_per_player -= target
UnregisterSignal(target, list(COMSIG_ATOM_ATTACK_HAND, COMSIG_PARENT_ATTACKBY, COMSIG_PARENT_EXAMINE))
/datum/element/scavenging/proc/on_examine(atom/source, mob/user, list/examine_list)
var/methods = tool_types.Copy()
if(can_use_hands)
methods += list("bare handed")
if(!length(methods))
return
var/text = english_list(methods, "", " or ")
examine_list += "<span class='notice'>Looks like [source.p_they()] can be scavenged [length(tool_types) ? "with" : ""][length(methods == 1) ? "" : "either "][length(tool_types) ? "a " : ""][text]</span>"
/datum/element/scavenging/proc/scavenge_barehanded(atom/source, mob/user)
scavenge(source, user, 1)
return COMPONENT_NO_ATTACK_HAND
/datum/element/scavenging/proc/scavenge_tool(atom/source, obj/item/I, mob/user, params)
if(user.a_intent == INTENT_HARM || !I.tool_behaviour) //Robust trash disposal techniques!
return
var/speed_multi = tool_types[I.tool_behaviour]
if(!speed_multi)
return
scavenge(source, user, speed_multi)
return COMPONENT_NO_AFTERATTACK
/// This proc has to be asynced (cough cough, do_after) in order to return the comsig values in time to stop the attack chain.
/datum/element/scavenging/proc/scavenge(atom/source, mob/user, speed_multi = 1)
set waitfor = FALSE
if(players_busy_scavenging[user])
return
players_busy_scavenging[user] = TRUE
var/progress_done = progress_per_atom[source]
var/len_messages = length(search_texts)
var/msg_first_person
if(len_messages >= 2)
msg_first_person = "<span class='notice'>You [progress_done ? ", resume a ditched task and " : ""][search_texts[2]] [source].</span>"
var/msg_blind
if(len_messages >= 3)
msg_blind = "<span class='italic'>[search_texts[3]]</span>"
user.visible_message("<span class='notice'>[user] [search_texts[1]] [source].</span>", msg_first_person, msg_blind)
if(do_after(user, scavenge_time * speed_multi, TRUE, source, TRUE, CALLBACK(src, .proc/set_progress, source, world.time), resume_time = progress_done * speed_multi))
spawn_loot(source, user)
players_busy_scavenging -= user
/datum/element/scavenging/proc/set_progress(atom/source, start_time)
progress_per_atom[source] = world.time - start_time
return TRUE
/datum/element/scavenging/proc/spawn_loot(atom/source, mob/user)
progress_per_atom -= source
var/loot = pickweight(loot_table)
var/special = TRUE
var/free = FALSE
if(!loot_left_per_atom[source])
to_chat(user, "<span class='warning'>Looks likes there is nothing worth of interest left in [source], what a shame...</span>")
return
var/num_times = 0
switch(loot_restriction)
if(LOOT_RESTRICTION_MIND)
num_times = LAZYACCESS(scavenger_restriction_list, user.mind)
if(LOOT_RESTRICTION_CKEY)
num_times = LAZYACCESS(scavenger_restriction_list, user.ckey)
if(LOOT_RESTRICTION_MIND_PILE)
var/list/L = LAZYACCESS(scavenger_restriction_list, source)
if(L)
num_times = LAZYACCESS(L, user.mind)
if(LOOT_RESTRICTION_CKEY_PILE)
var/list/L = LAZYACCESS(scavenger_restriction_list, source)
if(L)
num_times = LAZYACCESS(L, user.ckey)
if(num_times >= maximum_loot_per_player)
to_chat(user, "<span class='warning'>You can't find anything else vaguely useful in [source]. Another set of eyes might, however.</span>")
return
switch(loot) // TODO: datumize these out.
if(SCAVENGING_FOUND_NOTHING)
to_chat(user, "<span class='notice'>You found nothing, better luck next time.</span>")
free = TRUE //doesn't consume the loot pile.
if(SCAVENGING_SPAWN_MOUSE)
var/nasty_rodent = pick("mouse", "rodent", "squeaky critter", "stupid pest", "annoying cable chewer", "nasty, ugly, evil, disease-ridden rodent")
to_chat(user, "<span class='notice'>You found something in [source]... no wait, that's just another [nasty_rodent].</span>")
new /mob/living/simple_animal/mouse(source.loc)
if(SCAVENGING_SPAWN_MICE)
user.visible_message("<span class='notice'>A small gang of mice emerges from [source].</span>", \
"<span class='notice'>You found something in [source]... no wait, that's just another- <b>no wait, that's a lot of damn mice.</b></span>")
for(var/i in 1 to rand(4, 6))
new /mob/living/simple_animal/mouse(source.loc)
if(SCAVENGING_SPAWN_TOM)
if(GLOB.tom_existed) //There can only be one.
to_chat(user, "<span class='notice'>You found nothing, better luck next time.</span>")
free = TRUE
else
to_chat(user, "<span class='notice'>You found something in [source]... no wait, that's Tom, the mouse! What is he doing here?</span>")
new /mob/living/simple_animal/mouse/brown/Tom(source.loc)
else
special = FALSE
if(!special) //generic loot. Nothing too strange like more loot spawners anyway.
var/atom/A = new loot(source.loc)
if(isitem(A) && !user.get_active_held_item())
user.put_in_hands(A)
var/rarity_append = "."
switch(loot_table[loot]/mean_loot_weight*100)
if(0 to 1)
rarity_append = "! <b>AMAZING!</b>"
if(1 to 2)
rarity_append = "! Woah!"
if(2 to 5)
rarity_append = ". Rare!"
if(5 to 10)
rarity_append = ". Great."
if(10 to 25)
rarity_append = ". Nice."
if(20 to 50)
rarity_append = ". Not bad."
to_chat(user, "You found something in [source]... it's \a [A][rarity_append]")
if(unique_loot[loot])
var/loot_left = --unique_loot[loot]
if(!loot_left)
loot_table -= loot
unique_loot -= loot
mean_loot_weight = 0
for(var/A in loot_table) //re-tally the list weights
mean_loot_weight += loot_table[A]
mean_loot_weight /= length(loot_table)
if(free)
return
--loot_left_per_atom[source]
if(del_atom_on_depletion && !loot_left_per_atom[source])
source.visible_message("<span class='warning'>[source] has been looted clean.</span>")
qdel(source)
return
if(!loot_restriction)
return
LAZYINITLIST(scavenger_restriction_list)
switch(loot_restriction)
if(LOOT_RESTRICTION_MIND)
scavenger_restriction_list[user.mind]++
if(LOOT_RESTRICTION_CKEY)
scavenger_restriction_list[user.ckey]++
if(LOOT_RESTRICTION_MIND_PILE)
LAZYINITLIST(scavenger_restriction_list[source])
var/list/L = scavenger_restriction_list[source]
L[user.mind]++
if(LOOT_RESTRICTION_CKEY_PILE)
LAZYINITLIST(scavenger_restriction_list[source])
var/list/L = scavenger_restriction_list[source]
L[user.ckey]++
+6 -6
View File
@@ -12,7 +12,7 @@
RegisterSignal(target, COMSIG_ITEM_EQUIPPED, .proc/on_equip)
RegisterSignal(target, COMSIG_ITEM_DROPPED, .proc/on_drop)
else if(ismob(target))
RegisterSignal(target, COMSIG_MOB_SPELL_CAST_CHECK, .proc/on_cast)
RegisterSignal(target, COMSIG_MOB_SPELL_CAN_CAST, .proc/on_cast)
stacked_spellcasting_by_user[target]++
else
return ELEMENT_INCOMPATIBLE
@@ -21,24 +21,24 @@
/datum/element/spellcasting/Detach(datum/target)
. = ..()
UnregisterSignal(target, list(COMSIG_ITEM_EQUIPPED, COMSIG_ITEM_DROPPED, COMSIG_MOB_SPELL_CAST_CHECK))
UnregisterSignal(target, list(COMSIG_ITEM_EQUIPPED, COMSIG_ITEM_DROPPED, COMSIG_MOB_SPELL_CAN_CAST))
if(users_by_item[target])
var/mob/user = users_by_item[target]
stacked_spellcasting_by_user[user]--
if(!stacked_spellcasting_by_user[user])
stacked_spellcasting_by_user -= user
UnregisterSignal(user, COMSIG_MOB_SPELL_CAST_CHECK)
UnregisterSignal(user, COMSIG_MOB_SPELL_CAN_CAST)
else if(ismob(target))
stacked_spellcasting_by_user[target]--
if(!stacked_spellcasting_by_user[target])
stacked_spellcasting_by_user -= target
/datum/element/spellcasting/proc/on_equip(datum/source, mob/equipper, slot)
if(!(slot in cast_slots))
if(!(cast_slots & slotdefine2slotbit(slot)))
return
users_by_item[source] = equipper
if(!stacked_spellcasting_by_user[equipper])
RegisterSignal(equipper, COMSIG_MOB_SPELL_CAST_CHECK, .proc/on_cast)
RegisterSignal(equipper, COMSIG_MOB_SPELL_CAN_CAST, .proc/on_cast)
stacked_spellcasting_by_user[equipper]++
/datum/element/spellcasting/proc/on_drop(datum/source, mob/user)
@@ -48,7 +48,7 @@
stacked_spellcasting_by_user[user]--
if(!stacked_spellcasting_by_user[user])
stacked_spellcasting_by_user -= user
UnregisterSignal(user, COMSIG_MOB_SPELL_CAST_CHECK)
UnregisterSignal(user, COMSIG_MOB_SPELL_CAN_CAST)
/datum/element/spellcasting/proc/on_cast(mob/caster, obj/effect/proc_holder/spell)
return cast_flags
+28
View File
@@ -0,0 +1,28 @@
#define SHORT 5/7
#define TALL 7/5
/datum/element/squish
element_flags = ELEMENT_DETACH
/datum/element/squish/Attach(datum/target, duration)
. = ..()
if(!iscarbon(target))
return ELEMENT_INCOMPATIBLE
var/mob/living/carbon/C = target
var/was_lying = (C.lying != 0)
addtimer(CALLBACK(src, .proc/Detach, C, was_lying), duration)
C.transform = C.transform.Scale(TALL, SHORT)
/datum/element/squish/Detach(mob/living/carbon/C, was_lying)
. = ..()
if(istype(C))
var/is_lying = (C.lying != 0)
if(was_lying == is_lying)
C.transform = C.transform.Scale(SHORT, TALL)
else
C.transform = C.transform.Scale(TALL, SHORT)
#undef SHORT
#undef TALL
@@ -5,7 +5,7 @@
. = ..()
if(!istype(target, /obj/item))
return ELEMENT_INCOMPATIBLE
RegisterSignal(target, COMSIG_ATOM_UPDATED_ICON, .proc/update_onmob)
RegisterSignal(target, COMSIG_ATOM_UPDATED_ICON, .proc/update_onmob, override = TRUE)
/datum/element/update_icon_updates_onmob/proc/update_onmob(obj/item/target)
if(ismob(target.loc))
+3 -3
View File
@@ -121,14 +121,14 @@ GLOBAL_LIST_EMPTY(explosions)
if(dist <= round(max_range + world.view - 2, 1))
M.playsound_local(epicenter, null, 100, 1, frequency, falloff = 5, S = explosion_sound)
if(baseshakeamount > 0)
shake_camera(M, 25, CLAMP(baseshakeamount, 0, 10))
shake_camera(M, 25, clamp(baseshakeamount, 0, 10))
// You hear a far explosion if you're outside the blast radius. Small bombs shouldn't be heard all over the station.
else if(dist <= far_dist)
var/far_volume = CLAMP(far_dist, 30, 50) // Volume is based on explosion size and dist
var/far_volume = clamp(far_dist, 30, 50) // Volume is based on explosion size and dist
far_volume += (dist <= far_dist * 0.5 ? 50 : 0) // add 50 volume if the mob is pretty close to the explosion
M.playsound_local(epicenter, null, far_volume, 1, frequency, falloff = 5, S = far_explosion_sound)
if(baseshakeamount > 0)
shake_camera(M, 10, CLAMP(baseshakeamount*0.25, 0, 2.5))
shake_camera(M, 10, clamp(baseshakeamount*0.25, 0, 2.5))
EX_PREPROCESS_CHECK_TICK
//postpone processing for a bit
+1 -1
View File
@@ -128,7 +128,7 @@
// Can most things breathe?
if(trace_gases)
continue
if(A_gases[/datum/gas/oxygen] >= 16)
if(A_gases[/datum/gas/oxygen] <= 16)
continue
if(A_gases[/datum/gas/plasma])
continue
+15
View File
@@ -14,6 +14,7 @@
var/can_martial_parry = FALSE
/// Set this variable to something not null, this'll be the preferred unarmed parry in most cases if [can_martial_parry] is TRUE. YOU MUST RUN [get_block_parry_data(this)] INSTEAD OF DIRECTLY ACCESSING!
var/datum/block_parry_data/block_parry_data
var/pugilist = FALSE
/datum/martial_art/proc/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
return FALSE
@@ -39,6 +40,17 @@
current_target = new_target
streak = ""
/datum/martial_art/proc/damage_roll(mob/living/carbon/human/A, mob/living/carbon/human/D)
//Here we roll for our damage to be added into the damage var in the various attack procs. This is changed depending on whether we are in combat mode, lying down, or if our target is in combat mode.
var/damage = rand(A.dna.species.punchdamagelow, A.dna.species.punchdamagehigh)
if(!(D.combat_flags & COMBAT_FLAG_COMBAT_ACTIVE))
damage *= 1.5
if(!CHECK_MOBILITY(A, MOBILITY_STAND))
damage *= 0.5
if(!(A.combat_flags & COMBAT_FLAG_COMBAT_ACTIVE))
damage *= 0.25
return damage
/datum/martial_art/proc/teach(mob/living/carbon/human/H, make_temporary = FALSE)
if(!istype(H) || !H.mind)
return FALSE
@@ -54,6 +66,8 @@
if(help_verb)
H.verbs += help_verb
H.mind.martial_art = src
if(pugilist)
ADD_TRAIT(H, TRAIT_PUGILIST, MARTIAL_ARTIST_TRAIT)
return TRUE
/datum/martial_art/proc/store(datum/martial_art/M,mob/living/carbon/human/H)
@@ -72,6 +86,7 @@
else
var/datum/martial_art/X = H.mind.default_martial_art
X.teach(H)
REMOVE_TRAIT(H, TRAIT_PUGILIST, MARTIAL_ARTIST_TRAIT)
/datum/martial_art/proc/on_remove(mob/living/carbon/human/H)
if(help_verb)
+3 -5
View File
@@ -2,6 +2,7 @@
name = "Boxing"
id = MARTIALART_BOXING
pacifism_check = FALSE //Let's pretend pacifists can boxe the heck out of other people, it only deals stamina damage right now.
pugilist = TRUE
/datum/martial_art/boxing/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
to_chat(A, "<span class='warning'>Can't disarm while boxing!</span>")
@@ -16,16 +17,13 @@
A.do_attack_animation(D, ATTACK_EFFECT_PUNCH)
var/atk_verb = pick("left hook","right hook","straight punch")
var/damage = rand(10, 13)
var/extra_damage = rand(A.dna.species.punchdamagelow, A.dna.species.punchdamagehigh)
var/extra_damage = damage_roll(A,D)
if(extra_damage == A.dna.species.punchdamagelow)
playsound(D.loc, A.dna.species.miss_sound, 25, 1, -1)
D.visible_message("<span class='warning'>[A] has attempted to [atk_verb] [D]!</span>", \
"<span class='userdanger'>[A] has attempted to [atk_verb] [D]!</span>", null, COMBAT_MESSAGE_RANGE)
log_combat(A, D, "attempted to hit", atk_verb)
return TRUE
damage += extra_damage
var/obj/item/bodypart/affecting = D.get_bodypart(ran_zone(A.zone_selected))
var/armor_block = D.run_armor_check(affecting, "melee")
@@ -35,7 +33,7 @@
D.visible_message("<span class='danger'>[A] has [atk_verb]ed [D]!</span>", \
"<span class='userdanger'>[A] has [atk_verb]ed [D]!</span>", null, COMBAT_MESSAGE_RANGE)
D.apply_damage(damage, STAMINA, affecting, armor_block)
D.apply_damage(rand(10,13) + extra_damage, STAMINA, affecting, armor_block)
log_combat(A, D, "punched (boxing) ")
if(D.getStaminaLoss() > 100 && istype(D.mind?.martial_art, /datum/martial_art/boxing))
var/knockout_prob = (D.getStaminaLoss() + rand(-15,15))*0.75
+41 -27
View File
@@ -9,6 +9,7 @@
id = MARTIALART_CQC
help_verb = /mob/living/carbon/human/proc/CQC_help
block_chance = 75
pugilist = TRUE
var/old_grab_state = null
/datum/martial_art/cqc/reset_streak(mob/living/carbon/human/new_target)
@@ -42,11 +43,12 @@
/datum/martial_art/cqc/proc/Slam(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(!can_use(A))
return FALSE
var/damage = (damage_roll(A,D) + 5)
if(CHECK_MOBILITY(D, MOBILITY_STAND))
D.visible_message("<span class='warning'>[A] slams [D] into the ground!</span>", \
"<span class='userdanger'>[A] slams you into the ground!</span>")
playsound(get_turf(A), 'sound/weapons/slam.ogg', 50, 1, -1)
D.apply_damage(10, BRUTE)
D.apply_damage(damage, BRUTE)
D.DefaultCombatKnockdown(120)
log_combat(A, D, "slammed (CQC)")
return TRUE
@@ -54,29 +56,33 @@
/datum/martial_art/cqc/proc/Kick(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(!can_use(A))
return FALSE
if(CHECK_MOBILITY(D, MOBILITY_STAND))
D.visible_message("<span class='warning'>[A] kicks [D] back!</span>", \
"<span class='userdanger'>[A] kicks you back!</span>")
playsound(get_turf(A), 'sound/weapons/cqchit1.ogg', 50, 1, -1)
var/atom/throw_target = get_edge_target_turf(D, A.dir)
D.throw_at(throw_target, 1, 14, A)
D.apply_damage(10, BRUTE)
log_combat(A, D, "kicked (CQC)")
var/damage = damage_roll(A,D)
if(!CHECK_MOBILITY(D, MOBILITY_STAND) && CHECK_MOBILITY(D, MOBILITY_USE))
log_combat(A, D, "knocked out (Head kick)(CQC)")
D.visible_message("<span class='warning'>[A] kicks [D]'s head, knocking [D.p_them()] out!</span>", \
"<span class='userdanger'>[A] kicks your head, knocking you out!</span>")
playsound(get_turf(A), 'sound/weapons/genhit1.ogg', 50, 1, -1)
D.SetSleeping(300)
D.adjustOrganLoss(ORGAN_SLOT_BRAIN, 15, 150)
D.apply_damage(damage + 5, BRUTE)
var/atom/throw_target = get_edge_target_turf(D, A.dir)
D.throw_at(throw_target, 1, 14, A)
D.adjustOrganLoss(ORGAN_SLOT_BRAIN, damage + 10, 150)
else
D.visible_message("<span class='warning'>[A] kicks [D]!</span>", \
"<span class='userdanger'>[A] kicks you!</span>")
playsound(get_turf(A), 'sound/weapons/cqchit1.ogg', 50, 1, -1)
D.Dizzy(damage)
D.apply_damage(damage + 15, BRUTE)
log_combat(A, D, "kicked (CQC)")
return TRUE
/datum/martial_art/cqc/proc/Pressure(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(!can_use(A))
return FALSE
var/damage = (damage_roll(A,D) + 55)
log_combat(A, D, "pressured (CQC)")
D.visible_message("<span class='warning'>[A] punches [D]'s neck!</span>")
D.adjustStaminaLoss(60)
D.apply_damage(damage, STAMINA)
playsound(get_turf(A), 'sound/weapons/cqchit1.ogg', 50, 1, -1)
return TRUE
@@ -85,11 +91,12 @@
return
if(!can_use(A))
return FALSE
var/damage = (damage_roll(A,D) + 15)
if(!D.stat)
log_combat(A, D, "restrained (CQC)")
D.visible_message("<span class='warning'>[A] locks [D] into a restraining position!</span>", \
"<span class='userdanger'>[A] locks you into a restraining position!</span>")
D.adjustStaminaLoss(20)
D.apply_damage(damage, STAMINA)
D.Stun(100)
restraining = TRUE
addtimer(VARSET_CALLBACK(src, restraining, FALSE), 50, TIMER_UNIQUE)
@@ -98,6 +105,7 @@
/datum/martial_art/cqc/proc/Consecutive(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(!can_use(A))
return FALSE
var/damage = damage_roll(A,D)
if(!D.stat)
log_combat(A, D, "consecutive CQC'd (CQC)")
D.visible_message("<span class='warning'>[A] strikes [D]'s abdomen, neck and back consecutively</span>", \
@@ -106,8 +114,8 @@
var/obj/item/I = D.get_active_held_item()
if(I && D.temporarilyRemoveItemFromInventory(I))
A.put_in_hands(I)
D.adjustStaminaLoss(50)
D.apply_damage(25, BRUTE)
D.apply_damage(damage + 45, STAMINA)
D.apply_damage(damage + 20, BRUTE)
return TRUE
/datum/martial_art/cqc/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
@@ -135,7 +143,7 @@
log_combat(A, D, "attacked (CQC)")
A.do_attack_animation(D)
var/picked_hit_type = pick("CQC'd", "Big Bossed")
var/bonus_damage = 13
var/bonus_damage = (damage_roll(A,D) + 7)
if(!CHECK_MOBILITY(D, MOBILITY_STAND))
bonus_damage += 5
picked_hit_type = "stomps on"
@@ -151,7 +159,7 @@
D.visible_message("<span class='warning'>[A] leg sweeps [D]!", \
"<span class='userdanger'>[A] leg sweeps you!</span>")
playsound(get_turf(A), 'sound/effects/hit_kick.ogg', 50, 1, -1)
D.apply_damage(10, BRUTE)
D.apply_damage(bonus_damage, BRUTE)
D.DefaultCombatKnockdown(60)
log_combat(A, D, "sweeped (CQC)")
return TRUE
@@ -161,23 +169,29 @@
return FALSE
add_to_streak("D",D)
var/obj/item/I = null
var/damage = damage_roll(A,D)
var/stunthreshold = A.dna.species.punchstunthreshold
if(check_streak(A,D))
return TRUE
if(prob(65))
if(CHECK_MOBILITY(D, MOBILITY_MOVE) || !restraining)
if(CHECK_MOBILITY(D, MOBILITY_MOVE) || !restraining)
A.do_attack_animation(D, ATTACK_EFFECT_PUNCH)
if(damage >= stunthreshold)
I = D.get_active_held_item()
D.visible_message("<span class='warning'>[A] strikes [D]'s jaw with their hand!</span>", \
"<span class='userdanger'>[A] strikes your jaw, disorienting you!</span>")
"<span class='userdanger'>[A] strikes your jaw, disorienting you!</span>")
playsound(get_turf(D), 'sound/weapons/cqchit1.ogg', 50, 1, -1)
if(I && D.temporarilyRemoveItemFromInventory(I))
A.put_in_hands(I)
D.drop_all_held_items()
D.Jitter(2)
D.apply_damage(5, BRUTE)
else
D.visible_message("<span class='danger'>[A] attempted to disarm [D]!</span>", \
"<span class='userdanger'>[A] attempted to disarm [D]!</span>")
playsound(D, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
log_combat(A, D, "disarmed (CQC)", "[I ? " grabbing \the [I]" : ""]")
D.Dizzy(damage)
D.apply_damage(damage*2 + 20, STAMINA)
D.apply_damage(damage*0.5, BRUTE)
else
D.visible_message("<span class='danger'>[A] strikes [D] in the chest!</span>", \
"<span class='userdanger'>[A] strikes in chest!</span>")
playsound(D, 'sound/weapons/cqchit1.ogg', 25, 1, -1)
D.apply_damage(damage + 15, STAMINA)
D.apply_damage(damage*0.5, BRUTE)
log_combat(A, D, "disarmed (CQC)", "[I ? " grabbing \the [I]" : ""]")
if(restraining && A.pulling == D)
log_combat(A, D, "knocked out (Chokehold)(CQC)")
D.visible_message("<span class='danger'>[A] puts [D] into a chokehold!</span>", \
+56 -36
View File
@@ -1,6 +1,7 @@
/datum/martial_art/krav_maga
name = "Krav Maga"
id = MARTIALART_KRAVMAGA
pugilist = TRUE
var/datum/action/neck_chop/neckchop = new/datum/action/neck_chop()
var/datum/action/leg_sweep/legsweep = new/datum/action/leg_sweep()
var/datum/action/lung_punch/lungpunch = new/datum/action/lung_punch()
@@ -84,64 +85,71 @@
if("neck_chop")
streak = ""
neck_chop(A,D)
return 1
return TRUE
if("leg_sweep")
streak = ""
leg_sweep(A,D)
return 1
return TRUE
if("quick_choke")//is actually lung punch
streak = ""
quick_choke(A,D)
return 1
return 0
return TRUE
return FALSE
/datum/martial_art/krav_maga/proc/leg_sweep(mob/living/carbon/human/A, mob/living/carbon/human/D)
var/obj/item/bodypart/affecting = D.get_bodypart(BODY_ZONE_CHEST)
var/armor_block = D.run_armor_check(affecting, "melee")
var/damage = (damage_roll(A,D)*2 + 25)
if(!CHECK_MOBILITY(D, MOBILITY_STAND))
return 0
return FALSE
D.visible_message("<span class='warning'>[A] leg sweeps [D]!</span>", \
"<span class='userdanger'>[A] leg sweeps you!</span>")
playsound(get_turf(A), 'sound/effects/hit_kick.ogg', 50, 1, -1)
D.apply_damage(5, BRUTE)
D.DefaultCombatKnockdown(40, override_hardstun = 0.01, override_stamdmg = 25)
D.apply_damage(damage, STAMINA, affecting, armor_block)
D.DefaultCombatKnockdown(80, override_hardstun = 1, override_stamdmg = 0)
log_combat(A, D, "leg sweeped")
return 1
return TRUE
/datum/martial_art/krav_maga/proc/quick_choke(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)//is actually lung punch
var/damage = damage_roll(A,D)
D.visible_message("<span class='warning'>[A] pounds [D] on the chest!</span>", \
"<span class='userdanger'>[A] slams your chest! You can't breathe!</span>")
playsound(get_turf(A), 'sound/effects/hit_punch.ogg', 50, 1, -1)
if(D.losebreath <= 10)
D.losebreath = CLAMP(D.losebreath + 5, 0, 10)
D.adjustOxyLoss(10)
D.losebreath = clamp(D.losebreath + 5, 0, 10)
D.adjustOxyLoss(damage + 5)
log_combat(A, D, "quickchoked")
return 1
return TRUE
/datum/martial_art/krav_maga/proc/neck_chop(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)
var/damage = (damage_roll(A,D)*0.5)
D.visible_message("<span class='warning'>[A] karate chops [D]'s neck!</span>", \
"<span class='userdanger'>[A] karate chops your neck, rendering you unable to speak!</span>")
playsound(get_turf(A), 'sound/effects/hit_punch.ogg', 50, 1, -1)
D.apply_damage(5, BRUTE)
D.apply_damage(damage, BRUTE)
if(D.silent <= 10)
D.silent = CLAMP(D.silent + 10, 0, 10)
D.silent = clamp(D.silent + 10, 0, 10)
log_combat(A, D, "neck chopped")
return 1
return TRUE
/datum/martial_art/krav_maga/grab_act(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)
if(check_streak(A,D))
return 1
return TRUE
log_combat(A, D, "grabbed (Krav Maga)")
..()
/datum/martial_art/krav_maga/harm_act(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)
var/obj/item/bodypart/affecting = D.get_bodypart(ran_zone(A.zone_selected))
var/armor_block = D.run_armor_check(affecting, "melee")
if(check_streak(A,D))
return 1
return TRUE
log_combat(A, D, "punched")
var/picked_hit_type = pick("punches", "kicks")
var/bonus_damage = 10
if(CHECK_MOBILITY(D, MOBILITY_STAND))
bonus_damage += 5
var/bonus_damage = damage_roll(A,D)
if(!CHECK_MOBILITY(D, MOBILITY_STAND))
bonus_damage += 10
picked_hit_type = "stomps on"
D.apply_damage(bonus_damage, BRUTE)
D.apply_damage(bonus_damage, BRUTE, affecting, armor_block)
if(picked_hit_type == "kicks" || picked_hit_type == "stomps on")
A.do_attack_animation(D, ATTACK_EFFECT_KICK)
playsound(get_turf(D), 'sound/effects/hit_kick.ogg', 50, 1, -1)
@@ -151,24 +159,36 @@
D.visible_message("<span class='danger'>[A] [picked_hit_type] [D]!</span>", \
"<span class='userdanger'>[A] [picked_hit_type] you!</span>")
log_combat(A, D, "[picked_hit_type] with [name]")
return 1
return TRUE
/datum/martial_art/krav_maga/disarm_act(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)
var/obj/item/I = null
if(prob(60))
I = D.get_active_held_item()
if(I)
if(D.temporarilyRemoveItemFromInventory(I))
A.put_in_hands(I)
D.visible_message("<span class='danger'>[A] has disarmed [D]!</span>", \
"<span class='userdanger'>[A] has disarmed [D]!</span>")
playsound(D, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
/datum/martial_art/krav_maga/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(check_streak(A,D))
return TRUE
var/obj/item/bodypart/affecting = D.get_bodypart(ran_zone(A.zone_selected))
var/armor_block = D.run_armor_check(affecting, "melee")
var/damage = damage_roll(A,D)
var/stunthreshold = A.dna.species.punchstunthreshold
if(CHECK_MOBILITY(D, MOBILITY_STAND))
D.visible_message("<span class='danger'>[A] reprimands [D]!</span>", \
"<span class='userdanger'>You're slapped by [A]!</span>", "<span class='hear'>You hear a sickening sound of flesh hitting flesh!</span>", COMBAT_MESSAGE_RANGE, A)
to_chat(A, "<span class='danger'>You jab [D]!</span>")
A.do_attack_animation(D, ATTACK_EFFECT_PUNCH)
playsound(D, 'sound/effects/hit_punch.ogg', 50, TRUE, -1)
D.apply_damage(damage*2 + 15, STAMINA, affecting, armor_block)
log_combat(A, D, "punched nonlethally")
else
D.visible_message("<span class='danger'>[A] attempted to disarm [D]!</span>", \
"<span class='userdanger'>[A] attempted to disarm [D]!</span>")
playsound(D, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
log_combat(A, D, "disarmed (Krav Maga)", "[I ? " removing \the [I]" : ""]")
return 1
D.visible_message("<span class='danger'>[A] reprimands [D]!</span>", \
"<span class='userdanger'>You're manhandled by [A]!</span>", "<span class='hear'>You hear a sickening sound of flesh hitting flesh!</span>", COMBAT_MESSAGE_RANGE, A)
to_chat(A, "<span class='danger'>You stomp [D]!</span>")
A.do_attack_animation(D, ATTACK_EFFECT_KICK)
playsound(D, 'sound/effects/hit_punch.ogg', 50, TRUE, -1)
D.apply_damage(damage*2 + 20, STAMINA, affecting, armor_block)
log_combat(A, D, "stomped nonlethally")
if(damage >= stunthreshold)
D.visible_message("<span class='warning'>[D] sputters and recoils in pain!</span>", "<span class='userdanger'>You recoil in pain as you are jabbed in a nerve!</span>")
D.drop_all_held_items()
return TRUE
//Krav Maga Gloves
+2 -1
View File
@@ -4,6 +4,7 @@
/datum/martial_art/mushpunch/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
var/atk_verb
var/damage = (damage_roll(A,D)*3)
to_chat(A, "<span class='spider'>You begin to wind up an attack...</span>")
if(!do_after(A, 25, target = D))
to_chat(A, "<span class='spider'><b>Your attack was interrupted!</b></span>")
@@ -12,7 +13,7 @@
atk_verb = pick("punches", "smashes", "ruptures", "cracks")
D.visible_message("<span class='danger'>[A] [atk_verb] [D] with inhuman strength, sending [D.p_them()] flying backwards!</span>", \
"<span class='userdanger'>[A] [atk_verb] you with inhuman strength, sending you flying backwards!</span>")
D.apply_damage(rand(15,30), BRUTE)
D.apply_damage(damage, BRUTE) //KAPOW
playsound(D, 'sound/effects/meteorimpact.ogg', 25, 1, -1)
var/throwtarget = get_edge_target_turf(A, get_dir(A, get_step_away(D, A)))
D.throw_at(throwtarget, 4, 2, A)//So stuff gets tossed around at the same time.
+3
View File
@@ -6,6 +6,7 @@
name = "Plasma Fist"
id = MARTIALART_PLASMAFIST
help_verb = /mob/living/carbon/human/proc/plasma_fist_help
pugilist = TRUE
/datum/martial_art/plasma_fist/proc/check_streak(mob/living/carbon/human/A, mob/living/carbon/human/D)
@@ -44,11 +45,13 @@
return
/datum/martial_art/plasma_fist/proc/Throwback(mob/living/carbon/human/A, mob/living/carbon/human/D)
var/damage = (damage_roll(A,D)*3)
D.visible_message("<span class='danger'>[A] has hit [D] with Plasma Punch!</span>", \
"<span class='userdanger'>[A] has hit [D] with Plasma Punch!</span>")
playsound(D.loc, 'sound/weapons/punch1.ogg', 50, 1, -1)
var/atom/throw_target = get_edge_target_turf(D, get_dir(D, get_step_away(D, A)))
D.throw_at(throw_target, 200, 4,A)
D.apply_damage(damage, BRUTE)
A.say("HYAH!", forced="plasma fist")
log_combat(A, D, "threw back (Plasma Fist)")
return
+5 -4
View File
@@ -14,6 +14,7 @@
/datum/martial_art/psychotic_brawling/proc/psycho_attack(mob/living/carbon/human/A, mob/living/carbon/human/D)
var/atk_verb
var/damage = damage_roll(A,D)
switch(rand(1,8))
if(1)
D.help_shake_act(A)
@@ -44,10 +45,10 @@
D.visible_message("<span class='danger'>[A] [atk_verb] [D]!</span>", \
"<span class='userdanger'>[A] [atk_verb] you!</span>")
playsound(get_turf(D), 'sound/weapons/punch1.ogg', 40, 1, -1)
D.apply_damage(rand(5,10), BRUTE, BODY_ZONE_HEAD)
A.apply_damage(rand(5,10), BRUTE, BODY_ZONE_HEAD)
D.apply_damage(damage*1.5, BRUTE, BODY_ZONE_HEAD)
A.apply_damage(damage, BRUTE, BODY_ZONE_HEAD)
if(!istype(D.head,/obj/item/clothing/head/helmet/) && !istype(D.head,/obj/item/clothing/head/hardhat))
D.adjustOrganLoss(ORGAN_SLOT_BRAIN, 5)
D.adjustOrganLoss(ORGAN_SLOT_BRAIN, damage)
A.Stun(rand(10,45))
D.DefaultCombatKnockdown(rand(5,30))//CIT CHANGE - makes stuns from martial arts always use Knockdown instead of Stun for the sake of consistency
if(5,6)
@@ -55,7 +56,7 @@
atk_verb = pick("punches", "kicks", "hits", "slams into")
D.visible_message("<span class='danger'>[A] [atk_verb] [D] with inhuman strength, sending [D.p_them()] flying backwards!</span>", \
"<span class='userdanger'>[A] [atk_verb] you with inhuman strength, sending you flying backwards!</span>")
D.apply_damage(rand(15,30), BRUTE)
D.apply_damage(damage*2, BRUTE)
playsound(get_turf(D), 'sound/effects/meteorimpact.ogg', 25, 1, -1)
var/throwtarget = get_edge_target_turf(A, get_dir(A, get_step_away(D, A)))
D.throw_at(throwtarget, 4, 2, A)//So stuff gets tossed around at the same time.
+50 -28
View File
@@ -1,5 +1,5 @@
#define REPULSE_PUNCH_COMBO "HDHD"
#define SHOULDER_FLIP_COMBO "GHDGHH"
#define REPULSE_PUNCH_COMBO "HDD"
#define SHOULDER_FLIP_COMBO "DHDHG"
#define FOOT_SMASH_COMBO "HH"
#define SIDE_KICK_COMBO "skick"
#define DEFT_SWITCH_COMBO "deft"
@@ -9,6 +9,7 @@
id = MARTIALART_RISINGBASS
allow_temp_override = FALSE
help_verb = /mob/living/carbon/human/proc/rising_bass_help
pugilist = TRUE
var/datum/action/risingbassmove/sidekick = new/datum/action/risingbassmove/sidekick()
var/datum/action/risingbassmove/deftswitch = new/datum/action/risingbassmove/deftswitch()
var/repulsecool = 0
@@ -37,7 +38,6 @@
return FALSE
//Repulse Punch - Slams the opponent far away from you.
/datum/action/risingbassmove
name = ""
icon_icon = 'icons/mob/actions/actions_items.dmi'
@@ -78,6 +78,7 @@
return TRUE
/datum/martial_art/the_rising_bass/proc/sideKick(mob/living/carbon/human/A, mob/living/carbon/human/D)
var/damage = (damage_roll(A,D)*0.5)
if(CHECK_MOBILITY(D, MOBILITY_STAND))
var/dir = A.dir & (NORTH | SOUTH) ? pick(EAST, WEST) : pick(NORTH, SOUTH)
var/oppdir = dir == NORTH ? SOUTH : dir == SOUTH ? NORTH : dir == EAST ? WEST : EAST
@@ -87,8 +88,8 @@
D.visible_message("<span class='warning'>[A] kicks [D] in the side, sliding them over!</span>", \
"<span class='userdanger'>[A] kicks you in the side, forcing you to step away!</span>")
playsound(get_turf(A), 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
D.apply_damage(5, BRUTE, BODY_ZONE_CHEST)
D.DefaultCombatKnockdown(60)
D.apply_damage(damage, BRUTE, BODY_ZONE_CHEST)
D.DefaultCombatKnockdown(60, override_hardstun = 1, override_stamdmg = damage)
var/L = !checkfordensity(H,D) ? (!checkfordensity(K,D) ? D.loc : K) : H
D.forceMove(L)
log_combat(A, D, "side kicked (Rising Bass)")
@@ -96,24 +97,27 @@
return TRUE
/datum/martial_art/the_rising_bass/proc/shoulderFlip(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(CHECK_MOBILITY(D, MOBILITY_STAND))
var/turf/H = get_step(A, get_dir(D,A))
var/L = checkfordensity(H,D) ? H : A.loc
A.do_attack_animation(D, ATTACK_EFFECT_PUNCH)
D.visible_message("<span class='warning'>[A] flips [D] over their shoulder, slamming them into the ground!</span>", \
"<span class='userdanger'>[A] flips you over their shoulder, slamming you into the ground!</span>")
playsound(get_turf(A), 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
D.emote("scream")
D.apply_damage(10, BRUTE, BODY_ZONE_CHEST)
D.apply_damage(30, BRUTE, BODY_ZONE_HEAD)
var/damage = damage_roll(A,D)
var/stunthreshold = A.dna.species.punchstunthreshold
var/turf/H = get_step(A, get_dir(D,A))
var/L = checkfordensity(H,D) ? H : A.loc
A.do_attack_animation(D, ATTACK_EFFECT_PUNCH)
D.visible_message("<span class='warning'>[A] flips [D] over their shoulder, slamming them into the ground!</span>", \
"<span class='userdanger'>[A] flips you over their shoulder, slamming you into the ground!</span>")
playsound(get_turf(A), 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
D.emote("scream")
D.apply_damage(damage + 10, BRUTE, BODY_ZONE_CHEST)
D.apply_damage(damage + 10, BRUTE, BODY_ZONE_HEAD)
if(damage >= stunthreshold)
D.Sleeping(60)
D.DefaultCombatKnockdown(300)
D.forceMove(L)
log_combat(A, D, "shoulder flipped (Rising Bass)")
return TRUE
return FALSE
D.DefaultCombatKnockdown(300, override_hardstun = 1, override_stamdmg = 50)
D.forceMove(L)
log_combat(A, D, "shoulder flipped (Rising Bass)")
return TRUE
//Repulse Punch - Slams the opponent far away from you.
/datum/martial_art/the_rising_bass/proc/repulsePunch(mob/living/carbon/human/A, mob/living/carbon/human/D)
var/damage = damage_roll(A,D)
if(CHECK_MOBILITY(D, MOBILITY_STAND) && repulsecool < world.time)
A.do_attack_animation(D, ATTACK_EFFECT_PUNCH)
D.visible_message("<span class='warning'>[A] smashes [D] in the chest, throwing them away!</span>", \
@@ -121,20 +125,22 @@
playsound(get_turf(A), 'sound/weapons/punch1.ogg', 50, 1, -1)
var/atom/F = get_edge_target_turf(D, get_dir(A, get_step_away(D, A)))
D.throw_at(F, 10, 1)
D.apply_damage(10, BRUTE, BODY_ZONE_CHEST)
D.DefaultCombatKnockdown(90)
D.apply_damage(damage, BRUTE, BODY_ZONE_CHEST)
D.DefaultCombatKnockdown(90, override_hardstun = 1, override_stamdmg = damage*2)
D.confused += min(damage, 20)
log_combat(A, D, "repulse punched (Rising Bass)")
repulsecool = world.time + 3 SECONDS
return TRUE
return FALSE
/datum/martial_art/the_rising_bass/proc/footSmash(mob/living/carbon/human/A, mob/living/carbon/human/D)
var/damage = (damage_roll(A,D)*0.5)
if(CHECK_MOBILITY(D, MOBILITY_STAND))
A.do_attack_animation(D, ATTACK_EFFECT_KICK)
D.visible_message("<span class='warning'>[A] smashes their foot down on [D]'s foot!</span>", \
"<span class='userdanger'>[A] smashes your foot!</span>")
playsound(get_turf(A), 'sound/weapons/punch1.ogg', 50, 1, -1)
D.apply_damage(5, BRUTE, pick(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG))
D.apply_damage(damage, BRUTE, pick(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG))
D.dropItemToGround(D.get_active_held_item())
log_combat(A, D, "foot smashed (Rising Bass)")
return TRUE
@@ -158,7 +164,23 @@
add_to_streak("D",D)
if(check_streak(A,D))
return TRUE
return ..()
var/damage = damage_roll(A,D)
var/stunthreshold = A.dna.species.punchstunthreshold
A.do_attack_animation(D, ATTACK_EFFECT_PUNCH)
if(CHECK_MOBILITY(D, MOBILITY_STAND) && damage >= stunthreshold)
D.visible_message("<span class='danger'>[A] trips [D]!</span>", \
"<span class='userdanger'>You're tripped by [A]!</span>", "<span class='hear'>You hear something thump against the floor!</span>", COMBAT_MESSAGE_RANGE, A)
to_chat(A, "<span class='danger'>You trip [D]!</span>")
D.DefaultCombatKnockdown(10, override_hardstun = 0.01, override_stamdmg = damage)
D.Dizzy(damage)
else
D.visible_message("<span class='danger'>[A] jabs [D] in the stomach!</span>", \
"<span class='userdanger'>You're jabbed in the stomach by [A]!</span>", "<span class='hear'>You hear a sickening sound of flesh hitting flesh!</span>", COMBAT_MESSAGE_RANGE, A)
to_chat(A, "<span class='danger'>You jab [D] in the stomach!</span>")
D.apply_damage(damage*2 + 10, STAMINA)
D.disgust = min(damage, 20)
playsound(D, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
return TRUE
/datum/martial_art/the_rising_bass/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
add_to_streak("H",D)
@@ -181,7 +203,7 @@
. = ..()
if(A.incapacitated(FALSE, TRUE)) //NO STUN
return BULLET_ACT_HIT
if(!(A.mobility_flags & MOBILITY_USE)) //NO UNABLE TO USE
if(!CHECK_ALL_MOBILITY(A, MOBILITY_USE|MOBILITY_STAND)) //NO UNABLE TO USE, NO DODGING ON THE FLOOR
return BULLET_ACT_HIT
if(A.dna && A.dna.check_mutation(HULK)) //NO HULK
return BULLET_ACT_HIT
@@ -199,9 +221,9 @@
to_chat(usr, "<b><i>You retreat inward and recall the teachings of the Rising Bass...</i></b>")
to_chat(usr, "<span class='notice'>Side Kick</span>: Forces opponent to step to the side.")
to_chat(usr, "<span class='notice'>Shoulder Flip</span>: Grab Harm Disarm Grab Harm Harm. Flips opponent over your shoulder and stuns.")
to_chat(usr, "<span class='notice'>Repulse Punch</span>: Harm Disarm Harm Disarm. Slams the opponent far away from you.")
to_chat(usr, "<span class='notice'>Foot Smash</span>: Harm Harm. Stuns opponent, minor damage.")
to_chat(usr, "<span class='notice'>Shoulder Flip</span>: Disarm Harm Disarm Harm Grab. Flips opponent over your shoulder and stuns.")
to_chat(usr, "<span class='notice'>Repulse Punch</span>: Harm Disarm Disarm. Slams the opponent far away from you.")
to_chat(usr, "<span class='notice'>Foot Smash</span>: Harm Harm. Knocks opponent prone, minor damage.")
to_chat(usr, "<span class='notice'>Deft Switch</span>: Switches the opponent's held item for your own. Most useful with nothing in your hand.")
/datum/martial_art/the_rising_bass/teach(mob/living/carbon/human/H, make_temporary = FALSE)
+28 -16
View File
@@ -7,6 +7,7 @@
id = MARTIALART_SLEEPINGCARP
allow_temp_override = FALSE
help_verb = /mob/living/carbon/human/proc/sleeping_carp_help
pugilist = TRUE
/datum/martial_art/the_sleeping_carp/proc/check_streak(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(findtext(streak,STRONG_PUNCH_COMBO))
@@ -23,7 +24,7 @@
return TRUE
return FALSE
///Gnashing Teeth: Harm Harm, consistent 20 force punch on every second harm punch, has a chance to crit
///Gnashing Teeth: Harm Harm, high force punch on every second harm punch, has a chance to crit for near triple damage
/datum/martial_art/the_sleeping_carp/proc/strongPunch(mob/living/carbon/human/A, mob/living/carbon/human/D)
///this var is so that the strong punch is always aiming for the body part the user is targeting and not trying to apply to the chest before deviating
var/obj/item/bodypart/affecting = D.get_bodypart(ran_zone(A.zone_selected))
@@ -31,50 +32,53 @@
var/atk_verb = pick("precisely kick", "brutally chop", "cleanly hit", "viciously slam")
///this is the critical hit damage added to the attack if it rolls, it starts at 0 because it'll be changed when rolled
var/crit_damage = 0
var/damage = damage_roll(A,D)
D.visible_message("<span class='danger'>[A] [atk_verb]s [D]!</span>", \
"<span class='userdanger'>[A] [atk_verb]s you!</span>", null, null, A)
to_chat(A, "<span class='danger'>You [atk_verb] [D]!</span>")
if(prob(10))
crit_damage += 20
crit_damage += (damage*2 + 15)
playsound(get_turf(D), 'sound/weapons/bite.ogg', 50, TRUE, -1)
D.visible_message("<span class='warning'>[D] sputters blood as the blow strikes them with inhuman force!</span>", "<span class='userdanger'>You are struck with incredible precision by [A]!</span>")
D.visible_message("<span class='warning'>[D] staggers as the blow strikes them with inhuman force!</span>", "<span class='userdanger'>You are struck with incredible precision by [A]!</span>")
log_combat(A, D, "critcal strong punched (Sleeping Carp)")//log it here because a critical can swing for 40 force and it's important for the sake of how hard they hit
else
playsound(get_turf(D), 'sound/weapons/punch1.ogg', 25, TRUE, -1)
log_combat(A, D, "strong punched (Sleeping Carp)")//so as to not double up on logging
D.apply_damage(20 + crit_damage, BRUTE, affecting)
return
D.apply_damage((damage + 15) + crit_damage, BRUTE, affecting)
return TRUE
///Crashing Wave Kick: Harm Disarm combo, throws people seven tiles backwards
/datum/martial_art/the_sleeping_carp/proc/launchKick(mob/living/carbon/human/A, mob/living/carbon/human/D)
var/damage = (damage_roll(A,D) + 15)
A.do_attack_animation(D, ATTACK_EFFECT_KICK)
D.visible_message("<span class='warning'>[A] kicks [D] square in the chest, sending them flying!</span>", \
"<span class='userdanger'>You are kicked square in the chest by [A], sending you flying!</span>", "<span class='hear'>You hear a sickening sound of flesh hitting flesh!</span>", COMBAT_MESSAGE_RANGE, A)
playsound(get_turf(A), 'sound/effects/hit_kick.ogg', 50, TRUE, -1)
var/atom/throw_target = get_edge_target_turf(D, A.dir)
D.throw_at(throw_target, 7, 14, A)
D.apply_damage(15, BRUTE, BODY_ZONE_CHEST)
D.apply_damage(damage, BRUTE, BODY_ZONE_CHEST)
log_combat(A, D, "launchkicked (Sleeping Carp)")
return
return TRUE
///Keelhaul: Harm Grab combo, knocks people down, deals stamina damage while they're on the floor
/datum/martial_art/the_sleeping_carp/proc/dropKick(mob/living/carbon/human/A, mob/living/carbon/human/D)
var/damage = damage_roll(A,D)
A.do_attack_animation(D, ATTACK_EFFECT_KICK)
playsound(get_turf(A), 'sound/effects/hit_kick.ogg', 50, TRUE, -1)
if((D.mobility_flags & MOBILITY_STAND))
D.apply_damage(10, BRUTE, BODY_ZONE_HEAD)
D.apply_damage(damage, BRUTE, BODY_ZONE_HEAD)
D.DefaultCombatKnockdown(50, override_hardstun = 0.01, override_stamdmg = 0)
D.adjustStaminaLoss(40) //A cit specific change form the tg port to really punish anyone who tries to stand up
D.apply_damage(damage + 35, STAMINA, BODY_ZONE_HEAD) //A cit specific change form the tg port to really punish anyone who tries to stand up
D.visible_message("<span class='warning'>[A] kicks [D] in the head, sending them face first into the floor!</span>", \
"<span class='userdanger'>You are kicked in the head by [A], sending you crashing to the floor!</span>", "<span class='hear'>You hear a sickening sound of flesh hitting flesh!</span>", COMBAT_MESSAGE_RANGE, A)
else if(!(D.mobility_flags & MOBILITY_STAND))
D.apply_damage(5, BRUTE, BODY_ZONE_HEAD)
D.adjustStaminaLoss(40)
else
D.apply_damage(damage*0.5, BRUTE, BODY_ZONE_HEAD)
D.apply_damage(damage + 35, STAMINA, BODY_ZONE_HEAD)
D.drop_all_held_items()
D.visible_message("<span class='warning'>[A] kicks [D] in the head!</span>", \
"<span class='userdanger'>You are kicked in the head by [A]!</span>", "<span class='hear'>You hear a sickening sound of flesh hitting flesh!</span>", COMBAT_MESSAGE_RANGE, A)
log_combat(A, D, "dropkicked (Sleeping Carp)")
return
return TRUE
/datum/martial_art/the_sleeping_carp/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
add_to_streak("G",D)
@@ -85,6 +89,8 @@
/datum/martial_art/the_sleeping_carp/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
add_to_streak("H",D)
var/damage = (damage_roll(A,D) + 5)
var/stunthreshold = A.dna.species.punchstunthreshold
if(check_streak(A,D))
return TRUE
var/obj/item/bodypart/affecting = D.get_bodypart(ran_zone(A.zone_selected))
@@ -93,8 +99,11 @@
D.visible_message("<span class='danger'>[A] [atk_verb]s [D]!</span>", \
"<span class='userdanger'>[A] [atk_verb]s you!</span>", null, null, A)
to_chat(A, "<span class='danger'>You [atk_verb] [D]!</span>")
D.apply_damage(rand(10,15), BRUTE, affecting)
D.apply_damage(damage, BRUTE, affecting)
playsound(get_turf(D), 'sound/weapons/punch1.ogg', 25, TRUE, -1)
if(CHECK_MOBILITY(D, MOBILITY_STAND) && damage >= stunthreshold)
to_chat(D, "<span class='danger'>You stumble and fall!</span>")
D.DefaultCombatKnockdown(10, override_hardstun = 0.01, override_stamdmg = damage)
log_combat(A, D, "punched (Sleeping Carp)")
return TRUE
@@ -110,7 +119,7 @@
. = ..()
if(A.incapacitated(FALSE, TRUE)) //NO STUN
return BULLET_ACT_HIT
if(!(A.mobility_flags & MOBILITY_USE)) //NO UNABLE TO USE
if(!CHECK_ALL_MOBILITY(A, MOBILITY_USE|MOBILITY_STAND)) //NO UNABLE TO USE, NO DEFLECTION ON THE FLOOR
return BULLET_ACT_HIT
if(A.dna && A.dna.check_mutation(HULK)) //NO HULK
return BULLET_ACT_HIT
@@ -121,6 +130,7 @@
playsound(get_turf(A), pick('sound/weapons/bulletflyby.ogg', 'sound/weapons/bulletflyby2.ogg', 'sound/weapons/bulletflyby3.ogg'), 75, TRUE)
P.firer = A
P.setAngle(rand(0, 360))//SHING
A.adjustStaminaLossBuffered (3) //Citadel change to stop infinite bullet sponging as you run away, but it is buffered!
return BULLET_ACT_FORCE_PIERCE
return BULLET_ACT_HIT
@@ -131,9 +141,10 @@
ADD_TRAIT(H, TRAIT_NOGUNS, SLEEPING_CARP_TRAIT)
ADD_TRAIT(H, TRAIT_PIERCEIMMUNE, SLEEPING_CARP_TRAIT)
ADD_TRAIT(H, TRAIT_NODISMEMBER, SLEEPING_CARP_TRAIT)
ADD_TRAIT(H, TRAIT_TASED_RESISTANCE, SLEEPING_CARP_TRAIT)
H.physiology.brute_mod *= 0.4 //brute is really not gonna cut it
H.physiology.burn_mod *= 0.7 //burn is distinctly more useful against them than brute but they're still resistant
H.physiology.stamina_mod *= 0.5 //stun batons prove to be one of the few ways to fight them. They have stun resistance already, so I think doubling down too hard on this resistance is a bit much.
H.physiology.stamina_mod *= 0.5 //You take less stamina damage overall, but you do not reduce the damage from stun batons
H.physiology.stun_mod *= 0.3 //for those rare stuns
H.physiology.pressure_mod *= 0.3 //go hang out with carp
H.physiology.cold_mod *= 0.3 //cold mods are different to burn mods, they do stack however
@@ -146,6 +157,7 @@
REMOVE_TRAIT(H, TRAIT_NOGUNS, SLEEPING_CARP_TRAIT)
REMOVE_TRAIT(H, TRAIT_PIERCEIMMUNE, SLEEPING_CARP_TRAIT)
REMOVE_TRAIT(H, TRAIT_NODISMEMBER, SLEEPING_CARP_TRAIT)
REMOVE_TRAIT(H, TRAIT_TASED_RESISTANCE, SLEEPING_CARP_TRAIT)
H.physiology.brute_mod = initial(H.physiology.brute_mod)
H.physiology.burn_mod = initial(H.physiology.burn_mod)
H.physiology.stamina_mod = initial(H.physiology.stamina_mod)
+40 -34
View File
@@ -19,29 +19,29 @@
/datum/martial_art/wrestling/proc/check_streak(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)
if(!can_use(A, D))
return 0
return FALSE
switch(streak)
if("drop")
streak = ""
drop(A,D)
return 1
return TRUE
if("strike")
streak = ""
strike(A,D)
return 1
return TRUE
if("kick")
streak = ""
kick(A,D)
return 1
return TRUE
if("throw")
streak = ""
throw_wrassle(A,D)
return 1
return TRUE
if("slam")
streak = ""
slam(A,D)
return 1
return 0
return TRUE
return FALSE
/datum/action/slam
name = "Slam (Cinch) - Slam a grappled opponent into the floor."
@@ -138,7 +138,7 @@
/datum/martial_art/wrestling/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(check_streak(A,D))
return 1
return TRUE
log_combat(A, D, "punched with wrestling")
..()
@@ -173,11 +173,11 @@
if (get_dist(A, D) > 1)
to_chat(A, "[D] is too far away!")
return 0
return FALSE
if (!isturf(A.loc) || !isturf(D.loc))
to_chat(A, "You can't throw [D] from here!")
return 0
return FALSE
A.setDir(turn(A.dir, 90))
var/turf/T = get_step(A, A.dir)
@@ -186,7 +186,7 @@
D.forceMove(T)
D.setDir(get_dir(D, A))
else
return 0
return FALSE
sleep(delay)
@@ -195,11 +195,11 @@
if (get_dist(A, D) > 1)
to_chat(A, "[D] is too far away!")
return 0
return FALSE
if (!isturf(A.loc) || !isturf(D.loc))
to_chat(A, "You can't throw [D] from here!")
return 0
return FALSE
D.forceMove(A.loc) // Maybe this will help with the wallthrowing bug.
@@ -211,7 +211,7 @@
D.emote("scream")
D.throw_at(T, 10, 4, A, TRUE, TRUE, callback = CALLBACK(D, /mob/living/carbon/human.proc/DefaultCombatKnockdown, 20))
log_combat(A, D, "has thrown with wrestling")
return 0
return FALSE
/datum/martial_art/wrestling/proc/FlipAnimation(mob/living/carbon/human/D)
set waitfor = FALSE
@@ -227,6 +227,7 @@
if(!A.pulling || A.pulling != D)
to_chat(A, "You need to have [D] in a cinch!")
return
var/damage = damage_roll(A,D)
D.forceMove(A.loc)
A.setDir(get_dir(A, D))
D.setDir(get_dir(D, A))
@@ -258,7 +259,7 @@
A.pixel_y = 0
D.pixel_x = 0
D.pixel_y = 0
return 0
return FALSE
if (!isturf(A.loc) || !isturf(D.loc))
to_chat(A, "You can't slam [D] here!")
@@ -266,7 +267,7 @@
A.pixel_y = 0
D.pixel_x = 0
D.pixel_y = 0
return 0
return FALSE
else
if (A)
A.pixel_x = 0
@@ -274,7 +275,7 @@
if (D)
D.pixel_x = 0
D.pixel_y = 0
return 0
return FALSE
sleep(1)
@@ -286,11 +287,11 @@
if (get_dist(A, D) > 1)
to_chat(A, "[D] is too far away!")
return 0
return FALSE
if (!isturf(A.loc) || !isturf(D.loc))
to_chat(A, "You can't slam [D] here!")
return 0
return FALSE
D.forceMove(A.loc)
@@ -309,11 +310,11 @@
switch(rand(1,3))
if (2)
D.adjustBruteLoss(rand(20,30))
D.apply_damage(damage + 25, BRUTE)
if (3)
D.ex_act(EXPLODE_LIGHT)
else
D.adjustBruteLoss(rand(10,20))
D.apply_damage(damage + 15, BRUTE)
else
D.ex_act(EXPLODE_LIGHT)
@@ -327,7 +328,7 @@
log_combat(A, D, "body-slammed")
return 0
return FALSE
/datum/martial_art/wrestling/proc/CheckStrikeTurf(mob/living/carbon/human/A, turf/T)
if (A && (T && isturf(T) && get_dist(A, T) <= 1))
@@ -337,6 +338,7 @@
if(!D)
return
var/turf/T = get_turf(A)
var/damage = damage_roll(A,D)
if (T && isturf(T) && D && isturf(D.loc))
for (var/i = 0, i < 4, i++)
A.setDir(turn(A.dir, 90))
@@ -345,7 +347,7 @@
addtimer(CALLBACK(src, .proc/CheckStrikeTurf, A, T), 4)
A.visible_message("<span class = 'danger'><b>[A] headbutts [D]!</b></span>")
D.adjustBruteLoss(rand(10,20))
D.apply_damage(damage + 15, BRUTE)
playsound(A.loc, "swing_hit", 50, 1)
D.Unconscious(20)
log_combat(A, D, "headbutted")
@@ -353,13 +355,14 @@
/datum/martial_art/wrestling/proc/kick(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(!D)
return
var/damage = damage_roll(A,D)
A.emote("scream")
A.emote("flip")
A.setDir(turn(A.dir, 90))
A.visible_message("<span class = 'danger'><B>[A] roundhouse-kicks [D]!</B></span>")
playsound(A.loc, "swing_hit", 50, 1)
D.adjustBruteLoss(rand(10,20))
D.apply_damage(damage + 15, STAMINA)
var/turf/T = get_edge_target_turf(A, get_dir(A, get_step_away(D, A)))
if (T && isturf(T))
@@ -373,7 +376,8 @@
var/obj/surface = null
var/turf/ST = null
var/falling = 0
var/damage = damage_roll(A,D)
for (var/obj/O in oview(1, A))
if (O.density == 1)
if (O == A)
@@ -401,15 +405,15 @@
A.pixel_y = 0
if (falling == 1)
A.visible_message("<span class = 'danger'><B>...and dives head-first into the ground, ouch!</b></span>")
A.adjustBruteLoss(rand(10,20))
A.apply_damage(damage + 15, BRUTE)
A.DefaultCombatKnockdown(60)
to_chat(A, "[D] is too far away!")
return 0
return FALSE
if (!isturf(A.loc) || !isturf(D.loc))
A.pixel_y = 0
to_chat(A, "You can't drop onto [D] from here!")
return 0
return FALSE
if(A)
animate(A, transform = matrix(90, MATRIX_ROTATE), time = 1, loop = 0)
@@ -427,9 +431,9 @@
if (prob(33) || D.stat)
D.ex_act(EXPLODE_LIGHT)
else
D.adjustBruteLoss(rand(20,30))
D.apply_damage(damage + 25, BRUTE)
else
D.adjustBruteLoss(rand(20,30))
D.apply_damage(damage + 25, BRUTE)
D.DefaultCombatKnockdown(40)
@@ -442,14 +446,16 @@
return
/datum/martial_art/wrestling/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
damage_roll(A,D)
if(check_streak(A,D))
return 1
return TRUE
log_combat(A, D, "wrestling-disarmed")
..()
/datum/martial_art/wrestling/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
damage_roll(A,D)
if(check_streak(A,D))
return 1
return TRUE
if(!can_use(A,D))
return ..()
if(A.pulling == D || A == D) // don't stun grab yoursel
@@ -459,7 +465,7 @@
"<span class='userdanger'>[A] gets [D] in a cinch!</span>")
D.Stun(rand(60,100))
log_combat(A, D, "cinched")
return 1
return TRUE
/obj/item/storage/belt/champion/wrestling
name = "Wrestling Belt"
@@ -492,7 +498,7 @@
//Make sure that moves can only be used on people wearing the holodeck belt
/datum/martial_art/wrestling/holodeck/can_use(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)
if(!(istype(D.mind?.martial_art, /datum/martial_art/wrestling/holodeck)))
return 0
return FALSE
else
return ..()
+2 -2
View File
@@ -19,7 +19,7 @@
integrity_modifier = 0.1
sheet_type = /obj/item/stack/sheet/glass
value_per_unit = 0.0025
armor_modifiers = list("melee" = 0.2, "bullet" = 0.2, "laser" = 0, "energy" = 1, "bomb" = 0, "bio" = 0.2, "rad" = 0.2, "fire" = 1, "acid" = 0.2) // yeah ok retard
armor_modifiers = list("melee" = 0.2, "bullet" = 0.2, "laser" = 0, "energy" = 1, "bomb" = 0, "bio" = 0.2, "rad" = 0.2, "fire" = 1, "acid" = 0.2) // yeah ok
/*
Color matrices are like regular colors but unlike with normal colors, you can go over 255 on a channel.
@@ -92,7 +92,7 @@ Unless you know what you're doing, only use the first three numbers. They're in
/datum/material/plasma/on_applied(atom/source, amount, material_flags)
. = ..()
if(ismovableatom(source))
if(ismovable(source))
source.AddElement(/datum/element/firestacker, amount=1)
source.AddComponent(/datum/component/explodable, 0, 0, amount / 2500, amount / 1250)
+17
View File
@@ -63,7 +63,11 @@
var/force_escaped = FALSE // Set by Into The Sunset command of the shuttle manipulator
var/list/learned_recipes //List of learned recipe TYPES.
/// Our skill holder.
var/datum/skill_holder/skill_holder
/datum/mind/New(var/key)
skill_holder = new
src.key = key
soulOwner = src
martial_art = default_martial_art
@@ -511,6 +515,19 @@
message_admins("[key_name_admin(usr)] edited [current]'s objective to [new_objective.explanation_text]")
log_admin("[key_name(usr)] edited [current]'s objective to [new_objective.explanation_text]")
else if(href_list["traitor_class"])
var/static/list/choices
if(!choices)
choices = list()
for(var/C in GLOB.traitor_classes)
var/datum/traitor_class/t = C
choices[initial(t.employer)] = C
var/datum/antagonist/traitor/T = locate(href_list["target_antag"]) in antag_datums
if(T)
var/selected_type = input("Select traitor class:", "Traitor class", T.traitor_kind.employer) as null|anything in choices
selected_type = choices[selected_type]
T.set_traitor_kind(selected_type)
else if (href_list["obj_delete"])
var/datum/objective/objective
+5
View File
@@ -23,6 +23,11 @@
mood_change = 4
timeout = 2 MINUTES
/datum/mood_event/race_drink
description = "<span class='nicegreen'>That drink was made for me!</span>\n"
mood_change = 6
timeout = 5 MINUTES
/datum/mood_event/amazingtaste
description = "<span class='nicegreen'>Amazing taste!</span>\n"
mood_change = 50 //Is this not really high..?
+4
View File
@@ -81,6 +81,7 @@
/datum/mutation/human/dwarfism/on_acquiring(mob/living/carbon/human/owner)
if(..())
return
ADD_TRAIT(owner, TRAIT_DWARF, GENETIC_MUTATION)
owner.transform = owner.transform.Scale(1, 0.8)
passtable_on(owner, GENETIC_MUTATION)
owner.visible_message("<span class='danger'>[owner] suddenly shrinks!</span>", "<span class='notice'>Everything around you seems to grow..</span>")
@@ -88,6 +89,7 @@
/datum/mutation/human/dwarfism/on_losing(mob/living/carbon/human/owner)
if(..())
return
REMOVE_TRAIT(owner, TRAIT_DWARF, GENETIC_MUTATION)
owner.transform = owner.transform.Scale(1, 1.25)
passtable_off(owner, GENETIC_MUTATION)
owner.visible_message("<span class='danger'>[owner] suddenly grows!</span>", "<span class='notice'>Everything around you seems to shrink..</span>")
@@ -339,6 +341,7 @@
/datum/mutation/human/gigantism/on_acquiring(mob/living/carbon/human/owner)
if(..())
return
ADD_TRAIT(owner, TRAIT_GIANT, GENETIC_MUTATION)
owner.resize = 1.25
owner.update_transform()
owner.visible_message("<span class='danger'>[owner] suddenly grows!</span>", "<span class='notice'>Everything around you seems to shrink..</span>")
@@ -346,6 +349,7 @@
/datum/mutation/human/gigantism/on_losing(mob/living/carbon/human/owner)
if(..())
return
REMOVE_TRAIT(owner, TRAIT_GIANT, GENETIC_MUTATION)
owner.resize = 0.8
owner.update_transform()
owner.visible_message("<span class='danger'>[owner] suddenly shrinks!</span>", "<span class='notice'>Everything around you seems to grow..</span>")
+4
View File
@@ -26,3 +26,7 @@
/datum/generecipe/tonguechem
required = "/datum/mutation/human/tongue_spike; /datum/mutation/human/stimmed"
result = TONGUESPIKECHEM
/datum/generecipe/hulk
required = "/datum/mutation/human/strong; /datum/mutation/human/radioactive"
result = HULK
+2 -3
View File
@@ -79,7 +79,7 @@
message = " [message] "
//Time for a friendly game of SS13
message = replacetext(message," stupid "," smart ")
message = replacetext(message," retard "," genius ")
message = replacetext(message," idiot "," genius ")
message = replacetext(message," unrobust "," robust ")
message = replacetext(message," dumb "," smart ")
message = replacetext(message," awful "," great ")
@@ -108,7 +108,6 @@
message = replacetext(message," drink "," liquid ")
message = replacetext(message," feminist "," empowered woman ")
message = replacetext(message," i hate you "," you're a mean ")
message = replacetext(message," jew "," jewish ")
message = replacetext(message," shit "," shiz ")
message = replacetext(message," crap "," poo ")
message = replacetext(message," slut "," tease ")
@@ -263,7 +262,7 @@
message = replacetext(message," thank you "," thank you, thank you very much ")
message = replacetext(message," what are you "," whatcha ")
message = replacetext(message," yes ",pick(" sure", "yea "))
message = replacetext(message," faggot "," square ")
message = replacetext(message," dumbass "," square ")
message = replacetext(message," muh valids "," getting my kicks ")
speech_args[SPEECH_MESSAGE] = trim(message)
+1 -1
View File
@@ -20,7 +20,7 @@
return sqrt(((b.x - a.x) ** 2) + ((b.y - a.y) ** 2))
/proc/angle_between_points(datum/point/a, datum/point/b)
return ATAN2((b.y - a.y), (b.x - a.x))
return arctan((b.y - a.y), (b.x - a.x))
/datum/position //For positions with map x/y/z and pixel x/y so you don't have to return lists. Could use addition/subtraction in the future I guess.
var/x = 0
+1 -1
View File
@@ -38,7 +38,7 @@
if (user.client)
user.client.images += bar
progress = CLAMP(progress, 0, goal)
progress = clamp(progress, 0, goal)
bar.icon_state = "prog_bar_[round(((progress / goal) * 100), 5)]"
if (!shown)
user.client.images += bar
+3 -3
View File
@@ -117,10 +117,10 @@
continue
contam_atoms += thing
var/did_contam = 0
if(length(can_contam))
if(can_contam && contam_atoms.len)
var/rad_strength = ((strength-RAD_MINIMUM_CONTAMINATION) * RAD_CONTAMINATION_STR_COEFFICIENT)/contam_atoms.len
for(var/k in 1 to contam_atoms.len)
var/atom/thing = contam_atoms[k]
for(var/A in contam_atoms)
var/atom/thing = A
thing.AddComponent(/datum/component/radioactive, rad_strength, source)
did_contam = 1
return did_contam
+16
View File
@@ -0,0 +1,16 @@
// yeah yeah verbs suck whatever I suck at this fix this someone please - kevinz000
/mob/verb/check_skills()
set name = "Check Skills"
set category = "IC"
set desc = "Check your skills (if you have any..)"
if(!mind)
to_chat(usr, "<span class='warning'>How do you check the skills of [(usr == src)? "yourself when you are" : "something"] without a mind?</span>")
return
if(!mind.skill_holder)
to_chat(usr, "<span class='warning'>How do you check the skills of [(usr == src)? "yourself when you are" : "something"] without the capability for skills? (PROBABLY A BUG, PRESS F1.)</span>")
return
var/datum/browser/B = new(usr, "skilldisplay_[REF(src)]", "Skills of [src]")
B.set_content(mind.skill_holder.html_readout())
B.open()
+95
View File
@@ -0,0 +1,95 @@
GLOBAL_LIST_INIT(skill_datums, init_skill_datums())
/proc/init_skill_datums()
. = list()
for(var/path in subtypesof(/datum/skill))
var/datum/skill/S = path
if(initial(S.abstract_type) == path)
continue
S = new path
.[S.type] = S
/proc/get_skill_datum(path)
return GLOB.skill_datums[path]
/proc/sanitize_skill_value(path, value)
var/datum/skill/S = get_skill_datum(path)
// don't check, if we runtime let it happen.
return S.sanitize_value(value)
/proc/is_skill_value_greater(path, existing, new_value)
var/datum/skill/S = get_skill_datum(path)
// don't check, if we runtime let it happen.
return S.is_value_greater(existing, new_value)
/**
* Skill datums
*/
/datum/skill
/// Our name
var/name
/// Our description
var/desc
/// Our progression type
var/progression_type
/// Abstract type
var/abstract_type = /datum/skill
/**
* Ensures what someone's setting as a value for this skill is valid.
*/
/datum/skill/proc/sanitize_value(new_value)
return new_value
/**
* Checks if a value is greater
*/
/datum/skill/proc/is_value_greater(existing, new_value)
if(!existing)
return TRUE
return new_value > existing
/**
* Standard value "render"
*/
/datum/skill/proc/standard_render_value(value)
return value
// Just saying, the choice to use different sub-parent-types is to force coders to resolve issues as I won't be implementing custom procs to grab skill levels in a certain context.
// Aka: So people don't forget to change checks if they change a skill's progression type.
/datum/skill/binary
abstract_type = /datum/skill/binary
progression_type = SKILL_PROGRESSION_BINARY
/datum/skill/binary/sanitize_value(new_value)
return new_value? TRUE : FALSE
/datum/skill/binary/standard_render_value(value)
return value? "Yes" : "No"
/datum/skill/numerical
abstract_type = /datum/skill/numerical
progression_type = SKILL_PROGRESSION_NUMERICAL
/// Max value of this skill
var/max_value = 100
/// Min value of this skill
var/min_value = 0
/// Display as a percent in standard_render_value?
var/display_as_percent = FALSE
/datum/skill/numerical/sanitize_value(new_value)
return clamp(new_value, min_value, max_value)
/datum/skill/numerical/standard_render_value(value)
return display_as_percent? "[round(value/max_value/100, 0.01)]%" : "[value] / [max_value]"
/datum/skill/enum
abstract_type = /datum/skill/enum
progression_type = SKILL_PROGRESSION_ENUM
/// Valid values for the skill
var/list/valid_values = list()
/datum/skill/enum/sanitize_value(new_value)
if(new_value in valid_values)
return new_value
+78
View File
@@ -0,0 +1,78 @@
/**
* Skill holder datums
*/
/datum/skill_holder
/// Our list of skills and values. Lazylist. Associative. Keys are datum typepaths to the skill.
var/list/skills
/// Same as [skills] but affinities, which are multiplied to increase amount when gaining skills.
var/list/skill_affinities
/**
* Grabs the value of a skill.
*/
/datum/skill_holder/proc/get_skill_value(skill)
if(!ispath(skill))
CRASH("Invalid get_skill_value call. Use typepaths.") //until a time when we somehow need text ids for dynamic skills, I'm enforcing this.
if(!skills)
return null
return LAZYACCESS(skills, skill)
/**
* Grabs our affinity for a skill. !!This is a multiplier!!
*/
/datum/skill_holder/proc/get_skill_affinity(skill)
if(!ispath(skill))
CRASH("Invalid get_skill_affinity call. Use typepaths.") //until a time when we somehow need text ids for dynamic skills, I'm enforcing this.
if(!skills)
return 1
var/affinity = LAZYACCESS(skill_affinities, skill)
if(isnull(affinity))
return 1
return affinity
/**
* Sets the value of a skill.
*/
/datum/skill_holder/proc/set_skill_value(skill, value)
if(!ispath(skill))
CRASH("Invalid set_skill_value call. Use typepaths.") //until a time when we somehow need text ids for dynamic skills, I'm enforcing this.
LAZYINITLIST(skills)
value = sanitize_skill_value(skill, value)
if(!isnull(value))
LAZYSET(skills, skill, value)
return TRUE
return FALSE
/**
* Boosts a skill to a value if not aobve
*/
/datum/skill_holder/proc/boost_skill_value_to(skill, value)
var/current = get_skill_value(skill)
if(!is_skill_value_greater(skill, current, value))
return FALSE
set_skill_value(skill, value)
return TRUE
/**
* Automatic skill increase, multiplied by skill affinity if existing.
* Only works if skill is numerical.
*/
/datum/skill_holder/proc/auto_gain_experience(skill, value)
if(!ispath(skill, /datum/skill/numerical))
CRASH("You cannot auto increment a non numerical skill!")
var/current = get_skill_value(skill)
var/affinity = get_skill_affinity(skill)
boost_skill_value_to(skill, current + (value * affinity))
/**
* Generates a HTML readout of our skills.
* Port to tgui-next when?
*/
/datum/skill_holder/proc/html_readout()
var/list/out = list("<center><h1>Skills</h1></center><hr>")
out += "<table style=\"width:100%\"><tr><th><b>Skill</b><th><b>Value</b></tr>"
for(var/path in skills)
var/datum/skill/S = GLOB.skill_datums[path]
out += "<tr><td>[S.name]</td><td>[S.standard_render_value(skills[path])]</td></tr>"
out += "</table>"
return out.Join("")
+3
View File
@@ -0,0 +1,3 @@
/datum/skill/numerical/surgery
name = "Surgery"
desc = "How proficient you are at doing surgery."
+27
View File
@@ -550,3 +550,30 @@
else if(isanimal(L))
var/mob/living/simple_animal/SM = L
SM.adjustHealth(-3.5, forced = TRUE)
/obj/screen/alert/status_effect/regenerative_core
name = "Reinforcing Tendrils"
desc = "You can move faster than your broken body could normally handle!"
icon_state = "regenerative_core"
name = "Regenerative Core Tendrils"
/datum/status_effect/regenerative_core
id = "Regenerative Core"
duration = 1 MINUTES
status_type = STATUS_EFFECT_REPLACE
alert_type = /obj/screen/alert/status_effect/regenerative_core
/datum/status_effect/regenerative_core/on_apply()
. = ..()
ADD_TRAIT(owner, TRAIT_IGNOREDAMAGESLOWDOWN, "regenerative_core")
owner.adjustBruteLoss(-25)
if(!AmBloodsucker(owner)) //use your coffin you lazy bastard
owner.adjustFireLoss(-25)
owner.remove_CC()
owner.bodytemperature = BODYTEMP_NORMAL
return TRUE
/datum/status_effect/regenerative_core/on_remove()
. = ..()
REMOVE_TRAIT(owner, TRAIT_IGNOREDAMAGESLOWDOWN, "regenerative_core")
owner.updatehealth()
+18 -16
View File
@@ -113,19 +113,24 @@
duration = set_duration
. = ..()
/datum/status_effect/no_combat_mode/mesmerize
/datum/status_effect/mesmerize
id = "Mesmerize"
alert_type = /obj/screen/alert/status_effect/mesmerized
/datum/status_effect/no_combat_mode/mesmerize/on_creation(mob/living/new_owner, set_duration)
/datum/status_effect/mesmerize/on_creation(mob/living/new_owner, set_duration)
. = ..()
ADD_TRAIT(owner, TRAIT_MUTE, "mesmerize")
owner.add_movespeed_modifier("[STATUS_EFFECT_MESMERIZE]_[id]", TRUE, priority = 64, override = TRUE, multiplicative_slowdown = 5, blacklisted_movetypes = FALSE? NONE : CRAWLING)
owner.add_movespeed_modifier(/datum/movespeed_modifier/status_effect/mesmerize)
/datum/status_effect/no_combat_mode/mesmerize/on_remove()
/datum/status_effect/mesmerize/on_remove()
. = ..()
REMOVE_TRAIT(owner, TRAIT_MUTE, "mesmerize")
owner.remove_movespeed_modifier("[STATUS_EFFECT_MESMERIZE]_[id]")
owner.remove_movespeed_modifier(/datum/movespeed_modifier/status_effect/mesmerize)
/datum/status_effect/mesmerize/on_creation(mob/living/new_owner, set_duration)
if(isnum(set_duration))
duration = set_duration
. = ..()
/obj/screen/alert/status_effect/mesmerized
name = "Mesmerized"
@@ -136,9 +141,7 @@
/datum/status_effect/electrode
id = "tased"
alert_type = null
var/slowdown = 1.5
var/slowdown_priority = 50 //to make sure the stronger effect overrides
var/affect_crawl = FALSE
var/movespeed_mod = /datum/movespeed_modifier/status_effect/tased
var/nextmove_modifier = 1
var/stamdmg_per_ds = 0 //a 20 duration would do 20 stamdmg, disablers do 24 or something
var/last_tick = 0 //fastprocess processing speed is a goddamn sham, don't trust it.
@@ -150,12 +153,12 @@
last_tick = world.time
if(iscarbon(owner))
var/mob/living/carbon/C = owner
C.add_movespeed_modifier("[MOVESPEED_ID_TASED_STATUS]_[id]", TRUE, priority = slowdown_priority, override = TRUE, multiplicative_slowdown = slowdown, blacklisted_movetypes = affect_crawl? NONE : CRAWLING)
C.add_movespeed_modifier(movespeed_mod)
/datum/status_effect/electrode/on_remove()
if(iscarbon(owner))
var/mob/living/carbon/C = owner
C.remove_movespeed_modifier("[MOVESPEED_ID_TASED_STATUS]_[id]")
C.remove_movespeed_modifier(movespeed_mod)
. = ..()
/datum/status_effect/electrode/tick()
@@ -173,8 +176,7 @@
/datum/status_effect/electrode/no_combat_mode
id = "tased_strong"
slowdown = 8
slowdown_priority = 100
movespeed_mod = /datum/movespeed_modifier/status_effect/tased/no_combat_mode
nextmove_modifier = 2
blocks_combatmode = TRUE
stamdmg_per_ds = 1
@@ -331,7 +333,7 @@
if(prob(severity * 0.15))
to_chat(owner, "<span class='sevtug[span_part]'>\"[text2ratvar(pick(mania_messages))]\"</span>")
owner.playsound_local(get_turf(motor), hum, severity, 1)
owner.adjust_drugginess(CLAMP(max(severity * 0.075, 1), 0, max(0, 50 - owner.druggy))) //7.5% of severity per second, minimum 1
owner.adjust_drugginess(clamp(max(severity * 0.075, 1), 0, max(0, 50 - owner.druggy))) //7.5% of severity per second, minimum 1
if(owner.hallucination < 50)
owner.hallucination = min(owner.hallucination + max(severity * 0.075, 1), 50) //7.5% of severity per second, minimum 1
if(owner.dizziness < 50)
@@ -589,7 +591,7 @@
old_health = owner.health
if(!old_oxyloss)
old_oxyloss = owner.getOxyLoss()
var/health_difference = old_health - owner.health - CLAMP(owner.getOxyLoss() - old_oxyloss,0, owner.getOxyLoss())
var/health_difference = old_health - owner.health - clamp(owner.getOxyLoss() - old_oxyloss,0, owner.getOxyLoss())
if(!health_difference)
return
owner.visible_message("<span class='warning'>The light in [owner]'s eyes dims as [owner.p_theyre()] harmed!</span>", \
@@ -645,11 +647,11 @@
if(isnum(set_duration))
duration = set_duration
. = ..()
owner.add_movespeed_modifier(MOVESPEED_ID_ELECTROSTAFF, multiplicative_slowdown = 1, movetypes = GROUND)
owner.add_movespeed_modifier(/datum/movespeed_modifier/status_effect/electrostaff)
/datum/status_effect/electrostaff/on_remove()
. = ..()
owner.remove_movespeed_modifier(MOVESPEED_ID_ELECTROSTAFF)
owner.remove_movespeed_modifier(/datum/movespeed_modifier/status_effect/electrostaff)
//GOLEM GANG
-1
View File
@@ -38,7 +38,6 @@
..()
if(!istype(holder, holder_type))
CRASH("Wire holder is not of the expected type!")
return
src.holder = holder
if(randomize)
-48
View File
@@ -1,48 +0,0 @@
/datum/wires/autoylathe
holder_type = /obj/machinery/autoylathe
proper_name = "Autoylathe"
/datum/wires/autoylathe/New(atom/holder)
wires = list(
WIRE_HACK, WIRE_DISABLE,
WIRE_SHOCK, WIRE_ZAP
)
add_duds(6)
..()
/datum/wires/autoylathe/interactable(mob/user)
var/obj/machinery/autoylathe/A = holder
if(A.panel_open)
return TRUE
/datum/wires/autoylathe/get_status()
var/obj/machinery/autoylathe/A = holder
var/list/status = list()
status += "The red light is [A.disabled ? "on" : "off"]."
status += "The blue light is [A.hacked ? "on" : "off"]."
return status
/datum/wires/autoylathe/on_pulse(wire)
var/obj/machinery/autoylathe/A = holder
switch(wire)
if(WIRE_HACK)
A.adjust_hacked(!A.hacked)
addtimer(CALLBACK(A, /obj/machinery/autoylathe.proc/reset, wire), 60)
if(WIRE_SHOCK)
A.shocked = !A.shocked
addtimer(CALLBACK(A, /obj/machinery/autoylathe.proc/reset, wire), 60)
if(WIRE_DISABLE)
A.disabled = !A.disabled
addtimer(CALLBACK(A, /obj/machinery/autoylathe.proc/reset, wire), 60)
/datum/wires/autoylathe/on_cut(wire, mend)
var/obj/machinery/autoylathe/A = holder
switch(wire)
if(WIRE_HACK)
A.adjust_hacked(!mend)
if(WIRE_HACK)
A.shocked = !mend
if(WIRE_DISABLE)
A.disabled = !mend
if(WIRE_ZAP)
A.shock(usr, 50)
+1 -1
View File
@@ -169,7 +169,7 @@
.["real_mode"] = SSticker.mode.name
// Key-authed callers may know the truth behind the "secret"
.["security_level"] = get_security_level()
.["security_level"] = NUM2SECLEVEL(GLOB.security_level)
.["round_duration"] = SSticker ? round((world.time-SSticker.round_start_time)/10) : 0
// Amount of world's ticks in seconds, useful for calculating round duration