Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jarena3 committed Jun 28, 2022
1 parent 6199a51 commit 583e918
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 125 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- **Help Menu** Update help menu options [#2001](https://github.com/massif-press/compcon/issues/2001)
- **Active Mode** Improve Overcharge Pip determination (thanks msprijatelj!)
- **Cloud** Improve sign-up/in reliability (thanks msprijatelj!)
- **Pilot Sheet** Fixed failing import for Pilots with Bond data being imported into environments without the KTB LCP installed [#2007](https://github.com/massif-press/compcon/issues/2007)

### Features
- **Pilot Sheet** Revised Statblock Generator (thanks karidyas!) [#1887](https://github.com/massif-press/compcon/issues/1887)
Expand Down
7 changes: 6 additions & 1 deletion src/classes/components/feature/FeatureCollector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ abstract class FeatureCollector {
element[property].forEach(candidate => {
if (candidate['Destroyed'] !== undefined && (candidate as any).Destroyed) return
if (candidate['IsCascading'] !== undefined && (candidate as any).IsCascading) return
if (candidate['Used'] !== undefined && (candidate as any).Used) return
if (
collection.toLowerCase() !== 'action' &&
candidate['Used'] !== undefined &&
(candidate as any).Used
)
return
out.push(candidate as T)
})
return out
Expand Down
8 changes: 7 additions & 1 deletion src/classes/mech/ActiveState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,10 @@ class ActiveState {
}

public ItemActions(type: string): Action[] {
return this.ActiveMech.FeatureController.Actions.filter(x => x.Activation === type)
return [
...this.ActiveMech.FeatureController.Actions,
...this._pilot.FeatureController.Actions,
].filter(x => x.Activation === type)
}

public ActionsByType(type: string): Action[] {
Expand Down Expand Up @@ -1182,6 +1185,9 @@ class ActiveState {
if (this.ActiveMech.Destroyed) {
return ['act_dismount']
}

console.log(this.AllActions.map(x => x.Name))

const out = this.AllActions.filter(x => x.IsMechAction && !x.IsActiveHidden).map(x => x.ID)
if (!this.ActiveMech.IsShutDown) out.splice(out.indexOf('act_boot_up'), 1)
return out
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<template>
<v-footer
fixed
style="padding-bottom: 4px; border-top: 2px solid var(--v-primary-base)"
>
<v-footer fixed style="padding-bottom: 4px; border-top: 2px solid var(--v-primary-base)">
<v-row no-gutters justify="space-between" align="center">
<v-col cols="auto">
<v-dialog v-model="ecDialog" width="80vw">
Expand All @@ -26,8 +23,8 @@
<span class="accent--text">COMP/CON</span>
:
<span class="stark-text--text">Confirmation Required</span>
] Pilot, proceeding will disengage combat mode and enable rest
and repair protocols. This cannot be undone. Continue?
] Pilot, proceeding will disengage combat mode and enable rest and repair protocols.
This cannot be undone. Continue?
</p>
<v-row justify="center" no-gutters class="mt-n2"></v-row>
<v-row justify="center" class="mt-2">
Expand All @@ -37,8 +34,8 @@
tile
color="warning darken-3"
@click="
ecDialog = false;
state.StartRest();
ecDialog = false
state.StartRest()
"
>
&nbsp;Start Rest
Expand All @@ -53,30 +50,21 @@
<v-col cols="auto">
<v-row dense>
<v-col cols="auto">
<v-menu
v-if="state.InTurn"
v-model="turnConfirm"
close-on-content-click
offset-y
>
<v-btn
slot="activator"
:small="$vuetify.breakpoint.mdAndUp"
:x-small="$vuetify.breakpoint.smAndDown"
color="secondary"
dark
elevation="0"
@click="
endTurnConfirm.length ? (turnConfirm = true) : stageEndTurn()
"
>
END TURN
</v-btn>
<cc-confirmation
no-cc
:content="endTurnConfirm"
@confirm="stageEndTurn()"
/>
<v-menu v-if="state.InTurn" v-model="turnConfirm" close-on-content-click offset-y>
<template v-slot:activator="{ on }">
<v-btn
slot="activator"
:small="$vuetify.breakpoint.mdAndUp"
:x-small="$vuetify.breakpoint.smAndDown"
color="secondary"
dark
elevation="0"
v-on="endTurnConfirm.length ? on : stageEndTurn()"
>
END TURN
</v-btn>
</template>
<cc-confirmation no-cc :content="endTurnConfirm" @confirm="stageEndTurn()" />
</v-menu>
<v-btn
v-else
Expand Down Expand Up @@ -105,11 +93,7 @@
START ROUND {{ state.Round + 1 }}
</v-btn>
</template>
<cc-confirmation
no-cc
:content="nextRoundConfirm"
@confirm="stageNextRound()"
/>
<cc-confirmation no-cc :content="nextRoundConfirm" @confirm="stageNextRound()" />
</v-menu>
</v-col>
</v-row>
Expand All @@ -128,35 +112,23 @@
:actions="state.ActionsByType('Protocol')"
:mech="pilot.ActiveMech"
:available="state.IsProtocolAvailable"
:color="
state.IsProtocolAvailable
? 'action--protocol'
: 'grey darken-1'
"
:color="state.IsProtocolAvailable ? 'action--protocol' : 'grey darken-1'"
title="PROTOCOLS"
@open-menu="openMenu(0)"
@open-dialog="openDialog($event)"
>
<v-icon slot="icon" color="white" size="40"
>cci-protocol</v-icon
>
<v-icon slot="icon" color="white" size="40">cci-protocol</v-icon>
</action-menu-button>
</cc-tooltip>
</v-col>

<v-col
v-if="$vuetify.breakpoint.lgAndUp && !mech.Pilot.IsDownAndOut"
cols="auto"
>
<v-col v-if="$vuetify.breakpoint.lgAndUp && !mech.Pilot.IsDownAndOut" cols="auto">
<v-divider vertical class="mx-3" />
</v-col>

<v-col v-if="!mech.Pilot.IsDownAndOut" cols="auto">
<cc-tooltip inline content="Movement" delayed>
<move-menu-button
:mech="pilot.ActiveMech"
@open-dialog="openDialog($event)"
/>
<move-menu-button :mech="pilot.ActiveMech" @open-dialog="openDialog($event)" />
</cc-tooltip>
</v-col>
<v-col v-if="!mech.Pilot.IsDownAndOut">
Expand All @@ -170,9 +142,7 @@
@open-menu="openMenu(1)"
@open-dialog="openDialog($event)"
>
<v-icon slot="icon" color="white" size="30"
>mdi-hexagon-slice-6</v-icon
>
<v-icon slot="icon" color="white" size="30">mdi-hexagon-slice-6</v-icon>
</action-menu-button>
</cc-tooltip>
</v-col>
Expand All @@ -187,9 +157,7 @@
@open-menu="openMenu(2)"
@open-dialog="openDialog($event)"
>
<v-icon slot="icon" color="white" size="30"
>mdi-hexagon-slice-3</v-icon
>
<v-icon slot="icon" color="white" size="30">mdi-hexagon-slice-3</v-icon>
</action-menu-button>
</cc-tooltip>
</v-col>
Expand All @@ -204,9 +172,7 @@
@open-menu="openMenu(3)"
@open-dialog="openDialog($event)"
>
<v-icon slot="icon" color="white" size="35"
>cci-reaction</v-icon
>
<v-icon slot="icon" color="white" size="35">cci-reaction</v-icon>
</action-menu-button>
</cc-tooltip>
</v-col>
Expand All @@ -221,17 +187,12 @@
@open-menu="openMenu(4)"
@open-dialog="openDialog($event)"
>
<v-icon slot="icon" color="white" size="35"
>cci-free-action</v-icon
>
<v-icon slot="icon" color="white" size="35">cci-free-action</v-icon>
</action-menu-button>
</cc-tooltip>
</v-col>

<v-col
v-if="$vuetify.breakpoint.lgAndUp && !mech.Pilot.IsDownAndOut"
cols="auto"
>
<v-col v-if="$vuetify.breakpoint.lgAndUp && !mech.Pilot.IsDownAndOut" cols="auto">
<v-divider vertical class="mx-3" />
</v-col>

Expand All @@ -242,17 +203,13 @@
:small="$vuetify.breakpoint.lgAndUp"
:x-small="$vuetify.breakpoint.smAndDown"
dark
:fab="
$vuetify.breakpoint.lgAndUp || $vuetify.breakpoint.smAndDown
"
:fab="$vuetify.breakpoint.lgAndUp || $vuetify.breakpoint.smAndDown"
elevation="0"
color="primary"
@click="openMenu(5)"
>
<v-icon color="white" size="25">mdi-notebook</v-icon>
<span v-if="$vuetify.breakpoint.md" class="pl-2"
>COMBAT LOG</span
>
<span v-if="$vuetify.breakpoint.md" class="pl-2">COMBAT LOG</span>
</v-btn>
</cc-tooltip>
</v-col>
Expand All @@ -263,9 +220,7 @@
:small="$vuetify.breakpoint.lgAndUp"
:x-small="$vuetify.breakpoint.smAndDown"
dark
:fab="
$vuetify.breakpoint.lgAndUp || $vuetify.breakpoint.smAndDown
"
:fab="$vuetify.breakpoint.lgAndUp || $vuetify.breakpoint.smAndDown"
elevation="0"
color="primary"
@click="openMenu(6)"
Expand All @@ -287,29 +242,23 @@
:mech="pilot.ActiveMech"
/>

<cc-solo-dialog
ref="actionMenu"
no-confirm
title="Actions"
large
no-title-clip
>
<cc-solo-dialog ref="actionMenu" no-confirm title="Actions" large no-title-clip>
<action-menu :tab="menuTab" />
</cc-solo-dialog>
<burn-dialog ref="burnDialog" :mech="mech" @complete="endTurn($event)" />
</v-footer>
</template>

<script lang="ts">
import ActionMenuButton from "../../components/ActionMenuButton.vue";
import MoveMenuButton from "../../components/MoveMenuButton.vue";
import ActionMenu from "../../components/ActionMenu.vue";
import BurnDialog from "../../components/BurnDialog.vue";
import activePilot from "@/features/pilot_management/mixins/activePilot";
import vueMixins from "@/util/vueMixins";
import ActionMenuButton from '../../components/ActionMenuButton.vue'
import MoveMenuButton from '../../components/MoveMenuButton.vue'
import ActionMenu from '../../components/ActionMenu.vue'
import BurnDialog from '../../components/BurnDialog.vue'
import activePilot from '@/features/pilot_management/mixins/activePilot'
import vueMixins from '@/util/vueMixins'
export default vueMixins(activePilot).extend({
name: "combat-footer",
name: 'combat-footer',
components: { MoveMenuButton, ActionMenuButton, ActionMenu, BurnDialog },
data: () => ({
menuTab: 1,
Expand All @@ -319,63 +268,59 @@ export default vueMixins(activePilot).extend({
}),
computed: {
state() {
return this.pilot.State;
return this.pilot.State
},
mech() {
return this.pilot.ActiveMech;
return this.pilot.ActiveMech
},
nextRoundConfirm() {
let str = "";
if (this.state.Actions > 0)
str += `<div class='px-2'>Actions available</div>`;
if (this.state.Move > 0)
str += `<div class='px-2'>Movement available</div>`;
let str = ''
if (this.state.Actions > 0) str += `<div class='px-2'>Actions available</div>`
if (this.state.Move > 0) str += `<div class='px-2'>Movement available</div>`
if (str.length) {
str = `<div class='error--text'>ALERT::<div>${str}`;
str = `<div class='error--text'>ALERT::<div>${str}`
} else
str =
'<div>Confirm Round Complete</div> <div class="text--secondary">This cannot be undone.</div>';
return str;
'<div>Confirm Round Complete</div> <div class="text--secondary">This cannot be undone.</div>'
return str
},
endTurnConfirm() {
let str = "";
if (this.state.Actions > 0)
str += `<div class='px-2'>Actions available</div>`;
if (this.state.Move > 0)
str += `<div class='px-2'>Movement available</div>`;
let str = ''
if (this.state.Actions > 0) str += `<div class='px-2'>Actions available</div>`
if (this.state.Move > 0) str += `<div class='px-2'>Movement available</div>`
if (str.length) {
str = `<div class='error--text'>ALERT::<div>${str}`;
} else str = "";
return str;
str = `<div class='error--text'>ALERT::<div>${str}`
} else str = ''
return str
},
},
methods: {
stageEndTurn() {
if (this.mech.Burn) this.$refs.burnDialog.show();
else this.endTurn();
if (this.mech.Burn) this.$refs.burnDialog.show()
else this.endTurn()
},
stageNextRound() {
this.nextRound();
this.nextRound()
},
nextRound() {
this.state.NextRound();
this.roundConfirm = false;
this.state.NextRound()
this.roundConfirm = false
},
endTurn(burn) {
this.state.EndTurn(burn?.hp || 0, burn?.str || 0);
this.turnConfirm = false;
this.state.EndTurn(burn?.hp || 0, burn?.str || 0)
this.turnConfirm = false
},
undoEndTurn() {
this.state.UndoEndTurn();
this.state.UndoEndTurn()
},
openMenu(tab) {
this.menuTab = tab;
this.$refs.actionMenu.show();
this.menuTab = tab
this.$refs.actionMenu.show()
},
openDialog(action) {
const r = this.$refs[`dialog_${action.ID}`];
if (r && r[0]) r[0].show();
const r = this.$refs[`dialog_${action.ID}`]
if (r && r[0]) r[0].show()
},
},
});
})
</script>

0 comments on commit 583e918

Please sign in to comment.