-
Notifications
You must be signed in to change notification settings - Fork 763
Arsenal - Improve armor stat for medical #10561
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
Closed
Closed
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
87618c8
Arsenal - Improve armor stat for medical, fix gforce stat
LinkIsGrim c0d17f7
Merge branch 'master' into arsenal-medical-protection
LinkIsGrim 3217c31
Merge remote-tracking branch 'origin/master' into arsenal-medical-pro…
LinkIsGrim 9e03e62
Merge branch 'arsenal-medical-protection' of https://github.com/acemo…
LinkIsGrim a25deba
Apply suggestions from code review
LinkIsGrim 84bfdc7
Merge remote-tracking branch 'origin/master' into arsenal-medical-pro…
LinkIsGrim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| class EGVAR(arsenal,stats) { | ||
| class statBase; | ||
| class ACE_ballisticProtection: statBase { | ||
| condition = QUOTE(!(missionNamespace getVariable [ARR_2(QQEGVAR(medical,enabled),false)])); // Hide if medical is enabled | ||
| }; | ||
| class ACE_explosiveResistance: statBase { | ||
| condition = QUOTE(!(missionNamespace getVariable [ARR_2(QQEGVAR(medical,enabled),false)])); // Hide if medical is enabled | ||
| }; | ||
| class GVAR(armor): ACE_ballisticProtection { | ||
| displayName = "$STR_UI_ABAR"; | ||
| condition = QUOTE(missionNamespace getVariable [ARR_2(QQEGVAR(medical,enabled),false)]); // Show if medical is enabled | ||
| showBar = 1; | ||
| barStatement = QUOTE((_this select 1) call FUNC(statBarStatement_armor)); | ||
| showText = 1; | ||
| textStatement = QUOTE((_this select 1) call FUNC(statTextStatement_armor)); | ||
| }; | ||
| }; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| #include "script_component.hpp" | ||
|
|
||
| class CfgPatches { | ||
| class SUBADDON { | ||
| addonRootClass = QUOTE(COMPONENT); | ||
| units[] = {}; | ||
| weapons[] = {}; | ||
| requiredVersion = REQUIRED_VERSION; | ||
| requiredAddons[] = { | ||
| "ace_medical_engine", | ||
| "ace_arsenal" | ||
| }; | ||
| skipWhenMissingDependencies = 1; | ||
| VERSION_CONFIG; | ||
| }; | ||
| }; | ||
|
|
||
| #include "ACE_Arsenal_Stats.hpp" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #define SUBCOMPONENT arsenal | ||
| #define SUBCOMPONENT_BEAUTIFIED Arsenal | ||
| #include "..\script_component.hpp" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| #include "..\script_component.hpp" | ||
| /* | ||
| * Author: LinkIsGrim | ||
| * Bar statement for armor. | ||
| * | ||
| * Arguments: | ||
| * 0: Item config path <CONFIG> | ||
| * | ||
| * Return Value: | ||
| * Bar statement <NUMBER> | ||
| * | ||
| * Public: No | ||
| */ | ||
|
|
||
| params ["_config"]; | ||
|
|
||
| private _itemType = getNumber (_config >> "ItemInfo" >> "type"); | ||
|
|
||
| private _hitpoint = ["HitChest", "HitHead"] select (_itemType == TYPE_HEADGEAR); | ||
| private _levelStep = [4, 2] select (_itemType == TYPE_HEADGEAR); | ||
|
|
||
| ([configName _config, _hitpoint] call EFUNC(medical_engine,getItemArmor)) params ["_armor", "_armorScaled"]; | ||
|
|
||
| if (_armor > (_armorScaled * 2)) then { // Probably explosive-resistant armor | ||
| _armor = _armorScaled; | ||
| }; | ||
|
|
||
| private _armorLevel = (_armor - _levelStep) / _levelStep; | ||
|
|
||
| 0.01 max (_armorLevel / 5) min 1 | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| #include "..\script_component.hpp" | ||
| /* | ||
| * Author: LinkIsGrim | ||
| * Text statement for armor. | ||
| * | ||
| * Arguments: | ||
| * 0: Item config path <CONFIG> | ||
| * | ||
| * Return Value: | ||
| * Stat Text <STRING> | ||
| * | ||
| * Public: No | ||
| */ | ||
|
|
||
| params ["_config"]; | ||
|
|
||
| private _itemType = getNumber (_config >> "ItemInfo" >> "type"); | ||
|
|
||
| private _hitpoint = ["HitChest", "HitHead"] select (_itemType == TYPE_HEADGEAR); | ||
| private _levelStep = [4, 2] select (_itemType == TYPE_HEADGEAR); | ||
|
|
||
| ([configName _config, _hitpoint] call EFUNC(medical_engine,getItemArmor)) params ["_armor", "_armorScaled"]; | ||
|
|
||
| if (_armor > (_armorScaled * 2)) then { // Probably explosive-resistant armor | ||
| _armor = _armorScaled; | ||
| }; | ||
|
|
||
|
LinkIsGrim marked this conversation as resolved.
Outdated
|
||
| private _armorLevel = 0 max (round ((_armor - _levelStep) / _levelStep)) min 5; | ||
|
|
||
| localize ([ | ||
| "STR_A3_SP_NOARMOR", | ||
| "STR_A3_SP_AL_I", | ||
| "STR_A3_SP_AL_II", | ||
| "STR_A3_SP_AL_III", | ||
| "STR_A3_SP_AL_IV", | ||
| "STR_A3_SP_AL_V" | ||
| ] select _armorLevel) | ||
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.
Uh oh!
There was an error while loading. Please reload this page.