Skip to content

Commit 2596488

Browse files
authored
Optimizes pitbull code (#38353)
extra line removed
1 parent 4d8e2bb commit 2596488

File tree

2 files changed

+10
-20
lines changed

2 files changed

+10
-20
lines changed

code/modules/mob/living/simple_animal/hostile/pitbull.dm

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -81,31 +81,35 @@
8181
/mob/living/simple_animal/hostile/pitbull/summoned_pitbull
8282
faction = "wizard" // so they get along with other wizard mobs
8383
meat_type = /obj/item/weapon/ectoplasm //a magical dog
84+
var/fade_chance = 95
8485

8586
/mob/living/simple_animal/hostile/pitbull/summoned_pitbull/death(var/gibbed = FALSE)
8687
..()
8788
if(!gibbed)
88-
if(prob(95))
89+
if(prob(fade_chance))
8990
animate(src, alpha = 0, time = 4 SECONDS)
9091
spawn(4 SECONDS)
9192
qdel(src)
9293
else
9394
gib()
9495

95-
/mob/living/simple_animal/hostile/pitbull/smashednslammed
96+
/mob/living/simple_animal/hostile/pitbull/summoned_pitbull/smashednslammed
9697
name = "toadline pitbull"
9798
icon_state = "toadlinepitbull"
9899
icon_living = "toadlinepitbull"
99100
icon_dead = "toadlinepitbull_dead"
101+
faction = "hostile"
100102
pass_flags = PASSMOB|PASSDOOR //so smashed and slammed they can squeeze through doors
101103
health = 35
102104
maxHealth = 35
103105
speed = 3 //stumpier legs move slower
104106

105107
melee_damage_lower = 4
106108
melee_damage_upper = 6 //stumpy but they hit harder
109+
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat/animal
110+
fade_chance = 90
107111

108-
/mob/living/simple_animal/hostile/pitbull/smashednslammed/New()
112+
/mob/living/simple_animal/hostile/pitbull/summoned_pitbull/smashednslammed/New()
109113
..()
110114
desc = pick(
111115
"SMASHED and SLAMMED",
@@ -115,17 +119,3 @@
115119
"Two times Pimpy...",
116120
"Three times Bape!",
117121
"Not a family tree, but a family circle.")
118-
119-
/mob/living/simple_animal/hostile/pitbull/smashednslammed/summoned_pitbull
120-
faction = "wizard" // so they get along with other wizard mobs
121-
meat_type = /obj/item/weapon/ectoplasm //a magical dog
122-
123-
/mob/living/simple_animal/hostile/pitbull/smashednslammed/summoned_pitbull/death(var/gibbed = FALSE)
124-
..()
125-
if(!gibbed)
126-
if(prob(90))
127-
animate(src, alpha = 0, time = 4 SECONDS)
128-
spawn(4 SECONDS)
129-
qdel(src)
130-
else
131-
gib()

code/modules/spells/aoe_turf/conjure/pitbulls.dm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@
2828

2929
/spell/aoe_turf/conjure/pitbull/invocation(mob/user, list/targets)
3030
if(empowered)
31-
invocation = pick("P'MPY S'N 'PP", "P'MPY S'N 'PP", "R'V'R'D' K'NN'LS", "BL'DSK'LL")
31+
invocation = pick("P'MPY S'N 'PP", "P'MPY S'N 'PP", "R'V'R'D' K'NN'LS", "BL'DSK'LL")
3232
..()
3333

3434
var/list/pitbulls_exclude_kinlist = list() //all pitbulls go in here so pitbulls won't attack other pitbulls when feeling treacherous (and instead attack the wizard)
3535

3636
/spell/aoe_turf/conjure/pitbull/perform(mob/user = usr, skipcharge = 0, list/target_override, var/ignore_timeless = FALSE, var/ignore_path = null)
3737
if(empowered)
38-
summon_type = list(/mob/living/simple_animal/hostile/pitbull/smashednslammed/summoned_pitbull)
38+
summon_type = list(/mob/living/simple_animal/hostile/pitbull/summoned_pitbull/smashednslammed)
3939
..()
4040

4141
/spell/aoe_turf/conjure/pitbull/summon_object(var/type, var/location)
4242
if(empowered)
43-
var/mob/living/simple_animal/hostile/pitbull/smashednslammed/summoned_pitbull/P = new type(location)
43+
var/mob/living/simple_animal/hostile/pitbull/summoned_pitbull/smashednslammed/P = new type(location)
4444
P.friends.Add(holder)
4545
else
4646
var/mob/living/simple_animal/hostile/pitbull/summoned_pitbull/P = new type(location)

0 commit comments

Comments
 (0)