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