mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 15:17:01 +01:00
[READY] The Portal Update - Linked portals, momentum conservation, and more! (#28055)
* THE PORTAL UPDATE * portal gun checks * damn functions * o_range(s) * Atmos Portals (#12) * Rod Form's damage now scales with how much it's upgraded * buffs chem grenades * Fix getrev runtime * Automatic changelog generation for PR #27948 [ci skip] * Automatic changelog generation for PR #27951 [ci skip] * Fixes admiral recall (#27861) * the man with the 2 shotguns that blasted me to the end of the world with dualwielding. nerf (#27978) * Beam rifles now slowdown while scoped (#27898) * Update beam_rifle.dm * Update beam_rifle.dm * Update beam_rifle.dm * Fixes a very silly clockwork false wall trick (#27996) * Fixes #27979 (#28002) * Automatic changelog generation for PR #28002 [ci skip] * Fixes #27989 : Riot suits no longer hide jumpsuits (#28003) * Fixes #27989 * remove tag * Automatic changelog generation for PR #28003 [ci skip] * Refactors a cooldown var to not require a spawn or sleep (#28011) * wat (#28012) * Remove spawns in favour of stacktrace calls, which don't stop the called (#28013) proc * Refactor another spawned cooldown var (#28014) * Come on, pathetic (#28015) * Refactor another spawn cooldown (#28016) * Goodbye spawn (#28017) * Another spawn timer (#28018) * Remove a commented out function (#28019) * Gotta go with the fro2.0 (#28010) * This doesn't do anything (#28020) * refactor another spawn cooldown (#28022) * Refactors another spawn cooldown var (#28023) * Refactor another spawn (#28024) * Refactor another spawn var (#28027) * woops * woops2 * atmos links! * unused * wew * ffs! * Forced updates * update * Update portals.dm * adjacent/atmospass checks * Create portals.dm * Update portals.dm * Update other_tools.dm * stuff * crossed * documentation * reee * no portal stacking! * woops
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
|
||||
#define SOURCE_PORTAL 1
|
||||
#define DESTINATION_PORTAL 2
|
||||
|
||||
/* Teleportation devices.
|
||||
* Contains:
|
||||
* Locator
|
||||
@@ -136,7 +140,19 @@ Frequency:
|
||||
origin_tech = "magnets=3;bluespace=4"
|
||||
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 30, bio = 0, rad = 0, fire = 100, acid = 100)
|
||||
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
|
||||
var/active_portals = 0
|
||||
var/list/active_portal_pairs
|
||||
var/max_portal_pairs = 3
|
||||
|
||||
/obj/item/weapon/hand_tele/Initialize()
|
||||
. = ..()
|
||||
active_portal_pairs = list()
|
||||
|
||||
/obj/item/weapon/hand_tele/afterattack(atom/target, mob/user, proximity, params)
|
||||
if(is_parent_of_portal(target))
|
||||
qdel(target)
|
||||
to_chat(user, "<span class='notice'>You dispel [target] remotely with \the [src]!</span>")
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/weapon/hand_tele/attack_self(mob/user)
|
||||
var/turf/current_location = get_turf(user)//What turf is the user on?
|
||||
@@ -169,7 +185,7 @@ Frequency:
|
||||
var/t1 = input(user, "Please select a teleporter to lock in on.", "Hand Teleporter") as null|anything in L
|
||||
if (!t1 || user.get_active_held_item() != src || user.incapacitated())
|
||||
return
|
||||
if(active_portals >= 3)
|
||||
if(active_portal_pairs.len >= max_portal_pairs)
|
||||
user.show_message("<span class='notice'>\The [src] is recharging!</span>")
|
||||
return
|
||||
var/atom/T = L[t1]
|
||||
@@ -178,7 +194,22 @@ Frequency:
|
||||
to_chat(user, "<span class='notice'>\The [src] is malfunctioning.</span>")
|
||||
return
|
||||
user.show_message("<span class='notice'>Locked In.</span>", 2)
|
||||
var/obj/effect/portal/P = new /obj/effect/portal(get_turf(src), T, src)
|
||||
try_move_adjacent(P)
|
||||
active_portals++
|
||||
var/list/obj/effect/portal/created = create_portal_pair(current_location, get_teleport_turf(get_turf(T)), src, 300, 1)
|
||||
if(!(LAZYLEN(created) == 2))
|
||||
return
|
||||
try_move_adjacent(created[1])
|
||||
active_portal_pairs[created[1]] = created[2]
|
||||
add_fingerprint(user)
|
||||
|
||||
/obj/item/weapon/hand_tele/proc/on_portal_destroy(obj/effect/portal/P)
|
||||
active_portal_pairs -= P //If this portal pair is made by us it'll be erased along with the other portal by the portal.
|
||||
|
||||
/obj/item/weapon/hand_tele/proc/is_parent_of_portal(obj/effect/portal/P)
|
||||
if(!istype(P))
|
||||
return FALSE
|
||||
if(active_portal_pairs[P])
|
||||
return SOURCE_PORTAL
|
||||
for(var/i in active_portal_pairs)
|
||||
if(active_portal_pairs[i] == P)
|
||||
return DESTINATION_PORTAL
|
||||
return FALSE
|
||||
|
||||
Reference in New Issue
Block a user