Skip to content

Commit

Permalink
1 (#36796)
Browse files Browse the repository at this point in the history
  • Loading branch information
boy2mantwicethefam authored Jul 23, 2024
1 parent e07fe6e commit a2c2a62
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 64 deletions.
66 changes: 2 additions & 64 deletions code/_onclick/item_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -108,70 +108,8 @@
if(prob(25))
to_chat(user, "<span class='warning'>[I] passes right through [M]!</span>")
return 0

if(power > 0)
slime.attacked += 10

if(slime.Discipline && prob(50)) // wow, buddy, why am I getting attacked??
slime.Discipline = 0

if(power >= 3)
if(slime.slime_lifestage == SLIME_ADULT)
if(prob(5 + round(power/2)))

if(slime.Victim)
if(prob(80) && !slime.client)
slime.Discipline++
slime.Victim = null
slime.anchored = 0

spawn()
if(slime)
slime.SStun = 1
sleep(rand(5,20))
if(slime)
slime.SStun = 0

spawn(0)
if(slime)
slime.canmove = 0
step_away(slime, user)
if(prob(25 + power))
sleep(2)
if(slime && user)
step_away(slime, user)
slime.canmove = 1

else
if(prob(10 + power*2))
if(slime)
if(slime.Victim)
if(prob(80) && !slime.client)
slime.Discipline++

if(slime.Discipline == 1)
slime.attacked = 0

spawn()
if(slime)
slime.SStun = 1
sleep(rand(5,20))
if(slime)
slime.SStun = 0

slime.Victim = null
slime.anchored = 0


spawn(0)
if(slime && user)
step_away(slime, user)
slime.canmove = 0
if(prob(25 + power*4))
sleep(2)
if(slime && user)
step_away(slime, user)
slime.canmove = 1
//Handles pushing slimes off of targets, making them hostile from being attacked etc.
slime.slime_item_attacked(src, user, power) //The code has been moved to code/modules/mob/living/carbon/slime/slime.dm

var/showname = ""
if(user)
Expand Down
34 changes: 34 additions & 0 deletions code/modules/mob/living/carbon/slime/slime.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,40 @@
/mob/living/carbon/slime/ApplySlip(var/obj/effect/overlay/puddle/P)
return FALSE

//This was previously added directly in item_attack.dm in handle_attack()
//Now it's its own proc that gets called there, freeing up roughly 61 lines of code
/mob/living/carbon/slime/proc/slime_item_attacked(var/obj/item/I, var/mob/living/user, var/force)
if(force > 0)
attacked += 10

if(Discipline && prob(50)) // wow, buddy, why am I getting attacked??
Discipline = 0

if(force >= 3)
var/probability = isslimeadult(src) ? (prob(5 + round(force/2))) : (prob(10 + force*2))
if(probability) //We basically roll the check already in the above variable, to save up on copypaste by not having two separate rolls
if(Victim) //Can only be disciplined if they are currently attacking someone
if(prob(80) && !client)
Discipline++
attacked = !isslimeadult(src) //Adult slimes will not stop attacking, since discipline doesn't affect them.
Victim = null
anchored = 0
spawn()
if(src)
SStun = 1
sleep(rand(5,20))
if(src)
SStun = 0
spawn(0)
if(src)
canmove = 0
step_away(src, user)
if(prob(25 + force * (isslimeadult(src) ? 1 : 4)))
sleep(2)
if(src && user)
step_away(src, user)
canmove = 1

//////////////////////////////Old shit from metroids/RoRos, and the old cores, would not take much work to re-add them////////////////////////

/*
Expand Down

0 comments on commit a2c2a62

Please sign in to comment.