forked from tgstation/tgstation
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from Nerev4r/snailsfordinneragain
Snails, Except Twice
- Loading branch information
Showing
19 changed files
with
340 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#define BODYPART_ICON_SNAIL 'modular_doppler/modular_species/species_types/snails/icons/bodyparts/snail_bodyparts.dmi' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-117 Bytes
(95%)
code/modules/unit_tests/screenshots/screenshot_humanoids__datum_species_snail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
modular_doppler/modular_customization/organs/internal/eyes.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/obj/item/organ/internal/eyes | ||
var/eyes_layer = BODY_LAYER |
Binary file added
BIN
+1.15 KB
modular_doppler/modular_species/species_types/snails/icons/bodyparts/snail_bodyparts.dmi
Binary file not shown.
Binary file added
BIN
+1.99 KB
modular_doppler/modular_species/species_types/snails/icons/organs/snail_eyes.dmi
Binary file not shown.
Binary file added
BIN
+415 Bytes
modular_doppler/modular_species/species_types/snails/icons/organs/snail_heart.dmi
Binary file not shown.
Binary file added
BIN
+338 Bytes
modular_doppler/modular_species/species_types/snails/icons/organs/snail_liver.dmi
Binary file not shown.
Binary file added
BIN
+8.96 KB
modular_doppler/modular_species/species_types/snails/icons/shell/shell_mob.dmi
Binary file not shown.
Binary file added
BIN
+1.53 KB
modular_doppler/modular_species/species_types/snails/icons/shell/shell_obj.dmi
Binary file not shown.
190 changes: 190 additions & 0 deletions
190
modular_doppler/modular_species/species_types/snails/modular_snail.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,190 @@ | ||
#define SHELL_TRANSPARENCY_ALPHA 90 | ||
|
||
/datum/species/snail | ||
mutantliver = /obj/item/organ/internal/liver/snail //This is just a better liver to deal with toxins, it's a thematic thing. | ||
mutantheart = /obj/item/organ/internal/heart/snail //This gives them the shell buff where they take less damage from behind, and their heart's more durable. | ||
exotic_blood = null | ||
|
||
/datum/species/snail/on_species_gain(mob/living/carbon/new_snailperson, datum/species/old_species, pref_load) | ||
. = ..() | ||
new_snailperson.update_icons() | ||
|
||
/obj/item/storage/backpack/snail | ||
/// Whether or not a bluespace anomaly core has been inserted | ||
var/storage_core = FALSE | ||
slowdown = 6 // The snail's shell is what's making them slow. | ||
obj_flags = IMMUTABLE_SLOW //This should hopefully solve other issues involing it as well. | ||
alternate_worn_layer = ABOVE_BODY_FRONT_LAYER //This makes them layer over tails like the cult backpack; some tails really shouldn't appear over them! | ||
uses_advanced_reskins = TRUE | ||
unique_reskin = list( | ||
"Conical Shell" = list( | ||
RESKIN_ICON = 'modular_doppler/modular_species/species_types/snails/icons/shell/shell_obj.dmi', | ||
RESKIN_ICON_STATE = "coneshell", | ||
RESKIN_WORN_ICON = 'modular_doppler/modular_species/species_types/snails/icons/shell/shell_mob.dmi', | ||
RESKIN_WORN_ICON_STATE = "coneshell" | ||
), | ||
"Round Shell" = list( | ||
RESKIN_ICON = 'icons/obj/storage/backpack.dmi', | ||
RESKIN_ICON_STATE = "snailshell", | ||
RESKIN_WORN_ICON = 'icons/mob/clothing/back/backpack.dmi', | ||
RESKIN_WORN_ICON_STATE = "snailshell" | ||
), | ||
"Cinnamon Shell" = list( | ||
RESKIN_ICON = 'modular_doppler/modular_species/species_types/snails/icons/shell/shell_obj.dmi', | ||
RESKIN_ICON_STATE = "cinnamonshell", | ||
RESKIN_WORN_ICON = 'modular_doppler/modular_species/species_types/snails/icons/shell/shell_mob.dmi', | ||
RESKIN_WORN_ICON_STATE = "cinnamonshell" | ||
), | ||
"Caramel Shell" = list( | ||
RESKIN_ICON = 'modular_doppler/modular_species/species_types/snails/icons/shell/shell_obj.dmi', | ||
RESKIN_ICON_STATE = "caramelshell", | ||
RESKIN_WORN_ICON = 'modular_doppler/modular_species/species_types/snails/icons/shell/shell_mob.dmi', | ||
RESKIN_WORN_ICON_STATE = "caramelshell" | ||
), | ||
"Metal Shell" = list( | ||
RESKIN_ICON = 'modular_doppler/modular_species/species_types/snails/icons/shell/shell_obj.dmi', | ||
RESKIN_ICON_STATE = "mechashell", | ||
RESKIN_WORN_ICON = 'modular_doppler/modular_species/species_types/snails/icons/shell/shell_mob.dmi', | ||
RESKIN_WORN_ICON_STATE = "mechashell" | ||
), | ||
"Pyramid Shell" = list( | ||
RESKIN_ICON = 'modular_doppler/modular_species/species_types/snails/icons/shell/shell_obj.dmi', | ||
RESKIN_ICON_STATE = "pyramidshell", | ||
RESKIN_WORN_ICON = 'modular_doppler/modular_species/species_types/snails/icons/shell/shell_mob.dmi', | ||
RESKIN_WORN_ICON_STATE = "pyramidshell" | ||
), | ||
"Ivory Pyramid Shell" = list( | ||
RESKIN_ICON = 'modular_doppler/modular_species/species_types/snails/icons/shell/shell_obj.dmi', | ||
RESKIN_ICON_STATE = "pyramidshellwhite", | ||
RESKIN_WORN_ICON = 'modular_doppler/modular_species/species_types/snails/icons/shell/shell_mob.dmi', | ||
RESKIN_WORN_ICON_STATE = "pyramidshellwhite" | ||
), | ||
"Spiral Shell" = list( | ||
RESKIN_ICON = 'modular_doppler/modular_species/species_types/snails/icons/shell/shell_obj.dmi', | ||
RESKIN_ICON_STATE = "spiralshell", | ||
RESKIN_WORN_ICON = 'modular_doppler/modular_species/species_types/snails/icons/shell/shell_mob.dmi', | ||
RESKIN_WORN_ICON_STATE = "spiralshell" | ||
), | ||
"Ivory Spiral Shell" = list( | ||
RESKIN_ICON = 'modular_doppler/modular_species/species_types/snails/icons/shell/shell_obj.dmi', | ||
RESKIN_ICON_STATE = "spiralshellwhite", | ||
RESKIN_WORN_ICON = 'modular_doppler/modular_species/species_types/snails/icons/shell/shell_mob.dmi', | ||
RESKIN_WORN_ICON_STATE = "spiralshellwhite" | ||
), | ||
"Rocky Shell" = list( | ||
RESKIN_ICON = 'modular_doppler/modular_species/species_types/snails/icons/shell/shell_obj.dmi', | ||
RESKIN_ICON_STATE = "rockshell", | ||
RESKIN_WORN_ICON = 'modular_doppler/modular_species/species_types/snails/icons/shell/shell_mob.dmi', | ||
RESKIN_WORN_ICON_STATE = "rockshell" | ||
), | ||
"Ivory Rocky Shell" = list( | ||
RESKIN_ICON = 'modular_doppler/modular_species/species_types/snails/icons/shell/shell_obj.dmi', | ||
RESKIN_ICON_STATE = "rockshellwhite", | ||
RESKIN_WORN_ICON = 'modular_doppler/modular_species/species_types/snails/icons/shell/shell_mob.dmi', | ||
RESKIN_WORN_ICON_STATE = "rockshellwhite" | ||
), | ||
) | ||
|
||
/obj/item/storage/backpack/snail/Initialize(mapload) | ||
. = ..() | ||
atom_storage.max_total_storage = 30 | ||
|
||
/obj/item/storage/backpack/snail/build_worn_icon( | ||
default_layer = 0, | ||
default_icon_file = null, | ||
isinhands = FALSE, | ||
female_uniform = NO_FEMALE_UNIFORM, | ||
override_state = null, | ||
override_file = null, | ||
mutant_styles = NONE, | ||
humie = null, | ||
) | ||
|
||
var/mutable_appearance/standing = ..() | ||
if(storage_core == TRUE) | ||
standing.add_filter("bluespace_shell", 2, list("type" = "outline", "color" = COLOR_BLUE_LIGHT, "alpha" = SHELL_TRANSPARENCY_ALPHA, "size" = 1)) | ||
return standing | ||
|
||
/obj/item/storage/backpack/snail/item_interaction(mob/living/user, obj/item/tool, list/modifiers) | ||
if(storage_core || !istype(tool, /obj/item/assembly/signaler/anomaly/bluespace)) | ||
return NONE | ||
|
||
qdel(tool) | ||
upgrade_to_bluespace(user) | ||
to_chat(user, span_notice("You insert [tool] into your shell, and it starts to glow blue with expanded storage potential!")) | ||
return ITEM_INTERACT_SUCCESS | ||
|
||
/// Upgrades the storage capacity of the snail shell and gives it a glowy blue outline | ||
/obj/item/storage/backpack/snail/proc/upgrade_to_bluespace(mob/living/wearer) | ||
add_filter("bluespace_shell", 2, list("type" = "outline", "color" = COLOR_BLUE_LIGHT, "size" = 1)) | ||
playsound(src, 'sound/machines/click.ogg', 50, TRUE) | ||
storage_core = TRUE | ||
var/old_inventory = atom_storage.return_inv(FALSE) | ||
emptyStorage() | ||
create_storage(max_specific_storage = WEIGHT_CLASS_GIGANTIC, max_total_storage = 35, max_slots = 30, storage_type = /datum/storage/bag_of_holding) | ||
for(var/obj/item/stored_item in old_inventory) | ||
atom_storage.attempt_insert(stored_item, override = TRUE, messages = FALSE, force = TRUE) | ||
name = "snail shell of holding" | ||
update_appearance() | ||
|
||
// Update the worn sprite with the blue outline too if applicable | ||
if(isnull(wearer)) | ||
wearer = loc | ||
if(istype(wearer)) | ||
wearer.update_worn_back() | ||
|
||
/datum/species/snail/prepare_human_for_preview(mob/living/carbon/human/snail) | ||
snail.dna.features["mcolor"] = "#adaba7" | ||
snail.update_body(TRUE) | ||
|
||
/datum/species/snail/create_pref_unique_perks() | ||
var/list/to_add = list() | ||
|
||
to_add += list( | ||
list( | ||
SPECIES_PERK_TYPE = SPECIES_POSITIVE_PERK, | ||
SPECIES_PERK_ICON = "home", | ||
SPECIES_PERK_NAME = "Shellback", | ||
SPECIES_PERK_DESC = "Snails have a shell fused to their back. It offers great storage and most importantly gives them 50% brute damage reduction from behind, or while resting. Alt click to change the sprite!", | ||
), | ||
list( | ||
SPECIES_PERK_TYPE = SPECIES_POSITIVE_PERK, | ||
SPECIES_PERK_ICON = "wine-glass", | ||
SPECIES_PERK_NAME = "Poison Resistance", | ||
SPECIES_PERK_DESC = "Snails have a higher tolerance for poison owing to their robust livers.", | ||
), | ||
list( | ||
SPECIES_PERK_TYPE = SPECIES_POSITIVE_PERK, | ||
SPECIES_PERK_ICON = "heart", | ||
SPECIES_PERK_NAME = "Double Hearts", | ||
SPECIES_PERK_DESC = "Snails have two hearts, meaning it'll take more to break theirs.", | ||
), | ||
list( | ||
SPECIES_PERK_TYPE = SPECIES_POSITIVE_PERK, | ||
SPECIES_PERK_ICON = "bone", | ||
SPECIES_PERK_NAME = "Boneless", | ||
SPECIES_PERK_DESC = "Snails are invertebrates, meaning they don't take bone wounds, but are easier to delimb.", | ||
), | ||
list( | ||
SPECIES_PERK_TYPE = SPECIES_NEGATIVE_PERK, | ||
SPECIES_PERK_ICON = "crutch", | ||
SPECIES_PERK_NAME = "Sheer Mollusk Speed", | ||
SPECIES_PERK_DESC = "Snails move incredibly slow while standing. They move much faster while crawling, and can stick to the floors when the gravity is out.", | ||
), | ||
list( | ||
SPECIES_PERK_TYPE = SPECIES_NEGATIVE_PERK, | ||
SPECIES_PERK_ICON = "frown", | ||
SPECIES_PERK_NAME = "Weak Fighter", | ||
SPECIES_PERK_DESC = "Snails punch half as hard as a human.", | ||
), | ||
list( | ||
SPECIES_PERK_TYPE = SPECIES_NEGATIVE_PERK, | ||
SPECIES_PERK_ICON = "skull", | ||
SPECIES_PERK_NAME = "Salt Weakness", | ||
SPECIES_PERK_DESC = "Salt burns snails, and salt piles will block their path.", | ||
), | ||
) | ||
|
||
return to_add | ||
|
||
#undef SHELL_TRANSPARENCY_ALPHA |
76 changes: 76 additions & 0 deletions
76
modular_doppler/modular_species/species_types/snails/organs/snail_heart.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/obj/item/organ/internal/heart/snail | ||
name = "twin gastropod hearts" | ||
desc = "A primary heart normally nestled inside a gastropod's shell, and another in the owner's actual chest; necessary to maintain ample bloodflow through essentially two torsos." | ||
icon = 'modular_doppler/modular_species/species_types/snails/icons/organs/snail_heart.dmi' | ||
icon_state = "heart-snail-on" | ||
base_icon_state = "heart-snail" | ||
maxHealth = 2 * STANDARD_ORGAN_THRESHOLD // There's two of them. Also, due to the special interaction below, it's best we make sure these aren't easily lost. | ||
now_fixed = span_info("Your hearts begin to beat again.") //For the sake of verisimilitude. | ||
|
||
COOLDOWN_DECLARE(shell_effect_cd) | ||
|
||
/obj/item/organ/internal/heart/snail/on_mob_insert(mob/living/carbon/organ_owner, special) | ||
. = ..() | ||
if(!ishuman(organ_owner)) | ||
return | ||
|
||
if(!issnail(organ_owner)) //This is cleaner than checking for the shell, because there's not really going to be any non-horribly-bugged situation in which a snail will be lacking a shell. | ||
return | ||
|
||
var/mob/living/carbon/human/human_owner = organ_owner | ||
|
||
RegisterSignal(human_owner, COMSIG_MOB_APPLY_DAMAGE_MODIFIERS, PROC_REF(modify_damage)) | ||
RegisterSignal(human_owner, COMSIG_MOB_AFTER_APPLY_DAMAGE, PROC_REF(do_block_effect)) | ||
|
||
/obj/item/organ/internal/heart/snail/on_mob_remove(mob/living/carbon/organ_owner, special) | ||
. = ..() | ||
if(!ishuman(organ_owner) || QDELETED(organ_owner)) | ||
return | ||
|
||
var/mob/living/carbon/human/human_owner = organ_owner | ||
|
||
UnregisterSignal(human_owner, list(COMSIG_MOB_APPLY_DAMAGE_MODIFIERS, COMSIG_MOB_AFTER_APPLY_DAMAGE)) | ||
|
||
/** | ||
* Signal proc for [COMSIG_MOB_APPLY_DAMAGE_MODIFIERS] | ||
* | ||
* Adds a 0.5 modifier to attacks from the back, code borrowed (wholesale) from the roach heart. | ||
*/ | ||
/obj/item/organ/internal/heart/snail/proc/modify_damage(mob/living/carbon/human/source, list/damage_mods, damage_amount, damagetype, def_zone, sharpness, attack_direction, obj/item/attacking_item) | ||
SIGNAL_HANDLER | ||
|
||
if(!is_blocking(source, damage_amount, damagetype, attack_direction)) | ||
return | ||
|
||
damage_mods += 0.5 | ||
|
||
/** | ||
* Signal proc for [COMSIG_MOB_AFTER_APPLY_DAMAGE] | ||
* | ||
* Does a special effect if we blocked damage with our shell. | ||
*/ | ||
/obj/item/organ/internal/heart/snail/proc/do_block_effect(mob/living/carbon/human/source, damage_dealt, damagetype, def_zone, blocked, wound_bonus, bare_wound_bonus, sharpness, attack_direction, obj/item/attacking_item) | ||
SIGNAL_HANDLER | ||
|
||
if(!is_blocking(source, damage_dealt, damagetype, attack_direction)) | ||
return | ||
|
||
if(COOLDOWN_FINISHED(src, shell_effect_cd)) | ||
source.visible_message(span_warning("[source]'s shell weathers the blow, absorbing most of the shock!")) | ||
playsound(source, 'sound/weapons/parry.ogg', 50, extrarange = SHORT_RANGE_SOUND_EXTRARANGE) | ||
|
||
COOLDOWN_START(src, shell_effect_cd, 3 SECONDS) // Cooldown resets EVERY time we get hit | ||
|
||
/// Checks if the passed mob is in a valid state to be blocking damage with the snail shell | ||
/obj/item/organ/internal/heart/snail/proc/is_blocking(mob/living/carbon/human/blocker, damage_amount, damagetype, attack_direction) | ||
if(damage_amount < 5 || damagetype != BRUTE || !attack_direction) | ||
return | ||
if(!ishuman(blocker) || blocker.stat >= UNCONSCIOUS) | ||
return FALSE | ||
// No tactical spinning | ||
if(HAS_TRAIT(blocker, TRAIT_SPINNING)) | ||
return FALSE | ||
if(blocker.body_position == LYING_DOWN || (blocker.dir & attack_direction)) | ||
return TRUE | ||
return FALSE | ||
|
7 changes: 7 additions & 0 deletions
7
modular_doppler/modular_species/species_types/snails/organs/snail_liver.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/obj/item/organ/internal/liver/snail | ||
name = "gastropod liver" | ||
icon = 'modular_doppler/modular_species/species_types/snails/icons/organs/snail_liver.dmi' | ||
icon_state = "liver-snail" | ||
desc = "Due to snailfolk evolving in typically poisonous environments such as bogs, their liver has a higher tolerance for poisons compared to most." | ||
maxHealth = 1.5 * STANDARD_ORGAN_THRESHOLD | ||
toxTolerance = 5 //can shrug off up to 5u of toxins |
Oops, something went wrong.