Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbiosis #1172

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/__SPLURTCODE/DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@
#define TRAIT_MESSY "messy"
#define TRAIT_RESTORATIVE_METABOLISM "restorative_metabolism"
#define TRAIT_KISS_SLUT "kiss_slut"
#define TRAIT_SYMBIOTE "symbiote"
41 changes: 41 additions & 0 deletions modular_splurt/code/datums/traits/neutral.dm
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,47 @@
// Revoke quirk action
quirk_action.Remove(quirk_holder)

/datum/quirk/symbiote //adds the symbiote quirk
name = "Symbiote"
desc = "An alien parasite resides within you, allowing you to swap between a human and slime like appearance."
value = 0
mob_trait = TRAIT_SYMBIOTE
gain_text = span_notice("You feel a sense of symbiosis.")
lose_text = span_notice("The you are no longer we.")
medical_record_text = "Patient has been reported howling at the night sky."
var/list/old_features

/datum/quirk/symbiote/add()
// Define old features
old_features = list("species" = SPECIES_HUMAN, "legs" = "Plantigrade", "size" = 1, "bark")

// Define quirk mob
var/mob/living/carbon/human/quirk_mob = quirk_holder

// Record features
old_features = quirk_mob.dna.features.Copy()
old_features["species"] = quirk_mob.dna.species.type
old_features["custom_species"] = quirk_mob.custom_species
old_features["size"] = get_size(quirk_mob)
old_features["bark"] = quirk_mob.vocal_bark_id
old_features["taur"] = quirk_mob.dna.features["taur"]
old_features["eye_type"] = quirk_mob.dna.species.eye_type
old_features["color"] = quirk_mob.dna.species.mutant_color

Check failure on line 513 in modular_splurt/code/datums/traits/neutral.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined field: "mutant_color" on /datum/species
/datum/quirk/symbiote/post_add()
// Define quirk action
var/datum/action/cooldown/symbiote/transform/quirk_action = new

// Grant quirk action
quirk_action.Grant(quirk_holder)

/datum/quirk/symbiote/remove()
// Define quirk action
var/datum/action/cooldown/symbiote/transform/quirk_action = locate() in quirk_holder.actions

// Revoke quirk action
quirk_action.Remove(quirk_holder)


/datum/quirk/gargoyle //Mmmm yes stone time
name = "Gargoyle"
desc = "You are some form of gargoyle! You can only leave your stone form for so long, and will have to return to it to regain energy. On the bright side, you heal in statue form!"
Expand Down
188 changes: 188 additions & 0 deletions modular_splurt/code/datums/traits/trait_actions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,194 @@
// Start cooldown
StartCooldown()

// Return success
return TRUE
//
//Quirk: Symbiote
//

/datum/action/cooldown/symbiote
name = "Symbiote Ability"
desc = "Do something related to werewolves."
icon_icon = 'modular_splurt/icons/mob/actions/misc_actions.dmi'
button_icon_state = "Transform"
check_flags = AB_CHECK_RESTRAINED | AB_CHECK_STUN | AB_CHECK_CONSCIOUS | AB_CHECK_ALIVE
cooldown_time = 5 SECONDS
transparent_when_unavailable = TRUE

/datum/action/cooldown/symbiote/transform
name = "Toggle Symbiote Form"
desc = "Become one with your symbiote form."
var/transformed = FALSE
var/species_changed = FALSE
var/symbiote_gender = "Lycan"
var/list/old_features

/datum/action/cooldown/symbiote/transform/Grant()
. = ..()

// Define carbon owner
var/mob/living/carbon/action_owner_carbon = owner

// Define parent quirk
var/datum/quirk/symbiote/quirk_data = locate() in action_owner_carbon.roundstart_quirks

// Check if data was copied
if(!quirk_data)
// Log error and return
log_game("Failed to get species data for symbiote action!")
return

// Define stored features
old_features = quirk_data.old_features.Copy()

// Define action owner
var/mob/living/carbon/human/action_owner = owner

// Set species gendered name
switch(action_owner.gender)
if(MALE)
symbiote_gender = "Symbiote"
if(FEMALE)
symbiote_gender = "Symbiote"
if(PLURAL)
symbiote_gender = "Symbiote"
if(NEUTER)
symbiote_gender = "Symbiote"

/datum/action/cooldown/symbiote/transform/Activate()
// Define action owner
var/mob/living/carbon/human/action_owner = owner

// Check for restraints
if(!CHECK_MOBILITY(action_owner, MOBILITY_USE))
// Warn user, then return
action_owner.visible_message(span_warning("You cannot transform while restrained!"))
return

// Define citadel organs
var/obj/item/organ/genital/penis/organ_penis = action_owner.getorganslot(ORGAN_SLOT_PENIS)
var/obj/item/organ/genital/breasts/organ_breasts = action_owner.getorganslot(ORGAN_SLOT_BREASTS)
var/obj/item/organ/genital/vagina/organ_vagina = action_owner.getorganslot(ORGAN_SLOT_VAGINA)

// Play shake animation
action_owner.shake_animation(2)

// Transform into wolf form
if(!transformed)
// Define current species type
var/datum/species/owner_species = action_owner.dna.species.type

// Check if species has changed
if(old_features["species"] != owner_species)
// Set old species
old_features["species"] = owner_species

// Define species prefix
var/custom_species_prefix

// Check if species is mammal (anthro)
if(isjellyperson(action_owner))
// Do nothing!

// Check if species is already a mammal sub-type
else if(ispath(owner_species, /datum/species/jelly))

// Species is not a mammal
else
// Change species
action_owner.set_species(/datum/species/jelly, 1)

// Set species changed
species_changed = TRUE

// Set species features
action_owner.dna.custom_species = "[custom_species_prefix][symbiote_gender]"
action_owner.dna.species.mutant_bodyparts["legs"] = "Digitigrade"
action_owner.Digitigrade_Leg_Swap(FALSE)
action_owner.dna.features["legs"] = "Digitigrade"
action_owner.update_size(clamp(get_size(action_owner) + 0.5, RESIZE_MICRO, RESIZE_MACRO))
action_owner.set_bark("mutedc2")
if(!(action_owner.dna.species.species_traits.Find(DIGITIGRADE)))
action_owner.dna.species.species_traits += DIGITIGRADE
action_owner.update_body()
action_owner.update_body_parts()

// Update possible citadel organs
if(organ_breasts)
organ_breasts.color = "#[action_owner.dna.features["mcolor"]]"
organ_breasts.update()
if(organ_penis)
organ_penis.shape = "Tentacled"
organ_penis.update()
organ_penis.modify_size(6)
if(organ_vagina)
organ_vagina.shape = "Tentacle"
organ_vagina.color = "#[action_owner.dna.features["mcolor"]]"
organ_vagina.update()

// Un-transform from wolf form
else
// Check if species was already mammal (anthro)
if(!species_changed)
// Do nothing!

// Species was not a mammal
else
// Revert species
action_owner.set_species(old_features["species"], TRUE)

// Clear species changed flag
species_changed = FALSE

// Revert species trait
action_owner.set_bark(old_features["bark"])
action_owner.dna.custom_species = old_features["custom_species"]
action_owner.dna.features["mam_ears"] = old_features["mam_ears"]
action_owner.dna.features["mam_snouts"] = old_features["mam_snouts"]
action_owner.dna.features["mam_tail"] = old_features["mam_tail"]
action_owner.dna.features["legs"] = old_features["legs"]
action_owner.dna.features["insect_fluff"] = old_features["insect_fluff"]
action.owner.dna.features["color"] = old_features["color"] = quirk_mob.dna.species.mutant_color

Check failure on line 1529 in modular_splurt/code/datums/traits/trait_actions.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined var: "action"

Check warning on line 1529 in modular_splurt/code/datums/traits/trait_actions.dm

View workflow job for this annotation

GitHub Actions / Run Linters

field access requires static type: "owner"

Check warning on line 1529 in modular_splurt/code/datums/traits/trait_actions.dm

View workflow job for this annotation

GitHub Actions / Run Linters

field access requires static type: "dna"

Check warning on line 1529 in modular_splurt/code/datums/traits/trait_actions.dm

View workflow job for this annotation

GitHub Actions / Run Linters

field access requires static type: "features"

Check failure on line 1529 in modular_splurt/code/datums/traits/trait_actions.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined var: "quirk_mob"

Check warning on line 1529 in modular_splurt/code/datums/traits/trait_actions.dm

View workflow job for this annotation

GitHub Actions / Run Linters

field access requires static type: "dna"

Check warning on line 1529 in modular_splurt/code/datums/traits/trait_actions.dm

View workflow job for this annotation

GitHub Actions / Run Linters

field access requires static type: "species"

Check warning on line 1529 in modular_splurt/code/datums/traits/trait_actions.dm

View workflow job for this annotation

GitHub Actions / Run Linters

field access requires static type: "mutant_color"
action_owner.dna.species.eye_type = old_features["eye_type"]
if(old_features["taur"] != "None")
action_owner.dna.features["taur"] = old_features["taur"]
if(old_features["legs"] == "Plantigrade")
action_owner.dna.species.species_traits -= DIGITIGRADE
action_owner.Digitigrade_Leg_Swap(TRUE)
action_owner.dna.species.mutant_bodyparts["legs"] = old_features["legs"]
action_owner.update_body()
action_owner.update_body_parts()
action_owner.update_size(clamp(get_size(action_owner) - 0.5, RESIZE_MICRO, RESIZE_MACRO))

// Revert citadel organs
if(organ_breasts)
organ_breasts.color = "#[old_features["breasts_color"]]"
organ_breasts.update()
if(action_owner.has_penis())
organ_penis.shape = old_features["cock_shape"]
organ_penis.color = "#[old_features["cock_color"]]"
organ_penis.update()
organ_penis.modify_size(-6)
if(action_owner.has_vagina())
organ_vagina.shape = old_features["vag_shape"]
organ_vagina.color = "#[old_features["vag_color"]]"
organ_vagina.update()
organ_vagina.update_size()

// Set transformation message
var/owner_p_their = action_owner.p_their()
var/toggle_message = (!transformed ? "[action_owner] shivers, [owner_p_their] flesh bursting with a sudden growth of thick slime as [owner_p_their] features contort to that of a symbiote, fully transforming [action_owner.p_them()] into a symbiote!" : "[action_owner] shrinks, [owner_p_their] Monstrous features quickly receding.")

// Alert in local chat
action_owner.visible_message(span_danger(toggle_message))

// Toggle transformation state
transformed = !transformed

// Start cooldown
StartCooldown()

// Return success
return TRUE

Expand Down
Loading