|
|
|
@ -19,6 +19,7 @@ namespace components { |
|
|
|
|
struct Motion { |
|
|
|
|
int dx; |
|
|
|
|
int dy; |
|
|
|
|
bool random=false; |
|
|
|
|
DEFINE_SERIALIZABLE(Motion, dx, dy); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
@ -68,6 +69,8 @@ namespace components { |
|
|
|
|
world.set<EnemyConfig>(entity, {config["hearing_distance"]}); |
|
|
|
|
} else if(comp["type"] == "Combat") { |
|
|
|
|
world.set<Combat>(entity, {config["hp"], config["damage"]}); |
|
|
|
|
} else if(comp["type"] == "Motion") { |
|
|
|
|
world.set<Motion>(entity, {config["dx"], config["dy"], config["random"]}); |
|
|
|
|
} else { |
|
|
|
|
dbc::sentinel(fmt::format("ITEM COMPONENT TYPE MISSING: {}", |
|
|
|
|
std::string(comp["type"]))); |
|
|
|
|