From 0df1dabf75befc2dedb3e4f45d5cd194e3373cfd Mon Sep 17 00:00:00 2001 From: Chinsky Date: Sat, 28 Jun 2014 14:07:21 +0400 Subject: [PATCH] Adds overmap system and examples of it's usage. Unticked, as it disables space edge transition. Conflicts: code/modules/mob/mob_movement.dm --- code/WorkInProgress/Chinsky/overmap/helm.dm | 74 +++ .../WorkInProgress/Chinsky/overmap/sectors.dm | 74 +-- code/modules/mob/mob_movement.dm | 4 + maps/overmap/_map.dmm | 24 + maps/overmap/bearcat/bearcat.dm | 114 +++++ maps/overmap/bearcat/bearcat.dmi | Bin 0 -> 845 bytes maps/overmap/bearcat/bearcat.dmm | 461 ++++++++++++++++++ maps/overmap/example_sector1.dmm | 331 +++++++++++++ maps/overmap/example_sector2.dmm | 171 +++++++ 9 files changed, 1222 insertions(+), 31 deletions(-) create mode 100644 code/WorkInProgress/Chinsky/overmap/helm.dm create mode 100644 maps/overmap/_map.dmm create mode 100644 maps/overmap/bearcat/bearcat.dm create mode 100644 maps/overmap/bearcat/bearcat.dmi create mode 100644 maps/overmap/bearcat/bearcat.dmm create mode 100644 maps/overmap/example_sector1.dmm create mode 100644 maps/overmap/example_sector2.dmm diff --git a/code/WorkInProgress/Chinsky/overmap/helm.dm b/code/WorkInProgress/Chinsky/overmap/helm.dm new file mode 100644 index 00000000000..a441f57f6dd --- /dev/null +++ b/code/WorkInProgress/Chinsky/overmap/helm.dm @@ -0,0 +1,74 @@ +/obj/machinery/computer/helm + name = "helm control console" + icon_state = "id" + var/obj/effect/mapinfo/linked //connected overmap object + +/obj/machinery/computer/helm/initialize() + linked = map_sectors["[z]"] + if (!linked) + testing("Helm console at level [z] was unable to find a corresponding overmap object.") + else + testing("Helm console at level [z] found a corresponding overmap object '[linked.name]'.") + +/obj/machinery/computer/helm/relaymove(var/mob/user, direction) + if(linked) + linked.relaymove(user,direction) + return 1 + +/obj/machinery/computer/helm/check_eye(var/mob/user as mob) + if (get_dist(user, src) > 1 || user.blinded || !linked ) + return null + user.reset_view(linked) + return 1 + +/obj/machinery/computer/helm/attack_hand(var/mob/user as mob) + if(!linked) + user << "Could not get navigation data!" + return + + if(stat & (NOPOWER|BROKEN)) + user.unset_machine() + return + + if(!isAI(user)) + user.set_machine(src) + + return + +//Shuttle controller computer for shuttles going from ship to sectors + +/obj/machinery/computer/shuttle_control/explore + name = "exploration shuttle console" + shuttle_tag = "Exploration" + req_access = list() + var/landing_type //area for shuttle ship-side + +/obj/machinery/computer/shuttle_control/explore/initialize() + ..() + shuttle_tag = "[shuttle_tag]-[z]" + if(!shuttle_controller.shuttles[shuttle_tag]) + var/datum/shuttle/ferry/shuttle = new() + shuttle.warmup_time = 10 + shuttle.area_station = locate(landing_type) + shuttle.area_offsite = shuttle.area_station + shuttle_controller.shuttles[shuttle_tag] = shuttle + shuttle_controller.process_shuttles += shuttle + testing("Exploration shuttle '[shuttle_tag]' at zlevel [z] successfully added.") + +/obj/machinery/computer/shuttle_control/explore/proc/update_destination() + if(shuttle_controller.shuttles[shuttle_tag]) + var/obj/effect/map/ship/S = map_sectors["[z]"] + if (!istype(S)) + return + var/datum/shuttle/ferry/shuttle = shuttle_controller.shuttles[shuttle_tag] + if(S && S.current_sector) + var/obj/effect/map/M = S.current_sector + shuttle.area_offsite = M.shuttle_landing + testing("Shuttle controller now sends shuttle to [M]") + else + shuttle.area_offsite = shuttle.area_station + shuttle_controller.shuttles[shuttle_tag] = shuttle + +/obj/machinery/computer/shuttle_control/explore/attack_hand(user as mob) + update_destination() + ..() \ No newline at end of file diff --git a/code/WorkInProgress/Chinsky/overmap/sectors.dm b/code/WorkInProgress/Chinsky/overmap/sectors.dm index b6e5ed2e67c..bb24851affd 100644 --- a/code/WorkInProgress/Chinsky/overmap/sectors.dm +++ b/code/WorkInProgress/Chinsky/overmap/sectors.dm @@ -1,4 +1,20 @@ #define OVERMAP_ZLEVEL 1 +//=================================================================================== +//Hook for building overmap +//=================================================================================== +var/global/list/map_sectors = list() + +/hook/startup/proc/build_map() + accessable_z_levels = list() //no space travel with this system, at least not like this + testing("Building overmap...") + var/obj/effect/mapinfo/data + for(var/level in 1 to world.maxz) + data = locate("sector[level]") + if (data) + testing("Located sector \"[data.name]\" at [data.mapx],[data.mapy] corresponding to zlevel [level]") + map_sectors["[level]"] = new data.obj_type(data) + return 1 + //=================================================================================== //Metaobject for storing information about sector this zlevel is representing. //Should be placed only once on every zlevel. @@ -9,6 +25,7 @@ icon_state = "x2" invisibility = 101 var/obj_type //type of overmap object it spawns + var/landing_area //type of area used as inbound shuttle landing, null if no shuttle landing area var/zlevel var/mapx //coordinates on the var/mapy //overmap zlevel @@ -20,49 +37,57 @@ /obj/effect/mapinfo/sector name = "generic sector" - desc = "Space sector with some stuff in it." obj_type = /obj/effect/map/sector /obj/effect/mapinfo/ship name = "generic ship" - desc = "Space faring vessel." obj_type = /obj/effect/map/ship /obj/effect/mapinfo/ship/relaymove(var/mob/user, direction) step(src,direction) + + //=================================================================================== //Overmap object representing zlevel //=================================================================================== + /obj/effect/map name = "map object" + icon = 'icons/obj/items.dmi' + icon_state = "sheet-plasteel" var/map_z = 0 + var/area/shuttle/shuttle_landing /obj/effect/map/New(var/obj/effect/mapinfo/data) - name = data.name - desc = data.desc map_z = data.zlevel - icon = data.icon - icon_state = data.icon_state - var/new_x = data.mapx - if (!new_x) - new_x = rand(1,world.maxx) - var/new_y = data.mapy - if (!new_y) - new_y = rand(1,world.maxy) + name = data.name + if (data.icon != 'icons/mob/screen1.dmi') + icon = data.icon + icon_state = data.icon_state + if(data.desc) + desc = data.desc + var/new_x = data.mapx ? data.mapx : rand(2,world.maxx-2) + var/new_y = data.mapy ? data.mapy : rand(2,world.maxy-2) loc = locate(new_x, new_y, OVERMAP_ZLEVEL) + if(data.landing_area) + shuttle_landing = locate(data.landing_area) + /obj/effect/map/CanPass(atom/movable/A) testing("[A] attempts to enter sector\"[name]\"") - if(prob(50)) - testing("[A] was denied access to sector\"[name]\"") - return 0 return 1 /obj/effect/map/Crossed(atom/movable/A) testing("[A] has entered sector\"[name]\"") + if (istype(A,/obj/effect/map/ship)) + var/obj/effect/map/ship/S = A + S.current_sector = src /obj/effect/map/Uncrossed(atom/movable/A) testing("[A] has left sector\"[name]\"") + if (istype(A,/obj/effect/map/ship)) + var/obj/effect/map/ship/S = A + S.current_sector = null /obj/effect/map/sector name = "generic sector" @@ -72,22 +97,9 @@ /obj/effect/map/ship name = "generic ship" desc = "Space faring vessel." + icon_state = "sheet-sandstone" density = 1 + var/current_sector /obj/effect/map/ship/relaymove(mob/user, direction) - step(src, direction) - -//=================================================================================== -//Hook for building overmap -//=================================================================================== -var/global/list/map_sectors = list() - -/hook/startup/proc/build_map() - testing("Building overmap...") - var/obj/effect/mapinfo/data - for(var/level in 1 to world.maxz) - data = locate("sector[level]") - if (data) - testing("Located sector \"[data.name]\" at [data.mapx],[data.mapy] corresponding to zlevel [level]") - map_sectors["[level]"] = new data.obj_type(data) - return 1 + step(src,direction) diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 6d8b81aaa30..599e0901290 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -256,6 +256,10 @@ if(istype(mob.buckled, /obj/vehicle) || istype(mob.buckled, /obj/structure/stool/bed/chair/cart)) return mob.buckled.relaymove(mob,direct) + if(istype(mob.machine, /obj/machinery)) + if(mob.machine.relaymove(mob,direct)) + return + if(mob.pulledby || mob.buckled) // Wheelchair driving! if(istype(mob.loc, /turf/space)) return // No wheelchair driving in space diff --git a/maps/overmap/_map.dmm b/maps/overmap/_map.dmm new file mode 100644 index 00000000000..92a83a87e1a --- /dev/null +++ b/maps/overmap/_map.dmm @@ -0,0 +1,24 @@ +"a" = (/turf/space,/area/centcom) + +(1,1,1) = {" +aaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaa +"} diff --git a/maps/overmap/bearcat/bearcat.dm b/maps/overmap/bearcat/bearcat.dm new file mode 100644 index 00000000000..87b43bf4ef2 --- /dev/null +++ b/maps/overmap/bearcat/bearcat.dm @@ -0,0 +1,114 @@ +/obj/effect/mapinfo/ship/bearcat + name = "CSV Bearcat" + landing_area = /area/ship/scrap/shuttle/ingoing + obj_type = /obj/effect/map/ship/bearcat + mapx = 4 + mapy = 4 + +/obj/effect/map/ship/bearcat + name = "generic ship" + desc = "Space faring vessel." + icon = 'maps/overmap/bearcat/bearcat.dmi' + icon_state = "ship" + +/obj/machinery/computer/shuttle_control/explore/bearcat + name = "exploration shuttle console" + shuttle_tag = "Exploration" + landing_type = /area/ship/scrap/shuttle/outgoing + + + +/area/ship/scrap + name = "\improper Generic Ship" + +/area/ship/scrap/crew + name = "\improper Crew Compartemnts" + icon_state = "hallC" + +/area/ship/scrap/crew/kitchen + name = "\improper Galley" + icon_state = "kitchen" + +/area/ship/scrap/crew/dorms + name = "\improper Dorms" + icon_state = "crew_quarters" + +/area/ship/scrap/crew/saloon + name = "\improper Saloon" + icon_state = "conference" + +/area/ship/scrap/crew/toilets + name = "\improper Bathrooms" + icon_state = "toilet" + +/area/ship/scrap/crew/wash + name = "\improper Washroom" + icon_state = "locker" + +/area/ship/scrap/crew/medbay + name = "\improper Medical Bay" + icon_state = "medbay" + +/area/ship/scrap/cargo + name = "\improper Cargo Hold" + icon_state = "quartstorage" + +/area/ship/scrap/dock + name = "\improper Docking Bay" + icon_state = "entry" + +/area/ship/scrap/unused1 + name = "\improper Unused Compartment #1" + icon_state = "green" + +/area/ship/scrap/unused2 + name = "\improper Unused Compartment #2" + icon_state = "yellow" + +/area/ship/scrap/unused3 + name = "\improper Unused Compartment #3" + icon_state = "blueold" + +/area/ship/scrap/maintenance + name = "\improper Maintenance Compartments" + icon_state = "storage" + +/area/ship/scrap/maintenance/storage + name = "\improper Tools Storage" + icon_state = "eva" + +/area/ship/scrap/maintenance/atmos + name = "\improper Atmospherics Comparment" + icon_state = "atmos" + music = list('sound/ambience/ambiatm1.ogg') + +/area/ship/scrap/maintenance/power + name = "\improper Power Compartment" + icon_state = "engine_smes" + +/area/ship/scrap/maintenance/engine + name = "\improper Engine Compartments" + icon_state = "engine" + music = list('sound/ambience/ambisin1.ogg','sound/ambience/ambisin2.ogg','sound/ambience/ambisin3.ogg') + +/area/ship/scrap/command + name = "\improper Command Deck" + icon_state = "centcom" + music = list('sound/ambience/signal.ogg') + +/area/ship/scrap/command/captain + name = "\improper Captain's Quarters" + icon_state = "captain" + +/area/ship/scrap/comms + name = "\improper Communications Relay" + icon_state = "tcomsatcham" + music = list('sound/ambience/signal.ogg') + +/area/ship/scrap/shuttle/ingoing + name = "\improper Docking Bay #1" + icon_state = "tcomsatcham" + +/area/ship/scrap/shuttle/outgoing + name = "\improper Docking Bay #1" + icon_state = "tcomsatcham" \ No newline at end of file diff --git a/maps/overmap/bearcat/bearcat.dmi b/maps/overmap/bearcat/bearcat.dmi new file mode 100644 index 0000000000000000000000000000000000000000..fb883ec0100fcd8f00115cd213a3d9e9994f5c76 GIT binary patch literal 845 zcmV-T1G4;yP)V=-0C=2JR&a84_w-Y6@%7{?OD!tS%+FJ>RWQ*r;NmRLOex6# za*U0*I5Sc+(=$pSoZ^zil2jm5sW>CEK#7YpC9|j)q=$<$ttc@!6~s2=QdV&Fa{-$Q z02z20!ZoUB&;S4eFG)l}R9J=WR_$`5Fbwp?D}#win~#Q&=KY`ZWNbt@WT-yKVXHZ;W$?D7_*SI!sPBQWWB^j{r4Zebt;cR9gOlIh1cy_>e!hGJ z`^V*+o39QrTq(qW+jt*u7>Wrviq=!^fUBcXcDfp(v{pcb&u9yuz9N$V7-8sv2N}Lg z1E7Fw!qFJ!2yQ@j%$yT%;ZFwqloj-o_k4%W>8K7g`}jKt5@ADts)H?CtbU{|AGvx= z8;)5h6uHnmYNfiN)P-gdn@vgWD!02J7^2`vk|j%?Aeyr1O0q4=zDIp<$b&~3UE=7I zhNm=qfAHTRm9hvZNNoz%w)IjY6r?N-LQ|BI99+GFvepIv-srenU759*TrrI^``3VG zc_y6veVmsDoj@$so&wKKGglWy<0M8wlv*2^ZM(eZ->8_~$E){VX@>>_g5=2_Z7p|R=twKKe;<2AE`op)ex#LXr|G@-ql