Curation round 15: restart and mods, Brimstone and Tech X, room gaps, eight bosses, the Womb and Mom's Heart, the Forgotten and tainted starts, alt path enemies and exits
This commit is contained in:
1 parent
6e3da161fc
commit
78a2680134
128 files changed
+13196
-2933
No files matched your search
+472
-15
@@ -41,6 +41,31 @@ constexpr float FAMILIAR_BRIMSTONE_REACH = 10;
|
||||
constexpr float FAMILIAR_BRIMSTONE_LIFT = 4;
|
||||
constexpr float FAMILIAR_BRIMSTONE_HEIGHT = 23;
|
||||
constexpr const char* NULL_MOUTH = "Mouth";
|
||||
constexpr float RAPID_BEAM_DAMAGE = 0.2f;
|
||||
constexpr float RAPID_CHOCOLATE_DAMAGE = 1.25f;
|
||||
constexpr float CHOCOLATE_DAMAGE_MIN = 0.1f;
|
||||
constexpr float CHOCOLATE_DAMAGE_MAX = 2.5f;
|
||||
constexpr float CHOCOLATE_RELEASE_SHARE = 0.25f;
|
||||
constexpr float CHOCOLATE_AIM_NEAR = 50;
|
||||
constexpr float CHOCOLATE_AIM_RANGE = 250;
|
||||
constexpr float TEAR_EFFECT_INTERVAL = 4;
|
||||
constexpr float BEAM_SWEEP_SPEED = 8;
|
||||
constexpr float HEAD_FRAME_KEEP = -2;
|
||||
constexpr float HELD_BEAM_LOOP_START = 8;
|
||||
constexpr int HELD_BEAM_LOOP_FRAME = 15;
|
||||
constexpr int HELD_BEAM_TIMEOUT = 8;
|
||||
constexpr int HELD_BEAM_MIN_TIMEOUT = 4;
|
||||
constexpr int FAMILIAR_BEAM_BLINK = 10;
|
||||
constexpr float LUDOVICO_RING_LIFT = -20;
|
||||
constexpr float LUDOVICO_RETURN_PUSH = 0.15f;
|
||||
constexpr float LUDOVICO_RETURN_DISTANCE_SQUARED = 10000;
|
||||
constexpr float NO_RELEASE_CHARGE = -1000;
|
||||
constexpr float TECH_X_RADIUS_MIN = 15;
|
||||
constexpr float TECH_X_RADIUS_RANGE = 45;
|
||||
constexpr float TECH_X_DAMAGE_MIN = 0.25f;
|
||||
constexpr float TECH_X_DAMAGE_RANGE = 0.75f;
|
||||
constexpr float TECH_X_RANDOM_SPREAD = 50;
|
||||
constexpr int TECH_X_BLINK_MIN = 11;
|
||||
|
||||
// 009f9020's makers for the laser weapons (009f94c0, 009f9640, 009f91f0): a fresh weapon of the type, or none for the
|
||||
// other types.
|
||||
@@ -267,7 +292,8 @@ bool Weapon_Laser::SupportsTractorBeam()
|
||||
return !(modifiers & WEAPON_MOD_LUDOVICO_TECHNIQUE);
|
||||
}
|
||||
|
||||
// 00a06330 Gives a laser the owner's tear flags, laser color and damage.
|
||||
// 00a06330 Gives a laser the owner's tear flags, laser color and damage (Weapon_Brimstone::init_laser 00a00f90 is the
|
||||
// same).
|
||||
void Weapon_Laser::init_laser(Weapon& weapon, Entity_Laser& laser)
|
||||
{
|
||||
laser.tearFlags = weapon.get_owner_tear_flags();
|
||||
@@ -430,12 +456,339 @@ int Weapon_Brimstone::GetMarkedTargetVariant()
|
||||
return (modifiers & WEAPON_MOD_LUDOVICO_TECHNIQUE) ? 0 : marked_variant_get(weapon_player(owner));
|
||||
}
|
||||
|
||||
// The charging and firing of Brimstone are not reconstructed yet.
|
||||
|
||||
// 009ff360
|
||||
void Weapon_Brimstone::Fire(const Vector&, bool, bool)
|
||||
// What Brimstone's Fire works out about the owner before it decides to charge or fire.
|
||||
struct BrimstoneAim
|
||||
{
|
||||
reconstruction_missing("Weapon_Brimstone::Fire 009ff360");
|
||||
Vector target{};
|
||||
Entity_Player* player = nullptr;
|
||||
float maxCharge = 0;
|
||||
float shotSpeed = 1;
|
||||
bool isAimFixed = false;
|
||||
bool isFullyCharged = false;
|
||||
bool isHasBrimstone = false;
|
||||
bool isHasMarked = false;
|
||||
bool isRapid = false;
|
||||
bool isRapidBeam = false;
|
||||
};
|
||||
|
||||
// The charge part of Brimstone's Fire: a beam left on its parent goes, the head charges toward a full beam (unless
|
||||
// the costume shoots its other shot) as the charge grows by the owner's speed, and the aim follows the input.
|
||||
void Weapon_Brimstone::charge_update(const Vector& shootDirection, bool isCharging, bool isInterpolated)
|
||||
{
|
||||
Entity* beam = mainLaser;
|
||||
if (beam && beam->parent && beam->parent->type != ENTITY_EFFECT) beam->Remove();
|
||||
|
||||
bool isShootAlt = false;
|
||||
ItemConfig_Item* item = g_manager->itemConfig.GetCollectible(COLLECTIBLE_BRIMSTONE);
|
||||
if (owner && owner->is_player())
|
||||
for (PlayerCostumeMap& map : owner->ToPlayer()->playerCostumeMap)
|
||||
{
|
||||
if (map.index < 0 || map.isBodyLayer) continue;
|
||||
|
||||
CostumeSpriteDesc& costume = owner->ToPlayer()->costumeSpriteDescs[map.index];
|
||||
if (!is_held_item(costume, "", item) || !costume.sprite.IsPlaying()) continue;
|
||||
|
||||
isShootAlt = costume.sprite.GetAnimation().ends_with("ShootAlt");
|
||||
break;
|
||||
}
|
||||
|
||||
bool isCSection = modifiers & WEAPON_MOD_C_SECTION;
|
||||
if (isCharging)
|
||||
{
|
||||
float maxCharge = GetMaxCharge();
|
||||
if (charge < maxCharge)
|
||||
{
|
||||
float frame = charge / maxCharge * HEAD_CHARGE_FRAMES;
|
||||
if (!isCSection && !isShootAlt)
|
||||
UpdateHeadChargeAnimation(COLLECTIBLE_BRIMSTONE, HEAD_CHARGE_CHARGING, shootDirection, frame);
|
||||
else if (isCSection && is_c_section_anim_finished())
|
||||
update_c_section_charge_anim(HEAD_CHARGE_CHARGING, shootDirection, frame);
|
||||
if (!isInterpolated) charge += owner ? owner->speedMultiplier : 1;
|
||||
}
|
||||
else if (isCSection) update_c_section_charge_anim(HEAD_CHARGE_CHARGED, shootDirection, -1);
|
||||
else if (!isShootAlt) UpdateHeadChargeAnimation(COLLECTIBLE_BRIMSTONE, HEAD_CHARGE_CHARGED, shootDirection, -1);
|
||||
}
|
||||
|
||||
direction = IsAxisAligned() ? shootDirection : get_aim_direction(shootDirection);
|
||||
SetBlinkTime(1);
|
||||
}
|
||||
|
||||
// Fires one beam of a volley along a direction and links it to the main beam, or makes it the main beam.
|
||||
Entity_Laser* Weapon_Brimstone::fire_beam(const Vector& beamDirection, float damageScale, uint32_t fireFlags)
|
||||
{
|
||||
Entity_Laser* laser = fire_brimstone_with_color(beamDirection, damageScale, fireFlags);
|
||||
laser->parent = mainLaser;
|
||||
laser->Update();
|
||||
return laser;
|
||||
}
|
||||
|
||||
// The release part of Brimstone's Fire: without enough charge the costume stops, otherwise the volley's beams fire
|
||||
// (weak for a rapid fire, scaled by Chocolate Milk) along the aim, with the extra backward, sideways and random ones.
|
||||
// A beam out triggers the tear effects, and under Marked or a rapid fire it sweeps the beams toward the aim.
|
||||
void Weapon_Brimstone::release(const Vector& shootDirection, const BrimstoneAim& aim, bool isInterpolated)
|
||||
{
|
||||
bool isChocolateMilk = modifiers & WEAPON_MOD_CHOCOLATE_MILK;
|
||||
bool isCSection = modifiers & WEAPON_MOD_C_SECTION;
|
||||
bool isAntiGravity = modifiers & WEAPON_MOD_ANTI_GRAVITY;
|
||||
float threshold = isChocolateMilk ? std::max(aim.maxCharge * CHOCOLATE_RELEASE_SHARE, CHARGE_MINIMUM) : aim.maxCharge;
|
||||
|
||||
if (charge < threshold)
|
||||
{
|
||||
int blink = 0;
|
||||
if (owner && owner->is_player()) blink = owner->ToPlayer()->blinkTime;
|
||||
else if (owner && owner->IsFamiliar()) blink = static_cast<Entity_Familiar*>(owner)->headFrameDelay;
|
||||
if (mainLaser || blink > 1)
|
||||
{
|
||||
if (owner && owner->is_player() && IsItemAnimFinished(COLLECTIBLE_BRIMSTONE))
|
||||
stop_costume_item_anim(COLLECTIBLE_BRIMSTONE);
|
||||
}
|
||||
else stop_costume_item_anim(COLLECTIBLE_BRIMSTONE);
|
||||
if (!mainLaser && owner && owner->is_player() && isCSection && is_c_section_anim_finished())
|
||||
update_c_section_charge_anim(HEAD_CHARGE_CHARGING, shootDirection, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
uint32_t fireFlags = (aim.isRapid ? BRIMSTONE_FIRE_WEAK : 0) | (isCSection ? BRIMSTONE_FIRE_C_SECTION : 0);
|
||||
Vector beamDirection = aim.isAimFixed ? shootDirection : direction;
|
||||
beamDirection = IsAxisAligned() ? vector_cardinal(beamDirection) : vector_normalized(beamDirection);
|
||||
|
||||
float damageScale = 1;
|
||||
if (aim.isRapidBeam)
|
||||
{
|
||||
damageScale = SHOTS_PER_SECOND / (maxFireDelay + 1) * RAPID_BEAM_DAMAGE;
|
||||
if (isChocolateMilk) damageScale *= RAPID_CHOCOLATE_DAMAGE;
|
||||
}
|
||||
else if (isChocolateMilk)
|
||||
damageScale = std::clamp(charge / aim.maxCharge, CHOCOLATE_DAMAGE_MIN, CHOCOLATE_DAMAGE_MAX);
|
||||
if (modifiers & WEAPON_MOD_AZAZELS_SNEEZE)
|
||||
{
|
||||
fireFlags |= BRIMSTONE_FIRE_BURST;
|
||||
if (!aim.isHasBrimstone) damageScale *= 0.5f;
|
||||
}
|
||||
|
||||
Weapon_MultiShotParams params = GetMultiShotParams();
|
||||
aimAngle = vector_angle(beamDirection);
|
||||
if (isCSection) update_c_section_charge_anim(HEAD_CHARGE_SHOOT, beamDirection, -1);
|
||||
else UpdateHeadChargeAnimation(COLLECTIBLE_BRIMSTONE, HEAD_CHARGE_SHOOT, beamDirection, -1);
|
||||
|
||||
Entity_Laser* first = nullptr;
|
||||
for (int i = 0; i < params.numTears; i++)
|
||||
{
|
||||
PosVel shot = Entity_Player::GetMultiShotPositionVelocity(i, WEAPON_BRIMSTONE, beamDirection,
|
||||
aim.shotSpeed, params);
|
||||
Entity_Laser* laser = fire_brimstone_with_color(shot.velocity, damageScale, fireFlags);
|
||||
laser->Update();
|
||||
if (first) laser->parent = first;
|
||||
else mainLaser = first = laser;
|
||||
}
|
||||
for (int i = 0; i < params.numRandomDirTears; i++) fire_beam(random_direction(), damageScale, fireFlags);
|
||||
if (params.isShootingBackwards) fire_beam(vector_scale(beamDirection, -1), damageScale, fireFlags);
|
||||
if (params.isShootingSideways)
|
||||
{
|
||||
fire_beam(vector_make(-beamDirection.y, beamDirection.x), damageScale, fireFlags);
|
||||
fire_beam(vector_make(beamDirection.y, -beamDirection.x), damageScale, fireFlags);
|
||||
}
|
||||
if (isAntiGravity && isCSection) fire_c_section_fetuses();
|
||||
}
|
||||
|
||||
Entity* beam = mainLaser;
|
||||
if (beam && !isInterpolated)
|
||||
{
|
||||
TriggerTearEffects(shootDirection, beam->GetIntervalTicks(TEAR_EFFECT_INTERVAL, 0));
|
||||
if (!isAntiGravity && beam->GetIntervalTicks(TEAR_EFFECT_INTERVAL, 0) && isCSection) fire_c_section_fetuses();
|
||||
if (aim.isHasMarked || (aim.isRapidBeam && aim.isFullyCharged)) sweep(shootDirection, aim);
|
||||
else
|
||||
{
|
||||
SetHeadLockTime(2);
|
||||
if (owner && owner->IsFamiliar()) SetBlinkTime(FAMILIAR_BEAM_BLINK);
|
||||
}
|
||||
}
|
||||
charge = 0;
|
||||
}
|
||||
|
||||
// Turns the main beam and the beams on it toward the aim, by at most eight degrees a frame, facing them behind the
|
||||
// head when aimed up. A rapid beam at full charge also follows the mouth and keeps going. The head shows the shot.
|
||||
void Weapon_Brimstone::sweep(const Vector& shootDirection, const BrimstoneAim& aim)
|
||||
{
|
||||
float targetAngle = vector_angle(shootDirection);
|
||||
bool isHeld = aim.isRapidBeam && aim.isFullyCharged;
|
||||
|
||||
for (Entity* entity : entity_query(ENTITY_LASER, -1))
|
||||
{
|
||||
if (entity != mainLaser && entity->parent != mainLaser) continue;
|
||||
|
||||
Entity_Laser& laser = *static_cast<Entity_Laser*>(entity);
|
||||
laser.isActiveRotating = true;
|
||||
laser.rotationDelay = 0;
|
||||
laser.rotationDegrees = angle_difference(laser.angleDegrees, laser.angleDegrees - aimAngle + targetAngle);
|
||||
laser.rotationSpd = laser.rotationDegrees >= 0 ? BEAM_SWEEP_SPEED : -BEAM_SWEEP_SPEED;
|
||||
bool isFacingUp = std::sin(laser.angleDegrees * DEGREES_TO_RADIANS) <= -TECH_LASER_FACING;
|
||||
laser.renderDepthOffset = isFacingUp ? TECH_LASER_BACK_DEPTH : TECH_LASER_FRONT_DEPTH;
|
||||
if (!isHeld) continue;
|
||||
|
||||
laser.posOffset = GetOwnerLaserOffset(LASER_OFFSET_BRIMSTONE, shootDirection);
|
||||
laser.timeout = std::max(laser.timeout, HELD_BEAM_TIMEOUT);
|
||||
}
|
||||
|
||||
float step = std::clamp(angle_difference(aimAngle, targetAngle), -BEAM_SWEEP_SPEED, BEAM_SWEEP_SPEED);
|
||||
aimAngle = angle_wrap(aimAngle + step);
|
||||
if (IsItemAnimFinished(COLLECTIBLE_BRIMSTONE)) return;
|
||||
|
||||
if (modifiers & WEAPON_MOD_C_SECTION)
|
||||
{
|
||||
update_c_section_charge_anim(HEAD_CHARGE_SHOOT, shootDirection, 0);
|
||||
return;
|
||||
}
|
||||
UpdateHeadChargeAnimation(COLLECTIBLE_BRIMSTONE, HEAD_CHARGE_SHOOT, shootDirection, HEAD_FRAME_KEEP);
|
||||
Entity_Player* player = owner && owner->is_player() ? owner->ToPlayer() : nullptr;
|
||||
ItemConfig_Item* item = g_manager->itemConfig.GetCollectible(COLLECTIBLE_BRIMSTONE);
|
||||
if (isHeld && player && costume_item_frame_get(*player, item) > HELD_BEAM_LOOP_FRAME)
|
||||
play_brimstone_costume_shoot(shootDirection, HELD_BEAM_LOOP_START);
|
||||
}
|
||||
|
||||
// Ludovico's part of Brimstone's Fire: one ring beam that the input steers (or that drifts back to an owner in a
|
||||
// clear room), remade when its variant changes, thicker with a second Brimstone, triggering tear effects as it
|
||||
// moves.
|
||||
void Weapon_Brimstone::ludovico_update(const Vector& shootDirection, const BrimstoneAim& aim, bool isShooting,
|
||||
bool isInterpolated)
|
||||
{
|
||||
Vector ownerPosition = get_owner_position();
|
||||
Entity* ring = mainLaser;
|
||||
Vector ringPosition = ring ? ring->pos : ownerPosition;
|
||||
float ringScale = 1;
|
||||
|
||||
if (!isInterpolated)
|
||||
{
|
||||
bool isTechnology = aim.player && aim.player->HasCollectible(COLLECTIBLE_TECHNOLOGY);
|
||||
int variant = isTechnology ? LASER_BRIM_TECH : LASER_THICK_RED;
|
||||
if ((modifiers & WEAPON_MOD_AZAZELS_SNEEZE) && !aim.isHasBrimstone) ringScale = 0.5f;
|
||||
if (aim.player && aim.player->GetCollectibleNum(COLLECTIBLE_BRIMSTONE) > 1) ringScale += ringScale;
|
||||
if (owner && owner->IsFamiliar()) ringScale *= 0.5f;
|
||||
if (ringScale > BRIMSTONE_THICKER_SCALE)
|
||||
{
|
||||
variant = variant == LASER_BRIM_TECH ? LASER_THICKER_BRIM_TECH : LASER_THICKER_RED;
|
||||
ringScale *= 0.5f;
|
||||
}
|
||||
|
||||
if (ring && (ring->subtype != LASER_SUBTYPE_RING_LUDOVICO || ring->variant != variant))
|
||||
{
|
||||
ring->Remove();
|
||||
mainLaser = ring = nullptr;
|
||||
}
|
||||
if (!ring)
|
||||
{
|
||||
Entity_Laser* laser = static_cast<Entity_Laser*>(g_game->Spawn({.position = ringPosition,
|
||||
.spawner = owner,
|
||||
.subType = LASER_SUBTYPE_RING_LUDOVICO,
|
||||
.type = ENTITY_LASER,
|
||||
.variant = variant,
|
||||
.seed = Random()}));
|
||||
laser->posOffset = vector_make(0, LUDOVICO_RING_LIFT);
|
||||
laser->parent = owner;
|
||||
laser->renderDepthOffset = TECH_LASER_FRONT_DEPTH;
|
||||
laser->scale = ringScale;
|
||||
laser->ResetSpriteScale();
|
||||
Weapon_Laser::init_laser(*this, *laser);
|
||||
laser->Update();
|
||||
mainLaser = ring = laser;
|
||||
}
|
||||
}
|
||||
if (!ring) return;
|
||||
|
||||
if (isShooting)
|
||||
{
|
||||
Vector push = shootDirection;
|
||||
if (vector_length_squared(push) > 1) push = vector_normalized(push);
|
||||
ring->AddVelocity_divided(vector_scale(push, aim.shotSpeed), false);
|
||||
}
|
||||
else if (g_game->room->GetAliveEnemiesCount() < 1)
|
||||
{
|
||||
Vector away = vector_sub(ownerPosition, ring->pos);
|
||||
if (vector_length_squared(away) > LUDOVICO_RETURN_DISTANCE_SQUARED)
|
||||
ring->AddVelocity_divided(vector_scale(vector_normalized(away), LUDOVICO_RETURN_PUSH), false);
|
||||
}
|
||||
if (isInterpolated) return;
|
||||
|
||||
Entity_Laser& laser = *static_cast<Entity_Laser*>(ring);
|
||||
Weapon_Laser::init_laser(*this, laser);
|
||||
laser.scale = ringScale;
|
||||
laser.ResetSpriteScale();
|
||||
Entity* shooter = owner && owner->is_player() ? owner : nullptr;
|
||||
if (!shooter || !shooter->GetIntervalTicks(aim.maxCharge, 0)) return;
|
||||
|
||||
bool isApart = laser.pos.x != owner->pos.x || laser.pos.y != owner->pos.y;
|
||||
TriggerTearEffects(isApart ? vector_normalized(vector_sub(laser.pos, owner->pos)) : random_direction(), 1);
|
||||
}
|
||||
|
||||
// What Brimstone's Fire decides from the owner: its player, shot speed and charge, the aim Marked's target or a
|
||||
// fixed aim gives, and whether a rapid fire (Soy Milk or a fast fire delay) is already at full charge.
|
||||
BrimstoneAim Weapon_Brimstone::aim_get(bool isShooting)
|
||||
{
|
||||
BrimstoneAim aim;
|
||||
aim.player = weapon_player(owner);
|
||||
aim.shotSpeed = aim.player ? aim.player->shotSpeed : 1;
|
||||
aim.maxCharge = std::max(maxFireDelay, CHARGE_MINIMUM);
|
||||
aim.isHasBrimstone = aim.player && aim.player->HasCollectible(COLLECTIBLE_BRIMSTONE);
|
||||
aim.isRapid = (modifiers & WEAPON_MOD_SOY_MILK) || maxFireDelay <= 1;
|
||||
aim.isRapidBeam = aim.isRapid && !(modifiers & WEAPON_MOD_ANTI_GRAVITY);
|
||||
aim.isHasMarked = aim.player && aim.player->HasCollectible(COLLECTIBLE_MARKED);
|
||||
|
||||
bool isMarking = aim.player && (aim.isHasMarked || aim.player->HasCollectible(COLLECTIBLE_EYE_OF_THE_OCCULT));
|
||||
Entity* markedTarget = aim.player ? aim.player->markedTarget : nullptr;
|
||||
aim.target = isMarking && markedTarget ? markedTarget->pos : fixedDirection;
|
||||
aim.isAimFixed = !vector_is_zero(aim.target);
|
||||
|
||||
Entity* beam = mainLaser;
|
||||
bool isBeamHeld = beam && static_cast<Entity_Laser*>(beam)->timeout > HELD_BEAM_MIN_TIMEOUT;
|
||||
aim.isFullyCharged = aim.isRapid && (aim.maxCharge <= charge || (isShooting && aim.isRapidBeam && isBeamHeld));
|
||||
return aim;
|
||||
}
|
||||
|
||||
// 009ff360 Charges and fires Brimstone: while shooting the head charges, on release (or once a fixed aim or Marked's
|
||||
// charge is enough) the beams fire. A rapid fire keeps one beam going and sweeps it, Ludovico steers a ring beam.
|
||||
// C Section's fetuses and Hemoptysis' sneeze are not reconstructed yet. With C Section, the body faces the beam.
|
||||
void Weapon_Brimstone::Fire(const Vector& shootDirection, bool isShooting, bool isInterpolated)
|
||||
{
|
||||
Weapon::Fire(shootDirection, isShooting, isInterpolated);
|
||||
BrimstoneAim aim = aim_get(isShooting);
|
||||
bool isShootingNow = isShooting;
|
||||
|
||||
if (modifiers & WEAPON_MOD_LUDOVICO_TECHNIQUE) ludovico_update(shootDirection, aim, isShooting, isInterpolated);
|
||||
else
|
||||
{
|
||||
bool isCharging = fireDelay < 0 || charge > 0;
|
||||
if (!aim.isFullyCharged)
|
||||
{
|
||||
if (!isInterpolated && isShooting && aim.isAimFixed)
|
||||
{
|
||||
float threshold = aim.maxCharge;
|
||||
if (modifiers & WEAPON_MOD_CHOCOLATE_MILK)
|
||||
{
|
||||
float distance = vector_length(vector_sub(aim.target, get_owner_position()));
|
||||
float share = std::clamp((distance - CHOCOLATE_AIM_NEAR) / CHOCOLATE_AIM_RANGE, 0.0f, 1.0f);
|
||||
threshold = (aim.maxCharge * CHOCOLATE_DAMAGE_MAX - aim.maxCharge * CHOCOLATE_RELEASE_SHARE) *
|
||||
share +
|
||||
aim.maxCharge * CHOCOLATE_RELEASE_SHARE;
|
||||
}
|
||||
if (threshold <= charge) isShootingNow = false;
|
||||
}
|
||||
Entity* beam = mainLaser;
|
||||
if (beam && beam->parent && beam->parent->type != ENTITY_EFFECT &&
|
||||
(!aim.player || aim.isAimFixed || aim.player->twinPlayer))
|
||||
isShootingNow = false;
|
||||
}
|
||||
|
||||
bool isSneezing = modifiers & WEAPON_MOD_AZAZELS_SNEEZE;
|
||||
bool isHeldCharge = isInterpolated || charge > 0 || fireDelay >= 0;
|
||||
if (isSneezing && isShootingNow && !isHeldCharge && !aim.isFullyCharged)
|
||||
reconstruction_missing("Weapon_Brimstone::Fire 009ff360 (Hemoptysis' sneeze, fire_hitscan 00a01020)");
|
||||
if (isShootingNow && !aim.isFullyCharged) charge_update(shootDirection, isCharging, isInterpolated);
|
||||
else release(shootDirection, aim, isInterpolated);
|
||||
}
|
||||
|
||||
if (!(modifiers & WEAPON_MOD_C_SECTION)) return;
|
||||
if (Entity* beam = mainLaser) bodyDirection = vector_from_angle(static_cast<Entity_Laser*>(beam)->angleDegrees);
|
||||
else if (isShootingNow || is_c_section_anim_finished()) bodyDirection = shootDirection;
|
||||
}
|
||||
|
||||
// 00a00d10
|
||||
@@ -444,12 +797,6 @@ void Weapon_Brimstone::fire_c_section_fetuses()
|
||||
reconstruction_missing("Weapon_Brimstone::fire_c_section_fetuses 00a00d10");
|
||||
}
|
||||
|
||||
// 00a00f90
|
||||
void Weapon_Brimstone::init_laser(Entity_Laser&)
|
||||
{
|
||||
reconstruction_missing("Weapon_Brimstone::init_laser 00a00f90");
|
||||
}
|
||||
|
||||
// 00a01020
|
||||
void Weapon_Brimstone::fire_hitscan()
|
||||
{
|
||||
@@ -474,8 +821,118 @@ int Weapon_TechX::GetMarkedTargetVariant()
|
||||
return marked_variant_get(weapon_player(owner));
|
||||
}
|
||||
|
||||
// 00a0d9c0 The charging and firing of Tech X's rings are not reconstructed yet.
|
||||
void Weapon_TechX::Fire(const Vector&, bool, bool)
|
||||
// 00a0d9c0 Charges and fires Tech X's rings: the charge grows while shooting, and on release (or once a rapid fire,
|
||||
// Marked's aim or a pee burst has charged enough) a volley of rings flies off, bigger and stronger the longer it
|
||||
// charged, with the extra backward, mirrored and random ones.
|
||||
void Weapon_TechX::Fire(const Vector& shootDirection, bool isShooting, bool isInterpolated)
|
||||
{
|
||||
reconstruction_missing("Weapon_TechX::Fire 00a0d9c0");
|
||||
Weapon::Fire(shootDirection, isShooting, isInterpolated);
|
||||
if (isInterpolated) return;
|
||||
|
||||
Entity_Player* player = weapon_player(owner);
|
||||
float shotSpeed = player ? player->shotSpeed : 1;
|
||||
bool isHasMarked = player && player->HasCollectible(COLLECTIBLE_MARKED);
|
||||
bool isRapid = (modifiers & WEAPON_MOD_SOY_MILK) || maxFireDelay <= 0;
|
||||
Entity* markedTarget = player ? player->markedTarget : nullptr;
|
||||
Vector target = markedTarget && isHasMarked ? markedTarget->pos : fixedDirection;
|
||||
|
||||
float releaseCharge = NO_RELEASE_CHARGE;
|
||||
if (isShooting && isRapid) releaseCharge = maxFireDelay * TECH_X_CHARGE;
|
||||
else if (isShooting && !vector_is_zero(target))
|
||||
{
|
||||
float distance = vector_length(vector_sub(target, get_owner_position()));
|
||||
float share = std::clamp((distance - CHOCOLATE_AIM_NEAR) / CHOCOLATE_AIM_RANGE, 0.0f, 1.0f);
|
||||
releaseCharge = (maxFireDelay * TECH_X_CHARGE - maxFireDelay) * share + maxFireDelay;
|
||||
}
|
||||
if (owner && owner->is_player() && owner->ToPlayer()->peeBurstCooldown > 0)
|
||||
releaseCharge = std::max(maxFireDelay, 1.0f);
|
||||
bool isReleaseCharged = releaseCharge > NO_RELEASE_CHARGE && releaseCharge <= charge;
|
||||
|
||||
Vector aim = isShooting ? shootDirection : direction;
|
||||
aim = IsAxisAligned() ? vector_cardinal(aim) : vector_normalized(aim);
|
||||
if (isShooting && !isReleaseCharged)
|
||||
{
|
||||
if (maxFireDelay * TECH_X_CHARGE <= charge)
|
||||
UpdateHeadChargeAnimation(COLLECTIBLE_TECH_X, HEAD_CHARGE_CHARGED, shootDirection, -1);
|
||||
else charge += owner ? owner->speedMultiplier : 1;
|
||||
SetBlinkTime(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (std::max(maxFireDelay, 1.0f) <= charge || isReleaseCharged) fire_rings(aim, shotSpeed);
|
||||
charge = 0;
|
||||
}
|
||||
|
||||
if (isShooting) direction = IsAxisAligned() ? shootDirection : get_aim_direction(shootDirection);
|
||||
}
|
||||
|
||||
// Fires the charged volley of Tech X rings along an aim: their radius and damage grow from a quarter at one fire
|
||||
// delay to full at three.
|
||||
void Weapon_TechX::fire_rings(const Vector& aim, float shotSpeed)
|
||||
{
|
||||
fireDelay = maxFireDelay;
|
||||
SetBlinkTime(std::max(TECH_X_BLINK_MIN, LASER_BLINK_BASE - (int)(maxFireDelay * LASER_BLINK_SCALE)));
|
||||
TriggerTearEffects(aim, 1);
|
||||
|
||||
Vector position = get_owner_position();
|
||||
Vector velocity = vector_add(vector_scale(aim, LASER_AIM_SPEED), get_tear_movement_inheritance(aim));
|
||||
float fullDelay = maxFireDelay + 1;
|
||||
float share = (std::min(charge + 1, fullDelay * TECH_X_CHARGE) - fullDelay) / (fullDelay + fullDelay);
|
||||
float radius = share * TECH_X_RADIUS_RANGE + TECH_X_RADIUS_MIN;
|
||||
float damageScale = share * TECH_X_DAMAGE_RANGE + TECH_X_DAMAGE_MIN;
|
||||
Weapon_MultiShotParams params = GetMultiShotParams();
|
||||
auto fire_ring = [&](Vector ringPosition, Vector ringVelocity, float scale) {
|
||||
fire_tech_x_laser({.position = ringPosition,
|
||||
.velocity = ringVelocity,
|
||||
.damageMultiplier = damageScale * scale,
|
||||
.radius = radius * scale})
|
||||
->Update();
|
||||
};
|
||||
|
||||
if (params.isShootingBackwards) fire_ring(position, vector_scale(velocity, -shotSpeed), 1);
|
||||
if (params.isShootingSideways)
|
||||
{
|
||||
fire_ring(position, vector_make(velocity.x * shotSpeed, -velocity.y * shotSpeed), 1);
|
||||
fire_ring(position, vector_make(-velocity.x * shotSpeed, velocity.y * shotSpeed), 1);
|
||||
}
|
||||
for (int i = 0; i < params.numRandomDirTears; i++)
|
||||
{
|
||||
float scale = random_unit() * 0.5f + 0.5f;
|
||||
float angle = (random_unit() * TECH_X_RANDOM_SPREAD - TECH_X_RANDOM_SPREAD / 2) * DEGREES_TO_RADIANS;
|
||||
Vector turned = vector_make(velocity.x * std::cos(angle) - velocity.y * std::sin(angle),
|
||||
velocity.y * std::cos(angle) + velocity.x * std::sin(angle));
|
||||
fire_ring(position, vector_scale(turned, shotSpeed), scale);
|
||||
}
|
||||
for (int i = 0; i < params.numTears; i++)
|
||||
{
|
||||
PosVel shot = Entity_Player::GetMultiShotPositionVelocity(i, WEAPON_TECH_X, velocity, shotSpeed, params);
|
||||
fire_ring(vector_add(position, shot.position), shot.velocity, 1);
|
||||
}
|
||||
|
||||
if (owner && owner->IsFamiliar()) static_cast<Entity_Familiar*>(owner)->fireCooldown = 0;
|
||||
else if (owner && owner->is_player()) owner->ToPlayer()->stop_costume_item_anims();
|
||||
}
|
||||
|
||||
// 009f6980 Fires a Tech X ring: the owning player's, or a plain one from the owner.
|
||||
Entity_Laser* Weapon::fire_tech_x_laser(const TechXShot& shot)
|
||||
{
|
||||
if (Entity_Player* player = weapon_player(owner))
|
||||
{
|
||||
TechXShot playerShot = shot;
|
||||
playerShot.source = owner;
|
||||
if (Entity_Laser* laser = player->FireTechXLaser(playerShot)) return laser;
|
||||
}
|
||||
|
||||
Entity_Laser* laser = static_cast<Entity_Laser*>(g_game->Spawn({.position = shot.position,
|
||||
.velocity = shot.velocity,
|
||||
.spawner = owner,
|
||||
.subType = LASER_SUBTYPE_RING_PROJECTILE,
|
||||
.type = ENTITY_LASER,
|
||||
.variant = LASER_THIN_RED,
|
||||
.seed = Random()}));
|
||||
laser->posOffset = vector_make(0, LUDOVICO_RING_LIFT);
|
||||
laser->parent = owner;
|
||||
laser->renderDepthOffset = TECH_LASER_FRONT_DEPTH;
|
||||
laser->radius = shot.radius;
|
||||
return laser;
|
||||
}
|
||||
Reference in new issue
Block a user