Revert "Merge branch 'master' into fairylights"

This reverts commit 2947727659, reversing
changes made to 91063fe882.
This commit is contained in:
Dahlular
2022-07-09 04:55:33 -06:00
parent eb22b66720
commit e51460cb5d
123 changed files with 2065 additions and 3633 deletions
-18
View File
@@ -132,12 +132,6 @@
if(!GLOB.taur_list.len)
init_sprite_accessory_subtypes(/datum/sprite_accessory/taur, GLOB.taur_list)
L[DNA_TAUR_BLOCK] = construct_block(GLOB.taur_list.Find(features["taur"]), GLOB.taur_list.len)
L[DNA_COSMETIC_HEAD_BLOCK] = construct_block(GLOB.cosmetic_heads.Find(features["cosmetic_head"]), GLOB.cosmetic_heads.len)
L[DNA_COSMETIC_CHEST_BLOCK] = construct_block(GLOB.cosmetic_chests.Find(features["cosmetic_chest"]), GLOB.cosmetic_chests.len)
L[DNA_COSMETIC_L_ARM_BLOCK] = construct_block(GLOB.cosmetic_arms.Find(features["cosmetic_l_arm"]), GLOB.cosmetic_arms.len)
L[DNA_COSMETIC_R_ARM_BLOCK] = construct_block(GLOB.cosmetic_arms.Find(features["cosmetic_r_arm"]), GLOB.cosmetic_arms.len)
L[DNA_COSMETIC_L_LEG_BLOCK] = construct_block(GLOB.cosmetic_legs.Find(features["cosmetic_l_leg"]), GLOB.cosmetic_legs.len)
L[DNA_COSMETIC_R_LEG_BLOCK] = construct_block(GLOB.cosmetic_legs.Find(features["cosmetic_r_leg"]), GLOB.cosmetic_legs.len)
for(var/i=1, i<=DNA_UNI_IDENTITY_BLOCKS, i++)
if(L[i])
@@ -233,18 +227,6 @@
construct_block(GLOB.mam_body_markings_list.Find(features["mam_body_markings"]), GLOB.mam_body_markings_list.len)
if(DNA_TAUR_BLOCK)
construct_block(GLOB.taur_list.Find(features["taur"]), GLOB.taur_list.len)
if(DNA_COSMETIC_HEAD_BLOCK)
construct_block(GLOB.cosmetic_heads.Find(features["cosmetic_head"]), GLOB.cosmetic_heads.len)
if(DNA_COSMETIC_CHEST_BLOCK)
construct_block(GLOB.cosmetic_chests.Find(features["cosmetic_chest"]), GLOB.cosmetic_chests.len)
if(DNA_COSMETIC_L_ARM_BLOCK)
construct_block(GLOB.cosmetic_arms.Find(features["cosmetic_l_arm"]), GLOB.cosmetic_arms.len)
if(DNA_COSMETIC_R_ARM_BLOCK)
construct_block(GLOB.cosmetic_arms.Find(features["cosmetic_r_arm"]), GLOB.cosmetic_arms.len)
if(DNA_COSMETIC_L_LEG_BLOCK)
construct_block(GLOB.cosmetic_legs.Find(features["cosmetic_l_leg"]), GLOB.cosmetic_legs.len)
if(DNA_COSMETIC_R_LEG_BLOCK)
construct_block(GLOB.cosmetic_legs.Find(features["cosmetic_r_leg"]), GLOB.cosmetic_legs.len)
//Please use add_mutation or activate_mutation instead
/datum/dna/proc/force_give(datum/mutation/human/HM)
-39
View File
@@ -1,39 +0,0 @@
/**
* Element for making items change scaling depending on if they appear in the world or in a storage container.
*
* For context, overworld items are anything on a turf, storage scaling includes anywhere that the item is used as a UI element.
* Scaling should affect the target's icon and any affecting overlays
*/
/datum/element/item_scaling
element_flags = ELEMENT_BESPOKE
id_arg_index = 2
/// Value to scale the target by when it's in the overworld (on a turf)
var/overworld_scaling = 1
/// Value to scale the target by when it's in a storage component or inventory slot
var/storage_scaling = 1
/datum/element/item_scaling/Attach(datum/target, overworld_scaling = 1, storage_scaling = 1)
. = ..()
if(!isatom(target))
return ELEMENT_INCOMPATIBLE
src.overworld_scaling = overworld_scaling
src.storage_scaling = storage_scaling
scale(target, overworld_scaling)
RegisterSignal(target, list(COMSIG_ITEM_DROPPED, COMSIG_STORAGE_EXITED), .proc/scale_overworld)
RegisterSignal(target, list(COMSIG_ITEM_EQUIPPED, COMSIG_STORAGE_ENTERED), .proc/scale_storage)
//scale :)
/datum/element/item_scaling/proc/scale(atom/source, scaling)
var/matrix/M = matrix()
source.transform = M.Scale(scaling)
/// Signal handler for when the item is dropped
/datum/element/item_scaling/proc/scale_overworld(datum/source)
scale(source, overworld_scaling)
/// Signal handler for when the item is picked up
/datum/element/item_scaling/proc/scale_storage(datum/source)
scale(source, storage_scaling)
-143
View File
@@ -1,143 +0,0 @@
#define KNS_KICK_COMBO "DG"
#define KNS_RESTRAIN_COMBO "GG"
/datum/martial_art/kinaris
name = "KNS CQC"
id = MARTIALART_KNS_CQC
help_verb = /mob/living/carbon/human/proc/KNS_CQC_help
block_chance = 75
/datum/martial_art/kinaris/proc/drop_restraining()
restraining = FALSE
/datum/martial_art/kinaris/proc/check_streak(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(!can_use(A))
return FALSE
if(findtext(streak,KNS_KICK_COMBO))
streak = ""
Kick(A,D)
return TRUE
if(findtext(streak,KNS_RESTRAIN_COMBO))
streak = ""
Restrain(A,D)
return TRUE
return FALSE
/datum/martial_art/kinaris/proc/Kick(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(!can_use(A))
return FALSE
if(!D.stat || !D.IsKnockdown())
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 (KNS CQC)")
if(D.IsKnockdown() && !D.stat)
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)
return TRUE
/datum/martial_art/kinaris/proc/Restrain(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(restraining)
return
if(!can_use(A))
return FALSE
if(!D.stat)
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.Stun(100)
restraining = TRUE
addtimer(CALLBACK(src, .proc/drop_restraining), 50, TIMER_UNIQUE)
return TRUE
/datum/martial_art/kinaris/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(!can_use(A))
return FALSE
add_to_streak("G",D)
if(check_streak(A,D))
return TRUE
if(A.grab_state >= GRAB_AGGRESSIVE)
D.grabbedby(A, 1)
else
A.start_pulling(D, 1)
if(A.pulling)
D.stop_pulling()
log_combat(A, D, "grabbed", addition="aggressively")
A.grab_state = GRAB_AGGRESSIVE //Instant aggressive grab
return TRUE
/datum/martial_art/kinaris/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(!can_use(A))
return FALSE
add_to_streak("D",D)
var/obj/item/I = null
if(check_streak(A,D))
return TRUE
if(prob(65))
if(!D.stat || !D.IsKnockdown() || !restraining)
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>")
playsound(get_turf(D), 'sound/weapons/cqchit1.ogg', 50, 1, -1)
if(I && D.temporarilyRemoveItemFromInventory(I))
A.put_in_hands(I)
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 (KNS CQC)", "[I ? " grabbing \the [I]" : ""]")
if(restraining && A.pulling == D)
D.visible_message("<span class='danger'>[A] puts [D] into a chokehold!</span>", \
"<span class='userdanger'>[A] puts you into a chokehold!</span>")
D.SetSleeping(400)
restraining = FALSE
if(A.grab_state < GRAB_NECK)
A.grab_state = GRAB_NECK
else
restraining = FALSE
return FALSE
return TRUE
/datum/martial_art/kinaris/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(!can_use(A))
return FALSE
log_combat(A, D, "attacked (KNS CQC)")
A.do_attack_animation(D)
var/picked_hit_type = pick("CQC'd", "Big Bossed")
var/bonus_damage = 13
if(D.IsKnockdown() || D.resting || D.lying)
bonus_damage += 5
picked_hit_type = "stomps on"
D.apply_damage(bonus_damage, PAIN)
if(picked_hit_type == "kicks" || picked_hit_type == "stomps on")
playsound(get_turf(D), 'sound/weapons/cqchit2.ogg', 50, 1, -1)
else
playsound(get_turf(D), 'sound/weapons/cqchit1.ogg', 50, 1, -1)
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] (KNS CQC)")
if(A.resting && !D.stat && !D.IsKnockdown())
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, PAIN)
D.Knockdown(60)
log_combat(A, D, "sweeped (KNS CQC)")
return TRUE
/mob/living/carbon/human/proc/KNS_CQC_help()
set name = "Remember The Basics"
set desc = "You try to remember some of the basics of training."
set category = "KNS CQC"
to_chat(usr, "<b><i>You try to remember some of your training, undertaken when entering Kinaris employ.</i></b>")
to_chat(usr, "<span class='notice'>CQC Kick</span>: Disarm Grab. Knocks opponent away. Knocks out stunned or knocked down opponents.")
to_chat(usr, "<span class='notice'>Restrain</span>: Grab Grab. Locks opponents into a restraining position, disarm to knock them out with a choke hold.")
+2 -70
View File
@@ -1,7 +1,3 @@
/*
* Creates a weakref to the given input.
* See /datum/weakref's documentation for more information.
*/
/proc/WEAKREF(datum/input)
if(istype(input) && !QDELETED(input))
if(istype(input, /datum/weakref))
@@ -14,80 +10,16 @@
/datum/proc/create_weakref() //Forced creation for admin proccalls
return WEAKREF(src)
/**
* A weakref holds a non-owning reference to a datum.
* The datum can be referenced again using `resolve()`.
*
* To figure out why this is important, you must understand how deletion in
* BYOND works.
*
* Imagine a datum as a TV in a living room. When one person enters to watch
* TV, they turn it on. Others can come into the room and watch the TV.
* When the last person leaves the room, they turn off the TV because it's
* no longer being used.
*
* A datum being deleted tells everyone who's watching the TV to stop.
* If everyone leaves properly (AKA cleaning up their references), then the
* last person will turn off the TV, and everything is well.
* However, if someone is resistant (holds a hard reference after deletion),
* then someone has to walk in, drag them away, and turn off the TV forecefully.
* This process is very slow, and it's known as hard deletion.
*
* This is where weak references come in. Weak references don't count as someone
* watching the TV. Thus, when what it's referencing is destroyed, it will
* hopefully clean up properly, and limit hard deletions.
*
* A common use case for weak references is holding onto what created itself.
* For example, if a machine wanted to know what its last user was, it might
* create a `var/mob/living/last_user`. However, this is a strong reference to
* the mob, and thus will force a hard deletion when that mob is deleted.
* It is often better in this case to instead create a weakref to the user,
* meaning this type definition becomes `var/datum/weakref/last_user`.
*
* A good rule of thumb is that you should hold strong references to things
* that you *own*. For example, a dog holding a chew toy would be the owner
* of that chew toy, and thus a `var/obj/item/chew_toy` reference is fine
* (as long as it is cleaned up properly).
* However, a chew toy does not own its dog, so a `var/mob/living/dog/owner`
* might be inferior to a weakref.
* This is also a good rule of thumb to avoid circular references, such as the
* chew toy example. A circular reference that doesn't clean itself up properly
* will always hard delete.
*/
/datum/weakref
var/reference
/datum/weakref/New(datum/thing)
reference = REF(thing)
/datum/weakref/Destroy(force)
var/datum/target = resolve()
qdel(target)
/datum/weakref/Destroy()
return QDEL_HINT_LETMELIVE //Let BYOND autoGC thiswhen nothing is using it anymore.
if(!force)
return QDEL_HINT_LETMELIVE //Let BYOND autoGC thiswhen nothing is using it anymore.
target?.weak_reference = null
return ..()
/**
* Retrieves the datum that this weakref is referencing.
*
* This will return `null` if the datum was deleted. This MUST be respected.
*/
/datum/weakref/proc/resolve()
var/datum/D = locate(reference)
return (!QDELETED(D) && D.weak_reference == src) ? D : null
/datum/weakref/vv_get_dropdown()
. = ..()
VV_DROPDOWN_OPTION(VV_HK_WEAKREF_RESOLVE, "Go to reference")
/datum/weakref/vv_do_topic(list/href_list)
. = ..()
if(href_list[VV_HK_WEAKREF_RESOLVE])
if(!check_rights(NONE))
return
var/datum/R = resolve()
if(R)
usr.client.debug_variables(R)