diff --git a/code/game/objects/items/manuals.dm b/code/game/objects/items/manuals.dm index 9d47efe862..d1d9e16b4c 100644 --- a/code/game/objects/items/manuals.dm +++ b/code/game/objects/items/manuals.dm @@ -957,3 +957,60 @@ author = "Engineering Encyclopedia" title = "Hacking" page_link = "Hacking" + +///Reusable books that grant actions (knowledge is power) +/obj/item/book/action_granting + due_date = 0 // Game time in 1/10th seconds + unique = 1 // 0 - Normal book, 1 - Should not be treated as normal book, unable to be copied, unable to be modified + var/datum/action/granted_action = null + var/list/remarks = list() //things to read about while learning. + var/pages_to_mastery = 3 //Essentially controls how long a mob must keep the book in his hand to actually successfully learn + +/obj/item/book/action_granting/attack_self(mob/user) + if(!granted_action) + return + var/datum/action/G = new granted_action + for(var/datum/action/A in user.actions) + if(A.type == G.type) + to_chat(user, "You already know all about [G.name].") + qdel(G) + return + to_chat(user, "You start reading about [G.name]...") + for(var/i=1, i<=pages_to_mastery, i++) + if(!turn_page(user)) + to_chat(user, "You stop reading...") + qdel(G) + return + if(do_after(user,50, user)) + to_chat(user, "You feel like you've got a good handle on [G.name]!") + G.Grant(user) + +/obj/item/book/action_granting/proc/turn_page(mob/user) + playsound(user, pick('sound/effects/pageturn1.ogg','sound/effects/pageturn2.ogg','sound/effects/pageturn3.ogg'), 30, 1) + if(do_after(user,50, user)) + to_chat(user, "[pick(remarks)]") + return 1 + return 0 + +/obj/item/book/action_granting/drink_fling + name = "Tapper: This One's For You" + desc = "A seminal work on the dying art of booze sliding." + icon_state = "barbook" + granted_action = /datum/action/innate/drink_fling + remarks = list("The trick is keeping a low center of gravity it seems...", "The viscosity of the liquid is important...", "Accounting for crosswinds... really?", "Drag coefficients of various popular drinking glasses...", "What the heck is laminar flow and why does it matter here?", "Greasing the bar seems like it'd be cheating...", "I don't think I'll be working with superfluids...") + +/datum/action/innate/drink_fling + name = "Drink Flinging" + desc = "Toggles your ability to satifyingly throw glasses without spilling them." + button_icon_state = "drinkfling_off" + check_flags = 0 + +/datum/action/innate/drink_fling/Activate() + button_icon_state = "drinkfling_on" + active = TRUE + UpdateButtonIcon() + +/datum/action/innate/drink_fling/Deactivate() + button_icon_state = "drinkfling_off" + active = FALSE + UpdateButtonIcon() \ No newline at end of file diff --git a/code/modules/cargo/packs.dm b/code/modules/cargo/packs.dm index 2cc619d284..cc2beb3c2a 100644 --- a/code/modules/cargo/packs.dm +++ b/code/modules/cargo/packs.dm @@ -1212,7 +1212,8 @@ /obj/item/vending_refill/boozeomat, /obj/item/vending_refill/coffee, /obj/item/vending_refill/coffee, - /obj/item/vending_refill/coffee) + /obj/item/vending_refill/coffee, + /obj/item/book/action_granting/drink_fling) crate_name = "bartending supply crate" /datum/supply_pack/organic/vending/snack diff --git a/code/modules/jobs/job_types/cargo_service.dm b/code/modules/jobs/job_types/cargo_service.dm index 441a88a3bd..ee44a16db5 100644 --- a/code/modules/jobs/job_types/cargo_service.dm +++ b/code/modules/jobs/job_types/cargo_service.dm @@ -163,7 +163,7 @@ Bartender ears = /obj/item/device/radio/headset/headset_srv uniform = /obj/item/clothing/under/rank/bartender suit = /obj/item/clothing/suit/armor/vest - backpack_contents = list(/obj/item/storage/box/beanbag=1) + backpack_contents = list(/obj/item/storage/box/beanbag=1,/obj/item/book/action_granting/drink_fling=1) shoes = /obj/item/clothing/shoes/laceup /* diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm index 640f828e18..d6213a391b 100644 --- a/code/modules/reagents/reagent_containers.dm +++ b/code/modules/reagents/reagent_containers.dm @@ -79,7 +79,11 @@ SplashReagents(target, TRUE) /obj/item/reagent_containers/proc/bartender_check(atom/target) - return (target.CanPass(src, get_turf(src)) && thrownby && thrownby.mind && thrownby.mind.assigned_role == "Bartender") + . = FALSE + if(target.CanPass(src, get_turf(src)) && thrownby && thrownby.actions) + for(var/datum/action/innate/drink_fling/D in thrownby.actions) + if(D.active) + return TRUE /obj/item/reagent_containers/proc/SplashReagents(atom/target, thrown = FALSE) if(!reagents || !reagents.total_volume || !spillable) diff --git a/icons/mob/actions.dmi b/icons/mob/actions.dmi index 3a7b0648fd..5c2b85dcf6 100644 Binary files a/icons/mob/actions.dmi and b/icons/mob/actions.dmi differ