Merge pull request #4429 from Citadel-Station-13/upstream-merge-33302

[MIRROR] Spinning resin or laying eggs on vents prompts the user if they're sure
This commit is contained in:
LetterJay
2017-12-18 15:27:12 -06:00
committed by GitHub
2 changed files with 25 additions and 9 deletions

View File

@@ -59,6 +59,14 @@ Doesn't work on other aliens/AI.*/
return 0 return 0
return 1 return 1
/obj/effect/proc_holder/alien/proc/check_vent_block(mob/living/user)
var/obj/machinery/atmospherics/components/unary/atmos_thing = locate() in user.loc
if(atmos_thing)
var/rusure = alert(user, "Laying eggs and shaping resin here would block access to [atmos_thing]. Do you want to continue?", "Blocking Atmospheric Component", "Yes", "No")
if(rusure != "No")
return FALSE
return TRUE
/obj/effect/proc_holder/alien/plant /obj/effect/proc_holder/alien/plant
name = "Plant Weeds" name = "Plant Weeds"
desc = "Plants some alien weeds." desc = "Plants some alien weeds."
@@ -243,7 +251,7 @@ Doesn't work on other aliens/AI.*/
name = "Secrete Resin" name = "Secrete Resin"
desc = "Secrete tough malleable resin." desc = "Secrete tough malleable resin."
plasma_cost = 55 plasma_cost = 55
check_turf = 1 check_turf = TRUE
var/list/structures = list( var/list/structures = list(
"resin wall" = /obj/structure/alien/resin/wall, "resin wall" = /obj/structure/alien/resin/wall,
"resin membrane" = /obj/structure/alien/resin/membrane, "resin membrane" = /obj/structure/alien/resin/membrane,
@@ -254,18 +262,22 @@ Doesn't work on other aliens/AI.*/
/obj/effect/proc_holder/alien/resin/fire(mob/living/carbon/user) /obj/effect/proc_holder/alien/resin/fire(mob/living/carbon/user)
if(locate(/obj/structure/alien/resin) in user.loc) if(locate(/obj/structure/alien/resin) in user.loc)
to_chat(user, "<span class='danger'>There is already a resin structure there.</span>") to_chat(user, "<span class='danger'>There is already a resin structure there.</span>")
return 0 return FALSE
if(!check_vent_block(user))
return FALSE
var/choice = input("Choose what you wish to shape.","Resin building") as null|anything in structures var/choice = input("Choose what you wish to shape.","Resin building") as null|anything in structures
if(!choice) if(!choice)
return 0 return FALSE
if (!cost_check(check_turf,user)) if (!cost_check(check_turf,user))
return 0 return FALSE
to_chat(user, "<span class='notice'>You shape a [choice].</span>") to_chat(user, "<span class='notice'>You shape a [choice].</span>")
user.visible_message("<span class='notice'>[user] vomits up a thick purple substance and begins to shape it.</span>") user.visible_message("<span class='notice'>[user] vomits up a thick purple substance and begins to shape it.</span>")
choice = structures[choice] choice = structures[choice]
new choice(user.loc) new choice(user.loc)
return 1 return TRUE
/obj/effect/proc_holder/alien/regurgitate /obj/effect/proc_holder/alien/regurgitate
name = "Regurgitate" name = "Regurgitate"

View File

@@ -79,16 +79,20 @@
name = "Lay Egg" name = "Lay Egg"
desc = "Lay an egg to produce huggers to impregnate prey with." desc = "Lay an egg to produce huggers to impregnate prey with."
plasma_cost = 75 plasma_cost = 75
check_turf = 1 check_turf = TRUE
action_icon_state = "alien_egg" action_icon_state = "alien_egg"
/obj/effect/proc_holder/alien/lay_egg/fire(mob/living/carbon/user) /obj/effect/proc_holder/alien/lay_egg/fire(mob/living/carbon/user)
if(locate(/obj/structure/alien/egg) in get_turf(user)) if(locate(/obj/structure/alien/egg) in get_turf(user))
to_chat(user, "There's already an egg here.") to_chat(user, "<span class='alertalien'>There's already an egg here.</span>")
return 0 return FALSE
if(!check_vent_block(user))
return FALSE
user.visible_message("<span class='alertalien'>[user] has laid an egg!</span>") user.visible_message("<span class='alertalien'>[user] has laid an egg!</span>")
new /obj/structure/alien/egg(user.loc) new /obj/structure/alien/egg(user.loc)
return 1 return TRUE
//Button to let queen choose her praetorian. //Button to let queen choose her praetorian.
/obj/effect/proc_holder/alien/royal/queen/promote /obj/effect/proc_holder/alien/royal/queen/promote