Skip to content

Commit e251d98

Browse files
committed
actions
1 parent 15e9f2a commit e251d98

19 files changed

Lines changed: 665 additions & 56 deletions

src/components/round/ActionBox.vue

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
<div class="actionBox col" @click="showInstructions"
33
:class="{'instruction': hasInstruction, 'managedByApp': managedByApp}">
44
<slot name="action"></slot>
5+
<div v-if="vp" class="vpGain">
6+
<span v-html="t('roundTurnBot.gainVP', {vp: vp})"></span><template v-if="xp">,
7+
<span v-html="t('roundTurnBot.gainXP')"/>
8+
<FlowerIcon v-for="flower in xp" :key="flower" :flower="flower"/></template>
9+
</div>
510
<div v-if="currentCard?.remove" class="remove"><AppIcon name="x" class="icon"/></div>
611
</div>
712

@@ -21,12 +26,15 @@ import { useI18n } from 'vue-i18n'
2126
import { nanoid } from 'nanoid'
2227
import Card from '@/services/Card'
2328
import AppIcon from '../structure/AppIcon.vue'
29+
import Flower from '@/services/enum/Flower'
30+
import FlowerIcon from '../structure/FlowerIcon.vue'
2431
2532
export default defineComponent({
2633
name: 'ActionBox',
2734
components: {
2835
ModalDialog,
29-
AppIcon
36+
AppIcon,
37+
FlowerIcon
3038
},
3139
setup() {
3240
const { t } = useI18n()
@@ -38,6 +46,14 @@ export default defineComponent({
3846
type: String,
3947
required: true
4048
},
49+
vp: {
50+
type: Number,
51+
required: false
52+
},
53+
xp: {
54+
type: Array as PropType<Flower[]>,
55+
required: false
56+
},
4157
managedByApp: {
4258
type: Boolean,
4359
required: false
@@ -96,5 +112,11 @@ export default defineComponent({
96112
.icon {
97113
width: 0.75rem;
98114
}
115+
116+
}
117+
.vpGain {
118+
text-align: center;
119+
margin-top: 1rem;
120+
font-size: 1.5rem;
99121
}
100122
</style>

src/components/round/botAction/ActionDelivery.vue

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
<template>
2-
<ActionBox :instruction-title="t('rules.action.delivery.title')" :currentCard="currentCard">
2+
<ActionBox :instruction-title="t('rules.action.delivery.title')" :currentCard="currentCard" :vp="action.vp" :xp="action.xp">
33
<template #action>
44
<div class="action">
5-
<AppIcon type="action" name="delivery" class="icon"/>
5+
<AppIcon type="action" name="delivery" class="icon"/>:
6+
<div class="windowSelection">{{action.floor}}{{action.windowSelection?.toUpperCase()}}</div>
67
</div>
78
</template>
89
<template #instruction>
9-
<p v-html="t('rules.action.delivery.instruction')"/>
10+
<p>
11+
<span v-html="t('rules.action.delivery.selectWindow')"></span><br/>
12+
<span class="fw-bold" v-html="t('rules.action.delivery.selectedWindow', {floor:action.floor,selection:t(`windowSelection.${action.windowSelection}`)})"></span><br/>
13+
<FlowerIcon v-for="flower in action.flowers ?? []" :key="flower" :flower="flower"/>
14+
</p>
15+
<p v-html="t('rules.action.delivery.gainVPandXP', {vp:action.vp})"/>
16+
<p v-html="t('rules.action.delivery.placeMarker')"/>
1017
</template>
1118
</ActionBox>
1219
</template>
@@ -63,4 +70,8 @@ export default defineComponent({
6370
.icon {
6471
height: 5rem;
6572
}
73+
.windowSelection {
74+
font-weight: bold;
75+
font-size: 1.5rem;
76+
}
6677
</style>

src/components/round/botAction/ActionPaid.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<template>
2-
<ActionBox :instruction-title="t('rules.action.paid.title')" :currentCard="currentCard" :managedByApp="true">
2+
<ActionBox :instruction-title="t('rules.action.paid.title')" :currentCard="currentCard" :managedByApp="true" :vp="action.vp">
33
<template #action>
44
<div class="action">
5-
<AppIcon type="action" name="paid" class="icon"/>
5+
<AppIcon type="action" name="paid" class="icon"/>:
6+
<FlowerIcon v-if="action.flower" :flower="action.flower"/>
67
</div>
78
</template>
89
<template #instruction>
@@ -19,13 +20,15 @@ import Card from '@/services/Card'
1920
import { BotAction } from '@/services/BotActions'
2021
import ActionBox from '../ActionBox.vue'
2122
import AppIcon from '@/components/structure/AppIcon.vue'
23+
import FlowerIcon from '@/components/structure/FlowerIcon.vue'
2224
2325
export default defineComponent({
2426
name: 'ActionPaid',
2527
inheritAttrs: false,
2628
components: {
2729
ActionBox,
28-
AppIcon
30+
AppIcon,
31+
FlowerIcon
2932
},
3033
emits: ['ready'],
3134
setup() {

src/components/round/botAction/ActionPrice.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
<ActionBox :instruction-title="t('rules.action.price.title')" :currentCard="currentCard" :managedByApp="true">
33
<template #action>
44
<div class="action">
5-
<AppIcon type="action" :name="iconName" class="icon"/>
5+
<AppIcon type="action" :name="iconName" class="icon"/>:
6+
<div>
7+
<FlowerIcon v-for="flower in flowers" :key="flower" :flower="flower"/>
8+
</div>
69
</div>
7-
<div class="mt-2 mb-1" v-html="t('rules.action.price.priceIncreased', flowers.length)"></div>
8-
<FlowerIcon v-for="flower in flowers" :key="flower" :flower="flower"/>
910
</template>
1011
<template #instruction>
1112
<p v-html="t('rules.action.price.definedWindowInstruction')"/>

src/components/round/botAction/ActionSold.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
<ActionBox :instruction-title="t('rules.action.sold.title')" :currentCard="currentCard" :managedByApp="true">
33
<template #action>
44
<div class="action">
5-
<AppIcon type="action" name="sold" class="icon"/>
5+
<AppIcon type="action" name="sold" class="icon"/>:
6+
<div>
7+
<FlowerIcon v-for="flower in action.flowers ?? []" :key="flower" :flower="flower"/>
8+
</div>
69
</div>
710
</template>
811
<template #instruction>
@@ -19,13 +22,15 @@ import Card from '@/services/Card'
1922
import { BotAction } from '@/services/BotActions'
2023
import ActionBox from '../ActionBox.vue'
2124
import AppIcon from '@/components/structure/AppIcon.vue'
25+
import FlowerIcon from '@/components/structure/FlowerIcon.vue'
2226
2327
export default defineComponent({
2428
name: 'ActionSold',
2529
inheritAttrs: false,
2630
components: {
2731
ActionBox,
28-
AppIcon
32+
AppIcon,
33+
FlowerIcon
2934
},
3035
emits: ['ready'],
3136
setup() {

src/components/round/botAction/ActionVp5.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<template>
2-
<ActionBox :instruction-title="t('rules.action.vp5.title')" :currentCard="currentCard">
2+
<ActionBox :instruction-title="t('rules.action.vp5.title')" :currentCard="currentCard" :vp="action.vp">
33
<template #action>
44
<div class="action">
5-
<AppIcon type="action" name="vp5" class="icon"/>
5+
<AppIcon type="action" name="vp-5" class="icon"/>
66
</div>
77
</template>
88
<template #instruction>

src/components/round/botAction/ActionWindowBox.vue

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
<template>
2-
<ActionBox :instruction-title="t('rules.action.windowBox.title')" :currentCard="currentCard">
2+
<ActionBox :instruction-title="t('rules.action.windowBox.title')" :currentCard="currentCard" :vp="action.vp" :xp="action.xp">
33
<template #action>
44
<div class="action">
5-
<AppIcon type="action" name="window-box" class="icon"/>
5+
<AppIcon type="action" name="window-box" class="icon"/>:
6+
<div class="windowSelection">{{action.floor}}{{action.windowSelection?.toUpperCase()}}</div>
7+
<div>
8+
<FlowerIcon v-for="flower in action.flowers ?? []" :key="flower" :flower="flower"/>
9+
</div>
610
</div>
711
</template>
812
<template #instruction>
9-
<p v-html="t('rules.action.windowBox.instruction')"/>
13+
<p>
14+
<span v-html="t('rules.action.windowBox.defineWindow')"></span><br/>
15+
<span class="fw-bold" v-html="t('rules.action.delivery.selectedWindow', {floor:action.floor,selection:t(`windowSelection.${action.windowSelection}`)})"></span><br/>
16+
<FlowerIcon v-for="flower in action.flowers ?? []" :key="flower" :flower="flower"/>
17+
</p>
18+
<p v-html="t('rules.action.delivery.gainVPandXP', {vp:action.vp})"/>
19+
<p v-html="t('rules.action.delivery.placeMarker')"/>
1020
</template>
1121
</ActionBox>
1222
</template>
@@ -19,13 +29,15 @@ import Card from '@/services/Card'
1929
import { BotAction } from '@/services/BotActions'
2030
import ActionBox from '../ActionBox.vue'
2131
import AppIcon from '@/components/structure/AppIcon.vue'
32+
import FlowerIcon from '@/components/structure/FlowerIcon.vue'
2233
2334
export default defineComponent({
2435
name: 'ActionWindowBox',
2536
inheritAttrs: false,
2637
components: {
2738
ActionBox,
28-
AppIcon
39+
AppIcon,
40+
FlowerIcon
2941
},
3042
emits: ['ready'],
3143
setup() {
@@ -63,4 +75,8 @@ export default defineComponent({
6375
.icon {
6476
height: 5rem;
6577
}
78+
.windowSelection {
79+
font-weight: bold;
80+
font-size: 1.5rem;
81+
}
6682
</style>

src/locales/en.json

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
"milestones": "When Lady Pei claims a milestone (as displayed by the application, this can even happen during your own turns), put one of her marker to the highest available point value. She doesn't need to fulfill the conditions.",
4949
"noBonuses": "In general, Lady Pei does not receive the bonuses displayed on the window tiles when delivering, and does not interact with neighbors.",
5050
"actionBoxTypes": "When Lady Pei executes her actions, some are displayed in a grey box, and some in a blue box. The actions for grey boxes are executed automatically by the application and shown only for information. For the blue boxes, you have to execute the action for her and follow the instructions.",
51-
"autoActions": "Some actions start as blue boxes, but are automatically executed as grey actions later when the application learns the board state.",
5251
"clickForDetails": "You can click on each action box to see rules details."
5352
}
5453
},
@@ -84,7 +83,9 @@
8483
},
8584
"roundTurnBot": {
8685
"bonusActions": "Bonus Actions",
87-
"actionsNotReady": "Please complete the actions."
86+
"actionsNotReady": "Please complete the actions.",
87+
"gainVP": "<b>{vp} VP</B>",
88+
"gainXP": "XP: "
8889
},
8990
"botClaimMilestones": {
9091
"botClaim": "Lady Pei claims a milestone:",
@@ -108,17 +109,26 @@
108109
"spring": "Spring",
109110
"summer": "Summer"
110111
},
112+
"windowSelection": {
113+
"l": "left",
114+
"r": "right"
115+
},
111116
"rules": {
112117
"action": {
113118
"managedByApp": "This action is managed by the application.",
114119
"billboard": {
115120
"title": "Billboard"
116121
},
117122
"delivery": {
118-
"title": "Delivery"
123+
"title": "Delivery",
124+
"selectWindow": "Lady Pei delivers to a window with the most matching flowers (ignoring missing flowers, if required):",
125+
"selectedWindow": "Floor {floor}, Window: {selection}",
126+
"gainVPandXP": "Lady Pei earns <b>{vp} VP</b> and 1 XP for each color used in the Window Box.",
127+
"placeMarker": "Place a marker from Lady Pei in the window above the box."
119128
},
120129
"paid": {
121-
"title": "Paid"
130+
"title": "Paid",
131+
"instruction": "The price of the most expensive flower in Lady Pei’s garden this season is decreased by 1. Lady Pei gains VP equal to the new price."
122132
},
123133
"plant": {
124134
"title": "Plant",
@@ -127,21 +137,23 @@
127137
},
128138
"price": {
129139
"title": "Price",
130-
"priceIncreased": "Price increased for flower: | Price increased for flowers:",
131140
"definedWindowInstruction": "If the given window is defined, the price for <i>each flower</i> in that box is increased.",
132141
"undefinedWindowInstruction": {
133142
"cheapest": "If the window is not defined, the price of the <i>cheapest</i> flower is increased.",
134143
"most-expensive": "If the window is not defined, the price os the <i>most expensive</i> flower is increased."
135144
}
136145
},
137146
"sold": {
138-
"title": "Sold"
147+
"title": "Sold",
148+
"instruction": "For each flower family in Lady Pei’s Garden this season, the price is decreased by 1."
139149
},
140150
"vp5": {
141-
"title": "5 VP"
151+
"title": "5 VP",
152+
"instruction": "Lady Pei gains 5 VP."
142153
},
143154
"windowBox": {
144-
"title": "Window Box"
155+
"title": "Window Box",
156+
"defineWindow": "Lady Pei creates the most expensive legal Window Box that could be made from the flowers in her garden in the current season:"
145157
},
146158
"xp": {
147159
"title": "XP",

0 commit comments

Comments
 (0)