Files
DGamerL de6a54fbde Removes all mentions of return . where they would be unnecessary (#25142)
* Removes all mentions of `return .`

* I can do this all day

* Arthri review

* Update code/__HELPERS/sanitize_values.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/__HELPERS/sanitize_values.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

---------

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
2024-04-23 00:49:52 +00:00

62 lines
1.9 KiB
Plaintext

/mob/living/simple_animal/hostile/retaliate/poison
var/poison_per_bite = 0
var/poison_type = "toxin"
/mob/living/simple_animal/hostile/retaliate/poison/AttackingTarget()
. = ..()
if(. && isliving(target))
var/mob/living/L = target
if(L.reagents && !poison_per_bite == 0)
L.reagents.add_reagent(poison_type, poison_per_bite)
/mob/living/simple_animal/hostile/retaliate/poison/snake
name = "snake"
desc = "A slithery snake. These legless reptiles are the bane of mice and adventurers alike."
icon_state = "snake"
icon_living = "snake"
icon_dead = "snake_dead"
speak_emote = list("hisses")
health = 20
maxHealth = 20
attacktext = "bites"
melee_damage_lower = 5
melee_damage_upper = 6
response_help = "pets"
response_disarm = "shoos"
response_harm = "steps on"
faction = list("hostile", "jungle")
ventcrawler = VENTCRAWLER_ALWAYS
density = FALSE
pass_flags = PASSTABLE | PASSMOB
mob_biotypes = MOB_ORGANIC | MOB_BEAST | MOB_REPTILE
mob_size = MOB_SIZE_SMALL
gold_core_spawnable = FRIENDLY_SPAWN
obj_damage = 0
environment_smash = ENVIRONMENT_SMASH_NONE
/mob/living/simple_animal/hostile/retaliate/poison/snake/ListTargets(atom/the_target)
. = oview(vision_range, targets_from) //get list of things in vision range
var/list/living_mobs = list()
var/list/mice = list()
for(var/HM in .)
//Yum a tasty mouse
if(ismouse(HM))
mice += HM
if(isliving(HM))
living_mobs += HM
// if no tasty mice to chase, lets chase any living mob enemies in our vision range
if(length(mice) == 0)
//Filter living mobs (in range mobs) by those we consider enemies (retaliate behaviour)
return living_mobs & enemies
return mice
/mob/living/simple_animal/hostile/retaliate/poison/snake/AttackingTarget()
if(ismouse(target))
visible_message("<span class='notice'>[name] consumes [target] in a single gulp!</span>", "<span class='notice'>You consume [target] in a single gulp!</span>")
QDEL_NULL(target)
adjustHealth(-2)
else
return ..()