mirror of
https://github.com/thepaperpilot/Planar-Pioneers.git
synced 2024-11-21 16:13:54 +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 => {
|
||||
if (
|
||||
earnedTreasures.value.length < length &&
|
||||
main.activePortals.value.some(
|
||||
n => (n.state as unknown as PortalState).id === id
|
||||
) &&
|
||||
|
@ -735,6 +736,7 @@ export function createPlane(
|
|||
}
|
||||
this.on("preUpdate", diff => {
|
||||
if (
|
||||
earnedTreasures.value.length < length &&
|
||||
main.activePortals.value.some(
|
||||
n => (n.state as unknown as PortalState).id === id
|
||||
) &&
|
||||
|
@ -1052,9 +1054,11 @@ export function createPlane(
|
|||
const totalDiff = Decimal.times(computedPlanarSpeedModifier.value, diff);
|
||||
|
||||
timeActive.value = Decimal.add(timeActive.value, totalDiff);
|
||||
resource.value = Decimal.times(computedResourceGain.value, totalDiff).add(
|
||||
resource.value
|
||||
);
|
||||
if (earnedTreasures.value.length < length) {
|
||||
resource.value = Decimal.times(computedResourceGain.value, totalDiff).add(
|
||||
resource.value
|
||||
);
|
||||
}
|
||||
|
||||
earnedTreasures.value.forEach(treasure => {
|
||||
treasure.update?.(totalDiff);
|
||||
|
|
Loading…
Reference in a new issue