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

Evolution now doesn't rely on caste, adds casteswap, adds strong acid for everyone on prep phase. #107

Merged
merged 12 commits into from
Aug 23, 2024
3 changes: 3 additions & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -259,3 +259,6 @@
#define TRAIT_SUPER_STRONG "t_super_strong"
/// Foreign biology. Basic medHUDs won't show the mob. (Yautja, Zombies)
#define TRAIT_FOREIGN_BIO "t_foreign_bio"
//regress and caste swap UI
#define TRAIT_CASTE_SWAP "caste_swap"
#define TRAIT_REGRESSING "regressing"
1 change: 1 addition & 0 deletions code/_globalvars/lists/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ GLOBAL_LIST_EMPTY_TYPED(mob_illusions_list, /mob/illusion)
GLOBAL_LIST_INIT(xeno_types_tier_one, list(/mob/living/carbon/xenomorph/runner, /mob/living/carbon/xenomorph/drone, /mob/living/carbon/xenomorph/sentinel, /mob/living/carbon/xenomorph/defender))
GLOBAL_LIST_INIT(xeno_types_tier_two, list(/mob/living/carbon/xenomorph/hunter, /mob/living/carbon/xenomorph/panther, /mob/living/carbon/xenomorph/warrior, /mob/living/carbon/xenomorph/spitter, /mob/living/carbon/xenomorph/hivelord, /mob/living/carbon/xenomorph/carrier, /mob/living/carbon/xenomorph/bull))
GLOBAL_LIST_INIT(xeno_types_tier_three, list(/mob/living/carbon/xenomorph/gorger, /mob/living/carbon/xenomorph/ravager, /mob/living/carbon/xenomorph/praetorian, /mob/living/carbon/xenomorph/boiler, /mob/living/carbon/xenomorph/defiler, /mob/living/carbon/xenomorph/crusher, /mob/living/carbon/xenomorph/shrike, /mob/living/carbon/xenomorph/behemoth, /mob/living/carbon/xenomorph/chimera))
GLOBAL_LIST_INIT(xeno_types_tier_four, list(/mob/living/carbon/xenomorph/shrike, /mob/living/carbon/xenomorph/queen, /mob/living/carbon/xenomorph/king))

GLOBAL_LIST_INIT_TYPED(hive_datums, /datum/hive_status, init_hive_datum_list()) // init by make_datum_references_lists()

Expand Down
3 changes: 3 additions & 0 deletions code/_globalvars/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,8 @@ GLOBAL_PROTECT(key_to_time_of_death)
GLOBAL_LIST_EMPTY(key_to_time_of_xeno_death)
GLOBAL_PROTECT(key_to_time_of_xeno_death)

GLOBAL_LIST_EMPTY(key_to_time_of_caste_swap)
GLOBAL_PROTECT(key_to_time_of_caste_swap)

///List of ssd living mobs
GLOBAL_LIST_EMPTY(ssd_living_mobs)
2 changes: 1 addition & 1 deletion code/modules/codex/entries/mobs_codex.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

if(xeno_caste.caste_flags & CASTE_EVOLUTION_ALLOWED)
xeno_strings += "<br><U>This can evolve to</U>:"
for(var/type in xeno_caste.evolves_to)
for(var/type in get_evolution_options())
xeno_strings += "[GLOB.xeno_caste_datums[type][XENO_UPGRADE_BASETYPE].caste_name]"

if(length(actions))
Expand Down
17 changes: 11 additions & 6 deletions code/modules/mob/living/carbon/xenomorph/abilities.dm
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,9 @@
use_state_flags = ABILITY_USE_BUCKLED

