Goonstation Forums
Nerf rev flashbangs - Printable Version

+- Goonstation Forums (https://forum.ss13.co)
+-- Forum: Discussion (https://forum.ss13.co/forumdisplay.php?fid=6)
+--- Forum: Ideas & Suggestions (https://forum.ss13.co/forumdisplay.php?fid=8)
+--- Thread: Nerf rev flashbangs (/showthread.php?tid=14374)



Nerf rev flashbangs - Lady Birb - 04-21-2020

They instantly shatter implants, bypass sunglasses, hit everyone onscreen, and look the same as normal flashbangs. Way too much for one item.


RE: Nerf rev flashbangs - saccharineChampion - 04-21-2020

What would you change about it to nerf it?

For reference, I got the code for revolutionary flashbangs. code\modules\chemistry\tools\grenades.dm lines 317-350.
Screenshot form:
[Image: unknown.png]

Copyable code form:
Code:
revolution //convertssss
explode()
if (ticker && ticker.mode && istype(ticker.mode, /datum/game_mode/revolution))
var/datum/game_mode/revolution/R = ticker.mode
var/min_dispersal = src.reagents.get_dispersal()
for (var/mob/M in range(max(min_dispersal,6), get_turf(src.loc)))
if (ishuman(M))
var/mob/living/carbon/human/H = M
var/safety = 0
if (H.eyes_protected_from_light() && H.ears_protected_from_sound())
safety = 1

if (safety == 0)
var/can_convert = 1
var/list/U = R.get_unconvertables()
if (!H.client || !H.mind)
can_convert = 0
else if (H.mind in U)
can_convert = 0
else if (H.mind in R.head_revolutionaries)
can_convert = 0
else
can_convert = 1

for (var/obj/item/implant/antirev/found_imp in H.implant)
found_imp.on_remove(H)
H.implant.Remove(found_imp)
qdel(found_imp)

playsound(H.loc, 'sound/impact_sounds/Crystal_Shatter_1.ogg', 50, 0.1, 0, 0.9)
H.visible_message("<span style=\"color:blue\">The loyalty implant inside [H] shatters into one million pieces!</span>")

if (can_convert && !(H.mind in R.revolutionaries))
R.add_revolutionary(H.mind)

Given that, a few notes:
The majority of the code won't run if the victim is both blinded/sunglasses'd/welding masked, AND deafened/earmuffed.
The check for conversion eligibility is performed before it breaks any loyalty implants and is not rechecked after breaking implants. Therefore, a single flashbang won't convert people with a loyalty implant; you'll need to use two of them.
Unless a rev flashbang gets reagents which can boost the dispersal (unsure when/if that can occur in normal gameplay), it converts/breaks with a radius of 6 tiles. For reference, you can be up to 10 tiles away horizontally from something onscreen and still have it visible.


RE: Nerf rev flashbangs - Mouse - 04-21-2020

They've got a pretty small AoE for the implant breaking/revving bit, or at least did when I last used them.


RE: Nerf rev flashbangs - saccharineChampion - 04-21-2020

Today I learned that if you doublepost on the forums, it merges your messages. Now that there's another post (Mouse's) to break such up, I'd like to mention with a separate message that I expanded upon my original post above, outlining the relevant code.

Another quick note I'd like to mention is that unlike EMP and regular flashbang grenades, the revolutionary flashbang does not come in a box of seven; you need to pay two revolution coins for each revolutionary flashbang, not for seven.


RE: Nerf rev flashbangs - Mouse - 04-21-2020

I watched one convert someone with a loyalty implant today. Single flashbang, shattered the implant and converted.


RE: Nerf rev flashbangs - saccharineChampion - 04-21-2020

Are you certain there was only one flashbang? Do you have any screenshots or recordings?

I checked the github's code to make sure my code there wasn't out of date, and it is unchanged.

I'll walk through the code to the best of my understanding. Hopefully if there's some mistake with the code it can be caught due to such: if not, it should demonstrate the intent of the code.

When the code checking the individual M cast as human H runs, if H has an implant, line 331 will get the get_unconvertables() return list defined at code\datums\gamemodes\revolution.dm lines 312-336:
Code:
/datum/game_mode/revolution/proc/get_unconvertables()
    var/list/ucs = list()

    for(var/mob/living/silicon/robot/player in mobs)
        if(player.mind)
            var/rol = player.mind.assigned_role
            if(rol in list("Cyborg"))
                ucs += player.mind

    for(var/mob/living/critter/small_animal/player in mobs)
        if(player.mind)
            if (player.ghost_spawned)
                ucs += player.mind

    for(var/mob/living/carbon/human/player in mobs)
        if(player.mind)
            if (locate(/obj/item/implant/antirev) in player.implant)
                ucs += player.mind
            else
                var/role = player.mind.assigned_role
                if(role in list("Captain", "Head of Security", "Head of Personnel", "Chief Engineer", "Research Director", "Medical Director", "Head Surgeon", "Head of Mining", "Security Officer", "Vice Officer", "Detective", "AI", "Cyborg", "Nanotrasen Special Operative", "Nanotrasen Security Operative","Communications Officer"))
                    ucs += player.mind
    //for(var/mob/living/carbon/human/player in mobs)

    return ucs

The person will be included in locating people with loyalty implants, so back in the grenades code they'll be stored in U. Ergo
Code:
                            else if (H.mind in U)
                                can_convert = 0
would set their can_convert to 0. From then on, there is no way can_convert can get set to 1 by the time lines 349-350 check if they can be converted and convert them if so, which is the only area where the flashbangs can convert people.

I have attempted to replicate the issue on a personal server and have been unable to. It's possible that it did happen, but if it did, it's more of a bug to fix rather than intended behavior that should be nerfed.


RE: Nerf rev flashbangs - Studenterhue - 04-21-2020

My best guess is that there might be a bug that makes the flashbang explode twice somehow, maybe because of lag. I think MBC has gone on to say they're not supposed to convert people with loyalty implants, but I can't find proof.

To my knowledge, it works like this: After checking if it's the revolution mode (which requires a certain amount of players, so it's rather difficult to test this bug on your own), checking if the person within a certain area of effect, and checking if the person has sufficient eye and ear protection from the flash, it checks if the person is the list of unconvertables saccharinechampion posted, among a couple other things.

Having an loyalty implant (called "antirev" in the code") counts as unconvertable, so the code sets the person's can_convert to 0, meaning they can't be converted. For BYOND, 0 usually means false, while 1 thus means true.

When it gets around to actually trying to add people to the list of revolutionaries, i.e. convert them, it checks if that person was NOT already a revolutionary and if their can_convert is true, meaning if their can_convert equals 1 and they can thus be converted into a rev. While a person with a loyalty implant would NOT be in the list of revs, their can_convert is 0, so the check would evaluate to false and thus not convert them.


RE: Nerf rev flashbangs - saccharineChampion - 04-21-2020

Yep, I 100% agree with that explanation of it. (As for difficulty of checking on one's own, I just tweaked a couple of checks to bypass the revolution mode requirement. I encourage anybody trying to fix it to do similar, though do note you'll need to manipulate some of the code which uses the R defined by var/datum/game_mode/revolution/R = ticker.mode.)

My main guess about how it bugged was that maybe it saw a moving person twice when it was making a list of everybody in range; however, I was unable to replicate such an occurrence. The flashbang exploding twice sounds much more likely, especially since we have/had an existing bug where guns sometimes fired projectiles twice.