Curation round 16: Mom's Knife and the bone club, sin minibosses and death rewards, slots and beggars, NPC rendering and twelve bosses, alt path visuals, the Forgotten's flight and tainted HUDs, Sheol and the Cathedral to the credits, familiars and transformations

This commit is contained in:
shweet committed 2026-11-20 22:44:36 -05:00
1 parent 76c594f9a0
commit e9de039d0f
151 files changed
+14996 -5208

No files matched your search

+79 -10
View File
@@ -4,13 +4,51 @@
#include "homing_laser.h"
#include <vector>
// The distances a knife has no use for yet: removed or shown once it flies past them.
// The distances a knife has no use for yet: where it splits off its parent and where it shows up.
constexpr float KNIFE_DISTANCE_NONE = -1;
// The knives (Lua's KnifeVariant): Mom's Knife, the Forgotten's swung weapons, Bloody Babylon's and the swords.
enum KnifeVariant : int
{
KNIFE_MOMS_KNIFE,
KNIFE_BONE_CLUB,
KNIFE_BONE_SCYTHE,
KNIFE_DONKEY_JAWBONE,
KNIFE_BAG_OF_CRAFTING,
KNIFE_SUMPTORIUM,
KNIFE_BERSERK_CLUB = 8,
KNIFE_NOTCHED_AXE = 9,
KNIFE_SPIRIT_SWORD = 10,
KNIFE_TECH_SWORD = 11
};
// What a knife is by subtype: held or thrown, following a homing path, chained to its parent, or swung as an item.
enum KnifeSubType : int
{
KNIFE_SUBTYPE_HELD,
KNIFE_SUBTYPE_PATH,
KNIFE_SUBTYPE_CHAINED = 3,
KNIFE_SUBTYPE_HELD_ITEM = 4
};
// Where apply_hit_effects lands its effects: the knife's point, the target and its size, the damage and its flags, and
// whether the knife hit while thrown.
struct KnifeHit
{
Vector position{};
Vector targetPosition{};
Entity* target = nullptr;
uint64_t damageFlags = 0;
float damage = 0;
float targetSize = 0;
bool isFlying = false;
};
// Construction and destruction (00960b50, 00960a70) are the defaults.
// Field accessors (004d7790, 004d77a0, 0060cf10, 0060cfb0, 0085de90, 0085deb0, 0085dec0) are the public fields.
// A knife (Lua's EntityKnife): Mom's Knife and the swung weapons (bones, clubs, swords), with the tear effects they
// carry, their charge and flight, and the path a homing knife follows.
// carry, their charge and flight, and the path a homing knife follows. A knife split off its parent (Cricket's Body,
// Angelic Prism) follows it out to splitDistance, then turns off by splitAngle and splitOffset.
struct Entity_Knife : Entity
{
HomingLaser homingLaser;
@@ -23,10 +61,12 @@ struct Entity_Knife : Entity
EntityPtr techLaser;
Vector anchorPosition{};
Vector initPosition{};
Vector splitOffset{};
float basePosOffsetY = 0;
float charge = 0;
float displayRotation = 0;
float fallingSpeed = 0;
float flightAngle = 0;
float height = 0;
float knifeDepthOffset = 0;
float knifeDistance = 0;
@@ -36,18 +76,24 @@ struct Entity_Knife : Entity
float pathOffset = 0;
float pathProgress = 0;
float rotation = 0;
float removeDistance = KNIFE_DISTANCE_NONE;
float rotationOffset = 0;
float scale = 0;
float showDistance = KNIFE_DISTANCE_NONE;
float splitAngle = 0;
float splitDistance = KNIFE_DISTANCE_NONE;
int pathSegment = 0;
short spinsLeft = 0;
short swingEffects = 0;
short swingTick = 0;
bool isAttacking = false;
bool isDeadEyeHit = false;
bool isFlying = false;
bool isMultidimensionalApplied = false;
bool isPrimaryClub = false;
bool isPrismApplied = false;
bool isRecoiled = false;
bool isSpinAttack = false;
bool isSwingCharged = false;
bool isSwinging = false;
bool isUsingParentHitList = false;
@@ -61,19 +107,42 @@ struct Entity_Knife : Entity
int GetBaseVariant();
std::vector<uint32_t>& GetHitEntities();
void InitHomingPath(Vector direction, Entity* source, float pathOffset);
void copy_parent_state(Entity_Knife* source);
uint32_t spawn_child_knife();
void InitHomingPath(Vector direction, Entity* source, float offset);
void copy_parent_state(Entity_Knife& source);
bool spawn_child_knife();
Entity_Player* GetPlayer();
Entity* GetRootParent();
Entity_Knife* GetRootParent();
void Shoot(float charge, float range);
void UpdateHomingPath();
void update_target(float* outAngle);
void apply_wiggle(float*);
void update_target(float& angle);
void apply_wiggle(float& angle);
void screen_wrap();
void Reset();
void SetAttackAnimation();
void SpinAttack(short remainingSpins, int startFrame);
uint8_t drain_notched_axe(int charge);
bool drain_notched_axe(int charge);
void UpdateSwingHits();
void apply_hit_effects(const KnifeHit& hit);
private:
bool held_update(Entity_Player* player);
void ludovico_update();
void path_update();
void chained_update();
void held_item_update();
void hydrobounce_land();
void hydrobounce_update();
void lasers_update(Entity_Player* player);
void grid_hit_update(Entity_Player* player);
void sword_beam_fire(Entity_Player* player);
void brimstone_knife_spawn(Entity_Player* player);
void render_orbit_trail(const Vector& offset);
};
bool is_swung_knife_variant(int variant);
float bezier_closest_point(const Vector& point, const BezierPoint& start, const BezierPoint& end, float& outT);
Vector room_screen_wrap(const Vector& position, float margin);
void tear_flags_area_apply(const Vector& position, Entity* source, float radius, float damage,
const TearFlags& flags);
extern Entity_Player* g_notchedAxePlayer;