[s] Fixes altclick exploits
This commit is contained in:
committed by
CitadelStationBot
parent
7f7bea7468
commit
f4685cfe01
@@ -160,7 +160,7 @@
|
||||
access_display(user)
|
||||
|
||||
/obj/item/clockwork/slab/AltClick(mob/living/user)
|
||||
if(is_servant_of_ratvar(user) && linking)
|
||||
if(is_servant_of_ratvar(user) && linking && user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
linking = null
|
||||
to_chat(user, "<span class='notice'>Object link canceled.</span>")
|
||||
|
||||
|
||||
@@ -94,10 +94,10 @@
|
||||
|
||||
/mob/living/carbon/true_devil/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE)
|
||||
if(incapacitated())
|
||||
return 0
|
||||
return FALSE
|
||||
if(be_close && !in_range(M, src))
|
||||
return 0
|
||||
return 1
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/mob/living/carbon/true_devil/assess_threat(judgement_criteria, lasercolor = "", datum/callback/weaponcheck=null)
|
||||
return 666
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<<<<<<< HEAD
|
||||
|
||||
//Apprenticeship contract - moved to antag_spawner.dm
|
||||
|
||||
@@ -409,3 +410,416 @@
|
||||
/obj/effect/temp_visual/tornado/Initialize()
|
||||
. = ..()
|
||||
animate(src, pixel_x = -500, time = 40)
|
||||
=======
|
||||
|
||||
//Apprenticeship contract - moved to antag_spawner.dm
|
||||
|
||||
///////////////////////////Veil Render//////////////////////
|
||||
|
||||
/obj/item/veilrender
|
||||
name = "veil render"
|
||||
desc = "A wicked curved blade of alien origin, recovered from the ruins of a vast city."
|
||||
icon = 'icons/obj/wizard.dmi'
|
||||
icon_state = "render"
|
||||
item_state = "knife"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/kitchen_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/kitchen_righthand.dmi'
|
||||
force = 15
|
||||
throwforce = 10
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
var/charges = 1
|
||||
var/spawn_type = /obj/singularity/wizard
|
||||
var/spawn_amt = 1
|
||||
var/activate_descriptor = "reality"
|
||||
var/rend_desc = "You should run now."
|
||||
var/spawn_fast = 0 //if 1, ignores checking for mobs on loc before spawning
|
||||
|
||||
/obj/item/veilrender/attack_self(mob/user)
|
||||
if(charges > 0)
|
||||
new /obj/effect/rend(get_turf(user), spawn_type, spawn_amt, rend_desc, spawn_fast)
|
||||
charges--
|
||||
user.visible_message("<span class='boldannounce'>[src] hums with power as [user] deals a blow to [activate_descriptor] itself!</span>")
|
||||
else
|
||||
to_chat(user, "<span class='danger'>The unearthly energies that powered the blade are now dormant.</span>")
|
||||
|
||||
/obj/effect/rend
|
||||
name = "tear in the fabric of reality"
|
||||
desc = "You should run now."
|
||||
icon = 'icons/effects/effects.dmi'
|
||||
icon_state = "rift"
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
var/spawn_path = /mob/living/simple_animal/cow //defaulty cows to prevent unintentional narsies
|
||||
var/spawn_amt_left = 20
|
||||
var/spawn_fast = 0
|
||||
|
||||
/obj/effect/rend/New(loc, var/spawn_type, var/spawn_amt, var/desc, var/spawn_fast)
|
||||
src.spawn_path = spawn_type
|
||||
src.spawn_amt_left = spawn_amt
|
||||
src.desc = desc
|
||||
src.spawn_fast = spawn_fast
|
||||
START_PROCESSING(SSobj, src)
|
||||
return
|
||||
|
||||
/obj/effect/rend/process()
|
||||
if(!spawn_fast)
|
||||
if(locate(/mob) in loc)
|
||||
return
|
||||
new spawn_path(loc)
|
||||
spawn_amt_left--
|
||||
if(spawn_amt_left <= 0)
|
||||
qdel(src)
|
||||
|
||||
/obj/effect/rend/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/nullrod))
|
||||
user.visible_message("<span class='danger'>[user] seals \the [src] with \the [I].</span>")
|
||||
qdel(src)
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/effect/rend/singularity_pull()
|
||||
return
|
||||
|
||||
/obj/effect/rend/singularity_pull()
|
||||
return
|
||||
|
||||
/obj/item/veilrender/vealrender
|
||||
name = "veal render"
|
||||
desc = "A wicked curved blade of alien origin, recovered from the ruins of a vast farm."
|
||||
spawn_type = /mob/living/simple_animal/cow
|
||||
spawn_amt = 20
|
||||
activate_descriptor = "hunger"
|
||||
rend_desc = "Reverberates with the sound of ten thousand moos."
|
||||
|
||||
/obj/item/veilrender/honkrender
|
||||
name = "honk render"
|
||||
desc = "A wicked curved blade of alien origin, recovered from the ruins of a vast circus."
|
||||
spawn_type = /mob/living/simple_animal/hostile/retaliate/clown
|
||||
spawn_amt = 10
|
||||
activate_descriptor = "depression"
|
||||
rend_desc = "Gently wafting with the sounds of endless laughter."
|
||||
icon_state = "clownrender"
|
||||
|
||||
////TEAR IN REALITY
|
||||
|
||||
/obj/singularity/wizard
|
||||
name = "tear in the fabric of reality"
|
||||
desc = "This isn't right."
|
||||
icon = 'icons/effects/224x224.dmi'
|
||||
icon_state = "reality"
|
||||
pixel_x = -96
|
||||
pixel_y = -96
|
||||
grav_pull = 6
|
||||
consume_range = 3
|
||||
current_size = STAGE_FOUR
|
||||
allowed_size = STAGE_FOUR
|
||||
|
||||
/obj/singularity/wizard/process()
|
||||
move()
|
||||
eat()
|
||||
return
|
||||
/////////////////////////////////////////Scrying///////////////////
|
||||
|
||||
/obj/item/scrying
|
||||
name = "scrying orb"
|
||||
desc = "An incandescent orb of otherworldly energy, staring into it gives you vision beyond mortal means."
|
||||
icon = 'icons/obj/projectiles.dmi'
|
||||
icon_state ="bluespace"
|
||||
throw_speed = 3
|
||||
throw_range = 7
|
||||
throwforce = 15
|
||||
damtype = BURN
|
||||
force = 15
|
||||
hitsound = 'sound/items/welder2.ogg'
|
||||
|
||||
var/xray_granted = FALSE
|
||||
|
||||
/obj/item/scrying/equipped(mob/user)
|
||||
if(!xray_granted && ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(!(H.dna.check_mutation(XRAY)))
|
||||
H.dna.add_mutation(XRAY)
|
||||
xray_granted = TRUE
|
||||
. = ..()
|
||||
|
||||
/obj/item/scrying/attack_self(mob/user)
|
||||
to_chat(user, "<span class='notice'>You can see...everything!</span>")
|
||||
visible_message("<span class='danger'>[user] stares into [src], their eyes glazing over.</span>")
|
||||
user.ghostize(1)
|
||||
|
||||
/////////////////////////////////////////Necromantic Stone///////////////////
|
||||
|
||||
/obj/item/device/necromantic_stone
|
||||
name = "necromantic stone"
|
||||
desc = "A shard capable of resurrecting humans as skeleton thralls."
|
||||
icon = 'icons/obj/wizard.dmi'
|
||||
icon_state = "necrostone"
|
||||
item_state = "electronic"
|
||||
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
var/list/spooky_scaries = list()
|
||||
var/unlimited = 0
|
||||
|
||||
/obj/item/device/necromantic_stone/unlimited
|
||||
unlimited = 1
|
||||
|
||||
/obj/item/device/necromantic_stone/attack(mob/living/carbon/human/M, mob/living/carbon/human/user)
|
||||
if(!istype(M))
|
||||
return ..()
|
||||
|
||||
if(!istype(user) || !user.canUseTopic(M, BE_CLOSE))
|
||||
return
|
||||
|
||||
if(M.stat != DEAD)
|
||||
to_chat(user, "<span class='warning'>This artifact can only affect the dead!</span>")
|
||||
return
|
||||
|
||||
if(!M.mind || !M.client)
|
||||
to_chat(user, "<span class='warning'>There is no soul connected to this body...</span>")
|
||||
return
|
||||
|
||||
check_spooky()//clean out/refresh the list
|
||||
if(spooky_scaries.len >= 3 && !unlimited)
|
||||
to_chat(user, "<span class='warning'>This artifact can only affect three undead at a time!</span>")
|
||||
return
|
||||
|
||||
M.set_species(/datum/species/skeleton, icon_update=0)
|
||||
M.revive(full_heal = 1, admin_revive = 1)
|
||||
spooky_scaries |= M
|
||||
to_chat(M, "<span class='userdanger'>You have been revived by </span><B>[user.real_name]!</B>")
|
||||
to_chat(M, "<span class='userdanger'>[user.p_they(TRUE)] [user.p_are()] your master now, assist them even if it costs you your new life!</span>")
|
||||
|
||||
equip_roman_skeleton(M)
|
||||
|
||||
desc = "A shard capable of resurrecting humans as skeleton thralls[unlimited ? "." : ", [spooky_scaries.len]/3 active thralls."]"
|
||||
|
||||
/obj/item/device/necromantic_stone/proc/check_spooky()
|
||||
if(unlimited) //no point, the list isn't used.
|
||||
return
|
||||
|
||||
for(var/X in spooky_scaries)
|
||||
if(!ishuman(X))
|
||||
spooky_scaries.Remove(X)
|
||||
continue
|
||||
var/mob/living/carbon/human/H = X
|
||||
if(H.stat == DEAD)
|
||||
H.dust(TRUE)
|
||||
spooky_scaries.Remove(X)
|
||||
continue
|
||||
listclearnulls(spooky_scaries)
|
||||
|
||||
//Funny gimmick, skeletons always seem to wear roman/ancient armour
|
||||
/obj/item/device/necromantic_stone/proc/equip_roman_skeleton(mob/living/carbon/human/H)
|
||||
for(var/obj/item/I in H)
|
||||
H.dropItemToGround(I)
|
||||
|
||||
var/hat = pick(/obj/item/clothing/head/helmet/roman, /obj/item/clothing/head/helmet/roman/legionaire)
|
||||
H.equip_to_slot_or_del(new hat(H), slot_head)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/roman(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/roman(H), slot_shoes)
|
||||
H.put_in_hands(new /obj/item/shield/riot/roman(H), TRUE)
|
||||
H.put_in_hands(new /obj/item/claymore(H), TRUE)
|
||||
H.equip_to_slot_or_del(new /obj/item/twohanded/spear(H), slot_back)
|
||||
|
||||
|
||||
/obj/item/voodoo
|
||||
name = "wicker doll"
|
||||
desc = "Something creepy about it."
|
||||
icon = 'icons/obj/wizard.dmi'
|
||||
icon_state = "voodoo"
|
||||
item_state = "electronic"
|
||||
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
|
||||
var/mob/living/carbon/human/target = null
|
||||
var/list/mob/living/carbon/human/possible = list()
|
||||
var/obj/item/voodoo_link = null
|
||||
var/cooldown_time = 30 //3s
|
||||
var/cooldown = 0
|
||||
max_integrity = 10
|
||||
resistance_flags = FLAMMABLE
|
||||
|
||||
/obj/item/voodoo/attackby(obj/item/I, mob/user, params)
|
||||
if(target && cooldown < world.time)
|
||||
if(I.is_hot())
|
||||
to_chat(target, "<span class='userdanger'>You suddenly feel very hot</span>")
|
||||
target.bodytemperature += 50
|
||||
GiveHint(target)
|
||||
else if(is_pointed(I))
|
||||
to_chat(target, "<span class='userdanger'>You feel a stabbing pain in [parse_zone(user.zone_selected)]!</span>")
|
||||
target.Knockdown(40)
|
||||
GiveHint(target)
|
||||
else if(istype(I, /obj/item/bikehorn))
|
||||
to_chat(target, "<span class='userdanger'>HONK</span>")
|
||||
SEND_SOUND(target, 'sound/items/airhorn.ogg')
|
||||
target.adjustEarDamage(0,3)
|
||||
GiveHint(target)
|
||||
cooldown = world.time +cooldown_time
|
||||
return
|
||||
|
||||
if(!voodoo_link)
|
||||
if(I.loc == user && istype(I) && I.w_class <= WEIGHT_CLASS_SMALL)
|
||||
if (user.transferItemToLoc(I,src))
|
||||
voodoo_link = I
|
||||
to_chat(user, "You attach [I] to the doll.")
|
||||
update_targets()
|
||||
|
||||
/obj/item/voodoo/check_eye(mob/user)
|
||||
if(loc != user)
|
||||
user.reset_perspective(null)
|
||||
user.unset_machine()
|
||||
|
||||
/obj/item/voodoo/attack_self(mob/user)
|
||||
if(!target && possible.len)
|
||||
target = input(user, "Select your victim!", "Voodoo") as null|anything in possible
|
||||
return
|
||||
|
||||
if(user.zone_selected == "chest")
|
||||
if(voodoo_link)
|
||||
target = null
|
||||
voodoo_link.forceMove(drop_location())
|
||||
to_chat(user, "<span class='notice'>You remove the [voodoo_link] from the doll.</span>")
|
||||
voodoo_link = null
|
||||
update_targets()
|
||||
return
|
||||
|
||||
if(target && cooldown < world.time)
|
||||
switch(user.zone_selected)
|
||||
if("mouth")
|
||||
var/wgw = sanitize(input(user, "What would you like the victim to say", "Voodoo", null) as text)
|
||||
target.say(wgw)
|
||||
log_game("[user][user.key] made [target][target.key] say [wgw] with a voodoo doll.")
|
||||
if("eyes")
|
||||
user.set_machine(src)
|
||||
user.reset_perspective(target)
|
||||
spawn(100)
|
||||
user.reset_perspective(null)
|
||||
user.unset_machine()
|
||||
if("r_leg","l_leg")
|
||||
to_chat(user, "<span class='notice'>You move the doll's legs around.</span>")
|
||||
var/turf/T = get_step(target,pick(GLOB.cardinals))
|
||||
target.Move(T)
|
||||
if("r_arm","l_arm")
|
||||
target.click_random_mob()
|
||||
GiveHint(target)
|
||||
if("head")
|
||||
to_chat(user, "<span class='notice'>You smack the doll's head with your hand.</span>")
|
||||
target.Dizzy(10)
|
||||
to_chat(target, "<span class='warning'>You suddenly feel as if your head was hit with a hammer!</span>")
|
||||
GiveHint(target,user)
|
||||
cooldown = world.time + cooldown_time
|
||||
|
||||
/obj/item/voodoo/proc/update_targets()
|
||||
possible = list()
|
||||
if(!voodoo_link)
|
||||
return
|
||||
var/list/prints = voodoo_link.return_fingerprints()
|
||||
if(!length(prints))
|
||||
return FALSE
|
||||
for(var/mob/living/carbon/human/H in GLOB.alive_mob_list)
|
||||
if(prints[md5(H.dna.uni_identity)])
|
||||
possible |= H
|
||||
|
||||
/obj/item/voodoo/proc/GiveHint(mob/victim,force=0)
|
||||
if(prob(50) || force)
|
||||
var/way = dir2text(get_dir(victim,get_turf(src)))
|
||||
to_chat(victim, "<span class='notice'>You feel a dark presence from [way]</span>")
|
||||
if(prob(20) || force)
|
||||
var/area/A = get_area(src)
|
||||
to_chat(victim, "<span class='notice'>You feel a dark presence from [A.name]</span>")
|
||||
|
||||
/obj/item/voodoo/suicide_act(mob/living/carbon/user)
|
||||
user.visible_message("<span class='suicide'>[user] links the voodoo doll to themself and sits on it, infinitely crushing themself! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
user.gib()
|
||||
return(BRUTELOSS)
|
||||
|
||||
/obj/item/voodoo/fire_act(exposed_temperature, exposed_volume)
|
||||
if(target)
|
||||
target.adjust_fire_stacks(20)
|
||||
target.IgniteMob()
|
||||
GiveHint(target,1)
|
||||
return ..()
|
||||
|
||||
//Provides a decent heal, need to pump every 6 seconds
|
||||
/obj/item/organ/heart/cursed/wizard
|
||||
pump_delay = 60
|
||||
heal_brute = 25
|
||||
heal_burn = 25
|
||||
heal_oxy = 25
|
||||
|
||||
//Warp Whistle: Provides uncontrolled long distance teleportation.
|
||||
|
||||
/obj/item/warpwhistle
|
||||
name = "warp whistle"
|
||||
desc = "One toot on this whistle will send you to a far away land!"
|
||||
icon = 'icons/obj/wizard.dmi'
|
||||
icon_state = "whistle"
|
||||
var/on_cooldown = 0 //0: usable, 1: in use, 2: on cooldown
|
||||
var/mob/living/carbon/last_user
|
||||
|
||||
/obj/item/warpwhistle/proc/interrupted(mob/living/carbon/user)
|
||||
if(!user || QDELETED(src) || user.notransform)
|
||||
on_cooldown = FALSE
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/item/warpwhistle/attack_self(mob/living/carbon/user)
|
||||
if(!istype(user) || on_cooldown)
|
||||
return
|
||||
on_cooldown = TRUE
|
||||
last_user = user
|
||||
var/turf/T = get_turf(user)
|
||||
playsound(T,'sound/magic/warpwhistle.ogg', 200, 1)
|
||||
user.canmove = 0
|
||||
new /obj/effect/temp_visual/tornado(T)
|
||||
sleep(20)
|
||||
if(interrupted(user))
|
||||
return
|
||||
user.invisibility = INVISIBILITY_MAXIMUM
|
||||
user.status_flags |= GODMODE
|
||||
sleep(20)
|
||||
if(interrupted(user))
|
||||
return
|
||||
var/breakout = 0
|
||||
while(breakout < 50)
|
||||
var/turf/potential_T = find_safe_turf()
|
||||
if(T.z != potential_T.z || abs(get_dist_euclidian(potential_T,T)) > 50 - breakout)
|
||||
user.forceMove(potential_T)
|
||||
user.canmove = 0
|
||||
T = potential_T
|
||||
break
|
||||
breakout += 1
|
||||
new /obj/effect/temp_visual/tornado(T)
|
||||
sleep(20)
|
||||
if(interrupted(user))
|
||||
return
|
||||
user.invisibility = initial(user.invisibility)
|
||||
user.status_flags &= ~GODMODE
|
||||
user.canmove = 1
|
||||
on_cooldown = 2
|
||||
sleep(40)
|
||||
on_cooldown = 0
|
||||
|
||||
/obj/item/warpwhistle/Destroy()
|
||||
if(on_cooldown == 1 && last_user) //Flute got dunked somewhere in the teleport
|
||||
last_user.invisibility = initial(last_user.invisibility)
|
||||
last_user.status_flags &= ~GODMODE
|
||||
last_user.canmove = 1
|
||||
return ..()
|
||||
|
||||
/obj/effect/temp_visual/tornado
|
||||
icon = 'icons/obj/wizard.dmi'
|
||||
icon_state = "tornado"
|
||||
name = "tornado"
|
||||
desc = "This thing sucks!"
|
||||
layer = FLY_LAYER
|
||||
randomdir = 0
|
||||
duration = 40
|
||||
pixel_x = 500
|
||||
|
||||
/obj/effect/temp_visual/tornado/Initialize()
|
||||
. = ..()
|
||||
animate(src, pixel_x = -500, time = 40)
|
||||
>>>>>>> bfde5ac... [s] Fixes altclick exploits (#35456)
|
||||
|
||||
@@ -161,17 +161,14 @@
|
||||
set category = "Object"
|
||||
set src in usr
|
||||
|
||||
if(usr.incapacitated())
|
||||
if(!usr.canUseTopic(src, BE_CLOSE, NO_DEXTERY))
|
||||
return
|
||||
|
||||
setDir(turn(dir, -90))
|
||||
|
||||
/obj/item/device/assembly/infra/AltClick(mob/user)
|
||||
..()
|
||||
if(user.incapacitated())
|
||||
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
|
||||
return
|
||||
if(!in_range(src, user))
|
||||
if(!user.canUseTopic(src, BE_CLOSE, NO_DEXTERY))
|
||||
return
|
||||
else
|
||||
rotate()
|
||||
|
||||
@@ -734,8 +734,7 @@
|
||||
|
||||
/obj/machinery/airalarm/AltClick(mob/user)
|
||||
..()
|
||||
if(!issilicon(user) && (!user.canUseTopic(src, be_close=TRUE) || !isturf(loc)))
|
||||
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
|
||||
if(!user.canUseTopic(src, !issilicon(user)) || !isturf(loc))
|
||||
return
|
||||
else
|
||||
togglelock(user)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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.")
|
||||
|
||||
@@ -169,7 +169,7 @@
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/microwave/AltClick(mob/user)
|
||||
if(user.canUseTopic(src, be_close=TRUE) && !(operating || broken > 0 || panel_open || !anchored || dirty == 100))
|
||||
if(user.canUseTopic(src, BE_CLOSE) && !(operating || broken > 0 || panel_open || !anchored || dirty == 100))
|
||||
cook()
|
||||
|
||||
/*******************
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
set name = "Flip Card"
|
||||
set category = "Object"
|
||||
set src in range(1)
|
||||
if(!usr.canUseTopic(src,1))
|
||||
if(!ishuman(usr) || !usr.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
if(!flipped)
|
||||
name = "CAS card"
|
||||
@@ -127,7 +127,7 @@
|
||||
update_icon()
|
||||
|
||||
/obj/item/toy/cards/singlecard/cas/AltClick(mob/living/user)
|
||||
if(!user.canUseTopic(src,1))
|
||||
if(!ishuman(user) || !user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
Flip()
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
armor = list(melee = 50, bullet = 70, laser = 70, energy = 100, bomb = 10, bio = 100, rad = 100, fire = 0, acid = 0)
|
||||
|
||||
/obj/item/device/electronic_assembly/proc/check_interactivity(mob/user)
|
||||
return user.canUseTopic(src,be_close = TRUE)
|
||||
return user.canUseTopic(src, BE_CLOSE)
|
||||
|
||||
|
||||
/obj/item/device/electronic_assembly/Initialize()
|
||||
|
||||
@@ -68,7 +68,7 @@ a creative player the means to solve many problems. Circuits are held inside an
|
||||
if(assembly)
|
||||
return assembly.check_interactivity(user)
|
||||
else
|
||||
return user.canUseTopic(src,be_close = TRUE)
|
||||
return user.canUseTopic(src, BE_CLOSE)
|
||||
|
||||
/obj/item/integrated_circuit/Initialize()
|
||||
displayed_name = name
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
var/list/program // Currently loaded save, in form of list
|
||||
|
||||
/obj/item/device/integrated_circuit_printer/proc/check_interactivity(mob/user)
|
||||
return user.canUseTopic(src, be_close = TRUE)
|
||||
return user.canUseTopic(src, BE_CLOSE)
|
||||
|
||||
/obj/item/device/integrated_circuit_printer/upgraded
|
||||
upgraded = TRUE
|
||||
|
||||
@@ -154,7 +154,7 @@
|
||||
if(locked)
|
||||
to_chat(user, "<span class='notice'>The crate is locked with a Deca-code lock.</span>")
|
||||
var/input = input(usr, "Enter [codelen] digits. All digits must be unique.", "Deca-Code Lock", "") as text
|
||||
if(user.canUseTopic(src, 1))
|
||||
if(user.canUseTopic(src, BE_CLOSE))
|
||||
var/list/sanitised = list()
|
||||
var/sanitycheck = 1
|
||||
for(var/i=1,i<=length(input),i++) //put the guess into a list
|
||||
@@ -180,7 +180,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/structure/closet/crate/secure/loot/AltClick(mob/living/user)
|
||||
if(!user.canUseTopic(src))
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
attack_hand(user) //this helps you not blow up so easily by overriding unlocking which results in an immediate boom.
|
||||
|
||||
|
||||
@@ -57,13 +57,10 @@ GLOBAL_LIST_INIT(marker_beacon_colors, list(
|
||||
transfer_fingerprints_to(M)
|
||||
|
||||
/obj/item/stack/marker_beacon/AltClick(mob/living/user)
|
||||
if(user.incapacitated() || !istype(user))
|
||||
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
|
||||
return
|
||||
if(!in_range(src, user))
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
var/input_color = input(user, "Choose a color.", "Beacon Color") as null|anything in GLOB.marker_beacon_colors
|
||||
if(user.incapacitated() || !istype(user) || !in_range(src, user))
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
if(input_color)
|
||||
picked_color = input_color
|
||||
@@ -129,13 +126,10 @@ GLOBAL_LIST_INIT(marker_beacon_colors, list(
|
||||
|
||||
/obj/structure/marker_beacon/AltClick(mob/living/user)
|
||||
..()
|
||||
if(user.incapacitated() || !istype(user))
|
||||
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
|
||||
return
|
||||
if(!in_range(src, user))
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
var/input_color = input(user, "Choose a color.", "Beacon Color") as null|anything in GLOB.marker_beacon_colors
|
||||
if(user.incapacitated() || !istype(user) || !in_range(src, user))
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
if(input_color)
|
||||
picked_color = input_color
|
||||
|
||||
@@ -724,13 +724,13 @@
|
||||
|
||||
/mob/living/carbon/human/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE)
|
||||
if(incapacitated() || lying )
|
||||
return
|
||||
return FALSE
|
||||
if(!Adjacent(M) && (M.loc != src))
|
||||
if((be_close == 0) && (dna.check_mutation(TK)))
|
||||
if(tkMaxRangeCheck(src, M))
|
||||
return 1
|
||||
return
|
||||
return 1
|
||||
return TRUE
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/mob/living/carbon/human/resist_restraints()
|
||||
if(wear_suit && wear_suit.breakouttime)
|
||||
|
||||
@@ -787,13 +787,14 @@
|
||||
|
||||
/mob/living/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE)
|
||||
if(incapacitated())
|
||||
return
|
||||
return FALSE
|
||||
if(no_dextery)
|
||||
if(be_close && in_range(M, src))
|
||||
return 1
|
||||
return TRUE
|
||||
else
|
||||
to_chat(src, "<span class='warning'>You don't have the dexterity to do this!</span>")
|
||||
return
|
||||
return FALSE
|
||||
|
||||
/mob/living/proc/can_use_guns(obj/item/G)
|
||||
if(G.trigger_guard != TRIGGER_GUARD_ALLOW_ALL && !IsAdvancedToolUser())
|
||||
to_chat(src, "<span class='warning'>You don't have the dexterity to do this!</span>")
|
||||
|
||||
@@ -185,6 +185,8 @@
|
||||
// See software.dm for Topic()
|
||||
|
||||
/mob/living/silicon/pai/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE)
|
||||
if(be_close && !in_range(M, src))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/mob/proc/makePAI(delold)
|
||||
|
||||
@@ -879,10 +879,10 @@
|
||||
|
||||
/mob/living/silicon/robot/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE)
|
||||
if(stat || lockcharge || low_power_mode)
|
||||
return
|
||||
return FALSE
|
||||
if(be_close && !in_range(M, src))
|
||||
return
|
||||
return 1
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/mob/living/silicon/robot/updatehealth()
|
||||
..()
|
||||
|
||||
@@ -377,23 +377,23 @@
|
||||
|
||||
/mob/living/simple_animal/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE)
|
||||
if(incapacitated())
|
||||
return 0
|
||||
return FALSE
|
||||
if(no_dextery || dextrous)
|
||||
if(be_close && !in_range(M, src))
|
||||
return 0
|
||||
return FALSE
|
||||
else
|
||||
to_chat(src, "<span class='warning'>You don't have the dexterity to do this!</span>")
|
||||
return 0
|
||||
return 1
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/mob/living/simple_animal/stripPanelUnequip(obj/item/what, mob/who, where)
|
||||
if(!canUseTopic(who, TRUE))
|
||||
if(!canUseTopic(who, BE_CLOSE))
|
||||
return
|
||||
else
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/stripPanelEquip(obj/item/what, mob/who, where)
|
||||
if(!canUseTopic(who, TRUE))
|
||||
if(!canUseTopic(who, BE_CLOSE))
|
||||
return
|
||||
else
|
||||
..()
|
||||
|
||||
@@ -99,12 +99,9 @@
|
||||
H.emote("scream")
|
||||
|
||||
/obj/item/paper/AltClick(mob/living/carbon/user, obj/item/I)
|
||||
if ( istype(user) )
|
||||
if( (!in_range(src, user)) || user.stat || user.restrained() )
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You fold [src] into the shape of a plane!</span>")
|
||||
user.temporarilyRemoveItemFromInventory(src)
|
||||
I = new /obj/item/paperplane(user, src)
|
||||
user.put_in_hands(I)
|
||||
else
|
||||
to_chat(user, "<span class='notice'> You lack the dexterity to fold \the [src]. </span>")
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You fold [src] into the shape of a plane!</span>")
|
||||
user.temporarilyRemoveItemFromInventory(src)
|
||||
I = new /obj/item/paperplane(user, src)
|
||||
user.put_in_hands(I)
|
||||
|
||||
@@ -128,12 +128,12 @@
|
||||
if(isobj(O) && proximity)
|
||||
if(O.obj_flags & UNIQUE_RENAME)
|
||||
var/penchoice = input(user, "What would you like to edit?", "Rename or change description?") as null|anything in list("Rename","Change description")
|
||||
if(!QDELETED(O) && user.canUseTopic(O, be_close = TRUE))
|
||||
if(!QDELETED(O) && user.canUseTopic(O, BE_CLOSE))
|
||||
|
||||
if(penchoice == "Rename")
|
||||
var/input = stripped_input(user,"What do you want to name \the [O.name]?", ,"", MAX_NAME_LEN)
|
||||
var/oldname = O.name
|
||||
if(!QDELETED(O) && user.canUseTopic(O, be_close = TRUE))
|
||||
if(!QDELETED(O) && user.canUseTopic(O, BE_CLOSE))
|
||||
if(oldname == input)
|
||||
to_chat(user, "You changed \the [O.name] to... well... \the [O.name].")
|
||||
return
|
||||
@@ -146,7 +146,7 @@
|
||||
|
||||
if(penchoice == "Change description")
|
||||
var/input = stripped_input(user,"Describe \the [O.name] here", ,"", 100)
|
||||
if(!QDELETED(O) && user.canUseTopic(O, be_close = TRUE))
|
||||
if(!QDELETED(O) && user.canUseTopic(O, BE_CLOSE))
|
||||
O.desc = input
|
||||
to_chat(user, "You have successfully changed \the [O.name]'s description.")
|
||||
return
|
||||
|
||||
@@ -313,7 +313,7 @@
|
||||
|
||||
/obj/machinery/photocopier/MouseDrop_T(mob/target, mob/user)
|
||||
check_ass() //Just to make sure that you can re-drag somebody onto it after they moved off.
|
||||
if (!istype(target) || target.anchored || target.buckled || !Adjacent(user) || !Adjacent(target) || !user.canUseTopic(src, 1) || target == ass || copier_blocked())
|
||||
if (!istype(target) || target.anchored || target.buckled || !Adjacent(target) || !user.canUseTopic(src, BE_CLOSE) || target == ass || copier_blocked())
|
||||
return
|
||||
src.add_fingerprint(user)
|
||||
if(target == user)
|
||||
|
||||
@@ -662,8 +662,7 @@
|
||||
|
||||
/obj/machinery/power/apc/AltClick(mob/user)
|
||||
..()
|
||||
if(!issilicon(user) && (!user.canUseTopic(src, be_close=TRUE) || !isturf(loc)))
|
||||
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
|
||||
if(!user.canUseTopic(src, !issilicon(user)) || !isturf(loc))
|
||||
return
|
||||
else
|
||||
togglelock(user)
|
||||
|
||||
@@ -240,7 +240,7 @@
|
||||
to_chat(user, "You switch to tube A.")
|
||||
|
||||
/obj/item/gun/ballistic/shotgun/automatic/dual_tube/AltClick(mob/living/user)
|
||||
if(user.incapacitated() || !Adjacent(user) || !istype(user))
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return
|
||||
pump()
|
||||
|
||||
|
||||
@@ -223,7 +223,7 @@
|
||||
return
|
||||
vol_each = min(reagents.total_volume / amount, 50)
|
||||
var/name = stripped_input(usr,"Name:","Name your pill!", "[reagents.get_master_reagent_name()] ([vol_each]u)", MAX_NAME_LEN)
|
||||
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, be_close=TRUE))
|
||||
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
var/obj/item/reagent_containers/pill/P
|
||||
|
||||
@@ -237,7 +237,7 @@
|
||||
reagents.trans_to(P,vol_each)
|
||||
else
|
||||
var/name = stripped_input(usr, "Name:", "Name your pack!", reagents.get_master_reagent_name(), MAX_NAME_LEN)
|
||||
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, be_close=TRUE))
|
||||
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
var/obj/item/reagent_containers/food/condiment/pack/P = new/obj/item/reagent_containers/food/condiment/pack(drop_location())
|
||||
|
||||
@@ -259,7 +259,7 @@
|
||||
return
|
||||
vol_each = min(reagents.total_volume / amount, 40)
|
||||
var/name = stripped_input(usr,"Name:","Name your patch!", "[reagents.get_master_reagent_name()] ([vol_each]u)", MAX_NAME_LEN)
|
||||
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, be_close=TRUE))
|
||||
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
var/obj/item/reagent_containers/pill/P
|
||||
|
||||
@@ -277,7 +277,7 @@
|
||||
|
||||
if(condi)
|
||||
var/name = stripped_input(usr, "Name:","Name your bottle!", (reagents.total_volume ? reagents.get_master_reagent_name() : " "), MAX_NAME_LEN)
|
||||
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, be_close=TRUE))
|
||||
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
var/obj/item/reagent_containers/food/condiment/P = new(drop_location())
|
||||
P.originalname = name
|
||||
@@ -290,7 +290,7 @@
|
||||
amount_full = round(reagents.total_volume / 30)
|
||||
vol_part = reagents.total_volume % 30
|
||||
var/name = stripped_input(usr, "Name:","Name your bottle!", (reagents.total_volume ? reagents.get_master_reagent_name() : " "), MAX_NAME_LEN)
|
||||
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, be_close=TRUE))
|
||||
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
|
||||
var/obj/item/reagent_containers/glass/bottle/P
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/vehicle/ridden/AltClick(mob/user)
|
||||
if(user.Adjacent(src) && inserted_key)
|
||||
if(inserted_key && user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
if(!is_occupant(user))
|
||||
to_chat(user, "<span class='notice'>You must be riding the [src] to remove [src]'s key!</span>")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user