diff --git a/code/modules/mob/living/carbon/human/examine_vr.dm b/code/modules/mob/living/carbon/human/examine_vr.dm index 1d6d77c5ab..a9b6390782 100644 --- a/code/modules/mob/living/carbon/human/examine_vr.dm +++ b/code/modules/mob/living/carbon/human/examine_vr.dm @@ -114,15 +114,23 @@ //For OmniHUD records access for appropriate models /proc/hasHUD_vr(mob/living/carbon/human/H, hudtype) - if(!(istype(H.glasses, /obj/item/clothing/glasses/omnihud))) - return 0 //Not wearing omnis, don't care. + if(H.nif) + switch(hudtype) + if("security") + if(H.nif.flag_check(NIF_V_AR_SECURITY,NIF_FLAGS_VISION)) + return TRUE + if("medical") + if(H.nif.flag_check(NIF_V_AR_MEDICAL,NIF_FLAGS_VISION)) + return TRUE - var/obj/item/clothing/glasses/omnihud/omni = H.glasses + if(istype(H.glasses, /obj/item/clothing/glasses/omnihud)) + var/obj/item/clothing/glasses/omnihud/omni = H.glasses + switch(hudtype) + if("security") + if(omni.mode == "sec" || omni.mode == "best") + return TRUE + if("medical") + if(omni.mode == "med" || omni.mode == "best") + return TRUE - switch(hudtype) - if("security") - return omni.mode == "sec" || omni.mode == "best" - if("medical") - return omni.mode == "med" || omni.mode == "best" - else - return 0 \ No newline at end of file + return FALSE diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index a0cfc6f0a8..753cf3255e 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -82,7 +82,7 @@ handle_medical_side_effects() handle_heartbeat() - + handle_nif() //VOREStation Add if(!client) species.handle_npc(src) @@ -1336,10 +1336,10 @@ var/obj/item/clothing/glasses/omnihud/S = G O = S.hud //VOREStation Add End - if(istype(G, /obj/item/clothing/glasses/sunglasses/sechud)) + else if(istype(G, /obj/item/clothing/glasses/sunglasses/sechud)) //VOREStation Edit - Added else var/obj/item/clothing/glasses/sunglasses/sechud/S = G O = S.hud - if(istype(G, /obj/item/clothing/glasses/sunglasses/medhud)) + else if(istype(G, /obj/item/clothing/glasses/sunglasses/medhud)) //VOREStation Edit - Added else var/obj/item/clothing/glasses/sunglasses/medhud/M = G O = M.hud if(istype(O)) diff --git a/code/modules/mob/living/carbon/human/life_vr.dm b/code/modules/mob/living/carbon/human/life_vr.dm index 9e655d2672..a04232c401 100644 --- a/code/modules/mob/living/carbon/human/life_vr.dm +++ b/code/modules/mob/living/carbon/human/life_vr.dm @@ -43,3 +43,9 @@ vantag.icon_state = vantag_pref else vantag.icon_state = "hudblank" + +/mob/living/carbon/human/proc/handle_nif() + if(!nif) return + + //Process regular life stuff + nif.life() \ No newline at end of file diff --git a/code/modules/surgery/implant.dm b/code/modules/surgery/implant.dm index 3e49482c75..8c2fbfbbc0 100644 --- a/code/modules/surgery/implant.dm +++ b/code/modules/surgery/implant.dm @@ -136,6 +136,7 @@ user.drop_item() affected.implants += tool tool.loc = affected + if(istype(tool,/obj/item/device/nif)){var/obj/item/device/nif/N = tool;N.implant(target)} //VOREStation Add - NIF support affected.cavity = 0 ////////////////////////////////////////////////////////////////// @@ -207,6 +208,7 @@ var/obj/item/weapon/implant/imp = obj imp.imp_in = null imp.implanted = 0 + else if(istype(tool,/obj/item/device/nif)){var/obj/item/device/nif/N = tool;N.unimplant(target)} //VOREStation Add - NIF support else user.visible_message("\blue [user] removes \the [tool] from [target]'s [affected.name].", \ "\blue There's something inside [target]'s [affected.name], but you just missed it this time." ) diff --git a/code/modules/vore/persist/persist_vr.dm b/code/modules/vore/persist/persist_vr.dm index a6ff22d4e4..977473812a 100644 --- a/code/modules/vore/persist/persist_vr.dm +++ b/code/modules/vore/persist/persist_vr.dm @@ -35,6 +35,32 @@ persist_interround_data(Player, /datum/spawnpoint/cryo) return 1 +/** + * Prep for save: returns a preferences object if we're ready and allowed to save this mob. + */ +/proc/prep_for_persist(var/mob/persister) + ASSERT(istype(persister)) + + // Find out of this mob is a proper mob! + if (persister.mind && persister.mind.loaded_from_ckey) + // Okay this mob has a real loaded-from-savefile mind in it! + var/datum/preferences/prefs = preferences_datums[persister.mind.loaded_from_ckey] + if(!prefs) + WARNING("mind [persister.mind] was loaded from ckey [persister.mind.loaded_from_ckey] but no prefs datum found") + return + + // Okay, lets do a few checks to see if we should really save tho! + if(!prefs.load_character(persister.mind.loaded_from_slot)) + WARNING("mind [persister.mind] was loaded from slot [persister.mind.loaded_from_slot] but loading prefs failed.") + return // Failed to load character + + // For now as a safety measure we will only save if the name matches. + if(prefs.real_name != persister.real_name) + log_debug("Skipping persist for [persister] becuase [persister.real_name] != [prefs.real_name]") + return + + return prefs + /** * Called when mob despawns early (via cryopod)! */ @@ -47,42 +73,28 @@ /proc/persist_interround_data(var/mob/occupant, var/datum/spawnpoint/new_spawn_point_type) ASSERT(istype(occupant)) - // Find out of this mob is a proper mob! - if (occupant.mind && occupant.mind.loaded_from_ckey) - // Okay this mob has a real loaded-from-savefile mind in it! - var/datum/preferences/prefs = preferences_datums[occupant.mind.loaded_from_ckey] - if(!prefs) - WARNING("mind [occupant.mind] was loaded from ckey [occupant.mind.loaded_from_ckey] but no prefs datum found") - return + var/datum/preferences/prefs = prep_for_persist(occupant) + if(!prefs) + WARNING("persist_interround_data failed to prep [occupant] for persisting") + return - // Okay, lets do a few checks to see if we should really save tho! - if(!prefs.load_character(occupant.mind.loaded_from_slot)) - WARNING("mind [occupant.mind] was loaded from slot [occupant.mind.loaded_from_slot] but loading prefs failed.") - return // Failed to load character + if(!prefs.persistence_settings) + return // Persistence disabled by preference settings - // For now as a safety measure we will only save if the name matches. - if(prefs.real_name != occupant.real_name) - log_debug("Skipping persist for [occupant] becuase [occupant.real_name] != [prefs.real_name]") - return - - if(!prefs.persistence_settings) - return // Persistence disabled by preference settings - - // Okay we can start saving the data - if(new_spawn_point_type && prefs.persistence_settings & PERSIST_SPAWN) - prefs.spawnpoint = initial(new_spawn_point_type.display_name) - if(ishuman(occupant) && occupant.stat != DEAD) - var/mob/living/carbon/human/H = occupant - testing("About to try saving stuff from [H] to [prefs] (\ref[prefs])") - if(prefs.persistence_settings & PERSIST_ORGANS) - apply_organs_to_prefs(H, prefs) - if(prefs.persistence_settings & PERSIST_MARKINGS) - apply_markings_to_prefs(H, prefs) - if(prefs.persistence_settings & PERSIST_WEIGHT) - resolve_excess_nutrition(H) - prefs.weight_vr = H.weight - prefs.save_character() - return + // Okay we can start saving the data + if(new_spawn_point_type && prefs.persistence_settings & PERSIST_SPAWN) + prefs.spawnpoint = initial(new_spawn_point_type.display_name) + if(ishuman(occupant) && occupant.stat != DEAD) + var/mob/living/carbon/human/H = occupant + testing("About to try saving stuff from [H] to [prefs] (\ref[prefs])") + if(prefs.persistence_settings & PERSIST_ORGANS) + apply_organs_to_prefs(H, prefs) + if(prefs.persistence_settings & PERSIST_MARKINGS) + apply_markings_to_prefs(H, prefs) + if(prefs.persistence_settings & PERSIST_WEIGHT) + resolve_excess_nutrition(H) + prefs.weight_vr = H.weight + prefs.save_character() // Saves mob's current coloration state to prefs // This basically needs to be the reverse of /datum/category_item/player_setup_item/general/body/copy_to_mob() ~Leshana @@ -194,3 +206,13 @@ // Weight Loss! var/loss = (MAX_NUTRITION_TO_LOSE - C.nutrition) * weight_per_nutrition * C.weight_loss/100 C.weight = max(MIN_MOB_WEIGHT, C.weight - loss) + +/** +* Persist any NIF data that needs to be persisted. It's stored in a list to make it more malleable +* towards future shenanigans such as upgradable NIFs or different types or things of that nature, +* without invoking the need for a bunch of different save file variables. +*/ +/proc/persist_nif_data(var/mob/living/carbon/human/H) + if(!istype(H)) + CRASH("persist_nif_data given a nonhuman: [H]") + diff --git a/icons/obj/device_alt.dmi b/icons/obj/device_alt.dmi index fed11b212b..e434cfb7ac 100644 Binary files a/icons/obj/device_alt.dmi and b/icons/obj/device_alt.dmi differ diff --git a/icons/obj/vending_vr.dmi b/icons/obj/vending_vr.dmi index 1feb5f36c5..7d71132986 100644 Binary files a/icons/obj/vending_vr.dmi and b/icons/obj/vending_vr.dmi differ diff --git a/vorestation.dme b/vorestation.dme index 58325fdbbc..43703a8306 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -39,6 +39,7 @@ #include "code\__defines\misc.dm" #include "code\__defines\misc_vr.dm" #include "code\__defines\mobs.dm" +#include "code\__defines\nifsoft.dm" #include "code\__defines\planets.dm" #include "code\__defines\process_scheduler.dm" #include "code\__defines\research.dm" @@ -1963,6 +1964,12 @@ #include "code\modules\nano\modules\nano_module.dm" #include "code\modules\nano\modules\power_monitor.dm" #include "code\modules\nano\modules\rcon.dm" +#include "code\modules\nifsoft\nif.dm" +#include "code\modules\nifsoft\nif_interface.dm" +#include "code\modules\nifsoft\nif_softshop.dm" +#include "code\modules\nifsoft\nif_statpanel.dm" +#include "code\modules\nifsoft\nifsoft.dm" +#include "code\modules\nifsoft\software\vision.dm" #include "code\modules\organs\blood.dm" #include "code\modules\organs\misc.dm" #include "code\modules\organs\organ.dm"