Skip to content

Commit

Permalink
Mulebot fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Erbot34567 committed Dec 10, 2024
1 parent 4544f91 commit 4e1c132
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion code/game/objects/items/devices/PDA/cart.dm
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ Code:
if(href_list["mule"]) //MULEbots are special snowflakes, and need different args due to how they work.
var/mob/living/simple_animal/bot/mulebot/mule = active_bot
if (istype(mule))
active_bot.bot_control(href_list["mule"], usr, TRUE)
active_bot.bot_control(href_list["mule"], usr, null, TRUE)

if(!host_pda)
return
Expand Down
21 changes: 15 additions & 6 deletions code/modules/mob/living/simple_animal/bot/mulebot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
a_intent = INTENT_HARM //No swapping
buckle_lying = 0
mob_size = MOB_SIZE_LARGE
buckle_prevents_pull = TRUE //no mass destruction caused by pulling the mulebot with avoidance wire snipped :3

radio_key = /obj/item/encryptionkey/headset_cargo
radio_channel = RADIO_CHANNEL_SUPPLY
Expand Down Expand Up @@ -131,11 +132,12 @@
else
icon_state = "[base_icon][wires.is_cut(WIRE_AVOIDANCE)]"
cut_overlays()
if(load && !ismob(load))//buckling handles the mob offsets
if(load)//buckling handles the mob offsets
load.pixel_y = initial(load.pixel_y) + 9
if(load.layer < layer)
load.layer = layer + 0.01
add_overlay(load)
if(!ismob(load)) //doesn't look great if there are two people
add_overlay(load)
return

/mob/living/simple_animal/bot/mulebot/ex_act(severity, target, origin)
Expand All @@ -159,7 +161,7 @@
visible_message("<span class='danger'>Something shorts out inside [src]!</span>")
wires.cut_random()

/mob/living/simple_animal/bot/mulebot/interact(mob/user)
/mob/living/simple_animal/bot/mulebot/attack_hand(mob/user)
if(open && !isAI(user))
wires.interact(user)
else
Expand Down Expand Up @@ -201,7 +203,8 @@
return data

/mob/living/simple_animal/bot/mulebot/ui_act(action, params)
if(..() || (locked && hasSiliconAccessInArea(usr)))
. = ..()
if(..() || (locked && !hasSiliconAccessInArea(usr)))
return
switch(action)
if("lock")
Expand Down Expand Up @@ -350,17 +353,19 @@
can_buckle = FALSE
return TRUE
return FALSE

/mob/living/simple_animal/bot/mulebot/post_buckle_mob(mob/living/M)
/*
/mob/living/simple_animal/bot/mulebot/post_buckle_mob(mob/living/M) //already in update_icon
M.pixel_y = initial(M.pixel_y) + 9
if(M.layer < layer)
M.layer = layer + 0.01
*/

/mob/living/simple_animal/bot/mulebot/post_unbuckle_mob(mob/living/M)
load = null
M.layer = initial(M.layer)
M.pixel_y = initial(M.pixel_y)


// called to unload the bot
// argument is optional direction to unload
// if zero, unload at bot's location
Expand Down Expand Up @@ -473,6 +478,8 @@
if(cell)
cell.use(1)
if(moved && oldloc!=loc) // successful move
if(load && ismob(load)) //for mobs and to prevent runtimes if there isn't any load
load.pixel_y = initial(load.pixel_y) + 9 //for mobs to not default to their original y
blockcount = 0
path -= loc

Expand All @@ -483,6 +490,8 @@

else // failed to move

if(load && ismob(load)) //for mobs and to prevent runtimes if there isn't any load
load.pixel_y = initial(load.pixel_y) + 9 //for mobs to not default to their original y
blockcount++
mode = BOT_BLOCKED
if(blockcount == 3)
Expand Down
4 changes: 2 additions & 2 deletions tgui/packages/tgui/interfaces/Mule.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const Mule = (props, context) => {
selected={home}
options={destinations}
width="150px"
onSelected={value => act('destination', { value })} />
onSelected={value => act('sethome', { value })} />
<Button
icon="home"
content="Go Home"
Expand All @@ -117,7 +117,7 @@ export const Mule = (props, context) => {
<Button.Checkbox
checked={autoReturn}
content="Auto-Return"
onClick={() => act('autored')} />
onClick={() => act('autoret')} />
<br />
<Button.Checkbox
checked={autoPickup}
Expand Down

0 comments on commit 4e1c132

Please sign in to comment.