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

Combat automation specific attacks #196

Closed
wants to merge 118 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
98b2614
specificAttacks-and-resistance-overhauled
paiva92 Oct 17, 2023
c5125d2
specific-attacks-macro-execution
paiva92 Oct 17, 2023
f41a974
fix-psychicImbalanceCheck-and-check-result
paiva92 Oct 19, 2023
a388b41
code-aesthetic-mystic
paiva92 Oct 21, 2023
aabe156
critic-automation
paiva92 Oct 21, 2023
cb31fdc
fix-localization-criticIfBeAble
paiva92 Oct 21, 2023
71bef2b
fix-executeMacro-resistanceRoll
paiva92 Oct 21, 2023
afaf929
fix-critic-location-side
paiva92 Oct 21, 2023
16f1cbd
fix-psychic-projection
paiva92 Oct 22, 2023
f3747d5
techniques-sheet-active-effects
paiva92 Oct 22, 2023
d6eb742
hotfix-all-attacks-ignores-armor
paiva92 Oct 23, 2023
22d1716
actor-active-effects
paiva92 Oct 24, 2023
7e5bdf1
specific-attacks-combat-damage-fix
paiva92 Oct 25, 2023
e0c6179
new-critic-penalty-flag-hook
paiva92 Oct 25, 2023
955c728
new-domineTechniqueEvaluate-actor
paiva92 Oct 25, 2023
6fd2e58
rebase-fixes
paiva92 Jan 31, 2024
ffb5b59
update-3 equals to
paiva92 Jan 31, 2024
492c163
update-PP
paiva92 Feb 1, 2024
58a7a78
fix-accumulateDefenses
paiva92 Feb 1, 2024
9c34db9
fix-rebase
paiva92 Feb 1, 2024
26cff91
remove-domine technique active effects
paiva92 Feb 1, 2024
c0ef608
revamp-criticPenalty + pain modifiers
paiva92 Feb 2, 2024
474c284
visual - painModifiers
paiva92 Feb 2, 2024
04733d7
replace visuals-effects for status
paiva92 Feb 2, 2024
a1eaaba
Merge branch 'feature/new-combat-automation' into combat-automation-s…
paiva92 Feb 2, 2024
1743d69
Merge branch 'feature/new-combat-automation' into combat-automation-s…
paiva92 Feb 2, 2024
0c49037
fix - specificAttack
paiva92 Feb 3, 2024
a95ecc4
fix-mutate ACT interger
paiva92 Feb 3, 2024
66ab55a
fix-localization combat Modifiers
paiva92 Feb 3, 2024
82cc682
added - endCombat physicalPainDisappearing
paiva92 Feb 3, 2024
49f90c9
new - Combat Surprised automated
paiva92 Feb 3, 2024
9acf7d1
update - modifiers allActrions secondaryInput
paiva92 Feb 3, 2024
e4467cf
fix - surprised without combat
paiva92 Feb 4, 2024
664e990
new - psychicFatigue Combat Dialog Attacker
paiva92 Feb 4, 2024
f422f05
fix-resistanceRoll
paiva92 Feb 5, 2024
d14eb65
new-resistanceRoll socket
paiva92 Feb 6, 2024
e48cac5
rename - psychicPotencialEffect > difficultyAchieved
paiva92 Feb 7, 2024
7f87c6c
revamp - oppousedCheckRoll, CriticRoll, ResistanceRoll - with sockets
paiva92 Feb 7, 2024
0b540af
fix - macro specificAttack
paiva92 Feb 7, 2024
3a128ba
Merge branch 'feature/new-combat-automation' into combat-automation-s…
paiva92 Feb 7, 2024
d776e86
Merge branch 'feature/new-combat-automation' into combat-automation-s…
paiva92 Feb 7, 2024
839f26a
Merge branch 'feature/new-combat-automation' into combat-automation-s…
paiva92 Feb 7, 2024
ee46826
new - Macro mystic-act
paiva92 Feb 9, 2024
108bd86
update - macro-mystic-act
paiva92 Feb 15, 2024
1227728
update - background img
paiva92 Feb 15, 2024
9b48a4b
fix - localization
paiva92 Feb 15, 2024
a0a29fe
update - macro hotbar for users with maxZeon
paiva92 Feb 15, 2024
0a448df
update - release-act & withstand-pain
paiva92 Feb 15, 2024
dff2a3f
fix - mutateMysticData
paiva92 Feb 15, 2024
d1d81f2
Merge branch 'feature/new-combat-automation' into combat-automation-s…
paiva92 Feb 16, 2024
f093771
Merge branch 'combat-automation-specific-attacks' into feature/macro-…
paiva92 Feb 16, 2024
54b5d37
update - mutateData added special for Active Effects
paiva92 Feb 16, 2024
6f4b799
fix - mutate AllActions + pain modifier
paiva92 Feb 16, 2024
4180c95
Merge branch 'feature/new-combat-automation' into combat-automation-s…
paiva92 Feb 16, 2024
7b18e1d
Merge branch 'combat-automation-specific-attacks' into feature/macro-…
paiva92 Feb 16, 2024
16778b1
fix - weapon template hasOwnStr
paiva92 Feb 16, 2024
fdecbba
Merge branch 'fix/weapon-template-hasOwnStr' into combat-automation-s…
paiva92 Feb 16, 2024
7639975
new - actor criticLevel attribute
paiva92 Feb 18, 2024
7318c84
fix - rollResistance rollCritic
paiva92 Feb 20, 2024
4faa356
fix - Active Effects name/label
paiva92 Feb 20, 2024
a38c264
update - executeCombatMacro args hasCritic criticImpact
paiva92 Feb 20, 2024
fa4a220
new - GMCombat applyDamage
paiva92 Feb 20, 2024
4814f83
delete console.log()
paiva92 Feb 20, 2024
c7cddce
Merge branch 'main' into combat-automation-specific-attacks
paiva92 Feb 25, 2024
9fcae48
new - metaMagic template and constant
paiva92 Mar 3, 2024
71bd976
fix - critic roll
paiva92 Mar 3, 2024
9f00995
update - bodyparts on Actor
paiva92 Mar 3, 2024
309bfe6
Merge branch 'develop/new-combat-automation' into combat-automation-s…
paiva92 Mar 3, 2024
83cfd5b
fix - weaponSpecialCheck
paiva92 Mar 3, 2024
65de616
new - applyCritic option GMCombatDialog
paiva92 Mar 4, 2024
40dbcca
update - critic resistance roll display gm-combat-dialog
paiva92 Mar 4, 2024
213c488
update - GMCombat attacker applyCritic
paiva92 Mar 4, 2024
566beed
Merge branch 'develop/new-combat-automation' into combat-automation-s…
paiva92 Mar 4, 2024
6a39947
new - openArmor targeted attack
paiva92 Mar 4, 2024
ab3cba3
Merge branch 'develop/new-combat-automation' into combat-automation-s…
paiva92 Mar 5, 2024
c5702d8
fix - act via = 0
paiva92 Mar 6, 2024
41bc4de
Merge branch 'combat-automation-specific-attacks' into feature/macro-…
paiva92 Mar 6, 2024
9dedaed
Merge branch 'combat-automation-specific-attacks' into feature/metaMagic
paiva92 Mar 6, 2024
59237f6
update - repleace old metamagics with newer version
paiva92 Mar 6, 2024
ee6767f
update - localization
paiva92 Mar 6, 2024
56f7b82
new - spellDamage actor method
paiva92 Mar 6, 2024
fe8da8c
update - spellCasting addedZeonCost
paiva92 Mar 7, 2024
8999f41
fix - mystic actor methods
paiva92 Mar 7, 2024
43e1201
new - metamagics in combat
paiva92 Mar 7, 2024
072c631
fix - combat when not mystic
paiva92 Mar 7, 2024
51302e6
fix - combat hbs
paiva92 Mar 7, 2024
b5fbfe8
fix - combat spellDamage
paiva92 Mar 7, 2024
42222ec
fix - specificAttack knockOut
paiva92 Mar 7, 2024
0b8d278
Merge branch 'develop/new-combat-automation' into combat-automation-s…
paiva92 Mar 7, 2024
c885b4c
Merge branch 'combat-automation-specific-attacks' into feature/macro-…
paiva92 Mar 7, 2024
ea3bc32
fix - zeon accumulated
paiva92 Mar 7, 2024
c54470e
fix - lang knockOut
paiva92 Mar 7, 2024
dcd3611
Merge branch 'combat-automation-specific-attacks' into feature/macro-…
paiva92 Mar 7, 2024
dd34b13
Merge branch 'combat-automation-specific-attacks' into feature/metaMagic
paiva92 Mar 7, 2024
2f6e15d
fix - zeon accumulated actor method
paiva92 Mar 7, 2024
d218f27
Merge branch 'feature/macro-mystic-act' into feature/metaMagic-in-combat
paiva92 Mar 8, 2024
f75d900
update - metamagic exploitationOfNaturalEnergy
paiva92 Mar 8, 2024
05f6b04
update - metamagic definedMagicProjection
paiva92 Mar 8, 2024
724be63
update - metamagic advancedZeonRegeneration
paiva92 Mar 8, 2024
cdf766e
update - flag lastDefinedMagicProjection
paiva92 Mar 8, 2024
43e8bbc
fix - flag lastDefinedMagicProjection
paiva92 Mar 8, 2024
f998766
update - metamagics supernaturalShield
paiva92 Mar 8, 2024
1cffd03
update - metamagic preparedSpell and supernatural shield
paiva92 Mar 8, 2024
9160816
Merge branch 'develop/new-combat-automation' into combat-automation-s…
paiva92 Mar 13, 2024
cebd160
update - spellDamage actor method
paiva92 Mar 13, 2024
9253e84
Merge branch 'feature/metaMagic-in-combat' into combat-automation-spe…
paiva92 Mar 13, 2024
e9072c9
update - rename wrong english properties
paiva92 Mar 13, 2024
b44b255
fix - fatigueUsedBonus
paiva92 Mar 14, 2024
8b2fdfb
Merge branch 'feature/macro-mystic-act' into feature/metaMagic-in-combat
paiva92 Mar 14, 2024
e7e80aa
Merge branch 'develop/new-combat-automation' into combat-automation-s…
paiva92 Mar 18, 2024
0a664de
fix - metamagic increasedDestruction when baseDamage is 0
paiva92 Mar 21, 2024
d2b736b
fix - spellCasting async get Data CombatDefense
paiva92 Mar 27, 2024
cf238b5
fix - async mysticCanCastEvaluate
paiva92 Mar 27, 2024
f799d94
Merge branch 'develop/new-combat-automation' into combat-automation-s…
paiva92 Mar 27, 2024
bd70bdc
update - painModifieres for penalties
paiva92 Apr 12, 2024
d9332ac
new - immuneToCritic
paiva92 Apr 12, 2024
d5a11c9
update - criticRoll display
paiva92 Apr 12, 2024
2774a6b
Merge branch 'develop/new-combat-automation' into combat-automation-s…
paiva92 Apr 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/module/macros/ABFMacros.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { damageCalculatorMacro } from './functions/damageCalculatorMacro';
import { mysticActMacro } from './functions/mysticActMacro';

