Merge pull request #4612 from VOREStation/upstream-merge-5770

[MIRROR] Standardizes rotation verbs
This commit is contained in:
Novacat
2019-03-27 03:40:04 -04:00
committed by GitHub
22 changed files with 647 additions and 668 deletions
@@ -34,10 +34,10 @@
else
on = 1
icon_state = "echair1"
usr << "<span class='notice'>You switch [on ? "on" : "off"] [src].</span>"
to_chat(usr, "<span class='notice'>You switch [on ? "on" : "off"] [src].</span>")
return
/obj/structure/bed/chair/e_chair/rotate()
/obj/structure/bed/chair/e_chair/rotate_clockwise()
..()
overlays.Cut()
overlays += image('icons/obj/objects.dmi', src, "echair_over", MOB_LAYER + 1, dir) //there's probably a better way of handling this, but eh. -Pete
+11 -14
View File
@@ -115,23 +115,20 @@
return
/obj/structure/gravemarker/verb/rotate()
set name = "Rotate Grave Marker"
/obj/structure/gravemarker/verb/rotate_clockwise()
set name = "Rotate Grave Marker Clockwise"
set category = "Object"
set src in oview(1)
if(anchored)
return
if(config.ghost_interaction)
src.set_dir(turn(src.dir, 90))
return
else
if(ismouse(usr))
return
if(!usr || !isturf(usr.loc))
return
if(usr.stat || usr.restrained())
return
src.set_dir(turn(src.dir, 90))
return
if(!usr || !isturf(usr.loc))
return
if(usr.stat || usr.restrained())
return
if(ismouse(usr) || (isobserver(usr) && !config.ghost_interaction))
return
src.set_dir(turn(src.dir, 270))
return
+10 -14
View File
@@ -210,12 +210,12 @@
else
tempo = sanitize_tempo(5) // default 120 BPM
if(lines.len > INSTRUMENT_MAX_LINE_NUMBER)
usr << "Too many lines!"
to_chat(usr, "Too many lines!")
lines.Cut(INSTRUMENT_MAX_LINE_NUMBER+1)
var/linenum = 1
for(var/l in lines)
if(lentext(l) > INSTRUMENT_MAX_LINE_LENGTH)
usr << "Line [linenum] too long!"
to_chat(usr, "Line [linenum] too long!")
lines.Remove(l)
else
linenum++
@@ -316,22 +316,18 @@
song = null
..()
/obj/structure/device/piano/verb/rotate()
set name = "Rotate Piano"
/obj/structure/device/piano/verb/rotate_clockwise()
set name = "Rotate Piano Clockwise"
set category = "Object"
set src in oview(1)
if(istype(usr,/mob/living/simple_mob/animal/passive/mouse))
if(ismouse(usr))
return
else if(!usr || !isturf(usr.loc))
if(!usr || !isturf(usr.loc) || usr.stat || usr.restrained())
return
else if(usr.stat || usr.restrained())
return
else if (istype(usr,/mob/observer/ghost) && !config.ghost_interaction)
return
else
src.set_dir(turn(src.dir, 90))
if (isobserver(usr) && !config.ghost_interaction)
return
src.set_dir(turn(src.dir, 270))
/obj/structure/device/piano/attack_hand(mob/user)
if(!user.IsAdvancedToolUser())
@@ -350,7 +346,7 @@
if(O.is_wrench())
if(anchored)
playsound(src.loc, O.usesound, 50, 1)
user << "<span class='notice'>You begin to loosen \the [src]'s casters...</span>"
to_chat(user, "<span class='notice'>You begin to loosen \the [src]'s casters...</span>")
if (do_after(user, 40 * O.toolspeed))
user.visible_message( \
"[user] loosens \the [src]'s casters.", \
@@ -359,7 +355,7 @@
src.anchored = 0
else
playsound(src.loc, O.usesound, 50, 1)
user << "<span class='notice'>You begin to tighten \the [src] to the floor...</span>"
to_chat(user, "<span class='notice'>You begin to tighten \the [src] to the floor...</span>")
if (do_after(user, 20 * O.toolspeed))
user.visible_message( \
"[user] tightens \the [src]'s casters.", \
+4 -4
View File
@@ -126,7 +126,7 @@
if (WEST)
overlays += image ('icons/obj/railing.dmi', src, "mcorneroverlay", pixel_y = 32)
/obj/structure/railing/verb/rotate()
/obj/structure/railing/verb/rotate_counterclockwise()
set name = "Rotate Railing Counter-Clockwise"
set category = "Object"
set src in oview(1)
@@ -141,11 +141,11 @@
to_chat(usr, "It is fastened to the floor therefore you can't rotate it!")
return 0
set_dir(turn(dir, 90))
src.set_dir(turn(src.dir, 90))
update_icon()
return
/obj/structure/railing/verb/revrotate()
/obj/structure/railing/verb/rotate_clockwise()
set name = "Rotate Railing Clockwise"
set category = "Object"
set src in oview(1)
@@ -160,7 +160,7 @@
to_chat(usr, "It is fastened to the floor therefore you can't rotate it!")
return 0
set_dir(turn(dir, -90))
src.set_dir(turn(src.dir, 270))
update_icon()
return
@@ -20,7 +20,7 @@
if(!padding_material && istype(W, /obj/item/assembly/shock_kit))
var/obj/item/assembly/shock_kit/SK = W
if(!SK.status)
user << "<span class='notice'>\The [SK] is not ready to be attached!</span>"
to_chat(user, "<span class='notice'>\The [SK] is not ready to be attached!</span>")
return
user.drop_item()
var/obj/structure/bed/chair/e_chair/E = new (src.loc, material.name)
@@ -35,7 +35,7 @@
if(has_buckled_mobs())
..()
else
rotate()
rotate_clockwise()
return
/obj/structure/bed/chair/post_buckle_mob()
@@ -68,24 +68,19 @@
var/mob/living/L = A
L.set_dir(dir)
/obj/structure/bed/chair/verb/rotate()
set name = "Rotate Chair"
/obj/structure/bed/chair/verb/rotate_clockwise()
set name = "Rotate Chair Clockwise"
set category = "Object"
set src in oview(1)
if(config.ghost_interaction)
src.set_dir(turn(src.dir, 90))
if(!usr || !isturf(usr.loc))
return
if(usr.stat || usr.restrained())
return
if(ismouse(usr) || (isobserver(usr) && !config.ghost_interaction))
return
else
if(istype(usr,/mob/living/simple_mob/animal/passive/mouse))
return
if(!usr || !isturf(usr.loc))
return
if(usr.stat || usr.restrained())
return
src.set_dir(turn(src.dir, 90))
return
src.set_dir(turn(src.dir, 270))
/obj/structure/bed/chair/shuttle
name = "chair"
@@ -273,8 +273,8 @@ obj/structure/windoor_assembly/Destroy()
name += "[secure ? "secure " : ""]windoor assembly[created_name ? " ([created_name])" : ""]"
//Rotates the windoor assembly clockwise
/obj/structure/windoor_assembly/verb/revrotate()
set name = "Rotate Windoor Assembly"
/obj/structure/windoor_assembly/verb/rotate_clockwise()
set name = "Rotate Windoor Assembly Clockwise"
set category = "Object"
set src in oview(1)
+24 -24
View File
@@ -27,24 +27,24 @@
. = ..(user)
if(health == maxhealth)
user << "<span class='notice'>It looks fully intact.</span>"
to_chat(user, "<span class='notice'>It looks fully intact.</span>")
else
var/perc = health / maxhealth
if(perc > 0.75)
user << "<span class='notice'>It has a few cracks.</span>"
to_chat(user, "<span class='notice'>It has a few cracks.</span>")
else if(perc > 0.5)
user << "<span class='warning'>It looks slightly damaged.</span>"
to_chat(user, "<span class='warning'>It looks slightly damaged.</span>")
else if(perc > 0.25)
user << "<span class='warning'>It looks moderately damaged.</span>"
to_chat(user, "<span class='warning'>It looks moderately damaged.</span>")
else
user << "<span class='danger'>It looks heavily damaged.</span>"
to_chat(user, "<span class='danger'>It looks heavily damaged.</span>")
if(silicate)
if (silicate < 30)
user << "<span class='notice'>It has a thin layer of silicate.</span>"
to_chat(user, "<span class='notice'>It has a thin layer of silicate.</span>")
else if (silicate < 70)
user << "<span class='notice'>It is covered in silicate.</span>"
to_chat(user, "<span class='notice'>It is covered in silicate.</span>")
else
user << "<span class='notice'>There is a thick layer of silicate covering it.</span>"
to_chat(user, "<span class='notice'>There is a thick layer of silicate covering it.</span>")
/obj/structure/window/proc/take_damage(var/damage = 0, var/sound_effect = 1)
var/initialhealth = health
@@ -262,26 +262,26 @@
state = 3 - state
update_nearby_icons()
playsound(src, W.usesound, 75, 1)
user << (state == 1 ? "<span class='notice'>You have unfastened the window from the frame.</span>" : "<span class='notice'>You have fastened the window to the frame.</span>")
to_chat(user, "<span class='notice'>You have [state ? "un" : ""]fastened the window [state ? "from" : "to"] the frame.</span>")
else if(reinf && state == 0)
anchored = !anchored
update_nearby_icons()
update_verbs()
playsound(src, W.usesound, 75, 1)
user << (anchored ? "<span class='notice'>You have fastened the frame to the floor.</span>" : "<span class='notice'>You have unfastened the frame from the floor.</span>")
to_chat(user, "<span class='notice'>You have [anchored ? "" : "un"]fastened the frame [anchored ? "to" : "from"] the floor.</span>")
else if(!reinf)
anchored = !anchored
update_nearby_icons()
update_verbs()
playsound(src, W.usesound, 75, 1)
user << (anchored ? "<span class='notice'>You have fastened the window to the floor.</span>" : "<span class='notice'>You have unfastened the window.</span>")
to_chat(user, "<span class='notice'>You have [anchored ? "" : "un"]fastened the window [anchored ? "to" : "from"] the floor.</span>")
else if(W.is_crowbar() && reinf && state <= 1)
state = 1 - state
playsound(src, W.usesound, 75, 1)
user << (state ? "<span class='notice'>You have pried the window into the frame.</span>" : "<span class='notice'>You have pried the window out of the frame.</span>")
to_chat(user, "<span class='notice'>You have pried the window [state ? "into" : "out of"] the frame.</span>")
else if(W.is_wrench() && !anchored && (!state || !reinf))
if(!glasstype)
user << "<span class='notice'>You're not sure how to dismantle \the [src] properly.</span>"
to_chat(user, "<span class='notice'>You're not sure how to dismantle \the [src] properly.</span>")
else
playsound(src, W.usesound, 75, 1)
visible_message("<span class='notice'>[user] dismantles \the [src].</span>")
@@ -329,8 +329,8 @@
return
/obj/structure/window/proc/rotate()
set name = "Rotate Window Counter-Clockwise"
/obj/structure/window/verb/rotate_counterclockwise()
set name = "Rotate Window Counterclockwise"
set category = "Object"
set src in oview(1)
@@ -341,17 +341,17 @@
return 0
if(anchored)
usr << "It is fastened to the floor therefore you can't rotate it!"
to_chat(usr, "It is fastened to the floor therefore you can't rotate it!")
return 0
update_nearby_tiles(need_rebuild=1) //Compel updates before
set_dir(turn(dir, 90))
src.set_dir(turn(src.dir, 90))
updateSilicate()
update_nearby_tiles(need_rebuild=1)
return
/obj/structure/window/proc/revrotate()
/obj/structure/window/verb/rotate_clockwise()
set name = "Rotate Window Clockwise"
set category = "Object"
set src in oview(1)
@@ -363,11 +363,11 @@
return 0
if(anchored)
usr << "It is fastened to the floor therefore you can't rotate it!"
to_chat(usr, "It is fastened to the floor therefore you can't rotate it!")
return 0
update_nearby_tiles(need_rebuild=1) //Compel updates before
set_dir(turn(dir, 270))
src.set_dir(turn(src.dir, 270))
updateSilicate()
update_nearby_tiles(need_rebuild=1)
return
@@ -420,11 +420,11 @@
//Updates the availabiliy of the rotation verbs
/obj/structure/window/proc/update_verbs()
if(anchored || is_fulltile())
verbs -= /obj/structure/window/proc/rotate
verbs -= /obj/structure/window/proc/revrotate
verbs -= /obj/structure/window/verb/rotate_counterclockwise
verbs -= /obj/structure/window/verb/rotate_clockwise
else if(!is_fulltile())
verbs += /obj/structure/window/proc/rotate
verbs += /obj/structure/window/proc/revrotate
verbs += /obj/structure/window/verb/rotate_counterclockwise
verbs += /obj/structure/window/verb/rotate_clockwise
//merges adjacent full-tile windows into one (blatant ripoff from game/smoothwall.dm)
/obj/structure/window/update_icon()