farie fixes

This commit is contained in:
S34NW
2021-09-11 11:18:39 +01:00
parent 235ee0c4ac
commit fa8d8515af
3 changed files with 55 additions and 55 deletions
+30 -28
View File
@@ -51,6 +51,7 @@
/obj/structure/fence/cut/medium
icon_state = "straight_cut2"
hole_size = MEDIUM_HOLE
climbable = TRUE
/obj/structure/fence/cut/large
icon_state = "straight_cut3"
@@ -65,10 +66,11 @@
return TRUE
return FALSE
// shock user with probability prb (if all connections & power are working)
// returns 1 if shocked, 0 otherwise
// Totally not stolen from code\game\objects\structures\grille.dm
/*
Shock user with probability prb (if all connections & power are working)
Returns TRUE if shocked, FALSE otherwise
Totally not stolen from code\game\objects\structures\grille.dm
*/
/obj/structure/fence/proc/shock(mob/user, prb)
if(!prob(prb))
return FALSE
@@ -101,22 +103,21 @@
if(NO_HOLE)
visible_message("<span class='notice'>\The [user] cuts into \the [src] some more.</span>")
to_chat(user, "<span class='info'>You could probably fit yourself through that hole now. Although climbing through would be much faster if you made it even bigger.</span>")
climbable = TRUE
++hole_size
hole_size = MEDIUM_HOLE
if(MEDIUM_HOLE)
visible_message("<span class='notice'>\The [user] completely cuts through \the [src].</span>")
to_chat(user, "<span class='info'>The hole in \the [src] is now big enough to walk through.</span>")
climbable = FALSE
++hole_size
hole_size = LARGE_HOLE
if(LARGE_HOLE)
visible_message("<span class='notice'>\The [user] completely dismantles \the [src].</span>")
to_chat(user, "<span class='info'>You completely take apart \the [src].</span>")
qdel(src)
return
update_cut_status()
return
/obj/structure/fence/attackby(obj/item/C, mob/user)
if(shock(user, 90))
return
if(istype(C, /obj/item/stack/rods))
if(hole_size == NO_HOLE)
return
@@ -125,26 +126,23 @@
to_chat(user, "<span class='warning'>You need [HOLE_REPAIR] rods to fix this fence!</span>")
return
to_chat(user, "<span class='notice'>You begin repairing the fence...</span>")
if(do_after(user, 30 * C.toolspeed, target = src))
if(R.get_amount() >= HOLE_REPAIR && !(hole_size == NO_HOLE))
R.use(HOLE_REPAIR)
playsound(src, C.usesound, 80, 1)
hole_size = NO_HOLE
obj_integrity = max_integrity
to_chat(user, "<span class='notice'>You repair the fence.</span>")
update_cut_status()
return
. = ..()
if(shock(user, 90))
if(do_after(user, 3 SECONDS * C.toolspeed, target = src) && hole_size != NO_HOLE && R.use(HOLE_REPAIR))
playsound(src, C.usesound, 80, 1)
hole_size = NO_HOLE
obj_integrity = max_integrity
to_chat(user, "<span class='notice'>You repair the fence.</span>")
update_cut_status()
return
. = ..()
/obj/structure/fence/Bumped(atom/user)
if(ismob(user))
if(shock_cooldown)
return
shock(user, 70)
shock_cooldown = TRUE // We do not want bump shock spam!
addtimer(CALLBACK(src, .proc/shock_cooldown), 1 SECONDS, TIMER_UNIQUE | TIMER_OVERRIDE)
if(!ismob(user))
return
if(shock_cooldown)
return
shock(user, 70)
shock_cooldown = TRUE // We do not want bump shock spam!
addtimer(CALLBACK(src, .proc/shock_cooldown), 1 SECONDS, TIMER_UNIQUE | TIMER_OVERRIDE)
/obj/structure/fence/proc/shock_cooldown()
shock_cooldown = FALSE
@@ -161,11 +159,14 @@
switch(hole_size)
if(NO_HOLE)
icon_state = initial(icon_state)
climbable = FALSE
if(MEDIUM_HOLE)
icon_state = "straight_cut2"
climbable = TRUE
if(LARGE_HOLE)
icon_state = "straight_cut3"
new_density = FALSE
climbable = FALSE
set_density(new_density)
//FENCE DOORS
@@ -199,8 +200,8 @@
playsound(src, 'sound/machines/door_open.ogg', 100, TRUE)
/obj/structure/fence/door/proc/update_door_status()
set_density(!density)
icon_state = density ? "door_closed" : "door_opened"
set_density(!open)
icon_state = open ? "door_opened" : "door_closed"
/obj/structure/fence/door/proc/can_open(mob/user)
return TRUE
@@ -212,3 +213,4 @@
#undef MEDIUM_HOLE
#undef LARGE_HOLE
#undef MAX_HOLE_SIZE
#undef HOLE_REPAIR
+19 -26
View File
@@ -15,34 +15,30 @@
density = FALSE
climbable = FALSE
/obj/structure/railing/Initialize()
. = ..()
/obj/structure/railing/attackby(obj/item/I, mob/living/user, params)
..()
add_fingerprint(user)
/obj/structure/railing/welder_act(mob/living/user, obj/item/I)
if(user.intent == INTENT_HELP)
if(obj_integrity < max_integrity)
if(!I.tool_start_check(user, amount = 0))
return
to_chat(user, "<span class='notice'>You begin repairing [src]...</span>")
if(I.use_tool(src, user, 40, volume = 50))
obj_integrity = max_integrity
to_chat(user, "<span class='notice'>You repair [src].</span>")
return
if(user.intent != INTENT_HELP)
return
if(obj_integrity >= max_integrity)
to_chat(user, "<span class='warning'>[src] is already in good condition!</span>")
return
if(!I.tool_start_check(user, amount = 0))
return
to_chat(user, "<span class='notice'>You begin repairing [src]...</span>")
if(I.use_tool(src, user, 40, volume = 50))
obj_integrity = max_integrity
to_chat(user, "<span class='notice'>You repair [src].</span>")
/obj/structure/railing/wirecutter_act(mob/living/user, obj/item/I)
. = ..()
if(!anchored)
to_chat(user, "<span class='warning'>You cut apart the railing.</span>")
I.play_tool_sound(src, 100)
deconstruct()
return TRUE
if(anchored)
return
to_chat(user, "<span class='warning'>You cut apart the railing.</span>")
I.play_tool_sound(src, 100)
deconstruct()
return TRUE
/obj/structure/railing/deconstruct(disassembled)
if(!(flags & NODECONSTRUCT))
@@ -52,15 +48,11 @@
///Implements behaviour that makes it possible to unanchor the railing.
/obj/structure/railing/wrench_act(mob/living/user, obj/item/I)
. = ..()
if(flags & NODECONSTRUCT)
return
to_chat(user, "<span class='notice'>You begin to [anchored ? "unfasten the railing from":"fasten the railing to"] the floor...</span>")
if(I.use_tool(src, user, volume = 75, extra_checks = CALLBACK(src, .proc/check_anchored, anchored)))
if(!anchored)
anchored = TRUE
else
anchored = FALSE
anchored = !anchored
to_chat(user, "<span class='notice'>You [anchored ? "fasten the railing to":"unfasten the railing from"] the floor.</span>")
return TRUE
@@ -92,7 +84,7 @@
if(istype(O, /obj/item/projectile))
return TRUE
if(ismob(O))
if(M.flying | M.floating)
if(M.flying || M.floating)
return TRUE
if(O.throwing)
return TRUE
@@ -115,9 +107,10 @@
/obj/structure/railing/do_climb(mob/living/user)
. = ..()
if(!climbable)
return
return FALSE
if(get_turf(user) == get_turf(src))
currently_climbed = TRUE
return TRUE
/obj/structure/railing/proc/can_be_rotated(mob/user)
if(anchored)