MERGE SHIT REEEEE IMMAH PUNCH A WALL

This commit is contained in:
datlo
2018-12-18 11:47:29 +00:00
135 changed files with 1985 additions and 761 deletions
+21 -4
View File
@@ -44,12 +44,14 @@
M.update_action_buttons()
/datum/action/proc/Remove(mob/M)
owner = null
if(!M)
return
if(M.client)
M.client.screen -= button
button.moved = FALSE //so the button appears in its normal position when given to another owner.
M.actions -= src
M.update_action_buttons()
owner = null
/datum/action/proc/Trigger()
if(!IsAvailable())
@@ -102,20 +104,24 @@
/datum/action/item_action
check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_LYING|AB_CHECK_CONSCIOUS
var/use_itemicon = TRUE
/datum/action/item_action/New(Target)
/datum/action/item_action/New(Target, custom_icon, custom_icon_state)
..()
var/obj/item/I = target
I.actions += src
if(custom_icon && custom_icon_state)
use_itemicon = FALSE
icon_icon = custom_icon
button_icon_state = custom_icon_state
/datum/action/item_action/Destroy()
var/obj/item/I = target
I.actions -= src
return ..()
/datum/action/item_action/Trigger()
/datum/action/item_action/Trigger(attack_self = TRUE) //Maybe we don't want to click the thing itself
if(!..())
return 0
if(target)
if(target && attack_self)
var/obj/item/I = target
I.ui_action_click(owner, type)
return 1
@@ -313,6 +319,14 @@
/datum/action/item_action/toggle_helmet
name = "Toggle Helmet"
/datum/action/item_action/remove_tape
name = "Remove Duct Tape"
/datum/action/item_action/remove_tape/Trigger(attack_self = FALSE)
if(..())
GET_COMPONENT_FROM(DT, /datum/component/ducttape, target)
DT.remove_tape(target, usr)
/datum/action/item_action/toggle_jetpack
name = "Toggle Jetpack"
@@ -443,6 +457,9 @@
return 0
var/obj/effect/proc_holder/spell/spell = target
if(spell.special_availability_check)
return 1
if(owner)
return spell.can_cast(owner)
return 0
+70
View File
@@ -0,0 +1,70 @@
/datum/component/ducttape
var/x_offset = 0
var/y_offset = 0
var/icon/tape_overlay = null
/datum/component/ducttape/Initialize(obj/item/I, mob/user, x, y)
if(!istype(I)) //Something went wrong
return
x_offset = x
y_offset = y
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/add_tape_text)
RegisterSignal(parent, COMSIG_OBJ_UPDATE_ICON, .proc/add_tape_overlay)
RegisterSignal(parent, COMSIG_ITEM_AFTERATTACK, .proc/afterattack)
RegisterSignal(parent, COMSIG_ITEM_PICKUP, .proc/pick_up)
I.update_icon() //Do this first so the action button properly shows the icon
var/datum/action/item_action/remove_tape/RT = new(I)
if(I.loc == user)
RT.Grant(user)
/datum/component/proc/add_tape_text(datum/source, mob/user)
to_chat(user, "<span class='notice'>There's some sticky tape attached to [source].</span>")
/datum/component/ducttape/proc/add_tape_overlay(obj/item/O)
tape_overlay = new('icons/obj/bureaucracy.dmi', "tape")
tape_overlay.Shift(EAST, x_offset - 2)
tape_overlay.Shift(NORTH, y_offset - 2)
O.overlays += tape_overlay
/datum/component/ducttape/proc/remove_tape(obj/item/I, mob/user)
to_chat(user, "<span class='notice'>You tear the tape off [I]!</span>")
playsound(I, 'sound/items/poster_ripped.ogg', 50, 1)
new /obj/item/trash/tapetrash(user.loc)
I.update_icon()
I.anchored = initial(I.anchored)
for(var/datum/action/item_action/remove_tape/RT in I.actions)
RT.Remove(user)
RT.Destroy()
I.overlays.Cut(tape_overlay)
user.transfer_fingerprints_to(I)
Destroy()
/datum/component/ducttape/proc/afterattack(obj/item/I, atom/target, mob/user, proximity, params)
if(!proximity)
return
if(!isturf(target))
return
if(!user.unEquip(I))
return
var/turf/source_turf = get_turf(I)
var/turf/target_turf = target
var/list/clickparams = params2list(params)
var/x_offset = text2num(clickparams["icon-x"]) - 16
var/y_offset = text2num(clickparams["icon-y"]) - 16
if(target_turf != get_turf(I)) //Trying to stick it on a wall, don't move it to the actual wall or you can move the item through it. Instead set the pixels as appropriate
var/target_direction = get_dir(source_turf, target_turf)//The direction we clicked
if(target_direction & EAST)
x_offset += 32
else if(target_direction & WEST)
x_offset -= 32
if(target_direction & NORTH)
y_offset += 32
else if(target_direction & SOUTH)
y_offset -= 32
to_chat(user, "<span class='notice'>You stick [I] to [target_turf].</span>")
I.pixel_x = x_offset
I.pixel_y = y_offset
/datum/component/ducttape/proc/pick_up(obj/item/I, mob/user)
I.pixel_x = initial(I.pixel_x)
I.pixel_y = initial(I.pixel_y)
+1
View File
@@ -100,6 +100,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
var/action_icon = 'icons/mob/actions/actions.dmi'
var/action_icon_state = "spell_default"
var/action_background_icon_state = "bg_spell"
var/special_availability_check = 0//Whether the spell needs to bypass the action button's IsAvailable()
var/sound = null //The sound the spell makes when it is cast
+1
View File
@@ -10,6 +10,7 @@
cooldown_min = 30
selection_type = "view"
random_target = 1
special_availability_check = 1
var/start_time = 0
var/ready = 0
var/image/halo = null
+18 -1
View File
@@ -934,7 +934,7 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
/datum/supply_packs/science/oil
name = "Oil Tank Crate"
contains = list(/obj/structure/reagent_dispensers/oil,
contains = list(/obj/structure/reagent_dispensers/oil,
/obj/item/reagent_containers/food/drinks/oilcan)
cost = 10
containertype = /obj/structure/largecrate
@@ -1341,6 +1341,15 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
cost = 15
containername = "bureaucracy crate"
/datum/supply_packs/misc/tape
name = "Sticky Tape Crate"
contains = list(/obj/item/stack/tape_roll,
/obj/item/stack/tape_roll,
/obj/item/stack/tape_roll)
cost = 10
containername = "sticky tape crate"
containertype = /obj/structure/closet/crate/tape
/datum/supply_packs/misc/toner
name = "Toner Cartridges Crate"
contains = list(/obj/item/toner,
@@ -1711,6 +1720,14 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
)
containername = "hygiene station crate"
/datum/supply_packs/misc/snow_machine
name = "Snow Machine Crate"
cost = 20
contains = list(
/obj/machinery/snow_machine
)
special = TRUE
//////////////////////////////////////////////////////////////////////////////
//////////////////////////// Vending /////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
+1
View File
@@ -163,6 +163,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
/datum/uplink_item/jobspecific
category = "Job Specific Tools"
cant_discount = TRUE
excludefrom = list(/datum/game_mode/nuclear) // Stops the job specific category appearing for nukies
//Clown
/datum/uplink_item/jobspecific/clowngrenade