Skip to content

Commit

Permalink
pulse demon reopened PR (ParadiseSS13#21969)
Browse files Browse the repository at this point in the history
* proof-of-concept implementation

* clear being_hijacked on death

* it glows in the dark

* oops

* machinery interactions and some fixes

* consistency, correctness, fixes

* stop usage of the \the text macro

* list inits in Initialize

* fix control flow spacing

* review compliance

* event code and some tweaks

* upgradable spell abilities and some tweaks

* how did that happen

* cycle cameras spell

* stat upgrades (no sprites for now)

* tweaking

* sounds

* jecties code

* more tweaks and fixes

* some review stuff

* alt-click user param and charger icon fix

* Remove unused default amounts in objectives

* Comply with sirryan review (part 1)

* Move isapc definition

* Add autodoc comments to all pulse_demon vars

* Give random number in name on init

* Fix merge conflicts

* Remove pulse demon from traitors on Destroy

* Fix mulebot relaymove override

* Fix airlock TGUI actions

* Fix loop over mobs in cablehop

* Attempt to fix overload runtime

* Half-fix gun cooldown issue

* Fix chat related issues

* Attempt to fix overload runtime (take 2)

* Make ion projectiles collide

* Tweak pulse demon speed

* Make demon survive loc being deleted

* Send message when saved by self-sustaining

* Fix vv_edit_var for charge

* Stop people disabling hijacked bots

* Make demon lose more health when not on wires

* Increase costs of stat upgrades

* Allow demon to change its drain speed

* Stop demon obliterating xenos

* Comply with review (partial)

* Fix issues pointed out in reviews

* Allow demon to drain charge of reachable items

* Adjust volume of demon sounds

* Improve cell interactions

* Bump up event weight (for testmerge)

* Give pulse demon a highlight section on orbit menu

* Give demon an experimental soft-counter to insuls

* Reduce volume of most common sounds (again)

* Update demon cable overlay when required

* Stop AI using its tracking ability on pulse demons

* Add wizard spawner for pulse demon

* Tweak EMP behaviour and numbers

* Clear references in Destroy

* Make appear on end of round credits even when dead

* Prevent pulse demon from detonating cyborgs

* Generalise insulated structure check

* Clean up remaining review requests

* Add new sprites

* some addressed reviews

* Typepath changes, GC fixes

* I blame charlie

* good enough

* die or something

* Update code/game/gamemodes/miniantags/pulsedemon/pulsedemon.dm

Co-authored-by: Luc <[email protected]>

* Update code/game/gamemodes/miniantags/pulsedemon/pulsedemon_interactions.dm

Co-authored-by: Luc <[email protected]>

* Update code/game/gamemodes/miniantags/pulsedemon/pulsedemon_interactions.dm

Co-authored-by: Luc <[email protected]>

* even more changes

* final tweaks

* what

* Update code/game/gamemodes/miniantags/pulsedemon/pulsedemon_interactions.dm

Co-authored-by: Henri215 <[email protected]>

* Update code/game/gamemodes/miniantags/pulsedemon/pulsedemon_abilities.dm

Co-authored-by: Henri215 <[email protected]>

* Update code/game/gamemodes/miniantags/pulsedemon/pulsedemon.dm

Co-authored-by: Henri215 <[email protected]>

* Update code/game/gamemodes/miniantags/pulsedemon/pulsedemon.dm

Co-authored-by: Henri215 <[email protected]>

* bam

* Update code/game/gamemodes/miniantags/pulsedemon/pulsedemon.dm

Co-authored-by: DGamerL <[email protected]>

* Update code/game/gamemodes/miniantags/pulsedemon/pulsedemon.dm

Co-authored-by: DGamerL <[email protected]>

* Update code/game/gamemodes/miniantags/pulsedemon/pulsedemon.dm

Co-authored-by: DGamerL <[email protected]>

* Update code/game/gamemodes/miniantags/pulsedemon/pulsedemon.dm

Co-authored-by: DGamerL <[email protected]>

* Update code/game/gamemodes/miniantags/pulsedemon/pulsedemon.dm

Co-authored-by: DGamerL <[email protected]>

* to_chatn't

* deconflicted

---------

Co-authored-by: unknownuser782 <[email protected]>
Co-authored-by: Luc <[email protected]>
Co-authored-by: Henri215 <[email protected]>
Co-authored-by: DGamerL <[email protected]>
  • Loading branch information
5 people authored Sep 20, 2023
1 parent 7cd7102 commit f135863
Show file tree
Hide file tree
Showing 50 changed files with 1,968 additions and 73 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#define COMPONENT_GLOB_BLOCK_CINEMATIC (1<<0)
/// ingame button pressed (/obj/machinery/button/button)
#define COMSIG_GLOB_BUTTON_PRESSED "!button_pressed"
/// cable was placed or joined somewhere : (turf)
#define COMSIG_GLOB_CABLE_UPDATED "!cable_updated"

/// signals from globally accessible objects

Expand Down
4 changes: 4 additions & 0 deletions code/__DEFINES/is_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,17 @@

#define isslime(A) (istype((A), /mob/living/simple_animal/slime))

#define ispulsedemon(A) (istype(A, /mob/living/simple_animal/demon/pulse_demon))

// Objects
#define isobj(A) istype(A, /obj) //override the byond proc because it returns true on children of /atom/movable that aren't objs

#define isitem(A) (istype(A, /obj/item))

#define ismachinery(A) (istype(A, /obj/machinery))

#define isapc(A) (istype(A, /obj/machinery/power/apc))

#define ismecha(A) (istype(A, /obj/mecha))

#define iseffect(A) (istype(A, /obj/effect))
Expand Down
22 changes: 22 additions & 0 deletions code/__HELPERS/text.dm
Original file line number Diff line number Diff line change
Expand Up @@ -746,3 +746,25 @@
return TRUE
else
return FALSE

/**
* Formats num with an SI prefix.
*
* Returns a string formatted with a multiple of num and an SI prefix corresponding to an exponent of 10.
* Only considers exponents that are multiples of 3 (deca, deci, hecto, and centi are not included).
* A unit is not included in the string, the prefix is placed after the number with no spacing added anywhere.
* Listing of prefixes: https://en.wikipedia.org/wiki/Metric_prefix#List_of_SI_prefixes
*/
/proc/format_si_suffix(num)
if(num == 0)
return "[num]"

var/exponent = round_down(log(10, abs(num)))
var/ofthree = exponent / 3
if(exponent < 0)
ofthree = round(ofthree)
else
ofthree = round_down(ofthree)
if(ofthree == 0)
return "[num]"
return "[num / (10 ** (ofthree * 3))][GLOB.si_suffixes[round(length(GLOB.si_suffixes) / 2) + ofthree + 1]]"
7 changes: 7 additions & 0 deletions code/__HELPERS/trait_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@
: FALSE)
#define HAS_TRAIT_NOT_FROM(target, trait, source) (target.status_traits ? (target.status_traits[trait] ? (length(target.status_traits[trait] - source) > 0) : FALSE) : FALSE)

