Talk:Gentling mask

From Caves of Qud Wiki
Jump to navigation Jump to search

Parts.SlaveMask, Parts.DomesticatedSlave, Parts.HasSlaves

Hi. The three sections of code in the title are those that control the initialisation, spawning, and emancipation of newfather slaves. One thing I can't figure out, though, is where in this code the enslaved creatures are added to the newfather's party. In Parts.SlaveMask, the method reset handles any instance of the mask/cone being separated from the body of the slave by resetting the PartyLeader, Goals, and faction associations of that creature, as well as by removing the DomesticatedSlave part from the creature's GameObject. However, nowhere in Parts.DomesticatedSlave or Parts.SlaveMask are these properties set. Similarly, I can't find any references to the DomesticatedSlave part elsewhere in the game's code that would set these properties. Does anybody know how the party relationship between the newfather and their slaves is initialised? Knotrice (talk) 07:11, 3 December 2020 (UTC)

  • The party leadership details are handled by the IBondedCompanion interface (XRL.World.Parts.IBondedCompanion). You will notice that XRL.World.Parts.DomesticatedSlave extends the IBondedCompanion interface (public class DomesticatedSlave : IBondedCompanion). For this reason it essentially inherits the code from the IBondedCompanion part. IBondedCompanion includes an ObjectCreatedEvent where the companion and faction properties are configured.
    Egocarib (talk) 20:47, 4 December 2020 (UTC)
    • Thanks for your reply! I'm coming from Java so I wasn't familiar with C#'s : notation for extending classes, but your info makes sense. I'll write up an entry for the mask and cone later today. Knotrice (talk) 02:39, 5 December 2020 (UTC)