Skip to content

Bot no-insurance setting is not working #99

@dnqbob

Description

@dnqbob

From one of my test found out:
Image

AI don't have credits in resource (credits in resource take spaces in resource storage, comes from normally harvesting), but have 10000+ credits as cash (credits in cash does not go into resource storage), which means all credits of this bot is coming from somewhere other than harvesting -- the bot cheat.

However, we have

^BotFallbackInsurance:
	## this trait is not working in this usecase
	GrantConditionOnPlayerResources@botinsurance:
		Condition: noinsurance
		Threshold: 2500
...
	CashTrickler@brutalinsurance:
		Interval: 450
		Amount: 1250
		ShowTicks: False
		RequiresCondition: owned-by-brutal-ai && !noinsurance

As we can see, GrantConditionOnPlayerResources fail to restrict bot credit cheat to 2500.

In GrantConditionOnPlayerResources line 52, we see that the condition is toggled on only when playerResources.Resources > info.Threshold
Image

but actually, player's credit consist 2 part in code: resource and cash. In order to get overall cash, we should use playerResources.GetCashAndResources().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions