Create a Decorative object class

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2026-03-13 19:54:22 +01:00
parent 3c0e8f7d8a
commit 7835a6051e
4 changed files with 122 additions and 125 deletions

View File

@@ -0,0 +1,22 @@
import 'package:wolf_dart/classes/entity.dart';
class Decorative extends Entity {
Decorative({
required super.x,
required super.y,
required super.spriteIndex,
required super.mapId,
super.state = EntityState.staticObj, // Defaults to static
});
// Checks if the Map ID belongs to a standard decoration
static bool isDecoration(int objId) {
return (objId >= 23 && objId <= 70) || objId == 124;
}
// Safely calculates the VSWAP sprite index for standard decorations
static int getSpriteIndex(int objId) {
if (objId == 124) return 95; // Dead guard
return objId - 21;
}
}