Skip to content

Commit

Permalink
Anti spam
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben10083 committed Mar 27, 2024
1 parent 1cf5fbb commit 03d1d48
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -235,19 +235,18 @@
chance -= 30 // stronger grip
// above code means that if you are super strong, 80% chance to resist, otherwise, 20 percent. if both are super strong, standard 50.

//we do code to add floor and ceiling to chance
if(chance > 100)
chance = 100
else if(chance < 0)
chance = 0
if(prob(chance))
playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 25, 1, 7)
visible_message(SPAN_DANGER("[src] has broken free of [pulledby]'s grip!"), null, null, 5)
pulledby.stop_pulling()
return TRUE
if(moving_resist && client) //we resisted by trying to move
visible_message(SPAN_DANGER("[src] struggles to break free of [pulledby]'s grip!"), null, null, 5)
client.next_movement = world.time + (10*pulledby.grab_level) + client.move_delay
// +1 delay if super strong, also done as passive grabs would have a modifier of 0 otherwise, causing spam
if(HAS_TRAIT(pulledby, TRAIT_SUPER_STRONG) && !HAS_TRAIT(user, TRAIT_SUPER_STRONG))
client.next_movement = world.time + (10*(pulledby.grab_level + 1)) + client.move_delay
else
client.next_movement = world.time + (10*pulledby.grab_level) + client.move_delay
else
pulledby.stop_pulling()
return TRUE
Expand Down

0 comments on commit 03d1d48

Please sign in to comment.