Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

So, I found this section, which appears to be where the Cleanliness of the house gets reduced: each slave reduces it by 1, except that shortstacks do 2/3, beastkin 4/3, and a few key races nearly twice the norm.

for person in globals.slaves:
    if person.away.duration == 0:
        if person.bodyshape == 'shortstack':
            globals.state.condition = -0.65
        elif person.race in ['Lamia','Arachna','Centaur', 'Harpy', 'Scylla']:
            globals.state.condition = -1.8
        elif person.race.find('Beastkin') >= 0:
            globals.state.condition = -1.3
        else:
            globals.state.condition = -1.0

But then I took a closer look, and it appears that each line is setting the variable, not changing the variable.  That is, the only loop that matters should be the final loop, in which the condition is set te a negative number related to that specific slave's race.

But since the mansion clearly appears to be getting dirty in a less consistent fashion, it appears that these lines do something I didn't expect.  So I hunted around some more and found this:

func cond_set(value):
    condition += value*conditionmod
    if condition > 100:
        condition = 100
    elif condition < 0:
        condition = 0

...which is defined as the way that this variable gets changed/set.  So I take it that elsewhere in the code, "globals.state.condition = X" gets reinterpreted as "cond_set(X)"?

Related question: If I change these statements to -= X instead of = -X, how would that affect the code, if at all?

You found one of the messier parts of the game's code. Godot provides the option to set custom getter and setter functions for variables in a class. In this case, the class "progress" is found in ".../files/globals.gd". 

var condition = 85 setget cond_set

This variable declaration establishes a custom setter function for "condition", so any attempt to assign a value to "condition" outside the setter function will call the setter function with the new value as the argument for the function. Simply changing "condition = -X" to "condition -= X" causes the resulting value of "condition" to be "condition*2-X".

In order to make the switch, you would need to remove the setter function and update every line in the game that assigns to "condition". Note that all changes to "condition" are multiplied by "conditionmod", which is 1.3, so you would need to include this multiplier in every line when updating them otherwise the value would be reduced.