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
@@ -2,6 +2,7 @@
|
||||
#include "data.h"
|
||||
#include "entity_effect.h"
|
||||
#include "entity_familiar.h"
|
||||
#include "entity_laser.h"
|
||||
#include "entity_npc.h"
|
||||
#include "entity_slot.h"
|
||||
#include "game.h"
|
||||
@@ -72,6 +73,8 @@ constexpr int PICKUP_HEART = 10;
|
||||
constexpr float PICKUP_SPAWN_RADIUS = 40;
|
||||
constexpr int POCKET_ACTIVE_SLOT = 2;
|
||||
constexpr float RANDOM_FLOAT_SCALE = 2.3283064e-10f;
|
||||
// A removed player lets go of what it holds at a tenth of its speed.
|
||||
constexpr float HELD_RELEASE_SPEED = 0.1f;
|
||||
constexpr int RED_REDEMPTION_KEY_CHARGES = 20;
|
||||
constexpr uint8_t WOODEN_CROSS_STACK = 0x10;
|
||||
constexpr std::string_view COSTUMES_DIR = "costumes";
|
||||
@@ -528,6 +531,8 @@ void Entity_Player::links_reset()
|
||||
suplexTargetPos = {};
|
||||
suplexLandPos = {};
|
||||
bagOfCraftingContent.fill(0);
|
||||
bagOfCraftingOutput = 0;
|
||||
bagOfCraftingPool = -1;
|
||||
bagOfCraftingHoldFrames = 0;
|
||||
poopSpellQueue.fill(0);
|
||||
poopMana = 0;
|
||||
@@ -1415,6 +1420,63 @@ void Entity_Player::ClearReferences()
|
||||
release_weapons_and_effects(false);
|
||||
}
|
||||
|
||||
// Forgets an entity the player spawned, removing it first when asked.
|
||||
template <typename Link> static void link_release(Link& link, bool isRemoveEntities)
|
||||
{
|
||||
if (isRemoveEntities && link) static_cast<Entity*>(link)->Remove();
|
||||
link = nullptr;
|
||||
}
|
||||
|
||||
// 00757ac0 Lets go of the weapons, then of the effects the player spawned (removed when asked), the held entity (thrown
|
||||
// on removal) and, unless it is being replaced, its stored helper players and its twin, removing its co-op players.
|
||||
void Entity_Player::release_weapons_and_effects(bool isRemoveEntities)
|
||||
{
|
||||
for (size_t slot = 1; slot <= weapons.size(); slot++)
|
||||
{
|
||||
WeaponPtr& weapon = weapons[slot % weapons.size()];
|
||||
if (weapon) weapon->ClearReferences();
|
||||
weapon.reset();
|
||||
}
|
||||
link_release(azazelsRageLaser, isRemoveEntities);
|
||||
link_release(breathOfLifeEffect, isRemoveEntities);
|
||||
link_release(megaBlastLaser, isRemoveEntities);
|
||||
link_release(markedTarget, isRemoveEntities);
|
||||
link_release(forgottenBody, isRemoveEntities);
|
||||
link_release(babyFamiliar, isRemoveEntities);
|
||||
link_release(salvationEffect, isRemoveEntities);
|
||||
link_release(tetheredEffect, isRemoveEntities);
|
||||
link_release(astralProjectionBody, isRemoveEntities);
|
||||
link_release(montezumaLaser, isRemoveEntities);
|
||||
link_release(darkArtsLastSnare, isRemoveEntities);
|
||||
link_release(darkEsau, isRemoveEntities);
|
||||
moveToTarget = {};
|
||||
if (isRemoveEntities) ThrowHeldEntity(vector_make(velocity.x * HELD_RELEASE_SPEED, velocity.y * HELD_RELEASE_SPEED));
|
||||
heldEntity = nullptr;
|
||||
if (replacedPlayer) return;
|
||||
|
||||
for (Entity_Player** helper : {&subPlayer, &backupPlayer})
|
||||
{
|
||||
if (!*helper || (*helper)->isValid || (helper == &subPlayer && !isValid)) continue;
|
||||
(*helper)->ClearReferences();
|
||||
delete std::exchange(*helper, nullptr);
|
||||
}
|
||||
PlayerManager& players = g_game->playerManager;
|
||||
Entity_Player* twin = twin_get();
|
||||
if (isRemoveEntities && twin && (twin->playerIndex == -1 || playerIndex <= twin->playerIndex || twin == this))
|
||||
players.RemoveCoPlayer(twin);
|
||||
twinPlayer = nullptr;
|
||||
if (!isRemoveEntities) return;
|
||||
|
||||
for (size_t i = 0; i < players.playerList.size(); i++)
|
||||
{
|
||||
Entity_Player* each = players.playerList[i];
|
||||
Entity* owner = each->parent && each->parent->type == ENTITY_PLAYER ? (Entity*)each->parent
|
||||
: each->variant == PLAYER_VARIANT_COOP_BABY ? players.playerList[0]
|
||||
: nullptr;
|
||||
if (owner == this && each->parent) players.RemoveCoPlayer(each);
|
||||
}
|
||||
}
|
||||
|
||||
// 0065cf60 Whether the player is a co-op baby still blinking in after joining.
|
||||
bool Entity_Player::IsP2Appearing()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user