Revert item action bar

This commit is contained in:
Vortrex
2022-10-18 17:43:19 -05:00
parent c725852b0b
commit 2e2e44566d
2 changed files with 22 additions and 24 deletions

View File

@@ -11,8 +11,8 @@
let itemActionDelayDuration = 0;
let itemActionDelayStart = 0;
let itemActionDelayEnabled = false;
let itemActionDelayPosition = toVector2(0, game.height - 10);
let itemActionDelaySize = toVector2(game.width, 10);
let itemActionDelayPosition = toVector2(game.width / 2 - 100, game.height - 10);
let itemActionDelaySize = toVector2(200, 5);
// ===========================================================================

View File

@@ -118,20 +118,7 @@ function blackJackHitCommand(command, params, client) {
hand.push(deck.pop());
let tempHandValue = 0;
for (let i in hand) {
if (hand[i].value == 1) {
if ((tempHandValue + 11) > 21) {
tempHandValue += 1;
} else {
tempHandValue += 11;
}
} else {
tempHandValue += hand[i].value;
}
}
let tempHandValue = getValueOfBlackJackHand(hand);
if (handValue > 21) {
playerBustBlackJack(client);
@@ -155,14 +142,6 @@ function blackJackStandCommand(command, params, client) {
// ===========================================================================
function blackJackHit(hand, deck) {
return handValue;
}
// ===========================================================================
function dealPlayerBlackJackHand(deck, players) {
// Alternate handing cards to each player, 2 cards each
for (var i = 0; i < 2; i++) {
@@ -175,3 +154,22 @@ function dealPlayerBlackJackHand(deck, players) {
}
// ===========================================================================
function calculateValueOfBlackJackHand(hand) {
let tempHandValue = 0;
for (let i in hand) {
if (hand[i].value == 1) {
if ((tempHandValue + 11) > 21) {
tempHandValue += 1;
} else {
tempHandValue += 11;
}
} else {
tempHandValue += hand[i].value;
}
}
}
// ===========================================================================