Curation round 19: EvaluateItems and charged shots, actives split into Rebirth and Repentance dispatches, cards and runes, champions and death effects, War, Death, Uriel and the boss sweep, Delirium, T. Lilith's Gello and familiars, effects, price sprites and the devil room
This commit is contained in:
1 parent
9dfc09518c
commit
ee863e70e6
105 files changed
+14201
-2331
No files matched your search
@@ -20,7 +20,6 @@
|
||||
#include <array>
|
||||
#include <cmath>
|
||||
|
||||
constexpr uint32_t CACHE_TWIN_SPEED = 0x80000000;
|
||||
constexpr int CHARGE_STORE_MAX = 99;
|
||||
constexpr int SOUL_CHARGE_CONSUMABLE = 0x20;
|
||||
constexpr int BLOOD_CHARGE_CONSUMABLE = 0x100;
|
||||
@@ -1193,3 +1192,134 @@ void tainted_magdalene_hug(Entity_Player& player, Entity& collider)
|
||||
club->Update();
|
||||
player.maggySwingCooldown = MAGGY_HUG_FRAMES;
|
||||
}
|
||||
|
||||
// Cambion Conception's familiars by the flags conceptionFamiliarFlags keeps (Leech to Succubus, then Lil Abaddon and
|
||||
// Twisted Pair once unlocked), the stages its hits pass, and Immaculate Conception's stage size and costume stages.
|
||||
constexpr std::array<uint32_t, 6> CAMBION_FAMILIAR_FLAGS = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20};
|
||||
constexpr uint32_t CAMBION_LIL_ABADDON_FLAG = 0x800;
|
||||
constexpr uint32_t CAMBION_TWISTED_PAIR_FLAG = 0x1000;
|
||||
constexpr int ACHIEVEMENT_LIL_ABADDON = 455;
|
||||
constexpr int ACHIEVEMENT_TWISTED_PAIR = 502;
|
||||
constexpr std::array<int, 4> CAMBION_STAGE_HITS = {15, 30, 60, 90};
|
||||
constexpr int CAMBION_LAST_STAGE_END = 99;
|
||||
constexpr int CAMBION_COSTUME_STEP = 10;
|
||||
constexpr int CAMBION_LAST_COSTUME_STEP = 3;
|
||||
constexpr int CAMBION_FIRST_COSTUME_STEP = 5;
|
||||
constexpr int IMMACULATE_COSTUME_STEP = 5;
|
||||
constexpr int IMMACULATE_COSTUME_STEP_VERSUS = 20;
|
||||
constexpr int IMMACULATE_STAGE_END = 15;
|
||||
constexpr int IMMACULATE_STAGE_END_VERSUS = 60;
|
||||
constexpr std::array<std::string_view, 3> CAMBION_COSTUMES = {
|
||||
"gfx/characters/costumes/costume_412_cambionconception_stage1.png",
|
||||
"gfx/characters/costumes/costume_412_cambionconception_stage2.png",
|
||||
"gfx/characters/costumes/costume_412_cambionconception_stage3.png"};
|
||||
constexpr std::array<std::string_view, 3> IMMACULATE_COSTUMES = {
|
||||
"gfx/characters/costumes/costume_413_immaculateconception_stage1.png",
|
||||
"gfx/characters/costumes/costume_413_immaculateconception_stage2.png",
|
||||
"gfx/characters/costumes/costume_413_immaculateconception_stage3.png"};
|
||||
|
||||
// 007c9080 How many of Cambion Conception's stages the player's hits passed (15, 30, 60 and 90 hits).
|
||||
static int cambion_stage_get(const Entity_Player& player)
|
||||
{
|
||||
return (int)std::ranges::count_if(CAMBION_STAGE_HITS, [&](int hits) { return player.cambionConceptionState >= hits; });
|
||||
}
|
||||
|
||||
// 007c90b0 Cambion Conception's costume stage: a step every five hits up to fifteen, then every ten within each later
|
||||
// stage, and every three past ninety.
|
||||
int Entity_Player::GetCambionPregnancyLevel()
|
||||
{
|
||||
int hits = cambionConceptionState;
|
||||
if (hits < CAMBION_STAGE_HITS[0]) return hits / CAMBION_FIRST_COSTUME_STEP;
|
||||
if (hits < CAMBION_STAGE_HITS[1]) return (hits - CAMBION_STAGE_HITS[0]) / CAMBION_FIRST_COSTUME_STEP;
|
||||
if (hits < CAMBION_STAGE_HITS[2]) return (hits - CAMBION_STAGE_HITS[1]) / CAMBION_COSTUME_STEP;
|
||||
if (hits < CAMBION_STAGE_HITS[3]) return (hits - CAMBION_STAGE_HITS[2]) / CAMBION_COSTUME_STEP;
|
||||
if (hits < CAMBION_LAST_STAGE_END) return (hits - CAMBION_STAGE_HITS[3]) / CAMBION_LAST_COSTUME_STEP;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 007c7d70 Dresses the player in the conception's costume for its stage, in the player's skin colour.
|
||||
// The original reads past Immaculate Conception's costumes on a wrong state. This keeps to the last one.
|
||||
void Entity_Player::trigger_immaculate_conception(bool isCambion)
|
||||
{
|
||||
std::string_view costume;
|
||||
if (isCambion) costume = CAMBION_COSTUMES[GetCambionPregnancyLevel()];
|
||||
else
|
||||
{
|
||||
bool isVersus = g_game->deathmatchManager.is_active();
|
||||
int step = isVersus ? IMMACULATE_COSTUME_STEP_VERSUS : IMMACULATE_COSTUME_STEP;
|
||||
if (immaculateConceptionState >= (isVersus ? IMMACULATE_STAGE_END_VERSUS : IMMACULATE_STAGE_END))
|
||||
KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"[err] Immaculate has a wrong state!");
|
||||
costume = IMMACULATE_COSTUMES[std::min(immaculateConceptionState / step, (int)IMMACULATE_COSTUMES.size() - 1)];
|
||||
}
|
||||
std::string path = costume_path_apply_skin_color(std::string(costume), bodyColor, playerType, nullptr, nullptr);
|
||||
int item = isCambion ? COLLECTIBLE_CAMBION_CONCEPTION : COLLECTIBLE_IMMACULATE_CONCEPTION;
|
||||
ReplaceCostumeSprite(g_manager->itemConfig.GetCollectible(item), path);
|
||||
}
|
||||
|
||||
// Part of 007729d0: Cambion Conception counts the hit. Passing a stage gives a familiar not yet given (from a random
|
||||
// start), and a new costume stage redresses the player.
|
||||
void cambion_conception_hit(Entity_Player& player)
|
||||
{
|
||||
int stage = cambion_stage_get(player);
|
||||
int costume = player.GetCambionPregnancyLevel();
|
||||
player.cambionConceptionState++;
|
||||
if (stage != cambion_stage_get(player))
|
||||
{
|
||||
std::vector<uint32_t> flags(CAMBION_FAMILIAR_FLAGS.begin(), CAMBION_FAMILIAR_FLAGS.end());
|
||||
if (g_manager->persistentGameData.Unlocked(ACHIEVEMENT_LIL_ABADDON)) flags.push_back(CAMBION_LIL_ABADDON_FLAG);
|
||||
if (g_manager->persistentGameData.Unlocked(ACHIEVEMENT_TWISTED_PAIR)) flags.push_back(CAMBION_TWISTED_PAIR_FLAG);
|
||||
uint32_t start = player.GetCollectibleRNG(COLLECTIBLE_CAMBION_CONCEPTION).RandomInt((uint32_t)flags.size());
|
||||
for (size_t i = 0; i < flags.size(); i++)
|
||||
{
|
||||
uint32_t flag = flags[(start + i) % flags.size()];
|
||||
if (player.conceptionFamiliarFlags & flag) continue;
|
||||
|
||||
int sound = SOUND_CAMBION_CONCEPTION;
|
||||
seed_fart_sound_override(&sound);
|
||||
g_manager->sfxManager.Play(sound);
|
||||
player.conceptionFamiliarFlags |= flag;
|
||||
player.cacheFlags |= CACHE_FAMILIARS;
|
||||
player.EvaluateItems();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (costume != player.GetCambionPregnancyLevel()) player.trigger_immaculate_conception(true);
|
||||
}
|
||||
|
||||
// Birthright's lasting gains: Magdalene's, Keeper's and Tainted Magdalene's heart container, Lazarus risen's Red Stew
|
||||
// time, the slot Tainted Forgotten's Recall takes and Tainted Bethany's effect count.
|
||||
constexpr int BIRTHRIGHT_HEARTS = 2;
|
||||
constexpr int BIRTHRIGHT_RED_STEW_FRAMES = 1800;
|
||||
constexpr int BIRTHRIGHT_RECALL_SLOT = 2;
|
||||
constexpr int BIRTHRIGHT_BETHANY_EFFECTS = 4;
|
||||
|
||||
// Part of 0075f0e0: what Birthright does as it is picked up, by character. Judas's Book of Belial swap, Eden's three
|
||||
// items and Jacob and Esau's shared items are not reconstructed yet.
|
||||
void birthright_gain(Entity_Player& player, bool isFirstTime)
|
||||
{
|
||||
switch (player.playerType)
|
||||
{
|
||||
case PLAYER_MAGDALENE:
|
||||
case PLAYER_KEEPER:
|
||||
case PLAYER_MAGDALENE_B:
|
||||
if (!isFirstTime) return;
|
||||
player.AddMaxHearts(BIRTHRIGHT_HEARTS, false);
|
||||
player.AddHearts(BIRTHRIGHT_HEARTS, false, false);
|
||||
return;
|
||||
case PLAYER_EVE: return player.UpdateHeartDependentEffects();
|
||||
case PLAYER_LAZARUS2:
|
||||
if (isFirstTime) player.redStewBonusDuration = BIRTHRIGHT_RED_STEW_FRAMES;
|
||||
return;
|
||||
case PLAYER_EDEN_B: player.edenBirthrightFrame = g_game->frameCount + 1; return;
|
||||
case PLAYER_THEFORGOTTEN_B: return player.SetPocketActiveItem(COLLECTIBLE_RECALL, BIRTHRIGHT_RECALL_SLOT, false);
|
||||
case PLAYER_BETHANY_B:
|
||||
if (isFirstTime) player.temporaryEffects.AddNullEffect(NULLITEM_BETHANY_B_BIRTHRIGHT, false, BIRTHRIGHT_BETHANY_EFFECTS);
|
||||
return;
|
||||
case PLAYER_JUDAS:
|
||||
case PLAYER_BLACKJUDAS:
|
||||
case PLAYER_EDEN:
|
||||
case PLAYER_JACOB:
|
||||
case PLAYER_ESAU:
|
||||
reconstruction_missing("Entity_Player::AddCollectible 0075f0e0 (this character's Birthright)");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user