/datum/action/ability/activable/xeno/corrosive_acid/can_use_ability(atom/A, silent = FALSE, override_flags)
var/obj/effect/xenomorph/acid/current_acid_type = acid_type
if(SSmonitor.gamestate == SHUTTERS_CLOSED && CHECK_BITFIELD(SSticker.mode?.flags_round_type, MODE_ALLOW_XENO_QUICKBUILD) && SSresinshaping.active)
current_acid_type = /obj/effect/xenomorph/acid/strong //if it is before shutters open, everyone gets strong acid
// Check if it's an acid object we're upgrading
if (istype(A, /obj/effect/xenomorph/acid))
var/obj/effect/xenomorph/acid/existing_acid = A
Expand All @@ -631,24 +634,26 @@
if(!silent)
owner.balloon_alert(owner, "We can't melt [A]")
return FALSE
if(A.resistance_flags & UNACIDABLE || !A.dissolvability(initial(acid_type.acid_strength)))
if(A.resistance_flags & UNACIDABLE || !A.dissolvability(initial(current_acid_type.acid_strength)))
if(!silent)
owner.balloon_alert(owner, "We cannot dissolve [A]")
return FALSE
if(!A.should_apply_acid(initial(acid_type.acid_strength)) || initial(acid_type.acid_strength) <= A.current_acid?.acid_strength)
if(!A.should_apply_acid(initial(acid_type.acid_strength)) || initial(current_acid_type.acid_strength) <= A.current_acid?.acid_strength)
if(!silent)
owner.balloon_alert(owner, "[A] is already subject to a more or equally powerful acid")
return FALSE

/datum/action/ability/activable/xeno/corrosive_acid/use_ability(atom/A)
var/mob/living/carbon/xenomorph/X = owner

var/obj/effect/xenomorph/acid/current_acid_type = acid_type
if(SSmonitor.gamestate == SHUTTERS_CLOSED && CHECK_BITFIELD(SSticker.mode?.flags_round_type, MODE_ALLOW_XENO_QUICKBUILD) && SSresinshaping.active)
current_acid_type = /obj/effect/xenomorph/acid/strong //if it is before shutters open, everyone gets strong acid
// Check if it's an acid object we're upgrading
if (istype(A, /obj/effect/xenomorph/acid))
if(istype(A, /obj/effect/xenomorph/acid))
var/obj/effect/xenomorph/acid/existing_acid = A
A = existing_acid.acid_t // Swap the target to the target of the acid

if(!A.dissolvability(initial(acid_type.acid_strength)))
if(!A.dissolvability(initial(current_acid_type.acid_strength)))
return fail_activate()

X.face_atom(A)
Expand All @@ -662,7 +667,7 @@

var/old_acid_ticks = A.current_acid?.ticks
QDEL_NULL(A.current_acid)
A.current_acid = new acid_type(get_turf(A), A, A.dissolvability(initial(acid_type.acid_strength)), old_acid_ticks)
A.current_acid = new current_acid_type(get_turf(A), A, A.dissolvability(initial(current_acid_type.acid_strength)), old_acid_ticks)

succeed_activate()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,7 @@
// *** Evolution *** //
evolution_threshold = 225

evolves_to = list(
/mob/living/carbon/xenomorph/crusher,
/mob/living/carbon/xenomorph/behemoth,
)
deevolves_to = list(
/mob/living/carbon/xenomorph/runner,
)
deevolves_to = /mob/living/carbon/xenomorph/runner

// *** Flags *** //
caste_flags = CASTE_EVOLUTION_ALLOWED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@

deevolves_to = /mob/living/carbon/xenomorph/drone

evolves_to = list(/mob/living/carbon/xenomorph/defiler, /mob/living/carbon/xenomorph/gorger,)

// *** Flags *** //
caste_flags = CASTE_EVOLUTION_ALLOWED
can_hold_eggs = CAN_HOLD_ONE_HAND
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@

// *** Evolution *** //
evolution_threshold = 100
evolves_to = list(
/mob/living/carbon/xenomorph/warrior,
/mob/living/carbon/xenomorph/bull,
)

deevolves_to = /mob/living/carbon/xenomorph/larva

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@

