Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/items
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-08-19 00:18:51 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-08-19 00:18:51 +1000
commit156c243360d8a747c5951fe6a49abec9dafb11e0 (patch)
treef688377a3d4ad80a4bd15788ec8bf5f175819adb /source/game/items
parent7860262a3b88cfe52b1ce24f18cdb25f225952b5 (diff)
improve applyTileModifications to be more aggressive
Diffstat (limited to 'source/game/items')
-rw-r--r--source/game/items/StarMaterialItem.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/game/items/StarMaterialItem.cpp b/source/game/items/StarMaterialItem.cpp
index 99cdead..9ca9862 100644
--- a/source/game/items/StarMaterialItem.cpp
+++ b/source/game/items/StarMaterialItem.cpp
@@ -103,9 +103,10 @@ void MaterialItem::fire(FireMode mode, bool shifting, bool edgeTriggered) {
if (*m_lastAimPosition != aimPosition) {
diff = geo.diff(*m_lastAimPosition, aimPosition);
float magnitude = diff.magnitude();
- if (magnitude > 32) {
- m_lastAimPosition = aimPosition + diff.normalized() * 32;
- magnitude = 32;
+ float limit = max(4.f, 64.f / radius);
+ if (magnitude > limit) {
+ m_lastAimPosition = aimPosition + diff.normalized() * limit;
+ magnitude = limit;
}
steps = (int)ceil(magnitude * (Constants::pi / 2));
@@ -133,8 +134,8 @@ void MaterialItem::fire(FireMode mode, bool shifting, bool edgeTriggered) {
if (!fail) {
auto sound = Random::randValueFrom(m_placeSounds, "");
if (total && !sound.empty()) {
- float intensity = clamp((float)total / 20, 0.0f, 1.0f);
- owner()->addSound(sound, 1.0f + intensity, (1.25f - intensity * 0.75f) * Random::randf(0.9f, 1.1f));
+ float intensity = clamp((float)total / 96, 0.0f, 1.0f);
+ owner()->addSound(sound, 1.0f + intensity, (1.125f - intensity * 0.75f) * Random::randf(0.9f, 1.1f));
}
FireableItem::fire(mode, shifting, edgeTriggered);
}