Skip to content

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
morrowwolf committed Jul 19, 2023
1 parent 6f98fd9 commit d200d9d
Show file tree
Hide file tree
Showing 13 changed files with 232 additions and 6 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/typecheck/xenos.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define islarva(A) (istype(A, /mob/living/carbon/xenomorph/larva))
#define ispredalienlarva(A) (istype(A, /mob/living/carbon/xenomorph/larva/predalien))
#define isfacehugger(A) (istype(A, /mob/living/carbon/xenomorph/facehugger))
#define islesserdrone(A) (istype(A, /mob/living/carbon/xenomorph/lesser_drone))
#define ispraetorian(A) (istype(A, /mob/living/carbon/xenomorph/praetorian))
#define isqueen(A) (istype(A, /mob/living/carbon/xenomorph/queen))
#define isravager(A) (istype(A, /mob/living/carbon/xenomorph/ravager))
Expand Down
10 changes: 8 additions & 2 deletions code/__DEFINES/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
#define HUD_ARMOR_STATES_XENO 10

/// Multiplier for time taken for a xeno to place down a resin structure
#define BUILD_TIME_MULT_LESSER_DRONE 0.5
#define BUILD_TIME_MULT_XENO 1
#define BUILD_TIME_MULT_BUILDER 1
#define BUILD_TIME_MULT_HIVELORD 0.5
Expand Down Expand Up @@ -206,6 +207,7 @@

// Health bands
#define XENO_HEALTH_LARVA 35 * XENO_UNIVERSAL_HPMULT
#define XENO_HEALTH_LESSER_DRONE 200 * XENO_UNIVERSAL_HPMULT
#define XENO_HEALTH_RUNNER 230 * XENO_UNIVERSAL_HPMULT // Killed by 1 PB
#define XENO_HEALTH_TIER_1 250 * XENO_UNIVERSAL_HPMULT
#define XENO_HEALTH_TIER_2 300 * XENO_UNIVERSAL_HPMULT
Expand Down Expand Up @@ -603,7 +605,8 @@
#define XENO_CASTE_LARVA "Bloody Larva"
#define XENO_CASTE_PREDALIEN_LARVA "Predalien Larva"
#define XENO_CASTE_FACEHUGGER "Facehugger"
#define XENO_T0_CASTES list(XENO_CASTE_LARVA, XENO_CASTE_PREDALIEN_LARVA, XENO_CASTE_FACEHUGGER)
#define XENO_CASTE_LESSER_DRONE "Lesser Drone"
#define XENO_T0_CASTES list(XENO_CASTE_LARVA, XENO_CASTE_PREDALIEN_LARVA, XENO_CASTE_FACEHUGGER, XENO_CASTE_LESSER_DRONE)

//t1
#define XENO_CASTE_DRONE "Drone"
Expand Down Expand Up @@ -631,7 +634,7 @@
#define XENO_CASTE_HELLHOUND "Hellhound"
#define XENO_SPECIAL_CASTES list(XENO_CASTE_QUEEN, XENO_CASTE_PREDALIEN, XENO_CASTE_HELLHOUND)

