mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-25 13:07:46 +01:00
Merge remote-tracking branch 'upstream/master' into tail-markings
This commit is contained in:
@@ -156,7 +156,7 @@
|
||||
blacklist = null
|
||||
whitelist = list(/obj/item/weapon/tank,/obj/item/weapon/reagent_containers,
|
||||
/obj/item/stack/medical,/obj/item/weapon/storage/pill_bottle,/obj/item/weapon/gun/syringe,
|
||||
/obj/item/weapon/c4,/obj/item/weapon/grenade,/obj/item/ammo_box,
|
||||
/obj/item/weapon/grenade/plastic/c4,/obj/item/weapon/grenade,/obj/item/ammo_box,
|
||||
/obj/item/weapon/gun/grenadelauncher,/obj/item/weapon/flamethrower, /obj/item/weapon/lighter,
|
||||
/obj/item/weapon/match,/obj/item/weapon/weldingtool)
|
||||
|
||||
@@ -258,7 +258,7 @@
|
||||
whitelist = list(/obj/item/weapon/banhammer,/obj/item/weapon/sord,/obj/item/weapon/claymore,/obj/item/weapon/holo/esword,
|
||||
/obj/item/weapon/flamethrower,/obj/item/weapon/grenade,/obj/item/weapon/gun,/obj/item/weapon/hatchet,/obj/item/weapon/katana,
|
||||
/obj/item/weapon/kitchen/knife,/obj/item/weapon/melee,/obj/item/weapon/nullrod,/obj/item/weapon/pickaxe,/obj/item/weapon/twohanded,
|
||||
/obj/item/weapon/c4,/obj/item/weapon/scalpel,/obj/item/weapon/shield,/obj/item/weapon/grown/nettle/death)
|
||||
/obj/item/weapon/grenade/plastic/c4,/obj/item/weapon/scalpel,/obj/item/weapon/shield,/obj/item/weapon/grown/nettle/death)
|
||||
|
||||
/datum/cargoprofile/tools
|
||||
name = "Devices & Tools"
|
||||
|
||||
@@ -234,6 +234,7 @@
|
||||
|
||||
body += "<option value='?_src_=vars;mark_object=\ref[D]'>Mark Object</option>"
|
||||
body += "<option value='?_src_=vars;proc_call=\ref[D]'>Call Proc</option>"
|
||||
body += "<option value='?_src_=vars;jump_to=\ref[D]'>Jump to Object</option>"
|
||||
if(ismob(D))
|
||||
body += "<option value='?_src_=vars;mob_player_panel=\ref[D]'>Show player panel</option>"
|
||||
|
||||
@@ -394,11 +395,7 @@ body
|
||||
html += "<ul>"
|
||||
var/index = 1
|
||||
for(var/entry in L)
|
||||
if(istext(entry))
|
||||
html += debug_variable(entry, L[entry], level + 1)
|
||||
//html += debug_variable("[index]", L[index], level + 1)
|
||||
else
|
||||
html += debug_variable(index, L[index], level + 1)
|
||||
html += debug_variable(index, L[index], level + 1)
|
||||
index++
|
||||
html += "</ul>"
|
||||
|
||||
@@ -736,6 +733,17 @@ body
|
||||
if(T)
|
||||
callproc_datum(T)
|
||||
|
||||
else if(href_list["jump_to"])
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
var/atom/A = locate(href_list["jump_to"])
|
||||
var/turf/T = get_turf(A)
|
||||
if(T)
|
||||
usr.client.jumptoturf(T)
|
||||
href_list["datumrefresh"] = href_list["jump_to"]
|
||||
|
||||
|
||||
else if(href_list["rotatedatum"])
|
||||
if(!check_rights(R_DEBUG|R_ADMIN)) return
|
||||
|
||||
@@ -1080,4 +1088,3 @@ body
|
||||
src.debug_variables(DAT)
|
||||
|
||||
return
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
/datum/map_template/New(path = null, map = null, rename = null)
|
||||
if(path)
|
||||
mappath = path
|
||||
if(mappath)
|
||||
preload_size(mappath)
|
||||
if(map)
|
||||
mapfile = map
|
||||
@@ -16,52 +17,145 @@
|
||||
name = rename
|
||||
|
||||
/datum/map_template/proc/preload_size(path)
|
||||
var/quote = ascii2text(34)
|
||||
var/map_file = file2text(path)
|
||||
var/key_len = length(copytext(map_file,2,findtext(map_file,quote,2,0)))
|
||||
//assuming one map per file since more makes no sense for templates anyway
|
||||
var/mapstart = findtext(map_file,"\n(1,1,") //todo replace with something saner
|
||||
var/content = copytext(map_file,findtext(map_file,quote+"\n",mapstart,0)+2,findtext(map_file,"\n"+quote,mapstart,0)+1)
|
||||
var/line_len = length(copytext(content,1,findtext(content,"\n",2,0)))
|
||||
|
||||
width = line_len/key_len
|
||||
height = length(content)/(line_len+1)
|
||||
var/bounds = maploader.load_map(file(path), 1, 1, 1, cropMap = 0, measureOnly = 1)
|
||||
if(bounds)
|
||||
width = bounds[MAP_MAXX] // Assumes all templates are rectangular, have a single Z level, and begin at 1,1,1
|
||||
height = bounds[MAP_MAXY]
|
||||
return bounds
|
||||
|
||||
/datum/map_template/proc/load(turf/T, centered = 0)
|
||||
var/turf/placement = T
|
||||
var/min_x = placement.x
|
||||
var/min_y = placement.y
|
||||
if(centered)
|
||||
T = locate(T.x - round(width / 2), T.y - round(height / 2), T.z)
|
||||
min_x -= round(width/2)
|
||||
min_y -= round(height/2)
|
||||
|
||||
var/max_x = min_x + width - 1
|
||||
var/max_y = min_y + height - 1
|
||||
|
||||
if(!T)
|
||||
return
|
||||
if(T.x+width > world.maxx)
|
||||
return
|
||||
if(T.y+height > world.maxy)
|
||||
return
|
||||
return 0
|
||||
|
||||
var/turf/bot_left = locate(max(1, min_x), max(1, min_y), placement.z)
|
||||
var/turf/top_right = locate(min(world.maxx, max_x), min(world.maxy, max_y), placement.z)
|
||||
|
||||
// 1 bigger, to update the turf smoothing
|
||||
var/turf/ST_bot_left = locate(max(1, min_x-1), max(1, min_y-1), placement.z)
|
||||
var/turf/ST_top_right = locate(min(world.maxx, max_x+1), min(world.maxy, max_y+1), placement.z)
|
||||
// This is to place a freeze on initialization until the map's done loading
|
||||
// otherwise atmos and stuff will start running mid-load
|
||||
// This system will metaphorically snap in half (not postpone init everywhere)
|
||||
// if given a multi-z template
|
||||
// it might need to be adapted for that when that time comes
|
||||
zlevels.add_dirt(placement.z)
|
||||
var/list/bounds = maploader.load_map(get_file(), min_x, min_y, placement.z, cropMap = 1)
|
||||
if(!bounds)
|
||||
return 0
|
||||
if(bot_left == null || top_right == null)
|
||||
log_debug("One of the late setup corners is bust")
|
||||
else
|
||||
log_debug("Late Setup from ([bot_left.x],[bot_left.y]) to ([top_right.x],[top_right.y])")
|
||||
|
||||
if(ST_bot_left == null || ST_top_right == null)
|
||||
log_debug("One of the smoothing corners is bust")
|
||||
else
|
||||
log_debug("Tile smoothing from ([ST_bot_left.x],[ST_bot_left.y]) to ([ST_top_right.x],[ST_top_right.y])")
|
||||
|
||||
maploader.load_map(get_file(), T.x-1, T.y-1, T.z)
|
||||
late_setup_level(
|
||||
block(T, locate(T.x + width - 1, T.y + height - 1, T.z)),
|
||||
block(locate(T.x - 1, T.y - 1, T.z), locate(T.x + width, T.y + height, T.z)))
|
||||
block(bot_left, top_right),
|
||||
block(ST_bot_left, ST_top_right))
|
||||
zlevels.remove_dirt(placement.z)
|
||||
|
||||
log_game("[name] loaded at at [T.x],[T.y],[T.z]")
|
||||
log_game("[name] loaded at [min_x],[min_y],[placement.z]")
|
||||
return 1
|
||||
|
||||
/datum/map_template/proc/get_file()
|
||||
if(mapfile)
|
||||
return mapfile
|
||||
if(mappath)
|
||||
mapfile = file(mappath)
|
||||
return mapfile
|
||||
. = mapfile
|
||||
else if(mappath)
|
||||
. = file(mappath)
|
||||
|
||||
if(!.)
|
||||
log_to_dd(" The file of [src] appears to be empty/non-existent.")
|
||||
|
||||
/datum/map_template/proc/get_affected_turfs(turf/T, centered = 0)
|
||||
var/turf/placement = T
|
||||
var/min_x = placement.x
|
||||
var/min_y = placement.y
|
||||
if(centered)
|
||||
var/turf/corner = locate(placement.x - round(width/2), placement.y - round(height/2), placement.z)
|
||||
if(corner)
|
||||
placement = corner
|
||||
return block(placement, locate(placement.x+width-1, placement.y+height-1, placement.z))
|
||||
min_x -= round(width/2)
|
||||
min_y -= round(height/2)
|
||||
|
||||
var/max_x = min_x + width-1
|
||||
var/max_y = min_y + height-1
|
||||
placement = locate(max(min_x,1), max(min_y,1), placement.z)
|
||||
return block(placement, locate(min(max_x, world.maxx), min(max_y, world.maxy), placement.z))
|
||||
|
||||
/datum/map_template/proc/fits_in_map_bounds(turf/T, centered = 0)
|
||||
var/turf/placement = T
|
||||
var/min_x = placement.x
|
||||
var/min_y = placement.y
|
||||
if(centered)
|
||||
min_x -= round(width/2)
|
||||
min_y -= round(height/2)
|
||||
|
||||
var/max_x = min_x + width-1
|
||||
var/max_y = min_y + height-1
|
||||
if(min_x < 1 || min_y < 1 || max_x > world.maxx || max_y > world.maxy)
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
|
||||
|
||||
/proc/preloadTemplates(path = "_maps/map_files/templates/") //see master controller setup
|
||||
for(var/map in flist(path))
|
||||
if(cmptext(copytext(map, length(map) - 3), ".dmm"))
|
||||
var/datum/map_template/T = new(path = "[path][map]", rename = "[map]")
|
||||
map_templates[T.name] = T
|
||||
map_templates[T.name] = T
|
||||
|
||||
if(!config.disable_space_ruins) // so we don't unnecessarily clutter start-up
|
||||
preloadRuinTemplates()
|
||||
//preloadShuttleTemplates()
|
||||
|
||||
/proc/preloadRuinTemplates()
|
||||
// Still supporting bans by filename
|
||||
var/list/banned
|
||||
if(fexists("config/spaceRuinBlacklist.txt"))
|
||||
banned = generateMapList("config/spaceRuinBlacklist.txt")
|
||||
else
|
||||
banned = generateMapList("config/example/spaceRuinBlacklist.txt")
|
||||
//banned += generateMapList("config/lavaRuinBlacklist.txt")
|
||||
|
||||
for(var/item in subtypesof(/datum/map_template/ruin))
|
||||
var/datum/map_template/ruin/ruin_type = item
|
||||
// screen out the abstract subtypes
|
||||
if(!initial(ruin_type.id))
|
||||
continue
|
||||
var/datum/map_template/ruin/R = new ruin_type()
|
||||
|
||||
if(banned.Find(R.mappath))
|
||||
continue
|
||||
|
||||
map_templates[R.name] = R
|
||||
ruins_templates[R.name] = R
|
||||
|
||||
/*
|
||||
if(istype(R, /datum/map_template/ruin/lavaland))
|
||||
lava_ruins_templates[R.name] = R
|
||||
*/
|
||||
if(istype(R, /datum/map_template/ruin/space))
|
||||
space_ruins_templates[R.name] = R
|
||||
|
||||
/*
|
||||
/proc/preloadShuttleTemplates()
|
||||
for(var/item in subtypesof(/datum/map_template/shuttle))
|
||||
var/datum/map_template/shuttle/shuttle_type = item
|
||||
if(!(initial(shuttle_type.suffix)))
|
||||
continue
|
||||
|
||||
var/datum/map_template/shuttle/S = new shuttle_type()
|
||||
|
||||
shuttle_templates[S.shuttle_id] = S
|
||||
map_templates[S.shuttle_id] = S
|
||||
*/
|
||||
|
||||
+3
-2
@@ -6,7 +6,8 @@ var/datum/atom_hud/huds = list( \
|
||||
DATA_HUD_SECURITY_ADVANCED = new/datum/atom_hud/data/human/security/advanced(), \
|
||||
DATA_HUD_MEDICAL_BASIC = new/datum/atom_hud/data/human/medical/basic(), \
|
||||
DATA_HUD_MEDICAL_ADVANCED = new/datum/atom_hud/data/human/medical/advanced(), \
|
||||
DATA_HUD_DIAGNOSTIC = new/datum/atom_hud/data/diagnostic(),
|
||||
DATA_HUD_DIAGNOSTIC = new/datum/atom_hud/data/diagnostic(), \
|
||||
DATA_HUD_HYDROPONIC = new/datum/atom_hud/data/hydroponic(), \
|
||||
GAME_HUD_NATIONS = new/datum/atom_hud/antag(), \
|
||||
ANTAG_HUD_CULT = new/datum/atom_hud/antag(), \
|
||||
ANTAG_HUD_REV = new/datum/atom_hud/antag(), \
|
||||
@@ -17,7 +18,7 @@ var/datum/atom_hud/huds = list( \
|
||||
ANTAG_HUD_NINJA = new/datum/atom_hud/antag/hidden(),\
|
||||
ANTAG_HUD_CHANGELING = new/datum/atom_hud/antag/hidden(),\
|
||||
ANTAG_HUD_VAMPIRE = new/datum/atom_hud/antag/hidden(),\
|
||||
ANTAG_HUD_ABDUCTOR = new/datum/atom_hud/antag/hidden(),\
|
||||
ANTAG_HUD_ABDUCTOR = new/datum/atom_hud/antag/hidden()\
|
||||
)
|
||||
|
||||
/datum/atom_hud
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
/datum/map_template/ruin
|
||||
//name = "A Chest of Doubloons"
|
||||
name = null
|
||||
var/id = null // For blacklisting purposes, all ruins need an id
|
||||
var/description = "In the middle of a clearing in the rockface, there's a \
|
||||
chest filled with gold coins with Spanish engravings. How is there a \
|
||||
wooden container filled with 18th century coinage in the middle of a \
|
||||
lavawracked hellscape? It is clearly a mystery."
|
||||
|
||||
var/cost = null
|
||||
var/allow_duplicates = FALSE //A bit boring, don't you think? You can always explicitly allow it on a ruin definition
|
||||
|
||||
var/prefix = null
|
||||
var/suffix = null
|
||||
|
||||
/datum/map_template/ruin/New()
|
||||
if(!name && id)
|
||||
name = id
|
||||
|
||||
mappath = prefix + suffix
|
||||
..(path = mappath)
|
||||
@@ -0,0 +1,162 @@
|
||||
//The bigger ones lag like hell if there is more than one on a z-level, so cost 2 for them
|
||||
/datum/map_template/ruin/space
|
||||
prefix = "_maps/map_files/RandomRuins/SpaceRuins/"
|
||||
cost = 1
|
||||
|
||||
/datum/map_template/ruin/space/zoo
|
||||
id = "zoo"
|
||||
suffix = "abandonedzoo.dmm"
|
||||
name = "Biological Storage Facility"
|
||||
description = "In case society crumbles, we will be able to restore our \
|
||||
zoos to working order with the breeding stock kept in these 100% \
|
||||
secure and unbreachable storage facilities. At no point has anything \
|
||||
escaped. That's our story, and we're sticking to it."
|
||||
cost = 2
|
||||
|
||||
/datum/map_template/ruin/space/asteroid1
|
||||
id = "asteroid1"
|
||||
suffix = "asteroid1.dmm"
|
||||
name = "Asteroid 1"
|
||||
description = "I-spy with my little eye, something beginning with R."
|
||||
|
||||
/datum/map_template/ruin/space/asteroid2
|
||||
id = "asteroid2"
|
||||
suffix = "asteroid2.dmm"
|
||||
name = "Asteroid 2"
|
||||
description = "Oh my god, a giant rock!"
|
||||
|
||||
/datum/map_template/ruin/space/asteroid3
|
||||
id = "asteroid3"
|
||||
suffix = "asteroid3.dmm"
|
||||
name = "Asteroid 3"
|
||||
description = "This asteroid floating in space has no official \
|
||||
designation, because the scientist that discovered it deemed it \
|
||||
'super dull'."
|
||||
|
||||
/datum/map_template/ruin/space/asteroid4
|
||||
id = "asteroid4"
|
||||
suffix = "asteroid4.dmm"
|
||||
name = "Asteroid 4"
|
||||
description = "Nanotrasen Escape Pods have a 100%* success rate, and a \
|
||||
99%* customer satisfaction rate. *Please note that these statistics, \
|
||||
are taken from pods that have successfully docked with a recovery \
|
||||
vessel."
|
||||
|
||||
/datum/map_template/ruin/space/asteroid5
|
||||
id = "asteroid5"
|
||||
suffix = "asteroid5.dmm"
|
||||
name = "Asteroid 5"
|
||||
description = "Oh my god, another giant rock!"
|
||||
|
||||
/datum/map_template/ruin/space/deep_storage
|
||||
id = "deep-storage"
|
||||
suffix = "deepstorage.dmm"
|
||||
name = "Survivalist Bunker"
|
||||
description = "Assume the best, prepare for the worst. Generally, you \
|
||||
should do so by digging a three man heavily fortified bunker into \
|
||||
a giant unused asteroid. Then make it self sufficient, mask any \
|
||||
evidence of construction, hook it covertly into the \
|
||||
telecommunications network and hope for the best."
|
||||
cost = 2
|
||||
|
||||
/datum/map_template/ruin/space/derelict1
|
||||
id = "derelict1"
|
||||
suffix = "derelict1.dmm"
|
||||
name = "Derelict 1"
|
||||
description = "Nothing to see here citizen, move along, certainly no \
|
||||
xeno outbreaks on this piece of station debris. That purple stuff? \
|
||||
It's uh... station nectar. It's a top secret research installation."
|
||||
|
||||
/datum/map_template/ruin/space/derelict2
|
||||
id = "derelict2"
|
||||
suffix = "derelict2.dmm"
|
||||
name = "Dinner for Two"
|
||||
description = "Oh this is the night\n\
|
||||
It's a beautiful night\n\
|
||||
And we call it bella notte"
|
||||
|
||||
/datum/map_template/ruin/space/derelict3
|
||||
id = "derelict3"
|
||||
suffix = "derelict3.dmm"
|
||||
name = "Derelict 3"
|
||||
description = "These hulks were once part of a larger structure, where \
|
||||
the three great \[REDACTED\] were forged."
|
||||
|
||||
/datum/map_template/ruin/space/derelict4
|
||||
id = "derelict4"
|
||||
suffix = "derelict4.dmm"
|
||||
name = "Derelict 4"
|
||||
description = "Centcom ferries have never crashed, will never crash, \
|
||||
there is no current investigation into a crashed ferry, and we \
|
||||
will not let Internal Affairs trample over high security information \
|
||||
in the name of this baseless witchhunt."
|
||||
|
||||
/datum/map_template/ruin/space/derelict5
|
||||
id = "derelict5"
|
||||
suffix = "derelict5.dmm"
|
||||
name = "Derelict 5"
|
||||
description = "The plan is, we put a whole bunch of crates full of \
|
||||
treasure in this disused warehouse, launch it into space, and then \
|
||||
ignore it. Forever."
|
||||
|
||||
/datum/map_template/ruin/space/empty_shell
|
||||
id = "empty-shell"
|
||||
suffix = "emptyshell.dmm"
|
||||
name = "Empty Shell"
|
||||
description = "Cosy, rural property availible for young professional \
|
||||
couple. Only twelve parsecs from the nearest hyperspace lane!"
|
||||
|
||||
/datum/map_template/ruin/space/gas_the_lizards
|
||||
id = "gas-the-lizards"
|
||||
suffix = "gasthelizards.dmm"
|
||||
name = "Disposal Facility 17"
|
||||
description = "Gas efficiency at 95.6%, fluid elimination at 96.2%. \
|
||||
Will require renewed supplies of 'carpet' before the end of the \
|
||||
quarter."
|
||||
|
||||
/datum/map_template/ruin/space/intact_empty_ship
|
||||
id = "intact-empty-ship"
|
||||
suffix = "intactemptyship.dmm"
|
||||
name = "Authorship"
|
||||
description = "Just somewhere quiet, where I can focus on my work with \
|
||||
no interruptions."
|
||||
|
||||
/datum/map_template/ruin/space/mech_transport
|
||||
id = "mech-transport"
|
||||
suffix = "mechtransport.dmm"
|
||||
name = "CF Corsair"
|
||||
description = "Well, when is it getting here? I have bills to pay; very \
|
||||
well-armed clients who want their shipments as soon as possible! I \
|
||||
don't care, just find it!"
|
||||
|
||||
/datum/map_template/ruin/space/onehalf
|
||||
id = "onehalf"
|
||||
suffix = "onehalf.dmm"
|
||||
name = "DK Excavator 453"
|
||||
description = "Based on the trace elements we've detected on the \
|
||||
gutted asteroids, we suspect that a mining ship using a restricted \
|
||||
engine is somewhere in the area. We'd like to request a patrol vessel \
|
||||
to investigate."
|
||||
cost = 2
|
||||
|
||||
/datum/map_template/ruin/space/spacebar
|
||||
id = "spacebar"
|
||||
suffix = "spacebar.dmm"
|
||||
name = "The Rampant Golem and Yellow Hound"
|
||||
description = "No questions asked. No shoes/foot protection, no service. \
|
||||
No tabs. No violence in the inside areas. That's it. Welcome to the \
|
||||
Rampant Golem and Yellow Hound. Can I take your order?"
|
||||
cost = 2
|
||||
|
||||
/datum/map_template/ruin/space/turreted_outpost
|
||||
id = "turreted-outpost"
|
||||
suffix = "turretedoutpost.dmm"
|
||||
name = "Unnamed Turreted Outpost"
|
||||
description = "We'd ask them to stop blaring that ruskiepop music, but \
|
||||
none of us are brave enough to go near those death turrets they have."
|
||||
|
||||
/datum/map_template/ruin/space/way_home
|
||||
id = "way-home"
|
||||
suffix = "way_home.dmm"
|
||||
name = "Salvation"
|
||||
description = "In the darkest times, we will find our way home."
|
||||
@@ -953,11 +953,19 @@ var/list/uplink_items = list()
|
||||
|
||||
/datum/uplink_item/device_tools/plastic_explosives
|
||||
name = "Composition C-4"
|
||||
desc = "C-4 is plastic explosive of the common variety Composition C. You can use it to breach walls or connect a signaller to its wiring to make it remotely detonable. It has a modifiable timer with a minimum setting of 10 seconds."
|
||||
desc = "C-4 is plastic explosive of the common variety Composition C. You can use it to breach walls or connect an assembly to its wiring to make it remotely detonable. It has a modifiable timer with a minimum setting of 10 seconds."
|
||||
reference = "C4"
|
||||
item = /obj/item/weapon/c4
|
||||
item = /obj/item/weapon/grenade/plastic/c4
|
||||
cost = 1
|
||||
|
||||
/datum/uplink_item/device_tools/breaching_charge
|
||||
name = "Composition X-4"
|
||||
desc = "X-4 is a shaped charge designed to be safe to the user while causing maximum damage to the occupants of the room beach breached. It has a modifiable timer with a minimum setting of 10 seconds."
|
||||
reference = "X4"
|
||||
item = /obj/item/weapon/grenade/plastic/x4
|
||||
cost = 2
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
|
||||
/datum/uplink_item/device_tools/powersink
|
||||
name = "Power Sink"
|
||||
desc = "When screwed to wiring attached to an electric grid, then activated, this large device places excessive load on the grid, causing a stationwide blackout. The sink cannot be carried because of its excessive size. Ordering this sends you a small beacon that will teleport the power sink to your location on activation."
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
//The effects of weather occur across an entire z-level. For instance, lavaland has periodic ash storms that scorch most unprotected creatures.
|
||||
|
||||
#define STARTUP_STAGE 1
|
||||
#define MAIN_STAGE 2
|
||||
#define WIND_DOWN_STAGE 3
|
||||
#define END_STAGE 4
|
||||
|
||||
/datum/weather
|
||||
var/name = "space wind"
|
||||
var/desc = "Heavy gusts of wind blanket the area, periodically knocking down anyone caught in the open."
|
||||
|
||||
var/telegraph_message = "<span class='warning'>The wind begins to pick up.</span>" //The message displayed in chat to foreshadow the weather's beginning
|
||||
var/telegraph_duration = 300 //In deciseconds, how long from the beginning of the telegraph until the weather begins
|
||||
var/telegraph_sound //The sound file played to everyone on an affected z-level
|
||||
var/telegraph_overlay //The overlay applied to all tiles on the z-level
|
||||
|
||||
var/weather_message = "<span class='userdanger'>The wind begins to blow ferociously!</span>" //Displayed in chat once the weather begins in earnest
|
||||
var/weather_duration = 1200 //In deciseconds, how long the weather lasts once it begins
|
||||
var/weather_duration_lower = 1200 //See above - this is the lowest possible duration
|
||||
var/weather_duration_upper = 1500 //See above - this is the highest possible duration
|
||||
var/weather_sound
|
||||
var/weather_overlay
|
||||
|
||||
var/end_message = "<span class='danger'>The wind relents its assault.</span>" //Displayed once the wather is over
|
||||
var/end_duration = 300 //In deciseconds, how long the "wind-down" graphic will appear before vanishing entirely
|
||||
var/end_sound
|
||||
var/end_overlay
|
||||
|
||||
var/area_type = /area/space //Types of area to affect
|
||||
var/list/impacted_areas = list() //Areas to be affected by the weather, calculated when the weather begins
|
||||
var/target_z = ZLEVEL_STATION //The z-level to affect
|
||||
|
||||
var/overlay_layer = 10 //Since it's above everything else, this is the layer used by default. 2 is below mobs and walls if you need to use that.
|
||||
var/aesthetic = FALSE //If the weather has no purpose other than looks
|
||||
var/immunity_type = "storm" //Used by mobs to prevent them from being affected by the weather
|
||||
|
||||
var/stage = END_STAGE //The stage of the weather, from 1-4
|
||||
|
||||
var/probability = FALSE //Percent chance to happen if there are other possible weathers on the z-level
|
||||
|
||||
/datum/weather/New()
|
||||
..()
|
||||
weather_master.existing_weather |= src
|
||||
|
||||
/datum/weather/Destroy()
|
||||
weather_master.existing_weather -= src
|
||||
return ..()
|
||||
|
||||
/datum/weather/proc/telegraph()
|
||||
if(stage == STARTUP_STAGE)
|
||||
return
|
||||
stage = STARTUP_STAGE
|
||||
for(var/V in get_areas(area_type))
|
||||
var/area/A = V
|
||||
if(A.z == target_z)
|
||||
impacted_areas |= A
|
||||
weather_duration = rand(weather_duration_lower, weather_duration_upper)
|
||||
update_areas()
|
||||
for(var/V in player_list)
|
||||
var/mob/M = V
|
||||
if(M.z == target_z)
|
||||
if(telegraph_message)
|
||||
to_chat(M, telegraph_message)
|
||||
if(telegraph_sound)
|
||||
M << sound(telegraph_sound)
|
||||
addtimer(src, "start", telegraph_duration)
|
||||
|
||||
/datum/weather/proc/start()
|
||||
if(stage >= MAIN_STAGE)
|
||||
return
|
||||
stage = MAIN_STAGE
|
||||
update_areas()
|
||||
for(var/V in player_list)
|
||||
var/mob/M = V
|
||||
if(M.z == target_z)
|
||||
if(weather_message)
|
||||
to_chat(M, weather_message)
|
||||
if(weather_sound)
|
||||
M << sound(weather_sound)
|
||||
weather_master.processing_weather |= src
|
||||
addtimer(src, "wind_down", weather_duration)
|
||||
|
||||
/datum/weather/proc/wind_down()
|
||||
if(stage >= WIND_DOWN_STAGE)
|
||||
return
|
||||
stage = WIND_DOWN_STAGE
|
||||
update_areas()
|
||||
for(var/V in player_list)
|
||||
var/mob/M = V
|
||||
if(M.z == target_z)
|
||||
if(end_message)
|
||||
to_chat(M, end_message)
|
||||
if(end_sound)
|
||||
M << sound(end_sound)
|
||||
weather_master.processing_weather -= src
|
||||
addtimer(src, "end", end_duration)
|
||||
|
||||
/datum/weather/proc/end()
|
||||
if(stage == END_STAGE)
|
||||
return
|
||||
stage = END_STAGE
|
||||
update_areas()
|
||||
|
||||
/datum/weather/proc/can_impact(mob/living/L) //Can this weather impact a mob?
|
||||
if(L.z != target_z)
|
||||
return
|
||||
if(immunity_type in L.weather_immunities)
|
||||
return
|
||||
if(!(get_area(L) in impacted_areas))
|
||||
return
|
||||
return 1
|
||||
|
||||
/datum/weather/proc/impact(mob/living/L) //What effect does this weather have on the hapless mob?
|
||||
return
|
||||
|
||||
/datum/weather/proc/update_areas()
|
||||
for(var/V in impacted_areas)
|
||||
var/area/N = V
|
||||
N.layer = overlay_layer
|
||||
N.icon = 'icons/effects/weather_effects.dmi'
|
||||
N.invisibility = 0
|
||||
switch(stage)
|
||||
if(STARTUP_STAGE)
|
||||
N.icon_state = telegraph_overlay
|
||||
if(MAIN_STAGE)
|
||||
N.icon_state = weather_overlay
|
||||
if(WIND_DOWN_STAGE)
|
||||
N.icon_state = end_overlay
|
||||
if(END_STAGE)
|
||||
N.icon_state = initial(N.icon_state)
|
||||
N.icon = 'icons/turf/areas.dmi'
|
||||
N.layer = 10 //Just default back to normal area stuff since I assume setting a var is faster than initial
|
||||
N.invisibility = INVISIBILITY_MAXIMUM
|
||||
N.opacity = 0
|
||||
@@ -0,0 +1,118 @@
|
||||
//Different types of weather.
|
||||
|
||||
/datum/weather/floor_is_lava //The Floor is Lava: Makes all turfs damage anyone on them unless they're standing on a solid object.
|
||||
name = "the floor is lava"
|
||||
desc = "The ground turns into surprisingly cool lava, lightly damaging anything on the floor."
|
||||
|
||||
telegraph_message = "<span class='warning'>Waves of heat emanate from the ground...</span>"
|
||||
telegraph_duration = 150
|
||||
|
||||
weather_message = "<span class='userdanger'>The floor is lava! Get on top of something!</span>"
|
||||
weather_duration_lower = 300
|
||||
weather_duration_upper = 600
|
||||
weather_overlay = "lava"
|
||||
|
||||
end_message = "<span class='danger'>The ground cools and returns to its usual form.</span>"
|
||||
end_duration = 0
|
||||
|
||||
area_type = /area
|
||||
target_z = ZLEVEL_STATION
|
||||
|
||||
overlay_layer = 2 //Covers floors only
|
||||
immunity_type = "lava"
|
||||
|
||||
/datum/weather/floor_is_lava/impact(mob/living/L)
|
||||
for(var/obj/structure/O in L.loc)
|
||||
if(O.density)
|
||||
return
|
||||
if(L.loc.density)
|
||||
return
|
||||
if(!L.client) //Only sentient people are going along with it!
|
||||
return
|
||||
L.adjustFireLoss(3)
|
||||
|
||||
/datum/weather/floor_is_lava/fake
|
||||
name = "fake lava"
|
||||
aesthetic = TRUE
|
||||
|
||||
/datum/weather/advanced_darkness //Advanced Darkness: Restricts the vision of all affected mobs to a single tile in the cardinal directions.
|
||||
name = "advanced darkness"
|
||||
desc = "Everything in the area is effectively blinded, unable to see more than a foot or so around itself."
|
||||
|
||||
telegraph_message = "<span class='warning'>The lights begin to dim... is the power going out?</span>"
|
||||
telegraph_duration = 150
|
||||
|
||||
weather_message = "<span class='userdanger'>This isn't your everyday darkness... this is <i>advanced</i> darkness!</span>"
|
||||
weather_duration_lower = 300
|
||||
weather_duration_upper = 300
|
||||
|
||||
end_message = "<span class='danger'>At last, the darkness recedes.</span>"
|
||||
end_duration = 0
|
||||
|
||||
area_type = /area
|
||||
target_z = ZLEVEL_STATION
|
||||
|
||||
/datum/weather/advanced_darkness/update_areas()
|
||||
for(var/V in impacted_areas)
|
||||
var/area/A = V
|
||||
if(stage == MAIN_STAGE)
|
||||
A.invisibility = 0
|
||||
A.opacity = 1
|
||||
A.layer = overlay_layer
|
||||
A.icon = 'icons/effects/weather_effects.dmi'
|
||||
A.icon_state = "darkness"
|
||||
else
|
||||
A.invisibility = INVISIBILITY_MAXIMUM
|
||||
A.opacity = 0
|
||||
|
||||
|
||||
/datum/weather/ash_storm //Ash Storms: Common happenings on lavaland. Heavily obscures vision and deals heavy fire damage to anyone caught outside.
|
||||
name = "ash storm"
|
||||
desc = "An intense atmospheric storm lifts ash off of the planet's surface and billows it down across the area, dealing intense fire damage to the unprotected."
|
||||
|
||||
telegraph_message = "<span class='boldwarning'>An eerie moan rises on the wind. Sheets of burning ash blacken the horizon. Seek shelter.</span>"
|
||||
telegraph_duration = 300
|
||||
telegraph_sound = 'sound/lavaland/ash_storm_windup.ogg'
|
||||
telegraph_overlay = "light_ash"
|
||||
|
||||
weather_message = "<span class='userdanger'><i>Smoldering clouds of scorching ash billow down around you! Get inside!</i></span>"
|
||||
weather_duration_lower = 600
|
||||
weather_duration_upper = 1500
|
||||
weather_sound = 'sound/lavaland/ash_storm_start.ogg'
|
||||
weather_overlay = "ash_storm"
|
||||
|
||||
end_message = "<span class='boldannounce'>The shrieking wind whips away the last of the ash falls to its usual murmur. It should be safe to go outside now.</span>"
|
||||
end_duration = 300
|
||||
end_sound = 'sound/lavaland/ash_storm_end.ogg'
|
||||
end_overlay = "light_ash"
|
||||
|
||||
area_type = /area/mine
|
||||
target_z = ZLEVEL_ASTEROID
|
||||
|
||||
immunity_type = "ash"
|
||||
|
||||
probability = 90
|
||||
|
||||
/datum/weather/ash_storm/impact(mob/living/L)
|
||||
if(istype(L.loc, /obj/mecha))
|
||||
return
|
||||
if(ishuman(L))
|
||||
var/mob/living/carbon/human/H = L
|
||||
var/thermal_protection = H.get_thermal_protection()
|
||||
if(thermal_protection >= FIRE_IMMUNITY_SUIT_MAX_TEMP_PROTECT)
|
||||
return
|
||||
L.adjustFireLoss(4)
|
||||
|
||||
/datum/weather/ash_storm/emberfall //Emberfall: An ash storm passes by, resulting in harmless embers falling like snow. 10% to happen in place of an ash storm.
|
||||
name = "emberfall"
|
||||
desc = "A passing ash storm blankets the area in harmless embers."
|
||||
|
||||
weather_message = "<span class='notice'>Gentle embers waft down around you like grotesque snow. The storm seems to have passed you by...</span>"
|
||||
weather_sound = 'sound/lavaland/ash_storm_windup.ogg'
|
||||
weather_overlay = "light_ash"
|
||||
|
||||
end_message = "<span class='notice'>The emberfall slows, stops. Another layer of hardened soot to the basalt beneath your feet.</span>"
|
||||
|
||||
aesthetic = TRUE
|
||||
|
||||
probability = 10
|
||||
@@ -17,19 +17,6 @@ var/const/WIRE_EXPLODE = 1
|
||||
if(!mended)
|
||||
explode()
|
||||
|
||||
/datum/wires/explosive/plastic
|
||||
holder_type = /obj/item/weapon/c4
|
||||
|
||||
/datum/wires/explosive/plastic/CanUse(var/mob/living/L)
|
||||
var/obj/item/weapon/c4/P = holder
|
||||
if(P.open_panel)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/wires/explosive/plastic/explode()
|
||||
var/obj/item/weapon/c4/P = holder
|
||||
P.explode(get_turf(P))
|
||||
|
||||
/datum/wires/explosive/gibtonite
|
||||
holder_type = /obj/item/weapon/twohanded/required/gibtonite
|
||||
|
||||
|
||||
Reference in New Issue
Block a user