Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Castfind is a simple programming interface for the Cast Finder mod, allowing for the specification of the types of FtHoF outcomes and the backfire value. You can use this to string together "sequences" of spells, and Cast Finder will take one sequence each time to try to find said specific sequence arbitarily far into a given seed.
- In addition, Castfind also supports:
- - Base backfire chance adjustments according to such modifiers
- - Simplified way of setting GFD values through common abbreviations in the backfire chance field (what GFD selects is directly linked to backfire chance)
- - Set maximum search depths for each sequence
- - Set a probability for each sequence to be chosen
- - Simple compounding expressions for FtHoF outcome and backfire chance
- == Syntax
- There are three kinds of scopes in Castfind: Global, Sequence, and Local. You can think of scopes as just continuous chunks of the code, and scopes can house other scopes as long as those other scopes are entirely contained within it.
- - Global is the biggest kind of scope and it defines everything separated by the ampersands (&) or its equivalents. A "global" chunk of the code is typically a complete sequence.
- - Sequence is entirely contained within each global scope. It defines everything separated by the commas (,). This typically means the profile of a single cast, or modifier declaration
- - Local is entirely contained within each sequence scope. Each sequence scope can have up to 3 of them.
- - FtHoF outcome: an "Effect expression" that defines what FtHoF outcomes to find
- - note: this step does not account backfiring chance, so something like "elder frenzy" won't actually give you ef 85% of the times, because that 85% of the times it only gives ef if it backfires through increasing backfire chance
- - Backfire chance: a "Backfire expression" that defines what ranges of backfire values to find.
- - Local modifier: backfire chance modifiers that only apply for that spell. It can be used to simulate stuff like slotting or unslotting si only for that cast.
- - Precise syntax is down below.
- Global separator: ampersand (‘&’), or new line if there is not a comma/ampersand directly before or after it
- Sequence separator: comma (‘,’)
- Removed characters: space, round brackets, tabs, new lines that do not qualify for ampersand equivalents
- - These characters are immediately REMOVED upon compilation. Therefore, they won't show up in error logs.
- All uppercase characters are immediately converted to lowercase equivalents upon compilation.
- You can import code from another site that returns raw text by using: import[] (put url into the square brackets)
- NOTE: Will be affixed as js code, so you will need to include code in it to properly import
- Find: [number] > Find the casts with a depth of [number] (default: 9999)
- P: [float]> The chance for the next sequence to be pooled
- - If no sequence gets pooled, cast finder will not attempt to find any outcomes and will just give you a random seed
- The above two can only be declared in global space and separated by global separators
- - In other words, separated by ampersands or its equivalents
- Effect expressions
- (shorthands below, can be substituted for the actual terms)
- f > Frenzy
- bs > Building Special
- ef > Elder Frenzy
- cf > Click Frenzy
- l > Lucky!
- sweet > Sweet!
- clot > Clot
- ruin > Ruin
- blab > Blab
- cuf > Cursed Finger
- cs > Cookie Storm
- sd/drop > Cookie Storm Drop
- * > All outcomes
- [compound effect expression]
- - A compound expression takes in multiple effects and returns true if the cast is any of the effects.
- ‘;’ > separators in a compound expression
- ‘*’ > acts as NOT operator if placed before the first term
- - Example of compound expression: "cf;ef"
- - Will find a cast that either cf or ef
- - Note: the quotation marks are not included in the compound effect expression.
- - Another example: "*f;l"
- - Will find a cast that is NOT either frenzy or lucky
- - Individual declaration of backfire expression for each item in a compound expression is currently unsupported. (so like, "n^cf;b^ef" doesn't work)
- Backfire expression determines the first random call when casting a spell, which can represent the amount of backfire chance required to backfire for that specific cast or the GFD outcome. Here, the "backfire chance" is the "Chance to backfire" stat displayed in-game. Any expression that does not directly specify a number between 0 and 1 will take into consideration the backfire modifiers that you may have set (for conveience); backfire modifiers include si, rb, di (diminish ineptitude success), or im (ineptitude magified, or diminish ineptitude backfire).
- - Example: 45%+, or backfire chance must be above 45% to backfire. That means that 2 gcs must be onscreen for it to have a chance to backfire. Note that this is just the backfire expression; you also need an outcome for it to be a valid cast definition.
- - Example: 15%-, or backfire chance must be below 15% to backfire. Since default backfire chance is 15%, the backfire chance is always below default backfire chance, thus it is basically equivalent to "b" (unless di is active)
- - The Backfire chance here is inverted from the number in the game and in FtHoF planner v5.
- Backfire expression: [content]^ to prefix
- [content] can be:
- - b > Will backfire at 0gc chance
- - bb > Will backfire if casted from gfd (with 0gc chance)
- - n > Will not backfire at 0gc chance
- - nn > Will not backfire if casted from gfd (with 0gc chance)
- [range expression]
- - [number1]=[number2] > backfire chance must be between [number1] and [number2], inclusive toward [number1] only (this is not affected by modifiers)
- - [number]+ > backfire chance must be more than [number] (not affected by modifiers)
- - [number]- > backfire chance must be less than [number] (not affected by modifiers)
- - [number]gc+ > Will backfire at [number] gcs onscreen.
- - [number]gc- > Will not backfire at [number] gcs onscreen. (e.g. must take at least [number] gcs to have a chance to backfire)
- - cbg, fthof, st, se, hc, scp, ra, di > GFD must yield the spell, given full magic and that all spells can be casted
- - Conjure Baked Goods, Force the Hand of Fate, Stretch Time, Spontaneous Edifice, Haggler’s Charm, Summon Crafty Pixies, Resurrect Abomination, Diminish Ineptitude
- - You can also use the unabbreviated versions
- - hagglers and pixies are also acceptable for hagglers charm and summon crafty pixies, respectively
- - Backfire chance is shared between GFD outcome and backfiring, so GFD outcomes are necessarily in the same section as where Backfire expressions are declared.
- [compound backfire expression]
- - A compound expression takes in multiple backfire expressions and returns true if any of them is true.
- - ‘;’ > separators in a compound expression
- - Example of compound expression: "0.15-;0.85+"
- - Will find a cast with the backfire chance either below 15% or above 85%.
- - Note: the quotation marks are not included in the compound expression.
- [local modifier]
- - ‘si’ > supreme intellect equipped
- - ‘rb’ > reality bending equipped
- - ‘di’ > diminish ineptitude success
- - ‘im’ > ineptitude magnified (diminish ineptitude backfire)
- - 'x' > nullify all modifiers
- modifiers go after the backfire expression with a colon (‘:’)
- - Example of local modifier: "b:si^*"
- - Will find a cast that will always backfire with no gcs onscreen and with si equipped.
- - Note: the quotation marks are not included in the modifier expression.
- Sequence modifiers: [content]
- Put modifiers in [content]. The modifiers will apply to all subsequent statements until sequence modifiers are declared again or until sequence ends. Sequence modifiers are overridden by local modifiers.
- Global modifiers: [content]
- Put modifiers in [content]. The modifiers will apply to all subsequent sequences until global modifiers are declared again. Global modifiers are overridden by local and sequence modifiers.
- == Examples
- Find: 9999 & P: 1 &
- n^cf, n^*
- Finds a sequence with a successful click frenzy to start and another successful (with no GCs onscreen) cast afterwards.
- Find: 19999 & P: 1 & si &
- b^ef, n^*, sidi, *, *, 4gc-^bs
- b^ef, n^*, sidi, *, 3gc-^bs, *
- b^ef, n^*, sidi, 2gc-^bs, *, *
- Finds a sequence with a backfire elder frenzy to start and at least one building special that will always succeed, assuming that supreme intellect is always equipped, with a nonbackfire diminish ineptitude cast after the first cast. Note that "sidi" represents a change in backfire chance (having si and di success) and not actually the cast itself (the cast iself is represented by "n^*").
- Attempts to search with a depth of 19999.
Advertisement
Add Comment
Please, Sign In to add comment