Return Fire -> Defensive firestance - #8139
Merged
Ruwetuin merged 39 commits intoJul 4, 2026
Merged
Conversation
this allows us to block unwanted targets.
Contributor
SethDGamre
marked this pull request as ready for review
July 3, 2026 02:48
SethDGamre
marked this pull request as draft
July 3, 2026 12:15
Ruwetuin
pushed a commit
that referenced
this pull request
Jul 3, 2026
Since they're builders and canReclaim is undefined, it seems the engine considers them as able to reclaim things. This is impossible for them to actually do as factories. This messes up the WIP FireState Defend I'm working on. #8139 Merge this with it.
SethDGamre
marked this pull request as ready for review
July 3, 2026 17:11
efrec
reviewed
Jul 5, 2026
| local refCount = (weaponWatchRefCount[weaponDefID] or 0) + 1 | ||
| weaponWatchRefCount[weaponDefID] = refCount | ||
| if refCount == 1 then | ||
| Script.SetWatchAllowTarget(weaponDefID, true) |
Collaborator
There was a problem hiding this comment.
See notes on AllowWeaponTarget in unit_aa_targeting_priority.lua.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enable in ModOptions Experimental tab "New Defend Firestate" to use
Is greatly aided by merging: #8159 as well to prevent falsely considering factories as threats.
Replace the mostly unused Return Fire with a new and more useful Defensive firestate. A defensive unit will shoot targets that are a threat to itself on a 1v1 basis.
What's a threat?
If the target run up and shoot you before you can kill it, it's a threat. This is done with prebaked math related to DPS, Distance, movement speed, and health.
What's this useful for?
Random notes.
firestate or after being healed.
I'm most active on discord, you can participate in the brunt of discussion here: https://discord.com/channels/549281623154229250/1520166826435280998/1520166826435280998
AI disclosure:
Used claude 4.8, gpt 5.5, and cursor's "auto mode" to conduct research, suggest and write some of the changes, and change the unitdefs. The shape of the functions, flow, and design and decisions for changes are strictly mine.