- Profile Stats: damage dealt, kills and wins (single player and multiplayer) and the most and least played weapons and trinkets, counted from running totals in the simulation so online rewinds correct them. Protocol 6. - First-run control hints in the sandbox (and Chat in lobbies), each gone for good once used. - The ready countdown and a timed round's last five seconds beep (new countdown sound), and those seconds show big. When time runs out, everyone short of the most health dies. - Weapon balance tuned into tiers: Whip and Grenade Launcher on top, then melee, ranged, and utility (Vacuum, Grapple, Uzi) at the bottom. - The whip's lash is a chain of links a wave rolls down: windup, loop, crack, then a floppy recoil. - Muzzles come from Muzzle nulls in weapons.anm2 (read in at build time), for shots and the flash, which now follows the weapon. - Settings: Quit, Scale (1x-4x or Free), FPS meter and limit beside Vsync, Mute on Unfocus, Damage Numbers, Rumble, Stick Deadzone, and an Online section (Host, Chat, Ping) shared with the Multiplayer page. - The menu header lays out tabs and buttons by their names. About is sandbox-only. The score no longer shifts with the menu's tab. - Smaller meters, 90 tips (all ending in !), and a shorter lobby welcome.
94 lines
2.2 KiB
C++
94 lines
2.2 KiB
C++
#pragma once
|
|
|
|
#include "anm2.h"
|
|
#include <vector>
|
|
|
|
struct Game;
|
|
|
|
struct Particle
|
|
{
|
|
Color color;
|
|
Vec2 position;
|
|
Vec2 velocity;
|
|
float fill;
|
|
float gravity;
|
|
float life;
|
|
float lifeMax;
|
|
float size;
|
|
};
|
|
|
|
void particle_draw(Renderer& renderer, Particle& particle, Vec2 position);
|
|
|
|
// Text that hops up from where it appears and fades, like damage numbers. Jitter shakes it, in pixels.
|
|
// Damage numbers also keep their value and which target they're over, so quick hits can add up.
|
|
struct Popup
|
|
{
|
|
Color color;
|
|
Vec2 position;
|
|
Vec2 velocity;
|
|
char text[16];
|
|
float jitter;
|
|
float life;
|
|
float scale;
|
|
int target;
|
|
int value;
|
|
};
|
|
|
|
// Damage dealt at a moment in game time, for the DPS readout.
|
|
struct Hit
|
|
{
|
|
float time = 0;
|
|
int amount = 0;
|
|
};
|
|
|
|
// A muzzle flash: a brief white star at the barrel, pointing along the shot.
|
|
struct Flash
|
|
{
|
|
Color color;
|
|
Vec2 position;
|
|
float angle = 0;
|
|
float life = 0;
|
|
float size = 0;
|
|
// The fighter, hand and weapon that fired it, for keeping it on the muzzle (see Scene::flash_follow).
|
|
int owner = 0;
|
|
int hand = 0;
|
|
int weapon = 0;
|
|
};
|
|
|
|
// A fading copy of a sprite left behind by something moving fast, and what its fighter wore (nothing, FASHION_NONE,
|
|
// for an attack's).
|
|
struct Afterimage
|
|
{
|
|
Pose pose;
|
|
float life = 0;
|
|
int worn = 0;
|
|
};
|
|
|
|
// Particles, afterimages, text popups, screen shake and the damage-per-second tally.
|
|
class Effects
|
|
{
|
|
public:
|
|
void burst(Burst burst, Vec2 position, float angle, Color color);
|
|
void afterimage_spawn(Pose pose, int worn);
|
|
void flash_spawn(Flash flash);
|
|
void afterimage_draw(Game& game);
|
|
void number_spawn(Vec2 position, int value, int target, Color color);
|
|
void dps_record(int amount);
|
|
float dps_get();
|
|
void popup_spawn(Vec2 position, const char* text, Color color);
|
|
void shake_add(float amount);
|
|
Vec2 shake_get();
|
|
void update();
|
|
void draw(Game& game);
|
|
void clear();
|
|
|
|
private:
|
|
std::vector<Afterimage> afterimages;
|
|
std::vector<Flash> flashes;
|
|
std::vector<Hit> hits;
|
|
std::vector<Particle> particles;
|
|
std::vector<Popup> popups;
|
|
float shake = 0;
|
|
int ticks = 0;
|
|
};
|