Curation round 18: tears and four weapons, passive item and trinket sweeps, pills and most cards, alt path and main path enemies, Hush and the Blue Womb, Mega Satan, the Void, Tainted ???, Forgotten, Lilith and Eden, wisps
This commit is contained in:
1 parent
024cb12016
commit
9dfc09518c
157 files changed
+24212
-6106
No files matched your search
@@ -3,6 +3,8 @@
|
||||
#include "entity_npc.h"
|
||||
#include "entity_player.h"
|
||||
#include "entity_player_characters.h"
|
||||
#include "entity_player_passives.h"
|
||||
#include "entity_player_trinkets.h"
|
||||
#include "entity_tear.h"
|
||||
#include "game.h"
|
||||
#include "level.h"
|
||||
@@ -17,11 +19,9 @@
|
||||
constexpr int COLLECTIBLE_BINKY = 438;
|
||||
constexpr int COLLECTIBLE_CONE_HEAD = 457;
|
||||
constexpr int COLLECTIBLE_DULL_RAZOR = 486;
|
||||
constexpr int COLLECTIBLE_HYPERCOAGULATION = 724;
|
||||
constexpr int COLLECTIBLE_JELLY_BELLY = 690;
|
||||
constexpr int COLLECTIBLE_MARBLES = 538;
|
||||
constexpr int COLLECTIBLE_METAL_PLATE = 449;
|
||||
constexpr int COLLECTIBLE_SCAPULAR = 142;
|
||||
constexpr int COLLECTIBLE_SPIRIT_SHACKLES = 674;
|
||||
constexpr int TRINKET_BLIND_RAGE = 81;
|
||||
constexpr int TRINKET_CROW_HEART = 107;
|
||||
@@ -34,12 +34,8 @@ constexpr int NULLITEM_SHACKLES_GHOST = 101;
|
||||
constexpr int SAMSON_B_HIT_CHARGE = 10000;
|
||||
constexpr int BLEED_OUT_HEALTH = 600;
|
||||
|
||||
// The items and trinkets a landed hit sets off, by id, from Infestation's flies to Tonsil and Pinking Shears.
|
||||
constexpr int HIT_COLLECTIBLES[] = {148, 525, 658, 696, 162, 610, 274, 156, 180, 214, 204, 219, 225, 227, 211, 262,
|
||||
301, 303, 392, 371, 407, 412, 448, 452, 560, 675, 702, 502, 513};
|
||||
constexpr int HIT_TRINKETS[] = {40, 48, 29, 1, 8, 67, 158, 97, 105, 33, 104, 122};
|
||||
constexpr int CROWN_OF_LIGHT = 415;
|
||||
constexpr int HYPERCOAGULATION_IGNORED = 0x10040000;
|
||||
// Zodiac's sign a landed hit may set off, until the zodiac's hits are written.
|
||||
constexpr int ZODIAC = 392;
|
||||
|
||||
constexpr int ENTITY_SEGMENTED_WORM = 903;
|
||||
constexpr int ENTITY_DAMAGE_RELAY = 966;
|
||||
@@ -227,6 +223,19 @@ static int damage_cooldown_scale(int frames)
|
||||
return frames > COOLDOWN_SCALE_MIN - 1 ? frames >> COOLDOWN_SCALE_SHIFT : 1;
|
||||
}
|
||||
|
||||
// Blind Rage's and Finger Bone's part of 007729d0: Blind Rage stretches the invincibility frames, and Finger Bone
|
||||
// gives a bone heart one hit in 25 (12, 8 with stronger copies).
|
||||
static void blind_rage_finger_bone_hit(Entity_Player& player)
|
||||
{
|
||||
constexpr int FINGER_BONE_ODDS[] = {25, 12, 8};
|
||||
if (player.HasTrinket(TRINKET_BLIND_RAGE))
|
||||
player.damageCooldown = damage_cooldown_scale(player.GetTrinketMultiplier(TRINKET_BLIND_RAGE) * 2) * player.damageCooldown;
|
||||
if (!player.HasTrinket(TRINKET_FINGER_BONE)) return;
|
||||
int multiplier = player.GetTrinketMultiplier(TRINKET_FINGER_BONE);
|
||||
int odds = FINGER_BONE_ODDS[multiplier == 2 ? 1 : multiplier == 3 ? 2 : 0];
|
||||
if (player.GetTrinketRNG(TRINKET_FINGER_BONE).RandomInt((uint32_t)odds) == 0) player.AddBoneHearts(1);
|
||||
}
|
||||
|
||||
// The bestiary count an enemy adds to, unless the save is frozen or the enemy has no page.
|
||||
static void bestiary_count_add(std::map<int, int>& counts, int type, int variant)
|
||||
{
|
||||
@@ -415,17 +424,65 @@ static int hearts_remove(Entity_Player& player, int amount, uint64_t damageFlags
|
||||
return amount;
|
||||
}
|
||||
|
||||
// The items a landed hit sets off, Eve's Dead Bird and Samson's Bloody Lust the only ones written yet, then Tainted
|
||||
// Samson's rage. Bleeding out restarts its timer.
|
||||
static void hit_items_check(Entity_Player& player, uint64_t damageFlags, bool isPenalized)
|
||||
// 007db2d0 Spends one of the Holy Mantles Wooden Cross lends (one per copy, two at most, beyond those spent), moving
|
||||
// one from the lent half of the stacks to the spent half. Whether there was one.
|
||||
static bool wooden_cross_mantle_spend(Entity_Player& player)
|
||||
{
|
||||
bool isItemHit = std::ranges::any_of(HIT_COLLECTIBLES, [&](int item) { return player.HasCollectible(item); }) ||
|
||||
std::ranges::any_of(HIT_TRINKETS, [&](int trinket) { return player.HasTrinket(trinket); }) ||
|
||||
(isPenalized && player.HasTrinket(TRINKET_PERFECTION)) || player.HasPlayerForm(PLAYER_FORM_STOMPY) ||
|
||||
(player.HasCollectible(CROWN_OF_LIGHT) && !g_game->deathmatchManager.is_active()) ||
|
||||
(player.HasCollectible(COLLECTIBLE_HYPERCOAGULATION) && !(damageFlags & HYPERCOAGULATION_IGNORED)) ||
|
||||
std::ranges::any_of(player.activeItems, [](const ActiveItemDesc& active) { return active.item == COLLECTIBLE_LARYNX; });
|
||||
if (isItemHit) reconstruction_missing("Entity_Player::TakeDamage 007729d0 (the items and trinkets a hit sets off)");
|
||||
constexpr int CROSS_MANTLES_MAX = 2;
|
||||
constexpr int STACK_LOW_MASK = 0xf;
|
||||
constexpr int STACK_HIGH_SHIFT = 4;
|
||||
int crosses = std::min(player.GetTrinketMultiplier(TRINKET_WOODEN_CROSS), CROSS_MANTLES_MAX);
|
||||
uint8_t stacks = player.holyMantleStacks;
|
||||
|
||||
if (crosses - (stacks & STACK_LOW_MASK) <= 0) return false;
|
||||
player.holyMantleStacks = (uint8_t)((((stacks >> STACK_HIGH_SHIFT) - 1) << STACK_HIGH_SHIFT) | ((stacks + 1) & STACK_LOW_MASK));
|
||||
return true;
|
||||
}
|
||||
|
||||
// Holy Mantle's shield takes the hit: it shatters with a burst that follows the player, a Wooden Cross mantle, the
|
||||
// Blanket's, the room's own mantle or a Holy Card's is spent, and the player is invincible for a second (longer with
|
||||
// Blind Rage). The hit does not hurt.
|
||||
static bool holy_mantle_block(Entity_Player& player)
|
||||
{
|
||||
constexpr int MANTLE_BREAK_SUBTYPE = 11;
|
||||
constexpr float MANTLE_BREAK_DEPTH = 16;
|
||||
constexpr int MANTLE_COOLDOWN = 60;
|
||||
TemporaryEffects& effects = player.temporaryEffects;
|
||||
|
||||
voice_play(SOUND_HOLY_MANTLE, 1, SOUND_FRAME_DELAY, 1);
|
||||
uint32_t seed = Random();
|
||||
auto* burst = static_cast<Entity_Effect*>(g_game->Spawn({.position = player.pos, .spawner = &player,
|
||||
.subType = MANTLE_BREAK_SUBTYPE, .type = ENTITY_EFFECT,
|
||||
.variant = EFFECT_POOF02, .seed = seed}));
|
||||
burst->FollowParent(&player);
|
||||
burst->posOffset = player.posOffset;
|
||||
burst->sprite.scale = player.sprite.scale;
|
||||
burst->renderDepthOffset = MANTLE_BREAK_DEPTH;
|
||||
burst->Update();
|
||||
effects.RemoveCollectibleEffect(COLLECTIBLE_HOLY_MANTLE, 1);
|
||||
if (!wooden_cross_mantle_spend(player))
|
||||
{
|
||||
if (effects.HasCollectibleEffect(COLLECTIBLE_BLANKET)) effects.RemoveCollectibleEffect(COLLECTIBLE_BLANKET, 1);
|
||||
else if (player.HasCollectible(COLLECTIBLE_HOLY_MANTLE) && player.holyMantleState == 0) player.holyMantleState = 1;
|
||||
else if (effects.HasNullEffect(NULLITEM_HOLY_CARD)) effects.RemoveNullEffect(NULLITEM_HOLY_CARD, 1);
|
||||
}
|
||||
if (effects.GetCollectibleEffectNum(COLLECTIBLE_HOLY_MANTLE) < 1)
|
||||
player.RemoveCostume(g_manager->itemConfig.GetCollectible(COLLECTIBLE_HOLY_MANTLE));
|
||||
player.damageCooldown = damage_cooldown_scale(MANTLE_COOLDOWN);
|
||||
if (player.HasTrinket(TRINKET_BLIND_RAGE))
|
||||
player.damageCooldown *= damage_cooldown_scale(player.GetTrinketMultiplier(TRINKET_BLIND_RAGE) * 2);
|
||||
player.ClearEntityFlags(FLAG_NO_DAMAGE_BLINK);
|
||||
return false;
|
||||
}
|
||||
|
||||
// The items a landed hit sets off: collectibles 1 to 366, then the trinkets and later collectibles
|
||||
// (entity_player_hits.cpp), Eve's Dead Bird and Samson's Bloody Lust, then Tainted Samson's rage. Bleeding out
|
||||
// restarts its timer. The amount is the hit's hearts, not yet taken. Whether the hurt animation still plays.
|
||||
static bool hit_items_check(Entity_Player& player, int amount, const ItemsHit& hit)
|
||||
{
|
||||
passives_hit_trigger(player, amount);
|
||||
if (player.HasCollectible(ZODIAC)) reconstruction_missing("Entity_Player::TakeDamage 007729d0 (Zodiac's sign)");
|
||||
bool isHurtShown = late_items_hit_trigger(player, hit);
|
||||
character_items_hit(player);
|
||||
if (player.playerType == PLAYER_SAMSON_B && (player.redHearts > 0 || player.soulHearts > 0 || player.boneHearts > 0))
|
||||
player.add_samson_berserk_charge(SAMSON_B_HIT_CHARGE);
|
||||
@@ -434,6 +491,7 @@ static void hit_items_check(Entity_Player& player, uint64_t damageFlags, bool is
|
||||
player.bleedOutHealth = BLEED_OUT_HEALTH;
|
||||
if (!player.proceduralItems.empty())
|
||||
reconstruction_missing("Entity_Player::TakeDamage 007729d0 (glitched items, trigger_set_dispatch)");
|
||||
return isHurtShown;
|
||||
}
|
||||
|
||||
// 007729d0 The player takes a hit: the hit is ignored or turned by many items, then costs its hearts, plays the hurt
|
||||
@@ -444,7 +502,10 @@ bool Entity_Player::TakeDamage(float damage, uint64_t damageFlags, const EntityR
|
||||
Entity_Player* twin = twin_get();
|
||||
|
||||
if (playerType == PLAYER_THESOUL_B && twin && !twin->HasCollectible(COLLECTIBLE_ISAACS_HEART))
|
||||
reconstruction_missing("Entity_Player::TakeDamage 007729d0 (the Forgotten's soul passing the hit on)");
|
||||
{
|
||||
if (twin->itemState == COLLECTIBLE_GLASS_CANNON) twin->bodySprite.Reset();
|
||||
return twin->TakeDamage(damage, damageFlags, source, damageCountdown);
|
||||
}
|
||||
if (source.entity && (source.type == ENTITY_DAMAGE_RELAY || source.type == ENTITY_FAMILIAR))
|
||||
reconstruction_missing("Entity_Player::TakeDamage 007729d0 (a familiar or relay source)");
|
||||
if (is_wisp_shield_present(*this)) reconstruction_missing("Entity_Player::TakeDamage 007729d0 (wisp shields)");
|
||||
@@ -491,7 +552,7 @@ bool Entity_Player::TakeDamage(float damage, uint64_t damageFlags, const EntityR
|
||||
if (isBlocked && !isFake) return false;
|
||||
|
||||
if (temporaryEffects.HasCollectibleEffect(COLLECTIBLE_HOLY_MANTLE) && !(damageFlags & DAMAGE_RED_HEARTS))
|
||||
reconstruction_missing("Entity_Player::TakeDamage 007729d0 (Holy Mantle's shield)");
|
||||
return holy_mantle_block(*this);
|
||||
if (hallowedGroundCountdown > 0 && !(damageFlags & DAMAGE_NO_MODIFIERS))
|
||||
reconstruction_missing("Entity_Player::TakeDamage 007729d0 (Hallowed Ground)");
|
||||
if (!lua_engine_get().EntityTakeDamage(this, (float)amount, damageFlags, source, damageCountdown)) return false;
|
||||
@@ -543,7 +604,7 @@ bool Entity_Player::TakeDamage(float damage, uint64_t damageFlags, const EntityR
|
||||
voice_play(source.type == ENTITY_MOM ? SOUND_MOM_VOX_EVILLAUGH : SOUND_MOM_VOX_FILTERED_EVILLAUGH, 1,
|
||||
random_below(SOUND_BOSS_DELAY_RANDOM) + SOUND_BOSS_DELAY_MIN, 1);
|
||||
|
||||
hit_items_check(*this, damageFlags, isPenalized);
|
||||
bool isHurt = hit_items_check(*this, amount, {source, damageFlags, damage, isPenalized});
|
||||
for (size_t i = 0; i < game.room->entityList.updateEL.size(); i++)
|
||||
{
|
||||
Entity* entity = game.room->entityList.updateEL[i];
|
||||
@@ -567,7 +628,6 @@ bool Entity_Player::TakeDamage(float damage, uint64_t damageFlags, const EntityR
|
||||
!temporaryEffects.HasCollectibleEffect(COLLECTIBLE_ASTRAL_PROJECTION) && !astralProjectionBody;
|
||||
bool isInstantDeath = HasInstantDeathCurse() && amount > 0;
|
||||
bool isDeathSkipped = isAstral || temporaryEffects.HasCollectibleEffect(COLLECTIBLE_BERSERK);
|
||||
bool isHurt = true;
|
||||
|
||||
if ((redHearts < 1 && soulHearts < 1 && boneHearts < 1) || isInstantDeath)
|
||||
{
|
||||
@@ -600,26 +660,22 @@ bool Entity_Player::TakeDamage(float damage, uint64_t damageFlags, const EntityR
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isDead && HasCollectible(COLLECTIBLE_CURSED_EYE) && !HasCollectible(COLLECTIBLE_BLACK_CANDLE) && weapons[1])
|
||||
reconstruction_missing("Entity_Player::TakeDamage 007729d0 (Cursed Eye's teleport)");
|
||||
bool isTeleported = !isDead && cursed_eye_teleport(*this);
|
||||
|
||||
bool isHitAnimated = pitfallState == 0 && isHurt;
|
||||
if (HasTrinket(TRINKET_CURSED_SKULL) && !isDead)
|
||||
reconstruction_missing("Entity_Player::TakeDamage 007729d0 (Cursed Skull)");
|
||||
bool isHitAnimated = pitfallState == 0 && isHurt && !isTeleported;
|
||||
if (HasTrinket(TRINKET_CURSED_SKULL) && !isDead) cursed_skull_teleport(*this);
|
||||
if (redHearts <= scale_for_hard_difficulty(1))
|
||||
{
|
||||
if (HasCollectible(COLLECTIBLE_POLAROID) || HasCollectible(COLLECTIBLE_NEGATIVE))
|
||||
reconstruction_missing("Entity_Player::TakeDamage 007729d0 (the Polaroid and the Negative)");
|
||||
last_heart_items_trigger(*this, damageFlags);
|
||||
bool isLastHeart = soulHearts < 1 || (redHearts < 1 && soulHearts == scale_for_hard_difficulty(1));
|
||||
if (isLastHeart && (HasCollectible(COLLECTIBLE_SCAPULAR) || (HasTrinket(TRINKET_MONKEY_PAW) && variant == PLAYER_VARIANT_PLAYER)))
|
||||
reconstruction_missing("Entity_Player::TakeDamage 007729d0 (Scapular and Monkey Paw)");
|
||||
if (isLastHeart && HasTrinket(TRINKET_MONKEY_PAW) && variant == PLAYER_VARIANT_PLAYER)
|
||||
reconstruction_missing("Entity_Player::TakeDamage 007729d0 (Monkey Paw)");
|
||||
}
|
||||
|
||||
damageCooldown = damage_cooldown_scale(std::min(hurtFrames, HURT_HEARTS_MAX) * HURT_FRAMES_PER_HEART);
|
||||
flags &= ~FLAG_NO_DAMAGE_BLINK;
|
||||
if (isAstral) reconstruction_missing("Entity_Player::TakeDamage 007729d0 (Astral Projection)");
|
||||
if (HasTrinket(TRINKET_BLIND_RAGE) || HasTrinket(TRINKET_FINGER_BONE))
|
||||
reconstruction_missing("Entity_Player::TakeDamage 007729d0 (Blind Rage and Finger Bone)");
|
||||
blind_rage_finger_bone_hit(*this);
|
||||
if (isPenalized && HasCollectible(COLLECTIBLE_GLASS_CANNON)) reconstruction_missing("Entity_Player::TakeDamage 007729d0 (Glass Cannon)");
|
||||
|
||||
if (isHitAnimated)
|
||||
@@ -639,7 +695,7 @@ bool Entity_Player::TakeDamage(float damage, uint64_t damageFlags, const EntityR
|
||||
reconstruction_missing("Entity_Player::TakeDamage 007729d0 (Swallowed M80)");
|
||||
bool isGlitching = isPlayingExtraAnimation && sprite.IsPlaying("Glitch");
|
||||
if (!isDead && playerType == PLAYER_EDEN_B && isPenalized && !isGlitching)
|
||||
reconstruction_missing("Entity_Player::TakeDamage 007729d0 (Tainted Eden's reroll)");
|
||||
tainted_eden_glitch(*this);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user