SurvivorHollower

Updated a year ago

Xan.ROR2VoidPlayerCharacterCommon.SurvivorHelper.SurvivorHollower

This class is used to "hollow out" existing monsters so that they may be turned into survivors. It is, of course, oriented to the Void character model type.

Public Methods

static GameObject CreateBodyWithSkins(string bodyReplacementName, string bodyDir, string allyBodyDir)

This is the first method that should be called. This receives a new name for the survivor prefab, the path to the void enemy prefab, and the path to the equivalent void ally prefab. Duplicates and registers the prefab, stripping out its DeathRewards (which is what monsters use), stripping out all skills and skill families, and then reading the materials from the normal and ally variants to create the two skins for the survivor, all in a single method.

static void FinalizeBody(SkillLocator skillLocator)

This is the last method that should be called. This registers all skills to the game. It also asserts that the skills have been created properly (for instance, that they have a name).

static void AddSkill(GameObject bodyContainer, SkillDef definition, SlotType slotType, int variantIndex = 0)

Adds a skill to the hollowed survivor. bodyContainer should be the return value of CreateBodyWithSkins. This will put the skill into the appropriate slot at the appropriate index, ensuring that the skill family has a high enough capacity to contain the skills.