Curation round 15: restart and mods, Brimstone and Tech X, room gaps, eight bosses, the Womb and Mom's Heart, the Forgotten and tainted starts, alt path enemies and exits
This commit is contained in:
1 parent
6e3da161fc
commit
78a2680134
128 files changed
+13196
-2933
No files matched your search
@@ -0,0 +1,75 @@
|
||||
#include "entity_knife.h"
|
||||
#include "entity_laser.h"
|
||||
#include "entity_player.h"
|
||||
#include "lua_api.h"
|
||||
#include "weapon.h"
|
||||
|
||||
constexpr float LUA_ROTATE_SPEED = 8;
|
||||
constexpr float LUA_TECH_X_DAMAGE = 1;
|
||||
|
||||
// Adds Lua's EntityLaser functions that fire and turn beams to the class begun last.
|
||||
void weapon_lua_laser_register(lua_State* state)
|
||||
{
|
||||
lua_static(state, "ShootAngle", [](int variant, Vector position, float angle, int timeout, Vector offset, Entity* source) {
|
||||
return Entity_Laser::ShootAngle({.position = position,
|
||||
.posOffset = offset,
|
||||
.source = source,
|
||||
.angleDegrees = angle,
|
||||
.timeout = timeout,
|
||||
.variant = variant});
|
||||
});
|
||||
lua_static(state, "CalculateEndPoint", [](Vector start, Vector direction, Vector offset, Entity* parent, float margin) {
|
||||
return Entity_Laser::CalculateEndPoint(start, direction, offset, parent, margin);
|
||||
});
|
||||
lua_method(state, "SetActiveRotation", [](Entity_Laser& laser, int delay, float angle, float speed, bool isTimeout) {
|
||||
laser.SetActiveRotation(delay, angle, speed, isTimeout);
|
||||
});
|
||||
lua_method(state, "RotateToAngle", [](Entity_Laser& laser, float angle, LuaDefault<float, LUA_ROTATE_SPEED> speed) {
|
||||
laser.RotateToAngle(angle, speed.value);
|
||||
});
|
||||
}
|
||||
|
||||
// Adds Lua's EntityKnife functions that bring a knife back to rest to the class begun last.
|
||||
void weapon_lua_knife_register(lua_State* state)
|
||||
{
|
||||
lua_method(state, "Reset", [](Entity_Knife& knife) { knife.Reset(); });
|
||||
}
|
||||
|
||||
// Adds Lua's EntityPlayer functions that fire Technology's, Tech X's and Brimstone's lasers and Mom's Knife to the
|
||||
// class begun last.
|
||||
void weapon_lua_player_register(lua_State* state)
|
||||
{
|
||||
lua_method(state, "FireTechLaser",
|
||||
[](Entity_Player& player, Vector position, int offsetId, Vector direction, bool isLeftEye, bool isOneHit,
|
||||
Entity* source, LuaDefault<float, 1.0f> damageScale) {
|
||||
return player.FireTechLaser({.direction = direction,
|
||||
.position = position,
|
||||
.source = source,
|
||||
.damageScale = damageScale.value,
|
||||
.offsetId = offsetId,
|
||||
.isLeftEye = isLeftEye,
|
||||
.isOneHit = isOneHit});
|
||||
});
|
||||
lua_method(state, "FireTechXLaser",
|
||||
[](Entity_Player& player, Vector position, Vector velocity, float radius, Entity* source,
|
||||
LuaDefault<float, LUA_TECH_X_DAMAGE> damageMultiplier) {
|
||||
return player.FireTechXLaser({.position = position,
|
||||
.velocity = velocity,
|
||||
.source = source,
|
||||
.damageMultiplier = damageMultiplier.value,
|
||||
.radius = radius});
|
||||
});
|
||||
lua_method(state, "FireBrimstone",
|
||||
[](Entity_Player& player, Vector direction, Entity* source, LuaDefault<float, 1.0f> damageMultiplier) {
|
||||
return player.FireBrimstone(direction, source, damageMultiplier.value);
|
||||
});
|
||||
lua_method(state, "FireKnife",
|
||||
[](Entity_Player& player, Entity* parent, LuaDefault<float, 0.0f> rotationOffset,
|
||||
LuaDefault<bool, false> isCantOverwrite, LuaDefault<int, 0> subType, LuaDefault<int, 0> variant) {
|
||||
return player.FireKnife({.parent = parent,
|
||||
.rotationOffset = rotationOffset.value,
|
||||
.subType = subType.value,
|
||||
.variant = variant.value,
|
||||
.isCantOverwrite = isCantOverwrite.value});
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user