mirror of
https://github.com/thepaperpilot/Planar-Pioneers.git
synced 2024-11-25 01:41:44 +00:00
Don't run some things on portals that have finished their treasures
This commit is contained in:
parent
2a12bbe7c0
commit
ae53b56e8b
1 changed files with 7 additions and 3 deletions
|
@ -584,6 +584,7 @@ export function createPlane(
|
||||||
}));
|
}));
|
||||||
this.on("preUpdate", diff => {
|
this.on("preUpdate", diff => {
|
||||||
if (
|
if (
|
||||||
|
earnedTreasures.value.length < length &&
|
||||||
main.activePortals.value.some(
|
main.activePortals.value.some(
|
||||||
n => (n.state as unknown as PortalState).id === id
|
n => (n.state as unknown as PortalState).id === id
|
||||||
) &&
|
) &&
|
||||||
|
@ -735,6 +736,7 @@ export function createPlane(
|
||||||
}
|
}
|
||||||
this.on("preUpdate", diff => {
|
this.on("preUpdate", diff => {
|
||||||
if (
|
if (
|
||||||
|
earnedTreasures.value.length < length &&
|
||||||
main.activePortals.value.some(
|
main.activePortals.value.some(
|
||||||
n => (n.state as unknown as PortalState).id === id
|
n => (n.state as unknown as PortalState).id === id
|
||||||
) &&
|
) &&
|
||||||
|
@ -1052,9 +1054,11 @@ export function createPlane(
|
||||||
const totalDiff = Decimal.times(computedPlanarSpeedModifier.value, diff);
|
const totalDiff = Decimal.times(computedPlanarSpeedModifier.value, diff);
|
||||||
|
|
||||||
timeActive.value = Decimal.add(timeActive.value, totalDiff);
|
timeActive.value = Decimal.add(timeActive.value, totalDiff);
|
||||||
|
if (earnedTreasures.value.length < length) {
|
||||||
resource.value = Decimal.times(computedResourceGain.value, totalDiff).add(
|
resource.value = Decimal.times(computedResourceGain.value, totalDiff).add(
|
||||||
resource.value
|
resource.value
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
earnedTreasures.value.forEach(treasure => {
|
earnedTreasures.value.forEach(treasure => {
|
||||||
treasure.update?.(totalDiff);
|
treasure.update?.(totalDiff);
|
||||||
|
|
Loading…
Reference in a new issue