Room and lobby chat, /host, /fashion, player-colored lines, context tips, and American spelling

- Chat goes to your room (the sandbox, or your game) by default, and to the whole lobby with /all or a leading !.
  Lines from elsewhere say where they came from ([Sandbox], [Game 2]), lobby-wide ones from your room say [All].
  Typing shows only to your room. Protocol 8.
- Hosting: everyone is told who hosts now, and the host can hand it over with /host "player".
- /fashion <item> wears a fashion locally, like /color.
- Lines that mention a player show in that player's color, looked up as they draw.
- Tips are tagged with the item and situations they fit, and those that fit are 1.5x as likely. They turn over every
  10 seconds on one continuous run, show under the menu too, and can be turned off with Tips in HUD / Gameplay. The
  HUD hotbars hide while the menu is up (except on its item tabs).
- American spelling throughout: color, center, gray, mustache, and so on.
This commit is contained in:
shweet committed 2026-11-10 19:37:19 -05:00
1 parent f4e7784f3c
commit 93cdf46d5a
38 files changed
+603 -325

No files matched your search

+21 -21
View File
@@ -13,7 +13,7 @@ constexpr float RUMBLE_LANDED = 0.15f;
constexpr Uint32 RUMBLE_LANDED_TIME = 60;
constexpr int BLINK_MILLISECONDS = 80;
// How long a claimed shot takes to turn from its old owner's colour to its new one's.
// How long a claimed shot takes to turn from its old owner's color to its new one's.
constexpr float CLAIM_BLEND = 0.35f;
constexpr float TRAJECTORY_ALPHA = 0.12f;
constexpr float TRAJECTORY_TAPER = 0.25f;
@@ -116,7 +116,7 @@ constexpr Uint32 TOMATO_LOOK_STEP = 2654435761u;
constexpr float TOMATO_REACH = 10;
constexpr Burst TOMATO_BURST = {.gravity = 400, .life = 0.5f, .size = 2, .speed = 140, .spread = 1.2f, .count = 12};
// A random offset for an empowered attack or fighter to shake by, wider the more its colour fills in, like a damage
// A random offset for an empowered attack or fighter to shake by, wider the more its color fills in, like a damage
// number.
static Vec2 jitter_get(float fill)
{
@@ -124,7 +124,7 @@ static Vec2 jitter_get(float fill)
return {random_get(-reach, reach), random_get(-reach, reach)};
}
// Sheds particles off the edge of an empowered shape, more the more its colour fills in. They take the shape's colour
// Sheds particles off the edge of an empowered shape, more the more its color fills in. They take the shape's color
// and fill in just as far.
static void aura_spawn(Game& game, Capsule shape, float fill, Color color)
{
@@ -139,21 +139,21 @@ static void aura_spawn(Game& game, Capsule shape, float fill, Color color)
}
}
// A colour decayed to match a weakened strength: drained toward grey and darkened, faster than the damage drops so
// A color decayed to match a weakened strength: drained toward gray and darkened, faster than the damage drops so
// weakened shots read clearly.
static Color color_dim(Color color, float strength)
{
strength = math_pow(std::min(1.0f, strength), FALLOFF_CURVE);
float grey = (color.r + color.g + color.b) / 3;
Color washed = {math_lerp(grey, color.r, strength), math_lerp(grey, color.g, strength),
math_lerp(grey, color.b, strength), color.a};
float gray = (color.r + color.g + color.b) / 3;
Color washed = {math_lerp(gray, color.r, strength), math_lerp(gray, color.g, strength),
math_lerp(gray, color.b, strength), color.a};
return color_shade(washed, FALLOFF_DIM + (1 - FALLOFF_DIM) * strength);
}
// The owner's colour (darker for secondary attacks), dimming as a shot's damage falls off.
// The owner's color (darker for secondary attacks), dimming as a shot's damage falls off.
static Color owner_color_get(Game& game, Attack& attack)
{
// A claimed shot turns from its old owner's colour to its new one's.
// A claimed shot turns from its old owner's color to its new one's.
Color color = game.color_get(attack.owner);
if (attack.ownerPrevious >= 0)
color = color_mix(game.color_get(attack.ownerPrevious), color,
@@ -177,7 +177,7 @@ struct Stroke
float taper = 1;
};
// A beam, rope or whip, each piece coloured by the strength there, dimming along it the way damage falls off. Jitter
// A beam, rope or whip, each piece colored by the strength there, dimming along it the way damage falls off. Jitter
// kinks it at every piece, moving each frame so it crackles.
static void strength_line_draw(Game& game, Attack& attack, Stroke stroke)
{
@@ -350,7 +350,7 @@ static void reload_pose(Fighter& fighter, int key, Draw& draw)
draw.position.y += RELOAD_DROP * math_pow(weight, RELOAD_PUMP);
}
// How far a fighter's weapons (and crosshair) fill in with its colour: with the charge as it builds, or the speed bonus
// How far a fighter's weapons (and crosshair) fill in with its color: with the charge as it builds, or the speed bonus
// if that's more, then once the charge is ready blinking between full and the speed bonus alone.
float Scene::charge_fill_get(Fighter& fighter)
{
@@ -371,7 +371,7 @@ Vec2 Scene::weapon_shake_get(Fighter& fighter, int key)
return jitter_get(std::max({fighter.charge, left * left, spin}) * CHARGE_SHAKE);
}
// A weapon's colour (and its crosshair's) through its cooldown: darkened just after it fires (keeping its hue), back to
// A weapon's color (and its crosshair's) through its cooldown: darkened just after it fires (keeping its hue), back to
// color as it cools.
// One cooling too quickly to see doesn't fade, so rapid fire doesn't flicker.
Color Scene::cooldown_tint_get(Fighter& fighter, int key, Color color)
@@ -572,7 +572,7 @@ void Scene::update()
}
}
// The match's tomatoes as splats in their throwers' colours: a big blob where each landed with smaller ones flung round
// The match's tomatoes as splats in their throwers' colors: a big blob where each landed with smaller ones flung round
// it (the same on every screen), holding and then fading out.
void Scene::tomatoes_draw()
{
@@ -648,8 +648,8 @@ void Scene::world_draw()
for (int x = startX; x <= endX; x++)
{
auto isOpen = [&](float dx, float dy) {
Tile neighbour = world.tile_get(x + dx, y + dy);
return neighbour != TILE_SOLID && neighbour != TILE_SLOPE;
Tile neighbor = world.tile_get(x + dx, y + dy);
return neighbor != TILE_SOLID && neighbor != TILE_SLOPE;
};
auto isEmpty = [&](int dx) {
return world.tile_get(x + dx, y) == TILE_EMPTY;
@@ -832,7 +832,7 @@ void Scene::animator_update(Fighter& fighter, Animator& animator)
animator.update(stride > 0 ? std::abs(fighter.body.velocity.x) * TICK / stride : TICK * animator.art->fps);
}
// The fighter's animation placed where it is right now, in its colour: feet on the ground facing its way (walking and
// The fighter's animation placed where it is right now, in its color: feet on the ground facing its way (walking and
// crawling face the way they move), facing away from a wall it kicks off or slides down, spinning about its middle when
// launched, and rolling as a ball resting on the ground along the surface's perpendicular. Shared with afterimages.
Pose Scene::fighter_pose_get(Fighter& fighter)
@@ -929,7 +929,7 @@ void Scene::attacks_draw()
else if (kind != ATTACK_EXPLOSION)
attack_pose(attack).draw(renderer);
// A faint ring shows how far anything that explodes would reach, and pips in the shot's colour circle it, one
// A faint ring shows how far anything that explodes would reach, and pips in the shot's color circle it, one
// for each ricochet it has left.
if (attack.def()->isBursting && !attack.def()->isInstant)
renderer.ring_draw(attack.position, blast_area_get(attack), color_fade(tint, BLAST_RING_ALPHA));
@@ -976,7 +976,7 @@ void Scene::magic_draw()
}
}
// A share from 0 to 1 that a mote of air draws from a seed, the same every frame (a bit-mixing hash, so neighbouring
// A share from 0 to 1 that a mote of air draws from a seed, the same every frame (a bit-mixing hash, so neighboring
// seeds give unrelated shares).
static float mote_share_get(Uint32 seed)
{
@@ -1043,7 +1043,7 @@ void Scene::tesla_draw()
}
// The Display Collision setting: every attack's hit shapes as the hit test sees them (and a Vacuum's whole cone, where
// it pulls or blows), and the boxes fighters and dummies are hit in, see-through in their owner's colour.
// it pulls or blows), and the boxes fighters and dummies are hit in, see-through in their owner's color.
void Scene::collision_draw()
{
Renderer& renderer = game.renderer;
@@ -1068,7 +1068,7 @@ void Scene::collision_draw()
renderer.rect_draw(dummy.box, color_fade(WHITE, COLLISION_ALPHA));
}
// Explosions draw before the player, so their filled centre never hides anyone standing in the blast. One that landed a
// Explosions draw before the player, so their filled center never hides anyone standing in the blast. One that landed a
// double donk blinks bright as it lingers, like an armed mine.
void Scene::blasts_draw()
{
@@ -1254,7 +1254,7 @@ void Scene::flash_follow(Flash& flash)
flash.angle = probe.angle;
}
// Dual Wield: the off-hand weapons, a darker shade of the fighter's colour, fanned out behind it (see
// Dual Wield: the off-hand weapons, a darker shade of the fighter's color, fanned out behind it (see
// Fighter::hand_get), the furthest back first so the nearer cover them. Each shakes and reloads like the main one.
void Scene::offhand_draw(Fighter& fighter)
{