Merge pull request #17053 from coiax/chasm-lifering

Jaunters can now be belt-worn to offer chasm protection
This commit is contained in:
Razharas
2016-04-24 22:09:26 +03:00
2 changed files with 65 additions and 22 deletions
+54 -22
View File
@@ -475,7 +475,7 @@
/obj/item/device/wormhole_jaunter
name = "wormhole jaunter"
desc = "A single use device harnessing outdated wormhole technology, Nanotrasen has since turned its eyes to blue space for more accurate teleportation. The wormholes it creates are unpleasant to travel through, to say the least."
desc = "A single use device harnessing outdated wormhole technology, Nanotrasen has since turned its eyes to blue space for more accurate teleportation. The wormholes it creates are unpleasant to travel through, to say the least.\nThanks to modifications provided by the Free Golems, this jaunter can be worn on the belt to provide protection from chasms."
icon = 'icons/obj/mining.dmi'
icon_state = "Jaunter"
item_state = "electronic"
@@ -484,28 +484,58 @@
throw_speed = 3
throw_range = 5
origin_tech = "bluespace=2"
slot_flags = SLOT_BELT
/obj/item/device/wormhole_jaunter/attack_self(mob/user)
user.visible_message("<span class='notice'>[user.name] activates the [src.name]!</span>")
activate(user)
/obj/item/device/wormhole_jaunter/proc/turf_check(mob/user)
var/turf/device_turf = get_turf(user)
if(!device_turf||device_turf.z==2||device_turf.z>=7)
user << "<span class='notice'>You're having difficulties getting the [src.name] to work.</span>"
return FALSE
return TRUE
/obj/item/device/wormhole_jaunter/proc/activate(mob/user)
if(!turf_check(user))
return
var/list/L = list()
for(var/obj/item/device/radio/beacon/B in world)
var/turf/T = get_turf(B)
if(T.z == ZLEVEL_STATION)
L += B
if(!L.len)
user << "<span class='notice'>The [src.name] found no beacons in the world to anchor a wormhole to.</span>"
return
var/chosen_beacon = pick(L)
var/obj/effect/portal/wormhole/jaunt_tunnel/J = new /obj/effect/portal/wormhole/jaunt_tunnel(get_turf(src), chosen_beacon, lifespan=100)
J.target = chosen_beacon
try_move_adjacent(J)
playsound(src,'sound/effects/sparks4.ogg',50,1)
qdel(src)
/obj/item/device/wormhole_jaunter/emp_act(power)
var/triggered = FALSE
if(usr.get_item_by_slot(slot_belt) == src)
if(power == 1)
triggered = TRUE
else if(power == 2 && prob(50))
triggered = TRUE
if(triggered)
usr.visible_message("<span class='warning'>The [src] overloads and activates!</span>")
activate(usr)
/obj/item/device/wormhole_jaunter/proc/chasm_react(mob/user)
if(user.get_item_by_slot(slot_belt) == src)
user << "Your [src] activates, saving you from the chasm!</span>"
activate(user)
else
user.visible_message("<span class='notice'>[user.name] activates the [src.name]!</span>")
var/list/L = list()
for(var/obj/item/device/radio/beacon/B in world)
var/turf/T = get_turf(B)
if(T.z == ZLEVEL_STATION)
L += B
if(!L.len)
user << "<span class='notice'>The [src.name] failed to create a wormhole.</span>"
return
var/chosen_beacon = pick(L)
var/obj/effect/portal/wormhole/jaunt_tunnel/J = new /obj/effect/portal/wormhole/jaunt_tunnel(get_turf(src), chosen_beacon, lifespan=100)
J.target = chosen_beacon
try_move_adjacent(J)
playsound(src,'sound/effects/sparks4.ogg',50,1)
qdel(src)
user << "The [src] is not attached to your belt, preventing it from saving you from the chasm. RIP.</span>"
/obj/effect/portal/wormhole/jaunt_tunnel
name = "jaunt tunnel"
@@ -518,6 +548,8 @@
return
if(istype(M, /atom/movable))
if(do_teleport(M, target, 6))
// KERPLUNK
playsound(M,'sound/weapons/resonator_blast.ogg',50,1)
if(iscarbon(M))
var/mob/living/carbon/L = M
L.Weaken(3)
@@ -1019,20 +1051,20 @@
/*********************Hivelord stabilizer****************/
/obj/item/weapon/hivelordstabilizer
name = "hivelord stabilizer"
name = "stabilizing serum"
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle19"
desc = "Inject a hivelord core with this stabilizer to preserve its healing powers indefinitely."
desc = "Inject certain types of monster organs with this stabilizer to preserve their healing powers indefinitely."
w_class = 1
origin_tech = "biotech=1"
/obj/item/weapon/hivelordstabilizer/afterattack(obj/item/organ/internal/M, mob/user)
var/obj/item/organ/internal/hivelord_core/C = M
if(!istype(C, /obj/item/organ/internal/hivelord_core))
user << "<span class='warning'>The stabilizer only works on hivelord cores.</span>"
user << "<span class='warning'>The stabilizer only works on certain types of monster organs, generally regenerative in nature.</span>"
return ..()
C.preserved = 1
user << "<span class='notice'>You inject the hivelord core with the stabilizer. It will no longer go inert.</span>"
user << "<span class='notice'>You inject the [M] with the stabilizer. It will no longer go inert.</span>"
qdel(src)
@@ -1081,7 +1113,7 @@
new /datum/data/mining_equipment("Alien Toy", /obj/item/clothing/mask/facehugger/toy, 300),
new /datum/data/mining_equipment("Monkey Cube", /obj/item/weapon/reagent_containers/food/snacks/monkeycube, 300),
new /datum/data/mining_equipment("Toolbelt", /obj/item/weapon/storage/belt/utility, 350),
new /datum/data/mining_equipment("Hivelord Stabilizer", /obj/item/weapon/hivelordstabilizer, 400),
new /datum/data/mining_equipment("Stabilizing Serum", /obj/item/weapon/hivelordstabilizer, 400),
new /datum/data/mining_equipment("Shelter Capsule", /obj/item/weapon/survivalcapsule, 400),
new /datum/data/mining_equipment("GAR scanners", /obj/item/clothing/glasses/meson/gar, 500),
new /datum/data/mining_equipment("Sulphuric Acid", /obj/item/weapon/reagent_containers/glass/beaker/sulphuric, 500),
@@ -1110,4 +1142,4 @@
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
RefreshParts()
RefreshParts()
+11
View File
@@ -563,12 +563,23 @@
/turf/open/chasm/Entered(atom/movable/AM)
if(istype(AM, /obj/singularity) || istype(AM, /obj/item/projectile))
return
if(istype(AM, /obj/effect/portal))
// Portals aren't affected by gravity. Probably.
return
// Flies right over the chasm
if(istype(AM, /mob/living/simple_animal))
// apparently only simple_animals can fly??
var/mob/living/simple_animal/SA = AM
if(SA.flying)
return
if(istype(AM, /mob/living/carbon/human))
var/mob/living/carbon/human/H = AM
if(istype(H.belt, /obj/item/device/wormhole_jaunter))
var/obj/item/device/wormhole_jaunter/J = H.belt
// To freak out any bystanders
visible_message("[H] falls into [src]!")
J.chasm_react(H)
return
drop(AM)