Skip to content

Math in Rules #2

@dethwing

Description

@dethwing

I'm having some trouble using math in the rules section. Here's an example.

Rule(
description="Legend Sword Logic",
left_side=[ (value("elder_firestorm")+128),(value("elder_elixer")+128),(value("Legend_Sword")+128),
value("Old_Axe"),value("Fire_Urn"),value("Charmstone_Chest"),value("Power"),value("Star_Key"),value("Oasis_Boots") ],
rule_type="count",
right_side=("==",128,"==",1)
),

I want exactly one of these 7 values to result in the value that creates a particular item called the "Legend Sword". The issue is that for the first 3, that value is 0, and for the other 4, that value is 128.

So I thought I had hit upon a solution by adding 128 to the first 3 and asking the rule to make exactly one is 128. However, after a few trial generations, I got the following seed:

Charmstone_Chest : 128 [0x80]
Legend_Sword : 0 [0x00]

Which is not what I had in mind. It seems the rule is ignoring the +128 inside each parenthesis, and just comparing each to 128. Any thoughts on how I could correct this?

Thank you.

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