diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index 1f71b4cdd1c..d06238ace52 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -3,7 +3,7 @@ //PUBLIC - call these wherever you want -/mob/proc/throw_alert(category, type, severity, obj/new_master, override = FALSE, timeout_override, no_anim) +/mob/proc/throw_alert(category, type, severity, obj/new_master, override = FALSE, timeout_override, no_anim, icon_override) /* Proc to create or update an alert. Returns the alert if the alert is new or updated, 0 if it was thrown already @@ -42,6 +42,9 @@ if(override) alert.timeout = null + if(icon_override) + alert.icon = icon_override + if(new_master) var/old_layer = new_master.layer var/old_plane = new_master.plane @@ -153,72 +156,86 @@ icon_state = "too_much_tox" //End gas alerts +// Hunger alerts -/obj/screen/alert/fat +/obj/screen/alert/hunger + icon = 'icons/mob/screen_hunger.dmi' + +/obj/screen/alert/hunger/fat name = "Fat" desc = "You ate too much food, lardass. Run around the station and lose some weight." icon_state = "fat" -/obj/screen/alert/full +/obj/screen/alert/hunger/full name = "Full" desc = "You feel full and satisfied, but you shouldn't eat much more." icon_state = "full" -/obj/screen/alert/well_fed +/obj/screen/alert/hunger/well_fed name = "Well Fed" desc = "You feel quite satisfied, but you may be able to eat a bit more." icon_state = "well_fed" -/obj/screen/alert/fed +/obj/screen/alert/hunger/fed name = "Fed" desc = "You feel moderately satisfied, but a bit more food may not hurt." icon_state = "fed" -/obj/screen/alert/hungry +/obj/screen/alert/hunger/hungry name = "Hungry" desc = "Some food would be good right about now." icon_state = "hungry" -/obj/screen/alert/starving +/obj/screen/alert/hunger/starving name = "Starving" desc = "You're severely malnourished. The hunger pains make moving around a chore." icon_state = "starving" +/// Machine "hunger" + +/obj/screen/alert/hunger/full/machine + name = "Full Charge" + desc = "Your cell is at full charge. Might want to give APCs some space." + +/obj/screen/alert/hunger/well_fed/machine + name = "High Charge" + desc = "You're almost all charged, but could top up a bit more." + +/obj/screen/alert/hunger/fed/machine + name = "Half Charge" + desc = "You feel moderately charged, but a bit more juice couldn't hurt." + +/obj/screen/alert/hunger/hungry/machine + name = "Low Charge" + desc = "Could use a little charging right about now." + +/obj/screen/alert/hunger/starving/machine + name = "Nearly Discharged" + desc = "You're almost drained. The low power makes moving around a chore." + +// End of Machine "hunger" ///Vampire "hunger" -/obj/screen/alert/fat/vampire - name = "Fat" +/obj/screen/alert/hunger/fat/vampire desc = "You somehow drank too much blood, lardass. Run around the station and lose some weight." - icon_state = "v_fat" -/obj/screen/alert/full/vampire - name = "Full" +/obj/screen/alert/hunger/full/vampire desc = "You feel full and satisfied, but you know you will thirst for more blood soon..." - icon_state = "v_full" -/obj/screen/alert/well_fed/vampire - name = "Well Fed" +/obj/screen/alert/hunger/well_fed/vampire desc = "You feel quite satisfied, but you could do with a bit more blood." - icon_state = "v_well_fed" -/obj/screen/alert/fed/vampire - name = "Fed" +/obj/screen/alert/hunger/fed/vampire desc = "You feel moderately satisfied, but a bit more blood wouldn't hurt." - icon_state = "v_fed" -/obj/screen/alert/hungry/vampire - name = "Hungry" +/obj/screen/alert/hunger/hungry/vampire desc = "You currently thirst for blood." - icon_state = "v_hungry" -/obj/screen/alert/starving/vampire - name = "Starving" +/obj/screen/alert/hunger/starving/vampire desc = "You're severely thirsty. The thirst pains make moving around a chore." - icon_state = "v_starving" //End of Vampire "hunger" - /obj/screen/alert/hot name = "Too Hot" desc = "You're flaming hot! Get somewhere cooler and take off any insulating clothing like a fire suit." diff --git a/code/modules/antagonists/vampire/vamp_datum.dm b/code/modules/antagonists/vampire/vamp_datum.dm index 489ec62f44e..a9efbf2303d 100644 --- a/code/modules/antagonists/vampire/vamp_datum.dm +++ b/code/modules/antagonists/vampire/vamp_datum.dm @@ -95,6 +95,8 @@ var/datum/hud/hud = L.hud_used if(hud?.vampire_blood_display) hud.remove_vampire_hud() + L.dna.species.hunger_type = initial(L.dna.species.hunger_type) + L.dna.species.hunger_icon = initial(L.dna.species.hunger_icon) owner.current.alpha = 255 REMOVE_TRAITS_IN(owner.current, "vampire") return ..() @@ -324,7 +326,9 @@ if(!owner.som) //thralls and mindslaves owner.som = new() owner.som.masters += owner - + var/mob/living/L = new_body || owner.current + L.dna.species.hunger_type = "vampire" + L.dna.species.hunger_icon = 'icons/mob/screen_hunger_vampire.dmi' check_vampire_upgrade(FALSE) /datum/hud/proc/remove_vampire_hud() diff --git a/code/modules/hallucinations/effects/moderate.dm b/code/modules/hallucinations/effects/moderate.dm index 1d2bdf253db..f31b48e7317 100644 --- a/code/modules/hallucinations/effects/moderate.dm +++ b/code/modules/hallucinations/effects/moderate.dm @@ -22,8 +22,8 @@ /obj/screen/alert/too_much_oxy = "too_much_oxy", /obj/screen/alert/too_much_co2 = "too_much_co2", /obj/screen/alert/too_much_tox = "too_much_tox", - /obj/screen/alert/fat = "nutrition", - /obj/screen/alert/starving = "nutrition", + /obj/screen/alert/hunger/fat = "nutrition", + /obj/screen/alert/hunger/starving = "nutrition", /obj/screen/alert/hot = "temp", /obj/screen/alert/cold = "temp", /obj/screen/alert/highpressure = "pressure", diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 2187a20fccc..ed7b641299c 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -790,35 +790,25 @@ /mob/living/carbon/human/proc/handle_nutrition_alerts() //This is a terrible abuse of the alert system; something like this should be a HUD element if(HAS_TRAIT(src, TRAIT_NOHUNGER)) return - if(mind?.has_antag_datum(/datum/antagonist/vampire)) //Vampires - switch(nutrition) - if(NUTRITION_LEVEL_FULL to INFINITY) - throw_alert("nutrition", /obj/screen/alert/fat/vampire) - if(NUTRITION_LEVEL_WELL_FED to NUTRITION_LEVEL_FULL) - throw_alert("nutrition", /obj/screen/alert/full/vampire) - if(NUTRITION_LEVEL_FED to NUTRITION_LEVEL_WELL_FED) - throw_alert("nutrition", /obj/screen/alert/well_fed/vampire) - if(NUTRITION_LEVEL_HUNGRY to NUTRITION_LEVEL_FED) - throw_alert("nutrition", /obj/screen/alert/fed/vampire) - if(NUTRITION_LEVEL_STARVING to NUTRITION_LEVEL_HUNGRY) - throw_alert("nutrition", /obj/screen/alert/hungry/vampire) - else - throw_alert("nutrition", /obj/screen/alert/starving/vampire) - - else //Any other non-vampires - switch(nutrition) - if(NUTRITION_LEVEL_FULL to INFINITY) - throw_alert("nutrition", /obj/screen/alert/fat) - if(NUTRITION_LEVEL_WELL_FED to NUTRITION_LEVEL_FULL) - throw_alert("nutrition", /obj/screen/alert/full) - if(NUTRITION_LEVEL_FED to NUTRITION_LEVEL_WELL_FED) - throw_alert("nutrition", /obj/screen/alert/well_fed) - if(NUTRITION_LEVEL_HUNGRY to NUTRITION_LEVEL_FED) - throw_alert("nutrition", /obj/screen/alert/fed) - if(NUTRITION_LEVEL_STARVING to NUTRITION_LEVEL_HUNGRY) - throw_alert("nutrition", /obj/screen/alert/hungry) - else - throw_alert("nutrition", /obj/screen/alert/starving) + var/new_hunger + switch(nutrition) + if(NUTRITION_LEVEL_FULL to INFINITY) + new_hunger = "fat" + if(NUTRITION_LEVEL_WELL_FED to NUTRITION_LEVEL_FULL) + new_hunger = "full" + if(NUTRITION_LEVEL_FED to NUTRITION_LEVEL_WELL_FED) + new_hunger = "well_fed" + if(NUTRITION_LEVEL_HUNGRY to NUTRITION_LEVEL_FED) + new_hunger = "fed" + if(NUTRITION_LEVEL_STARVING to NUTRITION_LEVEL_HUNGRY) + new_hunger = "hungry" + else + new_hunger = "starving" + if(dna.species.hunger_type) + new_hunger += "/[dna.species.hunger_type]" + if(dna.species.hunger_level != new_hunger) + dna.species.hunger_level = new_hunger + throw_alert("nutrition", "/obj/screen/alert/hunger/[new_hunger]", icon_override = dna.species.hunger_icon) /mob/living/carbon/human/handle_random_events() // Puke if toxloss is too high diff --git a/code/modules/mob/living/carbon/human/species/_species.dm b/code/modules/mob/living/carbon/human/species/_species.dm index d61337edda8..11c4302fa41 100644 --- a/code/modules/mob/living/carbon/human/species/_species.dm +++ b/code/modules/mob/living/carbon/human/species/_species.dm @@ -36,6 +36,9 @@ var/hunger_drain = HUNGER_FACTOR var/digestion_ratio = 1 //How quickly the species digests/absorbs reagents. var/taste_sensitivity = TASTE_SENSITIVITY_NORMAL //the most widely used factor; humans use a different one + var/hunger_icon = 'icons/mob/screen_hunger.dmi' + var/hunger_type + var/hunger_level var/siemens_coeff = 1 //base electrocution coefficient diff --git a/code/modules/mob/living/carbon/human/species/machine.dm b/code/modules/mob/living/carbon/human/species/machine.dm index 43c0931f96b..171d8c033f1 100644 --- a/code/modules/mob/living/carbon/human/species/machine.dm +++ b/code/modules/mob/living/carbon/human/species/machine.dm @@ -45,6 +45,9 @@ female_sneeze_sound = 'sound/effects/mob_effects/f_machine_sneeze.ogg' butt_sprite = "machine" + hunger_icon = 'icons/mob/screen_hunger_machine.dmi' + hunger_type = "machine" + has_organ = list( "brain" = /obj/item/organ/internal/brain/mmi_holder/posibrain, "cell" = /obj/item/organ/internal/cell, diff --git a/icons/mob/screen_alert.dmi b/icons/mob/screen_alert.dmi index 38fc4ffaf89..70c3fdf8ee3 100644 Binary files a/icons/mob/screen_alert.dmi and b/icons/mob/screen_alert.dmi differ diff --git a/icons/mob/screen_hunger.dmi b/icons/mob/screen_hunger.dmi new file mode 100644 index 00000000000..d8fe982df1d Binary files /dev/null and b/icons/mob/screen_hunger.dmi differ diff --git a/icons/mob/screen_hunger_machine.dmi b/icons/mob/screen_hunger_machine.dmi new file mode 100644 index 00000000000..700cb723bd0 Binary files /dev/null and b/icons/mob/screen_hunger_machine.dmi differ diff --git a/icons/mob/screen_hunger_vampire.dmi b/icons/mob/screen_hunger_vampire.dmi new file mode 100644 index 00000000000..64743affb2d Binary files /dev/null and b/icons/mob/screen_hunger_vampire.dmi differ