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:
Shadowmech88
2017-01-13 17:46:25 -06:00
committed by Probe1
parent b8195cb71a
commit 465fb8b5b5
11 changed files with 127 additions and 75 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -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

View 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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -1,68 +1,68 @@
//Captain's Spacesuit
/obj/item/clothing/head/helmet/space/capspace
name = "space helmet"
icon_state = "capspace_0"
item_state = "capspacehelmet"
desc = "A special helmet designed for work in a hazardous, low-pressure environment. Only for the most fashionable of military figureheads."
body_parts_covered = HEAD|EARS|EYES
permeability_coefficient = 0.01
pressure_resistance = 200 * ONE_ATMOSPHERE
armor = list(melee = 65, bullet = 50, laser = 50,energy = 25, bomb = 50, bio = 100, rad = 50)
allowed = list(/obj/item/device/flashlight)
light_power = 1.7
var/brightness_on = 4
var/on = 0
var/no_light = 0
action_button_name = "Toggle Helmet Light"
species_fit = list(VOX_SHAPED)
/obj/item/clothing/head/helmet/space/capspace/attack_self(mob/user)
on = !on
icon_state = "capspace_[on]"
user.update_inv_head()
if(on)
set_light(brightness_on)
else
set_light(0)
//Captain's space suit This is not the proper path but I don't currently know enough about how this all works to mess with it.
/obj/item/clothing/suit/armor/captain
name = "Captain's armor"
desc = "A bulky, heavy-duty piece of exclusive Nanotrasen armor. YOU are in charge!"
icon_state = "caparmor"
item_state = "capspacesuit"
species_fit = list(VOX_SHAPED)
w_class = W_CLASS_LARGE
gas_transfer_coefficient = 0.01
permeability_coefficient = 0.02
clothing_flags = ONESIZEFITSALL
pressure_resistance = 200 * ONE_ATMOSPHERE
body_parts_covered = ARMS|LEGS|FULL_TORSO|FEET
allowed = list(/obj/item/weapon/tank/emergency_oxygen, /obj/item/device/flashlight,/obj/item/weapon/gun/energy, /obj/item/weapon/gun/projectile, /obj/item/ammo_storage, /obj/item/ammo_casing, /obj/item/weapon/melee/baton,/obj/item/weapon/handcuffs,/obj/item/weapon/tank/emergency_nitrogen)
slowdown = 1.5
armor = list(melee = 65, bullet = 50, laser = 50, energy = 25, bomb = 50, bio = 100, rad = 50)
siemens_coefficient = 0.7
heat_conductivity = SPACESUIT_HEAT_CONDUCTIVITY
/obj/item/clothing/suit/armor/captain/old
icon_state = "oldcaparmor"
/obj/item/clothing/suit/armor/centcomm
name = "Cent. Com. armor"
desc = "This bulky armor is the property of Nanotrasen's supreme leader. Witness and behold!"
icon_state = "centcom"
item_state = "centcom"
w_class = W_CLASS_LARGE
gas_transfer_coefficient = 0.01
permeability_coefficient = 0.02
clothing_flags = ONESIZEFITSALL | PLASMAGUARD
body_parts_covered = ARMS|LEGS|FULL_TORSO|FEET
allowed = list(/obj/item/weapon/tank/emergency_oxygen, /obj/item/device/flashlight,/obj/item/weapon/gun/energy, /obj/item/weapon/gun/projectile, /obj/item/ammo_storage, /obj/item/ammo_casing, /obj/item/weapon/melee/baton,/obj/item/weapon/handcuffs,/obj/item/weapon/tank/emergency_nitrogen)
armor = list(melee = 65, bullet = 55, laser = 50, energy = 25, bomb = 50, bio = 100, rad = 60)
max_heat_protection_temperature = FIRE_HELMET_MAX_HEAT_PROTECTION_TEMPERATURE
heat_conductivity = SPACESUIT_HEAT_CONDUCTIVITY
siemens_coefficient = 0
/obj/item/clothing/suit/armor/centcomm/old
icon_state = "oldcentcom"
//Captain's Spacesuit
/obj/item/clothing/head/helmet/space/capspace
name = "space helmet"
icon_state = "capspace_0"
item_state = "capspacehelmet"
desc = "A special helmet designed for work in a hazardous, low-pressure environment. Only for the most fashionable of military figureheads."
body_parts_covered = HEAD|EARS|EYES
permeability_coefficient = 0.01
pressure_resistance = 200 * ONE_ATMOSPHERE
armor = list(melee = 65, bullet = 50, laser = 50,energy = 25, bomb = 50, bio = 100, rad = 50)
allowed = list(/obj/item/device/flashlight)
light_power = 1.7
var/brightness_on = 4
var/on = 0
var/no_light = 0
action_button_name = "Toggle Helmet Light"
species_fit = list(VOX_SHAPED)
/obj/item/clothing/head/helmet/space/capspace/attack_self(mob/user)
on = !on
icon_state = "capspace_[on]"
user.update_inv_head()
if(on)
set_light(brightness_on)
else
set_light(0)
//Captain's space suit This is not the proper path but I don't currently know enough about how this all works to mess with it.
/obj/item/clothing/suit/armor/captain
name = "Captain's armor"
desc = "A bulky, heavy-duty piece of exclusive Nanotrasen armor. YOU are in charge!"
icon_state = "caparmor"
item_state = "capspacesuit"
species_fit = list(VOX_SHAPED)
w_class = W_CLASS_LARGE
gas_transfer_coefficient = 0.01
permeability_coefficient = 0.02
clothing_flags = ONESIZEFITSALL
pressure_resistance = 200 * ONE_ATMOSPHERE
body_parts_covered = ARMS|LEGS|FULL_TORSO|FEET
allowed = list(/obj/item/weapon/tank/emergency_oxygen, /obj/item/device/flashlight,/obj/item/weapon/gun/energy, /obj/item/weapon/gun/projectile, /obj/item/ammo_storage, /obj/item/ammo_casing, /obj/item/weapon/melee/baton,/obj/item/weapon/handcuffs,/obj/item/weapon/tank/emergency_nitrogen)
slowdown = 1.5
armor = list(melee = 65, bullet = 50, laser = 50, energy = 25, bomb = 50, bio = 100, rad = 50)
siemens_coefficient = 0.7
heat_conductivity = SPACESUIT_HEAT_CONDUCTIVITY
/obj/item/clothing/suit/armor/captain/old
icon_state = "oldcaparmor"
/obj/item/clothing/suit/armor/centcomm
name = "Cent. Com. armor"
desc = "This bulky armor is the property of Nanotrasen's supreme leader. Witness and behold!"
icon_state = "centcom"
item_state = "centcom"
w_class = W_CLASS_LARGE
gas_transfer_coefficient = 0.01
permeability_coefficient = 0.02
clothing_flags = ONESIZEFITSALL | PLASMAGUARD
body_parts_covered = ARMS|LEGS|FULL_TORSO|FEET
allowed = list(/obj/item/weapon/tank/emergency_oxygen, /obj/item/device/flashlight,/obj/item/weapon/gun/energy, /obj/item/weapon/gun/projectile, /obj/item/ammo_storage, /obj/item/ammo_casing, /obj/item/weapon/melee/baton,/obj/item/weapon/handcuffs,/obj/item/weapon/tank/emergency_nitrogen)
armor = list(melee = 65, bullet = 55, laser = 50, energy = 25, bomb = 50, bio = 100, rad = 60)
max_heat_protection_temperature = FIRE_HELMET_MAX_HEAT_PROTECTION_TEMPERATURE
heat_conductivity = SPACESUIT_HEAT_CONDUCTIVITY
siemens_coefficient = 0
/obj/item/clothing/suit/armor/centcomm/old
icon_state = "oldcentcom"

View File

@@ -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

View File

@@ -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"