[s] Fixes altclick exploits

This commit is contained in:
ShizCalev
2018-02-11 05:08:00 -06:00
committed by CitadelStationBot
parent 7f7bea7468
commit f4685cfe01
60 changed files with 660 additions and 129 deletions
+2 -2
View File
@@ -90,7 +90,7 @@
return ..()
/obj/item/clothing/AltClick(mob/user)
if(pockets && pockets.quickdraw && pockets.contents.len && !user.incapacitated())
if(istype(user) && user.canUseTopic(src, BE_CLOSE, ismonkey(user)) && pockets && pockets.quickdraw && pockets.contents.len)
var/obj/item/I = pockets.contents[1]
if(!I)
return
@@ -244,7 +244,7 @@ BLIND // can't see anything
if(..())
return 1
if(!user.canUseTopic(src, be_close=TRUE))
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
else
+1 -1
View File
@@ -87,7 +87,7 @@
to_chat(user, "<span class='notice'>Alt-click to take a candy corn.</span>")
/obj/item/clothing/head/fedora/det_hat/AltClick(mob/user)
if(user.canUseTopic(src, be_close=TRUE))
if(user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
..()
if(loc == user)
if(candy_cooldown < world.time)
+134
View File
@@ -1,3 +1,4 @@
<<<<<<< HEAD
/obj/item/clothing/head/soft
name = "cargo cap"
desc = "It's a baseball hat in a tasteless yellow colour."
@@ -130,3 +131,136 @@
icon_state = "emtsoft"
item_color = "emt"
dog_fashion = null
=======
/obj/item/clothing/head/soft
name = "cargo cap"
desc = "It's a baseball hat in a tasteless yellow colour."
icon_state = "cargosoft"
item_state = "helmet"
item_color = "cargo"
dog_fashion = /datum/dog_fashion/head/cargo_tech
var/flipped = 0
/obj/item/clothing/head/soft/dropped()
src.icon_state = "[item_color]soft"
src.flipped=0
..()
/obj/item/clothing/head/soft/verb/flipcap()
set category = "Object"
set name = "Flip cap"
flip(usr)
/obj/item/clothing/head/soft/AltClick(mob/user)
..()
if(!user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
else
flip(user)
/obj/item/clothing/head/soft/proc/flip(mob/user)
if(!user.incapacitated())
src.flipped = !src.flipped
if(src.flipped)
icon_state = "[item_color]soft_flipped"
to_chat(user, "<span class='notice'>You flip the hat backwards.</span>")
else
icon_state = "[item_color]soft"
to_chat(user, "<span class='notice'>You flip the hat back in normal position.</span>")
usr.update_inv_head() //so our mob-overlays update
/obj/item/clothing/head/soft/examine(mob/user)
..()
to_chat(user, "<span class='notice'>Alt-click the cap to flip it [flipped ? "forwards" : "backwards"].</span>")
/obj/item/clothing/head/soft/red
name = "red cap"
desc = "It's a baseball hat in a tasteless red colour."
icon_state = "redsoft"
item_color = "red"
dog_fashion = null
/obj/item/clothing/head/soft/blue
name = "blue cap"
desc = "It's a baseball hat in a tasteless blue colour."
icon_state = "bluesoft"
item_color = "blue"
dog_fashion = null
/obj/item/clothing/head/soft/green
name = "green cap"
desc = "It's a baseball hat in a tasteless green colour."
icon_state = "greensoft"
item_color = "green"
dog_fashion = null
/obj/item/clothing/head/soft/yellow
name = "yellow cap"
desc = "It's a baseball hat in a tasteless yellow colour."
icon_state = "yellowsoft"
item_color = "yellow"
dog_fashion = null
/obj/item/clothing/head/soft/grey
name = "grey cap"
desc = "It's a baseball hat in a tasteful grey colour."
icon_state = "greysoft"
item_color = "grey"
dog_fashion = null
/obj/item/clothing/head/soft/orange
name = "orange cap"
desc = "It's a baseball hat in a tasteless orange colour."
icon_state = "orangesoft"
item_color = "orange"
dog_fashion = null
/obj/item/clothing/head/soft/mime
name = "white cap"
desc = "It's a baseball hat in a tasteless white colour."
icon_state = "mimesoft"
item_color = "mime"
dog_fashion = null
/obj/item/clothing/head/soft/purple
name = "purple cap"
desc = "It's a baseball hat in a tasteless purple colour."
icon_state = "purplesoft"
item_color = "purple"
dog_fashion = null
/obj/item/clothing/head/soft/black
name = "black cap"
desc = "It's a baseball hat in a tasteless black colour."
icon_state = "blacksoft"
item_color = "black"
dog_fashion = null
/obj/item/clothing/head/soft/rainbow
name = "rainbow cap"
desc = "It's a baseball hat in a bright rainbow of colors."
icon_state = "rainbowsoft"
item_color = "rainbow"
dog_fashion = null
/obj/item/clothing/head/soft/sec
name = "security cap"
desc = "It's a robust baseball hat in tasteful red colour."
icon_state = "secsoft"
item_color = "sec"
armor = list(melee = 30, bullet = 25, laser = 25, energy = 10, bomb = 25, bio = 0, rad = 0, fire = 20, acid = 50)
strip_delay = 60
dog_fashion = null
/obj/item/clothing/head/soft/emt
name = "EMT cap"
desc = "It's a baseball hat with a dark turquoise color and a reflective cross on the top."
icon_state = "emtsoft"
item_color = "emt"
dog_fashion = null
>>>>>>> bfde5ac... [s] Fixes altclick exploits (#35456)
+1 -2
View File
@@ -23,8 +23,7 @@ obj/item/clothing/mask/breath/suicide_act(mob/living/carbon/user)
/obj/item/clothing/mask/breath/AltClick(mob/user)
..()
if(!user.canUseTopic(src, be_close=TRUE))
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
if(!user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
else
adjustmask(user)
+1 -2
View File
@@ -93,8 +93,7 @@
/obj/item/clothing/suit/toggle/AltClick(mob/user)
..()
if(!user.canUseTopic(src, be_close=TRUE))
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
if(!user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
else
suit_toggle(user)
+1 -1
View File
@@ -69,7 +69,7 @@
return
/obj/item/clothing/accessory/AltClick(mob/user)
if(user.canUseTopic(src, be_close=TRUE))
if(istype(user) && user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
if(initial(above_suit))
above_suit = !above_suit
to_chat(user, "[src] will be worn [above_suit ? "above" : "below"] your suit.")