Six agents took over Game::Start, Level::SetNextStage, BossPool, save_game_state, level generation to the first room (place_special_rooms, RoomDescriptor, load_room), Room, Camera, Entity/EntityList/EntityRef with a curated skeleton of every Entity_* subclass, Entity_Player, Game::Render, Manager::Update's run branch, RoomTransition, ItemInfoHUD and StatHUD. Integration wrote FirstTrinketOwner and room_shape_get_door_grid_index (checked against the decompile for every shape and slot) and folded the duplicated constants. A run now generates its floor, loads the start room and draws the HUD (under gdb); Isaac renders correctly when drawn, the room itself waits for Room::Render. 2479 functions taken over. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
103 lines
3.6 KiB
C++
103 lines
3.6 KiB
C++
#pragma once
|
|
|
|
#include "entity.h"
|
|
#include <array>
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
// Construction and destruction (0096ccf0, 0096cb60, 0096cd20) are the defaults. The homing path waits for
|
|
// HomingLaser's takeover.
|
|
// Field accessors (00435f20, 00435f30, 00456850, 004aaed0, 005cd580, 005cd590, 0060cea0, 0060ceb0, 007e9230,
|
|
// 007e9240) are the public fields.
|
|
// A laser (Lua's EntityLaser): a beam from its parent at an angle, its length, timeout and tear effects, the curve a
|
|
// homing one follows, and the lasers it splits into.
|
|
struct Entity_Laser : Entity
|
|
{
|
|
std::array<EntityPtr, 4> prismLasers;
|
|
std::array<EntityPtr, 2> multidimensionalLasers;
|
|
std::array<EntityPtr, 2> subLasers;
|
|
std::unique_ptr<HomingLaser> homingLaser;
|
|
std::vector<uint32_t> hitList;
|
|
TearFlags activeTearFlags;
|
|
TearFlags heldTearFlags;
|
|
TearFlags tearFlags;
|
|
EntityPtr childLaser;
|
|
EntityPtr continuumLaser;
|
|
EntityPtr parentLaser;
|
|
EntityPtr tearWaitEffect;
|
|
Entity* bounceLaser = nullptr;
|
|
Vector endPoint{};
|
|
Vector impactDirection{};
|
|
Vector impactPosition{};
|
|
Vector parentOffset{};
|
|
float angleDegrees = 0;
|
|
float blackHpDropChance = 0;
|
|
float curveStrength = 0;
|
|
float damageMultiplier = 0;
|
|
float impactDistance = 0;
|
|
float laserLength = 0;
|
|
float lastAngleDegrees = 0;
|
|
float maxDistance = 0;
|
|
float radius = 0;
|
|
float rotationDegrees = 0;
|
|
float rotationSpd = 0;
|
|
float scale = 0;
|
|
float startAngleDegrees = 0;
|
|
float subLaserAngle = 0;
|
|
float subLaserDistance = 0;
|
|
int chainedLasers = 0;
|
|
int timeout = 0;
|
|
int waitFrames = 0;
|
|
uint32_t homingType = 0;
|
|
uint32_t rotationDelay = 0;
|
|
bool isActiveRotating = false;
|
|
bool isDisableFollowParent = false;
|
|
bool isDisableInitSound = false;
|
|
bool isFirstUpdate = false;
|
|
bool isGridHit = false;
|
|
bool isMultidimensionalTouched = false;
|
|
bool isOneHit = false;
|
|
bool isPrismTouched = false;
|
|
bool isSampleLaser = false;
|
|
bool isShrink = false;
|
|
|
|
void Init(int type, int variant, int subType, uint32_t initSeed) override;
|
|
void Update() override;
|
|
void Interpolate() override;
|
|
void Render(const Vector& offset) override;
|
|
bool RenderShadowLayer(const Vector& offset) override;
|
|
void PostRender() override;
|
|
void Remove() override;
|
|
int GetRenderZ() override;
|
|
bool CanOverwrite() override;
|
|
void ClearReferences() override;
|
|
bool HandleCollision(Entity* collider, bool isLow) override;
|
|
|
|
bool IsCircleLaser();
|
|
bool is_thick_variant();
|
|
bool CanDamageEntity(Entity* entity);
|
|
void impact_tear_flag_effects(const Vector& position, const Vector& direction);
|
|
ColorMod* get_tear_spawn_color(const ColorMod& outColor);
|
|
void copy_from_parent(Entity_Laser* parent, bool isCopySpawnData);
|
|
void RotateToAngle(float angle, float speed);
|
|
void ClearLaserSamples();
|
|
void PlayInitSound();
|
|
Vector calc_end_point(const Vector& start, const Vector& direction);
|
|
void update_first_frame();
|
|
void find_nearest_grid_hit(int unusedFlag, const Vector& offset);
|
|
uint8_t damage_grid_entity(int gridIndex, int unused, const Vector& direction);
|
|
void update_line_hits();
|
|
void update_endpoint_and_hits();
|
|
void refresh_tear_params();
|
|
void update_laser();
|
|
void UpdateHits();
|
|
void* GetSamples();
|
|
void damage_entity(Entity*);
|
|
void* GetNonOptimizedSamples();
|
|
void spawn_impact_effect(int unused);
|
|
void ResetSpriteScale();
|
|
void set_scale(float scale);
|
|
void update_sample_points(char);
|
|
static void update_wiggle_path(void* samples, float amplitude, float phase);
|
|
};
|