Fix faint abilities not activating

This commit is contained in:
thepaperpilot 2023-02-28 20:35:03 -06:00
parent 24f2103717
commit f4f565729c
4 changed files with 23 additions and 4 deletions

View file

@ -83,6 +83,7 @@
<link rel="prefetch" href="yard_small.png" />
<link rel="prefetch" href="shop_Switch1.png" />
<link rel="prefetch" href="Fire.png" />
<link rel="prefetch" href="bandaid.png" />
<title>Profectus</title>
<meta name="description" content="A project made in Profectus"/>

BIN
public/bandaid.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 852 B

View file

@ -82,6 +82,9 @@
<img :src="level2_2" v-if="character.exp === 5" />
<img :src="level3" v-if="character.exp === 6" />
</span>
<span class="fainted" v-if="character != null && (character.presence <= 0 || character.relevancy <= 0)">
<img :src="bandaid" />
</span>
<Node v-if="id" :id="id" />
</div>
</Tooltip>
@ -93,16 +96,17 @@ import { jsx, JSXFunction } from "features/feature";
import Tooltip from "features/tooltips/Tooltip.vue";
import { Direction } from "util/common";
import { coerceComponent } from "util/vue";
import { Component, ref, shallowRef, watch, watchEffect } from "vue";
import heart from "../../public/heart.png";
import star from "../../public/presence_v2.png";
import { ref, shallowRef, watch, watchEffect } from "vue";
import bandaid from "../../public/bandaid.png";
import lock from "../../public/Freeze icon.png";
import heart from "../../public/heart.png";
import level1_0 from "../../public/Lvl 1_0.png";
import level1_1 from "../../public/Lvl 1_1.png";
import level2_0 from "../../public/Lvl 2_0.png";
import level2_1 from "../../public/Lvl 2_1.png";
import level2_2 from "../../public/Lvl 2_2.png";
import level3 from "../../public/Lvl 3.png";
import star from "../../public/presence_v2.png";
import { characters } from "./projEntry";
import { Character } from "./types";
@ -310,6 +314,17 @@ watchEffect(() => {
transform: translate(-50%, -50%);
}
.fainted img {
image-rendering: pixelated;
max-height: 10vmin;
filter: drop-shadow(2px 4px 6px black);
z-index: 1;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
@keyframes bouncingMoveIndicator {
0% {
transform: translateX(-50%) rotate(180deg) translateY(0%);

View file

@ -968,7 +968,10 @@ export const main = createLayer("main", function (this: BaseLayer) {
console.error("Invalid action", action);
break;
}
if (action.target.presence <= 0 || action.target.relevancy <= 0) {
if (
characters[action.target.type].abilityType !== "Faint" &&
(action.target.presence <= 0 || action.target.relevancy <= 0)
) {
break;
}
characters[action.target.type].performAbility(action.target);