From d3ea3ee4f13d5f4e230b2eb9f27f623ddc2f3765 Mon Sep 17 00:00:00 2001
From: qweq12yt <45515587+qweq12yt@users.noreply.github.com>
Date: Fri, 26 Feb 2021 18:13:12 -0300
Subject: [PATCH 1/6] fixes pacifist zombo
---
code/_onclick/item_attack.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm
index 7a614da07b..6495e18966 100644
--- a/code/_onclick/item_attack.dm
+++ b/code/_onclick/item_attack.dm
@@ -82,7 +82,7 @@
SEND_SIGNAL(user, COMSIG_MOB_ITEM_ATTACK, M, user)
if(item_flags & NOBLUDGEON)
return
- if(force && damtype != STAMINA && HAS_TRAIT(user, TRAIT_PACIFISM))
+ if(force && damtype != STAMINA && HAS_TRAIT(user, TRAIT_PACIFISM) && !is_species(user, /datum/species/zombie/infectious)) // probably it's here
to_chat(user, "You don't want to harm other living beings!")
return
From d02b713b461e3b401991e9b71b4d159ab722061b Mon Sep 17 00:00:00 2001
From: qweq12yt <45515587+qweq12yt@users.noreply.github.com>
Date: Fri, 26 Feb 2021 18:45:34 -0300
Subject: [PATCH 2/6] removes a comment i left behind
---
code/_onclick/item_attack.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm
index 6495e18966..327e6df0e5 100644
--- a/code/_onclick/item_attack.dm
+++ b/code/_onclick/item_attack.dm
@@ -82,7 +82,7 @@
SEND_SIGNAL(user, COMSIG_MOB_ITEM_ATTACK, M, user)
if(item_flags & NOBLUDGEON)
return
- if(force && damtype != STAMINA && HAS_TRAIT(user, TRAIT_PACIFISM) && !is_species(user, /datum/species/zombie/infectious)) // probably it's here
+ if(force && damtype != STAMINA && HAS_TRAIT(user, TRAIT_PACIFISM) && !is_species(user, /datum/species/zombie/infectious))
to_chat(user, "You don't want to harm other living beings!")
return
From 04d478bb208f1e90db4b61fcd2cc0c527f6d34b0 Mon Sep 17 00:00:00 2001
From: qweq12yt <45515587+qweq12yt@users.noreply.github.com>
Date: Sat, 27 Feb 2021 01:49:56 -0300
Subject: [PATCH 3/6] turning removes pacifism
---
code/_onclick/item_attack.dm | 2 +-
code/modules/mob/living/carbon/human/species.dm | 2 ++
.../mob/living/carbon/human/species_types/zombies.dm | 6 ++++++
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm
index 327e6df0e5..7a614da07b 100644
--- a/code/_onclick/item_attack.dm
+++ b/code/_onclick/item_attack.dm
@@ -82,7 +82,7 @@
SEND_SIGNAL(user, COMSIG_MOB_ITEM_ATTACK, M, user)
if(item_flags & NOBLUDGEON)
return
- if(force && damtype != STAMINA && HAS_TRAIT(user, TRAIT_PACIFISM) && !is_species(user, /datum/species/zombie/infectious))
+ if(force && damtype != STAMINA && HAS_TRAIT(user, TRAIT_PACIFISM))
to_chat(user, "You don't want to harm other living beings!")
return
diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm
index 432052d322..d67265be53 100644
--- a/code/modules/mob/living/carbon/human/species.dm
+++ b/code/modules/mob/living/carbon/human/species.dm
@@ -78,6 +78,8 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
var/list/species_traits = list(HAS_FLESH,HAS_BONE) //by default they can scar and have bones/flesh unless set to something else
// generic traits tied to having the species
var/list/inherent_traits = list()
+ // blacklisted traits that conflict with species. If i can figure how to use these lists and mass removes, will uncomment
+ //var/list/blacklisted_traits = list()
var/inherent_biotypes = MOB_ORGANIC|MOB_HUMANOID
var/attack_verb = "punch" // punch-specific attack verb
diff --git a/code/modules/mob/living/carbon/human/species_types/zombies.dm b/code/modules/mob/living/carbon/human/species_types/zombies.dm
index 385dd94f04..91e00bb3f5 100644
--- a/code/modules/mob/living/carbon/human/species_types/zombies.dm
+++ b/code/modules/mob/living/carbon/human/species_types/zombies.dm
@@ -37,6 +37,8 @@
armor = 20 // 120 damage to KO a zombie, which kills it
speedmod = 1.6 // they're very slow
mutanteyes = /obj/item/organ/eyes/night_vision/zombie
+ // same as in species.dm
+ //blacklisted_traits = list(TRAIT_PACIFISM)
var/heal_rate = 1
var/regen_cooldown = 0
@@ -96,6 +98,10 @@
part.incoming_stam_mult = incoming_stam_mult
//todo: add negative wound resistance to all parts when wounds is merged (zombies are physically weak in terms of limbs)
+ // this removes pacifism quirk so our zombie can attack normally. but how to add back when cured?
+ REMOVE_TRAIT(C, TRAIT_PACIFISM, ROUNDSTART_TRAIT) // and why "cannot be removed without admin intervention"? what does that mean?
+
+
// Your skin falls off
/datum/species/krokodil_addict
name = SPECIES_HUMAN
From d8d2a5d4c41545916600762662e9dea4b03752a5 Mon Sep 17 00:00:00 2001
From: qweq12yt <45515587+qweq12yt@users.noreply.github.com>
Date: Sat, 27 Feb 2021 15:56:44 -0300
Subject: [PATCH 4/6] using quirk susbsysten instead of trats
---
.../modules/mob/living/carbon/human/species.dm | 18 ++++++++++++++++--
.../carbon/human/species_types/zombies.dm | 7 +------
2 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm
index d67265be53..0e9441f731 100644
--- a/code/modules/mob/living/carbon/human/species.dm
+++ b/code/modules/mob/living/carbon/human/species.dm
@@ -78,10 +78,10 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
var/list/species_traits = list(HAS_FLESH,HAS_BONE) //by default they can scar and have bones/flesh unless set to something else
// generic traits tied to having the species
var/list/inherent_traits = list()
- // blacklisted traits that conflict with species. If i can figure how to use these lists and mass removes, will uncomment
- //var/list/blacklisted_traits = list()
var/inherent_biotypes = MOB_ORGANIC|MOB_HUMANOID
+ var/list/blacklisted_quirks = list() // Quirks that will be removed upon gaining this species, to be defined by species
+
var/attack_verb = "punch" // punch-specific attack verb
var/sound/attack_sound = 'sound/weapons/punch1.ogg'
var/sound/miss_sound = 'sound/weapons/punchmiss.ogg'
@@ -344,6 +344,9 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
for(var/X in inherent_traits)
ADD_TRAIT(C, X, SPECIES_TRAIT)
+ //lets remove those conflicting quirks
+ remove_blacklisted_quirks(C)
+
if(TRAIT_VIRUSIMMUNE in inherent_traits)
for(var/datum/disease/A in C.diseases)
A.cure(FALSE)
@@ -426,6 +429,17 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
SEND_SIGNAL(C, COMSIG_SPECIES_LOSS, src)
+// shamelessly inspired by antag_datum.remove_blacklisted_quirks()
+/datum/species/proc/remove_blacklisted_quirks(mob/living/carbon/C)
+ var/mob/living/L = C.mind.current
+ if(istype(L))
+ var/list/my_quirks = L.client?.prefs.all_quirks.Copy()
+ SSquirks.filter_quirks(my_quirks, blacklisted_quirks)
+ for(var/q in L.roundstart_quirks)
+ var/datum/quirk/Q = q
+ if(!(SSquirks.quirk_name_by_path(Q.type) in my_quirks))
+ L.remove_quirk(Q.type)
+
/datum/species/proc/handle_hair(mob/living/carbon/human/H, forced_colour)
H.remove_overlay(HAIR_LAYER)
var/obj/item/bodypart/head/HD = H.get_bodypart(BODY_ZONE_HEAD)
diff --git a/code/modules/mob/living/carbon/human/species_types/zombies.dm b/code/modules/mob/living/carbon/human/species_types/zombies.dm
index 91e00bb3f5..57a11481d7 100644
--- a/code/modules/mob/living/carbon/human/species_types/zombies.dm
+++ b/code/modules/mob/living/carbon/human/species_types/zombies.dm
@@ -37,8 +37,7 @@
armor = 20 // 120 damage to KO a zombie, which kills it
speedmod = 1.6 // they're very slow
mutanteyes = /obj/item/organ/eyes/night_vision/zombie
- // same as in species.dm
- //blacklisted_traits = list(TRAIT_PACIFISM)
+ blacklisted_quirks = list(/datum/quirk/nonviolent)
var/heal_rate = 1
var/regen_cooldown = 0
@@ -98,10 +97,6 @@
part.incoming_stam_mult = incoming_stam_mult
//todo: add negative wound resistance to all parts when wounds is merged (zombies are physically weak in terms of limbs)
- // this removes pacifism quirk so our zombie can attack normally. but how to add back when cured?
- REMOVE_TRAIT(C, TRAIT_PACIFISM, ROUNDSTART_TRAIT) // and why "cannot be removed without admin intervention"? what does that mean?
-
-
// Your skin falls off
/datum/species/krokodil_addict
name = SPECIES_HUMAN
From 6d5afe146c327216dbedb76d0d07a1b50b489bee Mon Sep 17 00:00:00 2001
From: qweq12yt <45515587+qweq12yt@users.noreply.github.com>
Date: Sat, 27 Feb 2021 19:17:12 -0300
Subject: [PATCH 5/6] restores any removed quirks when unchanging
---
code/modules/mob/living/carbon/human/species.dm | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm
index 0e9441f731..cb5abb56aa 100644
--- a/code/modules/mob/living/carbon/human/species.dm
+++ b/code/modules/mob/living/carbon/human/species.dm
@@ -81,6 +81,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
var/inherent_biotypes = MOB_ORGANIC|MOB_HUMANOID
var/list/blacklisted_quirks = list() // Quirks that will be removed upon gaining this species, to be defined by species
+ var/list/removed_quirks = list() // Quirks that got removed due to being blacklisted, and will be restored when on_species_loss() is called
var/attack_verb = "punch" // punch-specific attack verb
var/sound/attack_sound = 'sound/weapons/punch1.ogg'
@@ -400,6 +401,9 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
for(var/X in inherent_traits)
REMOVE_TRAIT(C, X, SPECIES_TRAIT)
+ // lets restore the quirks that got removed when gaining this species
+ restore_quirks(C)
+
C.remove_movespeed_modifier(/datum/movespeed_modifier/species)
if(mutant_bodyparts["meat_type"])
@@ -431,7 +435,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
// shamelessly inspired by antag_datum.remove_blacklisted_quirks()
/datum/species/proc/remove_blacklisted_quirks(mob/living/carbon/C)
- var/mob/living/L = C.mind.current
+ var/mob/living/L = C.mind?.current
if(istype(L))
var/list/my_quirks = L.client?.prefs.all_quirks.Copy()
SSquirks.filter_quirks(my_quirks, blacklisted_quirks)
@@ -439,6 +443,15 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
var/datum/quirk/Q = q
if(!(SSquirks.quirk_name_by_path(Q.type) in my_quirks))
L.remove_quirk(Q.type)
+ removed_quirks += Q.type
+
+// restore any quirks that we removed
+datum/species/proc/restore_quirks(mob/living/carbon/C)
+ var/mob/living/L = C.mind?.current
+ if(istype(L))
+ for(var/q in removed_quirks)
+ L.add_quirk(q)
+
/datum/species/proc/handle_hair(mob/living/carbon/human/H, forced_colour)
H.remove_overlay(HAIR_LAYER)
From d89bc85ae72ea90a690c012ca5201ce4ada3d4ee Mon Sep 17 00:00:00 2001
From: qweq12yt <45515587+qweq12yt@users.noreply.github.com>
Date: Sat, 27 Feb 2021 19:26:29 -0300
Subject: [PATCH 6/6] oops forgot a "/"
it could happen to anyone
---
code/modules/mob/living/carbon/human/species.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm
index cb5abb56aa..2334520d90 100644
--- a/code/modules/mob/living/carbon/human/species.dm
+++ b/code/modules/mob/living/carbon/human/species.dm
@@ -446,7 +446,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
removed_quirks += Q.type
// restore any quirks that we removed
-datum/species/proc/restore_quirks(mob/living/carbon/C)
+/datum/species/proc/restore_quirks(mob/living/carbon/C)
var/mob/living/L = C.mind?.current
if(istype(L))
for(var/q in removed_quirks)