TG wing port - Now YOU TOO, can be an "angel"

This commit is contained in:
Cognition
2021-12-07 18:59:07 -07:00
parent 6f8f1edd43
commit 318240bdc6
31 changed files with 397 additions and 178 deletions
@@ -1124,9 +1124,6 @@
/mob/living/carbon/human/species/android
race = /datum/species/android
/mob/living/carbon/human/species/angel
race = /datum/species/angel
/mob/living/carbon/human/species/corporate
race = /datum/species/corporate
+152 -1
View File
@@ -138,6 +138,15 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
/// A path to an outfit that is important for species life e.g. plasmaman outfit
var/datum/outfit/outfit_important_for_life
///Is this species a flying species? Used as an easy check for some things
var/flying_species = FALSE
///The actual flying ability given to flying species
var/datum/action/innate/flight/fly
///Current wings icon
var/wings_icon = "Angel"
//Dictates which wing icons are allowed for a given species. If count is >1 a radial menu is used to choose between all icons in list
var/list/wings_icons = SPECIES_WINGS_ANGEL
///Species-only traits. Can be found in [code/__DEFINES/DNA.dm]
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.
@@ -490,6 +499,10 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
for(var/datum/disease/A in C.diseases)
A.cure(FALSE)
if(flying_species && isnull(fly))
fly = new
fly.Grant(C)
if(ishuman(C))
var/mob/living/carbon/human/H = C
if(NOGENITALS in H.dna.species.species_traits)
@@ -564,6 +577,17 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
if(F)
qdel(F)
if(flying_species)
fly.Remove(C)
QDEL_NULL(fly)
if(C.movement_type & FLYING)
C.setMovetype(C.movement_type & ~FLYING)
ToggleFlight(C,0)
if(C.dna && C.dna.species && (C.dna.features["wings"] == wings_icon))
if("wings" in C.dna.species.mutant_bodyparts)
C.dna.species.mutant_bodyparts -= "wings"
C.dna.features["wings"] = "None"
C.update_body()
if(ROBOTIC_LIMBS in species_traits)
for(var/obj/item/bodypart/B in C.bodyparts)
@@ -2356,10 +2380,13 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
return
////////////
//Stun//
// Stun //
////////////
/datum/species/proc/spec_stun(mob/living/carbon/human/H,amount)
if(flying_species && H.movement_type & FLYING)
ToggleFlight(H,0)
flyslip(H)
if(H)
stop_wagging_tail(H)
. = stunmod * H.physiology.stun_mod * amount
@@ -2406,3 +2433,127 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
mutant_bodyparts["spines"] = mutant_bodyparts["waggingspines"]
mutant_bodyparts -= "waggingspines"
H.update_body()
///////////////
//FLIGHT SHIT//
///////////////
/datum/species/proc/GiveSpeciesFlight(mob/living/carbon/human/H)
if(flying_species) //species that already have flying traits should not work with this proc
return
flying_species = TRUE
//CITADEL CHANGE: check if they already have wings, and "evolve" them based off of the wings they have. If they have none, use their species wings basis.
var/list/wingslist
//why the fuck do we have two different wing types anyways? they're literally almost both using the same wing shit too.
var/datum/sprite_accessory/deco_wings/D = GLOB.deco_wings_list[H.dna.features["deco_wings"]]
var/datum/sprite_accessory/insect_wings/I = GLOB.insect_wings_list[H.dna.features["insect_wings"]]
if(mutant_bodyparts["deco_wings"] && D?.upgrade_to.len) //species check to see if they were allowed to have deco wings
wingslist = D.upgrade_to
else if(mutant_bodyparts["insect_wings"] && I?.upgrade_to.len) //species check to see if they were allowed to have insect wings
wingslist = I.upgrade_to
else
wingslist = wings_icons
if(wingslist.len > 1)
if(!H.client)
wings_icon = pick(wingslist)
else
var/list/wings = list()
for(var/W in wingslist)
var/datum/sprite_accessory/S = GLOB.wings_list[W] //Gets the datum for every wing this species has, then prompts user with a radial menu
var/image/img = image(icon = 'icons/mob/wings_functional.dmi', icon_state = "m_wingsopen_[S.icon_state]_BEHIND") //Process the HUD elements
img.transform *= 0.5
img.pixel_x = -32
if(wings[S.name])
stack_trace("Different wing types with repeated names. Please fix as this may cause issues.")
else
wings[S.name] = img
wings_icon = show_radial_menu(H, H, wings, tooltips = TRUE)
if(!wings_icon)
wings_icon = pick(wings_icons)
else
wings_icon = wingslist[1]
if(isnull(fly))
fly = new
fly.Grant(H)
if(H.dna.features["wings"] != wings_icon)
mutant_bodyparts["wings"] = wings_icon
H.dna.features["wings"] = wings_icon
H.update_body()
/datum/species/proc/HandleFlight(mob/living/carbon/human/H)
if(H.movement_type & FLYING)
if(!CanFly(H))
ToggleFlight(H)
return FALSE
return TRUE
else
return FALSE
/datum/species/proc/CanFly(mob/living/carbon/human/H)
if(H.stat || !(H.mobility_flags & MOBILITY_STAND))
return FALSE
if(H.wear_suit && ((H.wear_suit.flags_inv & HIDEJUMPSUIT) && (!H.wear_suit.species_exception || !is_type_in_list(src, H.wear_suit.species_exception)))) //Jumpsuits have tail holes, so it makes sense they have wing holes too
to_chat(H, "<span class='warning'>Your suit blocks your wings from extending!</span>")
return FALSE
var/turf/T = get_turf(H)
if(!T)
return FALSE
var/datum/gas_mixture/environment = T.return_air()
if(environment && !(environment.return_pressure() > 30))
to_chat(H, "<span class='warning'>The atmosphere is too thin for you to fly!</span>")
return FALSE
else
return TRUE
/datum/species/proc/flyslip(mob/living/carbon/human/H)
var/obj/buckled_obj
if(H.buckled)
buckled_obj = H.buckled
to_chat(H, "<span class='notice'>Your wings spazz out and launch you!</span>")
playsound(H.loc, 'sound/misc/slip.ogg', 50, TRUE, -3)
for(var/obj/item/I in H.held_items)
H.accident(I)
var/olddir = H.dir
H.stop_pulling()
if(buckled_obj)
buckled_obj.unbuckle_mob(H)
step(buckled_obj, olddir)
else
new /datum/forced_movement(H, get_ranged_target_turf(H, olddir, 4), 1, FALSE, CALLBACK(H, /mob/living/carbon/.proc/spin, 1, 1))
return TRUE
//UNSAFE PROC, should only be called through the Activate or other sources that check for CanFly
/datum/species/proc/ToggleFlight(mob/living/carbon/human/H)
if(!(H.movement_type & FLYING) && CanFly(H))
stunmod *= 2
speedmod -= 0.35
H.setMovetype(H.movement_type | FLYING)
override_float = TRUE
H.pass_flags |= PASSTABLE
H.OpenWings()
H.update_mobility()
else
stunmod *= 0.5
speedmod += 0.35
H.setMovetype(H.movement_type & ~FLYING)
override_float = FALSE
H.pass_flags &= ~PASSTABLE
H.CloseWings()
/datum/action/innate/flight
name = "Toggle Flight"
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_STUN
icon_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "flight"
/datum/action/innate/flight/Activate()
var/mob/living/carbon/human/H = owner
var/datum/species/S = H.dna.species
if(S.CanFly(H))
S.ToggleFlight(H)
if(!(H.movement_type & FLYING))
to_chat(H, "<span class='notice'>You settle gently back onto the ground...</span>")
else
to_chat(H, "<span class='notice'>You beat your wings and begin to hover gently above the ground...</span>")
H.set_resting(FALSE, TRUE)
@@ -12,3 +12,4 @@
species_language_holder = /datum/language_holder/synthetic
limbs_id = SPECIES_SYNTH
species_category = SPECIES_CATEGORY_ROBOT
wings_icons = SPECIES_WINGS_ROBOT
@@ -1,145 +0,0 @@
/datum/species/angel
name = "Angel"
id = SPECIES_ANGEL
default_color = "FFFFFF"
species_traits = list(EYECOLOR,HAIR,FACEHAIR,LIPS,HAS_FLESH,HAS_BONE)
mutant_bodyparts = list("tail_human" = "None", "ears" = "None", "wings" = "Angel")
use_skintones = USE_SKINTONES_GRAYSCALE_CUSTOM
no_equip = list(SLOT_BACK)
blacklisted = 1
limbs_id = SPECIES_HUMAN
skinned_type = /obj/item/stack/sheet/animalhide/human
species_category = SPECIES_CATEGORY_BASIC //they're a kind of human
var/datum/action/innate/flight/fly
/datum/species/angel/on_species_gain(mob/living/carbon/human/H, datum/species/old_species)
..()
if(H.dna && H.dna.species && (H.dna.features["wings"] != "Angel"))
if(!H.dna.species.mutant_bodyparts["wings"])
H.dna.species.mutant_bodyparts["wings"] = "Angel"
H.dna.features["wings"] = "Angel"
H.update_body()
if(ishuman(H) && !fly)
fly = new
fly.Grant(H)
ADD_TRAIT(H, TRAIT_HOLY, SPECIES_TRAIT)
/datum/species/angel/on_species_loss(mob/living/carbon/human/H)
if(fly)
fly.Remove(H)
if(H.movement_type & FLYING)
H.setMovetype(H.movement_type & ~FLYING)
ToggleFlight(H,0)
if(H.dna && H.dna.species && (H.dna.features["wings"] == "Angel"))
if(H.dna.species.mutant_bodyparts["wings"])
H.dna.species.mutant_bodyparts -= "wings"
H.dna.features["wings"] = "None"
H.update_body()
REMOVE_TRAIT(H, TRAIT_HOLY, SPECIES_TRAIT)
..()
/datum/species/angel/spec_life(mob/living/carbon/human/H)
HandleFlight(H)
/datum/species/angel/proc/HandleFlight(mob/living/carbon/human/H)
if(H.movement_type & FLYING)
if(!CanFly(H))
ToggleFlight(H,0)
return 0
return 1
else
return 0
/datum/species/angel/proc/CanFly(mob/living/carbon/human/H)
if(!CHECK_MOBILITY(H, MOBILITY_MOVE))
return FALSE
if(H.wear_suit && ((H.wear_suit.flags_inv & HIDEJUMPSUIT) && (!H.wear_suit.species_exception || !is_type_in_list(src, H.wear_suit.species_exception)))) //Jumpsuits have tail holes, so it makes sense they have wing holes too
to_chat(H, "Your suit blocks your wings from extending!")
return FALSE
var/turf/T = get_turf(H)
if(!T)
return FALSE
var/datum/gas_mixture/environment = T.return_air()
if(environment && !(environment.return_pressure() > 30))
to_chat(H, "<span class='warning'>The atmosphere is too thin for you to fly!</span>")
return FALSE
return TRUE
/datum/action/innate/flight
name = "Toggle Flight"
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_STUN
icon_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "flight"
/datum/action/innate/flight/Activate()
var/mob/living/carbon/human/H = owner
var/datum/species/angel/A = H.dna.species
if(A.CanFly(H))
if(H.movement_type & FLYING)
to_chat(H, "<span class='notice'>You settle gently back onto the ground...</span>")
A.ToggleFlight(H,0)
H.update_mobility()
else
to_chat(H, "<span class='notice'>You beat your wings and begin to hover gently above the ground...</span>")
H.set_resting(FALSE, TRUE)
A.ToggleFlight(H,1)
H.update_mobility()
/datum/species/angel/proc/flyslip(mob/living/carbon/human/H)
var/obj/buckled_obj
if(H.buckled)
buckled_obj = H.buckled
to_chat(H, "<span class='notice'>Your wings spazz out and launch you!</span>")
playsound(H.loc, 'sound/misc/slip.ogg', 50, 1, -3)
for(var/obj/item/I in H.held_items)
H.accident(I)
var/olddir = H.dir
H.stop_pulling()
if(buckled_obj)
buckled_obj.unbuckle_mob(H)
step(buckled_obj, olddir)
else
for(var/i=1, i<5, i++)
spawn (i)
step(H, olddir)
H.spin(1,1)
return 1
/datum/species/angel/spec_stun(mob/living/carbon/human/H,amount)
if(H.movement_type & FLYING)
ToggleFlight(H,0)
flyslip(H)
. = ..()
/datum/species/angel/negates_gravity(mob/living/carbon/human/H)
if(H.movement_type & FLYING)
return 1
/datum/species/angel/space_move(mob/living/carbon/human/H)
if(H.movement_type & FLYING)
return 1
/datum/species/angel/proc/ToggleFlight(mob/living/carbon/human/H,flight)
if(flight && CanFly(H))
stunmod = 2
speedmod = -0.1
H.setMovetype(H.movement_type | FLYING)
override_float = TRUE
H.pass_flags |= PASSTABLE
H.OpenWings()
else
stunmod = 1
speedmod = 0
H.setMovetype(H.movement_type & ~FLYING)
override_float = FALSE
H.pass_flags &= ~PASSTABLE
H.CloseWings()
update_species_slowdown(H)
@@ -48,4 +48,5 @@
miss_sound = 'sound/weapons/slashmiss.ogg'
allowed_limb_ids = list("mammal","aquatic","avian", "human")
species_category = "robot"
species_category = SPECIES_CATEGORY_ROBOT
wings_icons = SPECIES_WINGS_ROBOT
@@ -21,6 +21,7 @@
var/web_cooldown = 200
var/web_ready = TRUE
var/spinner_rate = 25
wings_icons = SPECIES_WINGS_MOTH //Arachnids' phylum is arthropods, which include butterflies. Might as well hit them with moth wings.
/datum/species/arachnid/random_name(gender,unique,lastname)
if(unique)
@@ -19,6 +19,7 @@
tail_type = "mam_tail"
wagging_type = "mam_waggingtail"
species_category = SPECIES_CATEGORY_INSECT
wings_icons = SPECIES_WINGS_INSECT
allowed_limb_ids = list("insect","apid","moth","moth_not_greyscale")
@@ -19,3 +19,4 @@
sexes = 0
gib_types = /obj/effect/gibspawner/robot
species_category = SPECIES_CATEGORY_ROBOT
wings_icons = SPECIES_WINGS_ROBOT
@@ -16,6 +16,7 @@
has_field_of_vision = FALSE //Too much of a trouble, their vision is already bound to their severed head.
species_category = SPECIES_CATEGORY_UNDEAD
var/pumpkin = FALSE
wings_icons = SPECIES_WINGS_SKELETAL //seems suitable for an undead.
var/obj/item/dullahan_relay/myhead
@@ -13,6 +13,7 @@
exotic_bloodtype = "BUG"
exotic_blood_color = BLOOD_COLOR_BUG
species_category = SPECIES_CATEGORY_INSECT
wings_icons = SPECIES_WINGS_INSECT
/datum/species/fly/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H)
if(istype(chem, /datum/reagent/toxin/pestkiller))
@@ -29,6 +29,7 @@
exotic_bloodtype = "HF"
exotic_blood_color = BLOOD_COLOR_OIL
species_category = SPECIES_CATEGORY_ROBOT
wings_icons = SPECIES_WINGS_ROBOT
var/datum/action/innate/monitor_change/screen
@@ -29,6 +29,7 @@
tail_type = "mam_tail"
wagging_type = "mam_waggingtail"
species_category = SPECIES_CATEGORY_JELLY
wings_icons = SPECIES_WINGS_JELLY
ass_image = 'icons/ass/assslime.png'
/datum/species/jelly/on_species_loss(mob/living/carbon/C)
@@ -29,6 +29,7 @@
tail_type = "tail_lizard"
wagging_type = "waggingtail_lizard"
species_category = SPECIES_CATEGORY_LIZARD
wings_icons = SPECIES_WINGS_DRAGON
ass_image = 'icons/ass/asslizard.png'
@@ -23,6 +23,7 @@
outfit_important_for_life = /datum/outfit/plasmaman
species_category = SPECIES_CATEGORY_SKELETON
wings_icons = SPECIES_WINGS_SKELETAL
ass_image = 'icons/ass/assplasma.png'
@@ -16,6 +16,7 @@
mutanteyes = /obj/item/organ/eyes/night_vision
species_category = SPECIES_CATEGORY_SHADOW
wings_icons = SPECIES_WINGS_SKELETAL //not sure what's more spooky for these guys - skeleton or dragon?
/datum/species/shadow/on_species_gain(mob/living/carbon/C, datum/species/old_species)
. = ..()
@@ -16,6 +16,7 @@
burnmod = 1.25
species_category = SPECIES_CATEGORY_SKELETON //they have their own category that's disassociated from undead, paired with plasmapeople
wings_icons = SPECIES_WINGS_SKELETAL
/datum/species/skeleton/New()
if(SSevents.holidays && SSevents.holidays[HALLOWEEN]) //skeletons are stronger during the spooky season!
@@ -28,3 +28,4 @@
tail_type = "mam_tail"
wagging_type = "mam_waggingtail"
species_category = SPECIES_CATEGORY_ROBOT
wings_icons = SPECIES_WINGS_ROBOT
@@ -18,6 +18,7 @@
var/datum/species/fake_species = null //a species to do most of our work for us, unless we're damaged
species_language_holder = /datum/language_holder/synthetic
species_category = SPECIES_CATEGORY_ROBOT
wings_icons = SPECIES_WINGS_ROBOT
/datum/species/synth/military
name = "Military Synth"
@@ -15,8 +15,10 @@
skinned_type = /obj/item/stack/sheet/animalhide/human
var/info_text = "You are a <span class='danger'>Vampire</span>. You will slowly but constantly lose blood if outside of a coffin. If inside a coffin, you will slowly heal. You may gain more blood by grabbing a live victim and using your drain ability."
species_category = SPECIES_CATEGORY_UNDEAD
wings_icons = SPECIES_WINGS_DRAGON //closest to "bat" wings.
var/batform_enabled = TRUE
/datum/species/vampire/roundstart
id = SPECIES_VAMPIRE_WEAK
batform_enabled = FALSE
@@ -17,3 +17,4 @@
disliked_food = JUNKFOOD
liked_food = GROSS | MEAT
species_category = SPECIES_CATEGORY_ALIEN
wings_icons = SPECIES_WINGS_DRAGON //most depictions of xenomorphs with wings are closest to this.
@@ -16,6 +16,7 @@
disliked_food = NONE
liked_food = GROSS | MEAT | RAW
species_category = SPECIES_CATEGORY_UNDEAD
wings_icons = SPECIES_WINGS_SKELETAL //eh.
/datum/species/zombie/notspaceproof
id = "notspaceproofzombie"