Merge branch 'master' of https://github.com/Citadel-Station-13/Citadel-Station-13 into Ghommie-cit45
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
/datum/component/bouncy
|
||||
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS
|
||||
var/bouncy_mod = 1
|
||||
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))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
if(_bouncy_mod)
|
||||
bouncy_mod = _bouncy_mod
|
||||
if(_bounce_signals)
|
||||
bounce_signals = _bounce_signals
|
||||
|
||||
/datum/component/bouncy/InheritComponent(datum/component/bouncy/B, original, _bouncy_mod, list/_bounce_signals)
|
||||
if(_bouncy_mod)
|
||||
bouncy_mod = max(bouncy_mod, _bouncy_mod)
|
||||
if(_bounce_signals)
|
||||
var/list/diff_bounces = difflist(bounce_signals, _bounce_signals, TRUE)
|
||||
for(var/bounce in diff_bounces)
|
||||
bounce_signals += bounce
|
||||
RegisterSignal(parent, bounce, .proc/bounce_up)
|
||||
|
||||
/datum/component/bouncy/RegisterWithParent()
|
||||
RegisterSignal(parent, bounce_signals, .proc/bounce_up)
|
||||
|
||||
/datum/component/bouncy/UnregisterFromParent()
|
||||
UnregisterSignal(parent, bounce_signals)
|
||||
|
||||
/datum/component/bouncy/proc/bounce_up(datum/source)
|
||||
var/atom/movable/A = parent
|
||||
switch(rand(1, 3))
|
||||
if(1)
|
||||
A.do_jiggle(45 + rand(-10, 10) * bouncy_mod, 14)
|
||||
if(2)
|
||||
var/min_b = 0.6/bouncy_mod
|
||||
var/max_b = 1.2 * bouncy_mod
|
||||
A.do_squish(rand(min_b, max_b), rand(min_b, max_b), 14)
|
||||
if(3)
|
||||
var/pixelshift = 8 * bouncy_mod
|
||||
A.Shake(pixelshift, pixelshift, duration = 15)
|
||||
@@ -2,10 +2,10 @@
|
||||
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS
|
||||
|
||||
var/mob/living/host_mob
|
||||
var/nanite_volume = 100 //amount of nanites in the system, used as fuel for nanite programs
|
||||
var/max_nanites = 500 //maximum amount of nanites in the system
|
||||
var/nanite_volume = 50 //amount of nanites in the system, used as fuel for nanite programs
|
||||
var/max_nanites = 250 //maximum amount of nanites in the system
|
||||
var/regen_rate = 0.5 //nanites generated per second
|
||||
var/safety_threshold = 50 //how low nanites will get before they stop processing/triggering
|
||||
var/safety_threshold = 25 //how low nanites will get before they stop processing/triggering
|
||||
var/cloud_id = 0 //0 if not connected to the cloud, 1-100 to set a determined cloud backup to draw from
|
||||
var/next_sync = 0
|
||||
var/list/datum/nanite_program/programs = list()
|
||||
@@ -311,4 +311,4 @@
|
||||
mob_program["trigger_code"] = P.trigger_code
|
||||
id++
|
||||
mob_programs += list(mob_program)
|
||||
data["mob_programs"] = mob_programs
|
||||
data["mob_programs"] = mob_programs
|
||||
|
||||
@@ -7,12 +7,28 @@
|
||||
. = ..()
|
||||
RegisterSignal(parent, COMSIG_ATOM_EMAG_ACT, .proc/unlock_me)
|
||||
|
||||
/datum/component/storage/concrete/emergency/on_attack_hand(datum/source, mob/user)
|
||||
var/atom/A = parent
|
||||
if(!attack_hand_interact)
|
||||
return
|
||||
if(user.active_storage == src && A.loc == user) //if you're already looking inside the storage item
|
||||
user.active_storage.close(user)
|
||||
close(user)
|
||||
. = COMPONENT_NO_ATTACK_HAND
|
||||
return
|
||||
. = COMPONENT_NO_ATTACK_HAND
|
||||
if(!check_locked(source, user, TRUE))
|
||||
show_to(user)
|
||||
A.do_jiggle()
|
||||
if(rustle_sound)
|
||||
playsound(A, "rustle", 50, 1, -5)
|
||||
|
||||
/datum/component/storage/concrete/emergency/signal_insertion_attempt(datum/source, obj/item/I, mob/M, silent = FALSE, force = FALSE)
|
||||
if(!silent && istype(I, /obj/item/card/emag))
|
||||
silent = TRUE // suppresses the message
|
||||
return ..()
|
||||
|
||||
/datum/component/storage/concrete/check_locked(datum/source, mob/user, message = FALSE)
|
||||
/datum/component/storage/concrete/emergency/check_locked(datum/source, mob/user, message = FALSE)
|
||||
. = locked && GLOB.security_level < SEC_LEVEL_RED
|
||||
if(message && . && user)
|
||||
to_chat(user, "The storage unit will only unlock during a Red or Delta security alert.")
|
||||
|
||||
@@ -531,11 +531,9 @@
|
||||
if(!istype(M))
|
||||
return FALSE
|
||||
A.add_fingerprint(M)
|
||||
if(locked && !force)
|
||||
to_chat(M, "<span class='warning'>[parent] seems to be locked!</span>")
|
||||
if(!force && (check_locked(null, M) || !M.CanReach(parent, view_only = TRUE)))
|
||||
return FALSE
|
||||
if(force || M.CanReach(parent, view_only = TRUE))
|
||||
show_to(M)
|
||||
show_to(M)
|
||||
|
||||
/datum/component/storage/proc/mousedrop_receive(datum/source, atom/movable/O, mob/M)
|
||||
if(isitem(O))
|
||||
@@ -594,7 +592,7 @@
|
||||
if(!stop_messages)
|
||||
to_chat(M, "<span class='warning'>[IP] cannot hold [I] as it's a storage item of the same size!</span>")
|
||||
return FALSE //To prevent the stacking of same sized storage items.
|
||||
if(I.item_flags & NODROP) //SHOULD be handled in unEquip, but better safe than sorry.
|
||||
if(HAS_TRAIT(I, TRAIT_NODROP)) //SHOULD be handled in unEquip, but better safe than sorry.
|
||||
to_chat(M, "<span class='warning'>\the [I] is stuck to your hand, you can't put it in \the [host]!</span>")
|
||||
return FALSE
|
||||
var/datum/component/storage/concrete/master = master()
|
||||
@@ -749,7 +747,8 @@
|
||||
if(!quickdraw)
|
||||
A.add_fingerprint(user)
|
||||
user_show_to_mob(user)
|
||||
playsound(A, "rustle", 50, 1, -5)
|
||||
if(rustle_sound)
|
||||
playsound(A, "rustle", 50, 1, -5)
|
||||
return
|
||||
|
||||
if(!user.incapacitated())
|
||||
|
||||
@@ -21,6 +21,9 @@ GLOBAL_LIST_EMPTY(uplinks)
|
||||
var/datum/uplink_purchase_log/purchase_log
|
||||
var/list/uplink_items
|
||||
var/hidden_crystals = 0
|
||||
var/unlock_note
|
||||
var/unlock_code
|
||||
var/failsafe_code
|
||||
|
||||
/datum/component/uplink/Initialize(_owner, _lockable = TRUE, _enabled = FALSE, datum/game_mode/_gamemode, starting_tc = 20)
|
||||
if(!isitem(parent))
|
||||
@@ -219,7 +222,10 @@ GLOBAL_LIST_EMPTY(uplinks)
|
||||
|
||||
/datum/component/uplink/proc/new_ringtone(datum/source, mob/living/user, new_ring_text)
|
||||
var/obj/item/pda/master = parent
|
||||
if(trim(lowertext(new_ring_text)) != trim(lowertext(master.lock_code))) //why is the lock code stored on the pda?
|
||||
if(trim(lowertext(new_ring_text)) != trim(lowertext(unlock_code)))
|
||||
if(trim(lowertext(new_ring_text)) == trim(lowertext(failsafe_code)))
|
||||
failsafe()
|
||||
return COMPONENT_STOP_RINGTONE_CHANGE
|
||||
return
|
||||
locked = FALSE
|
||||
interact(null, user)
|
||||
@@ -233,7 +239,9 @@ GLOBAL_LIST_EMPTY(uplinks)
|
||||
/datum/component/uplink/proc/new_frequency(datum/source, list/arguments)
|
||||
var/obj/item/radio/master = parent
|
||||
var/frequency = arguments[1]
|
||||
if(frequency != master.traitor_frequency)
|
||||
if(frequency != unlock_code)
|
||||
if(frequency == failsafe_code)
|
||||
failsafe()
|
||||
return
|
||||
locked = FALSE
|
||||
if(ismob(master.loc))
|
||||
@@ -243,9 +251,38 @@ GLOBAL_LIST_EMPTY(uplinks)
|
||||
|
||||
/datum/component/uplink/proc/pen_rotation(datum/source, degrees, mob/living/carbon/user)
|
||||
var/obj/item/pen/master = parent
|
||||
if(degrees != master.traitor_unlock_degrees)
|
||||
if(degrees != unlock_code)
|
||||
if(degrees == failsafe_code) //Getting failsafes on pens is risky business
|
||||
failsafe()
|
||||
return
|
||||
locked = FALSE
|
||||
master.degrees = 0
|
||||
interact(null, user)
|
||||
to_chat(user, "<span class='warning'>Your pen makes a clicking noise, before quickly rotating back to 0 degrees!</span>")
|
||||
to_chat(user, "<span class='warning'>Your pen makes a clicking noise, before quickly rotating back to 0 degrees!</span>")
|
||||
|
||||
/datum/component/uplink/proc/setup_unlock_code()
|
||||
unlock_code = generate_code()
|
||||
var/obj/item/P = parent
|
||||
if(istype(parent,/obj/item/pda))
|
||||
unlock_note = "<B>Uplink Passcode:</B> [unlock_code] ([P.name])."
|
||||
else if(istype(parent,/obj/item/radio))
|
||||
unlock_note = "<B>Radio Frequency:</B> [format_frequency(unlock_code)] ([P.name])."
|
||||
else if(istype(parent,/obj/item/pen))
|
||||
unlock_note = "<B>Uplink Degrees:</B> [unlock_code] ([P.name])."
|
||||
|
||||
/datum/component/uplink/proc/generate_code()
|
||||
if(istype(parent,/obj/item/pda))
|
||||
return "[rand(100,999)] [pick(GLOB.phonetic_alphabet)]"
|
||||
else if(istype(parent,/obj/item/radio))
|
||||
return sanitize_frequency(rand(MIN_FREQ, MAX_FREQ))
|
||||
else if(istype(parent,/obj/item/pen))
|
||||
return rand(1, 360)
|
||||
|
||||
/datum/component/uplink/proc/failsafe()
|
||||
if(!parent)
|
||||
return
|
||||
var/turf/T = get_turf(parent)
|
||||
if(!T)
|
||||
return
|
||||
explosion(T,1,2,3)
|
||||
qdel(parent) //Alternatively could brick the uplink.
|
||||
|
||||
Reference in New Issue
Block a user