// *** Evolution *** //
evolution_threshold = 100
evolves_to = list(
/mob/living/carbon/xenomorph/shrike,
/mob/living/carbon/xenomorph/queen,
/mob/living/carbon/xenomorph/king,
/mob/living/carbon/xenomorph/carrier,
/mob/living/carbon/xenomorph/hivelord,
/mob/living/carbon/xenomorph/hivemind,
)

deevolves_to = /mob/living/carbon/xenomorph/larva

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
max_health = 600

// *** Evolution *** //
deevolves_to = list(/mob/living/carbon/xenomorph/warrior, /mob/living/carbon/xenomorph/hivelord)
deevolves_to = /mob/living/carbon/xenomorph/hivelord

// *** Flags *** //
caste_flags = CASTE_INNATE_PLASMA_REGEN|CASTE_PLASMADRAIN_IMMUNE|CASTE_EVOLUTION_ALLOWED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@

deevolves_to = /mob/living/carbon/xenomorph/drone

evolves_to = list(/mob/living/carbon/xenomorph/defiler, /mob/living/carbon/xenomorph/gorger)

// *** Flags *** //
caste_flags = CASTE_EVOLUTION_ALLOWED|CASTE_IS_BUILDER
can_hold_eggs = CAN_HOLD_TWO_HANDS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
// *** Evolution *** //
evolution_threshold = 225

evolves_to = list(/mob/living/carbon/xenomorph/ravager, /mob/living/carbon/xenomorph/chimera)
deevolves_to = /mob/living/carbon/xenomorph/runner

// *** Flags *** //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@

// *** Evolution *** //
evolution_threshold = 50
evolves_to = list(
/mob/living/carbon/xenomorph/drone,
/mob/living/carbon/xenomorph/runner,
/mob/living/carbon/xenomorph/sentinel,
/mob/living/carbon/xenomorph/defender,
)

// *** Flags *** //
caste_flags = CASTE_EVOLUTION_ALLOWED|CASTE_INNATE_HEALING
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,6 @@

// *** Evolution *** //
evolution_threshold = 50
evolves_to = list(
/mob/living/carbon/xenomorph/predalien,
)

// *** Flags *** //
caste_flags = CASTE_EVOLUTION_ALLOWED|CASTE_INNATE_HEALING
Expand Down Expand Up @@ -203,3 +200,9 @@
icon_state = "[base_icon_state] Stunned"
else
icon_state = "[base_icon_state]"

/mob/living/carbon/xenomorph/larva/predalien/get_evolution_options()
. = list()
if(HAS_TRAIT(src, TRAIT_CASTE_SWAP) || HAS_TRAIT(src, TRAIT_REGRESSING))
return
return list(/mob/living/carbon/xenomorph/predalien)
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
// *** Evolution *** //
evolution_threshold = 225

evolves_to = list(/mob/living/carbon/xenomorph/ravager, /mob/living/carbon/xenomorph/chimera)
deevolves_to = /mob/living/carbon/xenomorph/runner

// *** Flags *** //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@
// *** Evolution *** //
evolution_threshold = 100

evolves_to = list(
/mob/living/carbon/xenomorph/hunter,
/mob/living/carbon/xenomorph/bull,
/mob/living/carbon/xenomorph/panther,
)
// *** Flags *** //
caste_flags = CASTE_EVOLUTION_ALLOWED
can_flags = CASTE_CAN_BE_QUEEN_HEALED|CASTE_CAN_BE_GIVEN_PLASMA|CASTE_CAN_BE_LEADER|CASTE_CAN_RIDE_CRUSHER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
// *** Evolution *** //
evolution_threshold = 100

evolves_to = list(/mob/living/carbon/xenomorph/spitter)

// *** Flags *** //
caste_flags = CASTE_EVOLUTION_ALLOWED
can_flags = CASTE_CAN_BE_QUEEN_HEALED|CASTE_CAN_BE_GIVEN_PLASMA|CASTE_CAN_BE_LEADER|CASTE_CAN_RIDE_CRUSHER|CASTE_CAN_HOLD_FACEHUGGERS|CASTE_CAN_HOLD_JELLY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
// *** Evolution *** //
maximum_active_caste = 1

