Merge remote-tracking branch 'upstream/master' into diagonal-movement

This commit is contained in:
Couls
2019-07-08 10:13:15 -04:00
54 changed files with 563 additions and 174 deletions
@@ -591,6 +591,9 @@ REAGENT SCANNER
var/scan_time = 10 SECONDS //how long does it take to scan
var/scan_cd = 60 SECONDS //how long before we can scan again
/obj/item/bodyanalyzer/get_cell()
return power_supply
/obj/item/bodyanalyzer/advanced
cell_type = /obj/item/stock_parts/cell/upgraded/plus
+3
View File
@@ -22,6 +22,9 @@
var/obj/item/stock_parts/cell/high/bcell = null
var/combat = 0 //can we revive through space suits?
/obj/item/defibrillator/get_cell()
return bcell
/obj/item/defibrillator/New() //starts without a cell for rnd
..()
paddles = make_paddles()
+47
View File
@@ -4,6 +4,9 @@
#define RPD_COOLDOWN_TIME 4 //How long should we have to wait between dispensing pipes?
#define RPD_WALLBUILD_TIME 40 //How long should drilling into a wall take?
#define RPD_MENU_ROTATE "Rotate pipes" //Stuff for radial menu
#define RPD_MENU_FLIP "Flip pipes" //Stuff for radial menu
#define RPD_MENU_DELETE "Delete pipes" //Stuff for radial menu
/obj/item/rpd
name = "rapid pipe dispenser"
@@ -172,6 +175,9 @@ var/list/pipemenu = list(
ui.open()
ui.set_auto_update(1)
/obj/item/rpd/AltClick(mob/user)
radial_menu(user)
/obj/item/rpd/ui_data(mob/user, ui_key = "main", datum/topic_state/state = inventory_state)
var/data[0]
data["iconrotation"] = iconrotation
@@ -200,6 +206,44 @@ var/list/pipemenu = list(
return
SSnanoui.update_uis(src)
//RPD radial menu
/obj/item/rpd/proc/check_menu(mob/living/user)
if(!istype(user))
return
if(user.incapacitated())
return
if(loc != user)
return
return TRUE
/obj/item/rpd/proc/radial_menu(mob/user)
if(!check_menu(user))
to_chat(user, "<span class='notice'>You can't do that right now!</span>")
return
var/list/choices = list(
RPD_MENU_ROTATE = image(icon = 'icons/obj/interface.dmi', icon_state = "rpd_rotate"),
RPD_MENU_FLIP = image(icon = 'icons/obj/interface.dmi', icon_state = "rpd_flip"),
RPD_MENU_DELETE = image(icon = 'icons/obj/interface.dmi', icon_state = "rpd_delete"),
"UI" = image(icon = 'icons/obj/interface.dmi', icon_state = "ui_interact")
)
var/selected_mode = show_radial_menu(user, src, choices, custom_check = CALLBACK(src, .proc/check_menu, user))
if(!check_menu(user))
return
if(selected_mode == "UI")
ui_interact(user)
else
switch(selected_mode)
if(RPD_MENU_ROTATE)
mode = RPD_ROTATE_MODE
if(RPD_MENU_FLIP)
mode = RPD_FLIP_MODE
if(RPD_MENU_DELETE)
mode = RPD_DELETE_MODE
else
return //Either nothing was selected, or an invalid mode was selected
to_chat(user, "<span class='notice'>You set [src]'s mode.</span>")
/obj/item/rpd/afterattack(atom/target, mob/user, proximity)
..()
if(loc != user)
@@ -236,3 +280,6 @@ var/list/pipemenu = list(
#undef RPD_COOLDOWN_TIME
#undef RPD_WALLBUILD_TIME
#undef RPD_MENU_ROTATE
#undef RPD_MENU_FLIP
#undef RPD_MENU_DELETE
@@ -20,6 +20,9 @@
user.visible_message("<span class='suicide'>[user] is putting the live [name] in [user.p_their()] mouth! It looks like [user.p_theyre()] trying to commit suicide.</span>")
return FIRELOSS
/obj/item/melee/baton/get_cell()
return bcell
/obj/item/melee/baton/New()
..()
update_icon()