Merge branch 'master' of https://github.com/Citadel-Station-13/Citadel-Station-13 into proc-define-shit
This commit is contained in:
@@ -50,7 +50,7 @@
|
||||
)
|
||||
if(!Q.Execute(async = TRUE))
|
||||
qdel(Q)
|
||||
return 0
|
||||
return FALSE
|
||||
var/result = 0
|
||||
if(Q.NextRow())
|
||||
result = text2num(Q.item[1])
|
||||
|
||||
+241
-123
@@ -11,11 +11,10 @@
|
||||
var/check_flags = 0
|
||||
var/required_mobility_flags = MOBILITY_USE
|
||||
var/processing = FALSE
|
||||
var/atom/movable/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.
|
||||
/// Where any buttons we create should be by default. Accepts screen_loc and location defines
|
||||
var/default_button_position = SCRN_OBJ_IN_LIST
|
||||
|
||||
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
|
||||
@@ -28,12 +27,6 @@
|
||||
|
||||
/datum/action/New(Target)
|
||||
link_to(Target)
|
||||
button = new
|
||||
button.linked_action = src
|
||||
button.name = name
|
||||
button.actiontooltipstyle = buttontooltipstyle
|
||||
if(desc)
|
||||
button.desc = desc
|
||||
|
||||
/datum/action/proc/link_to(Target)
|
||||
target = Target
|
||||
@@ -43,51 +36,42 @@
|
||||
if(owner)
|
||||
Remove(owner)
|
||||
target = null
|
||||
QDEL_NULL(button)
|
||||
QDEL_LIST_ASSOC_VAL(viewers) // Qdel the buttons in the viewers list **NOT THE HUDS**
|
||||
return ..()
|
||||
|
||||
/datum/action/proc/Grant(mob/M)
|
||||
if(M)
|
||||
if(owner)
|
||||
if(owner == M)
|
||||
return
|
||||
Remove(owner)
|
||||
owner = M
|
||||
|
||||
//button id generation
|
||||
var/counter = 0
|
||||
var/bitfield = 0
|
||||
for(var/datum/action/A in M.actions)
|
||||
if(A.name == name && A.button.id)
|
||||
counter += 1
|
||||
bitfield |= A.button.id
|
||||
bitfield = ~bitfield
|
||||
var/bitflag = 1
|
||||
for(var/i in 1 to (counter + 1))
|
||||
if(bitfield & bitflag)
|
||||
button.id = bitflag
|
||||
break
|
||||
bitflag *= 2
|
||||
|
||||
M.actions += src
|
||||
if(M.client)
|
||||
M.client.screen += button
|
||||
button.locked = M.client.prefs.buttons_locked || button.id ? M.client.prefs.action_buttons_screen_locs["[name]_[button.id]"] : FALSE //even if it's not defaultly locked we should remember we locked it before
|
||||
button.moved = button.id ? M.client.prefs.action_buttons_screen_locs["[name]_[button.id]"] : FALSE
|
||||
M.update_action_buttons()
|
||||
else
|
||||
if(!M)
|
||||
Remove(owner)
|
||||
return
|
||||
if(owner)
|
||||
if(owner == M)
|
||||
return
|
||||
Remove(owner)
|
||||
owner = M
|
||||
RegisterSignal(owner, COMSIG_PARENT_QDELETING, .proc/clear_ref, override = TRUE)
|
||||
|
||||
GiveAction(M)
|
||||
|
||||
/datum/action/proc/clear_ref(datum/ref)
|
||||
SIGNAL_HANDLER
|
||||
if(ref == owner)
|
||||
Remove(owner)
|
||||
if(ref == target)
|
||||
qdel(src)
|
||||
|
||||
/datum/action/proc/Remove(mob/M)
|
||||
if(M)
|
||||
if(M.client)
|
||||
M.client.screen -= button
|
||||
M.actions -= src
|
||||
M.update_action_buttons()
|
||||
owner = null
|
||||
button.moved = FALSE //so the button appears in its normal position when given to another owner.
|
||||
button.locked = FALSE
|
||||
button.id = null
|
||||
for(var/datum/hud/hud in viewers)
|
||||
if(!hud.mymob)
|
||||
continue
|
||||
HideFrom(hud.mymob)
|
||||
LAZYREMOVE(M.actions, src) // We aren't always properly inserted into the viewers list, gotta make sure that action's cleared
|
||||
viewers = list()
|
||||
|
||||
if(owner)
|
||||
UnregisterSignal(owner, COMSIG_PARENT_QDELETING)
|
||||
if(target == owner)
|
||||
RegisterSignal(target, COMSIG_PARENT_QDELETING, .proc/clear_ref)
|
||||
owner = null
|
||||
|
||||
/datum/action/proc/Trigger()
|
||||
if(!IsAvailable())
|
||||
@@ -125,15 +109,15 @@
|
||||
/datum/action/proc/UpdateButtons(status_only, force)
|
||||
for(var/datum/hud/hud in viewers)
|
||||
var/atom/movable/screen/movable/button = viewers[hud]
|
||||
UpdateButtonIcon(button, status_only, force)
|
||||
UpdateButton(button, status_only, force)
|
||||
|
||||
/datum/action/proc/UpdateButtonIcon(status_only = FALSE, force = FALSE)
|
||||
/datum/action/proc/UpdateButton(atom/movable/screen/movable/action_button/button, status_only = FALSE, force = FALSE)
|
||||
if(!button)
|
||||
return
|
||||
if(!status_only)
|
||||
button.name = name
|
||||
button.desc = desc
|
||||
if(owner && owner.hud_used && background_icon_state == ACTION_BUTTON_DEFAULT_BACKGROUND)
|
||||
if(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"]
|
||||
@@ -145,25 +129,13 @@
|
||||
if(button.icon_state != background_icon_state)
|
||||
button.icon_state = background_icon_state
|
||||
|
||||
if(!use_target_appearance)
|
||||
ApplyIcon(button, force)
|
||||
|
||||
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
|
||||
ApplyIcon(button, force)
|
||||
|
||||
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
|
||||
return TRUE
|
||||
|
||||
/datum/action/proc/ApplyIcon(atom/movable/screen/movable/action_button/current_button, force = FALSE)
|
||||
if(icon_icon && button_icon_state && ((current_button.button_icon_state != button_icon_state) || force))
|
||||
@@ -179,25 +151,82 @@
|
||||
|
||||
/datum/action/ghost/Trigger()
|
||||
if(!..())
|
||||
return 0
|
||||
return FALSE
|
||||
var/mob/M = target
|
||||
M.ghostize(can_reenter_corpse = TRUE, voluntary = TRUE)
|
||||
|
||||
/datum/action/proc/OnUpdatedIcon()
|
||||
addtimer(CALLBACK(src, PROC_REF(UpdateButtonIcon)), 1) //Hopefully runs after new icon overlays have been compiled.
|
||||
SIGNAL_HANDLER
|
||||
UpdateButtons(force = TRUE)
|
||||
|
||||
//Give our action button to the player
|
||||
/datum/action/proc/GiveAction(mob/viewer)
|
||||
var/datum/hud/our_hud = viewer.hud_used
|
||||
if(viewers[our_hud]) // Already have a copy of us? go away
|
||||
return
|
||||
|
||||
LAZYOR(viewer.actions, src) // Move this in
|
||||
ShowTo(viewer)
|
||||
|
||||
//Adds our action button to the screen of a player
|
||||
/datum/action/proc/ShowTo(mob/viewer)
|
||||
var/datum/hud/our_hud = viewer.hud_used
|
||||
if(!our_hud || viewers[our_hud]) // There's no point in this if you have no hud in the first place
|
||||
return
|
||||
|
||||
var/atom/movable/screen/movable/action_button/button = CreateButton()
|
||||
SetId(button, viewer)
|
||||
|
||||
button.our_hud = our_hud
|
||||
viewers[our_hud] = button
|
||||
if(viewer.client)
|
||||
viewer.client.screen += button
|
||||
|
||||
button.load_position(viewer)
|
||||
viewer.update_action_buttons()
|
||||
|
||||
//Removes our action button from the screen of a player
|
||||
/datum/action/proc/HideFrom(mob/viewer)
|
||||
var/datum/hud/our_hud = viewer.hud_used
|
||||
var/atom/movable/screen/movable/action_button/button = viewers[our_hud]
|
||||
LAZYREMOVE(viewer.actions, src)
|
||||
if(button)
|
||||
qdel(button)
|
||||
|
||||
/datum/action/proc/CreateButton()
|
||||
var/atom/movable/screen/movable/action_button/button = new()
|
||||
button.linked_action = src
|
||||
button.actiontooltipstyle = buttontooltipstyle
|
||||
if(desc)
|
||||
button.desc = desc
|
||||
return button
|
||||
|
||||
/datum/action/proc/SetId(atom/movable/screen/movable/action_button/our_button, mob/owner)
|
||||
//button id generation
|
||||
var/bitfield = 0
|
||||
for(var/datum/action/action in owner.actions)
|
||||
if(action == src) // This could be us, which is dumb
|
||||
continue
|
||||
var/atom/movable/screen/movable/action_button/button = action.viewers[owner.hud_used]
|
||||
if(action.name == name && button.id)
|
||||
bitfield |= button.id
|
||||
|
||||
bitfield = ~bitfield // Flip our possible ids, so we can check if we've found a unique one
|
||||
for(var/i in 0 to 23) // We get 24 possible bitflags in dm
|
||||
var/bitflag = 1 << i // Shift us over one
|
||||
if(bitfield & bitflag)
|
||||
our_button.id = bitflag
|
||||
return
|
||||
|
||||
//Presets for item actions
|
||||
/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
|
||||
|
||||
/datum/action/item_action/New(Target)
|
||||
..()
|
||||
if(button_icon_state)
|
||||
use_target_appearance = FALSE
|
||||
var/obj/item/I = target
|
||||
LAZYINITLIST(I.actions)
|
||||
I.actions += src
|
||||
@@ -208,17 +237,41 @@
|
||||
UNSETEMPTY(I.actions)
|
||||
return ..()
|
||||
|
||||
/datum/action/item_action/Trigger()
|
||||
if(!..())
|
||||
return 0
|
||||
/datum/action/item_action/Trigger(trigger_flags)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return FALSE
|
||||
if(target)
|
||||
var/obj/item/I = target
|
||||
I.ui_action_click(owner, src)
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/datum/action/item_action/ApplyIcon(atom/movable/screen/movable/action_button/current_button, force)
|
||||
var/obj/item/item_target = target
|
||||
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 != item_target.appearance) || force) //replace with /ref comparison if this is not valid.
|
||||
var/old_layer = item_target.layer
|
||||
var/old_plane = item_target.plane
|
||||
item_target.layer = FLOAT_LAYER //AAAH
|
||||
item_target.plane = FLOAT_PLANE //^ what that guy said
|
||||
current_button.filters = null
|
||||
current_button.cut_overlays()
|
||||
current_button.add_overlay(item_target)
|
||||
item_target.layer = old_layer
|
||||
item_target.plane = old_plane
|
||||
current_button.appearance_cache = item_target.appearance
|
||||
|
||||
/datum/action/item_action/toggle_light
|
||||
name = "Toggle Light"
|
||||
|
||||
/datum/action/item_action/toggle_light/pda/Trigger(trigger_flags)
|
||||
if(istype(target, /obj/item/pda))
|
||||
var/obj/item/pda/P = target
|
||||
return P.toggle_light(owner)
|
||||
|
||||
/datum/action/item_action/toggle_hood
|
||||
name = "Toggle Hood"
|
||||
|
||||
@@ -258,12 +311,14 @@
|
||||
/datum/action/item_action/set_internals
|
||||
name = "Set Internals"
|
||||
|
||||
/datum/action/item_action/set_internals/UpdateButtonIcon(status_only = FALSE, force)
|
||||
if(..()) //button available
|
||||
if(iscarbon(owner))
|
||||
var/mob/living/carbon/C = owner
|
||||
if(target == C.internal)
|
||||
button.icon_state = "template_active"
|
||||
/datum/action/item_action/set_internals/UpdateButton(atom/movable/screen/movable/action_button/button, status_only = FALSE, force)
|
||||
if(!..()) // no button available
|
||||
return
|
||||
if(!iscarbon(owner))
|
||||
return
|
||||
var/mob/living/carbon/C = owner
|
||||
if(target == C.internal)
|
||||
button.icon_state = "template_active"
|
||||
|
||||
/datum/action/item_action/pick_color
|
||||
name = "Choose A Color"
|
||||
@@ -309,9 +364,9 @@
|
||||
|
||||
/datum/action/item_action/toggle_unfriendly_fire/Trigger()
|
||||
if(..())
|
||||
UpdateButtonIcon()
|
||||
UpdateButtons()
|
||||
|
||||
/datum/action/item_action/toggle_unfriendly_fire/UpdateButtonIcon(status_only = FALSE, force)
|
||||
/datum/action/item_action/toggle_unfriendly_fire/UpdateButton(atom/movable/screen/movable/action_button/button, status_only = FALSE, force)
|
||||
if(istype(target, /obj/item/hierophant_club))
|
||||
var/obj/item/hierophant_club/H = target
|
||||
if(H.friendly_fire_check)
|
||||
@@ -332,7 +387,7 @@
|
||||
if(istype(target, /obj/item/hierophant_club))
|
||||
var/obj/item/hierophant_club/H = target
|
||||
if(H.teleporting)
|
||||
return 0
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/datum/action/item_action/clock
|
||||
@@ -342,7 +397,7 @@
|
||||
|
||||
/datum/action/item_action/clock/IsAvailable(silent = FALSE)
|
||||
if(!is_servant_of_ratvar(owner))
|
||||
return 0
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/datum/action/item_action/clock/toggle_visor
|
||||
@@ -351,11 +406,11 @@
|
||||
|
||||
/datum/action/item_action/clock/toggle_visor/IsAvailable(silent = FALSE)
|
||||
if(!is_servant_of_ratvar(owner))
|
||||
return 0
|
||||
return FALSE
|
||||
if(istype(target, /obj/item/clothing/glasses/judicial_visor))
|
||||
var/obj/item/clothing/glasses/judicial_visor/V = target
|
||||
if(V.recharging)
|
||||
return 0
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/datum/action/item_action/clock/hierophant
|
||||
@@ -366,7 +421,6 @@
|
||||
/datum/action/item_action/clock/quickbind
|
||||
name = "Quickbind"
|
||||
desc = "If you're seeing this, file a bug report."
|
||||
use_target_appearance = FALSE
|
||||
var/scripture_index = 0 //the index of the scripture we're associated with
|
||||
|
||||
/datum/action/item_action/toggle_helmet_flashlight
|
||||
@@ -380,7 +434,6 @@
|
||||
/datum/action/item_action/toggle/New(Target)
|
||||
..()
|
||||
name = "Toggle [target.name]"
|
||||
button.name = name
|
||||
|
||||
/datum/action/item_action/halt
|
||||
name = "HALT!"
|
||||
@@ -409,7 +462,6 @@
|
||||
/datum/action/item_action/adjust/New(Target)
|
||||
..()
|
||||
name = "Adjust [target.name]"
|
||||
button.name = name
|
||||
|
||||
/datum/action/item_action/switch_hud
|
||||
name = "Switch HUD"
|
||||
@@ -432,7 +484,7 @@
|
||||
/datum/action/item_action/jetpack_stabilization/IsAvailable(silent = FALSE)
|
||||
var/obj/item/tank/jetpack/J = target
|
||||
if(!istype(J) || !J.on)
|
||||
return 0
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/datum/action/item_action/hands_free
|
||||
@@ -464,7 +516,7 @@
|
||||
else
|
||||
owner.research_scanner--
|
||||
to_chat(owner, "<span class='notice'>[target] research scanner has been [active ? "activated" : "deactivated"].</span>")
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/datum/action/item_action/toggle_research_scanner/Remove(mob/M)
|
||||
if(owner && active)
|
||||
@@ -489,18 +541,16 @@
|
||||
/datum/action/item_action/organ_action/IsAvailable(silent = FALSE)
|
||||
var/obj/item/organ/I = target
|
||||
if(!I.owner)
|
||||
return 0
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/datum/action/item_action/organ_action/toggle/New(Target)
|
||||
..()
|
||||
name = "Toggle [target.name]"
|
||||
button.name = name
|
||||
|
||||
/datum/action/item_action/organ_action/use/New(Target)
|
||||
..()
|
||||
name = "Use [target.name]"
|
||||
button.name = name
|
||||
|
||||
/datum/action/item_action/cult_dagger
|
||||
name = "Draw Blood Rune"
|
||||
@@ -509,14 +559,13 @@
|
||||
button_icon_state = "draw"
|
||||
buttontooltipstyle = "cult"
|
||||
background_icon_state = "bg_demon"
|
||||
default_button_position = "6:157,4:-2"
|
||||
|
||||
/datum/action/item_action/cult_dagger/Grant(mob/M)
|
||||
if(iscultist(M))
|
||||
..()
|
||||
button.screen_loc = "6:157,4:-2"
|
||||
button.moved = "6:157,4:-2"
|
||||
else
|
||||
if(!iscultist(M))
|
||||
Remove(owner)
|
||||
return
|
||||
return ..()
|
||||
|
||||
/datum/action/item_action/cult_dagger/Trigger()
|
||||
for(var/obj/item/H in owner.held_items) //In case we were already holding another dagger
|
||||
@@ -643,7 +692,6 @@
|
||||
icon_icon = S.action_icon
|
||||
button_icon_state = S.action_icon_state
|
||||
background_icon_state = S.action_background_icon_state
|
||||
button.name = name
|
||||
|
||||
/datum/action/spell_action/Destroy()
|
||||
var/obj/effect/proc_holder/S = target
|
||||
@@ -693,12 +741,12 @@
|
||||
|
||||
/datum/action/innate/Trigger()
|
||||
if(!..())
|
||||
return 0
|
||||
return FALSE
|
||||
if(!active)
|
||||
Activate()
|
||||
else
|
||||
Deactivate()
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/datum/action/innate/proc/Activate()
|
||||
return
|
||||
@@ -711,44 +759,114 @@
|
||||
/datum/action/cooldown
|
||||
check_flags = 0
|
||||
transparent_when_unavailable = FALSE
|
||||
// The default cooldown applied when StartCooldown() is called
|
||||
var/cooldown_time = 0
|
||||
// The actual next time this ability can be used
|
||||
var/next_use_time = 0
|
||||
// Whether or not you want the cooldown for the ability to display in text form
|
||||
var/text_cooldown = TRUE
|
||||
// Setting for intercepting clicks before activating the ability
|
||||
var/click_to_activate = FALSE
|
||||
// Shares cooldowns with other cooldown abilities of the same value, not active if null
|
||||
var/shared_cooldown
|
||||
|
||||
/datum/action/cooldown/New()
|
||||
..()
|
||||
/datum/action/cooldown/CreateButton()
|
||||
var/atom/movable/screen/movable/action_button/button = ..()
|
||||
button.maptext = ""
|
||||
button.maptext_x = 8
|
||||
button.maptext_y = 0
|
||||
button.maptext_width = 24
|
||||
button.maptext_height = 12
|
||||
return button
|
||||
|
||||
/datum/action/cooldown/IsAvailable(silent = FALSE)
|
||||
return next_use_time <= world.time
|
||||
/datum/action/cooldown/IsAvailable()
|
||||
return ..() && (next_use_time <= world.time)
|
||||
|
||||
/datum/action/cooldown/proc/StartCooldown()
|
||||
next_use_time = world.time + cooldown_time
|
||||
button.maptext = "<b>[round(cooldown_time/10, 0.1)]</b>"
|
||||
UpdateButtonIcon()
|
||||
/// Starts a cooldown time to be shared with similar abilities, will use default cooldown time if an override is not specified
|
||||
/datum/action/cooldown/proc/StartCooldown(override_cooldown_time)
|
||||
if(shared_cooldown)
|
||||
for(var/datum/action/cooldown/shared_ability in owner.actions - src)
|
||||
if(shared_cooldown == shared_ability.shared_cooldown)
|
||||
if(isnum(override_cooldown_time))
|
||||
shared_ability.StartCooldownSelf(override_cooldown_time)
|
||||
else
|
||||
shared_ability.StartCooldownSelf(cooldown_time)
|
||||
StartCooldownSelf(override_cooldown_time)
|
||||
|
||||
/// Starts a cooldown time for this ability only, will use default cooldown time if an override is not specified
|
||||
/datum/action/cooldown/proc/StartCooldownSelf(override_cooldown_time)
|
||||
if(isnum(override_cooldown_time))
|
||||
next_use_time = world.time + override_cooldown_time
|
||||
else
|
||||
next_use_time = world.time + cooldown_time
|
||||
UpdateButtons()
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
|
||||
/datum/action/cooldown/process()
|
||||
/datum/action/cooldown/Trigger(trigger_flags, atom/target)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return
|
||||
if(!owner)
|
||||
return FALSE
|
||||
if(click_to_activate)
|
||||
if(target)
|
||||
// For automatic / mob handling
|
||||
return InterceptClickOn(owner, null, target)
|
||||
if(owner.click_intercept == src)
|
||||
owner.click_intercept = null
|
||||
else
|
||||
owner.click_intercept = src
|
||||
for(var/datum/action/cooldown/ability in owner.actions)
|
||||
ability.UpdateButtons()
|
||||
return TRUE
|
||||
return PreActivate(owner)
|
||||
|
||||
/// Intercepts client owner clicks to activate the ability
|
||||
/datum/action/cooldown/proc/InterceptClickOn(mob/living/caller, params, atom/target)
|
||||
if(!IsAvailable())
|
||||
return FALSE
|
||||
if(!target)
|
||||
return FALSE
|
||||
PreActivate(target)
|
||||
caller.click_intercept = null
|
||||
return TRUE
|
||||
|
||||
/// For signal calling
|
||||
/datum/action/cooldown/proc/PreActivate(atom/target)
|
||||
if(SEND_SIGNAL(owner, COMSIG_MOB_ABILITY_STARTED, src) & COMPONENT_BLOCK_ABILITY_START)
|
||||
return
|
||||
. = Activate(target)
|
||||
SEND_SIGNAL(owner, COMSIG_MOB_ABILITY_FINISHED, src)
|
||||
|
||||
/// To be implemented by subtypes
|
||||
/datum/action/cooldown/proc/Activate(atom/target)
|
||||
return
|
||||
|
||||
/datum/action/cooldown/UpdateButton(atom/movable/screen/movable/action_button/button, status_only = FALSE, force = FALSE)
|
||||
. = ..()
|
||||
if(!button)
|
||||
return
|
||||
var/time_left = max(next_use_time - world.time, 0)
|
||||
if(text_cooldown)
|
||||
button.maptext = MAPTEXT("<b>[round(time_left/10, 0.1)]</b>")
|
||||
if(!owner || time_left == 0)
|
||||
button.maptext = ""
|
||||
if(IsAvailable() && owner.click_intercept == src)
|
||||
button.color = COLOR_GREEN
|
||||
|
||||
/datum/action/cooldown/process()
|
||||
var/time_left = max(next_use_time - world.time, 0)
|
||||
if(!owner || time_left == 0)
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
var/timeleft = max(next_use_time - world.time, 0)
|
||||
if(timeleft == 0)
|
||||
button.maptext = ""
|
||||
UpdateButtonIcon()
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
else
|
||||
button.maptext = "<b>[round(timeleft/10, 0.1)]</b>"
|
||||
UpdateButtons()
|
||||
|
||||
/datum/action/cooldown/Grant(mob/M)
|
||||
..()
|
||||
if(owner)
|
||||
UpdateButtonIcon()
|
||||
if(next_use_time > world.time)
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
if(!owner)
|
||||
return
|
||||
UpdateButtons()
|
||||
if(next_use_time > world.time)
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
|
||||
//surf_ss13
|
||||
/datum/action/item_action/bhop
|
||||
@@ -841,7 +959,7 @@
|
||||
target.plane = old_plane
|
||||
current_button.appearance_cache = target.appearance
|
||||
|
||||
/proc/get_action_of_type(mob/M, var/action_type)
|
||||
/proc/get_action_of_type(mob/M, action_type)
|
||||
if(!M.actions || !ispath(action_type, /datum/action))
|
||||
return
|
||||
for(var/datum/action/A in M.actions)
|
||||
|
||||
@@ -225,7 +225,7 @@
|
||||
name = "Hide"
|
||||
desc = "Hide yourself from your owner's sight."
|
||||
button_icon_state = "hide"
|
||||
UpdateButtonIcon()
|
||||
UpdateButtons()
|
||||
|
||||
/datum/action/innate/imaginary_hide/Activate()
|
||||
var/mob/camera/imaginary_friend/I = owner
|
||||
|
||||
@@ -130,7 +130,9 @@
|
||||
var/tgt_color = extra_classes.Find("italics") ? target.chat_color_darkened : target.chat_color
|
||||
|
||||
var/complete_text = "<span class='center maptext [extra_classes.Join(" ")]' style='color: [tgt_color]'>[owner.say_emphasis(text)]</span>"
|
||||
var/mheight = WXH_TO_HEIGHT(owned_by.MeasureText(complete_text, null, CHAT_MESSAGE_WIDTH))
|
||||
|
||||
var/mheight
|
||||
WXH_TO_HEIGHT(owned_by.MeasureText(complete_text, null, CHAT_MESSAGE_WIDTH), mheight)
|
||||
approx_lines = max(1, mheight / CHAT_MESSAGE_APPROX_LHEIGHT)
|
||||
|
||||
// Translate any existing messages upwards, apply exponential decay factors to timers
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
/datum/component/personal_crafting/Initialize()
|
||||
if(ismob(parent))
|
||||
RegisterSignal(parent, COMSIG_MOB_CLIENT_LOGIN, PROC_REF(create_mob_button))
|
||||
RegisterSignal(parent, COMSIG_MOB_HUD_CREATED, PROC_REF(create_mob_button))
|
||||
|
||||
/datum/component/personal_crafting/proc/create_mob_button(mob/user, client/CL)
|
||||
/datum/component/personal_crafting/proc/create_mob_button(mob/user)
|
||||
var/datum/hud/H = user.hud_used
|
||||
for(var/huds in H.static_inventory)
|
||||
if(istype(huds, /atom/movable/screen/craft))
|
||||
return
|
||||
//We don't want to be stacking multiple crafting huds on relogs
|
||||
var/atom/movable/screen/craft/C = new()
|
||||
C.icon = H.ui_style
|
||||
H.static_inventory += C
|
||||
CL.screen += C
|
||||
user.client.screen += C
|
||||
RegisterSignal(C, COMSIG_CLICK, PROC_REF(component_ui_interact))
|
||||
|
||||
/datum/component/personal_crafting
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
return
|
||||
if(LAZYACCESS(modifiers, ALT_CLICK))
|
||||
return
|
||||
if(source.mob.in_throw_mode)
|
||||
if(source.mob.throw_mode)
|
||||
return
|
||||
if(!isturf(source.mob.loc)) //No firing inside lockers and stuff.
|
||||
return
|
||||
|
||||
@@ -328,9 +328,9 @@
|
||||
/// For spawning mineral sheets at a specific location. Used by machines to output sheets.
|
||||
/datum/component/material_container/proc/retrieve_sheets(sheet_amt, var/datum/material/M, target = null)
|
||||
if(!M.sheet_type)
|
||||
return 0 //Add greyscale sheet handling here later
|
||||
return FALSE //Add greyscale sheet handling here later
|
||||
if(sheet_amt <= 0)
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
if(!target)
|
||||
target = get_turf(parent)
|
||||
|
||||
@@ -268,7 +268,7 @@
|
||||
else
|
||||
if(the_event.timeout)
|
||||
addtimer(CALLBACK(src, PROC_REF(clear_event), null, category), the_event.timeout, TIMER_UNIQUE|TIMER_OVERRIDE)
|
||||
return 0 //Don't have to update the event.
|
||||
return FALSE //Don't have to update the event.
|
||||
the_event = new type(src, param)//This causes a runtime for some reason, was this me? No - there's an event floating around missing a definition.
|
||||
|
||||
mood_events[category] = the_event
|
||||
@@ -280,7 +280,7 @@
|
||||
/datum/component/mood/proc/clear_event(datum/source, category)
|
||||
var/datum/mood_event/event = mood_events[category]
|
||||
if(!event)
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
mood_events -= category
|
||||
qdel(event)
|
||||
|
||||
@@ -392,3 +392,12 @@
|
||||
if(rider in AM.buckled_mobs)
|
||||
AM.unbuckle_mob(rider)
|
||||
. = ..()
|
||||
|
||||
/obj/item/riding_offhand/on_thrown(mob/living/carbon/user, atom/target)
|
||||
if(rider == user)
|
||||
return //Piggyback user.
|
||||
user.unbuckle_mob(rider)
|
||||
if(HAS_TRAIT(user, TRAIT_PACIFISM))
|
||||
to_chat(user, span_notice("You gently let go of [rider]."))
|
||||
return
|
||||
return rider
|
||||
|
||||
@@ -43,9 +43,9 @@
|
||||
/datum/component/spawner/proc/try_spawn_mob()
|
||||
var/atom/P = parent
|
||||
if(spawned_mobs.len >= max_mobs)
|
||||
return 0
|
||||
return FALSE
|
||||
if(spawn_delay > world.time)
|
||||
return 0
|
||||
return FALSE
|
||||
spawn_delay = world.time + spawn_time
|
||||
var/chosen_mob_type = pick(mob_types)
|
||||
var/mob/living/simple_animal/L = new chosen_mob_type(P.loc)
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
if(!istype(I) || QDELETED(I)) //We're specialized stack storage, just ignore non stacks.
|
||||
continue
|
||||
if(!.[I.merge_type])
|
||||
.[I.merge_type] = new /datum/numbered_display(I, I.amount)
|
||||
.[I.merge_type] = new /datum/numbered_display(I, I.amount, src)
|
||||
else
|
||||
var/datum/numbered_display/ND = .[I.merge_type]
|
||||
ND.number += I.amount
|
||||
|
||||
@@ -486,7 +486,7 @@
|
||||
var/atom/A = parent
|
||||
A.do_squish()
|
||||
|
||||
//This proc return 1 if the item can be picked up and 0 if it can't.
|
||||
//This proc return TRUE if the item can be picked up and 0 if it can't.
|
||||
//Set the stop_messages to stop it from printing messages
|
||||
/datum/component/storage/proc/can_be_inserted(obj/item/I, stop_messages = FALSE, mob/M)
|
||||
if(!istype(I) || (I.item_flags & ABSTRACT))
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
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.maptext = 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
|
||||
|
||||
@@ -49,11 +49,11 @@
|
||||
|
||||
/datum/component/summoning/proc/do_spawn_mob(atom/spawn_location, summoner)
|
||||
if(spawned_mobs.len >= max_mobs)
|
||||
return 0
|
||||
return FALSE
|
||||
if(last_spawned_time > world.time)
|
||||
return 0
|
||||
return FALSE
|
||||
if(!prob(spawn_chance))
|
||||
return 0
|
||||
return FALSE
|
||||
last_spawned_time = world.time + spawn_delay
|
||||
var/chosen_mob_type = pick(mob_types)
|
||||
var/mob/living/simple_animal/L = new chosen_mob_type(spawn_location)
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
|
||||
///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)
|
||||
if(!user.throw_mode || user.get_active_held_item() || user.pulling || user.buckling)
|
||||
return
|
||||
|
||||
if(HAS_TRAIT(user, TRAIT_HULK))
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
VV_DROPDOWN_OPTION("", "---")
|
||||
VV_DROPDOWN_OPTION(VV_HK_CALLPROC, "Call Proc")
|
||||
VV_DROPDOWN_OPTION(VV_HK_MARK, "Mark Object")
|
||||
VV_DROPDOWN_OPTION(VV_HK_TAG, "Tag Datum")
|
||||
VV_DROPDOWN_OPTION(VV_HK_DELETE, "Delete")
|
||||
VV_DROPDOWN_OPTION(VV_HK_EXPOSE, "Show VV To Player")
|
||||
VV_DROPDOWN_OPTION(VV_HK_ADDCOMPONENT, "Add Component/Element")
|
||||
|
||||
@@ -135,11 +135,11 @@
|
||||
/datum/disease/advance/IsSame(datum/disease/advance/D)
|
||||
|
||||
if(!(istype(D, /datum/disease/advance)))
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
if(GetDiseaseID() != D.GetDiseaseID())
|
||||
return 0
|
||||
return 1
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
// Returns the advance disease with a different reference memory.
|
||||
/datum/disease/advance/Copy()
|
||||
@@ -178,8 +178,8 @@
|
||||
/datum/disease/advance/proc/HasSymptom(datum/symptom/S)
|
||||
for(var/datum/symptom/symp in symptoms)
|
||||
if(symp.type == S.type)
|
||||
return 1
|
||||
return 0
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
// Will generate new unique symptoms, use this if there are none. Returns a list of symptoms that were generated.
|
||||
/datum/disease/advance/proc/GenerateSymptoms(level_min, level_max, amount_get = 0)
|
||||
@@ -361,7 +361,7 @@
|
||||
L += "[S.id]N"
|
||||
else
|
||||
L += S.id
|
||||
L = sortList(L) // Sort the list so it doesn't matter which order the symptoms are in.
|
||||
L = sort_list(L) // Sort the list so it doesn't matter which order the symptoms are in.
|
||||
var/result = jointext(L, ":")
|
||||
id = result
|
||||
return id
|
||||
|
||||
@@ -64,11 +64,11 @@ Bonus
|
||||
|
||||
/datum/symptom/choking/proc/Choke_stage_3_4(mob/living/M, datum/disease/advance/A)
|
||||
M.adjustOxyLoss(rand(6,13))
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/datum/symptom/choking/proc/Choke(mob/living/M, datum/disease/advance/A)
|
||||
M.adjustOxyLoss(rand(10,18))
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
@@ -136,17 +136,17 @@ Bonus
|
||||
/datum/symptom/asphyxiation/proc/Asphyxiate_stage_3_4(mob/living/M, datum/disease/advance/A)
|
||||
var/get_damage = rand(10,15) * power
|
||||
M.adjustOxyLoss(get_damage)
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/datum/symptom/asphyxiation/proc/Asphyxiate(mob/living/M, datum/disease/advance/A)
|
||||
var/get_damage = rand(15,21) * power
|
||||
M.adjustOxyLoss(get_damage)
|
||||
if(paralysis)
|
||||
M.reagents.add_reagent_list(list(/datum/reagent/toxin/pancuronium = 3, /datum/reagent/toxin/sodium_thiopental = 3))
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/datum/symptom/asphyxiation/proc/Asphyxiate_death(mob/living/M, datum/disease/advance/A)
|
||||
var/get_damage = rand(25,35) * power
|
||||
M.adjustOxyLoss(get_damage)
|
||||
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, get_damage/2)
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
@@ -58,4 +58,4 @@ Bonus
|
||||
M.adjust_bodytemperature(get_heat * A.stage, 0, BODYTEMP_HEAT_DAMAGE_LIMIT - 1)
|
||||
else
|
||||
M.adjust_bodytemperature(get_heat * A.stage)
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
@@ -71,14 +71,14 @@ Bonus
|
||||
M.adjustFireLoss(3 * power)
|
||||
if(infective)
|
||||
A.spread(2)
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/datum/symptom/fire/proc/Firestacks_stage_5(mob/living/M, datum/disease/advance/A)
|
||||
M.adjust_fire_stacks(3 * power)
|
||||
M.adjustFireLoss(5 * power)
|
||||
if(infective)
|
||||
A.spread(4)
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
@@ -157,7 +157,7 @@ Bonus
|
||||
M.adjustFireLoss(get_stacks/2)
|
||||
if(chems)
|
||||
M.reagents.add_reagent(/datum/reagent/clf3, 2 * power)
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/datum/symptom/alkali/proc/Alkali_fire_stage_5(mob/living/M, datum/disease/advance/A)
|
||||
var/get_stacks = 8 * power
|
||||
@@ -165,4 +165,4 @@ Bonus
|
||||
M.adjustFireLoss(get_stacks)
|
||||
if(chems)
|
||||
M.reagents.add_reagent_list(list(/datum/reagent/napalm = 4 * power, /datum/reagent/clf3 = 4 * power))
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
@@ -65,7 +65,7 @@ Bonus
|
||||
var/mob/living/carbon/human/H = M
|
||||
var/obj/item/bodypart/random_part = pick(H.bodyparts)
|
||||
random_part.generic_bleedstacks += 5 * power
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
@@ -133,4 +133,4 @@ Bonus
|
||||
M.reagents.add_reagent_list(list(/datum/reagent/toxin/heparin = 2, /datum/reagent/toxin/lipolicide = 2))
|
||||
if(zombie)
|
||||
M.reagents.add_reagent(/datum/reagent/romerol, 1)
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
for(var/obj/item/bodypart/L in parts)
|
||||
if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len))
|
||||
M.update_damage_overlays()
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/datum/symptom/heal/starlight/passive_message_condition(mob/living/M)
|
||||
if(M.getBruteLoss() || M.getFireLoss() || M.getToxLoss())
|
||||
@@ -129,7 +129,7 @@
|
||||
M.adjust_nutrition(0.3)
|
||||
if(prob(2))
|
||||
to_chat(M, "<span class='notice'>You feel a mild warmth as your blood purifies itself.</span>")
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
C.adjust_nutrition(-lost_nutrition * HUNGER_FACTOR) //Hunger depletes at 10x the normal speed
|
||||
if(prob(2))
|
||||
to_chat(C, "<span class='notice'>You feel an odd gurgle in your stomach, as if it was working much faster than normal.</span>")
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/datum/symptom/heal/darkness
|
||||
name = "Nocturnal Regeneration"
|
||||
@@ -210,7 +210,7 @@
|
||||
for(var/obj/item/bodypart/L in parts)
|
||||
if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len * 0.5)) //more effective on brute
|
||||
M.update_damage_overlays()
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/datum/symptom/heal/darkness/passive_message_condition(mob/living/M)
|
||||
if(M.getBruteLoss() || M.getFireLoss())
|
||||
@@ -307,7 +307,7 @@
|
||||
if(active_coma && M.getBruteLoss() + M.getFireLoss() == 0)
|
||||
uncoma(M)
|
||||
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/datum/symptom/heal/coma/passive_message_condition(mob/living/M)
|
||||
if((M.getBruteLoss() + M.getFireLoss()) > 30)
|
||||
@@ -365,7 +365,7 @@
|
||||
if(L.heal_damage(heal_amt/parts.len * 0.5, heal_amt/parts.len))
|
||||
M.update_damage_overlays()
|
||||
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/datum/symptom/heal/water/passive_message_condition(mob/living/M)
|
||||
if(M.getBruteLoss() || M.getFireLoss())
|
||||
@@ -435,7 +435,7 @@
|
||||
for(var/obj/item/bodypart/L in parts)
|
||||
if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len))
|
||||
M.update_damage_overlays()
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
|
||||
/datum/symptom/heal/radiation
|
||||
@@ -475,7 +475,7 @@
|
||||
if(RAD_BURN_THRESHOLD to RAD_MOB_MUTATE)
|
||||
return 0.75
|
||||
if(RAD_MOB_MUTATE to RAD_MOB_KNOCKDOWN)
|
||||
return 1
|
||||
return TRUE
|
||||
else
|
||||
return 1.5
|
||||
|
||||
@@ -498,4 +498,4 @@
|
||||
for(var/obj/item/bodypart/L in parts)
|
||||
if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len))
|
||||
M.update_damage_overlays()
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
@@ -58,4 +58,4 @@ Bonus
|
||||
if(unsafe)
|
||||
limit = 0
|
||||
M.adjust_bodytemperature(-get_cold * A.stage, limit)
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
+4
-4
@@ -538,7 +538,7 @@
|
||||
|
||||
/datum/dna/proc/check_block_string(mutation)
|
||||
if((LAZYLEN(mutation_index) > DNA_MUTATION_BLOCKS) || !(mutation in mutation_index))
|
||||
return 0
|
||||
return FALSE
|
||||
return is_gene_active(mutation)
|
||||
|
||||
/datum/dna/proc/is_gene_active(mutation)
|
||||
@@ -585,7 +585,7 @@
|
||||
|
||||
/proc/setblock(istring, blocknumber, replacement, blocksize=DNA_BLOCK_SIZE)
|
||||
if(!istring || !blocknumber || !replacement || !blocksize)
|
||||
return 0
|
||||
return FALSE
|
||||
return getleftblocks(istring, blocknumber, blocksize) + replacement + getrightblocks(istring, blocknumber, blocksize)
|
||||
|
||||
/datum/dna/proc/mutation_in_sequence(mutation)
|
||||
@@ -649,7 +649,7 @@
|
||||
|
||||
/proc/scramble_dna(mob/living/carbon/M, ui=FALSE, se=FALSE, probability)
|
||||
if(!M.has_dna())
|
||||
return 0
|
||||
return FALSE
|
||||
if(se)
|
||||
for(var/i=1, i<=DNA_MUTATION_BLOCKS, i++)
|
||||
if(prob(probability))
|
||||
@@ -660,7 +660,7 @@
|
||||
if(prob(probability))
|
||||
M.dna.uni_identity = setblock(M.dna.uni_identity, i, random_string(DNA_BLOCK_SIZE, GLOB.hex_characters))
|
||||
M.updateappearance(mutations_overlay_update=1)
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
//value in range 1 to values. values must be greater than 0
|
||||
//all arguments assumed to be positive integers
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
return FALSE
|
||||
source.visible_message("<span class='warning'>[user] starts picking up [source].</span>", \
|
||||
"<span class='userdanger'>[user] starts picking you up!</span>")
|
||||
if(!do_after(user, 20, target = source) || source.buckled)
|
||||
if(!do_after(user, 2 SECONDS, target = source) || source.buckled)
|
||||
return FALSE
|
||||
|
||||
source.visible_message("<span class='warning'>[user] picks up [source]!</span>", \
|
||||
@@ -95,6 +95,7 @@
|
||||
dynamic_hair_suffix = ""
|
||||
var/mob/living/held_mob
|
||||
var/escape_on_find
|
||||
var/destroying = FALSE
|
||||
|
||||
/obj/item/clothing/head/mob_holder/Initialize(mapload, mob/living/target, worn_state, alt_worn, right_hand, left_hand, slots = NONE)
|
||||
. = ..()
|
||||
@@ -134,45 +135,54 @@
|
||||
w_class = WEIGHT_CLASS_HUGE
|
||||
|
||||
/obj/item/clothing/head/mob_holder/Destroy()
|
||||
destroying = TRUE
|
||||
if(held_mob)
|
||||
release()
|
||||
release(FALSE)
|
||||
return ..()
|
||||
|
||||
/obj/item/clothing/head/mob_holder/examine(mob/user)
|
||||
return held_mob?.examine(user) || ..()
|
||||
|
||||
/obj/item/clothing/head/mob_holder/Exited(atom/movable/AM, atom/newloc)
|
||||
. = ..()
|
||||
if(AM == held_mob)
|
||||
held_mob.reset_perspective()
|
||||
held_mob = null
|
||||
QDEL_IN(src, 1) //To avoid a qdel loop.
|
||||
/obj/item/clothing/head/mob_holder/on_thrown(mob/living/carbon/user, atom/target)
|
||||
if((item_flags & ABSTRACT) || HAS_TRAIT(src, TRAIT_NODROP))
|
||||
return
|
||||
if(HAS_TRAIT(user, TRAIT_PACIFISM))
|
||||
to_chat(user, span_notice("You set [src] down gently on the ground."))
|
||||
release()
|
||||
return
|
||||
|
||||
/obj/item/clothing/head/mob_holder/Entered(atom/movable/AM, atom/newloc)
|
||||
. = ..()
|
||||
if(AM != held_mob)
|
||||
var/destination = loc
|
||||
if(isliving(loc)) //the mob is held or worn, drop things on the floor
|
||||
destination = get_turf(loc)
|
||||
AM.forceMove(destination)
|
||||
var/mob/living/throw_mob = held_mob
|
||||
release()
|
||||
return throw_mob
|
||||
|
||||
/obj/item/clothing/head/mob_holder/dropped(mob/user)
|
||||
. = ..()
|
||||
if(held_mob && !ismob(loc) && !istype(loc,/obj/item/storage))//don't release on soft-drops
|
||||
if(held_mob && isturf(loc))
|
||||
release()
|
||||
|
||||
/obj/item/clothing/head/mob_holder/proc/release()
|
||||
if(held_mob)
|
||||
var/mob/living/L = held_mob
|
||||
held_mob = null
|
||||
L.forceMove(get_turf(L))
|
||||
L.reset_perspective()
|
||||
L.setDir(SOUTH)
|
||||
if(!QDELETED(src))
|
||||
/obj/item/clothing/head/mob_holder/proc/release(del_on_release = TRUE, display_messages = TRUE)
|
||||
if(!held_mob)
|
||||
if(del_on_release && !destroying)
|
||||
qdel(src)
|
||||
return FALSE
|
||||
var/mob/living/released_mob = held_mob
|
||||
held_mob = null // stops the held mob from being release()'d twice.
|
||||
if(isliving(loc))
|
||||
var/mob/living/L = loc
|
||||
if(display_messages)
|
||||
to_chat(L, span_warning("[released_mob] wriggles free!"))
|
||||
L.dropItemToGround(src)
|
||||
released_mob.forceMove(drop_location())
|
||||
released_mob.reset_perspective()
|
||||
released_mob.setDir(SOUTH)
|
||||
if(display_messages)
|
||||
released_mob.visible_message(span_warning("[released_mob] uncurls!"))
|
||||
if(del_on_release && !destroying)
|
||||
qdel(src)
|
||||
return TRUE
|
||||
|
||||
/obj/item/clothing/head/mob_holder/relaymove(mob/user)
|
||||
return
|
||||
/obj/item/clothing/head/mob_holder/relaymove(mob/living/user, direction)
|
||||
container_resist()
|
||||
|
||||
/obj/item/clothing/head/mob_holder/container_resist()
|
||||
if(isliving(loc))
|
||||
@@ -180,6 +190,11 @@
|
||||
L.visible_message("<span class='warning'>[held_mob] escapes from [L]!</span>", "<span class='warning'>[held_mob] escapes your grip!</span>")
|
||||
release()
|
||||
|
||||
/obj/item/clothing/head/mob_holder/Exited(atom/movable/gone, direction)
|
||||
. = ..()
|
||||
if(held_mob && held_mob == gone)
|
||||
release()
|
||||
|
||||
/obj/item/clothing/head/mob_holder/mob_can_equip(M, equipper, slot, disable_warning, bypass_equip_delay_self)
|
||||
if(M == held_mob || !ishuman(M)) //monkeys holding monkeys holding monkeys...
|
||||
return FALSE
|
||||
@@ -232,7 +247,9 @@
|
||||
return location.transfer_air(taker, ratio)
|
||||
|
||||
// escape when found if applicable
|
||||
/obj/item/clothing/head/mob_holder/on_found(mob/living/finder)
|
||||
/obj/item/clothing/head/mob_holder/on_found(mob/finder)
|
||||
if(escape_on_find)
|
||||
finder.visible_message("[finder] accidentally releases the [held_mob]!")
|
||||
release()
|
||||
to_chat(finder, span_warning("\A [held_mob.name] pops out! "))
|
||||
finder.visible_message(span_warning("\A [held_mob.name] pops out of the container [finder] is opening!"), ignored_mobs = finder)
|
||||
release(TRUE, FALSE)
|
||||
return
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
icon = to_reskin.unique_reskin[reskin_option]["icon"] ? to_reskin.unique_reskin[reskin_option]["icon"] : to_reskin.icon,
|
||||
icon_state = to_reskin.unique_reskin[reskin_option]["icon_state"] ? to_reskin.unique_reskin[reskin_option]["icon_state"] : to_reskin.icon_state)
|
||||
items += list("[reskin_option]" = item_image)
|
||||
sortList(items)
|
||||
items = sort_list(items)
|
||||
|
||||
// Display to the user
|
||||
var/pick = show_radial_menu(user, to_reskin, items, custom_check = CALLBACK(src, PROC_REF(check_reskin_menu), user, to_reskin), radius = 38, require_near = TRUE)
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
if(suits_with_helmet_typecache[A.type])
|
||||
RegisterSignal(A, COMSIG_SUIT_MADE_HELMET, PROC_REF(register_helmet)) //you better work now you slut
|
||||
else if(_flags & POLYCHROMIC_ACTION && ismob(A)) //in the event mob update icon procs are ever standarized.
|
||||
var/datum/action/polychromic/P = new(A)
|
||||
var/datum/action/item_action/polychromic/P = new(A)
|
||||
RegisterSignal(P, COMSIG_ACTION_TRIGGER, PROC_REF(activate_action))
|
||||
actions_by_atom[A] = P
|
||||
P.Grant(A)
|
||||
@@ -73,7 +73,7 @@
|
||||
/datum/element/polychromic/Detach(atom/A)
|
||||
. = ..()
|
||||
colors_by_atom -= A
|
||||
var/datum/action/polychromic/P = actions_by_atom[A]
|
||||
var/datum/action/item_action/polychromic/P = actions_by_atom[A]
|
||||
if(P)
|
||||
actions_by_atom -= A
|
||||
qdel(P)
|
||||
@@ -146,7 +146,7 @@
|
||||
/datum/element/polychromic/proc/grant_user_action(atom/source, mob/user, slot)
|
||||
if(slot == ITEM_SLOT_BACKPACK || slot == ITEM_SLOT_LEGCUFFED || slot == ITEM_SLOT_HANDCUFFED || slot == ITEM_SLOT_DEX_STORAGE)
|
||||
return
|
||||
var/datum/action/polychromic/P = actions_by_atom[source]
|
||||
var/datum/action/item_action/polychromic/P = actions_by_atom[source]
|
||||
if(!P)
|
||||
P = new (source)
|
||||
P.name = "Modify [source]'\s Colors"
|
||||
@@ -156,7 +156,7 @@
|
||||
P.Grant(user)
|
||||
|
||||
/datum/element/polychromic/proc/remove_user_action(atom/source, mob/user)
|
||||
var/datum/action/polychromic/P = actions_by_atom[source]
|
||||
var/datum/action/item_action/polychromic/P = actions_by_atom[source]
|
||||
P?.Remove(user)
|
||||
|
||||
/datum/element/polychromic/proc/activate_action(datum/action/source, atom/target)
|
||||
@@ -197,9 +197,14 @@
|
||||
helmet_by_suit -= S
|
||||
colors_by_atom -= source
|
||||
|
||||
/datum/action/polychromic
|
||||
/datum/action/item_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)
|
||||
check_flags = NONE
|
||||
|
||||
/datum/action/item_action/polychromic/ApplyIcon(atom/movable/screen/movable/action_button/current_button, force)
|
||||
var/matrix/save_matrix = target.transform
|
||||
target.transform = matrix(0.8, 0, 0, 0, 0.8, 0)
|
||||
. = ..()
|
||||
target.transform = save_matrix
|
||||
|
||||
@@ -397,7 +397,7 @@ GLOBAL_LIST_EMPTY(explosions)
|
||||
var/choice = input("Bomb Size?") in choices
|
||||
switch(choice)
|
||||
if(null)
|
||||
return 0
|
||||
return FALSE
|
||||
if("Small Bomb")
|
||||
dev = 1
|
||||
heavy = 2
|
||||
@@ -436,13 +436,13 @@ GLOBAL_LIST_EMPTY(explosions)
|
||||
|
||||
if(dist < dev)
|
||||
T.color = "red"
|
||||
T.maptext = "Dev"
|
||||
T.maptext = MAPTEXT("Dev")
|
||||
else if (dist < heavy)
|
||||
T.color = "yellow"
|
||||
T.maptext = "Heavy"
|
||||
T.maptext = MAPTEXT("Heavy")
|
||||
else if (dist < light)
|
||||
T.color = "blue"
|
||||
T.maptext = "Light"
|
||||
T.maptext = MAPTEXT("Light")
|
||||
else
|
||||
continue
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
|
||||
/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>")
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/datum/martial_art/boxing/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
|
||||
to_chat(A, "<span class='warning'>Can't grab while boxing!</span>")
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/datum/martial_art/boxing/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
log_combat(A, D, "knocked out (boxing) ")
|
||||
else if(D.lying)
|
||||
D.forcesay(GLOB.hit_appends)
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/datum/martial_art/boxing/teach(mob/living/carbon/human/H, make_temporary = TRUE)
|
||||
. = ..()
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
return BULLET_ACT_HIT
|
||||
if(!isturf(A.loc)) //NO MOTHERFLIPPIN MECHS!
|
||||
return BULLET_ACT_HIT
|
||||
if(A.in_throw_mode)
|
||||
if(A.throw_mode)
|
||||
A.visible_message("<span class='danger'>[A] effortlessly swats the projectile aside! They can deflect projectile with their bare hands!</span>", "<span class='userdanger'>You deflect the projectile!</span>")
|
||||
playsound(get_turf(A), pick('sound/weapons/bulletflyby.ogg', 'sound/weapons/bulletflyby2.ogg', 'sound/weapons/bulletflyby3.ogg'), 75, TRUE)
|
||||
P.firer = A
|
||||
|
||||
+18
-1
@@ -67,6 +67,8 @@
|
||||
var/datum/language_holder/language_holder
|
||||
var/unconvertable = FALSE
|
||||
var/late_joiner = FALSE
|
||||
///has this mind ever been an AI
|
||||
var/has_ever_been_ai = FALSE
|
||||
|
||||
var/force_escaped = FALSE // Set by Into The Sunset command of the shuttle manipulator
|
||||
var/list/learned_recipes //List of learned recipe TYPES.
|
||||
@@ -286,6 +288,21 @@
|
||||
if(O)
|
||||
O.unlock_code = null
|
||||
|
||||
/// Remove the antagonists that should not persist when being borged
|
||||
/datum/mind/proc/remove_antags_for_borging()
|
||||
remove_antag_datum(/datum/antagonist/cult)
|
||||
|
||||
var/datum/antagonist/rev/revolutionary = has_antag_datum(/datum/antagonist/rev)
|
||||
revolutionary?.remove_revolutionary(TRUE)
|
||||
|
||||
if(!isbrain(current))
|
||||
return
|
||||
if(!istype(current.loc, /obj/item/mmi))
|
||||
return
|
||||
var/obj/item/mmi/B = current.loc.loc
|
||||
if(!istype(B.laws, /datum/ai_laws/ratvar))
|
||||
remove_servant_of_ratvar(current, TRUE)
|
||||
|
||||
/datum/mind/proc/remove_all_antag() //For the Lazy amongst us.
|
||||
remove_changeling()
|
||||
remove_traitor()
|
||||
@@ -1644,7 +1661,7 @@ GLOBAL_LIST(objective_choices)
|
||||
if(istype(S, type))
|
||||
continue
|
||||
S.charge_counter = delay
|
||||
S.updateButtonIcon()
|
||||
S.UpdateButton()
|
||||
INVOKE_ASYNC(S, /obj/effect/proc_holder/spell.proc/start_recharge)
|
||||
|
||||
/datum/mind/proc/get_ghost(even_if_they_cant_reenter)
|
||||
|
||||
@@ -119,8 +119,8 @@
|
||||
owner.RemoveSpell(power)
|
||||
qdel(power)
|
||||
SEND_SIGNAL(owner, COMSIG_HUMAN_MUTATION_LOSS, src)
|
||||
return 0
|
||||
return 1
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/mutation/human/proc/say_mod(message)
|
||||
if(message)
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
if (aval_r_amnt>reagents_list[r_r])
|
||||
. = -1
|
||||
else
|
||||
return 0
|
||||
return FALSE
|
||||
if ((reagents_list?(reagents_list.len):(0)) < avail_reagents.reagent_list.len)
|
||||
return -1
|
||||
return .
|
||||
@@ -58,7 +58,7 @@
|
||||
if (locate(/obj/) in container)
|
||||
return -1
|
||||
else
|
||||
return 1
|
||||
return TRUE
|
||||
. = 1
|
||||
var/list/checklist = items.Copy()
|
||||
for (var/obj/O in container)
|
||||
@@ -71,7 +71,7 @@
|
||||
if (!found)
|
||||
. = -1
|
||||
if (checklist.len)
|
||||
return 0
|
||||
return FALSE
|
||||
return .
|
||||
|
||||
//general version
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
* Multiplied to clickdelays
|
||||
*/
|
||||
/datum/status_effect/proc/action_cooldown_mod()
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
////////////////
|
||||
// ALERT HOOK //
|
||||
|
||||
+28
-26
@@ -1,108 +1,110 @@
|
||||
//This is intended to be a full wrapper. DO NOT directly modify its values
|
||||
///Container for client viewsize
|
||||
/datum/viewData
|
||||
/datum/view_data
|
||||
var/width = 0
|
||||
var/height = 0
|
||||
var/default = ""
|
||||
var/is_suppressed = FALSE
|
||||
var/client/chief = null
|
||||
|
||||
/datum/viewData/New(client/owner, view_string)
|
||||
/datum/view_data/New(client/owner, view_string)
|
||||
default = view_string
|
||||
chief = owner
|
||||
apply()
|
||||
|
||||
/datum/viewData/proc/setDefault(string)
|
||||
/datum/view_data/proc/setDefault(string)
|
||||
default = string
|
||||
apply()
|
||||
|
||||
/datum/viewData/proc/safeApplyFormat()
|
||||
/datum/view_data/proc/afterViewChange()
|
||||
if(isZooming())
|
||||
assertFormat()
|
||||
return
|
||||
resetFormat()
|
||||
else
|
||||
resetFormat()
|
||||
var/datum/hud/our_hud = chief?.mob?.hud_used
|
||||
our_hud.view_audit_buttons() // Make sure our hud's buttons are in our new size
|
||||
|
||||
/datum/viewData/proc/assertFormat()//T-Pose
|
||||
/datum/view_data/proc/assertFormat()//T-Pose
|
||||
// winset(chief, "mapwindow.map", "zoom=0")
|
||||
// Citadel Edit - We're using icon dropdown instead
|
||||
|
||||
/datum/viewData/proc/resetFormat()//Cuck
|
||||
/datum/view_data/proc/resetFormat()//Cuck
|
||||
// winset(chief, "mapwindow.map", "zoom=[chief.prefs.pixel_size]")
|
||||
// Citadel Edit - We're using icon dropdown instead
|
||||
|
||||
/datum/viewData/proc/setZoomMode()
|
||||
/datum/view_data/proc/setZoomMode()
|
||||
// winset(chief, "mapwindow.map", "zoom-mode=[chief.prefs.scaling_method]")
|
||||
// Citadel Edit - We're using icon dropdown instead
|
||||
|
||||
/datum/viewData/proc/isZooming()
|
||||
/datum/view_data/proc/isZooming()
|
||||
return (width || height)
|
||||
|
||||
/datum/viewData/proc/resetToDefault()
|
||||
/datum/view_data/proc/resetToDefault()
|
||||
width = 0
|
||||
height = 0
|
||||
apply()
|
||||
|
||||
/datum/viewData/proc/add(toAdd)
|
||||
/datum/view_data/proc/add(toAdd)
|
||||
width += toAdd
|
||||
height += toAdd
|
||||
apply()
|
||||
|
||||
/datum/viewData/proc/addTo(toAdd)
|
||||
/datum/view_data/proc/addTo(toAdd)
|
||||
var/list/shitcode = getviewsize(toAdd)
|
||||
width += shitcode[1]
|
||||
height += shitcode[2]
|
||||
apply()
|
||||
|
||||
/datum/viewData/proc/setTo(toAdd)
|
||||
/datum/view_data/proc/setTo(toAdd)
|
||||
var/list/shitcode = getviewsize(toAdd) //Backward compatability to account
|
||||
width = shitcode[1] //for a change in how sizes get calculated. we used to include world.view in
|
||||
height = shitcode[2] //this, but it was jank, so I had to move it
|
||||
apply()
|
||||
|
||||
/datum/viewData/proc/setBoth(wid, hei)
|
||||
/datum/view_data/proc/setBoth(wid, hei)
|
||||
width = wid
|
||||
height = hei
|
||||
apply()
|
||||
|
||||
/datum/viewData/proc/setWidth(wid)
|
||||
/datum/view_data/proc/setWidth(wid)
|
||||
width = wid
|
||||
apply()
|
||||
|
||||
/datum/viewData/proc/setHeight(hei)
|
||||
/datum/view_data/proc/setHeight(hei)
|
||||
width = hei
|
||||
apply()
|
||||
|
||||
/datum/viewData/proc/addToWidth(toAdd)
|
||||
/datum/view_data/proc/addToWidth(toAdd)
|
||||
width += toAdd
|
||||
apply()
|
||||
|
||||
/datum/viewData/proc/addToHeight(screen, toAdd)
|
||||
/datum/view_data/proc/addToHeight(screen, toAdd)
|
||||
height += toAdd
|
||||
apply()
|
||||
|
||||
/datum/viewData/proc/apply()
|
||||
/datum/view_data/proc/apply()
|
||||
chief.change_view(getView())
|
||||
safeApplyFormat()
|
||||
afterViewChange()
|
||||
|
||||
/datum/viewData/proc/supress()
|
||||
/datum/view_data/proc/supress()
|
||||
is_suppressed = TRUE
|
||||
apply()
|
||||
|
||||
/datum/viewData/proc/unsupress()
|
||||
/datum/view_data/proc/unsupress()
|
||||
is_suppressed = FALSE
|
||||
apply()
|
||||
|
||||
/datum/viewData/proc/getView()
|
||||
/datum/view_data/proc/getView()
|
||||
var/list/temp = getviewsize(default)
|
||||
if(is_suppressed)
|
||||
return "[temp[1]]x[temp[2]]"
|
||||
return "[width + temp[1]]x[height + temp[2]]"
|
||||
|
||||
/datum/viewData/proc/zoomIn()
|
||||
/datum/view_data/proc/zoomIn()
|
||||
resetToDefault()
|
||||
animate(chief, pixel_x = 0, pixel_y = 0, 0, FALSE, LINEAR_EASING, ANIMATION_END_NOW)
|
||||
|
||||
/datum/viewData/proc/zoomOut(radius = 0, offset = 0, direction = FALSE)
|
||||
/datum/view_data/proc/zoomOut(radius = 0, offset = 0, direction = FALSE)
|
||||
if(direction)
|
||||
var/_x = 0
|
||||
var/_y = 0
|
||||
|
||||
@@ -178,7 +178,7 @@
|
||||
*/
|
||||
/datum/weather/proc/end()
|
||||
if(stage == END_STAGE)
|
||||
return 1
|
||||
return TRUE
|
||||
stage = END_STAGE
|
||||
STOP_PROCESSING(SSweather, src)
|
||||
update_areas()
|
||||
|
||||
Reference in New Issue
Block a user