Skip to content

Commit

Permalink
Xenomorph Endgame (#6334)
Browse files Browse the repository at this point in the history
# About the pull request
Xenomorph endgame stuff revived
Disclaimer: All the values and changes in this PR are not final, those
are testing values and will most likely be tweaked.

Credits:
Birdtalon - most of the code
Mikoka Wei & Zenith - sprites

# Explain why it's good for the game
https://hackmd.io/lfJWvwWSTEyxFs_nN2sIqw

# Testing Photographs and Procedure
King Cocoon Growing:

![image](https://github.com/user-attachments/assets/59bf123c-fa0a-49a7-b966-853f759cd03a)
King Cocoon Hatched:

![image](https://github.com/user-attachments/assets/8bd8cc3a-b6ef-4062-a9c9-64836a010ffe)
King & Rogue Sprites:

![image](https://github.com/user-attachments/assets/c169f5a5-7369-44a7-bdfd-49b76c0921d8)
Buff Radial Icons:

![image](https://github.com/user-attachments/assets/f910a900-3498-40bb-80cf-16f2fdab5004)

![image](https://github.com/user-attachments/assets/dd1096db-b06f-4d3a-9147-058165aa6fba)

![image](https://github.com/user-attachments/assets/d7f10a5e-2d41-445e-beba-3ba8a0cde200)
King Abilities:



https://github.com/user-attachments/assets/c23d0db8-c8c2-4442-9e03-544c5a182283

Updated Destroy animation:


https://github.com/user-attachments/assets/2f98d20e-b798-470b-ad28-9171805bdad2



</details>

# Changelog
:cl: Nivrak Birdtalon Wei Zenith
del: Removed passive larva gain from pylons
add: Added a new currency, Royal resin which is gained 1 per 5 minutes
per pylon which can be used to buy various buffs. Minor buffs require
one pylon while major buffs require both.
add: Current royal resin can be viewed on the Queen's status panel and
buffs can be bought through Manage the Hive ability.
add: Minor Hive buff - Larva Surge - Costs 5 royal resin, Gives 5 larva,
one time use
add: Minor Hive Buff - Boon of Evolution - Costs 1 royal resin, Gain 2x
evolution speed for 5 minutes
add: Minor Hive Buff - Boon of Defense - Costs 1 royal resin, Gain 2.5
additional armor for 5 minutes
add: Minor Hive Buff - Boon of Aggression - Costs 1 royal resin, Gain 5
additional damage for 5 minutes
add: Major variants of Plenty, Defense and Aggression, Each costing 2
royal resin, having usually twice as strong effect and duration. Major
boon of evolution also allows gaining evolution with the Queen out of
ovi.
balance: Pylons will have OB protection while the King is hatching.
add: Major Hive Buff - His Grace - Costs 0 royal resin, Can only be
bought between 1:35 and 1:55 minutes (random). Spawns a cocoon of the
King. The cocoon requires both comms to be held for 10 minutes. If any
of the comms are lost or the cocoon itself is the destroyed it will
despawn and will be on cooldown for 5-15 minutes. Can be rebought like
most other buffs. All living xenos can vote for a candidate after which
one of the top 2 will be randomally picked, otherwise a player is
randomly selected from all living xenos > 50 hours (will fallbacks to
ghosts and then again with no playtime requirements). Evacuating while
the destroyer is hatching will cause it to instantly hatch.
add: The King - A new xenomorph caste which is serves as the xeno's
counterpart to a nuke and is designed to end sieges. Has a rend to
attack around it, a light extinguishing smoke, a gigantic leap, group
bulwark shield that caps all incoming damage, and very strong
pheromones. Cannot be body blocked.
imageadd: Sprites by Mikoka Wei and Zenith
/:cl:

---------

Co-authored-by: Birdtalon <[email protected]>
Co-authored-by: harryob <[email protected]>
Co-authored-by: zzzmike <[email protected]>
Co-authored-by: Segrain <[email protected]>
Co-authored-by: Drulikar <[email protected]>
Co-authored-by: Drathek <[email protected]>
Co-authored-by: kiVts <[email protected]>
Co-authored-by: zeroisthebiggay <[email protected]>
Co-authored-by: Nanu308 <[email protected]>
  • Loading branch information
10 people authored Nov 22, 2024
1 parent 3001c25 commit 085faa8
Show file tree
Hide file tree
Showing 42 changed files with 1,737 additions and 44 deletions.
3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals/atom/mob/living/signals_xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,6 @@
/// From /mob/living/carbon/xenomorph/proc/do_evolve(): (castepick)
#define COMSIG_XENO_TRY_EVOLVE "xeno_try_evolve"
#define COMPONENT_OVERRIDE_EVOLVE (1<<0)

/// From /mob/living/carbon/xenomorph/proc/do_evolve()
#define COMSIG_XENO_EVOLVE_TO_NEW_CASTE "xeno_evolve_to_new_caste"
9 changes: 9 additions & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -386,3 +386,12 @@ GLOBAL_LIST_INIT(default_xeno_onmob_icons, list(
#define MOBILITY_FLAGS_LYING_CAPABLE_DEFAULT (MOBILITY_MOVE | MOBILITY_STAND | MOBILITY_LIEDOWN)
#define MOBILITY_FLAGS_CARBON_DEFAULT (MOBILITY_MOVE | MOBILITY_STAND | MOBILITY_REST | MOBILITY_LIEDOWN)
#define MOBILITY_FLAGS_REST_CAPABLE_DEFAULT (MOBILITY_MOVE | MOBILITY_STAND | MOBILITY_REST | MOBILITY_LIEDOWN)

/// Sleeps for X and will perform return if A is qdeleted or a dead mob.
#define SLEEP_CHECK_DEATH(X, A) \
sleep(X); \
if(QDELETED(A)) return; \
if(ismob(A)) { \
var/mob/sleep_check_death_mob = A; \
if(sleep_check_death_mob.stat == DEAD) return; \
}
13 changes: 10 additions & 3 deletions code/__DEFINES/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
/// The time when xenos can start taking over comm towers
#define XENO_COMM_ACQUISITION_TIME (55 MINUTES)

/// The time it takes for a pylon to give one larva while activated
/// The time it takes for a pylon to give one royal resin while activated
#define XENO_PYLON_ACTIVATION_COOLDOWN (5 MINUTES)

/// The time until you can re-corrupt a comms relay after the last pylon was destroyed
Expand Down Expand Up @@ -255,6 +255,7 @@
#define XENO_HEALTH_TIER_14 950 * XENO_UNIVERSAL_HPMULT
#define XENO_HEALTH_QUEEN 1000 * XENO_UNIVERSAL_HPMULT
#define XENO_HEALTH_IMMORTAL 1200 * XENO_UNIVERSAL_HPMULT
#define XENO_HEALTH_KING 1500 * XENO_UNIVERSAL_HPMULT

// Plasma bands
#define XENO_NO_PLASMA 0
Expand Down Expand Up @@ -434,6 +435,7 @@
// Armor mods. Use the above defines for some guidance
// In general, +20 armor should be a little more than +20% effective HP, however,
// the higher the Xeno's base armor, the greater the effect.
#define XENO_ARMOR_MOD_TINY 2.5
#define XENO_ARMOR_MOD_VERY_SMALL 5
#define XENO_ARMOR_MOD_SMALL 10
#define XENO_ARMOR_MOD_MED 15
Expand Down Expand Up @@ -665,6 +667,7 @@
#define XENO_SHIELD_SOURCE_GARDENER 8
#define XENO_SHIELD_SOURCE_SHIELD_PILLAR 9
#define XENO_SHIELD_SOURCE_CUMULATIVE_GENERIC 10
#define XENO_SHIELD_SOURCE_KING_BULWARKSPELL 11

//XENO CASTES
#define XENO_CASTE_LARVA "Larva"
Expand Down Expand Up @@ -693,13 +696,17 @@
#define XENO_CASTE_CRUSHER "Crusher"
#define XENO_CASTE_RAVAGER "Ravager"
#define XENO_T3_CASTES list(XENO_CASTE_BOILER, XENO_CASTE_PRAETORIAN, XENO_CASTE_CRUSHER, XENO_CASTE_RAVAGER)
//special

//Tier 4
#define XENO_CASTE_KING "King"
#define XENO_CASTE_QUEEN "Queen"

//special
#define XENO_CASTE_PREDALIEN "Predalien"
#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_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)
#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, XENO_CASTE_KING)

// Checks if two hives are allied to each other.
// PARAMETERS:
Expand Down
6 changes: 5 additions & 1 deletion code/_globalvars/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,15 @@ GLOBAL_LIST_INIT_TYPED(hive_datum, /datum/hive_status, list(
XENO_HIVE_TUTORIAL = new /datum/hive_status/tutorial()
))

GLOBAL_VAR_INIT(king_acquisition_time, 1 HOURS + 30 MINUTES + rand(0, 25) MINUTES)
GLOBAL_LIST_INIT(xeno_evolve_times, setup_xeno_evolve_times())

/proc/setup_xeno_evolve_times()
for(var/datum/caste_datum/caste as anything in subtypesof(/datum/caste_datum))
LAZYADDASSOCLIST(., num2text(initial(caste.minimum_evolve_time)), caste)
if(initial(caste.caste_type) == XENO_CASTE_KING)
LAZYADDASSOCLIST(., num2text(GLOB.king_acquisition_time), caste)
else
LAZYADDASSOCLIST(., num2text(initial(caste.minimum_evolve_time)), caste)

GLOBAL_LIST_INIT(custom_event_info_list, setup_custom_event_info())

Expand Down
1 change: 1 addition & 0 deletions code/datums/langchat/langchat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/mob/living/carbon/xenomorph/hivelord/langchat_height = 64
/mob/living/carbon/xenomorph/defender/langchat_height = 48
/mob/living/carbon/xenomorph/warrior/langchat_height = 48
/mob/living/carbon/xenomorph/king/langchat_height = 64

#define LANGCHAT_LONGEST_TEXT 64
#define LANGCHAT_WIDTH 96
Expand Down
20 changes: 20 additions & 0 deletions code/datums/xeno_shields/shield_types/king_shield.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/// Shield can be equal to a maximum of percent_maxhealth_damagecap of the receiver's max hp
/datum/xeno_shield/king_shield
duration = 10 SECONDS
decay_amount_per_second = 100
/// The maximum damage multiplier of max health to apply in a hit
var/percent_maxhealth_damagecap = 0.1

/datum/xeno_shield/king_shield/on_hit(damage)
var/relative_damage_cap = linked_xeno.maxHealth * percent_maxhealth_damagecap

if(damage > relative_damage_cap)
damage = relative_damage_cap
return ..(damage)


/datum/xeno_shield/king_shield/on_removal()
. = ..()
if(linked_xeno)
// Remove the shield overlay early
linked_xeno.remove_suit_layer()
12 changes: 7 additions & 5 deletions code/datums/xeno_shields/xeno_shield.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
// Use the type var if you need to construct a shield with different on hit behavior, damage reduction, etc.
/mob/living/carbon/xenomorph/proc/add_xeno_shield(\
added_amount, shield_source, type = /datum/xeno_shield, \
duration = -1, decay_amount_per_second = 1, \
duration, decay_amount_per_second, \
add_shield_on = FALSE, max_shield = 200)
for (var/datum/xeno_shield/curr_shield in xeno_shields)
if (shield_source == curr_shield.shield_source)
Expand All @@ -78,12 +78,14 @@
new_shield.shield_source = shield_source
xeno_shields += new_shield
new_shield.last_damage_taken = world.time // So we don't insta-delete our shield.

new_shield.decay_amount_per_second = decay_amount_per_second
if(decay_amount_per_second)
new_shield.decay_amount_per_second = decay_amount_per_second
if(duration)
new_shield.duration = duration
new_shield.linked_xeno = src

if(duration > -1)
addtimer(CALLBACK(new_shield, TYPE_PROC_REF(/datum/xeno_shield, begin_decay)), duration)
if(new_shield.duration > -1)
addtimer(CALLBACK(new_shield, TYPE_PROC_REF(/datum/xeno_shield, begin_decay)), new_shield.duration)

overlay_shields()
return new_shield
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 @@ -623,6 +623,8 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou
M = /mob/living/carbon/xenomorph/predalien
if(XENO_CASTE_HELLHOUND)
M = /mob/living/carbon/xenomorph/hellhound
if(XENO_CASTE_KING)
M = /mob/living/carbon/xenomorph/king
return M


Expand Down
16 changes: 16 additions & 0 deletions code/game/objects/effects/effect_system/smoke.dm
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,22 @@

// XENO SMOKES

/obj/effect/particle_effect/smoke/king
opacity = FALSE
color = "#000000"
icon = 'icons/effects/effects.dmi'
icon_state = "sparks"
anchored = TRUE
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
layer = BELOW_OBJ_LAYER
time_to_live = 5
spread_speed = 1
pixel_x = 0
pixel_y = 0

/datum/effect_system/smoke_spread/king_doom
smoke_type = /obj/effect/particle_effect/smoke/king

/datum/effect_system/smoke_spread/xeno_acid
smoke_type = /obj/effect/particle_effect/smoke/xeno_burn

Expand Down
13 changes: 13 additions & 0 deletions code/game/objects/effects/heavy_impact.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//-----------------------------------------
//HEAVY IMPACT
//-----------------------------------------

/obj/effect/heavy_impact
icon = 'icons/effects/heavyimpact.dmi'
icon_state = "heavyimpact"
var/duration = 1.3 SECONDS

/obj/effect/heavy_impact/Initialize(mapload)
. = ..()
flick("heavyimpact", src)
AddElement(/datum/element/temporary, duration)
51 changes: 51 additions & 0 deletions code/game/objects/effects/king_leap.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//-----------------------------------------
//KING LEAP
//-----------------------------------------

#define LEAP_HEIGHT 210 //how high up leaps go, in pixels

/obj/effect/king_leap
icon = 'icons/mob/xenos/king.dmi'
icon_state = "Normal King Charging"
layer = 4.7
plane = -4
pixel_x = -32
var/duration = 10

/obj/effect/king_leap/Initialize(mapload, negative, dir)
. = ..()
setDir(dir)
INVOKE_ASYNC(src, PROC_REF(flight), negative)
AddElement(/datum/element/temporary, duration)

/obj/effect/king_leap/proc/flight(negative)
if(negative)
animate(src, pixel_x = -LEAP_HEIGHT*0.1, pixel_z = LEAP_HEIGHT*0.15, time = 3, easing = BOUNCE_EASING)
else
animate(src, pixel_x = LEAP_HEIGHT*0.1, pixel_z = LEAP_HEIGHT*0.15, time = 3, easing = BOUNCE_EASING)
sleep(0.3 SECONDS)
icon_state = "Normal King Charging"
if(negative)
animate(src, pixel_x = -LEAP_HEIGHT, pixel_z = LEAP_HEIGHT, time = 7)
else
animate(src, pixel_x = LEAP_HEIGHT, pixel_z = LEAP_HEIGHT, time = 7)

/obj/effect/king_leap/end
pixel_x = LEAP_HEIGHT
pixel_z = LEAP_HEIGHT
duration = 10

/obj/effect/king_leap/end/flight(negative)
if(negative)
pixel_x = -LEAP_HEIGHT
animate(src, pixel_x = -16, pixel_z = 0, time = 5)
else
animate(src, pixel_x = -16, pixel_z = 0, time = 5)

/obj/effect/xenomorph/xeno_telegraph/king_attack_template
icon = 'icons/effects/96x96.dmi'
icon_state = "landing2"
layer = BELOW_MOB_LAYER

/obj/effect/xenomorph/xeno_telegraph/king_attack_template/yellow
icon_state = "xenolandingyellow"
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 @@ -140,6 +140,11 @@ GLOBAL_LIST_INIT(pp_transformables, list(
name = XENO_CASTE_PREDALIEN,
key = /mob/living/carbon/xenomorph/predalien,
color = "purple"
),
list(
name = XENO_CASTE_KING,
key = /mob/living/carbon/xenomorph/king,
color="purple"
)
),

Expand Down
Loading

0 comments on commit 085faa8

Please sign in to comment.