Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PORT&FEAT] Mobs pack - Part 1 #310

Merged
merged 19 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
403 changes: 339 additions & 64 deletions _maps/map_files220/cyberiad/cyberiad.dmm

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/human_mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2179,7 +2179,7 @@ Eyes need to have significantly high darksight to shine unless the mob has the X
set category = "IC"

update_flavor_text()

/mob/living/carbon/human/proc/apply_offstation_roles(source)
SIGNAL_HANDLER
mind.offstation_role = TRUE
5 changes: 4 additions & 1 deletion code/modules/mob/living/living_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,10 @@

for(var/obj/item/grab/G in grabbed_by)
if(G.assailant == user)
to_chat(user, "<span class='notice'>You already grabbed [src].</span>")
if(holder_type) // SS220 EDIT START
get_scooped(user)
else
to_chat(user, "<span class='notice'>Вы уже схватили [src.name].</span>") // SS220 EDIT END
return

add_attack_logs(user, src, "Grabbed passively", ATKLOG_ALL)
Expand Down
5 changes: 4 additions & 1 deletion code/modules/mob/living/simple_animal/animal_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)

if(INTENT_GRAB)
grabbedby(M)
if(holder_type) // SS220 EDIT START
get_scooped(M)
else
grabbedby(M) // SS220 EDIT END

if(INTENT_HARM, INTENT_DISARM)
if(HAS_TRAIT(M, TRAIT_PACIFISM))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
to_chat(src, "<span class='warning'>Unable to find any unwelded vents to spawn mice at.</span>")
return FALSE
var/obj/vent_found = pick(found_vents)
var/mob/living/simple_animal/mouse/host = new(vent_found.loc)
var/mob/living/simple_animal/mouse/host = prob(20) ? new /mob/living/simple_animal/mouse/rat(vent_found.loc) : new(vent_found.loc) // SS220 EDIT
host.ckey = src.ckey
to_chat(host, "<span class='info'>You are now a mouse. Try to avoid interaction with players, and do not give hints away that you are more than a simple rodent.</span>")
host.forceMove(vent_found)
Expand Down
2 changes: 1 addition & 1 deletion modular_ss220/events/_events.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/datum/modpack/events
name = "Кастомные ивенты"
desc = "Добавление новых ивентов"
author = "dj-34"
author = "dj-34, PhantomRU"
2 changes: 2 additions & 0 deletions modular_ss220/events/_events.dme
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "_events.dm"

#include "code/new_space_laws.dm"
#include "code/headcrabs.dm"
#include "code/infestation_extended.dm"
72 changes: 72 additions & 0 deletions modular_ss220/events/code/headcrabs.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#define HEADCRAB_NORMAL 0
#define HEADCRAB_FASTMIX 1
#define HEADCRAB_FAST 2
#define HEADCRAB_POISONMIX 3
#define HEADCRAB_POISON 4
#define HEADCRAB_SPAWNER 5

/datum/event/headcrabs
announceWhen = 10
endWhen = 11
var/locstring
var/headcrab_type

/datum/event/headcrabs/start()
var/list/availableareas = list()
for(var/area/station/maintenance/A in world)
availableareas += A
var/area/randomarea = pick(availableareas)
var/list/turf/simulated/floor/turfs = list()
for(var/turf/simulated/floor/F in randomarea)
if(turf_clear(F))
turfs += F
var/list/spawn_types = list()
var/max_number
headcrab_type = rand(0, 5)
switch(headcrab_type)
if(HEADCRAB_NORMAL)
spawn_types = list(/mob/living/simple_animal/hostile/headcrab)
max_number = 6
if(HEADCRAB_FASTMIX)
spawn_types = list(/mob/living/simple_animal/hostile/headcrab, /mob/living/simple_animal/hostile/headcrab/fast)
max_number = 8
if(HEADCRAB_FAST)
spawn_types = list(/mob/living/simple_animal/hostile/headcrab/fast)
max_number = 6
if(HEADCRAB_POISONMIX)
spawn_types = list(/mob/living/simple_animal/hostile/headcrab, /mob/living/simple_animal/hostile/headcrab/poison)
max_number = 4
if(HEADCRAB_POISON)
spawn_types = list(/mob/living/simple_animal/hostile/headcrab/poison)
max_number = 3
if(HEADCRAB_SPAWNER)
spawn_types = list(/obj/structure/spawner/headcrab)
max_number = 2


