Shared character defaults, fixed paths and names, one global font
This commit is contained in:
1 parent
4962eac7a8
commit
7dbb4cc154
22 files changed
+434
-567
No files matched your search
+8
-9
@@ -87,8 +87,7 @@ void Items::update(Play& play, Pointer pointer)
|
||||
Stats& stats = body.stats;
|
||||
Actor& active = play.pointer_actor_get();
|
||||
Audio& audio = *play.audio;
|
||||
int areaIndex = character.area_get(body.stage);
|
||||
Area area = areaIndex >= 0 ? character.areas[areaIndex] : Area{};
|
||||
Area& area = character.area;
|
||||
Rect bounds = play.bounds;
|
||||
bool isOver = body.is_over_capacity();
|
||||
auto text_play = [&](Hook hook) {
|
||||
@@ -97,7 +96,7 @@ void Items::update(Play& play, Pointer pointer)
|
||||
};
|
||||
auto release = [&](bool isThrown) {
|
||||
drop();
|
||||
active.play(character.cursor.idle);
|
||||
active.play(CURSOR_ANIMATION_IDLE);
|
||||
if (!isThrown && !body.actor.pending)
|
||||
body.idle_play();
|
||||
};
|
||||
@@ -122,7 +121,7 @@ void Items::update(Play& play, Pointer pointer)
|
||||
spawnDelay--;
|
||||
for (int id : spawnQueue)
|
||||
{
|
||||
Rect spawn = areaIndex >= 0 ? area.spawn : bounds;
|
||||
Rect spawn = area.anm2 ? area.spawn : bounds;
|
||||
Vec2 position = {spawn.x + random_get(0, spawn.w), spawn.y + random_get(0, spawn.h)};
|
||||
if (!discovered[id])
|
||||
{
|
||||
@@ -172,7 +171,7 @@ void Items::update(Play& play, Pointer pointer)
|
||||
stats.calories += item.calories;
|
||||
stats.totalCalories += item.calories;
|
||||
stats.capacity =
|
||||
std::clamp(stats.capacity + item.capacityBonus, traits.capacityMin, traits.capacityMax);
|
||||
std::clamp(stats.capacity + item.capacityBonus, traits.capacity, traits.capacityMax);
|
||||
stats.digestionRate = std::clamp(stats.digestionRate + item.digestionBonus,
|
||||
traits.digestionRateMin, traits.digestionRateMax);
|
||||
stats.totalConsumed++;
|
||||
@@ -244,7 +243,7 @@ void Items::update(Play& play, Pointer pointer)
|
||||
{
|
||||
isHovered = true;
|
||||
tooltip = held == i || pointer.isAutomated ? -1 : entity.id;
|
||||
active.play(character.cursor.hover, TRANSITION_IF_IDLE);
|
||||
active.play(CURSOR_ANIMATION_HOVER, TRANSITION_IF_IDLE);
|
||||
play.cursorState = CURSOR_HOVER;
|
||||
if (pointer.isClicked)
|
||||
{
|
||||
@@ -254,14 +253,14 @@ void Items::update(Play& play, Pointer pointer)
|
||||
}
|
||||
if (pointer.isDown)
|
||||
{
|
||||
active.play(character.cursor.grab);
|
||||
active.play(CURSOR_ANIMATION_GRAB);
|
||||
play.cursorState = CURSOR_ACTION;
|
||||
held = moved = i;
|
||||
}
|
||||
if (pointer.isRightClicked)
|
||||
{
|
||||
audio.play(character.sounds[SOUND_DISPOSE]);
|
||||
active.play(character.cursor.dispose, TRANSITION_FORCE, INTERRUPT_NEVER);
|
||||
active.play(CURSOR_ANIMATION_DISPOSE, TRANSITION_FORCE, INTERRUPT_NEVER);
|
||||
play.particles_spawn(character.catalog.disposeParticles, position);
|
||||
held = held == i ? -1 : held > i ? held - 1 : held;
|
||||
moved = moved == i ? -1 : moved > i ? moved - 1 : moved;
|
||||
@@ -313,6 +312,6 @@ void Items::update(Play& play, Pointer pointer)
|
||||
held = (int)list.size() - 1;
|
||||
}
|
||||
if (wasHovered && !isHovered)
|
||||
active.play(character.cursor.idle);
|
||||
active.play(CURSOR_ANIMATION_IDLE);
|
||||
pointerPrevious = pointer.position;
|
||||
}
|
||||
Reference in new issue
Block a user