Files
Bubberstation/code/modules/bitrunning/virtual_domain/modular_mob_segment.dm
Jeremiah 008876823c Adds two new BR maps, basic mobs, BR tweaks & fixes (#85292)
## About The Pull Request
Title. Adds two new maps: 
- Grasslands Hunt (peaceful)
- Meta Central (easy)

These maps add a new basic revolutionary mob and significantly upgrades
the ai of basic deer.
This fixes an issue where modular maps were not correctly spawning mobs
or adding them to the "mutable candidates" for antagonists.
There's also some balance changes to bitrunning vendor prices, which are
generally now lower. This change is unrelated to the PR as a whole so
I'm okay with removing it if there's concern

### photos
<details>
<summary>expand</summary>

![Screenshot 2024-07-26
151822](https://github.com/user-attachments/assets/61fd84f3-3768-4b7a-b421-a953fb8b8174)

![Screenshot 2024-07-26
151834](https://github.com/user-attachments/assets/27193237-858e-41ac-953c-6c30846c98c0)

</details>

### todo

- [x] Fix the revolutionary death anim
- [x] Make deer run when injured
## Why It's Good For The Game
New maps as a general positive for bitrunning
Bug fixes
Makes vendor choices for bitrunning-exclusive items generally less of a
chore to get
## Changelog
jlsnow301, MMMiracles, KikoWen0, Ben10Omintrix
🆑
add: Added two new bitrunning maps: Grasslands Hunt and Meta Central.
add: Deer are now more complex animals, granting them enhanced ability
to run amok and chew your favorite plants.
balance: Reduced the cost of most BR vendor items.
fix: Fixes an issue where modular virtual domains spawned less mobs than
intended.
fix: These modular spawns are now valid mutation targets to become an
antagonist.
/🆑

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2024-09-06 01:53:50 +02:00

218 lines
4.4 KiB
Plaintext

#define SPAWN_ALWAYS 100
#define SPAWN_LIKELY 85
#define SPAWN_UNLIKELY 35
#define SPAWN_RARE 10
/// Handles spawning mobs for this landmark. Sends a signal when done.
/obj/effect/landmark/bitrunning/mob_segment/proc/spawn_mobs(turf/origin, datum/modular_mob_segment/segment)
var/list/mob/living/spawned_mobs = list()
spawned_mobs += segment.spawn_mobs(origin)
SEND_SIGNAL(src, COMSIG_BITRUNNING_MOB_SEGMENT_SPAWNED, spawned_mobs)
var/list/datum/weakref/mob_refs = list()
for(var/mob/living/spawned as anything in spawned_mobs)
if(QDELETED(spawned))
continue
mob_refs += WEAKREF(spawned)
return mob_refs
/**
* A list for mob spawning landmarks to use.
*/
/datum/modular_mob_segment
/// Set this to false if you want explicitly what's in the list to spawn
var/exact = FALSE
/// The list of mobs to spawn
var/list/mobs = list()
/// Spawn no more than this amount
var/max = 4
/// Chance this will spawn (1 - 100)
var/probability = SPAWN_LIKELY
/// Spawns mobs in a circle around the location
/datum/modular_mob_segment/proc/spawn_mobs(turf/origin)
if(!prob(probability))
return
var/list/mob/living/spawned_mobs = list()
var/total_amount = exact ? length(mobs) : rand(1, max)
shuffle_inplace(mobs)
var/list/turf/nearby = list()
for(var/turf/tile as anything in RANGE_TURFS(2, origin))
if(!tile.is_blocked_turf())
nearby += tile
if(!length(nearby))
stack_trace("Couldn't find any valid turfs to spawn on")
return
for(var/index in 1 to total_amount)
// For each of those, we need to find an open space
var/turf/destination = pick(nearby)
var/path // Either a random mob or the next mob in the list
if(exact)
path = mobs[index]
else
path = pick(mobs)
var/mob/living/mob = new path(destination)
nearby -= destination
spawned_mobs += mob
return spawned_mobs
// Some generic mob segments. If you want to add generic ones for any map, add them here
/datum/modular_mob_segment/gondolas
mobs = list(
/mob/living/basic/pet/gondola,
)
/datum/modular_mob_segment/corgis
max = 2
mobs = list(
/mob/living/basic/pet/dog/corgi,
)
/datum/modular_mob_segment/monkeys
mobs = list(
/mob/living/carbon/human/species/monkey,
)
/datum/modular_mob_segment/syndicate_team
mobs = list(
/mob/living/basic/trooper/syndicate/ranged,
/mob/living/basic/trooper/syndicate/melee,
)
/datum/modular_mob_segment/abductor_agents
mobs = list(
/mob/living/basic/trooper/abductor/melee,
/mob/living/basic/trooper/abductor/ranged,
)
/datum/modular_mob_segment/syndicate_elite
mobs = list(
/mob/living/basic/trooper/syndicate/melee/sword/space/stormtrooper,
/mob/living/basic/trooper/syndicate/ranged/space/stormtrooper,
)
/datum/modular_mob_segment/bears
max = 2
mobs = list(
/mob/living/basic/bear,
)
/datum/modular_mob_segment/bees
exact = TRUE
mobs = list(
/mob/living/basic/bee,
/mob/living/basic/bee,
/mob/living/basic/bee,
/mob/living/basic/bee,
/mob/living/basic/bee/queen,
)
/datum/modular_mob_segment/bees_toxic
mobs = list(
/mob/living/basic/bee/toxin,
)
/datum/modular_mob_segment/blob_spores
mobs = list(
/mob/living/basic/blob_minion,
)
/datum/modular_mob_segment/carps
mobs = list(
/mob/living/basic/carp,
)
/datum/modular_mob_segment/hivebots
mobs = list(
/mob/living/basic/hivebot,
/mob/living/basic/hivebot/range,
)
/datum/modular_mob_segment/hivebots_strong
mobs = list(
/mob/living/basic/hivebot/strong,
/mob/living/basic/hivebot/range,
)
/datum/modular_mob_segment/lavaland_assorted
mobs = list(
/mob/living/basic/mining/basilisk,
/mob/living/basic/mining/goliath,
/mob/living/basic/mining/brimdemon,
/mob/living/basic/mining/lobstrosity,
)
/datum/modular_mob_segment/spiders
mobs = list(
/mob/living/basic/spider/giant/ambush,
/mob/living/basic/spider/giant/hunter,
/mob/living/basic/spider/giant/nurse,
/mob/living/basic/spider/giant/tarantula,
/mob/living/basic/spider/giant/midwife,
)
/datum/modular_mob_segment/venus_trap
mobs = list(
/mob/living/basic/venus_human_trap,
)
/datum/modular_mob_segment/xenos
mobs = list(
/mob/living/basic/alien,
/mob/living/basic/alien/sentinel,
/mob/living/basic/alien/drone,
)
/datum/modular_mob_segment/deer
max = 1
mobs = list(
/mob/living/basic/deer,
)
/datum/modular_mob_segment/revolutionary
mobs = list(
/mob/living/basic/revolutionary,
)
#undef SPAWN_ALWAYS
#undef SPAWN_LIKELY
#undef SPAWN_UNLIKELY
#undef SPAWN_RARE