var/num = rand(2,max_number)

while(turfs.len > 0 && num > 0)
var/turf/simulated/floor/T = pick(turfs)
turfs.Remove(T)
num--
var/spawn_type = pick(spawn_types)
new spawn_type(T)

if(prob(15))
var/turf/simulated/floor/T = pick(turfs)
new /obj/structure/spawner/headcrab(T)

/datum/event/headcrabs/announce()
GLOB.major_announcement.Announce("Биосканеры фиксируют размножение хедкрабов на борту станции. Избавьтесь от них, прежде чем это начнет влиять на продуктивность станции", "ВНИМАНИЕ: НЕОПОЗНАННЫЕ ФОРМЫ ЖИЗНИ.")

/datum/event_container/mundane/New()
. = ..()
available_events |= new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Headcrab Infestation", /datum/event/headcrabs, 100, list(ASSIGNMENT_SECURITY = 30), TRUE)

#undef HEADCRAB_NORMAL
#undef HEADCRAB_FASTMIX
#undef HEADCRAB_FAST
#undef HEADCRAB_POISONMIX
#undef HEADCRAB_POISON
#undef HEADCRAB_SPAWNER
123 changes: 123 additions & 0 deletions modular_ss220/events/code/infestation_extended.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
#define VERM_RATS 0
#define VERM_AXOLOTL 1
#define VERM_FROGS 2
#define VERM_IGUANAS 3
#define VERM_SNAKES 4
#define VERM_MOTH 5
#define VERM_MOTHROACH 6

/datum/event/infestation/extended
announceWhen = 10
endWhen = 11
var/static/list/spawn_areas_extended = list(
/area/station/service/chapel,
/area/station/service/library,
/area/station/service/hydroponics,
/area/station/service/cafeteria,
/area/station/service/hydroponics,
/area/station/service/bar,
/area/station/service/kitchen,
/area/station/service/janitor,
/area/station/public/construction,
/area/station/public/arcade,
/area/station/public/toilet,
/area/station/public/fitness,
/area/station/engineering/atmos,
/area/station/engineering/tech_storage,
/area/station/security/armory/secure,
/area/station/security/permabrig,
/area/station/security/lobby,
/area/station/security/prison/cell_block/A,
/area/station/security/prison/cell_block/B,
/area/station/security/prison/cell_block/C,
)

/datum/event/infestation/extended/start()
var/list/turf/simulated/floor/turfs = list()
spawn_area_type = pick(spawn_areas_extended)
for(var/areapath in typesof(spawn_area_type))
var/area/A = locate(areapath)
if(!A)
log_debug("Failed to locate area for extended infestation event!")
kill()
return
for(var/turf/simulated/floor/F in A.contents)
if(turf_clear(F))
turfs += F

var/list/spawn_types = list()
var/max_number
vermin = rand(0, 6)
switch(vermin)
if(VERM_RATS)
max_number = 12
var/possible_vermin = rand(0, 2)
switch(possible_vermin)
if(0)
spawn_types = list(/mob/living/simple_animal/mouse/rat)
vermstring = "крыс"
if(1)
spawn_types = list(/mob/living/simple_animal/mouse/rat/irish)
vermstring = "ирландских крыс борцов за независимость"
if(2)
spawn_types = list(/mob/living/simple_animal/mouse/rat/white)
vermstring = "лабораторных крыс"
if(VERM_AXOLOTL)
spawn_types = list(/mob/living/simple_animal/lizard/axolotl)
max_number = 9
vermstring = "аксолотлей"
if(VERM_IGUANAS)
spawn_types = list(/mob/living/simple_animal/hostile/lizard)
max_number = 5
vermstring = "игуанн"
if(prob(10))
spawn_types = list(/mob/living/simple_animal/hostile/lizard/gator)
max_number = 3
vermstring = "аллигаторов"
if(VERM_SNAKES)
spawn_types = list(/mob/living/simple_animal/hostile/poison_snake)
max_number = 9
vermstring = "ядовитых змей"
if(VERM_MOTH)
spawn_types = list(/mob/living/simple_animal/moth)
max_number = 5
vermstring = "молей"
if(VERM_MOTHROACH)
spawn_types = list(/mob/living/simple_animal/mothroach)
max_number = 5
vermstring = "молетараканов"
var/amount_to_spawn = rand(2, max_number)
while(length(turfs) && amount_to_spawn > 0)
var/turf/simulated/floor/T = pick_n_take(turfs)
amount_to_spawn--
var/spawn_type = pick(spawn_types)
new spawn_type(T)


