Files
f753786e3e [MIRROR] Add pAI movement freedom when emagged [MDB IGNORE] (#22895)
* Add pAI movement freedom when emagged

* Update PaiCard.tsx

* Emagging can remove the leash now

---------

Co-authored-by: Tim <timothymtorres@gmail.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
2023-08-05 23:20:33 -04:00

32 lines
528 B
Plaintext

/obj/item/pai_card/download_candidate(mob/user, ckey)
. = ..()
if(!.)
return
if(isnull(pai.leash))
return
pai.leash.disable_leash() // leash starts off disabled by default
/obj/item/pai_card/ui_data(mob/user)
. = ..()
if(!pai)
return
.["pai"]["leash_enabled"] = pai.leash?.enabled
/obj/item/pai_card/ui_act(action, list/params, datum/tgui/ui)
. = ..()
if(.)
return TRUE
if(pai && action == "toggle_leash")
if(isnull(pai.leash))
return FALSE
pai.leash.toggle_leash()
return TRUE
return FALSE