Merge branch 'master' into spike-loot-differentces
This commit is contained in:
@@ -45,8 +45,6 @@
|
||||
var/height = 11
|
||||
var/list/grid
|
||||
var/canvas_color = "#ffffff" //empty canvas color
|
||||
var/ui_x = 400
|
||||
var/ui_y = 400
|
||||
var/used = FALSE
|
||||
var/painting_name //Painting name, this is set after framing.
|
||||
var/finalized = FALSE //Blocks edits
|
||||
@@ -75,12 +73,16 @@
|
||||
. = ..()
|
||||
ui_interact(user)
|
||||
|
||||
/obj/item/canvas/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
/obj/item/canvas/ui_state(mob/user)
|
||||
if(finalized)
|
||||
return GLOB.physical_obscured_state
|
||||
else
|
||||
return GLOB.default_state
|
||||
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/obj/item/canvas/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "Canvas", name, ui_x, ui_y, master_ui, state)
|
||||
ui = new(user, src, "Canvas", name)
|
||||
ui.set_autoupdate(FALSE)
|
||||
ui.open()
|
||||
|
||||
@@ -190,8 +192,6 @@
|
||||
icon_state = "19x19"
|
||||
width = 19
|
||||
height = 19
|
||||
ui_x = 600
|
||||
ui_y = 600
|
||||
pixel_x = 6
|
||||
pixel_y = 9
|
||||
framed_offset_x = 8
|
||||
@@ -201,8 +201,6 @@
|
||||
icon_state = "23x19"
|
||||
width = 23
|
||||
height = 19
|
||||
ui_x = 800
|
||||
ui_y = 600
|
||||
pixel_x = 4
|
||||
pixel_y = 10
|
||||
framed_offset_x = 6
|
||||
@@ -212,8 +210,6 @@
|
||||
icon_state = "23x23"
|
||||
width = 23
|
||||
height = 23
|
||||
ui_x = 800
|
||||
ui_y = 800
|
||||
pixel_x = 5
|
||||
pixel_y = 9
|
||||
framed_offset_x = 5
|
||||
@@ -262,7 +258,7 @@
|
||||
/obj/structure/sign/painting/examine(mob/user)
|
||||
. = ..()
|
||||
if(C)
|
||||
C.ui_interact(user,state = GLOB.physical_obscured_state)
|
||||
C.ui_interact(user)
|
||||
|
||||
/obj/structure/sign/painting/wirecutter_act(mob/living/user, obj/item/I)
|
||||
. = ..()
|
||||
|
||||
@@ -319,10 +319,43 @@
|
||||
throwforce = 10
|
||||
throw_range = 3
|
||||
hitsound = 'sound/items/trayhit1.ogg'
|
||||
block_chance = 50
|
||||
custom_materials = list(/datum/material/iron = 2000)
|
||||
var/break_chance = 5 //Likely hood of smashing the chair.
|
||||
var/obj/structure/chair/origin_type = /obj/structure/chair
|
||||
item_flags = ITEM_CAN_PARRY | ITEM_CAN_BLOCK
|
||||
block_parry_data = /datum/block_parry_data/chair
|
||||
|
||||
/obj/item/chair/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/two_handed, require_twohands = TRUE)
|
||||
|
||||
/datum/block_parry_data/chair
|
||||
block_damage_multiplier = 0.7
|
||||
block_stamina_efficiency = 2
|
||||
block_stamina_cost_per_second = 1.5
|
||||
block_slowdown = 0.5
|
||||
block_lock_attacking = FALSE
|
||||
block_lock_sprinting = TRUE
|
||||
block_start_delay = 1.5
|
||||
block_damage_absorption = 7
|
||||
block_damage_limit = 20
|
||||
block_resting_stamina_penalty_multiplier = 2
|
||||
block_projectile_mitigation = 20
|
||||
parry_stamina_cost = 5
|
||||
parry_time_windup = 1
|
||||
parry_time_active = 11
|
||||
parry_time_spindown = 2
|
||||
parry_time_perfect = 1.5
|
||||
parry_time_perfect_leeway = 1
|
||||
parry_imperfect_falloff_percent = 7.5
|
||||
parry_efficiency_to_counterattack = 100
|
||||
parry_efficiency_considered_successful = 50
|
||||
parry_efficiency_perfect = 120
|
||||
parry_efficiency_perfect_override = list(
|
||||
TEXT_ATTACK_TYPE_PROJECTILE = 30,
|
||||
)
|
||||
parry_failed_stagger_duration = 3.5 SECONDS
|
||||
parry_data = list(PARRY_COUNTERATTACK_MELEE_ATTACK_CHAIN = 2.5)
|
||||
|
||||
/obj/item/chair/suicide_act(mob/living/carbon/user)
|
||||
user.visible_message("<span class='suicide'>[user] begins hitting [user.p_them()]self with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
|
||||
@@ -345,3 +345,212 @@
|
||||
name = initial(I.name)
|
||||
icon = initial(I.icon)
|
||||
icon_state = initial(I.icon_state)
|
||||
/* Selling people in jars is currently disabled.
|
||||
/obj/structure/displaycase/forsale
|
||||
name = "vend-a-tray"
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon_state = "laserbox0"
|
||||
desc = "A display case with an ID-card swiper. Use your ID to purchase the contents."
|
||||
density = FALSE
|
||||
max_integrity = 100
|
||||
req_access = null
|
||||
showpiece_type = /obj/item/reagent_containers/food
|
||||
alert = FALSE //No, we're not calling the fire department because someone stole your cookie.
|
||||
glass_fix = FALSE //Fixable with tools instead.
|
||||
///The price of the item being sold. Altered by grab intent ID use.
|
||||
var/sale_price = 20
|
||||
///The Account which will receive payment for purchases. Set by the first ID to swipe the tray.
|
||||
var/datum/bank_account/payments_acc = null
|
||||
///We're using the same trick as paper does in order to cache the image, and only load the UI when messed with.
|
||||
var/list/viewing_ui = list()
|
||||
|
||||
/obj/structure/displaycase/forsale/update_icon() //remind me to fix my shitcode later
|
||||
var/icon/I
|
||||
if(open)
|
||||
I = icon('icons/obj/stationobjs.dmi',"laserboxb0")
|
||||
else
|
||||
I = icon('icons/obj/stationobjs.dmi',"laserbox0")
|
||||
if(!showpiece && !open)
|
||||
I = icon('icons/obj/stationobjs.dmi',"laserbox_open")
|
||||
if(broken)
|
||||
I = icon('icons/obj/stationobjs.dmi',"laserbox_broken")
|
||||
if(showpiece)
|
||||
var/icon/S = getFlatIcon(showpiece)
|
||||
S.Scale(17,17)
|
||||
I.Blend(S,ICON_UNDERLAY,8,12)
|
||||
src.icon = I
|
||||
return
|
||||
|
||||
/obj/structure/displaycase/forsale/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "Vendatray", name)
|
||||
ui.set_autoupdate(FALSE)
|
||||
viewing_ui[user] = ui
|
||||
ui.open()
|
||||
|
||||
/obj/structure/displaycase/forsale/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
var/register = FALSE
|
||||
if(payments_acc)
|
||||
register = TRUE
|
||||
data["owner_name"] = payments_acc.account_holder
|
||||
if(showpiece)
|
||||
data["product_name"] = capitalize(showpiece.name)
|
||||
var/base64 = icon2base64(icon(showpiece.icon, showpiece.icon_state))
|
||||
data["product_icon"] = base64
|
||||
data["registered"] = register
|
||||
data["product_cost"] = sale_price
|
||||
data["tray_open"] = open
|
||||
return data
|
||||
|
||||
/obj/structure/displaycase/forsale/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
var/obj/item/card/id/potential_acc = usr.get_idcard(hand_first = TRUE)
|
||||
switch(action)
|
||||
if("Buy")
|
||||
if(!showpiece)
|
||||
to_chat(usr, "<span class='notice'>There's nothing for sale.</span>")
|
||||
return TRUE
|
||||
if(broken)
|
||||
to_chat(usr, "<span class='notice'>[src] appears to be broken.</span>")
|
||||
return TRUE
|
||||
if(!payments_acc)
|
||||
to_chat(usr, "<span class='notice'>[src] hasn't been registered yet.</span>")
|
||||
return TRUE
|
||||
if(!usr.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
return TRUE
|
||||
if(!potential_acc)
|
||||
to_chat(usr, "<span class='notice'>No ID card detected.</span>")
|
||||
return
|
||||
var/datum/bank_account/account = potential_acc.registered_account
|
||||
if(!account)
|
||||
to_chat(usr, "<span class='notice'>[potential_acc] has no account registered!</span>")
|
||||
return
|
||||
if(!account.has_money(sale_price))
|
||||
to_chat(usr, "<span class='notice'>You do not possess the funds to purchase this.</span>")
|
||||
return TRUE
|
||||
else
|
||||
account.adjust_money(-sale_price)
|
||||
if(payments_acc)
|
||||
payments_acc.adjust_money(sale_price)
|
||||
usr.put_in_hands(showpiece)
|
||||
to_chat(usr, "<span class='notice'>You purchase [showpiece] for [sale_price] credits.</span>")
|
||||
playsound(src, 'sound/effects/cashregister.ogg', 40, TRUE)
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
flick("laserbox_vend", src)
|
||||
showpiece = null
|
||||
update_icon()
|
||||
SStgui.update_uis(src)
|
||||
return TRUE
|
||||
if("Open")
|
||||
if(!payments_acc)
|
||||
to_chat(usr, "<span class='notice'>[src] hasn't been registered yet.</span>")
|
||||
return TRUE
|
||||
if(!potential_acc || !potential_acc.registered_account)
|
||||
return
|
||||
if(!check_access(potential_acc))
|
||||
playsound(src, 'sound/machines/buzz-sigh.ogg', 50, TRUE)
|
||||
return
|
||||
toggle_lock()
|
||||
SStgui.update_uis(src)
|
||||
if("Register")
|
||||
if(payments_acc)
|
||||
return
|
||||
if(!potential_acc || !potential_acc.registered_account)
|
||||
return
|
||||
if(!check_access(potential_acc))
|
||||
playsound(src, 'sound/machines/buzz-sigh.ogg', 50, TRUE)
|
||||
return
|
||||
payments_acc = potential_acc.registered_account
|
||||
playsound(src, 'sound/machines/click.ogg', 20, TRUE)
|
||||
if("Adjust")
|
||||
if(!check_access(potential_acc) || potential_acc.registered_account != payments_acc)
|
||||
playsound(src, 'sound/machines/buzz-sigh.ogg', 50, TRUE)
|
||||
return
|
||||
|
||||
var/new_price_input = input(usr,"Set the sale price for this vend-a-tray.","new price",0) as num|null
|
||||
if(isnull(new_price_input) || (payments_acc != potential_acc.registered_account))
|
||||
to_chat(usr, "<span class='warning'>[src] rejects your new price.</span>")
|
||||
return
|
||||
if(!usr.canUseTopic(src, BE_CLOSE, FALSE, NO_TK) )
|
||||
to_chat(usr, "<span class='warning'>You need to get closer!</span>")
|
||||
return
|
||||
new_price_input = clamp(round(new_price_input, 1), 10, 1000)
|
||||
sale_price = new_price_input
|
||||
to_chat(usr, "<span class='notice'>The cost is now set to [sale_price].</span>")
|
||||
SStgui.update_uis(src)
|
||||
return TRUE
|
||||
. = TRUE
|
||||
/obj/structure/displaycase/forsale/attackby(obj/item/I, mob/living/user, params)
|
||||
if(isidcard(I))
|
||||
//Card Registration
|
||||
var/obj/item/card/id/potential_acc = I
|
||||
if(!potential_acc.registered_account)
|
||||
to_chat(user, "<span class='warning'>This ID card has no account registered!</span>")
|
||||
return
|
||||
if(payments_acc == potential_acc.registered_account)
|
||||
playsound(src, 'sound/machines/click.ogg', 20, TRUE)
|
||||
toggle_lock()
|
||||
return
|
||||
if(istype(I, /obj/item/pda))
|
||||
return TRUE
|
||||
SStgui.update_uis(src)
|
||||
. = ..()
|
||||
|
||||
|
||||
/obj/structure/displaycase/forsale/multitool_act(mob/living/user, obj/item/I)
|
||||
. = ..()
|
||||
if(obj_integrity <= (integrity_failure * max_integrity))
|
||||
to_chat(user, "<span class='notice'>You start recalibrating [src]'s hover field...</span>")
|
||||
if(do_after(user, 20, target = src))
|
||||
broken = 0
|
||||
obj_integrity = max_integrity
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/structure/displaycase/forsale/wrench_act(mob/living/user, obj/item/I)
|
||||
. = ..()
|
||||
if(open && user.a_intent == INTENT_HELP )
|
||||
if(anchored)
|
||||
to_chat(user, "<span class='notice'>You start unsecuring [src]...</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You start securing [src]...</span>")
|
||||
if(I.use_tool(src, user, 16, volume=50))
|
||||
if(QDELETED(I))
|
||||
return
|
||||
if(anchored)
|
||||
to_chat(user, "<span class='notice'>You unsecure [src].</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You secure [src].</span>")
|
||||
anchored = !anchored
|
||||
return
|
||||
else if(!open && user.a_intent == INTENT_HELP)
|
||||
to_chat(user, "<span class='notice'>[src] must be open to move it.</span>")
|
||||
return
|
||||
|
||||
/obj/structure/displaycase/forsale/emag_act(mob/user)
|
||||
. = ..()
|
||||
payments_acc = null
|
||||
req_access = list()
|
||||
to_chat(user, "<span class='warning'>[src]'s card reader fizzles and smokes, and the account owner is reset.</span>")
|
||||
|
||||
/obj/structure/displaycase/forsale/examine(mob/user)
|
||||
. = ..()
|
||||
if(showpiece && !open)
|
||||
. += "<span class='notice'>[showpiece] is for sale for [sale_price] credits.</span>"
|
||||
if(broken)
|
||||
. += "<span class='notice'>[src] is sparking and the hover field generator seems to be overloaded. Use a multitool to fix it.</span>"
|
||||
|
||||
/obj/structure/displaycase/forsale/obj_break(damage_flag)
|
||||
if(!broken && !(flags_1 & NODECONSTRUCT_1))
|
||||
broken = TRUE
|
||||
playsound(src, "shatter", 70, TRUE)
|
||||
update_icon()
|
||||
trigger_alarm() //In case it's given an alarm anyway.
|
||||
|
||||
/obj/structure/displaycase/forsale/kitchen
|
||||
desc = "A display case with an ID-card swiper. Use your ID to purchase the contents. Meant for the bartender and chef."
|
||||
req_one_access = list(ACCESS_KITCHEN, ACCESS_BAR)
|
||||
*/
|
||||
@@ -67,15 +67,14 @@
|
||||
to_chat(user, "<span class='notice'>You put [I] in [src].</span>")
|
||||
update_icon()
|
||||
|
||||
/obj/structure/tank_dispenser/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "TankDispenser", name, 275, 103, master_ui, state)
|
||||
ui.open()
|
||||
/obj/structure/tank_dispenser/ui_state(mob/user)
|
||||
return GLOB.physical_state
|
||||
|
||||
/obj/structure/tank_dispenser/attack_robot(mob/user)
|
||||
ui_interact(user)
|
||||
/obj/structure/tank_dispenser/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "TankDispenser", name)
|
||||
ui.open()
|
||||
|
||||
/obj/structure/tank_dispenser/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
@@ -17,7 +17,6 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
|
||||
layer = ABOVE_OBJ_LAYER //Just above doors
|
||||
pressure_resistance = 4*ONE_ATMOSPHERE
|
||||
anchored = TRUE //initially is 0 for tile smoothing
|
||||
flags_1 = ON_BORDER_1
|
||||
max_integrity = 25
|
||||
var/ini_dir = null
|
||||
var/state = WINDOW_OUT_OF_FRAME
|
||||
@@ -38,7 +37,8 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
|
||||
var/hitsound = 'sound/effects/Glasshit.ogg'
|
||||
rad_insulation = RAD_VERY_LIGHT_INSULATION
|
||||
rad_flags = RAD_PROTECT_CONTENTS
|
||||
flags_ricochet = RICOCHET_HARD
|
||||
flags_1 = ON_BORDER_1|DEFAULT_RICOCHET_1
|
||||
flags_ricochet = RICOCHET_HARD
|
||||
ricochet_chance_mod = 0.4
|
||||
attack_hand_speed = CLICK_CD_MELEE
|
||||
attack_hand_is_action = TRUE
|
||||
|
||||
Reference in New Issue
Block a user