mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 00:29:02 +01:00
- Makes body_egg parent for alien embryos/changeling eggs
This commit is contained in:
@@ -7,8 +7,9 @@
|
||||
|
||||
/obj/effect/proc_holder/changeling/headcrab/sting_action(var/mob/user)
|
||||
explosion(get_turf(user),0,0,2,0,silent=1)
|
||||
var/turf = get_turf(user)
|
||||
spawn(5) // So it's not killed in explosion
|
||||
var/mob/living/simple_animal/hostile/headcrab/crab = new(get_turf(user))
|
||||
var/mob/living/simple_animal/hostile/headcrab/crab = new(turf)
|
||||
crab.origin = user.mind
|
||||
user.gib()
|
||||
feedback_add_details("changeling_powers","LR")
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
/obj/item/body_egg
|
||||
name = "generic egg"
|
||||
desc = "All slimy and yuck."
|
||||
icon = 'icons/mob/alien.dmi'
|
||||
icon_state = "larva0_dead"
|
||||
var/mob/living/affected_mob
|
||||
|
||||
/obj/item/body_egg/New()
|
||||
if(istype(loc, /mob/living))
|
||||
affected_mob = loc
|
||||
affected_mob.status_flags |= XENO_HOST
|
||||
SSobj.processing |= src
|
||||
if(istype(affected_mob,/mob/living/carbon))
|
||||
var/mob/living/carbon/H = affected_mob
|
||||
H.med_hud_set_status()
|
||||
spawn(0)
|
||||
AddInfectionImages(affected_mob)
|
||||
else
|
||||
qdel(src)
|
||||
|
||||
/obj/item/body_egg/Destroy()
|
||||
if(affected_mob)
|
||||
affected_mob.status_flags &= ~(XENO_HOST)
|
||||
if(istype(affected_mob,/mob/living/carbon))
|
||||
var/mob/living/carbon/H = affected_mob
|
||||
H.med_hud_set_status()
|
||||
spawn(0)
|
||||
RemoveInfectionImages(affected_mob)
|
||||
..()
|
||||
|
||||
/obj/item/body_egg/process()
|
||||
if(!affected_mob) return
|
||||
if(loc != affected_mob)
|
||||
affected_mob.status_flags &= ~(XENO_HOST)
|
||||
SSobj.processing.Remove(src)
|
||||
if(istype(affected_mob,/mob/living/carbon))
|
||||
var/mob/living/carbon/H = affected_mob
|
||||
H.med_hud_set_status()
|
||||
spawn(0)
|
||||
RemoveInfectionImages(affected_mob)
|
||||
affected_mob = null
|
||||
return
|
||||
|
||||
egg_process()
|
||||
|
||||
/obj/item/body_egg/proc/egg_process()
|
||||
return
|
||||
|
||||
/obj/item/body_egg/proc/RefreshInfectionImage()
|
||||
RemoveInfectionImages()
|
||||
AddInfectionImages()
|
||||
|
||||
/obj/item/body_egg/proc/AddInfectionImages()
|
||||
return
|
||||
|
||||
/obj/item/body_egg/proc/RemoveInfectionImages()
|
||||
return
|
||||
@@ -185,7 +185,7 @@ Des: Gives the client of the alien an image on each infected mob.
|
||||
if (client)
|
||||
for (var/mob/living/C in mob_list)
|
||||
if(C.status_flags & XENO_HOST)
|
||||
var/obj/item/alien_embryo/A = locate() in C
|
||||
var/obj/item/body_egg/alien_embryo/A = locate() in C
|
||||
var/I = image('icons/mob/alien.dmi', loc = C, icon_state = "infected[A.stage]")
|
||||
client.images += I
|
||||
return
|
||||
|
||||
@@ -2,50 +2,11 @@
|
||||
// It functions almost identically (see code/datums/diseases/alien_embryo.dm)
|
||||
var/const/ALIEN_AFK_BRACKET = 450 // 45 seconds
|
||||
|
||||
/obj/item/alien_embryo
|
||||
/obj/item/body_egg/alien_embryo
|
||||
name = "alien embryo"
|
||||
desc = "All slimy and yuck."
|
||||
icon = 'icons/mob/alien.dmi'
|
||||
icon_state = "larva0_dead"
|
||||
var/mob/living/affected_mob
|
||||
var/stage = 0
|
||||
|
||||
/obj/item/alien_embryo/New()
|
||||
if(istype(loc, /mob/living))
|
||||
affected_mob = loc
|
||||
affected_mob.status_flags |= XENO_HOST
|
||||
SSobj.processing |= src
|
||||
if(istype(affected_mob,/mob/living/carbon))
|
||||
var/mob/living/carbon/H = affected_mob
|
||||
H.med_hud_set_status()
|
||||
spawn(0)
|
||||
AddInfectionImages(affected_mob)
|
||||
else
|
||||
qdel(src)
|
||||
|
||||
/obj/item/alien_embryo/Destroy()
|
||||
if(affected_mob)
|
||||
affected_mob.status_flags &= ~(XENO_HOST)
|
||||
if(istype(affected_mob,/mob/living/carbon))
|
||||
var/mob/living/carbon/H = affected_mob
|
||||
H.med_hud_set_status()
|
||||
spawn(0)
|
||||
RemoveInfectionImages(affected_mob)
|
||||
..()
|
||||
|
||||
/obj/item/alien_embryo/process()
|
||||
if(!affected_mob) return
|
||||
if(loc != affected_mob)
|
||||
affected_mob.status_flags &= ~(XENO_HOST)
|
||||
SSobj.processing.Remove(src)
|
||||
if(istype(affected_mob,/mob/living/carbon))
|
||||
var/mob/living/carbon/H = affected_mob
|
||||
H.med_hud_set_status()
|
||||
spawn(0)
|
||||
RemoveInfectionImages(affected_mob)
|
||||
affected_mob = null
|
||||
return
|
||||
|
||||
/obj/item/body_egg/alien_embryo/egg_process()
|
||||
if(stage < 5 && prob(3))
|
||||
stage++
|
||||
spawn(0)
|
||||
@@ -87,7 +48,9 @@ var/const/ALIEN_AFK_BRACKET = 450 // 45 seconds
|
||||
if(prob(50))
|
||||
AttemptGrow()
|
||||
|
||||
/obj/item/alien_embryo/proc/AttemptGrow(var/gib_on_success = 1)
|
||||
|
||||
|
||||
/obj/item/body_egg/alien_embryo/proc/AttemptGrow(var/gib_on_success = 1)
|
||||
var/list/candidates = get_candidates(BE_ALIEN, ALIEN_AFK_BRACKET)
|
||||
var/client/C = null
|
||||
|
||||
@@ -123,7 +86,7 @@ var/const/ALIEN_AFK_BRACKET = 450 // 45 seconds
|
||||
Proc: RefreshInfectionImage()
|
||||
Des: Removes the current icons located in the infected mob adds the current stage
|
||||
----------------------------------------*/
|
||||
/obj/item/alien_embryo/proc/RefreshInfectionImage()
|
||||
/obj/item/body_egg/alien_embryo/RefreshInfectionImage()
|
||||
RemoveInfectionImages()
|
||||
AddInfectionImages()
|
||||
|
||||
@@ -131,7 +94,7 @@ Des: Removes the current icons located in the infected mob adds the current stag
|
||||
Proc: AddInfectionImages(C)
|
||||
Des: Adds the infection image to all aliens for this embryo
|
||||
----------------------------------------*/
|
||||
/obj/item/alien_embryo/proc/AddInfectionImages()
|
||||
/obj/item/body_egg/alien_embryo/AddInfectionImages()
|
||||
for(var/mob/living/carbon/alien/alien in player_list)
|
||||
if(alien.client)
|
||||
var/I = image('icons/mob/alien.dmi', loc = affected_mob, icon_state = "infected[stage]")
|
||||
@@ -141,7 +104,7 @@ Des: Adds the infection image to all aliens for this embryo
|
||||
Proc: RemoveInfectionImage(C)
|
||||
Des: Removes all images from the mob infected by this embryo
|
||||
----------------------------------------*/
|
||||
/obj/item/alien_embryo/proc/RemoveInfectionImages()
|
||||
/obj/item/body_egg/alien_embryo/RemoveInfectionImages()
|
||||
for(var/mob/living/carbon/alien/alien in player_list)
|
||||
if(alien.client)
|
||||
for(var/image/I in alien.client.images)
|
||||
|
||||
@@ -115,7 +115,7 @@ var/const/MAX_ACTIVE_TIME = 400
|
||||
|
||||
if(loc == L) return 0
|
||||
if(stat != CONSCIOUS) return 0
|
||||
if(locate(/obj/item/alien_embryo) in L) return 0
|
||||
if(locate(/obj/item/body_egg/alien_embryo) in L) return 0
|
||||
if(!sterile) L.take_organ_damage(strength,0) //done here so that even borgs and humans in helmets take damage
|
||||
|
||||
L.visible_message("<span class='danger'>[src] leaps at [L]'s face!</span>", \
|
||||
@@ -174,7 +174,7 @@ var/const/MAX_ACTIVE_TIME = 400
|
||||
icon_state = "[initial(icon_state)]_impregnated"
|
||||
|
||||
if(!target.getlimb(/obj/item/organ/limb/robot/chest) && !(target.status_flags & XENO_HOST))
|
||||
new /obj/item/alien_embryo(target)
|
||||
new /obj/item/body_egg/alien_embryo(target)
|
||||
|
||||
|
||||
if(iscorgi(target))
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
var/datum/mind/origin
|
||||
|
||||
/mob/living/simple_animal/hostile/headcrab/proc/Infect(var/mob/living/carbon/human/victim)
|
||||
var/obj/item/changeling_egg/egg = new(victim)
|
||||
var/obj/item/body_egg/changeling_egg/egg = new(victim)
|
||||
egg.owner = origin
|
||||
victim.internal_organs += egg
|
||||
visible_message("<span class='notice'>[src] lays an egg in a [victim]!</span>")
|
||||
@@ -33,42 +33,22 @@
|
||||
return
|
||||
target.attack_animal(src)
|
||||
|
||||
/obj/item/changeling_egg
|
||||
|
||||
|
||||
|
||||
/obj/item/body_egg/changeling_egg
|
||||
name = "changeling egg"
|
||||
desc = "Twitching and disgusting"
|
||||
icon = 'icons/mob/alien.dmi'
|
||||
icon_state = "larva0_dead"
|
||||
var/mob/living/affected_mob
|
||||
var/datum/mind/owner
|
||||
var/time
|
||||
|
||||
/obj/item/changeling_egg/New()
|
||||
if(istype(loc, /mob/living))
|
||||
affected_mob = loc
|
||||
affected_mob.status_flags |= XENO_HOST
|
||||
SSobj.processing |= src
|
||||
if(istype(affected_mob,/mob/living/carbon))
|
||||
var/mob/living/carbon/H = affected_mob
|
||||
H.med_hud_set_status()
|
||||
else
|
||||
qdel(src)
|
||||
|
||||
/obj/item/changeling_egg/process()
|
||||
if(!affected_mob) return
|
||||
if(loc != affected_mob)
|
||||
affected_mob.status_flags &= ~(XENO_HOST)
|
||||
SSobj.processing.Remove(src)
|
||||
if(istype(affected_mob,/mob/living/carbon))
|
||||
var/mob/living/carbon/H = affected_mob
|
||||
H.med_hud_set_status()
|
||||
affected_mob = null
|
||||
return
|
||||
/obj/item/body_egg/changeling_egg/egg_process()
|
||||
//Changeling eggs grow in dead people
|
||||
time++
|
||||
if(time >= EGG_INCUBATION_TIME)
|
||||
Pop()
|
||||
|
||||
obj/item/changeling_egg/proc/Pop()
|
||||
obj/item/body_egg/changeling_egg/proc/Pop()
|
||||
var/mob/living/carbon/monkey/M = new(affected_mob.loc)
|
||||
owner.transfer_to(M)
|
||||
owner.changeling.purchasedpowers += new /obj/effect/proc_holder/changeling/humanform(null)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
return 1
|
||||
|
||||
/datum/surgery_step/xenomorph_removal/proc/remove_xeno(mob/user, mob/living/carbon/target)
|
||||
var/obj/item/alien_embryo/A = locate() in target.contents
|
||||
var/obj/item/body_egg/alien_embryo/A = locate() in target.contents
|
||||
if(A)
|
||||
user << "<span class='notice'>You found an unknown alien organism in [target]'s chest!</span>"
|
||||
if(A.stage < 4)
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
|
||||
/datum/surgery_step/xenomorph_removal/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
var/obj/item/alien_embryo/A = locate() in target.contents
|
||||
var/obj/item/body_egg/alien_embryo/A = locate() in target.contents
|
||||
if(A)
|
||||
if(prob(50))
|
||||
A.AttemptGrow(0)
|
||||
|
||||
@@ -540,6 +540,7 @@
|
||||
#include "code\game\objects\effects\spawners\vaultspawner.dm"
|
||||
#include "code\game\objects\items\apc_frame.dm"
|
||||
#include "code\game\objects\items\blueprints.dm"
|
||||
#include "code\game\objects\items\body_egg.dm"
|
||||
#include "code\game\objects\items\bodybag.dm"
|
||||
#include "code\game\objects\items\candle.dm"
|
||||
#include "code\game\objects\items\crayons.dm"
|
||||
|
||||
Reference in New Issue
Block a user