Merge remote-tracking branch 'origin/master' into TGUI-4

This commit is contained in:
Letter N
2020-08-04 09:31:34 +08:00
94 changed files with 5367 additions and 4268 deletions
@@ -263,6 +263,14 @@
time = 30
category = CAT_CLOTHING
/datum/crafting_recipe/durathread_reinforcement_kit
name = "Durathread Reinforcement Kit"
result = /obj/item/armorkit
reqs = list(/obj/item/stack/sheet/durathread = 4)
tools = list(/obj/item/stack/sheet/mineral/titanium, TOOL_WIRECUTTER) // tough needle for a tough fabric
time = 40
category = CAT_CLOTHING
/datum/crafting_recipe/durathread_duffelbag
name = "Durathread Dufflebag"
result = /obj/item/storage/backpack/duffelbag/durathread
+91
View File
@@ -0,0 +1,91 @@
/**
* KILLER QUEEN
*
* Simple contact bomb component
* Blows up the first person to touch it.
*/
/datum/component/killerqueen
can_transfer = TRUE
/// strength of explosion on the touch-er. 0 to disable. usually only used if the normal explosion is disabled (this is the default).
var/ex_strength = EXPLODE_HEAVY
/// callback to invoke with (parent, victim) before standard detonation - useful for losing a reference to this component or implementing custom behavior. return FALSE to prevent explosion.
var/datum/callback/pre_explode
/// callback to invoke with (parent) when deleting without an explosion
var/datum/callback/failure
/// did we explode
var/exploded = FALSE
/// examine message
var/examine_message
/// light explosion radius
var/light = 0
/// heavy explosion radius
var/heavy = 0
/// dev explosion radius
var/dev = 0
/// flame explosion radius
var/flame = 0
/// only triggered by living mobs
var/living_only = TRUE
/datum/component/killerqueen/Initialize(ex_strength = EXPLODE_HEAVY, datum/callback/pre_explode, datum/callback/failure, examine_message, light = 0, heavy = 0, dev = 0, flame = 0, living_only = TRUE)
. = ..()
if(. & COMPONENT_INCOMPATIBLE)
return
if(!isatom(parent))
return COMPONENT_INCOMPATIBLE
src.ex_strength = ex_strength
src.pre_explode = pre_explode
src.failure = failure
src.examine_message = examine_message
src.light = light
src.heavy = heavy
src.dev = dev
src.flame = flame
src.living_only = living_only
/datum/component/killerqueen/Destroy()
if(!exploded)
failure?.Invoke(parent)
return ..()
/datum/component/killerqueen/RegisterWithParent()
. = ..()
RegisterSignal(parent, list(COMSIG_ATOM_ATTACK_HAND, COMSIG_ATOM_ATTACK_PAW, COMSIG_ATOM_ATTACK_ANIMAL), .proc/touch_detonate)
RegisterSignal(parent, COMSIG_MOVABLE_BUMP, .proc/bump_detonate)
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, .proc/attackby_detonate)
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/on_examine)
/datum/component/killerqueen/UnregisterFromParent()
. = ..()
UnregisterSignal(parent, list(COMSIG_ATOM_ATTACK_ANIMAL, COMSIG_ATOM_ATTACK_HAND, COMSIG_ATOM_ATTACK_PAW,
COMSIG_MOVABLE_BUMP, COMSIG_PARENT_ATTACKBY, COMSIG_PARENT_EXAMINE))
/datum/component/killerqueen/proc/attackby_detonate(datum/source, obj/item/I, mob/user)
detonate(user)
/datum/component/killerqueen/proc/bump_detonate(datum/source, atom/A)
detonate(A)
/datum/component/killerqueen/proc/touch_detonate(datum/source, mob/user)
detonate(user)
/datum/component/killerqueen/proc/on_examine(datum/source, mob/examiner, list/examine_return)
if(examine_message)
examine_return += examine_message
/datum/component/killerqueen/proc/detonate(atom/victim)
if(!isliving(victim) && living_only)
return
if(pre_explode && !pre_explode.Invoke(parent, victim))
return
if(ex_strength)
victim.ex_act(ex_strength)
if(light || heavy || dev || flame)
explosion(parent, dev, heavy, light, flame_range = flame)
else
var/turf/T = get_turf(parent)
playsound(T, 'sound/effects/explosion2.ogg', 200, 1)
new /obj/effect/temp_visual/explosion(T)
exploded = TRUE
qdel(src)
+9
View File
@@ -102,6 +102,15 @@ GLOBAL_LIST_EMPTY(uplinks)
return //no hitting everyone/everything just to try to slot tcs in!
if(istype(I, /obj/item/stack/telecrystal))
LoadTC(user, I)
if(active)
if(I.GetComponent(/datum/component/uplink))
var/datum/component/uplink/hidden_uplink = I.GetComponent(/datum/component/uplink)
var/amt = hidden_uplink.telecrystals
hidden_uplink.telecrystals -= amt
src.telecrystals += amt
to_chat(user, "<span class='notice'>You connect the [I] to your uplink, siphoning [amt] telecrystals before quickly undoing the connection.")
else
return
for(var/category in uplink_items)
for(var/item in uplink_items[category])
var/datum/uplink_item/UI = uplink_items[category][item]
+74
View File
@@ -0,0 +1,74 @@
/datum/http_request
var/id
var/in_progress = FALSE
var/method
var/body
var/headers
var/url
var/_raw_response
/datum/http_request/proc/prepare(method, url, body = "", list/headers)
if (!length(headers))
headers = ""
else
headers = json_encode(headers)
src.method = method
src.url = url
src.body = body
src.headers = headers
/datum/http_request/proc/execute_blocking()
_raw_response = rustg_http_request_blocking(method, url, body, headers)
/datum/http_request/proc/begin_async()
if (in_progress)
CRASH("Attempted to re-use a request object.")
id = rustg_http_request_async(method, url, body, headers)
if (isnull(text2num(id)))
stack_trace("Proc error: [id]")
_raw_response = "Proc error: [id]"
else
in_progress = TRUE
/datum/http_request/proc/is_complete()
if (isnull(id))
return TRUE
if (!in_progress)
return TRUE
var/r = rustg_http_check_request(id)
if (r == RUSTG_JOB_NO_RESULTS_YET)
return FALSE
else
_raw_response = r
in_progress = FALSE
return TRUE
/datum/http_request/proc/into_response()
var/datum/http_response/R = new()
try
var/list/L = json_decode(_raw_response)
R.status_code = L["status_code"]
R.headers = L["headers"]
R.body = L["body"]
catch
R.errored = TRUE
R.error = _raw_response
return R
/datum/http_response
var/status_code
var/body
var/list/headers
var/errored = FALSE
var/error
+3 -3
View File
@@ -44,11 +44,11 @@
//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(SEND_SIGNAL(D, COMSIG_COMBAT_MODE_CHECK, COMBAT_MODE_INACTIVE))
damage *= 1.5
damage *= 1.2
if(!CHECK_MOBILITY(A, MOBILITY_STAND))
damage *= 0.5
damage *= 0.7
if(SEND_SIGNAL(A, COMSIG_COMBAT_MODE_CHECK, COMBAT_MODE_INACTIVE))
damage *= 0.25
damage *= 0.8
return damage
/datum/martial_art/proc/teach(mob/living/carbon/human/H, make_temporary = FALSE)
+15
View File
@@ -97,6 +97,21 @@
duration = set_duration
return ..()
/datum/status_effect/off_balance
id = "offbalance"
alert_type = null
/datum/status_effect/off_balance/on_creation(mob/living/new_owner, set_duration)
if(isnum(set_duration))
duration = set_duration
return ..()
/datum/status_effect/off_balance/on_remove()
var/active_item = owner.get_active_held_item()
if(is_type_in_typecache(active_item, GLOB.shove_disarming_types))
owner.visible_message("<span class='warning'>[owner.name] regains their grip on \the [active_item]!</span>", "<span class='warning'>You regain your grip on \the [active_item]</span>", null, COMBAT_MESSAGE_RANGE)
return ..()
/obj/screen/alert/status_effect/asleep
name = "Asleep"
desc = "You've fallen asleep. Wait a bit and you should wake up. Unless you don't, considering how helpless you are."