diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm index fdded58308..dad0f49832 100644 --- a/code/__DEFINES/dcs/signals.dm +++ b/code/__DEFINES/dcs/signals.dm @@ -359,6 +359,9 @@ #define COMSIG_LIVING_RUN_BLOCK "living_do_run_block" //from base of mob/living/do_run_block(): (real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone) #define COMSIG_LIVING_GET_BLOCKING_ITEMS "get_blocking_items" //from base of mob/living/get_blocking_items(): (list/items) +#define COMSIG_LIVING_RESTING "living_on_resting" //from mob/living/set_resting +#define COMSIG_LIVING_STOPPED_PULLING "living_on_stop_pulling" //from mob/living/stop_pulling + #define COMSIG_LIVING_ACTIVE_BLOCK_START "active_block_start" //from base of mob/living/keybind_start_active_blocking(): (obj/item/blocking_item, list/backup_items) #define COMPONENT_PREVENT_BLOCK_START 1 #define COMSIG_LIVING_ACTIVE_PARRY_START "active_parry_start" //from base of mob/living/initiate_parry_sequence(): (parrying_method, datum/parrying_item_mob_or_art, list/backup_items, list/override) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 3272060835..8d6646b8d0 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -3066,6 +3066,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) save_character() character.dna.features = features.Copy() + character.set_species(chosen_species, icon_update = FALSE, pref_load = TRUE) character.dna.species.eye_type = eye_type if(chosen_limb_id && (chosen_limb_id in character.dna.species.allowed_limb_ids)) diff --git a/code/modules/mob/dead/new_player/sprite_accessories/_sprite_accessories.dm b/code/modules/mob/dead/new_player/sprite_accessories/_sprite_accessories.dm index 1dc50bfe73..f5e1c2e113 100644 --- a/code/modules/mob/dead/new_player/sprite_accessories/_sprite_accessories.dm +++ b/code/modules/mob/dead/new_player/sprite_accessories/_sprite_accessories.dm @@ -28,10 +28,9 @@ for(var/path in typesof(prototype)) if(path == prototype && skip_prototype) continue - if(roundstart) - var/datum/sprite_accessory/P = path - if(initial(P.locked)) - continue + var/datum/sprite_accessory/P = path + if((roundstart && initial(P.locked)) || initial(P.ignore)) + continue var/datum/sprite_accessory/D = new path() if(D.icon_state) @@ -64,6 +63,7 @@ var/mutant_part_string //Also used in species.handle_mutant_bodyparts() to generate the overlay icon state. var/alpha_mask_state var/matrixed_sections = MATRIX_NONE //if color_src is MATRIXED, how many sections does it have? 1-3 + var/ignore = FALSE //NEVER include in customization if set to TRUE //Special / holdover traits for Citadel specific sprites. var/extra = FALSE diff --git a/code/modules/mob/dead/new_player/sprite_accessories/legs_and_taurs.dm b/code/modules/mob/dead/new_player/sprite_accessories/legs_and_taurs.dm index c525a13ef8..11fde50a37 100644 --- a/code/modules/mob/dead/new_player/sprite_accessories/legs_and_taurs.dm +++ b/code/modules/mob/dead/new_player/sprite_accessories/legs_and_taurs.dm @@ -126,6 +126,11 @@ hide_legs = USE_SNEK_CLIP_MASK matrixed_sections = MATRIX_RED_GREEN +/datum/sprite_accessory/taur/naga/coiled + name = "Naga (coiled)" + icon_state = "naga_coiled" + ignore = TRUE + /datum/sprite_accessory/taur/otie name = "Otie" icon_state = "otie" diff --git a/code/modules/mob/living/carbon/human/innate_abilities/coiling.dm b/code/modules/mob/living/carbon/human/innate_abilities/coiling.dm new file mode 100644 index 0000000000..52e2a87a7d --- /dev/null +++ b/code/modules/mob/living/carbon/human/innate_abilities/coiling.dm @@ -0,0 +1,89 @@ + +/datum/action/innate/ability/coiling + name = "Coil Grabbed Mob" + check_flags = AB_CHECK_CONSCIOUS + button_icon_state = "coil_icon" + icon_icon = 'icons/mob/actions/actions_snake.dmi' + background_icon_state = "bg_alien" + required_mobility_flags = MOBILITY_STAND + var/currently_coiling = FALSE + var/mob/living/carbon/human/currently_coiled + var/mutable_appearance/tracked_overlay + +/datum/action/innate/ability/coiling/Activate() + // make sure they meet the mobility/check flags + if(IsAvailable()) + // check that the user has grabbed someone and they are not currently coiling someone + if(ishuman(owner.pulling) && !currently_coiling) + coil_mob(owner.pulling) + +/datum/action/innate/ability/coiling/proc/update_coil_offset(atom/source, old_dir, new_dir) + // update the coiling offset on the coiled user depending on the way the owner is facing + switch(new_dir) + if(NORTH) + currently_coiled.pixel_x = -12 + if(EAST) + currently_coiled.pixel_x = -12 + if(SOUTH) + currently_coiled.pixel_x = 12 + if(WEST) + currently_coiled.pixel_x = 12 + +/datum/action/innate/ability/coiling/proc/coil_mob(var/mob/living/carbon/human/H) + // begin the coiling action + H.visible_message("[owner] coils [H] with their tail!", \ + "[owner] coils you with their tail!") + currently_coiling = TRUE + currently_coiled = H + + H.layer -= 0.1 // LISTEN I HATE TOUCHING MOB LAYERS TOO BUT THIS IS JUST SO THEY RENDER UNDER THE OTHER PLAYER SDFHSDFHDSFHDSH + + // move user to same tile + H.forceMove(get_turf(owner)) + + // cancel the coiling action if certain things are done + RegisterSignal(owner, COMSIG_MOVABLE_MOVED, .proc/cancel_coil) + RegisterSignal(owner, COMSIG_LIVING_RESTING, .proc/cancel_coil) + RegisterSignal(owner, COMSIG_LIVING_STOPPED_PULLING, .proc/cancel_coil) + + // update the coil offset, update again if owner changes direction + RegisterSignal(owner, COMSIG_ATOM_DIR_CHANGE, .proc/update_coil_offset) + update_coil_offset(null, null, owner.dir) + + // set our overlay to new image + var/mob/living/carbon/human/user = owner + user.dna.species.mutant_bodyparts["taur"] = "Naga (coiled)" + user.dna.features["taur"] = "Naga (coiled)" + user.update_mutant_bodyparts() + +/datum/action/innate/ability/coiling/proc/cancel_coil() + var/mob/living/carbon/human/H = owner + + // cancel the coiling action by removing the overlay + currently_coiled.pixel_x = 0 + + currently_coiling = FALSE + currently_coiled = null + + // unregister signals + UnregisterSignal(owner, COMSIG_MOVABLE_MOVED) + UnregisterSignal(owner, COMSIG_LIVING_RESTING) + UnregisterSignal(owner, COMSIG_LIVING_STOPPED_PULLING) + UnregisterSignal(owner, COMSIG_ATOM_DIR_CHANGE) + + // change overlay back to original image + H.dna.species.mutant_bodyparts["taur"] = "Naga" + H.dna.features["taur"] = "Naga" + H.update_mutant_bodyparts() + + H.update_body() + + H.layer += 0.1 + + // remove the added overlay + owner.cut_overlay(tracked_overlay) + tracked_overlay = null + +/datum/action/innate/ability/coiling/Remove(mob/M) + cancel_coil() + ..(M) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index bbe2781403..e6ac8ae881 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -612,7 +612,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) if(Q.type in blacklisted_quirks) removed_quirks += Q.type . += 1 - qdel(Q) + qdel(Q) else var/point_overhead = 0 for(var/datum/quirk/Q as anything in C.roundstart_quirks) @@ -906,6 +906,22 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) var/tauric = mutant_bodyparts["taur"] && H.dna.features["taur"] && H.dna.features["taur"] != "None" + // stuff for adding/removing the coiling ability if you have a taur part + // if another action is ever based on mutant parts we should probably make a system for it so it's all done in one proc with less overhead + var/datum/action/found_action + + for(var/datum/action/A in H.actions) + if(A.type == /datum/action/innate/ability/coiling) + found_action = A + + if(found_action && (!tauric || (H.dna.features["taur"] != "Naga" && H.dna.features["taur"] != "Naga (coiled)"))) + found_action.Remove(H) + + if(!found_action && tauric && H.dna.features["taur"] == "Naga") + found_action = new /datum/action/innate/ability/coiling() + found_action.Grant(H) + + for(var/mutant_part in mutant_bodyparts) var/reference_list = GLOB.mutant_reference_list[mutant_part] if(reference_list) @@ -1220,7 +1236,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) if(!HAS_TRAIT(H, TRAIT_ROBOTIC_ORGANISM)) H.adjustBruteLoss(1) else - H.adjustFireLoss(1) //Robots melt instead of taking brute. + H.adjustFireLoss(1) //Robots melt instead of taking brute. /datum/species/proc/spec_death(gibbed, mob/living/carbon/human/H) if(H) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 2070d07e14..bf3094cb08 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -395,6 +395,7 @@ ..() update_pull_movespeed() update_pull_hud_icon() + SEND_SIGNAL(src, COMSIG_LIVING_STOPPED_PULLING) /mob/living/verb/stop_pulling1() set name = "Stop Pulling" diff --git a/code/modules/mob/living/living_mobility.dm b/code/modules/mob/living/living_mobility.dm index af34fb54cf..6aed30ab83 100644 --- a/code/modules/mob/living/living_mobility.dm +++ b/code/modules/mob/living/living_mobility.dm @@ -9,6 +9,8 @@ resting = new_resting if(!silent) to_chat(src, "You are now [resting? "resting" : "getting up"].") + if(resting == 1) + SEND_SIGNAL(src, COMSIG_LIVING_RESTING) update_resting(updating) /mob/living/proc/update_resting(update_mobility = TRUE) diff --git a/icons/mob/actions/actions_snake.dmi b/icons/mob/actions/actions_snake.dmi new file mode 100644 index 0000000000..6856171b0d Binary files /dev/null and b/icons/mob/actions/actions_snake.dmi differ diff --git a/modular_citadel/icons/mob/mam_taur.dmi b/modular_citadel/icons/mob/mam_taur.dmi index cf332019af..cc4bc0446c 100644 Binary files a/modular_citadel/icons/mob/mam_taur.dmi and b/modular_citadel/icons/mob/mam_taur.dmi differ diff --git a/tgstation.dme b/tgstation.dme index cd5a1eb823..0896e19bb9 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -2699,6 +2699,7 @@ #include "code\modules\mob\living\carbon\human\typing_indicator.dm" #include "code\modules\mob\living\carbon\human\update_icons.dm" #include "code\modules\mob\living\carbon\human\innate_abilities\blobform.dm" +#include "code\modules\mob\living\carbon\human\innate_abilities\coiling.dm" #include "code\modules\mob\living\carbon\human\innate_abilities\customization.dm" #include "code\modules\mob\living\carbon\human\innate_abilities\limb_regeneration.dm" #include "code\modules\mob\living\carbon\human\species_types\abductor.dm"