diff --git a/code/__HELPERS/AnimationLibrary.dm b/code/__HELPERS/AnimationLibrary.dm index cc496a85b63..7bbeb0a8c80 100644 --- a/code/__HELPERS/AnimationLibrary.dm +++ b/code/__HELPERS/AnimationLibrary.dm @@ -188,3 +188,21 @@ animate(A, transform = matrix(punchstr, MATRIX_ROTATE), pixel_y = 16, time = 2, color = "#eeeeee", easing = BOUNCE_EASING) animate(transform = matrix(-punchstr, MATRIX_ROTATE), pixel_y = original_y, time = 2, color = "#ffffff", easing = BOUNCE_EASING) animate(transform = null, time = 3, easing = BOUNCE_EASING) + +/proc/animate_rumble(atom/A) + var/static/list/transforms + if(!transforms) + var/matrix/M1 = matrix() + var/matrix/M2 = matrix() + var/matrix/M3 = matrix() + var/matrix/M4 = matrix() + M1.Translate(-1, 0) + M2.Translate(0, 1) + M3.Translate(1, 0) + M4.Translate(0, -1) + transforms = list(M1, M2, M3, M4) + + animate(A, transform = transforms[1], time = 0.2, loop = -1) + animate(transform = transforms[2], time = 0.1) + animate(transform = transforms[3], time = 0.2) + animate(transform = transforms[4], time = 0.3) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index dcf08d93b5c..38e16bfa892 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -463,12 +463,15 @@ Turf and target are seperate in case you want to teleport some distance from a t if(GLOB.stealthminID[P] == txt) return P -// Returns the atom sitting on the turf. -// For example, using this on a disk, which is in a bag, on a mob, will return the mob because it's on the turf. -/proc/get_atom_on_turf(var/atom/movable/M) +//Returns the atom sitting on the turf. +//For example, using this on a disk, which is in a bag, on a mob, will return the mob because it's on the turf. +//Optional arg 'type' to stop once it reaches a specific type instead of a turf. +/proc/get_atom_on_turf(atom/movable/M, stop_type) var/atom/loc = M - while(loc && loc.loc && !istype(loc.loc, /turf/)) + while(loc?.loc && !isturf(loc.loc)) loc = loc.loc + if(stop_type && istype(loc, stop_type)) + break return loc /* @@ -2116,7 +2119,7 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new) return "White Noise" if(CHANNEL_AMBIENCE) return "Ambience" - + /proc/slot_bitfield_to_slot(input_slot_flags) // Kill off this garbage ASAP; slot flags and clothing flags should be IDENTICAL. GOSH DARN IT. Doesn't work with ears or pockets, either. switch(input_slot_flags) if(SLOT_OCLOTHING) diff --git a/code/game/objects/items/his_grace.dm b/code/game/objects/items/his_grace.dm index a12378e3a2c..e86d82fef36 100644 --- a/code/game/objects/items/his_grace.dm +++ b/code/game/objects/items/his_grace.dm @@ -8,8 +8,8 @@ /obj/item/his_grace name = "artistic toolbox" desc = "A toolbox painted bright green. Looking at it makes you feel uneasy." - icon = 'icons/obj/items.dmi' - icon_state = "his_grace" + icon = 'icons/obj/storage.dmi' + icon_state = "green" item_state = "artistic_toolbox" lefthand_file = 'icons/mob/inhands/equipment/toolbox_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/toolbox_righthand.dmi' @@ -17,6 +17,8 @@ force = 12 attack_verb = list("robusted") hitsound = 'sound/weapons/smash.ogg' + drop_sound = 'sound/items/handling/toolbox_drop.ogg' + pickup_sound = 'sound/items/handling/toolbox_pickup.ogg' var/awakened = FALSE var/bloodthirst = HIS_GRACE_SATIATED var/prev_bloodthirst = HIS_GRACE_SATIATED @@ -30,6 +32,7 @@ START_PROCESSING(SSprocessing, src) GLOB.poi_list |= src RegisterSignal(src, COMSIG_MOVABLE_POST_THROW, .proc/move_gracefully) + update_icon() /obj/item/his_grace/Destroy() STOP_PROCESSING(SSprocessing, src) @@ -38,6 +41,17 @@ GLOB.poi_list -= src return ..() +/obj/item/his_grace/update_icon() + icon_state = ascended ? "gold" : "green" + item_state = ascended ? "toolbox_gold" : "artistic_toolbox" + cut_overlays() + if(ascended) + add_overlay("triple_latch") + else if(awakened) + add_overlay("single_latch_open") + else + add_overlay("single_latch") + /obj/item/his_grace/attack_self(mob/living/user) if(!awakened) INVOKE_ASYNC(src, .proc/awaken, user) @@ -48,8 +62,8 @@ else ..() -/obj/item/his_grace/CtrlClick(mob/user) //you can't pull his grace - return +/obj/item/his_grace/can_be_pulled(user, grab_state, force, show_message = FALSE) //you can't pull his grace + return FALSE /obj/item/his_grace/examine(mob/user) . = ..() @@ -137,6 +151,7 @@ adjust_bloodthirst(1) force_bonus = HIS_GRACE_FORCE_BONUS * length(contents) playsound(user, 'sound/effects/pope_entry.ogg', 100) + update_icon() move_gracefully() /obj/item/his_grace/proc/move_gracefully() @@ -144,22 +159,7 @@ if(!awakened) return - var/static/list/transforms - if(!transforms) - var/matrix/M1 = matrix() - var/matrix/M2 = matrix() - var/matrix/M3 = matrix() - var/matrix/M4 = matrix() - M1.Translate(-1, 0) - M2.Translate(0, 1) - M3.Translate(1, 0) - M4.Translate(0, -1) - transforms = list(M1, M2, M3, M4) - - animate(src, transform = transforms[1], time = 0.2, loop = -1) - animate(transform = transforms[2], time = 0.1) - animate(transform = transforms[3], time = 0.2) - animate(transform = transforms[4], time = 0.3) + animate_rumble(src) /obj/item/his_grace/proc/drowse() //Good night, Mr. Grace. if(!awakened || ascended) @@ -169,20 +169,20 @@ playsound(loc, 'sound/weapons/batonextend.ogg', 100, TRUE) name = initial(name) desc = initial(desc) - icon_state = initial(icon_state) animate(src, transform = matrix()) gender = initial(gender) force = initial(force) force_bonus = initial(force_bonus) awakened = FALSE bloodthirst = 0 + update_icon() /obj/item/his_grace/proc/consume(mob/living/meal) //Here's your dinner, Mr. Grace. if(!meal) return var/victims = 0 meal.visible_message("[src] swings open and devours [meal]!", "[src] consumes you!") - meal.adjustBruteLoss(200) + meal.adjustBruteLoss(300) playsound(meal, 'sound/misc/desceration-02.ogg', 75, TRUE) playsound(src, 'sound/items/eatfood.ogg', 100, TRUE) meal.forceMove(src) @@ -248,13 +248,14 @@ /obj/item/his_grace/proc/ascend() if(ascended) return - var/mob/living/carbon/human/master = loc force_bonus += ascend_bonus desc = "A legendary toolbox and a distant artifact from The Age of Three Powers. On its three latches engraved are the words \"The Sun\", \"The Moon\", and \"The Stars\". The entire toolbox has the words \"The World\" engraved into its sides." icon_state = "his_grace_ascended" item_state = "toolbox_gold" ascended = TRUE + update_icon() playsound(src, 'sound/effects/his_grace_ascend.ogg', 100) + var/mob/living/carbon/human/master = loc if(istype(master)) master.visible_message("Gods will be watching.") name = "[master]'s mythical toolbox of three powers" diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index dfda4710537..f8722ad8a75 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -1159,44 +1159,45 @@ /obj/item/toy/windup_toolbox name = "windup toolbox" desc = "A replica toolbox that rumbles when you turn the key." - icon = 'icons/obj/items.dmi' - icon_state = "his_grace" + icon = 'icons/obj/storage.dmi' + icon_state = "green" item_state = "artistic_toolbox" lefthand_file = 'icons/mob/inhands/equipment/toolbox_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/toolbox_righthand.dmi' hitsound = 'sound/weapons/smash.ogg' + drop_sound = 'sound/items/handling/toolbox_drop.ogg' + pickup_sound = 'sound/items/handling/toolbox_pickup.ogg' attack_verb = list("robusted") var/active = FALSE +/obj/item/toy/windup_toolbox/Initialize(mapload) + . = ..() + update_icon() + +/obj/item/toy/windup_toolbox/update_icon() + ..() + cut_overlays() + if(active) + add_overlay("single_latch_open") + else + add_overlay("single_latch") + /obj/item/toy/windup_toolbox/attack_self(mob/user) if(!active) to_chat(user, "You wind up [src], it begins to rumble.") active = TRUE + update_icon() playsound(src, 'sound/effects/pope_entry.ogg', 100) - Rumble() - addtimer(CALLBACK(src, .proc/stopRumble), 600) + animate_rumble(src) + addtimer(CALLBACK(src, .proc/stopRumble), 60 SECONDS) else to_chat(user, "[src] is already active!") -/obj/item/toy/windup_toolbox/proc/Rumble() - var/static/list/transforms - if(!transforms) - var/matrix/M1 = matrix() - var/matrix/M2 = matrix() - var/matrix/M3 = matrix() - var/matrix/M4 = matrix() - M1.Translate(-1, 0) - M2.Translate(0, 1) - M3.Translate(1, 0) - M4.Translate(0, -1) - transforms = list(M1, M2, M3, M4) - animate(src, transform = transforms[1], time = 0.2, loop = -1) - animate(transform = transforms[2], time = 0.1) - animate(transform = transforms[3], time = 0.2) - animate(transform = transforms[4], time = 0.3) - /obj/item/toy/windup_toolbox/proc/stopRumble() active = FALSE + update_icon() + visible_message("[src] slowly stops rattling and falls still, its latch snapping shut.") //subtle difference + playsound(loc, 'sound/weapons/batonextend.ogg', 100, TRUE) animate(src, transform = matrix()) /* diff --git a/icons/obj/items.dmi b/icons/obj/items.dmi index beb04347d22..dc45f40197c 100644 Binary files a/icons/obj/items.dmi and b/icons/obj/items.dmi differ diff --git a/icons/obj/storage.dmi b/icons/obj/storage.dmi index 28b2a79a06d..9444f06b996 100644 Binary files a/icons/obj/storage.dmi and b/icons/obj/storage.dmi differ