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

Autowiki data for xenomorph caste stats #7019

Merged
merged 11 commits into from
Aug 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions code/modules/autowiki/pages/xeno_stats.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/datum/autowiki/xeno_stats
generate_multiple = TRUE
page = "Template:Autowiki/Content/XenoStats"

/datum/autowiki/xeno_stats/generate_multiple()
var/output = list()

for(var/mob/living/carbon/xenomorph/xeno as anything in subtypesof(/mob/living/carbon/xenomorph))
if(IS_AUTOWIKI_SKIP(xeno))
continue

var/mob/living/carbon/xenomorph/xeno_instance = new xeno()

var/strains = list(null) + xeno_instance.caste.available_strains
for(var/datum/xeno_strain/strain as anything in strains)
var/datum/xeno_strain/strain_instance = null
if(!isnull(strain))
strain_instance = new strain()

output += template_from_xeno(xeno_instance, strain_instance)

qdel(strain_instance)

qdel(xeno_instance)

return output

/datum/autowiki/xeno_stats/proc/template_from_xeno(mob/living/carbon/xenomorph/xeno, datum/xeno_strain/strain)
var/name = xeno.caste_type
if(!isnull(strain))
strain.apply_strain(xeno)
name = "[strain.name] [name]"

var/xeno_data = list(
"name" = name,
"health" = xeno.maxHealth,
"armor" = xeno.armor_deflection,
"plasma" = xeno.plasma_max,
"plasma_regeneration" = xeno.plasma_gain,
"minimum_slash_damage" = xeno.melee_damage_lower,
"maximum_slash_damage" = xeno.melee_damage_upper,
"claw_strength" = xeno.claw_type,
"evasion" = xeno.evasion,
// Mob speed is relatively non-obvious, we we convert it into a very intuitive
// range for wiki-readability.
"speed" = humanize_speed(xeno.speed),
"explosion_resistance" = xeno.caste.xeno_explosion_resistance,
)

var/sanitized_name = url_encode(replacetext(name, " ", "_"))
return list(list(title = "Tempalte:AutoWiki/Content/XenoStats/[sanitized_name]", text = include_template("Autowiki/XenoStats", xeno_data)))

/datum/autowiki/xeno_stats/proc/humanize_speed(speed)
return speed * -1 + 1
1 change: 1 addition & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Drone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
weed_food_states_flipped = list("Drone_1","Drone_2","Drone_3")

/mob/living/carbon/xenomorph/drone/tutorial
AUTOWIKI_SKIP(TRUE)

/mob/living/carbon/xenomorph/drone/tutorial/gib(datum/cause_data/cause = create_cause_data("gibbing", src))
death(cause, 1)
2 changes: 2 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
minimap_icon = "facehugger"

/mob/living/carbon/xenomorph/facehugger
AUTOWIKI_SKIP(TRUE)

name = XENO_CASTE_FACEHUGGER
caste_type = XENO_CASTE_FACEHUGGER
speak_emote = list("hisses")
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Hellhound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
minimap_icon = "hellhound"

/mob/living/carbon/xenomorph/hellhound
AUTOWIKI_SKIP(TRUE)

caste_type = XENO_CASTE_HELLHOUND
name = XENO_CASTE_HELLHOUND
desc = "A disgusting beast from hell, it has four menacing spikes growing from its head."
Expand Down
16 changes: 16 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Larva.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
minimum_evolve_time = 0

/mob/living/carbon/xenomorph/larva
AUTOWIKI_SKIP(TRUE)

name = XENO_CASTE_LARVA
caste_type = XENO_CASTE_LARVA
speak_emote = list("hisses")
Expand Down Expand Up @@ -68,24 +70,38 @@
pass_flags.flags_can_pass_all = PASS_ALL^PASS_OVER_THROW_ITEM

/mob/living/carbon/xenomorph/larva/corrupted
AUTOWIKI_SKIP(TRUE)

hivenumber = XENO_HIVE_CORRUPTED

/mob/living/carbon/xenomorph/larva/alpha
AUTOWIKI_SKIP(TRUE)

hivenumber = XENO_HIVE_ALPHA

