Initial commit

Initial commit [v9.7]
This commit is contained in:
Jaysyn904
2025-04-03 12:54:47 -04:00
parent ff5835fcc7
commit ebc0c6a9b2
11298 changed files with 9432842 additions and 2 deletions

View File

@@ -0,0 +1,33 @@
#include "gh_black_include"
void main() {
//Minimum bet, change this for a more expensive table =)
SetLocalInt(OBJECT_SELF, "MINIMUM_BET", 10);
//Take Players bet.
TakeGoldFromCreature(GetLocalInt(OBJECT_SELF, "MINIMUM_BET"), GetPCSpeaker(), FALSE);
//Initialize deck
InitializeDeck();
//Deal out cards one to Player then to Dealer, etc.
SetLocalInt(OBJECT_SELF, "PLAYER_CARD_1", Deal());
SetLocalInt(OBJECT_SELF, "DEALER_CARD_1", Deal());
SetLocalInt(OBJECT_SELF, "PLAYER_CARD_2", Deal());
SetLocalInt(OBJECT_SELF, "DEALER_CARD_2", Deal());
//Get the scores of the Player and Dealer hands.
SetLocalInt(OBJECT_SELF, "PlayerScore", GetScore("PLAYER"));
SetLocalInt(OBJECT_SELF, "DealerScore", GetScore("DEALER"));
//If one of the Players has a score of 21 already, they have a BLACKJACK.
//Announce it and proceed to check for a winner, no need to get player decision
//as a natural 21 beats a regular 21.
if(GetLocalInt(OBJECT_SELF, "PlayerScore") == 21 || GetLocalInt(OBJECT_SELF, "DealerScore") == 21) {
SetLocalInt(OBJECT_SELF, "CHECK_WINNER", TRUE);
}
else {
//Show the scores, but hide the Dealers first card.
ShowHandAndScores(FALSE);
}
}