Curation round 17: Theora and Vorbis cutscene videos, Ludovico, Epic and Dr. Fetus, Tractor Beam and Eye of the Occult, familiars and blue spiders, fortune teller and restock, the Bag of Crafting and four tainted characters, ten enemies, water and the ultra secret door, Isaac, ???, the Lamb and Hush
This commit is contained in:
1 parent
e9de039d0f
commit
024cb12016
133 files changed
+13325
-2520
No files matched your search
@@ -1,6 +1,8 @@
|
||||
#include "entity_player_characters.h"
|
||||
#include "boss_ai.h"
|
||||
#include "entity_effect.h"
|
||||
#include "entity_familiar.h"
|
||||
#include "entity_knife.h"
|
||||
#include "entity_player_tainted.h"
|
||||
#include "game.h"
|
||||
#include "hud.h"
|
||||
@@ -29,6 +31,23 @@ constexpr int DEATHMATCH_WHORE_RED_HEARTS = 16;
|
||||
constexpr int NULLITEM_SLOW_A = 62;
|
||||
constexpr int NULLITEM_SLOW_B = 65;
|
||||
constexpr float AZAZELS_STUMP_DAMAGE_SCALE = 1.5f;
|
||||
constexpr int MAGGY_HEART_LIMIT = 4;
|
||||
constexpr int MAGGY_BIRTHRIGHT_HEART_LIMIT = 6;
|
||||
constexpr int MAGGY_DRAIN_FRAMES = 300;
|
||||
constexpr int MAGGY_DRIP_ODDS = 5;
|
||||
constexpr float MAGGY_DRIP_SCALE_SPREAD = 0.5f;
|
||||
constexpr float MAGGY_DRIP_SCALE_BASE = 0.2f;
|
||||
constexpr int MAGGY_HUG_READY = 3;
|
||||
constexpr int MAGGY_HUG_FRAMES = 9;
|
||||
constexpr int MAGGY_HUG_SUBTYPE = 4;
|
||||
constexpr float MAGGY_HUG_REACH = 6;
|
||||
constexpr float MAGGY_HUG_RISE = -14;
|
||||
constexpr int COLOR_PRIORITY_HUG = 255;
|
||||
constexpr int BERSERK_CHARGE_MAX = 99999;
|
||||
constexpr float BERSERK_CHARGE_PER_DAMAGE = 50000;
|
||||
constexpr float DEATHMATCH_DAMAGE_CHARGE_SCALE = 0.1f;
|
||||
constexpr float DAMAGE_CHARGE_PER_STAGE = 20;
|
||||
constexpr float DAMAGE_CHARGE_BASE = 40;
|
||||
constexpr float TWIN_SPEED_MAX = 2;
|
||||
constexpr float TWIN_SPEED_MIN = 0.1f;
|
||||
constexpr float TWIN_SPAWN_OFFSET = 20;
|
||||
@@ -88,16 +107,22 @@ bool is_azazel(Entity_Player& player)
|
||||
|
||||
// Whether the frame and the stat evaluation are reconstructed for the player's character: the normal ones and the
|
||||
// tainted ones the frame (00782af0, 00794e50) has no branch for. Tainted Judas's and Tainted Keeper's Birthright have
|
||||
// one.
|
||||
// one, and so has Tainted Lazarus's, which keeps both forms in the room.
|
||||
bool is_character_reconstructed(Entity_Player& player)
|
||||
{
|
||||
switch (player.playerType)
|
||||
{
|
||||
case PLAYER_JUDAS_B:
|
||||
case PLAYER_KEEPER_B:
|
||||
case PLAYER_LAZARUS_B:
|
||||
case PLAYER_LAZARUS2_B:
|
||||
return !player.HasCollectible(COLLECTIBLE_BIRTHRIGHT);
|
||||
case PLAYER_JACOB_B:
|
||||
case PLAYER_JACOB2_B:
|
||||
case PLAYER_ISAAC_B:
|
||||
case PLAYER_MAGDALENE_B:
|
||||
case PLAYER_CAIN_B:
|
||||
case PLAYER_SAMSON_B:
|
||||
case PLAYER_EVE_B:
|
||||
case PLAYER_AZAZEL_B:
|
||||
case PLAYER_EDEN_B:
|
||||
@@ -1022,3 +1047,142 @@ void character_items_hit(Entity_Player& player)
|
||||
if (isGust) effects.AddCollectibleEffect(COLLECTIBLE_BLOODY_GUST, true, 1);
|
||||
player.bloodLustCounter++;
|
||||
}
|
||||
|
||||
// 007d4320 The red hearts Tainted Magdalene keeps for good: two hearts, three with Birthright.
|
||||
int maggy_heart_limit(Entity_Player& player)
|
||||
{
|
||||
return player.HasCollectible(COLLECTIBLE_BIRTHRIGHT) ? MAGGY_BIRTHRIGHT_HEART_LIMIT : MAGGY_HEART_LIMIT;
|
||||
}
|
||||
|
||||
// Whether Tainted Magdalene holds health that drains: red hearts above her lasting ones, or soul hearts beyond the
|
||||
// last half heart.
|
||||
bool is_maggy_draining(Entity_Player& player)
|
||||
{
|
||||
return player.redHearts > maggy_heart_limit(player) || player.soulHearts > 1 ||
|
||||
(player.soulHearts == 1 && player.redHearts + player.boneHearts > 0);
|
||||
}
|
||||
|
||||
// Tainted Magdalene's drain, part of 00782af0: health above her lasting hearts loses half a heart every 300 frames,
|
||||
// red before soul. Anyone else's drain timer stays at 0.
|
||||
static void maggy_health_drain(Entity_Player& player)
|
||||
{
|
||||
if (player.playerType != PLAYER_MAGDALENE_B || !is_maggy_draining(player))
|
||||
{
|
||||
player.maggyHealthDrainCooldown = 0;
|
||||
return;
|
||||
}
|
||||
if (player.maggyHealthDrainCooldown == 0)
|
||||
{
|
||||
player.maggyHealthDrainCooldown = MAGGY_DRAIN_FRAMES;
|
||||
return;
|
||||
}
|
||||
if (--player.maggyHealthDrainCooldown >= 1) return;
|
||||
|
||||
if (player.redHearts > maggy_heart_limit(player)) player.AddHearts(-1, false, false);
|
||||
else if (is_maggy_draining(player)) player.AddSoulHearts(-1, false);
|
||||
player.maggyHealthDrainCooldown = MAGGY_DRAIN_FRAMES;
|
||||
}
|
||||
|
||||
// Tainted Magdalene's part of 00794e50: while her health drains, one frame in five drops a small spot of red creep.
|
||||
static void maggy_blood_drip(Entity_Player& player)
|
||||
{
|
||||
if (player.playerType != PLAYER_MAGDALENE_B || player.maggyHealthDrainCooldown <= 0 ||
|
||||
random_below(MAGGY_DRIP_ODDS) != 0)
|
||||
return;
|
||||
uint32_t seed = Random();
|
||||
Entity* drip = g_game->Spawn({.position = player.pos, .spawner = &player, .type = ENTITY_EFFECT,
|
||||
.variant = EFFECT_PLAYER_CREEP_RED, .seed = seed});
|
||||
float scale = random_unit() * MAGGY_DRIP_SCALE_SPREAD + MAGGY_DRIP_SCALE_BASE;
|
||||
drip->sprite.scale = vector_make(scale, scale);
|
||||
drip->Update();
|
||||
}
|
||||
|
||||
// 007d9200 Adds to Tainted Samson's berserk charge (held below full during a suplex). A full charge empties into
|
||||
// Berserk!, roaring, which reopens the backwards path's stages. The color is reevaluated.
|
||||
void Entity_Player::add_samson_berserk_charge(int amount)
|
||||
{
|
||||
samsonBerserkCharge += amount;
|
||||
if (suplexState != 0) samsonBerserkCharge = std::min(samsonBerserkCharge, BERSERK_CHARGE_MAX);
|
||||
if (samsonBerserkCharge > BERSERK_CHARGE_MAX)
|
||||
{
|
||||
samsonBerserkCharge = 0;
|
||||
if (ItemConfig_Item* berserk = g_manager->itemConfig.GetCollectible(COLLECTIBLE_BERSERK))
|
||||
temporaryEffects.AddEffect(TemporaryEffect(berserk), true, 1);
|
||||
for (int sound : {SOUND_BERSERK_START, SOUND_ISAAC_ROAR})
|
||||
{
|
||||
seed_fart_sound_override(&sound);
|
||||
g_manager->sfxManager.Play(sound);
|
||||
}
|
||||
g_game->UpdateBackwardsPathStages();
|
||||
}
|
||||
cacheFlags |= CACHE_COLOR;
|
||||
temporaryEffects.isEvaluateCachePending = true;
|
||||
}
|
||||
|
||||
// 007d3560 How much charge a point of damage dealt is worth: a tenth in a versus match, else less the deeper the
|
||||
// floor (the alternate floors count one deeper).
|
||||
float damage_charge_scale()
|
||||
{
|
||||
Game& game = *g_game;
|
||||
if (game.deathmatchManager.is_active()) return DEATHMATCH_DAMAGE_CHARGE_SCALE;
|
||||
bool isDeeper = game.stageType == STAGETYPE_REPENTANCE || game.stageType == STAGETYPE_REPENTANCE_B;
|
||||
return 1 / ((float)(game.stage + (isDeeper ? 1 : 0)) * DAMAGE_CHARGE_PER_STAGE + DAMAGE_CHARGE_BASE);
|
||||
}
|
||||
|
||||
// The Berserk! charge part of 00794e50: out of Berserk!, the damage enemies took this frame charges Tainted Samson's
|
||||
// berserk bar and any Berserk! held in an active slot.
|
||||
static void berserk_charge_update(Entity_Player& player)
|
||||
{
|
||||
bool isCharging = player.HasCollectible(COLLECTIBLE_BERSERK) || player.playerType == PLAYER_SAMSON_B;
|
||||
if (!isCharging || player.temporaryEffects.HasCollectibleEffect(COLLECTIBLE_BERSERK)) return;
|
||||
if (g_game->deathmatchManager.is_active())
|
||||
reconstruction_missing("Entity_Player::update_effects 00794e50 (the versus damage dealt)");
|
||||
float dealt = g_game->room->entityList.enemyDamageInflicted;
|
||||
if (dealt <= 0) return;
|
||||
|
||||
int charge = (int)(damage_charge_scale() * dealt * BERSERK_CHARGE_PER_DAMAGE);
|
||||
if (player.playerType == PLAYER_SAMSON_B) player.add_samson_berserk_charge(charge);
|
||||
for (int slot = 0; slot < ACTIVE_SLOT_COUNT && charge > 0; slot++)
|
||||
if (player.activeItems[slot].item == COLLECTIBLE_BERSERK)
|
||||
charge -= player.AddActiveCharge(charge, slot, false, false, true);
|
||||
}
|
||||
|
||||
// The characters' pieces of a whole frame the plain frame runs, with the items' frame (00794e50): Tainted Magdalene's
|
||||
// drain and its drip, and the Berserk! charge.
|
||||
void character_frame_update(Entity_Player& player)
|
||||
{
|
||||
maggy_health_drain(player);
|
||||
maggy_blood_drip(player);
|
||||
berserk_charge_update(player);
|
||||
}
|
||||
|
||||
// Tainted Magdalene's hug, part of 0078e1f0: touching a vulnerable enemy that is not a friend, with the last swing
|
||||
// nearly over, swings a bone club at it (along its main axis) with her melee damage doubled against her damage, the
|
||||
// tear look of a bone swing, and a 9 frame cooldown.
|
||||
void tainted_magdalene_hug(Entity_Player& player, Entity& collider)
|
||||
{
|
||||
if (player.playerType != PLAYER_MAGDALENE_B || !collider.IsVulnerableEnemy(nullptr) ||
|
||||
player.maggySwingCooldown >= MAGGY_HUG_READY || collider.HasEntityFlags(FLAG_FRIENDLY))
|
||||
return;
|
||||
|
||||
float damageScale = player.meleeDamage + player.meleeDamage;
|
||||
int displacement = (int)(Random() & 1) * 2 - 1;
|
||||
TearParams params = player.GetTearHitParams(WEAPON_BONE, damageScale / player.damage, displacement, nullptr);
|
||||
uint32_t seed = Random();
|
||||
auto* club = static_cast<Entity_Knife*>(g_game->Spawn({.position = player.pos, .spawner = &player,
|
||||
.subType = MAGGY_HUG_SUBTYPE, .type = ENTITY_KNIFE,
|
||||
.variant = KNIFE_BONE_CLUB, .seed = seed}));
|
||||
club->parent = &player;
|
||||
club->targetPosition = vector_make(MAGGY_HUG_REACH, 0);
|
||||
club->rotation = vector_angle(vector_cardinal(vector_sub(collider.pos, player.pos)));
|
||||
club->posOffset = vector_make(0, MAGGY_HUG_RISE);
|
||||
club->SetColor(params.tearColor, -1, COLOR_PRIORITY_HUG, false, true);
|
||||
club->sprite.scale = player.sprite.scale;
|
||||
club->tearFlags = params.tearFlags;
|
||||
club->SetCollisionDamage(params.tearDamage);
|
||||
// The club carries the entity flag the player's code reads as bleeding out (bit 34).
|
||||
club->AddEntityFlags(FLAG_BLEED_OUT);
|
||||
club->SetAttackAnimation();
|
||||
club->Update();
|
||||
player.maggySwingCooldown = MAGGY_HUG_FRAMES;
|
||||
}
|
||||
Reference in new issue
Block a user