Skip to content

Commit

Permalink
[READY] SNAKES! (tgstation#34724)
Browse files Browse the repository at this point in the history
* actual phobia created

* (LAST ATTEMPT) Adds Snakes

πŸ†‘ Togopal
add: Snakes! They hunt vermin on the station!
add: They can be purchased in cargo.
/πŸ†‘

Mice can be a problem in late round random events, and I figured releasing a bunch of snakes in maintenance would be a more long-term solution than constantly running around with a crowbar when you hear them.

Now with updated sprites!

(I apologize heavily for uploading this three times. I was unaware I was using an older fork, as this was my first attempt at modifying the code.)

* curator gets trauma! and fixes to snek trauma

* fixes the travis error

silly frog

* Reduces the cost of a normal snake crate in Cargo. Adds retaliation to snakes upon being attacked, removes venom from regular snakes.

I A

* quick fix

* quick fix 2

* fixes the cargo contains = list

* go away TRAVIS

* changes the name of the snake cargo crate of regular snakes to avoid confusion

* Updates how some snake mechanics works

Makes them actually retaliate, code is still sort of buggy though

* Some orange fixes

* Fix snakes on this motherfucking plane

* The thing oranges said
  • Loading branch information
Togopalis authored and KorPhaeron committed Jan 25, 2018
1 parent 4e77a06 commit 458c681
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 3 deletions.
6 changes: 4 additions & 2 deletions code/controllers/subsystem/traumas.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SUBSYSTEM_DEF(traumas)
#define PHOBIA_FILE "phobia.json"

/datum/controller/subsystem/traumas/Initialize()
phobia_types = list("spiders", "space", "security", "clowns", "greytide", "lizards", "skeletons")
phobia_types = list("spiders", "space", "security", "clowns", "greytide", "lizards", "skeletons", "snakes")

phobia_words = list("spiders" = strings(PHOBIA_FILE, "spiders"),
"space" = strings(PHOBIA_FILE, "space"),
Expand All @@ -20,11 +20,13 @@ SUBSYSTEM_DEF(traumas)
"greytide" = strings(PHOBIA_FILE, "greytide"),
"lizards" = strings(PHOBIA_FILE, "lizards"),
"skeletons" = strings(PHOBIA_FILE, "skeletons"),
"snakes" = strings(PHOBIA_FILE, "snakes")
)

phobia_mobs = list("spiders" = typecacheof(list(/mob/living/simple_animal/hostile/poison/giant_spider)),
"security" = typecacheof(list(/mob/living/simple_animal/bot/secbot)),
"lizards" = typecacheof(list(/mob/living/simple_animal/hostile/lizard))
"lizards" = typecacheof(list(/mob/living/simple_animal/hostile/lizard)),
"snakes" = typecacheof(list(/mob/living/simple_animal/hostile/retaliate/poison/snake))
)

phobia_objs = list("spiders" = typecacheof(list(/obj/structure/spider)),
Expand Down
8 changes: 8 additions & 0 deletions code/modules/cargo/packs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,14 @@
contains = list(/mob/living/simple_animal/hostile/retaliate/goat)
crate_name = "goat crate"

/datum/supply_pack/organic/critter/snake
name = "Snake Crate"
cost = 3000
contains = list(/mob/living/simple_animal/hostile/retaliate/poison/snake,
/mob/living/simple_animal/hostile/retaliate/poison/snake,
/mob/living/simple_animal/hostile/retaliate/poison/snake)
crate_name = "snake crate"

/datum/supply_pack/organic/critter/chick
name = "Chicken Crate"
cost = 2000
Expand Down
2 changes: 1 addition & 1 deletion code/modules/jobs/job_types/civilian.dm
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Curator
return

H.grant_all_languages(omnitongue=TRUE)

H.gain_trauma(/datum/brain_trauma/mild/phobia, FALSE, "snakes") //why does it have to be snakes...
/*
Lawyer
*/
Expand Down
61 changes: 61 additions & 0 deletions code/modules/mob/living/simple_animal/friendly/snake.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/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)
return .

/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")
ventcrawler = VENTCRAWLER_ALWAYS
density = FALSE
pass_flags = PASSTABLE | PASSMOB
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(istype(HM, /mob/living/simple_animal/mouse))
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(istype(target, /mob/living/simple_animal/mouse))
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)
adjustBruteLoss(-2)
else
return ..()
Binary file modified icons/mob/animal.dmi
Binary file not shown.
13 changes: 13 additions & 0 deletions strings/phobia.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,18 @@
"calcium",
"the ride never ends",
"doot"
],

"snakes": [
"snake",
"snek",
"hiss",
"snecko",
"boop",
"slither",
"fangs",
"anaconda",
"viper",
"python"
]
}
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1881,6 +1881,7 @@
#include "code\modules\mob\living\simple_animal\friendly\penguin.dm"
#include "code\modules\mob\living\simple_animal\friendly\pet.dm"
#include "code\modules\mob\living\simple_animal\friendly\sloth.dm"
#include "code\modules\mob\living\simple_animal\friendly\snake.dm"
#include "code\modules\mob\living\simple_animal\friendly\drone\_drone.dm"
#include "code\modules\mob\living\simple_animal\friendly\drone\drones_as_items.dm"
#include "code\modules\mob\living\simple_animal\friendly\drone\extra_drone_types.dm"
Expand Down

0 comments on commit 458c681

Please sign in to comment.