#define ALL_XENO_CASTES list(XENO_CASTE_LARVA, XENO_CASTE_PREDALIEN_LARVA, XENO_CASTE_FACEHUGGER, XENO_CASTE_DRONE, XENO_CASTE_RUNNER, XENO_CASTE_SENTINEL, XENO_CASTE_DEFENDER, XENO_CASTE_BURROWER, XENO_CASTE_CARRIER, XENO_CASTE_HIVELORD, XENO_CASTE_LURKER, XENO_CASTE_WARRIOR, XENO_CASTE_SPITTER, XENO_CASTE_BOILER, XENO_CASTE_PRAETORIAN, XENO_CASTE_CRUSHER, XENO_CASTE_RAVAGER, XENO_CASTE_QUEEN, XENO_CASTE_PREDALIEN, XENO_CASTE_HELLHOUND)
#define ALL_XENO_CASTES list(XENO_CASTE_LARVA, XENO_CASTE_PREDALIEN_LARVA, XENO_CASTE_FACEHUGGER, XENO_CASTE_LESSER_DRONE, XENO_CASTE_DRONE, XENO_CASTE_RUNNER, XENO_CASTE_SENTINEL, XENO_CASTE_DEFENDER, XENO_CASTE_BURROWER, XENO_CASTE_CARRIER, XENO_CASTE_HIVELORD, XENO_CASTE_LURKER, XENO_CASTE_WARRIOR, XENO_CASTE_SPITTER, XENO_CASTE_BOILER, XENO_CASTE_PRAETORIAN, XENO_CASTE_CRUSHER, XENO_CASTE_RAVAGER, XENO_CASTE_QUEEN, XENO_CASTE_PREDALIEN, XENO_CASTE_HELLHOUND)

// Checks if two hives are allied to each other.
// PARAMETERS:
Expand Down Expand Up @@ -695,3 +698,6 @@
#define TAILSTAB_AIRLOCK_DAMAGE_MULTIPLIER 2

#define FRENZY_DAMAGE_MULTIPLIER 2

#define JOIN_AS_FACEHUGGER_DELAY (3 MINUTES)
#define JOIN_AS_LESSER_DRONE_DELAY (3 MINUTES)
6 changes: 6 additions & 0 deletions code/_globalvars/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ GLOBAL_LIST_EMPTY(mainship_pipes)
// Resin constructions parameters
GLOBAL_LIST_INIT_TYPED(resin_constructions_list, /datum/resin_construction, setup_resin_constructions())

GLOBAL_LIST_INIT(resin_build_order_lesser_drone, list(
/datum/resin_construction/resin_turf/wall,
/datum/resin_construction/resin_turf/membrane,
/datum/resin_construction/resin_obj/door,
))

