initial changes

This commit is contained in:
kevinz000
2020-01-19 16:13:05 -07:00
parent fce73c84c7
commit 90fcb4cc14
6 changed files with 67 additions and 41 deletions
+6
View File
@@ -326,6 +326,12 @@
#define COMSIG_ACTION_TRIGGER "action_trigger" //from base of datum/action/proc/Trigger(): (datum/action)
#define COMPONENT_ACTION_BLOCK_TRIGGER 1
/*******Element signals*******/
// /datum/element/swimming
#define COMSIG_IS_SWIMMING "has_swimming_element"
#define IS_SWIMMING 1
/*******Non-Signal Component Related Defines*******/
//Redirection component init flags
+1 -1
View File
@@ -13,7 +13,7 @@
var/stealth = FALSE //if TRUE, does not appear on HUDs and health scans
var/diagnostics = TRUE //if TRUE, displays program list when scanned by nanite scanners
/datum/component/nanites/Initialize(amount = 100, cloud = 0)
if(!isliving(parent) && !istype(parent, /datum/nanite_cloud_backup))
return COMPONENT_INCOMPATIBLE
+23
View File
@@ -0,0 +1,23 @@
/// Just for marking when someone's swimming.
/datum/element/swimming
element_flags = ELEMENT_DETACH
/datum/element/swimming/Attach(datum/target)
if(!isliving(target))
return ELEMENT_INCOMPATIBLE
if((. = ..()) == ELEMENT_INCOMPATIBLE)
return
RegisterSignal(target, COMSIG_IS_SWIMMING, .proc/is_swimming)
RegisterSignal(target, COMSIG_MOVABLE_MOVED, .proc/check_valid)
/datum/element/swimming/Detach(datum/target)
. = ..()
UnregisterSignal(target, COMSIG_IS_SWIMMING)
/datum/element/swimming/proc/is_swimming()
return IS_SWIMMING
/datum/element/swimming/proc/check_valid(datum/source)
var/mob/living/L = source
if(!istype(L.loc, /turf/open/pool))
source.RemoveElement(/datum/elemtn/swimming)
+21 -17
View File
@@ -5,20 +5,10 @@
icon_state = "pool_tile"
heat_capacity = INFINITY
var/filled = TRUE
var/next_splash = 1
var/obj/effect/overlay/water/watereffect
var/obj/effect/overlay/water/top/watertop
var/next_splash = 0
var/obj/machinery/pool/controller/controller
/turf/open/pool/Initialize()
watereffect = new /obj/effect/overlay/water(src)
watertop = new /obj/effect/overlay/water/top(src)
. = ..()
/turf/open/pool/Destroy()
QDEL_NULL(watereffect)
QDEL_NULL(watertop)
controller = null
return ..()
@@ -26,13 +16,13 @@
if(!filled)
name = "drained pool"
desc = "No diving!"
QDEL_NULL(watereffect)
QDEL_NULL(watertop)
cut_overlay(/obj/effect/overlay/water)
cut_overlay(/obj/effect/overlay/water/top)
else
name = "poolwater"
desc = "You're safer here than in the deep."
watereffect = new /obj/effect/overlay/water(src)
watertop = new /obj/effect/overlay/water/top(src)
add_overlay(/obj/effect/overlay/water)
add_overlay(/obj/effect/overlay/water/top)
/obj/effect/overlay/water
name = "water"
@@ -47,8 +37,22 @@
icon_state = "top"
layer = BELOW_MOB_LAYER
/mob/living
var/swimming = FALSE
/turf/open/MouseDrop_T(atom/from, mob/user)
if(SEND_SIGNAL(from, COMSIG_IS_SWIMMING) && isliving(user) && ((user == from) || user.CanReach(from)) && CHECK_MOBILITY(user, MOBILITY_USE))
var/mob/living/L = from
//The element only exists if you're on water and a living mob, so let's skip those checks.
if(user == from)
from.visible_message("<span class='notice'>[from] is getting out of the pool.</span>")
if(do_mob(user, from, 20))
from.forceMove(src)
from.visible_message("<span class='notice'>[from] gets out of the pool.</span>")
else
from.visible_message("<span class='notice'>[from] is being pulled out of the pool by [user].</span>")
if(do_mob(user, from, 20))
from.forceMove(src)
from.visible_message("<span class='notice'>[user] pulls [from] out of the pool.</span>")
else
return ..()
//Put people out of the water
/turf/open/floor/MouseDrop_T(mob/living/M, mob/living/user)
+4 -16
View File
@@ -16,29 +16,17 @@
righthand_file = 'icons/mob/inhands/items_righthand.dmi'
/obj/item/toy/poolnoodle/attack(target as mob, mob/living/user as mob)
..()
if(prob(80))
user.emote("spin")
if(prob(5))
user.emote("spin")
. = ..()
user.spin(prob(20)? 16 : 8, 1)
/obj/item/toy/poolnoodle/red
item_state = "noodlered"
color = "#ff4c4c"
/obj/item/toy/poolnoodle/blue
item_state = "noodleblue"
color = "#3232ff"
/obj/item/toy/poolnoodle/yellow
item_state = "noodleyellow"
/obj/item/toy/poolnoodle/red/Initialize()
. = ..()
color = "#ff4c4c"
/obj/item/toy/poolnoodle/blue/Initialize()
. = ..()
color = "#3232ff"
/obj/item/toy/poolnoodle/yellow/Initialize()
. = ..()
color = "#ffff66"
+12 -7
View File
@@ -11,13 +11,18 @@
layer = ABOVE_MOB_LAYER
dir = EAST
/obj/structure/pool/ladder/attack_hand(mob/living/user as mob)
if(Adjacent(user) && user.y == y && user.swimming == 0)
user.swimming = TRUE
user.forceMove(get_step(user, get_dir(user, src))) //Either way, you're getting IN or OUT of the pool.
else if(user.loc == loc && user.swimming == TRUE)
user.swimming = FALSE
user.forceMove(get_step(user, turn(dir, 180)))
/obj/structure/pool/ladder/attack_hand(mob/living/user)
. = ..()
if(.)
return
var/is_swimming = SEND_SIGNAL(user, COMSIG_IS_SWIMMING)
if(!is_swimming)
if(user.CanReach(src))
user.AddElement(/datum/element/swimming)
user.forceMove(get_step(src, dir))
else
if(user.loc == loc)
user.forceMove(get_step(src, turn(dir, 180))) //If this moves them out the element cleans up after itself.
/obj/structure/pool/Rboard
name = "JumpBoard"