Merge pull request #9223 from Fox-McCloud/what-is-this-species

Makes Species datum Non-Global
This commit is contained in:
Crazy Lemon
2018-07-21 17:01:33 -07:00
committed by GitHub
197 changed files with 1320 additions and 1522 deletions
+15 -15
View File
@@ -280,7 +280,7 @@ var/record_id_num = 1001
G.fields["p_stat"] = "Active"
G.fields["m_stat"] = "Stable"
G.fields["sex"] = capitalize(H.gender)
G.fields["species"] = H.get_species()
G.fields["species"] = H.dna.species.name
G.fields["photo"] = get_id_photo(H)
G.fields["photo-south"] = "'data:image/png;base64,[icon2base64(icon(G.fields["photo"], dir = SOUTH))]'"
G.fields["photo-west"] = "'data:image/png;base64,[icon2base64(icon(G.fields["photo"], dir = WEST))]'"
@@ -357,7 +357,7 @@ var/record_id_num = 1001
temp = new /icon(icobase, "groin_[g]")
preview_icon.Blend(temp, ICON_OVERLAY)
var/head = "head"
if(head_organ.alt_head && head_organ.species.bodyflags & HAS_ALT_HEADS)
if(head_organ.alt_head && head_organ.dna.species.bodyflags & HAS_ALT_HEADS)
var/datum/sprite_accessory/alt_heads/alternate_head = alt_heads_list[head_organ.alt_head]
if(alternate_head.icon_state)
head = alternate_head.icon_state
@@ -368,7 +368,7 @@ var/record_id_num = 1001
if(H.body_accessory && istype(H.body_accessory, /datum/body_accessory/tail))
temp = new/icon("icon" = H.body_accessory.icon, "icon_state" = H.body_accessory.icon_state)
preview_icon.Blend(temp, ICON_OVERLAY)
else if(H.tail && H.species.bodyflags & HAS_TAIL)
else if(H.tail && H.dna.species.bodyflags & HAS_TAIL)
temp = new/icon("icon" = 'icons/effects/species.dmi', "icon_state" = "[H.tail]_s")
preview_icon.Blend(temp, ICON_OVERLAY)
@@ -376,19 +376,19 @@ var/record_id_num = 1001
preview_icon.Blend(E.get_icon(), ICON_OVERLAY)
// Skin tone
if(H.species.bodyflags & HAS_SKIN_TONE)
if(H.dna.species.bodyflags & HAS_SKIN_TONE)
if(H.s_tone >= 0)
preview_icon.Blend(rgb(H.s_tone, H.s_tone, H.s_tone), ICON_ADD)
else
preview_icon.Blend(rgb(-H.s_tone, -H.s_tone, -H.s_tone), ICON_SUBTRACT)
// Proper Skin color - Fix, you can't have HAS_SKIN_TONE *and* HAS_SKIN_COLOR
if(H.species.bodyflags & HAS_SKIN_COLOR)
if(H.dna.species.bodyflags & HAS_SKIN_COLOR)
preview_icon.Blend(H.skin_colour, ICON_ADD)
//Tail Markings
var/icon/t_marking_s
if(H.species.bodyflags & HAS_TAIL_MARKINGS)
if(H.dna.species.bodyflags & HAS_TAIL_MARKINGS)
var/tail_marking = H.m_styles["tail"]
var/datum/sprite_accessory/tail_marking_style = marking_styles_list[tail_marking]
if(tail_marking_style && tail_marking_style.species_allowed)
@@ -398,8 +398,8 @@ var/record_id_num = 1001
preview_icon.Blend(t_marking_s, ICON_OVERLAY)
var/icon/face_s = new/icon("icon" = 'icons/mob/human_face.dmi', "icon_state" = "bald_s")
if(!(H.species.bodyflags & NO_EYES))
var/icon/eyes_s = new/icon("icon" = 'icons/mob/human_face.dmi', "icon_state" = H.species ? H.species.eyes : "eyes_s")
if(!(H.dna.species.bodyflags & NO_EYES))
var/icon/eyes_s = new/icon("icon" = 'icons/mob/human_face.dmi', "icon_state" = H.dna.species ? H.dna.species.eyes : "eyes_s")
if(!eyes_organ)
return
eyes_s.Blend(eyes_organ.eye_colour, ICON_ADD)
@@ -410,7 +410,7 @@ var/record_id_num = 1001
var/icon/hair_s = new/icon("icon" = hair_style.icon, "icon_state" = "[hair_style.icon_state]_s")
// I'll want to make a species-specific proc for this sooner or later
// But this'll do for now
if(head_organ.species.name == "Slime People")
if(istype(head_organ.dna.species, /datum/species/slime))
hair_s.Blend("[H.skin_colour]A0", ICON_AND) //A0 = 160 alpha.
else
hair_s.Blend(head_organ.hair_colour, ICON_ADD)
@@ -424,7 +424,7 @@ var/record_id_num = 1001
face_s.Blend(hair_s, ICON_OVERLAY)
//Head Accessory
if(head_organ.species.bodyflags & HAS_HEAD_ACCESSORY)
if(head_organ.dna.species.bodyflags & HAS_HEAD_ACCESSORY)
var/datum/sprite_accessory/head_accessory_style = head_accessory_styles_list[head_organ.ha_style]
if(head_accessory_style && head_accessory_style.species_allowed)
var/icon/head_accessory_s = new/icon("icon" = head_accessory_style.icon, "icon_state" = "[head_accessory_style.icon_state]_s")
@@ -434,7 +434,7 @@ var/record_id_num = 1001
var/datum/sprite_accessory/facial_hair_style = facial_hair_styles_list[head_organ.f_style]
if(facial_hair_style && facial_hair_style.species_allowed)
var/icon/facial_s = new/icon("icon" = facial_hair_style.icon, "icon_state" = "[facial_hair_style.icon_state]_s")
if(head_organ.species.name == "Slime People")
if(istype(head_organ.dna.species, /datum/species/slime))
facial_s.Blend("[H.skin_colour]A0", ICON_ADD) //A0 = 160 alpha.
else
facial_s.Blend(head_organ.facial_colour, ICON_ADD)
@@ -448,15 +448,15 @@ var/record_id_num = 1001
face_s.Blend(facial_s, ICON_OVERLAY)
//Markings
if((H.species.bodyflags & HAS_HEAD_MARKINGS) || (H.species.bodyflags & HAS_BODY_MARKINGS))
if(H.species.bodyflags & HAS_BODY_MARKINGS) //Body markings.
if((H.dna.species.bodyflags & HAS_HEAD_MARKINGS) || (H.dna.species.bodyflags & HAS_BODY_MARKINGS))
if(H.dna.species.bodyflags & HAS_BODY_MARKINGS) //Body markings.
var/body_marking = H.m_styles["body"]
var/datum/sprite_accessory/body_marking_style = marking_styles_list[body_marking]
if(body_marking_style && body_marking_style.species_allowed)
var/icon/b_marking_s = new/icon("icon" = body_marking_style.icon, "icon_state" = "[body_marking_style.icon_state]_s")
b_marking_s.Blend(H.m_colours["body"], ICON_ADD)
face_s.Blend(b_marking_s, ICON_OVERLAY)
if(H.species.bodyflags & HAS_HEAD_MARKINGS) //Head markings.
if(H.dna.species.bodyflags & HAS_HEAD_MARKINGS) //Head markings.
var/head_marking = H.m_styles["head"]
var/datum/sprite_accessory/head_marking_style = marking_styles_list[head_marking]
if(head_marking_style && head_marking_style.species_allowed)
@@ -615,7 +615,7 @@ var/record_id_num = 1001
temp.Shift(EAST, H.body_accessory.pixel_x_offset)
if(H.body_accessory.pixel_y_offset)
temp.Shift(NORTH, H.body_accessory.pixel_y_offset)
if(H.species.bodyflags & HAS_SKIN_COLOR)
if(H.dna.species.bodyflags & HAS_SKIN_COLOR)
temp.Blend(H.skin_colour, H.body_accessory.blend_mode)
if(t_marking_s)
temp.Blend(t_marking_s, ICON_OVERLAY)
+3 -2
View File
@@ -1016,8 +1016,9 @@
to_chat(usr, "Mob doesn't exist anymore")
return
if(H.set_species(new_species))
to_chat(usr, "Set species of [H] to [H.species].")
var/datum/species/S = all_species[new_species]
if(H.set_species(S.type))
to_chat(usr, "Set species of [H] to [H.dna.species].")
H.regenerate_icons()
message_admins("[key_name_admin(usr)] has changed the species of [key_name_admin(H)] to [new_species]")
log_admin("[key_name(usr)] has changed the species of [key_name(H)] to [new_species]")
+1 -1
View File
@@ -134,7 +134,7 @@
/mob/living/carbon/human/CanContractDisease(datum/disease/D)
if((VIRUSIMMUNE in species.species_traits) && !D.bypasses_immunity)
if((VIRUSIMMUNE in dna.species.species_traits) && !D.bypasses_immunity)
return 0
for(var/thing in D.required_organs)
if(!((locate(thing) in bodyparts) || (locate(thing) in internal_organs)))
@@ -36,7 +36,7 @@ Bonus
else
if(ishuman(M))
var/mob/living/carbon/human/H = M
H.SetSpecialVoice(H.species.get_random_name(H.gender))
H.SetSpecialVoice(H.dna.species.get_random_name(H.gender))
return
+30 -29
View File
@@ -16,26 +16,26 @@
switch(stage)
if(1)
if(prob(10))
if(affected_mob.get_species() == "Tajaran")
if(istajaran(affected_mob))
to_chat(affected_mob, "<span class='notice'>You feel good.</span>")
else
to_chat(affected_mob, "<span class='notice'>You feel like playing with string.</span>")
if(2)
if(prob(10))
if(affected_mob.get_species() == "Tajaran")
if(istajaran(affected_mob))
to_chat(affected_mob, "<span class='danger'>Something in your throat itches.</span>")
else
to_chat(affected_mob, "<span class='danger'>You NEED to find a mouse.</span>")
if(3)
if(prob(10))
if(affected_mob.get_species() == "Tajaran")
if(istajaran(affected_mob))
to_chat(affected_mob, "<span class='danger'>You feel something in your throat!</span>")
affected_mob.emote("cough")
else
affected_mob.say(pick(list("Mew", "Meow!", "Nya!~")))
if(4)
if(prob(5))
if(affected_mob.get_species() == "Tajaran")
if(istajaran(affected_mob))
affected_mob.visible_message("<span class='danger'>[affected_mob] coughs up a hairball!</span>", \
"<span class='userdanger'>You cough up a hairball!</span>")
affected_mob.Stun(5)
@@ -43,7 +43,7 @@
affected_mob.visible_message("<span class='danger'>[affected_mob]'s form contorts into something more feline!</span>", \
"<span class='userdanger'>YOU TURN INTO A TAJARAN!</span>")
var/mob/living/carbon/human/catface = affected_mob
catface.set_species("Tajaran")
catface.set_species(/datum/species/tajaran)
/datum/disease/kingstons/advanced
@@ -57,9 +57,9 @@
permeability_mod = 0.75
desc = "If left untreated the subject will mutate to a different species."
severity = BIOHAZARD
var/list/virspecies = list("Human", "Tajaran", "Unathi", "Skrell", "Vulpkanin")//no karma races sorrys.
var/list/virspecies = list(/datum/species/human, /datum/species/tajaran, /datum/species/unathi,/datum/species/skrell, /datum/species/vulpkanin) //no karma races sorrys.
var/list/virsuffix = list("pox", "rot", "flu", "cough", "-gitis", "cold", "rash", "itch", "decay")
var/chosentype
var/datum/species/chosentype
var/chosensuff
/datum/disease/kingstons/advanced/New()
@@ -70,26 +70,27 @@
/datum/disease/kingstons/advanced/stage_act()
..()
switch(stage)
if(1)
if(prob(10))
to_chat(affected_mob, "<span class='notice'>You feel awkward.</span>")
if(2)
if(prob(10))
to_chat(affected_mob, "<span class='danger'>You itch.</span>")
if(3)
if(prob(10))
to_chat(affected_mob, "<span class='danger'>Your skin starts to flake!</span>")
if(ishuman(affected_mob))
var/mob/living/carbon/human/twisted = affected_mob
switch(stage)
if(1)
if(prob(10))
to_chat(twisted, "<span class='notice'>You feel awkward.</span>")
if(2)
if(prob(10))
to_chat(twisted, "<span class='danger'>You itch.</span>")
if(3)
if(prob(10))
to_chat(twisted, "<span class='danger'>Your skin starts to flake!</span>")
if(4)
if(prob(5))
if(affected_mob.get_species() != chosentype)
affected_mob.visible_message("<span class='danger'>[affected_mob]'s skin splits and form contorts!</span>", \
"<span class='userdanger'>Your body mutates into a [chosentype]!</span>")
var/mob/living/carbon/human/twisted = affected_mob
twisted.set_species(chosentype)
else
affected_mob.visible_message("<span class='danger'>[affected_mob] scratches at thier skin!</span>", \
"<span class='userdanger'>You scratch your skin to try not to itch!</span>")
affected_mob.adjustBruteLoss(-5)
affected_mob.adjustStaminaLoss(5)
if(4)
if(prob(5))
if(!istype(twisted.dna.species, chosentype))
twisted.visible_message("<span class='danger'>[twisted]'s skin splits and form contorts!</span>", \
"<span class='userdanger'>Your body mutates into a [initial(chosentype.name)]!</span>")
twisted.set_species(chosentype)
else
twisted.visible_message("<span class='danger'>[twisted] scratches at thier skin!</span>", \
"<span class='userdanger'>You scratch your skin to try not to itch!</span>")
twisted.adjustBruteLoss(-5)
twisted.adjustStaminaLoss(5)
+3 -3
View File
@@ -194,13 +194,13 @@
if(1)
if(ishuman(affected_mob))
var/mob/living/carbon/human/H = affected_mob
if(H.species.name == "Slime People")
if(isslimeperson(H))
stage = 5
if(3)
if(ishuman(affected_mob))
var/mob/living/carbon/human/human = affected_mob
if(human.species.name != "Slime People")
human.set_species("Slime People")
if(!isslimeperson(human))
human.set_species(/datum/species/slime)
/datum/disease/transformation/corgi
name = "The Barkening"
+17 -19
View File
@@ -61,7 +61,6 @@
var/linglink
var/datum/vampire/vampire //vampire holder
var/datum/nations/nation //nation holder
var/datum/abductor/abductor //abductor holder
var/antag_hud_icon_state = null //this mind's ANTAG_HUD should have this icon_state
var/datum/atom_hud/antag/antag_hud = null //this mind's antag HUD
@@ -1132,14 +1131,17 @@
log_admin("[key_name(usr)] turned [current] into abductor.")
ticker.mode.update_abductor_icons_added(src)
if("equip")
if(!ishuman(current))
to_chat(usr, "<span class='warning'>This only works on humans!</span>")
return
var/mob/living/carbon/human/H = current
var/gear = alert("Agent or Scientist Gear","Gear","Agent","Scientist")
if(gear)
var/datum/game_mode/abduction/temp = new
temp.equip_common(current)
if(gear=="Agent")
temp.equip_agent(current)
H.equipOutfit(/datum/outfit/abductor/agent)
else
temp.equip_scientist(current)
H.equipOutfit(/datum/outfit/abductor/scientist)
else if(href_list["silicon"])
switch(href_list["silicon"])
@@ -1424,36 +1426,32 @@
var/mob/living/carbon/human/H = current
H.set_species("Abductor")
H.set_species(/datum/species/abductor)
var/datum/species/abductor/S = H.dna.species
switch(role)
if("Agent")
H.mind.abductor.agent = 1
if("Scientist")
H.mind.abductor.scientist = 1
H.mind.abductor.team = team
if(role == "Scientist")
S.scientist = TRUE
S.team = team
var/list/obj/effect/landmark/abductor/agent_landmarks = new
var/list/obj/effect/landmark/abductor/scientist_landmarks = new
agent_landmarks.len = 4
scientist_landmarks.len = 4
for(var/obj/effect/landmark/abductor/A in landmarks_list)
if(istype(A,/obj/effect/landmark/abductor/agent))
if(istype(A, /obj/effect/landmark/abductor/agent))
agent_landmarks[text2num(A.team)] = A
else if(istype(A,/obj/effect/landmark/abductor/scientist))
else if(istype(A, /obj/effect/landmark/abductor/scientist))
scientist_landmarks[text2num(A.team)] = A
var/obj/effect/landmark/L
if(teleport=="Yes")
if(teleport == "Yes")
switch(role)
if("Agent")
H.mind.abductor.agent = 1
L = agent_landmarks[team]
H.loc = L.loc
if("Scientist")
H.mind.abductor.scientist = 1
L = agent_landmarks[team]
H.loc = L.loc
H.forceMove(L.loc)
// check whether this mind's mob has been brigged for the given duration
+1 -1
View File
@@ -371,7 +371,7 @@
)
/datum/outfit/admin/vox/equip(mob/living/carbon/human/H, visualsOnly = FALSE)
if(H.get_species() == "Vox Armalis")
if(isvoxarmalis(H))
. = ..()
else
H.equip_vox_raider()
+2 -2
View File
@@ -68,7 +68,7 @@
lich.real_name = M.mind.name
M.mind.transfer_to(lich)
lich.set_species("Skeleton")
lich.set_species(/datum/species/skeleton)
to_chat(lich, "<span class='warning'>Your bones clatter and shutter as they're pulled back into this world!</span>")
charge_max += 600
var/mob/old_body = current_body
@@ -122,7 +122,7 @@
current_body = M.mind.current
if(ishuman(M))
var/mob/living/carbon/human/H = M
H.set_species("Skeleton")
H.set_species(/datum/species/skeleton)
H.unEquip(H.wear_suit)
H.unEquip(H.head)
H.unEquip(H.shoes)
@@ -34,7 +34,7 @@
if(prob(40))
if(ishuman(L))
var/mob/living/carbon/human/H = L
if(!(RADIMMUNE in H.species.species_traits))
if(!(RADIMMUNE in H.dna.species.species_traits))
if(prob(max(0, 100 - resist)))
randmuti(H) // Applies bad mutation
if(prob(50))