GLOBAL_LIST_INIT(resin_build_order_drone, list(
/datum/resin_construction/resin_turf/wall,
/datum/resin_construction/resin_turf/membrane,
Expand Down
40 changes: 40 additions & 0 deletions code/game/gamemodes/cm_initialize.dm
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,46 @@ Additional game mode variables.

return TRUE

/datum/game_mode/proc/attempt_to_join_as_lesser_drone(mob/xeno_candidate)
var/list/active_hives = list()
var/datum/hive_status/hive
var/last_active_hive = 0
for(var/hivenumber in GLOB.hive_datum)
hive = GLOB.hive_datum[hivenumber]
if(hive.totalXenos.len <= 0)
continue
active_hives[hive.name] = hive.hivenumber
last_active_hive = hive.hivenumber

if(active_hives.len <= 0)
to_chat(xeno_candidate, SPAN_WARNING("There aren't any Hives active at this point for you to join."))
return FALSE

if(active_hives.len > 1)
var/hive_picked = tgui_input_list(xeno_candidate, "Select which Hive to attempt joining.", "Hive Choice", active_hives, theme="hive_status")
if(!hive_picked)
to_chat(xeno_candidate, SPAN_ALERT("Hive choice error. Aborting."))
return
hive = GLOB.hive_datum[active_hives[hive_picked]]
else
hive = GLOB.hive_datum[last_active_hive]

if(!hive.hive_location)
to_chat(xeno_candidate, SPAN_WARNING("The selected hive does not have a hive core to spawn from!"))
return

if(!hive.living_xeno_queen)
to_chat(xeno_candidate, SPAN_WARNING("The selected hive does not have a Queen!"))
return

if(!hive.living_xeno_queen.ovipositor)
to_chat(xeno_candidate, SPAN_WARNING("The selected hive does not have a Queen on Ovipositor!"))
return

hive.hive_location.spawn_lesser_drone(xeno_candidate)

return TRUE

/datum/game_mode/proc/transfer_xeno(xeno_candidate, mob/living/new_xeno)
if(!xeno_candidate || !isxeno(new_xeno) || QDELETED(new_xeno))
return FALSE
Expand Down
2 changes: 2 additions & 0 deletions code/game/jobs/role_authority.dm
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,8 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou
M = /mob/living/carbon/xenomorph/larva/predalien
if(XENO_CASTE_FACEHUGGER)
M = /mob/living/carbon/xenomorph/facehugger
if(XENO_CASTE_LESSER_DRONE)
M = /mob/living/carbon/xenomorph/lesser_drone
if(XENO_CASTE_RUNNER)
M = /mob/living/carbon/xenomorph/runner
if(XENO_CASTE_DRONE)
Expand Down
5 changes: 5 additions & 0 deletions code/modules/admin/player_panel/actions/transform.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ GLOBAL_LIST_INIT(pp_transformables, list(
name = "Facehugger",
key = /mob/living/carbon/xenomorph/facehugger,
color = "purple"
),
list(
name = "Lesser Drone",
key = /mob/living/carbon/xenomorph/lesser_drone,
color = "purple"
)
),

Expand Down
12 changes: 12 additions & 0 deletions code/modules/cm_aliens/structures/special/pylon_core.dm
Original file line number Diff line number Diff line change
Expand Up @@ -327,5 +327,17 @@
// Tell admins that this condition is reached so they know what has happened if it fails somehow
return

/obj/effect/alien/resin/special/pylon/core/proc/spawn_lesser_drone(mob/xeno_candidate)
if(!linked_hive.can_spawn_as_lesser_drone(xeno_candidate))
return FALSE

var/mob/living/carbon/xenomorph/lesser_drone/new_drone = new /mob/living/carbon/xenomorph/lesser_drone(loc, null, linked_hive.hivenumber)
xeno_candidate.mind.transfer_to(new_drone, TRUE)
new_drone.visible_message(SPAN_XENODANGER("A lesser drone emerges out of [src]!"), SPAN_XENODANGER("You emerge out of [src] and awaken from your slumber. For the Hive!"))
playsound(new_drone, 'sound/effects/xeno_newlarva.ogg', 25, TRUE)
new_drone.generate_name()

return TRUE

#undef PYLON_REPAIR_TIME
#undef PYLON_WEEDS_REGROWTH_TIME
20 changes: 18 additions & 2 deletions code/modules/mob/dead/observer/observer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,9 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(ghost && !is_admin_level(z))
ghost.timeofdeath = world.time

// Larva queue: We use the larger of their existing queue time or the new timeofdeath except for facehuggers
var/new_tod = isfacehugger(src) ? 1 : world.time
// Larva queue: We use the larger of their existing queue time or the new timeofdeath except for facehuggers/lesser drones
var/new_tod = (isfacehugger(src) || islesserdrone(src)) ? 1 : world.time

ghost.client?.player_details.larva_queue_time = max(ghost.client.player_details.larva_queue_time, new_tod)
if(is_nested && nest && !QDELETED(nest))
ghost.can_reenter_corpse = FALSE
Expand Down Expand Up @@ -773,6 +774,21 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(SSticker.mode.check_xeno_late_join(src))
SSticker.mode.attempt_to_join_as_facehugger(src)

/mob/dead/verb/join_as_lesser_drone()
set category = "Ghost.Join"
set name = "Join as a Lesser Drone"
set desc = "Try joining as a Lesser Drone to support the hive."

if (!client)
return

if(SSticker.current_state < GAME_STATE_PLAYING || !SSticker.mode)
to_chat(src, SPAN_WARNING("The game hasn't started yet!"))
return

if(SSticker.mode.check_xeno_late_join(src))
SSticker.mode.attempt_to_join_as_lesser_drone(src)

/mob/dead/verb/join_as_zombie() //Adapted from join as hellhoud
set category = "Ghost.Join"
set name = "Join as Zombie"
Expand Down
105 changes: 105 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/lesser_drone.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
/datum/caste_datum/lesser_drone
caste_type = XENO_CASTE_LESSER_DRONE
tier = 1
melee_damage_lower = XENO_DAMAGE_TIER_1
melee_damage_upper = XENO_DAMAGE_TIER_1
melee_vehicle_damage = XENO_DAMAGE_TIER_1
max_health = XENO_HEALTH_LESSER_DRONE
plasma_gain = XENO_PLASMA_GAIN_TIER_7
plasma_max = XENO_PLASMA_TIER_2
crystal_max = XENO_CRYSTAL_LOW
xeno_explosion_resistance = XENO_NO_EXPLOSIVE_ARMOR
armor_deflection = XENO_NO_ARMOR
evasion = XENO_EVASION_LOW
speed = XENO_SPEED_TIER_7

evolution_allowed = FALSE
can_be_revived = FALSE

build_time_mult = BUILD_TIME_MULT_LESSER_DRONE

caste_desc = "A builder of hives."
can_hold_facehuggers = 1
can_hold_eggs = CAN_HOLD_TWO_HANDS
acid_level = 1
weed_level = WEED_LEVEL_STANDARD
max_build_dist = 1

tackle_min = 4
tackle_max = 4
tacklestrength_min = 3
tacklestrength_max = 4

aura_strength = 1

minimap_icon = "drone" //add lesser drone minimap icon - Morrow

/datum/caste_datum/lesser_drone/New()
. = ..()

resin_build_order = GLOB.resin_build_order_lesser_drone

/mob/living/carbon/xenomorph/lesser_drone
caste_type = XENO_CASTE_LESSER_DRONE
name = XENO_CASTE_LESSER_DRONE
desc = "An alien drone. Looks... smaller."
icon = 'icons/mob/xenos/drone.dmi'
icon_size = 48
icon_state = "Drone Walking"
plasma_types = list(PLASMA_PURPLE)
tier = 1
pixel_x = -8
old_x = -8
pixel_y = -4
old_y = -4
tier = 0
mob_size = MOB_SIZE_SMALL
life_value = 0
default_honor_value = 0
show_only_numbers = TRUE
counts_for_slots = FALSE
counts_for_roundend = FALSE
refunds_larva_if_banished = FALSE
can_hivemind_speak = FALSE
crit_health = 0
gib_chance = 100
base_actions = list(
/datum/action/xeno_action/onclick/xeno_resting,
/datum/action/xeno_action/onclick/regurgitate,
/datum/action/xeno_action/watch_xeno,
/datum/action/xeno_action/activable/tail_stab,
/datum/action/xeno_action/activable/corrosive_acid/weak,
/datum/action/xeno_action/onclick/emit_pheromones,
/datum/action/xeno_action/onclick/plant_weeds, //first macro
/datum/action/xeno_action/onclick/choose_resin, //second macro
/datum/action/xeno_action/activable/secrete_resin, //third macro
/datum/action/xeno_action/onclick/tacmap,
)
inherent_verbs = list(
/mob/living/carbon/xenomorph/proc/vent_crawl,
/mob/living/carbon/xenomorph/proc/rename_tunnel,
/mob/living/carbon/xenomorph/proc/set_hugger_reserve_for_morpher,
)

mutation_type = DRONE_NORMAL

icon_xeno = 'icons/mob/xenos/lesser_drone.dmi'
icon_xenonid = 'icons/mob/xenonids/lesser_drone.dmi'

/mob/living/carbon/xenomorph/lesser_drone/update_icons()
. = ..()

var/matrix/scale_matrix = new()
scale_matrix.Scale(0.8, 0.8)

base_transform = scale_matrix //Threaten the spriters with this until they give a sprite - Morrow
transform = scale_matrix
enable_pixel_scaling()

/mob/living/carbon/xenomorph/lesser_drone/age_xeno()
if(stat == DEAD || !caste || QDELETED(src) || !client)
return

age = XENO_NORMAL

hud_update()
36 changes: 34 additions & 2 deletions code/modules/mob/living/carbon/xenomorph/xeno_defines.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#define JOIN_AS_FACEHUGGER_DELAY 3 MINUTES

// Actual caste datum basedef
/datum/caste_datum
var/caste_type = ""
Expand Down Expand Up @@ -352,6 +350,9 @@
/// How many huggers can the hive support
var/playable_hugger_limit = 0

/// How many lesser drones the hive can support
var/lesser_drone_limit = 0

var/datum/tacmap/tacmap
var/minimap_type = MINIMAP_FLAG_XENO

Expand Down Expand Up @@ -1047,6 +1048,37 @@
playsound(hugger, 'sound/effects/xeno_newlarva.ogg', 25, TRUE)
hugger.generate_name()

/datum/hive_status/proc/update_lesser_drone_limit()
lesser_drone_limit = Ceiling(totalXenos.len / 3)

/datum/hive_status/proc/can_spawn_as_lesser_drone(mob/dead/observer/user)
if(!GLOB.hive_datum || ! GLOB.hive_datum[hivenumber])
return FALSE
if(jobban_isbanned(user, JOB_XENOMORPH)) // User is jobbanned
to_chat(user, SPAN_WARNING("You are banned from playing aliens and cannot spawn as a xenomorph."))
return FALSE
if(world.time - user.timeofdeath < JOIN_AS_LESSER_DRONE_DELAY)
var/time_left = round((user.timeofdeath + JOIN_AS_LESSER_DRONE_DELAY - world.time) / 10)
to_chat(user, SPAN_WARNING("You ghosted too recently. You cannot become a lesser drone until 3 minutes have passed ([time_left] seconds remaining)."))
return FALSE
if(totalXenos.len <= 0)
to_chat(user, SPAN_WARNING("The hive has fallen, you can't join it!"))
return FALSE

update_lesser_drone_limit()

var/current_lesser_drone_count = 0
for(var/mob/mob as anything in totalXenos)
if(islesserdrone(mob))
current_lesser_drone_count++
if(lesser_drone_limit <= current_lesser_drone_count)
to_chat(user, SPAN_WARNING("\The [GLOB.hive_datum[hivenumber]] cannot support more lesser drones! Limit: <b>[current_lesser_drone_count]/[lesser_drone_limit]</b>"))
return FALSE

if(alert(user, "Are you sure you want to become a lesser drone?", "Confirmation", "Yes", "No") != "Yes")
return FALSE
return TRUE

///Called by /obj/item/alien_embryo when a host is bursting to determine extra larva per burst
/datum/hive_status/proc/increase_larva_after_burst()
var/extra_per_burst = CONFIG_GET(number/extra_larva_per_burst)
Expand Down
1 change: 1 addition & 0 deletions colonialmarines.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1890,6 +1890,7 @@
#include "code\modules\mob\living\carbon\xenomorph\castes\Hellhound.dm"
#include "code\modules\mob\living\carbon\xenomorph\castes\Hivelord.dm"
#include "code\modules\mob\living\carbon\xenomorph\castes\Larva.dm"
#include "code\modules\mob\living\carbon\xenomorph\castes\lesser_drone.dm"
#include "code\modules\mob\living\carbon\xenomorph\castes\Lurker.dm"
#include "code\modules\mob\living\carbon\xenomorph\castes\Praetorian.dm"
#include "code\modules\mob\living\carbon\xenomorph\castes\Predalien.dm"
Expand Down
Binary file added icons/mob/xenonids/lesser_drone.dmi
Binary file not shown.
Binary file added icons/mob/xenos/lesser_drone.dmi
Binary file not shown.

0 comments on commit d200d9d

Please sign in to comment.