evolves_to = list(/mob/living/carbon/xenomorph/queen)
deevolves_to = /mob/living/carbon/xenomorph/drone

// *** Flags *** //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,7 @@
// *** Evolution *** //
evolution_threshold = 225

evolves_to = list(
/mob/living/carbon/xenomorph/boiler,
/mob/living/carbon/xenomorph/praetorian,
)
deevolves_to = list(
/mob/living/carbon/xenomorph/sentinel,
)
deevolves_to = /mob/living/carbon/xenomorph/sentinel

// *** Flags *** //
caste_flags = CASTE_EVOLUTION_ALLOWED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
max_health = 375
spit_types = list(/datum/ammo/energy/xeno/psy_blast)

deevolves_to = list(/mob/living/carbon/xenomorph/warrior)
deevolves_to = /mob/living/carbon/xenomorph/warrior
can_flags = CASTE_CAN_BE_QUEEN_HEALED|CASTE_CAN_BE_GIVEN_PLASMA|CASTE_CAN_BE_LEADER
caste_traits = null
soft_armor = list(MELEE = 40, BULLET = 40, LASER = 40, ENERGY = 40, BOMB = 10, BIO = 35, FIRE = 35, ACID = 35)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
// *** Evolution *** //
evolution_threshold = 225

evolves_to = list(/mob/living/carbon/xenomorph/crusher, /mob/living/carbon/xenomorph/gorger, /mob/living/carbon/xenomorph/warlock, /mob/living/carbon/xenomorph/behemoth, /mob/living/carbon/xenomorph/chimera)
deevolves_to = /mob/living/carbon/xenomorph/defender

// *** Flags *** //
Expand Down
11 changes: 8 additions & 3 deletions code/modules/mob/living/carbon/xenomorph/evo_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
"cooldown" = (initial(xeno_ability.cooldown_duration) / 10)
)
.["evolves_to"] = list()
for(var/evolves_into in xeno.xeno_caste.evolves_to)
for(var/evolves_into in xeno.get_evolution_options())
var/datum/xeno_caste/caste = GLOB.xeno_caste_datums[evolves_into][XENO_UPGRADE_BASETYPE]
var/list/caste_data = list(
"type_path" = caste.caste_type_path,
"name" = caste.display_name,
"abilities" = list(),
"instant_evolve" = (caste.caste_flags & CASTE_INSTANT_EVOLUTION),
"instant_evolve" = (caste.caste_flags & CASTE_INSTANT_EVOLUTION || (HAS_TRAIT(xeno, TRAIT_CASTE_SWAP) || HAS_TRAIT(xeno, TRAIT_REGRESSING))),
)
for(var/ability in caste.actions)
var/datum/action/ability/xeno_action/xeno_ability = ability
Expand Down Expand Up @@ -74,5 +74,10 @@
switch(action)
if("evolve")
var/datum/xeno_caste/caste = GLOB.xeno_caste_datums[text2path(params["path"])][XENO_UPGRADE_BASETYPE]
xeno.do_evolve(caste.caste_type_path, caste.display_name) // All the checks for can or can't are handled inside do_evolve
xeno.do_evolve(caste.caste_type_path, caste.display_name, (HAS_TRAIT(xeno, TRAIT_CASTE_SWAP) || HAS_TRAIT(xeno, TRAIT_REGRESSING))) // All the checks for can or can't are handled inside do_evolve
return TRUE

/datum/evolution_panel/ui_close(mob/user)
. = ..()
REMOVE_TRAIT(user, TRAIT_CASTE_SWAP, TRAIT_CASTE_SWAP)
REMOVE_TRAIT(user, TRAIT_REGRESSING, TRAIT_REGRESSING)
Loading
Loading