mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 08:37:43 +01:00
Deathmatch modifiers (#81673)
## About The Pull Request This PR adds the base to simple modifiers that the host can select to make the minigame ~~worse~~ more entertaining for everyone. Here's the screenshot of the UI (without a few modifiers I added later):  ## Why It's Good For The Game I've seen this minigame is frankly popular lately, so I thought I could contribute to it. ## Changelog 🆑 add: Added 20+ modifiers to the deathmatch minigame, which can be enabled by the host. /🆑
This commit is contained in:
@@ -10,10 +10,8 @@
|
||||
var/bonus_tame_chance
|
||||
///Current chance to tame on interaction
|
||||
var/current_tame_chance
|
||||
///For effects once soemthing is tamed
|
||||
var/datum/callback/after_tame
|
||||
|
||||
/datum/component/tameable/Initialize(food_types, tame_chance, bonus_tame_chance, datum/callback/after_tame, unique = TRUE)
|
||||
/datum/component/tameable/Initialize(food_types, tame_chance, bonus_tame_chance, unique = TRUE)
|
||||
if(!isatom(parent)) //yes, you could make a tameable toolbox.
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
|
||||
@@ -24,18 +22,12 @@
|
||||
src.current_tame_chance = tame_chance
|
||||
if(bonus_tame_chance)
|
||||
src.bonus_tame_chance = bonus_tame_chance
|
||||
if(after_tame)
|
||||
src.after_tame = after_tame
|
||||
src.unique = unique
|
||||
|
||||
RegisterSignal(parent, COMSIG_ATOM_ATTACKBY, PROC_REF(try_tame))
|
||||
RegisterSignal(parent, COMSIG_SIMPLEMOB_SENTIENCEPOTION, PROC_REF(on_tame)) //Instantly succeeds
|
||||
RegisterSignal(parent, COMSIG_SIMPLEMOB_TRANSFERPOTION, PROC_REF(on_tame)) //Instantly succeeds
|
||||
|
||||
/datum/component/tameable/Destroy(force)
|
||||
after_tame = null
|
||||
return ..()
|
||||
|
||||
/datum/component/tameable/proc/try_tame(datum/source, obj/item/food, mob/living/attacker, params)
|
||||
SIGNAL_HANDLER
|
||||
if(!is_type_in_list(food, food_types))
|
||||
@@ -70,9 +62,9 @@
|
||||
return living_parent.faction.Find(REF(potential_friend))
|
||||
|
||||
///Ran once taming succeeds
|
||||
/datum/component/tameable/proc/on_tame(atom/source, mob/living/tamer, atom/food, inform_tamer = FALSE)
|
||||
/datum/component/tameable/proc/on_tame(atom/source, mob/living/tamer, obj/item/food, inform_tamer = FALSE)
|
||||
SIGNAL_HANDLER
|
||||
after_tame?.Invoke(tamer, food)//Run custom behavior if needed
|
||||
source.tamed(tamer, food)//Run custom behavior if needed
|
||||
|
||||
if(isliving(parent) && isliving(tamer))
|
||||
INVOKE_ASYNC(source, TYPE_PROC_REF(/mob/living, befriend), tamer)
|
||||
|
||||
Reference in New Issue
Block a user