export const ABFMacros = {
damageCalculator: damageCalculatorMacro
damageCalculator: damageCalculatorMacro,
mysticAct: mysticActMacro
};
107 changes: 107 additions & 0 deletions src/module/macros/functions/mysticActMacro.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
import { Templates } from '../../utils/constants';
import { ABFSettingsKeys } from '../../../utils/registerSettings';
import { getSelectedToken } from '../../utils/functions/getSelectedToken';

const getInitialData = () => {
const showRollByDefault = !!game.settings.get(
'animabf',
ABFSettingsKeys.SEND_ROLL_MESSAGES_ON_COMBAT_BY_DEFAULT
);
const isGM = !!game.user?.isGM;
const token = getSelectedToken(game)
const actor = token.actor;

return {
ui: {
isGM,
hasFatiguePoints: actor.system.characteristics.secondaries.fatigue.value > 0,
},
token,
actor,
showRoll: !isGM || showRollByDefault,
withoutRoll: actor.system.general.settings.defenseType.value === 'mass',
roll: {
resistance: undefined,
value: 0,
modifier: 0,
fatigueUsed: 0
}
};
};

export class MysticActDialog extends FormApplication {
constructor() {
super(getInitialData());

this.modalData = getInitialData();
console.log(this)
this.render(true);
}

static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ['abf-dialog mystic-act-dialog'],
submitOnChange: true,
closeOnSubmit: true,
width: 525,
height: 240,
resizable: true,
template: Templates.Dialog.MysticAct,
title: game.i18n.localize('macros.dialog.mysticAct.title'),
});
}

