Skip to content

Commit

Permalink
- Fixed for yet another rule misinterpretation regarding Missions (only
Browse files Browse the repository at this point in the history
failed missions that have a distance marker are to be reshuffled after
jumping)
- Added fix for revealed Karl getting notifications of “outside
Galactica”
- Fixed Cylon Ships Activation Flag on the new Ships buttons
- Added a “Discard Random Card” button; copies the discarded card to
clipboard to make it easier for the mod. Changed Apollo’s Headstrong to
behave similarly
- Minor interface changes
  • Loading branch information
mawkee authored and mawkee committed May 21, 2015
1 parent 531950c commit d63b99d
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 10 deletions.
Binary file modified BSG Moderator Template.ods
Binary file not shown.
6 changes: 4 additions & 2 deletions BSG Moderator Template/Basic/Standard/Crisis.xml
Original file line number Diff line number Diff line change
Expand Up @@ -519,14 +519,16 @@ sub DiscardCurrentMission
exit sub
end if

if CrisisSheet.getCellByPosition(_MissionStatusCol, refrow + crisisID).string = "Passed" then
if CrisisSheet.getCellByPosition(_MissionStatusCol, refrow + crisisID).string = "Passed" _
or CrisisSheet.getCellByPosition(_MissionDistanceCol, refrow + crisisID).string = "" then
CrisisSheet.getCellByPosition(refcol, refrow + crisisID).string = "X"
else
CrisisSheet.getCellByPosition(_MissionStatusCol, refrow + crisisID).string = ""
CrisisSheet.getCellByPosition(_MissionCol, refrow + crisisID).string = CrisisSheet.getCellByPosition(_MissionCol+1, refrow + crisisID).string
CrisisSheet.getCellByPosition(_MissionCol, refrow + crisisID).CharColor = CrisisSheet.getCellByPosition(_MissionCol+1, refrow + crisisID).CharColor
CrisisSheet.getCellByPosition(_MissionCol+1, refrow + crisisID).string = ""
ShuffleMissionDeck FALSE
msgbox "Since last Mission played had a distance marker and it failed, Mission deck was reshuffled"
end if
SetMissionBtns TRUE
end sub
Expand Down Expand Up @@ -2210,7 +2212,7 @@ sub DispatchMissionButton
mtitle = mtitle & CrisisSheet.GetCellByPosition(_MissionValueCol, mrow).string
' We use _SkillIDBaseMax instead of SkillBaseMax because there are no Missions that uses Treachery or Faith cards
for skillid = _SkillIDMin to _SkillIDBaseMax
tmpstr = CrisisSheet.getCellByPosition(_MissionSkillCol + skillID - 1, mrow).string
tmpstr = CrisisSheet.getCellByPosition(_MissionSkillCol + skillID, mrow).string
if tmpstr = "X" then
mtitle = mtitle & skillcolors(skillid)
end if
Expand Down
2 changes: 1 addition & 1 deletion BSG Moderator Template/Basic/Standard/GameState.xml
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ sub NextTurn
MsgBox GetPlayerName(GetCurrentPlayer()) & " is in " & GetPlayerLoc(GetCurrentPlayer()) & " and only receives 1 card this turn.", 0, "Sickness"
elseif GetPlayerName(curmin) = "Doral" and IsInfiltrating(curmin) then
MsgBox "Doral is Infiltrating and draws two extra cards instead of one."
elseif GetPlayerName(curmin) = "Karl" and not IsGalacticaLoc(GetPlayerLoc(curmin)) then
elseif GetPlayerName(curmin) = "Karl" and not IsRevealed(curmin) and not IsGalacticaLoc(GetPlayerLoc(curmin)) then
MsgBox "Karl is not on Galactica and draws only 4 cards this turn."
else
if GameForm.getByName("chkAutoDraw").state = 1 then
Expand Down
6 changes: 3 additions & 3 deletions BSG Moderator Template/Basic/Standard/Ships.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1346,7 +1346,7 @@ sub LaunchRaiders
end if
end if
next shipID
SetCrisisFlag(FALSE, TRUE)
SetCrisisFlag(FALSE, "")
UpdateShips
end sub ' LaunchRaiders

Expand Down Expand Up @@ -1432,7 +1432,7 @@ sub RaiderActivation
LogThis "Raider moved from sector " & shipstatus & " to sector " & target
end if
next shipid
SetCrisisFlag(FALSE, TRUE)
SetCrisisFlag(FALSE, "")
UpdateShips

end sub ' RaiderActivation
Expand Down Expand Up @@ -1564,7 +1564,7 @@ sub HeavyActivation
end if
end if

