mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-23 12:08:28 +01:00
Misc fixes
Applies cooldown to the 'use item on self' button, and makes the 'you don't have an item' text a little more informative. Also re-renames 'Custom Subtle' back to 'Subtle (Custom)', I didn't test this originally because I thought my pants were really big, and turns out that doing this just makes it first in the list for subtles, which is WORSE! I'm not sure what to rename it, so! Let's just put it back. Also touches up simple mobs and mouse holes so that simple mobs (such as mice) can click on mouse holes to interact with them! Turns out mice couldn't properly use mouse holes, and that seems like a shame! This is fixed now. Incidentally, borgs can also use mouse holes now.
This commit is contained in:
@@ -160,10 +160,8 @@
|
||||
using.alpha = HUD.ui_alpha
|
||||
adding += using
|
||||
|
||||
using = new /obj/screen()
|
||||
using = new /obj/screen/useself()
|
||||
using.icon = HUD.ui_style
|
||||
using.icon_state = "use"
|
||||
using.name = "use held item on self"
|
||||
using.screen_loc = ui_swaphand2
|
||||
using.color = HUD.ui_color
|
||||
using.alpha = HUD.ui_alpha
|
||||
@@ -424,3 +422,15 @@
|
||||
/obj/screen/wizard/energy
|
||||
name = "energy"
|
||||
icon_state = "wiz_energy"
|
||||
|
||||
/obj/screen/useself
|
||||
name = "use held item on self"
|
||||
icon_state = "use"
|
||||
var/next = 0
|
||||
|
||||
/obj/screen/useself/proc/can_use(var/mob/living/carbon/human/h, var/obj/item/i) //Basically trying to use the item this way skips the cooldown
|
||||
if(world.time >= next) //And trying to check the cooldown doesn't work because when you click the UI it sets a cooldown
|
||||
next = h.get_attack_speed(i) //So instead we'll just put a cooldown on the use button and apply the item's cooldown to the player
|
||||
h.setClickCooldown(next) //Otherwise you can click the button and yourself faster than the normal cooldown. SO WE SET BOTH!!!!
|
||||
next += world.time
|
||||
i.attack(h, h)
|
||||
|
||||
@@ -477,13 +477,14 @@
|
||||
usr.down()
|
||||
|
||||
if("use held item on self")
|
||||
var/obj/screen/useself/s = src
|
||||
if(ishuman(usr))
|
||||
var/mob/living/carbon/human/u = usr
|
||||
var/obj/item/i = u.get_active_hand()
|
||||
if(i)
|
||||
i.attack(usr, usr)
|
||||
s.can_use(u,i)
|
||||
else
|
||||
to_chat(usr, "<span class='notice'>You're not holding anything to use.</span>")
|
||||
to_chat(usr, "<span class='notice'>You're not holding anything to use. You need to have something in your active hand to use it.</span>")
|
||||
|
||||
if("module")
|
||||
if(isrobot(usr))
|
||||
|
||||
Reference in New Issue
Block a user