Airblasted shots hit 1.5x as hard
Any shot an airblast sends back, yours or anyone's, hits half again as hard (twice a Ricochet bounce's bonus), glowing to match. Reflects stack, but overlapping blows on one tick (Splitter, Doubler) count once. Protocol 9.
This commit is contained in:
1 parent
93cdf46d5a
commit
af41b53717
3 files changed
+16
-6
No files matched your search
+1
-1
@@ -27,7 +27,7 @@
|
|||||||
#include <string_view>
|
#include <string_view>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
constexpr int PROTOCOL_VERSION = 8;
|
constexpr int PROTOCOL_VERSION = 9;
|
||||||
constexpr int LOBBY_MEMBERS_MAX = 16;
|
constexpr int LOBBY_MEMBERS_MAX = 16;
|
||||||
constexpr int LOBBY_CODE_LENGTH = 4;
|
constexpr int LOBBY_CODE_LENGTH = 4;
|
||||||
// Letters only, without I and O, so codes are easy to read out and type.
|
// Letters only, without I and O, so codes are easy to read out and type.
|
||||||
|
|||||||
+13
-5
@@ -46,6 +46,9 @@ constexpr float SLAM_RATIO = 1.05f;
|
|||||||
constexpr float SPEED_DAMAGE = 0.05f;
|
constexpr float SPEED_DAMAGE = 0.05f;
|
||||||
// A normal attack let go partway through a charge hits harder, up to this much more just short of full.
|
// A normal attack let go partway through a charge hits harder, up to this much more just short of full.
|
||||||
constexpr float PARTIAL_CHARGE_BONUS = 0.5f;
|
constexpr float PARTIAL_CHARGE_BONUS = 0.5f;
|
||||||
|
// How many times as hard a shot hits once an airblast sends it back, anyone's, stacking with each one: twice what a
|
||||||
|
// Ricochet bounce adds, as it takes aim and timing.
|
||||||
|
constexpr float REFLECT_BONUS = 1.5f;
|
||||||
constexpr float SPEED_UNIT = 100;
|
constexpr float SPEED_UNIT = 100;
|
||||||
constexpr float CONTACT_INTERVAL = 0.4f;
|
constexpr float CONTACT_INTERVAL = 0.4f;
|
||||||
constexpr float WISP_GLIDE = 14;
|
constexpr float WISP_GLIDE = 14;
|
||||||
@@ -2224,11 +2227,12 @@ static void shot_restore(Attack& shot, float share)
|
|||||||
|
|
||||||
// Moves every shot in an attack's cone (from its position along its aim, out to its range), anyone's: a blow turns each
|
// Moves every shot in an attack's cone (from its position along its aim, out to its range), anyone's: a blow turns each
|
||||||
// to fly straight out of the cone from its point (along the aim, give or take where in the cone it is), at its own
|
// to fly straight out of the cone from its point (along the aim, give or take where in the cone it is), at its own
|
||||||
// speed plus the blow's, and pull speeds each toward the point. A shot stuck to a surface comes loose first (a
|
// speed plus the blow's, hitting harder for it (REFLECT_BONUS), and pull speeds each toward the point. A shot stuck to
|
||||||
// grapple's hook too), popping out toward the point at the cone's own speed when pulled, and glancing off the surface
|
// a surface comes loose first (a grapple's hook too), popping out toward the point at the cone's own speed when pulled,
|
||||||
// if it would head straight back in. A claiming attack makes other fighters' shots its owner's, burst into its color
|
// and glancing off the surface if it would head straight back in. A claiming attack makes other fighters' shots its
|
||||||
// (all but those tied to their fighter's weapon: on a rope or chain, waiting to be set off, or the weapon itself). The
|
// owner's, burst into its color (all but those tied to their fighter's weapon: on a rope or chain, waiting to be set
|
||||||
// owner's own shots then get back restore's share of what they set off with (see shot_restore).
|
// off, or the weapon itself). The owner's own shots then get back restore's share of what they set off with (see
|
||||||
|
// shot_restore).
|
||||||
void Weapons::shots_drift(Sim& sim, Attack& source, float blow, float pull, float restore)
|
void Weapons::shots_drift(Sim& sim, Attack& source, float blow, float pull, float restore)
|
||||||
{
|
{
|
||||||
for (Attack& shot : attacks)
|
for (Attack& shot : attacks)
|
||||||
@@ -2262,7 +2266,11 @@ void Weapons::shots_drift(Sim& sim, Attack& source, float blow, float pull, floa
|
|||||||
shot.isHeld |= pull > 0;
|
shot.isHeld |= pull > 0;
|
||||||
shot.velocity = shot.velocity + toward * pull * boxing;
|
shot.velocity = shot.velocity + toward * pull * boxing;
|
||||||
if (blow > 0)
|
if (blow > 0)
|
||||||
|
{
|
||||||
shot.velocity = toward * -(vec2_length(shot.velocity) + blow * boxing);
|
shot.velocity = toward * -(vec2_length(shot.velocity) + blow * boxing);
|
||||||
|
shot.bonus *= shot.blowTime == shot.time ? 1 : REFLECT_BONUS;
|
||||||
|
shot.blowTime = shot.time;
|
||||||
|
}
|
||||||
Vec2 next = shot.position + shot.velocity * TICK;
|
Vec2 next = shot.position + shot.velocity * TICK;
|
||||||
if (isLoosened && sim.world.is_blocking_at(next))
|
if (isLoosened && sim.world.is_blocking_at(next))
|
||||||
shot.velocity = reflect_get(sim, shot.position, next, shot.velocity);
|
shot.velocity = reflect_get(sim, shot.position, next, shot.velocity);
|
||||||
|
|||||||
@@ -1367,6 +1367,8 @@ struct Attack
|
|||||||
float length = 0;
|
float length = 0;
|
||||||
// When it was claimed from another fighter, whose color it turns from (see Weapons::shots_drift).
|
// When it was claimed from another fighter, whose color it turns from (see Weapons::shots_drift).
|
||||||
float claimTime = 0;
|
float claimTime = 0;
|
||||||
|
// When it was last blown back (its own time), so overlapping blows (Splitter copies) add REFLECT_BONUS once.
|
||||||
|
float blowTime = -1;
|
||||||
float lifeStart = 0;
|
float lifeStart = 0;
|
||||||
float lifetime = 0;
|
float lifetime = 0;
|
||||||
float orbitAngle = 0;
|
float orbitAngle = 0;
|
||||||
|
|||||||
Reference in new issue
Block a user