SetCrisisFlag(FALSE, TRUE)
SetCrisisFlag(FALSE, "")
UpdateShips
end sub ' HeavyActivation

Expand Down
42 changes: 38 additions & 4 deletions BSG Moderator Template/Basic/Standard/Skills.xml
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ function CardInHand (playerID as integer, cardNo as integer, optional stripped)
handrow = _PlayerHandRow
end if

if IsMissing(stripped) then
if IsMissing(stripped) or stripped = FALSE then
CardInHand =SkillSheet.getCellByPosition(GetPlayerCol(playerID), handrow + cardNo - 1).string
else
CardInHand =StripColor(SkillSheet.getCellByPosition(GetPlayerCol(playerID), handrow + cardNo - 1).string)
Expand Down Expand Up @@ -844,6 +844,39 @@ sub CardSelected
end if
end sub

function RandomCardFromPlayer (player as integer) as integer
dim cardno as integer
GetSF

cardno = Int(RND()* HandCardCnt(player))+1
' We have to also copy this card to the clipboard (and warn the mod)
' FALSE means we won't strip the color codes
CopyToClipboard(CardInHand(player,cardno,FALSE))

RandomCardFromPlayer = cardno
end function

sub DiscardRandomFromHand
dim player, srccol, srcrow, cardno, rtncd as integer
dim cardtext, tmplst() as string

GetSF
player = GetSelected(_ListSkillPlayers)
if player = -1 or IsPlayerDestiny(player) or IsPlayerSkillCheck(player) then
MsgBox "Please select a player."
exit sub
end if

rtncd = MsgBox("Discard a random card from " & GetPlayerName(player) & "'s hand?", 4)
if rtncd <> 6 then
exit sub
end if
cardno = RandomCardFromPlayer(player)

msgbox GetPlayerName(player) & " discarded " & CardInHand(player, cardno, TRUE) & " (copied to clipboard)"
RemoveFromHand player, cardno, FALSE
end sub

sub DiscardFromHand
dim player, srccol, srcrow, cardno, rtncd as integer
dim cardtext, tmplst() as string
Expand All @@ -860,7 +893,7 @@ sub DiscardFromHand
elseif IsPlayerSkillCheck(player) then
player = _SkillCheckPlayerID
end if

if GetPlayerName(player) <> "Apollo" or IsRevealed(player) then
cardNo = GetSelected(_ListSkillCards)
if cardNo = -1 then
Expand All @@ -870,8 +903,9 @@ sub DiscardFromHand
else
rtncd = MsgBox ("Should this discard for Apollo be random? (Headstrong)",4)
if rtncd = 6 then
cardno= Int(RND()* HandCardCnt(player))+1
Msgbox "Apollo will discard: " & CardInHand(player,cardno,TRUE)
'cardno= Int(RND()* HandCardCnt(player))+1
cardno = RandomCardFromPlayer(player)
Msgbox "Apollo will discard: " & CardInHand(player,cardno,TRUE) & " (copied to clipboard)"
else
cardNo= GetSelected(_ListSkillCards)
if cardNo = -1 then
Expand Down
30 changes: 30 additions & 0 deletions BSG Moderator Template/Basic/Standard/Util.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,36 @@ const _PostAntRow = 30
const _GameThreadRow = 20
const _GameThreadCol = 0

' Script to place a text on the clipboard
global clipboard_string as string

sub CopyToClipboard (byval s as string)
dim sc, xt, null as object

sc = createUnoService ("com.sun.star.datatransfer.clipboard.SystemClipboard")
xt = createUnoListener ("clipboard_transferable_", "com.sun.star.datatransfer.XTransferable")
clipboard_string = s
sc.setcontents (xt, null)
end sub

function clipboard_transferable_getTransferData (df as com.sun.star.datatransfer.DataFlavor)
if (df.mimetype = "text/plain;charset=utf-16") then
clipboard_transferable_getTransferData = clipboard_string
end if
end function

function clipboard_transferable_getTransferDataFlavors
dim df as new com.sun.star.datatransfer.DataFlavor
df.mimetype = "text/plain;charset=utf-16"
df.humanpresentablename = "Unicode-Text"
clipboard_transferable_getTransferDataFlavors = array (df)
end function

function clipboard_transferable_isDataFlavorSupported (df as com.sun.star.datatransfer.DataFlavor) as boolean
clipboard_transferable_isDataFlavorSupported = (df.mimetype = "text/plain;charset=utf-16")
end function
' End of "copy a string to clipboard" functions

function GetSelected (listid as integer) as integer
dim tmplst() as string

Expand Down

0 comments on commit d63b99d

Please sign in to comment.