get actor() {
return this.modalData.actor;
}

async close() {
return super.close();
}

activateListeners(html) {
super.activateListeners(html);

html.find('.send-roll').click(() => {
const {
token,
actor,
showRoll,
withoutRoll,
roll: {
type,
resistance,
value,
modifier,
fatigueUsed,
check
},
oppousedCheck,
critic
} = this.modalData;
const { i18n } = game;


this.render();
});
}

getData() {
const {
roll
} = this.modalData;
console.log("getData")

return this.modalData;
}

async _updateObject(event, formData) {
this.modalData = mergeObject(this.modalData, formData);
console.log("_updateObject")
this.render();
}
}

export const mysticActMacro = async () => {
const results = new MysticActDialog();
}
1 change: 1 addition & 0 deletions src/module/utils/constants.ts
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ export const Templates = {
Dialog: {
ModDialog: 'systems/animabf/templates/dialog/mod-dialog.html',
DamageCalculator: 'systems/animabf/templates/dialog/damage-calculator.hbs',
MysticAct: 'systems/animabf/templates/dialog/mystic-act.hbs',
newPreparedSpell: 'systems/animabf/templates/dialog/new-prepared-spell.hbs',
newSupernaturalShield: {
main: 'systems/animabf/templates/dialog/new-supernatural-shield/new-supernatural-shield.hbs',
14 changes: 14 additions & 0 deletions src/module/utils/functions/getSelectedToken.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { ABFDialogs } from "../../dialogs/ABFDialogs";

export function getSelectedToken(game) {
const selectedTokens = game.canvas.tokens?.controlled ?? [];

if (selectedTokens.length !== 1) {
const msg = game.i18n.localize(selectedTokens.length > 0 ? 'macros.dialog.error.multipleSelectedToken.title' : 'macros.dialog.error.noSelectedToken.title');

ABFDialogs.prompt(msg);
throw new Error(msg);
}

return selectedTokens[0].document;
}
4 changes: 4 additions & 0 deletions src/templates/custom-hotbar/custom-hotbar.hbs
Original file line number Diff line number Diff line change
@@ -13,6 +13,10 @@
<img src='/systems/animabf/assets/icons/game-icons.net/ffffff/lorc/sword-clash.svg' />
<p class='shortcut'>ctrl + 2</p>
</div>
<div title='{{localize 'customHotbar.mysticAct'}}' id='custom-hotbar-mystic-act' class='custom-macro'>
<img src='/icons/svg/aura.svg' />
<p class='shortcut'>ctrl + 3</p>
</div>
</ol>
{{else}}
<ol class='macros'>
76 changes: 76 additions & 0 deletions src/templates/dialog/mystic-act.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<form class='{{cssClass}}' autocomplete='off'>
{{#> "systems/animabf/templates/common/ui/group.hbs"
class="mystic-act"
}}
{{>
"systems/animabf/templates/common/ui/group-header.hbs"
title=(localize (concat 'macros.dialog.mystic-act.title'))
}}
{{#> "systems/animabf/templates/common/ui/group-body.hbs"
class="mystic-act"
}}
<div class='columns'>
<div>
{{>
"systems/animabf/templates/common/ui/horizontal-titled-input.hbs"
title=(localize 'macros.combat.dialog.noRoll.title')
disabled=true
inputType="checkbox"
inputName="withoutRoll"
inputValue=(is 'eq' this.withoutRoll true)
}}
</div>
<div>
{{#if this.ui.isGM}}
{{>
"systems/animabf/templates/common/ui/horizontal-titled-input.hbs"
title=(localize 'macros.combat.dialog.showRoll.title')
disabled=true
inputType="checkbox"
inputName="showRoll"
inputValue=(is 'eq' this.showRoll true)
}}
{{/if}}
</div>
</div>

{{>
"systems/animabf/templates/common/ui/horizontal-titled-input.hbs"
title=(localize 'macros.combat.dialog.modifier.title')
disabled=false
inputName="roll.modifier"
inputValue=this.roll.modifier
}}

{{>
"systems/animabf/templates/common/ui/horizontal-titled-input.hbs"
title=(localize "macros.combat.dialog.rollValue.title")
disabled=true
inputName="roll.value"
inputValue=this.roll.value
}}

{{#if this.ui.hasFatiguePoints}}
{{#> 'systems/animabf/templates/common/ui/custom-select.hbs'
title=(localize 'macros.combat.dialog.fatigue.title')
disabled=this.rollSent
inputName="roll.fatigueUsed"
inputValue=this.roll.fatigueUsed
}}
<option {{#if (is "eq" 0 this.roll.fatigueUsed)}}selected{{/if}} value='0'>0</option>

{{#iterateNumber this.actor.system.characteristics.secondaries.fatigue.value}}
<option {{#if (is "eq" (math this "+" 1) ../this.roll.fatigueUsed)}}selected{{/if}} value='{{math this "+" 1}}'>{{math this "+" 1}}</option>
{{/iterateNumber}}
{{/'systems/animabf/templates/common/ui/custom-select.hbs'}}
{{else}}
<p class='label no-fatigue'>{{localize 'macros.combat.dialog.notEnoughFatigue.title'}}</p>
{{/if}}

<button class='abf-button send-roll' data-type='roll'>
{{localize 'macros.combat.dialog.rollButton.title'}}
</button>

{{/"systems/animabf/templates/common/ui/group-body.hbs"}}
{{/"systems/animabf/templates/common/ui/group.hbs"}}
</form>
5 changes: 5 additions & 0 deletions src/utils/attachCustomMacroBar.ts
Original file line number Diff line number Diff line change
@@ -21,6 +21,11 @@ const DEFAULT_GM_MACROS: DefaultMacroConfig[] = [
macroSelectorId: '#custom-hotbar-send-attack',
hotkey: e => e.ctrlKey && e.key === '2',
fn: () => window.Websocket.sendAttack?.()
},
{
macroSelectorId: '#custom-hotbar-mystic-act',
hotkey: e => e.ctrlKey && e.key === '3',
fn: () => ABFMacros.mysticAct()
}
];

1 change: 1 addition & 0 deletions src/utils/preloadTemplates.ts
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ export const preloadTemplates = () => {
const templatePaths: string[] = [
Templates.Dialog.ModDialog,
Templates.Dialog.DamageCalculator,
Templates.Dialog.MysticAct,
Templates.Dialog.newSupernaturalShield.main,
Templates.Dialog.newSupernaturalShield.parts.mystic,
Templates.Dialog.newSupernaturalShield.parts.psychic,