Use TFA's weathers in your mod
True Final Ascent brings 28 weathers of its own: storms, fogs, a blood moon, an earthquake, a flash flood
you can swim in, a tsunami, a volcanic eruption and more. With TfaWeather your mod starts and stops them in
any run, Apocalypse mode or not, picks how hard they play and sets single values.
- Start and stop any of the 28 weathers, for as long as you like.
- Pick the difficulty.
Tier1-5 plays a weather like TFA's Apocalypse levels Relaxed, Normal, Hard, Brutal or Nightmare. Your players don't need Apocalypse mode for that, and their Apocalypse setting stays untouched. - Set single values. Every weather has named values - the storm's push, the flood's water level and air, the blood
moon's pack size. You set them with
With(name, value). Each one overrides the tier for that one number. - Follow the weather on every player through
Current,ModWeatherand theChangedevent, in every mode. - The host decides. Make the same call on every player. Only the host's call does something; TFA brings the weather with its tier and values to everyone, late joiners included.
- Next to TFA's dice. In Apocalypse mode your weather runs alongside TFA's own. Where the two collide, yours takes over.
- One mod weather at a time. The API slot is shared by all mods: whoever starts a weather owns it; you can only
change or stop your own, and another mod gets
Busyuntil yours ends.
Setup
Reference TFA as for the biome API (TrueFinalAscent.dll, Private=false; see the
Biomes tab) and declare a soft dependency. Touch TfaWeather only when TFA is installed
and new enough: TFA 2.10.0 is the first version with it. On an older TFA the type is missing, and the first touch
throws.
<Reference Include="TrueFinalAscent">
<HintPath>...\BepInEx\plugins\CptPICHU-TrueFinalAscent\TrueFinalAscent.dll</HintPath>
<Private>false</Private>
</Reference>
using System;
using System.Runtime.CompilerServices;
using BepInEx;
using BepInEx.Bootstrap;
[BepInPlugin("you.crystalcaves", "Crystal Caves", "1.0.0")]
[BepInDependency("com.CptPICHU.peak.truefinalascent", BepInDependency.DependencyFlags.SoftDependency)]
public class CrystalCavesPlugin : BaseUnityPlugin
{
internal static bool TfaWeatherReady;
private void Awake()
{
// Touch TfaWeather only when TFA 2.10.0 or newer is installed: on an older TFA the type is missing, and the first
// touch throws. Without TFA your mod keeps working as before.
if (Chainloader.PluginInfos.TryGetValue("com.CptPICHU.peak.truefinalascent", out PluginInfo tfa)
&& tfa.Metadata.Version >= new Version(2, 10, 0))
{
TfaWeatherReady = TfaWeatherBridge.ApiLevel() >= 1;
}
}
}
internal static class TfaWeatherBridge
{
// In its own class and never inlined: otherwise .NET may resolve TFA's type when Awake compiles, before your check runs.
[MethodImpl(MethodImplOptions.NoInlining)]
internal static int ApiLevel() => TrueFinalAscent.Api.TfaWeather.ApiVersion;
}
Reading ApiVersion in Awake also tells TFA that a mod uses its weather. When that happens on the
host's machine, TFA loads the heavy weathers (blood moon creatures, tsunami, avalanche, volcano, the darkness hunt) at the
start of every run, so they are ready on all players before you start one.
Quick start
using TrueFinalAscent.Api;
// On every player. On the host it starts 60 s of rain; on guests it returns NotHost, and the host's rain reaches them.
TfaWeather.Start("crystalcaves", "rain", new TfaWeatherParams { Seconds = 60f });
// The same rain on Hard, but nobody slips: the tier sets everything, the value overrides one number.
TfaWeather.Start("crystalcaves", "rain", new TfaWeatherParams { Seconds = 60f, Tier = 3 }.With("slip", 0f));
// Later, also on every player: stops the weather "crystalcaves" started.
TfaWeather.Stop("crystalcaves");
The first argument is your owner id: 2-24 lowercase letters or digits - the same rule as a biome id, so a biome mod uses its biome id. TFA uses it to know whose weather runs.
Start and Stop return what happened (see TfaWeatherResult).
Only Started, Updated and Stopped changed anything; every other result leaves the
weather as it was and writes one log line that says why (the same case at most once every 10 s).
Rules
Where it runs
| Run | Your weather |
|---|---|
| Normal run, Builder, custom run | Runs. TFA starts no weather of its own there, so the weather is yours. |
| Apocalypse mode | Runs next to TFA's dice: two weathers can run at once, one of the dice and one of yours. Where the two collide, yours takes over. See Next to TFA's dice. |
| Airport (lobby) | Runs too, just for fun: the hall is the stage. What needs the mountain does its best around the players (see Anywhere, any time). PEAK itself lets no status through in the airport - no injury, cold, heat or drowsiness - so weathers there throw, drop and scare, but don't hurt. A weather started there ends when the run loads. |
| Daily map | NotAllowed. The daily map is never changed. In a biome, start only when slot.OwnWeatherAllowed is true (see the Biomes tab); it is false there. |
| Title screen, loading, a lost run, the end screen after a win | NotAllowed. A weather that already runs follows the rules under Multiplayer. |
Anywhere, any time
Your calls ignore the rules TFA's dice follow. There is no check of place, biome, time of day, mode or run setting: any of
the 28 weathers runs in any stage (mod biomes and the Builder included), on PEAK's own maps, in cactus-ball mode and
with the Scoutmaster switched off for the run. The result codes WrongTime and Unavailable are
never returned any more.
- Time of day. A night weather (
blood,moon) started by day moves the clock to midnight while it runs, a day weather (sun,petrify) started at night moves it to noon. The weather holds the clock and gives it back when it ends. The blizzard (snow) never moves the clock. - Scoutmaster.
watchanddark: the host brings a Scoutmaster even if the run has none, and the watch no longer sleeps in the Kiln, Gloom, Citadel and Nadir. - No mountain to aim at. Without a Kiln the volcano erupts ahead of the group; the avalanche, the flash flood and the tsunami aim at the players when there is no campfire. What each weather does without the mountain - and in the airport - is listed below.
| Weather | Without the mountain, in the airport |
|---|---|
storm | Works everywhere. In the airport without flying wind streaks (haze, sky, push and sound only). |
rain | Works everywhere. The wet-ground sheen needs PEAK's rain rig on the map (not in the airport). |
snow | Any biome, any time of day; never moves the clock. In the airport shelter is decided by sky rays. |
thunder | Works everywhere. In the airport strikes land on any solid ground, and the roof and rock checks only see Terrain/Map, so bolts may hit players indoors. The lightning-rod badge counts only in runs. |
sun | Moves the clock to noon. In the airport it only shows: PEAK blocks heat there. |
petrify | Moves the clock to noon. In the airport it only shows: PEAK blocks the stone there. |
moon | Moves the clock to midnight. In the airport there is no roof protection. |
blood | Moves the clock to midnight. The creatures come from the map's templates; in the airport only Shroom Zombies come (if they can be loaded), the red sky always runs. |
sleepfog | Works everywhere. In the airport there is no Gloom lighting, only the tint and the fog layer; Early Worms land on visible floor near the players. |
icefog | Where PEAK's fog sphere is missing (airport, runs with fog off) the bubble works without its fog; the particle wall marks the edge. |
spores | Zombies rise wherever the cloud ends (airport included), but not if a scene change ended it. |
poison | The blast shrooms need the mountain's templates; in the airport they only grow if a poison fog ran in a run earlier this session. |
wisps | Count, gifts and lights work everywhere; in the airport the wisps spawn near the players, in their line of sight. |
shroomrain | Works everywhere. In the airport: berry rain, final burst and size phase, but no bounce mushrooms. |
cactusrain | Works in cactus-ball mode (no extra ball phase afterwards). In the airport: balls only, no cacti and no scorpion. |
foodfrenzy | Works everywhere. In the airport: hunger and food rain, no garden. |
floorlava | Works everywhere. In the airport the hall floor, the tarmac and the airstrip glow; furniture is safe ground. |
dark | Works anywhere; the host brings a Scoutmaster even if the run has none. In the airport the hunt ends with the throw or the lamp, and the music is muted. |
watch | Works anywhere and ignores the place; the host brings a Scoutmaster even if the run has none. In the airport he leaps to floor spots near the players; the Nightmare sky needs a Nadir. |
antigrav | Works anywhere; indoors (airport hall) players rise to the roof. On Nightmare touching a ceiling hurts, but not in the airport, where PEAK blocks all status. |
quake | Works anywhere, airport included; airborne players (3 m and more above the ground) are spared. |
flood | Without Level and without a campfire to aim at (airport), the host fixes the level at the start: 3 units above the lowest living player. |
tsunami | The wave crosses along the world X axis past the group. Without a campfire the water behind it stands 2 units above the lowest player. |
avalanche | Starts behind the next campfire; without one it starts ahead of the group (airport: along the hall). Snow or dust follows the biome, or snow. |
volcano | Without a Kiln it erupts about 250 m ahead of the group; rocks, bang, ash and tiers work as usual. In the airport rocks only knock players down. |
shockfrost | Works everywhere, in normal runs and the airport too. Lava and water turn to ice where the stage has them; the ice look, slipping, cold, frozen items and traps work anywhere. The thaw takes 3 s after Stop, and lava and water stay solid until then. |
What wins
For every number a weather uses, TFA looks in this order:
Harm = false- the weather hurts nobody, whatever else you set.- Your value, if you set one with
With(name, value). - Your
Tier. - No
Tierset: in Apocalypse mode the level of the run (without the ghosts' vote), everywhere else Normal.
Tier and values only touch your weather. A dice weather next to yours keeps the run's level; the players' Apocalypse level and TFA's statistics stay as they are.
Live or start. Call Start again with the same owner and weather to change it while it runs. Values
marked live in the catalogue apply at once (Updated); the host has them
immediately, guests within a second. Values marked start and Seconds and Warn only apply
to a fresh start; if only those changed, you get Unchanged and a log line - stop and start again.
Tier, Sound, Harm and Level are live; a few things a weather decides
once at its start (how many wisps appear, the flashlight battery) keep their start value. A call sets your tier,
Sound, Harm and live values as a whole: one you leave out falls back to its default.
Aftermath counts. What a weather leaves behind when it ends (spore zombies, blast shrooms, the shroom finale, the rolling cactus balls, the food that keeps falling, the draining water) plays with your tier and values too, for up to 90 s after the end (the flash flood: as long as it needs to drain, plus 10 s).
Wrong values don't break anything. Unknown names and values of the wrong type are ignored. Values outside the range are clamped; where the range reads "0 or 5-600", a value under 5 becomes 5 and 0 or less becomes 0. A tier outside 1-5 is clamped. Each case writes one log line.
Units. Heights and distances are world units (PEAK's altimeter shows about 1.6 m per unit). Times are seconds.
Status amounts are shares of a full bar: 0.025 = 2.5 points, in steps of 0.025. Factors multiply TFA's own
value.
Next to TFA's dice (Apocalypse mode)
In Apocalypse mode TFA's dice roll a weather every few minutes. Start is allowed there: your weather runs next
to them, so two weathers can run at once, one of the dice and one of yours. Outside Apocalypse mode only yours runs.
Two weathers that share a part of the game can't run together, so the following rules decide who gives way.
- Yours takes over. Your
Startcollides with a dice weather that runs or is announced when it is the same weather or one from the same group (table below). Then the dice weather ends at once, an announcement is cancelled, your weather starts and you getStarted. AStartthat fails (NotAllowed,Busy, ...) never touches the dice weather. - The dice keep rolling. They roll everything else, but never your weather or anything in its group while it runs and for 90 s after it ends - its aftermath is yours. In the host's F9 menu your weather shows as "Mod: yourid", switched on and locked; the colliding rows are locked too.
- Perma weather (the host's setting) pauses while a colliding weather of yours runs. It comes back when yours and its aftermath are over. Asking for the perma weather itself works the same way: yours takes over and the perma weather resumes afterwards.
- No collision, both run. Your earthquake next to the dice's rain, each by its own tier: yours by
Tier(left out: the run's level), the dice's by the run's level and the ghosts' vote. Your tier and values never reach a dice weather. Busy. The API holds one weather at a time. If another mod's weather runs or is announced, yourStartanswersBusy. It does too forshroomrainandcactusrainwhile the dice run one of them, or while a Mini/Mega phase or a cactus-ball phase is still on, whoever started it: they end in such a phase and can't be taken over. Ask again a little later; calls are cheap and merged.
// Apocalypse mode, and the dice are rolling rain right now. Rain and sandstorm both belong to the Wind group, so yours
// takes over: the rain ends at once, the sandstorm starts, and for as long as it runs (and 90 s after) the dice roll
// no weather of the Wind group.
TfaWeatherResult r = TfaWeather.Start("crystalcaves", "sand", new TfaWeatherParams { Seconds = 60f });
// r == TfaWeatherResult.Started
// Another mod's weather holds the slot? Then you get Busy - ask again in a few seconds.
if (TfaWeather.Start("crystalcaves", "quake", new TfaWeatherParams { Seconds = 24f }) == TfaWeatherResult.Busy)
{
// try again later
}
Who collides with whom
Weathers collide when they are the same or share a group. A weather can sit in several groups.
| Group | Weathers | Why they don't run together |
|---|---|---|
| Wind | storm, rain, snow, sand, thunder, cactusrain, volcano, avalanche, shockfrost | One wind system, one weather-fog block and shared sound banks. Rain and thunderstorm share the rain. |
| Water | flood, tsunami, antigrav, shockfrost | One body of water. Antigravity and the flood hook into the same gravity, stamina and fall rules. |
| Clouds | spores, poison | One cloud above the head and one fog setting to put back. |
| Sun | sun, petrify, dark, shockfrost | Sunlight and the clock. The darkness dims the sun the other two need. |
| Moon | blood, moon, dark | Moonlight and the night clock. The darkness dims the moon the other two need. |
| Mixer | dark, antigrav, icefog, shockfrost | All three turn music and sound volume down and would put back the wrong value. |
| Scoutmaster | dark, watch | There is one Scoutmaster. |
| Fog band | sleepfog, icefog, dark | The voices in the fog and the fog's light profile. |
| Frost | floorlava, shockfrost | Both rewrite the ground: glowing floor and ice, lava and hot rock. |
| Size | shroomrain, cactusrain | The Mini/Mega phase and the cactus-ball phase exclude each other - also in the aftermath, whoever started them. |
| Free | quake, foodfrenzy, wisps, hayfever | They run next to anything. |
A few pairs overlap only in looks - several sky tints stacking, the low-pass filters of the flood and the freezing fog, frost against frost. They are allowed.
Under water you are immune to every other weather
Whoever is under TFA water - a flash flood or a tsunami, whoever started it - is untouched by every other weather. That
includes the good: no healing from the Blue Moon, no wisp gift. Nothing reaches the character: no status, no push, no fall,
no blindness, no change of speed, no lost item. The look and the sound stay: the storm still roars above the lake. The
flash flood and the tsunami themselves work on swimmers as always. TfaWeather.IsUnderWater(point) asks exactly
this.
Statistics
Weather you start never counts in TFA's weather statistics: not its starts, its run time, the statuses, deeds, faints or
deaths, in the weather report, in uploads or on the website. What your weather does is never booked on a dice weather
either; where TFA can't tell whose weather did it, it books nothing. While a weather of yours runs or lingers and can hurt
(Harm left on), faints and deaths aren't booked at all. TFA's weather badges are not locked for your weather: deed badges keep counting in
Apocalypse mode like TFA's own, outside it they never count.
Difficulty - Tier
Tier is an int? from 1 to 5. Leave it out and the weather plays on the level of the run in
Apocalypse mode (without the ghosts' vote), on Normal everywhere else.
| Tier | Name | In short |
|---|---|---|
| 1 | Relaxed | Mild. Some hazards are off: no air bar under water, no Scoutmaster hunt, no throw in a quake. |
| 2 | Normal | As built. |
| 3 | Hard | Faster ticks, harder hits, shorter warnings. |
| 4 | Brutal | Hard plus extra rules: no banners (the tsunami and the Watch keep theirs), worse aftermath. |
| 5 | Nightmare | Brutal plus its own rules: Nightmare is not meant to be fair. Weathers last 25 % longer. |
These are exactly the levels of TFA's Apocalypse mode, with the same numbers. What each tier changes:
| Weather | 1 Relaxed | 2 Normal | 3 Hard | 4 Brutal | 5 Nightmare |
|---|---|---|---|---|---|
storm | push x0.6, sight 140 | push x1, sight 80 | push x2, sight 50 | push x3, sight 32 | push x4, sight 32 |
rain | no slips | 2.5 %/s slip when sprinting in the open; wet rock pulls climbers down | 15 %/s slip, rock pulls harder | as Hard, a slip costs 10 % injury, 10 %/s to let go of wet rock | every sprint in the open slips, climbing up at 15 % pace |
snow | 2.5 cold every 1.5 s | every 0.75 s | 0.4 s | 0.25 s | 0.125 s |
sand | blind after 18 s into the wind | 12 s | 6 s | 6 s, blindness doesn't fade while it blows | 4 s, thorns bleed after, you stay down until they're gone |
sun | heat every 3 s | 2 s | 1.5 s | 1.5 s, double heat | 0.75 s, double heat |
sleepfog | drowsy every 3 s, an Early Worm every 20 s | every 3 s, worm every 40 s | 2 s | 1.5 s, 30 s longer | 1.5 s, 30 s longer, no worms |
spores | every 2.5 s up to 40 %, 1-2 zombies after | 2.5 s, 1-3 zombies | 2 s, 3 zombies | 1.25 s, 3 zombies that stay until the next campfire | as Brutal, zombies run 1.5x faster |
poison | every 2.5 s up to 40 %, 60 blast shrooms after | 2.5 s, 80 | 2 s, 120 | 1.25 s, 160 | 1 s, 160 |
shroomrain | bounce mushroom every 0.67-1.67 s | 1-2.5 s | 2-5 s, final pops add spores (up to 25 %) | 2-5 s, pops add more spores (up to 50 %) | no bounce mushrooms, pops add spores and throw you |
cactusrain | balls x0.6, more cacti | balls x1 | balls x1.3, fewer cacti | as Hard, 5 % of the balls are dynamite | balls x2.6, 5 % dynamite, cacti 1.5x denser |
foodfrenzy | hunger 0.025/s, a bite 0.1, 1.3x food | hunger 0.025/s, a bite 0.075 | hunger 0.05/s | as Hard, poisonous food poisons | as Brutal, dynamite instead of Cure-All in the food |
floorlava | heat x0.5 | x1 | x1.5 | x2, lying food chars | x3, fainting in the glow kills |
dark | endless flashlight, no hunt | battery 70 % of the weather, the Scoutmaster hunts after 20 s without light | battery 60 %, hunts after 10 s and comes back | as Hard, no glow around you, drowsy every 2 s without light | as Brutal, drowsy every 1 s, torches half as bright |
wisps | 10 wisps | 8 | 6 | 6, all look white, red and pink twice as likely | 6, only bad gifts, wisps follow players |
antigrav | 10 s half fall damage after | as built | stamina use x2 while lifted | stamina held at 0 while lifted | as Brutal, falls after it x1.5, touching the ceiling hurts |
quake | 7 s warning, you only fall | 7 s, thrown x1 | 4 s, x2 | 4 s, x3, crouching doesn't stop the fall, drops a second item | no warning, x4, drops everything |
blood | 2-4 creatures per player | 3-5, at most 20 | 5-7 | 7-9, at most 40, frogs too | 10, at most 50 |
moon | heals everything, hunger too | heals curse, injury, spores, poison, heat, cold, drowsiness, stone | all but the curse | only spores, poison, heat, cold; no bonus stamina; 10 % drowsy sips | heals nothing; 25 % chance of stone per sip |
petrify | stone every 3 s | 2 s | 1.33 s, no banner | 2 s, double stone, no banner | 1 s, double stone, no banner |
thunder | strikes half as often, 10 % injury | 3-17 s apart, 35 % aimed at players, 20 % injury, 5 % mega bolts | 10 % mega bolts | 40 % injury, mega bolts hurt instead of heal | 70 % aimed, every third bolt is mega |
icefog | bubble 15.6 units, cold every 3 s outside | bubble 9.4 units, 3 s | 2 s | 1 s, voices vanish deep in the fog | 0.5 s, darker |
watch | alone at 40 apart, hunted after 8 s | 30 apart, 5 s | 25, 4 s, thrown players safe for 45 s | 20, 3 s, safe 20 s, campfires don't shelter, no gift | as Brutal, he hunts at once whenever nobody looks at him, no salute |
flood | no air bar | 75 s of air | 60 s, swimming costs x1.25 | 45 s, x1.5 | 45 s, x1.5, out of air = fully drowsy at once |
tsunami | swept 3 s, no injury | 3.5 s, 20 % | 4 s, 30 % | 5 s, 40 %, banner stays | 10 s, 40 %, wave twice as fast, no banner |
avalanche | no injury | 15 % injury, buried: 30 % cold | thrown x1.5, cold 40 % | as Hard, dust lasts twice as long, cold 60 % | snow freezes you solid, rubble kills |
volcano | 5 % injury per rock | 15 % injury, 10 % heat | rocks x1.25, warning fields 1 s later, ash heat x1.5 | rocks x1.5, 25 % heat, ash x2 | rocks x3, no warning fields, ash x3 |
shockfrost | climbing rock: 0.025 cold every 2 s, sprint slip 10 %/s, sprint fall 0.05 cold, wall slip 10 %/s | every 1 s, 10 %/s, 0.1, 10 %/s | 1 s, 30 %/s, 0.15, 15 %/s | 0.5 s, 50 %/s, 0.2, 20 %/s | 0.05 cold every 0.5 s, every sprint slips, 0.3, 30 %/s, items shatter on touch |
hayfever | sneeze 5 m high | 9 m | 13 m, tears you off walls | 17 m, flings the held item, knocks you over unless it throws you upward | 17 m, flings the held item, always knocks you over, never upward |
For every weather: Nightmare lasts 25 % longer. From Brutal there are no banners (the tsunami keeps its banner on
Brutal, The Floor Is Lava always warns, the Scoutmaster's Watch always shows its own banner); the Petrifying Sun has none
from Hard. Warn = true brings a banner back where the weather has one.
Values - With(name, value)
new TfaWeatherParams { Tier = 2 }.With("push", 1.5f).With("direction", "right")
Numbers can be float or int, switches bool, choices string. Names that
several weathers share mean the same everywhere: every = seconds per status tick, amount = status
per tick, injury, cold, direction. heat is the exception: a
factor for floorlava, an amount per rock for volcano. Names are matched without regard
to case.
Default shows TFA's value per tier: Relaxed / Normal / Hard / Brutal / Nightmare. One number = the same on every
tier. Live values change while the weather runs, start values on the next start, end values are read
when the weather ends (a change while it runs counts as Updated). Rows in italics are planned and not in API
level 1. Where a row says that 0 means none or never, it means that literally: no zombies, no worms, never blind.
| Weather | Name | What it sets | Unit, range | Default 1 / 2 / 3 / 4 / 5 | When |
|---|---|---|---|---|---|
storm | push | Sideways push, factor on PEAK's wind force | x, 0-6 | 0.6 / 1 / 2 / 3 / 4 | live |
sight | How far you see at full strength | units, 10-1000 | 140 / 80 / 50 / 32 / 32 | live | |
gloom | Daylight that gets through the storm | 0-1 | 0.8 / 0.62 / 0.48 / 0.38 / 0.38 | live | |
direction | storm, snow and sand: where the wind comes from, along the mountain | "left", "right" | the last direction (first: left) | live | |
rain | slip | Chance per second to slip when sprinting under open sky; 1 = every sprint slips | 0-1 | 0 / 0.025 / 0.15 / 0.15 / 1 | live |
slide | How hard wet rock pulls a climber down (PEAK's own: -0.5); also replaces Nightmare's slowdown uphill | -2 to 0 | -0.5 / -0.5 / -0.75 / -0.75 / -0.75 | live | |
letgo | Chance per second to let go of wet rock under open sky | 0-1 | 0 / 0 / 0 / 0.1 / 0.1 | live | |
density | How much rain you see (look only) | 0-1.6 | 1 | live | |
snow | every | Seconds per 2.5 cold at full strength (half as often while it builds up) | s, 0.1-30 | 1.5 / 0.75 / 0.4 / 0.25 / 0.125 | live |
sight | How far you see in the blizzard | factor | 1 | live | |
direction | Where the blizzard comes from, along the mountain; same as storm | "left", "right" | the last direction (first: left) | live | |
sand | blind | Seconds of looking into the wind until you're blind; 0 = never | s, 0-120 | 18 / 12 / 6 / 6 / 4 | live |
slow | How much slower you move when fully exposed | 0-0.9 | 0.5 | live | |
direction | Where the sandstorm comes from, along the mountain; same as storm | "left", "right" | the last direction (first: left) | live | |
sun | every | Seconds per heat sip | s, 0.25-30 | 3 / 2 / 1.5 / 1.5 / 0.75 | live |
amount | Heat per sip | 0-0.5 | 0.025 / 0.025 / 0.025 / 0.05 / 0.05 | live | |
sleepfog | every | Seconds per drowsiness sip | s, 0.25-30 | 3 / 3 / 2 / 1.5 / 1.5 | live |
amount | Drowsiness per sip | 0-0.5 | 0.025 | live | |
worms | Seconds between Early Worms per player; 0 = none | s, 0 or 5-600 | 20 / 40 / 40 / 40 / 0 | live | |
Level | Fog line at this world height | units | above the highest player | live | |
spores | every | Seconds per spore sip (crouching and looking down slow it) | s, 0.25-30 | 2.5 / 2.5 / 2 / 1.25 / 1.25 | live |
amount | Spores per sip | 0-0.5 | 0.025 | live | |
zombies | Mushroom zombies that rise when it ends; 0 = none | 0-6 | 1-2 / 1-3 / 3 / 3 / 3 | end | |
poison | every | Seconds per poison sip | s, 0.25-30 | 2.5 / 2.5 / 2 / 1.25 / 1 | live |
amount | Poison per sip | 0-0.5 | 0.025 | live | |
mushrooms | Blast shrooms sown when it ends; 0 = none | 0-300 | 60 / 80 / 120 / 160 / 160 | end | |
shroomrain | size | What the final burst does to everyone | "mini", "mega", "none" | 50:50 mini or mega | start |
sprout | Seconds between bounce mushrooms (TFA picks 1-2.5x this); 0 = none | s, 0 or 0.25-30 | 0.67 / 1 / 2 / 2 / 0 | live | |
cactusrain | balls | Cactus balls per second per group of players | 0-8 | 1.8 / 3 / 3.9 / 3.9 / 7.8 | live |
cacti | Seconds between new cacti (TFA picks 1-2.5x this); 0 = none | s, 0 or 0.2-30 | 0.34 / 0.5 / 1 / 1 / 0.67 | live | |
balltime | Seconds of rolling cactus balls after it ends; 0 = none | s, 0 or 10-300 | 60-90 | end | |
foodfrenzy | hunger | Hunger per second | 0-0.2 | 0.025 / 0.025 / 0.05 / 0.05 / 0.05 | live |
bite | Hunger one bite takes away | 0-1 | 0.1 / 0.075 / 0.075 / 0.075 / 0.075 | live | |
food | Food falling per second per player | 0-6 | 3.25 / 2.5 / 2.5 / 2.5 / 2.5 | live | |
floorlava | heat | Heat factor on and near hot ground | x, 0-5 | 0.5 / 1 / 1.5 / 2 / 3 | live |
hold | Seconds of full glow; the weather gets longer with it | s, 1-120 | 10 | start | |
dark | battery | Flashlight battery in seconds; 0 = endless. With Seconds = 0 TFA's own battery is 90 s (77 s from Hard) | s, 0 or 5-3600 | endless / 70 % of the weather / 60 % / 60 % / 60 % | start |
gaze | Seconds without light until the Scoutmaster hunts you; 0 = never. Above 0 it also hunts on Relaxed | s, 0 or 3-300 | 0 / 20 / 10 / 10 / 10 | live | |
wisps | count | Wisps, plus one per player beyond two. Read 7 s after the start; 0 ends the weather after about 10 s | 0-30 | 10 / 8 / 6 / 6 / 6 | start |
gifts | Odds of each gift | weights | by tier | start | |
antigrav | rise | How fast players, items and creatures rise | units/s, 0.2-5 | 1.2 | live |
quake | warn | Seconds of warning rumble before each quake | s, 0-20 | 7 / 7 / 4 / 4 / 0 | live |
shove | Throw strength; 0 = players only fall | x, 0-6 | 0 / 1 / 2 / 3 / 4 | live | |
calm | Seconds between quakes when Seconds is above 12 (TFA picks 1-2x this) | s, 5-300 | 20 | live | |
blood | pack | Creatures per standing player and wave | 0-10 | 2-4 / 3-5 / 5-7 / 7-9 / 10 | live |
cap | Most creatures at once | 0-50 | 20 / 20 / 20 / 40 / 50 | live | |
moon | every | Seconds per healing sip | s, 0.25-30 | 2 | live |
amount | Healing (or bonus stamina) per sip | 0-0.5 | 0.025 | live | |
petrify | every | Seconds per stone sip | s, 0.25-30 | 3 / 2 / 1.33 / 2 / 1 | live |
amount | Stone per sip | 0-0.5 | 0.05 / 0.05 / 0.05 / 0.1 / 0.1 | live | |
thunder | rain | 0 dry, 1 light, 2 normal, 3 heavy | 0-3 | TFA rolls one at the start | live |
spacing | Factor on the 3-17 s between strikes | x, 0.25-10 | 2 / 1 / 1 / 1 / 1 | live | |
aim | Chance a strike targets a player | 0-1 | 0.35 +0.05 per player beyond one, at most 0.7; Nightmare 0.7 +0.025 per player beyond two, at most 1 | live | |
injury | Injury from a bolt (not from the mega bolt) | 0-1 | 0.1 / 0.2 / 0.2 / 0.4 / 0.4 | live | |
mega | Chance of a mega bolt | 0-1 | 0.05 / 0.05 / 0.1 / 0.1 / every third | live | |
icefog | radius | Radius of the safe bubble around its carrier; 0 = no bubble | units, 0-60 | 15.6 / 9.4 / 9.4 / 9.4 / 9.4 | live |
every | Seconds per 2.5 cold outside the bubble | s, 0.25-30 | 3 / 3 / 2 / 1 / 0.5 | live | |
watch | apart | Distance to the nearest teammate that counts as alone | units, 5-200 | 40 / 30 / 25 / 20 / 20 | live |
grace | Seconds alone before he comes for you | s, 0-60 | 8 / 5 / 4 / 3 / 3 | live | |
gift | false: no salute and no gift at the end; true forces nothing | bool | as TFA decides | end | |
flood | Level | Water surface, world height (the typed property Level) | units, ±30000 | see flood below | live |
rise | Seconds to reach Level; 0 = there at once, also without the 4 s lead | s, 0-120 | 15 | live | |
drain | Seconds the water takes to drain after it ends | s, 0-120 | 20 | live | |
douse | Campfires and lanterns under water go out after 3 s | bool | true | start | |
air | Seconds of air under water; 0 = no air bar | s, 0 or 5-600 | 0 / 75 / 60 / 45 / 45 | live | |
area | Water only inside a box of your stage - a lake with a shore | box | everywhere | start | |
tsunami | direction | Side the first wave comes from (the wind vane stays as it is) | "left", "right" | the last direction | start |
carry | Seconds the wave carries you | s, 0-15 | 3 / 3.5 / 4 / 5 / 10 | live | |
injury | Injury when the wave hits | 0-1 | 0 / 0.2 / 0.3 / 0.4 / 0.4 | live | |
Level, speed | Water level after the wave, wave speed | units, units/s | 40 below the next camp, 32 | start | |
avalanche | snow | true: a snow slide that buries; false: dust and rubble | bool | TFA decides per slide, by place | start |
injury | Injury when it hits you | 0-1 | 0 / 0.15 / 0.15 / 0.15 / 0.15 | live | |
cold | Cold when the snow buries you | 0-1 | 0.3 / 0.3 / 0.4 / 0.6 / 0.6 | live | |
speed | How fast the slide runs | units/s | 9-13 | start | |
volcano | rocks | Factor on how many rocks fall | x, 0-5 | 1 / 1 / 1.25 / 1.5 / 3 | live |
injury | Injury from a rock | 0-1 | 0.05 / 0.15 / 0.15 / 0.15 / 0.15 | live | |
heat | Heat from a rock | 0-1 | 0.1 / 0.1 / 0.1 / 0.25 / 0.25 | live | |
ash | Ash fog in the second half | bool | true | start | |
hayfever | height | Apex of a straight-up sneeze in metres; the push scales with it, x1.5 in mid-air, with a small hop on flat ground. On Nightmare a sneeze never lifts you | m, 0-20 | 5 / 9 / 13 / 17 / 17 | live |
least | Shortest time between two sneezes | s, 1-60 | 4 / 4 / 4 / 4 / 4 | live | |
most | Longest time between two sneezes (each player rolls their own) | s, 1-120 | 20 / 20 / 20 / 20 / 20 | live | |
shockfrost | every | Seconds per cold bite while climbing rock | s, 0.1-10 | 2 / 1 / 1 / 0.5 / 0.5 | live |
cold | Cold per bite (steps of 0.025) | 0-1 | 0.025 / 0.025 / 0.025 / 0.025 / 0.05 | live | |
slip | Chance per second to slip when sprinting; 1 = every sprint slips | 0-1 | 0.1 / 0.1 / 0.3 / 0.5 / 1 | live | |
fall | Cold from a fall after a slip (steps of 0.025); breaking into water costs half | 0-1 | 0.05 / 0.1 / 0.15 / 0.2 / 0.3 | live | |
slide | Constant downward pull on iced rock, like rain; runs only when you set it (wall slips replace it by default) | -2 to 0 | off | live | |
wallslip | Chance per second of climbing iced rock to slip down the wall (one roll per second) | 0-1 | 0.1 / 0.1 / 0.15 / 0.2 / 0.3 | live | |
slipfor | Length of one wall slip | s, 0.05-2 | 0.25 | live | |
slipspeed | Peak speed of a wall slip; 3 = the speed of climbing down | 0-10 | 3 | live |
Every weather also takes Seconds, Warn and Tier, and Sound and
Harm where the weathers list them.
Example: a lake to swim in
TFA's flash flood is real water. Players swim with Space, dive and climb out, see and hear the world under water. With your own values it becomes a calm, silent lake that stays until you stop it.
The idea: your stage begins at the shore of a lake. The start campfire sits on a rock just above the water, and the way up starts with a swim across.
private static bool _lake;
private static float _level;
private static void OnPlayersHere(TfaBiomeSlot slot, bool here)
{
if (!CrystalCavesPlugin.TfaWeatherReady || !slot.OwnWeatherAllowed)
{
return;
}
_lake = here;
_level = slot.StartPoint.y - 2f; // world height of the surface: 2 units below the start campfire
if (here)
{
KeepLake();
}
else
{
TfaWeather.Stop("crystalcaves"); // the lake drains in 8 s (see "drain")
}
}
// Call it from OnPlayersHere and again about once a second from your Update while _lake is set. The same call answers
// Unchanged and writes nothing; if another mod's weather was in the way (Busy), the lake gets in as soon as it ends.
private static void KeepLake()
{
TfaWeather.Start("crystalcaves", "flood", new TfaWeatherParams
{
Level = _level,
Seconds = 0f, // until stopped
Sound = false, // no roar of rising water, no surge
Harm = false, // no air bar, no drowning
}
.With("rise", 0f) // already full when the players arrive
.With("drain", 8f)
.With("douse", false)); // the water may later rise over the start campfire without putting it out
}
What happens, on every player:
- The host writes the weather together with your values into the room. Guests take it over within about a second; a player who joins later gets it too.
- The water stands at
Levelright away. Everything below that height is under water. - Under water players swim, sink slowly and take no fall damage. Climbing goes at half speed, the view turns blue-green
and other sounds are muffled. Loose items drift and sink slowly. With
Harm = falsenobody runs out of air. - When the group lights the campfire at the end of your stage,
PlayersHere(slot, false)stops the lake and the water sinks away in 8 s.
Keep in mind:
- The water has no shore yet. It is a sea level: everything in the world below
Levelis under water - your stage, the stages below and the beach. Put your lake at the foot of your stage, where that is what you want.area(a lake bounded to a box of your stage) is planned. - If
Levellies above the start campfire, players arrive under water, and the campfire goes out after 3 s unless you add.With("douse", false)to the first call -douseis a start value, a later update can't change it. - Want diving to matter? Leave
Harmon and set the air:.With("air", 40f)gives 40 s under water on any tier. - In Apocalypse mode the dice keep rolling beside your lake. The Water group (flash flood, tsunami, antigravity) stays away while the lake stands; everything else runs, and swimmers are immune to it.
- Is the lake a route the group must swim? If another mod's weather holds the slot, your start answers
Busyuntil it ends - the repeated call above gets the lake in as soon as that is over.
More examples
Tier and values together. A short, nasty thunderstorm for the final push: Brutal, heavy rain, but no mega bolts, and a bolt costs 30 % instead of Brutal's 40 %:
TfaWeather.Start("crystalcaves", "thunder", new TfaWeatherParams { Seconds = 60f, Tier = 4 }
.With("rain", 3)
.With("mega", 0f)
.With("injury", 0.3f));
A gentle first blizzard. Relaxed, and the cold bites only every 3 s:
TfaWeather.Start("crystalcaves", "snow", new TfaWeatherParams { Seconds = 40f, Tier = 1 }.With("every", 3f));
Raise the water while it stands - same owner, same weather, new live values. The result is Updated:
_level = slot.StartPoint.y + 10f; // so the repeated KeepLake keeps the new height
TfaWeather.Start("crystalcaves", "flood", new TfaWeatherParams
{
Level = _level, Seconds = 0f, Sound = false, Harm = false,
}.With("rise", 20f).With("drain", 8f)); // up 12 units within 20 s; douse stays as the lake started it
douse is a start value, so the lake sets it in its first call. drain is repeated because
a live value you leave out in an update falls back to its default.
A blood moon that only brings a few creatures - at any time of day:
// Day or night, it doesn't matter: the clock moves to midnight while the blood moon runs and goes back afterwards.
TfaWeather.Start("crystalcaves", "blood", new TfaWeatherParams { Seconds = 90f }
.With("pack", 1).With("cap", 6));
React to TFA's weather. In every mode, Apocalypse included, on every player:
TfaWeather.Changed += change =>
{
// Dice and mod weather can run at once, so ask for the state instead of reading change.To.
CrystalGlow.Dimmed = TfaWeather.IsRunning("dark"); // your crystals dim while darkness runs, whoever started it
};
Your own torches go out under TFA water:
if (TfaWeather.IsUnderWater(torch.position)) torch.Snuff();
Reference
TfaWeather
int ApiVersionAPI level; 1 for this page. Read it at runtime. Reading it also tells TFA that a mod uses its weather.string CurrentKey of TFA's own running weather (the dice, the F9 menu, the ghosts' vote), "" if none. The same on every player, give or take a second.string ModWeatherKey of the weather started through this API, "" if none.string ModOwnerThe owner id of that weather, "" if none.bool IsRunning(string key)Does this weather run, in either slot?bool IsUnderWater(Vector3 point)Is this point under TFA water right now (flash flood, tsunami)?event Action<TfaWeatherChange> ChangedOn every player, right after a weather switched there - for any weather, TFA's own included. One event per slot; a value update without a change of weather fires none.TfaWeatherResult Start(string owner, string key, TfaWeatherParams values = null)Starts a weather, or gives your running one a new tier or new live values. Only the host acts. Another key replaces your running weather (its aftermath plays) and drops an announcement of yours that is still counting down; the answer is Started.TfaWeatherResult Stop(string owner)Stops the weather owner started. Some weathers leave something behind when they end (see the weathers). After a win it still works.Current, ModWeather, ModOwner and IsRunning tell what is applied on this
machine. Start and Stop are safe to call on every player and as often as your logic wants. On
guests nothing happens. If the same weather already runs with the same tier and values, nothing is written; calls in quick
succession are merged, the last one wins within a second. Your Changed handler runs inside TFA's weather
step, so keep it short; an exception in it is caught and logged once per handler.
TfaWeatherParams
Everything is optional. Whatever you leave out, TFA decides as it always does.
| Property | Type | Default | Meaning |
|---|---|---|---|
Seconds | float? | TFA's own duration for that weather and tier | 0 = until you stop it. Max 3600. |
Tier | int? | Apocalypse mode: the run's level; else Normal | Difficulty 1-5: Relaxed, Normal, Hard, Brutal, Nightmare. See Difficulty. |
Warn | bool? | as TFA would on that tier | The banner or sound 3 s before it starts. false: none, and it starts at once (watch keeps its 10 s lead). true brings the warning back (the banner, for foodfrenzy the growl) for blood, petrify, tsunami, floorlava, foodfrenzy and watch; on any other weather it is ignored and logged. |
Sound | bool | true | false: no hazard sounds. Works for sun, quake, flood, tsunami, avalanche, volcano, shockfrost and hayfever, elsewhere it is ignored and logged. Feedback such as splashes and swim strokes stays. |
Harm | bool | true | false: the weather hurts nobody, on any tier. Works for 26 of the 28 weathers; blood and cactusrain ignore it and log (use pack = 0 or balls = 0). What it means per weather: the weathers. |
Level | float? | TFA's rule | World height in units. API level 1: the flash flood's water surface; ignored elsewhere. |
Values | Dictionary<string, object> | empty | Named values, see Values. With(name, value) adds one and returns the object. |
TfaWeatherResult
| Value | Meaning |
|---|---|
Started | Written for everyone. With a warning, the weather begins 3 s later. Also the answer when yours took over a colliding dice weather. |
Updated | Your weather got a new tier or new live values - the water moves to the new level, for example. |
Unchanged | The same weather already runs with this tier and these values, or only start values changed. Stop it and start it again. |
Stopped | Your weather ends for everyone; its aftermath plays. |
NothingToStop | You run nothing. A weather of TFA or of another mod is not yours to stop. |
NotHost | You're a guest. The host's call reaches you anyway. |
NotAllowed | Not in a run or the airport (title screen, loading), the daily map, or the run is over (lost, or the end screen). The log line says which. |
UnknownWeather | No weather with this key in this TFA. |
WrongTime | Reserved. TFA 2.10.0 never returns it: a night or day weather moves the clock instead. The value stays so that mods built for API level 1 still compile. |
Unavailable | Reserved. TFA 2.10.0 never returns it: every weather can be made to work anywhere. The value stays so that mods built for API level 1 still compile. |
Busy | Another mod's weather runs or is announced; or a dice Shroom Rain or Cactus Rain, a Mini/Mega phase or a cactus-ball phase is in the way of shroomrain or cactusrain. Try again later. |
BadOwner | The owner id isn't 2-24 lowercase letters or digits. |
TfaWeatherChange
From, ToThe weather keys before and after, "" = none.Owner"" = TFA itself (dice, menu, ghosts' vote), otherwise the owner id of a mod.ByModOwner.Length > 0.The weathers
Keys never change; they are the same as in TfaBiome.Weathers (see the Biomes tab). Values per
weather: see Values.
| Key | Name | Clock | Sound off | Harm off | When it ends |
|---|---|---|---|---|---|
storm | Windstorm | any | - | no push, no grip penalty (scenery) | - |
rain | Rain | any | - | no slipping, no letting go, wet rock doesn't pull | - |
snow | Blizzard | any; never moves the clock; started at night outside an Alpine stage it holds the night | - | no cold | - |
sand | Sandstorm | any | - | no blindness, no fainting, no braking | - |
sun | Burning Sun | any; moves the clock to noon and holds it | roar | no heat | - |
sleepfog | Sleeping Fog | any | - | no drowsiness | - |
spores | Spore Cloud | any | - | no spores, no zombies afterwards | mushroom zombies rise (zombies) |
poison | Poison Fog | any | - | no poison, no blast shrooms afterwards | a field of blast shrooms (mushrooms) |
shroomrain | Shroom Rain | any | - | no stings and throws (the size change stays) | final burst, everyone turns Mini or Mega (size) |
cactusrain | Cactus Rain | any | - | not offered (use balls = 0) | rolling cactus balls (balltime) |
foodfrenzy | Food Fiesta | any | - | no hunger; food without poison or dynamite damage | food keeps falling 3 s, then lies 10 s more |
floorlava | The Floor Is Lava | any | - | no heat, no death, no charring | own timeline, about 20 s (hold) |
dark | Darkness | any | - | no dozing, no hunt | - |
wisps | Will-o'-Wisps | any | - | no bad gifts | ends by itself when the last wisp is taken |
antigrav | Antigravity | any | - | the lift stays; no stamina drain, no ceiling hit, soft landing | - |
quake | Earthquake | any | rumble and bang | nobody falls, flies or loses anything | own timeline: 12 s = one quake |
blood | Blood Moon | any; moves the clock to midnight and holds it | - | not offered (use pack = 0) | creatures turn to skeletons or vanish |
moon | Blue Moon | any; moves the clock to midnight and holds it | - | no drowsiness and no stone (healing stays) | - |
petrify | Petrifying Sun | any; moves the clock to noon and holds it | - | no stone | - |
thunder | Thunderstorm | any | - | nobody is hit, no mega healing | - |
icefog | Freezing Fog | any | - | no cold | - |
watch | Scoutmaster's Watch | any; the host brings the Scoutmaster even if the run has none | - | he hunts nobody | salute and a gift (gift) |
flood | Flash Flood | any | roar and surge | no air bar, no drowning, no extra drowsiness | the water drains (drain) |
tsunami | Tsunami | any | wave sounds | the wave carries nobody | own timeline: wave, then the water drains |
avalanche | Avalanche | any | rumble and boom | hits nobody | own timeline, 90 s |
volcano | Volcanic Eruption | any; without a Kiln it erupts ahead of the group | eruption, rocks | rocks and ash have no effect | - |
shockfrost | Flash Freeze | any | chimes, cracking, the burst | no cold, no slipping, no falls (the ice, frozen traps and shattering stay) | 4 s of cracking, then the ice bursts and thaws for 3 s |
hayfever | Pollen Season | any | sniffs, gasps and sneezes | no sneeze push (the pollen haze and the sounds stay) | sneezing stops at once |
Own timeline: these weathers play a fixed course. Seconds only decides when the weather counts as over and
the next one may start; a wave or slide that has begun still finishes.
Holds the clock: day or night stand still while the weather runs. A night weather with Seconds = 0 keeps
the night until you stop it. If the time of day doesn't fit, the clock first moves to midnight (blood,
moon) or noon (sun, petrify) and goes back to where it was when the weather ends.
Warnings: blood, petrify, tsunami and floorlava have a banner,
foodfrenzy has a growl, and watch starts with a 10 s lead and a banner of its own. Whether they show
depends on the tier (see Difficulty), except watch, whose banner shows on every
tier; Warn decides it for you. Warn = false
means no banner and, for blood, petrify, tsunami, floorlava and
foodfrenzy, no lead (the lava glows after 0.5 s instead of 3 s); watch keeps its 10 s lead and
only loses the banner.
Harm off: what Harm = false does is in the table. It works for 25 weathers. Under water the same gate keeps the
character out of other weathers (see above).
Flash Freeze (shockfrost): it has no banner; its 6 s fade-in is the warning, and Seconds includes it. When it ends
(cracking for 4 s first) or after Stop, the ice bursts and thaws for 3 s; lava and water stay solid until then, so a
weather that follows may start only after the thaw. Harm = false switches off everything that touches the players
(cold, slipping, falls); the ice look, the frozen traps, the frozen lava and water and the shattering items stay.
flood - Flash Flood
| Value | Type | Default | Range | When | Meaning |
|---|---|---|---|---|---|
Level | float | 15 units below the end campfire of the current stage (Gloom/Caldera: 50 above it, Kiln/Citadel: 15 below the summit) | ±30000 | live | Water surface, world height in units. |
rise | float | 15 | 0-120 | live | Seconds to reach Level. 0 = there at once, also without the 4 s lead. |
drain | float | 20 | 0-120 | live | Seconds the water takes to drain after it ends. |
air | float | by tier: none / 75 / 60 / 45 / 45 | 0, 5-600 | live | Seconds of air under water. 0 = no air bar. |
douse | bool | true | start | Campfires and lanterns under water go out after 3 s. | |
Sound = false | live | No roar while the water rises or drains, no surge. The hum under water, splashes, swim strokes and bubbles stay. | |||
Harm = false | live | No air bar, no drowning, no extra drowsiness under water. |
TFA's own flood ends when someone lights a campfire. A flood you start doesn't: it runs until Stop or
Seconds ends it. To change it while it runs, call Start again with new live values: the water moves to
the new Level within rise seconds. Lowering the water does not bring back vanilla water that TFA
hid. Without Level, TFA's rule applies, on every machine for itself; where there is no campfire to aim at
(the airport), the host fixes the level at the start: 3 units above the lowest living player.
Multiplayer
- Call it everywhere.
PlayersHereand your own triggers run on every player. Make the same call on all of them; only the host's call counts. Weather started from code that only runs on one guest does nothing. CallingStarton every player also lets TFA know your owner id on every machine - see "Host leaves". - Tier and values come from the host. TFA sends them with the weather. Don't compute a value from things that differ between players, such as player positions or physics hits. Your stage's geometry, its campfires and the slot are the same everywhere.
- Late joiners get the weather in its current state, with its tier and values: the lake already full, the storm halfway through. They get a weather that is in its aftermath too. They don't see banners or hear starts that already happened.
- While the mountain builds, or before a player's character exists,
Startstill answersStarted. The weather begins on each machine as soon as TFA is ready there. - Host leaves: the next host takes over; duration, owner, tier and values stay in the room. A warning still counting down is lost; your next call starts the weather again. If the new host has never seen a call with your owner id - the mod is missing there - the weather ends after 15 s and TFA logs it.
- Continue (quicksave): a running weather is not saved. After loading,
PlayersHerereports your stage again and your call starts it again. - Run over: a lost run ends your weather. After a win it stays as harmless scenery on the end screen, like TFA's own;
Stopstill works then,StartanswersNotAllowed. - Scene change: a weather started in the airport ends when the run loads; nothing carries over from one scene to the next.
- Versions: all players need the same TFA version (TFA checks that). Guests don't need your mod to see TFA's weather; your biome itself is another story.
Good to know
- Statistics and badges: see "Statistics" under Next to TFA's dice: your weather never counts.
- PEAK's own weather of a stage keeps going. TFA's storm, rain, blizzard and sandstorm hold PEAK's wind zones still
while they blow. Your
sunreplaces the Mesa's own hot sun while it runs, so only your values apply. Apart from that, TFA does not switch PEAK's weather off outside Apocalypse mode; a biome drops its frame's weather withDropFromFrame. In Apocalypse mode TFA's permanent Mesa sun rests while yoursun,petrifyordarkruns, and for 90 s after. - Oxygen tanks in suitcases only appear in Apocalypse mode. The air bubbles from suitcases under water work in every run.
- Sky: several weathers tint the whole sky and the sun, starting from your stage's sky (
slot.Sky). - Under water TFA puts a low-pass filter on every sound source in the scene, yours included; voices, music and the
HUD stay clear. Water surfaces whose shader name contains "Water" and that lie entirely below
Levelare hidden while the water stands. - Loose physics objects near the camera float and sink slowly in TFA water. Make props kinematic if they should stay put.
Versions
ApiVersiongoes up whenever something is added. Existing members, weather keys and value names never change their meaning.- Values are named, not typed, so a mod written for a newer TFA still runs on an older one: the older TFA ignores names it doesn't know and logs them. New values join the catalogue without a new API level.
Planned
- The rows in italics above:
areafor the flood (a lake with a shore),Levelfor the tsunami and the sleeping fog,speed,ash,density,sight,gifts. SoundandHarmfor more weathers.- One-off events without the weather slot: a lightning strike, a lava rock or a supply crate at a point.
Questions or ideas for the API? Write to CptPICHU on the PEAK Modding Discord.
TFAs Wetter in deiner Mod
True Final Ascent bringt 28 eigene Wetter mit: Stürme, Nebel, einen Blutmond, ein Erdbeben, eine Sturzflut zum
Schwimmen, einen Tsunami, einen Vulkanausbruch und mehr. Mit TfaWeather startet und stoppt deine Mod sie in
jedem Lauf, mit oder ohne Apokalypse-Modus, wählt, wie hart sie spielen, und setzt einzelne Werte.
- Starten und stoppen: jedes der 28 Wetter, so lange du willst.
- Schwierigkeit wählen.
Tier1-5 spielt ein Wetter wie TFAs Apokalypse-Stufen Entspannt, Normal, Schwer, Brutal oder Albtraum. Deine Spieler brauchen dafür keinen Apokalypse-Modus, und ihre Apokalypse-Einstellung bleibt unberührt. - Einzelwerte setzen. Jedes Wetter hat benannte Werte - den Schub des Sturms, Wasserstand und Luft der Flut, die
Rudelgröße des Blutmonds. Du setzt sie mit
With(name, value). Jeder überschreibt die Stufe für genau diese eine Zahl. - Dem Wetter folgen bei jedem Spieler über
Current,ModWeatherund das EreignisChanged, in jedem Modus. - Der Host entscheidet. Ruf überall dasselbe auf. Nur der Aufruf des Hosts bewirkt etwas; TFA bringt das Wetter mit Stufe und Werten zu allen, Nachzügler eingeschlossen.
- Neben TFAs Würfeln. Im Apokalypse-Modus läuft dein Wetter neben TFAs eigenem. Wo beide zusammenstoßen, übernimmt deins.
- Ein Mod-Wetter zur Zeit. Der API-Platz gehört allen Mods gemeinsam: Wer ein Wetter startet, besitzt es; du
kannst nur dein eigenes ändern oder stoppen, und eine andere Mod bekommt
Busy, bis deins endet.
Einrichtung
Binde TFA ein wie für die Biom-API (TrueFinalAscent.dll, Private=false; siehe den Reiter
Biome) und deklariere eine weiche Abhängigkeit. Fass TfaWeather nur an, wenn TFA
installiert und neu genug ist: TFA 2.10.0 ist die erste Version damit. In einem älteren TFA fehlt der Typ, und die
erste Berührung wirft eine Ausnahme.
<Reference Include="TrueFinalAscent">
<HintPath>...\BepInEx\plugins\CptPICHU-TrueFinalAscent\TrueFinalAscent.dll</HintPath>
<Private>false</Private>
</Reference>
using System;
using System.Runtime.CompilerServices;
using BepInEx;
using BepInEx.Bootstrap;
[BepInPlugin("you.crystalcaves", "Crystal Caves", "1.0.0")]
[BepInDependency("com.CptPICHU.peak.truefinalascent", BepInDependency.DependencyFlags.SoftDependency)]
public class CrystalCavesPlugin : BaseUnityPlugin
{
internal static bool TfaWeatherReady;
private void Awake()
{
// Touch TfaWeather only when TFA 2.10.0 or newer is installed: on an older TFA the type is missing, and the first
// touch throws. Without TFA your mod keeps working as before.
if (Chainloader.PluginInfos.TryGetValue("com.CptPICHU.peak.truefinalascent", out PluginInfo tfa)
&& tfa.Metadata.Version >= new Version(2, 10, 0))
{
TfaWeatherReady = TfaWeatherBridge.ApiLevel() >= 1;
}
}
}
internal static class TfaWeatherBridge
{
// In its own class and never inlined: otherwise .NET may resolve TFA's type when Awake compiles, before your check runs.
[MethodImpl(MethodImplOptions.NoInlining)]
internal static int ApiLevel() => TrueFinalAscent.Api.TfaWeather.ApiVersion;
}
Wer in Awake ApiVersion liest, sagt TFA damit auch, dass eine Mod sein Wetter nutzt. Geschieht das
beim Host, lädt TFA die schweren Wetter (Blutmond-Kreaturen, Tsunami, Lawine, Vulkan, die Finsternis-Jagd) zu Beginn jedes
Laufs, sodass sie bei allen Spielern bereit sind, bevor du eines startest.
Schnellstart
using TrueFinalAscent.Api;
// On every player. On the host it starts 60 s of rain; on guests it returns NotHost, and the host's rain reaches them.
TfaWeather.Start("crystalcaves", "rain", new TfaWeatherParams { Seconds = 60f });
// The same rain on Hard, but nobody slips: the tier sets everything, the value overrides one number.
TfaWeather.Start("crystalcaves", "rain", new TfaWeatherParams { Seconds = 60f, Tier = 3 }.With("slip", 0f));
// Later, also on every player: stops the weather "crystalcaves" started.
TfaWeather.Stop("crystalcaves");
Das erste Argument ist deine Owner-Id: 2-24 Kleinbuchstaben oder Ziffern - dieselbe Regel wie bei einer Biom-Id, eine Biom-Mod nimmt also ihre Biom-Id. TFA erkennt daran, wessen Wetter läuft.
Start und Stop liefern, was passiert ist (siehe TfaWeatherResult).
Nur Started, Updated und Stopped haben etwas geändert; jedes andere Ergebnis lässt
das Wetter, wie es war, und schreibt eine Logzeile mit dem Grund (denselben Fall höchstens alle 10 s).
Regeln
Wo es läuft
| Lauf | Dein Wetter |
|---|---|
| Normaler Lauf, Baukasten, eigener Lauf | Läuft. TFA startet dort kein eigenes Wetter, das Wetter gehört also dir. |
| Apokalypse-Modus | Läuft neben TFAs Würfeln: Zwei Wetter können zugleich laufen, eins der Würfel und eins von dir. Wo beide zusammenstoßen, übernimmt deins. Siehe Neben TFAs Würfeln. |
| Flughafen (Lobby) | Läuft auch, nur zum Spaß: Die Halle ist die Bühne. Was den Berg braucht, gibt sein Bestes rund um die Spieler (siehe Überall, jederzeit). PEAK selbst lässt im Flughafen keinen Status durch - keine Verletzung, Kälte, Hitze oder Müdigkeit -, die Wetter dort werfen, lassen fallen und erschrecken, tun aber nicht weh. Ein dort gestartetes Wetter endet, wenn der Lauf lädt. |
| Tageskarte | NotAllowed. Die Tageskarte wird nie verändert. In einem Biom startest du nur, wenn slot.OwnWeatherAllowed wahr ist (siehe den Reiter Biome); dort ist es falsch. |
| Titelbild, Laden, ein verlorener Lauf, der Endbildschirm nach einem Sieg | NotAllowed. Ein Wetter, das schon läuft, folgt den Regeln unter Mehrspieler. |
Überall, jederzeit
Deine Aufrufe ignorieren die Regeln, denen TFAs Würfel folgen. Es gibt keine Prüfung von Ort, Biom, Tageszeit, Modus oder
Laufeinstellung: Jedes der 28 Wetter läuft in jeder Etappe (Mod-Biome und der Baukasten eingeschlossen), auf PEAKs eigenen
Karten, im Kaktusball-Modus und mit für den Lauf abgeschaltetem Feldmeister. Die Ergebniscodes WrongTime und
Unavailable kommen nicht mehr vor.
- Tageszeit. Ein Nachtwetter (
blood,moon), bei Tag gestartet, stellt die Uhr auf Mitternacht, solange es läuft; ein Tagwetter (sun,petrify), nachts gestartet, stellt sie auf Mittag. Das Wetter hält die Uhr an und gibt sie am Ende zurück. Der Schneesturm (snow) verstellt die Uhr nie. - Feldmeister.
watchunddark: Der Host bringt einen Feldmeister mit, auch wenn der Lauf keinen hat, und die Wacht schläft nicht mehr im Kiln, in der Düsternis, in der Zitadelle und im Nadir. - Kein Berg zum Zielen. Ohne Kiln bricht der Vulkan vor der Gruppe aus; Lawine, Sturzflut und Tsunami zielen auf die Spieler, wenn es kein Lagerfeuer gibt. Was jedes Wetter ohne den Berg - und im Flughafen - tut, steht unten.
| Wetter | Ohne den Berg, im Flughafen |
|---|---|
storm | Läuft überall. Im Flughafen ohne fliegende Windstreifen (nur Dunst, Himmel, Schub und Klang). |
rain | Läuft überall. Der Nässeglanz am Boden braucht PEAKs Regentechnik auf der Karte (nicht im Flughafen). |
snow | Jedes Biom, jede Tageszeit; verstellt die Uhr nie. Im Flughafen entscheiden Himmelsstrahlen über den Schutz. |
thunder | Läuft überall. Im Flughafen schlagen Blitze auf jeden festen Boden ein, und die Dach- und Felsprüfung sieht nur Terrain/Map, Blitze können also Spieler drinnen treffen. Das Blitzableiter-Abzeichen zählt nur in Läufen. |
sun | Stellt die Uhr auf Mittag. Im Flughafen bleibt es bei der Optik: PEAK lässt dort keine Hitze durch. |
petrify | Stellt die Uhr auf Mittag. Im Flughafen bleibt es bei der Optik: PEAK lässt dort keinen Stein durch. |
moon | Stellt die Uhr auf Mitternacht. Im Flughafen schützt kein Dach. |
blood | Stellt die Uhr auf Mitternacht. Die Kreaturen kommen aus den Vorlagen der Karte; im Flughafen kommen nur Pilzzombies (wenn sie sich laden lassen), der rote Himmel läuft immer. |
sleepfog | Läuft überall. Im Flughafen gibt es keine Düsternis-Beleuchtung, nur Tönung und Nebelschicht; frühe Würmer landen auf sichtbarem Boden nahe der Spieler. |
icefog | Wo PEAKs Nebelkugel fehlt (Flughafen, Läufe ohne Nebel), arbeitet die Blase ohne ihren Nebel; die Partikelwand zeigt den Rand. |
spores | Zombies stehen überall auf, wo die Wolke endet (Flughafen eingeschlossen), aber nicht, wenn ein Szenenwechsel sie beendet hat. |
poison | Die Knallpilze brauchen die Vorlagen des Bergs; im Flughafen wachsen sie nur, wenn in dieser Sitzung schon ein Giftnebel in einem Lauf lief. |
wisps | Anzahl, Gaben und Lichter funktionieren überall; im Flughafen entstehen die Irrlichter nahe der Spieler, in ihrer Sichtlinie. |
shroomrain | Läuft überall. Im Flughafen: Beerenregen, Schlussknall und Größenphase, aber keine Hüpfpilze. |
cactusrain | Läuft im Kaktusball-Modus (danach keine zusätzliche Ballphase). Im Flughafen: nur Bälle, keine Kakteen und kein Skorpion. |
foodfrenzy | Läuft überall. Im Flughafen: Hunger und Essensregen, kein Garten. |
floorlava | Läuft überall. Im Flughafen glühen Hallenboden, Vorfeld und Rollbahn; Möbel sind sicherer Boden. |
dark | Läuft überall; der Host bringt einen Feldmeister mit, auch wenn der Lauf keinen hat. Im Flughafen endet die Jagd mit dem Wurf oder der Lampe, und die Musik ist stumm. |
watch | Läuft überall und ignoriert den Ort; der Host bringt einen Feldmeister mit, auch wenn der Lauf keinen hat. Im Flughafen springt er auf Bodenpunkte nahe der Spieler; der Albtraum-Himmel braucht ein Nadir. |
antigrav | Läuft überall; drinnen (Flughafenhalle) steigen die Spieler bis zum Dach. Im Albtraum tut die Berührung einer Decke weh, im Flughafen aber nicht, weil PEAK dort jeden Status blockt. |
quake | Läuft überall, Flughafen eingeschlossen; Spieler in der Luft (ab 3 m über dem Boden) bleiben verschont. |
flood | Ohne Level und ohne Lagerfeuer zum Zielen (Flughafen) legt der Host den Pegel beim Start fest: 3 Einheiten über dem tiefsten lebenden Spieler. |
tsunami | Die Welle zieht entlang der Welt-X-Achse an der Gruppe vorbei. Ohne Lagerfeuer steht das Wasser dahinter 2 Einheiten über dem tiefsten Spieler. |
avalanche | Beginnt hinter dem nächsten Lagerfeuer; ohne eines beginnt sie vor der Gruppe (Flughafen: entlang der Halle). Schnee oder Staub richtet sich nach dem Biom oder nach snow. |
volcano | Ohne Kiln bricht er etwa 250 m vor der Gruppe aus; Felsen, Knall, Asche und Stufen wirken wie gewohnt. Im Flughafen werfen Felsen die Spieler nur um. |
shockfrost | Läuft überall, auch in normalen Läufen und im Flughafen. Lava und Wasser werden zu Eis, wo die Etappe welche hat; Eis-Look, Rutschen, Kälte, eingefrorene Items und Fallen wirken überall. Das Tauen dauert nach Stop 3 s, bis dahin bleiben Lava und Wasser fest. |
Was gewinnt
Für jede Zahl, die ein Wetter nutzt, schaut TFA in dieser Reihenfolge:
Harm = false- das Wetter verletzt niemanden, was du sonst auch setzt.- Dein Wert, falls du einen mit
With(name, value)gesetzt hast. - Dein
Tier. - Kein
Tiergesetzt: im Apokalypse-Modus die Stufe des Laufs (ohne die Geisterwahl), sonst überall Normal.
Stufe und Werte betreffen nur dein Wetter. Ein Würfelwetter neben deinem behält die Stufe des Laufs; die Apokalypse-Stufe der Spieler und TFAs Statistik bleiben, wie sie sind.
Live oder Start. Ruf Start mit demselben Owner und Wetter noch einmal auf, um es während des Laufs zu
ändern. Werte mit live im Katalog gelten sofort (Updated); der Host hat sie
gleich, Gäste innerhalb einer Sekunde. Werte mit Start sowie Seconds und Warn gelten nur
für einen frischen Start; hat sich nur davon etwas geändert, bekommst du Unchanged und eine Logzeile - stoppe
und starte neu. Tier, Sound, Harm und Level sind live; ein paar Dinge
entscheidet ein Wetter einmal beim Start (wie viele Irrlichter erscheinen, die Taschenlampen-Batterie) und behält ihren
Startwert. Ein Aufruf setzt Stufe, Sound, Harm und Live-Werte als Ganzes: Was du weglässt, fällt
auf den Standard zurück.
Die Nachwirkung zählt. Was ein Wetter hinterlässt, wenn es endet (Sporenzombies, Knallpilze, das Pilzfinale, die rollenden Kaktusbälle, das weiterfallende Essen, das ablaufende Wasser), spielt ebenfalls mit deiner Stufe und deinen Werten, bis zu 90 s nach dem Ende (die Sturzflut: so lange, wie sie zum Ablaufen braucht, plus 10 s).
Falsche Werte machen nichts kaputt. Unbekannte Namen und Werte vom falschen Typ werden ignoriert. Werte außerhalb des Bereichs werden geklemmt; steht im Bereich „0 oder 5-600“, wird ein Wert unter 5 zu 5 und 0 oder weniger zu 0. Eine Stufe außerhalb von 1-5 wird geklemmt. Jeder Fall schreibt eine Logzeile.
Einheiten. Höhen und Entfernungen sind Welteinheiten (PEAKs Höhenmesser zeigt etwa 1,6 m je Einheit). Zeiten sind
Sekunden. Status-Mengen sind Anteile einer vollen Leiste: 0.025 = 2,5 Punkte, in Schritten von 0,025. Faktoren
multiplizieren TFAs eigenen Wert.
Neben TFAs Würfeln (Apokalypse-Modus)
Im Apokalypse-Modus würfelt TFA alle paar Minuten ein Wetter. Start ist dort erlaubt: Dein Wetter läuft neben
ihnen, also können zwei Wetter zugleich laufen, eins der Würfel und eins von dir. Außerhalb des Apokalypse-Modus läuft
nur deins. Zwei Wetter, die sich einen Teil des Spiels teilen, können nicht zusammen laufen; die folgenden Regeln entscheiden,
wer weicht.
- Deins übernimmt. Dein
Startstößt mit einem laufenden oder angekündigten Würfelwetter zusammen, wenn es dasselbe Wetter ist oder eins aus derselben Gruppe (Tabelle unten). Dann endet das Würfelwetter sofort, eine Ankündigung wird abgebrochen, dein Wetter startet, und du bekommstStarted. EinStart, der scheitert (NotAllowed,Busy, ...), fasst das Würfelwetter nie an. - Die Würfel würfeln weiter. Sie würfeln alles andere, aber nie dein Wetter und nichts aus seiner Gruppe, solange es läuft und 90 s nach dem Ende - seine Nachwirkung gehört dir. Im F9-Menü des Hosts steht dein Wetter als „Mod: deineid“, eingeschaltet und gesperrt; die kollidierenden Zeilen sind ebenfalls gesperrt.
- Permawetter (der Perma-Modus des Hosts) pausiert, solange ein kollidierendes Wetter von dir läuft. Es kommt zurück, wenn deins und seine Nachwirkung vorbei sind. Verlangst du das Permawetter selbst, gilt dasselbe: deins übernimmt, und das Permawetter läuft danach weiter.
- Kein Zusammenstoß, beide laufen. Dein Erdbeben neben dem Würfelregen, jedes nach seiner eigenen Stufe: deins nach
Tier(weggelassen: die Stufe des Laufs), das der Würfel nach der Stufe des Laufs und der Geisterwahl. Deine Stufe und deine Werte erreichen nie ein Würfelwetter. Busy. Die API hält ein Wetter zur Zeit. Läuft das Wetter einer anderen Mod oder ist es angekündigt, antwortet deinStartmitBusy. Das tut er auch fürshroomrainundcactusrain, solange die Würfel eins davon laufen haben oder noch eine Mini/Mega-Phase oder eine Kaktusball-Phase läuft, egal wer sie gestartet hat: Sie enden in so einer Phase und lassen sich nicht übernehmen. Frag etwas später noch einmal; Aufrufe sind billig und werden zusammengelegt.
// Apocalypse mode, and the dice are rolling rain right now. Rain and sandstorm both belong to the Wind group, so yours
// takes over: the rain ends at once, the sandstorm starts, and for as long as it runs (and 90 s after) the dice roll
// no weather of the Wind group.
TfaWeatherResult r = TfaWeather.Start("crystalcaves", "sand", new TfaWeatherParams { Seconds = 60f });
// r == TfaWeatherResult.Started
// Another mod's weather holds the slot? Then you get Busy - ask again in a few seconds.
if (TfaWeather.Start("crystalcaves", "quake", new TfaWeatherParams { Seconds = 24f }) == TfaWeatherResult.Busy)
{
// try again later
}
Wer mit wem zusammenstößt
Wetter stoßen zusammen, wenn sie gleich sind oder eine Gruppe teilen. Ein Wetter kann in mehreren Gruppen stehen.
| Gruppe | Wetter | Warum sie nicht zugleich laufen |
|---|---|---|
| Wind | storm, rain, snow, sand, thunder, cactusrain, volcano, avalanche, shockfrost | Ein Windsystem, ein gemeinsamer Wetternebel-Block und gemeinsame Klangbänke. Regen und Gewitter teilen sich den Regen. |
| Wasser | flood, tsunami, antigrav, shockfrost | Ein Wasserkörper. Antigravitation und Flut greifen in dieselben Schwerkraft-, Ausdauer- und Sturzregeln. |
| Wolken | spores, poison | Eine Wolke über dem Kopf und eine Nebeleinstellung, die zurückgestellt werden muss. |
| Sonne | sun, petrify, dark, shockfrost | Sonnenlicht und Uhr. Die Finsternis dimmt die Sonne, die die beiden anderen brauchen. |
| Mond | blood, moon, dark | Mondlicht und Nachtuhr. Die Finsternis dimmt den Mond, den die beiden anderen brauchen. |
| Mischpult | dark, antigrav, icefog, shockfrost | Alle drei senken Musik- und Klanglautstärke und würden den falschen Wert zurückstellen. |
| Feldmeister | dark, watch | Es gibt nur einen Feldmeister. |
| Nebelband | sleepfog, icefog, dark | Die Stimmen im Nebel und das Lichtprofil des Nebels. |
| Frost | floorlava, shockfrost | Beide schreiben den Boden um: glühender Boden und Eis, Lava und heißer Stein. |
| Größe | shroomrain, cactusrain | Die Mini/Mega-Phase und die Kaktusball-Phase schließen sich aus - auch in der Nachphase, egal wer sie gestartet hat. |
| Frei | quake, foodfrenzy, wisps, hayfever | Sie laufen neben allem. |
Ein paar Paare überlappen nur optisch - mehrere Himmelsfärbungen, die sich stapeln, die Tiefpassfilter von Flut und Eisnebel, Frost gegen Frost. Sie sind erlaubt.
Unter Wasser bist du gegen jedes andere Wetter immun
Wer unter TFA-Wasser ist - einer Sturzflut oder einem Tsunami, egal wer sie gestartet hat -, wird von keinem anderen Wetter
berührt. Das gilt auch für das Gute: keine Heilung durch den Blauen Mond, keine Irrlicht-Gabe. Nichts erreicht die Figur:
kein Status, kein Schub, kein Sturz, keine Blindheit, keine Tempoänderung, kein Gegenstandsverlust. Bild und Klang bleiben:
Der Sturm brüllt weiter über dem See. Die Sturzflut und der Tsunami selbst wirken auf Schwimmer wie immer.
TfaWeather.IsUnderWater(point) fragt genau das.
Statistik
Wetter, das du startest, zählt nie in TFAs Wetterstatistik: nicht seine Starts, seine Laufzeit, die Zustände, Taten,
Ohnmachten oder Tode, weder im Wetterbericht noch in Uploads noch auf der Webseite. Was dein Wetter anrichtet, wird auch nie
einem Würfelwetter gebucht; wo TFA nicht sicher weiß, wessen Wetter es war, bucht es nichts. Solange ein Wetter von dir läuft
oder nachwirkt und verletzen kann (Harm an), werden Ohnmachten und Tode gar nicht gebucht. TFAs Wetter-Abzeichen sind für dein Wetter nicht gesperrt:
Tat-Abzeichen zählen im Apokalypse-Modus weiter wie bei TFAs eigenem Wetter, außerhalb zählen sie nie.
Schwierigkeit - Tier
Tier ist ein int? von 1 bis 5. Lässt du es weg, spielt das Wetter im Apokalypse-Modus auf der Stufe
des Laufs (ohne die Geisterwahl), überall sonst auf Normal.
| Tier | Name | Kurz gesagt |
|---|---|---|
| 1 | Entspannt | Mild. Einige Gefahren sind aus: keine Luftleiste unter Wasser, keine Jagd des Feldmeisters, kein Wurf im Beben. |
| 2 | Normal | Wie gebaut. |
| 3 | Schwer | Schnellere Ticks, härtere Treffer, kürzere Warnungen. |
| 4 | Brutal | Schwer plus Zusatzregeln: keine Banner (Tsunami und Wacht behalten ihr Banner), schlimmere Nachwirkung. |
| 5 | Albtraum | Brutal plus eigene Regeln: Albtraum soll nicht fair sein. Wetter dauern 25 % länger. |
Das sind genau die Stufen von TFAs Apokalypse-Modus, mit denselben Zahlen. Was jede Stufe ändert:
| Wetter | 1 Entspannt | 2 Normal | 3 Schwer | 4 Brutal | 5 Albtraum |
|---|---|---|---|---|---|
storm | Schub x0,6, Sicht 140 | Schub x1, Sicht 80 | Schub x2, Sicht 50 | Schub x3, Sicht 32 | Schub x4, Sicht 32 |
rain | kein Ausrutschen | 2,5 %/s Ausrutschen beim Sprinten im Freien; nasser Fels zieht Kletternde nach unten | 15 %/s Ausrutschen, der Fels zieht stärker | wie Schwer, ein Ausrutscher kostet 10 % Verletzung, 10 %/s Loslassen am nassen Fels | jedes Sprinten im Freien rutscht aus, Klettern nach oben mit 15 % Tempo |
snow | 2,5 Kälte alle 1,5 s | alle 0,75 s | 0,4 s | 0,25 s | 0,125 s |
sand | blind nach 18 s gegen den Wind | 12 s | 6 s | 6 s, die Blindheit klingt nicht ab, solange es weht | 4 s, Dornen bluten danach, du bleibst unten, bis sie weg sind |
sun | Hitze alle 3 s | 2 s | 1,5 s | 1,5 s, doppelte Hitze | 0,75 s, doppelte Hitze |
sleepfog | müde alle 3 s, ein früher Wurm alle 20 s | alle 3 s, Wurm alle 40 s | 2 s | 1,5 s, 30 s länger | 1,5 s, 30 s länger, keine Würmer |
spores | alle 2,5 s bis 40 %, danach 1-2 Zombies | 2,5 s, 1-3 Zombies | 2 s, 3 Zombies | 1,25 s, 3 Zombies, die bis zum nächsten Lagerfeuer bleiben | wie Brutal, Zombies laufen 1,5x schneller |
poison | alle 2,5 s bis 40 %, danach 60 Knallpilze | 2,5 s, 80 | 2 s, 120 | 1,25 s, 160 | 1 s, 160 |
shroomrain | Hüpfpilz alle 0,67-1,67 s | 1-2,5 s | 2-5 s, die Schlussknalle fügen Sporen hinzu (bis 25 %) | 2-5 s, die Knalle fügen mehr Sporen hinzu (bis 50 %) | keine Hüpfpilze, die Knalle fügen Sporen hinzu und schleudern dich |
cactusrain | Bälle x0,6, mehr Kakteen | Bälle x1 | Bälle x1,3, weniger Kakteen | wie Schwer, 5 % der Bälle sind Dynamit | Bälle x2,6, 5 % Dynamit, Kakteen 1,5x dichter |
foodfrenzy | Hunger 0,025/s, ein Bissen 0,1, 1,3x Essen | Hunger 0,025/s, ein Bissen 0,075 | Hunger 0,05/s | wie Schwer, giftiges Essen vergiftet | wie Brutal, Dynamit statt Allheilmittel im Essen |
floorlava | Hitze x0,5 | x1 | x1,5 | x2, liegendes Essen verkohlt | x3, Ohnmacht in der Glut tötet |
dark | endlose Taschenlampe, keine Jagd | Batterie 70 % des Wetters, der Feldmeister jagt nach 20 s ohne Licht | Batterie 60 %, jagt nach 10 s und kommt wieder | wie Schwer, kein Leuchten um dich, müde alle 2 s ohne Licht | wie Brutal, müde alle 1 s, Fackeln halb so hell |
wisps | 10 Irrlichter | 8 | 6 | 6, alle sehen weiß aus, Rot und Rosa doppelt so wahrscheinlich | 6, nur schlechte Gaben, Irrlichter folgen den Spielern |
antigrav | danach 10 s halber Fallschaden | wie gebaut | Ausdauerverbrauch x2 im Auftrieb | Ausdauer bleibt im Auftrieb bei 0 | wie Brutal, Stürze danach x1,5, die Decke zu berühren tut weh |
quake | 7 s Vorwarnung, du fällst nur | 7 s, geschleudert x1 | 4 s, x2 | 4 s, x3, Ducken verhindert den Sturz nicht, ein zweites Item fällt | keine Vorwarnung, x4, alles fällt |
blood | 2-4 Kreaturen je Spieler | 3-5, höchstens 20 | 5-7 | 7-9, höchstens 40, auch Frösche | 10, höchstens 50 |
moon | heilt alles, auch Hunger | heilt Fluch, Verletzung, Sporen, Gift, Hitze, Kälte, Müdigkeit, Stein | alles außer dem Fluch | nur Sporen, Gift, Hitze, Kälte; keine Bonusausdauer; 10 % müde Schlucke | heilt nichts; 25 % Chance auf Stein je Schluck |
petrify | Stein alle 3 s | 2 s | 1,33 s, kein Banner | 2 s, doppelter Stein, kein Banner | 1 s, doppelter Stein, kein Banner |
thunder | Blitze halb so oft, 10 % Verletzung | 3-17 s Abstand, 35 % zielen auf Spieler, 20 % Verletzung, 5 % Mega-Blitze | 10 % Mega-Blitze | 40 % Verletzung, Mega-Blitze verletzen statt zu heilen | 70 % gezielt, jeder dritte Blitz ist ein Mega-Blitz |
icefog | Blase 15,6 Einheiten, Kälte alle 3 s draußen | Blase 9,4 Einheiten, 3 s | 2 s | 1 s, Stimmen verstummen tief im Nebel | 0,5 s, dunkler |
watch | allein ab 40 Abstand, Jagd nach 8 s | 30 Abstand, 5 s | 25, 4 s, Weggeschleuderte 45 s sicher | 20, 3 s, 20 s sicher, Lagerfeuer schützen nicht, keine Gabe | wie Brutal, er jagt sofort, wenn ihn niemand ansieht, kein Salut |
flood | keine Luftleiste | 75 s Luft | 60 s, Schwimmen kostet x1,25 | 45 s, x1,5 | 45 s, x1,5, keine Luft = sofort völlig müde |
tsunami | 3 s mitgerissen, keine Verletzung | 3,5 s, 20 % | 4 s, 30 % | 5 s, 40 %, Banner bleibt | 10 s, 40 %, Welle doppelt so schnell, kein Banner |
avalanche | keine Verletzung | 15 % Verletzung, verschüttet: 30 % Kälte | x1,5 geschleudert, Kälte 40 % | wie Schwer, Staub hält doppelt so lang, Kälte 60 % | Schnee friert dich fest, Geröll tötet |
volcano | 5 % Verletzung je Fels | 15 % Verletzung, 10 % Hitze | Felsen x1,25, Warnfelder 1 s später, Aschehitze x1,5 | Felsen x1,5, 25 % Hitze, Asche x2 | Felsen x3, keine Warnfelder, Asche x3 |
shockfrost | Klettern am Fels: 0,025 Kälte alle 2 s, Sprint-Ausrutschen 10 %/s, Sprintsturz 0,05 Kälte, Wandrutscher 10 %/s | alle 1 s, 10 %/s, 0,1, 10 %/s | 1 s, 30 %/s, 0,15, 15 %/s | 0,5 s, 50 %/s, 0,2, 20 %/s | 0,05 Kälte alle 0,5 s, jedes Sprinten rutscht, 0,3, 30 %/s, Items zerbrechen schon bei Berührung |
hayfever | Nieser 5 m hoch | 9 m | 13 m, reißt dich von Wänden | 17 m, Item fliegt aus der Hand, wirft dich um, außer es wirft dich nach oben | 17 m, Item fliegt aus der Hand, wirft dich immer um, nie nach oben |
Bei jedem Wetter: Albtraum dauert 25 % länger. Ab Brutal gibt es keine Banner (der Tsunami behält seins auf Brutal,
Der Boden ist Lava warnt immer, die Wacht des Feldmeisters zeigt immer ihr eigenes Banner); die Versteinernde Sonne hat ab
Schwer keins. Warn = true bringt ein Banner zurück, wo das Wetter eins hat.
Werte - With(name, value)
new TfaWeatherParams { Tier = 2 }.With("push", 1.5f).With("direction", "right")
Zahlen können float oder int sein, Schalter bool, Auswahlen string. Namen,
die sich mehrere Wetter teilen, bedeuten überall dasselbe: every = Sekunden je Status-Tick,
amount = Status je Tick, injury, cold, direction. heat ist die
Ausnahme: bei floorlava ein Faktor, bei volcano eine Menge je Fels.
Groß- und Kleinschreibung der Namen spielt keine Rolle.
Standard zeigt TFAs Wert je Stufe: Entspannt / Normal / Schwer / Brutal / Albtraum. Eine Zahl = auf jeder Stufe gleich.
Live-Werte ändern sich, während das Wetter läuft, Start-Werte beim nächsten Start, Ende-Werte werden
gelesen, wenn das Wetter endet (eine Änderung währenddessen zählt als Updated). Kursive Zeilen sind geplant und
nicht in API-Stufe 1. Wo eine Zeile sagt, dass 0 keine oder nie heißt, ist das wörtlich gemeint: keine Zombies,
keine Würmer, nie blind.
| Wetter | Name | Was er einstellt | Einheit, Bereich | Standard 1 / 2 / 3 / 4 / 5 | Wann |
|---|---|---|---|---|---|
storm | push | Seitlicher Schub, Faktor auf PEAKs Windkraft | x, 0-6 | 0,6 / 1 / 2 / 3 / 4 | live |
sight | Wie weit du bei voller Stärke siehst | Einheiten, 10-1000 | 140 / 80 / 50 / 32 / 32 | live | |
gloom | Tageslicht, das durch den Sturm dringt | 0-1 | 0,8 / 0,62 / 0,48 / 0,38 / 0,38 | live | |
direction | storm, snow und sand: woher der Wind kommt, entlang des Bergs | "left", "right" | die letzte Richtung (zuerst: links) | live | |
rain | slip | Chance pro Sekunde, beim Sprinten unter freiem Himmel auszurutschen; 1 = jedes Sprinten rutscht | 0-1 | 0 / 0,025 / 0,15 / 0,15 / 1 | live |
slide | Wie stark nasser Fels Kletternde nach unten zieht (PEAKs eigener Wert: -0,5); ersetzt auch die Bremse des Albtraums bergauf | -2 bis 0 | -0,5 / -0,5 / -0,75 / -0,75 / -0,75 | live | |
letgo | Chance pro Sekunde, am nassen Fels unter freiem Himmel loszulassen | 0-1 | 0 / 0 / 0 / 0,1 / 0,1 | live | |
density | Wie viel Regen du siehst (nur Optik) | 0-1,6 | 1 | live | |
snow | every | Sekunden je 2,5 Kälte bei voller Stärke (halb so oft, solange er sich aufbaut) | s, 0,1-30 | 1,5 / 0,75 / 0,4 / 0,25 / 0,125 | live |
sight | Wie weit du im Schneesturm siehst | Faktor | 1 | live | |
direction | Woher der Schneesturm kommt, entlang des Bergs; wie bei storm | "left", "right" | die letzte Richtung (zuerst: links) | live | |
sand | blind | Sekunden gegen den Wind, bis du blind bist; 0 = nie | s, 0-120 | 18 / 12 / 6 / 6 / 4 | live |
slow | Wie viel langsamer du dich ungeschützt bewegst | 0-0,9 | 0,5 | live | |
direction | Woher der Sandsturm kommt, entlang des Bergs; wie bei storm | "left", "right" | die letzte Richtung (zuerst: links) | live | |
sun | every | Sekunden je Hitzeschluck | s, 0,25-30 | 3 / 2 / 1,5 / 1,5 / 0,75 | live |
amount | Hitze je Schluck | 0-0,5 | 0,025 / 0,025 / 0,025 / 0,05 / 0,05 | live | |
sleepfog | every | Sekunden je Müdigkeitsschluck | s, 0,25-30 | 3 / 3 / 2 / 1,5 / 1,5 | live |
amount | Müdigkeit je Schluck | 0-0,5 | 0,025 | live | |
worms | Sekunden zwischen frühen Würmern je Spieler; 0 = keine | s, 0 oder 5-600 | 20 / 40 / 40 / 40 / 0 | live | |
Level | Nebelgrenze auf dieser Welthöhe | Einheiten | über dem höchsten Spieler | live | |
spores | every | Sekunden je Sporenschluck (Ducken und nach unten schauen bremsen ihn) | s, 0,25-30 | 2,5 / 2,5 / 2 / 1,25 / 1,25 | live |
amount | Sporen je Schluck | 0-0,5 | 0,025 | live | |
zombies | Pilzzombies, die am Ende aufstehen; 0 = keine | 0-6 | 1-2 / 1-3 / 3 / 3 / 3 | Ende | |
poison | every | Sekunden je Giftschluck | s, 0,25-30 | 2,5 / 2,5 / 2 / 1,25 / 1 | live |
amount | Gift je Schluck | 0-0,5 | 0,025 | live | |
mushrooms | Knallpilze, die am Ende gesät werden; 0 = keine | 0-300 | 60 / 80 / 120 / 160 / 160 | Ende | |
shroomrain | size | Was der Schlussknall mit allen macht | "mini", "mega", "none" | 50:50 Mini oder Mega | Start |
sprout | Sekunden zwischen Hüpfpilzen (TFA nimmt das 1- bis 2,5-Fache); 0 = keine | s, 0 oder 0,25-30 | 0,67 / 1 / 2 / 2 / 0 | live | |
cactusrain | balls | Kaktusbälle pro Sekunde je Spielergruppe | 0-8 | 1,8 / 3 / 3,9 / 3,9 / 7,8 | live |
cacti | Sekunden zwischen neuen Kakteen (TFA nimmt das 1- bis 2,5-Fache); 0 = keine | s, 0 oder 0,2-30 | 0,34 / 0,5 / 1 / 1 / 0,67 | live | |
balltime | Sekunden rollender Kaktusbälle nach dem Ende; 0 = keine | s, 0 oder 10-300 | 60-90 | Ende | |
foodfrenzy | hunger | Hunger pro Sekunde | 0-0,2 | 0,025 / 0,025 / 0,05 / 0,05 / 0,05 | live |
bite | Hunger, den ein Bissen nimmt | 0-1 | 0,1 / 0,075 / 0,075 / 0,075 / 0,075 | live | |
food | Essen, das pro Sekunde je Spieler fällt | 0-6 | 3,25 / 2,5 / 2,5 / 2,5 / 2,5 | live | |
floorlava | heat | Hitzefaktor auf und nahe heißem Boden | x, 0-5 | 0,5 / 1 / 1,5 / 2 / 3 | live |
hold | Sekunden voller Glut; das Wetter wird um so viel länger | s, 1-120 | 10 | Start | |
dark | battery | Batterie der Taschenlampe in Sekunden; 0 = endlos. Mit Seconds = 0 hat TFAs eigene Batterie 90 s (ab Schwer 77 s) | s, 0 oder 5-3600 | endlos / 70 % des Wetters / 60 % / 60 % / 60 % | Start |
gaze | Sekunden ohne Licht, bis der Feldmeister dich jagt; 0 = nie. Über 0 jagt er auch auf Entspannt | s, 0 oder 3-300 | 0 / 20 / 10 / 10 / 10 | live | |
wisps | count | Irrlichter, dazu eins je Spieler ab dem dritten. Wird 7 s nach dem Start gelesen; 0 beendet das Wetter nach etwa 10 s | 0-30 | 10 / 8 / 6 / 6 / 6 | Start |
gifts | Wahrscheinlichkeit jeder Gabe | Gewichte | nach Stufe | Start | |
antigrav | rise | Wie schnell Spieler, Items und Kreaturen steigen | Einheiten/s, 0,2-5 | 1,2 | live |
quake | warn | Sekunden Warngrollen vor jedem Beben | s, 0-20 | 7 / 7 / 4 / 4 / 0 | live |
shove | Wurfstärke; 0 = Spieler fallen nur | x, 0-6 | 0 / 1 / 2 / 3 / 4 | live | |
calm | Sekunden zwischen Beben, wenn Seconds über 12 liegt (TFA nimmt das 1- bis 2-Fache) | s, 5-300 | 20 | live | |
blood | pack | Kreaturen je stehendem Spieler und Welle | 0-10 | 2-4 / 3-5 / 5-7 / 7-9 / 10 | live |
cap | Höchstzahl an Kreaturen zugleich | 0-50 | 20 / 20 / 20 / 40 / 50 | live | |
moon | every | Sekunden je Heilschluck | s, 0,25-30 | 2 | live |
amount | Heilung (oder Bonusausdauer) je Schluck | 0-0,5 | 0,025 | live | |
petrify | every | Sekunden je Steinschluck | s, 0,25-30 | 3 / 2 / 1,33 / 2 / 1 | live |
amount | Stein je Schluck | 0-0,5 | 0,05 / 0,05 / 0,05 / 0,1 / 0,1 | live | |
thunder | rain | 0 trocken, 1 leicht, 2 normal, 3 stark | 0-3 | TFA würfelt zu Beginn eines | live |
spacing | Faktor auf die 3-17 s zwischen den Blitzen | x, 0,25-10 | 2 / 1 / 1 / 1 / 1 | live | |
aim | Chance, dass ein Blitz auf einen Spieler zielt | 0-1 | 0,35 +0,05 je Spieler ab dem zweiten, höchstens 0,7; Albtraum 0,7 +0,025 je Spieler ab dem dritten, höchstens 1 | live | |
injury | Verletzung durch einen Blitz (nicht durch den Mega-Blitz) | 0-1 | 0,1 / 0,2 / 0,2 / 0,4 / 0,4 | live | |
mega | Chance auf einen Mega-Blitz | 0-1 | 0,05 / 0,05 / 0,1 / 0,1 / jeder dritte | live | |
icefog | radius | Radius der sicheren Blase um den Träger; 0 = keine Blase | Einheiten, 0-60 | 15,6 / 9,4 / 9,4 / 9,4 / 9,4 | live |
every | Sekunden je 2,5 Kälte außerhalb der Blase | s, 0,25-30 | 3 / 3 / 2 / 1 / 0,5 | live | |
watch | apart | Abstand zum nächsten Mitspieler, ab dem man als allein gilt | Einheiten, 5-200 | 40 / 30 / 25 / 20 / 20 | live |
grace | Sekunden allein, bevor er dich holt | s, 0-60 | 8 / 5 / 4 / 3 / 3 | live | |
gift | false: kein Salut und keine Gabe am Ende; true erzwingt nichts | bool | wie TFA entscheidet | Ende | |
flood | Level | Wasseroberfläche, Welthöhe (die typisierte Eigenschaft Level) | Einheiten, ±30000 | siehe Sturzflut unten | live |
rise | Sekunden bis Level; 0 = sofort da, auch ohne die 4 s Vorlauf | s, 0-120 | 15 | live | |
drain | Sekunden, die das Wasser nach dem Ende zum Ablaufen braucht | s, 0-120 | 20 | live | |
douse | Lagerfeuer und Laternen unter Wasser gehen nach 3 s aus | bool | true | Start | |
air | Sekunden Luft unter Wasser; 0 = keine Luftleiste | s, 0 oder 5-600 | 0 / 75 / 60 / 45 / 45 | live | |
area | Wasser nur in einem Quader deiner Etappe - ein See mit Ufer | Quader | überall | Start | |
tsunami | direction | Seite, von der die erste Welle kommt (die Windfahne bleibt, wie sie ist) | "left", "right" | die letzte Richtung | Start |
carry | Sekunden, die die Welle dich mitreißt | s, 0-15 | 3 / 3,5 / 4 / 5 / 10 | live | |
injury | Verletzung, wenn die Welle trifft | 0-1 | 0 / 0,2 / 0,3 / 0,4 / 0,4 | live | |
Level, speed | Wasserstand nach der Welle, Wellentempo | Einheiten, Einheiten/s | 40 unter dem nächsten Lager, 32 | Start | |
avalanche | snow | true: ein Schneebrett, das begräbt; false: Staub und Geröll | bool | TFA entscheidet je Abgang nach Ort | Start |
injury | Verletzung, wenn sie dich trifft | 0-1 | 0 / 0,15 / 0,15 / 0,15 / 0,15 | live | |
cold | Kälte, wenn der Schnee dich begräbt | 0-1 | 0,3 / 0,3 / 0,4 / 0,6 / 0,6 | live | |
speed | Wie schnell die Lawine läuft | Einheiten/s | 9-13 | Start | |
volcano | rocks | Faktor darauf, wie viele Felsen fallen | x, 0-5 | 1 / 1 / 1,25 / 1,5 / 3 | live |
injury | Verletzung durch einen Felsen | 0-1 | 0,05 / 0,15 / 0,15 / 0,15 / 0,15 | live | |
heat | Hitze durch einen Felsen | 0-1 | 0,1 / 0,1 / 0,1 / 0,25 / 0,25 | live | |
ash | Aschenebel in der zweiten Hälfte | bool | true | Start | |
hayfever | height | Scheitelhöhe eines senkrechten Niesers in Metern; der Stoß wächst mit, in der Luft x1,5, auf ebenem Boden mit kleinem Hopser. Im Albtraum hebt dich ein Niesen nie an | m, 0-20 | 5 / 9 / 13 / 17 / 17 | live |
least | Kürzeste Zeit zwischen zwei Nieser | s, 1-60 | 4 / 4 / 4 / 4 / 4 | live | |
most | Längste Zeit zwischen zwei Nieser (jeder würfelt für sich) | s, 1-120 | 20 / 20 / 20 / 20 / 20 | live | |
shockfrost | every | Sekunden je Kältebiss beim Klettern am Fels | s, 0,1-10 | 2 / 1 / 1 / 0,5 / 0,5 | live |
cold | Kälte je Biss (in Schritten von 0,025) | 0-1 | 0,025 / 0,025 / 0,025 / 0,025 / 0,05 | live | |
slip | Chance pro Sekunde, beim Sprinten auszurutschen; 1 = jedes Sprinten rutscht | 0-1 | 0,1 / 0,1 / 0,3 / 0,5 / 1 | live | |
fall | Kälte durch einen Sturz nach dem Ausrutschen (in Schritten von 0,025); das Einbrechen ins Wasser kostet die Hälfte | 0-1 | 0,05 / 0,1 / 0,15 / 0,2 / 0,3 | live | |
slide | Dauerhafter Zug nach unten an vereistem Fels, wie bei rain; läuft nur, wenn du ihn setzt (standardmäßig ersetzen ihn die Wandrutscher) | -2 bis 0 | aus | live | |
wallslip | Chance pro Sekunde Klettern am vereisten Fels, die Wand hinunterzurutschen (ein Wurf pro Sekunde) | 0-1 | 0,1 / 0,1 / 0,15 / 0,2 / 0,3 | live | |
slipfor | Dauer eines Wandrutschers | s, 0,05-2 | 0,25 | live | |
slipspeed | Spitzentempo eines Wandrutschers; 3 = so schnell wie Runterklettern | 0-10 | 3 | live |
Jedes Wetter nimmt außerdem Seconds, Warn und Tier, und Sound und
Harm, wo die Wetter sie nennen.
Beispiel: ein See zum Schwimmen
TFAs Sturzflut ist echtes Wasser. Die Spieler schwimmen mit Leertaste, tauchen und klettern heraus, sehen und hören die Welt unter Wasser. Mit eigenen Werten wird sie zu einem ruhigen, lautlosen See, der bleibt, bis du ihn stoppst.
Die Idee: Deine Etappe beginnt am Ufer eines Sees. Das Start-Lagerfeuer steht auf einem Felsen knapp über dem Wasser, und der Weg nach oben beginnt mit einem Schwimmstück.
private static bool _lake;
private static float _level;
private static void OnPlayersHere(TfaBiomeSlot slot, bool here)
{
if (!CrystalCavesPlugin.TfaWeatherReady || !slot.OwnWeatherAllowed)
{
return;
}
_lake = here;
_level = slot.StartPoint.y - 2f; // world height of the surface: 2 units below the start campfire
if (here)
{
KeepLake();
}
else
{
TfaWeather.Stop("crystalcaves"); // the lake drains in 8 s (see "drain")
}
}
// Call it from OnPlayersHere and again about once a second from your Update while _lake is set. The same call answers
// Unchanged and writes nothing; if another mod's weather was in the way (Busy), the lake gets in as soon as it ends.
private static void KeepLake()
{
TfaWeather.Start("crystalcaves", "flood", new TfaWeatherParams
{
Level = _level,
Seconds = 0f, // until stopped
Sound = false, // no roar of rising water, no surge
Harm = false, // no air bar, no drowning
}
.With("rise", 0f) // already full when the players arrive
.With("drain", 8f)
.With("douse", false)); // the water may later rise over the start campfire without putting it out
}
Was passiert, bei jedem Spieler:
- Der Host schreibt das Wetter samt deinen Werten in den Raum. Gäste übernehmen es innerhalb von etwa einer Sekunde; wer später dazukommt, bekommt es auch.
- Das Wasser steht sofort auf
Level. Alles unterhalb dieser Höhe liegt unter Wasser. - Unter Wasser schwimmen die Spieler, sinken langsam und nehmen keinen Fallschaden. Klettern geht mit halbem Tempo, das Bild
wird blaugrün und andere Geräusche klingen gedämpft. Lose Gegenstände treiben und sinken langsam. Mit
Harm = falsegeht niemandem die Luft aus. - Zündet die Gruppe das Lagerfeuer am Ende deiner Etappe, stoppt
PlayersHere(slot, false)den See, und das Wasser sinkt in 8 s ab.
Bedenke:
- Das Wasser hat noch kein Ufer. Es ist ein Meeresspiegel: Alles in der Welt unterhalb von
Levelliegt unter Wasser - deine Etappe, die Etappen darunter und der Strand. Leg deinen See an den Fuß deiner Etappe, wo das gewollt ist.area(ein See, begrenzt auf einen Quader deiner Etappe) ist geplant. - Liegt
Levelüber dem Start-Lagerfeuer, kommen die Spieler unter Wasser an, und das Lagerfeuer geht nach 3 s aus, außer du fügst.With("douse", false)zum ersten Aufruf hinzu -douseist ein Start-Wert, ein späteres Update kann ihn nicht ändern. - Soll Tauchen zählen? Lass
Harman und setze die Luft:.With("air", 40f)gibt 40 s unter Wasser auf jeder Stufe. - Im Apokalypse-Modus würfeln die Würfel neben deinem See weiter. Die Gruppe Wasser (Sturzflut, Tsunami, Antigravitation) bleibt weg, solange der See steht; alles andere läuft, und Schwimmer sind dagegen immun.
- Ist der See ein Weg, den die Gruppe schwimmen muss? Hält das Wetter einer anderen Mod den Platz, antwortet dein Start mit
Busy, bis es endet - der wiederholte Aufruf oben bringt den See hinein, sobald das vorbei ist.
Weitere Beispiele
Stufe und Werte zusammen. Ein kurzes, fieses Gewitter für den Endspurt: Brutal, Starkregen, aber keine Mega-Blitze, und ein Blitz kostet 30 % statt der 40 % von Brutal:
TfaWeather.Start("crystalcaves", "thunder", new TfaWeatherParams { Seconds = 60f, Tier = 4 }
.With("rain", 3)
.With("mega", 0f)
.With("injury", 0.3f));
Ein sanfter erster Schneesturm. Entspannt, und die Kälte beißt nur alle 3 s:
TfaWeather.Start("crystalcaves", "snow", new TfaWeatherParams { Seconds = 40f, Tier = 1 }.With("every", 3f));
Das Wasser steigen lassen, während es steht - derselbe Owner, dasselbe Wetter, neue Live-Werte. Das Ergebnis ist
Updated:
_level = slot.StartPoint.y + 10f; // so the repeated KeepLake keeps the new height
TfaWeather.Start("crystalcaves", "flood", new TfaWeatherParams
{
Level = _level, Seconds = 0f, Sound = false, Harm = false,
}.With("rise", 20f).With("drain", 8f)); // up 12 units within 20 s; douse stays as the lake started it
douse ist ein Start-Wert, also setzt der See ihn schon im ersten Aufruf. drain steht noch
einmal dabei, weil ein Live-Wert, den du bei einem Update weglässt, auf seinen Standard zurückfällt.
Ein Blutmond, der nur wenige Kreaturen bringt - zu jeder Tageszeit:
// Day or night, it doesn't matter: the clock moves to midnight while the blood moon runs and goes back afterwards.
TfaWeather.Start("crystalcaves", "blood", new TfaWeatherParams { Seconds = 90f }
.With("pack", 1).With("cap", 6));
Auf TFAs Wetter reagieren. In jedem Modus, Apokalypse eingeschlossen, bei jedem Spieler:
TfaWeather.Changed += change =>
{
// Dice and mod weather can run at once, so ask for the state instead of reading change.To.
CrystalGlow.Dimmed = TfaWeather.IsRunning("dark"); // your crystals dim while darkness runs, whoever started it
};
Deine eigenen Fackeln erlöschen unter TFA-Wasser:
if (TfaWeather.IsUnderWater(torch.position)) torch.Snuff();
Übersicht
TfaWeather
int ApiVersionAPI-Stufe; 1 für diese Seite. Lies sie zur Laufzeit. Wer sie liest, sagt TFA damit auch, dass eine Mod sein Wetter nutzt.string CurrentSchlüssel von TFAs eigenem laufenden Wetter (Würfel, F9-Menü, Geisterwahl), "" wenn keins. Bei allen Spielern gleich, auf eine Sekunde genau.string ModWeatherSchlüssel des Wetters, das über diese API gestartet wurde, "" wenn keins.string ModOwnerDie Owner-Id dieses Wetters, "" wenn keins.bool IsRunning(string key)Läuft dieses Wetter, in einem der beiden Plätze?bool IsUnderWater(Vector3 point)Liegt dieser Punkt gerade unter TFA-Wasser (Sturzflut, Tsunami)?event Action<TfaWeatherChange> ChangedBei jedem Spieler, gleich nachdem dort ein Wetter gewechselt hat - für jedes Wetter, TFAs eigene eingeschlossen. Ein Ereignis je Platz; ein Werte-Update ohne Wetterwechsel löst keins aus.TfaWeatherResult Start(string owner, string key, TfaWeatherParams values = null)Startet ein Wetter oder gibt deinem laufenden eine neue Stufe oder neue Live-Werte. Nur der Host handelt. Ein anderer Schlüssel ersetzt dein laufendes Wetter (seine Nachwirkung spielt) und verwirft eine Ankündigung von dir, die noch zählt; die Antwort ist Started.TfaWeatherResult Stop(string owner)Stoppt das Wetter, das owner gestartet hat. Manche Wetter hinterlassen etwas, wenn sie enden (siehe die Wetter). Funktioniert auch nach einem Sieg.Current, ModWeather, ModOwner und IsRunning geben an, was auf diesem Rechner
angewandt ist. Start und Stop kannst du bei jedem Spieler und so oft aufrufen, wie deine Logik will.
Bei Gästen passiert nichts. Läuft dasselbe Wetter schon mit derselben Stufe und denselben Werten, wird nichts geschrieben; Aufrufe
kurz hintereinander werden zusammengelegt, der letzte gewinnt innerhalb einer Sekunde. Dein Changed-Handler läuft
mitten in TFAs Wetterschritt, halte ihn also kurz; eine Ausnahme darin wird abgefangen und einmal je Handler geloggt.
TfaWeatherParams
Alles ist optional. Was du weglässt, entscheidet TFA wie immer.
| Eigenschaft | Typ | Standard | Bedeutung |
|---|---|---|---|
Seconds | float? | TFAs eigene Dauer für dieses Wetter und diese Stufe | 0 = bis du es stoppst. Höchstens 3600. |
Tier | int? | Apokalypse-Modus: die Stufe des Laufs; sonst Normal | Schwierigkeit 1-5: Entspannt, Normal, Schwer, Brutal, Albtraum. Siehe Schwierigkeit. |
Warn | bool? | wie TFA auf dieser Stufe | Das Banner oder der Klang 3 s vor dem Start. false: keins, und es startet sofort (watch behält seinen Vorlauf von 10 s). true bringt die Warnung zurück (das Banner, bei foodfrenzy das Knurren) bei blood, petrify, tsunami, floorlava, foodfrenzy und watch; bei jedem anderen Wetter wird es ignoriert und geloggt. |
Sound | bool | true | false: keine Gefahrengeräusche. Wirkt bei sun, quake, flood, tsunami, avalanche, volcano, shockfrost und hayfever, sonst wird es ignoriert und geloggt. Rückmeldungen wie Platschen und Schwimmzüge bleiben. |
Harm | bool | true | false: das Wetter verletzt niemanden, auf jeder Stufe. Wirkt bei 26 der 28 Wetter; blood und cactusrain ignorieren es und loggen (nimm pack = 0 oder balls = 0). Was es je Wetter heißt: die Wetter. |
Level | float? | TFAs Regel | Welthöhe in Einheiten. API-Stufe 1: die Wasseroberfläche der Sturzflut; sonst ignoriert. |
Values | Dictionary<string, object> | leer | Benannte Werte, siehe Werte. With(name, value) fügt einen hinzu und gibt das Objekt zurück. |
TfaWeatherResult
| Wert | Bedeutung |
|---|---|
Started | Für alle geschrieben. Mit Warnung beginnt das Wetter 3 s später. Auch die Antwort, wenn deins ein kollidierendes Würfelwetter übernommen hat. |
Updated | Dein Wetter hat eine neue Stufe oder neue Live-Werte bekommen - das Wasser fährt zum Beispiel zum neuen Pegel. |
Unchanged | Dasselbe Wetter läuft schon mit dieser Stufe und diesen Werten, oder es haben sich nur Start-Werte geändert. Stoppe es und starte es neu. |
Stopped | Dein Wetter endet für alle; seine Nachwirkung spielt. |
NothingToStop | Du hast nichts laufen. Ein Wetter von TFA oder einer anderen Mod ist nicht deins zum Stoppen. |
NotHost | Du bist Gast. Der Aufruf des Hosts erreicht dich trotzdem. |
NotAllowed | Nicht in einem Lauf oder im Flughafen (Titelbild, Laden), die Tageskarte, oder der Lauf ist vorbei (verloren oder Endbildschirm). Die Logzeile sagt, was. |
UnknownWeather | Kein Wetter mit diesem Schlüssel in diesem TFA. |
WrongTime | Reserviert. TFA 2.10.0 gibt ihn nie zurück: Ein Nacht- oder Tagwetter stellt stattdessen die Uhr. Der Wert bleibt, damit Mods für API-Stufe 1 weiter kompilieren. |
Unavailable | Reserviert. TFA 2.10.0 gibt ihn nie zurück: Jedes Wetter lässt sich überall zum Laufen bringen. Der Wert bleibt, damit Mods für API-Stufe 1 weiter kompilieren. |
Busy | Das Wetter einer anderen Mod läuft oder ist angekündigt; oder ein Würfel-Pilzregen oder -Kaktusregen, eine Mini/Mega-Phase oder eine Kaktusball-Phase steht shroomrain oder cactusrain im Weg. Versuch es später noch einmal. |
BadOwner | Die Owner-Id besteht nicht aus 2-24 Kleinbuchstaben oder Ziffern. |
TfaWeatherChange
From, ToDie Wetter-Schlüssel davor und danach, "" = keins.Owner"" = TFA selbst (Würfel, Menü, Geisterwahl), sonst die Owner-Id einer Mod.ByModOwner.Length > 0.Die Wetter
Die Schlüssel ändern sich nie; es sind dieselben wie in TfaBiome.Weathers (siehe den Reiter
Biome). Werte je Wetter: siehe Werte.
| Schlüssel | Name | Uhr | Klang aus | Harm aus | Wenn es endet |
|---|---|---|---|---|---|
storm | Sturm | beliebig | - | kein Schub, kein Griff-Malus (Kulisse) | - |
rain | Regen | beliebig | - | kein Ausrutschen, kein Loslassen, nasser Fels zieht nicht | - |
snow | Schneesturm | beliebig; verstellt die Uhr nie; nachts außerhalb einer Alpen-Etappe gestartet hält er die Nacht | - | keine Kälte | - |
sand | Sandsturm | beliebig | - | keine Blindheit, keine Ohnmacht, kein Bremsen | - |
sun | Brennende Sonne | beliebig; stellt die Uhr auf Mittag und hält sie an | Brausen | keine Hitze | - |
sleepfog | Schlafnebel | beliebig | - | keine Müdigkeit | - |
spores | Sporenwolke | beliebig | - | keine Sporen, danach keine Zombies | Pilzzombies stehen auf (zombies) |
poison | Giftnebel | beliebig | - | kein Gift, danach keine Knallpilze | ein Feld aus Knallpilzen (mushrooms) |
shroomrain | Pilzregen | beliebig | - | keine Stiche und Würfe (die Größenänderung bleibt) | Schlussknall, alle werden Mini oder Mega (size) |
cactusrain | Kaktusregen | beliebig | - | nicht angeboten (nimm balls = 0) | rollende Kaktusbälle (balltime) |
foodfrenzy | Fress-Fiesta | beliebig | - | kein Hunger; Essen ohne Gift- oder Dynamitschaden | das Essen fällt noch 3 s, liegt dann 10 s |
floorlava | Der Boden ist Lava | beliebig | - | keine Hitze, kein Tod, kein Verkohlen | eigener Ablauf, etwa 20 s (hold) |
dark | Finsternis | beliebig | - | kein Dösen, keine Jagd | - |
wisps | Irrlichter | beliebig | - | keine schlechten Gaben | endet von selbst, wenn das letzte Irrlicht geholt ist |
antigrav | Antigravitation | beliebig | - | der Auftrieb bleibt; kein Ausdauerverlust, kein Deckenstoß, weiche Landung | - |
quake | Erdbeben | beliebig | Grollen und Knall | niemand fällt, fliegt oder verliert etwas | eigener Ablauf: 12 s = ein Beben |
blood | Blutmond | beliebig; stellt die Uhr auf Mitternacht und hält sie an | - | nicht angeboten (nimm pack = 0) | Kreaturen werden zu Skeletten oder verschwinden |
moon | Blauer Mond | beliebig; stellt die Uhr auf Mitternacht und hält sie an | - | keine Müdigkeit und kein Stein (die Heilung bleibt) | - |
petrify | Versteinernde Sonne | beliebig; stellt die Uhr auf Mittag und hält sie an | - | kein Stein | - |
thunder | Gewitter | beliebig | - | niemand wird getroffen, keine Mega-Heilung | - |
icefog | Eisnebel | beliebig | - | keine Kälte | - |
watch | Wacht des Feldmeisters | beliebig; der Host bringt den Feldmeister mit, auch wenn der Lauf keinen hat | - | er jagt niemanden | Salut und eine Gabe (gift) |
flood | Sturzflut | beliebig | Rauschen und Schwall | keine Luftleiste, kein Ertrinken, keine Extra-Müdigkeit | das Wasser läuft ab (drain) |
tsunami | Tsunami | beliebig | Wellenklänge | die Welle reißt niemanden mit | eigener Ablauf: Welle, dann läuft das Wasser ab |
avalanche | Lawine | beliebig | Grollen und Donner | trifft niemanden | eigener Ablauf, 90 s |
volcano | Vulkanausbruch | beliebig; ohne Kiln bricht er vor der Gruppe aus | Ausbruch, Felsen | Felsen und Asche ohne Wirkung | - |
shockfrost | Schockfrost | beliebig | Klimpern, Knacken, das Bersten | keine Kälte, kein Rutschen, keine Stürze (Eis, eingefrorene Fallen und Zerbersten bleiben) | 4 s Knacken, dann birst das Eis und taut 3 s lang |
hayfever | Pollenflug | beliebig | Schniefen, Luftholen und Niesen | kein Niesstoß (Pollendunst und Klänge bleiben) | das Niesen hört sofort auf |
Eigener Ablauf: Diese Wetter spielen einen festen Verlauf. Seconds entscheidet nur, wann das Wetter als
vorbei gilt und das nächste starten darf; eine Welle oder Lawine, die begonnen hat, läuft zu Ende.
Hält die Uhr an: Tag oder Nacht stehen still, solange das Wetter läuft. Ein Nachtwetter mit Seconds = 0
hält die Nacht, bis du es stoppst. Passt die Tageszeit nicht, stellt sich die Uhr erst auf Mitternacht (blood,
moon) oder Mittag (sun, petrify) und geht am Ende des Wetters dorthin zurück, wo sie war.
Warnungen: blood, petrify, tsunami und floorlava haben ein Banner,
foodfrenzy ein Knurren, und watch beginnt mit 10 s Vorlauf und einem eigenen Banner. Ob sie
erscheinen, hängt von der Stufe ab (siehe Schwierigkeit), außer bei watch, dessen
Banner auf jeder Stufe erscheint; Warn entscheidet es für dich. Warn = false heißt kein Banner und, bei blood,
petrify, tsunami, floorlava und foodfrenzy, kein Vorlauf (die Lava glüht nach
0,5 s statt nach 3 s); watch behält seinen Vorlauf von 10 s und verliert nur das Banner.
Harm aus: Was Harm = false bewirkt, steht in der Tabelle. Es wirkt bei 25 Wettern. Unter Wasser hält dieselbe
Pforte die Figur aus anderen Wettern heraus (siehe oben).
Schockfrost (shockfrost): Es hat kein Banner; das 6 s lange Einblenden ist die Warnung, und Seconds enthält es. Am Ende
(vorher 4 s Knacken) oder nach Stop birst das Eis und taut 3 s lang; Lava und Wasser bleiben bis dahin fest, ein
nachfolgendes Wetter startet also erst nach dem Tauen. Harm = false schaltet alles aus, was die Spieler trifft
(Kälte, Rutschen, Stürze); Eis-Look, eingefrorene Fallen, gefrorene Lava und gefrorenes Wasser und zerbrechende Items bleiben.
flood - Sturzflut
| Wert | Typ | Standard | Bereich | Wann | Bedeutung |
|---|---|---|---|---|---|
Level | float | 15 Einheiten unter dem End-Lagerfeuer der aktuellen Etappe (Düsternis/Caldera: 50 darüber, Kiln/Zitadelle: 15 unter dem Gipfel) | ±30000 | live | Wasseroberfläche, Welthöhe in Einheiten. |
rise | float | 15 | 0-120 | live | Sekunden bis Level. 0 = sofort da, auch ohne die 4 s Vorlauf. |
drain | float | 20 | 0-120 | live | Sekunden, die das Wasser nach dem Ende zum Ablaufen braucht. |
air | float | je Stufe: keine / 75 / 60 / 45 / 45 | 0, 5-600 | live | Sekunden Luft unter Wasser. 0 = keine Luftleiste. |
douse | bool | true | Start | Lagerfeuer und Laternen unter Wasser gehen nach 3 s aus. | |
Sound = false | live | Kein Rauschen beim Steigen und Ablaufen, kein Schwall. Das Brummen unter Wasser, Platschen, Schwimmzüge und Blasen bleiben. | |||
Harm = false | live | Keine Luftleiste, kein Ertrinken, keine Extra-Müdigkeit unter Wasser. |
TFAs eigene Flut endet, wenn jemand ein Lagerfeuer entzündet. Eine Flut, die du startest, nicht: Sie läuft, bis Stop
oder Seconds sie beendet. Um sie während des Laufs zu ändern, ruf Start mit neuen Live-Werten noch
einmal auf: Das Wasser fährt innerhalb von rise Sekunden zum neuen Level. Senkst du das Wasser, kommt
verborgenes Vanilla-Wasser nicht zurück. Ohne Level gilt TFAs Regel, auf jedem Rechner für sich; wo es kein
Lagerfeuer zum Zielen gibt (Flughafen), legt der Host den Pegel beim Start fest: 3 Einheiten über dem tiefsten lebenden Spieler.
Mehrspieler
- Ruf es überall auf.
PlayersHereund deine eigenen Auslöser laufen bei jedem Spieler. Mach bei allen denselben Aufruf; nur der des Hosts zählt. Wetter aus Code, der nur bei einem Gast läuft, bewirkt nichts. WerStartbei jedem Spieler aufruft, macht TFA außerdem deine Owner-Id auf jedem Rechner bekannt - siehe „Host geht“. - Stufe und Werte kommen vom Host. TFA schickt sie mit dem Wetter. Berechne keinen Wert aus Dingen, die sich zwischen Spielern unterscheiden, etwa Spielerpositionen oder Physiktreffer. Die Geometrie deiner Etappe, ihre Lagerfeuer und der Slot sind überall gleich.
- Nachzügler bekommen das Wetter im aktuellen Zustand, mit Stufe und Werten: der See schon voll, der Sturm schon halb durch. Auch ein Wetter in seiner Nachwirkung bekommen sie. Banner, die schon liefen, sehen und Starts, die schon geschahen, hören sie nicht.
- Während der Berg baut, oder bevor die Figur eines Spielers existiert, antwortet
StarttrotzdemStarted. Das Wetter beginnt auf jedem Rechner, sobald TFA dort bereit ist. - Host geht: Der nächste Host übernimmt; Dauer, Owner, Stufe und Werte bleiben im Raum. Eine Warnung, die noch zählte, geht verloren; dein nächster Aufruf startet das Wetter neu. Hat der neue Host nie einen Aufruf mit deiner Owner-Id gesehen - dort fehlt die Mod -, endet das Wetter nach 15 s, und TFA loggt es.
- Continue (Schnellspeicher): Ein laufendes Wetter wird nicht gespeichert. Nach dem Laden meldet
PlayersHeredeine Etappe wieder, und dein Aufruf startet es erneut. - Lauf vorbei: Ein verlorener Lauf beendet dein Wetter. Nach einem Sieg bleibt es als harmlose Kulisse auf dem
Endbildschirm, wie TFAs eigenes;
Stopgeht dann noch,StartantwortetNotAllowed. - Szenenwechsel: Ein im Flughafen gestartetes Wetter endet, wenn der Lauf lädt; nichts wird von einer Szene in die nächste mitgenommen.
- Versionen: Alle Spieler brauchen dieselbe TFA-Version (TFA prüft das). Gäste brauchen deine Mod nicht, um TFAs Wetter zu sehen; dein Biom selbst ist eine andere Geschichte.
Gut zu wissen
- Statistik und Abzeichen: siehe „Statistik“ unter Neben TFAs Würfeln: Dein Wetter zählt nie.
- PEAKs eigenes Wetter einer Etappe läuft weiter. TFAs Sturm, Regen, Schneesturm und Sandsturm halten PEAKs Windzonen
still, solange sie wehen. Dein
sunersetzt die heiße Sonne der Mesa, solange es läuft, sodass nur deine Werte gelten. Ansonsten schaltet TFA PEAKs Wetter außerhalb des Apokalypse-Modus nicht ab; ein Biom lässt das Wetter seines Rahmens mitDropFromFrameweg. Im Apokalypse-Modus ruht TFAs dauerhafte Mesa-Sonne, solange deinsun,petrifyoderdarkläuft, und 90 s danach. - Sauerstoffflaschen in Koffern gibt es nur im Apokalypse-Modus. Die Luftblasen aus Koffern unter Wasser funktionieren in jedem Lauf.
- Himmel: Mehrere Wetter färben den ganzen Himmel und die Sonne, ausgehend vom Himmel deiner Etappe
(
slot.Sky). - Unter Wasser legt TFA einen Tiefpassfilter auf jede Klangquelle der Szene, deine eingeschlossen; Stimmen, Musik und
die Oberfläche bleiben klar. Wasserflächen, deren Shader-Name „Water“ enthält und die ganz unter
Levelliegen, werden ausgeblendet, solange das Wasser steht. - Lose Physikobjekte in Kameranähe treiben und sinken in TFA-Wasser langsam. Mach Requisiten kinematisch, wenn sie liegen bleiben sollen.
Versionen
ApiVersionsteigt, wann immer etwas dazukommt. Bestehende Mitglieder, Wetter-Schlüssel und Wertnamen ändern nie ihre Bedeutung.- Werte sind benannt, nicht typisiert, daher läuft eine Mod für ein neueres TFA auch in einem älteren: Das ältere TFA ignoriert Namen, die es nicht kennt, und loggt sie. Neue Werte kommen ohne neue API-Stufe in den Katalog.
Geplant
- Die kursiven Zeilen oben:
areafür die Flut (ein See mit Ufer),Levelfür Tsunami und Schlafnebel,speed,ash,density,sight,gifts. SoundundHarmfür mehr Wetter.- Einzelereignisse ohne den Wetter-Platz: ein Blitzschlag, ein Lavafels oder eine Versorgungskiste an einem Punkt.
Fragen oder Wünsche an die Schnittstelle? Schreib CptPICHU auf dem PEAK-Modding-Discord.
在你的模组里使用 TFA 的天气
True Final Ascent 自带 28 种天气:风暴、迷雾、血月、地震、可以游泳的山洪、海啸、火山爆发等等。通过
TfaWeather,你的模组可以在任何攀登中(无论是否末日模式)启动和停止它们,选择它们的难度,并设定单个数值。
- 启动和停止28 种天气中的任何一种,想持续多久都行。
- 选择难度。
Tier1-5 会让天气像 TFA 末日模式的轻松、普通、困难、残酷、噩梦难度那样运行。玩家为此不需要开启末日模式,他们的末日设置也不会被改动。 - 设定单个数值。每种天气都有带名称的数值——风暴的推力、山洪的水位和氧气、血月的怪物数量。用
With(name, value)设定。每个数值只覆盖难度中的那一个数字。 - 跟踪天气:在每位玩家处通过
Current、ModWeather和Changed事件,任何模式下都可以。 - 房主说了算。在每位玩家处做同样的调用。只有房主的调用会起作用;TFA 会把天气连同难度和数值带给所有人,包括中途加入的玩家。
- 与 TFA 的随机并行。在末日模式下,你的天气与 TFA 自己的天气一起运行。两者冲突时,由你的接管。
- 同一时间只有一种模组天气。这个接口位置由所有模组共用:谁启动天气,天气就归谁;你只能修改或停止自己的天气,在你的天气结束之前,别的模组会得到
Busy。
设置
像地貌接口那样引用 TFA(TrueFinalAscent.dll,Private=false;见地貌标签页),并声明软依赖。只有在安装了
TFA 且版本足够新时才接触 TfaWeather:TFA 2.10.0 是第一个带它的版本。旧版 TFA 里没有这个类型,第一次接触就会抛出异常。
<Reference Include="TrueFinalAscent">
<HintPath>...\BepInEx\plugins\CptPICHU-TrueFinalAscent\TrueFinalAscent.dll</HintPath>
<Private>false</Private>
</Reference>
using System;
using System.Runtime.CompilerServices;
using BepInEx;
using BepInEx.Bootstrap;
[BepInPlugin("you.crystalcaves", "Crystal Caves", "1.0.0")]
[BepInDependency("com.CptPICHU.peak.truefinalascent", BepInDependency.DependencyFlags.SoftDependency)]
public class CrystalCavesPlugin : BaseUnityPlugin
{
internal static bool TfaWeatherReady;
private void Awake()
{
// Touch TfaWeather only when TFA 2.10.0 or newer is installed: on an older TFA the type is missing, and the first
// touch throws. Without TFA your mod keeps working as before.
if (Chainloader.PluginInfos.TryGetValue("com.CptPICHU.peak.truefinalascent", out PluginInfo tfa)
&& tfa.Metadata.Version >= new Version(2, 10, 0))
{
TfaWeatherReady = TfaWeatherBridge.ApiLevel() >= 1;
}
}
}
internal static class TfaWeatherBridge
{
// In its own class and never inlined: otherwise .NET may resolve TFA's type when Awake compiles, before your check runs.
[MethodImpl(MethodImplOptions.NoInlining)]
internal static int ApiLevel() => TrueFinalAscent.Api.TfaWeather.ApiVersion;
}
在 Awake 里读取 ApiVersion 也会告诉 TFA 有模组在使用它的天气。如果这发生在房主的电脑上,TFA
会在每次攀登开始时加载较重的天气(血月怪物、海啸、雪崩、火山、漆黑追猎),这样在你启动之前,所有玩家处都已准备好。
快速上手
using TrueFinalAscent.Api;
// On every player. On the host it starts 60 s of rain; on guests it returns NotHost, and the host's rain reaches them.
TfaWeather.Start("crystalcaves", "rain", new TfaWeatherParams { Seconds = 60f });
// The same rain on Hard, but nobody slips: the tier sets everything, the value overrides one number.
TfaWeather.Start("crystalcaves", "rain", new TfaWeatherParams { Seconds = 60f, Tier = 3 }.With("slip", 0f));
// Later, also on every player: stops the weather "crystalcaves" started.
TfaWeather.Stop("crystalcaves");
第一个参数是你的所有者标识(owner id):2-24 个小写字母或数字——规则与地貌标识相同,所以地貌模组直接用它的地貌标识。TFA 靠它知道是谁的天气在运行。
Start 和 Stop 会返回发生了什么(见 TfaWeatherResult)。只有
Started、Updated 和 Stopped 改变了东西;其他结果都保持天气原样,并写一行说明原因的日志(同一种情况最多每 10 秒一行)。
规则
在哪里运行
| 攀登 | 你的天气 |
|---|---|
| 普通攀登、积木、自定义攀登 | 会运行。TFA 在那里不启动自己的天气,所以天气归你。 |
| 末日模式 | 与 TFA 的随机并行运行:可以同时有两种天气,一种来自随机,一种来自你。两者冲突时,由你的接管。见与 TFA 的随机并行。 |
| 机场(大厅) | 也会运行,纯属好玩:候机大厅就是舞台。需要山体的天气会尽力围绕玩家运行(见随处、随时)。PEAK 自己在机场里不让任何状态生效——没有受伤、寒冷、炎热或困倦——所以那里的天气只会抛飞玩家、让人掉落物品和吓人,不会伤人。在机场启动的天气会在攀登加载时结束。 |
| 每日地图 | NotAllowed。每日地图永远不会被改动。在地貌里只有当 slot.OwnWeatherAllowed 为 true 时才启动(见地貌标签页);在那里它为 false。 |
| 标题画面、加载中、已失败的攀登、胜利后的结算画面 | NotAllowed。已经在运行的天气遵循多人联机里的规则。 |
随处、随时
你的调用会忽略 TFA 随机遵循的规则。没有对地点、地貌、时间、模式或攀登设置的检查:28 种天气中的任何一种都能在任何路段(包括模组地貌和积木)、PEAK 自己的地图、仙人掌球模式中运行,也包括本次攀登关闭了侦察长的情况。结果码 WrongTime 和 Unavailable 不会再返回。
- 时间。夜晚天气(
blood、moon)在白天启动时,会在运行期间把时钟拨到午夜;白天天气(sun、petrify)在夜里启动时拨到正午。天气会让时钟停住,结束时把它还回去。暴雪(snow)从不移动时钟。 - 侦察长。
watch和dark:即使本次攀登没有侦察长,房主也会带一个来;守望不再在熔炉、雾沼、城塞和天底里沉睡。 - 没有山体可瞄准。没有熔炉时,火山在队伍前方喷发;没有营火时,雪崩、山洪和海啸以玩家为目标。各天气在没有山体时——以及在机场里——的表现列在下面。
| 天气 | 没有山体时、在机场里 |
|---|---|
storm | 随处可用。在机场里没有飞舞的风带(只有雾霾、天空、推力和声音)。 |
rain | 随处可用。地面的湿润光泽需要地图上有 PEAK 的降雨装置(机场里没有)。 |
snow | 任何地貌、任何时间;从不移动时钟。在机场里是否有遮蔽由朝天射线决定。 |
thunder | 随处可用。在机场里闪电会落在任何坚实地面上,而屋顶和岩石检查只看得到 Terrain/Map,所以闪电可能劈中室内的玩家。避雷针徽章只在攀登中计数。 |
sun | 把时钟拨到正午。在机场里只有视觉效果:PEAK 在那里不让炎热生效。 |
petrify | 把时钟拨到正午。在机场里只有视觉效果:PEAK 在那里不让石化生效。 |
moon | 把时钟拨到午夜。在机场里屋顶不提供遮蔽。 |
blood | 把时钟拨到午夜。怪物来自地图上的模板;在机场里只有蘑菇僵尸会来(前提是能加载),红色天空总会出现。 |
sleepfog | 随处可用。在机场里没有雾沼的光照,只有色调和雾层;早起虫落在玩家附近看得见的地面上。 |
icefog | 在缺少 PEAK 雾球的地方(机场、关闭了雾的攀登),气泡不带雾也能工作;粒子墙标出边缘。 |
spores | 僵尸会在云结束的地方爬起(包括机场),但如果云是被场景切换结束的就不会。 |
poison | 爆炸菇需要山体里的模板;在机场里,只有本次游戏中已经在攀登里出现过毒雾时才会长出来。 |
wisps | 数量、礼物和光亮随处可用;在机场里鬼火出现在玩家附近、他们的视线之内。 |
shroomrain | 随处可用。在机场里:浆果雨、最后的爆破和体型阶段,但没有弹跳蘑菇。 |
cactusrain | 在仙人掌球模式中也能运行(之后不再有额外的球阶段)。在机场里:只有球,没有仙人掌和蝎子。 |
foodfrenzy | 随处可用。在机场里:饥饿和食物雨,没有花园。 |
floorlava | 随处可用。在机场里大厅地板、停机坪和跑道会发光;家具是安全的立足点。 |
dark | 随处可用;即使本次攀登没有侦察长,房主也会带一个来。在机场里追猎以抛飞或提灯结束,音乐会被静音。 |
watch | 随处可用,且不理会地点;即使本次攀登没有侦察长,房主也会带一个来。在机场里他会跳到玩家附近的地面点;噩梦天空需要有天底。 |
antigrav | 随处可用;在室内(机场大厅)玩家会升到屋顶。噩梦难度下碰到顶部会受伤,但在机场里不会,因为 PEAK 在那里阻止一切状态。 |
quake | 随处可用,包括机场;腾空的玩家(离地 3 米以上)不受影响。 |
flood | 不设 Level 且没有营火可瞄准时(机场),由房主在开始时定下水位:比最低的存活玩家高 3 单位。 |
tsunami | 浪沿着世界 X 轴从队伍旁掠过。没有营火时,浪后的水位比最低的玩家高 2 单位。 |
avalanche | 从下一处营火后方开始;没有营火时从队伍前方开始(机场:沿着大厅)。是雪还是尘土取决于地貌,或取决于 snow。 |
volcano | 没有熔炉时,在队伍前方约 250 米处喷发;落石、巨响、灰烬和难度照常生效。在机场里落石只会把玩家砸倒。 |
shockfrost | 随处可用,包括普通攀登和机场。路段上有岩浆和水的地方会结冰;冰的外观、打滑、寒冷、冻结的物品和陷阱在任何地方都有效。Stop 之后融化需要 3 秒,在此之前岩浆和水面保持冻结。 |
谁说了算
对于天气用到的每个数字,TFA 按这个顺序查找:
Harm = false——无论你还设了什么,这种天气都不会伤害任何人。- 你用
With(name, value)设定的数值(如果设了)。 - 你的
Tier。 - 没有设置
Tier:末日模式下是这次攀登的难度(不含幽灵投票),其他情况一律是普通。
难度和数值只影响你的天气。你的天气旁边的随机天气保持这次攀登的难度;玩家的末日难度和 TFA 的统计都保持原样。
实时还是开始时。用同一个所有者和天气再次调用 Start,就能在天气运行时修改它。数值表里标为实时的数值会立刻生效(Updated);房主立刻就有,客人在一秒内。标为开始时的数值以及
Seconds 和 Warn 只对全新的启动生效;如果只有这些变了,你会得到 Unchanged 和一行日志——请先停止再启动。Tier、Sound、Harm
和 Level 是实时的;有些东西天气在开始时只决定一次(出现多少鬼火、手电筒电池),它们保持开始时的值。一次调用会整体设定难度、Sound、Harm 和实时数值:省略的会回到默认值。
余波也算数。天气结束后留下的东西(孢子僵尸、爆炸菇、蘑菇终场、滚动的仙人掌球、继续掉落的食物、正在退去的水)同样按你的难度和数值进行,最长持续到结束后 90 秒(山洪:退水所需的时间再加 10 秒)。
错误的数值不会弄坏任何东西。未知的名称和类型不对的值会被忽略。超出范围的值会被限制;范围写作“0 或 5-600”时,低于 5 的值变为 5,小于等于 0 的变为 0。超出 1-5 的难度会被限制。每种情况都会写一行日志。
单位。高度和距离都是世界单位(PEAK 的高度计大约每单位显示 1.6 米)。时间是秒。状态量是满条的比例:0.025 = 2.5 点,以 0.025 为步长。倍数是乘在 TFA 自己的数值上。
与 TFA 的随机并行(末日模式)
在末日模式下,TFA 每隔几分钟随机一种天气。那里允许 Start:你的天气与它们并行,所以可以同时有两种天气,一种来自随机,一种来自你。末日模式之外只有你的在运行。
共用游戏同一部分的两种天气不能同时运行,所以下面的规则决定谁让路。
- 由你接管。当你的
Start遇到正在运行或已预告的随机天气,且它们是同一种天气或属于同一分组(见下表)时,就发生冲突。此时随机天气立刻结束,预告被取消,你的天气开始,你得到Started。失败的Start(NotAllowed、Busy等)绝不会动随机天气。 - 随机继续进行。它们会随机其他一切天气,但在你的天气运行期间以及结束后 90 秒内,绝不会随机到你的天气或同一分组里的任何天气——它的余波归你。在房主的 F9 菜单里,你的天气显示为“模组: 你的标识”,处于开启且锁定状态;冲突的行也会被锁定。
- 常驻天气(房主的常驻模式)在你的冲突天气运行时暂停。等你的天气及其余波结束后恢复。如果你要启动的正是那个常驻天气本身,也一样:你的接管,常驻天气之后继续。
- 不冲突,两者都运行。你的地震与随机的降雨并行,各按各自的难度:你的按
Tier(不设置则是这次攀登的难度),随机的按这次攀登的难度和幽灵投票。你的难度和数值绝不会影响随机天气。 Busy。这个接口同一时间只持有一种天气。如果别的模组的天气正在运行或已预告,你的Start会回答Busy。对shroomrain和cactusrain也会回答Busy:当随机正在运行其中之一,或迷你/巨大阶段、仙人掌球阶段仍在进行时,无论是谁启动的——它们会以这样的阶段收尾,无法被接管。稍后再问一次;调用很便宜,并且会被合并。
// Apocalypse mode, and the dice are rolling rain right now. Rain and sandstorm both belong to the Wind group, so yours
// takes over: the rain ends at once, the sandstorm starts, and for as long as it runs (and 90 s after) the dice roll
// no weather of the Wind group.
TfaWeatherResult r = TfaWeather.Start("crystalcaves", "sand", new TfaWeatherParams { Seconds = 60f });
// r == TfaWeatherResult.Started
// Another mod's weather holds the slot? Then you get Busy - ask again in a few seconds.
if (TfaWeather.Start("crystalcaves", "quake", new TfaWeatherParams { Seconds = 24f }) == TfaWeatherResult.Busy)
{
// try again later
}
谁和谁冲突
天气相同或共用一个分组时就会冲突。一种天气可以属于多个分组。
| 分组 | 天气 | 为什么不能同时运行 |
|---|---|---|
| 风 | storm, rain, snow, sand, thunder, cactusrain, volcano, avalanche, shockfrost | 共用一套风系统、同一块天气雾参数和同一组音效库。降雨和雷暴共用同一场雨。 |
| 水 | flood, tsunami, antigrav, shockfrost | 同一片水体。反重力和山洪改动同一套重力、体力和摔落规则。 |
| 云 | spores, poison | 头顶只有一朵云,且只有一份需要还原的雾设置。 |
| 太阳 | sun, petrify, dark, shockfrost | 阳光和时钟。漆黑会调暗另外两个需要的太阳。 |
| 月亮 | blood, moon, dark | 月光和夜晚时钟。漆黑会调暗另外两个需要的月亮。 |
| 混音 | dark, antigrav, icefog, shockfrost | 三者都会调低音乐和音效音量,还原时会还原成错误的值。 |
| 侦察长 | dark, watch | 只有一位侦察长。 |
| 雾带 | sleepfog, icefog, dark | 雾中的声音和雾的光照配置。 |
| 冰封 | floorlava, shockfrost | 两者都会改写地面:炙热的地板与冰层、岩浆与热岩。 |
| 体型 | shroomrain, cactusrain | 迷你/巨大阶段和仙人掌球阶段互相排斥——余波阶段也一样,无论是谁启动的。 |
| 不冲突 | quake, foodfrenzy, wisps, hayfever | 可以和任何天气一起运行。 |
少数几对只是外观上重叠——几种天空着色叠加、山洪和寒雾的低通滤波、霜冻对霜冻。这些是允许的。
在水下,你对其他一切天气免疫
身处 TFA 的水中——山洪或海啸,无论是谁启动的——就不会受到其他任何天气影响。连好的影响也一样:没有蓝月的治疗,没有鬼火的礼物。什么都不会作用到角色身上:没有状态、没有推力、没有摔落、没有失明、没有速度变化、不会丢失物品。画面和声音仍在:风暴仍在湖面上空呼啸。山洪和海啸本身对游泳者照常生效。
TfaWeather.IsUnderWater(point) 问的正是这个。
统计
你启动的天气永远不会计入 TFA 的天气统计:不计它的开始次数、运行时间、状态、行为、昏倒或死亡,无论是在天气报告里、上传里还是网站上。你的天气造成的后果也绝不会记到随机天气头上;TFA 无法确定是谁的天气造成的,就什么都不记。只要你的某种天气在运行或有余波,并且能造成伤害(Harm 保持开启),昏倒和死亡就完全不记录。TFA 的天气徽章不会因你的天气而被锁定:
行为类徽章在末日模式下像 TFA 自己的天气一样继续计数,在末日模式之外则一直不计数。
难度——Tier
Tier 是 1 到 5 的 int?。不设置时,天气在末日模式下按这次攀登的难度运行(不含幽灵投票),其他情况一律按普通运行。
| Tier | 名称 | 简述 |
|---|---|---|
| 1 | 轻松 | 温和。一些危险被关闭:水下没有氧气条、没有侦察长追猎、地震中不会被抛飞。 |
| 2 | 普通 | 原样。 |
| 3 | 困难 | 更快的间隔、更重的打击、更短的预警。 |
| 4 | 残酷 | 困难加额外规则:没有横幅(海啸和守望保留横幅),余波更糟。 |
| 5 | 噩梦 | 残酷加专属规则:噩梦不求公平。天气持续时间延长 25 %。 |
这正是 TFA 末日模式的各个难度,数字也完全一样。每个难度改变什么:
| 天气 | 1 轻松 | 2 普通 | 3 困难 | 4 残酷 | 5 噩梦 |
|---|---|---|---|---|---|
storm | 推力 x0.6,视野 140 | 推力 x1,视野 80 | 推力 x2,视野 50 | 推力 x3,视野 32 | 推力 x4,视野 32 |
rain | 不会滑倒 | 在空地冲刺时每秒 2.5 % 几率滑倒;湿岩把攀爬者往下拉 | 每秒 15 % 几率滑倒,岩壁拉力更大 | 同困难,滑倒会造成 10 % 受伤,湿岩上每秒 10 % 几率松手 | 在空地每次冲刺都会滑倒,向上攀爬只有 15 % 速度 |
snow | 每 1.5 秒 2.5 寒冷 | 每 0.75 秒 | 0.4 秒 | 0.25 秒 | 0.125 秒 |
sand | 迎风 18 秒后失明 | 12 秒 | 6 秒 | 6 秒,沙暴吹着时失明不会消退 | 4 秒,之后荆棘会让你流血,你会一直倒地直到荆棘消失 |
sun | 每 3 秒受热 | 2 秒 | 1.5 秒 | 1.5 秒,热量翻倍 | 0.75 秒,热量翻倍 |
sleepfog | 每 3 秒困倦,每 20 秒一条早起虫 | 每 3 秒,每 40 秒一条虫 | 2 秒 | 1.5 秒,延长 30 秒 | 1.5 秒,延长 30 秒,没有虫 |
spores | 每 2.5 秒,最多到 40 %,之后 1-2 只僵尸 | 2.5 秒,1-3 只僵尸 | 2 秒,3 只僵尸 | 1.25 秒,3 只僵尸,会留到下一个营火 | 同残酷,僵尸跑得快 1.5 倍 |
poison | 每 2.5 秒,最多到 40 %,之后 60 个爆炸菇 | 2.5 秒,80 个 | 2 秒,120 个 | 1.25 秒,160 个 | 1 秒,160 个 |
shroomrain | 每 0.67-1.67 秒一个弹跳菇 | 1-2.5 秒 | 2-5 秒,最后的爆破会增加孢子(最多 25 %) | 2-5 秒,爆破增加更多孢子(最多 50 %) | 没有弹跳菇,爆破会增加孢子并把你甩飞 |
cactusrain | 球 x0.6,仙人掌更多 | 球 x1 | 球 x1.3,仙人掌更少 | 同困难,5 % 的球是炸药 | 球 x2.6,5 % 炸药,仙人掌密度 1.5 倍 |
foodfrenzy | 饥饿 0.025/秒,一口 0.1,食物 1.3 倍 | 饥饿 0.025/秒,一口 0.075 | 饥饿 0.05/秒 | 同困难,有毒的食物会让人中毒 | 同残酷,食物里的万能药换成炸药 |
floorlava | 热量 x0.5 | x1 | x1.5 | x2,地上的食物会烧焦 | x3,在炙热地面昏倒会死 |
dark | 手电筒无限续航,没有追猎 | 电池为天气时长的 70 %,无光 20 秒后侦察长追猎 | 电池 60 %,无光 10 秒后追猎,并会回来 | 同困难,身边没有微光,无光时每 2 秒困倦 | 同残酷,每 1 秒困倦,火把亮度减半 |
wisps | 10 个鬼火 | 8 个 | 6 个 | 6 个,全都看起来是白色,红色和粉色的几率翻倍 | 6 个,只有坏礼物,鬼火会跟着玩家 |
antigrav | 之后 10 秒内摔伤减半 | 原样 | 漂浮时体力消耗 x2 | 漂浮时体力保持为 0 | 同残酷,之后的摔伤 x1.5,碰到顶部会受伤 |
quake | 7 秒预警,只会摔倒 | 7 秒,抛飞 x1 | 4 秒,x2 | 4 秒,x3,蹲下也躲不过摔倒,再掉落一件物品 | 没有预警,x4,掉落所有物品 |
blood | 每位玩家 2-4 只怪物 | 3-5 只,最多 20 | 5-7 | 7-9,最多 40,还有青蛙 | 10,最多 50 |
moon | 治愈一切,包括饥饿 | 治愈诅咒、受伤、孢子、中毒、炎热、寒冷、困倦、石化 | 除诅咒外全部 | 只治愈孢子、中毒、炎热、寒冷;没有额外体力;10 % 的口会让人困倦 | 什么都不治愈;每口有 25 % 几率石化 |
petrify | 每 3 秒石化 | 2 秒 | 1.33 秒,无横幅 | 2 秒,石化翻倍,无横幅 | 1 秒,石化翻倍,无横幅 |
thunder | 雷击频率减半,10 % 受伤 | 间隔 3-17 秒,35 % 瞄准玩家,20 % 受伤,5 % 巨型闪电 | 10 % 巨型闪电 | 40 % 受伤,巨型闪电会伤人而不是治疗 | 70 % 瞄准,每第三道闪电是巨型闪电 |
icefog | 保护圈 15.6 单位,圈外每 3 秒寒冷 | 圈 9.4 单位,3 秒 | 2 秒 | 1 秒,深入雾中声音会消失 | 0.5 秒,更暗 |
watch | 间距 40 即算落单,8 秒后被追猎 | 间距 30,5 秒 | 25,4 秒,被甩飞的玩家 45 秒内安全 | 20,3 秒,20 秒安全,营火不再庇护,没有礼物 | 同残酷,只要没人看着他就立刻追猎,没有敬礼 |
flood | 没有氧气条 | 75 秒氧气 | 60 秒,游泳消耗 x1.25 | 45 秒,x1.5 | 45 秒,x1.5,缺氧立刻完全困倦 |
tsunami | 被卷走 3 秒,不受伤 | 3.5 秒,20 % | 4 秒,30 % | 5 秒,40 %,横幅保留 | 10 秒,40 %,浪速翻倍,无横幅 |
avalanche | 不受伤 | 15 % 受伤,被埋:30 % 寒冷 | 抛飞 x1.5,寒冷 40 % | 同困难,烟尘持续两倍久,寒冷 60 % | 积雪把你冻成冰块,碎石致命 |
volcano | 每块落石 5 % 受伤 | 15 % 受伤,10 % 炎热 | 落石 x1.25,警示区晚 1 秒出现,灰烬热量 x1.5 | 落石 x1.5,25 % 炎热,灰烬 x2 | 落石 x3,没有警示区,灰烬 x3 |
shockfrost | 攀爬岩壁:每 2 秒 0.025 寒冷,冲刺打滑 10 %/秒,冲刺摔落 0.05 寒冷,墙面滑落 10 %/秒 | 每 1 秒,10 %/秒,0.1,10 %/秒 | 1 秒,30 %/秒,0.15,15 %/秒 | 0.5 秒,50 %/秒,0.2,20 %/秒 | 每 0.5 秒 0.05 寒冷,每次冲刺都打滑,0.3,30 %/秒,物品一碰就碎 |
hayfever | 喷嚏弹起 5 米 | 9 米 | 13 米,会把你从墙上震落 | 17 米,手中物品被甩出,把你撞倒,除非喷嚏把你向上抛 | 17 米,手中物品被甩出,一定把你撞倒,永远不会向上 |
对所有天气:噩梦持续时间延长 25 %。残酷起没有横幅(残酷下海啸保留横幅,“地板是岩浆”总会预警,侦察长之守望总会显示它自己的横幅);石化日光从困难起没有横幅。Warn = true 会在天气有横幅的地方把它带回来。
数值——With(name, value)
new TfaWeatherParams { Tier = 2 }.With("push", 1.5f).With("direction", "right")
数字可以是 float 或 int,开关是 bool,选项是 string。多种天气共用的名称在各处含义相同:every = 每次状态之间的秒数,
amount = 每次的状态量,injury、cold、direction。名称不区分大小写。heat 例外:floorlava 里是系数,volcano 里是每块岩石的量。
默认值列出 TFA 在各难度下的值:轻松 / 普通 / 困难 / 残酷 / 噩梦。只有一个数字表示各难度相同。实时数值在天气运行时改变,开始时数值在下一次启动时生效,结束时数值在天气结束时读取(运行期间修改算作 Updated)。斜体的行是计划中的,不在 API 1 里。表中写明 0 表示“没有”或“永不”的地方,就是这个意思:没有僵尸、没有虫、永不失明。
| 天气 | 名称 | 它设定什么 | 单位,范围 | 默认值 1 / 2 / 3 / 4 / 5 | 何时生效 |
|---|---|---|---|---|---|
storm | push | 横向推力,是 PEAK 风力的倍数 | x, 0-6 | 0.6 / 1 / 2 / 3 / 4 | 实时 |
sight | 满强度时你能看多远 | 单位,10-1000 | 140 / 80 / 50 / 32 / 32 | 实时 | |
gloom | 穿过风暴的日光量 | 0-1 | 0.8 / 0.62 / 0.48 / 0.38 / 0.38 | 实时 | |
direction | storm、snow 和 sand:风从哪边吹来,沿山体方向 | "left", "right" | 上一次的方向(首次:左) | 实时 | |
rain | slip | 在露天冲刺时每秒滑倒的几率;1 = 每次冲刺都滑倒 | 0-1 | 0 / 0.025 / 0.15 / 0.15 / 1 | 实时 |
slide | 湿岩把攀爬者往下拉的力度(PEAK 自己的值:-0.5);同时取代噩梦难度向上攀爬时的减速 | -2 到 0 | -0.5 / -0.5 / -0.75 / -0.75 / -0.75 | 实时 | |
letgo | 在露天湿岩上每秒松手的几率 | 0-1 | 0 / 0 / 0 / 0.1 / 0.1 | 实时 | |
density | 你看到多少雨(仅外观) | 0-1.6 | 1 | 实时 | |
snow | every | 满强度下每 2.5 点寒冷的间隔秒数(增强期间频率减半) | 秒,0.1-30 | 1.5 / 0.75 / 0.4 / 0.25 / 0.125 | 实时 |
sight | 暴雪中你能看多远 | 倍数 | 1 | 实时 | |
direction | 暴雪从哪边吹来,沿山体方向;与 storm 相同 | "left", "right" | 上一次的方向(首次:左) | 实时 | |
sand | blind | 迎风多少秒后失明;0 = 永不失明 | 秒,0-120 | 18 / 12 / 6 / 6 / 4 | 实时 |
slow | 完全暴露时你的移动慢多少 | 0-0.9 | 0.5 | 实时 | |
direction | 沙暴从哪边吹来,沿山体方向;与 storm 相同 | "left", "right" | 上一次的方向(首次:左) | 实时 | |
sun | every | 每次热量的间隔秒数 | 秒,0.25-30 | 3 / 2 / 1.5 / 1.5 / 0.75 | 实时 |
amount | 每次的热量 | 0-0.5 | 0.025 / 0.025 / 0.025 / 0.05 / 0.05 | 实时 | |
sleepfog | every | 每次困倦的间隔秒数 | 秒,0.25-30 | 3 / 3 / 2 / 1.5 / 1.5 | 实时 |
amount | 每次的困倦量 | 0-0.5 | 0.025 | 实时 | |
worms | 每位玩家两条早起虫之间的秒数;0 = 没有 | 秒,0 或 5-600 | 20 / 40 / 40 / 40 / 0 | 实时 | |
Level | 雾线所在的世界高度 | 单位 | 高于最高的玩家 | 实时 | |
spores | every | 每次孢子的间隔秒数(蹲下和低头会减慢) | 秒,0.25-30 | 2.5 / 2.5 / 2 / 1.25 / 1.25 | 实时 |
amount | 每次的孢子量 | 0-0.5 | 0.025 | 实时 | |
zombies | 结束时爬起的蘑菇僵尸数;0 = 没有 | 0-6 | 1-2 / 1-3 / 3 / 3 / 3 | 结束时 | |
poison | every | 每次中毒的间隔秒数 | 秒,0.25-30 | 2.5 / 2.5 / 2 / 1.25 / 1 | 实时 |
amount | 每次的毒量 | 0-0.5 | 0.025 | 实时 | |
mushrooms | 结束时播下的爆炸菇数;0 = 没有 | 0-300 | 60 / 80 / 120 / 160 / 160 | 结束时 | |
shroomrain | size | 最后的爆破对所有人做什么 | "mini", "mega", "none" | 迷你或巨大各占一半 | 开始时 |
sprout | 弹跳菇之间的秒数(TFA 取其 1-2.5 倍);0 = 没有 | 秒,0 或 0.25-30 | 0.67 / 1 / 2 / 2 / 0 | 实时 | |
cactusrain | balls | 每组玩家每秒的仙人掌球数 | 0-8 | 1.8 / 3 / 3.9 / 3.9 / 7.8 | 实时 |
cacti | 新仙人掌之间的秒数(TFA 取其 1-2.5 倍);0 = 没有 | 秒,0 或 0.2-30 | 0.34 / 0.5 / 1 / 1 / 0.67 | 实时 | |
balltime | 结束后滚动仙人掌球的秒数;0 = 没有 | 秒,0 或 10-300 | 60-90 | 结束时 | |
foodfrenzy | hunger | 每秒的饥饿量 | 0-0.2 | 0.025 / 0.025 / 0.05 / 0.05 / 0.05 | 实时 |
bite | 一口吃掉多少饥饿 | 0-1 | 0.1 / 0.075 / 0.075 / 0.075 / 0.075 | 实时 | |
food | 每位玩家每秒掉落的食物数 | 0-6 | 3.25 / 2.5 / 2.5 / 2.5 / 2.5 | 实时 | |
floorlava | heat | 炙热地面上及附近的热量倍数 | x, 0-5 | 0.5 / 1 / 1.5 / 2 / 3 | 实时 |
hold | 完全炙热的秒数;天气会随之变长 | 秒,1-120 | 10 | 开始时 | |
dark | battery | 手电筒电池的秒数;0 = 无限。Seconds = 0 时 TFA 自己的电池是 90 秒(困难起 77 秒) | 秒,0 或 5-3600 | 无限 / 天气时长的 70 % / 60 % / 60 % / 60 % | 开始时 |
gaze | 无光多少秒后侦察长追猎你;0 = 永不。大于 0 时轻松难度也会追猎 | 秒,0 或 3-300 | 0 / 20 / 10 / 10 / 10 | 实时 | |
wisps | count | 鬼火数量,第三位起每多一位玩家加一个。开始 7 秒后读取;0 会在约 10 秒后结束天气 | 0-30 | 10 / 8 / 6 / 6 / 6 | 开始时 |
gifts | 每种礼物的几率 | 权重 | 按难度 | 开始时 | |
antigrav | rise | 玩家、物品和怪物上升有多快 | 单位/秒,0.2-5 | 1.2 | 实时 |
quake | warn | 每次地震前预警轰鸣的秒数 | 秒,0-20 | 7 / 7 / 4 / 4 / 0 | 实时 |
shove | 抛飞力度;0 = 玩家只会摔倒 | x, 0-6 | 0 / 1 / 2 / 3 / 4 | 实时 | |
calm | Seconds 大于 12 时两次地震之间的秒数(TFA 取其 1-2 倍) | 秒,5-300 | 20 | 实时 | |
blood | pack | 每位站立玩家每一波的怪物数 | 0-10 | 2-4 / 3-5 / 5-7 / 7-9 / 10 | 实时 |
cap | 同时存在的最大怪物数 | 0-50 | 20 / 20 / 20 / 40 / 50 | 实时 | |
moon | every | 每次治疗的间隔秒数 | 秒,0.25-30 | 2 | 实时 |
amount | 每次的治疗量(或额外体力) | 0-0.5 | 0.025 | 实时 | |
petrify | every | 每次石化的间隔秒数 | 秒,0.25-30 | 3 / 2 / 1.33 / 2 / 1 | 实时 |
amount | 每次的石化量 | 0-0.5 | 0.05 / 0.05 / 0.05 / 0.1 / 0.1 | 实时 | |
thunder | rain | 0 无雨,1 小雨,2 普通,3 大雨 | 0-3 | TFA 在开始时随机一个 | 实时 |
spacing | 闪电之间 3-17 秒间隔的倍数 | x, 0.25-10 | 2 / 1 / 1 / 1 / 1 | 实时 | |
aim | 闪电瞄准玩家的几率 | 0-1 | 0.35,第二位起每多一位玩家 +0.05,最高 0.7;噩梦 0.7,第三位起每多一位 +0.025,最高 1 | 实时 | |
injury | 一道闪电造成的受伤(巨型闪电除外) | 0-1 | 0.1 / 0.2 / 0.2 / 0.4 / 0.4 | 实时 | |
mega | 出现巨型闪电的几率 | 0-1 | 0.05 / 0.05 / 0.1 / 0.1 / 每第三道 | 实时 | |
icefog | radius | 携带者周围安全圈的半径;0 = 没有安全圈 | 单位,0-60 | 15.6 / 9.4 / 9.4 / 9.4 / 9.4 | 实时 |
every | 圈外每 2.5 点寒冷的间隔秒数 | 秒,0.25-30 | 3 / 3 / 2 / 1 / 0.5 | 实时 | |
watch | apart | 与最近队友相距多远算落单 | 单位,5-200 | 40 / 30 / 25 / 20 / 20 | 实时 |
grace | 落单多少秒后他来找你 | 秒,0-60 | 8 / 5 / 4 / 3 / 3 | 实时 | |
gift | false:结尾没有敬礼和礼物;true 不会强制任何事 | bool | 由 TFA 决定 | 结束时 | |
flood | Level | 水面的世界高度(带类型的属性 Level) | 单位,±30000 | 见下方山洪 | 实时 |
rise | 到达 Level 的秒数;0 = 立刻到位,也没有 4 秒的前奏 | 秒,0-120 | 15 | 实时 | |
drain | 结束后水退去所需的秒数 | 秒,0-120 | 20 | 实时 | |
douse | 水下的营火和提灯 3 秒后熄灭 | bool | true | 开始时 | |
air | 水下氧气的秒数;0 = 没有氧气条 | 秒,0 或 5-600 | 0 / 75 / 60 / 45 / 45 | 实时 | |
area | 水只在你路段的一个区域内——有岸的湖 | 区域 | 所有地方 | 开始时 | |
tsunami | direction | 第一道浪从哪一侧来(风向标不变) | "left", "right" | 上一次的方向 | 开始时 |
carry | 浪卷着你的秒数 | 秒,0-15 | 3 / 3.5 / 4 / 5 / 10 | 实时 | |
injury | 浪打中时的受伤量 | 0-1 | 0 / 0.2 / 0.3 / 0.4 / 0.4 | 实时 | |
Level, speed | 浪过后的水位,浪的速度 | 单位,单位/秒 | 比下一个营地低 40,32 | 开始时 | |
avalanche | snow | true:会掩埋的雪崩;false:烟尘和碎石 | bool | 由 TFA 按地点逐次决定 | 开始时 |
injury | 击中你时的受伤量 | 0-1 | 0 / 0.15 / 0.15 / 0.15 / 0.15 | 实时 | |
cold | 被积雪掩埋时的寒冷量 | 0-1 | 0.3 / 0.3 / 0.4 / 0.6 / 0.6 | 实时 | |
speed | 雪崩滑得有多快 | 单位/秒 | 9-13 | 开始时 | |
volcano | rocks | 落石数量的倍数 | x, 0-5 | 1 / 1 / 1.25 / 1.5 / 3 | 实时 |
injury | 一块落石造成的受伤量 | 0-1 | 0.05 / 0.15 / 0.15 / 0.15 / 0.15 | 实时 | |
heat | 一块落石造成的热量 | 0-1 | 0.1 / 0.1 / 0.1 / 0.25 / 0.25 | 实时 | |
ash | 后半段的灰烬雾 | bool | true | 开始时 | |
hayfever | height | 垂直向上的喷嚏所达到的最高点(米);反冲力随之变化,在空中 x1.5,在平地上会带一个小跳。在噩梦难度下,喷嚏永远不会把你抬起 | m, 0-20 | 5 / 9 / 13 / 17 / 17 | 实时 |
least | 两次喷嚏之间的最短间隔 | 秒,1-60 | 4 / 4 / 4 / 4 / 4 | 实时 | |
most | 两次喷嚏之间的最长间隔(每名玩家各自掷骰) | 秒,1-120 | 20 / 20 / 20 / 20 / 20 | 实时 | |
shockfrost | every | 攀爬岩壁时每次寒冷的间隔秒数 | 秒,0.1-10 | 2 / 1 / 1 / 0.5 / 0.5 | 实时 |
cold | 每次的寒冷量(以 0.025 为步长) | 0-1 | 0.025 / 0.025 / 0.025 / 0.025 / 0.05 | 实时 | |
slip | 冲刺时每秒打滑的几率;1 = 每次冲刺都打滑 | 0-1 | 0.1 / 0.1 / 0.3 / 0.5 / 1 | 实时 | |
fall | 打滑后摔落的寒冷量(以 0.025 为步长);掉进水里只算一半 | 0-1 | 0.05 / 0.1 / 0.15 / 0.2 / 0.3 | 实时 | |
slide | 结冰岩壁上持续的向下拉力,与 rain 相同;只有设置后才生效(默认由墙面滑落取代) | -2 到 0 | 关 | 实时 | |
wallslip | 攀爬结冰岩壁时每秒顺墙滑落的几率(每秒掷一次) | 0-1 | 0.1 / 0.1 / 0.15 / 0.2 / 0.3 | 实时 | |
slipfor | 一次墙面滑落的持续时间 | 秒,0.05-2 | 0.25 | 实时 | |
slipspeed | 一次墙面滑落的峰值速度;3 = 向下攀爬的速度 | 0-10 | 3 | 实时 |
每种天气还接受 Seconds、Warn 和 Tier,以及天气表里列出的 Sound 和 Harm。
示例:一片可以游泳的湖
TFA 的山洪是真正的水。玩家按空格游泳、潜水、爬出水面,能看到并听到水下的世界。用你自己的数值,它就变成一片安静无声、直到你停止才消失的湖。
想法是:你的路段从一片湖的岸边开始。起点营火在水面稍高的一块岩石上,上山的路从游过去开始。
private static bool _lake;
private static float _level;
private static void OnPlayersHere(TfaBiomeSlot slot, bool here)
{
if (!CrystalCavesPlugin.TfaWeatherReady || !slot.OwnWeatherAllowed)
{
return;
}
_lake = here;
_level = slot.StartPoint.y - 2f; // world height of the surface: 2 units below the start campfire
if (here)
{
KeepLake();
}
else
{
TfaWeather.Stop("crystalcaves"); // the lake drains in 8 s (see "drain")
}
}
// Call it from OnPlayersHere and again about once a second from your Update while _lake is set. The same call answers
// Unchanged and writes nothing; if another mod's weather was in the way (Busy), the lake gets in as soon as it ends.
private static void KeepLake()
{
TfaWeather.Start("crystalcaves", "flood", new TfaWeatherParams
{
Level = _level,
Seconds = 0f, // until stopped
Sound = false, // no roar of rising water, no surge
Harm = false, // no air bar, no drowning
}
.With("rise", 0f) // already full when the players arrive
.With("drain", 8f)
.With("douse", false)); // the water may later rise over the start campfire without putting it out
}
在每位玩家处会发生:
- 房主把天气连同你的数值写入房间。客人在大约一秒内接收;之后加入的玩家也会收到。
- 水位立刻达到
Level。低于该高度的一切都在水下。 - 在水下,玩家可以游泳、缓慢下沉,不会受到摔伤。攀爬速度减半,画面变成蓝绿色,其他声音被闷住。散落的物品会漂浮并缓慢下沉。使用
Harm = false时没人会缺氧。 - 当队伍点燃你路段终点的营火时,
PlayersHere(slot, false)会停止这片湖,水在 8 秒内退去。
请注意:
- 水目前还没有岸。它是一个海平面:世界里低于
Level的一切都在水下——你的路段、下面的路段和海滩。请把你的湖放在你路段的脚下,那里正是你想要的地方。area(把湖限制在你路段的一个区域内)已在计划中。 - 如果
Level高于起点营火,玩家一到就在水下,营火 3 秒后熄灭,除非你在第一次调用里加上.With("douse", false)——douse是开始时数值,之后的更新无法改变它。 - 想让潜水有意义?保持
Harm开启并设定氧气:.With("air", 40f)在任何难度下都给 40 秒水下时间。 - 在末日模式下,随机会在你的湖旁继续进行。水分组(山洪、海啸、反重力)在湖存在期间不会出现;其他的照常运行,而游泳者对它们免疫。
- 这片湖是队伍必须游过去的路线吗?如果别的模组的天气占着位置,你的启动会回答
Busy,直到它结束——上面反复调用的写法会在它结束后立刻把湖放进去。
更多示例
难度和数值一起用。为最后冲刺准备的一场短促又凶险的雷暴:残酷难度、大雨,但没有巨型闪电,一道闪电造成 30 % 受伤,而不是残酷的 40 %:
TfaWeather.Start("crystalcaves", "thunder", new TfaWeatherParams { Seconds = 60f, Tier = 4 }
.With("rain", 3)
.With("mega", 0f)
.With("injury", 0.3f));
温和的第一场暴雪。轻松难度,寒冷每 3 秒才咬一次:
TfaWeather.Start("crystalcaves", "snow", new TfaWeatherParams { Seconds = 40f, Tier = 1 }.With("every", 3f));
在水存在时抬高水位——同一个所有者、同一种天气、新的实时数值。结果是 Updated:
_level = slot.StartPoint.y + 10f; // so the repeated KeepLake keeps the new height
TfaWeather.Start("crystalcaves", "flood", new TfaWeatherParams
{
Level = _level, Seconds = 0f, Sound = false, Harm = false,
}.With("rise", 20f).With("drain", 8f)); // up 12 units within 20 s; douse stays as the lake started it
douse 是开始时数值,所以湖在第一次调用里就设好了它。drain 又写了一遍,因为更新时省略的实时数值会回到默认值。
只带来少量怪物的血月——任何时间都行:
// Day or night, it doesn't matter: the clock moves to midnight while the blood moon runs and goes back afterwards.
TfaWeather.Start("crystalcaves", "blood", new TfaWeatherParams { Seconds = 90f }
.With("pack", 1).With("cap", 6));
对 TFA 的天气做出反应。任何模式(包括末日模式)下,在每位玩家处:
TfaWeather.Changed += change =>
{
// Dice and mod weather can run at once, so ask for the state instead of reading change.To.
CrystalGlow.Dimmed = TfaWeather.IsRunning("dark"); // your crystals dim while darkness runs, whoever started it
};
你自己的火把在 TFA 的水下熄灭:
if (TfaWeather.IsUnderWater(torch.position)) torch.Snuff();
参考
TfaWeather
int ApiVersion接口级别;本页对应 1。在运行时读取。读取它也会告诉 TFA 有模组在使用它的天气。string CurrentTFA 自己正在运行的天气的键(随机、F9 菜单、幽灵投票),没有则为 ""。在所有玩家处相同,误差约一秒。string ModWeather通过本接口启动的天气的键,没有则为 ""。string ModOwner该天气的所有者标识,没有则为 ""。bool IsRunning(string key)这种天气是否在运行(两个位置中的任意一个)?bool IsUnderWater(Vector3 point)这个点此刻是否在 TFA 的水下(山洪、海啸)?event Action<TfaWeatherChange> Changed在每位玩家处,该处天气刚切换之后触发——任何天气都会触发,包括 TFA 自己的。每个位置一个事件;只更新数值而没有换天气不会触发。TfaWeatherResult Start(string owner, string key, TfaWeatherParams values = null)启动一种天气,或给你正在运行的天气新的难度或新的实时数值。只有房主会执行。换用另一个键会取代你正在运行的天气(它的余波照常进行),并丢弃你仍在倒数的预告;回答是 Started。TfaWeatherResult Stop(string owner)停止 owner 启动的天气。有些天气结束时会留下东西(见天气表)。胜利之后仍然有效。Current、ModWeather、ModOwner 和 IsRunning 反映的是这台电脑上已经生效的状态。Start 和 Stop 可以在每位玩家处调用,也可以按你的逻辑需要随意频繁调用。客人处什么都不会发生。如果同样的天气已经以同样的难度和数值在运行,就不会写入任何东西;短时间内的连续调用会被合并,一秒内以最后一次为准。你的 Changed 处理程序在 TFA 的天气步骤内运行,所以请保持简短;其中的异常会被捕获,并且每个处理程序只记录一次日志。
TfaWeatherParams
全部可选。你没填的,TFA 照常决定。
| 属性 | 类型 | 默认值 | 含义 |
|---|---|---|---|
Seconds | float? | TFA 为该天气和难度定的时长 | 0 = 直到你停止。最大 3600。 |
Tier | int? | 末日模式:这次攀登的难度;否则为普通 | 难度 1-5:轻松、普通、困难、残酷、噩梦。见难度。 |
Warn | bool? | 与 TFA 在该难度下一致 | 天气开始前 3 秒的横幅或声音。false:没有,并且立刻开始(watch 保留它的 10 秒前奏)。true 会为 blood、petrify、tsunami、floorlava、foodfrenzy 和 watch 带回预警(横幅;foodfrenzy 是低吼声);对其他天气会被忽略并记录日志。 |
Sound | bool | true | false:没有危险音效。对 sun、quake、flood、tsunami、avalanche、volcano、shockfrost 和 hayfever 有效,其他会被忽略并记录日志。溅水声、划水声等反馈音保留。 |
Harm | bool | true | false:这种天气不伤害任何人,任何难度下都一样。对 28 种天气中的 26 种有效;blood 和 cactusrain 会忽略它并记录日志(请用 pack = 0 或 balls = 0)。各天气具体含义见天气表。 |
Level | float? | TFA 的规则 | 世界高度,单位。API 级别 1:山洪的水面;其他情况忽略。 |
Values | Dictionary<string, object> | 空 | 带名称的数值,见数值。With(name, value) 添加一个并返回该对象。 |
TfaWeatherResult
| 值 | 含义 |
|---|---|
Started | 已为所有人写入。有预警时天气 3 秒后开始。你的天气接管了冲突的随机天气时,也是这个回答。 |
Updated | 你的天气得到了新的难度或新的实时数值——比如水位移向新的高度。 |
Unchanged | 同样的天气已经以这个难度和这些数值在运行,或者只有开始时数值变了。请停止后重新启动。 |
Stopped | 你的天气对所有人结束;它的余波照常进行。 |
NothingToStop | 你没有在运行任何天气。TFA 或别的模组的天气不归你停止。 |
NotHost | 你是客人。房主的调用仍然会传到你这里。 |
NotAllowed | 不在攀登或机场中(标题画面、加载中)、每日地图,或攀登已结束(失败或结算画面)。日志会说明是哪种。 |
UnknownWeather | 这个 TFA 里没有该键的天气。 |
WrongTime | 保留值。TFA 2.10.0 永远不会返回它:夜晚或白天天气会改为移动时钟。该值保留,是为了让按 API 第 1 级编写的模组仍能编译。 |
Unavailable | 保留值。TFA 2.10.0 永远不会返回它:每种天气都能做到随处运行。该值保留,是为了让按 API 第 1 级编写的模组仍能编译。 |
Busy | 别的模组的天气正在运行或已预告;或随机的蘑菇雨/仙人掌雨、迷你/巨大阶段、仙人掌球阶段挡住了 shroomrain 或 cactusrain。请稍后再试。 |
BadOwner | 所有者标识不是 2-24 个小写字母或数字。 |
TfaWeatherChange
From, To切换前后的天气键,"" = 没有。Owner"" = TFA 自己(随机、菜单、幽灵投票),否则是某个模组的所有者标识。ByModOwner.Length > 0。所有天气
键永远不会变;它们与 TfaBiome.Weathers 里的相同(见地貌标签页)。各天气的数值见数值。
| 键 | 名称 | 时间 | 静音 | 无害 | 结束时 |
|---|---|---|---|---|---|
storm | 狂风 | 任意 | - | 没有推力,没有抓握惩罚(只是布景) | - |
rain | 降雨 | 任意 | - | 不会滑倒、不会松手,湿岩不再下拉 | - |
snow | 暴雪 | 任意时间;从不移动时钟;在雪山路段之外的夜里启动时会让夜晚停住 | - | 没有寒冷 | - |
sand | 沙暴 | 任意 | - | 没有失明、没有昏倒、没有减速 | - |
sun | 烈日 | 任意时间;把时钟拨到正午并让它停住 | 轰鸣 | 没有炎热 | - |
sleepfog | 眠雾 | 任意 | - | 没有困倦 | - |
spores | 孢子云 | 任意 | - | 没有孢子,之后也没有僵尸 | 蘑菇僵尸爬起(zombies) |
poison | 毒雾 | 任意 | - | 没有中毒,之后也没有爆炸菇 | 一片爆炸菇(mushrooms) |
shroomrain | 蘑菇雨 | 任意 | - | 没有蜇伤和抛飞(体型变化仍在) | 最后的爆破,所有人变成迷你或巨大(size) |
cactusrain | 仙人掌雨 | 任意 | - | 不提供(请用 balls = 0) | 滚动的仙人掌球(balltime) |
foodfrenzy | 暴食狂欢 | 任意 | - | 没有饥饿;食物不再有毒或炸药伤害 | 食物再落 3 秒,然后再躺 10 秒 |
floorlava | 地板是岩浆 | 任意 | - | 没有炎热、没有死亡、不会烧焦 | 自有时间线,约 20 秒(hold) |
dark | 漆黑 | 任意 | - | 没有打盹、没有追猎 | - |
wisps | 鬼火 | 任意 | - | 没有坏礼物 | 最后一个鬼火被拿走时自行结束 |
antigrav | 反重力 | 任意 | - | 升力仍在;没有体力消耗、没有撞顶,软着陆 | - |
quake | 地震 | 任意 | 轰鸣和巨响 | 没人摔倒、飞出或丢东西 | 自有时间线:12 秒 = 一次地震 |
blood | 血月 | 任意时间;把时钟拨到午夜并让它停住 | - | 不提供(请用 pack = 0) | 怪物变成骷髅或消失 |
moon | 蓝月 | 任意时间;把时钟拨到午夜并让它停住 | - | 没有困倦和石化(治疗仍在) | - |
petrify | 石化日光 | 任意时间;把时钟拨到正午并让它停住 | - | 没有石化 | - |
thunder | 雷暴 | 任意 | - | 没人被劈中,没有巨型闪电的治疗 | - |
icefog | 寒雾 | 任意 | - | 没有寒冷 | - |
watch | 侦察长之守望 | 任意时间;即使本次攀登没有侦察长,房主也会带一个来 | - | 他不追猎任何人 | 敬礼和一份礼物(gift) |
flood | 山洪 | 任意 | 轰鸣和涌浪 | 没有氧气条、不会溺水、没有额外困倦 | 水退去(drain) |
tsunami | 海啸 | 任意 | 海浪声 | 浪不会卷走任何人 | 自有时间线:先是浪,然后水退去 |
avalanche | 雪崩 | 任意 | 隆隆声和巨响 | 不会击中任何人 | 自有时间线,90 秒 |
volcano | 火山爆发 | 任意时间;没有熔炉时在队伍前方喷发 | 喷发、落石 | 落石和灰烬没有效果 | - |
shockfrost | 急冻 | 任意 | 叮当声、碎裂声、冰层爆裂 | 没有寒冷、没有打滑、没有摔落(冰层、冻结的陷阱和碎裂仍在) | 先有 4 秒冰裂声,然后冰层碎裂并在 3 秒内融化 |
hayfever | 花粉季 | 任意 | 吸鼻子声、倒吸气声和喷嚏声 | 没有喷嚏反冲(花粉薄雾和声音仍在) | 喷嚏立即停止 |
自有时间线:这些天气按固定流程进行。Seconds 只决定天气何时算作结束、下一种何时可以开始;已经开始的浪或雪崩仍会走完。
让时钟停住:天气运行期间,白天或黑夜保持不动。Seconds = 0 的夜晚天气会让夜晚一直持续,直到你停止它。如果时间不对,时钟会先拨到午夜(blood、moon)或正午(sun、petrify),天气结束时再回到原来的时间。
预警:blood、petrify、tsunami 和 floorlava 有横幅,foodfrenzy 有低吼声,watch 以 10 秒前奏和它自己的横幅开始。是否显示取决于难度(见难度),watch 除外,它的横幅在任何难度下都会显示;Warn 替你决定。Warn = false 表示没有横幅;对 blood、petrify、tsunami、floorlava 和 foodfrenzy 也没有前奏(岩浆 0.5 秒后就发光,而不是 3 秒);watch 保留它的 10 秒前奏,只是没有横幅。
无害:Harm = false 的作用写在表里,对 25 种天气有效。在水下,同一道关卡会让角色不受其他天气影响(见上文)。
急冻(shockfrost):没有横幅;6 秒的渐入就是预警,Seconds 已包含这段时间。结束时(先有 4 秒的冰裂声)或在
Stop 之后,冰层碎裂并在 3 秒内融化;在此之前岩浆和水面保持冻结,所以后续的天气要等融化结束后才会开始。
Harm = false 会关掉所有作用在玩家身上的效果(寒冷、打滑、摔落);冰的外观、被冻住的陷阱、冻结的岩浆和水面以及会碎裂的物品仍然保留。
flood——山洪
| 数值 | 类型 | 默认值 | 范围 | 何时 | 含义 |
|---|---|---|---|---|---|
Level | float | 当前路段终点营火下方 15 单位(雾沼/火山口:其上方 50,熔炉/城塞:山顶下方 15) | ±30000 | 实时 | 水面,世界高度,单位。 |
rise | float | 15 | 0-120 | 实时 | 到达 Level 的秒数。0 = 立刻到位,也没有 4 秒的前奏。 |
drain | float | 20 | 0-120 | 实时 | 结束后水退去所需的秒数。 |
air | float | 按难度:无 / 75 / 60 / 45 / 45 | 0、5-600 | 实时 | 水下氧气的秒数。0 = 没有氧气条。 |
douse | bool | true | 开始时 | 水下的营火和提灯 3 秒后熄灭。 | |
Sound = false | 实时 | 水位上涨和退去时没有轰鸣,也没有涌浪。水下的嗡鸣声、溅水声、划水声和气泡声保留。 | |||
Harm = false | 实时 | 水下没有氧气条、不会溺水、没有额外困倦。 |
TFA 自己的洪水在有人点燃营火时结束。你启动的洪水不会:它一直运行到 Stop 或 Seconds 把它结束。要在它运行时修改,用新的实时数值再次调用 Start:水会在 rise 秒内移向新的 Level。降低水位不会把 TFA 隐藏的原版水面带回来。不设 Level 时适用 TFA 的规则,在每台电脑上各自计算;没有营火可瞄准的地方(机场),由房主在开始时定下水位:比最低的存活玩家高 3 单位。
多人联机
- 在所有地方调用。
PlayersHere和你自己的触发器在每位玩家处运行。在所有人处做同样的调用;只有房主的调用算数。只在某位客人处运行的代码启动的天气不会有任何效果。在每位玩家处调用Start还会让 TFA 在每台电脑上都认识你的所有者标识——见“房主离开”。 - 难度和数值来自房主。TFA 会把它们随天气一起发送。不要用玩家之间不同的东西来计算数值,比如玩家位置或物理碰撞。你路段的几何形状、营火和 slot 在各处都相同。
- 中途加入的玩家会得到天气当前的状态,连同难度和数值:湖已经涨满,风暴已经过半。处于余波中的天气他们也会得到。已经出现过的横幅和已经发生的开始他们看不到也听不到。
- 山体生成期间,或玩家的角色还不存在时,
Start仍然回答Started。天气在每台电脑上等 TFA 准备好之后才开始。 - 房主离开:下一位房主接手;时长、所有者、难度和数值都保存在房间里。仍在倒数的预警会丢失;你的下一次调用会重新启动天气。如果新房主从未见过带你的所有者标识的调用——他那里没有这个模组——天气会在 15 秒后结束,TFA 会记录日志。
- 继续(快速存档):运行中的天气不会被保存。读取后,
PlayersHere会再次报告你的路段,你的调用会重新启动它。 - 攀登结束:失败的攀登会结束你的天气。胜利之后它会像 TFA 自己的天气一样,作为无害的布景留在结算画面上;此时
Stop仍然有效,Start回答NotAllowed。 - 场景切换:在机场启动的天气会在攀登加载时结束;没有任何东西会从一个场景带到下一个场景。
- 版本:所有玩家需要相同版本的 TFA(TFA 会检查)。客人不需要你的模组就能看到 TFA 的天气;你的地貌本身则是另一回事。
须知
- 统计和徽章:见与 TFA 的随机并行下的“统计”:你的天气永远不计入。
- PEAK 自己的天气会继续。TFA 的风暴、降雨、暴雪和沙暴在吹的时候会让 PEAK 的风区保持静止。你的
sun运行期间会取代方山自己的烈日,所以只有你的数值生效。除此之外,在末日模式之外 TFA 不会替你关掉 PEAK 的天气——地貌用DropFromFrame去掉其框架的天气。在末日模式下,你的sun、petrify或dark运行期间以及结束后 90 秒内,TFA 常驻的方山烈日会暂停。 - 氧气瓶只在末日模式下出现在行李箱里。行李箱在水下的气泡在任何攀登中都有效。
- 天空:有几种天气会给整个天空和太阳着色,以你路段的天空(
slot.Sky)为起点。 - 水下TFA 会给场景里每个声源加上低通滤波,包括你的;人声、音乐和界面声音保持清晰。着色器名称包含“Water”且完全位于
Level以下的水面,在水存在期间会被隐藏。 - 散落的物理物体在摄像机附近会在 TFA 的水中漂浮并缓慢下沉。如果希望道具保持不动,请把它们设为运动学(kinematic)。
版本
- 每当有新内容加入,
ApiVersion就会上升。已有的成员、天气键和数值名称的含义永远不变。 - 数值是按名称而不是按类型的,所以为较新 TFA 写的模组在较旧的 TFA 上仍能运行:较旧的 TFA 会忽略它不认识的名称并写入日志。新数值加入数值表时不需要新的 API 级别。
计划中
- 上面斜体的几行:洪水的
area(有岸的湖)、海啸和眠雾的Level、speed、ash、density、sight、gifts。 - 为更多天气提供
Sound和Harm。 - 不占用天气位置的一次性事件:某个点上的一次闪电、一块岩浆落石或一个补给箱。
对接口有疑问或想法?请在 PEAK Modding Discord 上联系 CptPICHU。
