Testmerge Conflict fix?
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
/datum/notificationpanel/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.observer_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "notificationpanel", "Notification Preferences", 700, 700, master_ui, state)
|
||||
ui = new(user, src, ui_key, "notificationpanel", "Notification Preferences", 270, 360, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/datum/notificationpanel/ui_data(mob/user)
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
icon_state = "mulebot0"
|
||||
density = TRUE
|
||||
move_resist = MOVE_FORCE_STRONG
|
||||
animate_movement = 1
|
||||
animate_movement = FORWARD_STEPS
|
||||
health = 50
|
||||
maxHealth = 50
|
||||
damage_coeff = list(BRUTE = 0.5, BURN = 0.7, TOX = 0, CLONE = 0, STAMINA = 0, OXY = 0)
|
||||
@@ -29,10 +29,14 @@
|
||||
model = "MULE"
|
||||
bot_core_type = /obj/machinery/bot_core/mulebot
|
||||
|
||||
var/ui_x = 350
|
||||
var/ui_y = 425
|
||||
|
||||
var/id
|
||||
|
||||
path_image_color = "#7F5200"
|
||||
|
||||
var/base_icon = "mulebot"
|
||||
var/atom/movable/load = null
|
||||
var/mob/living/passenger = null
|
||||
var/turf/target // this is turf to navigate to (location of beacon)
|
||||
@@ -74,16 +78,16 @@
|
||||
/mob/living/simple_animal/bot/mulebot/proc/set_id(new_id)
|
||||
id = new_id
|
||||
if(paicard)
|
||||
bot_name = "\improper MULEbot ([new_id])"
|
||||
bot_name = "[initial(name)] ([new_id])"
|
||||
else
|
||||
name = "\improper MULEbot ([new_id])"
|
||||
name = "[initial(name)] ([new_id])"
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/bot_reset()
|
||||
..()
|
||||
reached_target = 0
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/screwdriver))
|
||||
if(I.tool_behaviour == TOOL_SCREWDRIVER)
|
||||
..()
|
||||
if(open)
|
||||
on = FALSE
|
||||
@@ -91,13 +95,13 @@
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
cell = I
|
||||
visible_message("[user] inserts a cell into [src].",
|
||||
visible_message("<span class='notice'>[user] inserts a cell into [src].</span>",
|
||||
"<span class='notice'>You insert the new cell into [src].</span>")
|
||||
else if(istype(I, /obj/item/crowbar) && open && cell)
|
||||
else if(I.tool_behaviour == TOOL_CROWBAR && open && cell)
|
||||
cell.add_fingerprint(usr)
|
||||
cell.forceMove(loc)
|
||||
cell = null
|
||||
visible_message("[user] crowbars out the power cell from [src].",
|
||||
visible_message("<span class='notice'>[user] crowbars out the power cell from [src].</span>",
|
||||
"<span class='notice'>You pry the powercell out of [src].</span>")
|
||||
else if(is_wire_tool(I) && open)
|
||||
return attack_hand(user)
|
||||
@@ -115,21 +119,19 @@
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/emag_act(mob/user)
|
||||
. = SEND_SIGNAL(src, COMSIG_ATOM_EMAG_ACT)
|
||||
if(emagged < 1)
|
||||
emagged = TRUE
|
||||
if(!open)
|
||||
locked = !locked
|
||||
to_chat(user, "<span class='notice'>You [locked ? "lock" : "unlock"] [src]'s controls!</span>")
|
||||
flick("mulebot-emagged", src)
|
||||
playsound(src, "sparks", 100, 0)
|
||||
return TRUE
|
||||
playsound(src, "sparks", 100, FALSE)
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/update_icon()
|
||||
if(open)
|
||||
icon_state="mulebot-hatch"
|
||||
icon_state="[base_icon]-hatch"
|
||||
else
|
||||
icon_state = "mulebot[wires.is_cut(WIRE_AVOIDANCE)]"
|
||||
icon_state = "[base_icon][wires.is_cut(WIRE_AVOIDANCE)]"
|
||||
cut_overlays()
|
||||
if(load && !ismob(load))//buckling handles the mob offsets
|
||||
load.pixel_y = initial(load.pixel_y) + 9
|
||||
@@ -152,7 +154,7 @@
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/bullet_act(obj/item/projectile/Proj)
|
||||
. = ..()
|
||||
if(. == BULLET_ACT_HIT && !QDELETED(src)) //Got hit and not blown up yet.)
|
||||
if(. && !QDELETED(src)) //Got hit and not blown up yet.
|
||||
if(prob(50) && !isnull(load))
|
||||
unload(0)
|
||||
if(prob(25))
|
||||
@@ -171,7 +173,7 @@
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "mulebot", name, 600, 375, master_ui, state)
|
||||
ui = new(user, src, ui_key, "mulebot", name, ui_x, ui_y, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/ui_data(mob/user)
|
||||
@@ -191,12 +193,15 @@
|
||||
else
|
||||
data["load"] = load ? load.name : null
|
||||
data["destination"] = destination ? destination : null
|
||||
data["home"] = home_destination
|
||||
data["destinations"] = GLOB.deliverybeacontags
|
||||
data["cell"] = cell ? TRUE : FALSE
|
||||
data["cellPercent"] = cell ? cell.percent() : null
|
||||
data["autoReturn"] = auto_return
|
||||
data["autoPickup"] = auto_pickup
|
||||
data["reportDelivery"] = report_delivery
|
||||
data["haspai"] = paicard ? TRUE : FALSE
|
||||
data["id"] = id
|
||||
return data
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/ui_act(action, params)
|
||||
@@ -216,10 +221,10 @@
|
||||
return
|
||||
. = TRUE
|
||||
else
|
||||
bot_control(action, usr) // Kill this later.
|
||||
bot_control(action, usr, params) // Kill this later.
|
||||
. = TRUE
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/bot_control(command, mob/user, pda = FALSE)
|
||||
/mob/living/simple_animal/bot/mulebot/bot_control(command, mob/user, list/params = list(), pda = FALSE)
|
||||
if(pda && wires.is_cut(WIRE_RX)) // MULE wireless is controlled by wires.
|
||||
return
|
||||
|
||||
@@ -234,15 +239,27 @@
|
||||
if(mode == BOT_IDLE || mode == BOT_DELIVER)
|
||||
start_home()
|
||||
if("destination")
|
||||
var/new_dest = input(user, "Enter Destination:", name, destination) as null|anything in GLOB.deliverybeacontags
|
||||
var/new_dest
|
||||
if(pda)
|
||||
new_dest = input(user, "Enter Destination:", name, destination) as null|anything in GLOB.deliverybeacontags
|
||||
else
|
||||
new_dest = params["value"]
|
||||
if(new_dest)
|
||||
set_destination(new_dest)
|
||||
if("setid")
|
||||
var/new_id = stripped_input(user, "Enter ID:", name, id, MAX_NAME_LEN)
|
||||
var/new_id
|
||||
if(pda)
|
||||
new_id = stripped_input(user, "Enter ID:", name, id, MAX_NAME_LEN)
|
||||
else
|
||||
new_id = params["value"]
|
||||
if(new_id)
|
||||
set_id(new_id)
|
||||
if("sethome")
|
||||
var/new_home = input(user, "Enter Home:", name, home_destination) as null|anything in GLOB.deliverybeacontags
|
||||
var/new_home
|
||||
if(pda)
|
||||
new_home = input(user, "Enter Home:", name, home_destination) as null|anything in GLOB.deliverybeacontags
|
||||
else
|
||||
new_home = params["value"]
|
||||
if(new_home)
|
||||
home_destination = new_home
|
||||
if("unload")
|
||||
@@ -317,26 +334,28 @@
|
||||
/mob/living/simple_animal/bot/mulebot/proc/buzz(type)
|
||||
switch(type)
|
||||
if(SIGH)
|
||||
audible_message("[src] makes a sighing buzz.", "<span class='italics'>You hear an electronic buzzing sound.</span>")
|
||||
playsound(loc, 'sound/machines/buzz-sigh.ogg', 50, 0)
|
||||
audible_message("<span class='hear'>[src] makes a sighing buzz.</span>")
|
||||
playsound(loc, 'sound/machines/buzz-sigh.ogg', 50, FALSE)
|
||||
if(ANNOYED)
|
||||
audible_message("[src] makes an annoyed buzzing sound.", "<span class='italics'>You hear an electronic buzzing sound.</span>")
|
||||
playsound(loc, 'sound/machines/buzz-two.ogg', 50, 0)
|
||||
audible_message("<span class='hear'>[src] makes an annoyed buzzing sound.</span>")
|
||||
playsound(loc, 'sound/machines/buzz-two.ogg', 50, FALSE)
|
||||
if(DELIGHT)
|
||||
audible_message("[src] makes a delighted ping!", "<span class='italics'>You hear a ping.</span>")
|
||||
playsound(loc, 'sound/machines/ping.ogg', 50, 0)
|
||||
audible_message("<span class='hear'>[src] makes a delighted ping!</span>")
|
||||
playsound(loc, 'sound/machines/ping.ogg', 50, FALSE)
|
||||
|
||||
|
||||
// mousedrop a crate to load the bot
|
||||
// can load anything if hacked
|
||||
/mob/living/simple_animal/bot/mulebot/MouseDrop_T(atom/movable/AM, mob/user)
|
||||
|
||||
if(user.incapacitated() || user.lying)
|
||||
return
|
||||
|
||||
if(!istype(AM))
|
||||
return
|
||||
|
||||
if(!istype(AM) || isdead(AM) || iscameramob(AM) || istype(AM, /obj/effect/dummy/phased_mob))
|
||||
return
|
||||
|
||||
load(AM)
|
||||
|
||||
// called to load a crate
|
||||
@@ -449,10 +468,8 @@
|
||||
process_bot()
|
||||
num_steps--
|
||||
if(mode != BOT_IDLE)
|
||||
spawn(0)
|
||||
for(var/i=num_steps,i>0,i--)
|
||||
sleep(2)
|
||||
process_bot()
|
||||
var/process_timer = addtimer(CALLBACK(src, .proc/process_bot), 2, TIMER_LOOP|TIMER_STOPPABLE)
|
||||
addtimer(CALLBACK(GLOBAL_PROC, /proc/deltimer, process_timer), (num_steps*2) + 1)
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/proc/process_bot()
|
||||
if(!on || client)
|
||||
@@ -491,6 +508,7 @@
|
||||
B.setDir(newdir)
|
||||
bloodiness--
|
||||
|
||||
|
||||
var/oldloc = loc
|
||||
var/moved = step_towards(src, next) // attempt to move
|
||||
if(cell)
|
||||
@@ -516,11 +534,7 @@
|
||||
buzz(SIGH)
|
||||
mode = BOT_WAIT_FOR_NAV
|
||||
blockcount = 0
|
||||
spawn(20)
|
||||
calc_path(avoid=next)
|
||||
if(path.len > 0)
|
||||
buzz(DELIGHT)
|
||||
mode = BOT_BLOCKED
|
||||
addtimer(CALLBACK(src, .proc/process_blocked, next), 2 SECONDS)
|
||||
return
|
||||
return
|
||||
else
|
||||
@@ -533,18 +547,26 @@
|
||||
|
||||
if(BOT_NAV) // calculate new path
|
||||
mode = BOT_WAIT_FOR_NAV
|
||||
spawn(0)
|
||||
calc_path()
|
||||
INVOKE_ASYNC(src, .proc/process_nav)
|
||||
|
||||
if(path.len > 0)
|
||||
blockcount = 0
|
||||
mode = BOT_BLOCKED
|
||||
buzz(DELIGHT)
|
||||
/mob/living/simple_animal/bot/mulebot/proc/process_blocked(turf/next)
|
||||
calc_path(avoid=next)
|
||||
if(path.len > 0)
|
||||
buzz(DELIGHT)
|
||||
mode = BOT_BLOCKED
|
||||
|
||||
else
|
||||
buzz(SIGH)
|
||||
/mob/living/simple_animal/bot/mulebot/proc/process_nav()
|
||||
calc_path()
|
||||
|
||||
mode = BOT_NO_ROUTE
|
||||
if(path.len > 0)
|
||||
blockcount = 0
|
||||
mode = BOT_BLOCKED
|
||||
buzz(DELIGHT)
|
||||
|
||||
else
|
||||
buzz(SIGH)
|
||||
|
||||
mode = BOT_NO_ROUTE
|
||||
|
||||
// calculates a path to the current destination
|
||||
// given an optional turf to avoid
|
||||
@@ -574,26 +596,28 @@
|
||||
/mob/living/simple_animal/bot/mulebot/proc/start_home()
|
||||
if(!on)
|
||||
return
|
||||
spawn(0)
|
||||
set_destination(home_destination)
|
||||
mode = BOT_BLOCKED
|
||||
INVOKE_ASYNC(src, .proc/do_start_home)
|
||||
update_icon()
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/proc/do_start_home()
|
||||
set_destination(home_destination)
|
||||
mode = BOT_BLOCKED
|
||||
|
||||
// called when bot reaches current target
|
||||
/mob/living/simple_animal/bot/mulebot/proc/at_target()
|
||||
if(!reached_target)
|
||||
radio_channel = "Supply" //Supply channel
|
||||
audible_message("[src] makes a chiming sound!", "<span class='italics'>You hear a chime.</span>")
|
||||
playsound(loc, 'sound/machines/chime.ogg', 50, 0)
|
||||
radio_channel = RADIO_CHANNEL_SUPPLY //Supply channel
|
||||
audible_message("<span class='hear'>[src] makes a chiming sound!</span>")
|
||||
playsound(loc, 'sound/machines/chime.ogg', 50, FALSE)
|
||||
reached_target = 1
|
||||
|
||||
if(pathset) //The AI called us here, so notify it of our arrival.
|
||||
loaddir = dir //The MULE will attempt to load a crate in whatever direction the MULE is "facing".
|
||||
if(calling_ai)
|
||||
to_chat(calling_ai, "<span class='notice'>[icon2html(src, calling_ai)] [src] wirelessly plays a chiming sound!</span>")
|
||||
playsound(calling_ai, 'sound/machines/chime.ogg',40, 0)
|
||||
playsound(calling_ai, 'sound/machines/chime.ogg',40, FALSE)
|
||||
calling_ai = null
|
||||
radio_channel = "AI Private" //Report on AI Private instead if the AI is controlling us.
|
||||
radio_channel = RADIO_CHANNEL_AI_PRIVATE //Report on AI Private instead if the AI is controlling us.
|
||||
|
||||
if(load) // if loaded, unload at target
|
||||
if(report_delivery)
|
||||
@@ -645,7 +669,7 @@
|
||||
log_combat(src, H, "run over", null, "(DAMTYPE: [uppertext(BRUTE)])")
|
||||
H.visible_message("<span class='danger'>[src] drives over [H]!</span>", \
|
||||
"<span class='userdanger'>[src] drives over you!</span>")
|
||||
playsound(loc, 'sound/effects/splat.ogg', 50, 1)
|
||||
playsound(loc, 'sound/effects/splat.ogg', 50, TRUE)
|
||||
|
||||
var/damage = rand(5,15)
|
||||
H.apply_damage(2*damage, BRUTE, BODY_ZONE_HEAD, run_armor_check(BODY_ZONE_HEAD, "melee"))
|
||||
@@ -734,7 +758,7 @@
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/insertpai(mob/user, obj/item/paicard/card)
|
||||
if(..())
|
||||
visible_message("[src] safeties are locked on.")
|
||||
visible_message("<span class='notice'>[src] safeties are locked on.</span>")
|
||||
|
||||
#undef SIGH
|
||||
#undef ANNOYED
|
||||
@@ -742,3 +766,4 @@
|
||||
|
||||
/obj/machinery/bot_core/mulebot
|
||||
req_access = list(ACCESS_CARGO)
|
||||
|
||||
Reference in New Issue
Block a user