1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
-----------------------------
-- Tribute Pile Viewer Manager
-----------------------------
internalassert ( TRIBUTE_BOARD_LOCATION_ITERATION_END == 18 , "New TRIBUTE_BOARD_LOCATION added, check if it should be added to the PILE_FAMILIES table" )
local PILE_FAMILIES =
{
{ TRIBUTE_BOARD_LOCATION_PLAYER_DECK , TRIBUTE_BOARD_LOCATION_PLAYER_HAND , TRIBUTE_BOARD_LOCATION_PLAYER_COOLDOWN } ,
{ TRIBUTE_BOARD_LOCATION_OPPONENT_DECK , TRIBUTE_BOARD_LOCATION_OPPONENT_COOLDOWN } ,
{ TRIBUTE_BOARD_LOCATION_DOCKS_DECK , TRIBUTE_BOARD_LOCATION_DOCKS_DISCARD } ,
{ TRIBUTE_BOARD_LOCATION_PLAYER_BOARD_AGENT , TRIBUTE_BOARD_LOCATION_PLAYER_BOARD_ACTION } ,
{ TRIBUTE_BOARD_LOCATION_OPPONENT_BOARD_AGENT , TRIBUTE_BOARD_LOCATION_OPPONENT_BOARD_ACTION } ,
}
local COMPOSITE_PILE_GROUPINGS =
{
{
BOARD_LOCATIONS = { TRIBUTE_BOARD_LOCATION_PLAYER_DECK , TRIBUTE_BOARD_LOCATION_PLAYER_HAND } ,
} ,
{
BOARD_LOCATIONS = { TRIBUTE_BOARD_LOCATION_OPPONENT_DECK , TRIBUTE_BOARD_LOCATION_OPPONENT_HAND } ,
OVERRIDE_VIEWER = true ,
} ,
}
return family
end
end
end
return nil
end
-- First build any composite piles, which may get used in place of regular pile viewer piles
-- Make special composite piles that are used for some special cases where we want to describe piles as grouped together
-- This is sort of a hack solution to make the opponent DECK/HAND appear as one pile when viewed, to combat card counting
-- This also fascilitates combining the player and opponent's DECK and HAND being counted together for the Patron card count tooltips
local compositePilesData = { }
local boardLocations = compositePileGrouping . BOARD_LOCATIONS
compositePileData . overrideViewer = compositePileGrouping . OVERRIDE_VIEWER
compositePilesData [ boardLocation ] = compositePileData
end
end
-- Next build all the piles for the viewer out of the families
local pilesData = { }
internalassert ( pilesData [ boardLocation ] == nil , "The pile at board location %d already exists." , boardLocation )
end
end
EVENT_MANAGER : RegisterForEvent ( "TributePileViewer_Manager" , EVENT_GAMEPAD_PREFERRED_MODE_CHANGED , function ( ) self : SetViewingPile ( nil ) end )
EVENT_MANAGER : RegisterForEvent ( "TributePileViewer_Manager" , EVENT_TRIBUTE_PILE_UPDATED , function ( _ , boardLocation )
local viewingPileChanged = false
local compositePileData = compositePilesData [ boardLocation ]
if compositePileData then
if compositePileData . overrideViewer and self . isViewingPileLocation and ZO_IsElementInNumericallyIndexedTable ( compositePileData : GetBoardLocations ( ) , self . isViewingPileLocation ) then
viewingPileChanged = true
end
end
if pileData then
viewingPileChanged = true
end
end
if viewingPileChanged then
end
end )
EVENT_MANAGER : RegisterForEvent ( "TributePileViewer_Manager" , EVENT_TRIBUTE_VIEW_PILE , function ( _ , boardLocation )
if pileData then
end
end )
EVENT_MANAGER : RegisterForEvent ( "TributePileViewer_Manager" , EVENT_TRIBUTE_CARD_STATE_FLAGS_CHANGED , function ( _ , cardInstanceId , stateFlags )
end
end )
EVENT_MANAGER : RegisterForEvent ( "TributePileViewer_Manager" , EVENT_TRIBUTE_AGENT_DEFEAT_COST_CHANGED , function ( _ , cardInstanceId , delta , newDefeatCost , shouldPlayFx )
end
end )
EVENT_MANAGER : RegisterForEvent ( "TributePileViewer_Manager" , EVENT_TRIBUTE_BEGIN_TARGET_SELECTION , function ( _ , needsTargetViewer )
--Close the viewer if target selection begins
local NO_PILE = nil
end
end )
EVENT_MANAGER : RegisterForEvent ( "TributePileViewer_Manager" , EVENT_TRIBUTE_BEGIN_MECHANIC_SELECTION , function ( _ , cardInstanceId )
--Close the viewer if mechanic selection begins
local NO_PILE = nil
end
end )
end , "tributePileViewer" )
end
end
end
if compositePileData and compositePileData . overrideViewer then
return compositePileData
end
end
else
return nil
end
end
end
end
end
|