diff --git a/code/modules/mob/living/simple_animal/friendly/carp.dm b/code/modules/mob/living/simple_animal/friendly/carp.dm index ea669271567..b0d5b723b40 100644 --- a/code/modules/mob/living/simple_animal/friendly/carp.dm +++ b/code/modules/mob/living/simple_animal/friendly/carp.dm @@ -21,6 +21,7 @@ response_help = "brushes" response_disarm = "attempts to push" response_harm = "injures" + blood_overlay_icon = 'icons/mob/npc/blood_overlay_carp.dmi' gender = NEUTER faction = "carp" flying = TRUE @@ -50,6 +51,14 @@ possession_candidate = TRUE +/mob/living/simple_animal/carp/update_icon() + ..() + if(resting || stat == DEAD) + blood_overlay_icon = 'icons/mob/npc/blood_overlay.dmi' + else + blood_overlay_icon = initial(blood_overlay_icon) + handle_blood_overlay(TRUE) + /mob/living/simple_animal/carp/fall_impact() src.visible_message(SPAN_NOTICE("\The [src] gently floats to a stop.")) return FALSE diff --git a/code/modules/mob/living/simple_animal/hostile/carp.dm b/code/modules/mob/living/simple_animal/hostile/carp.dm index 6c4358062c5..eae113d0fe7 100644 --- a/code/modules/mob/living/simple_animal/hostile/carp.dm +++ b/code/modules/mob/living/simple_animal/hostile/carp.dm @@ -20,6 +20,7 @@ health = 25 mob_size = 10 + blood_overlay_icon = 'icons/mob/npc/blood_overlay_carp.dmi' harm_intent_damage = 8 melee_damage_lower = 15 melee_damage_upper = 15 @@ -46,6 +47,14 @@ see_in_dark = 8 see_invisible = SEE_INVISIBLE_NOLIGHTING +/mob/living/simple_animal/hostile/carp/update_icon() + ..() + if(resting || stat == DEAD) + blood_overlay_icon = 'icons/mob/npc/blood_overlay.dmi' + else + blood_overlay_icon = initial(blood_overlay_icon) + handle_blood_overlay(TRUE) + /mob/living/simple_animal/hostile/carp/Allow_Spacemove(var/check_drift = 0) return 1 //No drifting in space for space carp! //original comments do not steal diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm index 4ad5377b219..b6cb5506849 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -21,6 +21,7 @@ response_help = "pets" response_disarm = "gently pushes aside" response_harm = "pokes" + blood_overlay_icon = null stop_automated_movement_when_pulled = 0 maxHealth = 200 health = 200 diff --git a/code/modules/mob/living/simple_animal/hostile/hivebot.dm b/code/modules/mob/living/simple_animal/hostile/hivebot.dm index 8f5ac470cd5..50da1d7a402 100644 --- a/code/modules/mob/living/simple_animal/hostile/hivebot.dm +++ b/code/modules/mob/living/simple_animal/hostile/hivebot.dm @@ -14,6 +14,7 @@ icon = 'icons/mob/npc/hivebot.dmi' icon_state = "hivebot" blood_type = "#000000" + blood_overlay_icon = 'icons/mob/npc/blood_overlay_hivebot.dmi' health = 15 maxHealth = 15 harm_intent_damage = 3 @@ -48,6 +49,20 @@ /mob/living/simple_animal/hostile/hivebot/get_bullet_impact_effect_type(var/def_zone) return BULLET_IMPACT_METAL +/mob/living/simple_animal/hostile/hivebot/update_icon() + ..() + if(resting || stat == DEAD) + blood_overlay_icon = 'icons/mob/npc/blood_overlay.dmi' + else + blood_overlay_icon = initial(blood_overlay_icon) + handle_blood_overlay(TRUE) + +/mob/living/simple_animal/hostile/hivebot/get_blood_overlay_name() + if(stance == HOSTILE_STANCE_IDLE) + return "blood_overlay" + else + return "blood_overlay_armed" + /mob/living/simple_animal/hostile/hivebot/guardian health = 80 maxHealth = 45 @@ -227,6 +242,7 @@ icon_living = "hivebotbeacon_active" health = 300 maxHealth = 300 + blood_type = "#000000" projectilesound = 'sound/weapons/taser2.ogg' projectiletype = /obj/item/projectile/beam/hivebot wander = 0 @@ -505,6 +521,8 @@ icon_state = "hivebotharvester" health = 100 maxHealth = 100 + blood_type = "#000000" + blood_overlay_icon = 'icons/mob/npc/blood_overlay_hivebot.dmi' harm_intent_damage = 3 melee_damage_lower = 30 melee_damage_upper = 30 @@ -722,6 +740,11 @@ icon_state = "hivebotharvester_ripping" else icon_state = "hivebotharvester" + if(resting || stat == DEAD || busy) + blood_overlay_icon = 'icons/mob/npc/blood_overlay.dmi' + else + blood_overlay_icon = initial(blood_overlay_icon) + handle_blood_overlay(TRUE) /mob/living/simple_animal/hostile/retaliate/hivebotharvester/proc/prospect() diff --git a/code/modules/mob/living/simple_animal/hostile/icarus_drone.dm b/code/modules/mob/living/simple_animal/hostile/icarus_drone.dm index f06add5efab..3c3c95844ab 100644 --- a/code/modules/mob/living/simple_animal/hostile/icarus_drone.dm +++ b/code/modules/mob/living/simple_animal/hostile/icarus_drone.dm @@ -19,6 +19,7 @@ stop_automated_movement_when_pulled = FALSE health = 300 maxHealth = 300 + blood_type = "#000000" speed = 8 projectiletype = /obj/item/projectile/beam/drone projectilesound = 'sound/weapons/laser3.ogg' diff --git a/code/modules/mob/living/simple_animal/hostile/moghesfauna.dm b/code/modules/mob/living/simple_animal/hostile/moghesfauna.dm index 74d5cbe08a2..6bfc4f648cb 100644 --- a/code/modules/mob/living/simple_animal/hostile/moghesfauna.dm +++ b/code/modules/mob/living/simple_animal/hostile/moghesfauna.dm @@ -16,6 +16,7 @@ response_help = "pets" response_disarm = "shoves" response_harm = "harmlessly punches" + blood_overlay_icon = null maxHealth = 450 health = 450 harm_intent_damage = 0 diff --git a/code/modules/mob/living/simple_animal/hostile/morph.dm b/code/modules/mob/living/simple_animal/hostile/morph.dm index 928dd5bc8d7..dbf72fef369 100644 --- a/code/modules/mob/living/simple_animal/hostile/morph.dm +++ b/code/modules/mob/living/simple_animal/hostile/morph.dm @@ -48,6 +48,7 @@ attacktext = "glomped" attack_sound = 'sound/effects/blobattack.ogg' + blood_overlay_icon = null var/morphed = FALSE var/melee_damage_disguised = 0 diff --git a/code/modules/mob/living/simple_animal/hostile/pra.dm b/code/modules/mob/living/simple_animal/hostile/pra.dm index 3841f4fab30..9f6269b58e0 100644 --- a/code/modules/mob/living/simple_animal/hostile/pra.dm +++ b/code/modules/mob/living/simple_animal/hostile/pra.dm @@ -9,6 +9,7 @@ icon_state = "republicon" icon_living = "republicon" icon_dead = "republicon_dead" + blood_type = "#000000" speak_chance = 5 turns_per_move = 3 organ_names = list("chest", "lower body", "left arm", "right arm", "left leg", "right leg", "head") diff --git a/code/modules/mob/living/simple_animal/hostile/spider_queen.dm b/code/modules/mob/living/simple_animal/hostile/spider_queen.dm index 12c95b0ab39..26c7fa8cb6a 100644 --- a/code/modules/mob/living/simple_animal/hostile/spider_queen.dm +++ b/code/modules/mob/living/simple_animal/hostile/spider_queen.dm @@ -16,6 +16,7 @@ response_help = "pets" response_disarm = "gently pushes aside" response_harm = "pokes" + blood_overlay_icon = null stop_automated_movement_when_pulled = 0 maxHealth = 700 health = 700 diff --git a/code/modules/mob/living/simple_animal/hostile/tree.dm b/code/modules/mob/living/simple_animal/hostile/tree.dm index 583ec3029dd..91b9dbbe44e 100644 --- a/code/modules/mob/living/simple_animal/hostile/tree.dm +++ b/code/modules/mob/living/simple_animal/hostile/tree.dm @@ -13,6 +13,7 @@ response_help = "brushes" response_disarm = "pushes" response_harm = "hits" + blood_overlay_icon = null speed = -1 maxHealth = 250 health = 250 diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index d028cd278c5..cce6bb30fe3 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -1,3 +1,9 @@ +#define BLOOD_NONE "none" +#define BLOOD_LIGHT "light" +#define BLOOD_MEDIUM "medium" +#define BLOOD_HEAVY "heavy" + + /mob/living/simple_animal name = "animal" icon = 'icons/mob/npc/animal.dmi' @@ -13,7 +19,12 @@ var/icon_living = "" var/icon_dead = "" var/icon_gib = null //We only try to show a gibbing animation if this exists. + + appearance_flags = KEEP_TOGETHER var/blood_type = "#A10808" //Blood colour for impact visuals. + var/blood_overlay_icon = 'icons/mob/npc/blood_overlay.dmi' + var/blood_state = BLOOD_NONE + var/image/blood_overlay var/list/speak = list() var/speak_chance = 0 @@ -180,6 +191,7 @@ if(health > maxHealth) health = maxHealth + handle_blood_overlay() handle_stunned() handle_weakened() handle_paralysed() @@ -303,6 +315,34 @@ if(purge) purge -= 1 +/mob/living/simple_animal/proc/handle_blood_overlay(var/force_reset = FALSE) + if(!blood_overlay_icon) + return + + var/current_blood_state = blood_state + var/blood_mod = health / maxHealth + if(blood_mod > 0.9) + blood_state = BLOOD_NONE + else if(blood_mod >= 0.7) + blood_state = BLOOD_LIGHT + else if(blood_mod >= 0.4) + blood_state = BLOOD_MEDIUM + else + blood_state = BLOOD_HEAVY + + if(force_reset || (blood_state != BLOOD_NONE && current_blood_state != blood_state)) + if(blood_overlay) + cut_overlay(blood_overlay) + var/blood_overlay_name = get_blood_overlay_name() + var/image/I = image(blood_overlay_icon, src, "[blood_overlay_name]-[blood_state]") + I.color = blood_type + I.blend_mode = BLEND_INSET_OVERLAY + blood_overlay = I + add_overlay(blood_overlay) + +/mob/living/simple_animal/proc/get_blood_overlay_name() + return "blood_overlay" + /mob/living/simple_animal/proc/handle_eating() var/list/food_choices = list() for(var/obj/item/reagent_containers/food/snacks/S in get_turf(src)) @@ -488,6 +528,9 @@ mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj) visible_message(SPAN_DANGER("\The [src] has been attacked with \the [O] by \the [user].")) user.do_attack_animation(src) +/mob/living/simple_animal/apply_damage(damage, damagetype, def_zone, blocked, used_weapon, damage_flags) + . = ..() + handle_blood_overlay() /mob/living/simple_animal/movement_delay() var/tally = 0 //Incase I need to add stuff other than "speed" later @@ -532,11 +575,11 @@ mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj) /mob/living/simple_animal/death(gibbed, deathmessage = "dies!") walk_to(src,0) movement_target = null - icon_state = icon_dead - density = 0 + density = FALSE if (isopenturf(loc)) ADD_FALLING_ATOM(src) - return ..(gibbed,deathmessage) + . = ..(gibbed, deathmessage) + update_icon() /mob/living/simple_animal/ex_act(severity) if(!blinded) @@ -766,3 +809,8 @@ mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj) return /obj/effect/gibspawner/robot else return /obj/effect/gibspawner/generic + +#undef BLOOD_NONE +#undef BLOOD_LIGHT +#undef BLOOD_MEDIUM +#undef BLOOD_HEAVY \ No newline at end of file diff --git a/html/changelogs/geeves-blood_overlay.yml b/html/changelogs/geeves-blood_overlay.yml new file mode 100644 index 00000000000..b0b8dbe2e5a --- /dev/null +++ b/html/changelogs/geeves-blood_overlay.yml @@ -0,0 +1,6 @@ +author: Geeves + +delete-after: True + +changes: + - rscadd: "Added blood overlays to simple mobs." \ No newline at end of file diff --git a/icons/mob/npc/blood_overlay.dmi b/icons/mob/npc/blood_overlay.dmi new file mode 100644 index 00000000000..6c8cf088cc0 Binary files /dev/null and b/icons/mob/npc/blood_overlay.dmi differ diff --git a/icons/mob/npc/blood_overlay_carp.dmi b/icons/mob/npc/blood_overlay_carp.dmi new file mode 100644 index 00000000000..1f2afb1b7db Binary files /dev/null and b/icons/mob/npc/blood_overlay_carp.dmi differ diff --git a/icons/mob/npc/blood_overlay_hivebot.dmi b/icons/mob/npc/blood_overlay_hivebot.dmi new file mode 100644 index 00000000000..f3f795dc56e Binary files /dev/null and b/icons/mob/npc/blood_overlay_hivebot.dmi differ