mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 11:37:40 +01:00
Adds ability for nians to open and flap their wings (#31132)
* Adds ability for nians to open and flap their wings * To chat fixes * Add missing open moth wings. Adjust hind wing positions east/west/south. --------- Co-authored-by: Alfalfa Scout <alfalfascout@proton.me>
This commit is contained in:
co-authored by
Alfalfa Scout
parent
2da9270456
commit
3af7e3c1b4
@@ -164,7 +164,7 @@ GLOBAL_LIST_EMPTY(body_accessory_by_species)
|
||||
icon_state = "skrell_fringetail_xlong"
|
||||
allowed_species = list("Skrell")
|
||||
|
||||
//Moth wings
|
||||
// Moth wings
|
||||
/datum/body_accessory/wing
|
||||
icon = 'icons/mob/sprite_accessories/moth/moth_wings.dmi'
|
||||
animated_icon = null
|
||||
@@ -172,6 +172,8 @@ GLOBAL_LIST_EMPTY(body_accessory_by_species)
|
||||
icon_state = "plain"
|
||||
allowed_species = list("Nian")
|
||||
has_behind = TRUE
|
||||
var/is_open = FALSE
|
||||
var/open_icon = 'icons/mob/sprite_accessories/moth/moth_wingsopen.dmi'
|
||||
|
||||
/datum/body_accessory/wing/plain
|
||||
|
||||
|
||||
@@ -653,12 +653,60 @@
|
||||
message = "flaps their wings."
|
||||
sound = 'sound/effects/mob_effects/flap.ogg'
|
||||
species_type_whitelist_typecache = list(/datum/species/moth)
|
||||
var/wing_time = 1 SECONDS
|
||||
|
||||
/datum/emote/living/carbon/human/flap/run_emote(mob/user, params, type_override, intentional)
|
||||
. = ..()
|
||||
if(. && ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
H.Togglewings()
|
||||
addtimer(CALLBACK(src, PROC_REF(finish_flap), H), wing_time)
|
||||
|
||||
/datum/emote/living/carbon/human/flap/proc/finish_flap(mob/living/carbon/human/H)
|
||||
H.Togglewings()
|
||||
|
||||
/datum/emote/living/carbon/human/flap/angry
|
||||
key = "aflap"
|
||||
key_third_person = "aflaps"
|
||||
sound = 'sound/effects/mob_effects/angryflap.ogg'
|
||||
message = "flaps their wings ANGRILY!"
|
||||
wing_time = 0.5 SECONDS
|
||||
|
||||
/datum/emote/living/carbon/human/wings
|
||||
key = "wings"
|
||||
key_third_person = "wings"
|
||||
message = "their wings."
|
||||
|
||||
/datum/emote/living/carbon/human/wings/can_run_emote(mob/user, status_check = TRUE, intentional)
|
||||
. = ..()
|
||||
if(!..())
|
||||
return FALSE
|
||||
if(!ishuman(user))
|
||||
return FALSE
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(H.has_status_effect(STATUS_EFFECT_BURNT_WINGS))
|
||||
to_chat(H, "<span class='warning'>Your wings are burnt off!</span>")
|
||||
return FALSE
|
||||
if(!H.body_accessory || !istype(H.body_accessory, /datum/body_accessory/wing))
|
||||
to_chat(H, "<span class='warning'>You don't have wings!</span>")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/emote/living/carbon/human/wings/run_emote(mob/user, params, type_override, intentional)
|
||||
. = ..()
|
||||
if(.)
|
||||
var/mob/living/carbon/human/H = user
|
||||
H.Togglewings()
|
||||
|
||||
/datum/emote/living/carbon/human/wings/select_message_type(mob/user, intentional)
|
||||
. = ..()
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(H.body_accessory && istype(H.body_accessory, /datum/body_accessory/wing))
|
||||
var/datum/body_accessory/wing/wings = H.body_accessory
|
||||
if(!wings.is_open)
|
||||
. = "opens " + message
|
||||
else
|
||||
. = "closes " + message
|
||||
|
||||
/datum/emote/living/carbon/human/flutter
|
||||
key = "flutter"
|
||||
|
||||
@@ -2303,3 +2303,22 @@ Eyes need to have significantly high darksight to shine unless the mob has the X
|
||||
|
||||
/mob/living/carbon/human/get_strippable_items(datum/source, list/items)
|
||||
items |= GLOB.strippable_human_items
|
||||
|
||||
/// Used to toggle whether wings are open or not
|
||||
/mob/living/carbon/human/proc/Togglewings()
|
||||
if(has_status_effect(STATUS_EFFECT_BURNT_WINGS))
|
||||
to_chat(src, "<span class='warning'>Your wings are burnt off!</span>")
|
||||
return
|
||||
|
||||
if(body_accessory && istype(body_accessory, /datum/body_accessory/wing))
|
||||
var/datum/body_accessory/wing/wings = body_accessory
|
||||
if(wings.is_open)
|
||||
wings.is_open = FALSE
|
||||
wings.icon = initial(wings.icon)
|
||||
wings.pixel_x_offset = initial(wings.pixel_x_offset)
|
||||
update_wing_layer()
|
||||
return
|
||||
wings.is_open = TRUE
|
||||
wings.icon = wings.open_icon
|
||||
wings.pixel_x_offset = -22 // Center these bad boys
|
||||
update_wing_layer()
|
||||
|
||||
@@ -118,14 +118,26 @@
|
||||
if(isobj(H.loc))
|
||||
// Can't fly if you're in a box/mech/whatever.
|
||||
return FALSE
|
||||
// Open your wings to fly
|
||||
if(H.body_accessory && istype(H.body_accessory, /datum/body_accessory/wing))
|
||||
var/datum/body_accessory/wing/wings = H.body_accessory
|
||||
if(!wings.is_open)
|
||||
return FALSE
|
||||
var/turf/T = get_turf(H)
|
||||
var/datum/gas_mixture/current = T.get_readonly_air()
|
||||
if(current && (current.return_pressure() >= ONE_ATMOSPHERE * 0.85)) //as long as there's reasonable pressure and no gravity, flight is possible
|
||||
return TRUE
|
||||
|
||||
/datum/species/moth/spec_thunk(mob/living/carbon/human/H)
|
||||
if(!H.has_status_effect(STATUS_EFFECT_BURNT_WINGS))
|
||||
return TRUE
|
||||
if(H.has_status_effect(STATUS_EFFECT_BURNT_WINGS))
|
||||
return FALSE
|
||||
|
||||
if(H.body_accessory && istype(H.body_accessory, /datum/body_accessory/wing))
|
||||
var/datum/body_accessory/wing/wings = H.body_accessory
|
||||
if(!wings.is_open)
|
||||
return FALSE
|
||||
|
||||
return TRUE
|
||||
|
||||
/datum/species/moth/spec_movement_delay()
|
||||
return FALSE
|
||||
|
||||
Reference in New Issue
Block a user