Added stake select to tavern games

This commit is contained in:
Eddoursul 2024-02-15 16:20:20 +01:00
parent 5cba6f3c76
commit fdd9fa86ec
9 changed files with 110 additions and 47 deletions

BIN
Input fallback.esp Normal file

Binary file not shown.

Binary file not shown.

View File

@ -942,7 +942,7 @@ int Function Step01() ; place your bet
endif
endif
If PlayerBet > MaxBet || PlayerBet == 0
If PlayerBet > MaxBet || PlayerBet <= 0
Step01()
RETURN 0
EndIf

View File

@ -52,14 +52,39 @@ Function Step01()
OpponentScore = 0
if PlayerRef.GetItemcount(gold001) < Opponent.GetReference().GetItemCount(gold001)
MaxBet = PlayerRef.GetItemcount(gold001) /2
MaxBet = PlayerRef.GetItemcount(gold001) / 2
elseif PlayerRef.GetItemcount(gold001) >= Opponent.GetReference().GetItemCount(gold001)
MaxBet = Opponent.GetReference().GetItemcount(gold001) /2
MaxBet = Opponent.GetReference().GetItemcount(gold001) / 2
endif
if false && EnderalFunctions.TextInputEnabled()
PlayerBet = (((self as QUEST) as FORM) as UILIB_1).ShowTextInput(PlaceYourBet .GetName()+MaxBet, MaxBet) as int
else
float fPrevValue = PlayerRef.GetActorValue("Variable08")
PlayerRef.SetActorValue("Variable08", MaxBet)
int iBet = _SAG_SelectBetMessage.Show()
PlayerRef.SetActorValue("Variable08", fPrevValue)
if PlayerBet == 0
if iBet == 0
PlayerBet = 50
elseif iBet == 1
PlayerBet = 100
elseif iBet == 2
PlayerBet = 200
elseif iBet == 3
PlayerBet = 350
elseif iBet == 4
PlayerBet = 500
elseif iBet == 5
PlayerBet = 750
elseif iBet == 6
PlayerBet = 1000
else
PlayerBet = 0
endif
endif
if PlayerBet <= 0
QuitGame()
elseif PlayerBet > MaxBet
Step01()
@ -329,6 +354,7 @@ GlobalVariable Property _SAG_Activ_BJ_GoldWon Auto
GlobalVariable Property _SAG_Activ_BJ_Victories Auto
Message Property PlaceYourBet Auto
Message Property _SAG_SelectBetMessage Auto
String s_chargeninitialtext
Int OpponentTHrowing = 0
Int PlayerTHrowing = 0
@ -362,26 +388,3 @@ int MaxDice02
int MaxDice01
Bool OpponentPlayed = FALSE
Bool PlayerPlayed = FALSE

View File

@ -54,16 +54,45 @@ Function Step01()
ORandomDice2.Disable()
PRandomDice1.Disable()
PRandomDice2.Disable()
if PlayerRef.GetItemCount(Gold001) <= Opponent.GetReference().GetItemCount(Gold001)
if PlayerRef.GetItemCount(Gold001) <= Opponent.GetReference().GetItemCount(Gold001)
MaxBet = (PlayerRef.GetItemCount(Gold001)/2) as INT
elseif PlayerRef.GetItemCount(Gold001) > Opponent.GetReference().GetItemCount(Gold001)
elseif PlayerRef.GetItemCount(Gold001) > Opponent.GetReference().GetItemCount(Gold001)
MaxBet = (Opponent.GetReference().GetItemCount(Gold001)/2) as INT
endif
endif
if false && EnderalFunctions.TextInputEnabled()
PlayerBet = (((self as Quest) as form) as uilib_1).ShowTextInput(PlaceYourBet.GetName() + MaxBet as String, MaxBet as String) as Int
if PlayerBet > MaxBet || PlayerBet == 0
else
float fPrevValue = PlayerRef.GetActorValue("Variable08")
PlayerRef.SetActorValue("Variable08", MaxBet)
int iBet = _SAG_SelectBetMessage.Show()
PlayerRef.SetActorValue("Variable08", fPrevValue)
if iBet == 0
PlayerBet = 50
elseif iBet == 1
PlayerBet = 100
elseif iBet == 2
PlayerBet = 200
elseif iBet == 3
PlayerBet = 350
elseif iBet == 4
PlayerBet = 500
elseif iBet == 5
PlayerBet = 750
elseif iBet == 6
PlayerBet = 1000
else
QuitGame()
endif
endif
if PlayerBet > MaxBet || PlayerBet <= 0
Step01()
Return
endif
endif
OpponentBet = PlayerBet
Step02()
EndFunction
@ -172,11 +201,13 @@ Function QuitGame()
if Opponent.GetReference().IsDisabled()
Opponent.GetReference().Enable()
endif
if initialFurn
if initialFurn
PlayerRef.MoveTo(initialFurn)
else
else
PlayerRef.MoveTo(PlayerPosition)
endif
endif
Game.EnablePlayerControls()
game.SetInChargen(false, false, false)
Opponent.Clear()
@ -185,3 +216,4 @@ EndFunction
Message Property PlayAgain Auto
Message Property PlayerLost Auto
Message Property PlayerWon Auto
Message Property _SAG_SelectBetMessage Auto

View File

@ -44,8 +44,35 @@ int Function Step01() ; place your bet
else
MaxBet = (PlayerRef.GetItemCount(Gold001))/2
endif
if false && EnderalFunctions.TextInputEnabled()
PlayerBet = (((self as QUEST) as FORM) as UILIB_1).ShowTextInput(PlaceYourBet .GetName()+MaxBet, MaxBet) as int
if PlayerBet == 0
else
float fPrevValue = PlayerRef.GetActorValue("Variable08")
PlayerRef.SetActorValue("Variable08", MaxBet)
int iBet = _SAG_SelectBetMessage.Show()
PlayerRef.SetActorValue("Variable08", fPrevValue)
if iBet == 0
PlayerBet = 50
elseif iBet == 1
PlayerBet = 100
elseif iBet == 2
PlayerBet = 200
elseif iBet == 3
PlayerBet = 350
elseif iBet == 4
PlayerBet = 500
elseif iBet == 5
PlayerBet = 750
elseif iBet == 6
PlayerBet = 1000
else
PlayerBet = 0
endif
endif
if PlayerBet <= 0
FinishGameAndClearUp()
elseif PlayerBet > MaxBet
Step01()
@ -470,6 +497,7 @@ Actor Property Commentator Auto
Actor Property PlayerRef Auto
Message Property PlaceYourBet Auto
Message Property _SAG_SelectBetMessage Auto
GlobalVariable Property ExAequo Auto
GlobalVariable Property WonGames Auto