mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-04 14:33:10 +00:00
Opens the pool (#3459)
This pr adds some water/pool turf mechanics, such as water slowing you down, people suffocating if lying inside a pool title, and fire being extinguished if you enter the pool. Ported mostly from vore station. Also adds a diving suit rig, with sprites take from Europa. I swear I have plans to use it on an event.
This commit is contained in:
@@ -399,7 +399,7 @@
|
||||
put_mob(usr)
|
||||
return
|
||||
|
||||
/atom/proc/return_air_for_internal_lifeform()
|
||||
/atom/proc/return_air_for_internal_lifeform(var/mob/living/lifeform)
|
||||
return return_air()
|
||||
|
||||
/obj/machinery/atmospherics/unary/cryo_cell/return_air_for_internal_lifeform()
|
||||
|
||||
@@ -227,42 +227,3 @@
|
||||
baseturf = /turf/space
|
||||
|
||||
/turf/simulated/floor/light
|
||||
|
||||
/turf/simulated/floor/beach
|
||||
name = "beach"
|
||||
icon = 'icons/misc/beach.dmi'
|
||||
footstep_sound = "sandstep"
|
||||
|
||||
/turf/simulated/floor/beach/sand
|
||||
name = "sand"
|
||||
icon_state = "sand"
|
||||
|
||||
/turf/simulated/floor/beach/sand/desert
|
||||
icon_state = "desert"
|
||||
|
||||
/turf/simulated/floor/beach/coastline
|
||||
name = "coastline"
|
||||
icon = 'icons/misc/beach2.dmi'
|
||||
icon_state = "sandwater"
|
||||
footstep_sound = "waterstep"
|
||||
|
||||
/turf/simulated/floor/beach/water
|
||||
name = "water"
|
||||
icon_state = "water"
|
||||
footstep_sound = "waterstep"
|
||||
var/watertype = "water5"
|
||||
|
||||
/turf/simulated/floor/beach/water/update_dirt()
|
||||
return // Water doesn't become dirty
|
||||
|
||||
/turf/simulated/floor/beach/water/ocean
|
||||
icon_state = "seadeep"
|
||||
|
||||
/turf/simulated/floor/beach/water/pool
|
||||
icon_state = "pool"
|
||||
watertype = "poolwater"
|
||||
|
||||
/turf/simulated/floor/beach/water/Initialize()
|
||||
. = ..()
|
||||
if(add_overlay(image("icon"='icons/misc/beach.dmi',"icon_state"="[watertype]","layer"=MOB_LAYER+0.1)))
|
||||
icon_state = "pool1"
|
||||
|
||||
100
code/game/turfs/simulated/water.dm
Normal file
100
code/game/turfs/simulated/water.dm
Normal file
@@ -0,0 +1,100 @@
|
||||
/turf/simulated/floor/beach
|
||||
name = "beach"
|
||||
icon = 'icons/misc/beach.dmi'
|
||||
footstep_sound = "sandstep"
|
||||
|
||||
/turf/simulated/floor/beach/sand
|
||||
name = "sand"
|
||||
icon_state = "sand"
|
||||
|
||||
/turf/simulated/floor/beach/sand/desert
|
||||
icon_state = "desert"
|
||||
|
||||
/turf/simulated/floor/beach/coastline
|
||||
name = "coastline"
|
||||
icon = 'icons/misc/beach2.dmi'
|
||||
icon_state = "sandwater"
|
||||
footstep_sound = "waterstep"
|
||||
|
||||
/turf/simulated/floor/beach/water
|
||||
name = "water"
|
||||
icon_state = "water"
|
||||
footstep_sound = "waterstep"
|
||||
movement_cost = 2
|
||||
var/watertype = "water5"
|
||||
|
||||
/turf/simulated/floor/beach/water/pool
|
||||
name = "pool"
|
||||
icon_state = "pool"
|
||||
watertype = "poolwater"
|
||||
|
||||
/turf/simulated/floor/beach/water/ocean
|
||||
name = "ocean"
|
||||
icon_state = "seadeep"
|
||||
movement_cost = 4
|
||||
|
||||
/turf/simulated/floor/beach/water/ocean/abyss
|
||||
name = "abyss"
|
||||
icon_state = "abyss"
|
||||
watertype = "seadeep"
|
||||
|
||||
/turf/simulated/floor/beach/water/update_dirt()
|
||||
return // Water doesn't become dirty
|
||||
|
||||
/turf/simulated/floor/beach/water/Initialize()
|
||||
. = ..()
|
||||
add_overlay(image("icon"='icons/misc/beach.dmi',"icon_state"="[watertype]","layer"=MOB_LAYER+0.1))
|
||||
|
||||
/turf/simulated/floor/beach/water/return_air_for_internal_lifeform(var/mob/living/carbon/L)
|
||||
if(L && L.lying)
|
||||
if(L.can_breathe_water() || (istype(L.wear_mask, /obj/item/clothing/mask/snorkel)))
|
||||
var/datum/gas_mixture/water_breath = new()
|
||||
var/datum/gas_mixture/above_air = return_air()
|
||||
var/amount = 300
|
||||
water_breath.adjust_gas("oxygen", amount) // Assuming water breathes just extract the oxygen directly from the water.
|
||||
water_breath.temperature = above_air.temperature
|
||||
return water_breath
|
||||
else
|
||||
var/gasid = "carbon_dioxide"
|
||||
if(ishuman(L))
|
||||
var/mob/living/carbon/human/H = L
|
||||
if(H.species && H.species.exhale_type)
|
||||
gasid = H.species.exhale_type
|
||||
var/datum/gas_mixture/water_breath = new()
|
||||
var/datum/gas_mixture/above_air = return_air()
|
||||
water_breath.adjust_gas(gasid, BREATH_MOLES) // They have no oxygen, but non-zero moles and temp
|
||||
water_breath.temperature = above_air.temperature
|
||||
return water_breath
|
||||
return return_air() // Otherwise their head is above the water, so get the air from the atmosphere instead.
|
||||
|
||||
/turf/simulated/floor/beach/water/Entered(atom/movable/AM, atom/oldloc)
|
||||
if(istype(AM, /mob/living))
|
||||
var/mob/living/L = AM
|
||||
if(!istype(oldloc, /turf/simulated/floor/beach/water))
|
||||
to_chat(L, "<span class='warning'>You get drenched in water from entering \the [src]!</span>")
|
||||
AM.water_act(5)
|
||||
..()
|
||||
|
||||
/turf/simulated/floor/beach/water/Exited(atom/movable/AM, atom/newloc)
|
||||
if(istype(AM, /mob/living))
|
||||
var/mob/living/L = AM
|
||||
if(!istype(newloc, /turf/simulated/floor/beach/water))
|
||||
to_chat(L, "<span class='warning'>You climb out of \the [src].</span>")
|
||||
..()
|
||||
|
||||
/mob/living/proc/can_breathe_water()
|
||||
return FALSE
|
||||
|
||||
/mob/living/carbon/human/can_breathe_water()
|
||||
if(species)
|
||||
return species.can_breathe_water()
|
||||
return ..()
|
||||
|
||||
// Use this to have things react to having water applied to them.
|
||||
/atom/movable/proc/water_act(amount)
|
||||
return
|
||||
|
||||
/mob/living/water_act(amount)
|
||||
adjust_fire_stacks(-amount * 5)
|
||||
for(var/atom/movable/AM in contents)
|
||||
AM.water_act(amount)
|
||||
@@ -32,6 +32,8 @@
|
||||
var/roof_type = null // The turf type we spawn as a roof.
|
||||
var/tmp/roof_flags = 0
|
||||
|
||||
var/movement_cost = 0 // How much the turf slows down movement, if any.
|
||||
|
||||
// Parent code is duplicated in here instead of ..() for performance reasons.
|
||||
/turf/Initialize(mapload, ...)
|
||||
if (initialized)
|
||||
|
||||
@@ -108,9 +108,9 @@
|
||||
req_one_access = list()
|
||||
|
||||
/obj/item/weapon/rig/eva/equipped
|
||||
|
||||
|
||||
req_access = list(access_engine_equip)
|
||||
|
||||
|
||||
initial_modules = list(
|
||||
/obj/item/rig_module/device/basicdrill,
|
||||
/obj/item/rig_module/maneuvering_jets,
|
||||
@@ -242,3 +242,31 @@
|
||||
/obj/item/rig_module/grenade_launcher,
|
||||
/obj/item/rig_module/mounted/taser
|
||||
)
|
||||
|
||||
/obj/item/weapon/rig/diving
|
||||
name = "diving suit control module"
|
||||
suit_type = "diving suit"
|
||||
desc = "A heavy rig designated for operations under the water, you are not sure what it is doing here however."
|
||||
icon_state = "diving_rig"
|
||||
armor = list(melee = 30, bullet = 10, laser = 20, energy = 25, bomb = 20, bio = 100, rad = 100)
|
||||
slowdown = 4
|
||||
offline_slowdown = 2
|
||||
offline_vision_restriction = TINT_HEAVY
|
||||
|
||||
chest_type = /obj/item/clothing/suit/space/rig/diving
|
||||
helm_type = /obj/item/clothing/head/helmet/space/rig/diving
|
||||
boot_type = /obj/item/clothing/shoes/magboots/rig/diving
|
||||
|
||||
allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank,/obj/item/device/suit_cooling_unit,/obj/item/weapon/storage/toolbox,/obj/item/weapon/storage/briefcase/inflatable,/obj/item/device/t_scanner,/obj/item/weapon/rcd)
|
||||
|
||||
req_access = list()
|
||||
req_one_access = list()
|
||||
|
||||
/obj/item/clothing/head/helmet/space/rig/diving
|
||||
species_restricted = list("Human")
|
||||
|
||||
/obj/item/clothing/suit/space/rig/diving
|
||||
species_restricted = list("Human")
|
||||
|
||||
/obj/item/clothing/shoes/magboots/rig/diving
|
||||
species_restricted = list("Human")
|
||||
@@ -48,7 +48,7 @@
|
||||
|
||||
var/datum/gas_mixture/environment
|
||||
if(loc)
|
||||
environment = loc.return_air_for_internal_lifeform()
|
||||
environment = loc.return_air_for_internal_lifeform(src)
|
||||
|
||||
if(environment)
|
||||
breath = environment.remove_volume(volume_needed)
|
||||
|
||||
@@ -13,8 +13,6 @@
|
||||
if(embedded_flag)
|
||||
handle_embedded_objects() //Moving with objects stuck in you can cause bad times.
|
||||
|
||||
|
||||
|
||||
var/health_deficiency = (100 - health)
|
||||
if(health_deficiency >= 40) tally += (health_deficiency / 25)
|
||||
|
||||
@@ -74,11 +72,13 @@
|
||||
if(tally > 0 && (CE_SPEEDBOOST in chem_effects))
|
||||
tally = max(0, tally-3)
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
if(T)
|
||||
tally += T.movement_cost
|
||||
|
||||
return (tally+config.human_delay)
|
||||
|
||||
|
||||
|
||||
|
||||
/mob/living/carbon/human/Allow_Spacemove(var/check_drift = 0)
|
||||
//Can we act?
|
||||
if(restrained()) return 0
|
||||
@@ -135,4 +135,4 @@
|
||||
. = 1
|
||||
|
||||
/mob/living/carbon/human/mob_negates_gravity()
|
||||
return (shoes && shoes.negates_gravity())
|
||||
return (shoes && shoes.negates_gravity())
|
||||
|
||||
@@ -464,3 +464,6 @@
|
||||
|
||||
/datum/species/proc/get_light_color(hair_style)
|
||||
return
|
||||
|
||||
/datum/species/proc/can_breathe_water()
|
||||
return FALSE
|
||||
@@ -238,6 +238,9 @@
|
||||
stamina = 90
|
||||
sprint_speed_factor = 1.25 //Evolved for rapid escapes from predators
|
||||
|
||||
/datum/species/skrell/can_breathe_water()
|
||||
return TRUE
|
||||
|
||||
/datum/species/diona
|
||||
name = "Diona"
|
||||
short_name = "dio"
|
||||
|
||||
Reference in New Issue
Block a user