mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-19 02:59:17 +01:00
About The Pull Request
kép
This PR does the following:
Force event menu uses tgUI.
Arranged events into categories, and added a little description to each. The descriptions appear as tooltips when you hover over the Trigger button.
Rewrote how "Announce to crew?" works. It no longer pops up a panel after the event has been already announced. Instead, the admins select it via a checkbox, and the result is passed through an optional argument.
announceChance's comment is tweaked a bit to reflect how it actually works at the moment.
Moved rpgtitles to wizard events, where it belongs.
Fake Virus and Electric Storms show up to observers, as I believe they are not as common as Space Dust or Camera Failure, and should be cancelable.
Potential issues:
This only solves half of #68408, I don't think admin triggering having a timer and a cancel button is a big issue, as it allows other admins to overrule you if needed, but if i is, I will try to fix it within this PR.
Fixes #68408. Events now spawn immediately, and the the announceChance is overwritten before it begins.
My choices for categories and descriptions might not be the best, feedback would be appreciated.
Why It's Good For The Game
The old spawn menu was completely unorganized, and you could only search using the browser search tool. I believe a built in search bar helps with this issue a bit. I also believe that organizing the events into categories, and adding descriptions will help with newer admins who might not be familiar with all events.
Changelog
cl
refactor: The Force Event UI has been refactored
refactor: Events now have categories and descriptions
refactor: Admin triggered events happen immediately
balance: Fake Virus and Electric Storms are shown to admins, making them cancelable
/cl
87 lines
3.2 KiB
Plaintext
87 lines
3.2 KiB
Plaintext
/datum/round_event_control/wizard/embedpocalypse
|
|
name = "Make Everything Embeddable"
|
|
weight = 2
|
|
typepath = /datum/round_event/wizard/embedpocalypse
|
|
max_occurrences = 1
|
|
earliest_start = 0 MINUTES
|
|
description = "Everything becomes pointy enough to embed in people when thrown."
|
|
|
|
///behold... the only reason sticky is a subtype...
|
|
/datum/round_event_control/wizard/embedpocalypse/canSpawnEvent(players_amt, gamemode)
|
|
if(GLOB.global_funny_embedding)
|
|
return FALSE
|
|
|
|
/datum/round_event/wizard/embedpocalypse/start()
|
|
GLOB.global_funny_embedding = new /datum/global_funny_embedding/pointy
|
|
|
|
/datum/round_event_control/wizard/embedpocalypse/sticky
|
|
name = "Make Everything Sticky"
|
|
weight = 6
|
|
typepath = /datum/round_event/wizard/embedpocalypse/sticky
|
|
max_occurrences = 1
|
|
earliest_start = 0 MINUTES
|
|
description = "Everything becomes sticky enough to be glued to people when thrown."
|
|
|
|
/datum/round_event/wizard/embedpocalypse/sticky/start()
|
|
GLOB.global_funny_embedding = new /datum/global_funny_embedding/sticky
|
|
|
|
///set this to a new instance of a SUBTYPE of global_funny_embedding. The main type is a prototype and will runtime really hard
|
|
GLOBAL_DATUM(global_funny_embedding, /datum/global_funny_embedding)
|
|
|
|
/**
|
|
* ## global_funny_embedding!
|
|
*
|
|
* Stored in a global datum, and created when it is turned on via event or VV'ing the GLOB.embedpocalypse_controller to be a new /datum/global_funny_embedding.
|
|
* Gives every item in the world a prefix to their name, and...
|
|
* Makes every item in the world embed when thrown, but also hooks into global signals for new items created to also bless them with embed-ability(??).
|
|
*/
|
|
/datum/global_funny_embedding
|
|
var/embed_type = EMBED_POINTY
|
|
var/prefix = "error"
|
|
|
|
/datum/global_funny_embedding/New()
|
|
. = ..()
|
|
//second operation takes MUCH longer, so lets set up signals first.
|
|
RegisterSignal(SSdcs, COMSIG_GLOB_NEW_ITEM, .proc/on_new_item_in_existence)
|
|
handle_current_items()
|
|
|
|
/datum/global_funny_embedding/Destroy(force)
|
|
. = ..()
|
|
UnregisterSignal(SSdcs, COMSIG_GLOB_NEW_ITEM)
|
|
|
|
///signal sent by a new item being created.
|
|
/datum/global_funny_embedding/proc/on_new_item_in_existence(datum/source, obj/item/created_item)
|
|
SIGNAL_HANDLER
|
|
|
|
// this proc says it's for initializing components, but we're initializing elements too because it's you and me against the world >:)
|
|
if(LAZYLEN(created_item.embedding))
|
|
return //already embeds to some degree, so whatever 🐀
|
|
created_item.embedding = embed_type
|
|
created_item.name = "[prefix] [created_item.name]"
|
|
created_item.updateEmbedding()
|
|
|
|
/**
|
|
* ### handle_current_items
|
|
*
|
|
* Gives every viable item in the world the embed_type, and the prefix prefixed to the name.
|
|
*/
|
|
/datum/global_funny_embedding/proc/handle_current_items()
|
|
for(var/obj/item/embed_item in world)
|
|
CHECK_TICK
|
|
if(!(embed_item.flags_1 & INITIALIZED_1))
|
|
continue
|
|
if(!embed_item.embedding)
|
|
embed_item.embedding = embed_type
|
|
embed_item.updateEmbedding()
|
|
embed_item.name = "[prefix] [embed_item.name]"
|
|
|
|
///everything will be... POINTY!!!!
|
|
/datum/global_funny_embedding/pointy
|
|
embed_type = EMBED_POINTY
|
|
prefix = "pointy"
|
|
|
|
///everything will be... sticky? sure, why not
|
|
/datum/global_funny_embedding/sticky
|
|
embed_type = EMBED_HARMLESS
|
|
prefix = "sticky"
|