mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-23 03:57:48 +01:00
Merge pull request #4457 from Atermonera/VR_Avatar
VR mobs can toggle opaque/translucent appearance
This commit is contained in:
@@ -223,4 +223,67 @@ var/list/wrapped_species_by_ref = list()
|
||||
|
||||
/mob/living/carbon/human/proc/shapeshifter_set_facial_color(var/new_fhair)
|
||||
|
||||
change_facial_hair_color(hex2num(copytext(new_fhair, 2, 4)), hex2num(copytext(new_fhair, 4, 6)), hex2num(copytext(new_fhair, 6, 8)))
|
||||
change_facial_hair_color(hex2num(copytext(new_fhair, 2, 4)), hex2num(copytext(new_fhair, 4, 6)), hex2num(copytext(new_fhair, 6, 8)))
|
||||
|
||||
// Replaces limbs and copies wounds
|
||||
/mob/living/carbon/human/proc/shapeshifter_change_species(var/new_species)
|
||||
if(!species)
|
||||
return
|
||||
|
||||
dna.species = new_species
|
||||
|
||||
var/list/limb_exists = list(
|
||||
BP_TORSO = 0,
|
||||
BP_GROIN = 0,
|
||||
BP_HEAD = 0,
|
||||
BP_L_ARM = 0,
|
||||
BP_R_ARM = 0,
|
||||
BP_L_LEG = 0,
|
||||
BP_R_LEG = 0,
|
||||
BP_L_HAND = 0,
|
||||
BP_R_HAND = 0,
|
||||
BP_L_FOOT = 0,
|
||||
BP_R_FOOT = 0
|
||||
)
|
||||
var/list/wounds_by_limb = list(
|
||||
BP_TORSO = new/list(),
|
||||
BP_GROIN = new/list(),
|
||||
BP_HEAD = new/list(),
|
||||
BP_L_ARM = new/list(),
|
||||
BP_R_ARM = new/list(),
|
||||
BP_L_LEG = new/list(),
|
||||
BP_R_LEG = new/list(),
|
||||
BP_L_HAND = new/list(),
|
||||
BP_R_HAND = new/list(),
|
||||
BP_L_FOOT = new/list(),
|
||||
BP_R_FOOT = new/list()
|
||||
)
|
||||
|
||||
// Copy damage values
|
||||
for(var/limb in organs_by_name)
|
||||
var/obj/item/organ/external/O = organs_by_name[limb]
|
||||
limb_exists[O.organ_tag] = 1
|
||||
wounds_by_limb[O.organ_tag] = O.wounds
|
||||
|
||||
species = all_species[new_species]
|
||||
species.create_organs(src)
|
||||
// species.handle_post_spawn(src)
|
||||
|
||||
for(var/limb in organs_by_name)
|
||||
var/obj/item/organ/external/O = organs_by_name[limb]
|
||||
if(limb_exists[O.organ_tag])
|
||||
O.species = all_species[new_species]
|
||||
O.wounds = wounds_by_limb[O.organ_tag]
|
||||
// sync the organ's damage with its wounds
|
||||
O.update_damages()
|
||||
O.owner.updatehealth() //droplimb will call updatehealth() again if it does end up being called
|
||||
else
|
||||
organs.Remove(O)
|
||||
organs_by_name.Remove(O)
|
||||
|
||||
spawn(0)
|
||||
regenerate_icons()
|
||||
|
||||
if(species && mind)
|
||||
apply_traits()
|
||||
return
|
||||
@@ -31,6 +31,7 @@
|
||||
/mob/living/carbon/human/proc/shapeshifter_select_hair_colors,
|
||||
/mob/living/carbon/human/proc/shapeshifter_select_gender,
|
||||
/mob/living/carbon/human/proc/regenerate,
|
||||
/mob/living/carbon/human/proc/shapeshifter_change_opacity,
|
||||
/mob/living/carbon/human/proc/exit_vr
|
||||
)
|
||||
|
||||
@@ -41,6 +42,23 @@
|
||||
/datum/species/shapeshifter/promethean/avatar/handle_environment_special(var/mob/living/carbon/human/H)
|
||||
return
|
||||
|
||||
/mob/living/carbon/human/proc/shapeshifter_change_opacity()
|
||||
|
||||
set name = "Toggle Opacity"
|
||||
set category = "Abilities"
|
||||
|
||||
if(stat || world.time < last_special)
|
||||
return
|
||||
|
||||
last_special = world.time + 10
|
||||
|
||||
if(src.icon_state == "promethean")
|
||||
icon_state = lowertext(src.species.get_bodytype(src))
|
||||
shapeshifter_change_species("Virtual Reality [src.species.get_bodytype(src)]")
|
||||
else
|
||||
icon_state = "promethean"
|
||||
shapeshifter_change_species("Virtual Reality Avatar")
|
||||
|
||||
|
||||
// enter_vr is called on the original mob, and puts the mind into the supplied vr mob
|
||||
/mob/living/carbon/human/proc/enter_vr(var/mob/living/carbon/human/avatar) // Avatar is currently a human, because we have preexisting setup code for appearance manipulation, etc.
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
// Species for the opaque appearance
|
||||
// Due to sprite construction, they have to have separate limb lists
|
||||
|
||||
/datum/species/shapeshifter/promethean/avatar/human
|
||||
name = "Virtual Reality Human"
|
||||
icobase = 'icons/mob/human_races/r_human.dmi'
|
||||
deform = 'icons/mob/human_races/r_def_human.dmi'
|
||||
appearance_flags = HAS_HAIR_COLOR | HAS_SKIN_TONE | HAS_LIPS | HAS_UNDERWEAR | HAS_EYE_COLOR
|
||||
has_limbs = list(
|
||||
BP_TORSO = list("path" = /obj/item/organ/external/chest),
|
||||
BP_GROIN = list("path" = /obj/item/organ/external/groin),
|
||||
BP_HEAD = list("path" = /obj/item/organ/external/head),
|
||||
BP_L_ARM = list("path" = /obj/item/organ/external/arm),
|
||||
BP_R_ARM = list("path" = /obj/item/organ/external/arm/right),
|
||||
BP_L_LEG = list("path" = /obj/item/organ/external/leg),
|
||||
BP_R_LEG = list("path" = /obj/item/organ/external/leg/right),
|
||||
BP_L_HAND = list("path" = /obj/item/organ/external/hand),
|
||||
BP_R_HAND = list("path" = /obj/item/organ/external/hand/right),
|
||||
BP_L_FOOT = list("path" = /obj/item/organ/external/foot),
|
||||
BP_R_FOOT = list("path" = /obj/item/organ/external/foot/right)
|
||||
)
|
||||
|
||||
/datum/species/shapeshifter/promethean/avatar/unathi
|
||||
name = "Virtual Reality Unathi"
|
||||
icobase = 'icons/mob/human_races/r_lizard.dmi'
|
||||
deform = 'icons/mob/human_races/r_def_lizard.dmi'
|
||||
tail = "sogtail"
|
||||
tail_animation = 'icons/mob/species/unathi/tail.dmi'
|
||||
appearance_flags = HAS_HAIR_COLOR | HAS_LIPS | HAS_UNDERWEAR | HAS_SKIN_COLOR | HAS_EYE_COLOR
|
||||
has_limbs = list(
|
||||
BP_TORSO = list("path" = /obj/item/organ/external/chest/unathi),
|
||||
BP_GROIN = list("path" = /obj/item/organ/external/groin/unathi),
|
||||
BP_HEAD = list("path" = /obj/item/organ/external/head/unathi),
|
||||
BP_L_ARM = list("path" = /obj/item/organ/external/arm),
|
||||
BP_R_ARM = list("path" = /obj/item/organ/external/arm/right),
|
||||
BP_L_LEG = list("path" = /obj/item/organ/external/leg),
|
||||
BP_R_LEG = list("path" = /obj/item/organ/external/leg/right),
|
||||
BP_L_HAND = list("path" = /obj/item/organ/external/hand),
|
||||
BP_R_HAND = list("path" = /obj/item/organ/external/hand/right),
|
||||
BP_L_FOOT = list("path" = /obj/item/organ/external/foot),
|
||||
BP_R_FOOT = list("path" = /obj/item/organ/external/foot/right)
|
||||
)
|
||||
|
||||
/datum/species/shapeshifter/promethean/avatar/tajaran
|
||||
name = "Virtual Reality Tajara"
|
||||
icobase = 'icons/mob/human_races/r_tajaran.dmi'
|
||||
deform = 'icons/mob/human_races/r_def_tajaran.dmi'
|
||||
tail = "tajtail"
|
||||
tail_animation = 'icons/mob/species/tajaran/tail.dmi'
|
||||
appearance_flags = HAS_HAIR_COLOR | HAS_LIPS | HAS_UNDERWEAR | HAS_SKIN_COLOR | HAS_EYE_COLOR
|
||||
has_limbs = list(
|
||||
BP_TORSO = list("path" = /obj/item/organ/external/chest),
|
||||
BP_GROIN = list("path" = /obj/item/organ/external/groin),
|
||||
BP_HEAD = list("path" = /obj/item/organ/external/head),
|
||||
BP_L_ARM = list("path" = /obj/item/organ/external/arm),
|
||||
BP_R_ARM = list("path" = /obj/item/organ/external/arm/right),
|
||||
BP_L_LEG = list("path" = /obj/item/organ/external/leg),
|
||||
BP_R_LEG = list("path" = /obj/item/organ/external/leg/right),
|
||||
BP_L_HAND = list("path" = /obj/item/organ/external/hand),
|
||||
BP_R_HAND = list("path" = /obj/item/organ/external/hand/right),
|
||||
BP_L_FOOT = list("path" = /obj/item/organ/external/foot),
|
||||
BP_R_FOOT = list("path" = /obj/item/organ/external/foot/right)
|
||||
)
|
||||
|
||||
/datum/species/shapeshifter/promethean/avatar/skrell
|
||||
name = "Virtual Reality Skrell"
|
||||
icobase = 'icons/mob/human_races/r_skrell.dmi'
|
||||
deform = 'icons/mob/human_races/r_def_skrell.dmi'
|
||||
appearance_flags = HAS_HAIR_COLOR | HAS_LIPS | HAS_UNDERWEAR | HAS_SKIN_COLOR
|
||||
has_limbs = list(
|
||||
BP_TORSO = list("path" = /obj/item/organ/external/chest),
|
||||
BP_GROIN = list("path" = /obj/item/organ/external/groin),
|
||||
BP_HEAD = list("path" = /obj/item/organ/external/head/skrell),
|
||||
BP_L_ARM = list("path" = /obj/item/organ/external/arm),
|
||||
BP_R_ARM = list("path" = /obj/item/organ/external/arm/right),
|
||||
BP_L_LEG = list("path" = /obj/item/organ/external/leg),
|
||||
BP_R_LEG = list("path" = /obj/item/organ/external/leg/right),
|
||||
BP_L_HAND = list("path" = /obj/item/organ/external/hand),
|
||||
BP_R_HAND = list("path" = /obj/item/organ/external/hand/right),
|
||||
BP_L_FOOT = list("path" = /obj/item/organ/external/foot),
|
||||
BP_R_FOOT = list("path" = /obj/item/organ/external/foot/right)
|
||||
)
|
||||
|
||||
/datum/species/shapeshifter/promethean/avatar/teshari
|
||||
name = "Virtual Reality Teshari"
|
||||
icobase = 'icons/mob/human_races/r_seromi.dmi'
|
||||
deform = 'icons/mob/human_races/r_seromi.dmi'
|
||||
appearance_flags = HAS_HAIR_COLOR | HAS_SKIN_COLOR | HAS_EYE_COLOR
|
||||
has_limbs = list(
|
||||
BP_TORSO = list("path" = /obj/item/organ/external/chest),
|
||||
BP_GROIN = list("path" = /obj/item/organ/external/groin),
|
||||
BP_HEAD = list("path" = /obj/item/organ/external/head/seromi),
|
||||
BP_L_ARM = list("path" = /obj/item/organ/external/arm),
|
||||
BP_R_ARM = list("path" = /obj/item/organ/external/arm/right),
|
||||
BP_L_LEG = list("path" = /obj/item/organ/external/leg),
|
||||
BP_R_LEG = list("path" = /obj/item/organ/external/leg/right),
|
||||
BP_L_HAND = list("path" = /obj/item/organ/external/hand/seromi),
|
||||
BP_R_HAND = list("path" = /obj/item/organ/external/hand/right/seromi),
|
||||
BP_L_FOOT = list("path" = /obj/item/organ/external/foot/seromi),
|
||||
BP_R_FOOT = list("path" = /obj/item/organ/external/foot/right/seromi)
|
||||
)
|
||||
|
||||
/datum/species/shapeshifter/promethean/avatar/diona
|
||||
name = "Virtual Reality Diona"
|
||||
icobase = 'icons/mob/human_races/r_diona.dmi'
|
||||
deform = 'icons/mob/human_races/r_def_plant.dmi'
|
||||
appearance_flags = 0
|
||||
has_limbs = list(
|
||||
BP_TORSO = list("path" = /obj/item/organ/external/diona/chest),
|
||||
BP_GROIN = list("path" = /obj/item/organ/external/diona/groin),
|
||||
BP_HEAD = list("path" = /obj/item/organ/external/head/no_eyes/diona),
|
||||
BP_L_ARM = list("path" = /obj/item/organ/external/diona/arm),
|
||||
BP_R_ARM = list("path" = /obj/item/organ/external/diona/arm/right),
|
||||
BP_L_LEG = list("path" = /obj/item/organ/external/diona/leg),
|
||||
BP_R_LEG = list("path" = /obj/item/organ/external/diona/leg/right),
|
||||
BP_L_HAND = list("path" = /obj/item/organ/external/diona/hand),
|
||||
BP_R_HAND = list("path" = /obj/item/organ/external/diona/hand/right),
|
||||
BP_L_FOOT = list("path" = /obj/item/organ/external/diona/foot),
|
||||
BP_R_FOOT = list("path" = /obj/item/organ/external/diona/foot/right)
|
||||
)
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
author: Atermonera
|
||||
|
||||
delete-after: True
|
||||
|
||||
- rscadd: "Mobs in VR can switch between translucent and opaque forms."
|
||||
@@ -1756,6 +1756,7 @@
|
||||
#include "code\modules\mob\living\carbon\human\species\station\seromi.dm"
|
||||
#include "code\modules\mob\living\carbon\human\species\station\station.dm"
|
||||
#include "code\modules\mob\living\carbon\human\species\virtual_reality\avatar.dm"
|
||||
#include "code\modules\mob\living\carbon\human\species\virtual_reality\opaque_form.dm"
|
||||
#include "code\modules\mob\living\carbon\human\species\xenomorphs\alien_powers.dm"
|
||||
#include "code\modules\mob\living\carbon\human\species\xenomorphs\alien_species.dm"
|
||||
#include "code\modules\mob\living\carbon\human\species\xenomorphs\xenomorphs.dm"
|
||||
|
||||
Reference in New Issue
Block a user