/mob/living/carbon/xenomorph/larva/bravo
AUTOWIKI_SKIP(TRUE)

hivenumber = XENO_HIVE_BRAVO

/mob/living/carbon/xenomorph/larva/charlie
AUTOWIKI_SKIP(TRUE)

hivenumber = XENO_HIVE_CHARLIE

/mob/living/carbon/xenomorph/larva/delta
AUTOWIKI_SKIP(TRUE)

hivenumber = XENO_HIVE_DELTA

/mob/living/carbon/xenomorph/larva/mutated
AUTOWIKI_SKIP(TRUE)

hivenumber = XENO_HIVE_MUTATED

/mob/living/carbon/xenomorph/larva/predalien
AUTOWIKI_SKIP(TRUE)

icon_xeno = 'icons/mob/xenos/predalien_larva.dmi'
icon_state = "Predalien Larva"
caste_type = XENO_CASTE_PREDALIEN_LARVA
Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Predalien.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
minimap_icon = "predalien"

/mob/living/carbon/xenomorph/predalien
AUTOWIKI_SKIP(TRUE)

caste_type = XENO_CASTE_PREDALIEN
name = "Abomination" //snowflake name
desc = "A strange looking creature with fleshy strands on its head. It appears like a mixture of armor and flesh, smooth, but well carapaced."
Expand Down Expand Up @@ -114,6 +116,8 @@ You must still listen to the queen.
. += "It has [predalienkills.kills] kills to its name!"

/mob/living/carbon/xenomorph/predalien/tutorial
AUTOWIKI_SKIP(TRUE)

should_announce_spawn = FALSE

/mob/living/carbon/xenomorph/predalien/tutorial/gib(datum/cause_data/cause = create_cause_data("gibbing", src))
Expand Down
18 changes: 18 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Queen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@
return ..()

/mob/living/carbon/xenomorph/queen
AUTOWIKI_SKIP(TRUE)

caste_type = XENO_CASTE_QUEEN
name = XENO_CASTE_QUEEN
desc = "A huge, looming alien creature. The biggest and the baddest."
Expand Down Expand Up @@ -370,28 +372,44 @@
return "heart_t3"

/mob/living/carbon/xenomorph/queen/corrupted
AUTOWIKI_SKIP(TRUE)

hivenumber = XENO_HIVE_CORRUPTED

/mob/living/carbon/xenomorph/queen/forsaken
AUTOWIKI_SKIP(TRUE)

hivenumber = XENO_HIVE_FORSAKEN

/mob/living/carbon/xenomorph/queen/forsaken/combat_ready
AUTOWIKI_SKIP(TRUE)

hivenumber = XENO_HIVE_FORSAKEN
queen_aged = TRUE

/mob/living/carbon/xenomorph/queen/alpha
AUTOWIKI_SKIP(TRUE)

hivenumber = XENO_HIVE_ALPHA

/mob/living/carbon/xenomorph/queen/bravo
AUTOWIKI_SKIP(TRUE)

hivenumber = XENO_HIVE_BRAVO

/mob/living/carbon/xenomorph/queen/charlie
AUTOWIKI_SKIP(TRUE)

hivenumber = XENO_HIVE_CHARLIE

/mob/living/carbon/xenomorph/queen/delta
AUTOWIKI_SKIP(TRUE)

hivenumber = XENO_HIVE_DELTA

/mob/living/carbon/xenomorph/queen/mutated
AUTOWIKI_SKIP(TRUE)

hivenumber = XENO_HIVE_MUTATED

/mob/living/carbon/xenomorph/queen/combat_ready
Expand Down
1 change: 1 addition & 0 deletions colonialmarines.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1515,6 +1515,7 @@
#include "code\modules\autowiki\autowiki.dm"
#include "code\modules\autowiki\pages\_page.dm"
#include "code\modules\autowiki\pages\guns.dm"
#include "code\modules\autowiki\pages\xeno_stats.dm"
#include "code\modules\buildmode\bm-mode.dm"
#include "code\modules\buildmode\buildmode.dm"
#include "code\modules\buildmode\buttons.dm"
Expand Down
Loading