Files
Bubberstation/code/modules/holodeck/items.dm
SkyratBot e9e7d7a461 [MIRROR] Minigame DLC - Intergalactic Basketball League [MDB IGNORE] (#20048)
* Minigame DLC - Intergalactic Basketball League (#72459)

## About The Pull Request
New DLC bout to drop.

![dreamseeker_45s0qiPMXE](https://user-images.githubusercontent.com/5195984/210466427-35b90d46-6620-45e2-8b21-66d1dcada76f.png)

Lots of new things included:
- New basketball minigame that can be played between 2-7 players
- Crafting recipe for basketballs using leather sheets
- Crafting recipe for basketball hoops using metal, rods, and durathread
- New basketball sounds for the ball and hoops
- New scorecard that can be reset using CtrlClick
- Basketball hoops can be rotated using a wrench and AltClick
- Dunking and shooting animations.

### New basketball mechanics that now utilize stamina:

- Dunking costs large stamina and you must be directly adjacent to the
hoop and click on it.
- Shooting costs medium stamina and uses RMB. Shooting lets you aim the
ball over peoples heads, meaning anyone obstructing your path will be
bypassed. There is a half second delay during shooting where someone can
bump or push to prevent the shot from succeeding.
- Shooting from further away results in less accuracy. If you do not
click directly on the hoop, there is also an accuracy penalty!
- Passing costs no stamina and uses LMB. Trying to score into the hoop
via passing results in a reduced chance.
- Spinning costs medium stamina while holding the ball. It gives a
reduced chance for the ball to be stolen but decreases accuracy for
shooting.
- Pushing a player using RMB will attempt to steal the ball and drain
their stamina.
- The chance to steal the ball is based on the stamina of both players
and the direction they are facing. If the person with the ball is at low
stamina, and the person stealing is at full stamina, they will have a
higher chance. Likewise, if the person with the ball is face to face
with the stealer, then there is a higher chance for the ball to be
stolen. If the person has their back to the stealer, then it's a lower
chance.
- Shooting from more than 2 tiles away, results in 3 points. See below
picture to know the distance.

![dreamseeker_1iFLhQGx01](https://user-images.githubusercontent.com/5195984/210469319-162b9745-fcae-4261-92ef-228388eb4f6f.png)

### Now to introduce the teams:

<details>
<summary>Nanotrasen Basketball Department</summary>

![dreamseeker_baSqp2nipv](https://user-images.githubusercontent.com/5195984/210469887-9e0a92d5-d4bd-4da8-9e73-b11d91fdfcd8.png)

</details>

<details>
<summary>Greytide Worldwide</summary>

![dreamseeker_quzZ3KnwpX](https://user-images.githubusercontent.com/5195984/210469923-ed774656-f5cc-43bc-8314-f8309a01c474.png)

</details>

<details>
<summary>Lusty Xenomorphs</summary>

![dreamseeker_VDeT3JQkNF](https://user-images.githubusercontent.com/5195984/210469944-a229e0cc-4b2e-4754-a0b4-6b36953dca2e.png)

</details>

<details>
<summary>Space Surfers</summary>

![dreamseeker_Dh91fznQbN](https://user-images.githubusercontent.com/5195984/210469963-9a85b4e3-b69d-4b66-8c96-4e2ff2b3b983.png)

</details>

---

Big shoutout to the nukie round a few weeks ago where the nuke ops
challenged the crew (and clown) to a basketball match on their rebuilt
basketball shuttle. The nukies won, but it made me realize that the
basketball mechanics were very raw and needed some polishing.

#### TODO LIST

- [x] Fix bug where ball only goes over peoples heads if they are 1 tile
away
- [x] Remove leftover code comments and procs
- [x] Rebalance stamina values (maybe move this to different ball types)
- [x] Fix basketball stadium template runtiming from wall smoothing
during load
- [x] Fix space surfer stadium having an air breach somewhere
- [x] Add more sounds for when ball is passed, shot, or dunked
- [x] Make it so that holding a ball while on the floor isn't possible
(to avoid those meta cheese strats)
- [x] Drop basketball lets mobs make sounds when spinning (need to
detach signal?)
- [x] Finish adding a simple lobby menu for minigame

## Why It's Good For The Game
_If you can't slam with the best, then jam with the rest._

## Changelog
🆑
add: Add crafting recipe for basketballs (leather sheets) and basketball
hoops (metal, rods, and durathread)
add: Add new basketball minigame for 2-7 players. There are 4 different
courts and teams by default with more planned to be added later.
add: New basketball mechanics that uses stamina. Shoot with RMB, pass
with LMB, and dunk by clicking the hoop while adjacent. Spinning while
holding the ball decreases the chance for someone to steal the ball, but
it decreases your shooting accuracy. Shooting from 2 tiles away lets you
score 3 points.
qol: Basketballs now play a buzzer sound when someone scores. CtrlClick
will reset the scorecard and AltClick with a wrench will rotate the
hoop.
qol: Dunking and shooting animations for basketball.
soundadd: Added basketball bounce sound with credits attribution
imageadd: Added basketball icon to minigames. Move baseball and
dodgeball icons to toy/balls.dmi
/🆑

* Minigame DLC - Intergalactic Basketball League

* Update CentCom_skyrat_z2.dmm

* raptor

---------

Co-authored-by: Tim <timothymtorres@gmail.com>
Co-authored-by: lessthnthree <three@lessthanthree.dk>
Co-authored-by: Paxilmaniac <paxilmaniac@gmail.com>
2023-03-27 02:24:29 +01:00

165 lines
4.6 KiB
Plaintext

/*
Items, Structures, Machines
*/
//
// Items
//
/obj/item/melee/energy/sword/holographic
name = "holographic energy sword"
desc = "May the force be with you. Sorta."
damtype = STAMINA
throw_speed = 2
block_chance = 0
throwforce = 0
embedding = null
sword_color_icon = null
active_throwforce = 0
active_sharpness = NONE
active_heat = 0
/obj/item/melee/energy/sword/holographic/Initialize(mapload)
. = ..()
if(!sword_color_icon)
sword_color_icon = pick("red", "blue", "green", "purple")
/obj/item/melee/energy/sword/holographic/green
sword_color_icon = "green"
/obj/item/melee/energy/sword/holographic/red
sword_color_icon = "red"
/obj/item/toy/cards/deck/syndicate/holographic
desc = "A deck of holographic playing cards."
/obj/item/toy/cards/deck/syndicate/holographic/Initialize(mapload, obj/machinery/computer/holodeck/holodeck)
src.holodeck = holodeck
RegisterSignal(src, COMSIG_PARENT_QDELETING, PROC_REF(handle_card_delete))
. = ..()
/obj/item/toy/cards/deck/syndicate/holographic/proc/handle_card_delete(datum/source)
SIGNAL_HANDLER
//if any REAL cards have been inserted into the deck they are moved outside before destroying it
for(var/obj/item/toy/singlecard/card in card_atoms)
if(card.flags_1 & HOLOGRAM_1)
continue
card_atoms -= card
card.forceMove(drop_location())
/obj/item/toy/dodgeball
name = "dodgeball"
icon = 'icons/obj/toys/balls.dmi'
icon_state = "dodgeball"
inhand_icon_state = "dodgeball"
desc = "Used for playing the most violent and degrading of childhood games."
w_class = WEIGHT_CLASS_BULKY //Stops people from hiding it in their bags/pockets
/obj/item/toy/dodgeball/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
..()
if((ishuman(hit_atom)))
var/mob/living/carbon/M = hit_atom
playsound(src, 'sound/items/dodgeball.ogg', 50, TRUE)
M.apply_damage(10, STAMINA)
if(prob(5))
M.Paralyze(60)
visible_message(span_danger("[M] is knocked right off [M.p_their()] feet!"))
//
// Machines
//
/obj/machinery/readybutton
name = "ready declaration device"
desc = "This device is used to declare ready. If all devices in an area are ready, the event will begin!"
icon = 'icons/obj/monitors.dmi'
icon_state = "auth_off"
var/ready = 0
var/area/currentarea = null
var/eventstarted = FALSE
idle_power_usage = BASE_MACHINE_IDLE_CONSUMPTION * 0.02
active_power_usage = BASE_MACHINE_ACTIVE_CONSUMPTION * 0.006
power_channel = AREA_USAGE_ENVIRON
/obj/machinery/readybutton/attack_ai(mob/user)
to_chat(user, span_warning("The station AI is not to interact with these devices!"))
return
/obj/machinery/readybutton/attack_paw(mob/user, list/modifiers)
to_chat(user, span_warning("You are too primitive to use this device!"))
return
/obj/machinery/readybutton/attackby(obj/item/W, mob/user, params)
to_chat(user, span_warning("The device is a solid button, there's nothing you can do with it!"))
/obj/machinery/readybutton/attack_hand(mob/user, list/modifiers)
. = ..()
if(.)
return
if(user.stat || machine_stat & (NOPOWER|BROKEN))
to_chat(user, span_warning("This device is not powered!"))
return
currentarea = get_area(src.loc)
if(!currentarea)
qdel(src)
if(eventstarted)
to_chat(usr, span_warning("The event has already begun!"))
return
ready = !ready
update_appearance()
var/numbuttons = 0
var/numready = 0
for(var/obj/machinery/readybutton/button in currentarea)
numbuttons++
if (button.ready)
numready++
if(numbuttons == numready)
begin_event()
/obj/machinery/readybutton/update_icon_state()
icon_state = "auth_[ready ? "on" : "off"]"
return ..()
/obj/machinery/readybutton/proc/begin_event()
eventstarted = TRUE
for(var/obj/structure/window/W in currentarea)
if(W.flags_1&NODECONSTRUCT_1) // Just in case: only holo-windows
qdel(W)
for(var/mob/M in currentarea)
to_chat(M, span_userdanger("FIGHT!"))
/obj/machinery/conveyor/holodeck
/obj/machinery/conveyor/holodeck/attackby(obj/item/I, mob/user, params)
if(!user.transferItemToLoc(I, drop_location()))
return ..()
/obj/item/paper/fluff/holodeck/trek_diploma
name = "paper - Starfleet Academy Diploma"
default_raw_text = {"<h2>Starfleet Academy</h2></br><p>Official Diploma</p></br>"}
/obj/item/paper/fluff/holodeck/disclaimer
name = "Holodeck Disclaimer"
default_raw_text = "Bruises sustained in the holodeck can be healed simply by sleeping."
/obj/vehicle/ridden/scooter/skateboard/pro/holodeck
name = "holographic skateboard"
desc = "A holographic copy of the EightO brand professional skateboard."
instability = 6
/obj/vehicle/ridden/scooter/skateboard/pro/holodeck/pick_up_board() //picking up normal skateboards spawned in the holodeck gets rid of the holo flag, now you cant pick them up.
return