slendermen fix. (#12303)

* slendermen fix.

* Whops

* Update dwarfism.dm
This commit is contained in:
Ghom
2020-05-21 03:43:14 +02:00
committed by GitHub
parent 7f38e0714b
commit 6696560656
6 changed files with 50 additions and 4 deletions

View File

@@ -318,6 +318,9 @@
#define COMSIG_SPECIES_GAIN "species_gain" //from datum/species/on_species_gain(): (datum/species/new_species, datum/species/old_species)
#define COMSIG_SPECIES_LOSS "species_loss" //from datum/species/on_species_loss(): (datum/species/lost_species)
// /datum/mutation signals
#define COMSIG_HUMAN_MUTATION_LOSS "human_mutation_loss" //from datum/mutation/human/on_losing(): (datum/mutation/human/lost_mutation)
/*******Component Specific Signals*******/
//Janitor
#define COMSIG_TURF_IS_WET "check_turf_wet" //(): Returns bitflags of wet values.

View File

@@ -0,0 +1,42 @@
#define SHORT 4/5
#define TALL 5/4
///Very similar to squish, but for dwarves and shorties
/datum/element/dwarfism
element_flags = ELEMENT_DETACH|ELEMENT_BESPOKE
id_arg_index = 2
var/comsig
var/list/attached_targets = list()
/datum/element/dwarfism/Attach(datum/target, comsig, comsig_target)
. = ..()
if(!isliving(target))
return ELEMENT_INCOMPATIBLE
src.comsig = comsig
var/mob/living/L = target
if(L.lying != 0)
L.transform = L.transform.Scale(SHORT, 1)
else
L.transform = L.transform.Scale(1, SHORT)
attached_targets[target] = comsig_target
RegisterSignal(target, comsig, .proc/check_loss) //Second arg of the signal will be checked against the comsig_target.
/datum/element/dwarfism/proc/check_loss(mob/living/L, comsig_target)
if(attached_targets[L] == comsig_target)
Detach(L)
/datum/element/dwarfism/Detach(mob/living/L)
. = ..()
if(QDELETED(L))
return
if(L.lying != 0)
L.transform = L.transform.Scale(TALL, 1)
else
L.transform = L.transform.Scale(1, TALL)
UnregisterSignal(L, comsig)
attached_targets -= L
#undef SHORT
#undef TALL

View File

@@ -116,7 +116,8 @@
owner.apply_overlay(layer_used)
if(power)
owner.RemoveSpell(power)
qdel(src)
qdel(power)
SEND_SIGNAL(owner, COMSIG_HUMAN_MUTATION_LOSS, src)
return 0
return 1

View File

@@ -82,7 +82,7 @@
if(..())
return
ADD_TRAIT(owner, TRAIT_DWARF, GENETIC_MUTATION)
owner.transform = owner.transform.Scale(1, 0.8)
AddElement(/datum/element/dwarfism, COMSIG_HUMAN_MUTATION_LOSS, src)
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>")

View File

@@ -33,12 +33,11 @@ GLOBAL_LIST_INIT(dwarf_last, world.file2list("strings/names/dwarf_last.txt")) //
var/mob/living/carbon/human/H = C
H.facial_hair_style = dwarf_hair
H.update_hair()
H.transform = H.transform.Scale(1, 0.8) //We use scale, and yeah. Dwarves can become gnomes with DWARFISM.
AddElement(/datum/element/dwarfism, COMSIG_SPECIES_LOSS, src)
RegisterSignal(C, COMSIG_MOB_SAY, .proc/handle_speech) //We register handle_speech is being used.
/datum/species/dwarf/on_species_loss(mob/living/carbon/H, datum/species/new_species)
. = ..()
H.transform = H.transform.Scale(1, 1.25) //And we undo it.
UnregisterSignal(H, COMSIG_MOB_SAY) //We register handle_speech is not being used.
//Dwarf Name stuff

View File

@@ -528,6 +528,7 @@
#include "code\datums\elements\cleaning.dm"
#include "code\datums\elements\dusts_on_catatonia.dm"
#include "code\datums\elements\dusts_on_leaving_area.dm"
#include "code\datums\elements\dwarfism.dm"
#include "code\datums\elements\earhealing.dm"
#include "code\datums\elements\firestacker.dm"
#include "code\datums\elements\flavor_text.dm"