mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-20 04:17:33 +01:00
Xenobio Slime Extract Improvements (#8458)
This commit is contained in:
@@ -3,37 +3,49 @@
|
||||
desc = "Looks unstable. Best to test it carefully."
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon_state = "portal"
|
||||
density = 1
|
||||
unacidable = 1//Can't destroy energy portals.
|
||||
density = TRUE
|
||||
unacidable = TRUE //Can't destroy energy portals.
|
||||
var/does_teleport = TRUE // Some portals might just be visual
|
||||
var/has_lifespan = TRUE // Whether we want to directly control the lifespan or not
|
||||
var/failchance = 5
|
||||
var/obj/target = null
|
||||
var/creator = null
|
||||
var/precision = 1
|
||||
anchored = 1.0
|
||||
var/obj/target
|
||||
var/creator
|
||||
var/precision = TRUE
|
||||
anchored = TRUE
|
||||
|
||||
/obj/effect/portal/CollidedWith(mob/M as mob|obj)
|
||||
set waitfor = FALSE
|
||||
src.teleport(M)
|
||||
|
||||
if(does_teleport)
|
||||
src.teleport(M)
|
||||
|
||||
/obj/effect/portal/Crossed(AM as mob|obj)
|
||||
set waitfor = FALSE
|
||||
src.teleport(AM)
|
||||
|
||||
if(does_teleport)
|
||||
src.teleport(AM)
|
||||
|
||||
/obj/effect/portal/attack_hand(mob/user as mob)
|
||||
set waitfor = FALSE
|
||||
src.teleport(user)
|
||||
|
||||
if(does_teleport)
|
||||
src.teleport(user)
|
||||
|
||||
/obj/effect/portal/New(loc, turf/target, creator=null, lifespan=300, precise = 1)
|
||||
..()
|
||||
src.target = target
|
||||
src.creator = creator
|
||||
if(target)
|
||||
src.target = target
|
||||
if(creator)
|
||||
src.creator = creator
|
||||
|
||||
if(lifespan > 0)
|
||||
if(has_lifespan && lifespan > 0)
|
||||
QDEL_IN(src, lifespan)
|
||||
|
||||
precision = precise
|
||||
|
||||
/obj/effect/portal/proc/teleport(atom/movable/M as mob|obj)
|
||||
if(!does_teleport) // just to be safe
|
||||
return
|
||||
if(istype(M, /obj/effect)) //sparks don't teleport
|
||||
return
|
||||
if (icon_state == "portal1")
|
||||
@@ -47,3 +59,78 @@
|
||||
do_teleport(M, locate(rand(5, world.maxx - 5), rand(5, world.maxy -5), 3), 0)
|
||||
else
|
||||
do_teleport(M, target, precision)
|
||||
|
||||
/obj/effect/portal/spawner
|
||||
name = "portal"
|
||||
desc = "Looks like a one-way portal, don't come too close."
|
||||
description_info = "This portal is a spawner portal. You cannot enter it to teleport, but it will periodically spawn things."
|
||||
does_teleport = FALSE
|
||||
has_lifespan = FALSE
|
||||
layer = OBJ_LAYER - 0.01
|
||||
var/list/spawn_things = list() // The list things to spawn
|
||||
var/num_of_spawns // How many times we want to spawn them before qdel
|
||||
var/next_spawn
|
||||
|
||||
/obj/effect/portal/spawner/Initialize()
|
||||
. = ..()
|
||||
START_PROCESSING(SSprocessing, src)
|
||||
next_spawn = world.time + 5 SECONDS
|
||||
|
||||
/obj/effect/portal/spawner/Destroy()
|
||||
STOP_PROCESSING(SSprocessing, src)
|
||||
return ..()
|
||||
|
||||
/obj/effect/portal/spawner/process()
|
||||
if(next_spawn < world.time)
|
||||
visible_message(SPAN_WARNING("\The [src] spits something out!"))
|
||||
for(var/thing in spawn_things)
|
||||
var/spawn_path = text2path(thing)
|
||||
var/atom/spawned_thing = new spawn_path(get_turf(src))
|
||||
|
||||
if(istype(spawned_thing, /obj/item/stack))
|
||||
var/obj/item/stack/stack = spawned_thing
|
||||
stack.amount = spawn_things[thing]
|
||||
stack.throw_at(get_random_turf_in_range(get_turf(src), 1), 2)
|
||||
else
|
||||
for(var/i = 1; i < spawn_things[thing]; i++)
|
||||
var/atom/movable/A = new spawn_path(get_turf(src))
|
||||
A.throw_at(get_random_turf_in_range(get_turf(src), 1), 2)
|
||||
|
||||
next_spawn = world.time + 30 SECONDS
|
||||
num_of_spawns--
|
||||
if(num_of_spawns <= 0)
|
||||
visible_message(SPAN_WARNING("\The [src] collapses in on itself!"))
|
||||
qdel(src)
|
||||
|
||||
/obj/effect/portal/spawner/metal
|
||||
num_of_spawns = 3
|
||||
spawn_things = list(
|
||||
"/obj/item/stack/material/steel" = 10,
|
||||
"/obj/item/stack/material/plasteel" = 5
|
||||
)
|
||||
|
||||
/obj/effect/portal/spawner/rare_metal
|
||||
num_of_spawns = 4
|
||||
spawn_things = list(
|
||||
"/obj/item/stack/material/gold" = 2,
|
||||
"/obj/item/stack/material/silver" = 2,
|
||||
"/obj/item/stack/material/uranium" = 2
|
||||
)
|
||||
|
||||
/obj/effect/portal/spawner/phoron
|
||||
num_of_spawns = 3
|
||||
spawn_things = list(
|
||||
"/obj/item/stack/material/phoron" = 10
|
||||
)
|
||||
|
||||
/obj/effect/portal/spawner/monkey_cube
|
||||
num_of_spawns = 1
|
||||
spawn_things = list(
|
||||
"/obj/item/reagent_containers/food/snacks/monkeycube" = 4
|
||||
)
|
||||
|
||||
/obj/effect/portal/spawner/cow // debug but funny so im keeping it
|
||||
num_of_spawns = 1
|
||||
spawn_things = list(
|
||||
"/mob/living/simple_animal/cow" = 1
|
||||
)
|
||||
@@ -127,11 +127,24 @@
|
||||
name = "charged slime core"
|
||||
desc = "A yellow slime core infused with phoron, it crackles with power."
|
||||
origin_tech = list(TECH_POWER = 2, TECH_BIO = 4)
|
||||
icon = 'icons/mob/npc/slimes.dmi' //'icons/obj/harvest.dmi'
|
||||
icon_state = "yellow slime extract" //"potato_battery"
|
||||
icon = 'icons/mob/npc/slimes.dmi'
|
||||
icon_state = "yellow slime extract"
|
||||
maxcharge = 10000
|
||||
matter = null
|
||||
var/next_recharge
|
||||
|
||||
/obj/item/cell/slime/Initialize()
|
||||
. = ..()
|
||||
START_PROCESSING(SSprocessing, src)
|
||||
|
||||
/obj/item/cell/slime/Destroy()
|
||||
STOP_PROCESSING(SSprocessing, src)
|
||||
return ..()
|
||||
|
||||
/obj/item/cell/slime/process()
|
||||
if(next_recharge < world.time)
|
||||
charge += maxcharge / 10
|
||||
next_recharge = world.time + 1 MINUTE
|
||||
|
||||
/obj/item/cell/device/emergency_light
|
||||
name = "miniature power cell"
|
||||
|
||||
Reference in New Issue
Block a user