用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/mbianchidev/2dnd --skill weather-and-daynight命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | weather-and-daynight |
| description | Implement weather effects and day/night cycle mechanics in 2D&D |
| license | MIT |
Two interrelated systems that affect encounters, combat, visuals, and audio.
src/systems/daynight.ts)| Period | Steps | Duration | Tint Color |
|---|---|---|---|
| Dawn | 0–44 | 45 steps | 0xffd5a0 (warm orange) |
| Day | 45–219 | 175 steps | 0xffffff (no tint) |
| Dusk | 220–264 | 45 steps | 0xffa570 (deep orange) |
| Night | 265–359 | 95 steps | 0x6688cc (cool blue) |
import {
TimePeriod, // enum: Dawn, Day, Dusk, Night
CYCLE_LENGTH, // 360
getTimePeriod, // (step: number) → TimePeriod
getEncounterMultiplier, // Dawn/Day=1.0, Dusk=1.25, Night=1.5
isNightTime, // true during Dusk and Night
PERIOD_TINT, // Record<TimePeriod, 0xRRGGBB>
PERIOD_LABEL, // Record<TimePeriod, "🌅 Dawn" etc.>
} from "../systems/daynight";
applyDayNightTint()getEffectiveEncounterRate() and are capped at a 15% effective chancetimeStep is persisted in save data and passed through all scene transitionssrc/systems/weather.ts)| Type | Visual | Audio | Combat Effect |
|---|---|---|---|
| Clear | None | None | None |
| Rain | Blue rain particles | Lowpass filtered noise | Accuracy penalty |
| Snow | White slow particles | Soft highpass noise | Accuracy penalty |
| Sandstorm | Tan fast horizontal | Bandpass midrange noise | Accuracy penalty |
| Storm | Heavy rain + lightning | Heavy noise + thunder rumble | Accuracy + monster boost |
| Fog | Large slow blobs | Low sine drone | Accuracy penalty |
interface WeatherState {
current: WeatherType;
stepsUntilChange: number; // Countdown to next weather check
}
// Create fresh state (starts Clear, 40 steps until first check)
const state = createWeatherState();
Each chunk name maps to weather weights. Examples:
import {
WeatherType,
createWeatherState,
advanceWeather, // Step-based countdown, may change weather
changeZoneWeather, // Called on chunk transition
getWeatherAccuracyPenalty, // Accuracy penalty for combat
getWeatherEncounterMultiplier, // Encounter rate modifier
getMonsterWeatherBoost, // Per-monster AC/ATK/DMG bonuses
WEATHER_TINT, // Tint colors per weather type
WEATHER_LABEL, // HUD labels per weather type
} from "../systems/weather";
// In combat, apply weather penalties:
const weatherPenalty = getWeatherAccuracyPenalty(weatherState.current);
const boost = getMonsterWeatherBoost(monster.id, weatherState.current);
// boost.acBonus, boost.attackBonus, boost.damageBonus
Gathering reads current time and weather without mutating either. Rain/Storm favor special fishing outcomes, Fog/Rain favor damp forage, and day/night/ biome weighting remains deterministic. Reduced motion never changes the selected outcome or reward.
WeatherType enumBIOME_WEATHER recordsWEATHER_ACCURACY_PENALTYWEATHER_ENCOUNTER_MULTWEATHER_TINTWEATHER_LABELupdateWeatherParticles() (in renderers/map.ts) and Battle.createWeatherParticles()audioEngine.playWeatherSFX()Both systems' state must be passed through every scene transition:
this.scene.start("NextScene", {
player: this.player,
defeatedBosses: this.defeatedBosses,
codex: this.codex,
timeStep: this.timeStep, // Day/night position
weatherState: this.weatherState, // Current weather + countdown
});
weatherState in scene transitions — it resets to Clear otherwiseWeatherType.ClearrerollWeather() on chunk transitionsgetTimePeriod() and constants