From 2683da821c17c6587635dcfd5fe66de9c46062d6 Mon Sep 17 00:00:00 2001 From: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com> Date: Fri, 7 Jul 2023 14:45:54 +0200 Subject: [PATCH] Implements balling (#21441) * Implement balling * docstring --- code/game/objects/items/sport.dm | 14 ++++++++++++++ code/modules/admin/verbs/onlyoneteam.dm | 1 + 2 files changed, 15 insertions(+) diff --git a/code/game/objects/items/sport.dm b/code/game/objects/items/sport.dm index 3587b2bec3b..4f1f0e29235 100644 --- a/code/game/objects/items/sport.dm +++ b/code/game/objects/items/sport.dm @@ -12,6 +12,18 @@ throw_speed = 1 throw_range = 20 flags = CONDUCT + /// Whether `attack_self` will move ("dribble") it to the other hand + var/dribbleable = FALSE // Most balls do not have a dribble animation + +/obj/item/beach_ball/attack_self(mob/user) + if(!dribbleable) + return + + if(!user.get_inactive_hand()) // We ballin + user.unEquip(src) + user.put_in_inactive_hand(src) + else + to_chat(user, "You can't dribble to an occupied hand!") /obj/item/beach_ball/baseball name = "baseball" @@ -27,6 +39,7 @@ icon = 'icons/obj/basketball.dmi' icon_state = "dodgeball" item_state = "dodgeball" + dribbleable = TRUE var/list/suit_types = list(/obj/item/clothing/suit/redtag, /obj/item/clothing/suit/bluetag) /obj/item/beach_ball/dodgeball/throw_impact(atom/hit_atom) @@ -44,6 +57,7 @@ icon = 'icons/obj/basketball.dmi' icon_state = "basketball" item_state = "basketball" + dribbleable = TRUE w_class = WEIGHT_CLASS_BULKY //Stops people from hiding it in their bags/pockets /obj/structure/holohoop diff --git a/code/modules/admin/verbs/onlyoneteam.dm b/code/modules/admin/verbs/onlyoneteam.dm index b343dde435c..d71e8b3a687 100644 --- a/code/modules/admin/verbs/onlyoneteam.dm +++ b/code/modules/admin/verbs/onlyoneteam.dm @@ -67,6 +67,7 @@ icon = 'icons/obj/basketball.dmi' icon_state = "dodgeball" item_state = "dodgeball" + dribbleable = TRUE /obj/item/beach_ball/dodgeball_team/throw_impact(atom/hit_atom) ..()