Added fruit status
parent
dc8f0ace68
commit
f40b58508e
|
@ -28,6 +28,9 @@ class CelesteState(NamedTuple):
|
||||||
# Number of deaths since game start
|
# Number of deaths since game start
|
||||||
deaths: int
|
deaths: int
|
||||||
|
|
||||||
|
# If an index is true, we got a strawberry on that stage.
|
||||||
|
berries: list[bool]
|
||||||
|
|
||||||
# Distance to next point
|
# Distance to next point
|
||||||
dist: float
|
dist: float
|
||||||
|
|
||||||
|
@ -223,6 +226,7 @@ class Celeste:
|
||||||
xvel = float(self._internal_state["vx"]),
|
xvel = float(self._internal_state["vx"]),
|
||||||
yvel = float(self._internal_state["vy"]),
|
yvel = float(self._internal_state["vy"]),
|
||||||
deaths = int(self._internal_state["dc"]),
|
deaths = int(self._internal_state["dc"]),
|
||||||
|
berries = [x == "t" for x in self._internal_state["fr"][1:]],
|
||||||
|
|
||||||
dist = self._dist,
|
dist = self._dist,
|
||||||
next_point = self._next_checkpoint_idx,
|
next_point = self._next_checkpoint_idx,
|
||||||
|
|
|
@ -1275,11 +1275,25 @@ function _update()
|
||||||
hack_has_sent_first_message = true
|
hack_has_sent_first_message = true
|
||||||
out_string = "dc:" .. tostr(deaths) .. ";"
|
out_string = "dc:" .. tostr(deaths) .. ";"
|
||||||
|
|
||||||
|
-- Dash status
|
||||||
if hack_can_dash then
|
if hack_can_dash then
|
||||||
out_string = out_string .. "ds:t;"
|
out_string = out_string .. "ds:t;"
|
||||||
else
|
else
|
||||||
out_string = out_string .. "ds:f;"
|
out_string = out_string .. "ds:f;"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- Fruit status
|
||||||
|
out_string = out_string .. "fr:"
|
||||||
|
for i = 0,29 do
|
||||||
|
if got_fruit[i] then
|
||||||
|
out_string = out_string .. "t"
|
||||||
|
else
|
||||||
|
out_string = out_string .. "f"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
out_string = out_string .. ";"
|
||||||
|
|
||||||
|
|
||||||
for k, v in pairs(hack_player_state) do
|
for k, v in pairs(hack_player_state) do
|
||||||
out_string = out_string .. k ..":" .. v .. ";"
|
out_string = out_string .. k ..":" .. v .. ";"
|
||||||
|
|
Reference in New Issue