diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm index d5c37b89886..c0301b9bfa1 100644 --- a/code/__DEFINES/flags.dm +++ b/code/__DEFINES/flags.dm @@ -68,6 +68,8 @@ #define MUTCOLORS_PARTSONLY 32768 //Used if we want the mutant colour to be only used by mutant bodyparts. Don't combine this with MUTCOLORS, or it will be useless. +#define FLYING 65536 + /* These defines are used specifically with the atom/movable/languages bitmask. They are used in atom/movable/Hear() and atom/movable/say() to determine whether hearers can understand a message. diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index bf412453520..064c0e3dd94 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -120,7 +120,7 @@ name = "magic mirror" desc = "Turn and face the strange... face." icon_state = "magic_mirror" - var/list/races_blacklist = list("skeleton", "agent") + var/list/races_blacklist = list("skeleton", "agent", "angel") var/list/choosable_races = list() /obj/structure/mirror/magic/New() diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 9ae245d91b8..000e40768aa 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -990,3 +990,7 @@ if(HM.quality != POSITIVE) dna.remove_mutation(HM.name) ..() + +/mob/living/carbon/human/update_gravity(has_gravity,override = 0) + override = dna.species.override_float + ..() \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 255c64f9bfc..709af9ac1cb 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -372,4 +372,4 @@ /mob/living/carbon/human/Stun(amount, updating_canmove = 1) amount = dna.species.spec_stun(src,amount) - ..() + ..() \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index fe4710799a9..222bff80f8e 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -21,6 +21,7 @@ /datum/species var/id = null // if the game needs to manually check your race to do something not included in a proc here, it will use this + var/limbs_id = null //this is used if you want to use a different species limb sprites. Mainly used for angels as they look like humans. var/name = null // this is the fluff name. these will be left generic (such as 'Lizardperson' for the lizard race) so servers can change them to whatever var/roundstart = 0 // can this mob be chosen at roundstart? (assuming the config option is checked?) var/default_color = "#FFF" // if alien colors are disabled, this is the color that will be used by that race @@ -86,11 +87,19 @@ var/has_dismemberment = 1 //Whether or not this species uses dismemberment for its limbs + //Flight and floating + var/override_float = 0 + /////////// // PROCS // /////////// - var/flying = 0 + +/datum/species/New() + if(!limbs_id) //if we havent set a limbs id to use, just use our own id + limbs_id = id + ..() + //Called when admins use the Set Species verb, let's species //do some init stuff on the mob that got SS'd if necessary @@ -452,7 +461,6 @@ else icon_string = "m_[bodypart]_[S.icon_state]_[layer]" - world.log << icon_string I = image("icon" = 'icons/mob/mutant_bodyparts.dmi', "icon_state" = icon_string, "layer" =- layer) if(!(H.disabilities & HUSK)) @@ -848,6 +856,9 @@ if(!(H.status_flags & IGNORESLOWDOWN)) if(!has_gravity(H)) + if(specflags & FLYING) + . += speedmod + return // If there's no gravity we have the sanic speed of jetpack. var/obj/item/weapon/tank/jetpack/J = H.back var/obj/item/clothing/suit/space/hardsuit/C = H.wear_suit @@ -886,10 +897,11 @@ if(H.bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT) . += (BODYTEMP_COLD_DAMAGE_LIMIT - H.bodytemperature) / COLD_SLOWDOWN_FACTOR - var/leg_amount = H.get_num_legs() - . += 6 - 3*leg_amount //the fewer the legs, the slower the mob - if(!leg_amount) - . += 6 - 3*H.get_num_arms() //crawling is harder with fewer arms + if(!(specflags & FLYING)) + var/leg_amount = H.get_num_legs() + . += 6 - 3*leg_amount //the fewer the legs, the slower the mob + if(!leg_amount) + . += 6 - 3*H.get_num_arms() //crawling is harder with fewer arms . += speedmod @@ -1471,7 +1483,6 @@ /datum/species/proc/spec_stun(mob/living/carbon/human/H,amount) . = stunmod * amount - ////////////// //Space Move// ////////////// @@ -1483,22 +1494,6 @@ return 0 - - - - - - - - - - - - - - - - #undef HUMAN_MAX_OXYLOSS #undef HUMAN_CRIT_MAX_OXYLOSS diff --git a/code/modules/mob/living/carbon/human/species_types.dm b/code/modules/mob/living/carbon/human/species_types.dm index 0f40916250e..8800e78329b 100644 --- a/code/modules/mob/living/carbon/human/species_types.dm +++ b/code/modules/mob/living/carbon/human/species_types.dm @@ -742,41 +742,13 @@ SYNDICATE BLACK OPS mutant_bodyparts = list("tail_human", "ears", "wings") default_features = list("mcolor" = "FFF", "tail_human" = "None", "ears" = "None", "wings" = "Angel") use_skintones = 1 - flying = 0 + no_equip = list(slot_back) blacklisted = 1 + limbs_id = "human" skinned_type = /obj/item/stack/sheet/animalhide/human var/datum/action/innate/flight/fly -/* -/datum/species/human/qualifies_for_rank(rank, list/features) - if((!features["tail_human"] || features["tail_human"] == "None") && (!features["ears"] || features["ears"] == "None")) - return 1 //Pure humans are always allowed in all roles. - - //Mutants are not allowed in most roles. - if(rank in security_positions) //This list does not include lawyers. - return 0 - if(rank in science_positions) - return 0 - if(rank in medical_positions) - return 0 - if(rank in engineering_positions) - return 0 - if(rank == "Quartermaster") //QM is not contained in command_positions but we still want to bar mutants from it. - return 0 - return ..() - - -/datum/species/human/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H) - if(chem.id == "mutationtoxin") - H << "Your flesh rapidly mutates!" - H.set_species(/datum/species/jelly/slime) - H.reagents.del_reagent(chem.type) - H.faction |= "slime" - return 1 - -*/ - /datum/species/angel/on_species_gain(mob/living/carbon/human/H) ..() if(H.dna && H.dna.species &&((H.dna.features["wings"] != "Angel") && ("wings" in H.dna.species.mutant_bodyparts))) @@ -790,7 +762,8 @@ SYNDICATE BLACK OPS /datum/species/angel/on_species_loss(mob/living/carbon/human/H) if(fly) fly.Remove(H) - flying = 0 + if(FLYING in specflags) + specflags -= FLYING ToggleFlight(H,0) if(H.dna && H.dna.species &&((H.dna.features["wings"] != "None") && ("wings" in H.dna.species.mutant_bodyparts))) H.dna.features["wings"] = "None" @@ -801,7 +774,7 @@ SYNDICATE BLACK OPS HandleFlight(H) /datum/species/angel/proc/HandleFlight(mob/living/carbon/human/H) - if(flying) + if(FLYING in specflags) if(!CanFly(H)) ToggleFlight(H,0) H.float(0) @@ -812,22 +785,26 @@ SYNDICATE BLACK OPS H.float(0) return 0 - - /datum/species/angel/proc/CanFly(mob/living/carbon/human/H) + if(H.stat || H.stunned || H.weakened) + return 0 + if(H.wear_suit && (H.wear_suit.flags_inv & HIDEJUMPSUIT)) //Jumpsuits have tail holes, so it makes sense they have wing holes too + H << "Your suit blocks your wings from extending!" + return 0 var/turf/T = get_turf(H) if(!T) return 0 var/datum/gas_mixture/environment = T.return_air() if(environment && !(environment.return_pressure() > 30)) + H << "The atmosphere is too thin for you to fly!" return 0 else return 1 /datum/action/innate/flight name = "Toggle Flight" - check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_LYING + check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_RESTRAINED|AB_CHECK_STUNNED button_icon_state = "slimesplit" background_icon_state = "bg_alien" @@ -835,14 +812,17 @@ SYNDICATE BLACK OPS var/mob/living/carbon/human/H = owner var/datum/species/angel/A = H.dna.species if(A.CanFly(H)) - A.flying = !A.flying - if(A.flying) - H << "You beat your wings and begin to hover gently above the ground..." - A.ToggleFlight(H,A.flying) - else + if(FLYING in A.specflags) H << "You settle gently back onto the ground..." - A.ToggleFlight(H,A.flying) - + A.specflags -= FLYING + A.ToggleFlight(H,0) + H.update_canmove() + else + H << "You beat your wings and begin to hover gently above the ground..." + A.specflags += FLYING + H.resting = 0 + A.ToggleFlight(H,1) + H.update_canmove() /datum/species/angel/proc/flyslip(mob/living/carbon/human/H) var/obj/buckled_obj @@ -871,27 +851,30 @@ SYNDICATE BLACK OPS /datum/species/angel/spec_stun(mob/living/carbon/human/H,amount) - if(flying) + if(FLYING in specflags) flyslip(H) - ToggleFlight(H,0) - ..() + . = ..() /datum/species/angel/negates_gravity() - return flying + if(FLYING in specflags) + return 1 /datum/species/angel/space_move() - return flying + if(FLYING in specflags) + return 1 /datum/species/angel/proc/ToggleFlight(mob/living/carbon/human/H,flight) - if(flight) - flying = 1 + if(flight && CanFly(H)) stunmod = 2 speedmod = -1 + specflags += FLYING + override_float = 1 H.pass_flags |= PASSTABLE H.OpenWings() else - flying = 0 stunmod = 1 speedmod = 0 + specflags -= FLYING + override_float = 0 H.pass_flags &= ~PASSTABLE H.CloseWings() \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 6cb5cda6feb..37a207da1ee 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -583,7 +583,7 @@ var/global/list/limb_icon_cache = list() //produces a key based on the human's limbs /mob/living/carbon/human/proc/generate_icon_render_key() - . = "[dna.species.id]" + . = "[dna.species.limbs_id]" if(dna.check_mutation(HULK)) . += "-coloured-hulk" diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 06f6492e9ae..ef89ac463a4 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -716,14 +716,15 @@ Sorry Giacom. Please don't be mad :( /mob/living/proc/get_visible_name() return name -/mob/living/update_gravity(has_gravity) +/mob/living/update_gravity(has_gravity,override = 0) if(!ticker || !ticker.mode) return if(has_gravity) clear_alert("weightless") else throw_alert("weightless", /obj/screen/alert/weightless) - float(!has_gravity) + if(!override) + float(!has_gravity) /mob/living/proc/float(on) if(throwing) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 870064d2447..23cddc84d61 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -678,21 +678,22 @@ var/next_mob_id = 0 var/buckle_lying = !(buckled && !buckled.buckle_lying) var/has_legs = get_num_legs() var/has_arms = get_num_arms() + var/ignore_legs = get_leg_ignore() if(ko || resting || stunned) drop_r_hand() drop_l_hand() unset_machine() if(pulling) stop_pulling() - else if(has_legs) + else if(has_legs || ignore_legs) lying = 0 if(buckled) lying = 90*buckle_lying else - if((ko || resting || !has_legs) && !lying) + if((ko || resting || (!has_legs && !ignore_legs)) && !lying) fall(ko) - canmove = !(ko || resting || stunned || buckled || (!has_legs && !has_arms)) + canmove = !(ko || resting || stunned || buckled || (!has_legs && !ignore_legs && !has_arms)) density = !lying if(lying) if(layer == initial(layer)) //to avoid special cases like hiding larvas. diff --git a/code/modules/surgery/bodyparts/bodyparts.dm b/code/modules/surgery/bodyparts/bodyparts.dm index 0313dfa5325..62a7dbc4a3e 100644 --- a/code/modules/surgery/bodyparts/bodyparts.dm +++ b/code/modules/surgery/bodyparts/bodyparts.dm @@ -174,7 +174,7 @@ should_draw_greyscale = FALSE var/datum/species/S = H.dna.species - species_id = S.id + species_id = S.limbs_id if(S.use_skintones) skin_tone = H.skin_tone diff --git a/code/modules/surgery/bodyparts/helpers.dm b/code/modules/surgery/bodyparts/helpers.dm index 1dd5b807a62..54d19bf14af 100644 --- a/code/modules/surgery/bodyparts/helpers.dm +++ b/code/modules/surgery/bodyparts/helpers.dm @@ -51,6 +51,13 @@ /mob/proc/get_num_legs() return 2 +/mob/proc/get_leg_ignore() + return 0 + +/mob/living/carbon/human/get_leg_ignore() + if(FLYING in dna.species.specflags) + return 1 + /mob/living/carbon/human/get_num_arms() . = 0 for(var/X in bodyparts)