/datum/event/infestation/extended/announce(false_alarm)
var/vermin_chosen = vermstring || pick("неопознанных форм жизни", "золотых жуков", "ошибок", "насекомых", "тараканов", "муравьев", "щиткьюров", "ассистентов", "экипажа", "вульпканинов", "таяринов", "слаймов", "слаймоменов")
if(!spawn_area_type)
if(false_alarm)
spawn_area_type = pick(spawn_areas + spawn_areas_extended)
else
log_debug("Extended Infestation Event didn't provide an area to announce(), something is likely broken.")
kill()

GLOB.minor_announcement.Announce("Биосканеры фиксируют размножение [vermin_chosen] в [initial(spawn_area_type.name)]. Избавьтесь от них, прежде чем это начнет влиять на продуктивность станции.", "ВНИМАНИЕ: НЕОПОЗНАННЫЕ ФОРМЫ ЖИЗНИ.")
spawn_area_type = null

/datum/event/falsealarm/start()
possible_event_types |= /datum/event/infestation/extended
. = ..()

/datum/event_container/mundane/New()
. = ..()
available_events |= new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Vermin Infestation Extended", /datum/event/infestation/extended, 10, list(ASSIGNMENT_JANITOR = 100, ASSIGNMENT_SECURITY = 30))

#undef VERM_RATS
#undef VERM_AXOLOTL
#undef VERM_FROGS
#undef VERM_IGUANAS
#undef VERM_SNAKES
#undef VERM_MOTH
#undef VERM_MOTHROACH
4 changes: 4 additions & 0 deletions modular_ss220/mobs/_mobs.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/datum/modpack/mobs
name = "Мобы"
desc = "Пак животных, питомцев, холдеров для их держания и изменения."
author = "PhantomRU, dj-34"
37 changes: 37 additions & 0 deletions modular_ss220/mobs/_mobs.dme
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#include "_mobs.dm"

#include "code/simple_animal/friendly/crab.dm"
#include "code/simple_animal/friendly/farm_animals.dm"
#include "code/simple_animal/friendly/frog.dm"
#include "code/simple_animal/friendly/hamster.dm"
#include "code/simple_animal/friendly/lizard.dm"
#include "code/simple_animal/friendly/moth.dm"
#include "code/simple_animal/friendly/mouse.dm"
#include "code/simple_animal/friendly/possum.dm"
#include "code/simple_animal/friendly/rat.dm"
#include "code/simple_animal/friendly/snail.dm"
#include "code/simple_animal/hostile/alien.dm"
#include "code/simple_animal/hostile/bear.dm"
#include "code/simple_animal/hostile/headcrab.dm"
#include "code/simple_animal/hostile/lizard.dm"
#include "code/simple_animal/hostile/snake.dm"
#include "code/simple_animal/hostile/spider.dm"
#include "code/simple_animal/hostile/syndi_rat.dm"
#include "code/simple_animal/hostile/undead.dm"
#include "code/simple_animal/pets/cat.dm"
#include "code/simple_animal/pets/dog.dm"
#include "code/simple_animal/pets/fashion.dm"
#include "code/simple_animal/pets/fox.dm"
#include "code/simple_animal/pets/pet.dm"
#include "code/simple_animal/pets/rouge.dm"
#include "code/simple_animal/pets/security_dogs.dm"
#include "code/simple_animal/pets/slugcat.dm"
#include "code/simple_animal/items.dm"
#include "code/simple_animal/mobs.dm"
#include "code/simple_animal/named_animals.dm"
#include "code/simple_animal/overrides.dm"
#include "code/supplypacks/crittercrate.dm"
#include "code/supplypacks/pack_animals.dm"
#include "code/mob_holder.dm"
#include "code/mob_spawner.dm"
#include "code/pet_carrier.dm"
Loading