fix spacebattle (#19240)

* fix spacebattle

* clean that up

* .

* eh

* fine

* .
This commit is contained in:
Kashargul
2026-03-09 00:29:55 +01:00
committed by GitHub
parent c7dada2cf1
commit a0b7ab175e
13 changed files with 188 additions and 56 deletions
@@ -71,7 +71,7 @@
"current_player" = ui.user,
"player_one" = player_one_mob,
"player_two" = player_two_mob,
"all_placed" = ships_have_been_placed == (PLAYER_ONE_PLACED_SHIPS | PLAYER_TWO_PLACED_SHIPS),
"all_placed" = ships_have_been_placed,
"shots_fired_pone" = shots_fired_pone,
"shots_fired_ptwo" = shots_fired_ptwo,
"destroyed_ships_pone" = destroyed_ships_pone,
+6 -5
View File
@@ -1,7 +1,7 @@
/**
* tgui state: board_game_state
*
* Checks that the default living handling or if the user or the object are inside a belly
* Checks the distance only based on the turf, to allow interaction with devices held in hand or people inside a belly
**/
GLOBAL_DATUM_INIT(tgui_board_game_state, /datum/tgui_state/board_game_state, new)
@@ -9,10 +9,7 @@ GLOBAL_DATUM_INIT(tgui_board_game_state, /datum/tgui_state/board_game_state, new
/datum/tgui_state/board_game_state/can_use_topic(atom/src_object, mob/user)
if(!isliving(user))
return STATUS_UPDATE
var/mob/living/living_user = user
if(isbelly(living_user.loc) || isbelly(src_object.loc))
return living_user.board_game_can_use_tgui_topic(src_object)
return living_user.default_can_use_tgui_topic(src_object)
return user.board_game_can_use_tgui_topic(src_object)
/mob/proc/board_game_can_use_tgui_topic(atom/src_object)
return STATUS_CLOSE
@@ -23,4 +20,8 @@ GLOBAL_DATUM_INIT(tgui_board_game_state, /datum/tgui_state/board_game_state, new
var/dist = get_dist(get_turf(src_object), get_turf(src))
if(dist <= 1)
return STATUS_INTERACTIVE
else if(dist <= 2) // View only if 2-3 tiles away.
return STATUS_UPDATE
else if(dist <= 5) // Disable if 5 tiles away.
return STATUS_DISABLED
return STATUS_CLOSE