mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
- Something like a global map for extended and sandbox gamemodes. Explore space, blow up the asteroids, collect resources, build your own station. WIP
- Exosuit object. Patrially working. WIP. - Disease transmission on touch - Various minor changes. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@386 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -0,0 +1,116 @@
|
||||
proc/spawn_asteroid(var/atom/start_loc,var/type,var/size)//type: 0 or null - random, 1 - nothing, 2 - iron, 3 - silicon
|
||||
if(!size)
|
||||
size = pick(100;2,50;3,35;4,25;6,10;12)
|
||||
if(!type)
|
||||
type = pick(50;1,2,3)
|
||||
// world << "Asteroid size: [size]; Asteroid type: [type]"
|
||||
if(start_loc.x - size < 3 || start_loc.x + size >= world.maxx - 3 || start_loc.y - size < 3 || start_loc.y + size > world.maxy -3)
|
||||
return 0
|
||||
var/list/turfs = circlerange(start_loc,size)
|
||||
for(var/turf/T in turfs)
|
||||
var/dist = get_dist(start_loc,T)
|
||||
if(prob(100-(dist*rand(2,4))))//I'm terrible at generating random things.
|
||||
var/turf/simulated/wall/asteroid/A
|
||||
if(type > 1 && prob(25))
|
||||
switch(type)
|
||||
if(2)
|
||||
A = new /turf/simulated/wall/asteroid/iron(T)
|
||||
if(3)
|
||||
A = new /turf/simulated/wall/asteroid/silicon(T)
|
||||
else
|
||||
A = new /turf/simulated/wall/asteroid(T)
|
||||
A.opacity = 0
|
||||
A.sd_NewOpacity(1)
|
||||
/*
|
||||
if(max_secret_rooms && size == 12)
|
||||
var/x_len = rand(4,12)
|
||||
var/y_len = pick(4,12)
|
||||
var/st_l = locate(start_loc.x-round(x_len/2),start_loc.y-round(y_len/2),start_loc.z)
|
||||
spawn_room(st_l,x_len,y_len)
|
||||
max_secret_rooms--
|
||||
*/
|
||||
return 1
|
||||
|
||||
/proc/populate_w_asteroids(var/z,var/density)
|
||||
if(!density)
|
||||
density = pick(10,20,40)
|
||||
while(density)
|
||||
var/x = rand(1,world.maxx)
|
||||
var/y = rand(1,world.maxy)
|
||||
// world << "Asteroid coords: [x], [y], [z]"
|
||||
var/start_loc = locate(x,y,z)
|
||||
if(spawn_asteroid(start_loc))
|
||||
density--
|
||||
return
|
||||
|
||||
|
||||
/datum/game_mode/proc/setup_sectors()
|
||||
world << "\blue \b Randomizing space sectors."
|
||||
var/list/sectors = list(1,3,4,0,0,0,0,0,0)
|
||||
var/length = sectors.len/3
|
||||
global_map = new/list(length,length)//3x3 map
|
||||
var/x
|
||||
var/y
|
||||
|
||||
for(x=1,x<=length,x++)
|
||||
for(y=1,y<=length,y++)
|
||||
var/sector
|
||||
if(sectors.len)
|
||||
sector = pick(sectors)
|
||||
sectors -= sector
|
||||
if(sector == 0)
|
||||
sector = ++world.maxz
|
||||
populate_w_asteroids(sector)
|
||||
global_map[x][y] = sector
|
||||
else
|
||||
break
|
||||
world << "\blue \b Randomization complete."
|
||||
/*
|
||||
//debug
|
||||
for(x=1,x<=global_map.len,x++)
|
||||
var/list/y_arr = global_map[x]
|
||||
for(y=1,y<=y_arr.len,y++)
|
||||
var/t = ""
|
||||
switch(y_arr[y])
|
||||
if(1) t = "SS13"
|
||||
if(3) t = "AI Satellite"
|
||||
if(4) t = "Derelict"
|
||||
else t = "Empty Cold Space"
|
||||
world << "Global map [x] - [y] contains [t] (Z = [y_arr[y]])"
|
||||
//debug
|
||||
*/
|
||||
return
|
||||
|
||||
/datum/game_mode/proc/spawn_exporation_packs()
|
||||
for (var/obj/landmark/L in world)
|
||||
if (L.tag == "landmark*ExplorationPack")
|
||||
new /obj/item/weapon/storage/explorers_box(L.loc)
|
||||
del(L)
|
||||
return
|
||||
|
||||
|
||||
proc/spawn_room(var/atom/start_loc,var/x_size,var/y_size,var/wall,var/floor)
|
||||
var/list/room_turfs = list("walls"=list(),"floors"=list())
|
||||
|
||||
world << "Room spawned at [start_loc.x],[start_loc.y],[start_loc.z]"
|
||||
if(!wall)
|
||||
wall = pick(/turf/simulated/wall/r_wall,/turf/simulated/wall)
|
||||
if(!floor)
|
||||
floor = pick(/turf/simulated/floor,/turf/simulated/floor/engine)
|
||||
|
||||
for(var/x = 0,x<x_size,x++)
|
||||
for(var/y = 0,y<y_size,y++)
|
||||
var/turf/T
|
||||
var/cur_loc = locate(start_loc.x+x,start_loc.y+y,start_loc.z)
|
||||
if(x == 0 || x==x_size-1 || y==0 || y==y_size-1)
|
||||
T = new wall(cur_loc)
|
||||
room_turfs["walls"] += T
|
||||
else
|
||||
T = new floor(cur_loc)
|
||||
room_turfs["floors"] += T
|
||||
return room_turfs
|
||||
|
||||
|
||||
var/global/max_secret_rooms = 3
|
||||
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
/obj/item/device/gps
|
||||
name = "GPS"
|
||||
icon = 'device.dmi'
|
||||
icon_state = "pinoff"
|
||||
flags = FPRINT | TABLEPASS| CONDUCT | ONBELT
|
||||
w_class = 2.0
|
||||
item_state = "electronic"
|
||||
throw_speed = 4
|
||||
throw_range = 20
|
||||
m_amt = 500
|
||||
var/obj/ship_landing_beacon/beacon = null
|
||||
var/active = 0
|
||||
|
||||
attack_self()
|
||||
if(!active)
|
||||
active = 1
|
||||
work()
|
||||
usr << "\blue You activate the GPS"
|
||||
else
|
||||
active = 0
|
||||
icon_state = "pinoff"
|
||||
usr << "\blue You deactivate the GPS"
|
||||
|
||||
proc/work()
|
||||
if(!active) return
|
||||
if(!beacon)
|
||||
for(var/obj/ship_landing_beacon/B in world)
|
||||
if(B.name == "Beacon - SS13")
|
||||
beacon = B
|
||||
break
|
||||
|
||||
if(!beacon)
|
||||
usr << "\red Unable to detect beacon signal."
|
||||
active = 0
|
||||
icon_state = "pinonnull"
|
||||
return
|
||||
|
||||
if(!istype(src.loc, /turf) && !istype(src.loc, /mob))
|
||||
usr << "\red Too much interference. Please hold the device in hand or place it on belt."
|
||||
active = 0
|
||||
icon_state = "pinonnull"
|
||||
return
|
||||
|
||||
src.icon_state = "pinonfar"
|
||||
|
||||
var/atom/cur_loc = src.loc
|
||||
|
||||
if(cur_loc.z == beacon.z)
|
||||
src.dir = get_dir(cur_loc,beacon)
|
||||
else
|
||||
var/list/beacon_global_loc = beacon.get_global_map_pos()
|
||||
var/list/src_global_loc = cur_loc.get_global_map_pos()
|
||||
if(beacon_global_loc && src_global_loc)
|
||||
var/hor_dir = 0
|
||||
var/ver_dir = 0
|
||||
if(beacon_global_loc["x"]>src_global_loc["x"])
|
||||
hor_dir = EAST
|
||||
else if(beacon_global_loc["x"]<src_global_loc["x"])
|
||||
hor_dir = WEST
|
||||
|
||||
if(beacon_global_loc["y"]>src_global_loc["y"])
|
||||
ver_dir = NORTH
|
||||
else if(beacon_global_loc["y"]<src_global_loc["y"])
|
||||
ver_dir = SOUTH
|
||||
|
||||
src.dir = hor_dir|ver_dir
|
||||
|
||||
spawn(5) .()
|
||||
|
||||
|
||||
/obj/item/weapon/storage/explorers_box
|
||||
name = "SpaceFriend(tm)"
|
||||
icon_state = "box"
|
||||
desc = "Everything a dashing space explorer would want to have near in the grim darkness of... whatever."
|
||||
|
||||
/obj/item/weapon/storage/explorers_box/New()
|
||||
..()
|
||||
new /obj/item/device/radio/beacon(src)
|
||||
new /obj/item/device/gps(src)
|
||||
new /obj/item/device/flashlight(src)
|
||||
new /obj/item/weapon/reagent_containers/food/drinks/beer(src)
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/chips(src)
|
||||
new /obj/item/weapon/cigpacket(src)
|
||||
var/obj/item/weapon/reagent_containers/pill/P = new/obj/item/weapon/reagent_containers/pill(src)
|
||||
P.reagents.add_reagent("cyanide", 30)
|
||||
P.name = "Cyanide pill"
|
||||
return
|
||||
@@ -0,0 +1,69 @@
|
||||
/turf/simulated/wall/asteroid
|
||||
name = "asteroid"
|
||||
icon = 'walls.dmi'
|
||||
icon_state = "asteroid"
|
||||
opacity = 1
|
||||
density = 1
|
||||
oxygen = 0
|
||||
nitrogen = 0
|
||||
temperature = TCMB
|
||||
var/contains = null
|
||||
|
||||
/turf/simulated/wall/asteroid/iron
|
||||
icon_state = "asteroid_i"
|
||||
contains = /obj/item/weapon/sheet/metal
|
||||
|
||||
/turf/simulated/wall/asteroid/silicon
|
||||
icon_state = "asteroid_i"
|
||||
contains = /obj/item/weapon/sheet/glass
|
||||
|
||||
/*
|
||||
/turf/simulated/wall/asteroid/frozen_gas
|
||||
name="frozen gas"
|
||||
icon = 'atmos.dmi'
|
||||
|
||||
/turf/simulated/wall/asteroid/frozen_gas/oxygen
|
||||
icon_state = "blue"
|
||||
|
||||
New()
|
||||
src.oxygen = rand(40,200)
|
||||
..()
|
||||
|
||||
/turf/simulated/wall/asteroid/frozen_gas/nitrogen
|
||||
icon_state = "red"
|
||||
|
||||
New()
|
||||
src.nitrogen = rand(40,200)
|
||||
..()
|
||||
|
||||
/turf/simulated/wall/asteroid/frozen_gas/toxins
|
||||
icon_state = "orange"
|
||||
|
||||
New()
|
||||
src.toxins = rand(40,200)
|
||||
..()
|
||||
|
||||
/turf/simulated/wall/asteroid/frozen_gas/carbon_dioxide
|
||||
icon_state = "black"
|
||||
|
||||
New()
|
||||
src.carbon_dioxide = rand(40,200)
|
||||
..()
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/turf/simulated/wall/asteroid/dismantle_wall(devastated=0)
|
||||
if(contains && ispath(contains))
|
||||
if(!devastated)
|
||||
new contains(src)
|
||||
new contains(src)
|
||||
new contains(src)
|
||||
else
|
||||
new contains(src)
|
||||
|
||||
ReplaceWithSpace()
|
||||
|
||||
|
||||
/turf/simulated/wall/asteroid/attackby(obj/item/weapon/W as obj, mob/user as mob)//TODO
|
||||
return attack_hand(user)
|
||||
Reference in New Issue
Block a user