mirror of
https://github.com/thepaperpilot/Super-Auto-Coots.git
synced 2025-02-18 02:12:39 +00:00
Implement freezing
This commit is contained in:
parent
0f537bbac5
commit
927571efa6
3 changed files with 25 additions and 1 deletions
|
@ -79,6 +79,7 @@
|
||||||
<img :src="level2_2" v-if="character.exp === 5" />
|
<img :src="level2_2" v-if="character.exp === 5" />
|
||||||
<img :src="level3" v-if="character.exp === 6" />
|
<img :src="level3" v-if="character.exp === 6" />
|
||||||
</span>
|
</span>
|
||||||
|
<div v-if="frozen" class="frozen" />
|
||||||
<Node v-if="id" :id="id" />
|
<Node v-if="id" :id="id" />
|
||||||
</div>
|
</div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
@ -109,6 +110,7 @@ const props = defineProps<{
|
||||||
isDragging?: boolean;
|
isDragging?: boolean;
|
||||||
selected?: Character | null;
|
selected?: Character | null;
|
||||||
shake?: boolean;
|
shake?: boolean;
|
||||||
|
frozen?: boolean;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const dragging = ref(false);
|
const dragging = ref(false);
|
||||||
|
@ -278,6 +280,17 @@ watchEffect(() => {
|
||||||
color: var(--feature-foreground);
|
color: var(--feature-foreground);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.frozen {
|
||||||
|
position: absolute;
|
||||||
|
background: skyblue;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
opacity: 0.5;
|
||||||
|
transform: rotate(45deg);
|
||||||
|
}
|
||||||
|
|
||||||
@keyframes bouncingMoveIndicator {
|
@keyframes bouncingMoveIndicator {
|
||||||
0% {
|
0% {
|
||||||
transform: translateX(-50%) rotate(180deg) translateY(0%);
|
transform: translateX(-50%) rotate(180deg) translateY(0%);
|
||||||
|
|
|
@ -23,7 +23,6 @@ import { createReset } from "features/reset";
|
||||||
import settings from "game/settings";
|
import settings from "game/settings";
|
||||||
import type { AbilityTypes, CharacterInfo, Character, BattleOutcome } from "./types";
|
import type { AbilityTypes, CharacterInfo, Character, BattleOutcome } from "./types";
|
||||||
import { formatWhole } from "util/bignum";
|
import { formatWhole } from "util/bignum";
|
||||||
import particles from "./particle.json";
|
|
||||||
import { createParticles } from "features/particles/particles";
|
import { createParticles } from "features/particles/particles";
|
||||||
import { render } from "util/vue";
|
import { render } from "util/vue";
|
||||||
|
|
||||||
|
@ -132,6 +131,7 @@ export const main = createLayer("main", function (this: BaseLayer) {
|
||||||
target?: Character;
|
target?: Character;
|
||||||
}[]
|
}[]
|
||||||
>([]);
|
>([]);
|
||||||
|
const frozen = ref<number[]>([]);
|
||||||
|
|
||||||
const battle = ref<{
|
const battle = ref<{
|
||||||
team: Character[];
|
team: Character[];
|
||||||
|
@ -183,6 +183,7 @@ export const main = createLayer("main", function (this: BaseLayer) {
|
||||||
showingOutcome.value = false;
|
showingOutcome.value = false;
|
||||||
playClicked.value = false;
|
playClicked.value = false;
|
||||||
queue.value = [];
|
queue.value = [];
|
||||||
|
frozen.value = [];
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -507,6 +508,7 @@ export const main = createLayer("main", function (this: BaseLayer) {
|
||||||
{shop.value.map((item, i) => (
|
{shop.value.map((item, i) => (
|
||||||
<CharacterSlot
|
<CharacterSlot
|
||||||
id={`shop-char-${i}`}
|
id={`shop-char-${i}`}
|
||||||
|
frozen={frozen.value.includes(i)}
|
||||||
character={item == null ? undefined : item}
|
character={item == null ? undefined : item}
|
||||||
isSelected={selectedShopItem.value === i}
|
isSelected={selectedShopItem.value === i}
|
||||||
isShop={true}
|
isShop={true}
|
||||||
|
@ -587,6 +589,7 @@ export const main = createLayer("main", function (this: BaseLayer) {
|
||||||
outcome,
|
outcome,
|
||||||
reset,
|
reset,
|
||||||
battle,
|
battle,
|
||||||
|
frozen,
|
||||||
playClicked,
|
playClicked,
|
||||||
prepareMove,
|
prepareMove,
|
||||||
particles
|
particles
|
||||||
|
|
|
@ -143,6 +143,7 @@ function setupSocket(socket: Socket<ServerToClientEvents, ClientToServerEvents>)
|
||||||
presence: characters[item].initialPresence,
|
presence: characters[item].initialPresence,
|
||||||
exp: 1
|
exp: 1
|
||||||
}));
|
}));
|
||||||
|
main.frozen.value = main.frozen.value.map((_, i) => i);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
shop.forEach((_, i) => poof(`shop-char-${i}`));
|
shop.forEach((_, i) => poof(`shop-char-${i}`));
|
||||||
}, 0);
|
}, 0);
|
||||||
|
@ -198,6 +199,13 @@ function setupSocket(socket: Socket<ServerToClientEvents, ClientToServerEvents>)
|
||||||
main.team.value[index] = null;
|
main.team.value[index] = null;
|
||||||
poof(`team-char-${index}`);
|
poof(`team-char-${index}`);
|
||||||
});
|
});
|
||||||
|
socket.on("freeze", index => {
|
||||||
|
if (main.frozen.value.includes(index)) {
|
||||||
|
main.frozen.value = main.frozen.value.filter(m => m !== index);
|
||||||
|
} else {
|
||||||
|
main.frozen.value.push(index);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module "game/settings" {
|
declare module "game/settings" {
|
||||||
|
|
Loading…
Add table
Reference in a new issue