Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Units AutoDeploy/DeployBlock on Ammo change #1086

Merged

Conversation

Fryone
Copy link
Contributor

@Fryone Fryone commented Jun 24, 2023

Requires units to have:
'Ammo' > 0;
'IsSimpleDeployer=yes';
'Convert.Deploy='.

IsSimpleDeployer vehicle auto-deploy / deploy block on ammo change

  • Vehicle deployment can now be affected by ammo count.
    • Ammo.AutoDeployMinimumAmount determines the minimal number of ammo at which a vehicle converts/deploys automatically.
    • Ammo.DeployUnlockMinimumAmount determines the minimal number of ammo that unlocks issuing vehicle converting/deploying command.
      • Ammo.AutoDeployMaximumAmount and Ammo.DeployUnlockMaximumAmount behave analogically.
      • Setting a negative number will disable ammo count check.

In rulesmd.ini:

[SOMEVEHICLE]                        ; VehicleType
Ammo.AutoDeployMinimumAmount=-1      ; integer
Ammo.AutoDeployMaximumAmount=-1      ; integer
Ammo.DeployUnlockMinimumAmount=-1    ; integer
Ammo.DeployUnlockMaximumAmount=-1    ; integer
Auto-deploy feature requires `Convert.Deploy` from [Ares’ Type Conversion](https://ares-developers.github.io/Ares-docs/new/typeconversion.html) to change type. Unit without it will constantly use deploy command on self until ammo is changed.

IsSimpleDeployer vehicle ammo change on deploy

  • Ammo.AddOnDeploy determines the number of ammo added or substracted on unit deploy.

In rulesmd.ini:

[SOMEVEHICLE]           ; VehicleType
Ammo.AddOnDeploy=0      ; integer

Fryone and others added 23 commits June 17, 2023 10:53
TechnoType:
OnAmmoDepletion.AutoDeploy
OnAmmoDepletion.DeployBlock
removed unsuccesseful building support
This reverts commit 33c8a68.
Suggested refactoring applied
Updated feature description
Credits and Changelog update
OnAmmoDepletion_DeployBlock replaced with OnAmmoDepletion_DeployUnlockAmount
issue fixed, wrong condition
removed unnecessary functions
Implemented Hooks.Unload extension
Copy link
Member

@MortonPL MortonPL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, a few minor style and documentation issues remain.

src/Ext/TechnoType/Body.cpp Outdated Show resolved Hide resolved
src/Ext/Unit/Hooks.Unload.cpp Outdated Show resolved Hide resolved
src/Ext/Unit/Hooks.Unload.cpp Outdated Show resolved Hide resolved
src/Ext/Unit/Hooks.Unload.cpp Outdated Show resolved Hide resolved
docs/Fixed-or-Improved-Logics.md Outdated Show resolved Hide resolved
docs/Fixed-or-Improved-Logics.md Outdated Show resolved Hide resolved
docs/Fixed-or-Improved-Logics.md Show resolved Hide resolved
@MortonPL MortonPL force-pushed the fryone/ammodepletion_deploy branch from c8cc280 to 5548261 Compare July 8, 2023 17:35
Added VoiceCantDeploy to signal that deploying is unavailable
added nodeploy cursor
Docs update
Voice removed
Fixed Deploying on hotkey
- now autodeploy executes on exact amount of ammo
- some renaming
@Fryone Fryone changed the title Units AutoDeploy/DeployBlock on Ammo depletion Units AutoDeploy/DeployBlock on Ammo change Jul 14, 2023
Copy link
Member

@Metadorius Metadorius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would also be good to have this feature at both "sides" of the ammo count, as in instead of
specifying the minimal required amount you can also specify the maximum.

src/Ext/Unit/Hooks.Unload.cpp Outdated Show resolved Hide resolved
src/Ext/Unit/Hooks.Unload.cpp Outdated Show resolved Hide resolved
src/Ext/Unit/Hooks.Unload.cpp Outdated Show resolved Hide resolved
src/Ext/Unit/Hooks.Unload.cpp Outdated Show resolved Hide resolved
@MortonPL MortonPL requested a review from Otamaa August 31, 2023 21:58
Copy link
Contributor

@Otamaa Otamaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me !

@MortonPL MortonPL merged commit ef2dc61 into Phobos-developers:develop Sep 1, 2023
7 checks passed
@Fryone Fryone deleted the fryone/ammodepletion_deploy branch September 1, 2023 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants