Skip to content

Commit

Permalink
Merge branch 'Ionian-Earth'
Browse files Browse the repository at this point in the history
  • Loading branch information
Danilo Martins authored and Danilo Martins committed Jan 4, 2016
2 parents d63b99d + 28340af commit 672e5d8
Show file tree
Hide file tree
Showing 12 changed files with 140 additions and 58 deletions.
Binary file modified BSG Moderator Template.ods
Binary file not shown.
2 changes: 0 additions & 2 deletions BSG Moderator Template/Basic/Standard/Crisis.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ sub GetCrisisSheet

CrisisSheet= ThisComponent.Sheets.getByName("Crisis Cards")
CrisisForm = CrisisSheet.DrawPage.Forms.GetByName("formCrisis")

Randomize
end sub

function GetCrisisType (crisisID as integer) as integer
Expand Down
10 changes: 9 additions & 1 deletion BSG Moderator Template/Basic/Standard/Destination.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const _KobolDistance = 8
const _NewCapricaDistance = 7
const _IonianNebulaDistance = 8
const _EarthDistance = 10
const _IonianEarthDistance = 10
const _CivilWarDistance = 1
const _ColonyDistance = 7

Expand All @@ -52,7 +53,6 @@ sub GetDestn

DestnSheet= ThisComponent.Sheets.getByName("Destination Cards")
DestnForm = DestnSheet.DrawPage.Forms.GetByName("formDestination")
Randomize
end sub

function GetDestnBuryCnt as integer
Expand Down Expand Up @@ -504,6 +504,14 @@ sub HandleDistanceTriggers (optional legendary as boolean)
SetGamePhase _PhaseOnNewCaprica
SetDistanceTrigger(_DistanceTriggerEndgame)
end if
elseif ObjectiveIsIonianEarth() then
if GetTotalDistance() >=_IonianEarthDistance and not CheckDistanceTrigger(_DistanceTriggerEndgame) then
MsgBox "We have reached the CROSSROADS! One more jump to Earth!"
EnableDestButtons FALSE
DealCrossroads
BattleOfIonianNebula
SetDistanceTrigger(_DistanceTriggerEndgame)
end if
elseif ObjectiveIsIonianNebula() then
if GetTotalDistance() >=_IonianNebulaDistance and not CheckDistanceTrigger(_DistanceTriggerEndgame) then
MsgBox "We have reached the CROSSROADS!"
Expand Down
82 changes: 57 additions & 25 deletions BSG Moderator Template/Basic/Standard/GameState.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ sub GetGS

GameSheet = ThisComponent.Sheets.getByName("Game State")
GameForm = GameSheet.DrawPage.Forms.GetByName("formGameState")

Randomize
end sub

sub PopulatePlayers
Expand Down Expand Up @@ -539,7 +537,7 @@ end function

sub NextTurn
dim curmaj,curmin as integer
dim i, rtncd, playerid, cntr as integer
dim i, rtncd, playerid, cntr, skillid as integer
dim tmploc as string

GetGS
Expand Down Expand Up @@ -677,6 +675,9 @@ sub NextTurn

' Check if we have to automatically Draw the current player hand or just enable the respective button
GetSF
' Start by clearing up (setting to 0) the current player draw
ClearCPDrawnCount

SkillForm.getByName("btnDrawCurrentPlayerHand").enabled = FALSE
if GetPlayerName(curmin) = "Athena" and IsHazardous(GetPlayerLoc(curmin)) then
MsgBox "Athena is Grieving, and draws no cards this turn."
Expand Down Expand Up @@ -1377,10 +1378,13 @@ sub GalacticaReturns
end sub 'GalacticaReturns


sub SetJumpTrack (jumpstate as integer)
sub SetJumpTrack (jumpstate as integer, optional initial as boolean)
GetGS
dim i as integer
dim i, rtncd as integer
dim jpstr as variant
if IsMissing(initial) then
initial=FALSE
end if

GameSheet.GetCellByPosition(_JumpPrepCol+2, _JumpPrepRow+2).value = jumpstate

Expand All @@ -1395,6 +1399,13 @@ sub SetJumpTrack (jumpstate as integer)
SetCrisisFlag TRUE, ""
jpstr = Array("Start","Red 1","Red 2","Blue(-3)","Blue(-1)")
LogThis "Jump Prep track Set to " & jpstr(jumpstate)

if IsMutineer(GetCurrentPlayer) and not initial then
rtncd = MsgBox(GetPlayerName(GetCurrentPlayer) & " is the Mutineer. Do you want to draw a Mutiny now?", 4, "Mutineer")
if rtncd = 6 then
DrawMutiny(GetCurrentPlayer)
end if
end if
end sub 'SetJumpTrack


Expand Down Expand Up @@ -1444,7 +1455,6 @@ end sub
sub RandomDieRoll
dim diesize as integer
GetGS
Randomize

diesize = GameSheet.GetCellByPosition(_DieRollCol,_DieRollRow).value
MsgBox "Random # from 1 - " & diesize & " = " & Int(RND()*diesize)+1,0,"Die Roll"
Expand Down Expand Up @@ -1623,6 +1633,7 @@ function RepairLocation (dmgstr as string)
GameForm.getByName("btnRepairGalactica").enabled=FALSE
end if
LogThis dmgstr & " REPAIRED"
ShuffleDamage
Board_RefreshLocationDamage
end function 'RepairLocation

Expand All @@ -1645,7 +1656,6 @@ sub RepairGalactica
end if

RepairLocation dmgstr
ShuffleDamage
end sub 'RepairGalactica


Expand Down Expand Up @@ -1778,24 +1788,10 @@ sub DamagePegasus
end if
end sub 'DamagePegasus


sub RepairPegasus
function RepairPegasusLocation (dmgstr as string)
dim dmgID, dmgcnt, rtncd, i,j as integer
dim dmgstr, tmpstr as string
dim tmpstr as string
dim dmgloclst(4) as string

GetGS
dmgID = GetSelected(_ListGameDamagedPeg)
if dmgID = -1 then
MsgBox "Please select a location to REPAIR."
exit sub
end if
dmgstr = GameForm.getByName("lstDamagedPeg").StringItemList(dmgid)

rtncd = MsgBox ("REPAIR the " & dmgstr & "?",4)
if rtncd <> 6 then
exit sub
end if

'find the actual location
for i = 1 to 4
Expand Down Expand Up @@ -1823,9 +1819,29 @@ sub RepairPegasus
GameForm.getByName("btnRepairPegasus").enabled=FALSE
end if
LogThis dmgstr & " REPAIRED"
ShuffleDamagePeg
Board_RefreshLocationDamage
end function

sub RepairPegasus
dim dmgID, dmgcnt, rtncd, i,j as integer
dim dmgstr, tmpstr as string
dim dmgloclst(4) as string

GetGS
dmgID = GetSelected(_ListGameDamagedPeg)
if dmgID = -1 then
MsgBox "Please select a location to REPAIR."
exit sub
end if
dmgstr = GameForm.getByName("lstDamagedPeg").StringItemList(dmgid)

ShuffleDamagePeg
rtncd = MsgBox ("REPAIR the " & dmgstr & "?",4)
if rtncd <> 6 then
exit sub
end if

RepairPegasusLocation dmgstr
end sub 'RepairPegasus


Expand Down Expand Up @@ -2045,7 +2061,7 @@ sub Initialize_GameState
GameSheet.GetCellByPosition(_JumpPrepCol+jumpstate, _JumpPrepRow).string = ""
end if
next jumpstate
SetJumpTrack 0
SetJumpTrack 0, TRUE
SetPursuitTrack 0

' clear any damage and shuffle the Galactia Damage tokens
Expand Down Expand Up @@ -2091,6 +2107,8 @@ sub Initialize_GameState
SetGamePhase _PhaseInSpace
if ObjectiveIsColony() then
GameSheet.GetCellByPosition(_GamePhaseTextCol,_GamePhaseTextRow+3).string = "Colony"
elseif ObjectiveIsIonianEarth() then
GameSheet.GetCellByPosition(_GamePhaseTextCol,_GamePhaseTextRow+3).string = "Ionian Earth"
elseif ObjectiveIsEarth() then
GameSheet.GetCellByPosition(_GamePhaseTextCol,_GamePhaseTextRow+3).string = "Earth"
elseif ObjectiveIsNewCaprica() then
Expand Down Expand Up @@ -2678,4 +2696,18 @@ sub SetModuleFlags
GameSheet.getCellByPosition(_ModuleCol, _ModuleRow + _ModuleCCW).string = "X"
end if
end sub

sub SetDispatchButtons (state as boolean)
GetGS

GameForm.getByName("btnDispatchSelected").enabled = state
GameForm.getByName("btnDispatchAll").enabled = state
end sub

sub CreateHandList
SetDispatchButtons FALSE
GenerateHandLists
SetDispatchButtons TRUE
end sub

</script:module>
7 changes: 6 additions & 1 deletion BSG Moderator Template/Basic/Standard/IonNeb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,14 @@ end sub &apos;Initialize_IonianNebula

sub UpdateTTTargetList
dim targetlist(3), target as string
dim ally, allyID as integer
dim ally, allyID, totdist as integer
GetIonNeb

totdist = 8
if ObjectiveIsIonianEarth then
totdist = 10
end if

if GetTotalDistance() &lt; 8 then
for ally = 1 to 3
allyID = GetAvailableAlly - 4 + ally
Expand Down
1 change: 0 additions & 1 deletion BSG Moderator Template/Basic/Standard/Loyalty.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ sub GetLoyalty

LoyaltySheet= ThisComponent.Sheets.getByName(&quot;Loyalty&quot;)
LoyaltyForm = LoyaltySheet.DrawPage.Forms.GetByName(&quot;formLoyalty&quot;)
Randomize
end sub

function PlayerLoyaltyCol (playerID as integer) as integer
Expand Down
20 changes: 17 additions & 3 deletions BSG Moderator Template/Basic/Standard/Setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const _ObjectiveNewCaprica = 1
const _ObjectiveIonianNebula = 2
const _ObjectiveEarth = 3
const _ObjectiveColony = 4
const _ObjectiveIonianEarth = 5

const _SympathizerNONE = 0
const _Sympathizer = 1
Expand Down Expand Up @@ -171,11 +172,15 @@ function ObjectiveIsKobol as boolean
end function

function ObjectiveIsIonianNebula as boolean
ObjectiveIsIonianNebula = (GetObjective() = _ObjectiveIonianNebula)
ObjectiveIsIonianNebula = (GetObjective() = _ObjectiveIonianNebula or GetObjective() = _ObjectiveIonianEarth)
end function

function ObjectiveIsEarth as boolean
ObjectiveIsEarth = (GetObjective() = _ObjectiveEarth)
ObjectiveIsEarth = (GetObjective() = _ObjectiveEarth or GetObjective() = _ObjectiveIonianEarth)
end function

function ObjectiveIsIonianEarth as boolean
ObjectiveIsIonianEarth = (GetObjective() = _ObjectiveIonianEarth)
end function

function ObjectiveIsColony as boolean
Expand Down Expand Up @@ -628,6 +633,9 @@ sub Step3Complete
if GameTypeIsRevelations then
&apos; grpOpt(_ObjectiveColony).enabled = TRUE
end if
if GameTypeIsDaybreak and GameTypeIsExodus then
grpOpt(_ObjectiveIonianEarth).enabled = TRUE
end if

&apos; Set up Sympathizer/Cylon Leader options
if ((PlayerCnt() = 4 or PlayerCnt() = 6) and NOT HasLeader()) or (GameTypeIsDaybreak and (PlayerCnt = 5 or PlayerCnt = 7) and HasLeader) then
Expand Down Expand Up @@ -701,13 +709,19 @@ sub Initialize_Game
if VariantFlaws() and UsePersonalGoals() then
MsgBox(&quot;It is not recommended to use both Flaws and Personal Goals in the same game.&quot;)
end if

&apos; oh, and you need to confirm a couple of times...
rtncd = MsgBox (&quot;Do you really want to Initialize the game?&quot;,4,&quot;COMPLETE SETUP&quot;)
if rtncd &lt;&gt; 6 then
exit sub
end if

&apos; I&apos;ve read this is necessary to circumvent this crappy RNG
Randomize
RND
RND
RND

SetInitFlag TRUE

for taskID = 1 to 13
Expand Down
1 change: 0 additions & 1 deletion BSG Moderator Template/Basic/Standard/Ships.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ sub GetShipSheet
ShipForm = ShipSheet.DrawPage.Forms.GetByName(&quot;formShips&quot;)

PopulateShipLoc
Randomize
end sub


Expand Down
Loading

0 comments on commit 672e5d8

Please sign in to comment.