From 47a26dab13f7599a7b488643868566182669507e Mon Sep 17 00:00:00 2001 From: XDTM Date: Sat, 22 Apr 2017 21:20:01 +0200 Subject: [PATCH 1/4] Fixes some facehugger bugs --- .../living/carbon/alien/special/facehugger.dm | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/code/modules/mob/living/carbon/alien/special/facehugger.dm b/code/modules/mob/living/carbon/alien/special/facehugger.dm index 3a039d84dd6..d0e5bd03ce4 100644 --- a/code/modules/mob/living/carbon/alien/special/facehugger.dm +++ b/code/modules/mob/living/carbon/alien/special/facehugger.dm @@ -49,14 +49,14 @@ /obj/item/clothing/mask/facehugger/attack_hand(mob/user) if((stat == CONSCIOUS && !sterile) && !isalien(user)) - if(Attach(user)) + if(Leap(user)) return ..() /obj/item/clothing/mask/facehugger/attack(mob/living/M, mob/user) ..() - if(user.temporarilyRemoveItemFromInventory(src)) - Attach(M) + if(user.transferItemToLoc(src, get_turf(M))) + Leap(M) /obj/item/clothing/mask/facehugger/examine(mob/user) ..() @@ -98,7 +98,7 @@ /obj/item/clothing/mask/facehugger/HasProximity(atom/movable/AM as mob|obj) if(CanHug(AM) && Adjacent(AM)) - return Attach(AM) + return Leap(AM) return 0 /obj/item/clothing/mask/facehugger/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback) @@ -116,7 +116,7 @@ ..() if(stat == CONSCIOUS) icon_state = "[initial(icon_state)]" - Attach(hit_atom) + Leap(hit_atom) /obj/item/clothing/mask/facehugger/proc/valid_to_attach(mob/living/M) // valid targets: corgis, carbons except aliens and devils @@ -144,9 +144,13 @@ // corgi: valid return TRUE -/obj/item/clothing/mask/facehugger/proc/Attach(mob/living/M) +/obj/item/clothing/mask/facehugger/proc/Leap(mob/living/M) if(!valid_to_attach(M)) return FALSE + if(iscarbon(M)) + var/mob/living/carbon/target = M + if(target.wear_mask && istype(target.wear_mask, /obj/item/clothing/mask/facehugger)) + return FALSE // passed initial checks - time to leap! M.visible_message("[src] leaps at [M]'s face!", \ "[src] leaps at [M]'s face!") @@ -165,11 +169,15 @@ if(target.wear_mask) var/obj/item/clothing/W = target.wear_mask - if(!istype(W,/obj/item/clothing/mask/facehugger) && target.dropItemToGround(W)) + if(target.dropItemToGround(W)) target.visible_message("[src] tears [W] off of [target]'s face!", \ "[src] tears [W] off of [target]'s face!") - forceMove(target) target.equip_to_slot_if_possible(src, slot_wear_mask, 0, 1, 1) + return TRUE // time for a smoke + +/obj/item/clothing/mask/facehugger/proc/Attach(mob/living/M) + if(!valid_to_attach(M)) + return // early returns and validity checks done: attach. attached++ //ensure we detach once we no longer need to be attached @@ -189,8 +197,6 @@ addtimer(CALLBACK(src, .proc/Impregnate, M), rand(MIN_IMPREGNATION_TIME, MAX_IMPREGNATION_TIME)) - return TRUE // time for a smoke - /obj/item/clothing/mask/facehugger/proc/detach() attached = 0 From e996dbda9c4e05be88e530c2059051749d1ab1cf Mon Sep 17 00:00:00 2001 From: XDTM Date: Sat, 22 Apr 2017 22:13:59 +0200 Subject: [PATCH 2/4] Damage for huggers --- .../living/carbon/alien/special/facehugger.dm | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/code/modules/mob/living/carbon/alien/special/facehugger.dm b/code/modules/mob/living/carbon/alien/special/facehugger.dm index d0e5bd03ce4..cfea7039c00 100644 --- a/code/modules/mob/living/carbon/alien/special/facehugger.dm +++ b/code/modules/mob/living/carbon/alien/special/facehugger.dm @@ -20,6 +20,8 @@ tint = 3 flags_cover = MASKCOVERSEYES | MASKCOVERSMOUTH layer = MOB_LAYER + obj_integrity = 100 + max_integrity = 100 var/stat = CONSCIOUS //UNCONSCIOUS is the idle state in this case @@ -43,6 +45,11 @@ item_state = "facehugger_impregnated" stat = DEAD +/obj/item/clothing/mask/facehugger/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir) + ..() + if(integrity < 90) + Die() + /obj/item/clothing/mask/facehugger/attack_alien(mob/user) //can be picked up by aliens attack_hand(user) return @@ -70,19 +77,10 @@ if (sterile) to_chat(user, "It looks like the proboscis has been removed.") -/obj/item/clothing/mask/facehugger/attackby(obj/item/O,mob/m, params) - if(O.force) - Die() - return - -/obj/item/clothing/mask/facehugger/bullet_act(obj/item/projectile/P) - if(P.damage) - Die() /obj/item/clothing/mask/facehugger/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) if(exposed_temperature > 300) Die() - return /obj/item/clothing/mask/facehugger/equipped(mob/M) Attach(M) From 7daa26a74877cec357bc38deac4f9b34a1c90624 Mon Sep 17 00:00:00 2001 From: XDTM Date: Sat, 22 Apr 2017 22:34:00 +0200 Subject: [PATCH 3/4] hurt them --- code/modules/mob/living/carbon/alien/special/facehugger.dm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/alien/special/facehugger.dm b/code/modules/mob/living/carbon/alien/special/facehugger.dm index cfea7039c00..25f43685d8a 100644 --- a/code/modules/mob/living/carbon/alien/special/facehugger.dm +++ b/code/modules/mob/living/carbon/alien/special/facehugger.dm @@ -47,9 +47,12 @@ /obj/item/clothing/mask/facehugger/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir) ..() - if(integrity < 90) + if(obj_integrity < 90) Die() +/obj/item/clothing/mask/facehugger/attackby(obj/item/O,mob/m, params) + return O.attack_obj(src, user) + /obj/item/clothing/mask/facehugger/attack_alien(mob/user) //can be picked up by aliens attack_hand(user) return From afbb0a45e8ce92ae63d6340a7794ddc36efadfe1 Mon Sep 17 00:00:00 2001 From: XDTM Date: Sat, 22 Apr 2017 22:41:06 +0200 Subject: [PATCH 4/4] ree --- code/modules/mob/living/carbon/alien/special/facehugger.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/alien/special/facehugger.dm b/code/modules/mob/living/carbon/alien/special/facehugger.dm index 25f43685d8a..af6bc971114 100644 --- a/code/modules/mob/living/carbon/alien/special/facehugger.dm +++ b/code/modules/mob/living/carbon/alien/special/facehugger.dm @@ -50,7 +50,7 @@ if(obj_integrity < 90) Die() -/obj/item/clothing/mask/facehugger/attackby(obj/item/O,mob/m, params) +/obj/item/clothing/mask/facehugger/attackby(obj/item/O, mob/user, params) return O.attack_obj(src, user) /obj/item/clothing/mask/facehugger/attack_alien(mob/user) //can be picked up by aliens