/// Gives a unique trait source for any given datum
#define UNIQUE_TRAIT_SOURCE(target) "unique_source_[UID(target)]"

/*
Remember to update _globalvars/traits.dm if you're adding/removing/renaming traits.
*/
Expand Down Expand Up @@ -235,6 +238,9 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
/// An advanced surgical tool. If a surgical tool has this flag, it will be able to automatically repeat steps until they succeed.
#define TRAIT_ADVANCED_SURGICAL "advanced_surgical"

/// Prevent mobs on the turf from being affected by anything below that turf, such as a pulse demon going under it. Added by a /obj/structure with creates_cover set to TRUE
#define TRAIT_TURF_COVERED "turf_covered"

///An item that is oiled. If sprayed with water, it's slowdown reverts to normal.
#define TRAIT_OIL_SLICKED "oil_slicked"

Expand Down Expand Up @@ -278,6 +284,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define ENFORCER_GLOVES "enforcer_gloves"
#define HOLO_CIGAR "holo_cigar"
#define GLADIATOR "gladiator"
#define PULSEDEMON_TRAIT "pulse_demon"

//quirk traits
#define TRAIT_ALCOHOL_TOLERANCE "alcohol_tolerance"
Expand Down
2 changes: 2 additions & 0 deletions code/_globalvars/lists/misc_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ GLOBAL_LIST_INIT(html_colors, list("Alice Blue","Antique White","Aqua","Aquamari

GLOBAL_LIST_INIT(day_names, list("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"))
GLOBAL_LIST_INIT(month_names, list("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"))
// keep si_suffixes balanced and with a pivot in the middle!
GLOBAL_LIST_INIT(si_suffixes, list("y", "z", "a", "f", "p", "n", "u", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"))

GLOBAL_LIST_INIT(restricted_camera_networks, list(
"CentComm",
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/cyborg.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

/mob/living/silicon/robot/ClickOn(atom/A, params)
if(client.click_intercept)
if(client?.click_intercept)
client.click_intercept.InterceptClickOn(src, params, A)
return

Expand Down
39 changes: 13 additions & 26 deletions code/_onclick/hud/action_button.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@

/obj/screen/movable/action_button/Click(location,control,params)
var/list/modifiers = params2list(params)
if(usr.next_click > world.time)
return FALSE
usr.changeNext_click(1)
if(modifiers["shift"])
if(locked)
to_chat(usr, "<span class='warning'>Action button \"[name]\" is locked, unlock it first.</span>")
Expand All @@ -43,15 +46,18 @@
locked = !locked
to_chat(usr, "<span class='notice'>Action button \"[name]\" [locked ? "" : "un"]locked.</span>")
return TRUE
if(usr.next_click > world.time)
return
usr.next_click = world.time + 1
if(modifiers["alt"])
AltClick(usr)
return TRUE
if(modifiers["middle"])
linked_action.Trigger(left_click = FALSE)
return TRUE
linked_action.Trigger(left_click = TRUE)
linked_action.Trigger(TRUE)
return TRUE

/obj/screen/movable/action_button/AltClick(mob/user)
return linked_action.AltTrigger()

//Hide/Show Action Buttons ... Button
/obj/screen/movable/action_button/hide_toggle
name = "Hide Buttons"
Expand All @@ -68,28 +74,9 @@
return ..()

/obj/screen/movable/action_button/hide_toggle/Click(location,control,params)
var/list/modifiers = params2list(params)
if(modifiers["shift"])
if(locked)
to_chat(usr, "<span class='warning'>Action button \"[name]\" is locked, unlock it first.</span>")
return TRUE
moved = FALSE
usr.update_action_buttons(TRUE)
return TRUE
if(modifiers["ctrl"])
locked = !locked
to_chat(usr, "<span class='notice'>Action button \"[name]\" [locked ? "" : "un"]locked.</span>")
return TRUE
if(modifiers["alt"])
for(var/V in usr.actions)
var/datum/action/A = V
var/obj/screen/movable/action_button/B = A.button
B.moved = FALSE
moved = FALSE
usr.update_action_buttons(TRUE)
to_chat(usr, "<span class='notice'>Action button positions have been reset.</span>")
return TRUE
usr.hud_used.action_buttons_hidden = !usr.hud_used.action_buttons_hidden
. = ..()
if(!.)
usr.hud_used.action_buttons_hidden = !usr.hud_used.action_buttons_hidden

hidden = usr.hud_used.action_buttons_hidden
if(hidden)
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/hud/radial.dm
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ GLOBAL_LIST_EMPTY(radial_menus)
return
current_user = M.client
//Blank
menu_holder = image(icon = 'icons/effects/effects.dmi', loc = anchor,icon_state = "nothing", layer = ABOVE_HUD_LAYER)
menu_holder = image(icon = 'icons/effects/effects.dmi', loc = anchor, icon_state = "nothing", layer = ABOVE_HUD_LAYER)
menu_holder.appearance_flags |= KEEP_APART
menu_holder.vis_contents += elements + close_button
current_user.images += menu_holder
Expand Down
10 changes: 10 additions & 0 deletions code/datums/action.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
return FALSE
return TRUE

/datum/action/proc/AltTrigger()
Trigger()
return FALSE

/datum/action/proc/Process()
return

Expand Down Expand Up @@ -577,6 +581,12 @@
spell.Click()
return TRUE

/datum/action/spell_action/AltTrigger()
if(target)
var/obj/effect/proc_holder/spell/spell = target
spell.AltClick(usr)
return TRUE

/datum/action/spell_action/IsAvailable()
if(!target)
return FALSE
Expand Down
3 changes: 3 additions & 0 deletions code/datums/spell.dm
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell))
choose_targets(usr)
return 1

/obj/effect/proc_holder/spell/AltClick(mob/user)
return Click()

/obj/effect/proc_holder/spell/InterceptClickOn(mob/user, params, atom/A)
. = ..()
if(.)
Expand Down
3 changes: 3 additions & 0 deletions code/game/gamemodes/miniantags/demons/demon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@
whisper_action = new()
whisper_action.Grant(src)

/mob/living/simple_animal/demon/Destroy()
QDEL_NULL(whisper_action)
return ..()
Loading

0 comments on commit f135863

Please sign in to comment.