mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 15:17:01 +01:00
[MIRROR] Fixes moths infinitely eating most clothing (#7914)
* Fixes moths infinitely eating most clothing * Fixing merge conflict Co-authored-by: ArcaneDefence <51932756+ArcaneDefence@users.noreply.github.com> Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>
This commit is contained in:
co-authored by
ArcaneDefence
GoldenAlpharex
parent
6b43ac04de
commit
17fafd4e81
@@ -41,6 +41,8 @@
|
||||
#define MAGIC "magic"
|
||||
/// Involved in checking the likelyhood of applying a wound to a mob.
|
||||
#define WOUND "wound"
|
||||
/// Involves being eaten
|
||||
#define CONSUME "consume"
|
||||
|
||||
//bitflag damage defines used for suicide_act
|
||||
#define BRUTELOSS (1<<0)
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
var/acid
|
||||
var/magic
|
||||
var/wound
|
||||
var/consume
|
||||
|
||||
/datum/armor/New(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 0, acid = 0, magic = 0, wound = 0)
|
||||
src.melee = melee
|
||||
@@ -31,6 +32,7 @@
|
||||
src.acid = acid
|
||||
src.magic = magic
|
||||
src.wound = wound
|
||||
src.consume = melee
|
||||
tag = ARMORID
|
||||
|
||||
/datum/armor/proc/modifyRating(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 0, acid = 0, magic = 0, wound = 0)
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
/obj/item/food/clothing/proc/after_eat(mob/eater)
|
||||
var/obj/item/clothing/resolved_clothing = clothing.resolve()
|
||||
if (resolved_clothing)
|
||||
resolved_clothing.take_damage(MOTH_EATING_CLOTHING_DAMAGE, sound_effect = FALSE)
|
||||
resolved_clothing.take_damage(MOTH_EATING_CLOTHING_DAMAGE, sound_effect = FALSE, damage_flag = CONSUME)
|
||||
else
|
||||
qdel(src)
|
||||
|
||||
@@ -495,6 +495,13 @@ BLIND // can't see anything
|
||||
//so the shred survives potential turf change from the explosion.
|
||||
addtimer(CALLBACK_NEW(/obj/effect/decal/cleanable/shreds, list(T, name)), 1)
|
||||
deconstruct(FALSE)
|
||||
if(damage_flag == CONSUME) //This allows for moths to fully consume clothing, rather than damaging it like other sources like brute
|
||||
var/turf/current_position = get_turf(src)
|
||||
new /obj/effect/decal/cleanable/shreds(current_position, name)
|
||||
if(isliving(loc))
|
||||
var/mob/living/possessing_mob = loc
|
||||
possessing_mob.visible_message(span_danger("[src] is consumed until naught but shreds remains!"), span_boldwarning("[src] falls apart into little bits!"))
|
||||
deconstruct(FALSE)
|
||||
//SKYRAT EDIT CHANGE BEGIN
|
||||
//else if(!(damage_flag in list(ACID, FIRE))) - SKYRAT EDIT - ORIGINAL
|
||||
else if(!(damage_flag in list(ACID)))
|
||||
@@ -504,7 +511,7 @@ BLIND // can't see anything
|
||||
update_clothes_damaged_state(CLOTHING_SHREDDED)
|
||||
if(isliving(loc))
|
||||
var/mob/living/M = loc
|
||||
if(src in M.get_equipped_items(FALSE)) //make sure they were wearing it and not attacking the item in their hands / eating it if they were a moth.
|
||||
if(src in M.get_equipped_items(FALSE)) //make sure they were wearing it and not attacking the item in their hands
|
||||
M.visible_message(span_danger("[M]'s [src.name] fall[p_s()] off, [p_theyre()] completely shredded!"), span_warning("<b>Your [src.name] fall[p_s()] off, [p_theyre()] completely shredded!</b>"), vision_distance = COMBAT_MESSAGE_RANGE)
|
||||
M.dropItemToGround(src)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user