mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-26 21:49:11 +01:00
fix spacebattle (#19240)
* fix spacebattle * clean that up * . * eh * fine * .
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user