mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Chrono Grenades (#13396)
* Hopefully this works. * This is probably better. * Makes timelessness a flag. Adds an atom-level proc for toggling the TIMELESS flag. * Cleaner TIMELESS toggle. * Yet more conflict fixes.
This commit is contained in:
@@ -280,6 +280,8 @@ var/MAX_EXPLOSION_RANGE = 14
|
||||
#define OPENCONTAINER 8192 // is an open container for chemistry purposes
|
||||
#define NOREACT 16384 // Reagents don't react inside this container.
|
||||
|
||||
#define TIMELESS 32768 // Immune to time manipulation.
|
||||
|
||||
#define ALL ~0
|
||||
#define NONE 0
|
||||
|
||||
|
||||
@@ -359,7 +359,7 @@ var/global/list/PDA_Manifest = list()
|
||||
src.theworld = theworld
|
||||
|
||||
/obj/effect/stop/sleeping/Crossed(atom/movable/A)
|
||||
if(sleeptime > world.time)
|
||||
if(!(A.flags & TIMELESS) && sleeptime > world.time)
|
||||
if(ismob(A))
|
||||
var/mob/living/L = A
|
||||
if(L.mind != owner)
|
||||
|
||||
@@ -804,3 +804,7 @@ its easier to just keep the beam vertical.
|
||||
//Called when loaded by the map loader
|
||||
/atom/proc/spawned_by_map_element(datum/map_element/ME, list/objects)
|
||||
return
|
||||
|
||||
/atom/proc/toggle_timeless()
|
||||
flags ^= TIMELESS
|
||||
return flags & TIMELESS
|
||||
|
||||
13
code/game/objects/items/weapons/grenades/chronogrenade.dm
Normal file
13
code/game/objects/items/weapons/grenades/chronogrenade.dm
Normal file
@@ -0,0 +1,13 @@
|
||||
/obj/item/weapon/grenade/chronogrenade
|
||||
name = "chrono grenade"
|
||||
desc = "This experimental weapon will halt the progression of time in the local area for ten seconds."
|
||||
icon = 'icons/obj/grenade.dmi'
|
||||
icon_state = "chrono_grenade"
|
||||
item_state = "flashbang"
|
||||
flags = FPRINT | TIMELESS
|
||||
var/duration = 10 SECONDS
|
||||
var/radius = 5 //in tiles
|
||||
|
||||
/obj/item/weapon/grenade/chronogrenade/prime()
|
||||
timestop(src, duration, radius)
|
||||
qdel(src)
|
||||
@@ -99,16 +99,16 @@
|
||||
/obj/item/weapon/grenade/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(isscrewdriver(W))
|
||||
switch(det_time)
|
||||
if ("1")
|
||||
if (1)
|
||||
det_time = 10
|
||||
to_chat(user, "<span class='notice'>You set the [name] for 1 second detonation time.</span>")
|
||||
if ("10")
|
||||
if (10)
|
||||
det_time = 30
|
||||
to_chat(user, "<span class='notice'>You set the [name] for 3 second detonation time.</span>")
|
||||
if ("30")
|
||||
if (30)
|
||||
det_time = 50
|
||||
to_chat(user, "<span class='notice'>You set the [name] for 5 second detonation time.</span>")
|
||||
if ("50")
|
||||
if (50)
|
||||
det_time = 1
|
||||
to_chat(user, "<span class='notice'>You set the [name] for instant detonation.</span>")
|
||||
add_fingerprint(user)
|
||||
|
||||
@@ -712,3 +712,12 @@
|
||||
var/randomsprite = pick("a","b")
|
||||
icon_state = "wizbox-[randomsprite]"
|
||||
|
||||
/obj/item/weapon/storage/box/chrono_grenades
|
||||
name = "box of chrono grenades"
|
||||
desc = "A box of seven experimental chrono grenades."
|
||||
icon_state = "chrono_grenade"
|
||||
|
||||
/obj/item/weapon/storage/box/chrono_grenades/New()
|
||||
..()
|
||||
for(var/i = 1 to 7)
|
||||
new /obj/item/weapon/grenade/chronogrenade(src)
|
||||
|
||||
@@ -125,13 +125,15 @@ var/global/list/falltempoverlays = list()
|
||||
for(var/atom/movable/everything in T)
|
||||
if(isliving(everything))
|
||||
var/mob/living/L = everything
|
||||
if(L == holder)
|
||||
if(L == holder || L.flags & TIMELESS)
|
||||
continue
|
||||
affected += L
|
||||
invertcolor(L)
|
||||
spawn() recursive_timestop(L)
|
||||
L.playsound_local(L, invocation == "ZA WARUDO" ? 'sound/effects/theworld2.ogg' : 'sound/effects/fall2.ogg', 100, 0, 0, 0, 0)
|
||||
else
|
||||
if(everything.flags & TIMELESS)
|
||||
continue
|
||||
spawn() recursive_timestop(everything)
|
||||
if(everything.ignoreinvert)
|
||||
continue
|
||||
@@ -154,7 +156,8 @@ var/global/list/falltempoverlays = list()
|
||||
affected |= A
|
||||
|
||||
if(A != holder)
|
||||
A.timestopped = 1
|
||||
if(!(A.flags & TIMELESS))
|
||||
A.timestopped = 1
|
||||
|
||||
for (var/atom/B in A)
|
||||
if (!processed_list[B])
|
||||
@@ -214,3 +217,23 @@ var/global/list/falltempoverlays = list()
|
||||
0,-1,0,
|
||||
0,0,-1,
|
||||
1,1,1)
|
||||
|
||||
/proc/timestop(atom/A, var/duration, var/range)
|
||||
if(!A || !duration)
|
||||
return
|
||||
var/mob/caster = new
|
||||
var/spell/aoe_turf/fall/fall = new /spell/aoe_turf/fall
|
||||
caster.invisibility = 101
|
||||
caster.density = 0
|
||||
caster.anchored = 1
|
||||
caster.flags = INVULNERABLE
|
||||
caster.add_spell(fall)
|
||||
fall.spell_flags = 0
|
||||
fall.invocation_type = SpI_NONE
|
||||
fall.the_world_chance = 0
|
||||
fall.range = range ? range : 7 //how big
|
||||
fall.sleeptime = duration //for how long
|
||||
caster.forceMove(get_turf(A))
|
||||
spawn()
|
||||
fall.perform(caster, skipcharge = 1)
|
||||
qdel(caster)
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.8 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
@@ -771,6 +771,7 @@
|
||||
#include "code\game\objects\items\weapons\ai_modules\standard.dm"
|
||||
#include "code\game\objects\items\weapons\ai_modules\targetted.dm"
|
||||
#include "code\game\objects\items\weapons\grenades\chem_grenade.dm"
|
||||
#include "code\game\objects\items\weapons\grenades\chronogrenade.dm"
|
||||
#include "code\game\objects\items\weapons\grenades\clowngrenade.dm"
|
||||
#include "code\game\objects\items\weapons\grenades\emgrenade.dm"
|
||||
#include "code\game\objects\items\weapons\grenades\flashbang.dm"
|
||||
|
||||
Reference in New Issue
Block a user