Skip to content

Commit

Permalink
Autowiki data for xenomorph caste stats (#7019)
Browse files Browse the repository at this point in the history
# About the pull request

Generates autowiki templates for each caste's stats.

As far as I can tell, the wiki currently displays xeno states in two
places:
1. Plain text in the body of the article (e.g. [`Has 650 health, 25
armour, 400 plasma and 22 slash
damage.`](https://cm-ss13.com/wiki/Boiler))
2. The "XenoSkills" bar chart at the end of the article (e.g.
https://cm-ss13.com/wiki/Boiler#Boiler_Stats)

This PR enables full templatization of the plaintext stats, and
optionally expanding them to include some new information (namely
_speed_ and _claw strength_).
The chart template uses tiers instead of numeric values, so backing it
with this information would require more consideration.

Notes:
- Excluded castes are: Larva, Facehuggers, Hellhounds, and Predaliens
- Speed is transformed to be more human-readable (e.g. Carrier goes from
`-0.2` to `1.2`)

# Explain why it's good for the game

Less manual copying of numbers from the source code to the wiki.
Optionally provides more information.

# Testing Photographs and Procedure
I do not know how I would go about testing my local changes on the wiki,
so I have not. I have looked at the gun autowiki stuff and I do not see
anything indicating that this would not work.

<details>

<summary>Autowiki Output</summary>

```
{"title":"Tempalte:AutoWiki/Content/XenoStats/Carrier","text":"{{Autowiki/XenoStats|Name=Carrier|Health=650|Armor=0|Plasma=500|Plasma Regeneration=3.5|Minimum Melee Damage=25|Maximum Melee Damage=35|Claw Strength=1|Evasion=0|Speed=1.2|Explosion Resistance=20}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Eggsac_Carrier","text":"{{Autowiki/XenoStats|Name=Eggsac Carrier|Health=650|Armor=0|Plasma=500|Plasma Regeneration=3.5|Minimum Melee Damage=25|Maximum Melee Damage=35|Claw Strength=1|Evasion=0|Speed=1.2|Explosion Resistance=20}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Ravager","text":"{{Autowiki/XenoStats|Name=Ravager|Health=650|Armor=25|Plasma=300|Plasma Regeneration=5|Minimum Melee Damage=45|Maximum Melee Damage=45|Claw Strength=3|Evasion=0|Speed=1|Explosion Resistance=80}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Berserker_Ravager","text":"{{Autowiki/XenoStats|Name=Berserker Ravager|Health=590|Armor=30|Plasma=0|Plasma Regeneration=5|Minimum Melee Damage=45|Maximum Melee Damage=45|Claw Strength=3|Evasion=0|Speed=1.15|Explosion Resistance=80}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Hedgehog_Ravager","text":"{{Autowiki/XenoStats|Name=Hedgehog Ravager|Health=590|Armor=30|Plasma=0|Plasma Regeneration=5|Minimum Melee Damage=35|Maximum Melee Damage=35|Claw Strength=3|Evasion=0|Speed=1.15|Explosion Resistance=80}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Praetorian","text":"{{Autowiki/XenoStats|Name=Praetorian|Health=650|Armor=25|Plasma=800|Plasma Regeneration=3|Minimum Melee Damage=40|Maximum Melee Damage=40|Claw Strength=1|Evasion=0|Speed=1.6|Explosion Resistance=40}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Dancer_Praetorian","text":"{{Autowiki/XenoStats|Name=Dancer Praetorian|Health=650|Armor=20|Plasma=800|Plasma Regeneration=3|Minimum Melee Damage=40|Maximum Melee Damage=40|Claw Strength=2|Evasion=0|Speed=1.85|Explosion Resistance=40}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Oppressor_Praetorian","text":"{{Autowiki/XenoStats|Name=Oppressor Praetorian|Health=650|Armor=20|Plasma=800|Plasma Regeneration=3|Minimum Melee Damage=30|Maximum Melee Damage=30|Claw Strength=2|Evasion=0|Speed=1.6|Explosion Resistance=40}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Vanguard_Praetorian","text":"{{Autowiki/XenoStats|Name=Vanguard Praetorian|Health=590|Armor=20|Plasma=800|Plasma Regeneration=3|Minimum Melee Damage=30|Maximum Melee Damage=30|Claw Strength=2|Evasion=0|Speed=1.75|Explosion Resistance=40}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Warden_Praetorian","text":"{{Autowiki/XenoStats|Name=Warden Praetorian|Health=590|Armor=20|Plasma=800|Plasma Regeneration=3|Minimum Melee Damage=20|Maximum Melee Damage=20|Claw Strength=2|Evasion=0|Speed=1.5|Explosion Resistance=40}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Hivelord","text":"{{Autowiki/XenoStats|Name=Hivelord|Health=550|Armor=0|Plasma=1000|Plasma Regeneration=5.5|Minimum Melee Damage=20|Maximum Melee Damage=25|Claw Strength=1|Evasion=0|Speed=0.8|Explosion Resistance=10}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Resin_Whisperer_Hivelord","text":"{{Autowiki/XenoStats|Name=Resin Whisperer Hivelord|Health=550|Armor=0|Plasma=800|Plasma Regeneration=5.5|Minimum Melee Damage=20|Maximum Melee Damage=25|Claw Strength=1|Evasion=0|Speed=0.8|Explosion Resistance=10}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Defender","text":"{{Autowiki/XenoStats|Name=Defender|Health=500|Armor=35|Plasma=100|Plasma Regeneration=5|Minimum Melee Damage=25|Maximum Melee Damage=30|Claw Strength=1|Evasion=0|Speed=1.6|Explosion Resistance=70}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Steelcrest_Defender","text":"{{Autowiki/XenoStats|Name=Steelcrest Defender|Health=500|Armor=35|Plasma=100|Plasma Regeneration=5|Minimum Melee Damage=20|Maximum Melee Damage=25|Claw Strength=1|Evasion=0|Speed=1.6|Explosion Resistance=70}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Warrior","text":"{{Autowiki/XenoStats|Name=Warrior|Health=500|Armor=20|Plasma=0|Plasma Regeneration=5|Minimum Melee Damage=30|Maximum Melee Damage=40|Claw Strength=2|Evasion=0|Speed=1.8|Explosion Resistance=40}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Crusher","text":"{{Autowiki/XenoStats|Name=Crusher|Health=700|Armor=30|Plasma=400|Plasma Regeneration=4|Minimum Melee Damage=40|Maximum Melee Damage=40|Claw Strength=3|Evasion=0|Speed=0.8|Explosion Resistance=100}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Charger_Crusher","text":"{{Autowiki/XenoStats|Name=Charger Crusher|Health=780|Armor=20|Plasma=400|Plasma Regeneration=4|Minimum Melee Damage=30|Maximum Melee Damage=30|Claw Strength=3|Evasion=0|Speed=0.95|Explosion Resistance=100}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Runner","text":"{{Autowiki/XenoStats|Name=Runner|Health=230|Armor=0|Plasma=0|Plasma Regeneration=1|Minimum Melee Damage=20|Maximum Melee Damage=25|Claw Strength=1|Evasion=0|Speed=3|Explosion Resistance=10}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Acider_Runner","text":"{{Autowiki/XenoStats|Name=Acider Runner|Health=345|Armor=15|Plasma=0|Plasma Regeneration=1|Minimum Melee Damage=20|Maximum Melee Damage=25|Claw Strength=1|Evasion=0|Speed=2.75|Explosion Resistance=10}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Boiler","text":"{{Autowiki/XenoStats|Name=Boiler|Health=650|Armor=20|Plasma=400|Plasma Regeneration=4|Minimum Melee Damage=20|Maximum Melee Damage=25|Claw Strength=1|Evasion=0|Speed=1|Explosion Resistance=20}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Trapper_Boiler","text":"{{Autowiki/XenoStats|Name=Trapper Boiler|Health=590|Armor=0|Plasma=400|Plasma Regeneration=4|Minimum Melee Damage=20|Maximum Melee Damage=25|Claw Strength=1|Evasion=0|Speed=0.75|Explosion Resistance=20}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Burrower","text":"{{Autowiki/XenoStats|Name=Burrower|Health=500|Armor=25|Plasma=600|Plasma Regeneration=4.5|Minimum Melee Damage=25|Maximum Melee Damage=30|Claw Strength=1|Evasion=0|Speed=1.2|Explosion Resistance=40}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Drone","text":"{{Autowiki/XenoStats|Name=Drone|Health=500|Armor=0|Plasma=1000|Plasma Regeneration=4.5|Minimum Melee Damage=20|Maximum Melee Damage=25|Claw Strength=1|Evasion=15|Speed=1.8|Explosion Resistance=0}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Gardener_Drone","text":"{{Autowiki/XenoStats|Name=Gardener Drone|Health=500|Armor=0|Plasma=1000|Plasma Regeneration=4.5|Minimum Melee Damage=20|Maximum Melee Damage=25|Claw Strength=1|Evasion=15|Speed=1.8|Explosion Resistance=0}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Healer_Drone","text":"{{Autowiki/XenoStats|Name=Healer Drone|Health=500|Armor=0|Plasma=1000|Plasma Regeneration=4.5|Minimum Melee Damage=15|Maximum Melee Damage=20|Claw Strength=1|Evasion=15|Speed=1.8|Explosion Resistance=0}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Lesser_Drone","text":"{{Autowiki/XenoStats|Name=Lesser Drone|Health=160|Armor=0|Plasma=300|Plasma Regeneration=4|Minimum Melee Damage=20|Maximum Melee Damage=20|Claw Strength=1|Evasion=10|Speed=1.6|Explosion Resistance=0}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Lurker","text":"{{Autowiki/XenoStats|Name=Lurker|Health=450|Armor=0|Plasma=400|Plasma Regeneration=4.5|Minimum Melee Damage=35|Maximum Melee Damage=35|Claw Strength=2|Evasion=0|Speed=2.4|Explosion Resistance=20}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Vampire_Lurker","text":"{{Autowiki/XenoStats|Name=Vampire Lurker|Health=390|Armor=20|Plasma=0|Plasma Regeneration=4.5|Minimum Melee Damage=30|Maximum Melee Damage=30|Claw Strength=2|Evasion=0|Speed=2.45|Explosion Resistance=20}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Sentinel","text":"{{Autowiki/XenoStats|Name=Sentinel|Health=500|Armor=0|Plasma=400|Plasma Regeneration=3|Minimum Melee Damage=20|Maximum Melee Damage=25|Claw Strength=1|Evasion=0|Speed=1.8|Explosion Resistance=10}}"}
{"title":"Tempalte:AutoWiki/Content/XenoStats/Spitter","text":"{{Autowiki/XenoStats|Name=Spitter|Health=550|Armor=15|Plasma=600|Plasma Regeneration=4|Minimum Melee Damage=20|Maximum Melee Damage=30|Claw Strength=1|Evasion=0|Speed=1.4|Explosion Resistance=20}}"}
{"title":"Template:Autowiki/Content/XenoStats","text":["{{Tempalte:AutoWiki/Content/XenoStats/Carrier}}","{{Tempalte:AutoWiki/Content/XenoStats/Eggsac_Carrier}}","{{Tempalte:AutoWiki/Content/XenoStats/Ravager}}","{{Tempalte:AutoWiki/Content/XenoStats/Berserker_Ravager}}","{{Tempalte:AutoWiki/Content/XenoStats/Hedgehog_Ravager}}","{{Tempalte:AutoWiki/Content/XenoStats/Praetorian}}","{{Tempalte:AutoWiki/Content/XenoStats/Dancer_Praetorian}}","{{Tempalte:AutoWiki/Content/XenoStats/Oppressor_Praetorian}}","{{Tempalte:AutoWiki/Content/XenoStats/Vanguard_Praetorian}}","{{Tempalte:AutoWiki/Content/XenoStats/Warden_Praetorian}}","{{Tempalte:AutoWiki/Content/XenoStats/Hivelord}}","{{Tempalte:AutoWiki/Content/XenoStats/Resin_Whisperer_Hivelord}}","{{Tempalte:AutoWiki/Content/XenoStats/Defender}}","{{Tempalte:AutoWiki/Content/XenoStats/Steelcrest_Defender}}","{{Tempalte:AutoWiki/Content/XenoStats/Warrior}}","{{Tempalte:AutoWiki/Content/XenoStats/Crusher}}","{{Tempalte:AutoWiki/Content/XenoStats/Charger_Crusher}}","{{Tempalte:AutoWiki/Content/XenoStats/Runner}}","{{Tempalte:AutoWiki/Content/XenoStats/Acider_Runner}}","{{Tempalte:AutoWiki/Content/XenoStats/Boiler}}","{{Tempalte:AutoWiki/Content/XenoStats/Trapper_Boiler}}","{{Tempalte:AutoWiki/Content/XenoStats/Burrower}}","{{Tempalte:AutoWiki/Content/XenoStats/Drone}}","{{Tempalte:AutoWiki/Content/XenoStats/Gardener_Drone}}","{{Tempalte:AutoWiki/Content/XenoStats/Healer_Drone}}","{{Tempalte:AutoWiki/Content/XenoStats/Lesser_Drone}}","{{Tempalte:AutoWiki/Content/XenoStats/Lurker}}","{{Tempalte:AutoWiki/Content/XenoStats/Vampire_Lurker}}","{{Tempalte:AutoWiki/Content/XenoStats/Sentinel}}","{{Tempalte:AutoWiki/Content/XenoStats/Spitter}}"]}
```

</details>

---------

Co-authored-by: harryob <55142896+harryob@users.noreply.github.com>
  • Loading branch information
RainAndSand and harryob authored Aug 24, 2024
1 parent 0c18878 commit b8e0706
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 0 deletions.
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 @@ -1516,6 +1516,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

0 comments on commit b8e0706

Please sign in to comment.