mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-14 00:23:29 +01:00
Merge pull request #3851 from Fox-McCloud/xeno-fixes
Facehugger and Embryo Fixes
This commit is contained in:
@@ -653,13 +653,14 @@
|
||||
/**********************Facehugger toy**********************/
|
||||
|
||||
/obj/item/clothing/mask/facehugger/toy
|
||||
item_state = "facehugger_inactive"
|
||||
desc = "A toy often used to play pranks on other miners by putting it in their beds. It takes a bit to recharge after latching onto something."
|
||||
throwforce = 0
|
||||
real = 0
|
||||
sterile = 1
|
||||
tint = 3 //Makes it feel more authentic when it latches on
|
||||
|
||||
/obj/item/clothing/mask/facehugger/toy/death()
|
||||
/obj/item/clothing/mask/facehugger/toy/Die()
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -3,11 +3,9 @@
|
||||
|
||||
/obj/item/organ/internal/body_egg/alien_embryo
|
||||
name = "alien embryo"
|
||||
desc = "All slimy and yuck."
|
||||
icon = 'icons/mob/alien.dmi'
|
||||
icon_state = "larva0_dead"
|
||||
var/stage = 0
|
||||
var/growing = 0
|
||||
|
||||
/obj/item/organ/internal/body_egg/alien_embryo/on_find(mob/living/finder)
|
||||
..()
|
||||
@@ -58,13 +56,17 @@
|
||||
RefreshInfectionImage()
|
||||
|
||||
if(stage == 5 && prob(50))
|
||||
for(var/datum/surgery/S in owner.surgeries)
|
||||
if(S.location == "chest" && istype(S.get_surgery_step(), /datum/surgery_step/internal/manipulate_organs))
|
||||
AttemptGrow(0)
|
||||
return
|
||||
AttemptGrow()
|
||||
|
||||
/obj/item/organ/internal/body_egg/alien_embryo/proc/AttemptGrow(var/gib_on_success = 1)
|
||||
if(growing)
|
||||
return
|
||||
growing = 1
|
||||
|
||||
|
||||
/obj/item/organ/internal/body_egg/alien_embryo/proc/AttemptGrow(var/gib_on_success = 1)
|
||||
if(!owner)
|
||||
return
|
||||
spawn()
|
||||
var/list/candidates = pollCandidates("Do you want to play as an alien?", ROLE_ALIEN, 0)
|
||||
var/mob/C = null
|
||||
@@ -77,15 +79,14 @@
|
||||
if(candidates.len)
|
||||
C = pick(candidates)
|
||||
else if(owner.client)
|
||||
C = owner
|
||||
C = owner.client
|
||||
else
|
||||
stage = 4 // Let's try again later.
|
||||
return
|
||||
|
||||
if(owner.lying)
|
||||
owner.overlays += image('icons/mob/alien.dmi', loc = owner, icon_state = "burst_lie")
|
||||
else
|
||||
owner.overlays += image('icons/mob/alien.dmi', loc = owner, icon_state = "burst_stand")
|
||||
var/overlay = image('icons/mob/alien.dmi', loc = owner, icon_state = "burst_lie")
|
||||
owner.overlays += overlay
|
||||
|
||||
spawn(6)
|
||||
var/mob/living/carbon/alien/larva/new_xeno = new(owner.loc)
|
||||
new_xeno.key = C.key
|
||||
@@ -97,19 +98,11 @@
|
||||
new_xeno << sound('sound/voice/hiss5.ogg',0,0,0,100) //To get the player's attention
|
||||
if(gib_on_success)
|
||||
owner.gib()
|
||||
if(istype(new_xeno.loc,/mob/living/carbon))
|
||||
var/mob/living/carbon/digester = new_xeno.loc
|
||||
digester.stomach_contents += new_xeno
|
||||
else
|
||||
owner.adjustBruteLoss(40)
|
||||
owner.overlays -= overlay
|
||||
qdel(src)
|
||||
|
||||
/*----------------------------------------
|
||||
Proc: RefreshInfectionImage()
|
||||
Des: Removes the current icons located in the infected mob adds the current stage
|
||||
----------------------------------------*/
|
||||
/obj/item/organ/internal/body_egg/alien_embryo/RefreshInfectionImage()
|
||||
RemoveInfectionImages()
|
||||
AddInfectionImages()
|
||||
|
||||
/*----------------------------------------
|
||||
Proc: AddInfectionImages(C)
|
||||
Des: Adds the infection image to all aliens for this embryo
|
||||
|
||||
@@ -15,8 +15,10 @@ var/const/MAX_ACTIVE_TIME = 400
|
||||
icon_state = "facehugger"
|
||||
item_state = "facehugger"
|
||||
w_class = 1 //note: can be picked up by aliens unlike most other items of w_class below 4
|
||||
flags = MASKCOVERSMOUTH | MASKCOVERSEYES | AIRTIGHT
|
||||
throw_range = 5
|
||||
tint = 3
|
||||
flags = MASKCOVERSMOUTH | MASKCOVERSEYES | AIRTIGHT
|
||||
layer = MOB_LAYER
|
||||
|
||||
var/stat = CONSCIOUS //UNCONSCIOUS is the idle state in this case
|
||||
|
||||
@@ -26,19 +28,17 @@ var/const/MAX_ACTIVE_TIME = 400
|
||||
|
||||
var/attached = 0
|
||||
|
||||
/obj/item/clothing/mask/facehugger/attack_alien(user as mob) //can be picked up by aliens
|
||||
/obj/item/clothing/mask/facehugger/attack_alien(mob/user) //can be picked up by aliens
|
||||
attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/item/clothing/mask/facehugger/attack_hand(user as mob)
|
||||
/obj/item/clothing/mask/facehugger/attack_hand(mob/user)
|
||||
if((stat == CONSCIOUS && !sterile) && !isalien(user))
|
||||
Attach(user)
|
||||
return
|
||||
else
|
||||
..()
|
||||
return
|
||||
if(Attach(user))
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/clothing/mask/facehugger/attack(mob/living/M as mob, mob/user as mob)
|
||||
/obj/item/clothing/mask/facehugger/attack(mob/living/M, mob/user)
|
||||
..()
|
||||
user.unEquip(src)
|
||||
Attach(M)
|
||||
@@ -49,25 +49,25 @@ var/const/MAX_ACTIVE_TIME = 400
|
||||
return
|
||||
switch(stat)
|
||||
if(DEAD,UNCONSCIOUS)
|
||||
user << "<span class='userdanger'>[src] is not moving.</span>"
|
||||
user << "<span class='boldannounce'>[src] is not moving.</span>"
|
||||
if(CONSCIOUS)
|
||||
user << "<span class='userdanger'>[src] seems to be active!</span>"
|
||||
user << "<span class='boldannounce'>[src] seems to be active!</span>"
|
||||
if (sterile)
|
||||
user << "<span class='userdanger'>It looks like the proboscis has been removed.</span>"
|
||||
user << "<span class='boldannounce'>It looks like the proboscis has been removed.</span>"
|
||||
|
||||
/obj/item/clothing/mask/facehugger/attackby(var/obj/item/O,var/mob/m, params)
|
||||
/obj/item/clothing/mask/facehugger/attackby(obj/item/O,mob/m, params)
|
||||
if(O.force)
|
||||
death()
|
||||
Die()
|
||||
return
|
||||
|
||||
/obj/item/clothing/mask/facehugger/bullet_act(var/obj/item/projectile/P)
|
||||
/obj/item/clothing/mask/facehugger/bullet_act(obj/item/projectile/P)
|
||||
if(P.damage)
|
||||
death()
|
||||
Die()
|
||||
return
|
||||
|
||||
/obj/item/clothing/mask/facehugger/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
if(exposed_temperature > 300)
|
||||
death()
|
||||
Die()
|
||||
return
|
||||
|
||||
/obj/item/clothing/mask/facehugger/equipped(mob/M)
|
||||
@@ -77,13 +77,13 @@ var/const/MAX_ACTIVE_TIME = 400
|
||||
HasProximity(target)
|
||||
return
|
||||
|
||||
/obj/item/clothing/mask/facehugger/on_found(mob/finder as mob)
|
||||
/obj/item/clothing/mask/facehugger/on_found(mob/finder)
|
||||
if(stat == CONSCIOUS)
|
||||
return HasProximity(finder)
|
||||
return 0
|
||||
|
||||
/obj/item/clothing/mask/facehugger/HasProximity(atom/movable/AM as mob|obj)
|
||||
if(CanHug(AM))
|
||||
if(CanHug(AM) && Adjacent(AM))
|
||||
return Attach(AM)
|
||||
return 0
|
||||
|
||||
@@ -102,10 +102,10 @@ var/const/MAX_ACTIVE_TIME = 400
|
||||
icon_state = "[initial(icon_state)]"
|
||||
Attach(hit_atom)
|
||||
|
||||
/obj/item/clothing/mask/facehugger/proc/Attach(mob/living/M as mob)
|
||||
/obj/item/clothing/mask/facehugger/proc/Attach(mob/living/M)
|
||||
if(!isliving(M))
|
||||
return 0
|
||||
if( (!iscorgi(M) && !iscarbon(M)) || isalien(M))
|
||||
if((!iscorgi(M) && !iscarbon(M)) || isalien(M))
|
||||
return 0
|
||||
if(attached)
|
||||
return 0
|
||||
@@ -113,25 +113,24 @@ var/const/MAX_ACTIVE_TIME = 400
|
||||
attached++
|
||||
spawn(MAX_IMPREGNATION_TIME)
|
||||
attached = 0
|
||||
|
||||
if(M.get_int_organ(/obj/item/organ/internal/xenos/hivenode))
|
||||
return 0
|
||||
if(M.get_int_organ(/obj/item/organ/internal/body_egg/alien_embryo))
|
||||
return 0
|
||||
|
||||
if(loc == M) return 0
|
||||
|
||||
if(M.get_int_organ(/obj/item/organ/internal/body_egg/alien_embryo))
|
||||
return 0
|
||||
if(loc == M)
|
||||
return 0
|
||||
if(stat != CONSCIOUS)
|
||||
return 0
|
||||
if(!sterile) M.take_organ_damage(strength,0) //done here so that even borgs and humans in helmets take damage
|
||||
|
||||
M.visible_message("<span class='userdanger'>[src] leaps at [M]'s face!</span>")
|
||||
|
||||
M.visible_message("<span class='danger'>[src] leaps at [M]'s face!</span>", \
|
||||
"<span class='userdanger'>[src] leaps at [M]'s face!</span>")
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.head && H.head.flags & HEADCOVERSMOUTH)
|
||||
H.visible_message("<span class='userdanger'>[src] smashes against [H]'s [H.head]!</span>")
|
||||
death()
|
||||
H.visible_message("<span class='danger'>[src] smashes against [H]'s [H.head]!</span>", \
|
||||
"<span class='userdanger'>[src] smashes against [H]'s [H.head]!</span>")
|
||||
Die()
|
||||
return 0
|
||||
|
||||
if(iscarbon(M))
|
||||
var/mob/living/carbon/target = M
|
||||
if(target.wear_mask)
|
||||
@@ -147,8 +146,8 @@ var/const/MAX_ACTIVE_TIME = 400
|
||||
|
||||
src.loc = target
|
||||
target.equip_to_slot(src, slot_wear_mask,,0)
|
||||
|
||||
if(!sterile) M.Paralyse(MAX_IMPREGNATION_TIME/6) //something like 25 ticks = 20 seconds with the default settings
|
||||
if(!sterile)
|
||||
M.Paralyse(MAX_IMPREGNATION_TIME/6) //something like 25 ticks = 20 seconds with the default settings
|
||||
else if (iscorgi(M))
|
||||
var/mob/living/simple_animal/pet/corgi/C = M
|
||||
loc = C
|
||||
@@ -181,13 +180,12 @@ var/const/MAX_ACTIVE_TIME = 400
|
||||
target.visible_message("<span class='danger'>[src] falls limp after violating [target]'s face!</span>", \
|
||||
"<span class='userdanger'>[src] falls limp after violating [target]'s face!</span>")
|
||||
|
||||
death()
|
||||
Die()
|
||||
icon_state = "[initial(icon_state)]_impregnated"
|
||||
|
||||
if(!(target.status_flags & XENO_HOST))
|
||||
if(!target.get_int_organ(/obj/item/organ/internal/body_egg/alien_embryo))
|
||||
new /obj/item/organ/internal/body_egg/alien_embryo(target)
|
||||
|
||||
|
||||
if(iscorgi(target))
|
||||
var/mob/living/simple_animal/pet/corgi/C = target
|
||||
src.loc = get_turf(C)
|
||||
@@ -195,7 +193,6 @@ var/const/MAX_ACTIVE_TIME = 400
|
||||
else
|
||||
target.visible_message("<span class='danger'>[src] violates [target]'s face!</span>", \
|
||||
"<span class='userdanger'>[src] violates [target]'s face!</span>")
|
||||
return
|
||||
|
||||
/obj/item/clothing/mask/facehugger/proc/GoActive()
|
||||
if(stat == DEAD || stat == CONSCIOUS)
|
||||
@@ -204,20 +201,10 @@ var/const/MAX_ACTIVE_TIME = 400
|
||||
stat = CONSCIOUS
|
||||
icon_state = "[initial(icon_state)]"
|
||||
|
||||
/* for(var/mob/living/carbon/alien/alien in world)
|
||||
var/image/activeIndicator = image('icons/mob/alien.dmi', loc = src, icon_state = "facehugger_active")
|
||||
activeIndicator.override = 1
|
||||
if(alien && alien.client)
|
||||
alien.client.images += activeIndicator */
|
||||
|
||||
return
|
||||
|
||||
/obj/item/clothing/mask/facehugger/proc/GoIdle()
|
||||
if(stat == DEAD || stat == UNCONSCIOUS)
|
||||
return
|
||||
|
||||
/* RemoveActiveIndicators() */
|
||||
|
||||
stat = UNCONSCIOUS
|
||||
icon_state = "[initial(icon_state)]_inactive"
|
||||
|
||||
@@ -225,32 +212,27 @@ var/const/MAX_ACTIVE_TIME = 400
|
||||
GoActive()
|
||||
return
|
||||
|
||||
/obj/item/clothing/mask/facehugger/proc/death()
|
||||
/obj/item/clothing/mask/facehugger/proc/Die()
|
||||
if(stat == DEAD)
|
||||
return
|
||||
|
||||
/* RemoveActiveIndicators() */
|
||||
|
||||
icon_state = "[initial(icon_state)]_dead"
|
||||
item_state = "facehugger_inactive"
|
||||
stat = DEAD
|
||||
|
||||
src.visible_message("<span class='userdanger'>[src] curls up into a ball!</span>")
|
||||
visible_message("<span class='danger'>[src] curls up into a ball!</span>")
|
||||
|
||||
return
|
||||
|
||||
/proc/CanHug(var/mob/living/M)
|
||||
if(!M || !ismob(M))
|
||||
/proc/CanHug(mob/living/M)
|
||||
if(!istype(M))
|
||||
return 0
|
||||
|
||||
if(M.stat == DEAD)
|
||||
return 0
|
||||
if(M.get_int_organ(/obj/item/organ/internal/xenos/hivenode))
|
||||
return 0
|
||||
|
||||
if(iscorgi(M))
|
||||
return 1
|
||||
|
||||
if(M.get_int_organ(/obj/item/organ/internal/xenos/hivenode))
|
||||
return 0
|
||||
|
||||
var/mob/living/carbon/C = M
|
||||
if(ishuman(C))
|
||||
var/mob/living/carbon/human/H = C
|
||||
|
||||
@@ -10,11 +10,6 @@
|
||||
..()
|
||||
finder << "<span class='warning'>You found an unknown alien organism in [owner]'s [parent_organ]!</span>"
|
||||
|
||||
/obj/item/organ/internal/body_egg/New(loc)
|
||||
if(iscarbon(loc))
|
||||
insert(loc)
|
||||
return ..()
|
||||
|
||||
/obj/item/organ/internal/body_egg/insert(var/mob/living/carbon/M, special = 0)
|
||||
..()
|
||||
owner.status_flags |= XENO_HOST
|
||||
@@ -33,7 +28,8 @@
|
||||
..()
|
||||
|
||||
/obj/item/organ/internal/body_egg/process()
|
||||
if(!owner) return
|
||||
if(!owner)
|
||||
return
|
||||
if(!(src in owner.internal_organs))
|
||||
remove(owner)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user