Skip to content

Commit

Permalink
[MIRROR] [NO GBP] Fixing the multi-dimensional bomb payload (#1209)
Browse files Browse the repository at this point in the history
* [NO GBP] Fixing the multi-dimensional bomb payload

* Increases the cost of the bomb

---------

Co-authored-by: Ghom <[email protected]>
Co-authored-by: Bloop <[email protected]>
  • Loading branch information
3 people authored and StealsThePRs committed Feb 29, 2024
1 parent 3640943 commit 75c8fc2
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions code/game/machinery/syndicatebomb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,73 @@

qdel(src)

<<<<<<< HEAD

Check failure on line 587 in code/game/machinery/syndicatebomb.dm

View workflow job for this annotation

GitHub Actions / Run Linters

got '<<', expected one of: newline, '/', identifier
=======
#define DIMENSION_CHOICE_RANDOM "None/Randomized"

/obj/item/bombcore/dimensional
name = "multi-dimensional payload"
desc = "A wicked payload meant to wildly transmutate terrain over a wide area, a power no mere human should wield."
range_heavy = 17
var/datum/dimension_theme/chosen_theme

/obj/item/bombcore/dimensional/Destroy()
chosen_theme = null
return ..()

/obj/item/bombcore/dimensional/examine(mob/user)
. = ..()
. += span_notice("Use in hand to change the linked dimension. Current dimension: [chosen_theme?.name || "None, output will be random"].")

/obj/item/bombcore/dimensional/attack_self(mob/user)
. = ..()
var/list/choosable_dimensions = list()
var/datum/radial_menu_choice/null_choice = new
null_choice.name = DIMENSION_CHOICE_RANDOM
choosable_dimensions[DIMENSION_CHOICE_RANDOM] = null_choice
for(var/datum/dimension_theme/theme as anything in SSmaterials.dimensional_themes)
var/datum/radial_menu_choice/theme_choice = new
theme_choice.image = image(initial(theme.icon), initial(theme.icon_state))
theme_choice.name = initial(theme.name)
choosable_dimensions[theme] = theme_choice

var/datum/dimension_theme/picked = show_radial_menu(user, src, choosable_dimensions, custom_check = CALLBACK(src, PROC_REF(check_menu), user), radius = 38, require_near = TRUE)
if(isnull(picked))
return
if(picked == DIMENSION_CHOICE_RANDOM)
chosen_theme = null
else
chosen_theme = picked
balloon_alert(user, "set to [chosen_theme?.name || DIMENSION_CHOICE_RANDOM]")

/obj/item/bombcore/dimensional/proc/check_menu(mob/user)
if(!user.is_holding(src) || user.incapacitated())
return FALSE
return TRUE

/obj/item/bombcore/dimensional/detonate()
var/list/affected_turfs = circle_range_turfs(src, range_heavy)
var/theme_count = length(SSmaterials.dimensional_themes)
var/num_affected = 0
for(var/turf/affected as anything in affected_turfs)
var/datum/dimension_theme/theme_to_use
if(isnull(chosen_theme))
theme_to_use = SSmaterials.dimensional_themes[SSmaterials.dimensional_themes[rand(1, theme_count)]]
else
theme_to_use = SSmaterials.dimensional_themes[chosen_theme]
if(!theme_to_use.can_convert(affected))
continue
num_affected++
var/skip_sound = TRUE
if(num_affected % 5) //makes it play the sound more sparingly
skip_sound = FALSE
var/time_mult = round(get_dist_euclidian(get_turf(src), affected)) + 1
addtimer(CALLBACK(theme_to_use, TYPE_PROC_REF(/datum/dimension_theme, apply_theme), affected, skip_sound, TRUE), 0.1 SECONDS * time_mult)
qdel(src)

#undef DIMENSION_CHOICE_RANDOM

>>>>>>> beb979d19ac ([MIRROR] [NO GBP] Fixing the multi-dimensional bomb payload (#1209))
///Syndicate Detonator (aka the big red button)///

/obj/item/syndicatedetonator
Expand Down

0 comments on commit 75c8fc2

Please sign in to comment.