Files
Time-Green 68be76e817 Journeying Hitchhikers Shuttle Events + Bugfixes (#86655)
## About The Pull Request

Adds the following new general shuttle events:_
**Hitchhiker**
- 1% chance
- A single assistant in an EVA suit and some PBJs in a suitcase

**Assistant Wave**
- 0.1% chance
- Spawns 10 assistants with internals
- For clarity, they don't get sent to the shuttle, but get launched at
it from space. It's a scuffle of 10 assistants trying to get in without
being spaced or succumbing to the cold/pressure

**Intern Wave**
- Admin only
- Unarmed and armed version
- Spawns centcom interns, with a little announcement to warn they're
coming

I've also fixed projectiles bugging out and admin forced shuttle events
not activating if they were added after the shuttle launched

<details>
  <summary>Admin only events added</summary>
  
**Nukie**
Spawns a single nukie, armed with a shotgun, pistol and edagger.
Basically the deathmatch nukie loadout, you dont want to fight this

**Meaty ores**
Meaty-ores meteors. Have a 4% chance to hit the shuttle, posing a
potential hazard

**3 player controlled fire-sharks**
3 fire sharks controlled by players. Not much to talk about here

**Fireball Wave**
Shoots a wave of fireballs at the shuttle. I think it's cool but
apparently shuttle walls and windows deflect fireballs so it's kind of
moot unless you're outside :/

</details>

## Why It's Good For The Game
The assistant and hitchhiker events are some flavoring that I thought up
a while ago. The Hitchhiker is just intentionally a flavor addition, but
the assistant wave and intern wave can be used by admins to repopulate
or retake the emergency shuttle as well.

## Changelog
🆑
add: Adds an assistant and hitchiker shuttle event, replenishing the
crew mid flight!
admin: Adds two intern wave shuttle events
code: You can now supply shuttle events with outfits!
code: You can now shoot projectiles with the shuttle events!
fix: Fixes projectiles bugging out when fired in shuttle transit space
fix: Fixes admin forced shuttle events not activating when added mid
transit
/🆑
2024-10-02 00:24:18 -07:00

75 lines
3.1 KiB
Plaintext

///Mobs spawned with this one are automatically player controlled, if possible
/datum/shuttle_event/simple_spawner/player_controlled
spawning_list = list(/mob/living/basic/carp)
///If we cant find a ghost, do we spawn them anyway? Otherwise they go in the garbage bin
var/spawn_anyway_if_no_player = FALSE
var/ghost_alert_string = "Would you like to be shot at the shuttle?"
var/role_type = ROLE_SENTIENCE
/datum/shuttle_event/simple_spawner/player_controlled/spawn_movable(spawn_type)
if(ispath(spawn_type, /mob/living))
INVOKE_ASYNC(src, PROC_REF(try_grant_ghost_control), spawn_type)
else
..()
/// Attempt to grant control of a mob to ghosts before spawning it in. if spawn_anyway_if_no_player = TRUE, we spawn the mob even if there's no ghosts
/datum/shuttle_event/simple_spawner/player_controlled/proc/try_grant_ghost_control(spawn_type)
var/mob/living/new_mob = new spawn_type (null)
ADD_TRAIT(new_mob, TRAIT_STASIS, type)
post_spawn(new_mob)
var/mob/chosen_one = SSpolling.poll_ghost_candidates(ghost_alert_string + " (Warning: you will not be able to return to your body!)", check_jobban = role_type, poll_time = 10 SECONDS, alert_pic = new_mob, role_name_text = "shot at shuttle", amount_to_pick = 1)
if(isnull(chosen_one) && !spawn_anyway_if_no_player || !isdead(chosen_one)) //we can get sniped if there's multiple spawns, so check if dead
qdel(new_mob)
return
new_mob.forceMove(get_turf(get_spawn_turf()))
REMOVE_TRAIT(new_mob, TRAIT_STASIS, type)
new_mob.ckey = chosen_one?.ckey
///BACK FOR REVENGE!!!
/datum/shuttle_event/simple_spawner/player_controlled/alien_queen
name = "ALIEN QUEEN! (Kinda dangerous!)"
spawning_list = list(/mob/living/carbon/alien/adult/royal/queen = 1, /obj/vehicle/sealed/mecha/ripley = 1)
spawning_flags = SHUTTLE_EVENT_HIT_SHUTTLE
event_probability = 0.2
spawn_probability_per_process = 10
activation_fraction = 0.5
spawn_anyway_if_no_player = FALSE
ghost_alert_string = "Would you like to be an alien queen shot at the shuttle?"
remove_from_list_when_spawned = TRUE
self_destruct_when_empty = TRUE
role_type = ROLE_ALIEN
///Spawns three player controlled carp!! Deadchats final chance to wreak havoc, probably really not that dangerous if even one person has a laser gun
/datum/shuttle_event/simple_spawner/player_controlled/carp
name = "Three player controlled carp! (Little dangerous!)"
spawning_list = list(/mob/living/basic/carp = 10, /mob/living/basic/carp/mega = 2, /mob/living/basic/carp/magic = 2, /mob/living/basic/carp/magic/chaos = 1)
spawning_flags = SHUTTLE_EVENT_HIT_SHUTTLE
event_probability = 1
spawn_probability_per_process = 10
activation_fraction = 0.4
spawn_anyway_if_no_player = TRUE
ghost_alert_string = "Would you like to be a space carp to pester the emergency shuttle?"
remove_from_list_when_spawned = TRUE
self_destruct_when_empty = TRUE
role_type = ROLE_SENTIENCE
///how many carp can we spawn max?
var/max_carp_spawns = 3
/datum/shuttle_event/simple_spawner/player_controlled/carp/New(obj/docking_port/mobile/port)
. = ..()
var/list/spawning_list_copy = spawning_list.Copy()
spawning_list.Cut()
for(var/i in 1 to max_carp_spawns)
spawning_list[pick_weight(spawning_list_copy)] += 1